About Jd2chm...

The project files of this HTML Help
Were generated with Jd2chm version 0.34
Copyright © 2006-2009 Xiaoxiang Li

And the original Jd2chm version 0.30
Copyright © 2000-2003 Andre Burgaud
http://www.burgaud.com


Overview

Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Packages
org.springframework.aop | Core Spring AOP interfaces, built on AOP Alliance AOP interoperability interfaces.
org.springframework.aop.aspectj | AspectJ integration package.
org.springframework.aop.aspectj.annotation | Classes enabling AspectJ 5 @Annotated classes to be used in Spring AOP.
org.springframework.aop.aspectj.autoproxy | Base classes enabling auto-proxying based on AspectJ.
org.springframework.aop.config | Support package for declarative AOP configuration, with XML schema being the primary configuration format.
org.springframework.aop.framework | Package containing Spring's basic AOP infrastructure, compliant with the AOP Alliance interfaces.
org.springframework.aop.framework.adapter | SPI package allowing Spring AOP framework to handle arbitrary advice types.
org.springframework.aop.framework.autoproxy | Bean post-processors for use in ApplicationContexts to simplify AOP usage by automatically creating AOP proxies without the need to use a ProxyFactoryBean.
org.springframework.aop.framework.autoproxy.target | Generic support classes for target source creation.
org.springframework.aop.interceptor | Provides miscellaneous interceptor implementations.
org.springframework.aop.scope | Support for AOP-based scoping of target objects, with configurable backend.
org.springframework.aop.support | Convenience classes for using Spring's AOP API.
org.springframework.aop.support.annotation | Annotation support for AOP pointcuts.
org.springframework.aop.target | This package contains implementations of the org.springframework.aop.TargetSource interface.
org.springframework.aop.target.dynamic | Support for AOP-based refreshing of target objects.
org.springframework.beans | This package contains interfaces and classes for manipulating Java beans.
org.springframework.beans.annotation | Support package for beans-style handling of Java 5 annotations.
org.springframework.beans.factory | The core package implementing Spring's lightweight Inversion of Control (IoC) container.
org.springframework.beans.factory.access | Helper infrastructure to locate and access bean factories.
org.springframework.beans.factory.access.el | Support classes for accessing a Spring BeanFactory from Unified EL.
org.springframework.beans.factory.annotation | Support package for annotation-driven bean configuration.
org.springframework.beans.factory.aspectj |
org.springframework.beans.factory.config | SPI interfaces and configuration-related convenience classes for bean factories.
org.springframework.beans.factory.parsing | Support infrastructure for bean definition parsing.
org.springframework.beans.factory.serviceloader | Support package for the JDK 1.6 ServiceLoader facility.
org.springframework.beans.factory.support | Classes supporting the org.springframework.beans.factory package.
org.springframework.beans.factory.wiring | Mechanism to determine bean wiring metadata from a bean instance.
org.springframework.beans.factory.xml | Contains an abstract XML-based BeanFactory implementation, including a standard "spring-beans" DTD.
org.springframework.beans.propertyeditors | Properties editors used to convert from String values to object types such as java.util.Properties.
org.springframework.beans.support | Classes supporting the org.springframework.beans package, such as utility classes for sorting and holding lists of beans.
org.springframework.cache.ehcache | Support classes for the open source cache EHCache, allowing to set up an EHCache CacheManager and Caches as beans in a Spring context.
org.springframework.context | This package builds on the beans package to add support for message sources and for the Observer design pattern, and the ability for application objects to obtain resources using a consistent API.
org.springframework.context.access | Helper infrastructure to locate and access shared application contexts.
org.springframework.context.annotation | Annotation support for the Application Context, including JSR-250 "common" annotations, component-scanning, and Java-based metadata for creating Spring-managed objects.
org.springframework.context.config | Support package for advanced application context configuration, with XML schema being the primary configuration format.
org.springframework.context.event | Support classes for application events, like standard context events.
org.springframework.context.expression | Expression parsing support within a Spring application context.
org.springframework.context.i18n | Abstraction for determining the current Locale, plus global holder that exposes a thread-bound Locale.
org.springframework.context.support | Classes supporting the org.springframework.context package, such as abstract base classes for ApplicationContext implementations and a MessageSource implementation.
org.springframework.context.weaving | Load-time weaving support for a Spring application context, building on Spring's LoadTimeWeaver abstraction.
org.springframework.core | Provides basic classes for exception handling and version detection, and other core helpers that are not specific to any part of the framework.
org.springframework.core.annotation | Core support package for Java 5 annotations.
org.springframework.core.convert | Type conversion system API.
org.springframework.core.convert.converter | SPI to implement Converters.
org.springframework.core.convert.support | TypeConverter system implementation.
org.springframework.core.enums | Interfaces and classes for type-safe enum support on JDK >= 1.3.
org.springframework.core.io | Generic abstraction for (file-based) resources, used throughout the framework.
org.springframework.core.io.support | Support classes for Spring's resource abstraction.
org.springframework.core.style | Support for styling values as Strings, with ToStringCreator as central class.
org.springframework.core.task | This package defines Spring's core TaskExecutor abstraction, and provides SyncTaskExecutor and SimpleAsyncTaskExecutor implementations.
org.springframework.core.task.support | Support classes for Spring's TaskExecutor abstraction.
org.springframework.core.type | Core support package for type introspection.
org.springframework.core.type.classreading | Support classes for reading annotation and class-level metadata.
org.springframework.core.type.filter | Core support package for type filtering (e.g.
org.springframework.dao | Exception hierarchy enabling sophisticated error handling independent of the data access approach in use.
org.springframework.dao.annotation | Annotation support for DAOs.
org.springframework.dao.support | Support classes for DAO implementations, providing miscellaneous utility methods.
org.springframework.ejb.access | This package contains classes that allow easy access to EJBs.
org.springframework.ejb.config | Support package for EJB/J2EE-related configuration, with XML schema being the primary configuration format.
org.springframework.ejb.interceptor | Support classes for EJB 3 Session Beans and Message-Driven Beans, performing injection of Spring beans through an EJB 3 interceptor that processes Spring's @Autowired annotation.
org.springframework.ejb.support | Base classes to make implementing EJB 2.x beans simpler and less error-prone, as well as guaranteeing a Spring BeanFactory is available to such EJBs.
org.springframework.expression |
org.springframework.expression.common |
org.springframework.expression.spel |
org.springframework.expression.spel.ast |
org.springframework.expression.spel.standard |
org.springframework.expression.spel.support |
org.springframework.format | An API for defining Formatters to format field model values for display in a UI.
org.springframework.format.annotation | Annotations for declaratively configuring field formatting rules.
org.springframework.format.datetime | Formatters for java.util.Date properties.
org.springframework.format.datetime.joda | Integration with the Joda Time for formatting Joda types as well as standard JDK Date types.
org.springframework.format.number | Formatters for java.lang.Number properties.
org.springframework.format.support | Support classes for the formatting package, providing common implementations as well as adapters.
org.springframework.http | Contains a basic abstraction over client/server-side HTTP.
org.springframework.http.client | Contains an abstraction over client-side HTTP.
org.springframework.http.client.support | This package provides generic HTTP support classes, to be used by higher-level classes like RestTemplate.
org.springframework.http.converter | Provides an HttpMessageConverter abstraction to convert between Java objects and HTTP input/output messages.
org.springframework.http.converter.feed | Provides HttpMessageConverter implementations for handling Atom and RSS feeds.
org.springframework.http.converter.json | Provides an HttpMessageConverter implementations for handling JSON.
org.springframework.http.converter.xml | Provides an HttpMessageConverter implementations for handling XML.
org.springframework.http.server | Contains an abstraction over server-side HTTP.
org.springframework.instrument |
org.springframework.instrument.classloading | Support package for load time weaving based on class loaders, as required by JPA providers (but not JPA-specific).
org.springframework.instrument.classloading.glassfish | Support for class instrumentation on GlassFish / Sun Application Server.
org.springframework.instrument.classloading.jboss | Support for class instrumentation on JBoss AS 5.x / JBoss MC 2.0.x.
org.springframework.instrument.classloading.oc4j | Support for class instrumentation on Oracle OC4J.
org.springframework.instrument.classloading.tomcat | Support for class instrumentation on Apache Tomcat.
org.springframework.instrument.classloading.weblogic | Support for class instrumentation on BEA WebLogic 10.
org.springframework.jca.cci | This package contains Spring's support for the Common Client Interface (CCI), as defined by the J2EE Connector Architecture.
org.springframework.jca.cci.connection | Provides a utility class for easy ConnectionFactory access, a PlatformTransactionManager for local CCI transactions, and various simple ConnectionFactory proxies/adapters.
org.springframework.jca.cci.core | Provides the core JCA CCI support, based on CciTemplate and its associated callback interfaces.
org.springframework.jca.cci.core.support | Classes supporting the org.springframework.jca.cci.core package.
org.springframework.jca.cci.object | The classes in this package represent EIS operations as threadsafe, reusable objects.
org.springframework.jca.context | Integration package that allows for deploying a Spring application context as a JCA 1.5 compliant RAR file.
org.springframework.jca.endpoint | This package provides a facility for generic JCA message endpoint management.
org.springframework.jca.support | Provides generic support classes for JCA usage within Spring, mainly for local setup of a JCA ResourceAdapter and/or ConnectionFactory.
org.springframework.jca.work | Convenience classes for scheduling based on the JCA 1.5 WorkManager facility, as supported within JCA 1.5 ResourceAdapters.
org.springframework.jca.work.glassfish | Convenience package for obtaining a GlassFish JCA WorkManager for use in web applications.
org.springframework.jca.work.jboss | Convenience package for obtaining a JBoss JCA WorkManager for use in web applications.
org.springframework.jdbc | The classes in this package make JDBC easier to use and reduce the likelihood of common errors.
org.springframework.jdbc.config | Defines the Spring JDBC configuration namespace.
org.springframework.jdbc.core | Provides the core JDBC framework, based on JdbcTemplate and its associated callback interfaces and helper objects.
org.springframework.jdbc.core.metadata | Context metadata abstraction for the configuration and execution of a stored procedure call.
org.springframework.jdbc.core.namedparam | JdbcTemplate variant with named parameter support.
org.springframework.jdbc.core.simple | Simplification layer over JdbcTemplate for Java 5 and above.
org.springframework.jdbc.core.support | Classes supporting the org.springframework.jdbc.core package.
org.springframework.jdbc.datasource | Provides a utility class for easy DataSource access, a PlatformTransactionManager for a single DataSource, and various simple DataSource implementations.
org.springframework.jdbc.datasource.embedded | Provides extensible support for creating embedded database instances.
org.springframework.jdbc.datasource.init |
org.springframework.jdbc.datasource.lookup | Provides a strategy for looking up JDBC DataSources by name.
org.springframework.jdbc.object | The classes in this package represent RDBMS queries, updates, and stored procedures as threadsafe, reusable objects.
org.springframework.jdbc.support | Support classes for the JDBC framework, used by the classes in the jdbc.core and jdbc.object packages.
org.springframework.jdbc.support.incrementer | Provides a support framework for incrementing database table values via sequences, with implementations for various databases.
org.springframework.jdbc.support.lob | Provides a stategy interface for Large OBject handling, with implementations for various databases.
org.springframework.jdbc.support.nativejdbc | Provides a mechanism for extracting native implementations of JDBC interfaces from wrapper objects that got returned from connection pools.
org.springframework.jdbc.support.rowset | Provides a convenient holder for disconnected result sets.
org.springframework.jdbc.support.xml | Abstraction for handling fields of SQLXML data type.
org.springframework.jms | This package contains integration classes for JMS, allowing for Spring-style JMS access.
org.springframework.jms.config | Support package for declarative messaging configuration, with XML schema being the primary configuration format.
org.springframework.jms.connection | Provides a PlatformTransactionManager implementation for a single JMS ConnectionFactory, and a SingleConnectionFactory adapter.
org.springframework.jms.core | Core package of the JMS support.
org.springframework.jms.core.support | Classes supporting the org.springframework.jms.core package.
org.springframework.jms.listener | This package contains the base message listener container facility.
org.springframework.jms.listener.adapter | Message listener adapter mechanism that delegates to target listener methods, converting messages to appropriate message content types (such as String or byte array) that get passed into listener methods.
org.springframework.jms.listener.endpoint | This package provides JCA-based endpoint management for JMS message listeners.
org.springframework.jms.remoting | Remoting classes for transparent Java-to-Java remoting via a JMS provider.
org.springframework.jms.support | This package provides generic JMS support classes, to be used by higher-level classes like JmsTemplate.
org.springframework.jms.support.converter | Provides a MessageConverter abstraction to convert between Java objects and JMS messages.
org.springframework.jms.support.destination | Support classes for Spring's JMS framework.
org.springframework.jmx | This package contains Spring's JMX support, which includes registration of Spring-managed beans as JMX MBeans as well as access to remote JMX MBeans.
org.springframework.jmx.access | Provides support for accessing remote MBean resources.
org.springframework.jmx.export | This package provides declarative creation and registration of Spring-managed beans as JMX MBeans.
org.springframework.jmx.export.annotation | JDK 1.5+ annotations for MBean exposure.
org.springframework.jmx.export.assembler | Provides a strategy for MBeanInfo assembly.
org.springframework.jmx.export.metadata | Provides generic JMX metadata classes and basic support for reading JMX metadata in a provider-agnostic manner.
org.springframework.jmx.export.naming | Provides a strategy for ObjectName creation.
org.springframework.jmx.export.notification | Provides supporting infrastructure to allow Spring-created MBeans to send JMX notifications.
org.springframework.jmx.support | Contains support classes for connecting to local and remote MBeanServers and for exposing an MBeanServer to remote clients.
org.springframework.jndi | The classes in this package make JNDI easier to use, facilitating the accessing of configuration stored in JNDI, and provide useful superclasses for JNDI access classes.
org.springframework.jndi.support | Support classes for JNDI usage, including a JNDI-based BeanFactory implementation.
org.springframework.mail | Spring's generic mail infrastructure.
org.springframework.mail.javamail | JavaMail support for Spring's mail infrastructure.
org.springframework.mock.jndi | The simplest implementation of the JNDI SPI that could possibly work.
org.springframework.mock.staticmock |
org.springframework.mock.web | A comprehensive set of Servlet API 2.5 mock objects, targeted at usage with Spring's web MVC framework.
org.springframework.mock.web.portlet | A comprehensive set of Portlet API 2.0 mock objects, targeted at usage with Spring's web MVC framework.
org.springframework.orm | Root package for Spring's O/R Mapping integration classes.
org.springframework.orm.hibernate3 | Package providing integration of Hibernate3 with Spring concepts.
org.springframework.orm.hibernate3.annotation | Support package for the Hibernate3 Annotation add-on, which supports EJB3-compliant JDK 1.5+ annotations for mappings.
org.springframework.orm.hibernate3.support | Classes supporting the org.springframework.orm.hibernate3 package.
org.springframework.orm.ibatis | Package providing integration of iBATIS Database Layer with Spring concepts.
org.springframework.orm.ibatis.support | Classes supporting the org.springframework.orm.ibatis package.
org.springframework.orm.jdo | Package providing integration of JDO (Java Date Objects) with Spring concepts.
org.springframework.orm.jdo.support | Classes supporting the org.springframework.orm.jdo package.
org.springframework.orm.jpa | Package providing integration of JPA (Java Persistence API) with Spring concepts.
org.springframework.orm.jpa.persistenceunit | Internal support for managing JPA persistence units.
org.springframework.orm.jpa.support | Classes supporting the org.springframework.orm.jpa package.
org.springframework.orm.jpa.vendor | Support classes for adapting to specific JPA vendors.
org.springframework.oxm | Root package for Spring's O/X Mapping integration classes.
org.springframework.oxm.castor | Package providing integration of Castor within Springs O/X Mapping support
org.springframework.oxm.config | Provides an namespace handler for the Spring Object/XML namespace
org.springframework.oxm.jaxb | Package providing integration of JAXB with Springs O/X Mapping support
org.springframework.oxm.jibx | Package providing integration of JiBX with Springs O/X Mapping support
org.springframework.oxm.mime | Contains (un)marshallers optimized to store binary data in MIME attachments.
org.springframework.oxm.support | Provides generic support classes for using Spring's O/X Mapping integration within various scenario's.
org.springframework.oxm.xmlbeans | Package providing integration of XMLBeans with Springs O/X Mapping support
org.springframework.oxm.xstream | Package providing integration of XStream with Springs O/X Mapping support
org.springframework.remoting | Exception hierarchy for Spring's remoting infrastructure, independent of any specific remote method invocation system.
org.springframework.remoting.caucho | This package provides remoting classes for Caucho's Hessian and Burlap protocols: a proxy factory for accessing Hessian/Burlap services, and an exporter for making beans available to Hessian/Burlap clients.
org.springframework.remoting.httpinvoker | Remoting classes for transparent Java-to-Java remoting via HTTP invokers.
org.springframework.remoting.jaxrpc | Remoting classes for Web Services via JAX-RPC.
org.springframework.remoting.jaxws | Remoting classes for Web Services via JAX-WS (the successor of JAX-RPC), as included in Java 6 and Java EE 5.
org.springframework.remoting.rmi | Remoting classes for conventional RMI and transparent remoting via RMI invokers.
org.springframework.remoting.soap | SOAP-specific exceptions and support classes for Spring's remoting subsystem.
org.springframework.remoting.support | Generic support classes for remoting implementations.
org.springframework.scheduling | General exceptions for Spring's scheduling support, independent of any specific scheduling system.
org.springframework.scheduling.annotation | JDK 1.5+ annotation for asynchronous method execution.
org.springframework.scheduling.backportconcurrent | Scheduling convenience classes for the JSR-166 backport Executor mechanism, allowing to set up a ThreadPoolExecutor as a TaskExecutor-compliant bean in a Spring context.
org.springframework.scheduling.commonj | Convenience classes for scheduling based on the CommonJ WorkManager/TimerManager facility, as supported by IBM WebSphere 6.0+ and BEA WebLogic 9.0+.
org.springframework.scheduling.concurrent | Scheduling convenience classes for the JDK 1.5+ Executor mechanism in the java.util.concurrent package, allowing to set up a ThreadPoolExecutor or ScheduledThreadPoolExecutor as a bean in a Spring context.
org.springframework.scheduling.config |
org.springframework.scheduling.quartz | Support classes for the open source scheduler Quartz, allowing to set up Quartz Schedulers, JobDetails and Triggers as beans in a Spring context.
org.springframework.scheduling.support | Generic support classes for scheduling.
org.springframework.scheduling.timer | Scheduling convenience classes for the JDK Timer, allowing to set up Timers and ScheduledTimerTasks as beans in a Spring context.
org.springframework.scripting | Core interfaces for Spring's scripting support.
org.springframework.scripting.bsh | Package providing integration of BeanShell into Spring's scripting infrastructure.
org.springframework.scripting.config | Support package for Spring's dynamic language machinery, with XML schema being the primary configuration format.
org.springframework.scripting.groovy | Package providing integration of Groovy into Spring's scripting infrastructure.
org.springframework.scripting.jruby | Package providing integration of JRuby into Spring's scripting infrastructure.
org.springframework.scripting.support | Support classes for Spring's scripting package.
org.springframework.stereotype | Annotations denoting the roles of types or methods in the overall architecture (at a conceptual, rather than implementation, level).
org.springframework.test | This package contains the legacy JUnit 3.8 class hierarchy, which as of Spring 3.0 has been deprecated in favor of using the listener-based Spring TestContext Framework.
org.springframework.test.annotation | Support classes for annotation-driven tests.
org.springframework.test.context | This package contains the Spring TestContext Framework which provides annotation-driven unit and integration testing support that is agnostic of the actual testing framework in use.
org.springframework.test.context.junit38 | Support classes for ApplicationContext-based and transactional tests run with JUnit 3.8 and the Spring TestContext Framework.
org.springframework.test.context.junit4 | Support classes for ApplicationContext-based and transactional tests run with JUnit 4.5+ and the Spring TestContext Framework.
org.springframework.test.context.junit4.statements | JUnit 4.5 based statements used in the Spring TestContext Framework.
org.springframework.test.context.support | Support classes for the Spring TestContext Framework.
org.springframework.test.context.testng | Support classes for ApplicationContext-based and transactional tests run with TestNG and the Spring TestContext Framework.
org.springframework.test.context.transaction | Transactional support classes for the Spring TestContext Framework.
org.springframework.test.jdbc | Support classes for tests based on JDBC.
org.springframework.test.jpa | As of Spring 3.0, this package has been deprecated in favor of using the listener-based Spring TestContext Framework.
org.springframework.test.util | Helper classes for unit tests with reflective needs.
org.springframework.test.web | Helper classes for unit tests based on Spring's web support.
org.springframework.transaction | Exception hierarchy for Spring's transaction infrastructure, independent of any specific transaction management system.
org.springframework.transaction.annotation | JDK 1.5+ annotation for transaction demarcation.
org.springframework.transaction.config | Support package for declarative transaction configuration, with XML schema being the primary configuration format.
org.springframework.transaction.interceptor | AOP-based solution for declarative transaction demarcation.
org.springframework.transaction.jta | Transaction SPI implementation for JTA.
org.springframework.transaction.support | Support classes for the org.springframework.transaction package.
org.springframework.ui | Generic support for UI layer concepts.
org.springframework.ui.context | Contains classes defining the application context subinterface for UI applications.
org.springframework.ui.context.support | Classes supporting the org.springframework.ui.context package.
org.springframework.ui.freemarker | Support classes for setting up FreeMarker within a Spring application context.
org.springframework.ui.jasperreports | Support classes for JasperReports.
org.springframework.ui.velocity | Support classes for setting up Velocity within a Spring application context.
org.springframework.util | Miscellaneous utility classes, such as String manipulation utilities, a Log4J configurer, and a state holder for paged lists of objects.
org.springframework.util.comparator | Useful generic java.util.Comparator implementations, such as an invertible comparator and a compound comparator.
org.springframework.util.xml | Miscellaneous utility classes for XML parsing and transformation, such as error handlers that log warnings via Commons Logging.
org.springframework.validation | Provides data binding and validation functionality, for usage in business and/or UI layers.
org.springframework.validation.beanvalidation | Support classes for integrating a JSR-303 Bean Validation provider (such as Hibernate Validator 4.0) into a Spring ApplicationContext and in particular with Spring's data binding and validation APIs.
org.springframework.validation.support | Support classes for handling validation results.
org.springframework.web | Common, generic interfaces that define minimal boundary points between Spring's web infrastructure and other framework modules.
org.springframework.web.bind | Provides web-specific data binding functionality.
org.springframework.web.bind.annotation | Annotations for binding requests to controllers and handler methods as well as for binding request parameters to method arguments.
org.springframework.web.bind.annotation.support | Support classes for web annotation processing.
org.springframework.web.bind.support | Support classes for web data binding.
org.springframework.web.client | Core package of the client-side web support.
org.springframework.web.client.support | Classes supporting the org.springframework.web.client package.
org.springframework.web.context | Contains a variant of the application context interface for web applications, and the ContextLoaderListener that bootstraps a root web application context.
org.springframework.web.context.request | Support for generic request context holding, in particular for scoping of application objects per HTTP request or HTTP session.
org.springframework.web.context.support | Classes supporting the org.springframework.web.context package, such as WebApplicationContext implementations and various utility classes.
org.springframework.web.filter | Provides generic filter base classes allowing for bean-style configuration.
org.springframework.web.jsf | Support classes for integrating a JSF web tier with a Spring middle tier which is hosted in a Spring root WebApplicationContext.
org.springframework.web.jsf.el | Support classes for integrating a JSF 1.2 web tier with a Spring middle tier which is hosted in a Spring root WebApplicationContext.
org.springframework.web.multipart | Multipart resolution framework for handling file uploads.
org.springframework.web.multipart.commons | MultipartResolver implementation for Jakarta Commons FileUpload.
org.springframework.web.multipart.support | Support classes for the multipart resolution framework.
org.springframework.web.portlet | Provides JSR-168 portlets that integrate with the application context infrastructure, and the core interfaces and classes for the Portlet variant of Spring's web MVC framework.
org.springframework.web.portlet.bind | Provides portlet-specific data binding functionality.
org.springframework.web.portlet.bind.annotation | Annotations for binding portlet requests to handler methods.
org.springframework.web.portlet.context | Support for Spring's application context concept in a portlet environment, including ApplicationContext implementations and various utility classes.
org.springframework.web.portlet.handler | Provides standard HandlerMapping implementations, including abstract base classes for custom implementations.
org.springframework.web.portlet.multipart | Multipart resolution framework for handling file uploads.
org.springframework.web.portlet.mvc | Standard controller implementations for the portlet MVC framework that comes with Spring.
org.springframework.web.portlet.mvc.annotation | Support package for annotation-based Portlet MVC controllers.
org.springframework.web.portlet.util | Miscellaneous portlet utility classes.
org.springframework.web.servlet | Provides servlets that integrate with the application context infrastructure, and the core interfaces and classes for the Spring web MVC framework.
org.springframework.web.servlet.config | Defines the Spring MVC configuration namespace.
org.springframework.web.servlet.handler | Provides standard HandlerMapping implementations, including abstract base classes for custom implementations.
org.springframework.web.servlet.i18n | Locale support classes for Spring's web MVC framework.
org.springframework.web.servlet.mvc | Standard controller implementations for the servlet MVC framework that comes with Spring.
org.springframework.web.servlet.mvc.annotation | Support package for annotation-based Servlet MVC controllers.
org.springframework.web.servlet.mvc.multiaction | Package allowing MVC Controller implementations to handle requests at method rather than class level.
org.springframework.web.servlet.mvc.support | Support package for MVC controllers.
org.springframework.web.servlet.support | Support classes for Spring's web MVC framework.
org.springframework.web.servlet.tags | Spring's JSP standard tag library for JSP 2.0+.
org.springframework.web.servlet.tags.form | Spring's form tag library for JSP 2.0+.
org.springframework.web.servlet.theme | Theme support classes for Spring's web MVC framework.
org.springframework.web.servlet.view | Provides standard View and ViewResolver implementations, including abstract base classes for custom implementations.
org.springframework.web.servlet.view.document | Support classes for document generation, providing View implementations for PDF and Excel.
org.springframework.web.servlet.view.feed | Support classes for feed generation, providing View implementations for Atom and RSS
org.springframework.web.servlet.view.freemarker | Support classes for the integration of FreeMarker as Spring web view technology.
org.springframework.web.servlet.view.jasperreports | Support classes for the integration of JasperReports as Spring web view technology.
org.springframework.web.servlet.view.json | Support classes for providing a View implementation based on JSON serialization.
org.springframework.web.servlet.view.tiles | Support classes for the integration of Tiles (included in Struts) as Spring web view technology.
org.springframework.web.servlet.view.tiles2 | Support classes for the integration of Tiles2 (the standalone version of Tiles) as Spring web view technology.
org.springframework.web.servlet.view.velocity | Support classes for the integration of Velocity as Spring web view technology.
org.springframework.web.servlet.view.xml | Support classes for providing a View implementation based on XML Marshalling.
org.springframework.web.servlet.view.xslt | Support classes for XSLT, providing a View implementation for XSLT stylesheets.
org.springframework.web.struts | Support classes for integrating a Struts web tier with a Spring middle tier which is typically hosted in a Spring root WebApplicationContext.
org.springframework.web.util | Miscellaneous web utility classes, such as HTML escaping, log4j initialization, and cookie handling.

Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES


PREV NEXT FRAMES NO FRAMES

Hierarchy For All Packages

Package Hierarchies:
org.springframework.aop, org.springframework.aop.aspectj, org.springframework.aop.aspectj.annotation, org.springframework.aop.aspectj.autoproxy, org.springframework.aop.config, org.springframework.aop.framework, org.springframework.aop.framework.adapter, org.springframework.aop.framework.autoproxy, org.springframework.aop.framework.autoproxy.target, org.springframework.aop.interceptor, org.springframework.aop.scope, org.springframework.aop.support, org.springframework.aop.support.annotation, org.springframework.aop.target, org.springframework.aop.target.dynamic, org.springframework.beans, org.springframework.beans.annotation, org.springframework.beans.factory, org.springframework.beans.factory.access, org.springframework.beans.factory.access.el, org.springframework.beans.factory.annotation, org.springframework.beans.factory.aspectj, org.springframework.beans.factory.config, org.springframework.beans.factory.parsing, org.springframework.beans.factory.serviceloader, org.springframework.beans.factory.support, org.springframework.beans.factory.wiring, org.springframework.beans.factory.xml, org.springframework.beans.propertyeditors, org.springframework.beans.support, org.springframework.cache.ehcache, org.springframework.context, org.springframework.context.access, org.springframework.context.annotation, org.springframework.context.config, org.springframework.context.event, org.springframework.context.expression, org.springframework.context.i18n, org.springframework.context.support, org.springframework.context.weaving, org.springframework.core, org.springframework.core.annotation, org.springframework.core.convert, org.springframework.core.convert.converter, org.springframework.core.convert.support, org.springframework.core.enums, org.springframework.core.io, org.springframework.core.io.support, org.springframework.core.style, org.springframework.core.task, org.springframework.core.task.support, org.springframework.core.type, org.springframework.core.type.classreading, org.springframework.core.type.filter, org.springframework.dao, org.springframework.dao.annotation, org.springframework.dao.support, org.springframework.ejb.access, org.springframework.ejb.config, org.springframework.ejb.interceptor, org.springframework.ejb.support, org.springframework.expression, org.springframework.expression.common, org.springframework.expression.spel, org.springframework.expression.spel.ast, org.springframework.expression.spel.standard, org.springframework.expression.spel.support, org.springframework.format, org.springframework.format.annotation, org.springframework.format.datetime, org.springframework.format.datetime.joda, org.springframework.format.number, org.springframework.format.support, org.springframework.http, org.springframework.http.client, org.springframework.http.client.support, org.springframework.http.converter, org.springframework.http.converter.feed, org.springframework.http.converter.json, org.springframework.http.converter.xml, org.springframework.http.server, org.springframework.instrument, org.springframework.instrument.classloading, org.springframework.instrument.classloading.glassfish, org.springframework.instrument.classloading.jboss, org.springframework.instrument.classloading.oc4j, org.springframework.instrument.classloading.tomcat, org.springframework.instrument.classloading.weblogic, org.springframework.jca.cci, org.springframework.jca.cci.connection, org.springframework.jca.cci.core, org.springframework.jca.cci.core.support, org.springframework.jca.cci.object, org.springframework.jca.context, org.springframework.jca.endpoint, org.springframework.jca.support, org.springframework.jca.work, org.springframework.jca.work.glassfish, org.springframework.jca.work.jboss, org.springframework.jdbc, org.springframework.jdbc.config, org.springframework.jdbc.core, org.springframework.jdbc.core.metadata, org.springframework.jdbc.core.namedparam, org.springframework.jdbc.core.simple, org.springframework.jdbc.core.support, org.springframework.jdbc.datasource, org.springframework.jdbc.datasource.embedded, org.springframework.jdbc.datasource.init, org.springframework.jdbc.datasource.lookup, org.springframework.jdbc.object, org.springframework.jdbc.support, org.springframework.jdbc.support.incrementer, org.springframework.jdbc.support.lob, org.springframework.jdbc.support.nativejdbc, org.springframework.jdbc.support.rowset, org.springframework.jdbc.support.xml, org.springframework.jms, org.springframework.jms.config, org.springframework.jms.connection, org.springframework.jms.core, org.springframework.jms.core.support, org.springframework.jms.listener, org.springframework.jms.listener.adapter, org.springframework.jms.listener.endpoint, org.springframework.jms.remoting, org.springframework.jms.support, org.springframework.jms.support.converter, org.springframework.jms.support.destination, org.springframework.jmx, org.springframework.jmx.access, org.springframework.jmx.export, org.springframework.jmx.export.annotation, org.springframework.jmx.export.assembler, org.springframework.jmx.export.metadata, org.springframework.jmx.export.naming, org.springframework.jmx.export.notification, org.springframework.jmx.support, org.springframework.jndi, org.springframework.jndi.support, org.springframework.mail, org.springframework.mail.javamail, org.springframework.mock.jndi, org.springframework.mock.staticmock, org.springframework.mock.web, org.springframework.mock.web.portlet, org.springframework.orm, org.springframework.orm.hibernate3, org.springframework.orm.hibernate3.annotation, org.springframework.orm.hibernate3.support, org.springframework.orm.ibatis, org.springframework.orm.ibatis.support, org.springframework.orm.jdo, org.springframework.orm.jdo.support, org.springframework.orm.jpa, org.springframework.orm.jpa.persistenceunit, org.springframework.orm.jpa.support, org.springframework.orm.jpa.vendor, org.springframework.oxm, org.springframework.oxm.castor, org.springframework.oxm.config, org.springframework.oxm.jaxb, org.springframework.oxm.jibx, org.springframework.oxm.mime, org.springframework.oxm.support, org.springframework.oxm.xmlbeans, org.springframework.oxm.xstream, org.springframework.remoting, org.springframework.remoting.caucho, org.springframework.remoting.httpinvoker, org.springframework.remoting.jaxrpc, org.springframework.remoting.jaxws, org.springframework.remoting.rmi, org.springframework.remoting.soap, org.springframework.remoting.support, org.springframework.scheduling, org.springframework.scheduling.annotation, org.springframework.scheduling.backportconcurrent, org.springframework.scheduling.commonj, org.springframework.scheduling.concurrent, org.springframework.scheduling.config, org.springframework.scheduling.quartz, org.springframework.scheduling.support, org.springframework.scheduling.timer, org.springframework.scripting, org.springframework.scripting.bsh, org.springframework.scripting.config, org.springframework.scripting.groovy, org.springframework.scripting.jruby, org.springframework.scripting.support, org.springframework.stereotype, org.springframework.test, org.springframework.test.annotation, org.springframework.test.context, org.springframework.test.context.junit38, org.springframework.test.context.junit4, org.springframework.test.context.junit4.statements, org.springframework.test.context.support, org.springframework.test.context.testng, org.springframework.test.context.transaction, org.springframework.test.jdbc, org.springframework.test.jpa, org.springframework.test.util, org.springframework.test.web, org.springframework.transaction, org.springframework.transaction.annotation, org.springframework.transaction.config, org.springframework.transaction.interceptor, org.springframework.transaction.jta, org.springframework.transaction.support, org.springframework.ui, org.springframework.ui.context, org.springframework.ui.context.support, org.springframework.ui.freemarker, org.springframework.ui.jasperreports, org.springframework.ui.velocity, org.springframework.util, org.springframework.util.comparator, org.springframework.util.xml, org.springframework.validation, org.springframework.validation.beanvalidation, org.springframework.validation.support, org.springframework.web, org.springframework.web.bind, org.springframework.web.bind.annotation, org.springframework.web.bind.annotation.support, org.springframework.web.bind.support, org.springframework.web.client, org.springframework.web.client.support, org.springframework.web.context, org.springframework.web.context.request, org.springframework.web.context.support, org.springframework.web.filter, org.springframework.web.jsf, org.springframework.web.jsf.el, org.springframework.web.multipart, org.springframework.web.multipart.commons, org.springframework.web.multipart.support, org.springframework.web.portlet, org.springframework.web.portlet.bind, org.springframework.web.portlet.bind.annotation, org.springframework.web.portlet.context, org.springframework.web.portlet.handler, org.springframework.web.portlet.multipart, org.springframework.web.portlet.mvc, org.springframework.web.portlet.mvc.annotation, org.springframework.web.portlet.util, org.springframework.web.servlet, org.springframework.web.servlet.config, org.springframework.web.servlet.handler, org.springframework.web.servlet.i18n, org.springframework.web.servlet.mvc, org.springframework.web.servlet.mvc.annotation, org.springframework.web.servlet.mvc.multiaction, org.springframework.web.servlet.mvc.support, org.springframework.web.servlet.support, org.springframework.web.servlet.tags, org.springframework.web.servlet.tags.form, org.springframework.web.servlet.theme, org.springframework.web.servlet.view, org.springframework.web.servlet.view.document, org.springframework.web.servlet.view.feed, org.springframework.web.servlet.view.freemarker, org.springframework.web.servlet.view.jasperreports, org.springframework.web.servlet.view.json, org.springframework.web.servlet.view.tiles, org.springframework.web.servlet.view.tiles2, org.springframework.web.servlet.view.velocity, org.springframework.web.servlet.view.xml, org.springframework.web.servlet.view.xslt, org.springframework.web.struts, org.springframework.web.util

Class Hierarchy

  • java.lang.Object
    • org.springframework.context.event.AbstractApplicationEventMulticaster (implements org.springframework.context.event.ApplicationEventMulticaster, org.springframework.beans.factory.BeanFactoryAware)
      • org.springframework.context.event.SimpleApplicationEventMulticaster
    • org.springframework.aop.aspectj.AbstractAspectJAdvice (implements org.aopalliance.aop.Advice, org.springframework.aop.aspectj.AspectJPrecedenceInformation)
      • org.springframework.aop.aspectj.AspectJAfterAdvice (implements org.springframework.aop.AfterAdvice, org.aopalliance.intercept.MethodInterceptor)
      • org.springframework.aop.aspectj.AspectJAfterReturningAdvice (implements org.springframework.aop.AfterAdvice, org.springframework.aop.AfterReturningAdvice)
      • org.springframework.aop.aspectj.AspectJAfterThrowingAdvice (implements org.springframework.aop.AfterAdvice, org.aopalliance.intercept.MethodInterceptor)
      • org.springframework.aop.aspectj.AspectJAroundAdvice (implements org.aopalliance.intercept.MethodInterceptor)
      • org.springframework.aop.aspectj.AspectJMethodBeforeAdvice (implements org.springframework.aop.MethodBeforeAdvice)
    • org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory (implements org.springframework.aop.aspectj.annotation.AspectJAdvisorFactory)
      • org.springframework.aop.aspectj.annotation.ReflectiveAspectJAdvisorFactory
    • org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory.AspectJAnnotation<A>
    • org.springframework.beans.factory.xml.AbstractBeanDefinitionParser (implements org.springframework.beans.factory.xml.BeanDefinitionParser)
      • org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
        • org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser
        • org.springframework.scheduling.config.ExecutorBeanDefinitionParser
        • org.springframework.transaction.config.JtaTransactionManagerBeanDefinitionParser
        • org.springframework.scheduling.config.ScheduledTasksBeanDefinitionParser
        • org.springframework.scheduling.config.SchedulerBeanDefinitionParser
      • org.springframework.jdbc.config.EmbeddedDatabaseBeanDefinitionParser
      • org.springframework.jdbc.config.InitializeDatabaseBeanDefinitionParser
    • org.springframework.beans.factory.support.AbstractBeanDefinitionReader (implements org.springframework.beans.factory.support.BeanDefinitionReader)
      • org.springframework.beans.factory.support.PropertiesBeanDefinitionReader
      • org.springframework.beans.factory.xml.XmlBeanDefinitionReader
    • org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource (implements org.springframework.beans.factory.BeanFactoryAware, java.io.Serializable, org.springframework.aop.TargetSource)
      • org.springframework.aop.target.AbstractPrototypeBasedTargetSource
        • org.springframework.aop.target.AbstractPoolingTargetSource (implements org.springframework.beans.factory.DisposableBean, org.springframework.aop.target.PoolingConfig)
          • org.springframework.aop.target.CommonsPoolTargetSource (implements org.apache.commons.pool.PoolableObjectFactory)
        • org.springframework.aop.target.PrototypeTargetSource
        • org.springframework.aop.target.ThreadLocalTargetSource (implements org.springframework.beans.factory.DisposableBean, org.springframework.aop.target.ThreadLocalTargetSourceStats)
      • org.springframework.aop.target.LazyInitTargetSource
      • org.springframework.aop.target.SimpleBeanTargetSource
    • org.springframework.aop.framework.autoproxy.target.AbstractBeanFactoryBasedTargetSourceCreator (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.aop.framework.autoproxy.TargetSourceCreator)
      • org.springframework.aop.framework.autoproxy.target.LazyInitTargetSourceCreator
      • org.springframework.aop.framework.autoproxy.target.QuickTargetSourceCreator
    • org.springframework.core.enums.AbstractCachingLabeledEnumResolver (implements org.springframework.core.enums.LabeledEnumResolver)
      • org.springframework.core.enums.StaticLabeledEnumResolver
    • org.springframework.core.type.filter.AbstractClassTestingTypeFilter (implements org.springframework.core.type.filter.TypeFilter)
      • org.springframework.core.type.filter.RegexPatternTypeFilter
    • org.springframework.http.client.AbstractClientHttpRequest (implements org.springframework.http.client.ClientHttpRequest)
    • java.util.AbstractCollection<E> (implements java.util.Collection<E>)
      • java.util.AbstractList<E> (implements java.util.List<E>)
        • java.util.ArrayList<E> (implements java.lang.Cloneable, java.util.List<E>, java.util.RandomAccess, java.io.Serializable)
          • org.springframework.beans.factory.support.ManagedList<E> (implements org.springframework.beans.BeanMetadataElement, org.springframework.beans.Mergeable)
            • org.springframework.beans.factory.support.ManagedArray
      • java.util.AbstractSet<E> (implements java.util.Set<E>)
        • java.util.HashSet<E> (implements java.lang.Cloneable, java.io.Serializable, java.util.Set<E>)
          • java.util.LinkedHashSet<E> (implements java.lang.Cloneable, java.io.Serializable, java.util.Set<E>)
            • org.springframework.beans.factory.support.ManagedSet<E> (implements org.springframework.beans.BeanMetadataElement, org.springframework.beans.Mergeable)
    • org.springframework.beans.factory.parsing.AbstractComponentDefinition (implements org.springframework.beans.factory.parsing.ComponentDefinition)
      • org.springframework.aop.config.AdvisorComponentDefinition
      • org.springframework.beans.factory.parsing.CompositeComponentDefinition
        • org.springframework.aop.config.AspectComponentDefinition
      • org.springframework.aop.config.PointcutComponentDefinition
    • org.springframework.test.context.support.AbstractContextLoader (implements org.springframework.test.context.ContextLoader)
      • org.springframework.test.context.support.AbstractGenericContextLoader
        • org.springframework.test.context.support.GenericPropertiesContextLoader
        • org.springframework.test.context.support.GenericXmlContextLoader
    • org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer (implements org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer, org.springframework.beans.factory.InitializingBean)
      • org.springframework.jdbc.support.incrementer.AbstractColumnMaxValueIncrementer
        • org.springframework.jdbc.support.incrementer.DerbyMaxValueIncrementer
        • org.springframework.jdbc.support.incrementer.HsqlMaxValueIncrementer
        • org.springframework.jdbc.support.incrementer.MySQLMaxValueIncrementer
        • org.springframework.jdbc.support.incrementer.SqlServerMaxValueIncrementer
        • org.springframework.jdbc.support.incrementer.SybaseMaxValueIncrementer
      • org.springframework.jdbc.support.incrementer.AbstractSequenceMaxValueIncrementer
        • org.springframework.jdbc.support.incrementer.DB2MainframeSequenceMaxValueIncrementer
        • org.springframework.jdbc.support.incrementer.DB2SequenceMaxValueIncrementer
        • org.springframework.jdbc.support.incrementer.H2SequenceMaxValueIncrementer
        • org.springframework.jdbc.support.incrementer.HsqlSequenceMaxValueIncrementer
        • org.springframework.jdbc.support.incrementer.OracleSequenceMaxValueIncrementer
        • org.springframework.jdbc.support.incrementer.PostgreSQLSequenceMaxValueIncrementer
    • org.springframework.jdbc.datasource.AbstractDataSource (implements javax.sql.DataSource)
      • org.springframework.jdbc.datasource.AbstractDriverBasedDataSource
        • org.springframework.jdbc.datasource.DriverManagerDataSource
          • org.springframework.jdbc.datasource.SingleConnectionDataSource (implements org.springframework.beans.factory.DisposableBean, org.springframework.jdbc.datasource.SmartDataSource)
        • org.springframework.jdbc.datasource.SimpleDriverDataSource
      • org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource (implements org.springframework.beans.factory.InitializingBean)
        • org.springframework.jdbc.datasource.lookup.IsolationLevelDataSourceRouter
    • org.springframework.ejb.support.AbstractEnterpriseBean (implements javax.ejb.EnterpriseBean)
      • org.springframework.ejb.support.AbstractMessageDrivenBean (implements javax.ejb.MessageDrivenBean)
        • org.springframework.ejb.support.AbstractJmsMessageDrivenBean (implements javax.jms.MessageListener)
      • org.springframework.ejb.support.AbstractSessionBean (implements org.springframework.ejb.support.SmartSessionBean)
        • org.springframework.ejb.support.AbstractStatefulSessionBean
        • org.springframework.ejb.support.AbstractStatelessSessionBean
    • org.springframework.orm.jpa.AbstractEntityManagerFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.orm.jpa.EntityManagerFactoryInfo, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean, org.springframework.dao.support.PersistenceExceptionTranslator, java.io.Serializable)
      • org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean (implements org.springframework.context.weaving.LoadTimeWeaverAware, org.springframework.context.ResourceLoaderAware)
      • org.springframework.orm.jpa.LocalEntityManagerFactoryBean
    • org.springframework.validation.AbstractErrors (implements org.springframework.validation.Errors, java.io.Serializable)
      • org.springframework.validation.AbstractBindingResult (implements org.springframework.validation.BindingResult, java.io.Serializable)
        • org.springframework.validation.AbstractPropertyBindingResult
          • org.springframework.validation.BeanPropertyBindingResult (implements java.io.Serializable)
          • org.springframework.validation.DirectFieldBindingResult
        • org.springframework.validation.MapBindingResult (implements java.io.Serializable)
    • java.util.concurrent.AbstractExecutorService (implements java.util.concurrent.ExecutorService)
      • org.springframework.core.task.support.ExecutorServiceAdapter
    • org.springframework.aop.support.AbstractExpressionPointcut (implements org.springframework.aop.support.ExpressionPointcut, java.io.Serializable)
      • org.springframework.aop.aspectj.AspectJExpressionPointcut (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.aop.ClassFilter, org.springframework.aop.IntroductionAwareMethodMatcher)
    • org.springframework.beans.factory.config.AbstractFactoryBean<T> (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
      • org.springframework.beans.factory.serviceloader.AbstractServiceLoaderBasedFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware)
        • org.springframework.beans.factory.serviceloader.ServiceFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware)
        • org.springframework.beans.factory.serviceloader.ServiceListFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware)
        • org.springframework.beans.factory.serviceloader.ServiceLoaderFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware)
      • org.springframework.beans.factory.config.ListFactoryBean
      • org.springframework.beans.factory.config.MapFactoryBean
      • org.springframework.beans.factory.config.ObjectFactoryCreatingFactoryBean
      • org.springframework.beans.factory.config.ProviderCreatingFactoryBean
      • org.springframework.beans.factory.config.SetFactoryBean
      • org.springframework.jdbc.config.SortedResourcesFactoryBean (implements org.springframework.context.ResourceLoaderAware)
    • org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator (implements org.springframework.jdbc.support.SQLExceptionTranslator)
      • org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator
      • org.springframework.jdbc.support.SQLExceptionSubclassTranslator
      • org.springframework.jdbc.support.SQLStateSQLExceptionTranslator
    • org.springframework.transaction.interceptor.AbstractFallbackTransactionAttributeSource (implements org.springframework.transaction.interceptor.TransactionAttributeSource)
      • org.springframework.transaction.annotation.AnnotationTransactionAttributeSource (implements java.io.Serializable)
    • org.springframework.web.portlet.handler.AbstractHandlerExceptionResolver (implements org.springframework.web.portlet.HandlerExceptionResolver, org.springframework.core.Ordered)
      • org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver
      • org.springframework.web.portlet.handler.SimpleMappingExceptionResolver
    • org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver (implements org.springframework.web.servlet.HandlerExceptionResolver, org.springframework.core.Ordered)
      • org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver
      • org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver
      • org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver
      • org.springframework.web.servlet.handler.SimpleMappingExceptionResolver
    • org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.remoting.httpinvoker.HttpInvokerRequestExecutor)
      • org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor
      • org.springframework.remoting.httpinvoker.SimpleHttpInvokerRequestExecutor
    • org.springframework.http.converter.AbstractHttpMessageConverter<T> (implements org.springframework.http.converter.HttpMessageConverter<T>)
      • org.springframework.http.converter.feed.AbstractWireFeedHttpMessageConverter<T>
        • org.springframework.http.converter.feed.AtomFeedHttpMessageConverter
        • org.springframework.http.converter.feed.RssChannelHttpMessageConverter
      • org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter<T>
        • org.springframework.http.converter.xml.AbstractJaxb2HttpMessageConverter<T>
          • org.springframework.http.converter.xml.Jaxb2RootElementHttpMessageConverter
        • org.springframework.http.converter.xml.MarshallingHttpMessageConverter
        • org.springframework.http.converter.xml.SourceHttpMessageConverter<T>
      • org.springframework.http.converter.ByteArrayHttpMessageConverter
      • org.springframework.http.converter.json.MappingJacksonHttpMessageConverter
      • org.springframework.http.converter.StringHttpMessageConverter
    • org.springframework.aop.config.AbstractInterceptorDrivenBeanDefinitionDecorator (implements org.springframework.beans.factory.xml.BeanDefinitionDecorator)
    • org.springframework.jdbc.core.support.AbstractInterruptibleBatchPreparedStatementSetter (implements org.springframework.jdbc.core.InterruptibleBatchPreparedStatementSetter)
    • org.springframework.remoting.jaxws.AbstractJaxWsServiceExporter (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean)
      • org.springframework.remoting.jaxws.SimpleHttpServerJaxWsServiceExporter
      • org.springframework.remoting.jaxws.SimpleJaxWsServiceExporter
    • org.springframework.jdbc.core.simple.AbstractJdbcCall
      • org.springframework.jdbc.core.simple.SimpleJdbcCall (implements org.springframework.jdbc.core.simple.SimpleJdbcCallOperations)
    • org.springframework.jdbc.core.simple.AbstractJdbcInsert
      • org.springframework.jdbc.core.simple.SimpleJdbcInsert (implements org.springframework.jdbc.core.simple.SimpleJdbcInsertOperations)
    • org.springframework.jmx.export.metadata.AbstractJmxAttribute
      • org.springframework.jmx.export.metadata.ManagedAttribute
      • org.springframework.jmx.export.metadata.ManagedMetric
      • org.springframework.jmx.export.metadata.ManagedOperation
      • org.springframework.jmx.export.metadata.ManagedResource
    • org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter (implements org.springframework.orm.jpa.JpaVendorAdapter)
      • org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter
      • org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter
      • org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter
      • org.springframework.orm.jpa.vendor.TopLinkJpaVendorAdapter
    • org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests (implements org.springframework.context.ApplicationContextAware)
      • org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests
    • org.springframework.core.enums.AbstractLabeledEnum (implements org.springframework.core.enums.LabeledEnum)
      • org.springframework.core.enums.AbstractGenericLabeledEnum
        • org.springframework.core.enums.LetterCodedLabeledEnum
        • org.springframework.core.enums.ShortCodedLabeledEnum
        • org.springframework.core.enums.StringCodedLabeledEnum
      • org.springframework.core.enums.StaticLabeledEnum
    • org.springframework.aop.target.AbstractLazyCreationTargetSource (implements org.springframework.aop.TargetSource)
    • org.springframework.jdbc.core.support.AbstractLobCreatingPreparedStatementCallback (implements org.springframework.jdbc.core.PreparedStatementCallback<T>)
    • org.springframework.jdbc.support.lob.AbstractLobHandler (implements org.springframework.jdbc.support.lob.LobHandler)
      • org.springframework.jdbc.support.lob.DefaultLobHandler
      • org.springframework.jdbc.support.lob.OracleLobHandler
    • org.springframework.jdbc.core.support.AbstractLobStreamingResultSetExtractor (implements org.springframework.jdbc.core.ResultSetExtractor<T>)
    • org.springframework.orm.hibernate3.support.AbstractLobType (implements org.hibernate.usertype.UserType)
      • org.springframework.orm.hibernate3.support.BlobByteArrayType
      • org.springframework.orm.hibernate3.support.BlobSerializableType
      • org.springframework.orm.hibernate3.support.BlobStringType
      • org.springframework.orm.hibernate3.support.ClobStringType
    • org.springframework.web.servlet.i18n.AbstractLocaleResolver (implements org.springframework.web.servlet.LocaleResolver)
      • org.springframework.web.servlet.i18n.FixedLocaleResolver
      • org.springframework.web.servlet.i18n.SessionLocaleResolver
    • java.util.AbstractMap<K,V> (implements java.util.Map<K,V>)
      • java.util.HashMap<K,V> (implements java.lang.Cloneable, java.util.Map<K,V>, java.io.Serializable)
        • java.util.LinkedHashMap<K,V> (implements java.util.Map<K,V>)
          • org.springframework.util.LinkedCaseInsensitiveMap<V>
          • org.springframework.beans.factory.support.ManagedMap<K,V> (implements org.springframework.beans.BeanMetadataElement, org.springframework.beans.Mergeable)
          • org.springframework.ui.ModelMap
            • org.springframework.ui.ExtendedModelMap (implements org.springframework.ui.Model)
              • org.springframework.validation.support.BindingAwareModelMap
    • org.springframework.oxm.support.AbstractMarshaller (implements org.springframework.oxm.Marshaller, org.springframework.oxm.Unmarshaller)
      • org.springframework.oxm.castor.CastorMarshaller (implements org.springframework.beans.factory.InitializingBean)
      • org.springframework.oxm.jibx.JibxMarshaller (implements org.springframework.beans.factory.InitializingBean)
      • org.springframework.oxm.xmlbeans.XmlBeansMarshaller
      • org.springframework.oxm.xstream.XStreamMarshaller (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.InitializingBean)
    • org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler (implements org.springframework.jmx.export.assembler.MBeanInfoAssembler)
      • org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
        • org.springframework.jmx.export.assembler.AbstractConfigurableMBeanInfoAssembler
          • org.springframework.jmx.export.assembler.InterfaceBasedMBeanInfoAssembler (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.InitializingBean)
          • org.springframework.jmx.export.assembler.MethodExclusionMBeanInfoAssembler
          • org.springframework.jmx.export.assembler.MethodNameBasedMBeanInfoAssembler
          • org.springframework.jmx.export.assembler.SimpleReflectiveMBeanInfoAssembler
        • org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler (implements org.springframework.jmx.export.assembler.AutodetectCapableMBeanInfoAssembler, org.springframework.beans.factory.InitializingBean)
    • org.springframework.jca.endpoint.AbstractMessageEndpointFactory (implements javax.resource.spi.endpoint.MessageEndpointFactory)
      • org.springframework.jca.endpoint.GenericMessageEndpointFactory
      • org.springframework.jms.listener.endpoint.JmsMessageEndpointFactory
    • org.springframework.jca.endpoint.AbstractMessageEndpointFactory.AbstractMessageEndpoint (implements javax.resource.spi.endpoint.MessageEndpoint)
    • org.springframework.format.number.AbstractNumberFormatter (implements org.springframework.format.Formatter<T>)
      • org.springframework.format.number.CurrencyFormatter
      • org.springframework.format.number.NumberFormatter
      • org.springframework.format.number.PercentFormatter
    • org.springframework.transaction.support.AbstractPlatformTransactionManager (implements org.springframework.transaction.PlatformTransactionManager, java.io.Serializable)
      • org.springframework.jca.cci.connection.CciLocalTransactionManager (implements org.springframework.beans.factory.InitializingBean, org.springframework.transaction.support.ResourceTransactionManager)
      • org.springframework.jdbc.datasource.DataSourceTransactionManager (implements org.springframework.beans.factory.InitializingBean, org.springframework.transaction.support.ResourceTransactionManager)
      • org.springframework.orm.hibernate3.HibernateTransactionManager (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean, org.springframework.transaction.support.ResourceTransactionManager)
      • org.springframework.orm.jdo.JdoTransactionManager (implements org.springframework.beans.factory.InitializingBean, org.springframework.transaction.support.ResourceTransactionManager)
      • org.springframework.jms.connection.JmsTransactionManager (implements org.springframework.beans.factory.InitializingBean, org.springframework.transaction.support.ResourceTransactionManager)
        • org.springframework.jms.connection.JmsTransactionManager102
      • org.springframework.orm.jpa.JpaTransactionManager (implements org.springframework.beans.factory.InitializingBean, org.springframework.transaction.support.ResourceTransactionManager)
      • org.springframework.transaction.jta.JtaTransactionManager (implements org.springframework.beans.factory.InitializingBean, java.io.Serializable, org.springframework.transaction.jta.TransactionFactory)
        • org.springframework.transaction.jta.OC4JJtaTransactionManager
        • org.springframework.transaction.jta.WebLogicJtaTransactionManager
        • org.springframework.transaction.jta.WebSphereUowTransactionManager (implements org.springframework.transaction.support.CallbackPreferringPlatformTransactionManager)
    • org.springframework.transaction.support.AbstractPlatformTransactionManager.SuspendedResourcesHolder
    • org.springframework.aop.support.AbstractPointcutAdvisor (implements org.springframework.core.Ordered, org.springframework.aop.PointcutAdvisor, java.io.Serializable)
      • org.springframework.aop.support.AbstractBeanFactoryPointcutAdvisor (implements org.springframework.beans.factory.BeanFactoryAware)
        • org.springframework.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor
        • org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor
      • org.springframework.aop.support.AbstractGenericPointcutAdvisor
        • org.springframework.aop.aspectj.AspectJExpressionPointcutAdvisor
        • org.springframework.aop.support.DefaultPointcutAdvisor (implements java.io.Serializable)
          • org.springframework.aop.aspectj.annotation.ReflectiveAspectJAdvisorFactory.SyntheticInstantiationAdvisor
        • org.springframework.aop.support.NameMatchMethodPointcutAdvisor
        • org.springframework.aop.support.RegexpMethodPointcutAdvisor
      • org.springframework.scheduling.annotation.AsyncAnnotationAdvisor
      • org.springframework.dao.annotation.PersistenceExceptionTranslationAdvisor
      • org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor
    • org.hibernate.event.def.AbstractReassociateEventListener (implements java.io.Serializable)
      • org.hibernate.event.def.AbstractSaveEventListener
        • org.hibernate.event.def.DefaultMergeEventListener (implements org.hibernate.event.MergeEventListener)
          • org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener
    • org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource (implements org.springframework.aop.target.dynamic.Refreshable, org.springframework.aop.TargetSource)
      • org.springframework.aop.target.dynamic.BeanFactoryRefreshableTargetSource
        • org.springframework.scripting.support.RefreshableScriptTargetSource
    • org.springframework.web.context.request.AbstractRequestAttributes (implements org.springframework.web.context.request.RequestAttributes)
      • org.springframework.web.portlet.context.PortletRequestAttributes
        • org.springframework.web.portlet.context.PortletWebRequest (implements org.springframework.web.context.request.NativeWebRequest)
      • org.springframework.web.context.request.ServletRequestAttributes
        • org.springframework.web.context.request.ServletWebRequest (implements org.springframework.web.context.request.NativeWebRequest)
          • org.springframework.web.servlet.handler.DispatcherServletWebRequest
    • org.springframework.web.context.request.AbstractRequestAttributesScope (implements org.springframework.beans.factory.config.Scope)
      • org.springframework.web.context.request.RequestScope
      • org.springframework.web.context.request.SessionScope
    • org.springframework.core.io.AbstractResource (implements org.springframework.core.io.Resource)
      • org.springframework.core.io.AbstractFileResolvingResource
        • org.springframework.core.io.ClassPathResource
        • org.springframework.core.io.UrlResource
      • org.springframework.core.io.ByteArrayResource
      • org.springframework.core.io.DescriptiveResource
      • org.springframework.core.io.FileSystemResource
      • org.springframework.core.io.InputStreamResource
      • org.springframework.web.portlet.context.PortletContextResource (implements org.springframework.core.io.ContextResource)
      • org.springframework.web.context.support.ServletContextResource (implements org.springframework.core.io.ContextResource)
      • org.springframework.core.io.VfsResource
    • org.springframework.orm.hibernate3.AbstractSessionFactoryBean (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean, org.springframework.dao.support.PersistenceExceptionTranslator)
      • org.springframework.orm.hibernate3.LocalSessionFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware)
        • org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean (implements org.springframework.context.ResourceLoaderAware)
    • org.springframework.web.servlet.view.tiles2.AbstractSpringPreparerFactory (implements org.apache.tiles.preparer.PreparerFactory)
      • org.springframework.web.servlet.view.tiles2.SimpleSpringPreparerFactory
      • org.springframework.web.servlet.view.tiles2.SpringBeanPreparerFactory
    • org.springframework.jdbc.core.namedparam.AbstractSqlParameterSource (implements org.springframework.jdbc.core.namedparam.SqlParameterSource)
      • org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource
      • org.springframework.jdbc.core.namedparam.MapSqlParameterSource
    • org.springframework.jdbc.core.support.AbstractSqlTypeValue (implements org.springframework.jdbc.core.SqlTypeValue)
    • org.springframework.test.context.support.AbstractTestExecutionListener (implements org.springframework.test.context.TestExecutionListener)
      • org.springframework.test.context.support.DependencyInjectionTestExecutionListener
      • org.springframework.test.context.support.DirtiesContextTestExecutionListener
      • org.springframework.test.context.transaction.TransactionalTestExecutionListener
    • org.springframework.test.context.testng.AbstractTestNGSpringContextTests (implements org.springframework.context.ApplicationContextAware, org.testng.IHookable)
      • org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests
    • org.springframework.web.servlet.theme.AbstractThemeResolver (implements org.springframework.web.servlet.ThemeResolver)
      • org.springframework.web.servlet.theme.FixedThemeResolver
      • org.springframework.web.servlet.theme.SessionThemeResolver
    • org.apache.tiles.context.AbstractTilesApplicationContextFactory
      • org.springframework.web.servlet.view.tiles2.SpringTilesApplicationContextFactory (implements org.apache.tiles.Initializable)
    • org.springframework.aop.interceptor.AbstractTraceInterceptor (implements org.aopalliance.intercept.MethodInterceptor, java.io.Serializable)
      • org.springframework.aop.interceptor.AbstractMonitoringInterceptor
        • org.springframework.aop.interceptor.JamonPerformanceMonitorInterceptor
        • org.springframework.aop.interceptor.PerformanceMonitorInterceptor
      • org.springframework.aop.interceptor.CustomizableTraceInterceptor
      • org.springframework.aop.interceptor.SimpleTraceInterceptor
        • org.springframework.aop.interceptor.DebugInterceptor
    • org.springframework.transaction.support.AbstractTransactionStatus (implements org.springframework.transaction.TransactionStatus)
      • org.springframework.transaction.support.DefaultTransactionStatus
      • org.springframework.transaction.support.SimpleTransactionStatus
    • org.springframework.core.type.filter.AbstractTypeHierarchyTraversingFilter (implements org.springframework.core.type.filter.TypeFilter)
      • org.springframework.core.type.filter.AnnotationTypeFilter
      • org.springframework.core.type.filter.AssignableTypeFilter
    • org.springframework.web.servlet.mvc.multiaction.AbstractUrlMethodNameResolver (implements org.springframework.web.servlet.mvc.multiaction.MethodNameResolver)
      • org.springframework.web.servlet.mvc.multiaction.InternalPathMethodNameResolver
      • org.springframework.web.servlet.mvc.multiaction.PropertiesMethodNameResolver (implements org.springframework.beans.factory.InitializingBean)
    • org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver (implements org.springframework.web.servlet.LocaleResolver)
    • org.apache.struts.action.Action
      • org.springframework.web.struts.ActionSupport
      • org.springframework.web.struts.DelegatingActionProxy
      • org.apache.struts.actions.DispatchAction
        • org.springframework.web.struts.DispatchActionSupport
        • org.apache.struts.actions.LookupDispatchAction
          • org.springframework.web.struts.LookupDispatchActionSupport
        • org.apache.struts.actions.MappingDispatchAction
          • org.springframework.web.struts.MappingDispatchActionSupport
    • org.apache.struts.action.ActionForm (implements java.io.Serializable)
      • org.springframework.web.struts.SpringBindingActionForm
    • org.springframework.scheduling.quartz.AdaptableJobFactory (implements org.quartz.spi.JobFactory)
      • org.springframework.scheduling.quartz.SpringBeanJobFactory (implements org.springframework.scheduling.quartz.SchedulerContextAware)
    • org.springframework.aop.config.AdviceEntry (implements org.springframework.beans.factory.parsing.ParseState.Entry)
    • org.springframework.aop.framework.adapter.AdvisorAdapterRegistrationManager (implements org.springframework.beans.factory.config.BeanPostProcessor)
    • org.springframework.aop.config.AdvisorEntry (implements org.springframework.beans.factory.parsing.ParseState.Entry)
    • org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor (implements org.springframework.aop.AfterAdvice, org.aopalliance.intercept.MethodInterceptor, java.io.Serializable)
    • org.springframework.beans.factory.parsing.AliasDefinition (implements org.springframework.beans.BeanMetadataElement)
    • org.springframework.context.annotation.AnnotatedBeanDefinitionReader
    • org.springframework.context.annotation.AnnotationBeanNameGenerator (implements org.springframework.beans.factory.support.BeanNameGenerator)
    • org.springframework.beans.annotation.AnnotationBeanUtils
    • org.springframework.beans.factory.annotation.AnnotationBeanWiringInfoResolver (implements org.springframework.beans.factory.wiring.BeanWiringInfoResolver)
    • org.springframework.aop.support.annotation.AnnotationClassFilter (implements org.springframework.aop.ClassFilter)
    • org.springframework.context.annotation.AnnotationConfigBeanDefinitionParser (implements org.springframework.beans.factory.xml.BeanDefinitionParser)
    • org.springframework.context.annotation.AnnotationConfigUtils
    • org.springframework.scheduling.config.AnnotationDrivenBeanDefinitionParser (implements org.springframework.beans.factory.xml.BeanDefinitionParser)
    • org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource (implements org.springframework.jmx.export.metadata.JmxAttributeSource)
    • org.springframework.aop.support.annotation.AnnotationMatchingPointcut (implements org.springframework.aop.Pointcut)
    • org.springframework.context.annotation.AnnotationScopeMetadataResolver (implements org.springframework.context.annotation.ScopeMetadataResolver)
    • org.springframework.core.annotation.AnnotationUtils
    • org.springframework.util.AntPathMatcher (implements org.springframework.util.PathMatcher)
    • org.springframework.aop.config.AopConfigUtils
    • org.springframework.aop.framework.AopContext
    • org.springframework.aop.config.AopNamespaceUtils
    • org.springframework.aop.framework.AopProxyUtils
    • org.springframework.aop.support.AopUtils
    • org.springframework.context.support.ApplicationObjectSupport (implements org.springframework.context.ApplicationContextAware)
      • org.springframework.web.portlet.handler.AbstractHandlerMapping (implements org.springframework.web.portlet.HandlerMapping, org.springframework.core.Ordered)
        • org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping<K>
          • org.springframework.web.portlet.mvc.annotation.DefaultAnnotationHandlerMapping
          • org.springframework.web.portlet.handler.ParameterHandlerMapping
          • org.springframework.web.portlet.handler.PortletModeHandlerMapping
          • org.springframework.web.portlet.handler.PortletModeParameterHandlerMapping
      • org.springframework.web.portlet.context.PortletApplicationObjectSupport (implements org.springframework.web.portlet.context.PortletContextAware)
        • org.springframework.web.portlet.handler.PortletContentGenerator
          • org.springframework.web.portlet.mvc.AbstractController (implements org.springframework.web.portlet.mvc.Controller)
            • org.springframework.web.portlet.mvc.BaseCommandController
              • org.springframework.web.portlet.mvc.AbstractCommandController
              • org.springframework.web.portlet.mvc.AbstractFormController
                • org.springframework.web.portlet.mvc.AbstractWizardFormController
                • org.springframework.web.portlet.mvc.SimpleFormController
            • org.springframework.web.portlet.mvc.ParameterizableViewController
            • org.springframework.web.portlet.mvc.PortletWrappingController (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.web.portlet.context.PortletConfigAware, org.springframework.web.portlet.context.PortletContextAware)
          • org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.web.portlet.HandlerAdapter, org.springframework.core.Ordered)
      • org.springframework.web.context.support.WebApplicationObjectSupport (implements org.springframework.web.context.ServletContextAware)
        • org.springframework.web.servlet.view.AbstractCachingViewResolver (implements org.springframework.web.servlet.ViewResolver)
          • org.springframework.web.servlet.view.ResourceBundleViewResolver (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.core.Ordered)
          • org.springframework.web.servlet.view.UrlBasedViewResolver (implements org.springframework.core.Ordered)
            • org.springframework.web.servlet.view.AbstractTemplateViewResolver
              • org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver
              • org.springframework.web.servlet.view.velocity.VelocityViewResolver
                • org.springframework.web.servlet.view.velocity.VelocityLayoutViewResolver
            • org.springframework.web.servlet.view.InternalResourceViewResolver
            • org.springframework.web.servlet.view.jasperreports.JasperReportsViewResolver
            • org.springframework.web.servlet.view.tiles2.TilesViewResolver
            • org.springframework.web.servlet.view.xslt.XsltViewResolver
          • org.springframework.web.servlet.view.XmlViewResolver (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.core.Ordered)
        • org.springframework.web.servlet.handler.AbstractHandlerMapping (implements org.springframework.web.servlet.HandlerMapping, org.springframework.core.Ordered)
          • org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
            • org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping
              • org.springframework.web.servlet.mvc.support.AbstractControllerUrlHandlerMapping
                • org.springframework.web.servlet.mvc.support.ControllerBeanNameHandlerMapping
                • org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping
              • org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping
              • org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping
            • org.springframework.web.servlet.handler.SimpleUrlHandlerMapping
        • org.springframework.web.servlet.view.AbstractView (implements org.springframework.beans.factory.BeanNameAware, org.springframework.web.servlet.View)
          • org.springframework.web.servlet.view.document.AbstractExcelView
          • org.springframework.web.servlet.view.feed.AbstractFeedView<T>
            • org.springframework.web.servlet.view.feed.AbstractAtomFeedView
            • org.springframework.web.servlet.view.feed.AbstractRssFeedView
          • org.springframework.web.servlet.view.document.AbstractJExcelView
          • org.springframework.web.servlet.view.document.AbstractPdfView
          • org.springframework.web.servlet.view.AbstractUrlBasedView (implements org.springframework.beans.factory.InitializingBean)
            • org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
              • org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsSingleFormatView
                • org.springframework.web.servlet.view.jasperreports.ConfigurableJasperReportsView
                • org.springframework.web.servlet.view.jasperreports.JasperReportsCsvView
                • org.springframework.web.servlet.view.jasperreports.JasperReportsHtmlView
                • org.springframework.web.servlet.view.jasperreports.JasperReportsPdfView
                • org.springframework.web.servlet.view.jasperreports.JasperReportsXlsView
              • org.springframework.web.servlet.view.jasperreports.JasperReportsMultiFormatView
            • org.springframework.web.servlet.view.document.AbstractPdfStamperView
            • org.springframework.web.servlet.view.AbstractTemplateView
              • org.springframework.web.servlet.view.freemarker.FreeMarkerView
              • org.springframework.web.servlet.view.velocity.VelocityView
                • org.springframework.web.servlet.view.velocity.VelocityToolboxView
                  • org.springframework.web.servlet.view.velocity.VelocityLayoutView
            • org.springframework.web.servlet.view.InternalResourceView
              • org.springframework.web.servlet.view.JstlView
              • org.springframework.web.servlet.view.tiles.TilesView
                • org.springframework.web.servlet.view.tiles.TilesJstlView
            • org.springframework.web.servlet.view.RedirectView
            • org.springframework.web.servlet.view.tiles2.TilesView
            • org.springframework.web.servlet.view.xslt.XsltView
          • org.springframework.web.servlet.view.xslt.AbstractXsltView
          • org.springframework.web.servlet.view.json.MappingJacksonJsonView
          • org.springframework.web.servlet.view.xml.MarshallingView
        • org.springframework.web.servlet.view.BeanNameViewResolver (implements org.springframework.core.Ordered, org.springframework.web.servlet.ViewResolver)
        • org.springframework.web.servlet.view.ContentNegotiatingViewResolver (implements org.springframework.core.Ordered, org.springframework.web.servlet.ViewResolver)
        • org.springframework.web.servlet.view.tiles.TilesConfigurer (implements org.springframework.beans.factory.InitializingBean)
        • org.springframework.web.servlet.support.WebContentGenerator
          • org.springframework.web.servlet.mvc.AbstractController (implements org.springframework.web.servlet.mvc.Controller)
            • org.springframework.web.servlet.mvc.AbstractUrlViewController
              • org.springframework.web.servlet.mvc.UrlFilenameViewController
            • org.springframework.web.servlet.mvc.BaseCommandController
              • org.springframework.web.servlet.mvc.AbstractCommandController
              • org.springframework.web.servlet.mvc.AbstractFormController
                • org.springframework.web.servlet.mvc.AbstractWizardFormController
                • org.springframework.web.servlet.mvc.SimpleFormController
                  • org.springframework.web.servlet.mvc.CancellableFormController
            • org.springframework.web.servlet.mvc.multiaction.MultiActionController (implements org.springframework.web.servlet.mvc.LastModified)
            • org.springframework.web.servlet.mvc.ParameterizableViewController
            • org.springframework.web.servlet.mvc.ServletForwardingController (implements org.springframework.beans.factory.BeanNameAware)
            • org.springframework.web.servlet.mvc.ServletWrappingController (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean)
          • org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.web.servlet.HandlerAdapter, org.springframework.core.Ordered)
          • org.springframework.web.servlet.mvc.WebContentInterceptor (implements org.springframework.web.servlet.HandlerInterceptor)
    • org.springframework.aop.config.AspectEntry (implements org.springframework.beans.factory.parsing.ParseState.Entry)
    • org.springframework.aop.aspectj.AspectJAdviceParameterNameDiscoverer (implements org.springframework.core.ParameterNameDiscoverer)
    • org.springframework.aop.aspectj.AspectJAopUtils
    • org.springframework.aop.aspectj.AspectJPointcutAdvisor (implements org.springframework.core.Ordered, org.springframework.aop.PointcutAdvisor)
    • org.springframework.aop.aspectj.AspectJProxyUtils
    • org.springframework.core.type.filter.AspectJTypeFilter (implements org.springframework.core.type.filter.TypeFilter)
    • org.springframework.aop.aspectj.AspectJWeaverMessageHandler (implements org.aspectj.bridge.IMessageHandler)
    • org.springframework.context.weaving.AspectJWeavingEnabler (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.context.weaving.LoadTimeWeaverAware, org.springframework.core.Ordered)
    • org.springframework.aop.aspectj.annotation.AspectMetadata
    • junit.framework.Assert
      • junit.framework.TestCase (implements junit.framework.Test)
        • org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests (implements org.springframework.context.ApplicationContextAware)
          • org.springframework.test.context.junit38.AbstractTransactionalJUnit38SpringContextTests
        • org.springframework.test.web.AbstractModelAndViewTests
        • org.springframework.test.ConditionalTestCase
          • org.springframework.test.AbstractSpringContextTests
            • org.springframework.test.AbstractSingleSpringContextTests
              • org.springframework.test.AbstractDependencyInjectionSpringContextTests
                • org.springframework.test.AbstractTransactionalSpringContextTests
                  • org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
                    • org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests
                      • org.springframework.test.jpa.AbstractJpaTests
                        • org.springframework.test.jpa.AbstractAspectjJpaTests
    • org.springframework.util.Assert
    • org.springframework.test.AssertThrows
    • org.springframework.expression.spel.ast.AstUtils
    • org.springframework.aop.interceptor.AsyncExecutionInterceptor (implements org.aopalliance.intercept.MethodInterceptor, org.springframework.core.Ordered)
    • org.springframework.scheduling.annotation.AsyncResult<V> (implements java.util.concurrent.Future<V>)
    • org.springframework.core.AttributeAccessorSupport (implements org.springframework.core.AttributeAccessor, java.io.Serializable)
      • org.springframework.beans.BeanMetadataAttributeAccessor (implements org.springframework.beans.BeanMetadataElement)
        • org.springframework.beans.factory.support.AbstractBeanDefinition (implements org.springframework.beans.factory.config.BeanDefinition, java.lang.Cloneable)
          • org.springframework.beans.factory.support.ChildBeanDefinition
          • org.springframework.beans.factory.support.GenericBeanDefinition
            • org.springframework.beans.factory.annotation.AnnotatedGenericBeanDefinition (implements org.springframework.beans.factory.annotation.AnnotatedBeanDefinition)
            • org.springframework.context.annotation.ScannedGenericBeanDefinition (implements org.springframework.beans.factory.annotation.AnnotatedBeanDefinition)
          • org.springframework.beans.factory.support.RootBeanDefinition
        • org.springframework.beans.factory.support.AutowireCandidateQualifier
        • org.springframework.beans.PropertyValue (implements java.io.Serializable)
      • org.springframework.test.context.TestContext
    • org.springframework.util.AutoPopulatingList<E> (implements java.util.List<E>, java.io.Serializable)
    • org.springframework.aop.framework.autoproxy.AutoProxyUtils
    • com.ibatis.sqlmap.engine.type.BaseTypeHandler (implements com.ibatis.sqlmap.engine.type.TypeHandler)
      • org.springframework.orm.ibatis.support.AbstractLobTypeHandler
        • org.springframework.orm.ibatis.support.BlobByteArrayTypeHandler
        • org.springframework.orm.ibatis.support.BlobSerializableTypeHandler
        • org.springframework.orm.ibatis.support.ClobStringTypeHandler
    • org.springframework.jdbc.core.BatchUpdateUtils
      • org.springframework.jdbc.core.namedparam.NamedParameterBatchUpdateUtils
    • org.springframework.beans.factory.wiring.BeanConfigurerSupport (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean)
    • org.springframework.beans.factory.support.BeanDefinitionBuilder
    • org.springframework.beans.factory.support.BeanDefinitionDefaults
    • org.springframework.beans.factory.config.BeanDefinitionHolder (implements org.springframework.beans.BeanMetadataElement)
      • org.springframework.beans.factory.parsing.BeanComponentDefinition (implements org.springframework.beans.factory.parsing.ComponentDefinition)
    • org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
    • org.springframework.beans.factory.support.BeanDefinitionReaderUtils
    • org.springframework.beans.factory.config.BeanDefinitionVisitor
    • org.springframework.beans.factory.parsing.BeanEntry (implements org.springframework.beans.factory.parsing.ParseState.Entry)
    • org.springframework.beans.factory.config.BeanExpressionContext
    • org.springframework.context.expression.BeanExpressionContextAccessor (implements org.springframework.expression.PropertyAccessor)
    • org.springframework.context.expression.BeanFactoryAccessor (implements org.springframework.expression.PropertyAccessor)
    • org.springframework.aop.framework.autoproxy.BeanFactoryAdvisorRetrievalHelper
    • org.springframework.aop.aspectj.annotation.BeanFactoryAspectInstanceFactory (implements org.springframework.aop.aspectj.annotation.MetadataAwareAspectInstanceFactory)
      • org.springframework.aop.aspectj.annotation.PrototypeAspectInstanceFactory
    • org.springframework.aop.aspectj.annotation.BeanFactoryAspectJAdvisorsBuilder
    • org.springframework.jdbc.datasource.lookup.BeanFactoryDataSourceLookup (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.jdbc.datasource.lookup.DataSourceLookup)
    • org.springframework.jms.support.destination.BeanFactoryDestinationResolver (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.jms.support.destination.DestinationResolver)
    • org.springframework.beans.factory.BeanFactoryUtils
    • org.springframework.beans.BeanMetadataAttribute (implements org.springframework.beans.BeanMetadataElement)
    • org.springframework.jdbc.core.BeanPropertyRowMapper<T> (implements org.springframework.jdbc.core.RowMapper<T>)
      • org.springframework.jdbc.core.simple.ParameterizedBeanPropertyRowMapper<T> (implements org.springframework.jdbc.core.simple.ParameterizedRowMapper<T>)
    • org.springframework.beans.factory.config.BeanReferenceFactoryBean (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.SmartFactoryBean<T>)
    • org.springframework.beans.factory.xml.BeansDtdResolver (implements org.xml.sax.EntityResolver)
    • org.springframework.beans.BeanUtils
    • org.springframework.validation.beanvalidation.BeanValidationPostProcessor (implements org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.beans.factory.InitializingBean)
    • org.springframework.beans.factory.wiring.BeanWiringInfo
    • org.springframework.validation.BindingResultUtils
    • org.springframework.web.servlet.support.BindStatus
    • org.springframework.util.comparator.BooleanComparator (implements java.util.Comparator<T>, java.io.Serializable)
    • org.springframework.core.BridgeMethodResolver
    • org.springframework.scripting.bsh.BshScriptFactory (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.scripting.ScriptFactory)
    • org.springframework.scripting.bsh.BshScriptUtils
    • org.springframework.http.converter.BufferedImageHttpMessageConverter (implements org.springframework.http.converter.HttpMessageConverter<T>)
    • org.springframework.beans.CachedIntrospectionResults
    • org.springframework.util.CachingMapDecorator<K,V> (implements java.util.Map<K,V>, java.io.Serializable)
    • org.springframework.jdbc.core.CallableStatementCreatorFactory
    • org.springframework.jdbc.core.metadata.CallMetaDataContext
    • org.springframework.jdbc.core.metadata.CallMetaDataProviderFactory
    • org.springframework.jdbc.core.metadata.CallParameterMetaData
    • org.springframework.jca.cci.core.CciTemplate (implements org.springframework.jca.cci.core.CciOperations)
    • org.springframework.jms.connection.ChainedExceptionListener (implements javax.jms.ExceptionListener)
    • org.springframework.dao.support.ChainedPersistenceExceptionTranslator (implements org.springframework.dao.support.PersistenceExceptionTranslator)
    • org.springframework.aop.support.ClassFilters
    • java.lang.ClassLoader
      • org.springframework.core.DecoratingClassLoader
        • org.springframework.core.OverridingClassLoader
          • org.springframework.instrument.classloading.SimpleInstrumentableClassLoader
          • org.springframework.instrument.classloading.SimpleThrowawayClassLoader
        • org.springframework.instrument.classloading.ShadowingClassLoader
          • org.springframework.instrument.classloading.ResourceOverridingShadowingClassLoader
      • java.security.SecureClassLoader
        • java.net.URLClassLoader
          • org.apache.catalina.loader.WebappClassLoader (implements org.apache.catalina.Lifecycle, org.apache.catalina.loader.Reloader)
            • org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader
    • org.springframework.beans.factory.wiring.ClassNameBeanWiringInfoResolver (implements org.springframework.beans.factory.wiring.BeanWiringInfoResolver)
    • org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider (implements org.springframework.context.ResourceLoaderAware)
      • org.springframework.context.annotation.ClassPathBeanDefinitionScanner
    • org.springframework.util.ClassUtils
    • org.springframework.core.CollectionFactory
    • org.springframework.util.CollectionUtils
    • org.springframework.jdbc.core.ColumnMapRowMapper (implements org.springframework.jdbc.core.RowMapper<T>)
    • org.springframework.jca.cci.core.support.CommAreaRecord (implements javax.resource.cci.Record, javax.resource.cci.Streamable)
    • org.springframework.http.client.CommonsClientHttpRequestFactory (implements org.springframework.http.client.ClientHttpRequestFactory, org.springframework.beans.factory.DisposableBean)
    • org.springframework.web.multipart.commons.CommonsFileUploadSupport
      • org.springframework.web.multipart.commons.CommonsMultipartResolver (implements org.springframework.web.multipart.MultipartResolver, org.springframework.web.context.ServletContextAware)
      • org.springframework.web.portlet.multipart.CommonsPortletMultipartResolver (implements org.springframework.web.portlet.context.PortletContextAware, org.springframework.web.portlet.multipart.PortletMultipartResolver)
    • org.springframework.web.multipart.commons.CommonsFileUploadSupport.MultipartParsingResult
    • org.springframework.beans.factory.config.CommonsLogFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.ui.velocity.CommonsLoggingLogSystem (implements org.apache.velocity.runtime.log.LogSystem)
    • org.springframework.web.multipart.commons.CommonsMultipartFile (implements org.springframework.web.multipart.MultipartFile, java.io.Serializable)
    • org.springframework.util.comparator.ComparableComparator<T> (implements java.util.Comparator<T>)
    • org.springframework.context.annotation.ComponentScanBeanDefinitionParser (implements org.springframework.beans.factory.xml.BeanDefinitionParser)
    • org.springframework.aop.support.ComposablePointcut (implements org.springframework.aop.Pointcut, java.io.Serializable)
    • org.springframework.util.CompositeIterator<E> (implements java.util.Iterator<E>)
    • org.springframework.expression.common.CompositeStringExpression (implements org.springframework.expression.Expression)
    • org.springframework.transaction.interceptor.CompositeTransactionAttributeSource (implements java.io.Serializable, org.springframework.transaction.interceptor.TransactionAttributeSource)
    • org.springframework.util.comparator.CompoundComparator<T> (implements java.util.Comparator<T>, java.io.Serializable)
    • org.springframework.util.ConcurrencyThrottleSupport (implements java.io.Serializable)
      • org.springframework.aop.interceptor.ConcurrencyThrottleInterceptor (implements org.aopalliance.intercept.MethodInterceptor, java.io.Serializable)
    • org.springframework.core.task.support.ConcurrentExecutorAdapter (implements java.util.concurrent.Executor)
    • org.springframework.scheduling.backportconcurrent.ConcurrentTaskExecutor (implements edu.emory.mathcs.backport.java.util.concurrent.Executor, org.springframework.scheduling.SchedulingTaskExecutor)
    • org.springframework.scheduling.concurrent.ConcurrentTaskExecutor (implements org.springframework.scheduling.SchedulingTaskExecutor)
      • org.springframework.scheduling.concurrent.ConcurrentTaskScheduler (implements org.springframework.scheduling.TaskScheduler)
    • org.springframework.web.bind.support.ConfigurableWebBindingInitializer (implements org.springframework.web.bind.support.WebBindingInitializer)
    • org.springframework.context.annotation.ConfigurationClassPostProcessor (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor)
    • org.springframework.jca.cci.connection.ConnectionFactoryUtils
    • org.springframework.jms.connection.ConnectionFactoryUtils
    • org.springframework.core.Constants
    • org.springframework.beans.factory.parsing.ConstructorArgumentEntry (implements org.springframework.beans.factory.parsing.ParseState.Entry)
    • org.springframework.beans.factory.config.ConstructorArgumentValues
    • org.springframework.beans.factory.config.ConstructorArgumentValues.ValueHolder (implements org.springframework.beans.BeanMetadataElement)
    • org.springframework.context.access.ContextBeanFactoryReference (implements org.springframework.beans.factory.access.BeanFactoryReference)
    • org.springframework.web.context.ContextCleanupListener (implements javax.servlet.ServletContextListener)
    • org.springframework.web.context.ContextLoader
      • org.springframework.web.context.ContextLoaderListener (implements javax.servlet.ServletContextListener)
    • org.springframework.web.struts.ContextLoaderPlugIn (implements org.apache.struts.action.PlugIn)
    • org.springframework.core.ControlFlowFactory
    • org.springframework.aop.support.ControlFlowPointcut (implements org.springframework.aop.ClassFilter, org.springframework.aop.MethodMatcher, org.springframework.aop.Pointcut, java.io.Serializable)
    • org.apache.struts.tiles.ControllerSupport (implements org.apache.struts.tiles.Controller)
      • org.springframework.web.servlet.view.tiles.ComponentControllerSupport
    • org.springframework.core.Conventions
    • org.springframework.core.convert.support.ConversionServiceFactory
    • org.springframework.context.support.ConversionServiceFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.web.util.CookieGenerator
      • org.springframework.web.servlet.i18n.CookieLocaleResolver (implements org.springframework.web.servlet.LocaleResolver)
      • org.springframework.web.servlet.theme.CookieThemeResolver (implements org.springframework.web.servlet.ThemeResolver)
    • org.springframework.scheduling.support.CronSequenceGenerator
    • org.springframework.scheduling.support.CronTrigger (implements org.springframework.scheduling.Trigger)
    • org.springframework.beans.factory.annotation.CustomAutowireConfigurer (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.core.Ordered)
    • org.springframework.beans.factory.config.CustomEditorConfigurer (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.core.Ordered)
    • org.springframework.util.CustomizableThreadCreator (implements java.io.Serializable)
      • org.springframework.scheduling.backportconcurrent.CustomizableThreadFactory (implements edu.emory.mathcs.backport.java.util.concurrent.ThreadFactory)
        • org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, edu.emory.mathcs.backport.java.util.concurrent.Executor, org.springframework.beans.factory.InitializingBean, org.springframework.scheduling.SchedulingTaskExecutor)
      • org.springframework.scheduling.concurrent.CustomizableThreadFactory (implements java.util.concurrent.ThreadFactory)
        • org.springframework.scheduling.concurrent.ExecutorConfigurationSupport (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean)
          • org.springframework.scheduling.concurrent.ScheduledExecutorFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>)
          • org.springframework.scheduling.concurrent.ThreadPoolExecutorFactoryBean (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
          • org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor (implements org.springframework.scheduling.SchedulingTaskExecutor)
          • org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler (implements org.springframework.scheduling.SchedulingTaskExecutor, org.springframework.scheduling.TaskScheduler)
      • org.springframework.core.task.SimpleAsyncTaskExecutor (implements org.springframework.core.task.AsyncTaskExecutor, java.io.Serializable)
    • org.springframework.beans.factory.config.CustomScopeConfigurer (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.core.Ordered)
    • org.springframework.jdbc.support.CustomSQLErrorCodesTranslation
    • org.springframework.dao.support.DaoSupport (implements org.springframework.beans.factory.InitializingBean)
      • org.springframework.jca.cci.core.support.CciDaoSupport
      • org.springframework.orm.hibernate3.support.HibernateDaoSupport
      • org.springframework.jdbc.core.support.JdbcDaoSupport
        • org.springframework.jdbc.core.namedparam.NamedParameterJdbcDaoSupport
        • org.springframework.jdbc.core.simple.SimpleJdbcDaoSupport
      • org.springframework.orm.jdo.support.JdoDaoSupport
      • org.springframework.orm.jpa.support.JpaDaoSupport
      • org.springframework.orm.ibatis.support.SqlMapClientDaoSupport
    • org.springframework.dao.support.DataAccessUtils
    • org.springframework.jdbc.support.DatabaseStartupValidator (implements org.springframework.beans.factory.InitializingBean)
    • org.springframework.validation.DataBinder (implements org.springframework.beans.PropertyEditorRegistry, org.springframework.beans.TypeConverter)
      • org.springframework.web.bind.WebDataBinder
        • org.springframework.web.portlet.bind.PortletRequestDataBinder
        • org.springframework.web.bind.ServletRequestDataBinder
        • org.springframework.web.bind.support.WebRequestDataBinder
    • org.springframework.jdbc.datasource.init.DataSourceInitializer (implements org.springframework.beans.factory.InitializingBean)
    • org.springframework.jdbc.datasource.DataSourceUtils
    • org.springframework.format.datetime.DateFormatter (implements org.springframework.format.Formatter<T>)
    • org.springframework.format.datetime.joda.DateTimeParser (implements org.springframework.format.Parser<T>)
    • org.springframework.aop.aspectj.DeclareParentsAdvisor (implements org.springframework.aop.IntroductionAdvisor)
    • org.springframework.aop.framework.adapter.DefaultAdvisorAdapterRegistry (implements org.springframework.aop.framework.adapter.AdvisorAdapterRegistry, java.io.Serializable)
    • org.springframework.aop.framework.DefaultAdvisorChainFactory (implements org.springframework.aop.framework.AdvisorChainFactory, java.io.Serializable)
    • org.springframework.aop.framework.DefaultAopProxyFactory (implements org.springframework.aop.framework.AopProxyFactory, java.io.Serializable)
    • org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader (implements org.springframework.beans.factory.xml.BeanDefinitionDocumentReader)
    • org.springframework.beans.factory.support.DefaultBeanNameGenerator (implements org.springframework.beans.factory.support.BeanNameGenerator)
    • org.springframework.validation.DefaultBindingErrorProcessor (implements org.springframework.validation.BindingErrorProcessor)
    • org.springframework.context.weaving.DefaultContextLoadTimeWeaver (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.DisposableBean, org.springframework.instrument.classloading.LoadTimeWeaver)
    • org.springframework.beans.factory.xml.DefaultDocumentLoader (implements org.springframework.beans.factory.xml.DocumentLoader)
    • org.springframework.aop.support.DefaultIntroductionAdvisor (implements org.springframework.aop.ClassFilter, org.springframework.aop.IntroductionAdvisor, org.springframework.core.Ordered, java.io.Serializable)
    • org.springframework.orm.jdo.DefaultJdoDialect (implements org.springframework.orm.jdo.JdoDialect, org.springframework.dao.support.PersistenceExceptionTranslator)
    • org.springframework.orm.jpa.DefaultJpaDialect (implements org.springframework.orm.jpa.JpaDialect, java.io.Serializable)
      • org.springframework.orm.jpa.vendor.EclipseLinkJpaDialect
      • org.springframework.orm.jpa.vendor.HibernateJpaDialect
      • org.springframework.orm.jpa.vendor.OpenJpaDialect
      • org.springframework.orm.jpa.vendor.TopLinkJpaDialect
    • org.springframework.context.support.DefaultLifecycleProcessor (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.context.LifecycleProcessor)
    • org.springframework.jdbc.support.lob.DefaultLobHandler.DefaultLobCreator (implements org.springframework.jdbc.support.lob.LobCreator)
    • org.apache.tiles.locale.impl.DefaultLocaleResolver (implements org.apache.tiles.locale.LocaleResolver)
      • org.springframework.web.servlet.view.tiles2.SpringLocaleResolver
    • org.springframework.context.access.DefaultLocatorFactory
    • org.springframework.validation.DefaultMessageCodesResolver (implements org.springframework.validation.MessageCodesResolver, java.io.Serializable)
    • org.springframework.context.support.DefaultMessageSourceResolvable (implements org.springframework.context.MessageSourceResolvable, java.io.Serializable)
      • org.springframework.validation.ObjectError
        • org.springframework.validation.FieldError
    • org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver (implements org.springframework.beans.factory.xml.NamespaceHandlerResolver)
    • org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager (implements org.springframework.beans.factory.InitializingBean, org.springframework.context.weaving.LoadTimeWeaverAware, org.springframework.orm.jpa.persistenceunit.PersistenceUnitManager, org.springframework.context.ResourceLoaderAware)
    • org.springframework.util.DefaultPropertiesPersister (implements org.springframework.util.PropertiesPersister)
    • org.springframework.remoting.support.DefaultRemoteInvocationExecutor (implements org.springframework.remoting.support.RemoteInvocationExecutor)
    • org.springframework.remoting.support.DefaultRemoteInvocationFactory (implements org.springframework.remoting.support.RemoteInvocationFactory)
    • org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator (implements org.springframework.web.servlet.RequestToViewNameTranslator)
    • org.springframework.core.io.DefaultResourceLoader (implements org.springframework.core.io.ResourceLoader)
      • org.springframework.context.support.AbstractApplicationContext (implements org.springframework.context.ConfigurableApplicationContext, org.springframework.beans.factory.DisposableBean)
        • org.springframework.context.support.AbstractRefreshableApplicationContext
          • org.springframework.context.support.AbstractRefreshableConfigApplicationContext (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean)
            • org.springframework.web.portlet.context.AbstractRefreshablePortletApplicationContext (implements org.springframework.web.portlet.context.ConfigurablePortletApplicationContext, org.springframework.web.context.WebApplicationContext)
              • org.springframework.web.portlet.context.XmlPortletApplicationContext
            • org.springframework.web.context.support.AbstractRefreshableWebApplicationContext (implements org.springframework.web.context.ConfigurableWebApplicationContext, org.springframework.ui.context.ThemeSource)
              • org.springframework.web.context.support.AnnotationConfigWebApplicationContext
              • org.springframework.web.context.support.XmlWebApplicationContext
            • org.springframework.context.support.AbstractXmlApplicationContext
              • org.springframework.context.support.ClassPathXmlApplicationContext
              • org.springframework.context.support.FileSystemXmlApplicationContext
        • org.springframework.context.support.GenericApplicationContext (implements org.springframework.beans.factory.support.BeanDefinitionRegistry)
          • org.springframework.context.annotation.AnnotationConfigApplicationContext
          • org.springframework.web.context.support.GenericWebApplicationContext (implements org.springframework.ui.context.ThemeSource, org.springframework.web.context.WebApplicationContext)
          • org.springframework.context.support.GenericXmlApplicationContext
          • org.springframework.jca.context.ResourceAdapterApplicationContext
          • org.springframework.context.support.StaticApplicationContext
            • org.springframework.web.portlet.context.StaticPortletApplicationContext (implements org.springframework.web.portlet.context.ConfigurablePortletApplicationContext)
            • org.springframework.web.context.support.StaticWebApplicationContext (implements org.springframework.web.context.ConfigurableWebApplicationContext, org.springframework.ui.context.ThemeSource)
      • org.springframework.core.io.ClassRelativeResourceLoader
      • org.springframework.core.io.FileSystemResourceLoader
      • org.springframework.web.portlet.context.PortletContextResourceLoader
      • org.springframework.web.context.support.ServletContextResourceLoader
    • org.springframework.web.client.DefaultResponseErrorHandler (implements org.springframework.web.client.ResponseErrorHandler)
    • org.springframework.aop.scope.DefaultScopedObject (implements org.springframework.aop.scope.ScopedObject, java.io.Serializable)
    • org.springframework.web.bind.support.DefaultSessionAttributeStore (implements org.springframework.web.bind.support.SessionAttributeStore)
    • org.springframework.core.style.DefaultToStringStyler (implements org.springframework.core.style.ToStringStyler)
    • org.springframework.transaction.support.DefaultTransactionDefinition (implements java.io.Serializable, org.springframework.transaction.TransactionDefinition)
      • org.springframework.transaction.interceptor.DefaultTransactionAttribute (implements org.springframework.transaction.interceptor.TransactionAttribute)
        • org.springframework.transaction.interceptor.RuleBasedTransactionAttribute (implements java.io.Serializable)
      • org.springframework.transaction.support.TransactionTemplate (implements org.springframework.beans.factory.InitializingBean, org.springframework.transaction.support.TransactionOperations)
    • org.springframework.core.style.DefaultValueStyler (implements org.springframework.core.style.ValueStyler)
    • org.springframework.web.struts.DelegatingActionUtils
    • org.springframework.jca.cci.connection.DelegatingConnectionFactory (implements javax.resource.cci.ConnectionFactory, org.springframework.beans.factory.InitializingBean)
      • org.springframework.jca.cci.connection.ConnectionSpecConnectionFactoryAdapter
      • org.springframework.jca.cci.connection.SingleConnectionFactory (implements org.springframework.beans.factory.DisposableBean)
      • org.springframework.jca.cci.connection.TransactionAwareConnectionFactoryProxy
    • org.springframework.jms.connection.DelegatingConnectionFactory (implements org.springframework.beans.factory.InitializingBean, javax.jms.QueueConnectionFactory, org.springframework.jms.connection.SmartConnectionFactory, javax.jms.TopicConnectionFactory)
    • org.springframework.jdbc.datasource.DelegatingDataSource (implements javax.sql.DataSource, org.springframework.beans.factory.InitializingBean)
      • org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy
      • org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy
      • org.springframework.jdbc.datasource.UserCredentialsDataSourceAdapter
        • org.springframework.jdbc.datasource.IsolationLevelDataSourceAdapter
          • org.springframework.jdbc.datasource.WebSphereDataSourceAdapter
    • org.springframework.beans.factory.xml.DelegatingEntityResolver (implements org.xml.sax.EntityResolver)
      • org.springframework.beans.factory.xml.ResourceEntityResolver
    • org.springframework.scheduling.support.DelegatingErrorHandlingRunnable (implements java.lang.Runnable)
    • org.springframework.scheduling.quartz.DelegatingJob (implements org.quartz.Job)
    • org.springframework.web.jsf.DelegatingPhaseListenerMulticaster (implements javax.faces.event.PhaseListener)
    • org.springframework.ui.context.support.DelegatingThemeSource (implements org.springframework.ui.context.HierarchicalThemeSource)
    • org.springframework.scheduling.commonj.DelegatingTimerListener (implements commonj.timers.TimerListener)
    • org.springframework.transaction.support.DelegatingTransactionDefinition (implements java.io.Serializable, org.springframework.transaction.TransactionDefinition)
      • org.springframework.transaction.interceptor.DelegatingTransactionAttribute (implements java.io.Serializable, org.springframework.transaction.interceptor.TransactionAttribute)
    • org.springframework.jca.work.DelegatingWork (implements javax.resource.spi.work.Work)
    • org.springframework.scheduling.commonj.DelegatingWork (implements commonj.work.Work)
    • org.springframework.beans.factory.config.DependencyDescriptor (implements java.io.Serializable)
    • org.springframework.web.context.request.DestructionCallbackBindingListener (implements javax.servlet.http.HttpSessionBindingListener, java.io.Serializable)
    • java.util.Dictionary<K,V>
      • java.util.Hashtable<K,V> (implements java.lang.Cloneable, java.util.Map<K,V>, java.io.Serializable)
        • java.util.Properties
          • org.springframework.beans.factory.support.ManagedProperties (implements org.springframework.beans.BeanMetadataElement, org.springframework.beans.Mergeable)
    • org.springframework.util.DigestUtils
    • org.springframework.beans.factory.xml.DocumentDefaultsDefinition (implements org.springframework.beans.factory.parsing.DefaultsDefinition)
    • org.springframework.util.xml.DomUtils
    • org.springframework.jms.support.destination.DynamicDestinationResolver (implements org.springframework.jms.support.destination.DestinationResolver)
    • org.springframework.aop.support.DynamicMethodMatcher (implements org.springframework.aop.MethodMatcher)
      • org.springframework.aop.support.DynamicMethodMatcherPointcut (implements org.springframework.aop.Pointcut)
    • org.springframework.cache.ehcache.EhCacheFactoryBean (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.cache.ehcache.EhCacheManagerFactoryBean (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.jca.cci.object.EisOperation (implements org.springframework.beans.factory.InitializingBean)
      • org.springframework.jca.cci.object.MappingRecordOperation
        • org.springframework.jca.cci.object.MappingCommAreaOperation
      • org.springframework.jca.cci.object.SimpleRecordOperation
    • org.springframework.transaction.annotation.Ejb3TransactionAnnotationParser (implements java.io.Serializable, org.springframework.transaction.annotation.TransactionAnnotationParser)
    • javax.el.ELResolver
      • org.springframework.beans.factory.access.el.SpringBeanELResolver
        • org.springframework.beans.factory.access.el.SimpleSpringBeanELResolver
        • org.springframework.web.jsf.el.SpringBeanFacesELResolver
      • org.springframework.web.jsf.el.WebApplicationContextFacesELResolver
    • org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder
    • org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory
      • org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactoryBean (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.hibernate.EmptyInterceptor (implements org.hibernate.Interceptor, java.io.Serializable)
      • org.springframework.orm.hibernate3.support.ScopedBeanInterceptor
    • org.springframework.beans.factory.parsing.EmptyReaderEventListener (implements org.springframework.beans.factory.parsing.ReaderEventListener)
    • org.springframework.aop.target.EmptyTargetSource (implements java.io.Serializable, org.springframework.aop.TargetSource)
    • org.springframework.core.io.support.EncodedResource
    • org.springframework.orm.jpa.EntityManagerFactoryAccessor
      • org.springframework.orm.jpa.JpaAccessor (implements org.springframework.beans.factory.InitializingBean)
        • org.springframework.orm.jpa.JpaInterceptor (implements org.aopalliance.intercept.MethodInterceptor)
        • org.springframework.orm.jpa.JpaTemplate (implements org.springframework.orm.jpa.JpaOperations)
      • org.springframework.orm.jpa.support.OpenEntityManagerInViewInterceptor (implements org.springframework.web.context.request.WebRequestInterceptor)
      • org.springframework.orm.jpa.support.SharedEntityManagerBean (implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.orm.jpa.EntityManagerFactoryUtils
    • org.springframework.web.bind.EscapedErrors (implements org.springframework.validation.Errors)
    • java.util.EventObject (implements java.io.Serializable)
      • org.springframework.context.ApplicationEvent
        • org.springframework.context.event.ApplicationContextEvent
          • org.springframework.context.event.ContextClosedEvent
          • org.springframework.context.event.ContextRefreshedEvent
          • org.springframework.context.event.ContextStartedEvent
          • org.springframework.context.event.ContextStoppedEvent
        • org.springframework.web.context.support.RequestHandledEvent
          • org.springframework.web.portlet.context.PortletRequestHandledEvent
          • org.springframework.web.context.support.ServletRequestHandledEvent
    • org.springframework.context.event.EventPublicationInterceptor (implements org.springframework.context.ApplicationEventPublisherAware, org.springframework.beans.factory.InitializingBean, org.aopalliance.intercept.MethodInterceptor)
    • org.springframework.aop.interceptor.ExposeBeanNameAdvisors
    • org.springframework.aop.interceptor.ExposeInvocationInterceptor (implements org.aopalliance.intercept.MethodInterceptor, org.springframework.core.Ordered, java.io.Serializable)
    • org.springframework.web.util.ExpressionEvaluationUtils
    • javax.servlet.jsp.el.ExpressionEvaluator
      • org.springframework.mock.web.MockExpressionEvaluator
    • org.springframework.expression.spel.ExpressionState
    • org.springframework.expression.common.ExpressionUtils
    • org.springframework.orm.jpa.ExtendedEntityManagerCreator
    • org.springframework.web.jsf.FacesContextUtils
    • org.springframework.web.context.request.FacesRequestAttributes (implements org.springframework.web.context.request.RequestAttributes)
      • org.springframework.web.context.request.FacesWebRequest (implements org.springframework.web.context.request.NativeWebRequest)
    • org.springframework.beans.factory.parsing.FailFastProblemReporter (implements org.springframework.beans.factory.parsing.ProblemReporter)
    • org.springframework.beans.factory.config.FieldRetrievingFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.util.FileCopyUtils
    • org.springframework.util.FileSystemUtils
    • javax.activation.FileTypeMap
      • org.springframework.mail.javamail.ConfigurableMimeFileTypeMap (implements org.springframework.beans.factory.InitializingBean)
    • org.springframework.orm.hibernate3.FilterDefinitionFactoryBean (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.expression.spel.ast.FormatHelper
    • org.springframework.format.support.FormattingConversionServiceFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.http.converter.FormHttpMessageConverter (implements org.springframework.http.converter.HttpMessageConverter<T>)
    • org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
      • org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean, org.springframework.context.ResourceLoaderAware)
      • org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer (implements org.springframework.web.servlet.view.freemarker.FreeMarkerConfig, org.springframework.beans.factory.InitializingBean, org.springframework.context.ResourceLoaderAware, org.springframework.web.context.ServletContextAware)
    • org.springframework.ui.freemarker.FreeMarkerTemplateUtils
    • org.springframework.jdbc.support.GeneratedKeyHolder (implements org.springframework.jdbc.support.KeyHolder)
    • org.springframework.context.event.GenericApplicationListenerAdapter (implements org.springframework.context.event.SmartApplicationListener)
    • org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider (implements org.springframework.jdbc.core.metadata.CallMetaDataProvider)
      • org.springframework.jdbc.core.metadata.Db2CallMetaDataProvider
      • org.springframework.jdbc.core.metadata.DerbyCallMetaDataProvider
      • org.springframework.jdbc.core.metadata.OracleCallMetaDataProvider
      • org.springframework.jdbc.core.metadata.PostgresCallMetaDataProvider
      • org.springframework.jdbc.core.metadata.SqlServerCallMetaDataProvider
      • org.springframework.jdbc.core.metadata.SybaseCallMetaDataProvider
    • org.springframework.core.GenericCollectionTypeResolver
    • org.springframework.core.convert.support.GenericConversionService (implements org.springframework.core.convert.ConversionService, org.springframework.core.convert.converter.ConverterRegistry)
      • org.springframework.format.support.FormattingConversionService (implements org.springframework.format.FormatterRegistry)
    • org.springframework.core.convert.converter.GenericConverter.ConvertiblePair
    • org.springframework.web.filter.GenericFilterBean (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, javax.servlet.Filter, org.springframework.beans.factory.InitializingBean, org.springframework.web.context.ServletContextAware)
      • org.springframework.web.filter.DelegatingFilterProxy
      • org.springframework.web.filter.OncePerRequestFilter
        • org.springframework.web.filter.AbstractRequestLoggingFilter
          • org.springframework.web.filter.CommonsRequestLoggingFilter
          • org.springframework.web.filter.Log4jNestedDiagnosticContextFilter
          • org.springframework.web.filter.ServletContextRequestLoggingFilter
        • org.springframework.web.filter.CharacterEncodingFilter
        • org.springframework.web.filter.HiddenHttpMethodFilter
        • org.springframework.web.multipart.support.MultipartFilter
        • org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter
        • org.springframework.orm.jdo.support.OpenPersistenceManagerInViewFilter
        • org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
        • org.springframework.web.filter.RequestContextFilter
        • org.springframework.web.filter.ShallowEtagHeaderFilter
    • org.springframework.jca.endpoint.GenericMessageEndpointManager (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.SmartLifecycle)
      • org.springframework.jms.listener.endpoint.JmsMessageEndpointManager
    • javax.portlet.GenericPortlet (implements javax.portlet.EventPortlet, javax.portlet.Portlet, javax.portlet.PortletConfig, javax.portlet.ResourceServingPortlet)
      • org.springframework.web.portlet.GenericPortletBean
        • org.springframework.web.portlet.FrameworkPortlet (implements org.springframework.context.ApplicationListener<E>)
          • org.springframework.web.portlet.DispatcherPortlet
    • javax.servlet.GenericServlet (implements java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig)
      • javax.servlet.http.HttpServlet (implements java.io.Serializable)
        • org.springframework.web.context.support.HttpRequestHandlerServlet
        • org.springframework.web.servlet.HttpServletBean
          • org.springframework.web.servlet.FrameworkServlet
            • org.springframework.web.servlet.DispatcherServlet
          • org.springframework.web.servlet.ResourceServlet
        • org.springframework.web.servlet.ViewRendererServlet
    • org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider (implements org.springframework.jdbc.core.metadata.TableMetaDataProvider)
      • org.springframework.jdbc.core.metadata.DerbyTableMetaDataProvider
      • org.springframework.jdbc.core.metadata.HsqlTableMetaDataProvider
      • org.springframework.jdbc.core.metadata.OracleTableMetaDataProvider
      • org.springframework.jdbc.core.metadata.PostgresTableMetaDataProvider
    • org.springframework.core.GenericTypeResolver
    • org.springframework.instrument.classloading.glassfish.GlassFishLoadTimeWeaver (implements org.springframework.instrument.classloading.LoadTimeWeaver)
    • org.springframework.aop.framework.adapter.GlobalAdvisorAdapterRegistry
    • org.springframework.scripting.groovy.GroovyScriptFactory (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.scripting.ScriptFactory)
    • org.springframework.web.portlet.HandlerExecutionChain
    • org.springframework.web.servlet.HandlerExecutionChain
    • org.springframework.web.portlet.handler.HandlerInterceptorAdapter (implements org.springframework.web.portlet.HandlerInterceptor)
      • org.springframework.web.portlet.handler.ParameterMappingInterceptor
      • org.springframework.web.portlet.handler.UserRoleAuthorizationInterceptor
    • org.springframework.web.servlet.handler.HandlerInterceptorAdapter (implements org.springframework.web.servlet.HandlerInterceptor)
      • org.springframework.web.servlet.handler.ConversionServiceExposingInterceptor
      • org.springframework.web.servlet.i18n.LocaleChangeInterceptor
      • org.springframework.web.servlet.theme.ThemeChangeInterceptor
      • org.springframework.web.servlet.handler.UserRoleAuthorizationInterceptor
    • org.springframework.web.bind.annotation.support.HandlerMethodInvoker
    • org.springframework.web.bind.annotation.support.HandlerMethodResolver
    • org.springframework.orm.hibernate3.HibernateAccessor (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean)
      • org.springframework.orm.hibernate3.HibernateInterceptor (implements org.aopalliance.intercept.MethodInterceptor)
      • org.springframework.orm.hibernate3.HibernateTemplate (implements org.springframework.orm.hibernate3.HibernateOperations)
      • org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor (implements org.springframework.web.context.request.WebRequestInterceptor)
    • org.springframework.aop.target.HotSwappableTargetSource (implements java.io.Serializable, org.springframework.aop.TargetSource)
    • org.springframework.web.util.HtmlUtils
    • org.springframework.http.client.support.HttpAccessor
      • org.springframework.web.client.RestTemplate (implements org.springframework.web.client.RestOperations)
    • org.springframework.http.HttpEntity<T>
      • org.springframework.http.ResponseEntity<T>
    • org.springframework.http.HttpHeaders (implements org.springframework.util.MultiValueMap<K,V>)
    • org.springframework.web.client.HttpMessageConverterExtractor<T> (implements org.springframework.web.client.ResponseExtractor<T>)
    • org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter (implements org.springframework.web.servlet.HandlerAdapter)
    • org.springframework.web.util.HttpSessionMutexListener (implements javax.servlet.http.HttpSessionListener)
    • org.springframework.jmx.export.naming.IdentityNamingStrategy (implements org.springframework.jmx.export.naming.ObjectNamingStrategy)
    • org.springframework.beans.factory.parsing.ImportDefinition (implements org.springframework.beans.BeanMetadataElement)
    • org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor (implements org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor, org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor, org.springframework.core.PriorityOrdered, java.io.Serializable)
      • org.springframework.context.annotation.CommonAnnotationBeanPostProcessor (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor, java.io.Serializable)
    • org.springframework.beans.factory.annotation.InjectionMetadata
    • org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement
      • org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.LookupElement
    • java.io.InputStream (implements java.io.Closeable)
      • java.io.ObjectInputStream (implements java.io.ObjectInput, java.io.ObjectStreamConstants)
        • org.springframework.core.ConfigurableObjectInputStream
          • org.springframework.remoting.rmi.CodebaseAwareObjectInputStream
      • javax.servlet.ServletInputStream
        • org.springframework.mock.web.DelegatingServletInputStream
    • org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter (implements org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor)
      • org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor, org.springframework.core.PriorityOrdered)
      • org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor, org.springframework.core.PriorityOrdered)
      • org.springframework.scripting.support.ScriptFactoryPostProcessor (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.core.Ordered, org.springframework.context.ResourceLoaderAware)
    • org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver (implements org.springframework.instrument.classloading.LoadTimeWeaver)
    • org.springframework.instrument.InstrumentationSavingAgent
    • org.springframework.aop.support.IntroductionInfoSupport (implements org.springframework.aop.IntroductionInfo, java.io.Serializable)
      • org.springframework.aop.support.DelegatePerTargetObjectIntroductionInterceptor (implements org.springframework.aop.IntroductionInterceptor)
      • org.springframework.aop.support.DelegatingIntroductionInterceptor (implements org.springframework.aop.IntroductionInterceptor)
    • org.springframework.web.util.IntrospectorCleanupListener (implements javax.servlet.ServletContextListener)
    • org.springframework.util.comparator.InvertibleComparator<T> (implements java.util.Comparator<T>, java.io.Serializable)
    • org.springframework.ui.jasperreports.JasperReportsUtils
    • org.springframework.mail.javamail.JavaMailSenderImpl (implements org.springframework.mail.javamail.JavaMailSender)
    • org.springframework.web.util.JavaScriptUtils
    • org.springframework.oxm.jaxb.Jaxb2Marshaller (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.oxm.GenericMarshaller, org.springframework.oxm.GenericUnmarshaller, org.springframework.beans.factory.InitializingBean, org.springframework.oxm.mime.MimeMarshaller, org.springframework.oxm.mime.MimeUnmarshaller)
    • org.springframework.instrument.classloading.jboss.JBossLoadTimeWeaver (implements org.springframework.instrument.classloading.LoadTimeWeaver)
    • org.springframework.jca.work.jboss.JBossWorkManagerUtils
    • org.springframework.jdbc.support.xml.Jdbc4SqlXmlHandler (implements org.springframework.jdbc.support.xml.SqlXmlHandler)
    • org.springframework.jdbc.support.JdbcAccessor (implements org.springframework.beans.factory.InitializingBean)
      • org.springframework.jdbc.core.JdbcTemplate (implements org.springframework.jdbc.core.JdbcOperations)
      • org.springframework.orm.ibatis.SqlMapClientTemplate (implements org.springframework.orm.ibatis.SqlMapClientOperations)
    • org.springframework.jdbc.core.support.JdbcBeanDefinitionReader
    • org.springframework.test.jdbc.JdbcTestUtils
    • org.springframework.jdbc.datasource.JdbcTransactionObjectSupport (implements org.springframework.transaction.SavepointManager, org.springframework.transaction.support.SmartTransactionObject)
    • org.springframework.jdbc.support.JdbcUtils
    • org.springframework.core.JdkVersion
    • org.springframework.orm.jdo.JdoAccessor (implements org.springframework.beans.factory.InitializingBean)
      • org.springframework.orm.jdo.JdoInterceptor (implements org.aopalliance.intercept.MethodInterceptor)
      • org.springframework.orm.jdo.JdoTemplate (implements org.springframework.orm.jdo.JdoOperations)
      • org.springframework.orm.jdo.support.SpringPersistenceManagerProxyBean (implements org.springframework.beans.factory.FactoryBean<T>)
    • org.springframework.jms.support.JmsAccessor (implements org.springframework.beans.factory.InitializingBean)
      • org.springframework.jms.support.destination.JmsDestinationAccessor
        • org.springframework.jms.listener.AbstractJmsListeningContainer (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.context.SmartLifecycle)
          • org.springframework.jms.listener.AbstractMessageListenerContainer
            • org.springframework.jms.listener.AbstractPollingMessageListenerContainer (implements org.springframework.beans.factory.BeanNameAware)
              • org.springframework.jms.listener.DefaultMessageListenerContainer
                • org.springframework.jms.listener.DefaultMessageListenerContainer102
            • org.springframework.jms.listener.SimpleMessageListenerContainer (implements javax.jms.ExceptionListener)
              • org.springframework.jms.listener.SimpleMessageListenerContainer102
        • org.springframework.jms.core.JmsTemplate (implements org.springframework.jms.core.JmsOperations)
          • org.springframework.jms.core.JmsTemplate102
    • org.springframework.jms.listener.endpoint.JmsActivationSpecConfig
    • org.springframework.jms.core.support.JmsGatewaySupport (implements org.springframework.beans.factory.InitializingBean)
    • org.springframework.jms.remoting.JmsInvokerClientInterceptor (implements org.springframework.beans.factory.InitializingBean, org.aopalliance.intercept.MethodInterceptor)
      • org.springframework.jms.remoting.JmsInvokerProxyFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.FactoryBean<T>)
    • org.springframework.jms.support.JmsUtils
    • org.springframework.jmx.export.metadata.JmxMetadataUtils
    • org.springframework.jmx.support.JmxUtils
    • org.springframework.jndi.JndiAccessor
      • org.springframework.jndi.JndiLocatorSupport
        • org.springframework.context.access.ContextJndiBeanFactoryLocator (implements org.springframework.beans.factory.access.BeanFactoryLocator)
        • org.springframework.jdbc.datasource.lookup.JndiDataSourceLookup (implements org.springframework.jdbc.datasource.lookup.DataSourceLookup)
        • org.springframework.jms.support.destination.JndiDestinationResolver (implements org.springframework.jms.support.destination.CachingDestinationResolver)
        • org.springframework.jndi.JndiLocatorDelegate
        • org.springframework.jndi.JndiObjectLocator (implements org.springframework.beans.factory.InitializingBean)
          • org.springframework.ejb.access.AbstractSlsbInvokerInterceptor (implements org.aopalliance.intercept.MethodInterceptor)
            • org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor
              • org.springframework.ejb.access.SimpleRemoteSlsbInvokerInterceptor (implements org.springframework.beans.factory.DisposableBean)
                • org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.FactoryBean<T>)
            • org.springframework.ejb.access.LocalSlsbInvokerInterceptor
              • org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.FactoryBean<T>)
          • org.springframework.jndi.JndiObjectFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.FactoryBean<T>)
          • org.springframework.jndi.JndiObjectTargetSource (implements org.springframework.aop.TargetSource)
          • org.springframework.remoting.rmi.JndiRmiClientInterceptor (implements org.springframework.beans.factory.InitializingBean, org.aopalliance.intercept.MethodInterceptor)
            • org.springframework.remoting.rmi.JndiRmiProxyFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.FactoryBean<T>)
        • org.springframework.jndi.support.SimpleJndiBeanFactory (implements org.springframework.beans.factory.BeanFactory)
        • org.springframework.scheduling.commonj.TimerManagerAccessor (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle)
          • org.springframework.scheduling.commonj.TimerManagerFactoryBean (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle)
          • org.springframework.scheduling.commonj.TimerManagerTaskScheduler (implements org.springframework.scheduling.TaskScheduler)
        • org.springframework.jca.work.WorkManagerTaskExecutor (implements org.springframework.core.task.AsyncTaskExecutor, org.springframework.jca.context.BootstrapContextAware, org.springframework.beans.factory.InitializingBean, org.springframework.scheduling.SchedulingTaskExecutor, javax.resource.spi.work.WorkManager)
          • org.springframework.jca.work.glassfish.GlassFishWorkManagerTaskExecutor
          • org.springframework.jca.work.jboss.JBossWorkManagerTaskExecutor
        • org.springframework.scheduling.commonj.WorkManagerTaskExecutor (implements org.springframework.beans.factory.InitializingBean, org.springframework.scheduling.SchedulingTaskExecutor, commonj.work.WorkManager)
    • org.springframework.jndi.JndiTemplate
      • org.springframework.mock.jndi.ExpectedLookupTemplate
    • org.quartz.JobDetail (implements java.lang.Cloneable, java.io.Serializable)
      • org.springframework.scheduling.quartz.JobDetailBean (implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean)
    • org.quartz.impl.jdbcjobstore.JobStoreSupport (implements org.quartz.impl.jdbcjobstore.Constants, org.quartz.spi.JobStore)
      • org.quartz.impl.jdbcjobstore.JobStoreCMT
        • org.springframework.scheduling.quartz.LocalDataSourceJobStore
    • org.springframework.format.datetime.joda.JodaDateTimeFormatAnnotationFormatterFactory (implements org.springframework.format.AnnotationFormatterFactory<A>)
    • org.springframework.format.datetime.joda.JodaTimeContext
    • org.springframework.format.datetime.joda.JodaTimeContextHolder
    • org.springframework.format.datetime.joda.JodaTimeFormattingConfigurer
    • org.springframework.scripting.jruby.JRubyScriptFactory (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.scripting.ScriptFactory)
    • org.springframework.scripting.jruby.JRubyScriptUtils
    • javax.servlet.jsp.JspContext
      • javax.servlet.jsp.PageContext
        • org.springframework.mock.web.MockPageContext
    • org.springframework.context.annotation.Jsr330ScopeMetadataResolver (implements org.springframework.context.annotation.ScopeMetadataResolver)
    • org.springframework.web.servlet.support.JstlUtils
    • org.springframework.transaction.jta.JtaAfterCompletionSynchronization (implements javax.transaction.Synchronization)
    • org.springframework.jdbc.support.lob.JtaLobCreatorSynchronization (implements javax.transaction.Synchronization)
    • org.springframework.transaction.jta.JtaTransactionObject (implements org.springframework.transaction.support.SmartTransactionObject)
    • org.springframework.jmx.export.naming.KeyNamingStrategy (implements org.springframework.beans.factory.InitializingBean, org.springframework.jmx.export.naming.ObjectNamingStrategy)
    • org.springframework.scripting.config.LangNamespaceUtils
    • org.springframework.aop.aspectj.annotation.LazySingletonAspectInstanceFactoryDecorator (implements org.springframework.aop.aspectj.annotation.MetadataAwareAspectInstanceFactory)
    • org.springframework.util.LinkedMultiValueMap<K,V> (implements org.springframework.util.MultiValueMap<K,V>, java.io.Serializable)
    • org.springframework.expression.common.LiteralExpression (implements org.springframework.expression.Expression)
    • org.springframework.context.weaving.LoadTimeWeaverAwareProcessor (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.config.BeanPostProcessor)
    • org.springframework.jdbc.support.lob.LobCreatorUtils
    • org.springframework.orm.hibernate3.LocalCacheProviderProxy (implements org.hibernate.cache.CacheProvider)
    • org.springframework.jca.support.LocalConnectionFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider (implements org.hibernate.connection.ConnectionProvider)
      • org.springframework.orm.hibernate3.LocalJtaDataSourceConnectionProvider
      • org.springframework.orm.hibernate3.TransactionAwareDataSourceConnectionProvider
    • org.springframework.context.i18n.LocaleContextHolder
    • org.springframework.validation.beanvalidation.LocaleContextMessageInterpolator (implements javax.validation.MessageInterpolator)
    • org.springframework.core.io.support.LocalizedResourceHelper
    • org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
      • org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor (implements org.springframework.beans.factory.InitializingBean, org.aopalliance.intercept.MethodInterceptor)
        • org.springframework.remoting.jaxrpc.JaxRpcPortProxyFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.FactoryBean<T>)
      • org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.remoting.jaxws.LocalJaxWsServiceFactory
      • org.springframework.remoting.jaxws.JaxWsPortClientInterceptor (implements org.springframework.beans.factory.InitializingBean, org.aopalliance.intercept.MethodInterceptor)
        • org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.FactoryBean<T>)
      • org.springframework.remoting.jaxws.LocalJaxWsServiceFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean, org.springframework.dao.support.PersistenceExceptionTranslator)
    • org.springframework.orm.hibernate3.LocalRegionFactoryProxy (implements org.hibernate.cache.RegionFactory)
    • org.springframework.scheduling.quartz.LocalTaskExecutorThreadPool (implements org.quartz.spi.ThreadPool)
    • org.springframework.orm.hibernate3.LocalTransactionManagerLookup (implements org.hibernate.transaction.TransactionManagerLookup)
    • org.springframework.core.LocalVariableTableParameterNameDiscoverer (implements org.springframework.core.ParameterNameDiscoverer)
    • org.springframework.beans.factory.parsing.Location
    • org.springframework.web.util.Log4jConfigListener (implements javax.servlet.ServletContextListener)
    • org.springframework.util.Log4jConfigurer
    • org.springframework.web.context.request.Log4jNestedDiagnosticContextInterceptor (implements org.springframework.web.context.request.WebRequestInterceptor)
    • org.springframework.web.util.Log4jWebConfigurer
    • org.springframework.jmx.export.metadata.ManagedNotification
    • org.springframework.jmx.export.metadata.ManagedOperationParameter
    • org.springframework.transaction.jta.ManagedTransactionAdapter (implements javax.transaction.Transaction)
    • org.springframework.context.expression.MapAccessor (implements org.springframework.expression.PropertyAccessor)
    • org.springframework.jdbc.datasource.lookup.MapDataSourceLookup (implements org.springframework.jdbc.datasource.lookup.DataSourceLookup)
    • org.springframework.web.servlet.handler.MappedInterceptor
    • org.springframework.jca.cci.object.MappingRecordOperation.RecordCreatorImpl (implements org.springframework.jca.cci.core.RecordCreator)
    • org.springframework.jca.cci.object.MappingRecordOperation.RecordExtractorImpl (implements org.springframework.jca.cci.core.RecordExtractor<T>)
    • org.springframework.jdbc.object.MappingSqlQueryWithParameters.RowMapperImpl (implements org.springframework.jdbc.core.RowMapper<T>)
    • org.springframework.jms.support.converter.MarshallingMessageConverter (implements org.springframework.beans.factory.InitializingBean, org.springframework.jms.support.converter.MessageConverter)
    • org.springframework.transaction.interceptor.MatchAlwaysTransactionAttributeSource (implements java.io.Serializable, org.springframework.transaction.interceptor.TransactionAttributeSource)
    • org.springframework.jmx.access.MBeanClientInterceptor (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.aopalliance.intercept.MethodInterceptor)
      • org.springframework.jmx.access.MBeanProxyFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.jmx.support.MBeanRegistrationSupport
      • org.springframework.jmx.support.ConnectorServerFactoryBean (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
      • org.springframework.jmx.export.MBeanExporter (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.jmx.export.MBeanExportOperations)
        • org.springframework.jmx.export.annotation.AnnotationMBeanExporter
    • org.springframework.jmx.support.MBeanServerConnectionFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.jmx.support.MBeanServerFactoryBean (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.http.MediaType (implements java.lang.Comparable<T>)
    • org.springframework.jms.listener.adapter.MessageListenerAdapter (implements javax.jms.MessageListener, org.springframework.jms.listener.SessionAwareMessageListener<M>, org.springframework.jms.listener.SubscriptionNameProvider)
      • org.springframework.jms.listener.adapter.MessageListenerAdapter102
    • org.springframework.context.support.MessageSourceAccessor
    • org.springframework.context.support.MessageSourceSupport
      • org.springframework.context.support.AbstractMessageSource (implements org.springframework.context.HierarchicalMessageSource)
        • org.springframework.context.support.ReloadableResourceBundleMessageSource (implements org.springframework.context.ResourceLoaderAware)
        • org.springframework.context.support.ResourceBundleMessageSource (implements org.springframework.beans.factory.BeanClassLoaderAware)
        • org.springframework.context.support.StaticMessageSource
      • org.springframework.context.support.DelegatingMessageSource (implements org.springframework.context.HierarchicalMessageSource)
    • org.springframework.jmx.export.naming.MetadataNamingStrategy (implements org.springframework.beans.factory.InitializingBean, org.springframework.jmx.export.naming.ObjectNamingStrategy)
    • org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor (implements org.aopalliance.intercept.MethodInterceptor, java.io.Serializable)
    • org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint (implements org.aspectj.lang.JoinPoint.StaticPart, org.aspectj.lang.ProceedingJoinPoint)
    • org.springframework.util.MethodInvoker
      • org.springframework.beans.support.ArgumentConvertingMethodInvoker
        • org.springframework.beans.factory.config.MethodInvokingFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
        • org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
        • org.springframework.scheduling.support.MethodInvokingRunnable (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.InitializingBean, java.lang.Runnable)
          • org.springframework.scheduling.timer.MethodInvokingTimerTaskFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>)
    • org.springframework.aop.config.MethodLocatingFactoryBean (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.FactoryBean<T>)
    • org.springframework.transaction.interceptor.MethodMapTransactionAttributeSource (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.InitializingBean, org.springframework.transaction.interceptor.TransactionAttributeSource)
    • org.springframework.aop.support.MethodMatchers
    • org.springframework.beans.factory.support.MethodOverride (implements org.springframework.beans.BeanMetadataElement)
      • org.springframework.beans.factory.support.LookupOverride
      • org.springframework.beans.factory.support.ReplaceOverride
    • org.springframework.beans.factory.support.MethodOverrides
    • org.springframework.core.MethodParameter
    • org.springframework.format.datetime.joda.MillisecondInstantPrinter (implements org.springframework.format.Printer<T>)
    • org.springframework.mail.javamail.MimeMailMessage (implements org.springframework.mail.MailMessage)
    • org.springframework.mail.javamail.MimeMessageHelper
    • org.springframework.mock.web.portlet.MockBaseURL (implements javax.portlet.BaseURL)
      • org.springframework.mock.web.portlet.MockPortletURL (implements javax.portlet.PortletURL)
      • org.springframework.mock.web.portlet.MockResourceURL (implements javax.portlet.ResourceURL)
    • org.springframework.mock.web.portlet.MockCacheControl (implements javax.portlet.CacheControl)
    • org.springframework.mock.web.portlet.MockEvent (implements javax.portlet.Event)
    • org.springframework.mock.web.MockFilterChain (implements javax.servlet.FilterChain)
    • org.springframework.mock.web.MockFilterConfig (implements javax.servlet.FilterConfig)
    • org.springframework.mock.web.MockHttpServletRequest (implements javax.servlet.http.HttpServletRequest)
      • org.springframework.mock.web.MockMultipartHttpServletRequest (implements org.springframework.web.multipart.MultipartHttpServletRequest)
    • org.springframework.mock.web.MockHttpServletResponse (implements javax.servlet.http.HttpServletResponse)
    • org.springframework.mock.web.MockHttpSession (implements javax.servlet.http.HttpSession)
    • org.springframework.mock.web.MockMultipartFile (implements org.springframework.web.multipart.MultipartFile)
    • org.springframework.mock.web.portlet.MockPortalContext (implements javax.portlet.PortalContext)
    • org.springframework.mock.web.portlet.MockPortletConfig (implements javax.portlet.PortletConfig)
    • org.springframework.mock.web.portlet.MockPortletContext (implements javax.portlet.PortletContext)
    • org.springframework.mock.web.portlet.MockPortletPreferences (implements javax.portlet.PortletPreferences)
    • org.springframework.mock.web.portlet.MockPortletRequest (implements javax.portlet.PortletRequest)
      • org.springframework.mock.web.portlet.MockClientDataRequest (implements javax.portlet.ClientDataRequest)
        • org.springframework.mock.web.portlet.MockActionRequest (implements javax.portlet.ActionRequest)
          • org.springframework.mock.web.portlet.MockMultipartActionRequest (implements org.springframework.web.portlet.multipart.MultipartActionRequest)
        • org.springframework.mock.web.portlet.MockResourceRequest (implements javax.portlet.ResourceRequest)
      • org.springframework.mock.web.portlet.MockEventRequest (implements javax.portlet.EventRequest)
      • org.springframework.mock.web.portlet.MockRenderRequest (implements javax.portlet.RenderRequest)
    • org.springframework.mock.web.portlet.MockPortletRequestDispatcher (implements javax.portlet.PortletRequestDispatcher)
    • org.springframework.mock.web.portlet.MockPortletResponse (implements javax.portlet.PortletResponse)
      • org.springframework.mock.web.portlet.MockMimeResponse (implements javax.portlet.MimeResponse)
        • org.springframework.mock.web.portlet.MockRenderResponse (implements javax.portlet.RenderResponse)
        • org.springframework.mock.web.portlet.MockResourceResponse (implements javax.portlet.ResourceResponse)
      • org.springframework.mock.web.portlet.MockStateAwareResponse (implements javax.portlet.StateAwareResponse)
        • org.springframework.mock.web.portlet.MockActionResponse (implements javax.portlet.ActionResponse)
        • org.springframework.mock.web.portlet.MockEventResponse (implements javax.portlet.EventResponse)
    • org.springframework.mock.web.portlet.MockPortletSession (implements javax.portlet.PortletSession)
    • org.springframework.mock.web.MockRequestDispatcher (implements javax.servlet.RequestDispatcher)
    • org.springframework.mock.web.MockServletConfig (implements javax.servlet.ServletConfig)
    • org.springframework.mock.web.MockServletContext (implements javax.servlet.ServletContext)
    • org.springframework.web.portlet.ModelAndView
    • org.springframework.web.servlet.ModelAndView
    • org.springframework.test.web.ModelAndViewAssert
    • org.springframework.jmx.export.notification.ModelMBeanNotificationPublisher (implements org.springframework.jmx.export.notification.NotificationPublisher)
    • org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo (implements org.springframework.orm.jpa.persistenceunit.SmartPersistenceUnitInfo)
    • org.springframework.beans.MutablePropertyValues (implements org.springframework.beans.PropertyValues, java.io.Serializable)
      • org.springframework.web.portlet.bind.PortletRequestParameterPropertyValues
      • org.springframework.web.bind.ServletRequestParameterPropertyValues
    • org.springframework.beans.support.MutableSortDefinition (implements java.io.Serializable, org.springframework.beans.support.SortDefinition)
    • org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate (implements org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations)
    • org.springframework.jdbc.core.namedparam.NamedParameterUtils
    • org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource (implements java.io.Serializable, org.springframework.transaction.interceptor.TransactionAttributeSource)
    • org.springframework.beans.factory.xml.NamespaceHandlerSupport (implements org.springframework.beans.factory.xml.NamespaceHandler)
      • org.springframework.aop.config.AopNamespaceHandler
      • org.springframework.context.config.ContextNamespaceHandler
      • org.springframework.jdbc.config.JdbcNamespaceHandler
      • org.springframework.ejb.config.JeeNamespaceHandler
      • org.springframework.jms.config.JmsNamespaceHandler
      • org.springframework.scripting.config.LangNamespaceHandler
      • org.springframework.web.servlet.config.MvcNamespaceHandler
      • org.springframework.oxm.config.OxmNamespaceHandler
      • org.springframework.scheduling.config.TaskNamespaceHandler
      • org.springframework.transaction.config.TxNamespaceHandler
      • org.springframework.beans.factory.xml.UtilNamespaceHandler
    • org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter (implements org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor)
      • org.springframework.jdbc.support.nativejdbc.C3P0NativeJdbcExtractor
      • org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor
      • org.springframework.jdbc.support.nativejdbc.JBossNativeJdbcExtractor
      • org.springframework.jdbc.support.nativejdbc.Jdbc4NativeJdbcExtractor
      • org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor
      • org.springframework.jdbc.support.nativejdbc.WebLogicNativeJdbcExtractor
      • org.springframework.jdbc.support.nativejdbc.WebSphereNativeJdbcExtractor
    • javax.faces.application.NavigationHandler
      • org.springframework.web.jsf.DecoratingNavigationHandler
      • org.springframework.web.jsf.DelegatingNavigationHandlerProxy
    • org.springframework.core.NestedExceptionUtils
    • org.springframework.jmx.support.NotificationListenerHolder
      • org.springframework.jmx.export.NotificationListenerBean (implements org.springframework.beans.factory.InitializingBean)
      • org.springframework.jmx.access.NotificationListenerRegistrar (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean)
    • org.springframework.jca.cci.connection.NotSupportedRecordFactory (implements javax.resource.cci.RecordFactory)
    • org.springframework.util.comparator.NullSafeComparator<T> (implements java.util.Comparator<T>)
    • org.springframework.beans.factory.parsing.NullSourceExtractor (implements org.springframework.beans.factory.parsing.SourceExtractor)
    • org.springframework.format.number.NumberFormatAnnotationFormatterFactory (implements org.springframework.format.AnnotationFormatterFactory<A>)
    • org.springframework.util.NumberUtils
    • org.springframework.jmx.support.ObjectNameManager
    • org.springframework.util.ObjectUtils
    • org.springframework.instrument.classloading.oc4j.OC4JLoadTimeWeaver (implements org.springframework.instrument.classloading.LoadTimeWeaver)
    • org.springframework.orm.jdo.support.OpenPersistenceManagerInViewInterceptor (implements org.springframework.web.context.request.WebRequestInterceptor)
    • org.springframework.jdbc.support.lob.OracleLobHandler.OracleLobCreator (implements org.springframework.jdbc.support.lob.LobCreator)
    • org.springframework.core.OrderComparator (implements java.util.Comparator<T>)
      • org.springframework.core.annotation.AnnotationAwareOrderComparator
    • java.io.OutputStream (implements java.io.Closeable, java.io.Flushable)
      • javax.servlet.ServletOutputStream
        • org.springframework.mock.web.DelegatingServletOutputStream
    • org.springframework.jdbc.datasource.embedded.OutputStreamFactory
    • org.springframework.beans.support.PagedListHolder<E> (implements java.io.Serializable)
    • org.springframework.web.servlet.tags.Param
    • org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver (implements org.springframework.web.servlet.mvc.multiaction.MethodNameResolver)
    • org.springframework.jdbc.core.namedparam.ParsedSql
    • org.springframework.beans.factory.xml.ParserContext
    • org.springframework.beans.factory.parsing.ParseState
    • org.springframework.mock.web.PassThroughFilterChain (implements javax.servlet.FilterChain)
    • org.springframework.beans.factory.parsing.PassThroughSourceExtractor (implements org.springframework.beans.factory.parsing.SourceExtractor)
    • org.springframework.core.io.support.PathMatchingResourcePatternResolver (implements org.springframework.core.io.support.ResourcePatternResolver)
      • org.springframework.web.portlet.context.PortletContextResourcePatternResolver
      • org.springframework.web.context.support.ServletContextResourcePatternResolver
    • org.springframework.util.PatternMatchUtils
    • org.springframework.scheduling.support.PeriodicTrigger (implements org.springframework.scheduling.Trigger)
    • org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor, org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor, org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor, org.springframework.core.PriorityOrdered, java.io.Serializable)
    • org.springframework.dao.support.PersistenceExceptionTranslationInterceptor (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean, org.aopalliance.intercept.MethodInterceptor)
    • org.springframework.orm.jdo.PersistenceManagerFactoryUtils
    • org.springframework.beans.factory.xml.PluggableSchemaResolver (implements org.xml.sax.EntityResolver)
    • org.springframework.aop.config.PointcutEntry (implements org.springframework.beans.factory.parsing.ParseState.Entry)
    • org.springframework.aop.support.Pointcuts
    • org.springframework.web.portlet.context.PortletApplicationContextUtils
    • org.springframework.web.portlet.context.PortletContextAwareProcessor (implements org.springframework.beans.factory.config.BeanPostProcessor)
    • org.springframework.web.portlet.context.PortletContextScope (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.config.Scope)
    • org.springframework.web.portlet.mvc.PortletModeNameViewController (implements org.springframework.web.portlet.mvc.Controller)
    • org.springframework.web.portlet.bind.PortletRequestUtils
    • javax.portlet.filter.PortletRequestWrapper (implements javax.portlet.PortletRequest)
      • javax.portlet.filter.ActionRequestWrapper (implements javax.portlet.ActionRequest)
        • org.springframework.web.portlet.multipart.DefaultMultipartActionRequest (implements org.springframework.web.portlet.multipart.MultipartActionRequest)
    • org.springframework.web.portlet.util.PortletUtils
    • org.springframework.jdbc.core.PreparedStatementCreatorFactory
    • org.springframework.core.PrioritizedParameterNameDiscoverer (implements org.springframework.core.ParameterNameDiscoverer)
    • org.springframework.beans.factory.parsing.Problem
    • org.springframework.test.annotation.ProfileValueUtils
    • org.springframework.core.io.support.PropertiesLoaderSupport
      • org.springframework.beans.factory.config.PropertiesFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
      • org.springframework.beans.factory.config.PropertyResourceConfigurer (implements org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.core.PriorityOrdered)
        • org.springframework.beans.factory.config.PropertyOverrideConfigurer
        • org.springframework.beans.factory.config.PropertyPlaceholderConfigurer (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware)
          • org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer (implements org.springframework.beans.factory.InitializingBean)
          • org.springframework.web.context.support.ServletContextPropertyPlaceholderConfigurer (implements org.springframework.web.context.ServletContextAware)
    • org.springframework.core.io.support.PropertiesLoaderUtils
    • org.springframework.beans.PropertyAccessorFactory
    • org.springframework.beans.PropertyAccessorUtils
    • org.springframework.beans.support.PropertyComparator (implements java.util.Comparator<T>)
    • org.springframework.beans.PropertyEditorRegistrySupport (implements org.springframework.beans.PropertyEditorRegistry)
      • org.springframework.beans.AbstractPropertyAccessor (implements org.springframework.beans.ConfigurablePropertyAccessor)
        • org.springframework.beans.BeanWrapperImpl (implements org.springframework.beans.BeanWrapper)
        • org.springframework.beans.DirectFieldAccessor
      • org.springframework.beans.SimpleTypeConverter (implements org.springframework.beans.TypeConverter)
    • java.beans.PropertyEditorSupport (implements java.beans.PropertyEditor)
      • org.springframework.beans.propertyeditors.ByteArrayPropertyEditor
        • org.springframework.web.multipart.support.ByteArrayMultipartFileEditor
      • org.springframework.beans.propertyeditors.CharacterEditor
      • org.springframework.beans.propertyeditors.CharArrayPropertyEditor
      • org.springframework.beans.propertyeditors.CharsetEditor
      • org.springframework.beans.propertyeditors.ClassArrayEditor
      • org.springframework.beans.propertyeditors.ClassEditor
      • org.springframework.core.convert.support.ConvertingPropertyEditorAdapter
      • org.springframework.beans.propertyeditors.CurrencyEditor
      • org.springframework.beans.propertyeditors.CustomBooleanEditor
      • org.springframework.beans.propertyeditors.CustomCollectionEditor
      • org.springframework.beans.propertyeditors.CustomDateEditor
      • org.springframework.beans.propertyeditors.CustomMapEditor
      • org.springframework.beans.propertyeditors.CustomNumberEditor
      • org.springframework.beans.propertyeditors.FileEditor
      • org.springframework.beans.propertyeditors.InputStreamEditor
      • org.springframework.mail.javamail.InternetAddressEditor
      • org.springframework.jndi.JndiTemplateEditor
      • org.springframework.beans.propertyeditors.LocaleEditor
      • org.springframework.http.MediaTypeEditor
      • org.springframework.beans.propertyeditors.PatternEditor
      • org.springframework.beans.propertyeditors.PropertiesEditor
      • org.springframework.beans.PropertyValuesEditor
      • org.springframework.core.io.support.ResourceArrayPropertyEditor
      • org.springframework.beans.propertyeditors.ResourceBundleEditor
      • org.springframework.core.io.ResourceEditor
      • org.springframework.beans.propertyeditors.StringArrayPropertyEditor
      • org.springframework.web.multipart.support.StringMultipartFileEditor
      • org.springframework.beans.propertyeditors.StringTrimmerEditor
      • org.springframework.beans.propertyeditors.TimeZoneEditor
      • org.springframework.transaction.interceptor.TransactionAttributeEditor
      • org.springframework.transaction.interceptor.TransactionAttributeSourceEditor
      • org.springframework.beans.propertyeditors.URIEditor
      • org.springframework.beans.propertyeditors.URLEditor
      • org.springframework.beans.propertyeditors.UUIDEditor
    • org.springframework.beans.factory.parsing.PropertyEntry (implements org.springframework.beans.factory.parsing.ParseState.Entry)
    • org.springframework.beans.factory.config.PropertyPathFactoryBean (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.FactoryBean<T>)
    • org.springframework.util.PropertyPlaceholderHelper
    • org.springframework.aop.framework.ProxyConfig (implements java.io.Serializable)
      • org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator (implements org.springframework.aop.framework.AopInfrastructureBean, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.core.Ordered, org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor)
        • org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
          • org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator
            • org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator
          • org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator (implements org.springframework.beans.factory.BeanNameAware)
          • org.springframework.aop.framework.autoproxy.InfrastructureAdvisorAutoProxyCreator
        • org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator
      • org.springframework.aop.framework.AbstractSingletonProxyFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
        • org.springframework.transaction.interceptor.TransactionProxyFactoryBean (implements org.springframework.beans.factory.BeanFactoryAware)
      • org.springframework.aop.framework.AdvisedSupport (implements org.springframework.aop.framework.Advised)
        • org.springframework.aop.framework.ProxyCreatorSupport
          • org.springframework.aop.aspectj.annotation.AspectJProxyFactory
          • org.springframework.aop.framework.ProxyFactory
          • org.springframework.aop.framework.ProxyFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.FactoryBean<T>)
      • org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcessor (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.beans.factory.InitializingBean, org.springframework.core.Ordered)
      • org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.core.Ordered)
      • org.springframework.aop.scope.ScopedProxyFactoryBean (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.FactoryBean<T>)
    • org.springframework.aop.framework.autoproxy.ProxyCreationContext
    • org.springframework.beans.factory.annotation.QualifierAnnotationAutowireCandidateResolver (implements org.springframework.beans.factory.support.AutowireCandidateResolver, org.springframework.beans.factory.BeanFactoryAware)
    • org.springframework.beans.factory.parsing.QualifierEntry (implements org.springframework.beans.factory.parsing.ParseState.Entry)
    • org.springframework.scheduling.quartz.QuartzJobBean (implements org.quartz.Job)
      • org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean.MethodInvokingJob
        • org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean.StatefulMethodInvokingJob (implements org.quartz.StatefulJob)
    • org.springframework.jdbc.object.RdbmsOperation (implements org.springframework.beans.factory.InitializingBean)
      • org.springframework.jdbc.object.SqlCall
        • org.springframework.jdbc.object.StoredProcedure
          • org.springframework.jdbc.object.GenericStoredProcedure
      • org.springframework.jdbc.object.SqlOperation
        • org.springframework.jdbc.object.SqlQuery<T>
          • org.springframework.jdbc.object.GenericSqlQuery
          • org.springframework.jdbc.object.MappingSqlQueryWithParameters<T>
            • org.springframework.jdbc.object.MappingSqlQuery<T>
              • org.springframework.jdbc.object.SqlFunction<T>
          • org.springframework.jdbc.object.UpdatableSqlQuery<T>
        • org.springframework.jdbc.object.SqlUpdate
          • org.springframework.jdbc.object.BatchSqlUpdate
    • org.springframework.format.datetime.joda.ReadableInstantPrinter (implements org.springframework.format.Printer<T>)
    • org.springframework.format.datetime.joda.ReadablePartialPrinter (implements org.springframework.format.Printer<T>)
    • org.springframework.beans.factory.parsing.ReaderContext
      • org.springframework.beans.factory.xml.XmlReaderContext
    • org.springframework.expression.spel.support.ReflectionHelper
    • org.springframework.expression.spel.support.ReflectionHelper.ArgumentsMatchInfo
    • org.springframework.test.util.ReflectionTestUtils
    • org.springframework.util.ReflectionUtils
    • org.springframework.expression.spel.support.ReflectiveConstructorResolver (implements org.springframework.expression.ConstructorResolver)
    • org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver (implements org.springframework.instrument.classloading.LoadTimeWeaver)
    • org.springframework.aop.framework.ReflectiveMethodInvocation (implements java.lang.Cloneable, org.springframework.aop.ProxyMethodInvocation)
    • org.springframework.expression.spel.support.ReflectiveMethodResolver (implements org.springframework.expression.MethodResolver)
    • org.springframework.expression.spel.support.ReflectivePropertyAccessor (implements org.springframework.expression.PropertyAccessor)
    • org.springframework.context.support.ReloadableResourceBundleMessageSource.PropertiesHolder
    • org.springframework.remoting.support.RemoteInvocation (implements java.io.Serializable)
    • org.springframework.remoting.support.RemoteInvocationResult (implements java.io.Serializable)
    • org.springframework.remoting.support.RemoteInvocationTraceInterceptor (implements org.aopalliance.intercept.MethodInterceptor)
    • org.springframework.remoting.support.RemoteInvocationUtils
    • org.springframework.remoting.support.RemotingSupport (implements org.springframework.beans.factory.BeanClassLoaderAware)
      • org.springframework.remoting.support.RemoteAccessor
        • org.springframework.remoting.support.UrlBasedRemoteAccessor (implements org.springframework.beans.factory.InitializingBean)
          • org.springframework.remoting.caucho.BurlapClientInterceptor (implements org.aopalliance.intercept.MethodInterceptor)
            • org.springframework.remoting.caucho.BurlapProxyFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>)
          • org.springframework.remoting.caucho.HessianClientInterceptor (implements org.aopalliance.intercept.MethodInterceptor)
            • org.springframework.remoting.caucho.HessianProxyFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>)
          • org.springframework.remoting.support.RemoteInvocationBasedAccessor
            • org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor (implements org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration, org.aopalliance.intercept.MethodInterceptor)
              • org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>)
            • org.springframework.remoting.rmi.RmiClientInterceptor (implements org.aopalliance.intercept.MethodInterceptor)
              • org.springframework.remoting.rmi.RmiProxyFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.FactoryBean<T>)
      • org.springframework.remoting.support.RemoteExporter
        • org.springframework.remoting.caucho.BurlapExporter (implements org.springframework.beans.factory.InitializingBean)
          • org.springframework.remoting.caucho.BurlapServiceExporter (implements org.springframework.web.HttpRequestHandler)
          • org.springframework.remoting.caucho.SimpleBurlapServiceExporter (implements com.sun.net.httpserver.HttpHandler)
        • org.springframework.remoting.caucho.HessianExporter (implements org.springframework.beans.factory.InitializingBean)
          • org.springframework.remoting.caucho.HessianServiceExporter (implements org.springframework.web.HttpRequestHandler)
          • org.springframework.remoting.caucho.SimpleHessianServiceExporter (implements com.sun.net.httpserver.HttpHandler)
        • org.springframework.remoting.support.RemoteInvocationBasedExporter
          • org.springframework.jms.remoting.JmsInvokerServiceExporter (implements org.springframework.beans.factory.InitializingBean, org.springframework.jms.listener.SessionAwareMessageListener<M>)
          • org.springframework.remoting.rmi.RemoteInvocationSerializingExporter (implements org.springframework.beans.factory.InitializingBean)
            • org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter (implements org.springframework.web.HttpRequestHandler)
            • org.springframework.remoting.httpinvoker.SimpleHttpInvokerServiceExporter (implements com.sun.net.httpserver.HttpHandler)
          • org.springframework.remoting.rmi.RmiBasedExporter
            • org.springframework.remoting.rmi.JndiRmiServiceExporter (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean)
            • org.springframework.remoting.rmi.RmiServiceExporter (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean)
    • org.springframework.web.servlet.support.RequestContext
      • org.springframework.web.servlet.support.JspAwareRequestContext
    • org.springframework.web.context.request.RequestContextHolder
    • org.springframework.web.context.request.RequestContextListener (implements javax.servlet.ServletRequestListener)
    • org.springframework.web.servlet.support.RequestContextUtils
    • org.apache.struts.action.RequestProcessor
      • org.springframework.web.struts.AutowiringRequestProcessor
      • org.springframework.web.struts.DelegatingRequestProcessor
      • org.apache.struts.tiles.TilesRequestProcessor
        • org.springframework.web.struts.AutowiringTilesRequestProcessor
        • org.springframework.web.struts.DelegatingTilesRequestProcessor
    • javax.management.modelmbean.RequiredModelMBean (implements javax.management.MBeanRegistration, javax.management.modelmbean.ModelMBean, javax.management.NotificationEmitter)
      • org.springframework.jmx.export.SpringModelMBean
    • org.springframework.jca.support.ResourceAdapterFactoryBean (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • java.util.ResourceBundle
      • org.springframework.context.support.MessageSourceResourceBundle
    • org.springframework.ui.context.support.ResourceBundleThemeSource (implements org.springframework.ui.context.HierarchicalThemeSource)
    • org.springframework.jdbc.datasource.init.ResourceDatabasePopulator (implements org.springframework.jdbc.datasource.init.DatabasePopulator)
    • org.springframework.beans.support.ResourceEditorRegistrar (implements org.springframework.beans.PropertyEditorRegistrar)
    • org.springframework.transaction.support.ResourceHolderSupport (implements org.springframework.transaction.support.ResourceHolder)
      • org.springframework.jca.cci.connection.ConnectionHolder
      • org.springframework.jdbc.datasource.ConnectionHolder
      • org.springframework.orm.jpa.EntityManagerHolder
      • org.springframework.jms.connection.JmsResourceHolder
      • org.springframework.orm.jdo.PersistenceManagerHolder
      • org.springframework.orm.hibernate3.SessionHolder
    • org.springframework.transaction.support.ResourceHolderSynchronization<H,K> (implements org.springframework.transaction.support.TransactionSynchronization)
    • org.springframework.http.converter.ResourceHttpMessageConverter (implements org.springframework.http.converter.HttpMessageConverter<T>)
    • org.apache.velocity.runtime.resource.loader.ResourceLoader
      • org.springframework.ui.velocity.SpringResourceLoader
    • org.springframework.scheduling.quartz.ResourceLoaderClassLoadHelper (implements org.quartz.spi.ClassLoadHelper)
    • org.springframework.core.io.support.ResourcePatternUtils
    • org.springframework.scripting.support.ResourceScriptSource (implements org.springframework.scripting.ScriptSource)
    • org.springframework.util.ResourceUtils
    • org.springframework.web.client.support.RestGatewaySupport
    • org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet (implements org.springframework.jdbc.support.rowset.SqlRowSet)
    • org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSetMetaData (implements org.springframework.jdbc.support.rowset.SqlRowSetMetaData)
    • org.springframework.remoting.rmi.RmiClientInterceptorUtils
    • org.springframework.remoting.rmi.RmiRegistryFactoryBean (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.transaction.interceptor.RollbackRuleAttribute (implements java.io.Serializable)
      • org.springframework.transaction.interceptor.NoRollbackRuleAttribute
    • org.springframework.aop.support.RootClassFilter (implements org.springframework.aop.ClassFilter, java.io.Serializable)
    • org.springframework.jdbc.core.RowCountCallbackHandler (implements org.springframework.jdbc.core.RowCallbackHandler)
    • org.springframework.jdbc.core.RowMapperResultSetExtractor<T> (implements org.springframework.jdbc.core.ResultSetExtractor<T>)
    • org.junit.runner.Runner (implements org.junit.runner.Describable)
      • org.junit.runners.ParentRunner<T> (implements org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Sortable)
        • org.junit.runners.BlockJUnit4ClassRunner
          • org.springframework.test.context.junit4.SpringJUnit4ClassRunner
    • org.springframework.beans.factory.config.RuntimeBeanNameReference (implements org.springframework.beans.factory.config.BeanReference)
    • org.springframework.beans.factory.config.RuntimeBeanReference (implements org.springframework.beans.factory.config.BeanReference)
    • org.springframework.oxm.support.SaxResourceUtils
    • javax.xml.transform.sax.SAXSource (implements javax.xml.transform.Source)
      • org.springframework.oxm.support.MarshallingSource
    • org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor (implements org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener<E>, org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.beans.factory.DisposableBean, org.springframework.core.Ordered)
    • org.springframework.scheduling.concurrent.ScheduledExecutorTask
    • org.springframework.scheduling.config.ScheduledTaskRegistrar (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean)
    • org.springframework.scheduling.commonj.ScheduledTimerListener
    • org.springframework.scheduling.timer.ScheduledTimerTask
    • org.springframework.scheduling.quartz.SchedulerAccessor (implements org.springframework.context.ResourceLoaderAware)
      • org.springframework.scheduling.quartz.SchedulerAccessorBean (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean)
      • org.springframework.scheduling.quartz.SchedulerFactoryBean (implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean, org.springframework.context.SmartLifecycle)
    • org.springframework.aop.scope.ScopedProxyUtils
    • org.springframework.context.annotation.ScopeMetadata
    • org.springframework.scripting.config.ScriptingDefaultsParser (implements org.springframework.beans.factory.xml.BeanDefinitionParser)
    • org.springframework.beans.factory.config.ServiceLocatorFactoryBean (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.web.context.support.ServletContextAttributeExporter (implements org.springframework.web.context.ServletContextAware)
    • org.springframework.web.context.support.ServletContextAttributeFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.web.context.ServletContextAware)
    • org.springframework.web.context.support.ServletContextAwareProcessor (implements org.springframework.beans.factory.config.BeanPostProcessor)
    • org.springframework.web.context.support.ServletContextFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.web.context.ServletContextAware)
    • org.springframework.web.context.support.ServletContextParameterFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.web.context.ServletContextAware)
    • org.springframework.web.context.support.ServletContextScope (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.config.Scope)
    • org.springframework.remoting.jaxrpc.ServletEndpointSupport (implements javax.xml.rpc.server.ServiceLifecycle)
    • org.springframework.web.bind.ServletRequestUtils
    • javax.servlet.ServletRequestWrapper (implements javax.servlet.ServletRequest)
      • javax.servlet.http.HttpServletRequestWrapper (implements javax.servlet.http.HttpServletRequest)
        • org.springframework.web.multipart.support.AbstractMultipartHttpServletRequest (implements org.springframework.web.multipart.MultipartHttpServletRequest)
          • org.springframework.web.multipart.support.DefaultMultipartHttpServletRequest
        • org.springframework.web.context.support.ContextExposingHttpServletRequest
    • org.springframework.http.server.ServletServerHttpRequest (implements org.springframework.http.server.ServerHttpRequest)
    • org.springframework.http.server.ServletServerHttpResponse (implements org.springframework.http.server.ServerHttpResponse)
    • org.springframework.mock.web.portlet.ServletWrappingPortletContext (implements javax.portlet.PortletContext)
    • org.springframework.orm.hibernate3.SessionFactoryUtils
    • org.springframework.orm.jpa.SharedEntityManagerCreator
    • org.springframework.core.SimpleAliasRegistry (implements org.springframework.core.AliasRegistry)
      • org.springframework.beans.factory.support.DefaultSingletonBeanRegistry (implements org.springframework.beans.factory.config.SingletonBeanRegistry)
        • org.springframework.beans.factory.support.FactoryBeanRegistrySupport
          • org.springframework.beans.factory.support.AbstractBeanFactory (implements org.springframework.beans.factory.config.ConfigurableBeanFactory)
            • org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory (implements org.springframework.beans.factory.config.AutowireCapableBeanFactory)
              • org.springframework.beans.factory.support.DefaultListableBeanFactory (implements org.springframework.beans.factory.support.BeanDefinitionRegistry, org.springframework.beans.factory.config.ConfigurableListableBeanFactory, java.io.Serializable)
                • org.springframework.beans.factory.xml.XmlBeanFactory
      • org.springframework.beans.factory.support.SimpleBeanDefinitionRegistry (implements org.springframework.beans.factory.support.BeanDefinitionRegistry)
    • org.springframework.aop.aspectj.SimpleAspectInstanceFactory (implements org.springframework.aop.aspectj.AspectInstanceFactory)
      • org.springframework.aop.aspectj.annotation.SimpleMetadataAwareAspectInstanceFactory (implements org.springframework.aop.aspectj.annotation.MetadataAwareAspectInstanceFactory)
    • org.springframework.beans.factory.support.SimpleAutowireCandidateResolver (implements org.springframework.beans.factory.support.AutowireCandidateResolver)
    • org.springframework.aop.config.SimpleBeanFactoryAwareAspectInstanceFactory (implements org.springframework.aop.aspectj.AspectInstanceFactory, org.springframework.beans.factory.BeanFactoryAware)
    • org.springframework.jca.support.SimpleBootstrapContext (implements javax.resource.spi.BootstrapContext)
    • org.springframework.http.client.SimpleClientHttpRequestFactory (implements org.springframework.http.client.ClientHttpRequestFactory)
    • org.springframework.jdbc.datasource.SimpleConnectionHandle (implements org.springframework.jdbc.datasource.ConnectionHandle)
    • org.springframework.web.portlet.mvc.SimpleControllerHandlerAdapter (implements org.springframework.web.portlet.HandlerAdapter, org.springframework.web.portlet.context.PortletContextAware)
    • org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter (implements org.springframework.web.servlet.HandlerAdapter)
    • org.springframework.remoting.support.SimpleHttpServerFactoryBean (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.beans.factory.support.SimpleInstantiationStrategy (implements org.springframework.beans.factory.support.InstantiationStrategy)
      • org.springframework.beans.factory.support.CglibSubclassingInstantiationStrategy
    • org.springframework.jdbc.core.simple.SimpleJdbcTemplate (implements org.springframework.jdbc.core.simple.SimpleJdbcOperations)
    • org.springframework.test.jdbc.SimpleJdbcTestUtils
    • org.springframework.instrument.classloading.SimpleLoadTimeWeaver (implements org.springframework.instrument.classloading.LoadTimeWeaver)
    • org.springframework.context.i18n.SimpleLocaleContext (implements org.springframework.context.i18n.LocaleContext)
    • org.springframework.mail.SimpleMailMessage (implements org.springframework.mail.MailMessage, java.io.Serializable)
    • org.springframework.jms.support.converter.SimpleMessageConverter (implements org.springframework.jms.support.converter.MessageConverter)
      • org.springframework.jms.support.converter.SimpleMessageConverter102
    • org.springframework.core.type.classreading.SimpleMetadataReaderFactory (implements org.springframework.core.type.classreading.MetadataReaderFactory)
      • org.springframework.core.type.classreading.CachingMetadataReaderFactory
    • org.springframework.util.xml.SimpleNamespaceContext (implements javax.xml.namespace.NamespaceContext)
    • org.springframework.mock.jndi.SimpleNamingContext (implements javax.naming.Context)
    • org.springframework.mock.jndi.SimpleNamingContextBuilder (implements javax.naming.spi.InitialContextFactoryBuilder)
    • org.springframework.web.portlet.handler.SimplePortletHandlerAdapter (implements org.springframework.web.portlet.HandlerAdapter, org.springframework.web.portlet.context.PortletContextAware)
    • org.springframework.web.portlet.handler.SimplePortletPostProcessor (implements org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor, org.springframework.web.portlet.context.PortletConfigAware, org.springframework.web.portlet.context.PortletContextAware)
    • org.springframework.beans.factory.xml.SimplePropertyNamespaceHandler (implements org.springframework.beans.factory.xml.NamespaceHandler)
    • org.springframework.util.xml.SimpleSaxErrorHandler (implements org.xml.sax.ErrorHandler)
    • org.springframework.beans.factory.support.SimpleSecurityContextProvider (implements org.springframework.beans.factory.support.SecurityContextProvider)
    • org.springframework.web.servlet.handler.SimpleServletHandlerAdapter (implements org.springframework.web.servlet.HandlerAdapter)
    • org.springframework.web.servlet.handler.SimpleServletPostProcessor (implements org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor, org.springframework.web.context.ServletConfigAware, org.springframework.web.context.ServletContextAware)
    • org.springframework.web.bind.support.SimpleSessionStatus (implements org.springframework.web.bind.support.SessionStatus)
    • org.springframework.jca.work.SimpleTaskWorkManager (implements javax.resource.spi.work.WorkManager)
    • org.springframework.ui.context.support.SimpleTheme (implements org.springframework.ui.context.Theme)
    • org.quartz.simpl.SimpleThreadPool (implements org.quartz.spi.ThreadPool)
      • org.springframework.scheduling.quartz.SimpleThreadPoolTaskExecutor (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.scheduling.SchedulingTaskExecutor)
    • org.springframework.context.support.SimpleThreadScope (implements org.springframework.beans.factory.config.Scope)
    • org.springframework.transaction.jta.SimpleTransactionFactory (implements org.springframework.transaction.jta.TransactionFactory)
    • org.springframework.util.xml.SimpleTransformErrorListener (implements javax.xml.transform.ErrorListener)
    • org.springframework.scheduling.support.SimpleTriggerContext (implements org.springframework.scheduling.TriggerContext)
    • org.springframework.jdbc.core.SingleColumnRowMapper<T> (implements org.springframework.jdbc.core.RowMapper<T>)
      • org.springframework.jdbc.core.simple.ParameterizedSingleColumnRowMapper<T> (implements org.springframework.jdbc.core.simple.ParameterizedRowMapper<T>)
    • org.springframework.jms.connection.SingleConnectionFactory (implements javax.jms.ConnectionFactory, org.springframework.beans.factory.DisposableBean, javax.jms.ExceptionListener, org.springframework.beans.factory.InitializingBean, javax.jms.QueueConnectionFactory, javax.jms.TopicConnectionFactory)
      • org.springframework.jms.connection.CachingConnectionFactory
      • org.springframework.jms.connection.SingleConnectionFactory102
    • org.springframework.jdbc.datasource.lookup.SingleDataSourceLookup (implements org.springframework.jdbc.datasource.lookup.DataSourceLookup)
    • org.springframework.aop.aspectj.SingletonAspectInstanceFactory (implements org.springframework.aop.aspectj.AspectInstanceFactory)
      • org.springframework.aop.aspectj.annotation.SingletonMetadataAwareAspectInstanceFactory (implements org.springframework.aop.aspectj.annotation.MetadataAwareAspectInstanceFactory)
    • org.springframework.beans.factory.access.SingletonBeanFactoryLocator (implements org.springframework.beans.factory.access.BeanFactoryLocator)
      • org.springframework.context.access.ContextSingletonBeanFactoryLocator
    • org.springframework.aop.target.SingletonTargetSource (implements java.io.Serializable, org.springframework.aop.TargetSource)
    • org.springframework.context.event.SourceFilteringListener (implements org.springframework.context.event.SmartApplicationListener)
    • org.springframework.expression.spel.standard.SpelExpression (implements org.springframework.expression.Expression)
    • org.springframework.expression.spel.ast.SpelNodeImpl (implements org.springframework.expression.spel.SpelNode)
      • org.springframework.expression.spel.ast.Assign
      • org.springframework.expression.spel.ast.CompoundExpression
      • org.springframework.expression.spel.ast.ConstructorReference
      • org.springframework.expression.spel.ast.Elvis
      • org.springframework.expression.spel.ast.FunctionReference
      • org.springframework.expression.spel.ast.Identifier
      • org.springframework.expression.spel.ast.Indexer
      • org.springframework.expression.spel.ast.Literal
        • org.springframework.expression.spel.ast.BooleanLiteral
        • org.springframework.expression.spel.ast.IntLiteral
        • org.springframework.expression.spel.ast.LongLiteral
        • org.springframework.expression.spel.ast.NullLiteral
        • org.springframework.expression.spel.ast.RealLiteral
        • org.springframework.expression.spel.ast.StringLiteral
      • org.springframework.expression.spel.ast.MethodReference
      • org.springframework.expression.spel.ast.Operator
        • org.springframework.expression.spel.ast.OpAnd
        • org.springframework.expression.spel.ast.OpDivide
        • org.springframework.expression.spel.ast.OpEQ
        • org.springframework.expression.spel.ast.OperatorBetween
        • org.springframework.expression.spel.ast.OperatorInstanceof
        • org.springframework.expression.spel.ast.OperatorMatches
        • org.springframework.expression.spel.ast.OperatorPower
        • org.springframework.expression.spel.ast.OpGE
        • org.springframework.expression.spel.ast.OpGT
        • org.springframework.expression.spel.ast.OpLE
        • org.springframework.expression.spel.ast.OpLT
        • org.springframework.expression.spel.ast.OpMinus
        • org.springframework.expression.spel.ast.OpModulus
        • org.springframework.expression.spel.ast.OpMultiply
        • org.springframework.expression.spel.ast.OpNE
        • org.springframework.expression.spel.ast.OpOr
        • org.springframework.expression.spel.ast.OpPlus
      • org.springframework.expression.spel.ast.OperatorNot
      • org.springframework.expression.spel.ast.Projection
      • org.springframework.expression.spel.ast.PropertyOrFieldReference
      • org.springframework.expression.spel.ast.QualifiedIdentifier
      • org.springframework.expression.spel.ast.Selection
      • org.springframework.expression.spel.ast.Ternary
      • org.springframework.expression.spel.ast.TypeReference
      • org.springframework.expression.spel.ast.VariableReference
    • org.springframework.expression.spel.SpelParserConfiguration
    • org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor
    • org.springframework.web.context.support.SpringBeanAutowiringSupport
    • org.springframework.validation.beanvalidation.SpringConstraintValidatorFactory (implements javax.validation.ConstraintValidatorFactory)
    • org.springframework.jca.context.SpringContextResourceAdapter (implements javax.resource.spi.ResourceAdapter)
    • org.springframework.transaction.jta.SpringJtaSynchronizationAdapter (implements javax.transaction.Synchronization)
    • org.springframework.orm.hibernate3.SpringSessionContext (implements org.hibernate.context.CurrentSessionContext)
    • org.springframework.ui.freemarker.SpringTemplateLoader (implements freemarker.cache.TemplateLoader)
    • org.springframework.transaction.annotation.SpringTransactionAnnotationParser (implements java.io.Serializable, org.springframework.transaction.annotation.TransactionAnnotationParser)
    • org.springframework.orm.hibernate3.SpringTransactionFactory (implements org.hibernate.transaction.TransactionFactory)
    • org.springframework.validation.beanvalidation.SpringValidatorAdapter (implements org.springframework.validation.Validator, javax.validation.Validator)
      • org.springframework.validation.beanvalidation.CustomValidatorBean (implements org.springframework.beans.factory.InitializingBean, javax.validation.Validator)
      • org.springframework.validation.beanvalidation.LocalValidatorFactoryBean (implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean, javax.validation.ValidatorFactory)
    • org.springframework.core.SpringVersion
    • org.springframework.jdbc.support.SQLErrorCodes
    • org.springframework.jdbc.support.SQLErrorCodesFactory
    • org.springframework.jdbc.core.support.SqlLobValue (implements org.springframework.jdbc.core.DisposableSqlTypeValue)
    • org.springframework.orm.ibatis.SqlMapClientFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.jdbc.core.SqlParameter
      • org.springframework.jdbc.core.ResultSetSupportingSqlParameter
        • org.springframework.jdbc.core.SqlOutParameter
          • org.springframework.jdbc.core.SqlInOutParameter
        • org.springframework.jdbc.core.SqlReturnResultSet
      • org.springframework.jdbc.core.SqlParameterValue
      • org.springframework.jdbc.core.SqlReturnUpdateCount
    • org.springframework.jdbc.core.namedparam.SqlParameterSourceUtils
    • org.springframework.jdbc.core.SqlRowSetResultSetExtractor (implements org.springframework.jdbc.core.ResultSetExtractor<T>)
    • org.springframework.context.expression.StandardBeanExpressionResolver (implements org.springframework.beans.factory.config.BeanExpressionResolver)
    • org.springframework.core.type.StandardClassMetadata (implements org.springframework.core.type.ClassMetadata)
      • org.springframework.core.type.StandardAnnotationMetadata (implements org.springframework.core.type.AnnotationMetadata)
    • org.springframework.expression.spel.support.StandardEvaluationContext (implements org.springframework.expression.EvaluationContext)
    • org.springframework.jms.listener.endpoint.StandardJmsActivationSpecFactory (implements org.springframework.jms.listener.endpoint.JmsActivationSpecFactory)
      • org.springframework.jms.listener.endpoint.DefaultJmsActivationSpecFactory
    • org.springframework.core.type.StandardMethodMetadata (implements org.springframework.core.type.MethodMetadata)
    • org.springframework.expression.spel.support.StandardOperatorOverloader (implements org.springframework.expression.OperatorOverloader)
    • org.springframework.orm.jdo.support.StandardPersistenceManagerProxyBean (implements org.springframework.beans.factory.FactoryBean<T>)
    • org.springframework.expression.spel.support.StandardTypeComparator (implements org.springframework.expression.TypeComparator)
    • org.springframework.expression.spel.support.StandardTypeConverter (implements org.springframework.expression.TypeConverter)
    • org.springframework.expression.spel.support.StandardTypeLocator (implements org.springframework.expression.TypeLocator)
    • org.junit.runners.model.Statement
      • org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks
      • org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks
      • org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks
      • org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks
      • org.springframework.test.context.junit4.statements.SpringFailOnTimeout
      • org.springframework.test.context.junit4.statements.SpringRepeat
    • org.springframework.jdbc.core.StatementCreatorUtils
    • org.springframework.beans.factory.support.StaticListableBeanFactory (implements org.springframework.beans.factory.ListableBeanFactory)
    • org.springframework.aop.support.StaticMethodMatcher (implements org.springframework.aop.MethodMatcher)
      • org.springframework.aop.support.annotation.AnnotationMethodMatcher
      • org.springframework.aop.support.StaticMethodMatcherPointcut (implements org.springframework.aop.Pointcut)
        • org.springframework.aop.support.AbstractRegexpMethodPointcut (implements java.io.Serializable)
          • org.springframework.aop.support.JdkRegexpMethodPointcut
        • org.springframework.aop.support.NameMatchMethodPointcut (implements java.io.Serializable)
        • org.springframework.aop.support.StaticMethodMatcherPointcutAdvisor (implements org.springframework.core.Ordered, org.springframework.aop.PointcutAdvisor, java.io.Serializable)
    • org.springframework.scripting.support.StaticScriptSource (implements org.springframework.scripting.ScriptSource)
    • org.springframework.util.xml.StaxUtils
    • org.springframework.util.StopWatch
    • org.springframework.util.StopWatch.TaskInfo
    • org.springframework.util.StringUtils
    • org.springframework.core.style.StylerUtils
    • org.springframework.core.task.SyncTaskExecutor (implements java.io.Serializable, org.springframework.core.task.TaskExecutor)
    • org.springframework.test.annotation.SystemProfileValueSource (implements org.springframework.test.annotation.ProfileValueSource)
    • org.springframework.util.SystemPropertyUtils
    • org.springframework.jdbc.core.metadata.TableMetaDataContext
    • org.springframework.jdbc.core.metadata.TableMetaDataProviderFactory
    • org.springframework.jdbc.core.metadata.TableParameterMetaData
    • javax.servlet.jsp.tagext.TagSupport (implements javax.servlet.jsp.tagext.IterationTag, java.io.Serializable)
      • javax.servlet.jsp.tagext.BodyTagSupport (implements javax.servlet.jsp.tagext.BodyTag)
        • org.springframework.web.servlet.tags.ParamTag
      • org.springframework.web.servlet.tags.NestedPathTag (implements javax.servlet.jsp.tagext.TryCatchFinally)
      • org.springframework.web.servlet.tags.RequestContextAwareTag (implements javax.servlet.jsp.tagext.TryCatchFinally)
        • org.springframework.web.servlet.tags.HtmlEscapeTag
        • org.springframework.web.servlet.tags.HtmlEscapingAwareTag
          • org.springframework.web.servlet.tags.form.AbstractFormTag
            • org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag (implements org.springframework.web.servlet.tags.EditorAwareTag)
              • org.springframework.web.servlet.tags.form.AbstractHtmlElementTag (implements javax.servlet.jsp.tagext.DynamicAttributes)
                • org.springframework.web.servlet.tags.form.AbstractHtmlElementBodyTag (implements javax.servlet.jsp.tagext.BodyTag)
                  • org.springframework.web.servlet.tags.form.ErrorsTag (implements javax.servlet.jsp.tagext.BodyTag)
                  • org.springframework.web.servlet.tags.form.OptionTag (implements javax.servlet.jsp.tagext.BodyTag)
                • org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
                  • org.springframework.web.servlet.tags.form.AbstractCheckedElementTag
                    • org.springframework.web.servlet.tags.form.AbstractMultiCheckedElementTag
                      • org.springframework.web.servlet.tags.form.CheckboxesTag
                      • org.springframework.web.servlet.tags.form.RadioButtonsTag
                    • org.springframework.web.servlet.tags.form.AbstractSingleCheckedElementTag
                      • org.springframework.web.servlet.tags.form.CheckboxTag
                      • org.springframework.web.servlet.tags.form.RadioButtonTag
                  • org.springframework.web.servlet.tags.form.InputTag
                    • org.springframework.web.servlet.tags.form.PasswordInputTag
                  • org.springframework.web.servlet.tags.form.SelectTag
                  • org.springframework.web.servlet.tags.form.TextareaTag
                • org.springframework.web.servlet.tags.form.FormTag
                • org.springframework.web.servlet.tags.form.LabelTag
                • org.springframework.web.servlet.tags.form.OptionsTag
              • org.springframework.web.servlet.tags.form.HiddenInputTag
          • org.springframework.web.servlet.tags.BindErrorsTag
          • org.springframework.web.servlet.tags.BindTag (implements org.springframework.web.servlet.tags.EditorAwareTag)
          • org.springframework.web.servlet.tags.EscapeBodyTag (implements javax.servlet.jsp.tagext.BodyTag)
          • org.springframework.web.servlet.tags.EvalTag
          • org.springframework.web.servlet.tags.MessageTag
            • org.springframework.web.servlet.tags.ThemeTag
          • org.springframework.web.servlet.tags.TransformTag
          • org.springframework.web.servlet.tags.UrlTag (implements org.springframework.web.servlet.tags.ParamAware)
    • org.springframework.web.util.TagUtils
    • org.springframework.web.servlet.tags.form.TagWriter
    • org.springframework.core.task.support.TaskExecutorAdapter (implements org.springframework.core.task.AsyncTaskExecutor)
    • org.springframework.scheduling.config.TaskExecutorFactoryBean (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>)
    • org.springframework.scheduling.support.TaskUtils
    • org.springframework.expression.common.TemplateAwareExpressionParser (implements org.springframework.expression.ExpressionParser)
      • org.springframework.expression.spel.standard.SpelExpressionParser
    • org.springframework.expression.common.TemplateParserContext (implements org.springframework.expression.ParserContext)
    • org.springframework.test.context.TestContextManager
    • java.lang.ThreadLocal<T>
      • java.lang.InheritableThreadLocal<T>
        • org.springframework.core.NamedInheritableThreadLocal<T>
      • org.springframework.core.NamedThreadLocal<T>
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • org.springframework.expression.AccessException
        • org.springframework.validation.BindException (implements org.springframework.validation.BindingResult)
        • java.io.IOException
          • org.springframework.core.NestedIOException
        • javax.naming.NamingException
          • org.springframework.jndi.TypeMismatchNamingException
        • org.springframework.core.NestedCheckedException
          • org.springframework.jdbc.support.MetaDataAccessException
        • javax.portlet.PortletException
          • org.springframework.web.portlet.ModelAndViewDefiningException
          • org.springframework.web.portlet.bind.PortletRequestBindingException
            • org.springframework.web.portlet.bind.MissingPortletRequestParameterException
          • org.springframework.web.portlet.handler.PortletRequestMethodNotSupportedException
          • org.springframework.web.portlet.handler.PortletSessionRequiredException
        • java.lang.RuntimeException
          • org.springframework.jms.listener.AbstractJmsListeningContainer.SharedConnectionNotInitializedException
          • org.springframework.aop.aspectj.AspectJAdviceParameterNameDiscoverer.AmbiguousBindingException
          • org.springframework.util.AutoPopulatingList.ElementInstantiationException
          • org.springframework.jdbc.datasource.init.CannotReadScriptException
          • org.springframework.expression.ExpressionException
            • org.springframework.expression.EvaluationException
              • org.springframework.expression.spel.SpelEvaluationException
            • org.springframework.expression.ParseException
              • org.springframework.expression.spel.SpelParseException
          • org.springframework.jca.endpoint.GenericMessageEndpointFactory.InternalResourceException
          • java.lang.IllegalArgumentException
            • org.springframework.core.ConstantException
            • org.springframework.aop.framework.adapter.UnknownAdviceTypeException
          • org.springframework.expression.spel.InternalParseException
          • javax.management.JMRuntimeException
            • org.springframework.jmx.access.InvalidInvocationException
          • org.springframework.jms.listener.endpoint.JmsMessageEndpointFactory.JmsResourceException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.aop.framework.AopConfigException
              • org.springframework.aop.aspectj.annotation.NotAnAtAspectException
            • org.springframework.aop.AopInvocationException
            • org.springframework.beans.BeansException
              • org.springframework.beans.factory.BeanNotOfRequiredTypeException
                • org.springframework.beans.factory.BeanIsNotAFactoryException
              • org.springframework.beans.FatalBeanException
                • org.springframework.context.ApplicationContextException
                • org.springframework.beans.factory.BeanCreationException
                  • org.springframework.beans.factory.BeanCreationNotAllowedException
                  • org.springframework.beans.factory.BeanCurrentlyInCreationException
                  • org.springframework.beans.factory.BeanIsAbstractException
                  • org.springframework.beans.factory.UnsatisfiedDependencyException
                • org.springframework.beans.factory.BeanDefinitionStoreException
                  • org.springframework.beans.factory.parsing.BeanDefinitionParsingException
                  • org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException
                • org.springframework.beans.factory.support.BeanDefinitionValidationException
                • org.springframework.beans.factory.BeanExpressionException
                • org.springframework.beans.factory.BeanInitializationException
                • org.springframework.beans.BeanInstantiationException
                • org.springframework.beans.factory.access.BootstrapException
                • org.springframework.beans.factory.CannotLoadBeanClassException
                • org.springframework.beans.factory.FactoryBeanNotInitializedException
                • org.springframework.beans.InvalidPropertyException
                  • org.springframework.beans.NotReadablePropertyException
                  • org.springframework.beans.NotWritablePropertyException
                  • org.springframework.beans.NullValueInNestedPathException
              • org.springframework.beans.factory.NoSuchBeanDefinitionException
              • org.springframework.beans.PropertyAccessException (implements org.springframework.core.ErrorCoded)
                • org.springframework.beans.MethodInvocationException
                • org.springframework.beans.TypeMismatchException
                  • org.springframework.beans.ConversionNotSupportedException
              • org.springframework.beans.PropertyBatchUpdateException
            • org.springframework.scripting.bsh.BshScriptUtils.BshExecutionException
            • org.springframework.core.convert.ConversionException
              • org.springframework.core.convert.ConversionFailedException
              • org.springframework.core.convert.ConverterNotFoundException
            • org.springframework.dao.DataAccessException
              • org.springframework.dao.NonTransientDataAccessException
                • org.springframework.dao.CleanupFailureDataAccessException
                • org.springframework.dao.DataIntegrityViolationException
                  • org.springframework.dao.DuplicateKeyException
                • org.springframework.dao.DataRetrievalFailureException
                  • org.springframework.jdbc.IncorrectResultSetColumnCountException
                  • org.springframework.dao.IncorrectResultSizeDataAccessException
                    • org.springframework.dao.EmptyResultDataAccessException
                  • org.springframework.jdbc.LobRetrievalFailureException
                  • org.springframework.orm.ObjectRetrievalFailureException
                    • org.springframework.orm.hibernate3.HibernateObjectRetrievalFailureException
                    • org.springframework.orm.jdo.JdoObjectRetrievalFailureException
                    • org.springframework.orm.jpa.JpaObjectRetrievalFailureException
                • org.springframework.jdbc.datasource.lookup.DataSourceLookupFailureException
                • org.springframework.dao.InvalidDataAccessApiUsageException
                  • org.springframework.orm.jdo.JdoUsageException
                  • org.springframework.jdbc.support.xml.SqlXmlFeatureNotImplementedException
                • org.springframework.dao.InvalidDataAccessResourceUsageException
                  • org.springframework.jdbc.BadSqlGrammarException
                  • org.springframework.jca.cci.CciOperationNotSupportedException
                  • org.springframework.orm.hibernate3.HibernateQueryException
                  • org.springframework.dao.IncorrectUpdateSemanticsDataAccessException
                    • org.springframework.jdbc.JdbcUpdateAffectedIncorrectNumberOfRowsException
                  • org.springframework.jca.cci.InvalidResultSetAccessException
                  • org.springframework.jdbc.InvalidResultSetAccessException
                  • org.springframework.jca.cci.RecordTypeNotSupportedException
                  • org.springframework.dao.TypeMismatchDataAccessException
                • org.springframework.dao.NonTransientDataAccessResourceException
                  • org.springframework.dao.DataAccessResourceFailureException
                    • org.springframework.jca.cci.CannotCreateRecordException
                    • org.springframework.jca.cci.CannotGetCciConnectionException
                    • org.springframework.jdbc.CannotGetJdbcConnectionException
                    • org.springframework.orm.jdo.JdoResourceFailureException
                • org.springframework.dao.PermissionDeniedDataAccessException
                • org.springframework.dao.UncategorizedDataAccessException
                  • org.springframework.orm.hibernate3.HibernateJdbcException
                  • org.springframework.orm.hibernate3.HibernateSystemException
                  • org.springframework.orm.jdo.JdoSystemException
                  • org.springframework.orm.jpa.JpaSystemException
                  • org.springframework.jdbc.SQLWarningException
                  • org.springframework.jdbc.UncategorizedSQLException
              • org.springframework.dao.RecoverableDataAccessException
              • org.springframework.dao.TransientDataAccessException
                • org.springframework.dao.ConcurrencyFailureException
                  • org.springframework.dao.OptimisticLockingFailureException
                    • org.springframework.orm.ObjectOptimisticLockingFailureException
                      • org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException
                      • org.springframework.orm.jdo.JdoOptimisticLockingFailureException
                      • org.springframework.orm.jpa.JpaOptimisticLockingFailureException
                  • org.springframework.dao.PessimisticLockingFailureException
                    • org.springframework.dao.CannotAcquireLockException
                    • org.springframework.dao.CannotSerializeTransactionException
                    • org.springframework.dao.DeadlockLoserDataAccessException
                • org.springframework.dao.TransientDataAccessResourceException
            • org.springframework.ejb.access.EjbAccessException
            • org.springframework.web.bind.annotation.support.HandlerMethodInvocationException
            • org.springframework.http.converter.HttpMessageConversionException
              • org.springframework.http.converter.HttpMessageNotReadableException
              • org.springframework.http.converter.HttpMessageNotWritableException
            • org.springframework.jms.JmsException
              • org.springframework.jms.support.destination.DestinationResolutionException
              • org.springframework.jms.IllegalStateException
              • org.springframework.jms.InvalidClientIDException
              • org.springframework.jms.InvalidDestinationException
              • org.springframework.jms.InvalidSelectorException
              • org.springframework.jms.JmsSecurityException
              • org.springframework.jms.listener.adapter.ListenerExecutionFailedException
              • org.springframework.jms.support.converter.MessageConversionException
              • org.springframework.jms.MessageEOFException
              • org.springframework.jms.MessageFormatException
              • org.springframework.jms.MessageNotReadableException
              • org.springframework.jms.MessageNotWriteableException
              • org.springframework.jms.ResourceAllocationException
              • org.springframework.jms.connection.SynchedLocalTransactionFailedException
              • org.springframework.jms.TransactionInProgressException
              • org.springframework.jms.TransactionRolledBackException
              • org.springframework.jms.UncategorizedJmsException
            • org.springframework.jmx.JmxException
              • org.springframework.jmx.export.metadata.InvalidMetadataException
              • org.springframework.jmx.access.InvocationFailureException
              • org.springframework.jmx.access.MBeanConnectFailureException
              • org.springframework.jmx.export.MBeanExportException
                • org.springframework.jmx.export.UnableToRegisterMBeanException
              • org.springframework.jmx.access.MBeanInfoRetrievalException
              • org.springframework.jmx.MBeanServerNotFoundException
              • org.springframework.jmx.export.notification.UnableToSendNotificationException
            • org.springframework.jndi.JndiLookupFailureException
            • org.springframework.scheduling.quartz.JobMethodInvocationFailedException
            • org.springframework.scripting.jruby.JRubyScriptUtils.JRubyExecutionException
            • org.springframework.mail.MailException
              • org.springframework.mail.MailAuthenticationException
              • org.springframework.mail.MailParseException
              • org.springframework.mail.MailPreparationException
              • org.springframework.mail.MailSendException
            • org.springframework.web.multipart.MultipartException
              • org.springframework.web.multipart.MaxUploadSizeExceededException
            • org.springframework.remoting.RemoteAccessException
              • org.springframework.remoting.RemoteConnectFailureException
              • org.springframework.remoting.RemoteInvocationFailureException
                • org.springframework.remoting.soap.SoapFaultException
                  • org.springframework.remoting.jaxrpc.JaxRpcSoapFaultException
                  • org.springframework.remoting.jaxws.JaxWsSoapFaultException
              • org.springframework.remoting.RemoteLookupFailureException
              • org.springframework.remoting.RemoteProxyFailureException
            • org.springframework.web.client.RestClientException
              • org.springframework.web.client.HttpStatusCodeException
                • org.springframework.web.client.HttpClientErrorException
                • org.springframework.web.client.HttpServerErrorException
              • org.springframework.web.client.ResourceAccessException
            • org.springframework.scheduling.SchedulingException
            • org.springframework.scripting.ScriptCompilationException
            • org.springframework.transaction.TransactionException
              • org.springframework.transaction.CannotCreateTransactionException
                • org.springframework.transaction.NestedTransactionNotSupportedException
                • org.springframework.transaction.TransactionSuspensionNotSupportedException
              • org.springframework.transaction.HeuristicCompletionException
              • org.springframework.transaction.TransactionSystemException
              • org.springframework.transaction.TransactionTimedOutException
              • org.springframework.transaction.TransactionUsageException
                • org.springframework.transaction.IllegalTransactionStateException
                • org.springframework.transaction.InvalidIsolationLevelException
                • org.springframework.transaction.InvalidTimeoutException
                • org.springframework.transaction.NoTransactionException
              • org.springframework.transaction.UnexpectedRollbackException
            • org.springframework.oxm.XmlMappingException
              • org.springframework.oxm.castor.CastorMappingException
              • org.springframework.oxm.MarshallingException
                • org.springframework.oxm.MarshallingFailureException
                • org.springframework.oxm.UnmarshallingFailureException
              • org.springframework.oxm.UncategorizedMappingException
              • org.springframework.oxm.ValidationFailureException
          • org.springframework.context.NoSuchMessageException
          • java.util.concurrent.RejectedExecutionException
            • org.springframework.core.task.TaskRejectedException
              • org.springframework.core.task.TaskTimeoutException
        • javax.servlet.ServletException
          • org.springframework.web.HttpMediaTypeException
            • org.springframework.web.HttpMediaTypeNotAcceptableException
            • org.springframework.web.HttpMediaTypeNotSupportedException
          • org.springframework.web.HttpRequestMethodNotSupportedException
          • org.springframework.web.HttpSessionRequiredException
          • org.springframework.web.servlet.ModelAndViewDefiningException
          • org.springframework.web.util.NestedServletException
            • org.springframework.web.bind.ServletRequestBindingException
              • org.springframework.web.bind.MissingServletRequestParameterException
              • org.springframework.web.bind.UnsatisfiedServletRequestParameterException
          • org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException
    • org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor (implements org.springframework.aop.AfterAdvice, org.aopalliance.intercept.MethodInterceptor)
    • org.springframework.web.servlet.view.tiles2.TilesConfigurer (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.web.context.ServletContextAware)
    • org.springframework.scheduling.timer.TimerFactoryBean (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • java.util.TimerTask (implements java.lang.Runnable)
      • org.springframework.scheduling.timer.DelegatingTimerTask
    • org.springframework.scheduling.timer.TimerTaskExecutor (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.scheduling.SchedulingTaskExecutor)
    • org.springframework.core.style.ToStringCreator
    • org.springframework.transaction.interceptor.TransactionAspectSupport (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean)
      • org.springframework.transaction.interceptor.TransactionInterceptor (implements org.aopalliance.intercept.MethodInterceptor, java.io.Serializable)
    • org.springframework.transaction.interceptor.TransactionAspectSupport.TransactionInfo
    • org.springframework.transaction.interceptor.TransactionAspectUtils
    • org.springframework.jms.connection.TransactionAwareConnectionFactoryProxy (implements javax.jms.ConnectionFactory, javax.jms.QueueConnectionFactory, javax.jms.TopicConnectionFactory)
    • org.springframework.orm.jdo.TransactionAwarePersistenceManagerFactoryProxy (implements org.springframework.beans.factory.FactoryBean<T>)
    • org.springframework.transaction.support.TransactionCallbackWithoutResult (implements org.springframework.transaction.support.TransactionCallback<T>)
    • org.springframework.test.context.transaction.TransactionConfigurationAttributes
    • org.springframework.transaction.support.TransactionSynchronizationAdapter (implements org.springframework.core.Ordered, org.springframework.transaction.support.TransactionSynchronization)
      • org.springframework.jdbc.support.lob.SpringLobCreatorSynchronization
    • org.springframework.transaction.support.TransactionSynchronizationManager
    • org.springframework.transaction.support.TransactionSynchronizationUtils
    • org.springframework.util.xml.TransformerUtils
    • org.quartz.Trigger (implements java.lang.Cloneable, java.lang.Comparable<T>, java.io.Serializable)
      • org.quartz.CronTrigger
        • org.springframework.scheduling.quartz.CronTriggerBean (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.scheduling.quartz.JobDetailAwareTrigger)
      • org.quartz.SimpleTrigger
        • org.springframework.scheduling.quartz.SimpleTriggerBean (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.scheduling.quartz.JobDetailAwareTrigger)
    • org.springframework.orm.hibernate3.TypeDefinitionBean (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean)
    • org.springframework.core.convert.TypeDescriptor
      • org.springframework.core.convert.support.PropertyTypeDescriptor
    • org.springframework.beans.factory.config.TypedStringValue (implements org.springframework.beans.BeanMetadataElement)
    • org.springframework.expression.TypedValue
      • org.springframework.expression.spel.support.BooleanTypedValue
    • org.springframework.aop.aspectj.TypePatternClassFilter (implements org.springframework.aop.ClassFilter)
    • org.springframework.util.TypeUtils
    • org.springframework.ui.context.support.UiApplicationContextUtils
    • org.springframework.jdbc.object.UpdatableSqlQuery.RowMapperImpl (implements org.springframework.jdbc.core.RowMapper<T>)
    • org.springframework.web.util.UriTemplate
    • org.springframework.web.util.UriUtils
    • org.springframework.web.util.UrlPathHelper
    • org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter (implements javax.jms.ConnectionFactory, org.springframework.beans.factory.InitializingBean, javax.jms.QueueConnectionFactory, javax.jms.TopicConnectionFactory)
    • org.springframework.transaction.jta.UserTransactionAdapter (implements javax.transaction.UserTransaction)
    • org.springframework.validation.ValidationUtils
    • javax.faces.el.VariableResolver
      • org.springframework.web.jsf.DelegatingVariableResolver
        • org.springframework.web.jsf.SpringBeanVariableResolver
      • org.springframework.web.jsf.WebApplicationContextVariableResolver
    • org.springframework.ui.velocity.VelocityEngineFactory
      • org.springframework.web.servlet.view.velocity.VelocityConfigurer (implements org.springframework.beans.factory.InitializingBean, org.springframework.context.ResourceLoaderAware, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.view.velocity.VelocityConfig)
      • org.springframework.ui.velocity.VelocityEngineFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean, org.springframework.context.ResourceLoaderAware)
    • org.springframework.ui.velocity.VelocityEngineUtils
    • org.springframework.util.WeakReferenceMonitor
    • org.springframework.instrument.classloading.WeavingTransformer
    • org.springframework.web.context.support.WebApplicationContextUtils
    • org.springframework.web.util.WebAppRootListener (implements javax.servlet.ServletContextListener)
    • org.springframework.instrument.classloading.weblogic.WebLogicLoadTimeWeaver (implements org.springframework.instrument.classloading.LoadTimeWeaver)
    • org.springframework.web.portlet.handler.WebRequestHandlerInterceptorAdapter (implements org.springframework.web.portlet.HandlerInterceptor)
    • org.springframework.web.servlet.handler.WebRequestHandlerInterceptorAdapter (implements org.springframework.web.servlet.HandlerInterceptor)
    • org.springframework.jmx.support.WebSphereMBeanServerFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.web.util.WebUtils
    • java.io.Writer (implements java.lang.Appendable, java.io.Closeable, java.io.Flushable)
      • org.springframework.util.CommonsLogWriter
      • javax.servlet.jsp.JspWriter
        • javax.servlet.jsp.tagext.BodyContent
          • org.springframework.mock.web.MockBodyContent
        • org.springframework.mock.web.MockJspWriter
    • org.springframework.oxm.xmlbeans.XmlOptionsFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>)
    • org.springframework.util.xml.XmlValidationModeDetector

Interface Hierarchy

  • org.aopalliance.aop.Advice
    • org.springframework.aop.AfterAdvice
      • org.springframework.aop.AfterReturningAdvice
      • org.springframework.aop.ThrowsAdvice
    • org.springframework.aop.BeforeAdvice
      • org.springframework.aop.MethodBeforeAdvice
    • org.springframework.aop.DynamicIntroductionAdvice
      • org.springframework.aop.IntroductionInterceptor (also extends org.aopalliance.intercept.MethodInterceptor)
    • org.aopalliance.intercept.Interceptor
      • org.aopalliance.intercept.MethodInterceptor
        • org.springframework.aop.IntroductionInterceptor (also extends org.springframework.aop.DynamicIntroductionAdvice)
  • org.springframework.aop.framework.AdvisedSupportListener
  • org.springframework.aop.Advisor
    • org.springframework.aop.aspectj.InstantiationModelAwarePointcutAdvisor
    • org.springframework.aop.IntroductionAdvisor (also extends org.springframework.aop.IntroductionInfo)
    • org.springframework.aop.PointcutAdvisor
      • org.springframework.aop.aspectj.InstantiationModelAwarePointcutAdvisor
  • org.springframework.aop.framework.adapter.AdvisorAdapter
  • org.springframework.aop.framework.adapter.AdvisorAdapterRegistry
  • org.springframework.aop.framework.AdvisorChainFactory
  • org.springframework.core.AliasRegistry
    • org.springframework.beans.factory.support.BeanDefinitionRegistry
  • org.springframework.format.AnnotationFormatterFactory<A>
  • org.springframework.aop.framework.AopInfrastructureBean
  • org.springframework.aop.framework.AopProxy
  • org.springframework.aop.framework.AopProxyFactory
  • org.springframework.context.ApplicationContextAware
  • org.springframework.context.event.ApplicationEventMulticaster
  • org.springframework.context.ApplicationEventPublisher
    • org.springframework.context.ApplicationContext (also extends org.springframework.beans.factory.HierarchicalBeanFactory, org.springframework.beans.factory.ListableBeanFactory, org.springframework.context.MessageSource, org.springframework.core.io.support.ResourcePatternResolver)
      • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.Lifecycle)
        • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
        • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
      • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext, org.springframework.web.context.WebApplicationContext)
      • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext, org.springframework.web.context.WebApplicationContext)
      • org.springframework.web.context.WebApplicationContext
        • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
        • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
    • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.ApplicationContext, org.springframework.context.Lifecycle)
      • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
      • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
    • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext, org.springframework.web.context.WebApplicationContext)
    • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext, org.springframework.web.context.WebApplicationContext)
    • org.springframework.web.context.WebApplicationContext
      • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
      • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
  • org.springframework.context.ApplicationEventPublisherAware
  • org.springframework.aop.aspectj.annotation.AspectJAdvisorFactory
  • org.springframework.core.AttributeAccessor
    • org.springframework.beans.factory.annotation.AnnotatedBeanDefinition
    • org.springframework.beans.factory.config.BeanDefinition (also extends org.springframework.beans.BeanMetadataElement)
      • org.springframework.beans.factory.annotation.AnnotatedBeanDefinition
  • org.springframework.util.AutoPopulatingList.ElementFactory<E>
  • org.springframework.beans.factory.support.AutowireCandidateResolver
  • org.springframework.jdbc.core.BatchPreparedStatementSetter
    • org.springframework.jdbc.core.InterruptibleBatchPreparedStatementSetter
  • org.springframework.beans.factory.BeanClassLoaderAware
  • org.springframework.beans.factory.xml.BeanDefinitionDecorator
  • org.springframework.beans.factory.xml.BeanDefinitionDocumentReader
  • org.springframework.beans.factory.xml.BeanDefinitionParser
  • org.springframework.beans.factory.support.BeanDefinitionReader
  • org.springframework.beans.factory.config.BeanExpressionResolver
  • org.springframework.beans.factory.BeanFactory
    • org.springframework.context.ApplicationContext (also extends org.springframework.context.ApplicationEventPublisher, org.springframework.beans.factory.HierarchicalBeanFactory, org.springframework.beans.factory.ListableBeanFactory, org.springframework.context.MessageSource, org.springframework.core.io.support.ResourcePatternResolver)
      • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.Lifecycle)
        • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
        • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
      • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext, org.springframework.web.context.WebApplicationContext)
      • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext, org.springframework.web.context.WebApplicationContext)
      • org.springframework.web.context.WebApplicationContext
        • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
        • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
    • org.springframework.beans.factory.config.AutowireCapableBeanFactory
      • org.springframework.beans.factory.config.ConfigurableListableBeanFactory (also extends org.springframework.beans.factory.config.ConfigurableBeanFactory, org.springframework.beans.factory.ListableBeanFactory)
    • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.ApplicationContext, org.springframework.context.Lifecycle)
      • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
      • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
    • org.springframework.beans.factory.config.ConfigurableBeanFactory (also extends org.springframework.beans.factory.HierarchicalBeanFactory, org.springframework.beans.factory.config.SingletonBeanRegistry)
      • org.springframework.beans.factory.config.ConfigurableListableBeanFactory (also extends org.springframework.beans.factory.config.AutowireCapableBeanFactory, org.springframework.beans.factory.ListableBeanFactory)
    • org.springframework.beans.factory.config.ConfigurableListableBeanFactory (also extends org.springframework.beans.factory.config.AutowireCapableBeanFactory, org.springframework.beans.factory.config.ConfigurableBeanFactory, org.springframework.beans.factory.ListableBeanFactory)
    • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext, org.springframework.web.context.WebApplicationContext)
    • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext, org.springframework.web.context.WebApplicationContext)
    • org.springframework.beans.factory.HierarchicalBeanFactory
      • org.springframework.context.ApplicationContext (also extends org.springframework.context.ApplicationEventPublisher, org.springframework.beans.factory.ListableBeanFactory, org.springframework.context.MessageSource, org.springframework.core.io.support.ResourcePatternResolver)
        • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.Lifecycle)
          • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
          • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
        • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext, org.springframework.web.context.WebApplicationContext)
        • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext, org.springframework.web.context.WebApplicationContext)
        • org.springframework.web.context.WebApplicationContext
          • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
          • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
      • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.ApplicationContext, org.springframework.context.Lifecycle)
        • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
        • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
      • org.springframework.beans.factory.config.ConfigurableBeanFactory (also extends org.springframework.beans.factory.config.SingletonBeanRegistry)
        • org.springframework.beans.factory.config.ConfigurableListableBeanFactory (also extends org.springframework.beans.factory.config.AutowireCapableBeanFactory, org.springframework.beans.factory.ListableBeanFactory)
      • org.springframework.beans.factory.config.ConfigurableListableBeanFactory (also extends org.springframework.beans.factory.config.AutowireCapableBeanFactory, org.springframework.beans.factory.config.ConfigurableBeanFactory, org.springframework.beans.factory.ListableBeanFactory)
      • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext, org.springframework.web.context.WebApplicationContext)
      • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext, org.springframework.web.context.WebApplicationContext)
      • org.springframework.web.context.WebApplicationContext
        • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
        • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
    • org.springframework.beans.factory.ListableBeanFactory
      • org.springframework.context.ApplicationContext (also extends org.springframework.context.ApplicationEventPublisher, org.springframework.beans.factory.HierarchicalBeanFactory, org.springframework.context.MessageSource, org.springframework.core.io.support.ResourcePatternResolver)
        • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.Lifecycle)
          • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
          • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
        • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext, org.springframework.web.context.WebApplicationContext)
        • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext, org.springframework.web.context.WebApplicationContext)
        • org.springframework.web.context.WebApplicationContext
          • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
          • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
      • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.ApplicationContext, org.springframework.context.Lifecycle)
        • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
        • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
      • org.springframework.beans.factory.config.ConfigurableListableBeanFactory (also extends org.springframework.beans.factory.config.AutowireCapableBeanFactory, org.springframework.beans.factory.config.ConfigurableBeanFactory)
      • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext, org.springframework.web.context.WebApplicationContext)
      • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext, org.springframework.web.context.WebApplicationContext)
      • org.springframework.web.context.WebApplicationContext
        • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
        • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
    • org.springframework.web.context.WebApplicationContext
      • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
      • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
  • org.springframework.beans.factory.BeanFactoryAware
  • org.springframework.beans.factory.access.BeanFactoryLocator
  • org.springframework.beans.factory.config.BeanFactoryPostProcessor
    • org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor
  • org.springframework.beans.factory.access.BeanFactoryReference
  • org.springframework.beans.BeanMetadataElement
    • org.springframework.beans.factory.annotation.AnnotatedBeanDefinition
    • org.springframework.beans.factory.config.BeanDefinition (also extends org.springframework.core.AttributeAccessor)
      • org.springframework.beans.factory.annotation.AnnotatedBeanDefinition
    • org.springframework.beans.factory.config.BeanReference
    • org.springframework.beans.factory.parsing.ComponentDefinition
    • org.springframework.beans.factory.parsing.DefaultsDefinition
  • org.springframework.beans.factory.BeanNameAware
  • org.springframework.beans.factory.support.BeanNameGenerator
  • org.springframework.beans.factory.config.BeanPostProcessor
    • org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor
    • org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor
      • org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor
    • org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor
    • org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor
  • org.springframework.beans.factory.wiring.BeanWiringInfoResolver
  • org.springframework.validation.BindingErrorProcessor
  • org.springframework.jca.context.BootstrapContextAware
  • org.springframework.jms.core.BrowserCallback<T>
  • org.springframework.jdbc.core.CallableStatementCallback<T>
  • org.springframework.jdbc.core.CallableStatementCreator
  • org.springframework.jdbc.core.metadata.CallMetaDataProvider
  • org.springframework.jca.cci.core.CciOperations
  • org.springframework.aop.ClassFilter
  • org.springframework.core.type.ClassMetadata
    • org.springframework.core.type.AnnotationMetadata
  • org.springframework.http.client.ClientHttpRequestFactory
  • javax.sql.CommonDataSource
    • javax.sql.DataSource (also extends java.sql.Wrapper)
      • org.springframework.jdbc.datasource.embedded.EmbeddedDatabase
      • org.springframework.jdbc.datasource.SmartDataSource
  • java.lang.Comparable<T>
    • org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping.PortletRequestMappingPredicate
    • org.springframework.core.enums.LabeledEnum (also extends java.io.Serializable)
  • org.springframework.beans.factory.aspectj.ConfigurableObject
  • org.springframework.jca.cci.core.ConnectionCallback<T>
  • org.springframework.jdbc.core.ConnectionCallback<T>
  • javax.jms.ConnectionFactory
    • org.springframework.jms.connection.SmartConnectionFactory
  • org.springframework.jms.connection.ConnectionFactoryUtils.ResourceFactory
  • org.springframework.jdbc.datasource.ConnectionHandle
  • org.springframework.jdbc.datasource.embedded.ConnectionProperties
  • org.springframework.expression.ConstructorExecutor
  • org.springframework.expression.ConstructorResolver
  • org.springframework.test.context.ContextLoader
  • org.springframework.core.ControlFlow
  • org.springframework.web.portlet.mvc.Controller
  • org.springframework.web.servlet.mvc.Controller
  • org.springframework.core.convert.ConversionService
  • org.springframework.core.convert.converter.Converter<S,T>
  • org.springframework.core.convert.converter.ConverterFactory<S,R>
  • org.springframework.core.convert.converter.ConverterRegistry
    • org.springframework.format.FormatterRegistry
  • org.springframework.jdbc.support.DatabaseMetaDataCallback
  • org.springframework.jdbc.datasource.init.DatabasePopulator
  • org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer
  • org.springframework.jdbc.datasource.embedded.DataSourceFactory
  • org.springframework.jdbc.datasource.lookup.DataSourceLookup
  • org.springframework.jms.support.destination.DestinationResolver
    • org.springframework.jms.support.destination.CachingDestinationResolver
  • org.springframework.beans.factory.DisposableBean
  • org.springframework.beans.factory.xml.DocumentLoader
  • org.springframework.web.servlet.tags.EditorAwareTag
  • org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseConfigurer
  • javax.persistence.EntityManager
    • org.springframework.orm.jpa.EntityManagerPlus (also extends org.springframework.orm.jpa.EntityManagerPlusOperations)
    • org.springframework.orm.jpa.EntityManagerProxy
  • javax.persistence.EntityManagerFactory
    • org.springframework.orm.jpa.EntityManagerFactoryPlus (also extends org.springframework.orm.jpa.EntityManagerFactoryPlusOperations)
  • org.springframework.orm.jpa.EntityManagerFactoryInfo
  • org.springframework.orm.jpa.EntityManagerFactoryPlusOperations
    • org.springframework.orm.jpa.EntityManagerFactoryPlus (also extends javax.persistence.EntityManagerFactory)
  • org.springframework.orm.jpa.EntityManagerPlusOperations
    • org.springframework.orm.jpa.EntityManagerPlus (also extends javax.persistence.EntityManager)
  • org.springframework.core.ErrorCoded
  • org.springframework.util.ErrorHandler
  • org.springframework.validation.Errors
    • org.springframework.validation.BindingResult
  • org.springframework.expression.EvaluationContext
  • org.springframework.web.portlet.mvc.EventAwareController
  • java.util.EventListener
    • org.springframework.context.ApplicationListener<E>
      • org.springframework.context.event.SmartApplicationListener (also extends org.springframework.core.Ordered)
    • org.springframework.beans.factory.parsing.ReaderEventListener
  • java.util.concurrent.Executor
    • org.springframework.core.task.TaskExecutor
      • org.springframework.core.task.AsyncTaskExecutor
        • org.springframework.scheduling.SchedulingTaskExecutor
      • org.springframework.scheduling.SchedulingTaskExecutor
  • org.springframework.expression.Expression
  • org.springframework.expression.ExpressionParser
  • org.springframework.beans.factory.FactoryBean<T>
    • org.springframework.beans.factory.SmartFactoryBean<T>
  • org.springframework.web.servlet.view.freemarker.FreeMarkerConfig
  • org.springframework.core.convert.converter.GenericConverter
    • org.springframework.core.convert.converter.ConditionalGenericConverter
  • org.springframework.scripting.groovy.GroovyObjectCustomizer
  • org.springframework.web.portlet.HandlerAdapter
  • org.springframework.web.servlet.HandlerAdapter
  • org.springframework.web.portlet.HandlerExceptionResolver
  • org.springframework.web.servlet.HandlerExceptionResolver
  • org.springframework.web.portlet.HandlerInterceptor
  • org.springframework.web.servlet.HandlerInterceptor
  • org.springframework.web.portlet.HandlerMapping
  • org.springframework.web.servlet.HandlerMapping
  • org.springframework.orm.hibernate3.HibernateCallback<T>
  • org.springframework.orm.hibernate3.HibernateOperations
  • org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration
  • org.springframework.remoting.httpinvoker.HttpInvokerRequestExecutor
  • org.springframework.http.HttpMessage
    • org.springframework.http.client.ClientHttpRequest
    • org.springframework.http.client.ClientHttpResponse
    • org.springframework.http.HttpInputMessage
      • org.springframework.http.client.ClientHttpResponse
      • org.springframework.http.server.ServerHttpRequest
    • org.springframework.http.HttpOutputMessage
      • org.springframework.http.client.ClientHttpRequest
      • org.springframework.http.server.ServerHttpResponse
    • org.springframework.http.server.ServerHttpRequest
    • org.springframework.http.server.ServerHttpResponse
  • org.springframework.http.converter.HttpMessageConverter<T>
  • org.springframework.web.HttpRequestHandler
  • org.springframework.core.InfrastructureProxy
  • org.springframework.beans.factory.InitializingBean
  • org.springframework.core.io.InputStreamSource
    • org.springframework.core.io.ContextResource
    • org.springframework.core.io.Resource
      • org.springframework.core.io.ContextResource
  • org.springframework.beans.factory.support.InstantiationStrategy
  • org.springframework.jca.cci.core.InteractionCallback<T>
  • org.springframework.aop.IntroductionInfo
    • org.springframework.aop.IntroductionAdvisor (also extends org.springframework.aop.Advisor)
  • org.springframework.remoting.jaxrpc.JaxRpcServicePostProcessor
  • org.springframework.jdbc.core.JdbcOperations
  • org.springframework.orm.jdo.JdoCallback<T>
  • org.springframework.orm.jdo.JdoDialect
  • org.springframework.orm.jdo.JdoOperations
  • org.springframework.jms.listener.endpoint.JmsActivationSpecFactory
  • org.springframework.jms.core.JmsOperations
  • org.springframework.jmx.export.metadata.JmxAttributeSource
  • org.springframework.jndi.JndiCallback<T>
  • org.springframework.scheduling.quartz.JobDetailAwareTrigger
  • org.aopalliance.intercept.Joinpoint
    • org.aopalliance.intercept.Invocation
      • org.aopalliance.intercept.MethodInvocation
        • org.springframework.aop.ProxyMethodInvocation
  • org.springframework.orm.jpa.JpaCallback<T>
  • org.springframework.orm.jpa.JpaOperations
  • org.springframework.orm.jpa.JpaVendorAdapter
  • org.springframework.jdbc.support.KeyHolder
  • org.springframework.core.enums.LabeledEnumResolver
  • org.springframework.web.servlet.mvc.LastModified
  • org.springframework.context.Lifecycle
    • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.ApplicationContext)
      • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
      • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
    • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext, org.springframework.web.context.WebApplicationContext)
    • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext, org.springframework.web.context.WebApplicationContext)
    • org.springframework.context.LifecycleProcessor
    • org.springframework.context.SmartLifecycle (also extends org.springframework.context.Phased)
  • org.springframework.instrument.classloading.LoadTimeWeaver
  • org.springframework.context.weaving.LoadTimeWeaverAware
  • org.springframework.jdbc.support.lob.LobCreator
  • org.springframework.jdbc.support.lob.LobHandler
  • org.springframework.context.i18n.LocaleContext
  • org.springframework.web.servlet.LocaleResolver
  • org.springframework.mail.MailMessage
  • org.springframework.mail.MailSender
    • org.springframework.mail.javamail.JavaMailSender
  • java.util.Map<K,V>
    • org.springframework.core.ConcurrentMap
    • org.springframework.util.MultiValueMap<K,V>
  • org.springframework.oxm.Marshaller
    • org.springframework.oxm.GenericMarshaller
    • org.springframework.oxm.mime.MimeMarshaller
  • org.springframework.jmx.export.MBeanExporterListener
  • org.springframework.jmx.export.MBeanExportOperations
  • org.springframework.jmx.export.assembler.MBeanInfoAssembler
    • org.springframework.jmx.export.assembler.AutodetectCapableMBeanInfoAssembler
  • org.springframework.beans.Mergeable
  • org.springframework.validation.MessageCodesResolver
  • org.springframework.jms.support.converter.MessageConverter
  • org.springframework.jms.core.MessageCreator
  • org.springframework.jms.core.MessagePostProcessor
  • org.springframework.context.MessageSource
    • org.springframework.context.ApplicationContext (also extends org.springframework.context.ApplicationEventPublisher, org.springframework.beans.factory.HierarchicalBeanFactory, org.springframework.beans.factory.ListableBeanFactory, org.springframework.core.io.support.ResourcePatternResolver)
      • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.Lifecycle)
        • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
        • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
      • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext, org.springframework.web.context.WebApplicationContext)
      • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext, org.springframework.web.context.WebApplicationContext)
      • org.springframework.web.context.WebApplicationContext
        • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
        • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
    • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.ApplicationContext, org.springframework.context.Lifecycle)
      • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
      • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
    • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext, org.springframework.web.context.WebApplicationContext)
    • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext, org.springframework.web.context.WebApplicationContext)
    • org.springframework.context.HierarchicalMessageSource
    • org.springframework.web.context.WebApplicationContext
      • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
      • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
  • org.springframework.context.MessageSourceAware
  • org.springframework.context.MessageSourceResolvable
  • org.springframework.core.type.classreading.MetadataReader
  • org.springframework.core.type.classreading.MetadataReaderFactory
  • org.springframework.expression.MethodExecutor
  • org.springframework.expression.MethodFilter
  • org.springframework.aop.MethodMatcher
    • org.springframework.aop.IntroductionAwareMethodMatcher
  • org.springframework.core.type.MethodMetadata
  • org.springframework.web.servlet.mvc.multiaction.MethodNameResolver
  • org.springframework.beans.factory.support.MethodReplacer
  • org.springframework.expression.MethodResolver
  • org.springframework.oxm.mime.MimeContainer
  • org.springframework.mail.javamail.MimeMessagePreparator
  • org.springframework.ui.Model
  • org.springframework.web.servlet.mvc.annotation.ModelAndViewResolver
  • org.springframework.web.multipart.MultipartFile
  • org.springframework.web.multipart.MultipartRequest
    • org.springframework.web.portlet.multipart.MultipartActionRequest (also extends javax.portlet.ActionRequest)
    • org.springframework.web.multipart.MultipartHttpServletRequest (also extends javax.servlet.http.HttpServletRequest)
  • org.springframework.web.multipart.MultipartResolver
  • org.springframework.beans.factory.NamedBean
  • org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
  • org.springframework.beans.factory.xml.NamespaceHandler
  • org.springframework.beans.factory.xml.NamespaceHandlerResolver
  • org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor
  • org.springframework.jmx.export.notification.NotificationPublisher
  • org.springframework.jmx.export.notification.NotificationPublisherAware
  • org.springframework.beans.factory.ObjectFactory<T>
  • org.springframework.jmx.export.naming.ObjectNamingStrategy
  • org.springframework.expression.OperatorOverloader
  • org.springframework.jdbc.support.lob.OracleLobHandler.LobCallback
  • org.springframework.core.Ordered
    • org.springframework.aop.aspectj.AspectInstanceFactory
      • org.springframework.aop.aspectj.annotation.MetadataAwareAspectInstanceFactory
    • org.springframework.aop.aspectj.AspectJPrecedenceInformation
    • org.springframework.aop.aspectj.annotation.MetadataAwareAspectInstanceFactory
    • org.springframework.core.PriorityOrdered
    • org.springframework.context.event.SmartApplicationListener (also extends org.springframework.context.ApplicationListener<E>)
  • org.springframework.web.servlet.tags.ParamAware
  • org.springframework.jdbc.core.ParameterDisposer
  • org.springframework.jdbc.core.ParameterMapper
  • org.springframework.core.ParameterNameDiscoverer
  • org.springframework.format.Parser<T>
    • org.springframework.format.Formatter<T> (also extends org.springframework.format.Printer<T>)
  • org.springframework.expression.ParserContext
  • org.springframework.beans.factory.parsing.ParseState.Entry
  • org.springframework.util.PathMatcher
  • org.springframework.dao.support.PersistenceExceptionTranslator
    • org.springframework.orm.jpa.JpaDialect
  • javax.persistence.spi.PersistenceUnitInfo
    • org.springframework.orm.jpa.persistenceunit.SmartPersistenceUnitInfo
  • org.springframework.orm.jpa.persistenceunit.PersistenceUnitManager
  • org.springframework.orm.jpa.persistenceunit.PersistenceUnitPostProcessor
  • org.springframework.context.Phased
    • org.springframework.context.SmartLifecycle (also extends org.springframework.context.Lifecycle)
  • org.springframework.transaction.PlatformTransactionManager
    • org.springframework.transaction.support.CallbackPreferringPlatformTransactionManager
    • org.springframework.transaction.support.ResourceTransactionManager
  • org.springframework.aop.Pointcut
    • org.springframework.aop.support.ExpressionPointcut
  • org.springframework.aop.target.PoolingConfig
  • org.springframework.web.portlet.context.PortletConfigAware
  • org.springframework.web.portlet.context.PortletContextAware
  • org.springframework.web.portlet.multipart.PortletMultipartResolver
  • javax.portlet.PortletRequest
    • javax.portlet.ClientDataRequest
      • javax.portlet.ActionRequest
        • org.springframework.web.portlet.multipart.MultipartActionRequest (also extends org.springframework.web.multipart.MultipartRequest)
  • org.springframework.jdbc.core.PreparedStatementCallback<T>
  • org.springframework.jdbc.core.PreparedStatementCreator
  • org.springframework.jdbc.core.PreparedStatementSetter
  • org.springframework.format.Printer<T>
    • org.springframework.format.Formatter<T> (also extends org.springframework.format.Parser<T>)
  • org.springframework.beans.factory.parsing.ProblemReporter
  • org.springframework.jms.core.ProducerCallback<T>
  • org.springframework.test.annotation.ProfileValueSource
  • org.springframework.util.PropertiesPersister
  • org.springframework.beans.PropertyAccessor
    • org.springframework.beans.BeanWrapper
    • org.springframework.beans.ConfigurablePropertyAccessor (also extends org.springframework.beans.PropertyEditorRegistry, org.springframework.beans.TypeConverter)
      • org.springframework.beans.BeanWrapper
  • org.springframework.expression.PropertyAccessor
  • org.springframework.beans.PropertyEditorRegistrar
  • org.springframework.beans.PropertyEditorRegistry
    • org.springframework.beans.BeanWrapper
    • org.springframework.beans.ConfigurablePropertyAccessor (also extends org.springframework.beans.PropertyAccessor, org.springframework.beans.TypeConverter)
      • org.springframework.beans.BeanWrapper
  • org.springframework.util.PropertyPlaceholderHelper.PlaceholderResolver
  • org.springframework.beans.PropertyValues
  • org.springframework.aop.RawTargetAccess
    • org.springframework.aop.scope.ScopedObject
  • org.springframework.jca.cci.core.RecordCreator
  • org.springframework.jca.cci.core.RecordExtractor<T>
  • org.springframework.util.ReflectionUtils.FieldCallback
  • org.springframework.util.ReflectionUtils.FieldFilter
  • org.springframework.util.ReflectionUtils.MethodCallback
  • org.springframework.util.ReflectionUtils.MethodFilter
  • org.springframework.aop.target.dynamic.Refreshable
  • java.rmi.Remote
    • org.springframework.remoting.rmi.RmiInvocationHandler
  • org.springframework.remoting.support.RemoteInvocationExecutor
  • org.springframework.remoting.support.RemoteInvocationFactory
  • org.springframework.web.context.request.RequestAttributes
    • org.springframework.web.context.request.NativeWebRequest
    • org.springframework.web.context.request.WebRequest
      • org.springframework.web.context.request.NativeWebRequest
  • org.springframework.web.client.RequestCallback
  • org.springframework.web.servlet.RequestToViewNameTranslator
  • org.springframework.web.portlet.mvc.ResourceAwareController
  • org.springframework.transaction.support.ResourceHolder
  • org.springframework.core.io.ResourceLoader
    • org.springframework.context.ApplicationContext (also extends org.springframework.context.ApplicationEventPublisher, org.springframework.beans.factory.HierarchicalBeanFactory, org.springframework.beans.factory.ListableBeanFactory, org.springframework.context.MessageSource, org.springframework.core.io.support.ResourcePatternResolver)
      • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.Lifecycle)
        • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
        • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
      • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext, org.springframework.web.context.WebApplicationContext)
      • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext, org.springframework.web.context.WebApplicationContext)
      • org.springframework.web.context.WebApplicationContext
        • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
        • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
    • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.ApplicationContext, org.springframework.context.Lifecycle)
      • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
      • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
    • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext, org.springframework.web.context.WebApplicationContext)
    • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext, org.springframework.web.context.WebApplicationContext)
    • org.springframework.core.io.support.ResourcePatternResolver
      • org.springframework.context.ApplicationContext (also extends org.springframework.context.ApplicationEventPublisher, org.springframework.beans.factory.HierarchicalBeanFactory, org.springframework.beans.factory.ListableBeanFactory, org.springframework.context.MessageSource)
        • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.Lifecycle)
          • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
          • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
        • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext, org.springframework.web.context.WebApplicationContext)
        • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext, org.springframework.web.context.WebApplicationContext)
        • org.springframework.web.context.WebApplicationContext
          • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
          • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
      • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.ApplicationContext, org.springframework.context.Lifecycle)
        • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
        • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
      • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext, org.springframework.web.context.WebApplicationContext)
      • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext, org.springframework.web.context.WebApplicationContext)
      • org.springframework.web.context.WebApplicationContext
        • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
        • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
    • org.springframework.web.context.WebApplicationContext
      • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
      • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
  • org.springframework.context.ResourceLoaderAware
  • org.springframework.web.client.ResponseErrorHandler
  • org.springframework.web.client.ResponseExtractor<T>
  • org.springframework.web.client.RestOperations
  • org.springframework.jdbc.core.ResultSetExtractor<T>
  • org.springframework.jdbc.core.RowCallbackHandler
  • org.springframework.jdbc.core.RowMapper<T>
    • org.springframework.jdbc.core.simple.ParameterizedRowMapper<T>
  • java.lang.Runnable
    • org.springframework.scheduling.SchedulingAwareRunnable
    • javax.jms.Session
      • org.springframework.jms.connection.SessionProxy
  • org.springframework.transaction.SavepointManager
    • org.springframework.transaction.TransactionStatus
  • org.springframework.scheduling.quartz.SchedulerContextAware
  • org.springframework.beans.factory.config.Scope
  • org.springframework.context.annotation.ScopeMetadataResolver
  • org.springframework.scripting.ScriptFactory
  • org.springframework.scripting.ScriptSource
  • org.springframework.beans.factory.support.SecurityContextProvider
  • org.springframework.jmx.export.naming.SelfNaming
  • java.io.Serializable
    • javax.ejb.EnterpriseBean
      • javax.ejb.SessionBean
        • org.springframework.ejb.support.SmartSessionBean
    • org.springframework.core.enums.LabeledEnum (also extends java.lang.Comparable<T>)
    • org.springframework.jdbc.support.rowset.SqlRowSet
  • org.springframework.web.context.ServletConfigAware
  • org.springframework.web.context.ServletContextAware
  • javax.servlet.ServletRequest
    • javax.servlet.http.HttpServletRequest
      • org.springframework.web.multipart.MultipartHttpServletRequest (also extends org.springframework.web.multipart.MultipartRequest)
  • org.springframework.web.bind.support.SessionAttributeStore
  • org.springframework.jms.listener.SessionAwareMessageListener<M>
  • org.springframework.jms.core.SessionCallback<T>
  • org.springframework.web.bind.support.SessionStatus
  • org.springframework.jdbc.core.simple.SimpleJdbcCallOperations
  • org.springframework.jdbc.core.simple.SimpleJdbcInsertOperations
  • org.springframework.jdbc.core.simple.SimpleJdbcOperations
  • org.springframework.beans.factory.config.SingletonBeanRegistry
    • org.springframework.beans.factory.config.ConfigurableBeanFactory (also extends org.springframework.beans.factory.HierarchicalBeanFactory)
      • org.springframework.beans.factory.config.ConfigurableListableBeanFactory (also extends org.springframework.beans.factory.config.AutowireCapableBeanFactory, org.springframework.beans.factory.ListableBeanFactory)
    • org.springframework.beans.factory.config.ConfigurableListableBeanFactory (also extends org.springframework.beans.factory.config.AutowireCapableBeanFactory, org.springframework.beans.factory.config.ConfigurableBeanFactory, org.springframework.beans.factory.ListableBeanFactory)
  • org.springframework.core.SmartClassLoader
  • org.springframework.transaction.support.SmartTransactionObject
  • org.springframework.beans.support.SortDefinition
  • org.springframework.beans.factory.parsing.SourceExtractor
  • org.springframework.expression.spel.SpelNode
  • org.springframework.aop.SpringProxy
  • org.springframework.jdbc.support.SQLExceptionTranslator
  • org.springframework.orm.ibatis.SqlMapClientCallback<T>
  • org.springframework.orm.ibatis.SqlMapClientOperations
  • org.springframework.jdbc.core.namedparam.SqlParameterSource
  • org.springframework.jdbc.core.SqlProvider
  • org.springframework.jdbc.core.SqlReturnType
  • org.springframework.jdbc.support.rowset.SqlRowSetMetaData
  • org.springframework.jdbc.core.SqlTypeValue
    • org.springframework.jdbc.core.DisposableSqlTypeValue
  • org.springframework.jdbc.support.SqlValue
    • org.springframework.jdbc.support.xml.SqlXmlValue
  • org.springframework.jdbc.support.xml.SqlXmlHandler
    • org.springframework.jdbc.support.xml.SqlXmlObjectMappingHandler
  • org.springframework.jdbc.core.StatementCallback<T>
  • org.springframework.util.StringValueResolver
  • org.springframework.jms.listener.SubscriptionNameProvider
  • org.springframework.jdbc.core.metadata.TableMetaDataProvider
  • org.springframework.aop.TargetClassAware
    • org.springframework.aop.framework.Advised
    • org.springframework.aop.TargetSource
  • org.springframework.aop.framework.autoproxy.TargetSourceCreator
  • org.springframework.scheduling.TaskScheduler
  • org.springframework.test.context.TestExecutionListener
  • org.springframework.ui.context.Theme
  • org.springframework.web.servlet.ThemeResolver
  • org.springframework.ui.context.ThemeSource
    • org.springframework.ui.context.HierarchicalThemeSource
  • org.springframework.aop.target.ThreadLocalTargetSourceStats
  • org.springframework.core.style.ToStringStyler
  • org.springframework.transaction.annotation.TransactionAnnotationParser
  • org.springframework.transaction.interceptor.TransactionAttributeSource
  • org.springframework.transaction.support.TransactionCallback<T>
  • org.springframework.transaction.TransactionDefinition
    • org.springframework.transaction.interceptor.TransactionAttribute
  • org.springframework.transaction.jta.TransactionFactory
  • org.springframework.transaction.support.TransactionOperations
  • org.springframework.transaction.support.TransactionSynchronization
  • org.springframework.scheduling.Trigger
  • org.springframework.scheduling.TriggerContext
  • org.springframework.expression.TypeComparator
  • org.springframework.beans.TypeConverter
    • org.springframework.beans.BeanWrapper
    • org.springframework.beans.ConfigurablePropertyAccessor (also extends org.springframework.beans.PropertyAccessor, org.springframework.beans.PropertyEditorRegistry)
      • org.springframework.beans.BeanWrapper
  • org.springframework.expression.TypeConverter
  • org.springframework.core.type.filter.TypeFilter
  • org.springframework.expression.TypeLocator
  • org.springframework.oxm.Unmarshaller
    • org.springframework.oxm.GenericUnmarshaller
    • org.springframework.oxm.mime.MimeUnmarshaller
  • org.springframework.validation.Validator
  • org.springframework.web.bind.annotation.ValueConstants
  • org.springframework.core.style.ValueStyler
  • org.springframework.web.servlet.view.velocity.VelocityConfig
  • org.springframework.web.servlet.View
  • org.springframework.web.servlet.ViewResolver
  • org.springframework.util.WeakReferenceMonitor.ReleaseListener
  • org.springframework.web.bind.support.WebArgumentResolver
  • org.springframework.web.bind.support.WebBindingInitializer
  • org.springframework.web.context.request.WebRequestInterceptor
  • java.sql.Wrapper
    • java.sql.Connection
      • org.springframework.jdbc.datasource.ConnectionProxy
    • javax.sql.DataSource (also extends javax.sql.CommonDataSource)
      • org.springframework.jdbc.datasource.embedded.EmbeddedDatabase
      • org.springframework.jdbc.datasource.SmartDataSource
  • org.springframework.jdbc.support.xml.XmlBinaryStreamProvider
  • org.springframework.jdbc.support.xml.XmlCharacterStreamProvider
  • org.springframework.jdbc.support.xml.XmlResultProvider

Annotation Type Hierarchy

  • org.springframework.beans.factory.annotation.Value (implements java.lang.annotation.Annotation)
  • org.springframework.beans.factory.annotation.Required (implements java.lang.annotation.Annotation)
  • org.springframework.beans.factory.annotation.Qualifier (implements java.lang.annotation.Annotation)
  • org.springframework.beans.factory.annotation.Configurable (implements java.lang.annotation.Annotation)
  • org.springframework.beans.factory.annotation.Autowired (implements java.lang.annotation.Annotation)
  • org.springframework.context.annotation.Scope (implements java.lang.annotation.Annotation)
  • org.springframework.context.annotation.Primary (implements java.lang.annotation.Annotation)
  • org.springframework.context.annotation.Lazy (implements java.lang.annotation.Annotation)
  • org.springframework.context.annotation.ImportResource (implements java.lang.annotation.Annotation)
  • org.springframework.context.annotation.Import (implements java.lang.annotation.Annotation)
  • org.springframework.context.annotation.DependsOn (implements java.lang.annotation.Annotation)
  • org.springframework.context.annotation.Configuration (implements java.lang.annotation.Annotation)
  • org.springframework.context.annotation.Bean (implements java.lang.annotation.Annotation)
  • org.springframework.core.annotation.Order (implements java.lang.annotation.Annotation)
  • org.springframework.format.annotation.NumberFormat (implements java.lang.annotation.Annotation)
  • org.springframework.format.annotation.DateTimeFormat (implements java.lang.annotation.Annotation)
  • org.springframework.jmx.export.annotation.ManagedResource (implements java.lang.annotation.Annotation)
  • org.springframework.jmx.export.annotation.ManagedOperationParameters (implements java.lang.annotation.Annotation)
  • org.springframework.jmx.export.annotation.ManagedOperationParameter (implements java.lang.annotation.Annotation)
  • org.springframework.jmx.export.annotation.ManagedOperation (implements java.lang.annotation.Annotation)
  • org.springframework.jmx.export.annotation.ManagedNotifications (implements java.lang.annotation.Annotation)
  • org.springframework.jmx.export.annotation.ManagedNotification (implements java.lang.annotation.Annotation)
  • org.springframework.jmx.export.annotation.ManagedMetric (implements java.lang.annotation.Annotation)
  • org.springframework.jmx.export.annotation.ManagedAttribute (implements java.lang.annotation.Annotation)
  • org.springframework.mock.staticmock.MockStaticEntityMethods (implements java.lang.annotation.Annotation)
  • org.springframework.scheduling.annotation.Scheduled (implements java.lang.annotation.Annotation)
  • org.springframework.scheduling.annotation.Async (implements java.lang.annotation.Annotation)
  • org.springframework.stereotype.Service (implements java.lang.annotation.Annotation)
  • org.springframework.stereotype.Repository (implements java.lang.annotation.Annotation)
  • org.springframework.stereotype.Controller (implements java.lang.annotation.Annotation)
  • org.springframework.stereotype.Component (implements java.lang.annotation.Annotation)
  • org.springframework.test.annotation.Timed (implements java.lang.annotation.Annotation)
  • org.springframework.test.annotation.Rollback (implements java.lang.annotation.Annotation)
  • org.springframework.test.annotation.Repeat (implements java.lang.annotation.Annotation)
  • org.springframework.test.annotation.ProfileValueSourceConfiguration (implements java.lang.annotation.Annotation)
  • org.springframework.test.annotation.NotTransactional (implements java.lang.annotation.Annotation)
  • org.springframework.test.annotation.IfProfileValue (implements java.lang.annotation.Annotation)
  • org.springframework.test.annotation.ExpectedException (implements java.lang.annotation.Annotation)
  • org.springframework.test.annotation.DirtiesContext (implements java.lang.annotation.Annotation)
  • org.springframework.test.context.TestExecutionListeners (implements java.lang.annotation.Annotation)
  • org.springframework.test.context.ContextConfiguration (implements java.lang.annotation.Annotation)
  • org.springframework.test.context.transaction.TransactionConfiguration (implements java.lang.annotation.Annotation)
  • org.springframework.test.context.transaction.BeforeTransaction (implements java.lang.annotation.Annotation)
  • org.springframework.test.context.transaction.AfterTransaction (implements java.lang.annotation.Annotation)
  • org.springframework.transaction.annotation.Transactional (implements java.lang.annotation.Annotation)
  • org.springframework.web.bind.annotation.SessionAttributes (implements java.lang.annotation.Annotation)
  • org.springframework.web.bind.annotation.ResponseStatus (implements java.lang.annotation.Annotation)
  • org.springframework.web.bind.annotation.ResponseBody (implements java.lang.annotation.Annotation)
  • org.springframework.web.bind.annotation.RequestParam (implements java.lang.annotation.Annotation)
  • org.springframework.web.bind.annotation.RequestMapping (implements java.lang.annotation.Annotation)
  • org.springframework.web.bind.annotation.RequestHeader (implements java.lang.annotation.Annotation)
  • org.springframework.web.bind.annotation.RequestBody (implements java.lang.annotation.Annotation)
  • org.springframework.web.bind.annotation.PathVariable (implements java.lang.annotation.Annotation)
  • org.springframework.web.bind.annotation.ModelAttribute (implements java.lang.annotation.Annotation)
  • org.springframework.web.bind.annotation.Mapping (implements java.lang.annotation.Annotation)
  • org.springframework.web.bind.annotation.InitBinder (implements java.lang.annotation.Annotation)
  • org.springframework.web.bind.annotation.ExceptionHandler (implements java.lang.annotation.Annotation)
  • org.springframework.web.bind.annotation.CookieValue (implements java.lang.annotation.Annotation)
  • org.springframework.web.portlet.bind.annotation.ResourceMapping (implements java.lang.annotation.Annotation)
  • org.springframework.web.portlet.bind.annotation.RenderMapping (implements java.lang.annotation.Annotation)
  • org.springframework.web.portlet.bind.annotation.EventMapping (implements java.lang.annotation.Annotation)
  • org.springframework.web.portlet.bind.annotation.ActionMapping (implements java.lang.annotation.Annotation)

Enum Hierarchy

  • java.lang.Object
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)
      • org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory.AspectJAnnotationType
      • org.springframework.beans.factory.annotation.Autowire
      • org.springframework.context.annotation.ScopedProxyMode
      • org.springframework.context.annotation.FilterType
      • org.springframework.expression.Operation
      • org.springframework.expression.spel.SpelMessage
      • org.springframework.expression.spel.SpelMessage.Kind
      • org.springframework.expression.spel.ast.TypeCode
      • org.springframework.expression.spel.support.ReflectionHelper.ArgsMatchKind
      • org.springframework.format.annotation.NumberFormat.Style
      • org.springframework.format.annotation.DateTimeFormat.ISO
      • org.springframework.http.HttpStatus
      • org.springframework.http.HttpStatus.Series
      • org.springframework.http.HttpMethod
      • org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType
      • org.springframework.jms.support.converter.MessageType
      • org.springframework.jmx.support.MetricType
      • org.springframework.orm.jpa.vendor.Database
      • org.springframework.test.annotation.DirtiesContext.ClassMode
      • org.springframework.transaction.annotation.Propagation
      • org.springframework.transaction.annotation.Isolation
      • org.springframework.web.bind.annotation.RequestMethod
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES


org.springframework.aop

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.aop

Core Spring AOP interfaces, built on AOP Alliance AOP interoperability interfaces.

See:
Description

Interface Summary
Advisor | Base interface holding AOP advice (action to take at a joinpoint) and a filter determining the applicability of the advice (such as a pointcut).
AfterAdvice | Common marker interface for after advice, such as AfterReturningAdvice and ThrowsAdvice.
AfterReturningAdvice | After returning advice is invoked only on normal method return, not if an exception is thrown.
BeforeAdvice | Common marker interface for before advice, such as MethodBeforeAdvice.
ClassFilter | Filter that restricts matching of a pointcut or introduction to a given set of target classes.
DynamicIntroductionAdvice | Subinterface of AOP Alliance Advice that allows additional interfaces to be implemented by an Advice, and available via a proxy using that interceptor.
IntroductionAdvisor | Superinterface for advisors that perform one or more AOP introductions.
IntroductionAwareMethodMatcher | A specialized type of MethodMatcher that takes into account introductions when matching methods.
IntroductionInfo | Interface supplying the information necessary to describe an introduction.
IntroductionInterceptor | Subinterface of AOP Alliance MethodInterceptor that allows additional interfaces to be implemented by the interceptor, and available via a proxy using that interceptor.
MethodBeforeAdvice | Advice invoked before a method is invoked.
MethodMatcher | Part of a Pointcut: Checks whether the target method is eligible for advice.
Pointcut | Core Spring pointcut abstraction.
PointcutAdvisor | Superinterface for all Advisors that are driven by a pointcut.
ProxyMethodInvocation | Extension of the AOP Alliance MethodInvocation interface, allowing access to the proxy that the method invocation was made through.
RawTargetAccess | Marker for AOP proxy interfaces (in particular: introduction interfaces) that explicitly intend to return the raw target object (which would normally get replaced with the proxy object when returned from a method invocation).
SpringProxy | Marker interface implemented by all AOP proxies.
TargetClassAware | Minimal interface for exposing the target class behind a proxy.
TargetSource | A TargetSource is used to obtain the current "target" of an AOP invocation, which will be invoked via reflection if no around advice chooses to end the interceptor chain itself.
ThrowsAdvice | Tag interface for throws advice.

Exception Summary
AopInvocationException Exception that gets thrown when an AOP invocation failed because of misconfiguration or unexpected runtime issues.

Package org.springframework.aop Description

Core Spring AOP interfaces, built on AOP Alliance AOP interoperability interfaces.
Any AOP Alliance MethodInterceptor is usable in Spring.
Spring AOP also offers:

  • Introduction support
  • A Pointcut abstraction, supporting "static" pointcuts (class and method-based) and "dynamic" pointcuts (also considering method arguments). There are currently no AOP Alliance interfaces for pointcuts.
  • A full range of advice types, including around, before, after returning and throws advice.
  • Extensibility allowing arbitrary custom advice types to be plugged in without modifying the core framework.

Spring AOP can be used programmatically or (preferably) integrated with the Spring IoC container.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES


org.springframework.aop Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.aop

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.aop.AopInvocationException

Interface Hierarchy

  • org.aopalliance.aop.Advice
    • org.springframework.aop.AfterAdvice
      • org.springframework.aop.AfterReturningAdvice
      • org.springframework.aop.ThrowsAdvice
    • org.springframework.aop.BeforeAdvice
      • org.springframework.aop.MethodBeforeAdvice
    • org.springframework.aop.DynamicIntroductionAdvice
      • org.springframework.aop.IntroductionInterceptor (also extends org.aopalliance.intercept.MethodInterceptor)
    • org.aopalliance.intercept.Interceptor
      • org.aopalliance.intercept.MethodInterceptor
        • org.springframework.aop.IntroductionInterceptor (also extends org.springframework.aop.DynamicIntroductionAdvice)
  • org.springframework.aop.Advisor
    • org.springframework.aop.IntroductionAdvisor (also extends org.springframework.aop.IntroductionInfo)
    • org.springframework.aop.PointcutAdvisor
  • org.springframework.aop.ClassFilter
  • org.springframework.aop.IntroductionInfo
    • org.springframework.aop.IntroductionAdvisor (also extends org.springframework.aop.Advisor)
  • org.aopalliance.intercept.Joinpoint
    • org.aopalliance.intercept.Invocation
      • org.aopalliance.intercept.MethodInvocation
        • org.springframework.aop.ProxyMethodInvocation
  • org.springframework.aop.MethodMatcher
    • org.springframework.aop.IntroductionAwareMethodMatcher
  • org.springframework.aop.Pointcut
  • org.springframework.aop.RawTargetAccess
  • org.springframework.aop.SpringProxy
  • org.springframework.aop.TargetClassAware
    • org.springframework.aop.TargetSource
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES


Advisor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.aop
Interface Advisor

All Known Subinterfaces:
InstantiationModelAwarePointcutAdvisor, IntroductionAdvisor, PointcutAdvisor
All Known Implementing Classes:
AbstractBeanFactoryPointcutAdvisor, AbstractGenericPointcutAdvisor, AbstractPointcutAdvisor, AspectJExpressionPointcutAdvisor, AspectJPointcutAdvisor, AsyncAnnotationAdvisor, BeanFactoryTransactionAttributeSourceAdvisor, DeclareParentsAdvisor, DefaultBeanFactoryPointcutAdvisor, DefaultIntroductionAdvisor, DefaultPointcutAdvisor, NameMatchMethodPointcutAdvisor, PersistenceExceptionTranslationAdvisor, ReflectiveAspectJAdvisorFactory.SyntheticInstantiationAdvisor, RegexpMethodPointcutAdvisor, StaticMethodMatcherPointcutAdvisor, TransactionAttributeSourceAdvisor
public interface Advisor

Base interface holding AOP advice (action to take at a joinpoint) and a filter determining the applicability of the advice (such as a pointcut). This interface is not for use by Spring users, but to allow for commonality in support for different types of advice.

Spring AOP is based around around advice delivered via method interception, compliant with the AOP Alliance interception API. The Advisor interface allows support for different types of advice, such as before and after advice, which need not be implemented using interception.

Author:
Rod Johnson

Method Summary
Advice | getAdvice() Return the advice part of this aspect.
boolean | isPerInstance() Return whether this advice is associated with a particular instance (for example, creating a mixin) or shared with all instances of the advised class obtained from the same Spring bean factory.

Method Detail

getAdvice

Advice getAdvice()
Return the advice part of this aspect. An advice may be an interceptor, a before advice, a throws advice, etc.

Returns:
the advice that should apply if the pointcut matches
See Also:
MethodInterceptor, BeforeAdvice, ThrowsAdvice, AfterReturningAdvice

isPerInstance

boolean isPerInstance()
Return whether this advice is associated with a particular instance (for example, creating a mixin) or shared with all instances of the advised class obtained from the same Spring bean factory.

Note that this method is not currently used by the framework. Typical Advisor implementations always return true. Use singleton/prototype bean definitions or appropriate programmatic proxy creation to ensure that Advisors have the correct lifecycle model.

Returns:
whether this advice is associated with a particular target instance
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AfterAdvice

PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

org.springframework.aop
Interface AfterAdvice

All Superinterfaces:
Advice
All Known Subinterfaces:
AfterReturningAdvice, ThrowsAdvice
All Known Implementing Classes:
AfterReturningAdviceInterceptor, AspectJAfterAdvice, AspectJAfterReturningAdvice, AspectJAfterThrowingAdvice, ThrowsAdviceInterceptor
public interface AfterAdvice
extends Advice

Common marker interface for after advice, such as AfterReturningAdvice and ThrowsAdvice.

Since:
2.0.3
Author:
Juergen Hoeller
See Also:
BeforeAdvice

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AfterReturningAdvice

org.springframework.aop
Interface AfterReturningAdvice

All Superinterfaces:
Advice, AfterAdvice
All Known Implementing Classes:
AspectJAfterReturningAdvice
public interface AfterReturningAdvice
extends AfterAdvice

After returning advice is invoked only on normal method return, not if an exception is thrown. Such advice can see the return value, but cannot change it.

Author:
Rod Johnson
See Also:
MethodBeforeAdvice, ThrowsAdvice

Method Summary
 void afterReturning(Object returnValue, Method method, Object[] args, Object target)
Callback after a given method successfully returned.

Method Detail

afterReturning

void afterReturning(Object returnValue,
                    Method method,
                    Object[] args,
                    Object target)
                    throws Throwable
Callback after a given method successfully returned.

Parameters:
returnValue - the value returned by the method, if any
method - method being invoked
args - arguments to the method
target - target of the method invocation. May be null.
Throws:
Throwable - if this object wishes to abort the call. Any exception thrown will be returned to the caller if it's allowed by the method signature. Otherwise the exception will be wrapped as a runtime exception.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeforeAdvice

org.springframework.aop
Interface BeforeAdvice

All Superinterfaces:
Advice
All Known Subinterfaces:
MethodBeforeAdvice
All Known Implementing Classes:
AspectJMethodBeforeAdvice
public interface BeforeAdvice
extends Advice

Common marker interface for before advice, such as MethodBeforeAdvice.

Spring supports only method before advice. Although this is unlikely to change, this API is designed to allow field advice in future if desired.

Author:
Rod Johnson
See Also:
AfterAdvice

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ClassFilter

org.springframework.aop
Interface ClassFilter

All Known Implementing Classes:
AnnotationClassFilter, AspectJExpressionPointcut, ControlFlowPointcut, DefaultIntroductionAdvisor, RootClassFilter, TypePatternClassFilter
public interface ClassFilter

Filter that restricts matching of a pointcut or introduction to a given set of target classes.

Can be used as part of a Pointcut or for the entire targeting of an IntroductionAdvisor.

Author:
Rod Johnson
See Also:
Pointcut, MethodMatcher

Field Summary
static ClassFilter TRUE
Canonical instance of a ClassFilter that matches all classes.
Method Summary
 boolean matches(Class<?> clazz)
Should the pointcut apply to the given interface or target class?

Field Detail

TRUE

static final ClassFilter TRUE
Canonical instance of a ClassFilter that matches all classes.

Method Detail

matches

boolean matches(Class<?> clazz)
Should the pointcut apply to the given interface or target class?

Parameters:
clazz - the candidate target class
Returns:
whether the advice should apply to the given target class
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DynamicIntroductionAdvice

org.springframework.aop
Interface DynamicIntroductionAdvice

All Superinterfaces:
Advice
All Known Subinterfaces:
IntroductionInterceptor
All Known Implementing Classes:
DelegatePerTargetObjectIntroductionInterceptor, DelegatingIntroductionInterceptor
public interface DynamicIntroductionAdvice
extends Advice

Subinterface of AOP Alliance Advice that allows additional interfaces to be implemented by an Advice, and available via a proxy using that interceptor. This is a fundamental AOP concept called introduction.

Introductions are often mixins, enabling the building of composite objects that can achieve many of the goals of multiple inheritance in Java.

Compared to {qlink IntroductionInfo}, this interface allows an advice to implement a range of interfaces that is not necessarily known in advance. Thus an IntroductionAdvisor can be used to specify which interfaces will be exposed in an advised object.

Since:
1.1.1
Author:
Rod Johnson
See Also:
IntroductionInfo, IntroductionAdvisor

Method Summary
 boolean implementsInterface(Class<?> intf)
Does this introduction advice implement the given interface?

Method Detail

implementsInterface

boolean implementsInterface(Class<?> intf)
Does this introduction advice implement the given interface?

Parameters:
intf - the interface to check
Returns:
whether the advice implements the specified interface
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


IntroductionAdvisor

org.springframework.aop
Interface IntroductionAdvisor

All Superinterfaces:
Advisor, IntroductionInfo
All Known Implementing Classes:
DeclareParentsAdvisor, DefaultIntroductionAdvisor
public interface IntroductionAdvisor
extends Advisor, IntroductionInfo

Superinterface for advisors that perform one or more AOP introductions.

This interface cannot be implemented directly; subinterfaces must provide the advice type implementing the introduction.

Introduction is the implementation of additional interfaces (not implemented by a target) via AOP advice.

Since:
04.04.2003
Author:
Rod Johnson
See Also:
IntroductionInterceptor

Method Summary
ClassFilter | getClassFilter() Return the filter determining which target classes this introduction should apply to.
void | validateInterfaces() Can the advised interfaces be implemented by the introduction advice? Invoked before adding an IntroductionAdvisor.
Methods inherited from interface org.springframework.aop.Advisor
getAdvice, isPerInstance
Methods inherited from interface org.springframework.aop.IntroductionInfo
getInterfaces

Method Detail

getClassFilter

ClassFilter getClassFilter()
Return the filter determining which target classes this introduction should apply to.

This represents the class part of a pointcut. Note that method matching doesn't make sense to introductions.

Returns:
the class filter

validateInterfaces

void validateInterfaces()
                        throws IllegalArgumentException
Can the advised interfaces be implemented by the introduction advice? Invoked before adding an IntroductionAdvisor.

Throws:
IllegalArgumentException - if the advised interfaces can't be implemented by the introduction advice
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


IntroductionAwareMethodMatcher

org.springframework.aop
Interface IntroductionAwareMethodMatcher

All Superinterfaces:
MethodMatcher
All Known Implementing Classes:
AspectJExpressionPointcut
public interface IntroductionAwareMethodMatcher
extends MethodMatcher

A specialized type of MethodMatcher that takes into account introductions when matching methods. If there are no introductions on the target class, a method matcher may be able to optimize matching more effectively for example.

Since:
2.0
Author:
Adrian Colyer

Field Summary
Fields inherited from interface org.springframework.aop.MethodMatcher
TRUE
Method Summary
 boolean matches(Method method, Class targetClass, boolean hasIntroductions)
Perform static checking whether the given method matches.
Methods inherited from interface org.springframework.aop.MethodMatcher
isRuntime, matches, matches

Method Detail

matches

boolean matches(Method method,
                Class targetClass,
                boolean hasIntroductions)
Perform static checking whether the given method matches. This may be invoked instead of the 2-arg MethodMatcher.matches(java.lang.reflect.Method, Class) method if the caller supports the extended IntroductionAwareMethodMatcher interface.

Parameters:
method - the candidate method
targetClass - the target class (may be null, in which case the candidate class must be taken to be the method's declaring class)
hasIntroductions - true if the object on whose behalf we are asking is the subject on one or more introductions; false otherwise
Returns:
whether or not this method matches statically
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


IntroductionInfo

org.springframework.aop
Interface IntroductionInfo

All Known Subinterfaces:
IntroductionAdvisor
All Known Implementing Classes:
DeclareParentsAdvisor, DefaultIntroductionAdvisor, DelegatePerTargetObjectIntroductionInterceptor, DelegatingIntroductionInterceptor, IntroductionInfoSupport
public interface IntroductionInfo

Interface supplying the information necessary to describe an introduction.

IntroductionAdvisors must implement this interface. If an Advice implements this, it may be used as an introduction without an IntroductionAdvisor. In this case, the advice is self-describing, providing not only the necessary behavior, but describing the interfaces it introduces.

Since:
1.1.1
Author:
Rod Johnson

Method Summary
 Class[] getInterfaces()
Return the additional interfaces introduced by this Advisor or Advice.

Method Detail

getInterfaces

Class[] getInterfaces()
Return the additional interfaces introduced by this Advisor or Advice.

Returns:
the introduced interfaces
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


IntroductionInterceptor

org.springframework.aop
Interface IntroductionInterceptor

All Superinterfaces:
Advice, DynamicIntroductionAdvice, Interceptor, MethodInterceptor
All Known Implementing Classes:
DelegatePerTargetObjectIntroductionInterceptor, DelegatingIntroductionInterceptor
public interface IntroductionInterceptor
extends MethodInterceptor, DynamicIntroductionAdvice

Subinterface of AOP Alliance MethodInterceptor that allows additional interfaces to be implemented by the interceptor, and available via a proxy using that interceptor. This is a fundamental AOP concept called introduction.

Introductions are often mixins, enabling the building of composite objects that can achieve many of the goals of multiple inheritance in Java.

Author:
Rod Johnson
See Also:
DynamicIntroductionAdvice

Method Summary
Methods inherited from interface org.aopalliance.intercept.MethodInterceptor
invoke
Methods inherited from interface org.springframework.aop.DynamicIntroductionAdvice
implementsInterface

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MethodBeforeAdvice

org.springframework.aop
Interface MethodBeforeAdvice

All Superinterfaces:
Advice, BeforeAdvice
All Known Implementing Classes:
AspectJMethodBeforeAdvice
public interface MethodBeforeAdvice
extends BeforeAdvice

Advice invoked before a method is invoked. Such advices cannot prevent the method call proceeding, unless they throw a Throwable.

Author:
Rod Johnson
See Also:
AfterReturningAdvice, ThrowsAdvice

Method Summary
 void before(Method method, Object[] args, Object target)
Callback before a given method is invoked.

Method Detail

before

void before(Method method,
            Object[] args,
            Object target)
            throws Throwable
Callback before a given method is invoked.

Parameters:
method - method being invoked
args - arguments to the method
target - target of the method invocation. May be null.
Throws:
Throwable - if this object wishes to abort the call. Any exception thrown will be returned to the caller if it's allowed by the method signature. Otherwise the exception will be wrapped as a runtime exception.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MethodMatcher

org.springframework.aop
Interface MethodMatcher

All Known Subinterfaces:
IntroductionAwareMethodMatcher
All Known Implementing Classes:
AbstractRegexpMethodPointcut, AnnotationMethodMatcher, AspectJExpressionPointcut, ControlFlowPointcut, DynamicMethodMatcher, DynamicMethodMatcherPointcut, JdkRegexpMethodPointcut, NameMatchMethodPointcut, StaticMethodMatcher, StaticMethodMatcherPointcut, StaticMethodMatcherPointcutAdvisor
public interface MethodMatcher

Part of a Pointcut: Checks whether the target method is eligible for advice.

A MethodMatcher may be evaluated statically or at runtime (dynamically). Static matching involves method and (possibly) method attributes. Dynamic matching also makes arguments for a particular call available, and any effects of running previous advice applying to the joinpoint.

If an implementation returns false from its isRuntime() method, evaluation can be performed statically, and the result will be the same for all invocations of this method, whatever their arguments. This means that if the isRuntime() method returns false, the 3-arg matches(java.lang.reflect.Method, Class, Object[]) method will never be invoked.

If an implementation returns true from its 2-arg matches(java.lang.reflect.Method, Class) method and its isRuntime() method returns true, the 3-arg matches(java.lang.reflect.Method, Class, Object[]) method will be invoked immediately before each potential execution of the related advice, to decide whether the advice should run. All previous advice, such as earlier interceptors in an interceptor chain, will have run, so any state changes they have produced in parameters or ThreadLocal state will be available at the time of evaluation.

Since:
11.11.2003
Author:
Rod Johnson
See Also:
Pointcut, ClassFilter

Field Summary
static MethodMatcher TRUE
Canonical instance that matches all methods.
Method Summary
 boolean isRuntime()
Is this MethodMatcher dynamic, that is, must a final call be made on the matches(java.lang.reflect.Method, Class, Object[]) method at runtime even if the 2-arg matches method returns true?
 boolean matches(Method method, Class<?> targetClass)
Perform static checking whether the given method matches.
 boolean matches(Method method, Class<?> targetClass, Object[] args)
Check whether there a runtime (dynamic) match for this method, which must have matched statically.

Field Detail

TRUE

static final MethodMatcher TRUE
Canonical instance that matches all methods.

Method Detail

matches

boolean matches(Method method,
                Class<?> targetClass)
Perform static checking whether the given method matches. If this returns false or if the isRuntime() method returns false, no runtime check (i.e. no. matches(java.lang.reflect.Method, Class, Object[]) call) will be made.

Parameters:
method - the candidate method
targetClass - the target class (may be null, in which case the candidate class must be taken to be the method's declaring class)
Returns:
whether or not this method matches statically

isRuntime

boolean isRuntime()
Is this MethodMatcher dynamic, that is, must a final call be made on the matches(java.lang.reflect.Method, Class, Object[]) method at runtime even if the 2-arg matches method returns true?

Can be invoked when an AOP proxy is created, and need not be invoked again before each method invocation,

Returns:
whether or not a runtime match via the 3-arg matches(java.lang.reflect.Method, Class, Object[]) method is required if static matching passed

matches

boolean matches(Method method,
                Class<?> targetClass,
                Object[] args)
Check whether there a runtime (dynamic) match for this method, which must have matched statically.

This method is invoked only if the 2-arg matches method returns true for the given method and target class, and if the isRuntime() method returns true. Invoked immediately before potential running of the advice, after any advice earlier in the advice chain has run.

Parameters:
method - the candidate method
targetClass - the target class (may be null, in which case the candidate class must be taken to be the method's declaring class)
args - arguments to the method
Returns:
whether there's a runtime match
See Also:
matches(Method, Class)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Pointcut

org.springframework.aop
Interface Pointcut

All Known Subinterfaces:
ExpressionPointcut
All Known Implementing Classes:
AbstractExpressionPointcut, AbstractRegexpMethodPointcut, AnnotationMatchingPointcut, AspectJExpressionPointcut, ComposablePointcut, ControlFlowPointcut, DynamicMethodMatcherPointcut, JdkRegexpMethodPointcut, NameMatchMethodPointcut, StaticMethodMatcherPointcut, StaticMethodMatcherPointcutAdvisor
public interface Pointcut

Core Spring pointcut abstraction.

A pointcut is composed of a ClassFilter and a MethodMatcher. Both these basic terms and a Pointcut itself can be combined to build up combinations (e.g. through ComposablePointcut).

Author:
Rod Johnson
See Also:
ClassFilter, MethodMatcher, Pointcuts, ClassFilters, MethodMatchers

Field Summary
static Pointcut TRUE
Canonical Pointcut instance that always matches.
Method Summary
ClassFilter | getClassFilter() Return the ClassFilter for this pointcut.
MethodMatcher | getMethodMatcher() Return the MethodMatcher for this pointcut.

Field Detail

TRUE

static final Pointcut TRUE
Canonical Pointcut instance that always matches.

Method Detail

getClassFilter

ClassFilter getClassFilter()
Return the ClassFilter for this pointcut.

Returns:
the ClassFilter (never null)

getMethodMatcher

MethodMatcher getMethodMatcher()
Return the MethodMatcher for this pointcut.

Returns:
the MethodMatcher (never null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PointcutAdvisor

org.springframework.aop
Interface PointcutAdvisor

All Superinterfaces:
Advisor
All Known Subinterfaces:
InstantiationModelAwarePointcutAdvisor
All Known Implementing Classes:
AbstractBeanFactoryPointcutAdvisor, AbstractGenericPointcutAdvisor, AbstractPointcutAdvisor, AspectJExpressionPointcutAdvisor, AspectJPointcutAdvisor, AsyncAnnotationAdvisor, BeanFactoryTransactionAttributeSourceAdvisor, DefaultBeanFactoryPointcutAdvisor, DefaultPointcutAdvisor, NameMatchMethodPointcutAdvisor, PersistenceExceptionTranslationAdvisor, ReflectiveAspectJAdvisorFactory.SyntheticInstantiationAdvisor, RegexpMethodPointcutAdvisor, StaticMethodMatcherPointcutAdvisor, TransactionAttributeSourceAdvisor
public interface PointcutAdvisor
extends Advisor

Superinterface for all Advisors that are driven by a pointcut. This covers nearly all advisors except introduction advisors, for which method-level matching doesn't apply.

Author:
Rod Johnson

Method Summary
 Pointcut getPointcut()
Get the Pointcut that drives this advisor.
Methods inherited from interface org.springframework.aop.Advisor
getAdvice, isPerInstance

Method Detail

getPointcut

Pointcut getPointcut()
Get the Pointcut that drives this advisor.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ProxyMethodInvocation

org.springframework.aop
Interface ProxyMethodInvocation

All Superinterfaces:
Invocation, Joinpoint, MethodInvocation
All Known Implementing Classes:
ReflectiveMethodInvocation
public interface ProxyMethodInvocation
extends MethodInvocation

Extension of the AOP Alliance MethodInvocation interface, allowing access to the proxy that the method invocation was made through.

Useful to be able to substitute return values with the proxy, if necessary, for example if the invocation target returned itself.

Since:
1.1.3
Author:
Juergen Hoeller, Adrian Colyer
See Also:
ReflectiveMethodInvocation, DelegatingIntroductionInterceptor

Method Summary
Object | getProxy() Return the proxy that this method invocation was made through.
Object | getUserAttribute(String key) Return the value of the specified user attribute.
MethodInvocation | invocableClone() Create a clone of this object.
MethodInvocation | invocableClone(Object[] arguments) Create a clone of this object.
void | setArguments(Object[] arguments) Set the arguments to be used on subsequent invocations in the any advice in this chain.
void | setUserAttribute(String key, Object value) Add the specified user attribute with the given value to this invocation.
Methods inherited from interface org.aopalliance.intercept.MethodInvocation
getMethod
Methods inherited from interface org.aopalliance.intercept.Invocation
getArguments
Methods inherited from interface org.aopalliance.intercept.Joinpoint
getStaticPart, getThis, proceed

Method Detail

getProxy

Object getProxy()
Return the proxy that this method invocation was made through.

Returns:
the original proxy object

invocableClone

MethodInvocation invocableClone()
Create a clone of this object. If cloning is done before proceed() is invoked on this object, proceed() can be invoked once per clone to invoke the joinpoint (and the rest of the advice chain) more than once.

Returns:
an invocable clone of this invocation. proceed() can be called once per clone.

invocableClone

MethodInvocation invocableClone(Object[] arguments)
Create a clone of this object. If cloning is done before proceed() is invoked on this object, proceed() can be invoked once per clone to invoke the joinpoint (and the rest of the advice chain) more than once.

Parameters:
arguments - the arguments that the cloned invocation is supposed to use, overriding the original arguments
Returns:
an invocable clone of this invocation. proceed() can be called once per clone.

setArguments

void setArguments(Object[] arguments)
Set the arguments to be used on subsequent invocations in the any advice in this chain.

Parameters:
arguments - the argument array

setUserAttribute

void setUserAttribute(String key,
                      Object value)
Add the specified user attribute with the given value to this invocation.

Such attributes are not used within the AOP framework itself. They are just kept as part of the invocation object, for use in special interceptors.

Parameters:
key - the name of the attribute
value - the value of the attribute, or null to reset it

getUserAttribute

Object getUserAttribute(String key)
Return the value of the specified user attribute.

Parameters:
key - the name of the attribute
Returns:
the value of the attribute, or null if not set
See Also:
setUserAttribute(java.lang.String, java.lang.Object)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RawTargetAccess

org.springframework.aop
Interface RawTargetAccess

All Known Subinterfaces:
ScopedObject
All Known Implementing Classes:
DefaultScopedObject
public interface RawTargetAccess

Marker for AOP proxy interfaces (in particular: introduction interfaces) that explicitly intend to return the raw target object (which would normally get replaced with the proxy object when returned from a method invocation).

Note that this is a marker interface in the style of Serializable, semantically applying to a declared interface rather than to the full class of a concrete object. In other words, this marker applies to a particular interface only (typically an introduction interface that does not serve as the primary interface of an AOP proxy), and hence does not affect other interfaces that a concrete AOP proxy may implement.

Since:
2.0.5
Author:
Juergen Hoeller
See Also:
ScopedObject

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SpringProxy

org.springframework.aop
Interface SpringProxy

public interface SpringProxy

Marker interface implemented by all AOP proxies. Used to detect whether or not objects are Spring-generated proxies.

Since:
2.0.1
Author:
Rob Harrop
See Also:
AopUtils.isAopProxy(Object)

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TargetClassAware

org.springframework.aop
Interface TargetClassAware

All Known Subinterfaces:
Advised, TargetSource
All Known Implementing Classes:
AbstractBeanFactoryBasedTargetSource, AbstractLazyCreationTargetSource, AbstractPoolingTargetSource, AbstractPrototypeBasedTargetSource, AbstractRefreshableTargetSource, AdvisedSupport, AspectJProxyFactory, BeanFactoryRefreshableTargetSource, CommonsPoolTargetSource, EmptyTargetSource, HotSwappableTargetSource, JndiObjectTargetSource, LazyInitTargetSource, PrototypeTargetSource, ProxyCreatorSupport, ProxyFactory, ProxyFactoryBean, RefreshableScriptTargetSource, SimpleBeanTargetSource, SingletonTargetSource, ThreadLocalTargetSource
public interface TargetClassAware

Minimal interface for exposing the target class behind a proxy.

Implemented by AOP proxy objects and proxy factories (via Advised} as well as by TargetSources.

Since:
2.0.3
Author:
Juergen Hoeller
See Also:
AopUtils.getTargetClass(Object)

Method Summary
 Class getTargetClass()
Return the target class behind the implementing object (typically a proxy configuration or an actual proxy).

Method Detail

getTargetClass

Class getTargetClass()
Return the target class behind the implementing object (typically a proxy configuration or an actual proxy).

Returns:
the target Class, or null if not known
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TargetSource

org.springframework.aop
Interface TargetSource

All Superinterfaces:
TargetClassAware
All Known Implementing Classes:
AbstractBeanFactoryBasedTargetSource, AbstractLazyCreationTargetSource, AbstractPoolingTargetSource, AbstractPrototypeBasedTargetSource, AbstractRefreshableTargetSource, BeanFactoryRefreshableTargetSource, CommonsPoolTargetSource, EmptyTargetSource, HotSwappableTargetSource, JndiObjectTargetSource, LazyInitTargetSource, PrototypeTargetSource, RefreshableScriptTargetSource, SimpleBeanTargetSource, SingletonTargetSource, ThreadLocalTargetSource
public interface TargetSource
extends TargetClassAware

A TargetSource is used to obtain the current "target" of an AOP invocation, which will be invoked via reflection if no around advice chooses to end the interceptor chain itself.

If a TargetSource is "static", it will always return the same target, allowing optimizations in the AOP framework. Dynamic target sources can support pooling, hot swapping, etc.

Application developers don't usually need to work with TargetSources directly: this is an AOP framework interface.

Author:
Rod Johnson

Method Summary
 Object getTarget()
Return a target instance.
 Class getTargetClass()
Return the type of targets returned by this TargetSource.
 boolean isStatic()
Will all calls to getTarget() return the same object?
 void releaseTarget(Object target)
Release the given target object obtained from the getTarget() method.

Method Detail

getTargetClass

Class getTargetClass()
Return the type of targets returned by this TargetSource.

Can return null, although certain usages of a TargetSource might just work with a predetermined target class.

Specified by:
getTargetClass in interface TargetClassAware
Returns:
the type of targets returned by this TargetSource

isStatic

boolean isStatic()
Will all calls to getTarget() return the same object?

In that case, there will be no need to invoke releaseTarget(Object), and the AOP framework can cache the return value of getTarget().

Returns:
true if the target is immutable
See Also:
getTarget()

getTarget

Object getTarget()
                 throws Exception
Return a target instance. Invoked immediately before the AOP framework calls the "target" of an AOP method invocation.

Returns:
the target object, which contains the joinpoint
Throws:
Exception - if the target object can't be resolved

releaseTarget

void releaseTarget(Object target)
                   throws Exception
Release the given target object obtained from the getTarget() method.

Parameters:
target - object obtained from a call to getTarget()
Throws:
Exception - if the object can't be released
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ThrowsAdvice

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.aop
Interface ThrowsAdvice

All Superinterfaces:
Advice, AfterAdvice
public interface ThrowsAdvice
extends AfterAdvice

Tag interface for throws advice.

There are not any methods on this interface, as methods are invoked by reflection. Implementing classes must implement methods of the form:

void afterThrowing([Method, args, target], ThrowableSubclass);

Some examples of valid methods would be:

public void afterThrowing(Exception ex)
public void afterThrowing(RemoteException)
public void afterThrowing(Method method, Object[] args, Object target, Exception ex)
public void afterThrowing(Method method, Object[] args, Object target, ServletException ex)
The first three arguments are optional, and only useful if we want further information about the joinpoint, as in AspectJ after-throwing advice.

Note: If a throws-advice method throws an exception itself, it will override the original exception (i.e. change the exception thrown to the user). The overriding exception will typically be a RuntimeException; this is compatible with any method signature. However, if a throws-advice method throws a checked exception, it will have to match the declared exceptions of the target method and is hence to some degree coupled to specific target method signatures. Do not throw an undeclared checked exception that is incompatible with the target method's signature!

Author:
Rod Johnson, Juergen Hoeller
See Also:
AfterReturningAdvice, MethodBeforeAdvice

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AopInvocationException

org.springframework.aop
Class AopInvocationException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.aop.AopInvocationException
All Implemented Interfaces:
Serializable
public class AopInvocationException
extends NestedRuntimeException

Exception that gets thrown when an AOP invocation failed because of misconfiguration or unexpected runtime issues.

Since:
2.0
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
AopInvocationException(String msg)
Constructor for AopInvocationException.
AopInvocationException(String msg, Throwable cause)
Constructor for AopInvocationException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AopInvocationException

public AopInvocationException(String msg)
Constructor for AopInvocationException.

Parameters:
msg - the detail message

AopInvocationException

public AopInvocationException(String msg,
                              Throwable cause)
Constructor for AopInvocationException.

Parameters:
msg - the detail message
cause - the root cause
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.aop.aspectj

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.aop.aspectj

AspectJ integration package.

See:
Description

Interface Summary
AspectInstanceFactory | Interface implemented to provide an instance of an AspectJ aspect.
AspectJPrecedenceInformation | Interface to be implemented by types that can supply the information needed to sort advice/advisors by AspectJ's precedence rules.
InstantiationModelAwarePointcutAdvisor | Interface to be implemented by Spring AOP Advisors wrapping AspectJ aspects that may have a lazy initialization strategy.

Class Summary
AbstractAspectJAdvice | Base class for AOP Alliance Advice classes wrapping an AspectJ aspect or an AspectJ-annotated advice method.
AspectJAdviceParameterNameDiscoverer | ParameterNameDiscoverer implementation that tries to deduce parameter names for an advice method from the pointcut expression, returning, and throwing clauses.
AspectJAfterAdvice | Spring AOP advice wrapping an AspectJ after advice method.
AspectJAfterReturningAdvice | Spring AOP advice wrapping an AspectJ after-returning advice method.
AspectJAfterThrowingAdvice | Spring AOP advice wrapping an AspectJ after-throwing advice method.
AspectJAopUtils | Utility methods for dealing with AspectJ advisors.
AspectJAroundAdvice | Spring AOP around advice (MethodInterceptor) that wraps an AspectJ advice method.
AspectJExpressionPointcut | Spring Pointcut implementation that uses the AspectJ weaver to evaluate a pointcut expression.
AspectJExpressionPointcutAdvisor | Spring AOP Advisor that can be used for any AspectJ pointcut expression.
AspectJMethodBeforeAdvice | Spring AOP advice that wraps an AspectJ before method.
AspectJPointcutAdvisor | AspectJPointcutAdvisor that adapts an AbstractAspectJAdvice to the PointcutAdvisor interface.
AspectJProxyUtils | Utility methods for working with AspectJ proxies.
AspectJWeaverMessageHandler | Implementation of AspectJ's IMessageHandler interface that routes AspectJ weaving messages through the same logging system as the regular Spring messages.
DeclareParentsAdvisor | Introduction advisor delegating to the given object.
MethodInvocationProceedingJoinPoint | Implementation of AspectJ ProceedingJoinPoint interface wrapping an AOP Alliance MethodInvocation.
SimpleAspectInstanceFactory | Implementation of AspectInstanceFactory that creates a new instance of the specified aspect class for every SimpleAspectInstanceFactory.getAspectInstance() call.
SingletonAspectInstanceFactory | Implementation of AspectInstanceFactory that is backed by a specified singleton object, returning the same instance for every SingletonAspectInstanceFactory.getAspectInstance() call.
TypePatternClassFilter | Spring AOP ClassFilter implementation using AspectJ type matching.

Exception Summary
AspectJAdviceParameterNameDiscoverer.AmbiguousBindingException Thrown in response to an ambiguous binding being detected when trying to resolve a method's parameter names.

Package org.springframework.aop.aspectj Description

AspectJ integration package. Includes Spring AOP advice implementations for AspectJ 5 annotation-style methods, and an AspectJExpressionPointcut: a Spring AOP Pointcut implementation that allows use of the AspectJ pointcut expression language with the Spring AOP runtime framework.

Note that use of this package does not require the use of the ajc compiler or AspectJ load-time weaver. It is intended to enable the use of a valuable subset of AspectJ functionality, with consistent semantics, with the proxy-based Spring AOP framework.

Overview Package Class Tree Deprecated Index Help


org.springframework.aop.aspectj Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.aop.aspectj

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.aop.aspectj.AbstractAspectJAdvice (implements org.aopalliance.aop.Advice, org.springframework.aop.aspectj.AspectJPrecedenceInformation)
      • org.springframework.aop.aspectj.AspectJAfterAdvice (implements org.springframework.aop.AfterAdvice, org.aopalliance.intercept.MethodInterceptor)
      • org.springframework.aop.aspectj.AspectJAfterReturningAdvice (implements org.springframework.aop.AfterAdvice, org.springframework.aop.AfterReturningAdvice)
      • org.springframework.aop.aspectj.AspectJAfterThrowingAdvice (implements org.springframework.aop.AfterAdvice, org.aopalliance.intercept.MethodInterceptor)
      • org.springframework.aop.aspectj.AspectJAroundAdvice (implements org.aopalliance.intercept.MethodInterceptor)
      • org.springframework.aop.aspectj.AspectJMethodBeforeAdvice (implements org.springframework.aop.MethodBeforeAdvice)
    • org.springframework.aop.support.AbstractExpressionPointcut (implements org.springframework.aop.support.ExpressionPointcut, java.io.Serializable)
      • org.springframework.aop.aspectj.AspectJExpressionPointcut (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.aop.ClassFilter, org.springframework.aop.IntroductionAwareMethodMatcher)
    • org.springframework.aop.support.AbstractPointcutAdvisor (implements org.springframework.core.Ordered, org.springframework.aop.PointcutAdvisor, java.io.Serializable)
      • org.springframework.aop.support.AbstractGenericPointcutAdvisor
        • org.springframework.aop.aspectj.AspectJExpressionPointcutAdvisor
    • org.springframework.aop.aspectj.AspectJAdviceParameterNameDiscoverer (implements org.springframework.core.ParameterNameDiscoverer)
    • org.springframework.aop.aspectj.AspectJAopUtils
    • org.springframework.aop.aspectj.AspectJPointcutAdvisor (implements org.springframework.core.Ordered, org.springframework.aop.PointcutAdvisor)
    • org.springframework.aop.aspectj.AspectJProxyUtils
    • org.springframework.aop.aspectj.AspectJWeaverMessageHandler (implements org.aspectj.bridge.IMessageHandler)
    • org.springframework.aop.aspectj.DeclareParentsAdvisor (implements org.springframework.aop.IntroductionAdvisor)
    • org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint (implements org.aspectj.lang.JoinPoint.StaticPart, org.aspectj.lang.ProceedingJoinPoint)
    • org.springframework.aop.aspectj.SimpleAspectInstanceFactory (implements org.springframework.aop.aspectj.AspectInstanceFactory)
    • org.springframework.aop.aspectj.SingletonAspectInstanceFactory (implements org.springframework.aop.aspectj.AspectInstanceFactory)
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.aop.aspectj.AspectJAdviceParameterNameDiscoverer.AmbiguousBindingException
    • org.springframework.aop.aspectj.TypePatternClassFilter (implements org.springframework.aop.ClassFilter)

Interface Hierarchy

  • org.springframework.aop.Advisor
    • org.springframework.aop.PointcutAdvisor
      • org.springframework.aop.aspectj.InstantiationModelAwarePointcutAdvisor
  • org.springframework.core.Ordered
    • org.springframework.aop.aspectj.AspectInstanceFactory
    • org.springframework.aop.aspectj.AspectJPrecedenceInformation


AspectInstanceFactory

org.springframework.aop.aspectj
Interface AspectInstanceFactory

All Superinterfaces:
Ordered
All Known Subinterfaces:
MetadataAwareAspectInstanceFactory
All Known Implementing Classes:
BeanFactoryAspectInstanceFactory, LazySingletonAspectInstanceFactoryDecorator, PrototypeAspectInstanceFactory, SimpleAspectInstanceFactory, SimpleBeanFactoryAwareAspectInstanceFactory, SimpleMetadataAwareAspectInstanceFactory, SingletonAspectInstanceFactory, SingletonMetadataAwareAspectInstanceFactory
public interface AspectInstanceFactory
extends Ordered

Interface implemented to provide an instance of an AspectJ aspect. Decouples from Spring's bean factory.

Extends the Ordered interface to express an order value for the underlying aspect in a chain.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller
See Also:
BeanFactory.getBean(java.lang.String)

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Method Summary
ClassLoader | getAspectClassLoader() Expose the aspect class loader that this factory uses.
Object | getAspectInstance() Create an instance of this factory's aspect.
Methods inherited from interface org.springframework.core.Ordered
getOrder

Method Detail

getAspectInstance

Object getAspectInstance()
Create an instance of this factory's aspect.

Returns:
the aspect instance (never null)

getAspectClassLoader

ClassLoader getAspectClassLoader()
Expose the aspect class loader that this factory uses.

Returns:
the aspect class loader (never null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AspectJPrecedenceInformation

org.springframework.aop.aspectj
Interface AspectJPrecedenceInformation

All Superinterfaces:
Ordered
All Known Implementing Classes:
AbstractAspectJAdvice, AspectJAfterAdvice, AspectJAfterReturningAdvice, AspectJAfterThrowingAdvice, AspectJAroundAdvice, AspectJMethodBeforeAdvice
public interface AspectJPrecedenceInformation
extends Ordered

Interface to be implemented by types that can supply the information needed to sort advice/advisors by AspectJ's precedence rules.

Since:
2.0
Author:
Adrian Colyer
See Also:
AspectJPrecedenceComparator

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Method Summary
String | getAspectName() The name of the aspect (bean) in which the advice was declared.
int | getDeclarationOrder() The declaration order of the advice member within the aspect.
boolean | isAfterAdvice() Return whether this is an after advice.
boolean | isBeforeAdvice() Return whether this is a before advice.
Methods inherited from interface org.springframework.core.Ordered
getOrder

Method Detail

getAspectName

String getAspectName()
The name of the aspect (bean) in which the advice was declared.

getDeclarationOrder

int getDeclarationOrder()
The declaration order of the advice member within the aspect.

isBeforeAdvice

boolean isBeforeAdvice()
Return whether this is a before advice.

isAfterAdvice

boolean isAfterAdvice()
Return whether this is an after advice.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InstantiationModelAwarePointcutAdvisor

org.springframework.aop.aspectj
Interface InstantiationModelAwarePointcutAdvisor

All Superinterfaces:
Advisor, PointcutAdvisor
public interface InstantiationModelAwarePointcutAdvisor
extends PointcutAdvisor

Interface to be implemented by Spring AOP Advisors wrapping AspectJ aspects that may have a lazy initialization strategy. For example, a perThis instantiation model would mean lazy initialization of the advice.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller

Method Summary
boolean | isAdviceInstantiated() Return whether this advisor has already instantiated its advice.
boolean | isLazy() Return whether this advisor is lazily initializing its underlying advice.
Methods inherited from interface org.springframework.aop.PointcutAdvisor
getPointcut
Methods inherited from interface org.springframework.aop.Advisor
getAdvice, isPerInstance

Method Detail

isLazy

boolean isLazy()
Return whether this advisor is lazily initializing its underlying advice.

isAdviceInstantiated

boolean isAdviceInstantiated()
Return whether this advisor has already instantiated its advice.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractAspectJAdvice

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.aop.aspectj
Class AbstractAspectJAdvice

java.lang.Object
    extended by  org.springframework.aop.aspectj.AbstractAspectJAdvice
All Implemented Interfaces:
Advice, AspectJPrecedenceInformation, Ordered
Direct Known Subclasses:
AspectJAfterAdvice, AspectJAfterReturningAdvice, AspectJAfterThrowingAdvice, AspectJAroundAdvice, AspectJMethodBeforeAdvice
public abstract class AbstractAspectJAdvice
extends Object
implements Advice, AspectJPrecedenceInformation

Base class for AOP Alliance Advice classes wrapping an AspectJ aspect or an AspectJ-annotated advice method.

Since:
2.0
Author:
Rod Johnson, Adrian Colyer, Juergen Hoeller, Ramnivas Laddad

Field Summary
protected Method | aspectJAdviceMethod
protected static String | JOIN_POINT_KEY Key used in ReflectiveMethodInvocation userAtributes map for the current joinpoint.
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AbstractAspectJAdvice(Method aspectJAdviceMethod, AspectJExpressionPointcut pointcut, AspectInstanceFactory aspectInstanceFactory)
Create a new AbstractAspectJAdvice for the given advice method.
Method Summary
protected Object[] | argBinding(org.aspectj.lang.JoinPoint jp, org.aspectj.weaver.tools.JoinPointMatch jpMatch, Object returnValue, Throwable ex) Take the arguments at the method execution join point and output a set of arguments to the advice method
Pointcut | buildSafePointcut() Build a 'safe' pointcut that excludes the AspectJ advice method itself.
void | calculateArgumentBindings() Do as much work as we can as part of the set-up so that argument binding on subsequent advice invocations can be as fast as possible.
protected ParameterNameDiscoverer | createParameterNameDiscoverer() Create a ParameterNameDiscoverer to be used for argument binding.
static org.aspectj.lang.JoinPoint | currentJoinPoint() Lazily instantiate joinpoint for the current invocation.
ClassLoader | getAspectClassLoader() Return the ClassLoader for aspect instances.
AspectInstanceFactory | getAspectInstanceFactory() Return the factory for aspect instances.
Method | getAspectJAdviceMethod() Return the AspectJ-style advice method.
String | getAspectName() The name of the aspect (bean) in which the advice was declared.
int | getDeclarationOrder() The declaration order of the advice member within the aspect.
protected Type | getDiscoveredReturningGenericType()
protected Class | getDiscoveredReturningType()
protected Class | getDiscoveredThrowingType()
protected org.aspectj.lang.JoinPoint | getJoinPoint() Overridden in around advice to return proceeding join point.
protected org.aspectj.weaver.tools.JoinPointMatch | getJoinPointMatch() Get the current join point match at the join point we are being dispatched on.
protected org.aspectj.weaver.tools.JoinPointMatch | getJoinPointMatch(ProxyMethodInvocation pmi)
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
AspectJExpressionPointcut | getPointcut() Return the AspectJ expression pointcut.
protected Object | invokeAdviceMethod(org.aspectj.lang.JoinPoint jp, org.aspectj.weaver.tools.JoinPointMatch jpMatch, Object returnValue, Throwable t)
protected Object | invokeAdviceMethod(org.aspectj.weaver.tools.JoinPointMatch jpMatch, Object returnValue, Throwable ex) Invoke the advice method.
protected Object | invokeAdviceMethodWithGivenArgs(Object[] args)
void | setArgumentNames(String argNames) Set by creator of this advice object if the argument names are known.
void | setArgumentNamesFromStringArray(String[] args)
void | setAspectName(String name)
void | setDeclarationOrder(int order) Sets the declaration order of this advice within the aspect
void | setReturningName(String name)
protected void | setReturningNameNoCheck(String name) We need to hold the returning name at this level for argument binding calculations, this method allows the afterReturning advice subclass to set the name.
void | setThrowingName(String name)
protected void | setThrowingNameNoCheck(String name) We need to hold the throwing name at this level for argument binding calculations, this method allows the afterThrowing advice subclass to set the name.
protected boolean | supportsProceedingJoinPoint()
String | toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.aop.aspectj.AspectJPrecedenceInformation
isAfterAdvice, isBeforeAdvice

Field Detail

JOIN_POINT_KEY

protected static final String JOIN_POINT_KEY
Key used in ReflectiveMethodInvocation userAtributes map for the current joinpoint.

aspectJAdviceMethod

protected final Method aspectJAdviceMethod
Constructor Detail

AbstractAspectJAdvice

public AbstractAspectJAdvice(Method aspectJAdviceMethod,
                             AspectJExpressionPointcut pointcut,
                             AspectInstanceFactory aspectInstanceFactory)
Create a new AbstractAspectJAdvice for the given advice method.

Parameters:
aspectJAdviceMethod - the AspectJ-style advice method
pointcut - the AspectJ expression pointcut
aspectInstanceFactory - the factory for aspect instances
Method Detail

currentJoinPoint

public static org.aspectj.lang.JoinPoint currentJoinPoint()
Lazily instantiate joinpoint for the current invocation. Requires MethodInvocation to be bound with ExposeInvocationInterceptor.

Do not use if access is available to the current ReflectiveMethodInvocation (in an around advice).

Returns:
current AspectJ joinpoint, or through an exception if we're not in a Spring AOP invocation.

getAspectJAdviceMethod

public final Method getAspectJAdviceMethod()
Return the AspectJ-style advice method.

getPointcut

public final AspectJExpressionPointcut getPointcut()
Return the AspectJ expression pointcut.

buildSafePointcut

public final Pointcut buildSafePointcut()
Build a 'safe' pointcut that excludes the AspectJ advice method itself.

Returns:
a composable pointcut that builds on the original AspectJ expression pointcut
See Also:
getPointcut()

getAspectInstanceFactory

public final AspectInstanceFactory getAspectInstanceFactory()
Return the factory for aspect instances.

getAspectClassLoader

public final ClassLoader getAspectClassLoader()
Return the ClassLoader for aspect instances.

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

setAspectName

public void setAspectName(String name)

getAspectName

public String getAspectName()
Description copied from interface: AspectJPrecedenceInformation
The name of the aspect (bean) in which the advice was declared.

Specified by:
getAspectName in interface AspectJPrecedenceInformation

setDeclarationOrder

public void setDeclarationOrder(int order)
Sets the declaration order of this advice within the aspect

getDeclarationOrder

public int getDeclarationOrder()
Description copied from interface: AspectJPrecedenceInformation
The declaration order of the advice member within the aspect.

Specified by:
getDeclarationOrder in interface AspectJPrecedenceInformation

setArgumentNames

public void setArgumentNames(String argNames)
Set by creator of this advice object if the argument names are known.

This could be for example because they have been explicitly specified in XML, or in an advice annotation.

Parameters:
argNames - comma delimited list of arg names

setArgumentNamesFromStringArray

public void setArgumentNamesFromStringArray(String[] args)

setReturningName

public void setReturningName(String name)

setReturningNameNoCheck

protected void setReturningNameNoCheck(String name)
We need to hold the returning name at this level for argument binding calculations, this method allows the afterReturning advice subclass to set the name.

getDiscoveredReturningType

protected Class getDiscoveredReturningType()

getDiscoveredReturningGenericType

protected Type getDiscoveredReturningGenericType()

setThrowingName

public void setThrowingName(String name)

setThrowingNameNoCheck

protected void setThrowingNameNoCheck(String name)
We need to hold the throwing name at this level for argument binding calculations, this method allows the afterThrowing advice subclass to set the name.

getDiscoveredThrowingType

protected Class getDiscoveredThrowingType()

calculateArgumentBindings

public final void calculateArgumentBindings()
Do as much work as we can as part of the set-up so that argument binding on subsequent advice invocations can be as fast as possible.

If the first argument is of type JoinPoint or ProceedingJoinPoint then we pass a JoinPoint in that position (ProceedingJoinPoint for around advice).

If the first argument is of type JoinPoint.StaticPart then we pass a JoinPoint.StaticPart in that position.

Remaining arguments have to be bound by pointcut evaluation at a given join point. We will get back a map from argument name to value. We need to calculate which advice parameter needs to be bound to which argument name. There are multiple strategies for determining this binding, which are arranged in a ChainOfResponsibility.

supportsProceedingJoinPoint

protected boolean supportsProceedingJoinPoint()

createParameterNameDiscoverer

protected ParameterNameDiscoverer createParameterNameDiscoverer()
Create a ParameterNameDiscoverer to be used for argument binding.

The default implementation creates a PrioritizedParameterNameDiscoverer containing a LocalVariableTableParameterNameDiscoverer and an AspectJAdviceParameterNameDiscoverer.

argBinding

protected Object[] argBinding(org.aspectj.lang.JoinPoint jp,
                              org.aspectj.weaver.tools.JoinPointMatch jpMatch,
                              Object returnValue,
                              Throwable ex)
Take the arguments at the method execution join point and output a set of arguments to the advice method

Parameters:
jp - the current JoinPoint
jpMatch - the join point match that matched this execution join point
returnValue - the return value from the method execution (may be null)
ex - the exception thrown by the method execution (may be null)
Returns:
the empty array if there are no arguments

invokeAdviceMethod

protected Object invokeAdviceMethod(org.aspectj.weaver.tools.JoinPointMatch jpMatch,
                                    Object returnValue,
                                    Throwable ex)
                             throws Throwable
Invoke the advice method.

Parameters:
jpMatch - the JoinPointMatch that matched this execution join point
returnValue - the return value from the method execution (may be null)
ex - the exception thrown by the method execution (may be null)
Returns:
the invocation result
Throws:
Throwable - in case of invocation failure

invokeAdviceMethod

protected Object invokeAdviceMethod(org.aspectj.lang.JoinPoint jp,
                                    org.aspectj.weaver.tools.JoinPointMatch jpMatch,
                                    Object returnValue,
                                    Throwable t)
                             throws Throwable
Throws:
Throwable

invokeAdviceMethodWithGivenArgs

protected Object invokeAdviceMethodWithGivenArgs(Object[] args)
                                          throws Throwable
Throws:
Throwable

getJoinPoint

protected org.aspectj.lang.JoinPoint getJoinPoint()
Overridden in around advice to return proceeding join point.

getJoinPointMatch

protected org.aspectj.weaver.tools.JoinPointMatch getJoinPointMatch()
Get the current join point match at the join point we are being dispatched on.

getJoinPointMatch

protected org.aspectj.weaver.tools.JoinPointMatch getJoinPointMatch(ProxyMethodInvocation pmi)

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AspectJAdviceParameterNameDiscoverer

org.springframework.aop.aspectj
Class AspectJAdviceParameterNameDiscoverer

java.lang.Object
    extended by  org.springframework.aop.aspectj.AspectJAdviceParameterNameDiscoverer
All Implemented Interfaces:
ParameterNameDiscoverer
public class AspectJAdviceParameterNameDiscoverer
extends Object
implements ParameterNameDiscoverer

ParameterNameDiscoverer implementation that tries to deduce parameter names for an advice method from the pointcut expression, returning, and throwing clauses. If an unambiguous interpretation is not available, it returns null.

This class interprets arguments in the following way:

  1. If the first parameter of the method is of type JoinPoint or ProceedingJoinPoint, it is assumed to be for passing thisJoinPoint to the advice, and the parameter name will be assigned the value "thisJoinPoint".
  2. If the first parameter of the method is of type JoinPoint.StaticPart, it is assumed to be for passing "thisJoinPointStaticPart" to the advice, and the parameter name will be assigned the value "thisJoinPointStaticPart".
  3. If a throwingName has been set, and there are no unbound arguments of type Throwable+, then an IllegalArgumentException is raised. If there is more than one unbound argument of type Throwable+, then an AspectJAdviceParameterNameDiscoverer.AmbiguousBindingException is raised. If there is exactly one unbound argument of type Throwable+, then the corresponding parameter name is assigned the value <throwingName>.
  4. If there remain unbound arguments, then the pointcut expression is examined. Let a be the number of annotation-based pointcut expressions (@annotation, @this, @target, @args, @within, @withincode) that are used in binding form. Usage in binding form has itself to be deduced: if the expression inside the pointcut is a single string literal that meets Java variable name conventions it is assumed to be a variable name. If a is zero we proceed to the next stage. If a > 1 then an AmbiguousBindingException is raised. If a == 1, and there are no unbound arguments of type Annotation+, then an IllegalArgumentException is raised. if there is exactly one such argument, then the corresponding parameter name is assigned the value from the pointcut expression.
  5. If a returningName has been set, and there are no unbound arguments then an IllegalArgumentException is raised. If there is more than one unbound argument then an AmbiguousBindingException is raised. If there is exactly one unbound argument then the corresponding parameter name is assigned the value <returningName>.
  6. If there remain unbound arguments, then the pointcut expression is examined once more for this, target, and args pointcut expressions used in the binding form (binding forms are deduced as described for the annotation based pointcuts). If there remains more than one unbound argument of a primitive type (which can only be bound in args) then an AmbiguousBindingException is raised. If there is exactly one argument of a primitive type, then if exactly one args bound variable was found, we assign the corresponding parameter name the variable name. If there were no args bound variables found an IllegalStateException is raised. If there are multiple args bound variables, an AmbiguousBindingException is raised. At this point, if there remains more than one unbound argument we raise an AmbiguousBindingException. If there are no unbound arguments remaining, we are done. If there is exactly one unbound argument remaining, and only one candidate variable name unbound from this, target, or args, it is assigned as the corresponding parameter name. If there are multiple possibilities, an AmbiguousBindingException is raised.

The behavior on raising an IllegalArgumentException or AmbiguousBindingException is configurable to allow this discoverer to be used as part of a chain-of-responsibility. By default the condition will be logged and the getParameterNames(..) method will simply return null. If the raiseExceptions property is set to true, the conditions will be thrown as IllegalArgumentException and AmbiguousBindingException, respectively.

Was that perfectly clear? ;)

Short version: If an unambiguous binding can be deduced, then it is. If the advice requirements cannot possibly be satisfied, then null is returned. By setting the raiseExceptions property to true, descriptive exceptions will be thrown instead of returning null in the case that the parameter names cannot be discovered.

Since:
2.0
Author:
Adrian Colyer

Nested Class Summary
static class AspectJAdviceParameterNameDiscoverer.AmbiguousBindingException
Thrown in response to an ambiguous binding being detected when trying to resolve a method's parameter names.
Constructor Summary
AspectJAdviceParameterNameDiscoverer(String pointcutExpression)
Create a new discoverer that attempts to discover parameter names from the given pointcut expression.
Method Summary
String[] | getParameterNames(Constructor ctor) An advice method can never be a constructor in Spring.
String[] | getParameterNames(Method method) Deduce the parameter names for an advice method.
void | setRaiseExceptions(boolean raiseExceptions) Indicate whether IllegalArgumentException and AspectJAdviceParameterNameDiscoverer.AmbiguousBindingException must be thrown as appropriate in the case of failing to deduce advice parameter names.
void | setReturningName(String returningName) If afterReturning advice binds the return value, the returning variable name must be specified.
void | setThrowingName(String throwingName) If afterThrowing advice binds the thrown value, the throwing variable name must be specified.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AspectJAdviceParameterNameDiscoverer

public AspectJAdviceParameterNameDiscoverer(String pointcutExpression)
Create a new discoverer that attempts to discover parameter names from the given pointcut expression.

Method Detail

setRaiseExceptions

public void setRaiseExceptions(boolean raiseExceptions)
Indicate whether IllegalArgumentException and AspectJAdviceParameterNameDiscoverer.AmbiguousBindingException must be thrown as appropriate in the case of failing to deduce advice parameter names.

Parameters:
raiseExceptions - true if exceptions are to be thrown

setReturningName

public void setReturningName(String returningName)
If afterReturning advice binds the return value, the returning variable name must be specified.

Parameters:
returningName - the name of the returning variable

setThrowingName

public void setThrowingName(String throwingName)
If afterThrowing advice binds the thrown value, the throwing variable name must be specified.

Parameters:
throwingName - the name of the throwing variable

getParameterNames

public String[] getParameterNames(Method method)
Deduce the parameter names for an advice method.

See the class level javadoc for this class for details of the algorithm used.

Specified by:
getParameterNames in interface ParameterNameDiscoverer
Parameters:
method - the target Method
Returns:
the parameter names

getParameterNames

public String[] getParameterNames(Constructor ctor)
An advice method can never be a constructor in Spring.

Specified by:
getParameterNames in interface ParameterNameDiscoverer
Parameters:
ctor - constructor to find parameter names for
Returns:
null
Throws:
UnsupportedOperationException - if raiseExceptions has been set to true
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AspectJAdviceParameterNameDiscoverer.AmbiguousBindingException

org.springframework.aop.aspectj
Class AspectJAdviceParameterNameDiscoverer.AmbiguousBindingException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.aop.aspectj.AspectJAdviceParameterNameDiscoverer.AmbiguousBindingException
All Implemented Interfaces:
Serializable
Enclosing class:
AspectJAdviceParameterNameDiscoverer
public static class AspectJAdviceParameterNameDiscoverer.AmbiguousBindingException
extends RuntimeException

Thrown in response to an ambiguous binding being detected when trying to resolve a method's parameter names.

See Also:
Serialized Form

Constructor Summary
AspectJAdviceParameterNameDiscoverer.AmbiguousBindingException(String msg)
Construct a new AmbiguousBindingException with the specified message.
Method Summary
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AspectJAdviceParameterNameDiscoverer.AmbiguousBindingException

public AspectJAdviceParameterNameDiscoverer.AmbiguousBindingException(String msg)
Construct a new AmbiguousBindingException with the specified message.

Parameters:
msg - the detail message
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AspectJAfterAdvice

org.springframework.aop.aspectj
Class AspectJAfterAdvice

java.lang.Object
    extended by  org.springframework.aop.aspectj.AbstractAspectJAdvice
        extended by  org.springframework.aop.aspectj.AspectJAfterAdvice
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, AfterAdvice, AspectJPrecedenceInformation, Ordered
public class AspectJAfterAdvice
extends AbstractAspectJAdvice
implements MethodInterceptor, AfterAdvice

Spring AOP advice wrapping an AspectJ after advice method.

Since:
2.0
Author:
Rod Johnson

Field Summary
Fields inherited from class org.springframework.aop.aspectj.AbstractAspectJAdvice
aspectJAdviceMethod, JOIN_POINT_KEY
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AspectJAfterAdvice(Method aspectJBeforeAdviceMethod, AspectJExpressionPointcut pointcut, AspectInstanceFactory aif)
Method Summary
Object | invoke(MethodInvocation mi)
boolean | isAfterAdvice() Return whether this is an after advice.
boolean | isBeforeAdvice() Return whether this is a before advice.
Methods inherited from class org.springframework.aop.aspectj.AbstractAspectJAdvice
argBinding, buildSafePointcut, calculateArgumentBindings, createParameterNameDiscoverer, currentJoinPoint, getAspectClassLoader, getAspectInstanceFactory, getAspectJAdviceMethod, getAspectName, getDeclarationOrder, getDiscoveredReturningGenericType, getDiscoveredReturningType, getDiscoveredThrowingType, getJoinPoint, getJoinPointMatch, getJoinPointMatch, getOrder, getPointcut, invokeAdviceMethod, invokeAdviceMethod, invokeAdviceMethodWithGivenArgs, setArgumentNames, setArgumentNamesFromStringArray, setAspectName, setDeclarationOrder, setReturningName, setReturningNameNoCheck, setThrowingName, setThrowingNameNoCheck, supportsProceedingJoinPoint, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AspectJAfterAdvice

public AspectJAfterAdvice(Method aspectJBeforeAdviceMethod,
                          AspectJExpressionPointcut pointcut,
                          AspectInstanceFactory aif)
Method Detail

invoke

public Object invoke(MethodInvocation mi)
              throws Throwable
Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable

isBeforeAdvice

public boolean isBeforeAdvice()
Description copied from interface: AspectJPrecedenceInformation
Return whether this is a before advice.

Specified by:
isBeforeAdvice in interface AspectJPrecedenceInformation

isAfterAdvice

public boolean isAfterAdvice()
Description copied from interface: AspectJPrecedenceInformation
Return whether this is an after advice.

Specified by:
isAfterAdvice in interface AspectJPrecedenceInformation
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AspectJAfterReturningAdvice

org.springframework.aop.aspectj
Class AspectJAfterReturningAdvice

java.lang.Object
    extended by  org.springframework.aop.aspectj.AbstractAspectJAdvice
        extended by  org.springframework.aop.aspectj.AspectJAfterReturningAdvice
All Implemented Interfaces:
Advice, AfterAdvice, AfterReturningAdvice, AspectJPrecedenceInformation, Ordered
public class AspectJAfterReturningAdvice
extends AbstractAspectJAdvice
implements AfterReturningAdvice, AfterAdvice

Spring AOP advice wrapping an AspectJ after-returning advice method.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller, Ramnivas Laddad

Field Summary
Fields inherited from class org.springframework.aop.aspectj.AbstractAspectJAdvice
aspectJAdviceMethod, JOIN_POINT_KEY
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AspectJAfterReturningAdvice(Method aspectJBeforeAdviceMethod, AspectJExpressionPointcut pointcut, AspectInstanceFactory aif)
Method Summary
void | afterReturning(Object returnValue, Method method, Object[] args, Object target) Callback after a given method successfully returned.
boolean | isAfterAdvice() Return whether this is an after advice.
boolean | isBeforeAdvice() Return whether this is a before advice.
void | setReturningName(String name)
Methods inherited from class org.springframework.aop.aspectj.AbstractAspectJAdvice
argBinding, buildSafePointcut, calculateArgumentBindings, createParameterNameDiscoverer, currentJoinPoint, getAspectClassLoader, getAspectInstanceFactory, getAspectJAdviceMethod, getAspectName, getDeclarationOrder, getDiscoveredReturningGenericType, getDiscoveredReturningType, getDiscoveredThrowingType, getJoinPoint, getJoinPointMatch, getJoinPointMatch, getOrder, getPointcut, invokeAdviceMethod, invokeAdviceMethod, invokeAdviceMethodWithGivenArgs, setArgumentNames, setArgumentNamesFromStringArray, setAspectName, setDeclarationOrder, setReturningNameNoCheck, setThrowingName, setThrowingNameNoCheck, supportsProceedingJoinPoint, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AspectJAfterReturningAdvice

public AspectJAfterReturningAdvice(Method aspectJBeforeAdviceMethod,
                                   AspectJExpressionPointcut pointcut,
                                   AspectInstanceFactory aif)
Method Detail

isBeforeAdvice

public boolean isBeforeAdvice()
Description copied from interface: AspectJPrecedenceInformation
Return whether this is a before advice.

Specified by:
isBeforeAdvice in interface AspectJPrecedenceInformation

isAfterAdvice

public boolean isAfterAdvice()
Description copied from interface: AspectJPrecedenceInformation
Return whether this is an after advice.

Specified by:
isAfterAdvice in interface AspectJPrecedenceInformation

setReturningName

public void setReturningName(String name)
Overrides:
setReturningName in class AbstractAspectJAdvice

afterReturning

public void afterReturning(Object returnValue,
                           Method method,
                           Object[] args,
                           Object target)
                    throws Throwable
Description copied from interface: AfterReturningAdvice
Callback after a given method successfully returned.

Specified by:
afterReturning in interface AfterReturningAdvice
Parameters:
returnValue - the value returned by the method, if any
method - method being invoked
args - arguments to the method
target - target of the method invocation. May be null.
Throws:
Throwable - if this object wishes to abort the call. Any exception thrown will be returned to the caller if it's allowed by the method signature. Otherwise the exception will be wrapped as a runtime exception.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AspectJAfterThrowingAdvice

org.springframework.aop.aspectj
Class AspectJAfterThrowingAdvice

java.lang.Object
    extended by  org.springframework.aop.aspectj.AbstractAspectJAdvice
        extended by  org.springframework.aop.aspectj.AspectJAfterThrowingAdvice
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, AfterAdvice, AspectJPrecedenceInformation, Ordered
public class AspectJAfterThrowingAdvice
extends AbstractAspectJAdvice
implements MethodInterceptor, AfterAdvice

Spring AOP advice wrapping an AspectJ after-throwing advice method.

Since:
2.0
Author:
Rod Johnson

Field Summary
Fields inherited from class org.springframework.aop.aspectj.AbstractAspectJAdvice
aspectJAdviceMethod, JOIN_POINT_KEY
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AspectJAfterThrowingAdvice(Method aspectJBeforeAdviceMethod, AspectJExpressionPointcut pointcut, AspectInstanceFactory aif)
Method Summary
Object | invoke(MethodInvocation mi)
boolean | isAfterAdvice() Return whether this is an after advice.
boolean | isBeforeAdvice() Return whether this is a before advice.
void | setThrowingName(String name)
Methods inherited from class org.springframework.aop.aspectj.AbstractAspectJAdvice
argBinding, buildSafePointcut, calculateArgumentBindings, createParameterNameDiscoverer, currentJoinPoint, getAspectClassLoader, getAspectInstanceFactory, getAspectJAdviceMethod, getAspectName, getDeclarationOrder, getDiscoveredReturningGenericType, getDiscoveredReturningType, getDiscoveredThrowingType, getJoinPoint, getJoinPointMatch, getJoinPointMatch, getOrder, getPointcut, invokeAdviceMethod, invokeAdviceMethod, invokeAdviceMethodWithGivenArgs, setArgumentNames, setArgumentNamesFromStringArray, setAspectName, setDeclarationOrder, setReturningName, setReturningNameNoCheck, setThrowingNameNoCheck, supportsProceedingJoinPoint, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AspectJAfterThrowingAdvice

public AspectJAfterThrowingAdvice(Method aspectJBeforeAdviceMethod,
                                  AspectJExpressionPointcut pointcut,
                                  AspectInstanceFactory aif)
Method Detail

isBeforeAdvice

public boolean isBeforeAdvice()
Description copied from interface: AspectJPrecedenceInformation
Return whether this is a before advice.

Specified by:
isBeforeAdvice in interface AspectJPrecedenceInformation

isAfterAdvice

public boolean isAfterAdvice()
Description copied from interface: AspectJPrecedenceInformation
Return whether this is an after advice.

Specified by:
isAfterAdvice in interface AspectJPrecedenceInformation

setThrowingName

public void setThrowingName(String name)
Overrides:
setThrowingName in class AbstractAspectJAdvice

invoke

public Object invoke(MethodInvocation mi)
              throws Throwable
Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AspectJAopUtils

org.springframework.aop.aspectj
Class AspectJAopUtils

java.lang.Object
    extended by  org.springframework.aop.aspectj.AspectJAopUtils

public abstract class AspectJAopUtils
extends Object

Utility methods for dealing with AspectJ advisors.

Since:
2.0
Author:
Adrian Colyer, Juergen Hoeller

Constructor Summary
AspectJAopUtils()
Method Summary
static AspectJPrecedenceInformation | getAspectJPrecedenceInformationFor(Advisor anAdvisor) Return the AspectJPrecedenceInformation provided by this advisor or its advice.
static boolean | isAfterAdvice(Advisor anAdvisor) Return true if the advisor is a form of after advice.
static boolean | isBeforeAdvice(Advisor anAdvisor) Return true if the advisor is a form of before advice.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AspectJAopUtils

public AspectJAopUtils()
Method Detail

isBeforeAdvice

public static boolean isBeforeAdvice(Advisor anAdvisor)
Return true if the advisor is a form of before advice.

isAfterAdvice

public static boolean isAfterAdvice(Advisor anAdvisor)
Return true if the advisor is a form of after advice.

getAspectJPrecedenceInformationFor

public static AspectJPrecedenceInformation getAspectJPrecedenceInformationFor(Advisor anAdvisor)
Return the AspectJPrecedenceInformation provided by this advisor or its advice. If neither the advisor nor the advice have precedence information, this method will return null.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AspectJAroundAdvice

org.springframework.aop.aspectj
Class AspectJAroundAdvice

java.lang.Object
    extended by  org.springframework.aop.aspectj.AbstractAspectJAdvice
        extended by  org.springframework.aop.aspectj.AspectJAroundAdvice
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, AspectJPrecedenceInformation, Ordered
public class AspectJAroundAdvice
extends AbstractAspectJAdvice
implements MethodInterceptor

Spring AOP around advice (MethodInterceptor) that wraps an AspectJ advice method. Exposes ProceedingJoinPoint.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.aop.aspectj.AbstractAspectJAdvice
aspectJAdviceMethod, JOIN_POINT_KEY
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AspectJAroundAdvice(Method aspectJAroundAdviceMethod, AspectJExpressionPointcut pointcut, AspectInstanceFactory aif)
Method Summary
Object | invoke(MethodInvocation mi)
boolean | isAfterAdvice() Return whether this is an after advice.
boolean | isBeforeAdvice() Return whether this is a before advice.
protected org.aspectj.lang.ProceedingJoinPoint | lazyGetProceedingJoinPoint(ProxyMethodInvocation rmi) Return the ProceedingJoinPoint for the current invocation, instantiating it lazily if it hasn't been bound to the thread already.
protected boolean | supportsProceedingJoinPoint()
Methods inherited from class org.springframework.aop.aspectj.AbstractAspectJAdvice
argBinding, buildSafePointcut, calculateArgumentBindings, createParameterNameDiscoverer, currentJoinPoint, getAspectClassLoader, getAspectInstanceFactory, getAspectJAdviceMethod, getAspectName, getDeclarationOrder, getDiscoveredReturningGenericType, getDiscoveredReturningType, getDiscoveredThrowingType, getJoinPoint, getJoinPointMatch, getJoinPointMatch, getOrder, getPointcut, invokeAdviceMethod, invokeAdviceMethod, invokeAdviceMethodWithGivenArgs, setArgumentNames, setArgumentNamesFromStringArray, setAspectName, setDeclarationOrder, setReturningName, setReturningNameNoCheck, setThrowingName, setThrowingNameNoCheck, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AspectJAroundAdvice

public AspectJAroundAdvice(Method aspectJAroundAdviceMethod,
                           AspectJExpressionPointcut pointcut,
                           AspectInstanceFactory aif)
Method Detail

isBeforeAdvice

public boolean isBeforeAdvice()
Description copied from interface: AspectJPrecedenceInformation
Return whether this is a before advice.

Specified by:
isBeforeAdvice in interface AspectJPrecedenceInformation

isAfterAdvice

public boolean isAfterAdvice()
Description copied from interface: AspectJPrecedenceInformation
Return whether this is an after advice.

Specified by:
isAfterAdvice in interface AspectJPrecedenceInformation

supportsProceedingJoinPoint

protected boolean supportsProceedingJoinPoint()
Overrides:
supportsProceedingJoinPoint in class AbstractAspectJAdvice

invoke

public Object invoke(MethodInvocation mi)
              throws Throwable
Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable

lazyGetProceedingJoinPoint

protected org.aspectj.lang.ProceedingJoinPoint lazyGetProceedingJoinPoint(ProxyMethodInvocation rmi)
Return the ProceedingJoinPoint for the current invocation, instantiating it lazily if it hasn't been bound to the thread already.

Parameters:
rmi - the current Spring AOP ReflectiveMethodInvocation, which we'll use for attribute binding
Returns:
the ProceedingJoinPoint to make available to advice methods
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AspectJExpressionPointcut

org.springframework.aop.aspectj
Class AspectJExpressionPointcut

java.lang.Object
    extended by  org.springframework.aop.support.AbstractExpressionPointcut
        extended by  org.springframework.aop.aspectj.AspectJExpressionPointcut
All Implemented Interfaces:
Serializable, ClassFilter, IntroductionAwareMethodMatcher, MethodMatcher, Pointcut, ExpressionPointcut, BeanFactoryAware
public class AspectJExpressionPointcut
extends AbstractExpressionPointcut
implements ClassFilter, IntroductionAwareMethodMatcher, BeanFactoryAware

Spring Pointcut implementation that uses the AspectJ weaver to evaluate a pointcut expression.

The pointcut expression value is an AspectJ expression. This can reference other pointcuts and use composition and other operations.

Naturally, as this is to be processed by Spring AOP's proxy-based model, only method execution pointcuts are supported.

Since:
2.0
Author:
Rob Harrop, Adrian Colyer, Rod Johnson, Juergen Hoeller, Ramnivas Laddad
See Also:
Serialized Form

Field Summary
Fields inherited from interface org.springframework.aop.ClassFilter
TRUE
Fields inherited from interface org.springframework.aop.Pointcut
TRUE
Constructor Summary
AspectJExpressionPointcut()
Create a new default AspectJExpressionPointcut.
AspectJExpressionPointcut(Class declarationScope, String[] paramNames, Class[] paramTypes)
Create a new AspectJExpressionPointcut with the given settings.
Method Summary
 boolean equals(Object other)
 ClassFilter getClassFilter()
Return the ClassFilter for this pointcut.
protected  String getCurrentProxiedBeanName()
 MethodMatcher getMethodMatcher()
Return the MethodMatcher for this pointcut.
 org.aspectj.weaver.tools.PointcutExpression getPointcutExpression()
Return the underlying AspectJ pointcut expression.
 int hashCode()
 boolean isRuntime()
Is this MethodMatcher dynamic, that is, must a final call be made on the MethodMatcher.matches(java.lang.reflect.Method, Class, Object[]) method at runtime even if the 2-arg matches method returns true?
 boolean matches(Class targetClass)
Should the pointcut apply to the given interface or target class?
 boolean matches(Method method, Class targetClass)
Perform static checking whether the given method matches.
 boolean matches(Method method, Class targetClass, boolean beanHasIntroductions)
Perform static checking whether the given method matches.
 boolean matches(Method method, Class targetClass, Object[] args)
Check whether there a runtime (dynamic) match for this method, which must have matched statically.
 void setBeanFactory(BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance.
 void setParameterNames(String[] names)
Set the parameter names for the pointcut.
 void setParameterTypes(Class[] types)
Set the parameter types for the pointcut.
 void setPointcutDeclarationScope(Class pointcutDeclarationScope)
Set the declaration scope for the pointcut.
 String toString()
Methods inherited from class org.springframework.aop.support.AbstractExpressionPointcut
getExpression, getLocation, onSetExpression, setExpression, setLocation
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

AspectJExpressionPointcut

public AspectJExpressionPointcut()
Create a new default AspectJExpressionPointcut.

AspectJExpressionPointcut

public AspectJExpressionPointcut(Class declarationScope,
                                 String[] paramNames,
                                 Class[] paramTypes)
Create a new AspectJExpressionPointcut with the given settings.

Parameters:
declarationScope - the declaration scope for the pointcut
paramNames - the parameter names for the pointcut
paramTypes - the parameter types for the pointcut
Method Detail

setPointcutDeclarationScope

public void setPointcutDeclarationScope(Class pointcutDeclarationScope)
Set the declaration scope for the pointcut.

setParameterNames

public void setParameterNames(String[] names)
Set the parameter names for the pointcut.

setParameterTypes

public void setParameterTypes(Class[] types)
Set the parameter types for the pointcut.

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
BeanInitializationException

getClassFilter

public ClassFilter getClassFilter()
Description copied from interface: Pointcut
Return the ClassFilter for this pointcut.

Specified by:
getClassFilter in interface Pointcut
Returns:
the ClassFilter (never null)

getMethodMatcher

public MethodMatcher getMethodMatcher()
Description copied from interface: Pointcut
Return the MethodMatcher for this pointcut.

Specified by:
getMethodMatcher in interface Pointcut
Returns:
the MethodMatcher (never null)

getPointcutExpression

public org.aspectj.weaver.tools.PointcutExpression getPointcutExpression()
Return the underlying AspectJ pointcut expression.

matches

public boolean matches(Class targetClass)
Description copied from interface: ClassFilter
Should the pointcut apply to the given interface or target class?

Specified by:
matches in interface ClassFilter
Parameters:
targetClass - the candidate target class
Returns:
whether the advice should apply to the given target class

matches

public boolean matches(Method method,
                       Class targetClass,
                       boolean beanHasIntroductions)
Description copied from interface: IntroductionAwareMethodMatcher
Perform static checking whether the given method matches. This may be invoked instead of the 2-arg MethodMatcher.matches(java.lang.reflect.Method, Class) method if the caller supports the extended IntroductionAwareMethodMatcher interface.

Specified by:
matches in interface IntroductionAwareMethodMatcher
Parameters:
method - the candidate method
targetClass - the target class (may be null, in which case the candidate class must be taken to be the method's declaring class)
beanHasIntroductions - true if the object on whose behalf we are asking is the subject on one or more introductions; false otherwise
Returns:
whether or not this method matches statically

matches

public boolean matches(Method method,
                       Class targetClass)
Description copied from interface: MethodMatcher
Perform static checking whether the given method matches. If this returns false or if the MethodMatcher.isRuntime() method returns false, no runtime check (i.e. no. MethodMatcher.matches(java.lang.reflect.Method, Class, Object[]) call) will be made.

Specified by:
matches in interface MethodMatcher
Parameters:
method - the candidate method
targetClass - the target class (may be null, in which case the candidate class must be taken to be the method's declaring class)
Returns:
whether or not this method matches statically

isRuntime

public boolean isRuntime()
Description copied from interface: MethodMatcher
Is this MethodMatcher dynamic, that is, must a final call be made on the MethodMatcher.matches(java.lang.reflect.Method, Class, Object[]) method at runtime even if the 2-arg matches method returns true?

Can be invoked when an AOP proxy is created, and need not be invoked again before each method invocation,

Specified by:
isRuntime in interface MethodMatcher
Returns:
whether or not a runtime match via the 3-arg MethodMatcher.matches(java.lang.reflect.Method, Class, Object[]) method is required if static matching passed

matches

public boolean matches(Method method,
                       Class targetClass,
                       Object[] args)
Description copied from interface: MethodMatcher
Check whether there a runtime (dynamic) match for this method, which must have matched statically.

This method is invoked only if the 2-arg matches method returns true for the given method and target class, and if the MethodMatcher.isRuntime() method returns true. Invoked immediately before potential running of the advice, after any advice earlier in the advice chain has run.

Specified by:
matches in interface MethodMatcher
Parameters:
method - the candidate method
targetClass - the target class (may be null, in which case the candidate class must be taken to be the method's declaring class)
args - arguments to the method
Returns:
whether there's a runtime match
See Also:
MethodMatcher.matches(Method, Class)

getCurrentProxiedBeanName

protected String getCurrentProxiedBeanName()

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AspectJExpressionPointcutAdvisor

org.springframework.aop.aspectj
Class AspectJExpressionPointcutAdvisor

java.lang.Object
    extended by  org.springframework.aop.support.AbstractPointcutAdvisor
        extended by  org.springframework.aop.support.AbstractGenericPointcutAdvisor
            extended by  org.springframework.aop.aspectj.AspectJExpressionPointcutAdvisor
All Implemented Interfaces:
Serializable, Advisor, PointcutAdvisor, Ordered
public class AspectJExpressionPointcutAdvisor
extends AbstractGenericPointcutAdvisor

Spring AOP Advisor that can be used for any AspectJ pointcut expression.

Since:
2.0
Author:
Rob Harrop
See Also:
Serialized Form

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AspectJExpressionPointcutAdvisor()
Method Summary
String | getExpression()
String | getLocation()
Pointcut | getPointcut() Get the Pointcut that drives this advisor.
void | setExpression(String expression)
void | setLocation(String location)
void | setParameterNames(String[] names)
void | setParameterTypes(Class[] types)
Methods inherited from class org.springframework.aop.support.AbstractGenericPointcutAdvisor
getAdvice, setAdvice, toString
Methods inherited from class org.springframework.aop.support.AbstractPointcutAdvisor
equals, getOrder, hashCode, isPerInstance, setOrder
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

AspectJExpressionPointcutAdvisor

public AspectJExpressionPointcutAdvisor()
Method Detail

getPointcut

public Pointcut getPointcut()
Description copied from interface: PointcutAdvisor
Get the Pointcut that drives this advisor.

setExpression

public void setExpression(String expression)

setLocation

public void setLocation(String location)

setParameterTypes

public void setParameterTypes(Class[] types)

setParameterNames

public void setParameterNames(String[] names)

getLocation

public String getLocation()

getExpression

public String getExpression()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AspectJMethodBeforeAdvice

org.springframework.aop.aspectj
Class AspectJMethodBeforeAdvice

java.lang.Object
    extended by  org.springframework.aop.aspectj.AbstractAspectJAdvice
        extended by  org.springframework.aop.aspectj.AspectJMethodBeforeAdvice
All Implemented Interfaces:
Advice, AspectJPrecedenceInformation, BeforeAdvice, MethodBeforeAdvice, Ordered
public class AspectJMethodBeforeAdvice
extends AbstractAspectJAdvice
implements MethodBeforeAdvice

Spring AOP advice that wraps an AspectJ before method.

Since:
2.0
Author:
Rod Johnson, Adrian Colyer

Field Summary
Fields inherited from class org.springframework.aop.aspectj.AbstractAspectJAdvice
aspectJAdviceMethod, JOIN_POINT_KEY
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AspectJMethodBeforeAdvice(Method aspectJBeforeAdviceMethod, AspectJExpressionPointcut pointcut, AspectInstanceFactory aif)
Method Summary
void | before(Method method, Object[] args, Object target) Callback before a given method is invoked.
boolean | isAfterAdvice() Return whether this is an after advice.
boolean | isBeforeAdvice() Return whether this is a before advice.
Methods inherited from class org.springframework.aop.aspectj.AbstractAspectJAdvice
argBinding, buildSafePointcut, calculateArgumentBindings, createParameterNameDiscoverer, currentJoinPoint, getAspectClassLoader, getAspectInstanceFactory, getAspectJAdviceMethod, getAspectName, getDeclarationOrder, getDiscoveredReturningGenericType, getDiscoveredReturningType, getDiscoveredThrowingType, getJoinPoint, getJoinPointMatch, getJoinPointMatch, getOrder, getPointcut, invokeAdviceMethod, invokeAdviceMethod, invokeAdviceMethodWithGivenArgs, setArgumentNames, setArgumentNamesFromStringArray, setAspectName, setDeclarationOrder, setReturningName, setReturningNameNoCheck, setThrowingName, setThrowingNameNoCheck, supportsProceedingJoinPoint, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AspectJMethodBeforeAdvice

public AspectJMethodBeforeAdvice(Method aspectJBeforeAdviceMethod,
                                 AspectJExpressionPointcut pointcut,
                                 AspectInstanceFactory aif)
Method Detail

before

public void before(Method method,
                   Object[] args,
                   Object target)
            throws Throwable
Description copied from interface: MethodBeforeAdvice
Callback before a given method is invoked.

Specified by:
before in interface MethodBeforeAdvice
Parameters:
method - method being invoked
args - arguments to the method
target - target of the method invocation. May be null.
Throws:
Throwable - if this object wishes to abort the call. Any exception thrown will be returned to the caller if it's allowed by the method signature. Otherwise the exception will be wrapped as a runtime exception.

isBeforeAdvice

public boolean isBeforeAdvice()
Description copied from interface: AspectJPrecedenceInformation
Return whether this is a before advice.

Specified by:
isBeforeAdvice in interface AspectJPrecedenceInformation

isAfterAdvice

public boolean isAfterAdvice()
Description copied from interface: AspectJPrecedenceInformation
Return whether this is an after advice.

Specified by:
isAfterAdvice in interface AspectJPrecedenceInformation
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AspectJPointcutAdvisor

org.springframework.aop.aspectj
Class AspectJPointcutAdvisor

java.lang.Object
    extended by  org.springframework.aop.aspectj.AspectJPointcutAdvisor
All Implemented Interfaces:
Advisor, PointcutAdvisor, Ordered
public class AspectJPointcutAdvisor
extends Object
implements PointcutAdvisor, Ordered

AspectJPointcutAdvisor that adapts an AbstractAspectJAdvice to the PointcutAdvisor interface.

Since:
2.0
Author:
Adrian Colyer, Juergen Hoeller

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AspectJPointcutAdvisor(AbstractAspectJAdvice advice)
Create a new AspectJPointcutAdvisor for the given advice
Method Summary
boolean | equals(Object other)
Advice | getAdvice() Return the advice part of this aspect.
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
Pointcut | getPointcut() Get the Pointcut that drives this advisor.
int | hashCode()
boolean | isPerInstance() Return whether this advice is associated with a particular instance (for example, creating a mixin) or shared with all instances of the advised class obtained from the same Spring bean factory.
void | setOrder(int order)
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AspectJPointcutAdvisor

public AspectJPointcutAdvisor(AbstractAspectJAdvice advice)
Create a new AspectJPointcutAdvisor for the given advice

Parameters:
advice - the AbstractAspectJAdvice to wrap
Method Detail

setOrder

public void setOrder(int order)

isPerInstance

public boolean isPerInstance()
Description copied from interface: Advisor
Return whether this advice is associated with a particular instance (for example, creating a mixin) or shared with all instances of the advised class obtained from the same Spring bean factory.

Note that this method is not currently used by the framework. Typical Advisor implementations always return true. Use singleton/prototype bean definitions or appropriate programmatic proxy creation to ensure that Advisors have the correct lifecycle model.

Specified by:
isPerInstance in interface Advisor
Returns:
whether this advice is associated with a particular target instance

getAdvice

public Advice getAdvice()
Description copied from interface: Advisor
Return the advice part of this aspect. An advice may be an interceptor, a before advice, a throws advice, etc.

Specified by:
getAdvice in interface Advisor
Returns:
the advice that should apply if the pointcut matches
See Also:
MethodInterceptor, BeforeAdvice, ThrowsAdvice, AfterReturningAdvice

getPointcut

public Pointcut getPointcut()
Description copied from interface: PointcutAdvisor
Get the Pointcut that drives this advisor.

Specified by:
getPointcut in interface PointcutAdvisor

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AspectJProxyUtils

org.springframework.aop.aspectj
Class AspectJProxyUtils

java.lang.Object
    extended by  org.springframework.aop.aspectj.AspectJProxyUtils

public abstract class AspectJProxyUtils
extends Object

Utility methods for working with AspectJ proxies.

Since:
2.0
Author:
Rod Johnson, Ramnivas Laddad

Constructor Summary
AspectJProxyUtils()
Method Summary
static boolean makeAdvisorChainAspectJCapableIfNecessary(List<Advisor> advisors)
Add special advisors if necessary to work with a proxy chain that contains AspectJ advisors.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AspectJProxyUtils

public AspectJProxyUtils()
Method Detail

makeAdvisorChainAspectJCapableIfNecessary

public static boolean makeAdvisorChainAspectJCapableIfNecessary(List<Advisor> advisors)
Add special advisors if necessary to work with a proxy chain that contains AspectJ advisors. This will expose the current Spring AOP invocation (necessary for some AspectJ pointcut matching) and make available the current AspectJ JoinPoint. The call will have no effect if there are no AspectJ advisors in the advisor chain.

Parameters:
advisors - Advisors available
Returns:
true if any special Advisors were added, otherwise false.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AspectJWeaverMessageHandler

org.springframework.aop.aspectj
Class AspectJWeaverMessageHandler

java.lang.Object
    extended by  org.springframework.aop.aspectj.AspectJWeaverMessageHandler
All Implemented Interfaces:
org.aspectj.bridge.IMessageHandler
public class AspectJWeaverMessageHandler
extends Object
implements org.aspectj.bridge.IMessageHandler

Implementation of AspectJ's IMessageHandler interface that routes AspectJ weaving messages through the same logging system as the regular Spring messages.

Pass the option...

-XmessageHandlerClass:org.springframework.aop.aspectj.AspectJWeaverMessageHandler

to the weaver; for example, specifying the following in a "META-INF/aop.xml file:

<weaver options="..."/>

Since:
2.0
Author:
Adrian Colyer, Juergen Hoeller

Field Summary
Fields inherited from interface org.aspectj.bridge.IMessageHandler
SYSTEM_ERR, SYSTEM_OUT, THROW
Constructor Summary
AspectJWeaverMessageHandler()
Method Summary
void | dontIgnore(org.aspectj.bridge.IMessage.Kind messageKind)
boolean | handleMessage(org.aspectj.bridge.IMessage message)
void | ignore(org.aspectj.bridge.IMessage.Kind kind)
boolean | isIgnoring(org.aspectj.bridge.IMessage.Kind messageKind)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AspectJWeaverMessageHandler

public AspectJWeaverMessageHandler()
Method Detail

handleMessage

public boolean handleMessage(org.aspectj.bridge.IMessage message)
                      throws org.aspectj.bridge.AbortException
Specified by:
handleMessage in interface org.aspectj.bridge.IMessageHandler
Throws:
org.aspectj.bridge.AbortException

isIgnoring

public boolean isIgnoring(org.aspectj.bridge.IMessage.Kind messageKind)
Specified by:
isIgnoring in interface org.aspectj.bridge.IMessageHandler

dontIgnore

public void dontIgnore(org.aspectj.bridge.IMessage.Kind messageKind)
Specified by:
dontIgnore in interface org.aspectj.bridge.IMessageHandler

ignore

public void ignore(org.aspectj.bridge.IMessage.Kind kind)
Specified by:
ignore in interface org.aspectj.bridge.IMessageHandler
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DeclareParentsAdvisor

org.springframework.aop.aspectj
Class DeclareParentsAdvisor

java.lang.Object
    extended by  org.springframework.aop.aspectj.DeclareParentsAdvisor
All Implemented Interfaces:
Advisor, IntroductionAdvisor, IntroductionInfo
public class DeclareParentsAdvisor
extends Object
implements IntroductionAdvisor

Introduction advisor delegating to the given object. Implements AspectJ annotation-style behavior for the DeclareParents annotation.

Since:
2.0
Author:
Rod Johnson, Ramnivas Laddad

Constructor Summary
DeclareParentsAdvisor(Class interfaceType, String typePattern, Class defaultImpl)
Create a new advisor for this DeclareParents field.
DeclareParentsAdvisor(Class interfaceType, String typePattern, Object delegateRef)
Create a new advisor for this DeclareParents field.
Method Summary
Advice | getAdvice() Return the advice part of this aspect.
ClassFilter | getClassFilter() Return the filter determining which target classes this introduction should apply to.
Class[] | getInterfaces() Return the additional interfaces introduced by this Advisor or Advice.
boolean | isPerInstance() Return whether this advice is associated with a particular instance (for example, creating a mixin) or shared with all instances of the advised class obtained from the same Spring bean factory.
void | validateInterfaces() Can the advised interfaces be implemented by the introduction advice? Invoked before adding an IntroductionAdvisor.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DeclareParentsAdvisor

public DeclareParentsAdvisor(Class interfaceType,
                             String typePattern,
                             Class defaultImpl)
Create a new advisor for this DeclareParents field.

Parameters:
interfaceType - static field defining the introduction
typePattern - type pattern the introduction is restricted to
defaultImpl - the default implementation class

DeclareParentsAdvisor

public DeclareParentsAdvisor(Class interfaceType,
                             String typePattern,
                             Object delegateRef)
Create a new advisor for this DeclareParents field.

Parameters:
interfaceType - static field defining the introduction
typePattern - type pattern the introduction is restricted to
delegateRef - the delegate implementation object
Method Detail

getClassFilter

public ClassFilter getClassFilter()
Description copied from interface: IntroductionAdvisor
Return the filter determining which target classes this introduction should apply to.

This represents the class part of a pointcut. Note that method matching doesn't make sense to introductions.

Specified by:
getClassFilter in interface IntroductionAdvisor
Returns:
the class filter

validateInterfaces

public void validateInterfaces()
                        throws IllegalArgumentException
Description copied from interface: IntroductionAdvisor
Can the advised interfaces be implemented by the introduction advice? Invoked before adding an IntroductionAdvisor.

Specified by:
validateInterfaces in interface IntroductionAdvisor
Throws:
IllegalArgumentException - if the advised interfaces can't be implemented by the introduction advice

isPerInstance

public boolean isPerInstance()
Description copied from interface: Advisor
Return whether this advice is associated with a particular instance (for example, creating a mixin) or shared with all instances of the advised class obtained from the same Spring bean factory.

Note that this method is not currently used by the framework. Typical Advisor implementations always return true. Use singleton/prototype bean definitions or appropriate programmatic proxy creation to ensure that Advisors have the correct lifecycle model.

Specified by:
isPerInstance in interface Advisor
Returns:
whether this advice is associated with a particular target instance

getAdvice

public Advice getAdvice()
Description copied from interface: Advisor
Return the advice part of this aspect. An advice may be an interceptor, a before advice, a throws advice, etc.

Specified by:
getAdvice in interface Advisor
Returns:
the advice that should apply if the pointcut matches
See Also:
MethodInterceptor, BeforeAdvice, ThrowsAdvice, AfterReturningAdvice

getInterfaces

public Class[] getInterfaces()
Description copied from interface: IntroductionInfo
Return the additional interfaces introduced by this Advisor or Advice.

Specified by:
getInterfaces in interface IntroductionInfo
Returns:
the introduced interfaces
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MethodInvocationProceedingJoinPoint

org.springframework.aop.aspectj
Class MethodInvocationProceedingJoinPoint

java.lang.Object
    extended by  org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint
All Implemented Interfaces:
org.aspectj.lang.JoinPoint, org.aspectj.lang.JoinPoint.StaticPart, org.aspectj.lang.ProceedingJoinPoint
public class MethodInvocationProceedingJoinPoint
extends Object
implements org.aspectj.lang.ProceedingJoinPoint, org.aspectj.lang.JoinPoint.StaticPart

Implementation of AspectJ ProceedingJoinPoint interface wrapping an AOP Alliance MethodInvocation.

Note: the getThis() method returns the current Spring AOP proxy. The getTarget() method returns the current Spring AOP target (which may be null if there is no target), and is a plain POJO without any advice. If you want to call the object and have the advice take effect, use getThis(). A common example is casting the object to an introduced interface in the implementation of an introduction.

Of course there is no such distinction between target and proxy in AspectJ.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller, Adrian Colyer, Ramnivas Laddad

Nested Class Summary
Nested classes/interfaces inherited from interface org.aspectj.lang.JoinPoint
org.aspectj.lang.JoinPoint.EnclosingStaticPart, org.aspectj.lang.JoinPoint.StaticPart
Field Summary
Fields inherited from interface org.aspectj.lang.JoinPoint
ADVICE_EXECUTION, CONSTRUCTOR_CALL, CONSTRUCTOR_EXECUTION, EXCEPTION_HANDLER, FIELD_GET, FIELD_SET, INITIALIZATION, METHOD_CALL, METHOD_EXECUTION, PREINITIALIZATION, STATICINITIALIZATION, SYNCHRONIZATION_LOCK, SYNCHRONIZATION_UNLOCK
Constructor Summary
MethodInvocationProceedingJoinPoint(ProxyMethodInvocation methodInvocation)
Create a new MethodInvocationProceedingJoinPoint, wrapping the given Spring ProxyMethodInvocation object.
Method Summary
Object[] | getArgs()
int | getId()
String | getKind()
org.aspectj.lang.Signature | getSignature()
org.aspectj.lang.reflect.SourceLocation | getSourceLocation()
org.aspectj.lang.JoinPoint.StaticPart | getStaticPart()
Object | getTarget() Returns the Spring AOP target.
Object | getThis() Returns the Spring AOP proxy.
Object | proceed()
Object | proceed(Object[] arguments)
void | set$AroundClosure(org.aspectj.runtime.internal.AroundClosure aroundClosure)
String | toLongString()
String | toShortString()
String | toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

MethodInvocationProceedingJoinPoint

public MethodInvocationProceedingJoinPoint(ProxyMethodInvocation methodInvocation)
Create a new MethodInvocationProceedingJoinPoint, wrapping the given Spring ProxyMethodInvocation object.

Parameters:
methodInvocation - the Spring ProxyMethodInvocation object
Method Detail

set$AroundClosure

public void set$AroundClosure(org.aspectj.runtime.internal.AroundClosure aroundClosure)
Specified by:
set$AroundClosure in interface org.aspectj.lang.ProceedingJoinPoint

proceed

public Object proceed()
               throws Throwable
Specified by:
proceed in interface org.aspectj.lang.ProceedingJoinPoint
Throws:
Throwable

proceed

public Object proceed(Object[] arguments)
               throws Throwable
Specified by:
proceed in interface org.aspectj.lang.ProceedingJoinPoint
Throws:
Throwable

getThis

public Object getThis()
Returns the Spring AOP proxy. Cannot be null.

Specified by:
getThis in interface org.aspectj.lang.JoinPoint

getTarget

public Object getTarget()
Returns the Spring AOP target. May be null if there is no target.

Specified by:
getTarget in interface org.aspectj.lang.JoinPoint

getArgs

public Object[] getArgs()
Specified by:
getArgs in interface org.aspectj.lang.JoinPoint

getSignature

public org.aspectj.lang.Signature getSignature()
Specified by:
getSignature in interface org.aspectj.lang.JoinPoint
Specified by:
getSignature in interface org.aspectj.lang.JoinPoint.StaticPart

getSourceLocation

public org.aspectj.lang.reflect.SourceLocation getSourceLocation()
Specified by:
getSourceLocation in interface org.aspectj.lang.JoinPoint
Specified by:
getSourceLocation in interface org.aspectj.lang.JoinPoint.StaticPart

getKind

public String getKind()
Specified by:
getKind in interface org.aspectj.lang.JoinPoint
Specified by:
getKind in interface org.aspectj.lang.JoinPoint.StaticPart

getId

public int getId()
Specified by:
getId in interface org.aspectj.lang.JoinPoint.StaticPart

getStaticPart

public org.aspectj.lang.JoinPoint.StaticPart getStaticPart()
Specified by:
getStaticPart in interface org.aspectj.lang.JoinPoint

toShortString

public String toShortString()
Specified by:
toShortString in interface org.aspectj.lang.JoinPoint
Specified by:
toShortString in interface org.aspectj.lang.JoinPoint.StaticPart

toLongString

public String toLongString()
Specified by:
toLongString in interface org.aspectj.lang.JoinPoint
Specified by:
toLongString in interface org.aspectj.lang.JoinPoint.StaticPart

toString

public String toString()
Specified by:
toString in interface org.aspectj.lang.JoinPoint
Specified by:
toString in interface org.aspectj.lang.JoinPoint.StaticPart
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleAspectInstanceFactory

org.springframework.aop.aspectj
Class SimpleAspectInstanceFactory

java.lang.Object
    extended by  org.springframework.aop.aspectj.SimpleAspectInstanceFactory
All Implemented Interfaces:
AspectInstanceFactory, Ordered
Direct Known Subclasses:
SimpleMetadataAwareAspectInstanceFactory
public class SimpleAspectInstanceFactory
extends Object
implements AspectInstanceFactory

Implementation of AspectInstanceFactory that creates a new instance of the specified aspect class for every getAspectInstance() call.

Since:
2.0.4
Author:
Juergen Hoeller

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
SimpleAspectInstanceFactory(Class aspectClass)
Create a new SimpleAspectInstanceFactory for the given aspect class.
Method Summary
Class | getAspectClass() Return the specified aspect class (never null).
ClassLoader | getAspectClassLoader() Expose the aspect class loader that this factory uses.
Object | getAspectInstance() Create an instance of this factory's aspect.
int | getOrder() Determine the order for this factory's aspect instance, either an instance-specific order expressed through implementing the Ordered interface, or a fallback order.
protected int | getOrderForAspectClass(Class<?> aspectClass) Determine a fallback order for the case that the aspect instance does not express an instance-specific order through implementing the Ordered interface.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleAspectInstanceFactory

public SimpleAspectInstanceFactory(Class aspectClass)
Create a new SimpleAspectInstanceFactory for the given aspect class.

Parameters:
aspectClass - the aspect class
Method Detail

getAspectClass

public final Class getAspectClass()
Return the specified aspect class (never null).

getAspectInstance

public final Object getAspectInstance()
Description copied from interface: AspectInstanceFactory
Create an instance of this factory's aspect.

Specified by:
getAspectInstance in interface AspectInstanceFactory
Returns:
the aspect instance (never null)

getAspectClassLoader

public ClassLoader getAspectClassLoader()
Description copied from interface: AspectInstanceFactory
Expose the aspect class loader that this factory uses.

Specified by:
getAspectClassLoader in interface AspectInstanceFactory
Returns:
the aspect class loader (never null)

getOrder

public int getOrder()
Determine the order for this factory's aspect instance, either an instance-specific order expressed through implementing the Ordered interface, or a fallback order.

Specified by:
getOrder in interface Ordered
Returns:
the order value
See Also:
Ordered, getOrderForAspectClass(java.lang.Class)

getOrderForAspectClass

protected int getOrderForAspectClass(Class<?> aspectClass)
Determine a fallback order for the case that the aspect instance does not express an instance-specific order through implementing the Ordered interface.

The default implementation simply returns Ordered.LOWEST_PRECEDENCE.

Parameters:
aspectClass - the aspect class
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SingletonAspectInstanceFactory

org.springframework.aop.aspectj
Class SingletonAspectInstanceFactory

java.lang.Object
    extended by  org.springframework.aop.aspectj.SingletonAspectInstanceFactory
All Implemented Interfaces:
AspectInstanceFactory, Ordered
Direct Known Subclasses:
SingletonMetadataAwareAspectInstanceFactory
public class SingletonAspectInstanceFactory
extends Object
implements AspectInstanceFactory

Implementation of AspectInstanceFactory that is backed by a specified singleton object, returning the same instance for every getAspectInstance() call.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller
See Also:
SimpleAspectInstanceFactory

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
SingletonAspectInstanceFactory(Object aspectInstance)
Create a new SingletonAspectInstanceFactory for the given aspect instance.
Method Summary
ClassLoader | getAspectClassLoader() Expose the aspect class loader that this factory uses.
Object | getAspectInstance() Create an instance of this factory's aspect.
int | getOrder() Determine the order for this factory's aspect instance, either an instance-specific order expressed through implementing the Ordered interface, or a fallback order.
protected int | getOrderForAspectClass(Class<?> aspectClass) Determine a fallback order for the case that the aspect instance does not express an instance-specific order through implementing the Ordered interface.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SingletonAspectInstanceFactory

public SingletonAspectInstanceFactory(Object aspectInstance)
Create a new SingletonAspectInstanceFactory for the given aspect instance.

Parameters:
aspectInstance - the singleton aspect instance
Method Detail

getAspectInstance

public final Object getAspectInstance()
Description copied from interface: AspectInstanceFactory
Create an instance of this factory's aspect.

Specified by:
getAspectInstance in interface AspectInstanceFactory
Returns:
the aspect instance (never null)

getAspectClassLoader

public ClassLoader getAspectClassLoader()
Description copied from interface: AspectInstanceFactory
Expose the aspect class loader that this factory uses.

Specified by:
getAspectClassLoader in interface AspectInstanceFactory
Returns:
the aspect class loader (never null)

getOrder

public int getOrder()
Determine the order for this factory's aspect instance, either an instance-specific order expressed through implementing the Ordered interface, or a fallback order.

Specified by:
getOrder in interface Ordered
Returns:
the order value
See Also:
Ordered, getOrderForAspectClass(java.lang.Class)

getOrderForAspectClass

protected int getOrderForAspectClass(Class<?> aspectClass)
Determine a fallback order for the case that the aspect instance does not express an instance-specific order through implementing the Ordered interface.

The default implementation simply returns Ordered.LOWEST_PRECEDENCE.

Parameters:
aspectClass - the aspect class
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TypePatternClassFilter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.aop.aspectj
Class TypePatternClassFilter

java.lang.Object
    extended by  org.springframework.aop.aspectj.TypePatternClassFilter
All Implemented Interfaces:
ClassFilter
public class TypePatternClassFilter
extends Object
implements ClassFilter

Spring AOP ClassFilter implementation using AspectJ type matching.

Since:
2.0
Author:
Rod Johnson

Field Summary
Fields inherited from interface org.springframework.aop.ClassFilter
TRUE
Constructor Summary
TypePatternClassFilter()
Creates a new instance of the TypePatternClassFilter class.
TypePatternClassFilter(String typePattern)
Create a fully configured TypePatternClassFilter using the given type pattern.
Method Summary
String | getTypePattern()
boolean | matches(Class clazz) Should the pointcut apply to the given interface or target class?
void | setTypePattern(String typePattern) Set the AspectJ type pattern to match.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TypePatternClassFilter

public TypePatternClassFilter()
Creates a new instance of the TypePatternClassFilter class.

This is the JavaBean constructor; be sure to set the typePattern property, else a no doubt fatal IllegalStateException will be thrown when the matches(Class) method is first invoked.

TypePatternClassFilter

public TypePatternClassFilter(String typePattern)
Create a fully configured TypePatternClassFilter using the given type pattern.

Parameters:
typePattern - the type pattern that AspectJ weaver should parse
Throws:
IllegalArgumentException - if the supplied typePattern is null or is recognized as invalid
Method Detail

setTypePattern

public void setTypePattern(String typePattern)
Set the AspectJ type pattern to match.

Examples include: org.springframework.beans.* This will match any class or interface in the given package. org.springframework.beans.ITestBean+ This will match the ITestBean interface and any class that implements it.

These conventions are established by AspectJ, not Spring AOP.

Parameters:
typePattern - the type pattern that AspectJ weaver should parse
Throws:
IllegalArgumentException - if the supplied typePattern is null or is recognized as invalid

getTypePattern

public String getTypePattern()

matches

public boolean matches(Class clazz)
Should the pointcut apply to the given interface or target class?

Specified by:
matches in interface ClassFilter
Parameters:
clazz - candidate target class
Returns:
whether the advice should apply to this candidate target class
Throws:
IllegalStateException - if no setTypePattern(String) has been set
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.aop.aspectj.annotation

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.aop.aspectj.annotation

Classes enabling AspectJ 5 @Annotated classes to be used in Spring AOP.

See:
Description

Interface Summary
AspectJAdvisorFactory | Interface for factories that can create Spring AOP Advisors from classes annotated with AspectJ annotation syntax.
MetadataAwareAspectInstanceFactory | Subinterface of AspectInstanceFactory that returns AspectMetadata associated with AspectJ-annotated classes.

Class Summary
AbstractAspectJAdvisorFactory | Abstract base class for factories that can create Spring AOP Advisors given AspectJ classes from classes honoring the AspectJ 5 annotation syntax.
AbstractAspectJAdvisorFactory.AspectJAnnotation<A extends Annotation> | Class modelling an AspectJ annotation, exposing its type enumeration and pointcut String.
AnnotationAwareAspectJAutoProxyCreator | AspectJAwareAdvisorAutoProxyCreator subclass that processes all AspectJ annotation aspects in the current application context, as well as Spring Advisors.
AspectJProxyFactory | AspectJ-based proxy factory, allowing for programmatic building of proxies which include AspectJ aspects (code style as well Java 5 annotation style).
AspectMetadata | Metadata for an AspectJ aspect class, with an additional Spring AOP pointcut for the per clause.
BeanFactoryAspectInstanceFactory | AspectInstanceFactory implementation backed by a Spring BeanFactory.
BeanFactoryAspectJAdvisorsBuilder | Helper for retrieving @AspectJ beans from a BeanFactory and building Spring Advisors based on them, for use with auto-proxying.
LazySingletonAspectInstanceFactoryDecorator | Decorator to cause a MetadataAwareAspectInstanceFactory to instantiate only once.
PrototypeAspectInstanceFactory | AspectInstanceFactory backed by a BeanFactory-provided prototype, enforcing prototype semantics.
ReflectiveAspectJAdvisorFactory | Factory that can create Spring AOP Advisors given AspectJ classes from classes honoring the AspectJ 5 annotation syntax, using reflection to invoke the corresponding advice methods.
ReflectiveAspectJAdvisorFactory.SyntheticInstantiationAdvisor | Synthetic advisor that instantiates the aspect.
SimpleMetadataAwareAspectInstanceFactory | Implementation of MetadataAwareAspectInstanceFactory that creates a new instance of the specified aspect class for every SimpleAspectInstanceFactory.getAspectInstance() call.
SingletonMetadataAwareAspectInstanceFactory | Implementation of MetadataAwareAspectInstanceFactory that is backed by a specified singleton object, returning the same instance for every SingletonAspectInstanceFactory.getAspectInstance() call.

Enum Summary
AbstractAspectJAdvisorFactory.AspectJAnnotationType

Exception Summary
NotAnAtAspectException Extension of AopConfigException thrown when trying to perform an advisor generation operation on a class that is not an AspectJ annotation-style aspect.

Package org.springframework.aop.aspectj.annotation Description

Classes enabling AspectJ 5 @Annotated classes to be used in Spring AOP.

Normally to be used through an AspectJAutoProxyCreator rather than directly.


org.springframework.aop.aspectj.annotation Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.aop.aspectj.annotation

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory (implements org.springframework.aop.aspectj.annotation.AspectJAdvisorFactory)
      • org.springframework.aop.aspectj.annotation.ReflectiveAspectJAdvisorFactory
    • org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory.AspectJAnnotation<A>
    • org.springframework.aop.support.AbstractPointcutAdvisor (implements org.springframework.core.Ordered, org.springframework.aop.PointcutAdvisor, java.io.Serializable)
      • org.springframework.aop.support.AbstractGenericPointcutAdvisor
        • org.springframework.aop.support.DefaultPointcutAdvisor (implements java.io.Serializable)
          • org.springframework.aop.aspectj.annotation.ReflectiveAspectJAdvisorFactory.SyntheticInstantiationAdvisor
    • org.springframework.aop.aspectj.annotation.AspectMetadata
    • org.springframework.aop.aspectj.annotation.BeanFactoryAspectInstanceFactory (implements org.springframework.aop.aspectj.annotation.MetadataAwareAspectInstanceFactory)
      • org.springframework.aop.aspectj.annotation.PrototypeAspectInstanceFactory
    • org.springframework.aop.aspectj.annotation.BeanFactoryAspectJAdvisorsBuilder
    • org.springframework.aop.aspectj.annotation.LazySingletonAspectInstanceFactoryDecorator (implements org.springframework.aop.aspectj.annotation.MetadataAwareAspectInstanceFactory)
    • org.springframework.aop.framework.ProxyConfig (implements java.io.Serializable)
      • org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator (implements org.springframework.aop.framework.AopInfrastructureBean, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.core.Ordered, org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor)
        • org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
          • org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator
            • org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator
      • org.springframework.aop.framework.AdvisedSupport (implements org.springframework.aop.framework.Advised)
        • org.springframework.aop.framework.ProxyCreatorSupport
          • org.springframework.aop.aspectj.annotation.AspectJProxyFactory
    • org.springframework.aop.aspectj.SimpleAspectInstanceFactory (implements org.springframework.aop.aspectj.AspectInstanceFactory)
      • org.springframework.aop.aspectj.annotation.SimpleMetadataAwareAspectInstanceFactory (implements org.springframework.aop.aspectj.annotation.MetadataAwareAspectInstanceFactory)
    • org.springframework.aop.aspectj.SingletonAspectInstanceFactory (implements org.springframework.aop.aspectj.AspectInstanceFactory)
      • org.springframework.aop.aspectj.annotation.SingletonMetadataAwareAspectInstanceFactory (implements org.springframework.aop.aspectj.annotation.MetadataAwareAspectInstanceFactory)
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.aop.framework.AopConfigException
              • org.springframework.aop.aspectj.annotation.NotAnAtAspectException

Interface Hierarchy

  • org.springframework.aop.aspectj.annotation.AspectJAdvisorFactory
  • org.springframework.core.Ordered
    • org.springframework.aop.aspectj.AspectInstanceFactory
      • org.springframework.aop.aspectj.annotation.MetadataAwareAspectInstanceFactory

Enum Hierarchy

  • java.lang.Object
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)
      • org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory.AspectJAnnotationType


AspectJAdvisorFactory

org.springframework.aop.aspectj.annotation
Interface AspectJAdvisorFactory

All Known Implementing Classes:
AbstractAspectJAdvisorFactory, ReflectiveAspectJAdvisorFactory
public interface AspectJAdvisorFactory

Interface for factories that can create Spring AOP Advisors from classes annotated with AspectJ annotation syntax.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller
See Also:
AspectMetadata, AjTypeSystem

Method Summary
Advice | getAdvice(Method candidateAdviceMethod, AspectJExpressionPointcut pointcut, MetadataAwareAspectInstanceFactory aif, int declarationOrderInAspect, String aspectName) Build a Spring AOP Advice for the given AspectJ advice method.
Advisor | getAdvisor(Method candidateAdviceMethod, MetadataAwareAspectInstanceFactory aif, int declarationOrderInAspect, String aspectName) Build a Spring AOP Advisor for the given AspectJ advice method.
List<Advisor> | getAdvisors(MetadataAwareAspectInstanceFactory aif) Build Spring AOP Advisors for all annotated At-AspectJ methods on the specified aspect instance.
boolean | isAspect(Class<?> clazz) Determine whether or not the given class is an aspect, as reported by AspectJ's AjTypeSystem.
void | validate(Class<?> aspectClass) Is the given class a valid AspectJ aspect class?

Method Detail

isAspect

boolean isAspect(Class<?> clazz)
Determine whether or not the given class is an aspect, as reported by AspectJ's AjTypeSystem.

Will simply return false if the supposed aspect is invalid (such as an extension of a concrete aspect class). Will return true for some aspects that Spring AOP cannot process, such as those with unsupported instantiation models. Use the validate(java.lang.Class) method to handle these cases if necessary.

Parameters:
clazz - the supposed annotation-style AspectJ class
Returns:
whether or not this class is recognized by AspectJ as an aspect class

validate

void validate(Class<?> aspectClass)
              throws AopConfigException
Is the given class a valid AspectJ aspect class?

Parameters:
aspectClass - the supposed AspectJ annotation-style class to validate
Throws:
AopConfigException - if the class is an invalid aspect (which can never be legal)
NotAnAtAspectException - if the class is not an aspect at all (which may or may not be legal, depending on the context)

getAdvisors

List<Advisor> getAdvisors(MetadataAwareAspectInstanceFactory aif)
Build Spring AOP Advisors for all annotated At-AspectJ methods on the specified aspect instance.

Parameters:
aif - the aspect instance factory (not the aspect instance itself in order to avoid eager instantiation)
Returns:
a list of advisors for this class

getAdvisor

Advisor getAdvisor(Method candidateAdviceMethod,
                   MetadataAwareAspectInstanceFactory aif,
                   int declarationOrderInAspect,
                   String aspectName)
Build a Spring AOP Advisor for the given AspectJ advice method.

Parameters:
candidateAdviceMethod - the candidate advice method
aif - the aspect instance factory
declarationOrderInAspect - the declaration order within the aspect
aspectName - the name of the aspect
Returns:
null if the method is not an AspectJ advice method or if it is a pointcut that will be used by other advice but will not create a Spring advice in its own right

getAdvice

Advice getAdvice(Method candidateAdviceMethod,
                 AspectJExpressionPointcut pointcut,
                 MetadataAwareAspectInstanceFactory aif,
                 int declarationOrderInAspect,
                 String aspectName)
Build a Spring AOP Advice for the given AspectJ advice method.

Parameters:
candidateAdviceMethod - the candidate advice method
pointcut - the corresponding AspectJ expression pointcut
aif - the aspect instance factory
declarationOrderInAspect - the declaration order within the aspect
aspectName - the name of the aspect
Returns:
null if the method is not an AspectJ advice method or if it is a pointcut that will be used by other advice but will not create a Spring advice in its own right
See Also:
AspectJAroundAdvice, AspectJMethodBeforeAdvice, AspectJAfterAdvice, AspectJAfterReturningAdvice, AspectJAfterThrowingAdvice
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MetadataAwareAspectInstanceFactory

org.springframework.aop.aspectj.annotation
Interface MetadataAwareAspectInstanceFactory

All Superinterfaces:
AspectInstanceFactory, Ordered
All Known Implementing Classes:
BeanFactoryAspectInstanceFactory, LazySingletonAspectInstanceFactoryDecorator, PrototypeAspectInstanceFactory, SimpleMetadataAwareAspectInstanceFactory, SingletonMetadataAwareAspectInstanceFactory
public interface MetadataAwareAspectInstanceFactory
extends AspectInstanceFactory

Subinterface of AspectInstanceFactory that returns AspectMetadata associated with AspectJ-annotated classes.

Ideally, AspectInstanceFactory would include this method itself, but because AspectMetadata uses Java-5-only AjType, we need to split out this subinterface.

Since:
2.0
Author:
Rod Johnson
See Also:
AspectMetadata, AjType

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Method Summary
 AspectMetadata getAspectMetadata()
Return the AspectJ AspectMetadata for this factory's aspect.
Methods inherited from interface org.springframework.aop.aspectj.AspectInstanceFactory
getAspectClassLoader, getAspectInstance
Methods inherited from interface org.springframework.core.Ordered
getOrder

Method Detail

getAspectMetadata

AspectMetadata getAspectMetadata()
Return the AspectJ AspectMetadata for this factory's aspect.

Returns:
the aspect metadata
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractAspectJAdvisorFactory

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.aop.aspectj.annotation
Class AbstractAspectJAdvisorFactory

java.lang.Object
    extended by  org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory
All Implemented Interfaces:
AspectJAdvisorFactory
Direct Known Subclasses:
ReflectiveAspectJAdvisorFactory
public abstract class AbstractAspectJAdvisorFactory
extends Object
implements AspectJAdvisorFactory

Abstract base class for factories that can create Spring AOP Advisors given AspectJ classes from classes honoring the AspectJ 5 annotation syntax.

This class handles annotation parsing and validation functionality. It does not actually generate Spring AOP Advisors, which is deferred to subclasses.

Since:
2.0
Author:
Rod Johnson, Adrian Colyer, Juergen Hoeller

Nested Class Summary
protected static class | AbstractAspectJAdvisorFactory.AspectJAnnotation<A extends Annotation> Class modelling an AspectJ annotation, exposing its type enumeration and pointcut String.
protected static class | AbstractAspectJAdvisorFactory.AspectJAnnotationType
Field Summary
protected static ParameterNameDiscoverer | ASPECTJ_ANNOTATION_PARAMETER_NAME_DISCOVERER
protected Log | logger Logger available to subclasses
protected ParameterNameDiscoverer | parameterNameDiscoverer
Constructor Summary
protected AbstractAspectJAdvisorFactory()
Method Summary
protected AspectJExpressionPointcut | createPointcutExpression(Method annotatedMethod, Class declarationScope, String[] pointcutParameterNames) The pointcut and advice annotations both have an "argNames" member which contains a comma-separated list of the argument names.
protected static AbstractAspectJAdvisorFactory.AspectJAnnotation | findAspectJAnnotationOnMethod(Method method) Find and return the first AspectJ annotation on the given method (there should only be one anyway...)
boolean | isAspect(Class<?> clazz) We consider something to be an AspectJ aspect suitable for use by the Spring AOP system if it has the @Aspect annotation, and was not compiled by ajc.
void | validate(Class<?> aspectClass) Is the given class a valid AspectJ aspect class?
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.aop.aspectj.annotation.AspectJAdvisorFactory
getAdvice, getAdvisor, getAdvisors

Field Detail

ASPECTJ_ANNOTATION_PARAMETER_NAME_DISCOVERER

protected static final ParameterNameDiscoverer ASPECTJ_ANNOTATION_PARAMETER_NAME_DISCOVERER

logger

protected final Log logger
Logger available to subclasses

parameterNameDiscoverer

protected final ParameterNameDiscoverer parameterNameDiscoverer
Constructor Detail

AbstractAspectJAdvisorFactory

protected AbstractAspectJAdvisorFactory()
Method Detail

findAspectJAnnotationOnMethod

protected static AbstractAspectJAdvisorFactory.AspectJAnnotation findAspectJAnnotationOnMethod(Method method)
Find and return the first AspectJ annotation on the given method (there should only be one anyway...)

isAspect

public boolean isAspect(Class<?> clazz)
We consider something to be an AspectJ aspect suitable for use by the Spring AOP system if it has the @Aspect annotation, and was not compiled by ajc. The reason for this latter test is that aspects written in the code-style (AspectJ language) also have the annotation present when compiled by ajc with the -1.5 flag, yet they cannot be consumed by Spring AOP.

Specified by:
isAspect in interface AspectJAdvisorFactory
Parameters:
clazz - the supposed annotation-style AspectJ class
Returns:
whether or not this class is recognized by AspectJ as an aspect class

validate

public void validate(Class<?> aspectClass)
              throws AopConfigException
Description copied from interface: AspectJAdvisorFactory
Is the given class a valid AspectJ aspect class?

Specified by:
validate in interface AspectJAdvisorFactory
Parameters:
aspectClass - the supposed AspectJ annotation-style class to validate
Throws:
AopConfigException - if the class is an invalid aspect (which can never be legal)
NotAnAtAspectException - if the class is not an aspect at all (which may or may not be legal, depending on the context)

createPointcutExpression

protected AspectJExpressionPointcut createPointcutExpression(Method annotatedMethod,
                                                             Class declarationScope,
                                                             String[] pointcutParameterNames)
The pointcut and advice annotations both have an "argNames" member which contains a comma-separated list of the argument names. We use this (if non-empty) to build the formal parameters for the pointcut.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractAspectJAdvisorFactory.AspectJAnnotationType

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

org.springframework.aop.aspectj.annotation
Enum AbstractAspectJAdvisorFactory.AspectJAnnotationType

java.lang.Object
    extended by  java.lang.Enum<AbstractAspectJAdvisorFactory.AspectJAnnotationType>
        extended by  org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory.AspectJAnnotationType
All Implemented Interfaces:
Serializable, Comparable<AbstractAspectJAdvisorFactory.AspectJAnnotationType>
Enclosing class:
AbstractAspectJAdvisorFactory
protected static enum AbstractAspectJAdvisorFactory.AspectJAnnotationType
extends Enum<AbstractAspectJAdvisorFactory.AspectJAnnotationType>

Enum Constant Summary
AtAfter
AtAfterReturning
AtAfterThrowing
AtAround
AtBefore
AtPointcut
Method Summary
static AbstractAspectJAdvisorFactory.AspectJAnnotationType | valueOf(String name) Returns the enum constant of this type with the specified name.
static AbstractAspectJAdvisorFactory.AspectJAnnotationType[] | values() Returns an array containing the constants of this enum type, in the order they are declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

AtPointcut

public static final AbstractAspectJAdvisorFactory.AspectJAnnotationType AtPointcut

AtBefore

public static final AbstractAspectJAdvisorFactory.AspectJAnnotationType AtBefore

AtAfter

public static final AbstractAspectJAdvisorFactory.AspectJAnnotationType AtAfter

AtAfterReturning

public static final AbstractAspectJAdvisorFactory.AspectJAnnotationType AtAfterReturning

AtAfterThrowing

public static final AbstractAspectJAdvisorFactory.AspectJAnnotationType AtAfterThrowing

AtAround

public static final AbstractAspectJAdvisorFactory.AspectJAnnotationType AtAround
Method Detail

values

public static AbstractAspectJAdvisorFactory.AspectJAnnotationType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (AbstractAspectJAdvisorFactory.AspectJAnnotationType c : AbstractAspectJAdvisorFactory.AspectJAnnotationType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static AbstractAspectJAdvisorFactory.AspectJAnnotationType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


AnnotationAwareAspectJAutoProxyCreator

org.springframework.aop.aspectj.annotation
Class AnnotationAwareAspectJAutoProxyCreator

java.lang.Object
    extended by  org.springframework.aop.framework.ProxyConfig
        extended by  org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
            extended by  org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
                extended by  org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator
                    extended by  org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator
All Implemented Interfaces:
Serializable, AopInfrastructureBean, BeanClassLoaderAware, BeanFactoryAware, BeanPostProcessor, InstantiationAwareBeanPostProcessor, SmartInstantiationAwareBeanPostProcessor, Ordered
public class AnnotationAwareAspectJAutoProxyCreator
extends AspectJAwareAdvisorAutoProxyCreator

AspectJAwareAdvisorAutoProxyCreator subclass that processes all AspectJ annotation aspects in the current application context, as well as Spring Advisors.

Any AspectJ annotated classes will automatically be recognized, and their advice applied if Spring AOP's proxy-based model is capable of applying it. This covers method execution joinpoints.

If the <aop:include> element is used, only @AspectJ beans with names matched by an include pattern will be considered as defining aspects to use for Spring auto-proxying.

Processing of Spring Advisors follows the rules established in AbstractAdvisorAutoProxyCreator.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller
See Also:
AspectJAdvisorFactory, Serialized Form

Field Summary
Fields inherited from class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
DO_NOT_PROXY, logger, PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AnnotationAwareAspectJAutoProxyCreator()
Method Summary
protected List<Advisor> | findCandidateAdvisors() Find all candidate Advisors to use in auto-proxying.
protected void | initBeanFactory(ConfigurableListableBeanFactory beanFactory)
protected boolean | isEligibleAspectBean(String beanName) Check whether the given aspect bean is eligible for auto-proxying.
protected boolean | isInfrastructureClass(Class beanClass) Return whether the given bean class represents an infrastructure class that should never be proxied.
void | setAspectJAdvisorFactory(AspectJAdvisorFactory aspectJAdvisorFactory)
void | setIncludePatterns(List<String> patterns) Set a list of regex patterns, matching eligible @AspectJ bean names.
Methods inherited from class org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator
extendAdvisors, shouldSkip, sortAdvisors
Methods inherited from class org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
advisorsPreFiltered, findAdvisorsThatCanApply, findEligibleAdvisors, getAdvicesAndAdvisorsForBean, isEligibleAdvisorBean, setBeanFactory
Methods inherited from class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
buildAdvisors, createProxy, customizeProxyFactory, determineCandidateConstructors, getBeanFactory, getCacheKey, getCustomTargetSource, getEarlyBeanReference, getOrder, isFrozen, postProcessAfterInitialization, postProcessAfterInstantiation, postProcessBeforeInitialization, postProcessBeforeInstantiation, postProcessPropertyValues, predictBeanType, setAdvisorAdapterRegistry, setApplyCommonInterceptorsFirst, setBeanClassLoader, setCustomTargetSourceCreators, setFrozen, setInterceptorNames, setOrder, setProxyClassLoader, shouldProxyTargetClass, wrapIfNecessary
Methods inherited from class org.springframework.aop.framework.ProxyConfig
copyFrom, isExposeProxy, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setOpaque, setOptimize, setProxyTargetClass, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AnnotationAwareAspectJAutoProxyCreator

public AnnotationAwareAspectJAutoProxyCreator()
Method Detail

setIncludePatterns

public void setIncludePatterns(List<String> patterns)
Set a list of regex patterns, matching eligible @AspectJ bean names.

Default is to consider all @AspectJ beans as eligible.

setAspectJAdvisorFactory

public void setAspectJAdvisorFactory(AspectJAdvisorFactory aspectJAdvisorFactory)

initBeanFactory

protected void initBeanFactory(ConfigurableListableBeanFactory beanFactory)
Overrides:
initBeanFactory in class AbstractAdvisorAutoProxyCreator

findCandidateAdvisors

protected List<Advisor> findCandidateAdvisors()
Description copied from class: AbstractAdvisorAutoProxyCreator
Find all candidate Advisors to use in auto-proxying.

Overrides:
findCandidateAdvisors in class AbstractAdvisorAutoProxyCreator
Returns:
the List of candidate Advisors

isInfrastructureClass

protected boolean isInfrastructureClass(Class beanClass)
Description copied from class: AbstractAutoProxyCreator
Return whether the given bean class represents an infrastructure class that should never be proxied.

Default implementation considers Advisors, Advices and AbstractAutoProxyCreators as infrastructure classes.

Overrides:
isInfrastructureClass in class AbstractAutoProxyCreator
Parameters:
beanClass - the class of the bean
Returns:
whether the bean represents an infrastructure class
See Also:
Advisor, MethodInterceptor, AbstractAutoProxyCreator.shouldSkip(java.lang.Class, java.lang.String)

isEligibleAspectBean

protected boolean isEligibleAspectBean(String beanName)
Check whether the given aspect bean is eligible for auto-proxying.

If no <aop:include> elements were used then "includePatterns" will be null and all beans are included. If "includePatterns" is non-null, then one of the patterns must match.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AspectJProxyFactory

org.springframework.aop.aspectj.annotation
Class AspectJProxyFactory

java.lang.Object
    extended by  org.springframework.aop.framework.ProxyConfig
        extended by  org.springframework.aop.framework.AdvisedSupport
            extended by  org.springframework.aop.framework.ProxyCreatorSupport
                extended by  org.springframework.aop.aspectj.annotation.AspectJProxyFactory
All Implemented Interfaces:
Serializable, Advised, TargetClassAware
public class AspectJProxyFactory
extends ProxyCreatorSupport

AspectJ-based proxy factory, allowing for programmatic building of proxies which include AspectJ aspects (code style as well Java 5 annotation style).

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller, Ramnivas Laddad
See Also:
addAspect(Object), addAspect(Class), getProxy(), getProxy(ClassLoader), ProxyFactory, Serialized Form

Field Summary
Fields inherited from class org.springframework.aop.framework.AdvisedSupport
EMPTY_TARGET_SOURCE
Constructor Summary
AspectJProxyFactory()
Create a new AspectJProxyFactory.
AspectJProxyFactory(Class[] interfaces)
Create a new AspectJProxyFactory.
AspectJProxyFactory(Object target)
Create a new AspectJProxyFactory.
Method Summary
 void addAspect(Class aspectClass)
Add an aspect of the supplied type to the end of the advice chain.
 void addAspect(Object aspectInstance)
Add the supplied aspect instance to the chain.
<T> T
getProxy()
Create a new proxy according to the settings in this factory.
<T> T
getProxy(ClassLoader classLoader)
Create a new proxy according to the settings in this factory.
Methods inherited from class org.springframework.aop.framework.ProxyCreatorSupport
addListener, adviceChanged, createAopProxy, getAopProxyFactory, isActive, removeListener, setAopProxyFactory
Methods inherited from class org.springframework.aop.framework.AdvisedSupport
addAdvice, addAdvice, addAdvisor, addAdvisor, addAdvisors, addAdvisors, addAllAdvisors, addInterface, adviceIncluded, copyConfigurationFrom, copyConfigurationFrom, countAdvicesOfType, getAdvisorChainFactory, getAdvisors, getAdvisorsInternal, getInterceptorsAndDynamicInterceptionAdvice, getProxiedInterfaces, getTargetClass, getTargetSource, indexOf, indexOf, isInterfaceProxied, isPreFiltered, removeAdvice, removeAdvisor, removeAdvisor, removeInterface, replaceAdvisor, setAdvisorChainFactory, setInterfaces, setPreFiltered, setTarget, setTargetClass, setTargetSource, toProxyConfigString, toString, updateAdvisorArray
Methods inherited from class org.springframework.aop.framework.ProxyConfig
copyFrom, isExposeProxy, isFrozen, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setFrozen, setOpaque, setOptimize, setProxyTargetClass
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.aop.framework.Advised
isExposeProxy, isFrozen, isProxyTargetClass, setExposeProxy

Constructor Detail

AspectJProxyFactory

public AspectJProxyFactory()
Create a new AspectJProxyFactory.

AspectJProxyFactory

public AspectJProxyFactory(Object target)
Create a new AspectJProxyFactory.

Will proxy all interfaces that the given target implements.

Parameters:
target - the target object to be proxied

AspectJProxyFactory

public AspectJProxyFactory(Class[] interfaces)
Create a new AspectJProxyFactory. No target, only interfaces. Must add interceptors.

Method Detail

addAspect

public void addAspect(Object aspectInstance)
Add the supplied aspect instance to the chain. The type of the aspect instance supplied must be a singleton aspect. True singleton lifecycle is not honoured when using this method - the caller is responsible for managing the lifecycle of any aspects added in this way.

Parameters:
aspectInstance - the AspectJ aspect instance

addAspect

public void addAspect(Class aspectClass)
Add an aspect of the supplied type to the end of the advice chain.

Parameters:
aspectClass - the AspectJ aspect class

getProxy

public <T> T getProxy()
Create a new proxy according to the settings in this factory.

Can be called repeatedly. Effect will vary if we've added or removed interfaces. Can add and remove interceptors.

Uses a default class loader: Usually, the thread context class loader (if necessary for proxy creation).

Returns:
the new proxy

getProxy

public <T> T getProxy(ClassLoader classLoader)
Create a new proxy according to the settings in this factory.

Can be called repeatedly. Effect will vary if we've added or removed interfaces. Can add and remove interceptors.

Uses the given class loader (if necessary for proxy creation).

Parameters:
classLoader - the class loader to create the proxy with
Returns:
the new proxy
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AspectMetadata

org.springframework.aop.aspectj.annotation
Class AspectMetadata

java.lang.Object
    extended by  org.springframework.aop.aspectj.annotation.AspectMetadata

public class AspectMetadata
extends Object

Metadata for an AspectJ aspect class, with an additional Spring AOP pointcut for the per clause.

Uses AspectJ 5 AJType reflection API, so is only supported on Java 5. Enables us to work with different AspectJ instantiation models such as "singleton", "pertarget" and "perthis".

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller
See Also:
AspectJExpressionPointcut

Constructor Summary
AspectMetadata(Class<?> aspectClass, String aspectName)
Create a new AspectMetadata instance for the given aspect class.
Method Summary
org.aspectj.lang.reflect.AjType | getAjType() Return AspectJ reflection information.
Class | getAspectClass() Return the aspect class.
String | getAspectName() Return the aspect class.
Pointcut | getPerClausePointcut() Return a Spring pointcut expression for a singleton aspect.
boolean | isLazilyInstantiated() Return whether the aspect needs to be lazily instantiated.
boolean | isPerThisOrPerTarget() Return whether the aspect is defined as "perthis" or "pertarget".
boolean | isPerTypeWithin() Return whether the aspect is defined as "pertypewithin".
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AspectMetadata

public AspectMetadata(Class<?> aspectClass,
                      String aspectName)
Create a new AspectMetadata instance for the given aspect class.

Parameters:
aspectClass - the aspect class
aspectName - the name of the aspect
Method Detail

getAjType

public org.aspectj.lang.reflect.AjType getAjType()
Return AspectJ reflection information.

getAspectClass

public Class getAspectClass()
Return the aspect class.

getAspectName

public String getAspectName()
Return the aspect class.

getPerClausePointcut

public Pointcut getPerClausePointcut()
Return a Spring pointcut expression for a singleton aspect. (e.g. Pointcut.TRUE if it's a singleton).

isPerThisOrPerTarget

public boolean isPerThisOrPerTarget()
Return whether the aspect is defined as "perthis" or "pertarget".

isPerTypeWithin

public boolean isPerTypeWithin()
Return whether the aspect is defined as "pertypewithin".

isLazilyInstantiated

public boolean isLazilyInstantiated()
Return whether the aspect needs to be lazily instantiated.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanFactoryAspectInstanceFactory

org.springframework.aop.aspectj.annotation
Class BeanFactoryAspectInstanceFactory

java.lang.Object
    extended by  org.springframework.aop.aspectj.annotation.BeanFactoryAspectInstanceFactory
All Implemented Interfaces:
MetadataAwareAspectInstanceFactory, AspectInstanceFactory, Ordered
Direct Known Subclasses:
PrototypeAspectInstanceFactory
public class BeanFactoryAspectInstanceFactory
extends Object
implements MetadataAwareAspectInstanceFactory

AspectInstanceFactory implementation backed by a Spring BeanFactory.

Note that this may instantiate multiple times if using a prototype, which probably won't give the semantics you expect. Use a LazySingletonAspectInstanceFactoryDecorator to wrap this to ensure only one new aspect comes back.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller
See Also:
BeanFactory, LazySingletonAspectInstanceFactoryDecorator

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
BeanFactoryAspectInstanceFactory(BeanFactory beanFactory, String name)
Create a BeanFactoryAspectInstanceFactory.
BeanFactoryAspectInstanceFactory(BeanFactory beanFactory, String name, Class type)
Create a BeanFactoryAspectInstanceFactory, providing a type that AspectJ should introspect to create AJType metadata.
Method Summary
ClassLoader | getAspectClassLoader() Expose the aspect class loader that this factory uses.
Object | getAspectInstance() Create an instance of this factory's aspect.
AspectMetadata | getAspectMetadata() Return the AspectJ AspectMetadata for this factory's aspect.
int | getOrder() Determine the order for this factory's target aspect, either an instance-specific order expressed through implementing the Ordered interface (only checked for singleton beans), or an order expressed through the Order annotation at the class level.
String | toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

BeanFactoryAspectInstanceFactory

public BeanFactoryAspectInstanceFactory(BeanFactory beanFactory,
                                        String name)
Create a BeanFactoryAspectInstanceFactory. AspectJ will be called to introspect to create AJType metadata using the type returned for the given bean name from the BeanFactory.

Parameters:
beanFactory - BeanFactory to obtain instance(s) from
name - name of the bean

BeanFactoryAspectInstanceFactory

public BeanFactoryAspectInstanceFactory(BeanFactory beanFactory,
                                        String name,
                                        Class type)
Create a BeanFactoryAspectInstanceFactory, providing a type that AspectJ should introspect to create AJType metadata. Use if the BeanFactory may consider the type to be a subclass (as when using CGLIB), and the information should relate to a superclass.

Parameters:
beanFactory - BeanFactory to obtain instance(s) from
name - the name of the bean
type - the type that should be introspected by AspectJ
Method Detail

getAspectInstance

public Object getAspectInstance()
Description copied from interface: AspectInstanceFactory
Create an instance of this factory's aspect.

Specified by:
getAspectInstance in interface AspectInstanceFactory
Returns:
the aspect instance (never null)

getAspectClassLoader

public ClassLoader getAspectClassLoader()
Description copied from interface: AspectInstanceFactory
Expose the aspect class loader that this factory uses.

Specified by:
getAspectClassLoader in interface AspectInstanceFactory
Returns:
the aspect class loader (never null)

getAspectMetadata

public AspectMetadata getAspectMetadata()
Description copied from interface: MetadataAwareAspectInstanceFactory
Return the AspectJ AspectMetadata for this factory's aspect.

Specified by:
getAspectMetadata in interface MetadataAwareAspectInstanceFactory
Returns:
the aspect metadata

getOrder

public int getOrder()
Determine the order for this factory's target aspect, either an instance-specific order expressed through implementing the Ordered interface (only checked for singleton beans), or an order expressed through the Order annotation at the class level.

Specified by:
getOrder in interface Ordered
Returns:
the order value
See Also:
Ordered, Order

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanFactoryAspectJAdvisorsBuilder

org.springframework.aop.aspectj.annotation
Class BeanFactoryAspectJAdvisorsBuilder

java.lang.Object
    extended by  org.springframework.aop.aspectj.annotation.BeanFactoryAspectJAdvisorsBuilder

public class BeanFactoryAspectJAdvisorsBuilder
extends Object

Helper for retrieving @AspectJ beans from a BeanFactory and building Spring Advisors based on them, for use with auto-proxying.

Since:
2.0.2
Author:
Juergen Hoeller
See Also:
AnnotationAwareAspectJAutoProxyCreator

Constructor Summary
BeanFactoryAspectJAdvisorsBuilder(ListableBeanFactory beanFactory)
Create a new BeanFactoryAspectJAdvisorsBuilder for the given BeanFactory.
BeanFactoryAspectJAdvisorsBuilder(ListableBeanFactory beanFactory, AspectJAdvisorFactory advisorFactory)
Create a new BeanFactoryAspectJAdvisorsBuilder for the given BeanFactory.
Method Summary
List<Advisor> | buildAspectJAdvisors() Look for AspectJ-annotated aspect beans in the current bean factory, and return to a list of Spring AOP Advisors representing them.
protected boolean | isEligibleBean(String beanName) Return whether the aspect bean with the given name is eligible.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BeanFactoryAspectJAdvisorsBuilder

public BeanFactoryAspectJAdvisorsBuilder(ListableBeanFactory beanFactory)
Create a new BeanFactoryAspectJAdvisorsBuilder for the given BeanFactory.

Parameters:
beanFactory - the ListableBeanFactory to scan

BeanFactoryAspectJAdvisorsBuilder

public BeanFactoryAspectJAdvisorsBuilder(ListableBeanFactory beanFactory,
                                         AspectJAdvisorFactory advisorFactory)
Create a new BeanFactoryAspectJAdvisorsBuilder for the given BeanFactory.

Parameters:
beanFactory - the ListableBeanFactory to scan
advisorFactory - the AspectJAdvisorFactory to build each Advisor with
Method Detail

buildAspectJAdvisors

public List<Advisor> buildAspectJAdvisors()
Look for AspectJ-annotated aspect beans in the current bean factory, and return to a list of Spring AOP Advisors representing them.

Creates a Spring Advisor for each AspectJ advice method.

Returns:
the list of Advisor beans
See Also:
isEligibleBean(java.lang.String)

isEligibleBean

protected boolean isEligibleBean(String beanName)
Return whether the aspect bean with the given name is eligible.

Parameters:
beanName - the name of the aspect bean
Returns:
whether the bean is eligible
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LazySingletonAspectInstanceFactoryDecorator

org.springframework.aop.aspectj.annotation
Class LazySingletonAspectInstanceFactoryDecorator

java.lang.Object
    extended by  org.springframework.aop.aspectj.annotation.LazySingletonAspectInstanceFactoryDecorator
All Implemented Interfaces:
MetadataAwareAspectInstanceFactory, AspectInstanceFactory, Ordered
public class LazySingletonAspectInstanceFactoryDecorator
extends Object
implements MetadataAwareAspectInstanceFactory

Decorator to cause a MetadataAwareAspectInstanceFactory to instantiate only once.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
LazySingletonAspectInstanceFactoryDecorator(MetadataAwareAspectInstanceFactory maaif)
Create a new lazily initializing decorator for the given AspectInstanceFactory.
Method Summary
ClassLoader | getAspectClassLoader() Expose the aspect class loader that this factory uses.
Object | getAspectInstance() Create an instance of this factory's aspect.
AspectMetadata | getAspectMetadata() Return the AspectJ AspectMetadata for this factory's aspect.
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
boolean | isMaterialized()
String | toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

LazySingletonAspectInstanceFactoryDecorator

public LazySingletonAspectInstanceFactoryDecorator(MetadataAwareAspectInstanceFactory maaif)
Create a new lazily initializing decorator for the given AspectInstanceFactory.

Parameters:
maaif - the MetadataAwareAspectInstanceFactory to decorate
Method Detail

getAspectInstance

public Object getAspectInstance()
Description copied from interface: AspectInstanceFactory
Create an instance of this factory's aspect.

Specified by:
getAspectInstance in interface AspectInstanceFactory
Returns:
the aspect instance (never null)

isMaterialized

public boolean isMaterialized()

getAspectClassLoader

public ClassLoader getAspectClassLoader()
Description copied from interface: AspectInstanceFactory
Expose the aspect class loader that this factory uses.

Specified by:
getAspectClassLoader in interface AspectInstanceFactory
Returns:
the aspect class loader (never null)

getAspectMetadata

public AspectMetadata getAspectMetadata()
Description copied from interface: MetadataAwareAspectInstanceFactory
Return the AspectJ AspectMetadata for this factory's aspect.

Specified by:
getAspectMetadata in interface MetadataAwareAspectInstanceFactory
Returns:
the aspect metadata

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PrototypeAspectInstanceFactory

org.springframework.aop.aspectj.annotation
Class PrototypeAspectInstanceFactory

java.lang.Object
    extended by  org.springframework.aop.aspectj.annotation.BeanFactoryAspectInstanceFactory
        extended by  org.springframework.aop.aspectj.annotation.PrototypeAspectInstanceFactory
All Implemented Interfaces:
MetadataAwareAspectInstanceFactory, AspectInstanceFactory, Ordered
public class PrototypeAspectInstanceFactory
extends BeanFactoryAspectInstanceFactory

AspectInstanceFactory backed by a BeanFactory-provided prototype, enforcing prototype semantics.

Note that this may instantiate multiple times, which probably won't give the semantics you expect. Use a LazySingletonAspectInstanceFactoryDecorator to wrap this to ensure only one new aspect comes back.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller
See Also:
BeanFactory, LazySingletonAspectInstanceFactoryDecorator

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
PrototypeAspectInstanceFactory(BeanFactory beanFactory, String name)
Create a PrototypeAspectInstanceFactory.
Method Summary
Methods inherited from class org.springframework.aop.aspectj.annotation.BeanFactoryAspectInstanceFactory
getAspectClassLoader, getAspectInstance, getAspectMetadata, getOrder, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

PrototypeAspectInstanceFactory

public PrototypeAspectInstanceFactory(BeanFactory beanFactory,
                                      String name)
Create a PrototypeAspectInstanceFactory. AspectJ will be called to introspect to create AJType metadata using the type returned for the given bean name from the BeanFactory.

Parameters:
beanFactory - the BeanFactory to obtain instance(s) from
name - the name of the bean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ReflectiveAspectJAdvisorFactory

org.springframework.aop.aspectj.annotation
Class ReflectiveAspectJAdvisorFactory

java.lang.Object
    extended by  org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory
        extended by  org.springframework.aop.aspectj.annotation.ReflectiveAspectJAdvisorFactory
All Implemented Interfaces:
AspectJAdvisorFactory
public class ReflectiveAspectJAdvisorFactory
extends AbstractAspectJAdvisorFactory

Factory that can create Spring AOP Advisors given AspectJ classes from classes honoring the AspectJ 5 annotation syntax, using reflection to invoke the corresponding advice methods.

Since:
2.0
Author:
Rod Johnson, Adrian Colyer, Juergen Hoeller, Ramnivas Laddad

Nested Class Summary
protected static class ReflectiveAspectJAdvisorFactory.SyntheticInstantiationAdvisor
Synthetic advisor that instantiates the aspect.
Nested classes/interfaces inherited from class org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory
AbstractAspectJAdvisorFactory.AspectJAnnotation<A extends Annotation>, AbstractAspectJAdvisorFactory.AspectJAnnotationType
Field Summary
Fields inherited from class org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory
ASPECTJ_ANNOTATION_PARAMETER_NAME_DISCOVERER, logger, parameterNameDiscoverer
Constructor Summary
ReflectiveAspectJAdvisorFactory()
Method Summary
Advice | getAdvice(Method candidateAdviceMethod, AspectJExpressionPointcut ajexp, MetadataAwareAspectInstanceFactory aif, int declarationOrderInAspect, String aspectName) Build a Spring AOP Advice for the given AspectJ advice method.
Advisor | getAdvisor(Method candidateAdviceMethod, MetadataAwareAspectInstanceFactory aif, int declarationOrderInAspect, String aspectName) Build a Spring AOP Advisor for the given AspectJ advice method.
List<Advisor> | getAdvisors(MetadataAwareAspectInstanceFactory maaif) Build Spring AOP Advisors for all annotated At-AspectJ methods on the specified aspect instance.
Methods inherited from class org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory
createPointcutExpression, findAspectJAnnotationOnMethod, isAspect, validate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ReflectiveAspectJAdvisorFactory

public ReflectiveAspectJAdvisorFactory()
Method Detail

getAdvisors

public List<Advisor> getAdvisors(MetadataAwareAspectInstanceFactory maaif)
Description copied from interface: AspectJAdvisorFactory
Build Spring AOP Advisors for all annotated At-AspectJ methods on the specified aspect instance.

Parameters:
maaif - the aspect instance factory (not the aspect instance itself in order to avoid eager instantiation)
Returns:
a list of advisors for this class

getAdvisor

public Advisor getAdvisor(Method candidateAdviceMethod,
                          MetadataAwareAspectInstanceFactory aif,
                          int declarationOrderInAspect,
                          String aspectName)
Description copied from interface: AspectJAdvisorFactory
Build a Spring AOP Advisor for the given AspectJ advice method.

Parameters:
candidateAdviceMethod - the candidate advice method
aif - the aspect instance factory
declarationOrderInAspect - the declaration order within the aspect
aspectName - the name of the aspect
Returns:
null if the method is not an AspectJ advice method or if it is a pointcut that will be used by other advice but will not create a Spring advice in its own right

getAdvice

public Advice getAdvice(Method candidateAdviceMethod,
                        AspectJExpressionPointcut ajexp,
                        MetadataAwareAspectInstanceFactory aif,
                        int declarationOrderInAspect,
                        String aspectName)
Description copied from interface: AspectJAdvisorFactory
Build a Spring AOP Advice for the given AspectJ advice method.

Parameters:
candidateAdviceMethod - the candidate advice method
ajexp - the corresponding AspectJ expression pointcut
aif - the aspect instance factory
declarationOrderInAspect - the declaration order within the aspect
aspectName - the name of the aspect
Returns:
null if the method is not an AspectJ advice method or if it is a pointcut that will be used by other advice but will not create a Spring advice in its own right
See Also:
AspectJAroundAdvice, AspectJMethodBeforeAdvice, AspectJAfterAdvice, AspectJAfterReturningAdvice, AspectJAfterThrowingAdvice
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ReflectiveAspectJAdvisorFactory.SyntheticInstantiationAdvisor

org.springframework.aop.aspectj.annotation
Class ReflectiveAspectJAdvisorFactory.SyntheticInstantiationAdvisor

java.lang.Object
    extended by  org.springframework.aop.support.AbstractPointcutAdvisor
        extended by  org.springframework.aop.support.AbstractGenericPointcutAdvisor
            extended by  org.springframework.aop.support.DefaultPointcutAdvisor
                extended by  org.springframework.aop.aspectj.annotation.ReflectiveAspectJAdvisorFactory.SyntheticInstantiationAdvisor
All Implemented Interfaces:
Serializable, Advisor, PointcutAdvisor, Ordered
Enclosing class:
ReflectiveAspectJAdvisorFactory
protected static class ReflectiveAspectJAdvisorFactory.SyntheticInstantiationAdvisor
extends DefaultPointcutAdvisor

Synthetic advisor that instantiates the aspect. Triggered by per-clause pointcut on non-singleton aspect. The advice has no effect.

See Also:
Serialized Form

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
ReflectiveAspectJAdvisorFactory.SyntheticInstantiationAdvisor(MetadataAwareAspectInstanceFactory aif)
Method Summary
Methods inherited from class org.springframework.aop.support.DefaultPointcutAdvisor
getPointcut, setPointcut, toString
Methods inherited from class org.springframework.aop.support.AbstractGenericPointcutAdvisor
getAdvice, setAdvice
Methods inherited from class org.springframework.aop.support.AbstractPointcutAdvisor
equals, getOrder, hashCode, isPerInstance, setOrder
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

ReflectiveAspectJAdvisorFactory.SyntheticInstantiationAdvisor

public ReflectiveAspectJAdvisorFactory.SyntheticInstantiationAdvisor(MetadataAwareAspectInstanceFactory aif)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleMetadataAwareAspectInstanceFactory

org.springframework.aop.aspectj.annotation
Class SimpleMetadataAwareAspectInstanceFactory

java.lang.Object
    extended by  org.springframework.aop.aspectj.SimpleAspectInstanceFactory
        extended by  org.springframework.aop.aspectj.annotation.SimpleMetadataAwareAspectInstanceFactory
All Implemented Interfaces:
MetadataAwareAspectInstanceFactory, AspectInstanceFactory, Ordered
public class SimpleMetadataAwareAspectInstanceFactory
extends SimpleAspectInstanceFactory
implements MetadataAwareAspectInstanceFactory

Implementation of MetadataAwareAspectInstanceFactory that creates a new instance of the specified aspect class for every SimpleAspectInstanceFactory.getAspectInstance() call.

Since:
2.0.4
Author:
Juergen Hoeller

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
SimpleMetadataAwareAspectInstanceFactory(Class aspectClass, String aspectName)
Create a new SimpleMetadataAwareAspectInstanceFactory for the given aspect class.
Method Summary
AspectMetadata | getAspectMetadata() Return the AspectJ AspectMetadata for this factory's aspect.
protected int | getOrderForAspectClass(Class<?> aspectClass) Determine a fallback order for the case that the aspect instance does not express an instance-specific order through implementing the Ordered interface.
Methods inherited from class org.springframework.aop.aspectj.SimpleAspectInstanceFactory
getAspectClass, getAspectClassLoader, getAspectInstance, getOrder
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.aop.aspectj.AspectInstanceFactory
getAspectClassLoader, getAspectInstance
Methods inherited from interface org.springframework.core.Ordered
getOrder

Constructor Detail

SimpleMetadataAwareAspectInstanceFactory

public SimpleMetadataAwareAspectInstanceFactory(Class aspectClass,
                                                String aspectName)
Create a new SimpleMetadataAwareAspectInstanceFactory for the given aspect class.

Parameters:
aspectClass - the aspect class
aspectName - the aspect name
Method Detail

getAspectMetadata

public final AspectMetadata getAspectMetadata()
Description copied from interface: MetadataAwareAspectInstanceFactory
Return the AspectJ AspectMetadata for this factory's aspect.

Specified by:
getAspectMetadata in interface MetadataAwareAspectInstanceFactory
Returns:
the aspect metadata

getOrderForAspectClass

protected int getOrderForAspectClass(Class<?> aspectClass)
Determine a fallback order for the case that the aspect instance does not express an instance-specific order through implementing the Ordered interface.

The default implementation simply returns Ordered.LOWEST_PRECEDENCE.

Overrides:
getOrderForAspectClass in class SimpleAspectInstanceFactory
Parameters:
aspectClass - the aspect class
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SingletonMetadataAwareAspectInstanceFactory

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.aop.aspectj.annotation
Class SingletonMetadataAwareAspectInstanceFactory

java.lang.Object
    extended by  org.springframework.aop.aspectj.SingletonAspectInstanceFactory
        extended by  org.springframework.aop.aspectj.annotation.SingletonMetadataAwareAspectInstanceFactory
All Implemented Interfaces:
MetadataAwareAspectInstanceFactory, AspectInstanceFactory, Ordered
public class SingletonMetadataAwareAspectInstanceFactory
extends SingletonAspectInstanceFactory
implements MetadataAwareAspectInstanceFactory

Implementation of MetadataAwareAspectInstanceFactory that is backed by a specified singleton object, returning the same instance for every SingletonAspectInstanceFactory.getAspectInstance() call.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller
See Also:
SimpleMetadataAwareAspectInstanceFactory

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
SingletonMetadataAwareAspectInstanceFactory(Object aspectInstance, String aspectName)
Create a new SingletonMetadataAwareAspectInstanceFactory for the given aspect.
Method Summary
AspectMetadata | getAspectMetadata() Return the AspectJ AspectMetadata for this factory's aspect.
protected int | getOrderForAspectClass(Class<?> aspectClass) Check whether the aspect class carries an Order annotation, falling back to Ordered.LOWEST_PRECEDENCE.
Methods inherited from class org.springframework.aop.aspectj.SingletonAspectInstanceFactory
getAspectClassLoader, getAspectInstance, getOrder
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.aop.aspectj.AspectInstanceFactory
getAspectClassLoader, getAspectInstance
Methods inherited from interface org.springframework.core.Ordered
getOrder

Constructor Detail

SingletonMetadataAwareAspectInstanceFactory

public SingletonMetadataAwareAspectInstanceFactory(Object aspectInstance,
                                                   String aspectName)
Create a new SingletonMetadataAwareAspectInstanceFactory for the given aspect.

Parameters:
aspectInstance - the singleton aspect instance
aspectName - the name of the aspect
Method Detail

getAspectMetadata

public final AspectMetadata getAspectMetadata()
Description copied from interface: MetadataAwareAspectInstanceFactory
Return the AspectJ AspectMetadata for this factory's aspect.

Specified by:
getAspectMetadata in interface MetadataAwareAspectInstanceFactory
Returns:
the aspect metadata

getOrderForAspectClass

protected int getOrderForAspectClass(Class<?> aspectClass)
Check whether the aspect class carries an Order annotation, falling back to Ordered.LOWEST_PRECEDENCE.

Overrides:
getOrderForAspectClass in class SingletonAspectInstanceFactory
Parameters:
aspectClass - the aspect class
See Also:
Order
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


NotAnAtAspectException

org.springframework.aop.aspectj.annotation
Class NotAnAtAspectException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.aop.framework.AopConfigException
                        extended by  org.springframework.aop.aspectj.annotation.NotAnAtAspectException
All Implemented Interfaces:
Serializable
public class NotAnAtAspectException
extends AopConfigException

Extension of AopConfigException thrown when trying to perform an advisor generation operation on a class that is not an AspectJ annotation-style aspect.

Since:
2.0
Author:
Rod Johnson
See Also:
Serialized Form

Constructor Summary
NotAnAtAspectException(Class<?> nonAspectClass)
Create a new NotAnAtAspectException for the given class.
Method Summary
 Class<?> getNonAspectClass()
Returns the offending class.
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

NotAnAtAspectException

public NotAnAtAspectException(Class<?> nonAspectClass)
Create a new NotAnAtAspectException for the given class.

Parameters:
nonAspectClass - the offending class
Method Detail

getNonAspectClass

public Class<?> getNonAspectClass()
Returns the offending class.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.aop.aspectj.autoproxy

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.aop.aspectj.autoproxy

Base classes enabling auto-proxying based on AspectJ.

See:
Description

Class Summary
AspectJAwareAdvisorAutoProxyCreator AbstractAdvisorAutoProxyCreator subclass that exposes AspectJ's invocation context and understands AspectJ's rules for advice precedence when multiple pieces of advice come from the same aspect.

Package org.springframework.aop.aspectj.autoproxy Description

Base classes enabling auto-proxying based on AspectJ. Support for AspectJ annotation aspects resides in the "aspectj.annotation" package.


org.springframework.aop.aspectj.autoproxy Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.aop.aspectj.autoproxy

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.aop.framework.ProxyConfig (implements java.io.Serializable)
      • org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator (implements org.springframework.aop.framework.AopInfrastructureBean, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.core.Ordered, org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor)
        • org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
          • org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator


AspectJAwareAdvisorAutoProxyCreator

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.aop.aspectj.autoproxy
Class AspectJAwareAdvisorAutoProxyCreator

java.lang.Object
    extended by  org.springframework.aop.framework.ProxyConfig
        extended by  org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
            extended by  org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
                extended by  org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator
All Implemented Interfaces:
Serializable, AopInfrastructureBean, BeanClassLoaderAware, BeanFactoryAware, BeanPostProcessor, InstantiationAwareBeanPostProcessor, SmartInstantiationAwareBeanPostProcessor, Ordered
Direct Known Subclasses:
AnnotationAwareAspectJAutoProxyCreator
public class AspectJAwareAdvisorAutoProxyCreator
extends AbstractAdvisorAutoProxyCreator

AbstractAdvisorAutoProxyCreator subclass that exposes AspectJ's invocation context and understands AspectJ's rules for advice precedence when multiple pieces of advice come from the same aspect.

Since:
2.0
Author:
Adrian Colyer, Juergen Hoeller, Ramnivas Laddad
See Also:
Serialized Form

Field Summary
Fields inherited from class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
DO_NOT_PROXY, logger, PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AspectJAwareAdvisorAutoProxyCreator()
Method Summary
protected void | extendAdvisors(List<Advisor> candidateAdvisors) Adds an ExposeInvocationInterceptor to the beginning of the advice chain.
protected boolean | shouldSkip(Class beanClass, String beanName) Subclasses should override this method to return true if the given bean should not be considered for auto-proxying by this post-processor.
protected List<Advisor> | sortAdvisors(List<Advisor> advisors) Sort the rest by AspectJ precedence.
Methods inherited from class org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
advisorsPreFiltered, findAdvisorsThatCanApply, findCandidateAdvisors, findEligibleAdvisors, getAdvicesAndAdvisorsForBean, initBeanFactory, isEligibleAdvisorBean, setBeanFactory
Methods inherited from class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
buildAdvisors, createProxy, customizeProxyFactory, determineCandidateConstructors, getBeanFactory, getCacheKey, getCustomTargetSource, getEarlyBeanReference, getOrder, isFrozen, isInfrastructureClass, postProcessAfterInitialization, postProcessAfterInstantiation, postProcessBeforeInitialization, postProcessBeforeInstantiation, postProcessPropertyValues, predictBeanType, setAdvisorAdapterRegistry, setApplyCommonInterceptorsFirst, setBeanClassLoader, setCustomTargetSourceCreators, setFrozen, setInterceptorNames, setOrder, setProxyClassLoader, shouldProxyTargetClass, wrapIfNecessary
Methods inherited from class org.springframework.aop.framework.ProxyConfig
copyFrom, isExposeProxy, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setOpaque, setOptimize, setProxyTargetClass, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AspectJAwareAdvisorAutoProxyCreator

public AspectJAwareAdvisorAutoProxyCreator()
Method Detail

sortAdvisors

protected List<Advisor> sortAdvisors(List<Advisor> advisors)
Sort the rest by AspectJ precedence. If two pieces of advice have come from the same aspect they will have the same order. Advice from the same aspect is then further ordered according to the following rules:
  • if either of the pair is after advice, then the advice declared last gets highest precedence (runs last)
  • otherwise the advice declared first gets highest precedence (runs first)

Important: Advisors are sorted in precedence order, from highest precedence to lowest. "On the way in" to a join point, the highest precedence advisor should run first. "On the way out" of a join point, the highest precedence advisor should run last.

Overrides:
sortAdvisors in class AbstractAdvisorAutoProxyCreator
Parameters:
advisors - the source List of Advisors
Returns:
the sorted List of Advisors
See Also:
Ordered, OrderComparator

extendAdvisors

protected void extendAdvisors(List<Advisor> candidateAdvisors)
Adds an ExposeInvocationInterceptor to the beginning of the advice chain. These additional advices are needed when using AspectJ expression pointcuts and when using AspectJ-style advice.

Overrides:
extendAdvisors in class AbstractAdvisorAutoProxyCreator
Parameters:
candidateAdvisors - Advisors that have already been identified as applying to a given bean

shouldSkip

protected boolean shouldSkip(Class beanClass,
                             String beanName)
Description copied from class: AbstractAutoProxyCreator
Subclasses should override this method to return true if the given bean should not be considered for auto-proxying by this post-processor.

Sometimes we need to be able to avoid this happening if it will lead to a circular reference. This implementation returns false.

Overrides:
shouldSkip in class AbstractAutoProxyCreator
Parameters:
beanClass - the class of the bean
beanName - the name of the bean
Returns:
whether to skip the given bean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.aop.config

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.aop.config

Support package for declarative AOP configuration, with XML schema being the primary configuration format.

See:
Description

Class Summary
AbstractInterceptorDrivenBeanDefinitionDecorator | Base implementation for BeanDefinitionDecorators wishing to add an interceptor to the resulting bean.
AdviceEntry | ParseState entry representing an advice element.
AdvisorComponentDefinition | ComponentDefinition that bridges the gap between the advisor bean definition configured by the <aop:advisor> tag and the component definition infrastructure.
AdvisorEntry | ParseState entry representing an advisor.
AopConfigUtils | Utility class for handling registration of AOP auto-proxy creators.
AopNamespaceHandler | NamespaceHandler for the aop namespace.
AopNamespaceUtils | Utility class for handling registration of auto-proxy creators used internally by the 'aop' namespace tags.
AspectComponentDefinition | ComponentDefinition that holds an aspect definition, including its nested pointcuts.
AspectEntry | ParseState entry representing an aspect.
MethodLocatingFactoryBean | FactoryBean implementation that locates a Method on a specified bean.
PointcutComponentDefinition | ComponentDefinition implementation that holds a pointcut definition.
PointcutEntry | ParseState entry representing a pointcut.
SimpleBeanFactoryAwareAspectInstanceFactory | Implementation of AspectInstanceFactory that locates the aspect from the BeanFactory using a configured bean name.

Package org.springframework.aop.config Description

Support package for declarative AOP configuration, with XML schema being the primary configuration format.


org.springframework.aop.config Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.aop.config

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.beans.factory.parsing.AbstractComponentDefinition (implements org.springframework.beans.factory.parsing.ComponentDefinition)
      • org.springframework.aop.config.AdvisorComponentDefinition
      • org.springframework.beans.factory.parsing.CompositeComponentDefinition
        • org.springframework.aop.config.AspectComponentDefinition
      • org.springframework.aop.config.PointcutComponentDefinition
    • org.springframework.aop.config.AbstractInterceptorDrivenBeanDefinitionDecorator (implements org.springframework.beans.factory.xml.BeanDefinitionDecorator)
    • org.springframework.aop.config.AdviceEntry (implements org.springframework.beans.factory.parsing.ParseState.Entry)
    • org.springframework.aop.config.AdvisorEntry (implements org.springframework.beans.factory.parsing.ParseState.Entry)
    • org.springframework.aop.config.AopConfigUtils
    • org.springframework.aop.config.AopNamespaceUtils
    • org.springframework.aop.config.AspectEntry (implements org.springframework.beans.factory.parsing.ParseState.Entry)
    • org.springframework.aop.config.MethodLocatingFactoryBean (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.FactoryBean<T>)
    • org.springframework.beans.factory.xml.NamespaceHandlerSupport (implements org.springframework.beans.factory.xml.NamespaceHandler)
      • org.springframework.aop.config.AopNamespaceHandler
    • org.springframework.aop.config.PointcutEntry (implements org.springframework.beans.factory.parsing.ParseState.Entry)
    • org.springframework.aop.config.SimpleBeanFactoryAwareAspectInstanceFactory (implements org.springframework.aop.aspectj.AspectInstanceFactory, org.springframework.beans.factory.BeanFactoryAware)


AbstractInterceptorDrivenBeanDefinitionDecorator

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.aop.config
Class AbstractInterceptorDrivenBeanDefinitionDecorator

java.lang.Object
    extended by  org.springframework.aop.config.AbstractInterceptorDrivenBeanDefinitionDecorator
All Implemented Interfaces:
BeanDefinitionDecorator
public abstract class AbstractInterceptorDrivenBeanDefinitionDecorator
extends Object
implements BeanDefinitionDecorator

Base implementation for BeanDefinitionDecorators wishing to add an interceptor to the resulting bean.

This base class controls the creation of the ProxyFactoryBean bean definition and wraps the original as an inner-bean definition for the target property of ProxyFactoryBean.

Chaining is correctly handled, ensuring that only one ProxyFactoryBean definition is created. If a previous BeanDefinitionDecorator already created the ProxyFactoryBean then the interceptor is simply added to the existing definition.

Subclasses have only to create the BeanDefinition to the interceptor that they wish to add.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
See Also:
MethodInterceptor

Constructor Summary
AbstractInterceptorDrivenBeanDefinitionDecorator()
Method Summary
protected abstract BeanDefinition | createInterceptorDefinition(Node node) Subclasses should implement this method to return the BeanDefinition for the interceptor they wish to apply to the bean being decorated.
BeanDefinitionHolder | decorate(Node node, BeanDefinitionHolder definitionHolder, ParserContext parserContext) Parse the specified Node (either an element or an attribute) and decorate the supplied BeanDefinition, returning the decorated definition.
protected String | getInterceptorNameSuffix(BeanDefinition interceptorDefinition)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractInterceptorDrivenBeanDefinitionDecorator

public AbstractInterceptorDrivenBeanDefinitionDecorator()
Method Detail

decorate

public final BeanDefinitionHolder decorate(Node node,
                                           BeanDefinitionHolder definitionHolder,
                                           ParserContext parserContext)
Description copied from interface: BeanDefinitionDecorator
Parse the specified Node (either an element or an attribute) and decorate the supplied BeanDefinition, returning the decorated definition.

Implementations may choose to return a completely new definition, which will replace the original definition in the resulting BeanFactory.

The supplied ParserContext can be used to register any additional beans needed to support the main definition.

Specified by:
decorate in interface BeanDefinitionDecorator

getInterceptorNameSuffix

protected String getInterceptorNameSuffix(BeanDefinition interceptorDefinition)

createInterceptorDefinition

protected abstract BeanDefinition createInterceptorDefinition(Node node)
Subclasses should implement this method to return the BeanDefinition for the interceptor they wish to apply to the bean being decorated.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AdviceEntry

org.springframework.aop.config
Class AdviceEntry

java.lang.Object
    extended by  org.springframework.aop.config.AdviceEntry
All Implemented Interfaces:
ParseState.Entry
public class AdviceEntry
extends Object
implements ParseState.Entry

ParseState entry representing an advice element.

Since:
2.0
Author:
Mark Fisher

Constructor Summary
AdviceEntry(String kind)
Creates a new instance of the AdviceEntry class.
Method Summary
 String toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AdviceEntry

public AdviceEntry(String kind)
Creates a new instance of the AdviceEntry class.

Parameters:
kind - the kind of advice represented by this entry (before, after, around, etc.)
Method Detail

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AdvisorComponentDefinition

org.springframework.aop.config
Class AdvisorComponentDefinition

java.lang.Object
    extended by  org.springframework.beans.factory.parsing.AbstractComponentDefinition
        extended by  org.springframework.aop.config.AdvisorComponentDefinition
All Implemented Interfaces:
BeanMetadataElement, ComponentDefinition
public class AdvisorComponentDefinition
extends AbstractComponentDefinition

ComponentDefinition that bridges the gap between the advisor bean definition configured by the <aop:advisor> tag and the component definition infrastructure.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller

Constructor Summary
AdvisorComponentDefinition(String advisorBeanName, BeanDefinition advisorDefinition)
AdvisorComponentDefinition(String advisorBeanName, BeanDefinition advisorDefinition, BeanDefinition pointcutDefinition)
Method Summary
 BeanDefinition[] getBeanDefinitions()
Returns an empty array.
 BeanReference[] getBeanReferences()
Returns an empty array.
 String getDescription()
Delegates to ComponentDefinition.getName().
 String getName()
Get the user-visible name of this ComponentDefinition.
 Object getSource()
Return the configuration source Object for this metadata element (may be null).
Methods inherited from class org.springframework.beans.factory.parsing.AbstractComponentDefinition
getInnerBeanDefinitions, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AdvisorComponentDefinition

public AdvisorComponentDefinition(String advisorBeanName,
                                  BeanDefinition advisorDefinition)

AdvisorComponentDefinition

public AdvisorComponentDefinition(String advisorBeanName,
                                  BeanDefinition advisorDefinition,
                                  BeanDefinition pointcutDefinition)
Method Detail

getName

public String getName()
Description copied from interface: ComponentDefinition
Get the user-visible name of this ComponentDefinition.

This should link back directly to the corresponding configuration data for this component in a given context.

getDescription

public String getDescription()
Description copied from class: AbstractComponentDefinition
Delegates to ComponentDefinition.getName().

Specified by:
getDescription in interface ComponentDefinition
Overrides:
getDescription in class AbstractComponentDefinition

getBeanDefinitions

public BeanDefinition[] getBeanDefinitions()
Description copied from class: AbstractComponentDefinition
Returns an empty array.

Specified by:
getBeanDefinitions in interface ComponentDefinition
Overrides:
getBeanDefinitions in class AbstractComponentDefinition
Returns:
the array of BeanDefinitions, or an empty array if none

getBeanReferences

public BeanReference[] getBeanReferences()
Description copied from class: AbstractComponentDefinition
Returns an empty array.

Specified by:
getBeanReferences in interface ComponentDefinition
Overrides:
getBeanReferences in class AbstractComponentDefinition
Returns:
the array of BeanReferences, or an empty array if none

getSource

public Object getSource()
Description copied from interface: BeanMetadataElement
Return the configuration source Object for this metadata element (may be null).

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AdvisorEntry

org.springframework.aop.config
Class AdvisorEntry

java.lang.Object
    extended by  org.springframework.aop.config.AdvisorEntry
All Implemented Interfaces:
ParseState.Entry
public class AdvisorEntry
extends Object
implements ParseState.Entry

ParseState entry representing an advisor.

Since:
2.0
Author:
Mark Fisher

Constructor Summary
AdvisorEntry(String name)
Creates a new instance of the AdvisorEntry class.
Method Summary
 String toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AdvisorEntry

public AdvisorEntry(String name)
Creates a new instance of the AdvisorEntry class.

Parameters:
name - the bean name of the advisor
Method Detail

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AopConfigUtils

org.springframework.aop.config
Class AopConfigUtils

java.lang.Object
    extended by  org.springframework.aop.config.AopConfigUtils

public abstract class AopConfigUtils
extends Object

Utility class for handling registration of AOP auto-proxy creators.

Only a single auto-proxy creator can be registered yet multiple concrete implementations are available. Therefore this class wraps a simple escalation protocol, allowing classes to request a particular auto-proxy creator and know that class, or a subclass thereof, will eventually be resident in the application context.

Since:
2.5
Author:
Rob Harrop, Juergen Hoeller, Mark Fisher
See Also:
AopNamespaceUtils

Field Summary
static String AUTO_PROXY_CREATOR_BEAN_NAME
The bean name of the internally managed auto-proxy creator.
Constructor Summary
AopConfigUtils()
Method Summary
static void | forceAutoProxyCreatorToUseClassProxying(BeanDefinitionRegistry registry)
static BeanDefinition | registerAspectJAnnotationAutoProxyCreatorIfNecessary(BeanDefinitionRegistry registry)
static BeanDefinition | registerAspectJAnnotationAutoProxyCreatorIfNecessary(BeanDefinitionRegistry registry, Object source)
static BeanDefinition | registerAspectJAutoProxyCreatorIfNecessary(BeanDefinitionRegistry registry)
static BeanDefinition | registerAspectJAutoProxyCreatorIfNecessary(BeanDefinitionRegistry registry, Object source)
static BeanDefinition | registerAutoProxyCreatorIfNecessary(BeanDefinitionRegistry registry)
static BeanDefinition | registerAutoProxyCreatorIfNecessary(BeanDefinitionRegistry registry, Object source)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

AUTO_PROXY_CREATOR_BEAN_NAME

public static final String AUTO_PROXY_CREATOR_BEAN_NAME
The bean name of the internally managed auto-proxy creator.

See Also:
Constant Field Values
Constructor Detail

AopConfigUtils

public AopConfigUtils()
Method Detail

registerAutoProxyCreatorIfNecessary

public static BeanDefinition registerAutoProxyCreatorIfNecessary(BeanDefinitionRegistry registry)

registerAutoProxyCreatorIfNecessary

public static BeanDefinition registerAutoProxyCreatorIfNecessary(BeanDefinitionRegistry registry,
                                                                 Object source)

registerAspectJAutoProxyCreatorIfNecessary

public static BeanDefinition registerAspectJAutoProxyCreatorIfNecessary(BeanDefinitionRegistry registry)

registerAspectJAutoProxyCreatorIfNecessary

public static BeanDefinition registerAspectJAutoProxyCreatorIfNecessary(BeanDefinitionRegistry registry,
                                                                        Object source)

registerAspectJAnnotationAutoProxyCreatorIfNecessary

public static BeanDefinition registerAspectJAnnotationAutoProxyCreatorIfNecessary(BeanDefinitionRegistry registry)

registerAspectJAnnotationAutoProxyCreatorIfNecessary

public static BeanDefinition registerAspectJAnnotationAutoProxyCreatorIfNecessary(BeanDefinitionRegistry registry,
                                                                                Object source)

forceAutoProxyCreatorToUseClassProxying

public static void forceAutoProxyCreatorToUseClassProxying(BeanDefinitionRegistry registry)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AopNamespaceHandler

org.springframework.aop.config
Class AopNamespaceHandler

java.lang.Object
    extended by  org.springframework.beans.factory.xml.NamespaceHandlerSupport
        extended by  org.springframework.aop.config.AopNamespaceHandler
All Implemented Interfaces:
NamespaceHandler
public class AopNamespaceHandler
extends NamespaceHandlerSupport

NamespaceHandler for the aop namespace.

Provides a BeanDefinitionParser for the <aop:config> tag. A config tag can include nested pointcut, advisor and aspect tags.

The pointcut tag allows for creation of named AspectJExpressionPointcut beans using a simple syntax:

 <aop:pointcut id="getNameCalls" expression="execution(* *..ITestBean.getName(..))"/>

Using the advisor tag you can configure an Advisor and have it applied to all relevant beans in you BeanFactory automatically. The advisor tag supports both in-line and referenced Pointcuts:

 <aop:advisor id="getAgeAdvisor"
     pointcut="execution(* *..ITestBean.getAge(..))"
     advice-ref="getAgeCounter"/>

 <aop:advisor id="getNameAdvisor"
     pointcut-ref="getNameCalls"
     advice-ref="getNameCounter"/>

Since:
2.0
Author:
Rob Harrop, Adrian Colyer, Juergen Hoeller

Constructor Summary
AopNamespaceHandler()
Method Summary
 void init()
Register the BeanDefinitionParsers for the 'config', 'spring-configured', 'aspectj-autoproxy' and 'scoped-proxy' tags.
Methods inherited from class org.springframework.beans.factory.xml.NamespaceHandlerSupport
decorate, parse, registerBeanDefinitionDecorator, registerBeanDefinitionDecoratorForAttribute, registerBeanDefinitionParser
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AopNamespaceHandler

public AopNamespaceHandler()
Method Detail

init

public void init()
Register the BeanDefinitionParsers for the 'config', 'spring-configured', 'aspectj-autoproxy' and 'scoped-proxy' tags.

See Also:
NamespaceHandlerSupport.registerBeanDefinitionParser(String, BeanDefinitionParser)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AopNamespaceUtils

org.springframework.aop.config
Class AopNamespaceUtils

java.lang.Object
    extended by  org.springframework.aop.config.AopNamespaceUtils

public abstract class AopNamespaceUtils
extends Object

Utility class for handling registration of auto-proxy creators used internally by the 'aop' namespace tags.

Only a single auto-proxy creator can be registered and multiple tags may wish to register different concrete implementations. As such this class delegates to AopConfigUtils which wraps a simple escalation protocol. Therefore classes may request a particular auto-proxy creator and know that class, or a subclass thereof, will eventually be resident in the application context.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller, Mark Fisher
See Also:
AopConfigUtils

Field Summary
static String PROXY_TARGET_CLASS_ATTRIBUTE
The proxy-target-class attribute as found on AOP-related XML tags.
Constructor Summary
AopNamespaceUtils()
Method Summary
static void forceAutoProxyCreatorToUseClassProxying(BeanDefinitionRegistry registry)
Deprecated. since Spring 2.5, in favor of AopConfigUtils.forceAutoProxyCreatorToUseClassProxying(BeanDefinitionRegistry)
static void registerAspectJAnnotationAutoProxyCreatorIfNecessary(ParserContext parserContext, Element sourceElement)
static void registerAspectJAutoProxyCreatorIfNecessary(ParserContext parserContext, Element sourceElement)
static void registerAutoProxyCreatorIfNecessary(ParserContext parserContext, Element sourceElement)
static void registerAutoProxyCreatorIfNecessary(ParserContext parserContext, Object source)
Deprecated. since Spring 2.5, in favor of registerAutoProxyCreatorIfNecessary(ParserContext, Element) and AopConfigUtils.registerAutoProxyCreatorIfNecessary(BeanDefinitionRegistry, Object)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

PROXY_TARGET_CLASS_ATTRIBUTE

public static final String PROXY_TARGET_CLASS_ATTRIBUTE
The proxy-target-class attribute as found on AOP-related XML tags.

See Also:
Constant Field Values
Constructor Detail

AopNamespaceUtils

public AopNamespaceUtils()
Method Detail

registerAutoProxyCreatorIfNecessary

public static void registerAutoProxyCreatorIfNecessary(ParserContext parserContext,
                                                       Element sourceElement)

registerAspectJAutoProxyCreatorIfNecessary

public static void registerAspectJAutoProxyCreatorIfNecessary(ParserContext parserContext,
                                                              Element sourceElement)

registerAspectJAnnotationAutoProxyCreatorIfNecessary

public static void registerAspectJAnnotationAutoProxyCreatorIfNecessary(ParserContext parserContext,
                                                                        Element sourceElement)

registerAutoProxyCreatorIfNecessary

@Deprecated
public static void registerAutoProxyCreatorIfNecessary(ParserContext parserContext,
                                                                  Object source)
Deprecated. since Spring 2.5, in favor of registerAutoProxyCreatorIfNecessary(ParserContext, Element) and AopConfigUtils.registerAutoProxyCreatorIfNecessary(BeanDefinitionRegistry, Object)

forceAutoProxyCreatorToUseClassProxying

@Deprecated
public static void forceAutoProxyCreatorToUseClassProxying(BeanDefinitionRegistry registry)
Deprecated. since Spring 2.5, in favor of AopConfigUtils.forceAutoProxyCreatorToUseClassProxying(BeanDefinitionRegistry)

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AspectComponentDefinition

org.springframework.aop.config
Class AspectComponentDefinition

java.lang.Object
    extended by  org.springframework.beans.factory.parsing.AbstractComponentDefinition
        extended by  org.springframework.beans.factory.parsing.CompositeComponentDefinition
            extended by  org.springframework.aop.config.AspectComponentDefinition
All Implemented Interfaces:
BeanMetadataElement, ComponentDefinition
public class AspectComponentDefinition
extends CompositeComponentDefinition

ComponentDefinition that holds an aspect definition, including its nested pointcuts.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
See Also:
CompositeComponentDefinition.getNestedComponents(), PointcutComponentDefinition

Constructor Summary
AspectComponentDefinition(String aspectName, BeanDefinition[] beanDefinitions, BeanReference[] beanReferences, Object source)
Method Summary
BeanDefinition[] | getBeanDefinitions() Returns an empty array.
BeanReference[] | getBeanReferences() Returns an empty array.
Methods inherited from class org.springframework.beans.factory.parsing.CompositeComponentDefinition
addNestedComponent, getName, getNestedComponents, getSource
Methods inherited from class org.springframework.beans.factory.parsing.AbstractComponentDefinition
getDescription, getInnerBeanDefinitions, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AspectComponentDefinition

public AspectComponentDefinition(String aspectName,
                                 BeanDefinition[] beanDefinitions,
                                 BeanReference[] beanReferences,
                                 Object source)
Method Detail

getBeanDefinitions

public BeanDefinition[] getBeanDefinitions()
Description copied from class: AbstractComponentDefinition
Returns an empty array.

Specified by:
getBeanDefinitions in interface ComponentDefinition
Overrides:
getBeanDefinitions in class AbstractComponentDefinition
Returns:
the array of BeanDefinitions, or an empty array if none

getBeanReferences

public BeanReference[] getBeanReferences()
Description copied from class: AbstractComponentDefinition
Returns an empty array.

Specified by:
getBeanReferences in interface ComponentDefinition
Overrides:
getBeanReferences in class AbstractComponentDefinition
Returns:
the array of BeanReferences, or an empty array if none
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AspectEntry

org.springframework.aop.config
Class AspectEntry

java.lang.Object
    extended by  org.springframework.aop.config.AspectEntry
All Implemented Interfaces:
ParseState.Entry
public class AspectEntry
extends Object
implements ParseState.Entry

ParseState entry representing an aspect.

Since:
2.0
Author:
Mark Fisher, Juergen Hoeller

Constructor Summary
AspectEntry(String id, String ref)
Create a new AspectEntry.
Method Summary
 String toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AspectEntry

public AspectEntry(String id,
                   String ref)
Create a new AspectEntry.

Parameters:
id - the id of the aspect element
ref - the bean name referenced by this aspect element
Method Detail

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MethodLocatingFactoryBean

org.springframework.aop.config
Class MethodLocatingFactoryBean

java.lang.Object
    extended by  org.springframework.aop.config.MethodLocatingFactoryBean
All Implemented Interfaces:
BeanFactoryAware, FactoryBean<Method>
public class MethodLocatingFactoryBean
extends Object
implements FactoryBean<Method>, BeanFactoryAware

FactoryBean implementation that locates a Method on a specified bean.

Since:
2.0
Author:
Rob Harrop

Constructor Summary
MethodLocatingFactoryBean()
Method Summary
 Method getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<Method> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setBeanFactory(BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance.
 void setMethodName(String methodName)
Set the name of the Method to locate.
 void setTargetBeanName(String targetBeanName)
Set the name of the bean to locate the Method on.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MethodLocatingFactoryBean

public MethodLocatingFactoryBean()
Method Detail

setTargetBeanName

public void setTargetBeanName(String targetBeanName)
Set the name of the bean to locate the Method on.

This property is required.

Parameters:
targetBeanName - the name of the bean to locate the Method on

setMethodName

public void setMethodName(String methodName)
Set the name of the Method to locate.

This property is required.

Parameters:
methodName - the name of the Method to locate

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
BeanInitializationException

getObject

public Method getObject()
                 throws Exception
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<Method>
Returns:
an instance of the bean (can be null)
Throws:
Exception - in case of creation errors
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<Method> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<Method>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<Method>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PointcutComponentDefinition

org.springframework.aop.config
Class PointcutComponentDefinition

java.lang.Object
    extended by  org.springframework.beans.factory.parsing.AbstractComponentDefinition
        extended by  org.springframework.aop.config.PointcutComponentDefinition
All Implemented Interfaces:
BeanMetadataElement, ComponentDefinition
public class PointcutComponentDefinition
extends AbstractComponentDefinition

ComponentDefinition implementation that holds a pointcut definition.

Since:
2.0
Author:
Rob Harrop

Constructor Summary
PointcutComponentDefinition(String pointcutBeanName, BeanDefinition pointcutDefinition, String expression)
Method Summary
 BeanDefinition[] getBeanDefinitions()
Returns an empty array.
 String getDescription()
Delegates to ComponentDefinition.getName().
 String getName()
Get the user-visible name of this ComponentDefinition.
 Object getSource()
Return the configuration source Object for this metadata element (may be null).
Methods inherited from class org.springframework.beans.factory.parsing.AbstractComponentDefinition
getBeanReferences, getInnerBeanDefinitions, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

PointcutComponentDefinition

public PointcutComponentDefinition(String pointcutBeanName,
                                   BeanDefinition pointcutDefinition,
                                   String expression)
Method Detail

getName

public String getName()
Description copied from interface: ComponentDefinition
Get the user-visible name of this ComponentDefinition.

This should link back directly to the corresponding configuration data for this component in a given context.

getDescription

public String getDescription()
Description copied from class: AbstractComponentDefinition
Delegates to ComponentDefinition.getName().

Specified by:
getDescription in interface ComponentDefinition
Overrides:
getDescription in class AbstractComponentDefinition

getBeanDefinitions

public BeanDefinition[] getBeanDefinitions()
Description copied from class: AbstractComponentDefinition
Returns an empty array.

Specified by:
getBeanDefinitions in interface ComponentDefinition
Overrides:
getBeanDefinitions in class AbstractComponentDefinition
Returns:
the array of BeanDefinitions, or an empty array if none

getSource

public Object getSource()
Description copied from interface: BeanMetadataElement
Return the configuration source Object for this metadata element (may be null).

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PointcutEntry

org.springframework.aop.config
Class PointcutEntry

java.lang.Object
    extended by  org.springframework.aop.config.PointcutEntry
All Implemented Interfaces:
ParseState.Entry
public class PointcutEntry
extends Object
implements ParseState.Entry

ParseState entry representing a pointcut.

Since:
2.0
Author:
Mark Fisher

Constructor Summary
PointcutEntry(String name)
Creates a new instance of the PointcutEntry class.
Method Summary
 String toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

PointcutEntry

public PointcutEntry(String name)
Creates a new instance of the PointcutEntry class.

Parameters:
name - the bean name of the pointcut
Method Detail

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleBeanFactoryAwareAspectInstanceFactory

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.aop.config
Class SimpleBeanFactoryAwareAspectInstanceFactory

java.lang.Object
    extended by  org.springframework.aop.config.SimpleBeanFactoryAwareAspectInstanceFactory
All Implemented Interfaces:
AspectInstanceFactory, BeanFactoryAware, Ordered
public class SimpleBeanFactoryAwareAspectInstanceFactory
extends Object
implements AspectInstanceFactory, BeanFactoryAware

Implementation of AspectInstanceFactory that locates the aspect from the BeanFactory using a configured bean name.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
SimpleBeanFactoryAwareAspectInstanceFactory()
Method Summary
ClassLoader | getAspectClassLoader() Expose the aspect class loader that this factory uses.
Object | getAspectInstance() Look up the aspect bean from the BeanFactory and returns it.
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
void | setAspectBeanName(String aspectBeanName) Set the name of the aspect bean.
void | setBeanFactory(BeanFactory beanFactory) Callback that supplies the owning factory to a bean instance.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleBeanFactoryAwareAspectInstanceFactory

public SimpleBeanFactoryAwareAspectInstanceFactory()
Method Detail

setAspectBeanName

public void setAspectBeanName(String aspectBeanName)
Set the name of the aspect bean. This is the bean that is returned when calling getAspectInstance().

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
BeanInitializationException

getAspectInstance

public Object getAspectInstance()
Look up the aspect bean from the BeanFactory and returns it.

Specified by:
getAspectInstance in interface AspectInstanceFactory
Returns:
the aspect instance (never null)
See Also:
setAspectBeanName(java.lang.String)

getAspectClassLoader

public ClassLoader getAspectClassLoader()
Description copied from interface: AspectInstanceFactory
Expose the aspect class loader that this factory uses.

Specified by:
getAspectClassLoader in interface AspectInstanceFactory
Returns:
the aspect class loader (never null)

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.aop.framework

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.aop.framework

Package containing Spring's basic AOP infrastructure, compliant with the AOP Alliance interfaces.

See:
Description

Interface Summary
Advised | Interface to be implemented by classes that hold the configuration of a factory of AOP proxies.
AdvisedSupportListener | Listener to be registered on ProxyCreatorSupport objects Allows for receiving callbacks on activation and change of advice.
AdvisorChainFactory | Factory interface for advisor chains.
AopInfrastructureBean | Marker interface that indicates a bean that is part of Spring's AOP infrastructure.
AopProxy | Delegate interface for a configured AOP proxy, allowing for the creation of actual proxy objects.
AopProxyFactory | Interface to be implemented by factories that are able to create AOP proxies based on AdvisedSupport configuration objects.

Class Summary
AbstractSingletonProxyFactoryBean | Convenient proxy factory bean superclass for proxy factory beans that create only singletons.
AdvisedSupport | Base class for AOP proxy configuration managers.
AopContext | Class containing static methods used to obtain information about the current AOP invocation.
AopProxyUtils | Utility methods for AOP proxy factories.
DefaultAdvisorChainFactory | A simple but definitive way of working out an advice chain for a Method, given an Advised object.
DefaultAopProxyFactory | Default AopProxyFactory implementation, creating either a CGLIB proxy or a JDK dynamic proxy.
ProxyConfig | Convenience superclass for configuration used in creating proxies, to ensure that all proxy creators have consistent properties.
ProxyCreatorSupport | Base class for proxy factories.
ProxyFactory | Factory for AOP proxies for programmatic use, rather than via a bean factory.
ProxyFactoryBean | FactoryBean implementation that builds an AOP proxy based on beans in Spring BeanFactory.
ReflectiveMethodInvocation | Spring's implementation of the AOP Alliance MethodInvocation interface, implementing the extended ProxyMethodInvocation interface.

Exception Summary
AopConfigException Exception that gets thrown on illegal AOP configuration arguments.

Package org.springframework.aop.framework Description

Package containing Spring's basic AOP infrastructure, compliant with the AOP Alliance interfaces.

Spring AOP supports proxying interfaces or classes, introductions, and offers static and dynamic pointcuts.

Any Spring AOP proxy can be cast to the ProxyConfig AOP configuration interface in this package to add or remove interceptors.

The ProxyFactoryBean is a convenient way to create AOP proxies in a BeanFactory or ApplicationContext. However, proxies can be created programmatically using the ProxyFactory class.


org.springframework.aop.framework Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.aop.framework

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.aop.framework.AopContext
    • org.springframework.aop.framework.AopProxyUtils
    • org.springframework.aop.framework.DefaultAdvisorChainFactory (implements org.springframework.aop.framework.AdvisorChainFactory, java.io.Serializable)
    • org.springframework.aop.framework.DefaultAopProxyFactory (implements org.springframework.aop.framework.AopProxyFactory, java.io.Serializable)
    • org.springframework.aop.framework.ProxyConfig (implements java.io.Serializable)
      • org.springframework.aop.framework.AbstractSingletonProxyFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
      • org.springframework.aop.framework.AdvisedSupport (implements org.springframework.aop.framework.Advised)
        • org.springframework.aop.framework.ProxyCreatorSupport
          • org.springframework.aop.framework.ProxyFactory
          • org.springframework.aop.framework.ProxyFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.FactoryBean<T>)
    • org.springframework.aop.framework.ReflectiveMethodInvocation (implements java.lang.Cloneable, org.springframework.aop.ProxyMethodInvocation)
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.aop.framework.AopConfigException

Interface Hierarchy

  • org.springframework.aop.framework.AdvisedSupportListener
  • org.springframework.aop.framework.AdvisorChainFactory
  • org.springframework.aop.framework.AopInfrastructureBean
  • org.springframework.aop.framework.AopProxy
  • org.springframework.aop.framework.AopProxyFactory
  • org.springframework.aop.TargetClassAware
    • org.springframework.aop.framework.Advised


Advised

org.springframework.aop.framework
Interface Advised

All Superinterfaces:
TargetClassAware
All Known Implementing Classes:
AdvisedSupport, AspectJProxyFactory, ProxyCreatorSupport, ProxyFactory, ProxyFactoryBean
public interface Advised
extends TargetClassAware

Interface to be implemented by classes that hold the configuration of a factory of AOP proxies. This configuration includes the Interceptors and other advice, and Advisors, and the proxied interfaces.

Any AOP proxy obtained from Spring can be cast to this interface to allow manipulation of its AOP advice.

Since:
13.03.2003
Author:
Rod Johnson, Juergen Hoeller
See Also:
AdvisedSupport

Method Summary
 void addAdvice(Advice advice)
Add the given AOP Alliance advice to the tail of the advice (interceptor) chain.
 void addAdvice(int pos, Advice advice)
Add the given AOP Alliance Advice at the specified position in the advice chain.
 void addAdvisor(Advisor advisor)
Add an advisor at the end of the advisor chain.
 void addAdvisor(int pos, Advisor advisor)
Add an Advisor at the specified position in the chain.
 Advisor[] getAdvisors()
Return the advisors applying to this proxy.
 Class[] getProxiedInterfaces()
Return the interfaces proxied by the AOP proxy.
 TargetSource getTargetSource()
Return the TargetSource used by this Advised object.
 int indexOf(Advice advice)
Return the index (from 0) of the given AOP Alliance Advice, or -1 if no such advice is an advice for this proxy.
 int indexOf(Advisor advisor)
Return the index (from 0) of the given advisor, or -1 if no such advisor applies to this proxy.
 boolean isExposeProxy()
Return whether the factory should expose the proxy as a ThreadLocal.
 boolean isFrozen()
Return whether the Advised configuration is frozen, in which case no advice changes can be made.
 boolean isInterfaceProxied(Class intf)
Determine whether the given interface is proxied.
 boolean isPreFiltered()
Return whether this proxy configuration is pre-filtered so that it only contains applicable advisors (matching this proxy's target class).
 boolean isProxyTargetClass()
Are we proxying the full target class instead of specified interfaces?
 boolean removeAdvice(Advice advice)
Remove the Advisor containing the given advice.
 boolean removeAdvisor(Advisor advisor)
Remove the given advisor.
 void removeAdvisor(int index)
Remove the advisor at the given index.
 boolean replaceAdvisor(Advisor a, Advisor b)
Replace the given advisor.
 void setExposeProxy(boolean exposeProxy)
Set whether the proxy should be exposed by the AOP framework as a ThreadLocal for retrieval via the AopContext class.
 void setPreFiltered(boolean preFiltered)
Set whether this proxy configuration is pre-filtered so that it only contains applicable advisors (matching this proxy's target class).
 void setTargetSource(TargetSource targetSource)
Change the TargetSource used by this Advised object.
 String toProxyConfigString()
As toString() will normally be delegated to the target, this returns the equivalent for the AOP proxy.
Methods inherited from interface org.springframework.aop.TargetClassAware
getTargetClass

Method Detail

isFrozen

boolean isFrozen()
Return whether the Advised configuration is frozen, in which case no advice changes can be made.

isProxyTargetClass

boolean isProxyTargetClass()
Are we proxying the full target class instead of specified interfaces?

getProxiedInterfaces

Class[] getProxiedInterfaces()
Return the interfaces proxied by the AOP proxy. Will not include the target class, which may also be proxied.

isInterfaceProxied

boolean isInterfaceProxied(Class intf)
Determine whether the given interface is proxied.

Parameters:
intf - the interface to check

setTargetSource

void setTargetSource(TargetSource targetSource)
Change the TargetSource used by this Advised object. Only works if the configuration isn't frozen.

Parameters:
targetSource - new TargetSource to use

getTargetSource

TargetSource getTargetSource()
Return the TargetSource used by this Advised object.

setExposeProxy

void setExposeProxy(boolean exposeProxy)
Set whether the proxy should be exposed by the AOP framework as a ThreadLocal for retrieval via the AopContext class. This is useful if an advised object needs to call another advised method on itself. (If it uses this, the invocation will not be advised).

Default is "false", for optimal performance.

isExposeProxy

boolean isExposeProxy()
Return whether the factory should expose the proxy as a ThreadLocal. This can be necessary if a target object needs to invoke a method on itself benefitting from advice. (If it invokes a method on this no advice will apply.) Getting the proxy is analogous to an EJB calling getEJBObject().

See Also:
AopContext

setPreFiltered

void setPreFiltered(boolean preFiltered)
Set whether this proxy configuration is pre-filtered so that it only contains applicable advisors (matching this proxy's target class).

Default is "false". Set this to "true" if the advisors have been pre-filtered already, meaning that the ClassFilter check can be skipped when building the actual advisor chain for proxy invocations.

See Also:
ClassFilter

isPreFiltered

boolean isPreFiltered()
Return whether this proxy configuration is pre-filtered so that it only contains applicable advisors (matching this proxy's target class).

getAdvisors

Advisor[] getAdvisors()
Return the advisors applying to this proxy.

Returns:
a list of Advisors applying to this proxy (never null)

addAdvisor

void addAdvisor(Advisor advisor)
                throws AopConfigException
Add an advisor at the end of the advisor chain.

The Advisor may be an IntroductionAdvisor, in which new interfaces will be available when a proxy is next obtained from the relevant factory.

Parameters:
advisor - the advisor to add to the end of the chain
Throws:
AopConfigException - in case of invalid advice

addAdvisor

void addAdvisor(int pos,
                Advisor advisor)
                throws AopConfigException
Add an Advisor at the specified position in the chain.

Parameters:
advisor - the advisor to add at the specified position in the chain
pos - position in chain (0 is head). Must be valid.
Throws:
AopConfigException - in case of invalid advice

removeAdvisor

boolean removeAdvisor(Advisor advisor)
Remove the given advisor.

Parameters:
advisor - the advisor to remove
Returns:
true if the advisor was removed; false if the advisor was not found and hence could not be removed

removeAdvisor

void removeAdvisor(int index)
                   throws AopConfigException
Remove the advisor at the given index.

Parameters:
index - index of advisor to remove
Throws:
AopConfigException - if the index is invalid

indexOf

int indexOf(Advisor advisor)
Return the index (from 0) of the given advisor, or -1 if no such advisor applies to this proxy.

The return value of this method can be used to index into the advisors array.

Parameters:
advisor - the advisor to search for
Returns:
index from 0 of this advisor, or -1 if there's no such advisor

replaceAdvisor

boolean replaceAdvisor(Advisor a,
                       Advisor b)
                       throws AopConfigException
Replace the given advisor.

Note: If the advisor is an IntroductionAdvisor and the replacement is not or implements different interfaces, the proxy will need to be re-obtained or the old interfaces won't be supported and the new interface won't be implemented.

Parameters:
a - the advisor to replace
b - the advisor to replace it with
Returns:
whether it was replaced. If the advisor wasn't found in the list of advisors, this method returns false and does nothing.
Throws:
AopConfigException - in case of invalid advice

addAdvice

void addAdvice(Advice advice)
               throws AopConfigException
Add the given AOP Alliance advice to the tail of the advice (interceptor) chain.

This will be wrapped in a DefaultPointcutAdvisor with a pointcut that always applies, and returned from the getAdvisors() method in this wrapped form.

Note that the given advice will apply to all invocations on the proxy, even to the toString() method! Use appropriate advice implementations or specify appropriate pointcuts to apply to a narrower set of methods.

Parameters:
advice - advice to add to the tail of the chain
Throws:
AopConfigException - in case of invalid advice
See Also:
addAdvice(int, Advice), DefaultPointcutAdvisor

addAdvice

void addAdvice(int pos,
               Advice advice)
               throws AopConfigException
Add the given AOP Alliance Advice at the specified position in the advice chain.

This will be wrapped in a DefaultPointcutAdvisor with a pointcut that always applies, and returned from the getAdvisors() method in this wrapped form.

Note: The given advice will apply to all invocations on the proxy, even to the toString() method! Use appropriate advice implementations or specify appropriate pointcuts to apply to a narrower set of methods.

Parameters:
pos - index from 0 (head)
advice - advice to add at the specified position in the advice chain
Throws:
AopConfigException - in case of invalid advice

removeAdvice

boolean removeAdvice(Advice advice)
Remove the Advisor containing the given advice.

Parameters:
advice - the advice to remove
Returns:
true of the advice was found and removed; false if there was no such advice

indexOf

int indexOf(Advice advice)
Return the index (from 0) of the given AOP Alliance Advice, or -1 if no such advice is an advice for this proxy.

The return value of this method can be used to index into the advisors array.

Parameters:
advice - AOP Alliance advice to search for
Returns:
index from 0 of this advice, or -1 if there's no such advice

toProxyConfigString

String toProxyConfigString()
As toString() will normally be delegated to the target, this returns the equivalent for the AOP proxy.

Returns:
a string description of the proxy configuration
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AdvisedSupportListener

org.springframework.aop.framework
Interface AdvisedSupportListener

public interface AdvisedSupportListener

Listener to be registered on ProxyCreatorSupport objects Allows for receiving callbacks on activation and change of advice.

Author:
Rod Johnson, Juergen Hoeller
See Also:
ProxyCreatorSupport.addListener(org.springframework.aop.framework.AdvisedSupportListener)

Method Summary
void | activated(AdvisedSupport advised) Invoked when the first proxy is created.
void | adviceChanged(AdvisedSupport advised) Invoked when advice is changed after a proxy is created.

Method Detail

activated

void activated(AdvisedSupport advised)
Invoked when the first proxy is created.

Parameters:
advised - the AdvisedSupport object

adviceChanged

void adviceChanged(AdvisedSupport advised)
Invoked when advice is changed after a proxy is created.

Parameters:
advised - the AdvisedSupport object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AdvisorChainFactory

org.springframework.aop.framework
Interface AdvisorChainFactory

All Known Implementing Classes:
DefaultAdvisorChainFactory
public interface AdvisorChainFactory

Factory interface for advisor chains.

Author:
Rod Johnson, Juergen Hoeller

Method Summary
 List<Object> getInterceptorsAndDynamicInterceptionAdvice(Advised config, Method method, Class targetClass)
Determine a list of MethodInterceptor objects for the given advisor chain configuration.

Method Detail

getInterceptorsAndDynamicInterceptionAdvice

List<Object> getInterceptorsAndDynamicInterceptionAdvice(Advised config,
                                                         Method method,
                                                         Class targetClass)
Determine a list of MethodInterceptor objects for the given advisor chain configuration.

Parameters:
config - the AOP configuration in the form of an Advised object
method - the proxied method
targetClass - the target class
Returns:
List of MethodInterceptors (may also include InterceptorAndDynamicMethodMatchers)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AopInfrastructureBean

org.springframework.aop.framework
Interface AopInfrastructureBean

All Known Implementing Classes:
AbstractAdvisorAutoProxyCreator, AbstractAutoProxyCreator, AnnotationAwareAspectJAutoProxyCreator, AspectJAwareAdvisorAutoProxyCreator, BeanNameAutoProxyCreator, DefaultAdvisorAutoProxyCreator, InfrastructureAdvisorAutoProxyCreator
public interface AopInfrastructureBean

Marker interface that indicates a bean that is part of Spring's AOP infrastructure. In particular, this implies that any such bean is not subject to auto-proxying, even if a pointcut would match.

Since:
2.0.3
Author:
Juergen Hoeller
See Also:
AbstractAutoProxyCreator, ScopedProxyFactoryBean

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AopProxy

org.springframework.aop.framework
Interface AopProxy

public interface AopProxy

Delegate interface for a configured AOP proxy, allowing for the creation of actual proxy objects.

Out-of-the-box implementations are available for JDK dynamic proxies and for CGLIB proxies, as applied by DefaultAopProxyFactory.

Author:
Rod Johnson, Juergen Hoeller
See Also:
DefaultAopProxyFactory

Method Summary
Object | getProxy() Create a new proxy object.
Object | getProxy(ClassLoader classLoader) Create a new proxy object.

Method Detail

getProxy

Object getProxy()
Create a new proxy object.

Uses the AopProxy's default class loader (if necessary for proxy creation): usually, the thread context class loader.

Returns:
the new proxy object (never null)
See Also:
Thread.getContextClassLoader()

getProxy

Object getProxy(ClassLoader classLoader)
Create a new proxy object.

Uses the given class loader (if necessary for proxy creation). null will simply be passed down and thus lead to the low-level proxy facility's default, which is usually different from the default chosen by the AopProxy implementation's getProxy() method.

Parameters:
classLoader - the class loader to create the proxy with (or null for the low-level proxy facility's default)
Returns:
the new proxy object (never null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AopProxyFactory

org.springframework.aop.framework
Interface AopProxyFactory

All Known Implementing Classes:
DefaultAopProxyFactory
public interface AopProxyFactory

Interface to be implemented by factories that are able to create AOP proxies based on AdvisedSupport configuration objects.

Proxies should observe the following contract:

  • They should implement all interfaces that the configuration indicates should be proxied.
  • They should implement the Advised interface.
  • They should implement the equals method to compare proxied interfaces, advice, and target.
  • They should be serializable if all advisors and target are serializable.
  • They should be thread-safe if advisors and target are thread-safe.

Proxies may or may not allow advice changes to be made. If they do not permit advice changes (for example, because the configuration was frozen) a proxy should throw an AopConfigException on an attempted advice change.

Author:
Rod Johnson, Juergen Hoeller

Method Summary
 AopProxy createAopProxy(AdvisedSupport config)
Create an AopProxy for the given AOP configuration.

Method Detail

createAopProxy

AopProxy createAopProxy(AdvisedSupport config)
                        throws AopConfigException
Create an AopProxy for the given AOP configuration.

Parameters:
config - the AOP configuration in the form of an AdvisedSupport object
Returns:
the corresponding AOP proxy
Throws:
AopConfigException - if the configuration is invalid
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractSingletonProxyFactoryBean

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.aop.framework
Class AbstractSingletonProxyFactoryBean

java.lang.Object
    extended by  org.springframework.aop.framework.ProxyConfig
        extended by  org.springframework.aop.framework.AbstractSingletonProxyFactoryBean
All Implemented Interfaces:
Serializable, BeanClassLoaderAware, FactoryBean<Object>, InitializingBean
Direct Known Subclasses:
TransactionProxyFactoryBean
public abstract class AbstractSingletonProxyFactoryBean
extends ProxyConfig
implements FactoryBean<Object>, BeanClassLoaderAware, InitializingBean

Convenient proxy factory bean superclass for proxy factory beans that create only singletons.

Manages pre- and post-interceptors (references, rather than interceptor names, as in ProxyFactoryBean) and provides consistent interface management.

Since:
2.0
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
AbstractSingletonProxyFactoryBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected abstract  Object createMainInterceptor()
Create the "main" interceptor for this proxy factory bean.
protected  TargetSource createTargetSource(Object target)
Determine a TargetSource for the given target (or TargetSource).
 Object getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<?> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setAdvisorAdapterRegistry(AdvisorAdapterRegistry advisorAdapterRegistry)
Specify the AdvisorAdapterRegistry to use.
 void setBeanClassLoader(ClassLoader classLoader)
Callback that supplies the bean class loader to a bean instance.
 void setPostInterceptors(Object[] postInterceptors)
Set additional interceptors (or advisors) to be applied after the implicit transaction interceptor.
 void setPreInterceptors(Object[] preInterceptors)
Set additional interceptors (or advisors) to be applied before the implicit transaction interceptor, e.g.
 void setProxyClassLoader(ClassLoader classLoader)
Set the ClassLoader to generate the proxy class in.
 void setProxyInterfaces(Class[] proxyInterfaces)
Specify the set of interfaces being proxied.
 void setTarget(Object target)
Set the target object, that is, the bean to be wrapped with a transactional proxy.
Methods inherited from class org.springframework.aop.framework.ProxyConfig
copyFrom, isExposeProxy, isFrozen, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setFrozen, setOpaque, setOptimize, setProxyTargetClass, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AbstractSingletonProxyFactoryBean

public AbstractSingletonProxyFactoryBean()
Method Detail

setTarget

public void setTarget(Object target)
Set the target object, that is, the bean to be wrapped with a transactional proxy.

The target may be any object, in which case a SingletonTargetSource will be created. If it is a TargetSource, no wrapper TargetSource is created: This enables the use of a pooling or prototype TargetSource etc.

See Also:
TargetSource, SingletonTargetSource, LazyInitTargetSource, PrototypeTargetSource, CommonsPoolTargetSource

setProxyInterfaces

public void setProxyInterfaces(Class[] proxyInterfaces)
Specify the set of interfaces being proxied.

If not specified (the default), the AOP infrastructure works out which interfaces need proxying by analyzing the target, proxying all the interfaces that the target object implements.

setPreInterceptors

public void setPreInterceptors(Object[] preInterceptors)
Set additional interceptors (or advisors) to be applied before the implicit transaction interceptor, e.g. a PerformanceMonitorInterceptor.

You may specify any AOP Alliance MethodInterceptors or other Spring AOP Advices, as well as Spring AOP Advisors.

See Also:
PerformanceMonitorInterceptor

setPostInterceptors

public void setPostInterceptors(Object[] postInterceptors)
Set additional interceptors (or advisors) to be applied after the implicit transaction interceptor.

You may specify any AOP Alliance MethodInterceptors or other Spring AOP Advices, as well as Spring AOP Advisors.

setAdvisorAdapterRegistry

public void setAdvisorAdapterRegistry(AdvisorAdapterRegistry advisorAdapterRegistry)
Specify the AdvisorAdapterRegistry to use. Default is the global AdvisorAdapterRegistry.

See Also:
GlobalAdvisorAdapterRegistry

setProxyClassLoader

public void setProxyClassLoader(ClassLoader classLoader)
Set the ClassLoader to generate the proxy class in.

Default is the bean ClassLoader, i.e. the ClassLoader used by the containing BeanFactory for loading all bean classes. This can be overridden here for specific proxies.

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

createTargetSource

protected TargetSource createTargetSource(Object target)
Determine a TargetSource for the given target (or TargetSource).

Parameters:
target - target. If this is an implementation of TargetSource it is used as our TargetSource; otherwise it is wrapped in a SingletonTargetSource.
Returns:
a TargetSource for this object

getObject

public Object getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<Object>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<?> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<Object>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public final boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<Object>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()

createMainInterceptor

protected abstract Object createMainInterceptor()
Create the "main" interceptor for this proxy factory bean. Typically an Advisor, but can also be any type of Advice.

Pre-interceptors will be applied before, post-interceptors will be applied after this interceptor.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AdvisedSupport

org.springframework.aop.framework
Class AdvisedSupport

java.lang.Object
    extended by  org.springframework.aop.framework.ProxyConfig
        extended by  org.springframework.aop.framework.AdvisedSupport
All Implemented Interfaces:
Serializable, Advised, TargetClassAware
Direct Known Subclasses:
ProxyCreatorSupport
public class AdvisedSupport
extends ProxyConfig
implements Advised

Base class for AOP proxy configuration managers. These are not themselves AOP proxies, but subclasses of this class are normally factories from which AOP proxy instances are obtained directly.

This class frees subclasses of the housekeeping of Advices and Advisors, but doesn't actually implement proxy creation methods, which are provided by subclasses.

This class is serializable; subclasses need not be. This class is used to hold snapshots of proxies.

Author:
Rod Johnson, Juergen Hoeller
See Also:
AopProxy, Serialized Form

Field Summary
static TargetSource EMPTY_TARGET_SOURCE
Canonical TargetSource when there's no target, and behavior is supplied by the advisors.
Constructor Summary
AdvisedSupport()
No-arg constructor for use as a JavaBean.
AdvisedSupport(Class[] interfaces)
Create a AdvisedSupport instance with the given parameters.
Method Summary
 void addAdvice(Advice advice)
Add the given AOP Alliance advice to the tail of the advice (interceptor) chain.
 void addAdvice(int pos, Advice advice)
Cannot add introductions this way unless the advice implements IntroductionInfo.
 void addAdvisor(Advisor advisor)
Add an advisor at the end of the advisor chain.
 void addAdvisor(int pos, Advisor advisor)
Add an Advisor at the specified position in the chain.
 void addAdvisors(Advisor... advisors)
Add all of the given advisors to this proxy configuration.
 void addAdvisors(Collection<Advisor> advisors)
Add all of the given advisors to this proxy configuration.
 void addAllAdvisors(Advisor[] advisors)
Deprecated. as of Spring 3.0, in favor of addAdvisors(org.springframework.aop.Advisor...)
 void addInterface(Class intf)
Add a new proxied interface.
protected  void adviceChanged()
Invoked when advice has changed.
 boolean adviceIncluded(Advice advice)
Is the given advice included in any advisor within this proxy configuration?
protected  void copyConfigurationFrom(AdvisedSupport other)
Call this method on a new instance created by the no-arg constructor to create an independent copy of the configuration from the given object.
protected  void copyConfigurationFrom(AdvisedSupport other, TargetSource targetSource, List<Advisor> advisors)
Copy the AOP configuration from the given AdvisedSupport object, but allow substitution of a fresh TargetSource and a given interceptor chain.
 int countAdvicesOfType(Class adviceClass)
Count advices of the given class.
 AdvisorChainFactory getAdvisorChainFactory()
Return the advisor chain factory to use (never null).
 Advisor[] getAdvisors()
Return the advisors applying to this proxy.
protected  List<Advisor> getAdvisorsInternal()
Allows uncontrolled access to the List of Advisors.
 List<Object> getInterceptorsAndDynamicInterceptionAdvice(Method method, Class targetClass)
Determine a list of MethodInterceptor objects for the given method, based on this configuration.
 Class[] getProxiedInterfaces()
Return the interfaces proxied by the AOP proxy.
 Class getTargetClass()
Return the target class behind the implementing object (typically a proxy configuration or an actual proxy).
 TargetSource getTargetSource()
Return the TargetSource used by this Advised object.
 int indexOf(Advice advice)
Return the index (from 0) of the given AOP Alliance Advice, or -1 if no such advice is an advice for this proxy.
 int indexOf(Advisor advisor)
Return the index (from 0) of the given advisor, or -1 if no such advisor applies to this proxy.
 boolean isInterfaceProxied(Class intf)
Determine whether the given interface is proxied.
 boolean isPreFiltered()
Return whether this proxy configuration is pre-filtered so that it only contains applicable advisors (matching this proxy's target class).
 boolean removeAdvice(Advice advice)
Remove the Advisor containing the given advice.
 boolean removeAdvisor(Advisor advisor)
Remove the given advisor.
 void removeAdvisor(int index)
Remove the advisor at the given index.
 boolean removeInterface(Class intf)
Remove a proxied interface.
 boolean replaceAdvisor(Advisor a, Advisor b)
Replace the given advisor.
 void setAdvisorChainFactory(AdvisorChainFactory advisorChainFactory)
Set the advisor chain factory to use.
 void setInterfaces(Class[] interfaces)
Set the interfaces to be proxied.
 void setPreFiltered(boolean preFiltered)
Set whether this proxy configuration is pre-filtered so that it only contains applicable advisors (matching this proxy's target class).
 void setTarget(Object target)
Set the given object as target.
 void setTargetClass(Class targetClass)
Set a target class to be proxied, indicating that the proxy should be castable to the given class.
 void setTargetSource(TargetSource targetSource)
Change the TargetSource used by this Advised object.
 String toProxyConfigString()
As toString() will normally be delegated to the target, this returns the equivalent for the AOP proxy.
 String toString()
For debugging/diagnostic use.
protected  void updateAdvisorArray()
Bring the array up to date with the list.
Methods inherited from class org.springframework.aop.framework.ProxyConfig
copyFrom, isExposeProxy, isFrozen, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setFrozen, setOpaque, setOptimize, setProxyTargetClass
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.aop.framework.Advised
isExposeProxy, isFrozen, isProxyTargetClass, setExposeProxy

Field Detail

EMPTY_TARGET_SOURCE

public static final TargetSource EMPTY_TARGET_SOURCE
Canonical TargetSource when there's no target, and behavior is supplied by the advisors.

Constructor Detail

AdvisedSupport

public AdvisedSupport()
No-arg constructor for use as a JavaBean.

AdvisedSupport

public AdvisedSupport(Class[] interfaces)
Create a AdvisedSupport instance with the given parameters.

Parameters:
interfaces - the proxied interfaces
Method Detail

setTarget

public void setTarget(Object target)
Set the given object as target. Will create a SingletonTargetSource for the object.

See Also:
setTargetSource(org.springframework.aop.TargetSource), SingletonTargetSource

setTargetSource

public void setTargetSource(TargetSource targetSource)
Description copied from interface: Advised
Change the TargetSource used by this Advised object. Only works if the configuration isn't frozen.

Specified by:
setTargetSource in interface Advised
Parameters:
targetSource - new TargetSource to use

getTargetSource

public TargetSource getTargetSource()
Description copied from interface: Advised
Return the TargetSource used by this Advised object.

Specified by:
getTargetSource in interface Advised

setTargetClass

public void setTargetClass(Class targetClass)
Set a target class to be proxied, indicating that the proxy should be castable to the given class.

Internally, an EmptyTargetSource for the given target class will be used. The kind of proxy needed will be determined on actual creation of the proxy.

This is a replacement for setting a "targetSource" or "target", for the case where we want a proxy based on a target class (which can be an interface or a concrete class) without having a fully capable TargetSource available.

See Also:
setTargetSource(org.springframework.aop.TargetSource), setTarget(java.lang.Object)

getTargetClass

public Class getTargetClass()
Description copied from interface: TargetClassAware
Return the target class behind the implementing object (typically a proxy configuration or an actual proxy).

Specified by:
getTargetClass in interface TargetClassAware
Returns:
the target Class, or null if not known

setPreFiltered

public void setPreFiltered(boolean preFiltered)
Description copied from interface: Advised
Set whether this proxy configuration is pre-filtered so that it only contains applicable advisors (matching this proxy's target class).

Default is "false". Set this to "true" if the advisors have been pre-filtered already, meaning that the ClassFilter check can be skipped when building the actual advisor chain for proxy invocations.

Specified by:
setPreFiltered in interface Advised
See Also:
ClassFilter

isPreFiltered

public boolean isPreFiltered()
Description copied from interface: Advised
Return whether this proxy configuration is pre-filtered so that it only contains applicable advisors (matching this proxy's target class).

Specified by:
isPreFiltered in interface Advised

setAdvisorChainFactory

public void setAdvisorChainFactory(AdvisorChainFactory advisorChainFactory)
Set the advisor chain factory to use.

Default is a DefaultAdvisorChainFactory.

getAdvisorChainFactory

public AdvisorChainFactory getAdvisorChainFactory()
Return the advisor chain factory to use (never null).

setInterfaces

public void setInterfaces(Class[] interfaces)
Set the interfaces to be proxied.

addInterface

public void addInterface(Class intf)
Add a new proxied interface.

Parameters:
intf - the additional interface to proxy

removeInterface

public boolean removeInterface(Class intf)
Remove a proxied interface.

Does nothing if the given interface isn't proxied.

Parameters:
intf - the interface to remove from the proxy
Returns:
true if the interface was removed; false if the interface was not found and hence could not be removed

getProxiedInterfaces

public Class[] getProxiedInterfaces()
Description copied from interface: Advised
Return the interfaces proxied by the AOP proxy. Will not include the target class, which may also be proxied.

Specified by:
getProxiedInterfaces in interface Advised

isInterfaceProxied

public boolean isInterfaceProxied(Class intf)
Description copied from interface: Advised
Determine whether the given interface is proxied.

Specified by:
isInterfaceProxied in interface Advised
Parameters:
intf - the interface to check

getAdvisors

public final Advisor[] getAdvisors()
Description copied from interface: Advised
Return the advisors applying to this proxy.

Specified by:
getAdvisors in interface Advised
Returns:
a list of Advisors applying to this proxy (never null)

addAdvisor

public void addAdvisor(Advisor advisor)
Description copied from interface: Advised
Add an advisor at the end of the advisor chain.

The Advisor may be an IntroductionAdvisor, in which new interfaces will be available when a proxy is next obtained from the relevant factory.

Specified by:
addAdvisor in interface Advised
Parameters:
advisor - the advisor to add to the end of the chain

addAdvisor

public void addAdvisor(int pos,
                       Advisor advisor)
                throws AopConfigException
Description copied from interface: Advised
Add an Advisor at the specified position in the chain.

Specified by:
addAdvisor in interface Advised
Parameters:
pos - position in chain (0 is head). Must be valid.
advisor - the advisor to add at the specified position in the chain
Throws:
AopConfigException - in case of invalid advice

removeAdvisor

public boolean removeAdvisor(Advisor advisor)
Description copied from interface: Advised
Remove the given advisor.

Specified by:
removeAdvisor in interface Advised
Parameters:
advisor - the advisor to remove
Returns:
true if the advisor was removed; false if the advisor was not found and hence could not be removed

removeAdvisor

public void removeAdvisor(int index)
                   throws AopConfigException
Description copied from interface: Advised
Remove the advisor at the given index.

Specified by:
removeAdvisor in interface Advised
Parameters:
index - index of advisor to remove
Throws:
AopConfigException - if the index is invalid

indexOf

public int indexOf(Advisor advisor)
Description copied from interface: Advised
Return the index (from 0) of the given advisor, or -1 if no such advisor applies to this proxy.

The return value of this method can be used to index into the advisors array.

Specified by:
indexOf in interface Advised
Parameters:
advisor - the advisor to search for
Returns:
index from 0 of this advisor, or -1 if there's no such advisor

replaceAdvisor

public boolean replaceAdvisor(Advisor a,
                              Advisor b)
                       throws AopConfigException
Description copied from interface: Advised
Replace the given advisor.

Note: If the advisor is an IntroductionAdvisor and the replacement is not or implements different interfaces, the proxy will need to be re-obtained or the old interfaces won't be supported and the new interface won't be implemented.

Specified by:
replaceAdvisor in interface Advised
Parameters:
a - the advisor to replace
b - the advisor to replace it with
Returns:
whether it was replaced. If the advisor wasn't found in the list of advisors, this method returns false and does nothing.
Throws:
AopConfigException - in case of invalid advice

addAllAdvisors

@Deprecated
public void addAllAdvisors(Advisor[] advisors)
Deprecated. as of Spring 3.0, in favor of addAdvisors(org.springframework.aop.Advisor...)

Add all of the given advisors to this proxy configuration.

Parameters:
advisors - the advisors to register

addAdvisors

public void addAdvisors(Advisor... advisors)
Add all of the given advisors to this proxy configuration.

Parameters:
advisors - the advisors to register

addAdvisors

public void addAdvisors(Collection<Advisor> advisors)
Add all of the given advisors to this proxy configuration.

Parameters:
advisors - the advisors to register

updateAdvisorArray

protected final void updateAdvisorArray()
Bring the array up to date with the list.

getAdvisorsInternal

protected final List<Advisor> getAdvisorsInternal()
Allows uncontrolled access to the List of Advisors.

Use with care, and remember to refresh the advisor array and fire advice changed events when making any modifications.

addAdvice

public void addAdvice(Advice advice)
               throws AopConfigException
Description copied from interface: Advised
Add the given AOP Alliance advice to the tail of the advice (interceptor) chain.

This will be wrapped in a DefaultPointcutAdvisor with a pointcut that always applies, and returned from the getAdvisors() method in this wrapped form.

Note that the given advice will apply to all invocations on the proxy, even to the toString() method! Use appropriate advice implementations or specify appropriate pointcuts to apply to a narrower set of methods.

Specified by:
addAdvice in interface Advised
Parameters:
advice - advice to add to the tail of the chain
Throws:
AopConfigException - in case of invalid advice
See Also:
Advised.addAdvice(int, Advice), DefaultPointcutAdvisor

addAdvice

public void addAdvice(int pos,
                      Advice advice)
               throws AopConfigException
Cannot add introductions this way unless the advice implements IntroductionInfo.

Specified by:
addAdvice in interface Advised
Parameters:
pos - index from 0 (head)
advice - advice to add at the specified position in the advice chain
Throws:
AopConfigException - in case of invalid advice

removeAdvice

public boolean removeAdvice(Advice advice)
                     throws AopConfigException
Description copied from interface: Advised
Remove the Advisor containing the given advice.

Specified by:
removeAdvice in interface Advised
Parameters:
advice - the advice to remove
Returns:
true of the advice was found and removed; false if there was no such advice
Throws:
AopConfigException

indexOf

public int indexOf(Advice advice)
Description copied from interface: Advised
Return the index (from 0) of the given AOP Alliance Advice, or -1 if no such advice is an advice for this proxy.

The return value of this method can be used to index into the advisors array.

Specified by:
indexOf in interface Advised
Parameters:
advice - AOP Alliance advice to search for
Returns:
index from 0 of this advice, or -1 if there's no such advice

adviceIncluded

public boolean adviceIncluded(Advice advice)
Is the given advice included in any advisor within this proxy configuration?

Parameters:
advice - the advice to check inclusion of
Returns:
whether this advice instance is included

countAdvicesOfType

public int countAdvicesOfType(Class adviceClass)
Count advices of the given class.

Parameters:
adviceClass - the advice class to check
Returns:
the count of the interceptors of this class or subclasses

getInterceptorsAndDynamicInterceptionAdvice

public List<Object> getInterceptorsAndDynamicInterceptionAdvice(Method method,
                                                                Class targetClass)
Determine a list of MethodInterceptor objects for the given method, based on this configuration.

Parameters:
method - the proxied method
targetClass - the target class
Returns:
List of MethodInterceptors (may also include InterceptorAndDynamicMethodMatchers)

adviceChanged

protected void adviceChanged()
Invoked when advice has changed.

copyConfigurationFrom

protected void copyConfigurationFrom(AdvisedSupport other)
Call this method on a new instance created by the no-arg constructor to create an independent copy of the configuration from the given object.

Parameters:
other - the AdvisedSupport object to copy configuration from

copyConfigurationFrom

protected void copyConfigurationFrom(AdvisedSupport other,
                                     TargetSource targetSource,
                                     List<Advisor> advisors)
Copy the AOP configuration from the given AdvisedSupport object, but allow substitution of a fresh TargetSource and a given interceptor chain.

Parameters:
other - the AdvisedSupport object to take proxy configuration from
targetSource - the new TargetSource
advisors - the Advisors for the chain

toProxyConfigString

public String toProxyConfigString()
Description copied from interface: Advised
As toString() will normally be delegated to the target, this returns the equivalent for the AOP proxy.

Specified by:
toProxyConfigString in interface Advised
Returns:
a string description of the proxy configuration

toString

public String toString()
For debugging/diagnostic use.

Overrides:
toString in class ProxyConfig
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AopContext

org.springframework.aop.framework
Class AopContext

java.lang.Object
    extended by  org.springframework.aop.framework.AopContext

public abstract class AopContext
extends Object

Class containing static methods used to obtain information about the current AOP invocation.

The currentProxy() method is usable if the AOP framework is configured to expose the current proxy (not the default). It returns the AOP proxy in use. Target objects or advice can use this to make advised calls, in the same way as getEJBObject() can be used in EJBs. They can also use it to find advice configuration.

Spring's AOP framework does not expose proxies by default, as there is a performance cost in doing so.

The functionality in this class might be used by a target object that needed access to resources on the invocation. However, this approach should not be used when there is a reasonable alternative, as it makes application code dependent on usage under AOP and the Spring AOP framework in particular.

Since:
13.03.2003
Author:
Rod Johnson, Juergen Hoeller

Constructor Summary
AopContext()
Method Summary
static Object currentProxy()
Try to return the current AOP proxy.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AopContext

public AopContext()
Method Detail

currentProxy

public static Object currentProxy()
                           throws IllegalStateException
Try to return the current AOP proxy. This method is usable only if the calling method has been invoked via AOP, and the AOP framework has been set to expose proxies. Otherwise, this method will throw an IllegalStateException.

Returns:
Object the current AOP proxy (never returns null)
Throws:
IllegalStateException - if the proxy cannot be found, because the method was invoked outside an AOP invocation context, or because the AOP framework has not been configured to expose the proxy
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AopProxyUtils

org.springframework.aop.framework
Class AopProxyUtils

java.lang.Object
    extended by  org.springframework.aop.framework.AopProxyUtils

public abstract class AopProxyUtils
extends Object

Utility methods for AOP proxy factories. Mainly for internal use within the AOP framework.

See AopUtils for a collection of generic AOP utility methods which do not depend on AOP framework internals.

Author:
Rod Johnson, Juergen Hoeller
See Also:
AopUtils

Constructor Summary
AopProxyUtils()
Method Summary
static Class[] | completeProxiedInterfaces(AdvisedSupport advised) Determine the complete set of interfaces to proxy for the given AOP configuration.
static boolean | equalsAdvisors(AdvisedSupport a, AdvisedSupport b) Check equality of the advisors behind the given AdvisedSupport objects.
static boolean | equalsInProxy(AdvisedSupport a, AdvisedSupport b) Check equality of the proxies behind the given AdvisedSupport objects.
static boolean | equalsProxiedInterfaces(AdvisedSupport a, AdvisedSupport b) Check equality of the proxied interfaces behind the given AdvisedSupport objects.
static Class[] | proxiedUserInterfaces(Object proxy) Extract the user-specified interfaces that the given proxy implements, i.e.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AopProxyUtils

public AopProxyUtils()
Method Detail

completeProxiedInterfaces

public static Class[] completeProxiedInterfaces(AdvisedSupport advised)
Determine the complete set of interfaces to proxy for the given AOP configuration.

This will always add the Advised interface unless the AdvisedSupport's "opaque" flag is on. Always adds the SpringProxy marker interface.

Returns:
the complete set of interfaces to proxy
See Also:
Advised, SpringProxy

proxiedUserInterfaces

public static Class[] proxiedUserInterfaces(Object proxy)
Extract the user-specified interfaces that the given proxy implements, i.e. all non-Advised interfaces that the proxy implements.

Parameters:
proxy - the proxy to analyze (usually a JDK dynamic proxy)
Returns:
all user-specified interfaces that the proxy implements, in the original order (never null or empty)
See Also:
Advised

equalsInProxy

public static boolean equalsInProxy(AdvisedSupport a,
                                    AdvisedSupport b)
Check equality of the proxies behind the given AdvisedSupport objects. Not the same as equality of the AdvisedSupport objects: rather, equality of interfaces, advisors and target sources.

equalsProxiedInterfaces

public static boolean equalsProxiedInterfaces(AdvisedSupport a,
                                              AdvisedSupport b)
Check equality of the proxied interfaces behind the given AdvisedSupport objects.

equalsAdvisors

public static boolean equalsAdvisors(AdvisedSupport a,
                                     AdvisedSupport b)
Check equality of the advisors behind the given AdvisedSupport objects.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultAdvisorChainFactory

org.springframework.aop.framework
Class DefaultAdvisorChainFactory

java.lang.Object
    extended by  org.springframework.aop.framework.DefaultAdvisorChainFactory
All Implemented Interfaces:
Serializable, AdvisorChainFactory
public class DefaultAdvisorChainFactory
extends Object
implements AdvisorChainFactory, Serializable

A simple but definitive way of working out an advice chain for a Method, given an Advised object. Always rebuilds each advice chain; caching can be provided by subclasses.

Since:
2.0.3
Author:
Juergen Hoeller, Rod Johnson, Adrian Colyer
See Also:
Serialized Form

Constructor Summary
DefaultAdvisorChainFactory()
Method Summary
 List<Object> getInterceptorsAndDynamicInterceptionAdvice(Advised config, Method method, Class targetClass)
Determine a list of MethodInterceptor objects for the given advisor chain configuration.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DefaultAdvisorChainFactory

public DefaultAdvisorChainFactory()
Method Detail

getInterceptorsAndDynamicInterceptionAdvice

public List<Object> getInterceptorsAndDynamicInterceptionAdvice(Advised config,
                                                                Method method,
                                                                Class targetClass)
Description copied from interface: AdvisorChainFactory
Determine a list of MethodInterceptor objects for the given advisor chain configuration.

Specified by:
getInterceptorsAndDynamicInterceptionAdvice in interface AdvisorChainFactory
Parameters:
config - the AOP configuration in the form of an Advised object
method - the proxied method
targetClass - the target class
Returns:
List of MethodInterceptors (may also include InterceptorAndDynamicMethodMatchers)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultAopProxyFactory

org.springframework.aop.framework
Class DefaultAopProxyFactory

java.lang.Object
    extended by  org.springframework.aop.framework.DefaultAopProxyFactory
All Implemented Interfaces:
Serializable, AopProxyFactory
public class DefaultAopProxyFactory
extends Object
implements AopProxyFactory, Serializable

Default AopProxyFactory implementation, creating either a CGLIB proxy or a JDK dynamic proxy.

Creates a CGLIB proxy if one the following is true for a given AdvisedSupport instance:

  • the "optimize" flag is set
  • the "proxyTargetClass" flag is set
  • no proxy interfaces have been specified

Note that the CGLIB library classes have to be present on the class path if an actual CGLIB proxy needs to be created.

In general, specify "proxyTargetClass" to enforce a CGLIB proxy, or specify one or more interfaces to use a JDK dynamic proxy.

Since:
12.03.2004
Author:
Rod Johnson, Juergen Hoeller
See Also:
ProxyConfig.setOptimize(boolean),
ProxyConfig.setProxyTargetClass(boolean),
AdvisedSupport.setInterfaces(java.lang.Class[]),
Serialized Form

Constructor Summary
DefaultAopProxyFactory()
Method Summary
 AopProxy createAopProxy(AdvisedSupport config)
Create an AopProxy for the given AOP configuration.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DefaultAopProxyFactory

public DefaultAopProxyFactory()
Method Detail

createAopProxy

public AopProxy createAopProxy(AdvisedSupport config)
                        throws AopConfigException
Description copied from interface: AopProxyFactory
Create an AopProxy for the given AOP configuration.

Specified by:
createAopProxy in interface AopProxyFactory
Parameters:
config - the AOP configuration in the form of an AdvisedSupport object
Returns:
the corresponding AOP proxy
Throws:
AopConfigException - if the configuration is invalid
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ProxyConfig

org.springframework.aop.framework
Class ProxyConfig

java.lang.Object
    extended by  org.springframework.aop.framework.ProxyConfig
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AbstractAutoProxyCreator, AbstractSingletonProxyFactoryBean, AdvisedSupport, AsyncAnnotationBeanPostProcessor, PersistenceExceptionTranslationPostProcessor, ScopedProxyFactoryBean
public class ProxyConfig
extends Object
implements Serializable

Convenience superclass for configuration used in creating proxies, to ensure that all proxy creators have consistent properties.

Author:
Rod Johnson, Juergen Hoeller
See Also:
AdvisedSupport, Serialized Form

Constructor Summary
ProxyConfig()
Method Summary
void | copyFrom(ProxyConfig other) Copy configuration from the other config object.
boolean | isExposeProxy() Return whether the AOP proxy will expose the AOP proxy for each invocation.
boolean | isFrozen() Return whether the config is frozen, and no advice changes can be made.
boolean | isOpaque() Return whether proxies created by this configuration should be prevented from being cast to Advised.
boolean | isOptimize() Return whether proxies should perform aggressive optimizations.
boolean | isProxyTargetClass() Return whether to proxy the target class directly as well as any interfaces.
void | setExposeProxy(boolean exposeProxy) Set whether the proxy should be exposed by the AOP framework as a ThreadLocal for retrieval via the AopContext class.
void | setFrozen(boolean frozen) Set whether this config should be frozen.
void | setOpaque(boolean opaque) Set whether proxies created by this configuration should be prevented from being cast to Advised to query proxy status.
void | setOptimize(boolean optimize) Set whether proxies should perform aggressive optimizations.
void | setProxyTargetClass(boolean proxyTargetClass) Set whether to proxy the target class directly, instead of just proxying specific interfaces.
String | toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ProxyConfig

public ProxyConfig()
Method Detail

setProxyTargetClass

public void setProxyTargetClass(boolean proxyTargetClass)
Set whether to proxy the target class directly, instead of just proxying specific interfaces. Default is "false".

Set this to "true" to force proxying for the TargetSource's exposed target class. If that target class is an interface, a JDK proxy will be created for the given interface. If that target class is any other class, a CGLIB proxy will be created for the given class.

Note: Depending on the configuration of the concrete proxy factory, the proxy-target-class behavior will also be applied if no interfaces have been specified (and no interface autodetection is activated).

See Also:
TargetSource.getTargetClass()

isProxyTargetClass

public boolean isProxyTargetClass()
Return whether to proxy the target class directly as well as any interfaces.

setOptimize

public void setOptimize(boolean optimize)
Set whether proxies should perform aggressive optimizations. The exact meaning of "aggressive optimizations" will differ between proxies, but there is usually some tradeoff. Default is "false".

For example, optimization will usually mean that advice changes won't take effect after a proxy has been created. For this reason, optimization is disabled by default. An optimize value of "true" may be ignored if other settings preclude optimization: for example, if "exposeProxy" is set to "true" and that's not compatible with the optimization.

isOptimize

public boolean isOptimize()
Return whether proxies should perform aggressive optimizations.

setOpaque

public void setOpaque(boolean opaque)
Set whether proxies created by this configuration should be prevented from being cast to Advised to query proxy status.

Default is "false", meaning that any AOP proxy can be cast to Advised.

isOpaque

public boolean isOpaque()
Return whether proxies created by this configuration should be prevented from being cast to Advised.

setExposeProxy

public void setExposeProxy(boolean exposeProxy)
Set whether the proxy should be exposed by the AOP framework as a ThreadLocal for retrieval via the AopContext class. This is useful if an advised object needs to call another advised method on itself. (If it uses this, the invocation will not be advised).

Default is "false", for optimal performance.

isExposeProxy

public boolean isExposeProxy()
Return whether the AOP proxy will expose the AOP proxy for each invocation.

setFrozen

public void setFrozen(boolean frozen)
Set whether this config should be frozen.

When a config is frozen, no advice changes can be made. This is useful for optimization, and useful when we don't want callers to be able to manipulate configuration after casting to Advised.

isFrozen

public boolean isFrozen()
Return whether the config is frozen, and no advice changes can be made.

copyFrom

public void copyFrom(ProxyConfig other)
Copy configuration from the other config object.

Parameters:
other - object to copy configuration from

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ProxyCreatorSupport

org.springframework.aop.framework
Class ProxyCreatorSupport

java.lang.Object
    extended by  org.springframework.aop.framework.ProxyConfig
        extended by  org.springframework.aop.framework.AdvisedSupport
            extended by  org.springframework.aop.framework.ProxyCreatorSupport
All Implemented Interfaces:
Serializable, Advised, TargetClassAware
Direct Known Subclasses:
AspectJProxyFactory, ProxyFactory, ProxyFactoryBean
public class ProxyCreatorSupport
extends AdvisedSupport

Base class for proxy factories. Provides convenient access to a configurable AopProxyFactory.

Since:
2.0.3
Author:
Juergen Hoeller
See Also:
createAopProxy(), Serialized Form

Field Summary
Fields inherited from class org.springframework.aop.framework.AdvisedSupport
EMPTY_TARGET_SOURCE
Constructor Summary
ProxyCreatorSupport()
Create a new ProxyCreatorSupport instance.
ProxyCreatorSupport(AopProxyFactory aopProxyFactory)
Create a new ProxyCreatorSupport instance.
Method Summary
void | addListener(AdvisedSupportListener listener) Add the given AdvisedSupportListener to this proxy configuration.
protected void | adviceChanged() Propagate advice change event to all AdvisedSupportListeners.
protected AopProxy | createAopProxy() Subclasses should call this to get a new AOP proxy.
AopProxyFactory | getAopProxyFactory() Return the AopProxyFactory that this ProxyConfig uses.
protected boolean | isActive() Subclasses can call this to check whether any AOP proxies have been created yet.
void | removeListener(AdvisedSupportListener listener) Remove the given AdvisedSupportListener from this proxy configuration.
void | setAopProxyFactory(AopProxyFactory aopProxyFactory) Customize the AopProxyFactory, allowing different strategies to be dropped in without changing the core framework.
Methods inherited from class org.springframework.aop.framework.AdvisedSupport
addAdvice, addAdvice, addAdvisor, addAdvisor, addAdvisors, addAdvisors, addAllAdvisors, addInterface, adviceIncluded, copyConfigurationFrom, copyConfigurationFrom, countAdvicesOfType, getAdvisorChainFactory, getAdvisors, getAdvisorsInternal, getInterceptorsAndDynamicInterceptionAdvice, getProxiedInterfaces, getTargetClass, getTargetSource, indexOf, indexOf, isInterfaceProxied, isPreFiltered, removeAdvice, removeAdvisor, removeAdvisor, removeInterface, replaceAdvisor, setAdvisorChainFactory, setInterfaces, setPreFiltered, setTarget, setTargetClass, setTargetSource, toProxyConfigString, toString, updateAdvisorArray
Methods inherited from class org.springframework.aop.framework.ProxyConfig
copyFrom, isExposeProxy, isFrozen, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setFrozen, setOpaque, setOptimize, setProxyTargetClass
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.aop.framework.Advised
isExposeProxy, isFrozen, isProxyTargetClass, setExposeProxy

Constructor Detail

ProxyCreatorSupport

public ProxyCreatorSupport()
Create a new ProxyCreatorSupport instance.

ProxyCreatorSupport

public ProxyCreatorSupport(AopProxyFactory aopProxyFactory)
Create a new ProxyCreatorSupport instance.

Parameters:
aopProxyFactory - the AopProxyFactory to use
Method Detail

setAopProxyFactory

public void setAopProxyFactory(AopProxyFactory aopProxyFactory)
Customize the AopProxyFactory, allowing different strategies to be dropped in without changing the core framework.

Default is DefaultAopProxyFactory, using dynamic JDK proxies or CGLIB proxies based on the requirements.

getAopProxyFactory

public AopProxyFactory getAopProxyFactory()
Return the AopProxyFactory that this ProxyConfig uses.

addListener

public void addListener(AdvisedSupportListener listener)
Add the given AdvisedSupportListener to this proxy configuration.

Parameters:
listener - the listener to register

removeListener

public void removeListener(AdvisedSupportListener listener)
Remove the given AdvisedSupportListener from this proxy configuration.

Parameters:
listener - the listener to deregister

createAopProxy

protected final AopProxy createAopProxy()
Subclasses should call this to get a new AOP proxy. They should not create an AOP proxy with this as an argument.

adviceChanged

protected void adviceChanged()
Propagate advice change event to all AdvisedSupportListeners.

Overrides:
adviceChanged in class AdvisedSupport
See Also:
AdvisedSupportListener.adviceChanged(org.springframework.aop.framework.AdvisedSupport)

isActive

protected final boolean isActive()
Subclasses can call this to check whether any AOP proxies have been created yet.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ProxyFactory

org.springframework.aop.framework
Class ProxyFactory

java.lang.Object
    extended by  org.springframework.aop.framework.ProxyConfig
        extended by  org.springframework.aop.framework.AdvisedSupport
            extended by  org.springframework.aop.framework.ProxyCreatorSupport
                extended by  org.springframework.aop.framework.ProxyFactory
All Implemented Interfaces:
Serializable, Advised, TargetClassAware
public class ProxyFactory
extends ProxyCreatorSupport

Factory for AOP proxies for programmatic use, rather than via a bean factory. This class provides a simple way of obtaining and configuring AOP proxies in code.

Since:
14.03.2003
Author:
Rod Johnson, Juergen Hoeller, Rob Harrop
See Also:
Serialized Form

Field Summary
Fields inherited from class org.springframework.aop.framework.AdvisedSupport
EMPTY_TARGET_SOURCE
Constructor Summary
ProxyFactory()
Create a new ProxyFactory.
ProxyFactory(Class[] proxyInterfaces)
Create a new ProxyFactory.
ProxyFactory(Class proxyInterface, Interceptor interceptor)
Create a new ProxyFactory for the given interface and interceptor.
ProxyFactory(Class proxyInterface, TargetSource targetSource)
Create a ProxyFactory for the specified TargetSource, making the proxy implement the specified interface.
ProxyFactory(Object target)
Create a new ProxyFactory.
Method Summary
 Object getProxy()
Create a new proxy according to the settings in this factory.
static
<T> T
getProxy(Class<T> proxyInterface, Interceptor interceptor)
Create a new proxy for the given interface and interceptor.
static
<T> T
getProxy(Class<T> proxyInterface, TargetSource targetSource)
Create a proxy for the specified TargetSource, implementing the specified interface.
 Object getProxy(ClassLoader classLoader)
Create a new proxy according to the settings in this factory.
static Object getProxy(TargetSource targetSource)
Create a proxy for the specified TargetSource that extends the target class of the TargetSource.
Methods inherited from class org.springframework.aop.framework.ProxyCreatorSupport
addListener, adviceChanged, createAopProxy, getAopProxyFactory, isActive, removeListener, setAopProxyFactory
Methods inherited from class org.springframework.aop.framework.AdvisedSupport
addAdvice, addAdvice, addAdvisor, addAdvisor, addAdvisors, addAdvisors, addAllAdvisors, addInterface, adviceIncluded, copyConfigurationFrom, copyConfigurationFrom, countAdvicesOfType, getAdvisorChainFactory, getAdvisors, getAdvisorsInternal, getInterceptorsAndDynamicInterceptionAdvice, getProxiedInterfaces, getTargetClass, getTargetSource, indexOf, indexOf, isInterfaceProxied, isPreFiltered, removeAdvice, removeAdvisor, removeAdvisor, removeInterface, replaceAdvisor, setAdvisorChainFactory, setInterfaces, setPreFiltered, setTarget, setTargetClass, setTargetSource, toProxyConfigString, toString, updateAdvisorArray
Methods inherited from class org.springframework.aop.framework.ProxyConfig
copyFrom, isExposeProxy, isFrozen, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setFrozen, setOpaque, setOptimize, setProxyTargetClass
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.aop.framework.Advised
isExposeProxy, isFrozen, isProxyTargetClass, setExposeProxy

Constructor Detail

ProxyFactory

public ProxyFactory()
Create a new ProxyFactory.

ProxyFactory

public ProxyFactory(Object target)
Create a new ProxyFactory.

Will proxy all interfaces that the given target implements.

Parameters:
target - the target object to be proxied

ProxyFactory

public ProxyFactory(Class[] proxyInterfaces)
Create a new ProxyFactory.

No target, only interfaces. Must add interceptors.

Parameters:
proxyInterfaces - the interfaces that the proxy should implement

ProxyFactory

public ProxyFactory(Class proxyInterface,
                    Interceptor interceptor)
Create a new ProxyFactory for the given interface and interceptor.

Convenience method for creating a proxy for a single interceptor, assuming that the interceptor handles all calls itself rather than delegating to a target, like in the case of remoting proxies.

Parameters:
proxyInterface - the interface that the proxy should implement
interceptor - the interceptor that the proxy should invoke

ProxyFactory

public ProxyFactory(Class proxyInterface,
                    TargetSource targetSource)
Create a ProxyFactory for the specified TargetSource, making the proxy implement the specified interface.

Parameters:
proxyInterface - the interface that the proxy should implement
targetSource - the TargetSource that the proxy should invoke
Method Detail

getProxy

public Object getProxy()
Create a new proxy according to the settings in this factory.

Can be called repeatedly. Effect will vary if we've added or removed interfaces. Can add and remove interceptors.

Uses a default class loader: Usually, the thread context class loader (if necessary for proxy creation).

Returns:
the proxy object

getProxy

public Object getProxy(ClassLoader classLoader)
Create a new proxy according to the settings in this factory.

Can be called repeatedly. Effect will vary if we've added or removed interfaces. Can add and remove interceptors.

Uses the given class loader (if necessary for proxy creation).

Parameters:
classLoader - the class loader to create the proxy with (or null for the low-level proxy facility's default)
Returns:
the proxy object

getProxy

public static <T> T getProxy(Class<T> proxyInterface,
                             Interceptor interceptor)
Create a new proxy for the given interface and interceptor.

Convenience method for creating a proxy for a single interceptor, assuming that the interceptor handles all calls itself rather than delegating to a target, like in the case of remoting proxies.

Parameters:
proxyInterface - the interface that the proxy should implement
interceptor - the interceptor that the proxy should invoke
Returns:
the proxy object
See Also:
ProxyFactory(Class, org.aopalliance.intercept.Interceptor)

getProxy

public static <T> T getProxy(Class<T> proxyInterface,
                             TargetSource targetSource)
Create a proxy for the specified TargetSource, implementing the specified interface.

Parameters:
proxyInterface - the interface that the proxy should implement
targetSource - the TargetSource that the proxy should invoke
Returns:
the proxy object
See Also:
ProxyFactory(Class, org.springframework.aop.TargetSource)

getProxy

public static Object getProxy(TargetSource targetSource)
Create a proxy for the specified TargetSource that extends the target class of the TargetSource.

Parameters:
targetSource - the TargetSource that the proxy should invoke
Returns:
the proxy object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ProxyFactoryBean

org.springframework.aop.framework
Class ProxyFactoryBean

java.lang.Object
    extended by  org.springframework.aop.framework.ProxyConfig
        extended by  org.springframework.aop.framework.AdvisedSupport
            extended by  org.springframework.aop.framework.ProxyCreatorSupport
                extended by  org.springframework.aop.framework.ProxyFactoryBean
All Implemented Interfaces:
Serializable, Advised, TargetClassAware, BeanClassLoaderAware, BeanFactoryAware, FactoryBean<Object>
public class ProxyFactoryBean
extends ProxyCreatorSupport
implements FactoryBean<Object>, BeanClassLoaderAware, BeanFactoryAware

FactoryBean implementation that builds an AOP proxy based on beans in Spring BeanFactory.

MethodInterceptors and Advisors are identified by a list of bean names in the current bean factory, specified through the "interceptorNames" property. The last entry in the list can be the name of a target bean or a TargetSource; however, it is normally preferable to use the "targetName"/"target"/"targetSource" properties instead.

Global interceptors and advisors can be added at the factory level. The specified ones are expanded in an interceptor list where an "xxx*" entry is included in the list, matching the given prefix with the bean names (e.g. "global*" would match both "globalBean1" and "globalBean2", "*" all defined interceptors). The matching interceptors get applied according to their returned order value, if they implement the Ordered interface.

Creates a JDK proxy when proxy interfaces are given, and a CGLIB proxy for the actual target class if not. Note that the latter will only work if the target class does not have final methods, as a dynamic subclass will be created at runtime.

It's possible to cast a proxy obtained from this factory to Advised, or to obtain the ProxyFactoryBean reference and programmatically manipulate it. This won't work for existing prototype references, which are independent. However, it will work for prototypes subsequently obtained from the factory. Changes to interception will work immediately on singletons (including existing references). However, to change interfaces or target it's necessary to obtain a new instance from the factory. This means that singleton instances obtained from the factory do not have the same object identity. However, they do have the same interceptors and target, and changing any reference will change all objects.

Author:
Rod Johnson, Juergen Hoeller
See Also:
setInterceptorNames(java.lang.String[]), setProxyInterfaces(java.lang.Class[]), MethodInterceptor, Advisor, Advised, Serialized Form

Field Summary
static String | GLOBAL_SUFFIX This suffix in a value in an interceptor list indicates to expand globals.
protected Log | logger
Fields inherited from class org.springframework.aop.framework.AdvisedSupport
EMPTY_TARGET_SOURCE
Constructor Summary
ProxyFactoryBean()
Method Summary
protected  void adviceChanged()
Blow away and recache singleton on an advice change.
protected  Class createCompositeInterface(Class[] interfaces)
Create a composite interface Class for the given interfaces, implementing the given interfaces in one single Class.
 Object getObject()
Return a proxy.
 Class<?> getObjectType()
Return the type of the proxy.
protected  Object getProxy(AopProxy aopProxy)
Return the proxy object to expose.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setAdvisorAdapterRegistry(AdvisorAdapterRegistry advisorAdapterRegistry)
Specify the AdvisorAdapterRegistry to use.
 void setAutodetectInterfaces(boolean autodetectInterfaces)
Set whether to autodetect proxy interfaces if none specified.
 void setBeanClassLoader(ClassLoader classLoader)
Callback that supplies the bean class loader to a bean instance.
 void setBeanFactory(BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance.
 void setFrozen(boolean frozen)
Set whether this config should be frozen.
 void setInterceptorNames(String[] interceptorNames)
Set the list of Advice/Advisor bean names.
 void setProxyClassLoader(ClassLoader classLoader)
Set the ClassLoader to generate the proxy class in.
 void setProxyInterfaces(Class[] proxyInterfaces)
Set the names of the interfaces we're proxying.
 void setSingleton(boolean singleton)
Set the value of the singleton property.
 void setTargetName(String targetName)
Set the name of the target bean.
Methods inherited from class org.springframework.aop.framework.ProxyCreatorSupport
addListener, createAopProxy, getAopProxyFactory, isActive, removeListener, setAopProxyFactory
Methods inherited from class org.springframework.aop.framework.AdvisedSupport
addAdvice, addAdvice, addAdvisor, addAdvisor, addAdvisors, addAdvisors, addAllAdvisors, addInterface, adviceIncluded, copyConfigurationFrom, copyConfigurationFrom, countAdvicesOfType, getAdvisorChainFactory, getAdvisors, getAdvisorsInternal, getInterceptorsAndDynamicInterceptionAdvice, getProxiedInterfaces, getTargetClass, getTargetSource, indexOf, indexOf, isInterfaceProxied, isPreFiltered, removeAdvice, removeAdvisor, removeAdvisor, removeInterface, replaceAdvisor, setAdvisorChainFactory, setInterfaces, setPreFiltered, setTarget, setTargetClass, setTargetSource, toProxyConfigString, toString, updateAdvisorArray
Methods inherited from class org.springframework.aop.framework.ProxyConfig
copyFrom, isExposeProxy, isFrozen, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setOpaque, setOptimize, setProxyTargetClass
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.aop.framework.Advised
isExposeProxy, isFrozen, isProxyTargetClass, setExposeProxy

Field Detail

GLOBAL_SUFFIX

public static final String GLOBAL_SUFFIX
This suffix in a value in an interceptor list indicates to expand globals.

See Also:
Constant Field Values

logger

protected final Log logger
Constructor Detail

ProxyFactoryBean

public ProxyFactoryBean()
Method Detail

setProxyInterfaces

public void setProxyInterfaces(Class[] proxyInterfaces)
                        throws ClassNotFoundException
Set the names of the interfaces we're proxying. If no interface is given, a CGLIB for the actual class will be created.

This is essentially equivalent to the "setInterfaces" method, but mirrors TransactionProxyFactoryBean's "setProxyInterfaces".

Throws:
ClassNotFoundException
See Also:
AdvisedSupport.setInterfaces(java.lang.Class[]), AbstractSingletonProxyFactoryBean.setProxyInterfaces(java.lang.Class[])

setInterceptorNames

public void setInterceptorNames(String[] interceptorNames)
Set the list of Advice/Advisor bean names. This must always be set to use this factory bean in a bean factory.

The referenced beans should be of type Interceptor, Advisor or Advice The last entry in the list can be the name of any bean in the factory. If it's neither an Advice nor an Advisor, a new SingletonTargetSource is added to wrap it. Such a target bean cannot be used if the "target" or "targetSource" or "targetName" property is set, in which case the "interceptorNames" array must contain only Advice/Advisor bean names.

NOTE: Specifying a target bean as final name in the "interceptorNames" list is deprecated and will be removed in a future Spring version. Use the "targetName" property instead.

See Also:
MethodInterceptor, Advisor, Advice, SingletonTargetSource

setTargetName

public void setTargetName(String targetName)
Set the name of the target bean. This is an alternative to specifying the target name at the end of the "interceptorNames" array.

You can also specify a target object or a TargetSource object directly, via the "target"/"targetSource" property, respectively.

See Also:
setInterceptorNames(String[]), AdvisedSupport.setTarget(Object), AdvisedSupport.setTargetSource(org.springframework.aop.TargetSource)

setAutodetectInterfaces

public void setAutodetectInterfaces(boolean autodetectInterfaces)
Set whether to autodetect proxy interfaces if none specified.

Default is "true". Turn this flag off to create a CGLIB proxy for the full target class if no interfaces specified.

See Also:
ProxyConfig.setProxyTargetClass(boolean)

setSingleton

public void setSingleton(boolean singleton)
Set the value of the singleton property. Governs whether this factory should always return the same proxy instance (which implies the same target) or whether it should return a new prototype instance, which implies that the target and interceptors may be new instances also, if they are obtained from prototype bean definitions. This allows for fine control of independence/uniqueness in the object graph.

setAdvisorAdapterRegistry

public void setAdvisorAdapterRegistry(AdvisorAdapterRegistry advisorAdapterRegistry)
Specify the AdvisorAdapterRegistry to use. Default is the global AdvisorAdapterRegistry.

See Also:
GlobalAdvisorAdapterRegistry

setFrozen

public void setFrozen(boolean frozen)
Description copied from class: ProxyConfig
Set whether this config should be frozen.

When a config is frozen, no advice changes can be made. This is useful for optimization, and useful when we don't want callers to be able to manipulate configuration after casting to Advised.

Overrides:
setFrozen in class ProxyConfig

setProxyClassLoader

public void setProxyClassLoader(ClassLoader classLoader)
Set the ClassLoader to generate the proxy class in.

Default is the bean ClassLoader, i.e. the ClassLoader used by the containing BeanFactory for loading all bean classes. This can be overridden here for specific proxies.

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
BeanInitializationException

getObject

public Object getObject()
                 throws BeansException
Return a proxy. Invoked when clients obtain beans from this factory bean. Create an instance of the AOP proxy to be returned by this factory. The instance will be cached for a singleton, and create on each call to getObject() for a proxy.

Specified by:
getObject in interface FactoryBean<Object>
Returns:
a fresh AOP proxy reflecting the current state of this factory
Throws:
BeansException
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<?> getObjectType()
Return the type of the proxy. Will check the singleton instance if already created, else fall back to the proxy interface (in case of just a single one), the target bean type, or the TargetSource's target class.

Specified by:
getObjectType in interface FactoryBean<Object>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
TargetSource.getTargetClass()

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<Object>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()

createCompositeInterface

protected Class createCompositeInterface(Class[] interfaces)
Create a composite interface Class for the given interfaces, implementing the given interfaces in one single Class.

The default implementation builds a JDK proxy class for the given interfaces.

Parameters:
interfaces - the interfaces to merge
Returns:
the merged interface as Class
See Also:
Proxy.getProxyClass(java.lang.ClassLoader, java.lang.Class...)

getProxy

protected Object getProxy(AopProxy aopProxy)
Return the proxy object to expose.

The default implementation uses a getProxy call with the factory's bean class loader. Can be overridden to specify a custom class loader.

Parameters:
aopProxy - the prepared AopProxy instance to get the proxy from
Returns:
the proxy object to expose
See Also:
AopProxy.getProxy(ClassLoader)

adviceChanged

protected void adviceChanged()
Blow away and recache singleton on an advice change.

Overrides:
adviceChanged in class ProxyCreatorSupport
See Also:
AdvisedSupportListener.adviceChanged(org.springframework.aop.framework.AdvisedSupport)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ReflectiveMethodInvocation

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.aop.framework
Class ReflectiveMethodInvocation

java.lang.Object
    extended by  org.springframework.aop.framework.ReflectiveMethodInvocation
All Implemented Interfaces:
Cloneable, Invocation, Joinpoint, MethodInvocation, ProxyMethodInvocation
public class ReflectiveMethodInvocation
extends Object
implements ProxyMethodInvocation, Cloneable

Spring's implementation of the AOP Alliance MethodInvocation interface, implementing the extended ProxyMethodInvocation interface.

Invokes the target object using reflection. Subclasses can override the invokeJoinpoint() method to change this behavior, so this is also a useful base class for more specialized MethodInvocation implementations.

It is possible to clone an invocation, to invoke proceed() repeatedly (once per clone), using the invocableClone() method. It is also possible to attach custom attributes to the invocation, using the setUserAttribute(java.lang.String, java.lang.Object) / getUserAttribute(java.lang.String) methods.

NOTE: This class is considered internal and should not be directly accessed. The sole reason for it being public is compatibility with existing framework integrations (e.g. Pitchfork). For any other purposes, use the ProxyMethodInvocation interface instead.

Author:
Rod Johnson, Juergen Hoeller, Adrian Colyer
See Also:
invokeJoinpoint(),
proceed(),
invocableClone(),
setUserAttribute(java.lang.String, java.lang.Object),
getUserAttribute(java.lang.String)

Field Summary
protected Object[] | arguments
protected List | interceptorsAndDynamicMethodMatchers List of MethodInterceptor and InterceptorAndDynamicMethodMatcher that need dynamic checks.
protected Method | method
protected Object | proxy
protected Object | target
Constructor Summary
protected ReflectiveMethodInvocation(Object proxy, Object target, Method method, Object[] arguments, Class targetClass, List<Object> interceptorsAndDynamicMethodMatchers)
Construct a new ReflectiveMethodInvocation with the given arguments.
Method Summary
Object[] | getArguments()
Method | getMethod() Return the method invoked on the proxied interface.
Object | getProxy() Return the proxy that this method invocation was made through.
AccessibleObject | getStaticPart()
Object | getThis()
Object | getUserAttribute(String key) Return the value of the specified user attribute.
Map<String,Object> | getUserAttributes() Return user attributes associated with this invocation.
MethodInvocation | invocableClone() This implementation returns a shallow copy of this invocation object, including an independent copy of the original arguments array.
MethodInvocation | invocableClone(Object[] arguments) This implementation returns a shallow copy of this invocation object, using the given arguments array for the clone.
protected Object | invokeJoinpoint() Invoke the joinpoint using reflection.
Object | proceed()
void | setArguments(Object[] arguments) Set the arguments to be used on subsequent invocations in the any advice in this chain.
void | setUserAttribute(String key, Object value) Add the specified user attribute with the given value to this invocation.
String | toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

proxy

protected final Object proxy

target

protected final Object target

method

protected final Method method

arguments

protected Object[] arguments

interceptorsAndDynamicMethodMatchers

protected final List interceptorsAndDynamicMethodMatchers
List of MethodInterceptor and InterceptorAndDynamicMethodMatcher that need dynamic checks.

Constructor Detail

ReflectiveMethodInvocation

protected ReflectiveMethodInvocation(Object proxy,
                                     Object target,
                                     Method method,
                                     Object[] arguments,
                                     Class targetClass,
                                     List<Object> interceptorsAndDynamicMethodMatchers)
Construct a new ReflectiveMethodInvocation with the given arguments.

Parameters:
proxy - the proxy object that the invocation was made on
target - the target object to invoke
method - the method to invoke
arguments - the arguments to invoke the method with
targetClass - the target class, for MethodMatcher invocations
interceptorsAndDynamicMethodMatchers - interceptors that should be applied, along with any InterceptorAndDynamicMethodMatchers that need evaluation at runtime. MethodMatchers included in this struct must already have been found to have matched as far as was possibly statically. Passing an array might be about 10% faster, but would complicate the code. And it would work only for static pointcuts.
Method Detail

getProxy

public final Object getProxy()
Description copied from interface: ProxyMethodInvocation
Return the proxy that this method invocation was made through.

Specified by:
getProxy in interface ProxyMethodInvocation
Returns:
the original proxy object

getThis

public final Object getThis()
Specified by:
getThis in interface Joinpoint

getStaticPart

public final AccessibleObject getStaticPart()
Specified by:
getStaticPart in interface Joinpoint

getMethod

public final Method getMethod()
Return the method invoked on the proxied interface. May or may not correspond with a method invoked on an underlying implementation of that interface.

Specified by:
getMethod in interface MethodInvocation

getArguments

public final Object[] getArguments()
Specified by:
getArguments in interface Invocation

setArguments

public void setArguments(Object[] arguments)
Description copied from interface: ProxyMethodInvocation
Set the arguments to be used on subsequent invocations in the any advice in this chain.

Specified by:
setArguments in interface ProxyMethodInvocation
Parameters:
arguments - the argument array

proceed

public Object proceed()
               throws Throwable
Specified by:
proceed in interface Joinpoint
Throws:
Throwable

invokeJoinpoint

protected Object invokeJoinpoint()
                          throws Throwable
Invoke the joinpoint using reflection. Subclasses can override this to use custom invocation.

Returns:
the return value of the joinpoint
Throws:
Throwable - if invoking the joinpoint resulted in an exception

invocableClone

public MethodInvocation invocableClone()
This implementation returns a shallow copy of this invocation object, including an independent copy of the original arguments array.

We want a shallow copy in this case: We want to use the same interceptor chain and other object references, but we want an independent value for the current interceptor index.

Specified by:
invocableClone in interface ProxyMethodInvocation
Returns:
an invocable clone of this invocation. proceed() can be called once per clone.
See Also:
Object.clone()

invocableClone

public MethodInvocation invocableClone(Object[] arguments)
This implementation returns a shallow copy of this invocation object, using the given arguments array for the clone.

We want a shallow copy in this case: We want to use the same interceptor chain and other object references, but we want an independent value for the current interceptor index.

Specified by:
invocableClone in interface ProxyMethodInvocation
Parameters:
arguments - the arguments that the cloned invocation is supposed to use, overriding the original arguments
Returns:
an invocable clone of this invocation. proceed() can be called once per clone.
See Also:
Object.clone()

setUserAttribute

public void setUserAttribute(String key,
                             Object value)
Description copied from interface: ProxyMethodInvocation
Add the specified user attribute with the given value to this invocation.

Such attributes are not used within the AOP framework itself. They are just kept as part of the invocation object, for use in special interceptors.

Specified by:
setUserAttribute in interface ProxyMethodInvocation
Parameters:
key - the name of the attribute
value - the value of the attribute, or null to reset it

getUserAttribute

public Object getUserAttribute(String key)
Description copied from interface: ProxyMethodInvocation
Return the value of the specified user attribute.

Specified by:
getUserAttribute in interface ProxyMethodInvocation
Parameters:
key - the name of the attribute
Returns:
the value of the attribute, or null if not set
See Also:
ProxyMethodInvocation.setUserAttribute(java.lang.String, java.lang.Object)

getUserAttributes

public Map<String,Object> getUserAttributes()
Return user attributes associated with this invocation. This method provides an invocation-bound alternative to a ThreadLocal.

This map is initialized lazily and is not used in the AOP framework itself.

Returns:
any user attributes associated with this invocation (never null)

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AopConfigException

org.springframework.aop.framework
Class AopConfigException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.aop.framework.AopConfigException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
NotAnAtAspectException
public class AopConfigException
extends NestedRuntimeException

Exception that gets thrown on illegal AOP configuration arguments.

Since:
13.03.2003
Author:
Rod Johnson
See Also:
Serialized Form

Constructor Summary
AopConfigException(String msg)
Constructor for AopConfigException.
AopConfigException(String msg, Throwable cause)
Constructor for AopConfigException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AopConfigException

public AopConfigException(String msg)
Constructor for AopConfigException.

Parameters:
msg - the detail message

AopConfigException

public AopConfigException(String msg,
                          Throwable cause)
Constructor for AopConfigException.

Parameters:
msg - the detail message
cause - the root cause
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.aop.framework.adapter

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.aop.framework.adapter

SPI package allowing Spring AOP framework to handle arbitrary advice types.

See:
Description

Interface Summary
AdvisorAdapter | Interface allowing extension to the Spring AOP framework to allow handling of new Advisors and Advice types.
AdvisorAdapterRegistry | Interface for registries of Advisor adapters.

Class Summary
AdvisorAdapterRegistrationManager | BeanPostProcessor that registers AdvisorAdapter beans in the BeanFactory with an AdvisorAdapterRegistry (by default the GlobalAdvisorAdapterRegistry).
AfterReturningAdviceInterceptor | Interceptor to wrap am AfterReturningAdvice.
DefaultAdvisorAdapterRegistry | Default implementation of the AdvisorAdapterRegistry interface.
GlobalAdvisorAdapterRegistry | Singleton to publish a shared DefaultAdvisorAdapterRegistry instance.
MethodBeforeAdviceInterceptor | Interceptor to wrap am MethodBeforeAdvice.
ThrowsAdviceInterceptor | Interceptor to wrap an after-throwing advice.

Exception Summary
UnknownAdviceTypeException Exception thrown when an attempt is made to use an unsupported Advisor or Advice type.

Package org.springframework.aop.framework.adapter Description

SPI package allowing Spring AOP framework to handle arbitrary advice types.
Users who want merely to use the Spring AOP framework, rather than extend its capabilities, don't need to concern themselves with this package.
You may wish to use these adapters to wrap Spring-specific advices, such as MethodBeforeAdvice, in MethodInterceptor, to allow their use in another AOP framework supporting the AOP Alliance interfaces.

These adapters do not depend on any other Spring framework classes to allow such usage.


org.springframework.aop.framework.adapter Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.aop.framework.adapter

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.aop.framework.adapter.AdvisorAdapterRegistrationManager (implements org.springframework.beans.factory.config.BeanPostProcessor)
    • org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor (implements org.springframework.aop.AfterAdvice, org.aopalliance.intercept.MethodInterceptor, java.io.Serializable)
    • org.springframework.aop.framework.adapter.DefaultAdvisorAdapterRegistry (implements org.springframework.aop.framework.adapter.AdvisorAdapterRegistry, java.io.Serializable)
    • org.springframework.aop.framework.adapter.GlobalAdvisorAdapterRegistry
    • org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor (implements org.aopalliance.intercept.MethodInterceptor, java.io.Serializable)
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • java.lang.IllegalArgumentException
            • org.springframework.aop.framework.adapter.UnknownAdviceTypeException
    • org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor (implements org.springframework.aop.AfterAdvice, org.aopalliance.intercept.MethodInterceptor)

Interface Hierarchy

  • org.springframework.aop.framework.adapter.AdvisorAdapter
  • org.springframework.aop.framework.adapter.AdvisorAdapterRegistry


AdvisorAdapter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.aop.framework.adapter
Interface AdvisorAdapter

public interface AdvisorAdapter

Interface allowing extension to the Spring AOP framework to allow handling of new Advisors and Advice types.

Implementing objects can create AOP Alliance Interceptors from custom advice types, enabling these advice types to be used in the Spring AOP framework, which uses interception under the covers.

There is no need for most Spring users to implement this interface; do so only if you need to introduce more Advisor or Advice types to Spring.

Author:
Rod Johnson

Method Summary
MethodInterceptor | getInterceptor(Advisor advisor) Return an AOP Alliance MethodInterceptor exposing the behavior of the given advice to an interception-based AOP framework.
boolean | supportsAdvice(Advice advice) Does this adapter understand this advice object? Is it valid to invoke the getInterceptors method with an Advisor that contains this advice as an argument?

Method Detail

supportsAdvice

boolean supportsAdvice(Advice advice)
Does this adapter understand this advice object? Is it valid to invoke the getInterceptors method with an Advisor that contains this advice as an argument?

Parameters:
advice - an Advice such as a BeforeAdvice
Returns:
whether this adapter understands the given advice object
See Also:
getInterceptor(org.springframework.aop.Advisor), BeforeAdvice

getInterceptor

MethodInterceptor getInterceptor(Advisor advisor)
Return an AOP Alliance MethodInterceptor exposing the behavior of the given advice to an interception-based AOP framework.

Don't worry about any Pointcut contained in the Advisor; the AOP framework will take care of checking the pointcut.

Parameters:
advisor - the Advisor. The supportsAdvice() method must have returned true on this object
Returns:
an AOP Alliance interceptor for this Advisor. There's no need to cache instances for efficiency, as the AOP framework caches advice chains.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AdvisorAdapterRegistry

org.springframework.aop.framework.adapter
Interface AdvisorAdapterRegistry

All Known Implementing Classes:
DefaultAdvisorAdapterRegistry
public interface AdvisorAdapterRegistry

Interface for registries of Advisor adapters.

This is an SPI interface, not to be implemented by any Spring user.

Author:
Rod Johnson, Rob Harrop

Method Summary
MethodInterceptor[] | getInterceptors(Advisor advisor) Return an array of AOP Alliance MethodInterceptors to allow use of the given Advisor in an interception-based framework.
void | registerAdvisorAdapter(AdvisorAdapter adapter) Register the given AdvisorAdapter.
Advisor | wrap(Object advice) Return an Advisor wrapping the given advice.

Method Detail

wrap

Advisor wrap(Object advice)
             throws UnknownAdviceTypeException
Return an Advisor wrapping the given advice.

Should by default at least support MethodInterceptor, MethodBeforeAdvice, AfterReturningAdvice, ThrowsAdvice.

Parameters:
advice - object that should be an advice
Returns:
an Advisor wrapping the given advice. Never returns null. If the advice parameter is an Advisor, return it.
Throws:
UnknownAdviceTypeException - if no registered advisor adapter can wrap the supposed advice

getInterceptors

MethodInterceptor[] getInterceptors(Advisor advisor)
                                    throws UnknownAdviceTypeException
Return an array of AOP Alliance MethodInterceptors to allow use of the given Advisor in an interception-based framework.

Don't worry about the pointcut associated with the Advisor, if it's a PointcutAdvisor: just return an interceptor.

Parameters:
advisor - Advisor to find an interceptor for
Returns:
an array of MethodInterceptors to expose this Advisor's behavior
Throws:
UnknownAdviceTypeException - if the Advisor type is not understood by any registered AdvisorAdapter.

registerAdvisorAdapter

void registerAdvisorAdapter(AdvisorAdapter adapter)
Register the given AdvisorAdapter. Note that it is not necessary to register adapters for an AOP Alliance Interceptors or Spring Advices: these must be automatically recognized by an AdvisorAdapterRegistry implementation.

Parameters:
adapter - AdvisorAdapter that understands a particular Advisor or Advice types
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AdvisorAdapterRegistrationManager

org.springframework.aop.framework.adapter
Class AdvisorAdapterRegistrationManager

java.lang.Object
    extended by  org.springframework.aop.framework.adapter.AdvisorAdapterRegistrationManager
All Implemented Interfaces:
BeanPostProcessor
public class AdvisorAdapterRegistrationManager
extends Object
implements BeanPostProcessor

BeanPostProcessor that registers AdvisorAdapter beans in the BeanFactory with an AdvisorAdapterRegistry (by default the GlobalAdvisorAdapterRegistry).

The only requirement for it to work is that it needs to be defined in application context along with "non-native" Spring AdvisorAdapters that need to be "recognized" by Spring's AOP framework.

Since:
27.02.2004
Author:
Dmitriy Kopylenko, Juergen Hoeller
See Also:
setAdvisorAdapterRegistry(org.springframework.aop.framework.adapter.AdvisorAdapterRegistry), AdvisorAdapter

Constructor Summary
AdvisorAdapterRegistrationManager()
Method Summary
Object | postProcessAfterInitialization(Object bean, String beanName) Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).
Object | postProcessBeforeInitialization(Object bean, String beanName) Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).
void | setAdvisorAdapterRegistry(AdvisorAdapterRegistry advisorAdapterRegistry) Specify the AdvisorAdapterRegistry to register AdvisorAdapter beans with.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AdvisorAdapterRegistrationManager

public AdvisorAdapterRegistrationManager()
Method Detail

setAdvisorAdapterRegistry

public void setAdvisorAdapterRegistry(AdvisorAdapterRegistry advisorAdapterRegistry)
Specify the AdvisorAdapterRegistry to register AdvisorAdapter beans with. Default is the global AdvisorAdapterRegistry.

See Also:
GlobalAdvisorAdapterRegistry

postProcessBeforeInitialization

public Object postProcessBeforeInitialization(Object bean,
                                              String beanName)
                                       throws BeansException
Description copied from interface: BeanPostProcessor
Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

Specified by:
postProcessBeforeInitialization in interface BeanPostProcessor
Parameters:
bean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
Throws:
BeansException - in case of errors
See Also:
InitializingBean.afterPropertiesSet()

postProcessAfterInitialization

public Object postProcessAfterInitialization(Object bean,
                                             String beanName)
                                      throws BeansException
Description copied from interface: BeanPostProcessor
Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

In case of a FactoryBean, this callback will be invoked for both the FactoryBean instance and the objects created by the FactoryBean (as of Spring 2.0). The post-processor can decide whether to apply to either the FactoryBean or created objects or both through corresponding bean instanceof FactoryBean checks.

This callback will also be invoked after a short-circuiting triggered by a InstantiationAwareBeanPostProcessor.postProcessBeforeInstantiation(java.lang.Class, java.lang.String) method, in contrast to all other BeanPostProcessor callbacks.

Specified by:
postProcessAfterInitialization in interface BeanPostProcessor
Parameters:
bean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
Throws:
BeansException - in case of errors
See Also:
InitializingBean.afterPropertiesSet(), FactoryBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AfterReturningAdviceInterceptor

org.springframework.aop.framework.adapter
Class AfterReturningAdviceInterceptor

java.lang.Object
    extended by  org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor
All Implemented Interfaces:
Serializable, Advice, Interceptor, MethodInterceptor, AfterAdvice
public class AfterReturningAdviceInterceptor
extends Object
implements MethodInterceptor, AfterAdvice, Serializable

Interceptor to wrap am AfterReturningAdvice. Used internally by the AOP framework; application developers should not need to use this class directly.

Author:
Rod Johnson
See Also:
Serialized Form

Constructor Summary
AfterReturningAdviceInterceptor(AfterReturningAdvice advice)
Create a new AfterReturningAdviceInterceptor for the given advice.
Method Summary
 Object invoke(MethodInvocation mi)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AfterReturningAdviceInterceptor

public AfterReturningAdviceInterceptor(AfterReturningAdvice advice)
Create a new AfterReturningAdviceInterceptor for the given advice.

Parameters:
advice - the AfterReturningAdvice to wrap
Method Detail

invoke

public Object invoke(MethodInvocation mi)
              throws Throwable
Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultAdvisorAdapterRegistry

org.springframework.aop.framework.adapter
Class DefaultAdvisorAdapterRegistry

java.lang.Object
    extended by  org.springframework.aop.framework.adapter.DefaultAdvisorAdapterRegistry
All Implemented Interfaces:
Serializable, AdvisorAdapterRegistry
public class DefaultAdvisorAdapterRegistry
extends Object
implements AdvisorAdapterRegistry, Serializable

Default implementation of the AdvisorAdapterRegistry interface. Supports MethodInterceptor, MethodBeforeAdvice, AfterReturningAdvice, ThrowsAdvice.

Author:
Rod Johnson, Rob Harrop, Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
DefaultAdvisorAdapterRegistry()
Create a new DefaultAdvisorAdapterRegistry, registering well-known adapters.
Method Summary
MethodInterceptor[] | getInterceptors(Advisor advisor) Return an array of AOP Alliance MethodInterceptors to allow use of the given Advisor in an interception-based framework.
void | registerAdvisorAdapter(AdvisorAdapter adapter) Register the given AdvisorAdapter.
Advisor | wrap(Object adviceObject) Return an Advisor wrapping the given advice.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DefaultAdvisorAdapterRegistry

public DefaultAdvisorAdapterRegistry()
Create a new DefaultAdvisorAdapterRegistry, registering well-known adapters.

Method Detail

wrap

public Advisor wrap(Object adviceObject)
             throws UnknownAdviceTypeException
Description copied from interface: AdvisorAdapterRegistry
Return an Advisor wrapping the given advice.

Should by default at least support MethodInterceptor, MethodBeforeAdvice, AfterReturningAdvice, ThrowsAdvice.

Specified by:
wrap in interface AdvisorAdapterRegistry
Parameters:
adviceObject - object that should be an advice
Returns:
an Advisor wrapping the given advice. Never returns null. If the advice parameter is an Advisor, return it.
Throws:
UnknownAdviceTypeException - if no registered advisor adapter can wrap the supposed advice

getInterceptors

public MethodInterceptor[] getInterceptors(Advisor advisor)
                                    throws UnknownAdviceTypeException
Description copied from interface: AdvisorAdapterRegistry
Return an array of AOP Alliance MethodInterceptors to allow use of the given Advisor in an interception-based framework.

Don't worry about the pointcut associated with the Advisor, if it's a PointcutAdvisor: just return an interceptor.

Specified by:
getInterceptors in interface AdvisorAdapterRegistry
Parameters:
advisor - Advisor to find an interceptor for
Returns:
an array of MethodInterceptors to expose this Advisor's behavior
Throws:
UnknownAdviceTypeException - if the Advisor type is not understood by any registered AdvisorAdapter.

registerAdvisorAdapter

public void registerAdvisorAdapter(AdvisorAdapter adapter)
Description copied from interface: AdvisorAdapterRegistry
Register the given AdvisorAdapter. Note that it is not necessary to register adapters for an AOP Alliance Interceptors or Spring Advices: these must be automatically recognized by an AdvisorAdapterRegistry implementation.

Specified by:
registerAdvisorAdapter in interface AdvisorAdapterRegistry
Parameters:
adapter - AdvisorAdapter that understands a particular Advisor or Advice types
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


GlobalAdvisorAdapterRegistry

org.springframework.aop.framework.adapter
Class GlobalAdvisorAdapterRegistry

java.lang.Object
    extended by  org.springframework.aop.framework.adapter.GlobalAdvisorAdapterRegistry

public abstract class GlobalAdvisorAdapterRegistry
extends Object

Singleton to publish a shared DefaultAdvisorAdapterRegistry instance.

Author:
Rod Johnson, Juergen Hoeller
See Also:
DefaultAdvisorAdapterRegistry

Constructor Summary
GlobalAdvisorAdapterRegistry()
Method Summary
static AdvisorAdapterRegistry getInstance()
Return the singleton DefaultAdvisorAdapterRegistry instance.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

GlobalAdvisorAdapterRegistry

public GlobalAdvisorAdapterRegistry()
Method Detail

getInstance

public static AdvisorAdapterRegistry getInstance()
Return the singleton DefaultAdvisorAdapterRegistry instance.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MethodBeforeAdviceInterceptor

org.springframework.aop.framework.adapter
Class MethodBeforeAdviceInterceptor

java.lang.Object
    extended by  org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor
All Implemented Interfaces:
Serializable, Advice, Interceptor, MethodInterceptor
public class MethodBeforeAdviceInterceptor
extends Object
implements MethodInterceptor, Serializable

Interceptor to wrap am MethodBeforeAdvice. Used internally by the AOP framework; application developers should not need to use this class directly.

Author:
Rod Johnson
See Also:
Serialized Form

Constructor Summary
MethodBeforeAdviceInterceptor(MethodBeforeAdvice advice)
Create a new MethodBeforeAdviceInterceptor for the given advice.
Method Summary
 Object invoke(MethodInvocation mi)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MethodBeforeAdviceInterceptor

public MethodBeforeAdviceInterceptor(MethodBeforeAdvice advice)
Create a new MethodBeforeAdviceInterceptor for the given advice.

Parameters:
advice - the MethodBeforeAdvice to wrap
Method Detail

invoke

public Object invoke(MethodInvocation mi)
              throws Throwable
Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ThrowsAdviceInterceptor

org.springframework.aop.framework.adapter
Class ThrowsAdviceInterceptor

java.lang.Object
    extended by  org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, AfterAdvice
public class ThrowsAdviceInterceptor
extends Object
implements MethodInterceptor, AfterAdvice

Interceptor to wrap an after-throwing advice.

The signatures on handler methods on the ThrowsAdvice implementation method argument must be of the form:
void afterThrowing([Method, args, target], ThrowableSubclass);

Only the last argument is required.

Some examples of valid methods would be:

public void afterThrowing(Exception ex)
public void afterThrowing(RemoteException)
public void afterThrowing(Method method, Object[] args, Object target, Exception ex)
public void afterThrowing(Method method, Object[] args, Object target, ServletException ex)

This is a framework class that need not be used directly by Spring users.

Author:
Rod Johnson, Juergen Hoeller

Constructor Summary
ThrowsAdviceInterceptor(Object throwsAdvice)
Create a new ThrowsAdviceInterceptor for the given ThrowsAdvice.
Method Summary
int | getHandlerMethodCount()
Object | invoke(MethodInvocation mi)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ThrowsAdviceInterceptor

public ThrowsAdviceInterceptor(Object throwsAdvice)
Create a new ThrowsAdviceInterceptor for the given ThrowsAdvice.

Parameters:
throwsAdvice - the advice object that defines the exception handler methods (usually a ThrowsAdvice implementation)
Method Detail

getHandlerMethodCount

public int getHandlerMethodCount()

invoke

public Object invoke(MethodInvocation mi)
              throws Throwable
Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UnknownAdviceTypeException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.aop.framework.adapter
Class UnknownAdviceTypeException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  java.lang.IllegalArgumentException
                    extended by  org.springframework.aop.framework.adapter.UnknownAdviceTypeException
All Implemented Interfaces:
Serializable
public class UnknownAdviceTypeException
extends IllegalArgumentException

Exception thrown when an attempt is made to use an unsupported Advisor or Advice type.

Author:
Rod Johnson, Juergen Hoeller
See Also:
Advice, Advisor, Serialized Form

Constructor Summary
UnknownAdviceTypeException(Object advice)
Create a new UnknownAdviceTypeException for the given advice object.
UnknownAdviceTypeException(String message)
Create a new UnknownAdviceTypeException with the given message.
Method Summary
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

UnknownAdviceTypeException

public UnknownAdviceTypeException(Object advice)
Create a new UnknownAdviceTypeException for the given advice object. Will create a message text that says that the object is neither a subinterface of Advice nor an Advisor.

Parameters:
advice - the advice object of unknown type

UnknownAdviceTypeException

public UnknownAdviceTypeException(String message)
Create a new UnknownAdviceTypeException with the given message.

Parameters:
message - the message text
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.aop.framework.autoproxy

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.aop.framework.autoproxy

Bean post-processors for use in ApplicationContexts to simplify AOP usage by automatically creating AOP proxies without the need to use a ProxyFactoryBean.

See:
Description

Interface Summary
TargetSourceCreator Implementations can create special target sources, such as pooling target sources, for particular beans.

Class Summary
AbstractAdvisorAutoProxyCreator | Generic auto proxy creator that builds AOP proxies for specific beans based on detected Advisors for each bean.
AbstractAutoProxyCreator | BeanPostProcessor implementation that wraps each eligible bean with an AOP proxy, delegating to specified interceptors before invoking the bean itself.
AutoProxyUtils | Utilities for auto-proxy aware components.
BeanFactoryAdvisorRetrievalHelper | Helper for retrieving standard Spring Advisors from a BeanFactory, for use with auto-proxying.
BeanNameAutoProxyCreator | Auto proxy creator that identifies beans to proxy via a list of names.
DefaultAdvisorAutoProxyCreator | BeanPostProcessor implementation that creates AOP proxies based on all candidate Advisors in the current BeanFactory.
InfrastructureAdvisorAutoProxyCreator | Auto-proxy creator that considers infrastructure Advisor beans only, ignoring any application-defined Advisors.
ProxyCreationContext | Holder for the current proxy creation context, as exposed by auto-proxy creators such as AbstractAdvisorAutoProxyCreator.

Package org.springframework.aop.framework.autoproxy Description

Bean post-processors for use in ApplicationContexts to simplify AOP usage by automatically creating AOP proxies without the need to use a ProxyFactoryBean.

The various post-processors in this package need only be added to an ApplicationContext (typically in an XML bean definition document) to automatically proxy selected beans.

NB: Automatic auto-proxying is not supported for BeanFactory implementations, as post-processors beans are only automatically detected in application contexts. Post-processors can be explicitly registered on a ConfigurableBeanFactory instead.


org.springframework.aop.framework.autoproxy Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.aop.framework.autoproxy

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.aop.framework.autoproxy.AutoProxyUtils
    • org.springframework.aop.framework.autoproxy.BeanFactoryAdvisorRetrievalHelper
    • org.springframework.aop.framework.ProxyConfig (implements java.io.Serializable)
      • org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator (implements org.springframework.aop.framework.AopInfrastructureBean, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.core.Ordered, org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor)
        • org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
          • org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator (implements org.springframework.beans.factory.BeanNameAware)
          • org.springframework.aop.framework.autoproxy.InfrastructureAdvisorAutoProxyCreator
        • org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator
    • org.springframework.aop.framework.autoproxy.ProxyCreationContext

Interface Hierarchy

  • org.springframework.aop.framework.autoproxy.TargetSourceCreator


TargetSourceCreator

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.aop.framework.autoproxy
Interface TargetSourceCreator

All Known Implementing Classes:
AbstractBeanFactoryBasedTargetSourceCreator, LazyInitTargetSourceCreator, QuickTargetSourceCreator
public interface TargetSourceCreator

Implementations can create special target sources, such as pooling target sources, for particular beans. For example, they may base their choice on attributes, such as a pooling attribute, on the target class.

AbstractAutoProxyCreator can support a number of TargetSourceCreators, which will be applied in order.

Author:
Rod Johnson, Juergen Hoeller

Method Summary
 TargetSource getTargetSource(Class<?> beanClass, String beanName)
Create a special TargetSource for the given bean, if any.

Method Detail

getTargetSource

TargetSource getTargetSource(Class<?> beanClass,
                             String beanName)
Create a special TargetSource for the given bean, if any.

Parameters:
beanClass - the class of the bean to create a TargetSource for
beanName - the name of the bean
Returns:
a special TargetSource or null if this TargetSourceCreator isn't interested in the particular bean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractAdvisorAutoProxyCreator

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.aop.framework.autoproxy
Class AbstractAdvisorAutoProxyCreator

java.lang.Object
    extended by  org.springframework.aop.framework.ProxyConfig
        extended by  org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
            extended by  org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
All Implemented Interfaces:
Serializable, AopInfrastructureBean, BeanClassLoaderAware, BeanFactoryAware, BeanPostProcessor, InstantiationAwareBeanPostProcessor, SmartInstantiationAwareBeanPostProcessor, Ordered
Direct Known Subclasses:
AspectJAwareAdvisorAutoProxyCreator, DefaultAdvisorAutoProxyCreator, InfrastructureAdvisorAutoProxyCreator
public abstract class AbstractAdvisorAutoProxyCreator
extends AbstractAutoProxyCreator

Generic auto proxy creator that builds AOP proxies for specific beans based on detected Advisors for each bean.

Subclasses must implement the abstract findCandidateAdvisors() method to return a list of Advisors applying to any object. Subclasses can also override the inherited AbstractAutoProxyCreator.shouldSkip(java.lang.Class, java.lang.String) method to exclude certain objects from auto-proxying.

Advisors or advices requiring ordering should implement the Ordered interface. This class sorts Advisors by Ordered order value. Advisors that don't implement the Ordered interface will be considered as unordered; they will appear at the end of the advisor chain in undefined order.

Author:
Rod Johnson, Juergen Hoeller
See Also:
findCandidateAdvisors(), Serialized Form

Field Summary
Fields inherited from class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
DO_NOT_PROXY, logger, PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AbstractAdvisorAutoProxyCreator()
Method Summary
protected boolean | advisorsPreFiltered() This auto-proxy creator always returns pre-filtered Advisors.
protected void | extendAdvisors(List<Advisor> candidateAdvisors) Extension hook that subclasses can override to register additional Advisors, given the sorted Advisors obtained to date.
protected List<Advisor> | findAdvisorsThatCanApply(List<Advisor> candidateAdvisors, Class beanClass, String beanName) Search the given candidate Advisors to find all Advisors that can apply to the specified bean.
protected List<Advisor> | findCandidateAdvisors() Find all candidate Advisors to use in auto-proxying.
protected List<Advisor> | findEligibleAdvisors(Class beanClass, String beanName) Find all eligible Advisors for auto-proxying this class.
protected Object[] | getAdvicesAndAdvisorsForBean(Class beanClass, String beanName, TargetSource targetSource) Return whether the given bean is to be proxied, what additional advices (e.g.
protected void | initBeanFactory(ConfigurableListableBeanFactory beanFactory)
protected boolean | isEligibleAdvisorBean(String beanName) Return whether the Advisor bean with the given name is eligible for proxying in the first place.
void | setBeanFactory(BeanFactory beanFactory) Callback that supplies the owning factory to a bean instance.
protected List<Advisor> | sortAdvisors(List<Advisor> advisors) Sort advisors based on ordering.
Methods inherited from class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
buildAdvisors, createProxy, customizeProxyFactory, determineCandidateConstructors, getBeanFactory, getCacheKey, getCustomTargetSource, getEarlyBeanReference, getOrder, isFrozen, isInfrastructureClass, postProcessAfterInitialization, postProcessAfterInstantiation, postProcessBeforeInitialization, postProcessBeforeInstantiation, postProcessPropertyValues, predictBeanType, setAdvisorAdapterRegistry, setApplyCommonInterceptorsFirst, setBeanClassLoader, setCustomTargetSourceCreators, setFrozen, setInterceptorNames, setOrder, setProxyClassLoader, shouldProxyTargetClass, shouldSkip, wrapIfNecessary
Methods inherited from class org.springframework.aop.framework.ProxyConfig
copyFrom, isExposeProxy, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setOpaque, setOptimize, setProxyTargetClass, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AbstractAdvisorAutoProxyCreator

public AbstractAdvisorAutoProxyCreator()
Method Detail

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Overrides:
setBeanFactory in class AbstractAutoProxyCreator
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
BeanInitializationException

initBeanFactory

protected void initBeanFactory(ConfigurableListableBeanFactory beanFactory)

getAdvicesAndAdvisorsForBean

protected Object[] getAdvicesAndAdvisorsForBean(Class beanClass,
                                                String beanName,
                                                TargetSource targetSource)
Description copied from class: AbstractAutoProxyCreator
Return whether the given bean is to be proxied, what additional advices (e.g. AOP Alliance interceptors) and advisors to apply.

Specified by:
getAdvicesAndAdvisorsForBean in class AbstractAutoProxyCreator
Parameters:
beanClass - the class of the bean to advise
beanName - the name of the bean
targetSource - the TargetSource returned by the AbstractAutoProxyCreator.getCustomTargetSource(java.lang.Class, java.lang.String) method: may be ignored. Will be null if no custom target source is in use.
Returns:
an array of additional interceptors for the particular bean; or an empty array if no additional interceptors but just the common ones; or null if no proxy at all, not even with the common interceptors. See constants DO_NOT_PROXY and PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS.
See Also:
AbstractAutoProxyCreator.DO_NOT_PROXY, AbstractAutoProxyCreator.PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS

findEligibleAdvisors

protected List<Advisor> findEligibleAdvisors(Class beanClass,
                                             String beanName)
Find all eligible Advisors for auto-proxying this class.

Parameters:
beanClass - the clazz to find advisors for
beanName - the name of the currently proxied bean
Returns:
the empty List, not null, if there are no pointcuts or interceptors
See Also:
findCandidateAdvisors(),
sortAdvisors(java.util.List),
extendAdvisors(java.util.List)

findCandidateAdvisors

protected List<Advisor> findCandidateAdvisors()
Find all candidate Advisors to use in auto-proxying.

Returns:
the List of candidate Advisors

findAdvisorsThatCanApply

protected List<Advisor> findAdvisorsThatCanApply(List<Advisor> candidateAdvisors,
                                                 Class beanClass,
                                                 String beanName)
Search the given candidate Advisors to find all Advisors that can apply to the specified bean.

Parameters:
candidateAdvisors - the candidate Advisors
beanClass - the target's bean class
beanName - the target's bean name
Returns:
the List of applicable Advisors
See Also:
ProxyCreationContext.getCurrentProxiedBeanName()

isEligibleAdvisorBean

protected boolean isEligibleAdvisorBean(String beanName)
Return whether the Advisor bean with the given name is eligible for proxying in the first place.

Parameters:
beanName - the name of the Advisor bean
Returns:
whether the bean is eligible

sortAdvisors

protected List<Advisor> sortAdvisors(List<Advisor> advisors)
Sort advisors based on ordering. Subclasses may choose to override this method to customize the sorting strategy.

Parameters:
advisors - the source List of Advisors
Returns:
the sorted List of Advisors
See Also:
Ordered, OrderComparator

extendAdvisors

protected void extendAdvisors(List<Advisor> candidateAdvisors)
Extension hook that subclasses can override to register additional Advisors, given the sorted Advisors obtained to date.

The default implementation is empty.

Typically used to add Advisors that expose contextual information required by some of the later advisors.

Parameters:
candidateAdvisors - Advisors that have already been identified as applying to a given bean

advisorsPreFiltered

protected boolean advisorsPreFiltered()
This auto-proxy creator always returns pre-filtered Advisors.

Overrides:
advisorsPreFiltered in class AbstractAutoProxyCreator
Returns:
whether the Advisors are pre-filtered
See Also:
AbstractAutoProxyCreator.getAdvicesAndAdvisorsForBean(java.lang.Class, java.lang.String, org.springframework.aop.TargetSource), Advised.setPreFiltered(boolean)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractAutoProxyCreator

org.springframework.aop.framework.autoproxy
Class AbstractAutoProxyCreator

java.lang.Object
    extended by  org.springframework.aop.framework.ProxyConfig
        extended by  org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
All Implemented Interfaces:
Serializable, AopInfrastructureBean, BeanClassLoaderAware, BeanFactoryAware, BeanPostProcessor, InstantiationAwareBeanPostProcessor, SmartInstantiationAwareBeanPostProcessor, Ordered
Direct Known Subclasses:
AbstractAdvisorAutoProxyCreator, BeanNameAutoProxyCreator
public abstract class AbstractAutoProxyCreator
extends ProxyConfig
implements SmartInstantiationAwareBeanPostProcessor, BeanClassLoaderAware, BeanFactoryAware, Ordered, AopInfrastructureBean

BeanPostProcessor implementation that wraps each eligible bean with an AOP proxy, delegating to specified interceptors before invoking the bean itself.

This class distinguishes between "common" interceptors: shared for all proxies it creates, and "specific" interceptors: unique per bean instance. There need not be any common interceptors. If there are, they are set using the interceptorNames property. As with ProxyFactoryBean, interceptors names in the current factory are used rather than bean references to allow correct handling of prototype advisors and interceptors: for example, to support stateful mixins. Any advice type is supported for "interceptorNames" entries.

Such auto-proxying is particularly useful if there's a large number of beans that need to be wrapped with similar proxies, i.e. delegating to the same interceptors. Instead of x repetitive proxy definitions for x target beans, you can register one single such post processor with the bean factory to achieve the same effect.

Subclasses can apply any strategy to decide if a bean is to be proxied, e.g. by type, by name, by definition details, etc. They can also return additional interceptors that should just be applied to the specific bean instance. The default concrete implementation is BeanNameAutoProxyCreator, identifying the beans to be proxied via a list of bean names.

Any number of TargetSourceCreator implementations can be used to create a custom target source - for example, to pool prototype objects. Auto-proxying will occur even if there is no advice, as long as a TargetSourceCreator specifies a custom TargetSource. If there are no TargetSourceCreators set, or if none matches, a SingletonTargetSource will be used by default to wrap the target bean instance.

Since:
13.10.2003
Author:
Juergen Hoeller, Rod Johnson, Rob Harrop
See Also:
setInterceptorNames(java.lang.String[]), getAdvicesAndAdvisorsForBean(java.lang.Class, java.lang.String, org.springframework.aop.TargetSource), BeanNameAutoProxyCreator, DefaultAdvisorAutoProxyCreator, Serialized Form

Field Summary
protected static Object[] | DO_NOT_PROXY Convenience constant for subclasses: Return value for "do not proxy".
protected Log | logger Logger available to subclasses
protected static Object[] | PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS Convenience constant for subclasses: Return value for "proxy without additional interceptors, just the common ones".
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AbstractAutoProxyCreator()
Method Summary
protected  boolean advisorsPreFiltered()
Return whether the Advisors returned by the subclass are pre-filtered to match the bean's target class already, allowing the ClassFilter check to be skipped when building advisors chains for AOP invocations.
protected  Advisor[] buildAdvisors(String beanName, Object[] specificInterceptors)
Determine the advisors for the given bean, including the specific interceptors as well as the common interceptor, all adapted to the Advisor interface.
protected  Object createProxy(Class<?> beanClass, String beanName, Object[] specificInterceptors, TargetSource targetSource)
Create an AOP proxy for the given bean.
protected  void customizeProxyFactory(ProxyFactory proxyFactory)
Subclasses may choose to implement this: for example, to change the interfaces exposed.
 Constructor<?>[] determineCandidateConstructors(Class<?> beanClass, String beanName)
Determine the candidate constructors to use for the given bean.
protected abstract  Object[] getAdvicesAndAdvisorsForBean(Class<?> beanClass, String beanName, TargetSource customTargetSource)
Return whether the given bean is to be proxied, what additional advices (e.g.
protected  BeanFactory getBeanFactory()
Return the owning BeanFactory.
protected  Object getCacheKey(Class<?> beanClass, String beanName)
Build a cache key for the given bean class and bean name.
protected  TargetSource getCustomTargetSource(Class<?> beanClass, String beanName)
Create a target source for bean instances.
 Object getEarlyBeanReference(Object bean, String beanName)
Obtain a reference for early access to the specified bean, typically for the purpose of resolving a circular reference.
 int getOrder()
Return the order value of this object, with a higher value meaning greater in terms of sorting.
 boolean isFrozen()
Return whether the config is frozen, and no advice changes can be made.
protected  boolean isInfrastructureClass(Class<?> beanClass)
Return whether the given bean class represents an infrastructure class that should never be proxied.
 Object postProcessAfterInitialization(Object bean, String beanName)
Create a proxy with the configured interceptors if the bean is identified as one to proxy by the subclass.
 boolean postProcessAfterInstantiation(Object bean, String beanName)
Perform operations after the bean has been instantiated, via a constructor or factory method, but before Spring property population (from explicit properties or autowiring) occurs.
 Object postProcessBeforeInitialization(Object bean, String beanName)
Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).
 Object postProcessBeforeInstantiation(Class<?> beanClass, String beanName)
Apply this BeanPostProcessor before the target bean gets instantiated.
 PropertyValues postProcessPropertyValues(PropertyValues pvs, PropertyDescriptor[] pds, Object bean, String beanName)
Post-process the given property values before the factory applies them to the given bean.
 Class<?> predictBeanType(Class<?> beanClass, String beanName)
Predict the type of the bean to be eventually returned from this processor's InstantiationAwareBeanPostProcessor.postProcessBeforeInstantiation(java.lang.Class, java.lang.String) callback.
 void setAdvisorAdapterRegistry(AdvisorAdapterRegistry advisorAdapterRegistry)
Specify the AdvisorAdapterRegistry to use.
 void setApplyCommonInterceptorsFirst(boolean applyCommonInterceptorsFirst)
Set whether the common interceptors should be applied before bean-specific ones.
 void setBeanClassLoader(ClassLoader classLoader)
Callback that supplies the bean class loader to a bean instance.
 void setBeanFactory(BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance.
 void setCustomTargetSourceCreators(TargetSourceCreator[] targetSourceCreators)
Set custom TargetSourceCreators to be applied in this order.
 void setFrozen(boolean frozen)
Set whether or not the proxy should be frozen, preventing advice from being added to it once it is created.
 void setInterceptorNames(String[] interceptorNames)
Set the common interceptors.
 void setOrder(int order)
Set the ordering which will apply to this class's implementation of Ordered, used when applying multiple BeanPostProcessors.
 void setProxyClassLoader(ClassLoader classLoader)
Set the ClassLoader to generate the proxy class in.
protected  boolean shouldProxyTargetClass(Class<?> beanClass, String beanName)
Determine whether the given bean should be proxied with its target class rather than its interfaces.
protected  boolean shouldSkip(Class<?> beanClass, String beanName)
Subclasses should override this method to return true if the given bean should not be considered for auto-proxying by this post-processor.
protected  Object wrapIfNecessary(Object bean, String beanName, Object cacheKey)
Wrap the given bean if necessary, i.e.
Methods inherited from class org.springframework.aop.framework.ProxyConfig
copyFrom, isExposeProxy, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setOpaque, setOptimize, setProxyTargetClass, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

DO_NOT_PROXY

protected static final Object[] DO_NOT_PROXY
Convenience constant for subclasses: Return value for "do not proxy".

See Also:
getAdvicesAndAdvisorsForBean(java.lang.Class, java.lang.String, org.springframework.aop.TargetSource)

PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS

protected static final Object[] PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS
Convenience constant for subclasses: Return value for "proxy without additional interceptors, just the common ones".

See Also:
getAdvicesAndAdvisorsForBean(java.lang.Class, java.lang.String, org.springframework.aop.TargetSource)

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

AbstractAutoProxyCreator

public AbstractAutoProxyCreator()
Method Detail

setOrder

public final void setOrder(int order)
Set the ordering which will apply to this class's implementation of Ordered, used when applying multiple BeanPostProcessors.

Default value is Integer.MAX_VALUE, meaning that it's non-ordered.

Parameters:
order - ordering value

getOrder

public final int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

setFrozen

public void setFrozen(boolean frozen)
Set whether or not the proxy should be frozen, preventing advice from being added to it once it is created.

Overridden from the super class to prevent the proxy configuration from being frozen before the proxy is created.

Overrides:
setFrozen in class ProxyConfig

isFrozen

public boolean isFrozen()
Description copied from class: ProxyConfig
Return whether the config is frozen, and no advice changes can be made.

Overrides:
isFrozen in class ProxyConfig

setAdvisorAdapterRegistry

public void setAdvisorAdapterRegistry(AdvisorAdapterRegistry advisorAdapterRegistry)
Specify the AdvisorAdapterRegistry to use. Default is the global AdvisorAdapterRegistry.

See Also:
GlobalAdvisorAdapterRegistry

setCustomTargetSourceCreators

public void setCustomTargetSourceCreators(TargetSourceCreator[] targetSourceCreators)
Set custom TargetSourceCreators to be applied in this order. If the list is empty, or they all return null, a SingletonTargetSource will be created for each bean.

Note that TargetSourceCreators will kick in even for target beans where no advices or advisors have been found. If a TargetSourceCreator returns a TargetSource for a specific bean, that bean will be proxied in any case.

TargetSourceCreators can only be invoked if this post processor is used in a BeanFactory, and its BeanFactoryAware callback is used.

Parameters:
targetSourceCreators - list of TargetSourceCreator. Ordering is significant: The TargetSource returned from the first matching TargetSourceCreator (that is, the first that returns non-null) will be used.

setInterceptorNames

public void setInterceptorNames(String[] interceptorNames)
Set the common interceptors. These must be bean names in the current factory. They can be of any advice or advisor type Spring supports.

If this property isn't set, there will be zero common interceptors. This is perfectly valid, if "specific" interceptors such as matching Advisors are all we want.

setApplyCommonInterceptorsFirst

public void setApplyCommonInterceptorsFirst(boolean applyCommonInterceptorsFirst)
Set whether the common interceptors should be applied before bean-specific ones. Default is "true"; else, bean-specific interceptors will get applied first.

setProxyClassLoader

public void setProxyClassLoader(ClassLoader classLoader)
Set the ClassLoader to generate the proxy class in.

Default is the bean ClassLoader, i.e. the ClassLoader used by the containing BeanFactory for loading all bean classes. This can be overridden here for specific proxies.

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
BeanInitializationException

getBeanFactory

protected BeanFactory getBeanFactory()
Return the owning BeanFactory. May be null, as this object doesn't need to belong to a bean factory.

predictBeanType

public Class<?> predictBeanType(Class<?> beanClass,
                                String beanName)
Description copied from interface: SmartInstantiationAwareBeanPostProcessor
Predict the type of the bean to be eventually returned from this processor's InstantiationAwareBeanPostProcessor.postProcessBeforeInstantiation(java.lang.Class, java.lang.String) callback.

Specified by:
predictBeanType in interface SmartInstantiationAwareBeanPostProcessor
Parameters:
beanClass - the raw class of the bean
beanName - the name of the bean
Returns:
the type of the bean, or null if not predictable

determineCandidateConstructors

public Constructor<?>[] determineCandidateConstructors(Class<?> beanClass,
                                                       String beanName)
                                                throws BeansException
Description copied from interface: SmartInstantiationAwareBeanPostProcessor
Determine the candidate constructors to use for the given bean.

Specified by:
determineCandidateConstructors in interface SmartInstantiationAwareBeanPostProcessor
Parameters:
beanClass - the raw class of the bean (never null)
beanName - the name of the bean
Returns:
the candidate constructors, or null if none specified
Throws:
BeansException - in case of errors

getEarlyBeanReference

public Object getEarlyBeanReference(Object bean,
                                    String beanName)
                             throws BeansException
Description copied from interface: SmartInstantiationAwareBeanPostProcessor
Obtain a reference for early access to the specified bean, typically for the purpose of resolving a circular reference.

This callback gives post-processors a chance to expose a wrapper early - that is, before the target bean instance is fully initialized. The exposed object should be equivalent to the what BeanPostProcessor.postProcessBeforeInitialization(java.lang.Object, java.lang.String) / BeanPostProcessor.postProcessAfterInitialization(java.lang.Object, java.lang.String) would expose otherwise. Note that the object returned by this method will be used as bean reference unless the post-processor returns a different wrapper from said post-process callbacks. In other words: Those post-process callbacks may either eventually expose the same reference or alternatively return the raw bean instance from those subsequent callbacks (if the wrapper for the affected bean has been built for a call to this method already, it will be exposes as final bean reference by default).

Specified by:
getEarlyBeanReference in interface SmartInstantiationAwareBeanPostProcessor
Parameters:
bean - the raw bean instance
beanName - the name of the bean
Returns:
the object to expose as bean reference (typically with the passed-in bean instance as default)
Throws:
BeansException - in case of errors

postProcessBeforeInstantiation

public Object postProcessBeforeInstantiation(Class<?> beanClass,
                                             String beanName)
                                      throws BeansException
Description copied from interface: InstantiationAwareBeanPostProcessor
Apply this BeanPostProcessor before the target bean gets instantiated. The returned bean object may be a proxy to use instead of the target bean, effectively suppressing default instantiation of the target bean.

If a non-null object is returned by this method, the bean creation process will be short-circuited. The only further processing applied is the BeanPostProcessor.postProcessAfterInitialization(java.lang.Object, java.lang.String) callback from the configured BeanPostProcessors.

This callback will only be applied to bean definitions with a bean class. In particular, it will not be applied to beans with a "factory-method".

Post-processors may implement the extended SmartInstantiationAwareBeanPostProcessor interface in order to predict the type of the bean object that they are going to return here.

Specified by:
postProcessBeforeInstantiation in interface InstantiationAwareBeanPostProcessor
Parameters:
beanClass - the class of the bean to be instantiated
beanName - the name of the bean
Returns:
the bean object to expose instead of a default instance of the target bean, or null to proceed with default instantiation
Throws:
BeansException - in case of errors
See Also:
AbstractBeanDefinition.hasBeanClass(), AbstractBeanDefinition.getFactoryMethodName()

postProcessAfterInstantiation

public boolean postProcessAfterInstantiation(Object bean,
                                             String beanName)
Description copied from interface: InstantiationAwareBeanPostProcessor
Perform operations after the bean has been instantiated, via a constructor or factory method, but before Spring property population (from explicit properties or autowiring) occurs.

This is the ideal callback for performing field injection on the given bean instance. See Spring's own AutowiredAnnotationBeanPostProcessor for a typical example.

Specified by:
postProcessAfterInstantiation in interface InstantiationAwareBeanPostProcessor
Parameters:
bean - the bean instance created, with properties not having been set yet
beanName - the name of the bean
Returns:
true if properties should be set on the bean; false if property population should be skipped. Normal implementations should return true. Returning false will also prevent any subsequent InstantiationAwareBeanPostProcessor instances being invoked on this bean instance.

postProcessPropertyValues

public PropertyValues postProcessPropertyValues(PropertyValues pvs,
                                                PropertyDescriptor[] pds,
                                                Object bean,
                                                String beanName)
Description copied from interface: InstantiationAwareBeanPostProcessor
Post-process the given property values before the factory applies them to the given bean. Allows for checking whether all dependencies have been satisfied, for example based on a "Required" annotation on bean property setters.

Also allows for replacing the property values to apply, typically through creating a new MutablePropertyValues instance based on the original PropertyValues, adding or removing specific values.

Specified by:
postProcessPropertyValues in interface InstantiationAwareBeanPostProcessor
Parameters:
pvs - the property values that the factory is about to apply (never null)
pds - the relevant property descriptors for the target bean (with ignored dependency types - which the factory handles specifically - already filtered out)
bean - the bean instance created, but whose properties have not yet been set
beanName - the name of the bean
Returns:
the actual property values to apply to to the given bean (can be the passed-in PropertyValues instance), or null to skip property population
See Also:
MutablePropertyValues

postProcessBeforeInitialization

public Object postProcessBeforeInitialization(Object bean,
                                              String beanName)
Description copied from interface: BeanPostProcessor
Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

Specified by:
postProcessBeforeInitialization in interface BeanPostProcessor
Parameters:
bean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
See Also:
InitializingBean.afterPropertiesSet()

postProcessAfterInitialization

public Object postProcessAfterInitialization(Object bean,
                                             String beanName)
                                      throws BeansException
Create a proxy with the configured interceptors if the bean is identified as one to proxy by the subclass.

Specified by:
postProcessAfterInitialization in interface BeanPostProcessor
Parameters:
bean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
Throws:
BeansException - in case of errors
See Also:
getAdvicesAndAdvisorsForBean(java.lang.Class, java.lang.String, org.springframework.aop.TargetSource)

getCacheKey

protected Object getCacheKey(Class<?> beanClass,
                             String beanName)
Build a cache key for the given bean class and bean name.

Parameters:
beanClass - the bean class
beanName - the bean name
Returns:
the cache key for the given class and name

wrapIfNecessary

protected Object wrapIfNecessary(Object bean,
                                 String beanName,
                                 Object cacheKey)
Wrap the given bean if necessary, i.e. if it is eligible for being proxied.

Parameters:
bean - the raw bean instance
beanName - the name of the bean
cacheKey - the cache key for metadata access
Returns:
a proxy wrapping the bean, or the raw bean instance as-is

isInfrastructureClass

protected boolean isInfrastructureClass(Class<?> beanClass)
Return whether the given bean class represents an infrastructure class that should never be proxied.

Default implementation considers Advisors, Advices and AbstractAutoProxyCreators as infrastructure classes.

Parameters:
beanClass - the class of the bean
Returns:
whether the bean represents an infrastructure class
See Also:
Advisor, MethodInterceptor, shouldSkip(java.lang.Class, java.lang.String)

shouldSkip

protected boolean shouldSkip(Class<?> beanClass,
                             String beanName)
Subclasses should override this method to return true if the given bean should not be considered for auto-proxying by this post-processor.

Sometimes we need to be able to avoid this happening if it will lead to a circular reference. This implementation returns false.

Parameters:
beanClass - the class of the bean
beanName - the name of the bean
Returns:
whether to skip the given bean

getCustomTargetSource

protected TargetSource getCustomTargetSource(Class<?> beanClass,
                                             String beanName)
Create a target source for bean instances. Uses any TargetSourceCreators if set. Returns null if no custom TargetSource should be used.

This implementation uses the "customTargetSourceCreators" property. Subclasses can override this method to use a different mechanism.

Parameters:
beanClass - the class of the bean to create a TargetSource for
beanName - the name of the bean
Returns:
a TargetSource for this bean
See Also:
setCustomTargetSourceCreators(org.springframework.aop.framework.autoproxy.TargetSourceCreator[])

createProxy

protected Object createProxy(Class<?> beanClass,
                             String beanName,
                             Object[] specificInterceptors,
                             TargetSource targetSource)
Create an AOP proxy for the given bean.

Parameters:
beanClass - the class of the bean
beanName - the name of the bean
specificInterceptors - the set of interceptors that is specific to this bean (may be empty, but not null)
targetSource - the TargetSource for the proxy, already pre-configured to access the bean
Returns:
the AOP proxy for the bean
See Also:
buildAdvisors(java.lang.String, java.lang.Object[])

shouldProxyTargetClass

protected boolean shouldProxyTargetClass(Class<?> beanClass,
                                         String beanName)
Determine whether the given bean should be proxied with its target class rather than its interfaces. Checks the "proxyTargetClass" setting as well as the "preserveTargetClass" attribute of the corresponding bean definition.

Parameters:
beanClass - the class of the bean
beanName - the name of the bean
Returns:
whether the given bean should be proxied with its target class
See Also:
AutoProxyUtils.shouldProxyTargetClass(org.springframework.beans.factory.config.ConfigurableListableBeanFactory, java.lang.String)

advisorsPreFiltered

protected boolean advisorsPreFiltered()
Return whether the Advisors returned by the subclass are pre-filtered to match the bean's target class already, allowing the ClassFilter check to be skipped when building advisors chains for AOP invocations.

Default is false. Subclasses may override this if they will always return pre-filtered Advisors.

Returns:
whether the Advisors are pre-filtered
See Also:
getAdvicesAndAdvisorsForBean(java.lang.Class, java.lang.String, org.springframework.aop.TargetSource), Advised.setPreFiltered(boolean)

buildAdvisors

protected Advisor[] buildAdvisors(String beanName,
                                  Object[] specificInterceptors)
Determine the advisors for the given bean, including the specific interceptors as well as the common interceptor, all adapted to the Advisor interface.

Parameters:
beanName - the name of the bean
specificInterceptors - the set of interceptors that is specific to this bean (may be empty, but not null)
Returns:
the list of Advisors for the given bean

customizeProxyFactory

protected void customizeProxyFactory(ProxyFactory proxyFactory)
Subclasses may choose to implement this: for example, to change the interfaces exposed.

The default implementation is empty.

Parameters:
proxyFactory - ProxyFactory that is already configured with TargetSource and interfaces and will be used to create the proxy immediably after this method returns

getAdvicesAndAdvisorsForBean

protected abstract Object[] getAdvicesAndAdvisorsForBean(Class<?> beanClass,
                                                         String beanName,
                                                         TargetSource customTargetSource)
                                                  throws BeansException
Return whether the given bean is to be proxied, what additional advices (e.g. AOP Alliance interceptors) and advisors to apply.

Parameters:
beanClass - the class of the bean to advise
beanName - the name of the bean
customTargetSource - the TargetSource returned by the getCustomTargetSource(java.lang.Class, java.lang.String) method: may be ignored. Will be null if no custom target source is in use.
Returns:
an array of additional interceptors for the particular bean; or an empty array if no additional interceptors but just the common ones; or null if no proxy at all, not even with the common interceptors. See constants DO_NOT_PROXY and PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS.
Throws:
BeansException - in case of errors
See Also:
DO_NOT_PROXY, PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AutoProxyUtils

org.springframework.aop.framework.autoproxy
Class AutoProxyUtils

java.lang.Object
    extended by  org.springframework.aop.framework.autoproxy.AutoProxyUtils

public abstract class AutoProxyUtils
extends Object

Utilities for auto-proxy aware components. Mainly for internal use within the framework.

Since:
2.0.3
Author:
Juergen Hoeller
See Also:
AbstractAutoProxyCreator

Field Summary
static String PRESERVE_TARGET_CLASS_ATTRIBUTE
Bean definition attribute that may indicate whether a given bean is supposed to be proxied with its target class (in case of it getting proxied in the first place).
Constructor Summary
AutoProxyUtils()
Method Summary
static boolean shouldProxyTargetClass(ConfigurableListableBeanFactory beanFactory, String beanName)
Determine whether the given bean should be proxied with its target class rather than its interfaces.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

PRESERVE_TARGET_CLASS_ATTRIBUTE

public static final String PRESERVE_TARGET_CLASS_ATTRIBUTE
Bean definition attribute that may indicate whether a given bean is supposed to be proxied with its target class (in case of it getting proxied in the first place). The value is Boolean.TRUE or Boolean.FALSE.

Proxy factories can set this attribute if they built a target class proxy for a specific bean, and want to enforce that that bean can always be cast to its target class (even if AOP advices get applied through auto-proxying).

Constructor Detail

AutoProxyUtils

public AutoProxyUtils()
Method Detail

shouldProxyTargetClass

public static boolean shouldProxyTargetClass(ConfigurableListableBeanFactory beanFactory,
                                             String beanName)
Determine whether the given bean should be proxied with its target class rather than its interfaces. Checks the "preserveTargetClass" attribute of the corresponding bean definition.

Parameters:
beanFactory - the containing ConfigurableListableBeanFactory
beanName - the name of the bean
Returns:
whether the given bean should be proxied with its target class
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanFactoryAdvisorRetrievalHelper

org.springframework.aop.framework.autoproxy
Class BeanFactoryAdvisorRetrievalHelper

java.lang.Object
    extended by  org.springframework.aop.framework.autoproxy.BeanFactoryAdvisorRetrievalHelper

public class BeanFactoryAdvisorRetrievalHelper
extends Object

Helper for retrieving standard Spring Advisors from a BeanFactory, for use with auto-proxying.

Since:
2.0.2
Author:
Juergen Hoeller
See Also:
AbstractAdvisorAutoProxyCreator

Constructor Summary
BeanFactoryAdvisorRetrievalHelper(ConfigurableListableBeanFactory beanFactory)
Create a new BeanFactoryAdvisorRetrievalHelper for the given BeanFactory.
Method Summary
List<Advisor> | findAdvisorBeans() Find all eligible Advisor beans in the current bean factory, ignoring FactoryBeans and excluding beans that are currently in creation.
protected boolean | isEligibleBean(String beanName) Determine whether the aspect bean with the given name is eligible.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BeanFactoryAdvisorRetrievalHelper

public BeanFactoryAdvisorRetrievalHelper(ConfigurableListableBeanFactory beanFactory)
Create a new BeanFactoryAdvisorRetrievalHelper for the given BeanFactory.

Parameters:
beanFactory - the ListableBeanFactory to scan
Method Detail

findAdvisorBeans

public List<Advisor> findAdvisorBeans()
Find all eligible Advisor beans in the current bean factory, ignoring FactoryBeans and excluding beans that are currently in creation.

Returns:
the list of Advisor beans
See Also:
isEligibleBean(java.lang.String)

isEligibleBean

protected boolean isEligibleBean(String beanName)
Determine whether the aspect bean with the given name is eligible.

The default implementation always returns true.

Parameters:
beanName - the name of the aspect bean
Returns:
whether the bean is eligible
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanNameAutoProxyCreator

org.springframework.aop.framework.autoproxy
Class BeanNameAutoProxyCreator

java.lang.Object
    extended by  org.springframework.aop.framework.ProxyConfig
        extended by  org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
            extended by  org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator
All Implemented Interfaces:
Serializable, AopInfrastructureBean, BeanClassLoaderAware, BeanFactoryAware, BeanPostProcessor, InstantiationAwareBeanPostProcessor, SmartInstantiationAwareBeanPostProcessor, Ordered
public class BeanNameAutoProxyCreator
extends AbstractAutoProxyCreator

Auto proxy creator that identifies beans to proxy via a list of names. Checks for direct, "xxx*", and "*xxx" matches.

For configuration details, see the javadoc of the parent class AbstractAutoProxyCreator. Typically, you will specify a list of interceptor names to apply to all identified beans, via the "interceptorNames" property.

Since:
10.10.2003
Author:
Juergen Hoeller
See Also:
setBeanNames(java.lang.String[]),
isMatch(java.lang.String, java.lang.String),
AbstractAutoProxyCreator.setInterceptorNames(java.lang.String[]),
AbstractAutoProxyCreator,
Serialized Form

Field Summary
Fields inherited from class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
DO_NOT_PROXY, logger, PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
BeanNameAutoProxyCreator()
Method Summary
protected Object[] | getAdvicesAndAdvisorsForBean(Class beanClass, String beanName, TargetSource targetSource) Identify as bean to proxy if the bean name is in the configured list of names.
protected boolean | isMatch(String beanName, String mappedName) Return if the given bean name matches the mapped name.
void | setBeanNames(String[] beanNames) Set the names of the beans that should automatically get wrapped with proxies.
Methods inherited from class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
advisorsPreFiltered, buildAdvisors, createProxy, customizeProxyFactory, determineCandidateConstructors, getBeanFactory, getCacheKey, getCustomTargetSource, getEarlyBeanReference, getOrder, isFrozen, isInfrastructureClass, postProcessAfterInitialization, postProcessAfterInstantiation, postProcessBeforeInitialization, postProcessBeforeInstantiation, postProcessPropertyValues, predictBeanType, setAdvisorAdapterRegistry, setApplyCommonInterceptorsFirst, setBeanClassLoader, setBeanFactory, setCustomTargetSourceCreators, setFrozen, setInterceptorNames, setOrder, setProxyClassLoader, shouldProxyTargetClass, shouldSkip, wrapIfNecessary
Methods inherited from class org.springframework.aop.framework.ProxyConfig
copyFrom, isExposeProxy, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setOpaque, setOptimize, setProxyTargetClass, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

BeanNameAutoProxyCreator

public BeanNameAutoProxyCreator()
Method Detail

setBeanNames

public void setBeanNames(String[] beanNames)
Set the names of the beans that should automatically get wrapped with proxies. A name can specify a prefix to match by ending with "*", e.g. "myBean,tx*" will match the bean named "myBean" and all beans whose name start with "tx".

NOTE: In case of a FactoryBean, only the objects created by the FactoryBean will get proxied. This default behavior applies as of Spring 2.0. If you intend to proxy a FactoryBean instance itself (a rare use case, but Spring 1.2's default behavior), specify the bean name of the FactoryBean including the factory-bean prefix "&": e.g. "&myFactoryBean".

See Also:
FactoryBean, BeanFactory.FACTORY_BEAN_PREFIX

getAdvicesAndAdvisorsForBean

protected Object[] getAdvicesAndAdvisorsForBean(Class beanClass,
                                                String beanName,
                                                TargetSource targetSource)
Identify as bean to proxy if the bean name is in the configured list of names.

Specified by:
getAdvicesAndAdvisorsForBean in class AbstractAutoProxyCreator
Parameters:
beanClass - the class of the bean to advise
beanName - the name of the bean
targetSource - the TargetSource returned by the AbstractAutoProxyCreator.getCustomTargetSource(java.lang.Class, java.lang.String) method: may be ignored. Will be null if no custom target source is in use.
Returns:
an array of additional interceptors for the particular bean; or an empty array if no additional interceptors but just the common ones; or null if no proxy at all, not even with the common interceptors. See constants DO_NOT_PROXY and PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS.
See Also:
AbstractAutoProxyCreator.DO_NOT_PROXY, AbstractAutoProxyCreator.PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS

isMatch

protected boolean isMatch(String beanName,
                          String mappedName)
Return if the given bean name matches the mapped name.

The default implementation checks for "xxx*", "*xxx" and "*xxx*" matches, as well as direct equality. Can be overridden in subclasses.

Parameters:
beanName - the bean name to check
mappedName - the name in the configured list of names
Returns:
if the names match
See Also:
PatternMatchUtils.simpleMatch(String, String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultAdvisorAutoProxyCreator

org.springframework.aop.framework.autoproxy
Class DefaultAdvisorAutoProxyCreator

java.lang.Object
    extended by  org.springframework.aop.framework.ProxyConfig
        extended by  org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
            extended by  org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
                extended by  org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator
All Implemented Interfaces:
Serializable, AopInfrastructureBean, BeanClassLoaderAware, BeanFactoryAware, BeanNameAware, BeanPostProcessor, InstantiationAwareBeanPostProcessor, SmartInstantiationAwareBeanPostProcessor, Ordered
public class DefaultAdvisorAutoProxyCreator
extends AbstractAdvisorAutoProxyCreator
implements BeanNameAware

BeanPostProcessor implementation that creates AOP proxies based on all candidate Advisors in the current BeanFactory. This class is completely generic; it contains no special code to handle any particular aspects, such as pooling aspects.

It's possible to filter out advisors - for example, to use multiple post processors of this type in the same factory - by setting the usePrefix property to true, in which case only advisors beginning with the DefaultAdvisorAutoProxyCreator's bean name followed by a dot (like "aapc.") will be used. This default prefix can be changed from the bean name by setting the advisorBeanNamePrefix property. The separator (.) will also be used in this case.

Author:
Rod Johnson, Rob Harrop
See Also:
Serialized Form

Field Summary
static String SEPARATOR
Separator between prefix and remainder of bean name
Fields inherited from class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
DO_NOT_PROXY, logger, PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
DefaultAdvisorAutoProxyCreator()
Method Summary
String | getAdvisorBeanNamePrefix() Return the prefix for bean names that will cause them to be included for auto-proxying by this object.
protected boolean | isEligibleAdvisorBean(String beanName) Consider Advisor beans with the specified prefix as eligible, if activated.
boolean | isUsePrefix() Return whether to exclude advisors with a certain prefix in the bean name.
void | setAdvisorBeanNamePrefix(String advisorBeanNamePrefix) Set the prefix for bean names that will cause them to be included for auto-proxying by this object.
void | setBeanName(String name) Set the name of the bean in the bean factory that created this bean.
void | setUsePrefix(boolean usePrefix) Set whether to exclude advisors with a certain prefix in the bean name.
Methods inherited from class org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
advisorsPreFiltered, extendAdvisors, findAdvisorsThatCanApply, findCandidateAdvisors, findEligibleAdvisors, getAdvicesAndAdvisorsForBean, initBeanFactory, setBeanFactory, sortAdvisors
Methods inherited from class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
buildAdvisors, createProxy, customizeProxyFactory, determineCandidateConstructors, getBeanFactory, getCacheKey, getCustomTargetSource, getEarlyBeanReference, getOrder, isFrozen, isInfrastructureClass, postProcessAfterInitialization, postProcessAfterInstantiation, postProcessBeforeInitialization, postProcessBeforeInstantiation, postProcessPropertyValues, predictBeanType, setAdvisorAdapterRegistry, setApplyCommonInterceptorsFirst, setBeanClassLoader, setCustomTargetSourceCreators, setFrozen, setInterceptorNames, setOrder, setProxyClassLoader, shouldProxyTargetClass, shouldSkip, wrapIfNecessary
Methods inherited from class org.springframework.aop.framework.ProxyConfig
copyFrom, isExposeProxy, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setOpaque, setOptimize, setProxyTargetClass, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

SEPARATOR

public static final String SEPARATOR
Separator between prefix and remainder of bean name

See Also:
Constant Field Values
Constructor Detail

DefaultAdvisorAutoProxyCreator

public DefaultAdvisorAutoProxyCreator()
Method Detail

setUsePrefix

public void setUsePrefix(boolean usePrefix)
Set whether to exclude advisors with a certain prefix in the bean name.

isUsePrefix

public boolean isUsePrefix()
Return whether to exclude advisors with a certain prefix in the bean name.

setAdvisorBeanNamePrefix

public void setAdvisorBeanNamePrefix(String advisorBeanNamePrefix)
Set the prefix for bean names that will cause them to be included for auto-proxying by this object. This prefix should be set to avoid circular references. Default value is the bean name of this object + a dot.

Parameters:
advisorBeanNamePrefix - the exclusion prefix

getAdvisorBeanNamePrefix

public String getAdvisorBeanNamePrefix()
Return the prefix for bean names that will cause them to be included for auto-proxying by this object.

setBeanName

public void setBeanName(String name)
Description copied from interface: BeanNameAware
Set the name of the bean in the bean factory that created this bean.

Invoked after population of normal bean properties but before an init callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanName in interface BeanNameAware
Parameters:
name - the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use the BeanFactoryUtils.originalBeanName(String) method to extract the original bean name (without suffix), if desired.

isEligibleAdvisorBean

protected boolean isEligibleAdvisorBean(String beanName)
Consider Advisor beans with the specified prefix as eligible, if activated.

Overrides:
isEligibleAdvisorBean in class AbstractAdvisorAutoProxyCreator
Parameters:
beanName - the name of the Advisor bean
Returns:
whether the bean is eligible
See Also:
setUsePrefix(boolean), setAdvisorBeanNamePrefix(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InfrastructureAdvisorAutoProxyCreator

org.springframework.aop.framework.autoproxy
Class InfrastructureAdvisorAutoProxyCreator

java.lang.Object
    extended by  org.springframework.aop.framework.ProxyConfig
        extended by  org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
            extended by  org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
                extended by  org.springframework.aop.framework.autoproxy.InfrastructureAdvisorAutoProxyCreator
All Implemented Interfaces:
Serializable, AopInfrastructureBean, BeanClassLoaderAware, BeanFactoryAware, BeanPostProcessor, InstantiationAwareBeanPostProcessor, SmartInstantiationAwareBeanPostProcessor, Ordered
public class InfrastructureAdvisorAutoProxyCreator
extends AbstractAdvisorAutoProxyCreator

Auto-proxy creator that considers infrastructure Advisor beans only, ignoring any application-defined Advisors.

Since:
2.0.7
Author:
Juergen Hoeller
See Also:
Serialized Form

Field Summary
Fields inherited from class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
DO_NOT_PROXY, logger, PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
InfrastructureAdvisorAutoProxyCreator()
Method Summary
protected void | initBeanFactory(ConfigurableListableBeanFactory beanFactory)
protected boolean | isEligibleAdvisorBean(String beanName) Return whether the Advisor bean with the given name is eligible for proxying in the first place.
Methods inherited from class org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
advisorsPreFiltered, extendAdvisors, findAdvisorsThatCanApply, findCandidateAdvisors, findEligibleAdvisors, getAdvicesAndAdvisorsForBean, setBeanFactory, sortAdvisors
Methods inherited from class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
buildAdvisors, createProxy, customizeProxyFactory, determineCandidateConstructors, getBeanFactory, getCacheKey, getCustomTargetSource, getEarlyBeanReference, getOrder, isFrozen, isInfrastructureClass, postProcessAfterInitialization, postProcessAfterInstantiation, postProcessBeforeInitialization, postProcessBeforeInstantiation, postProcessPropertyValues, predictBeanType, setAdvisorAdapterRegistry, setApplyCommonInterceptorsFirst, setBeanClassLoader, setCustomTargetSourceCreators, setFrozen, setInterceptorNames, setOrder, setProxyClassLoader, shouldProxyTargetClass, shouldSkip, wrapIfNecessary
Methods inherited from class org.springframework.aop.framework.ProxyConfig
copyFrom, isExposeProxy, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setOpaque, setOptimize, setProxyTargetClass, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

InfrastructureAdvisorAutoProxyCreator

public InfrastructureAdvisorAutoProxyCreator()
Method Detail

initBeanFactory

protected void initBeanFactory(ConfigurableListableBeanFactory beanFactory)
Overrides:
initBeanFactory in class AbstractAdvisorAutoProxyCreator

isEligibleAdvisorBean

protected boolean isEligibleAdvisorBean(String beanName)
Description copied from class: AbstractAdvisorAutoProxyCreator
Return whether the Advisor bean with the given name is eligible for proxying in the first place.

Overrides:
isEligibleAdvisorBean in class AbstractAdvisorAutoProxyCreator
Parameters:
beanName - the name of the Advisor bean
Returns:
whether the bean is eligible
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ProxyCreationContext

org.springframework.aop.framework.autoproxy
Class ProxyCreationContext

java.lang.Object
    extended by  org.springframework.aop.framework.autoproxy.ProxyCreationContext

public class ProxyCreationContext
extends Object

Holder for the current proxy creation context, as exposed by auto-proxy creators such as AbstractAdvisorAutoProxyCreator.

Since:
2.5
Author:
Juergen Hoeller, Ramnivas Laddad

Constructor Summary
ProxyCreationContext()
Method Summary
static String getCurrentProxiedBeanName()
Return the name of the currently proxied bean instance.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ProxyCreationContext

public ProxyCreationContext()
Method Detail

getCurrentProxiedBeanName

public static String getCurrentProxiedBeanName()
Return the name of the currently proxied bean instance.

Returns:
the name of the bean, or null if none available
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.aop.framework.autoproxy.target

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.aop.framework.autoproxy.target

Generic support classes for target source creation.

See:
Description

Class Summary
AbstractBeanFactoryBasedTargetSourceCreator | Convenient superclass for TargetSourceCreator implementations that require creating multiple instances of a prototype bean.
LazyInitTargetSourceCreator | TargetSourceCreator that enforces a LazyInitTargetSource for each bean that is defined as "lazy-init".
QuickTargetSourceCreator | Convenient TargetSourceCreator using bean name prefixes to create one of three well-known TargetSource types: : CommonsPoolTargetSource % ThreadLocalTargetSource ! PrototypeTargetSource

Package org.springframework.aop.framework.autoproxy.target Description

Generic support classes for target source creation.


org.springframework.aop.framework.autoproxy.target Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.aop.framework.autoproxy.target

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.aop.framework.autoproxy.target.AbstractBeanFactoryBasedTargetSourceCreator (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.aop.framework.autoproxy.TargetSourceCreator)
      • org.springframework.aop.framework.autoproxy.target.LazyInitTargetSourceCreator
      • org.springframework.aop.framework.autoproxy.target.QuickTargetSourceCreator


AbstractBeanFactoryBasedTargetSourceCreator

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.aop.framework.autoproxy.target
Class AbstractBeanFactoryBasedTargetSourceCreator

java.lang.Object
    extended by  org.springframework.aop.framework.autoproxy.target.AbstractBeanFactoryBasedTargetSourceCreator
All Implemented Interfaces:
TargetSourceCreator, BeanFactoryAware, DisposableBean
Direct Known Subclasses:
LazyInitTargetSourceCreator, QuickTargetSourceCreator
public abstract class AbstractBeanFactoryBasedTargetSourceCreator
extends Object
implements TargetSourceCreator, BeanFactoryAware, DisposableBean

Convenient superclass for TargetSourceCreator implementations that require creating multiple instances of a prototype bean.

Uses an internal BeanFactory to manage the target instances, copying the original bean definition to this internal factory. This is necessary because the original BeanFactory will just contain the proxy instance created through auto-proxying.

Requires running in an AbstractBeanFactory.

Author:
Rod Johnson, Juergen Hoeller
See Also:
AbstractBeanFactoryBasedTargetSource, AbstractBeanFactory

Field Summary
protected  Log logger
Constructor Summary
AbstractBeanFactoryBasedTargetSourceCreator()
Method Summary
protected DefaultListableBeanFactory | buildInternalBeanFactory(ConfigurableBeanFactory containingFactory) Build an internal BeanFactory for resolving target beans.
protected abstract AbstractBeanFactoryBasedTargetSource | createBeanFactoryBasedTargetSource(Class<?> beanClass, String beanName) Subclasses must implement this method to return a new AbstractPrototypeBasedTargetSource if they wish to create a custom TargetSource for this bean, or null if they are not interested it in, in which case no special target source will be created.
void | destroy() Destroys the internal BeanFactory on shutdown of the TargetSourceCreator.
protected BeanFactory | getBeanFactory() Return the BeanFactory that this TargetSourceCreators runs in.
protected DefaultListableBeanFactory | getInternalBeanFactoryForBean(String beanName) Return the internal BeanFactory to be used for the specified bean.
TargetSource | getTargetSource(Class<?> beanClass, String beanName) Create a special TargetSource for the given bean, if any.
protected boolean | isPrototypeBased() Return whether this TargetSourceCreator is prototype-based.
void | setBeanFactory(BeanFactory beanFactory) Callback that supplies the owning factory to a bean instance.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Constructor Detail

AbstractBeanFactoryBasedTargetSourceCreator

public AbstractBeanFactoryBasedTargetSourceCreator()
Method Detail

setBeanFactory

public final void setBeanFactory(BeanFactory beanFactory)
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
BeanInitializationException

getBeanFactory

protected final BeanFactory getBeanFactory()
Return the BeanFactory that this TargetSourceCreators runs in.

getTargetSource

public final TargetSource getTargetSource(Class<?> beanClass,
                                          String beanName)
Description copied from interface: TargetSourceCreator
Create a special TargetSource for the given bean, if any.

Specified by:
getTargetSource in interface TargetSourceCreator
Parameters:
beanClass - the class of the bean to create a TargetSource for
beanName - the name of the bean
Returns:
a special TargetSource or null if this TargetSourceCreator isn't interested in the particular bean

getInternalBeanFactoryForBean

protected DefaultListableBeanFactory getInternalBeanFactoryForBean(String beanName)
Return the internal BeanFactory to be used for the specified bean.

Parameters:
beanName - the name of the target bean
Returns:
the internal BeanFactory to be used

buildInternalBeanFactory

protected DefaultListableBeanFactory buildInternalBeanFactory(ConfigurableBeanFactory containingFactory)
Build an internal BeanFactory for resolving target beans.

Parameters:
containingFactory - the containing BeanFactory that originally defines the beans
Returns:
an independent internal BeanFactory to hold copies of some target beans

destroy

public void destroy()
Destroys the internal BeanFactory on shutdown of the TargetSourceCreator.

Specified by:
destroy in interface DisposableBean
See Also:
getInternalBeanFactoryForBean(java.lang.String)

isPrototypeBased

protected boolean isPrototypeBased()
Return whether this TargetSourceCreator is prototype-based. The scope of the target bean definition will be set accordingly.

Default is "true".

See Also:
BeanDefinition.isSingleton()

createBeanFactoryBasedTargetSource

protected abstract AbstractBeanFactoryBasedTargetSource createBeanFactoryBasedTargetSource(Class<?> beanClass,
                                                                                String beanName)
Subclasses must implement this method to return a new AbstractPrototypeBasedTargetSource if they wish to create a custom TargetSource for this bean, or null if they are not interested it in, in which case no special target source will be created. Subclasses should not call setTargetBeanName or setBeanFactory on the AbstractPrototypeBasedTargetSource: This class' implementation of getTargetSource() will do that.

Parameters:
beanClass - the class of the bean to create a TargetSource for
beanName - the name of the bean
Returns:
the AbstractPrototypeBasedTargetSource, or null if we don't match this
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


LazyInitTargetSourceCreator

org.springframework.aop.framework.autoproxy.target
Class LazyInitTargetSourceCreator

java.lang.Object
    extended by  org.springframework.aop.framework.autoproxy.target.AbstractBeanFactoryBasedTargetSourceCreator
        extended by  org.springframework.aop.framework.autoproxy.target.LazyInitTargetSourceCreator
All Implemented Interfaces:
TargetSourceCreator, BeanFactoryAware, DisposableBean
public class LazyInitTargetSourceCreator
extends AbstractBeanFactoryBasedTargetSourceCreator

TargetSourceCreator that enforces a LazyInitTargetSource for each bean that is defined as "lazy-init". This will lead to a proxy created for each of those beans, allowing to fetch a reference to such a bean without actually initialized the target bean instance.

To be registered as custom TargetSourceCreator for an auto-proxy creator, in combination with custom interceptors for specific beans or for the creation of lazy-init proxies only. For example, as autodetected infrastructure bean in an XML application context definition:

 <bean class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
   <property name="customTargetSourceCreators">
     <list>
       <bean class="org.springframework.aop.framework.autoproxy.target.LazyInitTargetSourceCreator"/>
     </list>
   </property>
 </bean>

 <bean id="myLazyInitBean" class="mypackage.MyBeanClass" lazy-init="true">
   ...
 </bean>

Since:
1.2
Author:
Juergen Hoeller
See Also:
BeanDefinition.isLazyInit(), AbstractAutoProxyCreator.setCustomTargetSourceCreators(org.springframework.aop.framework.autoproxy.TargetSourceCreator[]), BeanNameAutoProxyCreator

Field Summary
Fields inherited from class org.springframework.aop.framework.autoproxy.target.AbstractBeanFactoryBasedTargetSourceCreator
logger
Constructor Summary
LazyInitTargetSourceCreator()
Method Summary
protected AbstractBeanFactoryBasedTargetSource | createBeanFactoryBasedTargetSource(Class beanClass, String beanName) Subclasses must implement this method to return a new AbstractPrototypeBasedTargetSource if they wish to create a custom TargetSource for this bean, or null if they are not interested it in, in which case no special target source will be created.
protected boolean | isPrototypeBased() Return whether this TargetSourceCreator is prototype-based.
Methods inherited from class org.springframework.aop.framework.autoproxy.target.AbstractBeanFactoryBasedTargetSourceCreator
buildInternalBeanFactory, destroy, getBeanFactory, getInternalBeanFactoryForBean, getTargetSource, setBeanFactory
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

LazyInitTargetSourceCreator

public LazyInitTargetSourceCreator()
Method Detail

isPrototypeBased

protected boolean isPrototypeBased()
Description copied from class: AbstractBeanFactoryBasedTargetSourceCreator
Return whether this TargetSourceCreator is prototype-based. The scope of the target bean definition will be set accordingly.

Default is "true".

Overrides:
isPrototypeBased in class AbstractBeanFactoryBasedTargetSourceCreator
See Also:
BeanDefinition.isSingleton()

createBeanFactoryBasedTargetSource

protected AbstractBeanFactoryBasedTargetSource createBeanFactoryBasedTargetSource(Class beanClass,
                                                                                String beanName)
Description copied from class: AbstractBeanFactoryBasedTargetSourceCreator
Subclasses must implement this method to return a new AbstractPrototypeBasedTargetSource if they wish to create a custom TargetSource for this bean, or null if they are not interested it in, in which case no special target source will be created. Subclasses should not call setTargetBeanName or setBeanFactory on the AbstractPrototypeBasedTargetSource: This class' implementation of getTargetSource() will do that.

Specified by:
createBeanFactoryBasedTargetSource in class AbstractBeanFactoryBasedTargetSourceCreator
Parameters:
beanClass - the class of the bean to create a TargetSource for
beanName - the name of the bean
Returns:
the AbstractPrototypeBasedTargetSource, or null if we don't match this
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


QuickTargetSourceCreator

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.aop.framework.autoproxy.target
Class QuickTargetSourceCreator

java.lang.Object
    extended by  org.springframework.aop.framework.autoproxy.target.AbstractBeanFactoryBasedTargetSourceCreator
        extended by  org.springframework.aop.framework.autoproxy.target.QuickTargetSourceCreator
All Implemented Interfaces:
TargetSourceCreator, BeanFactoryAware, DisposableBean
public class QuickTargetSourceCreator
extends AbstractBeanFactoryBasedTargetSourceCreator

Convenient TargetSourceCreator using bean name prefixes to create one of three well-known TargetSource types:

  • : CommonsPoolTargetSource
  • % ThreadLocalTargetSource
  • ! PrototypeTargetSource

    Author:
    Rod Johnson
    See Also:
    CommonsPoolTargetSource, ThreadLocalTargetSource, PrototypeTargetSource

    Field Summary
    static String PREFIX_COMMONS_POOL
    static String PREFIX_PROTOTYPE
    static String PREFIX_THREAD_LOCAL
    Fields inherited from class org.springframework.aop.framework.autoproxy.target.AbstractBeanFactoryBasedTargetSourceCreator
    logger
    Constructor Summary
    QuickTargetSourceCreator()
    Method Summary
    protected  AbstractBeanFactoryBasedTargetSource createBeanFactoryBasedTargetSource(Class beanClass, String beanName)
    Subclasses must implement this method to return a new AbstractPrototypeBasedTargetSource if they wish to create a custom TargetSource for this bean, or null if they are not interested it in, in which case no special target source will be created.
    Methods inherited from class org.springframework.aop.framework.autoproxy.target.AbstractBeanFactoryBasedTargetSourceCreator
    buildInternalBeanFactory, destroy, getBeanFactory, getInternalBeanFactoryForBean, getTargetSource, isPrototypeBased, setBeanFactory
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Field Detail

    PREFIX_COMMONS_POOL

    public static final String PREFIX_COMMONS_POOL
    See Also:
    Constant Field Values

    PREFIX_THREAD_LOCAL

    public static final String PREFIX_THREAD_LOCAL
    See Also:
    Constant Field Values

    PREFIX_PROTOTYPE

    public static final String PREFIX_PROTOTYPE
    See Also:
    Constant Field Values
    Constructor Detail

    QuickTargetSourceCreator

    public QuickTargetSourceCreator()
    Method Detail

    createBeanFactoryBasedTargetSource

    protected final AbstractBeanFactoryBasedTargetSource createBeanFactoryBasedTargetSource(Class beanClass,
                                                                                String beanName)
    Description copied from class: AbstractBeanFactoryBasedTargetSourceCreator
    Subclasses must implement this method to return a new AbstractPrototypeBasedTargetSource if they wish to create a custom TargetSource for this bean, or null if they are not interested it in, in which case no special target source will be created. Subclasses should not call setTargetBeanName or setBeanFactory on the AbstractPrototypeBasedTargetSource: This class' implementation of getTargetSource() will do that.

    Specified by:
    createBeanFactoryBasedTargetSource in class AbstractBeanFactoryBasedTargetSourceCreator
    Parameters:
    beanClass - the class of the bean to create a TargetSource for
    beanName - the name of the bean
    Returns:
    the AbstractPrototypeBasedTargetSource, or null if we don't match this
    Overview Package Class Tree Deprecated Index Help
    PREV CLASS NEXT CLASS | FRAMES NO FRAMES
    SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.aop.interceptor

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.aop.interceptor

Provides miscellaneous interceptor implementations.

See:
Description

Class Summary
AbstractMonitoringInterceptor | Base class for monitoring interceptors, such as performance monitors.
AbstractTraceInterceptor | Base MethodInterceptor implementation for tracing.
AsyncExecutionInterceptor | AOP Alliance MethodInterceptor that processes method invocations asynchronously, using a given AsyncTaskExecutor.
ConcurrencyThrottleInterceptor | Interceptor that throttles concurrent access, blocking invocations if a specified concurrency limit is reached.
CustomizableTraceInterceptor | MethodInterceptor implementation that allows for highly customizable method-level tracing, using placeholders.
DebugInterceptor | AOP Alliance MethodInterceptor that can be introduced in a chain to display verbose information about intercepted invocations to the logger.
ExposeBeanNameAdvisors | Convenient methods for creating advisors that may be used when autoproxying beans created with the Spring IoC container, binding the bean name to the current invocation.
ExposeInvocationInterceptor | Interceptor that exposes the current MethodInvocation as a thread-local object.
JamonPerformanceMonitorInterceptor | Performance monitor interceptor that uses JAMon library to perform the performance measurement on the intercepted method and output the stats.
PerformanceMonitorInterceptor | Simple AOP Alliance MethodInterceptor for performance monitoring.
SimpleTraceInterceptor | Simple AOP Alliance MethodInterceptor that can be introduced in a chain to display verbose trace information about intercepted method invocations, with method entry and method exit info.

Package org.springframework.aop.interceptor Description

Provides miscellaneous interceptor implementations. More specific interceptors can be found in corresponding functionality packages, like "transaction" and "orm".


org.springframework.aop.interceptor Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.aop.interceptor

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.aop.interceptor.AbstractTraceInterceptor (implements org.aopalliance.intercept.MethodInterceptor, java.io.Serializable)
      • org.springframework.aop.interceptor.AbstractMonitoringInterceptor
        • org.springframework.aop.interceptor.JamonPerformanceMonitorInterceptor
        • org.springframework.aop.interceptor.PerformanceMonitorInterceptor
      • org.springframework.aop.interceptor.CustomizableTraceInterceptor
      • org.springframework.aop.interceptor.SimpleTraceInterceptor
        • org.springframework.aop.interceptor.DebugInterceptor
    • org.springframework.aop.interceptor.AsyncExecutionInterceptor (implements org.aopalliance.intercept.MethodInterceptor, org.springframework.core.Ordered)
    • org.springframework.util.ConcurrencyThrottleSupport (implements java.io.Serializable)
      • org.springframework.aop.interceptor.ConcurrencyThrottleInterceptor (implements org.aopalliance.intercept.MethodInterceptor, java.io.Serializable)
    • org.springframework.aop.interceptor.ExposeBeanNameAdvisors
    • org.springframework.aop.interceptor.ExposeInvocationInterceptor (implements org.aopalliance.intercept.MethodInterceptor, org.springframework.core.Ordered, java.io.Serializable)


AbstractMonitoringInterceptor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.aop.interceptor
Class AbstractMonitoringInterceptor

java.lang.Object
    extended by  org.springframework.aop.interceptor.AbstractTraceInterceptor
        extended by  org.springframework.aop.interceptor.AbstractMonitoringInterceptor
All Implemented Interfaces:
Serializable, Advice, Interceptor, MethodInterceptor
Direct Known Subclasses:
JamonPerformanceMonitorInterceptor, PerformanceMonitorInterceptor
public abstract class AbstractMonitoringInterceptor
extends AbstractTraceInterceptor

Base class for monitoring interceptors, such as performance monitors. Provides prefix and suffix properties that help to classify/group performance monitoring results.

Subclasses should call the createInvocationTraceName(MethodInvocation) method to create a name for the given trace that includes information about the method invocation under trace along with the prefix and suffix added as appropriate.

Since:
1.2.7
Author:
Rob Harrop, Juergen Hoeller
See Also:
setPrefix(java.lang.String),
setSuffix(java.lang.String),
createInvocationTraceName(org.aopalliance.intercept.MethodInvocation),
Serialized Form

Field Summary
Fields inherited from class org.springframework.aop.interceptor.AbstractTraceInterceptor
defaultLogger
Constructor Summary
AbstractMonitoringInterceptor()
Method Summary
protected String | createInvocationTraceName(MethodInvocation invocation) Create a String name for the given MethodInvocation that can be used for trace/logging purposes.
protected String | getPrefix() Return the text that will get appended to the trace data.
protected String | getSuffix() Return the text that will get prepended to the trace data.
void | setLogTargetClassInvocation(boolean logTargetClassInvocation) Set whether to log the invocation on the target class, if applicable (i.e.
void | setPrefix(String prefix) Set the text that will get appended to the trace data.
void | setSuffix(String suffix) Set the text that will get prepended to the trace data.
Methods inherited from class org.springframework.aop.interceptor.AbstractTraceInterceptor
getClassForLogging, getLoggerForInvocation, invoke, invokeUnderTrace, isInterceptorEnabled, isLogEnabled, setHideProxyClassNames, setLoggerName, setUseDynamicLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractMonitoringInterceptor

public AbstractMonitoringInterceptor()
Method Detail

setPrefix

public void setPrefix(String prefix)
Set the text that will get appended to the trace data.

Default is none.

getPrefix

protected String getPrefix()
Return the text that will get appended to the trace data.

setSuffix

public void setSuffix(String suffix)
Set the text that will get prepended to the trace data.

Default is none.

getSuffix

protected String getSuffix()
Return the text that will get prepended to the trace data.

setLogTargetClassInvocation

public void setLogTargetClassInvocation(boolean logTargetClassInvocation)
Set whether to log the invocation on the target class, if applicable (i.e. if the method is actually delegated to the target class).

Default is "false", logging the invocation based on the proxy interface/class name.

createInvocationTraceName

protected String createInvocationTraceName(MethodInvocation invocation)
Create a String name for the given MethodInvocation that can be used for trace/logging purposes. This name is made up of the configured prefix, followed by the fully-qualified name of the method being invoked, followed by the configured suffix.

See Also:
setPrefix(java.lang.String), setSuffix(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractTraceInterceptor

org.springframework.aop.interceptor
Class AbstractTraceInterceptor

java.lang.Object
    extended by  org.springframework.aop.interceptor.AbstractTraceInterceptor
All Implemented Interfaces:
Serializable, Advice, Interceptor, MethodInterceptor
Direct Known Subclasses:
AbstractMonitoringInterceptor, CustomizableTraceInterceptor, SimpleTraceInterceptor
public abstract class AbstractTraceInterceptor
extends Object
implements MethodInterceptor, Serializable

Base MethodInterceptor implementation for tracing.

By default, log messages are written to the log for the interceptor class, not the class which is being intercepted. Setting the useDynamicLogger bean property to true causes all log messages to be written to the Log for the target class being intercepted.

Subclasses must implement the invokeUnderTrace method, which is invoked by this class ONLY when a particular invocation SHOULD be traced. Subclasses should write to the Log instance provided.

Since:
1.2
Author:
Rob Harrop, Juergen Hoeller
See Also:
setUseDynamicLogger(boolean), invokeUnderTrace(org.aopalliance.intercept.MethodInvocation, org.apache.commons.logging.Log), Serialized Form

Field Summary
protected  Log defaultLogger
The default Log instance used to write trace messages.
Constructor Summary
AbstractTraceInterceptor()
Method Summary
protected Class | getClassForLogging(Object target) Determine the class to use for logging purposes.
protected Log | getLoggerForInvocation(MethodInvocation invocation) Return the appropriate Log instance to use for the given MethodInvocation.
Object | invoke(MethodInvocation invocation) Determines whether or not logging is enabled for the particular MethodInvocation.
protected abstract Object | invokeUnderTrace(MethodInvocation invocation, Log logger) Subclasses must override this method to perform any tracing around the supplied MethodInvocation.
protected boolean | isInterceptorEnabled(MethodInvocation invocation, Log logger) Determine whether the interceptor should kick in, that is, whether the invokeUnderTrace method should be called.
protected boolean | isLogEnabled(Log logger) Determine whether the given Log instance is enabled.
void | setHideProxyClassNames(boolean hideProxyClassNames) Set to "true" to have dynamic loggers hide proxy class names wherever possible.
void | setLoggerName(String loggerName) Set the name of the logger to use.
void | setUseDynamicLogger(boolean useDynamicLogger) Set whether to use a dynamic logger or a static logger.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

defaultLogger

protected transient Log defaultLogger
The default Log instance used to write trace messages. This instance is mapped to the implementing Class.

Constructor Detail

AbstractTraceInterceptor

public AbstractTraceInterceptor()
Method Detail

setUseDynamicLogger

public void setUseDynamicLogger(boolean useDynamicLogger)
Set whether to use a dynamic logger or a static logger. Default is a static logger for this trace interceptor.

Used to determine which Log instance should be used to write log messages for a particular method invocation: a dynamic one for the Class getting called, or a static one for the Class of the trace interceptor.

NOTE: Specify either this property or "loggerName", not both.

See Also:
getLoggerForInvocation(org.aopalliance.intercept.MethodInvocation)

setLoggerName

public void setLoggerName(String loggerName)
Set the name of the logger to use. The name will be passed to the underlying logger implementation through Commons Logging, getting interpreted as log category according to the logger's configuration.

This can be specified to not log into the category of a class (whether this interceptor's class or the class getting called) but rather into a specific named category.

NOTE: Specify either this property or "useDynamicLogger", not both.

See Also:
LogFactory.getLog(String),
Logger.getLogger(String),
Logger.getLogger(String)

setHideProxyClassNames

public void setHideProxyClassNames(boolean hideProxyClassNames)
Set to "true" to have dynamic loggers hide proxy class names wherever possible. Default is "false".

invoke

public Object invoke(MethodInvocation invocation)
              throws Throwable
Determines whether or not logging is enabled for the particular MethodInvocation. If not, the method invocation proceeds as normal, otherwise the method invocation is passed to the invokeUnderTrace method for handling.

Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable
See Also:
invokeUnderTrace(org.aopalliance.intercept.MethodInvocation, org.apache.commons.logging.Log)

getLoggerForInvocation

protected Log getLoggerForInvocation(MethodInvocation invocation)
Return the appropriate Log instance to use for the given MethodInvocation. If the useDynamicLogger flag is set, the Log instance will be for the target class of the MethodInvocation, otherwise the Log will be the default static logger.

Parameters:
invocation - the MethodInvocation being traced
Returns:
the Log instance to use
See Also:
setUseDynamicLogger(boolean)

getClassForLogging

protected Class getClassForLogging(Object target)
Determine the class to use for logging purposes.

Parameters:
target - the target object to introspect
Returns:
the target class for the given object
See Also:
setHideProxyClassNames(boolean)

isInterceptorEnabled

protected boolean isInterceptorEnabled(MethodInvocation invocation,
                                       Log logger)
Determine whether the interceptor should kick in, that is, whether the invokeUnderTrace method should be called.

Default behavior is to check whether the given Log instance is enabled. Subclasses can override this to apply the interceptor in other cases as well.

Parameters:
invocation - the MethodInvocation being traced
logger - the Log instance to check
See Also:
invokeUnderTrace(org.aopalliance.intercept.MethodInvocation, org.apache.commons.logging.Log), isLogEnabled(org.apache.commons.logging.Log)

isLogEnabled

protected boolean isLogEnabled(Log logger)
Determine whether the given Log instance is enabled.

Default is true when the "trace" level is enabled. Subclasses can override this to change the level under which 'tracing' occurs.

Parameters:
logger - the Log instance to check

invokeUnderTrace

protected abstract Object invokeUnderTrace(MethodInvocation invocation,
                                           Log logger)
                                    throws Throwable
Subclasses must override this method to perform any tracing around the supplied MethodInvocation. Subclasses are responsible for ensuring that the MethodInvocation actually executes by calling MethodInvocation.proceed().

By default, the passed-in Log instance will have log level "trace" enabled. Subclasses do not have to check for this again, unless they overwrite the isInterceptorEnabled method to modify the default behavior.

Parameters:
logger - the Log to write trace messages to
Returns:
the result of the call to MethodInvocation.proceed()
Throws:
Throwable - if the call to MethodInvocation.proceed() encountered any errors
See Also:
isInterceptorEnabled(org.aopalliance.intercept.MethodInvocation, org.apache.commons.logging.Log), isLogEnabled(org.apache.commons.logging.Log)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AsyncExecutionInterceptor

org.springframework.aop.interceptor
Class AsyncExecutionInterceptor

java.lang.Object
    extended by  org.springframework.aop.interceptor.AsyncExecutionInterceptor
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, Ordered
public class AsyncExecutionInterceptor
extends Object
implements MethodInterceptor, Ordered

AOP Alliance MethodInterceptor that processes method invocations asynchronously, using a given AsyncTaskExecutor. Typically used with the org.springframework.context.task.Async annotation.

In terms of target method signatures, any parameter types are supported. However, the return type is constrained to either void or java.util.concurrent.Future. In the latter case, the Future handle returned from the proxy will be an actual asynchronous Future that can be used to track the result of the asynchronous method execution. However, since the target method needs to implement the same signature, it will have to return a temporary Future handle that just passes the return value through (like Spring's AsyncResult or EJB 3.1's javax.ejb.AsyncResult).

Since:
3.0
Author:
Juergen Hoeller
See Also:
Async, AsyncAnnotationAdvisor

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AsyncExecutionInterceptor(AsyncTaskExecutor asyncExecutor)
Create a new AsyncExecutionInterceptor.
AsyncExecutionInterceptor(Executor asyncExecutor)
Create a new AsyncExecutionInterceptor.
Method Summary
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
Object | invoke(MethodInvocation invocation)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AsyncExecutionInterceptor

public AsyncExecutionInterceptor(AsyncTaskExecutor asyncExecutor)
Create a new AsyncExecutionInterceptor.

Parameters:
asyncExecutor - the Spring AsyncTaskExecutor to delegate to

AsyncExecutionInterceptor

public AsyncExecutionInterceptor(Executor asyncExecutor)
Create a new AsyncExecutionInterceptor.

Parameters:
asyncExecutor - the java.util.concurrent Executor to delegate to (typically a ExecutorService
Method Detail

invoke

public Object invoke(MethodInvocation invocation)
              throws Throwable
Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConcurrencyThrottleInterceptor

org.springframework.aop.interceptor
Class ConcurrencyThrottleInterceptor

java.lang.Object
    extended by  org.springframework.util.ConcurrencyThrottleSupport
        extended by  org.springframework.aop.interceptor.ConcurrencyThrottleInterceptor
All Implemented Interfaces:
Serializable, Advice, Interceptor, MethodInterceptor
public class ConcurrencyThrottleInterceptor
extends ConcurrencyThrottleSupport
implements MethodInterceptor, Serializable

Interceptor that throttles concurrent access, blocking invocations if a specified concurrency limit is reached.

Can be applied to methods of local services that involve heavy use of system resources, in a scenario where it is more efficient to throttle concurrency for a specific service rather than restricting the entire thread pool (e.g. the web container's thread pool).

The default concurrency limit of this interceptor is 1. Specify the "concurrencyLimit" bean property to change this value.

Since:
11.02.2004
Author:
Juergen Hoeller
See Also:
ConcurrencyThrottleSupport.setConcurrencyLimit(int), Serialized Form

Field Summary
Fields inherited from class org.springframework.util.ConcurrencyThrottleSupport
logger, NO_CONCURRENCY, UNBOUNDED_CONCURRENCY
Constructor Summary
ConcurrencyThrottleInterceptor()
Method Summary
 Object invoke(MethodInvocation methodInvocation)
Methods inherited from class org.springframework.util.ConcurrencyThrottleSupport
afterAccess, beforeAccess, getConcurrencyLimit, isThrottleActive, setConcurrencyLimit
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ConcurrencyThrottleInterceptor

public ConcurrencyThrottleInterceptor()
Method Detail

invoke

public Object invoke(MethodInvocation methodInvocation)
              throws Throwable
Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CustomizableTraceInterceptor

org.springframework.aop.interceptor
Class CustomizableTraceInterceptor

java.lang.Object
    extended by  org.springframework.aop.interceptor.AbstractTraceInterceptor
        extended by  org.springframework.aop.interceptor.CustomizableTraceInterceptor
All Implemented Interfaces:
Serializable, Advice, Interceptor, MethodInterceptor
public class CustomizableTraceInterceptor
extends AbstractTraceInterceptor

MethodInterceptor implementation that allows for highly customizable method-level tracing, using placeholders.

Trace messages are written on method entry, and if the method invocation succeeds on method exit. If an invocation results in an exception, then an exception message is written. The contents of these trace messages is fully customizable and special placeholders are available to allow you to include runtime information in your log messages. The placeholders available are:

  • $[methodName] - replaced with the name of the method being invoked
  • $[targetClassName] - replaced with the name of the class that is the target of the invocation
  • $[targetClassShortName] - replaced with the short name of the class that is the target of the invocation
  • $[returnValue] - replaced with the value returned by the invocation
  • $[argumentTypes] - replaced with a comma-separated list of the short class names of the method arguments
  • $[arguments] - replaced with a comma-separated list of the String representation of the method arguments
  • $[exception] - replaced with the String representation of any Throwable raised during the invocation
  • $[invocationTime] - replaced with the time, in milliseconds, taken by the method invocation

There are restrictions on which placeholders can be used in which messages: see the individual message properties for details on the valid placeholders.

Since:
1.2
Author:
Rob Harrop, Juergen Hoeller
See Also:
setEnterMessage(java.lang.String),
setExitMessage(java.lang.String),
setExceptionMessage(java.lang.String),
SimpleTraceInterceptor,
Serialized Form

Field Summary
static String | PLACEHOLDER_ARGUMENT_TYPES The $[argumentTypes] placeholder.
static String | PLACEHOLDER_ARGUMENTS The $[arguments] placeholder.
static String | PLACEHOLDER_EXCEPTION The $[exception] placeholder.
static String | PLACEHOLDER_INVOCATION_TIME The $[invocationTime] placeholder.
static String | PLACEHOLDER_METHOD_NAME The $[methodName] placeholder.
static String | PLACEHOLDER_RETURN_VALUE The $[returnValue] placeholder.
static String | PLACEHOLDER_TARGET_CLASS_NAME The $[targetClassName] placeholder.
static String | PLACEHOLDER_TARGET_CLASS_SHORT_NAME The $[targetClassShortName] placeholder.
Fields inherited from class org.springframework.aop.interceptor.AbstractTraceInterceptor
defaultLogger
Constructor Summary
CustomizableTraceInterceptor()
Method Summary
protected Object | invokeUnderTrace(MethodInvocation invocation, Log logger) Writes a log message before the invocation based on the value of enterMessage.
protected String | replacePlaceholders(String message, MethodInvocation methodInvocation, Object returnValue, Throwable throwable, long invocationTime) Replace the placeholders in the given message with the supplied values, or values derived from those supplied.
void | setEnterMessage(String enterMessage) Set the template used for method entry log messages.
void | setExceptionMessage(String exceptionMessage) Set the template used for method exception log messages.
void | setExitMessage(String exitMessage) Set the template used for method exit log messages.
protected void | writeToLog(Log logger, String message) Writes the supplied message to the supplied Log instance.
protected void | writeToLog(Log logger, String message, Throwable ex) Writes the supplied message and Throwable to the supplied Log instance.
Methods inherited from class org.springframework.aop.interceptor.AbstractTraceInterceptor
getClassForLogging, getLoggerForInvocation, invoke, isInterceptorEnabled, isLogEnabled, setHideProxyClassNames, setLoggerName, setUseDynamicLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

PLACEHOLDER_METHOD_NAME

public static final String PLACEHOLDER_METHOD_NAME
The $[methodName] placeholder. Replaced with the name of the method being invoked.

See Also:
Constant Field Values

PLACEHOLDER_TARGET_CLASS_NAME

public static final String PLACEHOLDER_TARGET_CLASS_NAME
The $[targetClassName] placeholder. Replaced with the fully-qualifed name of the Class of the method invocation target.

See Also:
Constant Field Values

PLACEHOLDER_TARGET_CLASS_SHORT_NAME

public static final String PLACEHOLDER_TARGET_CLASS_SHORT_NAME
The $[targetClassShortName] placeholder. Replaced with the short name of the Class of the method invocation target.

See Also:
Constant Field Values

PLACEHOLDER_RETURN_VALUE

public static final String PLACEHOLDER_RETURN_VALUE
The $[returnValue] placeholder. Replaced with the String representation of the value returned by the method invocation.

See Also:
Constant Field Values

PLACEHOLDER_ARGUMENT_TYPES

public static final String PLACEHOLDER_ARGUMENT_TYPES
The $[argumentTypes] placeholder. Replaced with a comma-separated list of the argument types for the method invocation. Argument types are written as short class names.

See Also:
Constant Field Values

PLACEHOLDER_ARGUMENTS

public static final String PLACEHOLDER_ARGUMENTS
The $[arguments] placeholder. Replaced with a comma separated list of the argument values for the method invocation. Relies on the toString() method of each argument type.

See Also:
Constant Field Values

PLACEHOLDER_EXCEPTION

public static final String PLACEHOLDER_EXCEPTION
The $[exception] placeholder. Replaced with the String representation of any Throwable raised during method invocation.

See Also:
Constant Field Values

PLACEHOLDER_INVOCATION_TIME

public static final String PLACEHOLDER_INVOCATION_TIME
The $[invocationTime] placeholder. Replaced with the time taken by the invocation (in milliseconds).

See Also:
Constant Field Values
Constructor Detail

CustomizableTraceInterceptor

public CustomizableTraceInterceptor()
Method Detail

setEnterMessage

public void setEnterMessage(String enterMessage)
                     throws IllegalArgumentException
Set the template used for method entry log messages. This template can contain any of the following placeholders:
  • $[targetClassName]
  • $[targetClassShortName]
  • $[argumentTypes]
  • $[arguments]

Throws:
IllegalArgumentException

setExitMessage

public void setExitMessage(String exitMessage)
Set the template used for method exit log messages. This template can contain any of the following placeholders:
  • $[targetClassName]
  • $[targetClassShortName]
  • $[argumentTypes]
  • $[arguments]
  • $[returnValue]
  • $[invocationTime]

setExceptionMessage

public void setExceptionMessage(String exceptionMessage)
Set the template used for method exception log messages. This template can contain any of the following placeholders:
  • $[targetClassName]
  • $[targetClassShortName]
  • $[argumentTypes]
  • $[arguments]
  • $[exception]

invokeUnderTrace

protected Object invokeUnderTrace(MethodInvocation invocation,
                                  Log logger)
                           throws Throwable
Writes a log message before the invocation based on the value of enterMessage. If the invocation succeeds, then a log message is written on exit based on the value exitMessage. If an exception occurs during invocation, then a message is written based on the value of exceptionMessage.

Specified by:
invokeUnderTrace in class AbstractTraceInterceptor
logger - the Log to write trace messages to
Returns:
the result of the call to MethodInvocation.proceed()
Throws:
Throwable - if the call to MethodInvocation.proceed() encountered any errors
See Also:
setEnterMessage(java.lang.String),
setExitMessage(java.lang.String),
setExceptionMessage(java.lang.String)

writeToLog

protected void writeToLog(Log logger,
                          String message)
Writes the supplied message to the supplied Log instance.

See Also:
writeToLog(org.apache.commons.logging.Log, String, Throwable)

writeToLog

protected void writeToLog(Log logger,
                          String message,
                          Throwable ex)
Writes the supplied message and Throwable to the supplied Log instance. By default messages are written at TRACE level. Sub-classes can override this method to control which level the message is written at.

replacePlaceholders

protected String replacePlaceholders(String message,
                                     MethodInvocation methodInvocation,
                                     Object returnValue,
                                     Throwable throwable,
                                     long invocationTime)
Replace the placeholders in the given message with the supplied values, or values derived from those supplied.

Parameters:
message - the message template containing the placeholders to be replaced
methodInvocation - the MethodInvocation being logged. Used to derive values for all placeholders except $[exception] and $[returnValue].
returnValue - any value returned by the invocation. Used to replace the $[returnValue] placeholder. May be null.
throwable - any Throwable raised during the invocation. The value of Throwable.toString() is replaced for the $[exception] placeholder. May be null.
invocationTime - the value to write in place of the $[invocationTime] placeholder
Returns:
the formatted output to write to the log
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DebugInterceptor

org.springframework.aop.interceptor
Class DebugInterceptor

java.lang.Object
    extended by  org.springframework.aop.interceptor.AbstractTraceInterceptor
        extended by  org.springframework.aop.interceptor.SimpleTraceInterceptor
            extended by  org.springframework.aop.interceptor.DebugInterceptor
All Implemented Interfaces:
Serializable, Advice, Interceptor, MethodInterceptor
public class DebugInterceptor
extends SimpleTraceInterceptor

AOP Alliance MethodInterceptor that can be introduced in a chain to display verbose information about intercepted invocations to the logger.

Logs full invocation details on method entry and method exit, including invocation arguments and invocation count. This is only intended for debugging purposes; use SimpleTraceInterceptor or CustomizableTraceInterceptor for pure tracing purposes.

Author:
Rod Johnson, Juergen Hoeller
See Also:
SimpleTraceInterceptor, CustomizableTraceInterceptor, Serialized Form

Field Summary
Fields inherited from class org.springframework.aop.interceptor.AbstractTraceInterceptor
defaultLogger
Constructor Summary
DebugInterceptor()
Create a new DebugInterceptor with a static logger.
DebugInterceptor(boolean useDynamicLogger)
Create a new DebugInterceptor with dynamic or static logger, according to the given flag.
Method Summary
long | getCount() Return the number of times this interceptor has been invoked.
protected String | getInvocationDescription(MethodInvocation invocation) Return a description for the given method invocation.
Object | invoke(MethodInvocation invocation) Determines whether or not logging is enabled for the particular MethodInvocation.
void | resetCount() Reset the invocation count to zero.
Methods inherited from class org.springframework.aop.interceptor.SimpleTraceInterceptor
invokeUnderTrace
Methods inherited from class org.springframework.aop.interceptor.AbstractTraceInterceptor
getClassForLogging, getLoggerForInvocation, isInterceptorEnabled, isLogEnabled, setHideProxyClassNames, setLoggerName, setUseDynamicLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DebugInterceptor

public DebugInterceptor()
Create a new DebugInterceptor with a static logger.

DebugInterceptor

public DebugInterceptor(boolean useDynamicLogger)
Create a new DebugInterceptor with dynamic or static logger, according to the given flag.

Parameters:
useDynamicLogger - whether to use a dynamic logger or a static logger
See Also:
AbstractTraceInterceptor.setUseDynamicLogger(boolean)
Method Detail

invoke

public Object invoke(MethodInvocation invocation)
              throws Throwable
Description copied from class: AbstractTraceInterceptor
Determines whether or not logging is enabled for the particular MethodInvocation. If not, the method invocation proceeds as normal, otherwise the method invocation is passed to the invokeUnderTrace method for handling.

Specified by:
invoke in interface MethodInterceptor
Overrides:
invoke in class AbstractTraceInterceptor
Throws:
Throwable
See Also:
AbstractTraceInterceptor.invokeUnderTrace(org.aopalliance.intercept.MethodInvocation, org.apache.commons.logging.Log)

getInvocationDescription

protected String getInvocationDescription(MethodInvocation invocation)
Description copied from class: SimpleTraceInterceptor
Return a description for the given method invocation.

Overrides:
getInvocationDescription in class SimpleTraceInterceptor
Parameters:
invocation - the invocation to describe
Returns:
the description

getCount

public long getCount()
Return the number of times this interceptor has been invoked.

resetCount

public void resetCount()
Reset the invocation count to zero.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ExposeBeanNameAdvisors

org.springframework.aop.interceptor
Class ExposeBeanNameAdvisors

java.lang.Object
    extended by  org.springframework.aop.interceptor.ExposeBeanNameAdvisors

public abstract class ExposeBeanNameAdvisors
extends Object

Convenient methods for creating advisors that may be used when autoproxying beans created with the Spring IoC container, binding the bean name to the current invocation. May support a bean() pointcut designator with AspectJ.

Typically used in Spring auto-proxying, where the bean name is known at proxy creation time.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller
See Also:
NamedBean

Constructor Summary
ExposeBeanNameAdvisors()
Method Summary
static Advisor | createAdvisorIntroducingNamedBean(String beanName) Create a new advisor that will expose the given bean name, introducing the NamedBean interface to make the bean name accessible without forcing the target object to be aware of this Spring IoC concept.
static Advisor | createAdvisorWithoutIntroduction(String beanName) Create a new advisor that will expose the given bean name, with no introduction
static String | getBeanName() Find the bean name for the current invocation.
static String | getBeanName(MethodInvocation mi) Find the bean name for the given invocation.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ExposeBeanNameAdvisors

public ExposeBeanNameAdvisors()
Method Detail

getBeanName

public static String getBeanName()
                          throws IllegalStateException
Find the bean name for the current invocation. Assumes that an ExposeBeanNameAdvisor has been included in the interceptor chain, and that the invocation is exposed with ExposeInvocationInterceptor.

Returns:
the bean name (never null)
Throws:
IllegalStateException - if the bean name has not been exposed

getBeanName

public static String getBeanName(MethodInvocation mi)
                          throws IllegalStateException
Find the bean name for the given invocation. Assumes that an ExposeBeanNameAdvisor has been included in the interceptor chain.

Parameters:
mi - MethodInvocation that should contain the bean name as an attribute
Returns:
the bean name (never null)
Throws:
IllegalStateException - if the bean name has not been exposed

createAdvisorWithoutIntroduction

public static Advisor createAdvisorWithoutIntroduction(String beanName)
Create a new advisor that will expose the given bean name, with no introduction

Parameters:
beanName - bean name to expose

createAdvisorIntroducingNamedBean

public static Advisor createAdvisorIntroducingNamedBean(String beanName)
Create a new advisor that will expose the given bean name, introducing the NamedBean interface to make the bean name accessible without forcing the target object to be aware of this Spring IoC concept.

Parameters:
beanName - the bean name to expose
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ExposeInvocationInterceptor

org.springframework.aop.interceptor
Class ExposeInvocationInterceptor

java.lang.Object
    extended by  org.springframework.aop.interceptor.ExposeInvocationInterceptor
All Implemented Interfaces:
Serializable, Advice, Interceptor, MethodInterceptor, Ordered
public class ExposeInvocationInterceptor
extends Object
implements MethodInterceptor, Ordered, Serializable

Interceptor that exposes the current MethodInvocation as a thread-local object. We occasionally need to do this; for example, when a pointcut (e.g. an AspectJ expression pointcut) needs to know the full invocation context.

Don't use this interceptor unless this is really necessary. Target objects should not normally know about Spring AOP, as this creates a dependency on Spring API. Target objects should be plain POJOs as far as possible.

If used, this interceptor will normally be the first in the interceptor chain.

Author:
Rod Johnson, Juergen Hoeller
See Also:
Serialized Form

Field Summary
static Advisor | ADVISOR Singleton advisor for this class.
static ExposeInvocationInterceptor | INSTANCE Singleton instance of this class
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Method Summary
static MethodInvocation | currentInvocation() Return the AOP Alliance MethodInvocation object associated with the current invocation.
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
Object | invoke(MethodInvocation mi)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

INSTANCE

public static final ExposeInvocationInterceptor INSTANCE
Singleton instance of this class

ADVISOR

public static final Advisor ADVISOR
Singleton advisor for this class. Use in preference to INSTANCE when using Spring AOP, as it prevents the need to create a new Advisor to wrap the instance.

Method Detail

currentInvocation

public static MethodInvocation currentInvocation()
                                          throws IllegalStateException
Return the AOP Alliance MethodInvocation object associated with the current invocation.

Returns:
the invocation object associated with the current invocation
Throws:
IllegalStateException - if there is no AOP invocation in progress, or if the ExposeInvocationInterceptor was not added to this interceptor chain

invoke

public Object invoke(MethodInvocation mi)
              throws Throwable
Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JamonPerformanceMonitorInterceptor

org.springframework.aop.interceptor
Class JamonPerformanceMonitorInterceptor

java.lang.Object
    extended by  org.springframework.aop.interceptor.AbstractTraceInterceptor
        extended by  org.springframework.aop.interceptor.AbstractMonitoringInterceptor
            extended by  org.springframework.aop.interceptor.JamonPerformanceMonitorInterceptor
All Implemented Interfaces:
Serializable, Advice, Interceptor, MethodInterceptor
public class JamonPerformanceMonitorInterceptor
extends AbstractMonitoringInterceptor

Performance monitor interceptor that uses JAMon library to perform the performance measurement on the intercepted method and output the stats.

This code is inspired by Thierry Templier's blog.

Since:
1.1.3
Author:
Dmitriy Kopylenko, Juergen Hoeller, Rob Harrop
See Also:
MonitorFactory, PerformanceMonitorInterceptor, Serialized Form

Field Summary
Fields inherited from class org.springframework.aop.interceptor.AbstractTraceInterceptor
defaultLogger
Constructor Summary
JamonPerformanceMonitorInterceptor()
Create a new JamonPerformanceMonitorInterceptor with a static logger.
JamonPerformanceMonitorInterceptor(boolean useDynamicLogger)
Create a new JamonPerformanceMonitorInterceptor with a dynamic or static logger, according to the given flag.
JamonPerformanceMonitorInterceptor(boolean useDynamicLogger, boolean trackAllInvocations)
Create a new JamonPerformanceMonitorInterceptor with a dynamic or static logger, according to the given flag.
Method Summary
protected Object | invokeUnderTrace(MethodInvocation invocation, Log logger) Wraps the invocation with a JAMon Monitor and writes the current performance statistics to the log (if enabled).
protected boolean | isInterceptorEnabled(MethodInvocation invocation, Log logger) Always applies the interceptor if the "trackAllInvocations" flag has been set; else just kicks in if the log is enabled.
void | setTrackAllInvocations(boolean trackAllInvocations) Set whether to track all invocations that go through this interceptor, or just invocations with trace logging enabled.
Methods inherited from class org.springframework.aop.interceptor.AbstractMonitoringInterceptor
createInvocationTraceName, getPrefix, getSuffix, setLogTargetClassInvocation, setPrefix, setSuffix
Methods inherited from class org.springframework.aop.interceptor.AbstractTraceInterceptor
getClassForLogging, getLoggerForInvocation, invoke, isLogEnabled, setHideProxyClassNames, setLoggerName, setUseDynamicLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JamonPerformanceMonitorInterceptor

public JamonPerformanceMonitorInterceptor()
Create a new JamonPerformanceMonitorInterceptor with a static logger.

JamonPerformanceMonitorInterceptor

public JamonPerformanceMonitorInterceptor(boolean useDynamicLogger)
Create a new JamonPerformanceMonitorInterceptor with a dynamic or static logger, according to the given flag.

Parameters:
useDynamicLogger - whether to use a dynamic logger or a static logger
See Also:
AbstractTraceInterceptor.setUseDynamicLogger(boolean)

JamonPerformanceMonitorInterceptor

public JamonPerformanceMonitorInterceptor(boolean useDynamicLogger,
                                          boolean trackAllInvocations)
Create a new JamonPerformanceMonitorInterceptor with a dynamic or static logger, according to the given flag.

Parameters:
useDynamicLogger - whether to use a dynamic logger or a static logger
trackAllInvocations - whether to track all invocations that go through this interceptor, or just invocations with trace logging enabled
See Also:
AbstractTraceInterceptor.setUseDynamicLogger(boolean)
Method Detail

setTrackAllInvocations

public void setTrackAllInvocations(boolean trackAllInvocations)
Set whether to track all invocations that go through this interceptor, or just invocations with trace logging enabled.

Default is "false": Only invocations with trace logging enabled will be monitored. Specify "true" to let JAMon track all invocations, gathering statistics even when trace logging is disabled.

isInterceptorEnabled

protected boolean isInterceptorEnabled(MethodInvocation invocation,
                                       Log logger)
Always applies the interceptor if the "trackAllInvocations" flag has been set; else just kicks in if the log is enabled.

Overrides:
isInterceptorEnabled in class AbstractTraceInterceptor
Parameters:
invocation - the MethodInvocation being traced
logger - the Log instance to check
See Also:
setTrackAllInvocations(boolean), AbstractTraceInterceptor.isLogEnabled(org.apache.commons.logging.Log)

invokeUnderTrace

protected Object invokeUnderTrace(MethodInvocation invocation,
                                  Log logger)
                           throws Throwable
Wraps the invocation with a JAMon Monitor and writes the current performance statistics to the log (if enabled).

Specified by:
invokeUnderTrace in class AbstractTraceInterceptor
logger - the Log to write trace messages to
Returns:
the result of the call to MethodInvocation.proceed()
Throws:
Throwable - if the call to MethodInvocation.proceed() encountered any errors
See Also:
MonitorFactory.start(java.lang.String), Monitor.stop()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PerformanceMonitorInterceptor

org.springframework.aop.interceptor
Class PerformanceMonitorInterceptor

java.lang.Object
    extended by  org.springframework.aop.interceptor.AbstractTraceInterceptor
        extended by  org.springframework.aop.interceptor.AbstractMonitoringInterceptor
            extended by  org.springframework.aop.interceptor.PerformanceMonitorInterceptor
All Implemented Interfaces:
Serializable, Advice, Interceptor, MethodInterceptor
public class PerformanceMonitorInterceptor
extends AbstractMonitoringInterceptor

Simple AOP Alliance MethodInterceptor for performance monitoring. This interceptor has no effect on the intercepted method call.

Uses a StopWatch for the actual performance measuring.

Author:
Rod Johnson, Dmitriy Kopylenko, Rob Harrop
See Also:
StopWatch, JamonPerformanceMonitorInterceptor, Serialized Form

Field Summary
Fields inherited from class org.springframework.aop.interceptor.AbstractTraceInterceptor
defaultLogger
Constructor Summary
PerformanceMonitorInterceptor()
Create a new PerformanceMonitorInterceptor with a static logger.
PerformanceMonitorInterceptor(boolean useDynamicLogger)
Create a new PerformanceMonitorInterceptor with a dynamic or static logger, according to the given flag.
Method Summary
protected  Object invokeUnderTrace(MethodInvocation invocation, Log logger)
Subclasses must override this method to perform any tracing around the supplied MethodInvocation.
Methods inherited from class org.springframework.aop.interceptor.AbstractMonitoringInterceptor
createInvocationTraceName, getPrefix, getSuffix, setLogTargetClassInvocation, setPrefix, setSuffix
Methods inherited from class org.springframework.aop.interceptor.AbstractTraceInterceptor
getClassForLogging, getLoggerForInvocation, invoke, isInterceptorEnabled, isLogEnabled, setHideProxyClassNames, setLoggerName, setUseDynamicLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PerformanceMonitorInterceptor

public PerformanceMonitorInterceptor()
Create a new PerformanceMonitorInterceptor with a static logger.

PerformanceMonitorInterceptor

public PerformanceMonitorInterceptor(boolean useDynamicLogger)
Create a new PerformanceMonitorInterceptor with a dynamic or static logger, according to the given flag.

Parameters:
useDynamicLogger - whether to use a dynamic logger or a static logger
See Also:
AbstractTraceInterceptor.setUseDynamicLogger(boolean)
Method Detail

invokeUnderTrace

protected Object invokeUnderTrace(MethodInvocation invocation,
                                  Log logger)
                           throws Throwable
Description copied from class: AbstractTraceInterceptor
Subclasses must override this method to perform any tracing around the supplied MethodInvocation. Subclasses are responsible for ensuring that the MethodInvocation actually executes by calling MethodInvocation.proceed().

By default, the passed-in Log instance will have log level "trace" enabled. Subclasses do not have to check for this again, unless they overwrite the isInterceptorEnabled method to modify the default behavior.

Specified by:
invokeUnderTrace in class AbstractTraceInterceptor
logger - the Log to write trace messages to
Returns:
the result of the call to MethodInvocation.proceed()
Throws:
Throwable - if the call to MethodInvocation.proceed() encountered any errors
See Also:
AbstractTraceInterceptor.isInterceptorEnabled(org.aopalliance.intercept.MethodInvocation, org.apache.commons.logging.Log), AbstractTraceInterceptor.isLogEnabled(org.apache.commons.logging.Log)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleTraceInterceptor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.aop.interceptor
Class SimpleTraceInterceptor

java.lang.Object
    extended by  org.springframework.aop.interceptor.AbstractTraceInterceptor
        extended by  org.springframework.aop.interceptor.SimpleTraceInterceptor
All Implemented Interfaces:
Serializable, Advice, Interceptor, MethodInterceptor
Direct Known Subclasses:
DebugInterceptor
public class SimpleTraceInterceptor
extends AbstractTraceInterceptor

Simple AOP Alliance MethodInterceptor that can be introduced in a chain to display verbose trace information about intercepted method invocations, with method entry and method exit info.

Consider using CustomizableTraceInterceptor for more advanced needs.

Since:
1.2
Author:
Dmitriy Kopylenko, Juergen Hoeller
See Also:
CustomizableTraceInterceptor, Serialized Form

Field Summary
Fields inherited from class org.springframework.aop.interceptor.AbstractTraceInterceptor
defaultLogger
Constructor Summary
SimpleTraceInterceptor()
Create a new SimpleTraceInterceptor with a static logger.
SimpleTraceInterceptor(boolean useDynamicLogger)
Create a new SimpleTraceInterceptor with dynamic or static logger, according to the given flag.
Method Summary
protected String | getInvocationDescription(MethodInvocation invocation) Return a description for the given method invocation.
protected Object | invokeUnderTrace(MethodInvocation invocation, Log logger) Subclasses must override this method to perform any tracing around the supplied MethodInvocation.
Methods inherited from class org.springframework.aop.interceptor.AbstractTraceInterceptor
getClassForLogging, getLoggerForInvocation, invoke, isInterceptorEnabled, isLogEnabled, setHideProxyClassNames, setLoggerName, setUseDynamicLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleTraceInterceptor

public SimpleTraceInterceptor()
Create a new SimpleTraceInterceptor with a static logger.

SimpleTraceInterceptor

public SimpleTraceInterceptor(boolean useDynamicLogger)
Create a new SimpleTraceInterceptor with dynamic or static logger, according to the given flag.

Parameters:
useDynamicLogger - whether to use a dynamic logger or a static logger
See Also:
AbstractTraceInterceptor.setUseDynamicLogger(boolean)
Method Detail

invokeUnderTrace

protected Object invokeUnderTrace(MethodInvocation invocation,
                                  Log logger)
                           throws Throwable
Description copied from class: AbstractTraceInterceptor
Subclasses must override this method to perform any tracing around the supplied MethodInvocation. Subclasses are responsible for ensuring that the MethodInvocation actually executes by calling MethodInvocation.proceed().

By default, the passed-in Log instance will have log level "trace" enabled. Subclasses do not have to check for this again, unless they overwrite the isInterceptorEnabled method to modify the default behavior.

Specified by:
invokeUnderTrace in class AbstractTraceInterceptor
logger - the Log to write trace messages to
Returns:
the result of the call to MethodInvocation.proceed()
Throws:
Throwable - if the call to MethodInvocation.proceed() encountered any errors
See Also:
AbstractTraceInterceptor.isInterceptorEnabled(org.aopalliance.intercept.MethodInvocation, org.apache.commons.logging.Log), AbstractTraceInterceptor.isLogEnabled(org.apache.commons.logging.Log)

getInvocationDescription

protected String getInvocationDescription(MethodInvocation invocation)
Return a description for the given method invocation.

Parameters:
invocation - the invocation to describe
Returns:
the description
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.aop.scope

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.aop.scope

Support for AOP-based scoping of target objects, with configurable backend.

See:
Description

Interface Summary
ScopedObject An AOP introduction interface for scoped objects.

Class Summary
DefaultScopedObject | Default implementation of the ScopedObject interface.
ScopedProxyFactoryBean | Convenient proxy factory bean for scoped objects.
ScopedProxyUtils | Utility class for creating a scoped proxy.

Package org.springframework.aop.scope Description

Support for AOP-based scoping of target objects, with configurable backend.


org.springframework.aop.scope Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.aop.scope

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.aop.scope.DefaultScopedObject (implements org.springframework.aop.scope.ScopedObject, java.io.Serializable)
    • org.springframework.aop.framework.ProxyConfig (implements java.io.Serializable)
      • org.springframework.aop.scope.ScopedProxyFactoryBean (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.FactoryBean<T>)
    • org.springframework.aop.scope.ScopedProxyUtils

Interface Hierarchy

  • org.springframework.aop.RawTargetAccess
    • org.springframework.aop.scope.ScopedObject


ScopedObject

org.springframework.aop.scope
Interface ScopedObject

All Superinterfaces:
RawTargetAccess
All Known Implementing Classes:
DefaultScopedObject
public interface ScopedObject
extends RawTargetAccess

An AOP introduction interface for scoped objects.

Objects created from the ScopedProxyFactoryBean can be cast to this interface, enabling access to the raw target object and programmatic removal of the target object.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller
See Also:
ScopedProxyFactoryBean

Method Summary
Object | getTargetObject() Return the current target object behind this scoped object proxy, in its raw form (as stored in the target scope).
void | removeFromScope() Remove this object from its target scope, for example from the backing session.

Method Detail

getTargetObject

Object getTargetObject()
Return the current target object behind this scoped object proxy, in its raw form (as stored in the target scope).

The raw target object can for example be passed to persistence providers which would not be able to handle the scoped proxy object.

Returns:
the current target object behind this scoped object proxy

removeFromScope

void removeFromScope()
Remove this object from its target scope, for example from the backing session.

Note that no further calls may be made to the scoped object afterwards (at least within the current thread, that is, with the exact same target object in the target scope).

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultScopedObject

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.aop.scope
Class DefaultScopedObject

java.lang.Object
    extended by  org.springframework.aop.scope.DefaultScopedObject
All Implemented Interfaces:
Serializable, RawTargetAccess, ScopedObject
public class DefaultScopedObject
extends Object
implements ScopedObject, Serializable

Default implementation of the ScopedObject interface.

Simply delegates the calls to the underlying bean factory (BeanFactory.getBean(String)/ ConfigurableBeanFactory.destroyScopedBean(String)).

Since:
2.0
Author:
Juergen Hoeller
See Also:
BeanFactory.getBean(java.lang.String), ConfigurableBeanFactory.destroyScopedBean(java.lang.String), Serialized Form

Constructor Summary
DefaultScopedObject(ConfigurableBeanFactory beanFactory, String targetBeanName)
Creates a new instance of the DefaultScopedObject class.
Method Summary
Object | getTargetObject() Return the current target object behind this scoped object proxy, in its raw form (as stored in the target scope).
void | removeFromScope() Remove this object from its target scope, for example from the backing session.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DefaultScopedObject

public DefaultScopedObject(ConfigurableBeanFactory beanFactory,
                           String targetBeanName)
Creates a new instance of the DefaultScopedObject class.

Parameters:
beanFactory - the ConfigurableBeanFactory that holds the scoped target object
targetBeanName - the name of the target bean
Method Detail

getTargetObject

public Object getTargetObject()
Description copied from interface: ScopedObject
Return the current target object behind this scoped object proxy, in its raw form (as stored in the target scope).

The raw target object can for example be passed to persistence providers which would not be able to handle the scoped proxy object.

Specified by:
getTargetObject in interface ScopedObject
Returns:
the current target object behind this scoped object proxy

removeFromScope

public void removeFromScope()
Description copied from interface: ScopedObject
Remove this object from its target scope, for example from the backing session.

Note that no further calls may be made to the scoped object afterwards (at least within the current thread, that is, with the exact same target object in the target scope).

Specified by:
removeFromScope in interface ScopedObject
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ScopedProxyFactoryBean

org.springframework.aop.scope
Class ScopedProxyFactoryBean

java.lang.Object
    extended by  org.springframework.aop.framework.ProxyConfig
        extended by  org.springframework.aop.scope.ScopedProxyFactoryBean
All Implemented Interfaces:
Serializable, BeanFactoryAware, FactoryBean<Object>
public class ScopedProxyFactoryBean
extends ProxyConfig
implements FactoryBean<Object>, BeanFactoryAware

Convenient proxy factory bean for scoped objects.

Proxies created using this factory bean are thread-safe singletons and may be injected into shared objects, with transparent scoping behavior.

Proxies returned by this class implement the ScopedObject interface. This presently allows for removing the corresponding object from the scope, seamlessly creating a new instance in the scope on next access.

Please note that the proxies created by this factory are class-based proxies by default. This can be customized through switching the "proxyTargetClass" property to "false".

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller
See Also:
ProxyConfig.setProxyTargetClass(boolean), Serialized Form

Constructor Summary
ScopedProxyFactoryBean()
Create a new ScopedProxyFactoryBean instance.
Method Summary
 Object getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<?> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setBeanFactory(BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance.
 void setTargetBeanName(String targetBeanName)
Set the name of the bean that is to be scoped.
Methods inherited from class org.springframework.aop.framework.ProxyConfig
copyFrom, isExposeProxy, isFrozen, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setFrozen, setOpaque, setOptimize, setProxyTargetClass, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ScopedProxyFactoryBean

public ScopedProxyFactoryBean()
Create a new ScopedProxyFactoryBean instance.

Method Detail

setTargetBeanName

public void setTargetBeanName(String targetBeanName)
Set the name of the bean that is to be scoped.

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
BeanInitializationException

getObject

public Object getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<Object>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<?> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<Object>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<Object>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ScopedProxyUtils

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.aop.scope
Class ScopedProxyUtils

java.lang.Object
    extended by  org.springframework.aop.scope.ScopedProxyUtils

public abstract class ScopedProxyUtils
extends Object

Utility class for creating a scoped proxy. Used by ScopedProxyBeanDefinitionDecorator and ClassPathBeanDefinitionScanner.

Since:
2.5
Author:
Mark Fisher, Juergen Hoeller, Rob Harrop

Constructor Summary
ScopedProxyUtils()
Method Summary
static BeanDefinitionHolder | createScopedProxy(BeanDefinitionHolder definition, BeanDefinitionRegistry registry, boolean proxyTargetClass) Generates a scoped proxy for the supplied target bean, registering the target bean with an internal name and setting 'targetBeanName' on the scoped proxy.
static String | getTargetBeanName(String originalBeanName) Generates the bean name that is used within the scoped proxy to reference the target bean.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ScopedProxyUtils

public ScopedProxyUtils()
Method Detail

createScopedProxy

public static BeanDefinitionHolder createScopedProxy(BeanDefinitionHolder definition,
                                                     BeanDefinitionRegistry registry,
                                                     boolean proxyTargetClass)
Generates a scoped proxy for the supplied target bean, registering the target bean with an internal name and setting 'targetBeanName' on the scoped proxy.

Parameters:
definition - the original bean definition
registry - the bean definition registry
proxyTargetClass - whether to create a target class proxy
Returns:
the scoped proxy definition

getTargetBeanName

public static String getTargetBeanName(String originalBeanName)
Generates the bean name that is used within the scoped proxy to reference the target bean.

Parameters:
originalBeanName - the original name of bean
Returns:
the generated bean to be used to reference the target bean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.aop.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.aop.support

Convenience classes for using Spring's AOP API.

See:
Description

Interface Summary
ExpressionPointcut Interface to be implemented by pointcuts that use String expressions.

Class Summary
AbstractBeanFactoryPointcutAdvisor | Abstract BeanFactory-based PointcutAdvisor that allows for any Advice to be configured as reference to an Advice bean in a BeanFactory.
AbstractExpressionPointcut | Abstract superclass for expression pointcuts, offering location and expression properties.
AbstractGenericPointcutAdvisor | Abstract generic PointcutAdvisor that allows for any Advice to be configured.
AbstractPointcutAdvisor | Abstract base class for PointcutAdvisor implementations.
AbstractRegexpMethodPointcut | Abstract base regular expression pointcut bean.
AopUtils | Utility methods for AOP support code.
ClassFilters | Static utility methods for composing ClassFilters.
ComposablePointcut | Convenient class for building up pointcuts.
ControlFlowPointcut | Pointcut and method matcher for use in simple cflow-style pointcut.
DefaultBeanFactoryPointcutAdvisor | Concrete BeanFactory-based PointcutAdvisor that allows for any Advice to be configured as reference to an Advice bean in the BeanFactory, as well as the Pointcut to be configured through a bean property.
DefaultIntroductionAdvisor | Simple IntroductionAdvisor implementation that by default applies to any class.
DefaultPointcutAdvisor | Convenient Pointcut-driven Advisor implementation.
DelegatePerTargetObjectIntroductionInterceptor | Convenient implementation of the IntroductionInterceptor interface.
DelegatingIntroductionInterceptor | Convenient implementation of the IntroductionInterceptor interface.
DynamicMethodMatcher | Convenient abstract superclass for dynamic method matchers, which do care about arguments at runtime.
DynamicMethodMatcherPointcut | Convenient superclass when we want to force subclasses to implement MethodMatcher interface, but subclasses will want to be pointcuts.
IntroductionInfoSupport | Support for implementations of IntroductionInfo.
JdkRegexpMethodPointcut | Regular expression pointcut based on the java.util.regex package.
MethodMatchers | Static utility methods for composing MethodMatchers.
NameMatchMethodPointcut | Pointcut bean for simple method name matches, as alternative to regexp patterns.
NameMatchMethodPointcutAdvisor | Convenient class for name-match method pointcuts that hold an Advice, making them an Advisor.
Pointcuts | Pointcut constants for matching getters and setters, and static methods useful for manipulating and evaluating pointcuts.
RegexpMethodPointcutAdvisor | Convenient class for regexp method pointcuts that hold an Advice, making them an Advisor.
RootClassFilter | Simple ClassFilter implementation that passes classes (and optionally subclasses)
StaticMethodMatcher | Convenient abstract superclass for static method matchers, which don't care about arguments at runtime.
StaticMethodMatcherPointcut | Convenient superclass when we want to force subclasses to implement the MethodMatcher interface but subclasses will want to be pointcuts.
StaticMethodMatcherPointcutAdvisor | Convenient base class for Advisors that are also static pointcuts.

Package org.springframework.aop.support Description

Convenience classes for using Spring's AOP API.


org.springframework.aop.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.aop.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.aop.support.AbstractExpressionPointcut (implements org.springframework.aop.support.ExpressionPointcut, java.io.Serializable)
    • org.springframework.aop.support.AbstractPointcutAdvisor (implements org.springframework.core.Ordered, org.springframework.aop.PointcutAdvisor, java.io.Serializable)
      • org.springframework.aop.support.AbstractBeanFactoryPointcutAdvisor (implements org.springframework.beans.factory.BeanFactoryAware)
        • org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor
      • org.springframework.aop.support.AbstractGenericPointcutAdvisor
        • org.springframework.aop.support.DefaultPointcutAdvisor (implements java.io.Serializable)
        • org.springframework.aop.support.NameMatchMethodPointcutAdvisor
        • org.springframework.aop.support.RegexpMethodPointcutAdvisor
    • org.springframework.aop.support.AopUtils
    • org.springframework.aop.support.ClassFilters
    • org.springframework.aop.support.ComposablePointcut (implements org.springframework.aop.Pointcut, java.io.Serializable)
    • org.springframework.aop.support.ControlFlowPointcut (implements org.springframework.aop.ClassFilter, org.springframework.aop.MethodMatcher, org.springframework.aop.Pointcut, java.io.Serializable)
    • org.springframework.aop.support.DefaultIntroductionAdvisor (implements org.springframework.aop.ClassFilter, org.springframework.aop.IntroductionAdvisor, org.springframework.core.Ordered, java.io.Serializable)
    • org.springframework.aop.support.DynamicMethodMatcher (implements org.springframework.aop.MethodMatcher)
      • org.springframework.aop.support.DynamicMethodMatcherPointcut (implements org.springframework.aop.Pointcut)
    • org.springframework.aop.support.IntroductionInfoSupport (implements org.springframework.aop.IntroductionInfo, java.io.Serializable)
      • org.springframework.aop.support.DelegatePerTargetObjectIntroductionInterceptor (implements org.springframework.aop.IntroductionInterceptor)
      • org.springframework.aop.support.DelegatingIntroductionInterceptor (implements org.springframework.aop.IntroductionInterceptor)
    • org.springframework.aop.support.MethodMatchers
    • org.springframework.aop.support.Pointcuts
    • org.springframework.aop.support.RootClassFilter (implements org.springframework.aop.ClassFilter, java.io.Serializable)
    • org.springframework.aop.support.StaticMethodMatcher (implements org.springframework.aop.MethodMatcher)
      • org.springframework.aop.support.StaticMethodMatcherPointcut (implements org.springframework.aop.Pointcut)
        • org.springframework.aop.support.AbstractRegexpMethodPointcut (implements java.io.Serializable)
          • org.springframework.aop.support.JdkRegexpMethodPointcut
        • org.springframework.aop.support.NameMatchMethodPointcut (implements java.io.Serializable)
        • org.springframework.aop.support.StaticMethodMatcherPointcutAdvisor (implements org.springframework.core.Ordered, org.springframework.aop.PointcutAdvisor, java.io.Serializable)

Interface Hierarchy

  • org.springframework.aop.Pointcut
    • org.springframework.aop.support.ExpressionPointcut


ExpressionPointcut

org.springframework.aop.support
Interface ExpressionPointcut

All Superinterfaces:
Pointcut
All Known Implementing Classes:
AbstractExpressionPointcut, AspectJExpressionPointcut
public interface ExpressionPointcut
extends Pointcut

Interface to be implemented by pointcuts that use String expressions.

Since:
2.0
Author:
Rob Harrop

Field Summary
Fields inherited from interface org.springframework.aop.Pointcut
TRUE
Method Summary
 String getExpression()
Return the String expression for this pointcut.
Methods inherited from interface org.springframework.aop.Pointcut
getClassFilter, getMethodMatcher

Method Detail

getExpression

String getExpression()
Return the String expression for this pointcut.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractBeanFactoryPointcutAdvisor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.aop.support
Class AbstractBeanFactoryPointcutAdvisor

java.lang.Object
    extended by  org.springframework.aop.support.AbstractPointcutAdvisor
        extended by  org.springframework.aop.support.AbstractBeanFactoryPointcutAdvisor
All Implemented Interfaces:
Serializable, Advisor, PointcutAdvisor, BeanFactoryAware, Ordered
Direct Known Subclasses:
BeanFactoryTransactionAttributeSourceAdvisor, DefaultBeanFactoryPointcutAdvisor
public abstract class AbstractBeanFactoryPointcutAdvisor
extends AbstractPointcutAdvisor
implements BeanFactoryAware

Abstract BeanFactory-based PointcutAdvisor that allows for any Advice to be configured as reference to an Advice bean in a BeanFactory.

Specifying the name of an advice bean instead of the advice object itself (if running within a BeanFactory) increases loose coupling at initialization time, in order to not initialize the advice object until the pointcut actually matches.

Since:
2.0.2
Author:
Juergen Hoeller
See Also:
setAdviceBeanName(java.lang.String), DefaultBeanFactoryPointcutAdvisor, Serialized Form

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AbstractBeanFactoryPointcutAdvisor()
Method Summary
Advice | getAdvice() Return the advice part of this aspect.
String | getAdviceBeanName() Return the name of the advice bean that this advisor refers to, if any.
void | setAdviceBeanName(String adviceBeanName) Specify the name of the advice bean that this advisor should refer to.
void | setBeanFactory(BeanFactory beanFactory) Callback that supplies the owning factory to a bean instance.
String | toString()
Methods inherited from class org.springframework.aop.support.AbstractPointcutAdvisor
equals, getOrder, hashCode, isPerInstance, setOrder
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.aop.PointcutAdvisor
getPointcut

Constructor Detail

AbstractBeanFactoryPointcutAdvisor

public AbstractBeanFactoryPointcutAdvisor()
Method Detail

setAdviceBeanName

public void setAdviceBeanName(String adviceBeanName)
Specify the name of the advice bean that this advisor should refer to.

An instance of the specified bean will be obtained on first access of this advisor's advice. This advisor will only ever obtain at most one single instance of the advice bean, caching the instance for the lifetime of the advisor.

See Also:
getAdvice()

getAdviceBeanName

public String getAdviceBeanName()
Return the name of the advice bean that this advisor refers to, if any.

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
BeanInitializationException

getAdvice

public Advice getAdvice()
Description copied from interface: Advisor
Return the advice part of this aspect. An advice may be an interceptor, a before advice, a throws advice, etc.

Specified by:
getAdvice in interface Advisor
Returns:
the advice that should apply if the pointcut matches
See Also:
MethodInterceptor, BeforeAdvice, ThrowsAdvice, AfterReturningAdvice

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractExpressionPointcut

org.springframework.aop.support
Class AbstractExpressionPointcut

java.lang.Object
    extended by  org.springframework.aop.support.AbstractExpressionPointcut
All Implemented Interfaces:
Serializable, Pointcut, ExpressionPointcut
Direct Known Subclasses:
AspectJExpressionPointcut
public abstract class AbstractExpressionPointcut
extends Object
implements ExpressionPointcut, Serializable

Abstract superclass for expression pointcuts, offering location and expression properties.

Since:
2.0
Author:
Rod Johnson, Rob Harrop
See Also:
setLocation(java.lang.String), setExpression(java.lang.String), Serialized Form

Field Summary
Fields inherited from interface org.springframework.aop.Pointcut
TRUE
Constructor Summary
AbstractExpressionPointcut()
Method Summary
String | getExpression() Return this pointcut's expression.
String | getLocation() Return location information about the pointcut expression if available.
protected void | onSetExpression(String expression) Called when a new pointcut expression is set.
void | setExpression(String expression)
void | setLocation(String location) Set the location for debugging.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.aop.Pointcut
getClassFilter, getMethodMatcher

Constructor Detail

AbstractExpressionPointcut

public AbstractExpressionPointcut()
Method Detail

setLocation

public void setLocation(String location)
Set the location for debugging.

getLocation

public String getLocation()
Return location information about the pointcut expression if available. This is useful in debugging.

Returns:
location information as a human-readable String, or null if none is available

setExpression

public void setExpression(String expression)

onSetExpression

protected void onSetExpression(String expression)
                        throws IllegalArgumentException
Called when a new pointcut expression is set. The expression should be parsed at this point if possible.

This implementation is empty.

Parameters:
expression - expression to set
Throws:
IllegalArgumentException - if the expression is invalid
See Also:
setExpression(java.lang.String)

getExpression

public String getExpression()
Return this pointcut's expression.

Specified by:
getExpression in interface ExpressionPointcut
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractGenericPointcutAdvisor

org.springframework.aop.support
Class AbstractGenericPointcutAdvisor

java.lang.Object
    extended by  org.springframework.aop.support.AbstractPointcutAdvisor
        extended by  org.springframework.aop.support.AbstractGenericPointcutAdvisor
All Implemented Interfaces:
Serializable, Advisor, PointcutAdvisor, Ordered
Direct Known Subclasses:
AspectJExpressionPointcutAdvisor, DefaultPointcutAdvisor, NameMatchMethodPointcutAdvisor, RegexpMethodPointcutAdvisor
public abstract class AbstractGenericPointcutAdvisor
extends AbstractPointcutAdvisor

Abstract generic PointcutAdvisor that allows for any Advice to be configured.

Since:
2.0
Author:
Juergen Hoeller
See Also:
setAdvice(org.aopalliance.aop.Advice), DefaultPointcutAdvisor, Serialized Form

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AbstractGenericPointcutAdvisor()
Method Summary
Advice | getAdvice() Return the advice part of this aspect.
void | setAdvice(Advice advice) Specify the advice that this advisor should apply.
String | toString()
Methods inherited from class org.springframework.aop.support.AbstractPointcutAdvisor
equals, getOrder, hashCode, isPerInstance, setOrder
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.aop.PointcutAdvisor
getPointcut

Constructor Detail

AbstractGenericPointcutAdvisor

public AbstractGenericPointcutAdvisor()
Method Detail

setAdvice

public void setAdvice(Advice advice)
Specify the advice that this advisor should apply.

getAdvice

public Advice getAdvice()
Description copied from interface: Advisor
Return the advice part of this aspect. An advice may be an interceptor, a before advice, a throws advice, etc.

Returns:
the advice that should apply if the pointcut matches
See Also:
MethodInterceptor, BeforeAdvice, ThrowsAdvice, AfterReturningAdvice

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractPointcutAdvisor

org.springframework.aop.support
Class AbstractPointcutAdvisor

java.lang.Object
    extended by  org.springframework.aop.support.AbstractPointcutAdvisor
All Implemented Interfaces:
Serializable, Advisor, PointcutAdvisor, Ordered
Direct Known Subclasses:
AbstractBeanFactoryPointcutAdvisor, AbstractGenericPointcutAdvisor, AsyncAnnotationAdvisor, PersistenceExceptionTranslationAdvisor, TransactionAttributeSourceAdvisor
public abstract class AbstractPointcutAdvisor
extends Object
implements PointcutAdvisor, Ordered, Serializable

Abstract base class for PointcutAdvisor implementations. Can be subclassed for returning a specific pointcut/advice or a freely configurable pointcut/advice.

Since:
1.1.2
Author:
Rod Johnson, Juergen Hoeller
See Also:
AbstractGenericPointcutAdvisor, Serialized Form

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AbstractPointcutAdvisor()
Method Summary
boolean | equals(Object other)
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
int | hashCode()
boolean | isPerInstance() Return whether this advice is associated with a particular instance (for example, creating a mixin) or shared with all instances of the advised class obtained from the same Spring bean factory.
void | setOrder(int order)
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.aop.PointcutAdvisor
getPointcut
Methods inherited from interface org.springframework.aop.Advisor
getAdvice

Constructor Detail

AbstractPointcutAdvisor

public AbstractPointcutAdvisor()
Method Detail

setOrder

public void setOrder(int order)

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

isPerInstance

public boolean isPerInstance()
Description copied from interface: Advisor
Return whether this advice is associated with a particular instance (for example, creating a mixin) or shared with all instances of the advised class obtained from the same Spring bean factory.

Note that this method is not currently used by the framework. Typical Advisor implementations always return true. Use singleton/prototype bean definitions or appropriate programmatic proxy creation to ensure that Advisors have the correct lifecycle model.

Specified by:
isPerInstance in interface Advisor
Returns:
whether this advice is associated with a particular target instance

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractRegexpMethodPointcut

org.springframework.aop.support
Class AbstractRegexpMethodPointcut

java.lang.Object
    extended by  org.springframework.aop.support.StaticMethodMatcher
        extended by  org.springframework.aop.support.StaticMethodMatcherPointcut
            extended by  org.springframework.aop.support.AbstractRegexpMethodPointcut
All Implemented Interfaces:
Serializable, MethodMatcher, Pointcut
Direct Known Subclasses:
JdkRegexpMethodPointcut
public abstract class AbstractRegexpMethodPointcut
extends StaticMethodMatcherPointcut
implements Serializable

Abstract base regular expression pointcut bean. JavaBean properties are:

  • pattern: regular expression for the fully-qualified method names to match. The exact regexp syntax will depend on the subclass (e.g. Perl5 regular expressions)
  • patterns: alternative property taking a String array of patterns. The result will be the union of these patterns.

Note: the regular expressions must be a match. For example, .*get.* will match com.mycom.Foo.getBar(). get.* will not.

This base class is serializable. Subclasses should declare all fields transient - the initPatternRepresentation method in this class will be invoked again on the client side on deserialization.

Since:
1.1
Author:
Rod Johnson, Juergen Hoeller, Rob Harrop
See Also:
JdkRegexpMethodPointcut, Serialized Form

Field Summary
Fields inherited from interface org.springframework.aop.Pointcut
TRUE
Fields inherited from interface org.springframework.aop.MethodMatcher
TRUE
Constructor Summary
AbstractRegexpMethodPointcut()
Method Summary
boolean | equals(Object other)
String[] | getExcludedPatterns() Returns the regular expressions for exclusion matching.
String[] | getPatterns() Return the regular expressions for method matching.
int | hashCode()
protected abstract void | initExcludedPatternRepresentation(String[] patterns) Subclasses must implement this to initialize regexp pointcuts.
protected abstract void | initPatternRepresentation(String[] patterns) Subclasses must implement this to initialize regexp pointcuts.
boolean | matches(Method method, Class targetClass) Try to match the regular expression against the fully qualified name of the target class as well as against the method's declaring class, plus the name of the method.
protected abstract boolean | matches(String pattern, int patternIndex) Does the pattern at the given index match this string?
protected abstract boolean | matchesExclusion(String pattern, int patternIndex) Does the exclusion pattern at the given index match this string?
protected boolean | matchesPattern(String signatureString) Match the specified candidate against the configured patterns.
void | setExcludedPattern(String excludedPattern) Convenience method when we have only a single exclusion pattern.
void | setExcludedPatterns(String[] excludedPatterns) Set the regular expressions defining methods to match for exclusion.
void | setPattern(String pattern) Convenience method when we have only a single pattern.
void | setPatterns(String[] patterns) Set the regular expressions defining methods to match.
String | toString()
Methods inherited from class org.springframework.aop.support.StaticMethodMatcherPointcut
getClassFilter, getMethodMatcher, setClassFilter
Methods inherited from class org.springframework.aop.support.StaticMethodMatcher
isRuntime, matches
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

AbstractRegexpMethodPointcut

public AbstractRegexpMethodPointcut()
Method Detail

setPattern

public void setPattern(String pattern)
Convenience method when we have only a single pattern. Use either this method or setPatterns(java.lang.String[]), not both.

See Also:
setPatterns(java.lang.String[])

setPatterns

public void setPatterns(String[] patterns)
Set the regular expressions defining methods to match. Matching will be the union of all these; if any match, the pointcut matches.

getPatterns

public String[] getPatterns()
Return the regular expressions for method matching.

setExcludedPattern

public void setExcludedPattern(String excludedPattern)
Convenience method when we have only a single exclusion pattern. Use either this method or setExcludedPatterns(java.lang.String[]), not both.

See Also:
setExcludedPatterns(java.lang.String[])

setExcludedPatterns

public void setExcludedPatterns(String[] excludedPatterns)
Set the regular expressions defining methods to match for exclusion. Matching will be the union of all these; if any match, the pointcut matches.

getExcludedPatterns

public String[] getExcludedPatterns()
Returns the regular expressions for exclusion matching.

matches

public boolean matches(Method method,
                       Class targetClass)
Try to match the regular expression against the fully qualified name of the target class as well as against the method's declaring class, plus the name of the method.

Specified by:
matches in interface MethodMatcher
Parameters:
method - the candidate method
targetClass - the target class (may be null, in which case the candidate class must be taken to be the method's declaring class)
Returns:
whether or not this method matches statically

matchesPattern

protected boolean matchesPattern(String signatureString)
Match the specified candidate against the configured patterns.

Parameters:
signatureString - "java.lang.Object.hashCode" style signature
Returns:
whether the candidate matches at least one of the specified patterns

initPatternRepresentation

protected abstract void initPatternRepresentation(String[] patterns)
                                           throws IllegalArgumentException
Subclasses must implement this to initialize regexp pointcuts. Can be invoked multiple times.

This method will be invoked from the setPatterns(java.lang.String[]) method, and also on deserialization.

Parameters:
patterns - the patterns to initialize
Throws:
IllegalArgumentException - in case of an invalid pattern

initExcludedPatternRepresentation

protected abstract void initExcludedPatternRepresentation(String[] patterns)
                                                   throws IllegalArgumentException
Subclasses must implement this to initialize regexp pointcuts. Can be invoked multiple times.

This method will be invoked from the setExcludedPatterns(java.lang.String[]) method, and also on deserialization.

Parameters:
patterns - the patterns to initialize
Throws:
IllegalArgumentException - in case of an invalid pattern

matches

protected abstract boolean matches(String pattern,
                                   int patternIndex)
Does the pattern at the given index match this string?

Parameters:
pattern - String pattern to match
patternIndex - index of pattern from 0
Returns:
true if there is a match, else false.

matchesExclusion

protected abstract boolean matchesExclusion(String pattern,
                                            int patternIndex)
Does the exclusion pattern at the given index match this string?

Parameters:
pattern - String pattern to match.
patternIndex - index of pattern starting from 0.
Returns:
true if there is a match, else false.

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AopUtils

org.springframework.aop.support
Class AopUtils

java.lang.Object
    extended by  org.springframework.aop.support.AopUtils

public abstract class AopUtils
extends Object

Utility methods for AOP support code. Mainly for internal use within Spring's AOP support.

See AopProxyUtils for a collection of framework-specific AOP utility methods which depend on internals of Spring's AOP framework implementation.

Author:
Rod Johnson, Juergen Hoeller, Rob Harrop
See Also:
AopProxyUtils

Constructor Summary
AopUtils()
Method Summary
static boolean | canApply(Advisor advisor, Class<?> targetClass) Can the given advisor apply at all on the given class? This is an important test as it can be used to optimize out a advisor for a class.
static boolean | canApply(Advisor advisor, Class<?> targetClass, boolean hasIntroductions) Can the given advisor apply at all on the given class?
static boolean | canApply(Pointcut pc, Class<?> targetClass) Can the given pointcut apply at all on the given class?
static boolean | canApply(Pointcut pc, Class<?> targetClass, boolean hasIntroductions) Can the given pointcut apply at all on the given class?
static List<Advisor> | findAdvisorsThatCanApply(List<Advisor> candidateAdvisors, Class<?> clazz) Determine the sublist of the candidateAdvisors list that is applicable to the given class.
static Method | getMostSpecificMethod(Method method, Class<?> targetClass) Given a method, which may come from an interface, and a target class used in the current AOP invocation, find the corresponding target method if there is one.
static Class<?> | getTargetClass(Object candidate) Determine the target class of the given bean instance, which might be an AOP proxy.
static Object | invokeJoinpointUsingReflection(Object target, Method method, Object[] args) Invoke the given target via reflection, as part of an AOP method invocation.
static boolean | isAopProxy(Object object) Check whether the given object is a JDK dynamic proxy or a CGLIB proxy.
static boolean | isCglibProxy(Object object) Check whether the given object is a CGLIB proxy.
static boolean | isCglibProxyClass(Class<?> clazz) Check whether the specified class is a CGLIB-generated class.
static boolean | isCglibProxyClassName(String className) Check whether the specified class name is a CGLIB-generated class.
static boolean | isEqualsMethod(Method method) Determine whether the given method is an "equals" method.
static boolean | isFinalizeMethod(Method method) Determine whether the given method is a "finalize" method.
static boolean | isHashCodeMethod(Method method) Determine whether the given method is a "hashCode" method.
static boolean | isJdkDynamicProxy(Object object) Check whether the given object is a JDK dynamic proxy.
static boolean | isToStringMethod(Method method) Determine whether the given method is a "toString" method.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AopUtils

public AopUtils()
Method Detail

isAopProxy

public static boolean isAopProxy(Object object)
Check whether the given object is a JDK dynamic proxy or a CGLIB proxy.

Parameters:
object - the object to check
See Also:
isJdkDynamicProxy(java.lang.Object), isCglibProxy(java.lang.Object)

isJdkDynamicProxy

public static boolean isJdkDynamicProxy(Object object)
Check whether the given object is a JDK dynamic proxy.

Parameters:
object - the object to check
See Also:
Proxy.isProxyClass(java.lang.Class)

isCglibProxy

public static boolean isCglibProxy(Object object)
Check whether the given object is a CGLIB proxy.

Parameters:
object - the object to check

isCglibProxyClass

public static boolean isCglibProxyClass(Class<?> clazz)
Check whether the specified class is a CGLIB-generated class.

Parameters:
clazz - the class to check

isCglibProxyClassName

public static boolean isCglibProxyClassName(String className)
Check whether the specified class name is a CGLIB-generated class.

Parameters:
className - the class name to check

getTargetClass

public static Class<?> getTargetClass(Object candidate)
Determine the target class of the given bean instance, which might be an AOP proxy.

Returns the target class for an AOP proxy and the plain class else.

Parameters:
candidate - the instance to check (might be an AOP proxy)
Returns:
the target class (or the plain class of the given object as fallback; never null)
See Also:
TargetClassAware.getTargetClass()

isEqualsMethod

public static boolean isEqualsMethod(Method method)
Determine whether the given method is an "equals" method.

See Also:
Object.equals(java.lang.Object)

isHashCodeMethod

public static boolean isHashCodeMethod(Method method)
Determine whether the given method is a "hashCode" method.

See Also:
Object.hashCode()

isToStringMethod

public static boolean isToStringMethod(Method method)
Determine whether the given method is a "toString" method.

See Also:
Object.toString()

isFinalizeMethod

public static boolean isFinalizeMethod(Method method)
Determine whether the given method is a "finalize" method.

See Also:
Object.finalize()

getMostSpecificMethod

public static Method getMostSpecificMethod(Method method,
                                           Class<?> targetClass)
Given a method, which may come from an interface, and a target class used in the current AOP invocation, find the corresponding target method if there is one. E.g. the method may be IFoo.bar() and the target class may be DefaultFoo. In this case, the method may be DefaultFoo.bar(). This enables attributes on that method to be found.

NOTE: In contrast to ClassUtils.getMostSpecificMethod(java.lang.reflect.Method, java.lang.Class), this method resolves Java 5 bridge methods in order to retrieve attributes from the original method definition.

Parameters:
method - the method to be invoked, which may come from an interface
targetClass - the target class for the current invocation. May be null or may not even implement the method.
Returns:
the specific target method, or the original method if the targetClass doesn't implement it or is null
See Also:
ClassUtils.getMostSpecificMethod(java.lang.reflect.Method, java.lang.Class)

canApply

public static boolean canApply(Pointcut pc,
                               Class<?> targetClass)
Can the given pointcut apply at all on the given class?

This is an important test as it can be used to optimize out a pointcut for a class.

Parameters:
pc - the static or dynamic pointcut to check
targetClass - the class to test
Returns:
whether the pointcut can apply on any method

canApply

public static boolean canApply(Pointcut pc,
                               Class<?> targetClass,
                               boolean hasIntroductions)
Can the given pointcut apply at all on the given class?

This is an important test as it can be used to optimize out a pointcut for a class.

Parameters:
pc - the static or dynamic pointcut to check
targetClass - the class to test
hasIntroductions - whether or not the advisor chain for this bean includes any introductions
Returns:
whether the pointcut can apply on any method

canApply

public static boolean canApply(Advisor advisor,
                               Class<?> targetClass)
Can the given advisor apply at all on the given class? This is an important test as it can be used to optimize out a advisor for a class.

Parameters:
advisor - the advisor to check
targetClass - class we're testing
Returns:
whether the pointcut can apply on any method

canApply

public static boolean canApply(Advisor advisor,
                               Class<?> targetClass,
                               boolean hasIntroductions)
Can the given advisor apply at all on the given class?

This is an important test as it can be used to optimize out a advisor for a class. This version also takes into account introductions (for IntroductionAwareMethodMatchers).

Parameters:
advisor - the advisor to check
targetClass - class we're testing
hasIntroductions - whether or not the advisor chain for this bean includes any introductions
Returns:
whether the pointcut can apply on any method

findAdvisorsThatCanApply

public static List<Advisor> findAdvisorsThatCanApply(List<Advisor> candidateAdvisors,
                                                     Class<?> clazz)
Determine the sublist of the candidateAdvisors list that is applicable to the given class.

Parameters:
candidateAdvisors - the Advisors to evaluate
clazz - the target class
Returns:
sublist of Advisors that can apply to an object of the given class (may be the incoming List as-is)

invokeJoinpointUsingReflection

public static Object invokeJoinpointUsingReflection(Object target,
                                                    Method method,
                                                    Object[] args)
                                             throws Throwable
Invoke the given target via reflection, as part of an AOP method invocation.

Parameters:
target - the target object
method - the method to invoke
args - the arguments for the method
Returns:
the invocation result, if any
Throws:
Throwable - if thrown by the target method
AopInvocationException - in case of a reflection error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ClassFilters

org.springframework.aop.support
Class ClassFilters

java.lang.Object
    extended by  org.springframework.aop.support.ClassFilters

public abstract class ClassFilters
extends Object

Static utility methods for composing ClassFilters.

Since:
11.11.2003
Author:
Rod Johnson, Rob Harrop, Juergen Hoeller
See Also:
MethodMatchers, Pointcuts

Constructor Summary
ClassFilters()
Method Summary
static ClassFilter | intersection(ClassFilter[] classFilters) Match all classes that all of the given ClassFilters match.
static ClassFilter | intersection(ClassFilter cf1, ClassFilter cf2) Match all classes that both of the given ClassFilters match.
static ClassFilter | union(ClassFilter[] classFilters) Match all classes that either (or all) of the given ClassFilters matches.
static ClassFilter | union(ClassFilter cf1, ClassFilter cf2) Match all classes that either (or both) of the given ClassFilters matches.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ClassFilters

public ClassFilters()
Method Detail

union

public static ClassFilter union(ClassFilter cf1,
                                ClassFilter cf2)
Match all classes that either (or both) of the given ClassFilters matches.

Parameters:
cf1 - the first ClassFilter
cf2 - the second ClassFilter
Returns:
a distinct ClassFilter that matches all classes that either of the given ClassFilter matches

union

public static ClassFilter union(ClassFilter[] classFilters)
Match all classes that either (or all) of the given ClassFilters matches.

Parameters:
classFilters - the ClassFilters to match
Returns:
a distinct ClassFilter that matches all classes that either of the given ClassFilter matches

intersection

public static ClassFilter intersection(ClassFilter cf1,
                                       ClassFilter cf2)
Match all classes that both of the given ClassFilters match.

Parameters:
cf1 - the first ClassFilter
cf2 - the second ClassFilter
Returns:
a distinct ClassFilter that matches all classes that both of the given ClassFilter match

intersection

public static ClassFilter intersection(ClassFilter[] classFilters)
Match all classes that all of the given ClassFilters match.

Parameters:
classFilters - the ClassFilters to match
Returns:
a distinct ClassFilter that matches all classes that both of the given ClassFilter match
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ComposablePointcut

org.springframework.aop.support
Class ComposablePointcut

java.lang.Object
    extended by  org.springframework.aop.support.ComposablePointcut
All Implemented Interfaces:
Serializable, Pointcut
public class ComposablePointcut
extends Object
implements Pointcut, Serializable

Convenient class for building up pointcuts. All methods return ComposablePointcut, so we can use a concise idiom like: Pointcut pc = new ComposablePointcut().union(classFilter).intersection(methodMatcher).intersection(pointcut);

Since:
11.11.2003
Author:
Rod Johnson, Juergen Hoeller, Rob Harrop
See Also:
Pointcuts, Serialized Form

Field Summary
Fields inherited from interface org.springframework.aop.Pointcut
TRUE
Constructor Summary
ComposablePointcut()
Create a default ComposablePointcut, with ClassFilter.TRUE and MethodMatcher.TRUE.
ComposablePointcut(ClassFilter classFilter)
Create a ComposablePointcut for the given ClassFilter, with MethodMatcher.TRUE.
ComposablePointcut(ClassFilter classFilter, MethodMatcher methodMatcher)
Create a ComposablePointcut for the given ClassFilter and MethodMatcher.
ComposablePointcut(MethodMatcher methodMatcher)
Create a ComposablePointcut for the given MethodMatcher, with ClassFilter.TRUE.
ComposablePointcut(Pointcut pointcut)
Create a ComposablePointcut based on the given Pointcut.
Method Summary
boolean | equals(Object other)
ClassFilter | getClassFilter() Return the ClassFilter for this pointcut.
MethodMatcher | getMethodMatcher() Return the MethodMatcher for this pointcut.
int | hashCode()
ComposablePointcut | intersection(ClassFilter other) Apply an intersection with the given ClassFilter.
ComposablePointcut | intersection(MethodMatcher other) Apply an intersection with the given MethodMatcher.
ComposablePointcut | intersection(Pointcut other) Apply an intersection with the given Pointcut.
String | toString()
ComposablePointcut | union(ClassFilter other) Apply a union with the given ClassFilter.
ComposablePointcut | union(MethodMatcher other) Apply a union with the given MethodMatcher.
ComposablePointcut | union(Pointcut other) Apply a union with the given Pointcut.
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

ComposablePointcut

public ComposablePointcut()
Create a default ComposablePointcut, with ClassFilter.TRUE and MethodMatcher.TRUE.

ComposablePointcut

public ComposablePointcut(Pointcut pointcut)
Create a ComposablePointcut based on the given Pointcut.

Parameters:
pointcut - the original Pointcut

ComposablePointcut

public ComposablePointcut(ClassFilter classFilter)
Create a ComposablePointcut for the given ClassFilter, with MethodMatcher.TRUE.

Parameters:
classFilter - the ClassFilter to use

ComposablePointcut

public ComposablePointcut(MethodMatcher methodMatcher)
Create a ComposablePointcut for the given MethodMatcher, with ClassFilter.TRUE.

Parameters:
methodMatcher - the MethodMatcher to use

ComposablePointcut

public ComposablePointcut(ClassFilter classFilter,
                          MethodMatcher methodMatcher)
Create a ComposablePointcut for the given ClassFilter and MethodMatcher.

Parameters:
classFilter - the ClassFilter to use
methodMatcher - the MethodMatcher to use
Method Detail

union

public ComposablePointcut union(ClassFilter other)
Apply a union with the given ClassFilter.

Parameters:
other - the ClassFilter to apply a union with
Returns:
this composable pointcut (for call chaining)

intersection

public ComposablePointcut intersection(ClassFilter other)
Apply an intersection with the given ClassFilter.

Parameters:
other - the ClassFilter to apply an intersection with
Returns:
this composable pointcut (for call chaining)

union

public ComposablePointcut union(MethodMatcher other)
Apply a union with the given MethodMatcher.

Parameters:
other - the MethodMatcher to apply a union with
Returns:
this composable pointcut (for call chaining)

intersection

public ComposablePointcut intersection(MethodMatcher other)
Apply an intersection with the given MethodMatcher.

Parameters:
other - the MethodMatcher to apply an intersection with
Returns:
this composable pointcut (for call chaining)

union

public ComposablePointcut union(Pointcut other)
Apply a union with the given Pointcut.

Note that for a Pointcut union, methods will only match if their original ClassFilter (from the originating Pointcut) matches as well. MethodMatchers and ClassFilters from different Pointcuts will never get interleaved with each other.

Parameters:
other - the Pointcut to apply a union with
Returns:
this composable pointcut (for call chaining)

intersection

public ComposablePointcut intersection(Pointcut other)
Apply an intersection with the given Pointcut.

Parameters:
other - the Pointcut to apply an intersection with
Returns:
this composable pointcut (for call chaining)

getClassFilter

public ClassFilter getClassFilter()
Description copied from interface: Pointcut
Return the ClassFilter for this pointcut.

Specified by:
getClassFilter in interface Pointcut
Returns:
the ClassFilter (never null)

getMethodMatcher

public MethodMatcher getMethodMatcher()
Description copied from interface: Pointcut
Return the MethodMatcher for this pointcut.

Specified by:
getMethodMatcher in interface Pointcut
Returns:
the MethodMatcher (never null)

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ControlFlowPointcut

org.springframework.aop.support
Class ControlFlowPointcut

java.lang.Object
    extended by  org.springframework.aop.support.ControlFlowPointcut
All Implemented Interfaces:
Serializable, ClassFilter, MethodMatcher, Pointcut
public class ControlFlowPointcut
extends Object
implements Pointcut, ClassFilter, MethodMatcher, Serializable

Pointcut and method matcher for use in simple cflow-style pointcut. Note that evaluating such pointcuts is 10-15 times slower than evaluating normal pointcuts, but they are useful in some cases.

Author:
Rod Johnson, Rob Harrop
See Also:
ControlFlow, Serialized Form

Field Summary
Fields inherited from interface org.springframework.aop.Pointcut
TRUE
Fields inherited from interface org.springframework.aop.ClassFilter
TRUE
Fields inherited from interface org.springframework.aop.MethodMatcher
TRUE
Constructor Summary
ControlFlowPointcut(Class clazz)
Construct a new pointcut that matches all control flows below that class.
ControlFlowPointcut(Class clazz, String methodName)
Construct a new pointcut that matches all calls below the given method in the given class.
Method Summary
 boolean equals(Object other)
 ClassFilter getClassFilter()
Return the ClassFilter for this pointcut.
 int getEvaluations()
It's useful to know how many times we've fired, for optimization.
 MethodMatcher getMethodMatcher()
Return the MethodMatcher for this pointcut.
 int hashCode()
 boolean isRuntime()
Is this MethodMatcher dynamic, that is, must a final call be made on the MethodMatcher.matches(java.lang.reflect.Method, Class, Object[]) method at runtime even if the 2-arg matches method returns true?
 boolean matches(Class clazz)
Subclasses can override this for greater filtering (and performance).
 boolean matches(Method method, Class targetClass)
Subclasses can override this if it's possible to filter out some candidate classes.
 boolean matches(Method method, Class targetClass, Object[] args)
Check whether there a runtime (dynamic) match for this method, which must have matched statically.
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ControlFlowPointcut

public ControlFlowPointcut(Class clazz)
Construct a new pointcut that matches all control flows below that class.

Parameters:
clazz - the clazz

ControlFlowPointcut

public ControlFlowPointcut(Class clazz,
                           String methodName)
Construct a new pointcut that matches all calls below the given method in the given class. If the method name is null, matches all control flows below that class.

Parameters:
clazz - the clazz
methodName - the name of the method
Method Detail

matches

public boolean matches(Class clazz)
Subclasses can override this for greater filtering (and performance).

Specified by:
matches in interface ClassFilter
Parameters:
clazz - the candidate target class
Returns:
whether the advice should apply to the given target class

matches

public boolean matches(Method method,
                       Class targetClass)
Subclasses can override this if it's possible to filter out some candidate classes.

Specified by:
matches in interface MethodMatcher
Parameters:
method - the candidate method
targetClass - the target class (may be null, in which case the candidate class must be taken to be the method's declaring class)
Returns:
whether or not this method matches statically

isRuntime

public boolean isRuntime()
Description copied from interface: MethodMatcher
Is this MethodMatcher dynamic, that is, must a final call be made on the MethodMatcher.matches(java.lang.reflect.Method, Class, Object[]) method at runtime even if the 2-arg matches method returns true?

Can be invoked when an AOP proxy is created, and need not be invoked again before each method invocation,

Specified by:
isRuntime in interface MethodMatcher
Returns:
whether or not a runtime match via the 3-arg MethodMatcher.matches(java.lang.reflect.Method, Class, Object[]) method is required if static matching passed

matches

public boolean matches(Method method,
                       Class targetClass,
                       Object[] args)
Description copied from interface: MethodMatcher
Check whether there a runtime (dynamic) match for this method, which must have matched statically.

This method is invoked only if the 2-arg matches method returns true for the given method and target class, and if the MethodMatcher.isRuntime() method returns true. Invoked immediately before potential running of the advice, after any advice earlier in the advice chain has run.

Specified by:
matches in interface MethodMatcher
Parameters:
method - the candidate method
targetClass - the target class (may be null, in which case the candidate class must be taken to be the method's declaring class)
args - arguments to the method
Returns:
whether there's a runtime match
See Also:
MethodMatcher.matches(Method, Class)

getEvaluations

public int getEvaluations()
It's useful to know how many times we've fired, for optimization.

getClassFilter

public ClassFilter getClassFilter()
Description copied from interface: Pointcut
Return the ClassFilter for this pointcut.

Specified by:
getClassFilter in interface Pointcut
Returns:
the ClassFilter (never null)

getMethodMatcher

public MethodMatcher getMethodMatcher()
Description copied from interface: Pointcut
Return the MethodMatcher for this pointcut.

Specified by:
getMethodMatcher in interface Pointcut
Returns:
the MethodMatcher (never null)

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultBeanFactoryPointcutAdvisor

org.springframework.aop.support
Class DefaultBeanFactoryPointcutAdvisor

java.lang.Object
    extended by  org.springframework.aop.support.AbstractPointcutAdvisor
        extended by  org.springframework.aop.support.AbstractBeanFactoryPointcutAdvisor
            extended by  org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor
All Implemented Interfaces:
Serializable, Advisor, PointcutAdvisor, BeanFactoryAware, Ordered
public class DefaultBeanFactoryPointcutAdvisor
extends AbstractBeanFactoryPointcutAdvisor

Concrete BeanFactory-based PointcutAdvisor that allows for any Advice to be configured as reference to an Advice bean in the BeanFactory, as well as the Pointcut to be configured through a bean property.

Specifying the name of an advice bean instead of the advice object itself (if running within a BeanFactory) increases loose coupling at initialization time, in order to not initialize the advice object until the pointcut actually matches.

Since:
2.0.2
Author:
Juergen Hoeller
See Also:
setPointcut(org.springframework.aop.Pointcut), AbstractBeanFactoryPointcutAdvisor.setAdviceBeanName(java.lang.String), Serialized Form

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
DefaultBeanFactoryPointcutAdvisor()
Method Summary
Pointcut | getPointcut() Get the Pointcut that drives this advisor.
void | setPointcut(Pointcut pointcut) Specify the pointcut targeting the advice.
String | toString()
Methods inherited from class org.springframework.aop.support.AbstractBeanFactoryPointcutAdvisor
getAdvice, getAdviceBeanName, setAdviceBeanName, setBeanFactory
Methods inherited from class org.springframework.aop.support.AbstractPointcutAdvisor
equals, getOrder, hashCode, isPerInstance, setOrder
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

DefaultBeanFactoryPointcutAdvisor

public DefaultBeanFactoryPointcutAdvisor()
Method Detail

setPointcut

public void setPointcut(Pointcut pointcut)
Specify the pointcut targeting the advice.

Default is Pointcut.TRUE.

See Also:
AbstractBeanFactoryPointcutAdvisor.setAdviceBeanName(java.lang.String)

getPointcut

public Pointcut getPointcut()
Description copied from interface: PointcutAdvisor
Get the Pointcut that drives this advisor.

toString

public String toString()
Overrides:
toString in class AbstractBeanFactoryPointcutAdvisor
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultIntroductionAdvisor

org.springframework.aop.support
Class DefaultIntroductionAdvisor

java.lang.Object
    extended by  org.springframework.aop.support.DefaultIntroductionAdvisor
All Implemented Interfaces:
Serializable, Advisor, ClassFilter, IntroductionAdvisor, IntroductionInfo, Ordered
public class DefaultIntroductionAdvisor
extends Object
implements IntroductionAdvisor, ClassFilter, Ordered, Serializable

Simple IntroductionAdvisor implementation that by default applies to any class.

Since:
11.11.2003
Author:
Rod Johnson, Juergen Hoeller
See Also:
Serialized Form

Field Summary
Fields inherited from interface org.springframework.aop.ClassFilter
TRUE
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
DefaultIntroductionAdvisor(Advice advice)
Create a DefaultIntroductionAdvisor for the given advice.
DefaultIntroductionAdvisor(Advice advice, IntroductionInfo introductionInfo)
Create a DefaultIntroductionAdvisor for the given advice.
DefaultIntroductionAdvisor(DynamicIntroductionAdvice advice, Class intf)
Create a DefaultIntroductionAdvisor for the given advice.
Method Summary
void | addInterface(Class intf) Add the specified interface to the list of interfaces to introduce.
boolean | equals(Object other)
Advice | getAdvice() Return the advice part of this aspect.
ClassFilter | getClassFilter() Return the filter determining which target classes this introduction should apply to.
Class[] | getInterfaces() Return the additional interfaces introduced by this Advisor or Advice.
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
int | hashCode()
boolean | isPerInstance() Return whether this advice is associated with a particular instance (for example, creating a mixin) or shared with all instances of the advised class obtained from the same Spring bean factory.
boolean | matches(Class clazz) Should the pointcut apply to the given interface or target class?
void | setOrder(int order)
String | toString()
void | validateInterfaces() Can the advised interfaces be implemented by the introduction advice? Invoked before adding an IntroductionAdvisor.
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

DefaultIntroductionAdvisor

public DefaultIntroductionAdvisor(Advice advice)
Create a DefaultIntroductionAdvisor for the given advice.

Parameters:
advice - the Advice to apply (may implement the IntroductionInfo interface)
See Also:
addInterface(java.lang.Class)

DefaultIntroductionAdvisor

public DefaultIntroductionAdvisor(Advice advice,
                                  IntroductionInfo introductionInfo)
Create a DefaultIntroductionAdvisor for the given advice.

Parameters:
advice - the Advice to apply
introductionInfo - the IntroductionInfo that describes the interface to introduce (may be null)

DefaultIntroductionAdvisor

public DefaultIntroductionAdvisor(DynamicIntroductionAdvice advice,
                                  Class intf)
Create a DefaultIntroductionAdvisor for the given advice.

Parameters:
advice - the Advice to apply
intf - the interface to introduce
Method Detail

addInterface

public void addInterface(Class intf)
Add the specified interface to the list of interfaces to introduce.

Parameters:
intf - the interface to introduce

getInterfaces

public Class[] getInterfaces()
Description copied from interface: IntroductionInfo
Return the additional interfaces introduced by this Advisor or Advice.

Specified by:
getInterfaces in interface IntroductionInfo
Returns:
the introduced interfaces

validateInterfaces

public void validateInterfaces()
                        throws IllegalArgumentException
Description copied from interface: IntroductionAdvisor
Can the advised interfaces be implemented by the introduction advice? Invoked before adding an IntroductionAdvisor.

Specified by:
validateInterfaces in interface IntroductionAdvisor
Throws:
IllegalArgumentException - if the advised interfaces can't be implemented by the introduction advice

setOrder

public void setOrder(int order)

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

getAdvice

public Advice getAdvice()
Description copied from interface: Advisor
Return the advice part of this aspect. An advice may be an interceptor, a before advice, a throws advice, etc.

Specified by:
getAdvice in interface Advisor
Returns:
the advice that should apply if the pointcut matches
See Also:
MethodInterceptor, BeforeAdvice, ThrowsAdvice, AfterReturningAdvice

isPerInstance

public boolean isPerInstance()
Description copied from interface: Advisor
Return whether this advice is associated with a particular instance (for example, creating a mixin) or shared with all instances of the advised class obtained from the same Spring bean factory.

Note that this method is not currently used by the framework. Typical Advisor implementations always return true. Use singleton/prototype bean definitions or appropriate programmatic proxy creation to ensure that Advisors have the correct lifecycle model.

Specified by:
isPerInstance in interface Advisor
Returns:
whether this advice is associated with a particular target instance

getClassFilter

public ClassFilter getClassFilter()
Description copied from interface: IntroductionAdvisor
Return the filter determining which target classes this introduction should apply to.

This represents the class part of a pointcut. Note that method matching doesn't make sense to introductions.

Specified by:
getClassFilter in interface IntroductionAdvisor
Returns:
the class filter

matches

public boolean matches(Class clazz)
Description copied from interface: ClassFilter
Should the pointcut apply to the given interface or target class?

Specified by:
matches in interface ClassFilter
Parameters:
clazz - the candidate target class
Returns:
whether the advice should apply to the given target class

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultPointcutAdvisor

org.springframework.aop.support
Class DefaultPointcutAdvisor

java.lang.Object
    extended by  org.springframework.aop.support.AbstractPointcutAdvisor
        extended by  org.springframework.aop.support.AbstractGenericPointcutAdvisor
            extended by  org.springframework.aop.support.DefaultPointcutAdvisor
All Implemented Interfaces:
Serializable, Advisor, PointcutAdvisor, Ordered
Direct Known Subclasses:
ReflectiveAspectJAdvisorFactory.SyntheticInstantiationAdvisor
public class DefaultPointcutAdvisor
extends AbstractGenericPointcutAdvisor
implements Serializable

Convenient Pointcut-driven Advisor implementation.

This is the most commonly used Advisor implementation. It can be used with any pointcut and advice type, except for introductions. There is normally no need to subclass this class, or to implement custom Advisors.

Author:
Rod Johnson, Juergen Hoeller
See Also:
setPointcut(org.springframework.aop.Pointcut), AbstractGenericPointcutAdvisor.setAdvice(org.aopalliance.aop.Advice), Serialized Form

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
DefaultPointcutAdvisor()
Create an empty DefaultPointcutAdvisor.
DefaultPointcutAdvisor(Advice advice)
Create a DefaultPointcutAdvisor that matches all methods.
DefaultPointcutAdvisor(Pointcut pointcut, Advice advice)
Create a DefaultPointcutAdvisor, specifying Pointcut and Advice.
Method Summary
Pointcut | getPointcut() Get the Pointcut that drives this advisor.
void | setPointcut(Pointcut pointcut) Specify the pointcut targeting the advice.
String | toString()
Methods inherited from class org.springframework.aop.support.AbstractGenericPointcutAdvisor
getAdvice, setAdvice
Methods inherited from class org.springframework.aop.support.AbstractPointcutAdvisor
equals, getOrder, hashCode, isPerInstance, setOrder
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

DefaultPointcutAdvisor

public DefaultPointcutAdvisor()
Create an empty DefaultPointcutAdvisor.

Advice must be set before use using setter methods. Pointcut will normally be set also, but defaults to Pointcut.TRUE.

DefaultPointcutAdvisor

public DefaultPointcutAdvisor(Advice advice)
Create a DefaultPointcutAdvisor that matches all methods.

Pointcut.TRUE will be used as Pointcut.

Parameters:
advice - the Advice to use

DefaultPointcutAdvisor

public DefaultPointcutAdvisor(Pointcut pointcut,
                              Advice advice)
Create a DefaultPointcutAdvisor, specifying Pointcut and Advice.

Parameters:
pointcut - the Pointcut targeting the Advice
advice - the Advice to run when Pointcut matches
Method Detail

setPointcut

public void setPointcut(Pointcut pointcut)
Specify the pointcut targeting the advice.

Default is Pointcut.TRUE.

See Also:
AbstractGenericPointcutAdvisor.setAdvice(org.aopalliance.aop.Advice)

getPointcut

public Pointcut getPointcut()
Description copied from interface: PointcutAdvisor
Get the Pointcut that drives this advisor.

Specified by:
getPointcut in interface PointcutAdvisor

toString

public String toString()
Overrides:
toString in class AbstractGenericPointcutAdvisor
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DelegatePerTargetObjectIntroductionInterceptor

org.springframework.aop.support
Class DelegatePerTargetObjectIntroductionInterceptor

java.lang.Object
    extended by  org.springframework.aop.support.IntroductionInfoSupport
        extended by  org.springframework.aop.support.DelegatePerTargetObjectIntroductionInterceptor
All Implemented Interfaces:
Serializable, Advice, Interceptor, MethodInterceptor, DynamicIntroductionAdvice, IntroductionInfo, IntroductionInterceptor
public class DelegatePerTargetObjectIntroductionInterceptor
extends IntroductionInfoSupport
implements IntroductionInterceptor

Convenient implementation of the IntroductionInterceptor interface.

This differs from DelegatingIntroductionInterceptor in that a single instance of this class can be used to advise multiple target objects, and each target object will have its own delegate (whereas DelegatingIntroductionInterceptor shares the same delegate, and hence the same state across all targets).

The suppressInterface method can be used to suppress interfaces implemented by the delegate class but which should not be introduced to the owning AOP proxy.

An instance of this class is serializable if the delegates are.

Note: There are some implementation similarities between this class and DelegatingIntroductionInterceptor that suggest a possible refactoring to extract a common ancestor class in the future.

Since:
2.0
Author:
Adrian Colyer, Juergen Hoeller
See Also:
IntroductionInfoSupport.suppressInterface(java.lang.Class), DelegatingIntroductionInterceptor, Serialized Form

Field Summary
Fields inherited from class org.springframework.aop.support.IntroductionInfoSupport
publishedInterfaces
Constructor Summary
DelegatePerTargetObjectIntroductionInterceptor(Class defaultImplType, Class interfaceType)
Method Summary
protected Object | doProceed(MethodInvocation mi) Proceed with the supplied MethodInterceptor.
Object | invoke(MethodInvocation mi) Subclasses may need to override this if they want to perform custom behaviour in around advice.
Methods inherited from class org.springframework.aop.support.IntroductionInfoSupport
getInterfaces, implementInterfacesOnObject, implementsInterface, isMethodOnIntroducedInterface, suppressInterface
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.aop.DynamicIntroductionAdvice
implementsInterface

Constructor Detail

DelegatePerTargetObjectIntroductionInterceptor

public DelegatePerTargetObjectIntroductionInterceptor(Class defaultImplType,
                                                      Class interfaceType)
Method Detail

invoke

public Object invoke(MethodInvocation mi)
              throws Throwable
Subclasses may need to override this if they want to perform custom behaviour in around advice. However, subclasses should invoke this method, which handles introduced interfaces and forwarding to the target.

Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable

doProceed

protected Object doProceed(MethodInvocation mi)
                    throws Throwable
Proceed with the supplied MethodInterceptor. Subclasses can override this method to intercept method invocations on the target object which is useful when an introduction needs to monitor the object that it is introduced into. This method is never called for MethodInvocations on the introduced interfaces.

Throws:
Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DelegatingIntroductionInterceptor

org.springframework.aop.support
Class DelegatingIntroductionInterceptor

java.lang.Object
    extended by  org.springframework.aop.support.IntroductionInfoSupport
        extended by  org.springframework.aop.support.DelegatingIntroductionInterceptor
All Implemented Interfaces:
Serializable, Advice, Interceptor, MethodInterceptor, DynamicIntroductionAdvice, IntroductionInfo, IntroductionInterceptor
public class DelegatingIntroductionInterceptor
extends IntroductionInfoSupport
implements IntroductionInterceptor

Convenient implementation of the IntroductionInterceptor interface.

Subclasses merely need to extend this class and implement the interfaces to be introduced themselves. In this case the delegate is the subclass instance itself. Alternatively a separate delegate may implement the interface, and be set via the delegate bean property.

Delegates or subclasses may implement any number of interfaces. All interfaces except IntroductionInterceptor are picked up from the subclass or delegate by default.

The suppressInterface method can be used to suppress interfaces implemented by the delegate but which should not be introduced to the owning AOP proxy.

An instance of this class is serializable if the delegate is.

Since:
16.11.2003
Author:
Rod Johnson, Juergen Hoeller
See Also:
IntroductionInfoSupport.suppressInterface(java.lang.Class), DelegatePerTargetObjectIntroductionInterceptor, Serialized Form

Field Summary
Fields inherited from class org.springframework.aop.support.IntroductionInfoSupport
publishedInterfaces
Constructor Summary
protected | DelegatingIntroductionInterceptor() Construct a new DelegatingIntroductionInterceptor.
 | DelegatingIntroductionInterceptor(Object delegate) Construct a new DelegatingIntroductionInterceptor, providing a delegate that implements the interfaces to be introduced.
Method Summary
protected Object | doProceed(MethodInvocation mi) Proceed with the supplied MethodInterceptor.
Object | invoke(MethodInvocation mi) Subclasses may need to override this if they want to perform custom behaviour in around advice.
Methods inherited from class org.springframework.aop.support.IntroductionInfoSupport
getInterfaces, implementInterfacesOnObject, implementsInterface, isMethodOnIntroducedInterface, suppressInterface
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.aop.DynamicIntroductionAdvice
implementsInterface

Constructor Detail

DelegatingIntroductionInterceptor

public DelegatingIntroductionInterceptor(Object delegate)
Construct a new DelegatingIntroductionInterceptor, providing a delegate that implements the interfaces to be introduced.

Parameters:
delegate - the delegate that implements the introduced interfaces

DelegatingIntroductionInterceptor

protected DelegatingIntroductionInterceptor()
Construct a new DelegatingIntroductionInterceptor. The delegate will be the subclass, which must implement additional interfaces.

Method Detail

invoke

public Object invoke(MethodInvocation mi)
              throws Throwable
Subclasses may need to override this if they want to perform custom behaviour in around advice. However, subclasses should invoke this method, which handles introduced interfaces and forwarding to the target.

Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable

doProceed

protected Object doProceed(MethodInvocation mi)
                    throws Throwable
Proceed with the supplied MethodInterceptor. Subclasses can override this method to intercept method invocations on the target object which is useful when an introduction needs to monitor the object that it is introduced into. This method is never called for MethodInvocations on the introduced interfaces.

Throws:
Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DynamicMethodMatcher

org.springframework.aop.support
Class DynamicMethodMatcher

java.lang.Object
    extended by  org.springframework.aop.support.DynamicMethodMatcher
All Implemented Interfaces:
MethodMatcher
Direct Known Subclasses:
DynamicMethodMatcherPointcut
public abstract class DynamicMethodMatcher
extends Object
implements MethodMatcher

Convenient abstract superclass for dynamic method matchers, which do care about arguments at runtime.

Field Summary
Fields inherited from interface org.springframework.aop.MethodMatcher
TRUE
Constructor Summary
DynamicMethodMatcher()
Method Summary
 boolean isRuntime()
Is this MethodMatcher dynamic, that is, must a final call be made on the MethodMatcher.matches(java.lang.reflect.Method, Class, Object[]) method at runtime even if the 2-arg matches method returns true?
 boolean matches(Method method, Class<?> targetClass)
Can override to add preconditions for dynamic matching.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.aop.MethodMatcher
matches

Constructor Detail

DynamicMethodMatcher

public DynamicMethodMatcher()
Method Detail

isRuntime

public final boolean isRuntime()
Description copied from interface: MethodMatcher
Is this MethodMatcher dynamic, that is, must a final call be made on the MethodMatcher.matches(java.lang.reflect.Method, Class, Object[]) method at runtime even if the 2-arg matches method returns true?

Can be invoked when an AOP proxy is created, and need not be invoked again before each method invocation,

Specified by:
isRuntime in interface MethodMatcher
Returns:
whether or not a runtime match via the 3-arg MethodMatcher.matches(java.lang.reflect.Method, Class, Object[]) method is required if static matching passed

matches

public boolean matches(Method method,
                       Class<?> targetClass)
Can override to add preconditions for dynamic matching. This implementation always returns true.

Specified by:
matches in interface MethodMatcher
Parameters:
method - the candidate method
targetClass - the target class (may be null, in which case the candidate class must be taken to be the method's declaring class)
Returns:
whether or not this method matches statically
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DynamicMethodMatcherPointcut

org.springframework.aop.support
Class DynamicMethodMatcherPointcut

java.lang.Object
    extended by  org.springframework.aop.support.DynamicMethodMatcher
        extended by  org.springframework.aop.support.DynamicMethodMatcherPointcut
All Implemented Interfaces:
MethodMatcher, Pointcut
public abstract class DynamicMethodMatcherPointcut
extends DynamicMethodMatcher
implements Pointcut

Convenient superclass when we want to force subclasses to implement MethodMatcher interface, but subclasses will want to be pointcuts. The getClassFilter() method can be overriden to customize ClassFilter behaviour as well.

Author:
Rod Johnson

Field Summary
Fields inherited from interface org.springframework.aop.Pointcut
TRUE
Fields inherited from interface org.springframework.aop.MethodMatcher
TRUE
Constructor Summary
DynamicMethodMatcherPointcut()
Method Summary
ClassFilter | getClassFilter() Return the ClassFilter for this pointcut.
MethodMatcher | getMethodMatcher() Return the MethodMatcher for this pointcut.
Methods inherited from class org.springframework.aop.support.DynamicMethodMatcher
isRuntime, matches
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.aop.MethodMatcher
matches

Constructor Detail

DynamicMethodMatcherPointcut

public DynamicMethodMatcherPointcut()
Method Detail

getClassFilter

public ClassFilter getClassFilter()
Description copied from interface: Pointcut
Return the ClassFilter for this pointcut.

Specified by:
getClassFilter in interface Pointcut
Returns:
the ClassFilter (never null)

getMethodMatcher

public final MethodMatcher getMethodMatcher()
Description copied from interface: Pointcut
Return the MethodMatcher for this pointcut.

Specified by:
getMethodMatcher in interface Pointcut
Returns:
the MethodMatcher (never null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


IntroductionInfoSupport

org.springframework.aop.support
Class IntroductionInfoSupport

java.lang.Object
    extended by  org.springframework.aop.support.IntroductionInfoSupport
All Implemented Interfaces:
Serializable, IntroductionInfo
Direct Known Subclasses:
DelegatePerTargetObjectIntroductionInterceptor, DelegatingIntroductionInterceptor
public class IntroductionInfoSupport
extends Object
implements IntroductionInfo, Serializable

Support for implementations of IntroductionInfo.

Allows subclasses to conveniently add all interfaces from a given object, and to suppress interfaces that should not be added. Also allows for querying all introduced interfaces.

Author:
Rod Johnson, Juergen Hoeller
See Also:
Serialized Form

Field Summary
protected  Set<Class> publishedInterfaces
Constructor Summary
IntroductionInfoSupport()
Method Summary
Class[] | getInterfaces() Return the additional interfaces introduced by this Advisor or Advice.
protected void | implementInterfacesOnObject(Object delegate) Publish all interfaces that the given delegate implements at the proxy level.
boolean | implementsInterface(Class ifc) Check whether the specified interfaces is a published introduction interface.
protected boolean | isMethodOnIntroducedInterface(MethodInvocation mi) Is this method on an introduced interface?
void | suppressInterface(Class intf) Suppress the specified interface, which may have been autodetected due to the delegate implementing it.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

publishedInterfaces

protected final Set<Class> publishedInterfaces
Constructor Detail

IntroductionInfoSupport

public IntroductionInfoSupport()
Method Detail

suppressInterface

public void suppressInterface(Class intf)
Suppress the specified interface, which may have been autodetected due to the delegate implementing it. Call this method to exclude internal interfaces from being visible at the proxy level.

Does nothing if the interface is not implemented by the delegate.

Parameters:
intf - the interface to suppress

getInterfaces

public Class[] getInterfaces()
Description copied from interface: IntroductionInfo
Return the additional interfaces introduced by this Advisor or Advice.

Specified by:
getInterfaces in interface IntroductionInfo
Returns:
the introduced interfaces

implementsInterface

public boolean implementsInterface(Class ifc)
Check whether the specified interfaces is a published introduction interface.

Parameters:
ifc - the interface to check
Returns:
whether the interface is part of this introduction

implementInterfacesOnObject

protected void implementInterfacesOnObject(Object delegate)
Publish all interfaces that the given delegate implements at the proxy level.

Parameters:
delegate - the delegate object

isMethodOnIntroducedInterface

protected final boolean isMethodOnIntroducedInterface(MethodInvocation mi)
Is this method on an introduced interface?

Parameters:
mi - the method invocation
Returns:
whether the invoked method is on an introduced interface
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JdkRegexpMethodPointcut

org.springframework.aop.support
Class JdkRegexpMethodPointcut

java.lang.Object
    extended by  org.springframework.aop.support.StaticMethodMatcher
        extended by  org.springframework.aop.support.StaticMethodMatcherPointcut
            extended by  org.springframework.aop.support.AbstractRegexpMethodPointcut
                extended by  org.springframework.aop.support.JdkRegexpMethodPointcut
All Implemented Interfaces:
Serializable, MethodMatcher, Pointcut
public class JdkRegexpMethodPointcut
extends AbstractRegexpMethodPointcut

Regular expression pointcut based on the java.util.regex package. Supports the following JavaBean properties:

  • pattern: regular expression for the fully-qualified method names to match
  • patterns: alternative property taking a String array of patterns. The result will be the union of these patterns.

Note: the regular expressions must be a match. For example, .*get.* will match com.mycom.Foo.getBar(). get.* will not.

Since:
1.1
Author:
Dmitriy Kopylenko, Rob Harrop
See Also:
Serialized Form

Field Summary
Fields inherited from interface org.springframework.aop.Pointcut
TRUE
Fields inherited from interface org.springframework.aop.MethodMatcher
TRUE
Constructor Summary
JdkRegexpMethodPointcut()
Method Summary
protected void | initExcludedPatternRepresentation(String[] excludedPatterns) Initialize exclusion Patterns from the supplied String[].
protected void | initPatternRepresentation(String[] patterns) Initialize Patterns from the supplied String[].
protected boolean | matches(String pattern, int patternIndex) Returns true if the Pattern at index patternIndex matches the supplied candidate String.
protected boolean | matchesExclusion(String candidate, int patternIndex) Returns true if the exclusion Pattern at index patternIndex matches the supplied candidate String.
Methods inherited from class org.springframework.aop.support.AbstractRegexpMethodPointcut
equals, getExcludedPatterns, getPatterns, hashCode, matches, matchesPattern, setExcludedPattern, setExcludedPatterns, setPattern, setPatterns, toString
Methods inherited from class org.springframework.aop.support.StaticMethodMatcherPointcut
getClassFilter, getMethodMatcher, setClassFilter
Methods inherited from class org.springframework.aop.support.StaticMethodMatcher
isRuntime, matches
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

JdkRegexpMethodPointcut

public JdkRegexpMethodPointcut()
Method Detail

initPatternRepresentation

protected void initPatternRepresentation(String[] patterns)
                                  throws PatternSyntaxException
Initialize Patterns from the supplied String[].

Specified by:
initPatternRepresentation in class AbstractRegexpMethodPointcut
Parameters:
patterns - the patterns to initialize
Throws:
PatternSyntaxException

initExcludedPatternRepresentation

protected void initExcludedPatternRepresentation(String[] excludedPatterns)
                                          throws PatternSyntaxException
Initialize exclusion Patterns from the supplied String[].

Specified by:
initExcludedPatternRepresentation in class AbstractRegexpMethodPointcut
Parameters:
excludedPatterns - the patterns to initialize
Throws:
PatternSyntaxException

matches

protected boolean matches(String pattern,
                          int patternIndex)
Returns true if the Pattern at index patternIndex matches the supplied candidate String.

Specified by:
matches in class AbstractRegexpMethodPointcut
Parameters:
pattern - String pattern to match
patternIndex - index of pattern from 0
Returns:
true if there is a match, else false.

matchesExclusion

protected boolean matchesExclusion(String candidate,
                                   int patternIndex)
Returns true if the exclusion Pattern at index patternIndex matches the supplied candidate String.

Specified by:
matchesExclusion in class AbstractRegexpMethodPointcut
Parameters:
candidate - String pattern to match.
patternIndex - index of pattern starting from 0.
Returns:
true if there is a match, else false.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MethodMatchers

org.springframework.aop.support
Class MethodMatchers

java.lang.Object
    extended by  org.springframework.aop.support.MethodMatchers

public abstract class MethodMatchers
extends Object

Static utility methods for composing MethodMatchers.

A MethodMatcher may be evaluated statically (based on method and target class) or need further evaluation dynamically (based on arguments at the time of method invocation).

Since:
11.11.2003
Author:
Rod Johnson, Rob Harrop, Juergen Hoeller
See Also:
ClassFilters, Pointcuts

Constructor Summary
MethodMatchers()
Method Summary
static MethodMatcher | intersection(MethodMatcher mm1, MethodMatcher mm2) Match all methods that both of the given MethodMatchers match.
static boolean | matches(MethodMatcher mm, Method method, Class targetClass, boolean hasIntroductions) Apply the given MethodMatcher to the given Method, supporting an IntroductionAwareMethodMatcher (if applicable).
static MethodMatcher | union(MethodMatcher mm1, MethodMatcher mm2) Match all methods that either (or both) of the given MethodMatchers matches.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MethodMatchers

public MethodMatchers()
Method Detail

union

public static MethodMatcher union(MethodMatcher mm1,
                                  MethodMatcher mm2)
Match all methods that either (or both) of the given MethodMatchers matches.

Parameters:
mm1 - the first MethodMatcher
mm2 - the second MethodMatcher
Returns:
a distinct MethodMatcher that matches all methods that either of the given MethodMatchers matches

intersection

public static MethodMatcher intersection(MethodMatcher mm1,
                                         MethodMatcher mm2)
Match all methods that both of the given MethodMatchers match.

Parameters:
mm1 - the first MethodMatcher
mm2 - the second MethodMatcher
Returns:
a distinct MethodMatcher that matches all methods that both of the given MethodMatchers match

matches

public static boolean matches(MethodMatcher mm,
                              Method method,
                              Class targetClass,
                              boolean hasIntroductions)
Apply the given MethodMatcher to the given Method, supporting an IntroductionAwareMethodMatcher (if applicable).

Parameters:
mm - the MethodMatcher to apply (may be an IntroductionAwareMethodMatcher)
method - the candidate method
targetClass - the target class (may be null, in which case the candidate class must be taken to be the method's declaring class)
hasIntroductions - true if the object on whose behalf we are asking is the subject on one or more introductions; false otherwise
Returns:
whether or not this method matches statically
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NameMatchMethodPointcut

org.springframework.aop.support
Class NameMatchMethodPointcut

java.lang.Object
    extended by  org.springframework.aop.support.StaticMethodMatcher
        extended by  org.springframework.aop.support.StaticMethodMatcherPointcut
            extended by  org.springframework.aop.support.NameMatchMethodPointcut
All Implemented Interfaces:
Serializable, MethodMatcher, Pointcut
public class NameMatchMethodPointcut
extends StaticMethodMatcherPointcut
implements Serializable

Pointcut bean for simple method name matches, as alternative to regexp patterns. Does not handle overloaded methods: all methods *with a given name will be eligible.

Since:
11.02.2004
Author:
Juergen Hoeller, Rod Johnson, Rob Harrop
See Also:
isMatch(java.lang.String, java.lang.String), Serialized Form

Field Summary
Fields inherited from interface org.springframework.aop.Pointcut
TRUE
Fields inherited from interface org.springframework.aop.MethodMatcher
TRUE
Constructor Summary
NameMatchMethodPointcut()
Method Summary
NameMatchMethodPointcut | addMethodName(String name) Add another eligible method name, in addition to those already named.
boolean | equals(Object other)
int | hashCode()
protected boolean | isMatch(String methodName, String mappedName) Return if the given method name matches the mapped name.
boolean | matches(Method method, Class targetClass) Perform static checking whether the given method matches.
void | setMappedName(String mappedName) Convenience method when we have only a single method name to match.
void | setMappedNames(String[] mappedNames) Set the method names defining methods to match.
Methods inherited from class org.springframework.aop.support.StaticMethodMatcherPointcut
getClassFilter, getMethodMatcher, setClassFilter
Methods inherited from class org.springframework.aop.support.StaticMethodMatcher
isRuntime, matches
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

NameMatchMethodPointcut

public NameMatchMethodPointcut()
Method Detail

setMappedName

public void setMappedName(String mappedName)
Convenience method when we have only a single method name to match. Use either this method or setMappedNames, not both.

See Also:
setMappedNames(java.lang.String[])

setMappedNames

public void setMappedNames(String[] mappedNames)
Set the method names defining methods to match. Matching will be the union of all these; if any match, the pointcut matches.

addMethodName

public NameMatchMethodPointcut addMethodName(String name)
Add another eligible method name, in addition to those already named. Like the set methods, this method is for use when configuring proxies, before a proxy is used.

NB: This method does not work after the proxy is in use, as advice chains will be cached.

Parameters:
name - name of the additional method that will match
Returns:
this pointcut to allow for multiple additions in one line

matches

public boolean matches(Method method,
                       Class targetClass)
Description copied from interface: MethodMatcher
Perform static checking whether the given method matches. If this returns false or if the MethodMatcher.isRuntime() method returns false, no runtime check (i.e. no. MethodMatcher.matches(java.lang.reflect.Method, Class, Object[]) call) will be made.

Specified by:
matches in interface MethodMatcher
Parameters:
method - the candidate method
targetClass - the target class (may be null, in which case the candidate class must be taken to be the method's declaring class)
Returns:
whether or not this method matches statically

isMatch

protected boolean isMatch(String methodName,
                          String mappedName)
Return if the given method name matches the mapped name.

The default implementation checks for "xxx*", "*xxx" and "*xxx*" matches, as well as direct equality. Can be overridden in subclasses.

Parameters:
methodName - the method name of the class
mappedName - the name in the descriptor
Returns:
if the names match
See Also:
PatternMatchUtils.simpleMatch(String, String)

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NameMatchMethodPointcutAdvisor

org.springframework.aop.support
Class NameMatchMethodPointcutAdvisor

java.lang.Object
    extended by  org.springframework.aop.support.AbstractPointcutAdvisor
        extended by  org.springframework.aop.support.AbstractGenericPointcutAdvisor
            extended by  org.springframework.aop.support.NameMatchMethodPointcutAdvisor
All Implemented Interfaces:
Serializable, Advisor, PointcutAdvisor, Ordered
public class NameMatchMethodPointcutAdvisor
extends AbstractGenericPointcutAdvisor

Convenient class for name-match method pointcuts that hold an Advice, making them an Advisor.

Author:
Juergen Hoeller, Rob Harrop
See Also:
NameMatchMethodPointcut, Serialized Form

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
NameMatchMethodPointcutAdvisor()
NameMatchMethodPointcutAdvisor(Advice advice)
Method Summary
NameMatchMethodPointcut | addMethodName(String name) Add another eligible method name, in addition to those already named.
Pointcut | getPointcut() Get the Pointcut that drives this advisor.
void | setClassFilter(ClassFilter classFilter) Set the ClassFilter to use for this pointcut.
void | setMappedName(String mappedName) Convenience method when we have only a single method name to match.
void | setMappedNames(String[] mappedNames) Set the method names defining methods to match.
Methods inherited from class org.springframework.aop.support.AbstractGenericPointcutAdvisor
getAdvice, setAdvice, toString
Methods inherited from class org.springframework.aop.support.AbstractPointcutAdvisor
equals, getOrder, hashCode, isPerInstance, setOrder
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

NameMatchMethodPointcutAdvisor

public NameMatchMethodPointcutAdvisor()

NameMatchMethodPointcutAdvisor

public NameMatchMethodPointcutAdvisor(Advice advice)
Method Detail

setClassFilter

public void setClassFilter(ClassFilter classFilter)
Set the ClassFilter to use for this pointcut. Default is ClassFilter.TRUE.

See Also:
StaticMethodMatcherPointcut.setClassFilter(org.springframework.aop.ClassFilter)

setMappedName

public void setMappedName(String mappedName)
Convenience method when we have only a single method name to match. Use either this method or setMappedNames, not both.

See Also:
setMappedNames(java.lang.String[]), NameMatchMethodPointcut.setMappedName(java.lang.String)

setMappedNames

public void setMappedNames(String[] mappedNames)
Set the method names defining methods to match. Matching will be the union of all these; if any match, the pointcut matches.

See Also:
NameMatchMethodPointcut.setMappedNames(java.lang.String[])

addMethodName

public NameMatchMethodPointcut addMethodName(String name)
Add another eligible method name, in addition to those already named. Like the set methods, this method is for use when configuring proxies, before a proxy is used.

Parameters:
name - name of the additional method that will match
Returns:
this pointcut to allow for multiple additions in one line
See Also:
NameMatchMethodPointcut.addMethodName(java.lang.String)

getPointcut

public Pointcut getPointcut()
Description copied from interface: PointcutAdvisor
Get the Pointcut that drives this advisor.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Pointcuts

org.springframework.aop.support
Class Pointcuts

java.lang.Object
    extended by  org.springframework.aop.support.Pointcuts

public abstract class Pointcuts
extends Object

Pointcut constants for matching getters and setters, and static methods useful for manipulating and evaluating pointcuts. These methods are particularly useful for composing pointcuts using the union and intersection methods.

Author:
Rod Johnson, Juergen Hoeller

Field Summary
static Pointcut | GETTERS Pointcut matching all bean property getters, in any class
static Pointcut | SETTERS Pointcut matching all bean property setters, in any class
Constructor Summary
Pointcuts()
Method Summary
static Pointcut | intersection(Pointcut pc1, Pointcut pc2) Match all methods that both the given pointcuts match.
static boolean | matches(Pointcut pointcut, Method method, Class targetClass, Object[] args) Perform the least expensive check for a pointcut match.
static Pointcut | union(Pointcut pc1, Pointcut pc2) Match all methods that either (or both) of the given pointcuts matches.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

SETTERS

public static final Pointcut SETTERS
Pointcut matching all bean property setters, in any class

GETTERS

public static final Pointcut GETTERS
Pointcut matching all bean property getters, in any class

Constructor Detail

Pointcuts

public Pointcuts()
Method Detail

union

public static Pointcut union(Pointcut pc1,
                             Pointcut pc2)
Match all methods that either (or both) of the given pointcuts matches.

Parameters:
pc1 - the first Pointcut
pc2 - the second Pointcut
Returns:
a distinct Pointcut that matches all methods that either of the given Pointcuts matches

intersection

public static Pointcut intersection(Pointcut pc1,
                                    Pointcut pc2)
Match all methods that both the given pointcuts match.

Parameters:
pc1 - the first Pointcut
pc2 - the second Pointcut
Returns:
a distinct Pointcut that matches all methods that both of the given Pointcuts match

matches

public static boolean matches(Pointcut pointcut,
                              Method method,
                              Class targetClass,
                              Object[] args)
Perform the least expensive check for a pointcut match.

Parameters:
pointcut - the pointcut to match
method - the candidate method
targetClass - the target class
args - arguments to the method
Returns:
whether there's a runtime match
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RegexpMethodPointcutAdvisor

org.springframework.aop.support
Class RegexpMethodPointcutAdvisor

java.lang.Object
    extended by  org.springframework.aop.support.AbstractPointcutAdvisor
        extended by  org.springframework.aop.support.AbstractGenericPointcutAdvisor
            extended by  org.springframework.aop.support.RegexpMethodPointcutAdvisor
All Implemented Interfaces:
Serializable, Advisor, PointcutAdvisor, Ordered
public class RegexpMethodPointcutAdvisor
extends AbstractGenericPointcutAdvisor

Convenient class for regexp method pointcuts that hold an Advice, making them an Advisor.

Configure this class using the "pattern" and "patterns" pass-through properties. These are analogous to the pattern and patterns properties of AbstractRegexpMethodPointcut.

Can delegate to any AbstractRegexpMethodPointcut subclass. By default, JdkRegexpMethodPointcut will be used. To choose a specific one, override the createPointcut() method.

Author:
Rod Johnson, Juergen Hoeller
See Also:
setPattern(java.lang.String), setPatterns(java.lang.String[]), JdkRegexpMethodPointcut, Serialized Form

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
RegexpMethodPointcutAdvisor()
Create an empty RegexpMethodPointcutAdvisor.
RegexpMethodPointcutAdvisor(Advice advice)
Create a RegexpMethodPointcutAdvisor for the given advice.
RegexpMethodPointcutAdvisor(String[] patterns, Advice advice)
Create a RegexpMethodPointcutAdvisor for the given advice.
RegexpMethodPointcutAdvisor(String pattern, Advice advice)
Create a RegexpMethodPointcutAdvisor for the given advice.
Method Summary
protected AbstractRegexpMethodPointcut | createPointcut() Create the actual pointcut: By default, a JdkRegexpMethodPointcut will be used.
Pointcut | getPointcut() Initialize the singleton Pointcut held within this Advisor.
void | setPattern(String pattern) Set the regular expression defining methods to match.
void | setPatterns(String[] patterns) Set the regular expressions defining methods to match.
String | toString()
Methods inherited from class org.springframework.aop.support.AbstractGenericPointcutAdvisor
getAdvice, setAdvice
Methods inherited from class org.springframework.aop.support.AbstractPointcutAdvisor
equals, getOrder, hashCode, isPerInstance, setOrder
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

RegexpMethodPointcutAdvisor

public RegexpMethodPointcutAdvisor()
Create an empty RegexpMethodPointcutAdvisor.

See Also:
setPattern(java.lang.String),
setPatterns(java.lang.String[]),
AbstractGenericPointcutAdvisor.setAdvice(org.aopalliance.aop.Advice)

RegexpMethodPointcutAdvisor

public RegexpMethodPointcutAdvisor(Advice advice)
Create a RegexpMethodPointcutAdvisor for the given advice. The pattern still needs to be specified afterwards.

Parameters:
advice - the advice to use
See Also:
setPattern(java.lang.String), setPatterns(java.lang.String[])

RegexpMethodPointcutAdvisor

public RegexpMethodPointcutAdvisor(String pattern,
                                   Advice advice)
Create a RegexpMethodPointcutAdvisor for the given advice.

Parameters:
pattern - the pattern to use
advice - the advice to use

RegexpMethodPointcutAdvisor

public RegexpMethodPointcutAdvisor(String[] patterns,
                                   Advice advice)
Create a RegexpMethodPointcutAdvisor for the given advice.

Parameters:
patterns - the patterns to use
advice - the advice to use
Method Detail

setPattern

public void setPattern(String pattern)
Set the regular expression defining methods to match.

Use either this method or setPatterns(java.lang.String[]), not both.

See Also:
setPatterns(java.lang.String[])

setPatterns

public void setPatterns(String[] patterns)
Set the regular expressions defining methods to match. To be passed through to the pointcut implementation.

Matching will be the union of all these; if any of the patterns matches, the pointcut matches.

See Also:
AbstractRegexpMethodPointcut.setPatterns(java.lang.String[])

getPointcut

public Pointcut getPointcut()
Initialize the singleton Pointcut held within this Advisor.

createPointcut

protected AbstractRegexpMethodPointcut createPointcut()
Create the actual pointcut: By default, a JdkRegexpMethodPointcut will be used.

Returns:
the Pointcut instance (never null)

toString

public String toString()
Overrides:
toString in class AbstractGenericPointcutAdvisor
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RootClassFilter

org.springframework.aop.support
Class RootClassFilter

java.lang.Object
    extended by  org.springframework.aop.support.RootClassFilter
All Implemented Interfaces:
Serializable, ClassFilter
public class RootClassFilter
extends Object
implements ClassFilter, Serializable

Simple ClassFilter implementation that passes classes (and optionally subclasses)

Author:
Rod Johnson
See Also:
Serialized Form

Field Summary
Fields inherited from interface org.springframework.aop.ClassFilter
TRUE
Constructor Summary
RootClassFilter(Class clazz)
Method Summary
 boolean matches(Class candidate)
Should the pointcut apply to the given interface or target class?
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

RootClassFilter

public RootClassFilter(Class clazz)
Method Detail

matches

public boolean matches(Class candidate)
Description copied from interface: ClassFilter
Should the pointcut apply to the given interface or target class?

Specified by:
matches in interface ClassFilter
Parameters:
candidate - the candidate target class
Returns:
whether the advice should apply to the given target class
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StaticMethodMatcher

org.springframework.aop.support
Class StaticMethodMatcher

java.lang.Object
    extended by  org.springframework.aop.support.StaticMethodMatcher
All Implemented Interfaces:
MethodMatcher
Direct Known Subclasses:
AnnotationMethodMatcher, StaticMethodMatcherPointcut
public abstract class StaticMethodMatcher
extends Object
implements MethodMatcher

Convenient abstract superclass for static method matchers, which don't care about arguments at runtime.

Field Summary
Fields inherited from interface org.springframework.aop.MethodMatcher
TRUE
Constructor Summary
StaticMethodMatcher()
Method Summary
 boolean isRuntime()
Is this MethodMatcher dynamic, that is, must a final call be made on the MethodMatcher.matches(java.lang.reflect.Method, Class, Object[]) method at runtime even if the 2-arg matches method returns true?
 boolean matches(Method method, Class<?> targetClass, Object[] args)
Check whether there a runtime (dynamic) match for this method, which must have matched statically.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.aop.MethodMatcher
matches

Constructor Detail

StaticMethodMatcher

public StaticMethodMatcher()
Method Detail

isRuntime

public final boolean isRuntime()
Description copied from interface: MethodMatcher
Is this MethodMatcher dynamic, that is, must a final call be made on the MethodMatcher.matches(java.lang.reflect.Method, Class, Object[]) method at runtime even if the 2-arg matches method returns true?

Can be invoked when an AOP proxy is created, and need not be invoked again before each method invocation,

Specified by:
isRuntime in interface MethodMatcher
Returns:
whether or not a runtime match via the 3-arg MethodMatcher.matches(java.lang.reflect.Method, Class, Object[]) method is required if static matching passed

matches

public final boolean matches(Method method,
                             Class<?> targetClass,
                             Object[] args)
Description copied from interface: MethodMatcher
Check whether there a runtime (dynamic) match for this method, which must have matched statically.

This method is invoked only if the 2-arg matches method returns true for the given method and target class, and if the MethodMatcher.isRuntime() method returns true. Invoked immediately before potential running of the advice, after any advice earlier in the advice chain has run.

Specified by:
matches in interface MethodMatcher
Parameters:
method - the candidate method
targetClass - the target class (may be null, in which case the candidate class must be taken to be the method's declaring class)
args - arguments to the method
Returns:
whether there's a runtime match
See Also:
MethodMatcher.matches(Method, Class)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StaticMethodMatcherPointcut

org.springframework.aop.support
Class StaticMethodMatcherPointcut

java.lang.Object
    extended by  org.springframework.aop.support.StaticMethodMatcher
        extended by  org.springframework.aop.support.StaticMethodMatcherPointcut
All Implemented Interfaces:
MethodMatcher, Pointcut
Direct Known Subclasses:
AbstractRegexpMethodPointcut, NameMatchMethodPointcut, StaticMethodMatcherPointcutAdvisor
public abstract class StaticMethodMatcherPointcut
extends StaticMethodMatcher
implements Pointcut

Convenient superclass when we want to force subclasses to implement the MethodMatcher interface but subclasses will want to be pointcuts.

The "classFilter" property can be set to customize ClassFilter behavior. The default is ClassFilter.TRUE.

Author:
Rod Johnson, Juergen Hoeller

Field Summary
Fields inherited from interface org.springframework.aop.Pointcut
TRUE
Fields inherited from interface org.springframework.aop.MethodMatcher
TRUE
Constructor Summary
StaticMethodMatcherPointcut()
Method Summary
ClassFilter | getClassFilter() Return the ClassFilter for this pointcut.
MethodMatcher | getMethodMatcher() Return the MethodMatcher for this pointcut.
void | setClassFilter(ClassFilter classFilter) Set the ClassFilter to use for this pointcut.
Methods inherited from class org.springframework.aop.support.StaticMethodMatcher
isRuntime, matches
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.aop.MethodMatcher
matches

Constructor Detail

StaticMethodMatcherPointcut

public StaticMethodMatcherPointcut()
Method Detail

setClassFilter

public void setClassFilter(ClassFilter classFilter)
Set the ClassFilter to use for this pointcut. Default is ClassFilter.TRUE.

getClassFilter

public ClassFilter getClassFilter()
Description copied from interface: Pointcut
Return the ClassFilter for this pointcut.

Specified by:
getClassFilter in interface Pointcut
Returns:
the ClassFilter (never null)

getMethodMatcher

public final MethodMatcher getMethodMatcher()
Description copied from interface: Pointcut
Return the MethodMatcher for this pointcut.

Specified by:
getMethodMatcher in interface Pointcut
Returns:
the MethodMatcher (never null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StaticMethodMatcherPointcutAdvisor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.aop.support
Class StaticMethodMatcherPointcutAdvisor

java.lang.Object
    extended by  org.springframework.aop.support.StaticMethodMatcher
        extended by  org.springframework.aop.support.StaticMethodMatcherPointcut
            extended by  org.springframework.aop.support.StaticMethodMatcherPointcutAdvisor
All Implemented Interfaces:
Serializable, Advisor, MethodMatcher, Pointcut, PointcutAdvisor, Ordered
public abstract class StaticMethodMatcherPointcutAdvisor
extends StaticMethodMatcherPointcut
implements PointcutAdvisor, Ordered, Serializable

Convenient base class for Advisors that are also static pointcuts. Serializable if Advice and subclass are.

Author:
Rod Johnson, Juergen Hoeller
See Also:
Serialized Form

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Fields inherited from interface org.springframework.aop.Pointcut
TRUE
Fields inherited from interface org.springframework.aop.MethodMatcher
TRUE
Constructor Summary
StaticMethodMatcherPointcutAdvisor()
Create a new StaticMethodMatcherPointcutAdvisor, expecting bean-style configuration.
StaticMethodMatcherPointcutAdvisor(Advice advice)
Create a new StaticMethodMatcherPointcutAdvisor for the given advice.
Method Summary
Advice | getAdvice() Return the advice part of this aspect.
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
Pointcut | getPointcut() Get the Pointcut that drives this advisor.
boolean | isPerInstance() Return whether this advice is associated with a particular instance (for example, creating a mixin) or shared with all instances of the advised class obtained from the same Spring bean factory.
void | setAdvice(Advice advice)
void | setOrder(int order)
Methods inherited from class org.springframework.aop.support.StaticMethodMatcherPointcut
getClassFilter, getMethodMatcher, setClassFilter
Methods inherited from class org.springframework.aop.support.StaticMethodMatcher
isRuntime, matches
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.aop.MethodMatcher
matches

Constructor Detail

StaticMethodMatcherPointcutAdvisor

public StaticMethodMatcherPointcutAdvisor()
Create a new StaticMethodMatcherPointcutAdvisor, expecting bean-style configuration.

See Also:
setAdvice(org.aopalliance.aop.Advice)

StaticMethodMatcherPointcutAdvisor

public StaticMethodMatcherPointcutAdvisor(Advice advice)
Create a new StaticMethodMatcherPointcutAdvisor for the given advice.

Parameters:
advice - the Advice to use
Method Detail

setOrder

public void setOrder(int order)

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

setAdvice

public void setAdvice(Advice advice)

getAdvice

public Advice getAdvice()
Description copied from interface: Advisor
Return the advice part of this aspect. An advice may be an interceptor, a before advice, a throws advice, etc.

Specified by:
getAdvice in interface Advisor
Returns:
the advice that should apply if the pointcut matches
See Also:
MethodInterceptor, BeforeAdvice, ThrowsAdvice, AfterReturningAdvice

isPerInstance

public boolean isPerInstance()
Description copied from interface: Advisor
Return whether this advice is associated with a particular instance (for example, creating a mixin) or shared with all instances of the advised class obtained from the same Spring bean factory.

Note that this method is not currently used by the framework. Typical Advisor implementations always return true. Use singleton/prototype bean definitions or appropriate programmatic proxy creation to ensure that Advisors have the correct lifecycle model.

Specified by:
isPerInstance in interface Advisor
Returns:
whether this advice is associated with a particular target instance

getPointcut

public Pointcut getPointcut()
Description copied from interface: PointcutAdvisor
Get the Pointcut that drives this advisor.

Specified by:
getPointcut in interface PointcutAdvisor
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.aop.support.annotation

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.aop.support.annotation

Annotation support for AOP pointcuts.

See:
Description

Class Summary
AnnotationClassFilter | Simple ClassFilter that looks for a specific Java 5 annotation being present on a class.
AnnotationMatchingPointcut | Simple Pointcut that looks for a specific Java 5 annotation being present on a class or method.
AnnotationMethodMatcher | Simple MethodMatcher that looks for a specific Java 5 annotation being present on a method (checking both the method on the invoked interface, if any, and the corresponding method on the target class).

Package org.springframework.aop.support.annotation Description

Annotation support for AOP pointcuts.


org.springframework.aop.support.annotation Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.aop.support.annotation

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.aop.support.annotation.AnnotationClassFilter (implements org.springframework.aop.ClassFilter)
    • org.springframework.aop.support.annotation.AnnotationMatchingPointcut (implements org.springframework.aop.Pointcut)
    • org.springframework.aop.support.StaticMethodMatcher (implements org.springframework.aop.MethodMatcher)
      • org.springframework.aop.support.annotation.AnnotationMethodMatcher


AnnotationClassFilter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.aop.support.annotation
Class AnnotationClassFilter

java.lang.Object
    extended by  org.springframework.aop.support.annotation.AnnotationClassFilter
All Implemented Interfaces:
ClassFilter
public class AnnotationClassFilter
extends Object
implements ClassFilter

Simple ClassFilter that looks for a specific Java 5 annotation being present on a class.

Since:
2.0
Author:
Juergen Hoeller
See Also:
AnnotationMatchingPointcut

Field Summary
Fields inherited from interface org.springframework.aop.ClassFilter
TRUE
Constructor Summary
AnnotationClassFilter(Class<? extends Annotation> annotationType)
Create a new AnnotationClassFilter for the given annotation type.
AnnotationClassFilter(Class<? extends Annotation> annotationType, boolean checkInherited)
Create a new AnnotationClassFilter for the given annotation type.
Method Summary
 boolean matches(Class clazz)
Should the pointcut apply to the given interface or target class?
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AnnotationClassFilter

public AnnotationClassFilter(Class<? extends Annotation> annotationType)
Create a new AnnotationClassFilter for the given annotation type.

Parameters:
annotationType - the annotation type to look for

AnnotationClassFilter

public AnnotationClassFilter(Class<? extends Annotation> annotationType,
                             boolean checkInherited)
Create a new AnnotationClassFilter for the given annotation type.

Parameters:
annotationType - the annotation type to look for
checkInherited - whether to explicitly check the superclasses and interfaces for the annotation type as well (even if the annotation type is not marked as inherited itself)
Method Detail

matches

public boolean matches(Class clazz)
Description copied from interface: ClassFilter
Should the pointcut apply to the given interface or target class?

Specified by:
matches in interface ClassFilter
Parameters:
clazz - the candidate target class
Returns:
whether the advice should apply to the given target class
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AnnotationMatchingPointcut

org.springframework.aop.support.annotation
Class AnnotationMatchingPointcut

java.lang.Object
    extended by  org.springframework.aop.support.annotation.AnnotationMatchingPointcut
All Implemented Interfaces:
Pointcut
public class AnnotationMatchingPointcut
extends Object
implements Pointcut

Simple Pointcut that looks for a specific Java 5 annotation being present on a class or method.

Since:
2.0
Author:
Juergen Hoeller
See Also:
AnnotationClassFilter, AnnotationMethodMatcher

Field Summary
Fields inherited from interface org.springframework.aop.Pointcut
TRUE
Constructor Summary
AnnotationMatchingPointcut(Class<? extends Annotation> classAnnotationType)
Create a new AnnotationMatchingPointcut for the given annotation type.
AnnotationMatchingPointcut(Class<? extends Annotation> classAnnotationType, boolean checkInherited)
Create a new AnnotationMatchingPointcut for the given annotation type.
AnnotationMatchingPointcut(Class<? extends Annotation> classAnnotationType, Class<? extends Annotation> methodAnnotationType)
Create a new AnnotationMatchingPointcut for the given annotation type.
Method Summary
static AnnotationMatchingPointcut | forClassAnnotation(Class<? extends Annotation> annotationType) Factory method for an AnnotationMatchingPointcut that matches for the specified annotation at the class level.
static AnnotationMatchingPointcut | forMethodAnnotation(Class<? extends Annotation> annotationType) Factory method for an AnnotationMatchingPointcut that matches for the specified annotation at the method level.
ClassFilter | getClassFilter() Return the ClassFilter for this pointcut.
MethodMatcher | getMethodMatcher() Return the MethodMatcher for this pointcut.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AnnotationMatchingPointcut

public AnnotationMatchingPointcut(Class<? extends Annotation> classAnnotationType)
Create a new AnnotationMatchingPointcut for the given annotation type.

Parameters:
classAnnotationType - the annotation type to look for at the class level

AnnotationMatchingPointcut

public AnnotationMatchingPointcut(Class<? extends Annotation> classAnnotationType,
                                  boolean checkInherited)
Create a new AnnotationMatchingPointcut for the given annotation type.

Parameters:
classAnnotationType - the annotation type to look for at the class level
checkInherited - whether to explicitly check the superclasses and interfaces for the annotation type as well (even if the annotation type is not marked as inherited itself)

AnnotationMatchingPointcut

public AnnotationMatchingPointcut(Class<? extends Annotation> classAnnotationType,
                                  Class<? extends Annotation> methodAnnotationType)
Create a new AnnotationMatchingPointcut for the given annotation type.

Parameters:
classAnnotationType - the annotation type to look for at the class level (can be null)
methodAnnotationType - the annotation type to look for at the method level (can be null)
Method Detail

getClassFilter

public ClassFilter getClassFilter()
Description copied from interface: Pointcut
Return the ClassFilter for this pointcut.

Specified by:
getClassFilter in interface Pointcut
Returns:
the ClassFilter (never null)

getMethodMatcher

public MethodMatcher getMethodMatcher()
Description copied from interface: Pointcut
Return the MethodMatcher for this pointcut.

Specified by:
getMethodMatcher in interface Pointcut
Returns:
the MethodMatcher (never null)

forClassAnnotation

public static AnnotationMatchingPointcut forClassAnnotation(Class<? extends Annotation> annotationType)
Factory method for an AnnotationMatchingPointcut that matches for the specified annotation at the class level.

Parameters:
annotationType - the annotation type to look for at the class level
Returns:
the corresponding AnnotationMatchingPointcut

forMethodAnnotation

public static AnnotationMatchingPointcut forMethodAnnotation(Class<? extends Annotation> annotationType)
Factory method for an AnnotationMatchingPointcut that matches for the specified annotation at the method level.

Parameters:
annotationType - the annotation type to look for at the method level
Returns:
the corresponding AnnotationMatchingPointcut
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AnnotationMethodMatcher

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.aop.support.annotation
Class AnnotationMethodMatcher

java.lang.Object
    extended by  org.springframework.aop.support.StaticMethodMatcher
        extended by  org.springframework.aop.support.annotation.AnnotationMethodMatcher
All Implemented Interfaces:
MethodMatcher
public class AnnotationMethodMatcher
extends StaticMethodMatcher

Simple MethodMatcher that looks for a specific Java 5 annotation being present on a method (checking both the method on the invoked interface, if any, and the corresponding method on the target class).

Since:
2.0
Author:
Juergen Hoeller
See Also:
AnnotationMatchingPointcut

Field Summary
Fields inherited from interface org.springframework.aop.MethodMatcher
TRUE
Constructor Summary
AnnotationMethodMatcher(Class<? extends Annotation> annotationType)
Create a new AnnotationClassFilter for the given annotation type.
Method Summary
 boolean matches(Method method, Class targetClass)
Perform static checking whether the given method matches.
Methods inherited from class org.springframework.aop.support.StaticMethodMatcher
isRuntime, matches
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AnnotationMethodMatcher

public AnnotationMethodMatcher(Class<? extends Annotation> annotationType)
Create a new AnnotationClassFilter for the given annotation type.

Parameters:
annotationType - the annotation type to look for
Method Detail

matches

public boolean matches(Method method,
                       Class targetClass)
Description copied from interface: MethodMatcher
Perform static checking whether the given method matches. If this returns false or if the MethodMatcher.isRuntime() method returns false, no runtime check (i.e. no. MethodMatcher.matches(java.lang.reflect.Method, Class, Object[]) call) will be made.

Parameters:
method - the candidate method
targetClass - the target class (may be null, in which case the candidate class must be taken to be the method's declaring class)
Returns:
whether or not this method matches statically
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.aop.target

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.aop.target

This package contains implementations of the org.springframework.aop.TargetSource interface.

See:
Description

Interface Summary
PoolingConfig | Config interface for a pooling target source.
ThreadLocalTargetSourceStats | Statistics for a ThreadLocal TargetSource.

Class Summary
AbstractBeanFactoryBasedTargetSource | Base class for TargetSource implementations that are based on a Spring BeanFactory, delegating to Spring-managed bean instances.
AbstractLazyCreationTargetSource | TargetSource implementation that will lazily create a user-managed object.
AbstractPoolingTargetSource | Abstract base class for pooling TargetSource implementations which maintain a pool of target instances, acquiring and releasing a target object from the pool for each method invocation.
AbstractPrototypeBasedTargetSource | Base class for dynamic TargetSource implementations that create new prototype bean instances to support a pooling or new-instance-per-invocation strategy.
CommonsPoolTargetSource | TargetSource implementation that holds objects in a configurable Jakarta Commons Pool.
EmptyTargetSource | Canonical TargetSource when there is no target (or just the target class known), and behavior is supplied by interfaces and advisors only.
HotSwappableTargetSource | TargetSource implementation that caches a local target object, but allows the target to be swapped while the application is running.
LazyInitTargetSource | TargetSource that lazily accesses a singleton bean from a BeanFactory.
PrototypeTargetSource | TargetSource that creates a new instance of the target bean for each request, destroying each instance on release (after each request).
SimpleBeanTargetSource | Simple TargetSource implementation, freshly obtaining the specified target bean from its containing Spring BeanFactory.
SingletonTargetSource | Implementation of the TargetSource interface that holds a given object.
ThreadLocalTargetSource | Alternative to an object pool.

Package org.springframework.aop.target Description

This package contains implementations of the org.springframework.aop.TargetSource interface.
The simplest implementation is the SingletonTargetSource, used by default in the AOP framework to wrap a single target instance. This is normally appropriate.
Other provided implementations include pooling implementations, that provide a target from a pool for each request, ensuring a single threaded programming model; and a "prototype" implementation, that uses a new target instance for each invocation.


org.springframework.aop.target Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.aop.target

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource (implements org.springframework.beans.factory.BeanFactoryAware, java.io.Serializable, org.springframework.aop.TargetSource)
      • org.springframework.aop.target.AbstractPrototypeBasedTargetSource
        • org.springframework.aop.target.AbstractPoolingTargetSource (implements org.springframework.beans.factory.DisposableBean, org.springframework.aop.target.PoolingConfig)
          • org.springframework.aop.target.CommonsPoolTargetSource (implements org.apache.commons.pool.PoolableObjectFactory)
        • org.springframework.aop.target.PrototypeTargetSource
        • org.springframework.aop.target.ThreadLocalTargetSource (implements org.springframework.beans.factory.DisposableBean, org.springframework.aop.target.ThreadLocalTargetSourceStats)
      • org.springframework.aop.target.LazyInitTargetSource
      • org.springframework.aop.target.SimpleBeanTargetSource
    • org.springframework.aop.target.AbstractLazyCreationTargetSource (implements org.springframework.aop.TargetSource)
    • org.springframework.aop.target.EmptyTargetSource (implements java.io.Serializable, org.springframework.aop.TargetSource)
    • org.springframework.aop.target.HotSwappableTargetSource (implements java.io.Serializable, org.springframework.aop.TargetSource)
    • org.springframework.aop.target.SingletonTargetSource (implements java.io.Serializable, org.springframework.aop.TargetSource)

Interface Hierarchy

  • org.springframework.aop.target.PoolingConfig
  • org.springframework.aop.target.ThreadLocalTargetSourceStats


PoolingConfig

org.springframework.aop.target
Interface PoolingConfig

All Known Implementing Classes:
AbstractPoolingTargetSource, CommonsPoolTargetSource
public interface PoolingConfig

Config interface for a pooling target source.

Author:
Rod Johnson, Juergen Hoeller

Method Summary
int | getActiveCount() Return the number of active objects in the pool.
int | getIdleCount() Return the number of idle objects in the pool.
int | getMaxSize() Return the maximum size of the pool.

Method Detail

getMaxSize

int getMaxSize()
Return the maximum size of the pool.

getActiveCount

int getActiveCount()
                   throws UnsupportedOperationException
Return the number of active objects in the pool.

Throws:
UnsupportedOperationException - if not supported by the pool

getIdleCount

int getIdleCount()
                 throws UnsupportedOperationException
Return the number of idle objects in the pool.

Throws:
UnsupportedOperationException - if not supported by the pool
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ThreadLocalTargetSourceStats

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.aop.target
Interface ThreadLocalTargetSourceStats

All Known Implementing Classes:
ThreadLocalTargetSource
public interface ThreadLocalTargetSourceStats

Statistics for a ThreadLocal TargetSource.

Author:
Rod Johnson, Juergen Hoeller

Method Summary
int | getHitCount() Return the number of hits that were satisfied by a thread-bound object.
int | getInvocationCount() Return the number of client invocations.
int | getObjectCount() Return the number of thread-bound objects created.

Method Detail

getInvocationCount

int getInvocationCount()
Return the number of client invocations.

getHitCount

int getHitCount()
Return the number of hits that were satisfied by a thread-bound object.

getObjectCount

int getObjectCount()
Return the number of thread-bound objects created.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractBeanFactoryBasedTargetSource

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.aop.target
Class AbstractBeanFactoryBasedTargetSource

java.lang.Object
    extended by  org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
All Implemented Interfaces:
Serializable, TargetClassAware, TargetSource, BeanFactoryAware
Direct Known Subclasses:
AbstractPrototypeBasedTargetSource, LazyInitTargetSource, SimpleBeanTargetSource
public abstract class AbstractBeanFactoryBasedTargetSource
extends Object
implements TargetSource, BeanFactoryAware, Serializable

Base class for TargetSource implementations that are based on a Spring BeanFactory, delegating to Spring-managed bean instances.

Subclasses can create prototype instances or lazily access a singleton target, for example. See LazyInitTargetSource and AbstractPrototypeBasedTargetSource's subclasses for concrete strategies.

BeanFactory-based TargetSources are serializable. This involves disconnecting the current target and turning into a SingletonTargetSource.

Since:
1.1.4
Author:
Juergen Hoeller, Rod Johnson
See Also:
BeanFactory.getBean(java.lang.String), LazyInitTargetSource, PrototypeTargetSource, ThreadLocalTargetSource, CommonsPoolTargetSource, Serialized Form

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
AbstractBeanFactoryBasedTargetSource()
Method Summary
protected  void copyFrom(AbstractBeanFactoryBasedTargetSource other)
Copy configuration from the other AbstractBeanFactoryBasedTargetSource object.
 boolean equals(Object other)
 BeanFactory getBeanFactory()
Return the owning BeanFactory.
 String getTargetBeanName()
Return the name of the target bean in the factory.
 Class getTargetClass()
Return the type of targets returned by this TargetSource.
 int hashCode()
 boolean isStatic()
Will all calls to TargetSource.getTarget() return the same object?
 void releaseTarget(Object target)
Release the given target object obtained from the TargetSource.getTarget() method.
 void setBeanFactory(BeanFactory beanFactory)
Set the owning BeanFactory.
 void setTargetBeanName(String targetBeanName)
Set the name of the target bean in the factory.
 void setTargetClass(Class targetClass)
Specify the target class explicitly, to avoid any kind of access to the target bean (for example, to avoid initialization of a FactoryBean instance).
 String toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.aop.TargetSource
getTarget

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

AbstractBeanFactoryBasedTargetSource

public AbstractBeanFactoryBasedTargetSource()
Method Detail

setTargetBeanName

public void setTargetBeanName(String targetBeanName)
Set the name of the target bean in the factory.

The target bean should not be a singleton, else the same instance will always be obtained from the factory, resulting in the same behavior as provided by SingletonTargetSource.

Parameters:
targetBeanName - name of the target bean in the BeanFactory that owns this interceptor
See Also:
SingletonTargetSource

getTargetBeanName

public String getTargetBeanName()
Return the name of the target bean in the factory.

setTargetClass

public void setTargetClass(Class targetClass)
Specify the target class explicitly, to avoid any kind of access to the target bean (for example, to avoid initialization of a FactoryBean instance).

Default is to detect the type automatically, through a getType call on the BeanFactory (or even a full getBean call as fallback).

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
                    throws BeansException
Set the owning BeanFactory. We need to save a reference so that we can use the getBean method on every invocation.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
Throws:
BeansException - in case of initialization errors
See Also:
BeanInitializationException

getBeanFactory

public BeanFactory getBeanFactory()
Return the owning BeanFactory.

getTargetClass

public Class getTargetClass()
Description copied from interface: TargetSource
Return the type of targets returned by this TargetSource.

Can return null, although certain usages of a TargetSource might just work with a predetermined target class.

Specified by:
getTargetClass in interface TargetClassAware
Specified by:
getTargetClass in interface TargetSource
Returns:
the type of targets returned by this TargetSource

isStatic

public boolean isStatic()
Description copied from interface: TargetSource
Will all calls to TargetSource.getTarget() return the same object?

In that case, there will be no need to invoke TargetSource.releaseTarget(Object), and the AOP framework can cache the return value of TargetSource.getTarget().

Specified by:
isStatic in interface TargetSource
Returns:
true if the target is immutable
See Also:
TargetSource.getTarget()

releaseTarget

public void releaseTarget(Object target)
                   throws Exception
Description copied from interface: TargetSource
Release the given target object obtained from the TargetSource.getTarget() method.

Specified by:
releaseTarget in interface TargetSource
Parameters:
target - object obtained from a call to TargetSource.getTarget()
Throws:
Exception - if the object can't be released

copyFrom

protected void copyFrom(AbstractBeanFactoryBasedTargetSource other)
Copy configuration from the other AbstractBeanFactoryBasedTargetSource object. Subclasses should override this if they wish to expose it.

Parameters:
other - object to copy configuration from

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractLazyCreationTargetSource

org.springframework.aop.target
Class AbstractLazyCreationTargetSource

java.lang.Object
    extended by  org.springframework.aop.target.AbstractLazyCreationTargetSource
All Implemented Interfaces:
TargetClassAware, TargetSource
public abstract class AbstractLazyCreationTargetSource
extends Object
implements TargetSource

TargetSource implementation that will lazily create a user-managed object.

Creation of the lazy target object is controlled by the user by implementing the createObject() method. This TargetSource will invoke this method the first time the proxy is accessed.

Useful when you need to pass a reference to some dependency to an object but you don't actually want the dependency to be created until it is first used. A typical scenario for this is a connection to a remote resource.

Since:
1.2.4
Author:
Rob Harrop, Juergen Hoeller
See Also:
isInitialized(), createObject()

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
AbstractLazyCreationTargetSource()
Method Summary
protected abstract  Object createObject()
Subclasses should implement this method to return the lazy initialized object.
 Object getTarget()
Returns the lazy-initialized target object, creating it on-the-fly if it doesn't exist already.
 Class getTargetClass()
This default implementation returns null if the target is null (it is hasn't yet been initialized), or the target class if the target has already been initialized.
 boolean isInitialized()
Return whether the lazy target object of this TargetSource has already been fetched.
 boolean isStatic()
Will all calls to TargetSource.getTarget() return the same object?
 void releaseTarget(Object target)
Release the given target object obtained from the TargetSource.getTarget() method.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

AbstractLazyCreationTargetSource

public AbstractLazyCreationTargetSource()
Method Detail

isInitialized

public boolean isInitialized()
Return whether the lazy target object of this TargetSource has already been fetched.

getTargetClass

public Class getTargetClass()
This default implementation returns null if the target is null (it is hasn't yet been initialized), or the target class if the target has already been initialized.

Subclasses may wish to override this method in order to provide a meaningful value when the target is still null.

Specified by:
getTargetClass in interface TargetClassAware
Specified by:
getTargetClass in interface TargetSource
Returns:
the type of targets returned by this TargetSource
See Also:
isInitialized()

isStatic

public boolean isStatic()
Description copied from interface: TargetSource
Will all calls to TargetSource.getTarget() return the same object?

In that case, there will be no need to invoke TargetSource.releaseTarget(Object), and the AOP framework can cache the return value of TargetSource.getTarget().

Specified by:
isStatic in interface TargetSource
Returns:
true if the target is immutable
See Also:
TargetSource.getTarget()

getTarget

public Object getTarget()
                 throws Exception
Returns the lazy-initialized target object, creating it on-the-fly if it doesn't exist already.

Specified by:
getTarget in interface TargetSource
Returns:
the target object, which contains the joinpoint
Throws:
Exception - if the target object can't be resolved
See Also:
createObject()

releaseTarget

public void releaseTarget(Object target)
                   throws Exception
Description copied from interface: TargetSource
Release the given target object obtained from the TargetSource.getTarget() method.

Specified by:
releaseTarget in interface TargetSource
Parameters:
target - object obtained from a call to TargetSource.getTarget()
Throws:
Exception - if the object can't be released

createObject

protected abstract Object createObject()
                                throws Exception
Subclasses should implement this method to return the lazy initialized object. Called the first time the proxy is invoked.

Returns:
the created object
Throws:
Exception - if creation failed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractPoolingTargetSource

org.springframework.aop.target
Class AbstractPoolingTargetSource

java.lang.Object
    extended by  org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
        extended by  org.springframework.aop.target.AbstractPrototypeBasedTargetSource
            extended by  org.springframework.aop.target.AbstractPoolingTargetSource
All Implemented Interfaces:
Serializable, PoolingConfig, TargetClassAware, TargetSource, BeanFactoryAware, DisposableBean
Direct Known Subclasses:
CommonsPoolTargetSource
public abstract class AbstractPoolingTargetSource
extends AbstractPrototypeBasedTargetSource
implements PoolingConfig, DisposableBean

Abstract base class for pooling TargetSource implementations which maintain a pool of target instances, acquiring and releasing a target object from the pool for each method invocation. This abstract base class is independent of concrete pooling technology; see the subclass CommonsPoolTargetSource for a concrete example.

Subclasses must implement the getTarget() and releaseTarget(java.lang.Object) methods based on their chosen object pool. The AbstractPrototypeBasedTargetSource.newPrototypeInstance() method inherited from AbstractPrototypeBasedTargetSource can be used to create objects in order to put them into the pool.

Subclasses must also implement some of the monitoring methods from the PoolingConfig interface. The getPoolingConfigMixin() method makes these stats available on proxied objects through an IntroductionAdvisor.

This class implements the DisposableBean interface in order to force subclasses to implement a DisposableBean.destroy() method, closing down their object pool.

Author:
Rod Johnson, Juergen Hoeller
See Also:
getTarget(),
releaseTarget(java.lang.Object),
DisposableBean.destroy(),
Serialized Form

Field Summary
Fields inherited from class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
logger
Constructor Summary
AbstractPoolingTargetSource()
Method Summary
protected abstract void | createPool() Create the pool.
int | getMaxSize() Return the maximum size of the pool.
DefaultIntroductionAdvisor | getPoolingConfigMixin() Return an IntroductionAdvisor that providing a mixin exposing statistics about the pool maintained by this object.
abstract Object | getTarget() Acquire an object from the pool.
abstract void | releaseTarget(Object target) Return the given object to the pool.
void | setBeanFactory(BeanFactory beanFactory) Set the owning BeanFactory.
void | setMaxSize(int maxSize) Set the maximum size of the pool.
Methods inherited from class org.springframework.aop.target.AbstractPrototypeBasedTargetSource
destroyPrototypeInstance, newPrototypeInstance, writeReplace
Methods inherited from class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
copyFrom, equals, getBeanFactory, getTargetBeanName, getTargetClass, hashCode, isStatic, setTargetBeanName, setTargetClass, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.aop.target.PoolingConfig
getActiveCount, getIdleCount
Methods inherited from interface org.springframework.beans.factory.DisposableBean
destroy

Constructor Detail

AbstractPoolingTargetSource

public AbstractPoolingTargetSource()
Method Detail

setMaxSize

public void setMaxSize(int maxSize)
Set the maximum size of the pool. Default is -1, indicating no size limit.

getMaxSize

public int getMaxSize()
Return the maximum size of the pool.

Specified by:
getMaxSize in interface PoolingConfig

setBeanFactory

public final void setBeanFactory(BeanFactory beanFactory)
                          throws BeansException
Description copied from class: AbstractBeanFactoryBasedTargetSource
Set the owning BeanFactory. We need to save a reference so that we can use the getBean method on every invocation.

Specified by:
setBeanFactory in interface BeanFactoryAware
Overrides:
setBeanFactory in class AbstractPrototypeBasedTargetSource
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
Throws:
BeansException - in case of initialization errors
See Also:
BeanInitializationException

createPool

protected abstract void createPool()
                            throws Exception
Create the pool.

Throws:
Exception - to avoid placing constraints on pooling APIs

getTarget

public abstract Object getTarget()
                          throws Exception
Acquire an object from the pool.

Specified by:
getTarget in interface TargetSource
Returns:
an object from the pool
Throws:
Exception - we may need to deal with checked exceptions from pool APIs, so we're forgiving with our exception signature

releaseTarget

public abstract void releaseTarget(Object target)
                            throws Exception
Return the given object to the pool.

Specified by:
releaseTarget in interface TargetSource
Overrides:
releaseTarget in class AbstractBeanFactoryBasedTargetSource
Parameters:
target - object that must have been acquired from the pool via a call to getTarget()
Throws:
Exception - to allow pooling APIs to throw exception
See Also:
getTarget()

getPoolingConfigMixin

public DefaultIntroductionAdvisor getPoolingConfigMixin()
Return an IntroductionAdvisor that providing a mixin exposing statistics about the pool maintained by this object.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractPrototypeBasedTargetSource

org.springframework.aop.target
Class AbstractPrototypeBasedTargetSource

java.lang.Object
    extended by  org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
        extended by  org.springframework.aop.target.AbstractPrototypeBasedTargetSource
All Implemented Interfaces:
Serializable, TargetClassAware, TargetSource, BeanFactoryAware
Direct Known Subclasses:
AbstractPoolingTargetSource, PrototypeTargetSource, ThreadLocalTargetSource
public abstract class AbstractPrototypeBasedTargetSource
extends AbstractBeanFactoryBasedTargetSource

Base class for dynamic TargetSource implementations that create new prototype bean instances to support a pooling or new-instance-per-invocation strategy.

Such TargetSources must run in a BeanFactory, as it needs to call the getBean method to create a new prototype instance. Therefore, this base class extends AbstractBeanFactoryBasedTargetSource.

Author:
Rod Johnson, Juergen Hoeller
See Also:
BeanFactory.getBean(java.lang.String), PrototypeTargetSource, ThreadLocalTargetSource, CommonsPoolTargetSource, Serialized Form

Field Summary
Fields inherited from class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
logger
Constructor Summary
AbstractPrototypeBasedTargetSource()
Method Summary
protected void | destroyPrototypeInstance(Object target) Subclasses should call this method to destroy an obsolete prototype instance.
protected Object | newPrototypeInstance() Subclasses should call this method to create a new prototype instance.
void | setBeanFactory(BeanFactory beanFactory) Set the owning BeanFactory.
protected Object | writeReplace() Replaces this object with a SingletonTargetSource on serialization.
Methods inherited from class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
copyFrom, equals, getBeanFactory, getTargetBeanName, getTargetClass, hashCode, isStatic, releaseTarget, setTargetBeanName, setTargetClass, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.aop.TargetSource
getTarget

Constructor Detail

AbstractPrototypeBasedTargetSource

public AbstractPrototypeBasedTargetSource()
Method Detail

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
                    throws BeansException
Description copied from class: AbstractBeanFactoryBasedTargetSource
Set the owning BeanFactory. We need to save a reference so that we can use the getBean method on every invocation.

Specified by:
setBeanFactory in interface BeanFactoryAware
Overrides:
setBeanFactory in class AbstractBeanFactoryBasedTargetSource
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
Throws:
BeansException - in case of initialization errors
See Also:
BeanInitializationException

newPrototypeInstance

protected Object newPrototypeInstance()
                               throws BeansException
Subclasses should call this method to create a new prototype instance.

Throws:
BeansException - if bean creation failed

destroyPrototypeInstance

protected void destroyPrototypeInstance(Object target)
Subclasses should call this method to destroy an obsolete prototype instance.

Parameters:
target - the bean instance to destroy

writeReplace

protected Object writeReplace()
                       throws ObjectStreamException
Replaces this object with a SingletonTargetSource on serialization. Protected as otherwise it won't be invoked for subclasses. (The writeReplace() method must be visible to the class being serialized.)

With this implementation of this method, there is no need to mark non-serializable fields in this class or subclasses as transient.

Throws:
ObjectStreamException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CommonsPoolTargetSource

org.springframework.aop.target
Class CommonsPoolTargetSource

java.lang.Object
    extended by  org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
        extended by  org.springframework.aop.target.AbstractPrototypeBasedTargetSource
            extended by  org.springframework.aop.target.AbstractPoolingTargetSource
                extended by  org.springframework.aop.target.CommonsPoolTargetSource
All Implemented Interfaces:
Serializable, PoolableObjectFactory, PoolingConfig, TargetClassAware, TargetSource, BeanFactoryAware, DisposableBean
public class CommonsPoolTargetSource
extends AbstractPoolingTargetSource
implements PoolableObjectFactory

TargetSource implementation that holds objects in a configurable Jakarta Commons Pool.

By default, an instance of GenericObjectPool is created. Subclasses may change the type of ObjectPool used by overriding the createObjectPool() method.

Provides many configuration properties mirroring those of the Commons Pool GenericObjectPool class; these properties are passed to the GenericObjectPool during construction. If creating a subclass of this class to change the ObjectPool implementation type, pass in the values of configuration properties that are relevant to your chosen implementation.

The testOnBorrow, testOnReturn and testWhileIdle properties are explictly not mirrored because the implementation of PoolableObjectFactory used by this class does not implement meaningful validation. All exposed Commons Pool properties use the corresponding Commons Pool defaults: for example,

Author:
Rod Johnson, Rob Harrop, Juergen Hoeller
See Also:
GenericObjectPool, createObjectPool(), AbstractPoolingTargetSource.setMaxSize(int), setMaxIdle(int), setMinIdle(int), setMaxWait(long), setTimeBetweenEvictionRunsMillis(long), setMinEvictableIdleTimeMillis(long), Serialized Form

Field Summary
Fields inherited from class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
logger
Constructor Summary
CommonsPoolTargetSource()
Create a CommonsPoolTargetSource with default settings.
Method Summary
void | activateObject(Object obj)
protected ObjectPool | createObjectPool() Subclasses can override this if they want to return a specific Commons pool.
protected void | createPool() Creates and holds an ObjectPool instance.
void | destroy() Closes the underlying ObjectPool when destroying this object.
void | destroyObject(Object obj)
int | getActiveCount() Return the number of active objects in the pool.
int | getIdleCount() Return the number of idle objects in the pool.
int | getMaxIdle() Return the maximum number of idle objects in the pool.
long | getMaxWait() Return the maximum waiting time for fetching an object from the pool.
long | getMinEvictableIdleTimeMillis() Return the minimum time that an idle object can sit in the pool.
int | getMinIdle() Return the minimum number of idle objects in the pool.
Object | getTarget() Borrow an object from the ObjectPool.
long | getTimeBetweenEvictionRunsMillis() Return the time between eviction runs that check idle objects.
byte | getWhenExhaustedAction() Return the action to take when the pool is exhausted.
Object | makeObject()
void | passivateObject(Object obj)
void | releaseTarget(Object target) Returns the specified object to the underlying ObjectPool.
void | setMaxIdle(int maxIdle) Set the maximum number of idle objects in the pool.
void | setMaxWait(long maxWait) Set the maximum waiting time for fetching an object from the pool.
void | setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis) Set the minimum time that an idle object can sit in the pool before it becomes subject to eviction.
void | setMinIdle(int minIdle) Set the minimum number of idle objects in the pool.
void | setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis) Set the time between eviction runs that check idle objects whether they have been idle for too long or have become invalid.
void | setWhenExhaustedAction(byte whenExhaustedAction) Set the action to take when the pool is exhausted.
void | setWhenExhaustedActionName(String whenExhaustedActionName) Set the action to take when the pool is exhausted.
boolean | validateObject(Object obj)
Methods inherited from class org.springframework.aop.target.AbstractPoolingTargetSource
getMaxSize, getPoolingConfigMixin, setBeanFactory, setMaxSize
Methods inherited from class org.springframework.aop.target.AbstractPrototypeBasedTargetSource
destroyPrototypeInstance, newPrototypeInstance, writeReplace
Methods inherited from class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
copyFrom, equals, getBeanFactory, getTargetBeanName, getTargetClass, hashCode, isStatic, setTargetBeanName, setTargetClass, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

CommonsPoolTargetSource

public CommonsPoolTargetSource()
Create a CommonsPoolTargetSource with default settings. Default maximum size of the pool is 8.

See Also:
AbstractPoolingTargetSource.setMaxSize(int), GenericObjectPool.setMaxActive(int)
Method Detail

setMaxIdle

public void setMaxIdle(int maxIdle)
Set the maximum number of idle objects in the pool. Default is 8.

See Also:
GenericObjectPool.setMaxIdle(int)

getMaxIdle

public int getMaxIdle()
Return the maximum number of idle objects in the pool.

setMinIdle

public void setMinIdle(int minIdle)
Set the minimum number of idle objects in the pool. Default is 0.

See Also:
GenericObjectPool.setMinIdle(int)

getMinIdle

public int getMinIdle()
Return the minimum number of idle objects in the pool.

setMaxWait

public void setMaxWait(long maxWait)
Set the maximum waiting time for fetching an object from the pool. Default is -1, waiting forever.

See Also:
GenericObjectPool.setMaxWait(long)

getMaxWait

public long getMaxWait()
Return the maximum waiting time for fetching an object from the pool.

setTimeBetweenEvictionRunsMillis

public void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis)
Set the time between eviction runs that check idle objects whether they have been idle for too long or have become invalid. Default is -1, not performing any eviction.

See Also:
GenericObjectPool.setTimeBetweenEvictionRunsMillis(long)

getTimeBetweenEvictionRunsMillis

public long getTimeBetweenEvictionRunsMillis()
Return the time between eviction runs that check idle objects.

setMinEvictableIdleTimeMillis

public void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis)
Set the minimum time that an idle object can sit in the pool before it becomes subject to eviction. Default is 1800000 (30 minutes).

Note that eviction runs need to be performed to take this setting into effect.

See Also:
setTimeBetweenEvictionRunsMillis(long), GenericObjectPool.setMinEvictableIdleTimeMillis(long)

getMinEvictableIdleTimeMillis

public long getMinEvictableIdleTimeMillis()
Return the minimum time that an idle object can sit in the pool.

setWhenExhaustedActionName

public void setWhenExhaustedActionName(String whenExhaustedActionName)
Set the action to take when the pool is exhausted. Uses the constant names defined in Commons Pool's GenericObjectPool class: "WHEN_EXHAUSTED_BLOCK", "WHEN_EXHAUSTED_FAIL", "WHEN_EXHAUSTED_GROW".

See Also:
setWhenExhaustedAction(byte)

setWhenExhaustedAction

public void setWhenExhaustedAction(byte whenExhaustedAction)
Set the action to take when the pool is exhausted. Uses the constant values defined in Commons Pool's GenericObjectPool class.

See Also:
GenericObjectPool.setWhenExhaustedAction(byte), GenericObjectPool.WHEN_EXHAUSTED_BLOCK, GenericObjectPool.WHEN_EXHAUSTED_FAIL, GenericObjectPool.WHEN_EXHAUSTED_GROW

getWhenExhaustedAction

public byte getWhenExhaustedAction()
Return the action to take when the pool is exhausted.

createPool

protected final void createPool()
Creates and holds an ObjectPool instance.

Specified by:
createPool in class AbstractPoolingTargetSource
See Also:
createObjectPool()

createObjectPool

protected ObjectPool createObjectPool()
Subclasses can override this if they want to return a specific Commons pool. They should apply any configuration properties to the pool here.

Default is a GenericObjectPool instance with the given pool size.

Returns:
an empty Commons ObjectPool.
See Also:
GenericObjectPool, AbstractPoolingTargetSource.setMaxSize(int)

getTarget

public Object getTarget()
                 throws Exception
Borrow an object from the ObjectPool.

Specified by:
getTarget in interface TargetSource
Specified by:
getTarget in class AbstractPoolingTargetSource
Returns:
an object from the pool
Throws:
Exception - we may need to deal with checked exceptions from pool APIs, so we're forgiving with our exception signature

releaseTarget

public void releaseTarget(Object target)
                   throws Exception
Returns the specified object to the underlying ObjectPool.

Specified by:
releaseTarget in interface TargetSource
Specified by:
releaseTarget in class AbstractPoolingTargetSource
Parameters:
target - object that must have been acquired from the pool via a call to getTarget()
Throws:
Exception - to allow pooling APIs to throw exception
See Also:
AbstractPoolingTargetSource.getTarget()

getActiveCount

public int getActiveCount()
                   throws UnsupportedOperationException
Description copied from interface: PoolingConfig
Return the number of active objects in the pool.

Specified by:
getActiveCount in interface PoolingConfig
Throws:
UnsupportedOperationException - if not supported by the pool

getIdleCount

public int getIdleCount()
                 throws UnsupportedOperationException
Description copied from interface: PoolingConfig
Return the number of idle objects in the pool.

Specified by:
getIdleCount in interface PoolingConfig
Throws:
UnsupportedOperationException - if not supported by the pool

destroy

public void destroy()
             throws Exception
Closes the underlying ObjectPool when destroying this object.

Specified by:
destroy in interface DisposableBean
Throws:
Exception - in case of shutdown errors. Exceptions will get logged but not rethrown to allow other beans to release their resources too.

makeObject

public Object makeObject()
                  throws BeansException
Specified by:
makeObject in interface PoolableObjectFactory
Throws:
BeansException

destroyObject

public void destroyObject(Object obj)
                   throws Exception
Specified by:
destroyObject in interface PoolableObjectFactory
Throws:
Exception

validateObject

public boolean validateObject(Object obj)
Specified by:
validateObject in interface PoolableObjectFactory

activateObject

public void activateObject(Object obj)
Specified by:
activateObject in interface PoolableObjectFactory

passivateObject

public void passivateObject(Object obj)
Specified by:
passivateObject in interface PoolableObjectFactory
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EmptyTargetSource

org.springframework.aop.target
Class EmptyTargetSource

java.lang.Object
    extended by  org.springframework.aop.target.EmptyTargetSource
All Implemented Interfaces:
Serializable, TargetClassAware, TargetSource
public class EmptyTargetSource
extends Object
implements TargetSource, Serializable

Canonical TargetSource when there is no target (or just the target class known), and behavior is supplied by interfaces and advisors only.

Author:
Rod Johnson, Juergen Hoeller
See Also:
Serialized Form

Field Summary
static EmptyTargetSource INSTANCE
The canonical (Singleton) instance of this EmptyTargetSource.
Method Summary
boolean | equals(Object other)
static EmptyTargetSource | forClass(Class targetClass) Return an EmptyTargetSource for the given target Class.
static EmptyTargetSource | forClass(Class targetClass, boolean isStatic) Return an EmptyTargetSource for the given target Class.
Object | getTarget() Always returns null.
Class | getTargetClass() Always returns the specified target Class, or null if none.
int | hashCode()
boolean | isStatic() Always returns true.
void | releaseTarget(Object target) Nothing to release.
String | toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail

INSTANCE

public static final EmptyTargetSource INSTANCE
The canonical (Singleton) instance of this EmptyTargetSource.

Method Detail

forClass

public static EmptyTargetSource forClass(Class targetClass)
Return an EmptyTargetSource for the given target Class.

Parameters:
targetClass - the target Class (may be null)
See Also:
getTargetClass()

forClass

public static EmptyTargetSource forClass(Class targetClass,
                                         boolean isStatic)
Return an EmptyTargetSource for the given target Class.

Parameters:
targetClass - the target Class (may be null)
isStatic - whether the TargetSource should be marked as static
See Also:
getTargetClass()

getTargetClass

public Class getTargetClass()
Always returns the specified target Class, or null if none.

Specified by:
getTargetClass in interface TargetClassAware
Specified by:
getTargetClass in interface TargetSource
Returns:
the type of targets returned by this TargetSource

isStatic

public boolean isStatic()
Always returns true.

Specified by:
isStatic in interface TargetSource
Returns:
true if the target is immutable
See Also:
TargetSource.getTarget()

getTarget

public Object getTarget()
Always returns null.

Specified by:
getTarget in interface TargetSource
Returns:
the target object, which contains the joinpoint

releaseTarget

public void releaseTarget(Object target)
Nothing to release.

Specified by:
releaseTarget in interface TargetSource
Parameters:
target - object obtained from a call to TargetSource.getTarget()

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HotSwappableTargetSource

org.springframework.aop.target
Class HotSwappableTargetSource

java.lang.Object
    extended by  org.springframework.aop.target.HotSwappableTargetSource
All Implemented Interfaces:
Serializable, TargetClassAware, TargetSource
public class HotSwappableTargetSource
extends Object
implements TargetSource, Serializable

TargetSource implementation that caches a local target object, but allows the target to be swapped while the application is running.

If configuring an object of this class in a Spring IoC container, use constructor injection.

This TargetSource is serializable if the target is at the time of serialization.

Author:
Rod Johnson, Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
HotSwappableTargetSource(Object initialTarget)
Create a new HotSwappableTargetSource with the given initial target object.
Method Summary
 boolean equals(Object other)
Two HotSwappableTargetSources are equal if the current target objects are equal.
 Object getTarget()
Return a target instance.
 Class getTargetClass()
Return the type of the current target object.
 int hashCode()
 boolean isStatic()
Will all calls to TargetSource.getTarget() return the same object?
 void releaseTarget(Object target)
Release the given target object obtained from the TargetSource.getTarget() method.
 Object swap(Object newTarget)
Swap the target, returning the old target object.
 String toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

HotSwappableTargetSource

public HotSwappableTargetSource(Object initialTarget)
Create a new HotSwappableTargetSource with the given initial target object.

Parameters:
initialTarget - the initial target object
Method Detail

getTargetClass

public Class getTargetClass()
Return the type of the current target object.

The returned type should usually be constant across all target objects.

Specified by:
getTargetClass in interface TargetClassAware
Specified by:
getTargetClass in interface TargetSource
Returns:
the type of targets returned by this TargetSource

isStatic

public final boolean isStatic()
Description copied from interface: TargetSource
Will all calls to TargetSource.getTarget() return the same object?

In that case, there will be no need to invoke TargetSource.releaseTarget(Object), and the AOP framework can cache the return value of TargetSource.getTarget().

Specified by:
isStatic in interface TargetSource
Returns:
true if the target is immutable
See Also:
TargetSource.getTarget()

getTarget

public Object getTarget()
Description copied from interface: TargetSource
Return a target instance. Invoked immediately before the AOP framework calls the "target" of an AOP method invocation.

Specified by:
getTarget in interface TargetSource
Returns:
the target object, which contains the joinpoint

releaseTarget

public void releaseTarget(Object target)
Description copied from interface: TargetSource
Release the given target object obtained from the TargetSource.getTarget() method.

Specified by:
releaseTarget in interface TargetSource
Parameters:
target - object obtained from a call to TargetSource.getTarget()

swap

public Object swap(Object newTarget)
            throws IllegalArgumentException
Swap the target, returning the old target object.

Parameters:
newTarget - the new target object
Returns:
the old target object
Throws:
IllegalArgumentException - if the new target is invalid

equals

public boolean equals(Object other)
Two HotSwappableTargetSources are equal if the current target objects are equal.

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LazyInitTargetSource

org.springframework.aop.target
Class LazyInitTargetSource

java.lang.Object
    extended by  org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
        extended by  org.springframework.aop.target.LazyInitTargetSource
All Implemented Interfaces:
Serializable, TargetClassAware, TargetSource, BeanFactoryAware
public class LazyInitTargetSource
extends AbstractBeanFactoryBasedTargetSource

TargetSource that lazily accesses a singleton bean from a BeanFactory.

Useful when a proxy reference is needed on initialization but the actual target object should not be initialized until first use. When the target bean is defined in an ApplicationContext (or a BeanFactory that is eagerly pre-instantiating singleton beans) it must be marked as "lazy-init" too, else it will be instantiated by said ApplicationContext (or BeanFactory) on startup.

For example:

 <bean id="serviceTarget" class="example.MyService" lazy-init="true">
   ...
 </bean>

 <bean id="service" class="org.springframework.aop.framework.ProxyFactoryBean">
   <property name="targetSource">
     <bean class="org.springframework.aop.target.LazyInitTargetSource">
       <property name="targetBeanName"><idref local="serviceTarget"/></property>
     </bean>
   </property>
 </bean>
The "serviceTarget" bean will not get initialized until a method on the "service" proxy gets invoked.

Subclasses can extend this class and override the postProcessTargetObject(Object) to perform some additional processing with the target object when it is first loaded.

Since:
1.1.4
Author:
Juergen Hoeller, Rob Harrop
See Also:
BeanFactory.getBean(java.lang.String), postProcessTargetObject(java.lang.Object), Serialized Form

Field Summary
Fields inherited from class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
logger
Constructor Summary
LazyInitTargetSource()
Method Summary
Object | getTarget() Return a target instance.
protected void | postProcessTargetObject(Object targetObject) Subclasses may override this method to perform additional processing on the target object when it is first loaded.
Methods inherited from class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
copyFrom, equals, getBeanFactory, getTargetBeanName, getTargetClass, hashCode, isStatic, releaseTarget, setBeanFactory, setTargetBeanName, setTargetClass, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

LazyInitTargetSource

public LazyInitTargetSource()
Method Detail

getTarget

public Object getTarget()
                 throws BeansException
Description copied from interface: TargetSource
Return a target instance. Invoked immediately before the AOP framework calls the "target" of an AOP method invocation.

Returns:
the target object, which contains the joinpoint
Throws:
BeansException

postProcessTargetObject

protected void postProcessTargetObject(Object targetObject)
Subclasses may override this method to perform additional processing on the target object when it is first loaded.

Parameters:
targetObject - the target object that has just been instantiated (and configured)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PrototypeTargetSource

org.springframework.aop.target
Class PrototypeTargetSource

java.lang.Object
    extended by  org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
        extended by  org.springframework.aop.target.AbstractPrototypeBasedTargetSource
            extended by  org.springframework.aop.target.PrototypeTargetSource
All Implemented Interfaces:
Serializable, TargetClassAware, TargetSource, BeanFactoryAware
public class PrototypeTargetSource
extends AbstractPrototypeBasedTargetSource

TargetSource that creates a new instance of the target bean for each request, destroying each instance on release (after each request). Obtains bean instances from its containing BeanFactory.

Author:
Rod Johnson, Juergen Hoeller
See Also:
AbstractPrototypeBasedTargetSource.setBeanFactory(org.springframework.beans.factory.BeanFactory), AbstractBeanFactoryBasedTargetSource.setTargetBeanName(java.lang.String), Serialized Form

Field Summary
Fields inherited from class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
logger
Constructor Summary
PrototypeTargetSource()
Method Summary
Object | getTarget() Obtain a new prototype instance for every call.
void | releaseTarget(Object target) Destroy the given independent instance.
String | toString()
Methods inherited from class org.springframework.aop.target.AbstractPrototypeBasedTargetSource
destroyPrototypeInstance, newPrototypeInstance, setBeanFactory, writeReplace
Methods inherited from class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
copyFrom, equals, getBeanFactory, getTargetBeanName, getTargetClass, hashCode, isStatic, setTargetBeanName, setTargetClass
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

PrototypeTargetSource

public PrototypeTargetSource()
Method Detail

getTarget

public Object getTarget()
                 throws BeansException
Obtain a new prototype instance for every call.

Returns:
the target object, which contains the joinpoint
Throws:
BeansException
See Also:
AbstractPrototypeBasedTargetSource.newPrototypeInstance()

releaseTarget

public void releaseTarget(Object target)
Destroy the given independent instance.

Specified by:
releaseTarget in interface TargetSource
Overrides:
releaseTarget in class AbstractBeanFactoryBasedTargetSource
Parameters:
target - object obtained from a call to TargetSource.getTarget()
See Also:
AbstractPrototypeBasedTargetSource.destroyPrototypeInstance(java.lang.Object)

toString

public String toString()
Overrides:
toString in class AbstractBeanFactoryBasedTargetSource
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleBeanTargetSource

org.springframework.aop.target
Class SimpleBeanTargetSource

java.lang.Object
    extended by  org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
        extended by  org.springframework.aop.target.SimpleBeanTargetSource
All Implemented Interfaces:
Serializable, TargetClassAware, TargetSource, BeanFactoryAware
public class SimpleBeanTargetSource
extends AbstractBeanFactoryBasedTargetSource

Simple TargetSource implementation, freshly obtaining the specified target bean from its containing Spring BeanFactory.

Can obtain any kind of target bean: singleton, scoped, or prototype. Typically used for scoped beans.

Since:
2.0.3
Author:
Juergen Hoeller
See Also:
Serialized Form

Field Summary
Fields inherited from class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
logger
Constructor Summary
SimpleBeanTargetSource()
Method Summary
 Object getTarget()
Return a target instance.
Methods inherited from class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
copyFrom, equals, getBeanFactory, getTargetBeanName, getTargetClass, hashCode, isStatic, releaseTarget, setBeanFactory, setTargetBeanName, setTargetClass, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

SimpleBeanTargetSource

public SimpleBeanTargetSource()
Method Detail

getTarget

public Object getTarget()
                 throws Exception
Description copied from interface: TargetSource
Return a target instance. Invoked immediately before the AOP framework calls the "target" of an AOP method invocation.

Returns:
the target object, which contains the joinpoint
Throws:
Exception - if the target object can't be resolved
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SingletonTargetSource

org.springframework.aop.target
Class SingletonTargetSource

java.lang.Object
    extended by  org.springframework.aop.target.SingletonTargetSource
All Implemented Interfaces:
Serializable, TargetClassAware, TargetSource
public class SingletonTargetSource
extends Object
implements TargetSource, Serializable

Implementation of the TargetSource interface that holds a given object. This is the default implementation of the TargetSource interface, as used by the Spring AOP framework. There is usually no need to create objects of this class in application code.

This class is serializable. However, the actual serializability of a SingletonTargetSource will depend on whether the target is serializable.

Author:
Rod Johnson, Juergen Hoeller
See Also:
AdvisedSupport.setTarget(Object), Serialized Form

Constructor Summary
SingletonTargetSource(Object target)
Create a new SingletonTargetSource for the given target.
Method Summary
 boolean equals(Object other)
Two invoker interceptors are equal if they have the same target or if the targets or the targets are equal.
 Object getTarget()
Return a target instance.
 Class getTargetClass()
Return the type of targets returned by this TargetSource.
 int hashCode()
SingletonTargetSource uses the hash code of the target object.
 boolean isStatic()
Will all calls to TargetSource.getTarget() return the same object?
 void releaseTarget(Object target)
Release the given target object obtained from the TargetSource.getTarget() method.
 String toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

SingletonTargetSource

public SingletonTargetSource(Object target)
Create a new SingletonTargetSource for the given target.

Parameters:
target - the target object
Method Detail

getTargetClass

public Class getTargetClass()
Description copied from interface: TargetSource
Return the type of targets returned by this TargetSource.

Can return null, although certain usages of a TargetSource might just work with a predetermined target class.

Specified by:
getTargetClass in interface TargetClassAware
Specified by:
getTargetClass in interface TargetSource
Returns:
the type of targets returned by this TargetSource

getTarget

public Object getTarget()
Description copied from interface: TargetSource
Return a target instance. Invoked immediately before the AOP framework calls the "target" of an AOP method invocation.

Specified by:
getTarget in interface TargetSource
Returns:
the target object, which contains the joinpoint

releaseTarget

public void releaseTarget(Object target)
Description copied from interface: TargetSource
Release the given target object obtained from the TargetSource.getTarget() method.

Specified by:
releaseTarget in interface TargetSource
Parameters:
target - object obtained from a call to TargetSource.getTarget()

isStatic

public boolean isStatic()
Description copied from interface: TargetSource
Will all calls to TargetSource.getTarget() return the same object?

In that case, there will be no need to invoke TargetSource.releaseTarget(Object), and the AOP framework can cache the return value of TargetSource.getTarget().

Specified by:
isStatic in interface TargetSource
Returns:
true if the target is immutable
See Also:
TargetSource.getTarget()

equals

public boolean equals(Object other)
Two invoker interceptors are equal if they have the same target or if the targets or the targets are equal.

Overrides:
equals in class Object

hashCode

public int hashCode()
SingletonTargetSource uses the hash code of the target object.

Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ThreadLocalTargetSource

org.springframework.aop.target
Class ThreadLocalTargetSource

java.lang.Object
    extended by  org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
        extended by  org.springframework.aop.target.AbstractPrototypeBasedTargetSource
            extended by  org.springframework.aop.target.ThreadLocalTargetSource
All Implemented Interfaces:
Serializable, ThreadLocalTargetSourceStats, TargetClassAware, TargetSource, BeanFactoryAware, DisposableBean
public class ThreadLocalTargetSource
extends AbstractPrototypeBasedTargetSource
implements ThreadLocalTargetSourceStats, DisposableBean

Alternative to an object pool. This TargetSource uses a threading model in which every thread has its own copy of the target. There's no contention for targets. Target object creation is kept to a minimum on the running server.

Application code is written as to a normal pool; callers can't assume they will be dealing with the same instance in invocations in different threads. However, state can be relied on during the operations of a single thread: for example, if one caller makes repeated calls on the AOP proxy.

Cleanup of thread-bound objects is performed on BeanFactory destruction, calling their DisposableBean.destroy() method if available. Be aware that many thread-bound objects can be around until the application actually shuts down.

Author:
Rod Johnson, Juergen Hoeller, Rob Harrop
See Also:
ThreadLocalTargetSourceStats, DisposableBean.destroy(), Serialized Form

Field Summary
Fields inherited from class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
logger
Constructor Summary
ThreadLocalTargetSource()
Method Summary
 void destroy()
Dispose of targets if necessary; clear ThreadLocal.
 int getHitCount()
Return the number of hits that were satisfied by a thread-bound object.
 int getInvocationCount()
Return the number of client invocations.
 int getObjectCount()
Return the number of thread-bound objects created.
 IntroductionAdvisor getStatsMixin()
Return an introduction advisor mixin that allows the AOP proxy to be cast to ThreadLocalInvokerStats.
 Object getTarget()
Implementation of abstract getTarget() method.
Methods inherited from class org.springframework.aop.target.AbstractPrototypeBasedTargetSource
destroyPrototypeInstance, newPrototypeInstance, setBeanFactory, writeReplace
Methods inherited from class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
copyFrom, equals, getBeanFactory, getTargetBeanName, getTargetClass, hashCode, isStatic, releaseTarget, setTargetBeanName, setTargetClass, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

ThreadLocalTargetSource

public ThreadLocalTargetSource()
Method Detail

getTarget

public Object getTarget()
                 throws BeansException
Implementation of abstract getTarget() method. We look for a target held in a ThreadLocal. If we don't find one, we create one and bind it to the thread. No synchronization is required.

Specified by:
getTarget in interface TargetSource
Returns:
the target object, which contains the joinpoint
Throws:
BeansException

destroy

public void destroy()
Dispose of targets if necessary; clear ThreadLocal.

Specified by:
destroy in interface DisposableBean
See Also:
AbstractPrototypeBasedTargetSource.destroyPrototypeInstance(java.lang.Object)

getInvocationCount

public int getInvocationCount()
Description copied from interface: ThreadLocalTargetSourceStats
Return the number of client invocations.

Specified by:
getInvocationCount in interface ThreadLocalTargetSourceStats

getHitCount

public int getHitCount()
Description copied from interface: ThreadLocalTargetSourceStats
Return the number of hits that were satisfied by a thread-bound object.

Specified by:
getHitCount in interface ThreadLocalTargetSourceStats

getObjectCount

public int getObjectCount()
Description copied from interface: ThreadLocalTargetSourceStats
Return the number of thread-bound objects created.

Specified by:
getObjectCount in interface ThreadLocalTargetSourceStats

getStatsMixin

public IntroductionAdvisor getStatsMixin()
Return an introduction advisor mixin that allows the AOP proxy to be cast to ThreadLocalInvokerStats.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.aop.target.dynamic

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.aop.target.dynamic

Support for AOP-based refreshing of target objects.

See:
Description

Interface Summary
Refreshable Interface to be implemented by dynamic target objects, which support reloading and optionally polling for updates.

Class Summary
AbstractRefreshableTargetSource | Abstract TargetSource implementation that wraps a refreshable target object.
BeanFactoryRefreshableTargetSource | Refreshable TargetSource that fetches fresh target beans from a BeanFactory.

Package org.springframework.aop.target.dynamic Description

Support for AOP-based refreshing of target objects.


org.springframework.aop.target.dynamic Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.aop.target.dynamic

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource (implements org.springframework.aop.target.dynamic.Refreshable, org.springframework.aop.TargetSource)
      • org.springframework.aop.target.dynamic.BeanFactoryRefreshableTargetSource

Interface Hierarchy

  • org.springframework.aop.target.dynamic.Refreshable


Refreshable

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.aop.target.dynamic
Interface Refreshable

All Known Implementing Classes:
AbstractRefreshableTargetSource, BeanFactoryRefreshableTargetSource, RefreshableScriptTargetSource
public interface Refreshable

Interface to be implemented by dynamic target objects, which support reloading and optionally polling for updates.

Since:
2.0
Author:
Rod Johnson, Rob Harrop

Method Summary
long | getLastRefreshTime() Return the last time an actual refresh happened (as timestamp).
long | getRefreshCount() Return the number of actual refreshes since startup.
void | refresh() Refresh the underlying target object.

Method Detail

refresh

void refresh()
Refresh the underlying target object.

getRefreshCount

long getRefreshCount()
Return the number of actual refreshes since startup.

getLastRefreshTime

long getLastRefreshTime()
Return the last time an actual refresh happened (as timestamp).

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractRefreshableTargetSource

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.aop.target.dynamic
Class AbstractRefreshableTargetSource

java.lang.Object
    extended by  org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource
All Implemented Interfaces:
Refreshable, TargetClassAware, TargetSource
Direct Known Subclasses:
BeanFactoryRefreshableTargetSource
public abstract class AbstractRefreshableTargetSource
extends Object
implements TargetSource, Refreshable

Abstract TargetSource implementation that wraps a refreshable target object. Subclasses can determine whether a refresh is required, and need to provide fresh target objects.

Implements the Refreshable interface in order to allow for explicit control over the refresh status.

Since:
2.0
Author:
Rod Johnson, Rob Harrop, Juergen Hoeller
See Also:
requiresRefresh(), freshTarget()

Field Summary
protected Log | logger Logger available to subclasses
protected Object | targetObject
Constructor Summary
AbstractRefreshableTargetSource()
Method Summary
protected abstract Object | freshTarget() Obtain a fresh target object.
long | getLastRefreshTime() Return the last time an actual refresh happened (as timestamp).
long | getRefreshCount() Return the number of actual refreshes since startup.
Object | getTarget() Return a target instance.
Class | getTargetClass() Return the type of targets returned by this TargetSource.
boolean | isStatic() Not static.
void | refresh() Refresh the underlying target object.
void | releaseTarget(Object object) No need to release target.
protected boolean | requiresRefresh() Determine whether a refresh is required.
void | setRefreshCheckDelay(long refreshCheckDelay) Set the delay between refresh checks, in milliseconds.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected Log logger
Logger available to subclasses

targetObject

protected Object targetObject
Constructor Detail

AbstractRefreshableTargetSource

public AbstractRefreshableTargetSource()
Method Detail

setRefreshCheckDelay

public void setRefreshCheckDelay(long refreshCheckDelay)
Set the delay between refresh checks, in milliseconds. Default is -1, indicating no refresh checks at all.

Note that an actual refresh will only happen when requiresRefresh() returns true.

getTargetClass

public Class getTargetClass()
Description copied from interface: TargetSource
Return the type of targets returned by this TargetSource.

Can return null, although certain usages of a TargetSource might just work with a predetermined target class.

Specified by:
getTargetClass in interface TargetClassAware
Specified by:
getTargetClass in interface TargetSource
Returns:
the type of targets returned by this TargetSource

isStatic

public boolean isStatic()
Not static.

Specified by:
isStatic in interface TargetSource
Returns:
true if the target is immutable
See Also:
TargetSource.getTarget()

getTarget

public final Object getTarget()
Description copied from interface: TargetSource
Return a target instance. Invoked immediately before the AOP framework calls the "target" of an AOP method invocation.

Specified by:
getTarget in interface TargetSource
Returns:
the target object, which contains the joinpoint

releaseTarget

public void releaseTarget(Object object)
No need to release target.

Specified by:
releaseTarget in interface TargetSource
Parameters:
object - object obtained from a call to TargetSource.getTarget()

refresh

public final void refresh()
Description copied from interface: Refreshable
Refresh the underlying target object.

Specified by:
refresh in interface Refreshable

getRefreshCount

public long getRefreshCount()
Description copied from interface: Refreshable
Return the number of actual refreshes since startup.

Specified by:
getRefreshCount in interface Refreshable

getLastRefreshTime

public long getLastRefreshTime()
Description copied from interface: Refreshable
Return the last time an actual refresh happened (as timestamp).

Specified by:
getLastRefreshTime in interface Refreshable

requiresRefresh

protected boolean requiresRefresh()
Determine whether a refresh is required. Invoked for each refresh check, after the refresh check delay has elapsed.

The default implementation always returns true, triggering a refresh every time the delay has elapsed. To be overridden by subclasses with an appropriate check of the underlying target resource.

Returns:
whether a refresh is required

freshTarget

protected abstract Object freshTarget()
Obtain a fresh target object.

Only invoked if a refresh check has found that a refresh is required (that is, requiresRefresh() has returned true).

Returns:
the fresh target object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


BeanFactoryRefreshableTargetSource

org.springframework.aop.target.dynamic
Class BeanFactoryRefreshableTargetSource

java.lang.Object
    extended by  org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource
        extended by  org.springframework.aop.target.dynamic.BeanFactoryRefreshableTargetSource
All Implemented Interfaces:
Refreshable, TargetClassAware, TargetSource
Direct Known Subclasses:
RefreshableScriptTargetSource
public class BeanFactoryRefreshableTargetSource
extends AbstractRefreshableTargetSource

Refreshable TargetSource that fetches fresh target beans from a BeanFactory.

Can be subclassed to override requiresRefresh() to suppress unnecessary refreshes. By default, a refresh will be performed every time the "refreshCheckDelay" has elapsed.

Since:
2.0
Author:
Rob Harrop, Rod Johnson, Juergen Hoeller, Mark Fisher
See Also:
BeanFactory, AbstractRefreshableTargetSource.requiresRefresh(), AbstractRefreshableTargetSource.setRefreshCheckDelay(long)

Field Summary
Fields inherited from class org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource
logger, targetObject
Constructor Summary
BeanFactoryRefreshableTargetSource(BeanFactory beanFactory, String beanName)
Create a new BeanFactoryRefreshableTargetSource for the given bean factory and bean name.
Method Summary
protected Object | freshTarget() Retrieve a fresh target object.
protected Object | obtainFreshBean(BeanFactory beanFactory, String beanName) A template method that subclasses may override to provide a fresh target object for the given bean factory and bean name.
Methods inherited from class org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource
getLastRefreshTime, getRefreshCount, getTarget, getTargetClass, isStatic, refresh, releaseTarget, requiresRefresh, setRefreshCheckDelay
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BeanFactoryRefreshableTargetSource

public BeanFactoryRefreshableTargetSource(BeanFactory beanFactory,
                                          String beanName)
Create a new BeanFactoryRefreshableTargetSource for the given bean factory and bean name.

Note that the passed-in BeanFactory should have an appropriate bean definition set up for the given bean name.

Parameters:
beanFactory - the BeanFactory to fetch beans from
beanName - the name of the target bean
Method Detail

freshTarget

protected final Object freshTarget()
Retrieve a fresh target object.

Specified by:
freshTarget in class AbstractRefreshableTargetSource
Returns:
the fresh target object

obtainFreshBean

protected Object obtainFreshBean(BeanFactory beanFactory,
                                 String beanName)
A template method that subclasses may override to provide a fresh target object for the given bean factory and bean name.

This default implementation fetches a new target bean instance from the bean factory.

See Also:
BeanFactory.getBean(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.beans

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.beans

This package contains interfaces and classes for manipulating Java beans.

See:
Description

Interface Summary
BeanMetadataElement | Interface to be implemented by bean metadata elements that carry a configuration source object.
BeanWrapper | The central interface of Spring's low-level JavaBeans infrastructure.
ConfigurablePropertyAccessor | Interface that encapsulates configuration methods for a PropertyAccessor.
Mergeable | Interface representing an object whose value set can be merged with that of a parent object.
PropertyAccessor | Common interface for classes that can access named properties (such as bean properties of an object or fields in an object) Serves as base interface for BeanWrapper.
PropertyEditorRegistrar | Interface for strategies that register custom property editors with a property editor registry.
PropertyEditorRegistry | Encapsulates methods for registering JavaBeans PropertyEditors.
PropertyValues | Holder containing one or more PropertyValue objects, typically comprising one update for a specific target bean.
TypeConverter | Interface that defines type conversion methods.

Class Summary
AbstractPropertyAccessor | Abstract implementation of the PropertyAccessor interface.
BeanMetadataAttribute | Holder for a key-value style attribute that is part of a bean definition.
BeanMetadataAttributeAccessor | Extension of AttributeAccessorSupport, holding attributes as BeanMetadataAttribute objects in order to keep track of the definition source.
BeanUtils | Static convenience methods for JavaBeans: for instantiating beans, checking bean property types, copying bean properties, etc.
BeanWrapperImpl | Default BeanWrapper implementation that should be sufficient for all typical use cases.
CachedIntrospectionResults | Internal class that caches JavaBeans PropertyDescriptor information for a Java class.
DirectFieldAccessor | PropertyAccessor implementation that directly accesses instance fields.
MutablePropertyValues | Default implementation of the PropertyValues interface.
PropertyAccessorFactory | Simple factory facade for obtaining PropertyAccessor instances, in particular for BeanWrapper instances.
PropertyAccessorUtils | Utility methods for classes that perform bean property access according to the PropertyAccessor interface.
PropertyEditorRegistrySupport | Base implementation of the PropertyEditorRegistry interface.
PropertyValue | Object to hold information and value for an individual bean property.
PropertyValuesEditor | Editor for a PropertyValues object.
SimpleTypeConverter | Simple implementation of the TypeConverter interface that does not operate on any specific target object.

Exception Summary
BeanInstantiationException | Exception thrown when instantiation of a bean failed.
BeansException | Abstract superclass for all exceptions thrown in the beans package and subpackages.
ConversionNotSupportedException | Exception thrown when no suitable editor or converter can be found for a bean property.
FatalBeanException | Thrown on an unrecoverable problem encountered in the beans packages or sub-packages, e.g.
InvalidPropertyException | Exception thrown when referring to an invalid bean property.
MethodInvocationException | Thrown when a bean property getter or setter method throws an exception, analogous to an InvocationTargetException.
NotReadablePropertyException | Exception thrown on an attempt to get the value of a property that isn't readable, because there's no getter method.
NotWritablePropertyException | Exception thrown on an attempt to set the value of a property that is not writable (typically because there is no setter method).
NullValueInNestedPathException | Exception thrown when navigation of a valid nested property path encounters a NullPointerException.
PropertyAccessException | Superclass for exceptions related to a property access, such as type mismatch or invocation target exception.
PropertyBatchUpdateException | Combined exception, composed of individual PropertyAccessException instances.
TypeMismatchException | Exception thrown on a type mismatch when trying to set a bean property.

Package org.springframework.beans Description

This package contains interfaces and classes for manipulating Java beans. It is used by most other Spring packages.

A BeanWrapper object may be used to set and get bean properties, singly or in bulk.

The classes in this package are discussed in Chapter 11 of Expert One-On-One J2EE Design and Development by Rod Johnson (Wrox, 2002).


org.springframework.beans Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.beans

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.core.AttributeAccessorSupport (implements org.springframework.core.AttributeAccessor, java.io.Serializable)
      • org.springframework.beans.BeanMetadataAttributeAccessor (implements org.springframework.beans.BeanMetadataElement)
        • org.springframework.beans.PropertyValue (implements java.io.Serializable)
    • org.springframework.beans.BeanMetadataAttribute (implements org.springframework.beans.BeanMetadataElement)
    • org.springframework.beans.BeanUtils
    • org.springframework.beans.CachedIntrospectionResults
    • org.springframework.beans.MutablePropertyValues (implements org.springframework.beans.PropertyValues, java.io.Serializable)
    • org.springframework.beans.PropertyAccessorFactory
    • org.springframework.beans.PropertyAccessorUtils
    • org.springframework.beans.PropertyEditorRegistrySupport (implements org.springframework.beans.PropertyEditorRegistry)
      • org.springframework.beans.AbstractPropertyAccessor (implements org.springframework.beans.ConfigurablePropertyAccessor)
        • org.springframework.beans.BeanWrapperImpl (implements org.springframework.beans.BeanWrapper)
        • org.springframework.beans.DirectFieldAccessor
      • org.springframework.beans.SimpleTypeConverter (implements org.springframework.beans.TypeConverter)
    • java.beans.PropertyEditorSupport (implements java.beans.PropertyEditor)
      • org.springframework.beans.PropertyValuesEditor
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.beans.BeansException
              • org.springframework.beans.FatalBeanException
                • org.springframework.beans.BeanInstantiationException
                • org.springframework.beans.InvalidPropertyException
                  • org.springframework.beans.NotReadablePropertyException
                  • org.springframework.beans.NotWritablePropertyException
                  • org.springframework.beans.NullValueInNestedPathException
              • org.springframework.beans.PropertyAccessException (implements org.springframework.core.ErrorCoded)
                • org.springframework.beans.MethodInvocationException
                • org.springframework.beans.TypeMismatchException
                  • org.springframework.beans.ConversionNotSupportedException
              • org.springframework.beans.PropertyBatchUpdateException

Interface Hierarchy

  • org.springframework.beans.BeanMetadataElement
  • org.springframework.beans.Mergeable
  • org.springframework.beans.PropertyAccessor
    • org.springframework.beans.ConfigurablePropertyAccessor (also extends org.springframework.beans.PropertyEditorRegistry, org.springframework.beans.TypeConverter)
      • org.springframework.beans.BeanWrapper
  • org.springframework.beans.PropertyEditorRegistrar
  • org.springframework.beans.PropertyEditorRegistry
    • org.springframework.beans.ConfigurablePropertyAccessor (also extends org.springframework.beans.PropertyAccessor, org.springframework.beans.TypeConverter)
      • org.springframework.beans.BeanWrapper
  • org.springframework.beans.PropertyValues
  • org.springframework.beans.TypeConverter
    • org.springframework.beans.ConfigurablePropertyAccessor (also extends org.springframework.beans.PropertyAccessor, org.springframework.beans.PropertyEditorRegistry)
      • org.springframework.beans.BeanWrapper


BeanMetadataElement

org.springframework.beans
Interface BeanMetadataElement

All Known Subinterfaces:
AnnotatedBeanDefinition, BeanDefinition, BeanReference, ComponentDefinition, DefaultsDefinition
All Known Implementing Classes:
AbstractBeanDefinition, AbstractComponentDefinition, AdvisorComponentDefinition, AliasDefinition, AnnotatedGenericBeanDefinition, AspectComponentDefinition, AutowireCandidateQualifier, BeanComponentDefinition, BeanDefinitionHolder, BeanMetadataAttribute, BeanMetadataAttributeAccessor, ChildBeanDefinition, CompositeComponentDefinition, ConstructorArgumentValues.ValueHolder, DocumentDefaultsDefinition, GenericBeanDefinition, ImportDefinition, LookupOverride, ManagedArray, ManagedList, ManagedMap, ManagedProperties, ManagedSet, MethodOverride, PointcutComponentDefinition, PropertyValue, ReplaceOverride, RootBeanDefinition, RuntimeBeanNameReference, RuntimeBeanReference, ScannedGenericBeanDefinition, TypedStringValue
public interface BeanMetadataElement

Interface to be implemented by bean metadata elements that carry a configuration source object.

Since:
2.0
Author:
Juergen Hoeller

Method Summary
 Object getSource()
Return the configuration source Object for this metadata element (may be null).

Method Detail

getSource

Object getSource()
Return the configuration source Object for this metadata element (may be null).

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanWrapper

org.springframework.beans
Interface BeanWrapper

All Superinterfaces:
ConfigurablePropertyAccessor, PropertyAccessor, PropertyEditorRegistry, TypeConverter
All Known Implementing Classes:
BeanWrapperImpl
public interface BeanWrapper
extends ConfigurablePropertyAccessor

The central interface of Spring's low-level JavaBeans infrastructure.

Typically not used directly but rather implicitly via a BeanFactory or a DataBinder.

Provides operations to analyze and manipulate standard JavaBeans: the ability to get and set property values (individually or in bulk), get property descriptors, and query the readability/writability of properties.

This interface supports nested properties enabling the setting of properties on subproperties to an unlimited depth.

A BeanWrapper's default for the "extractOldValueForEditor" setting is "false", to avoid side effects caused by getter method invocations. Turn this to "true" to expose present property values to custom editors.

Since:
13 April 2001
Author:
Rod Johnson, Juergen Hoeller
See Also:
PropertyAccessor, PropertyEditorRegistry, PropertyAccessorFactory.forBeanPropertyAccess(java.lang.Object), BeanFactory, BeanPropertyBindingResult, DataBinder.initBeanPropertyAccess()

Field Summary
Fields inherited from interface org.springframework.beans.PropertyAccessor
NESTED_PROPERTY_SEPARATOR, NESTED_PROPERTY_SEPARATOR_CHAR, PROPERTY_KEY_PREFIX, PROPERTY_KEY_PREFIX_CHAR, PROPERTY_KEY_SUFFIX, PROPERTY_KEY_SUFFIX_CHAR
Method Summary
PropertyDescriptor | getPropertyDescriptor(String propertyName) Obtain the property descriptor for a specific property of the wrapped object.
PropertyDescriptor[] | getPropertyDescriptors() Obtain the PropertyDescriptors for the wrapped object (as determined by standard JavaBeans introspection).
Class | getWrappedClass() Return the type of the wrapped JavaBean object.
Object | getWrappedInstance() Return the bean instance wrapped by this object, if any.
boolean | isAutoGrowNestedPaths() Return whether "auto-growing" of nested paths has been activated.
void | setAutoGrowNestedPaths(boolean autoGrowNestedPaths) Set whether this BeanWrapper should attempt to "auto-grow" a nested path that contains a null value.
Methods inherited from interface org.springframework.beans.ConfigurablePropertyAccessor
getConversionService, isExtractOldValueForEditor, setConversionService, setExtractOldValueForEditor
Methods inherited from interface org.springframework.beans.PropertyAccessor
getPropertyType, getPropertyTypeDescriptor, getPropertyValue, isReadableProperty, isWritableProperty, setPropertyValue, setPropertyValue, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues
Methods inherited from interface org.springframework.beans.PropertyEditorRegistry
findCustomEditor, registerCustomEditor, registerCustomEditor
Methods inherited from interface org.springframework.beans.TypeConverter
convertIfNecessary, convertIfNecessary

Method Detail

getWrappedInstance

Object getWrappedInstance()
Return the bean instance wrapped by this object, if any.

Returns:
the bean instance, or null if none set

getWrappedClass

Class getWrappedClass()
Return the type of the wrapped JavaBean object.

Returns:
the type of the wrapped bean instance, or null if no wrapped object has been set

getPropertyDescriptors

PropertyDescriptor[] getPropertyDescriptors()
Obtain the PropertyDescriptors for the wrapped object (as determined by standard JavaBeans introspection).

Returns:
the PropertyDescriptors for the wrapped object

getPropertyDescriptor

PropertyDescriptor getPropertyDescriptor(String propertyName)
                                         throws InvalidPropertyException
Obtain the property descriptor for a specific property of the wrapped object.

Parameters:
propertyName - the property to obtain the descriptor for (may be a nested path, but no indexed/mapped property)
Returns:
the property descriptor for the specified property
Throws:
InvalidPropertyException - if there is no such property

setAutoGrowNestedPaths

void setAutoGrowNestedPaths(boolean autoGrowNestedPaths)
Set whether this BeanWrapper should attempt to "auto-grow" a nested path that contains a null value.

If "true", a null path location will be populated with a default object value and traversed instead of resulting in a NullValueInNestedPathException. Turning this flag on also enables auto-growth of collection elements when accessing an out-of-bounds index.

Default is "false" on a plain BeanWrapper.

isAutoGrowNestedPaths

boolean isAutoGrowNestedPaths()
Return whether "auto-growing" of nested paths has been activated.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConfigurablePropertyAccessor

org.springframework.beans
Interface ConfigurablePropertyAccessor

All Superinterfaces:
PropertyAccessor, PropertyEditorRegistry, TypeConverter
All Known Subinterfaces:
BeanWrapper
All Known Implementing Classes:
AbstractPropertyAccessor, BeanWrapperImpl, DirectFieldAccessor
public interface ConfigurablePropertyAccessor
extends PropertyAccessor, PropertyEditorRegistry, TypeConverter

Interface that encapsulates configuration methods for a PropertyAccessor. Also extends the PropertyEditorRegistry interface, which defines methods for PropertyEditor management.

Serves as base interface for BeanWrapper.

Since:
2.0
Author:
Juergen Hoeller
See Also:
BeanWrapper

Field Summary
Fields inherited from interface org.springframework.beans.PropertyAccessor
NESTED_PROPERTY_SEPARATOR, NESTED_PROPERTY_SEPARATOR_CHAR, PROPERTY_KEY_PREFIX, PROPERTY_KEY_PREFIX_CHAR, PROPERTY_KEY_SUFFIX, PROPERTY_KEY_SUFFIX_CHAR
Method Summary
ConversionService | getConversionService() Return the associated ConversionService, if any.
boolean | isExtractOldValueForEditor() Return whether to extract the old property value when applying a property editor to a new value for a property.
void | setConversionService(ConversionService conversionService) Specify a Spring 3.0 ConversionService to use for converting property values, as an alternative to JavaBeans PropertyEditors.
void | setExtractOldValueForEditor(boolean extractOldValueForEditor) Set whether to extract the old property value when applying a property editor to a new value for a property.
Methods inherited from interface org.springframework.beans.PropertyAccessor
getPropertyType, getPropertyTypeDescriptor, getPropertyValue, isReadableProperty, isWritableProperty, setPropertyValue, setPropertyValue, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues
Methods inherited from interface org.springframework.beans.PropertyEditorRegistry
findCustomEditor, registerCustomEditor, registerCustomEditor
Methods inherited from interface org.springframework.beans.TypeConverter
convertIfNecessary, convertIfNecessary

Method Detail

setConversionService

void setConversionService(ConversionService conversionService)
Specify a Spring 3.0 ConversionService to use for converting property values, as an alternative to JavaBeans PropertyEditors.

getConversionService

ConversionService getConversionService()
Return the associated ConversionService, if any.

setExtractOldValueForEditor

void setExtractOldValueForEditor(boolean extractOldValueForEditor)
Set whether to extract the old property value when applying a property editor to a new value for a property.

isExtractOldValueForEditor

boolean isExtractOldValueForEditor()
Return whether to extract the old property value when applying a property editor to a new value for a property.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Mergeable

org.springframework.beans
Interface Mergeable

All Known Implementing Classes:
ManagedArray, ManagedList, ManagedMap, ManagedProperties, ManagedSet
public interface Mergeable

Interface representing an object whose value set can be merged with that of a parent object.

Since:
2.0
Author:
Rob Harrop
See Also:
ManagedSet, ManagedList, ManagedMap, ManagedProperties

Method Summary
boolean | isMergeEnabled() Is merging enabled for this particular instance?
Object | merge(Object parent) Merge the current value set with that of the supplied object.

Method Detail

isMergeEnabled

boolean isMergeEnabled()
Is merging enabled for this particular instance?

merge

Object merge(Object parent)
Merge the current value set with that of the supplied object.

The supplied object is considered the parent, and values in the callee's value set must override those of the supplied object.

Parameters:
parent - the object to merge with
Returns:
the result of the merge operation
Throws:
IllegalArgumentException - if the supplied parent is null
IllegalStateException - if merging is not enabled for this instance (i.e. mergeEnabled equals false).
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertyAccessor

org.springframework.beans
Interface PropertyAccessor

All Known Subinterfaces:
BeanWrapper, ConfigurablePropertyAccessor
All Known Implementing Classes:
AbstractPropertyAccessor, BeanWrapperImpl, DirectFieldAccessor
public interface PropertyAccessor

Common interface for classes that can access named properties (such as bean properties of an object or fields in an object) Serves as base interface for BeanWrapper.

Since:
1.1
Author:
Juergen Hoeller
See Also:
BeanWrapper, PropertyAccessorFactory.forBeanPropertyAccess(java.lang.Object), PropertyAccessorFactory.forDirectFieldAccess(java.lang.Object)

Field Summary
static String | NESTED_PROPERTY_SEPARATOR Path separator for nested properties.
static char | NESTED_PROPERTY_SEPARATOR_CHAR
static String | PROPERTY_KEY_PREFIX Marker that indicates the start of a property key for an indexed or mapped property like "person.addresses[0]".
static char | PROPERTY_KEY_PREFIX_CHAR
static String | PROPERTY_KEY_SUFFIX Marker that indicates the end of a property key for an indexed or mapped property like "person.addresses[0]".
static char | PROPERTY_KEY_SUFFIX_CHAR
Method Summary
Class | getPropertyType(String propertyName) Determine the property type for the specified property, either checking the property descriptor or checking the value in case of an indexed or mapped element.
TypeDescriptor | getPropertyTypeDescriptor(String propertyName) Return a type descriptor for the specified property: preferably from the read method, falling back to the write method.
Object | getPropertyValue(String propertyName) Get the current value of the specified property.
boolean | isReadableProperty(String propertyName) Determine whether the specified property is readable.
boolean | isWritableProperty(String propertyName) Determine whether the specified property is writable.
void | setPropertyValue(PropertyValue pv) Set the specified value as current property value.
void | setPropertyValue(String propertyName, Object value) Set the specified value as current property value.
void | setPropertyValues(Map<?,?> map) Perform a batch update from a Map.
void | setPropertyValues(PropertyValues pvs) The preferred way to perform a batch update.
void | setPropertyValues(PropertyValues pvs, boolean ignoreUnknown) Perform a batch update with more control over behavior.
void | setPropertyValues(PropertyValues pvs, boolean ignoreUnknown, boolean ignoreInvalid) Perform a batch update with full control over behavior.

Field Detail

NESTED_PROPERTY_SEPARATOR

static final String NESTED_PROPERTY_SEPARATOR
Path separator for nested properties. Follows normal Java conventions: getFoo().getBar() would be "foo.bar".

See Also:
Constant Field Values

NESTED_PROPERTY_SEPARATOR_CHAR

static final char NESTED_PROPERTY_SEPARATOR_CHAR
See Also:
Constant Field Values

PROPERTY_KEY_PREFIX

static final String PROPERTY_KEY_PREFIX
Marker that indicates the start of a property key for an indexed or mapped property like "person.addresses[0]".

See Also:
Constant Field Values

PROPERTY_KEY_PREFIX_CHAR

static final char PROPERTY_KEY_PREFIX_CHAR
See Also:
Constant Field Values

PROPERTY_KEY_SUFFIX

static final String PROPERTY_KEY_SUFFIX
Marker that indicates the end of a property key for an indexed or mapped property like "person.addresses[0]".

See Also:
Constant Field Values

PROPERTY_KEY_SUFFIX_CHAR

static final char PROPERTY_KEY_SUFFIX_CHAR
See Also:
Constant Field Values
Method Detail

isReadableProperty

boolean isReadableProperty(String propertyName)
Determine whether the specified property is readable.

Returns false if the property doesn't exist.

Parameters:
propertyName - the property to check (may be a nested path and/or an indexed/mapped property)
Returns:
whether the property is readable

isWritableProperty

boolean isWritableProperty(String propertyName)
Determine whether the specified property is writable.

Returns false if the property doesn't exist.

Parameters:
propertyName - the property to check (may be a nested path and/or an indexed/mapped property)
Returns:
whether the property is writable

getPropertyType

Class getPropertyType(String propertyName)
                      throws BeansException
Determine the property type for the specified property, either checking the property descriptor or checking the value in case of an indexed or mapped element.

Parameters:
propertyName - the property to check (may be a nested path and/or an indexed/mapped property)
Returns:
the property type for the particular property, or null if not determinable
Throws:
InvalidPropertyException - if there is no such property or if the property isn't readable
PropertyAccessException - if the property was valid but the accessor method failed
BeansException

getPropertyTypeDescriptor

TypeDescriptor getPropertyTypeDescriptor(String propertyName)
                                         throws BeansException
Return a type descriptor for the specified property: preferably from the read method, falling back to the write method.

Parameters:
propertyName - the property to check (may be a nested path and/or an indexed/mapped property)
Returns:
the property type for the particular property, or null if not determinable
Throws:
InvalidPropertyException - if there is no such property or if the property isn't readable
BeansException

getPropertyValue

Object getPropertyValue(String propertyName)
                        throws BeansException
Get the current value of the specified property.

Parameters:
propertyName - the name of the property to get the value of (may be a nested path and/or an indexed/mapped property)
Returns:
the value of the property
Throws:
InvalidPropertyException - if there is no such property or if the property isn't readable
PropertyAccessException - if the property was valid but the accessor method failed
BeansException

setPropertyValue

void setPropertyValue(String propertyName,
                      Object value)
                      throws BeansException
Set the specified value as current property value.

Parameters:
propertyName - the name of the property to set the value of (may be a nested path and/or an indexed/mapped property)
value - the new value
Throws:
InvalidPropertyException - if there is no such property or if the property isn't writable
PropertyAccessException - if the property was valid but the accessor method failed or a type mismatch occured
BeansException

setPropertyValue

void setPropertyValue(PropertyValue pv)
                      throws BeansException
Set the specified value as current property value.

Parameters:
pv - an object containing the new property value
Throws:
InvalidPropertyException - if there is no such property or if the property isn't writable
PropertyAccessException - if the property was valid but the accessor method failed or a type mismatch occured
BeansException

setPropertyValues

void setPropertyValues(Map<?,?> map)
                       throws BeansException
Perform a batch update from a Map.

Bulk updates from PropertyValues are more powerful: This method is provided for convenience. Behavior will be identical to that of the setPropertyValues(PropertyValues) method.

Parameters:
map - Map to take properties from. Contains property value objects, keyed by property name
Throws:
InvalidPropertyException - if there is no such property or if the property isn't writable
PropertyBatchUpdateException - if one or more PropertyAccessExceptions occured for specific properties during the batch update. This exception bundles all individual PropertyAccessExceptions. All other properties will have been successfully updated.
BeansException

setPropertyValues

void setPropertyValues(PropertyValues pvs)
                       throws BeansException
The preferred way to perform a batch update.

Note that performing a batch update differs from performing a single update, in that an implementation of this class will continue to update properties if a recoverable error (such as a type mismatch, but not an invalid field name or the like) is encountered, throwing a PropertyBatchUpdateException containing all the individual errors. This exception can be examined later to see all binding errors. Properties that were successfully updated remain changed.

Does not allow unknown fields or invalid fields.

Parameters:
pvs - PropertyValues to set on the target object
Throws:
InvalidPropertyException - if there is no such property or if the property isn't writable
PropertyBatchUpdateException - if one or more PropertyAccessExceptions occured for specific properties during the batch update. This exception bundles all individual PropertyAccessExceptions. All other properties will have been successfully updated.
BeansException
See Also:
setPropertyValues(PropertyValues, boolean, boolean)

setPropertyValues

void setPropertyValues(PropertyValues pvs,
                       boolean ignoreUnknown)
                       throws BeansException
Perform a batch update with more control over behavior.

Note that performing a batch update differs from performing a single update, in that an implementation of this class will continue to update properties if a recoverable error (such as a type mismatch, but not an invalid field name or the like) is encountered, throwing a PropertyBatchUpdateException containing all the individual errors. This exception can be examined later to see all binding errors. Properties that were successfully updated remain changed.

Parameters:
pvs - PropertyValues to set on the target object
ignoreUnknown - should we ignore unknown properties (not found in the bean)
Throws:
InvalidPropertyException - if there is no such property or if the property isn't writable
PropertyBatchUpdateException - if one or more PropertyAccessExceptions occured for specific properties during the batch update. This exception bundles all individual PropertyAccessExceptions. All other properties will have been successfully updated.
BeansException
See Also:
setPropertyValues(PropertyValues, boolean, boolean)

setPropertyValues

void setPropertyValues(PropertyValues pvs,
                       boolean ignoreUnknown,
                       boolean ignoreInvalid)
                       throws BeansException
Perform a batch update with full control over behavior.

Note that performing a batch update differs from performing a single update, in that an implementation of this class will continue to update properties if a recoverable error (such as a type mismatch, but not an invalid field name or the like) is encountered, throwing a PropertyBatchUpdateException containing all the individual errors. This exception can be examined later to see all binding errors. Properties that were successfully updated remain changed.

Parameters:
pvs - PropertyValues to set on the target object
ignoreUnknown - should we ignore unknown properties (not found in the bean)
ignoreInvalid - should we ignore invalid properties (found but not accessible)
Throws:
InvalidPropertyException - if there is no such property or if the property isn't writable
PropertyBatchUpdateException - if one or more PropertyAccessExceptions occured for specific properties during the batch update. This exception bundles all individual PropertyAccessExceptions. All other properties will have been successfully updated.
BeansException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertyEditorRegistrar

org.springframework.beans
Interface PropertyEditorRegistrar

All Known Implementing Classes:
ResourceEditorRegistrar
public interface PropertyEditorRegistrar

Interface for strategies that register custom property editors with a property editor registry.

This is particularly useful when you need to use the same set of property editors in several different situations: write a corresponding registrar and reuse that in each case.

Since:
1.2.6
Author:
Juergen Hoeller
See Also:
PropertyEditorRegistry, PropertyEditor

Method Summary
 void registerCustomEditors(PropertyEditorRegistry registry)
Register custom PropertyEditors with the given PropertyEditorRegistry.

Method Detail

registerCustomEditors

void registerCustomEditors(PropertyEditorRegistry registry)
Register custom PropertyEditors with the given PropertyEditorRegistry.

The passed-in registry will usually be a BeanWrapper or a DataBinder.

It is expected that implementations will create brand new PropertyEditors instances for each invocation of this method (since PropertyEditors are not threadsafe).

Parameters:
registry - the PropertyEditorRegistry to register the custom PropertyEditors with
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertyEditorRegistry

org.springframework.beans
Interface PropertyEditorRegistry

All Known Subinterfaces:
BeanWrapper, ConfigurablePropertyAccessor
All Known Implementing Classes:
AbstractPropertyAccessor, BeanWrapperImpl, DataBinder, DirectFieldAccessor, PortletRequestDataBinder, PropertyEditorRegistrySupport, ServletRequestDataBinder, SimpleTypeConverter, WebDataBinder, WebRequestDataBinder
public interface PropertyEditorRegistry

Encapsulates methods for registering JavaBeans PropertyEditors. This is the central interface that a PropertyEditorRegistrar operates on.

Extended by BeanWrapper; implemented by BeanWrapperImpl and DataBinder.

Since:
1.2.6
Author:
Juergen Hoeller
See Also:
PropertyEditor, PropertyEditorRegistrar, BeanWrapper, DataBinder

Method Summary
PropertyEditor | findCustomEditor(Class requiredType, String propertyPath) Find a custom property editor for the given type and property.
void | registerCustomEditor(Class requiredType, PropertyEditor propertyEditor) Register the given custom property editor for all properties of the given type.
void | registerCustomEditor(Class requiredType, String propertyPath, PropertyEditor propertyEditor) Register the given custom property editor for the given type and property, or for all properties of the given type.

Method Detail

registerCustomEditor

void registerCustomEditor(Class requiredType,
                          PropertyEditor propertyEditor)
Register the given custom property editor for all properties of the given type.

Parameters:
requiredType - the type of the property
propertyEditor - the editor to register

registerCustomEditor

void registerCustomEditor(Class requiredType,
                          String propertyPath,
                          PropertyEditor propertyEditor)
Register the given custom property editor for the given type and property, or for all properties of the given type.

If the property path denotes an array or Collection property, the editor will get applied either to the array/Collection itself (the PropertyEditor has to create an array or Collection value) or to each element (the PropertyEditor has to create the element type), depending on the specified required type.

Note: Only one single registered custom editor per property path is supported. In the case of a Collection/array, do not register an editor for both the Collection/array and each element on the same property.

For example, if you wanted to register an editor for "items[n].quantity" (for all values n), you would use "items.quantity" as the value of the 'propertyPath' argument to this method.

Parameters:
requiredType - the type of the property. This may be null if a property is given but should be specified in any case, in particular in case of a Collection - making clear whether the editor is supposed to apply to the entire Collection itself or to each of its entries. So as a general rule: Do not specify null here in case of a Collection/array!
propertyPath - the path of the property (name or nested path), or null if registering an editor for all properties of the given type
propertyEditor - editor to register

findCustomEditor

PropertyEditor findCustomEditor(Class requiredType,
                                String propertyPath)
Find a custom property editor for the given type and property.

Parameters:
requiredType - the type of the property (can be null if a property is given but should be specified in any case for consistency checking)
propertyPath - the path of the property (name or nested path), or null if looking for an editor for all properties of the given type
Returns:
the registered editor, or null if none
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertyValues

org.springframework.beans
Interface PropertyValues

All Known Implementing Classes:
MutablePropertyValues, PortletRequestParameterPropertyValues, ServletRequestParameterPropertyValues
public interface PropertyValues

Holder containing one or more PropertyValue objects, typically comprising one update for a specific target bean.

Since:
13 May 2001
Author:
Rod Johnson, Juergen Hoeller
See Also:
PropertyValue

Method Summary
PropertyValues | changesSince(PropertyValues old) Return the changes since the previous PropertyValues.
boolean | contains(String propertyName) Is there a property value (or other processing entry) for this property?
PropertyValue | getPropertyValue(String propertyName) Return the property value with the given name, if any.
PropertyValue[] | getPropertyValues() Return an array of the PropertyValue objects held in this object.
boolean | isEmpty() Does this holder not contain any PropertyValue objects at all?

Method Detail

getPropertyValues

PropertyValue[] getPropertyValues()
Return an array of the PropertyValue objects held in this object.

getPropertyValue

PropertyValue getPropertyValue(String propertyName)
Return the property value with the given name, if any.

Parameters:
propertyName - the name to search for
Returns:
the property value, or null

changesSince

PropertyValues changesSince(PropertyValues old)
Return the changes since the previous PropertyValues. Subclasses should also override equals.

Parameters:
old - old property values
Returns:
PropertyValues updated or new properties. Return empty PropertyValues if there are no changes.
See Also:
Object.equals(java.lang.Object)

contains

boolean contains(String propertyName)
Is there a property value (or other processing entry) for this property?

Parameters:
propertyName - the name of the property we're interested in
Returns:
whether there is a property value for this property

isEmpty

boolean isEmpty()
Does this holder not contain any PropertyValue objects at all?

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TypeConverter

org.springframework.beans
Interface TypeConverter

All Known Subinterfaces:
BeanWrapper, ConfigurablePropertyAccessor
All Known Implementing Classes:
AbstractPropertyAccessor, BeanWrapperImpl, DataBinder, DirectFieldAccessor, PortletRequestDataBinder, ServletRequestDataBinder, SimpleTypeConverter, WebDataBinder, WebRequestDataBinder
public interface TypeConverter

Interface that defines type conversion methods. Typically (but not necessarily) implemented in conjunction with the PropertyEditorRegistry interface.

Since:
2.0
Author:
Juergen Hoeller
See Also:
PropertyEditorRegistry, SimpleTypeConverter, BeanWrapperImpl

Method Summary
<T> T
convertIfNecessary(Object value, Class<T> requiredType)
Convert the value to the required type (if necessary from a String).
<T> T
convertIfNecessary(Object value, Class<T> requiredType, MethodParameter methodParam)
Convert the value to the required type (if necessary from a String).

Method Detail

convertIfNecessary

<T> T convertIfNecessary(Object value,
                         Class<T> requiredType)
                     throws TypeMismatchException
Convert the value to the required type (if necessary from a String).

Conversions from String to any type will typically use the setAsText method of the PropertyEditor class. Note that a PropertyEditor must be registered for the given class for this to work; this is a standard JavaBeans API. A number of PropertyEditors are automatically registered.

Parameters:
value - the value to convert
requiredType - the type we must convert to (or null if not known, for example in case of a collection element)
Returns:
the new value, possibly the result of type conversion
Throws:
TypeMismatchException - if type conversion failed
See Also:
PropertyEditor.setAsText(String), PropertyEditor.getValue()

convertIfNecessary

<T> T convertIfNecessary(Object value,
                         Class<T> requiredType,
                         MethodParameter methodParam)
                     throws TypeMismatchException
Convert the value to the required type (if necessary from a String).

Conversions from String to any type will typically use the setAsText method of the PropertyEditor class. Note that a PropertyEditor must be registered for the given class for this to work; this is a standard JavaBeans API. A number of PropertyEditors are automatically registered.

Parameters:
value - the value to convert
requiredType - the type we must convert to (or null if not known, for example in case of a collection element)
methodParam - the method parameter that is the target of the conversion (for analysis of generic types; may be null)
Returns:
the new value, possibly the result of type conversion
Throws:
TypeMismatchException - if type conversion failed
See Also:
PropertyEditor.setAsText(String), PropertyEditor.getValue()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractPropertyAccessor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.beans
Class AbstractPropertyAccessor

java.lang.Object
    extended by  org.springframework.beans.PropertyEditorRegistrySupport
        extended by  org.springframework.beans.AbstractPropertyAccessor
All Implemented Interfaces:
ConfigurablePropertyAccessor, PropertyAccessor, PropertyEditorRegistry, TypeConverter
Direct Known Subclasses:
BeanWrapperImpl, DirectFieldAccessor
public abstract class AbstractPropertyAccessor
extends PropertyEditorRegistrySupport
implements ConfigurablePropertyAccessor

Abstract implementation of the PropertyAccessor interface. Provides base implementations of all convenience methods, with the implementation of actual property access left to subclasses.

Since:
2.0
Author:
Juergen Hoeller
See Also:
getPropertyValue(java.lang.String), setPropertyValue(org.springframework.beans.PropertyValue)

Field Summary
Fields inherited from interface org.springframework.beans.PropertyAccessor
NESTED_PROPERTY_SEPARATOR, NESTED_PROPERTY_SEPARATOR_CHAR, PROPERTY_KEY_PREFIX, PROPERTY_KEY_PREFIX_CHAR, PROPERTY_KEY_SUFFIX, PROPERTY_KEY_SUFFIX_CHAR
Constructor Summary
AbstractPropertyAccessor()
Method Summary
<T> T
convertIfNecessary(Object value, Class<T> requiredType)
Convert the value to the required type (if necessary from a String).
 Class getPropertyType(String propertyPath)
Determine the property type for the given property path.
abstract  Object getPropertyValue(String propertyName)
Actually get the value of a property.
 boolean isExtractOldValueForEditor()
Return whether to extract the old property value when applying a property editor to a new value for a property.
 void setExtractOldValueForEditor(boolean extractOldValueForEditor)
Set whether to extract the old property value when applying a property editor to a new value for a property.
 void setPropertyValue(PropertyValue pv)
Set the specified value as current property value.
abstract  void setPropertyValue(String propertyName, Object value)
Actually set a property value.
 void setPropertyValues(Map<?,?> map)
Perform a batch update from a Map.
 void setPropertyValues(PropertyValues pvs)
The preferred way to perform a batch update.
 void setPropertyValues(PropertyValues pvs, boolean ignoreUnknown)
Perform a batch update with more control over behavior.
 void setPropertyValues(PropertyValues pvs, boolean ignoreUnknown, boolean ignoreInvalid)
Perform a batch update with full control over behavior.
Methods inherited from class org.springframework.beans.PropertyEditorRegistrySupport
copyCustomEditorsTo, copyDefaultEditorsTo, findCustomEditor, getConversionService, getDefaultEditor, guessPropertyTypeFromEditors, hasCustomEditorForElement, isSharedEditor, registerCustomEditor, registerCustomEditor, registerDefaultEditors, registerSharedEditor, setConversionService, useConfigValueEditors
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.ConfigurablePropertyAccessor
getConversionService, setConversionService
Methods inherited from interface org.springframework.beans.PropertyAccessor
getPropertyTypeDescriptor, isReadableProperty, isWritableProperty
Methods inherited from interface org.springframework.beans.PropertyEditorRegistry
findCustomEditor, registerCustomEditor, registerCustomEditor
Methods inherited from interface org.springframework.beans.TypeConverter
convertIfNecessary

Constructor Detail

AbstractPropertyAccessor

public AbstractPropertyAccessor()
Method Detail

setExtractOldValueForEditor

public void setExtractOldValueForEditor(boolean extractOldValueForEditor)
Description copied from interface: ConfigurablePropertyAccessor
Set whether to extract the old property value when applying a property editor to a new value for a property.

Specified by:
setExtractOldValueForEditor in interface ConfigurablePropertyAccessor

isExtractOldValueForEditor

public boolean isExtractOldValueForEditor()
Description copied from interface: ConfigurablePropertyAccessor
Return whether to extract the old property value when applying a property editor to a new value for a property.

Specified by:
isExtractOldValueForEditor in interface ConfigurablePropertyAccessor

setPropertyValue

public void setPropertyValue(PropertyValue pv)
                      throws BeansException
Description copied from interface: PropertyAccessor
Set the specified value as current property value.

Specified by:
setPropertyValue in interface PropertyAccessor
Parameters:
pv - an object containing the new property value
Throws:
InvalidPropertyException - if there is no such property or if the property isn't writable
PropertyAccessException - if the property was valid but the accessor method failed or a type mismatch occured
BeansException

setPropertyValues

public void setPropertyValues(Map<?,?> map)
                       throws BeansException
Description copied from interface: PropertyAccessor
Perform a batch update from a Map.

Bulk updates from PropertyValues are more powerful: This method is provided for convenience. Behavior will be identical to that of the PropertyAccessor.setPropertyValues(PropertyValues) method.

Specified by:
setPropertyValues in interface PropertyAccessor
Parameters:
map - Map to take properties from. Contains property value objects, keyed by property name
Throws:
InvalidPropertyException - if there is no such property or if the property isn't writable
PropertyBatchUpdateException - if one or more PropertyAccessExceptions occured for specific properties during the batch update. This exception bundles all individual PropertyAccessExceptions. All other properties will have been successfully updated.
BeansException

setPropertyValues

public void setPropertyValues(PropertyValues pvs)
                       throws BeansException
Description copied from interface: PropertyAccessor
The preferred way to perform a batch update.

Note that performing a batch update differs from performing a single update, in that an implementation of this class will continue to update properties if a recoverable error (such as a type mismatch, but not an invalid field name or the like) is encountered, throwing a PropertyBatchUpdateException containing all the individual errors. This exception can be examined later to see all binding errors. Properties that were successfully updated remain changed.

Does not allow unknown fields or invalid fields.

Specified by:
setPropertyValues in interface PropertyAccessor
Parameters:
pvs - PropertyValues to set on the target object
Throws:
InvalidPropertyException - if there is no such property or if the property isn't writable
PropertyBatchUpdateException - if one or more PropertyAccessExceptions occured for specific properties during the batch update. This exception bundles all individual PropertyAccessExceptions. All other properties will have been successfully updated.
BeansException
See Also:
PropertyAccessor.setPropertyValues(PropertyValues, boolean, boolean)

setPropertyValues

public void setPropertyValues(PropertyValues pvs,
                              boolean ignoreUnknown)
                       throws BeansException
Description copied from interface: PropertyAccessor
Perform a batch update with more control over behavior.

Note that performing a batch update differs from performing a single update, in that an implementation of this class will continue to update properties if a recoverable error (such as a type mismatch, but not an invalid field name or the like) is encountered, throwing a PropertyBatchUpdateException containing all the individual errors. This exception can be examined later to see all binding errors. Properties that were successfully updated remain changed.

Specified by:
setPropertyValues in interface PropertyAccessor
Parameters:
pvs - PropertyValues to set on the target object
ignoreUnknown - should we ignore unknown properties (not found in the bean)
Throws:
InvalidPropertyException - if there is no such property or if the property isn't writable
PropertyBatchUpdateException - if one or more PropertyAccessExceptions occured for specific properties during the batch update. This exception bundles all individual PropertyAccessExceptions. All other properties will have been successfully updated.
BeansException
See Also:
PropertyAccessor.setPropertyValues(PropertyValues, boolean, boolean)

setPropertyValues

public void setPropertyValues(PropertyValues pvs,
                              boolean ignoreUnknown,
                              boolean ignoreInvalid)
                       throws BeansException
Description copied from interface: PropertyAccessor
Perform a batch update with full control over behavior.

Note that performing a batch update differs from performing a single update, in that an implementation of this class will continue to update properties if a recoverable error (such as a type mismatch, but not an invalid field name or the like) is encountered, throwing a PropertyBatchUpdateException containing all the individual errors. This exception can be examined later to see all binding errors. Properties that were successfully updated remain changed.

Specified by:
setPropertyValues in interface PropertyAccessor
Parameters:
pvs - PropertyValues to set on the target object
ignoreUnknown - should we ignore unknown properties (not found in the bean)
ignoreInvalid - should we ignore invalid properties (found but not accessible)
Throws:
InvalidPropertyException - if there is no such property or if the property isn't writable
PropertyBatchUpdateException - if one or more PropertyAccessExceptions occured for specific properties during the batch update. This exception bundles all individual PropertyAccessExceptions. All other properties will have been successfully updated.
BeansException

convertIfNecessary

public <T> T convertIfNecessary(Object value,
                                Class<T> requiredType)
                     throws TypeMismatchException
Description copied from interface: TypeConverter
Convert the value to the required type (if necessary from a String).

Conversions from String to any type will typically use the setAsText method of the PropertyEditor class. Note that a PropertyEditor must be registered for the given class for this to work; this is a standard JavaBeans API. A number of PropertyEditors are automatically registered.

Specified by:
convertIfNecessary in interface TypeConverter
Parameters:
value - the value to convert
requiredType - the type we must convert to (or null if not known, for example in case of a collection element)
Returns:
the new value, possibly the result of type conversion
Throws:
TypeMismatchException - if type conversion failed
See Also:
PropertyEditor.setAsText(String), PropertyEditor.getValue()

getPropertyType

public Class getPropertyType(String propertyPath)
Description copied from class: PropertyEditorRegistrySupport
Determine the property type for the given property path.

Called by PropertyEditorRegistrySupport.findCustomEditor(java.lang.Class, java.lang.String) if no required type has been specified, to be able to find a type-specific editor even if just given a property path.

The default implementation always returns null. BeanWrapperImpl overrides this with the standard getPropertyType method as defined by the BeanWrapper interface.

Specified by:
getPropertyType in interface PropertyAccessor
Overrides:
getPropertyType in class PropertyEditorRegistrySupport
Parameters:
propertyPath - the property path to determine the type for
Returns:
the type of the property, or null if not determinable
See Also:
PropertyAccessor.getPropertyType(String)

getPropertyValue

public abstract Object getPropertyValue(String propertyName)
                                 throws BeansException
Actually get the value of a property.

Specified by:
getPropertyValue in interface PropertyAccessor
Parameters:
propertyName - name of the property to get the value of
Returns:
the value of the property
Throws:
InvalidPropertyException - if there is no such property or if the property isn't readable
PropertyAccessException - if the property was valid but the accessor method failed
BeansException

setPropertyValue

public abstract void setPropertyValue(String propertyName,
                                      Object value)
                               throws BeansException
Actually set a property value.

Specified by:
setPropertyValue in interface PropertyAccessor
Parameters:
propertyName - name of the property to set value of
value - the new value
Throws:
InvalidPropertyException - if there is no such property or if the property isn't writable
PropertyAccessException - if the property was valid but the accessor method failed or a type mismatch occured
BeansException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


BeanMetadataAttribute

org.springframework.beans
Class BeanMetadataAttribute

java.lang.Object
    extended by  org.springframework.beans.BeanMetadataAttribute
All Implemented Interfaces:
BeanMetadataElement
public class BeanMetadataAttribute
extends Object
implements BeanMetadataElement

Holder for a key-value style attribute that is part of a bean definition. Keeps track of the definition source in addition to the key-value pair.

Since:
2.5
Author:
Juergen Hoeller

Constructor Summary
BeanMetadataAttribute(String name, Object value)
Create a new AttributeValue instance.
Method Summary
boolean | equals(Object other)
String | getName() Return the name of the attribute.
Object | getSource() Return the configuration source Object for this metadata element (may be null).
Object | getValue() Return the value of the attribute.
int | hashCode()
void | setSource(Object source) Set the configuration source Object for this metadata element.
String | toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

BeanMetadataAttribute

public BeanMetadataAttribute(String name,
                             Object value)
Create a new AttributeValue instance.

Parameters:
name - the name of the attribute (never null)
value - the value of the attribute (possibly before type conversion)
Method Detail

getName

public String getName()
Return the name of the attribute.

getValue

public Object getValue()
Return the value of the attribute.

setSource

public void setSource(Object source)
Set the configuration source Object for this metadata element.

The exact type of the object will depend on the configuration mechanism used.

getSource

public Object getSource()
Description copied from interface: BeanMetadataElement
Return the configuration source Object for this metadata element (may be null).

Specified by:
getSource in interface BeanMetadataElement

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanMetadataAttributeAccessor

org.springframework.beans
Class BeanMetadataAttributeAccessor

java.lang.Object
    extended by  org.springframework.core.AttributeAccessorSupport
        extended by  org.springframework.beans.BeanMetadataAttributeAccessor
All Implemented Interfaces:
Serializable, BeanMetadataElement, AttributeAccessor
Direct Known Subclasses:
AbstractBeanDefinition, AutowireCandidateQualifier, PropertyValue
public class BeanMetadataAttributeAccessor
extends AttributeAccessorSupport
implements BeanMetadataElement

Extension of AttributeAccessorSupport, holding attributes as BeanMetadataAttribute objects in order to keep track of the definition source.

Since:
2.5
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
BeanMetadataAttributeAccessor()
Method Summary
void | addMetadataAttribute(BeanMetadataAttribute attribute) Add the given BeanMetadataAttribute to this accessor's set of attributes.
Object | getAttribute(String name) Get the value of the attribute identified by name.
BeanMetadataAttribute | getMetadataAttribute(String name) Look up the given BeanMetadataAttribute in this accessor's set of attributes.
Object | getSource() Return the configuration source Object for this metadata element (may be null).
Object | removeAttribute(String name) Remove the attribute identified by name and return its value.
void | setAttribute(String name, Object value) Set the attribute defined by name to the supplied value.
void | setSource(Object source) Set the configuration source Object for this metadata element.
Methods inherited from class org.springframework.core.AttributeAccessorSupport
attributeNames, copyAttributesFrom, equals, hasAttribute, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BeanMetadataAttributeAccessor

public BeanMetadataAttributeAccessor()
Method Detail

setSource

public void setSource(Object source)
Set the configuration source Object for this metadata element.

The exact type of the object will depend on the configuration mechanism used.

getSource

public Object getSource()
Description copied from interface: BeanMetadataElement
Return the configuration source Object for this metadata element (may be null).

Specified by:
getSource in interface BeanMetadataElement

addMetadataAttribute

public void addMetadataAttribute(BeanMetadataAttribute attribute)
Add the given BeanMetadataAttribute to this accessor's set of attributes.

Parameters:
attribute - the BeanMetadataAttribute object to register

getMetadataAttribute

public BeanMetadataAttribute getMetadataAttribute(String name)
Look up the given BeanMetadataAttribute in this accessor's set of attributes.

Parameters:
name - the name of the attribute
Returns:
the corresponding BeanMetadataAttribute object, or null if no such attribute defined

setAttribute

public void setAttribute(String name,
                         Object value)
Description copied from interface: AttributeAccessor
Set the attribute defined by name to the supplied value. If value is null, the attribute is removed.

In general, users should take care to prevent overlaps with other metadata attributes by using fully-qualified names, perhaps using class or package names as prefix.

Specified by:
setAttribute in interface AttributeAccessor
Overrides:
setAttribute in class AttributeAccessorSupport
Parameters:
name - the unique attribute key
value - the attribute value to be attached

getAttribute

public Object getAttribute(String name)
Description copied from interface: AttributeAccessor
Get the value of the attribute identified by name. Return null if the attribute doesn't exist.

Specified by:
getAttribute in interface AttributeAccessor
Overrides:
getAttribute in class AttributeAccessorSupport
Parameters:
name - the unique attribute key
Returns:
the current value of the attribute, if any

removeAttribute

public Object removeAttribute(String name)
Description copied from interface: AttributeAccessor
Remove the attribute identified by name and return its value. Return null if no attribute under name is found.

Specified by:
removeAttribute in interface AttributeAccessor
Overrides:
removeAttribute in class AttributeAccessorSupport
Parameters:
name - the unique attribute key
Returns:
the last value of the attribute, if any
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanUtils

org.springframework.beans
Class BeanUtils

java.lang.Object
    extended by  org.springframework.beans.BeanUtils

public abstract class BeanUtils
extends Object

Static convenience methods for JavaBeans: for instantiating beans, checking bean property types, copying bean properties, etc.

Mainly for use within the framework, but to some degree also useful for application classes.

Author:
Rod Johnson, Juergen Hoeller, Rob Harrop, Sam Brannen

Constructor Summary
BeanUtils()
Method Summary
static void copyProperties(Object source, Object target)
Copy the property values of the given source bean into the target bean.
static void copyProperties(Object source, Object target, Class<?> editable)
Copy the property values of the given source bean into the given target bean, only setting properties defined in the given "editable" class (or interface).
static void copyProperties(Object source, Object target, String[] ignoreProperties)
Copy the property values of the given source bean into the given target bean, ignoring the given "ignoreProperties".
static Method findDeclaredMethod(Class<?> clazz, String methodName, Class<?>[] paramTypes)
Find a method with the given method name and the given parameter types, declared on the given class or one of its superclasses.
static Method findDeclaredMethodWithMinimalParameters(Class<?> clazz, String methodName)
Find a method with the given method name and minimal parameters (best case: none), declared on the given class or one of its superclasses.
static PropertyEditor findEditorByConvention(Class<?> targetType)
Find a JavaBeans PropertyEditor following the 'Editor' suffix convention (e.g.
static Method findMethod(Class<?> clazz, String methodName, Class<?>... paramTypes)
Find a method with the given method name and the given parameter types, declared on the given class or one of its superclasses.
static Method findMethodWithMinimalParameters(Class<?> clazz, String methodName)
Find a method with the given method name and minimal parameters (best case: none), declared on the given class or one of its superclasses.
static Method findMethodWithMinimalParameters(Method[] methods, String methodName)
Find a method with the given method name and minimal parameters (best case: none) in the given list of methods.
static PropertyDescriptor findPropertyForMethod(Method method)
Find a JavaBeans PropertyDescriptor for the given method, with the method either being the read method or the write method for that bean property.
static Class<?> findPropertyType(String propertyName, Class<?>[] beanClasses)
Determine the bean property type for the given property from the given classes/interfaces, if possible.
static PropertyDescriptor getPropertyDescriptor(Class<?> clazz, String propertyName)
Retrieve the JavaBeans PropertyDescriptors for the given property.
static PropertyDescriptor[] getPropertyDescriptors(Class<?> clazz)
Retrieve the JavaBeans PropertyDescriptors of a given class.
static MethodParameter getWriteMethodParameter(PropertyDescriptor pd)
Obtain a new MethodParameter object for the write method of the specified property.
static
<T> T
instantiate(Class<T> clazz)
Convenience method to instantiate a class using its no-arg constructor.
static
<T> T
instantiateClass(Class<T> clazz)
Convenience method to instantiate a class using its no-arg constructor.
static
<T> T
instantiateClass(Constructor<T> ctor, Object... args)
Convenience method to instantiate a class using the given constructor.
static boolean isSimpleProperty(Class<?> clazz)
Check if the given type represents a "simple" property: a primitive, a String or other CharSequence, a Number, a Date, a URI, a URL, a Locale, a Class, or a corresponding array.
static boolean isSimpleValueType(Class<?> clazz)
Check if the given type represents a "simple" value type: a primitive, a String or other CharSequence, a Number, a Date, a URI, a URL, a Locale or a Class.
static Method resolveSignature(String signature, Class<?> clazz)
Parse a method signature in the form methodName[([arg_list])], where arg_list is an optional, comma-separated list of fully-qualified type names, and attempts to resolve that signature against the supplied Class.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BeanUtils

public BeanUtils()
Method Detail

instantiate

public static <T> T instantiate(Class<T> clazz)
                     throws BeanInstantiationException
Convenience method to instantiate a class using its no-arg constructor. As this method doesn't try to load classes by name, it should avoid class-loading issues.

Parameters:
clazz - class to instantiate
Returns:
the new instance
Throws:
BeanInstantiationException - if the bean cannot be instantiated

instantiateClass

public static <T> T instantiateClass(Class<T> clazz)
                          throws BeanInstantiationException
Convenience method to instantiate a class using its no-arg constructor. As this method doesn't try to load classes by name, it should avoid class-loading issues.

Note that this method tries to set the constructor accessible if given a non-accessible (that is, non-public) constructor.

Parameters:
clazz - class to instantiate
Returns:
the new instance
Throws:
BeanInstantiationException - if the bean cannot be instantiated

instantiateClass

public static <T> T instantiateClass(Constructor<T> ctor,
                                     Object... args)
                          throws BeanInstantiationException
Convenience method to instantiate a class using the given constructor. As this method doesn't try to load classes by name, it should avoid class-loading issues.

Note that this method tries to set the constructor accessible if given a non-accessible (that is, non-public) constructor.

Parameters:
ctor - the constructor to instantiate
args - the constructor arguments to apply
Returns:
the new instance
Throws:
BeanInstantiationException - if the bean cannot be instantiated

findMethod

public static Method findMethod(Class<?> clazz,
                                String methodName,
                                Class<?>... paramTypes)
Find a method with the given method name and the given parameter types, declared on the given class or one of its superclasses. Prefers public methods, but will return a protected, package access, or private method too.

Checks Class.getMethod first, falling back to findDeclaredMethod. This allows to find public methods without issues even in environments with restricted Java security settings.

Parameters:
clazz - the class to check
methodName - the name of the method to find
paramTypes - the parameter types of the method to find
Returns:
the Method object, or null if not found
See Also:
Class.getMethod(java.lang.String, java.lang.Class...), findDeclaredMethod(java.lang.Class, java.lang.String, java.lang.Class[])

findDeclaredMethod

public static Method findDeclaredMethod(Class<?> clazz,
                                        String methodName,
                                        Class<?>[] paramTypes)
Find a method with the given method name and the given parameter types, declared on the given class or one of its superclasses. Will return a public, protected, package access, or private method.

Checks Class.getDeclaredMethod, cascading upwards to all superclasses.

Parameters:
clazz - the class to check
methodName - the name of the method to find
paramTypes - the parameter types of the method to find
Returns:
the Method object, or null if not found
See Also:
Class.getDeclaredMethod(java.lang.String, java.lang.Class...)

findMethodWithMinimalParameters

public static Method findMethodWithMinimalParameters(Class<?> clazz,
                                                     String methodName)
                                              throws IllegalArgumentException
Find a method with the given method name and minimal parameters (best case: none), declared on the given class or one of its superclasses. Prefers public methods, but will return a protected, package access, or private method too.

Checks Class.getMethods first, falling back to findDeclaredMethodWithMinimalParameters. This allows for finding public methods without issues even in environments with restricted Java security settings.

Parameters:
clazz - the class to check
methodName - the name of the method to find
Returns:
the Method object, or null if not found
Throws:
IllegalArgumentException - if methods of the given name were found but could not be resolved to a unique method with minimal parameters
See Also:
Class.getMethods(), findDeclaredMethodWithMinimalParameters(java.lang.Class, java.lang.String)

findDeclaredMethodWithMinimalParameters

public static Method findDeclaredMethodWithMinimalParameters(Class<?> clazz,
                                                             String methodName)
                                                      throws IllegalArgumentException
Find a method with the given method name and minimal parameters (best case: none), declared on the given class or one of its superclasses. Will return a public, protected, package access, or private method.

Checks Class.getDeclaredMethods, cascading upwards to all superclasses.

Parameters:
clazz - the class to check
methodName - the name of the method to find
Returns:
the Method object, or null if not found
Throws:
IllegalArgumentException - if methods of the given name were found but could not be resolved to a unique method with minimal parameters
See Also:
Class.getDeclaredMethods()

findMethodWithMinimalParameters

public static Method findMethodWithMinimalParameters(Method[] methods,
                                                     String methodName)
                                              throws IllegalArgumentException
Find a method with the given method name and minimal parameters (best case: none) in the given list of methods.

Parameters:
methods - the methods to check
methodName - the name of the method to find
Returns:
the Method object, or null if not found
Throws:
IllegalArgumentException - if methods of the given name were found but could not be resolved to a unique method with minimal parameters

resolveSignature

public static Method resolveSignature(String signature,
                                      Class<?> clazz)
Parse a method signature in the form methodName[([arg_list])], where arg_list is an optional, comma-separated list of fully-qualified type names, and attempts to resolve that signature against the supplied Class.

When not supplying an argument list (methodName) the method whose name matches and has the least number of parameters will be returned. When supplying an argument type list, only the method whose name and argument types match will be returned.

Note then that methodName and methodName() are not resolved in the same way. The signature methodName means the method called methodName with the least number of arguments, whereas methodName() means the method called methodName with exactly 0 arguments.

If no method can be found, then null is returned.

Parameters:
signature - the method signature as String representation
clazz - the class to resolve the method signature against
Returns:
the resolved Method
See Also:
findMethod(java.lang.Class, java.lang.String, java.lang.Class...), findMethodWithMinimalParameters(java.lang.Class, java.lang.String)

getPropertyDescriptors

public static PropertyDescriptor[] getPropertyDescriptors(Class<?> clazz)
                                                   throws BeansException
Retrieve the JavaBeans PropertyDescriptors of a given class.

Parameters:
clazz - the Class to retrieve the PropertyDescriptors for
Returns:
an array of PropertyDescriptors for the given class
Throws:
BeansException - if PropertyDescriptor look fails

getPropertyDescriptor

public static PropertyDescriptor getPropertyDescriptor(Class<?> clazz,
                                                       String propertyName)
                                                throws BeansException
Retrieve the JavaBeans PropertyDescriptors for the given property.

Parameters:
clazz - the Class to retrieve the PropertyDescriptor for
propertyName - the name of the property
Returns:
the corresponding PropertyDescriptor, or null if none
Throws:
BeansException - if PropertyDescriptor lookup fails

findPropertyForMethod

public static PropertyDescriptor findPropertyForMethod(Method method)
                                                throws BeansException
Find a JavaBeans PropertyDescriptor for the given method, with the method either being the read method or the write method for that bean property.

Parameters:
method - the method to find a corresponding PropertyDescriptor for
Returns:
the corresponding PropertyDescriptor, or null if none
Throws:
BeansException - if PropertyDescriptor lookup fails

findEditorByConvention

public static PropertyEditor findEditorByConvention(Class<?> targetType)
Find a JavaBeans PropertyEditor following the 'Editor' suffix convention (e.g. "mypackage.MyDomainClass" -> "mypackage.MyDomainClassEditor").

Compatible to the standard JavaBeans convention as implemented by PropertyEditorManager but isolated from the latter's registered default editors for primitive types.

Parameters:
targetType - the type to find an editor for
Returns:
the corresponding editor, or null if none found

findPropertyType

public static Class<?> findPropertyType(String propertyName,
                                        Class<?>[] beanClasses)
Determine the bean property type for the given property from the given classes/interfaces, if possible.

Parameters:
propertyName - the name of the bean property
beanClasses - the classes to check against
Returns:
the property type, or Object.class as fallback

getWriteMethodParameter

public static MethodParameter getWriteMethodParameter(PropertyDescriptor pd)
Obtain a new MethodParameter object for the write method of the specified property.

Parameters:
pd - the PropertyDescriptor for the property
Returns:
a corresponding MethodParameter object

isSimpleProperty

public static boolean isSimpleProperty(Class<?> clazz)
Check if the given type represents a "simple" property: a primitive, a String or other CharSequence, a Number, a Date, a URI, a URL, a Locale, a Class, or a corresponding array.

Used to determine properties to check for a "simple" dependency-check.

Parameters:
clazz - the type to check
Returns:
whether the given type represents a "simple" property
See Also:
AbstractBeanDefinition.DEPENDENCY_CHECK_SIMPLE, AbstractAutowireCapableBeanFactory.checkDependencies(java.lang.String, org.springframework.beans.factory.support.AbstractBeanDefinition, java.beans.PropertyDescriptor[], org.springframework.beans.PropertyValues)

isSimpleValueType

public static boolean isSimpleValueType(Class<?> clazz)
Check if the given type represents a "simple" value type: a primitive, a String or other CharSequence, a Number, a Date, a URI, a URL, a Locale or a Class.

Parameters:
clazz - the type to check
Returns:
whether the given type represents a "simple" value type

copyProperties

public static void copyProperties(Object source,
                                  Object target)
                           throws BeansException
Copy the property values of the given source bean into the target bean.

Note: The source and target classes do not have to match or even be derived from each other, as long as the properties match. Any bean properties that the source bean exposes but the target bean does not will silently be ignored.

This is just a convenience method. For more complex transfer needs, consider using a full BeanWrapper.

Parameters:
source - the source bean
target - the target bean
Throws:
BeansException - if the copying failed
See Also:
BeanWrapper

copyProperties

public static void copyProperties(Object source,
                                  Object target,
                                  Class<?> editable)
                           throws BeansException
Copy the property values of the given source bean into the given target bean, only setting properties defined in the given "editable" class (or interface).

Note: The source and target classes do not have to match or even be derived from each other, as long as the properties match. Any bean properties that the source bean exposes but the target bean does not will silently be ignored.

This is just a convenience method. For more complex transfer needs, consider using a full BeanWrapper.

Parameters:
source - the source bean
target - the target bean
editable - the class (or interface) to restrict property setting to
Throws:
BeansException - if the copying failed
See Also:
BeanWrapper

copyProperties

public static void copyProperties(Object source,
                                  Object target,
                                  String[] ignoreProperties)
                           throws BeansException
Copy the property values of the given source bean into the given target bean, ignoring the given "ignoreProperties".

Note: The source and target classes do not have to match or even be derived from each other, as long as the properties match. Any bean properties that the source bean exposes but the target bean does not will silently be ignored.

This is just a convenience method. For more complex transfer needs, consider using a full BeanWrapper.

Parameters:
source - the source bean
target - the target bean
ignoreProperties - array of property names to ignore
Throws:
BeansException - if the copying failed
See Also:
BeanWrapper
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanWrapperImpl

org.springframework.beans
Class BeanWrapperImpl

java.lang.Object
    extended by  org.springframework.beans.PropertyEditorRegistrySupport
        extended by  org.springframework.beans.AbstractPropertyAccessor
            extended by  org.springframework.beans.BeanWrapperImpl
All Implemented Interfaces:
BeanWrapper, ConfigurablePropertyAccessor, PropertyAccessor, PropertyEditorRegistry, TypeConverter
public class BeanWrapperImpl
extends AbstractPropertyAccessor
implements BeanWrapper

Default BeanWrapper implementation that should be sufficient for all typical use cases. Caches introspection results for efficiency.

Note: Auto-registers default property editors from the org.springframework.beans.propertyeditors package, which apply in addition to the JDK's standard PropertyEditors. Applications can call the PropertyEditorRegistrySupport.registerCustomEditor(Class, java.beans.PropertyEditor) method to register an editor for a particular instance (i.e. they are not shared across the application). See the base class PropertyEditorRegistrySupport for details.

BeanWrapperImpl will convert collection and array values to the corresponding target collections or arrays, if necessary. Custom property editors that deal with collections or arrays can either be written via PropertyEditor's setValue, or against a comma-delimited String via setAsText, as String arrays are converted in such a format if the array itself is not assignable.

NOTE: As of Spring 2.5, this is - for almost all purposes - an internal class. It is just public in order to allow for access from other framework packages. For standard application access purposes, use the PropertyAccessorFactory.forBeanPropertyAccess(java.lang.Object) factory method instead.

Since:
15 April 2001
Author:
Rod Johnson, Juergen Hoeller, Rob Harrop
See Also:
PropertyEditorRegistrySupport.registerCustomEditor(java.lang.Class, java.beans.PropertyEditor),
AbstractPropertyAccessor.setPropertyValues(java.util.Map),
setPropertyValue(java.lang.String, java.lang.Object),
getPropertyValue(java.lang.String),
getPropertyType(java.lang.String),
BeanWrapper,
PropertyEditorRegistrySupport

Field Summary
Fields inherited from interface org.springframework.beans.PropertyAccessor
NESTED_PROPERTY_SEPARATOR, NESTED_PROPERTY_SEPARATOR_CHAR, PROPERTY_KEY_PREFIX, PROPERTY_KEY_PREFIX_CHAR, PROPERTY_KEY_SUFFIX, PROPERTY_KEY_SUFFIX_CHAR
Constructor Summary
BeanWrapperImpl()
Create new empty BeanWrapperImpl.
BeanWrapperImpl(boolean registerDefaultEditors)
Create new empty BeanWrapperImpl.
BeanWrapperImpl(Class<?> clazz)
Create new BeanWrapperImpl, wrapping a new instance of the specified class.
BeanWrapperImpl(Object object)
Create new BeanWrapperImpl for the given object.
BeanWrapperImpl(Object object, String nestedPath, Object rootObject)
Create new BeanWrapperImpl for the given object, registering a nested path that the object is in.
Method Summary
 Object convertForProperty(Object value, String propertyName)
Convert the given value for the specified property to the latter's type.
<T> T
convertIfNecessary(Object value, Class<T> requiredType, MethodParameter methodParam)
Convert the value to the required type (if necessary from a String).
protected  BeanWrapperImpl getBeanWrapperForPropertyPath(String propertyPath)
Recursively navigate to return a BeanWrapper for the nested property path.
 String getNestedPath()
Return the nested path of the object wrapped by this BeanWrapper.
 PropertyDescriptor getPropertyDescriptor(String propertyName)
Obtain the property descriptor for a specific property of the wrapped object.
protected  PropertyDescriptor getPropertyDescriptorInternal(String propertyName)
Internal version of getPropertyDescriptor(java.lang.String): Returns null if not found rather than throwing an exception.
 PropertyDescriptor[] getPropertyDescriptors()
Obtain the PropertyDescriptors for the wrapped object (as determined by standard JavaBeans introspection).
 Class getPropertyType(String propertyName)
Determine the property type for the given property path.
 TypeDescriptor getPropertyTypeDescriptor(String propertyName)
Return a type descriptor for the specified property: preferably from the read method, falling back to the write method.
 Object getPropertyValue(String propertyName)
Actually get the value of a property.
 Class getRootClass()
Return the class of the root object at the top of the path of this BeanWrapper.
 Object getRootInstance()
Return the root object at the top of the path of this BeanWrapper.
 AccessControlContext getSecurityContext()
Return the security context used during the invocation of the wrapped instance methods.
 Class getWrappedClass()
Return the type of the wrapped JavaBean object.
 Object getWrappedInstance()
Return the bean instance wrapped by this object, if any.
 boolean isAutoGrowNestedPaths()
If this BeanWrapper should "auto grow" nested paths.
 boolean isReadableProperty(String propertyName)
Determine whether the specified property is readable.
 boolean isWritableProperty(String propertyName)
Determine whether the specified property is writable.
protected  BeanWrapperImpl newNestedBeanWrapper(Object object, String nestedPath)
Create a new nested BeanWrapper instance.
 void setAutoGrowNestedPaths(boolean autoGrowNestedPaths)
If this BeanWrapper should "auto grow" nested paths.
protected  void setIntrospectionClass(Class clazz)
Set the class to introspect.
 void setPropertyValue(PropertyValue pv)
Set the specified value as current property value.
 void setPropertyValue(String propertyName, Object value)
Actually set a property value.
 void setSecurityContext(AccessControlContext acc)
Set the security context used during the invocation of the wrapped instance methods.
 void setWrappedInstance(Object object)
Switch the target object, replacing the cached introspection results only if the class of the new object is different to that of the replaced object.
 void setWrappedInstance(Object object, String nestedPath, Object rootObject)
Switch the target object, replacing the cached introspection results only if the class of the new object is different to that of the replaced object.
 String toString()
Methods inherited from class org.springframework.beans.AbstractPropertyAccessor
convertIfNecessary, isExtractOldValueForEditor, setExtractOldValueForEditor, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues
Methods inherited from class org.springframework.beans.PropertyEditorRegistrySupport
copyCustomEditorsTo, copyDefaultEditorsTo, findCustomEditor, getConversionService, getDefaultEditor, guessPropertyTypeFromEditors, hasCustomEditorForElement, isSharedEditor, registerCustomEditor, registerCustomEditor, registerDefaultEditors, registerSharedEditor, setConversionService, useConfigValueEditors
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.beans.ConfigurablePropertyAccessor
getConversionService, isExtractOldValueForEditor, setConversionService, setExtractOldValueForEditor
Methods inherited from interface org.springframework.beans.PropertyAccessor
setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues
Methods inherited from interface org.springframework.beans.PropertyEditorRegistry
findCustomEditor, registerCustomEditor, registerCustomEditor
Methods inherited from interface org.springframework.beans.TypeConverter
convertIfNecessary

Constructor Detail

BeanWrapperImpl

public BeanWrapperImpl()
Create new empty BeanWrapperImpl. Wrapped instance needs to be set afterwards. Registers default editors.

See Also:
setWrappedInstance(java.lang.Object)

BeanWrapperImpl

public BeanWrapperImpl(boolean registerDefaultEditors)
Create new empty BeanWrapperImpl. Wrapped instance needs to be set afterwards.

Parameters:
registerDefaultEditors - whether to register default editors (can be suppressed if the BeanWrapper won't need any type conversion)
See Also:
setWrappedInstance(java.lang.Object)

BeanWrapperImpl

public BeanWrapperImpl(Object object)
Create new BeanWrapperImpl for the given object.

Parameters:
object - object wrapped by this BeanWrapper

BeanWrapperImpl

public BeanWrapperImpl(Class<?> clazz)
Create new BeanWrapperImpl, wrapping a new instance of the specified class.

Parameters:
clazz - class to instantiate and wrap

BeanWrapperImpl

public BeanWrapperImpl(Object object,
                       String nestedPath,
                       Object rootObject)
Create new BeanWrapperImpl for the given object, registering a nested path that the object is in.

Parameters:
object - object wrapped by this BeanWrapper
nestedPath - the nested path of the object
rootObject - the root object at the top of the path
Method Detail

setWrappedInstance

public void setWrappedInstance(Object object)
Switch the target object, replacing the cached introspection results only if the class of the new object is different to that of the replaced object.

Parameters:
object - the new target object

setWrappedInstance

public void setWrappedInstance(Object object,
                               String nestedPath,
                               Object rootObject)
Switch the target object, replacing the cached introspection results only if the class of the new object is different to that of the replaced object.

Parameters:
object - the new target object
nestedPath - the nested path of the object
rootObject - the root object at the top of the path

getWrappedInstance

public final Object getWrappedInstance()
Description copied from interface: BeanWrapper
Return the bean instance wrapped by this object, if any.

Specified by:
getWrappedInstance in interface BeanWrapper
Returns:
the bean instance, or null if none set

getWrappedClass

public final Class getWrappedClass()
Description copied from interface: BeanWrapper
Return the type of the wrapped JavaBean object.

Specified by:
getWrappedClass in interface BeanWrapper
Returns:
the type of the wrapped bean instance, or null if no wrapped object has been set

getNestedPath

public final String getNestedPath()
Return the nested path of the object wrapped by this BeanWrapper.

getRootInstance

public final Object getRootInstance()
Return the root object at the top of the path of this BeanWrapper.

See Also:
getNestedPath()

getRootClass

public final Class getRootClass()
Return the class of the root object at the top of the path of this BeanWrapper.

See Also:
getNestedPath()

setAutoGrowNestedPaths

public void setAutoGrowNestedPaths(boolean autoGrowNestedPaths)
If this BeanWrapper should "auto grow" nested paths. When true, auto growth is triggered on nested paths when null values are encountered. When true, auto growth is triggered on collection properties when out of bounds indexes are accessed. Default is false.

Specified by:
setAutoGrowNestedPaths in interface BeanWrapper

isAutoGrowNestedPaths

public boolean isAutoGrowNestedPaths()
If this BeanWrapper should "auto grow" nested paths.

Specified by:
isAutoGrowNestedPaths in interface BeanWrapper

setSecurityContext

public void setSecurityContext(AccessControlContext acc)
Set the security context used during the invocation of the wrapped instance methods. Can be null.

getSecurityContext

public AccessControlContext getSecurityContext()
Return the security context used during the invocation of the wrapped instance methods. Can be null.

setIntrospectionClass

protected void setIntrospectionClass(Class clazz)
Set the class to introspect. Needs to be called when the target object changes.

Parameters:
clazz - the class to introspect

getPropertyDescriptors

public PropertyDescriptor[] getPropertyDescriptors()
Description copied from interface: BeanWrapper
Obtain the PropertyDescriptors for the wrapped object (as determined by standard JavaBeans introspection).

Specified by:
getPropertyDescriptors in interface BeanWrapper
Returns:
the PropertyDescriptors for the wrapped object

getPropertyDescriptor

public PropertyDescriptor getPropertyDescriptor(String propertyName)
                                         throws BeansException
Description copied from interface: BeanWrapper
Obtain the property descriptor for a specific property of the wrapped object.

Specified by:
getPropertyDescriptor in interface BeanWrapper
Parameters:
propertyName - the property to obtain the descriptor for (may be a nested path, but no indexed/mapped property)
Returns:
the property descriptor for the specified property
Throws:
InvalidPropertyException - if there is no such property
BeansException

getPropertyDescriptorInternal

protected PropertyDescriptor getPropertyDescriptorInternal(String propertyName)
                                                    throws BeansException
Internal version of getPropertyDescriptor(java.lang.String): Returns null if not found rather than throwing an exception.

Parameters:
propertyName - the property to obtain the descriptor for
Returns:
the property descriptor for the specified property, or null if not found
Throws:
BeansException - in case of introspection failure

getPropertyType

public Class getPropertyType(String propertyName)
                      throws BeansException
Description copied from class: PropertyEditorRegistrySupport
Determine the property type for the given property path.

Called by PropertyEditorRegistrySupport.findCustomEditor(java.lang.Class, java.lang.String) if no required type has been specified, to be able to find a type-specific editor even if just given a property path.

The default implementation always returns null. BeanWrapperImpl overrides this with the standard getPropertyType method as defined by the BeanWrapper interface.

Specified by:
getPropertyType in interface PropertyAccessor
Overrides:
getPropertyType in class AbstractPropertyAccessor
Parameters:
propertyName - the property path to determine the type for
Returns:
the type of the property, or null if not determinable
Throws:
InvalidPropertyException - if there is no such property or if the property isn't readable
PropertyAccessException - if the property was valid but the accessor method failed
BeansException
See Also:
PropertyAccessor.getPropertyType(String)

getPropertyTypeDescriptor

public TypeDescriptor getPropertyTypeDescriptor(String propertyName)
                                         throws BeansException
Description copied from interface: PropertyAccessor
Return a type descriptor for the specified property: preferably from the read method, falling back to the write method.

Specified by:
getPropertyTypeDescriptor in interface PropertyAccessor
Parameters:
propertyName - the property to check (may be a nested path and/or an indexed/mapped property)
Returns:
the property type for the particular property, or null if not determinable
Throws:
InvalidPropertyException - if there is no such property or if the property isn't readable
BeansException

isReadableProperty

public boolean isReadableProperty(String propertyName)
Description copied from interface: PropertyAccessor
Determine whether the specified property is readable.

Returns false if the property doesn't exist.

Specified by:
isReadableProperty in interface PropertyAccessor
Parameters:
propertyName - the property to check (may be a nested path and/or an indexed/mapped property)
Returns:
whether the property is readable

isWritableProperty

public boolean isWritableProperty(String propertyName)
Description copied from interface: PropertyAccessor
Determine whether the specified property is writable.

Returns false if the property doesn't exist.

Specified by:
isWritableProperty in interface PropertyAccessor
Parameters:
propertyName - the property to check (may be a nested path and/or an indexed/mapped property)
Returns:
whether the property is writable

convertIfNecessary

public <T> T convertIfNecessary(Object value,
                                Class<T> requiredType,
                                MethodParameter methodParam)
                     throws TypeMismatchException
Description copied from interface: TypeConverter
Convert the value to the required type (if necessary from a String).

Conversions from String to any type will typically use the setAsText method of the PropertyEditor class. Note that a PropertyEditor must be registered for the given class for this to work; this is a standard JavaBeans API. A number of PropertyEditors are automatically registered.

Specified by:
convertIfNecessary in interface TypeConverter
Parameters:
value - the value to convert
requiredType - the type we must convert to (or null if not known, for example in case of a collection element)
methodParam - the method parameter that is the target of the conversion (for analysis of generic types; may be null)
Returns:
the new value, possibly the result of type conversion
Throws:
TypeMismatchException - if type conversion failed
See Also:
PropertyEditor.setAsText(String), PropertyEditor.getValue()

convertForProperty

public Object convertForProperty(Object value,
                                 String propertyName)
                          throws TypeMismatchException
Convert the given value for the specified property to the latter's type.

This method is only intended for optimizations in a BeanFactory. Use the convertIfNecessary methods for programmatic conversion.

Parameters:
value - the value to convert
propertyName - the target property (note that nested or indexed properties are not supported here)
Returns:
the new value, possibly the result of type conversion
Throws:
TypeMismatchException - if type conversion failed

getBeanWrapperForPropertyPath

protected BeanWrapperImpl getBeanWrapperForPropertyPath(String propertyPath)
Recursively navigate to return a BeanWrapper for the nested property path.

Parameters:
propertyPath - property property path, which may be nested
Returns:
a BeanWrapper for the target bean

newNestedBeanWrapper

protected BeanWrapperImpl newNestedBeanWrapper(Object object,
                                               String nestedPath)
Create a new nested BeanWrapper instance.

Default implementation creates a BeanWrapperImpl instance. Can be overridden in subclasses to create a BeanWrapperImpl subclass.

Parameters:
object - object wrapped by this BeanWrapper
nestedPath - the nested path of the object
Returns:
the nested BeanWrapper instance

getPropertyValue

public Object getPropertyValue(String propertyName)
                        throws BeansException
Description copied from class: AbstractPropertyAccessor
Actually get the value of a property.

Specified by:
getPropertyValue in interface PropertyAccessor
Specified by:
getPropertyValue in class AbstractPropertyAccessor
Parameters:
propertyName - name of the property to get the value of
Returns:
the value of the property
Throws:
InvalidPropertyException - if there is no such property or if the property isn't readable
PropertyAccessException - if the property was valid but the accessor method failed
BeansException

setPropertyValue

public void setPropertyValue(String propertyName,
                             Object value)
                      throws BeansException
Description copied from class: AbstractPropertyAccessor
Actually set a property value.

Specified by:
setPropertyValue in interface PropertyAccessor
Specified by:
setPropertyValue in class AbstractPropertyAccessor
Parameters:
propertyName - name of the property to set value of
value - the new value
Throws:
InvalidPropertyException - if there is no such property or if the property isn't writable
PropertyAccessException - if the property was valid but the accessor method failed or a type mismatch occured
BeansException

setPropertyValue

public void setPropertyValue(PropertyValue pv)
                      throws BeansException
Description copied from interface: PropertyAccessor
Set the specified value as current property value.

Specified by:
setPropertyValue in interface PropertyAccessor
Overrides:
setPropertyValue in class AbstractPropertyAccessor
Parameters:
pv - an object containing the new property value
Throws:
InvalidPropertyException - if there is no such property or if the property isn't writable
PropertyAccessException - if the property was valid but the accessor method failed or a type mismatch occured
BeansException

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CachedIntrospectionResults

org.springframework.beans
Class CachedIntrospectionResults

java.lang.Object
    extended by  org.springframework.beans.CachedIntrospectionResults

public class CachedIntrospectionResults
extends Object

Internal class that caches JavaBeans PropertyDescriptor information for a Java class. Not intended for direct use by application code.

Necessary for own caching of descriptors within the application's ClassLoader, rather than rely on the JDK's system-wide BeanInfo cache (in order to avoid leaks on ClassLoader shutdown).

Information is cached statically, so we don't need to create new objects of this class for every JavaBean we manipulate. Hence, this class implements the factory design pattern, using a private constructor and a static forClass(Class) factory method to obtain instances.

Since:
05 May 2001
Author:
Rod Johnson, Juergen Hoeller
See Also:
acceptClassLoader(ClassLoader), clearClassLoader(ClassLoader), forClass(Class)

Method Summary
static void | acceptClassLoader(ClassLoader classLoader) Accept the given ClassLoader as cache-safe, even if its classes would not qualify as cache-safe in this CachedIntrospectionResults class.
static void | clearClassLoader(ClassLoader classLoader) Clear the introspection cache for the given ClassLoader, removing the introspection results for all classes underneath that ClassLoader, and deregistering the ClassLoader (and any of its children) from the acceptance list.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail

acceptClassLoader

public static void acceptClassLoader(ClassLoader classLoader)
Accept the given ClassLoader as cache-safe, even if its classes would not qualify as cache-safe in this CachedIntrospectionResults class.

This configuration method is only relevant in scenarios where the Spring classes reside in a 'common' ClassLoader (e.g. the system ClassLoader) whose lifecycle is not coupled to the application. In such a scenario, CachedIntrospectionResults would by default not cache any of the application's classes, since they would create a leak in the common ClassLoader.

Any acceptClassLoader call at application startup should be paired with a clearClassLoader(java.lang.ClassLoader) call at application shutdown.

Parameters:
classLoader - the ClassLoader to accept

clearClassLoader

public static void clearClassLoader(ClassLoader classLoader)
Clear the introspection cache for the given ClassLoader, removing the introspection results for all classes underneath that ClassLoader, and deregistering the ClassLoader (and any of its children) from the acceptance list.

Parameters:
classLoader - the ClassLoader to clear the cache for
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DirectFieldAccessor

org.springframework.beans
Class DirectFieldAccessor

java.lang.Object
    extended by  org.springframework.beans.PropertyEditorRegistrySupport
        extended by  org.springframework.beans.AbstractPropertyAccessor
            extended by  org.springframework.beans.DirectFieldAccessor
All Implemented Interfaces:
ConfigurablePropertyAccessor, PropertyAccessor, PropertyEditorRegistry, TypeConverter
public class DirectFieldAccessor
extends AbstractPropertyAccessor

PropertyAccessor implementation that directly accesses instance fields. Allows for direct binding to fields instead of going through JavaBean setters.

This implementation just supports fields in the actual target object. It is not able to traverse nested fields.

A DirectFieldAccessor's default for the "extractOldValueForEditor" setting is "true", since a field can always be read without side effects.

Since:
2.0
Author:
Juergen Hoeller
See Also:
AbstractPropertyAccessor.setExtractOldValueForEditor(boolean), BeanWrapper, DirectFieldBindingResult, DataBinder.initDirectFieldAccess()

Field Summary
Fields inherited from interface org.springframework.beans.PropertyAccessor
NESTED_PROPERTY_SEPARATOR, NESTED_PROPERTY_SEPARATOR_CHAR, PROPERTY_KEY_PREFIX, PROPERTY_KEY_PREFIX_CHAR, PROPERTY_KEY_SUFFIX, PROPERTY_KEY_SUFFIX_CHAR
Constructor Summary
DirectFieldAccessor(Object target)
Create a new DirectFieldAccessor for the given target object.
Method Summary
<T> T
convertIfNecessary(Object value, Class<T> requiredType, MethodParameter methodParam)
Convert the value to the required type (if necessary from a String).
 Class getPropertyType(String propertyName)
Determine the property type for the given property path.
 TypeDescriptor getPropertyTypeDescriptor(String propertyName)
Return a type descriptor for the specified property: preferably from the read method, falling back to the write method.
 Object getPropertyValue(String propertyName)
Actually get the value of a property.
 boolean isReadableProperty(String propertyName)
Determine whether the specified property is readable.
 boolean isWritableProperty(String propertyName)
Determine whether the specified property is writable.
 void setPropertyValue(String propertyName, Object newValue)
Actually set a property value.
Methods inherited from class org.springframework.beans.AbstractPropertyAccessor
convertIfNecessary, isExtractOldValueForEditor, setExtractOldValueForEditor, setPropertyValue, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues
Methods inherited from class org.springframework.beans.PropertyEditorRegistrySupport
copyCustomEditorsTo, copyDefaultEditorsTo, findCustomEditor, getConversionService, getDefaultEditor, guessPropertyTypeFromEditors, hasCustomEditorForElement, isSharedEditor, registerCustomEditor, registerCustomEditor, registerDefaultEditors, registerSharedEditor, setConversionService, useConfigValueEditors
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.ConfigurablePropertyAccessor
getConversionService, setConversionService
Methods inherited from interface org.springframework.beans.PropertyEditorRegistry
findCustomEditor, registerCustomEditor, registerCustomEditor

Constructor Detail

DirectFieldAccessor

public DirectFieldAccessor(Object target)
Create a new DirectFieldAccessor for the given target object.

Parameters:
target - the target object to access
Method Detail

isReadableProperty

public boolean isReadableProperty(String propertyName)
                           throws BeansException
Description copied from interface: PropertyAccessor
Determine whether the specified property is readable.

Returns false if the property doesn't exist.

Parameters:
propertyName - the property to check (may be a nested path and/or an indexed/mapped property)
Returns:
whether the property is readable
Throws:
BeansException

isWritableProperty

public boolean isWritableProperty(String propertyName)
                           throws BeansException
Description copied from interface: PropertyAccessor
Determine whether the specified property is writable.

Returns false if the property doesn't exist.

Parameters:
propertyName - the property to check (may be a nested path and/or an indexed/mapped property)
Returns:
whether the property is writable
Throws:
BeansException

getPropertyType

public Class getPropertyType(String propertyName)
                      throws BeansException
Description copied from class: PropertyEditorRegistrySupport
Determine the property type for the given property path.

Called by PropertyEditorRegistrySupport.findCustomEditor(java.lang.Class, java.lang.String) if no required type has been specified, to be able to find a type-specific editor even if just given a property path.

The default implementation always returns null. BeanWrapperImpl overrides this with the standard getPropertyType method as defined by the BeanWrapper interface.

Specified by:
getPropertyType in interface PropertyAccessor
Overrides:
getPropertyType in class AbstractPropertyAccessor
Parameters:
propertyName - the property path to determine the type for
Returns:
the type of the property, or null if not determinable
Throws:
InvalidPropertyException - if there is no such property or if the property isn't readable
PropertyAccessException - if the property was valid but the accessor method failed
BeansException
See Also:
PropertyAccessor.getPropertyType(String)

getPropertyTypeDescriptor

public TypeDescriptor getPropertyTypeDescriptor(String propertyName)
                                         throws BeansException
Description copied from interface: PropertyAccessor
Return a type descriptor for the specified property: preferably from the read method, falling back to the write method.

Parameters:
propertyName - the property to check (may be a nested path and/or an indexed/mapped property)
Returns:
the property type for the particular property, or null if not determinable
Throws:
InvalidPropertyException - if there is no such property or if the property isn't readable
BeansException

getPropertyValue

public Object getPropertyValue(String propertyName)
                        throws BeansException
Description copied from class: AbstractPropertyAccessor
Actually get the value of a property.

Specified by:
getPropertyValue in interface PropertyAccessor
Specified by:
getPropertyValue in class AbstractPropertyAccessor
Parameters:
propertyName - name of the property to get the value of
Returns:
the value of the property
Throws:
InvalidPropertyException - if there is no such property or if the property isn't readable
PropertyAccessException - if the property was valid but the accessor method failed
BeansException

setPropertyValue

public void setPropertyValue(String propertyName,
                             Object newValue)
                      throws BeansException
Description copied from class: AbstractPropertyAccessor
Actually set a property value.

Specified by:
setPropertyValue in interface PropertyAccessor
Specified by:
setPropertyValue in class AbstractPropertyAccessor
Parameters:
propertyName - name of the property to set value of
newValue - the new value
Throws:
InvalidPropertyException - if there is no such property or if the property isn't writable
PropertyAccessException - if the property was valid but the accessor method failed or a type mismatch occured
BeansException

convertIfNecessary

public <T> T convertIfNecessary(Object value,
                                Class<T> requiredType,
                                MethodParameter methodParam)
                     throws TypeMismatchException
Description copied from interface: TypeConverter
Convert the value to the required type (if necessary from a String).

Conversions from String to any type will typically use the setAsText method of the PropertyEditor class. Note that a PropertyEditor must be registered for the given class for this to work; this is a standard JavaBeans API. A number of PropertyEditors are automatically registered.

Parameters:
value - the value to convert
requiredType - the type we must convert to (or null if not known, for example in case of a collection element)
methodParam - the method parameter that is the target of the conversion (for analysis of generic types; may be null)
Returns:
the new value, possibly the result of type conversion
Throws:
TypeMismatchException - if type conversion failed
See Also:
PropertyEditor.setAsText(String), PropertyEditor.getValue()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MutablePropertyValues

org.springframework.beans
Class MutablePropertyValues

java.lang.Object
    extended by  org.springframework.beans.MutablePropertyValues
All Implemented Interfaces:
Serializable, PropertyValues
Direct Known Subclasses:
PortletRequestParameterPropertyValues, ServletRequestParameterPropertyValues
public class MutablePropertyValues
extends Object
implements PropertyValues, Serializable

Default implementation of the PropertyValues interface. Allows simple manipulation of properties, and provides constructors to support deep copy and construction from a Map.

Since:
13 May 2001
Author:
Rod Johnson, Juergen Hoeller, Rob Harrop
See Also:
Serialized Form

Constructor Summary
MutablePropertyValues()
Creates a new empty MutablePropertyValues object.
MutablePropertyValues(List<PropertyValue> propertyValueList)
Construct a new MutablePropertyValues object using the given List of PropertyValue objects as-is.
MutablePropertyValues(Map<?,?> original)
Construct a new MutablePropertyValues object from a Map.
MutablePropertyValues(PropertyValues original)
Deep copy constructor.
Method Summary
MutablePropertyValues | add(String propertyName, Object propertyValue) Add a PropertyValue object, replacing any existing one for the corresponding property or getting merged with it (if applicable).
MutablePropertyValues | addPropertyValue(PropertyValue pv) Add a PropertyValue object, replacing any existing one for the corresponding property or getting merged with it (if applicable).
void | addPropertyValue(String propertyName, Object propertyValue) Overloaded version of addPropertyValue that takes a property name and a property value.
MutablePropertyValues | addPropertyValues(Map<?,?> other) Add all property values from the given Map.
MutablePropertyValues | addPropertyValues(PropertyValues other) Copy all given PropertyValues into this object.
PropertyValues | changesSince(PropertyValues old) Return the changes since the previous PropertyValues.
boolean | contains(String propertyName) Is there a property value (or other processing entry) for this property?
boolean | equals(Object other)
PropertyValue | getPropertyValue(String propertyName) Return the property value with the given name, if any.
List<PropertyValue> | getPropertyValueList() Return the underlying List of PropertyValue objects in its raw form.
PropertyValue[] | getPropertyValues() Return an array of the PropertyValue objects held in this object.
int | hashCode()
boolean | isConverted() Return whether this holder contains converted values only (true), or whether the values still need to be converted (false).
boolean | isEmpty() Does this holder not contain any PropertyValue objects at all?
void | registerProcessedProperty(String propertyName) Register the specified property as "processed" in the sense of some processor calling the corresponding setter method outside of the PropertyValue(s) mechanism.
void | removePropertyValue(PropertyValue pv) Remove the given PropertyValue, if contained.
void | removePropertyValue(String propertyName) Overloaded version of removePropertyValue that takes a property name.
void | setConverted() Mark this holder as containing converted values only (i.e.
void | setPropertyValueAt(PropertyValue pv, int i) Modify a PropertyValue object held in this object.
int | size() Return the number of PropertyValue entries in the list.
String | toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

MutablePropertyValues

public MutablePropertyValues()
Creates a new empty MutablePropertyValues object.

Property values can be added with the add method.

See Also:
add(String, Object)

MutablePropertyValues

public MutablePropertyValues(PropertyValues original)
Deep copy constructor. Guarantees PropertyValue references are independent, although it can't deep copy objects currently referenced by individual PropertyValue objects.

Parameters:
original - the PropertyValues to copy
See Also:
addPropertyValues(PropertyValues)

MutablePropertyValues

public MutablePropertyValues(Map<?,?> original)
Construct a new MutablePropertyValues object from a Map.

Parameters:
original - Map with property values keyed by property name Strings
See Also:
addPropertyValues(Map)

MutablePropertyValues

public MutablePropertyValues(List<PropertyValue> propertyValueList)
Construct a new MutablePropertyValues object using the given List of PropertyValue objects as-is.

This is a constructor for advanced usage scenarios. It is not intended for typical programmatic use.

Parameters:
propertyValueList - List of PropertyValue objects
Method Detail

getPropertyValueList

public List<PropertyValue> getPropertyValueList()
Return the underlying List of PropertyValue objects in its raw form. The returned List can be modified directly, although this is not recommended.

This is an accessor for optimized access to all PropertyValue objects. It is not intended for typical programmatic use.

size

public int size()
Return the number of PropertyValue entries in the list.

addPropertyValues

public MutablePropertyValues addPropertyValues(PropertyValues other)
Copy all given PropertyValues into this object. Guarantees PropertyValue references are independent, although it can't deep copy objects currently referenced by individual PropertyValue objects.

Parameters:
other - the PropertyValues to copy
Returns:
this in order to allow for adding multiple property values in a chain

addPropertyValues

public MutablePropertyValues addPropertyValues(Map<?,?> other)
Add all property values from the given Map.

Parameters:
other - Map with property values keyed by property name, which must be a String
Returns:
this in order to allow for adding multiple property values in a chain

addPropertyValue

public MutablePropertyValues addPropertyValue(PropertyValue pv)
Add a PropertyValue object, replacing any existing one for the corresponding property or getting merged with it (if applicable).

Parameters:
pv - PropertyValue object to add
Returns:
this in order to allow for adding multiple property values in a chain

addPropertyValue

public void addPropertyValue(String propertyName,
                             Object propertyValue)
Overloaded version of addPropertyValue that takes a property name and a property value.

Note: As of Spring 3.0, we recommend using the more concise and chaining-capable variant add(java.lang.String, java.lang.Object).

Parameters:
propertyName - name of the property
propertyValue - value of the property
See Also:
addPropertyValue(PropertyValue)

add

public MutablePropertyValues add(String propertyName,
                                 Object propertyValue)
Add a PropertyValue object, replacing any existing one for the corresponding property or getting merged with it (if applicable).

Parameters:
propertyName - name of the property
propertyValue - value of the property
Returns:
this in order to allow for adding multiple property values in a chain

setPropertyValueAt

public void setPropertyValueAt(PropertyValue pv,
                               int i)
Modify a PropertyValue object held in this object. Indexed from 0.

removePropertyValue

public void removePropertyValue(PropertyValue pv)
Remove the given PropertyValue, if contained.

Parameters:
pv - the PropertyValue to remove

removePropertyValue

public void removePropertyValue(String propertyName)
Overloaded version of removePropertyValue that takes a property name.

Parameters:
propertyName - name of the property
See Also:
removePropertyValue(PropertyValue)

getPropertyValues

public PropertyValue[] getPropertyValues()
Description copied from interface: PropertyValues
Return an array of the PropertyValue objects held in this object.

Specified by:
getPropertyValues in interface PropertyValues

getPropertyValue

public PropertyValue getPropertyValue(String propertyName)
Description copied from interface: PropertyValues
Return the property value with the given name, if any.

Specified by:
getPropertyValue in interface PropertyValues
Parameters:
propertyName - the name to search for
Returns:
the property value, or null

changesSince

public PropertyValues changesSince(PropertyValues old)
Description copied from interface: PropertyValues
Return the changes since the previous PropertyValues. Subclasses should also override equals.

Specified by:
changesSince in interface PropertyValues
Parameters:
old - old property values
Returns:
PropertyValues updated or new properties. Return empty PropertyValues if there are no changes.
See Also:
Object.equals(java.lang.Object)

contains

public boolean contains(String propertyName)
Description copied from interface: PropertyValues
Is there a property value (or other processing entry) for this property?

Specified by:
contains in interface PropertyValues
Parameters:
propertyName - the name of the property we're interested in
Returns:
whether there is a property value for this property

isEmpty

public boolean isEmpty()
Description copied from interface: PropertyValues
Does this holder not contain any PropertyValue objects at all?

Specified by:
isEmpty in interface PropertyValues

registerProcessedProperty

public void registerProcessedProperty(String propertyName)
Register the specified property as "processed" in the sense of some processor calling the corresponding setter method outside of the PropertyValue(s) mechanism.

This will lead to true being returned from a contains(java.lang.String) call for the specified property.

Parameters:
propertyName - the name of the property.

setConverted

public void setConverted()
Mark this holder as containing converted values only (i.e. no runtime resolution needed anymore).

isConverted

public boolean isConverted()
Return whether this holder contains converted values only (true), or whether the values still need to be converted (false).

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertyAccessorFactory

org.springframework.beans
Class PropertyAccessorFactory

java.lang.Object
    extended by  org.springframework.beans.PropertyAccessorFactory

public abstract class PropertyAccessorFactory
extends Object

Simple factory facade for obtaining PropertyAccessor instances, in particular for BeanWrapper instances. Conceals the actual target implementation classes and their extended public signature.

Since:
2.5.2
Author:
Juergen Hoeller

Constructor Summary
PropertyAccessorFactory()
Method Summary
static BeanWrapper | forBeanPropertyAccess(Object target) Obtain a BeanWrapper for the given target object, accessing properties in JavaBeans style.
static ConfigurablePropertyAccessor | forDirectFieldAccess(Object target) Obtain a PropertyAccessor for the given target object, accessing properties in direct field style.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PropertyAccessorFactory

public PropertyAccessorFactory()
Method Detail

forBeanPropertyAccess

public static BeanWrapper forBeanPropertyAccess(Object target)
Obtain a BeanWrapper for the given target object, accessing properties in JavaBeans style.

Parameters:
target - the target object to wrap
Returns:
the property accessor
See Also:
BeanWrapperImpl

forDirectFieldAccess

public static ConfigurablePropertyAccessor forDirectFieldAccess(Object target)
Obtain a PropertyAccessor for the given target object, accessing properties in direct field style.

Parameters:
target - the target object to wrap
Returns:
the property accessor
See Also:
DirectFieldAccessor
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertyAccessorUtils

org.springframework.beans
Class PropertyAccessorUtils

java.lang.Object
    extended by  org.springframework.beans.PropertyAccessorUtils

public abstract class PropertyAccessorUtils
extends Object

Utility methods for classes that perform bean property access according to the PropertyAccessor interface.

Since:
1.2.6
Author:
Juergen Hoeller

Constructor Summary
PropertyAccessorUtils()
Method Summary
static String | canonicalPropertyName(String propertyName) Determine the canonical name for the given property path.
static String[] | canonicalPropertyNames(String[] propertyNames) Determine the canonical names for the given property paths.
static int | getFirstNestedPropertySeparatorIndex(String propertyPath) Determine the first nested property separator in the given property path, ignoring dots in keys (like "map[my.key]").
static int | getLastNestedPropertySeparatorIndex(String propertyPath) Determine the first nested property separator in the given property path, ignoring dots in keys (like "map[my.key]").
static String | getPropertyName(String propertyPath) Return the actual property name for the given property path.
static boolean | isNestedOrIndexedProperty(String propertyPath) Check whether the given property path indicates an indexed or nested property.
static boolean | matchesProperty(String registeredPath, String propertyPath) Determine whether the given registered path matches the given property path, either indicating the property itself or an indexed element of the property.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PropertyAccessorUtils

public PropertyAccessorUtils()
Method Detail

getPropertyName

public static String getPropertyName(String propertyPath)
Return the actual property name for the given property path.

Parameters:
propertyPath - the property path to determine the property name for (can include property keys, for example for specifying a map entry)
Returns:
the actual property name, without any key elements

isNestedOrIndexedProperty

public static boolean isNestedOrIndexedProperty(String propertyPath)
Check whether the given property path indicates an indexed or nested property.

Parameters:
propertyPath - the property path to check
Returns:
whether the path indicates an indexed or nested property

getFirstNestedPropertySeparatorIndex

public static int getFirstNestedPropertySeparatorIndex(String propertyPath)
Determine the first nested property separator in the given property path, ignoring dots in keys (like "map[my.key]").

Parameters:
propertyPath - the property path to check
Returns:
the index of the nested property separator, or -1 if none

getLastNestedPropertySeparatorIndex

public static int getLastNestedPropertySeparatorIndex(String propertyPath)
Determine the first nested property separator in the given property path, ignoring dots in keys (like "map[my.key]").

Parameters:
propertyPath - the property path to check
Returns:
the index of the nested property separator, or -1 if none

matchesProperty

public static boolean matchesProperty(String registeredPath,
                                      String propertyPath)
Determine whether the given registered path matches the given property path, either indicating the property itself or an indexed element of the property.

Parameters:
propertyPath - the property path (typically without index)
registeredPath - the registered path (potentially with index)
Returns:
whether the paths match

canonicalPropertyName

public static String canonicalPropertyName(String propertyName)
Determine the canonical name for the given property path. Removes surrounding quotes from map keys:
map['key'] -> map[key]
map["key"] -> map[key]

Parameters:
propertyName - the bean property path
Returns:
the canonical representation of the property path

canonicalPropertyNames

public static String[] canonicalPropertyNames(String[] propertyNames)
Determine the canonical names for the given property paths.

Parameters:
propertyNames - the bean property paths (as array)
Returns:
the canonical representation of the property paths (as array of the same size)
See Also:
canonicalPropertyName(String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertyEditorRegistrySupport

org.springframework.beans
Class PropertyEditorRegistrySupport

java.lang.Object
    extended by  org.springframework.beans.PropertyEditorRegistrySupport
All Implemented Interfaces:
PropertyEditorRegistry
Direct Known Subclasses:
AbstractPropertyAccessor, SimpleTypeConverter
public class PropertyEditorRegistrySupport
extends Object
implements PropertyEditorRegistry

Base implementation of the PropertyEditorRegistry interface. Provides management of default editors and custom editors. Mainly serves as base class for BeanWrapperImpl.

Since:
1.2.6
Author:
Juergen Hoeller, Rob Harrop
See Also:
PropertyEditorManager, PropertyEditorSupport.setAsText(java.lang.String), PropertyEditorSupport.setValue(java.lang.Object)

Constructor Summary
PropertyEditorRegistrySupport()
Method Summary
protected void | copyCustomEditorsTo(PropertyEditorRegistry target, String nestedProperty) Copy the custom editors registered in this instance to the given target registry.
protected void | copyDefaultEditorsTo(PropertyEditorRegistrySupport target) Copy the default editors registered in this instance to the given target registry.
PropertyEditor | findCustomEditor(Class requiredType, String propertyPath) Find a custom property editor for the given type and property.
ConversionService | getConversionService() Return the associated ConversionService, if any.
PropertyEditor | getDefaultEditor(Class requiredType) Retrieve the default editor for the given property type, if any.
protected Class | getPropertyType(String propertyPath) Determine the property type for the given property path.
protected Class | guessPropertyTypeFromEditors(String propertyName) Guess the property type of the specified property from the registered custom editors (provided that they were registered for a specific type).
boolean | hasCustomEditorForElement(Class elementType, String propertyPath) Determine whether this registry contains a custom editor for the specified array/collection element.
boolean | isSharedEditor(PropertyEditor propertyEditor) Check whether the given editor instance is a shared editor, that is, whether the given editor instance might be used concurrently.
void | registerCustomEditor(Class requiredType, PropertyEditor propertyEditor) Register the given custom property editor for all properties of the given type.
void | registerCustomEditor(Class requiredType, String propertyPath, PropertyEditor propertyEditor) Register the given custom property editor for the given type and property, or for all properties of the given type.
protected void | registerDefaultEditors() Activate the default editors for this registry instance, allowing for lazily registering default editors when needed.
void | registerSharedEditor(Class requiredType, PropertyEditor propertyEditor) Deprecated. as of Spring 3.0, in favor of PropertyEditorRegistrars or ConversionService usage
void | setConversionService(ConversionService conversionService) Specify a Spring 3.0 ConversionService to use for converting property values, as an alternative to JavaBeans PropertyEditors.
void | useConfigValueEditors() Activate config value editors which are only intended for configuration purposes, such as StringArrayPropertyEditor.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PropertyEditorRegistrySupport

public PropertyEditorRegistrySupport()
Method Detail

setConversionService

public void setConversionService(ConversionService conversionService)
Specify a Spring 3.0 ConversionService to use for converting property values, as an alternative to JavaBeans PropertyEditors.

getConversionService

public ConversionService getConversionService()
Return the associated ConversionService, if any.

registerDefaultEditors

protected void registerDefaultEditors()
Activate the default editors for this registry instance, allowing for lazily registering default editors when needed.

useConfigValueEditors

public void useConfigValueEditors()
Activate config value editors which are only intended for configuration purposes, such as StringArrayPropertyEditor.

Those editors are not registered by default simply because they are in general inappropriate for data binding purposes. Of course, you may register them individually in any case, through registerCustomEditor(java.lang.Class, java.beans.PropertyEditor).

getDefaultEditor

public PropertyEditor getDefaultEditor(Class requiredType)
Retrieve the default editor for the given property type, if any.

Lazily registers the default editors, if they are active.

Parameters:
requiredType - type of the property
Returns:
the default editor, or null if none found
See Also:
registerDefaultEditors()

copyDefaultEditorsTo

protected void copyDefaultEditorsTo(PropertyEditorRegistrySupport target)
Copy the default editors registered in this instance to the given target registry.

Parameters:
target - the target registry to copy to

registerCustomEditor

public void registerCustomEditor(Class requiredType,
                                 PropertyEditor propertyEditor)
Description copied from interface: PropertyEditorRegistry
Register the given custom property editor for all properties of the given type.

Specified by:
registerCustomEditor in interface PropertyEditorRegistry
Parameters:
requiredType - the type of the property
propertyEditor - the editor to register

registerCustomEditor

public void registerCustomEditor(Class requiredType,
                                 String propertyPath,
                                 PropertyEditor propertyEditor)
Description copied from interface: PropertyEditorRegistry
Register the given custom property editor for the given type and property, or for all properties of the given type.

If the property path denotes an array or Collection property, the editor will get applied either to the array/Collection itself (the PropertyEditor has to create an array or Collection value) or to each element (the PropertyEditor has to create the element type), depending on the specified required type.

Note: Only one single registered custom editor per property path is supported. In the case of a Collection/array, do not register an editor for both the Collection/array and each element on the same property.

For example, if you wanted to register an editor for "items[n].quantity" (for all values n), you would use "items.quantity" as the value of the 'propertyPath' argument to this method.

Specified by:
registerCustomEditor in interface PropertyEditorRegistry
Parameters:
requiredType - the type of the property. This may be null if a property is given but should be specified in any case, in particular in case of a Collection - making clear whether the editor is supposed to apply to the entire Collection itself or to each of its entries. So as a general rule: Do not specify null here in case of a Collection/array!
propertyPath - the path of the property (name or nested path), or null if registering an editor for all properties of the given type
propertyEditor - editor to register

registerSharedEditor

@Deprecated
public void registerSharedEditor(Class requiredType,
                                            PropertyEditor propertyEditor)
Deprecated. as of Spring 3.0, in favor of PropertyEditorRegistrars or ConversionService usage

Register the given custom property editor for all properties of the given type, indicating that the given instance is a shared editor that might be used concurrently.

Parameters:
requiredType - the type of the property
propertyEditor - the shared editor to register

isSharedEditor

public boolean isSharedEditor(PropertyEditor propertyEditor)
Check whether the given editor instance is a shared editor, that is, whether the given editor instance might be used concurrently.

Parameters:
propertyEditor - the editor instance to check
Returns:
whether the editor is a shared instance

findCustomEditor

public PropertyEditor findCustomEditor(Class requiredType,
                                       String propertyPath)
Description copied from interface: PropertyEditorRegistry
Find a custom property editor for the given type and property.

Specified by:
findCustomEditor in interface PropertyEditorRegistry
Parameters:
requiredType - the type of the property (can be null if a property is given but should be specified in any case for consistency checking)
propertyPath - the path of the property (name or nested path), or null if looking for an editor for all properties of the given type
Returns:
the registered editor, or null if none

hasCustomEditorForElement

public boolean hasCustomEditorForElement(Class elementType,
                                         String propertyPath)
Determine whether this registry contains a custom editor for the specified array/collection element.

Parameters:
elementType - the target type of the element (can be null if not known)
propertyPath - the property path (typically of the array/collection; can be null if not known)
Returns:
whether a matching custom editor has been found

getPropertyType

protected Class getPropertyType(String propertyPath)
Determine the property type for the given property path.

Called by findCustomEditor(java.lang.Class, java.lang.String) if no required type has been specified, to be able to find a type-specific editor even if just given a property path.

The default implementation always returns null. BeanWrapperImpl overrides this with the standard getPropertyType method as defined by the BeanWrapper interface.

Parameters:
propertyPath - the property path to determine the type for
Returns:
the type of the property, or null if not determinable
See Also:
PropertyAccessor.getPropertyType(String)

guessPropertyTypeFromEditors

protected Class guessPropertyTypeFromEditors(String propertyName)
Guess the property type of the specified property from the registered custom editors (provided that they were registered for a specific type).

Parameters:
propertyName - the name of the property
Returns:
the property type, or null if not determinable

copyCustomEditorsTo

protected void copyCustomEditorsTo(PropertyEditorRegistry target,
                                   String nestedProperty)
Copy the custom editors registered in this instance to the given target registry.

Parameters:
target - the target registry to copy to
nestedProperty - the nested property path of the target registry, if any. If this is non-null, only editors registered for a path below this nested property will be copied. If this is null, all editors will be copied.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertyValue

org.springframework.beans
Class PropertyValue

java.lang.Object
    extended by  org.springframework.core.AttributeAccessorSupport
        extended by  org.springframework.beans.BeanMetadataAttributeAccessor
            extended by  org.springframework.beans.PropertyValue
All Implemented Interfaces:
Serializable, BeanMetadataElement, AttributeAccessor
public class PropertyValue
extends BeanMetadataAttributeAccessor
implements Serializable

Object to hold information and value for an individual bean property. Using an object here, rather than just storing all properties in a map keyed by property name, allows for more flexibility, and the ability to handle indexed properties etc in an optimized way.

Note that the value doesn't need to be the final required type: A BeanWrapper implementation should handle any necessary conversion, as this object doesn't know anything about the objects it will be applied to.

Since:
13 May 2001
Author:
Rod Johnson, Rob Harrop, Juergen Hoeller
See Also:
PropertyValues, BeanWrapper, Serialized Form

Constructor Summary
PropertyValue(PropertyValue original)
Copy constructor.
PropertyValue(PropertyValue original, Object newValue)
Constructor that exposes a new value for an original value holder.
PropertyValue(String name, Object value)
Create a new PropertyValue instance.
Method Summary
boolean | equals(Object other)
Object | getConvertedValue() Return the converted value of the constructor argument, after processed type conversion.
String | getName() Return the name of the property.
PropertyValue | getOriginalPropertyValue() Return the original PropertyValue instance for this value holder.
Object | getValue() Return the value of the property.
int | hashCode()
boolean | isConverted() Return whether this holder contains a converted value already (true), or whether the value still needs to be converted (false).
boolean | isOptional()
void | setConvertedValue(Object value) Set the converted value of the constructor argument, after processed type conversion.
void | setOptional(boolean optional)
String | toString()
Methods inherited from class org.springframework.beans.BeanMetadataAttributeAccessor
addMetadataAttribute, getAttribute, getMetadataAttribute, getSource, removeAttribute, setAttribute, setSource
Methods inherited from class org.springframework.core.AttributeAccessorSupport
attributeNames, copyAttributesFrom, hasAttribute
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

PropertyValue

public PropertyValue(String name,
                     Object value)
Create a new PropertyValue instance.

Parameters:
name - the name of the property (never null)
value - the value of the property (possibly before type conversion)

PropertyValue

public PropertyValue(PropertyValue original)
Copy constructor.

Parameters:
original - the PropertyValue to copy (never null)

PropertyValue

public PropertyValue(PropertyValue original,
                     Object newValue)
Constructor that exposes a new value for an original value holder. The original holder will be exposed as source of the new holder.

Parameters:
original - the PropertyValue to link to (never null)
newValue - the new value to apply
Method Detail

getName

public String getName()
Return the name of the property.

getValue

public Object getValue()
Return the value of the property.

Note that type conversion will not have occurred here. It is the responsibility of the BeanWrapper implementation to perform type conversion.

getOriginalPropertyValue

public PropertyValue getOriginalPropertyValue()
Return the original PropertyValue instance for this value holder.

Returns:
the original PropertyValue (either a source of this value holder or this value holder itself).

setOptional

public void setOptional(boolean optional)

isOptional

public boolean isOptional()

isConverted

public boolean isConverted()
Return whether this holder contains a converted value already (true), or whether the value still needs to be converted (false).

setConvertedValue

public void setConvertedValue(Object value)
Set the converted value of the constructor argument, after processed type conversion.

getConvertedValue

public Object getConvertedValue()
Return the converted value of the constructor argument, after processed type conversion.

equals

public boolean equals(Object other)
Overrides:
equals in class AttributeAccessorSupport

hashCode

public int hashCode()
Overrides:
hashCode in class AttributeAccessorSupport

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertyValuesEditor

org.springframework.beans
Class PropertyValuesEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.beans.PropertyValuesEditor
All Implemented Interfaces:
PropertyEditor
public class PropertyValuesEditor
extends PropertyEditorSupport

Editor for a PropertyValues object.

The required format is defined in the Properties documentation. Each property must be on a new line.

The present implementation relies on a PropertiesEditor underneath.

Author:
Rod Johnson, Juergen Hoeller

Constructor Summary
PropertyValuesEditor()
Method Summary
 void setAsText(String text)
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getAsText, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PropertyValuesEditor

public PropertyValuesEditor()
Method Detail

setAsText

public void setAsText(String text)
               throws IllegalArgumentException
Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport
Throws:
IllegalArgumentException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleTypeConverter

org.springframework.beans
Class SimpleTypeConverter

java.lang.Object
    extended by  org.springframework.beans.PropertyEditorRegistrySupport
        extended by  org.springframework.beans.SimpleTypeConverter
All Implemented Interfaces:
PropertyEditorRegistry, TypeConverter
public class SimpleTypeConverter
extends PropertyEditorRegistrySupport
implements TypeConverter

Simple implementation of the TypeConverter interface that does not operate on any specific target object. This is an alternative to using a full-blown BeanWrapperImpl instance for arbitrary type conversion needs.

Since:
2.0
Author:
Juergen Hoeller
See Also:
BeanWrapperImpl

Constructor Summary
SimpleTypeConverter()
Method Summary
<T> T
convertIfNecessary(Object value, Class<T> requiredType)
Convert the value to the required type (if necessary from a String).
<T> T
convertIfNecessary(Object value, Class<T> requiredType, MethodParameter methodParam)
Convert the value to the required type (if necessary from a String).
Methods inherited from class org.springframework.beans.PropertyEditorRegistrySupport
copyCustomEditorsTo, copyDefaultEditorsTo, findCustomEditor, getConversionService, getDefaultEditor, getPropertyType, guessPropertyTypeFromEditors, hasCustomEditorForElement, isSharedEditor, registerCustomEditor, registerCustomEditor, registerDefaultEditors, registerSharedEditor, setConversionService, useConfigValueEditors
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleTypeConverter

public SimpleTypeConverter()
Method Detail

convertIfNecessary

public <T> T convertIfNecessary(Object value,
                                Class<T> requiredType)
                     throws TypeMismatchException
Description copied from interface: TypeConverter
Convert the value to the required type (if necessary from a String).

Conversions from String to any type will typically use the setAsText method of the PropertyEditor class. Note that a PropertyEditor must be registered for the given class for this to work; this is a standard JavaBeans API. A number of PropertyEditors are automatically registered.

Specified by:
convertIfNecessary in interface TypeConverter
Parameters:
value - the value to convert
requiredType - the type we must convert to (or null if not known, for example in case of a collection element)
Returns:
the new value, possibly the result of type conversion
Throws:
TypeMismatchException - if type conversion failed
See Also:
PropertyEditor.setAsText(String), PropertyEditor.getValue()

convertIfNecessary

public <T> T convertIfNecessary(Object value,
                                Class<T> requiredType,
                                MethodParameter methodParam)
                     throws TypeMismatchException
Description copied from interface: TypeConverter
Convert the value to the required type (if necessary from a String).

Conversions from String to any type will typically use the setAsText method of the PropertyEditor class. Note that a PropertyEditor must be registered for the given class for this to work; this is a standard JavaBeans API. A number of PropertyEditors are automatically registered.

Specified by:
convertIfNecessary in interface TypeConverter
Parameters:
value - the value to convert
requiredType - the type we must convert to (or null if not known, for example in case of a collection element)
methodParam - the method parameter that is the target of the conversion (for analysis of generic types; may be null)
Returns:
the new value, possibly the result of type conversion
Throws:
TypeMismatchException - if type conversion failed
See Also:
PropertyEditor.setAsText(String), PropertyEditor.getValue()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanInstantiationException

org.springframework.beans
Class BeanInstantiationException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.beans.BeansException
                        extended by  org.springframework.beans.FatalBeanException
                            extended by  org.springframework.beans.BeanInstantiationException
All Implemented Interfaces:
Serializable
public class BeanInstantiationException
extends FatalBeanException

Exception thrown when instantiation of a bean failed. Carries the offending bean class.

Since:
1.2.8
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
BeanInstantiationException(Class beanClass, String msg)
Create a new BeanInstantiationException.
BeanInstantiationException(Class beanClass, String msg, Throwable cause)
Create a new BeanInstantiationException.
Method Summary
 Class getBeanClass()
Return the offending bean class.
Methods inherited from class org.springframework.beans.BeansException
equals, hashCode
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

BeanInstantiationException

public BeanInstantiationException(Class beanClass,
                                  String msg)
Create a new BeanInstantiationException.

Parameters:
beanClass - the offending bean class
msg - the detail message

BeanInstantiationException

public BeanInstantiationException(Class beanClass,
                                  String msg,
                                  Throwable cause)
Create a new BeanInstantiationException.

Parameters:
beanClass - the offending bean class
msg - the detail message
cause - the root cause
Method Detail

getBeanClass

public Class getBeanClass()
Return the offending bean class.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeansException

org.springframework.beans
Class BeansException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.beans.BeansException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
BeanNotOfRequiredTypeException, FatalBeanException, NoSuchBeanDefinitionException, PropertyAccessException, PropertyBatchUpdateException
public abstract class BeansException
extends NestedRuntimeException

Abstract superclass for all exceptions thrown in the beans package and subpackages.

Note that this is a runtime (unchecked) exception. Beans exceptions are usually fatal; there is no reason for them to be checked.

Author:
Rod Johnson, Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
BeansException(String msg)
Create a new BeansException with the specified message.
BeansException(String msg, Throwable cause)
Create a new BeansException with the specified message and root cause.
Method Summary
boolean | equals(Object other)
int | hashCode()
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

BeansException

public BeansException(String msg)
Create a new BeansException with the specified message.

Parameters:
msg - the detail message

BeansException

public BeansException(String msg,
                      Throwable cause)
Create a new BeansException with the specified message and root cause.

Parameters:
msg - the detail message
cause - the root cause
Method Detail

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConversionNotSupportedException

org.springframework.beans
Class ConversionNotSupportedException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.beans.BeansException
                        extended by  org.springframework.beans.PropertyAccessException
                            extended by  org.springframework.beans.TypeMismatchException
                                extended by  org.springframework.beans.ConversionNotSupportedException
All Implemented Interfaces:
Serializable, ErrorCoded
public class ConversionNotSupportedException
extends TypeMismatchException

Exception thrown when no suitable editor or converter can be found for a bean property.

Since:
3.0
Author:
Arjen Poutsma, Juergen Hoeller
See Also:
Serialized Form

Field Summary
Fields inherited from class org.springframework.beans.TypeMismatchException
ERROR_CODE
Constructor Summary
ConversionNotSupportedException(Object value, Class requiredType, Throwable cause)
Create a new ConversionNotSupportedException.
ConversionNotSupportedException(PropertyChangeEvent propertyChangeEvent, Class requiredType, Throwable cause)
Create a new ConversionNotSupportedException.
Method Summary
Methods inherited from class org.springframework.beans.TypeMismatchException
getErrorCode, getRequiredType, getValue
Methods inherited from class org.springframework.beans.PropertyAccessException
getPropertyChangeEvent, getPropertyName
Methods inherited from class org.springframework.beans.BeansException
equals, hashCode
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

ConversionNotSupportedException

public ConversionNotSupportedException(PropertyChangeEvent propertyChangeEvent,
                                       Class requiredType,
                                       Throwable cause)
Create a new ConversionNotSupportedException.

Parameters:
propertyChangeEvent - the PropertyChangeEvent that resulted in the problem
requiredType - the required target type (or null if not known)
cause - the root cause (may be null)

ConversionNotSupportedException

public ConversionNotSupportedException(Object value,
                                       Class requiredType,
                                       Throwable cause)
Create a new ConversionNotSupportedException.

Parameters:
value - the offending value that couldn't be converted (may be null)
requiredType - the required target type (or null if not known)
cause - the root cause (may be null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FatalBeanException

org.springframework.beans
Class FatalBeanException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.beans.BeansException
                        extended by  org.springframework.beans.FatalBeanException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ApplicationContextException, BeanCreationException, BeanDefinitionStoreException, BeanDefinitionValidationException, BeanExpressionException, BeanInitializationException, BeanInstantiationException, BootstrapException, CannotLoadBeanClassException, FactoryBeanNotInitializedException, InvalidPropertyException
public class FatalBeanException
extends BeansException

Thrown on an unrecoverable problem encountered in the beans packages or sub-packages, e.g. bad class or field.

Author:
Rod Johnson
See Also:
Serialized Form

Constructor Summary
FatalBeanException(String msg)
Create a new FatalBeanException with the specified message.
FatalBeanException(String msg, Throwable cause)
Create a new FatalBeanException with the specified message and root cause.
Method Summary
Methods inherited from class org.springframework.beans.BeansException
equals, hashCode
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

FatalBeanException

public FatalBeanException(String msg)
Create a new FatalBeanException with the specified message.

Parameters:
msg - the detail message

FatalBeanException

public FatalBeanException(String msg,
                          Throwable cause)
Create a new FatalBeanException with the specified message and root cause.

Parameters:
msg - the detail message
cause - the root cause
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InvalidPropertyException

org.springframework.beans
Class InvalidPropertyException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.beans.BeansException
                        extended by  org.springframework.beans.FatalBeanException
                            extended by  org.springframework.beans.InvalidPropertyException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
NotReadablePropertyException, NotWritablePropertyException, NullValueInNestedPathException
public class InvalidPropertyException
extends FatalBeanException

Exception thrown when referring to an invalid bean property. Carries the offending bean class and property name.

Since:
1.0.2
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
InvalidPropertyException(Class beanClass, String propertyName, String msg)
Create a new InvalidPropertyException.
InvalidPropertyException(Class beanClass, String propertyName, String msg, Throwable cause)
Create a new InvalidPropertyException.
Method Summary
Class | getBeanClass() Return the offending bean class.
String | getPropertyName() Return the name of the offending property.
Methods inherited from class org.springframework.beans.BeansException
equals, hashCode
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

InvalidPropertyException

public InvalidPropertyException(Class beanClass,
                                String propertyName,
                                String msg)
Create a new InvalidPropertyException.

Parameters:
beanClass - the offending bean class
propertyName - the offending property
msg - the detail message

InvalidPropertyException

public InvalidPropertyException(Class beanClass,
                                String propertyName,
                                String msg,
                                Throwable cause)
Create a new InvalidPropertyException.

Parameters:
beanClass - the offending bean class
propertyName - the offending property
msg - the detail message
cause - the root cause
Method Detail

getBeanClass

public Class getBeanClass()
Return the offending bean class.

getPropertyName

public String getPropertyName()
Return the name of the offending property.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MethodInvocationException

org.springframework.beans
Class MethodInvocationException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.beans.BeansException
                        extended by  org.springframework.beans.PropertyAccessException
                            extended by  org.springframework.beans.MethodInvocationException
All Implemented Interfaces:
Serializable, ErrorCoded
public class MethodInvocationException
extends PropertyAccessException

Thrown when a bean property getter or setter method throws an exception, analogous to an InvocationTargetException.

Author:
Rod Johnson
See Also:
Serialized Form

Field Summary
static String ERROR_CODE
Error code that a method invocation error will be registered with.
Constructor Summary
MethodInvocationException(PropertyChangeEvent propertyChangeEvent, Throwable cause)
Create a new MethodInvocationException.
Method Summary
 String getErrorCode()
Return the error code associated with this failure.
Methods inherited from class org.springframework.beans.PropertyAccessException
getPropertyChangeEvent, getPropertyName, getValue
Methods inherited from class org.springframework.beans.BeansException
equals, hashCode
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail

ERROR_CODE

public static final String ERROR_CODE
Error code that a method invocation error will be registered with.

See Also:
Constant Field Values
Constructor Detail

MethodInvocationException

public MethodInvocationException(PropertyChangeEvent propertyChangeEvent,
                                 Throwable cause)
Create a new MethodInvocationException.

Parameters:
propertyChangeEvent - PropertyChangeEvent that resulted in an exception
cause - the Throwable raised by the invoked method
Method Detail

getErrorCode

public String getErrorCode()
Description copied from interface: ErrorCoded
Return the error code associated with this failure. The GUI can render this any way it pleases, allowing for localization etc.

Returns:
a String error code associated with this failure, or null if not error-coded
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NotReadablePropertyException

org.springframework.beans
Class NotReadablePropertyException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.beans.BeansException
                        extended by  org.springframework.beans.FatalBeanException
                            extended by  org.springframework.beans.InvalidPropertyException
                                extended by  org.springframework.beans.NotReadablePropertyException
All Implemented Interfaces:
Serializable
public class NotReadablePropertyException
extends InvalidPropertyException

Exception thrown on an attempt to get the value of a property that isn't readable, because there's no getter method.

Since:
1.0.2
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
NotReadablePropertyException(Class beanClass, String propertyName)
Create a new NotReadablePropertyException.
NotReadablePropertyException(Class beanClass, String propertyName, String msg)
Create a new NotReadablePropertyException.
Method Summary
Methods inherited from class org.springframework.beans.InvalidPropertyException
getBeanClass, getPropertyName
Methods inherited from class org.springframework.beans.BeansException
equals, hashCode
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

NotReadablePropertyException

public NotReadablePropertyException(Class beanClass,
                                    String propertyName)
Create a new NotReadablePropertyException.

Parameters:
beanClass - the offending bean class
propertyName - the offending property

NotReadablePropertyException

public NotReadablePropertyException(Class beanClass,
                                    String propertyName,
                                    String msg)
Create a new NotReadablePropertyException.

Parameters:
beanClass - the offending bean class
propertyName - the offending property
msg - the detail message
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NotWritablePropertyException

org.springframework.beans
Class NotWritablePropertyException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.beans.BeansException
                        extended by  org.springframework.beans.FatalBeanException
                            extended by  org.springframework.beans.InvalidPropertyException
                                extended by  org.springframework.beans.NotWritablePropertyException
All Implemented Interfaces:
Serializable
public class NotWritablePropertyException
extends InvalidPropertyException

Exception thrown on an attempt to set the value of a property that is not writable (typically because there is no setter method).

Author:
Rod Johnson, Alef Arendsen, Arjen Poutsma
See Also:
Serialized Form

Constructor Summary
NotWritablePropertyException(Class beanClass, String propertyName)
Create a new NotWritablePropertyException.
NotWritablePropertyException(Class beanClass, String propertyName, String msg)
Create a new NotWritablePropertyException.
NotWritablePropertyException(Class beanClass, String propertyName, String msg, String[] possibleMatches)
Create a new NotWritablePropertyException.
NotWritablePropertyException(Class beanClass, String propertyName, String msg, Throwable cause)
Create a new NotWritablePropertyException.
Method Summary
 String[] getPossibleMatches()
Return suggestions for actual bean property names that closely match the invalid property name, if any.
Methods inherited from class org.springframework.beans.InvalidPropertyException
getBeanClass, getPropertyName
Methods inherited from class org.springframework.beans.BeansException
equals, hashCode
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

NotWritablePropertyException

public NotWritablePropertyException(Class beanClass,
                                    String propertyName)
Create a new NotWritablePropertyException.

Parameters:
beanClass - the offending bean class
propertyName - the offending property name

NotWritablePropertyException

public NotWritablePropertyException(Class beanClass,
                                    String propertyName,
                                    String msg)
Create a new NotWritablePropertyException.

Parameters:
beanClass - the offending bean class
propertyName - the offending property name
msg - the detail message

NotWritablePropertyException

public NotWritablePropertyException(Class beanClass,
                                    String propertyName,
                                    String msg,
                                    Throwable cause)
Create a new NotWritablePropertyException.

Parameters:
beanClass - the offending bean class
propertyName - the offending property name
msg - the detail message
cause - the root cause

NotWritablePropertyException

public NotWritablePropertyException(Class beanClass,
                                    String propertyName,
                                    String msg,
                                    String[] possibleMatches)
Create a new NotWritablePropertyException.

Parameters:
beanClass - the offending bean class
propertyName - the offending property name
msg - the detail message
possibleMatches - suggestions for actual bean property names that closely match the invalid property name
Method Detail

getPossibleMatches

public String[] getPossibleMatches()
Return suggestions for actual bean property names that closely match the invalid property name, if any.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NullValueInNestedPathException

org.springframework.beans
Class NullValueInNestedPathException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.beans.BeansException
                        extended by  org.springframework.beans.FatalBeanException
                            extended by  org.springframework.beans.InvalidPropertyException
                                extended by  org.springframework.beans.NullValueInNestedPathException
All Implemented Interfaces:
Serializable
public class NullValueInNestedPathException
extends InvalidPropertyException

Exception thrown when navigation of a valid nested property path encounters a NullPointerException.

For example, navigating "spouse.age" could fail because the spouse property of the target object has a null value.

Author:
Rod Johnson
See Also:
Serialized Form

Constructor Summary
NullValueInNestedPathException(Class beanClass, String propertyName)
Create a new NullValueInNestedPathException.
NullValueInNestedPathException(Class beanClass, String propertyName, String msg)
Create a new NullValueInNestedPathException.
Method Summary
Methods inherited from class org.springframework.beans.InvalidPropertyException
getBeanClass, getPropertyName
Methods inherited from class org.springframework.beans.BeansException
equals, hashCode
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

NullValueInNestedPathException

public NullValueInNestedPathException(Class beanClass,
                                      String propertyName)
Create a new NullValueInNestedPathException.

Parameters:
beanClass - the offending bean class
propertyName - the offending property

NullValueInNestedPathException

public NullValueInNestedPathException(Class beanClass,
                                      String propertyName,
                                      String msg)
Create a new NullValueInNestedPathException.

Parameters:
beanClass - the offending bean class
propertyName - the offending property
msg - the detail message
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertyAccessException

org.springframework.beans
Class PropertyAccessException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.beans.BeansException
                        extended by  org.springframework.beans.PropertyAccessException
All Implemented Interfaces:
Serializable, ErrorCoded
Direct Known Subclasses:
MethodInvocationException, TypeMismatchException
public abstract class PropertyAccessException
extends BeansException
implements ErrorCoded

Superclass for exceptions related to a property access, such as type mismatch or invocation target exception.

Author:
Rod Johnson, Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
PropertyAccessException(PropertyChangeEvent propertyChangeEvent, String msg, Throwable cause)
Create a new PropertyAccessException.
PropertyAccessException(String msg, Throwable cause)
Create a new PropertyAccessException without PropertyChangeEvent.
Method Summary
PropertyChangeEvent | getPropertyChangeEvent() Return the PropertyChangeEvent that resulted in the problem.
String | getPropertyName() Return the name of the affected property, if available.
Object | getValue() Return the affected value that was about to be set, if any.
Methods inherited from class org.springframework.beans.BeansException
equals, hashCode
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.core.ErrorCoded
getErrorCode

Constructor Detail

PropertyAccessException

public PropertyAccessException(PropertyChangeEvent propertyChangeEvent,
                               String msg,
                               Throwable cause)
Create a new PropertyAccessException.

Parameters:
propertyChangeEvent - the PropertyChangeEvent that resulted in the problem
msg - the detail message
cause - the root cause

PropertyAccessException

public PropertyAccessException(String msg,
                               Throwable cause)
Create a new PropertyAccessException without PropertyChangeEvent.

Parameters:
msg - the detail message
cause - the root cause
Method Detail

getPropertyChangeEvent

public PropertyChangeEvent getPropertyChangeEvent()
Return the PropertyChangeEvent that resulted in the problem.

May be null; only available if an actual bean property was affected.

getPropertyName

public String getPropertyName()
Return the name of the affected property, if available.

getValue

public Object getValue()
Return the affected value that was about to be set, if any.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertyBatchUpdateException

org.springframework.beans
Class PropertyBatchUpdateException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.beans.BeansException
                        extended by  org.springframework.beans.PropertyBatchUpdateException
All Implemented Interfaces:
Serializable
public class PropertyBatchUpdateException
extends BeansException

Combined exception, composed of individual PropertyAccessException instances. An object of this class is created at the beginning of the binding process, and errors added to it as necessary.

The binding process continues when it encounters application-level PropertyAccessExceptions, applying those changes that can be applied and storing rejected changes in an object of this class.

Since:
18 April 2001
Author:
Rod Johnson, Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
PropertyBatchUpdateException(PropertyAccessException[] propertyAccessExceptions)
Create a new PropertyBatchUpdateException.
Method Summary
boolean | contains(Class exType) Check whether this exception contains an exception of the given type: either it is of the given class itself or it contains a nested cause of the given type.
int | getExceptionCount() If this returns 0, no errors were encountered during binding.
String | getMessage() Return the detail message, including the message from the nested exception if there is one.
PropertyAccessException | getPropertyAccessException(String propertyName) Return the exception for this field, or null if there isn't any.
PropertyAccessException[] | getPropertyAccessExceptions() Return an array of the propertyAccessExceptions stored in this object.
void | printStackTrace(PrintStream ps)
void | printStackTrace(PrintWriter pw)
String | toString()
Methods inherited from class org.springframework.beans.BeansException
equals, hashCode
Methods inherited from class org.springframework.core.NestedRuntimeException
getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, setStackTrace
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

PropertyBatchUpdateException

public PropertyBatchUpdateException(PropertyAccessException[] propertyAccessExceptions)
Create a new PropertyBatchUpdateException.

Parameters:
propertyAccessExceptions - the List of PropertyAccessExceptions
Method Detail

getExceptionCount

public final int getExceptionCount()
If this returns 0, no errors were encountered during binding.

getPropertyAccessExceptions

public final PropertyAccessException[] getPropertyAccessExceptions()
Return an array of the propertyAccessExceptions stored in this object.

Will return the empty array (not null) if there were no errors.

getPropertyAccessException

public PropertyAccessException getPropertyAccessException(String propertyName)
Return the exception for this field, or null if there isn't any.

getMessage

public String getMessage()
Description copied from class: NestedRuntimeException
Return the detail message, including the message from the nested exception if there is one.

Overrides:
getMessage in class NestedRuntimeException

toString

public String toString()
Overrides:
toString in class Throwable

printStackTrace

public void printStackTrace(PrintStream ps)
Overrides:
printStackTrace in class Throwable

printStackTrace

public void printStackTrace(PrintWriter pw)
Overrides:
printStackTrace in class Throwable

contains

public boolean contains(Class exType)
Description copied from class: NestedRuntimeException
Check whether this exception contains an exception of the given type: either it is of the given class itself or it contains a nested cause of the given type.

Overrides:
contains in class NestedRuntimeException
Parameters:
exType - the exception type to look for
Returns:
whether there is a nested exception of the specified type
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TypeMismatchException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.beans
Class TypeMismatchException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.beans.BeansException
                        extended by  org.springframework.beans.PropertyAccessException
                            extended by  org.springframework.beans.TypeMismatchException
All Implemented Interfaces:
Serializable, ErrorCoded
Direct Known Subclasses:
ConversionNotSupportedException
public class TypeMismatchException
extends PropertyAccessException

Exception thrown on a type mismatch when trying to set a bean property.

Author:
Rod Johnson, Juergen Hoeller
See Also:
Serialized Form

Field Summary
static String ERROR_CODE
Error code that a type mismatch error will be registered with.
Constructor Summary
TypeMismatchException(Object value, Class requiredType)
Create a new TypeMismatchException without PropertyChangeEvent.
TypeMismatchException(Object value, Class requiredType, Throwable cause)
Create a new TypeMismatchException without PropertyChangeEvent.
TypeMismatchException(PropertyChangeEvent propertyChangeEvent, Class requiredType)
Create a new TypeMismatchException.
TypeMismatchException(PropertyChangeEvent propertyChangeEvent, Class requiredType, Throwable cause)
Create a new TypeMismatchException.
Method Summary
String | getErrorCode() Return the error code associated with this failure.
Class | getRequiredType() Return the required target type, if any.
Object | getValue() Return the offending value (may be null)
Methods inherited from class org.springframework.beans.PropertyAccessException
getPropertyChangeEvent, getPropertyName
Methods inherited from class org.springframework.beans.BeansException
equals, hashCode
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail

ERROR_CODE

public static final String ERROR_CODE
Error code that a type mismatch error will be registered with.

See Also:
Constant Field Values
Constructor Detail

TypeMismatchException

public TypeMismatchException(PropertyChangeEvent propertyChangeEvent,
                             Class requiredType)
Create a new TypeMismatchException.

Parameters:
propertyChangeEvent - the PropertyChangeEvent that resulted in the problem
requiredType - the required target type

TypeMismatchException

public TypeMismatchException(PropertyChangeEvent propertyChangeEvent,
                             Class requiredType,
                             Throwable cause)
Create a new TypeMismatchException.

Parameters:
propertyChangeEvent - the PropertyChangeEvent that resulted in the problem
requiredType - the required target type (or null if not known)
cause - the root cause (may be null)

TypeMismatchException

public TypeMismatchException(Object value,
                             Class requiredType)
Create a new TypeMismatchException without PropertyChangeEvent.

Parameters:
value - the offending value that couldn't be converted (may be null)
requiredType - the required target type (or null if not known)

TypeMismatchException

public TypeMismatchException(Object value,
                             Class requiredType,
                             Throwable cause)
Create a new TypeMismatchException without PropertyChangeEvent.

Parameters:
value - the offending value that couldn't be converted (may be null)
requiredType - the required target type (or null if not known)
cause - the root cause (may be null)
Method Detail

getValue

public Object getValue()
Return the offending value (may be null)

Overrides:
getValue in class PropertyAccessException

getRequiredType

public Class getRequiredType()
Return the required target type, if any.

getErrorCode

public String getErrorCode()
Description copied from interface: ErrorCoded
Return the error code associated with this failure. The GUI can render this any way it pleases, allowing for localization etc.

Returns:
a String error code associated with this failure, or null if not error-coded
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.beans.annotation

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.beans.annotation

Support package for beans-style handling of Java 5 annotations.

See:
Description

Class Summary
AnnotationBeanUtils General utility methods for working with annotations in JavaBeans style.

Package org.springframework.beans.annotation Description

Support package for beans-style handling of Java 5 annotations.


org.springframework.beans.annotation Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.beans.annotation

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.beans.annotation.AnnotationBeanUtils


AnnotationBeanUtils

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.beans.annotation
Class AnnotationBeanUtils

java.lang.Object
    extended by  org.springframework.beans.annotation.AnnotationBeanUtils

public abstract class AnnotationBeanUtils
extends Object

General utility methods for working with annotations in JavaBeans style.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller

Constructor Summary
AnnotationBeanUtils()
Method Summary
static void copyPropertiesToBean(Annotation ann, Object bean, String... excludedProperties)
Copy the properties of the supplied Annotation to the supplied target bean.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AnnotationBeanUtils

public AnnotationBeanUtils()
Method Detail

copyPropertiesToBean

public static void copyPropertiesToBean(Annotation ann,
                                        Object bean,
                                        String... excludedProperties)
Copy the properties of the supplied Annotation to the supplied target bean. Any properties defined in excludedProperties will not be copied.

See Also:
BeanWrapper
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.beans.factory

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.beans.factory

The core package implementing Spring's lightweight Inversion of Control (IoC) container.

See:
Description

Interface Summary
BeanClassLoaderAware | Callback that allows a bean to be aware of the bean class loader; that is, the class loader used by the present bean factory to load bean classes.
BeanFactory | The root interface for accessing a Spring bean container.
BeanFactoryAware | Interface to be implemented by beans that wish to be aware of their owning BeanFactory.
BeanNameAware | Interface to be implemented by beans that want to be aware of their bean name in a bean factory.
DisposableBean | Interface to be implemented by beans that want to release resources on destruction.
FactoryBean<T> | Interface to be implemented by objects used within a BeanFactory which are themselves factories.
HierarchicalBeanFactory | Sub-interface implemented by bean factories that can be part of a hierarchy.
InitializingBean | Interface to be implemented by beans that need to react once all their properties have been set by a BeanFactory: for example, to perform custom initialization, or merely to check that all mandatory properties have been set.
ListableBeanFactory | Extension of the BeanFactory interface to be implemented by bean factories that can enumerate all their bean instances, rather than attempting bean lookup by name one by one as requested by clients.
NamedBean | Counterpart of BeanNameAware.
ObjectFactory<T> | Defines a factory which can return an Object instance (possibly shared or independent) when invoked.
SmartFactoryBean<T> | Extension of the FactoryBean interface.

Class Summary
BeanFactoryUtils Convenience methods operating on bean factories, in particular on the ListableBeanFactory interface.

Exception Summary
BeanCreationException | Exception thrown when a BeanFactory encounters an error when attempting to create a bean from a bean definition.
BeanCreationNotAllowedException | Exception thrown in case of a bean being requested despite bean creation currently not being allowed (for example, during the shutdown phase of a bean factory).
BeanCurrentlyInCreationException | Exception thrown in case of a reference to a bean that's currently in creation.
BeanDefinitionStoreException | Exception thrown when a BeanFactory encounters an invalid bean definition: e.g.
BeanExpressionException | Exception that indicates an expression evaluation attempt having failed.
BeanInitializationException | Exception that a bean implementation is suggested to throw if its own factory-aware initialization code fails.
BeanIsAbstractException | Exception thrown when a bean instance has been requested for a bean definition which has been marked as abstract.
BeanIsNotAFactoryException | Exception thrown when a bean is not a factory, but a user tries to get at the factory for the given bean name.
BeanNotOfRequiredTypeException | Thrown when a bean doesn't match the expected type.
CannotLoadBeanClassException | Exception thrown when the BeanFactory cannot load the specified class of a given bean.
FactoryBeanNotInitializedException | Exception to be thrown from a FactoryBean's getObject() method if the bean is not fully initialized yet, for example because it is involved in a circular reference.
NoSuchBeanDefinitionException | Exception thrown when a BeanFactory is asked for a bean instance name for which it cannot find a definition.
UnsatisfiedDependencyException | Exception thrown when a bean depends on other beans or simple properties that were not specified in the bean factory definition, although dependency checking was enabled.

Package org.springframework.beans.factory Description

The core package implementing Spring's lightweight Inversion of Control (IoC) container.

Provides an alternative to the Singleton and Prototype design patterns, including a consistent approach to configuration management. Builds on the org.springframework.beans package.

This package and related packages are discussed in Chapter 11 of Expert One-On-One J2EE Design and Development by Rod Johnson (Wrox, 2002).


org.springframework.beans.factory Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.beans.factory

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.beans.factory.BeanFactoryUtils
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.beans.BeansException
              • org.springframework.beans.factory.BeanNotOfRequiredTypeException
                • org.springframework.beans.factory.BeanIsNotAFactoryException
              • org.springframework.beans.FatalBeanException
                • org.springframework.beans.factory.BeanCreationException
                  • org.springframework.beans.factory.BeanCreationNotAllowedException
                  • org.springframework.beans.factory.BeanCurrentlyInCreationException
                  • org.springframework.beans.factory.BeanIsAbstractException
                  • org.springframework.beans.factory.UnsatisfiedDependencyException
                • org.springframework.beans.factory.BeanDefinitionStoreException
                • org.springframework.beans.factory.BeanExpressionException
                • org.springframework.beans.factory.BeanInitializationException
                • org.springframework.beans.factory.CannotLoadBeanClassException
                • org.springframework.beans.factory.FactoryBeanNotInitializedException
              • org.springframework.beans.factory.NoSuchBeanDefinitionException

Interface Hierarchy

  • org.springframework.beans.factory.BeanClassLoaderAware
  • org.springframework.beans.factory.BeanFactory
    • org.springframework.beans.factory.HierarchicalBeanFactory
    • org.springframework.beans.factory.ListableBeanFactory
  • org.springframework.beans.factory.BeanFactoryAware
  • org.springframework.beans.factory.BeanNameAware
  • org.springframework.beans.factory.DisposableBean
  • org.springframework.beans.factory.FactoryBean<T>
    • org.springframework.beans.factory.SmartFactoryBean<T>
  • org.springframework.beans.factory.InitializingBean
  • org.springframework.beans.factory.NamedBean
  • org.springframework.beans.factory.ObjectFactory<T>


BeanClassLoaderAware

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.beans.factory
Interface BeanClassLoaderAware

All Known Implementing Classes:
AbstractAdvisorAutoProxyCreator, AbstractAutoProxyCreator, AbstractEntityManagerFactoryBean, AbstractFactoryBean, AbstractHttpInvokerRequestExecutor, AbstractServiceLoaderBasedFactoryBean, AbstractSingletonProxyFactoryBean, AnnotationAwareAspectJAutoProxyCreator, AnnotationMBeanExporter, AnnotationSessionFactoryBean, AspectJAwareAdvisorAutoProxyCreator, AspectJWeavingEnabler, AsyncAnnotationBeanPostProcessor, BeanNameAutoProxyCreator, BshScriptFactory, BurlapClientInterceptor, BurlapExporter, BurlapProxyFactoryBean, BurlapServiceExporter, CommonsHttpInvokerRequestExecutor, ConfigurationClassPostProcessor, CustomAutowireConfigurer, CustomEditorConfigurer, CustomScopeConfigurer, DefaultAdvisorAutoProxyCreator, DefaultContextLoadTimeWeaver, FieldRetrievingFactoryBean, GroovyScriptFactory, HessianClientInterceptor, HessianExporter, HessianProxyFactoryBean, HessianServiceExporter, HttpInvokerClientInterceptor, HttpInvokerProxyFactoryBean, HttpInvokerServiceExporter, InfrastructureAdvisorAutoProxyCreator, InterfaceBasedMBeanInfoAssembler, Jaxb2Marshaller, JaxRpcPortProxyFactoryBean, JaxWsPortProxyFactoryBean, JmsInvokerProxyFactoryBean, JmsInvokerServiceExporter, JndiObjectFactoryBean, JndiRmiProxyFactoryBean, JndiRmiServiceExporter, JRubyScriptFactory, ListFactoryBean, LocalContainerEntityManagerFactoryBean, LocalEntityManagerFactoryBean, LocalPersistenceManagerFactoryBean, LocalSessionFactoryBean, LocalStatelessSessionProxyFactoryBean, MapFactoryBean, MBeanClientInterceptor, MBeanExporter, MBeanProxyFactoryBean, MBeanServerConnectionFactoryBean, MethodInvokingFactoryBean, MethodInvokingJobDetailFactoryBean, MethodInvokingRunnable, MethodInvokingTimerTaskFactoryBean, MethodMapTransactionAttributeSource, ObjectFactoryCreatingFactoryBean, PersistenceExceptionTranslationPostProcessor, ProviderCreatingFactoryBean, ProxyFactoryBean, RemoteAccessor, RemoteExporter, RemoteInvocationBasedAccessor, RemoteInvocationBasedExporter, RemoteInvocationSerializingExporter, RemotingSupport, ResourceBundleMessageSource, RmiBasedExporter, RmiClientInterceptor, RmiProxyFactoryBean, RmiServiceExporter, ScriptFactoryPostProcessor, ServiceFactoryBean, ServiceListFactoryBean, ServiceLoaderFactoryBean, SetFactoryBean, SimpleBurlapServiceExporter, SimpleHessianServiceExporter, SimpleHttpInvokerRequestExecutor, SimpleHttpInvokerServiceExporter, SimpleRemoteStatelessSessionProxyFactoryBean, SortedResourcesFactoryBean, TransactionProxyFactoryBean, UrlBasedRemoteAccessor, XStreamMarshaller
public interface BeanClassLoaderAware

Callback that allows a bean to be aware of the bean class loader; that is, the class loader used by the present bean factory to load bean classes.

This is mainly intended to be implemented by framework classes which have to pick up application classes by name despite themselves potentially being loaded from a shared class loader.

For a list of all bean lifecycle methods, see the BeanFactory javadocs.

Since:
2.0
Author:
Juergen Hoeller
See Also:
BeanNameAware, BeanFactoryAware, InitializingBean

Method Summary
 void setBeanClassLoader(ClassLoader classLoader)
Callback that supplies the bean class loader to a bean instance.

Method Detail

setBeanClassLoader

void setBeanClassLoader(ClassLoader classLoader)
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


BeanFactory

org.springframework.beans.factory
Interface BeanFactory

All Known Subinterfaces:
ApplicationContext, AutowireCapableBeanFactory, ConfigurableApplicationContext, ConfigurableBeanFactory, ConfigurableListableBeanFactory, ConfigurablePortletApplicationContext, ConfigurableWebApplicationContext, HierarchicalBeanFactory, ListableBeanFactory, WebApplicationContext
All Known Implementing Classes:
AbstractApplicationContext, AbstractAutowireCapableBeanFactory, AbstractBeanFactory, AbstractRefreshableApplicationContext, AbstractRefreshableConfigApplicationContext, AbstractRefreshablePortletApplicationContext, AbstractRefreshableWebApplicationContext, AbstractXmlApplicationContext, AnnotationConfigApplicationContext, AnnotationConfigWebApplicationContext, ClassPathXmlApplicationContext, DefaultListableBeanFactory, FileSystemXmlApplicationContext, GenericApplicationContext, GenericWebApplicationContext, GenericXmlApplicationContext, ResourceAdapterApplicationContext, SimpleJndiBeanFactory, StaticApplicationContext, StaticListableBeanFactory, StaticPortletApplicationContext, StaticWebApplicationContext, XmlBeanFactory, XmlPortletApplicationContext, XmlWebApplicationContext
public interface BeanFactory

The root interface for accessing a Spring bean container. This is the basic client view of a bean container; further interfaces such as ListableBeanFactory and ConfigurableBeanFactory are available for specific purposes.

This interface is implemented by objects that hold a number of bean definitions, each uniquely identified by a String name. Depending on the bean definition, the factory will return either an independent instance of a contained object (the Prototype design pattern), or a single shared instance (a superior alternative to the Singleton design pattern, in which the instance is a singleton in the scope of the factory). Which type of instance will be returned depends on the bean factory configuration: the API is the same. Since Spring 2.0, further scopes are available depending on the concrete application context (e.g. "request" and "session" scopes in a web environment).

The point of this approach is that the BeanFactory is a central registry of application components, and centralizes configuration of application components (no more do individual objects need to read properties files, for example). See chapters 4 and 11 of "Expert One-on-One J2EE Design and Development" for a discussion of the benefits of this approach.

Note that it is generally better to rely on Dependency Injection ("push" configuration) to configure application objects through setters or constructors, rather than use any form of "pull" configuration like a BeanFactory lookup. Spring's Dependency Injection functionality is implemented using this BeanFactory interface and its subinterfaces.

Normally a BeanFactory will load bean definitions stored in a configuration source (such as an XML document), and use the org.springframework.beans package to configure the beans. However, an implementation could simply return Java objects it creates as necessary directly in Java code. There are no constraints on how the definitions could be stored: LDAP, RDBMS, XML, properties file, etc. Implementations are encouraged to support references amongst beans (Dependency Injection).

In contrast to the methods in ListableBeanFactory, all of the operations in this interface will also check parent factories if this is a HierarchicalBeanFactory. If a bean is not found in this factory instance, the immediate parent factory will be asked. Beans in this factory instance are supposed to override beans of the same name in any parent factory.

Bean factory implementations should support the standard bean lifecycle interfaces as far as possible. The full set of initialization methods and their standard order is:
1. BeanNameAware's setBeanName
2. BeanClassLoaderAware's setBeanClassLoader
3. BeanFactoryAware's setBeanFactory
4. ResourceLoaderAware's setResourceLoader (only applicable when running in an application context)
5. ApplicationEventPublisherAware's setApplicationEventPublisher (only applicable when running in an application context)
6. MessageSourceAware's setMessageSource (only applicable when running in an application context)
7. ApplicationContextAware's setApplicationContext (only applicable when running in an application context)
8. ServletContextAware's setServletContext (only applicable when running in a web application context)
9. postProcessBeforeInitialization methods of BeanPostProcessors
10. InitializingBean's afterPropertiesSet
11. a custom init-method definition
12. postProcessAfterInitialization methods of BeanPostProcessors

On shutdown of a bean factory, the following lifecycle methods apply:
1. DisposableBean's destroy
2. a custom destroy-method definition

Since:
13 April 2001
Author:
Rod Johnson, Juergen Hoeller
See Also:
BeanNameAware.setBeanName(java.lang.String),
BeanClassLoaderAware.setBeanClassLoader(java.lang.ClassLoader),
BeanFactoryAware.setBeanFactory(org.springframework.beans.factory.BeanFactory),
ResourceLoaderAware.setResourceLoader(org.springframework.core.io.ResourceLoader),
ApplicationEventPublisherAware.setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher),
MessageSourceAware.setMessageSource(org.springframework.context.MessageSource),
ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext),
ServletContextAware.setServletContext(javax.servlet.ServletContext),
BeanPostProcessor.postProcessBeforeInitialization(java.lang.Object, java.lang.String),
InitializingBean.afterPropertiesSet(),
AbstractBeanDefinition.getInitMethodName(),
BeanPostProcessor.postProcessAfterInitialization(java.lang.Object, java.lang.String),
DisposableBean.destroy(),
AbstractBeanDefinition.getDestroyMethodName()

Field Summary
static String FACTORY_BEAN_PREFIX
Used to dereference a FactoryBean instance and distinguish it from beans created by the FactoryBean.
Method Summary
 boolean containsBean(String name)
Does this bean factory contain a bean with the given name? More specifically, is getBean(java.lang.String) able to obtain a bean instance for the given name?
 String[] getAliases(String name)
Return the aliases for the given bean name, if any.
<T> T
getBean(Class<T> requiredType)
Return the bean instance that uniquely matches the given object type, if any.
 Object getBean(String name)
Return an instance, which may be shared or independent, of the specified bean.
<T> T
getBean(String name, Class<T> requiredType)
Return an instance, which may be shared or independent, of the specified bean.
 Object getBean(String name, Object... args)
Return an instance, which may be shared or independent, of the specified bean.
 Class<?> getType(String name)
Determine the type of the bean with the given name.
 boolean isPrototype(String name)
Is this bean a prototype? That is, will getBean(java.lang.String) always return independent instances?
 boolean isSingleton(String name)
Is this bean a shared singleton? That is, will getBean(java.lang.String) always return the same instance?
 boolean isTypeMatch(String name, Class targetType)
Check whether the bean with the given name matches the specified type.

Field Detail

FACTORY_BEAN_PREFIX

static final String FACTORY_BEAN_PREFIX
Used to dereference a FactoryBean instance and distinguish it from beans created by the FactoryBean. For example, if the bean named myJndiObject is a FactoryBean, getting &myJndiObject will return the factory, not the instance returned by the factory.

See Also:
Constant Field Values
Method Detail

getBean

Object getBean(String name)
               throws BeansException
Return an instance, which may be shared or independent, of the specified bean.

This method allows a Spring BeanFactory to be used as a replacement for the Singleton or Prototype design pattern. Callers may retain references to returned objects in the case of Singleton beans.

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Parameters:
name - the name of the bean to retrieve
Returns:
an instance of the bean
Throws:
NoSuchBeanDefinitionException - if there is no bean definition with the specified name
BeansException - if the bean could not be obtained

getBean

<T> T getBean(String name,
              Class<T> requiredType)
          throws BeansException
Return an instance, which may be shared or independent, of the specified bean.

Behaves the same as getBean(String), but provides a measure of type safety by throwing a BeanNotOfRequiredTypeException if the bean is not of the required type. This means that ClassCastException can't be thrown on casting the result correctly, as can happen with getBean(String).

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Parameters:
name - the name of the bean to retrieve
requiredType - type the bean must match. Can be an interface or superclass of the actual class, or null for any match. For example, if the value is Object.class, this method will succeed whatever the class of the returned instance.
Returns:
an instance of the bean
Throws:
NoSuchBeanDefinitionException - if there's no such bean definition
BeanNotOfRequiredTypeException - if the bean is not of the required type
BeansException - if the bean could not be created

getBean

<T> T getBean(Class<T> requiredType)
          throws BeansException
Return the bean instance that uniquely matches the given object type, if any.

Parameters:
requiredType - type the bean must match; can be an interface or superclass. null is disallowed.

This method goes into ListableBeanFactory by-type lookup territory but may also be translated into a conventional by-name lookup based on the name of the given type. For more extensive retrieval operations across sets of beans, use ListableBeanFactory and/or BeanFactoryUtils.

Returns:
an instance of the single bean matching the required type
Throws:
NoSuchBeanDefinitionException - if there is not exactly one matching bean found
BeansException
Since:
3.0
See Also:
ListableBeanFactory

getBean

Object getBean(String name,
               Object... args)
               throws BeansException
Return an instance, which may be shared or independent, of the specified bean.

Allows for specifying explicit constructor arguments / factory method arguments, overriding the specified default arguments (if any) in the bean definition.

Parameters:
name - the name of the bean to retrieve
args - arguments to use if creating a prototype using explicit arguments to a static factory method. It is invalid to use a non-null args value in any other case.
Returns:
an instance of the bean
Throws:
NoSuchBeanDefinitionException - if there's no such bean definition
BeanDefinitionStoreException - if arguments have been given but the affected bean isn't a prototype
BeansException - if the bean could not be created
Since:
2.5

containsBean

boolean containsBean(String name)
Does this bean factory contain a bean with the given name? More specifically, is getBean(java.lang.String) able to obtain a bean instance for the given name?

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Parameters:
name - the name of the bean to query
Returns:
whether a bean with the given name is defined

isSingleton

boolean isSingleton(String name)
                    throws NoSuchBeanDefinitionException
Is this bean a shared singleton? That is, will getBean(java.lang.String) always return the same instance?

Note: This method returning false does not clearly indicate independent instances. It indicates non-singleton instances, which may correspond to a scoped bean as well. Use the isPrototype(java.lang.String) operation to explicitly check for independent instances.

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Parameters:
name - the name of the bean to query
Returns:
whether this bean corresponds to a singleton instance
Throws:
NoSuchBeanDefinitionException - if there is no bean with the given name
See Also:
getBean(java.lang.String), isPrototype(java.lang.String)

isPrototype

boolean isPrototype(String name)
                    throws NoSuchBeanDefinitionException
Is this bean a prototype? That is, will getBean(java.lang.String) always return independent instances?

Note: This method returning false does not clearly indicate a singleton object. It indicates non-independent instances, which may correspond to a scoped bean as well. Use the isSingleton(java.lang.String) operation to explicitly check for a shared singleton instance.

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Parameters:
name - the name of the bean to query
Returns:
whether this bean will always deliver independent instances
Throws:
NoSuchBeanDefinitionException - if there is no bean with the given name
Since:
2.0.3
See Also:
getBean(java.lang.String), isSingleton(java.lang.String)

isTypeMatch

boolean isTypeMatch(String name,
                    Class targetType)
                    throws NoSuchBeanDefinitionException
Check whether the bean with the given name matches the specified type. More specifically, check whether a getBean(java.lang.String) call for the given name would return an object that is assignable to the specified target type.

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Parameters:
name - the name of the bean to query
targetType - the type to match against
Returns:
true if the bean type matches, false if it doesn't match or cannot be determined yet
Throws:
NoSuchBeanDefinitionException - if there is no bean with the given name
Since:
2.0.1
See Also:
getBean(java.lang.String), getType(java.lang.String)

getType

Class<?> getType(String name)
                 throws NoSuchBeanDefinitionException
Determine the type of the bean with the given name. More specifically, determine the type of object that getBean(java.lang.String) would return for the given name.

For a FactoryBean, return the type of object that the FactoryBean creates, as exposed by FactoryBean.getObjectType().

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Parameters:
name - the name of the bean to query
Returns:
the type of the bean, or null if not determinable
Throws:
NoSuchBeanDefinitionException - if there is no bean with the given name
Since:
1.1.2
See Also:
getBean(java.lang.String), isTypeMatch(java.lang.String, java.lang.Class)

getAliases

String[] getAliases(String name)
Return the aliases for the given bean name, if any. All of those aliases point to the same bean when used in a getBean(java.lang.String) call.

If the given name is an alias, the corresponding original bean name and other aliases (if any) will be returned, with the original bean name being the first element in the array.

Will ask the parent factory if the bean cannot be found in this factory instance.

Parameters:
name - the bean name to check for aliases
Returns:
the aliases, or an empty array if none
See Also:
getBean(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanFactoryAware

org.springframework.beans.factory
Interface BeanFactoryAware

All Known Implementing Classes:
AbstractAdvisorAutoProxyCreator, AbstractApplicationEventMulticaster, AbstractAutoProxyCreator, AbstractBeanFactoryBasedTargetSource, AbstractBeanFactoryBasedTargetSourceCreator, AbstractBeanFactoryPointcutAdvisor, AbstractEntityManagerFactoryBean, AbstractFactoryBean, AbstractJaxWsServiceExporter, AbstractPoolingTargetSource, AbstractPrototypeBasedTargetSource, AbstractServiceLoaderBasedFactoryBean, AnnotationAwareAspectJAutoProxyCreator, AnnotationMBeanExporter, AnnotationMethodHandlerAdapter, AnnotationMethodHandlerAdapter, AspectJAwareAdvisorAutoProxyCreator, AspectJExpressionPointcut, AutowiredAnnotationBeanPostProcessor, BeanConfigurerSupport, BeanFactoryDataSourceLookup, BeanFactoryDestinationResolver, BeanFactoryTransactionAttributeSourceAdvisor, BeanNameAutoProxyCreator, BeanReferenceFactoryBean, CommonAnnotationBeanPostProcessor, CommonsPoolTargetSource, DefaultAdvisorAutoProxyCreator, DefaultBeanFactoryPointcutAdvisor, DefaultLifecycleProcessor, GroovyScriptFactory, HibernateAccessor, HibernateInterceptor, HibernateTemplate, HibernateTransactionManager, InfrastructureAdvisorAutoProxyCreator, LazyInitTargetSource, LazyInitTargetSourceCreator, ListFactoryBean, LoadTimeWeaverAwareProcessor, LocalContainerEntityManagerFactoryBean, LocalEntityManagerFactoryBean, MapFactoryBean, MBeanExporter, MethodInvokingFactoryBean, MethodInvokingJobDetailFactoryBean, MethodLocatingFactoryBean, ObjectFactoryCreatingFactoryBean, OpenSessionInViewInterceptor, PersistenceAnnotationBeanPostProcessor, PersistenceExceptionTranslationInterceptor, PersistenceExceptionTranslationPostProcessor, PreferencesPlaceholderConfigurer, PropertyPathFactoryBean, PropertyPlaceholderConfigurer, PrototypeTargetSource, ProviderCreatingFactoryBean, ProxyFactoryBean, QualifierAnnotationAutowireCandidateResolver, QuickTargetSourceCreator, RequiredAnnotationBeanPostProcessor, SchedulerAccessorBean, ScopedProxyFactoryBean, ScriptFactoryPostProcessor, ServiceFactoryBean, ServiceListFactoryBean, ServiceLoaderFactoryBean, ServiceLocatorFactoryBean, ServletContextPropertyPlaceholderConfigurer, SetFactoryBean, SimpleApplicationEventMulticaster, SimpleBeanFactoryAwareAspectInstanceFactory, SimpleBeanTargetSource, SimpleHttpServerJaxWsServiceExporter, SimpleJaxWsServiceExporter, SortedResourcesFactoryBean, ThreadLocalTargetSource, TransactionAspectSupport, TransactionInterceptor, TransactionProxyFactoryBean
public interface BeanFactoryAware

Interface to be implemented by beans that wish to be aware of their owning BeanFactory.

For example, beans can look up collaborating beans via the factory (Dependency Lookup). Note that most beans will choose to receive references to collaborating beans via corresponding bean properties or constructor arguments (Dependency Injection).

For a list of all bean lifecycle methods, see the BeanFactory javadocs.

Since:
11.03.2003
Author:
Rod Johnson
See Also:
BeanNameAware, BeanClassLoaderAware, InitializingBean, ApplicationContextAware

Method Summary
 void setBeanFactory(BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance.

Method Detail

setBeanFactory

void setBeanFactory(BeanFactory beanFactory)
                    throws BeansException
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
Throws:
BeansException - in case of initialization errors
See Also:
BeanInitializationException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanNameAware

org.springframework.beans.factory
Interface BeanNameAware

All Known Implementing Classes:
AbstractAtomFeedView, AbstractEntityManagerFactoryBean, AbstractExcelView, AbstractFeedView, AbstractJasperReportsSingleFormatView, AbstractJasperReportsView, AbstractJExcelView, AbstractJmsListeningContainer, AbstractMessageListenerContainer, AbstractPdfStamperView, AbstractPdfView, AbstractPollingMessageListenerContainer, AbstractRefreshableConfigApplicationContext, AbstractRefreshablePortletApplicationContext, AbstractRefreshableWebApplicationContext, AbstractRequestLoggingFilter, AbstractRssFeedView, AbstractTemplateView, AbstractUrlBasedView, AbstractView, AbstractXmlApplicationContext, AbstractXsltView, AnnotationConfigWebApplicationContext, CharacterEncodingFilter, ClassPathXmlApplicationContext, CommonsRequestLoggingFilter, ConfigurableJasperReportsView, CronTriggerBean, DefaultAdvisorAutoProxyCreator, DefaultMessageListenerContainer, DefaultMessageListenerContainer102, DelegatingFilterProxy, EhCacheFactoryBean, ExecutorConfigurationSupport, FieldRetrievingFactoryBean, FileSystemXmlApplicationContext, FilterDefinitionFactoryBean, FreeMarkerView, GenericFilterBean, HiddenHttpMethodFilter, InternalResourceView, JasperReportsCsvView, JasperReportsHtmlView, JasperReportsMultiFormatView, JasperReportsPdfView, JasperReportsXlsView, JobDetailBean, JstlView, LocalContainerEntityManagerFactoryBean, LocalEntityManagerFactoryBean, Log4jNestedDiagnosticContextFilter, MappingJacksonJsonView, MarshallingView, MethodInvokingJobDetailFactoryBean, MultipartFilter, OncePerRequestFilter, OpenEntityManagerInViewFilter, OpenPersistenceManagerInViewFilter, OpenSessionInViewFilter, PortletWrappingController, PreferencesPlaceholderConfigurer, PropertyPathFactoryBean, PropertyPlaceholderConfigurer, RedirectView, RequestContextFilter, ScheduledExecutorFactoryBean, SchedulerFactoryBean, ServletContextPropertyPlaceholderConfigurer, ServletContextRequestLoggingFilter, ServletForwardingController, ServletWrappingController, ShallowEtagHeaderFilter, SimpleMessageListenerContainer, SimpleMessageListenerContainer102, SimpleTriggerBean, TaskExecutorFactoryBean, ThreadPoolExecutorFactoryBean, ThreadPoolTaskExecutor, ThreadPoolTaskExecutor, ThreadPoolTaskScheduler, TilesJstlView, TilesView, TilesView, TimerFactoryBean, TimerTaskExecutor, TypeDefinitionBean, VelocityLayoutView, VelocityToolboxView, VelocityView, XmlPortletApplicationContext, XmlWebApplicationContext, XsltView
public interface BeanNameAware

Interface to be implemented by beans that want to be aware of their bean name in a bean factory. Note that it is not usually recommended that an object depend on its bean name, as this represents a potentially brittle dependence on external configuration, as well as a possibly unnecessary dependence on a Spring API.

For a list of all bean lifecycle methods, see the BeanFactory javadocs.

Since:
01.11.2003
Author:
Juergen Hoeller
See Also:
BeanClassLoaderAware, BeanFactoryAware, InitializingBean

Method Summary
 void setBeanName(String name)
Set the name of the bean in the bean factory that created this bean.

Method Detail

setBeanName

void setBeanName(String name)
Set the name of the bean in the bean factory that created this bean.

Invoked after population of normal bean properties but before an init callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Parameters:
name - the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use the BeanFactoryUtils.originalBeanName(String) method to extract the original bean name (without suffix), if desired.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DisposableBean

org.springframework.beans.factory
Interface DisposableBean

All Known Implementing Classes:
AbstractApplicationContext, AbstractBeanFactoryBasedTargetSourceCreator, AbstractEntityManagerFactoryBean, AbstractFactoryBean, AbstractJaxWsServiceExporter, AbstractJmsListeningContainer, AbstractMessageListenerContainer, AbstractPollingMessageListenerContainer, AbstractPoolingTargetSource, AbstractRefreshableApplicationContext, AbstractRefreshableConfigApplicationContext, AbstractRefreshablePortletApplicationContext, AbstractRefreshableWebApplicationContext, AbstractRequestLoggingFilter, AbstractServiceLoaderBasedFactoryBean, AbstractSessionFactoryBean, AbstractXmlApplicationContext, AnnotationConfigApplicationContext, AnnotationConfigWebApplicationContext, AnnotationMBeanExporter, AnnotationSessionFactoryBean, BeanConfigurerSupport, CachingConnectionFactory, CharacterEncodingFilter, ClassPathXmlApplicationContext, CommonsClientHttpRequestFactory, CommonsPoolTargetSource, CommonsRequestLoggingFilter, ConnectorServerFactoryBean, DefaultContextLoadTimeWeaver, DefaultMessageListenerContainer, DefaultMessageListenerContainer102, DelegatingFilterProxy, EhCacheManagerFactoryBean, EmbeddedDatabaseFactoryBean, ExecutorConfigurationSupport, FileSystemXmlApplicationContext, GenericApplicationContext, GenericFilterBean, GenericMessageEndpointManager, GenericWebApplicationContext, GenericXmlApplicationContext, HiddenHttpMethodFilter, JmsMessageEndpointManager, JndiRmiServiceExporter, LazyInitTargetSourceCreator, ListFactoryBean, LocalContainerEntityManagerFactoryBean, LocalEntityManagerFactoryBean, LocalPersistenceManagerFactoryBean, LocalSessionFactoryBean, Log4jNestedDiagnosticContextFilter, MapFactoryBean, MBeanClientInterceptor, MBeanExporter, MBeanProxyFactoryBean, MBeanServerConnectionFactoryBean, MBeanServerFactoryBean, MultipartFilter, NotificationListenerRegistrar, ObjectFactoryCreatingFactoryBean, OncePerRequestFilter, OpenEntityManagerInViewFilter, OpenPersistenceManagerInViewFilter, OpenSessionInViewFilter, PortletContextScope, PortletWrappingController, ProviderCreatingFactoryBean, QuickTargetSourceCreator, RequestContextFilter, ResourceAdapterApplicationContext, ResourceAdapterFactoryBean, ResourceBundleViewResolver, RmiRegistryFactoryBean, RmiServiceExporter, ScheduledAnnotationBeanPostProcessor, ScheduledExecutorFactoryBean, ScheduledTaskRegistrar, SchedulerFactoryBean, ScriptFactoryPostProcessor, ServiceFactoryBean, ServiceListFactoryBean, ServiceLoaderFactoryBean, ServletContextRequestLoggingFilter, ServletContextScope, ServletWrappingController, SetFactoryBean, ShallowEtagHeaderFilter, SimpleHttpServerFactoryBean, SimpleHttpServerJaxWsServiceExporter, SimpleJaxWsServiceExporter, SimpleMessageListenerContainer, SimpleMessageListenerContainer102, SimpleRemoteSlsbInvokerInterceptor, SimpleRemoteStatelessSessionProxyFactoryBean, SimpleThreadPoolTaskExecutor, SingleConnectionDataSource, SingleConnectionFactory, SingleConnectionFactory, SingleConnectionFactory102, SortedResourcesFactoryBean, StaticApplicationContext, StaticPortletApplicationContext, StaticWebApplicationContext, TaskExecutorFactoryBean, ThreadLocalTargetSource, ThreadPoolExecutorFactoryBean, ThreadPoolTaskExecutor, ThreadPoolTaskExecutor, ThreadPoolTaskScheduler, TilesConfigurer, TimerFactoryBean, TimerManagerAccessor, TimerManagerFactoryBean, TimerManagerTaskScheduler, TimerTaskExecutor, XmlPortletApplicationContext, XmlViewResolver, XmlWebApplicationContext
public interface DisposableBean

Interface to be implemented by beans that want to release resources on destruction. A BeanFactory is supposed to invoke the destroy method if it disposes a cached singleton. An application context is supposed to dispose all of its singletons on close.

An alternative to implementing DisposableBean is specifying a custom destroy-method, for example in an XML bean definition. For a list of all bean lifecycle methods, see the BeanFactory javadocs.

Since:
12.08.2003
Author:
Juergen Hoeller
See Also:
AbstractBeanDefinition.getDestroyMethodName(), ConfigurableApplicationContext.close()

Method Summary
 void destroy()
Invoked by a BeanFactory on destruction of a singleton.

Method Detail

destroy

void destroy()
             throws Exception
Invoked by a BeanFactory on destruction of a singleton.

Throws:
Exception - in case of shutdown errors. Exceptions will get logged but not rethrown to allow other beans to release their resources too.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FactoryBean

org.springframework.beans.factory
Interface FactoryBean<T>

All Known Subinterfaces:
SmartFactoryBean<T>
All Known Implementing Classes:
AbstractEntityManagerFactoryBean, AbstractFactoryBean, AbstractServiceLoaderBasedFactoryBean, AbstractSessionFactoryBean, AbstractSingletonProxyFactoryBean, AnnotationSessionFactoryBean, BeanReferenceFactoryBean, BurlapProxyFactoryBean, CommonsLogFactoryBean, ConnectorServerFactoryBean, ConversionServiceFactoryBean, EhCacheFactoryBean, EhCacheManagerFactoryBean, EmbeddedDatabaseFactoryBean, FieldRetrievingFactoryBean, FilterDefinitionFactoryBean, FormattingConversionServiceFactoryBean, FreeMarkerConfigurationFactoryBean, HessianProxyFactoryBean, HttpInvokerProxyFactoryBean, JaxRpcPortProxyFactoryBean, JaxWsPortProxyFactoryBean, JmsInvokerProxyFactoryBean, JndiObjectFactoryBean, JndiRmiProxyFactoryBean, ListFactoryBean, LocalConnectionFactoryBean, LocalContainerEntityManagerFactoryBean, LocalEntityManagerFactoryBean, LocalJaxRpcServiceFactoryBean, LocalJaxWsServiceFactoryBean, LocalPersistenceManagerFactoryBean, LocalSessionFactoryBean, LocalStatelessSessionProxyFactoryBean, MapFactoryBean, MBeanProxyFactoryBean, MBeanServerConnectionFactoryBean, MBeanServerFactoryBean, MethodInvokingFactoryBean, MethodInvokingJobDetailFactoryBean, MethodInvokingTimerTaskFactoryBean, MethodLocatingFactoryBean, ObjectFactoryCreatingFactoryBean, PropertiesFactoryBean, PropertyPathFactoryBean, ProviderCreatingFactoryBean, ProxyFactoryBean, ResourceAdapterFactoryBean, RmiProxyFactoryBean, RmiRegistryFactoryBean, ScheduledExecutorFactoryBean, SchedulerFactoryBean, ScopedProxyFactoryBean, ServiceFactoryBean, ServiceListFactoryBean, ServiceLoaderFactoryBean, ServiceLocatorFactoryBean, ServletContextAttributeFactoryBean, ServletContextFactoryBean, ServletContextParameterFactoryBean, SetFactoryBean, SharedEntityManagerBean, SimpleHttpServerFactoryBean, SimpleRemoteStatelessSessionProxyFactoryBean, SortedResourcesFactoryBean, SpringPersistenceManagerProxyBean, SqlMapClientFactoryBean, StandardPersistenceManagerProxyBean, TaskExecutorFactoryBean, ThreadPoolExecutorFactoryBean, TimerFactoryBean, TimerManagerFactoryBean, TransactionAwarePersistenceManagerFactoryProxy, TransactionProxyFactoryBean, VelocityEngineFactoryBean, WebSphereMBeanServerFactoryBean, XmlOptionsFactoryBean
public interface FactoryBean<T>

Interface to be implemented by objects used within a BeanFactory which are themselves factories. If a bean implements this interface, it is used as a factory for an object to expose, not directly as a bean instance that will be exposed itself.

NB: A bean that implements this interface cannot be used as a normal bean. A FactoryBean is defined in a bean style, but the object exposed for bean references (getObject() is always the object that it creates.

FactoryBeans can support singletons and prototypes, and can either create objects lazily on demand or eagerly on startup. The SmartFactoryBean interface allows for exposing more fine-grained behavioral metadata.

This interface is heavily used within the framework itself, for example for the AOP ProxyFactoryBean or the JndiObjectFactoryBean. It can be used for application components as well; however, this is not common outside of infrastructure code.

NOTE: FactoryBean objects participate in the containing BeanFactory's synchronization of bean creation. There is usually no need for internal synchronization other than for purposes of lazy initialization within the FactoryBean itself (or the like).

Since:
08.03.2003
Author:
Rod Johnson, Juergen Hoeller
See Also:
BeanFactory, ProxyFactoryBean, JndiObjectFactoryBean

Method Summary
 T getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<?> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will getObject() always return the same object (a reference that can be cached)?

Method Detail

getObject

T getObject()
            throws Exception
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Returns:
an instance of the bean (can be null)
Throws:
Exception - in case of creation errors
See Also:
FactoryBeanNotInitializedException

getObjectType

Class<?> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

boolean isSingleton()
Is the object managed by this factory a singleton? That is, will getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Returns:
whether the exposed object is a singleton
See Also:
getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HierarchicalBeanFactory

org.springframework.beans.factory
Interface HierarchicalBeanFactory

All Superinterfaces:
BeanFactory
All Known Subinterfaces:
ApplicationContext, ConfigurableApplicationContext, ConfigurableBeanFactory, ConfigurableListableBeanFactory, ConfigurablePortletApplicationContext, ConfigurableWebApplicationContext, WebApplicationContext
All Known Implementing Classes:
AbstractApplicationContext, AbstractAutowireCapableBeanFactory, AbstractBeanFactory, AbstractRefreshableApplicationContext, AbstractRefreshableConfigApplicationContext, AbstractRefreshablePortletApplicationContext, AbstractRefreshableWebApplicationContext, AbstractXmlApplicationContext, AnnotationConfigApplicationContext, AnnotationConfigWebApplicationContext, ClassPathXmlApplicationContext, DefaultListableBeanFactory, FileSystemXmlApplicationContext, GenericApplicationContext, GenericWebApplicationContext, GenericXmlApplicationContext, ResourceAdapterApplicationContext, StaticApplicationContext, StaticPortletApplicationContext, StaticWebApplicationContext, XmlBeanFactory, XmlPortletApplicationContext, XmlWebApplicationContext
public interface HierarchicalBeanFactory
extends BeanFactory

Sub-interface implemented by bean factories that can be part of a hierarchy.

The corresponding setParentBeanFactory method for bean factories that allow setting the parent in a configurable fashion can be found in the ConfigurableBeanFactory interface.

Since:
07.07.2003
Author:
Rod Johnson, Juergen Hoeller
See Also:
ConfigurableBeanFactory.setParentBeanFactory(org.springframework.beans.factory.BeanFactory)

Field Summary
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Method Summary
boolean | containsLocalBean(String name) Return whether the local bean factory contains a bean of the given name, ignoring beans defined in ancestor contexts.
BeanFactory | getParentBeanFactory() Return the parent bean factory, or null if there is none.
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getBean, getBean, getType, isPrototype, isSingleton, isTypeMatch

Method Detail

getParentBeanFactory

BeanFactory getParentBeanFactory()
Return the parent bean factory, or null if there is none.

containsLocalBean

boolean containsLocalBean(String name)
Return whether the local bean factory contains a bean of the given name, ignoring beans defined in ancestor contexts.

This is an alternative to containsBean, ignoring a bean of the given name from an ancestor bean factory.

Parameters:
name - the name of the bean to query
Returns:
whether a bean with the given name is defined in the local factory
See Also:
BeanFactory.containsBean(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InitializingBean

org.springframework.beans.factory
Interface InitializingBean

All Known Implementing Classes:
AbstractColumnMaxValueIncrementer, AbstractDataFieldMaxValueIncrementer, AbstractEntityManagerFactoryBean, AbstractFactoryBean, AbstractJasperReportsSingleFormatView, AbstractJasperReportsView, AbstractJaxWsServiceExporter, AbstractJmsListeningContainer, AbstractMessageListenerContainer, AbstractPdfStamperView, AbstractPollingMessageListenerContainer, AbstractRefreshableConfigApplicationContext, AbstractRefreshablePortletApplicationContext, AbstractRefreshableWebApplicationContext, AbstractRemoteSlsbInvokerInterceptor, AbstractRequestLoggingFilter, AbstractRoutingDataSource, AbstractSequenceMaxValueIncrementer, AbstractServiceLoaderBasedFactoryBean, AbstractSessionFactoryBean, AbstractSingletonProxyFactoryBean, AbstractSlsbInvokerInterceptor, AbstractTemplateView, AbstractUrlBasedView, AbstractXmlApplicationContext, AnnotationConfigWebApplicationContext, AnnotationMBeanExporter, AnnotationSessionFactoryBean, AsyncAnnotationBeanPostProcessor, BatchSqlUpdate, BeanConfigurerSupport, BeanValidationPostProcessor, BurlapClientInterceptor, BurlapExporter, BurlapProxyFactoryBean, BurlapServiceExporter, CachingConnectionFactory, CastorMarshaller, CciDaoSupport, CciLocalTransactionManager, CharacterEncodingFilter, ClassPathXmlApplicationContext, CommonsLogFactoryBean, CommonsRequestLoggingFilter, ConfigurableJasperReportsView, ConfigurableMimeFileTypeMap, ConnectionSpecConnectionFactoryAdapter, ConnectorServerFactoryBean, ConversionServiceFactoryBean, CronTriggerBean, CustomValidatorBean, DaoSupport, DatabaseStartupValidator, DataSourceInitializer, DataSourceTransactionManager, DB2MainframeSequenceMaxValueIncrementer, DB2SequenceMaxValueIncrementer, DefaultMessageListenerContainer, DefaultMessageListenerContainer102, DefaultPersistenceUnitManager, DelegatingConnectionFactory, DelegatingConnectionFactory, DelegatingDataSource, DelegatingFilterProxy, DerbyMaxValueIncrementer, EhCacheFactoryBean, EhCacheManagerFactoryBean, EisOperation, EmbeddedDatabaseFactoryBean, EventPublicationInterceptor, ExecutorConfigurationSupport, FieldRetrievingFactoryBean, FileSystemXmlApplicationContext, FilterDefinitionFactoryBean, FormattingConversionServiceFactoryBean, FreeMarkerConfigurationFactoryBean, FreeMarkerConfigurer, FreeMarkerView, GenericFilterBean, GenericMessageEndpointManager, GenericSqlQuery, GenericStoredProcedure, GlassFishWorkManagerTaskExecutor, H2SequenceMaxValueIncrementer, HessianClientInterceptor, HessianExporter, HessianProxyFactoryBean, HessianServiceExporter, HibernateAccessor, HibernateDaoSupport, HibernateInterceptor, HibernateTemplate, HibernateTransactionManager, HiddenHttpMethodFilter, HsqlMaxValueIncrementer, HsqlSequenceMaxValueIncrementer, HttpInvokerClientInterceptor, HttpInvokerProxyFactoryBean, HttpInvokerServiceExporter, InterfaceBasedMBeanInfoAssembler, InternalResourceView, IsolationLevelDataSourceAdapter, IsolationLevelDataSourceRouter, JasperReportsCsvView, JasperReportsHtmlView, JasperReportsMultiFormatView, JasperReportsPdfView, JasperReportsXlsView, Jaxb2Marshaller, JaxRpcPortClientInterceptor, JaxRpcPortProxyFactoryBean, JaxWsPortClientInterceptor, JaxWsPortProxyFactoryBean, JBossWorkManagerTaskExecutor, JdbcAccessor, JdbcDaoSupport, JdbcTemplate, JdoAccessor, JdoDaoSupport, JdoInterceptor, JdoTemplate, JdoTransactionManager, JibxMarshaller, JmsAccessor, JmsDestinationAccessor, JmsGatewaySupport, JmsInvokerClientInterceptor, JmsInvokerProxyFactoryBean, JmsInvokerServiceExporter, JmsMessageEndpointManager, JmsTemplate, JmsTemplate102, JmsTransactionManager, JmsTransactionManager102, JndiObjectFactoryBean, JndiObjectLocator, JndiObjectTargetSource, JndiRmiClientInterceptor, JndiRmiProxyFactoryBean, JndiRmiServiceExporter, JobDetailBean, JpaAccessor, JpaDaoSupport, JpaInterceptor, JpaTemplate, JpaTransactionManager, JstlView, JtaTransactionManager, KeyNamingStrategy, LazyConnectionDataSourceProxy, ListFactoryBean, LocalConnectionFactoryBean, LocalContainerEntityManagerFactoryBean, LocalEntityManagerFactoryBean, LocalJaxRpcServiceFactoryBean, LocalJaxWsServiceFactoryBean, LocalPersistenceManagerFactoryBean, LocalSessionFactoryBean, LocalSlsbInvokerInterceptor, LocalStatelessSessionProxyFactoryBean, LocalValidatorFactoryBean, Log4jNestedDiagnosticContextFilter, MapFactoryBean, MappingCommAreaOperation, MappingRecordOperation, MappingSqlQuery, MappingSqlQueryWithParameters, MarshallingMessageConverter, MBeanClientInterceptor, MBeanExporter, MBeanProxyFactoryBean, MBeanServerConnectionFactoryBean, MBeanServerFactoryBean, MetadataMBeanInfoAssembler, MetadataNamingStrategy, MethodInvokingFactoryBean, MethodInvokingJobDetailFactoryBean, MethodInvokingRunnable, MethodInvokingTimerTaskFactoryBean, MethodMapTransactionAttributeSource, MultipartFilter, MySQLMaxValueIncrementer, NamedParameterJdbcDaoSupport, NotificationListenerBean, NotificationListenerRegistrar, ObjectFactoryCreatingFactoryBean, OC4JJtaTransactionManager, OncePerRequestFilter, OpenEntityManagerInViewFilter, OpenPersistenceManagerInViewFilter, OpenSessionInViewFilter, OpenSessionInViewInterceptor, OracleSequenceMaxValueIncrementer, PersistenceExceptionTranslationInterceptor, PortletWrappingController, PostgreSQLSequenceMaxValueIncrementer, PreferencesPlaceholderConfigurer, PropertiesFactoryBean, PropertiesMethodNameResolver, ProviderCreatingFactoryBean, RdbmsOperation, RedirectView, RemoteInvocationBasedAccessor, RemoteInvocationSerializingExporter, RequestContextFilter, ResourceAdapterFactoryBean, ResourceBundleViewResolver, RmiClientInterceptor, RmiProxyFactoryBean, RmiRegistryFactoryBean, RmiServiceExporter, ScheduledExecutorFactoryBean, ScheduledTaskRegistrar, SchedulerAccessorBean, SchedulerFactoryBean, ServiceFactoryBean, ServiceListFactoryBean, ServiceLoaderFactoryBean, ServiceLocatorFactoryBean, ServletContextRequestLoggingFilter, ServletWrappingController, SetFactoryBean, ShallowEtagHeaderFilter, SharedEntityManagerBean, SimpleBurlapServiceExporter, SimpleHessianServiceExporter, SimpleHttpInvokerServiceExporter, SimpleHttpServerFactoryBean, SimpleHttpServerJaxWsServiceExporter, SimpleJaxWsServiceExporter, SimpleJdbcDaoSupport, SimpleMessageListenerContainer, SimpleMessageListenerContainer102, SimpleRecordOperation, SimpleRemoteSlsbInvokerInterceptor, SimpleRemoteStatelessSessionProxyFactoryBean, SimpleThreadPoolTaskExecutor, SimpleTriggerBean, SingleConnectionFactory, SingleConnectionFactory, SingleConnectionFactory102, SortedResourcesFactoryBean, SpringPersistenceManagerProxyBean, SqlCall, SqlFunction, SqlMapClientDaoSupport, SqlMapClientFactoryBean, SqlMapClientTemplate, SqlOperation, SqlQuery, SqlServerMaxValueIncrementer, SqlUpdate, StoredProcedure, SybaseMaxValueIncrementer, ThreadPoolExecutorFactoryBean, ThreadPoolTaskExecutor, ThreadPoolTaskExecutor, ThreadPoolTaskScheduler, TilesConfigurer, TilesConfigurer, TilesJstlView, TilesView, TilesView, TimerFactoryBean, TimerManagerAccessor, TimerManagerFactoryBean, TimerManagerTaskScheduler, TimerTaskExecutor, TransactionAspectSupport, TransactionAwareConnectionFactoryProxy, TransactionAwareDataSourceProxy, TransactionInterceptor, TransactionProxyFactoryBean, TransactionTemplate, TypeDefinitionBean, UpdatableSqlQuery, UrlBasedRemoteAccessor, UserCredentialsConnectionFactoryAdapter, UserCredentialsDataSourceAdapter, VelocityConfigurer, VelocityEngineFactoryBean, VelocityLayoutView, VelocityToolboxView, VelocityView, WebLogicJtaTransactionManager, WebSphereDataSourceAdapter, WebSphereMBeanServerFactoryBean, WebSphereUowTransactionManager, WorkManagerTaskExecutor, WorkManagerTaskExecutor, XmlPortletApplicationContext, XmlViewResolver, XmlWebApplicationContext, XsltView, XStreamMarshaller
public interface InitializingBean

Interface to be implemented by beans that need to react once all their properties have been set by a BeanFactory: for example, to perform custom initialization, or merely to check that all mandatory properties have been set.

An alternative to implementing InitializingBean is specifying a custom init-method, for example in an XML bean definition. For a list of all bean lifecycle methods, see the BeanFactory javadocs.

Author:
Rod Johnson
See Also:
BeanNameAware, BeanFactoryAware, BeanFactory, AbstractBeanDefinition.getInitMethodName(), ApplicationContextAware

Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

Method Detail

afterPropertiesSet

void afterPropertiesSet()
                        throws Exception
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Throws:
Exception - in the event of misconfiguration (such as failure to set an essential property) or if initialization fails.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ListableBeanFactory

org.springframework.beans.factory
Interface ListableBeanFactory

All Superinterfaces:
BeanFactory
All Known Subinterfaces:
ApplicationContext, ConfigurableApplicationContext, ConfigurableListableBeanFactory, ConfigurablePortletApplicationContext, ConfigurableWebApplicationContext, WebApplicationContext
All Known Implementing Classes:
AbstractApplicationContext, AbstractRefreshableApplicationContext, AbstractRefreshableConfigApplicationContext, AbstractRefreshablePortletApplicationContext, AbstractRefreshableWebApplicationContext, AbstractXmlApplicationContext, AnnotationConfigApplicationContext, AnnotationConfigWebApplicationContext, ClassPathXmlApplicationContext, DefaultListableBeanFactory, FileSystemXmlApplicationContext, GenericApplicationContext, GenericWebApplicationContext, GenericXmlApplicationContext, ResourceAdapterApplicationContext, StaticApplicationContext, StaticListableBeanFactory, StaticPortletApplicationContext, StaticWebApplicationContext, XmlBeanFactory, XmlPortletApplicationContext, XmlWebApplicationContext
public interface ListableBeanFactory
extends BeanFactory

Extension of the BeanFactory interface to be implemented by bean factories that can enumerate all their bean instances, rather than attempting bean lookup by name one by one as requested by clients. BeanFactory implementations that preload all their bean definitions (such as XML-based factories) may implement this interface.

If this is a HierarchicalBeanFactory, the return values will not take any BeanFactory hierarchy into account, but will relate only to the beans defined in the current factory. Use the BeanFactoryUtils helper class to consider beans in ancestor factories too.

The methods in this interface will just respect bean definitions of this factory. They will ignore any singleton beans that have been registered by other means like ConfigurableBeanFactory's registerSingleton method, with the exception of getBeanNamesOfType and getBeansOfType which will check such manually registered singletons too. Of course, BeanFactory's getBean does allow transparent access to such special beans as well. However, in typical scenarios, all beans will be defined by external bean definitions anyway, so most applications don't need to worry about this differentation.

NOTE: With the exception of getBeanDefinitionCount and containsBeanDefinition, the methods in this interface are not designed for frequent invocation. Implementations may be slow.

Since:
16 April 2001
Author:
Rod Johnson, Juergen Hoeller
See Also:
HierarchicalBeanFactory, BeanFactoryUtils

Field Summary
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Method Summary
 boolean containsBeanDefinition(String beanName)
Check if this bean factory contains a bean definition with the given name.
<A extends Annotation>
A
findAnnotationOnBean(String beanName, Class<A> annotationType)
Find a Annotation of annotationType on the specified bean, traversing its interfaces and super classes if no annotation can be found on the given class itself.
 int getBeanDefinitionCount()
Return the number of beans defined in the factory.
 String[] getBeanDefinitionNames()
Return the names of all beans defined in this factory.
 String[] getBeanNamesForType(Class type)
Return the names of beans matching the given type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.
 String[] getBeanNamesForType(Class type, boolean includeNonSingletons, boolean allowEagerInit)
Return the names of beans matching the given type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.
<T> Map<String,T>
getBeansOfType(Class<T> type)
Return the bean instances that match the given object type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.
<T> Map<String,T>
getBeansOfType(Class<T> type, boolean includeNonSingletons, boolean allowEagerInit)
Return the bean instances that match the given object type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.
 Map<String,Object> getBeansWithAnnotation(Class<? extends Annotation> annotationType)
Find all beans whose Class has the supplied Annotation type.
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getBean, getBean, getType, isPrototype, isSingleton, isTypeMatch

Method Detail

containsBeanDefinition

boolean containsBeanDefinition(String beanName)
Check if this bean factory contains a bean definition with the given name.

Does not consider any hierarchy this factory may participate in, and ignores any singleton beans that have been registered by other means than bean definitions.

Parameters:
beanName - the name of the bean to look for
Returns:
if this bean factory contains a bean definition with the given name
See Also:
BeanFactory.containsBean(java.lang.String)

getBeanDefinitionCount

int getBeanDefinitionCount()
Return the number of beans defined in the factory.

Does not consider any hierarchy this factory may participate in, and ignores any singleton beans that have been registered by other means than bean definitions.

Returns:
the number of beans defined in the factory

getBeanDefinitionNames

String[] getBeanDefinitionNames()
Return the names of all beans defined in this factory.

Does not consider any hierarchy this factory may participate in, and ignores any singleton beans that have been registered by other means than bean definitions.

Returns:
the names of all beans defined in this factory, or an empty array if none defined

getBeanNamesForType

String[] getBeanNamesForType(Class type)
Return the names of beans matching the given type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.

NOTE: This method introspects top-level beans only. It does not check nested beans which might match the specified type as well.

Does consider objects created by FactoryBeans, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type.

Does not consider any hierarchy this factory may participate in. Use BeanFactoryUtils' beanNamesForTypeIncludingAncestors to include beans in ancestor factories too.

Note: Does not ignore singleton beans that have been registered by other means than bean definitions.

This version of getBeanNamesForType matches all kinds of beans, be it singletons, prototypes, or FactoryBeans. In most implementations, the result will be the same as for getBeanNamesOfType(type, true, true).

Bean names returned by this method should always return bean names in the order of definition in the backend configuration, as far as possible.

Parameters:
type - the class or interface to match, or null for all bean names
Returns:
the names of beans (or objects created by FactoryBeans) matching the given object type (including subclasses), or an empty array if none
See Also:
FactoryBean.getObjectType(), BeanFactoryUtils.beanNamesForTypeIncludingAncestors(ListableBeanFactory, Class)

getBeanNamesForType

String[] getBeanNamesForType(Class type,
                             boolean includeNonSingletons,
                             boolean allowEagerInit)
Return the names of beans matching the given type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.

NOTE: This method introspects top-level beans only. It does not check nested beans which might match the specified type as well.

Does consider objects created by FactoryBeans if the "allowEagerInit" flag is set, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type. If "allowEagerInit" is not set, only raw FactoryBeans will be checked (which doesn't require initialization of each FactoryBean). $ *

Does not consider any hierarchy this factory may participate in. Use BeanFactoryUtils' beanNamesForTypeIncludingAncestors to include beans in ancestor factories too.

Note: Does not ignore singleton beans that have been registered by other means than bean definitions.

Bean names returned by this method should always return bean names in the order of definition in the backend configuration, as far as possible.

Parameters:
type - the class or interface to match, or null for all bean names
includeNonSingletons - whether to include prototype or scoped beans too or just singletons (also applies to FactoryBeans)
allowEagerInit - whether to initialize lazy-init singletons and objects created by FactoryBeans (or by factory methods with a "factory-bean" reference) for the type check. Note that FactoryBeans need to be eagerly initialized to determine their type: So be aware that passing in "true" for this flag will initialize FactoryBeans and "factory-bean" references.
Returns:
the names of beans (or objects created by FactoryBeans) matching the given object type (including subclasses), or an empty array if none
See Also:
FactoryBean.getObjectType(), BeanFactoryUtils.beanNamesForTypeIncludingAncestors(ListableBeanFactory, Class, boolean, boolean)

getBeansOfType

<T> Map<String,T> getBeansOfType(Class<T> type)
                             throws BeansException
Return the bean instances that match the given object type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.

NOTE: This method introspects top-level beans only. It does not check nested beans which might match the specified type as well.

Does consider objects created by FactoryBeans, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type.

Does not consider any hierarchy this factory may participate in. Use BeanFactoryUtils' beansOfTypeIncludingAncestors to include beans in ancestor factories too.

Note: Does not ignore singleton beans that have been registered by other means than bean definitions.

This version of getBeansOfType matches all kinds of beans, be it singletons, prototypes, or FactoryBeans. In most implementations, the result will be the same as for getBeansOfType(type, true, true).

The Map returned by this method should always return bean names and corresponding bean instances in the order of definition in the backend configuration, as far as possible.

Parameters:
type - the class or interface to match, or null for all concrete beans
Returns:
a Map with the matching beans, containing the bean names as keys and the corresponding bean instances as values
Throws:
BeansException - if a bean could not be created
Since:
1.1.2
See Also:
FactoryBean.getObjectType(), BeanFactoryUtils.beansOfTypeIncludingAncestors(ListableBeanFactory, Class)

getBeansOfType

<T> Map<String,T> getBeansOfType(Class<T> type,
                                 boolean includeNonSingletons,
                                 boolean allowEagerInit)
                             throws BeansException
Return the bean instances that match the given object type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.

NOTE: This method introspects top-level beans only. It does not check nested beans which might match the specified type as well.

Does consider objects created by FactoryBeans if the "allowEagerInit" flag is set, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type. If "allowEagerInit" is not set, only raw FactoryBeans will be checked (which doesn't require initialization of each FactoryBean).

Does not consider any hierarchy this factory may participate in. Use BeanFactoryUtils' beansOfTypeIncludingAncestors to include beans in ancestor factories too.

Note: Does not ignore singleton beans that have been registered by other means than bean definitions.

The Map returned by this method should always return bean names and corresponding bean instances in the order of definition in the backend configuration, as far as possible.

Parameters:
type - the class or interface to match, or null for all concrete beans
includeNonSingletons - whether to include prototype or scoped beans too or just singletons (also applies to FactoryBeans)
allowEagerInit - whether to initialize lazy-init singletons and objects created by FactoryBeans (or by factory methods with a "factory-bean" reference) for the type check. Note that FactoryBeans need to be eagerly initialized to determine their type: So be aware that passing in "true" for this flag will initialize FactoryBeans and "factory-bean" references.
Returns:
a Map with the matching beans, containing the bean names as keys and the corresponding bean instances as values
Throws:
BeansException - if a bean could not be created
See Also:
FactoryBean.getObjectType(), BeanFactoryUtils.beansOfTypeIncludingAncestors(ListableBeanFactory, Class, boolean, boolean)

getBeansWithAnnotation

Map<String,Object> getBeansWithAnnotation(Class<? extends Annotation> annotationType)
                                          throws BeansException
Find all beans whose Class has the supplied Annotation type.

Parameters:
annotationType - the type of annotation to look for
Returns:
a Map with the matching beans, containing the bean names as keys and the corresponding bean instances as values
Throws:
BeansException - if a bean could not be created

findAnnotationOnBean

<A extends Annotation> A findAnnotationOnBean(String beanName,
                                              Class<A> annotationType)
Find a Annotation of annotationType on the specified bean, traversing its interfaces and super classes if no annotation can be found on the given class itself.

Parameters:
beanName - the name of the bean to look for annotations on
annotationType - the annotation class to look for
Returns:
the annotation of the given type found, or null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NamedBean

org.springframework.beans.factory
Interface NamedBean

public interface NamedBean

Counterpart of BeanNameAware. Returns the bean name of an object.

This interface can be introduced to avoid a brittle dependence on bean name in objects used with Spring IoC and Spring AOP.

Since:
2.0
Author:
Rod Johnson
See Also:
BeanNameAware

Method Summary
 String getBeanName()
Return the name of this bean in a Spring bean factory.

Method Detail

getBeanName

String getBeanName()
Return the name of this bean in a Spring bean factory.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ObjectFactory

org.springframework.beans.factory
Interface ObjectFactory<T>

public interface ObjectFactory<T>

Defines a factory which can return an Object instance (possibly shared or independent) when invoked.

This interface is typically used to encapsulate a generic factory which returns a new instance (prototype) of some target object on each invocation.

This interface is similar to FactoryBean, but implementations of the latter are normally meant to be defined as SPI instances in a BeanFactory, while implementations of this class are normally meant to be fed as an API to other beans (through injection). As such, the getObject() method has different exception handling behavior.

Since:
1.0.2
Author:
Colin Sampaleanu
See Also:
FactoryBean

Method Summary
 T getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.

Method Detail

getObject

T getObject()
            throws BeansException
Return an instance (possibly shared or independent) of the object managed by this factory.

Returns:
an instance of the bean (should never be null)
Throws:
BeansException - in case of creation errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SmartFactoryBean

org.springframework.beans.factory
Interface SmartFactoryBean<T>

All Superinterfaces:
FactoryBean<T>
All Known Implementing Classes:
BeanReferenceFactoryBean
public interface SmartFactoryBean<T>
extends FactoryBean<T>

Extension of the FactoryBean interface. Implementations may indicate whether they always return independent instances, for the case where their FactoryBean.isSingleton() implementation returning false does not clearly indicate independent instances.

Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if their FactoryBean.isSingleton() implementation returns false; the exposed object is only accessed on demand.

NOTE: This interface is a special purpose interface, mainly for internal use within the framework and within collaborating frameworks. In general, application-provided FactoryBeans should simply implement the plain FactoryBean interface. New methods might be added to this extended interface even in point releases.

Since:
2.0.3
Author:
Juergen Hoeller
See Also:
isPrototype(), FactoryBean.isSingleton()

Method Summary
 boolean isEagerInit()
Does this FactoryBean expect eager initialization, that is, eagerly initialize itself as well as expect eager initialization of its singleton object (if any)?
 boolean isPrototype()
Is the object managed by this factory a prototype? That is, will FactoryBean.getObject() always return an independent instance?
Methods inherited from interface org.springframework.beans.factory.FactoryBean
getObject, getObjectType, isSingleton

Method Detail

isPrototype

boolean isPrototype()
Is the object managed by this factory a prototype? That is, will FactoryBean.getObject() always return an independent instance?

The prototype status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

This method is supposed to strictly check for independent instances; it should not return true for scoped objects or other kinds of non-singleton, non-independent objects. For this reason, this is not simply the inverted form of FactoryBean.isSingleton().

Returns:
whether the exposed object is a prototype
See Also:
FactoryBean.getObject(), FactoryBean.isSingleton()

isEagerInit

boolean isEagerInit()
Does this FactoryBean expect eager initialization, that is, eagerly initialize itself as well as expect eager initialization of its singleton object (if any)?

A standard FactoryBean is not expected to initialize eagerly: Its FactoryBean.getObject() will only be called for actual access, even in case of a singleton object. Returning true from this method suggests that FactoryBean.getObject() should be called eagerly, also applying post-processors eagerly. This may make sense in case of a singleton object, in particular if post-processors expect to be applied on startup.

Returns:
whether eager initialization applies
See Also:
ConfigurableListableBeanFactory.preInstantiateSingletons()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanFactoryUtils

org.springframework.beans.factory
Class BeanFactoryUtils

java.lang.Object
    extended by  org.springframework.beans.factory.BeanFactoryUtils

public abstract class BeanFactoryUtils
extends Object

Convenience methods operating on bean factories, in particular on the ListableBeanFactory interface.

Returns bean counts, bean names or bean instances, taking into account the nesting hierarchy of a bean factory (which the methods defined on the ListableBeanFactory interface don't, in contrast to the methods defined on the BeanFactory interface).

Since:
04.07.2003
Author:
Rod Johnson, Juergen Hoeller

Field Summary
static String GENERATED_BEAN_NAME_SEPARATOR
Separator for generated bean names.
Constructor Summary
BeanFactoryUtils()
Method Summary
static String[] beanNamesForTypeIncludingAncestors(ListableBeanFactory lbf, Class type)
Get all bean names for the given type, including those defined in ancestor factories.
static String[] beanNamesForTypeIncludingAncestors(ListableBeanFactory lbf, Class type, boolean includeNonSingletons, boolean allowEagerInit)
Get all bean names for the given type, including those defined in ancestor factories.
static String[] beanNamesIncludingAncestors(ListableBeanFactory lbf)
Return all bean names in the factory, including ancestor factories.
static
<T> T
beanOfType(ListableBeanFactory lbf, Class<T> type)
Return a single bean of the given type or subtypes, not looking in ancestor factories.
static
<T> T
beanOfType(ListableBeanFactory lbf, Class<T> type, boolean includeNonSingletons, boolean allowEagerInit)
Return a single bean of the given type or subtypes, not looking in ancestor factories.
static
<T> T
beanOfTypeIncludingAncestors(ListableBeanFactory lbf, Class<T> type)
Return a single bean of the given type or subtypes, also picking up beans defined in ancestor bean factories if the current bean factory is a HierarchicalBeanFactory.
static
<T> T
beanOfTypeIncludingAncestors(ListableBeanFactory lbf, Class<T> type, boolean includeNonSingletons, boolean allowEagerInit)
Return a single bean of the given type or subtypes, also picking up beans defined in ancestor bean factories if the current bean factory is a HierarchicalBeanFactory.
static
<T> Map<String,T>
beansOfTypeIncludingAncestors(ListableBeanFactory lbf, Class<T> type)
Return all beans of the given type or subtypes, also picking up beans defined in ancestor bean factories if the current bean factory is a HierarchicalBeanFactory.
static
<T> Map<String,T>
beansOfTypeIncludingAncestors(ListableBeanFactory lbf, Class<T> type, boolean includeNonSingletons, boolean allowEagerInit)
Return all beans of the given type or subtypes, also picking up beans defined in ancestor bean factories if the current bean factory is a HierarchicalBeanFactory.
static int countBeansIncludingAncestors(ListableBeanFactory lbf)
Count all beans in any hierarchy in which this factory participates.
static boolean isFactoryDereference(String name)
Return whether the given name is a factory dereference (beginning with the factory dereference prefix).
static boolean isGeneratedBeanName(String name)
Return whether the given name is a bean name which has been generated by the default naming strategy (containing a "#..." part).
static String originalBeanName(String name)
Extract the "raw" bean name from the given (potentially generated) bean name, excluding any "#..." suffixes which might have been added for uniqueness.
static String transformedBeanName(String name)
Return the actual bean name, stripping out the factory dereference prefix (if any, also stripping repeated factory prefixes if found).
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

GENERATED_BEAN_NAME_SEPARATOR

public static final String GENERATED_BEAN_NAME_SEPARATOR
Separator for generated bean names. If a class name or parent name is not unique, "#1", "#2" etc will be appended, until the name becomes unique.

See Also:
Constant Field Values
Constructor Detail

BeanFactoryUtils

public BeanFactoryUtils()
Method Detail

isFactoryDereference

public static boolean isFactoryDereference(String name)
Return whether the given name is a factory dereference (beginning with the factory dereference prefix).

Parameters:
name - the name of the bean
Returns:
whether the given name is a factory dereference
See Also:
BeanFactory.FACTORY_BEAN_PREFIX

transformedBeanName

public static String transformedBeanName(String name)
Return the actual bean name, stripping out the factory dereference prefix (if any, also stripping repeated factory prefixes if found).

Parameters:
name - the name of the bean
Returns:
the transformed name
See Also:
BeanFactory.FACTORY_BEAN_PREFIX

isGeneratedBeanName

public static boolean isGeneratedBeanName(String name)
Return whether the given name is a bean name which has been generated by the default naming strategy (containing a "#..." part).

Parameters:
name - the name of the bean
Returns:
whether the given name is a generated bean name
See Also:
GENERATED_BEAN_NAME_SEPARATOR, BeanDefinitionReaderUtils.generateBeanName(org.springframework.beans.factory.config.BeanDefinition, org.springframework.beans.factory.support.BeanDefinitionRegistry, boolean), DefaultBeanNameGenerator

originalBeanName

public static String originalBeanName(String name)
Extract the "raw" bean name from the given (potentially generated) bean name, excluding any "#..." suffixes which might have been added for uniqueness.

Parameters:
name - the potentially generated bean name
Returns:
the raw bean name
See Also:
GENERATED_BEAN_NAME_SEPARATOR

countBeansIncludingAncestors

public static int countBeansIncludingAncestors(ListableBeanFactory lbf)
Count all beans in any hierarchy in which this factory participates. Includes counts of ancestor bean factories.

Beans that are "overridden" (specified in a descendant factory with the same name) are only counted once.

Parameters:
lbf - the bean factory
Returns:
count of beans including those defined in ancestor factories

beanNamesIncludingAncestors

public static String[] beanNamesIncludingAncestors(ListableBeanFactory lbf)
Return all bean names in the factory, including ancestor factories.

Parameters:
lbf - the bean factory
Returns:
the array of matching bean names, or an empty array if none
See Also:
beanNamesForTypeIncludingAncestors(org.springframework.beans.factory.ListableBeanFactory, java.lang.Class)

beanNamesForTypeIncludingAncestors

public static String[] beanNamesForTypeIncludingAncestors(ListableBeanFactory lbf,
                                                          Class type)
Get all bean names for the given type, including those defined in ancestor factories. Will return unique names in case of overridden bean definitions.

Does consider objects created by FactoryBeans, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type.

This version of beanNamesForTypeIncludingAncestors automatically includes prototypes and FactoryBeans.

Parameters:
lbf - the bean factory
type - the type that beans must match
Returns:
the array of matching bean names, or an empty array if none

beanNamesForTypeIncludingAncestors

public static String[] beanNamesForTypeIncludingAncestors(ListableBeanFactory lbf,
                                                          Class type,
                                                          boolean includeNonSingletons,
                                                          boolean allowEagerInit)
Get all bean names for the given type, including those defined in ancestor factories. Will return unique names in case of overridden bean definitions.

Does consider objects created by FactoryBeans if the "allowEagerInit" flag is set, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type. If "allowEagerInit" is not set, only raw FactoryBeans will be checked (which doesn't require initialization of each FactoryBean).

Parameters:
lbf - the bean factory
includeNonSingletons - whether to include prototype or scoped beans too or just singletons (also applies to FactoryBeans)
allowEagerInit - whether to initialize lazy-init singletons and objects created by FactoryBeans (or by factory methods with a "factory-bean" reference) for the type check. Note that FactoryBeans need to be eagerly initialized to determine their type: So be aware that passing in "true" for this flag will initialize FactoryBeans and "factory-bean" references.
type - the type that beans must match
Returns:
the array of matching bean names, or an empty array if none

beansOfTypeIncludingAncestors

public static <T> Map<String,T> beansOfTypeIncludingAncestors(ListableBeanFactory lbf,
                                                              Class<T> type)
                                                   throws BeansException
Return all beans of the given type or subtypes, also picking up beans defined in ancestor bean factories if the current bean factory is a HierarchicalBeanFactory. The returned Map will only contain beans of this type.

Does consider objects created by FactoryBeans, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type.

Parameters:
lbf - the bean factory
type - type of bean to match
Returns:
the Map of matching bean instances, or an empty Map if none
Throws:
BeansException - if a bean could not be created

beansOfTypeIncludingAncestors

public static <T> Map<String,T> beansOfTypeIncludingAncestors(ListableBeanFactory lbf,
                                                              Class<T> type,
                                                              boolean includeNonSingletons,
                                                              boolean allowEagerInit)
                                                   throws BeansException
Return all beans of the given type or subtypes, also picking up beans defined in ancestor bean factories if the current bean factory is a HierarchicalBeanFactory. The returned Map will only contain beans of this type.

Does consider objects created by FactoryBeans if the "allowEagerInit" flag is set, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type. If "allowEagerInit" is not set, only raw FactoryBeans will be checked (which doesn't require initialization of each FactoryBean).

Parameters:
lbf - the bean factory
type - type of bean to match
includeNonSingletons - whether to include prototype or scoped beans too or just singletons (also applies to FactoryBeans)
allowEagerInit - whether to initialize lazy-init singletons and objects created by FactoryBeans (or by factory methods with a "factory-bean" reference) for the type check. Note that FactoryBeans need to be eagerly initialized to determine their type: So be aware that passing in "true" for this flag will initialize FactoryBeans and "factory-bean" references.
Returns:
the Map of matching bean instances, or an empty Map if none
Throws:
BeansException - if a bean could not be created

beanOfTypeIncludingAncestors

public static <T> T beanOfTypeIncludingAncestors(ListableBeanFactory lbf,
                                                 Class<T> type)
                                      throws BeansException
Return a single bean of the given type or subtypes, also picking up beans defined in ancestor bean factories if the current bean factory is a HierarchicalBeanFactory. Useful convenience method when we expect a single bean and don't care about the bean name.

Does consider objects created by FactoryBeans, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type.

This version of beanOfTypeIncludingAncestors automatically includes prototypes and FactoryBeans.

Parameters:
lbf - the bean factory
type - type of bean to match
Returns:
the matching bean instance
Throws:
NoSuchBeanDefinitionException - if 0 or more than 1 beans of the given type were found
BeansException - if the bean could not be created

beanOfTypeIncludingAncestors

public static <T> T beanOfTypeIncludingAncestors(ListableBeanFactory lbf,
                                                 Class<T> type,
                                                 boolean includeNonSingletons,
                                                 boolean allowEagerInit)
                                      throws BeansException
Return a single bean of the given type or subtypes, also picking up beans defined in ancestor bean factories if the current bean factory is a HierarchicalBeanFactory. Useful convenience method when we expect a single bean and don't care about the bean name.

Does consider objects created by FactoryBeans if the "allowEagerInit" flag is set, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type. If "allowEagerInit" is not set, only raw FactoryBeans will be checked (which doesn't require initialization of each FactoryBean).

Parameters:
lbf - the bean factory
type - type of bean to match
includeNonSingletons - whether to include prototype or scoped beans too or just singletons (also applies to FactoryBeans)
allowEagerInit - whether to initialize lazy-init singletons and objects created by FactoryBeans (or by factory methods with a "factory-bean" reference) for the type check. Note that FactoryBeans need to be eagerly initialized to determine their type: So be aware that passing in "true" for this flag will initialize FactoryBeans and "factory-bean" references.
Returns:
the matching bean instance
Throws:
NoSuchBeanDefinitionException - if 0 or more than 1 beans of the given type were found
BeansException - if the bean could not be created

beanOfType

public static <T> T beanOfType(ListableBeanFactory lbf,
                               Class<T> type)
                    throws BeansException
Return a single bean of the given type or subtypes, not looking in ancestor factories. Useful convenience method when we expect a single bean and don't care about the bean name.

Does consider objects created by FactoryBeans, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type.

This version of beanOfType automatically includes prototypes and FactoryBeans.

Parameters:
lbf - the bean factory
type - type of bean to match
Returns:
the matching bean instance
Throws:
NoSuchBeanDefinitionException - if 0 or more than 1 beans of the given type were found
BeansException - if the bean could not be created

beanOfType

public static <T> T beanOfType(ListableBeanFactory lbf,
                               Class<T> type,
                               boolean includeNonSingletons,
                               boolean allowEagerInit)
                    throws BeansException
Return a single bean of the given type or subtypes, not looking in ancestor factories. Useful convenience method when we expect a single bean and don't care about the bean name.

Does consider objects created by FactoryBeans if the "allowEagerInit" flag is set, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type. If "allowEagerInit" is not set, only raw FactoryBeans will be checked (which doesn't require initialization of each FactoryBean).

Parameters:
lbf - the bean factory
type - type of bean to match
includeNonSingletons - whether to include prototype or scoped beans too or just singletons (also applies to FactoryBeans)
allowEagerInit - whether to initialize lazy-init singletons and objects created by FactoryBeans (or by factory methods with a "factory-bean" reference) for the type check. Note that FactoryBeans need to be eagerly initialized to determine their type: So be aware that passing in "true" for this flag will initialize FactoryBeans and "factory-bean" references.
Returns:
the matching bean instance
Throws:
NoSuchBeanDefinitionException - if 0 or more than 1 beans of the given type were found
BeansException - if the bean could not be created
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanCreationException

org.springframework.beans.factory
Class BeanCreationException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.beans.BeansException
                        extended by  org.springframework.beans.FatalBeanException
                            extended by  org.springframework.beans.factory.BeanCreationException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
BeanCreationNotAllowedException, BeanCurrentlyInCreationException, BeanIsAbstractException, UnsatisfiedDependencyException
public class BeanCreationException
extends FatalBeanException

Exception thrown when a BeanFactory encounters an error when attempting to create a bean from a bean definition.

Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
BeanCreationException(String msg)
Create a new BeanCreationException.
BeanCreationException(String beanName, String msg)
Create a new BeanCreationException.
BeanCreationException(String resourceDescription, String beanName, String msg)
Create a new BeanCreationException.
BeanCreationException(String resourceDescription, String beanName, String msg, Throwable cause)
Create a new BeanCreationException.
BeanCreationException(String beanName, String msg, Throwable cause)
Create a new BeanCreationException.
BeanCreationException(String msg, Throwable cause)
Create a new BeanCreationException.
Method Summary
void | addRelatedCause(Throwable ex) Add a related cause to this bean creation exception, not being a direct cause of the failure but having occured earlier in the creation of the same bean instance.
boolean | contains(Class exClass) Check whether this exception contains an exception of the given type: either it is of the given class itself or it contains a nested cause of the given type.
String | getBeanName() Return the name of the bean requested, if any.
Throwable[] | getRelatedCauses() Return the related causes, if any.
String | getResourceDescription() Return the description of the resource that the bean definition came from, if any.
void | printStackTrace(PrintStream ps)
void | printStackTrace(PrintWriter pw)
String | toString()
Methods inherited from class org.springframework.beans.BeansException
equals, hashCode
Methods inherited from class org.springframework.core.NestedRuntimeException
getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, setStackTrace
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

BeanCreationException

public BeanCreationException(String msg)
Create a new BeanCreationException.

Parameters:
msg - the detail message

BeanCreationException

public BeanCreationException(String msg,
                             Throwable cause)
Create a new BeanCreationException.

Parameters:
msg - the detail message
cause - the root cause

BeanCreationException

public BeanCreationException(String beanName,
                             String msg)
Create a new BeanCreationException.

Parameters:
beanName - the name of the bean requested
msg - the detail message

BeanCreationException

public BeanCreationException(String beanName,
                             String msg,
                             Throwable cause)
Create a new BeanCreationException.

Parameters:
beanName - the name of the bean requested
msg - the detail message
cause - the root cause

BeanCreationException

public BeanCreationException(String resourceDescription,
                             String beanName,
                             String msg)
Create a new BeanCreationException.

Parameters:
resourceDescription - description of the resource that the bean definition came from
beanName - the name of the bean requested
msg - the detail message

BeanCreationException

public BeanCreationException(String resourceDescription,
                             String beanName,
                             String msg,
                             Throwable cause)
Create a new BeanCreationException.

Parameters:
resourceDescription - description of the resource that the bean definition came from
beanName - the name of the bean requested
msg - the detail message
cause - the root cause
Method Detail

getBeanName

public String getBeanName()
Return the name of the bean requested, if any.

getResourceDescription

public String getResourceDescription()
Return the description of the resource that the bean definition came from, if any.

addRelatedCause

public void addRelatedCause(Throwable ex)
Add a related cause to this bean creation exception, not being a direct cause of the failure but having occured earlier in the creation of the same bean instance.

Parameters:
ex - the related cause to add

getRelatedCauses

public Throwable[] getRelatedCauses()
Return the related causes, if any.

Returns:
the array of related causes, or null if none

toString

public String toString()
Overrides:
toString in class Throwable

printStackTrace

public void printStackTrace(PrintStream ps)
Overrides:
printStackTrace in class Throwable

printStackTrace

public void printStackTrace(PrintWriter pw)
Overrides:
printStackTrace in class Throwable

contains

public boolean contains(Class exClass)
Description copied from class: NestedRuntimeException
Check whether this exception contains an exception of the given type: either it is of the given class itself or it contains a nested cause of the given type.

Overrides:
contains in class NestedRuntimeException
Parameters:
exClass - the exception type to look for
Returns:
whether there is a nested exception of the specified type
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanCreationNotAllowedException

org.springframework.beans.factory
Class BeanCreationNotAllowedException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.beans.BeansException
                        extended by  org.springframework.beans.FatalBeanException
                            extended by  org.springframework.beans.factory.BeanCreationException
                                extended by  org.springframework.beans.factory.BeanCreationNotAllowedException
All Implemented Interfaces:
Serializable
public class BeanCreationNotAllowedException
extends BeanCreationException

Exception thrown in case of a bean being requested despite bean creation currently not being allowed (for example, during the shutdown phase of a bean factory).

Since:
2.0
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
BeanCreationNotAllowedException(String beanName, String msg)
Create a new BeanCreationNotAllowedException.
Method Summary
Methods inherited from class org.springframework.beans.factory.BeanCreationException
addRelatedCause, contains, getBeanName, getRelatedCauses, getResourceDescription, printStackTrace, printStackTrace, toString
Methods inherited from class org.springframework.beans.BeansException
equals, hashCode
Methods inherited from class org.springframework.core.NestedRuntimeException
getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, setStackTrace
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

BeanCreationNotAllowedException

public BeanCreationNotAllowedException(String beanName,
                                       String msg)
Create a new BeanCreationNotAllowedException.

Parameters:
beanName - the name of the bean requested
msg - the detail message
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanCurrentlyInCreationException

org.springframework.beans.factory
Class BeanCurrentlyInCreationException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.beans.BeansException
                        extended by  org.springframework.beans.FatalBeanException
                            extended by  org.springframework.beans.factory.BeanCreationException
                                extended by  org.springframework.beans.factory.BeanCurrentlyInCreationException
All Implemented Interfaces:
Serializable
public class BeanCurrentlyInCreationException
extends BeanCreationException

Exception thrown in case of a reference to a bean that's currently in creation. Typically happens when constructor autowiring matches the currently constructed bean.

Since:
1.1
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
BeanCurrentlyInCreationException(String beanName)
Create a new BeanCurrentlyInCreationException, with a default error message that indicates a circular reference.
BeanCurrentlyInCreationException(String beanName, String msg)
Create a new BeanCurrentlyInCreationException.
Method Summary
Methods inherited from class org.springframework.beans.factory.BeanCreationException
addRelatedCause, contains, getBeanName, getRelatedCauses, getResourceDescription, printStackTrace, printStackTrace, toString
Methods inherited from class org.springframework.beans.BeansException
equals, hashCode
Methods inherited from class org.springframework.core.NestedRuntimeException
getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, setStackTrace
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

BeanCurrentlyInCreationException

public BeanCurrentlyInCreationException(String beanName)
Create a new BeanCurrentlyInCreationException, with a default error message that indicates a circular reference.

Parameters:
beanName - the name of the bean requested

BeanCurrentlyInCreationException

public BeanCurrentlyInCreationException(String beanName,
                                        String msg)
Create a new BeanCurrentlyInCreationException.

Parameters:
beanName - the name of the bean requested
msg - the detail message
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanDefinitionStoreException

org.springframework.beans.factory
Class BeanDefinitionStoreException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.beans.BeansException
                        extended by  org.springframework.beans.FatalBeanException
                            extended by  org.springframework.beans.factory.BeanDefinitionStoreException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
BeanDefinitionParsingException, XmlBeanDefinitionStoreException
public class BeanDefinitionStoreException
extends FatalBeanException

Exception thrown when a BeanFactory encounters an invalid bean definition: e.g. in case of incomplete or contradictory bean metadata.

Author:
Rod Johnson, Juergen Hoeller, Rob Harrop
See Also:
Serialized Form

Constructor Summary
BeanDefinitionStoreException(String msg)
Create a new BeanDefinitionStoreException.
BeanDefinitionStoreException(String resourceDescription, String msg)
Create a new BeanDefinitionStoreException.
BeanDefinitionStoreException(String resourceDescription, String beanName, String msg)
Create a new BeanDefinitionStoreException.
BeanDefinitionStoreException(String resourceDescription, String beanName, String msg, Throwable cause)
Create a new BeanDefinitionStoreException.
BeanDefinitionStoreException(String resourceDescription, String msg, Throwable cause)
Create a new BeanDefinitionStoreException.
BeanDefinitionStoreException(String msg, Throwable cause)
Create a new BeanDefinitionStoreException.
Method Summary
String | getBeanName() Return the name of the bean requested, if any.
String | getResourceDescription() Return the description of the resource that the bean definition came from, if any.
Methods inherited from class org.springframework.beans.BeansException
equals, hashCode
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

BeanDefinitionStoreException

public BeanDefinitionStoreException(String msg)
Create a new BeanDefinitionStoreException.

Parameters:
msg - the detail message (used as exception message as-is)

BeanDefinitionStoreException

public BeanDefinitionStoreException(String msg,
                                    Throwable cause)
Create a new BeanDefinitionStoreException.

Parameters:
msg - the detail message (used as exception message as-is)
cause - the root cause (may be null)

BeanDefinitionStoreException

public BeanDefinitionStoreException(String resourceDescription,
                                    String msg)
Create a new BeanDefinitionStoreException.

Parameters:
resourceDescription - description of the resource that the bean definition came from
msg - the detail message (used as exception message as-is)

BeanDefinitionStoreException

public BeanDefinitionStoreException(String resourceDescription,
                                    String msg,
                                    Throwable cause)
Create a new BeanDefinitionStoreException.

Parameters:
resourceDescription - description of the resource that the bean definition came from
msg - the detail message (used as exception message as-is)
cause - the root cause (may be null)

BeanDefinitionStoreException

public BeanDefinitionStoreException(String resourceDescription,
                                    String beanName,
                                    String msg)
Create a new BeanDefinitionStoreException.

Parameters:
resourceDescription - description of the resource that the bean definition came from
beanName - the name of the bean requested
msg - the detail message (appended to an introductory message that indicates the resource and the name of the bean)

BeanDefinitionStoreException

public BeanDefinitionStoreException(String resourceDescription,
                                    String beanName,
                                    String msg,
                                    Throwable cause)
Create a new BeanDefinitionStoreException.

Parameters:
resourceDescription - description of the resource that the bean definition came from
beanName - the name of the bean requested
msg - the detail message (appended to an introductory message that indicates the resource and the name of the bean)
cause - the root cause (may be null)
Method Detail

getResourceDescription

public String getResourceDescription()
Return the description of the resource that the bean definition came from, if any.

getBeanName

public String getBeanName()
Return the name of the bean requested, if any.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanExpressionException

org.springframework.beans.factory
Class BeanExpressionException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.beans.BeansException
                        extended by  org.springframework.beans.FatalBeanException
                            extended by  org.springframework.beans.factory.BeanExpressionException
All Implemented Interfaces:
Serializable
public class BeanExpressionException
extends FatalBeanException

Exception that indicates an expression evaluation attempt having failed.

Since:
3.0
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
BeanExpressionException(String msg)
Create a new BeanExpressionException with the specified message.
BeanExpressionException(String msg, Throwable cause)
Create a new BeanExpressionException with the specified message and root cause.
Method Summary
Methods inherited from class org.springframework.beans.BeansException
equals, hashCode
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

BeanExpressionException

public BeanExpressionException(String msg)
Create a new BeanExpressionException with the specified message.

Parameters:
msg - the detail message

BeanExpressionException

public BeanExpressionException(String msg,
                               Throwable cause)
Create a new BeanExpressionException with the specified message and root cause.

Parameters:
msg - the detail message
cause - the root cause
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanInitializationException

org.springframework.beans.factory
Class BeanInitializationException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.beans.BeansException
                        extended by  org.springframework.beans.FatalBeanException
                            extended by  org.springframework.beans.factory.BeanInitializationException
All Implemented Interfaces:
Serializable
public class BeanInitializationException
extends FatalBeanException

Exception that a bean implementation is suggested to throw if its own factory-aware initialization code fails. BeansExceptions thrown by bean factory methods themselves should simply be propagated as-is.

Note that non-factory-aware initialization methods like afterPropertiesSet() or a custom "init-method" can throw any exception.

Since:
13.11.2003
Author:
Juergen Hoeller
See Also:
BeanFactoryAware.setBeanFactory(org.springframework.beans.factory.BeanFactory), InitializingBean.afterPropertiesSet(), Serialized Form

Constructor Summary
BeanInitializationException(String msg)
Create a new BeanInitializationException with the specified message.
BeanInitializationException(String msg, Throwable cause)
Create a new BeanInitializationException with the specified message and root cause.
Method Summary
Methods inherited from class org.springframework.beans.BeansException
equals, hashCode
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

BeanInitializationException

public BeanInitializationException(String msg)
Create a new BeanInitializationException with the specified message.

Parameters:
msg - the detail message

BeanInitializationException

public BeanInitializationException(String msg,
                                   Throwable cause)
Create a new BeanInitializationException with the specified message and root cause.

Parameters:
msg - the detail message
cause - the root cause
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanIsAbstractException

org.springframework.beans.factory
Class BeanIsAbstractException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.beans.BeansException
                        extended by  org.springframework.beans.FatalBeanException
                            extended by  org.springframework.beans.factory.BeanCreationException
                                extended by  org.springframework.beans.factory.BeanIsAbstractException
All Implemented Interfaces:
Serializable
public class BeanIsAbstractException
extends BeanCreationException

Exception thrown when a bean instance has been requested for a bean definition which has been marked as abstract.

Since:
1.1
Author:
Juergen Hoeller
See Also:
AbstractBeanDefinition.setAbstract(boolean), Serialized Form

Constructor Summary
BeanIsAbstractException(String beanName)
Create a new BeanIsAbstractException.
Method Summary
Methods inherited from class org.springframework.beans.factory.BeanCreationException
addRelatedCause, contains, getBeanName, getRelatedCauses, getResourceDescription, printStackTrace, printStackTrace, toString
Methods inherited from class org.springframework.beans.BeansException
equals, hashCode
Methods inherited from class org.springframework.core.NestedRuntimeException
getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, setStackTrace
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

BeanIsAbstractException

public BeanIsAbstractException(String beanName)
Create a new BeanIsAbstractException.

Parameters:
beanName - the name of the bean requested
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanIsNotAFactoryException

org.springframework.beans.factory
Class BeanIsNotAFactoryException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.beans.BeansException
                        extended by  org.springframework.beans.factory.BeanNotOfRequiredTypeException
                            extended by  org.springframework.beans.factory.BeanIsNotAFactoryException
All Implemented Interfaces:
Serializable
public class BeanIsNotAFactoryException
extends BeanNotOfRequiredTypeException

Exception thrown when a bean is not a factory, but a user tries to get at the factory for the given bean name. Whether a bean is a factory is determined by whether it implements the FactoryBean interface.

Since:
10.03.2003
Author:
Rod Johnson
See Also:
FactoryBean, Serialized Form

Constructor Summary
BeanIsNotAFactoryException(String name, Class actualType)
Create a new BeanIsNotAFactoryException.
Method Summary
Methods inherited from class org.springframework.beans.factory.BeanNotOfRequiredTypeException
getActualType, getBeanName, getRequiredType
Methods inherited from class org.springframework.beans.BeansException
equals, hashCode
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

BeanIsNotAFactoryException

public BeanIsNotAFactoryException(String name,
                                  Class actualType)
Create a new BeanIsNotAFactoryException.

Parameters:
name - the name of the bean requested
actualType - the actual type returned, which did not match the expected type
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanNotOfRequiredTypeException

org.springframework.beans.factory
Class BeanNotOfRequiredTypeException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.beans.BeansException
                        extended by  org.springframework.beans.factory.BeanNotOfRequiredTypeException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
BeanIsNotAFactoryException
public class BeanNotOfRequiredTypeException
extends BeansException

Thrown when a bean doesn't match the expected type.

Author:
Rod Johnson, Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
BeanNotOfRequiredTypeException(String beanName, Class requiredType, Class actualType)
Create a new BeanNotOfRequiredTypeException.
Method Summary
Class | getActualType() Return the actual type of the instance found.
String | getBeanName() Return the name of the instance that was of the wrong type.
Class | getRequiredType() Return the expected type for the bean.
Methods inherited from class org.springframework.beans.BeansException
equals, hashCode
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

BeanNotOfRequiredTypeException

public BeanNotOfRequiredTypeException(String beanName,
                                      Class requiredType,
                                      Class actualType)
Create a new BeanNotOfRequiredTypeException.

Parameters:
beanName - the name of the bean requested
requiredType - the required type
actualType - the actual type returned, which did not match the expected type
Method Detail

getBeanName

public String getBeanName()
Return the name of the instance that was of the wrong type.

getRequiredType

public Class getRequiredType()
Return the expected type for the bean.

getActualType

public Class getActualType()
Return the actual type of the instance found.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CannotLoadBeanClassException

org.springframework.beans.factory
Class CannotLoadBeanClassException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.beans.BeansException
                        extended by  org.springframework.beans.FatalBeanException
                            extended by  org.springframework.beans.factory.CannotLoadBeanClassException
All Implemented Interfaces:
Serializable
public class CannotLoadBeanClassException
extends FatalBeanException

Exception thrown when the BeanFactory cannot load the specified class of a given bean.

Since:
2.0
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
CannotLoadBeanClassException(String resourceDescription, String beanName, String beanClassName, ClassNotFoundException cause)
Create a new CannotLoadBeanClassException.
CannotLoadBeanClassException(String resourceDescription, String beanName, String beanClassName, LinkageError cause)
Create a new CannotLoadBeanClassException.
Method Summary
String | getBeanClassName() Return the name of the class we were trying to load.
String | getBeanName() Return the name of the bean requested.
String | getResourceDescription() Return the description of the resource that the bean definition came from.
Methods inherited from class org.springframework.beans.BeansException
equals, hashCode
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

CannotLoadBeanClassException

public CannotLoadBeanClassException(String resourceDescription,
                                    String beanName,
                                    String beanClassName,
                                    ClassNotFoundException cause)
Create a new CannotLoadBeanClassException.

Parameters:
resourceDescription - description of the resource that the bean definition came from
beanName - the name of the bean requested
beanClassName - the name of the bean class
cause - the root cause

CannotLoadBeanClassException

public CannotLoadBeanClassException(String resourceDescription,
                                    String beanName,
                                    String beanClassName,
                                    LinkageError cause)
Create a new CannotLoadBeanClassException.

Parameters:
resourceDescription - description of the resource that the bean definition came from
beanName - the name of the bean requested
beanClassName - the name of the bean class
cause - the root cause
Method Detail

getResourceDescription

public String getResourceDescription()
Return the description of the resource that the bean definition came from.

getBeanName

public String getBeanName()
Return the name of the bean requested.

getBeanClassName

public String getBeanClassName()
Return the name of the class we were trying to load.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FactoryBeanNotInitializedException

org.springframework.beans.factory
Class FactoryBeanNotInitializedException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.beans.BeansException
                        extended by  org.springframework.beans.FatalBeanException
                            extended by  org.springframework.beans.factory.FactoryBeanNotInitializedException
All Implemented Interfaces:
Serializable
public class FactoryBeanNotInitializedException
extends FatalBeanException

Exception to be thrown from a FactoryBean's getObject() method if the bean is not fully initialized yet, for example because it is involved in a circular reference.

Note: A circular reference with a FactoryBean cannot be solved by eagerly caching singleton instances like with normal beans. The reason is that every FactoryBean needs to be fully initialized before it can return the created bean, while only specific normal beans need to be initialized - that is, if a collaborating bean actually invokes them on initialization instead of just storing the reference.

Since:
30.10.2003
Author:
Juergen Hoeller
See Also:
FactoryBean.getObject(), Serialized Form

Constructor Summary
FactoryBeanNotInitializedException()
Create a new FactoryBeanNotInitializedException with the default message.
FactoryBeanNotInitializedException(String msg)
Create a new FactoryBeanNotInitializedException with the given message.
Method Summary
Methods inherited from class org.springframework.beans.BeansException
equals, hashCode
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

FactoryBeanNotInitializedException

public FactoryBeanNotInitializedException()
Create a new FactoryBeanNotInitializedException with the default message.

FactoryBeanNotInitializedException

public FactoryBeanNotInitializedException(String msg)
Create a new FactoryBeanNotInitializedException with the given message.

Parameters:
msg - the detail message
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NoSuchBeanDefinitionException

org.springframework.beans.factory
Class NoSuchBeanDefinitionException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.beans.BeansException
                        extended by  org.springframework.beans.factory.NoSuchBeanDefinitionException
All Implemented Interfaces:
Serializable
public class NoSuchBeanDefinitionException
extends BeansException

Exception thrown when a BeanFactory is asked for a bean instance name for which it cannot find a definition.

Author:
Rod Johnson, Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
NoSuchBeanDefinitionException(Class type)
Create a new NoSuchBeanDefinitionException.
NoSuchBeanDefinitionException(Class type, String message)
Create a new NoSuchBeanDefinitionException.
NoSuchBeanDefinitionException(Class type, String dependencyDescription, String message)
Create a new NoSuchBeanDefinitionException.
NoSuchBeanDefinitionException(String name)
Create a new NoSuchBeanDefinitionException.
NoSuchBeanDefinitionException(String name, String message)
Create a new NoSuchBeanDefinitionException.
Method Summary
String | getBeanName() Return the name of the missing bean, if it was a lookup by name that failed.
Class | getBeanType() Return the required type of bean, if it was a lookup by type that failed.
Methods inherited from class org.springframework.beans.BeansException
equals, hashCode
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

NoSuchBeanDefinitionException

public NoSuchBeanDefinitionException(String name)
Create a new NoSuchBeanDefinitionException.

Parameters:
name - the name of the missing bean

NoSuchBeanDefinitionException

public NoSuchBeanDefinitionException(String name,
                                     String message)
Create a new NoSuchBeanDefinitionException.

Parameters:
name - the name of the missing bean
message - detailed message describing the problem

NoSuchBeanDefinitionException

public NoSuchBeanDefinitionException(Class type)
Create a new NoSuchBeanDefinitionException.

Parameters:
type - required type of bean

NoSuchBeanDefinitionException

public NoSuchBeanDefinitionException(Class type,
                                     String message)
Create a new NoSuchBeanDefinitionException.

Parameters:
type - required type of bean
message - detailed message describing the problem

NoSuchBeanDefinitionException

public NoSuchBeanDefinitionException(Class type,
                                     String dependencyDescription,
                                     String message)
Create a new NoSuchBeanDefinitionException.

Parameters:
type - required type of bean
dependencyDescription - a description of the originating dependency
message - detailed message describing the problem
Method Detail

getBeanName

public String getBeanName()
Return the name of the missing bean, if it was a lookup by name that failed.

getBeanType

public Class getBeanType()
Return the required type of bean, if it was a lookup by type that failed.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UnsatisfiedDependencyException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.beans.factory
Class UnsatisfiedDependencyException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.beans.BeansException
                        extended by  org.springframework.beans.FatalBeanException
                            extended by  org.springframework.beans.factory.BeanCreationException
                                extended by  org.springframework.beans.factory.UnsatisfiedDependencyException
All Implemented Interfaces:
Serializable
public class UnsatisfiedDependencyException
extends BeanCreationException

Exception thrown when a bean depends on other beans or simple properties that were not specified in the bean factory definition, although dependency checking was enabled.

Since:
03.09.2003
Author:
Rod Johnson, Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
UnsatisfiedDependencyException(String resourceDescription, String beanName, int ctorArgIndex, Class ctorArgType, BeansException ex)
Create a new UnsatisfiedDependencyException.
UnsatisfiedDependencyException(String resourceDescription, String beanName, int ctorArgIndex, Class ctorArgType, String msg)
Create a new UnsatisfiedDependencyException.
UnsatisfiedDependencyException(String resourceDescription, String beanName, String propertyName, BeansException ex)
Create a new UnsatisfiedDependencyException.
UnsatisfiedDependencyException(String resourceDescription, String beanName, String propertyName, String msg)
Create a new UnsatisfiedDependencyException.
Method Summary
Methods inherited from class org.springframework.beans.factory.BeanCreationException
addRelatedCause, contains, getBeanName, getRelatedCauses, getResourceDescription, printStackTrace, printStackTrace, toString
Methods inherited from class org.springframework.beans.BeansException
equals, hashCode
Methods inherited from class org.springframework.core.NestedRuntimeException
getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, setStackTrace
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

UnsatisfiedDependencyException

public UnsatisfiedDependencyException(String resourceDescription,
                                      String beanName,
                                      String propertyName,
                                      String msg)
Create a new UnsatisfiedDependencyException.

Parameters:
resourceDescription - description of the resource that the bean definition came from
beanName - the name of the bean requested
propertyName - the name of the bean property that couldn't be satisfied
msg - the detail message

UnsatisfiedDependencyException

public UnsatisfiedDependencyException(String resourceDescription,
                                      String beanName,
                                      String propertyName,
                                      BeansException ex)
Create a new UnsatisfiedDependencyException.

Parameters:
resourceDescription - description of the resource that the bean definition came from
beanName - the name of the bean requested
propertyName - the name of the bean property that couldn't be satisfied
ex - the bean creation exception that indicated the unsatisfied dependency

UnsatisfiedDependencyException

public UnsatisfiedDependencyException(String resourceDescription,
                                      String beanName,
                                      int ctorArgIndex,
                                      Class ctorArgType,
                                      String msg)
Create a new UnsatisfiedDependencyException.

Parameters:
resourceDescription - description of the resource that the bean definition came from
beanName - the name of the bean requested
ctorArgIndex - the index of the constructor argument that couldn't be satisfied
ctorArgType - the type of the constructor argument that couldn't be satisfied
msg - the detail message

UnsatisfiedDependencyException

public UnsatisfiedDependencyException(String resourceDescription,
                                      String beanName,
                                      int ctorArgIndex,
                                      Class ctorArgType,
                                      BeansException ex)
Create a new UnsatisfiedDependencyException.

Parameters:
resourceDescription - description of the resource that the bean definition came from
beanName - the name of the bean requested
ctorArgIndex - the index of the constructor argument that couldn't be satisfied
ctorArgType - the type of the constructor argument that couldn't be satisfied
ex - the bean creation exception that indicated the unsatisfied dependency
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.beans.factory.access

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.beans.factory.access

Helper infrastructure to locate and access bean factories.

See:
Description

Interface Summary
BeanFactoryLocator | Defines a contract for the lookup, use, and release of a BeanFactory, or a BeanFactory subclass such as an ApplicationContext.
BeanFactoryReference | Used to track a reference to a BeanFactory obtained through a BeanFactoryLocator.

Class Summary
SingletonBeanFactoryLocator Keyed-singleton implementation of BeanFactoryLocator, which accesses shared Spring BeanFactory instances.

Exception Summary
BootstrapException Exception thrown if a bean factory could not be loaded by a bootstrap class.

Package org.springframework.beans.factory.access Description

Helper infrastructure to locate and access bean factories.

Note: This package is only relevant for special sharing of bean factories, for example behind EJB facades. It is not used in a typical web application or standalone application.


org.springframework.beans.factory.access Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.beans.factory.access

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.beans.factory.access.SingletonBeanFactoryLocator (implements org.springframework.beans.factory.access.BeanFactoryLocator)
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.beans.BeansException
              • org.springframework.beans.FatalBeanException
                • org.springframework.beans.factory.access.BootstrapException

Interface Hierarchy

  • org.springframework.beans.factory.access.BeanFactoryLocator
  • org.springframework.beans.factory.access.BeanFactoryReference


BeanFactoryLocator

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.beans.factory.access
Interface BeanFactoryLocator

All Known Implementing Classes:
ContextJndiBeanFactoryLocator, ContextSingletonBeanFactoryLocator, SingletonBeanFactoryLocator
public interface BeanFactoryLocator

Defines a contract for the lookup, use, and release of a BeanFactory, or a BeanFactory subclass such as an ApplicationContext.

Where this interface is implemented as a singleton class such as SingletonBeanFactoryLocator, the Spring team strongly suggests that it be used sparingly and with caution. By far the vast majority of the code inside an application is best written in a Dependency Injection style, where that code is served out of a BeanFactory/ApplicationContext container, and has its own dependencies supplied by the container when it is created. However, even such a singleton implementation sometimes has its use in the small glue layers of code that is sometimes needed to tie other code together. For example, third party code may try to construct new objects directly, without the ability to force it to get these objects out of a BeanFactory. If the object constructed by the third party code is just a small stub or proxy, which then uses an implementation of this class to get a BeanFactory from which it gets the real object, to which it delegates, then proper Dependency Injection has been achieved.

As another example, in a complex J2EE app with multiple layers, with each layer having its own ApplicationContext definition (in a hierarchy), a class like SingletonBeanFactoryLocator may be used to demand load these contexts.

Author:
Colin Sampaleanu
See Also:
BeanFactory, DefaultLocatorFactory, ApplicationContext

Method Summary
 BeanFactoryReference useBeanFactory(String factoryKey)
Use the BeanFactory (or derived interface such as ApplicationContext) specified by the factoryKey parameter.

Method Detail

useBeanFactory

BeanFactoryReference useBeanFactory(String factoryKey)
                                    throws BeansException
Use the BeanFactory (or derived interface such as ApplicationContext) specified by the factoryKey parameter.

The definition is possibly loaded/created as needed.

Parameters:
factoryKey - a resource name specifying which BeanFactory the BeanFactoryLocator must return for usage. The actual meaning of the resource name is specific to the implementation of BeanFactoryLocator.
Returns:
the BeanFactory instance, wrapped as a BeanFactoryReference object
Throws:
BeansException - if there is an error loading or accessing the BeanFactory
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


BeanFactoryReference

org.springframework.beans.factory.access
Interface BeanFactoryReference

All Known Implementing Classes:
ContextBeanFactoryReference
public interface BeanFactoryReference

Used to track a reference to a BeanFactory obtained through a BeanFactoryLocator.

It is safe to call release() multiple times, but getFactory() must not be called after calling release.

Author:
Colin Sampaleanu
See Also:
BeanFactoryLocator, ContextBeanFactoryReference

Method Summary
BeanFactory | getFactory() Return the BeanFactory instance held by this reference.
void | release() Indicate that the BeanFactory instance referred to by this object is not needed any longer by the client code which obtained the BeanFactoryReference.

Method Detail

getFactory

BeanFactory getFactory()
Return the BeanFactory instance held by this reference.

Throws:
IllegalStateException - if invoked after release() has been called

release

void release()
             throws FatalBeanException
Indicate that the BeanFactory instance referred to by this object is not needed any longer by the client code which obtained the BeanFactoryReference.

Depending on the actual implementation of BeanFactoryLocator, and the actual type of BeanFactory, this may possibly not actually do anything; alternately in the case of a 'closeable' BeanFactory or derived class (such as ApplicationContext) may 'close' it, or may 'close' it once no more references remain.

In an EJB usage scenario this would normally be called from ejbRemove() and ejbPassivate().

This is safe to call multiple times.

Throws:
FatalBeanException - if the BeanFactory cannot be released
See Also:
BeanFactoryLocator, ContextBeanFactoryReference, ConfigurableApplicationContext.close()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SingletonBeanFactoryLocator

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.beans.factory.access
Class SingletonBeanFactoryLocator

java.lang.Object
    extended by  org.springframework.beans.factory.access.SingletonBeanFactoryLocator
All Implemented Interfaces:
BeanFactoryLocator
Direct Known Subclasses:
ContextSingletonBeanFactoryLocator
public class SingletonBeanFactoryLocator
extends Object
implements BeanFactoryLocator

Keyed-singleton implementation of BeanFactoryLocator, which accesses shared Spring BeanFactory instances.

Please see the warning in BeanFactoryLocator's javadoc about appropriate usage of singleton style BeanFactoryLocator implementations. It is the opinion of the Spring team that the use of this class and similar classes is unnecessary except (sometimes) for a small amount of glue code. Excessive usage will lead to code that is more tightly coupled, and harder to modify or test.

In this implementation, a BeanFactory is built up from one or more XML definition file fragments, accessed as resources. The default resource name searched for is 'classpath*:beanRefFactory.xml', with the Spring-standard 'classpath*:' prefix ensuring that if the classpath contains multiple copies of this file (perhaps one in each component jar) they will be combined. To override the default resource name, instead of using the no-arg getInstance() method, use the getInstance(String selector) variant, which will treat the 'selector' argument as the resource name to search for.

The purpose of this 'outer' BeanFactory is to create and hold a copy of one or more 'inner' BeanFactory or ApplicationContext instances, and allow those to be obtained either directly or via an alias. As such, this class provides both singleton style access to one or more BeanFactories/ApplicationContexts, and also a level of indirection, allowing multiple pieces of code, which are not able to work in a Dependency Injection fashion, to refer to and use the same target BeanFactory/ApplicationContext instance(s), by different names.

Consider an example application scenario:

  • com.mycompany.myapp.util.applicationContext.xml - ApplicationContext definition file which defines beans for 'util' layer.
  • com.mycompany.myapp.dataaccess-applicationContext.xml - ApplicationContext definition file which defines beans for 'data access' layer. Depends on the above.
  • com.mycompany.myapp.services.applicationContext.xml - ApplicationContext definition file which defines beans for 'services' layer. Depends on the above.

In an ideal scenario, these would be combined to create one ApplicationContext, or created as three hierarchical ApplicationContexts, by one piece of code somewhere at application startup (perhaps a Servlet filter), from which all other code in the application would flow, obtained as beans from the context(s). However when third party code enters into the picture, things can get problematic. If the third party code needs to create user classes, which should normally be obtained from a Spring BeanFactory/ApplicationContext, but can handle only newInstance() style object creation, then some extra work is required to actually access and use object from a BeanFactory/ApplicationContext. One solutions is to make the class created by the third party code be just a stub or proxy, which gets the real object from a BeanFactory/ApplicationContext, and delegates to it. However, it is is not normally workable for the stub to create the BeanFactory on each use, as depending on what is inside it, that can be an expensive operation. Additionally, there is a fairly tight coupling between the stub and the name of the definition resource for the BeanFactory/ApplicationContext. This is where SingletonBeanFactoryLocator comes in. The stub can obtain a SingletonBeanFactoryLocator instance, which is effectively a singleton, and ask it for an appropriate BeanFactory. A subsequent invocation (assuming the same class loader is involved) by the stub or another piece of code, will obtain the same instance. The simple aliasing mechanism allows the context to be asked for by a name which is appropriate for (or describes) the user. The deployer can match alias names to actual context names.

Another use of SingletonBeanFactoryLocator, is to demand-load/use one or more BeanFactories/ApplicationContexts. Because the definition can contain one of more BeanFactories/ApplicationContexts, which can be independent or in a hierarchy, if they are set to lazy-initialize, they will only be created when actually requested for use.

Given the above-mentioned three ApplicationContexts, consider the simplest SingletonBeanFactoryLocator usage scenario, where there is only one single beanRefFactory.xml definition file:

<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">

 <beans>

   <bean id="com.mycompany.myapp"
         class="org.springframework.context.support.ClassPathXmlApplicationContext">
     <constructor-arg>
       <list>
         <value>com/mycompany/myapp/util/applicationContext.xml</value>
         <value>com/mycompany/myapp/dataaccess/applicationContext.xml</value>
         <value>com/mycompany/myapp/dataaccess/services.xml</value>
       </list>
     </constructor-arg>
   </bean>

 </beans>
The client code is as simple as:
 BeanFactoryLocator bfl = SingletonBeanFactoryLocator.getInstance();
 BeanFactoryReference bf = bfl.useBeanFactory("com.mycompany.myapp");
 // now use some bean from factory
 MyClass zed = bf.getFactory().getBean("mybean");
Another relatively simple variation of the beanRefFactory.xml definition file could be:
<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">

 <beans>

   <bean id="com.mycompany.myapp.util" lazy-init="true"
         class="org.springframework.context.support.ClassPathXmlApplicationContext">
     <constructor-arg>
       <value>com/mycompany/myapp/util/applicationContext.xml</value>
     </constructor-arg>
   </bean>

   <!-- child of above -->
   <bean id="com.mycompany.myapp.dataaccess" lazy-init="true"
         class="org.springframework.context.support.ClassPathXmlApplicationContext">
     <constructor-arg>
       <list><value>com/mycompany/myapp/dataaccess/applicationContext.xml</value></list>
     </constructor-arg>
     <constructor-arg>
       <ref bean="com.mycompany.myapp.util"/>
     </constructor-arg>
   </bean>

   <!-- child of above -->
   <bean id="com.mycompany.myapp.services" lazy-init="true"
         class="org.springframework.context.support.ClassPathXmlApplicationContext">
     <constructor-arg>
       <list><value>com/mycompany/myapp/dataaccess.services.xml</value></value>
     </constructor-arg>
     <constructor-arg>
       <ref bean="com.mycompany.myapp.dataaccess"/>
     </constructor-arg>
   </bean>

   <!-- define an alias -->
   <bean id="com.mycompany.myapp.mypackage"
         class="java.lang.String">
     <constructor-arg>
       <value>com.mycompany.myapp.services</value>
     </constructor-arg>
   </bean>

 </beans>

In this example, there is a hierarchy of three contexts created. The (potential) advantage is that if the lazy flag is set to true, a context will only be created if it's actually used. If there is some code that is only needed some of the time, this mechanism can save some resources. Additionally, an alias to the last context has been created. Aliases allow usage of the idiom where client code asks for a context with an id which represents the package or module the code is in, and the actual definition file(s) for the SingletonBeanFactoryLocator maps that id to a real context id.

A final example is more complex, with a beanRefFactory.xml for every module. All the files are automatically combined to create the final definition.

beanRefFactory.xml file inside jar for util module:

<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">

 <beans>
   <bean id="com.mycompany.myapp.util" lazy-init="true"
        class="org.springframework.context.support.ClassPathXmlApplicationContext">
     <constructor-arg>
       <value>com/mycompany/myapp/util/applicationContext.xml</value>
     </constructor-arg>
   </bean>
 </beans>
beanRefFactory.xml file inside jar for data-access module:
<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">

 <beans>
   <!-- child of util -->
   <bean id="com.mycompany.myapp.dataaccess" lazy-init="true"
        class="org.springframework.context.support.ClassPathXmlApplicationContext">
     <constructor-arg>
       <list><value>com/mycompany/myapp/dataaccess/applicationContext.xml</value></list>
     </constructor-arg>
     <constructor-arg>
       <ref bean="com.mycompany.myapp.util"/>
     </constructor-arg>
   </bean>
 </beans>
beanRefFactory.xml file inside jar for services module:
<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">

 <beans>
   <!-- child of data-access -->
   <bean id="com.mycompany.myapp.services" lazy-init="true"
        class="org.springframework.context.support.ClassPathXmlApplicationContext">
     <constructor-arg>
       <list><value>com/mycompany/myapp/dataaccess/services.xml</value></list>
     </constructor-arg>
     <constructor-arg>
       <ref bean="com.mycompany.myapp.dataaccess"/>
     </constructor-arg>
   </bean>
 </beans>
beanRefFactory.xml file inside jar for mypackage module. This doesn't create any of its own contexts, but allows the other ones to be referred to be a name known to this module:
<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">

 <beans>
   <!-- define an alias for "com.mycompany.myapp.services" -->
   <alias name="com.mycompany.myapp.services" alias="com.mycompany.myapp.mypackage"/>
 </beans>

Author:
Colin Sampaleanu, Juergen Hoeller
See Also:
ContextSingletonBeanFactoryLocator, DefaultLocatorFactory

Field Summary
protected static Log logger
Constructor Summary
protected SingletonBeanFactoryLocator(String resourceLocation)
Constructor which uses the the specified name as the resource name of the definition file(s).
Method Summary
protected BeanFactory | createDefinition(String resourceLocation, String factoryKey) Actually creates definition in the form of a BeanFactory, given a resource name which supports standard Spring resource prefixes ('classpath:', 'classpath*:', etc.) This is split out as a separate method so that subclasses can override the actual type used (to be an ApplicationContext, for example).
protected void | destroyDefinition(BeanFactory groupDef, String selector) Destroy definition in separate method so subclass may work with other definition types.
static BeanFactoryLocator | getInstance() Returns an instance which uses the default "classpath*:beanRefFactory.xml", as the name of the definition file(s).
static BeanFactoryLocator | getInstance(String selector) Returns an instance which uses the the specified selector, as the name of the definition file(s).
protected void | initializeDefinition(BeanFactory groupDef) Instantiate singletons and do any other normal initialization of the factory.
BeanFactoryReference | useBeanFactory(String factoryKey) Use the BeanFactory (or derived interface such as ApplicationContext) specified by the factoryKey parameter.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected static final Log logger
Constructor Detail

SingletonBeanFactoryLocator

protected SingletonBeanFactoryLocator(String resourceLocation)
Constructor which uses the the specified name as the resource name of the definition file(s).

Parameters:
resourceLocation - the Spring resource location to use (either a URL or a "classpath:" / "classpath*:" pseudo URL)
Method Detail

getInstance

public static BeanFactoryLocator getInstance()
                                      throws BeansException
Returns an instance which uses the default "classpath*:beanRefFactory.xml", as the name of the definition file(s). All resources returned by calling the current thread context ClassLoader's getResources method with this name will be combined to create a BeanFactory definition set.

Returns:
the corresponding BeanFactoryLocator instance
Throws:
BeansException - in case of factory loading failure

getInstance

public static BeanFactoryLocator getInstance(String selector)
                                      throws BeansException
Returns an instance which uses the the specified selector, as the name of the definition file(s). In the case of a name with a Spring 'classpath*:' prefix, or with no prefix, which is treated the same, the current thread context ClassLoader's getResources method will be called with this value to get all resources having that name. These resources will then be combined to form a definition. In the case where the name uses a Spring 'classpath:' prefix, or a standard URL prefix, then only one resource file will be loaded as the definition.

Parameters:
selector - the name of the resource(s) which will be read and combined to form the definition for the BeanFactoryLocator instance. Any such files must form a valid BeanFactory definition.
Returns:
the corresponding BeanFactoryLocator instance
Throws:
BeansException - in case of factory loading failure

useBeanFactory

public BeanFactoryReference useBeanFactory(String factoryKey)
                                    throws BeansException
Description copied from interface: BeanFactoryLocator
Use the BeanFactory (or derived interface such as ApplicationContext) specified by the factoryKey parameter.

The definition is possibly loaded/created as needed.

Specified by:
useBeanFactory in interface BeanFactoryLocator
Parameters:
factoryKey - a resource name specifying which BeanFactory the BeanFactoryLocator must return for usage. The actual meaning of the resource name is specific to the implementation of BeanFactoryLocator.
Returns:
the BeanFactory instance, wrapped as a BeanFactoryReference object
Throws:
BeansException - if there is an error loading or accessing the BeanFactory

createDefinition

protected BeanFactory createDefinition(String resourceLocation,
                                       String factoryKey)
Actually creates definition in the form of a BeanFactory, given a resource name which supports standard Spring resource prefixes ('classpath:', 'classpath*:', etc.) This is split out as a separate method so that subclasses can override the actual type used (to be an ApplicationContext, for example).

The default implementation simply builds a DefaultListableBeanFactory and populates it using an XmlBeanDefinitionReader.

This method should not instantiate any singletons. That function is performed by initializeDefinition(), which should also be overridden if this method is.

Parameters:
resourceLocation - the resource location for this factory group
factoryKey - the bean name of the factory to obtain
Returns:
the corresponding BeanFactory reference

initializeDefinition

protected void initializeDefinition(BeanFactory groupDef)
Instantiate singletons and do any other normal initialization of the factory. Subclasses that override createDefinition() should also override this method.

Parameters:
groupDef - the factory returned by createDefinition()

destroyDefinition

protected void destroyDefinition(BeanFactory groupDef,
                                 String selector)
Destroy definition in separate method so subclass may work with other definition types.

Parameters:
groupDef - the factory returned by createDefinition()
selector - the resource location for this factory group
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


BootstrapException

org.springframework.beans.factory.access
Class BootstrapException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.beans.BeansException
                        extended by  org.springframework.beans.FatalBeanException
                            extended by  org.springframework.beans.factory.access.BootstrapException
All Implemented Interfaces:
Serializable
public class BootstrapException
extends FatalBeanException

Exception thrown if a bean factory could not be loaded by a bootstrap class.

Since:
02.12.2002
Author:
Rod Johnson
See Also:
Serialized Form

Constructor Summary
BootstrapException(String msg)
Create a new BootstrapException with the specified message.
BootstrapException(String msg, Throwable cause)
Create a new BootstrapException with the specified message and root cause.
Method Summary
Methods inherited from class org.springframework.beans.BeansException
equals, hashCode
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

BootstrapException

public BootstrapException(String msg)
Create a new BootstrapException with the specified message.

Parameters:
msg - the detail message

BootstrapException

public BootstrapException(String msg,
                          Throwable cause)
Create a new BootstrapException with the specified message and root cause.

Parameters:
msg - the detail message
cause - the root cause
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.beans.factory.access.el

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.beans.factory.access.el

Support classes for accessing a Spring BeanFactory from Unified EL.

See:
Description

Class Summary
SimpleSpringBeanELResolver | Simple concrete variant of SpringBeanELResolver, delegating to a given BeanFactory that the resolver was constructed with.
SpringBeanELResolver | Unified EL ELResolver that delegates to a Spring BeanFactory, resolving name references to Spring-defined beans.

Package org.springframework.beans.factory.access.el Description

Support classes for accessing a Spring BeanFactory from Unified EL.


org.springframework.beans.factory.access.el Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.beans.factory.access.el

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.el.ELResolver
      • org.springframework.beans.factory.access.el.SpringBeanELResolver
        • org.springframework.beans.factory.access.el.SimpleSpringBeanELResolver


SimpleSpringBeanELResolver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.beans.factory.access.el
Class SimpleSpringBeanELResolver

java.lang.Object
    extended by  javax.el.ELResolver
        extended by  org.springframework.beans.factory.access.el.SpringBeanELResolver
            extended by  org.springframework.beans.factory.access.el.SimpleSpringBeanELResolver

public class SimpleSpringBeanELResolver
extends SpringBeanELResolver

Simple concrete variant of SpringBeanELResolver, delegating to a given BeanFactory that the resolver was constructed with.

Since:
2.5.2
Author:
Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.beans.factory.access.el.SpringBeanELResolver
logger
Fields inherited from class javax.el.ELResolver
RESOLVABLE_AT_DESIGN_TIME, TYPE
Constructor Summary
SimpleSpringBeanELResolver(BeanFactory beanFactory)
Create a new SimpleSpringBeanELResolver for the given BeanFactory.
Method Summary
protected  BeanFactory getBeanFactory(javax.el.ELContext elContext)
Retrieve the Spring BeanFactory to delegate bean name resolution to.
Methods inherited from class org.springframework.beans.factory.access.el.SpringBeanELResolver
getCommonPropertyType, getFeatureDescriptors, getType, getValue, isReadOnly, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleSpringBeanELResolver

public SimpleSpringBeanELResolver(BeanFactory beanFactory)
Create a new SimpleSpringBeanELResolver for the given BeanFactory.

Parameters:
beanFactory - the Spring BeanFactory to delegate to
Method Detail

getBeanFactory

protected BeanFactory getBeanFactory(javax.el.ELContext elContext)
Description copied from class: SpringBeanELResolver
Retrieve the Spring BeanFactory to delegate bean name resolution to.

Specified by:
getBeanFactory in class SpringBeanELResolver
Parameters:
elContext - the current ELContext
Returns:
the Spring BeanFactory (never null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


SpringBeanELResolver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.beans.factory.access.el
Class SpringBeanELResolver

java.lang.Object
    extended by  javax.el.ELResolver
        extended by  org.springframework.beans.factory.access.el.SpringBeanELResolver
Direct Known Subclasses:
SimpleSpringBeanELResolver, SpringBeanFacesELResolver
public abstract class SpringBeanELResolver
extends javax.el.ELResolver

Unified EL ELResolver that delegates to a Spring BeanFactory, resolving name references to Spring-defined beans.

Since:
2.5.2
Author:
Juergen Hoeller
See Also:
SpringBeanFacesELResolver

Field Summary
protected  Log logger
Logger available to subclasses
Fields inherited from class javax.el.ELResolver
RESOLVABLE_AT_DESIGN_TIME, TYPE
Constructor Summary
SpringBeanELResolver()
Method Summary
protected abstract BeanFactory | getBeanFactory(javax.el.ELContext elContext) Retrieve the Spring BeanFactory to delegate bean name resolution to.
Class<?> | getCommonPropertyType(javax.el.ELContext elContext, Object base)
Iterator<FeatureDescriptor> | getFeatureDescriptors(javax.el.ELContext elContext, Object base)
Class<?> | getType(javax.el.ELContext elContext, Object base, Object property)
Object | getValue(javax.el.ELContext elContext, Object base, Object property)
boolean | isReadOnly(javax.el.ELContext elContext, Object base, Object property)
void | setValue(javax.el.ELContext elContext, Object base, Object property, Object value)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

SpringBeanELResolver

public SpringBeanELResolver()
Method Detail

getValue

public Object getValue(javax.el.ELContext elContext,
                       Object base,
                       Object property)
                throws javax.el.ELException
Specified by:
getValue in class javax.el.ELResolver
Throws:
javax.el.ELException

getType

public Class<?> getType(javax.el.ELContext elContext,
                        Object base,
                        Object property)
                 throws javax.el.ELException
Specified by:
getType in class javax.el.ELResolver
Throws:
javax.el.ELException

setValue

public void setValue(javax.el.ELContext elContext,
                     Object base,
                     Object property,
                     Object value)
              throws javax.el.ELException
Specified by:
setValue in class javax.el.ELResolver
Throws:
javax.el.ELException

isReadOnly

public boolean isReadOnly(javax.el.ELContext elContext,
                          Object base,
                          Object property)
                   throws javax.el.ELException
Specified by:
isReadOnly in class javax.el.ELResolver
Throws:
javax.el.ELException

getFeatureDescriptors

public Iterator<FeatureDescriptor> getFeatureDescriptors(javax.el.ELContext elContext,
                                                         Object base)
Specified by:
getFeatureDescriptors in class javax.el.ELResolver

getCommonPropertyType

public Class<?> getCommonPropertyType(javax.el.ELContext elContext,
                                      Object base)
Specified by:
getCommonPropertyType in class javax.el.ELResolver

getBeanFactory

protected abstract BeanFactory getBeanFactory(javax.el.ELContext elContext)
Retrieve the Spring BeanFactory to delegate bean name resolution to.

Parameters:
elContext - the current ELContext
Returns:
the Spring BeanFactory (never null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.beans.factory.annotation

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.beans.factory.annotation

Support package for annotation-driven bean configuration.

See:
Description

Interface Summary
AnnotatedBeanDefinition Extended BeanDefinition interface that exposes AnnotationMetadata about its bean class - without requiring the class to be loaded yet.

Class Summary
AnnotatedGenericBeanDefinition | Extension of the GenericBeanDefinition class, adding support for annotation metadata exposed through the AnnotatedBeanDefinition interface.
AnnotationBeanWiringInfoResolver | BeanWiringInfoResolver that uses the Configurable annotation to identify which classes need autowiring.
AutowiredAnnotationBeanPostProcessor | BeanPostProcessor implementation that autowires annotated fields, setter methods and arbitrary config methods.
CustomAutowireConfigurer | A BeanFactoryPostProcessor implementation that allows for convenient registration of custom autowire qualifier types.
InitDestroyAnnotationBeanPostProcessor | BeanPostProcessor implementation that invokes annotated init and destroy methods.
InjectionMetadata | Internal class for managing injection metadata.
InjectionMetadata.InjectedElement |
QualifierAnnotationAutowireCandidateResolver | AutowireCandidateResolver implementation that matches bean definition qualifiers against qualifier annotations on the field or parameter to be autowired.
RequiredAnnotationBeanPostProcessor | BeanPostProcessor implementation that enforces required JavaBean properties to have been configured.

Enum Summary
Autowire Enumeration determining autowiring status: that is, whether a bean should have its dependencies automatically injected by the Spring container using setter injection.

Annotation Types Summary
Autowired | Marks a constructor, field, setter method or config method as to be autowired by Spring's dependency injection facilities.
Configurable | Marks a class as being eligible for Spring-driven configuration.
Qualifier | This annotation may be used on a field or parameter as a qualifier for candidate beans when autowiring.
Required | Marks a method (typically a JavaBean setter method) as being 'required': that is, the setter method must be configured to be dependency-injected with a value.
Value | Annotation at the field or method/constructor parameter level that indicates a default value expression for the affected argument.

Package org.springframework.beans.factory.annotation Description

Support package for annotation-driven bean configuration.


org.springframework.beans.factory.annotation Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.beans.factory.annotation

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.beans.factory.annotation.AnnotationBeanWiringInfoResolver (implements org.springframework.beans.factory.wiring.BeanWiringInfoResolver)
    • org.springframework.core.AttributeAccessorSupport (implements org.springframework.core.AttributeAccessor, java.io.Serializable)
      • org.springframework.beans.BeanMetadataAttributeAccessor (implements org.springframework.beans.BeanMetadataElement)
        • org.springframework.beans.factory.support.AbstractBeanDefinition (implements org.springframework.beans.factory.config.BeanDefinition, java.lang.Cloneable)
          • org.springframework.beans.factory.support.GenericBeanDefinition
            • org.springframework.beans.factory.annotation.AnnotatedGenericBeanDefinition (implements org.springframework.beans.factory.annotation.AnnotatedBeanDefinition)
    • org.springframework.beans.factory.annotation.CustomAutowireConfigurer (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.core.Ordered)
    • org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor (implements org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor, org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor, org.springframework.core.PriorityOrdered, java.io.Serializable)
    • org.springframework.beans.factory.annotation.InjectionMetadata
    • org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement
    • org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter (implements org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor)
      • org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor, org.springframework.core.PriorityOrdered)
      • org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor, org.springframework.core.PriorityOrdered)
    • org.springframework.beans.factory.annotation.QualifierAnnotationAutowireCandidateResolver (implements org.springframework.beans.factory.support.AutowireCandidateResolver, org.springframework.beans.factory.BeanFactoryAware)

Interface Hierarchy

  • org.springframework.core.AttributeAccessor
    • org.springframework.beans.factory.config.BeanDefinition (also extends org.springframework.beans.BeanMetadataElement)
      • org.springframework.beans.factory.annotation.AnnotatedBeanDefinition
  • org.springframework.beans.BeanMetadataElement
    • org.springframework.beans.factory.config.BeanDefinition (also extends org.springframework.core.AttributeAccessor)
      • org.springframework.beans.factory.annotation.AnnotatedBeanDefinition

Annotation Type Hierarchy

  • org.springframework.beans.factory.annotation.Value (implements java.lang.annotation.Annotation)
  • org.springframework.beans.factory.annotation.Required (implements java.lang.annotation.Annotation)
  • org.springframework.beans.factory.annotation.Qualifier (implements java.lang.annotation.Annotation)
  • org.springframework.beans.factory.annotation.Configurable (implements java.lang.annotation.Annotation)
  • org.springframework.beans.factory.annotation.Autowired (implements java.lang.annotation.Annotation)

Enum Hierarchy

  • java.lang.Object
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)
      • org.springframework.beans.factory.annotation.Autowire


AnnotatedBeanDefinition

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.beans.factory.annotation
Interface AnnotatedBeanDefinition

All Superinterfaces:
AttributeAccessor, BeanDefinition, BeanMetadataElement
All Known Implementing Classes:
AnnotatedGenericBeanDefinition, ScannedGenericBeanDefinition
public interface AnnotatedBeanDefinition
extends BeanDefinition

Extended BeanDefinition interface that exposes AnnotationMetadata about its bean class - without requiring the class to be loaded yet.

Since:
2.5
Author:
Juergen Hoeller
See Also:
AnnotatedGenericBeanDefinition, AnnotationMetadata

Field Summary
Fields inherited from interface org.springframework.beans.factory.config.BeanDefinition
ROLE_APPLICATION, ROLE_INFRASTRUCTURE, ROLE_SUPPORT, SCOPE_PROTOTYPE, SCOPE_SINGLETON
Method Summary
 AnnotationMetadata getMetadata()
Obtain the annotation metadata (as well as basic class metadata) for this bean definition's bean class.
Methods inherited from interface org.springframework.beans.factory.config.BeanDefinition
getBeanClassName, getConstructorArgumentValues, getDependsOn, getDescription, getFactoryBeanName, getFactoryMethodName, getOriginatingBeanDefinition, getParentName, getPropertyValues, getResourceDescription, getRole, getScope, isAbstract, isAutowireCandidate, isLazyInit, isPrimary, isPrototype, isSingleton, setAutowireCandidate, setBeanClassName, setDependsOn, setFactoryBeanName, setFactoryMethodName, setLazyInit, setParentName, setPrimary, setScope
Methods inherited from interface org.springframework.core.AttributeAccessor
attributeNames, getAttribute, hasAttribute, removeAttribute, setAttribute
Methods inherited from interface org.springframework.beans.BeanMetadataElement
getSource

Method Detail

getMetadata

AnnotationMetadata getMetadata()
Obtain the annotation metadata (as well as basic class metadata) for this bean definition's bean class.

Returns:
the annotation metadata object (never null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AnnotatedGenericBeanDefinition

org.springframework.beans.factory.annotation
Class AnnotatedGenericBeanDefinition

java.lang.Object
    extended by  org.springframework.core.AttributeAccessorSupport
        extended by  org.springframework.beans.BeanMetadataAttributeAccessor
            extended by  org.springframework.beans.factory.support.AbstractBeanDefinition
                extended by  org.springframework.beans.factory.support.GenericBeanDefinition
                    extended by  org.springframework.beans.factory.annotation.AnnotatedGenericBeanDefinition
All Implemented Interfaces:
Serializable, Cloneable, BeanMetadataElement, AnnotatedBeanDefinition, BeanDefinition, AttributeAccessor
public class AnnotatedGenericBeanDefinition
extends GenericBeanDefinition
implements AnnotatedBeanDefinition

Extension of the GenericBeanDefinition class, adding support for annotation metadata exposed through the AnnotatedBeanDefinition interface.

This GenericBeanDefinition variant is mainly useful for testing code that expects to operate on an AnnotatedBeanDefinition, for example strategy implementations in Spring's component scanning support (where the default definition class is ScannedGenericBeanDefinition, which also implements the AnnotatedBeanDefinition interface).

Since:
2.5
Author:
Juergen Hoeller
See Also:
AnnotatedBeanDefinition.getMetadata(), StandardAnnotationMetadata, Serialized Form

Field Summary
Fields inherited from class org.springframework.beans.factory.support.AbstractBeanDefinition
AUTOWIRE_AUTODETECT, AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_CONSTRUCTOR, AUTOWIRE_NO, DEPENDENCY_CHECK_ALL, DEPENDENCY_CHECK_NONE, DEPENDENCY_CHECK_OBJECTS, DEPENDENCY_CHECK_SIMPLE, SCOPE_DEFAULT
Fields inherited from interface org.springframework.beans.factory.config.BeanDefinition
ROLE_APPLICATION, ROLE_INFRASTRUCTURE, ROLE_SUPPORT, SCOPE_PROTOTYPE, SCOPE_SINGLETON
Constructor Summary
AnnotatedGenericBeanDefinition(Class beanClass)
Create a new AnnotatedGenericBeanDefinition for the given bean class.
Method Summary
 AnnotationMetadata getMetadata()
Obtain the annotation metadata (as well as basic class metadata) for this bean definition's bean class.
Methods inherited from class org.springframework.beans.factory.support.GenericBeanDefinition
cloneBeanDefinition, equals, getParentName, setParentName, toString
Methods inherited from class org.springframework.beans.factory.support.AbstractBeanDefinition
addQualifier, applyDefaults, clone, copyQualifiersFrom, getAutowireMode, getBeanClass, getBeanClassName, getConstructorArgumentValues, getDependencyCheck, getDependsOn, getDescription, getDestroyMethodName, getFactoryBeanName, getFactoryMethodName, getInitMethodName, getMethodOverrides, getOriginatingBeanDefinition, getPropertyValues, getQualifier, getQualifiers, getResolvedAutowireMode, getResource, getResourceDescription, getRole, getScope, hasBeanClass, hasConstructorArgumentValues, hashCode, hasQualifier, isAbstract, isAutowireCandidate, isEnforceDestroyMethod, isEnforceInitMethod, isLazyInit, isLenientConstructorResolution, isNonPublicAccessAllowed, isPrimary, isPrototype, isSingleton, isSynthetic, overrideFrom, overrideFrom, prepareMethodOverride, prepareMethodOverrides, resolveBeanClass, setAbstract, setAutowireCandidate, setAutowireMode, setBeanClass, setBeanClassName, setConstructorArgumentValues, setDependencyCheck, setDependsOn, setDescription, setDestroyMethodName, setEnforceDestroyMethod, setEnforceInitMethod, setFactoryBeanName, setFactoryMethodName, setInitMethodName, setLazyInit, setLenientConstructorResolution, setMethodOverrides, setNonPublicAccessAllowed, setOriginatingBeanDefinition, setPrimary, setPropertyValues, setResource, setResourceDescription, setRole, setScope, setSingleton, setSynthetic, validate
Methods inherited from class org.springframework.beans.BeanMetadataAttributeAccessor
addMetadataAttribute, getAttribute, getMetadataAttribute, getSource, removeAttribute, setAttribute, setSource
Methods inherited from class org.springframework.core.AttributeAccessorSupport
attributeNames, copyAttributesFrom, hasAttribute
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.config.BeanDefinition
getBeanClassName, getConstructorArgumentValues, getDependsOn, getDescription, getFactoryBeanName, getFactoryMethodName, getOriginatingBeanDefinition, getParentName, getPropertyValues, getResourceDescription, getRole, getScope, isAbstract, isAutowireCandidate, isLazyInit, isPrimary, isPrototype, isSingleton, setAutowireCandidate, setBeanClassName, setDependsOn, setFactoryBeanName, setFactoryMethodName, setLazyInit, setParentName, setPrimary, setScope
Methods inherited from interface org.springframework.core.AttributeAccessor
attributeNames, getAttribute, hasAttribute, removeAttribute, setAttribute
Methods inherited from interface org.springframework.beans.BeanMetadataElement
getSource

Constructor Detail

AnnotatedGenericBeanDefinition

public AnnotatedGenericBeanDefinition(Class beanClass)
Create a new AnnotatedGenericBeanDefinition for the given bean class.

Parameters:
beanClass - the loaded bean class
Method Detail

getMetadata

public final AnnotationMetadata getMetadata()
Description copied from interface: AnnotatedBeanDefinition
Obtain the annotation metadata (as well as basic class metadata) for this bean definition's bean class.

Specified by:
getMetadata in interface AnnotatedBeanDefinition
Returns:
the annotation metadata object (never null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AnnotationBeanWiringInfoResolver

org.springframework.beans.factory.annotation
Class AnnotationBeanWiringInfoResolver

java.lang.Object
    extended by  org.springframework.beans.factory.annotation.AnnotationBeanWiringInfoResolver
All Implemented Interfaces:
BeanWiringInfoResolver
public class AnnotationBeanWiringInfoResolver
extends Object
implements BeanWiringInfoResolver

BeanWiringInfoResolver that uses the Configurable annotation to identify which classes need autowiring. The bean name to look up will be taken from the Configurable annotation if specified; otherwise the default will be the fully-qualified name of the class being configured.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller
See Also:
Configurable, ClassNameBeanWiringInfoResolver

Constructor Summary
AnnotationBeanWiringInfoResolver()
Method Summary
protected BeanWiringInfo | buildWiringInfo(Object beanInstance, Configurable annotation) Build the BeanWiringInfo for the given Configurable annotation.
protected String | getDefaultBeanName(Object beanInstance) Determine the default bean name for the specified bean instance.
BeanWiringInfo | resolveWiringInfo(Object beanInstance) Resolve the BeanWiringInfo for the given bean instance.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AnnotationBeanWiringInfoResolver

public AnnotationBeanWiringInfoResolver()
Method Detail

resolveWiringInfo

public BeanWiringInfo resolveWiringInfo(Object beanInstance)
Description copied from interface: BeanWiringInfoResolver
Resolve the BeanWiringInfo for the given bean instance.

Specified by:
resolveWiringInfo in interface BeanWiringInfoResolver
Parameters:
beanInstance - the bean instance to resolve info for
Returns:
the BeanWiringInfo, or null if not found

buildWiringInfo

protected BeanWiringInfo buildWiringInfo(Object beanInstance,
                                         Configurable annotation)
Build the BeanWiringInfo for the given Configurable annotation.

Parameters:
beanInstance - the bean instance
annotation - the Configurable annotation found on the bean class
Returns:
the resolved BeanWiringInfo

getDefaultBeanName

protected String getDefaultBeanName(Object beanInstance)
Determine the default bean name for the specified bean instance.

The default implementation returns the superclass name for a CGLIB proxy and the name of the plain bean class else.

Parameters:
beanInstance - the bean instance to build a default name for
Returns:
the default bean name to use
See Also:
ClassUtils.getUserClass(Class)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AutowiredAnnotationBeanPostProcessor

org.springframework.beans.factory.annotation
Class AutowiredAnnotationBeanPostProcessor

java.lang.Object
    extended by  org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter
        extended by  org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor
All Implemented Interfaces:
BeanFactoryAware, BeanPostProcessor, InstantiationAwareBeanPostProcessor, SmartInstantiationAwareBeanPostProcessor, MergedBeanDefinitionPostProcessor, Ordered, PriorityOrdered
public class AutowiredAnnotationBeanPostProcessor
extends InstantiationAwareBeanPostProcessorAdapter
implements MergedBeanDefinitionPostProcessor, PriorityOrdered, BeanFactoryAware

BeanPostProcessor implementation that autowires annotated fields, setter methods and arbitrary config methods. Such members to be injected are detected through a Java 5 annotation: by default, Spring's Autowired annotation.

Only one constructor (at max) of any given bean class may carry this annotation with the 'required' parameter set to true, indicating the constructor to autowire when used as a Spring bean. If multiple non-required constructors carry the annotation, they will be considered as candidates for autowiring. The constructor with the greatest number of dependencies that can be satisfied by matching beans in the Spring container will be chosen. If none of the candidates can be satisfied, then a default constructor (if present) will be used. An annotated constructor does not have to be public.

Fields are injected right after construction of a bean, before any config methods are invoked. Such a config field does not have to be public.

Config methods may have an arbitrary name and any number of arguments; each of those arguments will be autowired with a matching bean in the Spring container. Bean property setter methods are effectively just a special case of such a general config method. Such config methods do not have to be public.

Also supports JSR-330's Inject annotation, if available.

Note: A default AutowiredAnnotationBeanPostProcessor will be registered by the "context:annotation-config" and "context:component-scan" XML tags. Remove or turn off the default annotation configuration there if you intend to specify a custom AutowiredAnnotationBeanPostProcessor bean definition.

NOTE: Annotation injection will be performed before XML injection; thus the latter configuration will override the former for properties wired through both approaches.

Since:
2.5
Author:
Juergen Hoeller, Mark Fisher
See Also:
setAutowiredAnnotationType(java.lang.Class), Autowired

Field Summary
protected  Log logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AutowiredAnnotationBeanPostProcessor()
Create a new AutowiredAnnotationBeanPostProcessor for Spring's standard Autowired annotation.
Method Summary
 Constructor[] determineCandidateConstructors(Class beanClass, String beanName)
Determine the candidate constructors to use for the given bean.
protected  boolean determineRequiredStatus(Annotation annotation)
Determine if the annotated field or method requires its dependency.
protected
<T> Map<String,T>
findAutowireCandidates(Class<T> type)
Obtain all beans of the given type as autowire candidates.
 int getOrder()
Return the order value of this object, with a higher value meaning greater in terms of sorting.
 void postProcessMergedBeanDefinition(RootBeanDefinition beanDefinition, Class beanType, String beanName)
Post-process the given merged bean definition for the specified bean.
 PropertyValues postProcessPropertyValues(PropertyValues pvs, PropertyDescriptor[] pds, Object bean, String beanName)
Post-process the given property values before the factory applies them to the given bean.
 void processInjection(Object bean)
'Native' processing method for direct calls with an arbitrary target instance, resolving all of its fields and methods which are annotated with @Autowired.
 void setAutowiredAnnotationType(Class<? extends Annotation> autowiredAnnotationType)
Set the 'autowired' annotation type, to be used on constructors, fields, setter methods and arbitrary config methods.
 void setAutowiredAnnotationTypes(Set<Class<? extends Annotation>> autowiredAnnotationTypes)
Set the 'autowired' annotation types, to be used on constructors, fields, setter methods and arbitrary config methods.
 void setBeanFactory(BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance.
 void setOrder(int order)
 void setRequiredParameterName(String requiredParameterName)
Set the name of a parameter of the annotation that specifies whether it is required.
 void setRequiredParameterValue(boolean requiredParameterValue)
Set the boolean value that marks a dependency as required
Methods inherited from class org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter
getEarlyBeanReference, postProcessAfterInitialization, postProcessAfterInstantiation, postProcessBeforeInitialization, postProcessBeforeInstantiation, predictBeanType
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.config.BeanPostProcessor
postProcessAfterInitialization, postProcessBeforeInitialization

Field Detail

logger

protected final Log logger
Constructor Detail

AutowiredAnnotationBeanPostProcessor

public AutowiredAnnotationBeanPostProcessor()
Create a new AutowiredAnnotationBeanPostProcessor for Spring's standard Autowired annotation.

Also supports JSR-330's Inject annotation, if available.

Method Detail

setAutowiredAnnotationType

public void setAutowiredAnnotationType(Class<? extends Annotation> autowiredAnnotationType)
Set the 'autowired' annotation type, to be used on constructors, fields, setter methods and arbitrary config methods.

The default autowired annotation type is the Spring-provided Autowired annotation, as well as Value.

This setter property exists so that developers can provide their own (non-Spring-specific) annotation type to indicate that a member is supposed to be autowired.

setAutowiredAnnotationTypes

public void setAutowiredAnnotationTypes(Set<Class<? extends Annotation>> autowiredAnnotationTypes)
Set the 'autowired' annotation types, to be used on constructors, fields, setter methods and arbitrary config methods.

The default autowired annotation type is the Spring-provided Autowired annotation, as well as Value.

This setter property exists so that developers can provide their own (non-Spring-specific) annotation types to indicate that a member is supposed to be autowired.

setRequiredParameterName

public void setRequiredParameterName(String requiredParameterName)
Set the name of a parameter of the annotation that specifies whether it is required.

See Also:
setRequiredParameterValue(boolean)

setRequiredParameterValue

public void setRequiredParameterValue(boolean requiredParameterValue)
Set the boolean value that marks a dependency as required

For example if using 'required=true' (the default), this value should be true; but if using 'optional=false', this value should be false.

See Also:
setRequiredParameterName(String)

setOrder

public void setOrder(int order)

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
                    throws BeansException
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
Throws:
BeansException - in case of initialization errors
See Also:
BeanInitializationException

postProcessMergedBeanDefinition

public void postProcessMergedBeanDefinition(RootBeanDefinition beanDefinition,
                                            Class beanType,
                                            String beanName)
Description copied from interface: MergedBeanDefinitionPostProcessor
Post-process the given merged bean definition for the specified bean.

Specified by:
postProcessMergedBeanDefinition in interface MergedBeanDefinitionPostProcessor
Parameters:
beanDefinition - the merged bean definition for the bean
beanType - the actual type of the managed bean instance
beanName - the name of the bean

determineCandidateConstructors

public Constructor[] determineCandidateConstructors(Class beanClass,
                                                    String beanName)
                                             throws BeansException
Description copied from interface: SmartInstantiationAwareBeanPostProcessor
Determine the candidate constructors to use for the given bean.

Specified by:
determineCandidateConstructors in interface SmartInstantiationAwareBeanPostProcessor
Overrides:
determineCandidateConstructors in class InstantiationAwareBeanPostProcessorAdapter
Parameters:
beanClass - the raw class of the bean (never null)
beanName - the name of the bean
Returns:
the candidate constructors, or null if none specified
Throws:
BeansException - in case of errors

postProcessPropertyValues

public PropertyValues postProcessPropertyValues(PropertyValues pvs,
                                                PropertyDescriptor[] pds,
                                                Object bean,
                                                String beanName)
                                         throws BeansException
Description copied from interface: InstantiationAwareBeanPostProcessor
Post-process the given property values before the factory applies them to the given bean. Allows for checking whether all dependencies have been satisfied, for example based on a "Required" annotation on bean property setters.

Also allows for replacing the property values to apply, typically through creating a new MutablePropertyValues instance based on the original PropertyValues, adding or removing specific values.

Specified by:
postProcessPropertyValues in interface InstantiationAwareBeanPostProcessor
Overrides:
postProcessPropertyValues in class InstantiationAwareBeanPostProcessorAdapter
Parameters:
pvs - the property values that the factory is about to apply (never null)
pds - the relevant property descriptors for the target bean (with ignored dependency types - which the factory handles specifically - already filtered out)
bean - the bean instance created, but whose properties have not yet been set
beanName - the name of the bean
Returns:
the actual property values to apply to to the given bean (can be the passed-in PropertyValues instance), or null to skip property population
Throws:
BeansException - in case of errors
See Also:
MutablePropertyValues

processInjection

public void processInjection(Object bean)
                      throws BeansException
'Native' processing method for direct calls with an arbitrary target instance, resolving all of its fields and methods which are annotated with @Autowired.

Parameters:
bean - the target instance to process
Throws:
BeansException - if autowiring failed

findAutowireCandidates

protected <T> Map<String,T> findAutowireCandidates(Class<T> type)
                                        throws BeansException
Obtain all beans of the given type as autowire candidates.

Parameters:
type - the type of the bean
Returns:
the target beans, or an empty Collection if no bean of this type is found
Throws:
BeansException - if bean retrieval failed

determineRequiredStatus

protected boolean determineRequiredStatus(Annotation annotation)
Determine if the annotated field or method requires its dependency.

A 'required' dependency means that autowiring should fail when no beans are found. Otherwise, the autowiring process will simply bypass the field or method when no beans are found.

Parameters:
annotation - the Autowired annotation
Returns:
whether the annotation indicates that a dependency is required
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CustomAutowireConfigurer

org.springframework.beans.factory.annotation
Class CustomAutowireConfigurer

java.lang.Object
    extended by  org.springframework.beans.factory.annotation.CustomAutowireConfigurer
All Implemented Interfaces:
BeanClassLoaderAware, BeanFactoryPostProcessor, Ordered
public class CustomAutowireConfigurer
extends Object
implements BeanFactoryPostProcessor, BeanClassLoaderAware, Ordered

A BeanFactoryPostProcessor implementation that allows for convenient registration of custom autowire qualifier types.

 <bean id="customAutowireConfigurer" class="org.springframework.beans.factory.annotation.CustomAutowireConfigurer">
   <property name="customQualifierTypes">
     <set>
       <value>mypackage.MyQualifier</value>
     </set>
   </property>
 </bean>

Since:
2.5
Author:
Mark Fisher, Juergen Hoeller
See Also:
Qualifier

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
CustomAutowireConfigurer()
Method Summary
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
void | postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) Modify the application context's internal bean factory after its standard initialization.
void | setBeanClassLoader(ClassLoader beanClassLoader) Callback that supplies the bean class loader to a bean instance.
void | setCustomQualifierTypes(Set customQualifierTypes) Register custom qualifier annotation types to be considered when autowiring beans.
void | setOrder(int order)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CustomAutowireConfigurer

public CustomAutowireConfigurer()
Method Detail

setOrder

public void setOrder(int order)

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

setBeanClassLoader

public void setBeanClassLoader(ClassLoader beanClassLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
beanClassLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

setCustomQualifierTypes

public void setCustomQualifierTypes(Set customQualifierTypes)
Register custom qualifier annotation types to be considered when autowiring beans. Each element of the provided set may be either a Class instance or a String representation of the fully-qualified class name of the custom annotation.

Note that any annotation that is itself annotated with Spring's Qualifier does not require explicit registration.

Parameters:
customQualifierTypes - the custom types to register

postProcessBeanFactory

public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
                            throws BeansException
Description copied from interface: BeanFactoryPostProcessor
Modify the application context's internal bean factory after its standard initialization. All bean definitions will have been loaded, but no beans will have been instantiated yet. This allows for overriding or adding properties even to eager-initializing beans.

Specified by:
postProcessBeanFactory in interface BeanFactoryPostProcessor
Parameters:
beanFactory - the bean factory used by the application context
Throws:
BeansException - in case of errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InitDestroyAnnotationBeanPostProcessor

org.springframework.beans.factory.annotation
Class InitDestroyAnnotationBeanPostProcessor

java.lang.Object
    extended by  org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor
All Implemented Interfaces:
Serializable, BeanPostProcessor, DestructionAwareBeanPostProcessor, MergedBeanDefinitionPostProcessor, Ordered, PriorityOrdered
Direct Known Subclasses:
CommonAnnotationBeanPostProcessor
public class InitDestroyAnnotationBeanPostProcessor
extends Object
implements DestructionAwareBeanPostProcessor, MergedBeanDefinitionPostProcessor, PriorityOrdered, Serializable

BeanPostProcessor implementation that invokes annotated init and destroy methods. Allows for an annotation alternative to Spring's InitializingBean and DisposableBean callback interfaces.

The actual annotation types that this post-processor checks for can be configured through the "initAnnotationType" and "destroyAnnotationType" properties. Any custom annotation can be used, since there are no required annotation attributes.

Init and destroy annotations may be applied to methods of any visibility: public, package-protected, protected, or private. Multiple such methods may be annotated, but it is recommended to only annotate one single init method and destroy method, respectively.

Spring's CommonAnnotationBeanPostProcessor supports the JSR-250 PostConstruct and PreDestroy annotations out of the box, as init annotation and destroy annotation, respectively. Furthermore, it also supports the Resource annotation for annotation-driven injection of named beans.

Since:
2.5
Author:
Juergen Hoeller
See Also:
setInitAnnotationType(java.lang.Class), setDestroyAnnotationType(java.lang.Class), Serialized Form

Field Summary
protected  Log logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
InitDestroyAnnotationBeanPostProcessor()
Method Summary
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
Object | postProcessAfterInitialization(Object bean, String beanName) Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).
void | postProcessBeforeDestruction(Object bean, String beanName) Apply this BeanPostProcessor to the given bean instance before its destruction.
Object | postProcessBeforeInitialization(Object bean, String beanName) Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).
void | postProcessMergedBeanDefinition(RootBeanDefinition beanDefinition, Class beanType, String beanName) Post-process the given merged bean definition for the specified bean.
void | setDestroyAnnotationType(Class<? extends Annotation> destroyAnnotationType) Specify the destroy annotation to check for, indicating destruction methods to call when the context is shutting down.
void | setInitAnnotationType(Class<? extends Annotation> initAnnotationType) Specify the init annotation to check for, indicating initialization methods to call after configuration of a bean.
void | setOrder(int order)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected transient Log logger
Constructor Detail

InitDestroyAnnotationBeanPostProcessor

public InitDestroyAnnotationBeanPostProcessor()
Method Detail

setInitAnnotationType

public void setInitAnnotationType(Class<? extends Annotation> initAnnotationType)
Specify the init annotation to check for, indicating initialization methods to call after configuration of a bean.

Any custom annotation can be used, since there are no required annotation attributes. There is no default, although a typical choice is the JSR-250 PostConstruct annotation.

setDestroyAnnotationType

public void setDestroyAnnotationType(Class<? extends Annotation> destroyAnnotationType)
Specify the destroy annotation to check for, indicating destruction methods to call when the context is shutting down.

Any custom annotation can be used, since there are no required annotation attributes. There is no default, although a typical choice is the JSR-250 PreDestroy annotation.

setOrder

public void setOrder(int order)

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

postProcessMergedBeanDefinition

public void postProcessMergedBeanDefinition(RootBeanDefinition beanDefinition,
                                            Class beanType,
                                            String beanName)
Description copied from interface: MergedBeanDefinitionPostProcessor
Post-process the given merged bean definition for the specified bean.

Specified by:
postProcessMergedBeanDefinition in interface MergedBeanDefinitionPostProcessor
Parameters:
beanDefinition - the merged bean definition for the bean
beanType - the actual type of the managed bean instance
beanName - the name of the bean

postProcessBeforeInitialization

public Object postProcessBeforeInitialization(Object bean,
                                              String beanName)
                                       throws BeansException
Description copied from interface: BeanPostProcessor
Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

Specified by:
postProcessBeforeInitialization in interface BeanPostProcessor
Parameters:
bean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
Throws:
BeansException - in case of errors
See Also:
InitializingBean.afterPropertiesSet()

postProcessAfterInitialization

public Object postProcessAfterInitialization(Object bean,
                                             String beanName)
                                      throws BeansException
Description copied from interface: BeanPostProcessor
Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

In case of a FactoryBean, this callback will be invoked for both the FactoryBean instance and the objects created by the FactoryBean (as of Spring 2.0). The post-processor can decide whether to apply to either the FactoryBean or created objects or both through corresponding bean instanceof FactoryBean checks.

This callback will also be invoked after a short-circuiting triggered by a InstantiationAwareBeanPostProcessor.postProcessBeforeInstantiation(java.lang.Class, java.lang.String) method, in contrast to all other BeanPostProcessor callbacks.

Specified by:
postProcessAfterInitialization in interface BeanPostProcessor
Parameters:
bean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
Throws:
BeansException - in case of errors
See Also:
InitializingBean.afterPropertiesSet(), FactoryBean

postProcessBeforeDestruction

public void postProcessBeforeDestruction(Object bean,
                                         String beanName)
                                  throws BeansException
Description copied from interface: DestructionAwareBeanPostProcessor
Apply this BeanPostProcessor to the given bean instance before its destruction. Can invoke custom destruction callbacks.

Like DisposableBean's destroy and a custom destroy method, this callback just applies to singleton beans in the factory (including inner beans).

Specified by:
postProcessBeforeDestruction in interface DestructionAwareBeanPostProcessor
Parameters:
bean - the bean instance to be destroyed
beanName - the name of the bean
Throws:
BeansException - in case of errors
See Also:
DisposableBean, AbstractBeanDefinition.setDestroyMethodName(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InjectionMetadata

org.springframework.beans.factory.annotation
Class InjectionMetadata

java.lang.Object
    extended by  org.springframework.beans.factory.annotation.InjectionMetadata

public class InjectionMetadata
extends Object

Internal class for managing injection metadata. Not intended for direct use in applications.

Used by AutowiredAnnotationBeanPostProcessor, CommonAnnotationBeanPostProcessor and PersistenceAnnotationBeanPostProcessor.

Since:
2.5
Author:
Juergen Hoeller

Nested Class Summary
static class InjectionMetadata.InjectedElement
Constructor Summary
InjectionMetadata(Class targetClass, Collection<InjectionMetadata.InjectedElement> elements)
Method Summary
void | checkConfigMembers(RootBeanDefinition beanDefinition)
void | inject(Object target, String beanName, PropertyValues pvs)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

InjectionMetadata

public InjectionMetadata(Class targetClass,
                         Collection<InjectionMetadata.InjectedElement> elements)
Method Detail

checkConfigMembers

public void checkConfigMembers(RootBeanDefinition beanDefinition)

inject

public void inject(Object target,
                   String beanName,
                   PropertyValues pvs)
            throws Throwable
Throws:
Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InjectionMetadata.InjectedElement

org.springframework.beans.factory.annotation
Class InjectionMetadata.InjectedElement

java.lang.Object
    extended by  org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement
Direct Known Subclasses:
CommonAnnotationBeanPostProcessor.LookupElement
Enclosing class:
InjectionMetadata
public abstract static class InjectionMetadata.InjectedElement
extends Object

Field Summary
protected boolean | isField
protected Member | member
protected PropertyDescriptor | pd
protected Boolean | skip
Constructor Summary
protected InjectionMetadata.InjectedElement(Member member, PropertyDescriptor pd)
Method Summary
protected  boolean checkPropertySkipping(PropertyValues pvs)
Checks whether this injector's property needs to be skipped due to an explicit property value having been specified.
protected  void checkResourceType(Class resourceType)
 boolean equals(Object other)
 Member getMember()
protected  Object getResourceToInject(Object target, String requestingBeanName)
Either this or inject(java.lang.Object, java.lang.String, org.springframework.beans.PropertyValues) needs to be overridden.
protected  Class getResourceType()
 int hashCode()
protected  void inject(Object target, String requestingBeanName, PropertyValues pvs)
Either this or getResourceToInject(java.lang.Object, java.lang.String) needs to be overridden.
 String toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail

member

protected final Member member

isField

protected final boolean isField

pd

protected final PropertyDescriptor pd

skip

protected volatile Boolean skip
Constructor Detail

InjectionMetadata.InjectedElement

protected InjectionMetadata.InjectedElement(Member member,
                                            PropertyDescriptor pd)
Method Detail

getMember

public final Member getMember()

getResourceType

protected final Class getResourceType()

checkResourceType

protected final void checkResourceType(Class resourceType)

inject

protected void inject(Object target,
                      String requestingBeanName,
                      PropertyValues pvs)
               throws Throwable
Either this or getResourceToInject(java.lang.Object, java.lang.String) needs to be overridden.

Throws:
Throwable

checkPropertySkipping

protected boolean checkPropertySkipping(PropertyValues pvs)
Checks whether this injector's property needs to be skipped due to an explicit property value having been specified. Also marks the affected property as processed for other processors to ignore it.

getResourceToInject

protected Object getResourceToInject(Object target,
                                     String requestingBeanName)
Either this or inject(java.lang.Object, java.lang.String, org.springframework.beans.PropertyValues) needs to be overridden.

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


QualifierAnnotationAutowireCandidateResolver

org.springframework.beans.factory.annotation
Class QualifierAnnotationAutowireCandidateResolver

java.lang.Object
    extended by  org.springframework.beans.factory.annotation.QualifierAnnotationAutowireCandidateResolver
All Implemented Interfaces:
BeanFactoryAware, AutowireCandidateResolver
public class QualifierAnnotationAutowireCandidateResolver
extends Object
implements AutowireCandidateResolver, BeanFactoryAware

AutowireCandidateResolver implementation that matches bean definition qualifiers against qualifier annotations on the field or parameter to be autowired. Also supports suggested expression values through a value annotation.

Also supports JSR-330's Qualifier annotation, if available.

Since:
2.5
Author:
Mark Fisher, Juergen Hoeller
See Also:
AutowireCandidateQualifier, Qualifier, Value

Constructor Summary
QualifierAnnotationAutowireCandidateResolver()
Create a new QualifierAnnotationAutowireCandidateResolver for Spring's standard Qualifier annotation.
QualifierAnnotationAutowireCandidateResolver(Class<? extends Annotation> qualifierType)
Create a new QualifierAnnotationAutowireCandidateResolver for the given qualifier annotation type.
QualifierAnnotationAutowireCandidateResolver(Set<Class<? extends Annotation>> qualifierTypes)
Create a new QualifierAnnotationAutowireCandidateResolver for the given qualifier annotation types.
Method Summary
void | addQualifierType(Class<? extends Annotation> qualifierType) Register the given type to be used as a qualifier when autowiring.
protected boolean | checkQualifier(BeanDefinitionHolder bdHolder, Annotation annotation, TypeConverter typeConverter) Match the given qualifier annotation against the candidate bean definition.
protected boolean | checkQualifiers(BeanDefinitionHolder bdHolder, Annotation[] annotationsToSearch) Match the given qualifier annotations against the candidate bean definition.
protected Object | findValue(Annotation[] annotationsToSearch) Determine a suggested value from any of the given candidate annotations.
Object | getSuggestedValue(DependencyDescriptor descriptor) Determine whether the given dependency carries a value annotation.
boolean | isAutowireCandidate(BeanDefinitionHolder bdHolder, DependencyDescriptor descriptor) Determine whether the provided bean definition is an autowire candidate.
protected boolean | isQualifier(Class<? extends Annotation> annotationType) Checks whether the given annotation type is a recognized qualifier type.
void | setBeanFactory(BeanFactory beanFactory) Callback that supplies the owning factory to a bean instance.
void | setValueAnnotationType(Class<? extends Annotation> valueAnnotationType) Set the 'value' annotation type, to be used on fields, method parameters and constructor parameters.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

QualifierAnnotationAutowireCandidateResolver

public QualifierAnnotationAutowireCandidateResolver()
Create a new QualifierAnnotationAutowireCandidateResolver for Spring's standard Qualifier annotation.

Also supports JSR-330's Qualifier annotation, if available.

QualifierAnnotationAutowireCandidateResolver

public QualifierAnnotationAutowireCandidateResolver(Class<? extends Annotation> qualifierType)
Create a new QualifierAnnotationAutowireCandidateResolver for the given qualifier annotation type.

Parameters:
qualifierType - the qualifier annotation to look for

QualifierAnnotationAutowireCandidateResolver

public QualifierAnnotationAutowireCandidateResolver(Set<Class<? extends Annotation>> qualifierTypes)
Create a new QualifierAnnotationAutowireCandidateResolver for the given qualifier annotation types.

Parameters:
qualifierTypes - the qualifier annotations to look for
Method Detail

addQualifierType

public void addQualifierType(Class<? extends Annotation> qualifierType)
Register the given type to be used as a qualifier when autowiring.

This identifies qualifier annotations for direct use (on fields, method parameters and constructor parameters) as well as meta annotations that in turn identify actual qualifier annotations.

This implementation only supports annotations as qualifier types. The default is Spring's Qualifier annotation which serves as a qualifier for direct use and also as a meta annotation.

Parameters:
qualifierType - the annotation type to register

setValueAnnotationType

public void setValueAnnotationType(Class<? extends Annotation> valueAnnotationType)
Set the 'value' annotation type, to be used on fields, method parameters and constructor parameters.

The default value annotation type is the Spring-provided Value annotation.

This setter property exists so that developers can provide their own (non-Spring-specific) annotation type to indicate a default value expression for a specific argument.

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
BeanInitializationException

isAutowireCandidate

public boolean isAutowireCandidate(BeanDefinitionHolder bdHolder,
                                   DependencyDescriptor descriptor)
Determine whether the provided bean definition is an autowire candidate.

To be considered a candidate the bean's autowire-candidate attribute must not have been set to 'false'. Also, if an annotation on the field or parameter to be autowired is recognized by this bean factory as a qualifier, the bean must 'match' against the annotation as well as any attributes it may contain. The bean definition must contain the same qualifier or match by meta attributes. A "value" attribute will fallback to match against the bean name or an alias if a qualifier or attribute does not match.

Specified by:
isAutowireCandidate in interface AutowireCandidateResolver
Parameters:
bdHolder - the bean definition including bean name and aliases
descriptor - the descriptor for the target method parameter or field
Returns:
whether the bean definition qualifies as autowire candidate
See Also:
Qualifier

checkQualifiers

protected boolean checkQualifiers(BeanDefinitionHolder bdHolder,
                                  Annotation[] annotationsToSearch)
Match the given qualifier annotations against the candidate bean definition.

isQualifier

protected boolean isQualifier(Class<? extends Annotation> annotationType)
Checks whether the given annotation type is a recognized qualifier type.

checkQualifier

protected boolean checkQualifier(BeanDefinitionHolder bdHolder,
                                 Annotation annotation,
                                 TypeConverter typeConverter)
Match the given qualifier annotation against the candidate bean definition.

getSuggestedValue

public Object getSuggestedValue(DependencyDescriptor descriptor)
Determine whether the given dependency carries a value annotation.

Specified by:
getSuggestedValue in interface AutowireCandidateResolver
Parameters:
descriptor - the descriptor for the target method parameter or field
Returns:
the value suggested (typically an expression String), or null if none found
See Also:
Value

findValue

protected Object findValue(Annotation[] annotationsToSearch)
Determine a suggested value from any of the given candidate annotations.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RequiredAnnotationBeanPostProcessor

org.springframework.beans.factory.annotation
Class RequiredAnnotationBeanPostProcessor

java.lang.Object
    extended by  org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter
        extended by  org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor
All Implemented Interfaces:
BeanFactoryAware, BeanPostProcessor, InstantiationAwareBeanPostProcessor, SmartInstantiationAwareBeanPostProcessor, MergedBeanDefinitionPostProcessor, Ordered, PriorityOrdered
public class RequiredAnnotationBeanPostProcessor
extends InstantiationAwareBeanPostProcessorAdapter
implements MergedBeanDefinitionPostProcessor, PriorityOrdered, BeanFactoryAware

BeanPostProcessor implementation that enforces required JavaBean properties to have been configured. Required bean properties are detected through a Java 5 annotation: by default, Spring's Required annotation.

The motivation for the existence of this BeanPostProcessor is to allow developers to annotate the setter properties of their own classes with an arbitrary JDK 1.5 annotation to indicate that the container must check for the configuration of a dependency injected value. This neatly pushes responsibility for such checking onto the container (where it arguably belongs), and obviates the need (in part) for a developer to code a method that simply checks that all required properties have actually been set.

Please note that an 'init' method may still need to implemented (and may still be desirable), because all that this class does is enforce that a 'required' property has actually been configured with a value. It does not check anything else... In particular, it does not check that a configured value is not null.

Note: A default RequiredAnnotationBeanPostProcessor will be registered by the "context:annotation-config" and "context:component-scan" XML tags. Remove or turn off the default annotation configuration there if you intend to specify a custom RequiredAnnotationBeanPostProcessor bean definition.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
See Also:
setRequiredAnnotationType(java.lang.Class), Required

Field Summary
static String SKIP_REQUIRED_CHECK_ATTRIBUTE
Bean definition attribute that may indicate whether a given bean is supposed to be skipped when performing this post-processor's required property check.
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
RequiredAnnotationBeanPostProcessor()
Method Summary
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
protected Class<? extends Annotation> | getRequiredAnnotationType() Return the 'required' annotation type.
protected boolean | isRequiredProperty(PropertyDescriptor propertyDescriptor) Is the supplied property required to have a value (that is, to be dependency-injected)?
void | postProcessMergedBeanDefinition(RootBeanDefinition beanDefinition, Class beanType, String beanName) Post-process the given merged bean definition for the specified bean.
PropertyValues | postProcessPropertyValues(PropertyValues pvs, PropertyDescriptor[] pds, Object bean, String beanName) Post-process the given property values before the factory applies them to the given bean.
void | setBeanFactory(BeanFactory beanFactory) Callback that supplies the owning factory to a bean instance.
void | setOrder(int order)
void | setRequiredAnnotationType(Class<? extends Annotation> requiredAnnotationType) Set the 'required' annotation type, to be used on bean property setter methods.
protected boolean | shouldSkip(ConfigurableListableBeanFactory beanFactory, String beanName) Check whether the given bean definition is not subject to the annotation-based required property check as performed by this post-processor.
Methods inherited from class org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter
determineCandidateConstructors, getEarlyBeanReference, postProcessAfterInitialization, postProcessAfterInstantiation, postProcessBeforeInitialization, postProcessBeforeInstantiation, predictBeanType
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.config.BeanPostProcessor
postProcessAfterInitialization, postProcessBeforeInitialization

Field Detail

SKIP_REQUIRED_CHECK_ATTRIBUTE

public static final String SKIP_REQUIRED_CHECK_ATTRIBUTE
Bean definition attribute that may indicate whether a given bean is supposed to be skipped when performing this post-processor's required property check.

See Also:
shouldSkip(org.springframework.beans.factory.config.ConfigurableListableBeanFactory, java.lang.String)
Constructor Detail

RequiredAnnotationBeanPostProcessor

public RequiredAnnotationBeanPostProcessor()
Method Detail

setRequiredAnnotationType

public void setRequiredAnnotationType(Class<? extends Annotation> requiredAnnotationType)
Set the 'required' annotation type, to be used on bean property setter methods.

The default required annotation type is the Spring-provided Required annotation.

This setter property exists so that developers can provide their own (non-Spring-specific) annotation type to indicate that a property value is required.

getRequiredAnnotationType

protected Class<? extends Annotation> getRequiredAnnotationType()
Return the 'required' annotation type.

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
BeanInitializationException

setOrder

public void setOrder(int order)

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

postProcessMergedBeanDefinition

public void postProcessMergedBeanDefinition(RootBeanDefinition beanDefinition,
                                            Class beanType,
                                            String beanName)
Description copied from interface: MergedBeanDefinitionPostProcessor
Post-process the given merged bean definition for the specified bean.

Specified by:
postProcessMergedBeanDefinition in interface MergedBeanDefinitionPostProcessor
Parameters:
beanDefinition - the merged bean definition for the bean
beanType - the actual type of the managed bean instance
beanName - the name of the bean

postProcessPropertyValues

public PropertyValues postProcessPropertyValues(PropertyValues pvs,
                                                PropertyDescriptor[] pds,
                                                Object bean,
                                                String beanName)
                                         throws BeansException
Description copied from interface: InstantiationAwareBeanPostProcessor
Post-process the given property values before the factory applies them to the given bean. Allows for checking whether all dependencies have been satisfied, for example based on a "Required" annotation on bean property setters.

Also allows for replacing the property values to apply, typically through creating a new MutablePropertyValues instance based on the original PropertyValues, adding or removing specific values.

Specified by:
postProcessPropertyValues in interface InstantiationAwareBeanPostProcessor
Overrides:
postProcessPropertyValues in class InstantiationAwareBeanPostProcessorAdapter
Parameters:
pvs - the property values that the factory is about to apply (never null)
pds - the relevant property descriptors for the target bean (with ignored dependency types - which the factory handles specifically - already filtered out)
bean - the bean instance created, but whose properties have not yet been set
beanName - the name of the bean
Returns:
the actual property values to apply to to the given bean (can be the passed-in PropertyValues instance), or null to skip property population
Throws:
BeansException - in case of errors
See Also:
MutablePropertyValues

shouldSkip

protected boolean shouldSkip(ConfigurableListableBeanFactory beanFactory,
                             String beanName)
Check whether the given bean definition is not subject to the annotation-based required property check as performed by this post-processor.

The default implementations check for the presence of the SKIP_REQUIRED_CHECK_ATTRIBUTE attribute in the bean definition, if any.

Parameters:
beanFactory - the BeanFactory to check against
beanName - the name of the bean to check against
Returns:
true to skip the bean; false to process it

isRequiredProperty

protected boolean isRequiredProperty(PropertyDescriptor propertyDescriptor)
Is the supplied property required to have a value (that is, to be dependency-injected)?

This implementation looks for the existence of a "required" annotation on the supplied property.

Parameters:
propertyDescriptor - the target PropertyDescriptor (never null)
Returns:
true if the supplied property has been marked as being required; false if not, or if the supplied property does not have a setter method
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Autowire

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

org.springframework.beans.factory.annotation
Enum Autowire

java.lang.Object
    extended by  java.lang.Enum<Autowire>
        extended by  org.springframework.beans.factory.annotation.Autowire
All Implemented Interfaces:
Serializable, Comparable<Autowire>
public enum Autowire
extends Enum<Autowire>

Enumeration determining autowiring status: that is, whether a bean should have its dependencies automatically injected by the Spring container using setter injection. This is a core concept in Spring DI.

Available for use in annotation-based configurations, such as for the AspectJ AnnotationBeanConfigurer aspect.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller
See Also:
Configurable, AutowireCapableBeanFactory

Enum Constant Summary
BY_NAME
Constant that indicates autowiring bean properties by name.
BY_TYPE
Constant that indicates autowiring bean properties by type.
NO
Constant that indicates no autowiring at all.
Method Summary
boolean | isAutowire() Return whether this represents an actual autowiring value.
int | value()
static Autowire | valueOf(String name) Returns the enum constant of this type with the specified name.
static Autowire[] | values() Returns an array containing the constants of this enum type, in the order they are declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

NO

public static final Autowire NO
Constant that indicates no autowiring at all.

BY_NAME

public static final Autowire BY_NAME
Constant that indicates autowiring bean properties by name.

BY_TYPE

public static final Autowire BY_TYPE
Constant that indicates autowiring bean properties by type.

Method Detail

values

public static Autowire[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Autowire c : Autowire.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Autowire valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

value

public int value()

isAutowire

public boolean isAutowire()
Return whether this represents an actual autowiring value.

Returns:
whether actual autowiring was specified (either BY_NAME or BY_TYPE)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


Autowired

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.beans.factory.annotation
Annotation Type Autowired

@Retention(value=RUNTIME)
@Target(value={CONSTRUCTOR,FIELD,METHOD})
public @interface Autowired

Marks a constructor, field, setter method or config method as to be autowired by Spring's dependency injection facilities.

Only one constructor (at max) of any given bean class may carry this annotation, indicating the constructor to autowire when used as a Spring bean. Such a constructor does not have to be public.

Fields are injected right after construction of a bean, before any config methods are invoked. Such a config field does not have to be public.

Config methods may have an arbitrary name and any number of arguments; each of those arguments will be autowired with a matching bean in the Spring container. Bean property setter methods are effectively just a special case of such a general config method. Such config methods do not have to be public.

In the case of multiple argument methods, the 'required' parameter is applicable for all arguments.

In case of a Collection or Map dependency type, the container will autowire all beans matching the declared value type. In case of a Map, the keys must be declared as type String and will be resolved to the corresponding bean names.

Please do consult the javadoc for the AutowiredAnnotationBeanPostProcessor class (which, by default, checks for the presence of this annotation).

Since:
2.5
Author:
Juergen Hoeller, Mark Fisher
See Also:
AutowiredAnnotationBeanPostProcessor

Optional Element Summary
 boolean required
Declares whether the annotated dependency is required.

required

public abstract boolean required
Declares whether the annotated dependency is required.

Defaults to true.

Default:
true
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Configurable

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.beans.factory.annotation
Annotation Type Configurable

@Retention(value=RUNTIME)
@Target(value=TYPE)
@Documented
@Inherited
public @interface Configurable

Marks a class as being eligible for Spring-driven configuration.

Typically used with the AspectJ AnnotationBeanConfigurerAspect.

Since:
2.0
Author:
Rod Johnson, Rob Harrop, Adrian Colyer, Ramnivas Laddad

Optional Element Summary
Autowire | autowire Are dependencies to be injected via autowiring?
boolean | dependencyCheck Is dependency checking to be performed for configured objects?
boolean | preConstruction Are dependencies to be injected prior to the construction of an object?
String | value The name of the bean definition that serves as the configuration template.

value

public abstract String value
The name of the bean definition that serves as the configuration template.

Default:
""

autowire

public abstract Autowire autowire
Are dependencies to be injected via autowiring?

Default:
org.springframework.beans.factory.annotation.Autowire.NO

dependencyCheck

public abstract boolean dependencyCheck
Is dependency checking to be performed for configured objects?

Default:
false

preConstruction

public abstract boolean preConstruction
Are dependencies to be injected prior to the construction of an object?

Default:
false
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Qualifier

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.beans.factory.annotation
Annotation Type Qualifier

@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD,PARAMETER,TYPE,ANNOTATION_TYPE})
@Inherited
@Documented
public @interface Qualifier

This annotation may be used on a field or parameter as a qualifier for candidate beans when autowiring. It may also be used to annotate other custom annotations that can then in turn be used as qualifiers.

Since:
2.5
Author:
Mark Fisher, Juergen Hoeller

Optional Element Summary
 String value

value

public abstract String value
Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Required

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.beans.factory.annotation
Annotation Type Required

@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface Required

Marks a method (typically a JavaBean setter method) as being 'required': that is, the setter method must be configured to be dependency-injected with a value.

Please do consult the javadoc for the RequiredAnnotationBeanPostProcessor class (which, by default, checks for the presence of this annotation).

Since:
2.0
Author:
Rob Harrop
See Also:
RequiredAnnotationBeanPostProcessor

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Value

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

org.springframework.beans.factory.annotation
Annotation Type Value

@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD,PARAMETER})
public @interface Value

Annotation at the field or method/constructor parameter level that indicates a default value expression for the affected argument.

Typically used for expression-driven dependency injection. Also supported for dynamic resolution of handler method parameters, e.g. in Spring MVC.

A common use case is to assign default field values using "#{systemProperties.myProp}" style expressions.

Since:
3.0
Author:
Juergen Hoeller
See Also:
BeanExpressionResolver, AutowireCandidateResolver.getSuggestedValue(org.springframework.beans.factory.config.DependencyDescriptor)

Required Element Summary
 String value
The actual value expression: e.g.

Element Detail

value

public abstract String value
The actual value expression: e.g. "#{systemProperties.myProp}".

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT


org.springframework.beans.factory.aspectj

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.beans.factory.aspectj

Interface Summary
ConfigurableObject Marker interface for domain object that need DI through aspects.


org.springframework.beans.factory.aspectj Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.beans.factory.aspectj

Package Hierarchies:
All Packages

Interface Hierarchy

  • org.springframework.beans.factory.aspectj.ConfigurableObject


ConfigurableObject

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.beans.factory.aspectj
Interface ConfigurableObject

public interface ConfigurableObject

Marker interface for domain object that need DI through aspects.

Since:
2.5
Author:
Ramnivas Laddad

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.beans.factory.config

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.beans.factory.config

SPI interfaces and configuration-related convenience classes for bean factories.

See:
Description

Interface Summary
AutowireCapableBeanFactory | Extension of the BeanFactory interface to be implemented by bean factories that are capable of autowiring, provided that they want to expose this functionality for existing bean instances.
BeanDefinition | A BeanDefinition describes a bean instance, which has property values, constructor argument values, and further information supplied by concrete implementations.
BeanExpressionResolver | Strategy interface for resolving a value through evaluating it as an expression, if applicable.
BeanFactoryPostProcessor | Allows for custom modification of an application context's bean definitions, adapting the bean property values of the context's underlying bean factory.
BeanPostProcessor | Factory hook that allows for custom modification of new bean instances, e.g.
BeanReference | Interface that exposes a reference to a bean name in an abstract fashion.
ConfigurableBeanFactory | Configuration interface to be implemented by most bean factories.
ConfigurableListableBeanFactory | Configuration interface to be implemented by most listable bean factories.
DestructionAwareBeanPostProcessor | Subinterface of BeanPostProcessor that adds a before-destruction callback.
InstantiationAwareBeanPostProcessor | Subinterface of BeanPostProcessor that adds a before-instantiation callback, and a callback after instantiation but before explicit properties are set or autowiring occurs.
Scope | Strategy interface used by a ConfigurableBeanFactory, representing a target scope to hold bean instances in.
SingletonBeanRegistry | Interface that defines a registry for shared bean instances.
SmartInstantiationAwareBeanPostProcessor | Extension of the InstantiationAwareBeanPostProcessor interface, adding a callback for predicting the eventual type of a processed bean.

Class Summary
AbstractFactoryBean<T> | Simple template superclass for FactoryBean implementations that creates a singleton or a prototype object, depending on a flag.
BeanDefinitionHolder | Holder for a BeanDefinition with name and aliases.
BeanDefinitionVisitor | Visitor class for traversing BeanDefinition objects, in particular the property values and constructor argument values contained in them, resolving bean metadata values.
BeanExpressionContext | Context object for evaluating an expression within a bean definition.
BeanReferenceFactoryBean | FactoryBean that exposes an arbitrary target bean under a different name.
CommonsLogFactoryBean | Factory bean for commons-logging Log instances.
ConstructorArgumentValues | Holder for constructor argument values, typically as part of a bean definition.
ConstructorArgumentValues.ValueHolder | Holder for a constructor argument value, with an optional type attribute indicating the target type of the actual constructor argument.
CustomEditorConfigurer | BeanFactoryPostProcessor implementation that allows for convenient registration of custom property editors.
CustomScopeConfigurer | Simple BeanFactoryPostProcessor implementation that registers custom Scope(s) with the containing ConfigurableBeanFactory.
DependencyDescriptor | Descriptor for a specific dependency that is about to be injected.
FieldRetrievingFactoryBean | FactoryBean which retrieves a static or non-static field value.
InstantiationAwareBeanPostProcessorAdapter | Adapter that implements all methods on SmartInstantiationAwareBeanPostProcessor as no-ops, which will not change normal processing of each bean instantiated by the container.
ListFactoryBean | Simple factory for shared List instances.
MapFactoryBean | Simple factory for shared Map instances.
MethodInvokingFactoryBean | FactoryBean which returns a value which is the result of a static or instance method invocation.
ObjectFactoryCreatingFactoryBean | A FactoryBean implementation that returns a value which is an ObjectFactory that in turn returns a bean sourced from a BeanFactory.
PreferencesPlaceholderConfigurer | Subclass of PropertyPlaceholderConfigurer that supports JDK 1.4's Preferences API (java.util.prefs).
PropertiesFactoryBean | Allows for making a properties file from a classpath location available as Properties instance in a bean factory.
PropertyOverrideConfigurer | Property resource configurer that overrides bean property values in an application context definition.
PropertyPathFactoryBean | FactoryBean that evaluates a property path on a given target object.
PropertyPlaceholderConfigurer | A property resource configurer that resolves placeholders in bean property values of context definitions.
PropertyResourceConfigurer | Allows for configuration of individual bean property values from a property resource, i.e.
ProviderCreatingFactoryBean | A FactoryBean implementation that returns a value which is a JSR-330 Provider that in turn returns a bean sourced from a BeanFactory.
RuntimeBeanNameReference | Immutable placeholder class used for a property value object when it's a reference to another bean name in the factory, to be resolved at runtime.
RuntimeBeanReference | Immutable placeholder class used for a property value object when it's a reference to another bean in the factory, to be resolved at runtime.
ServiceLocatorFactoryBean | A FactoryBean implementation that takes an interface which must have one or more methods with the signatures MyType xxx() or MyType xxx(MyIdType id) (typically, MyService getService() or MyService getService(String id)) and creates a dynamic proxy which implements that interface, delegating to an underlying BeanFactory.
SetFactoryBean | Simple factory for shared Set instances.
TypedStringValue | Holder for a typed String value.

Package org.springframework.beans.factory.config Description

SPI interfaces and configuration-related convenience classes for bean factories.


org.springframework.beans.factory.config Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.beans.factory.config

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.beans.factory.config.AbstractFactoryBean<T> (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
      • org.springframework.beans.factory.config.ListFactoryBean
      • org.springframework.beans.factory.config.MapFactoryBean
      • org.springframework.beans.factory.config.ObjectFactoryCreatingFactoryBean
      • org.springframework.beans.factory.config.ProviderCreatingFactoryBean
      • org.springframework.beans.factory.config.SetFactoryBean
    • org.springframework.beans.factory.config.BeanDefinitionHolder (implements org.springframework.beans.BeanMetadataElement)
    • org.springframework.beans.factory.config.BeanDefinitionVisitor
    • org.springframework.beans.factory.config.BeanExpressionContext
    • org.springframework.beans.factory.config.BeanReferenceFactoryBean (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.SmartFactoryBean<T>)
    • org.springframework.beans.factory.config.CommonsLogFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.beans.factory.config.ConstructorArgumentValues
    • org.springframework.beans.factory.config.ConstructorArgumentValues.ValueHolder (implements org.springframework.beans.BeanMetadataElement)
    • org.springframework.beans.factory.config.CustomEditorConfigurer (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.core.Ordered)
    • org.springframework.beans.factory.config.CustomScopeConfigurer (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.core.Ordered)
    • org.springframework.beans.factory.config.DependencyDescriptor (implements java.io.Serializable)
    • org.springframework.beans.factory.config.FieldRetrievingFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter (implements org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor)
    • org.springframework.util.MethodInvoker
      • org.springframework.beans.support.ArgumentConvertingMethodInvoker
        • org.springframework.beans.factory.config.MethodInvokingFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.core.io.support.PropertiesLoaderSupport
      • org.springframework.beans.factory.config.PropertiesFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
      • org.springframework.beans.factory.config.PropertyResourceConfigurer (implements org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.core.PriorityOrdered)
        • org.springframework.beans.factory.config.PropertyOverrideConfigurer
        • org.springframework.beans.factory.config.PropertyPlaceholderConfigurer (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware)
          • org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer (implements org.springframework.beans.factory.InitializingBean)
    • org.springframework.beans.factory.config.PropertyPathFactoryBean (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.FactoryBean<T>)
    • org.springframework.beans.factory.config.RuntimeBeanNameReference (implements org.springframework.beans.factory.config.BeanReference)
    • org.springframework.beans.factory.config.RuntimeBeanReference (implements org.springframework.beans.factory.config.BeanReference)
    • org.springframework.beans.factory.config.ServiceLocatorFactoryBean (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.beans.factory.config.TypedStringValue (implements org.springframework.beans.BeanMetadataElement)

Interface Hierarchy

  • org.springframework.core.AttributeAccessor
    • org.springframework.beans.factory.config.BeanDefinition (also extends org.springframework.beans.BeanMetadataElement)
  • org.springframework.beans.factory.config.BeanExpressionResolver
  • org.springframework.beans.factory.BeanFactory
    • org.springframework.beans.factory.config.AutowireCapableBeanFactory
      • org.springframework.beans.factory.config.ConfigurableListableBeanFactory (also extends org.springframework.beans.factory.config.ConfigurableBeanFactory, org.springframework.beans.factory.ListableBeanFactory)
    • org.springframework.beans.factory.HierarchicalBeanFactory
      • org.springframework.beans.factory.config.ConfigurableBeanFactory (also extends org.springframework.beans.factory.config.SingletonBeanRegistry)
        • org.springframework.beans.factory.config.ConfigurableListableBeanFactory (also extends org.springframework.beans.factory.config.AutowireCapableBeanFactory, org.springframework.beans.factory.ListableBeanFactory)
    • org.springframework.beans.factory.ListableBeanFactory
      • org.springframework.beans.factory.config.ConfigurableListableBeanFactory (also extends org.springframework.beans.factory.config.AutowireCapableBeanFactory, org.springframework.beans.factory.config.ConfigurableBeanFactory)
  • org.springframework.beans.factory.config.BeanFactoryPostProcessor
  • org.springframework.beans.BeanMetadataElement
    • org.springframework.beans.factory.config.BeanDefinition (also extends org.springframework.core.AttributeAccessor)
    • org.springframework.beans.factory.config.BeanReference
  • org.springframework.beans.factory.config.BeanPostProcessor
    • org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor
    • org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor
      • org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor
  • org.springframework.beans.factory.config.Scope
  • org.springframework.beans.factory.config.SingletonBeanRegistry
    • org.springframework.beans.factory.config.ConfigurableBeanFactory (also extends org.springframework.beans.factory.HierarchicalBeanFactory)
      • org.springframework.beans.factory.config.ConfigurableListableBeanFactory (also extends org.springframework.beans.factory.config.AutowireCapableBeanFactory, org.springframework.beans.factory.ListableBeanFactory)


AutowireCapableBeanFactory

org.springframework.beans.factory.config
Interface AutowireCapableBeanFactory

All Superinterfaces:
BeanFactory
All Known Subinterfaces:
ConfigurableListableBeanFactory
All Known Implementing Classes:
AbstractAutowireCapableBeanFactory, DefaultListableBeanFactory, XmlBeanFactory
public interface AutowireCapableBeanFactory
extends BeanFactory

Extension of the BeanFactory interface to be implemented by bean factories that are capable of autowiring, provided that they want to expose this functionality for existing bean instances.

This subinterface of BeanFactory is not meant to be used in normal application code: stick to BeanFactory or ListableBeanFactory for typical use cases.

Integration code for other frameworks can leverage this interface to wire and populate existing bean instances that Spring does not control the lifecycle of. This is particularly useful for WebWork Actions and Tapestry Page objects, for example.

Note that this interface is not implemented by ApplicationContext facades, as it is hardly ever used by application code. That said, it is available from an application context too, accessible through ApplicationContext's ApplicationContext.getAutowireCapableBeanFactory() method.

You may also implement the BeanFactoryAware interface, which exposes the internal BeanFactory even when running in an ApplicationContext, to get access to an AutowireCapableBeanFactory: simply cast the passed-in BeanFactory to AutowireCapableBeanFactory.

Since:
04.12.2003
Author:
Juergen Hoeller
See Also:
BeanFactoryAware, ConfigurableListableBeanFactory, ApplicationContext.getAutowireCapableBeanFactory()

Field Summary
static int | AUTOWIRE_AUTODETECT Deprecated. as of Spring 3.0: If you are using mixed autowiring strategies, prefer annotation-based autowiring for clearer demarcation of autowiring needs.
static int | AUTOWIRE_BY_NAME Constant that indicates autowiring bean properties by name (applying to all bean property setters).
static int | AUTOWIRE_BY_TYPE Constant that indicates autowiring bean properties by type (applying to all bean property setters).
static int | AUTOWIRE_CONSTRUCTOR Constant that indicates autowiring the greediest constructor that can be satisfied (involves resolving the appropriate constructor).
static int | AUTOWIRE_NO Constant that indicates no externally defined autowiring.
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Method Summary
 Object applyBeanPostProcessorsAfterInitialization(Object existingBean, String beanName)
Apply BeanPostProcessors to the given existing bean instance, invoking their postProcessAfterInitialization methods.
 Object applyBeanPostProcessorsBeforeInitialization(Object existingBean, String beanName)
Apply BeanPostProcessors to the given existing bean instance, invoking their postProcessBeforeInitialization methods.
 void applyBeanPropertyValues(Object existingBean, String beanName)
Apply the property values of the bean definition with the given name to the given bean instance.
 Object autowire(Class beanClass, int autowireMode, boolean dependencyCheck)
Instantiate a new bean instance of the given class with the specified autowire strategy.
 void autowireBean(Object existingBean)
Populate the given bean instance through applying after-instantiation callbacks and bean property post-processing (e.g.
 void autowireBeanProperties(Object existingBean, int autowireMode, boolean dependencyCheck)
Autowire the bean properties of the given bean instance by name or type.
 Object configureBean(Object existingBean, String beanName)
Configure the given raw bean: autowiring bean properties, applying bean property values, applying factory callbacks such as setBeanName and setBeanFactory, and also applying all bean post processors (including ones which might wrap the given raw bean).
<T> T
createBean(Class<T> beanClass)
Fully create a new bean instance of the given class.
 Object createBean(Class beanClass, int autowireMode, boolean dependencyCheck)
Fully create a new bean instance of the given class with the specified autowire strategy.
 Object initializeBean(Object existingBean, String beanName)
Initialize the given raw bean, applying factory callbacks such as setBeanName and setBeanFactory, also applying all bean post processors (including ones which might wrap the given raw bean).
 Object resolveDependency(DependencyDescriptor descriptor, String beanName)
Resolve the specified dependency against the beans defined in this factory.
 Object resolveDependency(DependencyDescriptor descriptor, String beanName, Set<String> autowiredBeanNames, TypeConverter typeConverter)
Resolve the specified dependency against the beans defined in this factory.
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getBean, getBean, getType, isPrototype, isSingleton, isTypeMatch

Field Detail

AUTOWIRE_NO

static final int AUTOWIRE_NO
Constant that indicates no externally defined autowiring. Note that BeanFactoryAware etc and annotation-driven injection will still be applied.

See Also:
createBean(java.lang.Class),
autowire(java.lang.Class, int, boolean),
autowireBeanProperties(java.lang.Object, int, boolean),
Constant Field Values

AUTOWIRE_BY_NAME

static final int AUTOWIRE_BY_NAME
Constant that indicates autowiring bean properties by name (applying to all bean property setters).

See Also:
createBean(java.lang.Class),
autowire(java.lang.Class, int, boolean),
autowireBeanProperties(java.lang.Object, int, boolean),
Constant Field Values

AUTOWIRE_BY_TYPE

static final int AUTOWIRE_BY_TYPE
Constant that indicates autowiring bean properties by type (applying to all bean property setters).

See Also:
createBean(java.lang.Class),
autowire(java.lang.Class, int, boolean),
autowireBeanProperties(java.lang.Object, int, boolean),
Constant Field Values

AUTOWIRE_CONSTRUCTOR

static final int AUTOWIRE_CONSTRUCTOR
Constant that indicates autowiring the greediest constructor that can be satisfied (involves resolving the appropriate constructor).

See Also:
createBean(java.lang.Class), autowire(java.lang.Class, int, boolean), Constant Field Values

AUTOWIRE_AUTODETECT

@Deprecated
static final int AUTOWIRE_AUTODETECT
Deprecated. as of Spring 3.0: If you are using mixed autowiring strategies, prefer annotation-based autowiring for clearer demarcation of autowiring needs.
Constant that indicates determining an appropriate autowire strategy through introspection of the bean class.

See Also:
createBean(java.lang.Class), autowire(java.lang.Class, int, boolean), Constant Field Values
Method Detail

createBean

<T> T createBean(Class<T> beanClass)
             throws BeansException
Fully create a new bean instance of the given class.

Performs full initialization of the bean, including all applicable BeanPostProcessors.

Note: This is intended for creating a fresh instance, populating annotated fields and methods as well as applying all standard bean initialiation callbacks. It does not imply traditional by-name or by-type autowiring of properties; use createBean(Class, int, boolean) for that purposes.

Parameters:
beanClass - the class of the bean to create
Returns:
the new bean instance
Throws:
BeansException - if instantiation or wiring failed

autowireBean

void autowireBean(Object existingBean)
                  throws BeansException
Populate the given bean instance through applying after-instantiation callbacks and bean property post-processing (e.g. for annotation-driven injection).

Note: This is essentially intended for (re-)populating annotated fields and methods, either for new instances or for deserialized instances. It does not imply traditional by-name or by-type autowiring of properties; use autowireBeanProperties(java.lang.Object, int, boolean) for that purposes.

Parameters:
existingBean - the existing bean instance
Throws:
BeansException - if wiring failed

configureBean

Object configureBean(Object existingBean,
                     String beanName)
                     throws BeansException
Configure the given raw bean: autowiring bean properties, applying bean property values, applying factory callbacks such as setBeanName and setBeanFactory, and also applying all bean post processors (including ones which might wrap the given raw bean).

This is effectively a superset of what initializeBean(java.lang.Object, java.lang.String) provides, fully applying the configuration specified by the corresponding bean definition. Note: This method requires a bean definition for the given name!

Parameters:
existingBean - the existing bean instance
beanName - the name of the bean, to be passed to it if necessary (a bean definition of that name has to be available)
Returns:
the bean instance to use, either the original or a wrapped one
Throws:
NoSuchBeanDefinitionException - if there is no bean definition with the given name
BeansException - if the initialization failed
See Also:
initializeBean(java.lang.Object, java.lang.String)

resolveDependency

Object resolveDependency(DependencyDescriptor descriptor,
                         String beanName)
                         throws BeansException
Resolve the specified dependency against the beans defined in this factory.

Parameters:
descriptor - the descriptor for the dependency
beanName - the name of the bean which declares the present dependency
Returns:
the resolved object, or null if none found
Throws:
BeansException - in dependency resolution failed

createBean

Object createBean(Class beanClass,
                  int autowireMode,
                  boolean dependencyCheck)
                  throws BeansException
Fully create a new bean instance of the given class with the specified autowire strategy. All constants defined in this interface are supported here.

Performs full initialization of the bean, including all applicable BeanPostProcessors. This is effectively a superset of what autowire(java.lang.Class, int, boolean) provides, adding initializeBean(java.lang.Object, java.lang.String) behavior.

Parameters:
beanClass - the class of the bean to create
autowireMode - by name or type, using the constants in this interface
dependencyCheck - whether to perform a dependency check for objects (not applicable to autowiring a constructor, thus ignored there)
Returns:
the new bean instance
Throws:
BeansException - if instantiation or wiring failed
See Also:
AUTOWIRE_NO, AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_CONSTRUCTOR

autowire

Object autowire(Class beanClass,
                int autowireMode,
                boolean dependencyCheck)
                throws BeansException
Instantiate a new bean instance of the given class with the specified autowire strategy. All constants defined in this interface are supported here. Can also be invoked with AUTOWIRE_NO in order to just apply before-instantiation callbacks (e.g. for annotation-driven injection).

Does not apply standard BeanPostProcessors callbacks or perform any further initialization of the bean. This interface offers distinct, fine-grained operations for those purposes, for example initializeBean(java.lang.Object, java.lang.String). However, InstantiationAwareBeanPostProcessor callbacks are applied, if applicable to the construction of the instance.

Parameters:
beanClass - the class of the bean to instantiate
autowireMode - by name or type, using the constants in this interface
dependencyCheck - whether to perform a dependency check for object references in the bean instance (not applicable to autowiring a constructor, thus ignored there)
Returns:
the new bean instance
Throws:
BeansException - if instantiation or wiring failed
See Also:
AUTOWIRE_NO, AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_CONSTRUCTOR, AUTOWIRE_AUTODETECT, initializeBean(java.lang.Object, java.lang.String), applyBeanPostProcessorsBeforeInitialization(java.lang.Object, java.lang.String), applyBeanPostProcessorsAfterInitialization(java.lang.Object, java.lang.String)

autowireBeanProperties

void autowireBeanProperties(Object existingBean,
                            int autowireMode,
                            boolean dependencyCheck)
                            throws BeansException
Autowire the bean properties of the given bean instance by name or type. Can also be invoked with AUTOWIRE_NO in order to just apply after-instantiation callbacks (e.g. for annotation-driven injection).

Does not apply standard BeanPostProcessors callbacks or perform any further initialization of the bean. This interface offers distinct, fine-grained operations for those purposes, for example initializeBean(java.lang.Object, java.lang.String). However, InstantiationAwareBeanPostProcessor callbacks are applied, if applicable to the configuration of the instance.

Parameters:
existingBean - the existing bean instance
autowireMode - by name or type, using the constants in this interface
dependencyCheck - whether to perform a dependency check for object references in the bean instance
Throws:
BeansException - if wiring failed
See Also:
AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_NO

applyBeanPropertyValues

void applyBeanPropertyValues(Object existingBean,
                             String beanName)
                             throws BeansException
Apply the property values of the bean definition with the given name to the given bean instance. The bean definition can either define a fully self-contained bean, reusing its property values, or just property values meant to be used for existing bean instances.

This method does not autowire bean properties; it just applies explicitly defined property values. Use the autowireBeanProperties(java.lang.Object, int, boolean) method to autowire an existing bean instance. Note: This method requires a bean definition for the given name!

Does not apply standard BeanPostProcessors callbacks or perform any further initialization of the bean. This interface offers distinct, fine-grained operations for those purposes, for example initializeBean(java.lang.Object, java.lang.String). However, InstantiationAwareBeanPostProcessor callbacks are applied, if applicable to the configuration of the instance.

Parameters:
existingBean - the existing bean instance
beanName - the name of the bean definition in the bean factory (a bean definition of that name has to be available)
Throws:
NoSuchBeanDefinitionException - if there is no bean definition with the given name
BeansException - if applying the property values failed
See Also:
autowireBeanProperties(java.lang.Object, int, boolean)

initializeBean

Object initializeBean(Object existingBean,
                      String beanName)
                      throws BeansException
Initialize the given raw bean, applying factory callbacks such as setBeanName and setBeanFactory, also applying all bean post processors (including ones which might wrap the given raw bean).

Note that no bean definition of the given name has to exist in the bean factory. The passed-in bean name will simply be used for callbacks but not checked against the registered bean definitions.

Parameters:
existingBean - the existing bean instance
beanName - the name of the bean, to be passed to it if necessary (only passed to BeanPostProcessors)
Returns:
the bean instance to use, either the original or a wrapped one
Throws:
BeansException - if the initialization failed

applyBeanPostProcessorsBeforeInitialization

Object applyBeanPostProcessorsBeforeInitialization(Object existingBean,
                                                   String beanName)
                                                   throws BeansException
Apply BeanPostProcessors to the given existing bean instance, invoking their postProcessBeforeInitialization methods. The returned bean instance may be a wrapper around the original.

Parameters:
existingBean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one
Throws:
BeansException - if any post-processing failed
See Also:
BeanPostProcessor.postProcessBeforeInitialization(java.lang.Object, java.lang.String)

applyBeanPostProcessorsAfterInitialization

Object applyBeanPostProcessorsAfterInitialization(Object existingBean,
                                                  String beanName)
                                                  throws BeansException
Apply BeanPostProcessors to the given existing bean instance, invoking their postProcessAfterInitialization methods. The returned bean instance may be a wrapper around the original.

Parameters:
existingBean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one
Throws:
BeansException - if any post-processing failed
See Also:
BeanPostProcessor.postProcessAfterInitialization(java.lang.Object, java.lang.String)

resolveDependency

Object resolveDependency(DependencyDescriptor descriptor,
                         String beanName,
                         Set<String> autowiredBeanNames,
                         TypeConverter typeConverter)
                         throws BeansException
Resolve the specified dependency against the beans defined in this factory.

Parameters:
descriptor - the descriptor for the dependency
beanName - the name of the bean which declares the present dependency
autowiredBeanNames - a Set that all names of autowired beans (used for resolving the present dependency) are supposed to be added to
typeConverter - the TypeConverter to use for populating arrays and collections
Returns:
the resolved object, or null if none found
Throws:
BeansException - in dependency resolution failed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanDefinition

org.springframework.beans.factory.config
Interface BeanDefinition

All Superinterfaces:
AttributeAccessor, BeanMetadataElement
All Known Subinterfaces:
AnnotatedBeanDefinition
All Known Implementing Classes:
AbstractBeanDefinition, AnnotatedGenericBeanDefinition, ChildBeanDefinition, GenericBeanDefinition, RootBeanDefinition, ScannedGenericBeanDefinition
public interface BeanDefinition
extends AttributeAccessor, BeanMetadataElement

A BeanDefinition describes a bean instance, which has property values, constructor argument values, and further information supplied by concrete implementations.

This is just a minimal interface: The main intention is to allow a BeanFactoryPostProcessor such as PropertyPlaceholderConfigurer to introspect and modify property values and other bean metadata.

Since:
19.03.2004
Author:
Juergen Hoeller, Rob Harrop
See Also:
ConfigurableListableBeanFactory.getBeanDefinition(java.lang.String), RootBeanDefinition, ChildBeanDefinition

Field Summary
static int | ROLE_APPLICATION Role hint indicating that a BeanDefinition is a major part of the application.
static int | ROLE_INFRASTRUCTURE Role hint indicating that a BeanDefinition is providing an entirely background role and has no relevance to the end-user.
static int | ROLE_SUPPORT Role hint indicating that a BeanDefinition is a supporting part of some larger configuration, typically an outer ComponentDefinition.
static String | SCOPE_PROTOTYPE Scope identifier for the standard prototype scope: "prototype".
static String | SCOPE_SINGLETON Scope identifier for the standard singleton scope: "singleton".
Method Summary
String | getBeanClassName() Return the current bean class name of this bean definition.
ConstructorArgumentValues | getConstructorArgumentValues() Return the constructor argument values for this bean.
String[] | getDependsOn() Return the bean names that this bean depends on.
String | getDescription() Return a human-readable description of this bean definition.
String | getFactoryBeanName() Return the factory bean name, if any.
String | getFactoryMethodName() Return a factory method, if any.
BeanDefinition | getOriginatingBeanDefinition() Return the originating BeanDefinition, or null if none.
String | getParentName() Return the name of the parent definition of this bean definition, if any.
MutablePropertyValues | getPropertyValues() Return the property values to be applied to a new instance of the bean.
String | getResourceDescription() Return a description of the resource that this bean definition came from (for the purpose of showing context in case of errors).
int | getRole() Get the role hint for this BeanDefinition.
String | getScope() Return the name of the current target scope for this bean, or null if not known yet.
boolean | isAbstract() Return whether this bean is "abstract", that is, not meant to be instantiated.
boolean | isAutowireCandidate() Return whether this bean is a candidate for getting autowired into some other bean.
boolean | isLazyInit() Return whether this bean should be lazily initialized, i.e.
boolean | isPrimary() Return whether this bean is a primary autowire candidate.
boolean | isPrototype() Return whether this a Prototype, with an independent instance returned for each call.
boolean | isSingleton() Return whether this a Singleton, with a single, shared instance returned on all calls.
void | setAutowireCandidate(boolean autowireCandidate) Set whether this bean is a candidate for getting autowired into some other bean.
void | setBeanClassName(String beanClassName) Override the bean class name of this bean definition.
void | setDependsOn(String[] dependsOn) Set the names of the beans that this bean depends on being initialized.
void | setFactoryBeanName(String factoryBeanName) Specify the factory bean to use, if any.
void | setFactoryMethodName(String factoryMethodName) Specify a factory method, if any.
void | setLazyInit(boolean lazyInit) Set whether this bean should be lazily initialized.
void | setParentName(String parentName) Set the name of the parent definition of this bean definition, if any.
void | setPrimary(boolean primary) Set whether this bean is a primary autowire candidate.
void | setScope(String scope) Override the target scope of this bean, specifying a new scope name.
Methods inherited from interface org.springframework.core.AttributeAccessor
attributeNames, getAttribute, hasAttribute, removeAttribute, setAttribute
Methods inherited from interface org.springframework.beans.BeanMetadataElement
getSource

Field Detail

SCOPE_SINGLETON

static final String SCOPE_SINGLETON
Scope identifier for the standard singleton scope: "singleton".

Note that extended bean factories might support further scopes.

See Also:
setScope(java.lang.String), Constant Field Values

SCOPE_PROTOTYPE

static final String SCOPE_PROTOTYPE
Scope identifier for the standard prototype scope: "prototype".

Note that extended bean factories might support further scopes.

See Also:
setScope(java.lang.String), Constant Field Values

ROLE_APPLICATION

static final int ROLE_APPLICATION
Role hint indicating that a BeanDefinition is a major part of the application. Typically corresponds to a user-defined bean.

See Also:
Constant Field Values

ROLE_SUPPORT

static final int ROLE_SUPPORT
Role hint indicating that a BeanDefinition is a supporting part of some larger configuration, typically an outer ComponentDefinition. SUPPORT beans are considered important enough to be aware of when looking more closely at a particular ComponentDefinition, but not when looking at the overall configuration of an application.

See Also:
Constant Field Values

ROLE_INFRASTRUCTURE

static final int ROLE_INFRASTRUCTURE
Role hint indicating that a BeanDefinition is providing an entirely background role and has no relevance to the end-user. This hint is used when registering beans that are completely part of the internal workings of a ComponentDefinition.

See Also:
Constant Field Values
Method Detail

getParentName

String getParentName()
Return the name of the parent definition of this bean definition, if any.

setParentName

void setParentName(String parentName)
Set the name of the parent definition of this bean definition, if any.

getBeanClassName

String getBeanClassName()
Return the current bean class name of this bean definition.

Note that this does not have to be the actual class name used at runtime, in case of a child definition overriding/inheriting the class name from its parent. Hence, do not consider this to be the definitive bean type at runtime but rather only use it for parsing purposes at the individual bean definition level.

setBeanClassName

void setBeanClassName(String beanClassName)
Override the bean class name of this bean definition.

The class name can be modified during bean factory post-processing, typically replacing the original class name with a parsed variant of it.

getFactoryBeanName

String getFactoryBeanName()
Return the factory bean name, if any.

setFactoryBeanName

void setFactoryBeanName(String factoryBeanName)
Specify the factory bean to use, if any.

getFactoryMethodName

String getFactoryMethodName()
Return a factory method, if any.

setFactoryMethodName

void setFactoryMethodName(String factoryMethodName)
Specify a factory method, if any. This method will be invoked with constructor arguments, or with no arguments if none are specified. The method will be invoked on the specifed factory bean, if any, or as static method on the local bean class else.

Parameters:
factoryMethodName - static factory method name, or null if normal constructor creation should be used
See Also:
getBeanClassName()

getScope

String getScope()
Return the name of the current target scope for this bean, or null if not known yet.

setScope

void setScope(String scope)
Override the target scope of this bean, specifying a new scope name.

See Also:
SCOPE_SINGLETON, SCOPE_PROTOTYPE

isLazyInit

boolean isLazyInit()
Return whether this bean should be lazily initialized, i.e. not eagerly instantiated on startup. Only applicable to a singleton bean.

setLazyInit

void setLazyInit(boolean lazyInit)
Set whether this bean should be lazily initialized.

If false, the bean will get instantiated on startup by bean factories that perform eager initialization of singletons.

getDependsOn

String[] getDependsOn()
Return the bean names that this bean depends on.

setDependsOn

void setDependsOn(String[] dependsOn)
Set the names of the beans that this bean depends on being initialized. The bean factory will guarantee that these beans get initialized first.

isAutowireCandidate

boolean isAutowireCandidate()
Return whether this bean is a candidate for getting autowired into some other bean.

setAutowireCandidate

void setAutowireCandidate(boolean autowireCandidate)
Set whether this bean is a candidate for getting autowired into some other bean.

isPrimary

boolean isPrimary()
Return whether this bean is a primary autowire candidate. If this value is true for exactly one bean among multiple matching candidates, it will serve as a tie-breaker.

setPrimary

void setPrimary(boolean primary)
Set whether this bean is a primary autowire candidate.

If this value is true for exactly one bean among multiple matching candidates, it will serve as a tie-breaker.

getConstructorArgumentValues

ConstructorArgumentValues getConstructorArgumentValues()
Return the constructor argument values for this bean.

The returned instance can be modified during bean factory post-processing.

Returns:
the ConstructorArgumentValues object (never null)

getPropertyValues

MutablePropertyValues getPropertyValues()
Return the property values to be applied to a new instance of the bean.

The returned instance can be modified during bean factory post-processing.

Returns:
the MutablePropertyValues object (never null)

isSingleton

boolean isSingleton()
Return whether this a Singleton, with a single, shared instance returned on all calls.

See Also:
SCOPE_SINGLETON

isPrototype

boolean isPrototype()
Return whether this a Prototype, with an independent instance returned for each call.

See Also:
SCOPE_PROTOTYPE

isAbstract

boolean isAbstract()
Return whether this bean is "abstract", that is, not meant to be instantiated.

getRole

int getRole()
Get the role hint for this BeanDefinition. The role hint provides tools with an indication of the importance of a particular BeanDefinition.

See Also:
ROLE_APPLICATION, ROLE_INFRASTRUCTURE, ROLE_SUPPORT

getDescription

String getDescription()
Return a human-readable description of this bean definition.

getResourceDescription

String getResourceDescription()
Return a description of the resource that this bean definition came from (for the purpose of showing context in case of errors).

getOriginatingBeanDefinition

BeanDefinition getOriginatingBeanDefinition()
Return the originating BeanDefinition, or null if none. Allows for retrieving the decorated bean definition, if any.

Note that this method returns the immediate originator. Iterate through the originator chain to find the original BeanDefinition as defined by the user.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanExpressionResolver

org.springframework.beans.factory.config
Interface BeanExpressionResolver

All Known Implementing Classes:
StandardBeanExpressionResolver
public interface BeanExpressionResolver

Strategy interface for resolving a value through evaluating it as an expression, if applicable.

A raw BeanFactory does not contain a default implementation of this strategy. However, ApplicationContext implementations will provide expression support out of the box.

Since:
3.0
Author:
Juergen Hoeller

Method Summary
 Object evaluate(String value, BeanExpressionContext evalContext)
Evaluate the given value as an expression, if applicable; return the value as-is otherwise.

Method Detail

evaluate

Object evaluate(String value,
                BeanExpressionContext evalContext)
                throws BeansException
Evaluate the given value as an expression, if applicable; return the value as-is otherwise.

Parameters:
value - the value to check
evalContext - the evaluation context
Returns:
the resolved value (potentially the given value as-is)
Throws:
BeansException - if evaluation failed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanFactoryPostProcessor

org.springframework.beans.factory.config
Interface BeanFactoryPostProcessor

All Known Subinterfaces:
BeanDefinitionRegistryPostProcessor
All Known Implementing Classes:
AspectJWeavingEnabler, ConfigurationClassPostProcessor, CustomAutowireConfigurer, CustomEditorConfigurer, CustomScopeConfigurer, PreferencesPlaceholderConfigurer, PropertyOverrideConfigurer, PropertyPlaceholderConfigurer, PropertyResourceConfigurer, ServletContextPropertyPlaceholderConfigurer
public interface BeanFactoryPostProcessor

Allows for custom modification of an application context's bean definitions, adapting the bean property values of the context's underlying bean factory.

Application contexts can auto-detect BeanFactoryPostProcessor beans in their bean definitions and apply them before any other beans get created.

Useful for custom config files targeted at system administrators that override bean properties configured in the application context.

See PropertyResourceConfigurer and its concrete implementations for out-of-the-box solutions that address such configuration needs.

Since:
06.07.2003
Author:
Juergen Hoeller
See Also:
BeanPostProcessor, PropertyResourceConfigurer

Method Summary
 void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
Modify the application context's internal bean factory after its standard initialization.

Method Detail

postProcessBeanFactory

void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
                            throws BeansException
Modify the application context's internal bean factory after its standard initialization. All bean definitions will have been loaded, but no beans will have been instantiated yet. This allows for overriding or adding properties even to eager-initializing beans.

Parameters:
beanFactory - the bean factory used by the application context
Throws:
BeansException - in case of errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanPostProcessor

org.springframework.beans.factory.config
Interface BeanPostProcessor

All Known Subinterfaces:
DestructionAwareBeanPostProcessor, InstantiationAwareBeanPostProcessor, MergedBeanDefinitionPostProcessor, SmartInstantiationAwareBeanPostProcessor
All Known Implementing Classes:
AbstractAdvisorAutoProxyCreator, AbstractAutoProxyCreator, AdvisorAdapterRegistrationManager, AnnotationAwareAspectJAutoProxyCreator, AspectJAwareAdvisorAutoProxyCreator, AsyncAnnotationBeanPostProcessor, AutowiredAnnotationBeanPostProcessor, BeanNameAutoProxyCreator, BeanValidationPostProcessor, CommonAnnotationBeanPostProcessor, DefaultAdvisorAutoProxyCreator, InfrastructureAdvisorAutoProxyCreator, InitDestroyAnnotationBeanPostProcessor, InstantiationAwareBeanPostProcessorAdapter, LoadTimeWeaverAwareProcessor, PersistenceAnnotationBeanPostProcessor, PersistenceExceptionTranslationPostProcessor, PortletContextAwareProcessor, RequiredAnnotationBeanPostProcessor, ScheduledAnnotationBeanPostProcessor, ScriptFactoryPostProcessor, ServletContextAwareProcessor, SimplePortletPostProcessor, SimpleServletPostProcessor
public interface BeanPostProcessor

Factory hook that allows for custom modification of new bean instances, e.g. checking for marker interfaces or wrapping them with proxies.

ApplicationContexts can autodetect BeanPostProcessor beans in their bean definitions and apply them to any beans subsequently created. Plain bean factories allow for programmatic registration of post-processors, applying to all beans created through this factory.

Typically, post-processors that populate beans via marker interfaces or the like will implement postProcessBeforeInitialization(java.lang.Object, java.lang.String), while post-processors that wrap beans with proxies will normally implement postProcessAfterInitialization(java.lang.Object, java.lang.String).

Since:
10.10.2003
Author:
Juergen Hoeller
See Also:
InstantiationAwareBeanPostProcessor, DestructionAwareBeanPostProcessor, ConfigurableBeanFactory.addBeanPostProcessor(org.springframework.beans.factory.config.BeanPostProcessor), BeanFactoryPostProcessor

Method Summary
Object | postProcessAfterInitialization(Object bean, String beanName) Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).
Object | postProcessBeforeInitialization(Object bean, String beanName) Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).

Method Detail

postProcessBeforeInitialization

Object postProcessBeforeInitialization(Object bean,
                                       String beanName)
                                       throws BeansException
Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

Parameters:
bean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
Throws:
BeansException - in case of errors
See Also:
InitializingBean.afterPropertiesSet()

postProcessAfterInitialization

Object postProcessAfterInitialization(Object bean,
                                      String beanName)
                                      throws BeansException
Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

In case of a FactoryBean, this callback will be invoked for both the FactoryBean instance and the objects created by the FactoryBean (as of Spring 2.0). The post-processor can decide whether to apply to either the FactoryBean or created objects or both through corresponding bean instanceof FactoryBean checks.

This callback will also be invoked after a short-circuiting triggered by a InstantiationAwareBeanPostProcessor.postProcessBeforeInstantiation(java.lang.Class, java.lang.String) method, in contrast to all other BeanPostProcessor callbacks.

Parameters:
bean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
Throws:
BeansException - in case of errors
See Also:
InitializingBean.afterPropertiesSet(), FactoryBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanReference

org.springframework.beans.factory.config
Interface BeanReference

All Superinterfaces:
BeanMetadataElement
All Known Implementing Classes:
RuntimeBeanNameReference, RuntimeBeanReference
public interface BeanReference
extends BeanMetadataElement

Interface that exposes a reference to a bean name in an abstract fashion. This interface does not necessarily imply a reference to an actual bean instance; it just expresses a logical reference to the name of a bean.

Serves as common interface implemented by any kind of bean reference holder, such as RuntimeBeanReference and RuntimeBeanNameReference.

Since:
2.0
Author:
Juergen Hoeller

Method Summary
 String getBeanName()
Return the target bean name that this reference points to (never null).
Methods inherited from interface org.springframework.beans.BeanMetadataElement
getSource

Method Detail

getBeanName

String getBeanName()
Return the target bean name that this reference points to (never null).

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConfigurableBeanFactory

org.springframework.beans.factory.config
Interface ConfigurableBeanFactory

All Superinterfaces:
BeanFactory, HierarchicalBeanFactory, SingletonBeanRegistry
All Known Subinterfaces:
ConfigurableListableBeanFactory
All Known Implementing Classes:
AbstractAutowireCapableBeanFactory, AbstractBeanFactory, DefaultListableBeanFactory, XmlBeanFactory
public interface ConfigurableBeanFactory
extends HierarchicalBeanFactory, SingletonBeanRegistry

Configuration interface to be implemented by most bean factories. Provides facilities to configure a bean factory, in addition to the bean factory client methods in the BeanFactory interface.

This bean factory interface is not meant to be used in normal application code: Stick to BeanFactory or ListableBeanFactory for typical needs. This extended interface is just meant to allow for framework-internal plug'n'play and for special access to bean factory configuration methods.

Since:
03.11.2003
Author:
Juergen Hoeller
See Also:
BeanFactory, ListableBeanFactory, ConfigurableListableBeanFactory

Field Summary
static String | SCOPE_PROTOTYPE Scope identifier for the standard prototype scope: "prototype".
static String | SCOPE_SINGLETON Scope identifier for the standard singleton scope: "singleton".
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Method Summary
void | addBeanPostProcessor(BeanPostProcessor beanPostProcessor) Add a new BeanPostProcessor that will get applied to beans created by this factory.
void | addEmbeddedValueResolver(StringValueResolver valueResolver) Add a String resolver for embedded values such as annotation attributes.
void | addPropertyEditorRegistrar(PropertyEditorRegistrar registrar) Add a PropertyEditorRegistrar to be applied to all bean creation processes.
void | copyConfigurationFrom(ConfigurableBeanFactory otherFactory) Copy all relevant configuration from the given other factory.
void | copyRegisteredEditorsTo(PropertyEditorRegistry registry) Initialize the given PropertyEditorRegistry with the custom editors that have been registered with this BeanFactory.
void | destroyBean(String beanName, Object beanInstance) Destroy the given bean instance (usually a prototype instance obtained from this factory) according to its bean definition.
void | destroyScopedBean(String beanName) Destroy the specified scoped bean in the current target scope, if any.
void | destroySingletons() Destroy all singleton beans in this factory, including inner beans that have been registered as disposable.
AccessControlContext | getAccessControlContext() Provides a security access control context relevant to this factory.
ClassLoader | getBeanClassLoader() Return this factory's class loader for loading bean classes.
BeanExpressionResolver | getBeanExpressionResolver() Return the resolution strategy for expressions in bean definition values.
int | getBeanPostProcessorCount() Return the current number of registered BeanPostProcessors, if any.
ConversionService | getConversionService() Return the associated ConversionService, if any.
String[] | getDependenciesForBean(String beanName) Return the names of all beans that the specified bean depends on, if any.
String[] | getDependentBeans(String beanName) Return the names of all beans which depend on the specified bean, if any.
BeanDefinition | getMergedBeanDefinition(String beanName) Return a merged BeanDefinition for the given bean name, merging a child bean definition with its parent if necessary.
Scope | getRegisteredScope(String scopeName) Return the Scope implementation for the given scope name, if any.
String[] | getRegisteredScopeNames() Return the names of all currently registered scopes.
ClassLoader | getTempClassLoader() Return the temporary ClassLoader to use for type matching purposes, if any.
TypeConverter | getTypeConverter() Obtain a type converter as used by this BeanFactory.
boolean | isCacheBeanMetadata() Return whether to cache bean metadata such as given bean definitions (in merged fashion) and resolved bean classes.
boolean | isCurrentlyInCreation(String beanName) Determine whether the specified bean is currently in creation.
boolean | isFactoryBean(String name) Determine whether the bean with the given name is a FactoryBean.
void | registerAlias(String beanName, String alias) Given a bean name, create an alias.
void | registerCustomEditor(Class requiredType, Class<? extends PropertyEditor> propertyEditorClass) Register the given custom property editor for all properties of the given type.
void | registerDependentBean(String beanName, String dependentBeanName) Register a dependent bean for the given bean, to be destroyed before the given bean is destroyed.
void | registerScope(String scopeName, Scope scope) Register the given scope, backed by the given Scope implementation.
void | resolveAliases(StringValueResolver valueResolver) Resolve all alias target names and aliases registered in this factory, applying the given StringValueResolver to them.
String | resolveEmbeddedValue(String value) Resolve the given embedded value, e.g.
void | setBeanClassLoader(ClassLoader beanClassLoader) Set the class loader to use for loading bean classes.
void | setBeanExpressionResolver(BeanExpressionResolver resolver) Specify the resolution strategy for expressions in bean definition values.
void | setCacheBeanMetadata(boolean cacheBeanMetadata) Set whether to cache bean metadata such as given bean definitions (in merged fashion) and resolved bean classes.
void | setConversionService(ConversionService conversionService) Specify a Spring 3.0 ConversionService to use for converting property values, as an alternative to JavaBeans PropertyEditors.
void | setParentBeanFactory(BeanFactory parentBeanFactory) Set the parent of this bean factory.
void | setTempClassLoader(ClassLoader tempClassLoader) Specify a temporary ClassLoader to use for type matching purposes.
void | setTypeConverter(TypeConverter typeConverter) Set a custom type converter that this BeanFactory should use for converting bean property values, constructor argument values, etc.
Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory
containsLocalBean, getParentBeanFactory
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getBean, getBean, getType, isPrototype, isSingleton, isTypeMatch
Methods inherited from interface org.springframework.beans.factory.config.SingletonBeanRegistry
containsSingleton, getSingleton, getSingletonCount, getSingletonNames, registerSingleton

Field Detail

SCOPE_SINGLETON

static final String SCOPE_SINGLETON
Scope identifier for the standard singleton scope: "singleton". Custom scopes can be added via registerScope.

See Also:
registerScope(java.lang.String, org.springframework.beans.factory.config.Scope), Constant Field Values

SCOPE_PROTOTYPE

static final String SCOPE_PROTOTYPE
Scope identifier for the standard prototype scope: "prototype". Custom scopes can be added via registerScope.

See Also:
registerScope(java.lang.String, org.springframework.beans.factory.config.Scope), Constant Field Values
Method Detail

setParentBeanFactory

void setParentBeanFactory(BeanFactory parentBeanFactory)
                          throws IllegalStateException
Set the parent of this bean factory.

Note that the parent cannot be changed: It should only be set outside a constructor if it isn't available at the time of factory instantiation.

Parameters:
parentBeanFactory - the parent BeanFactory
Throws:
IllegalStateException - if this factory is already associated with a parent BeanFactory
See Also:
HierarchicalBeanFactory.getParentBeanFactory()

setBeanClassLoader

void setBeanClassLoader(ClassLoader beanClassLoader)
Set the class loader to use for loading bean classes. Default is the thread context class loader.

Note that this class loader will only apply to bean definitions that do not carry a resolved bean class yet. This is the case as of Spring 2.0 by default: Bean definitions only carry bean class names, to be resolved once the factory processes the bean definition.

Parameters:
beanClassLoader - the class loader to use, or null to suggest the default class loader

getBeanClassLoader

ClassLoader getBeanClassLoader()
Return this factory's class loader for loading bean classes.

setTempClassLoader

void setTempClassLoader(ClassLoader tempClassLoader)
Specify a temporary ClassLoader to use for type matching purposes. Default is none, simply using the standard bean ClassLoader.

A temporary ClassLoader is usually just specified if load-time weaving is involved, to make sure that actual bean classes are loaded as lazily as possible. The temporary loader is then removed once the BeanFactory completes its bootstrap phase.

Since:
2.5

getTempClassLoader

ClassLoader getTempClassLoader()
Return the temporary ClassLoader to use for type matching purposes, if any.

Since:
2.5

setCacheBeanMetadata

void setCacheBeanMetadata(boolean cacheBeanMetadata)
Set whether to cache bean metadata such as given bean definitions (in merged fashion) and resolved bean classes. Default is on.

Turn this flag off to enable hot-refreshing of bean definition objects and in particular bean classes. If this flag is off, any creation of a bean instance will re-query the bean class loader for newly resolved classes.

isCacheBeanMetadata

boolean isCacheBeanMetadata()
Return whether to cache bean metadata such as given bean definitions (in merged fashion) and resolved bean classes.

setBeanExpressionResolver

void setBeanExpressionResolver(BeanExpressionResolver resolver)
Specify the resolution strategy for expressions in bean definition values.

There is no expression support active in a BeanFactory by default. An ApplicationContext will typically set a standard expression strategy here, supporting "#{...}" expressions in a Unified EL compatible style.

Since:
3.0

getBeanExpressionResolver

BeanExpressionResolver getBeanExpressionResolver()
Return the resolution strategy for expressions in bean definition values.

Since:
3.0

setConversionService

void setConversionService(ConversionService conversionService)
Specify a Spring 3.0 ConversionService to use for converting property values, as an alternative to JavaBeans PropertyEditors.

Since:
3.0

getConversionService

ConversionService getConversionService()
Return the associated ConversionService, if any.

Since:
3.0

addPropertyEditorRegistrar

void addPropertyEditorRegistrar(PropertyEditorRegistrar registrar)
Add a PropertyEditorRegistrar to be applied to all bean creation processes.

Such a registrar creates new PropertyEditor instances and registers them on the given registry, fresh for each bean creation attempt. This avoids the need for synchronization on custom editors; hence, it is generally preferable to use this method instead of registerCustomEditor(java.lang.Class, java.lang.Class).

Parameters:
registrar - the PropertyEditorRegistrar to register

registerCustomEditor

void registerCustomEditor(Class requiredType,
                          Class<? extends PropertyEditor> propertyEditorClass)
Register the given custom property editor for all properties of the given type. To be invoked during factory configuration.

Note that this method will register a shared custom editor instance; access to that instance will be synchronized for thread-safety. It is generally preferable to use addPropertyEditorRegistrar(org.springframework.beans.PropertyEditorRegistrar) instead of this method, to avoid for the need for synchronization on custom editors.

Parameters:
requiredType - type of the property
propertyEditorClass - the PropertyEditor class to register

copyRegisteredEditorsTo

void copyRegisteredEditorsTo(PropertyEditorRegistry registry)
Initialize the given PropertyEditorRegistry with the custom editors that have been registered with this BeanFactory.

Parameters:
registry - the PropertyEditorRegistry to initialize

setTypeConverter

void setTypeConverter(TypeConverter typeConverter)
Set a custom type converter that this BeanFactory should use for converting bean property values, constructor argument values, etc.

This will override the default PropertyEditor mechanism and hence make any custom editors or custom editor registrars irrelevant.

Since:
2.5
See Also:
addPropertyEditorRegistrar(org.springframework.beans.PropertyEditorRegistrar), registerCustomEditor(java.lang.Class, java.lang.Class)

getTypeConverter

TypeConverter getTypeConverter()
Obtain a type converter as used by this BeanFactory. This may be a fresh instance for each call, since TypeConverters are usually not thread-safe.

If the default PropertyEditor mechanism is active, the returned TypeConverter will be aware of all custom editors that have been registered.

Since:
2.5

addEmbeddedValueResolver

void addEmbeddedValueResolver(StringValueResolver valueResolver)
Add a String resolver for embedded values such as annotation attributes.

Parameters:
valueResolver - the String resolver to apply to embedded values
Since:
3.0

resolveEmbeddedValue

String resolveEmbeddedValue(String value)
Resolve the given embedded value, e.g. an annotation attribute.

Parameters:
value - the value to resolve
Returns:
the resolved value (may be the original value as-is)
Since:
3.0

addBeanPostProcessor

void addBeanPostProcessor(BeanPostProcessor beanPostProcessor)
Add a new BeanPostProcessor that will get applied to beans created by this factory. To be invoked during factory configuration.

Note: Post-processors submitted here will be applied in the order of registration; any ordering semantics expressed through implementing the Ordered interface will be ignored. Note that autodetected post-processors (e.g. as beans in an ApplicationContext) will always be applied after programmatically registered ones.

Parameters:
beanPostProcessor - the post-processor to register

getBeanPostProcessorCount

int getBeanPostProcessorCount()
Return the current number of registered BeanPostProcessors, if any.

registerScope

void registerScope(String scopeName,
                   Scope scope)
Register the given scope, backed by the given Scope implementation.

Parameters:
scopeName - the scope identifier
scope - the backing Scope implementation

getRegisteredScopeNames

String[] getRegisteredScopeNames()
Return the names of all currently registered scopes.

This will only return the names of explicitly registered scopes. Built-in scopes such as "singleton" and "prototype" won't be exposed.

Returns:
the array of scope names, or an empty array if none
See Also:
registerScope(java.lang.String, org.springframework.beans.factory.config.Scope)

getRegisteredScope

Scope getRegisteredScope(String scopeName)
Return the Scope implementation for the given scope name, if any.

This will only return explicitly registered scopes. Built-in scopes such as "singleton" and "prototype" won't be exposed.

Parameters:
scopeName - the name of the scope
Returns:
the registered Scope implementation, or null if none
See Also:
registerScope(java.lang.String, org.springframework.beans.factory.config.Scope)

getAccessControlContext

AccessControlContext getAccessControlContext()
Provides a security access control context relevant to this factory.

Returns:
the applicable AccessControlContext (never null)
Since:
3.0

copyConfigurationFrom

void copyConfigurationFrom(ConfigurableBeanFactory otherFactory)
Copy all relevant configuration from the given other factory.

Should include all standard configuration settings as well as BeanPostProcessors, Scopes, and factory-specific internal settings. Should not include any metadata of actual bean definitions, such as BeanDefinition objects and bean name aliases.

Parameters:
otherFactory - the other BeanFactory to copy from

registerAlias

void registerAlias(String beanName,
                   String alias)
                   throws BeanDefinitionStoreException
Given a bean name, create an alias. We typically use this method to support names that are illegal within XML ids (used for bean names).

Typically invoked during factory configuration, but can also be used for runtime registration of aliases. Therefore, a factory implementation should synchronize alias access.

Parameters:
beanName - the canonical name of the target bean
alias - the alias to be registered for the bean
Throws:
BeanDefinitionStoreException - if the alias is already in use

resolveAliases

void resolveAliases(StringValueResolver valueResolver)
Resolve all alias target names and aliases registered in this factory, applying the given StringValueResolver to them.

The value resolver may for example resolve placeholders in target bean names and even in alias names.

Parameters:
valueResolver - the StringValueResolver to apply
Since:
2.5

getMergedBeanDefinition

BeanDefinition getMergedBeanDefinition(String beanName)
                                       throws NoSuchBeanDefinitionException
Return a merged BeanDefinition for the given bean name, merging a child bean definition with its parent if necessary. Considers bean definitions in ancestor factories as well.

Parameters:
beanName - the name of the bean to retrieve the merged definition for
Returns:
a (potentially merged) BeanDefinition for the given bean
Throws:
NoSuchBeanDefinitionException - if there is no bean definition with the given name
Since:
2.5

isFactoryBean

boolean isFactoryBean(String name)
                      throws NoSuchBeanDefinitionException
Determine whether the bean with the given name is a FactoryBean.

Parameters:
name - the name of the bean to check
Returns:
whether the bean is a FactoryBean (false means the bean exists but is not a FactoryBean)
Throws:
NoSuchBeanDefinitionException - if there is no bean with the given name
Since:
2.5

isCurrentlyInCreation

boolean isCurrentlyInCreation(String beanName)
Determine whether the specified bean is currently in creation.

Parameters:
beanName - the name of the bean
Returns:
whether the bean is currently in creation
Since:
2.5

registerDependentBean

void registerDependentBean(String beanName,
                           String dependentBeanName)
Register a dependent bean for the given bean, to be destroyed before the given bean is destroyed.

Parameters:
beanName - the name of the bean
dependentBeanName - the name of the dependent bean
Since:
2.5

getDependentBeans

String[] getDependentBeans(String beanName)
Return the names of all beans which depend on the specified bean, if any.

Parameters:
beanName - the name of the bean
Returns:
the array of dependent bean names, or an empty array if none
Since:
2.5

getDependenciesForBean

String[] getDependenciesForBean(String beanName)
Return the names of all beans that the specified bean depends on, if any.

Parameters:
beanName - the name of the bean
Returns:
the array of names of beans which the bean depends on, or an empty array if none
Since:
2.5

destroyBean

void destroyBean(String beanName,
                 Object beanInstance)
Destroy the given bean instance (usually a prototype instance obtained from this factory) according to its bean definition.

Any exception that arises during destruction should be caught and logged instead of propagated to the caller of this method.

Parameters:
beanName - the name of the bean definition
beanInstance - the bean instance to destroy

destroyScopedBean

void destroyScopedBean(String beanName)
Destroy the specified scoped bean in the current target scope, if any.

Any exception that arises during destruction should be caught and logged instead of propagated to the caller of this method.

Parameters:
beanName - the name of the scoped bean

destroySingletons

void destroySingletons()
Destroy all singleton beans in this factory, including inner beans that have been registered as disposable. To be called on shutdown of a factory.

Any exception that arises during destruction should be caught and logged instead of propagated to the caller of this method.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConfigurableListableBeanFactory

org.springframework.beans.factory.config
Interface ConfigurableListableBeanFactory

All Superinterfaces:
AutowireCapableBeanFactory, BeanFactory, ConfigurableBeanFactory, HierarchicalBeanFactory, ListableBeanFactory, SingletonBeanRegistry
All Known Implementing Classes:
DefaultListableBeanFactory, XmlBeanFactory
public interface ConfigurableListableBeanFactory
extends ListableBeanFactory, AutowireCapableBeanFactory, ConfigurableBeanFactory

Configuration interface to be implemented by most listable bean factories. In addition to ConfigurableBeanFactory, it provides facilities to analyze and modify bean definitions, and to pre-instantiate singletons.

This subinterface of BeanFactory is not meant to be used in normal application code: Stick to BeanFactory or ListableBeanFactory for typical use cases. This interface is just meant to allow for framework-internal plug'n'play even when needing access to bean factory configuration methods.

Since:
03.11.2003
Author:
Juergen Hoeller
See Also:
AbstractApplicationContext.getBeanFactory()

Field Summary
Fields inherited from interface org.springframework.beans.factory.config.AutowireCapableBeanFactory
AUTOWIRE_AUTODETECT, AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_CONSTRUCTOR, AUTOWIRE_NO
Fields inherited from interface org.springframework.beans.factory.config.ConfigurableBeanFactory
SCOPE_PROTOTYPE, SCOPE_SINGLETON
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Method Summary
void | freezeConfiguration() Freeze all bean definitions, signalling that the registered bean definitions will not be modified or post-processed any further.
BeanDefinition | getBeanDefinition(String beanName) Return the registered BeanDefinition for the specified bean, allowing access to its property values and constructor argument value (which can be modified during bean factory post-processing).
void | ignoreDependencyInterface(Class ifc) Ignore the given dependency interface for autowiring.
void | ignoreDependencyType(Class type) Ignore the given dependency type for autowiring: for example, String.
boolean | isAutowireCandidate(String beanName, DependencyDescriptor descriptor) Determine whether the specified bean qualifies as an autowire candidate, to be injected into other beans which declare a dependency of matching type.
boolean | isConfigurationFrozen() Return whether this factory's bean definitions are frozen, i.e.
void | preInstantiateSingletons() Ensure that all non-lazy-init singletons are instantiated, also considering FactoryBeans.
void | registerResolvableDependency(Class dependencyType, Object autowiredValue) Register a special dependency type with corresponding autowired value.
Methods inherited from interface org.springframework.beans.factory.ListableBeanFactory
containsBeanDefinition, findAnnotationOnBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation
Methods inherited from interface org.springframework.beans.factory.config.AutowireCapableBeanFactory
applyBeanPostProcessorsAfterInitialization, applyBeanPostProcessorsBeforeInitialization, applyBeanPropertyValues, autowire, autowireBean, autowireBeanProperties, configureBean, createBean, createBean, initializeBean, resolveDependency, resolveDependency
Methods inherited from interface org.springframework.beans.factory.config.ConfigurableBeanFactory
addBeanPostProcessor, addEmbeddedValueResolver, addPropertyEditorRegistrar, copyConfigurationFrom, copyRegisteredEditorsTo, destroyBean, destroyScopedBean, destroySingletons, getAccessControlContext, getBeanClassLoader, getBeanExpressionResolver, getBeanPostProcessorCount, getConversionService, getDependenciesForBean, getDependentBeans, getMergedBeanDefinition, getRegisteredScope, getRegisteredScopeNames, getTempClassLoader, getTypeConverter, isCacheBeanMetadata, isCurrentlyInCreation, isFactoryBean, registerAlias, registerCustomEditor, registerDependentBean, registerScope, resolveAliases, resolveEmbeddedValue, setBeanClassLoader, setBeanExpressionResolver, setCacheBeanMetadata, setConversionService, setParentBeanFactory, setTempClassLoader, setTypeConverter
Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory
containsLocalBean, getParentBeanFactory
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getBean, getBean, getType, isPrototype, isSingleton, isTypeMatch
Methods inherited from interface org.springframework.beans.factory.config.SingletonBeanRegistry
containsSingleton, getSingleton, getSingletonCount, getSingletonNames, registerSingleton

Method Detail

ignoreDependencyType

void ignoreDependencyType(Class type)
Ignore the given dependency type for autowiring: for example, String. Default is none.

Parameters:
type - the dependency type to ignore

ignoreDependencyInterface

void ignoreDependencyInterface(Class ifc)
Ignore the given dependency interface for autowiring.

This will typically be used by application contexts to register dependencies that are resolved in other ways, like BeanFactory through BeanFactoryAware or ApplicationContext through ApplicationContextAware.

By default, only the BeanFactoryAware interface is ignored. For further types to ignore, invoke this method for each type.

Parameters:
ifc - the dependency interface to ignore
See Also:
BeanFactoryAware, ApplicationContextAware

registerResolvableDependency

void registerResolvableDependency(Class dependencyType,
                                  Object autowiredValue)
Register a special dependency type with corresponding autowired value.

This is intended for factory/context references that are supposed to be autowirable but are not defined as beans in the factory: e.g. a dependency of type ApplicationContext resolved to the ApplicationContext instance that the bean is living in.

Note: There are no such default types registered in a plain BeanFactory, not even for the BeanFactory interface itself.

Parameters:
dependencyType - the dependency type to register. This will typically be a base interface such as BeanFactory, with extensions of it resolved as well if declared as an autowiring dependency (e.g. ListableBeanFactory), as long as the given value actually implements the extended interface.
autowiredValue - the corresponding autowired value. This may also be an implementation of the ObjectFactory interface, which allows for lazy resolution of the actual target value.

isAutowireCandidate

boolean isAutowireCandidate(String beanName,
                            DependencyDescriptor descriptor)
                            throws NoSuchBeanDefinitionException
Determine whether the specified bean qualifies as an autowire candidate, to be injected into other beans which declare a dependency of matching type.

This method checks ancestor factories as well.

Parameters:
beanName - the name of the bean to check
descriptor - the descriptor of the dependency to resolve
Returns:
whether the bean should be considered as autowire candidate
Throws:
NoSuchBeanDefinitionException - if there is no bean with the given name

getBeanDefinition

BeanDefinition getBeanDefinition(String beanName)
                                 throws NoSuchBeanDefinitionException
Return the registered BeanDefinition for the specified bean, allowing access to its property values and constructor argument value (which can be modified during bean factory post-processing).

A returned BeanDefinition object should not be a copy but the original definition object as registered in the factory. This means that it should be castable to a more specific implementation type, if necessary.

NOTE: This method does not consider ancestor factories. It is only meant for accessing local bean definitions of this factory.

Parameters:
beanName - the name of the bean
Returns:
the registered BeanDefinition
Throws:
NoSuchBeanDefinitionException - if there is no bean with the given name defined in this factory

freezeConfiguration

void freezeConfiguration()
Freeze all bean definitions, signalling that the registered bean definitions will not be modified or post-processed any further.

This allows the factory to aggressively cache bean definition metadata.

isConfigurationFrozen

boolean isConfigurationFrozen()
Return whether this factory's bean definitions are frozen, i.e. are not supposed to be modified or post-processed any further.

Returns:
true if the factory's configuration is considered frozen

preInstantiateSingletons

void preInstantiateSingletons()
                              throws BeansException
Ensure that all non-lazy-init singletons are instantiated, also considering FactoryBeans. Typically invoked at the end of factory setup, if desired.

Throws:
BeansException - if one of the singleton beans could not be created. Note: This may have left the factory with some beans already initialized! Call ConfigurableBeanFactory.destroySingletons() for full cleanup in this case.
See Also:
ConfigurableBeanFactory.destroySingletons()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DestructionAwareBeanPostProcessor

org.springframework.beans.factory.config
Interface DestructionAwareBeanPostProcessor

All Superinterfaces:
BeanPostProcessor
All Known Implementing Classes:
CommonAnnotationBeanPostProcessor, InitDestroyAnnotationBeanPostProcessor, PersistenceAnnotationBeanPostProcessor, SimplePortletPostProcessor, SimpleServletPostProcessor
public interface DestructionAwareBeanPostProcessor
extends BeanPostProcessor

Subinterface of BeanPostProcessor that adds a before-destruction callback.

The typical usage will be to invoke custom destruction callbacks on specific bean types, matching corresponding initialization callbacks.

Since:
1.0.1
Author:
Juergen Hoeller

Method Summary
 void postProcessBeforeDestruction(Object bean, String beanName)
Apply this BeanPostProcessor to the given bean instance before its destruction.
Methods inherited from interface org.springframework.beans.factory.config.BeanPostProcessor
postProcessAfterInitialization, postProcessBeforeInitialization

Method Detail

postProcessBeforeDestruction

void postProcessBeforeDestruction(Object bean,
                                  String beanName)
                                  throws BeansException
Apply this BeanPostProcessor to the given bean instance before its destruction. Can invoke custom destruction callbacks.

Like DisposableBean's destroy and a custom destroy method, this callback just applies to singleton beans in the factory (including inner beans).

Parameters:
bean - the bean instance to be destroyed
beanName - the name of the bean
Throws:
BeansException - in case of errors
See Also:
DisposableBean, AbstractBeanDefinition.setDestroyMethodName(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InstantiationAwareBeanPostProcessor

org.springframework.beans.factory.config
Interface InstantiationAwareBeanPostProcessor

All Superinterfaces:
BeanPostProcessor
All Known Subinterfaces:
SmartInstantiationAwareBeanPostProcessor
All Known Implementing Classes:
AbstractAdvisorAutoProxyCreator, AbstractAutoProxyCreator, AnnotationAwareAspectJAutoProxyCreator, AspectJAwareAdvisorAutoProxyCreator, AutowiredAnnotationBeanPostProcessor, BeanNameAutoProxyCreator, CommonAnnotationBeanPostProcessor, DefaultAdvisorAutoProxyCreator, InfrastructureAdvisorAutoProxyCreator, InstantiationAwareBeanPostProcessorAdapter, PersistenceAnnotationBeanPostProcessor, RequiredAnnotationBeanPostProcessor, ScriptFactoryPostProcessor
public interface InstantiationAwareBeanPostProcessor
extends BeanPostProcessor

Subinterface of BeanPostProcessor that adds a before-instantiation callback, and a callback after instantiation but before explicit properties are set or autowiring occurs.

Typically used to suppress default instantiation for specific target beans, for example to create proxies with special TargetSources (pooling targets, lazily initializing targets, etc), or to implement additional injection strategies such as field injection.

NOTE: This interface is a special purpose interface, mainly for internal use within the framework. It is recommended to implement the plain BeanPostProcessor interface as far as possible, or to derive from InstantiationAwareBeanPostProcessorAdapter in order to be shielded from extensions to this interface.

Since:
1.2
Author:
Juergen Hoeller, Rod Johnson
See Also:
AbstractAutoProxyCreator.setCustomTargetSourceCreators(org.springframework.aop.framework.autoproxy.TargetSourceCreator[]), LazyInitTargetSourceCreator

Method Summary
boolean | postProcessAfterInstantiation(Object bean, String beanName) Perform operations after the bean has been instantiated, via a constructor or factory method, but before Spring property population (from explicit properties or autowiring) occurs.
Object | postProcessBeforeInstantiation(Class<?> beanClass, String beanName) Apply this BeanPostProcessor before the target bean gets instantiated.
PropertyValues | postProcessPropertyValues(PropertyValues pvs, PropertyDescriptor[] pds, Object bean, String beanName) Post-process the given property values before the factory applies them to the given bean.
Methods inherited from interface org.springframework.beans.factory.config.BeanPostProcessor
postProcessAfterInitialization, postProcessBeforeInitialization

Method Detail

postProcessBeforeInstantiation

Object postProcessBeforeInstantiation(Class<?> beanClass,
                                      String beanName)
                                      throws BeansException
Apply this BeanPostProcessor before the target bean gets instantiated. The returned bean object may be a proxy to use instead of the target bean, effectively suppressing default instantiation of the target bean.

If a non-null object is returned by this method, the bean creation process will be short-circuited. The only further processing applied is the BeanPostProcessor.postProcessAfterInitialization(java.lang.Object, java.lang.String) callback from the configured BeanPostProcessors.

This callback will only be applied to bean definitions with a bean class. In particular, it will not be applied to beans with a "factory-method".

Post-processors may implement the extended SmartInstantiationAwareBeanPostProcessor interface in order to predict the type of the bean object that they are going to return here.

Parameters:
beanClass - the class of the bean to be instantiated
beanName - the name of the bean
Returns:
the bean object to expose instead of a default instance of the target bean, or null to proceed with default instantiation
Throws:
BeansException - in case of errors
See Also:
AbstractBeanDefinition.hasBeanClass(), AbstractBeanDefinition.getFactoryMethodName()

postProcessAfterInstantiation

boolean postProcessAfterInstantiation(Object bean,
                                      String beanName)
                                      throws BeansException
Perform operations after the bean has been instantiated, via a constructor or factory method, but before Spring property population (from explicit properties or autowiring) occurs.

This is the ideal callback for performing field injection on the given bean instance. See Spring's own AutowiredAnnotationBeanPostProcessor for a typical example.

Parameters:
bean - the bean instance created, with properties not having been set yet
beanName - the name of the bean
Returns:
true if properties should be set on the bean; false if property population should be skipped. Normal implementations should return true. Returning false will also prevent any subsequent InstantiationAwareBeanPostProcessor instances being invoked on this bean instance.
Throws:
BeansException - in case of errors

postProcessPropertyValues

PropertyValues postProcessPropertyValues(PropertyValues pvs,
                                         PropertyDescriptor[] pds,
                                         Object bean,
                                         String beanName)
                                         throws BeansException
Post-process the given property values before the factory applies them to the given bean. Allows for checking whether all dependencies have been satisfied, for example based on a "Required" annotation on bean property setters.

Also allows for replacing the property values to apply, typically through creating a new MutablePropertyValues instance based on the original PropertyValues, adding or removing specific values.

Parameters:
pvs - the property values that the factory is about to apply (never null)
pds - the relevant property descriptors for the target bean (with ignored dependency types - which the factory handles specifically - already filtered out)
bean - the bean instance created, but whose properties have not yet been set
beanName - the name of the bean
Returns:
the actual property values to apply to to the given bean (can be the passed-in PropertyValues instance), or null to skip property population
Throws:
BeansException - in case of errors
See Also:
MutablePropertyValues
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Scope

org.springframework.beans.factory.config
Interface Scope

All Known Implementing Classes:
AbstractRequestAttributesScope, PortletContextScope, RequestScope, ServletContextScope, SessionScope, SimpleThreadScope
public interface Scope

Strategy interface used by a ConfigurableBeanFactory, representing a target scope to hold bean instances in. This allows for extending the BeanFactory's standard scopes "singleton" and "prototype" with custom further scopes, registered for a specific key.

ApplicationContext implementations such as a WebApplicationContext may register additional standard scopes specific to their environment, e.g. "request" and "session", based on this Scope SPI.

Even if its primary use is for extended scopes in a web environment, this SPI is completely generic: It provides the ability to get and put objects from any underlying storage mechanism, such as an HTTP session or a custom conversation mechanism. The name passed into this class's get and remove methods will identify the target object in the current scope.

Scope implementations are expected to be thread-safe. One Scope instance can be used with multiple bean factories at the same time, if desired (unless it explicitly wants to be aware of the containing BeanFactory), with any number of threads accessing the Scope concurrently from any number of factories.

Since:
2.0
Author:
Juergen Hoeller, Rob Harrop
See Also:
ConfigurableBeanFactory.registerScope(java.lang.String, org.springframework.beans.factory.config.Scope), CustomScopeConfigurer, ScopedProxyFactoryBean, RequestScope, SessionScope

Method Summary
Object | get(String name, ObjectFactory<?> objectFactory) Return the object with the given name from the underlying scope, creating it if not found in the underlying storage mechanism.
String | getConversationId() Return the conversation ID for the current underlying scope, if any.
void | registerDestructionCallback(String name, Runnable callback) Register a callback to be executed on destruction of the specified object in the scope (or at destruction of the entire scope, if the scope does not destroy individual objects but rather only terminates in its entirety).
Object | remove(String name) Remove the object with the given name from the underlying scope.
Object | resolveContextualObject(String key) Resolve the contextual object for the given key, if any.

Method Detail

get

Object get(String name,
           ObjectFactory<?> objectFactory)
Return the object with the given name from the underlying scope, creating it if not found in the underlying storage mechanism.

This is the central operation of a Scope, and the only operation that is absolutely required.

Parameters:
name - the name of the object to retrieve
objectFactory - the ObjectFactory to use to create the scoped object if it is not present in the underlying storage mechanism
Returns:
the desired object (never null)

remove

Object remove(String name)
Remove the object with the given name from the underlying scope.

Returns null if no object was found; otherwise returns the removed Object.

Note that an implementation should also remove a registered destruction callback for the specified object, if any. It does, however, not need to execute a registered destruction callback in this case, since the object will be destroyed by the caller (if appropriate).

Note: This is an optional operation. Implementations may throw UnsupportedOperationException if they do not support explicitly removing an object.

Parameters:
name - the name of the object to remove
Returns:
the removed object, or null if no object was present
See Also:
registerDestructionCallback(java.lang.String, java.lang.Runnable)

registerDestructionCallback

void registerDestructionCallback(String name,
                                 Runnable callback)
Register a callback to be executed on destruction of the specified object in the scope (or at destruction of the entire scope, if the scope does not destroy individual objects but rather only terminates in its entirety).

Note: This is an optional operation. This method will only be called for scoped beans with actual destruction configuration (DisposableBean, destroy-method, DestructionAwareBeanPostProcessor). Implementations should do their best to execute a given callback at the appropriate time. If such a callback is not supported by the underlying runtime environment at all, the callback must be ignored and a corresponding warning should be logged.

Note that 'destruction' refers to to automatic destruction of the object as part of the scope's own lifecycle, not to the individual scoped object having been explicitly removed by the application. If a scoped object gets removed via this facade's remove(String) method, any registered destruction callback should be removed as well, assuming that the removed object will be reused or manually destroyed.

Parameters:
name - the name of the object to execute the destruction callback for
callback - the destruction callback to be executed. Note that the passed-in Runnable will never throw an exception, so it can safely be executed without an enclosing try-catch block. Furthermore, the Runnable will usually be serializable, provided that its target object is serializable as well.
See Also:
DisposableBean, AbstractBeanDefinition.getDestroyMethodName(), DestructionAwareBeanPostProcessor

resolveContextualObject

Object resolveContextualObject(String key)
Resolve the contextual object for the given key, if any. E.g. the HttpServletRequest object for key "request".

Parameters:
key - the contextual key
Returns:
the corresponding object, or null if none found

getConversationId

String getConversationId()
Return the conversation ID for the current underlying scope, if any.

The exact meaning of the conversation ID depends on the underlying storage mechanism. In the case of session-scoped objects, the conversation ID would typically be equal to (or derived from) the session ID; in the case of a custom conversation that sits within the overall session, the specific ID for the current conversation would be appropriate.

Note: This is an optional operation. It is perfectly valid to return null in an implementation of this method if the underlying storage mechanism has no obvious candidate for such an ID.

Returns:
the conversation ID, or null if there is no conversation ID for the current scope
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SingletonBeanRegistry

org.springframework.beans.factory.config
Interface SingletonBeanRegistry

All Known Subinterfaces:
ConfigurableBeanFactory, ConfigurableListableBeanFactory
All Known Implementing Classes:
AbstractAutowireCapableBeanFactory, AbstractBeanFactory, DefaultListableBeanFactory, DefaultSingletonBeanRegistry, FactoryBeanRegistrySupport, XmlBeanFactory
public interface SingletonBeanRegistry

Interface that defines a registry for shared bean instances. Can be implemented by BeanFactory implementations in order to expose their singleton management facility in a uniform manner.

The ConfigurableBeanFactory interface extends this interface.

Since:
2.0
Author:
Juergen Hoeller
See Also:
ConfigurableBeanFactory, DefaultSingletonBeanRegistry, AbstractBeanFactory

Method Summary
boolean | containsSingleton(String beanName) Check if this registry contains a singleton instance with the given name.
Object | getSingleton(String beanName) Return the (raw) singleton object registered under the given name.
int | getSingletonCount() Return the number of singleton beans registered in this registry.
String[] | getSingletonNames() Return the names of singleton beans registered in this registry.
void | registerSingleton(String beanName, Object singletonObject) Register the given existing object as singleton in the bean registry, under the given bean name.

Method Detail

registerSingleton

void registerSingleton(String beanName,
                       Object singletonObject)
Register the given existing object as singleton in the bean registry, under the given bean name.

The given instance is supposed to be fully initialized; the registry will not perform any initialization callbacks (in particular, it won't call InitializingBean's afterPropertiesSet method). The given instance will not receive any destruction callbacks (like DisposableBean's destroy method) either.

When running within a full BeanFactory: Register a bean definition instead of an existing instance if your bean is supposed to receive initialization and/or destruction callbacks.

Typically invoked during registry configuration, but can also be used for runtime registration of singletons. As a consequence, a registry implementation should synchronize singleton access; it will have to do this anyway if it supports a BeanFactory's lazy initialization of singletons.

Parameters:
beanName - the name of the bean
singletonObject - the existing singleton object
See Also:
InitializingBean.afterPropertiesSet(),
DisposableBean.destroy(),
BeanDefinitionRegistry.registerBeanDefinition(java.lang.String, org.springframework.beans.factory.config.BeanDefinition)

getSingleton

Object getSingleton(String beanName)
Return the (raw) singleton object registered under the given name.

Only checks already instantiated singletons; does not return an Object for singleton bean definitions which have not been instantiated yet.

The main purpose of this method is to access manually registered singletons (see registerSingleton(java.lang.String, java.lang.Object)). Can also be used to access a singleton defined by a bean definition that already been created, in a raw fashion.

NOTE: This lookup method is not aware of FactoryBean prefixes or aliases. You need to resolve the canonical bean name first before obtaining the singleton instance.

Parameters:
beanName - the name of the bean to look for
Returns:
the registered singleton object, or null if none found
See Also:
ConfigurableListableBeanFactory.getBeanDefinition(java.lang.String)

containsSingleton

boolean containsSingleton(String beanName)
Check if this registry contains a singleton instance with the given name.

Only checks already instantiated singletons; does not return true for singleton bean definitions which have not been instantiated yet.

The main purpose of this method is to check manually registered singletons (see registerSingleton(java.lang.String, java.lang.Object)). Can also be used to check whether a singleton defined by a bean definition has already been created.

To check whether a bean factory contains a bean definition with a given name, use ListableBeanFactory's containsBeanDefinition. Calling both containsBeanDefinition and containsSingleton answers whether a specific bean factory contains a local bean instance with the given name.

Use BeanFactory's containsBean for general checks whether the factory knows about a bean with a given name (whether manually registered singleton instance or created by bean definition), also checking ancestor factories.

NOTE: This lookup method is not aware of FactoryBean prefixes or aliases. You need to resolve the canonical bean name first before checking the singleton status.

Parameters:
beanName - the name of the bean to look for
Returns:
if this bean factory contains a singleton instance with the given name
See Also:
registerSingleton(java.lang.String, java.lang.Object),
ListableBeanFactory.containsBeanDefinition(java.lang.String),
BeanFactory.containsBean(java.lang.String)

getSingletonNames

String[] getSingletonNames()
Return the names of singleton beans registered in this registry.

Only checks already instantiated singletons; does not return names for singleton bean definitions which have not been instantiated yet.

The main purpose of this method is to check manually registered singletons (see registerSingleton(java.lang.String, java.lang.Object)). Can also be used to check which singletons defined by a bean definition have already been created.

Returns:
the list of names as a String array (never null)
See Also:
registerSingleton(java.lang.String, java.lang.Object),
BeanDefinitionRegistry.getBeanDefinitionNames(),
ListableBeanFactory.getBeanDefinitionNames()

getSingletonCount

int getSingletonCount()
Return the number of singleton beans registered in this registry.

Only checks already instantiated singletons; does not count singleton bean definitions which have not been instantiated yet.

The main purpose of this method is to check manually registered singletons (see registerSingleton(java.lang.String, java.lang.Object)). Can also be used to count the number of singletons defined by a bean definition that have already been created.

Returns:
the number of singleton beans
See Also:
registerSingleton(java.lang.String, java.lang.Object),
BeanDefinitionRegistry.getBeanDefinitionCount(),
ListableBeanFactory.getBeanDefinitionCount()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SmartInstantiationAwareBeanPostProcessor

org.springframework.beans.factory.config
Interface SmartInstantiationAwareBeanPostProcessor

All Superinterfaces:
BeanPostProcessor, InstantiationAwareBeanPostProcessor
All Known Implementing Classes:
AbstractAdvisorAutoProxyCreator, AbstractAutoProxyCreator, AnnotationAwareAspectJAutoProxyCreator, AspectJAwareAdvisorAutoProxyCreator, AutowiredAnnotationBeanPostProcessor, BeanNameAutoProxyCreator, DefaultAdvisorAutoProxyCreator, InfrastructureAdvisorAutoProxyCreator, InstantiationAwareBeanPostProcessorAdapter, RequiredAnnotationBeanPostProcessor, ScriptFactoryPostProcessor
public interface SmartInstantiationAwareBeanPostProcessor
extends InstantiationAwareBeanPostProcessor

Extension of the InstantiationAwareBeanPostProcessor interface, adding a callback for predicting the eventual type of a processed bean.

NOTE: This interface is a special purpose interface, mainly for internal use within the framework. In general, application-provided post-processors should simply implement the plain BeanPostProcessor interface or derive from the InstantiationAwareBeanPostProcessorAdapter class. New methods might be added to this interface even in point releases.

Since:
2.0.3
Author:
Juergen Hoeller
See Also:
InstantiationAwareBeanPostProcessorAdapter

Method Summary
 Constructor<?>[] determineCandidateConstructors(Class<?> beanClass, String beanName)
Determine the candidate constructors to use for the given bean.
 Object getEarlyBeanReference(Object bean, String beanName)
Obtain a reference for early access to the specified bean, typically for the purpose of resolving a circular reference.
 Class<?> predictBeanType(Class<?> beanClass, String beanName)
Predict the type of the bean to be eventually returned from this processor's InstantiationAwareBeanPostProcessor.postProcessBeforeInstantiation(java.lang.Class, java.lang.String) callback.
Methods inherited from interface org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor
postProcessAfterInstantiation, postProcessBeforeInstantiation, postProcessPropertyValues
Methods inherited from interface org.springframework.beans.factory.config.BeanPostProcessor
postProcessAfterInitialization, postProcessBeforeInitialization

Method Detail

predictBeanType

Class<?> predictBeanType(Class<?> beanClass,
                         String beanName)
                         throws BeansException
Predict the type of the bean to be eventually returned from this processor's InstantiationAwareBeanPostProcessor.postProcessBeforeInstantiation(java.lang.Class, java.lang.String) callback.

Parameters:
beanClass - the raw class of the bean
beanName - the name of the bean
Returns:
the type of the bean, or null if not predictable
Throws:
BeansException - in case of errors

determineCandidateConstructors

Constructor<?>[] determineCandidateConstructors(Class<?> beanClass,
                                                String beanName)
                                                throws BeansException
Determine the candidate constructors to use for the given bean.

Parameters:
beanClass - the raw class of the bean (never null)
beanName - the name of the bean
Returns:
the candidate constructors, or null if none specified
Throws:
BeansException - in case of errors

getEarlyBeanReference

Object getEarlyBeanReference(Object bean,
                             String beanName)
                             throws BeansException
Obtain a reference for early access to the specified bean, typically for the purpose of resolving a circular reference.

This callback gives post-processors a chance to expose a wrapper early - that is, before the target bean instance is fully initialized. The exposed object should be equivalent to the what BeanPostProcessor.postProcessBeforeInitialization(java.lang.Object, java.lang.String) / BeanPostProcessor.postProcessAfterInitialization(java.lang.Object, java.lang.String) would expose otherwise. Note that the object returned by this method will be used as bean reference unless the post-processor returns a different wrapper from said post-process callbacks. In other words: Those post-process callbacks may either eventually expose the same reference or alternatively return the raw bean instance from those subsequent callbacks (if the wrapper for the affected bean has been built for a call to this method already, it will be exposes as final bean reference by default).

Parameters:
bean - the raw bean instance
beanName - the name of the bean
Returns:
the object to expose as bean reference (typically with the passed-in bean instance as default)
Throws:
BeansException - in case of errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractFactoryBean

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.beans.factory.config
Class AbstractFactoryBean<T>

java.lang.Object
    extended by  org.springframework.beans.factory.config.AbstractFactoryBean<T>
All Implemented Interfaces:
BeanClassLoaderAware, BeanFactoryAware, DisposableBean, FactoryBean<T>, InitializingBean
Direct Known Subclasses:
AbstractServiceLoaderBasedFactoryBean, ListFactoryBean, MapFactoryBean, ObjectFactoryCreatingFactoryBean, ProviderCreatingFactoryBean, SetFactoryBean, SortedResourcesFactoryBean
public abstract class AbstractFactoryBean<T>
extends Object
implements FactoryBean<T>, BeanClassLoaderAware, BeanFactoryAware, InitializingBean, DisposableBean

Simple template superclass for FactoryBean implementations that creates a singleton or a prototype object, depending on a flag.

If the "singleton" flag is true (the default), this class will create the object that it creates exactly once on initialization and subsequently return said singleton instance on all calls to the getObject() method.

Else, this class will create a new instance every time the getObject() method is invoked. Subclasses are responsible for implementing the abstract createInstance() template method to actually create the object(s) to expose.

Since:
1.0.2
Author:
Juergen Hoeller, Keith Donald
See Also:
setSingleton(boolean), createInstance()

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
AbstractFactoryBean()
Method Summary
 void afterPropertiesSet()
Eagerly create the singleton instance, if necessary.
protected abstract  T createInstance()
Template method that subclasses must override to construct the object returned by this factory.
 void destroy()
Destroy the singleton instance, if any.
protected  void destroyInstance(T instance)
Callback for destroying a singleton instance.
protected  BeanFactory getBeanFactory()
Return the BeanFactory that this bean runs in.
protected  TypeConverter getBeanTypeConverter()
Obtain a bean type converter from the BeanFactory that this bean runs in.
protected  Class[] getEarlySingletonInterfaces()
Return an array of interfaces that a singleton object exposed by this FactoryBean is supposed to implement, for use with an 'early singleton proxy' that will be exposed in case of a circular reference.
 T getObject()
Expose the singleton instance or create a new prototype instance.
abstract  Class<?> getObjectType()
This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setBeanClassLoader(ClassLoader classLoader)
Callback that supplies the bean class loader to a bean instance.
 void setBeanFactory(BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance.
 void setSingleton(boolean singleton)
Set if a singleton should be created, or a new object on each request otherwise.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

AbstractFactoryBean

public AbstractFactoryBean()
Method Detail

setSingleton

public void setSingleton(boolean singleton)
Set if a singleton should be created, or a new object on each request otherwise. Default is true (a singleton).

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<T>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
BeanInitializationException

getBeanFactory

protected BeanFactory getBeanFactory()
Return the BeanFactory that this bean runs in.

getBeanTypeConverter

protected TypeConverter getBeanTypeConverter()
Obtain a bean type converter from the BeanFactory that this bean runs in. This is typically a fresh instance for each call, since TypeConverters are usually not thread-safe.

Falls back to a SimpleTypeConverter when not running in a BeanFactory.

See Also:
ConfigurableBeanFactory.getTypeConverter(), SimpleTypeConverter

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Eagerly create the singleton instance, if necessary.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception - in the event of misconfiguration (such as failure to set an essential property) or if initialization fails.

getObject

public final T getObject()
                  throws Exception
Expose the singleton instance or create a new prototype instance.

Specified by:
getObject in interface FactoryBean<T>
Returns:
an instance of the bean (can be null)
Throws:
Exception - in case of creation errors
See Also:
createInstance(), getEarlySingletonInterfaces()

destroy

public void destroy()
             throws Exception
Destroy the singleton instance, if any.

Specified by:
destroy in interface DisposableBean
Throws:
Exception - in case of shutdown errors. Exceptions will get logged but not rethrown to allow other beans to release their resources too.
See Also:
destroyInstance(Object)

getObjectType

public abstract Class<?> getObjectType()
This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.

Specified by:
getObjectType in interface FactoryBean<T>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
FactoryBean.getObjectType()

createInstance

protected abstract T createInstance()
                             throws Exception
Template method that subclasses must override to construct the object returned by this factory.

Invoked on initialization of this FactoryBean in case of a singleton; else, on each getObject() call.

Returns:
the object returned by this factory
Throws:
Exception - if an exception occured during object creation
See Also:
getObject()

getEarlySingletonInterfaces

protected Class[] getEarlySingletonInterfaces()
Return an array of interfaces that a singleton object exposed by this FactoryBean is supposed to implement, for use with an 'early singleton proxy' that will be exposed in case of a circular reference.

The default implementation returns this FactoryBean's object type, provided that it is an interface, or null else. The latter indicates that early singleton access is not supported by this FactoryBean. This will lead to a FactoryBeanNotInitializedException getting thrown.

Returns:
the interfaces to use for 'early singletons', or null to indicate a FactoryBeanNotInitializedException
See Also:
FactoryBeanNotInitializedException

destroyInstance

protected void destroyInstance(T instance)
                        throws Exception
Callback for destroying a singleton instance. Subclasses may override this to destroy the previously created instance.

The default implementation is empty.

Parameters:
instance - the singleton instance, as returned by createInstance()
Throws:
Exception - in case of shutdown errors
See Also:
createInstance()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


BeanDefinitionHolder

org.springframework.beans.factory.config
Class BeanDefinitionHolder

java.lang.Object
    extended by  org.springframework.beans.factory.config.BeanDefinitionHolder
All Implemented Interfaces:
BeanMetadataElement
Direct Known Subclasses:
BeanComponentDefinition
public class BeanDefinitionHolder
extends Object
implements BeanMetadataElement

Holder for a BeanDefinition with name and aliases. Can be registered as a placeholder for an inner bean.

Can also be used for programmatic registration of inner bean definitions. If you don't care about BeanNameAware and the like, registering RootBeanDefinition or ChildBeanDefinition is good enough.

Since:
1.0.2
Author:
Juergen Hoeller
See Also:
BeanNameAware, RootBeanDefinition, ChildBeanDefinition

Constructor Summary
BeanDefinitionHolder(BeanDefinitionHolder beanDefinitionHolder)
Copy constructor: Create a new BeanDefinitionHolder with the same contents as the given BeanDefinitionHolder instance.
BeanDefinitionHolder(BeanDefinition beanDefinition, String beanName)
Create a new BeanDefinitionHolder.
BeanDefinitionHolder(BeanDefinition beanDefinition, String beanName, String[] aliases)
Create a new BeanDefinitionHolder.
Method Summary
boolean | equals(Object other)
String[] | getAliases() Return the alias names for the bean, as specified directly for the bean definition.
BeanDefinition | getBeanDefinition() Return the wrapped BeanDefinition.
String | getBeanName() Return the primary name of the bean, as specified for the bean definition.
String | getLongDescription() Return a long description for the bean, including name and aliases as well as a description of the contained BeanDefinition.
String | getShortDescription() Return a friendly, short description for the bean, stating name and aliases.
Object | getSource() Expose the bean definition's source object.
int | hashCode()
boolean | matchesName(String candidateName) Determine whether the given candidate name matches the bean name or the aliases stored in this bean definition.
String | toString() This implementation returns the long description.
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

BeanDefinitionHolder

public BeanDefinitionHolder(BeanDefinition beanDefinition,
                            String beanName)
Create a new BeanDefinitionHolder.

Parameters:
beanDefinition - the BeanDefinition to wrap
beanName - the name of the bean, as specified for the bean definition

BeanDefinitionHolder

public BeanDefinitionHolder(BeanDefinition beanDefinition,
                            String beanName,
                            String[] aliases)
Create a new BeanDefinitionHolder.

Parameters:
beanDefinition - the BeanDefinition to wrap
beanName - the name of the bean, as specified for the bean definition
aliases - alias names for the bean, or null if none

BeanDefinitionHolder

public BeanDefinitionHolder(BeanDefinitionHolder beanDefinitionHolder)
Copy constructor: Create a new BeanDefinitionHolder with the same contents as the given BeanDefinitionHolder instance.

Note: The wrapped BeanDefinition reference is taken as-is; it is not deeply copied.

Parameters:
beanDefinitionHolder - the BeanDefinitionHolder to copy
Method Detail

getBeanDefinition

public BeanDefinition getBeanDefinition()
Return the wrapped BeanDefinition.

getBeanName

public String getBeanName()
Return the primary name of the bean, as specified for the bean definition.

getAliases

public String[] getAliases()
Return the alias names for the bean, as specified directly for the bean definition.

Returns:
the array of alias names, or null if none

getSource

public Object getSource()
Expose the bean definition's source object.

Specified by:
getSource in interface BeanMetadataElement
See Also:
BeanMetadataElement.getSource()

matchesName

public boolean matchesName(String candidateName)
Determine whether the given candidate name matches the bean name or the aliases stored in this bean definition.

getShortDescription

public String getShortDescription()
Return a friendly, short description for the bean, stating name and aliases.

See Also:
getBeanName(), getAliases()

getLongDescription

public String getLongDescription()
Return a long description for the bean, including name and aliases as well as a description of the contained BeanDefinition.

See Also:
getShortDescription(), getBeanDefinition()

toString

public String toString()
This implementation returns the long description. Can be overridden to return the short description or any kind of custom description instead.

Overrides:
toString in class Object
See Also:
getLongDescription(), getShortDescription()

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanDefinitionVisitor

org.springframework.beans.factory.config
Class BeanDefinitionVisitor

java.lang.Object
    extended by  org.springframework.beans.factory.config.BeanDefinitionVisitor

public class BeanDefinitionVisitor
extends Object

Visitor class for traversing BeanDefinition objects, in particular the property values and constructor argument values contained in them, resolving bean metadata values.

Used by PropertyPlaceholderConfigurer to parse all String values contained in a BeanDefinition, resolving any placeholders found.

Since:
1.2
Author:
Juergen Hoeller
See Also:
BeanDefinition, BeanDefinition.getPropertyValues(), BeanDefinition.getConstructorArgumentValues(), PropertyPlaceholderConfigurer

Constructor Summary
protected | BeanDefinitionVisitor() Create a new BeanDefinitionVisitor for subclassing.
 | BeanDefinitionVisitor(StringValueResolver valueResolver) Create a new BeanDefinitionVisitor, applying the specified value resolver to all bean metadata values.
Method Summary
protected String | resolveStringValue(String strVal) Resolve the given String value, for example parsing placeholders.
protected Object | resolveValue(Object value)
protected void | visitBeanClassName(BeanDefinition beanDefinition)
void | visitBeanDefinition(BeanDefinition beanDefinition) Traverse the given BeanDefinition object and the MutablePropertyValues and ConstructorArgumentValues contained in them.
protected void | visitFactoryBeanName(BeanDefinition beanDefinition)
protected void | visitFactoryMethodName(BeanDefinition beanDefinition)
protected void | visitGenericArgumentValues(List<ConstructorArgumentValues.ValueHolder> gas)
protected void | visitIndexedArgumentValues(Map<Integer,ConstructorArgumentValues.ValueHolder> ias)
protected void | visitList(List listVal)
protected void | visitMap(Map<?,?> mapVal)
protected void | visitParentName(BeanDefinition beanDefinition)
protected void | visitPropertyValues(MutablePropertyValues pvs)
protected void | visitScope(BeanDefinition beanDefinition)
protected void | visitSet(Set setVal)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BeanDefinitionVisitor

public BeanDefinitionVisitor(StringValueResolver valueResolver)
Create a new BeanDefinitionVisitor, applying the specified value resolver to all bean metadata values.

Parameters:
valueResolver - the StringValueResolver to apply

BeanDefinitionVisitor

protected BeanDefinitionVisitor()
Create a new BeanDefinitionVisitor for subclassing. Subclasses need to override the resolveStringValue(java.lang.String) method.

Method Detail

visitBeanDefinition

public void visitBeanDefinition(BeanDefinition beanDefinition)
Traverse the given BeanDefinition object and the MutablePropertyValues and ConstructorArgumentValues contained in them.

Parameters:
beanDefinition - the BeanDefinition object to traverse
See Also:
resolveStringValue(String)

visitParentName

protected void visitParentName(BeanDefinition beanDefinition)

visitBeanClassName

protected void visitBeanClassName(BeanDefinition beanDefinition)

visitFactoryBeanName

protected void visitFactoryBeanName(BeanDefinition beanDefinition)

visitFactoryMethodName

protected void visitFactoryMethodName(BeanDefinition beanDefinition)

visitScope

protected void visitScope(BeanDefinition beanDefinition)

visitPropertyValues

protected void visitPropertyValues(MutablePropertyValues pvs)

visitIndexedArgumentValues

protected void visitIndexedArgumentValues(Map<Integer,ConstructorArgumentValues.ValueHolder> ias)

visitGenericArgumentValues

protected void visitGenericArgumentValues(List<ConstructorArgumentValues.ValueHolder> gas)

resolveValue

protected Object resolveValue(Object value)

visitList

protected void visitList(List listVal)

visitSet

protected void visitSet(Set setVal)

visitMap

protected void visitMap(Map<?,?> mapVal)

resolveStringValue

protected String resolveStringValue(String strVal)
Resolve the given String value, for example parsing placeholders.

Parameters:
strVal - the original String value
Returns:
the resolved String value
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanExpressionContext

org.springframework.beans.factory.config
Class BeanExpressionContext

java.lang.Object
    extended by  org.springframework.beans.factory.config.BeanExpressionContext

public class BeanExpressionContext
extends Object

Context object for evaluating an expression within a bean definition.

Since:
3.0
Author:
Juergen Hoeller

Constructor Summary
BeanExpressionContext(ConfigurableBeanFactory beanFactory, Scope scope)
Method Summary
boolean | containsObject(String key)
boolean | equals(Object other)
ConfigurableBeanFactory | getBeanFactory()
Object | getObject(String key)
Scope | getScope()
int | hashCode()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BeanExpressionContext

public BeanExpressionContext(ConfigurableBeanFactory beanFactory,
                             Scope scope)
Method Detail

getBeanFactory

public final ConfigurableBeanFactory getBeanFactory()

getScope

public final Scope getScope()

containsObject

public boolean containsObject(String key)

getObject

public Object getObject(String key)

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanReferenceFactoryBean

org.springframework.beans.factory.config
Class BeanReferenceFactoryBean

java.lang.Object
    extended by  org.springframework.beans.factory.config.BeanReferenceFactoryBean
All Implemented Interfaces:
BeanFactoryAware, FactoryBean, SmartFactoryBean
public class BeanReferenceFactoryBean
extends Object
implements SmartFactoryBean, BeanFactoryAware

FactoryBean that exposes an arbitrary target bean under a different name.

Usually, the target bean will reside in a different bean definition file, using this FactoryBean to link it in and expose it under a different name. Effectively, this corresponds to an alias for the target bean.

NOTE: For XML bean definition files, an <alias> tag is available that effectively achieves the same.

A special capability of this FactoryBean is enabled through its configuration as bean definition: The "targetBeanName" can be substituted through a placeholder, in combination with Spring's PropertyPlaceholderConfigurer. Thanks to Marcus Bristav for pointing this out!

Since:
1.2
Author:
Juergen Hoeller
See Also:
setTargetBeanName(java.lang.String), PropertyPlaceholderConfigurer

Constructor Summary
BeanReferenceFactoryBean()
Method Summary
 Object getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isEagerInit()
Does this FactoryBean expect eager initialization, that is, eagerly initialize itself as well as expect eager initialization of its singleton object (if any)?
 boolean isPrototype()
Is the object managed by this factory a prototype? That is, will FactoryBean.getObject() always return an independent instance?
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setBeanFactory(BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance.
 void setTargetBeanName(String targetBeanName)
Set the name of the target bean.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BeanReferenceFactoryBean

public BeanReferenceFactoryBean()
Method Detail

setTargetBeanName

public void setTargetBeanName(String targetBeanName)
Set the name of the target bean.

This property is required. The value for this property can be substituted through a placeholder, in combination with Spring's PropertyPlaceholderConfigurer.

Parameters:
targetBeanName - the name of the target bean
See Also:
PropertyPlaceholderConfigurer

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
BeanInitializationException

getObject

public Object getObject()
                 throws BeansException
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean
Returns:
an instance of the bean (can be null)
Throws:
BeansException
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()

isPrototype

public boolean isPrototype()
Description copied from interface: SmartFactoryBean
Is the object managed by this factory a prototype? That is, will FactoryBean.getObject() always return an independent instance?

The prototype status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

This method is supposed to strictly check for independent instances; it should not return true for scoped objects or other kinds of non-singleton, non-independent objects. For this reason, this is not simply the inverted form of FactoryBean.isSingleton().

Specified by:
isPrototype in interface SmartFactoryBean
Returns:
whether the exposed object is a prototype
See Also:
FactoryBean.getObject(), FactoryBean.isSingleton()

isEagerInit

public boolean isEagerInit()
Description copied from interface: SmartFactoryBean
Does this FactoryBean expect eager initialization, that is, eagerly initialize itself as well as expect eager initialization of its singleton object (if any)?

A standard FactoryBean is not expected to initialize eagerly: Its FactoryBean.getObject() will only be called for actual access, even in case of a singleton object. Returning true from this method suggests that FactoryBean.getObject() should be called eagerly, also applying post-processors eagerly. This may make sense in case of a singleton object, in particular if post-processors expect to be applied on startup.

Specified by:
isEagerInit in interface SmartFactoryBean
Returns:
whether eager initialization applies
See Also:
ConfigurableListableBeanFactory.preInstantiateSingletons()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CommonsLogFactoryBean

org.springframework.beans.factory.config
Class CommonsLogFactoryBean

java.lang.Object
    extended by  org.springframework.beans.factory.config.CommonsLogFactoryBean
All Implemented Interfaces:
FactoryBean<Log>, InitializingBean
public class CommonsLogFactoryBean
extends Object
implements FactoryBean<Log>, InitializingBean

Factory bean for commons-logging Log instances.

Useful for sharing Log instances among multiple beans instead of using one Log instance per class name, e.g. for common log topics.

Since:
16.11.2003
Author:
Juergen Hoeller
See Also:
Log

Constructor Summary
CommonsLogFactoryBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 Log getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<? extends Log> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setLogName(String logName)
The name of the log.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CommonsLogFactoryBean

public CommonsLogFactoryBean()
Method Detail

setLogName

public void setLogName(String logName)
The name of the log.

This property is required.

Parameters:
logName - the name of the log

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

getObject

public Log getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<Log>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends Log> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<Log>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<Log>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConstructorArgumentValues

org.springframework.beans.factory.config
Class ConstructorArgumentValues

java.lang.Object
    extended by  org.springframework.beans.factory.config.ConstructorArgumentValues

public class ConstructorArgumentValues
extends Object

Holder for constructor argument values, typically as part of a bean definition.

Supports values for a specific index in the constructor argument list as well as for generic argument matches by type.

Since:
09.11.2003
Author:
Juergen Hoeller
See Also:
BeanDefinition.getConstructorArgumentValues()

Nested Class Summary
static class ConstructorArgumentValues.ValueHolder
Holder for a constructor argument value, with an optional type attribute indicating the target type of the actual constructor argument.
Constructor Summary
ConstructorArgumentValues()
Create a new empty ConstructorArgumentValues object.
ConstructorArgumentValues(ConstructorArgumentValues original)
Deep copy constructor.
Method Summary
void | addArgumentValues(ConstructorArgumentValues other) Copy all given argument values into this object, using separate holder instances to keep the values independent from the original object.
void | addGenericArgumentValue(ConstructorArgumentValues.ValueHolder newValue) Add a generic argument value to be matched by type or name (if available).
void | addGenericArgumentValue(Object value) Add a generic argument value to be matched by type.
void | addGenericArgumentValue(Object value, String type) Add a generic argument value to be matched by type.
void | addIndexedArgumentValue(int index, ConstructorArgumentValues.ValueHolder newValue) Add an argument value for the given index in the constructor argument list.
void | addIndexedArgumentValue(int index, Object value) Add an argument value for the given index in the constructor argument list.
void | addIndexedArgumentValue(int index, Object value, String type) Add an argument value for the given index in the constructor argument list.
void | clear() Clear this holder, removing all argument values.
boolean | equals(Object other)
int | getArgumentCount() Return the number of argument values held in this instance, counting both indexed and generic argument values.
ConstructorArgumentValues.ValueHolder | getArgumentValue(int index, Class requiredType) Look for an argument value that either corresponds to the given index in the constructor argument list or generically matches by type.
ConstructorArgumentValues.ValueHolder | getArgumentValue(int index, Class requiredType, String requiredName) Look for an argument value that either corresponds to the given index in the constructor argument list or generically matches by type.
ConstructorArgumentValues.ValueHolder | getArgumentValue(int index, Class requiredType, String requiredName, Set<ConstructorArgumentValues.ValueHolder> usedValueHolders) Look for an argument value that either corresponds to the given index in the constructor argument list or generically matches by type.
ConstructorArgumentValues.ValueHolder | getGenericArgumentValue(Class requiredType) Look for a generic argument value that matches the given type.
ConstructorArgumentValues.ValueHolder | getGenericArgumentValue(Class requiredType, String requiredName) Look for a generic argument value that matches the given type.
ConstructorArgumentValues.ValueHolder | getGenericArgumentValue(Class requiredType, String requiredName, Set<ConstructorArgumentValues.ValueHolder> usedValueHolders) Look for the next generic argument value that matches the given type, ignoring argument values that have already been used in the current resolution process.
List<ConstructorArgumentValues.ValueHolder> | getGenericArgumentValues() Return the list of generic argument values.
ConstructorArgumentValues.ValueHolder | getIndexedArgumentValue(int index, Class requiredType) Get argument value for the given index in the constructor argument list.
ConstructorArgumentValues.ValueHolder | getIndexedArgumentValue(int index, Class requiredType, String requiredName) Get argument value for the given index in the constructor argument list.
Map<Integer,ConstructorArgumentValues.ValueHolder> | getIndexedArgumentValues() Return the map of indexed argument values.
int | hashCode()
boolean | hasIndexedArgumentValue(int index) Check whether an argument value has been registered for the given index.
boolean | isEmpty() Return if this holder does not contain any argument values, neither indexed ones nor generic ones.
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ConstructorArgumentValues

public ConstructorArgumentValues()
Create a new empty ConstructorArgumentValues object.

ConstructorArgumentValues

public ConstructorArgumentValues(ConstructorArgumentValues original)
Deep copy constructor.

Parameters:
original - the ConstructorArgumentValues to copy
Method Detail

addArgumentValues

public void addArgumentValues(ConstructorArgumentValues other)
Copy all given argument values into this object, using separate holder instances to keep the values independent from the original object.

Note: Identical ValueHolder instances will only be registered once, to allow for merging and re-merging of argument value definitions. Distinct ValueHolder instances carrying the same content are of course allowed.

addIndexedArgumentValue

public void addIndexedArgumentValue(int index,
                                    Object value)
Add an argument value for the given index in the constructor argument list.

Parameters:
index - the index in the constructor argument list
value - the argument value

addIndexedArgumentValue

public void addIndexedArgumentValue(int index,
                                    Object value,
                                    String type)
Add an argument value for the given index in the constructor argument list.

Parameters:
index - the index in the constructor argument list
value - the argument value
type - the type of the constructor argument

addIndexedArgumentValue

public void addIndexedArgumentValue(int index,
                                    ConstructorArgumentValues.ValueHolder newValue)
Add an argument value for the given index in the constructor argument list.

Parameters:
index - the index in the constructor argument list
newValue - the argument value in the form of a ValueHolder

hasIndexedArgumentValue

public boolean hasIndexedArgumentValue(int index)
Check whether an argument value has been registered for the given index.

Parameters:
index - the index in the constructor argument list

getIndexedArgumentValue

public ConstructorArgumentValues.ValueHolder getIndexedArgumentValue(int index,
                                                                     Class requiredType)
Get argument value for the given index in the constructor argument list.

Parameters:
index - the index in the constructor argument list
requiredType - the type to match (can be null to match untyped values only)
Returns:
the ValueHolder for the argument, or null if none set

getIndexedArgumentValue

public ConstructorArgumentValues.ValueHolder getIndexedArgumentValue(int index,
                                                                     Class requiredType,
                                                                     String requiredName)
Get argument value for the given index in the constructor argument list.

Parameters:
index - the index in the constructor argument list
requiredType - the type to match (can be null to match untyped values only)
requiredName - the type to match (can be null to match unnamed values only)
Returns:
the ValueHolder for the argument, or null if none set

getIndexedArgumentValues

public Map<Integer,ConstructorArgumentValues.ValueHolder> getIndexedArgumentValues()
Return the map of indexed argument values.

Returns:
unmodifiable Map with Integer index as key and ValueHolder as value
See Also:
ConstructorArgumentValues.ValueHolder

addGenericArgumentValue

public void addGenericArgumentValue(Object value)
Add a generic argument value to be matched by type.

Note: A single generic argument value will just be used once, rather than matched multiple times.

Parameters:
value - the argument value

addGenericArgumentValue

public void addGenericArgumentValue(Object value,
                                    String type)
Add a generic argument value to be matched by type.

Note: A single generic argument value will just be used once, rather than matched multiple times.

Parameters:
value - the argument value
type - the type of the constructor argument

addGenericArgumentValue

public void addGenericArgumentValue(ConstructorArgumentValues.ValueHolder newValue)
Add a generic argument value to be matched by type or name (if available).

Note: A single generic argument value will just be used once, rather than matched multiple times.

Parameters:
newValue - the argument value in the form of a ValueHolder

Note: Identical ValueHolder instances will only be registered once, to allow for merging and re-merging of argument value definitions. Distinct ValueHolder instances carrying the same content are of course allowed.

getGenericArgumentValue

public ConstructorArgumentValues.ValueHolder getGenericArgumentValue(Class requiredType)
Look for a generic argument value that matches the given type.

Parameters:
requiredType - the type to match
Returns:
the ValueHolder for the argument, or null if none set

getGenericArgumentValue

public ConstructorArgumentValues.ValueHolder getGenericArgumentValue(Class requiredType,
                                                                     String requiredName)
Look for a generic argument value that matches the given type.

Parameters:
requiredType - the type to match
requiredName - the name to match
Returns:
the ValueHolder for the argument, or null if none set

getGenericArgumentValue

public ConstructorArgumentValues.ValueHolder getGenericArgumentValue(Class requiredType,
                                                                     String requiredName,
                                                                     Set<ConstructorArgumentValues.ValueHolder> usedValueHolders)
Look for the next generic argument value that matches the given type, ignoring argument values that have already been used in the current resolution process.

Parameters:
requiredType - the type to match (can be null to find an arbitrary next generic argument value)
requiredName - the name to match (can be null to not match argument values by name)
usedValueHolders - a Set of ValueHolder objects that have already been used in the current resolution process and should therefore not be returned again
Returns:
the ValueHolder for the argument, or null if none found

getGenericArgumentValues

public List<ConstructorArgumentValues.ValueHolder> getGenericArgumentValues()
Return the list of generic argument values.

Returns:
unmodifiable List of ValueHolders
See Also:
ConstructorArgumentValues.ValueHolder

getArgumentValue

public ConstructorArgumentValues.ValueHolder getArgumentValue(int index,
                                                              Class requiredType)
Look for an argument value that either corresponds to the given index in the constructor argument list or generically matches by type.

Parameters:
index - the index in the constructor argument list
requiredType - the type to match
Returns:
the ValueHolder for the argument, or null if none set

getArgumentValue

public ConstructorArgumentValues.ValueHolder getArgumentValue(int index,
                                                              Class requiredType,
                                                              String requiredName)
Look for an argument value that either corresponds to the given index in the constructor argument list or generically matches by type.

Parameters:
index - the index in the constructor argument list
requiredType - the type to match
requiredName - the name to match
Returns:
the ValueHolder for the argument, or null if none set

getArgumentValue

public ConstructorArgumentValues.ValueHolder getArgumentValue(int index,
                                                              Class requiredType,
                                                              String requiredName,
                                                              Set<ConstructorArgumentValues.ValueHolder> usedValueHolders)
Look for an argument value that either corresponds to the given index in the constructor argument list or generically matches by type.

Parameters:
index - the index in the constructor argument list
requiredType - the type to match (can be null to find an untyped argument value)
usedValueHolders - a Set of ValueHolder objects that have already been used in the current resolution process and should therefore not be returned again (allowing to return the next generic argument match in case of multiple generic argument values of the same type)
Returns:
the ValueHolder for the argument, or null if none set

getArgumentCount

public int getArgumentCount()
Return the number of argument values held in this instance, counting both indexed and generic argument values.

isEmpty

public boolean isEmpty()
Return if this holder does not contain any argument values, neither indexed ones nor generic ones.

clear

public void clear()
Clear this holder, removing all argument values.

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConstructorArgumentValues.ValueHolder

org.springframework.beans.factory.config
Class ConstructorArgumentValues.ValueHolder

java.lang.Object
    extended by  org.springframework.beans.factory.config.ConstructorArgumentValues.ValueHolder
All Implemented Interfaces:
BeanMetadataElement
Enclosing class:
ConstructorArgumentValues
public static class ConstructorArgumentValues.ValueHolder
extends Object
implements BeanMetadataElement

Holder for a constructor argument value, with an optional type attribute indicating the target type of the actual constructor argument.

Constructor Summary
ConstructorArgumentValues.ValueHolder(Object value)
Create a new ValueHolder for the given value.
ConstructorArgumentValues.ValueHolder(Object value, String type)
Create a new ValueHolder for the given value and type.
ConstructorArgumentValues.ValueHolder(Object value, String type, String name)
Create a new ValueHolder for the given value, type and name.
Method Summary
ConstructorArgumentValues.ValueHolder | copy() Create a copy of this ValueHolder: that is, an independent ValueHolder instance with the same contents.
Object | getConvertedValue() Return the converted value of the constructor argument, after processed type conversion.
String | getName() Return the name of the constructor argument.
Object | getSource() Return the configuration source Object for this metadata element (may be null).
String | getType() Return the type of the constructor argument.
Object | getValue() Return the value for the constructor argument.
boolean | isConverted() Return whether this holder contains a converted value already (true), or whether the value still needs to be converted (false).
void | setConvertedValue(Object value) Set the converted value of the constructor argument, after processed type conversion.
void | setName(String name) Set the name of the constructor argument.
void | setSource(Object source) Set the configuration source Object for this metadata element.
void | setType(String type) Set the type of the constructor argument.
void | setValue(Object value) Set the value for the constructor argument.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ConstructorArgumentValues.ValueHolder

public ConstructorArgumentValues.ValueHolder(Object value)
Create a new ValueHolder for the given value.

Parameters:
value - the argument value

ConstructorArgumentValues.ValueHolder

public ConstructorArgumentValues.ValueHolder(Object value,
                                             String type)
Create a new ValueHolder for the given value and type.

Parameters:
value - the argument value
type - the type of the constructor argument

ConstructorArgumentValues.ValueHolder

public ConstructorArgumentValues.ValueHolder(Object value,
                                             String type,
                                             String name)
Create a new ValueHolder for the given value, type and name.

Parameters:
value - the argument value
type - the type of the constructor argument
name - the name of the constructor argument
Method Detail

setValue

public void setValue(Object value)
Set the value for the constructor argument.

See Also:
PropertyPlaceholderConfigurer

getValue

public Object getValue()
Return the value for the constructor argument.

setType

public void setType(String type)
Set the type of the constructor argument.

getType

public String getType()
Return the type of the constructor argument.

setName

public void setName(String name)
Set the name of the constructor argument.

getName

public String getName()
Return the name of the constructor argument.

setSource

public void setSource(Object source)
Set the configuration source Object for this metadata element.

The exact type of the object will depend on the configuration mechanism used.

getSource

public Object getSource()
Description copied from interface: BeanMetadataElement
Return the configuration source Object for this metadata element (may be null).

Specified by:
getSource in interface BeanMetadataElement

isConverted

public boolean isConverted()
Return whether this holder contains a converted value already (true), or whether the value still needs to be converted (false).

setConvertedValue

public void setConvertedValue(Object value)
Set the converted value of the constructor argument, after processed type conversion.

getConvertedValue

public Object getConvertedValue()
Return the converted value of the constructor argument, after processed type conversion.

copy

public ConstructorArgumentValues.ValueHolder copy()
Create a copy of this ValueHolder: that is, an independent ValueHolder instance with the same contents.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CustomEditorConfigurer

org.springframework.beans.factory.config
Class CustomEditorConfigurer

java.lang.Object
    extended by  org.springframework.beans.factory.config.CustomEditorConfigurer
All Implemented Interfaces:
BeanClassLoaderAware, BeanFactoryPostProcessor, Ordered
public class CustomEditorConfigurer
extends Object
implements BeanFactoryPostProcessor, BeanClassLoaderAware, Ordered

BeanFactoryPostProcessor implementation that allows for convenient registration of custom property editors.

As of Spring 2.0, the recommended usage is to use custom PropertyEditorRegistrar implementations that in turn register any desired editors on a given registry. Each PropertyEditorRegistrar can register any number of custom editors.

 <bean id="customEditorConfigurer" class="org.springframework.beans.factory.config.CustomEditorConfigurer">
   <property name="propertyEditorRegistrars">
     <list>
       <bean class="mypackage.MyCustomDateEditorRegistrar"/>
       <bean class="mypackage.MyObjectEditorRegistrar"/>
     </list>
   </property>
 </bean>

Alternative configuration example with custom editor classes:

 <bean id="customEditorConfigurer" class="org.springframework.beans.factory.config.CustomEditorConfigurer">
   <property name="customEditors">
     <map>
       <entry key="java.util.Date" value="mypackage.MyCustomDateEditor"/>
       <entry key="mypackage.MyObject" value="mypackage.MyObjectEditor"/>
     </map>
   </property>
 </bean>

Also supports "java.lang.String[]"-style array class names and primitive class names (e.g. "boolean"). Delegates to ClassUtils for actual class name resolution.

NOTE: Custom property editors registered with this configurer do not apply to data binding. Custom editors for data binding need to be registered on the DataBinder: Use a common base class or delegate to common PropertyEditorRegistrar implementations to reuse editor registration there.

Since:
27.02.2004
Author:
Juergen Hoeller
See Also:
PropertyEditor,
PropertyEditorRegistrar,
ConfigurableBeanFactory.addPropertyEditorRegistrar(org.springframework.beans.PropertyEditorRegistrar),
ConfigurableBeanFactory.registerCustomEditor(java.lang.Class, java.lang.Class),
DataBinder.registerCustomEditor(java.lang.Class, java.beans.PropertyEditor),
BaseCommandController.setPropertyEditorRegistrars(org.springframework.beans.PropertyEditorRegistrar[]),
BaseCommandController.initBinder(javax.servlet.http.HttpServletRequest, org.springframework.web.bind.ServletRequestDataBinder)

Field Summary
protected  Log logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
CustomEditorConfigurer()
Method Summary
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
void | postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) Modify the application context's internal bean factory after its standard initialization.
void | setBeanClassLoader(ClassLoader beanClassLoader) Callback that supplies the bean class loader to a bean instance.
void | setCustomEditors(Map<String,?> customEditors) Specify the custom editors to register via a Map, using the class name of the required type as the key and the class name of the associated PropertyEditor as value.
void | setIgnoreUnresolvableEditors(boolean ignoreUnresolvableEditors) Set whether unresolvable editors should simply be skipped.
void | setOrder(int order)
void | setPropertyEditorRegistrars(PropertyEditorRegistrar[] propertyEditorRegistrars) Specify the PropertyEditorRegistrars to apply to beans defined within the current application context.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Constructor Detail

CustomEditorConfigurer

public CustomEditorConfigurer()
Method Detail

setOrder

public void setOrder(int order)

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

setPropertyEditorRegistrars

public void setPropertyEditorRegistrars(PropertyEditorRegistrar[] propertyEditorRegistrars)
Specify the PropertyEditorRegistrars to apply to beans defined within the current application context.

This allows for sharing PropertyEditorRegistrars with DataBinders, etc. Furthermore, it avoids the need for synchronization on custom editors: A PropertyEditorRegistrar will always create fresh editor instances for each bean creation attempt.

See Also:
ConfigurableBeanFactory.addPropertyEditorRegistrar(org.springframework.beans.PropertyEditorRegistrar)

setCustomEditors

public void setCustomEditors(Map<String,?> customEditors)
Specify the custom editors to register via a Map, using the class name of the required type as the key and the class name of the associated PropertyEditor as value.

Also supports PropertyEditor instances as values; however, this is deprecated since Spring 2.0.7!

See Also:
ConfigurableBeanFactory.registerCustomEditor(java.lang.Class, java.lang.Class)

setIgnoreUnresolvableEditors

public void setIgnoreUnresolvableEditors(boolean ignoreUnresolvableEditors)
Set whether unresolvable editors should simply be skipped. Default is to raise an exception in such a case.

This typically applies to either the editor class or the required type class not being found in the classpath. If you expect this to happen in some deployments and prefer to simply ignore the affected editors, then switch this flag to "true".

setBeanClassLoader

public void setBeanClassLoader(ClassLoader beanClassLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
beanClassLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

postProcessBeanFactory

public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
                            throws BeansException
Description copied from interface: BeanFactoryPostProcessor
Modify the application context's internal bean factory after its standard initialization. All bean definitions will have been loaded, but no beans will have been instantiated yet. This allows for overriding or adding properties even to eager-initializing beans.

Specified by:
postProcessBeanFactory in interface BeanFactoryPostProcessor
Parameters:
beanFactory - the bean factory used by the application context
Throws:
BeansException - in case of errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CustomScopeConfigurer

org.springframework.beans.factory.config
Class CustomScopeConfigurer

java.lang.Object
    extended by  org.springframework.beans.factory.config.CustomScopeConfigurer
All Implemented Interfaces:
BeanClassLoaderAware, BeanFactoryPostProcessor, Ordered
public class CustomScopeConfigurer
extends Object
implements BeanFactoryPostProcessor, BeanClassLoaderAware, Ordered

Simple BeanFactoryPostProcessor implementation that registers custom Scope(s) with the containing ConfigurableBeanFactory.

Will register all of the supplied scopes with the ConfigurableListableBeanFactory that is passed to the postProcessBeanFactory(ConfigurableListableBeanFactory) method.

This class allows for declarative registration of custom scopes. Alternatively, consider implementing a custom BeanFactoryPostProcessor that calls ConfigurableBeanFactory.registerScope(java.lang.String, org.springframework.beans.factory.config.Scope) programmatically.

Since:
2.0
Author:
Juergen Hoeller, Rick Evans
See Also:
ConfigurableBeanFactory.registerScope(java.lang.String, org.springframework.beans.factory.config.Scope)

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
CustomScopeConfigurer()
Method Summary
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
void | postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) Modify the application context's internal bean factory after its standard initialization.
void | setBeanClassLoader(ClassLoader beanClassLoader) Callback that supplies the bean class loader to a bean instance.
void | setOrder(int order)
void | setScopes(Map<String,Object> scopes) Specify the custom scopes that are to be registered.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CustomScopeConfigurer

public CustomScopeConfigurer()
Method Detail

setScopes

public void setScopes(Map<String,Object> scopes)
Specify the custom scopes that are to be registered.

The keys indicate the scope names (of type String); each value is expected to be the corresponding custom Scope instance or class name.

setOrder

public void setOrder(int order)

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

setBeanClassLoader

public void setBeanClassLoader(ClassLoader beanClassLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
beanClassLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

postProcessBeanFactory

public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
                            throws BeansException
Description copied from interface: BeanFactoryPostProcessor
Modify the application context's internal bean factory after its standard initialization. All bean definitions will have been loaded, but no beans will have been instantiated yet. This allows for overriding or adding properties even to eager-initializing beans.

Specified by:
postProcessBeanFactory in interface BeanFactoryPostProcessor
Parameters:
beanFactory - the bean factory used by the application context
Throws:
BeansException - in case of errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DependencyDescriptor

org.springframework.beans.factory.config
Class DependencyDescriptor

java.lang.Object
    extended by  org.springframework.beans.factory.config.DependencyDescriptor
All Implemented Interfaces:
Serializable
public class DependencyDescriptor
extends Object
implements Serializable

Descriptor for a specific dependency that is about to be injected. Wraps a constructor parameter, a method parameter or a field, allowing unified access to their metadata.

Since:
2.5
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
DependencyDescriptor(Field field, boolean required)
Create a new descriptor for a field.
DependencyDescriptor(Field field, boolean required, boolean eager)
Create a new descriptor for a field.
DependencyDescriptor(MethodParameter methodParameter, boolean required)
Create a new descriptor for a method or constructor parameter.
DependencyDescriptor(MethodParameter methodParameter, boolean required, boolean eager)
Create a new descriptor for a method or constructor parameter.
Method Summary
Annotation[] | getAnnotations() Obtain the annotations associated with the wrapped parameter/field, if any.
Class<?> | getCollectionType() Determine the generic element type of the wrapped Collection parameter/field, if any.
String | getDependencyName() Determine the name of the wrapped parameter/field.
Class<?> | getDependencyType() Determine the declared (non-generic) type of the wrapped parameter/field.
Field | getField() Return the wrapped Field, if any.
Type | getGenericDependencyType() Determine the generic type of the wrapped parameter/field.
Class<?> | getMapKeyType() Determine the generic key type of the wrapped Map parameter/field, if any.
Class<?> | getMapValueType() Determine the generic value type of the wrapped Map parameter/field, if any.
MethodParameter | getMethodParameter() Return the wrapped MethodParameter, if any.
void | initParameterNameDiscovery(ParameterNameDiscoverer parameterNameDiscoverer) Initialize parameter name discovery for the underlying method parameter, if any.
boolean | isEager() Return whether this dependency is 'eager' in the sense of eagerly resolving potential target beans for type matching.
boolean | isRequired() Return whether this dependency is required.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DependencyDescriptor

public DependencyDescriptor(MethodParameter methodParameter,
                            boolean required)
Create a new descriptor for a method or constructor parameter. Considers the dependency as 'eager'.

Parameters:
methodParameter - the MethodParameter to wrap
required - whether the dependency is required

DependencyDescriptor

public DependencyDescriptor(MethodParameter methodParameter,
                            boolean required,
                            boolean eager)
Create a new descriptor for a method or constructor parameter.

Parameters:
methodParameter - the MethodParameter to wrap
required - whether the dependency is required
eager - whether this dependency is 'eager' in the sense of eagerly resolving potential target beans for type matching

DependencyDescriptor

public DependencyDescriptor(Field field,
                            boolean required)
Create a new descriptor for a field. Considers the dependency as 'eager'.

Parameters:
field - the field to wrap
required - whether the dependency is required

DependencyDescriptor

public DependencyDescriptor(Field field,
                            boolean required,
                            boolean eager)
Create a new descriptor for a field.

Parameters:
field - the field to wrap
required - whether the dependency is required
eager - whether this dependency is 'eager' in the sense of eagerly resolving potential target beans for type matching
Method Detail

getMethodParameter

public MethodParameter getMethodParameter()
Return the wrapped MethodParameter, if any.

Note: Either MethodParameter or Field is available.

Returns:
the MethodParameter, or null if none

getField

public Field getField()
Return the wrapped Field, if any.

Note: Either MethodParameter or Field is available.

Returns:
the Field, or null if none

isRequired

public boolean isRequired()
Return whether this dependency is required.

isEager

public boolean isEager()
Return whether this dependency is 'eager' in the sense of eagerly resolving potential target beans for type matching.

initParameterNameDiscovery

public void initParameterNameDiscovery(ParameterNameDiscoverer parameterNameDiscoverer)
Initialize parameter name discovery for the underlying method parameter, if any.

This method does not actually try to retrieve the parameter name at this point; it just allows discovery to happen when the application calls getDependencyName() (if ever).

getDependencyName

public String getDependencyName()
Determine the name of the wrapped parameter/field.

Returns:
the declared name (never null)

getDependencyType

public Class<?> getDependencyType()
Determine the declared (non-generic) type of the wrapped parameter/field.

Returns:
the declared type (never null)

getGenericDependencyType

public Type getGenericDependencyType()
Determine the generic type of the wrapped parameter/field.

Returns:
the generic type (never null)

getCollectionType

public Class<?> getCollectionType()
Determine the generic element type of the wrapped Collection parameter/field, if any.

Returns:
the generic type, or null if none

getMapKeyType

public Class<?> getMapKeyType()
Determine the generic key type of the wrapped Map parameter/field, if any.

Returns:
the generic type, or null if none

getMapValueType

public Class<?> getMapValueType()
Determine the generic value type of the wrapped Map parameter/field, if any.

Returns:
the generic type, or null if none

getAnnotations

public Annotation[] getAnnotations()
Obtain the annotations associated with the wrapped parameter/field, if any.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FieldRetrievingFactoryBean

org.springframework.beans.factory.config
Class FieldRetrievingFactoryBean

java.lang.Object
    extended by  org.springframework.beans.factory.config.FieldRetrievingFactoryBean
All Implemented Interfaces:
BeanClassLoaderAware, BeanNameAware, FactoryBean<Object>, InitializingBean
public class FieldRetrievingFactoryBean
extends Object
implements FactoryBean<Object>, BeanNameAware, BeanClassLoaderAware, InitializingBean

FactoryBean which retrieves a static or non-static field value.

Typically used for retrieving public static final constants. Usage example:

// standard definition for exposing a static field, specifying the "staticField" property
 <bean id="myField" class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean">
   <property name="staticField" value="java.sql.Connection.TRANSACTION_SERIALIZABLE"/>
 </bean>

 // convenience version that specifies a static field pattern as bean name
 <bean id="java.sql.Connection.TRANSACTION_SERIALIZABLE"
       class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean"/>

If you are using Spring 2.0, you can also use the following style of configuration for public static fields.

<util:constant static-field="java.sql.Connection.TRANSACTION_SERIALIZABLE"/>

Since:
1.1
Author:
Juergen Hoeller
See Also:
setStaticField(java.lang.String)

Constructor Summary
FieldRetrievingFactoryBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 Object getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<?> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 Class getTargetClass()
Return the target class on which the field is defined.
 String getTargetField()
Return the name of the field to be retrieved.
 Object getTargetObject()
Return the target object on which the field is defined.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setBeanClassLoader(ClassLoader classLoader)
Callback that supplies the bean class loader to a bean instance.
 void setBeanName(String beanName)
The bean name of this FieldRetrievingFactoryBean will be interpreted as "staticField" pattern, if neither "targetClass" nor "targetObject" nor "targetField" have been specified.
 void setStaticField(String staticField)
Set a fully qualified static field name to retrieve, e.g.
 void setTargetClass(Class targetClass)
Set the target class on which the field is defined.
 void setTargetField(String targetField)
Set the name of the field to be retrieved.
 void setTargetObject(Object targetObject)
Set the target object on which the field is defined.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

FieldRetrievingFactoryBean

public FieldRetrievingFactoryBean()
Method Detail

setTargetClass

public void setTargetClass(Class targetClass)
Set the target class on which the field is defined. Only necessary when the target field is static; else, a target object needs to be specified anyway.

See Also:
setTargetObject(java.lang.Object), setTargetField(java.lang.String)

getTargetClass

public Class getTargetClass()
Return the target class on which the field is defined.

setTargetObject

public void setTargetObject(Object targetObject)
Set the target object on which the field is defined. Only necessary when the target field is not static; else, a target class is sufficient.

See Also:
setTargetClass(java.lang.Class), setTargetField(java.lang.String)

getTargetObject

public Object getTargetObject()
Return the target object on which the field is defined.

setTargetField

public void setTargetField(String targetField)
Set the name of the field to be retrieved. Refers to either a static field or a non-static field, depending on a target object being set.

See Also:
setTargetClass(java.lang.Class), setTargetObject(java.lang.Object)

getTargetField

public String getTargetField()
Return the name of the field to be retrieved.

setStaticField

public void setStaticField(String staticField)
Set a fully qualified static field name to retrieve, e.g. "example.MyExampleClass.MY_EXAMPLE_FIELD". Convenient alternative to specifying targetClass and targetField.

See Also:
setTargetClass(java.lang.Class), setTargetField(java.lang.String)

setBeanName

public void setBeanName(String beanName)
The bean name of this FieldRetrievingFactoryBean will be interpreted as "staticField" pattern, if neither "targetClass" nor "targetObject" nor "targetField" have been specified. This allows for concise bean definitions with just an id/name.

Specified by:
setBeanName in interface BeanNameAware
Parameters:
beanName - the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use the BeanFactoryUtils.originalBeanName(String) method to extract the original bean name (without suffix), if desired.

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

afterPropertiesSet

public void afterPropertiesSet()
                        throws ClassNotFoundException,
                               NoSuchFieldException
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
ClassNotFoundException
NoSuchFieldException

getObject

public Object getObject()
                 throws IllegalAccessException
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<Object>
Returns:
an instance of the bean (can be null)
Throws:
IllegalAccessException
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<?> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<Object>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<Object>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InstantiationAwareBeanPostProcessorAdapter

org.springframework.beans.factory.config
Class InstantiationAwareBeanPostProcessorAdapter

java.lang.Object
    extended by  org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter
All Implemented Interfaces:
BeanPostProcessor, InstantiationAwareBeanPostProcessor, SmartInstantiationAwareBeanPostProcessor
Direct Known Subclasses:
AutowiredAnnotationBeanPostProcessor, RequiredAnnotationBeanPostProcessor, ScriptFactoryPostProcessor
public abstract class InstantiationAwareBeanPostProcessorAdapter
extends Object
implements SmartInstantiationAwareBeanPostProcessor

Adapter that implements all methods on SmartInstantiationAwareBeanPostProcessor as no-ops, which will not change normal processing of each bean instantiated by the container. Subclasses may override merely those methods that they are actually interested in.

Note that this base class is only recommendable if you actually require InstantiationAwareBeanPostProcessor functionality. If all you need is plain BeanPostProcessor functionality, prefer a straight implementation of that (simpler) interface.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller

Constructor Summary
InstantiationAwareBeanPostProcessorAdapter()
Method Summary
 Constructor<?>[] determineCandidateConstructors(Class beanClass, String beanName)
Determine the candidate constructors to use for the given bean.
 Object getEarlyBeanReference(Object bean, String beanName)
Obtain a reference for early access to the specified bean, typically for the purpose of resolving a circular reference.
 Object postProcessAfterInitialization(Object bean, String beanName)
Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).
 boolean postProcessAfterInstantiation(Object bean, String beanName)
Perform operations after the bean has been instantiated, via a constructor or factory method, but before Spring property population (from explicit properties or autowiring) occurs.
 Object postProcessBeforeInitialization(Object bean, String beanName)
Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).
 Object postProcessBeforeInstantiation(Class beanClass, String beanName)
Apply this BeanPostProcessor before the target bean gets instantiated.
 PropertyValues postProcessPropertyValues(PropertyValues pvs, PropertyDescriptor[] pds, Object bean, String beanName)
Post-process the given property values before the factory applies them to the given bean.
 Class<?> predictBeanType(Class<?> beanClass, String beanName)
Predict the type of the bean to be eventually returned from this processor's InstantiationAwareBeanPostProcessor.postProcessBeforeInstantiation(java.lang.Class, java.lang.String) callback.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

InstantiationAwareBeanPostProcessorAdapter

public InstantiationAwareBeanPostProcessorAdapter()
Method Detail

predictBeanType

public Class<?> predictBeanType(Class<?> beanClass,
                                String beanName)
Description copied from interface: SmartInstantiationAwareBeanPostProcessor
Predict the type of the bean to be eventually returned from this processor's InstantiationAwareBeanPostProcessor.postProcessBeforeInstantiation(java.lang.Class, java.lang.String) callback.

Specified by:
predictBeanType in interface SmartInstantiationAwareBeanPostProcessor
Parameters:
beanClass - the raw class of the bean
beanName - the name of the bean
Returns:
the type of the bean, or null if not predictable

determineCandidateConstructors

public Constructor<?>[] determineCandidateConstructors(Class beanClass,
                                                       String beanName)
                                                throws BeansException
Description copied from interface: SmartInstantiationAwareBeanPostProcessor
Determine the candidate constructors to use for the given bean.

Specified by:
determineCandidateConstructors in interface SmartInstantiationAwareBeanPostProcessor
Parameters:
beanClass - the raw class of the bean (never null)
beanName - the name of the bean
Returns:
the candidate constructors, or null if none specified
Throws:
BeansException - in case of errors

getEarlyBeanReference

public Object getEarlyBeanReference(Object bean,
                                    String beanName)
                             throws BeansException
Description copied from interface: SmartInstantiationAwareBeanPostProcessor
Obtain a reference for early access to the specified bean, typically for the purpose of resolving a circular reference.

This callback gives post-processors a chance to expose a wrapper early - that is, before the target bean instance is fully initialized. The exposed object should be equivalent to the what BeanPostProcessor.postProcessBeforeInitialization(java.lang.Object, java.lang.String) / BeanPostProcessor.postProcessAfterInitialization(java.lang.Object, java.lang.String) would expose otherwise. Note that the object returned by this method will be used as bean reference unless the post-processor returns a different wrapper from said post-process callbacks. In other words: Those post-process callbacks may either eventually expose the same reference or alternatively return the raw bean instance from those subsequent callbacks (if the wrapper for the affected bean has been built for a call to this method already, it will be exposes as final bean reference by default).

Specified by:
getEarlyBeanReference in interface SmartInstantiationAwareBeanPostProcessor
Parameters:
bean - the raw bean instance
beanName - the name of the bean
Returns:
the object to expose as bean reference (typically with the passed-in bean instance as default)
Throws:
BeansException - in case of errors

postProcessBeforeInstantiation

public Object postProcessBeforeInstantiation(Class beanClass,
                                             String beanName)
                                      throws BeansException
Description copied from interface: InstantiationAwareBeanPostProcessor
Apply this BeanPostProcessor before the target bean gets instantiated. The returned bean object may be a proxy to use instead of the target bean, effectively suppressing default instantiation of the target bean.

If a non-null object is returned by this method, the bean creation process will be short-circuited. The only further processing applied is the BeanPostProcessor.postProcessAfterInitialization(java.lang.Object, java.lang.String) callback from the configured BeanPostProcessors.

This callback will only be applied to bean definitions with a bean class. In particular, it will not be applied to beans with a "factory-method".

Post-processors may implement the extended SmartInstantiationAwareBeanPostProcessor interface in order to predict the type of the bean object that they are going to return here.

Specified by:
postProcessBeforeInstantiation in interface InstantiationAwareBeanPostProcessor
Parameters:
beanClass - the class of the bean to be instantiated
beanName - the name of the bean
Returns:
the bean object to expose instead of a default instance of the target bean, or null to proceed with default instantiation
Throws:
BeansException - in case of errors
See Also:
AbstractBeanDefinition.hasBeanClass(), AbstractBeanDefinition.getFactoryMethodName()

postProcessAfterInstantiation

public boolean postProcessAfterInstantiation(Object bean,
                                             String beanName)
                                      throws BeansException
Description copied from interface: InstantiationAwareBeanPostProcessor
Perform operations after the bean has been instantiated, via a constructor or factory method, but before Spring property population (from explicit properties or autowiring) occurs.

This is the ideal callback for performing field injection on the given bean instance. See Spring's own AutowiredAnnotationBeanPostProcessor for a typical example.

Specified by:
postProcessAfterInstantiation in interface InstantiationAwareBeanPostProcessor
Parameters:
bean - the bean instance created, with properties not having been set yet
beanName - the name of the bean
Returns:
true if properties should be set on the bean; false if property population should be skipped. Normal implementations should return true. Returning false will also prevent any subsequent InstantiationAwareBeanPostProcessor instances being invoked on this bean instance.
Throws:
BeansException - in case of errors

postProcessPropertyValues

public PropertyValues postProcessPropertyValues(PropertyValues pvs,
                                                PropertyDescriptor[] pds,
                                                Object bean,
                                                String beanName)
                                         throws BeansException
Description copied from interface: InstantiationAwareBeanPostProcessor
Post-process the given property values before the factory applies them to the given bean. Allows for checking whether all dependencies have been satisfied, for example based on a "Required" annotation on bean property setters.

Also allows for replacing the property values to apply, typically through creating a new MutablePropertyValues instance based on the original PropertyValues, adding or removing specific values.

Specified by:
postProcessPropertyValues in interface InstantiationAwareBeanPostProcessor
Parameters:
pvs - the property values that the factory is about to apply (never null)
pds - the relevant property descriptors for the target bean (with ignored dependency types - which the factory handles specifically - already filtered out)
bean - the bean instance created, but whose properties have not yet been set
beanName - the name of the bean
Returns:
the actual property values to apply to to the given bean (can be the passed-in PropertyValues instance), or null to skip property population
Throws:
BeansException - in case of errors
See Also:
MutablePropertyValues

postProcessBeforeInitialization

public Object postProcessBeforeInitialization(Object bean,
                                              String beanName)
                                       throws BeansException
Description copied from interface: BeanPostProcessor
Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

Specified by:
postProcessBeforeInitialization in interface BeanPostProcessor
Parameters:
bean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
Throws:
BeansException - in case of errors
See Also:
InitializingBean.afterPropertiesSet()

postProcessAfterInitialization

public Object postProcessAfterInitialization(Object bean,
                                             String beanName)
                                      throws BeansException
Description copied from interface: BeanPostProcessor
Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

In case of a FactoryBean, this callback will be invoked for both the FactoryBean instance and the objects created by the FactoryBean (as of Spring 2.0). The post-processor can decide whether to apply to either the FactoryBean or created objects or both through corresponding bean instanceof FactoryBean checks.

This callback will also be invoked after a short-circuiting triggered by a InstantiationAwareBeanPostProcessor.postProcessBeforeInstantiation(java.lang.Class, java.lang.String) method, in contrast to all other BeanPostProcessor callbacks.

Specified by:
postProcessAfterInitialization in interface BeanPostProcessor
Parameters:
bean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
Throws:
BeansException - in case of errors
See Also:
InitializingBean.afterPropertiesSet(), FactoryBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ListFactoryBean

org.springframework.beans.factory.config
Class ListFactoryBean

java.lang.Object
    extended by  org.springframework.beans.factory.config.AbstractFactoryBean<List>
        extended by  org.springframework.beans.factory.config.ListFactoryBean
All Implemented Interfaces:
BeanClassLoaderAware, BeanFactoryAware, DisposableBean, FactoryBean<List>, InitializingBean
public class ListFactoryBean
extends AbstractFactoryBean<List>

Simple factory for shared List instances. Allows for central setup of Lists via the "list" element in XML bean definitions.

Since:
09.12.2003
Author:
Juergen Hoeller
See Also:
SetFactoryBean, MapFactoryBean

Field Summary
Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
logger
Constructor Summary
ListFactoryBean()
Method Summary
protected List | createInstance() Template method that subclasses must override to construct the object returned by this factory.
Class<List> | getObjectType() This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.
void | setSourceList(List sourceList) Set the source List, typically populated via XML "list" elements.
void | setTargetListClass(Class targetListClass) Set the class to use for the target List.
Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ListFactoryBean

public ListFactoryBean()
Method Detail

setSourceList

public void setSourceList(List sourceList)
Set the source List, typically populated via XML "list" elements.

setTargetListClass

public void setTargetListClass(Class targetListClass)
Set the class to use for the target List. Can be populated with a fully qualified class name when defined in a Spring application context.

Default is a java.util.ArrayList.

See Also:
ArrayList

getObjectType

public Class<List> getObjectType()
Description copied from class: AbstractFactoryBean
This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.

Specified by:
getObjectType in interface FactoryBean<List>
Specified by:
getObjectType in class AbstractFactoryBean<List>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
FactoryBean.getObjectType()

createInstance

protected List createInstance()
Description copied from class: AbstractFactoryBean
Template method that subclasses must override to construct the object returned by this factory.

Invoked on initialization of this FactoryBean in case of a singleton; else, on each AbstractFactoryBean.getObject() call.

Specified by:
createInstance in class AbstractFactoryBean<List>
Returns:
the object returned by this factory
See Also:
AbstractFactoryBean.getObject()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MapFactoryBean

org.springframework.beans.factory.config
Class MapFactoryBean

java.lang.Object
    extended by  org.springframework.beans.factory.config.AbstractFactoryBean<Map>
        extended by  org.springframework.beans.factory.config.MapFactoryBean
All Implemented Interfaces:
BeanClassLoaderAware, BeanFactoryAware, DisposableBean, FactoryBean<Map>, InitializingBean
public class MapFactoryBean
extends AbstractFactoryBean<Map>

Simple factory for shared Map instances. Allows for central setup of Maps via the "map" element in XML bean definitions.

Since:
09.12.2003
Author:
Juergen Hoeller
See Also:
SetFactoryBean, ListFactoryBean

Field Summary
Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
logger
Constructor Summary
MapFactoryBean()
Method Summary
protected Map | createInstance() Template method that subclasses must override to construct the object returned by this factory.
Class<Map> | getObjectType() This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.
void | setSourceMap(Map sourceMap) Set the source Map, typically populated via XML "map" elements.
void | setTargetMapClass(Class targetMapClass) Set the class to use for the target Map.
Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MapFactoryBean

public MapFactoryBean()
Method Detail

setSourceMap

public void setSourceMap(Map sourceMap)
Set the source Map, typically populated via XML "map" elements.

setTargetMapClass

public void setTargetMapClass(Class targetMapClass)
Set the class to use for the target Map. Can be populated with a fully qualified class name when defined in a Spring application context.

Default is a linked HashMap, keeping the registration order.

See Also:
LinkedHashMap

getObjectType

public Class<Map> getObjectType()
Description copied from class: AbstractFactoryBean
This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.

Specified by:
getObjectType in interface FactoryBean<Map>
Specified by:
getObjectType in class AbstractFactoryBean<Map>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
FactoryBean.getObjectType()

createInstance

protected Map createInstance()
Description copied from class: AbstractFactoryBean
Template method that subclasses must override to construct the object returned by this factory.

Invoked on initialization of this FactoryBean in case of a singleton; else, on each AbstractFactoryBean.getObject() call.

Specified by:
createInstance in class AbstractFactoryBean<Map>
Returns:
the object returned by this factory
See Also:
AbstractFactoryBean.getObject()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MethodInvokingFactoryBean

org.springframework.beans.factory.config
Class MethodInvokingFactoryBean

java.lang.Object
    extended by  org.springframework.util.MethodInvoker
        extended by  org.springframework.beans.support.ArgumentConvertingMethodInvoker
            extended by  org.springframework.beans.factory.config.MethodInvokingFactoryBean
All Implemented Interfaces:
BeanClassLoaderAware, BeanFactoryAware, FactoryBean<Object>, InitializingBean
public class MethodInvokingFactoryBean
extends ArgumentConvertingMethodInvoker
implements FactoryBean<Object>, BeanClassLoaderAware, BeanFactoryAware, InitializingBean

FactoryBean which returns a value which is the result of a static or instance method invocation. For most use cases it is better to just use the container's built-in factory method support for the same purpose, since that is smarter at converting arguments. This factory bean is still useful though when you need to call a method which doesn't return any value (for example, a static class method to force some sort of initialization to happen). This use case is not supported by factory methods, since a return value is needed to obtain the bean instance.

Note that as it is expected to be used mostly for accessing factory methods, this factory by default operates in a singleton fashion. The first request to getObject() by the owning bean factory will cause a method invocation, whose return value will be cached for subsequent requests. An internal singleton property may be set to "false", to cause this factory to invoke the target method each time it is asked for an object.

A static target method may be specified by setting the targetMethod property to a String representing the static method name, with targetClass specifying the Class that the static method is defined on. Alternatively, a target instance method may be specified, by setting the targetObject property as the target object, and the targetMethod property as the name of the method to call on that target object. Arguments for the method invocation may be specified by setting the arguments property.

This class depends on afterPropertiesSet() being called once all properties have been set, as per the InitializingBean contract.

An example (in an XML based bean factory definition) of a bean definition which uses this class to call a static factory method:

 <bean id="myObject" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
   <property name="staticMethod"><value>com.whatever.MyClassFactory.getInstance</value></property>
 </bean>

An example of calling a static method then an instance method to get at a Java system property. Somewhat verbose, but it works.

 <bean id="sysProps" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
   <property name="targetClass"><value>java.lang.System</value></property>
   <property name="targetMethod"><value>getProperties</value></property>
 </bean>

 <bean id="javaVersion" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
   <property name="targetObject"><ref local="sysProps"/></property>
   <property name="targetMethod"><value>getProperty</value></property>
   <property name="arguments">
     <list>
       <value>java.version</value>
     </list>
   </property>
 </bean>

Since:
21.11.2003
Author:
Colin Sampaleanu, Juergen Hoeller

Constructor Summary
MethodInvokingFactoryBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected  TypeConverter getDefaultTypeConverter()
Obtain the TypeConverter from the BeanFactory that this bean runs in, if possible.
 Object getObject()
Returns the same value each time if the singleton property is set to "true", otherwise returns the value returned from invoking the specified method on the fly.
 Class<?> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
protected  Class resolveClassName(String className)
Resolve the given class name into a Class.
 void setBeanClassLoader(ClassLoader classLoader)
Callback that supplies the bean class loader to a bean instance.
 void setBeanFactory(BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance.
 void setSingleton(boolean singleton)
Set if a singleton should be created, or a new object on each request else.
Methods inherited from class org.springframework.beans.support.ArgumentConvertingMethodInvoker
doFindMatchingMethod, findMatchingMethod, getTypeConverter, registerCustomEditor, setTypeConverter
Methods inherited from class org.springframework.util.MethodInvoker
getArguments, getPreparedMethod, getTargetClass, getTargetMethod, getTargetObject, getTypeDifferenceWeight, invoke, isPrepared, prepare, setArguments, setStaticMethod, setTargetClass, setTargetMethod, setTargetObject
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MethodInvokingFactoryBean

public MethodInvokingFactoryBean()
Method Detail

setSingleton

public void setSingleton(boolean singleton)
Set if a singleton should be created, or a new object on each request else. Default is "true".

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<Object>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

resolveClassName

protected Class resolveClassName(String className)
                          throws ClassNotFoundException
Description copied from class: MethodInvoker
Resolve the given class name into a Class.

The default implementations uses ClassUtils.forName, using the thread context class loader.

Overrides:
resolveClassName in class MethodInvoker
Parameters:
className - the class name to resolve
Returns:
the resolved Class
Throws:
ClassNotFoundException - if the class name was invalid

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
BeanInitializationException

getDefaultTypeConverter

protected TypeConverter getDefaultTypeConverter()
Obtain the TypeConverter from the BeanFactory that this bean runs in, if possible.

Overrides:
getDefaultTypeConverter in class ArgumentConvertingMethodInvoker
See Also:
ConfigurableBeanFactory.getTypeConverter()

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception - in the event of misconfiguration (such as failure to set an essential property) or if initialization fails.

getObject

public Object getObject()
                 throws Exception
Returns the same value each time if the singleton property is set to "true", otherwise returns the value returned from invoking the specified method on the fly.

Specified by:
getObject in interface FactoryBean<Object>
Returns:
an instance of the bean (can be null)
Throws:
Exception - in case of creation errors
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<?> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.

Specified by:
getObjectType in interface FactoryBean<Object>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ObjectFactoryCreatingFactoryBean

org.springframework.beans.factory.config
Class ObjectFactoryCreatingFactoryBean

java.lang.Object
    extended by  org.springframework.beans.factory.config.AbstractFactoryBean<ObjectFactory>
        extended by  org.springframework.beans.factory.config.ObjectFactoryCreatingFactoryBean
All Implemented Interfaces:
BeanClassLoaderAware, BeanFactoryAware, DisposableBean, FactoryBean<ObjectFactory>, InitializingBean
public class ObjectFactoryCreatingFactoryBean
extends AbstractFactoryBean<ObjectFactory>

A FactoryBean implementation that returns a value which is an ObjectFactory that in turn returns a bean sourced from a BeanFactory.

As such, this may be used to avoid having a client object directly calling BeanFactory.getBean(String) to get a (typically prototype) bean from a BeanFactory, which would be a violation of the inversion of control principle. Instead, with the use of this class, the client object can be fed an ObjectFactory instance as a property which directly returns only the one target bean (again, which is typically a prototype bean).

A sample config in an XML-based BeanFactory might look as follows:

<beans>

   <!-- Prototype bean since we have state -->
   <bean id="myService" class="a.b.c.MyService" scope="prototype"/>

   <bean id="myServiceFactory"
       class="org.springframework.beans.factory.config.ObjectFactoryCreatingFactoryBean">
     <property name="targetBeanName"><idref local="myService"/></property>
   </bean>

   <bean id="clientBean" class="a.b.c.MyClientBean">
     <property name="myServiceFactory" ref="myServiceFactory"/>
   </bean>

</beans>

The attendant MyClientBean class implementation might look something like this:

package a.b.c;

 import org.springframework.beans.factory.ObjectFactory;

 public class MyClientBean {

   private ObjectFactory<MyService> myServiceFactory;

   public void setMyServiceFactory(ObjectFactory<MyService> myServiceFactory) {
     this.myServiceFactory = myServiceFactory;
   }

   public void someBusinessMethod() {
     // get a 'fresh', brand new MyService instance
     MyService service = this.myServiceFactory.getObject();
     // use the service object to effect the business logic...
   }
 }

An alternate approach to this application of an object creational pattern would be to use the ServiceLocatorFactoryBean to source (prototype) beans. The ServiceLocatorFactoryBean approach has the advantage of the fact that one doesn't have to depend on any Spring-specific interface such as ObjectFactory, but has the disadvantage of requiring runtime class generation. Please do consult the ServiceLocatorFactoryBean JavaDoc for a fuller discussion of this issue.

Since:
1.0.2
Author:
Colin Sampaleanu, Juergen Hoeller
See Also:
ObjectFactory, ServiceLocatorFactoryBean

Field Summary
Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
logger
Constructor Summary
ObjectFactoryCreatingFactoryBean()
Method Summary
void | afterPropertiesSet() Eagerly create the singleton instance, if necessary.
protected ObjectFactory | createInstance() Template method that subclasses must override to construct the object returned by this factory.
Class | getObjectType() This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.
void | setTargetBeanName(String targetBeanName) Set the name of the target bean.
Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ObjectFactoryCreatingFactoryBean

public ObjectFactoryCreatingFactoryBean()
Method Detail

setTargetBeanName

public void setTargetBeanName(String targetBeanName)
Set the name of the target bean.

The target does not have to be a non-singleton bean, but realisticially always will be (because if the target bean were a singleton, then said singleton bean could simply be injected straight into the dependent object, thus obviating the need for the extra level of indirection afforded by this factory approach).

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Description copied from class: AbstractFactoryBean
Eagerly create the singleton instance, if necessary.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class AbstractFactoryBean<ObjectFactory>
Throws:
Exception - in the event of misconfiguration (such as failure to set an essential property) or if initialization fails.

getObjectType

public Class getObjectType()
Description copied from class: AbstractFactoryBean
This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.

Specified by:
getObjectType in interface FactoryBean<ObjectFactory>
Specified by:
getObjectType in class AbstractFactoryBean<ObjectFactory>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
FactoryBean.getObjectType()

createInstance

protected ObjectFactory createInstance()
Description copied from class: AbstractFactoryBean
Template method that subclasses must override to construct the object returned by this factory.

Invoked on initialization of this FactoryBean in case of a singleton; else, on each AbstractFactoryBean.getObject() call.

Specified by:
createInstance in class AbstractFactoryBean<ObjectFactory>
Returns:
the object returned by this factory
See Also:
AbstractFactoryBean.getObject()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PreferencesPlaceholderConfigurer

org.springframework.beans.factory.config
Class PreferencesPlaceholderConfigurer

java.lang.Object
    extended by  org.springframework.core.io.support.PropertiesLoaderSupport
        extended by  org.springframework.beans.factory.config.PropertyResourceConfigurer
            extended by  org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
                extended by  org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer
All Implemented Interfaces:
BeanFactoryAware, BeanNameAware, BeanFactoryPostProcessor, InitializingBean, Ordered, PriorityOrdered
public class PreferencesPlaceholderConfigurer
extends PropertyPlaceholderConfigurer
implements InitializingBean

Subclass of PropertyPlaceholderConfigurer that supports JDK 1.4's Preferences API (java.util.prefs).

Tries to resolve placeholders as keys first in the user preferences, then in the system preferences, then in this configurer's properties. Thus, behaves like PropertyPlaceholderConfigurer if no corresponding preferences defined.

Supports custom paths for the system and user preferences trees. Also supports custom paths specified in placeholders ("myPath/myPlaceholderKey"). Uses the respective root node if not specified.

Since:
16.02.2004
Author:
Juergen Hoeller
See Also:
setSystemTreePath(java.lang.String), setUserTreePath(java.lang.String), Preferences

Field Summary
Fields inherited from class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
DEFAULT_PLACEHOLDER_PREFIX, DEFAULT_PLACEHOLDER_SUFFIX, DEFAULT_VALUE_SEPARATOR, SYSTEM_PROPERTIES_MODE_FALLBACK, SYSTEM_PROPERTIES_MODE_NEVER, SYSTEM_PROPERTIES_MODE_OVERRIDE
Fields inherited from class org.springframework.core.io.support.PropertiesLoaderSupport
logger, XML_FILE_EXTENSION
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
PreferencesPlaceholderConfigurer()
Method Summary
void | afterPropertiesSet() This implementation eagerly fetches the Preferences instances for the required system and user tree nodes.
protected String | resolvePlaceholder(String placeholder, Properties props) This implementation tries to resolve placeholders as keys first in the user preferences, then in the system preferences, then in the passed-in properties.
protected String | resolvePlaceholder(String path, String key, Preferences preferences) Resolve the given path and key against the given Preferences.
void | setSystemTreePath(String systemTreePath) Set the path in the system preferences tree to use for resolving placeholders.
void | setUserTreePath(String userTreePath) Set the path in the system preferences tree to use for resolving placeholders.
Methods inherited from class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
parseStringValue, processProperties, resolvePlaceholder, resolveSystemProperty, setBeanFactory, setBeanName, setIgnoreUnresolvablePlaceholders, setNullValue, setPlaceholderPrefix, setPlaceholderSuffix, setSearchSystemEnvironment, setSystemPropertiesMode, setSystemPropertiesModeName
Methods inherited from class org.springframework.beans.factory.config.PropertyResourceConfigurer
convertProperties, convertPropertyValue, getOrder, postProcessBeanFactory, setOrder
Methods inherited from class org.springframework.core.io.support.PropertiesLoaderSupport
loadProperties, mergeProperties, setFileEncoding, setIgnoreResourceNotFound, setLocalOverride, setLocation, setLocations, setProperties, setPropertiesArray, setPropertiesPersister
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PreferencesPlaceholderConfigurer

public PreferencesPlaceholderConfigurer()
Method Detail

setSystemTreePath

public void setSystemTreePath(String systemTreePath)
Set the path in the system preferences tree to use for resolving placeholders. Default is the root node.

setUserTreePath

public void setUserTreePath(String userTreePath)
Set the path in the system preferences tree to use for resolving placeholders. Default is the root node.

afterPropertiesSet

public void afterPropertiesSet()
This implementation eagerly fetches the Preferences instances for the required system and user tree nodes.

Specified by:
afterPropertiesSet in interface InitializingBean

resolvePlaceholder

protected String resolvePlaceholder(String placeholder,
                                    Properties props)
This implementation tries to resolve placeholders as keys first in the user preferences, then in the system preferences, then in the passed-in properties.

Overrides:
resolvePlaceholder in class PropertyPlaceholderConfigurer
Parameters:
placeholder - the placeholder to resolve
props - the merged properties of this configurer
Returns:
the resolved value, of null if none
See Also:
PropertyPlaceholderConfigurer.setSystemPropertiesMode(int)

resolvePlaceholder

protected String resolvePlaceholder(String path,
                                    String key,
                                    Preferences preferences)
Resolve the given path and key against the given Preferences.

Parameters:
path - the preferences path (placeholder part before '/')
key - the preferences key (placeholder part after '/')
preferences - the Preferences to resolve against
Returns:
the value for the placeholder, or null if none found
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertiesFactoryBean

org.springframework.beans.factory.config
Class PropertiesFactoryBean

java.lang.Object
    extended by  org.springframework.core.io.support.PropertiesLoaderSupport
        extended by  org.springframework.beans.factory.config.PropertiesFactoryBean
All Implemented Interfaces:
FactoryBean<Properties>, InitializingBean
public class PropertiesFactoryBean
extends PropertiesLoaderSupport
implements FactoryBean<Properties>, InitializingBean

Allows for making a properties file from a classpath location available as Properties instance in a bean factory. Can be used to populate any bean property of type Properties via a bean reference.

Supports loading from a properties file and/or setting local properties on this FactoryBean. The created Properties instance will be merged from loaded and local values. If neither a location nor local properties are set, an exception will be thrown on initialization.

Can create a singleton or a new object on each request. Default is a singleton.

Author:
Juergen Hoeller
See Also:
PropertiesLoaderSupport.setLocation(org.springframework.core.io.Resource),
PropertiesLoaderSupport.setProperties(java.util.Properties),
PropertiesLoaderSupport.setLocalOverride(boolean),
Properties

Field Summary
Fields inherited from class org.springframework.core.io.support.PropertiesLoaderSupport
logger, XML_FILE_EXTENSION
Constructor Summary
PropertiesFactoryBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 Properties getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<Properties> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setSingleton(boolean singleton)
Set whether a shared 'singleton' Properties instance should be created, or rather a new Properties instance on each request.
Methods inherited from class org.springframework.core.io.support.PropertiesLoaderSupport
loadProperties, mergeProperties, setFileEncoding, setIgnoreResourceNotFound, setLocalOverride, setLocation, setLocations, setProperties, setPropertiesArray, setPropertiesPersister
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PropertiesFactoryBean

public PropertiesFactoryBean()
Method Detail

setSingleton

public final void setSingleton(boolean singleton)
Set whether a shared 'singleton' Properties instance should be created, or rather a new Properties instance on each request.

Default is "true" (a shared singleton).

isSingleton

public final boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<Properties>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()

afterPropertiesSet

public final void afterPropertiesSet()
                              throws IOException
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
IOException

getObject

public final Properties getObject()
                           throws IOException
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<Properties>
Returns:
an instance of the bean (can be null)
Throws:
IOException
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<Properties> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<Properties>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertyOverrideConfigurer

org.springframework.beans.factory.config
Class PropertyOverrideConfigurer

java.lang.Object
    extended by  org.springframework.core.io.support.PropertiesLoaderSupport
        extended by  org.springframework.beans.factory.config.PropertyResourceConfigurer
            extended by  org.springframework.beans.factory.config.PropertyOverrideConfigurer
All Implemented Interfaces:
BeanFactoryPostProcessor, Ordered, PriorityOrdered
public class PropertyOverrideConfigurer
extends PropertyResourceConfigurer

Property resource configurer that overrides bean property values in an application context definition. It pushes values from a properties file into bean definitions.

Configuration lines are expected to be of the following form:

beanName.property=value
Example properties file:
dataSource.driverClassName=com.mysql.jdbc.Driver
 dataSource.url=jdbc:mysql:mydb
In contrast to PropertyPlaceholderConfigurer, the original definition can have default values or no values at all for such bean properties. If an overriding properties file does not have an entry for a certain bean property, the default context definition is used.

Note that the context definition is not aware of being overridden; so this is not immediately obvious when looking at the XML definition file. Furthermore, note that specified override values are always literal values; they are not translated into bean references. This also applies when the original value in the XML bean definition specifies a bean reference.

In case of multiple PropertyOverrideConfigurers that define different values for the same bean property, the last one will win (due to the overriding mechanism).

Property values can be converted after reading them in, through overriding the convertPropertyValue method. For example, encrypted values can be detected and decrypted accordingly before processing them.

Since:
12.03.2003
Author:
Juergen Hoeller, Rod Johnson
See Also:
PropertyResourceConfigurer.convertPropertyValue(java.lang.String), PropertyPlaceholderConfigurer

Field Summary
static String DEFAULT_BEAN_NAME_SEPARATOR
Fields inherited from class org.springframework.core.io.support.PropertiesLoaderSupport
logger, XML_FILE_EXTENSION
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
PropertyOverrideConfigurer()
Method Summary
protected void | applyPropertyValue(ConfigurableListableBeanFactory factory, String beanName, String property, String value) Apply the given property value to the corresponding bean.
boolean | hasPropertyOverridesFor(String beanName) Were there overrides for this bean? Only valid after processing has occurred at least once.
protected void | processKey(ConfigurableListableBeanFactory factory, String key, String value) Process the given key as 'beanName.property' entry.
protected void | processProperties(ConfigurableListableBeanFactory beanFactory, Properties props) Apply the given Properties to the given BeanFactory.
void | setBeanNameSeparator(String beanNameSeparator) Set the separator to expect between bean name and property path.
void | setIgnoreInvalidKeys(boolean ignoreInvalidKeys) Set whether to ignore invalid keys.
Methods inherited from class org.springframework.beans.factory.config.PropertyResourceConfigurer
convertProperties, convertPropertyValue, getOrder, postProcessBeanFactory, setOrder
Methods inherited from class org.springframework.core.io.support.PropertiesLoaderSupport
loadProperties, mergeProperties, setFileEncoding, setIgnoreResourceNotFound, setLocalOverride, setLocation, setLocations, setProperties, setPropertiesArray, setPropertiesPersister
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_BEAN_NAME_SEPARATOR

public static final String DEFAULT_BEAN_NAME_SEPARATOR
See Also:
Constant Field Values
Constructor Detail

PropertyOverrideConfigurer

public PropertyOverrideConfigurer()
Method Detail

setBeanNameSeparator

public void setBeanNameSeparator(String beanNameSeparator)
Set the separator to expect between bean name and property path. Default is a dot (".").

setIgnoreInvalidKeys

public void setIgnoreInvalidKeys(boolean ignoreInvalidKeys)
Set whether to ignore invalid keys. Default is "false".

If you ignore invalid keys, keys that do not follow the 'beanName.property' format (or refer to invalid bean names or properties) will just be logged at debug level. This allows one to have arbitrary other keys in a properties file.

processProperties

protected void processProperties(ConfigurableListableBeanFactory beanFactory,
                                 Properties props)
                          throws BeansException
Description copied from class: PropertyResourceConfigurer
Apply the given Properties to the given BeanFactory.

Specified by:
processProperties in class PropertyResourceConfigurer
Parameters:
beanFactory - the BeanFactory used by the application context
props - the Properties to apply
Throws:
BeansException - in case of errors

processKey

protected void processKey(ConfigurableListableBeanFactory factory,
                          String key,
                          String value)
                   throws BeansException
Process the given key as 'beanName.property' entry.

Throws:
BeansException

applyPropertyValue

protected void applyPropertyValue(ConfigurableListableBeanFactory factory,
                                  String beanName,
                                  String property,
                                  String value)
Apply the given property value to the corresponding bean.

hasPropertyOverridesFor

public boolean hasPropertyOverridesFor(String beanName)
Were there overrides for this bean? Only valid after processing has occurred at least once.

Parameters:
beanName - name of the bean to query status for
Returns:
whether there were property overrides for the named bean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertyPathFactoryBean

org.springframework.beans.factory.config
Class PropertyPathFactoryBean

java.lang.Object
    extended by  org.springframework.beans.factory.config.PropertyPathFactoryBean
All Implemented Interfaces:
BeanFactoryAware, BeanNameAware, FactoryBean<Object>
public class PropertyPathFactoryBean
extends Object
implements FactoryBean<Object>, BeanNameAware, BeanFactoryAware

FactoryBean that evaluates a property path on a given target object.

The target object can be specified directly or via a bean name.

Usage examples:

<!-- target bean to be referenced by name -->
 <bean id="tb" class="org.springframework.beans.TestBean" singleton="false">
   <property name="age" value="10"/>
   <property name="spouse">
     <bean class="org.springframework.beans.TestBean">
       <property name="age" value="11"/>
     </bean>
   </property>
 </bean>

 <!-- will result in 12, which is the value of property 'age' of the inner bean -->
 <bean id="propertyPath1" class="org.springframework.beans.factory.config.PropertyPathFactoryBean">
   <property name="targetObject">
     <bean class="org.springframework.beans.TestBean">
       <property name="age" value="12"/>
     </bean>
   </property>
   <property name="propertyPath" value="age"/>
 </bean>

 <!-- will result in 11, which is the value of property 'spouse.age' of bean 'tb' -->
 <bean id="propertyPath2" class="org.springframework.beans.factory.config.PropertyPathFactoryBean">
   <property name="targetBeanName" value="tb"/>
   <property name="propertyPath" value="spouse.age"/>
 </bean>

 <!-- will result in 10, which is the value of property 'age' of bean 'tb' -->
 <bean id="tb.age" class="org.springframework.beans.factory.config.PropertyPathFactoryBean"/>

If you are using Spring 2.0 and XML Schema support in your configuration file(s), you can also use the following style of configuration for property path access. (See also the appendix entitled 'XML Schema-based configuration' in the Spring reference manual for more examples.)

 <!-- will result in 10, which is the value of property 'age' of bean 'tb' -->
 <util:property-path id="name" path="testBean.age"/>
Thanks to Matthias Ernst for the suggestion and initial prototype!

Since:
1.1.2
Author:
Juergen Hoeller
See Also:
setTargetObject(java.lang.Object),
setTargetBeanName(java.lang.String),
setPropertyPath(java.lang.String)

Constructor Summary
PropertyPathFactoryBean()
Method Summary
 Object getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<?> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
While this FactoryBean will often be used for singleton targets, the invoked getters for the property path might return a new object for each call, so we have to assume that we're not returning the same object for each getObject() call.
 void setBeanFactory(BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance.
 void setBeanName(String beanName)
The bean name of this PropertyPathFactoryBean will be interpreted as "beanName.property" pattern, if neither "targetObject" nor "targetBeanName" nor "propertyPath" have been specified.
 void setPropertyPath(String propertyPath)
Specify the property path to apply to the target.
 void setResultType(Class resultType)
Specify the type of the result from evaluating the property path.
 void setTargetBeanName(String targetBeanName)
Specify the name of a target bean to apply the property path to.
 void setTargetObject(Object targetObject)
Specify a target object to apply the property path to.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PropertyPathFactoryBean

public PropertyPathFactoryBean()
Method Detail

setTargetObject

public void setTargetObject(Object targetObject)
Specify a target object to apply the property path to. Alternatively, specify a target bean name.

Parameters:
targetObject - a target object, for example a bean reference or an inner bean
See Also:
setTargetBeanName(java.lang.String)

setTargetBeanName

public void setTargetBeanName(String targetBeanName)
Specify the name of a target bean to apply the property path to. Alternatively, specify a target object directly.

Parameters:
targetBeanName - the bean name to be looked up in the containing bean factory (e.g. "testBean")
See Also:
setTargetObject(java.lang.Object)

setPropertyPath

public void setPropertyPath(String propertyPath)
Specify the property path to apply to the target.

Parameters:
propertyPath - the property path, potentially nested (e.g. "age" or "spouse.age")

setResultType

public void setResultType(Class resultType)
Specify the type of the result from evaluating the property path.

Note: This is not necessary for directly specified target objects or singleton target beans, where the type can be determined through introspection. Just specify this in case of a prototype target, provided that you need matching by type (for example, for autowiring).

Parameters:
resultType - the result type, for example "java.lang.Integer"

setBeanName

public void setBeanName(String beanName)
The bean name of this PropertyPathFactoryBean will be interpreted as "beanName.property" pattern, if neither "targetObject" nor "targetBeanName" nor "propertyPath" have been specified. This allows for concise bean definitions with just an id/name.

Specified by:
setBeanName in interface BeanNameAware
Parameters:
beanName - the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use the BeanFactoryUtils.originalBeanName(String) method to extract the original bean name (without suffix), if desired.

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
BeanInitializationException

getObject

public Object getObject()
                 throws BeansException
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<Object>
Returns:
an instance of the bean (can be null)
Throws:
BeansException
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<?> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<Object>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
While this FactoryBean will often be used for singleton targets, the invoked getters for the property path might return a new object for each call, so we have to assume that we're not returning the same object for each getObject() call.

Specified by:
isSingleton in interface FactoryBean<Object>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertyPlaceholderConfigurer

org.springframework.beans.factory.config
Class PropertyPlaceholderConfigurer

java.lang.Object
    extended by  org.springframework.core.io.support.PropertiesLoaderSupport
        extended by  org.springframework.beans.factory.config.PropertyResourceConfigurer
            extended by  org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
All Implemented Interfaces:
BeanFactoryAware, BeanNameAware, BeanFactoryPostProcessor, Ordered, PriorityOrdered
Direct Known Subclasses:
PreferencesPlaceholderConfigurer, ServletContextPropertyPlaceholderConfigurer
public class PropertyPlaceholderConfigurer
extends PropertyResourceConfigurer
implements BeanNameAware, BeanFactoryAware

A property resource configurer that resolves placeholders in bean property values of context definitions. It pulls values from a properties file into bean definitions.

The default placeholder syntax follows the Ant / Log4J / JSP EL style:

${...}
Example XML context definition:
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
   <property name="driverClassName"><value>${driver}</value></property>
   <property name="url"><value>jdbc:${dbname}</value></property>
 </bean>
Example properties file:
driver=com.mysql.jdbc.Driver
 dbname=mysql:mydb
PropertyPlaceholderConfigurer checks simple property values, lists, maps, props, and bean names in bean references. Furthermore, placeholder values can also cross-reference other placeholders, like:
rootPath=myrootdir
 subPath=${rootPath}/subdir
In contrast to PropertyOverrideConfigurer, this configurer allows to fill in explicit placeholders in context definitions. Therefore, the original definition cannot specify any default values for such bean properties, and the placeholder properties file is supposed to contain an entry for each defined placeholder.

If a configurer cannot resolve a placeholder, a BeanDefinitionStoreException will be thrown. If you want to check against multiple properties files, specify multiple resources via the "locations" setting. You can also define multiple PropertyPlaceholderConfigurers, each with its own placeholder syntax.

Default property values can be defined via "properties", to make overriding definitions in properties files optional. A configurer will also check against system properties (e.g. "user.dir") if it cannot resolve a placeholder with any of the specified properties. This can be customized via "systemPropertiesMode".

Note that the context definition is aware of being incomplete; this is immediately obvious to users when looking at the XML definition file. Hence, placeholders have to be resolved; any desired defaults have to be defined as placeholder values as well (for example in a default properties file).

Property values can be converted after reading them in, through overriding the PropertyResourceConfigurer.convertPropertyValue(java.lang.String) method. For example, encrypted values can be detected and decrypted accordingly before processing them.

Since:
02.10.2003
Author:
Juergen Hoeller
See Also:
PropertiesLoaderSupport.setLocations(org.springframework.core.io.Resource[]),
PropertiesLoaderSupport.setProperties(java.util.Properties),
setPlaceholderPrefix(java.lang.String),
setPlaceholderSuffix(java.lang.String),
setSystemPropertiesModeName(java.lang.String),
System.getProperty(String),
PropertyResourceConfigurer.convertPropertyValue(java.lang.String),
PropertyOverrideConfigurer

Field Summary
static String | DEFAULT_PLACEHOLDER_PREFIX Default placeholder prefix: "${"
static String | DEFAULT_PLACEHOLDER_SUFFIX Default placeholder suffix: "}"
static String | DEFAULT_VALUE_SEPARATOR Default value separator: ":"
static int | SYSTEM_PROPERTIES_MODE_FALLBACK Check system properties if not resolvable in the specified properties.
static int | SYSTEM_PROPERTIES_MODE_NEVER Never check system properties.
static int | SYSTEM_PROPERTIES_MODE_OVERRIDE Check system properties first, before trying the specified properties.
Fields inherited from class org.springframework.core.io.support.PropertiesLoaderSupport
logger, XML_FILE_EXTENSION
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
PropertyPlaceholderConfigurer()
Method Summary
protected  String parseStringValue(String strVal, Properties props, Set visitedPlaceholders)
Deprecated. as of Spring 3.0, in favor of using resolvePlaceholder(java.lang.String, java.util.Properties, int) with PropertyPlaceholderHelper. Only retained for compatibility with Spring 2.5 extensions.
protected  void processProperties(ConfigurableListableBeanFactory beanFactoryToProcess, Properties props)
Apply the given Properties to the given BeanFactory.
protected  String resolvePlaceholder(String placeholder, Properties props)
Resolve the given placeholder using the given properties.
protected  String resolvePlaceholder(String placeholder, Properties props, int systemPropertiesMode)
Resolve the given placeholder using the given properties, performing a system properties check according to the given mode.
protected  String resolveSystemProperty(String key)
Resolve the given key as JVM system property, and optionally also as system environment variable if no matching system property has been found.
 void setBeanFactory(BeanFactory beanFactory)
Only necessary to check that we're not parsing our own bean definition, to avoid failing on unresolvable placeholders in properties file locations.
 void setBeanName(String beanName)
Only necessary to check that we're not parsing our own bean definition, to avoid failing on unresolvable placeholders in properties file locations.
 void setIgnoreUnresolvablePlaceholders(boolean ignoreUnresolvablePlaceholders)
Set whether to ignore unresolvable placeholders.
 void setNullValue(String nullValue)
Set a value that should be treated as null when resolved as a placeholder value: e.g.
 void setPlaceholderPrefix(String placeholderPrefix)
Set the prefix that a placeholder string starts with.
 void setPlaceholderSuffix(String placeholderSuffix)
Set the suffix that a placeholder string ends with.
 void setSearchSystemEnvironment(boolean searchSystemEnvironment)
Set whether to search for a matching system environment variable if no matching system property has been found.
 void setSystemPropertiesMode(int systemPropertiesMode)
Set how to check system properties: as fallback, as override, or never.
 void setSystemPropertiesModeName(String constantName)
Set the system property mode by the name of the corresponding constant, e.g.
Methods inherited from class org.springframework.beans.factory.config.PropertyResourceConfigurer
convertProperties, convertPropertyValue, getOrder, postProcessBeanFactory, setOrder
Methods inherited from class org.springframework.core.io.support.PropertiesLoaderSupport
loadProperties, mergeProperties, setFileEncoding, setIgnoreResourceNotFound, setLocalOverride, setLocation, setLocations, setProperties, setPropertiesArray, setPropertiesPersister
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_PLACEHOLDER_PREFIX

public static final String DEFAULT_PLACEHOLDER_PREFIX
Default placeholder prefix: "${"

See Also:
Constant Field Values

DEFAULT_PLACEHOLDER_SUFFIX

public static final String DEFAULT_PLACEHOLDER_SUFFIX
Default placeholder suffix: "}"

See Also:
Constant Field Values

DEFAULT_VALUE_SEPARATOR

public static final String DEFAULT_VALUE_SEPARATOR
Default value separator: ":"

See Also:
Constant Field Values

SYSTEM_PROPERTIES_MODE_NEVER

public static final int SYSTEM_PROPERTIES_MODE_NEVER
Never check system properties.

See Also:
Constant Field Values

SYSTEM_PROPERTIES_MODE_FALLBACK

public static final int SYSTEM_PROPERTIES_MODE_FALLBACK
Check system properties if not resolvable in the specified properties. This is the default.

See Also:
Constant Field Values

SYSTEM_PROPERTIES_MODE_OVERRIDE

public static final int SYSTEM_PROPERTIES_MODE_OVERRIDE
Check system properties first, before trying the specified properties. This allows system properties to override any other property source.

See Also:
Constant Field Values
Constructor Detail

PropertyPlaceholderConfigurer

public PropertyPlaceholderConfigurer()
Method Detail

setPlaceholderPrefix

public void setPlaceholderPrefix(String placeholderPrefix)
Set the prefix that a placeholder string starts with. The default is "${".

See Also:
DEFAULT_PLACEHOLDER_PREFIX

setPlaceholderSuffix

public void setPlaceholderSuffix(String placeholderSuffix)
Set the suffix that a placeholder string ends with. The default is "}".

See Also:
DEFAULT_PLACEHOLDER_SUFFIX

setSystemPropertiesModeName

public void setSystemPropertiesModeName(String constantName)
                                 throws IllegalArgumentException
Set the system property mode by the name of the corresponding constant, e.g. "SYSTEM_PROPERTIES_MODE_OVERRIDE".

Parameters:
constantName - name of the constant
Throws:
IllegalArgumentException - if an invalid constant was specified
See Also:
setSystemPropertiesMode(int)

setSystemPropertiesMode

public void setSystemPropertiesMode(int systemPropertiesMode)
Set how to check system properties: as fallback, as override, or never. For example, will resolve ${user.dir} to the "user.dir" system property.

The default is "fallback": If not being able to resolve a placeholder with the specified properties, a system property will be tried. "override" will check for a system property first, before trying the specified properties. "never" will not check system properties at all.

See Also:
SYSTEM_PROPERTIES_MODE_NEVER, SYSTEM_PROPERTIES_MODE_FALLBACK, SYSTEM_PROPERTIES_MODE_OVERRIDE, setSystemPropertiesModeName(java.lang.String)

setSearchSystemEnvironment

public void setSearchSystemEnvironment(boolean searchSystemEnvironment)
Set whether to search for a matching system environment variable if no matching system property has been found. Only applied when "systemPropertyMode" is active (i.e. "fallback" or "override"), right after checking JVM system properties.

Default is "true". Switch this setting off to never resolve placeholders against system environment variables. Note that it is generally recommended to pass external values in as JVM system properties: This can easily be achieved in a startup script, even for existing environment variables.

NOTE: Access to environment variables does not work on the Sun VM 1.4, where the corresponding System.getenv(java.lang.String) support was disabled - before it eventually got re-enabled for the Sun VM 1.5. Please upgrade to 1.5 (or higher) if you intend to rely on the environment variable support.

See Also:
setSystemPropertiesMode(int), System.getProperty(String), System.getenv(String)

setIgnoreUnresolvablePlaceholders

public void setIgnoreUnresolvablePlaceholders(boolean ignoreUnresolvablePlaceholders)
Set whether to ignore unresolvable placeholders. Default is "false": An exception will be thrown if a placeholder cannot be resolved.

setNullValue

public void setNullValue(String nullValue)
Set a value that should be treated as null when resolved as a placeholder value: e.g. "" (empty String) or "null".

Note that this will only apply to full property values, not to parts of concatenated values.

By default, no such null value is defined. This means that there is no way to express null as a property value unless you explictly map a corresponding value here.

setBeanName

public void setBeanName(String beanName)
Only necessary to check that we're not parsing our own bean definition, to avoid failing on unresolvable placeholders in properties file locations. The latter case can happen with placeholders for system properties in resource locations.

Specified by:
setBeanName in interface BeanNameAware
Parameters:
beanName - the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use the BeanFactoryUtils.originalBeanName(String) method to extract the original bean name (without suffix), if desired.
See Also:
PropertiesLoaderSupport.setLocations(org.springframework.core.io.Resource[]), ResourceEditor

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Only necessary to check that we're not parsing our own bean definition, to avoid failing on unresolvable placeholders in properties file locations. The latter case can happen with placeholders for system properties in resource locations.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
PropertiesLoaderSupport.setLocations(org.springframework.core.io.Resource[]), ResourceEditor

processProperties

protected void processProperties(ConfigurableListableBeanFactory beanFactoryToProcess,
                                 Properties props)
                          throws BeansException
Description copied from class: PropertyResourceConfigurer
Apply the given Properties to the given BeanFactory.

Specified by:
processProperties in class PropertyResourceConfigurer
Parameters:
beanFactoryToProcess - the BeanFactory used by the application context
props - the Properties to apply
Throws:
BeansException - in case of errors

resolvePlaceholder

protected String resolvePlaceholder(String placeholder,
                                    Properties props,
                                    int systemPropertiesMode)
Resolve the given placeholder using the given properties, performing a system properties check according to the given mode.

Default implementation delegates to resolvePlaceholder (placeholder, props) before/after the system properties check.

Subclasses can override this for custom resolution strategies, including customized points for the system properties check.

Parameters:
placeholder - the placeholder to resolve
props - the merged properties of this configurer
systemPropertiesMode - the system properties mode, according to the constants in this class
Returns:
the resolved value, of null if none
See Also:
setSystemPropertiesMode(int), System.getProperty(java.lang.String), resolvePlaceholder(String, java.util.Properties)

resolvePlaceholder

protected String resolvePlaceholder(String placeholder,
                                    Properties props)
Resolve the given placeholder using the given properties. The default implementation simply checks for a corresponding property key.

Subclasses can override this for customized placeholder-to-key mappings or custom resolution strategies, possibly just using the given properties as fallback.

Note that system properties will still be checked before respectively after this method is invoked, according to the system properties mode.

Parameters:
placeholder - the placeholder to resolve
props - the merged properties of this configurer
Returns:
the resolved value, of null if none
See Also:
setSystemPropertiesMode(int)

resolveSystemProperty

protected String resolveSystemProperty(String key)
Resolve the given key as JVM system property, and optionally also as system environment variable if no matching system property has been found.

Parameters:
key - the placeholder to resolve as system property key
Returns:
the system property value, or null if not found
See Also:
setSearchSystemEnvironment(boolean), System.getProperty(String), System.getenv(String)

parseStringValue

@Deprecated
protected String parseStringValue(String strVal,
                                             Properties props,
                                             Set visitedPlaceholders)
Deprecated. as of Spring 3.0, in favor of using resolvePlaceholder(java.lang.String, java.util.Properties, int) with PropertyPlaceholderHelper. Only retained for compatibility with Spring 2.5 extensions.

Parse the given String value for placeholder resolution.

Parameters:
strVal - the String value to parse
props - the Properties to resolve placeholders against
visitedPlaceholders - the placeholders that have already been visited during the current resolution attempt (ignored in this version of the code)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertyResourceConfigurer

org.springframework.beans.factory.config
Class PropertyResourceConfigurer

java.lang.Object
    extended by  org.springframework.core.io.support.PropertiesLoaderSupport
        extended by  org.springframework.beans.factory.config.PropertyResourceConfigurer
All Implemented Interfaces:
BeanFactoryPostProcessor, Ordered, PriorityOrdered
Direct Known Subclasses:
PropertyOverrideConfigurer, PropertyPlaceholderConfigurer
public abstract class PropertyResourceConfigurer
extends PropertiesLoaderSupport
implements BeanFactoryPostProcessor, PriorityOrdered

Allows for configuration of individual bean property values from a property resource, i.e. a properties file. Useful for custom config files targeted at system administrators that override bean properties configured in the application context.

Two concrete implementations are provided in the distribution:

  • PropertyOverrideConfigurer for "beanName.property=value" style overriding (pushing values from a properties file into bean definitions)
  • PropertyPlaceholderConfigurer for replacing "${...}" placeholders (pulling values from a properties file into bean definitions)

Property values can be converted after reading them in, through overriding the convertPropertyValue(java.lang.String) method. For example, encrypted values can be detected and decrypted accordingly before processing them.

Since:
02.10.2003
Author:
Juergen Hoeller
See Also:
PropertyOverrideConfigurer, PropertyPlaceholderConfigurer

Field Summary
Fields inherited from class org.springframework.core.io.support.PropertiesLoaderSupport
logger, XML_FILE_EXTENSION
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
PropertyResourceConfigurer()
Method Summary
protected void | convertProperties(Properties props) Convert the given merged properties, converting property values if necessary.
protected String | convertPropertyValue(String originalValue) Convert the given property value from the properties source to the value that should be applied.
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
void | postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) Modify the application context's internal bean factory after its standard initialization.
protected abstract void | processProperties(ConfigurableListableBeanFactory beanFactory, Properties props) Apply the given Properties to the given BeanFactory.
void | setOrder(int order)
Methods inherited from class org.springframework.core.io.support.PropertiesLoaderSupport
loadProperties, mergeProperties, setFileEncoding, setIgnoreResourceNotFound, setLocalOverride, setLocation, setLocations, setProperties, setPropertiesArray, setPropertiesPersister
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PropertyResourceConfigurer

public PropertyResourceConfigurer()
Method Detail

setOrder

public void setOrder(int order)

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

postProcessBeanFactory

public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
                            throws BeansException
Description copied from interface: BeanFactoryPostProcessor
Modify the application context's internal bean factory after its standard initialization. All bean definitions will have been loaded, but no beans will have been instantiated yet. This allows for overriding or adding properties even to eager-initializing beans.

Specified by:
postProcessBeanFactory in interface BeanFactoryPostProcessor
Parameters:
beanFactory - the bean factory used by the application context
Throws:
BeansException - in case of errors

convertProperties

protected void convertProperties(Properties props)
Convert the given merged properties, converting property values if necessary. The result will then be processed.

The default implementation will invoke convertPropertyValue(java.lang.String) for each property value, replacing the original with the converted value.

Parameters:
props - the Properties to convert
See Also:
processProperties(org.springframework.beans.factory.config.ConfigurableListableBeanFactory, java.util.Properties)

convertPropertyValue

protected String convertPropertyValue(String originalValue)
Convert the given property value from the properties source to the value that should be applied.

The default implementation simply returns the original value. Can be overridden in subclasses, for example to detect encrypted values and decrypt them accordingly.

Parameters:
originalValue - the original value from the properties source (properties file or local "properties")
Returns:
the converted value, to be used for processing
See Also:
PropertiesLoaderSupport.setProperties(java.util.Properties),
PropertiesLoaderSupport.setLocations(org.springframework.core.io.Resource[]),
PropertiesLoaderSupport.setLocation(org.springframework.core.io.Resource)

processProperties

protected abstract void processProperties(ConfigurableListableBeanFactory beanFactory,
                                          Properties props)
                                   throws BeansException
Apply the given Properties to the given BeanFactory.

Parameters:
beanFactory - the BeanFactory used by the application context
props - the Properties to apply
Throws:
BeansException - in case of errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ProviderCreatingFactoryBean

org.springframework.beans.factory.config
Class ProviderCreatingFactoryBean

java.lang.Object
    extended by  org.springframework.beans.factory.config.AbstractFactoryBean<javax.inject.Provider>
        extended by  org.springframework.beans.factory.config.ProviderCreatingFactoryBean
All Implemented Interfaces:
BeanClassLoaderAware, BeanFactoryAware, DisposableBean, FactoryBean<javax.inject.Provider>, InitializingBean
public class ProviderCreatingFactoryBean
extends AbstractFactoryBean<javax.inject.Provider>

A FactoryBean implementation that returns a value which is a JSR-330 Provider that in turn returns a bean sourced from a BeanFactory.

This is basically a JSR-330 compliant variant of Spring's good old ObjectFactoryCreatingFactoryBean. It can be used for traditional external dependency injection configuration that targets a property or constructor argument of type javax.inject.Provider, as an alternative to JSR-330's @Inject annotation-driven approach.

Since:
3.0.2
Author:
Juergen Hoeller
See Also:
Provider, ObjectFactoryCreatingFactoryBean

Field Summary
Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
logger
Constructor Summary
ProviderCreatingFactoryBean()
Method Summary
void | afterPropertiesSet() Eagerly create the singleton instance, if necessary.
protected javax.inject.Provider | createInstance() Template method that subclasses must override to construct the object returned by this factory.
Class | getObjectType() This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.
void | setTargetBeanName(String targetBeanName) Set the name of the target bean.
Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ProviderCreatingFactoryBean

public ProviderCreatingFactoryBean()
Method Detail

setTargetBeanName

public void setTargetBeanName(String targetBeanName)
Set the name of the target bean.

The target does not have to be a non-singleton bean, but realisticially always will be (because if the target bean were a singleton, then said singleton bean could simply be injected straight into the dependent object, thus obviating the need for the extra level of indirection afforded by this factory approach).

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Description copied from class: AbstractFactoryBean
Eagerly create the singleton instance, if necessary.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class AbstractFactoryBean<javax.inject.Provider>
Throws:
Exception - in the event of misconfiguration (such as failure to set an essential property) or if initialization fails.

getObjectType

public Class getObjectType()
Description copied from class: AbstractFactoryBean
This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.

Specified by:
getObjectType in interface FactoryBean<javax.inject.Provider>
Specified by:
getObjectType in class AbstractFactoryBean<javax.inject.Provider>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
FactoryBean.getObjectType()

createInstance

protected javax.inject.Provider createInstance()
Description copied from class: AbstractFactoryBean
Template method that subclasses must override to construct the object returned by this factory.

Invoked on initialization of this FactoryBean in case of a singleton; else, on each AbstractFactoryBean.getObject() call.

Specified by:
createInstance in class AbstractFactoryBean<javax.inject.Provider>
Returns:
the object returned by this factory
See Also:
AbstractFactoryBean.getObject()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RuntimeBeanNameReference

org.springframework.beans.factory.config
Class RuntimeBeanNameReference

java.lang.Object
    extended by  org.springframework.beans.factory.config.RuntimeBeanNameReference
All Implemented Interfaces:
BeanMetadataElement, BeanReference
public class RuntimeBeanNameReference
extends Object
implements BeanReference

Immutable placeholder class used for a property value object when it's a reference to another bean name in the factory, to be resolved at runtime.

Since:
2.0
Author:
Juergen Hoeller
See Also:
RuntimeBeanReference, BeanDefinition.getPropertyValues(), BeanFactory.getBean(java.lang.String)

Constructor Summary
RuntimeBeanNameReference(String beanName)
Create a new RuntimeBeanNameReference to the given bean name.
Method Summary
boolean | equals(Object other)
String | getBeanName() Return the target bean name that this reference points to (never null).
Object | getSource() Return the configuration source Object for this metadata element (may be null).
int | hashCode()
void | setSource(Object source) Set the configuration source Object for this metadata element.
String | toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

RuntimeBeanNameReference

public RuntimeBeanNameReference(String beanName)
Create a new RuntimeBeanNameReference to the given bean name.

Parameters:
beanName - name of the target bean
Method Detail

getBeanName

public String getBeanName()
Description copied from interface: BeanReference
Return the target bean name that this reference points to (never null).

Specified by:
getBeanName in interface BeanReference

setSource

public void setSource(Object source)
Set the configuration source Object for this metadata element.

The exact type of the object will depend on the configuration mechanism used.

getSource

public Object getSource()
Description copied from interface: BeanMetadataElement
Return the configuration source Object for this metadata element (may be null).

Specified by:
getSource in interface BeanMetadataElement

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RuntimeBeanReference

org.springframework.beans.factory.config
Class RuntimeBeanReference

java.lang.Object
    extended by  org.springframework.beans.factory.config.RuntimeBeanReference
All Implemented Interfaces:
BeanMetadataElement, BeanReference
public class RuntimeBeanReference
extends Object
implements BeanReference

Immutable placeholder class used for a property value object when it's a reference to another bean in the factory, to be resolved at runtime.

Author:
Rod Johnson, Juergen Hoeller
See Also:
BeanDefinition.getPropertyValues(), BeanFactory.getBean(java.lang.String)

Constructor Summary
RuntimeBeanReference(String beanName)
Create a new RuntimeBeanReference to the given bean name, without explicitly marking it as reference to a bean in the parent factory.
RuntimeBeanReference(String beanName, boolean toParent)
Create a new RuntimeBeanReference to the given bean name, with the option to mark it as reference to a bean in the parent factory.
Method Summary
boolean | equals(Object other)
String | getBeanName() Return the target bean name that this reference points to (never null).
Object | getSource() Return the configuration source Object for this metadata element (may be null).
int | hashCode()
boolean | isToParent() Return whether this is an explicit reference to a bean in the parent factory.
void | setSource(Object source) Set the configuration source Object for this metadata element.
String | toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

RuntimeBeanReference

public RuntimeBeanReference(String beanName)
Create a new RuntimeBeanReference to the given bean name, without explicitly marking it as reference to a bean in the parent factory.

Parameters:
beanName - name of the target bean

RuntimeBeanReference

public RuntimeBeanReference(String beanName,
                            boolean toParent)
Create a new RuntimeBeanReference to the given bean name, with the option to mark it as reference to a bean in the parent factory.

Parameters:
beanName - name of the target bean
toParent - whether this is an explicit reference to a bean in the parent factory
Method Detail

getBeanName

public String getBeanName()
Description copied from interface: BeanReference
Return the target bean name that this reference points to (never null).

Specified by:
getBeanName in interface BeanReference

isToParent

public boolean isToParent()
Return whether this is an explicit reference to a bean in the parent factory.

setSource

public void setSource(Object source)
Set the configuration source Object for this metadata element.

The exact type of the object will depend on the configuration mechanism used.

getSource

public Object getSource()
Description copied from interface: BeanMetadataElement
Return the configuration source Object for this metadata element (may be null).

Specified by:
getSource in interface BeanMetadataElement

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServiceLocatorFactoryBean

org.springframework.beans.factory.config
Class ServiceLocatorFactoryBean

java.lang.Object
    extended by  org.springframework.beans.factory.config.ServiceLocatorFactoryBean
All Implemented Interfaces:
BeanFactoryAware, FactoryBean<Object>, InitializingBean
public class ServiceLocatorFactoryBean
extends Object
implements FactoryBean<Object>, BeanFactoryAware, InitializingBean

A FactoryBean implementation that takes an interface which must have one or more methods with the signatures MyType xxx() or MyType xxx(MyIdType id) (typically, MyService getService() or MyService getService(String id)) and creates a dynamic proxy which implements that interface, delegating to an underlying BeanFactory.

Such service locators permit the decoupling of calling code from the BeanFactory API, by using an appropriate custom locator interface. They will typically be used for prototype beans, i.e. for factory methods that are supposed to return a new instance for each call. The client receives a reference to the service locator via setter or constructor injection, to be able to invoke the locator's factory methods on demand. For singleton beans, direct setter or constructor injection of the target bean is preferable.

On invocation of the no-arg factory method, or the single-arg factory method with a String id of null or empty String, if exactly one bean in the factory matches the return type of the factory method, that bean is returned, otherwise a NoSuchBeanDefinitionException is thrown.

On invocation of the single-arg factory method with a non-null (and non-empty) argument, the proxy returns the result of a BeanFactory.getBean(String) call, using a stringified version of the passed-in id as bean name.

A factory method argument will usually be a String, but can also be an int or a custom enumeration type, for example, stringified via toString. The resulting String can be used as bean name as-is, provided that corresponding beans are defined in the bean factory. Alternatively, a custom mapping between service ids and bean names can be defined.

By way of an example, consider the following service locator interface. Note that this interface is not dependant on any Spring APIs.

package a.b.c;

public interface ServiceFactory {

    public MyService getService ();
}

A sample config in an XML-based BeanFactory might look as follows:

<beans>

   <!-- Prototype bean since we have state -->
   <bean id="myService" class="a.b.c.MyService" singleton="false"/>

   <!-- will lookup the above 'myService' bean by *TYPE* -->
   <bean id="myServiceFactory"
            class="org.springframework.beans.factory.config.ServiceLocatorFactoryBean">
     <property name="serviceLocatorInterface" value="a.b.c.ServiceFactory"/>
   </bean>

   <bean id="clientBean" class="a.b.c.MyClientBean">
     <property name="myServiceFactory" ref="myServiceFactory"/>
   </bean>

</beans>

The attendant MyClientBean class implementation might then look something like this:

package a.b.c;

public class MyClientBean {

    private ServiceFactory myServiceFactory;

    // actual implementation provided by the Spring container
    public void setServiceFactory(ServiceFactory myServiceFactory) {
        this.myServiceFactory = myServiceFactory;
    }

    public void someBusinessMethod() {
        // get a 'fresh', brand new MyService instance
        MyService service = this.myServiceFactory.getService();
        // use the service object to effect the business logic...
    }
}

By way of an example that looks up a bean by name, consider the following service locator interface. Again, note that this interface is not dependant on any Spring APIs.

package a.b.c;

public interface ServiceFactory {

    public MyService getService (String serviceName);
}

A sample config in an XML-based BeanFactory might look as follows:

<beans>

   <!-- Prototype beans since we have state (both extend MyService) -->
   <bean id="specialService" class="a.b.c.SpecialService" singleton="false"/>
   <bean id="anotherService" class="a.b.c.AnotherService" singleton="false"/>

   <bean id="myServiceFactory"
            class="org.springframework.beans.factory.config.ServiceLocatorFactoryBean">
     <property name="serviceLocatorInterface" value="a.b.c.ServiceFactory"/>
   </bean>

   <bean id="clientBean" class="a.b.c.MyClientBean">
     <property name="myServiceFactory" ref="myServiceFactory"/>
   </bean>

</beans>

The attendant MyClientBean class implementation might then look something like this:

package a.b.c;

public class MyClientBean {

    private ServiceFactory myServiceFactory;

    // actual implementation provided by the Spring container
    public void setServiceFactory(ServiceFactory myServiceFactory) {
        this.myServiceFactory = myServiceFactory;
    }

    public void someBusinessMethod() {
        // get a 'fresh', brand new MyService instance
        MyService service = this.myServiceFactory.getService("specialService");
        // use the service object to effect the business logic...
    }

    public void anotherBusinessMethod() {
        // get a 'fresh', brand new MyService instance
        MyService service = this.myServiceFactory.getService("anotherService");
        // use the service object to effect the business logic...
    }
}

See ObjectFactoryCreatingFactoryBean for an alternate approach.

Since:
1.1.4
Author:
Colin Sampaleanu, Juergen Hoeller
See Also:
setServiceLocatorInterface(java.lang.Class), setServiceMappings(java.util.Properties), ObjectFactoryCreatingFactoryBean

Constructor Summary
ServiceLocatorFactoryBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected  Exception createServiceLocatorException(Constructor exceptionConstructor, BeansException cause)
Create a service locator exception for the given cause.
protected  Constructor determineServiceLocatorExceptionConstructor(Class exceptionClass)
Determine the constructor to use for the given service locator exception class.
 Object getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<?> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setBeanFactory(BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance.
 void setServiceLocatorExceptionClass(Class serviceLocatorExceptionClass)
Set the exception class that the service locator should throw if service lookup failed.
 void setServiceLocatorInterface(Class interfaceType)
Set the service locator interface to use, which must have one or more methods with the signatures MyType xxx() or MyType xxx(MyIdType id) (typically, MyService getService() or MyService getService(String id)).
 void setServiceMappings(Properties serviceMappings)
Set mappings between service ids (passed into the service locator) and bean names (in the bean factory).
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ServiceLocatorFactoryBean

public ServiceLocatorFactoryBean()
Method Detail

setServiceLocatorInterface

public void setServiceLocatorInterface(Class interfaceType)
Set the service locator interface to use, which must have one or more methods with the signatures MyType xxx() or MyType xxx(MyIdType id) (typically, MyService getService() or MyService getService(String id)). See the class-level Javadoc for information on the semantics of such methods.

setServiceLocatorExceptionClass

public void setServiceLocatorExceptionClass(Class serviceLocatorExceptionClass)
Set the exception class that the service locator should throw if service lookup failed. The specified exception class must have a constructor with one of the following parameter types: (String, Throwable) or (Throwable) or (String).

If not specified, subclasses of Spring's BeansException will be thrown, for example NoSuchBeanDefinitionException. As those are unchecked, the caller does not need to handle them, so it might be acceptable that Spring exceptions get thrown as long as they are just handled generically.

See Also:
determineServiceLocatorExceptionConstructor(java.lang.Class), createServiceLocatorException(java.lang.reflect.Constructor, org.springframework.beans.BeansException)

setServiceMappings

public void setServiceMappings(Properties serviceMappings)
Set mappings between service ids (passed into the service locator) and bean names (in the bean factory). Service ids that are not defined here will be treated as bean names as-is.

The empty string as service id key defines the mapping for null and empty string, and for factory methods without parameter. If not defined, a single matching bean will be retrieved from the bean factory.

Parameters:
serviceMappings - mappings between service ids and bean names, with service ids as keys as bean names as values

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
                    throws BeansException
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
Throws:
BeansException - in case of initialization errors
See Also:
BeanInitializationException

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

determineServiceLocatorExceptionConstructor

protected Constructor determineServiceLocatorExceptionConstructor(Class exceptionClass)
Determine the constructor to use for the given service locator exception class. Only called in case of a custom service locator exception.

The default implementation looks for a constructor with one of the following parameter types: (String, Throwable) or (Throwable) or (String).

Parameters:
exceptionClass - the exception class
Returns:
the constructor to use
See Also:
setServiceLocatorExceptionClass(java.lang.Class)

createServiceLocatorException

protected Exception createServiceLocatorException(Constructor exceptionConstructor,
                                                  BeansException cause)
Create a service locator exception for the given cause. Only called in case of a custom service locator exception.

The default implementation can handle all variations of message and exception arguments.

Parameters:
exceptionConstructor - the constructor to use
cause - the cause of the service lookup failure
Returns:
the service locator exception to throw
See Also:
setServiceLocatorExceptionClass(java.lang.Class)

getObject

public Object getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<Object>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<?> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<Object>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<Object>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SetFactoryBean

org.springframework.beans.factory.config
Class SetFactoryBean

java.lang.Object
    extended by  org.springframework.beans.factory.config.AbstractFactoryBean<Set>
        extended by  org.springframework.beans.factory.config.SetFactoryBean
All Implemented Interfaces:
BeanClassLoaderAware, BeanFactoryAware, DisposableBean, FactoryBean<Set>, InitializingBean
public class SetFactoryBean
extends AbstractFactoryBean<Set>

Simple factory for shared Set instances. Allows for central setup of Sets via the "set" element in XML bean definitions.

Since:
09.12.2003
Author:
Juergen Hoeller
See Also:
ListFactoryBean, MapFactoryBean

Field Summary
Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
logger
Constructor Summary
SetFactoryBean()
Method Summary
protected Set | createInstance() Template method that subclasses must override to construct the object returned by this factory.
Class<Set> | getObjectType() This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.
void | setSourceSet(Set sourceSet) Set the source Set, typically populated via XML "set" elements.
void | setTargetSetClass(Class targetSetClass) Set the class to use for the target Set.
Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SetFactoryBean

public SetFactoryBean()
Method Detail

setSourceSet

public void setSourceSet(Set sourceSet)
Set the source Set, typically populated via XML "set" elements.

setTargetSetClass

public void setTargetSetClass(Class targetSetClass)
Set the class to use for the target Set. Can be populated with a fully qualified class name when defined in a Spring application context.

Default is a linked HashSet, keeping the registration order.

See Also:
LinkedHashSet

getObjectType

public Class<Set> getObjectType()
Description copied from class: AbstractFactoryBean
This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.

Specified by:
getObjectType in interface FactoryBean<Set>
Specified by:
getObjectType in class AbstractFactoryBean<Set>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
FactoryBean.getObjectType()

createInstance

protected Set createInstance()
Description copied from class: AbstractFactoryBean
Template method that subclasses must override to construct the object returned by this factory.

Invoked on initialization of this FactoryBean in case of a singleton; else, on each AbstractFactoryBean.getObject() call.

Specified by:
createInstance in class AbstractFactoryBean<Set>
Returns:
the object returned by this factory
See Also:
AbstractFactoryBean.getObject()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TypedStringValue

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.beans.factory.config
Class TypedStringValue

java.lang.Object
    extended by  org.springframework.beans.factory.config.TypedStringValue
All Implemented Interfaces:
BeanMetadataElement
public class TypedStringValue
extends Object
implements BeanMetadataElement

Holder for a typed String value. Can be added to bean definitions in order to explicitly specify a target type for a String value, for example for collection elements.

This holder will just store the String value and the target type. The actual conversion will be performed by the bean factory.

Since:
1.2
Author:
Juergen Hoeller
See Also:
BeanDefinition.getPropertyValues(), MutablePropertyValues.addPropertyValue(org.springframework.beans.PropertyValue)

Constructor Summary
TypedStringValue(String value)
Create a new TypedStringValue for the given String value.
TypedStringValue(String value, Class targetType)
Create a new TypedStringValue for the given String value and target type.
TypedStringValue(String value, String targetTypeName)
Create a new TypedStringValue for the given String value and target type.
Method Summary
boolean | equals(Object other)
Object | getSource() Return the configuration source Object for this metadata element (may be null).
String | getSpecifiedTypeName() Return the type name as actually specified for this particular value, if any.
Class | getTargetType() Return the type to convert to.
String | getTargetTypeName() Return the type to convert to.
String | getValue() Return the String value.
int | hashCode()
boolean | hasTargetType() Return whether this typed String value carries a target type .
boolean | isDynamic() Return whether this value has been marked as dynamic.
Class | resolveTargetType(ClassLoader classLoader) Determine the type to convert to, resolving it from a specified class name if necessary.
void | setDynamic() Mark this value as dynamic, i.e.
void | setSource(Object source) Set the configuration source Object for this metadata element.
void | setSpecifiedTypeName(String specifiedTypeName) Set the type name as actually specified for this particular value, if any.
void | setTargetType(Class targetType) Set the type to convert to.
void | setTargetTypeName(String targetTypeName) Specify the type to convert to.
void | setValue(String value) Set the String value.
String | toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

TypedStringValue

public TypedStringValue(String value)
Create a new TypedStringValue for the given String value.

Parameters:
value - the String value

TypedStringValue

public TypedStringValue(String value,
                        Class targetType)
Create a new TypedStringValue for the given String value and target type.

Parameters:
value - the String value
targetType - the type to convert to

TypedStringValue

public TypedStringValue(String value,
                        String targetTypeName)
Create a new TypedStringValue for the given String value and target type.

Parameters:
value - the String value
targetTypeName - the type to convert to
Method Detail

setValue

public void setValue(String value)
Set the String value.

Only necessary for manipulating a registered value, for example in BeanFactoryPostProcessors.

See Also:
PropertyPlaceholderConfigurer

getValue

public String getValue()
Return the String value.

setTargetType

public void setTargetType(Class targetType)
Set the type to convert to.

Only necessary for manipulating a registered value, for example in BeanFactoryPostProcessors.

See Also:
PropertyPlaceholderConfigurer

getTargetType

public Class getTargetType()
Return the type to convert to.

setTargetTypeName

public void setTargetTypeName(String targetTypeName)
Specify the type to convert to.

getTargetTypeName

public String getTargetTypeName()
Return the type to convert to.

hasTargetType

public boolean hasTargetType()
Return whether this typed String value carries a target type .

resolveTargetType

public Class resolveTargetType(ClassLoader classLoader)
                        throws ClassNotFoundException
Determine the type to convert to, resolving it from a specified class name if necessary. Will also reload a specified Class from its name when called with the target type already resolved.

Parameters:
classLoader - the ClassLoader to use for resolving a (potential) class name
Returns:
the resolved type to convert to
Throws:
ClassNotFoundException - if the type cannot be resolved

setSource

public void setSource(Object source)
Set the configuration source Object for this metadata element.

The exact type of the object will depend on the configuration mechanism used.

getSource

public Object getSource()
Description copied from interface: BeanMetadataElement
Return the configuration source Object for this metadata element (may be null).

Specified by:
getSource in interface BeanMetadataElement

setSpecifiedTypeName

public void setSpecifiedTypeName(String specifiedTypeName)
Set the type name as actually specified for this particular value, if any.

getSpecifiedTypeName

public String getSpecifiedTypeName()
Return the type name as actually specified for this particular value, if any.

setDynamic

public void setDynamic()
Mark this value as dynamic, i.e. as containing an expression and hence not being subject to caching.

isDynamic

public boolean isDynamic()
Return whether this value has been marked as dynamic.

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.beans.factory.parsing

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.beans.factory.parsing

Support infrastructure for bean definition parsing.

See:
Description

Interface Summary
ComponentDefinition | Interface that describes the logical view of a set of BeanDefinitions and BeanReferences as presented in some configuration context.
DefaultsDefinition | Marker interface for a defaults definition, extending BeanMetadataElement to inherit source exposure.
ParseState.Entry | Marker interface for entries into the ParseState.
ProblemReporter | SPI interface allowing tools and other external processes to handle errors and warnings reported during bean definition parsing.
ReaderEventListener | Interface that receives callbacks for component, alias and import registrations during a bean definition reading process.
SourceExtractor | Simple strategy allowing tools to control how source metadata is attached to the bean definition metadata.

Class Summary
AbstractComponentDefinition | Base implementation of ComponentDefinition that provides a basic implementation of AbstractComponentDefinition.getDescription() which delegates to ComponentDefinition.getName().
AliasDefinition | Representation of an alias that has been registered during the parsing process.
BeanComponentDefinition | ComponentDefinition based on a standard BeanDefinition, exposing the given bean definition as well as inner bean definitions and bean references for the given bean.
BeanEntry | ParseState entry representing a bean definition.
CompositeComponentDefinition | ComponentDefinition implementation that holds one or more nested ComponentDefinition instances, aggregating them into a named group of components.
ConstructorArgumentEntry | ParseState entry representing a (possibly indexed) constructor argument.
EmptyReaderEventListener | Empty implementation of the ReaderEventListener interface, providing no-op implementations of all callback methods.
FailFastProblemReporter | Simple ProblemReporter implementation that exhibits fail-fast behavior when errors are encountered.
ImportDefinition | Representation of an import that has been processed during the parsing process.
Location | Class that models an arbitrary location in a resource.
NullSourceExtractor | Simple implementation of SourceExtractor that returns null as the source metadata.
ParseState | Simple Stack-based structure for tracking the logical position during a parsing process.
PassThroughSourceExtractor | Simple SourceExtractor implementation that just passes the candidate source metadata object through for attachment.
Problem | Represents a problem with a bean definition configuration.
PropertyEntry | ParseState entry representing a JavaBean property.
QualifierEntry | ParseState entry representing an autowire candidate qualifier.
ReaderContext | Context that gets passed along a bean definition reading process, encapsulating all relevant configuration as well as state.

Exception Summary
BeanDefinitionParsingException Exception thrown when a bean definition reader encounters an error during the parsing process.

Package org.springframework.beans.factory.parsing Description

Support infrastructure for bean definition parsing.


org.springframework.beans.factory.parsing Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.beans.factory.parsing

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.beans.factory.parsing.AbstractComponentDefinition (implements org.springframework.beans.factory.parsing.ComponentDefinition)
      • org.springframework.beans.factory.parsing.CompositeComponentDefinition
    • org.springframework.beans.factory.parsing.AliasDefinition (implements org.springframework.beans.BeanMetadataElement)
    • org.springframework.beans.factory.config.BeanDefinitionHolder (implements org.springframework.beans.BeanMetadataElement)
      • org.springframework.beans.factory.parsing.BeanComponentDefinition (implements org.springframework.beans.factory.parsing.ComponentDefinition)
    • org.springframework.beans.factory.parsing.BeanEntry (implements org.springframework.beans.factory.parsing.ParseState.Entry)
    • org.springframework.beans.factory.parsing.ConstructorArgumentEntry (implements org.springframework.beans.factory.parsing.ParseState.Entry)
    • org.springframework.beans.factory.parsing.EmptyReaderEventListener (implements org.springframework.beans.factory.parsing.ReaderEventListener)
    • org.springframework.beans.factory.parsing.FailFastProblemReporter (implements org.springframework.beans.factory.parsing.ProblemReporter)
    • org.springframework.beans.factory.parsing.ImportDefinition (implements org.springframework.beans.BeanMetadataElement)
    • org.springframework.beans.factory.parsing.Location
    • org.springframework.beans.factory.parsing.NullSourceExtractor (implements org.springframework.beans.factory.parsing.SourceExtractor)
    • org.springframework.beans.factory.parsing.ParseState
    • org.springframework.beans.factory.parsing.PassThroughSourceExtractor (implements org.springframework.beans.factory.parsing.SourceExtractor)
    • org.springframework.beans.factory.parsing.Problem
    • org.springframework.beans.factory.parsing.PropertyEntry (implements org.springframework.beans.factory.parsing.ParseState.Entry)
    • org.springframework.beans.factory.parsing.QualifierEntry (implements org.springframework.beans.factory.parsing.ParseState.Entry)
    • org.springframework.beans.factory.parsing.ReaderContext
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.beans.BeansException
              • org.springframework.beans.FatalBeanException
                • org.springframework.beans.factory.BeanDefinitionStoreException
                  • org.springframework.beans.factory.parsing.BeanDefinitionParsingException

Interface Hierarchy

  • org.springframework.beans.BeanMetadataElement
    • org.springframework.beans.factory.parsing.ComponentDefinition
    • org.springframework.beans.factory.parsing.DefaultsDefinition
  • java.util.EventListener
    • org.springframework.beans.factory.parsing.ReaderEventListener
  • org.springframework.beans.factory.parsing.ParseState.Entry
  • org.springframework.beans.factory.parsing.ProblemReporter
  • org.springframework.beans.factory.parsing.SourceExtractor


ComponentDefinition

org.springframework.beans.factory.parsing
Interface ComponentDefinition

All Superinterfaces:
BeanMetadataElement
All Known Implementing Classes:
AbstractComponentDefinition, AdvisorComponentDefinition, AspectComponentDefinition, BeanComponentDefinition, CompositeComponentDefinition, PointcutComponentDefinition
public interface ComponentDefinition
extends BeanMetadataElement

Interface that describes the logical view of a set of BeanDefinitions and BeanReferences as presented in some configuration context.

With the introduction of pluggable custom XML tags, it is now possible for a single logical configuration entity, in this case an XML tag, to create multiple BeanDefinitions and RuntimeBeanReferences in order to provide more succinct configuration and greater convenience to end users. As such, it can no longer be assumed that each configuration entity (e.g. XML tag) maps to one BeanDefinition. For tool vendors and other users who wish to present visualization or support for configuring Spring applications it is important that there is some mechanism in place to tie the BeanDefinitions in the BeanFactory back to the configuration data in a way that has concrete meaning to the end user. As such, NamespaceHandler implementations are able to publish events in the form of a ComponentDefinition for each logical entity being configured. Third parties can then subscribe to these events, allowing for a user-centric view of the bean metadata.

Each ComponentDefinition has a source object which is configuration-specific. In the case of XML-based configuration this is typically the Node which contains the user supplied configuration information. In addition to this, each BeanDefinition enclosed in a ComponentDefinition has its own source object which may point to a different, more specific, set of configuration data. Beyond this, individual pieces of bean metadata such as the PropertyValues may also have a source object giving an even greater level of detail. Source object extraction is handled through the SourceExtractor which can be customized as required.

Whilst direct access to important BeanReferences is provided through getBeanReferences(), tools may wish to inspect all BeanDefinitions to gather the full set of BeanReferences. Implementations are required to provide all BeanReferences that are required to validate the configuration of the overall logical entity as well as those required to provide full user visualisation of the configuration. It is expected that certain BeanReferences will not be important to validation or to the user view of the configuration and as such these may be ommitted. A tool may wish to display any additional BeanReferences sourced through the supplied BeanDefinitions but this is not considered to be a typical case.

Tools can determine the important of contained BeanDefinitions by checking the role identifier. The role is essentially a hint to the tool as to how important the configuration provider believes a BeanDefinition is to the end user. It is expected that tools will not display all BeanDefinitions for a given ComponentDefinition choosing instead to filter based on the role. Tools may choose to make this filtering user configurable. Particular notice should be given to the INFRASTRUCTURE role identifier. BeanDefinitions classified with this role are completely unimportant to the end user and are required only for internal implementation reasons.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
See Also:
AbstractComponentDefinition, CompositeComponentDefinition, BeanComponentDefinition, ReaderEventListener.componentRegistered(ComponentDefinition)

Method Summary
BeanDefinition[] | getBeanDefinitions() Return the BeanDefinitions that were registered to form this ComponentDefinition.
BeanReference[] | getBeanReferences() Return the set of BeanReferences that are considered to be important to this ComponentDefinition.
String | getDescription() Return a friendly description of the described component.
BeanDefinition[] | getInnerBeanDefinitions() Return the BeanDefinitions that represent all relevant inner beans within this component.
String | getName() Get the user-visible name of this ComponentDefinition.
Methods inherited from interface org.springframework.beans.BeanMetadataElement
getSource

Method Detail

getName

String getName()
Get the user-visible name of this ComponentDefinition.

This should link back directly to the corresponding configuration data for this component in a given context.

getDescription

String getDescription()
Return a friendly description of the described component.

Implementations are encouraged to return the same value from toString().

getBeanDefinitions

BeanDefinition[] getBeanDefinitions()
Return the BeanDefinitions that were registered to form this ComponentDefinition.

It should be noted that a ComponentDefinition may well be related with other BeanDefinitions via references, however these are not included as they may be not available immediately. Important BeanReferences are available from getBeanReferences().

Returns:
the array of BeanDefinitions, or an empty array if none

getInnerBeanDefinitions

BeanDefinition[] getInnerBeanDefinitions()
Return the BeanDefinitions that represent all relevant inner beans within this component.

Other inner beans may exist within the associated BeanDefinitions, however these are not considered to be needed for validation or for user visualization.

Returns:
the array of BeanDefinitions, or an empty array if none

getBeanReferences

BeanReference[] getBeanReferences()
Return the set of BeanReferences that are considered to be important to this ComponentDefinition.

Other BeanReferences may exist within the associated BeanDefinitions, however these are not considered to be needed for validation or for user visualization.

Returns:
the array of BeanReferences, or an empty array if none
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultsDefinition

org.springframework.beans.factory.parsing
Interface DefaultsDefinition

All Superinterfaces:
BeanMetadataElement
All Known Implementing Classes:
DocumentDefaultsDefinition
public interface DefaultsDefinition
extends BeanMetadataElement

Marker interface for a defaults definition, extending BeanMetadataElement to inherit source exposure.

Concrete implementations are typically based on 'document defaults', for example specified at the root tag level within an XML document.

Since:
2.0.2
Author:
Juergen Hoeller
See Also:
DocumentDefaultsDefinition, ReaderEventListener.defaultsRegistered(DefaultsDefinition)

Method Summary
Methods inherited from interface org.springframework.beans.BeanMetadataElement
getSource

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ProblemReporter

org.springframework.beans.factory.parsing
Interface ProblemReporter

All Known Implementing Classes:
FailFastProblemReporter
public interface ProblemReporter

SPI interface allowing tools and other external processes to handle errors and warnings reported during bean definition parsing.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
See Also:
Problem

Method Summary
void | error(Problem problem) Called when an error is encountered during the parsing process.
void | fatal(Problem problem) Called when a fatal error is encountered during the parsing process.
void | warning(Problem problem) Called when a warning is raised during the parsing process.

Method Detail

fatal

void fatal(Problem problem)
Called when a fatal error is encountered during the parsing process.

Implementations must treat the given problem as fatal, i.e. they have to eventually raise an exception.

Parameters:
problem - the source of the error (never null)

error

void error(Problem problem)
Called when an error is encountered during the parsing process.

Implementations may choose to treat errors as fatal.

Parameters:
problem - the source of the error (never null)

warning

void warning(Problem problem)
Called when a warning is raised during the parsing process.

Warnings are never considered to be fatal.

Parameters:
problem - the source of the warning (never null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ReaderEventListener

org.springframework.beans.factory.parsing
Interface ReaderEventListener

All Superinterfaces:
EventListener
All Known Implementing Classes:
EmptyReaderEventListener
public interface ReaderEventListener
extends EventListener

Interface that receives callbacks for component, alias and import registrations during a bean definition reading process.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
See Also:
ReaderContext

Method Summary
void | aliasRegistered(AliasDefinition aliasDefinition) Notification that the given alias has been registered.
void | componentRegistered(ComponentDefinition componentDefinition) Notification that the given component has been registered.
void | defaultsRegistered(DefaultsDefinition defaultsDefinition) Notification that the given defaults has been registered.
void | importProcessed(ImportDefinition importDefinition) Notification that the given import has been processed.

Method Detail

defaultsRegistered

void defaultsRegistered(DefaultsDefinition defaultsDefinition)
Notification that the given defaults has been registered.

Parameters:
defaultsDefinition - a descriptor for the defaults
See Also:
DocumentDefaultsDefinition

componentRegistered

void componentRegistered(ComponentDefinition componentDefinition)
Notification that the given component has been registered.

Parameters:
componentDefinition - a descriptor for the new component
See Also:
BeanComponentDefinition

aliasRegistered

void aliasRegistered(AliasDefinition aliasDefinition)
Notification that the given alias has been registered.

Parameters:
aliasDefinition - a descriptor for the new alias

importProcessed

void importProcessed(ImportDefinition importDefinition)
Notification that the given import has been processed.

Parameters:
importDefinition - a descriptor for the import
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SourceExtractor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.beans.factory.parsing
Interface SourceExtractor

All Known Implementing Classes:
NullSourceExtractor, PassThroughSourceExtractor
public interface SourceExtractor

Simple strategy allowing tools to control how source metadata is attached to the bean definition metadata.

Configuration parsers may provide the ability to attach source metadata during the parse phase. They will offer this metadata in a generic format which can be further modified by a SourceExtractor before being attached to the bean definition metadata.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
See Also:
BeanMetadataElement.getSource(), BeanDefinition

Method Summary
 Object extractSource(Object sourceCandidate, Resource definingResource)
Extract the source metadata from the candidate object supplied by the configuration parser.

Method Detail

extractSource

Object extractSource(Object sourceCandidate,
                     Resource definingResource)
Extract the source metadata from the candidate object supplied by the configuration parser.

Parameters:
sourceCandidate - the original source metadata (never null)
definingResource - the resource that defines the given source object (may be null)
Returns:
the source metadata object to store (may be null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractComponentDefinition

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.beans.factory.parsing
Class AbstractComponentDefinition

java.lang.Object
    extended by  org.springframework.beans.factory.parsing.AbstractComponentDefinition
All Implemented Interfaces:
BeanMetadataElement, ComponentDefinition
Direct Known Subclasses:
AdvisorComponentDefinition, CompositeComponentDefinition, PointcutComponentDefinition
public abstract class AbstractComponentDefinition
extends Object
implements ComponentDefinition

Base implementation of ComponentDefinition that provides a basic implementation of getDescription() which delegates to ComponentDefinition.getName(). Also provides a base implementation of toString() which delegates to getDescription() in keeping with the recommended implementation strategy. Also provides default implementations of getInnerBeanDefinitions() and getBeanReferences() that return an empty array.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller

Constructor Summary
AbstractComponentDefinition()
Method Summary
 BeanDefinition[] getBeanDefinitions()
Returns an empty array.
 BeanReference[] getBeanReferences()
Returns an empty array.
 String getDescription()
Delegates to ComponentDefinition.getName().
 BeanDefinition[] getInnerBeanDefinitions()
Returns an empty array.
 String toString()
Delegates to getDescription().
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.parsing.ComponentDefinition
getName
Methods inherited from interface org.springframework.beans.BeanMetadataElement
getSource

Constructor Detail

AbstractComponentDefinition

public AbstractComponentDefinition()
Method Detail

getDescription

public String getDescription()
Delegates to ComponentDefinition.getName().

Specified by:
getDescription in interface ComponentDefinition

getBeanDefinitions

public BeanDefinition[] getBeanDefinitions()
Returns an empty array.

Specified by:
getBeanDefinitions in interface ComponentDefinition
Returns:
the array of BeanDefinitions, or an empty array if none

getInnerBeanDefinitions

public BeanDefinition[] getInnerBeanDefinitions()
Returns an empty array.

Specified by:
getInnerBeanDefinitions in interface ComponentDefinition
Returns:
the array of BeanDefinitions, or an empty array if none

getBeanReferences

public BeanReference[] getBeanReferences()
Returns an empty array.

Specified by:
getBeanReferences in interface ComponentDefinition
Returns:
the array of BeanReferences, or an empty array if none

toString

public String toString()
Delegates to getDescription().

Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AliasDefinition

org.springframework.beans.factory.parsing
Class AliasDefinition

java.lang.Object
    extended by  org.springframework.beans.factory.parsing.AliasDefinition
All Implemented Interfaces:
BeanMetadataElement
public class AliasDefinition
extends Object
implements BeanMetadataElement

Representation of an alias that has been registered during the parsing process.

Since:
2.0
Author:
Juergen Hoeller
See Also:
ReaderEventListener.aliasRegistered(AliasDefinition)

Constructor Summary
AliasDefinition(String beanName, String alias)
Create a new AliasDefinition.
AliasDefinition(String beanName, String alias, Object source)
Create a new AliasDefinition.
Method Summary
String | getAlias() Return the alias registered for the bean.
String | getBeanName() Return the canonical name of the bean.
Object | getSource() Return the configuration source Object for this metadata element (may be null).
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AliasDefinition

public AliasDefinition(String beanName,
                       String alias)
Create a new AliasDefinition.

Parameters:
beanName - the canonical name of the bean
alias - the alias registered for the bean

AliasDefinition

public AliasDefinition(String beanName,
                       String alias,
                       Object source)
Create a new AliasDefinition.

Parameters:
beanName - the canonical name of the bean
alias - the alias registered for the bean
source - the source object (may be null)
Method Detail

getBeanName

public final String getBeanName()
Return the canonical name of the bean.

getAlias

public final String getAlias()
Return the alias registered for the bean.

getSource

public final Object getSource()
Description copied from interface: BeanMetadataElement
Return the configuration source Object for this metadata element (may be null).

Specified by:
getSource in interface BeanMetadataElement
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanComponentDefinition

org.springframework.beans.factory.parsing
Class BeanComponentDefinition

java.lang.Object
    extended by  org.springframework.beans.factory.config.BeanDefinitionHolder
        extended by  org.springframework.beans.factory.parsing.BeanComponentDefinition
All Implemented Interfaces:
BeanMetadataElement, ComponentDefinition
public class BeanComponentDefinition
extends BeanDefinitionHolder
implements ComponentDefinition

ComponentDefinition based on a standard BeanDefinition, exposing the given bean definition as well as inner bean definitions and bean references for the given bean.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller

Constructor Summary
BeanComponentDefinition(BeanDefinitionHolder holder)
Create a new BeanComponentDefinition for the given bean.
BeanComponentDefinition(BeanDefinition beanDefinition, String beanName)
Create a new BeanComponentDefinition for the given bean.
BeanComponentDefinition(BeanDefinition beanDefinition, String beanName, String[] aliases)
Create a new BeanComponentDefinition for the given bean.
Method Summary
boolean | equals(Object other) This implementations expects the other object to be of type BeanComponentDefinition as well, in addition to the superclass's equality requirements.
BeanDefinition[] | getBeanDefinitions() Return the BeanDefinitions that were registered to form this ComponentDefinition.
BeanReference[] | getBeanReferences() Return the set of BeanReferences that are considered to be important to this ComponentDefinition.
String | getDescription() Return a friendly description of the described component.
BeanDefinition[] | getInnerBeanDefinitions() Return the BeanDefinitions that represent all relevant inner beans within this component.
String | getName() Get the user-visible name of this ComponentDefinition.
String | toString() This implementation returns this ComponentDefinition's description.
Methods inherited from class org.springframework.beans.factory.config.BeanDefinitionHolder
getAliases, getBeanDefinition, getBeanName, getLongDescription, getShortDescription, getSource, hashCode, matchesName
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.beans.BeanMetadataElement
getSource

Constructor Detail

BeanComponentDefinition

public BeanComponentDefinition(BeanDefinition beanDefinition,
                               String beanName)
Create a new BeanComponentDefinition for the given bean.

Parameters:
beanDefinition - the BeanDefinition
beanName - the name of the bean

BeanComponentDefinition

public BeanComponentDefinition(BeanDefinition beanDefinition,
                               String beanName,
                               String[] aliases)
Create a new BeanComponentDefinition for the given bean.

Parameters:
beanDefinition - the BeanDefinition
beanName - the name of the bean
aliases - alias names for the bean, or null if none

BeanComponentDefinition

public BeanComponentDefinition(BeanDefinitionHolder holder)
Create a new BeanComponentDefinition for the given bean.

Parameters:
holder - the BeanDefinitionHolder encapsulating the bean definition as well as the name of the bean
Method Detail

getName

public String getName()
Description copied from interface: ComponentDefinition
Get the user-visible name of this ComponentDefinition.

This should link back directly to the corresponding configuration data for this component in a given context.

Specified by:
getName in interface ComponentDefinition

getDescription

public String getDescription()
Description copied from interface: ComponentDefinition
Return a friendly description of the described component.

Implementations are encouraged to return the same value from toString().

Specified by:
getDescription in interface ComponentDefinition

getBeanDefinitions

public BeanDefinition[] getBeanDefinitions()
Description copied from interface: ComponentDefinition
Return the BeanDefinitions that were registered to form this ComponentDefinition.

It should be noted that a ComponentDefinition may well be related with other BeanDefinitions via references, however these are not included as they may be not available immediately. Important BeanReferences are available from ComponentDefinition.getBeanReferences().

Specified by:
getBeanDefinitions in interface ComponentDefinition
Returns:
the array of BeanDefinitions, or an empty array if none

getInnerBeanDefinitions

public BeanDefinition[] getInnerBeanDefinitions()
Description copied from interface: ComponentDefinition
Return the BeanDefinitions that represent all relevant inner beans within this component.

Other inner beans may exist within the associated BeanDefinitions, however these are not considered to be needed for validation or for user visualization.

Specified by:
getInnerBeanDefinitions in interface ComponentDefinition
Returns:
the array of BeanDefinitions, or an empty array if none

getBeanReferences

public BeanReference[] getBeanReferences()
Description copied from interface: ComponentDefinition
Return the set of BeanReferences that are considered to be important to this ComponentDefinition.

Other BeanReferences may exist within the associated BeanDefinitions, however these are not considered to be needed for validation or for user visualization.

Specified by:
getBeanReferences in interface ComponentDefinition
Returns:
the array of BeanReferences, or an empty array if none

toString

public String toString()
This implementation returns this ComponentDefinition's description.

Overrides:
toString in class BeanDefinitionHolder
See Also:
getDescription()

equals

public boolean equals(Object other)
This implementations expects the other object to be of type BeanComponentDefinition as well, in addition to the superclass's equality requirements.

Overrides:
equals in class BeanDefinitionHolder
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanEntry

org.springframework.beans.factory.parsing
Class BeanEntry

java.lang.Object
    extended by  org.springframework.beans.factory.parsing.BeanEntry
All Implemented Interfaces:
ParseState.Entry
public class BeanEntry
extends Object
implements ParseState.Entry

ParseState entry representing a bean definition.

Since:
2.0
Author:
Rob Harrop

Constructor Summary
BeanEntry(String beanDefinitionName)
Creates a new instance of BeanEntry class.
Method Summary
 String toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

BeanEntry

public BeanEntry(String beanDefinitionName)
Creates a new instance of BeanEntry class.

Parameters:
beanDefinitionName - the name of the associated bean definition
Method Detail

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CompositeComponentDefinition

org.springframework.beans.factory.parsing
Class CompositeComponentDefinition

java.lang.Object
    extended by  org.springframework.beans.factory.parsing.AbstractComponentDefinition
        extended by  org.springframework.beans.factory.parsing.CompositeComponentDefinition
All Implemented Interfaces:
BeanMetadataElement, ComponentDefinition
Direct Known Subclasses:
AspectComponentDefinition
public class CompositeComponentDefinition
extends AbstractComponentDefinition

ComponentDefinition implementation that holds one or more nested ComponentDefinition instances, aggregating them into a named group of components.

Since:
2.0.1
Author:
Juergen Hoeller
See Also:
getNestedComponents()

Constructor Summary
CompositeComponentDefinition(String name, Object source)
Create a new CompositeComponentDefinition.
Method Summary
void | addNestedComponent(ComponentDefinition component) Add the given component as nested element of this composite component.
String | getName() Get the user-visible name of this ComponentDefinition.
ComponentDefinition[] | getNestedComponents() Return the nested components that this composite component holds.
Object | getSource() Return the configuration source Object for this metadata element (may be null).
Methods inherited from class org.springframework.beans.factory.parsing.AbstractComponentDefinition
getBeanDefinitions, getBeanReferences, getDescription, getInnerBeanDefinitions, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

CompositeComponentDefinition

public CompositeComponentDefinition(String name,
                                    Object source)
Create a new CompositeComponentDefinition.

Parameters:
name - the name of the composite component
source - the source element that defines the root of the composite component
Method Detail

getName

public String getName()
Description copied from interface: ComponentDefinition
Get the user-visible name of this ComponentDefinition.

This should link back directly to the corresponding configuration data for this component in a given context.

getSource

public Object getSource()
Description copied from interface: BeanMetadataElement
Return the configuration source Object for this metadata element (may be null).

addNestedComponent

public void addNestedComponent(ComponentDefinition component)
Add the given component as nested element of this composite component.

Parameters:
component - the nested component to add

getNestedComponents

public ComponentDefinition[] getNestedComponents()
Return the nested components that this composite component holds.

Returns:
the array of nested components, or an empty array if none
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConstructorArgumentEntry

org.springframework.beans.factory.parsing
Class ConstructorArgumentEntry

java.lang.Object
    extended by  org.springframework.beans.factory.parsing.ConstructorArgumentEntry
All Implemented Interfaces:
ParseState.Entry
public class ConstructorArgumentEntry
extends Object
implements ParseState.Entry

ParseState entry representing a (possibly indexed) constructor argument.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller

Constructor Summary
ConstructorArgumentEntry()
Creates a new instance of the ConstructorArgumentEntry class representing a constructor argument with a (currently) unknown index.
ConstructorArgumentEntry(int index)
Creates a new instance of the ConstructorArgumentEntry class representing a constructor argument at the supplied index.
Method Summary
 String toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ConstructorArgumentEntry

public ConstructorArgumentEntry()
Creates a new instance of the ConstructorArgumentEntry class representing a constructor argument with a (currently) unknown index.

ConstructorArgumentEntry

public ConstructorArgumentEntry(int index)
Creates a new instance of the ConstructorArgumentEntry class representing a constructor argument at the supplied index.

Parameters:
index - the index of the constructor argument
Throws:
IllegalArgumentException - if the supplied index is less than zero
Method Detail

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EmptyReaderEventListener

org.springframework.beans.factory.parsing
Class EmptyReaderEventListener

java.lang.Object
    extended by  org.springframework.beans.factory.parsing.EmptyReaderEventListener
All Implemented Interfaces:
EventListener, ReaderEventListener
public class EmptyReaderEventListener
extends Object
implements ReaderEventListener

Empty implementation of the ReaderEventListener interface, providing no-op implementations of all callback methods.

Since:
2.0
Author:
Juergen Hoeller

Constructor Summary
EmptyReaderEventListener()
Method Summary
void | aliasRegistered(AliasDefinition aliasDefinition) Notification that the given alias has been registered.
void | componentRegistered(ComponentDefinition componentDefinition) Notification that the given component has been registered.
void | defaultsRegistered(DefaultsDefinition defaultsDefinition) Notification that the given defaults has been registered.
void | importProcessed(ImportDefinition importDefinition) Notification that the given import has been processed.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

EmptyReaderEventListener

public EmptyReaderEventListener()
Method Detail

defaultsRegistered

public void defaultsRegistered(DefaultsDefinition defaultsDefinition)
Description copied from interface: ReaderEventListener
Notification that the given defaults has been registered.

Specified by:
defaultsRegistered in interface ReaderEventListener
Parameters:
defaultsDefinition - a descriptor for the defaults
See Also:
DocumentDefaultsDefinition

componentRegistered

public void componentRegistered(ComponentDefinition componentDefinition)
Description copied from interface: ReaderEventListener
Notification that the given component has been registered.

Specified by:
componentRegistered in interface ReaderEventListener
Parameters:
componentDefinition - a descriptor for the new component
See Also:
BeanComponentDefinition

aliasRegistered

public void aliasRegistered(AliasDefinition aliasDefinition)
Description copied from interface: ReaderEventListener
Notification that the given alias has been registered.

Specified by:
aliasRegistered in interface ReaderEventListener
Parameters:
aliasDefinition - a descriptor for the new alias

importProcessed

public void importProcessed(ImportDefinition importDefinition)
Description copied from interface: ReaderEventListener
Notification that the given import has been processed.

Specified by:
importProcessed in interface ReaderEventListener
Parameters:
importDefinition - a descriptor for the import
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FailFastProblemReporter

org.springframework.beans.factory.parsing
Class FailFastProblemReporter

java.lang.Object
    extended by  org.springframework.beans.factory.parsing.FailFastProblemReporter
All Implemented Interfaces:
ProblemReporter
public class FailFastProblemReporter
extends Object
implements ProblemReporter

Simple ProblemReporter implementation that exhibits fail-fast behavior when errors are encountered.

The first error encountered results in a BeanDefinitionParsingException being thrown.

Warnings are written to the log for this class.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller, Rick Evans

Constructor Summary
FailFastProblemReporter()
Method Summary
void | error(Problem problem) Throws a BeanDefinitionParsingException detailing the error that has occurred.
void | fatal(Problem problem) Throws a BeanDefinitionParsingException detailing the error that has occurred.
void | setLogger(Log logger) Set the logger that is to be used to report warnings.
void | warning(Problem problem) Writes the supplied Problem to the Log at WARN level.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

FailFastProblemReporter

public FailFastProblemReporter()
Method Detail

setLogger

public void setLogger(Log logger)
Set the logger that is to be used to report warnings.

If set to null then a default logger set to the name of the instance class will be used.

Parameters:
logger - the logger that is to be used to report warnings

fatal

public void fatal(Problem problem)
Throws a BeanDefinitionParsingException detailing the error that has occurred.

Specified by:
fatal in interface ProblemReporter
Parameters:
problem - the source of the error

error

public void error(Problem problem)
Throws a BeanDefinitionParsingException detailing the error that has occurred.

Specified by:
error in interface ProblemReporter
Parameters:
problem - the source of the error

warning

public void warning(Problem problem)
Writes the supplied Problem to the Log at WARN level.

Specified by:
warning in interface ProblemReporter
Parameters:
problem - the source of the warning
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ImportDefinition

org.springframework.beans.factory.parsing
Class ImportDefinition

java.lang.Object
    extended by  org.springframework.beans.factory.parsing.ImportDefinition
All Implemented Interfaces:
BeanMetadataElement
public class ImportDefinition
extends Object
implements BeanMetadataElement

Representation of an import that has been processed during the parsing process.

Since:
2.0
Author:
Juergen Hoeller
See Also:
ReaderEventListener.importProcessed(ImportDefinition)

Constructor Summary
ImportDefinition(String importedResource)
Create a new ImportDefinition.
ImportDefinition(String importedResource, Object source)
Create a new ImportDefinition.
ImportDefinition(String importedResource, Resource[] actualResources, Object source)
Create a new ImportDefinition.
Method Summary
Resource[] | getActualResources()
String | getImportedResource() Return the location of the imported resource.
Object | getSource() Return the configuration source Object for this metadata element (may be null).
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ImportDefinition

public ImportDefinition(String importedResource)
Create a new ImportDefinition.

Parameters:
importedResource - the location of the imported resource

ImportDefinition

public ImportDefinition(String importedResource,
                        Object source)
Create a new ImportDefinition.

Parameters:
importedResource - the location of the imported resource
source - the source object (may be null)

ImportDefinition

public ImportDefinition(String importedResource,
                        Resource[] actualResources,
                        Object source)
Create a new ImportDefinition.

Parameters:
importedResource - the location of the imported resource
source - the source object (may be null)
Method Detail

getImportedResource

public final String getImportedResource()
Return the location of the imported resource.

getActualResources

public final Resource[] getActualResources()

getSource

public final Object getSource()
Description copied from interface: BeanMetadataElement
Return the configuration source Object for this metadata element (may be null).

Specified by:
getSource in interface BeanMetadataElement
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Location

org.springframework.beans.factory.parsing
Class Location

java.lang.Object
    extended by  org.springframework.beans.factory.parsing.Location

public class Location
extends Object

Class that models an arbitrary location in a resource.

Typically used to track the location of problematic or erroneous metadata in XML configuration files. For example, a source location might be 'The bean defined on line 76 of beans.properties has an invalid Class'; another source might be the actual DOM Element from a parsed XML Document; or the source object might simply be null.

Since:
2.0
Author:
Rob Harrop

Constructor Summary
Location(Resource resource)
Create a new instance of the Location class.
Location(Resource resource, Object source)
Create a new instance of the Location class.
Method Summary
Resource | getResource() Get the resource with which this location is associated.
Object | getSource() Get the actual location within the associated resource (may be null).
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Location

public Location(Resource resource)
Create a new instance of the Location class.

Parameters:
resource - the resource with which this location is associated

Location

public Location(Resource resource,
                Object source)
Create a new instance of the Location class.

Parameters:
resource - the resource with which this location is associated
source - the actual location within the associated resource (may be null)
Method Detail

getResource

public Resource getResource()
Get the resource with which this location is associated.

getSource

public Object getSource()
Get the actual location within the associated resource (may be null).

See the class level javadoc for this class for examples of what the actual type of the returned object may be.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NullSourceExtractor

org.springframework.beans.factory.parsing
Class NullSourceExtractor

java.lang.Object
    extended by  org.springframework.beans.factory.parsing.NullSourceExtractor
All Implemented Interfaces:
SourceExtractor
public class NullSourceExtractor
extends Object
implements SourceExtractor

Simple implementation of SourceExtractor that returns null as the source metadata.

This is the default implementation and prevents too much metadata from being held in memory during normal (non-tooled) runtime usage.

Since:
2.0
Author:
Rob Harrop

Constructor Summary
NullSourceExtractor()
Method Summary
 Object extractSource(Object sourceCandidate, Resource definitionResource)
This implementation simply returns null for any input.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

NullSourceExtractor

public NullSourceExtractor()
Method Detail

extractSource

public Object extractSource(Object sourceCandidate,
                            Resource definitionResource)
This implementation simply returns null for any input.

Specified by:
extractSource in interface SourceExtractor
Parameters:
sourceCandidate - the original source metadata (never null)
definitionResource - the resource that defines the given source object (may be null)
Returns:
the source metadata object to store (may be null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ParseState

org.springframework.beans.factory.parsing
Class ParseState

java.lang.Object
    extended by  org.springframework.beans.factory.parsing.ParseState

public final class ParseState
extends Object

Simple Stack-based structure for tracking the logical position during a parsing process. entries are added to the stack at each point during the parse phase in a reader-specific manner.

Calling toString() will render a tree-style view of the current logical position in the parse phase. This representation is intended for use in error messages.

Since:
2.0
Author:
Rob Harrop

Nested Class Summary
static interface ParseState.Entry
Marker interface for entries into the ParseState.
Constructor Summary
ParseState()
Create a new ParseState with an empty Stack.
Method Summary
ParseState.Entry | peek() Return the ParseState.Entry currently at the top of the Stack or null if the Stack is empty.
void | pop() Remove an ParseState.Entry from the Stack.
void | push(ParseState.Entry entry) Add a new ParseState.Entry to the Stack.
ParseState | snapshot() Create a new instance of ParseState which is an independent snapshot of this instance.
String | toString() Returns a tree-style representation of the current ParseState.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ParseState

public ParseState()
Create a new ParseState with an empty Stack.

Method Detail

push

public void push(ParseState.Entry entry)
Add a new ParseState.Entry to the Stack.

pop

public void pop()
Remove an ParseState.Entry from the Stack.

peek

public ParseState.Entry peek()
Return the ParseState.Entry currently at the top of the Stack or null if the Stack is empty.

snapshot

public ParseState snapshot()
Create a new instance of ParseState which is an independent snapshot of this instance.

toString

public String toString()
Returns a tree-style representation of the current ParseState.

Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ParseState.Entry

org.springframework.beans.factory.parsing
Interface ParseState.Entry

All Known Implementing Classes:
AdviceEntry, AdvisorEntry, AspectEntry, BeanEntry, ConstructorArgumentEntry, PointcutEntry, PropertyEntry, QualifierEntry
Enclosing class:
ParseState
public static interface ParseState.Entry

Marker interface for entries into the ParseState.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PassThroughSourceExtractor

org.springframework.beans.factory.parsing
Class PassThroughSourceExtractor

java.lang.Object
    extended by  org.springframework.beans.factory.parsing.PassThroughSourceExtractor
All Implemented Interfaces:
SourceExtractor
public class PassThroughSourceExtractor
extends Object
implements SourceExtractor

Simple SourceExtractor implementation that just passes the candidate source metadata object through for attachment.

Using this implementation means that tools will get raw access to the underlying configuration source metadata provided by the tool.

This implementation should not be used in a production application since it is likely to keep too much metadata in memory (unnecessarily).

Since:
2.0
Author:
Rob Harrop

Constructor Summary
PassThroughSourceExtractor()
Method Summary
 Object extractSource(Object sourceCandidate, Resource definingResource)
Simply returns the supplied sourceCandidate as-is.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PassThroughSourceExtractor

public PassThroughSourceExtractor()
Method Detail

extractSource

public Object extractSource(Object sourceCandidate,
                            Resource definingResource)
Simply returns the supplied sourceCandidate as-is.

Specified by:
extractSource in interface SourceExtractor
Parameters:
sourceCandidate - the source metadata
definingResource - the resource that defines the given source object (may be null)
Returns:
the supplied sourceCandidate
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Problem

org.springframework.beans.factory.parsing
Class Problem

java.lang.Object
    extended by  org.springframework.beans.factory.parsing.Problem

public class Problem
extends Object

Represents a problem with a bean definition configuration. Mainly serves as common argument passed into a ProblemReporter.

May indicate a potentially fatal problem (an error) or just a warning.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
See Also:
ProblemReporter

Constructor Summary
Problem(String message, Location location)
Create a new instance of the Problem class.
Problem(String message, Location location, ParseState parseState)
Create a new instance of the Problem class.
Problem(String message, Location location, ParseState parseState, Throwable rootCause)
Create a new instance of the Problem class.
Method Summary
Location | getLocation() Get the location within a bean configuration source that triggered the error.
String | getMessage() Get the message detailing the problem.
ParseState | getParseState() Get the ParseState at the time of the error (may be null).
String | getResourceDescription() Get the description of the bean configuration source that triggered the error, as contained within this Problem's Location object.
Throwable | getRootCause() Get the underlying expection that caused the error (may be null).
String | toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

Problem

public Problem(String message,
               Location location)
Create a new instance of the Problem class.

Parameters:
message - a message detailing the problem
location - the location within a bean configuration source that triggered the error

Problem

public Problem(String message,
               Location location,
               ParseState parseState)
Create a new instance of the Problem class.

Parameters:
message - a message detailing the problem
parseState - the ParseState at the time of the error
location - the location within a bean configuration source that triggered the error

Problem

public Problem(String message,
               Location location,
               ParseState parseState,
               Throwable rootCause)
Create a new instance of the Problem class.

Parameters:
message - a message detailing the problem
rootCause - the underlying expection that caused the error (may be null)
parseState - the ParseState at the time of the error
location - the location within a bean configuration source that triggered the error
Method Detail

getMessage

public String getMessage()
Get the message detailing the problem.

getLocation

public Location getLocation()
Get the location within a bean configuration source that triggered the error.

getResourceDescription

public String getResourceDescription()
Get the description of the bean configuration source that triggered the error, as contained within this Problem's Location object.

See Also:
getLocation()

getParseState

public ParseState getParseState()
Get the ParseState at the time of the error (may be null).

getRootCause

public Throwable getRootCause()
Get the underlying expection that caused the error (may be null).

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertyEntry

org.springframework.beans.factory.parsing
Class PropertyEntry

java.lang.Object
    extended by  org.springframework.beans.factory.parsing.PropertyEntry
All Implemented Interfaces:
ParseState.Entry
public class PropertyEntry
extends Object
implements ParseState.Entry

ParseState entry representing a JavaBean property.

Since:
2.0
Author:
Rob Harrop

Constructor Summary
PropertyEntry(String name)
Creates a new instance of the PropertyEntry class.
Method Summary
 String toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

PropertyEntry

public PropertyEntry(String name)
Creates a new instance of the PropertyEntry class.

Parameters:
name - the name of the JavaBean property represented by this instance
Throws:
IllegalArgumentException - if the supplied name is null or consists wholly of whitespace
Method Detail

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


QualifierEntry

org.springframework.beans.factory.parsing
Class QualifierEntry

java.lang.Object
    extended by  org.springframework.beans.factory.parsing.QualifierEntry
All Implemented Interfaces:
ParseState.Entry
public class QualifierEntry
extends Object
implements ParseState.Entry

ParseState entry representing an autowire candidate qualifier.

Since:
2.5
Author:
Mark Fisher

Constructor Summary
QualifierEntry(String typeName)
Method Summary
 String toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

QualifierEntry

public QualifierEntry(String typeName)
Method Detail

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ReaderContext

org.springframework.beans.factory.parsing
Class ReaderContext

java.lang.Object
    extended by  org.springframework.beans.factory.parsing.ReaderContext
Direct Known Subclasses:
XmlReaderContext
public class ReaderContext
extends Object

Context that gets passed along a bean definition reading process, encapsulating all relevant configuration as well as state.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller

Constructor Summary
ReaderContext(Resource resource, ProblemReporter problemReporter, ReaderEventListener eventListener, SourceExtractor sourceExtractor)
Method Summary
void | error(String message, Object source)
void | error(String message, Object source, ParseState parseState)
void | error(String message, Object source, ParseState parseState, Throwable cause)
void | error(String message, Object source, Throwable ex)
Object | extractSource(Object sourceCandidate)
void | fatal(String message, Object source)
void | fatal(String message, Object source, ParseState parseState)
void | fatal(String message, Object source, ParseState parseState, Throwable cause)
void | fatal(String message, Object source, Throwable ex)
void | fireAliasRegistered(String beanName, String alias, Object source)
void | fireComponentRegistered(ComponentDefinition componentDefinition)
void | fireDefaultsRegistered(DefaultsDefinition defaultsDefinition)
void | fireImportProcessed(String importedResource, Object source)
void | fireImportProcessed(String importedResource, Resource[] actualResources, Object source)
Resource | getResource()
SourceExtractor | getSourceExtractor()
void | warning(String message, Object source)
void | warning(String message, Object source, ParseState parseState)
void | warning(String message, Object source, ParseState parseState, Throwable cause)
void | warning(String message, Object source, Throwable ex)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ReaderContext

public ReaderContext(Resource resource,
                     ProblemReporter problemReporter,
                     ReaderEventListener eventListener,
                     SourceExtractor sourceExtractor)
Method Detail

getResource

public final Resource getResource()

fatal

public void fatal(String message,
                  Object source)

fatal

public void fatal(String message,
                  Object source,
                  Throwable ex)

fatal

public void fatal(String message,
                  Object source,
                  ParseState parseState)

fatal

public void fatal(String message,
                  Object source,
                  ParseState parseState,
                  Throwable cause)

error

public void error(String message,
                  Object source)

error

public void error(String message,
                  Object source,
                  Throwable ex)

error

public void error(String message,
                  Object source,
                  ParseState parseState)

error

public void error(String message,
                  Object source,
                  ParseState parseState,
                  Throwable cause)

warning

public void warning(String message,
                    Object source)

warning

public void warning(String message,
                    Object source,
                    Throwable ex)

warning

public void warning(String message,
                    Object source,
                    ParseState parseState)

warning

public void warning(String message,
                    Object source,
                    ParseState parseState,
                    Throwable cause)

fireDefaultsRegistered

public void fireDefaultsRegistered(DefaultsDefinition defaultsDefinition)

fireComponentRegistered

public void fireComponentRegistered(ComponentDefinition componentDefinition)

fireAliasRegistered

public void fireAliasRegistered(String beanName,
                                String alias,
                                Object source)

fireImportProcessed

public void fireImportProcessed(String importedResource,
                                Object source)

fireImportProcessed

public void fireImportProcessed(String importedResource,
                                Resource[] actualResources,
                                Object source)

getSourceExtractor

public SourceExtractor getSourceExtractor()

extractSource

public Object extractSource(Object sourceCandidate)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanDefinitionParsingException

org.springframework.beans.factory.parsing
Class BeanDefinitionParsingException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.beans.BeansException
                        extended by  org.springframework.beans.FatalBeanException
                            extended by  org.springframework.beans.factory.BeanDefinitionStoreException
                                extended by  org.springframework.beans.factory.parsing.BeanDefinitionParsingException
All Implemented Interfaces:
Serializable
public class BeanDefinitionParsingException
extends BeanDefinitionStoreException

Exception thrown when a bean definition reader encounters an error during the parsing process.

Since:
2.0
Author:
Juergen Hoeller, Rob Harrop
See Also:
Serialized Form

Constructor Summary
BeanDefinitionParsingException(Problem problem)
Create a new BeanDefinitionParsingException.
Method Summary
Methods inherited from class org.springframework.beans.factory.BeanDefinitionStoreException
getBeanName, getResourceDescription
Methods inherited from class org.springframework.beans.BeansException
equals, hashCode
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

BeanDefinitionParsingException

public BeanDefinitionParsingException(Problem problem)
Create a new BeanDefinitionParsingException.

Parameters:
problem - the configuration problem that was detected during the parsing process
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.beans.factory.serviceloader

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.beans.factory.serviceloader

Support package for the JDK 1.6 ServiceLoader facility.

See:
Description

Class Summary
AbstractServiceLoaderBasedFactoryBean | Abstract base class for FactoryBeans operating on the JDK 1.6 ServiceLoader facility.
ServiceFactoryBean | FactoryBean that exposes the 'primary' service for the configured service class, obtained through the JDK 1.6 ServiceLoader facility.
ServiceListFactoryBean | FactoryBean that exposes all services for the configured service class, represented as a List of service objects, obtained through the JDK 1.6 ServiceLoader facility.
ServiceLoaderFactoryBean | FactoryBean that exposes the JDK 1.6 ServiceLoader for the configured service class.

Package org.springframework.beans.factory.serviceloader Description

Support package for the JDK 1.6 ServiceLoader facility.


org.springframework.beans.factory.serviceloader Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.beans.factory.serviceloader

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.beans.factory.config.AbstractFactoryBean<T> (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
      • org.springframework.beans.factory.serviceloader.AbstractServiceLoaderBasedFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware)
        • org.springframework.beans.factory.serviceloader.ServiceFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware)
        • org.springframework.beans.factory.serviceloader.ServiceListFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware)
        • org.springframework.beans.factory.serviceloader.ServiceLoaderFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware)


AbstractServiceLoaderBasedFactoryBean

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.beans.factory.serviceloader
Class AbstractServiceLoaderBasedFactoryBean

java.lang.Object
    extended by  org.springframework.beans.factory.config.AbstractFactoryBean
        extended by  org.springframework.beans.factory.serviceloader.AbstractServiceLoaderBasedFactoryBean
All Implemented Interfaces:
BeanClassLoaderAware, BeanFactoryAware, DisposableBean, FactoryBean, InitializingBean
Direct Known Subclasses:
ServiceFactoryBean, ServiceListFactoryBean, ServiceLoaderFactoryBean
public abstract class AbstractServiceLoaderBasedFactoryBean
extends AbstractFactoryBean
implements BeanClassLoaderAware

Abstract base class for FactoryBeans operating on the JDK 1.6 ServiceLoader facility.

Since:
2.5
Author:
Juergen Hoeller
See Also:
ServiceLoader

Field Summary
Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
logger
Constructor Summary
AbstractServiceLoaderBasedFactoryBean()
Method Summary
protected  Object createInstance()
Delegates to getObjectToExpose(java.util.ServiceLoader).
protected abstract  Object getObjectToExpose(ServiceLoader serviceLoader)
Determine the actual object to expose for the given ServiceLoader.
 Class getServiceType()
Return the desired service type.
 void setBeanClassLoader(ClassLoader beanClassLoader)
Callback that supplies the bean class loader to a bean instance.
 void setServiceType(Class serviceType)
Specify the desired service type (typically the service's public API).
Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, getObjectType, isSingleton, setBeanFactory, setSingleton
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractServiceLoaderBasedFactoryBean

public AbstractServiceLoaderBasedFactoryBean()
Method Detail

setServiceType

public void setServiceType(Class serviceType)
Specify the desired service type (typically the service's public API).

getServiceType

public Class getServiceType()
Return the desired service type.

setBeanClassLoader

public void setBeanClassLoader(ClassLoader beanClassLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Overrides:
setBeanClassLoader in class AbstractFactoryBean
Parameters:
beanClassLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

createInstance

protected Object createInstance()
Delegates to getObjectToExpose(java.util.ServiceLoader).

Specified by:
createInstance in class AbstractFactoryBean
Returns:
the object to expose
See Also:
AbstractFactoryBean.getObject()

getObjectToExpose

protected abstract Object getObjectToExpose(ServiceLoader serviceLoader)
Determine the actual object to expose for the given ServiceLoader.

Left to concrete subclasses.

Parameters:
serviceLoader - the ServiceLoader for the configured service class
Returns:
the object to expose
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ServiceFactoryBean

org.springframework.beans.factory.serviceloader
Class ServiceFactoryBean

java.lang.Object
    extended by  org.springframework.beans.factory.config.AbstractFactoryBean
        extended by  org.springframework.beans.factory.serviceloader.AbstractServiceLoaderBasedFactoryBean
            extended by  org.springframework.beans.factory.serviceloader.ServiceFactoryBean
All Implemented Interfaces:
BeanClassLoaderAware, BeanFactoryAware, DisposableBean, FactoryBean, InitializingBean
public class ServiceFactoryBean
extends AbstractServiceLoaderBasedFactoryBean
implements BeanClassLoaderAware

FactoryBean that exposes the 'primary' service for the configured service class, obtained through the JDK 1.6 ServiceLoader facility.

Since:
2.5
Author:
Juergen Hoeller
See Also:
ServiceLoader

Field Summary
Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
logger
Constructor Summary
ServiceFactoryBean()
Method Summary
protected Object | getObjectToExpose(ServiceLoader serviceLoader) Determine the actual object to expose for the given ServiceLoader.
Class | getObjectType() This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.
Methods inherited from class org.springframework.beans.factory.serviceloader.AbstractServiceLoaderBasedFactoryBean
createInstance, getServiceType, setBeanClassLoader, setServiceType
Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanFactory, setSingleton
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.BeanClassLoaderAware
setBeanClassLoader

Constructor Detail

ServiceFactoryBean

public ServiceFactoryBean()
Method Detail

getObjectToExpose

protected Object getObjectToExpose(ServiceLoader serviceLoader)
Description copied from class: AbstractServiceLoaderBasedFactoryBean
Determine the actual object to expose for the given ServiceLoader.

Left to concrete subclasses.

Specified by:
getObjectToExpose in class AbstractServiceLoaderBasedFactoryBean
Parameters:
serviceLoader - the ServiceLoader for the configured service class
Returns:
the object to expose

getObjectType

public Class getObjectType()
Description copied from class: AbstractFactoryBean
This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.

Specified by:
getObjectType in interface FactoryBean
Specified by:
getObjectType in class AbstractFactoryBean
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
FactoryBean.getObjectType()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServiceListFactoryBean

org.springframework.beans.factory.serviceloader
Class ServiceListFactoryBean

java.lang.Object
    extended by  org.springframework.beans.factory.config.AbstractFactoryBean
        extended by  org.springframework.beans.factory.serviceloader.AbstractServiceLoaderBasedFactoryBean
            extended by  org.springframework.beans.factory.serviceloader.ServiceListFactoryBean
All Implemented Interfaces:
BeanClassLoaderAware, BeanFactoryAware, DisposableBean, FactoryBean, InitializingBean
public class ServiceListFactoryBean
extends AbstractServiceLoaderBasedFactoryBean
implements BeanClassLoaderAware

FactoryBean that exposes all services for the configured service class, represented as a List of service objects, obtained through the JDK 1.6 ServiceLoader facility.

Since:
2.5
Author:
Juergen Hoeller
See Also:
ServiceLoader

Field Summary
Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
logger
Constructor Summary
ServiceListFactoryBean()
Method Summary
protected Object | getObjectToExpose(ServiceLoader serviceLoader) Determine the actual object to expose for the given ServiceLoader.
Class | getObjectType() This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.
Methods inherited from class org.springframework.beans.factory.serviceloader.AbstractServiceLoaderBasedFactoryBean
createInstance, getServiceType, setBeanClassLoader, setServiceType
Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanFactory, setSingleton
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.BeanClassLoaderAware
setBeanClassLoader

Constructor Detail

ServiceListFactoryBean

public ServiceListFactoryBean()
Method Detail

getObjectToExpose

protected Object getObjectToExpose(ServiceLoader serviceLoader)
Description copied from class: AbstractServiceLoaderBasedFactoryBean
Determine the actual object to expose for the given ServiceLoader.

Left to concrete subclasses.

Specified by:
getObjectToExpose in class AbstractServiceLoaderBasedFactoryBean
Parameters:
serviceLoader - the ServiceLoader for the configured service class
Returns:
the object to expose

getObjectType

public Class getObjectType()
Description copied from class: AbstractFactoryBean
This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.

Specified by:
getObjectType in interface FactoryBean
Specified by:
getObjectType in class AbstractFactoryBean
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
FactoryBean.getObjectType()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServiceLoaderFactoryBean

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.beans.factory.serviceloader
Class ServiceLoaderFactoryBean

java.lang.Object
    extended by  org.springframework.beans.factory.config.AbstractFactoryBean
        extended by  org.springframework.beans.factory.serviceloader.AbstractServiceLoaderBasedFactoryBean
            extended by  org.springframework.beans.factory.serviceloader.ServiceLoaderFactoryBean
All Implemented Interfaces:
BeanClassLoaderAware, BeanFactoryAware, DisposableBean, FactoryBean, InitializingBean
public class ServiceLoaderFactoryBean
extends AbstractServiceLoaderBasedFactoryBean
implements BeanClassLoaderAware

FactoryBean that exposes the JDK 1.6 ServiceLoader for the configured service class.

Since:
2.5
Author:
Juergen Hoeller
See Also:
ServiceLoader

Field Summary
Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
logger
Constructor Summary
ServiceLoaderFactoryBean()
Method Summary
protected Object | getObjectToExpose(ServiceLoader serviceLoader) Determine the actual object to expose for the given ServiceLoader.
Class | getObjectType() This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.
Methods inherited from class org.springframework.beans.factory.serviceloader.AbstractServiceLoaderBasedFactoryBean
createInstance, getServiceType, setBeanClassLoader, setServiceType
Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanFactory, setSingleton
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.BeanClassLoaderAware
setBeanClassLoader

Constructor Detail

ServiceLoaderFactoryBean

public ServiceLoaderFactoryBean()
Method Detail

getObjectToExpose

protected Object getObjectToExpose(ServiceLoader serviceLoader)
Description copied from class: AbstractServiceLoaderBasedFactoryBean
Determine the actual object to expose for the given ServiceLoader.

Left to concrete subclasses.

Specified by:
getObjectToExpose in class AbstractServiceLoaderBasedFactoryBean
Parameters:
serviceLoader - the ServiceLoader for the configured service class
Returns:
the object to expose

getObjectType

public Class getObjectType()
Description copied from class: AbstractFactoryBean
This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.

Specified by:
getObjectType in interface FactoryBean
Specified by:
getObjectType in class AbstractFactoryBean
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
FactoryBean.getObjectType()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.beans.factory.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.beans.factory.support

Classes supporting the org.springframework.beans.factory package.

See:
Description

Interface Summary
AutowireCandidateResolver | Strategy interface for determining whether a specific bean definition qualifies as an autowire candidate for a specific dependency.
BeanDefinitionReader | Simple interface for bean definition readers.
BeanDefinitionRegistry | Interface for registries that hold bean definitions, for example RootBeanDefinition and ChildBeanDefinition instances.
BeanDefinitionRegistryPostProcessor | Extension to the standard BeanFactoryPostProcessor SPI, allowing for the registration of further bean definitions before regular BeanFactoryPostProcessor detection kicks in.
BeanNameGenerator | Strategy interface for generating bean names for bean definitions.
InstantiationStrategy | Interface responsible for creating instances corresponding to a root bean definition.
MergedBeanDefinitionPostProcessor | Post-processor callback interface for merged bean definitions at runtime.
MethodReplacer | Interface to be implemented by classes that can reimplement any method on an IoC-managed object: the Method Injection form of Dependency Injection.
SecurityContextProvider | Provider of the security context of the code running inside the bean factory.

Class Summary
AbstractAutowireCapableBeanFactory | Abstract bean factory superclass that implements default bean creation, with the full capabilities specified by the RootBeanDefinition class.
AbstractBeanDefinition | Base class for concrete, full-fledged BeanDefinition classes, factoring out common properties of RootBeanDefinition and ChildBeanDefinition.
AbstractBeanDefinitionReader | Abstract base class for bean definition readers which implement the BeanDefinitionReader interface.
AbstractBeanFactory | Abstract base class for BeanFactory implementations, providing the full capabilities of the ConfigurableBeanFactory SPI.
AutowireCandidateQualifier | Qualifier for resolving autowire candidates.
BeanDefinitionBuilder | Programmatic means of constructing BeanDefinitions using the builder pattern.
BeanDefinitionDefaults | A simple holder for BeanDefinition property defaults.
BeanDefinitionReaderUtils | Utility methods that are useful for bean definition reader implementations.
CglibSubclassingInstantiationStrategy | Default object instantiation strategy for use in BeanFactories.
ChildBeanDefinition | Bean definition for beans which inherit settings from their parent.
DefaultBeanNameGenerator | Default implementation of the BeanNameGenerator interface, delegating to BeanDefinitionReaderUtils.generateBeanName(BeanDefinition, BeanDefinitionRegistry).
DefaultListableBeanFactory | Default implementation of the ListableBeanFactory and BeanDefinitionRegistry interfaces: a full-fledged bean factory based on bean definition objects.
DefaultSingletonBeanRegistry | Generic registry for shared bean instances, implementing the SingletonBeanRegistry.
FactoryBeanRegistrySupport | Support base class for singleton registries which need to handle FactoryBean instances, integrated with DefaultSingletonBeanRegistry's singleton management.
GenericBeanDefinition | GenericBeanDefinition is a one-stop shop for standard bean definition purposes.
LookupOverride | Represents an override of a method that looks up an object in the same IoC context.
ManagedArray | Tag collection class used to hold managed array elements, which may include runtime bean references (to be resolved into bean objects).
ManagedList<E> | Tag collection class used to hold managed List elements, which may include runtime bean references (to be resolved into bean objects).
ManagedMap<K,V> | Tag collection class used to hold managed Map values, which may include runtime bean references (to be resolved into bean objects).
ManagedProperties | Tag class which represents a Spring-managed Properties instance that supports merging of parent/child definitions.
ManagedSet<E> | Tag collection class used to hold managed Set values, which may include runtime bean references (to be resolved into bean objects).
MethodOverride | Object representing the override of a method on a managed object by the IoC container.
MethodOverrides | Set of method overrides, determining which, if any, methods on a managed object the Spring IoC container will override at runtime.
PropertiesBeanDefinitionReader | Bean definition reader for a simple properties format.
ReplaceOverride | Extension of MethodOverride that represents an arbitrary override of a method by the IoC container.
RootBeanDefinition | A root bean definition represents the merged bean definition that backs a specific bean in a Spring BeanFactory at runtime.
SimpleAutowireCandidateResolver | AutowireCandidateResolver implementation to use when no annotation support is available.
SimpleBeanDefinitionRegistry | Simple implementation of the BeanDefinitionRegistry interface.
SimpleInstantiationStrategy | Simple object instantiation strategy for use in a BeanFactory.
SimpleSecurityContextProvider | Simple SecurityContextProvider implementation.
StaticListableBeanFactory | Static BeanFactory implementation which allows to register existing singleton instances programmatically.

Exception Summary
BeanDefinitionValidationException Exception thrown when the validation of a bean definition failed.

Package org.springframework.beans.factory.support Description

Classes supporting the org.springframework.beans.factory package. Contains abstract base classes for BeanFactory implementations.


org.springframework.beans.factory.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.beans.factory.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.beans.factory.support.AbstractBeanDefinitionReader (implements org.springframework.beans.factory.support.BeanDefinitionReader)
      • org.springframework.beans.factory.support.PropertiesBeanDefinitionReader
    • java.util.AbstractCollection<E> (implements java.util.Collection<E>)
      • java.util.AbstractList<E> (implements java.util.List<E>)
        • java.util.ArrayList<E> (implements java.lang.Cloneable, java.util.List<E>, java.util.RandomAccess, java.io.Serializable)
          • org.springframework.beans.factory.support.ManagedList<E> (implements org.springframework.beans.BeanMetadataElement, org.springframework.beans.Mergeable)
            • org.springframework.beans.factory.support.ManagedArray
      • java.util.AbstractSet<E> (implements java.util.Set<E>)
        • java.util.HashSet<E> (implements java.lang.Cloneable, java.io.Serializable, java.util.Set<E>)
          • java.util.LinkedHashSet<E> (implements java.lang.Cloneable, java.io.Serializable, java.util.Set<E>)
            • org.springframework.beans.factory.support.ManagedSet<E> (implements org.springframework.beans.BeanMetadataElement, org.springframework.beans.Mergeable)
    • java.util.AbstractMap<K,V> (implements java.util.Map<K,V>)
      • java.util.HashMap<K,V> (implements java.lang.Cloneable, java.util.Map<K,V>, java.io.Serializable)
        • java.util.LinkedHashMap<K,V> (implements java.util.Map<K,V>)
          • org.springframework.beans.factory.support.ManagedMap<K,V> (implements org.springframework.beans.BeanMetadataElement, org.springframework.beans.Mergeable)
    • org.springframework.core.AttributeAccessorSupport (implements org.springframework.core.AttributeAccessor, java.io.Serializable)
      • org.springframework.beans.BeanMetadataAttributeAccessor (implements org.springframework.beans.BeanMetadataElement)
        • org.springframework.beans.factory.support.AbstractBeanDefinition (implements org.springframework.beans.factory.config.BeanDefinition, java.lang.Cloneable)
          • org.springframework.beans.factory.support.ChildBeanDefinition
          • org.springframework.beans.factory.support.GenericBeanDefinition
          • org.springframework.beans.factory.support.RootBeanDefinition
        • org.springframework.beans.factory.support.AutowireCandidateQualifier
    • org.springframework.beans.factory.support.BeanDefinitionBuilder
    • org.springframework.beans.factory.support.BeanDefinitionDefaults
    • org.springframework.beans.factory.support.BeanDefinitionReaderUtils
    • org.springframework.beans.factory.support.DefaultBeanNameGenerator (implements org.springframework.beans.factory.support.BeanNameGenerator)
    • java.util.Dictionary<K,V>
      • java.util.Hashtable<K,V> (implements java.lang.Cloneable, java.util.Map<K,V>, java.io.Serializable)
        • java.util.Properties
          • org.springframework.beans.factory.support.ManagedProperties (implements org.springframework.beans.BeanMetadataElement, org.springframework.beans.Mergeable)
    • org.springframework.beans.factory.support.MethodOverride (implements org.springframework.beans.BeanMetadataElement)
      • org.springframework.beans.factory.support.LookupOverride
      • org.springframework.beans.factory.support.ReplaceOverride
    • org.springframework.beans.factory.support.MethodOverrides
    • org.springframework.core.SimpleAliasRegistry (implements org.springframework.core.AliasRegistry)
      • org.springframework.beans.factory.support.DefaultSingletonBeanRegistry (implements org.springframework.beans.factory.config.SingletonBeanRegistry)
        • org.springframework.beans.factory.support.FactoryBeanRegistrySupport
          • org.springframework.beans.factory.support.AbstractBeanFactory (implements org.springframework.beans.factory.config.ConfigurableBeanFactory)
            • org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory (implements org.springframework.beans.factory.config.AutowireCapableBeanFactory)
              • org.springframework.beans.factory.support.DefaultListableBeanFactory (implements org.springframework.beans.factory.support.BeanDefinitionRegistry, org.springframework.beans.factory.config.ConfigurableListableBeanFactory, java.io.Serializable)
      • org.springframework.beans.factory.support.SimpleBeanDefinitionRegistry (implements org.springframework.beans.factory.support.BeanDefinitionRegistry)
    • org.springframework.beans.factory.support.SimpleAutowireCandidateResolver (implements org.springframework.beans.factory.support.AutowireCandidateResolver)
    • org.springframework.beans.factory.support.SimpleInstantiationStrategy (implements org.springframework.beans.factory.support.InstantiationStrategy)
      • org.springframework.beans.factory.support.CglibSubclassingInstantiationStrategy
    • org.springframework.beans.factory.support.SimpleSecurityContextProvider (implements org.springframework.beans.factory.support.SecurityContextProvider)
    • org.springframework.beans.factory.support.StaticListableBeanFactory (implements org.springframework.beans.factory.ListableBeanFactory)
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.beans.BeansException
              • org.springframework.beans.FatalBeanException
                • org.springframework.beans.factory.support.BeanDefinitionValidationException

Interface Hierarchy

  • org.springframework.core.AliasRegistry
    • org.springframework.beans.factory.support.BeanDefinitionRegistry
  • org.springframework.beans.factory.support.AutowireCandidateResolver
  • org.springframework.beans.factory.support.BeanDefinitionReader
  • org.springframework.beans.factory.config.BeanFactoryPostProcessor
    • org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor
  • org.springframework.beans.factory.support.BeanNameGenerator
  • org.springframework.beans.factory.config.BeanPostProcessor
    • org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor
  • org.springframework.beans.factory.support.InstantiationStrategy
  • org.springframework.beans.factory.support.MethodReplacer
  • org.springframework.beans.factory.support.SecurityContextProvider


AutowireCandidateResolver

org.springframework.beans.factory.support
Interface AutowireCandidateResolver

All Known Implementing Classes:
QualifierAnnotationAutowireCandidateResolver, SimpleAutowireCandidateResolver
public interface AutowireCandidateResolver

Strategy interface for determining whether a specific bean definition qualifies as an autowire candidate for a specific dependency.

Since:
2.5
Author:
Mark Fisher, Juergen Hoeller

Method Summary
Object | getSuggestedValue(DependencyDescriptor descriptor) Determine whether a default value is suggested for the given dependency.
boolean | isAutowireCandidate(BeanDefinitionHolder bdHolder, DependencyDescriptor descriptor) Determine whether the given bean definition qualifies as an autowire candidate for the given dependency.

Method Detail

isAutowireCandidate

boolean isAutowireCandidate(BeanDefinitionHolder bdHolder,
                            DependencyDescriptor descriptor)
Determine whether the given bean definition qualifies as an autowire candidate for the given dependency.

Parameters:
bdHolder - the bean definition including bean name and aliases
descriptor - the descriptor for the target method parameter or field
Returns:
whether the bean definition qualifies as autowire candidate

getSuggestedValue

Object getSuggestedValue(DependencyDescriptor descriptor)
Determine whether a default value is suggested for the given dependency.

Parameters:
descriptor - the descriptor for the target method parameter or field
Returns:
the value suggested (typically an expression String), or null if none found
Since:
3.0
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanDefinitionReader

org.springframework.beans.factory.support
Interface BeanDefinitionReader

All Known Implementing Classes:
AbstractBeanDefinitionReader, PropertiesBeanDefinitionReader, XmlBeanDefinitionReader
public interface BeanDefinitionReader

Simple interface for bean definition readers. Specifies load methods with Resource parameters.

Concrete bean definition readers can of course add additional load and register methods for bean definitions, specific to their bean definition format.

Note that a bean definition reader does not have to implement this interface. It only serves as suggestion for bean definition readers that want to follow standard naming conventions.

Since:
1.1
Author:
Juergen Hoeller
See Also:
Resource

Method Summary
ClassLoader | getBeanClassLoader() Return the class loader to use for bean classes.
BeanNameGenerator | getBeanNameGenerator() Return the BeanNameGenerator to use for anonymous beans (without explicit bean name specified).
BeanDefinitionRegistry | getRegistry() Return the bean factory to register the bean definitions with.
ResourceLoader | getResourceLoader() Return the resource loader to use for resource locations.
int | loadBeanDefinitions(Resource... resources) Load bean definitions from the specified resources.
int | loadBeanDefinitions(Resource resource) Load bean definitions from the specified resource.
int | loadBeanDefinitions(String... locations) Load bean definitions from the specified resource locations.
int | loadBeanDefinitions(String location) Load bean definitions from the specified resource location.

Method Detail

getRegistry

BeanDefinitionRegistry getRegistry()
Return the bean factory to register the bean definitions with.

The factory is exposed through the BeanDefinitionRegistry interface, encapsulating the methods that are relevant for bean definition handling.

getResourceLoader

ResourceLoader getResourceLoader()
Return the resource loader to use for resource locations. Can be checked for the ResourcePatternResolver interface and cast accordingly, for loading multiple resources for a given resource pattern.

Null suggests that absolute resource loading is not available for this bean definition reader.

This is mainly meant to be used for importing further resources from within a bean definition resource, for example via the "import" tag in XML bean definitions. It is recommended, however, to apply such imports relative to the defining resource; only explicit full resource locations will trigger absolute resource loading.

There is also a loadBeanDefinitions(String) method available, for loading bean definitions from a resource location (or location pattern). This is a convenience to avoid explicit ResourceLoader handling.

See Also:
loadBeanDefinitions(String), ResourcePatternResolver

getBeanClassLoader

ClassLoader getBeanClassLoader()
Return the class loader to use for bean classes.

null suggests to not load bean classes eagerly but rather to just register bean definitions with class names, with the corresponding Classes to be resolved later (or never).

getBeanNameGenerator

BeanNameGenerator getBeanNameGenerator()
Return the BeanNameGenerator to use for anonymous beans (without explicit bean name specified).

loadBeanDefinitions

int loadBeanDefinitions(Resource resource)
                        throws BeanDefinitionStoreException
Load bean definitions from the specified resource.

Parameters:
resource - the resource descriptor
Returns:
the number of bean definitions found
Throws:
BeanDefinitionStoreException - in case of loading or parsing errors

loadBeanDefinitions

int loadBeanDefinitions(Resource... resources)
                        throws BeanDefinitionStoreException
Load bean definitions from the specified resources.

Parameters:
resources - the resource descriptors
Returns:
the number of bean definitions found
Throws:
BeanDefinitionStoreException - in case of loading or parsing errors

loadBeanDefinitions

int loadBeanDefinitions(String location)
                        throws BeanDefinitionStoreException
Load bean definitions from the specified resource location.

The location can also be a location pattern, provided that the ResourceLoader of this bean definition reader is a ResourcePatternResolver.

Parameters:
location - the resource location, to be loaded with the ResourceLoader (or ResourcePatternResolver) of this bean definition reader
Returns:
the number of bean definitions found
Throws:
BeanDefinitionStoreException - in case of loading or parsing errors
See Also:
getResourceLoader(),
loadBeanDefinitions(org.springframework.core.io.Resource),
loadBeanDefinitions(org.springframework.core.io.Resource[])

loadBeanDefinitions

int loadBeanDefinitions(String... locations)
                        throws BeanDefinitionStoreException
Load bean definitions from the specified resource locations.

Parameters:
locations - the resource locations, to be loaded with the ResourceLoader (or ResourcePatternResolver) of this bean definition reader
Returns:
the number of bean definitions found
Throws:
BeanDefinitionStoreException - in case of loading or parsing errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanDefinitionRegistry

org.springframework.beans.factory.support
Interface BeanDefinitionRegistry

All Superinterfaces:
AliasRegistry
All Known Implementing Classes:
AnnotationConfigApplicationContext, DefaultListableBeanFactory, GenericApplicationContext, GenericWebApplicationContext, GenericXmlApplicationContext, ResourceAdapterApplicationContext, SimpleBeanDefinitionRegistry, StaticApplicationContext, StaticPortletApplicationContext, StaticWebApplicationContext, XmlBeanFactory
public interface BeanDefinitionRegistry
extends AliasRegistry

Interface for registries that hold bean definitions, for example RootBeanDefinition and ChildBeanDefinition instances. Typically implemented by BeanFactories that internally work with the AbstractBeanDefinition hierarchy.

This is the only interface in Spring's bean factory packages that encapsulates registration of bean definitions. The standard BeanFactory interfaces only cover access to a fully configured factory instance.

Spring's bean definition readers expect to work on an implementation of this interface. Known implementors within the Spring core are DefaultListableBeanFactory and GenericApplicationContext.

Since:
26.11.2003
Author:
Juergen Hoeller
See Also:
BeanDefinition, AbstractBeanDefinition, RootBeanDefinition, ChildBeanDefinition, DefaultListableBeanFactory, GenericApplicationContext, XmlBeanDefinitionReader, PropertiesBeanDefinitionReader

Method Summary
boolean | containsBeanDefinition(String beanName) Check if this registry contains a bean definition with the given name.
BeanDefinition | getBeanDefinition(String beanName) Return the BeanDefinition for the given bean name.
int | getBeanDefinitionCount() Return the number of beans defined in the registry.
String[] | getBeanDefinitionNames() Return the names of all beans defined in this registry.
boolean | isBeanNameInUse(String beanName) Determine whether the given bean name is already in use within this registry, i.e.
void | registerBeanDefinition(String beanName, BeanDefinition beanDefinition) Register a new bean definition with this registry.
void | removeBeanDefinition(String beanName) Remove the BeanDefinition for the given name.
Methods inherited from interface org.springframework.core.AliasRegistry
getAliases, isAlias, registerAlias, removeAlias

Method Detail

registerBeanDefinition

void registerBeanDefinition(String beanName,
                            BeanDefinition beanDefinition)
                            throws BeanDefinitionStoreException
Register a new bean definition with this registry. Must support RootBeanDefinition and ChildBeanDefinition.

Parameters:
beanName - the name of the bean instance to register
beanDefinition - definition of the bean instance to register
Throws:
BeanDefinitionStoreException - if the BeanDefinition is invalid or if there is already a BeanDefinition for the specified bean name (and we are not allowed to override it)
See Also:
RootBeanDefinition, ChildBeanDefinition

removeBeanDefinition

void removeBeanDefinition(String beanName)
                          throws NoSuchBeanDefinitionException
Remove the BeanDefinition for the given name.

Parameters:
beanName - the name of the bean instance to register
Throws:
NoSuchBeanDefinitionException - if there is no such bean definition

getBeanDefinition

BeanDefinition getBeanDefinition(String beanName)
                                 throws NoSuchBeanDefinitionException
Return the BeanDefinition for the given bean name.

Parameters:
beanName - name of the bean to find a definition for
Returns:
the BeanDefinition for the given name (never null)
Throws:
NoSuchBeanDefinitionException - if there is no such bean definition

containsBeanDefinition

boolean containsBeanDefinition(String beanName)
Check if this registry contains a bean definition with the given name.

Parameters:
beanName - the name of the bean to look for
Returns:
if this registry contains a bean definition with the given name

getBeanDefinitionNames

String[] getBeanDefinitionNames()
Return the names of all beans defined in this registry.

Returns:
the names of all beans defined in this registry, or an empty array if none defined

getBeanDefinitionCount

int getBeanDefinitionCount()
Return the number of beans defined in the registry.

Returns:
the number of beans defined in the registry

isBeanNameInUse

boolean isBeanNameInUse(String beanName)
Determine whether the given bean name is already in use within this registry, i.e. whether there is a local bean or alias registered under this name.

Parameters:
beanName - the name to check
Returns:
whether the given bean name is already in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanDefinitionRegistryPostProcessor

org.springframework.beans.factory.support
Interface BeanDefinitionRegistryPostProcessor

All Superinterfaces:
BeanFactoryPostProcessor
All Known Implementing Classes:
ConfigurationClassPostProcessor
public interface BeanDefinitionRegistryPostProcessor
extends BeanFactoryPostProcessor

Extension to the standard BeanFactoryPostProcessor SPI, allowing for the registration of further bean definitions before regular BeanFactoryPostProcessor detection kicks in. In particular, BeanDefinitionRegistryPostProcessor may register further bean definitions which in turn define BeanFactoryPostProcessor instances.

Since:
3.0.1
Author:
Juergen Hoeller
See Also:
ConfigurationClassPostProcessor

Method Summary
 void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry)
Modify the application context's internal bean definition registry after its standard initialization.
Methods inherited from interface org.springframework.beans.factory.config.BeanFactoryPostProcessor
postProcessBeanFactory

Method Detail

postProcessBeanDefinitionRegistry

void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry)
                                       throws BeansException
Modify the application context's internal bean definition registry after its standard initialization. All regular bean definitions will have been loaded, but no beans will have been instantiated yet. This allows for adding further bean definitions before the next post-processing phase kicks in.

Parameters:
registry - the bean definition registry used by the application context
Throws:
BeansException - in case of errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanNameGenerator

org.springframework.beans.factory.support
Interface BeanNameGenerator

All Known Implementing Classes:
AnnotationBeanNameGenerator, DefaultBeanNameGenerator
public interface BeanNameGenerator

Strategy interface for generating bean names for bean definitions.

Since:
2.0.3
Author:
Juergen Hoeller

Method Summary
 String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry)
Generate a bean name for the given bean definition.

Method Detail

generateBeanName

String generateBeanName(BeanDefinition definition,
                        BeanDefinitionRegistry registry)
Generate a bean name for the given bean definition.

Parameters:
definition - the bean definition to generate a name for
registry - the bean definition registry that the given definition is supposed to be registered with
Returns:
the generated bean name
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InstantiationStrategy

org.springframework.beans.factory.support
Interface InstantiationStrategy

All Known Implementing Classes:
CglibSubclassingInstantiationStrategy, SimpleInstantiationStrategy
public interface InstantiationStrategy

Interface responsible for creating instances corresponding to a root bean definition.

This is pulled out into a strategy as various approaches are possible, including using CGLIB to create subclasses on the fly to support Method Injection.

Since:
1.1
Author:
Rod Johnson

Method Summary
Object | instantiate(RootBeanDefinition beanDefinition, String beanName, BeanFactory owner) Return an instance of the bean with the given name in this factory.
Object | instantiate(RootBeanDefinition beanDefinition, String beanName, BeanFactory owner, Constructor ctor, Object[] args) Return an instance of the bean with the given name in this factory, creating it via the given constructor.
Object | instantiate(RootBeanDefinition beanDefinition, String beanName, BeanFactory owner, Object factoryBean, Method factoryMethod, Object[] args) Return an instance of the bean with the given name in this factory, creating it via the given factory method.

Method Detail

instantiate

Object instantiate(RootBeanDefinition beanDefinition,
                   String beanName,
                   BeanFactory owner)
                   throws BeansException
Return an instance of the bean with the given name in this factory.

Parameters:
beanDefinition - the bean definition
beanName - name of the bean when it's created in this context. The name can be null if we're autowiring a bean that doesn't belong to the factory.
owner - owning BeanFactory
Returns:
a bean instance for this bean definition
Throws:
BeansException - if the instantiation failed

instantiate

Object instantiate(RootBeanDefinition beanDefinition,
                   String beanName,
                   BeanFactory owner,
                   Constructor ctor,
                   Object[] args)
                   throws BeansException
Return an instance of the bean with the given name in this factory, creating it via the given constructor.

Parameters:
beanDefinition - the bean definition
beanName - name of the bean when it's created in this context. The name can be null if we're autowiring a bean that doesn't belong to the factory.
owner - owning BeanFactory
ctor - the constructor to use
args - the constructor arguments to apply
Returns:
a bean instance for this bean definition
Throws:
BeansException - if the instantiation failed

instantiate

Object instantiate(RootBeanDefinition beanDefinition,
                   String beanName,
                   BeanFactory owner,
                   Object factoryBean,
                   Method factoryMethod,
                   Object[] args)
                   throws BeansException
Return an instance of the bean with the given name in this factory, creating it via the given factory method.

Parameters:
beanDefinition - bean definition
beanName - name of the bean when it's created in this context. The name can be null if we're autowiring a bean that doesn't belong to the factory.
owner - owning BeanFactory
factoryBean - the factory bean instance to call the factory method on, or null in case of a static factory method
factoryMethod - the factory method to use
args - the factory method arguments to apply
Returns:
a bean instance for this bean definition
Throws:
BeansException - if the instantiation failed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MergedBeanDefinitionPostProcessor

org.springframework.beans.factory.support
Interface MergedBeanDefinitionPostProcessor

All Superinterfaces:
BeanPostProcessor
All Known Implementing Classes:
AutowiredAnnotationBeanPostProcessor, CommonAnnotationBeanPostProcessor, InitDestroyAnnotationBeanPostProcessor, PersistenceAnnotationBeanPostProcessor, RequiredAnnotationBeanPostProcessor
public interface MergedBeanDefinitionPostProcessor
extends BeanPostProcessor

Post-processor callback interface for merged bean definitions at runtime. BeanPostProcessor implementations may implement this sub-interface in order to post-process the merged bean definition that the Spring BeanFactory uses to create a specific bean instance.

The postProcessMergedBeanDefinition(org.springframework.beans.factory.support.RootBeanDefinition, java.lang.Class, java.lang.String) method may for example introspect the bean definition in order to prepare some cached metadata before post-processing actual instances of a bean. It is also allowed to modify the bean definition but only for bean definition properties which are actually intended for concurrent modification. Basically, this only applies to operations defined on the RootBeanDefinition itself but not to the properties of its base classes.

Since:
2.5
Author:
Juergen Hoeller

Method Summary
 void postProcessMergedBeanDefinition(RootBeanDefinition beanDefinition, Class beanType, String beanName)
Post-process the given merged bean definition for the specified bean.
Methods inherited from interface org.springframework.beans.factory.config.BeanPostProcessor
postProcessAfterInitialization, postProcessBeforeInitialization

Method Detail

postProcessMergedBeanDefinition

void postProcessMergedBeanDefinition(RootBeanDefinition beanDefinition,
                                     Class beanType,
                                     String beanName)
Post-process the given merged bean definition for the specified bean.

Parameters:
beanDefinition - the merged bean definition for the bean
beanType - the actual type of the managed bean instance
beanName - the name of the bean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MethodReplacer

org.springframework.beans.factory.support
Interface MethodReplacer

public interface MethodReplacer

Interface to be implemented by classes that can reimplement any method on an IoC-managed object: the Method Injection form of Dependency Injection.

Such methods may be (but need not be) abstract, in which case the container will create a concrete subclass to instantiate.

Since:
1.1
Author:
Rod Johnson

Method Summary
 Object reimplement(Object obj, Method method, Object[] args)
Reimplement the given method.

Method Detail

reimplement

Object reimplement(Object obj,
                   Method method,
                   Object[] args)
                   throws Throwable
Reimplement the given method.

Parameters:
obj - the instance we're reimplementing the method for
method - the method to reimplement
args - arguments to the method
Returns:
return value for the method
Throws:
Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SecurityContextProvider

org.springframework.beans.factory.support
Interface SecurityContextProvider

All Known Implementing Classes:
SimpleSecurityContextProvider
public interface SecurityContextProvider

Provider of the security context of the code running inside the bean factory.

Since:
3.0
Author:
Costin Leau

Method Summary
 AccessControlContext getAccessControlContext()
Provides a security access control context relevant to a bean factory.

Method Detail

getAccessControlContext

AccessControlContext getAccessControlContext()
Provides a security access control context relevant to a bean factory.

Returns:
bean factory security control context
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractAutowireCapableBeanFactory

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.beans.factory.support
Class AbstractAutowireCapableBeanFactory

java.lang.Object
    extended by  org.springframework.core.SimpleAliasRegistry
        extended by  org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
            extended by  org.springframework.beans.factory.support.FactoryBeanRegistrySupport
                extended by  org.springframework.beans.factory.support.AbstractBeanFactory
                    extended by  org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
All Implemented Interfaces:
BeanFactory, AutowireCapableBeanFactory, ConfigurableBeanFactory, SingletonBeanRegistry, HierarchicalBeanFactory, AliasRegistry
Direct Known Subclasses:
DefaultListableBeanFactory
public abstract class AbstractAutowireCapableBeanFactory
extends AbstractBeanFactory
implements AutowireCapableBeanFactory

Abstract bean factory superclass that implements default bean creation, with the full capabilities specified by the RootBeanDefinition class. Implements the AutowireCapableBeanFactory interface in addition to AbstractBeanFactory's createBean(java.lang.Class) method.

Provides bean creation (with constructor resolution), property population, wiring (including autowiring), and initialization. Handles runtime bean references, resolves managed collections, calls initialization methods, etc. Supports autowiring constructors, properties by name, and properties by type.

The main template method to be implemented by subclasses is AutowireCapableBeanFactory.resolveDependency(DependencyDescriptor, String, Set, TypeConverter), used for autowiring by type. In case of a factory which is capable of searching its bean definitions, matching beans will typically be implemented through such a search. For other factory styles, simplified matching algorithms can be implemented.

Note that this class does not assume or implement bean definition registry capabilities. See DefaultListableBeanFactory for an implementation of the ListableBeanFactory and BeanDefinitionRegistry interfaces, which represent the API and SPI view of such a factory, respectively.

Since:
13.02.2004
Author:
Rod Johnson, Juergen Hoeller, Rob Harrop, Mark Fisher, Costin Leau
See Also:
RootBeanDefinition, DefaultListableBeanFactory, BeanDefinitionRegistry

Field Summary
Fields inherited from class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
logger, NULL_OBJECT
Fields inherited from interface org.springframework.beans.factory.config.AutowireCapableBeanFactory
AUTOWIRE_AUTODETECT, AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_CONSTRUCTOR, AUTOWIRE_NO
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Fields inherited from interface org.springframework.beans.factory.config.ConfigurableBeanFactory
SCOPE_PROTOTYPE, SCOPE_SINGLETON
Constructor Summary
AbstractAutowireCapableBeanFactory()
Create a new AbstractAutowireCapableBeanFactory.
AbstractAutowireCapableBeanFactory(BeanFactory parentBeanFactory)
Create a new AbstractAutowireCapableBeanFactory with the given parent.
Method Summary
 Object applyBeanPostProcessorsAfterInitialization(Object existingBean, String beanName)
Apply BeanPostProcessors to the given existing bean instance, invoking their postProcessAfterInitialization methods.
 Object applyBeanPostProcessorsBeforeInitialization(Object existingBean, String beanName)
Apply BeanPostProcessors to the given existing bean instance, invoking their postProcessBeforeInitialization methods.
protected  Object applyBeanPostProcessorsBeforeInstantiation(Class beanClass, String beanName)
Apply InstantiationAwareBeanPostProcessors to the specified bean definition (by class and name), invoking their postProcessBeforeInstantiation methods.
 void applyBeanPropertyValues(Object existingBean, String beanName)
Apply the property values of the bean definition with the given name to the given bean instance.
protected  void applyMergedBeanDefinitionPostProcessors(RootBeanDefinition mbd, Class beanType, String beanName)
Apply MergedBeanDefinitionPostProcessors to the specified bean definition, invoking their postProcessMergedBeanDefinition methods.
protected  void applyPropertyValues(String beanName, BeanDefinition mbd, BeanWrapper bw, PropertyValues pvs)
Apply the given property values, resolving any runtime references to other beans in this bean factory.
 Object autowire(Class beanClass, int autowireMode, boolean dependencyCheck)
Instantiate a new bean instance of the given class with the specified autowire strategy.
 void autowireBean(Object existingBean)
Populate the given bean instance through applying after-instantiation callbacks and bean property post-processing (e.g.
 void autowireBeanProperties(Object existingBean, int autowireMode, boolean dependencyCheck)
Autowire the bean properties of the given bean instance by name or type.
protected  void autowireByName(String beanName, AbstractBeanDefinition mbd, BeanWrapper bw, MutablePropertyValues pvs)
Fill in any missing property values with references to other beans in this factory if autowire is set to "byName".
protected  void autowireByType(String beanName, AbstractBeanDefinition mbd, BeanWrapper bw, MutablePropertyValues pvs)
Abstract method defining "autowire by type" (bean properties by type) behavior.
protected  BeanWrapper autowireConstructor(String beanName, RootBeanDefinition mbd, Constructor[] ctors, Object[] explicitArgs)
"autowire constructor" (with constructor arguments by type) behavior.
protected  void checkDependencies(String beanName, AbstractBeanDefinition mbd, PropertyDescriptor[] pds, PropertyValues pvs)
Perform a dependency check that all properties exposed have been set, if desired.
 Object configureBean(Object existingBean, String beanName)
Configure the given raw bean: autowiring bean properties, applying bean property values, applying factory callbacks such as setBeanName and setBeanFactory, and also applying all bean post processors (including ones which might wrap the given raw bean).
 void copyConfigurationFrom(ConfigurableBeanFactory otherFactory)
Copy all relevant configuration from the given other factory.
<T> T
createBean(Class<T> beanClass)
Fully create a new bean instance of the given class.
 Object createBean(Class beanClass, int autowireMode, boolean dependencyCheck)
Fully create a new bean instance of the given class with the specified autowire strategy.
protected  Object createBean(String beanName, RootBeanDefinition mbd, Object[] args)
Central method of this class: creates a bean instance, populates the bean instance, applies post-processors, etc.
protected  BeanWrapper createBeanInstance(String beanName, RootBeanDefinition mbd, Object[] args)
Create a new instance for the specified bean, using an appropriate instantiation strategy: factory method, constructor autowiring, or simple instantiation.
protected  Constructor[] determineConstructorsFromBeanPostProcessors(Class beanClass, String beanName)
Determine candidate constructors to use for the given bean, checking all registered SmartInstantiationAwareBeanPostProcessors.
protected  Object doCreateBean(String beanName, RootBeanDefinition mbd, Object[] args)
Actually create the specified bean.
protected  PropertyDescriptor[] filterPropertyDescriptorsForDependencyCheck(BeanWrapper bw)
Extract a filtered set of PropertyDescriptors from the given BeanWrapper, excluding ignored dependency types or properties defined on ignored dependency interfaces.
protected  Object getEarlyBeanReference(String beanName, RootBeanDefinition mbd, Object bean)
Obtain a reference for early access to the specified bean, typically for the purpose of resolving a circular reference.
protected  InstantiationStrategy getInstantiationStrategy()
Return the instantiation strategy to use for creating bean instances.
protected  ParameterNameDiscoverer getParameterNameDiscoverer()
Return the ParameterNameDiscoverer to use for resolving method parameter names if needed.
protected  Class getTypeForFactoryBean(String beanName, RootBeanDefinition mbd)
This implementation checks the FactoryBean's getObjectType method on a plain instance of the FactoryBean, without bean properties applied yet.
protected  Class getTypeForFactoryMethod(String beanName, RootBeanDefinition mbd, Class[] typesToMatch)
Determine the bean type for the given bean definition which is based on a factory method.
 void ignoreDependencyInterface(Class ifc)
Ignore the given dependency interface for autowiring.
 void ignoreDependencyType(Class type)
Ignore the given dependency type for autowiring: for example, String.
 Object initializeBean(Object existingBean, String beanName)
Initialize the given raw bean, applying factory callbacks such as setBeanName and setBeanFactory, also applying all bean post processors (including ones which might wrap the given raw bean).
protected  Object initializeBean(String beanName, Object bean, RootBeanDefinition mbd)
Initialize the given bean instance, applying factory callbacks as well as init methods and bean post processors.
protected  BeanWrapper instantiateBean(String beanName, RootBeanDefinition mbd)
Instantiate the given bean using its default constructor.
protected  BeanWrapper instantiateUsingFactoryMethod(String beanName, RootBeanDefinition mbd, Object[] explicitArgs)
Instantiate the bean using a named factory method.
protected  void invokeCustomInitMethod(String beanName, Object bean, RootBeanDefinition mbd)
Invoke the specified custom init method on the given bean.
protected  void invokeInitMethods(String beanName, Object bean, RootBeanDefinition mbd)
Give a bean a chance to react now all its properties are set, and a chance to know about its owning bean factory (this object).
protected  boolean isExcludedFromDependencyCheck(PropertyDescriptor pd)
Determine whether the given bean property is excluded from dependency checks.
protected  void populateBean(String beanName, AbstractBeanDefinition mbd, BeanWrapper bw)
Populate the bean instance in the given BeanWrapper with the property values from the bean definition.
protected  Object postProcessObjectFromFactoryBean(Object object, String beanName)
Applies the postProcessAfterInitialization callback of all registered BeanPostProcessors, giving them a chance to post-process the object obtained from FactoryBeans (for example, to auto-proxy them).
protected  Class predictBeanType(String beanName, RootBeanDefinition mbd, Class[] typesToMatch)
Predict the eventual bean type (of the processed bean instance) for the specified bean.
protected  void removeSingleton(String beanName)
Overridden to clear FactoryBean instance cache as well.
protected  Object resolveBeforeInstantiation(String beanName, RootBeanDefinition mbd)
Apply before-instantiation post-processors, resolving whether there is a before-instantiation shortcut for the specified bean.
 Object resolveDependency(DependencyDescriptor descriptor, String beanName)
Resolve the specified dependency against the beans defined in this factory.
 void setAllowCircularReferences(boolean allowCircularReferences)
Set whether to allow circular references between beans - and automatically try to resolve them.
 void setAllowRawInjectionDespiteWrapping(boolean allowRawInjectionDespiteWrapping)
Set whether to allow the raw injection of a bean instance into some other bean's property, despite the injected bean eventually getting wrapped (for example, through AOP auto-proxying).
 void setInstantiationStrategy(InstantiationStrategy instantiationStrategy)
Set the instantiation strategy to use for creating bean instances.
 void setParameterNameDiscoverer(ParameterNameDiscoverer parameterNameDiscoverer)
Set the ParameterNameDiscoverer to use for resolving method parameter names if needed (e.g.
protected  String[] unsatisfiedNonSimpleProperties(AbstractBeanDefinition mbd, BeanWrapper bw)
Return an array of non-simple bean properties that are unsatisfied.
Methods inherited from class org.springframework.beans.factory.support.AbstractBeanFactory
addBeanPostProcessor, addEmbeddedValueResolver, addPropertyEditorRegistrar, afterPrototypeCreation, beforePrototypeCreation, checkMergedBeanDefinition, clearMergedBeanDefinition, containsBean, containsBeanDefinition, containsLocalBean, copyRegisteredEditorsTo, destroyBean, destroyBean, destroyScopedBean, doGetBean, evaluateBeanDefinitionString, getAccessControlContext, getAliases, getBean, getBean, getBean, getBean, getBeanClassLoader, getBeanDefinition, getBeanExpressionResolver, getBeanPostProcessorCount, getBeanPostProcessors, getConversionService, getCustomEditors, getCustomTypeConverter, getMergedBeanDefinition, getMergedBeanDefinition, getMergedBeanDefinition, getMergedLocalBeanDefinition, getObjectForBeanInstance, getParentBeanFactory, getPropertyEditorRegistrars, getRegisteredScope, getRegisteredScopeNames, getTempClassLoader, getType, getTypeConverter, hasDestructionAwareBeanPostProcessors, hasInstantiationAwareBeanPostProcessors, initBeanWrapper, isBeanEligibleForMetadataCaching, isBeanNameInUse, isCacheBeanMetadata, isCurrentlyInCreation, isFactoryBean, isFactoryBean, isPrototype, isPrototypeCurrentlyInCreation, isSingleton, isTypeMatch, markBeanAsCreated, originalBeanName, registerCustomEditor, registerCustomEditors, registerDisposableBeanIfNecessary, registerScope, removeSingletonIfCreatedForTypeCheckOnly, requiresDestruction, resolveBeanClass, resolveEmbeddedValue, setBeanClassLoader, setBeanExpressionResolver, setCacheBeanMetadata, setConversionService, setParentBeanFactory, setSecurityContextProvider, setTempClassLoader, setTypeConverter, transformedBeanName
Methods inherited from class org.springframework.beans.factory.support.FactoryBeanRegistrySupport
getCachedObjectForFactoryBean, getFactoryBean, getObjectFromFactoryBean, getTypeForFactoryBean
Methods inherited from class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
addSingleton, addSingletonFactory, afterSingletonCreation, beforeSingletonCreation, containsSingleton, destroyBean, destroySingleton, destroySingletons, getDependenciesForBean, getDependentBeans, getSingleton, getSingleton, getSingleton, getSingletonCount, getSingletonMutex, getSingletonNames, hasDependentBean, isSingletonCurrentlyInCreation, onSuppressedException, registerContainedBean, registerDependentBean, registerDisposableBean, registerSingleton
Methods inherited from class org.springframework.core.SimpleAliasRegistry
allowAliasOverriding, canonicalName, isAlias, registerAlias, removeAlias, resolveAliases
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.config.AutowireCapableBeanFactory
resolveDependency
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getBean, getBean, getType, isPrototype, isSingleton, isTypeMatch
Methods inherited from interface org.springframework.beans.factory.config.ConfigurableBeanFactory
destroySingletons, getDependenciesForBean, getDependentBeans, registerAlias, registerDependentBean, resolveAliases
Methods inherited from interface org.springframework.beans.factory.config.SingletonBeanRegistry
containsSingleton, getSingleton, getSingletonCount, getSingletonNames, registerSingleton

Constructor Detail

AbstractAutowireCapableBeanFactory

public AbstractAutowireCapableBeanFactory()
Create a new AbstractAutowireCapableBeanFactory.

AbstractAutowireCapableBeanFactory

public AbstractAutowireCapableBeanFactory(BeanFactory parentBeanFactory)
Create a new AbstractAutowireCapableBeanFactory with the given parent.

Parameters:
parentBeanFactory - parent bean factory, or null if none
Method Detail

setInstantiationStrategy

public void setInstantiationStrategy(InstantiationStrategy instantiationStrategy)
Set the instantiation strategy to use for creating bean instances. Default is CglibSubclassingInstantiationStrategy.

See Also:
CglibSubclassingInstantiationStrategy

getInstantiationStrategy

protected InstantiationStrategy getInstantiationStrategy()
Return the instantiation strategy to use for creating bean instances.

setParameterNameDiscoverer

public void setParameterNameDiscoverer(ParameterNameDiscoverer parameterNameDiscoverer)
Set the ParameterNameDiscoverer to use for resolving method parameter names if needed (e.g. for constructor names).

Default is none. A typical candidate is LocalVariableTableParameterNameDiscoverer, which implies an ASM dependency and hence isn't set as the default.

getParameterNameDiscoverer

protected ParameterNameDiscoverer getParameterNameDiscoverer()
Return the ParameterNameDiscoverer to use for resolving method parameter names if needed.

setAllowCircularReferences

public void setAllowCircularReferences(boolean allowCircularReferences)
Set whether to allow circular references between beans - and automatically try to resolve them.

Note that circular reference resolution means that one of the involved beans will receive a reference to another bean that is not fully initialized yet. This can lead to subtle and not-so-subtle side effects on initialization; it does work fine for many scenarios, though.

Default is "true". Turn this off to throw an exception when encountering a circular reference, disallowing them completely.

NOTE: It is generally recommended to not rely on circular references between your beans. Refactor your application logic to have the two beans involved delegate to a third bean that encapsulates their common logic.

setAllowRawInjectionDespiteWrapping

public void setAllowRawInjectionDespiteWrapping(boolean allowRawInjectionDespiteWrapping)
Set whether to allow the raw injection of a bean instance into some other bean's property, despite the injected bean eventually getting wrapped (for example, through AOP auto-proxying).

This will only be used as a last resort in case of a circular reference that cannot be resolved otherwise: essentially, preferring a raw instance getting injected over a failure of the entire bean wiring process.

Default is "false", as of Spring 2.0. Turn this on to allow for non-wrapped raw beans injected into some of your references, which was Spring 1.2's (arguably unclean) default behavior.

NOTE: It is generally recommended to not rely on circular references between your beans, in particular with auto-proxying involved.

See Also:
setAllowCircularReferences(boolean)

ignoreDependencyType

public void ignoreDependencyType(Class type)
Ignore the given dependency type for autowiring: for example, String. Default is none.

ignoreDependencyInterface

public void ignoreDependencyInterface(Class ifc)
Ignore the given dependency interface for autowiring.

This will typically be used by application contexts to register dependencies that are resolved in other ways, like BeanFactory through BeanFactoryAware or ApplicationContext through ApplicationContextAware.

By default, only the BeanFactoryAware interface is ignored. For further types to ignore, invoke this method for each type.

See Also:
BeanFactoryAware, ApplicationContextAware

copyConfigurationFrom

public void copyConfigurationFrom(ConfigurableBeanFactory otherFactory)
Description copied from interface: ConfigurableBeanFactory
Copy all relevant configuration from the given other factory.

Should include all standard configuration settings as well as BeanPostProcessors, Scopes, and factory-specific internal settings. Should not include any metadata of actual bean definitions, such as BeanDefinition objects and bean name aliases.

Specified by:
copyConfigurationFrom in interface ConfigurableBeanFactory
Overrides:
copyConfigurationFrom in class AbstractBeanFactory
Parameters:
otherFactory - the other BeanFactory to copy from

createBean

public <T> T createBean(Class<T> beanClass)
             throws BeansException
Description copied from interface: AutowireCapableBeanFactory
Fully create a new bean instance of the given class.

Performs full initialization of the bean, including all applicable BeanPostProcessors.

Note: This is intended for creating a fresh instance, populating annotated fields and methods as well as applying all standard bean initialiation callbacks. It does not imply traditional by-name or by-type autowiring of properties; use AutowireCapableBeanFactory.createBean(Class, int, boolean) for that purposes.

Specified by:
createBean in interface AutowireCapableBeanFactory
Parameters:
beanClass - the class of the bean to create
Returns:
the new bean instance
Throws:
BeansException - if instantiation or wiring failed

autowireBean

public void autowireBean(Object existingBean)
Description copied from interface: AutowireCapableBeanFactory
Populate the given bean instance through applying after-instantiation callbacks and bean property post-processing (e.g. for annotation-driven injection).

Note: This is essentially intended for (re-)populating annotated fields and methods, either for new instances or for deserialized instances. It does not imply traditional by-name or by-type autowiring of properties; use AutowireCapableBeanFactory.autowireBeanProperties(java.lang.Object, int, boolean) for that purposes.

Specified by:
autowireBean in interface AutowireCapableBeanFactory
Parameters:
existingBean - the existing bean instance

configureBean

public Object configureBean(Object existingBean,
                            String beanName)
                     throws BeansException
Description copied from interface: AutowireCapableBeanFactory
Configure the given raw bean: autowiring bean properties, applying bean property values, applying factory callbacks such as setBeanName and setBeanFactory, and also applying all bean post processors (including ones which might wrap the given raw bean).

This is effectively a superset of what AutowireCapableBeanFactory.initializeBean(java.lang.Object, java.lang.String) provides, fully applying the configuration specified by the corresponding bean definition. Note: This method requires a bean definition for the given name!

Specified by:
configureBean in interface AutowireCapableBeanFactory
Parameters:
existingBean - the existing bean instance
beanName - the name of the bean, to be passed to it if necessary (a bean definition of that name has to be available)
Returns:
the bean instance to use, either the original or a wrapped one
Throws:
NoSuchBeanDefinitionException - if there is no bean definition with the given name
BeansException - if the initialization failed
See Also:
AutowireCapableBeanFactory.initializeBean(java.lang.Object, java.lang.String)

resolveDependency

public Object resolveDependency(DependencyDescriptor descriptor,
                                String beanName)
                         throws BeansException
Description copied from interface: AutowireCapableBeanFactory
Resolve the specified dependency against the beans defined in this factory.

Specified by:
resolveDependency in interface AutowireCapableBeanFactory
Parameters:
descriptor - the descriptor for the dependency
beanName - the name of the bean which declares the present dependency
Returns:
the resolved object, or null if none found
Throws:
BeansException - in dependency resolution failed

createBean

public Object createBean(Class beanClass,
                         int autowireMode,
                         boolean dependencyCheck)
                  throws BeansException
Description copied from interface: AutowireCapableBeanFactory
Fully create a new bean instance of the given class with the specified autowire strategy. All constants defined in this interface are supported here.

Performs full initialization of the bean, including all applicable BeanPostProcessors. This is effectively a superset of what AutowireCapableBeanFactory.autowire(java.lang.Class, int, boolean) provides, adding AutowireCapableBeanFactory.initializeBean(java.lang.Object, java.lang.String) behavior.

Specified by:
createBean in interface AutowireCapableBeanFactory
Parameters:
beanClass - the class of the bean to create
autowireMode - by name or type, using the constants in this interface
dependencyCheck - whether to perform a dependency check for objects (not applicable to autowiring a constructor, thus ignored there)
Returns:
the new bean instance
Throws:
BeansException - if instantiation or wiring failed
See Also:
AutowireCapableBeanFactory.AUTOWIRE_NO, AutowireCapableBeanFactory.AUTOWIRE_BY_NAME, AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE, AutowireCapableBeanFactory.AUTOWIRE_CONSTRUCTOR

autowire

public Object autowire(Class beanClass,
                       int autowireMode,
                       boolean dependencyCheck)
                throws BeansException
Description copied from interface: AutowireCapableBeanFactory
Instantiate a new bean instance of the given class with the specified autowire strategy. All constants defined in this interface are supported here. Can also be invoked with AUTOWIRE_NO in order to just apply before-instantiation callbacks (e.g. for annotation-driven injection).

Does not apply standard BeanPostProcessors callbacks or perform any further initialization of the bean. This interface offers distinct, fine-grained operations for those purposes, for example AutowireCapableBeanFactory.initializeBean(java.lang.Object, java.lang.String). However, InstantiationAwareBeanPostProcessor callbacks are applied, if applicable to the construction of the instance.

Specified by:
autowire in interface AutowireCapableBeanFactory
Parameters:
beanClass - the class of the bean to instantiate
autowireMode - by name or type, using the constants in this interface
dependencyCheck - whether to perform a dependency check for object references in the bean instance (not applicable to autowiring a constructor, thus ignored there)
Returns:
the new bean instance
Throws:
BeansException - if instantiation or wiring failed
See Also:
AutowireCapableBeanFactory.AUTOWIRE_NO, AutowireCapableBeanFactory.AUTOWIRE_BY_NAME, AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE, AutowireCapableBeanFactory.AUTOWIRE_CONSTRUCTOR, AutowireCapableBeanFactory.AUTOWIRE_AUTODETECT, AutowireCapableBeanFactory.initializeBean(java.lang.Object, java.lang.String), AutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(java.lang.Object, java.lang.String), AutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(java.lang.Object, java.lang.String)

autowireBeanProperties

public void autowireBeanProperties(Object existingBean,
                                   int autowireMode,
                                   boolean dependencyCheck)
                            throws BeansException
Description copied from interface: AutowireCapableBeanFactory
Autowire the bean properties of the given bean instance by name or type. Can also be invoked with AUTOWIRE_NO in order to just apply after-instantiation callbacks (e.g. for annotation-driven injection).

Does not apply standard BeanPostProcessors callbacks or perform any further initialization of the bean. This interface offers distinct, fine-grained operations for those purposes, for example AutowireCapableBeanFactory.initializeBean(java.lang.Object, java.lang.String). However, InstantiationAwareBeanPostProcessor callbacks are applied, if applicable to the configuration of the instance.

Specified by:
autowireBeanProperties in interface AutowireCapableBeanFactory
Parameters:
existingBean - the existing bean instance
autowireMode - by name or type, using the constants in this interface
dependencyCheck - whether to perform a dependency check for object references in the bean instance
Throws:
BeansException - if wiring failed
See Also:
AutowireCapableBeanFactory.AUTOWIRE_BY_NAME, AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE, AutowireCapableBeanFactory.AUTOWIRE_NO

applyBeanPropertyValues

public void applyBeanPropertyValues(Object existingBean,
                                    String beanName)
                             throws BeansException
Description copied from interface: AutowireCapableBeanFactory
Apply the property values of the bean definition with the given name to the given bean instance. The bean definition can either define a fully self-contained bean, reusing its property values, or just property values meant to be used for existing bean instances.

This method does not autowire bean properties; it just applies explicitly defined property values. Use the AutowireCapableBeanFactory.autowireBeanProperties(java.lang.Object, int, boolean) method to autowire an existing bean instance. Note: This method requires a bean definition for the given name!

Does not apply standard BeanPostProcessors callbacks or perform any further initialization of the bean. This interface offers distinct, fine-grained operations for those purposes, for example AutowireCapableBeanFactory.initializeBean(java.lang.Object, java.lang.String). However, InstantiationAwareBeanPostProcessor callbacks are applied, if applicable to the configuration of the instance.

Specified by:
applyBeanPropertyValues in interface AutowireCapableBeanFactory
Parameters:
existingBean - the existing bean instance
beanName - the name of the bean definition in the bean factory (a bean definition of that name has to be available)
Throws:
NoSuchBeanDefinitionException - if there is no bean definition with the given name
BeansException - if applying the property values failed
See Also:
AutowireCapableBeanFactory.autowireBeanProperties(java.lang.Object, int, boolean)

initializeBean

public Object initializeBean(Object existingBean,
                             String beanName)
Description copied from interface: AutowireCapableBeanFactory
Initialize the given raw bean, applying factory callbacks such as setBeanName and setBeanFactory, also applying all bean post processors (including ones which might wrap the given raw bean).

Note that no bean definition of the given name has to exist in the bean factory. The passed-in bean name will simply be used for callbacks but not checked against the registered bean definitions.

Specified by:
initializeBean in interface AutowireCapableBeanFactory
Parameters:
existingBean - the existing bean instance
beanName - the name of the bean, to be passed to it if necessary (only passed to BeanPostProcessors)
Returns:
the bean instance to use, either the original or a wrapped one

applyBeanPostProcessorsBeforeInitialization

public Object applyBeanPostProcessorsBeforeInitialization(Object existingBean,
                                                          String beanName)
                                                   throws BeansException
Description copied from interface: AutowireCapableBeanFactory
Apply BeanPostProcessors to the given existing bean instance, invoking their postProcessBeforeInitialization methods. The returned bean instance may be a wrapper around the original.

Specified by:
applyBeanPostProcessorsBeforeInitialization in interface AutowireCapableBeanFactory
Parameters:
existingBean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one
Throws:
BeansException - if any post-processing failed
See Also:
BeanPostProcessor.postProcessBeforeInitialization(java.lang.Object, java.lang.String)

applyBeanPostProcessorsAfterInitialization

public Object applyBeanPostProcessorsAfterInitialization(Object existingBean,
                                                         String beanName)
                                                  throws BeansException
Description copied from interface: AutowireCapableBeanFactory
Apply BeanPostProcessors to the given existing bean instance, invoking their postProcessAfterInitialization methods. The returned bean instance may be a wrapper around the original.

Specified by:
applyBeanPostProcessorsAfterInitialization in interface AutowireCapableBeanFactory
Parameters:
existingBean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one
Throws:
BeansException - if any post-processing failed
See Also:
BeanPostProcessor.postProcessAfterInitialization(java.lang.Object, java.lang.String)

createBean

protected Object createBean(String beanName,
                            RootBeanDefinition mbd,
                            Object[] args)
                     throws BeanCreationException
Central method of this class: creates a bean instance, populates the bean instance, applies post-processors, etc.

Specified by:
createBean in class AbstractBeanFactory
Parameters:
beanName - the name of the bean
mbd - the merged bean definition for the bean
args - arguments to use if creating a prototype using explicit arguments to a static factory method. This parameter must be null except in this case.
Returns:
a new instance of the bean
Throws:
BeanCreationException - if the bean could not be created
See Also:
doCreateBean(java.lang.String, org.springframework.beans.factory.support.RootBeanDefinition, java.lang.Object[])

doCreateBean

protected Object doCreateBean(String beanName,
                              RootBeanDefinition mbd,
                              Object[] args)
Actually create the specified bean. Pre-creation processing has already happened at this point, e.g. checking postProcessBeforeInstantiation callbacks.

Differentiates between default bean instantiation, use of a factory method, and autowiring a constructor.

Parameters:
beanName - the name of the bean
mbd - the merged bean definition for the bean
args - arguments to use if creating a prototype using explicit arguments to a static factory method. This parameter must be null except in this case.
Returns:
a new instance of the bean
Throws:
BeanCreationException - if the bean could not be created
See Also:
instantiateBean(java.lang.String, org.springframework.beans.factory.support.RootBeanDefinition),
instantiateUsingFactoryMethod(java.lang.String, org.springframework.beans.factory.support.RootBeanDefinition, java.lang.Object[]),
autowireConstructor(java.lang.String, org.springframework.beans.factory.support.RootBeanDefinition, java.lang.reflect.Constructor[], java.lang.Object[])

predictBeanType

protected Class predictBeanType(String beanName,
                                RootBeanDefinition mbd,
                                Class[] typesToMatch)
Description copied from class: AbstractBeanFactory
Predict the eventual bean type (of the processed bean instance) for the specified bean. Called by AbstractBeanFactory.getType(java.lang.String) and AbstractBeanFactory.isTypeMatch(java.lang.String, java.lang.Class). Does not need to handle FactoryBeans specifically, since it is only supposed to operate on the raw bean type.

This implementation is simplistic in that it is not able to handle factory methods and InstantiationAwareBeanPostProcessors. It only predicts the bean type correctly for a standard bean. To be overridden in subclasses, applying more sophisticated type detection.

Overrides:
predictBeanType in class AbstractBeanFactory
Parameters:
beanName - the name of the bean
mbd - the merged bean definition to determine the type for
typesToMatch - the types to match in case of internal type matching purposes (also signals that the returned Class will never be exposed to application code)
Returns:
the type of the bean, or null if not predictable

getTypeForFactoryMethod

protected Class getTypeForFactoryMethod(String beanName,
                                        RootBeanDefinition mbd,
                                        Class[] typesToMatch)
Determine the bean type for the given bean definition which is based on a factory method. Only called if there is no singleton instance registered for the target bean already.

This implementation determines the type matching createBean(java.lang.Class)'s different creation strategies. As far as possible, we'll perform static type checking to avoid creation of the target bean.

Parameters:
beanName - the name of the bean (for error handling purposes)
mbd - the merged bean definition for the bean
typesToMatch - the types to match in case of internal type matching purposes (also signals that the returned Class will never be exposed to application code)
Returns:
the type for the bean if determinable, or null else
See Also:
createBean(java.lang.Class)

getTypeForFactoryBean

protected Class getTypeForFactoryBean(String beanName,
                                      RootBeanDefinition mbd)
This implementation checks the FactoryBean's getObjectType method on a plain instance of the FactoryBean, without bean properties applied yet. If this doesn't return a type yet, a full creation of the FactoryBean is used as fallback (through delegation to the superclass's implementation).

The shortcut check for a FactoryBean is only applied in case of a singleton FactoryBean. If the FactoryBean instance itself is not kept as singleton, it will be fully created to check the type of its exposed object.

Overrides:
getTypeForFactoryBean in class AbstractBeanFactory
Parameters:
beanName - the name of the bean
mbd - the merged bean definition for the bean
Returns:
the type for the bean if determinable, or null else
See Also:
FactoryBean.getObjectType(), AbstractBeanFactory.getBean(String)

getEarlyBeanReference

protected Object getEarlyBeanReference(String beanName,
                                       RootBeanDefinition mbd,
                                       Object bean)
Obtain a reference for early access to the specified bean, typically for the purpose of resolving a circular reference.

Parameters:
beanName - the name of the bean (for error handling purposes)
mbd - the merged bean definition for the bean
bean - the raw bean instance
Returns:
the object to expose as bean reference

applyMergedBeanDefinitionPostProcessors

protected void applyMergedBeanDefinitionPostProcessors(RootBeanDefinition mbd,
                                                       Class beanType,
                                                       String beanName)
                                                throws BeansException
Apply MergedBeanDefinitionPostProcessors to the specified bean definition, invoking their postProcessMergedBeanDefinition methods.

Parameters:
mbd - the merged bean definition for the bean
beanType - the actual type of the managed bean instance
beanName - the name of the bean
Throws:
BeansException - if any post-processing failed
See Also:
MergedBeanDefinitionPostProcessor.postProcessMergedBeanDefinition(org.springframework.beans.factory.support.RootBeanDefinition, java.lang.Class, java.lang.String)

resolveBeforeInstantiation

protected Object resolveBeforeInstantiation(String beanName,
                                            RootBeanDefinition mbd)
Apply before-instantiation post-processors, resolving whether there is a before-instantiation shortcut for the specified bean.

Parameters:
beanName - the name of the bean
mbd - the bean definition for the bean
Returns:
the shortcut-determined bean instance, or null if none

applyBeanPostProcessorsBeforeInstantiation

protected Object applyBeanPostProcessorsBeforeInstantiation(Class beanClass,
                                                            String beanName)
                                                     throws BeansException
Apply InstantiationAwareBeanPostProcessors to the specified bean definition (by class and name), invoking their postProcessBeforeInstantiation methods.

Any returned object will be used as the bean instead of actually instantiating the target bean. A null return value from the post-processor will result in the target bean being instantiated.

Parameters:
beanClass - the class of the bean to be instantiated
beanName - the name of the bean
Returns:
the bean object to use instead of a default instance of the target bean, or null
Throws:
BeansException - if any post-processing failed
See Also:
InstantiationAwareBeanPostProcessor.postProcessBeforeInstantiation(java.lang.Class, java.lang.String)

createBeanInstance

protected BeanWrapper createBeanInstance(String beanName,
                                         RootBeanDefinition mbd,
                                         Object[] args)
Create a new instance for the specified bean, using an appropriate instantiation strategy: factory method, constructor autowiring, or simple instantiation.

Parameters:
beanName - the name of the bean
mbd - the bean definition for the bean
args - arguments to use if creating a prototype using explicit arguments to a static factory method. It is invalid to use a non-null args value in any other case.
Returns:
BeanWrapper for the new instance
See Also:
instantiateUsingFactoryMethod(java.lang.String, org.springframework.beans.factory.support.RootBeanDefinition, java.lang.Object[]),
autowireConstructor(java.lang.String, org.springframework.beans.factory.support.RootBeanDefinition, java.lang.reflect.Constructor[], java.lang.Object[]),
instantiateBean(java.lang.String, org.springframework.beans.factory.support.RootBeanDefinition)

determineConstructorsFromBeanPostProcessors

protected Constructor[] determineConstructorsFromBeanPostProcessors(Class beanClass,
                                                                    String beanName)
                                                             throws BeansException
Determine candidate constructors to use for the given bean, checking all registered SmartInstantiationAwareBeanPostProcessors.

Parameters:
beanClass - the raw class of the bean
beanName - the name of the bean
Returns:
the candidate constructors, or null if none specified
Throws:
BeansException - in case of errors
See Also:
SmartInstantiationAwareBeanPostProcessor.determineCandidateConstructors(java.lang.Class, java.lang.String)

instantiateBean

protected BeanWrapper instantiateBean(String beanName,
                                      RootBeanDefinition mbd)
Instantiate the given bean using its default constructor.

Parameters:
beanName - the name of the bean
mbd - the bean definition for the bean
Returns:
BeanWrapper for the new instance

instantiateUsingFactoryMethod

protected BeanWrapper instantiateUsingFactoryMethod(String beanName,
                                                    RootBeanDefinition mbd,
                                                    Object[] explicitArgs)
Instantiate the bean using a named factory method. The method may be static, if the mbd parameter specifies a class, rather than a factoryBean, or an instance variable on a factory object itself configured using Dependency Injection.

Parameters:
beanName - the name of the bean
mbd - the bean definition for the bean
explicitArgs - argument values passed in programmatically via the getBean method, or null if none (-> use constructor argument values from bean definition)
Returns:
BeanWrapper for the new instance
See Also:
AbstractBeanFactory.getBean(String, Object[])

autowireConstructor

protected BeanWrapper autowireConstructor(String beanName,
                                          RootBeanDefinition mbd,
                                          Constructor[] ctors,
                                          Object[] explicitArgs)
"autowire constructor" (with constructor arguments by type) behavior. Also applied if explicit constructor argument values are specified, matching all remaining arguments with beans from the bean factory.

This corresponds to constructor injection: In this mode, a Spring bean factory is able to host components that expect constructor-based dependency resolution.

Parameters:
beanName - the name of the bean
mbd - the bean definition for the bean
ctors - the chosen candidate constructors
explicitArgs - argument values passed in programmatically via the getBean method, or null if none (-> use constructor argument values from bean definition)
Returns:
BeanWrapper for the new instance

populateBean

protected void populateBean(String beanName,
                            AbstractBeanDefinition mbd,
                            BeanWrapper bw)
Populate the bean instance in the given BeanWrapper with the property values from the bean definition.

Parameters:
beanName - the name of the bean
mbd - the bean definition for the bean
bw - BeanWrapper with bean instance

autowireByName

protected void autowireByName(String beanName,
                              AbstractBeanDefinition mbd,
                              BeanWrapper bw,
                              MutablePropertyValues pvs)
Fill in any missing property values with references to other beans in this factory if autowire is set to "byName".

Parameters:
beanName - the name of the bean we're wiring up. Useful for debugging messages; not used functionally.
mbd - bean definition to update through autowiring
bw - BeanWrapper from which we can obtain information about the bean
pvs - the PropertyValues to register wired objects with

autowireByType

protected void autowireByType(String beanName,
                              AbstractBeanDefinition mbd,
                              BeanWrapper bw,
                              MutablePropertyValues pvs)
Abstract method defining "autowire by type" (bean properties by type) behavior.

This is like PicoContainer default, in which there must be exactly one bean of the property type in the bean factory. This makes bean factories simple to configure for small namespaces, but doesn't work as well as standard Spring behavior for bigger applications.

Parameters:
beanName - the name of the bean to autowire by type
mbd - the merged bean definition to update through autowiring
bw - BeanWrapper from which we can obtain information about the bean
pvs - the PropertyValues to register wired objects with

unsatisfiedNonSimpleProperties

protected String[] unsatisfiedNonSimpleProperties(AbstractBeanDefinition mbd,
                                                  BeanWrapper bw)
Return an array of non-simple bean properties that are unsatisfied. These are probably unsatisfied references to other beans in the factory. Does not include simple properties like primitives or Strings.

Parameters:
mbd - the merged bean definition the bean was created with
bw - the BeanWrapper the bean was created with
Returns:
an array of bean property names
See Also:
BeanUtils.isSimpleProperty(java.lang.Class)

filterPropertyDescriptorsForDependencyCheck

protected PropertyDescriptor[] filterPropertyDescriptorsForDependencyCheck(BeanWrapper bw)
Extract a filtered set of PropertyDescriptors from the given BeanWrapper, excluding ignored dependency types or properties defined on ignored dependency interfaces.

Parameters:
bw - the BeanWrapper the bean was created with
Returns:
the filtered PropertyDescriptors
See Also:
isExcludedFromDependencyCheck(java.beans.PropertyDescriptor)

isExcludedFromDependencyCheck

protected boolean isExcludedFromDependencyCheck(PropertyDescriptor pd)
Determine whether the given bean property is excluded from dependency checks.

This implementation excludes properties defined by CGLIB and properties whose type matches an ignored dependency type or which are defined by an ignored dependency interface.

Parameters:
pd - the PropertyDescriptor of the bean property
Returns:
whether the bean property is excluded
See Also:
ignoreDependencyType(Class), ignoreDependencyInterface(Class)

checkDependencies

protected void checkDependencies(String beanName,
                                 AbstractBeanDefinition mbd,
                                 PropertyDescriptor[] pds,
                                 PropertyValues pvs)
                          throws UnsatisfiedDependencyException
Perform a dependency check that all properties exposed have been set, if desired. Dependency checks can be objects (collaborating beans), simple (primitives and String), or all (both).

Parameters:
beanName - the name of the bean
mbd - the merged bean definition the bean was created with
pds - the relevant property descriptors for the target bean
pvs - the property values to be applied to the bean
Throws:
UnsatisfiedDependencyException
See Also:
isExcludedFromDependencyCheck(java.beans.PropertyDescriptor)

applyPropertyValues

protected void applyPropertyValues(String beanName,
                                   BeanDefinition mbd,
                                   BeanWrapper bw,
                                   PropertyValues pvs)
Apply the given property values, resolving any runtime references to other beans in this bean factory. Must use deep copy, so we don't permanently modify this property.

Parameters:
beanName - the bean name passed for better exception information
mbd - the merged bean definition
bw - the BeanWrapper wrapping the target object
pvs - the new property values

initializeBean

protected Object initializeBean(String beanName,
                                Object bean,
                                RootBeanDefinition mbd)
Initialize the given bean instance, applying factory callbacks as well as init methods and bean post processors.

Called from createBean(java.lang.Class) for traditionally defined beans, and from initializeBean(java.lang.Object, java.lang.String) for existing bean instances.

Parameters:
beanName - the bean name in the factory (for debugging purposes)
bean - the new bean instance we may need to initialize
mbd - the bean definition that the bean was created with (can also be null, if given an existing bean instance)
Returns:
the initialized bean instance (potentially wrapped)
See Also:
BeanNameAware, BeanClassLoaderAware, BeanFactoryAware, applyBeanPostProcessorsBeforeInitialization(java.lang.Object, java.lang.String), invokeInitMethods(java.lang.String, java.lang.Object, org.springframework.beans.factory.support.RootBeanDefinition), applyBeanPostProcessorsAfterInitialization(java.lang.Object, java.lang.String)

invokeInitMethods

protected void invokeInitMethods(String beanName,
                                 Object bean,
                                 RootBeanDefinition mbd)
                          throws Throwable
Give a bean a chance to react now all its properties are set, and a chance to know about its owning bean factory (this object). This means checking whether the bean implements InitializingBean or defines a custom init method, and invoking the necessary callback(s) if it does.

Parameters:
beanName - the bean name in the factory (for debugging purposes)
bean - the new bean instance we may need to initialize
mbd - the merged bean definition that the bean was created with (can also be null, if given an existing bean instance)
Throws:
Throwable - if thrown by init methods or by the invocation process
See Also:
invokeCustomInitMethod(java.lang.String, java.lang.Object, org.springframework.beans.factory.support.RootBeanDefinition)

invokeCustomInitMethod

protected void invokeCustomInitMethod(String beanName,
                                      Object bean,
                                      RootBeanDefinition mbd)
                               throws Throwable
Invoke the specified custom init method on the given bean. Called by invokeInitMethods.

Can be overridden in subclasses for custom resolution of init methods with arguments.

Throws:
Throwable
See Also:
invokeInitMethods(java.lang.String, java.lang.Object, org.springframework.beans.factory.support.RootBeanDefinition)

postProcessObjectFromFactoryBean

protected Object postProcessObjectFromFactoryBean(Object object,
                                                  String beanName)
Applies the postProcessAfterInitialization callback of all registered BeanPostProcessors, giving them a chance to post-process the object obtained from FactoryBeans (for example, to auto-proxy them).

Overrides:
postProcessObjectFromFactoryBean in class FactoryBeanRegistrySupport
Parameters:
object - the object obtained from the FactoryBean.
beanName - the name of the bean
Returns:
the object to expose
See Also:
applyBeanPostProcessorsAfterInitialization(java.lang.Object, java.lang.String)

removeSingleton

protected void removeSingleton(String beanName)
Overridden to clear FactoryBean instance cache as well.

Overrides:
removeSingleton in class FactoryBeanRegistrySupport
Parameters:
beanName - the name of the bean
See Also:
DefaultSingletonBeanRegistry.getSingletonMutex()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractBeanDefinition

org.springframework.beans.factory.support
Class AbstractBeanDefinition

java.lang.Object
    extended by  org.springframework.core.AttributeAccessorSupport
        extended by  org.springframework.beans.BeanMetadataAttributeAccessor
            extended by  org.springframework.beans.factory.support.AbstractBeanDefinition
All Implemented Interfaces:
Serializable, Cloneable, BeanMetadataElement, BeanDefinition, AttributeAccessor
Direct Known Subclasses:
ChildBeanDefinition, GenericBeanDefinition, RootBeanDefinition
public abstract class AbstractBeanDefinition
extends BeanMetadataAttributeAccessor
implements BeanDefinition, Cloneable

Base class for concrete, full-fledged BeanDefinition classes, factoring out common properties of RootBeanDefinition and ChildBeanDefinition.

The autowire constants match the ones defined in the AutowireCapableBeanFactory interface.

Author:
Rod Johnson, Juergen Hoeller, Rob Harrop, Mark Fisher
See Also:
RootBeanDefinition, ChildBeanDefinition, Serialized Form

Field Summary
static int | AUTOWIRE_AUTODETECT Deprecated. as of Spring 3.0: If you are using mixed autowiring strategies, use annotation-based autowiring for clearer demarcation of autowiring needs.
static int | AUTOWIRE_BY_NAME Constant that indicates autowiring bean properties by name.
static int | AUTOWIRE_BY_TYPE Constant that indicates autowiring bean properties by type.
static int | AUTOWIRE_CONSTRUCTOR Constant that indicates autowiring a constructor.
static int | AUTOWIRE_NO Constant that indicates no autowiring at all.
static int | DEPENDENCY_CHECK_ALL Constant that indicates dependency checking for all properties (object references as well as "simple" properties).
static int | DEPENDENCY_CHECK_NONE Constant that indicates no dependency check at all.
static int | DEPENDENCY_CHECK_OBJECTS Constant that indicates dependency checking for object references.
static int | DEPENDENCY_CHECK_SIMPLE Constant that indicates dependency checking for "simple" properties.
static String | SCOPE_DEFAULT Constant for the default scope name: "", equivalent to singleton status but to be overridden from a parent bean definition (if applicable).
Fields inherited from interface org.springframework.beans.factory.config.BeanDefinition
ROLE_APPLICATION, ROLE_INFRASTRUCTURE, ROLE_SUPPORT, SCOPE_PROTOTYPE, SCOPE_SINGLETON
Constructor Summary
protected | AbstractBeanDefinition() Create a new AbstractBeanDefinition with default settings.
protected | AbstractBeanDefinition(AbstractBeanDefinition original) Deprecated. since Spring 2.5, in favor of AbstractBeanDefinition(BeanDefinition)
protected | AbstractBeanDefinition(BeanDefinition original) Create a new AbstractBeanDefinition as deep copy of the given bean definition.
protected | AbstractBeanDefinition(ConstructorArgumentValues cargs, MutablePropertyValues pvs) Create a new AbstractBeanDefinition with the given constructor argument values and property values.
Method Summary
 void addQualifier(AutowireCandidateQualifier qualifier)
Register a qualifier to be used for autowire candidate resolution, keyed by the qualifier's type name.
 void applyDefaults(BeanDefinitionDefaults defaults)
Apply the provided default values to this bean.
 Object clone()
Public declaration of Object's clone() method.
abstract  AbstractBeanDefinition cloneBeanDefinition()
Clone this bean definition.
 void copyQualifiersFrom(AbstractBeanDefinition source)
Copy the qualifiers from the supplied AbstractBeanDefinition to this bean definition.
 boolean equals(Object other)
 int getAutowireMode()
Return the autowire mode as specified in the bean definition.
 Class<?> getBeanClass()
Return the class of the wrapped bean, if already resolved.
 String getBeanClassName()
Return the current bean class name of this bean definition.
 ConstructorArgumentValues getConstructorArgumentValues()
Return constructor argument values for this bean (never null).
 int getDependencyCheck()
Return the dependency check code.
 String[] getDependsOn()
Return the bean names that this bean depends on.
 String getDescription()
Return a human-readable description of this bean definition.
 String getDestroyMethodName()
Return the name of the destroy method.
 String getFactoryBeanName()
Return the factory bean name, if any.
 String getFactoryMethodName()
Return a factory method, if any.
 String getInitMethodName()
Return the name of the initializer method.
 MethodOverrides getMethodOverrides()
Return information about methods to be overridden by the IoC container.
 BeanDefinition getOriginatingBeanDefinition()
Return the originating BeanDefinition, or null if none.
 MutablePropertyValues getPropertyValues()
Return property values for this bean (never null).
 AutowireCandidateQualifier getQualifier(String typeName)
Return the qualifier mapped to the provided type name.
 Set<AutowireCandidateQualifier> getQualifiers()
Return all registered qualifiers.
 int getResolvedAutowireMode()
Return the resolved autowire code, (resolving AUTOWIRE_AUTODETECT to AUTOWIRE_CONSTRUCTOR or AUTOWIRE_BY_TYPE).
 Resource getResource()
Return the resource that this bean definition came from.
 String getResourceDescription()
Return a description of the resource that this bean definition came from (for the purpose of showing context in case of errors).
 int getRole()
Return the role hint for this BeanDefinition.
 String getScope()
Return the name of the target scope for the bean.
 boolean hasBeanClass()
Return whether this definition specifies a bean class.
 boolean hasConstructorArgumentValues()
Return if there are constructor argument values defined for this bean.
 int hashCode()
 boolean hasQualifier(String typeName)
Return whether this bean has the specified qualifier.
 boolean isAbstract()
Return whether this bean is "abstract", i.e.
 boolean isAutowireCandidate()
Return whether this bean is a candidate for getting autowired into some other bean.
 boolean isEnforceDestroyMethod()
Indicate whether the configured destroy method is the default.
 boolean isEnforceInitMethod()
Indicate whether the configured init method is the default.
 boolean isLazyInit()
Return whether this bean should be lazily initialized, i.e.
 boolean isLenientConstructorResolution()
Return whether to resolve constructors in lenient mode or in strict mode.
 boolean isNonPublicAccessAllowed()
Return whether to allow access to non-public constructors and methods.
 boolean isPrimary()
Return whether this bean is a primary autowire candidate.
 boolean isPrototype()
Return whether this a Prototype, with an independent instance returned for each call.
 boolean isSingleton()
Return whether this a Singleton, with a single shared instance returned from all calls.
 boolean isSynthetic()
Return whether this bean definition is 'synthetic', that is, not defined by the application itself.
 void overrideFrom(AbstractBeanDefinition other)
Deprecated. since Spring 2.5, in favor of overrideFrom(BeanDefinition)
 void overrideFrom(BeanDefinition other)
Override settings in this bean definition (assumably a copied parent from a parent-child inheritance relationship) from the given bean definition (assumably the child).
protected  void prepareMethodOverride(MethodOverride mo)
Validate and prepare the given method override.
 void prepareMethodOverrides()
Validate and prepare the method overrides defined for this bean.
 Class resolveBeanClass(ClassLoader classLoader)
Determine the class of the wrapped bean, resolving it from a specified class name if necessary.
 void setAbstract(boolean abstractFlag)
Set if this bean is "abstract", i.e.
 void setAutowireCandidate(boolean autowireCandidate)
Set whether this bean is a candidate for getting autowired into some other bean.
 void setAutowireMode(int autowireMode)
Set the autowire mode.
 void setBeanClass(Class<?> beanClass)
Specify the class for this bean.
 void setBeanClassName(String beanClassName)
Override the bean class name of this bean definition.
 void setConstructorArgumentValues(ConstructorArgumentValues constructorArgumentValues)
Specify constructor argument values for this bean.
 void setDependencyCheck(int dependencyCheck)
Set the dependency check code.
 void setDependsOn(String[] dependsOn)
Set the names of the beans that this bean depends on being initialized.
 void setDescription(String description)
Set a human-readable description of this bean definition.
 void setDestroyMethodName(String destroyMethodName)
Set the name of the destroy method.
 void setEnforceDestroyMethod(boolean enforceDestroyMethod)
Specify whether or not the configured destroy method is the default.
 void setEnforceInitMethod(boolean enforceInitMethod)
Specify whether or not the configured init method is the default.
 void setFactoryBeanName(String factoryBeanName)
Specify the factory bean to use, if any.
 void setFactoryMethodName(String factoryMethodName)
Specify a factory method, if any.
 void setInitMethodName(String initMethodName)
Set the name of the initializer method.
 void setLazyInit(boolean lazyInit)
Set whether this bean should be lazily initialized.
 void setLenientConstructorResolution(boolean lenientConstructorResolution)
Specify whether to resolve constructors in lenient mode (true, which is the default) or to switch to strict resolution (throwing an exception in case of ambigious constructors that all match when converting the arguments, whereas lenient mode would use the one with the 'closest' type matches).
 void setMethodOverrides(MethodOverrides methodOverrides)
Specify method overrides for the bean, if any.
 void setNonPublicAccessAllowed(boolean nonPublicAccessAllowed)
Specify whether to allow access to non-public constructors and methods, for the case of externalized metadata pointing to those.
 void setOriginatingBeanDefinition(BeanDefinition originatingBd)
Set the originating (e.g.
 void setPrimary(boolean primary)
Set whether this bean is a primary autowire candidate.
 void setPropertyValues(MutablePropertyValues propertyValues)
Specify property values for this bean, if any.
 void setResource(Resource resource)
Set the resource that this bean definition came from (for the purpose of showing context in case of errors).
 void setResourceDescription(String resourceDescription)
Set a description of the resource that this bean definition came from (for the purpose of showing context in case of errors).
 void setRole(int role)
Set the role hint for this BeanDefinition.
 void setScope(String scope)
Set the name of the target scope for the bean.
 void setSingleton(boolean singleton)
Deprecated. since Spring 2.5, in favor of setScope(java.lang.String)
 void setSynthetic(boolean synthetic)
Set whether this bean definition is 'synthetic', that is, not defined by the application itself (for example, an infrastructure bean such as a helper for auto-proxying, created through <aop:config>).
 String toString()
 void validate()
Validate this bean definition.
Methods inherited from class org.springframework.beans.BeanMetadataAttributeAccessor
addMetadataAttribute, getAttribute, getMetadataAttribute, getSource, removeAttribute, setAttribute, setSource
Methods inherited from class org.springframework.core.AttributeAccessorSupport
attributeNames, copyAttributesFrom, hasAttribute
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.config.BeanDefinition
getParentName, setParentName
Methods inherited from interface org.springframework.core.AttributeAccessor
attributeNames, getAttribute, hasAttribute, removeAttribute, setAttribute
Methods inherited from interface org.springframework.beans.BeanMetadataElement
getSource

Field Detail

SCOPE_DEFAULT

public static final String SCOPE_DEFAULT
Constant for the default scope name: "", equivalent to singleton status but to be overridden from a parent bean definition (if applicable).

See Also:
Constant Field Values

AUTOWIRE_NO

public static final int AUTOWIRE_NO
Constant that indicates no autowiring at all.

See Also:
setAutowireMode(int), Constant Field Values

AUTOWIRE_BY_NAME

public static final int AUTOWIRE_BY_NAME
Constant that indicates autowiring bean properties by name.

See Also:
setAutowireMode(int), Constant Field Values

AUTOWIRE_BY_TYPE

public static final int AUTOWIRE_BY_TYPE
Constant that indicates autowiring bean properties by type.

See Also:
setAutowireMode(int), Constant Field Values

AUTOWIRE_CONSTRUCTOR

public static final int AUTOWIRE_CONSTRUCTOR
Constant that indicates autowiring a constructor.

See Also:
setAutowireMode(int), Constant Field Values

AUTOWIRE_AUTODETECT

@Deprecated
public static final int AUTOWIRE_AUTODETECT
Deprecated. as of Spring 3.0: If you are using mixed autowiring strategies, use annotation-based autowiring for clearer demarcation of autowiring needs.
Constant that indicates determining an appropriate autowire strategy through introspection of the bean class.

See Also:
setAutowireMode(int), Constant Field Values

DEPENDENCY_CHECK_NONE

public static final int DEPENDENCY_CHECK_NONE
Constant that indicates no dependency check at all.

See Also:
setDependencyCheck(int), Constant Field Values

DEPENDENCY_CHECK_OBJECTS

public static final int DEPENDENCY_CHECK_OBJECTS
Constant that indicates dependency checking for object references.

See Also:
setDependencyCheck(int), Constant Field Values

DEPENDENCY_CHECK_SIMPLE

public static final int DEPENDENCY_CHECK_SIMPLE
Constant that indicates dependency checking for "simple" properties.

See Also:
setDependencyCheck(int), BeanUtils.isSimpleProperty(java.lang.Class), Constant Field Values

DEPENDENCY_CHECK_ALL

public static final int DEPENDENCY_CHECK_ALL
Constant that indicates dependency checking for all properties (object references as well as "simple" properties).

See Also:
setDependencyCheck(int), Constant Field Values
Constructor Detail

AbstractBeanDefinition

protected AbstractBeanDefinition()
Create a new AbstractBeanDefinition with default settings.

AbstractBeanDefinition

protected AbstractBeanDefinition(ConstructorArgumentValues cargs,
                                 MutablePropertyValues pvs)
Create a new AbstractBeanDefinition with the given constructor argument values and property values.

AbstractBeanDefinition

@Deprecated
protected AbstractBeanDefinition(AbstractBeanDefinition original)
Deprecated. since Spring 2.5, in favor of AbstractBeanDefinition(BeanDefinition)

Create a new AbstractBeanDefinition as deep copy of the given bean definition.

Parameters:
original - the original bean definition to copy from

AbstractBeanDefinition

protected AbstractBeanDefinition(BeanDefinition original)
Create a new AbstractBeanDefinition as deep copy of the given bean definition.

Parameters:
original - the original bean definition to copy from
Method Detail

overrideFrom

@Deprecated
public void overrideFrom(AbstractBeanDefinition other)
Deprecated. since Spring 2.5, in favor of overrideFrom(BeanDefinition)

Override settings in this bean definition (assumably a copied parent from a parent-child inheritance relationship) from the given bean definition (assumably the child).

overrideFrom

public void overrideFrom(BeanDefinition other)
Override settings in this bean definition (assumably a copied parent from a parent-child inheritance relationship) from the given bean definition (assumably the child).
  • Will override beanClass if specified in the given bean definition.
  • Will always take abstract, scope, lazyInit, autowireMode, dependencyCheck, and dependsOn from the given bean definition.
  • Will add constructorArgumentValues, propertyValues, methodOverrides from the given bean definition to existing ones.
  • Will override factoryBeanName, factoryMethodName, initMethodName, and destroyMethodName if specified in the given bean definition.

applyDefaults

public void applyDefaults(BeanDefinitionDefaults defaults)
Apply the provided default values to this bean.

Parameters:
defaults - the defaults to apply

hasBeanClass

public boolean hasBeanClass()
Return whether this definition specifies a bean class.

setBeanClass

public void setBeanClass(Class<?> beanClass)
Specify the class for this bean.

getBeanClass

public Class<?> getBeanClass()
                      throws IllegalStateException
Return the class of the wrapped bean, if already resolved.

Returns:
the bean class, or null if none defined
Throws:
IllegalStateException - if the bean definition does not define a bean class, or a specified bean class name has not been resolved into an actual Class

setBeanClassName

public void setBeanClassName(String beanClassName)
Description copied from interface: BeanDefinition
Override the bean class name of this bean definition.

The class name can be modified during bean factory post-processing, typically replacing the original class name with a parsed variant of it.

Specified by:
setBeanClassName in interface BeanDefinition

getBeanClassName

public String getBeanClassName()
Description copied from interface: BeanDefinition
Return the current bean class name of this bean definition.

Note that this does not have to be the actual class name used at runtime, in case of a child definition overriding/inheriting the class name from its parent. Hence, do not consider this to be the definitive bean type at runtime but rather only use it for parsing purposes at the individual bean definition level.

Specified by:
getBeanClassName in interface BeanDefinition

resolveBeanClass

public Class resolveBeanClass(ClassLoader classLoader)
                       throws ClassNotFoundException
Determine the class of the wrapped bean, resolving it from a specified class name if necessary. Will also reload a specified Class from its name when called with the bean class already resolved.

Parameters:
classLoader - the ClassLoader to use for resolving a (potential) class name
Returns:
the resolved bean class
Throws:
ClassNotFoundException - if the class name could be resolved

setScope

public void setScope(String scope)
Set the name of the target scope for the bean.

Default is singleton status, although this is only applied once a bean definition becomes active in the containing factory. A bean definition may eventually inherit its scope from a parent bean definitionFor this reason, the default scope name is empty (empty String), with singleton status being assumed until a resolved scope will be set.

Specified by:
setScope in interface BeanDefinition
See Also:
BeanDefinition.SCOPE_SINGLETON, BeanDefinition.SCOPE_PROTOTYPE

getScope

public String getScope()
Return the name of the target scope for the bean.

Specified by:
getScope in interface BeanDefinition

setSingleton

@Deprecated
public void setSingleton(boolean singleton)
Deprecated. since Spring 2.5, in favor of setScope(java.lang.String)

Set if this a Singleton, with a single, shared instance returned on all calls. In case of "false", the BeanFactory will apply the Prototype design pattern, with each caller requesting an instance getting an independent instance. How this is exactly defined will depend on the BeanFactory.

"Singletons" are the commoner type, so the default is "true". Note that as of Spring 2.0, this flag is just an alternative way to specify scope="singleton" or scope="prototype".

See Also:
setScope(java.lang.String), BeanDefinition.SCOPE_SINGLETON, BeanDefinition.SCOPE_PROTOTYPE

isSingleton

public boolean isSingleton()
Return whether this a Singleton, with a single shared instance returned from all calls.

Specified by:
isSingleton in interface BeanDefinition
See Also:
BeanDefinition.SCOPE_SINGLETON

isPrototype

public boolean isPrototype()
Return whether this a Prototype, with an independent instance returned for each call.

Specified by:
isPrototype in interface BeanDefinition
See Also:
BeanDefinition.SCOPE_PROTOTYPE

setAbstract

public void setAbstract(boolean abstractFlag)
Set if this bean is "abstract", i.e. not meant to be instantiated itself but rather just serving as parent for concrete child bean definitions.

Default is "false". Specify true to tell the bean factory to not try to instantiate that particular bean in any case.

isAbstract

public boolean isAbstract()
Return whether this bean is "abstract", i.e. not meant to be instantiated itself but rather just serving as parent for concrete child bean definitions.

Specified by:
isAbstract in interface BeanDefinition

setLazyInit

public void setLazyInit(boolean lazyInit)
Set whether this bean should be lazily initialized.

If false, the bean will get instantiated on startup by bean factories that perform eager initialization of singletons.

Specified by:
setLazyInit in interface BeanDefinition

isLazyInit

public boolean isLazyInit()
Return whether this bean should be lazily initialized, i.e. not eagerly instantiated on startup. Only applicable to a singleton bean.

Specified by:
isLazyInit in interface BeanDefinition

setAutowireMode

public void setAutowireMode(int autowireMode)
Set the autowire mode. This determines whether any automagical detection and setting of bean references will happen. Default is AUTOWIRE_NO, which means there's no autowire.

Parameters:
autowireMode - the autowire mode to set. Must be one of the constants defined in this class.
See Also:
AUTOWIRE_NO, AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_CONSTRUCTOR, AUTOWIRE_AUTODETECT

getAutowireMode

public int getAutowireMode()
Return the autowire mode as specified in the bean definition.

getResolvedAutowireMode

public int getResolvedAutowireMode()
Return the resolved autowire code, (resolving AUTOWIRE_AUTODETECT to AUTOWIRE_CONSTRUCTOR or AUTOWIRE_BY_TYPE).

See Also:
AUTOWIRE_AUTODETECT, AUTOWIRE_CONSTRUCTOR, AUTOWIRE_BY_TYPE

setDependencyCheck

public void setDependencyCheck(int dependencyCheck)
Set the dependency check code.

Parameters:
dependencyCheck - the code to set. Must be one of the four constants defined in this class.
See Also:
DEPENDENCY_CHECK_NONE, DEPENDENCY_CHECK_OBJECTS, DEPENDENCY_CHECK_SIMPLE, DEPENDENCY_CHECK_ALL

getDependencyCheck

public int getDependencyCheck()
Return the dependency check code.

setDependsOn

public void setDependsOn(String[] dependsOn)
Set the names of the beans that this bean depends on being initialized. The bean factory will guarantee that these beans get initialized first.

Note that dependencies are normally expressed through bean properties or constructor arguments. This property should just be necessary for other kinds of dependencies like statics (*ugh*) or database preparation on startup.

Specified by:
setDependsOn in interface BeanDefinition

getDependsOn

public String[] getDependsOn()
Return the bean names that this bean depends on.

Specified by:
getDependsOn in interface BeanDefinition

setAutowireCandidate

public void setAutowireCandidate(boolean autowireCandidate)
Set whether this bean is a candidate for getting autowired into some other bean.

Specified by:
setAutowireCandidate in interface BeanDefinition

isAutowireCandidate

public boolean isAutowireCandidate()
Return whether this bean is a candidate for getting autowired into some other bean.

Specified by:
isAutowireCandidate in interface BeanDefinition

setPrimary

public void setPrimary(boolean primary)
Set whether this bean is a primary autowire candidate. If this value is true for exactly one bean among multiple matching candidates, it will serve as a tie-breaker.

Specified by:
setPrimary in interface BeanDefinition

isPrimary

public boolean isPrimary()
Return whether this bean is a primary autowire candidate. If this value is true for exactly one bean among multiple matching candidates, it will serve as a tie-breaker.

Specified by:
isPrimary in interface BeanDefinition

addQualifier

public void addQualifier(AutowireCandidateQualifier qualifier)
Register a qualifier to be used for autowire candidate resolution, keyed by the qualifier's type name.

See Also:
AutowireCandidateQualifier.getTypeName()

hasQualifier

public boolean hasQualifier(String typeName)
Return whether this bean has the specified qualifier.

getQualifier

public AutowireCandidateQualifier getQualifier(String typeName)
Return the qualifier mapped to the provided type name.

getQualifiers

public Set<AutowireCandidateQualifier> getQualifiers()
Return all registered qualifiers.

Returns:
the Set of AutowireCandidateQualifier objects.

copyQualifiersFrom

public void copyQualifiersFrom(AbstractBeanDefinition source)
Copy the qualifiers from the supplied AbstractBeanDefinition to this bean definition.

Parameters:
source - the AbstractBeanDefinition to copy from

setNonPublicAccessAllowed

public void setNonPublicAccessAllowed(boolean nonPublicAccessAllowed)
Specify whether to allow access to non-public constructors and methods, for the case of externalized metadata pointing to those.

This applies to constructor resolution, factory method resolution, and also init/destroy methods. Bean property accessors have to be public in any case and are not affected by this setting.

Note that annotation-driven configuration will still access non-public members as far as they have been annotated. This setting applies to externalized metadata in this bean definition only.

isNonPublicAccessAllowed

public boolean isNonPublicAccessAllowed()
Return whether to allow access to non-public constructors and methods.

setLenientConstructorResolution

public void setLenientConstructorResolution(boolean lenientConstructorResolution)
Specify whether to resolve constructors in lenient mode (true, which is the default) or to switch to strict resolution (throwing an exception in case of ambigious constructors that all match when converting the arguments, whereas lenient mode would use the one with the 'closest' type matches).

isLenientConstructorResolution

public boolean isLenientConstructorResolution()
Return whether to resolve constructors in lenient mode or in strict mode.

setConstructorArgumentValues

public void setConstructorArgumentValues(ConstructorArgumentValues constructorArgumentValues)
Specify constructor argument values for this bean.

getConstructorArgumentValues

public ConstructorArgumentValues getConstructorArgumentValues()
Return constructor argument values for this bean (never null).

Specified by:
getConstructorArgumentValues in interface BeanDefinition
Returns:
the ConstructorArgumentValues object (never null)

hasConstructorArgumentValues

public boolean hasConstructorArgumentValues()
Return if there are constructor argument values defined for this bean.

setPropertyValues

public void setPropertyValues(MutablePropertyValues propertyValues)
Specify property values for this bean, if any.

getPropertyValues

public MutablePropertyValues getPropertyValues()
Return property values for this bean (never null).

Specified by:
getPropertyValues in interface BeanDefinition
Returns:
the MutablePropertyValues object (never null)

setMethodOverrides

public void setMethodOverrides(MethodOverrides methodOverrides)
Specify method overrides for the bean, if any.

getMethodOverrides

public MethodOverrides getMethodOverrides()
Return information about methods to be overridden by the IoC container. This will be empty if there are no method overrides. Never returns null.

setFactoryBeanName

public void setFactoryBeanName(String factoryBeanName)
Description copied from interface: BeanDefinition
Specify the factory bean to use, if any.

Specified by:
setFactoryBeanName in interface BeanDefinition

getFactoryBeanName

public String getFactoryBeanName()
Description copied from interface: BeanDefinition
Return the factory bean name, if any.

Specified by:
getFactoryBeanName in interface BeanDefinition

setFactoryMethodName

public void setFactoryMethodName(String factoryMethodName)
Description copied from interface: BeanDefinition
Specify a factory method, if any. This method will be invoked with constructor arguments, or with no arguments if none are specified. The method will be invoked on the specifed factory bean, if any, or as static method on the local bean class else.

Specified by:
setFactoryMethodName in interface BeanDefinition
Parameters:
factoryMethodName - static factory method name, or null if normal constructor creation should be used
See Also:
BeanDefinition.getBeanClassName()

getFactoryMethodName

public String getFactoryMethodName()
Description copied from interface: BeanDefinition
Return a factory method, if any.

Specified by:
getFactoryMethodName in interface BeanDefinition

setInitMethodName

public void setInitMethodName(String initMethodName)
Set the name of the initializer method. The default is null in which case there is no initializer method.

getInitMethodName

public String getInitMethodName()
Return the name of the initializer method.

setEnforceInitMethod

public void setEnforceInitMethod(boolean enforceInitMethod)
Specify whether or not the configured init method is the default. Default value is false.

See Also:
setInitMethodName(java.lang.String)

isEnforceInitMethod

public boolean isEnforceInitMethod()
Indicate whether the configured init method is the default.

See Also:
getInitMethodName()

setDestroyMethodName

public void setDestroyMethodName(String destroyMethodName)
Set the name of the destroy method. The default is null in which case there is no destroy method.

getDestroyMethodName

public String getDestroyMethodName()
Return the name of the destroy method.

setEnforceDestroyMethod

public void setEnforceDestroyMethod(boolean enforceDestroyMethod)
Specify whether or not the configured destroy method is the default. Default value is false.

See Also:
setDestroyMethodName(java.lang.String)

isEnforceDestroyMethod

public boolean isEnforceDestroyMethod()
Indicate whether the configured destroy method is the default.

See Also:
getDestroyMethodName()

setSynthetic

public void setSynthetic(boolean synthetic)
Set whether this bean definition is 'synthetic', that is, not defined by the application itself (for example, an infrastructure bean such as a helper for auto-proxying, created through <aop:config>).

isSynthetic

public boolean isSynthetic()
Return whether this bean definition is 'synthetic', that is, not defined by the application itself.

setRole

public void setRole(int role)
Set the role hint for this BeanDefinition.

getRole

public int getRole()
Return the role hint for this BeanDefinition.

Specified by:
getRole in interface BeanDefinition
See Also:
BeanDefinition.ROLE_APPLICATION, BeanDefinition.ROLE_INFRASTRUCTURE, BeanDefinition.ROLE_SUPPORT

setDescription

public void setDescription(String description)
Set a human-readable description of this bean definition.

getDescription

public String getDescription()
Description copied from interface: BeanDefinition
Return a human-readable description of this bean definition.

Specified by:
getDescription in interface BeanDefinition

setResource

public void setResource(Resource resource)
Set the resource that this bean definition came from (for the purpose of showing context in case of errors).

getResource

public Resource getResource()
Return the resource that this bean definition came from.

setResourceDescription

public void setResourceDescription(String resourceDescription)
Set a description of the resource that this bean definition came from (for the purpose of showing context in case of errors).

getResourceDescription

public String getResourceDescription()
Description copied from interface: BeanDefinition
Return a description of the resource that this bean definition came from (for the purpose of showing context in case of errors).

Specified by:
getResourceDescription in interface BeanDefinition

setOriginatingBeanDefinition

public void setOriginatingBeanDefinition(BeanDefinition originatingBd)
Set the originating (e.g. decorated) BeanDefinition, if any.

getOriginatingBeanDefinition

public BeanDefinition getOriginatingBeanDefinition()
Description copied from interface: BeanDefinition
Return the originating BeanDefinition, or null if none. Allows for retrieving the decorated bean definition, if any.

Note that this method returns the immediate originator. Iterate through the originator chain to find the original BeanDefinition as defined by the user.

Specified by:
getOriginatingBeanDefinition in interface BeanDefinition

validate

public void validate()
              throws BeanDefinitionValidationException
Validate this bean definition.

Throws:
BeanDefinitionValidationException - in case of validation failure

prepareMethodOverrides

public void prepareMethodOverrides()
                            throws BeanDefinitionValidationException
Validate and prepare the method overrides defined for this bean. Checks for existence of a method with the specified name.

Throws:
BeanDefinitionValidationException - in case of validation failure

prepareMethodOverride

protected void prepareMethodOverride(MethodOverride mo)
                              throws BeanDefinitionValidationException
Validate and prepare the given method override. Checks for existence of a method with the specified name, marking it as not overloaded if none found.

Parameters:
mo - the MethodOverride object to validate
Throws:
BeanDefinitionValidationException - in case of validation failure

clone

public Object clone()
Public declaration of Object's clone() method. Delegates to cloneBeanDefinition().

Overrides:
clone in class Object
See Also:
Object.clone()

cloneBeanDefinition

public abstract AbstractBeanDefinition cloneBeanDefinition()
Clone this bean definition. To be implemented by concrete subclasses.

Returns:
the cloned bean definition object

equals

public boolean equals(Object other)
Overrides:
equals in class AttributeAccessorSupport

hashCode

public int hashCode()
Overrides:
hashCode in class AttributeAccessorSupport

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractBeanDefinitionReader

org.springframework.beans.factory.support
Class AbstractBeanDefinitionReader

java.lang.Object
    extended by  org.springframework.beans.factory.support.AbstractBeanDefinitionReader
All Implemented Interfaces:
BeanDefinitionReader
Direct Known Subclasses:
PropertiesBeanDefinitionReader, XmlBeanDefinitionReader
public abstract class AbstractBeanDefinitionReader
extends Object
implements BeanDefinitionReader

Abstract base class for bean definition readers which implement the BeanDefinitionReader interface.

Provides common properties like the bean factory to work on and the class loader to use for loading bean classes.

Since:
11.12.2003
Author:
Juergen Hoeller
See Also:
BeanDefinitionReaderUtils

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
protected AbstractBeanDefinitionReader(BeanDefinitionRegistry registry)
Create a new AbstractBeanDefinitionReader for the given bean factory.
Method Summary
ClassLoader | getBeanClassLoader() Return the class loader to use for bean classes.
BeanDefinitionRegistry | getBeanFactory()
BeanNameGenerator | getBeanNameGenerator() Return the BeanNameGenerator to use for anonymous beans (without explicit bean name specified).
BeanDefinitionRegistry | getRegistry() Return the bean factory to register the bean definitions with.
ResourceLoader | getResourceLoader() Return the resource loader to use for resource locations.
int | loadBeanDefinitions(Resource... resources) Load bean definitions from the specified resources.
int | loadBeanDefinitions(String... locations) Load bean definitions from the specified resource locations.
int | loadBeanDefinitions(String location) Load bean definitions from the specified resource location.
int | loadBeanDefinitions(String location, Set<Resource> actualResources) Load bean definitions from the specified resource location.
void | setBeanClassLoader(ClassLoader beanClassLoader) Set the ClassLoader to use for bean classes.
void | setBeanNameGenerator(BeanNameGenerator beanNameGenerator) Set the BeanNameGenerator to use for anonymous beans (without explicit bean name specified).
void | setResourceLoader(ResourceLoader resourceLoader) Set the ResourceLoader to use for resource locations.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.support.BeanDefinitionReader
loadBeanDefinitions

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

AbstractBeanDefinitionReader

protected AbstractBeanDefinitionReader(BeanDefinitionRegistry registry)
Create a new AbstractBeanDefinitionReader for the given bean factory.

If the passed-in bean factory does not only implement the BeanDefinitionRegistry interface but also the ResourceLoader interface, it will be used as default ResourceLoader as well. This will usually be the case for ApplicationContext implementations.

If given a plain BeanDefinitionRegistry, the default ResourceLoader will be a PathMatchingResourcePatternResolver.

Parameters:
registry - the BeanFactory to load bean definitions into, in the form of a BeanDefinitionRegistry
See Also:
setResourceLoader(org.springframework.core.io.ResourceLoader)
Method Detail

getBeanFactory

public final BeanDefinitionRegistry getBeanFactory()

getRegistry

public final BeanDefinitionRegistry getRegistry()
Description copied from interface: BeanDefinitionReader
Return the bean factory to register the bean definitions with.

The factory is exposed through the BeanDefinitionRegistry interface, encapsulating the methods that are relevant for bean definition handling.

Specified by:
getRegistry in interface BeanDefinitionReader

setResourceLoader

public void setResourceLoader(ResourceLoader resourceLoader)
Set the ResourceLoader to use for resource locations. If specifying a ResourcePatternResolver, the bean definition reader will be capable of resolving resource patterns to Resource arrays.

Default is PathMatchingResourcePatternResolver, also capable of resource pattern resolving through the ResourcePatternResolver interface.

Setting this to null suggests that absolute resource loading is not available for this bean definition reader.

See Also:
ResourcePatternResolver, PathMatchingResourcePatternResolver

getResourceLoader

public ResourceLoader getResourceLoader()
Description copied from interface: BeanDefinitionReader
Return the resource loader to use for resource locations. Can be checked for the ResourcePatternResolver interface and cast accordingly, for loading multiple resources for a given resource pattern.

Null suggests that absolute resource loading is not available for this bean definition reader.

This is mainly meant to be used for importing further resources from within a bean definition resource, for example via the "import" tag in XML bean definitions. It is recommended, however, to apply such imports relative to the defining resource; only explicit full resource locations will trigger absolute resource loading.

There is also a loadBeanDefinitions(String) method available, for loading bean definitions from a resource location (or location pattern). This is a convenience to avoid explicit ResourceLoader handling.

Specified by:
getResourceLoader in interface BeanDefinitionReader
See Also:
BeanDefinitionReader.loadBeanDefinitions(String), ResourcePatternResolver

setBeanClassLoader

public void setBeanClassLoader(ClassLoader beanClassLoader)
Set the ClassLoader to use for bean classes.

Default is null, which suggests to not load bean classes eagerly but rather to just register bean definitions with class names, with the corresponding Classes to be resolved later (or never).

See Also:
Thread.getContextClassLoader()

getBeanClassLoader

public ClassLoader getBeanClassLoader()
Description copied from interface: BeanDefinitionReader
Return the class loader to use for bean classes.

null suggests to not load bean classes eagerly but rather to just register bean definitions with class names, with the corresponding Classes to be resolved later (or never).

Specified by:
getBeanClassLoader in interface BeanDefinitionReader

setBeanNameGenerator

public void setBeanNameGenerator(BeanNameGenerator beanNameGenerator)
Set the BeanNameGenerator to use for anonymous beans (without explicit bean name specified).

Default is a DefaultBeanNameGenerator.

getBeanNameGenerator

public BeanNameGenerator getBeanNameGenerator()
Description copied from interface: BeanDefinitionReader
Return the BeanNameGenerator to use for anonymous beans (without explicit bean name specified).

Specified by:
getBeanNameGenerator in interface BeanDefinitionReader

loadBeanDefinitions

public int loadBeanDefinitions(Resource... resources)
                        throws BeanDefinitionStoreException
Description copied from interface: BeanDefinitionReader
Load bean definitions from the specified resources.

Specified by:
loadBeanDefinitions in interface BeanDefinitionReader
Parameters:
resources - the resource descriptors
Returns:
the number of bean definitions found
Throws:
BeanDefinitionStoreException - in case of loading or parsing errors

loadBeanDefinitions

public int loadBeanDefinitions(String location)
                        throws BeanDefinitionStoreException
Description copied from interface: BeanDefinitionReader
Load bean definitions from the specified resource location.

The location can also be a location pattern, provided that the ResourceLoader of this bean definition reader is a ResourcePatternResolver.

Specified by:
loadBeanDefinitions in interface BeanDefinitionReader
Parameters:
location - the resource location, to be loaded with the ResourceLoader (or ResourcePatternResolver) of this bean definition reader
Returns:
the number of bean definitions found
Throws:
BeanDefinitionStoreException - in case of loading or parsing errors
See Also:
BeanDefinitionReader.getResourceLoader(),
BeanDefinitionReader.loadBeanDefinitions(org.springframework.core.io.Resource),
BeanDefinitionReader.loadBeanDefinitions(org.springframework.core.io.Resource[])

loadBeanDefinitions

public int loadBeanDefinitions(String location,
                               Set<Resource> actualResources)
                        throws BeanDefinitionStoreException
Load bean definitions from the specified resource location.

The location can also be a location pattern, provided that the ResourceLoader of this bean definition reader is a ResourcePatternResolver.

Parameters:
location - the resource location, to be loaded with the ResourceLoader (or ResourcePatternResolver) of this bean definition reader
actualResources - a Set to be filled with the actual Resource objects that have been resolved during the loading process. May be null to indicate that the caller is not interested in those Resource objects.
Returns:
the number of bean definitions found
Throws:
BeanDefinitionStoreException - in case of loading or parsing errors
See Also:
getResourceLoader(),
BeanDefinitionReader.loadBeanDefinitions(org.springframework.core.io.Resource),
loadBeanDefinitions(org.springframework.core.io.Resource[])

loadBeanDefinitions

public int loadBeanDefinitions(String... locations)
                        throws BeanDefinitionStoreException
Description copied from interface: BeanDefinitionReader
Load bean definitions from the specified resource locations.

Specified by:
loadBeanDefinitions in interface BeanDefinitionReader
Parameters:
locations - the resource locations, to be loaded with the ResourceLoader (or ResourcePatternResolver) of this bean definition reader
Returns:
the number of bean definitions found
Throws:
BeanDefinitionStoreException - in case of loading or parsing errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractBeanFactory

org.springframework.beans.factory.support
Class AbstractBeanFactory

java.lang.Object
    extended by  org.springframework.core.SimpleAliasRegistry
        extended by  org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
            extended by  org.springframework.beans.factory.support.FactoryBeanRegistrySupport
                extended by  org.springframework.beans.factory.support.AbstractBeanFactory
All Implemented Interfaces:
BeanFactory, ConfigurableBeanFactory, SingletonBeanRegistry, HierarchicalBeanFactory, AliasRegistry
Direct Known Subclasses:
AbstractAutowireCapableBeanFactory
public abstract class AbstractBeanFactory
extends FactoryBeanRegistrySupport
implements ConfigurableBeanFactory

Abstract base class for BeanFactory implementations, providing the full capabilities of the ConfigurableBeanFactory SPI. Does not assume a listable bean factory: can therefore also be used as base class for bean factory implementations which obtain bean definitions from some backend resource (where bean definition access is an expensive operation).

This class provides a singleton cache (through its base class DefaultSingletonBeanRegistry, singleton/prototype determination, FactoryBean handling, aliases, bean definition merging for child bean definitions, and bean destruction (DisposableBean interface, custom destroy methods). Furthermore, it can manage a bean factory hierarchy (delegating to the parent in case of an unknown bean), through implementing the HierarchicalBeanFactory interface.

The main template methods to be implemented by subclasses are getBeanDefinition(java.lang.String) and createBean(java.lang.String, org.springframework.beans.factory.support.RootBeanDefinition, java.lang.Object[]), retrieving a bean definition for a given bean name and creating a bean instance for a given bean definition, respectively. Default implementations of those operations can be found in DefaultListableBeanFactory and AbstractAutowireCapableBeanFactory.

Since:
15 April 2001
Author:
Rod Johnson, Juergen Hoeller, Costin Leau
See Also:
getBeanDefinition(java.lang.String),
createBean(java.lang.String, org.springframework.beans.factory.support.RootBeanDefinition, java.lang.Object[]),
AbstractAutowireCapableBeanFactory.createBean(java.lang.Class),
DefaultListableBeanFactory.getBeanDefinition(java.lang.String)

Field Summary
Fields inherited from class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
logger, NULL_OBJECT
Fields inherited from interface org.springframework.beans.factory.config.ConfigurableBeanFactory
SCOPE_PROTOTYPE, SCOPE_SINGLETON
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Constructor Summary
AbstractBeanFactory()
Create a new AbstractBeanFactory.
AbstractBeanFactory(BeanFactory parentBeanFactory)
Create a new AbstractBeanFactory with the given parent.
Method Summary
 void addBeanPostProcessor(BeanPostProcessor beanPostProcessor)
Add a new BeanPostProcessor that will get applied to beans created by this factory.
 void addEmbeddedValueResolver(StringValueResolver valueResolver)
Add a String resolver for embedded values such as annotation attributes.
 void addPropertyEditorRegistrar(PropertyEditorRegistrar registrar)
Add a PropertyEditorRegistrar to be applied to all bean creation processes.
protected  void afterPrototypeCreation(String beanName)
Callback after prototype creation.
protected  void beforePrototypeCreation(String beanName)
Callback before prototype creation.
protected  void checkMergedBeanDefinition(RootBeanDefinition mbd, String beanName, Object[] args)
Check the given merged bean definition, potentially throwing validation exceptions.
protected  void clearMergedBeanDefinition(String beanName)
Remove the merged bean definition for the specified bean, recreating it on next access.
 boolean containsBean(String name)
Does this bean factory contain a bean with the given name? More specifically, is BeanFactory.getBean(java.lang.String) able to obtain a bean instance for the given name?
protected abstract  boolean containsBeanDefinition(String beanName)
Check if this bean factory contains a bean definition with the given name.
 boolean containsLocalBean(String name)
Return whether the local bean factory contains a bean of the given name, ignoring beans defined in ancestor contexts.
 void copyConfigurationFrom(ConfigurableBeanFactory otherFactory)
Copy all relevant configuration from the given other factory.
 void copyRegisteredEditorsTo(PropertyEditorRegistry registry)
Initialize the given PropertyEditorRegistry with the custom editors that have been registered with this BeanFactory.
protected abstract  Object createBean(String beanName, RootBeanDefinition mbd, Object[] args)
Create a bean instance for the given bean definition.
 void destroyBean(String beanName, Object beanInstance)
Destroy the given bean instance (usually a prototype instance obtained from this factory) according to its bean definition.
protected  void destroyBean(String beanName, Object beanInstance, RootBeanDefinition mbd)
Destroy the given bean instance (usually a prototype instance obtained from this factory) according to the given bean definition.
 void destroyScopedBean(String beanName)
Destroy the specified scoped bean in the current target scope, if any.
protected
<T> T
doGetBean(String name, Class<T> requiredType, Object[] args, boolean typeCheckOnly)
Return an instance, which may be shared or independent, of the specified bean.
protected  Object evaluateBeanDefinitionString(String value, BeanDefinition beanDefinition)
Evaluate the given String as contained in a bean definition, potentially resolving it as an expression.
 AccessControlContext getAccessControlContext()
Delegate the creation of the access control context to the SecurityContextProvider.
 String[] getAliases(String name)
Return the aliases for the given name, if defined.
 Object getBean(String name)
Return an instance, which may be shared or independent, of the specified bean.
<T> T
getBean(String name, Class<T> requiredType)
Return an instance, which may be shared or independent, of the specified bean.
<T> T
getBean(String name, Class<T> requiredType, Object... args)
Return an instance, which may be shared or independent, of the specified bean.
 Object getBean(String name, Object... args)
Return an instance, which may be shared or independent, of the specified bean.
 ClassLoader getBeanClassLoader()
Return this factory's class loader for loading bean classes.
protected abstract  BeanDefinition getBeanDefinition(String beanName)
Return the bean definition for the given bean name.
 BeanExpressionResolver getBeanExpressionResolver()
Return the resolution strategy for expressions in bean definition values.
 int getBeanPostProcessorCount()
Return the current number of registered BeanPostProcessors, if any.
 List<BeanPostProcessor> getBeanPostProcessors()
Return the list of BeanPostProcessors that will get applied to beans created with this factory.
 ConversionService getConversionService()
Return the associated ConversionService, if any.
 Map<Class,Class<? extends PropertyEditor>> getCustomEditors()
Return the map of custom editors, with Classes as keys and PropertyEditor classes as values.
protected  TypeConverter getCustomTypeConverter()
Return the custom TypeConverter to use, if any.
 BeanDefinition getMergedBeanDefinition(String name)
Return a 'merged' BeanDefinition for the given bean name, merging a child bean definition with its parent if necessary.
protected  RootBeanDefinition getMergedBeanDefinition(String beanName, BeanDefinition bd)
Return a RootBeanDefinition for the given top-level bean, by merging with the parent if the given bean's definition is a child bean definition.
protected  RootBeanDefinition getMergedBeanDefinition(String beanName, BeanDefinition bd, BeanDefinition containingBd)
Return a RootBeanDefinition for the given bean, by merging with the parent if the given bean's definition is a child bean definition.
protected  RootBeanDefinition getMergedLocalBeanDefinition(String beanName)
Return a merged RootBeanDefinition, traversing the parent bean definition if the specified bean corresponds to a child bean definition.
protected  Object getObjectForBeanInstance(Object beanInstance, String name, String beanName, RootBeanDefinition mbd)
Get the object for the given bean instance, either the bean instance itself or its created object in case of a FactoryBean.
 BeanFactory getParentBeanFactory()
Return the parent bean factory, or null if there is none.
 Set<PropertyEditorRegistrar> getPropertyEditorRegistrars()
Return the set of PropertyEditorRegistrars.
 Scope getRegisteredScope(String scopeName)
Return the Scope implementation for the given scope name, if any.
 String[] getRegisteredScopeNames()
Return the names of all currently registered scopes.
 ClassLoader getTempClassLoader()
Return the temporary ClassLoader to use for type matching purposes, if any.
 Class<?> getType(String name)
Determine the type of the bean with the given name.
 TypeConverter getTypeConverter()
Obtain a type converter as used by this BeanFactory.
protected  Class getTypeForFactoryBean(String beanName, RootBeanDefinition mbd)
Determine the bean type for the given FactoryBean definition, as far as possible.
protected  boolean hasDestructionAwareBeanPostProcessors()
Return whether this factory holds a DestructionAwareBeanPostProcessor that will get applied to singleton beans on shutdown.
protected  boolean hasInstantiationAwareBeanPostProcessors()
Return whether this factory holds a InstantiationAwareBeanPostProcessor that will get applied to singleton beans on shutdown.
protected  void initBeanWrapper(BeanWrapper bw)
Initialize the given BeanWrapper with the custom editors registered with this factory.
protected  boolean isBeanEligibleForMetadataCaching(String beanName)
Determine whether the specified bean is eligible for having its bean definition metadata cached.
 boolean isBeanNameInUse(String beanName)
Determine whether the given bean name is already in use within this factory, i.e.
 boolean isCacheBeanMetadata()
Return whether to cache bean metadata such as given bean definitions (in merged fashion) and resolved bean classes.
 boolean isCurrentlyInCreation(String beanName)
Determine whether the specified bean is currently in creation.
 boolean isFactoryBean(String name)
Determine whether the bean with the given name is a FactoryBean.
protected  boolean isFactoryBean(String beanName, RootBeanDefinition mbd)
Check whether the given bean is defined as a FactoryBean.
 boolean isPrototype(String name)
Is this bean a prototype? That is, will BeanFactory.getBean(java.lang.String) always return independent instances?
protected  boolean isPrototypeCurrentlyInCreation(String beanName)
Return whether the specified prototype bean is currently in creation (within the current thread).
 boolean isSingleton(String name)
Is this bean a shared singleton? That is, will BeanFactory.getBean(java.lang.String) always return the same instance?
 boolean isTypeMatch(String name, Class targetType)
Check whether the bean with the given name matches the specified type.
protected  void markBeanAsCreated(String beanName)
Mark the specified bean as already created (or about to be created).
protected  String originalBeanName(String name)
Determine the original bean name, resolving locally defined aliases to canonical names.
protected  Class predictBeanType(String beanName, RootBeanDefinition mbd, Class... typesToMatch)
Predict the eventual bean type (of the processed bean instance) for the specified bean.
 void registerCustomEditor(Class requiredType, Class<? extends PropertyEditor> propertyEditorClass)
Register the given custom property editor for all properties of the given type.
protected  void registerCustomEditors(PropertyEditorRegistry registry)
Initialize the given PropertyEditorRegistry with the custom editors that have been registered with this BeanFactory.
protected  void registerDisposableBeanIfNecessary(String beanName, Object bean, RootBeanDefinition mbd)
Add the given bean to the list of disposable beans in this factory, registering its DisposableBean interface and/or the given destroy method to be called on factory shutdown (if applicable).
 void registerScope(String scopeName, Scope scope)
Register the given scope, backed by the given Scope implementation.
protected  boolean removeSingletonIfCreatedForTypeCheckOnly(String beanName)
Remove the singleton instance (if any) for the given bean name, but only if it hasn't been used for other purposes than type checking.
protected  boolean requiresDestruction(Object bean, RootBeanDefinition mbd)
Determine whether the given bean requires destruction on shutdown.
protected  Class resolveBeanClass(RootBeanDefinition mbd, String beanName, Class... typesToMatch)
Resolve the bean class for the specified bean definition, resolving a bean class name into a Class reference (if necessary) and storing the resolved Class in the bean definition for further use.
 String resolveEmbeddedValue(String value)
Resolve the given embedded value, e.g.
 void setBeanClassLoader(ClassLoader beanClassLoader)
Set the class loader to use for loading bean classes.
 void setBeanExpressionResolver(BeanExpressionResolver resolver)
Specify the resolution strategy for expressions in bean definition values.
 void setCacheBeanMetadata(boolean cacheBeanMetadata)
Set whether to cache bean metadata such as given bean definitions (in merged fashion) and resolved bean classes.
 void setConversionService(ConversionService conversionService)
Specify a Spring 3.0 ConversionService to use for converting property values, as an alternative to JavaBeans PropertyEditors.
 void setParentBeanFactory(BeanFactory parentBeanFactory)
Set the parent of this bean factory.
 void setSecurityContextProvider(SecurityContextProvider securityProvider)
Set the security context provider for this bean factory.
 void setTempClassLoader(ClassLoader tempClassLoader)
Specify a temporary ClassLoader to use for type matching purposes.
 void setTypeConverter(TypeConverter typeConverter)
Set a custom type converter that this BeanFactory should use for converting bean property values, constructor argument values, etc.
protected  String transformedBeanName(String name)
Return the bean name, stripping out the factory dereference prefix if necessary, and resolving aliases to canonical names.
Methods inherited from class org.springframework.beans.factory.support.FactoryBeanRegistrySupport
getCachedObjectForFactoryBean, getFactoryBean, getObjectFromFactoryBean, getTypeForFactoryBean, postProcessObjectFromFactoryBean, removeSingleton
Methods inherited from class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
addSingleton, addSingletonFactory, afterSingletonCreation, beforeSingletonCreation, containsSingleton, destroyBean, destroySingleton, destroySingletons, getDependenciesForBean, getDependentBeans, getSingleton, getSingleton, getSingleton, getSingletonCount, getSingletonMutex, getSingletonNames, hasDependentBean, isSingletonCurrentlyInCreation, onSuppressedException, registerContainedBean, registerDependentBean, registerDisposableBean, registerSingleton
Methods inherited from class org.springframework.core.SimpleAliasRegistry
allowAliasOverriding, canonicalName, isAlias, registerAlias, removeAlias, resolveAliases
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.config.ConfigurableBeanFactory
destroySingletons, getDependenciesForBean, getDependentBeans, registerAlias, registerDependentBean, resolveAliases
Methods inherited from interface org.springframework.beans.factory.BeanFactory
getBean
Methods inherited from interface org.springframework.beans.factory.config.SingletonBeanRegistry
containsSingleton, getSingleton, getSingletonCount, getSingletonNames, registerSingleton

Constructor Detail

AbstractBeanFactory

public AbstractBeanFactory()
Create a new AbstractBeanFactory.

AbstractBeanFactory

public AbstractBeanFactory(BeanFactory parentBeanFactory)
Create a new AbstractBeanFactory with the given parent.

Parameters:
parentBeanFactory - parent bean factory, or null if none
See Also:
getBean(java.lang.String)
Method Detail

getBean

public Object getBean(String name)
               throws BeansException
Description copied from interface: BeanFactory
Return an instance, which may be shared or independent, of the specified bean.

This method allows a Spring BeanFactory to be used as a replacement for the Singleton or Prototype design pattern. Callers may retain references to returned objects in the case of Singleton beans.

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Specified by:
getBean in interface BeanFactory
Parameters:
name - the name of the bean to retrieve
Returns:
an instance of the bean
Throws:
NoSuchBeanDefinitionException - if there is no bean definition with the specified name
BeansException - if the bean could not be obtained

getBean

public <T> T getBean(String name,
                     Class<T> requiredType)
          throws BeansException
Description copied from interface: BeanFactory
Return an instance, which may be shared or independent, of the specified bean.

Behaves the same as BeanFactory.getBean(String), but provides a measure of type safety by throwing a BeanNotOfRequiredTypeException if the bean is not of the required type. This means that ClassCastException can't be thrown on casting the result correctly, as can happen with BeanFactory.getBean(String).

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Specified by:
getBean in interface BeanFactory
Parameters:
name - the name of the bean to retrieve
requiredType - type the bean must match. Can be an interface or superclass of the actual class, or null for any match. For example, if the value is Object.class, this method will succeed whatever the class of the returned instance.
Returns:
an instance of the bean
Throws:
NoSuchBeanDefinitionException - if there's no such bean definition
BeanNotOfRequiredTypeException - if the bean is not of the required type
BeansException - if the bean could not be created

getBean

public Object getBean(String name,
                      Object... args)
               throws BeansException
Description copied from interface: BeanFactory
Return an instance, which may be shared or independent, of the specified bean.

Allows for specifying explicit constructor arguments / factory method arguments, overriding the specified default arguments (if any) in the bean definition.

Specified by:
getBean in interface BeanFactory
Parameters:
name - the name of the bean to retrieve
args - arguments to use if creating a prototype using explicit arguments to a static factory method. It is invalid to use a non-null args value in any other case.
Returns:
an instance of the bean
Throws:
NoSuchBeanDefinitionException - if there's no such bean definition
BeanDefinitionStoreException - if arguments have been given but the affected bean isn't a prototype
BeansException - if the bean could not be created

getBean

public <T> T getBean(String name,
                     Class<T> requiredType,
                     Object... args)
          throws BeansException
Return an instance, which may be shared or independent, of the specified bean.

Parameters:
name - the name of the bean to retrieve
requiredType - the required type of the bean to retrieve
args - arguments to use if creating a prototype using explicit arguments to a static factory method. It is invalid to use a non-null args value in any other case.
Returns:
an instance of the bean
Throws:
BeansException - if the bean could not be created

doGetBean

protected <T> T doGetBean(String name,
                          Class<T> requiredType,
                          Object[] args,
                          boolean typeCheckOnly)
               throws BeansException
Return an instance, which may be shared or independent, of the specified bean.

Parameters:
name - the name of the bean to retrieve
requiredType - the required type of the bean to retrieve
args - arguments to use if creating a prototype using explicit arguments to a static factory method. It is invalid to use a non-null args value in any other case.
typeCheckOnly - whether the instance is obtained for a type check, not for actual use
Returns:
an instance of the bean
Throws:
BeansException - if the bean could not be created

containsBean

public boolean containsBean(String name)
Description copied from interface: BeanFactory
Does this bean factory contain a bean with the given name? More specifically, is BeanFactory.getBean(java.lang.String) able to obtain a bean instance for the given name?

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Specified by:
containsBean in interface BeanFactory
Parameters:
name - the name of the bean to query
Returns:
whether a bean with the given name is defined

isSingleton

public boolean isSingleton(String name)
                    throws NoSuchBeanDefinitionException
Description copied from interface: BeanFactory
Is this bean a shared singleton? That is, will BeanFactory.getBean(java.lang.String) always return the same instance?

Note: This method returning false does not clearly indicate independent instances. It indicates non-singleton instances, which may correspond to a scoped bean as well. Use the BeanFactory.isPrototype(java.lang.String) operation to explicitly check for independent instances.

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Specified by:
isSingleton in interface BeanFactory
Parameters:
name - the name of the bean to query
Returns:
whether this bean corresponds to a singleton instance
Throws:
NoSuchBeanDefinitionException - if there is no bean with the given name
See Also:
BeanFactory.getBean(java.lang.String), BeanFactory.isPrototype(java.lang.String)

isPrototype

public boolean isPrototype(String name)
                    throws NoSuchBeanDefinitionException
Description copied from interface: BeanFactory
Is this bean a prototype? That is, will BeanFactory.getBean(java.lang.String) always return independent instances?

Note: This method returning false does not clearly indicate a singleton object. It indicates non-independent instances, which may correspond to a scoped bean as well. Use the BeanFactory.isSingleton(java.lang.String) operation to explicitly check for a shared singleton instance.

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Specified by:
isPrototype in interface BeanFactory
Parameters:
name - the name of the bean to query
Returns:
whether this bean will always deliver independent instances
Throws:
NoSuchBeanDefinitionException - if there is no bean with the given name
See Also:
BeanFactory.getBean(java.lang.String), BeanFactory.isSingleton(java.lang.String)

isTypeMatch

public boolean isTypeMatch(String name,
                           Class targetType)
                    throws NoSuchBeanDefinitionException
Description copied from interface: BeanFactory
Check whether the bean with the given name matches the specified type. More specifically, check whether a BeanFactory.getBean(java.lang.String) call for the given name would return an object that is assignable to the specified target type.

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Specified by:
isTypeMatch in interface BeanFactory
Parameters:
name - the name of the bean to query
targetType - the type to match against
Returns:
true if the bean type matches, false if it doesn't match or cannot be determined yet
Throws:
NoSuchBeanDefinitionException - if there is no bean with the given name
See Also:
BeanFactory.getBean(java.lang.String), BeanFactory.getType(java.lang.String)

getType

public Class<?> getType(String name)
                 throws NoSuchBeanDefinitionException
Description copied from interface: BeanFactory
Determine the type of the bean with the given name. More specifically, determine the type of object that BeanFactory.getBean(java.lang.String) would return for the given name.

For a FactoryBean, return the type of object that the FactoryBean creates, as exposed by FactoryBean.getObjectType().

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Specified by:
getType in interface BeanFactory
Parameters:
name - the name of the bean to query
Returns:
the type of the bean, or null if not determinable
Throws:
NoSuchBeanDefinitionException - if there is no bean with the given name
See Also:
BeanFactory.getBean(java.lang.String), BeanFactory.isTypeMatch(java.lang.String, java.lang.Class)

getAliases

public String[] getAliases(String name)
Description copied from interface: AliasRegistry
Return the aliases for the given name, if defined.

Specified by:
getAliases in interface BeanFactory
Specified by:
getAliases in interface AliasRegistry
Overrides:
getAliases in class SimpleAliasRegistry
Parameters:
name - the name to check for aliases
Returns:
the aliases, or an empty array if none
See Also:
BeanFactory.getBean(java.lang.String)

getParentBeanFactory

public BeanFactory getParentBeanFactory()
Description copied from interface: HierarchicalBeanFactory
Return the parent bean factory, or null if there is none.

Specified by:
getParentBeanFactory in interface HierarchicalBeanFactory

containsLocalBean

public boolean containsLocalBean(String name)
Description copied from interface: HierarchicalBeanFactory
Return whether the local bean factory contains a bean of the given name, ignoring beans defined in ancestor contexts.

This is an alternative to containsBean, ignoring a bean of the given name from an ancestor bean factory.

Specified by:
containsLocalBean in interface HierarchicalBeanFactory
Parameters:
name - the name of the bean to query
Returns:
whether a bean with the given name is defined in the local factory
See Also:
BeanFactory.containsBean(java.lang.String)

setParentBeanFactory

public void setParentBeanFactory(BeanFactory parentBeanFactory)
Description copied from interface: ConfigurableBeanFactory
Set the parent of this bean factory.

Note that the parent cannot be changed: It should only be set outside a constructor if it isn't available at the time of factory instantiation.

Specified by:
setParentBeanFactory in interface ConfigurableBeanFactory
Parameters:
parentBeanFactory - the parent BeanFactory
See Also:
HierarchicalBeanFactory.getParentBeanFactory()

setBeanClassLoader

public void setBeanClassLoader(ClassLoader beanClassLoader)
Description copied from interface: ConfigurableBeanFactory
Set the class loader to use for loading bean classes. Default is the thread context class loader.

Note that this class loader will only apply to bean definitions that do not carry a resolved bean class yet. This is the case as of Spring 2.0 by default: Bean definitions only carry bean class names, to be resolved once the factory processes the bean definition.

Specified by:
setBeanClassLoader in interface ConfigurableBeanFactory
Parameters:
beanClassLoader - the class loader to use, or null to suggest the default class loader

getBeanClassLoader

public ClassLoader getBeanClassLoader()
Description copied from interface: ConfigurableBeanFactory
Return this factory's class loader for loading bean classes.

Specified by:
getBeanClassLoader in interface ConfigurableBeanFactory

setTempClassLoader

public void setTempClassLoader(ClassLoader tempClassLoader)
Description copied from interface: ConfigurableBeanFactory
Specify a temporary ClassLoader to use for type matching purposes. Default is none, simply using the standard bean ClassLoader.

A temporary ClassLoader is usually just specified if load-time weaving is involved, to make sure that actual bean classes are loaded as lazily as possible. The temporary loader is then removed once the BeanFactory completes its bootstrap phase.

Specified by:
setTempClassLoader in interface ConfigurableBeanFactory

getTempClassLoader

public ClassLoader getTempClassLoader()
Description copied from interface: ConfigurableBeanFactory
Return the temporary ClassLoader to use for type matching purposes, if any.

Specified by:
getTempClassLoader in interface ConfigurableBeanFactory

setCacheBeanMetadata

public void setCacheBeanMetadata(boolean cacheBeanMetadata)
Description copied from interface: ConfigurableBeanFactory
Set whether to cache bean metadata such as given bean definitions (in merged fashion) and resolved bean classes. Default is on.

Turn this flag off to enable hot-refreshing of bean definition objects and in particular bean classes. If this flag is off, any creation of a bean instance will re-query the bean class loader for newly resolved classes.

Specified by:
setCacheBeanMetadata in interface ConfigurableBeanFactory

isCacheBeanMetadata

public boolean isCacheBeanMetadata()
Description copied from interface: ConfigurableBeanFactory
Return whether to cache bean metadata such as given bean definitions (in merged fashion) and resolved bean classes.

Specified by:
isCacheBeanMetadata in interface ConfigurableBeanFactory

setBeanExpressionResolver

public void setBeanExpressionResolver(BeanExpressionResolver resolver)
Description copied from interface: ConfigurableBeanFactory
Specify the resolution strategy for expressions in bean definition values.

There is no expression support active in a BeanFactory by default. An ApplicationContext will typically set a standard expression strategy here, supporting "#{...}" expressions in a Unified EL compatible style.

Specified by:
setBeanExpressionResolver in interface ConfigurableBeanFactory

getBeanExpressionResolver

public BeanExpressionResolver getBeanExpressionResolver()
Description copied from interface: ConfigurableBeanFactory
Return the resolution strategy for expressions in bean definition values.

Specified by:
getBeanExpressionResolver in interface ConfigurableBeanFactory

setConversionService

public void setConversionService(ConversionService conversionService)
Description copied from interface: ConfigurableBeanFactory
Specify a Spring 3.0 ConversionService to use for converting property values, as an alternative to JavaBeans PropertyEditors.

Specified by:
setConversionService in interface ConfigurableBeanFactory

getConversionService

public ConversionService getConversionService()
Description copied from interface: ConfigurableBeanFactory
Return the associated ConversionService, if any.

Specified by:
getConversionService in interface ConfigurableBeanFactory

addPropertyEditorRegistrar

public void addPropertyEditorRegistrar(PropertyEditorRegistrar registrar)
Description copied from interface: ConfigurableBeanFactory
Add a PropertyEditorRegistrar to be applied to all bean creation processes.

Such a registrar creates new PropertyEditor instances and registers them on the given registry, fresh for each bean creation attempt. This avoids the need for synchronization on custom editors; hence, it is generally preferable to use this method instead of ConfigurableBeanFactory.registerCustomEditor(java.lang.Class, java.lang.Class).

Specified by:
addPropertyEditorRegistrar in interface ConfigurableBeanFactory
Parameters:
registrar - the PropertyEditorRegistrar to register

getPropertyEditorRegistrars

public Set<PropertyEditorRegistrar> getPropertyEditorRegistrars()
Return the set of PropertyEditorRegistrars.

registerCustomEditor

public void registerCustomEditor(Class requiredType,
                                 Class<? extends PropertyEditor> propertyEditorClass)
Description copied from interface: ConfigurableBeanFactory
Register the given custom property editor for all properties of the given type. To be invoked during factory configuration.

Note that this method will register a shared custom editor instance; access to that instance will be synchronized for thread-safety. It is generally preferable to use ConfigurableBeanFactory.addPropertyEditorRegistrar(org.springframework.beans.PropertyEditorRegistrar) instead of this method, to avoid for the need for synchronization on custom editors.

Specified by:
registerCustomEditor in interface ConfigurableBeanFactory
Parameters:
requiredType - type of the property
propertyEditorClass - the PropertyEditor class to register

copyRegisteredEditorsTo

public void copyRegisteredEditorsTo(PropertyEditorRegistry registry)
Description copied from interface: ConfigurableBeanFactory
Initialize the given PropertyEditorRegistry with the custom editors that have been registered with this BeanFactory.

Specified by:
copyRegisteredEditorsTo in interface ConfigurableBeanFactory
Parameters:
registry - the PropertyEditorRegistry to initialize

getCustomEditors

public Map<Class,Class<? extends PropertyEditor>> getCustomEditors()
Return the map of custom editors, with Classes as keys and PropertyEditor classes as values.

setTypeConverter

public void setTypeConverter(TypeConverter typeConverter)
Description copied from interface: ConfigurableBeanFactory
Set a custom type converter that this BeanFactory should use for converting bean property values, constructor argument values, etc.

This will override the default PropertyEditor mechanism and hence make any custom editors or custom editor registrars irrelevant.

Specified by:
setTypeConverter in interface ConfigurableBeanFactory
See Also:
ConfigurableBeanFactory.addPropertyEditorRegistrar(org.springframework.beans.PropertyEditorRegistrar), ConfigurableBeanFactory.registerCustomEditor(java.lang.Class, java.lang.Class)

getCustomTypeConverter

protected TypeConverter getCustomTypeConverter()
Return the custom TypeConverter to use, if any.

Returns:
the custom TypeConverter, or null if none specified

getTypeConverter

public TypeConverter getTypeConverter()
Description copied from interface: ConfigurableBeanFactory
Obtain a type converter as used by this BeanFactory. This may be a fresh instance for each call, since TypeConverters are usually not thread-safe.

If the default PropertyEditor mechanism is active, the returned TypeConverter will be aware of all custom editors that have been registered.

Specified by:
getTypeConverter in interface ConfigurableBeanFactory

addEmbeddedValueResolver

public void addEmbeddedValueResolver(StringValueResolver valueResolver)
Description copied from interface: ConfigurableBeanFactory
Add a String resolver for embedded values such as annotation attributes.

Specified by:
addEmbeddedValueResolver in interface ConfigurableBeanFactory
Parameters:
valueResolver - the String resolver to apply to embedded values

resolveEmbeddedValue

public String resolveEmbeddedValue(String value)
Description copied from interface: ConfigurableBeanFactory
Resolve the given embedded value, e.g. an annotation attribute.

Specified by:
resolveEmbeddedValue in interface ConfigurableBeanFactory
Parameters:
value - the value to resolve
Returns:
the resolved value (may be the original value as-is)

addBeanPostProcessor

public void addBeanPostProcessor(BeanPostProcessor beanPostProcessor)
Description copied from interface: ConfigurableBeanFactory
Add a new BeanPostProcessor that will get applied to beans created by this factory. To be invoked during factory configuration.

Note: Post-processors submitted here will be applied in the order of registration; any ordering semantics expressed through implementing the Ordered interface will be ignored. Note that autodetected post-processors (e.g. as beans in an ApplicationContext) will always be applied after programmatically registered ones.

Specified by:
addBeanPostProcessor in interface ConfigurableBeanFactory
Parameters:
beanPostProcessor - the post-processor to register

getBeanPostProcessorCount

public int getBeanPostProcessorCount()
Description copied from interface: ConfigurableBeanFactory
Return the current number of registered BeanPostProcessors, if any.

Specified by:
getBeanPostProcessorCount in interface ConfigurableBeanFactory

getBeanPostProcessors

public List<BeanPostProcessor> getBeanPostProcessors()
Return the list of BeanPostProcessors that will get applied to beans created with this factory.

hasInstantiationAwareBeanPostProcessors

protected boolean hasInstantiationAwareBeanPostProcessors()
Return whether this factory holds a InstantiationAwareBeanPostProcessor that will get applied to singleton beans on shutdown.

See Also:
addBeanPostProcessor(org.springframework.beans.factory.config.BeanPostProcessor), InstantiationAwareBeanPostProcessor

hasDestructionAwareBeanPostProcessors

protected boolean hasDestructionAwareBeanPostProcessors()
Return whether this factory holds a DestructionAwareBeanPostProcessor that will get applied to singleton beans on shutdown.

See Also:
addBeanPostProcessor(org.springframework.beans.factory.config.BeanPostProcessor), DestructionAwareBeanPostProcessor

registerScope

public void registerScope(String scopeName,
                          Scope scope)
Description copied from interface: ConfigurableBeanFactory
Register the given scope, backed by the given Scope implementation.

Specified by:
registerScope in interface ConfigurableBeanFactory
Parameters:
scopeName - the scope identifier
scope - the backing Scope implementation

getRegisteredScopeNames

public String[] getRegisteredScopeNames()
Description copied from interface: ConfigurableBeanFactory
Return the names of all currently registered scopes.

This will only return the names of explicitly registered scopes. Built-in scopes such as "singleton" and "prototype" won't be exposed.

Specified by:
getRegisteredScopeNames in interface ConfigurableBeanFactory
Returns:
the array of scope names, or an empty array if none
See Also:
ConfigurableBeanFactory.registerScope(java.lang.String, org.springframework.beans.factory.config.Scope)

getRegisteredScope

public Scope getRegisteredScope(String scopeName)
Description copied from interface: ConfigurableBeanFactory
Return the Scope implementation for the given scope name, if any.

This will only return explicitly registered scopes. Built-in scopes such as "singleton" and "prototype" won't be exposed.

Specified by:
getRegisteredScope in interface ConfigurableBeanFactory
Parameters:
scopeName - the name of the scope
Returns:
the registered Scope implementation, or null if none
See Also:
ConfigurableBeanFactory.registerScope(java.lang.String, org.springframework.beans.factory.config.Scope)

setSecurityContextProvider

public void setSecurityContextProvider(SecurityContextProvider securityProvider)
Set the security context provider for this bean factory. If a security manager is set, interaction with the user code will be executed using the privileged of the provided security context.

getAccessControlContext

public AccessControlContext getAccessControlContext()
Delegate the creation of the access control context to the SecurityContextProvider.

Specified by:
getAccessControlContext in interface ConfigurableBeanFactory
Overrides:
getAccessControlContext in class FactoryBeanRegistrySupport
Returns:
the applicable AccessControlContext (never null)
See Also:
AccessController.getContext()

copyConfigurationFrom

public void copyConfigurationFrom(ConfigurableBeanFactory otherFactory)
Description copied from interface: ConfigurableBeanFactory
Copy all relevant configuration from the given other factory.

Should include all standard configuration settings as well as BeanPostProcessors, Scopes, and factory-specific internal settings. Should not include any metadata of actual bean definitions, such as BeanDefinition objects and bean name aliases.

Specified by:
copyConfigurationFrom in interface ConfigurableBeanFactory
Parameters:
otherFactory - the other BeanFactory to copy from

getMergedBeanDefinition

public BeanDefinition getMergedBeanDefinition(String name)
                                       throws BeansException
Return a 'merged' BeanDefinition for the given bean name, merging a child bean definition with its parent if necessary.

This getMergedBeanDefinition considers bean definition in ancestors as well.

Specified by:
getMergedBeanDefinition in interface ConfigurableBeanFactory
Parameters:
name - the name of the bean to retrieve the merged definition for (may be an alias)
Returns:
a (potentially merged) RootBeanDefinition for the given bean
Throws:
NoSuchBeanDefinitionException - if there is no bean with the given name
BeanDefinitionStoreException - in case of an invalid bean definition
BeansException

isFactoryBean

public boolean isFactoryBean(String name)
                      throws NoSuchBeanDefinitionException
Description copied from interface: ConfigurableBeanFactory
Determine whether the bean with the given name is a FactoryBean.

Specified by:
isFactoryBean in interface ConfigurableBeanFactory
Parameters:
name - the name of the bean to check
Returns:
whether the bean is a FactoryBean (false means the bean exists but is not a FactoryBean)
Throws:
NoSuchBeanDefinitionException - if there is no bean with the given name

beforePrototypeCreation

protected void beforePrototypeCreation(String beanName)
Callback before prototype creation.

The default implementation register the prototype as currently in creation.

Parameters:
beanName - the name of the prototype about to be created
See Also:
isPrototypeCurrentlyInCreation(java.lang.String)

afterPrototypeCreation

protected void afterPrototypeCreation(String beanName)
Callback after prototype creation.

The default implementation marks the prototype as not in creation anymore.

Parameters:
beanName - the name of the prototype that has been created
See Also:
isPrototypeCurrentlyInCreation(java.lang.String)

isPrototypeCurrentlyInCreation

protected final boolean isPrototypeCurrentlyInCreation(String beanName)
Return whether the specified prototype bean is currently in creation (within the current thread).

Parameters:
beanName - the name of the bean

isCurrentlyInCreation

public boolean isCurrentlyInCreation(String beanName)
Description copied from interface: ConfigurableBeanFactory
Determine whether the specified bean is currently in creation.

Specified by:
isCurrentlyInCreation in interface ConfigurableBeanFactory
Parameters:
beanName - the name of the bean
Returns:
whether the bean is currently in creation

destroyBean

public void destroyBean(String beanName,
                        Object beanInstance)
Description copied from interface: ConfigurableBeanFactory
Destroy the given bean instance (usually a prototype instance obtained from this factory) according to its bean definition.

Any exception that arises during destruction should be caught and logged instead of propagated to the caller of this method.

Specified by:
destroyBean in interface ConfigurableBeanFactory
Parameters:
beanName - the name of the bean definition
beanInstance - the bean instance to destroy

destroyBean

protected void destroyBean(String beanName,
                           Object beanInstance,
                           RootBeanDefinition mbd)
Destroy the given bean instance (usually a prototype instance obtained from this factory) according to the given bean definition.

Parameters:
beanName - the name of the bean definition
beanInstance - the bean instance to destroy
mbd - the merged bean definition

destroyScopedBean

public void destroyScopedBean(String beanName)
Description copied from interface: ConfigurableBeanFactory
Destroy the specified scoped bean in the current target scope, if any.

Any exception that arises during destruction should be caught and logged instead of propagated to the caller of this method.

Specified by:
destroyScopedBean in interface ConfigurableBeanFactory
Parameters:
beanName - the name of the scoped bean

transformedBeanName

protected String transformedBeanName(String name)
Return the bean name, stripping out the factory dereference prefix if necessary, and resolving aliases to canonical names.

Parameters:
name - the user-specified name
Returns:
the transformed bean name

originalBeanName

protected String originalBeanName(String name)
Determine the original bean name, resolving locally defined aliases to canonical names.

Parameters:
name - the user-specified name
Returns:
the original bean name

initBeanWrapper

protected void initBeanWrapper(BeanWrapper bw)
Initialize the given BeanWrapper with the custom editors registered with this factory. To be called for BeanWrappers that will create and populate bean instances.

The default implementation delegates to registerCustomEditors(org.springframework.beans.PropertyEditorRegistry). Can be overridden in subclasses.

Parameters:
bw - the BeanWrapper to initialize

registerCustomEditors

protected void registerCustomEditors(PropertyEditorRegistry registry)
Initialize the given PropertyEditorRegistry with the custom editors that have been registered with this BeanFactory.

To be called for BeanWrappers that will create and populate bean instances, and for SimpleTypeConverter used for constructor argument and factory method type conversion.

Parameters:
registry - the PropertyEditorRegistry to initialize

getMergedLocalBeanDefinition

protected RootBeanDefinition getMergedLocalBeanDefinition(String beanName)
                                                   throws BeansException
Return a merged RootBeanDefinition, traversing the parent bean definition if the specified bean corresponds to a child bean definition.

Parameters:
beanName - the name of the bean to retrieve the merged definition for
Returns:
a (potentially merged) RootBeanDefinition for the given bean
Throws:
NoSuchBeanDefinitionException - if there is no bean with the given name
BeanDefinitionStoreException - in case of an invalid bean definition
BeansException

getMergedBeanDefinition

protected RootBeanDefinition getMergedBeanDefinition(String beanName,
                                                     BeanDefinition bd)
                                              throws BeanDefinitionStoreException
Return a RootBeanDefinition for the given top-level bean, by merging with the parent if the given bean's definition is a child bean definition.

Parameters:
beanName - the name of the bean definition
bd - the original bean definition (Root/ChildBeanDefinition)
Returns:
a (potentially merged) RootBeanDefinition for the given bean
Throws:
BeanDefinitionStoreException - in case of an invalid bean definition

getMergedBeanDefinition

protected RootBeanDefinition getMergedBeanDefinition(String beanName,
                                                     BeanDefinition bd,
                                                     BeanDefinition containingBd)
                                              throws BeanDefinitionStoreException
Return a RootBeanDefinition for the given bean, by merging with the parent if the given bean's definition is a child bean definition.

Parameters:
beanName - the name of the bean definition
bd - the original bean definition (Root/ChildBeanDefinition)
containingBd - the containing bean definition in case of inner bean, or null in case of a top-level bean
Returns:
a (potentially merged) RootBeanDefinition for the given bean
Throws:
BeanDefinitionStoreException - in case of an invalid bean definition

checkMergedBeanDefinition

protected void checkMergedBeanDefinition(RootBeanDefinition mbd,
                                         String beanName,
                                         Object[] args)
                                  throws BeanDefinitionStoreException
Check the given merged bean definition, potentially throwing validation exceptions.

Parameters:
mbd - the merged bean definition to check
beanName - the name of the bean
args - the arguments for bean creation, if any
Throws:
BeanDefinitionStoreException - in case of validation failure

clearMergedBeanDefinition

protected void clearMergedBeanDefinition(String beanName)
Remove the merged bean definition for the specified bean, recreating it on next access.

Parameters:
beanName - the bean name to clear the merged definition for

resolveBeanClass

protected Class resolveBeanClass(RootBeanDefinition mbd,
                                 String beanName,
                                 Class... typesToMatch)
                          throws CannotLoadBeanClassException
Resolve the bean class for the specified bean definition, resolving a bean class name into a Class reference (if necessary) and storing the resolved Class in the bean definition for further use.

Parameters:
mbd - the merged bean definition to determine the class for
beanName - the name of the bean (for error handling purposes)
typesToMatch - the types to match in case of internal type matching purposes (also signals that the returned Class will never be exposed to application code)
Returns:
the resolved bean class (or null if none)
Throws:
CannotLoadBeanClassException - if we failed to load the class

evaluateBeanDefinitionString

protected Object evaluateBeanDefinitionString(String value,
                                              BeanDefinition beanDefinition)
Evaluate the given String as contained in a bean definition, potentially resolving it as an expression.

Parameters:
value - the value to check
beanDefinition - the bean definition that the value comes from
Returns:
the resolved value
See Also:
setBeanExpressionResolver(org.springframework.beans.factory.config.BeanExpressionResolver)

predictBeanType

protected Class predictBeanType(String beanName,
                                RootBeanDefinition mbd,
                                Class... typesToMatch)
Predict the eventual bean type (of the processed bean instance) for the specified bean. Called by getType(java.lang.String) and isTypeMatch(java.lang.String, java.lang.Class). Does not need to handle FactoryBeans specifically, since it is only supposed to operate on the raw bean type.

This implementation is simplistic in that it is not able to handle factory methods and InstantiationAwareBeanPostProcessors. It only predicts the bean type correctly for a standard bean. To be overridden in subclasses, applying more sophisticated type detection.

Parameters:
beanName - the name of the bean
mbd - the merged bean definition to determine the type for
typesToMatch - the types to match in case of internal type matching purposes (also signals that the returned Class will never be exposed to application code)
Returns:
the type of the bean, or null if not predictable

isFactoryBean

protected boolean isFactoryBean(String beanName,
                                RootBeanDefinition mbd)
Check whether the given bean is defined as a FactoryBean.

Parameters:
beanName - the name of the bean
mbd - the corresponding bean definition

getTypeForFactoryBean

protected Class getTypeForFactoryBean(String beanName,
                                      RootBeanDefinition mbd)
Determine the bean type for the given FactoryBean definition, as far as possible. Only called if there is no singleton instance registered for the target bean already.

The default implementation creates the FactoryBean via getBean to call its getObjectType method. Subclasses are encouraged to optimize this, typically by just instantiating the FactoryBean but not populating it yet, trying whether its getObjectType method already returns a type. If no type found, a full FactoryBean creation as performed by this implementation should be used as fallback.

Parameters:
beanName - the name of the bean
mbd - the merged bean definition for the bean
Returns:
the type for the bean if determinable, or null else
See Also:
FactoryBean.getObjectType(), getBean(String)

markBeanAsCreated

protected void markBeanAsCreated(String beanName)
Mark the specified bean as already created (or about to be created).

This allows the bean factory to optimize its caching for repeated creation of the specified bean.

Parameters:
beanName - the name of the bean

isBeanEligibleForMetadataCaching

protected boolean isBeanEligibleForMetadataCaching(String beanName)
Determine whether the specified bean is eligible for having its bean definition metadata cached.

Parameters:
beanName - the name of the bean
Returns:
true if the bean's metadata may be cached at this point already

removeSingletonIfCreatedForTypeCheckOnly

protected boolean removeSingletonIfCreatedForTypeCheckOnly(String beanName)
Remove the singleton instance (if any) for the given bean name, but only if it hasn't been used for other purposes than type checking.

Parameters:
beanName - the name of the bean
Returns:
true if actually removed, false otherwise

getObjectForBeanInstance

protected Object getObjectForBeanInstance(Object beanInstance,
                                          String name,
                                          String beanName,
                                          RootBeanDefinition mbd)
Get the object for the given bean instance, either the bean instance itself or its created object in case of a FactoryBean.

Parameters:
beanInstance - the shared bean instance
name - name that may include factory dereference prefix
beanName - the canonical bean name
mbd - the merged bean definition
Returns:
the object to expose for the bean

isBeanNameInUse

public boolean isBeanNameInUse(String beanName)
Determine whether the given bean name is already in use within this factory, i.e. whether there is a local bean or alias registered under this name or an inner bean created with this name.

Parameters:
beanName - the name to check

requiresDestruction

protected boolean requiresDestruction(Object bean,
                                      RootBeanDefinition mbd)
Determine whether the given bean requires destruction on shutdown.

The default implementation checks the DisposableBean interface as well as a specified destroy method and registered DestructionAwareBeanPostProcessors.

Parameters:
bean - the bean instance to check
mbd - the corresponding bean definition
See Also:
DisposableBean, AbstractBeanDefinition.getDestroyMethodName(), DestructionAwareBeanPostProcessor

registerDisposableBeanIfNecessary

protected void registerDisposableBeanIfNecessary(String beanName,
                                                 Object bean,
                                                 RootBeanDefinition mbd)
Add the given bean to the list of disposable beans in this factory, registering its DisposableBean interface and/or the given destroy method to be called on factory shutdown (if applicable). Only applies to singletons.

Parameters:
beanName - the name of the bean
bean - the bean instance
mbd - the bean definition for the bean
See Also:
AbstractBeanDefinition.isSingleton(),
AbstractBeanDefinition.getDependsOn(),
DefaultSingletonBeanRegistry.registerDisposableBean(java.lang.String, org.springframework.beans.factory.DisposableBean),
DefaultSingletonBeanRegistry.registerDependentBean(java.lang.String, java.lang.String)

containsBeanDefinition

protected abstract boolean containsBeanDefinition(String beanName)
Check if this bean factory contains a bean definition with the given name. Does not consider any hierarchy this factory may participate in. Invoked by containsBean when no cached singleton instance is found.

Depending on the nature of the concrete bean factory implementation, this operation might be expensive (for example, because of directory lookups in external registries). However, for listable bean factories, this usually just amounts to a local hash lookup: The operation is therefore part of the public interface there. The same implementation can serve for both this template method and the public interface method in that case.

Parameters:
beanName - the name of the bean to look for
Returns:
if this bean factory contains a bean definition with the given name
See Also:
containsBean(java.lang.String), ListableBeanFactory.containsBeanDefinition(java.lang.String)

getBeanDefinition

protected abstract BeanDefinition getBeanDefinition(String beanName)
                                             throws BeansException
Return the bean definition for the given bean name. Subclasses should normally implement caching, as this method is invoked by this class every time bean definition metadata is needed.

Depending on the nature of the concrete bean factory implementation, this operation might be expensive (for example, because of directory lookups in external registries). However, for listable bean factories, this usually just amounts to a local hash lookup: The operation is therefore part of the public interface there. The same implementation can serve for both this template method and the public interface method in that case.

Parameters:
beanName - the name of the bean to find a definition for
Returns:
the BeanDefinition for this prototype name (never null)
Throws:
NoSuchBeanDefinitionException - if the bean definition cannot be resolved
BeansException - in case of errors
See Also:
RootBeanDefinition, ChildBeanDefinition, ConfigurableListableBeanFactory.getBeanDefinition(java.lang.String)

createBean

protected abstract Object createBean(String beanName,
                                     RootBeanDefinition mbd,
                                     Object[] args)
                              throws BeanCreationException
Create a bean instance for the given bean definition. The bean definition will already have been merged with the parent definition in case of a child definition.

All the other methods in this class invoke this method, although beans may be cached after being instantiated by this method. All bean instantiation within this class is performed by this method.

Parameters:
beanName - the name of the bean
mbd - the merged bean definition for the bean
args - arguments to use if creating a prototype using explicit arguments to a static factory method. This parameter must be null except in this case.
Returns:
a new instance of the bean
Throws:
BeanCreationException - if the bean could not be created
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AutowireCandidateQualifier

org.springframework.beans.factory.support
Class AutowireCandidateQualifier

java.lang.Object
    extended by  org.springframework.core.AttributeAccessorSupport
        extended by  org.springframework.beans.BeanMetadataAttributeAccessor
            extended by  org.springframework.beans.factory.support.AutowireCandidateQualifier
All Implemented Interfaces:
Serializable, BeanMetadataElement, AttributeAccessor
public class AutowireCandidateQualifier
extends BeanMetadataAttributeAccessor

Qualifier for resolving autowire candidates. A bean definition that includes one or more such qualifiers enables fine-grained matching against annotations on a field or parameter to be autowired.

Since:
2.5
Author:
Mark Fisher, Juergen Hoeller
See Also:
Qualifier, Serialized Form

Field Summary
static String VALUE_KEY
Constructor Summary
AutowireCandidateQualifier(Class type)
Construct a qualifier to match against an annotation of the given type.
AutowireCandidateQualifier(Class type, Object value)
Construct a qualifier to match against an annotation of the given type whose value attribute also matches the specified value.
AutowireCandidateQualifier(String typeName)
Construct a qualifier to match against an annotation of the given type name.
AutowireCandidateQualifier(String typeName, Object value)
Construct a qualifier to match against an annotation of the given type name whose value attribute also matches the specified value.
Method Summary
 String getTypeName()
Retrieve the type name.
Methods inherited from class org.springframework.beans.BeanMetadataAttributeAccessor
addMetadataAttribute, getAttribute, getMetadataAttribute, getSource, removeAttribute, setAttribute, setSource
Methods inherited from class org.springframework.core.AttributeAccessorSupport
attributeNames, copyAttributesFrom, equals, hasAttribute, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Field Detail

VALUE_KEY

public static String VALUE_KEY
Constructor Detail

AutowireCandidateQualifier

public AutowireCandidateQualifier(Class type)
Construct a qualifier to match against an annotation of the given type.

Parameters:
type - the annotation type

AutowireCandidateQualifier

public AutowireCandidateQualifier(String typeName)
Construct a qualifier to match against an annotation of the given type name.

The type name may match the fully-qualified class name of the annotation or the short class name (without the package).

Parameters:
typeName - the name of the annotation type

AutowireCandidateQualifier

public AutowireCandidateQualifier(Class type,
                                  Object value)
Construct a qualifier to match against an annotation of the given type whose value attribute also matches the specified value.

Parameters:
type - the annotation type
value - the annotation value to match

AutowireCandidateQualifier

public AutowireCandidateQualifier(String typeName,
                                  Object value)
Construct a qualifier to match against an annotation of the given type name whose value attribute also matches the specified value.

The type name may match the fully-qualified class name of the annotation or the short class name (without the package).

Parameters:
typeName - the name of the annotation type
value - the annotation value to match
Method Detail

getTypeName

public String getTypeName()
Retrieve the type name. This value will be the same as the type name provided to the constructor or the fully-qualified class name if a Class instance was provided to the constructor.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanDefinitionBuilder

org.springframework.beans.factory.support
Class BeanDefinitionBuilder

java.lang.Object
    extended by  org.springframework.beans.factory.support.BeanDefinitionBuilder

public class BeanDefinitionBuilder
extends Object

Programmatic means of constructing BeanDefinitions using the builder pattern. Intended primarily for use when implementing Spring 2.0 NamespaceHandlers.

Since:
2.0
Author:
Rod Johnson, Rob Harrop, Juergen Hoeller

Method Summary
BeanDefinitionBuilder | addConstructorArg(Object value) Deprecated. since Spring 2.5, in favor of addConstructorArgValue(java.lang.Object)
BeanDefinitionBuilder | addConstructorArgReference(String beanName) Add a reference to a named bean as a constructor arg.
BeanDefinitionBuilder | addConstructorArgValue(Object value) Add an indexed constructor arg value.
BeanDefinitionBuilder | addDependsOn(String beanName) Append the specified bean name to the list of beans that this definition depends on.
BeanDefinitionBuilder | addPropertyReference(String name, String beanName) Add a reference to the specified bean name under the property specified.
BeanDefinitionBuilder | addPropertyValue(String name, Object value) Add the supplied property value under the given name.
static BeanDefinitionBuilder | childBeanDefinition(String parentName) Create a new BeanDefinitionBuilder used to construct a ChildBeanDefinition.
static BeanDefinitionBuilder | genericBeanDefinition() Create a new BeanDefinitionBuilder used to construct a GenericBeanDefinition.
static BeanDefinitionBuilder | genericBeanDefinition(Class beanClass) Create a new BeanDefinitionBuilder used to construct a GenericBeanDefinition.
static BeanDefinitionBuilder | genericBeanDefinition(String beanClassName) Create a new BeanDefinitionBuilder used to construct a GenericBeanDefinition.
AbstractBeanDefinition | getBeanDefinition() Validate and return the created BeanDefinition object.
AbstractBeanDefinition | getRawBeanDefinition() Return the current BeanDefinition object in its raw (unvalidated) form.
static BeanDefinitionBuilder | rootBeanDefinition(Class beanClass) Create a new BeanDefinitionBuilder used to construct a RootBeanDefinition.
static BeanDefinitionBuilder | rootBeanDefinition(Class beanClass, String factoryMethodName) Create a new BeanDefinitionBuilder used to construct a RootBeanDefinition.
static BeanDefinitionBuilder | rootBeanDefinition(String beanClassName) Create a new BeanDefinitionBuilder used to construct a RootBeanDefinition.
static BeanDefinitionBuilder | rootBeanDefinition(String beanClassName, String factoryMethodName) Create a new BeanDefinitionBuilder used to construct a RootBeanDefinition.
BeanDefinitionBuilder | setAbstract(boolean flag) Set whether or not this definition is abstract.
BeanDefinitionBuilder | setAutowireMode(int autowireMode) Set the autowire mode for this definition.
BeanDefinitionBuilder | setDependencyCheck(int dependencyCheck) Set the depency check mode for this definition.
BeanDefinitionBuilder | setDestroyMethodName(String methodName) Set the destroy method for this definition.
BeanDefinitionBuilder | setFactoryBean(String factoryBean, String factoryMethod) Deprecated. since Spring 2.5, in favor of preparing this on the raw BeanDefinition object
BeanDefinitionBuilder | setFactoryMethod(String factoryMethod) Set the name of the factory method to use for this definition.
BeanDefinitionBuilder | setInitMethodName(String methodName) Set the init method for this definition.
BeanDefinitionBuilder | setLazyInit(boolean lazy) Set whether beans for this definition should be lazily initialized or not.
BeanDefinitionBuilder | setParentName(String parentName) Set the name of the parent definition of this bean definition.
BeanDefinitionBuilder | setResourceDescription(String resourceDescription) Deprecated. since Spring 2.5, in favor of preparing this on the raw BeanDefinition object
BeanDefinitionBuilder | setRole(int role) Set the role of this definition.
BeanDefinitionBuilder | setScope(String scope) Set the scope of this definition.
BeanDefinitionBuilder | setSingleton(boolean singleton) Deprecated. since Spring 2.5, in favor of setScope(java.lang.String)
BeanDefinitionBuilder | setSource(Object source) Deprecated. since Spring 2.5, in favor of preparing this on the raw BeanDefinition object
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail

genericBeanDefinition

public static BeanDefinitionBuilder genericBeanDefinition()
Create a new BeanDefinitionBuilder used to construct a GenericBeanDefinition.

genericBeanDefinition

public static BeanDefinitionBuilder genericBeanDefinition(Class beanClass)
Create a new BeanDefinitionBuilder used to construct a GenericBeanDefinition.

Parameters:
beanClass - the Class of the bean that the definition is being created for

genericBeanDefinition

public static BeanDefinitionBuilder genericBeanDefinition(String beanClassName)
Create a new BeanDefinitionBuilder used to construct a GenericBeanDefinition.

Parameters:
beanClassName - the class name for the bean that the definition is being created for

rootBeanDefinition

public static BeanDefinitionBuilder rootBeanDefinition(Class beanClass)
Create a new BeanDefinitionBuilder used to construct a RootBeanDefinition.

Parameters:
beanClass - the Class of the bean that the definition is being created for

rootBeanDefinition

public static BeanDefinitionBuilder rootBeanDefinition(Class beanClass,
                                                       String factoryMethodName)
Create a new BeanDefinitionBuilder used to construct a RootBeanDefinition.

Parameters:
beanClass - the Class of the bean that the definition is being created for
factoryMethodName - the name of the method to use to construct the bean instance

rootBeanDefinition

public static BeanDefinitionBuilder rootBeanDefinition(String beanClassName)
Create a new BeanDefinitionBuilder used to construct a RootBeanDefinition.

Parameters:
beanClassName - the class name for the bean that the definition is being created for

rootBeanDefinition

public static BeanDefinitionBuilder rootBeanDefinition(String beanClassName,
                                                       String factoryMethodName)
Create a new BeanDefinitionBuilder used to construct a RootBeanDefinition.

Parameters:
beanClassName - the class name for the bean that the definition is being created for
factoryMethodName - the name of the method to use to construct the bean instance

childBeanDefinition

public static BeanDefinitionBuilder childBeanDefinition(String parentName)
Create a new BeanDefinitionBuilder used to construct a ChildBeanDefinition.

Parameters:
parentName - the name of the parent bean

getRawBeanDefinition

public AbstractBeanDefinition getRawBeanDefinition()
Return the current BeanDefinition object in its raw (unvalidated) form.

See Also:
getBeanDefinition()

getBeanDefinition

public AbstractBeanDefinition getBeanDefinition()
Validate and return the created BeanDefinition object.

setParentName

public BeanDefinitionBuilder setParentName(String parentName)
Set the name of the parent definition of this bean definition.

setFactoryMethod

public BeanDefinitionBuilder setFactoryMethod(String factoryMethod)
Set the name of the factory method to use for this definition.

setFactoryBean

@Deprecated
public BeanDefinitionBuilder setFactoryBean(String factoryBean,
                                                       String factoryMethod)
Deprecated. since Spring 2.5, in favor of preparing this on the raw BeanDefinition object

Set the name of the factory bean to use for this definition.

addConstructorArg

@Deprecated
public BeanDefinitionBuilder addConstructorArg(Object value)
Deprecated. since Spring 2.5, in favor of addConstructorArgValue(java.lang.Object)

Add an indexed constructor arg value. The current index is tracked internally and all additions are at the present point.

addConstructorArgValue

public BeanDefinitionBuilder addConstructorArgValue(Object value)
Add an indexed constructor arg value. The current index is tracked internally and all additions are at the present point.

addConstructorArgReference

public BeanDefinitionBuilder addConstructorArgReference(String beanName)
Add a reference to a named bean as a constructor arg.

See Also:
addConstructorArgValue(Object)

addPropertyValue

public BeanDefinitionBuilder addPropertyValue(String name,
                                              Object value)
Add the supplied property value under the given name.

addPropertyReference

public BeanDefinitionBuilder addPropertyReference(String name,
                                                  String beanName)
Add a reference to the specified bean name under the property specified.

Parameters:
name - the name of the property to add the reference to
beanName - the name of the bean being referenced

setInitMethodName

public BeanDefinitionBuilder setInitMethodName(String methodName)
Set the init method for this definition.

setDestroyMethodName

public BeanDefinitionBuilder setDestroyMethodName(String methodName)
Set the destroy method for this definition.

setScope

public BeanDefinitionBuilder setScope(String scope)
Set the scope of this definition.

See Also:
BeanDefinition.SCOPE_SINGLETON, BeanDefinition.SCOPE_PROTOTYPE

setSingleton

@Deprecated
public BeanDefinitionBuilder setSingleton(boolean singleton)
Deprecated. since Spring 2.5, in favor of setScope(java.lang.String)

Set whether or not this definition describes a singleton bean, as alternative to setScope(java.lang.String).

setAbstract

public BeanDefinitionBuilder setAbstract(boolean flag)
Set whether or not this definition is abstract.

setLazyInit

public BeanDefinitionBuilder setLazyInit(boolean lazy)
Set whether beans for this definition should be lazily initialized or not.

setAutowireMode

public BeanDefinitionBuilder setAutowireMode(int autowireMode)
Set the autowire mode for this definition.

setDependencyCheck

public BeanDefinitionBuilder setDependencyCheck(int dependencyCheck)
Set the depency check mode for this definition.

addDependsOn

public BeanDefinitionBuilder addDependsOn(String beanName)
Append the specified bean name to the list of beans that this definition depends on.

setRole

public BeanDefinitionBuilder setRole(int role)
Set the role of this definition.

setSource

@Deprecated
public BeanDefinitionBuilder setSource(Object source)
Deprecated. since Spring 2.5, in favor of preparing this on the raw BeanDefinition object

Set the source of this definition.

setResourceDescription

@Deprecated
public BeanDefinitionBuilder setResourceDescription(String resourceDescription)
Deprecated. since Spring 2.5, in favor of preparing this on the raw BeanDefinition object

Set the description associated with this definition.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanDefinitionDefaults

org.springframework.beans.factory.support
Class BeanDefinitionDefaults

java.lang.Object
    extended by  org.springframework.beans.factory.support.BeanDefinitionDefaults

public class BeanDefinitionDefaults
extends Object

A simple holder for BeanDefinition property defaults.

Since:
2.5
Author:
Mark Fisher

Constructor Summary
BeanDefinitionDefaults()
Method Summary
int | getAutowireMode()
int | getDependencyCheck()
String | getDestroyMethodName()
String | getInitMethodName()
boolean | isLazyInit()
void | setAutowireMode(int autowireMode)
void | setDependencyCheck(int dependencyCheck)
void | setDestroyMethodName(String destroyMethodName)
void | setInitMethodName(String initMethodName)
void | setLazyInit(boolean lazyInit)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BeanDefinitionDefaults

public BeanDefinitionDefaults()
Method Detail

setLazyInit

public void setLazyInit(boolean lazyInit)

isLazyInit

public boolean isLazyInit()

setDependencyCheck

public void setDependencyCheck(int dependencyCheck)

getDependencyCheck

public int getDependencyCheck()

setAutowireMode

public void setAutowireMode(int autowireMode)

getAutowireMode

public int getAutowireMode()

setInitMethodName

public void setInitMethodName(String initMethodName)

getInitMethodName

public String getInitMethodName()

setDestroyMethodName

public void setDestroyMethodName(String destroyMethodName)

getDestroyMethodName

public String getDestroyMethodName()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanDefinitionReaderUtils

org.springframework.beans.factory.support
Class BeanDefinitionReaderUtils

java.lang.Object
    extended by  org.springframework.beans.factory.support.BeanDefinitionReaderUtils

public class BeanDefinitionReaderUtils
extends Object

Utility methods that are useful for bean definition reader implementations. Mainly intended for internal use.

Since:
1.1
Author:
Juergen Hoeller, Rob Harrop
See Also:
PropertiesBeanDefinitionReader, DefaultBeanDefinitionDocumentReader

Field Summary
static String GENERATED_BEAN_NAME_SEPARATOR
Separator for generated bean names.
Constructor Summary
BeanDefinitionReaderUtils()
Method Summary
static AbstractBeanDefinition | createBeanDefinition(String parentName, String className, ClassLoader classLoader) Create a new GenericBeanDefinition for the given parent name and class name, eagerly loading the bean class if a ClassLoader has been specified.
static String | generateBeanName(BeanDefinition beanDefinition, BeanDefinitionRegistry registry) Generate a bean name for the given top-level bean definition, unique within the given bean factory.
static String | generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry, boolean isInnerBean) Generate a bean name for the given bean definition, unique within the given bean factory.
static void | registerBeanDefinition(BeanDefinitionHolder definitionHolder, BeanDefinitionRegistry registry) Register the given bean definition with the given bean factory.
static String | registerWithGeneratedName(AbstractBeanDefinition definition, BeanDefinitionRegistry registry) Register the given bean definition with a generated name, unique within the given bean factory.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

GENERATED_BEAN_NAME_SEPARATOR

public static final String GENERATED_BEAN_NAME_SEPARATOR
Separator for generated bean names. If a class name or parent name is not unique, "#1", "#2" etc will be appended, until the name becomes unique.

See Also:
Constant Field Values
Constructor Detail

BeanDefinitionReaderUtils

public BeanDefinitionReaderUtils()
Method Detail

createBeanDefinition

public static AbstractBeanDefinition createBeanDefinition(String parentName,
                                                          String className,
                                                          ClassLoader classLoader)
                                                   throws ClassNotFoundException
Create a new GenericBeanDefinition for the given parent name and class name, eagerly loading the bean class if a ClassLoader has been specified.

Parameters:
parentName - the name of the parent bean, if any
className - the name of the bean class, if any
classLoader - the ClassLoader to use for loading bean classes (can be null to just register bean classes by name)
Returns:
the bean definition
Throws:
ClassNotFoundException - if the bean class could not be loaded

generateBeanName

public static String generateBeanName(BeanDefinition definition,
                                      BeanDefinitionRegistry registry,
                                      boolean isInnerBean)
                               throws BeanDefinitionStoreException
Generate a bean name for the given bean definition, unique within the given bean factory.

Parameters:
definition - the bean definition to generate a bean name for
registry - the bean factory that the definition is going to be registered with (to check for existing bean names)
isInnerBean - whether the given bean definition will be registered as inner bean or as top-level bean (allowing for special name generation for inner beans versus top-level beans)
Returns:
the generated bean name
Throws:
BeanDefinitionStoreException - if no unique name can be generated for the given bean definition

generateBeanName

public static String generateBeanName(BeanDefinition beanDefinition,
                                      BeanDefinitionRegistry registry)
                               throws BeanDefinitionStoreException
Generate a bean name for the given top-level bean definition, unique within the given bean factory.

Parameters:
beanDefinition - the bean definition to generate a bean name for
registry - the bean factory that the definition is going to be registered with (to check for existing bean names)
Returns:
the generated bean name
Throws:
BeanDefinitionStoreException - if no unique name can be generated for the given bean definition

registerBeanDefinition

public static void registerBeanDefinition(BeanDefinitionHolder definitionHolder,
                                          BeanDefinitionRegistry registry)
                                   throws BeanDefinitionStoreException
Register the given bean definition with the given bean factory.

Parameters:
definitionHolder - the bean definition including name and aliases
registry - the bean factory to register with
Throws:
BeanDefinitionStoreException - if registration failed

registerWithGeneratedName

public static String registerWithGeneratedName(AbstractBeanDefinition definition,
                                               BeanDefinitionRegistry registry)
                                        throws BeanDefinitionStoreException
Register the given bean definition with a generated name, unique within the given bean factory.

Parameters:
definition - the bean definition to generate a bean name for
registry - the bean factory to register with
Returns:
the generated bean name
Throws:
BeanDefinitionStoreException - if no unique name can be generated for the given bean definition or the definition cannot be registered
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CglibSubclassingInstantiationStrategy

org.springframework.beans.factory.support
Class CglibSubclassingInstantiationStrategy

java.lang.Object
    extended by  org.springframework.beans.factory.support.SimpleInstantiationStrategy
        extended by  org.springframework.beans.factory.support.CglibSubclassingInstantiationStrategy
All Implemented Interfaces:
InstantiationStrategy
public class CglibSubclassingInstantiationStrategy
extends SimpleInstantiationStrategy

Default object instantiation strategy for use in BeanFactories. Uses CGLIB to generate subclasses dynamically if methods need to be overridden by the container, to implement Method Injection.

Using Method Injection features requires CGLIB on the classpath. However, the core IoC container will still run without CGLIB being available.

Since:
1.1
Author:
Rod Johnson, Juergen Hoeller

Constructor Summary
CglibSubclassingInstantiationStrategy()
Method Summary
protected Object | instantiateWithMethodInjection(RootBeanDefinition beanDefinition, String beanName, BeanFactory owner) Subclasses can override this method, which is implemented to throw UnsupportedOperationException, if they can instantiate an object with the Method Injection specified in the given RootBeanDefinition.
protected Object | instantiateWithMethodInjection(RootBeanDefinition beanDefinition, String beanName, BeanFactory owner, Constructor ctor, Object[] args) Subclasses can override this method, which is implemented to throw UnsupportedOperationException, if they can instantiate an object with the Method Injection specified in the given RootBeanDefinition.
Methods inherited from class org.springframework.beans.factory.support.SimpleInstantiationStrategy
instantiate, instantiate, instantiate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CglibSubclassingInstantiationStrategy

public CglibSubclassingInstantiationStrategy()
Method Detail

instantiateWithMethodInjection

protected Object instantiateWithMethodInjection(RootBeanDefinition beanDefinition,
                                                String beanName,
                                                BeanFactory owner)
Description copied from class: SimpleInstantiationStrategy
Subclasses can override this method, which is implemented to throw UnsupportedOperationException, if they can instantiate an object with the Method Injection specified in the given RootBeanDefinition. Instantiation should use a no-arg constructor.

Overrides:
instantiateWithMethodInjection in class SimpleInstantiationStrategy

instantiateWithMethodInjection

protected Object instantiateWithMethodInjection(RootBeanDefinition beanDefinition,
                                                String beanName,
                                                BeanFactory owner,
                                                Constructor ctor,
                                                Object[] args)
Description copied from class: SimpleInstantiationStrategy
Subclasses can override this method, which is implemented to throw UnsupportedOperationException, if they can instantiate an object with the Method Injection specified in the given RootBeanDefinition. Instantiation should use the given constructor and parameters.

Overrides:
instantiateWithMethodInjection in class SimpleInstantiationStrategy
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ChildBeanDefinition

org.springframework.beans.factory.support
Class ChildBeanDefinition

java.lang.Object
    extended by  org.springframework.core.AttributeAccessorSupport
        extended by  org.springframework.beans.BeanMetadataAttributeAccessor
            extended by  org.springframework.beans.factory.support.AbstractBeanDefinition
                extended by  org.springframework.beans.factory.support.ChildBeanDefinition
All Implemented Interfaces:
Serializable, Cloneable, BeanMetadataElement, BeanDefinition, AttributeAccessor
public class ChildBeanDefinition
extends AbstractBeanDefinition

Bean definition for beans which inherit settings from their parent. Child bean definitions have a fixed dependency on a parent bean definition.

A child bean definition will inherit constructor argument values, property values and method overrides from the parent, with the option to add new values. If init method, destroy method and/or static factory method are specified, they will override the corresponding parent settings. The remaining settings will always be taken from the child definition: depends on, autowire mode, dependency check, singleton, lazy init.

NOTE: Since Spring 2.5, the preferred way to register bean definitions programmatically is the GenericBeanDefinition class, which allows to dynamically define parent dependencies through the GenericBeanDefinition.setParentName(java.lang.String) method. This effectively supersedes the ChildBeanDefinition class for most use cases.

Author:
Rod Johnson, Juergen Hoeller
See Also:
GenericBeanDefinition, RootBeanDefinition, Serialized Form

Field Summary
Fields inherited from class org.springframework.beans.factory.support.AbstractBeanDefinition
AUTOWIRE_AUTODETECT, AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_CONSTRUCTOR, AUTOWIRE_NO, DEPENDENCY_CHECK_ALL, DEPENDENCY_CHECK_NONE, DEPENDENCY_CHECK_OBJECTS, DEPENDENCY_CHECK_SIMPLE, SCOPE_DEFAULT
Fields inherited from interface org.springframework.beans.factory.config.BeanDefinition
ROLE_APPLICATION, ROLE_INFRASTRUCTURE, ROLE_SUPPORT, SCOPE_PROTOTYPE, SCOPE_SINGLETON
Constructor Summary
ChildBeanDefinition(ChildBeanDefinition original)
Create a new ChildBeanDefinition as deep copy of the given bean definition.
ChildBeanDefinition(String parentName)
Create a new ChildBeanDefinition for the given parent, to be configured through its bean properties and configuration methods.
ChildBeanDefinition(String parentName, Class beanClass, ConstructorArgumentValues cargs, MutablePropertyValues pvs)
Create a new ChildBeanDefinition for the given parent, providing constructor arguments and property values.
ChildBeanDefinition(String parentName, ConstructorArgumentValues cargs, MutablePropertyValues pvs)
Create a new ChildBeanDefinition for the given parent.
ChildBeanDefinition(String parentName, MutablePropertyValues pvs)
Create a new ChildBeanDefinition for the given parent.
ChildBeanDefinition(String parentName, String beanClassName, ConstructorArgumentValues cargs, MutablePropertyValues pvs)
Create a new ChildBeanDefinition for the given parent, providing constructor arguments and property values.
Method Summary
AbstractBeanDefinition | cloneBeanDefinition() Clone this bean definition.
boolean | equals(Object other)
String | getParentName() Return the name of the parent definition of this bean definition, if any.
int | hashCode()
void | setParentName(String parentName) Set the name of the parent definition of this bean definition, if any.
String | toString()
void | validate() Validate this bean definition.
Methods inherited from class org.springframework.beans.factory.support.AbstractBeanDefinition
addQualifier, applyDefaults, clone, copyQualifiersFrom, getAutowireMode, getBeanClass, getBeanClassName, getConstructorArgumentValues, getDependencyCheck, getDependsOn, getDescription, getDestroyMethodName, getFactoryBeanName, getFactoryMethodName, getInitMethodName, getMethodOverrides, getOriginatingBeanDefinition, getPropertyValues, getQualifier, getQualifiers, getResolvedAutowireMode, getResource, getResourceDescription, getRole, getScope, hasBeanClass, hasConstructorArgumentValues, hasQualifier, isAbstract, isAutowireCandidate, isEnforceDestroyMethod, isEnforceInitMethod, isLazyInit, isLenientConstructorResolution, isNonPublicAccessAllowed, isPrimary, isPrototype, isSingleton, isSynthetic, overrideFrom, overrideFrom, prepareMethodOverride, prepareMethodOverrides, resolveBeanClass, setAbstract, setAutowireCandidate, setAutowireMode, setBeanClass, setBeanClassName, setConstructorArgumentValues, setDependencyCheck, setDependsOn, setDescription, setDestroyMethodName, setEnforceDestroyMethod, setEnforceInitMethod, setFactoryBeanName, setFactoryMethodName, setInitMethodName, setLazyInit, setLenientConstructorResolution, setMethodOverrides, setNonPublicAccessAllowed, setOriginatingBeanDefinition, setPrimary, setPropertyValues, setResource, setResourceDescription, setRole, setScope, setSingleton, setSynthetic
Methods inherited from class org.springframework.beans.BeanMetadataAttributeAccessor
addMetadataAttribute, getAttribute, getMetadataAttribute, getSource, removeAttribute, setAttribute, setSource
Methods inherited from class org.springframework.core.AttributeAccessorSupport
attributeNames, copyAttributesFrom, hasAttribute
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.core.AttributeAccessor
attributeNames, getAttribute, hasAttribute, removeAttribute, setAttribute
Methods inherited from interface org.springframework.beans.BeanMetadataElement
getSource

Constructor Detail

ChildBeanDefinition

public ChildBeanDefinition(String parentName)
Create a new ChildBeanDefinition for the given parent, to be configured through its bean properties and configuration methods.

Parameters:
parentName - the name of the parent bean
See Also:
AbstractBeanDefinition.setBeanClass(java.lang.Class),
AbstractBeanDefinition.setBeanClassName(java.lang.String),
AbstractBeanDefinition.setScope(java.lang.String),
AbstractBeanDefinition.setAutowireMode(int),
AbstractBeanDefinition.setDependencyCheck(int),
AbstractBeanDefinition.setConstructorArgumentValues(org.springframework.beans.factory.config.ConstructorArgumentValues),
AbstractBeanDefinition.setPropertyValues(org.springframework.beans.MutablePropertyValues)

ChildBeanDefinition

public ChildBeanDefinition(String parentName,
                           MutablePropertyValues pvs)
Create a new ChildBeanDefinition for the given parent.

Parameters:
parentName - the name of the parent bean
pvs - the additional property values of the child

ChildBeanDefinition

public ChildBeanDefinition(String parentName,
                           ConstructorArgumentValues cargs,
                           MutablePropertyValues pvs)
Create a new ChildBeanDefinition for the given parent.

Parameters:
parentName - the name of the parent bean
cargs - the constructor argument values to apply
pvs - the additional property values of the child

ChildBeanDefinition

public ChildBeanDefinition(String parentName,
                           Class beanClass,
                           ConstructorArgumentValues cargs,
                           MutablePropertyValues pvs)
Create a new ChildBeanDefinition for the given parent, providing constructor arguments and property values.

Parameters:
parentName - the name of the parent bean
beanClass - the class of the bean to instantiate
cargs - the constructor argument values to apply
pvs - the property values to apply

ChildBeanDefinition

public ChildBeanDefinition(String parentName,
                           String beanClassName,
                           ConstructorArgumentValues cargs,
                           MutablePropertyValues pvs)
Create a new ChildBeanDefinition for the given parent, providing constructor arguments and property values. Takes a bean class name to avoid eager loading of the bean class.

Parameters:
parentName - the name of the parent bean
beanClassName - the name of the class to instantiate
cargs - the constructor argument values to apply
pvs - the property values to apply

ChildBeanDefinition

public ChildBeanDefinition(ChildBeanDefinition original)
Create a new ChildBeanDefinition as deep copy of the given bean definition.

Parameters:
original - the original bean definition to copy from
Method Detail

setParentName

public void setParentName(String parentName)
Description copied from interface: BeanDefinition
Set the name of the parent definition of this bean definition, if any.

getParentName

public String getParentName()
Description copied from interface: BeanDefinition
Return the name of the parent definition of this bean definition, if any.

validate

public void validate()
              throws BeanDefinitionValidationException
Description copied from class: AbstractBeanDefinition
Validate this bean definition.

Overrides:
validate in class AbstractBeanDefinition
Throws:
BeanDefinitionValidationException - in case of validation failure

cloneBeanDefinition

public AbstractBeanDefinition cloneBeanDefinition()
Description copied from class: AbstractBeanDefinition
Clone this bean definition. To be implemented by concrete subclasses.

Specified by:
cloneBeanDefinition in class AbstractBeanDefinition
Returns:
the cloned bean definition object

equals

public boolean equals(Object other)
Overrides:
equals in class AbstractBeanDefinition

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractBeanDefinition

toString

public String toString()
Overrides:
toString in class AbstractBeanDefinition
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultBeanNameGenerator

org.springframework.beans.factory.support
Class DefaultBeanNameGenerator

java.lang.Object
    extended by  org.springframework.beans.factory.support.DefaultBeanNameGenerator
All Implemented Interfaces:
BeanNameGenerator
public class DefaultBeanNameGenerator
extends Object
implements BeanNameGenerator

Default implementation of the BeanNameGenerator interface, delegating to BeanDefinitionReaderUtils.generateBeanName(BeanDefinition, BeanDefinitionRegistry).

Since:
2.0.3
Author:
Juergen Hoeller

Constructor Summary
DefaultBeanNameGenerator()
Method Summary
 String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry)
Generate a bean name for the given bean definition.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DefaultBeanNameGenerator

public DefaultBeanNameGenerator()
Method Detail

generateBeanName

public String generateBeanName(BeanDefinition definition,
                               BeanDefinitionRegistry registry)
Description copied from interface: BeanNameGenerator
Generate a bean name for the given bean definition.

Specified by:
generateBeanName in interface BeanNameGenerator
Parameters:
definition - the bean definition to generate a name for
registry - the bean definition registry that the given definition is supposed to be registered with
Returns:
the generated bean name
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultListableBeanFactory

org.springframework.beans.factory.support
Class DefaultListableBeanFactory

java.lang.Object
    extended by  org.springframework.core.SimpleAliasRegistry
        extended by  org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
            extended by  org.springframework.beans.factory.support.FactoryBeanRegistrySupport
                extended by  org.springframework.beans.factory.support.AbstractBeanFactory
                    extended by  org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
                        extended by  org.springframework.beans.factory.support.DefaultListableBeanFactory
All Implemented Interfaces:
Serializable, BeanFactory, AutowireCapableBeanFactory, ConfigurableBeanFactory, ConfigurableListableBeanFactory, SingletonBeanRegistry, HierarchicalBeanFactory, ListableBeanFactory, BeanDefinitionRegistry, AliasRegistry
Direct Known Subclasses:
XmlBeanFactory
public class DefaultListableBeanFactory
extends AbstractAutowireCapableBeanFactory
implements ConfigurableListableBeanFactory, BeanDefinitionRegistry, Serializable

Default implementation of the ListableBeanFactory and BeanDefinitionRegistry interfaces: a full-fledged bean factory based on bean definition objects.

Typical usage is registering all bean definitions first (possibly read from a bean definition file), before accessing beans. Bean definition lookup is therefore an inexpensive operation in a local bean definition table, operating on pre-built bean definition metadata objects.

Can be used as a standalone bean factory, or as a superclass for custom bean factories. Note that readers for specific bean definition formats are typically implemented separately rather than as bean factory subclasses: see for example PropertiesBeanDefinitionReader and XmlBeanDefinitionReader.

For an alternative implementation of the ListableBeanFactory interface, have a look at StaticListableBeanFactory, which manages existing bean instances rather than creating new ones based on bean definitions.

Since:
16 April 2001
Author:
Rod Johnson, Juergen Hoeller, Sam Brannen, Costin Leau
See Also:
StaticListableBeanFactory, PropertiesBeanDefinitionReader, XmlBeanDefinitionReader, Serialized Form

Field Summary
Fields inherited from class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
logger, NULL_OBJECT
Fields inherited from interface org.springframework.beans.factory.config.AutowireCapableBeanFactory
AUTOWIRE_AUTODETECT, AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_CONSTRUCTOR, AUTOWIRE_NO
Fields inherited from interface org.springframework.beans.factory.config.ConfigurableBeanFactory
SCOPE_PROTOTYPE, SCOPE_SINGLETON
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Constructor Summary
DefaultListableBeanFactory()
Create a new DefaultListableBeanFactory.
DefaultListableBeanFactory(BeanFactory parentBeanFactory)
Create a new DefaultListableBeanFactory with the given parent.
Method Summary
protected  boolean allowAliasOverriding()
Only allows alias overriding if bean definition overriding is allowed.
 boolean containsBeanDefinition(String beanName)
Check if this bean factory contains a bean definition with the given name.
 void copyConfigurationFrom(ConfigurableBeanFactory otherFactory)
Copy all relevant configuration from the given other factory.
protected  String determinePrimaryCandidate(Map<String,Object> candidateBeans, DependencyDescriptor descriptor)
Determine the primary autowire candidate in the given set of beans.
protected  Object doResolveDependency(DependencyDescriptor descriptor, Class<?> type, String beanName, Set<String> autowiredBeanNames, TypeConverter typeConverter)
<A extends Annotation>
A
findAnnotationOnBean(String beanName, Class<A> annotationType)
Find a Annotation of annotationType on the specified bean, traversing its interfaces and super classes if no annotation can be found on the given class itself, as well as checking its raw bean class if not found on the exposed bean reference (e.g.
protected  Map<String,Object> findAutowireCandidates(String beanName, Class requiredType, DependencyDescriptor descriptor)
Find bean instances that match the required type.
 void freezeConfiguration()
Freeze all bean definitions, signalling that the registered bean definitions will not be modified or post-processed any further.
 AutowireCandidateResolver getAutowireCandidateResolver()
Return the autowire candidate resolver for this BeanFactory (never null).
<T> T
getBean(Class<T> requiredType)
Return the bean instance that uniquely matches the given object type, if any.
 BeanDefinition getBeanDefinition(String beanName)
Return the bean definition for the given bean name.
 int getBeanDefinitionCount()
Return the number of beans defined in the factory.
 String[] getBeanDefinitionNames()
Return the names of all beans defined in this factory.
 String[] getBeanNamesForType(Class type)
Return the names of beans matching the given type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.
 String[] getBeanNamesForType(Class type, boolean includeNonSingletons, boolean allowEagerInit)
Return the names of beans matching the given type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.
<T> Map<String,T>
getBeansOfType(Class<T> type)
Return the bean instances that match the given object type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.
<T> Map<String,T>
getBeansOfType(Class<T> type, boolean includeNonSingletons, boolean allowEagerInit)
Return the bean instances that match the given object type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.
 Map<String,Object> getBeansWithAnnotation(Class<? extends Annotation> annotationType)
Find all beans whose Class has the supplied Annotation type.
 boolean isAutowireCandidate(String beanName, DependencyDescriptor descriptor)
Determine whether the specified bean qualifies as an autowire candidate, to be injected into other beans which declare a dependency of matching type.
protected  boolean isAutowireCandidate(String beanName, RootBeanDefinition mbd, DependencyDescriptor descriptor)
Determine whether the specified bean definition qualifies as an autowire candidate, to be injected into other beans which declare a dependency of matching type.
protected  boolean isBeanEligibleForMetadataCaching(String beanName)
Considers all beans as eligible for metdata caching if the factory's configuration has been marked as frozen.
 boolean isConfigurationFrozen()
Return whether this factory's bean definitions are frozen, i.e.
protected  boolean isPrimary(String beanName, Object beanInstance)
Return whether the bean definition for the given bean name has been marked as a primary bean.
protected  boolean matchesBeanName(String beanName, String candidateName)
Determine whether the given candidate name matches the bean name or the aliases stored in this bean definition.
 void preInstantiateSingletons()
Ensure that all non-lazy-init singletons are instantiated, also considering FactoryBeans.
 void registerBeanDefinition(String beanName, BeanDefinition beanDefinition)
Register a new bean definition with this registry.
 void registerResolvableDependency(Class dependencyType, Object autowiredValue)
Register a special dependency type with corresponding autowired value.
 void removeBeanDefinition(String beanName)
Remove the BeanDefinition for the given name.
protected  void resetBeanDefinition(String beanName)
Reset all bean definition caches for the given bean, including the caches of beans that are derived from it.
 Object resolveDependency(DependencyDescriptor descriptor, String beanName, Set<String> autowiredBeanNames, TypeConverter typeConverter)
Resolve the specified dependency against the beans defined in this factory.
 void setAllowBeanDefinitionOverriding(boolean allowBeanDefinitionOverriding)
Set whether it should be allowed to override bean definitions by registering a different definition with the same name, automatically replacing the former.
 void setAllowEagerClassLoading(boolean allowEagerClassLoading)
Set whether the factory is allowed to eagerly load bean classes even for bean definitions that are marked as "lazy-init".
 void setAutowireCandidateResolver(AutowireCandidateResolver autowireCandidateResolver)
Set a custom autowire candidate resolver for this BeanFactory to use when deciding whether a bean definition should be considered as a candidate for autowiring.
 void setSerializationId(String serializationId)
Specify an id for serialization purposes, allowing this BeanFactory to be deserialized from this id back into the BeanFactory object, if needed.
 String toString()
protected  Object writeReplace()
Methods inherited from class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
applyBeanPostProcessorsAfterInitialization, applyBeanPostProcessorsBeforeInitialization, applyBeanPostProcessorsBeforeInstantiation, applyBeanPropertyValues, applyMergedBeanDefinitionPostProcessors, applyPropertyValues, autowire, autowireBean, autowireBeanProperties, autowireByName, autowireByType, autowireConstructor, checkDependencies, configureBean, createBean, createBean, createBean, createBeanInstance, determineConstructorsFromBeanPostProcessors, doCreateBean, filterPropertyDescriptorsForDependencyCheck, getEarlyBeanReference, getInstantiationStrategy, getParameterNameDiscoverer, getTypeForFactoryBean, getTypeForFactoryMethod, ignoreDependencyInterface, ignoreDependencyType, initializeBean, initializeBean, instantiateBean, instantiateUsingFactoryMethod, invokeCustomInitMethod, invokeInitMethods, isExcludedFromDependencyCheck, populateBean, postProcessObjectFromFactoryBean, predictBeanType, removeSingleton, resolveBeforeInstantiation, resolveDependency, setAllowCircularReferences, setAllowRawInjectionDespiteWrapping, setInstantiationStrategy, setParameterNameDiscoverer, unsatisfiedNonSimpleProperties
Methods inherited from class org.springframework.beans.factory.support.AbstractBeanFactory
addBeanPostProcessor, addEmbeddedValueResolver, addPropertyEditorRegistrar, afterPrototypeCreation, beforePrototypeCreation, checkMergedBeanDefinition, clearMergedBeanDefinition, containsBean, containsLocalBean, copyRegisteredEditorsTo, destroyBean, destroyBean, destroyScopedBean, doGetBean, evaluateBeanDefinitionString, getAccessControlContext, getAliases, getBean, getBean, getBean, getBean, getBeanClassLoader, getBeanExpressionResolver, getBeanPostProcessorCount, getBeanPostProcessors, getConversionService, getCustomEditors, getCustomTypeConverter, getMergedBeanDefinition, getMergedBeanDefinition, getMergedBeanDefinition, getMergedLocalBeanDefinition, getObjectForBeanInstance, getParentBeanFactory, getPropertyEditorRegistrars, getRegisteredScope, getRegisteredScopeNames, getTempClassLoader, getType, getTypeConverter, hasDestructionAwareBeanPostProcessors, hasInstantiationAwareBeanPostProcessors, initBeanWrapper, isBeanNameInUse, isCacheBeanMetadata, isCurrentlyInCreation, isFactoryBean, isFactoryBean, isPrototype, isPrototypeCurrentlyInCreation, isSingleton, isTypeMatch, markBeanAsCreated, originalBeanName, registerCustomEditor, registerCustomEditors, registerDisposableBeanIfNecessary, registerScope, removeSingletonIfCreatedForTypeCheckOnly, requiresDestruction, resolveBeanClass, resolveEmbeddedValue, setBeanClassLoader, setBeanExpressionResolver, setCacheBeanMetadata, setConversionService, setParentBeanFactory, setSecurityContextProvider, setTempClassLoader, setTypeConverter, transformedBeanName
Methods inherited from class org.springframework.beans.factory.support.FactoryBeanRegistrySupport
getCachedObjectForFactoryBean, getFactoryBean, getObjectFromFactoryBean, getTypeForFactoryBean
Methods inherited from class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
addSingleton, addSingletonFactory, afterSingletonCreation, beforeSingletonCreation, containsSingleton, destroyBean, destroySingleton, destroySingletons, getDependenciesForBean, getDependentBeans, getSingleton, getSingleton, getSingleton, getSingletonCount, getSingletonMutex, getSingletonNames, hasDependentBean, isSingletonCurrentlyInCreation, onSuppressedException, registerContainedBean, registerDependentBean, registerDisposableBean, registerSingleton
Methods inherited from class org.springframework.core.SimpleAliasRegistry
canonicalName, isAlias, registerAlias, removeAlias, resolveAliases
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.config.ConfigurableListableBeanFactory
ignoreDependencyInterface, ignoreDependencyType
Methods inherited from interface org.springframework.beans.factory.config.AutowireCapableBeanFactory
applyBeanPostProcessorsAfterInitialization, applyBeanPostProcessorsBeforeInitialization, applyBeanPropertyValues, autowire, autowireBean, autowireBeanProperties, configureBean, createBean, createBean, initializeBean, resolveDependency
Methods inherited from interface org.springframework.beans.factory.config.ConfigurableBeanFactory
addBeanPostProcessor, addEmbeddedValueResolver, addPropertyEditorRegistrar, copyRegisteredEditorsTo, destroyBean, destroyScopedBean, destroySingletons, getAccessControlContext, getBeanClassLoader, getBeanExpressionResolver, getBeanPostProcessorCount, getConversionService, getDependenciesForBean, getDependentBeans, getMergedBeanDefinition, getRegisteredScope, getRegisteredScopeNames, getTempClassLoader, getTypeConverter, isCacheBeanMetadata, isCurrentlyInCreation, isFactoryBean, registerAlias, registerCustomEditor, registerDependentBean, registerScope, resolveAliases, resolveEmbeddedValue, setBeanClassLoader, setBeanExpressionResolver, setCacheBeanMetadata, setConversionService, setParentBeanFactory, setTempClassLoader, setTypeConverter
Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory
containsLocalBean, getParentBeanFactory
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getBean, getType, isPrototype, isSingleton, isTypeMatch
Methods inherited from interface org.springframework.beans.factory.config.SingletonBeanRegistry
containsSingleton, getSingleton, getSingletonCount, getSingletonNames, registerSingleton
Methods inherited from interface org.springframework.beans.factory.support.BeanDefinitionRegistry
isBeanNameInUse
Methods inherited from interface org.springframework.core.AliasRegistry
getAliases, isAlias, registerAlias, removeAlias

Constructor Detail

DefaultListableBeanFactory

public DefaultListableBeanFactory()
Create a new DefaultListableBeanFactory.

DefaultListableBeanFactory

public DefaultListableBeanFactory(BeanFactory parentBeanFactory)
Create a new DefaultListableBeanFactory with the given parent.

Parameters:
parentBeanFactory - the parent BeanFactory
Method Detail

setSerializationId

public void setSerializationId(String serializationId)
Specify an id for serialization purposes, allowing this BeanFactory to be deserialized from this id back into the BeanFactory object, if needed.

setAllowBeanDefinitionOverriding

public void setAllowBeanDefinitionOverriding(boolean allowBeanDefinitionOverriding)
Set whether it should be allowed to override bean definitions by registering a different definition with the same name, automatically replacing the former. If not, an exception will be thrown. This also applies to overriding aliases.

Default is "true".

See Also:
registerBeanDefinition(java.lang.String, org.springframework.beans.factory.config.BeanDefinition)

setAllowEagerClassLoading

public void setAllowEagerClassLoading(boolean allowEagerClassLoading)
Set whether the factory is allowed to eagerly load bean classes even for bean definitions that are marked as "lazy-init".

Default is "true". Turn this flag off to suppress class loading for lazy-init beans unless such a bean is explicitly requested. In particular, by-type lookups will then simply ignore bean definitions without resolved class name, instead of loading the bean classes on demand just to perform a type check.

See Also:
AbstractBeanDefinition.setLazyInit(boolean)

setAutowireCandidateResolver

public void setAutowireCandidateResolver(AutowireCandidateResolver autowireCandidateResolver)
Set a custom autowire candidate resolver for this BeanFactory to use when deciding whether a bean definition should be considered as a candidate for autowiring.

getAutowireCandidateResolver

public AutowireCandidateResolver getAutowireCandidateResolver()
Return the autowire candidate resolver for this BeanFactory (never null).

copyConfigurationFrom

public void copyConfigurationFrom(ConfigurableBeanFactory otherFactory)
Description copied from interface: ConfigurableBeanFactory
Copy all relevant configuration from the given other factory.

Should include all standard configuration settings as well as BeanPostProcessors, Scopes, and factory-specific internal settings. Should not include any metadata of actual bean definitions, such as BeanDefinition objects and bean name aliases.

Specified by:
copyConfigurationFrom in interface ConfigurableBeanFactory
Overrides:
copyConfigurationFrom in class AbstractAutowireCapableBeanFactory
Parameters:
otherFactory - the other BeanFactory to copy from

getBean

public <T> T getBean(Class<T> requiredType)
          throws BeansException
Description copied from interface: BeanFactory
Return the bean instance that uniquely matches the given object type, if any.

Specified by:
getBean in interface BeanFactory
Parameters:
requiredType - type the bean must match; can be an interface or superclass. null is disallowed.

This method goes into ListableBeanFactory by-type lookup territory but may also be translated into a conventional by-name lookup based on the name of the given type. For more extensive retrieval operations across sets of beans, use ListableBeanFactory and/or BeanFactoryUtils.

Returns:
an instance of the single bean matching the required type
Throws:
NoSuchBeanDefinitionException - if there is not exactly one matching bean found
BeansException
See Also:
ListableBeanFactory

containsBeanDefinition

public boolean containsBeanDefinition(String beanName)
Description copied from class: AbstractBeanFactory
Check if this bean factory contains a bean definition with the given name. Does not consider any hierarchy this factory may participate in. Invoked by containsBean when no cached singleton instance is found.

Depending on the nature of the concrete bean factory implementation, this operation might be expensive (for example, because of directory lookups in external registries). However, for listable bean factories, this usually just amounts to a local hash lookup: The operation is therefore part of the public interface there. The same implementation can serve for both this template method and the public interface method in that case.

Specified by:
containsBeanDefinition in interface ListableBeanFactory
Specified by:
containsBeanDefinition in interface BeanDefinitionRegistry
Specified by:
containsBeanDefinition in class AbstractBeanFactory
Parameters:
beanName - the name of the bean to look for
Returns:
if this bean factory contains a bean definition with the given name
See Also:
AbstractBeanFactory.containsBean(java.lang.String), ListableBeanFactory.containsBeanDefinition(java.lang.String)

getBeanDefinitionCount

public int getBeanDefinitionCount()
Description copied from interface: ListableBeanFactory
Return the number of beans defined in the factory.

Does not consider any hierarchy this factory may participate in, and ignores any singleton beans that have been registered by other means than bean definitions.

Specified by:
getBeanDefinitionCount in interface ListableBeanFactory
Specified by:
getBeanDefinitionCount in interface BeanDefinitionRegistry
Returns:
the number of beans defined in the factory

getBeanDefinitionNames

public String[] getBeanDefinitionNames()
Description copied from interface: ListableBeanFactory
Return the names of all beans defined in this factory.

Does not consider any hierarchy this factory may participate in, and ignores any singleton beans that have been registered by other means than bean definitions.

Specified by:
getBeanDefinitionNames in interface ListableBeanFactory
Specified by:
getBeanDefinitionNames in interface BeanDefinitionRegistry
Returns:
the names of all beans defined in this factory, or an empty array if none defined

getBeanNamesForType

public String[] getBeanNamesForType(Class type)
Description copied from interface: ListableBeanFactory
Return the names of beans matching the given type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.

NOTE: This method introspects top-level beans only. It does not check nested beans which might match the specified type as well.

Does consider objects created by FactoryBeans, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type.

Does not consider any hierarchy this factory may participate in. Use BeanFactoryUtils' beanNamesForTypeIncludingAncestors to include beans in ancestor factories too.

Note: Does not ignore singleton beans that have been registered by other means than bean definitions.

This version of getBeanNamesForType matches all kinds of beans, be it singletons, prototypes, or FactoryBeans. In most implementations, the result will be the same as for getBeanNamesOfType(type, true, true).

Bean names returned by this method should always return bean names in the order of definition in the backend configuration, as far as possible.

Specified by:
getBeanNamesForType in interface ListableBeanFactory
Parameters:
type - the class or interface to match, or null for all bean names
Returns:
the names of beans (or objects created by FactoryBeans) matching the given object type (including subclasses), or an empty array if none
See Also:
FactoryBean.getObjectType(), BeanFactoryUtils.beanNamesForTypeIncludingAncestors(ListableBeanFactory, Class)

getBeanNamesForType

public String[] getBeanNamesForType(Class type,
                                    boolean includeNonSingletons,
                                    boolean allowEagerInit)
Description copied from interface: ListableBeanFactory
Return the names of beans matching the given type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.

NOTE: This method introspects top-level beans only. It does not check nested beans which might match the specified type as well.

Does consider objects created by FactoryBeans if the "allowEagerInit" flag is set, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type. If "allowEagerInit" is not set, only raw FactoryBeans will be checked (which doesn't require initialization of each FactoryBean). $ *

Does not consider any hierarchy this factory may participate in. Use BeanFactoryUtils' beanNamesForTypeIncludingAncestors to include beans in ancestor factories too.

Note: Does not ignore singleton beans that have been registered by other means than bean definitions.

Bean names returned by this method should always return bean names in the order of definition in the backend configuration, as far as possible.

Specified by:
getBeanNamesForType in interface ListableBeanFactory
Parameters:
type - the class or interface to match, or null for all bean names
includeNonSingletons - whether to include prototype or scoped beans too or just singletons (also applies to FactoryBeans)
allowEagerInit - whether to initialize lazy-init singletons and objects created by FactoryBeans (or by factory methods with a "factory-bean" reference) for the type check. Note that FactoryBeans need to be eagerly initialized to determine their type: So be aware that passing in "true" for this flag will initialize FactoryBeans and "factory-bean" references.
Returns:
the names of beans (or objects created by FactoryBeans) matching the given object type (including subclasses), or an empty array if none
See Also:
FactoryBean.getObjectType(), BeanFactoryUtils.beanNamesForTypeIncludingAncestors(ListableBeanFactory, Class, boolean, boolean)

getBeansOfType

public <T> Map<String,T> getBeansOfType(Class<T> type)
                             throws BeansException
Description copied from interface: ListableBeanFactory
Return the bean instances that match the given object type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.

NOTE: This method introspects top-level beans only. It does not check nested beans which might match the specified type as well.

Does consider objects created by FactoryBeans, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type.

Does not consider any hierarchy this factory may participate in. Use BeanFactoryUtils' beansOfTypeIncludingAncestors to include beans in ancestor factories too.

Note: Does not ignore singleton beans that have been registered by other means than bean definitions.

This version of getBeansOfType matches all kinds of beans, be it singletons, prototypes, or FactoryBeans. In most implementations, the result will be the same as for getBeansOfType(type, true, true).

The Map returned by this method should always return bean names and corresponding bean instances in the order of definition in the backend configuration, as far as possible.

Specified by:
getBeansOfType in interface ListableBeanFactory
Parameters:
type - the class or interface to match, or null for all concrete beans
Returns:
a Map with the matching beans, containing the bean names as keys and the corresponding bean instances as values
Throws:
BeansException - if a bean could not be created
See Also:
FactoryBean.getObjectType(), BeanFactoryUtils.beansOfTypeIncludingAncestors(ListableBeanFactory, Class)

getBeansOfType

public <T> Map<String,T> getBeansOfType(Class<T> type,
                                        boolean includeNonSingletons,
                                        boolean allowEagerInit)
                             throws BeansException
Description copied from interface: ListableBeanFactory
Return the bean instances that match the given object type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.

NOTE: This method introspects top-level beans only. It does not check nested beans which might match the specified type as well.

Does consider objects created by FactoryBeans if the "allowEagerInit" flag is set, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type. If "allowEagerInit" is not set, only raw FactoryBeans will be checked (which doesn't require initialization of each FactoryBean).

Does not consider any hierarchy this factory may participate in. Use BeanFactoryUtils' beansOfTypeIncludingAncestors to include beans in ancestor factories too.

Note: Does not ignore singleton beans that have been registered by other means than bean definitions.

The Map returned by this method should always return bean names and corresponding bean instances in the order of definition in the backend configuration, as far as possible.

Specified by:
getBeansOfType in interface ListableBeanFactory
Parameters:
type - the class or interface to match, or null for all concrete beans
includeNonSingletons - whether to include prototype or scoped beans too or just singletons (also applies to FactoryBeans)
allowEagerInit - whether to initialize lazy-init singletons and objects created by FactoryBeans (or by factory methods with a "factory-bean" reference) for the type check. Note that FactoryBeans need to be eagerly initialized to determine their type: So be aware that passing in "true" for this flag will initialize FactoryBeans and "factory-bean" references.
Returns:
a Map with the matching beans, containing the bean names as keys and the corresponding bean instances as values
Throws:
BeansException - if a bean could not be created
See Also:
FactoryBean.getObjectType(), BeanFactoryUtils.beansOfTypeIncludingAncestors(ListableBeanFactory, Class, boolean, boolean)

getBeansWithAnnotation

public Map<String,Object> getBeansWithAnnotation(Class<? extends Annotation> annotationType)
Description copied from interface: ListableBeanFactory
Find all beans whose Class has the supplied Annotation type.

Specified by:
getBeansWithAnnotation in interface ListableBeanFactory
Parameters:
annotationType - the type of annotation to look for
Returns:
a Map with the matching beans, containing the bean names as keys and the corresponding bean instances as values

findAnnotationOnBean

public <A extends Annotation> A findAnnotationOnBean(String beanName,
                                                     Class<A> annotationType)
Find a Annotation of annotationType on the specified bean, traversing its interfaces and super classes if no annotation can be found on the given class itself, as well as checking its raw bean class if not found on the exposed bean reference (e.g. in case of a proxy).

Specified by:
findAnnotationOnBean in interface ListableBeanFactory
Parameters:
beanName - the name of the bean to look for annotations on
annotationType - the annotation class to look for
Returns:
the annotation of the given type found, or null

registerResolvableDependency

public void registerResolvableDependency(Class dependencyType,
                                         Object autowiredValue)
Description copied from interface: ConfigurableListableBeanFactory
Register a special dependency type with corresponding autowired value.

This is intended for factory/context references that are supposed to be autowirable but are not defined as beans in the factory: e.g. a dependency of type ApplicationContext resolved to the ApplicationContext instance that the bean is living in.

Note: There are no such default types registered in a plain BeanFactory, not even for the BeanFactory interface itself.

Specified by:
registerResolvableDependency in interface ConfigurableListableBeanFactory
Parameters:
dependencyType - the dependency type to register. This will typically be a base interface such as BeanFactory, with extensions of it resolved as well if declared as an autowiring dependency (e.g. ListableBeanFactory), as long as the given value actually implements the extended interface.
autowiredValue - the corresponding autowired value. This may also be an implementation of the ObjectFactory interface, which allows for lazy resolution of the actual target value.

isAutowireCandidate

public boolean isAutowireCandidate(String beanName,
                                   DependencyDescriptor descriptor)
                            throws NoSuchBeanDefinitionException
Description copied from interface: ConfigurableListableBeanFactory
Determine whether the specified bean qualifies as an autowire candidate, to be injected into other beans which declare a dependency of matching type.

This method checks ancestor factories as well.

Specified by:
isAutowireCandidate in interface ConfigurableListableBeanFactory
Parameters:
beanName - the name of the bean to check
descriptor - the descriptor of the dependency to resolve
Returns:
whether the bean should be considered as autowire candidate
Throws:
NoSuchBeanDefinitionException - if there is no bean with the given name

isAutowireCandidate

protected boolean isAutowireCandidate(String beanName,
                                      RootBeanDefinition mbd,
                                      DependencyDescriptor descriptor)
Determine whether the specified bean definition qualifies as an autowire candidate, to be injected into other beans which declare a dependency of matching type.

Parameters:
beanName - the name of the bean definition to check
mbd - the merged bean definition to check
descriptor - the descriptor of the dependency to resolve
Returns:
whether the bean should be considered as autowire candidate

getBeanDefinition

public BeanDefinition getBeanDefinition(String beanName)
                                 throws NoSuchBeanDefinitionException
Description copied from class: AbstractBeanFactory
Return the bean definition for the given bean name. Subclasses should normally implement caching, as this method is invoked by this class every time bean definition metadata is needed.

Depending on the nature of the concrete bean factory implementation, this operation might be expensive (for example, because of directory lookups in external registries). However, for listable bean factories, this usually just amounts to a local hash lookup: The operation is therefore part of the public interface there. The same implementation can serve for both this template method and the public interface method in that case.

Specified by:
getBeanDefinition in interface ConfigurableListableBeanFactory
Specified by:
getBeanDefinition in interface BeanDefinitionRegistry
Specified by:
getBeanDefinition in class AbstractBeanFactory
Parameters:
beanName - the name of the bean to find a definition for
Returns:
the BeanDefinition for this prototype name (never null)
Throws:
NoSuchBeanDefinitionException - if there is no bean with the given name defined in this factory
See Also:
RootBeanDefinition, ChildBeanDefinition, ConfigurableListableBeanFactory.getBeanDefinition(java.lang.String)

freezeConfiguration

public void freezeConfiguration()
Description copied from interface: ConfigurableListableBeanFactory
Freeze all bean definitions, signalling that the registered bean definitions will not be modified or post-processed any further.

This allows the factory to aggressively cache bean definition metadata.

Specified by:
freezeConfiguration in interface ConfigurableListableBeanFactory

isConfigurationFrozen

public boolean isConfigurationFrozen()
Description copied from interface: ConfigurableListableBeanFactory
Return whether this factory's bean definitions are frozen, i.e. are not supposed to be modified or post-processed any further.

Specified by:
isConfigurationFrozen in interface ConfigurableListableBeanFactory
Returns:
true if the factory's configuration is considered frozen

isBeanEligibleForMetadataCaching

protected boolean isBeanEligibleForMetadataCaching(String beanName)
Considers all beans as eligible for metdata caching if the factory's configuration has been marked as frozen.

Overrides:
isBeanEligibleForMetadataCaching in class AbstractBeanFactory
Parameters:
beanName - the name of the bean
Returns:
true if the bean's metadata may be cached at this point already
See Also:
freezeConfiguration()

preInstantiateSingletons

public void preInstantiateSingletons()
                              throws BeansException
Description copied from interface: ConfigurableListableBeanFactory
Ensure that all non-lazy-init singletons are instantiated, also considering FactoryBeans. Typically invoked at the end of factory setup, if desired.

Specified by:
preInstantiateSingletons in interface ConfigurableListableBeanFactory
Throws:
BeansException - if one of the singleton beans could not be created. Note: This may have left the factory with some beans already initialized! Call ConfigurableBeanFactory.destroySingletons() for full cleanup in this case.
See Also:
ConfigurableBeanFactory.destroySingletons()

registerBeanDefinition

public void registerBeanDefinition(String beanName,
                                   BeanDefinition beanDefinition)
                            throws BeanDefinitionStoreException
Description copied from interface: BeanDefinitionRegistry
Register a new bean definition with this registry. Must support RootBeanDefinition and ChildBeanDefinition.

Specified by:
registerBeanDefinition in interface BeanDefinitionRegistry
Parameters:
beanName - the name of the bean instance to register
beanDefinition - definition of the bean instance to register
Throws:
BeanDefinitionStoreException - if the BeanDefinition is invalid or if there is already a BeanDefinition for the specified bean name (and we are not allowed to override it)
See Also:
RootBeanDefinition, ChildBeanDefinition

removeBeanDefinition

public void removeBeanDefinition(String beanName)
                          throws NoSuchBeanDefinitionException
Description copied from interface: BeanDefinitionRegistry
Remove the BeanDefinition for the given name.

Specified by:
removeBeanDefinition in interface BeanDefinitionRegistry
Parameters:
beanName - the name of the bean instance to register
Throws:
NoSuchBeanDefinitionException - if there is no such bean definition

resetBeanDefinition

protected void resetBeanDefinition(String beanName)
Reset all bean definition caches for the given bean, including the caches of beans that are derived from it.

Parameters:
beanName - the name of the bean to reset

allowAliasOverriding

protected boolean allowAliasOverriding()
Only allows alias overriding if bean definition overriding is allowed.

Overrides:
allowAliasOverriding in class SimpleAliasRegistry

resolveDependency

public Object resolveDependency(DependencyDescriptor descriptor,
                                String beanName,
                                Set<String> autowiredBeanNames,
                                TypeConverter typeConverter)
                         throws BeansException
Description copied from interface: AutowireCapableBeanFactory
Resolve the specified dependency against the beans defined in this factory.

Specified by:
resolveDependency in interface AutowireCapableBeanFactory
Parameters:
descriptor - the descriptor for the dependency
beanName - the name of the bean which declares the present dependency
autowiredBeanNames - a Set that all names of autowired beans (used for resolving the present dependency) are supposed to be added to
typeConverter - the TypeConverter to use for populating arrays and collections
Returns:
the resolved object, or null if none found
Throws:
BeansException - in dependency resolution failed

doResolveDependency

protected Object doResolveDependency(DependencyDescriptor descriptor,
                                     Class<?> type,
                                     String beanName,
                                     Set<String> autowiredBeanNames,
                                     TypeConverter typeConverter)
                              throws BeansException
Throws:
BeansException

findAutowireCandidates

protected Map<String,Object> findAutowireCandidates(String beanName,
                                                    Class requiredType,
                                                    DependencyDescriptor descriptor)
Find bean instances that match the required type. Called during autowiring for the specified bean.

Parameters:
beanName - the name of the bean that is about to be wired
requiredType - the actual type of bean to look for (may be an array component type or collection element type)
descriptor - the descriptor of the dependency to resolve
Returns:
a Map of candidate names and candidate instances that match the required type (never null)
Throws:
BeansException - in case of errors
See Also:
AbstractAutowireCapableBeanFactory.autowireByType(java.lang.String, org.springframework.beans.factory.support.AbstractBeanDefinition, org.springframework.beans.BeanWrapper, org.springframework.beans.MutablePropertyValues), AbstractAutowireCapableBeanFactory.autowireConstructor(java.lang.String, org.springframework.beans.factory.support.RootBeanDefinition, java.lang.reflect.Constructor[], java.lang.Object[])

determinePrimaryCandidate

protected String determinePrimaryCandidate(Map<String,Object> candidateBeans,
                                           DependencyDescriptor descriptor)
Determine the primary autowire candidate in the given set of beans.

Parameters:
candidateBeans - a Map of candidate names and candidate instances that match the required type, as returned by findAutowireCandidates(java.lang.String, java.lang.Class, org.springframework.beans.factory.config.DependencyDescriptor)
descriptor - the target dependency to match against
Returns:
the name of the primary candidate, or null if none found

isPrimary

protected boolean isPrimary(String beanName,
                            Object beanInstance)
Return whether the bean definition for the given bean name has been marked as a primary bean.

Parameters:
beanName - the name of the bean
beanInstance - the corresponding bean instance
Returns:
whether the given bean qualifies as primary

matchesBeanName

protected boolean matchesBeanName(String beanName,
                                  String candidateName)
Determine whether the given candidate name matches the bean name or the aliases stored in this bean definition.

toString

public String toString()
Overrides:
toString in class Object

writeReplace

protected Object writeReplace()
                       throws ObjectStreamException
Throws:
ObjectStreamException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultSingletonBeanRegistry

org.springframework.beans.factory.support
Class DefaultSingletonBeanRegistry

java.lang.Object
    extended by  org.springframework.core.SimpleAliasRegistry
        extended by  org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
All Implemented Interfaces:
SingletonBeanRegistry, AliasRegistry
Direct Known Subclasses:
FactoryBeanRegistrySupport
public class DefaultSingletonBeanRegistry
extends SimpleAliasRegistry
implements SingletonBeanRegistry

Generic registry for shared bean instances, implementing the SingletonBeanRegistry. Allows for registering singleton instances that should be shared for all callers of the registry, to be obtained via bean name.

Also supports registration of DisposableBean instances, (which might or might not correspond to registered singletons), to be destroyed on shutdown of the registry. Dependencies between beans can be registered to enforce an appropriate shutdown order.

This class mainly serves as base class for BeanFactory implementations, factoring out the common management of singleton bean instances. Note that the ConfigurableBeanFactory interface extends the SingletonBeanRegistry interface.

Note that this class assumes neither a bean definition concept nor a specific creation process for bean instances, in contrast to AbstractBeanFactory and DefaultListableBeanFactory (which inherit from it). Can alternatively also be used as a nested helper to delegate to.

Since:
2.0
Author:
Juergen Hoeller
See Also:
registerSingleton(java.lang.String, java.lang.Object), registerDisposableBean(java.lang.String, org.springframework.beans.factory.DisposableBean), DisposableBean, ConfigurableBeanFactory

Field Summary
protected Log | logger Logger available to subclasses
protected static Object | NULL_OBJECT Internal marker for a null singleton object: used as marker value for concurrent Maps (which don't support null values).
Constructor Summary
DefaultSingletonBeanRegistry()
Method Summary
protected void | addSingleton(String beanName, Object singletonObject) Add the given singleton object to the singleton cache of this factory.
protected void | addSingletonFactory(String beanName, ObjectFactory singletonFactory) Add the given singleton factory for building the specified singleton if necessary.
protected void | afterSingletonCreation(String beanName) Callback after singleton creation.
protected void | beforeSingletonCreation(String beanName) Callback before singleton creation.
boolean | containsSingleton(String beanName) Check if this registry contains a singleton instance with the given name.
protected void | destroyBean(String beanName, DisposableBean bean) Destroy the given bean.
void | destroySingleton(String beanName) Destroy the given bean.
void | destroySingletons()
String[] | getDependenciesForBean(String beanName) Return the names of all beans that the specified bean depends on, if any.
String[] | getDependentBeans(String beanName) Return the names of all beans which depend on the specified bean, if any.
Object | getSingleton(String beanName) Return the (raw) singleton object registered under the given name.
protected Object | getSingleton(String beanName, boolean allowEarlyReference) Return the (raw) singleton object registered under the given name.
Object | getSingleton(String beanName, ObjectFactory singletonFactory) Return the (raw) singleton object registered under the given name, creating and registering a new one if none registered yet.
int | getSingletonCount() Return the number of singleton beans registered in this registry.
protected Object | getSingletonMutex() Expose the singleton mutex to subclasses.
String[] | getSingletonNames() Return the names of singleton beans registered in this registry.
protected boolean | hasDependentBean(String beanName) Determine whether a dependent bean has been registered for the given name.
boolean | isSingletonCurrentlyInCreation(String beanName) Return whether the specified singleton bean is currently in creation (within the entire factory).
protected void | onSuppressedException(Exception ex) Register an Exception that happened to get suppressed during the creation of a singleton bean instance, e.g.
void | registerContainedBean(String containedBeanName, String containingBeanName) Register a containment relationship between two beans, e.g.
void | registerDependentBean(String beanName, String dependentBeanName) Register a dependent bean for the given bean, to be destroyed before the given bean is destroyed.
void | registerDisposableBean(String beanName, DisposableBean bean) Add the given bean to the list of disposable beans in this registry.
void | registerSingleton(String beanName, Object singletonObject) Register the given existing object as singleton in the bean registry, under the given bean name.
protected void | removeSingleton(String beanName) Remove the bean with the given name from the singleton cache of this factory, to be able to clean up eager registration of a singleton if creation failed.
Methods inherited from class org.springframework.core.SimpleAliasRegistry
allowAliasOverriding, canonicalName, getAliases, isAlias, registerAlias, removeAlias, resolveAliases
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

NULL_OBJECT

protected static final Object NULL_OBJECT
Internal marker for a null singleton object: used as marker value for concurrent Maps (which don't support null values).

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

DefaultSingletonBeanRegistry

public DefaultSingletonBeanRegistry()
Method Detail

registerSingleton

public void registerSingleton(String beanName,
                              Object singletonObject)
                       throws IllegalStateException
Description copied from interface: SingletonBeanRegistry
Register the given existing object as singleton in the bean registry, under the given bean name.

The given instance is supposed to be fully initialized; the registry will not perform any initialization callbacks (in particular, it won't call InitializingBean's afterPropertiesSet method). The given instance will not receive any destruction callbacks (like DisposableBean's destroy method) either.

When running within a full BeanFactory: Register a bean definition instead of an existing instance if your bean is supposed to receive initialization and/or destruction callbacks.

Typically invoked during registry configuration, but can also be used for runtime registration of singletons. As a consequence, a registry implementation should synchronize singleton access; it will have to do this anyway if it supports a BeanFactory's lazy initialization of singletons.

Specified by:
registerSingleton in interface SingletonBeanRegistry
Parameters:
beanName - the name of the bean
singletonObject - the existing singleton object
Throws:
IllegalStateException
See Also:
InitializingBean.afterPropertiesSet(),
DisposableBean.destroy(),
BeanDefinitionRegistry.registerBeanDefinition(java.lang.String, org.springframework.beans.factory.config.BeanDefinition)

addSingleton

protected void addSingleton(String beanName,
                            Object singletonObject)
Add the given singleton object to the singleton cache of this factory.

To be called for eager registration of singletons.

Parameters:
beanName - the name of the bean
singletonObject - the singleton object

addSingletonFactory

protected void addSingletonFactory(String beanName,
                                   ObjectFactory singletonFactory)
Add the given singleton factory for building the specified singleton if necessary.

To be called for eager registration of singletons, e.g. to be able to resolve circular references.

Parameters:
beanName - the name of the bean
singletonFactory - the factory for the singleton object

getSingleton

public Object getSingleton(String beanName)
Description copied from interface: SingletonBeanRegistry
Return the (raw) singleton object registered under the given name.

Only checks already instantiated singletons; does not return an Object for singleton bean definitions which have not been instantiated yet.

The main purpose of this method is to access manually registered singletons (see SingletonBeanRegistry.registerSingleton(java.lang.String, java.lang.Object)). Can also be used to access a singleton defined by a bean definition that already been created, in a raw fashion.

NOTE: This lookup method is not aware of FactoryBean prefixes or aliases. You need to resolve the canonical bean name first before obtaining the singleton instance.

Specified by:
getSingleton in interface SingletonBeanRegistry
Parameters:
beanName - the name of the bean to look for
Returns:
the registered singleton object, or null if none found
See Also:
ConfigurableListableBeanFactory.getBeanDefinition(java.lang.String)

getSingleton

protected Object getSingleton(String beanName,
                              boolean allowEarlyReference)
Return the (raw) singleton object registered under the given name.

Checks already instantiated singletons and also allows for an early reference to a currently created singleton (resolving a circular reference).

Parameters:
beanName - the name of the bean to look for
allowEarlyReference - whether early references should be created or not
Returns:
the registered singleton object, or null if none found

getSingleton

public Object getSingleton(String beanName,
                           ObjectFactory singletonFactory)
Return the (raw) singleton object registered under the given name, creating and registering a new one if none registered yet.

Parameters:
beanName - the name of the bean
singletonFactory - the ObjectFactory to lazily create the singleton with, if necessary
Returns:
the registered singleton object

onSuppressedException

protected void onSuppressedException(Exception ex)
Register an Exception that happened to get suppressed during the creation of a singleton bean instance, e.g. a temporary circular reference resolution problem.

Parameters:
ex - the Exception to register

removeSingleton

protected void removeSingleton(String beanName)
Remove the bean with the given name from the singleton cache of this factory, to be able to clean up eager registration of a singleton if creation failed.

Parameters:
beanName - the name of the bean
See Also:
getSingletonMutex()

containsSingleton

public boolean containsSingleton(String beanName)
Description copied from interface: SingletonBeanRegistry
Check if this registry contains a singleton instance with the given name.

Only checks already instantiated singletons; does not return true for singleton bean definitions which have not been instantiated yet.

The main purpose of this method is to check manually registered singletons (see SingletonBeanRegistry.registerSingleton(java.lang.String, java.lang.Object)). Can also be used to check whether a singleton defined by a bean definition has already been created.

To check whether a bean factory contains a bean definition with a given name, use ListableBeanFactory's containsBeanDefinition. Calling both containsBeanDefinition and containsSingleton answers whether a specific bean factory contains a local bean instance with the given name.

Use BeanFactory's containsBean for general checks whether the factory knows about a bean with a given name (whether manually registered singleton instance or created by bean definition), also checking ancestor factories.

NOTE: This lookup method is not aware of FactoryBean prefixes or aliases. You need to resolve the canonical bean name first before checking the singleton status.

Specified by:
containsSingleton in interface SingletonBeanRegistry
Parameters:
beanName - the name of the bean to look for
Returns:
if this bean factory contains a singleton instance with the given name
See Also:
SingletonBeanRegistry.registerSingleton(java.lang.String, java.lang.Object),
ListableBeanFactory.containsBeanDefinition(java.lang.String),
BeanFactory.containsBean(java.lang.String)

getSingletonNames

public String[] getSingletonNames()
Description copied from interface: SingletonBeanRegistry
Return the names of singleton beans registered in this registry.

Only checks already instantiated singletons; does not return names for singleton bean definitions which have not been instantiated yet.

The main purpose of this method is to check manually registered singletons (see SingletonBeanRegistry.registerSingleton(java.lang.String, java.lang.Object)). Can also be used to check which singletons defined by a bean definition have already been created.

Specified by:
getSingletonNames in interface SingletonBeanRegistry
Returns:
the list of names as a String array (never null)
See Also:
SingletonBeanRegistry.registerSingleton(java.lang.String, java.lang.Object),
BeanDefinitionRegistry.getBeanDefinitionNames(),
ListableBeanFactory.getBeanDefinitionNames()

getSingletonCount

public int getSingletonCount()
Description copied from interface: SingletonBeanRegistry
Return the number of singleton beans registered in this registry.

Only checks already instantiated singletons; does not count singleton bean definitions which have not been instantiated yet.

The main purpose of this method is to check manually registered singletons (see SingletonBeanRegistry.registerSingleton(java.lang.String, java.lang.Object)). Can also be used to count the number of singletons defined by a bean definition that have already been created.

Specified by:
getSingletonCount in interface SingletonBeanRegistry
Returns:
the number of singleton beans
See Also:
SingletonBeanRegistry.registerSingleton(java.lang.String, java.lang.Object),
BeanDefinitionRegistry.getBeanDefinitionCount(),
ListableBeanFactory.getBeanDefinitionCount()

beforeSingletonCreation

protected void beforeSingletonCreation(String beanName)
Callback before singleton creation.

Default implementation register the singleton as currently in creation.

Parameters:
beanName - the name of the singleton about to be created
See Also:
isSingletonCurrentlyInCreation(java.lang.String)

afterSingletonCreation

protected void afterSingletonCreation(String beanName)
Callback after singleton creation.

Default implementation marks the singleton as not in creation anymore.

Parameters:
beanName - the name of the singleton that has been created
See Also:
isSingletonCurrentlyInCreation(java.lang.String)

isSingletonCurrentlyInCreation

public final boolean isSingletonCurrentlyInCreation(String beanName)
Return whether the specified singleton bean is currently in creation (within the entire factory).

Parameters:
beanName - the name of the bean

registerDisposableBean

public void registerDisposableBean(String beanName,
                                   DisposableBean bean)
Add the given bean to the list of disposable beans in this registry. Disposable beans usually correspond to registered singletons, matching the bean name but potentially being a different instance (for example, a DisposableBean adapter for a singleton that does not naturally implement Spring's DisposableBean interface).

Parameters:
beanName - the name of the bean
bean - the bean instance

registerContainedBean

public void registerContainedBean(String containedBeanName,
                                  String containingBeanName)
Register a containment relationship between two beans, e.g. between an inner bean and its containing outer bean.

Also registers the containing bean as dependent on the contained bean in terms of destruction order.

Parameters:
containedBeanName - the name of the contained (inner) bean
containingBeanName - the name of the containing (outer) bean
See Also:
registerDependentBean(java.lang.String, java.lang.String)

registerDependentBean

public void registerDependentBean(String beanName,
                                  String dependentBeanName)
Register a dependent bean for the given bean, to be destroyed before the given bean is destroyed.

Parameters:
beanName - the name of the bean
dependentBeanName - the name of the dependent bean

hasDependentBean

protected boolean hasDependentBean(String beanName)
Determine whether a dependent bean has been registered for the given name.

Parameters:
beanName - the name of the bean to check

getDependentBeans

public String[] getDependentBeans(String beanName)
Return the names of all beans which depend on the specified bean, if any.

Parameters:
beanName - the name of the bean
Returns:
the array of dependent bean names, or an empty array if none

getDependenciesForBean

public String[] getDependenciesForBean(String beanName)
Return the names of all beans that the specified bean depends on, if any.

Parameters:
beanName - the name of the bean
Returns:
the array of names of beans which the bean depends on, or an empty array if none

destroySingletons

public void destroySingletons()

destroySingleton

public void destroySingleton(String beanName)
Destroy the given bean. Delegates to destroyBean if a corresponding disposable bean instance is found.

Parameters:
beanName - the name of the bean
See Also:
destroyBean(java.lang.String, org.springframework.beans.factory.DisposableBean)

destroyBean

protected void destroyBean(String beanName,
                           DisposableBean bean)
Destroy the given bean. Must destroy beans that depend on the given bean before the bean itself. Should not throw any exceptions.

Parameters:
beanName - the name of the bean
bean - the bean instance to destroy

getSingletonMutex

protected final Object getSingletonMutex()
Expose the singleton mutex to subclasses.

Subclasses should synchronize on the given Object if they perform any sort of extended singleton creation phase. In particular, subclasses should not have their own mutexes involved in singleton creation, to avoid the potential for deadlocks in lazy-init situations.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FactoryBeanRegistrySupport

org.springframework.beans.factory.support
Class FactoryBeanRegistrySupport

java.lang.Object
    extended by  org.springframework.core.SimpleAliasRegistry
        extended by  org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
            extended by  org.springframework.beans.factory.support.FactoryBeanRegistrySupport
All Implemented Interfaces:
SingletonBeanRegistry, AliasRegistry
Direct Known Subclasses:
AbstractBeanFactory
public abstract class FactoryBeanRegistrySupport
extends DefaultSingletonBeanRegistry

Support base class for singleton registries which need to handle FactoryBean instances, integrated with DefaultSingletonBeanRegistry's singleton management.

Serves as base class for AbstractBeanFactory.

Since:
2.5.1
Author:
Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
logger, NULL_OBJECT
Constructor Summary
FactoryBeanRegistrySupport()
Method Summary
protected AccessControlContext | getAccessControlContext() Returns the security context for this bean factory.
protected Object | getCachedObjectForFactoryBean(String beanName) Obtain an object to expose from the given FactoryBean, if available in cached form.
protected FactoryBean | getFactoryBean(String beanName, Object beanInstance) Get a FactoryBean for the given bean if possible.
protected Object | getObjectFromFactoryBean(FactoryBean factory, String beanName, boolean shouldPostProcess) Obtain an object to expose from the given FactoryBean.
protected Class | getTypeForFactoryBean(FactoryBean factoryBean) Determine the type for the given FactoryBean.
protected Object | postProcessObjectFromFactoryBean(Object object, String beanName) Post-process the given object that has been obtained from the FactoryBean.
protected void | removeSingleton(String beanName) Overridden to clear the FactoryBean object cache as well.
Methods inherited from class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
addSingleton, addSingletonFactory, afterSingletonCreation, beforeSingletonCreation, containsSingleton, destroyBean, destroySingleton, destroySingletons, getDependenciesForBean, getDependentBeans, getSingleton, getSingleton, getSingleton, getSingletonCount, getSingletonMutex, getSingletonNames, hasDependentBean, isSingletonCurrentlyInCreation, onSuppressedException, registerContainedBean, registerDependentBean, registerDisposableBean, registerSingleton
Methods inherited from class org.springframework.core.SimpleAliasRegistry
allowAliasOverriding, canonicalName, getAliases, isAlias, registerAlias, removeAlias, resolveAliases
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

FactoryBeanRegistrySupport

public FactoryBeanRegistrySupport()
Method Detail

getTypeForFactoryBean

protected Class getTypeForFactoryBean(FactoryBean factoryBean)
Determine the type for the given FactoryBean.

Parameters:
factoryBean - the FactoryBean instance to check
Returns:
the FactoryBean's object type, or null if the type cannot be determined yet

getCachedObjectForFactoryBean

protected Object getCachedObjectForFactoryBean(String beanName)
Obtain an object to expose from the given FactoryBean, if available in cached form. Quick check for minimal synchronization.

Parameters:
beanName - the name of the bean
Returns:
the object obtained from the FactoryBean, or null if not available

getObjectFromFactoryBean

protected Object getObjectFromFactoryBean(FactoryBean factory,
                                          String beanName,
                                          boolean shouldPostProcess)
Obtain an object to expose from the given FactoryBean.

Parameters:
factory - the FactoryBean instance
beanName - the name of the bean
shouldPostProcess - whether the bean is subject for post-processing
Returns:
the object obtained from the FactoryBean
Throws:
BeanCreationException - if FactoryBean object creation failed
See Also:
FactoryBean.getObject()

postProcessObjectFromFactoryBean

protected Object postProcessObjectFromFactoryBean(Object object,
                                                  String beanName)
                                           throws BeansException
Post-process the given object that has been obtained from the FactoryBean. The resulting object will get exposed for bean references.

The default implementation simply returns the given object as-is. Subclasses may override this, for example, to apply post-processors.

Parameters:
object - the object obtained from the FactoryBean.
beanName - the name of the bean
Returns:
the object to expose
Throws:
BeansException - if any post-processing failed

getFactoryBean

protected FactoryBean getFactoryBean(String beanName,
                                     Object beanInstance)
                              throws BeansException
Get a FactoryBean for the given bean if possible.

Parameters:
beanName - the name of the bean
beanInstance - the corresponding bean instance
Returns:
the bean instance as FactoryBean
Throws:
BeansException - if the given bean cannot be exposed as a FactoryBean

removeSingleton

protected void removeSingleton(String beanName)
Overridden to clear the FactoryBean object cache as well.

Overrides:
removeSingleton in class DefaultSingletonBeanRegistry
Parameters:
beanName - the name of the bean
See Also:
DefaultSingletonBeanRegistry.getSingletonMutex()

getAccessControlContext

protected AccessControlContext getAccessControlContext()
Returns the security context for this bean factory. If a security manager is set, interaction with the user code will be executed using the privileged of the security context returned by this method.

See Also:
AccessController.getContext()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


GenericBeanDefinition

org.springframework.beans.factory.support
Class GenericBeanDefinition

java.lang.Object
    extended by  org.springframework.core.AttributeAccessorSupport
        extended by  org.springframework.beans.BeanMetadataAttributeAccessor
            extended by  org.springframework.beans.factory.support.AbstractBeanDefinition
                extended by  org.springframework.beans.factory.support.GenericBeanDefinition
All Implemented Interfaces:
Serializable, Cloneable, BeanMetadataElement, BeanDefinition, AttributeAccessor
Direct Known Subclasses:
AnnotatedGenericBeanDefinition, ScannedGenericBeanDefinition
public class GenericBeanDefinition
extends AbstractBeanDefinition

GenericBeanDefinition is a one-stop shop for standard bean definition purposes. Like any bean definition, it allows for specifying a class plus optionally constructor argument values and property values. Additionally, deriving from a parent bean definition can be flexibly configured through the "parentName" property.

In general, use this GenericBeanDefinition class for the purpose of registering user-visible bean definitions (which a post-processor might operate on, potentially even reconfiguring the parent name). Use RootBeanDefinition / ChildBeanDefinition where parent/child relationships happen to be pre-determined.

Since:
2.5
Author:
Juergen Hoeller
See Also:
setParentName(java.lang.String), RootBeanDefinition, ChildBeanDefinition, Serialized Form

Field Summary
Fields inherited from class org.springframework.beans.factory.support.AbstractBeanDefinition
AUTOWIRE_AUTODETECT, AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_CONSTRUCTOR, AUTOWIRE_NO, DEPENDENCY_CHECK_ALL, DEPENDENCY_CHECK_NONE, DEPENDENCY_CHECK_OBJECTS, DEPENDENCY_CHECK_SIMPLE, SCOPE_DEFAULT
Fields inherited from interface org.springframework.beans.factory.config.BeanDefinition
ROLE_APPLICATION, ROLE_INFRASTRUCTURE, ROLE_SUPPORT, SCOPE_PROTOTYPE, SCOPE_SINGLETON
Constructor Summary
GenericBeanDefinition()
Create a new GenericBeanDefinition, to be configured through its bean properties and configuration methods.
GenericBeanDefinition(BeanDefinition original)
Create a new GenericBeanDefinition as deep copy of the given bean definition.
Method Summary
AbstractBeanDefinition | cloneBeanDefinition() Clone this bean definition.
boolean | equals(Object other)
String | getParentName() Return the name of the parent definition of this bean definition, if any.
void | setParentName(String parentName) Set the name of the parent definition of this bean definition, if any.
String | toString()
Methods inherited from class org.springframework.beans.factory.support.AbstractBeanDefinition
addQualifier, applyDefaults, clone, copyQualifiersFrom, getAutowireMode, getBeanClass, getBeanClassName, getConstructorArgumentValues, getDependencyCheck, getDependsOn, getDescription, getDestroyMethodName, getFactoryBeanName, getFactoryMethodName, getInitMethodName, getMethodOverrides, getOriginatingBeanDefinition, getPropertyValues, getQualifier, getQualifiers, getResolvedAutowireMode, getResource, getResourceDescription, getRole, getScope, hasBeanClass, hasConstructorArgumentValues, hashCode, hasQualifier, isAbstract, isAutowireCandidate, isEnforceDestroyMethod, isEnforceInitMethod, isLazyInit, isLenientConstructorResolution, isNonPublicAccessAllowed, isPrimary, isPrototype, isSingleton, isSynthetic, overrideFrom, overrideFrom, prepareMethodOverride, prepareMethodOverrides, resolveBeanClass, setAbstract, setAutowireCandidate, setAutowireMode, setBeanClass, setBeanClassName, setConstructorArgumentValues, setDependencyCheck, setDependsOn, setDescription, setDestroyMethodName, setEnforceDestroyMethod, setEnforceInitMethod, setFactoryBeanName, setFactoryMethodName, setInitMethodName, setLazyInit, setLenientConstructorResolution, setMethodOverrides, setNonPublicAccessAllowed, setOriginatingBeanDefinition, setPrimary, setPropertyValues, setResource, setResourceDescription, setRole, setScope, setSingleton, setSynthetic, validate
Methods inherited from class org.springframework.beans.BeanMetadataAttributeAccessor
addMetadataAttribute, getAttribute, getMetadataAttribute, getSource, removeAttribute, setAttribute, setSource
Methods inherited from class org.springframework.core.AttributeAccessorSupport
attributeNames, copyAttributesFrom, hasAttribute
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.core.AttributeAccessor
attributeNames, getAttribute, hasAttribute, removeAttribute, setAttribute
Methods inherited from interface org.springframework.beans.BeanMetadataElement
getSource

Constructor Detail

GenericBeanDefinition

public GenericBeanDefinition()
Create a new GenericBeanDefinition, to be configured through its bean properties and configuration methods.

See Also:
AbstractBeanDefinition.setBeanClass(java.lang.Class),
AbstractBeanDefinition.setBeanClassName(java.lang.String),
AbstractBeanDefinition.setScope(java.lang.String),
AbstractBeanDefinition.setAutowireMode(int),
AbstractBeanDefinition.setDependencyCheck(int),
AbstractBeanDefinition.setConstructorArgumentValues(org.springframework.beans.factory.config.ConstructorArgumentValues),
AbstractBeanDefinition.setPropertyValues(org.springframework.beans.MutablePropertyValues)

GenericBeanDefinition

public GenericBeanDefinition(BeanDefinition original)
Create a new GenericBeanDefinition as deep copy of the given bean definition.

Parameters:
original - the original bean definition to copy from
Method Detail

setParentName

public void setParentName(String parentName)
Description copied from interface: BeanDefinition
Set the name of the parent definition of this bean definition, if any.

getParentName

public String getParentName()
Description copied from interface: BeanDefinition
Return the name of the parent definition of this bean definition, if any.

cloneBeanDefinition

public AbstractBeanDefinition cloneBeanDefinition()
Description copied from class: AbstractBeanDefinition
Clone this bean definition. To be implemented by concrete subclasses.

Specified by:
cloneBeanDefinition in class AbstractBeanDefinition
Returns:
the cloned bean definition object

equals

public boolean equals(Object other)
Overrides:
equals in class AbstractBeanDefinition

toString

public String toString()
Overrides:
toString in class AbstractBeanDefinition
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LookupOverride

org.springframework.beans.factory.support
Class LookupOverride

java.lang.Object
    extended by  org.springframework.beans.factory.support.MethodOverride
        extended by  org.springframework.beans.factory.support.LookupOverride
All Implemented Interfaces:
BeanMetadataElement
public class LookupOverride
extends MethodOverride

Represents an override of a method that looks up an object in the same IoC context.

Methods eligible for lookup override must not have arguments.

Since:
1.1
Author:
Rod Johnson, Juergen Hoeller

Constructor Summary
LookupOverride(String methodName, String beanName)
Construct a new LookupOverride.
Method Summary
boolean | equals(Object other)
String | getBeanName() Return the name of the bean that should be returned by this method.
int | hashCode()
boolean | matches(Method method) Match method of the given name, with no parameters.
String | toString()
Methods inherited from class org.springframework.beans.factory.support.MethodOverride
getMethodName, getSource, isOverloaded, setOverloaded, setSource
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

LookupOverride

public LookupOverride(String methodName,
                      String beanName)
Construct a new LookupOverride.

Parameters:
methodName - the name of the method to override. This method must have no arguments.
beanName - name of the bean in the current BeanFactory that the overriden method should return
Method Detail

getBeanName

public String getBeanName()
Return the name of the bean that should be returned by this method.

matches

public boolean matches(Method method)
Match method of the given name, with no parameters.

Specified by:
matches in class MethodOverride
Parameters:
method - the method to check
Returns:
whether this override matches the given method

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object other)
Overrides:
equals in class MethodOverride

hashCode

public int hashCode()
Overrides:
hashCode in class MethodOverride
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ManagedArray

org.springframework.beans.factory.support
Class ManagedArray

java.lang.Object
    extended by  java.util.AbstractCollection<E>
        extended by  java.util.AbstractList<E>
            extended by  java.util.ArrayList<E>
                extended by  org.springframework.beans.factory.support.ManagedList<Object>
                    extended by  org.springframework.beans.factory.support.ManagedArray
All Implemented Interfaces:
Serializable, Cloneable, Iterable<Object>, Collection<Object>, List<Object>, RandomAccess, BeanMetadataElement, Mergeable
public class ManagedArray
extends ManagedList<Object>

Tag collection class used to hold managed array elements, which may include runtime bean references (to be resolved into bean objects).

Since:
3.0
Author:
Juergen Hoeller
See Also:
Serialized Form

Field Summary
Fields inherited from class java.util.AbstractList
modCount
Constructor Summary
ManagedArray(String elementTypeName, int size)
Create a new managed array placeholder.
Method Summary
Methods inherited from class org.springframework.beans.factory.support.ManagedList
getElementTypeName, getSource, isMergeEnabled, merge, setElementTypeName, setMergeEnabled, setSource
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList

Constructor Detail

ManagedArray

public ManagedArray(String elementTypeName,
                    int size)
Create a new managed array placeholder.

Parameters:
elementTypeName - the target element type as a class name
size - the size of the array
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ManagedList

org.springframework.beans.factory.support
Class ManagedList<E>

java.lang.Object
    extended by  java.util.AbstractCollection<E>
        extended by  java.util.AbstractList<E>
            extended by  java.util.ArrayList<E>
                extended by  org.springframework.beans.factory.support.ManagedList<E>
All Implemented Interfaces:
Serializable, Cloneable, Iterable<E>, Collection<E>, List<E>, RandomAccess, BeanMetadataElement, Mergeable
Direct Known Subclasses:
ManagedArray
public class ManagedList<E>
extends ArrayList<E>
implements Mergeable, BeanMetadataElement

Tag collection class used to hold managed List elements, which may include runtime bean references (to be resolved into bean objects).

Since:
27.05.2003
Author:
Rod Johnson, Rob Harrop, Juergen Hoeller
See Also:
Serialized Form

Field Summary
Fields inherited from class java.util.AbstractList
modCount
Constructor Summary
ManagedList()
ManagedList(int initialCapacity)
Method Summary
String | getElementTypeName() Return the default element type name (class name) to be used for this list.
Object | getSource() Return the configuration source Object for this metadata element (may be null).
boolean | isMergeEnabled() Is merging enabled for this particular instance?
List<E> | merge(Object parent) Merge the current value set with that of the supplied object.
void | setElementTypeName(String elementTypeName) Set the default element type name (class name) to be used for this list.
void | setMergeEnabled(boolean mergeEnabled) Set whether merging should be enabled for this collection, in case of a 'parent' collection value being present.
void | setSource(Object source) Set the configuration source Object for this metadata element.
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList

Constructor Detail

ManagedList

public ManagedList()

ManagedList

public ManagedList(int initialCapacity)
Method Detail

setSource

public void setSource(Object source)
Set the configuration source Object for this metadata element.

The exact type of the object will depend on the configuration mechanism used.

getSource

public Object getSource()
Description copied from interface: BeanMetadataElement
Return the configuration source Object for this metadata element (may be null).

Specified by:
getSource in interface BeanMetadataElement

setElementTypeName

public void setElementTypeName(String elementTypeName)
Set the default element type name (class name) to be used for this list.

getElementTypeName

public String getElementTypeName()
Return the default element type name (class name) to be used for this list.

setMergeEnabled

public void setMergeEnabled(boolean mergeEnabled)
Set whether merging should be enabled for this collection, in case of a 'parent' collection value being present.

isMergeEnabled

public boolean isMergeEnabled()
Description copied from interface: Mergeable
Is merging enabled for this particular instance?

Specified by:
isMergeEnabled in interface Mergeable

merge

public List<E> merge(Object parent)
Description copied from interface: Mergeable
Merge the current value set with that of the supplied object.

The supplied object is considered the parent, and values in the callee's value set must override those of the supplied object.

Specified by:
merge in interface Mergeable
Parameters:
parent - the object to merge with
Returns:
the result of the merge operation
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ManagedMap

org.springframework.beans.factory.support
Class ManagedMap<K,V>

java.lang.Object
    extended by  java.util.AbstractMap<K,V>
        extended by  java.util.HashMap<K,V>
            extended by  java.util.LinkedHashMap<K,V>
                extended by  org.springframework.beans.factory.support.ManagedMap<K,V>
All Implemented Interfaces:
Serializable, Cloneable, Map<K,V>, BeanMetadataElement, Mergeable
public class ManagedMap<K,V>
extends LinkedHashMap<K,V>
implements Mergeable, BeanMetadataElement

Tag collection class used to hold managed Map values, which may include runtime bean references (to be resolved into bean objects).

Since:
27.05.2003
Author:
Juergen Hoeller, Rob Harrop
See Also:
Serialized Form

Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor Summary
ManagedMap()
ManagedMap(int initialCapacity)
Method Summary
String | getKeyTypeName() Return the default key type name (class name) to be used for this map.
Object | getSource() Return the configuration source Object for this metadata element (may be null).
String | getValueTypeName() Return the default value type name (class name) to be used for this map.
boolean | isMergeEnabled() Is merging enabled for this particular instance?
Object | merge(Object parent) Merge the current value set with that of the supplied object.
void | setKeyTypeName(String keyTypeName) Set the default key type name (class name) to be used for this map.
void | setMergeEnabled(boolean mergeEnabled) Set whether merging should be enabled for this collection, in case of a 'parent' collection value being present.
void | setSource(Object source) Set the configuration source Object for this metadata element.
void | setValueTypeName(String valueTypeName) Set the default value type name (class name) to be used for this map.
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, get, removeEldestEntry
Methods inherited from class java.util.HashMap
clone, containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values

Constructor Detail

ManagedMap

public ManagedMap()

ManagedMap

public ManagedMap(int initialCapacity)
Method Detail

setSource

public void setSource(Object source)
Set the configuration source Object for this metadata element.

The exact type of the object will depend on the configuration mechanism used.

getSource

public Object getSource()
Description copied from interface: BeanMetadataElement
Return the configuration source Object for this metadata element (may be null).

Specified by:
getSource in interface BeanMetadataElement

setKeyTypeName

public void setKeyTypeName(String keyTypeName)
Set the default key type name (class name) to be used for this map.

getKeyTypeName

public String getKeyTypeName()
Return the default key type name (class name) to be used for this map.

setValueTypeName

public void setValueTypeName(String valueTypeName)
Set the default value type name (class name) to be used for this map.

getValueTypeName

public String getValueTypeName()
Return the default value type name (class name) to be used for this map.

setMergeEnabled

public void setMergeEnabled(boolean mergeEnabled)
Set whether merging should be enabled for this collection, in case of a 'parent' collection value being present.

isMergeEnabled

public boolean isMergeEnabled()
Description copied from interface: Mergeable
Is merging enabled for this particular instance?

Specified by:
isMergeEnabled in interface Mergeable

merge

public Object merge(Object parent)
Description copied from interface: Mergeable
Merge the current value set with that of the supplied object.

The supplied object is considered the parent, and values in the callee's value set must override those of the supplied object.

Specified by:
merge in interface Mergeable
Parameters:
parent - the object to merge with
Returns:
the result of the merge operation
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ManagedProperties

org.springframework.beans.factory.support
Class ManagedProperties

java.lang.Object
    extended by  java.util.Dictionary<K,V>
        extended by  java.util.Hashtable<Object,Object>
            extended by  java.util.Properties
                extended by  org.springframework.beans.factory.support.ManagedProperties
All Implemented Interfaces:
Serializable, Cloneable, Map<Object,Object>, BeanMetadataElement, Mergeable
public class ManagedProperties
extends Properties
implements Mergeable, BeanMetadataElement

Tag class which represents a Spring-managed Properties instance that supports merging of parent/child definitions.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
See Also:
Serialized Form

Field Summary
Fields inherited from class java.util.Properties
defaults
Constructor Summary
ManagedProperties()
Method Summary
Object | getSource() Return the configuration source Object for this metadata element (may be null).
boolean | isMergeEnabled() Is merging enabled for this particular instance?
Object | merge(Object parent) Merge the current value set with that of the supplied object.
void | setMergeEnabled(boolean mergeEnabled) Set whether merging should be enabled for this collection, in case of a 'parent' collection value being present.
void | setSource(Object source) Set the configuration source Object for this metadata element.
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

ManagedProperties

public ManagedProperties()
Method Detail

setSource

public void setSource(Object source)
Set the configuration source Object for this metadata element.

The exact type of the object will depend on the configuration mechanism used.

getSource

public Object getSource()
Description copied from interface: BeanMetadataElement
Return the configuration source Object for this metadata element (may be null).

Specified by:
getSource in interface BeanMetadataElement

setMergeEnabled

public void setMergeEnabled(boolean mergeEnabled)
Set whether merging should be enabled for this collection, in case of a 'parent' collection value being present.

isMergeEnabled

public boolean isMergeEnabled()
Description copied from interface: Mergeable
Is merging enabled for this particular instance?

Specified by:
isMergeEnabled in interface Mergeable

merge

public Object merge(Object parent)
Description copied from interface: Mergeable
Merge the current value set with that of the supplied object.

The supplied object is considered the parent, and values in the callee's value set must override those of the supplied object.

Specified by:
merge in interface Mergeable
Parameters:
parent - the object to merge with
Returns:
the result of the merge operation
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ManagedSet

org.springframework.beans.factory.support
Class ManagedSet<E>

java.lang.Object
    extended by  java.util.AbstractCollection<E>
        extended by  java.util.AbstractSet<E>
            extended by  java.util.HashSet<E>
                extended by  java.util.LinkedHashSet<E>
                    extended by  org.springframework.beans.factory.support.ManagedSet<E>
All Implemented Interfaces:
Serializable, Cloneable, Iterable<E>, Collection<E>, Set<E>, BeanMetadataElement, Mergeable
public class ManagedSet<E>
extends LinkedHashSet<E>
implements Mergeable, BeanMetadataElement

Tag collection class used to hold managed Set values, which may include runtime bean references (to be resolved into bean objects).

Since:
21.01.2004
Author:
Juergen Hoeller, Rob Harrop
See Also:
Serialized Form

Constructor Summary
ManagedSet()
ManagedSet(int initialCapacity)
Method Summary
String | getElementTypeName() Return the default element type name (class name) to be used for this set.
Object | getSource() Return the configuration source Object for this metadata element (may be null).
boolean | isMergeEnabled() Is merging enabled for this particular instance?
Set<E> | merge(Object parent) Merge the current value set with that of the supplied object.
void | setElementTypeName(String elementTypeName) Set the default element type name (class name) to be used for this set.
void | setMergeEnabled(boolean mergeEnabled) Set whether merging should be enabled for this collection, in case of a 'parent' collection value being present.
void | setSource(Object source) Set the configuration source Object for this metadata element.
Methods inherited from class java.util.HashSet
add, clear, clone, contains, isEmpty, iterator, remove, size
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll, toArray, toArray, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray

Constructor Detail

ManagedSet

public ManagedSet()

ManagedSet

public ManagedSet(int initialCapacity)
Method Detail

setSource

public void setSource(Object source)
Set the configuration source Object for this metadata element.

The exact type of the object will depend on the configuration mechanism used.

getSource

public Object getSource()
Description copied from interface: BeanMetadataElement
Return the configuration source Object for this metadata element (may be null).

Specified by:
getSource in interface BeanMetadataElement

setElementTypeName

public void setElementTypeName(String elementTypeName)
Set the default element type name (class name) to be used for this set.

getElementTypeName

public String getElementTypeName()
Return the default element type name (class name) to be used for this set.

setMergeEnabled

public void setMergeEnabled(boolean mergeEnabled)
Set whether merging should be enabled for this collection, in case of a 'parent' collection value being present.

isMergeEnabled

public boolean isMergeEnabled()
Description copied from interface: Mergeable
Is merging enabled for this particular instance?

Specified by:
isMergeEnabled in interface Mergeable

merge

public Set<E> merge(Object parent)
Description copied from interface: Mergeable
Merge the current value set with that of the supplied object.

The supplied object is considered the parent, and values in the callee's value set must override those of the supplied object.

Specified by:
merge in interface Mergeable
Parameters:
parent - the object to merge with
Returns:
the result of the merge operation
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MethodOverride

org.springframework.beans.factory.support
Class MethodOverride

java.lang.Object
    extended by  org.springframework.beans.factory.support.MethodOverride
All Implemented Interfaces:
BeanMetadataElement
Direct Known Subclasses:
LookupOverride, ReplaceOverride
public abstract class MethodOverride
extends Object
implements BeanMetadataElement

Object representing the override of a method on a managed object by the IoC container.

Note that the override mechanism is not intended as a generic means of inserting crosscutting code: use AOP for that.

Since:
1.1
Author:
Rod Johnson, Juergen Hoeller

Constructor Summary
protected MethodOverride(String methodName)
Construct a new override for the given method.
Method Summary
boolean | equals(Object other)
String | getMethodName() Return the name of the method to be overridden.
Object | getSource() Return the configuration source Object for this metadata element (may be null).
int | hashCode()
protected boolean | isOverloaded() Return whether the overridden method has to be considered as overloaded (that is, whether arg type matching has to happen).
abstract boolean | matches(Method method) Subclasses must override this to indicate whether they match the given method.
protected void | setOverloaded(boolean overloaded) Set whether the overridden method has to be considered as overloaded (that is, whether arg type matching has to happen).
void | setSource(Object source) Set the configuration source Object for this metadata element.
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MethodOverride

protected MethodOverride(String methodName)
Construct a new override for the given method.

Parameters:
methodName - the name of the method to override
Method Detail

getMethodName

public String getMethodName()
Return the name of the method to be overridden.

setOverloaded

protected void setOverloaded(boolean overloaded)
Set whether the overridden method has to be considered as overloaded (that is, whether arg type matching has to happen).

Default is "true"; can be switched to "false" to optimize runtime performance.

isOverloaded

protected boolean isOverloaded()
Return whether the overridden method has to be considered as overloaded (that is, whether arg type matching has to happen).

setSource

public void setSource(Object source)
Set the configuration source Object for this metadata element.

The exact type of the object will depend on the configuration mechanism used.

getSource

public Object getSource()
Description copied from interface: BeanMetadataElement
Return the configuration source Object for this metadata element (may be null).

Specified by:
getSource in interface BeanMetadataElement

matches

public abstract boolean matches(Method method)
Subclasses must override this to indicate whether they match the given method. This allows for argument list checking as well as method name checking.

Parameters:
method - the method to check
Returns:
whether this override matches the given method

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MethodOverrides

org.springframework.beans.factory.support
Class MethodOverrides

java.lang.Object
    extended by  org.springframework.beans.factory.support.MethodOverrides

public class MethodOverrides
extends Object

Set of method overrides, determining which, if any, methods on a managed object the Spring IoC container will override at runtime.

The currently supported MethodOverride variants are LookupOverride and ReplaceOverride.

Since:
1.1
Author:
Rod Johnson, Juergen Hoeller
See Also:
MethodOverride

Constructor Summary
MethodOverrides()
Create new MethodOverrides.
MethodOverrides(MethodOverrides other)
Deep copy constructor.
Method Summary
void | addOverride(MethodOverride override) Add the given method override.
void | addOverrides(MethodOverrides other) Copy all given method overrides into this object.
boolean | equals(Object other)
MethodOverride | getOverride(Method method) Return the override for the given method, if any.
Set<MethodOverride> | getOverrides() Return all method overrides contained by this object.
int | hashCode()
boolean | isEmpty() Return whether the set of method overrides is empty.
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MethodOverrides

public MethodOverrides()
Create new MethodOverrides.

MethodOverrides

public MethodOverrides(MethodOverrides other)
Deep copy constructor.

Method Detail

addOverrides

public void addOverrides(MethodOverrides other)
Copy all given method overrides into this object.

addOverride

public void addOverride(MethodOverride override)
Add the given method override.

getOverrides

public Set<MethodOverride> getOverrides()
Return all method overrides contained by this object.

Returns:
Set of MethodOverride objects
See Also:
MethodOverride

isEmpty

public boolean isEmpty()
Return whether the set of method overrides is empty.

getOverride

public MethodOverride getOverride(Method method)
Return the override for the given method, if any.

Parameters:
method - method to check for overrides for
Returns:
the method override, or null if none

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertiesBeanDefinitionReader

org.springframework.beans.factory.support
Class PropertiesBeanDefinitionReader

java.lang.Object
    extended by  org.springframework.beans.factory.support.AbstractBeanDefinitionReader
        extended by  org.springframework.beans.factory.support.PropertiesBeanDefinitionReader
All Implemented Interfaces:
BeanDefinitionReader
public class PropertiesBeanDefinitionReader
extends AbstractBeanDefinitionReader

Bean definition reader for a simple properties format.

Provides bean definition registration methods for Map/Properties and ResourceBundle. Typically applied to a DefaultListableBeanFactory.

Example:

 employee.(class)=MyClass       // bean is of class MyClass
 employee.(abstract)=true       // this bean can't be instantiated directly
 employee.group=Insurance       // real property
 employee.usesDialUp=false      // real property (potentially overridden)

 salesrep.(parent)=employee     // derives from "employee" bean definition
 salesrep.(lazy-init)=true      // lazily initialize this singleton bean
 salesrep.manager(ref)=tony     // reference to another bean
 salesrep.department=Sales      // real property

 techie.(parent)=employee       // derives from "employee" bean definition
 techie.(scope)=prototype       // bean is a prototype (not a shared instance)
 techie.manager(ref)=jeff       // reference to another bean
 techie.department=Engineering  // real property
 techie.usesDialUp=true         // real property (overriding parent value)

 ceo.$0(ref)=secretary          // inject 'secretary' bean as 0th constructor arg
 ceo.$1=1000000                 // inject value '1000000' at 1st constructor arg

Since:
26.11.2003
Author:
Rod Johnson, Juergen Hoeller, Rob Harrop
See Also:
DefaultListableBeanFactory

Field Summary
static String | ABSTRACT_KEY Special key to distinguish owner.(abstract)=true Default is "false".
static String | CLASS_KEY Special key to distinguish owner.(class)=com.myapp.MyClass-
static String | CONSTRUCTOR_ARG_PREFIX Prefix used to denote a constructor argument definition.
static String | LAZY_INIT_KEY Special key to distinguish owner.(lazy-init)=true Default is "false".
static String | PARENT_KEY Special key to distinguish owner.(parent)=parentBeanName.
static String | REF_PREFIX Prefix before values referencing other beans.
static String | REF_SUFFIX Property suffix for references to other beans in the current BeanFactory: e.g.
static String | SCOPE_KEY Special key to distinguish owner.(scope)=prototype.
static String | SEPARATOR Separator between bean name and property name.
static String | SINGLETON_KEY Special key to distinguish owner.(singleton)=false.
static String | TRUE_VALUE Value of a T/F attribute that represents true.
Fields inherited from class org.springframework.beans.factory.support.AbstractBeanDefinitionReader
logger
Constructor Summary
PropertiesBeanDefinitionReader(BeanDefinitionRegistry registry)
Create new PropertiesBeanDefinitionReader for the given bean factory.
Method Summary
String | getDefaultParentBean() Return the default parent bean for this bean factory.
PropertiesPersister | getPropertiesPersister() Return the PropertiesPersister to use for parsing properties files.
int | loadBeanDefinitions(EncodedResource encodedResource) Load bean definitions from the specified properties file.
int | loadBeanDefinitions(EncodedResource encodedResource, String prefix) Load bean definitions from the specified properties file.
int | loadBeanDefinitions(Resource resource) Load bean definitions from the specified properties file, using all property keys (i.e.
int | loadBeanDefinitions(Resource resource, String prefix) Load bean definitions from the specified properties file.
protected void | registerBeanDefinition(String beanName, Map<?,?> map, String prefix, String resourceDescription) Get all property values, given a prefix (which will be stripped) and add the bean they define to the factory with the given name
int | registerBeanDefinitions(Map map) Register bean definitions contained in a Map, using all property keys (i.e.
int | registerBeanDefinitions(Map map, String prefix) Register bean definitions contained in a Map.
int | registerBeanDefinitions(Map map, String prefix, String resourceDescription) Register bean definitions contained in a Map.
int | registerBeanDefinitions(ResourceBundle rb) Register bean definitions contained in a resource bundle, using all property keys (i.e.
int | registerBeanDefinitions(ResourceBundle rb, String prefix) Register bean definitions contained in a ResourceBundle.
void | setDefaultParentBean(String defaultParentBean) Set the default parent bean for this bean factory.
void | setPropertiesPersister(PropertiesPersister propertiesPersister) Set the PropertiesPersister to use for parsing properties files.
Methods inherited from class org.springframework.beans.factory.support.AbstractBeanDefinitionReader
getBeanClassLoader, getBeanFactory, getBeanNameGenerator, getRegistry, getResourceLoader, loadBeanDefinitions, loadBeanDefinitions, loadBeanDefinitions, loadBeanDefinitions, setBeanClassLoader, setBeanNameGenerator, setResourceLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

TRUE_VALUE

public static final String TRUE_VALUE
Value of a T/F attribute that represents true. Anything else represents false. Case seNsItive.

See Also:
Constant Field Values

SEPARATOR

public static final String SEPARATOR
Separator between bean name and property name. We follow normal Java conventions.

See Also:
Constant Field Values

CLASS_KEY

public static final String CLASS_KEY
Special key to distinguish owner.(class)=com.myapp.MyClass-

See Also:
Constant Field Values

PARENT_KEY

public static final String PARENT_KEY
Special key to distinguish owner.(parent)=parentBeanName.

See Also:
Constant Field Values

SCOPE_KEY

public static final String SCOPE_KEY
Special key to distinguish owner.(scope)=prototype. Default is "true".

See Also:
Constant Field Values

SINGLETON_KEY

public static final String SINGLETON_KEY
Special key to distinguish owner.(singleton)=false. Default is "true".

See Also:
Constant Field Values

ABSTRACT_KEY

public static final String ABSTRACT_KEY
Special key to distinguish owner.(abstract)=true Default is "false".

See Also:
Constant Field Values

LAZY_INIT_KEY

public static final String LAZY_INIT_KEY
Special key to distinguish owner.(lazy-init)=true Default is "false".

See Also:
Constant Field Values

REF_SUFFIX

public static final String REF_SUFFIX
Property suffix for references to other beans in the current BeanFactory: e.g. owner.dog(ref)=fido. Whether this is a reference to a singleton or a prototype will depend on the definition of the target bean.

See Also:
Constant Field Values

REF_PREFIX

public static final String REF_PREFIX
Prefix before values referencing other beans.

See Also:
Constant Field Values

CONSTRUCTOR_ARG_PREFIX

public static final String CONSTRUCTOR_ARG_PREFIX
Prefix used to denote a constructor argument definition.

See Also:
Constant Field Values
Constructor Detail

PropertiesBeanDefinitionReader

public PropertiesBeanDefinitionReader(BeanDefinitionRegistry registry)
Create new PropertiesBeanDefinitionReader for the given bean factory.

Parameters:
registry - the BeanFactory to load bean definitions into, in the form of a BeanDefinitionRegistry
Method Detail

setDefaultParentBean

public void setDefaultParentBean(String defaultParentBean)
Set the default parent bean for this bean factory. If a child bean definition handled by this factory provides neither a parent nor a class attribute, this default value gets used.

Can be used e.g. for view definition files, to define a parent with a default view class and common attributes for all views. View definitions that define their own parent or carry their own class can still override this.

Strictly speaking, the rule that a default parent setting does not apply to a bean definition that carries a class is there for backwards compatiblity reasons. It still matches the typical use case.

getDefaultParentBean

public String getDefaultParentBean()
Return the default parent bean for this bean factory.

setPropertiesPersister

public void setPropertiesPersister(PropertiesPersister propertiesPersister)
Set the PropertiesPersister to use for parsing properties files. The default is DefaultPropertiesPersister.

See Also:
DefaultPropertiesPersister

getPropertiesPersister

public PropertiesPersister getPropertiesPersister()
Return the PropertiesPersister to use for parsing properties files.

loadBeanDefinitions

public int loadBeanDefinitions(Resource resource)
                        throws BeanDefinitionStoreException
Load bean definitions from the specified properties file, using all property keys (i.e. not filtering by prefix).

Parameters:
resource - the resource descriptor for the properties file
Returns:
the number of bean definitions found
Throws:
BeanDefinitionStoreException - in case of loading or parsing errors
See Also:
loadBeanDefinitions(org.springframework.core.io.Resource, String)

loadBeanDefinitions

public int loadBeanDefinitions(Resource resource,
                               String prefix)
                        throws BeanDefinitionStoreException
Load bean definitions from the specified properties file.

Parameters:
resource - the resource descriptor for the properties file
prefix - a filter within the keys in the map: e.g. 'beans.' (can be empty or null)
Returns:
the number of bean definitions found
Throws:
BeanDefinitionStoreException - in case of loading or parsing errors

loadBeanDefinitions

public int loadBeanDefinitions(EncodedResource encodedResource)
                        throws BeanDefinitionStoreException
Load bean definitions from the specified properties file.

Parameters:
encodedResource - the resource descriptor for the properties file, allowing to specify an encoding to use for parsing the file
Returns:
the number of bean definitions found
Throws:
BeanDefinitionStoreException - in case of loading or parsing errors

loadBeanDefinitions

public int loadBeanDefinitions(EncodedResource encodedResource,
                               String prefix)
                        throws BeanDefinitionStoreException
Load bean definitions from the specified properties file.

Parameters:
encodedResource - the resource descriptor for the properties file, allowing to specify an encoding to use for parsing the file
prefix - a filter within the keys in the map: e.g. 'beans.' (can be empty or null)
Returns:
the number of bean definitions found
Throws:
BeanDefinitionStoreException - in case of loading or parsing errors

registerBeanDefinitions

public int registerBeanDefinitions(ResourceBundle rb)
                            throws BeanDefinitionStoreException
Register bean definitions contained in a resource bundle, using all property keys (i.e. not filtering by prefix).

Parameters:
rb - the ResourceBundle to load from
Returns:
the number of bean definitions found
Throws:
BeanDefinitionStoreException - in case of loading or parsing errors
See Also:
registerBeanDefinitions(java.util.ResourceBundle, String)

registerBeanDefinitions

public int registerBeanDefinitions(ResourceBundle rb,
                                   String prefix)
                            throws BeanDefinitionStoreException
Register bean definitions contained in a ResourceBundle.

Similar syntax as for a Map. This method is useful to enable standard Java internationalization support.

Parameters:
rb - the ResourceBundle to load from
prefix - a filter within the keys in the map: e.g. 'beans.' (can be empty or null)
Returns:
the number of bean definitions found
Throws:
BeanDefinitionStoreException - in case of loading or parsing errors

registerBeanDefinitions

public int registerBeanDefinitions(Map map)
                            throws BeansException
Register bean definitions contained in a Map, using all property keys (i.e. not filtering by prefix).

Parameters:
map - Map: name -> property (String or Object). Property values will be strings if coming from a Properties file etc. Property names (keys) must be Strings. Class keys must be Strings.
Returns:
the number of bean definitions found
Throws:
BeansException - in case of loading or parsing errors
See Also:
registerBeanDefinitions(java.util.Map, String, String)

registerBeanDefinitions

public int registerBeanDefinitions(Map map,
                                   String prefix)
                            throws BeansException
Register bean definitions contained in a Map. Ignore ineligible properties.

Parameters:
map - Map name -> property (String or Object). Property values will be strings if coming from a Properties file etc. Property names (keys) must be Strings. Class keys must be Strings.
prefix - a filter within the keys in the map: e.g. 'beans.' (can be empty or null)
Returns:
the number of bean definitions found
Throws:
BeansException - in case of loading or parsing errors

registerBeanDefinitions

public int registerBeanDefinitions(Map map,
                                   String prefix,
                                   String resourceDescription)
                            throws BeansException
Register bean definitions contained in a Map. Ignore ineligible properties.

Parameters:
map - Map name -> property (String or Object). Property values will be strings if coming from a Properties file etc. Property names (keys) must be strings. Class keys must be Strings.
prefix - a filter within the keys in the map: e.g. 'beans.' (can be empty or null)
resourceDescription - description of the resource that the Map came from (for logging purposes)
Returns:
the number of bean definitions found
Throws:
BeansException - in case of loading or parsing errors
See Also:
registerBeanDefinitions(Map, String)

registerBeanDefinition

protected void registerBeanDefinition(String beanName,
                                      Map<?,?> map,
                                      String prefix,
                                      String resourceDescription)
                               throws BeansException
Get all property values, given a prefix (which will be stripped) and add the bean they define to the factory with the given name

Parameters:
beanName - name of the bean to define
map - Map containing string pairs
prefix - prefix of each entry, which will be stripped
resourceDescription - description of the resource that the Map came from (for logging purposes)
Throws:
BeansException - if the bean definition could not be parsed or registered
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ReplaceOverride

org.springframework.beans.factory.support
Class ReplaceOverride

java.lang.Object
    extended by  org.springframework.beans.factory.support.MethodOverride
        extended by  org.springframework.beans.factory.support.ReplaceOverride
All Implemented Interfaces:
BeanMetadataElement
public class ReplaceOverride
extends MethodOverride

Extension of MethodOverride that represents an arbitrary override of a method by the IoC container.

Any non-final method can be overridden, irrespective of its parameters and return types.

Since:
1.1
Author:
Rod Johnson, Juergen Hoeller

Constructor Summary
ReplaceOverride(String methodName, String methodReplacerBeanName)
Construct a new ReplaceOverride.
Method Summary
void | addTypeIdentifier(String identifier) Add a fragment of a class string, like "Exception" or "java.lang.Exc", to identify a parameter type.
boolean | equals(Object other)
String | getMethodReplacerBeanName() Return the name of the bean implementing MethodReplacer.
int | hashCode()
boolean | matches(Method method) Subclasses must override this to indicate whether they match the given method.
String | toString()
Methods inherited from class org.springframework.beans.factory.support.MethodOverride
getMethodName, getSource, isOverloaded, setOverloaded, setSource
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

ReplaceOverride

public ReplaceOverride(String methodName,
                       String methodReplacerBeanName)
Construct a new ReplaceOverride.

Parameters:
methodName - the name of the method to override
methodReplacerBeanName - the bean name of the MethodReplacer
Method Detail

getMethodReplacerBeanName

public String getMethodReplacerBeanName()
Return the name of the bean implementing MethodReplacer.

addTypeIdentifier

public void addTypeIdentifier(String identifier)
Add a fragment of a class string, like "Exception" or "java.lang.Exc", to identify a parameter type.

Parameters:
identifier - a substring of the fully qualified class name

matches

public boolean matches(Method method)
Description copied from class: MethodOverride
Subclasses must override this to indicate whether they match the given method. This allows for argument list checking as well as method name checking.

Specified by:
matches in class MethodOverride
Parameters:
method - the method to check
Returns:
whether this override matches the given method

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object other)
Overrides:
equals in class MethodOverride

hashCode

public int hashCode()
Overrides:
hashCode in class MethodOverride
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RootBeanDefinition

org.springframework.beans.factory.support
Class RootBeanDefinition

java.lang.Object
    extended by  org.springframework.core.AttributeAccessorSupport
        extended by  org.springframework.beans.BeanMetadataAttributeAccessor
            extended by  org.springframework.beans.factory.support.AbstractBeanDefinition
                extended by  org.springframework.beans.factory.support.RootBeanDefinition
All Implemented Interfaces:
Serializable, Cloneable, BeanMetadataElement, BeanDefinition, AttributeAccessor
public class RootBeanDefinition
extends AbstractBeanDefinition

A root bean definition represents the merged bean definition that backs a specific bean in a Spring BeanFactory at runtime. It might have been created from multiple original bean definitions that inherit from each other, typically registered as GenericBeanDefinitions. A root bean definition is essentially the 'unified' bean definition view at runtime.

Root bean definitions may also be used for registering individual bean definitions in the configuration phase. However, since Spring 2.5, the preferred way to register bean definitions programmatically is the GenericBeanDefinition class. GenericBeanDefinition has the advantage that it allows to dynamically define parent dependencies, not 'hard-coding' the role as a root bean definition.

Author:
Rod Johnson, Juergen Hoeller
See Also:
GenericBeanDefinition, ChildBeanDefinition, Serialized Form

Field Summary
Fields inherited from class org.springframework.beans.factory.support.AbstractBeanDefinition
AUTOWIRE_AUTODETECT, AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_CONSTRUCTOR, AUTOWIRE_NO, DEPENDENCY_CHECK_ALL, DEPENDENCY_CHECK_NONE, DEPENDENCY_CHECK_OBJECTS, DEPENDENCY_CHECK_SIMPLE, SCOPE_DEFAULT
Fields inherited from interface org.springframework.beans.factory.config.BeanDefinition
ROLE_APPLICATION, ROLE_INFRASTRUCTURE, ROLE_SUPPORT, SCOPE_PROTOTYPE, SCOPE_SINGLETON
Constructor Summary
RootBeanDefinition()
Create a new RootBeanDefinition, to be configured through its bean properties and configuration methods.
RootBeanDefinition(Class beanClass)
Create a new RootBeanDefinition for a singleton.
RootBeanDefinition(Class beanClass, boolean singleton)
Deprecated. since Spring 2.5, in favor of AbstractBeanDefinition.setScope(java.lang.String)
RootBeanDefinition(Class beanClass, ConstructorArgumentValues cargs, MutablePropertyValues pvs)
Create a new RootBeanDefinition for a singleton, providing constructor arguments and property values.
RootBeanDefinition(Class beanClass, int autowireMode)
Deprecated. as of Spring 3.0, in favor of AbstractBeanDefinition.setAutowireMode(int) usage
RootBeanDefinition(Class beanClass, int autowireMode, boolean dependencyCheck)
Create a new RootBeanDefinition for a singleton, using the given autowire mode.
RootBeanDefinition(Class beanClass, MutablePropertyValues pvs)
Deprecated. as of Spring 3.0, in favor of AbstractBeanDefinition.getPropertyValues() usage
RootBeanDefinition(Class beanClass, MutablePropertyValues pvs, boolean singleton)
Deprecated. since Spring 2.5, in favor of AbstractBeanDefinition.setScope(java.lang.String)
RootBeanDefinition(RootBeanDefinition original)
Create a new RootBeanDefinition as deep copy of the given bean definition.
RootBeanDefinition(String beanClassName)
Create a new RootBeanDefinition for a singleton, providing constructor arguments and property values.
RootBeanDefinition(String beanClassName, ConstructorArgumentValues cargs, MutablePropertyValues pvs)
Create a new RootBeanDefinition for a singleton, providing constructor arguments and property values.
Method Summary
RootBeanDefinition | cloneBeanDefinition() Clone this bean definition.
boolean | equals(Object other)
BeanDefinitionHolder | getDecoratedDefinition()
String | getParentName() Return the name of the parent definition of this bean definition, if any.
Method | getResolvedFactoryMethod() Return the resolved factory method as a Java Method object, if available.
boolean | isExternallyManagedConfigMember(Member configMember)
boolean | isExternallyManagedDestroyMethod(String destroyMethod)
boolean | isExternallyManagedInitMethod(String initMethod)
boolean | isFactoryMethod(Method candidate) Check whether the given candidate qualifies as a factory method.
void | registerExternallyManagedConfigMember(Member configMember)
void | registerExternallyManagedDestroyMethod(String destroyMethod)
void | registerExternallyManagedInitMethod(String initMethod)
void | setDecoratedDefinition(BeanDefinitionHolder decoratedDefinition)
void | setParentName(String parentName) Set the name of the parent definition of this bean definition, if any.
void | setUniqueFactoryMethodName(String name) Specify a factory method name that refers to a non-overloaded method.
String | toString()
Methods inherited from class org.springframework.beans.factory.support.AbstractBeanDefinition
addQualifier, applyDefaults, clone, copyQualifiersFrom, getAutowireMode, getBeanClass, getBeanClassName, getConstructorArgumentValues, getDependencyCheck, getDependsOn, getDescription, getDestroyMethodName, getFactoryBeanName, getFactoryMethodName, getInitMethodName, getMethodOverrides, getOriginatingBeanDefinition, getPropertyValues, getQualifier, getQualifiers, getResolvedAutowireMode, getResource, getResourceDescription, getRole, getScope, hasBeanClass, hasConstructorArgumentValues, hashCode, hasQualifier, isAbstract, isAutowireCandidate, isEnforceDestroyMethod, isEnforceInitMethod, isLazyInit, isLenientConstructorResolution, isNonPublicAccessAllowed, isPrimary, isPrototype, isSingleton, isSynthetic, overrideFrom, overrideFrom, prepareMethodOverride, prepareMethodOverrides, resolveBeanClass, setAbstract, setAutowireCandidate, setAutowireMode, setBeanClass, setBeanClassName, setConstructorArgumentValues, setDependencyCheck, setDependsOn, setDescription, setDestroyMethodName, setEnforceDestroyMethod, setEnforceInitMethod, setFactoryBeanName, setFactoryMethodName, setInitMethodName, setLazyInit, setLenientConstructorResolution, setMethodOverrides, setNonPublicAccessAllowed, setOriginatingBeanDefinition, setPrimary, setPropertyValues, setResource, setResourceDescription, setRole, setScope, setSingleton, setSynthetic, validate
Methods inherited from class org.springframework.beans.BeanMetadataAttributeAccessor
addMetadataAttribute, getAttribute, getMetadataAttribute, getSource, removeAttribute, setAttribute, setSource
Methods inherited from class org.springframework.core.AttributeAccessorSupport
attributeNames, copyAttributesFrom, hasAttribute
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.core.AttributeAccessor
attributeNames, getAttribute, hasAttribute, removeAttribute, setAttribute
Methods inherited from interface org.springframework.beans.BeanMetadataElement
getSource

Constructor Detail

RootBeanDefinition

public RootBeanDefinition()
Create a new RootBeanDefinition, to be configured through its bean properties and configuration methods.

See Also:
AbstractBeanDefinition.setBeanClass(java.lang.Class),
AbstractBeanDefinition.setBeanClassName(java.lang.String),
AbstractBeanDefinition.setScope(java.lang.String),
AbstractBeanDefinition.setAutowireMode(int),
AbstractBeanDefinition.setDependencyCheck(int),
AbstractBeanDefinition.setConstructorArgumentValues(org.springframework.beans.factory.config.ConstructorArgumentValues),
AbstractBeanDefinition.setPropertyValues(org.springframework.beans.MutablePropertyValues)

RootBeanDefinition

public RootBeanDefinition(Class beanClass)
Create a new RootBeanDefinition for a singleton.

Parameters:
beanClass - the class of the bean to instantiate

RootBeanDefinition

@Deprecated
public RootBeanDefinition(Class beanClass,
                                     boolean singleton)
Deprecated. since Spring 2.5, in favor of AbstractBeanDefinition.setScope(java.lang.String)

Create a new RootBeanDefinition with the given singleton status.

Parameters:
beanClass - the class of the bean to instantiate
singleton - the singleton status of the bean

RootBeanDefinition

@Deprecated
public RootBeanDefinition(Class beanClass,
                                     int autowireMode)
Deprecated. as of Spring 3.0, in favor of AbstractBeanDefinition.setAutowireMode(int) usage

Create a new RootBeanDefinition for a singleton, using the given autowire mode.

Parameters:
beanClass - the class of the bean to instantiate
autowireMode - by name or type, using the constants in this interface

RootBeanDefinition

public RootBeanDefinition(Class beanClass,
                          int autowireMode,
                          boolean dependencyCheck)
Create a new RootBeanDefinition for a singleton, using the given autowire mode.

Parameters:
beanClass - the class of the bean to instantiate
autowireMode - by name or type, using the constants in this interface
dependencyCheck - whether to perform a dependency check for objects (not applicable to autowiring a constructor, thus ignored there)

RootBeanDefinition

@Deprecated
public RootBeanDefinition(Class beanClass,
                                     MutablePropertyValues pvs)
Deprecated. as of Spring 3.0, in favor of AbstractBeanDefinition.getPropertyValues() usage

Create a new RootBeanDefinition for a singleton, providing property values.

Parameters:
beanClass - the class of the bean to instantiate
pvs - the property values to apply

RootBeanDefinition

@Deprecated
public RootBeanDefinition(Class beanClass,
                                     MutablePropertyValues pvs,
                                     boolean singleton)
Deprecated. since Spring 2.5, in favor of AbstractBeanDefinition.setScope(java.lang.String)

Create a new RootBeanDefinition with the given singleton status, providing property values.

Parameters:
beanClass - the class of the bean to instantiate
pvs - the property values to apply
singleton - the singleton status of the bean

RootBeanDefinition

public RootBeanDefinition(Class beanClass,
                          ConstructorArgumentValues cargs,
                          MutablePropertyValues pvs)
Create a new RootBeanDefinition for a singleton, providing constructor arguments and property values.

Parameters:
beanClass - the class of the bean to instantiate
cargs - the constructor argument values to apply
pvs - the property values to apply

RootBeanDefinition

public RootBeanDefinition(String beanClassName)
Create a new RootBeanDefinition for a singleton, providing constructor arguments and property values.

Takes a bean class name to avoid eager loading of the bean class.

Parameters:
beanClassName - the name of the class to instantiate

RootBeanDefinition

public RootBeanDefinition(String beanClassName,
                          ConstructorArgumentValues cargs,
                          MutablePropertyValues pvs)
Create a new RootBeanDefinition for a singleton, providing constructor arguments and property values.

Takes a bean class name to avoid eager loading of the bean class.

Parameters:
beanClassName - the name of the class to instantiate
cargs - the constructor argument values to apply
pvs - the property values to apply

RootBeanDefinition

public RootBeanDefinition(RootBeanDefinition original)
Create a new RootBeanDefinition as deep copy of the given bean definition.

Parameters:
original - the original bean definition to copy from
Method Detail

getParentName

public String getParentName()
Description copied from interface: BeanDefinition
Return the name of the parent definition of this bean definition, if any.

setParentName

public void setParentName(String parentName)
Description copied from interface: BeanDefinition
Set the name of the parent definition of this bean definition, if any.

setUniqueFactoryMethodName

public void setUniqueFactoryMethodName(String name)
Specify a factory method name that refers to a non-overloaded method.

isFactoryMethod

public boolean isFactoryMethod(Method candidate)
Check whether the given candidate qualifies as a factory method.

getResolvedFactoryMethod

public Method getResolvedFactoryMethod()
Return the resolved factory method as a Java Method object, if available.

Returns:
the factory method, or null if not found or not resolved yet

registerExternallyManagedConfigMember

public void registerExternallyManagedConfigMember(Member configMember)

isExternallyManagedConfigMember

public boolean isExternallyManagedConfigMember(Member configMember)

registerExternallyManagedInitMethod

public void registerExternallyManagedInitMethod(String initMethod)

isExternallyManagedInitMethod

public boolean isExternallyManagedInitMethod(String initMethod)

registerExternallyManagedDestroyMethod

public void registerExternallyManagedDestroyMethod(String destroyMethod)

isExternallyManagedDestroyMethod

public boolean isExternallyManagedDestroyMethod(String destroyMethod)

setDecoratedDefinition

public void setDecoratedDefinition(BeanDefinitionHolder decoratedDefinition)

getDecoratedDefinition

public BeanDefinitionHolder getDecoratedDefinition()

cloneBeanDefinition

public RootBeanDefinition cloneBeanDefinition()
Description copied from class: AbstractBeanDefinition
Clone this bean definition. To be implemented by concrete subclasses.

Specified by:
cloneBeanDefinition in class AbstractBeanDefinition
Returns:
the cloned bean definition object

equals

public boolean equals(Object other)
Overrides:
equals in class AbstractBeanDefinition

toString

public String toString()
Overrides:
toString in class AbstractBeanDefinition
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleAutowireCandidateResolver

org.springframework.beans.factory.support
Class SimpleAutowireCandidateResolver

java.lang.Object
    extended by  org.springframework.beans.factory.support.SimpleAutowireCandidateResolver
All Implemented Interfaces:
AutowireCandidateResolver
public class SimpleAutowireCandidateResolver
extends Object
implements AutowireCandidateResolver

AutowireCandidateResolver implementation to use when no annotation support is available. This implementation checks the bean definition only.

Since:
2.5
Author:
Mark Fisher, Juergen Hoeller
See Also:
BeanDefinition.isAutowireCandidate()

Constructor Summary
SimpleAutowireCandidateResolver()
Method Summary
Object | getSuggestedValue(DependencyDescriptor descriptor) Determine whether a default value is suggested for the given dependency.
boolean | isAutowireCandidate(BeanDefinitionHolder bdHolder, DependencyDescriptor descriptor) Determine if the provided bean definition is an autowire candidate.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleAutowireCandidateResolver

public SimpleAutowireCandidateResolver()
Method Detail

isAutowireCandidate

public boolean isAutowireCandidate(BeanDefinitionHolder bdHolder,
                                   DependencyDescriptor descriptor)
Determine if the provided bean definition is an autowire candidate.

To be considered a candidate the bean's autowire-candidate attribute must not have been set to 'false'.

Specified by:
isAutowireCandidate in interface AutowireCandidateResolver
Parameters:
bdHolder - the bean definition including bean name and aliases
descriptor - the descriptor for the target method parameter or field
Returns:
whether the bean definition qualifies as autowire candidate

getSuggestedValue

public Object getSuggestedValue(DependencyDescriptor descriptor)
Description copied from interface: AutowireCandidateResolver
Determine whether a default value is suggested for the given dependency.

Specified by:
getSuggestedValue in interface AutowireCandidateResolver
Parameters:
descriptor - the descriptor for the target method parameter or field
Returns:
the value suggested (typically an expression String), or null if none found
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleBeanDefinitionRegistry

org.springframework.beans.factory.support
Class SimpleBeanDefinitionRegistry

java.lang.Object
    extended by  org.springframework.core.SimpleAliasRegistry
        extended by  org.springframework.beans.factory.support.SimpleBeanDefinitionRegistry
All Implemented Interfaces:
BeanDefinitionRegistry, AliasRegistry
public class SimpleBeanDefinitionRegistry
extends SimpleAliasRegistry
implements BeanDefinitionRegistry

Simple implementation of the BeanDefinitionRegistry interface. Provides registry capabilities only, with no factory capabilities built in. Can for example be used for testing bean definition readers.

Since:
2.5.2
Author:
Juergen Hoeller

Constructor Summary
SimpleBeanDefinitionRegistry()
Method Summary
boolean | containsBeanDefinition(String beanName) Check if this registry contains a bean definition with the given name.
BeanDefinition | getBeanDefinition(String beanName) Return the BeanDefinition for the given bean name.
int | getBeanDefinitionCount() Return the number of beans defined in the registry.
String[] | getBeanDefinitionNames() Return the names of all beans defined in this registry.
boolean | isBeanNameInUse(String beanName) Determine whether the given bean name is already in use within this registry, i.e.
void | registerBeanDefinition(String beanName, BeanDefinition beanDefinition) Register a new bean definition with this registry.
void | removeBeanDefinition(String beanName) Remove the BeanDefinition for the given name.
Methods inherited from class org.springframework.core.SimpleAliasRegistry
allowAliasOverriding, canonicalName, getAliases, isAlias, registerAlias, removeAlias, resolveAliases
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.core.AliasRegistry
getAliases, isAlias, registerAlias, removeAlias

Constructor Detail

SimpleBeanDefinitionRegistry

public SimpleBeanDefinitionRegistry()
Method Detail

registerBeanDefinition

public void registerBeanDefinition(String beanName,
                                   BeanDefinition beanDefinition)
                            throws BeanDefinitionStoreException
Description copied from interface: BeanDefinitionRegistry
Register a new bean definition with this registry. Must support RootBeanDefinition and ChildBeanDefinition.

Specified by:
registerBeanDefinition in interface BeanDefinitionRegistry
Parameters:
beanName - the name of the bean instance to register
beanDefinition - definition of the bean instance to register
Throws:
BeanDefinitionStoreException - if the BeanDefinition is invalid or if there is already a BeanDefinition for the specified bean name (and we are not allowed to override it)
See Also:
RootBeanDefinition, ChildBeanDefinition

removeBeanDefinition

public void removeBeanDefinition(String beanName)
                          throws NoSuchBeanDefinitionException
Description copied from interface: BeanDefinitionRegistry
Remove the BeanDefinition for the given name.

Specified by:
removeBeanDefinition in interface BeanDefinitionRegistry
Parameters:
beanName - the name of the bean instance to register
Throws:
NoSuchBeanDefinitionException - if there is no such bean definition

getBeanDefinition

public BeanDefinition getBeanDefinition(String beanName)
                                 throws NoSuchBeanDefinitionException
Description copied from interface: BeanDefinitionRegistry
Return the BeanDefinition for the given bean name.

Specified by:
getBeanDefinition in interface BeanDefinitionRegistry
Parameters:
beanName - name of the bean to find a definition for
Returns:
the BeanDefinition for the given name (never null)
Throws:
NoSuchBeanDefinitionException - if there is no such bean definition

containsBeanDefinition

public boolean containsBeanDefinition(String beanName)
Description copied from interface: BeanDefinitionRegistry
Check if this registry contains a bean definition with the given name.

Specified by:
containsBeanDefinition in interface BeanDefinitionRegistry
Parameters:
beanName - the name of the bean to look for
Returns:
if this registry contains a bean definition with the given name

getBeanDefinitionNames

public String[] getBeanDefinitionNames()
Description copied from interface: BeanDefinitionRegistry
Return the names of all beans defined in this registry.

Specified by:
getBeanDefinitionNames in interface BeanDefinitionRegistry
Returns:
the names of all beans defined in this registry, or an empty array if none defined

getBeanDefinitionCount

public int getBeanDefinitionCount()
Description copied from interface: BeanDefinitionRegistry
Return the number of beans defined in the registry.

Specified by:
getBeanDefinitionCount in interface BeanDefinitionRegistry
Returns:
the number of beans defined in the registry

isBeanNameInUse

public boolean isBeanNameInUse(String beanName)
Description copied from interface: BeanDefinitionRegistry
Determine whether the given bean name is already in use within this registry, i.e. whether there is a local bean or alias registered under this name.

Specified by:
isBeanNameInUse in interface BeanDefinitionRegistry
Parameters:
beanName - the name to check
Returns:
whether the given bean name is already in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleInstantiationStrategy

org.springframework.beans.factory.support
Class SimpleInstantiationStrategy

java.lang.Object
    extended by  org.springframework.beans.factory.support.SimpleInstantiationStrategy
All Implemented Interfaces:
InstantiationStrategy
Direct Known Subclasses:
CglibSubclassingInstantiationStrategy
public class SimpleInstantiationStrategy
extends Object
implements InstantiationStrategy

Simple object instantiation strategy for use in a BeanFactory.

Does not support Method Injection, although it provides hooks for subclasses to override to add Method Injection support, for example by overriding methods.

Since:
1.1
Author:
Rod Johnson, Juergen Hoeller

Constructor Summary
SimpleInstantiationStrategy()
Method Summary
Object | instantiate(RootBeanDefinition beanDefinition, String beanName, BeanFactory owner) Return an instance of the bean with the given name in this factory.
Object | instantiate(RootBeanDefinition beanDefinition, String beanName, BeanFactory owner, Constructor ctor, Object[] args) Return an instance of the bean with the given name in this factory, creating it via the given constructor.
Object | instantiate(RootBeanDefinition beanDefinition, String beanName, BeanFactory owner, Object factoryBean, Method factoryMethod, Object[] args) Return an instance of the bean with the given name in this factory, creating it via the given factory method.
protected Object | instantiateWithMethodInjection(RootBeanDefinition beanDefinition, String beanName, BeanFactory owner) Subclasses can override this method, which is implemented to throw UnsupportedOperationException, if they can instantiate an object with the Method Injection specified in the given RootBeanDefinition.
protected Object | instantiateWithMethodInjection(RootBeanDefinition beanDefinition, String beanName, BeanFactory owner, Constructor ctor, Object[] args) Subclasses can override this method, which is implemented to throw UnsupportedOperationException, if they can instantiate an object with the Method Injection specified in the given RootBeanDefinition.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleInstantiationStrategy

public SimpleInstantiationStrategy()
Method Detail

instantiate

public Object instantiate(RootBeanDefinition beanDefinition,
                          String beanName,
                          BeanFactory owner)
Description copied from interface: InstantiationStrategy
Return an instance of the bean with the given name in this factory.

Specified by:
instantiate in interface InstantiationStrategy
Parameters:
beanDefinition - the bean definition
beanName - name of the bean when it's created in this context. The name can be null if we're autowiring a bean that doesn't belong to the factory.
owner - owning BeanFactory
Returns:
a bean instance for this bean definition

instantiateWithMethodInjection

protected Object instantiateWithMethodInjection(RootBeanDefinition beanDefinition,
                                                String beanName,
                                                BeanFactory owner)
Subclasses can override this method, which is implemented to throw UnsupportedOperationException, if they can instantiate an object with the Method Injection specified in the given RootBeanDefinition. Instantiation should use a no-arg constructor.

instantiate

public Object instantiate(RootBeanDefinition beanDefinition,
                          String beanName,
                          BeanFactory owner,
                          Constructor ctor,
                          Object[] args)
Description copied from interface: InstantiationStrategy
Return an instance of the bean with the given name in this factory, creating it via the given constructor.

Specified by:
instantiate in interface InstantiationStrategy
Parameters:
beanDefinition - the bean definition
beanName - name of the bean when it's created in this context. The name can be null if we're autowiring a bean that doesn't belong to the factory.
owner - owning BeanFactory
ctor - the constructor to use
args - the constructor arguments to apply
Returns:
a bean instance for this bean definition

instantiateWithMethodInjection

protected Object instantiateWithMethodInjection(RootBeanDefinition beanDefinition,
                                                String beanName,
                                                BeanFactory owner,
                                                Constructor ctor,
                                                Object[] args)
Subclasses can override this method, which is implemented to throw UnsupportedOperationException, if they can instantiate an object with the Method Injection specified in the given RootBeanDefinition. Instantiation should use the given constructor and parameters.

instantiate

public Object instantiate(RootBeanDefinition beanDefinition,
                          String beanName,
                          BeanFactory owner,
                          Object factoryBean,
                          Method factoryMethod,
                          Object[] args)
Description copied from interface: InstantiationStrategy
Return an instance of the bean with the given name in this factory, creating it via the given factory method.

Specified by:
instantiate in interface InstantiationStrategy
Parameters:
beanDefinition - bean definition
beanName - name of the bean when it's created in this context. The name can be null if we're autowiring a bean that doesn't belong to the factory.
owner - owning BeanFactory
factoryBean - the factory bean instance to call the factory method on, or null in case of a static factory method
factoryMethod - the factory method to use
args - the factory method arguments to apply
Returns:
a bean instance for this bean definition
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleSecurityContextProvider

org.springframework.beans.factory.support
Class SimpleSecurityContextProvider

java.lang.Object
    extended by  org.springframework.beans.factory.support.SimpleSecurityContextProvider
All Implemented Interfaces:
SecurityContextProvider
public class SimpleSecurityContextProvider
extends Object
implements SecurityContextProvider

Simple SecurityContextProvider implementation.

Since:
3.0
Author:
Costin Leau

Constructor Summary
SimpleSecurityContextProvider()
Construct a new SimpleSecurityContextProvider instance.
SimpleSecurityContextProvider(AccessControlContext acc)
Construct a new SimpleSecurityContextProvider instance.
Method Summary
 AccessControlContext getAccessControlContext()
Provides a security access control context relevant to a bean factory.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleSecurityContextProvider

public SimpleSecurityContextProvider()
Construct a new SimpleSecurityContextProvider instance.

The security context will be retrieved on each call from the current thread.

SimpleSecurityContextProvider

public SimpleSecurityContextProvider(AccessControlContext acc)
Construct a new SimpleSecurityContextProvider instance.

If the given control context is null, the security context will be retrieved on each call from the current thread.

Parameters:
acc - access control context (can be null)
See Also:
AccessController.getContext()
Method Detail

getAccessControlContext

public AccessControlContext getAccessControlContext()
Description copied from interface: SecurityContextProvider
Provides a security access control context relevant to a bean factory.

Specified by:
getAccessControlContext in interface SecurityContextProvider
Returns:
bean factory security control context
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StaticListableBeanFactory

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.beans.factory.support
Class StaticListableBeanFactory

java.lang.Object
    extended by  org.springframework.beans.factory.support.StaticListableBeanFactory
All Implemented Interfaces:
BeanFactory, ListableBeanFactory
public class StaticListableBeanFactory
extends Object
implements ListableBeanFactory

Static BeanFactory implementation which allows to register existing singleton instances programmatically. Does not have support for prototype beans or aliases.

Serves as example for a simple implementation of the ListableBeanFactory interface, managing existing bean instances rather than creating new ones based on bean definitions, and not implementing any extended SPI interfaces (such as ConfigurableBeanFactory).

For a full-fledged factory based on bean definitions, have a look at DefaultListableBeanFactory.

Since:
06.01.2003
Author:
Rod Johnson, Juergen Hoeller
See Also:
DefaultListableBeanFactory

Field Summary
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Constructor Summary
StaticListableBeanFactory()
Method Summary
 void addBean(String name, Object bean)
Add a new singleton bean.
 boolean containsBean(String name)
Does this bean factory contain a bean with the given name? More specifically, is BeanFactory.getBean(java.lang.String) able to obtain a bean instance for the given name?
 boolean containsBeanDefinition(String name)
Check if this bean factory contains a bean definition with the given name.
<A extends Annotation>
A
findAnnotationOnBean(String beanName, Class<A> annotationType)
Find a Annotation of annotationType on the specified bean, traversing its interfaces and super classes if no annotation can be found on the given class itself.
 String[] getAliases(String name)
Return the aliases for the given bean name, if any.
<T> T
getBean(Class<T> requiredType)
Return the bean instance that uniquely matches the given object type, if any.
 Object getBean(String name)
Return an instance, which may be shared or independent, of the specified bean.
<T> T
getBean(String name, Class<T> requiredType)
Return an instance, which may be shared or independent, of the specified bean.
 Object getBean(String name, Object... args)
Return an instance, which may be shared or independent, of the specified bean.
 int getBeanDefinitionCount()
Return the number of beans defined in the factory.
 String[] getBeanDefinitionNames()
Return the names of all beans defined in this factory.
 String[] getBeanNamesForType(Class type)
Return the names of beans matching the given type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.
 String[] getBeanNamesForType(Class type, boolean includeNonSingletons, boolean includeFactoryBeans)
Return the names of beans matching the given type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.
<T> Map<String,T>
getBeansOfType(Class<T> type)
Return the bean instances that match the given object type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.
<T> Map<String,T>
getBeansOfType(Class<T> type, boolean includeNonSingletons, boolean includeFactoryBeans)
Return the bean instances that match the given object type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.
 Map<String,Object> getBeansWithAnnotation(Class<? extends Annotation> annotationType)
Find all beans whose Class has the supplied Annotation type.
 Class<?> getType(String name)
Determine the type of the bean with the given name.
 boolean isPrototype(String name)
Is this bean a prototype? That is, will BeanFactory.getBean(java.lang.String) always return independent instances?
 boolean isSingleton(String name)
Is this bean a shared singleton? That is, will BeanFactory.getBean(java.lang.String) always return the same instance?
 boolean isTypeMatch(String name, Class targetType)
Check whether the bean with the given name matches the specified type.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

StaticListableBeanFactory

public StaticListableBeanFactory()
Method Detail

addBean

public void addBean(String name,
                    Object bean)
Add a new singleton bean. Will overwrite any existing instance for the given name.

Parameters:
name - the name of the bean
bean - the bean instance

getBean

public Object getBean(String name)
               throws BeansException
Description copied from interface: BeanFactory
Return an instance, which may be shared or independent, of the specified bean.

This method allows a Spring BeanFactory to be used as a replacement for the Singleton or Prototype design pattern. Callers may retain references to returned objects in the case of Singleton beans.

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Specified by:
getBean in interface BeanFactory
Parameters:
name - the name of the bean to retrieve
Returns:
an instance of the bean
Throws:
NoSuchBeanDefinitionException - if there is no bean definition with the specified name
BeansException - if the bean could not be obtained

getBean

public <T> T getBean(String name,
                     Class<T> requiredType)
          throws BeansException
Description copied from interface: BeanFactory
Return an instance, which may be shared or independent, of the specified bean.

Behaves the same as BeanFactory.getBean(String), but provides a measure of type safety by throwing a BeanNotOfRequiredTypeException if the bean is not of the required type. This means that ClassCastException can't be thrown on casting the result correctly, as can happen with BeanFactory.getBean(String).

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Specified by:
getBean in interface BeanFactory
Parameters:
name - the name of the bean to retrieve
requiredType - type the bean must match. Can be an interface or superclass of the actual class, or null for any match. For example, if the value is Object.class, this method will succeed whatever the class of the returned instance.
Returns:
an instance of the bean
Throws:
NoSuchBeanDefinitionException - if there's no such bean definition
BeanNotOfRequiredTypeException - if the bean is not of the required type
BeansException - if the bean could not be created

getBean

public <T> T getBean(Class<T> requiredType)
          throws BeansException
Description copied from interface: BeanFactory
Return the bean instance that uniquely matches the given object type, if any.

Specified by:
getBean in interface BeanFactory
Parameters:
requiredType - type the bean must match; can be an interface or superclass. null is disallowed.

This method goes into ListableBeanFactory by-type lookup territory but may also be translated into a conventional by-name lookup based on the name of the given type. For more extensive retrieval operations across sets of beans, use ListableBeanFactory and/or BeanFactoryUtils.

Returns:
an instance of the single bean matching the required type
Throws:
NoSuchBeanDefinitionException - if there is not exactly one matching bean found
BeansException
See Also:
ListableBeanFactory

getBean

public Object getBean(String name,
                      Object... args)
               throws BeansException
Description copied from interface: BeanFactory
Return an instance, which may be shared or independent, of the specified bean.

Allows for specifying explicit constructor arguments / factory method arguments, overriding the specified default arguments (if any) in the bean definition.

Specified by:
getBean in interface BeanFactory
Parameters:
name - the name of the bean to retrieve
args - arguments to use if creating a prototype using explicit arguments to a static factory method. It is invalid to use a non-null args value in any other case.
Returns:
an instance of the bean
Throws:
NoSuchBeanDefinitionException - if there's no such bean definition
BeanDefinitionStoreException - if arguments have been given but the affected bean isn't a prototype
BeansException - if the bean could not be created

containsBean

public boolean containsBean(String name)
Description copied from interface: BeanFactory
Does this bean factory contain a bean with the given name? More specifically, is BeanFactory.getBean(java.lang.String) able to obtain a bean instance for the given name?

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Specified by:
containsBean in interface BeanFactory
Parameters:
name - the name of the bean to query
Returns:
whether a bean with the given name is defined

isSingleton

public boolean isSingleton(String name)
                    throws NoSuchBeanDefinitionException
Description copied from interface: BeanFactory
Is this bean a shared singleton? That is, will BeanFactory.getBean(java.lang.String) always return the same instance?

Note: This method returning false does not clearly indicate independent instances. It indicates non-singleton instances, which may correspond to a scoped bean as well. Use the BeanFactory.isPrototype(java.lang.String) operation to explicitly check for independent instances.

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Specified by:
isSingleton in interface BeanFactory
Parameters:
name - the name of the bean to query
Returns:
whether this bean corresponds to a singleton instance
Throws:
NoSuchBeanDefinitionException - if there is no bean with the given name
See Also:
BeanFactory.getBean(java.lang.String), BeanFactory.isPrototype(java.lang.String)

isPrototype

public boolean isPrototype(String name)
                    throws NoSuchBeanDefinitionException
Description copied from interface: BeanFactory
Is this bean a prototype? That is, will BeanFactory.getBean(java.lang.String) always return independent instances?

Note: This method returning false does not clearly indicate a singleton object. It indicates non-independent instances, which may correspond to a scoped bean as well. Use the BeanFactory.isSingleton(java.lang.String) operation to explicitly check for a shared singleton instance.

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Specified by:
isPrototype in interface BeanFactory
Parameters:
name - the name of the bean to query
Returns:
whether this bean will always deliver independent instances
Throws:
NoSuchBeanDefinitionException - if there is no bean with the given name
See Also:
BeanFactory.getBean(java.lang.String), BeanFactory.isSingleton(java.lang.String)

isTypeMatch

public boolean isTypeMatch(String name,
                           Class targetType)
                    throws NoSuchBeanDefinitionException
Description copied from interface: BeanFactory
Check whether the bean with the given name matches the specified type. More specifically, check whether a BeanFactory.getBean(java.lang.String) call for the given name would return an object that is assignable to the specified target type.

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Specified by:
isTypeMatch in interface BeanFactory
Parameters:
name - the name of the bean to query
targetType - the type to match against
Returns:
true if the bean type matches, false if it doesn't match or cannot be determined yet
Throws:
NoSuchBeanDefinitionException - if there is no bean with the given name
See Also:
BeanFactory.getBean(java.lang.String), BeanFactory.getType(java.lang.String)

getType

public Class<?> getType(String name)
                 throws NoSuchBeanDefinitionException
Description copied from interface: BeanFactory
Determine the type of the bean with the given name. More specifically, determine the type of object that BeanFactory.getBean(java.lang.String) would return for the given name.

For a FactoryBean, return the type of object that the FactoryBean creates, as exposed by FactoryBean.getObjectType().

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Specified by:
getType in interface BeanFactory
Parameters:
name - the name of the bean to query
Returns:
the type of the bean, or null if not determinable
Throws:
NoSuchBeanDefinitionException - if there is no bean with the given name
See Also:
BeanFactory.getBean(java.lang.String), BeanFactory.isTypeMatch(java.lang.String, java.lang.Class)

getAliases

public String[] getAliases(String name)
Description copied from interface: BeanFactory
Return the aliases for the given bean name, if any. All of those aliases point to the same bean when used in a BeanFactory.getBean(java.lang.String) call.

If the given name is an alias, the corresponding original bean name and other aliases (if any) will be returned, with the original bean name being the first element in the array.

Will ask the parent factory if the bean cannot be found in this factory instance.

Specified by:
getAliases in interface BeanFactory
Parameters:
name - the bean name to check for aliases
Returns:
the aliases, or an empty array if none
See Also:
BeanFactory.getBean(java.lang.String)

containsBeanDefinition

public boolean containsBeanDefinition(String name)
Description copied from interface: ListableBeanFactory
Check if this bean factory contains a bean definition with the given name.

Does not consider any hierarchy this factory may participate in, and ignores any singleton beans that have been registered by other means than bean definitions.

Specified by:
containsBeanDefinition in interface ListableBeanFactory
Parameters:
name - the name of the bean to look for
Returns:
if this bean factory contains a bean definition with the given name
See Also:
BeanFactory.containsBean(java.lang.String)

getBeanDefinitionCount

public int getBeanDefinitionCount()
Description copied from interface: ListableBeanFactory
Return the number of beans defined in the factory.

Does not consider any hierarchy this factory may participate in, and ignores any singleton beans that have been registered by other means than bean definitions.

Specified by:
getBeanDefinitionCount in interface ListableBeanFactory
Returns:
the number of beans defined in the factory

getBeanDefinitionNames

public String[] getBeanDefinitionNames()
Description copied from interface: ListableBeanFactory
Return the names of all beans defined in this factory.

Does not consider any hierarchy this factory may participate in, and ignores any singleton beans that have been registered by other means than bean definitions.

Specified by:
getBeanDefinitionNames in interface ListableBeanFactory
Returns:
the names of all beans defined in this factory, or an empty array if none defined

getBeanNamesForType

public String[] getBeanNamesForType(Class type)
Description copied from interface: ListableBeanFactory
Return the names of beans matching the given type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.

NOTE: This method introspects top-level beans only. It does not check nested beans which might match the specified type as well.

Does consider objects created by FactoryBeans, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type.

Does not consider any hierarchy this factory may participate in. Use BeanFactoryUtils' beanNamesForTypeIncludingAncestors to include beans in ancestor factories too.

Note: Does not ignore singleton beans that have been registered by other means than bean definitions.

This version of getBeanNamesForType matches all kinds of beans, be it singletons, prototypes, or FactoryBeans. In most implementations, the result will be the same as for getBeanNamesOfType(type, true, true).

Bean names returned by this method should always return bean names in the order of definition in the backend configuration, as far as possible.

Specified by:
getBeanNamesForType in interface ListableBeanFactory
Parameters:
type - the class or interface to match, or null for all bean names
Returns:
the names of beans (or objects created by FactoryBeans) matching the given object type (including subclasses), or an empty array if none
See Also:
FactoryBean.getObjectType(), BeanFactoryUtils.beanNamesForTypeIncludingAncestors(ListableBeanFactory, Class)

getBeanNamesForType

public String[] getBeanNamesForType(Class type,
                                    boolean includeNonSingletons,
                                    boolean includeFactoryBeans)
Description copied from interface: ListableBeanFactory
Return the names of beans matching the given type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.

NOTE: This method introspects top-level beans only. It does not check nested beans which might match the specified type as well.

Does consider objects created by FactoryBeans if the "allowEagerInit" flag is set, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type. If "allowEagerInit" is not set, only raw FactoryBeans will be checked (which doesn't require initialization of each FactoryBean). $ *

Does not consider any hierarchy this factory may participate in. Use BeanFactoryUtils' beanNamesForTypeIncludingAncestors to include beans in ancestor factories too.

Note: Does not ignore singleton beans that have been registered by other means than bean definitions.

Bean names returned by this method should always return bean names in the order of definition in the backend configuration, as far as possible.

Specified by:
getBeanNamesForType in interface ListableBeanFactory
Parameters:
type - the class or interface to match, or null for all bean names
includeNonSingletons - whether to include prototype or scoped beans too or just singletons (also applies to FactoryBeans)
includeFactoryBeans - whether to initialize lazy-init singletons and objects created by FactoryBeans (or by factory methods with a "factory-bean" reference) for the type check. Note that FactoryBeans need to be eagerly initialized to determine their type: So be aware that passing in "true" for this flag will initialize FactoryBeans and "factory-bean" references.
Returns:
the names of beans (or objects created by FactoryBeans) matching the given object type (including subclasses), or an empty array if none
See Also:
FactoryBean.getObjectType(), BeanFactoryUtils.beanNamesForTypeIncludingAncestors(ListableBeanFactory, Class, boolean, boolean)

getBeansOfType

public <T> Map<String,T> getBeansOfType(Class<T> type)
                             throws BeansException
Description copied from interface: ListableBeanFactory
Return the bean instances that match the given object type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.

NOTE: This method introspects top-level beans only. It does not check nested beans which might match the specified type as well.

Does consider objects created by FactoryBeans, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type.

Does not consider any hierarchy this factory may participate in. Use BeanFactoryUtils' beansOfTypeIncludingAncestors to include beans in ancestor factories too.

Note: Does not ignore singleton beans that have been registered by other means than bean definitions.

This version of getBeansOfType matches all kinds of beans, be it singletons, prototypes, or FactoryBeans. In most implementations, the result will be the same as for getBeansOfType(type, true, true).

The Map returned by this method should always return bean names and corresponding bean instances in the order of definition in the backend configuration, as far as possible.

Specified by:
getBeansOfType in interface ListableBeanFactory
Parameters:
type - the class or interface to match, or null for all concrete beans
Returns:
a Map with the matching beans, containing the bean names as keys and the corresponding bean instances as values
Throws:
BeansException - if a bean could not be created
See Also:
FactoryBean.getObjectType(), BeanFactoryUtils.beansOfTypeIncludingAncestors(ListableBeanFactory, Class)

getBeansOfType

public <T> Map<String,T> getBeansOfType(Class<T> type,
                                        boolean includeNonSingletons,
                                        boolean includeFactoryBeans)
                             throws BeansException
Description copied from interface: ListableBeanFactory
Return the bean instances that match the given object type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.

NOTE: This method introspects top-level beans only. It does not check nested beans which might match the specified type as well.

Does consider objects created by FactoryBeans if the "allowEagerInit" flag is set, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type. If "allowEagerInit" is not set, only raw FactoryBeans will be checked (which doesn't require initialization of each FactoryBean).

Does not consider any hierarchy this factory may participate in. Use BeanFactoryUtils' beansOfTypeIncludingAncestors to include beans in ancestor factories too.

Note: Does not ignore singleton beans that have been registered by other means than bean definitions.

The Map returned by this method should always return bean names and corresponding bean instances in the order of definition in the backend configuration, as far as possible.

Specified by:
getBeansOfType in interface ListableBeanFactory
Parameters:
type - the class or interface to match, or null for all concrete beans
includeNonSingletons - whether to include prototype or scoped beans too or just singletons (also applies to FactoryBeans)
includeFactoryBeans - whether to initialize lazy-init singletons and objects created by FactoryBeans (or by factory methods with a "factory-bean" reference) for the type check. Note that FactoryBeans need to be eagerly initialized to determine their type: So be aware that passing in "true" for this flag will initialize FactoryBeans and "factory-bean" references.
Returns:
a Map with the matching beans, containing the bean names as keys and the corresponding bean instances as values
Throws:
BeansException - if a bean could not be created
See Also:
FactoryBean.getObjectType(), BeanFactoryUtils.beansOfTypeIncludingAncestors(ListableBeanFactory, Class, boolean, boolean)

getBeansWithAnnotation

public Map<String,Object> getBeansWithAnnotation(Class<? extends Annotation> annotationType)
                                          throws BeansException
Description copied from interface: ListableBeanFactory
Find all beans whose Class has the supplied Annotation type.

Specified by:
getBeansWithAnnotation in interface ListableBeanFactory
Parameters:
annotationType - the type of annotation to look for
Returns:
a Map with the matching beans, containing the bean names as keys and the corresponding bean instances as values
Throws:
BeansException - if a bean could not be created

findAnnotationOnBean

public <A extends Annotation> A findAnnotationOnBean(String beanName,
                                                     Class<A> annotationType)
Description copied from interface: ListableBeanFactory
Find a Annotation of annotationType on the specified bean, traversing its interfaces and super classes if no annotation can be found on the given class itself.

Specified by:
findAnnotationOnBean in interface ListableBeanFactory
Parameters:
beanName - the name of the bean to look for annotations on
annotationType - the annotation class to look for
Returns:
the annotation of the given type found, or null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


BeanDefinitionValidationException

org.springframework.beans.factory.support
Class BeanDefinitionValidationException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.beans.BeansException
                        extended by  org.springframework.beans.FatalBeanException
                            extended by  org.springframework.beans.factory.support.BeanDefinitionValidationException
All Implemented Interfaces:
Serializable
public class BeanDefinitionValidationException
extends FatalBeanException

Exception thrown when the validation of a bean definition failed.

Since:
21.11.2003
Author:
Juergen Hoeller
See Also:
AbstractBeanDefinition.validate(), Serialized Form

Constructor Summary
BeanDefinitionValidationException(String msg)
Create a new BeanDefinitionValidationException with the specified message.
BeanDefinitionValidationException(String msg, Throwable cause)
Create a new BeanDefinitionValidationException with the specified message and root cause.
Method Summary
Methods inherited from class org.springframework.beans.BeansException
equals, hashCode
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

BeanDefinitionValidationException

public BeanDefinitionValidationException(String msg)
Create a new BeanDefinitionValidationException with the specified message.

Parameters:
msg - the detail message

BeanDefinitionValidationException

public BeanDefinitionValidationException(String msg,
                                         Throwable cause)
Create a new BeanDefinitionValidationException with the specified message and root cause.

Parameters:
msg - the detail message
cause - the root cause
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.beans.factory.wiring

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.beans.factory.wiring

Mechanism to determine bean wiring metadata from a bean instance.

See:
Description

Interface Summary
BeanWiringInfoResolver Strategy interface to be implemented by objects than can resolve bean name information, given a newly instantiated bean object.

Class Summary
BeanConfigurerSupport | Convenient base class for configurers that can perform Dependency Injection on objects (however they may be created).
BeanWiringInfo | Holder for bean wiring metadata information about a particular class.
ClassNameBeanWiringInfoResolver | Simple default implementation of the BeanWiringInfoResolver interface, looking for a bean with the same name as the fully-qualified class name.

Package org.springframework.beans.factory.wiring Description

Mechanism to determine bean wiring metadata from a bean instance. Foundation for aspect-driven bean configuration.


org.springframework.beans.factory.wiring Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.beans.factory.wiring

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.beans.factory.wiring.BeanConfigurerSupport (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean)
    • org.springframework.beans.factory.wiring.BeanWiringInfo
    • org.springframework.beans.factory.wiring.ClassNameBeanWiringInfoResolver (implements org.springframework.beans.factory.wiring.BeanWiringInfoResolver)

Interface Hierarchy

  • org.springframework.beans.factory.wiring.BeanWiringInfoResolver


BeanWiringInfoResolver

org.springframework.beans.factory.wiring
Interface BeanWiringInfoResolver

All Known Implementing Classes:
AnnotationBeanWiringInfoResolver, ClassNameBeanWiringInfoResolver
public interface BeanWiringInfoResolver

Strategy interface to be implemented by objects than can resolve bean name information, given a newly instantiated bean object. Invocations to the resolveWiringInfo(java.lang.Object) method on this interface will be driven by the AspectJ pointcut in the relevant concrete aspect.

Metadata resolution strategy can be pluggable. A good default is ClassNameBeanWiringInfoResolver, which uses the fully-qualified class name as bean name.

Since:
2.0
Author:
Rod Johnson
See Also:
BeanWiringInfo, ClassNameBeanWiringInfoResolver, AnnotationBeanWiringInfoResolver

Method Summary
 BeanWiringInfo resolveWiringInfo(Object beanInstance)
Resolve the BeanWiringInfo for the given bean instance.

Method Detail

resolveWiringInfo

BeanWiringInfo resolveWiringInfo(Object beanInstance)
Resolve the BeanWiringInfo for the given bean instance.

Parameters:
beanInstance - the bean instance to resolve info for
Returns:
the BeanWiringInfo, or null if not found
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanConfigurerSupport

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.beans.factory.wiring
Class BeanConfigurerSupport

java.lang.Object
    extended by  org.springframework.beans.factory.wiring.BeanConfigurerSupport
All Implemented Interfaces:
BeanFactoryAware, DisposableBean, InitializingBean
public class BeanConfigurerSupport
extends Object
implements BeanFactoryAware, InitializingBean, DisposableBean

Convenient base class for configurers that can perform Dependency Injection on objects (however they may be created). Typically subclassed by AspectJ aspects.

Subclasses may also need a custom metadata resolution strategy, in the BeanWiringInfoResolver interface. The default implementation looks for a bean with the same name as the fully-qualified class name. (This is the default name of the bean in a Spring XML file if the 'id' attribute is not used.)

Since:
2.0
Author:
Rob Harrop, Rod Johnson, Juergen Hoeller, Adrian Colyer
See Also:
setBeanWiringInfoResolver(org.springframework.beans.factory.wiring.BeanWiringInfoResolver), ClassNameBeanWiringInfoResolver

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
BeanConfigurerSupport()
Method Summary
void | afterPropertiesSet() Check that a BeanFactory has been set.
void | configureBean(Object beanInstance) Configure the bean instance.
protected BeanWiringInfoResolver | createDefaultBeanWiringInfoResolver() Create the default BeanWiringInfoResolver to be used if none was specified explicitly.
void | destroy() Release references to the BeanFactory and BeanWiringInfoResolver when the container is destroyed.
void | setBeanFactory(BeanFactory beanFactory) Set the BeanFactory in which this aspect must configure beans.
void | setBeanWiringInfoResolver(BeanWiringInfoResolver beanWiringInfoResolver) Set the BeanWiringInfoResolver to use.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

BeanConfigurerSupport

public BeanConfigurerSupport()
Method Detail

setBeanWiringInfoResolver

public void setBeanWiringInfoResolver(BeanWiringInfoResolver beanWiringInfoResolver)
Set the BeanWiringInfoResolver to use.

The default behavior is to look for a bean with the same name as the class. As an alternative, consider using annotation-driven bean wiring.

See Also:
ClassNameBeanWiringInfoResolver, AnnotationBeanWiringInfoResolver

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Set the BeanFactory in which this aspect must configure beans.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
BeanInitializationException

createDefaultBeanWiringInfoResolver

protected BeanWiringInfoResolver createDefaultBeanWiringInfoResolver()
Create the default BeanWiringInfoResolver to be used if none was specified explicitly.

The default implementation builds a ClassNameBeanWiringInfoResolver.

Returns:
the default BeanWiringInfoResolver (never null)

afterPropertiesSet

public void afterPropertiesSet()
Check that a BeanFactory has been set.

Specified by:
afterPropertiesSet in interface InitializingBean

destroy

public void destroy()
Release references to the BeanFactory and BeanWiringInfoResolver when the container is destroyed.

Specified by:
destroy in interface DisposableBean

configureBean

public void configureBean(Object beanInstance)
Configure the bean instance.

Subclasses can override this to provide custom configuration logic. Typically called by an aspect, for all bean instances matched by a pointcut.

Parameters:
beanInstance - the bean instance to configure (must not be null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


BeanWiringInfo

org.springframework.beans.factory.wiring
Class BeanWiringInfo

java.lang.Object
    extended by  org.springframework.beans.factory.wiring.BeanWiringInfo

public class BeanWiringInfo
extends Object

Holder for bean wiring metadata information about a particular class. Used in conjunction with the Configurable annotation and the AspectJ AnnotationBeanConfigurerAspect.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller
See Also:
BeanWiringInfoResolver, AutowireCapableBeanFactory, Configurable

Field Summary
static int | AUTOWIRE_BY_NAME Constant that indicates autowiring bean properties by name.
static int | AUTOWIRE_BY_TYPE Constant that indicates autowiring bean properties by type.
Constructor Summary
BeanWiringInfo()
Create a default BeanWiringInfo that suggests plain initialization of factory and post-processor callbacks that the bean class may expect.
BeanWiringInfo(int autowireMode, boolean dependencyCheck)
Create a new BeanWiringInfo that indicates autowiring.
BeanWiringInfo(String beanName)
Create a new BeanWiringInfo that points to the given bean name.
BeanWiringInfo(String beanName, boolean isDefaultBeanName)
Create a new BeanWiringInfo that points to the given bean name.
Method Summary
int | getAutowireMode() Return one of the constants AUTOWIRE_BY_NAME / AUTOWIRE_BY_TYPE, if autowiring is indicated.
String | getBeanName() Return the specific bean name that this BeanWiringInfo points to, if any.
boolean | getDependencyCheck() Return whether to perform a dependency check for object references in the bean instance (after autowiring).
boolean | indicatesAutowiring() Return whether this BeanWiringInfo indicates autowiring.
boolean | isDefaultBeanName() Return whether the specific bean name is a suggested default bean name, not necessarily matching an actual bean definition in the factory.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

AUTOWIRE_BY_NAME

public static final int AUTOWIRE_BY_NAME
Constant that indicates autowiring bean properties by name.

See Also:
BeanWiringInfo(int, boolean), AutowireCapableBeanFactory.AUTOWIRE_BY_NAME, Constant Field Values

AUTOWIRE_BY_TYPE

public static final int AUTOWIRE_BY_TYPE
Constant that indicates autowiring bean properties by type.

See Also:
BeanWiringInfo(int, boolean), AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE, Constant Field Values
Constructor Detail

BeanWiringInfo

public BeanWiringInfo()
Create a default BeanWiringInfo that suggests plain initialization of factory and post-processor callbacks that the bean class may expect.

BeanWiringInfo

public BeanWiringInfo(String beanName)
Create a new BeanWiringInfo that points to the given bean name.

Parameters:
beanName - the name of the bean definition to take the property values from
Throws:
IllegalArgumentException - if the supplied beanName is null, is empty, or consists wholly of whitespace

BeanWiringInfo

public BeanWiringInfo(String beanName,
                      boolean isDefaultBeanName)
Create a new BeanWiringInfo that points to the given bean name.

Parameters:
beanName - the name of the bean definition to take the property values from
isDefaultBeanName - whether the given bean name is a suggested default bean name, not necessarily matching an actual bean definition
Throws:
IllegalArgumentException - if the supplied beanName is null, is empty, or consists wholly of whitespace

BeanWiringInfo

public BeanWiringInfo(int autowireMode,
                      boolean dependencyCheck)
Create a new BeanWiringInfo that indicates autowiring.

Parameters:
autowireMode - one of the constants AUTOWIRE_BY_NAME / AUTOWIRE_BY_TYPE
dependencyCheck - whether to perform a dependency check for object references in the bean instance (after autowiring)
Throws:
IllegalArgumentException - if the supplied autowireMode is not one of the allowed values
See Also:
AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE
Method Detail

indicatesAutowiring

public boolean indicatesAutowiring()
Return whether this BeanWiringInfo indicates autowiring.

getBeanName

public String getBeanName()
Return the specific bean name that this BeanWiringInfo points to, if any.

isDefaultBeanName

public boolean isDefaultBeanName()
Return whether the specific bean name is a suggested default bean name, not necessarily matching an actual bean definition in the factory.

getAutowireMode

public int getAutowireMode()
Return one of the constants AUTOWIRE_BY_NAME / AUTOWIRE_BY_TYPE, if autowiring is indicated.

getDependencyCheck

public boolean getDependencyCheck()
Return whether to perform a dependency check for object references in the bean instance (after autowiring).

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ClassNameBeanWiringInfoResolver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.beans.factory.wiring
Class ClassNameBeanWiringInfoResolver

java.lang.Object
    extended by  org.springframework.beans.factory.wiring.ClassNameBeanWiringInfoResolver
All Implemented Interfaces:
BeanWiringInfoResolver
public class ClassNameBeanWiringInfoResolver
extends Object
implements BeanWiringInfoResolver

Simple default implementation of the BeanWiringInfoResolver interface, looking for a bean with the same name as the fully-qualified class name. This matches the default name of the bean in a Spring XML file if the bean tag's "id" attribute is not used.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller

Constructor Summary
ClassNameBeanWiringInfoResolver()
Method Summary
 BeanWiringInfo resolveWiringInfo(Object beanInstance)
Resolve the BeanWiringInfo for the given bean instance.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ClassNameBeanWiringInfoResolver

public ClassNameBeanWiringInfoResolver()
Method Detail

resolveWiringInfo

public BeanWiringInfo resolveWiringInfo(Object beanInstance)
Description copied from interface: BeanWiringInfoResolver
Resolve the BeanWiringInfo for the given bean instance.

Specified by:
resolveWiringInfo in interface BeanWiringInfoResolver
Parameters:
beanInstance - the bean instance to resolve info for
Returns:
the BeanWiringInfo, or null if not found
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.beans.factory.xml

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.beans.factory.xml

Contains an abstract XML-based BeanFactory implementation, including a standard "spring-beans" DTD.

See:
Description

Interface Summary
BeanDefinitionDecorator | Interface used by the DefaultBeanDefinitionDocumentReader to handle custom, nested (directly under a <bean>) tags.
BeanDefinitionDocumentReader | SPI for parsing an XML document that contains Spring bean definitions.
BeanDefinitionParser | Interface used by the DefaultBeanDefinitionDocumentReader to handle custom, top-level (directly under <beans>) tags.
DocumentLoader | Strategy interface for loading an XML Document.
NamespaceHandler | Base interface used by the DefaultBeanDefinitionDocumentReader for handling custom namespaces in a Spring XML configuration file.
NamespaceHandlerResolver | Used by the DefaultBeanDefinitionDocumentReader to locate a NamespaceHandler implementation for a particular namespace URI.

Class Summary
AbstractBeanDefinitionParser | Abstract BeanDefinitionParser implementation providing a number of convenience methods and a template method that subclasses must override to provide the actual parsing logic.
AbstractSimpleBeanDefinitionParser | Convenient base class for when there exists a one-to-one mapping between attribute names on the element that is to be parsed and the property names on the Class being configured.
AbstractSingleBeanDefinitionParser | Base class for those BeanDefinitionParser implementations that need to parse and define just a single BeanDefinition.
BeanDefinitionParserDelegate | Stateful delegate class used to parse XML bean definitions.
BeansDtdResolver | EntityResolver implementation for the Spring beans DTD, to load the DTD from the Spring class path (or JAR file).
DefaultBeanDefinitionDocumentReader | Default implementation of the BeanDefinitionDocumentReader interface.
DefaultDocumentLoader | Spring's default DocumentLoader implementation.
DefaultNamespaceHandlerResolver | Default implementation of the NamespaceHandlerResolver interface.
DelegatingEntityResolver | EntityResolver implementation that delegates to a BeansDtdResolver and a PluggableSchemaResolver for DTDs and XML schemas, respectively.
DocumentDefaultsDefinition | Simple JavaBean that holds the defaults specified at the <beans> level in a standard Spring XML bean definition document: default-lazy-init, default-autowire, etc.
NamespaceHandlerSupport | Support class for implementing custom NamespaceHandlers.
ParserContext | Context that gets passed along a bean definition parsing process, encapsulating all relevant configuration as well as state.
PluggableSchemaResolver | EntityResolver implementation that attempts to resolve schema URLs into local classpath resources using a set of mappings files.
ResourceEntityResolver | EntityResolver implementation that tries to resolve entity references through a ResourceLoader (usually, relative to the resource base of an ApplicationContext), if applicable.
SimplePropertyNamespaceHandler | Simple NamespaceHandler implementation that maps custom attributes directly through to bean properties.
UtilNamespaceHandler | NamespaceHandler for the util namespace.
XmlBeanDefinitionReader | Bean definition reader for XML bean definitions.
XmlBeanFactory | Convenience extension of DefaultListableBeanFactory that reads bean definitions from an XML document.
XmlReaderContext | Extension of ReaderContext, specific to use with an XmlBeanDefinitionReader.

Exception Summary
XmlBeanDefinitionStoreException XML-specific BeanDefinitionStoreException subclass that wraps a SAXException, typically a SAXParseException which contains information about the error location.

Package org.springframework.beans.factory.xml Description

Contains an abstract XML-based BeanFactory implementation, including a standard "spring-beans" DTD.


org.springframework.beans.factory.xml Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.beans.factory.xml

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.beans.factory.xml.AbstractBeanDefinitionParser (implements org.springframework.beans.factory.xml.BeanDefinitionParser)
      • org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
        • org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser
    • org.springframework.beans.factory.support.AbstractBeanDefinitionReader (implements org.springframework.beans.factory.support.BeanDefinitionReader)
      • org.springframework.beans.factory.xml.XmlBeanDefinitionReader
    • org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
    • org.springframework.beans.factory.xml.BeansDtdResolver (implements org.xml.sax.EntityResolver)
    • org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader (implements org.springframework.beans.factory.xml.BeanDefinitionDocumentReader)
    • org.springframework.beans.factory.xml.DefaultDocumentLoader (implements org.springframework.beans.factory.xml.DocumentLoader)
    • org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver (implements org.springframework.beans.factory.xml.NamespaceHandlerResolver)
    • org.springframework.beans.factory.xml.DelegatingEntityResolver (implements org.xml.sax.EntityResolver)
      • org.springframework.beans.factory.xml.ResourceEntityResolver
    • org.springframework.beans.factory.xml.DocumentDefaultsDefinition (implements org.springframework.beans.factory.parsing.DefaultsDefinition)
    • org.springframework.beans.factory.xml.NamespaceHandlerSupport (implements org.springframework.beans.factory.xml.NamespaceHandler)
      • org.springframework.beans.factory.xml.UtilNamespaceHandler
    • org.springframework.beans.factory.xml.ParserContext
    • org.springframework.beans.factory.xml.PluggableSchemaResolver (implements org.xml.sax.EntityResolver)
    • org.springframework.beans.factory.parsing.ReaderContext
      • org.springframework.beans.factory.xml.XmlReaderContext
    • org.springframework.core.SimpleAliasRegistry (implements org.springframework.core.AliasRegistry)
      • org.springframework.beans.factory.support.DefaultSingletonBeanRegistry (implements org.springframework.beans.factory.config.SingletonBeanRegistry)
        • org.springframework.beans.factory.support.FactoryBeanRegistrySupport
          • org.springframework.beans.factory.support.AbstractBeanFactory (implements org.springframework.beans.factory.config.ConfigurableBeanFactory)
            • org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory (implements org.springframework.beans.factory.config.AutowireCapableBeanFactory)
              • org.springframework.beans.factory.support.DefaultListableBeanFactory (implements org.springframework.beans.factory.support.BeanDefinitionRegistry, org.springframework.beans.factory.config.ConfigurableListableBeanFactory, java.io.Serializable)
                • org.springframework.beans.factory.xml.XmlBeanFactory
    • org.springframework.beans.factory.xml.SimplePropertyNamespaceHandler (implements org.springframework.beans.factory.xml.NamespaceHandler)
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.beans.BeansException
              • org.springframework.beans.FatalBeanException
                • org.springframework.beans.factory.BeanDefinitionStoreException
                  • org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException

Interface Hierarchy

  • org.springframework.beans.factory.xml.BeanDefinitionDecorator
  • org.springframework.beans.factory.xml.BeanDefinitionDocumentReader
  • org.springframework.beans.factory.xml.BeanDefinitionParser
  • org.springframework.beans.factory.xml.DocumentLoader
  • org.springframework.beans.factory.xml.NamespaceHandler
  • org.springframework.beans.factory.xml.NamespaceHandlerResolver


BeanDefinitionDecorator

org.springframework.beans.factory.xml
Interface BeanDefinitionDecorator

All Known Implementing Classes:
AbstractInterceptorDrivenBeanDefinitionDecorator
public interface BeanDefinitionDecorator

Interface used by the DefaultBeanDefinitionDocumentReader to handle custom, nested (directly under a <bean>) tags.

Decoration may also occur based on custom attributes applied to the <bean> tag. Implementations are free to turn the metadata in the custom tag into as many BeanDefinitions as required and to transform the BeanDefinition of the enclosing <bean> tag, potentially even returning a completely different BeanDefinition to replace the original.

BeanDefinitionDecorators should be aware that they may be part of a chain. In particular, a BeanDefinitionDecorator should be aware that a previous BeanDefinitionDecorator may have replaced the original BeanDefinition with a ProxyFactoryBean definition allowing for custom interceptors to be added.

BeanDefinitionDecorators that wish to add an interceptor to the enclosing bean should extend AbstractInterceptorDrivenBeanDefinitionDecorator which handles the chaining ensuring that only one proxy is created and that it contains all interceptors from the chain.

The parser locates a BeanDefinitionDecorator from the NamespaceHandler for the namespace in which the custom tag resides.

Since:
2.0
Author:
Rob Harrop
See Also:
NamespaceHandler, BeanDefinitionParser

Method Summary
 BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder definition, ParserContext parserContext)
Parse the specified Node (either an element or an attribute) and decorate the supplied BeanDefinition, returning the decorated definition.

Method Detail

decorate

BeanDefinitionHolder decorate(Node node,
                              BeanDefinitionHolder definition,
                              ParserContext parserContext)
Parse the specified Node (either an element or an attribute) and decorate the supplied BeanDefinition, returning the decorated definition.

Implementations may choose to return a completely new definition, which will replace the original definition in the resulting BeanFactory.

The supplied ParserContext can be used to register any additional beans needed to support the main definition.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanDefinitionDocumentReader

org.springframework.beans.factory.xml
Interface BeanDefinitionDocumentReader

All Known Implementing Classes:
DefaultBeanDefinitionDocumentReader
public interface BeanDefinitionDocumentReader

SPI for parsing an XML document that contains Spring bean definitions. Used by XmlBeanDefinitionReader for actually parsing a DOM document.

Instantiated per document to parse: Implementations can hold state in instance variables during the execution of the registerBeanDefinitions method, for example global settings that are defined for all bean definitions in the document.

Since:
18.12.2003
Author:
Juergen Hoeller, Rob Harrop
See Also:
XmlBeanDefinitionReader.setDocumentReaderClass(java.lang.Class)

Method Summary
 void registerBeanDefinitions(Document doc, XmlReaderContext readerContext)
Read bean definitions from the given DOM document, and register them with the given bean factory.

Method Detail

registerBeanDefinitions

void registerBeanDefinitions(Document doc,
                             XmlReaderContext readerContext)
                             throws BeanDefinitionStoreException
Read bean definitions from the given DOM document, and register them with the given bean factory.

Parameters:
doc - the DOM document
readerContext - the current context of the reader. Includes the resource being parsed
Throws:
BeanDefinitionStoreException - in case of parsing errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanDefinitionParser

org.springframework.beans.factory.xml
Interface BeanDefinitionParser

All Known Implementing Classes:
AbstractBeanDefinitionParser, AbstractSimpleBeanDefinitionParser, AbstractSingleBeanDefinitionParser, AnnotationConfigBeanDefinitionParser, AnnotationDrivenBeanDefinitionParser, ComponentScanBeanDefinitionParser, EmbeddedDatabaseBeanDefinitionParser, ExecutorBeanDefinitionParser, InitializeDatabaseBeanDefinitionParser, JtaTransactionManagerBeanDefinitionParser, ScheduledTasksBeanDefinitionParser, SchedulerBeanDefinitionParser, ScriptingDefaultsParser
public interface BeanDefinitionParser

Interface used by the DefaultBeanDefinitionDocumentReader to handle custom, top-level (directly under <beans>) tags.

Implementations are free to turn the metadata in the custom tag into as many BeanDefinitions as required.

The parser locates a BeanDefinitionParser from the associated NamespaceHandler for the namespace in which the custom tag resides.

Since:
2.0
Author:
Rob Harrop
See Also:
NamespaceHandler, BeanDefinitionDecorator, AbstractBeanDefinitionParser

Method Summary
 BeanDefinition parse(Element element, ParserContext parserContext)
Parse the specified Element and register the resulting BeanDefinition(s) with the ParserContext.getRegistry() BeanDefinitionRegistry} embedded in the supplied ParserContext.

Method Detail

parse

BeanDefinition parse(Element element,
                     ParserContext parserContext)
Parse the specified Element and register the resulting BeanDefinition(s) with the ParserContext.getRegistry() BeanDefinitionRegistry} embedded in the supplied ParserContext.

Implementations must return the primary BeanDefinition that results from the parse if they will ever be used in a nested fashion (for example as an inner tag in a <property/> tag). Implementations may return null if they will not be used in a nested fashion.

Parameters:
element - the element that is to be parsed into one or more BeanDefinitions
parserContext - the object encapsulating the current state of the parsing process; provides access to a BeanDefinitionRegistry
Returns:
the primary BeanDefinition
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DocumentLoader

org.springframework.beans.factory.xml
Interface DocumentLoader

All Known Implementing Classes:
DefaultDocumentLoader
public interface DocumentLoader

Strategy interface for loading an XML Document.

Since:
2.0
Author:
Rob Harrop
See Also:
DefaultDocumentLoader

Method Summary
 Document loadDocument(InputSource inputSource, EntityResolver entityResolver, ErrorHandler errorHandler, int validationMode, boolean namespaceAware)
Load a document from the supplied source.

Method Detail

loadDocument

Document loadDocument(InputSource inputSource,
                      EntityResolver entityResolver,
                      ErrorHandler errorHandler,
                      int validationMode,
                      boolean namespaceAware)
                      throws Exception
Load a document from the supplied source.

Parameters:
inputSource - the source of the document that is to be loaded
entityResolver - the resolver that is to be used to resolve any entities
errorHandler - used to report any errors during document loading
validationMode - the type of validation DTD or XSD)
namespaceAware - true if support for XML namespaces is to be provided
Returns:
the loaded document
Throws:
Exception - if an error occurs
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NamespaceHandler

org.springframework.beans.factory.xml
Interface NamespaceHandler

All Known Implementing Classes:
AopNamespaceHandler, ContextNamespaceHandler, JdbcNamespaceHandler, JeeNamespaceHandler, JmsNamespaceHandler, LangNamespaceHandler, MvcNamespaceHandler, NamespaceHandlerSupport, OxmNamespaceHandler, SimplePropertyNamespaceHandler, TaskNamespaceHandler, TxNamespaceHandler, UtilNamespaceHandler
public interface NamespaceHandler

Base interface used by the DefaultBeanDefinitionDocumentReader for handling custom namespaces in a Spring XML configuration file.

Implementations are expected to return implementations of the BeanDefinitionParser interface for custom top-level tags and implementations of the BeanDefinitionDecorator interface for custom nested tags.

The parser will call parse(org.w3c.dom.Element, org.springframework.beans.factory.xml.ParserContext) when it encounters a custom tag directly under the <beans> tags and decorate(org.w3c.dom.Node, org.springframework.beans.factory.config.BeanDefinitionHolder, org.springframework.beans.factory.xml.ParserContext) when it encounters a custom tag directly under a <bean> tag.

Developers writing their own custom element extensions typically will not implement this interface drectly, but rather make use of the provided NamespaceHandlerSupport class.

Since:
2.0
Author:
Rob Harrop, Erik Wiersma
See Also:
DefaultBeanDefinitionDocumentReader, NamespaceHandlerResolver

Method Summary
BeanDefinitionHolder | decorate(Node source, BeanDefinitionHolder definition, ParserContext parserContext) Parse the specified Node and decorate the supplied BeanDefinitionHolder, returning the decorated definition.
void | init() Invoked by the DefaultBeanDefinitionDocumentReader after construction but before any custom elements are parsed.
BeanDefinition | parse(Element element, ParserContext parserContext) Parse the specified Element and register any resulting BeanDefinitions with the BeanDefinitionRegistry that is embedded in the supplied ParserContext.

Method Detail

init

void init()
Invoked by the DefaultBeanDefinitionDocumentReader after construction but before any custom elements are parsed.

See Also:
NamespaceHandlerSupport.registerBeanDefinitionParser(String, BeanDefinitionParser)

parse

BeanDefinition parse(Element element,
                     ParserContext parserContext)
Parse the specified Element and register any resulting BeanDefinitions with the BeanDefinitionRegistry that is embedded in the supplied ParserContext.

Implementations should return the primary BeanDefinition that results from the parse phase if they wish to be used nested inside (for example) a <property> tag.

Implementations may return null if they will not be used in a nested scenario.

Parameters:
element - the element that is to be parsed into one or more BeanDefinitions
parserContext - the object encapsulating the current state of the parsing process
Returns:
the primary BeanDefinition (can be null as explained above)

decorate

BeanDefinitionHolder decorate(Node source,
                              BeanDefinitionHolder definition,
                              ParserContext parserContext)
Parse the specified Node and decorate the supplied BeanDefinitionHolder, returning the decorated definition.

The Node may be either an Attr or an Element, depending on whether a custom attribute or element is being parsed.

Implementations may choose to return a completely new definition, which will replace the original definition in the resulting BeanFactory.

The supplied ParserContext can be used to register any additional beans needed to support the main definition.

Parameters:
source - the source element or attribute that is to be parsed
definition - the current bean definition
parserContext - the object encapsulating the current state of the parsing process
Returns:
the decorated definition (to be registered in the BeanFactory), or simply the original bean definition if no decoration is required. A null value is strictly speaking invalid, but will be leniently treated like the case where the original bean definition gets returned.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NamespaceHandlerResolver

org.springframework.beans.factory.xml
Interface NamespaceHandlerResolver

All Known Implementing Classes:
DefaultNamespaceHandlerResolver
public interface NamespaceHandlerResolver

Used by the DefaultBeanDefinitionDocumentReader to locate a NamespaceHandler implementation for a particular namespace URI.

Since:
2.0
Author:
Rob Harrop
See Also:
NamespaceHandler, DefaultBeanDefinitionDocumentReader

Method Summary
 NamespaceHandler resolve(String namespaceUri)
Resolve the namespace URI and return the located NamespaceHandler implementation.

Method Detail

resolve

NamespaceHandler resolve(String namespaceUri)
Resolve the namespace URI and return the located NamespaceHandler implementation.

Parameters:
namespaceUri - the relevant namespace URI
Returns:
the located NamespaceHandler (may be null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractBeanDefinitionParser

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.beans.factory.xml
Class AbstractBeanDefinitionParser

java.lang.Object
    extended by  org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
All Implemented Interfaces:
BeanDefinitionParser
Direct Known Subclasses:
AbstractSingleBeanDefinitionParser, EmbeddedDatabaseBeanDefinitionParser, InitializeDatabaseBeanDefinitionParser
public abstract class AbstractBeanDefinitionParser
extends Object
implements BeanDefinitionParser

Abstract BeanDefinitionParser implementation providing a number of convenience methods and a template method that subclasses must override to provide the actual parsing logic.

Use this BeanDefinitionParser implementation when you want to parse some arbitrarily complex XML into one or more BeanDefinitions. If you just want to parse some XML into a single BeanDefinition, you may wish to consider the simpler convenience extensions of this class, namely AbstractSingleBeanDefinitionParser and AbstractSimpleBeanDefinitionParser.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller, Rick Evans, Dave Syer

Field Summary
static String | ID_ATTRIBUTE Constant for the id attribute
static String | NAME_ATTRIBUTE Constant for the name attribute
Constructor Summary
AbstractBeanDefinitionParser()
Method Summary
 BeanDefinition parse(Element element, ParserContext parserContext)
Parse the specified Element and register the resulting BeanDefinition(s) with the ParserContext.getRegistry() BeanDefinitionRegistry} embedded in the supplied ParserContext.
protected abstract  AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext)
Central template method to actually parse the supplied Element into one or more BeanDefinitions.
protected  void postProcessComponentDefinition(BeanComponentDefinition componentDefinition)
Hook method called after the primary parsing of a BeanComponentDefinition but before the BeanComponentDefinition has been registered with a BeanDefinitionRegistry.
protected  void registerBeanDefinition(BeanDefinitionHolder definition, BeanDefinitionRegistry registry)
Register the supplied bean with the supplied registry.
protected  String resolveId(Element element, AbstractBeanDefinition definition, ParserContext parserContext)
Resolve the ID for the supplied BeanDefinition.
protected  boolean shouldFireEvents()
Controls whether this parser is supposed to fire a BeanComponentDefinition event after parsing the bean definition.
protected  boolean shouldGenerateId()
Should an ID be generated instead of read from the passed in Element?
protected  boolean shouldGenerateIdAsFallback()
Should an ID be generated instead if the passed in Element does not specify an "id" attribute explicitly?
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

ID_ATTRIBUTE

public static final String ID_ATTRIBUTE
Constant for the id attribute

See Also:
Constant Field Values

NAME_ATTRIBUTE

public static final String NAME_ATTRIBUTE
Constant for the name attribute

See Also:
Constant Field Values
Constructor Detail

AbstractBeanDefinitionParser

public AbstractBeanDefinitionParser()
Method Detail

parse

public final BeanDefinition parse(Element element,
                                  ParserContext parserContext)
Description copied from interface: BeanDefinitionParser
Parse the specified Element and register the resulting BeanDefinition(s) with the ParserContext.getRegistry() BeanDefinitionRegistry} embedded in the supplied ParserContext.

Implementations must return the primary BeanDefinition that results from the parse if they will ever be used in a nested fashion (for example as an inner tag in a <property/> tag). Implementations may return null if they will not be used in a nested fashion.

Specified by:
parse in interface BeanDefinitionParser
Parameters:
element - the element that is to be parsed into one or more BeanDefinitions
parserContext - the object encapsulating the current state of the parsing process; provides access to a BeanDefinitionRegistry
Returns:
the primary BeanDefinition

resolveId

protected String resolveId(Element element,
                           AbstractBeanDefinition definition,
                           ParserContext parserContext)
                    throws BeanDefinitionStoreException
Resolve the ID for the supplied BeanDefinition.

When using generation, a name is generated automatically. Otherwise, the ID is extracted from the "id" attribute, potentially with a fallback to a generated id.

Parameters:
element - the element that the bean definition has been built from
definition - the bean definition to be registered
parserContext - the object encapsulating the current state of the parsing process; provides access to a BeanDefinitionRegistry
Returns:
the resolved id
Throws:
BeanDefinitionStoreException - if no unique name could be generated for the given bean definition

registerBeanDefinition

protected void registerBeanDefinition(BeanDefinitionHolder definition,
                                      BeanDefinitionRegistry registry)
Register the supplied bean with the supplied registry.

Subclasses can override this method to control whether or not the supplied bean is actually even registered, or to register even more beans.

The default implementation registers the supplied bean with the supplied registry only if the isNested parameter is false, because one typically does not want inner beans to be registered as top level beans.

Parameters:
definition - the bean definition to be registered
registry - the registry that the bean is to be registered with
See Also:
BeanDefinitionReaderUtils.registerBeanDefinition(BeanDefinitionHolder, BeanDefinitionRegistry)

parseInternal

protected abstract AbstractBeanDefinition parseInternal(Element element,
                                                        ParserContext parserContext)
Central template method to actually parse the supplied Element into one or more BeanDefinitions.

Parameters:
element - the element that is to be parsed into one or more BeanDefinitions
parserContext - the object encapsulating the current state of the parsing process; provides access to a BeanDefinitionRegistry
Returns:
the primary BeanDefinition resulting from the parsing of the supplied Element
See Also:
parse(org.w3c.dom.Element, ParserContext), postProcessComponentDefinition(org.springframework.beans.factory.parsing.BeanComponentDefinition)

shouldGenerateId

protected boolean shouldGenerateId()
Should an ID be generated instead of read from the passed in Element?

Disabled by default; subclasses can override this to enable ID generation. Note that this flag is about always generating an ID; the parser won't even check for an "id" attribute in this case.

Returns:
whether the parser should always generate an id

shouldGenerateIdAsFallback

protected boolean shouldGenerateIdAsFallback()
Should an ID be generated instead if the passed in Element does not specify an "id" attribute explicitly?

Disabled by default; subclasses can override this to enable ID generation as fallback: The parser will first check for an "id" attribute in this case, only falling back to a generated ID if no value was specified.

Returns:
whether the parser should generate an id if no id was specified

shouldFireEvents

protected boolean shouldFireEvents()
Controls whether this parser is supposed to fire a BeanComponentDefinition event after parsing the bean definition.

This implementation returns true by default; that is, an event will be fired when a bean definition has been completely parsed. Override this to return false in order to suppress the event.

Returns:
true in order to fire a component registration event after parsing the bean definition; false to suppress the event
See Also:
postProcessComponentDefinition(org.springframework.beans.factory.parsing.BeanComponentDefinition), ReaderContext.fireComponentRegistered(org.springframework.beans.factory.parsing.ComponentDefinition)

postProcessComponentDefinition

protected void postProcessComponentDefinition(BeanComponentDefinition componentDefinition)
Hook method called after the primary parsing of a BeanComponentDefinition but before the BeanComponentDefinition has been registered with a BeanDefinitionRegistry.

Derived classes can override this method to supply any custom logic that is to be executed after all the parsing is finished.

The default implementation is a no-op.

Parameters:
componentDefinition - the BeanComponentDefinition that is to be processed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractSimpleBeanDefinitionParser

org.springframework.beans.factory.xml
Class AbstractSimpleBeanDefinitionParser

java.lang.Object
    extended by  org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
        extended by  org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
            extended by  org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser
All Implemented Interfaces:
BeanDefinitionParser
public abstract class AbstractSimpleBeanDefinitionParser
extends AbstractSingleBeanDefinitionParser

Convenient base class for when there exists a one-to-one mapping between attribute names on the element that is to be parsed and the property names on the Class being configured.

Extend this parser class when you want to create a single bean definition from a relatively simple custom XML element. The resulting BeanDefinition will be automatically registered with the relevant BeanDefinitionRegistry.

An example will hopefully make the use of this particular parser class immediately clear. Consider the following class definition:

public class SimpleCache implements Cache {

     public void setName(String name) {...}
     public void setTimeout(int timeout) {...}
     public void setEvictionPolicy(EvictionPolicy policy) {...}

     // remaining class definition elided for clarity...
 }

Then let us assume the following XML tag has been defined to permit the easy configuration of instances of the above class;

<caching:cache name="..." timeout="..." eviction-policy="..."/>

All that is required of the Java developer tasked with writing the parser to parse the above XML tag into an actual SimpleCache bean definition is the following:

public class SimpleCacheBeanDefinitionParser extends AbstractSimpleBeanDefinitionParser {

     protected Class getBeanClass(Element element) {
         return SimpleCache.class;
     }
 }

Please note that the AbstractSimpleBeanDefinitionParser is limited to populating the created bean definition with property values. if you want to parse constructor arguments and nested elements from the supplied XML element, then you will have to implement the postProcess(org.springframework.beans.factory.support.BeanDefinitionBuilder, org.w3c.dom.Element) method and do such parsing yourself, or (more likely) subclass the AbstractSingleBeanDefinitionParser or AbstractBeanDefinitionParser classes directly.

The process of actually registering the SimpleCacheBeanDefinitionParser with the Spring XML parsing infrastructure is described in the Spring Framework reference documentation (in one of the appendices).

For an example of this parser in action (so to speak), do look at the source code for the UtilNamespaceHandler.PropertiesBeanDefinitionParser; the observant (and even not so observant) reader will immediately notice that there is next to no code in the implementation. The PropertiesBeanDefinitionParser populates a PropertiesFactoryBean from an XML element that looks like this:

<util:properties location="jdbc.properties"/>

The observant reader will notice that the sole attribute on the <util:properties/> element matches the PropertiesLoaderSupport.setLocation(org.springframework.core.io.Resource) method name on the PropertiesFactoryBean (the general usage thus illustrated holds true for any number of attributes). All that the PropertiesBeanDefinitionParser needs actually do is supply an implementation of the AbstractSingleBeanDefinitionParser.getBeanClass(org.w3c.dom.Element) method to return the PropertiesFactoryBean type.

Since:
2.0
Author:
Rob Harrop, Rick Evans, Juergen Hoeller
See Also:
Conventions.attributeNameToPropertyName(String)

Field Summary
Fields inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
ID_ATTRIBUTE, NAME_ATTRIBUTE
Constructor Summary
AbstractSimpleBeanDefinitionParser()
Method Summary
protected void | doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) Parse the supplied Element and populate the supplied BeanDefinitionBuilder as required.
protected String | extractPropertyName(String attributeName) Extract a JavaBean property name from the supplied attribute name.
protected boolean | isEligibleAttribute(Attr attribute) Deprecated. in favour of isEligibleAttribute(org.w3c.dom.Attr, ParserContext)
protected boolean | isEligibleAttribute(Attr attribute, ParserContext parserContext) Determine whether the given attribute is eligible for being turned into a corresponding bean property value.
protected boolean | isEligibleAttribute(String attributeName) Determine whether the given attribute is eligible for being turned into a corresponding bean property value.
protected void | postProcess(BeanDefinitionBuilder beanDefinition, Element element) Hook method that derived classes can implement to inspect/change a bean definition after parsing is complete.
Methods inherited from class org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
doParse, getBeanClass, getBeanClassName, getParentName, parseInternal
Methods inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
parse, postProcessComponentDefinition, registerBeanDefinition, resolveId, shouldFireEvents, shouldGenerateId, shouldGenerateIdAsFallback
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractSimpleBeanDefinitionParser

public AbstractSimpleBeanDefinitionParser()
Method Detail

doParse

protected void doParse(Element element,
                       ParserContext parserContext,
                       BeanDefinitionBuilder builder)
Parse the supplied Element and populate the supplied BeanDefinitionBuilder as required.

This implementation maps any attributes present on the supplied element to PropertyValue instances, and adds them to the builder.

The extractPropertyName(String) method is used to reconcile the name of an attribute with the name of a JavaBean property.

Overrides:
doParse in class AbstractSingleBeanDefinitionParser
Parameters:
element - the XML element being parsed
builder - used to define the BeanDefinition
parserContext - the object encapsulating the current state of the parsing process
See Also:
extractPropertyName(String)

isEligibleAttribute

protected boolean isEligibleAttribute(Attr attribute,
                                      ParserContext parserContext)
Determine whether the given attribute is eligible for being turned into a corresponding bean property value.

The default implementation considers any attribute as eligible, except for the "id" attribute and namespace declaration attributes.

Parameters:
attribute - the XML attribute to check
parserContext - the ParserContext
See Also:
isEligibleAttribute(String)

isEligibleAttribute

@Deprecated
protected boolean isEligibleAttribute(Attr attribute)
Deprecated. in favour of isEligibleAttribute(org.w3c.dom.Attr, ParserContext)

Determine whether the given attribute is eligible for being turned into a corresponding bean property value.

The default implementation considers any attribute as eligible, except for the "id" attribute and namespace declaration attributes.

Parameters:
attribute - the XML attribute to check
See Also:
isEligibleAttribute(String)

isEligibleAttribute

protected boolean isEligibleAttribute(String attributeName)
Determine whether the given attribute is eligible for being turned into a corresponding bean property value.

The default implementation considers any attribute as eligible, except for the "id" attribute.

Parameters:
attributeName - the attribute name taken straight from the XML element being parsed (never null)

extractPropertyName

protected String extractPropertyName(String attributeName)
Extract a JavaBean property name from the supplied attribute name.

The default implementation uses the Conventions.attributeNameToPropertyName(String) method to perform the extraction.

The name returned must obey the standard JavaBean property name conventions. For example for a class with a setter method 'setBingoHallFavourite(String)', the name returned had better be 'bingoHallFavourite' (with that exact casing).

Parameters:
attributeName - the attribute name taken straight from the XML element being parsed (never null)
Returns:
the extracted JavaBean property name (must never be null)

postProcess

protected void postProcess(BeanDefinitionBuilder beanDefinition,
                           Element element)
Hook method that derived classes can implement to inspect/change a bean definition after parsing is complete.

The default implementation does nothing.

Parameters:
beanDefinition - the parsed (and probably totally defined) bean definition being built
element - the XML element that was the source of the bean definition's metadata
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractSingleBeanDefinitionParser

org.springframework.beans.factory.xml
Class AbstractSingleBeanDefinitionParser

java.lang.Object
    extended by  org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
        extended by  org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
All Implemented Interfaces:
BeanDefinitionParser
Direct Known Subclasses:
AbstractSimpleBeanDefinitionParser, ExecutorBeanDefinitionParser, JtaTransactionManagerBeanDefinitionParser, ScheduledTasksBeanDefinitionParser, SchedulerBeanDefinitionParser
public abstract class AbstractSingleBeanDefinitionParser
extends AbstractBeanDefinitionParser

Base class for those BeanDefinitionParser implementations that need to parse and define just a single BeanDefinition.

Extend this parser class when you want to create a single bean definition from an arbitrarily complex XML element. You may wish to consider extending the AbstractSimpleBeanDefinitionParser when you want to create a single bean definition from a relatively simple custom XML element.

The resulting BeanDefinition will be automatically registered with the BeanDefinitionRegistry. Your job simply is to parse the custom XML Element into a single BeanDefinition.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller, Rick Evans
See Also:
getBeanClass(org.w3c.dom.Element),
getBeanClassName(org.w3c.dom.Element),
doParse(org.w3c.dom.Element, org.springframework.beans.factory.xml.ParserContext, org.springframework.beans.factory.support.BeanDefinitionBuilder)

Field Summary
Fields inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
ID_ATTRIBUTE, NAME_ATTRIBUTE
Constructor Summary
AbstractSingleBeanDefinitionParser()
Method Summary
protected  void doParse(Element element, BeanDefinitionBuilder builder)
Parse the supplied Element and populate the supplied BeanDefinitionBuilder as required.
protected  void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder)
Parse the supplied Element and populate the supplied BeanDefinitionBuilder as required.
protected  Class getBeanClass(Element element)
Determine the bean class corresponding to the supplied Element.
protected  String getBeanClassName(Element element)
Determine the bean class name corresponding to the supplied Element.
protected  String getParentName(Element element)
Determine the name for the parent of the currently parsed bean, in case of the current bean being defined as a child bean.
protected  AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext)
Creates a BeanDefinitionBuilder instance for the bean Class and passes it to the doParse(org.w3c.dom.Element, org.springframework.beans.factory.xml.ParserContext, org.springframework.beans.factory.support.BeanDefinitionBuilder) strategy method.
Methods inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
parse, postProcessComponentDefinition, registerBeanDefinition, resolveId, shouldFireEvents, shouldGenerateId, shouldGenerateIdAsFallback
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractSingleBeanDefinitionParser

public AbstractSingleBeanDefinitionParser()
Method Detail

parseInternal

protected final AbstractBeanDefinition parseInternal(Element element,
                                                     ParserContext parserContext)
Creates a BeanDefinitionBuilder instance for the bean Class and passes it to the doParse(org.w3c.dom.Element, org.springframework.beans.factory.xml.ParserContext, org.springframework.beans.factory.support.BeanDefinitionBuilder) strategy method.

Specified by:
parseInternal in class AbstractBeanDefinitionParser
Parameters:
element - the element that is to be parsed into a single BeanDefinition
parserContext - the object encapsulating the current state of the parsing process
Returns:
the BeanDefinition resulting from the parsing of the supplied Element
Throws:
IllegalStateException - if the bean Class returned from getBeanClass(org.w3c.dom.Element) is null
See Also:
doParse(org.w3c.dom.Element, org.springframework.beans.factory.xml.ParserContext, org.springframework.beans.factory.support.BeanDefinitionBuilder)

getParentName

protected String getParentName(Element element)
Determine the name for the parent of the currently parsed bean, in case of the current bean being defined as a child bean.

The default implementation returns null, indicating a root bean definition.

Parameters:
element - the Element that is being parsed
Returns:
the name of the parent bean for the currently parsed bean, or null if none

getBeanClass

protected Class getBeanClass(Element element)
Determine the bean class corresponding to the supplied Element.

Note that, for application classes, it is generally preferable to override getBeanClassName(org.w3c.dom.Element) instead, in order to avoid a direct dependence on the bean implementation class. The BeanDefinitionParser and its NamespaceHandler can be used within an IDE plugin then, even if the application classes are not available on the plugin's classpath.

Parameters:
element - the Element that is being parsed
Returns:
the Class of the bean that is being defined via parsing the supplied Element, or null if none
See Also:
getBeanClassName(org.w3c.dom.Element)

getBeanClassName

protected String getBeanClassName(Element element)
Determine the bean class name corresponding to the supplied Element.

Parameters:
element - the Element that is being parsed
Returns:
the class name of the bean that is being defined via parsing the supplied Element, or null if none
See Also:
getBeanClass(org.w3c.dom.Element)

doParse

protected void doParse(Element element,
                       ParserContext parserContext,
                       BeanDefinitionBuilder builder)
Parse the supplied Element and populate the supplied BeanDefinitionBuilder as required.

The default implementation delegates to the doParse version without ParserContext argument.

Parameters:
element - the XML element being parsed
parserContext - the object encapsulating the current state of the parsing process
builder - used to define the BeanDefinition
See Also:
doParse(Element, BeanDefinitionBuilder)

doParse

protected void doParse(Element element,
                       BeanDefinitionBuilder builder)
Parse the supplied Element and populate the supplied BeanDefinitionBuilder as required.

The default implementation does nothing.

Parameters:
element - the XML element being parsed
builder - used to define the BeanDefinition
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanDefinitionParserDelegate

org.springframework.beans.factory.xml
Class BeanDefinitionParserDelegate

java.lang.Object
    extended by  org.springframework.beans.factory.xml.BeanDefinitionParserDelegate

public class BeanDefinitionParserDelegate
extends Object

Stateful delegate class used to parse XML bean definitions. Intended for use by both the main parser and any extension BeanDefinitionParsers or BeanDefinitionDecorators.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller, Rod Johnson, Mark Fisher
See Also:
ParserContext, DefaultBeanDefinitionDocumentReader

Field Summary
static String | ABSTRACT_ATTRIBUTE
static String | ARG_TYPE_ELEMENT
static String | ARG_TYPE_MATCH_ATTRIBUTE
static String | ARRAY_ELEMENT
static String | AUTOWIRE_ATTRIBUTE
static String | AUTOWIRE_AUTODETECT_VALUE
static String | AUTOWIRE_BY_NAME_VALUE
static String | AUTOWIRE_BY_TYPE_VALUE
static String | AUTOWIRE_CANDIDATE_ATTRIBUTE
static String | AUTOWIRE_CONSTRUCTOR_VALUE
static String | BEAN_ELEMENT
static String | BEAN_NAME_DELIMITERS
static String | BEAN_REF_ATTRIBUTE
static String | BEANS_NAMESPACE_URI
static String | CLASS_ATTRIBUTE
static String | CONSTRUCTOR_ARG_ELEMENT
static String | DEFAULT_AUTOWIRE_ATTRIBUTE
static String | DEFAULT_AUTOWIRE_CANDIDATES_ATTRIBUTE
static String | DEFAULT_DEPENDENCY_CHECK_ATTRIBUTE
static String | DEFAULT_DESTROY_METHOD_ATTRIBUTE
static String | DEFAULT_INIT_METHOD_ATTRIBUTE
static String | DEFAULT_LAZY_INIT_ATTRIBUTE
static String | DEFAULT_MERGE_ATTRIBUTE
static String | DEFAULT_VALUE
static String | DEPENDENCY_CHECK_ALL_ATTRIBUTE_VALUE
static String | DEPENDENCY_CHECK_ATTRIBUTE
static String | DEPENDENCY_CHECK_OBJECTS_ATTRIBUTE_VALUE
static String | DEPENDENCY_CHECK_SIMPLE_ATTRIBUTE_VALUE
static String | DEPENDS_ON_ATTRIBUTE
static String | DESCRIPTION_ELEMENT
static String | DESTROY_METHOD_ATTRIBUTE
static String | ENTRY_ELEMENT
static String | FACTORY_BEAN_ATTRIBUTE
static String | FACTORY_METHOD_ATTRIBUTE
static String | ID_ATTRIBUTE
static String | IDREF_ELEMENT
static String | INDEX_ATTRIBUTE
static String | INIT_METHOD_ATTRIBUTE
static String | KEY_ATTRIBUTE
static String | KEY_ELEMENT
static String | KEY_REF_ATTRIBUTE
static String | KEY_TYPE_ATTRIBUTE
static String | LAZY_INIT_ATTRIBUTE
static String | LIST_ELEMENT
static String | LOCAL_REF_ATTRIBUTE
protected Log | logger
static String | LOOKUP_METHOD_ELEMENT
static String | MAP_ELEMENT
static String | MERGE_ATTRIBUTE
static String | META_ELEMENT
static String | NAME_ATTRIBUTE
static String | NULL_ELEMENT
static String | PARENT_ATTRIBUTE
static String | PARENT_REF_ATTRIBUTE
static String | PRIMARY_ATTRIBUTE
static String | PROP_ELEMENT
static String | PROPERTY_ELEMENT
static String | PROPS_ELEMENT
static String | QUALIFIER_ATTRIBUTE_ELEMENT
static String | QUALIFIER_ELEMENT
static String | REF_ATTRIBUTE
static String | REF_ELEMENT
static String | REPLACED_METHOD_ELEMENT
static String | REPLACER_ATTRIBUTE
static String | SCOPE_ATTRIBUTE
static String | SET_ELEMENT
static String | SINGLETON_ATTRIBUTE
static String | TRUE_VALUE Value of a T/F attribute that represents true.
static String | TYPE_ATTRIBUTE
static String | VALUE_ATTRIBUTE
static String | VALUE_ELEMENT
static String | VALUE_REF_ATTRIBUTE
static String | VALUE_TYPE_ATTRIBUTE
Constructor Summary
BeanDefinitionParserDelegate(XmlReaderContext readerContext)
Create a new BeanDefinitionParserDelegate associated with the supplied XmlReaderContext.
Method Summary
protected TypedStringValue | buildTypedStringValue(String value, String targetTypeName) Build a typed String value Object for the given raw value.
protected Object | buildTypedStringValueForMap(String value, String defaultTypeName, Element entryEle) Build a typed String value Object for the given raw value.
protected void | checkNameUniqueness(String beanName, List<String> aliases, Element beanElement) Validate that the specified bean name and aliases have not been used already.
protected AbstractBeanDefinition | createBeanDefinition(String className, String parentName) Create a bean definition for the given class name and parent name.
BeanDefinitionHolder | decorateBeanDefinitionIfRequired(Element ele, BeanDefinitionHolder definitionHolder)
BeanDefinitionHolder | decorateBeanDefinitionIfRequired(Element ele, BeanDefinitionHolder definitionHolder, BeanDefinition containingBd)
protected void | error(String message, Element source) Report an error with the given message for the given source element.
protected void | error(String message, Element source, Throwable cause) Report an error with the given message for the given source element.
protected void | error(String message, Node source) Report an error with the given message for the given source element.
protected Object | extractSource(Element ele) Invoke the SourceExtractor to pull the source metadata from the supplied Element.
String[] | getAutowireCandidatePatterns() Return any patterns provided in the 'default-autowire-candidates' attribute of the top-level <beans/> element.
int | getAutowireMode(String attValue)
BeanDefinitionDefaults | getBeanDefinitionDefaults() Return the default settings for bean definitions as indicated within the attributes of the top-level <beans/> element.
DocumentDefaultsDefinition | getDefaults() Return the defaults definition object, or null if the defaults have been initialized yet.
int | getDependencyCheck(String attValue)
String | getLocalName(Node node) Gets the local name for the supplied Node.
String | getNamespaceURI(Node node) Gets the namespace URI for the supplied node.
XmlReaderContext | getReaderContext() Get the XmlReaderContext associated with this helper instance.
void | initDefaults(Element root) Initialize the default lazy-init, autowire, dependency check settings, init-method, destroy-method and merge settings.
boolean | isDefaultNamespace(String namespaceUri)
boolean | nodeNameEquals(Node node, String desiredName) Determines whether the name of the supplied node is equal to the supplied name.
Object | parseArrayElement(Element arrayEle, BeanDefinition bd) Parse an array element.
AbstractBeanDefinition | parseBeanDefinitionAttributes(Element ele, String beanName, BeanDefinition containingBean, AbstractBeanDefinition bd) Apply the attributes of the given bean element to the given bean * definition.
BeanDefinitionHolder | parseBeanDefinitionElement(Element ele) Parses the supplied <bean> element.
BeanDefinitionHolder | parseBeanDefinitionElement(Element ele, BeanDefinition containingBean) Parses the supplied <bean> element.
AbstractBeanDefinition | parseBeanDefinitionElement(Element ele, String beanName, BeanDefinition containingBean) Parse the bean definition itself, without regard to name or aliases.
protected void | parseCollectionElements(NodeList elementNodes, Collection<Object> target, BeanDefinition bd, String defaultElementType)
void | parseConstructorArgElement(Element ele, BeanDefinition bd) Parse a constructor-arg element.
void | parseConstructorArgElements(Element beanEle, BeanDefinition bd) Parse constructor-arg sub-elements of the given bean element.
BeanDefinition | parseCustomElement(Element ele)
BeanDefinition | parseCustomElement(Element ele, BeanDefinition containingBd)
Object | parseIdRefElement(Element ele) Return a typed String value Object for the given 'idref' element.
protected Object | parseKeyElement(Element keyEle, BeanDefinition bd, String defaultKeyTypeName) Parse a key sub-element of a map element.
List | parseListElement(Element collectionEle, BeanDefinition bd) Parse a list element.
void | parseLookupOverrideSubElements(Element beanEle, MethodOverrides overrides) Parse lookup-override sub-elements of the given bean element.
Map | parseMapElement(Element mapEle, BeanDefinition bd) Parse a map element.
boolean | parseMergeAttribute(Element collectionElement) Parse the merge attribute of a collection element, if any.
void | parseMetaElements(Element ele, BeanMetadataAttributeAccessor attributeAccessor)
void | parsePropertyElement(Element ele, BeanDefinition bd) Parse a property element.
void | parsePropertyElements(Element beanEle, BeanDefinition bd) Parse property sub-elements of the given bean element.
Object | parsePropertySubElement(Element ele, BeanDefinition bd)
Object | parsePropertySubElement(Element ele, BeanDefinition bd, String defaultValueType) Parse a value, ref or collection sub-element of a property or constructor-arg element.
Object | parsePropertyValue(Element ele, BeanDefinition bd, String propertyName) Get the value of a property element.
Properties | parsePropsElement(Element propsEle) Parse a props element.
void | parseQualifierElement(Element ele, AbstractBeanDefinition bd) Parse a qualifier element.
void | parseQualifierElements(Element beanEle, AbstractBeanDefinition bd) Parse qualifier sub-elements of the given bean element.
void | parseReplacedMethodSubElements(Element beanEle, MethodOverrides overrides) Parse replaced-method sub-elements of the given bean element.
Set | parseSetElement(Element collectionEle, BeanDefinition bd) Parse a set element.
Object | parseValueElement(Element ele, String defaultTypeName) Return a typed String value Object for the given value element.
protected void | populateDefaults(DocumentDefaultsDefinition defaults, Element root) Populate the given DocumentDefaultsDefinition instance with the default lazy-init, autowire, dependency check settings, init-method, destroy-method and merge settings.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

BEANS_NAMESPACE_URI

public static final String BEANS_NAMESPACE_URI
See Also:
Constant Field Values

BEAN_NAME_DELIMITERS

public static final String BEAN_NAME_DELIMITERS
See Also:
Constant Field Values

TRUE_VALUE

public static final String TRUE_VALUE
Value of a T/F attribute that represents true. Anything else represents false. Case seNsItive.

See Also:
Constant Field Values

DEFAULT_VALUE

public static final String DEFAULT_VALUE
See Also:
Constant Field Values

DESCRIPTION_ELEMENT

public static final String DESCRIPTION_ELEMENT
See Also:
Constant Field Values

AUTOWIRE_BY_NAME_VALUE

public static final String AUTOWIRE_BY_NAME_VALUE
See Also:
Constant Field Values

AUTOWIRE_BY_TYPE_VALUE

public static final String AUTOWIRE_BY_TYPE_VALUE
See Also:
Constant Field Values

AUTOWIRE_CONSTRUCTOR_VALUE

public static final String AUTOWIRE_CONSTRUCTOR_VALUE
See Also:
Constant Field Values

AUTOWIRE_AUTODETECT_VALUE

public static final String AUTOWIRE_AUTODETECT_VALUE
See Also:
Constant Field Values

DEPENDENCY_CHECK_ALL_ATTRIBUTE_VALUE

public static final String DEPENDENCY_CHECK_ALL_ATTRIBUTE_VALUE
See Also:
Constant Field Values

DEPENDENCY_CHECK_SIMPLE_ATTRIBUTE_VALUE

public static final String DEPENDENCY_CHECK_SIMPLE_ATTRIBUTE_VALUE
See Also:
Constant Field Values

DEPENDENCY_CHECK_OBJECTS_ATTRIBUTE_VALUE

public static final String DEPENDENCY_CHECK_OBJECTS_ATTRIBUTE_VALUE
See Also:
Constant Field Values

NAME_ATTRIBUTE

public static final String NAME_ATTRIBUTE
See Also:
Constant Field Values

BEAN_ELEMENT

public static final String BEAN_ELEMENT
See Also:
Constant Field Values

META_ELEMENT

public static final String META_ELEMENT
See Also:
Constant Field Values

ID_ATTRIBUTE

public static final String ID_ATTRIBUTE
See Also:
Constant Field Values

PARENT_ATTRIBUTE

public static final String PARENT_ATTRIBUTE
See Also:
Constant Field Values

CLASS_ATTRIBUTE

public static final String CLASS_ATTRIBUTE
See Also:
Constant Field Values

ABSTRACT_ATTRIBUTE

public static final String ABSTRACT_ATTRIBUTE
See Also:
Constant Field Values

SCOPE_ATTRIBUTE

public static final String SCOPE_ATTRIBUTE
See Also:
Constant Field Values

SINGLETON_ATTRIBUTE

public static final String SINGLETON_ATTRIBUTE
See Also:
Constant Field Values

LAZY_INIT_ATTRIBUTE

public static final String LAZY_INIT_ATTRIBUTE
See Also:
Constant Field Values

AUTOWIRE_ATTRIBUTE

public static final String AUTOWIRE_ATTRIBUTE
See Also:
Constant Field Values

AUTOWIRE_CANDIDATE_ATTRIBUTE

public static final String AUTOWIRE_CANDIDATE_ATTRIBUTE
See Also:
Constant Field Values

PRIMARY_ATTRIBUTE

public static final String PRIMARY_ATTRIBUTE
See Also:
Constant Field Values

DEPENDENCY_CHECK_ATTRIBUTE

public static final String DEPENDENCY_CHECK_ATTRIBUTE
See Also:
Constant Field Values

DEPENDS_ON_ATTRIBUTE

public static final String DEPENDS_ON_ATTRIBUTE
See Also:
Constant Field Values

INIT_METHOD_ATTRIBUTE

public static final String INIT_METHOD_ATTRIBUTE
See Also:
Constant Field Values

DESTROY_METHOD_ATTRIBUTE

public static final String DESTROY_METHOD_ATTRIBUTE
See Also:
Constant Field Values

FACTORY_METHOD_ATTRIBUTE

public static final String FACTORY_METHOD_ATTRIBUTE
See Also:
Constant Field Values

FACTORY_BEAN_ATTRIBUTE

public static final String FACTORY_BEAN_ATTRIBUTE
See Also:
Constant Field Values

CONSTRUCTOR_ARG_ELEMENT

public static final String CONSTRUCTOR_ARG_ELEMENT
See Also:
Constant Field Values

INDEX_ATTRIBUTE

public static final String INDEX_ATTRIBUTE
See Also:
Constant Field Values

TYPE_ATTRIBUTE

public static final String TYPE_ATTRIBUTE
See Also:
Constant Field Values

VALUE_TYPE_ATTRIBUTE

public static final String VALUE_TYPE_ATTRIBUTE
See Also:
Constant Field Values

KEY_TYPE_ATTRIBUTE

public static final String KEY_TYPE_ATTRIBUTE
See Also:
Constant Field Values

PROPERTY_ELEMENT

public static final String PROPERTY_ELEMENT
See Also:
Constant Field Values

REF_ATTRIBUTE

public static final String REF_ATTRIBUTE
See Also:
Constant Field Values

VALUE_ATTRIBUTE

public static final String VALUE_ATTRIBUTE
See Also:
Constant Field Values

LOOKUP_METHOD_ELEMENT

public static final String LOOKUP_METHOD_ELEMENT
See Also:
Constant Field Values

REPLACED_METHOD_ELEMENT

public static final String REPLACED_METHOD_ELEMENT
See Also:
Constant Field Values

REPLACER_ATTRIBUTE

public static final String REPLACER_ATTRIBUTE
See Also:
Constant Field Values

ARG_TYPE_ELEMENT

public static final String ARG_TYPE_ELEMENT
See Also:
Constant Field Values

ARG_TYPE_MATCH_ATTRIBUTE

public static final String ARG_TYPE_MATCH_ATTRIBUTE
See Also:
Constant Field Values

REF_ELEMENT

public static final String REF_ELEMENT
See Also:
Constant Field Values

IDREF_ELEMENT

public static final String IDREF_ELEMENT
See Also:
Constant Field Values

BEAN_REF_ATTRIBUTE

public static final String BEAN_REF_ATTRIBUTE
See Also:
Constant Field Values

LOCAL_REF_ATTRIBUTE

public static final String LOCAL_REF_ATTRIBUTE
See Also:
Constant Field Values

PARENT_REF_ATTRIBUTE

public static final String PARENT_REF_ATTRIBUTE
See Also:
Constant Field Values

VALUE_ELEMENT

public static final String VALUE_ELEMENT
See Also:
Constant Field Values

NULL_ELEMENT

public static final String NULL_ELEMENT
See Also:
Constant Field Values

ARRAY_ELEMENT

public static final String ARRAY_ELEMENT
See Also:
Constant Field Values

LIST_ELEMENT

public static final String LIST_ELEMENT
See Also:
Constant Field Values

SET_ELEMENT

public static final String SET_ELEMENT
See Also:
Constant Field Values

MAP_ELEMENT

public static final String MAP_ELEMENT
See Also:
Constant Field Values

ENTRY_ELEMENT

public static final String ENTRY_ELEMENT
See Also:
Constant Field Values

KEY_ELEMENT

public static final String KEY_ELEMENT
See Also:
Constant Field Values

KEY_ATTRIBUTE

public static final String KEY_ATTRIBUTE
See Also:
Constant Field Values

KEY_REF_ATTRIBUTE

public static final String KEY_REF_ATTRIBUTE
See Also:
Constant Field Values

VALUE_REF_ATTRIBUTE

public static final String VALUE_REF_ATTRIBUTE
See Also:
Constant Field Values

PROPS_ELEMENT

public static final String PROPS_ELEMENT
See Also:
Constant Field Values

PROP_ELEMENT

public static final String PROP_ELEMENT
See Also:
Constant Field Values

MERGE_ATTRIBUTE

public static final String MERGE_ATTRIBUTE
See Also:
Constant Field Values

QUALIFIER_ELEMENT

public static final String QUALIFIER_ELEMENT
See Also:
Constant Field Values

QUALIFIER_ATTRIBUTE_ELEMENT

public static final String QUALIFIER_ATTRIBUTE_ELEMENT
See Also:
Constant Field Values

DEFAULT_LAZY_INIT_ATTRIBUTE

public static final String DEFAULT_LAZY_INIT_ATTRIBUTE
See Also:
Constant Field Values

DEFAULT_MERGE_ATTRIBUTE

public static final String DEFAULT_MERGE_ATTRIBUTE
See Also:
Constant Field Values

DEFAULT_AUTOWIRE_ATTRIBUTE

public static final String DEFAULT_AUTOWIRE_ATTRIBUTE
See Also:
Constant Field Values

DEFAULT_DEPENDENCY_CHECK_ATTRIBUTE

public static final String DEFAULT_DEPENDENCY_CHECK_ATTRIBUTE
See Also:
Constant Field Values

DEFAULT_AUTOWIRE_CANDIDATES_ATTRIBUTE

public static final String DEFAULT_AUTOWIRE_CANDIDATES_ATTRIBUTE
See Also:
Constant Field Values

DEFAULT_INIT_METHOD_ATTRIBUTE

public static final String DEFAULT_INIT_METHOD_ATTRIBUTE
See Also:
Constant Field Values

DEFAULT_DESTROY_METHOD_ATTRIBUTE

public static final String DEFAULT_DESTROY_METHOD_ATTRIBUTE
See Also:
Constant Field Values

logger

protected final Log logger
Constructor Detail

BeanDefinitionParserDelegate

public BeanDefinitionParserDelegate(XmlReaderContext readerContext)
Create a new BeanDefinitionParserDelegate associated with the supplied XmlReaderContext.

Method Detail

getReaderContext

public final XmlReaderContext getReaderContext()
Get the XmlReaderContext associated with this helper instance.

extractSource

protected Object extractSource(Element ele)
Invoke the SourceExtractor to pull the source metadata from the supplied Element.

error

protected void error(String message,
                     Node source)
Report an error with the given message for the given source element.

error

protected void error(String message,
                     Element source)
Report an error with the given message for the given source element.

error

protected void error(String message,
                     Element source,
                     Throwable cause)
Report an error with the given message for the given source element.

initDefaults

public void initDefaults(Element root)
Initialize the default lazy-init, autowire, dependency check settings, init-method, destroy-method and merge settings.

See Also:
populateDefaults(DocumentDefaultsDefinition, org.w3c.dom.Element), getDefaults()

populateDefaults

protected void populateDefaults(DocumentDefaultsDefinition defaults,
                                Element root)
Populate the given DocumentDefaultsDefinition instance with the default lazy-init, autowire, dependency check settings, init-method, destroy-method and merge settings.

getDefaults

public DocumentDefaultsDefinition getDefaults()
Return the defaults definition object, or null if the defaults have been initialized yet.

getBeanDefinitionDefaults

public BeanDefinitionDefaults getBeanDefinitionDefaults()
Return the default settings for bean definitions as indicated within the attributes of the top-level <beans/> element.

getAutowireCandidatePatterns

public String[] getAutowireCandidatePatterns()
Return any patterns provided in the 'default-autowire-candidates' attribute of the top-level <beans/> element.

parseBeanDefinitionElement

public BeanDefinitionHolder parseBeanDefinitionElement(Element ele)
Parses the supplied <bean> element. May return null if there were errors during parse. Errors are reported to the ProblemReporter.

parseBeanDefinitionElement

public BeanDefinitionHolder parseBeanDefinitionElement(Element ele,
                                                       BeanDefinition containingBean)
Parses the supplied <bean> element. May return null if there were errors during parse. Errors are reported to the ProblemReporter.

checkNameUniqueness

protected void checkNameUniqueness(String beanName,
                                   List<String> aliases,
                                   Element beanElement)
Validate that the specified bean name and aliases have not been used already.

parseBeanDefinitionElement

public AbstractBeanDefinition parseBeanDefinitionElement(Element ele,
                                                         String beanName,
                                                         BeanDefinition containingBean)
Parse the bean definition itself, without regard to name or aliases. May return null if problems occured during the parse of the bean definition.

parseBeanDefinitionAttributes

public AbstractBeanDefinition parseBeanDefinitionAttributes(Element ele,
                                                            String beanName,
                                                            BeanDefinition containingBean,
                                                            AbstractBeanDefinition bd)
Apply the attributes of the given bean element to the given bean * definition.

Parameters:
ele - bean declaration element
beanName - bean name
containingBean - containing bean definition
Returns:
a bean definition initialized according to the bean element attributes

createBeanDefinition

protected AbstractBeanDefinition createBeanDefinition(String className,
                                                      String parentName)
                                               throws ClassNotFoundException
Create a bean definition for the given class name and parent name.

Parameters:
className - the name of the bean class
parentName - the name of the bean's parent bean
Returns:
the newly created bean definition
Throws:
ClassNotFoundException - if bean class resolution was attempted but failed

parseMetaElements

public void parseMetaElements(Element ele,
                              BeanMetadataAttributeAccessor attributeAccessor)

getAutowireMode

public int getAutowireMode(String attValue)

getDependencyCheck

public int getDependencyCheck(String attValue)

parseConstructorArgElements

public void parseConstructorArgElements(Element beanEle,
                                        BeanDefinition bd)
Parse constructor-arg sub-elements of the given bean element.

parsePropertyElements

public void parsePropertyElements(Element beanEle,
                                  BeanDefinition bd)
Parse property sub-elements of the given bean element.

parseQualifierElements

public void parseQualifierElements(Element beanEle,
                                   AbstractBeanDefinition bd)
Parse qualifier sub-elements of the given bean element.

parseLookupOverrideSubElements

public void parseLookupOverrideSubElements(Element beanEle,
                                           MethodOverrides overrides)
Parse lookup-override sub-elements of the given bean element.

parseReplacedMethodSubElements

public void parseReplacedMethodSubElements(Element beanEle,
                                           MethodOverrides overrides)
Parse replaced-method sub-elements of the given bean element.

parseConstructorArgElement

public void parseConstructorArgElement(Element ele,
                                       BeanDefinition bd)
Parse a constructor-arg element.

parsePropertyElement

public void parsePropertyElement(Element ele,
                                 BeanDefinition bd)
Parse a property element.

parseQualifierElement

public void parseQualifierElement(Element ele,
                                  AbstractBeanDefinition bd)
Parse a qualifier element.

parsePropertyValue

public Object parsePropertyValue(Element ele,
                                 BeanDefinition bd,
                                 String propertyName)
Get the value of a property element. May be a list etc. Also used for constructor arguments, "propertyName" being null in this case.

parsePropertySubElement

public Object parsePropertySubElement(Element ele,
                                      BeanDefinition bd)

parsePropertySubElement

public Object parsePropertySubElement(Element ele,
                                      BeanDefinition bd,
                                      String defaultValueType)
Parse a value, ref or collection sub-element of a property or constructor-arg element.

Parameters:
ele - subelement of property element; we don't know which yet
defaultValueType - the default type (class name) for any <value> tag that might be created

parseIdRefElement

public Object parseIdRefElement(Element ele)
Return a typed String value Object for the given 'idref' element.

parseValueElement

public Object parseValueElement(Element ele,
                                String defaultTypeName)
Return a typed String value Object for the given value element.

buildTypedStringValue

protected TypedStringValue buildTypedStringValue(String value,
                                                 String targetTypeName)
                                          throws ClassNotFoundException
Build a typed String value Object for the given raw value.

Throws:
ClassNotFoundException
See Also:
TypedStringValue

parseArrayElement

public Object parseArrayElement(Element arrayEle,
                                BeanDefinition bd)
Parse an array element.

parseListElement

public List parseListElement(Element collectionEle,
                             BeanDefinition bd)
Parse a list element.

parseSetElement

public Set parseSetElement(Element collectionEle,
                           BeanDefinition bd)
Parse a set element.

parseCollectionElements

protected void parseCollectionElements(NodeList elementNodes,
                                       Collection<Object> target,
                                       BeanDefinition bd,
                                       String defaultElementType)

parseMapElement

public Map parseMapElement(Element mapEle,
                           BeanDefinition bd)
Parse a map element.

buildTypedStringValueForMap

protected final Object buildTypedStringValueForMap(String value,
                                                   String defaultTypeName,
                                                   Element entryEle)
Build a typed String value Object for the given raw value.

See Also:
TypedStringValue

parseKeyElement

protected Object parseKeyElement(Element keyEle,
                                 BeanDefinition bd,
                                 String defaultKeyTypeName)
Parse a key sub-element of a map element.

parsePropsElement

public Properties parsePropsElement(Element propsEle)
Parse a props element.

parseMergeAttribute

public boolean parseMergeAttribute(Element collectionElement)
Parse the merge attribute of a collection element, if any.

parseCustomElement

public BeanDefinition parseCustomElement(Element ele)

parseCustomElement

public BeanDefinition parseCustomElement(Element ele,
                                         BeanDefinition containingBd)

decorateBeanDefinitionIfRequired

public BeanDefinitionHolder decorateBeanDefinitionIfRequired(Element ele,
                                                             BeanDefinitionHolder definitionHolder)

decorateBeanDefinitionIfRequired

public BeanDefinitionHolder decorateBeanDefinitionIfRequired(Element ele,
                                                             BeanDefinitionHolder definitionHolder,
                                                             BeanDefinition containingBd)

isDefaultNamespace

public boolean isDefaultNamespace(String namespaceUri)

getNamespaceURI

public String getNamespaceURI(Node node)
Gets the namespace URI for the supplied node. The default implementation uses Node.getNamespaceURI(). Subclasses may override the default implementation to provide a different namespace identification mechanism.

Parameters:
node - the node
Returns:
the namespace URI of the the node.

nodeNameEquals

public boolean nodeNameEquals(Node node,
                              String desiredName)
Determines whether the name of the supplied node is equal to the supplied name. The default implementation checks the supplied desired name against both Node#getNodeName) and {@link #getLoclName}. Subclasses may override the default implementation to provide a different mechanism for comparing node names.

Parameters:
node - the node to compare
desiredName - the name to check for
Returns:
true if the names are equal otherwise false.

getLocalName

public String getLocalName(Node node)
Gets the local name for the supplied Node. The default implementation calls Node.getLocalName(). Subclasses may override the default implementation to provide a different mechanism for getting the local name.

Parameters:
node - the Node
Returns:
the local name of the supplied Node.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeansDtdResolver

org.springframework.beans.factory.xml
Class BeansDtdResolver

java.lang.Object
    extended by  org.springframework.beans.factory.xml.BeansDtdResolver
All Implemented Interfaces:
EntityResolver
public class BeansDtdResolver
extends Object
implements EntityResolver

EntityResolver implementation for the Spring beans DTD, to load the DTD from the Spring class path (or JAR file).

Fetches "spring-beans-2.0.dtd" from the class path resource "/org/springframework/beans/factory/xml/spring-beans-2.0.dtd", no matter whether specified as some local URL that includes "spring-beans" in the DTD name or as "http://www.springframework.org/dtd/spring-beans-2.0.dtd".

Since:
04.06.2003
Author:
Juergen Hoeller, Colin Sampaleanu
See Also:
ResourceEntityResolver

Constructor Summary
BeansDtdResolver()
Method Summary
InputSource | resolveEntity(String publicId, String systemId)
String | toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

BeansDtdResolver

public BeansDtdResolver()
Method Detail

resolveEntity

public InputSource resolveEntity(String publicId,
                                 String systemId)
                          throws IOException
Specified by:
resolveEntity in interface EntityResolver
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultBeanDefinitionDocumentReader

org.springframework.beans.factory.xml
Class DefaultBeanDefinitionDocumentReader

java.lang.Object
    extended by  org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader
All Implemented Interfaces:
BeanDefinitionDocumentReader
public class DefaultBeanDefinitionDocumentReader
extends Object
implements BeanDefinitionDocumentReader

Default implementation of the BeanDefinitionDocumentReader interface. Reads bean definitions according to the "spring-beans" DTD and XSD format (Spring's default XML bean definition format).

The structure, elements and attribute names of the required XML document are hard-coded in this class. (Of course a transform could be run if necessary to produce this format). <beans> doesn't need to be the root element of the XML document: This class will parse all bean definition elements in the XML file, not regarding the actual root element.

Since:
18.12.2003
Author:
Rod Johnson, Juergen Hoeller, Rob Harrop, Erik Wiersma

Field Summary
static String | ALIAS_ATTRIBUTE
static String | ALIAS_ELEMENT
static String | BEAN_ELEMENT
static String | IMPORT_ELEMENT
protected Log | logger
static String | NAME_ATTRIBUTE
static String | RESOURCE_ATTRIBUTE
Constructor Summary
DefaultBeanDefinitionDocumentReader()
Method Summary
protected BeanDefinitionParserDelegate | createHelper(XmlReaderContext readerContext, Element root)
protected Object | extractSource(Element ele) Invoke the SourceExtractor to pull the source metadata from the supplied Element.
protected XmlReaderContext | getReaderContext() Return the descriptor for the XML resource that this parser works on.
protected void | importBeanDefinitionResource(Element ele) Parse an "import" element and load the bean definitions from the given resource into the bean factory.
protected void | parseBeanDefinitions(Element root, BeanDefinitionParserDelegate delegate) Parse the elements at the root level in the document: "import", "alias", "bean".
protected void | postProcessXml(Element root) Allow the XML to be extensible by processing any custom element types last, after we finished processing the bean definitions.
protected void | preProcessXml(Element root) Allow the XML to be extensible by processing any custom element types first, before we start to process the bean definitions.
protected void | processAliasRegistration(Element ele) Process the given alias element, registering the alias with the registry.
protected void | processBeanDefinition(Element ele, BeanDefinitionParserDelegate delegate) Process the given bean element, parsing the bean definition and registering it with the registry.
void | registerBeanDefinitions(Document doc, XmlReaderContext readerContext) Parses bean definitions according to the "spring-beans" DTD.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

BEAN_ELEMENT

public static final String BEAN_ELEMENT
See Also:
Constant Field Values

ALIAS_ELEMENT

public static final String ALIAS_ELEMENT
See Also:
Constant Field Values

NAME_ATTRIBUTE

public static final String NAME_ATTRIBUTE
See Also:
Constant Field Values

ALIAS_ATTRIBUTE

public static final String ALIAS_ATTRIBUTE
See Also:
Constant Field Values

IMPORT_ELEMENT

public static final String IMPORT_ELEMENT
See Also:
Constant Field Values

RESOURCE_ATTRIBUTE

public static final String RESOURCE_ATTRIBUTE
See Also:
Constant Field Values

logger

protected final Log logger
Constructor Detail

DefaultBeanDefinitionDocumentReader

public DefaultBeanDefinitionDocumentReader()
Method Detail

registerBeanDefinitions

public void registerBeanDefinitions(Document doc,
                                    XmlReaderContext readerContext)
Parses bean definitions according to the "spring-beans" DTD.

Opens a DOM Document; then initializes the default settings specified at <beans> level; then parses the contained bean definitions.

Specified by:
registerBeanDefinitions in interface BeanDefinitionDocumentReader
Parameters:
doc - the DOM document
readerContext - the current context of the reader. Includes the resource being parsed

createHelper

protected BeanDefinitionParserDelegate createHelper(XmlReaderContext readerContext,
                                                    Element root)

getReaderContext

protected final XmlReaderContext getReaderContext()
Return the descriptor for the XML resource that this parser works on.

extractSource

protected Object extractSource(Element ele)
Invoke the SourceExtractor to pull the source metadata from the supplied Element.

parseBeanDefinitions

protected void parseBeanDefinitions(Element root,
                                    BeanDefinitionParserDelegate delegate)
Parse the elements at the root level in the document: "import", "alias", "bean".

Parameters:
root - the DOM root element of the document

importBeanDefinitionResource

protected void importBeanDefinitionResource(Element ele)
Parse an "import" element and load the bean definitions from the given resource into the bean factory.

processAliasRegistration

protected void processAliasRegistration(Element ele)
Process the given alias element, registering the alias with the registry.

processBeanDefinition

protected void processBeanDefinition(Element ele,
                                     BeanDefinitionParserDelegate delegate)
Process the given bean element, parsing the bean definition and registering it with the registry.

preProcessXml

protected void preProcessXml(Element root)
Allow the XML to be extensible by processing any custom element types first, before we start to process the bean definitions. This method is a natural extension point for any other custom pre-processing of the XML.

The default implementation is empty. Subclasses can override this method to convert custom elements into standard Spring bean definitions, for example. Implementors have access to the parser's bean definition reader and the underlying XML resource, through the corresponding accessors.

See Also:
getReaderContext()

postProcessXml

protected void postProcessXml(Element root)
Allow the XML to be extensible by processing any custom element types last, after we finished processing the bean definitions. This method is a natural extension point for any other custom post-processing of the XML.

The default implementation is empty. Subclasses can override this method to convert custom elements into standard Spring bean definitions, for example. Implementors have access to the parser's bean definition reader and the underlying XML resource, through the corresponding accessors.

See Also:
getReaderContext()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultDocumentLoader

org.springframework.beans.factory.xml
Class DefaultDocumentLoader

java.lang.Object
    extended by  org.springframework.beans.factory.xml.DefaultDocumentLoader
All Implemented Interfaces:
DocumentLoader
public class DefaultDocumentLoader
extends Object
implements DocumentLoader

Spring's default DocumentLoader implementation.

Simply loads documents using the standard JAXP-configured XML parser. If you want to change the DocumentBuilder that is used to load documents, then one strategy is to define a corresponding Java system property when starting your JVM. For example, to use the Oracle DocumentBuilder, you might start your application like as follows:

java -Djavax.xml.parsers.DocumentBuilderFactory=oracle.xml.jaxp.JXDocumentBuilderFactory MyMainClass

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller

Constructor Summary
DefaultDocumentLoader()
Method Summary
protected DocumentBuilder | createDocumentBuilder(DocumentBuilderFactory factory, EntityResolver entityResolver, ErrorHandler errorHandler) Create a JAXP DocumentBuilder that this bean definition reader will use for parsing XML documents.
protected DocumentBuilderFactory | createDocumentBuilderFactory(int validationMode, boolean namespaceAware) Create the DocumentBuilderFactory instance.
Document | loadDocument(InputSource inputSource, EntityResolver entityResolver, ErrorHandler errorHandler, int validationMode, boolean namespaceAware) Load the Document at the supplied InputSource using the standard JAXP-configured XML parser.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DefaultDocumentLoader

public DefaultDocumentLoader()
Method Detail

loadDocument

public Document loadDocument(InputSource inputSource,
                             EntityResolver entityResolver,
                             ErrorHandler errorHandler,
                             int validationMode,
                             boolean namespaceAware)
                      throws Exception
Load the Document at the supplied InputSource using the standard JAXP-configured XML parser.

Specified by:
loadDocument in interface DocumentLoader
Parameters:
inputSource - the source of the document that is to be loaded
entityResolver - the resolver that is to be used to resolve any entities
errorHandler - used to report any errors during document loading
validationMode - the type of validation DTD or XSD)
namespaceAware - true if support for XML namespaces is to be provided
Returns:
the loaded document
Throws:
Exception - if an error occurs

createDocumentBuilderFactory

protected DocumentBuilderFactory createDocumentBuilderFactory(int validationMode,
                                                              boolean namespaceAware)
                                                       throws ParserConfigurationException
Create the DocumentBuilderFactory instance.

Parameters:
validationMode - the type of validation: DTD or XSD)
namespaceAware - whether the returned factory is to provide support for XML namespaces
Returns:
the JAXP DocumentBuilderFactory
Throws:
ParserConfigurationException - if we failed to build a proper DocumentBuilderFactory

createDocumentBuilder

protected DocumentBuilder createDocumentBuilder(DocumentBuilderFactory factory,
                                                EntityResolver entityResolver,
                                                ErrorHandler errorHandler)
                                         throws ParserConfigurationException
Create a JAXP DocumentBuilder that this bean definition reader will use for parsing XML documents. Can be overridden in subclasses, adding further initialization of the builder.

Parameters:
factory - the JAXP DocumentBuilderFactory that the DocumentBuilder should be created with
entityResolver - the SAX EntityResolver to use
errorHandler - the SAX ErrorHandler to use
Returns:
the JAXP DocumentBuilder
Throws:
ParserConfigurationException - if thrown by JAXP methods
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultNamespaceHandlerResolver

org.springframework.beans.factory.xml
Class DefaultNamespaceHandlerResolver

java.lang.Object
    extended by  org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver
All Implemented Interfaces:
NamespaceHandlerResolver
public class DefaultNamespaceHandlerResolver
extends Object
implements NamespaceHandlerResolver

Default implementation of the NamespaceHandlerResolver interface. Resolves namespace URIs to implementation classes based on the mappings contained in mapping file.

By default, this implementation looks for the mapping file at META-INF/spring.handlers, but this can be changed using the DefaultNamespaceHandlerResolver(ClassLoader, String) constructor.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
See Also:
NamespaceHandler, DefaultBeanDefinitionDocumentReader

Field Summary
static String | DEFAULT_HANDLER_MAPPINGS_LOCATION The location to look for the mapping files.
protected Log | logger Logger available to subclasses
Constructor Summary
DefaultNamespaceHandlerResolver()
Create a new DefaultNamespaceHandlerResolver using the default mapping file location.
DefaultNamespaceHandlerResolver(ClassLoader classLoader)
Create a new DefaultNamespaceHandlerResolver using the default mapping file location.
DefaultNamespaceHandlerResolver(ClassLoader classLoader, String handlerMappingsLocation)
Create a new DefaultNamespaceHandlerResolver using the supplied mapping file location.
Method Summary
NamespaceHandler | resolve(String namespaceUri) Locate the NamespaceHandler for the supplied namespace URI from the configured mappings.
String | toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

DEFAULT_HANDLER_MAPPINGS_LOCATION

public static final String DEFAULT_HANDLER_MAPPINGS_LOCATION
The location to look for the mapping files. Can be present in multiple JAR files.

See Also:
Constant Field Values

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

DefaultNamespaceHandlerResolver

public DefaultNamespaceHandlerResolver()
Create a new DefaultNamespaceHandlerResolver using the default mapping file location.

This constructor will result in the thread context ClassLoader being used to load resources.

See Also:
DEFAULT_HANDLER_MAPPINGS_LOCATION

DefaultNamespaceHandlerResolver

public DefaultNamespaceHandlerResolver(ClassLoader classLoader)
Create a new DefaultNamespaceHandlerResolver using the default mapping file location.

Parameters:
classLoader - the ClassLoader instance used to load mapping resources (may be null, in which case the thread context ClassLoader will be used)
See Also:
DEFAULT_HANDLER_MAPPINGS_LOCATION

DefaultNamespaceHandlerResolver

public DefaultNamespaceHandlerResolver(ClassLoader classLoader,
                                       String handlerMappingsLocation)
Create a new DefaultNamespaceHandlerResolver using the supplied mapping file location.

Parameters:
classLoader - the ClassLoader instance used to load mapping resources may be null, in which case the thread context ClassLoader will be used)
handlerMappingsLocation - the mapping file location
Method Detail

resolve

public NamespaceHandler resolve(String namespaceUri)
Locate the NamespaceHandler for the supplied namespace URI from the configured mappings.

Specified by:
resolve in interface NamespaceHandlerResolver
Parameters:
namespaceUri - the relevant namespace URI
Returns:
the located NamespaceHandler, or null if none found

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DelegatingEntityResolver

org.springframework.beans.factory.xml
Class DelegatingEntityResolver

java.lang.Object
    extended by  org.springframework.beans.factory.xml.DelegatingEntityResolver
All Implemented Interfaces:
EntityResolver
Direct Known Subclasses:
ResourceEntityResolver
public class DelegatingEntityResolver
extends Object
implements EntityResolver

EntityResolver implementation that delegates to a BeansDtdResolver and a PluggableSchemaResolver for DTDs and XML schemas, respectively.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller, Rick Evans
See Also:
BeansDtdResolver, PluggableSchemaResolver

Field Summary
static String | DTD_SUFFIX Suffix for DTD files
static String | XSD_SUFFIX Suffix for schema definition files
Constructor Summary
DelegatingEntityResolver(ClassLoader classLoader)
Create a new DelegatingEntityResolver that delegates to a default BeansDtdResolver and a default PluggableSchemaResolver.
DelegatingEntityResolver(EntityResolver dtdResolver, EntityResolver schemaResolver)
Create a new DelegatingEntityResolver that delegates to the given EntityResolvers.
Method Summary
InputSource | resolveEntity(String publicId, String systemId)
String | toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

DTD_SUFFIX

public static final String DTD_SUFFIX
Suffix for DTD files

See Also:
Constant Field Values

XSD_SUFFIX

public static final String XSD_SUFFIX
Suffix for schema definition files

See Also:
Constant Field Values
Constructor Detail

DelegatingEntityResolver

public DelegatingEntityResolver(ClassLoader classLoader)
Create a new DelegatingEntityResolver that delegates to a default BeansDtdResolver and a default PluggableSchemaResolver.

Configures the PluggableSchemaResolver with the supplied ClassLoader.

Parameters:
classLoader - the ClassLoader to use for loading (can be null) to use the default ClassLoader)

DelegatingEntityResolver

public DelegatingEntityResolver(EntityResolver dtdResolver,
                                EntityResolver schemaResolver)
Create a new DelegatingEntityResolver that delegates to the given EntityResolvers.

Parameters:
dtdResolver - the EntityResolver to resolve DTDs with
schemaResolver - the EntityResolver to resolve XML schemas with
Method Detail

resolveEntity

public InputSource resolveEntity(String publicId,
                                 String systemId)
                          throws SAXException,
                                 IOException
Specified by:
resolveEntity in interface EntityResolver
Throws:
SAXException
IOException

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DocumentDefaultsDefinition

org.springframework.beans.factory.xml
Class DocumentDefaultsDefinition

java.lang.Object
    extended by  org.springframework.beans.factory.xml.DocumentDefaultsDefinition
All Implemented Interfaces:
BeanMetadataElement, DefaultsDefinition
public class DocumentDefaultsDefinition
extends Object
implements DefaultsDefinition

Simple JavaBean that holds the defaults specified at the <beans> level in a standard Spring XML bean definition document: default-lazy-init, default-autowire, etc.

Since:
2.0.2
Author:
Juergen Hoeller

Constructor Summary
DocumentDefaultsDefinition()
Method Summary
String | getAutowire() Return the default autowire setting for the document that's currently parsed.
String | getAutowireCandidates() Return the default autowire-candidate pattern for the document that's currently parsed.
String | getDependencyCheck() Return the default dependency-check setting for the document that's currently parsed.
String | getDestroyMethod() Return the default destroy-method setting for the document that's currently parsed.
String | getInitMethod() Return the default init-method setting for the document that's currently parsed.
String | getLazyInit() Return the default lazy-init flag for the document that's currently parsed.
String | getMerge() Return the default merge setting for the document that's currently parsed.
Object | getSource() Return the configuration source Object for this metadata element (may be null).
void | setAutowire(String autowire) Set the default autowire setting for the document that's currently parsed.
void | setAutowireCandidates(String autowireCandidates) Set the default autowire-candidate pattern for the document that's currently parsed.
void | setDependencyCheck(String dependencyCheck) Set the default dependency-check setting for the document that's currently parsed.
void | setDestroyMethod(String destroyMethod) Set the default destroy-method setting for the document that's currently parsed.
void | setInitMethod(String initMethod) Set the default init-method setting for the document that's currently parsed.
void | setLazyInit(String lazyInit) Set the default lazy-init flag for the document that's currently parsed.
void | setMerge(String merge) Set the default merge setting for the document that's currently parsed.
void | setSource(Object source) Set the configuration source Object for this metadata element.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DocumentDefaultsDefinition

public DocumentDefaultsDefinition()
Method Detail

setLazyInit

public void setLazyInit(String lazyInit)
Set the default lazy-init flag for the document that's currently parsed.

getLazyInit

public String getLazyInit()
Return the default lazy-init flag for the document that's currently parsed.

setMerge

public void setMerge(String merge)
Set the default merge setting for the document that's currently parsed.

getMerge

public String getMerge()
Return the default merge setting for the document that's currently parsed.

setAutowire

public void setAutowire(String autowire)
Set the default autowire setting for the document that's currently parsed.

getAutowire

public String getAutowire()
Return the default autowire setting for the document that's currently parsed.

setDependencyCheck

public void setDependencyCheck(String dependencyCheck)
Set the default dependency-check setting for the document that's currently parsed.

getDependencyCheck

public String getDependencyCheck()
Return the default dependency-check setting for the document that's currently parsed.

setAutowireCandidates

public void setAutowireCandidates(String autowireCandidates)
Set the default autowire-candidate pattern for the document that's currently parsed. Also accepts a comma-separated list of patterns.

getAutowireCandidates

public String getAutowireCandidates()
Return the default autowire-candidate pattern for the document that's currently parsed. May also return a comma-separated list of patterns.

setInitMethod

public void setInitMethod(String initMethod)
Set the default init-method setting for the document that's currently parsed.

getInitMethod

public String getInitMethod()
Return the default init-method setting for the document that's currently parsed.

setDestroyMethod

public void setDestroyMethod(String destroyMethod)
Set the default destroy-method setting for the document that's currently parsed.

getDestroyMethod

public String getDestroyMethod()
Return the default destroy-method setting for the document that's currently parsed.

setSource

public void setSource(Object source)
Set the configuration source Object for this metadata element.

The exact type of the object will depend on the configuration mechanism used.

getSource

public Object getSource()
Description copied from interface: BeanMetadataElement
Return the configuration source Object for this metadata element (may be null).

Specified by:
getSource in interface BeanMetadataElement
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NamespaceHandlerSupport

org.springframework.beans.factory.xml
Class NamespaceHandlerSupport

java.lang.Object
    extended by  org.springframework.beans.factory.xml.NamespaceHandlerSupport
All Implemented Interfaces:
NamespaceHandler
Direct Known Subclasses:
AopNamespaceHandler, ContextNamespaceHandler, JdbcNamespaceHandler, JeeNamespaceHandler, JmsNamespaceHandler, LangNamespaceHandler, MvcNamespaceHandler, OxmNamespaceHandler, TaskNamespaceHandler, TxNamespaceHandler, UtilNamespaceHandler
public abstract class NamespaceHandlerSupport
extends Object
implements NamespaceHandler

Support class for implementing custom NamespaceHandlers. Parsing and decorating of individual Nodes is done via BeanDefinitionParser and BeanDefinitionDecorator strategy interfaces, respectively.

Provides the registerBeanDefinitionParser(java.lang.String, org.springframework.beans.factory.xml.BeanDefinitionParser) and registerBeanDefinitionDecorator(java.lang.String, org.springframework.beans.factory.xml.BeanDefinitionDecorator) methods for registering a BeanDefinitionParser or BeanDefinitionDecorator to handle a specific element.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
See Also:
registerBeanDefinitionParser(String, BeanDefinitionParser), registerBeanDefinitionDecorator(String, BeanDefinitionDecorator)

Constructor Summary
NamespaceHandlerSupport()
Method Summary
BeanDefinitionHolder | decorate(Node node, BeanDefinitionHolder definition, ParserContext parserContext) Decorates the supplied Node by delegating to the BeanDefinitionDecorator that is registered to handle that Node.
BeanDefinition | parse(Element element, ParserContext parserContext) Parses the supplied Element by delegating to the BeanDefinitionParser that is registered for that Element.
protected void | registerBeanDefinitionDecorator(String elementName, BeanDefinitionDecorator dec) Subclasses can call this to register the supplied BeanDefinitionDecorator to handle the specified element.
protected void | registerBeanDefinitionDecoratorForAttribute(String attrName, BeanDefinitionDecorator dec) Subclasses can call this to register the supplied BeanDefinitionDecorator to handle the specified attribute.
protected void | registerBeanDefinitionParser(String elementName, BeanDefinitionParser parser) Subclasses can call this to register the supplied BeanDefinitionParser to handle the specified element.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.xml.NamespaceHandler
init

Constructor Detail

NamespaceHandlerSupport

public NamespaceHandlerSupport()
Method Detail

parse

public BeanDefinition parse(Element element,
                            ParserContext parserContext)
Parses the supplied Element by delegating to the BeanDefinitionParser that is registered for that Element.

Specified by:
parse in interface NamespaceHandler
Parameters:
element - the element that is to be parsed into one or more BeanDefinitions
parserContext - the object encapsulating the current state of the parsing process
Returns:
the primary BeanDefinition (can be null as explained above)

decorate

public BeanDefinitionHolder decorate(Node node,
                                     BeanDefinitionHolder definition,
                                     ParserContext parserContext)
Decorates the supplied Node by delegating to the BeanDefinitionDecorator that is registered to handle that Node.

Specified by:
decorate in interface NamespaceHandler
Parameters:
node - the source element or attribute that is to be parsed
definition - the current bean definition
parserContext - the object encapsulating the current state of the parsing process
Returns:
the decorated definition (to be registered in the BeanFactory), or simply the original bean definition if no decoration is required. A null value is strictly speaking invalid, but will be leniently treated like the case where the original bean definition gets returned.

registerBeanDefinitionParser

protected final void registerBeanDefinitionParser(String elementName,
                                                  BeanDefinitionParser parser)
Subclasses can call this to register the supplied BeanDefinitionParser to handle the specified element. The element name is the local (non-namespace qualified) name.

registerBeanDefinitionDecorator

protected final void registerBeanDefinitionDecorator(String elementName,
                                                     BeanDefinitionDecorator dec)
Subclasses can call this to register the supplied BeanDefinitionDecorator to handle the specified element. The element name is the local (non-namespace qualified) name.

registerBeanDefinitionDecoratorForAttribute

protected final void registerBeanDefinitionDecoratorForAttribute(String attrName,
                                                                 BeanDefinitionDecorator dec)
Subclasses can call this to register the supplied BeanDefinitionDecorator to handle the specified attribute. The attribute name is the local (non-namespace qualified) name.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ParserContext

org.springframework.beans.factory.xml
Class ParserContext

java.lang.Object
    extended by  org.springframework.beans.factory.xml.ParserContext

public final class ParserContext
extends Object

Context that gets passed along a bean definition parsing process, encapsulating all relevant configuration as well as state. Nested inside an XmlReaderContext.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
See Also:
XmlReaderContext, BeanDefinitionParserDelegate

Constructor Summary
ParserContext(XmlReaderContext readerContext, BeanDefinitionParserDelegate delegate)
ParserContext(XmlReaderContext readerContext, BeanDefinitionParserDelegate delegate, BeanDefinition containingBeanDefinition)
Method Summary
Object | extractSource(Object sourceCandidate)
BeanDefinition | getContainingBeanDefinition()
CompositeComponentDefinition | getContainingComponent()
BeanDefinitionParserDelegate | getDelegate()
XmlReaderContext | getReaderContext()
BeanDefinitionRegistry | getRegistry()
boolean | isDefaultLazyInit()
boolean | isNested()
void | popAndRegisterContainingComponent()
CompositeComponentDefinition | popContainingComponent()
void | pushContainingComponent(CompositeComponentDefinition containingComponent)
void | registerBeanComponent(BeanComponentDefinition component)
void | registerComponent(ComponentDefinition component)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ParserContext

public ParserContext(XmlReaderContext readerContext,
                     BeanDefinitionParserDelegate delegate)

ParserContext

public ParserContext(XmlReaderContext readerContext,
                     BeanDefinitionParserDelegate delegate,
                     BeanDefinition containingBeanDefinition)
Method Detail

getReaderContext

public final XmlReaderContext getReaderContext()

getRegistry

public final BeanDefinitionRegistry getRegistry()

getDelegate

public final BeanDefinitionParserDelegate getDelegate()

getContainingBeanDefinition

public final BeanDefinition getContainingBeanDefinition()

isNested

public final boolean isNested()

isDefaultLazyInit

public boolean isDefaultLazyInit()

extractSource

public Object extractSource(Object sourceCandidate)

getContainingComponent

public CompositeComponentDefinition getContainingComponent()

pushContainingComponent

public void pushContainingComponent(CompositeComponentDefinition containingComponent)

popContainingComponent

public CompositeComponentDefinition popContainingComponent()

popAndRegisterContainingComponent

public void popAndRegisterContainingComponent()

registerComponent

public void registerComponent(ComponentDefinition component)

registerBeanComponent

public void registerBeanComponent(BeanComponentDefinition component)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PluggableSchemaResolver

org.springframework.beans.factory.xml
Class PluggableSchemaResolver

java.lang.Object
    extended by  org.springframework.beans.factory.xml.PluggableSchemaResolver
All Implemented Interfaces:
EntityResolver
public class PluggableSchemaResolver
extends Object
implements EntityResolver

EntityResolver implementation that attempts to resolve schema URLs into local classpath resources using a set of mappings files.

By default, this class will look for mapping files in the classpath using the pattern: META-INF/spring.schemas allowing for multiple files to exist on the classpath at any one time. The format of META-INF/spring.schemas is a properties file where each line should be of the form systemId=schema-location where schema-location should also be a schema file in the classpath. Since systemId is commonly a URL, one must be careful to escape any ':' characters which are treated as delimiters in properties files.

The pattern for the mapping files can be overidden using the PluggableSchemaResolver(ClassLoader, String) constructor

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller

Field Summary
static String DEFAULT_SCHEMA_MAPPINGS_LOCATION
The location of the file that defines schema mappings.
Constructor Summary
PluggableSchemaResolver(ClassLoader classLoader)
Loads the schema URL -> schema file location mappings using the default mapping file pattern "META-INF/spring.schemas".
PluggableSchemaResolver(ClassLoader classLoader, String schemaMappingsLocation)
Loads the schema URL -> schema file location mappings using the given mapping file pattern.
Method Summary
InputSource | resolveEntity(String publicId, String systemId)
String | toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

DEFAULT_SCHEMA_MAPPINGS_LOCATION

public static final String DEFAULT_SCHEMA_MAPPINGS_LOCATION
The location of the file that defines schema mappings. Can be present in multiple JAR files.

See Also:
Constant Field Values
Constructor Detail

PluggableSchemaResolver

public PluggableSchemaResolver(ClassLoader classLoader)
Loads the schema URL -> schema file location mappings using the default mapping file pattern "META-INF/spring.schemas".

Parameters:
classLoader - the ClassLoader to use for loading (can be null) to use the default ClassLoader)
See Also:
PropertiesLoaderUtils.loadAllProperties(String, ClassLoader)

PluggableSchemaResolver

public PluggableSchemaResolver(ClassLoader classLoader,
                               String schemaMappingsLocation)
Loads the schema URL -> schema file location mappings using the given mapping file pattern.

Parameters:
classLoader - the ClassLoader to use for loading (can be null) to use the default ClassLoader)
schemaMappingsLocation - the location of the file that defines schema mappings (must not be empty)
See Also:
PropertiesLoaderUtils.loadAllProperties(String, ClassLoader)
Method Detail

resolveEntity

public InputSource resolveEntity(String publicId,
                                 String systemId)
                          throws IOException
Specified by:
resolveEntity in interface EntityResolver
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResourceEntityResolver

org.springframework.beans.factory.xml
Class ResourceEntityResolver

java.lang.Object
    extended by  org.springframework.beans.factory.xml.DelegatingEntityResolver
        extended by  org.springframework.beans.factory.xml.ResourceEntityResolver
All Implemented Interfaces:
EntityResolver
public class ResourceEntityResolver
extends DelegatingEntityResolver

EntityResolver implementation that tries to resolve entity references through a ResourceLoader (usually, relative to the resource base of an ApplicationContext), if applicable. Extends DelegatingEntityResolver to also provide DTD and XSD lookup.

Allows to use standard XML entities to include XML snippets into an application context definition, for example to split a large XML file into various modules. The include paths can be relative to the application context's resource base as usual, instead of relative to the JVM working directory (the XML parser's default).

Note: In addition to relative paths, every URL that specifies a file in the current system root, i.e. the JVM working directory, will be interpreted relative to the application context too.

Since:
31.07.2003
Author:
Juergen Hoeller
See Also:
ResourceLoader, ApplicationContext

Field Summary
Fields inherited from class org.springframework.beans.factory.xml.DelegatingEntityResolver
DTD_SUFFIX, XSD_SUFFIX
Constructor Summary
ResourceEntityResolver(ResourceLoader resourceLoader)
Create a ResourceEntityResolver for the specified ResourceLoader (usually, an ApplicationContext).
Method Summary
 InputSource resolveEntity(String publicId, String systemId)
Methods inherited from class org.springframework.beans.factory.xml.DelegatingEntityResolver
toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ResourceEntityResolver

public ResourceEntityResolver(ResourceLoader resourceLoader)
Create a ResourceEntityResolver for the specified ResourceLoader (usually, an ApplicationContext).

Parameters:
resourceLoader - the ResourceLoader (or ApplicationContext) to load XML entity includes with
Method Detail

resolveEntity

public InputSource resolveEntity(String publicId,
                                 String systemId)
                          throws SAXException,
                                 IOException
Specified by:
resolveEntity in interface EntityResolver
Overrides:
resolveEntity in class DelegatingEntityResolver
Throws:
SAXException
IOException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimplePropertyNamespaceHandler

org.springframework.beans.factory.xml
Class SimplePropertyNamespaceHandler

java.lang.Object
    extended by  org.springframework.beans.factory.xml.SimplePropertyNamespaceHandler
All Implemented Interfaces:
NamespaceHandler
public class SimplePropertyNamespaceHandler
extends Object
implements NamespaceHandler

Simple NamespaceHandler implementation that maps custom attributes directly through to bean properties. An important point to note is that this NamespaceHandler does not have a corresponding schema since there is no way to know in advance all possible attribute names.

An example of the usage of this NamespaceHandler is shown below:

 <bean id="rob" class="..TestBean" p:name="Rob Harrop" p:spouse-ref="sally"/>
Here the 'p:name' corresponds directly to the 'name' property on class 'TestBean'. The 'p:spouse-ref' attributes corresponds to the 'spouse' property and, rather than being the concrete value, it contains the name of the bean that will be injected into that property.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller

Constructor Summary
SimplePropertyNamespaceHandler()
Method Summary
BeanDefinitionHolder | decorate(Node node, BeanDefinitionHolder definition, ParserContext parserContext) Parse the specified Node and decorate the supplied BeanDefinitionHolder, returning the decorated definition.
void | init() Invoked by the DefaultBeanDefinitionDocumentReader after construction but before any custom elements are parsed.
BeanDefinition | parse(Element element, ParserContext parserContext) Parse the specified Element and register any resulting BeanDefinitions with the BeanDefinitionRegistry that is embedded in the supplied ParserContext.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimplePropertyNamespaceHandler

public SimplePropertyNamespaceHandler()
Method Detail

init

public void init()
Description copied from interface: NamespaceHandler
Invoked by the DefaultBeanDefinitionDocumentReader after construction but before any custom elements are parsed.

Specified by:
init in interface NamespaceHandler
See Also:
NamespaceHandlerSupport.registerBeanDefinitionParser(String, BeanDefinitionParser)

parse

public BeanDefinition parse(Element element,
                            ParserContext parserContext)
Description copied from interface: NamespaceHandler
Parse the specified Element and register any resulting BeanDefinitions with the BeanDefinitionRegistry that is embedded in the supplied ParserContext.

Implementations should return the primary BeanDefinition that results from the parse phase if they wish to be used nested inside (for example) a <property> tag.

Implementations may return null if they will not be used in a nested scenario.

Specified by:
parse in interface NamespaceHandler
Parameters:
element - the element that is to be parsed into one or more BeanDefinitions
parserContext - the object encapsulating the current state of the parsing process
Returns:
the primary BeanDefinition (can be null as explained above)

decorate

public BeanDefinitionHolder decorate(Node node,
                                     BeanDefinitionHolder definition,
                                     ParserContext parserContext)
Description copied from interface: NamespaceHandler
Parse the specified Node and decorate the supplied BeanDefinitionHolder, returning the decorated definition.

The Node may be either an Attr or an Element, depending on whether a custom attribute or element is being parsed.

Implementations may choose to return a completely new definition, which will replace the original definition in the resulting BeanFactory.

The supplied ParserContext can be used to register any additional beans needed to support the main definition.

Specified by:
decorate in interface NamespaceHandler
Parameters:
node - the source element or attribute that is to be parsed
definition - the current bean definition
parserContext - the object encapsulating the current state of the parsing process
Returns:
the decorated definition (to be registered in the BeanFactory), or simply the original bean definition if no decoration is required. A null value is strictly speaking invalid, but will be leniently treated like the case where the original bean definition gets returned.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UtilNamespaceHandler

org.springframework.beans.factory.xml
Class UtilNamespaceHandler

java.lang.Object
    extended by  org.springframework.beans.factory.xml.NamespaceHandlerSupport
        extended by  org.springframework.beans.factory.xml.UtilNamespaceHandler
All Implemented Interfaces:
NamespaceHandler
public class UtilNamespaceHandler
extends NamespaceHandlerSupport

NamespaceHandler for the util namespace.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller

Constructor Summary
UtilNamespaceHandler()
Method Summary
 void init()
Invoked by the DefaultBeanDefinitionDocumentReader after construction but before any custom elements are parsed.
Methods inherited from class org.springframework.beans.factory.xml.NamespaceHandlerSupport
decorate, parse, registerBeanDefinitionDecorator, registerBeanDefinitionDecoratorForAttribute, registerBeanDefinitionParser
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

UtilNamespaceHandler

public UtilNamespaceHandler()
Method Detail

init

public void init()
Description copied from interface: NamespaceHandler
Invoked by the DefaultBeanDefinitionDocumentReader after construction but before any custom elements are parsed.

See Also:
NamespaceHandlerSupport.registerBeanDefinitionParser(String, BeanDefinitionParser)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XmlBeanDefinitionReader

org.springframework.beans.factory.xml
Class XmlBeanDefinitionReader

java.lang.Object
    extended by  org.springframework.beans.factory.support.AbstractBeanDefinitionReader
        extended by  org.springframework.beans.factory.xml.XmlBeanDefinitionReader
All Implemented Interfaces:
BeanDefinitionReader
public class XmlBeanDefinitionReader
extends AbstractBeanDefinitionReader

Bean definition reader for XML bean definitions. Delegates the actual XML document reading to an implementation of the BeanDefinitionDocumentReader interface.

Typically applied to a DefaultListableBeanFactory or a GenericApplicationContext.

This class loads a DOM document and applies the BeanDefinitionDocumentReader to it. The document reader will register each bean definition with the given bean factory, talking to the latter's implementation of the BeanDefinitionRegistry interface.

Since:
26.11.2003
Author:
Juergen Hoeller, Rob Harrop
See Also:
setDocumentReaderClass(java.lang.Class), BeanDefinitionDocumentReader, DefaultBeanDefinitionDocumentReader, BeanDefinitionRegistry, DefaultListableBeanFactory, GenericApplicationContext

Field Summary
static int | VALIDATION_AUTO Indicates that the validation mode should be detected automatically.
static int | VALIDATION_DTD Indicates that DTD validation should be used.
static int | VALIDATION_NONE Indicates that the validation should be disabled.
static int | VALIDATION_XSD Indicates that XSD validation should be used.
Fields inherited from class org.springframework.beans.factory.support.AbstractBeanDefinitionReader
logger
Constructor Summary
XmlBeanDefinitionReader(BeanDefinitionRegistry registry)
Create new XmlBeanDefinitionReader for the given bean factory.
Method Summary
protected BeanDefinitionDocumentReader | createBeanDefinitionDocumentReader() Create the BeanDefinitionDocumentReader to use for actually reading bean definitions from an XML document.
protected NamespaceHandlerResolver | createDefaultNamespaceHandlerResolver() Create the default implementation of NamespaceHandlerResolver used if none is specified.
protected XmlReaderContext | createReaderContext(Resource resource) Create the XmlReaderContext to pass over to the document reader.
protected int | detectValidationMode(Resource resource) Detects which kind of validation to perform on the XML file identified by the supplied Resource.
protected int | doLoadBeanDefinitions(InputSource inputSource, Resource resource) Actually load bean definitions from the specified XML file.
protected EntityResolver | getEntityResolver() Return the EntityResolver to use, building a default resolver if none specified.
int | getValidationMode() Return the validation mode to use.
protected int | getValidationModeForResource(Resource resource) Gets the validation mode for the specified Resource.
boolean | isNamespaceAware() Return whether or not the XML parser should be XML namespace aware.
int | loadBeanDefinitions(EncodedResource encodedResource) Load bean definitions from the specified XML file.
int | loadBeanDefinitions(InputSource inputSource) Load bean definitions from the specified XML file.
int | loadBeanDefinitions(InputSource inputSource, String resourceDescription) Load bean definitions from the specified XML file.
int | loadBeanDefinitions(Resource resource) Load bean definitions from the specified XML file.
int | registerBeanDefinitions(Document doc, Resource resource) Register the bean definitions contained in the given DOM document.
void | setDocumentLoader(DocumentLoader documentLoader) Specify the DocumentLoader to use.
void | setDocumentReaderClass(Class documentReaderClass) Specify the BeanDefinitionDocumentReader implementation to use, responsible for the actual reading of the XML bean definition document.
void | setEntityResolver(EntityResolver entityResolver) Set a SAX entity resolver to be used for parsing.
void | setErrorHandler(ErrorHandler errorHandler) Set an implementation of the org.xml.sax.ErrorHandler interface for custom handling of XML parsing errors and warnings.
void | setEventListener(ReaderEventListener eventListener) Specify which ReaderEventListener to use.
void | setNamespaceAware(boolean namespaceAware) Set whether or not the XML parser should be XML namespace aware.
void | setNamespaceHandlerResolver(NamespaceHandlerResolver namespaceHandlerResolver) Specify the NamespaceHandlerResolver to use.
void | setProblemReporter(ProblemReporter problemReporter) Specify which ProblemReporter to use.
void | setSourceExtractor(SourceExtractor sourceExtractor) Specify the SourceExtractor to use.
void | setValidating(boolean validating) Set whether to use XML validation.
void | setValidationMode(int validationMode) Set the validation mode to use.
void | setValidationModeName(String validationModeName) Set the validation mode to use by name.
Methods inherited from class org.springframework.beans.factory.support.AbstractBeanDefinitionReader
getBeanClassLoader, getBeanFactory, getBeanNameGenerator, getRegistry, getResourceLoader, loadBeanDefinitions, loadBeanDefinitions, loadBeanDefinitions, loadBeanDefinitions, setBeanClassLoader, setBeanNameGenerator, setResourceLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

VALIDATION_NONE

public static final int VALIDATION_NONE
Indicates that the validation should be disabled.

See Also:
Constant Field Values

VALIDATION_AUTO

public static final int VALIDATION_AUTO
Indicates that the validation mode should be detected automatically.

See Also:
Constant Field Values

VALIDATION_DTD

public static final int VALIDATION_DTD
Indicates that DTD validation should be used.

See Also:
Constant Field Values

VALIDATION_XSD

public static final int VALIDATION_XSD
Indicates that XSD validation should be used.

See Also:
Constant Field Values
Constructor Detail

XmlBeanDefinitionReader

public XmlBeanDefinitionReader(BeanDefinitionRegistry registry)
Create new XmlBeanDefinitionReader for the given bean factory.

Parameters:
registry - the BeanFactory to load bean definitions into, in the form of a BeanDefinitionRegistry
Method Detail

setValidating

public void setValidating(boolean validating)
Set whether to use XML validation. Default is true.

This method switches namespace awareness on if validation is turned off, in order to still process schema namespaces properly in such a scenario.

See Also:
setValidationMode(int), setNamespaceAware(boolean)

setValidationModeName

public void setValidationModeName(String validationModeName)
Set the validation mode to use by name. Defaults to VALIDATION_AUTO.

See Also:
setValidationMode(int)

setValidationMode

public void setValidationMode(int validationMode)
Set the validation mode to use. Defaults to VALIDATION_AUTO.

Note that this only activates or deactivates validation itself. If you are switching validation off for schema files, you might need to activate schema namespace support explicitly: see setNamespaceAware(boolean).

getValidationMode

public int getValidationMode()
Return the validation mode to use.

setNamespaceAware

public void setNamespaceAware(boolean namespaceAware)
Set whether or not the XML parser should be XML namespace aware. Default is "false".

This is typically not needed when schema validation is active. However, without validation, this has to be switched to "true" in order to properly process schema namespaces.

isNamespaceAware

public boolean isNamespaceAware()
Return whether or not the XML parser should be XML namespace aware.

setProblemReporter

public void setProblemReporter(ProblemReporter problemReporter)
Specify which ProblemReporter to use.

The default implementation is FailFastProblemReporter which exhibits fail fast behaviour. External tools can provide an alternative implementation that collates errors and warnings for display in the tool UI.

setEventListener

public void setEventListener(ReaderEventListener eventListener)
Specify which ReaderEventListener to use.

The default implementation is EmptyReaderEventListener which discards every event notification. External tools can provide an alternative implementation to monitor the components being registered in the BeanFactory.

setSourceExtractor

public void setSourceExtractor(SourceExtractor sourceExtractor)
Specify the SourceExtractor to use.

The default implementation is NullSourceExtractor which simply returns null as the source object. This means that - during normal runtime execution - no additional source metadata is attached to the bean configuration metadata.

setNamespaceHandlerResolver

public void setNamespaceHandlerResolver(NamespaceHandlerResolver namespaceHandlerResolver)
Specify the NamespaceHandlerResolver to use.

If none is specified, a default instance will be created through createDefaultNamespaceHandlerResolver().

setDocumentLoader

public void setDocumentLoader(DocumentLoader documentLoader)
Specify the DocumentLoader to use.

The default implementation is DefaultDocumentLoader which loads Document instances using JAXP.

setEntityResolver

public void setEntityResolver(EntityResolver entityResolver)
Set a SAX entity resolver to be used for parsing.

By default, ResourceEntityResolver will be used. Can be overridden for custom entity resolution, for example relative to some specific base path.

getEntityResolver

protected EntityResolver getEntityResolver()
Return the EntityResolver to use, building a default resolver if none specified.

setErrorHandler

public void setErrorHandler(ErrorHandler errorHandler)
Set an implementation of the org.xml.sax.ErrorHandler interface for custom handling of XML parsing errors and warnings.

If not set, a default SimpleSaxErrorHandler is used that simply logs warnings using the logger instance of the view class, and rethrows errors to discontinue the XML transformation.

See Also:
SimpleSaxErrorHandler

setDocumentReaderClass

public void setDocumentReaderClass(Class documentReaderClass)
Specify the BeanDefinitionDocumentReader implementation to use, responsible for the actual reading of the XML bean definition document.

The default is DefaultBeanDefinitionDocumentReader.

Parameters:
documentReaderClass - the desired BeanDefinitionDocumentReader implementation class

loadBeanDefinitions

public int loadBeanDefinitions(Resource resource)
                        throws BeanDefinitionStoreException
Load bean definitions from the specified XML file.

Parameters:
resource - the resource descriptor for the XML file
Returns:
the number of bean definitions found
Throws:
BeanDefinitionStoreException - in case of loading or parsing errors

loadBeanDefinitions

public int loadBeanDefinitions(EncodedResource encodedResource)
                        throws BeanDefinitionStoreException
Load bean definitions from the specified XML file.

Parameters:
encodedResource - the resource descriptor for the XML file, allowing to specify an encoding to use for parsing the file
Returns:
the number of bean definitions found
Throws:
BeanDefinitionStoreException - in case of loading or parsing errors

loadBeanDefinitions

public int loadBeanDefinitions(InputSource inputSource)
                        throws BeanDefinitionStoreException
Load bean definitions from the specified XML file.

Parameters:
inputSource - the SAX InputSource to read from
Returns:
the number of bean definitions found
Throws:
BeanDefinitionStoreException - in case of loading or parsing errors

loadBeanDefinitions

public int loadBeanDefinitions(InputSource inputSource,
                               String resourceDescription)
                        throws BeanDefinitionStoreException
Load bean definitions from the specified XML file.

Parameters:
inputSource - the SAX InputSource to read from
resourceDescription - a description of the resource (can be null or empty)
Returns:
the number of bean definitions found
Throws:
BeanDefinitionStoreException - in case of loading or parsing errors

doLoadBeanDefinitions

protected int doLoadBeanDefinitions(InputSource inputSource,
                                    Resource resource)
                             throws BeanDefinitionStoreException
Actually load bean definitions from the specified XML file.

Parameters:
inputSource - the SAX InputSource to read from
resource - the resource descriptor for the XML file
Returns:
the number of bean definitions found
Throws:
BeanDefinitionStoreException - in case of loading or parsing errors

getValidationModeForResource

protected int getValidationModeForResource(Resource resource)
Gets the validation mode for the specified Resource. If no explicit validation mode has been configured then the validation mode is detected.

Override this method if you would like full control over the validation mode, even when something other than VALIDATION_AUTO was set.

detectValidationMode

protected int detectValidationMode(Resource resource)
Detects which kind of validation to perform on the XML file identified by the supplied Resource. If the file has a DOCTYPE definition then DTD validation is used otherwise XSD validation is assumed.

Override this method if you would like to customize resolution of the VALIDATION_AUTO mode.

registerBeanDefinitions

public int registerBeanDefinitions(Document doc,
                                   Resource resource)
                            throws BeanDefinitionStoreException
Register the bean definitions contained in the given DOM document. Called by loadBeanDefinitions.

Creates a new instance of the parser class and invokes registerBeanDefinitions on it.

Parameters:
doc - the DOM document
resource - the resource descriptor (for context information)
Returns:
the number of bean definitions found
Throws:
BeanDefinitionStoreException - in case of parsing errors
See Also:
loadBeanDefinitions(org.springframework.core.io.Resource),
setDocumentReaderClass(java.lang.Class),
BeanDefinitionDocumentReader.registerBeanDefinitions(org.w3c.dom.Document, org.springframework.beans.factory.xml.XmlReaderContext)

createBeanDefinitionDocumentReader

protected BeanDefinitionDocumentReader createBeanDefinitionDocumentReader()
Create the BeanDefinitionDocumentReader to use for actually reading bean definitions from an XML document.

The default implementation instantiates the specified "documentReaderClass".

See Also:
setDocumentReaderClass(java.lang.Class)

createReaderContext

protected XmlReaderContext createReaderContext(Resource resource)
Create the XmlReaderContext to pass over to the document reader.

createDefaultNamespaceHandlerResolver

protected NamespaceHandlerResolver createDefaultNamespaceHandlerResolver()
Create the default implementation of NamespaceHandlerResolver used if none is specified. Default implementation returns an instance of DefaultNamespaceHandlerResolver.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XmlBeanFactory

org.springframework.beans.factory.xml
Class XmlBeanFactory

java.lang.Object
    extended by  org.springframework.core.SimpleAliasRegistry
        extended by  org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
            extended by  org.springframework.beans.factory.support.FactoryBeanRegistrySupport
                extended by  org.springframework.beans.factory.support.AbstractBeanFactory
                    extended by  org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
                        extended by  org.springframework.beans.factory.support.DefaultListableBeanFactory
                            extended by  org.springframework.beans.factory.xml.XmlBeanFactory
All Implemented Interfaces:
Serializable, BeanFactory, AutowireCapableBeanFactory, ConfigurableBeanFactory, ConfigurableListableBeanFactory, SingletonBeanRegistry, HierarchicalBeanFactory, ListableBeanFactory, BeanDefinitionRegistry, AliasRegistry
public class XmlBeanFactory
extends DefaultListableBeanFactory

Convenience extension of DefaultListableBeanFactory that reads bean definitions from an XML document. Delegates to XmlBeanDefinitionReader underneath; effectively equivalent to using an XmlBeanDefinitionReader with a DefaultListableBeanFactory.

The structure, element and attribute names of the required XML document are hard-coded in this class. (Of course a transform could be run if necessary to produce this format). "beans" doesn't need to be the root element of the XML document: This class will parse all bean definition elements in the XML file.

This class registers each bean definition with the DefaultListableBeanFactory superclass, and relies on the latter's implementation of the BeanFactory interface. It supports singletons, prototypes, and references to either of these kinds of bean. See "spring-beans-2.0.dtd" for details on options and configuration style.

For advanced needs, consider using a DefaultListableBeanFactory with an XmlBeanDefinitionReader. The latter allows for reading from multiple XML resources and is highly configurable in its actual XML parsing behavior.

Since:
15 April 2001
Author:
Rod Johnson, Juergen Hoeller
See Also:
DefaultListableBeanFactory, XmlBeanDefinitionReader, Serialized Form

Field Summary
Fields inherited from class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
logger, NULL_OBJECT
Fields inherited from interface org.springframework.beans.factory.config.AutowireCapableBeanFactory
AUTOWIRE_AUTODETECT, AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_CONSTRUCTOR, AUTOWIRE_NO
Fields inherited from interface org.springframework.beans.factory.config.ConfigurableBeanFactory
SCOPE_PROTOTYPE, SCOPE_SINGLETON
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Constructor Summary
XmlBeanFactory(Resource resource)
Create a new XmlBeanFactory with the given resource, which must be parsable using DOM.
XmlBeanFactory(Resource resource, BeanFactory parentBeanFactory)
Create a new XmlBeanFactory with the given input stream, which must be parsable using DOM.
Method Summary
Methods inherited from class org.springframework.beans.factory.support.DefaultListableBeanFactory
allowAliasOverriding, containsBeanDefinition, copyConfigurationFrom, determinePrimaryCandidate, doResolveDependency, findAnnotationOnBean, findAutowireCandidates, freezeConfiguration, getAutowireCandidateResolver, getBean, getBeanDefinition, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation, isAutowireCandidate, isAutowireCandidate, isBeanEligibleForMetadataCaching, isConfigurationFrozen, isPrimary, matchesBeanName, preInstantiateSingletons, registerBeanDefinition, registerResolvableDependency, removeBeanDefinition, resetBeanDefinition, resolveDependency, setAllowBeanDefinitionOverriding, setAllowEagerClassLoading, setAutowireCandidateResolver, setSerializationId, toString, writeReplace
Methods inherited from class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
applyBeanPostProcessorsAfterInitialization, applyBeanPostProcessorsBeforeInitialization, applyBeanPostProcessorsBeforeInstantiation, applyBeanPropertyValues, applyMergedBeanDefinitionPostProcessors, applyPropertyValues, autowire, autowireBean, autowireBeanProperties, autowireByName, autowireByType, autowireConstructor, checkDependencies, configureBean, createBean, createBean, createBean, createBeanInstance, determineConstructorsFromBeanPostProcessors, doCreateBean, filterPropertyDescriptorsForDependencyCheck, getEarlyBeanReference, getInstantiationStrategy, getParameterNameDiscoverer, getTypeForFactoryBean, getTypeForFactoryMethod, ignoreDependencyInterface, ignoreDependencyType, initializeBean, initializeBean, instantiateBean, instantiateUsingFactoryMethod, invokeCustomInitMethod, invokeInitMethods, isExcludedFromDependencyCheck, populateBean, postProcessObjectFromFactoryBean, predictBeanType, removeSingleton, resolveBeforeInstantiation, resolveDependency, setAllowCircularReferences, setAllowRawInjectionDespiteWrapping, setInstantiationStrategy, setParameterNameDiscoverer, unsatisfiedNonSimpleProperties
Methods inherited from class org.springframework.beans.factory.support.AbstractBeanFactory
addBeanPostProcessor, addEmbeddedValueResolver, addPropertyEditorRegistrar, afterPrototypeCreation, beforePrototypeCreation, checkMergedBeanDefinition, clearMergedBeanDefinition, containsBean, containsLocalBean, copyRegisteredEditorsTo, destroyBean, destroyBean, destroyScopedBean, doGetBean, evaluateBeanDefinitionString, getAccessControlContext, getAliases, getBean, getBean, getBean, getBean, getBeanClassLoader, getBeanExpressionResolver, getBeanPostProcessorCount, getBeanPostProcessors, getConversionService, getCustomEditors, getCustomTypeConverter, getMergedBeanDefinition, getMergedBeanDefinition, getMergedBeanDefinition, getMergedLocalBeanDefinition, getObjectForBeanInstance, getParentBeanFactory, getPropertyEditorRegistrars, getRegisteredScope, getRegisteredScopeNames, getTempClassLoader, getType, getTypeConverter, hasDestructionAwareBeanPostProcessors, hasInstantiationAwareBeanPostProcessors, initBeanWrapper, isBeanNameInUse, isCacheBeanMetadata, isCurrentlyInCreation, isFactoryBean, isFactoryBean, isPrototype, isPrototypeCurrentlyInCreation, isSingleton, isTypeMatch, markBeanAsCreated, originalBeanName, registerCustomEditor, registerCustomEditors, registerDisposableBeanIfNecessary, registerScope, removeSingletonIfCreatedForTypeCheckOnly, requiresDestruction, resolveBeanClass, resolveEmbeddedValue, setBeanClassLoader, setBeanExpressionResolver, setCacheBeanMetadata, setConversionService, setParentBeanFactory, setSecurityContextProvider, setTempClassLoader, setTypeConverter, transformedBeanName
Methods inherited from class org.springframework.beans.factory.support.FactoryBeanRegistrySupport
getCachedObjectForFactoryBean, getFactoryBean, getObjectFromFactoryBean, getTypeForFactoryBean
Methods inherited from class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
addSingleton, addSingletonFactory, afterSingletonCreation, beforeSingletonCreation, containsSingleton, destroyBean, destroySingleton, destroySingletons, getDependenciesForBean, getDependentBeans, getSingleton, getSingleton, getSingleton, getSingletonCount, getSingletonMutex, getSingletonNames, hasDependentBean, isSingletonCurrentlyInCreation, onSuppressedException, registerContainedBean, registerDependentBean, registerDisposableBean, registerSingleton
Methods inherited from class org.springframework.core.SimpleAliasRegistry
canonicalName, getAliases, isAlias, registerAlias, removeAlias, resolveAliases
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.config.ConfigurableListableBeanFactory
ignoreDependencyInterface, ignoreDependencyType
Methods inherited from interface org.springframework.beans.factory.config.AutowireCapableBeanFactory
applyBeanPostProcessorsAfterInitialization, applyBeanPostProcessorsBeforeInitialization, applyBeanPropertyValues, autowire, autowireBean, autowireBeanProperties, configureBean, createBean, createBean, initializeBean, resolveDependency
Methods inherited from interface org.springframework.beans.factory.config.ConfigurableBeanFactory
addBeanPostProcessor, addEmbeddedValueResolver, addPropertyEditorRegistrar, copyRegisteredEditorsTo, destroyBean, destroyScopedBean, destroySingletons, getAccessControlContext, getBeanClassLoader, getBeanExpressionResolver, getBeanPostProcessorCount, getConversionService, getDependenciesForBean, getDependentBeans, getMergedBeanDefinition, getRegisteredScope, getRegisteredScopeNames, getTempClassLoader, getTypeConverter, isCacheBeanMetadata, isCurrentlyInCreation, isFactoryBean, registerAlias, registerCustomEditor, registerDependentBean, registerScope, resolveAliases, resolveEmbeddedValue, setBeanClassLoader, setBeanExpressionResolver, setCacheBeanMetadata, setConversionService, setParentBeanFactory, setTempClassLoader, setTypeConverter
Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory
containsLocalBean, getParentBeanFactory
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getBean, getType, isPrototype, isSingleton, isTypeMatch
Methods inherited from interface org.springframework.beans.factory.config.SingletonBeanRegistry
containsSingleton, getSingleton, getSingletonCount, getSingletonNames, registerSingleton
Methods inherited from interface org.springframework.beans.factory.support.BeanDefinitionRegistry
isBeanNameInUse
Methods inherited from interface org.springframework.core.AliasRegistry
getAliases, isAlias, registerAlias, removeAlias

Constructor Detail

XmlBeanFactory

public XmlBeanFactory(Resource resource)
               throws BeansException
Create a new XmlBeanFactory with the given resource, which must be parsable using DOM.

Parameters:
resource - XML resource to load bean definitions from
Throws:
BeansException - in case of loading or parsing errors

XmlBeanFactory

public XmlBeanFactory(Resource resource,
                      BeanFactory parentBeanFactory)
               throws BeansException
Create a new XmlBeanFactory with the given input stream, which must be parsable using DOM.

Parameters:
resource - XML resource to load bean definitions from
parentBeanFactory - parent bean factory
Throws:
BeansException - in case of loading or parsing errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XmlReaderContext

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.beans.factory.xml
Class XmlReaderContext

java.lang.Object
    extended by  org.springframework.beans.factory.parsing.ReaderContext
        extended by  org.springframework.beans.factory.xml.XmlReaderContext

public class XmlReaderContext
extends ReaderContext

Extension of ReaderContext, specific to use with an XmlBeanDefinitionReader. Provides access to the NamespaceHandlerResolver configured in the XmlBeanDefinitionReader.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller

Constructor Summary
XmlReaderContext(Resource resource, ProblemReporter problemReporter, ReaderEventListener eventListener, SourceExtractor sourceExtractor, XmlBeanDefinitionReader reader, NamespaceHandlerResolver namespaceHandlerResolver)
Method Summary
String | generateBeanName(BeanDefinition beanDefinition)
ClassLoader | getBeanClassLoader()
NamespaceHandlerResolver | getNamespaceHandlerResolver()
XmlBeanDefinitionReader | getReader()
BeanDefinitionRegistry | getRegistry()
ResourceLoader | getResourceLoader()
String | registerWithGeneratedName(BeanDefinition beanDefinition)
Methods inherited from class org.springframework.beans.factory.parsing.ReaderContext
error, error, error, error, extractSource, fatal, fatal, fatal, fatal, fireAliasRegistered, fireComponentRegistered, fireDefaultsRegistered, fireImportProcessed, fireImportProcessed, getResource, getSourceExtractor, warning, warning, warning, warning
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

XmlReaderContext

public XmlReaderContext(Resource resource,
                        ProblemReporter problemReporter,
                        ReaderEventListener eventListener,
                        SourceExtractor sourceExtractor,
                        XmlBeanDefinitionReader reader,
                        NamespaceHandlerResolver namespaceHandlerResolver)
Method Detail

getReader

public final XmlBeanDefinitionReader getReader()

getRegistry

public final BeanDefinitionRegistry getRegistry()

getResourceLoader

public final ResourceLoader getResourceLoader()

getBeanClassLoader

public final ClassLoader getBeanClassLoader()

getNamespaceHandlerResolver

public final NamespaceHandlerResolver getNamespaceHandlerResolver()

generateBeanName

public String generateBeanName(BeanDefinition beanDefinition)

registerWithGeneratedName

public String registerWithGeneratedName(BeanDefinition beanDefinition)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


XmlBeanDefinitionStoreException

org.springframework.beans.factory.xml
Class XmlBeanDefinitionStoreException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.beans.BeansException
                        extended by  org.springframework.beans.FatalBeanException
                            extended by  org.springframework.beans.factory.BeanDefinitionStoreException
                                extended by  org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException
All Implemented Interfaces:
Serializable
public class XmlBeanDefinitionStoreException
extends BeanDefinitionStoreException

XML-specific BeanDefinitionStoreException subclass that wraps a SAXException, typically a SAXParseException which contains information about the error location.

Since:
2.0.2
Author:
Juergen Hoeller
See Also:
getLineNumber(), SAXParseException, Serialized Form

Constructor Summary
XmlBeanDefinitionStoreException(String resourceDescription, String msg, SAXException cause)
Create a new XmlBeanDefinitionStoreException.
Method Summary
 int getLineNumber()
Return the line number in the XML resource that failed.
Methods inherited from class org.springframework.beans.factory.BeanDefinitionStoreException
getBeanName, getResourceDescription
Methods inherited from class org.springframework.beans.BeansException
equals, hashCode
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

XmlBeanDefinitionStoreException

public XmlBeanDefinitionStoreException(String resourceDescription,
                                       String msg,
                                       SAXException cause)
Create a new XmlBeanDefinitionStoreException.

Parameters:
resourceDescription - description of the resource that the bean definition came from
msg - the detail message (used as exception message as-is)
cause - the SAXException (typically a SAXParseException) root cause
See Also:
SAXParseException
Method Detail

getLineNumber

public int getLineNumber()
Return the line number in the XML resource that failed.

Returns:
the line number if available (in case of a SAXParseException); -1 else
See Also:
SAXParseException.getLineNumber()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.beans.propertyeditors

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.beans.propertyeditors

Properties editors used to convert from String values to object types such as java.util.Properties.

See:
Description

Class Summary
ByteArrayPropertyEditor | Editor for byte arrays.
CharacterEditor | Editor for a Character, to populate a property of type Character or char from a String value.
CharArrayPropertyEditor | Editor for char arrays.
CharsetEditor | Editor for java.nio.charset.Charset, translating charset String representations into Charset objects and back.
ClassArrayEditor | Property editor for an array of Classes, to enable the direct population of a Class[] property without having to use a String class name property as bridge.
ClassEditor | Property editor for java.lang.Class, to enable the direct population of a Class property without recourse to having to use a String class name property as bridge.
CurrencyEditor | Editor for java.util.Currency, translating currency codes into Currency objects.
CustomBooleanEditor | Property editor for Boolean/boolean properties.
CustomCollectionEditor | Property editor for Collections, converting any source Collection to a given target Collection type.
CustomDateEditor | Property editor for java.util.Date, supporting a custom java.text.DateFormat.
CustomMapEditor | Property editor for Maps, converting any source Map to a given target Map type.
CustomNumberEditor | Property editor for any Number subclass such as Short, Integer, Long, BigInteger, Float, Double, BigDecimal.
FileEditor | Editor for java.io.File, to directly populate a File property from a Spring resource location.
InputStreamEditor | One-way PropertyEditor, which can convert from a text string to a java.io.InputStream, allowing InputStream properties to be set directly as a text string.
LocaleEditor | Editor for java.util.Locale, to directly populate a Locale property.
PatternEditor | Editor for java.util.regex.Pattern, to directly populate a Pattern property.
PropertiesEditor | Custom PropertyEditor for Properties objects.
ResourceBundleEditor | PropertyEditor implementation for ResourceBundles.
StringArrayPropertyEditor | Custom PropertyEditor for String arrays.
StringTrimmerEditor | Property editor that trims Strings.
TimeZoneEditor | Editor for java.util.TimeZone, translating timezone IDs into TimeZone objects.
URIEditor | Editor for java.net.URI, to directly populate a URI property instead of using a String property as bridge.
URLEditor | Editor for java.net.URL, to directly populate a URL property instead of using a String property as bridge.
UUIDEditor | Editor for java.util.UUID, translating UUID String representations into UUID objects and back.

Package org.springframework.beans.propertyeditors Description

Properties editors used to convert from String values to object types such as java.util.Properties.

Some of these editors are registered automatically by BeanWrapperImpl. "CustomXxxEditor" classes are intended for manual registration in specific binding processes, as they are localized or the like.


org.springframework.beans.propertyeditors Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.beans.propertyeditors

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.beans.PropertyEditorSupport (implements java.beans.PropertyEditor)
      • org.springframework.beans.propertyeditors.ByteArrayPropertyEditor
      • org.springframework.beans.propertyeditors.CharacterEditor
      • org.springframework.beans.propertyeditors.CharArrayPropertyEditor
      • org.springframework.beans.propertyeditors.CharsetEditor
      • org.springframework.beans.propertyeditors.ClassArrayEditor
      • org.springframework.beans.propertyeditors.ClassEditor
      • org.springframework.beans.propertyeditors.CurrencyEditor
      • org.springframework.beans.propertyeditors.CustomBooleanEditor
      • org.springframework.beans.propertyeditors.CustomCollectionEditor
      • org.springframework.beans.propertyeditors.CustomDateEditor
      • org.springframework.beans.propertyeditors.CustomMapEditor
      • org.springframework.beans.propertyeditors.CustomNumberEditor
      • org.springframework.beans.propertyeditors.FileEditor
      • org.springframework.beans.propertyeditors.InputStreamEditor
      • org.springframework.beans.propertyeditors.LocaleEditor
      • org.springframework.beans.propertyeditors.PatternEditor
      • org.springframework.beans.propertyeditors.PropertiesEditor
      • org.springframework.beans.propertyeditors.ResourceBundleEditor
      • org.springframework.beans.propertyeditors.StringArrayPropertyEditor
      • org.springframework.beans.propertyeditors.StringTrimmerEditor
      • org.springframework.beans.propertyeditors.TimeZoneEditor
      • org.springframework.beans.propertyeditors.URIEditor
      • org.springframework.beans.propertyeditors.URLEditor
      • org.springframework.beans.propertyeditors.UUIDEditor


ByteArrayPropertyEditor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.beans.propertyeditors
Class ByteArrayPropertyEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.beans.propertyeditors.ByteArrayPropertyEditor
All Implemented Interfaces:
PropertyEditor
Direct Known Subclasses:
ByteArrayMultipartFileEditor
public class ByteArrayPropertyEditor
extends PropertyEditorSupport

Editor for byte arrays. Strings will simply be converted to their corresponding byte representations.

Since:
1.0.1
Author:
Juergen Hoeller
See Also:
String.getBytes(int, int, byte[], int)

Constructor Summary
ByteArrayPropertyEditor()
Method Summary
String | getAsText()
void | setAsText(String text)
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ByteArrayPropertyEditor

public ByteArrayPropertyEditor()
Method Detail

setAsText

public void setAsText(String text)
Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport

getAsText

public String getAsText()
Specified by:
getAsText in interface PropertyEditor
Overrides:
getAsText in class PropertyEditorSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


CharacterEditor

org.springframework.beans.propertyeditors
Class CharacterEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.beans.propertyeditors.CharacterEditor
All Implemented Interfaces:
PropertyEditor
public class CharacterEditor
extends PropertyEditorSupport

Editor for a Character, to populate a property of type Character or char from a String value.

Note that the JDK does not contain a default property editor for char! BeanWrapperImpl will register this editor by default.

Also supports conversion from a Unicode character sequence; e.g. u0041 ('A').

Since:
1.2
Author:
Juergen Hoeller, Rob Harrop, Rick Evans
See Also:
Character, BeanWrapperImpl

Constructor Summary
CharacterEditor(boolean allowEmpty)
Create a new CharacterEditor instance.
Method Summary
String | getAsText()
void | setAsText(String text)
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CharacterEditor

public CharacterEditor(boolean allowEmpty)
Create a new CharacterEditor instance.

The "allowEmpty" parameter controls whether an empty String is to be allowed in parsing, i.e. be interpreted as the null value when text is being converted. If false, an IllegalArgumentException will be thrown at that time.

Parameters:
allowEmpty - if empty strings are to be allowed
Method Detail

setAsText

public void setAsText(String text)
               throws IllegalArgumentException
Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport
Throws:
IllegalArgumentException

getAsText

public String getAsText()
Specified by:
getAsText in interface PropertyEditor
Overrides:
getAsText in class PropertyEditorSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CharArrayPropertyEditor

org.springframework.beans.propertyeditors
Class CharArrayPropertyEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.beans.propertyeditors.CharArrayPropertyEditor
All Implemented Interfaces:
PropertyEditor
public class CharArrayPropertyEditor
extends PropertyEditorSupport

Editor for char arrays. Strings will simply be converted to their corresponding char representations.

Since:
1.2.8
Author:
Juergen Hoeller
See Also:
String.toCharArray()

Constructor Summary
CharArrayPropertyEditor()
Method Summary
String | getAsText()
void | setAsText(String text)
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CharArrayPropertyEditor

public CharArrayPropertyEditor()
Method Detail

setAsText

public void setAsText(String text)
Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport

getAsText

public String getAsText()
Specified by:
getAsText in interface PropertyEditor
Overrides:
getAsText in class PropertyEditorSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CharsetEditor

org.springframework.beans.propertyeditors
Class CharsetEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.beans.propertyeditors.CharsetEditor
All Implemented Interfaces:
PropertyEditor
public class CharsetEditor
extends PropertyEditorSupport

Editor for java.nio.charset.Charset, translating charset String representations into Charset objects and back.

Expects the same syntax as Charset's Charset.name(), e.g. UTF-8, ISO-8859-16, etc.

Since:
2.5.4
Author:
Arjen Poutsma
See Also:
Charset

Constructor Summary
CharsetEditor()

Method Summary
String | getAsText()
void | setAsText(String text)

Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CharsetEditor

public CharsetEditor()
Method Detail

setAsText

public void setAsText(String text)
               throws IllegalArgumentException
Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport
Throws:
IllegalArgumentException

getAsText

public String getAsText()
Specified by:
getAsText in interface PropertyEditor
Overrides:
getAsText in class PropertyEditorSupport
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


ClassArrayEditor

org.springframework.beans.propertyeditors
Class ClassArrayEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.beans.propertyeditors.ClassArrayEditor
All Implemented Interfaces:
PropertyEditor
public class ClassArrayEditor
extends PropertyEditorSupport

Property editor for an array of Classes, to enable the direct population of a Class[] property without having to use a String class name property as bridge.

Also supports "java.lang.String[]"-style array class names, in contrast to the standard Class.forName(String) method.

Since:
2.0
Author:
Rob Harrop

Constructor Summary
ClassArrayEditor()
Create a default ClassEditor, using the thread context ClassLoader.
ClassArrayEditor(ClassLoader classLoader)
Create a default ClassArrayEditor, using the given ClassLoader.
Method Summary
String | getAsText()
void | setAsText(String text)
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ClassArrayEditor

public ClassArrayEditor()
Create a default ClassEditor, using the thread context ClassLoader.

ClassArrayEditor

public ClassArrayEditor(ClassLoader classLoader)
Create a default ClassArrayEditor, using the given ClassLoader.

Parameters:
classLoader - the ClassLoader to use (or pass null for the thread context ClassLoader)
Method Detail

setAsText

public void setAsText(String text)
               throws IllegalArgumentException
Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport
Throws:
IllegalArgumentException

getAsText

public String getAsText()
Specified by:
getAsText in interface PropertyEditor
Overrides:
getAsText in class PropertyEditorSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ClassEditor

org.springframework.beans.propertyeditors
Class ClassEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.beans.propertyeditors.ClassEditor
All Implemented Interfaces:
PropertyEditor
public class ClassEditor
extends PropertyEditorSupport

Property editor for java.lang.Class, to enable the direct population of a Class property without recourse to having to use a String class name property as bridge.

Also supports "java.lang.String[]"-style array class names, in contrast to the standard Class.forName(String) method.

Since:
13.05.2003
Author:
Juergen Hoeller, Rick Evans
See Also:
Class.forName(java.lang.String), ClassUtils.forName(String, ClassLoader)

Constructor Summary
ClassEditor()
Create a default ClassEditor, using the thread context ClassLoader.
ClassEditor(ClassLoader classLoader)
Create a default ClassEditor, using the given ClassLoader.
Method Summary
String | getAsText()
void | setAsText(String text)
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ClassEditor

public ClassEditor()
Create a default ClassEditor, using the thread context ClassLoader.

ClassEditor

public ClassEditor(ClassLoader classLoader)
Create a default ClassEditor, using the given ClassLoader.

Parameters:
classLoader - the ClassLoader to use (or null for the thread context ClassLoader)
Method Detail

setAsText

public void setAsText(String text)
               throws IllegalArgumentException
Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport
Throws:
IllegalArgumentException

getAsText

public String getAsText()
Specified by:
getAsText in interface PropertyEditor
Overrides:
getAsText in class PropertyEditorSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CurrencyEditor

org.springframework.beans.propertyeditors
Class CurrencyEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.beans.propertyeditors.CurrencyEditor
All Implemented Interfaces:
PropertyEditor
public class CurrencyEditor
extends PropertyEditorSupport

Editor for java.util.Currency, translating currency codes into Currency objects. Exposes the currency code as text representation of a Currency object.

Since:
3.0
Author:
Juergen Hoeller
See Also:
Currency

Constructor Summary
CurrencyEditor()
Method Summary
String | getAsText() This implementation returns null to indicate that there is no appropriate text representation.
void | setAsText(String text)
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CurrencyEditor

public CurrencyEditor()
Method Detail

setAsText

public void setAsText(String text)
               throws IllegalArgumentException
Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport
Throws:
IllegalArgumentException

getAsText

public String getAsText()
This implementation returns null to indicate that there is no appropriate text representation.

Specified by:
getAsText in interface PropertyEditor
Overrides:
getAsText in class PropertyEditorSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CustomBooleanEditor

org.springframework.beans.propertyeditors
Class CustomBooleanEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.beans.propertyeditors.CustomBooleanEditor
All Implemented Interfaces:
PropertyEditor
public class CustomBooleanEditor
extends PropertyEditorSupport

Property editor for Boolean/boolean properties.

This is not meant to be used as system PropertyEditor but rather as locale-specific Boolean editor within custom controller code, to parse UI-caused boolean strings into boolean properties of beans and check them in the UI form.

In web MVC code, this editor will typically be registered with binder.registerCustomEditor calls in an implementation of BaseCommandController's initBinder method.

Since:
10.06.2003
Author:
Juergen Hoeller
See Also:
DataBinder.registerCustomEditor(java.lang.Class, java.beans.PropertyEditor), BaseCommandController.initBinder(javax.servlet.http.HttpServletRequest, org.springframework.web.bind.ServletRequestDataBinder)

Field Summary
static String | VALUE_0
static String | VALUE_1
static String | VALUE_FALSE
static String | VALUE_NO
static String | VALUE_OFF
static String | VALUE_ON
static String | VALUE_TRUE
static String | VALUE_YES
Constructor Summary
CustomBooleanEditor(boolean allowEmpty)
Create a new CustomBooleanEditor instance, with "true"/"on"/"yes" and "false"/"off"/"no" as recognized String values.
CustomBooleanEditor(String trueString, String falseString, boolean allowEmpty)
Create a new CustomBooleanEditor instance, with configurable String values for true and false.
Method Summary
String | getAsText()
void | setAsText(String text)
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

VALUE_TRUE

public static final String VALUE_TRUE
See Also:
Constant Field Values

VALUE_FALSE

public static final String VALUE_FALSE
See Also:
Constant Field Values

VALUE_ON

public static final String VALUE_ON
See Also:
Constant Field Values

VALUE_OFF

public static final String VALUE_OFF
See Also:
Constant Field Values

VALUE_YES

public static final String VALUE_YES
See Also:
Constant Field Values

VALUE_NO

public static final String VALUE_NO
See Also:
Constant Field Values

VALUE_1

public static final String VALUE_1
See Also:
Constant Field Values

VALUE_0

public static final String VALUE_0
See Also:
Constant Field Values
Constructor Detail

CustomBooleanEditor

public CustomBooleanEditor(boolean allowEmpty)
Create a new CustomBooleanEditor instance, with "true"/"on"/"yes" and "false"/"off"/"no" as recognized String values.

The "allowEmpty" parameter states if an empty String should be allowed for parsing, i.e. get interpreted as null value. Else, an IllegalArgumentException gets thrown in that case.

Parameters:
allowEmpty - if empty strings should be allowed

CustomBooleanEditor

public CustomBooleanEditor(String trueString,
                           String falseString,
                           boolean allowEmpty)
Create a new CustomBooleanEditor instance, with configurable String values for true and false.

The "allowEmpty" parameter states if an empty String should be allowed for parsing, i.e. get interpreted as null value. Else, an IllegalArgumentException gets thrown in that case.

Parameters:
trueString - the String value that represents true: for example, "true" (VALUE_TRUE), "on" (VALUE_ON), "yes" (VALUE_YES) or some custom value
falseString - the String value that represents false: for example, "false" (VALUE_FALSE), "off" (VALUE_OFF), "no" (VALUE_NO) or some custom value
allowEmpty - if empty strings should be allowed
See Also:
VALUE_TRUE, VALUE_FALSE, VALUE_ON, VALUE_OFF, VALUE_YES, VALUE_NO
Method Detail

setAsText

public void setAsText(String text)
               throws IllegalArgumentException
Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport
Throws:
IllegalArgumentException

getAsText

public String getAsText()
Specified by:
getAsText in interface PropertyEditor
Overrides:
getAsText in class PropertyEditorSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CustomCollectionEditor

org.springframework.beans.propertyeditors
Class CustomCollectionEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.beans.propertyeditors.CustomCollectionEditor
All Implemented Interfaces:
PropertyEditor
public class CustomCollectionEditor
extends PropertyEditorSupport

Property editor for Collections, converting any source Collection to a given target Collection type.

By default registered for Set, SortedSet and List, to automatically convert any given Collection to one of those target types if the type does not match the target property.

Since:
1.1.3
Author:
Juergen Hoeller
See Also:
Collection, Set, SortedSet, List

Constructor Summary
CustomCollectionEditor(Class collectionType)
Create a new CustomCollectionEditor for the given target type, keeping an incoming null as-is.
CustomCollectionEditor(Class collectionType, boolean nullAsEmptyCollection)
Create a new CustomCollectionEditor for the given target type.
Method Summary
protected boolean | alwaysCreateNewCollection() Return whether to always create a new Collection, even if the type of the passed-in Collection already matches.
protected Object | convertElement(Object element) Hook to convert each encountered Collection/array element.
protected Collection | createCollection(Class collectionType, int initialCapacity) Create a Collection of the given type, with the given initial capacity (if supported by the Collection type).
String | getAsText() This implementation returns null to indicate that there is no appropriate text representation.
void | setAsText(String text) Convert the given text value to a Collection with a single element.
void | setValue(Object value) Convert the given value to a Collection of the target type.
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CustomCollectionEditor

public CustomCollectionEditor(Class collectionType)
Create a new CustomCollectionEditor for the given target type, keeping an incoming null as-is.

Parameters:
collectionType - the target type, which needs to be a sub-interface of Collection or a concrete Collection class
See Also:
Collection, ArrayList, TreeSet, LinkedHashSet

CustomCollectionEditor

public CustomCollectionEditor(Class collectionType,
                              boolean nullAsEmptyCollection)
Create a new CustomCollectionEditor for the given target type.

If the incoming value is of the given type, it will be used as-is. If it is a different Collection type or an array, it will be converted to a default implementation of the given Collection type. If the value is anything else, a target Collection with that single value will be created.

The default Collection implementations are: ArrayList for List, TreeSet for SortedSet, and LinkedHashSet for Set.

Parameters:
collectionType - the target type, which needs to be a sub-interface of Collection or a concrete Collection class
nullAsEmptyCollection - whether to convert an incoming null value to an empty Collection (of the appropriate type)
See Also:
Collection, ArrayList, TreeSet, LinkedHashSet
Method Detail

setAsText

public void setAsText(String text)
               throws IllegalArgumentException
Convert the given text value to a Collection with a single element.

Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport
Throws:
IllegalArgumentException

setValue

public void setValue(Object value)
Convert the given value to a Collection of the target type.

Specified by:
setValue in interface PropertyEditor
Overrides:
setValue in class PropertyEditorSupport

createCollection

protected Collection createCollection(Class collectionType,
                                      int initialCapacity)
Create a Collection of the given type, with the given initial capacity (if supported by the Collection type).

Parameters:
collectionType - a sub-interface of Collection
initialCapacity - the initial capacity
Returns:
the new Collection instance

alwaysCreateNewCollection

protected boolean alwaysCreateNewCollection()
Return whether to always create a new Collection, even if the type of the passed-in Collection already matches.

Default is "false"; can be overridden to enforce creation of a new Collection, for example to convert elements in any case.

See Also:
convertElement(java.lang.Object)

convertElement

protected Object convertElement(Object element)
Hook to convert each encountered Collection/array element. The default implementation simply returns the passed-in element as-is.

Can be overridden to perform conversion of certain elements, for example String to Integer if a String array comes in and should be converted to a Set of Integer objects.

Only called if actually creating a new Collection! This is by default not the case if the type of the passed-in Collection already matches. Override alwaysCreateNewCollection() to enforce creating a new Collection in every case.

Parameters:
element - the source element
Returns:
the element to be used in the target Collection
See Also:
alwaysCreateNewCollection()

getAsText

public String getAsText()
This implementation returns null to indicate that there is no appropriate text representation.

Specified by:
getAsText in interface PropertyEditor
Overrides:
getAsText in class PropertyEditorSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CustomDateEditor

org.springframework.beans.propertyeditors
Class CustomDateEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.beans.propertyeditors.CustomDateEditor
All Implemented Interfaces:
PropertyEditor
public class CustomDateEditor
extends PropertyEditorSupport

Property editor for java.util.Date, supporting a custom java.text.DateFormat.

This is not meant to be used as system PropertyEditor but rather as locale-specific date editor within custom controller code, parsing user-entered number strings into Date properties of beans and rendering them in the UI form.

In web MVC code, this editor will typically be registered with binder.registerCustomEditor calls in a custom initBinder method.

Since:
28.04.2003
Author:
Juergen Hoeller
See Also:
Date, DateFormat, DataBinder.registerCustomEditor(java.lang.Class, java.beans.PropertyEditor), BaseCommandController.initBinder(javax.servlet.http.HttpServletRequest, org.springframework.web.bind.ServletRequestDataBinder)

Constructor Summary
CustomDateEditor(DateFormat dateFormat, boolean allowEmpty)
Create a new CustomDateEditor instance, using the given DateFormat for parsing and rendering.
CustomDateEditor(DateFormat dateFormat, boolean allowEmpty, int exactDateLength)
Create a new CustomDateEditor instance, using the given DateFormat for parsing and rendering.
Method Summary
String | getAsText() Format the Date as String, using the specified DateFormat.
void | setAsText(String text) Parse the Date from the given text, using the specified DateFormat.
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CustomDateEditor

public CustomDateEditor(DateFormat dateFormat,
                        boolean allowEmpty)
Create a new CustomDateEditor instance, using the given DateFormat for parsing and rendering.

The "allowEmpty" parameter states if an empty String should be allowed for parsing, i.e. get interpreted as null value. Otherwise, an IllegalArgumentException gets thrown in that case.

Parameters:
dateFormat - DateFormat to use for parsing and rendering
allowEmpty - if empty strings should be allowed

CustomDateEditor

public CustomDateEditor(DateFormat dateFormat,
                        boolean allowEmpty,
                        int exactDateLength)
Create a new CustomDateEditor instance, using the given DateFormat for parsing and rendering.

The "allowEmpty" parameter states if an empty String should be allowed for parsing, i.e. get interpreted as null value. Otherwise, an IllegalArgumentException gets thrown in that case.

The "exactDateLength" parameter states that IllegalArgumentException gets thrown if the String does not exactly match the length specified. This is useful because SimpleDateFormat does not enforce strict parsing of the year part, not even with setLenient(false). Without an "exactDateLength" specified, the "01/01/05" would get parsed to "01/01/0005".

Parameters:
dateFormat - DateFormat to use for parsing and rendering
allowEmpty - if empty strings should be allowed
exactDateLength - the exact expected length of the date String
Method Detail

setAsText

public void setAsText(String text)
               throws IllegalArgumentException
Parse the Date from the given text, using the specified DateFormat.

Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport
Throws:
IllegalArgumentException

getAsText

public String getAsText()
Format the Date as String, using the specified DateFormat.

Specified by:
getAsText in interface PropertyEditor
Overrides:
getAsText in class PropertyEditorSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CustomMapEditor

org.springframework.beans.propertyeditors
Class CustomMapEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.beans.propertyeditors.CustomMapEditor
All Implemented Interfaces:
PropertyEditor
public class CustomMapEditor
extends PropertyEditorSupport

Property editor for Maps, converting any source Map to a given target Map type.

Since:
2.0.1
Author:
Juergen Hoeller
See Also:
Map, SortedMap

Constructor Summary
CustomMapEditor(Class mapType)
Create a new CustomMapEditor for the given target type, keeping an incoming null as-is.
CustomMapEditor(Class mapType, boolean nullAsEmptyMap)
Create a new CustomMapEditor for the given target type.
Method Summary
protected boolean | alwaysCreateNewMap() Return whether to always create a new Map, even if the type of the passed-in Map already matches.
protected Object | convertKey(Object key) Hook to convert each encountered Map key.
protected Object | convertValue(Object value) Hook to convert each encountered Map value.
protected Map | createMap(Class mapType, int initialCapacity) Create a Map of the given type, with the given initial capacity (if supported by the Map type).
String | getAsText() This implementation returns null to indicate that there is no appropriate text representation.
void | setAsText(String text) Convert the given text value to a Map with a single element.
void | setValue(Object value) Convert the given value to a Map of the target type.
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CustomMapEditor

public CustomMapEditor(Class mapType)
Create a new CustomMapEditor for the given target type, keeping an incoming null as-is.

Parameters:
mapType - the target type, which needs to be a sub-interface of Map or a concrete Map class
See Also:
Map, HashMap, TreeMap, LinkedHashMap

CustomMapEditor

public CustomMapEditor(Class mapType,
                       boolean nullAsEmptyMap)
Create a new CustomMapEditor for the given target type.

If the incoming value is of the given type, it will be used as-is. If it is a different Map type or an array, it will be converted to a default implementation of the given Map type. If the value is anything else, a target Map with that single value will be created.

The default Map implementations are: TreeMap for SortedMap, and LinkedHashMap for Map.

Parameters:
mapType - the target type, which needs to be a sub-interface of Map or a concrete Map class
nullAsEmptyMap - ap whether to convert an incoming null value to an empty Map (of the appropriate type)
See Also:
Map, TreeMap, LinkedHashMap
Method Detail

setAsText

public void setAsText(String text)
               throws IllegalArgumentException
Convert the given text value to a Map with a single element.

Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport
Throws:
IllegalArgumentException

setValue

public void setValue(Object value)
Convert the given value to a Map of the target type.

Specified by:
setValue in interface PropertyEditor
Overrides:
setValue in class PropertyEditorSupport

createMap

protected Map createMap(Class mapType,
                        int initialCapacity)
Create a Map of the given type, with the given initial capacity (if supported by the Map type).

Parameters:
mapType - a sub-interface of Map
initialCapacity - the initial capacity
Returns:
the new Map instance

alwaysCreateNewMap

protected boolean alwaysCreateNewMap()
Return whether to always create a new Map, even if the type of the passed-in Map already matches.

Default is "false"; can be overridden to enforce creation of a new Map, for example to convert elements in any case.

See Also:
convertKey(java.lang.Object), convertValue(java.lang.Object)

convertKey

protected Object convertKey(Object key)
Hook to convert each encountered Map key. The default implementation simply returns the passed-in key as-is.

Can be overridden to perform conversion of certain keys, for example from String to Integer.

Only called if actually creating a new Map! This is by default not the case if the type of the passed-in Map already matches. Override alwaysCreateNewMap() to enforce creating a new Map in every case.

Parameters:
key - the source key
Returns:
the key to be used in the target Map
See Also:
alwaysCreateNewMap()

convertValue

protected Object convertValue(Object value)
Hook to convert each encountered Map value. The default implementation simply returns the passed-in value as-is.

Can be overridden to perform conversion of certain values, for example from String to Integer.

Only called if actually creating a new Map! This is by default not the case if the type of the passed-in Map already matches. Override alwaysCreateNewMap() to enforce creating a new Map in every case.

Parameters:
value - the source value
Returns:
the value to be used in the target Map
See Also:
alwaysCreateNewMap()

getAsText

public String getAsText()
This implementation returns null to indicate that there is no appropriate text representation.

Specified by:
getAsText in interface PropertyEditor
Overrides:
getAsText in class PropertyEditorSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CustomNumberEditor

org.springframework.beans.propertyeditors
Class CustomNumberEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.beans.propertyeditors.CustomNumberEditor
All Implemented Interfaces:
PropertyEditor
public class CustomNumberEditor
extends PropertyEditorSupport

Property editor for any Number subclass such as Short, Integer, Long, BigInteger, Float, Double, BigDecimal. Can use a given NumberFormat for (locale-specific) parsing and rendering, or alternatively the default decode / valueOf / toString methods.

This is not meant to be used as system PropertyEditor but rather as locale-specific number editor within custom controller code, parsing user-entered number strings into Number properties of beans and rendering them in the UI form.

In web MVC code, this editor will typically be registered with binder.registerCustomEditor calls in a custom initBinder method.

Since:
06.06.2003
Author:
Juergen Hoeller
See Also:
Number, NumberFormat, DataBinder.registerCustomEditor(java.lang.Class, java.beans.PropertyEditor), BaseCommandController.initBinder(javax.servlet.http.HttpServletRequest, org.springframework.web.bind.ServletRequestDataBinder)

Constructor Summary
CustomNumberEditor(Class numberClass, boolean allowEmpty)
Create a new CustomNumberEditor instance, using the default valueOf methods for parsing and toString methods for rendering.
CustomNumberEditor(Class numberClass, NumberFormat numberFormat, boolean allowEmpty)
Create a new CustomNumberEditor instance, using the given NumberFormat for parsing and rendering.
Method Summary
String | getAsText() Format the Number as String, using the specified NumberFormat.
void | setAsText(String text) Parse the Number from the given text, using the specified NumberFormat.
void | setValue(Object value) Coerce a Number value into the required target class, if necessary.
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CustomNumberEditor

public CustomNumberEditor(Class numberClass,
                          boolean allowEmpty)
                   throws IllegalArgumentException
Create a new CustomNumberEditor instance, using the default valueOf methods for parsing and toString methods for rendering.

The "allowEmpty" parameter states if an empty String should be allowed for parsing, i.e. get interpreted as null value. Else, an IllegalArgumentException gets thrown in that case.

Parameters:
numberClass - Number subclass to generate
allowEmpty - if empty strings should be allowed
Throws:
IllegalArgumentException - if an invalid numberClass has been specified
See Also:
NumberUtils.parseNumber(String, Class),
Integer.valueOf(java.lang.String, int),
Integer.toString(int, int)

CustomNumberEditor

public CustomNumberEditor(Class numberClass,
                          NumberFormat numberFormat,
                          boolean allowEmpty)
                   throws IllegalArgumentException
Create a new CustomNumberEditor instance, using the given NumberFormat for parsing and rendering.

The allowEmpty parameter states if an empty String should be allowed for parsing, i.e. get interpreted as null value. Else, an IllegalArgumentException gets thrown in that case.

Parameters:
numberClass - Number subclass to generate
numberFormat - NumberFormat to use for parsing and rendering
allowEmpty - if empty strings should be allowed
Throws:
IllegalArgumentException - if an invalid numberClass has been specified
See Also:
NumberUtils.parseNumber(String, Class, java.text.NumberFormat),
NumberFormat.parse(java.lang.String, java.text.ParsePosition),
NumberFormat.format(java.lang.Object, java.lang.StringBuffer, java.text.FieldPosition)
Method Detail

setAsText

public void setAsText(String text)
               throws IllegalArgumentException
Parse the Number from the given text, using the specified NumberFormat.

Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport
Throws:
IllegalArgumentException

setValue

public void setValue(Object value)
Coerce a Number value into the required target class, if necessary.

Specified by:
setValue in interface PropertyEditor
Overrides:
setValue in class PropertyEditorSupport

getAsText

public String getAsText()
Format the Number as String, using the specified NumberFormat.

Specified by:
getAsText in interface PropertyEditor
Overrides:
getAsText in class PropertyEditorSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FileEditor

org.springframework.beans.propertyeditors
Class FileEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.beans.propertyeditors.FileEditor
All Implemented Interfaces:
PropertyEditor
public class FileEditor
extends PropertyEditorSupport

Editor for java.io.File, to directly populate a File property from a Spring resource location.

Supports Spring-style URL notation: any fully qualified standard URL ("file:", "http:", etc) and Spring's special "classpath:" pseudo-URL.

NOTE: The behavior of this editor has changed in Spring 2.0. Previously, it created a File instance directly from a filename. As of Spring 2.0, it takes a standard Spring resource location as input; this is consistent with URLEditor and InputStreamEditor now.

NOTE: In Spring 2.5 the following modification was made. If a file name is specified without a URL prefix or without an absolute path then we try to locate the file using standard ResourceLoader semantics. If the file was not found, then a File instance is created assuming the file name refers to a relative file location.

Since:
09.12.2003
Author:
Juergen Hoeller, Thomas Risberg
See Also:
File, ResourceEditor, ResourceLoader, URLEditor, InputStreamEditor

Constructor Summary
FileEditor()
Create a new FileEditor, using the default ResourceEditor underneath.
FileEditor(ResourceEditor resourceEditor)
Create a new FileEditor, using the given ResourceEditor underneath.
Method Summary
String | getAsText()
void | setAsText(String text)
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

FileEditor

public FileEditor()
Create a new FileEditor, using the default ResourceEditor underneath.

FileEditor

public FileEditor(ResourceEditor resourceEditor)
Create a new FileEditor, using the given ResourceEditor underneath.

Parameters:
resourceEditor - the ResourceEditor to use
Method Detail

setAsText

public void setAsText(String text)
               throws IllegalArgumentException
Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport
Throws:
IllegalArgumentException

getAsText

public String getAsText()
Specified by:
getAsText in interface PropertyEditor
Overrides:
getAsText in class PropertyEditorSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InputStreamEditor

org.springframework.beans.propertyeditors
Class InputStreamEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.beans.propertyeditors.InputStreamEditor
All Implemented Interfaces:
PropertyEditor
public class InputStreamEditor
extends PropertyEditorSupport

One-way PropertyEditor, which can convert from a text string to a java.io.InputStream, allowing InputStream properties to be set directly as a text string.

Supports Spring-style URL notation: any fully qualified standard URL ("file:", "http:", etc) and Spring's special "classpath:" pseudo-URL.

Note that in the default usage, the stream is not closed by Spring itself!

Since:
1.0.1
Author:
Juergen Hoeller
See Also:
InputStream, ResourceEditor, ResourceLoader, URLEditor, FileEditor

Constructor Summary
InputStreamEditor()
Create a new InputStreamEditor, using the default ResourceEditor underneath.
InputStreamEditor(ResourceEditor resourceEditor)
Create a new InputStreamEditor, using the given ResourceEditor underneath.
Method Summary
String | getAsText() This implementation returns null to indicate that there is no appropriate text representation.
void | setAsText(String text)
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

InputStreamEditor

public InputStreamEditor()
Create a new InputStreamEditor, using the default ResourceEditor underneath.

InputStreamEditor

public InputStreamEditor(ResourceEditor resourceEditor)
Create a new InputStreamEditor, using the given ResourceEditor underneath.

Parameters:
resourceEditor - the ResourceEditor to use
Method Detail

setAsText

public void setAsText(String text)
               throws IllegalArgumentException
Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport
Throws:
IllegalArgumentException

getAsText

public String getAsText()
This implementation returns null to indicate that there is no appropriate text representation.

Specified by:
getAsText in interface PropertyEditor
Overrides:
getAsText in class PropertyEditorSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LocaleEditor

org.springframework.beans.propertyeditors
Class LocaleEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.beans.propertyeditors.LocaleEditor
All Implemented Interfaces:
PropertyEditor
public class LocaleEditor
extends PropertyEditorSupport

Editor for java.util.Locale, to directly populate a Locale property.

Expects the same syntax as Locale's toString, i.e. language + optionally country + optionally variant, separated by "_" (e.g. "en", "en_US"). Also accepts spaces as separators, as alternative to underscores.

Since:
26.05.2003
Author:
Juergen Hoeller
See Also:
Locale, StringUtils.parseLocaleString(java.lang.String)

Constructor Summary
LocaleEditor()
Method Summary
String | getAsText()
void | setAsText(String text)
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

LocaleEditor

public LocaleEditor()
Method Detail

setAsText

public void setAsText(String text)
Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport

getAsText

public String getAsText()
Specified by:
getAsText in interface PropertyEditor
Overrides:
getAsText in class PropertyEditorSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PatternEditor

org.springframework.beans.propertyeditors
Class PatternEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.beans.propertyeditors.PatternEditor
All Implemented Interfaces:
PropertyEditor
public class PatternEditor
extends PropertyEditorSupport

Editor for java.util.regex.Pattern, to directly populate a Pattern property. Expects the same syntax as Pattern's compile method.

Since:
2.0.1
Author:
Juergen Hoeller
See Also:
Pattern, Pattern.compile(String)

Constructor Summary
PatternEditor()
Create a new PatternEditor with default settings.
PatternEditor(int flags)
Create a new PatternEditor with the given settings.
Method Summary
String | getAsText()
void | setAsText(String text)
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PatternEditor

public PatternEditor()
Create a new PatternEditor with default settings.

PatternEditor

public PatternEditor(int flags)
Create a new PatternEditor with the given settings.

Parameters:
flags - the java.util.regex.Pattern flags to apply
See Also:
Pattern.compile(String, int), Pattern.CASE_INSENSITIVE, Pattern.MULTILINE, Pattern.DOTALL, Pattern.UNICODE_CASE, Pattern.CANON_EQ
Method Detail

setAsText

public void setAsText(String text)
Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport

getAsText

public String getAsText()
Specified by:
getAsText in interface PropertyEditor
Overrides:
getAsText in class PropertyEditorSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertiesEditor

org.springframework.beans.propertyeditors
Class PropertiesEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.beans.propertyeditors.PropertiesEditor
All Implemented Interfaces:
PropertyEditor
public class PropertiesEditor
extends PropertyEditorSupport

Custom PropertyEditor for Properties objects.

Handles conversion from content String to Properties object. Also handles Map to Properties conversion, for populating a Properties object via XML "map" entries.

The required format is defined in the standard Properties documentation. Each property must be on a new line.

Author:
Rod Johnson, Juergen Hoeller
See Also:
Properties.load(java.io.Reader)

Constructor Summary
PropertiesEditor()
Method Summary
void | setAsText(String text) Convert String into Properties, considering it as properties content.
void | setValue(Object value) Take Properties as-is; convert Map into Properties.
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getAsText, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PropertiesEditor

public PropertiesEditor()
Method Detail

setAsText

public void setAsText(String text)
               throws IllegalArgumentException
Convert String into Properties, considering it as properties content.

Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport
Parameters:
text - the text to be so converted
Throws:
IllegalArgumentException

setValue

public void setValue(Object value)
Take Properties as-is; convert Map into Properties.

Specified by:
setValue in interface PropertyEditor
Overrides:
setValue in class PropertyEditorSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResourceBundleEditor

org.springframework.beans.propertyeditors
Class ResourceBundleEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.beans.propertyeditors.ResourceBundleEditor
All Implemented Interfaces:
PropertyEditor
public class ResourceBundleEditor
extends PropertyEditorSupport

PropertyEditor implementation for ResourceBundles.

Only supports conversion from a String, but not to a String. Find below some examples of using this class in a (properly configured) Spring container using XML-based metadata:

 <bean id="errorDialog" class="...">
    <!--
        the 'messages' property is of type java.util.ResourceBundle.
        the 'DialogMessages.properties' file exists at the root of the CLASSPATH
    -->
    <property name="messages" value="DialogMessages"/>
 </bean>
 <bean id="errorDialog" class="...">
    <!--
        the 'DialogMessages.properties' file exists in the 'com/messages' package
    -->
    <property name="messages" value="com/messages/DialogMessages"/>
 </bean>

A 'properly configured' Spring container might contain a CustomEditorConfigurer definition such that the conversion can be effected transparently:

 <bean class="org.springframework.beans.factory.config.CustomEditorConfigurer">
    <property name="customEditors">
        <map>
            <entry key="java.util.ResourceBundle">
                <bean class="org.springframework.beans.propertyeditors.ResourceBundleEditor"/>
            </entry>
        </map>
    </property>
 </bean>

Please note that this PropertyEditor is not registered by default with any of the Spring infrastructure.

Thanks to David Leal Valmana for the suggestion and initial prototype.

Since:
2.0
Author:
Rick Evans

Field Summary
static String BASE_NAME_SEPARATOR
The separator used to distinguish between the base name and the locale (if any) when converting from a String.
Constructor Summary
ResourceBundleEditor()
Method Summary
 void setAsText(String text)
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getAsText, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

BASE_NAME_SEPARATOR

public static final String BASE_NAME_SEPARATOR
The separator used to distinguish between the base name and the locale (if any) when converting from a String.

See Also:
Constant Field Values
Constructor Detail

ResourceBundleEditor

public ResourceBundleEditor()
Method Detail

setAsText

public void setAsText(String text)
               throws IllegalArgumentException
Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport
Throws:
IllegalArgumentException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StringArrayPropertyEditor

org.springframework.beans.propertyeditors
Class StringArrayPropertyEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.beans.propertyeditors.StringArrayPropertyEditor
All Implemented Interfaces:
PropertyEditor
public class StringArrayPropertyEditor
extends PropertyEditorSupport

Custom PropertyEditor for String arrays.

Strings must be in CSV format, with a customizable separator. By default values in the result are trimmed of whitespace.

Author:
Rod Johnson, Juergen Hoeller, Dave Syer
See Also:
StringUtils.delimitedListToStringArray(java.lang.String, java.lang.String), StringUtils.arrayToDelimitedString(java.lang.Object[], java.lang.String)

Field Summary
static String DEFAULT_SEPARATOR
Default separator for splitting a String: a comma (",")
Constructor Summary
StringArrayPropertyEditor()
Create a new StringArrayPropertyEditor with the default separator (a comma).
StringArrayPropertyEditor(String separator)
Create a new StringArrayPropertyEditor with the given separator.
StringArrayPropertyEditor(String separator, boolean emptyArrayAsNull)
Create a new StringArrayPropertyEditor with the given separator.
StringArrayPropertyEditor(String separator, boolean emptyArrayAsNull, boolean trimValues)
Create a new StringArrayPropertyEditor with the given separator.
StringArrayPropertyEditor(String separator, String charsToDelete, boolean emptyArrayAsNull)
Create a new StringArrayPropertyEditor with the given separator.
StringArrayPropertyEditor(String separator, String charsToDelete, boolean emptyArrayAsNull, boolean trimValues)
Create a new StringArrayPropertyEditor with the given separator.
Method Summary
String | getAsText()
void | setAsText(String text)
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_SEPARATOR

public static final String DEFAULT_SEPARATOR
Default separator for splitting a String: a comma (",")

See Also:
Constant Field Values
Constructor Detail

StringArrayPropertyEditor

public StringArrayPropertyEditor()
Create a new StringArrayPropertyEditor with the default separator (a comma).

An empty text (without elements) will be turned into an empty array.

StringArrayPropertyEditor

public StringArrayPropertyEditor(String separator)
Create a new StringArrayPropertyEditor with the given separator.

An empty text (without elements) will be turned into an empty array.

Parameters:
separator - the separator to use for splitting a String

StringArrayPropertyEditor

public StringArrayPropertyEditor(String separator,
                                 boolean emptyArrayAsNull)
Create a new StringArrayPropertyEditor with the given separator.

Parameters:
separator - the separator to use for splitting a String
emptyArrayAsNull - true if an empty String array is to be transformed into null

StringArrayPropertyEditor

public StringArrayPropertyEditor(String separator,
                                 boolean emptyArrayAsNull,
                                 boolean trimValues)
Create a new StringArrayPropertyEditor with the given separator.

Parameters:
separator - the separator to use for splitting a String
emptyArrayAsNull - true if an empty String array is to be transformed into null
trimValues - true if the values in the parsed arrays are to be be trimmed of whitespace (default is true).

StringArrayPropertyEditor

public StringArrayPropertyEditor(String separator,
                                 String charsToDelete,
                                 boolean emptyArrayAsNull)
Create a new StringArrayPropertyEditor with the given separator.

Parameters:
separator - the separator to use for splitting a String
charsToDelete - a set of characters to delete, in addition to trimming an input String. Useful for deleting unwanted line breaks: e.g. "\r\n\f" will delete all new lines and line feeds in a String.
emptyArrayAsNull - true if an empty String array is to be transformed into null

StringArrayPropertyEditor

public StringArrayPropertyEditor(String separator,
                                 String charsToDelete,
                                 boolean emptyArrayAsNull,
                                 boolean trimValues)
Create a new StringArrayPropertyEditor with the given separator.

Parameters:
separator - the separator to use for splitting a String
charsToDelete - a set of characters to delete, in addition to trimming an input String. Useful for deleting unwanted line breaks: e.g. "\r\n\f" will delete all new lines and line feeds in a String.
emptyArrayAsNull - true if an empty String array is to be transformed into null
trimValues - true if the values in the parsed arrays are to be be trimmed of whitespace (default is true).
Method Detail

setAsText

public void setAsText(String text)
               throws IllegalArgumentException
Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport
Throws:
IllegalArgumentException

getAsText

public String getAsText()
Specified by:
getAsText in interface PropertyEditor
Overrides:
getAsText in class PropertyEditorSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StringTrimmerEditor

org.springframework.beans.propertyeditors
Class StringTrimmerEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.beans.propertyeditors.StringTrimmerEditor
All Implemented Interfaces:
PropertyEditor
public class StringTrimmerEditor
extends PropertyEditorSupport

Property editor that trims Strings.

Optionally allows transforming an empty string into a null value. Needs to be explictly registered, e.g. for command binding.

Author:
Juergen Hoeller
See Also:
DataBinder.registerCustomEditor(java.lang.Class, java.beans.PropertyEditor), BaseCommandController.initBinder(javax.servlet.http.HttpServletRequest, org.springframework.web.bind.ServletRequestDataBinder)

Constructor Summary
StringTrimmerEditor(boolean emptyAsNull)
Create a new StringTrimmerEditor.
StringTrimmerEditor(String charsToDelete, boolean emptyAsNull)
Create a new StringTrimmerEditor.
Method Summary
String | getAsText()
void | setAsText(String text)
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

StringTrimmerEditor

public StringTrimmerEditor(boolean emptyAsNull)
Create a new StringTrimmerEditor.

Parameters:
emptyAsNull - true if an empty String is to be transformed into null

StringTrimmerEditor

public StringTrimmerEditor(String charsToDelete,
                           boolean emptyAsNull)
Create a new StringTrimmerEditor.

Parameters:
charsToDelete - a set of characters to delete, in addition to trimming an input String. Useful for deleting unwanted line breaks: e.g. "\r\n\f" will delete all new lines and line feeds in a String.
emptyAsNull - true if an empty String is to be transformed into null
Method Detail

setAsText

public void setAsText(String text)
Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport

getAsText

public String getAsText()
Specified by:
getAsText in interface PropertyEditor
Overrides:
getAsText in class PropertyEditorSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TimeZoneEditor

org.springframework.beans.propertyeditors
Class TimeZoneEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.beans.propertyeditors.TimeZoneEditor
All Implemented Interfaces:
PropertyEditor
public class TimeZoneEditor
extends PropertyEditorSupport

Editor for java.util.TimeZone, translating timezone IDs into TimeZone objects. Does not expose a text representation for TimeZone objects.

Since:
3.0
Author:
Juergen Hoeller
See Also:
TimeZone

Constructor Summary
TimeZoneEditor()
Method Summary
String | getAsText() This implementation returns null to indicate that there is no appropriate text representation.
void | setAsText(String text)
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TimeZoneEditor

public TimeZoneEditor()
Method Detail

setAsText

public void setAsText(String text)
               throws IllegalArgumentException
Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport
Throws:
IllegalArgumentException

getAsText

public String getAsText()
This implementation returns null to indicate that there is no appropriate text representation.

Specified by:
getAsText in interface PropertyEditor
Overrides:
getAsText in class PropertyEditorSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


URIEditor

org.springframework.beans.propertyeditors
Class URIEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.beans.propertyeditors.URIEditor
All Implemented Interfaces:
PropertyEditor
public class URIEditor
extends PropertyEditorSupport

Editor for java.net.URI, to directly populate a URI property instead of using a String property as bridge.

Supports Spring-style URI notation: any fully qualified standard URI ("file:", "http:", etc) and Spring's special "classpath:" pseudo-URL, which will be resolved to a corresponding URI.

By default, this editor will encode Strings into URIs. For instance, a space will be encoded into %20. This behavior can be changed by setting calling the URIEditor(boolean) constructor.

Note: A URI is more relaxed than a URL in that it does not require a valid protocol to be specified. Any scheme within a valid URI syntax is allowed, even without a matching protocol handler being registered.

Since:
2.0.2
Author:
Juergen Hoeller
See Also:
URI, URLEditor

Constructor Summary
URIEditor()
Create a new, encoding URIEditor, converting "classpath:" locations into standard URIs (not trying to resolve them into physical resources).
URIEditor(boolean encode)
Create a new URIEditor, converting "classpath:" locations into standard URIs (not trying to resolve them into physical resources).
URIEditor(ClassLoader classLoader)
Create a new URIEditor, using the given ClassLoader to resolve "classpath:" locations into physical resource URLs.
URIEditor(ClassLoader classLoader, boolean encode)
Create a new URIEditor, using the given ClassLoader to resolve "classpath:" locations into physical resource URLs.
Method Summary
protected URI | createURI(String value) Create a URI instance for the given (resolved) String value.
String | getAsText()
void | setAsText(String text)
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

URIEditor

public URIEditor()
Create a new, encoding URIEditor, converting "classpath:" locations into standard URIs (not trying to resolve them into physical resources).

URIEditor

public URIEditor(boolean encode)
Create a new URIEditor, converting "classpath:" locations into standard URIs (not trying to resolve them into physical resources).

Parameters:
encode - indicates whether Strings will be encoded or not

URIEditor

public URIEditor(ClassLoader classLoader)
Create a new URIEditor, using the given ClassLoader to resolve "classpath:" locations into physical resource URLs.

Parameters:
classLoader - the ClassLoader to use for resolving "classpath:" locations (may be null to indicate the default ClassLoader)

URIEditor

public URIEditor(ClassLoader classLoader,
                 boolean encode)
Create a new URIEditor, using the given ClassLoader to resolve "classpath:" locations into physical resource URLs.

Parameters:
classLoader - the ClassLoader to use for resolving "classpath:" locations (may be null to indicate the default ClassLoader)
encode - indicates whether Strings will be encoded or not
Method Detail

setAsText

public void setAsText(String text)
               throws IllegalArgumentException
Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport
Throws:
IllegalArgumentException

createURI

protected URI createURI(String value)
                 throws URISyntaxException
Create a URI instance for the given (resolved) String value.

The default implementation encodes the value into a RFC 2396 compliant URI.

Parameters:
value - the value to convert into a URI instance
Returns:
the URI instance
Throws:
URISyntaxException - if URI conversion failed

getAsText

public String getAsText()
Specified by:
getAsText in interface PropertyEditor
Overrides:
getAsText in class PropertyEditorSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


URLEditor

org.springframework.beans.propertyeditors
Class URLEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.beans.propertyeditors.URLEditor
All Implemented Interfaces:
PropertyEditor
public class URLEditor
extends PropertyEditorSupport

Editor for java.net.URL, to directly populate a URL property instead of using a String property as bridge.

Supports Spring-style URL notation: any fully qualified standard URL ("file:", "http:", etc) and Spring's special "classpath:" pseudo-URL, as well as Spring's context-specific relative file paths.

Note: A URL must specify a valid protocol, else it will be rejected upfront. However, the target resource does not necessarily have to exist at the time of URL creation; this depends on the specific resource type.

Since:
15.12.2003
Author:
Juergen Hoeller
See Also:
URL, ResourceEditor, ResourceLoader, FileEditor, InputStreamEditor

Constructor Summary
URLEditor()
Create a new URLEditor, using the default ResourceEditor underneath.
URLEditor(ResourceEditor resourceEditor)
Create a new URLEditor, using the given ResourceEditor underneath.
Method Summary
String | getAsText()
void | setAsText(String text)
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

URLEditor

public URLEditor()
Create a new URLEditor, using the default ResourceEditor underneath.

URLEditor

public URLEditor(ResourceEditor resourceEditor)
Create a new URLEditor, using the given ResourceEditor underneath.

Parameters:
resourceEditor - the ResourceEditor to use
Method Detail

setAsText

public void setAsText(String text)
               throws IllegalArgumentException
Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport
Throws:
IllegalArgumentException

getAsText

public String getAsText()
Specified by:
getAsText in interface PropertyEditor
Overrides:
getAsText in class PropertyEditorSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UUIDEditor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.beans.propertyeditors
Class UUIDEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.beans.propertyeditors.UUIDEditor
All Implemented Interfaces:
PropertyEditor
public class UUIDEditor
extends PropertyEditorSupport

Editor for java.util.UUID, translating UUID String representations into UUID objects and back.

Since:
3.0.1
Author:
Juergen Hoeller
See Also:
UUID

Constructor Summary
UUIDEditor()
Method Summary
String | getAsText()
void | setAsText(String text)
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

UUIDEditor

public UUIDEditor()
Method Detail

setAsText

public void setAsText(String text)
               throws IllegalArgumentException
Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport
Throws:
IllegalArgumentException

getAsText

public String getAsText()
Specified by:
getAsText in interface PropertyEditor
Overrides:
getAsText in class PropertyEditorSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.beans.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.beans.support

Classes supporting the org.springframework.beans package, such as utility classes for sorting and holding lists of beans.

See:
Description

Interface Summary
SortDefinition Definition for sorting bean instances by a property.

Class Summary
ArgumentConvertingMethodInvoker | Subclass of MethodInvoker that tries to convert the given arguments for the actual target method via a TypeConverter.
MutableSortDefinition | Mutable implementation of the SortDefinition interface.
PagedListHolder<E> | PagedListHolder is a simple state holder for handling lists of objects, separating them into pages.
PropertyComparator | PropertyComparator performs a comparison of two beans, evaluating the specified bean property via a BeanWrapper.
ResourceEditorRegistrar | PropertyEditorRegistrar implementation that populates a given PropertyEditorRegistry (typically a BeanWrapper used for bean creation within an ApplicationContext) with resource editors.

Package org.springframework.beans.support Description

Classes supporting the org.springframework.beans package, such as utility classes for sorting and holding lists of beans.


org.springframework.beans.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.beans.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.util.MethodInvoker
      • org.springframework.beans.support.ArgumentConvertingMethodInvoker
    • org.springframework.beans.support.MutableSortDefinition (implements java.io.Serializable, org.springframework.beans.support.SortDefinition)
    • org.springframework.beans.support.PagedListHolder<E> (implements java.io.Serializable)
    • org.springframework.beans.support.PropertyComparator (implements java.util.Comparator<T>)
    • org.springframework.beans.support.ResourceEditorRegistrar (implements org.springframework.beans.PropertyEditorRegistrar)

Interface Hierarchy

  • org.springframework.beans.support.SortDefinition


SortDefinition

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.beans.support
Interface SortDefinition

All Known Implementing Classes:
MutableSortDefinition
public interface SortDefinition

Definition for sorting bean instances by a property.

Since:
26.05.2003
Author:
Juergen Hoeller

Method Summary
String | getProperty() Return the name of the bean property to compare.
boolean | isAscending() Return whether to sort ascending (true) or descending (false).
boolean | isIgnoreCase() Return whether upper and lower case in String values should be ignored.

Method Detail

getProperty

String getProperty()
Return the name of the bean property to compare. Can also be a nested bean property path.

isIgnoreCase

boolean isIgnoreCase()
Return whether upper and lower case in String values should be ignored.

isAscending

boolean isAscending()
Return whether to sort ascending (true) or descending (false).

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ArgumentConvertingMethodInvoker

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.beans.support
Class ArgumentConvertingMethodInvoker

java.lang.Object
    extended by  org.springframework.util.MethodInvoker
        extended by  org.springframework.beans.support.ArgumentConvertingMethodInvoker
Direct Known Subclasses:
MethodInvokingFactoryBean, MethodInvokingJobDetailFactoryBean, MethodInvokingRunnable
public class ArgumentConvertingMethodInvoker
extends MethodInvoker

Subclass of MethodInvoker that tries to convert the given arguments for the actual target method via a TypeConverter.

Supports flexible argument conversions, in particular for invoking a specific overloaded method.

Since:
1.1
Author:
Juergen Hoeller
See Also:
BeanWrapperImpl.convertIfNecessary(java.lang.Object, java.lang.Class, org.springframework.core.MethodParameter)

Constructor Summary
ArgumentConvertingMethodInvoker()
Method Summary
protected Method | doFindMatchingMethod(Object[] arguments) Actually find a method with matching parameter type, i.e.
protected Method | findMatchingMethod() This implementation looks for a method with matching parameter types.
protected TypeConverter | getDefaultTypeConverter() Obtain the default TypeConverter for this method invoker.
TypeConverter | getTypeConverter() Return the TypeConverter used for argument type conversion.
void | registerCustomEditor(Class requiredType, PropertyEditor propertyEditor) Register the given custom property editor for all properties of the given type.
void | setTypeConverter(TypeConverter typeConverter) Set a TypeConverter to use for argument type conversion.
Methods inherited from class org.springframework.util.MethodInvoker
getArguments, getPreparedMethod, getTargetClass, getTargetMethod, getTargetObject, getTypeDifferenceWeight, invoke, isPrepared, prepare, resolveClassName, setArguments, setStaticMethod, setTargetClass, setTargetMethod, setTargetObject
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ArgumentConvertingMethodInvoker

public ArgumentConvertingMethodInvoker()
Method Detail

setTypeConverter

public void setTypeConverter(TypeConverter typeConverter)
Set a TypeConverter to use for argument type conversion.

Default is a SimpleTypeConverter. Can be overridden with any TypeConverter implementation, typically a pre-configured SimpleTypeConverter or a BeanWrapperImpl instance.

See Also:
SimpleTypeConverter, BeanWrapperImpl

getTypeConverter

public TypeConverter getTypeConverter()
Return the TypeConverter used for argument type conversion.

Can be cast to PropertyEditorRegistry if direct access to the underlying PropertyEditors is desired (provided that the present TypeConverter actually implements the PropertyEditorRegistry interface).

getDefaultTypeConverter

protected TypeConverter getDefaultTypeConverter()
Obtain the default TypeConverter for this method invoker.

Called if no explicit TypeConverter has been specified. The default implementation builds a SimpleTypeConverter. Can be overridden in subclasses.

registerCustomEditor

public void registerCustomEditor(Class requiredType,
                                 PropertyEditor propertyEditor)
Register the given custom property editor for all properties of the given type.

Typically used in conjunction with the default SimpleTypeConverter; will work with any TypeConverter that implements the PropertyEditorRegistry interface as well.

Parameters:
requiredType - type of the property
propertyEditor - editor to register
See Also:
setTypeConverter(org.springframework.beans.TypeConverter), PropertyEditorRegistry.registerCustomEditor(java.lang.Class, java.beans.PropertyEditor)

findMatchingMethod

protected Method findMatchingMethod()
This implementation looks for a method with matching parameter types.

Overrides:
findMatchingMethod in class MethodInvoker
Returns:
a matching method, or null if none
See Also:
doFindMatchingMethod(java.lang.Object[])

doFindMatchingMethod

protected Method doFindMatchingMethod(Object[] arguments)
Actually find a method with matching parameter type, i.e. where each argument value is assignable to the corresponding parameter type.

Parameters:
arguments - the argument values to match against method parameters
Returns:
a matching method, or null if none
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


MutableSortDefinition

org.springframework.beans.support
Class MutableSortDefinition

java.lang.Object
    extended by  org.springframework.beans.support.MutableSortDefinition
All Implemented Interfaces:
Serializable, SortDefinition
public class MutableSortDefinition
extends Object
implements SortDefinition, Serializable

Mutable implementation of the SortDefinition interface. Supports toggling the ascending value on setting the same property again.

Since:
26.05.2003
Author:
Juergen Hoeller, Jean-Pierre Pawlak
See Also:
setToggleAscendingOnProperty(boolean), Serialized Form

Constructor Summary
MutableSortDefinition()
Create an empty MutableSortDefinition, to be populated via its bean properties.
MutableSortDefinition(boolean toggleAscendingOnSameProperty)
Create a new MutableSortDefinition.
MutableSortDefinition(SortDefinition source)
Copy constructor: create a new MutableSortDefinition that mirrors the given sort definition.
MutableSortDefinition(String property, boolean ignoreCase, boolean ascending)
Create a MutableSortDefinition for the given settings.
Method Summary
 boolean equals(Object other)
 String getProperty()
Return the name of the bean property to compare.
 int hashCode()
 boolean isAscending()
Return whether to sort ascending (true) or descending (false).
 boolean isIgnoreCase()
Return whether upper and lower case in String values should be ignored.
 boolean isToggleAscendingOnProperty()
Return whether to toggle the ascending flag if the same property gets set again (that is, setProperty(java.lang.String) gets called with already set property name again).
 void setAscending(boolean ascending)
Set whether to sort ascending (true) or descending (false).
 void setIgnoreCase(boolean ignoreCase)
Set whether upper and lower case in String values should be ignored.
 void setProperty(String property)
Set the property to compare.
 void setToggleAscendingOnProperty(boolean toggleAscendingOnProperty)
Set whether to toggle the ascending flag if the same property gets set again (that is, setProperty(java.lang.String) gets called with already set property name again).
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MutableSortDefinition

public MutableSortDefinition()
Create an empty MutableSortDefinition, to be populated via its bean properties.

See Also:
setProperty(java.lang.String), setIgnoreCase(boolean), setAscending(boolean)

MutableSortDefinition

public MutableSortDefinition(SortDefinition source)
Copy constructor: create a new MutableSortDefinition that mirrors the given sort definition.

Parameters:
source - the original sort definition

MutableSortDefinition

public MutableSortDefinition(String property,
                             boolean ignoreCase,
                             boolean ascending)
Create a MutableSortDefinition for the given settings.

Parameters:
property - the property to compare
ignoreCase - whether upper and lower case in String values should be ignored
ascending - whether to sort ascending (true) or descending (false)

MutableSortDefinition

public MutableSortDefinition(boolean toggleAscendingOnSameProperty)
Create a new MutableSortDefinition.

Parameters:
toggleAscendingOnSameProperty - whether to toggle the ascending flag if the same property gets set again (that is, setProperty gets called with already set property name again).
Method Detail

setProperty

public void setProperty(String property)
Set the property to compare.

If the property was the same as the current, the sort is reversed if "toggleAscendingOnProperty" is activated, else simply ignored.

See Also:
setToggleAscendingOnProperty(boolean)

getProperty

public String getProperty()
Description copied from interface: SortDefinition
Return the name of the bean property to compare. Can also be a nested bean property path.

Specified by:
getProperty in interface SortDefinition

setIgnoreCase

public void setIgnoreCase(boolean ignoreCase)
Set whether upper and lower case in String values should be ignored.

isIgnoreCase

public boolean isIgnoreCase()
Description copied from interface: SortDefinition
Return whether upper and lower case in String values should be ignored.

Specified by:
isIgnoreCase in interface SortDefinition

setAscending

public void setAscending(boolean ascending)
Set whether to sort ascending (true) or descending (false).

isAscending

public boolean isAscending()
Description copied from interface: SortDefinition
Return whether to sort ascending (true) or descending (false).

Specified by:
isAscending in interface SortDefinition

setToggleAscendingOnProperty

public void setToggleAscendingOnProperty(boolean toggleAscendingOnProperty)
Set whether to toggle the ascending flag if the same property gets set again (that is, setProperty(java.lang.String) gets called with already set property name again).

This is particularly useful for parameter binding through a web request, where clicking on the field header again might be supposed to trigger a resort for the same field but opposite order.

isToggleAscendingOnProperty

public boolean isToggleAscendingOnProperty()
Return whether to toggle the ascending flag if the same property gets set again (that is, setProperty(java.lang.String) gets called with already set property name again).

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PagedListHolder

org.springframework.beans.support
Class PagedListHolder<E>

java.lang.Object
    extended by  org.springframework.beans.support.PagedListHolder<E>
All Implemented Interfaces:
Serializable
public class PagedListHolder<E>
extends Object
implements Serializable

PagedListHolder is a simple state holder for handling lists of objects, separating them into pages. Page numbering starts with 0.

This is mainly targetted at usage in web UIs. Typically, an instance will be instantiated with a list of beans, put into the session, and exported as model. The properties can all be set/get programmatically, but the most common way will be data binding, i.e. populating the bean from request parameters. The getters will mainly be used by the view.

Supports sorting the underlying list via a SortDefinition implementation, available as property "sort". By default, a MutableSortDefinition instance will be used, toggling the ascending value on setting the same property again.

The data binding names have to be called "pageSize" and "sort.ascending", as expected by BeanWrapper. Note that the names and the nesting syntax match the respective JSTL EL expressions, like "myModelAttr.pageSize" and "myModelAttr.sort.ascending".

Since:
19.05.2003
Author:
Juergen Hoeller
See Also:
getPageList(), MutableSortDefinition, Serialized Form

Field Summary
static int | DEFAULT_MAX_LINKED_PAGES
static int | DEFAULT_PAGE_SIZE
Constructor Summary
PagedListHolder()
Create a new holder instance.
PagedListHolder(List<E> source)
Create a new holder instance with the given source list, starting with a default sort definition (with "toggleAscendingOnProperty" activated).
PagedListHolder(List<E> source, SortDefinition sort)
Create a new holder instance with the given source list.
Method Summary
protected SortDefinition | copySortDefinition(SortDefinition sort) Create a deep copy of the given sort definition, for use as state holder to compare a modified sort definition against.
protected void | doSort(List<E> source, SortDefinition sort) Actually perform sorting of the given source list, according to the given sort definition.
int | getFirstElementOnPage() Return the element index of the first element on the current page.
int | getFirstLinkedPage() Return the first page to which create a link around the current page.
int | getLastElementOnPage() Return the element index of the last element on the current page.
int | getLastLinkedPage() Return the last page to which create a link around the current page.
int | getMaxLinkedPages() Return the maximum number of page links to a few pages around the current one.
int | getNrOfElements() Return the total number of elements in the source list.
int | getPage() Return the current page number.
int | getPageCount() Return the number of pages for the current source list.
List<E> | getPageList() Return a sub-list representing the current page.
int | getPageSize() Return the current page size.
Date | getRefreshDate() Return the last time the list has been fetched from the source provider.
SortDefinition | getSort() Return the sort definition for this holder.
List<E> | getSource() Return the source list for this holder.
boolean | isFirstPage() Return if the current page is the first one.
boolean | isLastPage() Return if the current page is the last one.
void | nextPage() Switch to next page.
void | previousPage() Switch to previous page.
void | resort() Resort the list if necessary, i.e.
void | setMaxLinkedPages(int maxLinkedPages) Set the maximum number of page links to a few pages around the current one.
void | setPage(int page) Set the current page number.
void | setPageSize(int pageSize) Set the current page size.
void | setSort(SortDefinition sort) Set the sort definition for this holder.
void | setSource(List<E> source) Set the source list for this holder.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_PAGE_SIZE

public static final int DEFAULT_PAGE_SIZE
See Also:
Constant Field Values

DEFAULT_MAX_LINKED_PAGES

public static final int DEFAULT_MAX_LINKED_PAGES
See Also:
Constant Field Values
Constructor Detail

PagedListHolder

public PagedListHolder()
Create a new holder instance. You'll need to set a source list to be able to use the holder.

See Also:
setSource(java.util.List)

PagedListHolder

public PagedListHolder(List<E> source)
Create a new holder instance with the given source list, starting with a default sort definition (with "toggleAscendingOnProperty" activated).

Parameters:
source - the source List
See Also:
MutableSortDefinition.setToggleAscendingOnProperty(boolean)

PagedListHolder

public PagedListHolder(List<E> source,
                       SortDefinition sort)
Create a new holder instance with the given source list.

Parameters:
source - the source List
sort - the SortDefinition to start with
Method Detail

setSource

public void setSource(List<E> source)
Set the source list for this holder.

getSource

public List<E> getSource()
Return the source list for this holder.

getRefreshDate

public Date getRefreshDate()
Return the last time the list has been fetched from the source provider.

setSort

public void setSort(SortDefinition sort)
Set the sort definition for this holder. Typically an instance of MutableSortDefinition.

See Also:
MutableSortDefinition

getSort

public SortDefinition getSort()
Return the sort definition for this holder.

setPageSize

public void setPageSize(int pageSize)
Set the current page size. Resets the current page number if changed.

Default value is 10.

getPageSize

public int getPageSize()
Return the current page size.

setPage

public void setPage(int page)
Set the current page number. Page numbering starts with 0.

getPage

public int getPage()
Return the current page number. Page numbering starts with 0.

setMaxLinkedPages

public void setMaxLinkedPages(int maxLinkedPages)
Set the maximum number of page links to a few pages around the current one.

getMaxLinkedPages

public int getMaxLinkedPages()
Return the maximum number of page links to a few pages around the current one.

getPageCount

public int getPageCount()
Return the number of pages for the current source list.

isFirstPage

public boolean isFirstPage()
Return if the current page is the first one.

isLastPage

public boolean isLastPage()
Return if the current page is the last one.

previousPage

public void previousPage()
Switch to previous page. Will stay on first page if already on first page.

nextPage

public void nextPage()
Switch to next page. Will stay on last page if already on last page.

getNrOfElements

public int getNrOfElements()
Return the total number of elements in the source list.

getFirstElementOnPage

public int getFirstElementOnPage()
Return the element index of the first element on the current page. Element numbering starts with 0.

getLastElementOnPage

public int getLastElementOnPage()
Return the element index of the last element on the current page. Element numbering starts with 0.

getPageList

public List<E> getPageList()
Return a sub-list representing the current page.

getFirstLinkedPage

public int getFirstLinkedPage()
Return the first page to which create a link around the current page.

getLastLinkedPage

public int getLastLinkedPage()
Return the last page to which create a link around the current page.

resort

public void resort()
Resort the list if necessary, i.e. if the current sort instance isn't equal to the backed-up sortUsed instance.

Calls doSort to trigger actual sorting.

See Also:
doSort(java.util.List, org.springframework.beans.support.SortDefinition)

copySortDefinition

protected SortDefinition copySortDefinition(SortDefinition sort)
Create a deep copy of the given sort definition, for use as state holder to compare a modified sort definition against.

Default implementation creates a MutableSortDefinition instance. Can be overridden in subclasses, in particular in case of custom extensions to the SortDefinition interface. Is allowed to return null, which means that no sort state will be held, triggering actual sorting for each resort call.

Parameters:
sort - the current SortDefinition object
Returns:
a deep copy of the SortDefinition object
See Also:
MutableSortDefinition.MutableSortDefinition(SortDefinition)

doSort

protected void doSort(List<E> source,
                      SortDefinition sort)
Actually perform sorting of the given source list, according to the given sort definition.

The default implementation uses Spring's PropertyComparator. Can be overridden in subclasses.

See Also:
PropertyComparator.sort(java.util.List, SortDefinition)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertyComparator

org.springframework.beans.support
Class PropertyComparator

java.lang.Object
    extended by  org.springframework.beans.support.PropertyComparator
All Implemented Interfaces:
Comparator
public class PropertyComparator
extends Object
implements Comparator

PropertyComparator performs a comparison of two beans, evaluating the specified bean property via a BeanWrapper.

Since:
19.05.2003
Author:
Juergen Hoeller, Jean-Pierre Pawlak
See Also:
BeanWrapper

Field Summary
protected  Log logger
Constructor Summary
PropertyComparator(SortDefinition sortDefinition)
Create a new PropertyComparator for the given SortDefinition.
PropertyComparator(String property, boolean ignoreCase, boolean ascending)
Create a PropertyComparator for the given settings.
Method Summary
int | compare(Object o1, Object o2)
SortDefinition | getSortDefinition() Return the SortDefinition that this comparator uses.
static void | sort(List source, SortDefinition sortDefinition) Sort the given List according to the given sort definition.
static void | sort(Object[] source, SortDefinition sortDefinition) Sort the given source according to the given sort definition.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals

Field Detail

logger

protected final Log logger
Constructor Detail

PropertyComparator

public PropertyComparator(SortDefinition sortDefinition)
Create a new PropertyComparator for the given SortDefinition.

See Also:
MutableSortDefinition

PropertyComparator

public PropertyComparator(String property,
                          boolean ignoreCase,
                          boolean ascending)
Create a PropertyComparator for the given settings.

Parameters:
property - the property to compare
ignoreCase - whether upper and lower case in String values should be ignored
ascending - whether to sort ascending (true) or descending (false)
Method Detail

getSortDefinition

public final SortDefinition getSortDefinition()
Return the SortDefinition that this comparator uses.

compare

public int compare(Object o1,
                   Object o2)
Specified by:
compare in interface Comparator

sort

public static void sort(List source,
                        SortDefinition sortDefinition)
                 throws BeansException
Sort the given List according to the given sort definition.

Note: Contained objects have to provide the given property in the form of a bean property, i.e. a getXXX method.

Parameters:
source - the input List
sortDefinition - the parameters to sort by
Throws:
IllegalArgumentException - in case of a missing propertyName
BeansException

sort

public static void sort(Object[] source,
                        SortDefinition sortDefinition)
                 throws BeansException
Sort the given source according to the given sort definition.

Note: Contained objects have to provide the given property in the form of a bean property, i.e. a getXXX method.

Parameters:
source - input source
sortDefinition - the parameters to sort by
Throws:
IllegalArgumentException - in case of a missing propertyName
BeansException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResourceEditorRegistrar

org.springframework.beans.support
Class ResourceEditorRegistrar

java.lang.Object
    extended by  org.springframework.beans.support.ResourceEditorRegistrar
All Implemented Interfaces:
PropertyEditorRegistrar
public class ResourceEditorRegistrar
extends Object
implements PropertyEditorRegistrar

PropertyEditorRegistrar implementation that populates a given PropertyEditorRegistry (typically a BeanWrapper used for bean creation within an ApplicationContext) with resource editors. Used by AbstractApplicationContext.

Since:
2.0
Author:
Juergen Hoeller

Constructor Summary
ResourceEditorRegistrar(ResourceLoader resourceLoader)
Create a new ResourceEditorRegistrar for the given ResourceLoader
Method Summary
 void registerCustomEditors(PropertyEditorRegistry registry)
Populate the given bean factory with the following resource editors: ResourceEditor, InputStreamEditor, FileEditor, URLEditor, ClassEditor, URIEditor.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ResourceEditorRegistrar

public ResourceEditorRegistrar(ResourceLoader resourceLoader)
Create a new ResourceEditorRegistrar for the given ResourceLoader

Parameters:
resourceLoader - the ResourceLoader (or ResourcePatternResolver) to create editors for (usually an ApplicationContext)
See Also:
ResourcePatternResolver, ApplicationContext
Method Detail

registerCustomEditors

public void registerCustomEditors(PropertyEditorRegistry registry)
Populate the given bean factory with the following resource editors: ResourceEditor, InputStreamEditor, FileEditor, URLEditor, ClassEditor, URIEditor.

In case of a ResourcePatternResolver, a ResourceArrayPropertyEditor will be registered as well.

Specified by:
registerCustomEditors in interface PropertyEditorRegistrar
Parameters:
registry - the PropertyEditorRegistry to register the custom PropertyEditors with
See Also:
ResourceEditor, InputStreamEditor, FileEditor, URLEditor, ClassEditor, URIEditor, ResourceArrayPropertyEditor
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.cache.ehcache

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.cache.ehcache

Support classes for the open source cache EHCache, allowing to set up an EHCache CacheManager and Caches as beans in a Spring context.

See:
Description

Class Summary
EhCacheFactoryBean | FactoryBean that creates a named EHCache Cache instance (or a decorator that implements the Ehcache interface), representing a cache region within an EHCache CacheManager.
EhCacheManagerFactoryBean | FactoryBean that exposes an EHCache CacheManager instance (independent or shared), configured from a specified config location.

Package org.springframework.cache.ehcache Description

Support classes for the open source cache EHCache, allowing to set up an EHCache CacheManager and Caches as beans in a Spring context.


org.springframework.cache.ehcache Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.cache.ehcache

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.cache.ehcache.EhCacheFactoryBean (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.cache.ehcache.EhCacheManagerFactoryBean (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)


EhCacheFactoryBean

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.cache.ehcache
Class EhCacheFactoryBean

java.lang.Object
    extended by  org.springframework.cache.ehcache.EhCacheFactoryBean
All Implemented Interfaces:
BeanNameAware, FactoryBean<Ehcache>, InitializingBean
public class EhCacheFactoryBean
extends Object
implements FactoryBean<Ehcache>, BeanNameAware, InitializingBean

FactoryBean that creates a named EHCache Cache instance (or a decorator that implements the Ehcache interface), representing a cache region within an EHCache CacheManager.

If the specified named cache is not configured in the cache configuration descriptor, this FactoryBean will construct an instance of a Cache with the provided name and the specified cache properties and add it to the CacheManager for later retrieval. If some or all properties are not set at configuration time, this FactoryBean will use defaults.

Note: If the named Cache instance is found, the properties will be ignored and the Cache instance will be retrieved from the CacheManager.

Note: As of Spring 3.0, Spring's EHCache support requires EHCache 1.3 or higher.

Since:
1.1.1
Author:
Dmitriy Kopylenko, Juergen Hoeller
See Also:
setCacheManager(net.sf.ehcache.CacheManager), EhCacheManagerFactoryBean, Cache

Field Summary
protected  Log logger
Constructor Summary
EhCacheFactoryBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected  Cache createCache()
Create a raw Cache object based on the configuration of this FactoryBean.
protected  Ehcache decorateCache(Ehcache cache)
Decorate the given Cache, if necessary.
 Ehcache getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<? extends Ehcache> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setBeanName(String name)
Set the name of the bean in the bean factory that created this bean.
 void setBlocking(boolean blocking)
Set whether to use a blocking cache that lets read attempts block until the requested element is created.
 void setBootstrapCacheLoader(BootstrapCacheLoader bootstrapCacheLoader)
Set an EHCache BootstrapCacheLoader for this cache, if any.
 void setCacheEntryFactory(CacheEntryFactory cacheEntryFactory)
Set an EHCache CacheEntryFactory to use for a self-populating cache.
 void setCacheEventListeners(Set<CacheEventListener> cacheEventListeners)
Specify EHCache cache event listeners to registered with this cache.
 void setCacheManager(CacheManager cacheManager)
Set a CacheManager from which to retrieve a named Cache instance.
 void setCacheName(String cacheName)
Set a name for which to retrieve or create a cache instance.
 void setClearOnFlush(boolean clearOnFlush)
Set whether the memory store should be cleared when flush is called on the cache.
 void setDiskExpiryThreadIntervalSeconds(int diskExpiryThreadIntervalSeconds)
Set the number of seconds between runs of the disk expiry thread.
 void setDiskPersistent(boolean diskPersistent)
Set whether the disk store persists between restarts of the Virtual Machine.
 void setDiskSpoolBufferSize(int diskSpoolBufferSize)
Set the amount of memory to allocate the write buffer for puts to the disk store.
 void setEternal(boolean eternal)
Set whether elements are considered as eternal.
 void setMaxElementsInMemory(int maxElementsInMemory)
Specify the maximum number of cached objects in memory.
 void setMaxElementsOnDisk(int maxElementsOnDisk)
Specify the maximum number of cached objects on disk.
 void setMemoryStoreEvictionPolicy(MemoryStoreEvictionPolicy memoryStoreEvictionPolicy)
Set the memory style eviction policy for this cache.
 void setOverflowToDisk(boolean overflowToDisk)
Set whether elements can overflow to disk when the in-memory cache has reached the maximum size limit.
 void setTimeToIdle(int timeToIdle)
Set the time in seconds to idle for an element before it expires, that is, the maximum amount of time between accesses before an element expires.
 void setTimeToLive(int timeToLive)
Set the time in seconds to live for an element before it expires, i.e.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Constructor Detail

EhCacheFactoryBean

public EhCacheFactoryBean()
Method Detail

setCacheManager

public void setCacheManager(CacheManager cacheManager)
Set a CacheManager from which to retrieve a named Cache instance. By default, CacheManager.getInstance() will be called.

Note that in particular for persistent caches, it is advisable to properly handle the shutdown of the CacheManager: Set up a separate EhCacheManagerFactoryBean and pass a reference to this bean property.

A separate EhCacheManagerFactoryBean is also necessary for loading EHCache configuration from a non-default config location.

See Also:
EhCacheManagerFactoryBean, CacheManager.getInstance()

setCacheName

public void setCacheName(String cacheName)
Set a name for which to retrieve or create a cache instance. Default is the bean name of this EhCacheFactoryBean.

setMaxElementsInMemory

public void setMaxElementsInMemory(int maxElementsInMemory)
Specify the maximum number of cached objects in memory. Default is 10000 elements.

setMaxElementsOnDisk

public void setMaxElementsOnDisk(int maxElementsOnDisk)
Specify the maximum number of cached objects on disk. Default is 10000000 elements.

setMemoryStoreEvictionPolicy

public void setMemoryStoreEvictionPolicy(MemoryStoreEvictionPolicy memoryStoreEvictionPolicy)
Set the memory style eviction policy for this cache.

Supported values are "LRU", "LFU" and "FIFO", according to the constants defined in EHCache's MemoryStoreEvictionPolicy class. Default is "LRU".

setOverflowToDisk

public void setOverflowToDisk(boolean overflowToDisk)
Set whether elements can overflow to disk when the in-memory cache has reached the maximum size limit. Default is "true".

setEternal

public void setEternal(boolean eternal)
Set whether elements are considered as eternal. If "true", timeouts are ignored and the element is never expired. Default is "false".

setTimeToLive

public void setTimeToLive(int timeToLive)
Set the time in seconds to live for an element before it expires, i.e. the maximum time between creation time and when an element expires.

This is only used if the element is not eternal. Default is 120 seconds.

setTimeToIdle

public void setTimeToIdle(int timeToIdle)
Set the time in seconds to idle for an element before it expires, that is, the maximum amount of time between accesses before an element expires.

This is only used if the element is not eternal. Default is 120 seconds.

setDiskPersistent

public void setDiskPersistent(boolean diskPersistent)
Set whether the disk store persists between restarts of the Virtual Machine. Default is "false".

setDiskExpiryThreadIntervalSeconds

public void setDiskExpiryThreadIntervalSeconds(int diskExpiryThreadIntervalSeconds)
Set the number of seconds between runs of the disk expiry thread. Default is 120 seconds.

setDiskSpoolBufferSize

public void setDiskSpoolBufferSize(int diskSpoolBufferSize)
Set the amount of memory to allocate the write buffer for puts to the disk store. Default is 0.

setClearOnFlush

public void setClearOnFlush(boolean clearOnFlush)
Set whether the memory store should be cleared when flush is called on the cache. Default is "true".

setBlocking

public void setBlocking(boolean blocking)
Set whether to use a blocking cache that lets read attempts block until the requested element is created.

If you intend to build a self-populating blocking cache, consider specifying a CacheEntryFactory.

See Also:
BlockingCache, setCacheEntryFactory(net.sf.ehcache.constructs.blocking.CacheEntryFactory)

setCacheEntryFactory

public void setCacheEntryFactory(CacheEntryFactory cacheEntryFactory)
Set an EHCache CacheEntryFactory to use for a self-populating cache. If such a factory is specified, the cache will be decorated with EHCache's SelfPopulatingCache.

The specified factory can be of type UpdatingCacheEntryFactory, which will lead to the use of an UpdatingSelfPopulatingCache.

Note: Any such self-populating cache is automatically a blocking cache.

See Also:
SelfPopulatingCache, UpdatingSelfPopulatingCache, UpdatingCacheEntryFactory

setBootstrapCacheLoader

public void setBootstrapCacheLoader(BootstrapCacheLoader bootstrapCacheLoader)
Set an EHCache BootstrapCacheLoader for this cache, if any.

setCacheEventListeners

public void setCacheEventListeners(Set<CacheEventListener> cacheEventListeners)
Specify EHCache cache event listeners to registered with this cache.

setBeanName

public void setBeanName(String name)
Description copied from interface: BeanNameAware
Set the name of the bean in the bean factory that created this bean.

Invoked after population of normal bean properties but before an init callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanName in interface BeanNameAware
Parameters:
name - the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use the BeanFactoryUtils.originalBeanName(String) method to extract the original bean name (without suffix), if desired.

afterPropertiesSet

public void afterPropertiesSet()
                        throws CacheException,
                               IOException
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
CacheException
IOException

createCache

protected Cache createCache()
Create a raw Cache object based on the configuration of this FactoryBean.

decorateCache

protected Ehcache decorateCache(Ehcache cache)
Decorate the given Cache, if necessary.

Parameters:
cache - the raw Cache object, based on the configuration of this FactoryBean
Returns:
the (potentially decorated) cache object to be registered with the CacheManager

getObject

public Ehcache getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<Ehcache>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends Ehcache> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<Ehcache>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<Ehcache>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


EhCacheManagerFactoryBean

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.cache.ehcache
Class EhCacheManagerFactoryBean

java.lang.Object
    extended by  org.springframework.cache.ehcache.EhCacheManagerFactoryBean
All Implemented Interfaces:
DisposableBean, FactoryBean<CacheManager>, InitializingBean
public class EhCacheManagerFactoryBean
extends Object
implements FactoryBean<CacheManager>, InitializingBean, DisposableBean

FactoryBean that exposes an EHCache CacheManager instance (independent or shared), configured from a specified config location.

If no config location is specified, a CacheManager will be configured from "ehcache.xml" in the root of the class path (that is, default EHCache initialization - as defined in the EHCache docs - will apply).

Setting up a separate EhCacheManagerFactoryBean is also advisable when using EhCacheFactoryBean, as it provides a (by default) independent CacheManager instance and cares for proper shutdown of the CacheManager. EhCacheManagerFactoryBean is also necessary for loading EHCache configuration from a non-default config location.

Note: As of Spring 3.0, Spring's EHCache support requires EHCache 1.3 or higher.

Since:
1.1.1
Author:
Dmitriy Kopylenko, Juergen Hoeller
See Also:
setConfigLocation(org.springframework.core.io.Resource), setShared(boolean), EhCacheFactoryBean, CacheManager

Field Summary
protected  Log logger
Constructor Summary
EhCacheManagerFactoryBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 void destroy()
Invoked by a BeanFactory on destruction of a singleton.
 CacheManager getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<? extends CacheManager> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setCacheManagerName(String cacheManagerName)
Set the name of the EHCache CacheManager (if a specific name is desired).
 void setConfigLocation(Resource configLocation)
Set the location of the EHCache config file.
 void setShared(boolean shared)
Set whether the EHCache CacheManager should be shared (as a singleton at the VM level) or independent (typically local within the application).
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Constructor Detail

EhCacheManagerFactoryBean

public EhCacheManagerFactoryBean()
Method Detail

setConfigLocation

public void setConfigLocation(Resource configLocation)
Set the location of the EHCache config file. A typical value is "/WEB-INF/ehcache.xml".

Default is "ehcache.xml" in the root of the class path, or if not found, "ehcache-failsafe.xml" in the EHCache jar (default EHCache initialization).

See Also:
CacheManager.create(java.io.InputStream), CacheManager.CacheManager(java.io.InputStream)

setShared

public void setShared(boolean shared)
Set whether the EHCache CacheManager should be shared (as a singleton at the VM level) or independent (typically local within the application). Default is "false", creating an independent instance.

See Also:
CacheManager.create(), CacheManager.CacheManager()

setCacheManagerName

public void setCacheManagerName(String cacheManagerName)
Set the name of the EHCache CacheManager (if a specific name is desired).

See Also:
CacheManager.setName(String)

afterPropertiesSet

public void afterPropertiesSet()
                        throws IOException,
                               CacheException
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
IOException
CacheException

getObject

public CacheManager getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<CacheManager>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends CacheManager> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<CacheManager>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<CacheManager>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()

destroy

public void destroy()
Description copied from interface: DisposableBean
Invoked by a BeanFactory on destruction of a singleton.

Specified by:
destroy in interface DisposableBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.context

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.context

This package builds on the beans package to add support for message sources and for the Observer design pattern, and the ability for application objects to obtain resources using a consistent API.

See:
Description

Interface Summary
ApplicationContext | Central interface to provide configuration for an application.
ApplicationContextAware | Interface to be implemented by any object that wishes to be notified of the ApplicationContext that it runs in.
ApplicationEventPublisher | Interface that encapsulates event publication functionality.
ApplicationEventPublisherAware | Interface to be implemented by any object that wishes to be notified of the ApplicationEventPublisher (typically the ApplicationContext) that it runs in.
ApplicationListener<E extends ApplicationEvent> | Interface to be implemented by application event listeners.
ConfigurableApplicationContext | SPI interface to be implemented by most if not all application contexts.
HierarchicalMessageSource | Sub-interface of MessageSource to be implemented by objects that can resolve messages hierarchically.
Lifecycle | Interface defining methods for start/stop lifecycle control.
LifecycleProcessor | Strategy interface for processing Lifecycle beans within the ApplicationContext.
MessageSource | Strategy interface for resolving messages, with support for the parameterization and internationalization of such messages.
MessageSourceAware | Interface to be implemented by any object that wishes to be notified of the MessageSource (typically the ApplicationContext) that it runs in.
MessageSourceResolvable | Interface for objects that are suitable for message resolution in a MessageSource.
Phased | Interface for objects that may participate in a phased process such as lifecycle management.
ResourceLoaderAware | Interface to be implemented by any object that wishes to be notified of the ResourceLoader (typically the ApplicationContext) that it runs in.
SmartLifecycle | An extension of the Lifecycle interface for those objects that require to be started upon ApplicationContext refresh and/or shutdown in a particular order.

Class Summary
ApplicationEvent Class to be extended by all application events.

Exception Summary
ApplicationContextException | Exception thrown during application context initialization.
NoSuchMessageException | Exception thrown when a message can't be resolved.

Package org.springframework.context Description

This package builds on the beans package to add support for message sources and for the Observer design pattern, and the ability for application objects to obtain resources using a consistent API.

There is no necessity for Spring applications to depend on ApplicationContext or even BeanFactory functionality explicitly. One of the strengths of the Spring architecture is that application objects can often be configured without any dependency on Spring-specific APIs.


org.springframework.context Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.context

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.util.EventObject (implements java.io.Serializable)
      • org.springframework.context.ApplicationEvent
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.beans.BeansException
              • org.springframework.beans.FatalBeanException
                • org.springframework.context.ApplicationContextException
          • org.springframework.context.NoSuchMessageException

Interface Hierarchy

  • org.springframework.context.ApplicationContextAware
  • org.springframework.context.ApplicationEventPublisher
    • org.springframework.context.ApplicationContext (also extends org.springframework.beans.factory.HierarchicalBeanFactory, org.springframework.beans.factory.ListableBeanFactory, org.springframework.context.MessageSource, org.springframework.core.io.support.ResourcePatternResolver)
      • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.Lifecycle)
  • org.springframework.context.ApplicationEventPublisherAware
  • org.springframework.beans.factory.BeanFactory
    • org.springframework.beans.factory.HierarchicalBeanFactory
      • org.springframework.context.ApplicationContext (also extends org.springframework.context.ApplicationEventPublisher, org.springframework.beans.factory.ListableBeanFactory, org.springframework.context.MessageSource, org.springframework.core.io.support.ResourcePatternResolver)
        • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.Lifecycle)
    • org.springframework.beans.factory.ListableBeanFactory
      • org.springframework.context.ApplicationContext (also extends org.springframework.context.ApplicationEventPublisher, org.springframework.beans.factory.HierarchicalBeanFactory, org.springframework.context.MessageSource, org.springframework.core.io.support.ResourcePatternResolver)
        • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.Lifecycle)
  • java.util.EventListener
    • org.springframework.context.ApplicationListener<E>
  • org.springframework.context.Lifecycle
    • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.ApplicationContext)
    • org.springframework.context.LifecycleProcessor
    • org.springframework.context.SmartLifecycle (also extends org.springframework.context.Phased)
  • org.springframework.context.MessageSource
    • org.springframework.context.ApplicationContext (also extends org.springframework.context.ApplicationEventPublisher, org.springframework.beans.factory.HierarchicalBeanFactory, org.springframework.beans.factory.ListableBeanFactory, org.springframework.core.io.support.ResourcePatternResolver)
      • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.Lifecycle)
    • org.springframework.context.HierarchicalMessageSource
  • org.springframework.context.MessageSourceAware
  • org.springframework.context.MessageSourceResolvable
  • org.springframework.context.Phased
    • org.springframework.context.SmartLifecycle (also extends org.springframework.context.Lifecycle)
  • org.springframework.core.io.ResourceLoader
    • org.springframework.core.io.support.ResourcePatternResolver
      • org.springframework.context.ApplicationContext (also extends org.springframework.context.ApplicationEventPublisher, org.springframework.beans.factory.HierarchicalBeanFactory, org.springframework.beans.factory.ListableBeanFactory, org.springframework.context.MessageSource)
        • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.Lifecycle)
  • org.springframework.context.ResourceLoaderAware


ApplicationContext

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.context
Interface ApplicationContext

All Superinterfaces:
ApplicationEventPublisher, BeanFactory, HierarchicalBeanFactory, ListableBeanFactory, MessageSource, ResourceLoader, ResourcePatternResolver
All Known Subinterfaces:
ConfigurableApplicationContext, ConfigurablePortletApplicationContext, ConfigurableWebApplicationContext, WebApplicationContext
All Known Implementing Classes:
AbstractApplicationContext, AbstractRefreshableApplicationContext, AbstractRefreshableConfigApplicationContext, AbstractRefreshablePortletApplicationContext, AbstractRefreshableWebApplicationContext, AbstractXmlApplicationContext, AnnotationConfigApplicationContext, AnnotationConfigWebApplicationContext, ClassPathXmlApplicationContext, FileSystemXmlApplicationContext, GenericApplicationContext, GenericWebApplicationContext, GenericXmlApplicationContext, ResourceAdapterApplicationContext, StaticApplicationContext, StaticPortletApplicationContext, StaticWebApplicationContext, XmlPortletApplicationContext, XmlWebApplicationContext
public interface ApplicationContext
extends ListableBeanFactory, HierarchicalBeanFactory, MessageSource, ApplicationEventPublisher, ResourcePatternResolver

Central interface to provide configuration for an application. This is read-only while the application is running, but may be reloaded if the implementation supports this.

An ApplicationContext provides:

  • Bean factory methods for accessing application components. Inherited from ListableBeanFactory.
  • The ability to load file resources in a generic fashion. Inherited from the ResourceLoader interface.
  • The ability to publish events to registered listeners. Inherited from the ApplicationEventPublisher interface.
  • The ability to resolve messages, supporting internationalization. Inherited from the MessageSource interface.
  • Inheritance from a parent context. Definitions in a descendant context will always take priority. This means, for example, that a single parent context can be used by an entire web application, while each servlet has its own child context that is independent of that of any other servlet.

In addition to standard BeanFactory lifecycle capabilities, ApplicationContext implementations detect and invoke ApplicationContextAware beans as well as ResourceLoaderAware, ApplicationEventPublisherAware and MessageSourceAware beans.

Author:
Rod Johnson, Juergen Hoeller
See Also:
ConfigurableApplicationContext, BeanFactory, ResourceLoader

Field Summary
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Method Summary
AutowireCapableBeanFactory | getAutowireCapableBeanFactory() Expose AutowireCapableBeanFactory functionality for this context.
String | getDisplayName() Return a friendly name for this context.
String | getId() Return the unique id of this application context.
ApplicationContext | getParent() Return the parent context, or null if there is no parent and this is the root of the context hierarchy.
long | getStartupDate() Return the timestamp when this context was first loaded.
Methods inherited from interface org.springframework.beans.factory.ListableBeanFactory
containsBeanDefinition, findAnnotationOnBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation
Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory
containsLocalBean, getParentBeanFactory
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getBean, getBean, getType, isPrototype, isSingleton, isTypeMatch
Methods inherited from interface org.springframework.context.MessageSource
getMessage, getMessage, getMessage
Methods inherited from interface org.springframework.context.ApplicationEventPublisher
publishEvent
Methods inherited from interface org.springframework.core.io.support.ResourcePatternResolver
getResources
Methods inherited from interface org.springframework.core.io.ResourceLoader
getClassLoader, getResource

Method Detail

getId

String getId()
Return the unique id of this application context.

Returns:
the unique id of the context, or null if none

getDisplayName

String getDisplayName()
Return a friendly name for this context.

Returns:
a display name for this context (never null)

getStartupDate

long getStartupDate()
Return the timestamp when this context was first loaded.

Returns:
the timestamp (ms) when this context was first loaded

getParent

ApplicationContext getParent()
Return the parent context, or null if there is no parent and this is the root of the context hierarchy.

Returns:
the parent context, or null if there is no parent

getAutowireCapableBeanFactory

AutowireCapableBeanFactory getAutowireCapableBeanFactory()
                                                         throws IllegalStateException
Expose AutowireCapableBeanFactory functionality for this context.

This is not typically used by application code, except for the purpose of initializing bean instances that live outside the application context, applying the Spring bean lifecycle (fully or partly) to them.

Alternatively, the internal BeanFactory exposed by the ConfigurableApplicationContext interface offers access to the AutowireCapableBeanFactory interface too. The present method mainly serves as convenient, specific facility on the ApplicationContext interface itself.

Returns:
the AutowireCapableBeanFactory for this context
Throws:
IllegalStateException - if the context does not support the AutowireCapableBeanFactory interface or does not hold an autowire-capable bean factory yet (usually if refresh() has never been called)
See Also:
ConfigurableApplicationContext.refresh(), ConfigurableApplicationContext.getBeanFactory()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ApplicationContextAware

org.springframework.context
Interface ApplicationContextAware

All Known Implementing Classes:
AbstractAtomFeedView, AbstractCachingViewResolver, AbstractCommandController, AbstractCommandController, AbstractController, AbstractController, AbstractControllerUrlHandlerMapping, AbstractDetectingUrlHandlerMapping, AbstractExcelView, AbstractFeedView, AbstractFormController, AbstractFormController, AbstractHandlerMapping, AbstractHandlerMapping, AbstractJasperReportsSingleFormatView, AbstractJasperReportsView, AbstractJExcelView, AbstractJUnit38SpringContextTests, AbstractJUnit4SpringContextTests, AbstractMapBasedHandlerMapping, AbstractPdfStamperView, AbstractPdfView, AbstractRssFeedView, AbstractTemplateView, AbstractTemplateViewResolver, AbstractTestNGSpringContextTests, AbstractTransactionalJUnit38SpringContextTests, AbstractTransactionalJUnit4SpringContextTests, AbstractTransactionalTestNGSpringContextTests, AbstractUrlBasedView, AbstractUrlHandlerMapping, AbstractUrlViewController, AbstractView, AbstractWizardFormController, AbstractWizardFormController, AbstractXsltView, AnnotationMethodHandlerAdapter, AnnotationMethodHandlerAdapter, ApplicationObjectSupport, BaseCommandController, BaseCommandController, BeanNameUrlHandlerMapping, BeanNameViewResolver, CancellableFormController, ConfigurableJasperReportsView, ContentNegotiatingViewResolver, ControllerBeanNameHandlerMapping, ControllerClassNameHandlerMapping, DefaultAnnotationHandlerMapping, DefaultAnnotationHandlerMapping, FreeMarkerView, FreeMarkerViewResolver, InternalResourceView, InternalResourceViewResolver, JasperReportsCsvView, JasperReportsHtmlView, JasperReportsMultiFormatView, JasperReportsPdfView, JasperReportsViewResolver, JasperReportsXlsView, JobDetailBean, JstlView, LocalValidatorFactoryBean, MappingJacksonJsonView, MarshallingView, MultiActionController, ParameterHandlerMapping, ParameterizableViewController, ParameterizableViewController, PortletApplicationObjectSupport, PortletContentGenerator, PortletModeHandlerMapping, PortletModeParameterHandlerMapping, PortletWrappingController, RedirectView, ResourceBundleViewResolver, ScheduledAnnotationBeanPostProcessor, SchedulerFactoryBean, ServletForwardingController, ServletWrappingController, SimpleFormController, SimpleFormController, SimpleUrlHandlerMapping, TilesConfigurer, TilesJstlView, TilesView, TilesView, TilesViewResolver, UrlBasedViewResolver, UrlFilenameViewController, VelocityLayoutView, VelocityLayoutViewResolver, VelocityToolboxView, VelocityView, VelocityViewResolver, WebApplicationObjectSupport, WebContentGenerator, WebContentInterceptor, XmlViewResolver, XsltView, XsltViewResolver
public interface ApplicationContextAware

Interface to be implemented by any object that wishes to be notified of the ApplicationContext that it runs in.

Implementing this interface makes sense for example when an object requires access to a set of collaborating beans. Note that configuration via bean references is preferable to implementing this interface just for bean lookup purposes.

This interface can also be implemented if an object needs access to file resources, i.e. wants to call getResource, wants to publish an application event, or requires access to the MessageSource. However, it is preferable to implement the more specific ResourceLoaderAware, ApplicationEventPublisherAware or MessageSourceAware interface in such a specific scenario.

Note that file resource dependencies can also be exposed as bean properties of type Resource, populated via Strings with automatic type conversion by the bean factory. This removes the need for implementing any callback interface just for the purpose of accessing a specific file resource.

ApplicationObjectSupport is a convenience base class for application objects, implementing this interface.

For a list of all bean lifecycle methods, see the BeanFactory javadocs.

Author:
Rod Johnson, Juergen Hoeller
See Also:
ResourceLoaderAware, ApplicationEventPublisherAware, MessageSourceAware, ApplicationObjectSupport, BeanFactoryAware

Method Summary
 void setApplicationContext(ApplicationContext applicationContext)
Set the ApplicationContext that this object runs in.

Method Detail

setApplicationContext

void setApplicationContext(ApplicationContext applicationContext)
                           throws BeansException
Set the ApplicationContext that this object runs in. Normally this call will be used to initialize the object.

Invoked after population of normal bean properties but before an init callback such as InitializingBean.afterPropertiesSet() or a custom init-method. Invoked after ResourceLoaderAware.setResourceLoader(org.springframework.core.io.ResourceLoader), ApplicationEventPublisherAware.setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher) and MessageSourceAware, if applicable.

Parameters:
applicationContext - the ApplicationContext object to be used by this object
Throws:
ApplicationContextException - in case of context initialization errors
BeansException - if thrown by application context methods
See Also:
BeanInitializationException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ApplicationEventPublisher

org.springframework.context
Interface ApplicationEventPublisher

All Known Subinterfaces:
ApplicationContext, ConfigurableApplicationContext, ConfigurablePortletApplicationContext, ConfigurableWebApplicationContext, WebApplicationContext
All Known Implementing Classes:
AbstractApplicationContext, AbstractRefreshableApplicationContext, AbstractRefreshableConfigApplicationContext, AbstractRefreshablePortletApplicationContext, AbstractRefreshableWebApplicationContext, AbstractXmlApplicationContext, AnnotationConfigApplicationContext, AnnotationConfigWebApplicationContext, ClassPathXmlApplicationContext, FileSystemXmlApplicationContext, GenericApplicationContext, GenericWebApplicationContext, GenericXmlApplicationContext, ResourceAdapterApplicationContext, StaticApplicationContext, StaticPortletApplicationContext, StaticWebApplicationContext, XmlPortletApplicationContext, XmlWebApplicationContext
public interface ApplicationEventPublisher

Interface that encapsulates event publication functionality. Serves as super-interface for ApplicationContext.

Since:
1.1.1
Author:
Juergen Hoeller
See Also:
ApplicationContext, ApplicationEventPublisherAware, ApplicationEvent, EventPublicationInterceptor

Method Summary
 void publishEvent(ApplicationEvent event)
Notify all listeners registered with this application of an application event.

Method Detail

publishEvent

void publishEvent(ApplicationEvent event)
Notify all listeners registered with this application of an application event. Events may be framework events (such as RequestHandledEvent) or application-specific events.

Parameters:
event - the event to publish
See Also:
RequestHandledEvent
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ApplicationEventPublisherAware

org.springframework.context
Interface ApplicationEventPublisherAware

All Known Implementing Classes:
EventPublicationInterceptor
public interface ApplicationEventPublisherAware

Interface to be implemented by any object that wishes to be notified of the ApplicationEventPublisher (typically the ApplicationContext) that it runs in.

Since:
1.1.1
Author:
Juergen Hoeller
See Also:
ApplicationContextAware

Method Summary
 void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
Set the ApplicationEventPublisher that this object runs in.

Method Detail

setApplicationEventPublisher

void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
Set the ApplicationEventPublisher that this object runs in.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked before ApplicationContextAware's setApplicationContext.

Parameters:
applicationEventPublisher - event publisher to be used by this object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ApplicationListener

org.springframework.context
Interface ApplicationListener<E extends ApplicationEvent>

Type Parameters:
E - the specific ApplicationEvent subclass to listen to
All Superinterfaces:
EventListener
All Known Subinterfaces:
SmartApplicationListener
All Known Implementing Classes:
DispatcherPortlet, FrameworkPortlet, GenericApplicationListenerAdapter, ScheduledAnnotationBeanPostProcessor, SourceFilteringListener
public interface ApplicationListener<E extends ApplicationEvent>
extends EventListener

Interface to be implemented by application event listeners. Based on the standard java.util.EventListener interface for the Observer design pattern.

As of Spring 3.0, an ApplicationListener can generically declare the event type that it is interested in. When registered with a Spring ApplicationContext, events will be filtered accordingly, with the listener getting invoked for matching event objects only.

Author:
Rod Johnson, Juergen Hoeller
See Also:
ApplicationEventMulticaster

Method Summary
 void onApplicationEvent(E event)
Handle an application event.

Method Detail

onApplicationEvent

void onApplicationEvent(E event)
Handle an application event.

Parameters:
event - the event to respond to
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConfigurableApplicationContext

org.springframework.context
Interface ConfigurableApplicationContext

All Superinterfaces:
ApplicationContext, ApplicationEventPublisher, BeanFactory, HierarchicalBeanFactory, Lifecycle, ListableBeanFactory, MessageSource, ResourceLoader, ResourcePatternResolver
All Known Subinterfaces:
ConfigurablePortletApplicationContext, ConfigurableWebApplicationContext
All Known Implementing Classes:
AbstractApplicationContext, AbstractRefreshableApplicationContext, AbstractRefreshableConfigApplicationContext, AbstractRefreshablePortletApplicationContext, AbstractRefreshableWebApplicationContext, AbstractXmlApplicationContext, AnnotationConfigApplicationContext, AnnotationConfigWebApplicationContext, ClassPathXmlApplicationContext, FileSystemXmlApplicationContext, GenericApplicationContext, GenericWebApplicationContext, GenericXmlApplicationContext, ResourceAdapterApplicationContext, StaticApplicationContext, StaticPortletApplicationContext, StaticWebApplicationContext, XmlPortletApplicationContext, XmlWebApplicationContext
public interface ConfigurableApplicationContext
extends ApplicationContext, Lifecycle

SPI interface to be implemented by most if not all application contexts. Provides facilities to configure an application context in addition to the application context client methods in the ApplicationContext interface.

Configuration and lifecycle methods are encapsulated here to avoid making them obvious to ApplicationContext client code. The present methods should only be used by startup and shutdown code.

Since:
03.11.2003
Author:
Juergen Hoeller

Field Summary
static String | CONFIG_LOCATION_DELIMITERS Any number of these characters are considered delimiters between multiple context config paths in a single String value.
static String | CONVERSION_SERVICE_BEAN_NAME Name of the ConversionService bean in the factory.
static String | LOAD_TIME_WEAVER_BEAN_NAME Name of the LoadTimeWeaver bean in the factory.
static String | SYSTEM_ENVIRONMENT_BEAN_NAME Name of the System environment bean in the factory.
static String | SYSTEM_PROPERTIES_BEAN_NAME Name of the System properties bean in the factory.
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Method Summary
void | addApplicationListener(ApplicationListener listener) Add a new ApplicationListener that will be notified on context events such as context refresh and context shutdown.
void | addBeanFactoryPostProcessor(BeanFactoryPostProcessor beanFactoryPostProcessor) Add a new BeanFactoryPostProcessor that will get applied to the internal bean factory of this application context on refresh, before any of the bean definitions get evaluated.
void | close() Close this application context, releasing all resources and locks that the implementation might hold.
ConfigurableListableBeanFactory | getBeanFactory() Return the internal bean factory of this application context.
boolean | isActive() Determine whether this application context is active, that is, whether it has been refreshed at least once and has not been closed yet.
void | refresh() Load or refresh the persistent representation of the configuration, which might an XML file, properties file, or relational database schema.
void | registerShutdownHook() Register a shutdown hook with the JVM runtime, closing this context on JVM shutdown unless it has already been closed at that time.
void | setId(String id) Set the unique id of this application context.
void | setParent(ApplicationContext parent) Set the parent of this application context.
Methods inherited from interface org.springframework.context.ApplicationContext
getAutowireCapableBeanFactory, getDisplayName, getId, getParent, getStartupDate
Methods inherited from interface org.springframework.beans.factory.ListableBeanFactory
containsBeanDefinition, findAnnotationOnBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation
Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory
containsLocalBean, getParentBeanFactory
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getBean, getBean, getType, isPrototype, isSingleton, isTypeMatch
Methods inherited from interface org.springframework.context.MessageSource
getMessage, getMessage, getMessage
Methods inherited from interface org.springframework.context.ApplicationEventPublisher
publishEvent
Methods inherited from interface org.springframework.core.io.support.ResourcePatternResolver
getResources
Methods inherited from interface org.springframework.core.io.ResourceLoader
getClassLoader, getResource
Methods inherited from interface org.springframework.context.Lifecycle
isRunning, start, stop

Field Detail

CONFIG_LOCATION_DELIMITERS

static final String CONFIG_LOCATION_DELIMITERS
Any number of these characters are considered delimiters between multiple context config paths in a single String value.

See Also:
AbstractRefreshableConfigApplicationContext.setConfigLocation(java.lang.String), ContextLoader.CONFIG_LOCATION_PARAM, FrameworkServlet.setContextConfigLocation(java.lang.String), Constant Field Values

CONVERSION_SERVICE_BEAN_NAME

static final String CONVERSION_SERVICE_BEAN_NAME
Name of the ConversionService bean in the factory. If none is supplied, default conversion rules apply.

See Also:
ConversionService, Constant Field Values

LOAD_TIME_WEAVER_BEAN_NAME

static final String LOAD_TIME_WEAVER_BEAN_NAME
Name of the LoadTimeWeaver bean in the factory. If such a bean is supplied, the context will use a temporary ClassLoader for type matching, in order to allow the LoadTimeWeaver to process all actual bean classes.

See Also:
LoadTimeWeaver, Constant Field Values

SYSTEM_PROPERTIES_BEAN_NAME

static final String SYSTEM_PROPERTIES_BEAN_NAME
Name of the System properties bean in the factory.

See Also:
System.getProperties(), Constant Field Values

SYSTEM_ENVIRONMENT_BEAN_NAME

static final String SYSTEM_ENVIRONMENT_BEAN_NAME
Name of the System environment bean in the factory.

See Also:
System.getenv(), Constant Field Values
Method Detail

setId

void setId(String id)
Set the unique id of this application context.

setParent

void setParent(ApplicationContext parent)
Set the parent of this application context.

Note that the parent shouldn't be changed: It should only be set outside a constructor if it isn't available when an object of this class is created, for example in case of WebApplicationContext setup.

Parameters:
parent - the parent context
See Also:
ConfigurableWebApplicationContext

addBeanFactoryPostProcessor

void addBeanFactoryPostProcessor(BeanFactoryPostProcessor beanFactoryPostProcessor)
Add a new BeanFactoryPostProcessor that will get applied to the internal bean factory of this application context on refresh, before any of the bean definitions get evaluated. To be invoked during context configuration.

Parameters:
beanFactoryPostProcessor - the factory processor to register

addApplicationListener

void addApplicationListener(ApplicationListener listener)
Add a new ApplicationListener that will be notified on context events such as context refresh and context shutdown.

Note that any ApplicationListener registered here will be applied on refresh if the context is not active yet, or on the fly with the current event multicaster in case of a context that is already active.

Parameters:
listener - the ApplicationListener to register
See Also:
ContextRefreshedEvent, ContextClosedEvent

refresh

void refresh()
             throws BeansException,
                    IllegalStateException
Load or refresh the persistent representation of the configuration, which might an XML file, properties file, or relational database schema.

As this is a startup method, it should destroy already created singletons if it fails, to avoid dangling resources. In other words, after invocation of that method, either all or no singletons at all should be instantiated.

Throws:
BeansException - if the bean factory could not be initialized
IllegalStateException - if already initialized and multiple refresh attempts are not supported

registerShutdownHook

void registerShutdownHook()
Register a shutdown hook with the JVM runtime, closing this context on JVM shutdown unless it has already been closed at that time.

This method can be called multiple times. Only one shutdown hook (at max) will be registered for each context instance.

See Also:
Runtime.addShutdownHook(java.lang.Thread), close()

close

void close()
Close this application context, releasing all resources and locks that the implementation might hold. This includes destroying all cached singleton beans.

Note: Does not invoke close on a parent context; parent contexts have their own, independent lifecycle.

This method can be called multiple times without side effects: Subsequent close calls on an already closed context will be ignored.

isActive

boolean isActive()
Determine whether this application context is active, that is, whether it has been refreshed at least once and has not been closed yet.

Returns:
whether the context is still active
See Also:
refresh(),
close(),
getBeanFactory()

getBeanFactory

ConfigurableListableBeanFactory getBeanFactory()
                                               throws IllegalStateException
Return the internal bean factory of this application context. Can be used to access specific functionality of the underlying factory.

Note: Do not use this to post-process the bean factory; singletons will already have been instantiated before. Use a BeanFactoryPostProcessor to intercept the BeanFactory setup process before beans get touched.

Generally, this internal factory will only be accessible while the context is active, that is, inbetween refresh() and close(). The isActive() flag can be used to check whether the context is in an appropriate state.

Returns:
the underlying bean factory
Throws:
IllegalStateException - if the context does not hold an internal bean factory (usually if refresh() hasn't been called yet or if close() has already been called)
See Also:
isActive(),
refresh(),
close(),
addBeanFactoryPostProcessor(org.springframework.beans.factory.config.BeanFactoryPostProcessor)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HierarchicalMessageSource

org.springframework.context
Interface HierarchicalMessageSource

All Superinterfaces:
MessageSource
All Known Implementing Classes:
AbstractMessageSource, DelegatingMessageSource, ReloadableResourceBundleMessageSource, ResourceBundleMessageSource, StaticMessageSource
public interface HierarchicalMessageSource
extends MessageSource

Sub-interface of MessageSource to be implemented by objects that can resolve messages hierarchically.

Author:
Rod Johnson, Juergen Hoeller

Method Summary
MessageSource | getParentMessageSource() Return the parent of this MessageSource, or null if none.
void | setParentMessageSource(MessageSource parent) Set the parent that will be used to try to resolve messages that this object can't resolve.
Methods inherited from interface org.springframework.context.MessageSource
getMessage, getMessage, getMessage

Method Detail

setParentMessageSource

void setParentMessageSource(MessageSource parent)
Set the parent that will be used to try to resolve messages that this object can't resolve.

Parameters:
parent - the parent MessageSource that will be used to resolve messages that this object can't resolve. May be null, in which case no further resolution is possible.

getParentMessageSource

MessageSource getParentMessageSource()
Return the parent of this MessageSource, or null if none.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Lifecycle

org.springframework.context
Interface Lifecycle

All Known Subinterfaces:
ConfigurableApplicationContext, ConfigurablePortletApplicationContext, ConfigurableWebApplicationContext, LifecycleProcessor, SmartLifecycle
All Known Implementing Classes:
AbstractApplicationContext, AbstractJmsListeningContainer, AbstractMessageListenerContainer, AbstractPollingMessageListenerContainer, AbstractRefreshableApplicationContext, AbstractRefreshableConfigApplicationContext, AbstractRefreshablePortletApplicationContext, AbstractRefreshableWebApplicationContext, AbstractXmlApplicationContext, AnnotationConfigApplicationContext, AnnotationConfigWebApplicationContext, ClassPathXmlApplicationContext, DefaultLifecycleProcessor, DefaultMessageListenerContainer, DefaultMessageListenerContainer102, FileSystemXmlApplicationContext, GenericApplicationContext, GenericMessageEndpointManager, GenericWebApplicationContext, GenericXmlApplicationContext, JmsMessageEndpointManager, ResourceAdapterApplicationContext, SchedulerFactoryBean, SimpleMessageListenerContainer, SimpleMessageListenerContainer102, StaticApplicationContext, StaticPortletApplicationContext, StaticWebApplicationContext, TimerManagerAccessor, TimerManagerFactoryBean, TimerManagerTaskScheduler, XmlPortletApplicationContext, XmlWebApplicationContext
public interface Lifecycle

Interface defining methods for start/stop lifecycle control. The typical use case for this is to control asynchronous processing.

Can be implemented by both components (typically a Spring bean defined in a Spring BeanFactory) and containers (typically a Spring ApplicationContext). Containers will propagate start/stop signals to all components that apply.

Can be used for direct invocations or for management operations via JMX. In the latter case, the MBeanExporter will typically be defined with an InterfaceBasedMBeanInfoAssembler, restricting the visibility of activity-controlled components to the Lifecycle interface.

Note that the Lifecycle interface is only supported on top-level singleton beans. On any other component, the Lifecycle interface will remain undetected and hence ignored. Also, note that the extended SmartLifecycle interface provides more sophisticated integration with the container's startup and shutdown phases.

Since:
2.0
Author:
Juergen Hoeller
See Also:
SmartLifecycle, ConfigurableApplicationContext, AbstractMessageListenerContainer, SchedulerFactoryBean

Method Summary
boolean | isRunning() Check whether this component is currently running.
void | start() Start this component.
void | stop() Stop this component.

Method Detail

start

void start()
Start this component. Should not throw an exception if the component is already running.

In the case of a container, this will propagate the start signal to all components that apply.

stop

void stop()
Stop this component. Should not throw an exception if the component isn't started yet.

In the case of a container, this will propagate the stop signal to all components that apply.

isRunning

boolean isRunning()
Check whether this component is currently running.

In the case of a container, this will return true only if all components that apply are currently running.

Returns:
whether the component is currently running
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LifecycleProcessor

org.springframework.context
Interface LifecycleProcessor

All Superinterfaces:
Lifecycle
All Known Implementing Classes:
DefaultLifecycleProcessor
public interface LifecycleProcessor
extends Lifecycle

Strategy interface for processing Lifecycle beans within the ApplicationContext.

Since:
3.0
Author:
Mark Fisher, Juergen Hoeller

Method Summary
void | onClose() Notification of context close phase, e.g.
void | onRefresh() Notification of context refresh, e.g.
Methods inherited from interface org.springframework.context.Lifecycle
isRunning, start, stop

Method Detail

onRefresh

void onRefresh()
Notification of context refresh, e.g. for auto-starting components.

onClose

void onClose()
Notification of context close phase, e.g. for auto-stopping components.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageSource

org.springframework.context
Interface MessageSource

All Known Subinterfaces:
ApplicationContext, ConfigurableApplicationContext, ConfigurablePortletApplicationContext, ConfigurableWebApplicationContext, HierarchicalMessageSource, WebApplicationContext
All Known Implementing Classes:
AbstractApplicationContext, AbstractMessageSource, AbstractRefreshableApplicationContext, AbstractRefreshableConfigApplicationContext, AbstractRefreshablePortletApplicationContext, AbstractRefreshableWebApplicationContext, AbstractXmlApplicationContext, AnnotationConfigApplicationContext, AnnotationConfigWebApplicationContext, ClassPathXmlApplicationContext, DelegatingMessageSource, FileSystemXmlApplicationContext, GenericApplicationContext, GenericWebApplicationContext, GenericXmlApplicationContext, ReloadableResourceBundleMessageSource, ResourceAdapterApplicationContext, ResourceBundleMessageSource, StaticApplicationContext, StaticMessageSource, StaticPortletApplicationContext, StaticWebApplicationContext, XmlPortletApplicationContext, XmlWebApplicationContext
public interface MessageSource

Strategy interface for resolving messages, with support for the parameterization and internationalization of such messages.

Spring provides two out-of-the-box implementations for production:

  • ResourceBundleMessageSource, built on top of the standard ResourceBundle
  • ReloadableResourceBundleMessageSource, being able to reload message definitions without restarting the VM

Author:
Rod Johnson, Juergen Hoeller
See Also:
ResourceBundleMessageSource, ReloadableResourceBundleMessageSource

Method Summary
String | getMessage(MessageSourceResolvable resolvable, Locale locale) Try to resolve the message using all the attributes contained within the MessageSourceResolvable argument that was passed in.
String | getMessage(String code, Object[] args, Locale locale) Try to resolve the message.
String | getMessage(String code, Object[] args, String defaultMessage, Locale locale) Try to resolve the message.

Method Detail

getMessage

String getMessage(String code,
                  Object[] args,
                  String defaultMessage,
                  Locale locale)
Try to resolve the message. Return default message if no message was found.

Parameters:
code - the code to lookup up, such as 'calculator.noRateSet'. Users of this class are encouraged to base message names on the relevant fully qualified class name, thus avoiding conflict and ensuring maximum clarity.
args - array of arguments that will be filled in for params within the message (params look like "{0}", "{1,date}", "{2,time}" within a message), or null if none.
defaultMessage - String to return if the lookup fails
locale - the Locale in which to do the lookup
Returns:
the resolved message if the lookup was successful; otherwise the default message passed as a parameter
See Also:
MessageFormat

getMessage

String getMessage(String code,
                  Object[] args,
                  Locale locale)
                  throws NoSuchMessageException
Try to resolve the message. Treat as an error if the message can't be found.

Parameters:
code - the code to lookup up, such as 'calculator.noRateSet'
args - Array of arguments that will be filled in for params within the message (params look like "{0}", "{1,date}", "{2,time}" within a message), or null if none.
locale - the Locale in which to do the lookup
Returns:
the resolved message
Throws:
NoSuchMessageException - if the message wasn't found
See Also:
MessageFormat

getMessage

String getMessage(MessageSourceResolvable resolvable,
                  Locale locale)
                  throws NoSuchMessageException
Try to resolve the message using all the attributes contained within the MessageSourceResolvable argument that was passed in.

NOTE: We must throw a NoSuchMessageException on this method since at the time of calling this method we aren't able to determine if the defaultMessage property of the resolvable is null or not.

Parameters:
resolvable - value object storing attributes required to properly resolve a message
locale - the Locale in which to do the lookup
Returns:
the resolved message
Throws:
NoSuchMessageException - if the message wasn't found
See Also:
MessageFormat
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageSourceAware

org.springframework.context
Interface MessageSourceAware

public interface MessageSourceAware

Interface to be implemented by any object that wishes to be notified of the MessageSource (typically the ApplicationContext) that it runs in.

Note that the MessageSource can usually also be passed on as bean reference (to arbitrary bean properties or constructor arguments), because it is defined as bean with name "messageSource" in the application context.

Since:
1.1.1
Author:
Juergen Hoeller
See Also:
ApplicationContextAware

Method Summary
 void setMessageSource(MessageSource messageSource)
Set the MessageSource that this object runs in.

Method Detail

setMessageSource

void setMessageSource(MessageSource messageSource)
Set the MessageSource that this object runs in.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked before ApplicationContextAware's setApplicationContext.

Parameters:
messageSource - message sourceto be used by this object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageSourceResolvable

org.springframework.context
Interface MessageSourceResolvable

All Known Implementing Classes:
DefaultMessageSourceResolvable, FieldError, ObjectError
public interface MessageSourceResolvable

Interface for objects that are suitable for message resolution in a MessageSource.

Spring's own validation error classes implement this interface.

Author:
Juergen Hoeller
See Also:
MessageSource.getMessage(MessageSourceResolvable, java.util.Locale), ObjectError, FieldError

Method Summary
Object[] | getArguments() Return the array of arguments to be used to resolve this message.
String[] | getCodes() Return the codes to be used to resolve this message, in the order that they should get tried.
String | getDefaultMessage() Return the default message to be used to resolve this message.

Method Detail

getCodes

String[] getCodes()
Return the codes to be used to resolve this message, in the order that they should get tried. The last code will therefore be the default one.

Returns:
a String array of codes which are associated with this message

getArguments

Object[] getArguments()
Return the array of arguments to be used to resolve this message.

Returns:
an array of objects to be used as parameters to replace placeholders within the message text
See Also:
MessageFormat

getDefaultMessage

String getDefaultMessage()
Return the default message to be used to resolve this message.

Returns:
the default message, or null if no default
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Phased

org.springframework.context
Interface Phased

All Known Subinterfaces:
SmartLifecycle
All Known Implementing Classes:
AbstractJmsListeningContainer, AbstractMessageListenerContainer, AbstractPollingMessageListenerContainer, DefaultMessageListenerContainer, DefaultMessageListenerContainer102, GenericMessageEndpointManager, JmsMessageEndpointManager, SchedulerFactoryBean, SimpleMessageListenerContainer, SimpleMessageListenerContainer102
public interface Phased

Interface for objects that may participate in a phased process such as lifecycle management.

Since:
3.0
Author:
Mark Fisher
See Also:
SmartLifecycle

Method Summary
 int getPhase()
Return the phase value of this object.

Method Detail

getPhase

int getPhase()
Return the phase value of this object.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResourceLoaderAware

org.springframework.context
Interface ResourceLoaderAware

All Known Implementing Classes:
AnnotationSessionFactoryBean, ClassPathBeanDefinitionScanner, ClassPathScanningCandidateComponentProvider, DefaultPersistenceUnitManager, FreeMarkerConfigurationFactoryBean, FreeMarkerConfigurer, LocalContainerEntityManagerFactoryBean, ReloadableResourceBundleMessageSource, SchedulerAccessor, SchedulerAccessorBean, SchedulerFactoryBean, ScriptFactoryPostProcessor, SortedResourcesFactoryBean, VelocityConfigurer, VelocityEngineFactoryBean
public interface ResourceLoaderAware

Interface to be implemented by any object that wishes to be notified of the ResourceLoader (typically the ApplicationContext) that it runs in. This is an alternative to a full ApplicationContext dependency via the ApplicationContextAware interface.

Note that Resource dependencies can also be exposed as bean properties of type Resource, populated via Strings with automatic type conversion by the bean factory. This removes the need for implementing any callback interface just for the purpose of accessing a specific file resource.

You typically need a ResourceLoader when your application object has to access a variety of file resources whose names are calculated. A good strategy is to make the object use a DefaultResourceLoader but still implement ResourceLoaderAware to allow for overriding when running in an ApplicationContext. See ReloadableResourceBundleMessageSource for an example.

A passed-in ResourceLoader can also be checked for the ResourcePatternResolver interface and cast accordingly, to be able to resolve resource patterns into arrays of Resource objects. This will always work when running in an ApplicationContext (the context interface extends ResourcePatternResolver). Use a PathMatchingResourcePatternResolver as default. See also the ResourcePatternUtils.getResourcePatternResolver method.

As alternative to a ResourcePatternResolver dependency, consider exposing bean properties of type Resource array, populated via pattern Strings with automatic type conversion by the bean factory.

Since:
10.03.2004
Author:
Juergen Hoeller
See Also:
ApplicationContextAware, InitializingBean, Resource, ResourcePatternResolver, ResourcePatternUtils.getResourcePatternResolver(org.springframework.core.io.ResourceLoader), DefaultResourceLoader, PathMatchingResourcePatternResolver, ReloadableResourceBundleMessageSource

Method Summary
 void setResourceLoader(ResourceLoader resourceLoader)
Set the ResourceLoader that this object runs in.

Method Detail

setResourceLoader

void setResourceLoader(ResourceLoader resourceLoader)
Set the ResourceLoader that this object runs in.

This might be a ResourcePatternResolver, which can be checked through instanceof ResourcePatternResolver. See also the ResourcePatternUtils.getResourcePatternResolver method.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked before ApplicationContextAware's setApplicationContext.

Parameters:
resourceLoader - ResourceLoader object to be used by this object
See Also:
ResourcePatternResolver, ResourcePatternUtils.getResourcePatternResolver(org.springframework.core.io.ResourceLoader)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SmartLifecycle

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.context
Interface SmartLifecycle

All Superinterfaces:
Lifecycle, Phased
All Known Implementing Classes:
AbstractJmsListeningContainer, AbstractMessageListenerContainer, AbstractPollingMessageListenerContainer, DefaultMessageListenerContainer, DefaultMessageListenerContainer102, GenericMessageEndpointManager, JmsMessageEndpointManager, SchedulerFactoryBean, SimpleMessageListenerContainer, SimpleMessageListenerContainer102
public interface SmartLifecycle
extends Lifecycle, Phased

An extension of the Lifecycle interface for those objects that require to be started upon ApplicationContext refresh and/or shutdown in a particular order. The isAutoStartup() return value indicates whether this object should be started at the time of a context refresh. The callback-accepting stop(Runnable) method is useful for objects that have an asynchronous shutdown process. Any implementation of this interface must invoke the callback's run() method upon shutdown completion to avoid unnecessary delays in the overall ApplicationContext shutdown.

This interface extends Phased, and the Phased.getPhase() method's return value indicates the phase within which this Lifecycle component should be started and stopped. The startup process begins with the lowest phase value and ends with the highest phase value (Integer.MIN_VALUE is the lowest possible, and Integer.MAX_VALUE is the highest possible). The shutdown process will apply the reverse order. Any components with the same value will be arbitrarily ordered within the same phase.

Example: if component B depends on component A having already started, then component A should have a lower phase value than component B. During the shutdown process, component B would be stopped before component A.

Any explicit "depends-on" relationship will take precedence over the phase order such that the dependent bean always starts after its dependency and always stops before its dependency.

Any Lifecycle components within the context that do not also implement SmartLifecycle will be treated as if they have a phase value of 0. That way a SmartLifecycle implementation may start before those Lifecycle components if it has a negative phase value, or it may start after those components if it has a positive phase value.

Note that, due to the auto-startup support in SmartLifecycle, a SmartLifecycle bean instance will get initialized on startup of the application context in any case. As a consequence, the bean definition lazy-init flag has very limited actual effect on SmartLifecycle beans.

Since:
3.0
Author:
Mark Fisher

Method Summary
boolean | isAutoStartup() Return whether this Lifecycle component should be started automatically by the container when the ApplicationContext is refreshed.
void | stop(Runnable callback) Indicates that a Lifecycle component must stop if it is currently running.
Methods inherited from interface org.springframework.context.Lifecycle
isRunning, start, stop
Methods inherited from interface org.springframework.context.Phased
getPhase

Method Detail

isAutoStartup

boolean isAutoStartup()
Return whether this Lifecycle component should be started automatically by the container when the ApplicationContext is refreshed. A value of "false" indicates that the component is intended to be started manually.

stop

void stop(Runnable callback)
Indicates that a Lifecycle component must stop if it is currently running.

The provided callback is used by the LifecycleProcessor to support an ordered, and potentially concurrent, shutdown of all components having a common shutdown order value. The callback must be executed after the SmartLifecycle component does indeed stop.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ApplicationEvent

org.springframework.context
Class ApplicationEvent

java.lang.Object
    extended by  java.util.EventObject
        extended by  org.springframework.context.ApplicationEvent
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ApplicationContextEvent, RequestHandledEvent
public abstract class ApplicationEvent
extends EventObject

Class to be extended by all application events. Abstract as it doesn't make sense for generic events to be published directly.

Author:
Rod Johnson, Juergen Hoeller
See Also:
Serialized Form

Field Summary
Fields inherited from class java.util.EventObject
source
Constructor Summary
ApplicationEvent(Object source)
Create a new ApplicationEvent.
Method Summary
 long getTimestamp()
Return the system time in milliseconds when the event happened.
Methods inherited from class java.util.EventObject
getSource, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ApplicationEvent

public ApplicationEvent(Object source)
Create a new ApplicationEvent.

Parameters:
source - the component that published the event (never null)
Method Detail

getTimestamp

public final long getTimestamp()
Return the system time in milliseconds when the event happened.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ApplicationContextException

org.springframework.context
Class ApplicationContextException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.beans.BeansException
                        extended by  org.springframework.beans.FatalBeanException
                            extended by  org.springframework.context.ApplicationContextException
All Implemented Interfaces:
Serializable
public class ApplicationContextException
extends FatalBeanException

Exception thrown during application context initialization.

Author:
Rod Johnson
See Also:
Serialized Form

Constructor Summary
ApplicationContextException(String msg)
Create a new ApplicationContextException with the specified detail message and no root cause.
ApplicationContextException(String msg, Throwable cause)
Create a new ApplicationContextException with the specified detail message and the given root cause.
Method Summary
Methods inherited from class org.springframework.beans.BeansException
equals, hashCode
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

ApplicationContextException

public ApplicationContextException(String msg)
Create a new ApplicationContextException with the specified detail message and no root cause.

Parameters:
msg - the detail message

ApplicationContextException

public ApplicationContextException(String msg,
                                   Throwable cause)
Create a new ApplicationContextException with the specified detail message and the given root cause.

Parameters:
msg - the detail message
cause - the root cause
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NoSuchMessageException

org.springframework.context
Class NoSuchMessageException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.context.NoSuchMessageException
All Implemented Interfaces:
Serializable
public class NoSuchMessageException
extends RuntimeException

Exception thrown when a message can't be resolved.

Author:
Rod Johnson
See Also:
Serialized Form

Constructor Summary
NoSuchMessageException(String code)
Create a new exception.
NoSuchMessageException(String code, Locale locale)
Create a new exception.
Method Summary
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

NoSuchMessageException

public NoSuchMessageException(String code,
                              Locale locale)
Create a new exception.

Parameters:
code - code that could not be resolved for given locale
locale - locale that was used to search for the code within

NoSuchMessageException

public NoSuchMessageException(String code)
Create a new exception.

Parameters:
code - code that could not be resolved for given locale
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.context.access

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.context.access

Helper infrastructure to locate and access shared application contexts.

See:
Description

Class Summary
ContextBeanFactoryReference | ApplicationContext-specific implementation of BeanFactoryReference, wrapping a newly created ApplicationContext, closing it on release.
ContextJndiBeanFactoryLocator | BeanFactoryLocator implementation that creates the BeanFactory from one or more classpath locations specified in a JNDI environment variable.
ContextSingletonBeanFactoryLocator | Variant of SingletonBeanFactoryLocator which creates its internal bean factory reference as an ApplicationContext instead of SingletonBeanFactoryLocator's simple BeanFactory.
DefaultLocatorFactory | A factory class to get a default ContextSingletonBeanFactoryLocator instance.

Package org.springframework.context.access Description

Helper infrastructure to locate and access shared application contexts.

Note: This package is only relevant for special sharing of application contexts, for example behind EJB facades. It is not used in a typical web application or standalone application.


org.springframework.context.access Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.context.access

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.context.access.ContextBeanFactoryReference (implements org.springframework.beans.factory.access.BeanFactoryReference)
    • org.springframework.context.access.DefaultLocatorFactory
    • org.springframework.jndi.JndiAccessor
      • org.springframework.jndi.JndiLocatorSupport
        • org.springframework.context.access.ContextJndiBeanFactoryLocator (implements org.springframework.beans.factory.access.BeanFactoryLocator)
    • org.springframework.beans.factory.access.SingletonBeanFactoryLocator (implements org.springframework.beans.factory.access.BeanFactoryLocator)
      • org.springframework.context.access.ContextSingletonBeanFactoryLocator


ContextBeanFactoryReference

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.context.access
Class ContextBeanFactoryReference

java.lang.Object
    extended by  org.springframework.context.access.ContextBeanFactoryReference
All Implemented Interfaces:
BeanFactoryReference
public class ContextBeanFactoryReference
extends Object
implements BeanFactoryReference

ApplicationContext-specific implementation of BeanFactoryReference, wrapping a newly created ApplicationContext, closing it on release.

As per BeanFactoryReference contract, release may be called more than once, with subsequent calls not doing anything. However, calling getFactory after a release call will cause an exception.

Since:
13.02.2004
Author:
Juergen Hoeller, Colin Sampaleanu
See Also:
ConfigurableApplicationContext.close()

Constructor Summary
ContextBeanFactoryReference(ApplicationContext applicationContext)
Create a new ContextBeanFactoryReference for the given context.
Method Summary
BeanFactory | getFactory() Return the BeanFactory instance held by this reference.
void | release() Indicate that the BeanFactory instance referred to by this object is not needed any longer by the client code which obtained the BeanFactoryReference.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ContextBeanFactoryReference

public ContextBeanFactoryReference(ApplicationContext applicationContext)
Create a new ContextBeanFactoryReference for the given context.

Parameters:
applicationContext - the ApplicationContext to wrap
Method Detail

getFactory

public BeanFactory getFactory()
Description copied from interface: BeanFactoryReference
Return the BeanFactory instance held by this reference.

Specified by:
getFactory in interface BeanFactoryReference

release

public void release()
Description copied from interface: BeanFactoryReference
Indicate that the BeanFactory instance referred to by this object is not needed any longer by the client code which obtained the BeanFactoryReference.

Depending on the actual implementation of BeanFactoryLocator, and the actual type of BeanFactory, this may possibly not actually do anything; alternately in the case of a 'closeable' BeanFactory or derived class (such as ApplicationContext) may 'close' it, or may 'close' it once no more references remain.

In an EJB usage scenario this would normally be called from ejbRemove() and ejbPassivate().

This is safe to call multiple times.

Specified by:
release in interface BeanFactoryReference
See Also:
BeanFactoryLocator, ContextBeanFactoryReference, ConfigurableApplicationContext.close()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ContextJndiBeanFactoryLocator

org.springframework.context.access
Class ContextJndiBeanFactoryLocator

java.lang.Object
    extended by  org.springframework.jndi.JndiAccessor
        extended by  org.springframework.jndi.JndiLocatorSupport
            extended by  org.springframework.context.access.ContextJndiBeanFactoryLocator
All Implemented Interfaces:
BeanFactoryLocator
public class ContextJndiBeanFactoryLocator
extends JndiLocatorSupport
implements BeanFactoryLocator

BeanFactoryLocator implementation that creates the BeanFactory from one or more classpath locations specified in a JNDI environment variable.

This default implementation creates a ClassPathXmlApplicationContext. Subclasses may override createBeanFactory(java.lang.String[]) for custom instantiation.

Author:
Colin Sampaleanu, Juergen Hoeller
See Also:
createBeanFactory(java.lang.String[])

Field Summary
static String BEAN_FACTORY_PATH_DELIMITERS
Any number of these characters are considered delimiters between multiple bean factory config paths in a single String value.
Fields inherited from class org.springframework.jndi.JndiLocatorSupport
CONTAINER_PREFIX
Fields inherited from class org.springframework.jndi.JndiAccessor
logger
Constructor Summary
ContextJndiBeanFactoryLocator()
Method Summary
protected ApplicationContext | createApplicationContext(String[] resources) Create the ApplicationContext instance, given an array of class path resource Strings which should be combined
protected BeanFactoryReference | createBeanFactory(String[] resources) Create the BeanFactory instance, given an array of class path resource Strings which should be combined.
BeanFactoryReference | useBeanFactory(String factoryKey) Load/use a bean factory, as specified by a factory key which is a JNDI address, of the form java:comp/env/ejb/BeanFactoryPath.
Methods inherited from class org.springframework.jndi.JndiLocatorSupport
convertJndiName, isResourceRef, lookup, lookup, setResourceRef
Methods inherited from class org.springframework.jndi.JndiAccessor
getJndiEnvironment, getJndiTemplate, setJndiEnvironment, setJndiTemplate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

BEAN_FACTORY_PATH_DELIMITERS

public static final String BEAN_FACTORY_PATH_DELIMITERS
Any number of these characters are considered delimiters between multiple bean factory config paths in a single String value.

See Also:
Constant Field Values
Constructor Detail

ContextJndiBeanFactoryLocator

public ContextJndiBeanFactoryLocator()
Method Detail

useBeanFactory

public BeanFactoryReference useBeanFactory(String factoryKey)
                                    throws BeansException
Load/use a bean factory, as specified by a factory key which is a JNDI address, of the form java:comp/env/ejb/BeanFactoryPath. The contents of this JNDI location must be a string containing one or more classpath resource names (separated by any of the delimiters ',; \t\n' if there is more than one. The resulting BeanFactory (or ApplicationContext) will be created from the combined resources.

Specified by:
useBeanFactory in interface BeanFactoryLocator
Parameters:
factoryKey - a resource name specifying which BeanFactory the BeanFactoryLocator must return for usage. The actual meaning of the resource name is specific to the implementation of BeanFactoryLocator.
Returns:
the BeanFactory instance, wrapped as a BeanFactoryReference object
Throws:
BeansException - if there is an error loading or accessing the BeanFactory
See Also:
createBeanFactory(java.lang.String[])

createBeanFactory

protected BeanFactoryReference createBeanFactory(String[] resources)
                                          throws BeansException
Create the BeanFactory instance, given an array of class path resource Strings which should be combined. This is split out as a separate method so that subclasses can override the actual BeanFactory implementation class.

Delegates to createApplicationContext by default, wrapping the result in a ContextBeanFactoryReference.

Parameters:
resources - an array of Strings representing classpath resource names
Returns:
the created BeanFactory, wrapped in a BeanFactoryReference (for example, a ContextBeanFactoryReference wrapping an ApplicationContext)
Throws:
BeansException - if factory creation failed
See Also:
createApplicationContext(java.lang.String[]), ContextBeanFactoryReference

createApplicationContext

protected ApplicationContext createApplicationContext(String[] resources)
                                               throws BeansException
Create the ApplicationContext instance, given an array of class path resource Strings which should be combined

Parameters:
resources - an array of Strings representing classpath resource names
Returns:
the created ApplicationContext
Throws:
BeansException - if context creation failed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ContextSingletonBeanFactoryLocator

org.springframework.context.access
Class ContextSingletonBeanFactoryLocator

java.lang.Object
    extended by  org.springframework.beans.factory.access.SingletonBeanFactoryLocator
        extended by  org.springframework.context.access.ContextSingletonBeanFactoryLocator
All Implemented Interfaces:
BeanFactoryLocator
public class ContextSingletonBeanFactoryLocator
extends SingletonBeanFactoryLocator

Variant of SingletonBeanFactoryLocator which creates its internal bean factory reference as an ApplicationContext instead of SingletonBeanFactoryLocator's simple BeanFactory. For almost all usage scenarios, this will not make a difference, since within that ApplicationContext or BeanFactory you are still free to define either BeanFactory or ApplicationContext instances. The main reason one would need to use this class is if bean post-processing (or other ApplicationContext specific features are needed in the bean reference definition itself).

Note: This class uses classpath*:beanRefContext.xml as the default resource location for the bean factory reference definition files. It is not possible nor legal to share definitions with SingletonBeanFactoryLocator at the same time.

Author:
Colin Sampaleanu, Juergen Hoeller
See Also:
SingletonBeanFactoryLocator, DefaultLocatorFactory

Field Summary
Fields inherited from class org.springframework.beans.factory.access.SingletonBeanFactoryLocator
logger
Constructor Summary
protected ContextSingletonBeanFactoryLocator(String resourceLocation)
Constructor which uses the the specified name as the resource name of the definition file(s).
Method Summary
protected  BeanFactory createDefinition(String resourceLocation, String factoryKey)
Overrides the default method to create definition object as an ApplicationContext instead of the default BeanFactory.
protected  void destroyDefinition(BeanFactory groupDef, String selector)
Overrides the default method to operate on an ApplicationContext, invoking ConfigurableApplicationContext.close().
static BeanFactoryLocator getInstance()
Returns an instance which uses the default "classpath*:beanRefContext.xml", as the name of the definition file(s).
static BeanFactoryLocator getInstance(String selector)
Returns an instance which uses the the specified selector, as the name of the definition file(s).
protected  void initializeDefinition(BeanFactory groupDef)
Overrides the default method to refresh the ApplicationContext, invoking ConfigurableApplicationContext.refresh().
Methods inherited from class org.springframework.beans.factory.access.SingletonBeanFactoryLocator
useBeanFactory
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ContextSingletonBeanFactoryLocator

protected ContextSingletonBeanFactoryLocator(String resourceLocation)
Constructor which uses the the specified name as the resource name of the definition file(s).

Parameters:
resourceLocation - the Spring resource location to use (either a URL or a "classpath:" / "classpath*:" pseudo URL)
Method Detail

getInstance

public static BeanFactoryLocator getInstance()
                                      throws BeansException
Returns an instance which uses the default "classpath*:beanRefContext.xml", as the name of the definition file(s). All resources returned by the current thread's context class loader's getResources method with this name will be combined to create a definition, which is just a BeanFactory.

Returns:
the corresponding BeanFactoryLocator instance
Throws:
BeansException - in case of factory loading failure

getInstance

public static BeanFactoryLocator getInstance(String selector)
                                      throws BeansException
Returns an instance which uses the the specified selector, as the name of the definition file(s). In the case of a name with a Spring "classpath*:" prefix, or with no prefix, which is treated the same, the current thread's context class loader's getResources method will be called with this value to get all resources having that name. These resources will then be combined to form a definition. In the case where the name uses a Spring "classpath:" prefix, or a standard URL prefix, then only one resource file will be loaded as the definition.

Parameters:
selector - the location of the resource(s) which will be read and combined to form the definition for the BeanFactoryLocator instance. Any such files must form a valid ApplicationContext definition.
Returns:
the corresponding BeanFactoryLocator instance
Throws:
BeansException - in case of factory loading failure

createDefinition

protected BeanFactory createDefinition(String resourceLocation,
                                       String factoryKey)
Overrides the default method to create definition object as an ApplicationContext instead of the default BeanFactory. This does not affect what can actually be loaded by that definition.

The default implementation simply builds a ClassPathXmlApplicationContext.

Overrides:
createDefinition in class SingletonBeanFactoryLocator
Parameters:
resourceLocation - the resource location for this factory group
factoryKey - the bean name of the factory to obtain
Returns:
the corresponding BeanFactory reference

initializeDefinition

protected void initializeDefinition(BeanFactory groupDef)
Overrides the default method to refresh the ApplicationContext, invoking ConfigurableApplicationContext.refresh().

Overrides:
initializeDefinition in class SingletonBeanFactoryLocator
Parameters:
groupDef - the factory returned by createDefinition()

destroyDefinition

protected void destroyDefinition(BeanFactory groupDef,
                                 String selector)
Overrides the default method to operate on an ApplicationContext, invoking ConfigurableApplicationContext.close().

Overrides:
destroyDefinition in class SingletonBeanFactoryLocator
Parameters:
groupDef - the factory returned by createDefinition()
selector - the resource location for this factory group
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultLocatorFactory

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.context.access
Class DefaultLocatorFactory

java.lang.Object
    extended by  org.springframework.context.access.DefaultLocatorFactory

public class DefaultLocatorFactory
extends Object

A factory class to get a default ContextSingletonBeanFactoryLocator instance.

Author:
Colin Sampaleanu
See Also:
ContextSingletonBeanFactoryLocator

Constructor Summary
DefaultLocatorFactory()
Method Summary
static BeanFactoryLocator | getInstance() Return an instance object implementing BeanFactoryLocator.
static BeanFactoryLocator | getInstance(String selector) Return an instance object implementing BeanFactoryLocator.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DefaultLocatorFactory

public DefaultLocatorFactory()
Method Detail

getInstance

public static BeanFactoryLocator getInstance()
                                      throws FatalBeanException
Return an instance object implementing BeanFactoryLocator. This will normally be a singleton instance of the specific ContextSingletonBeanFactoryLocator class, using the default resource selector.

Throws:
FatalBeanException

getInstance

public static BeanFactoryLocator getInstance(String selector)
                                      throws FatalBeanException
Return an instance object implementing BeanFactoryLocator. This will normally be a singleton instance of the specific ContextSingletonBeanFactoryLocator class, using the specified resource selector.

Parameters:
selector - a selector variable which provides a hint to the factory as to which instance to return.
Throws:
FatalBeanException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.context.annotation

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.context.annotation

Annotation support for the Application Context, including JSR-250 "common" annotations, component-scanning, and Java-based metadata for creating Spring-managed objects.

See:
Description

Interface Summary
ScopeMetadataResolver Strategy interface for resolving the scope of bean definitions.

Class Summary
AnnotatedBeanDefinitionReader | Convenient adapter for programmatic registration of annotated bean classes.
AnnotationBeanNameGenerator | BeanNameGenerator implementation for bean classes annotated with the @Component annotation or with another annotation that is itself annotated with @Component as a meta-annotation.
AnnotationConfigApplicationContext | Standalone application context, accepting annotated classes as input - in particular @Configuration-annotated classes, but also plain @Components and JSR-330 compliant classes using javax.inject annotations.
AnnotationConfigBeanDefinitionParser | Parser for the <context:annotation-config/> element.
AnnotationConfigUtils | Utility class that allows for convenient registration of common BeanPostProcessor and BeanFactoryPostProcessor definitions for annotation-based configuration.
AnnotationScopeMetadataResolver | A ScopeMetadataResolver implementation that by default checks for the presence of Spring's Scope annotation on the bean class.
ClassPathBeanDefinitionScanner | A bean definition scanner that detects bean candidates on the classpath, registering corresponding bean definitions with a given registry (BeanFactory or ApplicationContext).
ClassPathScanningCandidateComponentProvider | A component provider that scans the classpath from a base package.
CommonAnnotationBeanPostProcessor | BeanPostProcessor implementation that supports common Java annotations out of the box, in particular the JSR-250 annotations in the javax.annotation package.
ComponentScanBeanDefinitionParser | Parser for the <context:component-scan/> element.
ConfigurationClassPostProcessor | BeanFactoryPostProcessor used for bootstrapping processing of @Configuration classes.
Jsr330ScopeMetadataResolver | Simple ScopeMetadataResolver implementation that follows JSR-330 scoping rules: defaulting to prototype scope unless Singleton is present.
ScannedGenericBeanDefinition | Extension of the GenericBeanDefinition class, based on an ASM ClassReader, with support for annotation metadata exposed through the AnnotatedBeanDefinition interface.
ScopeMetadata | Describes scope characteristics for a Spring-managed bean including the scope name and the scoped-proxy behavior.

Enum Summary
FilterType | Enumeration of the valid type filters to be added for annotation-driven configuration.
ScopedProxyMode | Enumerates the various scoped-proxy options.

Annotation Types Summary
Bean | Indicates that a method produces a bean to be managed by the Spring container.
Configuration | Indicates that a class declares one or more Bean methods and may be processed by the Spring container to generate bean definitions and service requests for those beans at runtime.
DependsOn | Beans on which the current bean depends.
Import | Indicates one or more Configuration classes to import.
ImportResource | Indicates one or more resources containing bean definitions to import.
Lazy | Indicates whether a bean is to be lazily initialized.
Primary | Indicates that a bean should be given preference when multiple candidates are qualified to autowire a single-valued dependency.
Scope | When used as a type-level annotation in conjunction with the Component annotation, indicates the name of a scope to use for instances of the annotated type.

Package org.springframework.context.annotation Description

Annotation support for the Application Context, including JSR-250 "common" annotations, component-scanning, and Java-based metadata for creating Spring-managed objects.


org.springframework.context.annotation Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.context.annotation

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.context.annotation.AnnotatedBeanDefinitionReader
    • org.springframework.context.annotation.AnnotationBeanNameGenerator (implements org.springframework.beans.factory.support.BeanNameGenerator)
    • org.springframework.context.annotation.AnnotationConfigBeanDefinitionParser (implements org.springframework.beans.factory.xml.BeanDefinitionParser)
    • org.springframework.context.annotation.AnnotationConfigUtils
    • org.springframework.context.annotation.AnnotationScopeMetadataResolver (implements org.springframework.context.annotation.ScopeMetadataResolver)
    • org.springframework.core.AttributeAccessorSupport (implements org.springframework.core.AttributeAccessor, java.io.Serializable)
      • org.springframework.beans.BeanMetadataAttributeAccessor (implements org.springframework.beans.BeanMetadataElement)
        • org.springframework.beans.factory.support.AbstractBeanDefinition (implements org.springframework.beans.factory.config.BeanDefinition, java.lang.Cloneable)
          • org.springframework.beans.factory.support.GenericBeanDefinition
            • org.springframework.context.annotation.ScannedGenericBeanDefinition (implements org.springframework.beans.factory.annotation.AnnotatedBeanDefinition)
    • org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider (implements org.springframework.context.ResourceLoaderAware)
      • org.springframework.context.annotation.ClassPathBeanDefinitionScanner
    • org.springframework.context.annotation.ComponentScanBeanDefinitionParser (implements org.springframework.beans.factory.xml.BeanDefinitionParser)
    • org.springframework.context.annotation.ConfigurationClassPostProcessor (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor)
    • org.springframework.core.io.DefaultResourceLoader (implements org.springframework.core.io.ResourceLoader)
      • org.springframework.context.support.AbstractApplicationContext (implements org.springframework.context.ConfigurableApplicationContext, org.springframework.beans.factory.DisposableBean)
        • org.springframework.context.support.GenericApplicationContext (implements org.springframework.beans.factory.support.BeanDefinitionRegistry)
          • org.springframework.context.annotation.AnnotationConfigApplicationContext
    • org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor (implements org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor, org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor, org.springframework.core.PriorityOrdered, java.io.Serializable)
      • org.springframework.context.annotation.CommonAnnotationBeanPostProcessor (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor, java.io.Serializable)
    • org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement
      • org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.LookupElement
    • org.springframework.context.annotation.Jsr330ScopeMetadataResolver (implements org.springframework.context.annotation.ScopeMetadataResolver)
    • org.springframework.context.annotation.ScopeMetadata

Interface Hierarchy

  • org.springframework.context.annotation.ScopeMetadataResolver

Annotation Type Hierarchy

  • org.springframework.context.annotation.Scope (implements java.lang.annotation.Annotation)
  • org.springframework.context.annotation.Primary (implements java.lang.annotation.Annotation)
  • org.springframework.context.annotation.Lazy (implements java.lang.annotation.Annotation)
  • org.springframework.context.annotation.ImportResource (implements java.lang.annotation.Annotation)
  • org.springframework.context.annotation.Import (implements java.lang.annotation.Annotation)
  • org.springframework.context.annotation.DependsOn (implements java.lang.annotation.Annotation)
  • org.springframework.context.annotation.Configuration (implements java.lang.annotation.Annotation)
  • org.springframework.context.annotation.Bean (implements java.lang.annotation.Annotation)

Enum Hierarchy

  • java.lang.Object
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)
      • org.springframework.context.annotation.ScopedProxyMode
      • org.springframework.context.annotation.FilterType


ScopeMetadataResolver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.context.annotation
Interface ScopeMetadataResolver

All Known Implementing Classes:
AnnotationScopeMetadataResolver, Jsr330ScopeMetadataResolver
public interface ScopeMetadataResolver

Strategy interface for resolving the scope of bean definitions.

Since:
2.5
Author:
Mark Fisher
See Also:
Scope

Method Summary
 ScopeMetadata resolveScopeMetadata(BeanDefinition definition)
Resolve the ScopeMetadata appropriate to the supplied bean definition.

Method Detail

resolveScopeMetadata

ScopeMetadata resolveScopeMetadata(BeanDefinition definition)
Resolve the ScopeMetadata appropriate to the supplied bean definition.

Implementations can of course use any strategy they like to determine the scope metadata, but some implementations that spring immediately to mind might be to use source level annotations present on the class of the supplied definition, or to use metadata present in the AttributeAccessor.attributeNames() of the supplied definition.

Parameters:
definition - the target bean definition
Returns:
the relevant scope metadata; never null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AnnotatedBeanDefinitionReader

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.context.annotation
Class AnnotatedBeanDefinitionReader

java.lang.Object
    extended by  org.springframework.context.annotation.AnnotatedBeanDefinitionReader

public class AnnotatedBeanDefinitionReader
extends Object

Convenient adapter for programmatic registration of annotated bean classes. This is an alternative to ClassPathBeanDefinitionScanner, applying the same resolution of annotations but for explicitly registered classes only.

Since:
3.0
Author:
Juergen Hoeller
See Also:
AnnotationConfigApplicationContext.register(java.lang.Class...)

Constructor Summary
AnnotatedBeanDefinitionReader(BeanDefinitionRegistry registry)
Create a new AnnotatedBeanDefinitionReader for the given bean factory.
Method Summary
BeanDefinitionRegistry | getRegistry() Return the BeanDefinitionRegistry that this scanner operates on.
void | register(Class<?>... annotatedClasses)
void | registerBean(Class<?> annotatedClass)
void | registerBean(Class<?> annotatedClass, Class<? extends Annotation>... qualifiers)
void | registerBean(Class<?> annotatedClass, String name, Class<? extends Annotation>... qualifiers)
void | setBeanNameGenerator(BeanNameGenerator beanNameGenerator) Set the BeanNameGenerator to use for detected bean classes.
void | setScopeMetadataResolver(ScopeMetadataResolver scopeMetadataResolver) Set the ScopeMetadataResolver to use for detected bean classes.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AnnotatedBeanDefinitionReader

public AnnotatedBeanDefinitionReader(BeanDefinitionRegistry registry)
Create a new AnnotatedBeanDefinitionReader for the given bean factory.

Parameters:
registry - the BeanFactory to load bean definitions into, in the form of a BeanDefinitionRegistry
Method Detail

getRegistry

public final BeanDefinitionRegistry getRegistry()
Return the BeanDefinitionRegistry that this scanner operates on.

setBeanNameGenerator

public void setBeanNameGenerator(BeanNameGenerator beanNameGenerator)
Set the BeanNameGenerator to use for detected bean classes.

Default is a AnnotationBeanNameGenerator.

setScopeMetadataResolver

public void setScopeMetadataResolver(ScopeMetadataResolver scopeMetadataResolver)
Set the ScopeMetadataResolver to use for detected bean classes.

The default is an AnnotationScopeMetadataResolver.

register

public void register(Class<?>... annotatedClasses)

registerBean

public void registerBean(Class<?> annotatedClass)

registerBean

public void registerBean(Class<?> annotatedClass,
                         Class<? extends Annotation>... qualifiers)

registerBean

public void registerBean(Class<?> annotatedClass,
                         String name,
                         Class<? extends Annotation>... qualifiers)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AnnotationBeanNameGenerator

org.springframework.context.annotation
Class AnnotationBeanNameGenerator

java.lang.Object
    extended by  org.springframework.context.annotation.AnnotationBeanNameGenerator
All Implemented Interfaces:
BeanNameGenerator
public class AnnotationBeanNameGenerator
extends Object
implements BeanNameGenerator

BeanNameGenerator implementation for bean classes annotated with the @Component annotation or with another annotation that is itself annotated with @Component as a meta-annotation. For example, Spring's stereotype annotations (such as @Repository) are themselves annotated with @Component.

Also supports Java EE 6's ManagedBean and JSR-330's Named annotations, if available. Note that Spring component annotations always override such standard annotations.

If the annotation's value doesn't indicate a bean name, an appropriate name will be built based on the short name of the class (with the first letter lower-cased). For example:

com.xyz.FooServiceImpl -> fooServiceImpl

Since:
2.5
Author:
Juergen Hoeller, Mark Fisher
See Also:
Component.value(),
Repository.value(),
Service.value(),
Controller.value(),
Named.value()

Constructor Summary
AnnotationBeanNameGenerator()
Method Summary
protected  String buildDefaultBeanName(BeanDefinition definition)
Derive a default bean name from the given bean definition.
protected  String determineBeanNameFromAnnotation(AnnotatedBeanDefinition annotatedDef)
Derive a bean name from one of the annotations on the class.
 String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry)
Generate a bean name for the given bean definition.
protected  boolean isStereotypeWithNameValue(String annotationType, Set<String> metaAnnotationTypes, Map<String,Object> attributes)
Check whether the given annotation is a stereotype that is allowed to suggest a component name through its annotation value().
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AnnotationBeanNameGenerator

public AnnotationBeanNameGenerator()
Method Detail

generateBeanName

public String generateBeanName(BeanDefinition definition,
                               BeanDefinitionRegistry registry)
Description copied from interface: BeanNameGenerator
Generate a bean name for the given bean definition.

Specified by:
generateBeanName in interface BeanNameGenerator
Parameters:
definition - the bean definition to generate a name for
registry - the bean definition registry that the given definition is supposed to be registered with
Returns:
the generated bean name

determineBeanNameFromAnnotation

protected String determineBeanNameFromAnnotation(AnnotatedBeanDefinition annotatedDef)
Derive a bean name from one of the annotations on the class.

Parameters:
annotatedDef - the annotation-aware bean definition
Returns:
the bean name, or null if none is found

isStereotypeWithNameValue

protected boolean isStereotypeWithNameValue(String annotationType,
                                            Set<String> metaAnnotationTypes,
                                            Map<String,Object> attributes)
Check whether the given annotation is a stereotype that is allowed to suggest a component name through its annotation value().

Parameters:
annotationType - the name of the annotation class to check
metaAnnotationTypes - the names of meta-annotations on the given annotation
attributes - the map of attributes for the given annotation
Returns:
whether the annotation qualifies as a stereotype with component name

buildDefaultBeanName

protected String buildDefaultBeanName(BeanDefinition definition)
Derive a default bean name from the given bean definition.

The default implementation simply builds a decapitalized version of the short class name: e.g. "mypackage.MyJdbcDao" -> "myJdbcDao".

Note that inner classes will thus have names of the form "outerClassName.innerClassName", which because of the period in the name may be an issue if you are autowiring by name.

Parameters:
definition - the bean definition to build a bean name for
Returns:
the default bean name (never null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AnnotationConfigApplicationContext

org.springframework.context.annotation
Class AnnotationConfigApplicationContext

java.lang.Object
    extended by  org.springframework.core.io.DefaultResourceLoader
        extended by  org.springframework.context.support.AbstractApplicationContext
            extended by  org.springframework.context.support.GenericApplicationContext
                extended by  org.springframework.context.annotation.AnnotationConfigApplicationContext
All Implemented Interfaces:
BeanFactory, DisposableBean, HierarchicalBeanFactory, ListableBeanFactory, BeanDefinitionRegistry, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, AliasRegistry, ResourceLoader, ResourcePatternResolver
public class AnnotationConfigApplicationContext
extends GenericApplicationContext

Standalone application context, accepting annotated classes as input - in particular @Configuration-annotated classes, but also plain @Components and JSR-330 compliant classes using javax.inject annotations. Allows for registering classes one by one (register(java.lang.Class...)) as well as for classpath scanning (scan(java.lang.String...)).

In case of multiple Configuration classes, Bean methods defined in later classes will override those defined in earlier classes. This can be leveraged to deliberately override certain bean definitions via an extra Configuration class.

Since:
3.0
Author:
Chris Beams, Juergen Hoeller
See Also:
register(java.lang.Class...), scan(java.lang.String...), AnnotatedBeanDefinitionReader, ClassPathBeanDefinitionScanner, GenericXmlApplicationContext

Field Summary
Fields inherited from class org.springframework.context.support.AbstractApplicationContext
APPLICATION_EVENT_MULTICASTER_BEAN_NAME, LIFECYCLE_PROCESSOR_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAME
Fields inherited from interface org.springframework.context.ConfigurableApplicationContext
CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAME
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Constructor Summary
AnnotationConfigApplicationContext()
Create a new AnnotationConfigApplicationContext that needs to be populated through #add calls and then manually refreshed.
AnnotationConfigApplicationContext(Class<?>... annotatedClasses)
Create a new AnnotationConfigApplicationContext, deriving bean definitions from the given annotated classes and automatically refreshing the context.
AnnotationConfigApplicationContext(String... basePackages)
Create a new AnnotationConfigApplicationContext, scanning for bean definitions in the given packages and automatically refreshing the context.
Method Summary
void | register(Class<?>... annotatedClasses) Register an annotated class to be processed.
void | scan(String... basePackages) Perform a scan within the specified base packages.
void | setBeanNameGenerator(BeanNameGenerator beanNameGenerator) Set the BeanNameGenerator to use for detected bean classes.
void | setScopeMetadataResolver(ScopeMetadataResolver scopeMetadataResolver) Set the ScopeMetadataResolver to use for detected bean classes.
Methods inherited from class org.springframework.context.support.GenericApplicationContext
closeBeanFactory, getBeanDefinition, getBeanFactory, getDefaultListableBeanFactory, getResource, getResources, isAlias, isBeanNameInUse, refreshBeanFactory, registerAlias, registerBeanDefinition, removeAlias, removeBeanDefinition, setAllowBeanDefinitionOverriding, setAllowCircularReferences, setId, setParent, setResourceLoader
Methods inherited from class org.springframework.context.support.AbstractApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, addListener, cancelRefresh, close, containsBean, containsBeanDefinition, containsLocalBean, destroy, destroyBeans, doClose, findAnnotationOnBean, finishBeanFactoryInitialization, finishRefresh, getAliases, getApplicationListeners, getAutowireCapableBeanFactory, getBean, getBean, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getDisplayName, getId, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getResourcePatternResolver, getStartupDate, getType, initApplicationEventMulticaster, initLifecycleProcessor, initMessageSource, invokeBeanFactoryPostProcessors, isActive, isPrototype, isRunning, isSingleton, isTypeMatch, obtainFreshBeanFactory, onClose, onRefresh, postProcessBeanFactory, prepareBeanFactory, prepareRefresh, publishEvent, refresh, registerBeanPostProcessors, registerListeners, registerShutdownHook, setDisplayName, start, stop, toString
Methods inherited from class org.springframework.core.io.DefaultResourceLoader
getClassLoader, getResourceByPath, setClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.support.BeanDefinitionRegistry
containsBeanDefinition, getBeanDefinitionCount, getBeanDefinitionNames
Methods inherited from interface org.springframework.core.AliasRegistry
getAliases
Methods inherited from interface org.springframework.core.io.ResourceLoader
getClassLoader

Constructor Detail

AnnotationConfigApplicationContext

public AnnotationConfigApplicationContext()
Create a new AnnotationConfigApplicationContext that needs to be populated through #add calls and then manually refreshed.

AnnotationConfigApplicationContext

public AnnotationConfigApplicationContext(Class<?>... annotatedClasses)
Create a new AnnotationConfigApplicationContext, deriving bean definitions from the given annotated classes and automatically refreshing the context.

Parameters:
annotatedClasses - one or more annotated classes, e.g. @Configuration classes

AnnotationConfigApplicationContext

public AnnotationConfigApplicationContext(String... basePackages)
Create a new AnnotationConfigApplicationContext, scanning for bean definitions in the given packages and automatically refreshing the context.

Parameters:
basePackages - the packages to check for annotated classes
Method Detail

setBeanNameGenerator

public void setBeanNameGenerator(BeanNameGenerator beanNameGenerator)
Set the BeanNameGenerator to use for detected bean classes.

Default is a AnnotationBeanNameGenerator.

setScopeMetadataResolver

public void setScopeMetadataResolver(ScopeMetadataResolver scopeMetadataResolver)
Set the ScopeMetadataResolver to use for detected bean classes.

The default is an AnnotationScopeMetadataResolver.

register

public void register(Class<?>... annotatedClasses)
Register an annotated class to be processed. Allows for programmatically building a AnnotationConfigApplicationContext. Note that AbstractApplicationContext.refresh() must be called in order for the context to fully process the new class.

Calls to register(java.lang.Class...) are idempotent; adding the same annotated class more than once has no additional effect.

Parameters:
annotatedClasses - one or more annotated classes, e.g. @Configuration classes
See Also:
AbstractApplicationContext.refresh()

scan

public void scan(String... basePackages)
Perform a scan within the specified base packages. Note that AbstractApplicationContext.refresh() must be called in order for the context to fully process the new class.

Parameters:
basePackages - the packages to check for annotated classes
See Also:
AbstractApplicationContext.refresh()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AnnotationConfigBeanDefinitionParser

org.springframework.context.annotation
Class AnnotationConfigBeanDefinitionParser

java.lang.Object
    extended by  org.springframework.context.annotation.AnnotationConfigBeanDefinitionParser
All Implemented Interfaces:
BeanDefinitionParser
public class AnnotationConfigBeanDefinitionParser
extends Object
implements BeanDefinitionParser

Parser for the <context:annotation-config/> element.

Since:
2.5
Author:
Mark Fisher, Juergen Hoeller, Christian Dupuis
See Also:
AnnotationConfigUtils

Constructor Summary
AnnotationConfigBeanDefinitionParser()
Method Summary
 BeanDefinition parse(Element element, ParserContext parserContext)
Parse the specified Element and register the resulting BeanDefinition(s) with the ParserContext.getRegistry() BeanDefinitionRegistry} embedded in the supplied ParserContext.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AnnotationConfigBeanDefinitionParser

public AnnotationConfigBeanDefinitionParser()
Method Detail

parse

public BeanDefinition parse(Element element,
                            ParserContext parserContext)
Description copied from interface: BeanDefinitionParser
Parse the specified Element and register the resulting BeanDefinition(s) with the ParserContext.getRegistry() BeanDefinitionRegistry} embedded in the supplied ParserContext.

Implementations must return the primary BeanDefinition that results from the parse if they will ever be used in a nested fashion (for example as an inner tag in a <property/> tag). Implementations may return null if they will not be used in a nested fashion.

Specified by:
parse in interface BeanDefinitionParser
Parameters:
element - the element that is to be parsed into one or more BeanDefinitions
parserContext - the object encapsulating the current state of the parsing process; provides access to a BeanDefinitionRegistry
Returns:
the primary BeanDefinition
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AnnotationConfigUtils

org.springframework.context.annotation
Class AnnotationConfigUtils

java.lang.Object
    extended by  org.springframework.context.annotation.AnnotationConfigUtils

public class AnnotationConfigUtils
extends Object

Utility class that allows for convenient registration of common BeanPostProcessor and BeanFactoryPostProcessor definitions for annotation-based configuration.

Since:
2.5
Author:
Mark Fisher, Juergen Hoeller, Chris Beams
See Also:
CommonAnnotationBeanPostProcessor, org.springframework.context.annotation.support.ConfigurationClassPostProcessor;, AutowiredAnnotationBeanPostProcessor, RequiredAnnotationBeanPostProcessor, PersistenceAnnotationBeanPostProcessor

Field Summary
static String | AUTOWIRED_ANNOTATION_PROCESSOR_BEAN_NAME The bean name of the internally managed Autowired annotation processor.
static String | COMMON_ANNOTATION_PROCESSOR_BEAN_NAME The bean name of the internally managed JSR-250 annotation processor.
static String | CONFIGURATION_ANNOTATION_PROCESSOR_BEAN_NAME The bean name of the internally managed Configuration annotation processor.
static String | PERSISTENCE_ANNOTATION_PROCESSOR_BEAN_NAME The bean name of the internally managed JPA annotation processor.
static String | REQUIRED_ANNOTATION_PROCESSOR_BEAN_NAME The bean name of the internally managed Required annotation processor.
Constructor Summary
AnnotationConfigUtils()
Method Summary
static void | registerAnnotationConfigProcessors(BeanDefinitionRegistry registry) Register all relevant annotation post processors in the given registry.
static Set<BeanDefinitionHolder> | registerAnnotationConfigProcessors(BeanDefinitionRegistry registry, Object source) Register all relevant annotation post processors in the given registry.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

CONFIGURATION_ANNOTATION_PROCESSOR_BEAN_NAME

public static final String CONFIGURATION_ANNOTATION_PROCESSOR_BEAN_NAME
The bean name of the internally managed Configuration annotation processor.

See Also:
Constant Field Values

AUTOWIRED_ANNOTATION_PROCESSOR_BEAN_NAME

public static final String AUTOWIRED_ANNOTATION_PROCESSOR_BEAN_NAME
The bean name of the internally managed Autowired annotation processor.

See Also:
Constant Field Values

REQUIRED_ANNOTATION_PROCESSOR_BEAN_NAME

public static final String REQUIRED_ANNOTATION_PROCESSOR_BEAN_NAME
The bean name of the internally managed Required annotation processor.

See Also:
Constant Field Values

COMMON_ANNOTATION_PROCESSOR_BEAN_NAME

public static final String COMMON_ANNOTATION_PROCESSOR_BEAN_NAME
The bean name of the internally managed JSR-250 annotation processor.

See Also:
Constant Field Values

PERSISTENCE_ANNOTATION_PROCESSOR_BEAN_NAME

public static final String PERSISTENCE_ANNOTATION_PROCESSOR_BEAN_NAME
The bean name of the internally managed JPA annotation processor.

See Also:
Constant Field Values
Constructor Detail

AnnotationConfigUtils

public AnnotationConfigUtils()
Method Detail

registerAnnotationConfigProcessors

public static void registerAnnotationConfigProcessors(BeanDefinitionRegistry registry)
Register all relevant annotation post processors in the given registry.

Parameters:
registry - the registry to operate on

registerAnnotationConfigProcessors

public static Set<BeanDefinitionHolder> registerAnnotationConfigProcessors(BeanDefinitionRegistry registry,
                                                                           Object source)
Register all relevant annotation post processors in the given registry.

Parameters:
registry - the registry to operate on
source - the configuration source element (already extracted) that this registration was triggered from. May be null.
Returns:
a Set of BeanDefinitionHolders, containing all bean definitions that have actually been registered by this call
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AnnotationScopeMetadataResolver

org.springframework.context.annotation
Class AnnotationScopeMetadataResolver

java.lang.Object
    extended by  org.springframework.context.annotation.AnnotationScopeMetadataResolver
All Implemented Interfaces:
ScopeMetadataResolver
public class AnnotationScopeMetadataResolver
extends Object
implements ScopeMetadataResolver

A ScopeMetadataResolver implementation that by default checks for the presence of Spring's Scope annotation on the bean class.

The exact type of annotation that is checked for is configurable via the setScopeAnnotationType(Class) property.

Since:
2.5
Author:
Mark Fisher, Juergen Hoeller
See Also:
Scope

Constructor Summary
AnnotationScopeMetadataResolver()
Create a new instance of the AnnotationScopeMetadataResolver class.
AnnotationScopeMetadataResolver(ScopedProxyMode defaultProxyMode)
Create a new instance of the AnnotationScopeMetadataResolver class.
Method Summary
ScopeMetadata | resolveScopeMetadata(BeanDefinition definition) Resolve the ScopeMetadata appropriate to the supplied bean definition.
void | setScopeAnnotationType(Class<? extends Annotation> scopeAnnotationType) Set the type of annotation that is checked for by this AnnotationScopeMetadataResolver.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AnnotationScopeMetadataResolver

public AnnotationScopeMetadataResolver()
Create a new instance of the AnnotationScopeMetadataResolver class.

See Also:
AnnotationScopeMetadataResolver(ScopedProxyMode), ScopedProxyMode.NO

AnnotationScopeMetadataResolver

public AnnotationScopeMetadataResolver(ScopedProxyMode defaultProxyMode)
Create a new instance of the AnnotationScopeMetadataResolver class.

Parameters:
defaultProxyMode - the desired scoped-proxy mode
Method Detail

setScopeAnnotationType

public void setScopeAnnotationType(Class<? extends Annotation> scopeAnnotationType)
Set the type of annotation that is checked for by this AnnotationScopeMetadataResolver.

Parameters:
scopeAnnotationType - the target annotation type

resolveScopeMetadata

public ScopeMetadata resolveScopeMetadata(BeanDefinition definition)
Description copied from interface: ScopeMetadataResolver
Resolve the ScopeMetadata appropriate to the supplied bean definition.

Implementations can of course use any strategy they like to determine the scope metadata, but some implementations that spring immediately to mind might be to use source level annotations present on the class of the supplied definition, or to use metadata present in the AttributeAccessor.attributeNames() of the supplied definition.

Specified by:
resolveScopeMetadata in interface ScopeMetadataResolver
Parameters:
definition - the target bean definition
Returns:
the relevant scope metadata; never null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ClassPathBeanDefinitionScanner

org.springframework.context.annotation
Class ClassPathBeanDefinitionScanner

java.lang.Object
    extended by  org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider
        extended by  org.springframework.context.annotation.ClassPathBeanDefinitionScanner
All Implemented Interfaces:
ResourceLoaderAware
public class ClassPathBeanDefinitionScanner
extends ClassPathScanningCandidateComponentProvider

A bean definition scanner that detects bean candidates on the classpath, registering corresponding bean definitions with a given registry (BeanFactory or ApplicationContext).

Candidate classes are detected through configurable type filters. The default filters include classes that are annotated with Spring's @Component, @Repository, @Service, or @Controller stereotype.

Also supports Java EE 6's ManagedBean and JSR-330's Named annotations, if available.

Since:
2.5
Author:
Mark Fisher, Juergen Hoeller
See Also:
AnnotationConfigApplicationContext.scan(java.lang.String...), Component, Repository, Service, Controller

Field Summary
Fields inherited from class org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider
logger
Constructor Summary
ClassPathBeanDefinitionScanner(BeanDefinitionRegistry registry)
Create a new ClassPathBeanDefinitionScanner for the given bean factory.
ClassPathBeanDefinitionScanner(BeanDefinitionRegistry registry, boolean useDefaultFilters)
Create a new ClassPathBeanDefinitionScanner for the given bean factory.
Method Summary
protected boolean | checkCandidate(String beanName, BeanDefinition beanDefinition) Check the given candidate's bean name, determining whether the corresponding bean definition needs to be registered or conflicts with an existing definition.
protected Set<BeanDefinitionHolder> | doScan(String... basePackages) Perform a scan within the specified base packages, returning the registered bean definitions.
BeanDefinitionRegistry | getRegistry() Return the BeanDefinitionRegistry that this scanner operates on.
protected boolean | isCompatible(BeanDefinition newDefinition, BeanDefinition existingDefinition) Determine whether the given new bean definition is compatible with the given existing bean definition.
protected void | postProcessBeanDefinition(AbstractBeanDefinition beanDefinition, String beanName) Apply further settings to the given bean definition, beyond the contents retrieved from scanning the component class.
protected void | registerBeanDefinition(BeanDefinitionHolder definitionHolder, BeanDefinitionRegistry registry) Register the specified bean with the given registry.
int | scan(String... basePackages) Perform a scan within the specified base packages.
void | setAutowireCandidatePatterns(String[] autowireCandidatePatterns) Set the name-matching patterns for determining autowire candidates.
void | setBeanDefinitionDefaults(BeanDefinitionDefaults beanDefinitionDefaults) Set the defaults to use for detected beans.
void | setBeanNameGenerator(BeanNameGenerator beanNameGenerator) Set the BeanNameGenerator to use for detected bean classes.
void | setIncludeAnnotationConfig(boolean includeAnnotationConfig) Specify whether to register annotation config post-processors.
void | setScopedProxyMode(ScopedProxyMode scopedProxyMode) Specify the proxy behavior for non-singleton scoped beans.
void | setScopeMetadataResolver(ScopeMetadataResolver scopeMetadataResolver) Set the ScopeMetadataResolver to use for detected bean classes.
Methods inherited from class org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider
addExcludeFilter, addIncludeFilter, findCandidateComponents, getResourceLoader, isCandidateComponent, isCandidateComponent, registerDefaultFilters, resetFilters, resolveBasePackage, setResourceLoader, setResourcePattern
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ClassPathBeanDefinitionScanner

public ClassPathBeanDefinitionScanner(BeanDefinitionRegistry registry)
Create a new ClassPathBeanDefinitionScanner for the given bean factory.

Parameters:
registry - the BeanFactory to load bean definitions into, in the form of a BeanDefinitionRegistry

ClassPathBeanDefinitionScanner

public ClassPathBeanDefinitionScanner(BeanDefinitionRegistry registry,
                                      boolean useDefaultFilters)
Create a new ClassPathBeanDefinitionScanner for the given bean factory.

If the passed-in bean factory does not only implement the BeanDefinitionRegistry interface but also the ResourceLoader interface, it will be used as default ResourceLoader as well. This will usually be the case for ApplicationContext implementations.

If given a plain BeanDefinitionRegistry, the default ResourceLoader will be a PathMatchingResourcePatternResolver.

Parameters:
registry - the BeanFactory to load bean definitions into, in the form of a BeanDefinitionRegistry
useDefaultFilters - whether to include the default filters for the @Component, @Repository, @Service, and @Controller stereotype annotations.
See Also:
ClassPathScanningCandidateComponentProvider.setResourceLoader(org.springframework.core.io.ResourceLoader)
Method Detail

getRegistry

public final BeanDefinitionRegistry getRegistry()
Return the BeanDefinitionRegistry that this scanner operates on.

setBeanDefinitionDefaults

public void setBeanDefinitionDefaults(BeanDefinitionDefaults beanDefinitionDefaults)
Set the defaults to use for detected beans.

See Also:
BeanDefinitionDefaults

setAutowireCandidatePatterns

public void setAutowireCandidatePatterns(String[] autowireCandidatePatterns)
Set the name-matching patterns for determining autowire candidates.

Parameters:
autowireCandidatePatterns - the patterns to match against

setBeanNameGenerator

public void setBeanNameGenerator(BeanNameGenerator beanNameGenerator)
Set the BeanNameGenerator to use for detected bean classes.

Default is a AnnotationBeanNameGenerator.

setScopeMetadataResolver

public void setScopeMetadataResolver(ScopeMetadataResolver scopeMetadataResolver)
Set the ScopeMetadataResolver to use for detected bean classes. Note that this will override any custom "scopedProxyMode" setting.

The default is an AnnotationScopeMetadataResolver.

See Also:
setScopedProxyMode(org.springframework.context.annotation.ScopedProxyMode)

setScopedProxyMode

public void setScopedProxyMode(ScopedProxyMode scopedProxyMode)
Specify the proxy behavior for non-singleton scoped beans. Note that this will override any custom "scopeMetadataResolver" setting.

The default is ScopedProxyMode.NO.

See Also:
setScopeMetadataResolver(org.springframework.context.annotation.ScopeMetadataResolver)

setIncludeAnnotationConfig

public void setIncludeAnnotationConfig(boolean includeAnnotationConfig)
Specify whether to register annotation config post-processors.

The default is to register the post-processors. Turn this off to be able to ignore the annotations or to process them differently.

scan

public int scan(String... basePackages)
Perform a scan within the specified base packages.

Parameters:
basePackages - the packages to check for annotated classes
Returns:
number of beans registered

doScan

protected Set<BeanDefinitionHolder> doScan(String... basePackages)
Perform a scan within the specified base packages, returning the registered bean definitions.

This method does not register an annotation config processor but rather leaves this up to the caller.

Parameters:
basePackages - the packages to check for annotated classes
Returns:
number of beans registered

postProcessBeanDefinition

protected void postProcessBeanDefinition(AbstractBeanDefinition beanDefinition,
                                         String beanName)
Apply further settings to the given bean definition, beyond the contents retrieved from scanning the component class.

Parameters:
beanDefinition - the scanned bean definition
beanName - the generated bean name for the given bean

registerBeanDefinition

protected void registerBeanDefinition(BeanDefinitionHolder definitionHolder,
                                      BeanDefinitionRegistry registry)
Register the specified bean with the given registry.

Can be overridden in subclasses, e.g. to adapt the registration process or to register further bean definitions for each scanned bean.

Parameters:
definitionHolder - the bean definition plus bean name for the bean
registry - the BeanDefinitionRegistry to register the bean with

checkCandidate

protected boolean checkCandidate(String beanName,
                                 BeanDefinition beanDefinition)
                          throws IllegalStateException
Check the given candidate's bean name, determining whether the corresponding bean definition needs to be registered or conflicts with an existing definition.

Parameters:
beanName - the suggested name for the bean
beanDefinition - the corresponding bean definition
Returns:
true if the bean can be registered as-is; false if it should be skipped because there is an existing, compatible bean definition for the specified name
Throws:
IllegalStateException - if an existing, incompatible bean definition has been found for the specified name

isCompatible

protected boolean isCompatible(BeanDefinition newDefinition,
                               BeanDefinition existingDefinition)
Determine whether the given new bean definition is compatible with the given existing bean definition.

The default implementation simply considers them as compatible when the bean class name matches.

Parameters:
newDefinition - the new bean definition, originated from scanning
existingDefinition - the existing bean definition, potentially an explicitly defined one or a previously generated one from scanning
Returns:
whether the definitions are considered as compatible, with the new definition to be skipped in favor of the existing definition
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ClassPathScanningCandidateComponentProvider

org.springframework.context.annotation
Class ClassPathScanningCandidateComponentProvider

java.lang.Object
    extended by  org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider
All Implemented Interfaces:
ResourceLoaderAware
Direct Known Subclasses:
ClassPathBeanDefinitionScanner
public class ClassPathScanningCandidateComponentProvider
extends Object
implements ResourceLoaderAware

A component provider that scans the classpath from a base package. It then applies exclude and include filters to the resulting classes to find candidates.

This implementation is based on Spring's MetadataReader facility, backed by an ASM ClassReader.

Since:
2.5
Author:
Mark Fisher, Juergen Hoeller, Ramnivas Laddad
See Also:
MetadataReaderFactory, AnnotationMetadata, ScannedGenericBeanDefinition

Field Summary
protected  Log logger
Constructor Summary
ClassPathScanningCandidateComponentProvider(boolean useDefaultFilters)
Create a ClassPathScanningCandidateComponentProvider.
Method Summary
void | addExcludeFilter(TypeFilter excludeFilter) Add an exclude type filter to the front of the exclusion list.
void | addIncludeFilter(TypeFilter includeFilter) Add an include type filter to the end of the inclusion list.
Set<BeanDefinition> | findCandidateComponents(String basePackage) Scan the class path for candidate components.
ResourceLoader | getResourceLoader() Return the ResourceLoader that this component provider uses.
protected boolean | isCandidateComponent(AnnotatedBeanDefinition beanDefinition) Determine whether the given bean definition qualifies as candidate.
protected boolean | isCandidateComponent(MetadataReader metadataReader) Determine whether the given class does not match any exclude filter and does match at least one include filter.
protected void | registerDefaultFilters() Register the default filter for @Component.
void | resetFilters(boolean useDefaultFilters) Reset the configured type filters.
protected String | resolveBasePackage(String basePackage) Resolve the specified base package into a pattern specification for the package search path.
void | setResourceLoader(ResourceLoader resourceLoader) Set the ResourceLoader to use for resource locations.
void | setResourcePattern(String resourcePattern) Set the resource pattern to use when scanning the classpath.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Constructor Detail

ClassPathScanningCandidateComponentProvider

public ClassPathScanningCandidateComponentProvider(boolean useDefaultFilters)
Create a ClassPathScanningCandidateComponentProvider.

Parameters:
useDefaultFilters - whether to register the default filters for the @Component, @Repository, @Service, and @Controller stereotype annotations
See Also:
registerDefaultFilters()
Method Detail

setResourceLoader

public void setResourceLoader(ResourceLoader resourceLoader)
Set the ResourceLoader to use for resource locations. This will typically be a ResourcePatternResolver implementation.

Default is PathMatchingResourcePatternResolver, also capable of resource pattern resolving through the ResourcePatternResolver interface.

Specified by:
setResourceLoader in interface ResourceLoaderAware
Parameters:
resourceLoader - ResourceLoader object to be used by this object
See Also:
ResourcePatternResolver, PathMatchingResourcePatternResolver

getResourceLoader

public final ResourceLoader getResourceLoader()
Return the ResourceLoader that this component provider uses.

setResourcePattern

public void setResourcePattern(String resourcePattern)
Set the resource pattern to use when scanning the classpath. This value will be appended to each base package name.

See Also:
findCandidateComponents(String), DEFAULT_RESOURCE_PATTERN

addIncludeFilter

public void addIncludeFilter(TypeFilter includeFilter)
Add an include type filter to the end of the inclusion list.

addExcludeFilter

public void addExcludeFilter(TypeFilter excludeFilter)
Add an exclude type filter to the front of the exclusion list.

resetFilters

public void resetFilters(boolean useDefaultFilters)
Reset the configured type filters.

Parameters:
useDefaultFilters - whether to re-register the default filters for the @Component, @Repository, @Service, and @Controller stereotype annotations
See Also:
registerDefaultFilters()

registerDefaultFilters

protected void registerDefaultFilters()
Register the default filter for @Component.

This will implicitly register all annotations that have the @Component meta-annotation including the @Repository, @Service, and @Controller stereotype annotations.

Also supports Java EE 6's ManagedBean and JSR-330's Named annotations, if available.

findCandidateComponents

public Set<BeanDefinition> findCandidateComponents(String basePackage)
Scan the class path for candidate components.

Parameters:
basePackage - the package to check for annotated classes
Returns:
a corresponding Set of autodetected bean definitions

resolveBasePackage

protected String resolveBasePackage(String basePackage)
Resolve the specified base package into a pattern specification for the package search path.

The default implementation resolves placeholders against system properties, and converts a "."-based package path to a "/"-based resource path.

Parameters:
basePackage - the base package as specified by the user
Returns:
the pattern specification to be used for package searching

isCandidateComponent

protected boolean isCandidateComponent(MetadataReader metadataReader)
                                throws IOException
Determine whether the given class does not match any exclude filter and does match at least one include filter.

Parameters:
metadataReader - the ASM ClassReader for the class
Returns:
whether the class qualifies as a candidate component
Throws:
IOException

isCandidateComponent

protected boolean isCandidateComponent(AnnotatedBeanDefinition beanDefinition)
Determine whether the given bean definition qualifies as candidate.

The default implementation checks whether the class is concrete (i.e. not abstract and not an interface). Can be overridden in subclasses.

Parameters:
beanDefinition - the bean definition to check
Returns:
whether the bean definition qualifies as a candidate component
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CommonAnnotationBeanPostProcessor

org.springframework.context.annotation
Class CommonAnnotationBeanPostProcessor

java.lang.Object
    extended by  org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor
        extended by  org.springframework.context.annotation.CommonAnnotationBeanPostProcessor
All Implemented Interfaces:
Serializable, BeanFactoryAware, BeanPostProcessor, DestructionAwareBeanPostProcessor, InstantiationAwareBeanPostProcessor, MergedBeanDefinitionPostProcessor, Ordered, PriorityOrdered
public class CommonAnnotationBeanPostProcessor
extends InitDestroyAnnotationBeanPostProcessor
implements InstantiationAwareBeanPostProcessor, BeanFactoryAware, Serializable

BeanPostProcessor implementation that supports common Java annotations out of the box, in particular the JSR-250 annotations in the javax.annotation package. These common Java annotations are supported in many Java EE 5 technologies (e.g. JSF 1.2), as well as in Java 6's JAX-WS.

This post-processor includes support for the PostConstruct and PreDestroy annotations - as init annotation and destroy annotation, respectively - through inheriting from InitDestroyAnnotationBeanPostProcessor with pre-configured annotation types.

The central element is the Resource annotation for annotation-driven injection of named beans, by default from the containing Spring BeanFactory, with only mappedName references resolved in JNDI. The "alwaysUseJndiLookup" flag enforces JNDI lookups equivalent to standard Java EE 5 resource injection for name references and default names as well. The target beans can be simple POJOs, with no special requirements other than the type having to match.

The JAX-WS WebServiceRef annotation is supported too, analogous to Resource but with the capability of creating specific JAX-WS service endpoints. This may either point to an explicitly defined resource by name or operate on a locally specified JAX-WS service class. Finally, this post-processor also supports the EJB 3 EJB annotation, analogous to Resource as well, with the capability to specify both a local bean name and a global JNDI name for fallback retrieval. The target beans can be plain POJOs as well as EJB 3 Session Beans in this case.

The common annotations supported by this post-processor are available in Java 6 (JDK 1.6) as well as in Java EE 5 (which provides a standalone jar for its common annotations as well, allowing for use in any Java 5 based application). Hence, this post-processor works out of the box on JDK 1.6, and requires the JSR-250 API jar (and optionally the JAX-WS API jar and/or the EJB 3 API jar) to be added to the classpath on JDK 1.5 (when running outside of Java EE 5).

For default usage, resolving resource names as Spring bean names, simply define the following in your application context:

 <bean class="org.springframework.context.annotation.CommonAnnotationBeanPostProcessor"/>
For direct JNDI access, resolving resource names as JNDI resource references within the Java EE application's "java:comp/env/" namespace, use the following:
 <bean class="org.springframework.context.annotation.CommonAnnotationBeanPostProcessor">
   <property name="alwaysUseJndiLookup" value="true"/>
 </bean>
mappedName references will always be resolved in JNDI, allowing for global JNDI names (including "java:" prefix) as well. The "alwaysUseJndiLookup" flag just affects name references and default names (inferred from the field name / property name).

NOTE: A default CommonAnnotationBeanPostProcessor will be registered by the "context:annotation-config" and "context:component-scan" XML tags. Remove or turn off the default annotation configuration there if you intend to specify a custom CommonAnnotationBeanPostProcessor bean definition!

NOTE: Annotation injection will be performed before XML injection; thus the latter configuration will override the former for properties wired through both approaches.

Since:
2.5
Author:
Juergen Hoeller
See Also:
setAlwaysUseJndiLookup(boolean), setResourceFactory(org.springframework.beans.factory.BeanFactory), InitDestroyAnnotationBeanPostProcessor, AutowiredAnnotationBeanPostProcessor, Serialized Form

Nested Class Summary
protected  class CommonAnnotationBeanPostProcessor.LookupElement
Class representing generic injection information about an annotated field or setter method, supporting @Resource and related annotations.
Field Summary
Fields inherited from class org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
CommonAnnotationBeanPostProcessor()
Create a new CommonAnnotationBeanPostProcessor, with the init and destroy annotation types set to PostConstruct and PreDestroy, respectively.
Method Summary
protected Object | autowireResource(BeanFactory factory, CommonAnnotationBeanPostProcessor.LookupElement element, String requestingBeanName) Obtain a resource object for the given name and type through autowiring based on the given factory.
protected Object | getResource(CommonAnnotationBeanPostProcessor.LookupElement element, String requestingBeanName) Obtain the resource object for the given name and type.
void | ignoreResourceType(String resourceType) Ignore the given resource type when resolving @Resource annotations.
boolean | postProcessAfterInstantiation(Object bean, String beanName) Perform operations after the bean has been instantiated, via a constructor or factory method, but before Spring property population (from explicit properties or autowiring) occurs.
Object | postProcessBeforeInstantiation(Class beanClass, String beanName) Apply this BeanPostProcessor before the target bean gets instantiated.
void | postProcessMergedBeanDefinition(RootBeanDefinition beanDefinition, Class beanType, String beanName) Post-process the given merged bean definition for the specified bean.
PropertyValues | postProcessPropertyValues(PropertyValues pvs, PropertyDescriptor[] pds, Object bean, String beanName) Post-process the given property values before the factory applies them to the given bean.
void | setAlwaysUseJndiLookup(boolean alwaysUseJndiLookup) Set whether to always use JNDI lookups equivalent to standard Java EE 5 resource injection, even for name attributes and default names.
void | setBeanFactory(BeanFactory beanFactory) Callback that supplies the owning factory to a bean instance.
void | setFallbackToDefaultTypeMatch(boolean fallbackToDefaultTypeMatch) Set whether to allow a fallback to a type match if no explicit name has been specified.
void | setJndiFactory(BeanFactory jndiFactory) Specify the factory for objects to be injected into @Resource / @WebServiceRef / @EJB annotated fields and setter methods, for mappedName attributes that point directly into JNDI.
void | setResourceFactory(BeanFactory resourceFactory) Specify the factory for objects to be injected into @Resource / @WebServiceRef / @EJB annotated fields and setter methods, for name attributes and default names.
Methods inherited from class org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor
getOrder, postProcessAfterInitialization, postProcessBeforeDestruction, postProcessBeforeInitialization, setDestroyAnnotationType, setInitAnnotationType, setOrder
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.config.BeanPostProcessor
postProcessAfterInitialization, postProcessBeforeInitialization

Constructor Detail

CommonAnnotationBeanPostProcessor

public CommonAnnotationBeanPostProcessor()
Create a new CommonAnnotationBeanPostProcessor, with the init and destroy annotation types set to PostConstruct and PreDestroy, respectively.

Method Detail

ignoreResourceType

public void ignoreResourceType(String resourceType)
Ignore the given resource type when resolving @Resource annotations.

By default, the javax.xml.ws.WebServiceContext interface will be ignored, since it will be resolved by the JAX-WS runtime.

Parameters:
resourceType - the resource type to ignore

setFallbackToDefaultTypeMatch

public void setFallbackToDefaultTypeMatch(boolean fallbackToDefaultTypeMatch)
Set whether to allow a fallback to a type match if no explicit name has been specified. The default name (i.e. the field name or bean property name) will still be checked first; if a bean of that name exists, it will be taken. However, if no bean of that name exists, a by-type resolution of the dependency will be attempted if this flag is "true".

Default is "true". Switch this flag to "false" in order to enforce a by-name lookup in all cases, throwing an exception in case of no name match.

See Also:
AutowireCapableBeanFactory.resolveDependency(org.springframework.beans.factory.config.DependencyDescriptor, java.lang.String)

setAlwaysUseJndiLookup

public void setAlwaysUseJndiLookup(boolean alwaysUseJndiLookup)
Set whether to always use JNDI lookups equivalent to standard Java EE 5 resource injection, even for name attributes and default names.

Default is "false": Resource names are used for Spring bean lookups in the containing BeanFactory; only mappedName attributes point directly into JNDI. Switch this flag to "true" for enforcing Java EE style JNDI lookups in any case, even for name attributes and default names.

See Also:
setJndiFactory(org.springframework.beans.factory.BeanFactory), setResourceFactory(org.springframework.beans.factory.BeanFactory)

setJndiFactory

public void setJndiFactory(BeanFactory jndiFactory)
Specify the factory for objects to be injected into @Resource / @WebServiceRef / @EJB annotated fields and setter methods, for mappedName attributes that point directly into JNDI. This factory will also be used if "alwaysUseJndiLookup" is set to "true" in order to enforce JNDI lookups even for name attributes and default names.

The default is a SimpleJndiBeanFactory for JNDI lookup behavior equivalent to standard Java EE 5 resource injection.

See Also:
setResourceFactory(org.springframework.beans.factory.BeanFactory), setAlwaysUseJndiLookup(boolean)

setResourceFactory

public void setResourceFactory(BeanFactory resourceFactory)
Specify the factory for objects to be injected into @Resource / @WebServiceRef / @EJB annotated fields and setter methods, for name attributes and default names.

The default is the BeanFactory that this post-processor is defined in, if any, looking up resource names as Spring bean names. Specify the resource factory explicitly for programmatic usage of this post-processor.

Specifying Spring's SimpleJndiBeanFactory leads to JNDI lookup behavior equivalent to standard Java EE 5 resource injection, even for name attributes and default names. This is the same behavior that the "alwaysUseJndiLookup" flag enables.

See Also:
setAlwaysUseJndiLookup(boolean)

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
                    throws BeansException
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
Throws:
BeansException - in case of initialization errors
See Also:
BeanInitializationException

postProcessMergedBeanDefinition

public void postProcessMergedBeanDefinition(RootBeanDefinition beanDefinition,
                                            Class beanType,
                                            String beanName)
Description copied from interface: MergedBeanDefinitionPostProcessor
Post-process the given merged bean definition for the specified bean.

Specified by:
postProcessMergedBeanDefinition in interface MergedBeanDefinitionPostProcessor
Overrides:
postProcessMergedBeanDefinition in class InitDestroyAnnotationBeanPostProcessor
Parameters:
beanDefinition - the merged bean definition for the bean
beanType - the actual type of the managed bean instance
beanName - the name of the bean

postProcessBeforeInstantiation

public Object postProcessBeforeInstantiation(Class beanClass,
                                             String beanName)
                                      throws BeansException
Description copied from interface: InstantiationAwareBeanPostProcessor
Apply this BeanPostProcessor before the target bean gets instantiated. The returned bean object may be a proxy to use instead of the target bean, effectively suppressing default instantiation of the target bean.

If a non-null object is returned by this method, the bean creation process will be short-circuited. The only further processing applied is the BeanPostProcessor.postProcessAfterInitialization(java.lang.Object, java.lang.String) callback from the configured BeanPostProcessors.

This callback will only be applied to bean definitions with a bean class. In particular, it will not be applied to beans with a "factory-method".

Post-processors may implement the extended SmartInstantiationAwareBeanPostProcessor interface in order to predict the type of the bean object that they are going to return here.

Specified by:
postProcessBeforeInstantiation in interface InstantiationAwareBeanPostProcessor
Parameters:
beanClass - the class of the bean to be instantiated
beanName - the name of the bean
Returns:
the bean object to expose instead of a default instance of the target bean, or null to proceed with default instantiation
Throws:
BeansException - in case of errors
See Also:
AbstractBeanDefinition.hasBeanClass(), AbstractBeanDefinition.getFactoryMethodName()

postProcessAfterInstantiation

public boolean postProcessAfterInstantiation(Object bean,
                                             String beanName)
                                      throws BeansException
Description copied from interface: InstantiationAwareBeanPostProcessor
Perform operations after the bean has been instantiated, via a constructor or factory method, but before Spring property population (from explicit properties or autowiring) occurs.

This is the ideal callback for performing field injection on the given bean instance. See Spring's own AutowiredAnnotationBeanPostProcessor for a typical example.

Specified by:
postProcessAfterInstantiation in interface InstantiationAwareBeanPostProcessor
Parameters:
bean - the bean instance created, with properties not having been set yet
beanName - the name of the bean
Returns:
true if properties should be set on the bean; false if property population should be skipped. Normal implementations should return true. Returning false will also prevent any subsequent InstantiationAwareBeanPostProcessor instances being invoked on this bean instance.
Throws:
BeansException - in case of errors

postProcessPropertyValues

public PropertyValues postProcessPropertyValues(PropertyValues pvs,
                                                PropertyDescriptor[] pds,
                                                Object bean,
                                                String beanName)
                                         throws BeansException
Description copied from interface: InstantiationAwareBeanPostProcessor
Post-process the given property values before the factory applies them to the given bean. Allows for checking whether all dependencies have been satisfied, for example based on a "Required" annotation on bean property setters.

Also allows for replacing the property values to apply, typically through creating a new MutablePropertyValues instance based on the original PropertyValues, adding or removing specific values.

Specified by:
postProcessPropertyValues in interface InstantiationAwareBeanPostProcessor
Parameters:
pvs - the property values that the factory is about to apply (never null)
pds - the relevant property descriptors for the target bean (with ignored dependency types - which the factory handles specifically - already filtered out)
bean - the bean instance created, but whose properties have not yet been set
beanName - the name of the bean
Returns:
the actual property values to apply to to the given bean (can be the passed-in PropertyValues instance), or null to skip property population
Throws:
BeansException - in case of errors
See Also:
MutablePropertyValues

getResource

protected Object getResource(CommonAnnotationBeanPostProcessor.LookupElement element,
                             String requestingBeanName)
                      throws BeansException
Obtain the resource object for the given name and type.

Parameters:
element - the descriptor for the annotated field/method
requestingBeanName - the name of the requesting bean
Returns:
the resource object (never null)
Throws:
BeansException - if we failed to obtain the target resource

autowireResource

protected Object autowireResource(BeanFactory factory,
                                  CommonAnnotationBeanPostProcessor.LookupElement element,
                                  String requestingBeanName)
                           throws BeansException
Obtain a resource object for the given name and type through autowiring based on the given factory.

Parameters:
factory - the factory to autowire against
element - the descriptor for the annotated field/method
requestingBeanName - the name of the requesting bean
Returns:
the resource object (never null)
Throws:
BeansException - if we failed to obtain the target resource
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CommonAnnotationBeanPostProcessor.LookupElement

org.springframework.context.annotation
Class CommonAnnotationBeanPostProcessor.LookupElement

java.lang.Object
    extended by  org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement
        extended by  org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.LookupElement
Enclosing class:
CommonAnnotationBeanPostProcessor
protected abstract class CommonAnnotationBeanPostProcessor.LookupElement
extends InjectionMetadata.InjectedElement

Class representing generic injection information about an annotated field or setter method, supporting @Resource and related annotations.

Field Summary
protected boolean | isDefaultName
protected Class<?> | lookupType
protected String | mappedName
protected String | name
Fields inherited from class org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement
isField, member, pd, skip
Constructor Summary
CommonAnnotationBeanPostProcessor.LookupElement(Member member, PropertyDescriptor pd)
Method Summary
DependencyDescriptor | getDependencyDescriptor() Build a DependencyDescriptor for the underlying field/method.
Class<?> | getLookupType() Return the desired type for the lookup.
String | getName() Return the resource name for the lookup.
protected abstract void | initAnnotation(AnnotatedElement ae)
Methods inherited from class org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement
checkPropertySkipping, checkResourceType, equals, getMember, getResourceToInject, getResourceType, hashCode, inject, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail

name

protected String name

isDefaultName

protected boolean isDefaultName

lookupType

protected Class<?> lookupType

mappedName

protected String mappedName
Constructor Detail

CommonAnnotationBeanPostProcessor.LookupElement

public CommonAnnotationBeanPostProcessor.LookupElement(Member member,
                                                       PropertyDescriptor pd)
Method Detail

initAnnotation

protected abstract void initAnnotation(AnnotatedElement ae)

getName

public final String getName()
Return the resource name for the lookup.

getLookupType

public final Class<?> getLookupType()
Return the desired type for the lookup.

getDependencyDescriptor

public final DependencyDescriptor getDependencyDescriptor()
Build a DependencyDescriptor for the underlying field/method.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ComponentScanBeanDefinitionParser

org.springframework.context.annotation
Class ComponentScanBeanDefinitionParser

java.lang.Object
    extended by  org.springframework.context.annotation.ComponentScanBeanDefinitionParser
All Implemented Interfaces:
BeanDefinitionParser
public class ComponentScanBeanDefinitionParser
extends Object
implements BeanDefinitionParser

Parser for the <context:component-scan/> element.

Since:
2.5
Author:
Mark Fisher, Ramnivas Laddad, Juergen Hoeller

Constructor Summary
ComponentScanBeanDefinitionParser()
Method Summary
protected  ClassPathBeanDefinitionScanner configureScanner(ParserContext parserContext, Element element)
protected  ClassPathBeanDefinitionScanner createScanner(XmlReaderContext readerContext, boolean useDefaultFilters)
protected  TypeFilter createTypeFilter(Element element, ClassLoader classLoader)
 BeanDefinition parse(Element element, ParserContext parserContext)
Parse the specified Element and register the resulting BeanDefinition(s) with the ParserContext.getRegistry() BeanDefinitionRegistry} embedded in the supplied ParserContext.
protected  void parseBeanNameGenerator(Element element, ClassPathBeanDefinitionScanner scanner)
protected  void parseScope(Element element, ClassPathBeanDefinitionScanner scanner)
protected  void parseTypeFilters(Element element, ClassPathBeanDefinitionScanner scanner, XmlReaderContext readerContext, ParserContext parserContext)
protected  void registerComponents(XmlReaderContext readerContext, Set<BeanDefinitionHolder> beanDefinitions, Element element)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ComponentScanBeanDefinitionParser

public ComponentScanBeanDefinitionParser()
Method Detail

parse

public BeanDefinition parse(Element element,
                            ParserContext parserContext)
Description copied from interface: BeanDefinitionParser
Parse the specified Element and register the resulting BeanDefinition(s) with the ParserContext.getRegistry() BeanDefinitionRegistry} embedded in the supplied ParserContext.

Implementations must return the primary BeanDefinition that results from the parse if they will ever be used in a nested fashion (for example as an inner tag in a <property/> tag). Implementations may return null if they will not be used in a nested fashion.

Specified by:
parse in interface BeanDefinitionParser
Parameters:
element - the element that is to be parsed into one or more BeanDefinitions
parserContext - the object encapsulating the current state of the parsing process; provides access to a BeanDefinitionRegistry
Returns:
the primary BeanDefinition

configureScanner

protected ClassPathBeanDefinitionScanner configureScanner(ParserContext parserContext,
                                                          Element element)

createScanner

protected ClassPathBeanDefinitionScanner createScanner(XmlReaderContext readerContext,
                                                       boolean useDefaultFilters)

registerComponents

protected void registerComponents(XmlReaderContext readerContext,
                                  Set<BeanDefinitionHolder> beanDefinitions,
                                  Element element)

parseBeanNameGenerator

protected void parseBeanNameGenerator(Element element,
                                      ClassPathBeanDefinitionScanner scanner)

parseScope

protected void parseScope(Element element,
                          ClassPathBeanDefinitionScanner scanner)

parseTypeFilters

protected void parseTypeFilters(Element element,
                                ClassPathBeanDefinitionScanner scanner,
                                XmlReaderContext readerContext,
                                ParserContext parserContext)

createTypeFilter

protected TypeFilter createTypeFilter(Element element,
                                      ClassLoader classLoader)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConfigurationClassPostProcessor

org.springframework.context.annotation
Class ConfigurationClassPostProcessor

java.lang.Object
    extended by  org.springframework.context.annotation.ConfigurationClassPostProcessor
All Implemented Interfaces:
BeanClassLoaderAware, BeanFactoryPostProcessor, BeanDefinitionRegistryPostProcessor
public class ConfigurationClassPostProcessor
extends Object
implements BeanDefinitionRegistryPostProcessor, BeanClassLoaderAware

BeanFactoryPostProcessor used for bootstrapping processing of @Configuration classes.

Registered by default when using <context:annotation-config/> or <context:component-scan/>. Otherwise, may be declared manually as with any other BeanFactoryPostProcessor.

This post processor is Ordered.HIGHEST_PRECEDENCE as it is important that any Bean methods declared in Configuration classes have their respective bean definitions registered before any other BeanFactoryPostProcessor executes.

Since:
3.0
Author:
Chris Beams, Juergen Hoeller

Constructor Summary
ConfigurationClassPostProcessor()
Method Summary
void | enhanceConfigurationClasses(ConfigurableListableBeanFactory beanFactory) Post-processes a BeanFactory in search of Configuration class BeanDefinitions; any candidates are then enhanced by a ConfigurationClassEnhancer.
int | getOrder()
void | postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) Derive further bean definitions from the configuration classes in the registry.
void | postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) Prepare the Configuration classes for servicing bean requests at runtime by replacing them with CGLIB-enhanced subclasses.
void | processConfigBeanDefinitions(BeanDefinitionRegistry registry) Build and validate a configuration model based on the registry of Configuration classes.
void | setBeanClassLoader(ClassLoader beanClassLoader) Callback that supplies the bean class loader to a bean instance.
void | setMetadataReaderFactory(MetadataReaderFactory metadataReaderFactory) Set the MetadataReaderFactory to use.
void | setProblemReporter(ProblemReporter problemReporter) Set the ProblemReporter to use.
void | setSourceExtractor(SourceExtractor sourceExtractor) Set the SourceExtractor to use for generated bean definitions that correspond to Bean factory methods.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ConfigurationClassPostProcessor

public ConfigurationClassPostProcessor()
Method Detail

setSourceExtractor

public void setSourceExtractor(SourceExtractor sourceExtractor)
Set the SourceExtractor to use for generated bean definitions that correspond to Bean factory methods.

setProblemReporter

public void setProblemReporter(ProblemReporter problemReporter)
Set the ProblemReporter to use.

Used to register any problems detected with Configuration or Bean declarations. For instance, an @Bean method marked as final is illegal and would be reported as a problem. Defaults to FailFastProblemReporter.

setMetadataReaderFactory

public void setMetadataReaderFactory(MetadataReaderFactory metadataReaderFactory)
Set the MetadataReaderFactory to use.

Default is a CachingMetadataReaderFactory for the specified bean class loader.

setBeanClassLoader

public void setBeanClassLoader(ClassLoader beanClassLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
beanClassLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

getOrder

public int getOrder()

postProcessBeanDefinitionRegistry

public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry)
Derive further bean definitions from the configuration classes in the registry.

Specified by:
postProcessBeanDefinitionRegistry in interface BeanDefinitionRegistryPostProcessor
Parameters:
registry - the bean definition registry used by the application context

postProcessBeanFactory

public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
Prepare the Configuration classes for servicing bean requests at runtime by replacing them with CGLIB-enhanced subclasses.

Specified by:
postProcessBeanFactory in interface BeanFactoryPostProcessor
Parameters:
beanFactory - the bean factory used by the application context

processConfigBeanDefinitions

public void processConfigBeanDefinitions(BeanDefinitionRegistry registry)
Build and validate a configuration model based on the registry of Configuration classes.

enhanceConfigurationClasses

public void enhanceConfigurationClasses(ConfigurableListableBeanFactory beanFactory)
Post-processes a BeanFactory in search of Configuration class BeanDefinitions; any candidates are then enhanced by a ConfigurationClassEnhancer. Candidate status is determined by BeanDefinition attribute metadata.

See Also:
ConfigurationClassEnhancer
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Jsr330ScopeMetadataResolver

org.springframework.context.annotation
Class Jsr330ScopeMetadataResolver

java.lang.Object
    extended by  org.springframework.context.annotation.Jsr330ScopeMetadataResolver
All Implemented Interfaces:
ScopeMetadataResolver
public class Jsr330ScopeMetadataResolver
extends Object
implements ScopeMetadataResolver

Simple ScopeMetadataResolver implementation that follows JSR-330 scoping rules: defaulting to prototype scope unless Singleton is present.

This scope resolver can be used with ClassPathBeanDefinitionScanner and AnnotatedBeanDefinitionReader for standard JSR-330 compliance. However, in practice, you will typically use Spring's rich default scoping instead - or extend this resolver with custom scoping annotations that point to extended Spring scopes.

Since:
3.0
Author:
Juergen Hoeller
See Also:
registerScope(java.lang.Class, java.lang.String),
resolveScopeName(java.lang.String),
ClassPathBeanDefinitionScanner.setScopeMetadataResolver(org.springframework.context.annotation.ScopeMetadataResolver),
AnnotatedBeanDefinitionReader.setScopeMetadataResolver(org.springframework.context.annotation.ScopeMetadataResolver)

Constructor Summary
Jsr330ScopeMetadataResolver()
Method Summary
void | registerScope(Class annotationType, String scopeName) Register an extended JSR-330 scope annotation, mapping it onto a specific Spring scope by name.
void | registerScope(String annotationType, String scopeName) Register an extended JSR-330 scope annotation, mapping it onto a specific Spring scope by name.
ScopeMetadata | resolveScopeMetadata(BeanDefinition definition) Resolve the ScopeMetadata appropriate to the supplied bean definition.
protected String | resolveScopeName(String annotationType) Resolve the given annotation type into a named Spring scope.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Jsr330ScopeMetadataResolver

public Jsr330ScopeMetadataResolver()
Method Detail

registerScope

public final void registerScope(Class annotationType,
                                String scopeName)
Register an extended JSR-330 scope annotation, mapping it onto a specific Spring scope by name.

Parameters:
annotationType - the JSR-330 annotation type as a Class
scopeName - the Spring scope name

registerScope

public final void registerScope(String annotationType,
                                String scopeName)
Register an extended JSR-330 scope annotation, mapping it onto a specific Spring scope by name.

Parameters:
annotationType - the JSR-330 annotation type by name
scopeName - the Spring scope name

resolveScopeName

protected String resolveScopeName(String annotationType)
Resolve the given annotation type into a named Spring scope.

The default implementation simply checks against registered scopes. Can be overridden for custom mapping rules, e.g. naming conventions.

Parameters:
annotationType - the JSR-330 annotation type
Returns:
the Spring scope name

resolveScopeMetadata

public ScopeMetadata resolveScopeMetadata(BeanDefinition definition)
Description copied from interface: ScopeMetadataResolver
Resolve the ScopeMetadata appropriate to the supplied bean definition.

Implementations can of course use any strategy they like to determine the scope metadata, but some implementations that spring immediately to mind might be to use source level annotations present on the class of the supplied definition, or to use metadata present in the AttributeAccessor.attributeNames() of the supplied definition.

Specified by:
resolveScopeMetadata in interface ScopeMetadataResolver
Parameters:
definition - the target bean definition
Returns:
the relevant scope metadata; never null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ScannedGenericBeanDefinition

org.springframework.context.annotation
Class ScannedGenericBeanDefinition

java.lang.Object
    extended by  org.springframework.core.AttributeAccessorSupport
        extended by  org.springframework.beans.BeanMetadataAttributeAccessor
            extended by  org.springframework.beans.factory.support.AbstractBeanDefinition
                extended by  org.springframework.beans.factory.support.GenericBeanDefinition
                    extended by  org.springframework.context.annotation.ScannedGenericBeanDefinition
All Implemented Interfaces:
Serializable, Cloneable, BeanMetadataElement, AnnotatedBeanDefinition, BeanDefinition, AttributeAccessor
public class ScannedGenericBeanDefinition
extends GenericBeanDefinition
implements AnnotatedBeanDefinition

Extension of the GenericBeanDefinition class, based on an ASM ClassReader, with support for annotation metadata exposed through the AnnotatedBeanDefinition interface.

This class does not load the bean Class early. It rather retrieves all relevant metadata from the ".class" file itself, parsed with the ASM ClassReader.

Since:
2.5
Author:
Juergen Hoeller
See Also:
getMetadata(), AbstractBeanDefinition.getBeanClassName(), MetadataReaderFactory, Serialized Form

Field Summary
Fields inherited from class org.springframework.beans.factory.support.AbstractBeanDefinition
AUTOWIRE_AUTODETECT, AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_CONSTRUCTOR, AUTOWIRE_NO, DEPENDENCY_CHECK_ALL, DEPENDENCY_CHECK_NONE, DEPENDENCY_CHECK_OBJECTS, DEPENDENCY_CHECK_SIMPLE, SCOPE_DEFAULT
Fields inherited from interface org.springframework.beans.factory.config.BeanDefinition
ROLE_APPLICATION, ROLE_INFRASTRUCTURE, ROLE_SUPPORT, SCOPE_PROTOTYPE, SCOPE_SINGLETON
Constructor Summary
ScannedGenericBeanDefinition(MetadataReader metadataReader)
Create a new ScannedGenericBeanDefinition for the class that the given MetadataReader describes.
Method Summary
 AnnotationMetadata getMetadata()
Obtain the annotation metadata (as well as basic class metadata) for this bean definition's bean class.
Methods inherited from class org.springframework.beans.factory.support.GenericBeanDefinition
cloneBeanDefinition, equals, getParentName, setParentName, toString
Methods inherited from class org.springframework.beans.factory.support.AbstractBeanDefinition
addQualifier, applyDefaults, clone, copyQualifiersFrom, getAutowireMode, getBeanClass, getBeanClassName, getConstructorArgumentValues, getDependencyCheck, getDependsOn, getDescription, getDestroyMethodName, getFactoryBeanName, getFactoryMethodName, getInitMethodName, getMethodOverrides, getOriginatingBeanDefinition, getPropertyValues, getQualifier, getQualifiers, getResolvedAutowireMode, getResource, getResourceDescription, getRole, getScope, hasBeanClass, hasConstructorArgumentValues, hashCode, hasQualifier, isAbstract, isAutowireCandidate, isEnforceDestroyMethod, isEnforceInitMethod, isLazyInit, isLenientConstructorResolution, isNonPublicAccessAllowed, isPrimary, isPrototype, isSingleton, isSynthetic, overrideFrom, overrideFrom, prepareMethodOverride, prepareMethodOverrides, resolveBeanClass, setAbstract, setAutowireCandidate, setAutowireMode, setBeanClass, setBeanClassName, setConstructorArgumentValues, setDependencyCheck, setDependsOn, setDescription, setDestroyMethodName, setEnforceDestroyMethod, setEnforceInitMethod, setFactoryBeanName, setFactoryMethodName, setInitMethodName, setLazyInit, setLenientConstructorResolution, setMethodOverrides, setNonPublicAccessAllowed, setOriginatingBeanDefinition, setPrimary, setPropertyValues, setResource, setResourceDescription, setRole, setScope, setSingleton, setSynthetic, validate
Methods inherited from class org.springframework.beans.BeanMetadataAttributeAccessor
addMetadataAttribute, getAttribute, getMetadataAttribute, getSource, removeAttribute, setAttribute, setSource
Methods inherited from class org.springframework.core.AttributeAccessorSupport
attributeNames, copyAttributesFrom, hasAttribute
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.config.BeanDefinition
getBeanClassName, getConstructorArgumentValues, getDependsOn, getDescription, getFactoryBeanName, getFactoryMethodName, getOriginatingBeanDefinition, getParentName, getPropertyValues, getResourceDescription, getRole, getScope, isAbstract, isAutowireCandidate, isLazyInit, isPrimary, isPrototype, isSingleton, setAutowireCandidate, setBeanClassName, setDependsOn, setFactoryBeanName, setFactoryMethodName, setLazyInit, setParentName, setPrimary, setScope
Methods inherited from interface org.springframework.core.AttributeAccessor
attributeNames, getAttribute, hasAttribute, removeAttribute, setAttribute
Methods inherited from interface org.springframework.beans.BeanMetadataElement
getSource

Constructor Detail

ScannedGenericBeanDefinition

public ScannedGenericBeanDefinition(MetadataReader metadataReader)
Create a new ScannedGenericBeanDefinition for the class that the given MetadataReader describes.

Parameters:
metadataReader - the MetadataReader for the scanned target class
Method Detail

getMetadata

public final AnnotationMetadata getMetadata()
Description copied from interface: AnnotatedBeanDefinition
Obtain the annotation metadata (as well as basic class metadata) for this bean definition's bean class.

Specified by:
getMetadata in interface AnnotatedBeanDefinition
Returns:
the annotation metadata object (never null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ScopeMetadata

org.springframework.context.annotation
Class ScopeMetadata

java.lang.Object
    extended by  org.springframework.context.annotation.ScopeMetadata

public class ScopeMetadata
extends Object

Describes scope characteristics for a Spring-managed bean including the scope name and the scoped-proxy behavior.

The default scope is "singleton", and the default is to not create scoped-proxies.

Since:
2.5
Author:
Mark Fisher, Juergen Hoeller
See Also:
ScopeMetadataResolver, ScopedProxyMode

Constructor Summary
ScopeMetadata()
Method Summary
ScopedProxyMode | getScopedProxyMode() Get the proxy-mode to be applied to the scoped instance.
String | getScopeName() Get the name of the scope.
void | setScopedProxyMode(ScopedProxyMode scopedProxyMode) Set the proxy-mode to be applied to the scoped instance.
void | setScopeName(String scopeName) Set the name of the scope.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ScopeMetadata

public ScopeMetadata()
Method Detail

setScopeName

public void setScopeName(String scopeName)
Set the name of the scope.

getScopeName

public String getScopeName()
Get the name of the scope.

setScopedProxyMode

public void setScopedProxyMode(ScopedProxyMode scopedProxyMode)
Set the proxy-mode to be applied to the scoped instance.

getScopedProxyMode

public ScopedProxyMode getScopedProxyMode()
Get the proxy-mode to be applied to the scoped instance.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FilterType

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

org.springframework.context.annotation
Enum FilterType

java.lang.Object
    extended by  java.lang.Enum<FilterType>
        extended by  org.springframework.context.annotation.FilterType
All Implemented Interfaces:
Serializable, Comparable<FilterType>
public enum FilterType
extends Enum<FilterType>

Enumeration of the valid type filters to be added for annotation-driven configuration.

Since:
2.5
Author:
Mark Fisher, Juergen Hoeller

Enum Constant Summary
ANNOTATION
ASPECTJ_PATTERN
ASSIGNABLE_TYPE
CUSTOM
REGEX_PATTERN
Method Summary
static FilterType | valueOf(String name) Returns the enum constant of this type with the specified name.
static FilterType[] | values() Returns an array containing the constants of this enum type, in the order they are declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

ANNOTATION

public static final FilterType ANNOTATION

ASSIGNABLE_TYPE

public static final FilterType ASSIGNABLE_TYPE

ASPECTJ_PATTERN

public static final FilterType ASPECTJ_PATTERN

REGEX_PATTERN

public static final FilterType REGEX_PATTERN

CUSTOM

public static final FilterType CUSTOM
Method Detail

values

public static FilterType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (FilterType c : FilterType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static FilterType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


ScopedProxyMode

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

org.springframework.context.annotation
Enum ScopedProxyMode

java.lang.Object
    extended by  java.lang.Enum<ScopedProxyMode>
        extended by  org.springframework.context.annotation.ScopedProxyMode
All Implemented Interfaces:
Serializable, Comparable<ScopedProxyMode>
public enum ScopedProxyMode
extends Enum<ScopedProxyMode>

Enumerates the various scoped-proxy options.

For a fuller discussion of exactly what a scoped-proxy is, see that section of the Spring reference documentation entitled 'Scoped beans as dependencies'.

Since:
2.5
Author:
Mark Fisher
See Also:
ScopeMetadata

Enum Constant Summary
DEFAULT
Default typically equals NO, unless a different default has been configured at the component-scan instruction level.
INTERFACES
Create a JDK dynamic proxy implementing all interfaces exposed by the class of the target object.
NO
Do not create a scoped proxy.
TARGET_CLASS
Create a class-based proxy (requires CGLIB).
Method Summary
static ScopedProxyMode | valueOf(String name) Returns the enum constant of this type with the specified name.
static ScopedProxyMode[] | values() Returns an array containing the constants of this enum type, in the order they are declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

DEFAULT

public static final ScopedProxyMode DEFAULT
Default typically equals NO, unless a different default has been configured at the component-scan instruction level.

NO

public static final ScopedProxyMode NO
Do not create a scoped proxy.

This proxy-mode is not typically useful when used with a non-singleton scoped instance, which should favor the use of the INTERFACES or TARGET_CLASS proxy-modes instead if it is to be used as a dependency.

INTERFACES

public static final ScopedProxyMode INTERFACES
Create a JDK dynamic proxy implementing all interfaces exposed by the class of the target object.

TARGET_CLASS

public static final ScopedProxyMode TARGET_CLASS
Create a class-based proxy (requires CGLIB).

Method Detail

values

public static ScopedProxyMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ScopedProxyMode c : ScopedProxyMode.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static ScopedProxyMode valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


Bean

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.context.annotation
Annotation Type Bean

@Target(value={METHOD,ANNOTATION_TYPE})
@Retention(value=RUNTIME)
@Documented
public @interface Bean

Indicates that a method produces a bean to be managed by the Spring container. The names and semantics of the attributes to this annotation are intentionally similar to those of the <bean/> element in the Spring XML schema.

Note that the @Bean annotation does not provide attributes for scope, primary or lazy. Rather, it should be used in conjunction with @Scope, @Primary, and @Lazy annotations to achieve those semantics. The same annotations can also be used at the type level, e.g. for component scanning.

While a name() attribute is available, the default strategy for determining the name of a bean is to use the name of the Bean method. This is convenient and intuitive, but if explicit naming is desired, the name() attribute may be used. Also note that name() accepts an array of Strings. This is in order to allow for specifying multiple names (i.e., aliases) for a single bean.

The @Bean annotation may be used on any methods in an @Component class, in which case they will get processed in a configuration class 'lite' mode where they will simply be called as plain factory methods from the container (similar to factory-method declarations in XML). The containing component classes remain unmodified in this case, and there are no unusual constraints for factory methods.

As an advanced mode, @Bean may also be used within @Configuration component classes. In this case, bean methods may reference other @Bean methods on the same class by calling them directly. This ensures that references between beans are strongly typed and navigable. Such so-called 'inter-bean references' are guaranteed to respect scoping and AOP semantics, just like getBean lookups would. These are the semantics known from the original 'Spring JavaConfig' project which require CGLIB subclassing of each such configuration class at runtime. As a consequence, configuration classes and their factory methods must not be marked as final or private in this mode.

Since:
3.0
Author:
Rod Johnson, Costin Leau, Chris Beams, Juergen Hoeller
See Also:
Component, Configuration, Scope, DependsOn, Lazy, Primary, Autowired, Value

Optional Element Summary
Autowire | autowire Are dependencies to be injected via autowiring?
String | destroyMethod The optional name of a method to call on the bean instance upon closing the application context, for example a close() method on a DataSource.
String | initMethod The optional name of a method to call on the bean instance during initialization.
String[] | name The name of this bean, or if plural, aliases for this bean.

name

public abstract String[] name
The name of this bean, or if plural, aliases for this bean. If left unspecified the name of the bean is the name of the annotated method. If specified, the method name is ignored.

Default:
{}

autowire

public abstract Autowire autowire
Are dependencies to be injected via autowiring?

Default:
org.springframework.beans.factory.annotation.Autowire.NO

initMethod

public abstract String initMethod
The optional name of a method to call on the bean instance during initialization. Not commonly used, given that the method may be called programmatically directly within the body of a Bean-annotated method.

Default:
""

destroyMethod

public abstract String destroyMethod
The optional name of a method to call on the bean instance upon closing the application context, for example a close() method on a DataSource. The method must have no arguments but may throw any exception.

Note: Only invoked on beans whose lifecycle is under the full control of the factory, which is always the case for singletons but not guaranteed for any other scope.

See Also:
org.springframework.context.ConfigurableApplicationContext#close()}
Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Configuration

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.context.annotation
Annotation Type Configuration

@Target(value=TYPE)
@Retention(value=RUNTIME)
@Documented
@Component
public @interface Configuration

Indicates that a class declares one or more Bean methods and may be processed by the Spring container to generate bean definitions and service requests for those beans at runtime.

Configuration is meta-annotated as a Component, therefore Configuration classes are candidates for component-scanning and may also take advantage of Autowired at the field and method but not at the constructor level. Externalized values may be wired into Configuration classes using the Value annotation.

May be used in conjunction with the Lazy annotation to indicate that all Bean methods declared within this class are by default lazily initialized.

Constraints

  • Configuration classes must be non-final
  • Configuration classes must be non-local (may not be declared within a method)
  • Configuration classes must have a default/no-arg constructor and may not use Autowired constructor parameters

Since:
3.0
Author:
Rod Johnson, Chris Beams
See Also:
Import, Lazy, Bean, ConfigurationClassPostProcessor, AnnotationConfigApplicationContext

Optional Element Summary
 String value
Explicitly specify the name of the Spring bean definition associated with this Configuration class.

value

public abstract String value
Explicitly specify the name of the Spring bean definition associated with this Configuration class. If left unspecified (the common case), a bean name will be automatically generated.

The custom name applies only if the Configuration class is picked up via component scanning or supplied directly to a AnnotationConfigApplicationContext. If the Configuration class is registered as a traditional XML bean definition, the name/id of the bean element will take precedence.

Returns:
the specified bean name, if any
See Also:
DefaultBeanNameGenerator
Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


DependsOn

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.context.annotation
Annotation Type DependsOn

@Target(value={TYPE,METHOD})
@Retention(value=RUNTIME)
@Inherited
@Documented
public @interface DependsOn

Beans on which the current bean depends. Any beans specified are guaranteed to be created by the container before this bean. Used infrequently in cases where a bean does not explicitly depend on another through properties or constructor arguments, but rather depends on the side effects of another bean's initialization.

Note: This attribute will not be inherited by child bean definitions, hence it needs to be specified per concrete bean definition.

May be used on any class directly or indirectly annotated with Component or on methods annotated with Bean.

Using DependsOn at the class level has no effect unless component-scanning is being used. If a DependsOn-annotated class is declared via XML, DependsOn annotation metadata is ignored, and <bean depends-on="..."/> is respected instead.

Since:
3.0
Author:
Juergen Hoeller

Optional Element Summary
 String[] value

value

public abstract String[] value
Default:
{}
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Import

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.context.annotation
Annotation Type Import

@Target(value=TYPE)
@Retention(value=RUNTIME)
@Documented
public @interface Import

Indicates one or more Configuration classes to import.

Provides functionality equivalent to the <import/> element in Spring XML. Only supported for actual @Configuration-annotated classes.

@Bean definitions declared in imported @Configuration classes should be accessed by using @Autowired injection. Either the bean itself can be autowired, or the configuration class instance declaring the bean can be autowired. The latter approach allows for explicit, IDE-friendly navigation between @Configuration class methods.

If XML or other non-@Configuration bean definition resources need to be imported, use @ImportResource

Since:
3.0
Author:
Chris Beams
See Also:
Configuration, ImportResource

Required Element Summary
 Class<?>[] value
The Configuration class or classes to import.

Element Detail

value

public abstract Class<?>[] value
The Configuration class or classes to import.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


ImportResource

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.context.annotation
Annotation Type ImportResource

@Retention(value=RUNTIME)
@Target(value=TYPE)
@Documented
public @interface ImportResource

Indicates one or more resources containing bean definitions to import.

Like @Import, this annotation provides functionality similar to the <import/> element in Spring XML. It is typically used when designing @Configuration classes to be bootstrapped by AnnotationConfigApplicationContext, but where some XML functionality such as namespaces is still necessary.

By default, arguments to the value() attribute will be processed using an XmlBeanDefinitionReader, i.e. it is assumed that resources are Spring <beans/> XML files. Optionally, the reader() attribute may be supplied, allowing the user to specify a different BeanDefinitionReader implementation, such as PropertiesBeanDefinitionReader.

Since:
3.0
Author:
Chris Beams
See Also:
Configuration, Import

Required Element Summary
 String[] value
Resource paths to import.
Optional Element Summary
 Class<? extends BeanDefinitionReader> reader
BeanDefinitionReader implementation to use when processing resources specified by the value() attribute.

Element Detail

value

public abstract String[] value
Resource paths to import. Resource-loading prefixes such as classpath: and file:, etc may be used.

reader

public abstract Class<? extends BeanDefinitionReader> reader
BeanDefinitionReader implementation to use when processing resources specified by the value() attribute.

Default:
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.class
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Lazy

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.context.annotation
Annotation Type Lazy

@Target(value={TYPE,METHOD})
@Retention(value=RUNTIME)
@Inherited
@Documented
public @interface Lazy

Indicates whether a bean is to be lazily initialized.

May be used on any class directly or indirectly annotated with Component or on methods annotated with Bean.

If this annotation is not present on a Component or Bean definition, eager initialization will occur. If present and set to true, the Bean/Component will not be initialized until referenced by another bean or explicitly retrieved from the enclosing BeanFactory. If present and set to false, the bean will be instantiated on startup by bean factories that perform eager initialization of singletons.

If Lazy is present on a Configuration class, this indicates that all Bean methods within that Configuration should be lazily initialized. If Lazy is present and false on a Bean method within a Lazy-annotated Configuration class, this indicates overriding the 'default lazy' behavior and that the bean should be eagerly initialized.

Since:
3.0
Author:
Chris Beams
See Also:
Primary, Bean, Configuration, Component

Optional Element Summary
 boolean value
Whether lazy initialization should occur.

value

public abstract boolean value
Whether lazy initialization should occur.

Default:
true
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Primary

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.context.annotation
Annotation Type Primary

@Target(value={TYPE,METHOD})
@Retention(value=RUNTIME)
@Inherited
@Documented
public @interface Primary

Indicates that a bean should be given preference when multiple candidates are qualified to autowire a single-valued dependency. If exactly one 'primary' bean exists among the candidates, it will be the autowired value.

May be used on any class directly or indirectly annotated with Component or on methods annotated with Bean.

Using Primary at the class level has no effect unless component-scanning is being used. If a Primary-annotated class is declared via XML, Primary annotation metadata is ignored, and <bean primary="true|false"/> is respected instead.

Since:
3.0
Author:
Chris Beams
See Also:
Lazy, Bean, Component

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Scope

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.context.annotation
Annotation Type Scope

@Target(value={TYPE,METHOD})
@Retention(value=RUNTIME)
@Documented
public @interface Scope

When used as a type-level annotation in conjunction with the Component annotation, indicates the name of a scope to use for instances of the annotated type.

When used as a method-level annotation in conjunction with the Bean annotation, indicates the name of a scope to use for the instance returned from the method.

In this context, scope means the lifecycle of an instance, such as singleton, prototype, and so forth.

Since:
2.5
Author:
Mark Fisher, Chris Beams
See Also:
Component, Bean

Optional Element Summary
ScopedProxyMode | proxyMode Specifies whether a component should be configured as a scoped proxy and if so, whether the proxy should be interface-based or subclass-based.
String | value Specifies the scope to use for the annotated component/bean.

value

public abstract String value
Specifies the scope to use for the annotated component/bean.

Returns:
the specified scope
Default:
"singleton"

proxyMode

public abstract ScopedProxyMode proxyMode
Specifies whether a component should be configured as a scoped proxy and if so, whether the proxy should be interface-based or subclass-based.

Defaults to ScopedProxyMode.NO, indicating that no scoped proxy should be created.

Analogous to <aop:scoped-proxy/> support in Spring XML.

Default:
org.springframework.context.annotation.ScopedProxyMode.DEFAULT
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


org.springframework.context.config

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.context.config

Support package for advanced application context configuration, with XML schema being the primary configuration format.

See:
Description

Class Summary
ContextNamespaceHandler NamespaceHandler for the 'context' namespace.

Package org.springframework.context.config Description

Support package for advanced application context configuration, with XML schema being the primary configuration format.


org.springframework.context.config Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.context.config

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.beans.factory.xml.NamespaceHandlerSupport (implements org.springframework.beans.factory.xml.NamespaceHandler)
      • org.springframework.context.config.ContextNamespaceHandler


ContextNamespaceHandler

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.context.config
Class ContextNamespaceHandler

java.lang.Object
    extended by  org.springframework.beans.factory.xml.NamespaceHandlerSupport
        extended by  org.springframework.context.config.ContextNamespaceHandler
All Implemented Interfaces:
NamespaceHandler
public class ContextNamespaceHandler
extends NamespaceHandlerSupport

NamespaceHandler for the 'context' namespace.

Since:
2.5
Author:
Mark Fisher, Juergen Hoeller

Constructor Summary
ContextNamespaceHandler()
Method Summary
 void init()
Invoked by the DefaultBeanDefinitionDocumentReader after construction but before any custom elements are parsed.
Methods inherited from class org.springframework.beans.factory.xml.NamespaceHandlerSupport
decorate, parse, registerBeanDefinitionDecorator, registerBeanDefinitionDecoratorForAttribute, registerBeanDefinitionParser
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ContextNamespaceHandler

public ContextNamespaceHandler()
Method Detail

init

public void init()
Description copied from interface: NamespaceHandler
Invoked by the DefaultBeanDefinitionDocumentReader after construction but before any custom elements are parsed.

See Also:
NamespaceHandlerSupport.registerBeanDefinitionParser(String, BeanDefinitionParser)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.context.event

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.context.event

Support classes for application events, like standard context events.

See:
Description

Interface Summary
ApplicationEventMulticaster | Interface to be implemented by objects that can manage a number of ApplicationListener objects, and publish events to them.
SmartApplicationListener | Extended variant of the standard ApplicationListener interface, exposing further metadata such as the supported event type.

Class Summary
AbstractApplicationEventMulticaster | Abstract implementation of the ApplicationEventMulticaster interface, providing the basic listener registration facility.
ApplicationContextEvent | Base class for events raised for an ApplicationContext.
ContextClosedEvent | Event raised when an ApplicationContext gets closed.
ContextRefreshedEvent | Event raised when an ApplicationContext gets initialized or refreshed.
ContextStartedEvent | Event raised when an ApplicationContext gets started.
ContextStoppedEvent | Event raised when an ApplicationContext gets stopped.
EventPublicationInterceptor | Interceptor that publishes an ApplicationEvent to all ApplicationListeners registered with an ApplicationEventPublisher after each successful method invocation.
GenericApplicationListenerAdapter | SmartApplicationListener adapter that determines supported event types through introspecting the generically declared type of the target listener.
SimpleApplicationEventMulticaster | Simple implementation of the ApplicationEventMulticaster interface.
SourceFilteringListener | ApplicationListener decorator that filters events from a specified event source, invoking its delegate listener for matching ApplicationEvent objects only.

Package org.springframework.context.event Description

Support classes for application events, like standard context events. To be supported by all major application context implementations.


org.springframework.context.event Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.context.event

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.context.event.AbstractApplicationEventMulticaster (implements org.springframework.context.event.ApplicationEventMulticaster, org.springframework.beans.factory.BeanFactoryAware)
      • org.springframework.context.event.SimpleApplicationEventMulticaster
    • java.util.EventObject (implements java.io.Serializable)
      • org.springframework.context.ApplicationEvent
        • org.springframework.context.event.ApplicationContextEvent
          • org.springframework.context.event.ContextClosedEvent
          • org.springframework.context.event.ContextRefreshedEvent
          • org.springframework.context.event.ContextStartedEvent
          • org.springframework.context.event.ContextStoppedEvent
    • org.springframework.context.event.EventPublicationInterceptor (implements org.springframework.context.ApplicationEventPublisherAware, org.springframework.beans.factory.InitializingBean, org.aopalliance.intercept.MethodInterceptor)
    • org.springframework.context.event.GenericApplicationListenerAdapter (implements org.springframework.context.event.SmartApplicationListener)
    • org.springframework.context.event.SourceFilteringListener (implements org.springframework.context.event.SmartApplicationListener)

Interface Hierarchy

  • org.springframework.context.event.ApplicationEventMulticaster
  • java.util.EventListener
    • org.springframework.context.ApplicationListener<E>
      • org.springframework.context.event.SmartApplicationListener (also extends org.springframework.core.Ordered)
  • org.springframework.core.Ordered
    • org.springframework.context.event.SmartApplicationListener (also extends org.springframework.context.ApplicationListener<E>)


ApplicationEventMulticaster

org.springframework.context.event
Interface ApplicationEventMulticaster

All Known Implementing Classes:
AbstractApplicationEventMulticaster, SimpleApplicationEventMulticaster
public interface ApplicationEventMulticaster

Interface to be implemented by objects that can manage a number of ApplicationListener objects, and publish events to them.

An ApplicationEventPublisher, typically a Spring ApplicationContext, can use an ApplicationEventMulticaster as a delegate for actually publishing events.

Author:
Rod Johnson, Juergen Hoeller

Method Summary
void | addApplicationListener(ApplicationListener listener) Add a listener to be notified of all events.
void | addApplicationListenerBean(String listenerBeanName) Add a listener bean to be notified of all events.
void | multicastEvent(ApplicationEvent event) Multicast the given application event to appropriate listeners.
void | removeAllListeners() Remove all listeners registered with this multicaster.
void | removeApplicationListener(ApplicationListener listener) Remove a listener from the notification list.
void | removeApplicationListenerBean(String listenerBeanName) Remove a listener bean from the notification list.

Method Detail

addApplicationListener

void addApplicationListener(ApplicationListener listener)
Add a listener to be notified of all events.

Parameters:
listener - the listener to add

addApplicationListenerBean

void addApplicationListenerBean(String listenerBeanName)
Add a listener bean to be notified of all events.

Parameters:
listenerBeanName - the name of the listener bean to add

removeApplicationListener

void removeApplicationListener(ApplicationListener listener)
Remove a listener from the notification list.

Parameters:
listener - the listener to remove

removeApplicationListenerBean

void removeApplicationListenerBean(String listenerBeanName)
Remove a listener bean from the notification list.

Parameters:
listenerBeanName - the name of the listener bean to add

removeAllListeners

void removeAllListeners()
Remove all listeners registered with this multicaster.

After a remove call, the multicaster will perform no action on event notification until new listeners are being registered.

multicastEvent

void multicastEvent(ApplicationEvent event)
Multicast the given application event to appropriate listeners.

Parameters:
event - the event to multicast
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SmartApplicationListener

org.springframework.context.event
Interface SmartApplicationListener

All Superinterfaces:
ApplicationListener<ApplicationEvent>, EventListener, Ordered
All Known Implementing Classes:
GenericApplicationListenerAdapter, SourceFilteringListener
public interface SmartApplicationListener
extends ApplicationListener<ApplicationEvent>, Ordered

Extended variant of the standard ApplicationListener interface, exposing further metadata such as the supported event type.

Since:
3.0
Author:
Juergen Hoeller

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Method Summary
boolean | supportsEventType(Class<? extends ApplicationEvent> eventType) Determine whether this listener actually supports the given event type.
boolean | supportsSourceType(Class<?> sourceType) Determine whether this listener actually supports the given source type.
Methods inherited from interface org.springframework.context.ApplicationListener
onApplicationEvent
Methods inherited from interface org.springframework.core.Ordered
getOrder

Method Detail

supportsEventType

boolean supportsEventType(Class<? extends ApplicationEvent> eventType)
Determine whether this listener actually supports the given event type.

supportsSourceType

boolean supportsSourceType(Class<?> sourceType)
Determine whether this listener actually supports the given source type.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractApplicationEventMulticaster

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.context.event
Class AbstractApplicationEventMulticaster

java.lang.Object
    extended by  org.springframework.context.event.AbstractApplicationEventMulticaster
All Implemented Interfaces:
BeanFactoryAware, ApplicationEventMulticaster
Direct Known Subclasses:
SimpleApplicationEventMulticaster
public abstract class AbstractApplicationEventMulticaster
extends Object
implements ApplicationEventMulticaster, BeanFactoryAware

Abstract implementation of the ApplicationEventMulticaster interface, providing the basic listener registration facility.

Doesn't permit multiple instances of the same listener by default, as it keeps listeners in a linked Set. The collection class used to hold ApplicationListener objects can be overridden through the "collectionClass" bean property.

Implementing ApplicationEventMulticaster's actual ApplicationEventMulticaster.multicastEvent(org.springframework.context.ApplicationEvent) method is left to subclasses. SimpleApplicationEventMulticaster simply multicasts all events to all registered listeners, invoking them in the calling thread. Alternative implementations could be more sophisticated in those respects.

Since:
1.2.3
Author:
Juergen Hoeller
See Also:
getApplicationListeners(), SimpleApplicationEventMulticaster

Constructor Summary
AbstractApplicationEventMulticaster()
Method Summary
void | addApplicationListener(ApplicationListener listener) Add a listener to be notified of all events.
void | addApplicationListenerBean(String listenerBeanName) Add a listener bean to be notified of all events.
protected Collection<ApplicationListener> | getApplicationListeners() Return a Collection containing all ApplicationListeners.
protected Collection<ApplicationListener> | getApplicationListeners(ApplicationEvent event) Return a Collection of ApplicationListeners matching the given event type.
void | removeAllListeners() Remove all listeners registered with this multicaster.
void | removeApplicationListener(ApplicationListener listener) Remove a listener from the notification list.
void | removeApplicationListenerBean(String listenerBeanName) Remove a listener bean from the notification list.
void | setBeanFactory(BeanFactory beanFactory) Callback that supplies the owning factory to a bean instance.
protected boolean | supportsEvent(ApplicationListener listener, Class<? extends ApplicationEvent> eventType, Class sourceType) Determine whether the given listener supports the given event.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.context.event.ApplicationEventMulticaster
multicastEvent

Constructor Detail

AbstractApplicationEventMulticaster

public AbstractApplicationEventMulticaster()
Method Detail

addApplicationListener

public void addApplicationListener(ApplicationListener listener)
Description copied from interface: ApplicationEventMulticaster
Add a listener to be notified of all events.

Specified by:
addApplicationListener in interface ApplicationEventMulticaster
Parameters:
listener - the listener to add

addApplicationListenerBean

public void addApplicationListenerBean(String listenerBeanName)
Description copied from interface: ApplicationEventMulticaster
Add a listener bean to be notified of all events.

Specified by:
addApplicationListenerBean in interface ApplicationEventMulticaster
Parameters:
listenerBeanName - the name of the listener bean to add

removeApplicationListener

public void removeApplicationListener(ApplicationListener listener)
Description copied from interface: ApplicationEventMulticaster
Remove a listener from the notification list.

Specified by:
removeApplicationListener in interface ApplicationEventMulticaster
Parameters:
listener - the listener to remove

removeApplicationListenerBean

public void removeApplicationListenerBean(String listenerBeanName)
Description copied from interface: ApplicationEventMulticaster
Remove a listener bean from the notification list.

Specified by:
removeApplicationListenerBean in interface ApplicationEventMulticaster
Parameters:
listenerBeanName - the name of the listener bean to add

removeAllListeners

public void removeAllListeners()
Description copied from interface: ApplicationEventMulticaster
Remove all listeners registered with this multicaster.

After a remove call, the multicaster will perform no action on event notification until new listeners are being registered.

Specified by:
removeAllListeners in interface ApplicationEventMulticaster

setBeanFactory

public final void setBeanFactory(BeanFactory beanFactory)
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
BeanInitializationException

getApplicationListeners

protected Collection<ApplicationListener> getApplicationListeners()
Return a Collection containing all ApplicationListeners.

Returns:
a Collection of ApplicationListeners
See Also:
ApplicationListener

getApplicationListeners

protected Collection<ApplicationListener> getApplicationListeners(ApplicationEvent event)
Return a Collection of ApplicationListeners matching the given event type. Non-matching listeners get excluded early.

Parameters:
event - the event to be propagated. Allows for excluding non-matching listeners early, based on cached matching information.
Returns:
a Collection of ApplicationListeners
See Also:
ApplicationListener

supportsEvent

protected boolean supportsEvent(ApplicationListener listener,
                                Class<? extends ApplicationEvent> eventType,
                                Class sourceType)
Determine whether the given listener supports the given event.

The default implementation detects the SmartApplicationListener interface. In case of a standard ApplicationListener, a GenericApplicationListenerAdapter will be used to introspect the generically declared type of the target listener.

Parameters:
listener - the target listener to check
eventType - the event type to check against
sourceType - the source type to check against
Returns:
whether the given listener should be included in the candidates for the given event type
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ApplicationContextEvent

org.springframework.context.event
Class ApplicationContextEvent

java.lang.Object
    extended by  java.util.EventObject
        extended by  org.springframework.context.ApplicationEvent
            extended by  org.springframework.context.event.ApplicationContextEvent
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ContextClosedEvent, ContextRefreshedEvent, ContextStartedEvent, ContextStoppedEvent
public abstract class ApplicationContextEvent
extends ApplicationEvent

Base class for events raised for an ApplicationContext.

Since:
2.5
Author:
Juergen Hoeller
See Also:
Serialized Form

Field Summary
Fields inherited from class java.util.EventObject
source
Constructor Summary
ApplicationContextEvent(ApplicationContext source)
Create a new ContextStartedEvent.
Method Summary
 ApplicationContext getApplicationContext()
Get the ApplicationContext that the event was raised for.
Methods inherited from class org.springframework.context.ApplicationEvent
getTimestamp
Methods inherited from class java.util.EventObject
getSource, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ApplicationContextEvent

public ApplicationContextEvent(ApplicationContext source)
Create a new ContextStartedEvent.

Parameters:
source - the ApplicationContext that the event is raised for (must not be null)
Method Detail

getApplicationContext

public final ApplicationContext getApplicationContext()
Get the ApplicationContext that the event was raised for.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ContextClosedEvent

org.springframework.context.event
Class ContextClosedEvent

java.lang.Object
    extended by  java.util.EventObject
        extended by  org.springframework.context.ApplicationEvent
            extended by  org.springframework.context.event.ApplicationContextEvent
                extended by  org.springframework.context.event.ContextClosedEvent
All Implemented Interfaces:
Serializable
public class ContextClosedEvent
extends ApplicationContextEvent

Event raised when an ApplicationContext gets closed.

Since:
12.08.2003
Author:
Juergen Hoeller
See Also:
ContextRefreshedEvent, Serialized Form

Field Summary
Fields inherited from class java.util.EventObject
source
Constructor Summary
ContextClosedEvent(ApplicationContext source)
Creates a new ContextClosedEvent.
Method Summary
Methods inherited from class org.springframework.context.event.ApplicationContextEvent
getApplicationContext
Methods inherited from class org.springframework.context.ApplicationEvent
getTimestamp
Methods inherited from class java.util.EventObject
getSource, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ContextClosedEvent

public ContextClosedEvent(ApplicationContext source)
Creates a new ContextClosedEvent.

Parameters:
source - the ApplicationContext that has been closed (must not be null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ContextRefreshedEvent

org.springframework.context.event
Class ContextRefreshedEvent

java.lang.Object
    extended by  java.util.EventObject
        extended by  org.springframework.context.ApplicationEvent
            extended by  org.springframework.context.event.ApplicationContextEvent
                extended by  org.springframework.context.event.ContextRefreshedEvent
All Implemented Interfaces:
Serializable
public class ContextRefreshedEvent
extends ApplicationContextEvent

Event raised when an ApplicationContext gets initialized or refreshed.

Since:
04.03.2003
Author:
Juergen Hoeller
See Also:
ContextClosedEvent, Serialized Form

Field Summary
Fields inherited from class java.util.EventObject
source
Constructor Summary
ContextRefreshedEvent(ApplicationContext source)
Create a new ContextRefreshedEvent.
Method Summary
Methods inherited from class org.springframework.context.event.ApplicationContextEvent
getApplicationContext
Methods inherited from class org.springframework.context.ApplicationEvent
getTimestamp
Methods inherited from class java.util.EventObject
getSource, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ContextRefreshedEvent

public ContextRefreshedEvent(ApplicationContext source)
Create a new ContextRefreshedEvent.

Parameters:
source - the ApplicationContext that has been initialized or refreshed (must not be null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ContextStartedEvent

org.springframework.context.event
Class ContextStartedEvent

java.lang.Object
    extended by  java.util.EventObject
        extended by  org.springframework.context.ApplicationEvent
            extended by  org.springframework.context.event.ApplicationContextEvent
                extended by  org.springframework.context.event.ContextStartedEvent
All Implemented Interfaces:
Serializable
public class ContextStartedEvent
extends ApplicationContextEvent

Event raised when an ApplicationContext gets started.

Since:
2.5
Author:
Mark Fisher, Juergen Hoeller
See Also:
ContextStoppedEvent, Serialized Form

Field Summary
Fields inherited from class java.util.EventObject
source
Constructor Summary
ContextStartedEvent(ApplicationContext source)
Create a new ContextStartedEvent.
Method Summary
Methods inherited from class org.springframework.context.event.ApplicationContextEvent
getApplicationContext
Methods inherited from class org.springframework.context.ApplicationEvent
getTimestamp
Methods inherited from class java.util.EventObject
getSource, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ContextStartedEvent

public ContextStartedEvent(ApplicationContext source)
Create a new ContextStartedEvent.

Parameters:
source - the ApplicationContext that has been started (must not be null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ContextStoppedEvent

org.springframework.context.event
Class ContextStoppedEvent

java.lang.Object
    extended by  java.util.EventObject
        extended by  org.springframework.context.ApplicationEvent
            extended by  org.springframework.context.event.ApplicationContextEvent
                extended by  org.springframework.context.event.ContextStoppedEvent
All Implemented Interfaces:
Serializable
public class ContextStoppedEvent
extends ApplicationContextEvent

Event raised when an ApplicationContext gets stopped.

Since:
2.5
Author:
Mark Fisher, Juergen Hoeller
See Also:
ContextStartedEvent, Serialized Form

Field Summary
Fields inherited from class java.util.EventObject
source
Constructor Summary
ContextStoppedEvent(ApplicationContext source)
Create a new ContextStoppedEvent.
Method Summary
Methods inherited from class org.springframework.context.event.ApplicationContextEvent
getApplicationContext
Methods inherited from class org.springframework.context.ApplicationEvent
getTimestamp
Methods inherited from class java.util.EventObject
getSource, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ContextStoppedEvent

public ContextStoppedEvent(ApplicationContext source)
Create a new ContextStoppedEvent.

Parameters:
source - the ApplicationContext that has been stopped (must not be null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EventPublicationInterceptor

org.springframework.context.event
Class EventPublicationInterceptor

java.lang.Object
    extended by  org.springframework.context.event.EventPublicationInterceptor
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, InitializingBean, ApplicationEventPublisherAware
public class EventPublicationInterceptor
extends Object
implements MethodInterceptor, ApplicationEventPublisherAware, InitializingBean

Interceptor that publishes an ApplicationEvent to all ApplicationListeners registered with an ApplicationEventPublisher after each successful method invocation.

Note that this interceptor is only capable of publishing stateless events configured via the "applicationEventClass" property.

Author:
Dmitriy Kopylenko, Juergen Hoeller, Rick Evans
See Also:
setApplicationEventClass(java.lang.Class), ApplicationEvent, ApplicationListener, ApplicationEventPublisher, ApplicationContext

Constructor Summary
EventPublicationInterceptor()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
Object | invoke(MethodInvocation invocation)
void | setApplicationEventClass(Class applicationEventClass) Set the application event class to publish.
void | setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) Set the ApplicationEventPublisher that this object runs in.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

EventPublicationInterceptor

public EventPublicationInterceptor()
Method Detail

setApplicationEventClass

public void setApplicationEventClass(Class applicationEventClass)
Set the application event class to publish.

The event class must have a constructor with a single Object argument for the event source. The interceptor will pass in the invoked object.

Throws:
IllegalArgumentException - if the supplied Class is null or if it is not an ApplicationEvent subclass or if it does not expose a constructor that takes a single Object argument

setApplicationEventPublisher

public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
Description copied from interface: ApplicationEventPublisherAware
Set the ApplicationEventPublisher that this object runs in.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked before ApplicationContextAware's setApplicationContext.

Specified by:
setApplicationEventPublisher in interface ApplicationEventPublisherAware
Parameters:
applicationEventPublisher - event publisher to be used by this object

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception - in the event of misconfiguration (such as failure to set an essential property) or if initialization fails.

invoke

public Object invoke(MethodInvocation invocation)
              throws Throwable
Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


GenericApplicationListenerAdapter

org.springframework.context.event
Class GenericApplicationListenerAdapter

java.lang.Object
    extended by  org.springframework.context.event.GenericApplicationListenerAdapter
All Implemented Interfaces:
EventListener, ApplicationListener<ApplicationEvent>, SmartApplicationListener, Ordered
public class GenericApplicationListenerAdapter
extends Object
implements SmartApplicationListener

SmartApplicationListener adapter that determines supported event types through introspecting the generically declared type of the target listener.

Since:
3.0
Author:
Juergen Hoeller
See Also:
ApplicationListener.onApplicationEvent(E)

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
GenericApplicationListenerAdapter(ApplicationListener delegate)
Create a new GenericApplicationListener for the given delegate.
Method Summary
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
void | onApplicationEvent(ApplicationEvent event) Handle an application event.
boolean | supportsEventType(Class<? extends ApplicationEvent> eventType) Determine whether this listener actually supports the given event type.
boolean | supportsSourceType(Class<?> sourceType) Determine whether this listener actually supports the given source type.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

GenericApplicationListenerAdapter

public GenericApplicationListenerAdapter(ApplicationListener delegate)
Create a new GenericApplicationListener for the given delegate.

Parameters:
delegate - the delegate listener to be invoked
Method Detail

onApplicationEvent

public void onApplicationEvent(ApplicationEvent event)
Description copied from interface: ApplicationListener
Handle an application event.

Specified by:
onApplicationEvent in interface ApplicationListener<ApplicationEvent>
Parameters:
event - the event to respond to

supportsEventType

public boolean supportsEventType(Class<? extends ApplicationEvent> eventType)
Description copied from interface: SmartApplicationListener
Determine whether this listener actually supports the given event type.

Specified by:
supportsEventType in interface SmartApplicationListener

supportsSourceType

public boolean supportsSourceType(Class<?> sourceType)
Description copied from interface: SmartApplicationListener
Determine whether this listener actually supports the given source type.

Specified by:
supportsSourceType in interface SmartApplicationListener

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleApplicationEventMulticaster

org.springframework.context.event
Class SimpleApplicationEventMulticaster

java.lang.Object
    extended by  org.springframework.context.event.AbstractApplicationEventMulticaster
        extended by  org.springframework.context.event.SimpleApplicationEventMulticaster
All Implemented Interfaces:
BeanFactoryAware, ApplicationEventMulticaster
public class SimpleApplicationEventMulticaster
extends AbstractApplicationEventMulticaster

Simple implementation of the ApplicationEventMulticaster interface.

Multicasts all events to all registered listeners, leaving it up to the listeners to ignore events that they are not interested in. Listeners will usually perform corresponding instanceof checks on the passed-in event object.

By default, all listeners are invoked in the calling thread. This allows the danger of a rogue listener blocking the entire application, but adds minimal overhead. Specify an alternative TaskExecutor to have listeners executed in different threads, for example from a thread pool.

Author:
Rod Johnson, Juergen Hoeller
See Also:
setTaskExecutor(java.util.concurrent.Executor)

Constructor Summary
SimpleApplicationEventMulticaster()
Create a new SimpleApplicationEventMulticaster.
SimpleApplicationEventMulticaster(BeanFactory beanFactory)
Create a new SimpleApplicationEventMulticaster for the given BeanFactory.
Method Summary
protected Executor | getTaskExecutor() Return the current TaskExecutor for this multicaster.
void | multicastEvent(ApplicationEvent event) Multicast the given application event to appropriate listeners.
void | setTaskExecutor(Executor taskExecutor) Set the TaskExecutor to execute application listeners with.
Methods inherited from class org.springframework.context.event.AbstractApplicationEventMulticaster
addApplicationListener, addApplicationListenerBean, getApplicationListeners, getApplicationListeners, removeAllListeners, removeApplicationListener, removeApplicationListenerBean, setBeanFactory, supportsEvent
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleApplicationEventMulticaster

public SimpleApplicationEventMulticaster()
Create a new SimpleApplicationEventMulticaster.

SimpleApplicationEventMulticaster

public SimpleApplicationEventMulticaster(BeanFactory beanFactory)
Create a new SimpleApplicationEventMulticaster for the given BeanFactory.

Method Detail

setTaskExecutor

public void setTaskExecutor(Executor taskExecutor)
Set the TaskExecutor to execute application listeners with.

Default is a SyncTaskExecutor, executing the listeners synchronously in the calling thread.

Consider specifying an asynchronous TaskExecutor here to not block the caller until all listeners have been executed. However, note that asynchronous execution will not participate in the caller's thread context (class loader, transaction association) unless the TaskExecutor explicitly supports this.

See Also:
SyncTaskExecutor, SimpleAsyncTaskExecutor

getTaskExecutor

protected Executor getTaskExecutor()
Return the current TaskExecutor for this multicaster.

multicastEvent

public void multicastEvent(ApplicationEvent event)
Description copied from interface: ApplicationEventMulticaster
Multicast the given application event to appropriate listeners.

Parameters:
event - the event to multicast
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SourceFilteringListener

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.context.event
Class SourceFilteringListener

java.lang.Object
    extended by  org.springframework.context.event.SourceFilteringListener
All Implemented Interfaces:
EventListener, ApplicationListener<ApplicationEvent>, SmartApplicationListener, Ordered
public class SourceFilteringListener
extends Object
implements SmartApplicationListener

ApplicationListener decorator that filters events from a specified event source, invoking its delegate listener for matching ApplicationEvent objects only.

Can also be used as base class, overriding the onApplicationEventInternal(org.springframework.context.ApplicationEvent) method instead of specifying a delegate listener.

Since:
2.0.5
Author:
Juergen Hoeller

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
protected | SourceFilteringListener(Object source) Create a SourceFilteringListener for the given event source, expecting subclasses to override the onApplicationEventInternal(org.springframework.context.ApplicationEvent) method (instead of specifying a delegate listener).
 | SourceFilteringListener(Object source, ApplicationListener delegate) Create a SourceFilteringListener for the given event source.
Method Summary
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
void | onApplicationEvent(ApplicationEvent event) Handle an application event.
protected void | onApplicationEventInternal(ApplicationEvent event) Actually process the event, after having filtered according to the desired event source already.
boolean | supportsEventType(Class<? extends ApplicationEvent> eventType) Determine whether this listener actually supports the given event type.
boolean | supportsSourceType(Class<?> sourceType) Determine whether this listener actually supports the given source type.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SourceFilteringListener

public SourceFilteringListener(Object source,
                               ApplicationListener delegate)
Create a SourceFilteringListener for the given event source.

Parameters:
source - the event source that this listener filters for, only processing events from this source
delegate - the delegate listener to invoke with event from the specified source

SourceFilteringListener

protected SourceFilteringListener(Object source)
Create a SourceFilteringListener for the given event source, expecting subclasses to override the onApplicationEventInternal(org.springframework.context.ApplicationEvent) method (instead of specifying a delegate listener).

Parameters:
source - the event source that this listener filters for, only processing events from this source
Method Detail

onApplicationEvent

public void onApplicationEvent(ApplicationEvent event)
Description copied from interface: ApplicationListener
Handle an application event.

Specified by:
onApplicationEvent in interface ApplicationListener<ApplicationEvent>
Parameters:
event - the event to respond to

supportsEventType

public boolean supportsEventType(Class<? extends ApplicationEvent> eventType)
Description copied from interface: SmartApplicationListener
Determine whether this listener actually supports the given event type.

Specified by:
supportsEventType in interface SmartApplicationListener

supportsSourceType

public boolean supportsSourceType(Class<?> sourceType)
Description copied from interface: SmartApplicationListener
Determine whether this listener actually supports the given source type.

Specified by:
supportsSourceType in interface SmartApplicationListener

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

onApplicationEventInternal

protected void onApplicationEventInternal(ApplicationEvent event)
Actually process the event, after having filtered according to the desired event source already.

The default implementation invokes the specified delegate, if any.

Parameters:
event - the event to process (matching the specified source)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.context.expression

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.context.expression

Expression parsing support within a Spring application context.

See:
Description

Class Summary
BeanExpressionContextAccessor | EL property accessor that knows how to traverse the beans and contextual objects of a Spring BeanExpressionContext.
BeanFactoryAccessor | EL property accessor that knows how to traverse the beans of a Spring BeanFactory.
MapAccessor | EL property accessor that knows how to traverse the keys of a standard Map.
StandardBeanExpressionResolver | Standard implementation of the BeanExpressionResolver interface, parsing and evaluating Spring EL using Spring's expression module.

Package org.springframework.context.expression Description

Expression parsing support within a Spring application context.


org.springframework.context.expression Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.context.expression

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.context.expression.BeanExpressionContextAccessor (implements org.springframework.expression.PropertyAccessor)
    • org.springframework.context.expression.BeanFactoryAccessor (implements org.springframework.expression.PropertyAccessor)
    • org.springframework.context.expression.MapAccessor (implements org.springframework.expression.PropertyAccessor)
    • org.springframework.context.expression.StandardBeanExpressionResolver (implements org.springframework.beans.factory.config.BeanExpressionResolver)


BeanExpressionContextAccessor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.context.expression
Class BeanExpressionContextAccessor

java.lang.Object
    extended by  org.springframework.context.expression.BeanExpressionContextAccessor
All Implemented Interfaces:
PropertyAccessor
public class BeanExpressionContextAccessor
extends Object
implements PropertyAccessor

EL property accessor that knows how to traverse the beans and contextual objects of a Spring BeanExpressionContext.

Since:
3.0
Author:
Juergen Hoeller, Andy Clement

Constructor Summary
BeanExpressionContextAccessor()
Method Summary
boolean | canRead(EvaluationContext context, Object target, String name) Called to determine if a resolver instance is able to access a specified property on a specified target object.
boolean | canWrite(EvaluationContext context, Object target, String name) Called to determine if a resolver instance is able to write to a specified property on a specified target object.
Class[] | getSpecificTargetClasses() Return an array of classes for which this resolver should be called.
TypedValue | read(EvaluationContext context, Object target, String name) Called to read a property from a specified target object
void | write(EvaluationContext context, Object target, String name, Object newValue) Called to write to a property on a specified target object.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BeanExpressionContextAccessor

public BeanExpressionContextAccessor()
Method Detail

canRead

public boolean canRead(EvaluationContext context,
                       Object target,
                       String name)
                throws AccessException
Description copied from interface: PropertyAccessor
Called to determine if a resolver instance is able to access a specified property on a specified target object.

Specified by:
canRead in interface PropertyAccessor
Parameters:
context - the evaluation context in which the access is being attempted
target - the target object upon which the property is being accessed
name - the name of the property being accessed
Returns:
true if this resolver is able to read the property
Throws:
AccessException - if there is any problem determining whether the property can be read

read

public TypedValue read(EvaluationContext context,
                       Object target,
                       String name)
                throws AccessException
Description copied from interface: PropertyAccessor
Called to read a property from a specified target object

Specified by:
read in interface PropertyAccessor
Parameters:
context - the evaluation context in which the access is being attempted
target - the target object upon which the property is being accessed
name - the name of the property being accessed
Returns:
a TypedValue object wrapping the property value read and a type descriptor for it
Throws:
AccessException - if there is any problem accessing the property value

canWrite

public boolean canWrite(EvaluationContext context,
                        Object target,
                        String name)
                 throws AccessException
Description copied from interface: PropertyAccessor
Called to determine if a resolver instance is able to write to a specified property on a specified target object.

Specified by:
canWrite in interface PropertyAccessor
Parameters:
context - the evaluation context in which the access is being attempted
target - the target object upon which the property is being accessed
name - the name of the property being accessed
Returns:
true if this resolver is able to write to the property
Throws:
AccessException - if there is any problem determining whether the property can be written to

write

public void write(EvaluationContext context,
                  Object target,
                  String name,
                  Object newValue)
           throws AccessException
Description copied from interface: PropertyAccessor
Called to write to a property on a specified target object. Should only succeed if canWrite() also returns true.

Specified by:
write in interface PropertyAccessor
Parameters:
context - the evaluation context in which the access is being attempted
target - the target object upon which the property is being accessed
name - the name of the property being accessed
newValue - the new value for the property
Throws:
AccessException - if there is any problem writing to the property value

getSpecificTargetClasses

public Class[] getSpecificTargetClasses()
Description copied from interface: PropertyAccessor
Return an array of classes for which this resolver should be called. Returning null indicates this is a general resolver that can be called in an attempt to resolve a property on any type.

Specified by:
getSpecificTargetClasses in interface PropertyAccessor
Returns:
an array of classes that this resolver is suitable for (or null if a general resolver)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


BeanFactoryAccessor

org.springframework.context.expression
Class BeanFactoryAccessor

java.lang.Object
    extended by  org.springframework.context.expression.BeanFactoryAccessor
All Implemented Interfaces:
PropertyAccessor
public class BeanFactoryAccessor
extends Object
implements PropertyAccessor

EL property accessor that knows how to traverse the beans of a Spring BeanFactory.

Since:
3.0
Author:
Juergen Hoeller, Andy Clement

Constructor Summary
BeanFactoryAccessor()
Method Summary
boolean | canRead(EvaluationContext context, Object target, String name) Called to determine if a resolver instance is able to access a specified property on a specified target object.
boolean | canWrite(EvaluationContext context, Object target, String name) Called to determine if a resolver instance is able to write to a specified property on a specified target object.
Class[] | getSpecificTargetClasses() Return an array of classes for which this resolver should be called.
TypedValue | read(EvaluationContext context, Object target, String name) Called to read a property from a specified target object
void | write(EvaluationContext context, Object target, String name, Object newValue) Called to write to a property on a specified target object.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BeanFactoryAccessor

public BeanFactoryAccessor()
Method Detail

canRead

public boolean canRead(EvaluationContext context,
                       Object target,
                       String name)
                throws AccessException
Description copied from interface: PropertyAccessor
Called to determine if a resolver instance is able to access a specified property on a specified target object.

Specified by:
canRead in interface PropertyAccessor
Parameters:
context - the evaluation context in which the access is being attempted
target - the target object upon which the property is being accessed
name - the name of the property being accessed
Returns:
true if this resolver is able to read the property
Throws:
AccessException - if there is any problem determining whether the property can be read

read

public TypedValue read(EvaluationContext context,
                       Object target,
                       String name)
                throws AccessException
Description copied from interface: PropertyAccessor
Called to read a property from a specified target object

Specified by:
read in interface PropertyAccessor
Parameters:
context - the evaluation context in which the access is being attempted
target - the target object upon which the property is being accessed
name - the name of the property being accessed
Returns:
a TypedValue object wrapping the property value read and a type descriptor for it
Throws:
AccessException - if there is any problem accessing the property value

canWrite

public boolean canWrite(EvaluationContext context,
                        Object target,
                        String name)
                 throws AccessException
Description copied from interface: PropertyAccessor
Called to determine if a resolver instance is able to write to a specified property on a specified target object.

Specified by:
canWrite in interface PropertyAccessor
Parameters:
context - the evaluation context in which the access is being attempted
target - the target object upon which the property is being accessed
name - the name of the property being accessed
Returns:
true if this resolver is able to write to the property
Throws:
AccessException - if there is any problem determining whether the property can be written to

write

public void write(EvaluationContext context,
                  Object target,
                  String name,
                  Object newValue)
           throws AccessException
Description copied from interface: PropertyAccessor
Called to write to a property on a specified target object. Should only succeed if canWrite() also returns true.

Specified by:
write in interface PropertyAccessor
Parameters:
context - the evaluation context in which the access is being attempted
target - the target object upon which the property is being accessed
name - the name of the property being accessed
newValue - the new value for the property
Throws:
AccessException - if there is any problem writing to the property value

getSpecificTargetClasses

public Class[] getSpecificTargetClasses()
Description copied from interface: PropertyAccessor
Return an array of classes for which this resolver should be called. Returning null indicates this is a general resolver that can be called in an attempt to resolve a property on any type.

Specified by:
getSpecificTargetClasses in interface PropertyAccessor
Returns:
an array of classes that this resolver is suitable for (or null if a general resolver)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MapAccessor

org.springframework.context.expression
Class MapAccessor

java.lang.Object
    extended by  org.springframework.context.expression.MapAccessor
All Implemented Interfaces:
PropertyAccessor
public class MapAccessor
extends Object
implements PropertyAccessor

EL property accessor that knows how to traverse the keys of a standard Map.

Since:
3.0
Author:
Juergen Hoeller, Andy Clement

Constructor Summary
MapAccessor()
Method Summary
boolean | canRead(EvaluationContext context, Object target, String name) Called to determine if a resolver instance is able to access a specified property on a specified target object.
boolean | canWrite(EvaluationContext context, Object target, String name) Called to determine if a resolver instance is able to write to a specified property on a specified target object.
Class[] | getSpecificTargetClasses() Return an array of classes for which this resolver should be called.
TypedValue | read(EvaluationContext context, Object target, String name) Called to read a property from a specified target object
void | write(EvaluationContext context, Object target, String name, Object newValue) Called to write to a property on a specified target object.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MapAccessor

public MapAccessor()
Method Detail

canRead

public boolean canRead(EvaluationContext context,
                       Object target,
                       String name)
                throws AccessException
Description copied from interface: PropertyAccessor
Called to determine if a resolver instance is able to access a specified property on a specified target object.

Specified by:
canRead in interface PropertyAccessor
Parameters:
context - the evaluation context in which the access is being attempted
target - the target object upon which the property is being accessed
name - the name of the property being accessed
Returns:
true if this resolver is able to read the property
Throws:
AccessException - if there is any problem determining whether the property can be read

read

public TypedValue read(EvaluationContext context,
                       Object target,
                       String name)
                throws AccessException
Description copied from interface: PropertyAccessor
Called to read a property from a specified target object

Specified by:
read in interface PropertyAccessor
Parameters:
context - the evaluation context in which the access is being attempted
target - the target object upon which the property is being accessed
name - the name of the property being accessed
Returns:
a TypedValue object wrapping the property value read and a type descriptor for it
Throws:
AccessException - if there is any problem accessing the property value

canWrite

public boolean canWrite(EvaluationContext context,
                        Object target,
                        String name)
                 throws AccessException
Description copied from interface: PropertyAccessor
Called to determine if a resolver instance is able to write to a specified property on a specified target object.

Specified by:
canWrite in interface PropertyAccessor
Parameters:
context - the evaluation context in which the access is being attempted
target - the target object upon which the property is being accessed
name - the name of the property being accessed
Returns:
true if this resolver is able to write to the property
Throws:
AccessException - if there is any problem determining whether the property can be written to

write

public void write(EvaluationContext context,
                  Object target,
                  String name,
                  Object newValue)
           throws AccessException
Description copied from interface: PropertyAccessor
Called to write to a property on a specified target object. Should only succeed if canWrite() also returns true.

Specified by:
write in interface PropertyAccessor
Parameters:
context - the evaluation context in which the access is being attempted
target - the target object upon which the property is being accessed
name - the name of the property being accessed
newValue - the new value for the property
Throws:
AccessException - if there is any problem writing to the property value

getSpecificTargetClasses

public Class[] getSpecificTargetClasses()
Description copied from interface: PropertyAccessor
Return an array of classes for which this resolver should be called. Returning null indicates this is a general resolver that can be called in an attempt to resolve a property on any type.

Specified by:
getSpecificTargetClasses in interface PropertyAccessor
Returns:
an array of classes that this resolver is suitable for (or null if a general resolver)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StandardBeanExpressionResolver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.context.expression
Class StandardBeanExpressionResolver

java.lang.Object
    extended by  org.springframework.context.expression.StandardBeanExpressionResolver
All Implemented Interfaces:
BeanExpressionResolver
public class StandardBeanExpressionResolver
extends Object
implements BeanExpressionResolver

Standard implementation of the BeanExpressionResolver interface, parsing and evaluating Spring EL using Spring's expression module.

Since:
3.0
Author:
Juergen Hoeller
See Also:
ExpressionParser, SpelExpressionParser, StandardEvaluationContext

Field Summary
static String | DEFAULT_EXPRESSION_PREFIX Default expression prefix: "#{"
static String | DEFAULT_EXPRESSION_SUFFIX Default expression suffix: "}"
Constructor Summary
StandardBeanExpressionResolver()
Method Summary
protected void | customizeEvaluationContext(StandardEvaluationContext evalContext) Template method for customizing the expression evaluation context.
Object | evaluate(String value, BeanExpressionContext evalContext) Evaluate the given value as an expression, if applicable; return the value as-is otherwise.
void | setExpressionParser(ExpressionParser expressionParser) Specify the EL parser to use for expression parsing.
void | setExpressionPrefix(String expressionPrefix) Set the prefix that an expression string starts with.
void | setExpressionSuffix(String expressionSuffix) Set the suffix that an expression string ends with.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_EXPRESSION_PREFIX

public static final String DEFAULT_EXPRESSION_PREFIX
Default expression prefix: "#{"

See Also:
Constant Field Values

DEFAULT_EXPRESSION_SUFFIX

public static final String DEFAULT_EXPRESSION_SUFFIX
Default expression suffix: "}"

See Also:
Constant Field Values
Constructor Detail

StandardBeanExpressionResolver

public StandardBeanExpressionResolver()
Method Detail

setExpressionPrefix

public void setExpressionPrefix(String expressionPrefix)
Set the prefix that an expression string starts with. The default is "#{".

See Also:
DEFAULT_EXPRESSION_PREFIX

setExpressionSuffix

public void setExpressionSuffix(String expressionSuffix)
Set the suffix that an expression string ends with. The default is "}".

See Also:
DEFAULT_EXPRESSION_SUFFIX

setExpressionParser

public void setExpressionParser(ExpressionParser expressionParser)
Specify the EL parser to use for expression parsing.

Default is a SpelExpressionParser, compatible with standard Unified EL style expression syntax.

evaluate

public Object evaluate(String value,
                       BeanExpressionContext evalContext)
                throws BeansException
Description copied from interface: BeanExpressionResolver
Evaluate the given value as an expression, if applicable; return the value as-is otherwise.

Specified by:
evaluate in interface BeanExpressionResolver
Parameters:
value - the value to check
evalContext - the evaluation context
Returns:
the resolved value (potentially the given value as-is)
Throws:
BeansException - if evaluation failed

customizeEvaluationContext

protected void customizeEvaluationContext(StandardEvaluationContext evalContext)
Template method for customizing the expression evaluation context.

The default implementation is empty.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.context.i18n

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.context.i18n

Abstraction for determining the current Locale, plus global holder that exposes a thread-bound Locale.

See:
Description

Interface Summary
LocaleContext Strategy interface for determining the current Locale.

Class Summary
LocaleContextHolder | Simple holder class that associates a LocaleContext instance with the current thread.
SimpleLocaleContext | Simple implementation of the LocaleContext interface, always returning a specified Locale.

Package org.springframework.context.i18n Description

Abstraction for determining the current Locale, plus global holder that exposes a thread-bound Locale.


org.springframework.context.i18n Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.context.i18n

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.context.i18n.LocaleContextHolder
    • org.springframework.context.i18n.SimpleLocaleContext (implements org.springframework.context.i18n.LocaleContext)

Interface Hierarchy

  • org.springframework.context.i18n.LocaleContext


LocaleContext

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.context.i18n
Interface LocaleContext

All Known Implementing Classes:
SimpleLocaleContext
public interface LocaleContext

Strategy interface for determining the current Locale.

A LocaleContext instance can be associated with a thread via the LocaleContextHolder class.

Since:
1.2
Author:
Juergen Hoeller
See Also:
LocaleContextHolder, Locale

Method Summary
 Locale getLocale()
Return the current Locale, which can be fixed or determined dynamically, depending on the implementation strategy.

Method Detail

getLocale

Locale getLocale()
Return the current Locale, which can be fixed or determined dynamically, depending on the implementation strategy.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


LocaleContextHolder

org.springframework.context.i18n
Class LocaleContextHolder

java.lang.Object
    extended by  org.springframework.context.i18n.LocaleContextHolder

public abstract class LocaleContextHolder
extends Object

Simple holder class that associates a LocaleContext instance with the current thread. The LocaleContext will be inherited by any child threads spawned by the current thread.

Used as a central holder for the current Locale in Spring, wherever necessary: for example, in MessageSourceAccessor. DispatcherServlet automatically exposes its current Locale here. Other applications can expose theirs too, to make classes like MessageSourceAccessor automatically use that Locale.

Since:
1.2
Author:
Juergen Hoeller
See Also:
LocaleContext, MessageSourceAccessor, DispatcherServlet

Constructor Summary
LocaleContextHolder()
Method Summary
static Locale | getLocale() Return the Locale associated with the current thread, if any, or the system default Locale else.
static LocaleContext | getLocaleContext() Return the LocaleContext associated with the current thread, if any.
static void | resetLocaleContext() Reset the LocaleContext for the current thread.
static void | setLocale(Locale locale) Associate the given Locale with the current thread.
static void | setLocale(Locale locale, boolean inheritable) Associate the given Locale with the current thread.
static void | setLocaleContext(LocaleContext localeContext) Associate the given LocaleContext with the current thread, not exposing it as inheritable for child threads.
static void | setLocaleContext(LocaleContext localeContext, boolean inheritable) Associate the given LocaleContext with the current thread.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

LocaleContextHolder

public LocaleContextHolder()
Method Detail

resetLocaleContext

public static void resetLocaleContext()
Reset the LocaleContext for the current thread.

setLocaleContext

public static void setLocaleContext(LocaleContext localeContext)
Associate the given LocaleContext with the current thread, not exposing it as inheritable for child threads.

Parameters:
localeContext - the current LocaleContext, or null to reset the thread-bound context

setLocaleContext

public static void setLocaleContext(LocaleContext localeContext,
                                    boolean inheritable)
Associate the given LocaleContext with the current thread.

Parameters:
localeContext - the current LocaleContext, or null to reset the thread-bound context
inheritable - whether to expose the LocaleContext as inheritable for child threads (using an InheritableThreadLocal)

getLocaleContext

public static LocaleContext getLocaleContext()
Return the LocaleContext associated with the current thread, if any.

Returns:
the current LocaleContext, or null if none

setLocale

public static void setLocale(Locale locale)
Associate the given Locale with the current thread.

Will implicitly create a LocaleContext for the given Locale, not exposing it as inheritable for child threads.

Parameters:
locale - the current Locale, or null to reset the thread-bound context
See Also:
SimpleLocaleContext.SimpleLocaleContext(java.util.Locale)

setLocale

public static void setLocale(Locale locale,
                             boolean inheritable)
Associate the given Locale with the current thread.

Will implicitly create a LocaleContext for the given Locale.

Parameters:
locale - the current Locale, or null to reset the thread-bound context
inheritable - whether to expose the LocaleContext as inheritable for child threads (using an InheritableThreadLocal)
See Also:
SimpleLocaleContext.SimpleLocaleContext(java.util.Locale)

getLocale

public static Locale getLocale()
Return the Locale associated with the current thread, if any, or the system default Locale else.

Returns:
the current Locale, or the system default Locale if no specific Locale has been associated with the current thread
See Also:
LocaleContext.getLocale(), Locale.getDefault()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleLocaleContext

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.context.i18n
Class SimpleLocaleContext

java.lang.Object
    extended by  org.springframework.context.i18n.SimpleLocaleContext
All Implemented Interfaces:
LocaleContext
public class SimpleLocaleContext
extends Object
implements LocaleContext

Simple implementation of the LocaleContext interface, always returning a specified Locale.

Since:
1.2
Author:
Juergen Hoeller

Constructor Summary
SimpleLocaleContext(Locale locale)
Create a new SimpleLocaleContext that exposes the specified Locale.
Method Summary
Locale | getLocale() Return the current Locale, which can be fixed or determined dynamically, depending on the implementation strategy.
String | toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

SimpleLocaleContext

public SimpleLocaleContext(Locale locale)
Create a new SimpleLocaleContext that exposes the specified Locale. Every getLocale() will return this Locale.

Parameters:
locale - the Locale to expose
Method Detail

getLocale

public Locale getLocale()
Description copied from interface: LocaleContext
Return the current Locale, which can be fixed or determined dynamically, depending on the implementation strategy.

Specified by:
getLocale in interface LocaleContext

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.context.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.context.support

Classes supporting the org.springframework.context package, such as abstract base classes for ApplicationContext implementations and a MessageSource implementation.

See:
Description

Class Summary
AbstractApplicationContext | Abstract implementation of the ApplicationContext interface.
AbstractMessageSource | Abstract implementation of the HierarchicalMessageSource interface, implementing common handling of message variants, making it easy to implement a specific strategy for a concrete MessageSource.
AbstractRefreshableApplicationContext | Base class for ApplicationContext implementations which are supposed to support multiple calls to refresh, creating a new internal bean factory instance every time.
AbstractRefreshableConfigApplicationContext | AbstractRefreshableApplicationContext subclass that adds common handling of specified config locations.
AbstractXmlApplicationContext | Convenient base class for ApplicationContext implementations, drawing configuration from XML documents containing bean definitions understood by an XmlBeanDefinitionReader.
ApplicationObjectSupport | Convenient superclass for application objects that want to be aware of the application context, e.g.
ClassPathXmlApplicationContext | Standalone XML application context, taking the context definition files from the class path, interpreting plain paths as class path resource names that include the package path (e.g.
ConversionServiceFactoryBean | A factory for a ConversionService that installs default converters appropriate for most environments.
DefaultLifecycleProcessor | Default implementation of the LifecycleProcessor strategy.
DefaultMessageSourceResolvable | Default implementation of the MessageSourceResolvable interface.
DelegatingMessageSource | Empty MessageSource that delegates all calls to the parent MessageSource.
FileSystemXmlApplicationContext | Standalone XML application context, taking the context definition files from the file system or from URLs, interpreting plain paths as relative file system locations (e.g.
GenericApplicationContext | Generic ApplicationContext implementation that holds a single internal DefaultListableBeanFactory instance and does not assume a specific bean definition format.
GenericXmlApplicationContext | Convenient application context with built-in XML support.
MessageSourceAccessor | Helper class for easy access to messages from a MessageSource, providing various overloaded getMessage methods.
MessageSourceResourceBundle | Helper class that allows for accessing a Spring MessageSource as a ResourceBundle.
MessageSourceSupport | Base class for message source implementations, providing support infrastructure such as MessageFormat handling but not implementing concrete methods defined in the MessageSource.
ReloadableResourceBundleMessageSource | MessageSource implementation that accesses resource bundles using specified basenames.
ResourceBundleMessageSource | MessageSource implementation that accesses resource bundles using specified basenames.
SimpleThreadScope | Thread-backed Scope implementation.
StaticApplicationContext | ApplicationContext implementation which supports programmatic registration of beans and messages, rather than reading bean definitions from external configuration sources.
StaticMessageSource | Simple implementation of MessageSource which allows messages to be registered programmatically.

Package org.springframework.context.support Description

Classes supporting the org.springframework.context package, such as abstract base classes for ApplicationContext implementations and a MessageSource implementation.


org.springframework.context.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.context.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.context.support.ApplicationObjectSupport (implements org.springframework.context.ApplicationContextAware)
    • org.springframework.context.support.ConversionServiceFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.context.support.DefaultLifecycleProcessor (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.context.LifecycleProcessor)
    • org.springframework.context.support.DefaultMessageSourceResolvable (implements org.springframework.context.MessageSourceResolvable, java.io.Serializable)
    • org.springframework.core.io.DefaultResourceLoader (implements org.springframework.core.io.ResourceLoader)
      • org.springframework.context.support.AbstractApplicationContext (implements org.springframework.context.ConfigurableApplicationContext, org.springframework.beans.factory.DisposableBean)
        • org.springframework.context.support.AbstractRefreshableApplicationContext
          • org.springframework.context.support.AbstractRefreshableConfigApplicationContext (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean)
            • org.springframework.context.support.AbstractXmlApplicationContext
              • org.springframework.context.support.ClassPathXmlApplicationContext
              • org.springframework.context.support.FileSystemXmlApplicationContext
        • org.springframework.context.support.GenericApplicationContext (implements org.springframework.beans.factory.support.BeanDefinitionRegistry)
          • org.springframework.context.support.GenericXmlApplicationContext
          • org.springframework.context.support.StaticApplicationContext
    • org.springframework.context.support.MessageSourceAccessor
    • org.springframework.context.support.MessageSourceSupport
      • org.springframework.context.support.AbstractMessageSource (implements org.springframework.context.HierarchicalMessageSource)
        • org.springframework.context.support.ReloadableResourceBundleMessageSource (implements org.springframework.context.ResourceLoaderAware)
        • org.springframework.context.support.ResourceBundleMessageSource (implements org.springframework.beans.factory.BeanClassLoaderAware)
        • org.springframework.context.support.StaticMessageSource
      • org.springframework.context.support.DelegatingMessageSource (implements org.springframework.context.HierarchicalMessageSource)
    • org.springframework.context.support.ReloadableResourceBundleMessageSource.PropertiesHolder
    • java.util.ResourceBundle
      • org.springframework.context.support.MessageSourceResourceBundle
    • org.springframework.context.support.SimpleThreadScope (implements org.springframework.beans.factory.config.Scope)


AbstractApplicationContext

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.context.support
Class AbstractApplicationContext

java.lang.Object
    extended by  org.springframework.core.io.DefaultResourceLoader
        extended by  org.springframework.context.support.AbstractApplicationContext
All Implemented Interfaces:
BeanFactory, DisposableBean, HierarchicalBeanFactory, ListableBeanFactory, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, ResourceLoader, ResourcePatternResolver
Direct Known Subclasses:
AbstractRefreshableApplicationContext, GenericApplicationContext
public abstract class AbstractApplicationContext
extends DefaultResourceLoader
implements ConfigurableApplicationContext, DisposableBean

Abstract implementation of the ApplicationContext interface. Doesn't mandate the type of storage used for configuration; simply implements common context functionality. Uses the Template Method design pattern, requiring concrete subclasses to implement abstract methods.

In contrast to a plain BeanFactory, an ApplicationContext is supposed to detect special beans defined in its internal bean factory: Therefore, this class automatically registers BeanFactoryPostProcessors, BeanPostProcessors and ApplicationListeners which are defined as beans in the context.

A MessageSource may also be supplied as a bean in the context, with the name "messageSource"; otherwise, message resolution is delegated to the parent context. Furthermore, a multicaster for application events can be supplied as "applicationEventMulticaster" bean of type ApplicationEventMulticaster in the context; otherwise, a default multicaster of type SimpleApplicationEventMulticaster will be used.

Implements resource loading through extending DefaultResourceLoader. Consequently treats non-URL resource paths as class path resources (supporting full class path resource names that include the package path, e.g. "mypackage/myresource.dat"), unless the DefaultResourceLoader.getResourceByPath(java.lang.String) method is overwritten in a subclass.

Since:
January 21, 2001
Author:
Rod Johnson, Juergen Hoeller, Mark Fisher
See Also:
refreshBeanFactory(), getBeanFactory(), BeanFactoryPostProcessor, BeanPostProcessor, ApplicationEventMulticaster, ApplicationListener, MessageSource

Field Summary
static String | APPLICATION_EVENT_MULTICASTER_BEAN_NAME Name of the ApplicationEventMulticaster bean in the factory.
static String | LIFECYCLE_PROCESSOR_BEAN_NAME Name of the LifecycleProcessor bean in the factory.
protected Log | logger Logger used by this class.
static String | MESSAGE_SOURCE_BEAN_NAME Name of the MessageSource bean in the factory.
Fields inherited from interface org.springframework.context.ConfigurableApplicationContext
CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAME
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Constructor Summary
AbstractApplicationContext()
Create a new AbstractApplicationContext with no parent.
AbstractApplicationContext(ApplicationContext parent)
Create a new AbstractApplicationContext with the given parent context.
Method Summary
 void addApplicationListener(ApplicationListener listener)
Add a new ApplicationListener that will be notified on context events such as context refresh and context shutdown.
 void addBeanFactoryPostProcessor(BeanFactoryPostProcessor beanFactoryPostProcessor)
Add a new BeanFactoryPostProcessor that will get applied to the internal bean factory of this application context on refresh, before any of the bean definitions get evaluated.
protected  void addListener(ApplicationListener listener)
Deprecated. as of Spring 3.0, in favor of addApplicationListener(org.springframework.context.ApplicationListener)
protected  void cancelRefresh(BeansException ex)
Cancel this context's refresh attempt, resetting the active flag after an exception got thrown.
 void close()
Close this application context, destroying all beans in its bean factory.
protected abstract  void closeBeanFactory()
Subclasses must implement this method to release their internal bean factory.
 boolean containsBean(String name)
Does this bean factory contain a bean with the given name? More specifically, is BeanFactory.getBean(java.lang.String) able to obtain a bean instance for the given name?
 boolean containsBeanDefinition(String beanName)
Check if this bean factory contains a bean definition with the given name.
 boolean containsLocalBean(String name)
Return whether the local bean factory contains a bean of the given name, ignoring beans defined in ancestor contexts.
 void destroy()
DisposableBean callback for destruction of this instance.
protected  void destroyBeans()
Template method for destroying all beans that this context manages.
protected  void doClose()
Actually performs context closing: publishes a ContextClosedEvent and destroys the singletons in the bean factory of this application context.
<A extends Annotation>
A
findAnnotationOnBean(String beanName, Class<A> annotationType)
Find a Annotation of annotationType on the specified bean, traversing its interfaces and super classes if no annotation can be found on the given class itself.
protected  void finishBeanFactoryInitialization(ConfigurableListableBeanFactory beanFactory)
Finish the initialization of this context's bean factory, initializing all remaining singleton beans.
protected  void finishRefresh()
Finish the refresh of this context, invoking the LifecycleProcessor's onRefresh() method and publishing the ContextRefreshedEvent.
 String[] getAliases(String name)
Return the aliases for the given bean name, if any.
 Collection<ApplicationListener> getApplicationListeners()
Return the list of statically specified ApplicationListeners.
 AutowireCapableBeanFactory getAutowireCapableBeanFactory()
Return this context's internal bean factory as AutowireCapableBeanFactory, if already available.
<T> T
getBean(Class<T> requiredType)
Return the bean instance that uniquely matches the given object type, if any.
 Object getBean(String name)
Return an instance, which may be shared or independent, of the specified bean.
<T> T
getBean(String name, Class<T> requiredType)
Return an instance, which may be shared or independent, of the specified bean.
 Object getBean(String name, Object... args)
Return an instance, which may be shared or independent, of the specified bean.
 int getBeanDefinitionCount()
Return the number of beans defined in the factory.
 String[] getBeanDefinitionNames()
Return the names of all beans defined in this factory.
abstract  ConfigurableListableBeanFactory getBeanFactory()
Subclasses must return their internal bean factory here.
 List<BeanFactoryPostProcessor> getBeanFactoryPostProcessors()
Return the list of BeanFactoryPostProcessors that will get applied to the internal BeanFactory.
 String[] getBeanNamesForType(Class type)
Return the names of beans matching the given type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.
 String[] getBeanNamesForType(Class type, boolean includeNonSingletons, boolean allowEagerInit)
Return the names of beans matching the given type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.
<T> Map<String,T>
getBeansOfType(Class<T> type)
Return the bean instances that match the given object type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.
<T> Map<String,T>
getBeansOfType(Class<T> type, boolean includeNonSingletons, boolean allowEagerInit)
Return the bean instances that match the given object type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.
 Map<String,Object> getBeansWithAnnotation(Class<? extends Annotation> annotationType)
Find all beans whose Class has the supplied Annotation type.
 String getDisplayName()
Return a friendly name for this context.
 String getId()
Return the unique id of this application context.
protected  BeanFactory getInternalParentBeanFactory()
Return the internal bean factory of the parent context if it implements ConfigurableApplicationContext; else, return the parent context itself.
protected  MessageSource getInternalParentMessageSource()
Return the internal message source of the parent context if it is an AbstractApplicationContext too; else, return the parent context itself.
 String getMessage(MessageSourceResolvable resolvable, Locale locale)
Try to resolve the message using all the attributes contained within the MessageSourceResolvable argument that was passed in.
 String getMessage(String code, Object[] args, Locale locale)
Try to resolve the message.
 String getMessage(String code, Object[] args, String defaultMessage, Locale locale)
Try to resolve the message.
 ApplicationContext getParent()
Return the parent context, or null if there is no parent (that is, this context is the root of the context hierarchy).
 BeanFactory getParentBeanFactory()
Return the parent bean factory, or null if there is none.
protected  ResourcePatternResolver getResourcePatternResolver()
Return the ResourcePatternResolver to use for resolving location patterns into Resource instances.
 Resource[] getResources(String locationPattern)
Resolve the given location pattern into Resource objects.
 long getStartupDate()
Return the timestamp (ms) when this context was first loaded.
 Class<?> getType(String name)
Determine the type of the bean with the given name.
protected  void initApplicationEventMulticaster()
Initialize the ApplicationEventMulticaster.
protected  void initLifecycleProcessor()
Initialize the LifecycleProcessor.
protected  void initMessageSource()
Initialize the MessageSource.
protected  void invokeBeanFactoryPostProcessors(ConfigurableListableBeanFactory beanFactory)
Instantiate and invoke all registered BeanFactoryPostProcessor beans, respecting explicit order if given.
 boolean isActive()
Determine whether this application context is active, that is, whether it has been refreshed at least once and has not been closed yet.
 boolean isPrototype(String name)
Is this bean a prototype? That is, will BeanFactory.getBean(java.lang.String) always return independent instances?
 boolean isRunning()
Check whether this component is currently running.
 boolean isSingleton(String name)
Is this bean a shared singleton? That is, will BeanFactory.getBean(java.lang.String) always return the same instance?
 boolean isTypeMatch(String name, Class targetType)
Check whether the bean with the given name matches the specified type.
protected  ConfigurableListableBeanFactory obtainFreshBeanFactory()
Tell the subclass to refresh the internal bean factory.
protected  void onClose()
Template method which can be overridden to add context-specific shutdown work.
protected  void onRefresh()
Template method which can be overridden to add context-specific refresh work.
protected  void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
Modify the application context's internal bean factory after its standard initialization.
protected  void prepareBeanFactory(ConfigurableListableBeanFactory beanFactory)
Configure the factory's standard context characteristics, such as the context's ClassLoader and post-processors.
protected  void prepareRefresh()
Prepare this context for refreshing, setting its startup date and active flag.
 void publishEvent(ApplicationEvent event)
Publish the given event to all listeners.
 void refresh()
Load or refresh the persistent representation of the configuration, which might an XML file, properties file, or relational database schema.
protected abstract  void refreshBeanFactory()
Subclasses must implement this method to perform the actual configuration load.
protected  void registerBeanPostProcessors(ConfigurableListableBeanFactory beanFactory)
Instantiate and invoke all registered BeanPostProcessor beans, respecting explicit order if given.
protected  void registerListeners()
Add beans that implement ApplicationListener as listeners.
 void registerShutdownHook()
Register a shutdown hook with the JVM runtime, closing this context on JVM shutdown unless it has already been closed at that time.
 void setDisplayName(String displayName)
Set a friendly name for this context.
 void setId(String id)
Set the unique id of this application context.
 void setParent(ApplicationContext parent)
Set the parent of this application context.
 void start()
Start this component.
 void stop()
Stop this component.
 String toString()
Return information about this context.
Methods inherited from class org.springframework.core.io.DefaultResourceLoader
getClassLoader, getResource, getResourceByPath, setClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.core.io.ResourceLoader
getClassLoader, getResource

Field Detail

MESSAGE_SOURCE_BEAN_NAME

public static final String MESSAGE_SOURCE_BEAN_NAME
Name of the MessageSource bean in the factory. If none is supplied, message resolution is delegated to the parent.

See Also:
MessageSource, Constant Field Values

LIFECYCLE_PROCESSOR_BEAN_NAME

public static final String LIFECYCLE_PROCESSOR_BEAN_NAME
Name of the LifecycleProcessor bean in the factory. If none is supplied, a DefaultLifecycleProcessor is used.

See Also:
LifecycleProcessor, DefaultLifecycleProcessor, Constant Field Values

APPLICATION_EVENT_MULTICASTER_BEAN_NAME

public static final String APPLICATION_EVENT_MULTICASTER_BEAN_NAME
Name of the ApplicationEventMulticaster bean in the factory. If none is supplied, a default SimpleApplicationEventMulticaster is used.

See Also:
ApplicationEventMulticaster, SimpleApplicationEventMulticaster, Constant Field Values

logger

protected final Log logger
Logger used by this class. Available to subclasses.

Constructor Detail

AbstractApplicationContext

public AbstractApplicationContext()
Create a new AbstractApplicationContext with no parent.

AbstractApplicationContext

public AbstractApplicationContext(ApplicationContext parent)
Create a new AbstractApplicationContext with the given parent context.

Parameters:
parent - the parent context
Method Detail

setId

public void setId(String id)
Set the unique id of this application context.

Default is the object id of the context instance, or the name of the context bean if the context is itself defined as a bean.

Specified by:
setId in interface ConfigurableApplicationContext
Parameters:
id - the unique id of the context

getId

public String getId()
Return the unique id of this application context.

Specified by:
getId in interface ApplicationContext
Returns:
the unique id of the context, or null if none

setDisplayName

public void setDisplayName(String displayName)
Set a friendly name for this context. Typically done during initialization of concrete context implementations.

Default is the object id of the context instance.

getDisplayName

public String getDisplayName()
Return a friendly name for this context.

Specified by:
getDisplayName in interface ApplicationContext
Returns:
a display name for this context (never null)

getParent

public ApplicationContext getParent()
Return the parent context, or null if there is no parent (that is, this context is the root of the context hierarchy).

Specified by:
getParent in interface ApplicationContext
Returns:
the parent context, or null if there is no parent

getAutowireCapableBeanFactory

public AutowireCapableBeanFactory getAutowireCapableBeanFactory()
                                                         throws IllegalStateException
Return this context's internal bean factory as AutowireCapableBeanFactory, if already available.

Specified by:
getAutowireCapableBeanFactory in interface ApplicationContext
Returns:
the AutowireCapableBeanFactory for this context
Throws:
IllegalStateException - if the context does not support the AutowireCapableBeanFactory interface or does not hold an autowire-capable bean factory yet (usually if refresh() has never been called)
See Also:
getBeanFactory()

getStartupDate

public long getStartupDate()
Return the timestamp (ms) when this context was first loaded.

Specified by:
getStartupDate in interface ApplicationContext
Returns:
the timestamp (ms) when this context was first loaded

publishEvent

public void publishEvent(ApplicationEvent event)
Publish the given event to all listeners.

Note: Listeners get initialized after the MessageSource, to be able to access it within listener implementations. Thus, MessageSource implementations cannot publish events.

Specified by:
publishEvent in interface ApplicationEventPublisher
Parameters:
event - the event to publish (may be application-specific or a standard framework event)
See Also:
RequestHandledEvent

getResourcePatternResolver

protected ResourcePatternResolver getResourcePatternResolver()
Return the ResourcePatternResolver to use for resolving location patterns into Resource instances. Default is a PathMatchingResourcePatternResolver, supporting Ant-style location patterns.

Can be overridden in subclasses, for extended resolution strategies, for example in a web environment.

Do not call this when needing to resolve a location pattern. Call the context's getResources method instead, which will delegate to the ResourcePatternResolver.

Returns:
the ResourcePatternResolver for this context
See Also:
getResources(java.lang.String), PathMatchingResourcePatternResolver

setParent

public void setParent(ApplicationContext parent)
Description copied from interface: ConfigurableApplicationContext
Set the parent of this application context.

Note that the parent shouldn't be changed: It should only be set outside a constructor if it isn't available when an object of this class is created, for example in case of WebApplicationContext setup.

Specified by:
setParent in interface ConfigurableApplicationContext
Parameters:
parent - the parent context
See Also:
ConfigurableWebApplicationContext

addBeanFactoryPostProcessor

public void addBeanFactoryPostProcessor(BeanFactoryPostProcessor beanFactoryPostProcessor)
Description copied from interface: ConfigurableApplicationContext
Add a new BeanFactoryPostProcessor that will get applied to the internal bean factory of this application context on refresh, before any of the bean definitions get evaluated. To be invoked during context configuration.

Specified by:
addBeanFactoryPostProcessor in interface ConfigurableApplicationContext
Parameters:
beanFactoryPostProcessor - the factory processor to register

getBeanFactoryPostProcessors

public List<BeanFactoryPostProcessor> getBeanFactoryPostProcessors()
Return the list of BeanFactoryPostProcessors that will get applied to the internal BeanFactory.

addApplicationListener

public void addApplicationListener(ApplicationListener listener)
Description copied from interface: ConfigurableApplicationContext
Add a new ApplicationListener that will be notified on context events such as context refresh and context shutdown.

Note that any ApplicationListener registered here will be applied on refresh if the context is not active yet, or on the fly with the current event multicaster in case of a context that is already active.

Specified by:
addApplicationListener in interface ConfigurableApplicationContext
Parameters:
listener - the ApplicationListener to register
See Also:
ContextRefreshedEvent, ContextClosedEvent

getApplicationListeners

public Collection<ApplicationListener> getApplicationListeners()
Return the list of statically specified ApplicationListeners.

refresh

public void refresh()
             throws BeansException,
                    IllegalStateException
Description copied from interface: ConfigurableApplicationContext
Load or refresh the persistent representation of the configuration, which might an XML file, properties file, or relational database schema.

As this is a startup method, it should destroy already created singletons if it fails, to avoid dangling resources. In other words, after invocation of that method, either all or no singletons at all should be instantiated.

Specified by:
refresh in interface ConfigurableApplicationContext
Throws:
BeansException - if the bean factory could not be initialized
IllegalStateException - if already initialized and multiple refresh attempts are not supported

prepareRefresh

protected void prepareRefresh()
Prepare this context for refreshing, setting its startup date and active flag.

obtainFreshBeanFactory

protected ConfigurableListableBeanFactory obtainFreshBeanFactory()
Tell the subclass to refresh the internal bean factory.

Returns:
the fresh BeanFactory instance
See Also:
refreshBeanFactory(), getBeanFactory()

prepareBeanFactory

protected void prepareBeanFactory(ConfigurableListableBeanFactory beanFactory)
Configure the factory's standard context characteristics, such as the context's ClassLoader and post-processors.

Parameters:
beanFactory - the BeanFactory to configure

postProcessBeanFactory

protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
Modify the application context's internal bean factory after its standard initialization. All bean definitions will have been loaded, but no beans will have been instantiated yet. This allows for registering special BeanPostProcessors etc in certain ApplicationContext implementations.

Parameters:
beanFactory - the bean factory used by the application context

invokeBeanFactoryPostProcessors

protected void invokeBeanFactoryPostProcessors(ConfigurableListableBeanFactory beanFactory)
Instantiate and invoke all registered BeanFactoryPostProcessor beans, respecting explicit order if given.

Must be called before singleton instantiation.

registerBeanPostProcessors

protected void registerBeanPostProcessors(ConfigurableListableBeanFactory beanFactory)
Instantiate and invoke all registered BeanPostProcessor beans, respecting explicit order if given.

Must be called before any instantiation of application beans.

initMessageSource

protected void initMessageSource()
Initialize the MessageSource. Use parent's if none defined in this context.

initApplicationEventMulticaster

protected void initApplicationEventMulticaster()
Initialize the ApplicationEventMulticaster. Uses SimpleApplicationEventMulticaster if none defined in the context.

See Also:
SimpleApplicationEventMulticaster

initLifecycleProcessor

protected void initLifecycleProcessor()
Initialize the LifecycleProcessor. Uses DefaultLifecycleProcessor if none defined in the context.

See Also:
DefaultLifecycleProcessor

onRefresh

protected void onRefresh()
                  throws BeansException
Template method which can be overridden to add context-specific refresh work. Called on initialization of special beans, before instantiation of singletons.

This implementation is empty.

Throws:
BeansException - in case of errors
See Also:
refresh()

registerListeners

protected void registerListeners()
Add beans that implement ApplicationListener as listeners. Doesn't affect other listeners, which can be added without being beans.

addListener

@Deprecated
protected void addListener(ApplicationListener listener)
Deprecated. as of Spring 3.0, in favor of addApplicationListener(org.springframework.context.ApplicationListener)

Subclasses can invoke this method to register a listener. Any beans in the context that are listeners are automatically added.

Note: This method only works within an active application context, i.e. when an ApplicationEventMulticaster is already available. Generally prefer the use of addApplicationListener(org.springframework.context.ApplicationListener) which is more flexible.

Parameters:
listener - the listener to register

finishBeanFactoryInitialization

protected void finishBeanFactoryInitialization(ConfigurableListableBeanFactory beanFactory)
Finish the initialization of this context's bean factory, initializing all remaining singleton beans.

finishRefresh

protected void finishRefresh()
Finish the refresh of this context, invoking the LifecycleProcessor's onRefresh() method and publishing the ContextRefreshedEvent.

cancelRefresh

protected void cancelRefresh(BeansException ex)
Cancel this context's refresh attempt, resetting the active flag after an exception got thrown.

Parameters:
ex - the exception that led to the cancellation

registerShutdownHook

public void registerShutdownHook()
Register a shutdown hook with the JVM runtime, closing this context on JVM shutdown unless it has already been closed at that time.

Delegates to doClose() for the actual closing procedure.

Specified by:
registerShutdownHook in interface ConfigurableApplicationContext
See Also:
Runtime.addShutdownHook(java.lang.Thread),
close(),
doClose()

destroy

public void destroy()
DisposableBean callback for destruction of this instance. Only called when the ApplicationContext itself is running as a bean in another BeanFactory or ApplicationContext, which is rather unusual.

The close method is the native way to shut down an ApplicationContext.

Specified by:
destroy in interface DisposableBean
See Also:
close(), SingletonBeanFactoryLocator

close

public void close()
Close this application context, destroying all beans in its bean factory.

Delegates to doClose() for the actual closing procedure. Also removes a JVM shutdown hook, if registered, as it's not needed anymore.

Specified by:
close in interface ConfigurableApplicationContext
See Also:
doClose(), registerShutdownHook()

doClose

protected void doClose()
Actually performs context closing: publishes a ContextClosedEvent and destroys the singletons in the bean factory of this application context.

Called by both close() and a JVM shutdown hook, if any.

See Also:
ContextClosedEvent,
destroyBeans(),
close(),
registerShutdownHook()

destroyBeans

protected void destroyBeans()
Template method for destroying all beans that this context manages. The default implementation destroy all cached singletons in this context, invoking DisposableBean.destroy() and/or the specified "destroy-method".

Can be overridden to add context-specific bean destruction steps right before or right after standard singleton destruction, while the context's BeanFactory is still active.

See Also:
getBeanFactory(), ConfigurableBeanFactory.destroySingletons()

onClose

protected void onClose()
Template method which can be overridden to add context-specific shutdown work. The default implementation is empty.

Called at the end of doClose()'s shutdown procedure, after this context's BeanFactory has been closed. If custom shutdown logic needs to execute while the BeanFactory is still active, override the destroyBeans() method instead.

isActive

public boolean isActive()
Description copied from interface: ConfigurableApplicationContext
Determine whether this application context is active, that is, whether it has been refreshed at least once and has not been closed yet.

Specified by:
isActive in interface ConfigurableApplicationContext
Returns:
whether the context is still active
See Also:
ConfigurableApplicationContext.refresh(),
ConfigurableApplicationContext.close(),
ConfigurableApplicationContext.getBeanFactory()

getBean

public Object getBean(String name)
               throws BeansException
Description copied from interface: BeanFactory
Return an instance, which may be shared or independent, of the specified bean.

This method allows a Spring BeanFactory to be used as a replacement for the Singleton or Prototype design pattern. Callers may retain references to returned objects in the case of Singleton beans.

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Specified by:
getBean in interface BeanFactory
Parameters:
name - the name of the bean to retrieve
Returns:
an instance of the bean
Throws:
NoSuchBeanDefinitionException - if there is no bean definition with the specified name
BeansException - if the bean could not be obtained

getBean

public <T> T getBean(String name,
                     Class<T> requiredType)
          throws BeansException
Description copied from interface: BeanFactory
Return an instance, which may be shared or independent, of the specified bean.

Behaves the same as BeanFactory.getBean(String), but provides a measure of type safety by throwing a BeanNotOfRequiredTypeException if the bean is not of the required type. This means that ClassCastException can't be thrown on casting the result correctly, as can happen with BeanFactory.getBean(String).

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Specified by:
getBean in interface BeanFactory
Parameters:
name - the name of the bean to retrieve
requiredType - type the bean must match. Can be an interface or superclass of the actual class, or null for any match. For example, if the value is Object.class, this method will succeed whatever the class of the returned instance.
Returns:
an instance of the bean
Throws:
NoSuchBeanDefinitionException - if there's no such bean definition
BeanNotOfRequiredTypeException - if the bean is not of the required type
BeansException - if the bean could not be created

getBean

public <T> T getBean(Class<T> requiredType)
          throws BeansException
Description copied from interface: BeanFactory
Return the bean instance that uniquely matches the given object type, if any.

Specified by:
getBean in interface BeanFactory
Parameters:
requiredType - type the bean must match; can be an interface or superclass. null is disallowed.

This method goes into ListableBeanFactory by-type lookup territory but may also be translated into a conventional by-name lookup based on the name of the given type. For more extensive retrieval operations across sets of beans, use ListableBeanFactory and/or BeanFactoryUtils.

Returns:
an instance of the single bean matching the required type
Throws:
NoSuchBeanDefinitionException - if there is not exactly one matching bean found
BeansException
See Also:
ListableBeanFactory

getBean

public Object getBean(String name,
                      Object... args)
               throws BeansException
Description copied from interface: BeanFactory
Return an instance, which may be shared or independent, of the specified bean.

Allows for specifying explicit constructor arguments / factory method arguments, overriding the specified default arguments (if any) in the bean definition.

Specified by:
getBean in interface BeanFactory
Parameters:
name - the name of the bean to retrieve
args - arguments to use if creating a prototype using explicit arguments to a static factory method. It is invalid to use a non-null args value in any other case.
Returns:
an instance of the bean
Throws:
NoSuchBeanDefinitionException - if there's no such bean definition
BeanDefinitionStoreException - if arguments have been given but the affected bean isn't a prototype
BeansException - if the bean could not be created

containsBean

public boolean containsBean(String name)
Description copied from interface: BeanFactory
Does this bean factory contain a bean with the given name? More specifically, is BeanFactory.getBean(java.lang.String) able to obtain a bean instance for the given name?

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Specified by:
containsBean in interface BeanFactory
Parameters:
name - the name of the bean to query
Returns:
whether a bean with the given name is defined

isSingleton

public boolean isSingleton(String name)
                    throws NoSuchBeanDefinitionException
Description copied from interface: BeanFactory
Is this bean a shared singleton? That is, will BeanFactory.getBean(java.lang.String) always return the same instance?

Note: This method returning false does not clearly indicate independent instances. It indicates non-singleton instances, which may correspond to a scoped bean as well. Use the BeanFactory.isPrototype(java.lang.String) operation to explicitly check for independent instances.

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Specified by:
isSingleton in interface BeanFactory
Parameters:
name - the name of the bean to query
Returns:
whether this bean corresponds to a singleton instance
Throws:
NoSuchBeanDefinitionException - if there is no bean with the given name
See Also:
BeanFactory.getBean(java.lang.String), BeanFactory.isPrototype(java.lang.String)

isPrototype

public boolean isPrototype(String name)
                    throws NoSuchBeanDefinitionException
Description copied from interface: BeanFactory
Is this bean a prototype? That is, will BeanFactory.getBean(java.lang.String) always return independent instances?

Note: This method returning false does not clearly indicate a singleton object. It indicates non-independent instances, which may correspond to a scoped bean as well. Use the BeanFactory.isSingleton(java.lang.String) operation to explicitly check for a shared singleton instance.

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Specified by:
isPrototype in interface BeanFactory
Parameters:
name - the name of the bean to query
Returns:
whether this bean will always deliver independent instances
Throws:
NoSuchBeanDefinitionException - if there is no bean with the given name
See Also:
BeanFactory.getBean(java.lang.String), BeanFactory.isSingleton(java.lang.String)

isTypeMatch

public boolean isTypeMatch(String name,
                           Class targetType)
                    throws NoSuchBeanDefinitionException
Description copied from interface: BeanFactory
Check whether the bean with the given name matches the specified type. More specifically, check whether a BeanFactory.getBean(java.lang.String) call for the given name would return an object that is assignable to the specified target type.

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Specified by:
isTypeMatch in interface BeanFactory
Parameters:
name - the name of the bean to query
targetType - the type to match against
Returns:
true if the bean type matches, false if it doesn't match or cannot be determined yet
Throws:
NoSuchBeanDefinitionException - if there is no bean with the given name
See Also:
BeanFactory.getBean(java.lang.String), BeanFactory.getType(java.lang.String)

getType

public Class<?> getType(String name)
                 throws NoSuchBeanDefinitionException
Description copied from interface: BeanFactory
Determine the type of the bean with the given name. More specifically, determine the type of object that BeanFactory.getBean(java.lang.String) would return for the given name.

For a FactoryBean, return the type of object that the FactoryBean creates, as exposed by FactoryBean.getObjectType().

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Specified by:
getType in interface BeanFactory
Parameters:
name - the name of the bean to query
Returns:
the type of the bean, or null if not determinable
Throws:
NoSuchBeanDefinitionException - if there is no bean with the given name
See Also:
BeanFactory.getBean(java.lang.String), BeanFactory.isTypeMatch(java.lang.String, java.lang.Class)

getAliases

public String[] getAliases(String name)
Description copied from interface: BeanFactory
Return the aliases for the given bean name, if any. All of those aliases point to the same bean when used in a BeanFactory.getBean(java.lang.String) call.

If the given name is an alias, the corresponding original bean name and other aliases (if any) will be returned, with the original bean name being the first element in the array.

Will ask the parent factory if the bean cannot be found in this factory instance.

Specified by:
getAliases in interface BeanFactory
Parameters:
name - the bean name to check for aliases
Returns:
the aliases, or an empty array if none
See Also:
BeanFactory.getBean(java.lang.String)

containsBeanDefinition

public boolean containsBeanDefinition(String beanName)
Description copied from interface: ListableBeanFactory
Check if this bean factory contains a bean definition with the given name.

Does not consider any hierarchy this factory may participate in, and ignores any singleton beans that have been registered by other means than bean definitions.

Specified by:
containsBeanDefinition in interface ListableBeanFactory
Parameters:
beanName - the name of the bean to look for
Returns:
if this bean factory contains a bean definition with the given name
See Also:
BeanFactory.containsBean(java.lang.String)

getBeanDefinitionCount

public int getBeanDefinitionCount()
Description copied from interface: ListableBeanFactory
Return the number of beans defined in the factory.

Does not consider any hierarchy this factory may participate in, and ignores any singleton beans that have been registered by other means than bean definitions.

Specified by:
getBeanDefinitionCount in interface ListableBeanFactory
Returns:
the number of beans defined in the factory

getBeanDefinitionNames

public String[] getBeanDefinitionNames()
Description copied from interface: ListableBeanFactory
Return the names of all beans defined in this factory.

Does not consider any hierarchy this factory may participate in, and ignores any singleton beans that have been registered by other means than bean definitions.

Specified by:
getBeanDefinitionNames in interface ListableBeanFactory
Returns:
the names of all beans defined in this factory, or an empty array if none defined

getBeanNamesForType

public String[] getBeanNamesForType(Class type)
Description copied from interface: ListableBeanFactory
Return the names of beans matching the given type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.

NOTE: This method introspects top-level beans only. It does not check nested beans which might match the specified type as well.

Does consider objects created by FactoryBeans, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type.

Does not consider any hierarchy this factory may participate in. Use BeanFactoryUtils' beanNamesForTypeIncludingAncestors to include beans in ancestor factories too.

Note: Does not ignore singleton beans that have been registered by other means than bean definitions.

This version of getBeanNamesForType matches all kinds of beans, be it singletons, prototypes, or FactoryBeans. In most implementations, the result will be the same as for getBeanNamesOfType(type, true, true).

Bean names returned by this method should always return bean names in the order of definition in the backend configuration, as far as possible.

Specified by:
getBeanNamesForType in interface ListableBeanFactory
Parameters:
type - the class or interface to match, or null for all bean names
Returns:
the names of beans (or objects created by FactoryBeans) matching the given object type (including subclasses), or an empty array if none
See Also:
FactoryBean.getObjectType(), BeanFactoryUtils.beanNamesForTypeIncludingAncestors(ListableBeanFactory, Class)

getBeanNamesForType

public String[] getBeanNamesForType(Class type,
                                    boolean includeNonSingletons,
                                    boolean allowEagerInit)
Description copied from interface: ListableBeanFactory
Return the names of beans matching the given type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.

NOTE: This method introspects top-level beans only. It does not check nested beans which might match the specified type as well.

Does consider objects created by FactoryBeans if the "allowEagerInit" flag is set, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type. If "allowEagerInit" is not set, only raw FactoryBeans will be checked (which doesn't require initialization of each FactoryBean). $ *

Does not consider any hierarchy this factory may participate in. Use BeanFactoryUtils' beanNamesForTypeIncludingAncestors to include beans in ancestor factories too.

Note: Does not ignore singleton beans that have been registered by other means than bean definitions.

Bean names returned by this method should always return bean names in the order of definition in the backend configuration, as far as possible.

Specified by:
getBeanNamesForType in interface ListableBeanFactory
Parameters:
type - the class or interface to match, or null for all bean names
includeNonSingletons - whether to include prototype or scoped beans too or just singletons (also applies to FactoryBeans)
allowEagerInit - whether to initialize lazy-init singletons and objects created by FactoryBeans (or by factory methods with a "factory-bean" reference) for the type check. Note that FactoryBeans need to be eagerly initialized to determine their type: So be aware that passing in "true" for this flag will initialize FactoryBeans and "factory-bean" references.
Returns:
the names of beans (or objects created by FactoryBeans) matching the given object type (including subclasses), or an empty array if none
See Also:
FactoryBean.getObjectType(), BeanFactoryUtils.beanNamesForTypeIncludingAncestors(ListableBeanFactory, Class, boolean, boolean)

getBeansOfType

public <T> Map<String,T> getBeansOfType(Class<T> type)
                             throws BeansException
Description copied from interface: ListableBeanFactory
Return the bean instances that match the given object type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.

NOTE: This method introspects top-level beans only. It does not check nested beans which might match the specified type as well.

Does consider objects created by FactoryBeans, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type.

Does not consider any hierarchy this factory may participate in. Use BeanFactoryUtils' beansOfTypeIncludingAncestors to include beans in ancestor factories too.

Note: Does not ignore singleton beans that have been registered by other means than bean definitions.

This version of getBeansOfType matches all kinds of beans, be it singletons, prototypes, or FactoryBeans. In most implementations, the result will be the same as for getBeansOfType(type, true, true).

The Map returned by this method should always return bean names and corresponding bean instances in the order of definition in the backend configuration, as far as possible.

Specified by:
getBeansOfType in interface ListableBeanFactory
Parameters:
type - the class or interface to match, or null for all concrete beans
Returns:
a Map with the matching beans, containing the bean names as keys and the corresponding bean instances as values
Throws:
BeansException - if a bean could not be created
See Also:
FactoryBean.getObjectType(), BeanFactoryUtils.beansOfTypeIncludingAncestors(ListableBeanFactory, Class)

getBeansOfType

public <T> Map<String,T> getBeansOfType(Class<T> type,
                                        boolean includeNonSingletons,
                                        boolean allowEagerInit)
                             throws BeansException
Description copied from interface: ListableBeanFactory
Return the bean instances that match the given object type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.

NOTE: This method introspects top-level beans only. It does not check nested beans which might match the specified type as well.

Does consider objects created by FactoryBeans if the "allowEagerInit" flag is set, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type. If "allowEagerInit" is not set, only raw FactoryBeans will be checked (which doesn't require initialization of each FactoryBean).

Does not consider any hierarchy this factory may participate in. Use BeanFactoryUtils' beansOfTypeIncludingAncestors to include beans in ancestor factories too.

Note: Does not ignore singleton beans that have been registered by other means than bean definitions.

The Map returned by this method should always return bean names and corresponding bean instances in the order of definition in the backend configuration, as far as possible.

Specified by:
getBeansOfType in interface ListableBeanFactory
Parameters:
type - the class or interface to match, or null for all concrete beans
includeNonSingletons - whether to include prototype or scoped beans too or just singletons (also applies to FactoryBeans)
allowEagerInit - whether to initialize lazy-init singletons and objects created by FactoryBeans (or by factory methods with a "factory-bean" reference) for the type check. Note that FactoryBeans need to be eagerly initialized to determine their type: So be aware that passing in "true" for this flag will initialize FactoryBeans and "factory-bean" references.
Returns:
a Map with the matching beans, containing the bean names as keys and the corresponding bean instances as values
Throws:
BeansException - if a bean could not be created
See Also:
FactoryBean.getObjectType(), BeanFactoryUtils.beansOfTypeIncludingAncestors(ListableBeanFactory, Class, boolean, boolean)

getBeansWithAnnotation

public Map<String,Object> getBeansWithAnnotation(Class<? extends Annotation> annotationType)
                                          throws BeansException
Description copied from interface: ListableBeanFactory
Find all beans whose Class has the supplied Annotation type.

Specified by:
getBeansWithAnnotation in interface ListableBeanFactory
Parameters:
annotationType - the type of annotation to look for
Returns:
a Map with the matching beans, containing the bean names as keys and the corresponding bean instances as values
Throws:
BeansException - if a bean could not be created

findAnnotationOnBean

public <A extends Annotation> A findAnnotationOnBean(String beanName,
                                                     Class<A> annotationType)
Description copied from interface: ListableBeanFactory
Find a Annotation of annotationType on the specified bean, traversing its interfaces and super classes if no annotation can be found on the given class itself.

Specified by:
findAnnotationOnBean in interface ListableBeanFactory
Parameters:
beanName - the name of the bean to look for annotations on
annotationType - the annotation class to look for
Returns:
the annotation of the given type found, or null

getParentBeanFactory

public BeanFactory getParentBeanFactory()
Description copied from interface: HierarchicalBeanFactory
Return the parent bean factory, or null if there is none.

Specified by:
getParentBeanFactory in interface HierarchicalBeanFactory

containsLocalBean

public boolean containsLocalBean(String name)
Description copied from interface: HierarchicalBeanFactory
Return whether the local bean factory contains a bean of the given name, ignoring beans defined in ancestor contexts.

This is an alternative to containsBean, ignoring a bean of the given name from an ancestor bean factory.

Specified by:
containsLocalBean in interface HierarchicalBeanFactory
Parameters:
name - the name of the bean to query
Returns:
whether a bean with the given name is defined in the local factory
See Also:
BeanFactory.containsBean(java.lang.String)

getInternalParentBeanFactory

protected BeanFactory getInternalParentBeanFactory()
Return the internal bean factory of the parent context if it implements ConfigurableApplicationContext; else, return the parent context itself.

See Also:
ConfigurableApplicationContext.getBeanFactory()

getMessage

public String getMessage(String code,
                         Object[] args,
                         String defaultMessage,
                         Locale locale)
Description copied from interface: MessageSource
Try to resolve the message. Return default message if no message was found.

Specified by:
getMessage in interface MessageSource
Parameters:
code - the code to lookup up, such as 'calculator.noRateSet'. Users of this class are encouraged to base message names on the relevant fully qualified class name, thus avoiding conflict and ensuring maximum clarity.
args - array of arguments that will be filled in for params within the message (params look like "{0}", "{1,date}", "{2,time}" within a message), or null if none.
defaultMessage - String to return if the lookup fails
locale - the Locale in which to do the lookup
Returns:
the resolved message if the lookup was successful; otherwise the default message passed as a parameter
See Also:
MessageFormat

getMessage

public String getMessage(String code,
                         Object[] args,
                         Locale locale)
                  throws NoSuchMessageException
Description copied from interface: MessageSource
Try to resolve the message. Treat as an error if the message can't be found.

Specified by:
getMessage in interface MessageSource
Parameters:
code - the code to lookup up, such as 'calculator.noRateSet'
args - Array of arguments that will be filled in for params within the message (params look like "{0}", "{1,date}", "{2,time}" within a message), or null if none.
locale - the Locale in which to do the lookup
Returns:
the resolved message
Throws:
NoSuchMessageException - if the message wasn't found
See Also:
MessageFormat

getMessage

public String getMessage(MessageSourceResolvable resolvable,
                         Locale locale)
                  throws NoSuchMessageException
Description copied from interface: MessageSource
Try to resolve the message using all the attributes contained within the MessageSourceResolvable argument that was passed in.

NOTE: We must throw a NoSuchMessageException on this method since at the time of calling this method we aren't able to determine if the defaultMessage property of the resolvable is null or not.

Specified by:
getMessage in interface MessageSource
Parameters:
resolvable - value object storing attributes required to properly resolve a message
locale - the Locale in which to do the lookup
Returns:
the resolved message
Throws:
NoSuchMessageException - if the message wasn't found
See Also:
MessageFormat

getInternalParentMessageSource

protected MessageSource getInternalParentMessageSource()
Return the internal message source of the parent context if it is an AbstractApplicationContext too; else, return the parent context itself.

getResources

public Resource[] getResources(String locationPattern)
                        throws IOException
Description copied from interface: ResourcePatternResolver
Resolve the given location pattern into Resource objects.

Overlapping resource entries that point to the same physical resource should be avoided, as far as possible. The result should have set semantics.

Specified by:
getResources in interface ResourcePatternResolver
Parameters:
locationPattern - the location pattern to resolve
Returns:
the corresponding Resource objects
Throws:
IOException - in case of I/O errors

start

public void start()
Description copied from interface: Lifecycle
Start this component. Should not throw an exception if the component is already running.

In the case of a container, this will propagate the start signal to all components that apply.

Specified by:
start in interface Lifecycle

stop

public void stop()
Description copied from interface: Lifecycle
Stop this component. Should not throw an exception if the component isn't started yet.

In the case of a container, this will propagate the stop signal to all components that apply.

Specified by:
stop in interface Lifecycle

isRunning

public boolean isRunning()
Description copied from interface: Lifecycle
Check whether this component is currently running.

In the case of a container, this will return true only if all components that apply are currently running.

Specified by:
isRunning in interface Lifecycle
Returns:
whether the component is currently running

refreshBeanFactory

protected abstract void refreshBeanFactory()
                                    throws BeansException,
                                           IllegalStateException
Subclasses must implement this method to perform the actual configuration load. The method is invoked by refresh() before any other initialization work.

A subclass will either create a new bean factory and hold a reference to it, or return a single BeanFactory instance that it holds. In the latter case, it will usually throw an IllegalStateException if refreshing the context more than once.

Throws:
BeansException - if initialization of the bean factory failed
IllegalStateException - if already initialized and multiple refresh attempts are not supported

closeBeanFactory

protected abstract void closeBeanFactory()
Subclasses must implement this method to release their internal bean factory. This method gets invoked by close() after all other shutdown work.

Should never throw an exception but rather log shutdown failures.

getBeanFactory

public abstract ConfigurableListableBeanFactory getBeanFactory()
                                                        throws IllegalStateException
Subclasses must return their internal bean factory here. They should implement the lookup efficiently, so that it can be called repeatedly without a performance penalty.

Note: Subclasses should check whether the context is still active before returning the internal bean factory. The internal factory should generally be considered unavailable once the context has been closed.

Specified by:
getBeanFactory in interface ConfigurableApplicationContext
Returns:
this application context's internal bean factory (never null)
Throws:
IllegalStateException - if the context does not hold an internal bean factory yet (usually if refresh() has never been called) or if the context has been closed already
See Also:
refreshBeanFactory(), closeBeanFactory()

toString

public String toString()
Return information about this context.

Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractMessageSource

org.springframework.context.support
Class AbstractMessageSource

java.lang.Object
    extended by  org.springframework.context.support.MessageSourceSupport
        extended by  org.springframework.context.support.AbstractMessageSource
All Implemented Interfaces:
HierarchicalMessageSource, MessageSource
Direct Known Subclasses:
ReloadableResourceBundleMessageSource, ResourceBundleMessageSource, StaticMessageSource
public abstract class AbstractMessageSource
extends MessageSourceSupport
implements HierarchicalMessageSource

Abstract implementation of the HierarchicalMessageSource interface, implementing common handling of message variants, making it easy to implement a specific strategy for a concrete MessageSource.

Subclasses must implement the abstract resolveCode(java.lang.String, java.util.Locale) method. For efficient resolution of messages without arguments, the resolveCodeWithoutArguments(java.lang.String, java.util.Locale) method should be overridden as well, resolving messages without a MessageFormat being involved.

Note: By default, message texts are only parsed through MessageFormat if arguments have been passed in for the message. In case of no arguments, message texts will be returned as-is. As a consequence, you should only use MessageFormat escaping for messages with actual arguments, and keep all other messages unescaped. If you prefer to escape all messages, set the "alwaysUseMessageFormat" flag to "true".

Supports not only MessageSourceResolvables as primary messages but also resolution of message arguments that are in turn MessageSourceResolvables themselves.

This class does not implement caching of messages per code, thus subclasses can dynamically change messages over time. Subclasses are encouraged to cache their messages in a modification-aware fashion, allowing for hot deployment of updated messages.

Author:
Juergen Hoeller, Rod Johnson
See Also:
resolveCode(String, java.util.Locale),
resolveCodeWithoutArguments(String, java.util.Locale),
MessageSourceSupport.setAlwaysUseMessageFormat(boolean),
MessageFormat

Field Summary
Fields inherited from class org.springframework.context.support.MessageSourceSupport
logger
Constructor Summary
AbstractMessageSource()
Method Summary
protected String | getDefaultMessage(String code) Return a fallback default message for the given code, if any.
String | getMessage(MessageSourceResolvable resolvable, Locale locale) Try to resolve the message using all the attributes contained within the MessageSourceResolvable argument that was passed in.
String | getMessage(String code, Object[] args, Locale locale) Try to resolve the message.
String | getMessage(String code, Object[] args, String defaultMessage, Locale locale) Try to resolve the message.
protected String | getMessageFromParent(String code, Object[] args, Locale locale) Try to retrieve the given message from the parent MessageSource, if any.
protected String | getMessageInternal(String code, Object[] args, Locale locale) Resolve the given code and arguments as message in the given Locale, returning null if not found.
MessageSource | getParentMessageSource() Return the parent of this MessageSource, or null if none.
protected boolean | isUseCodeAsDefaultMessage() Return whether to use the message code as default message instead of throwing a NoSuchMessageException.
protected String | renderDefaultMessage(String defaultMessage, Object[] args, Locale locale) Render the given default message String.
protected Object[] | resolveArguments(Object[] args, Locale locale) Searches through the given array of objects, finds any MessageSourceResolvable objects and resolves them.
protected abstract MessageFormat | resolveCode(String code, Locale locale) Subclasses must implement this method to resolve a message.
protected String | resolveCodeWithoutArguments(String code, Locale locale) Subclasses can override this method to resolve a message without arguments in an optimized fashion, i.e.
void | setParentMessageSource(MessageSource parent) Set the parent that will be used to try to resolve messages that this object can't resolve.
void | setUseCodeAsDefaultMessage(boolean useCodeAsDefaultMessage) Set whether to use the message code as default message instead of throwing a NoSuchMessageException.
Methods inherited from class org.springframework.context.support.MessageSourceSupport
createMessageFormat, formatMessage, isAlwaysUseMessageFormat, setAlwaysUseMessageFormat
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractMessageSource

public AbstractMessageSource()
Method Detail

setParentMessageSource

public void setParentMessageSource(MessageSource parent)
Description copied from interface: HierarchicalMessageSource
Set the parent that will be used to try to resolve messages that this object can't resolve.

Specified by:
setParentMessageSource in interface HierarchicalMessageSource
Parameters:
parent - the parent MessageSource that will be used to resolve messages that this object can't resolve. May be null, in which case no further resolution is possible.

getParentMessageSource

public MessageSource getParentMessageSource()
Description copied from interface: HierarchicalMessageSource
Return the parent of this MessageSource, or null if none.

Specified by:
getParentMessageSource in interface HierarchicalMessageSource

setUseCodeAsDefaultMessage

public void setUseCodeAsDefaultMessage(boolean useCodeAsDefaultMessage)
Set whether to use the message code as default message instead of throwing a NoSuchMessageException. Useful for development and debugging. Default is "false".

Note: In case of a MessageSourceResolvable with multiple codes (like a FieldError) and a MessageSource that has a parent MessageSource, do not activate "useCodeAsDefaultMessage" in the parent: Else, you'll get the first code returned as message by the parent, without attempts to check further codes.

To be able to work with "useCodeAsDefaultMessage" turned on in the parent, AbstractMessageSource and AbstractApplicationContext contain special checks to delegate to the internal getMessageInternal(java.lang.String, java.lang.Object[], java.util.Locale) method if available. In general, it is recommended to just use "useCodeAsDefaultMessage" during development and not rely on it in production in the first place, though.

See Also:
getMessage(String, Object[], Locale), FieldError

isUseCodeAsDefaultMessage

protected boolean isUseCodeAsDefaultMessage()
Return whether to use the message code as default message instead of throwing a NoSuchMessageException. Useful for development and debugging. Default is "false".

Alternatively, consider overriding the getDefaultMessage(java.lang.String) method to return a custom fallback message for an unresolvable code.

See Also:
getDefaultMessage(String)

getMessage

public final String getMessage(String code,
                               Object[] args,
                               String defaultMessage,
                               Locale locale)
Description copied from interface: MessageSource
Try to resolve the message. Return default message if no message was found.

Specified by:
getMessage in interface MessageSource
Parameters:
code - the code to lookup up, such as 'calculator.noRateSet'. Users of this class are encouraged to base message names on the relevant fully qualified class name, thus avoiding conflict and ensuring maximum clarity.
args - array of arguments that will be filled in for params within the message (params look like "{0}", "{1,date}", "{2,time}" within a message), or null if none.
defaultMessage - String to return if the lookup fails
locale - the Locale in which to do the lookup
Returns:
the resolved message if the lookup was successful; otherwise the default message passed as a parameter
See Also:
MessageFormat

getMessage

public final String getMessage(String code,
                               Object[] args,
                               Locale locale)
                        throws NoSuchMessageException
Description copied from interface: MessageSource
Try to resolve the message. Treat as an error if the message can't be found.

Specified by:
getMessage in interface MessageSource
Parameters:
code - the code to lookup up, such as 'calculator.noRateSet'
args - Array of arguments that will be filled in for params within the message (params look like "{0}", "{1,date}", "{2,time}" within a message), or null if none.
locale - the Locale in which to do the lookup
Returns:
the resolved message
Throws:
NoSuchMessageException - if the message wasn't found
See Also:
MessageFormat

getMessage

public final String getMessage(MessageSourceResolvable resolvable,
                               Locale locale)
                        throws NoSuchMessageException
Description copied from interface: MessageSource
Try to resolve the message using all the attributes contained within the MessageSourceResolvable argument that was passed in.

NOTE: We must throw a NoSuchMessageException on this method since at the time of calling this method we aren't able to determine if the defaultMessage property of the resolvable is null or not.

Specified by:
getMessage in interface MessageSource
Parameters:
resolvable - value object storing attributes required to properly resolve a message
locale - the Locale in which to do the lookup
Returns:
the resolved message
Throws:
NoSuchMessageException - if the message wasn't found
See Also:
MessageFormat

getMessageInternal

protected String getMessageInternal(String code,
                                    Object[] args,
                                    Locale locale)
Resolve the given code and arguments as message in the given Locale, returning null if not found. Does not fall back to the code as default message. Invoked by getMessage methods.

Parameters:
code - the code to lookup up, such as 'calculator.noRateSet'
args - array of arguments that will be filled in for params within the message
locale - the Locale in which to do the lookup
Returns:
the resolved message, or null if not found
See Also:
getMessage(String, Object[], String, Locale),
getMessage(String, Object[], Locale),
getMessage(MessageSourceResolvable, Locale),
setUseCodeAsDefaultMessage(boolean)

getMessageFromParent

protected String getMessageFromParent(String code,
                                      Object[] args,
                                      Locale locale)
Try to retrieve the given message from the parent MessageSource, if any.

Parameters:
code - the code to lookup up, such as 'calculator.noRateSet'
args - array of arguments that will be filled in for params within the message
locale - the Locale in which to do the lookup
Returns:
the resolved message, or null if not found
See Also:
getParentMessageSource()

getDefaultMessage

protected String getDefaultMessage(String code)
Return a fallback default message for the given code, if any.

Default is to return the code itself if "useCodeAsDefaultMessage" is activated, or return no fallback else. In case of no fallback, the caller will usually receive a NoSuchMessageException from getMessage.

Parameters:
code - the message code that we couldn't resolve and that we didn't receive an explicit default message for
Returns:
the default message to use, or null if none
See Also:
setUseCodeAsDefaultMessage(boolean)

renderDefaultMessage

protected String renderDefaultMessage(String defaultMessage,
                                      Object[] args,
                                      Locale locale)
Render the given default message String. The default message is passed in as specified by the caller and can be rendered into a fully formatted default message shown to the user.

The default implementation passes the String to MessageSourceSupport.formatMessage(java.lang.String, java.lang.Object[], java.util.Locale), resolving any argument placeholders found in them. Subclasses may override this method to plug in custom processing of default messages.

Overrides:
renderDefaultMessage in class MessageSourceSupport
Parameters:
defaultMessage - the passed-in default message String
args - array of arguments that will be filled in for params within the message, or null if none.
locale - the Locale used for formatting
Returns:
the rendered default message (with resolved arguments)
See Also:
MessageSourceSupport.formatMessage(String, Object[], java.util.Locale)

resolveArguments

protected Object[] resolveArguments(Object[] args,
                                    Locale locale)
Searches through the given array of objects, finds any MessageSourceResolvable objects and resolves them.

Allows for messages to have MessageSourceResolvables as arguments.

Overrides:
resolveArguments in class MessageSourceSupport
Parameters:
args - array of arguments for a message
locale - the locale to resolve through
Returns:
an array of arguments with any MessageSourceResolvables resolved

resolveCodeWithoutArguments

protected String resolveCodeWithoutArguments(String code,
                                             Locale locale)
Subclasses can override this method to resolve a message without arguments in an optimized fashion, i.e. to resolve without involving a MessageFormat.

The default implementation does use MessageFormat, through delegating to the resolveCode(java.lang.String, java.util.Locale) method. Subclasses are encouraged to replace this with optimized resolution.

Unfortunately, java.text.MessageFormat is not implemented in an efficient fashion. In particular, it does not detect that a message pattern doesn't contain argument placeholders in the first place. Therefore, it is advisable to circumvent MessageFormat for messages without arguments.

Parameters:
code - the code of the message to resolve
locale - the Locale to resolve the code for (subclasses are encouraged to support internationalization)
Returns:
the message String, or null if not found
See Also:
resolveCode(java.lang.String, java.util.Locale), MessageFormat

resolveCode

protected abstract MessageFormat resolveCode(String code,
                                             Locale locale)
Subclasses must implement this method to resolve a message.

Returns a MessageFormat instance rather than a message String, to allow for appropriate caching of MessageFormats in subclasses.

Subclasses are encouraged to provide optimized resolution for messages without arguments, not involving MessageFormat. See the resolveCodeWithoutArguments(java.lang.String, java.util.Locale) javadoc for details.

Parameters:
code - the code of the message to resolve
locale - the Locale to resolve the code for (subclasses are encouraged to support internationalization)
Returns:
the MessageFormat for the message, or null if not found
See Also:
resolveCodeWithoutArguments(String, java.util.Locale)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractRefreshableApplicationContext

org.springframework.context.support
Class AbstractRefreshableApplicationContext

java.lang.Object
    extended by  org.springframework.core.io.DefaultResourceLoader
        extended by  org.springframework.context.support.AbstractApplicationContext
            extended by  org.springframework.context.support.AbstractRefreshableApplicationContext
All Implemented Interfaces:
BeanFactory, DisposableBean, HierarchicalBeanFactory, ListableBeanFactory, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, ResourceLoader, ResourcePatternResolver
Direct Known Subclasses:
AbstractRefreshableConfigApplicationContext
public abstract class AbstractRefreshableApplicationContext
extends AbstractApplicationContext

Base class for ApplicationContext implementations which are supposed to support multiple calls to refresh, creating a new internal bean factory instance every time. Typically (but not necessarily), such a context will be driven by a set of config locations to load bean definitions from.

The only method to be implemented by subclasses is loadBeanDefinitions(org.springframework.beans.factory.support.DefaultListableBeanFactory), which gets invoked on each refresh. A concrete implementation is supposed to load bean definitions into the given DefaultListableBeanFactory, typically delegating to one or more specific bean definition readers.

Note that there is a similar base class for WebApplicationContexts. AbstractRefreshableWebApplicationContext provides the same subclassing strategy, but additionally pre-implements all context functionality for web environments. There is also a pre-defined way to receive config locations for a web context.

Concrete standalone subclasses of this base class, reading in a specific bean definition format, are ClassPathXmlApplicationContext and FileSystemXmlApplicationContext, which both derive from the common AbstractXmlApplicationContext base class; AnnotationConfigApplicationContext supports @Configuration-annotated classes as a source of bean definitions.

Since:
1.1.3
Author:
Juergen Hoeller
See Also:
loadBeanDefinitions(org.springframework.beans.factory.support.DefaultListableBeanFactory), DefaultListableBeanFactory, AbstractRefreshableWebApplicationContext, AbstractXmlApplicationContext, ClassPathXmlApplicationContext, FileSystemXmlApplicationContext, AnnotationConfigApplicationContext

Field Summary
Fields inherited from class org.springframework.context.support.AbstractApplicationContext
APPLICATION_EVENT_MULTICASTER_BEAN_NAME, LIFECYCLE_PROCESSOR_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAME
Fields inherited from interface org.springframework.context.ConfigurableApplicationContext
CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAME
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Constructor Summary
AbstractRefreshableApplicationContext()
Create a new AbstractRefreshableApplicationContext with no parent.
AbstractRefreshableApplicationContext(ApplicationContext parent)
Create a new AbstractRefreshableApplicationContext with the given parent context.
Method Summary
protected void | cancelRefresh(BeansException ex) Cancel this context's refresh attempt, resetting the active flag after an exception got thrown.
protected void | closeBeanFactory() Subclasses must implement this method to release their internal bean factory.
protected DefaultListableBeanFactory | createBeanFactory() Create an internal bean factory for this context.
protected void | customizeBeanFactory(DefaultListableBeanFactory beanFactory) Customize the internal bean factory used by this context.
ConfigurableListableBeanFactory | getBeanFactory() Subclasses must return their internal bean factory here.
protected boolean | hasBeanFactory() Determine whether this context currently holds a bean factory, i.e.
protected abstract void | loadBeanDefinitions(DefaultListableBeanFactory beanFactory) Load bean definitions into the given bean factory, typically through delegating to one or more bean definition readers.
protected void | refreshBeanFactory() This implementation performs an actual refresh of this context's underlying bean factory, shutting down the previous bean factory (if any) and initializing a fresh bean factory for the next phase of the context's lifecycle.
void | setAllowBeanDefinitionOverriding(boolean allowBeanDefinitionOverriding) Set whether it should be allowed to override bean definitions by registering a different definition with the same name, automatically replacing the former.
void | setAllowCircularReferences(boolean allowCircularReferences) Set whether to allow circular references between beans - and automatically try to resolve them.
Methods inherited from class org.springframework.context.support.AbstractApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, addListener, close, containsBean, containsBeanDefinition, containsLocalBean, destroy, destroyBeans, doClose, findAnnotationOnBean, finishBeanFactoryInitialization, finishRefresh, getAliases, getApplicationListeners, getAutowireCapableBeanFactory, getBean, getBean, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getDisplayName, getId, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getResourcePatternResolver, getResources, getStartupDate, getType, initApplicationEventMulticaster, initLifecycleProcessor, initMessageSource, invokeBeanFactoryPostProcessors, isActive, isPrototype, isRunning, isSingleton, isTypeMatch, obtainFreshBeanFactory, onClose, onRefresh, postProcessBeanFactory, prepareBeanFactory, prepareRefresh, publishEvent, refresh, registerBeanPostProcessors, registerListeners, registerShutdownHook, setDisplayName, setId, setParent, start, stop, toString
Methods inherited from class org.springframework.core.io.DefaultResourceLoader
getClassLoader, getResource, getResourceByPath, setClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.core.io.ResourceLoader
getClassLoader, getResource

Constructor Detail

AbstractRefreshableApplicationContext

public AbstractRefreshableApplicationContext()
Create a new AbstractRefreshableApplicationContext with no parent.

AbstractRefreshableApplicationContext

public AbstractRefreshableApplicationContext(ApplicationContext parent)
Create a new AbstractRefreshableApplicationContext with the given parent context.

Parameters:
parent - the parent context
Method Detail

setAllowBeanDefinitionOverriding

public void setAllowBeanDefinitionOverriding(boolean allowBeanDefinitionOverriding)
Set whether it should be allowed to override bean definitions by registering a different definition with the same name, automatically replacing the former. If not, an exception will be thrown. Default is "true".

See Also:
DefaultListableBeanFactory.setAllowBeanDefinitionOverriding(boolean)

setAllowCircularReferences

public void setAllowCircularReferences(boolean allowCircularReferences)
Set whether to allow circular references between beans - and automatically try to resolve them.

Default is "true". Turn this off to throw an exception when encountering a circular reference, disallowing them completely.

See Also:
AbstractAutowireCapableBeanFactory.setAllowCircularReferences(boolean)

refreshBeanFactory

protected final void refreshBeanFactory()
                                 throws BeansException
This implementation performs an actual refresh of this context's underlying bean factory, shutting down the previous bean factory (if any) and initializing a fresh bean factory for the next phase of the context's lifecycle.

Specified by:
refreshBeanFactory in class AbstractApplicationContext
Throws:
BeansException - if initialization of the bean factory failed

cancelRefresh

protected void cancelRefresh(BeansException ex)
Description copied from class: AbstractApplicationContext
Cancel this context's refresh attempt, resetting the active flag after an exception got thrown.

Overrides:
cancelRefresh in class AbstractApplicationContext
Parameters:
ex - the exception that led to the cancellation

closeBeanFactory

protected final void closeBeanFactory()
Description copied from class: AbstractApplicationContext
Subclasses must implement this method to release their internal bean factory. This method gets invoked by AbstractApplicationContext.close() after all other shutdown work.

Should never throw an exception but rather log shutdown failures.

Specified by:
closeBeanFactory in class AbstractApplicationContext

hasBeanFactory

protected final boolean hasBeanFactory()
Determine whether this context currently holds a bean factory, i.e. has been refreshed at least once and not been closed yet.

getBeanFactory

public final ConfigurableListableBeanFactory getBeanFactory()
Description copied from class: AbstractApplicationContext
Subclasses must return their internal bean factory here. They should implement the lookup efficiently, so that it can be called repeatedly without a performance penalty.

Note: Subclasses should check whether the context is still active before returning the internal bean factory. The internal factory should generally be considered unavailable once the context has been closed.

Specified by:
getBeanFactory in interface ConfigurableApplicationContext
Specified by:
getBeanFactory in class AbstractApplicationContext
Returns:
this application context's internal bean factory (never null)
See Also:
AbstractApplicationContext.refreshBeanFactory(), AbstractApplicationContext.closeBeanFactory()

createBeanFactory

protected DefaultListableBeanFactory createBeanFactory()
Create an internal bean factory for this context. Called for each AbstractApplicationContext.refresh() attempt.

The default implementation creates a DefaultListableBeanFactory with the internal bean factory of this context's parent as parent bean factory. Can be overridden in subclasses, for example to customize DefaultListableBeanFactory's settings.

Returns:
the bean factory for this context
See Also:
DefaultListableBeanFactory.setAllowBeanDefinitionOverriding(boolean),
DefaultListableBeanFactory.setAllowEagerClassLoading(boolean),
AbstractAutowireCapableBeanFactory.setAllowCircularReferences(boolean),
AbstractAutowireCapableBeanFactory.setAllowRawInjectionDespiteWrapping(boolean)

customizeBeanFactory

protected void customizeBeanFactory(DefaultListableBeanFactory beanFactory)
Customize the internal bean factory used by this context. Called for each AbstractApplicationContext.refresh() attempt.

The default implementation applies this context's "allowBeanDefinitionOverriding" and "allowCircularReferences" settings, if specified. Can be overridden in subclasses to customize any of DefaultListableBeanFactory's settings.

Parameters:
beanFactory - the newly created bean factory for this context
See Also:
DefaultListableBeanFactory.setAllowBeanDefinitionOverriding(boolean),
AbstractAutowireCapableBeanFactory.setAllowCircularReferences(boolean),
AbstractAutowireCapableBeanFactory.setAllowRawInjectionDespiteWrapping(boolean),
DefaultListableBeanFactory.setAllowEagerClassLoading(boolean)

loadBeanDefinitions

protected abstract void loadBeanDefinitions(DefaultListableBeanFactory beanFactory)
                                     throws BeansException,
                                            IOException
Load bean definitions into the given bean factory, typically through delegating to one or more bean definition readers.

Parameters:
beanFactory - the bean factory to load bean definitions into
Throws:
BeansException - if parsing of the bean definitions failed
IOException - if loading of bean definition files failed
See Also:
PropertiesBeanDefinitionReader, XmlBeanDefinitionReader
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractRefreshableConfigApplicationContext

org.springframework.context.support
Class AbstractRefreshableConfigApplicationContext

java.lang.Object
    extended by  org.springframework.core.io.DefaultResourceLoader
        extended by  org.springframework.context.support.AbstractApplicationContext
            extended by  org.springframework.context.support.AbstractRefreshableApplicationContext
                extended by  org.springframework.context.support.AbstractRefreshableConfigApplicationContext
All Implemented Interfaces:
BeanFactory, BeanNameAware, DisposableBean, HierarchicalBeanFactory, InitializingBean, ListableBeanFactory, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, ResourceLoader, ResourcePatternResolver
Direct Known Subclasses:
AbstractRefreshablePortletApplicationContext, AbstractRefreshableWebApplicationContext, AbstractXmlApplicationContext
public abstract class AbstractRefreshableConfigApplicationContext
extends AbstractRefreshableApplicationContext
implements BeanNameAware, InitializingBean

AbstractRefreshableApplicationContext subclass that adds common handling of specified config locations. Serves as base class for XML-based application context implementations such as ClassPathXmlApplicationContext and FileSystemXmlApplicationContext, as well as XmlWebApplicationContext and XmlPortletApplicationContext.

Since:
2.5.2
Author:
Juergen Hoeller
See Also:
setConfigLocation(java.lang.String),
setConfigLocations(java.lang.String[]),
getDefaultConfigLocations()

Field Summary
Fields inherited from class org.springframework.context.support.AbstractApplicationContext
APPLICATION_EVENT_MULTICASTER_BEAN_NAME, LIFECYCLE_PROCESSOR_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAME
Fields inherited from interface org.springframework.context.ConfigurableApplicationContext
CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAME
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Constructor Summary
AbstractRefreshableConfigApplicationContext()
Create a new AbstractRefreshableConfigApplicationContext with no parent.
AbstractRefreshableConfigApplicationContext(ApplicationContext parent)
Create a new AbstractRefreshableConfigApplicationContext with the given parent context.
Method Summary
 void afterPropertiesSet()
Triggers AbstractApplicationContext.refresh() if not refreshed in the concrete context's constructor already.
protected  String[] getConfigLocations()
Return an array of resource locations, referring to the XML bean definition files that this context should be built with.
protected  String[] getDefaultConfigLocations()
Return the default config locations to use, for the case where no explicit config locations have been specified.
protected  String resolvePath(String path)
Resolve the given path, replacing placeholders with corresponding system property values if necessary.
 void setBeanName(String name)
Sets the id of this context to the bean name by default, for cases where the context instance is itself defined as a bean.
 void setConfigLocation(String location)
Set the config locations for this application context in init-param style, i.e.
 void setConfigLocations(String[] locations)
Set the config locations for this application context.
 void setId(String id)
Set the unique id of this application context.
Methods inherited from class org.springframework.context.support.AbstractRefreshableApplicationContext
cancelRefresh, closeBeanFactory, createBeanFactory, customizeBeanFactory, getBeanFactory, hasBeanFactory, loadBeanDefinitions, refreshBeanFactory, setAllowBeanDefinitionOverriding, setAllowCircularReferences
Methods inherited from class org.springframework.context.support.AbstractApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, addListener, close, containsBean, containsBeanDefinition, containsLocalBean, destroy, destroyBeans, doClose, findAnnotationOnBean, finishBeanFactoryInitialization, finishRefresh, getAliases, getApplicationListeners, getAutowireCapableBeanFactory, getBean, getBean, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getDisplayName, getId, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getResourcePatternResolver, getResources, getStartupDate, getType, initApplicationEventMulticaster, initLifecycleProcessor, initMessageSource, invokeBeanFactoryPostProcessors, isActive, isPrototype, isRunning, isSingleton, isTypeMatch, obtainFreshBeanFactory, onClose, onRefresh, postProcessBeanFactory, prepareBeanFactory, prepareRefresh, publishEvent, refresh, registerBeanPostProcessors, registerListeners, registerShutdownHook, setDisplayName, setParent, start, stop, toString
Methods inherited from class org.springframework.core.io.DefaultResourceLoader
getClassLoader, getResource, getResourceByPath, setClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.core.io.ResourceLoader
getClassLoader, getResource

Constructor Detail

AbstractRefreshableConfigApplicationContext

public AbstractRefreshableConfigApplicationContext()
Create a new AbstractRefreshableConfigApplicationContext with no parent.

AbstractRefreshableConfigApplicationContext

public AbstractRefreshableConfigApplicationContext(ApplicationContext parent)
Create a new AbstractRefreshableConfigApplicationContext with the given parent context.

Parameters:
parent - the parent context
Method Detail

setConfigLocation

public void setConfigLocation(String location)
Set the config locations for this application context in init-param style, i.e. with distinct locations separated by commas, semicolons or whitespace.

If not set, the implementation may use a default as appropriate.

setConfigLocations

public void setConfigLocations(String[] locations)
Set the config locations for this application context.

If not set, the implementation may use a default as appropriate.

getConfigLocations

protected String[] getConfigLocations()
Return an array of resource locations, referring to the XML bean definition files that this context should be built with. Can also include location patterns, which will get resolved via a ResourcePatternResolver.

The default implementation returns null. Subclasses can override this to provide a set of resource locations to load bean definitions from.

Returns:
an array of resource locations, or null if none
See Also:
AbstractApplicationContext.getResources(java.lang.String), AbstractApplicationContext.getResourcePatternResolver()

getDefaultConfigLocations

protected String[] getDefaultConfigLocations()
Return the default config locations to use, for the case where no explicit config locations have been specified.

The default implementation returns null, requiring explicit config locations.

Returns:
an array of default config locations, if any
See Also:
setConfigLocations(java.lang.String[])

resolvePath

protected String resolvePath(String path)
Resolve the given path, replacing placeholders with corresponding system property values if necessary. Applied to config locations.

Parameters:
path - the original file path
Returns:
the resolved file path
See Also:
SystemPropertyUtils.resolvePlaceholders(java.lang.String)

setId

public void setId(String id)
Description copied from class: AbstractApplicationContext
Set the unique id of this application context.

Default is the object id of the context instance, or the name of the context bean if the context is itself defined as a bean.

Specified by:
setId in interface ConfigurableApplicationContext
Overrides:
setId in class AbstractApplicationContext
Parameters:
id - the unique id of the context

setBeanName

public void setBeanName(String name)
Sets the id of this context to the bean name by default, for cases where the context instance is itself defined as a bean.

Specified by:
setBeanName in interface BeanNameAware
Parameters:
name - the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use the BeanFactoryUtils.originalBeanName(String) method to extract the original bean name (without suffix), if desired.

afterPropertiesSet

public void afterPropertiesSet()
Triggers AbstractApplicationContext.refresh() if not refreshed in the concrete context's constructor already.

Specified by:
afterPropertiesSet in interface InitializingBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractXmlApplicationContext

org.springframework.context.support
Class AbstractXmlApplicationContext

java.lang.Object
    extended by  org.springframework.core.io.DefaultResourceLoader
        extended by  org.springframework.context.support.AbstractApplicationContext
            extended by  org.springframework.context.support.AbstractRefreshableApplicationContext
                extended by  org.springframework.context.support.AbstractRefreshableConfigApplicationContext
                    extended by  org.springframework.context.support.AbstractXmlApplicationContext
All Implemented Interfaces:
BeanFactory, BeanNameAware, DisposableBean, HierarchicalBeanFactory, InitializingBean, ListableBeanFactory, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, ResourceLoader, ResourcePatternResolver
Direct Known Subclasses:
ClassPathXmlApplicationContext, FileSystemXmlApplicationContext
public abstract class AbstractXmlApplicationContext
extends AbstractRefreshableConfigApplicationContext

Convenient base class for ApplicationContext implementations, drawing configuration from XML documents containing bean definitions understood by an XmlBeanDefinitionReader.

Subclasses just have to implement the getConfigResources() and/or the AbstractRefreshableConfigApplicationContext.getConfigLocations() method. Furthermore, they might override the DefaultResourceLoader.getResourceByPath(java.lang.String) hook to interpret relative paths in an environment-specific fashion, and/or AbstractApplicationContext.getResourcePatternResolver() for extended pattern resolution.

Author:
Rod Johnson, Juergen Hoeller
See Also:
getConfigResources(), AbstractRefreshableConfigApplicationContext.getConfigLocations(), XmlBeanDefinitionReader

Field Summary
Fields inherited from class org.springframework.context.support.AbstractApplicationContext
APPLICATION_EVENT_MULTICASTER_BEAN_NAME, LIFECYCLE_PROCESSOR_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAME
Fields inherited from interface org.springframework.context.ConfigurableApplicationContext
CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAME
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Constructor Summary
AbstractXmlApplicationContext()
Create a new AbstractXmlApplicationContext with no parent.
AbstractXmlApplicationContext(ApplicationContext parent)
Create a new AbstractXmlApplicationContext with the given parent context.
Method Summary
protected Resource[] | getConfigResources() Return an array of Resource objects, referring to the XML bean definition files that this context should be built with.
protected void | initBeanDefinitionReader(XmlBeanDefinitionReader reader) Initialize the bean definition reader used for loading the bean definitions of this context.
protected void | loadBeanDefinitions(DefaultListableBeanFactory beanFactory) Loads the bean definitions via an XmlBeanDefinitionReader.
protected void | loadBeanDefinitions(XmlBeanDefinitionReader reader) Load the bean definitions with the given XmlBeanDefinitionReader.
void | setValidating(boolean validating) Set whether to use XML validation.
Methods inherited from class org.springframework.context.support.AbstractRefreshableConfigApplicationContext
afterPropertiesSet, getConfigLocations, getDefaultConfigLocations, resolvePath, setBeanName, setConfigLocation, setConfigLocations, setId
Methods inherited from class org.springframework.context.support.AbstractRefreshableApplicationContext
cancelRefresh, closeBeanFactory, createBeanFactory, customizeBeanFactory, getBeanFactory, hasBeanFactory, refreshBeanFactory, setAllowBeanDefinitionOverriding, setAllowCircularReferences
Methods inherited from class org.springframework.context.support.AbstractApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, addListener, close, containsBean, containsBeanDefinition, containsLocalBean, destroy, destroyBeans, doClose, findAnnotationOnBean, finishBeanFactoryInitialization, finishRefresh, getAliases, getApplicationListeners, getAutowireCapableBeanFactory, getBean, getBean, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getDisplayName, getId, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getResourcePatternResolver, getResources, getStartupDate, getType, initApplicationEventMulticaster, initLifecycleProcessor, initMessageSource, invokeBeanFactoryPostProcessors, isActive, isPrototype, isRunning, isSingleton, isTypeMatch, obtainFreshBeanFactory, onClose, onRefresh, postProcessBeanFactory, prepareBeanFactory, prepareRefresh, publishEvent, refresh, registerBeanPostProcessors, registerListeners, registerShutdownHook, setDisplayName, setParent, start, stop, toString
Methods inherited from class org.springframework.core.io.DefaultResourceLoader
getClassLoader, getResource, getResourceByPath, setClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.core.io.ResourceLoader
getClassLoader, getResource

Constructor Detail

AbstractXmlApplicationContext

public AbstractXmlApplicationContext()
Create a new AbstractXmlApplicationContext with no parent.

AbstractXmlApplicationContext

public AbstractXmlApplicationContext(ApplicationContext parent)
Create a new AbstractXmlApplicationContext with the given parent context.

Parameters:
parent - the parent context
Method Detail

setValidating

public void setValidating(boolean validating)
Set whether to use XML validation. Default is true.

loadBeanDefinitions

protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory)
                            throws BeansException,
                                   IOException
Loads the bean definitions via an XmlBeanDefinitionReader.

Specified by:
loadBeanDefinitions in class AbstractRefreshableApplicationContext
Parameters:
beanFactory - the bean factory to load bean definitions into
Throws:
BeansException - if parsing of the bean definitions failed
IOException - if loading of bean definition files failed
See Also:
XmlBeanDefinitionReader, initBeanDefinitionReader(org.springframework.beans.factory.xml.XmlBeanDefinitionReader), loadBeanDefinitions(org.springframework.beans.factory.support.DefaultListableBeanFactory)

initBeanDefinitionReader

protected void initBeanDefinitionReader(XmlBeanDefinitionReader reader)
Initialize the bean definition reader used for loading the bean definitions of this context. Default implementation is empty.

Can be overridden in subclasses, e.g. for turning off XML validation or using a different XmlBeanDefinitionParser implementation.

Parameters:
reader - the bean definition reader used by this context
See Also:
XmlBeanDefinitionReader.setDocumentReaderClass(java.lang.Class)

loadBeanDefinitions

protected void loadBeanDefinitions(XmlBeanDefinitionReader reader)
                            throws BeansException,
                                   IOException
Load the bean definitions with the given XmlBeanDefinitionReader.

The lifecycle of the bean factory is handled by the AbstractRefreshableApplicationContext.refreshBeanFactory() method; hence this method is just supposed to load and/or register bean definitions.

Parameters:
reader - the XmlBeanDefinitionReader to use
Throws:
BeansException - in case of bean registration errors
IOException - if the required XML document isn't found
See Also:
AbstractRefreshableApplicationContext.refreshBeanFactory(),
AbstractRefreshableConfigApplicationContext.getConfigLocations(),
AbstractApplicationContext.getResources(java.lang.String),
AbstractApplicationContext.getResourcePatternResolver()

getConfigResources

protected Resource[] getConfigResources()
Return an array of Resource objects, referring to the XML bean definition files that this context should be built with.

The default implementation returns null. Subclasses can override this to provide pre-built Resource objects rather than location Strings.

Returns:
an array of Resource objects, or null if none
See Also:
AbstractRefreshableConfigApplicationContext.getConfigLocations()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ApplicationObjectSupport

org.springframework.context.support
Class ApplicationObjectSupport

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
All Implemented Interfaces:
ApplicationContextAware
Direct Known Subclasses:
AbstractHandlerMapping, PortletApplicationObjectSupport, WebApplicationObjectSupport
public abstract class ApplicationObjectSupport
extends Object
implements ApplicationContextAware

Convenient superclass for application objects that want to be aware of the application context, e.g. for custom lookup of collaborating beans or for context-specific resource access. It saves the application context reference and provides an initialization callback method. Furthermore, it offers numerous convenience methods for message lookup.

There is no requirement to subclass this class: It just makes things a little easier if you need access to the context, e.g. for access to file resources or to the message source. Note that many application objects do not need to be aware of the application context at all, as they can receive collaborating beans via bean references.

Many framework classes are derived from this class, particularly within the web support.

Author:
Rod Johnson, Juergen Hoeller
See Also:
WebApplicationObjectSupport

Field Summary
protected  Log logger
Logger that is available to subclasses
Constructor Summary
ApplicationObjectSupport()
Method Summary
ApplicationContext | getApplicationContext() Return the ApplicationContext that this object is associated with.
protected MessageSourceAccessor | getMessageSourceAccessor() Return a MessageSourceAccessor for the application context used by this object, for easy message access.
protected void | initApplicationContext() Subclasses can override this for custom initialization behavior.
protected void | initApplicationContext(ApplicationContext context) Subclasses can override this for custom initialization behavior.
protected boolean | isContextRequired() Determine whether this application object needs to run in an ApplicationContext.
protected Class | requiredContextClass() Determine the context class that any context passed to setApplicationContext must be an instance of.
void | setApplicationContext(ApplicationContext context) Set the ApplicationContext that this object runs in.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger that is available to subclasses

Constructor Detail

ApplicationObjectSupport

public ApplicationObjectSupport()
Method Detail

setApplicationContext

public final void setApplicationContext(ApplicationContext context)
                                 throws BeansException
Description copied from interface: ApplicationContextAware
Set the ApplicationContext that this object runs in. Normally this call will be used to initialize the object.

Invoked after population of normal bean properties but before an init callback such as InitializingBean.afterPropertiesSet() or a custom init-method. Invoked after ResourceLoaderAware.setResourceLoader(org.springframework.core.io.ResourceLoader), ApplicationEventPublisherAware.setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher) and MessageSourceAware, if applicable.

Specified by:
setApplicationContext in interface ApplicationContextAware
Parameters:
context - the ApplicationContext object to be used by this object
Throws:
ApplicationContextException - in case of context initialization errors
BeansException - if thrown by application context methods
See Also:
BeanInitializationException

isContextRequired

protected boolean isContextRequired()
Determine whether this application object needs to run in an ApplicationContext.

Default is "false". Can be overridden to enforce running in a context (i.e. to throw IllegalStateException on accessors if outside a context).

See Also:
getApplicationContext(), getMessageSourceAccessor()

requiredContextClass

protected Class requiredContextClass()
Determine the context class that any context passed to setApplicationContext must be an instance of. Can be overridden in subclasses.

See Also:
setApplicationContext(org.springframework.context.ApplicationContext)

initApplicationContext

protected void initApplicationContext(ApplicationContext context)
                               throws BeansException
Subclasses can override this for custom initialization behavior. Gets called by setApplicationContext after setting the context instance.

Note: Does not get called on reinitialization of the context but rather just on first initialization of this object's context reference.

The default implementation calls the overloaded initApplicationContext() method without ApplicationContext reference.

Parameters:
context - the containing ApplicationContext
Throws:
ApplicationContextException - in case of initialization errors
BeansException - if thrown by ApplicationContext methods
See Also:
setApplicationContext(org.springframework.context.ApplicationContext)

initApplicationContext

protected void initApplicationContext()
                               throws BeansException
Subclasses can override this for custom initialization behavior.

The default implementation is empty. Called by initApplicationContext(org.springframework.context.ApplicationContext).

Throws:
ApplicationContextException - in case of initialization errors
BeansException - if thrown by ApplicationContext methods
See Also:
setApplicationContext(org.springframework.context.ApplicationContext)

getApplicationContext

public final ApplicationContext getApplicationContext()
                                               throws IllegalStateException
Return the ApplicationContext that this object is associated with.

Throws:
IllegalStateException - if not running in an ApplicationContext

getMessageSourceAccessor

protected final MessageSourceAccessor getMessageSourceAccessor()
                                                        throws IllegalStateException
Return a MessageSourceAccessor for the application context used by this object, for easy message access.

Throws:
IllegalStateException - if not running in an ApplicationContext
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ClassPathXmlApplicationContext

org.springframework.context.support
Class ClassPathXmlApplicationContext

java.lang.Object
    extended by  org.springframework.core.io.DefaultResourceLoader
        extended by  org.springframework.context.support.AbstractApplicationContext
            extended by  org.springframework.context.support.AbstractRefreshableApplicationContext
                extended by  org.springframework.context.support.AbstractRefreshableConfigApplicationContext
                    extended by  org.springframework.context.support.AbstractXmlApplicationContext
                        extended by  org.springframework.context.support.ClassPathXmlApplicationContext
All Implemented Interfaces:
BeanFactory, BeanNameAware, DisposableBean, HierarchicalBeanFactory, InitializingBean, ListableBeanFactory, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, ResourceLoader, ResourcePatternResolver
public class ClassPathXmlApplicationContext
extends AbstractXmlApplicationContext

Standalone XML application context, taking the context definition files from the class path, interpreting plain paths as class path resource names that include the package path (e.g. "mypackage/myresource.txt"). Useful for test harnesses as well as for application contexts embedded within JARs.

The config location defaults can be overridden via AbstractRefreshableConfigApplicationContext.getConfigLocations(), Config locations can either denote concrete files like "/myfiles/context.xml" or Ant-style patterns like "/myfiles/*-context.xml" (see the AntPathMatcher javadoc for pattern details).

Note: In case of multiple config locations, later bean definitions will override ones defined in earlier loaded files. This can be leveraged to deliberately override certain bean definitions via an extra XML file.

This is a simple, one-stop shop convenience ApplicationContext. Consider using the GenericApplicationContext class in combination with an XmlBeanDefinitionReader for more flexible context setup.

Author:
Rod Johnson, Juergen Hoeller
See Also:
DefaultResourceLoader.getResource(java.lang.String), DefaultResourceLoader.getResourceByPath(java.lang.String), GenericApplicationContext

Field Summary
Fields inherited from class org.springframework.context.support.AbstractApplicationContext
APPLICATION_EVENT_MULTICASTER_BEAN_NAME, LIFECYCLE_PROCESSOR_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAME
Fields inherited from interface org.springframework.context.ConfigurableApplicationContext
CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAME
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Constructor Summary
ClassPathXmlApplicationContext()
Create a new ClassPathXmlApplicationContext for bean-style configuration.
ClassPathXmlApplicationContext(ApplicationContext parent)
Create a new ClassPathXmlApplicationContext for bean-style configuration.
ClassPathXmlApplicationContext(String... configLocations)
Create a new ClassPathXmlApplicationContext, loading the definitions from the given XML files and automatically refreshing the context.
ClassPathXmlApplicationContext(String configLocation)
Create a new ClassPathXmlApplicationContext, loading the definitions from the given XML file and automatically refreshing the context.
ClassPathXmlApplicationContext(String[] configLocations, ApplicationContext parent)
Create a new ClassPathXmlApplicationContext with the given parent, loading the definitions from the given XML files and automatically refreshing the context.
ClassPathXmlApplicationContext(String[] configLocations, boolean refresh)
Create a new ClassPathXmlApplicationContext, loading the definitions from the given XML files.
ClassPathXmlApplicationContext(String[] configLocations, boolean refresh, ApplicationContext parent)
Create a new ClassPathXmlApplicationContext with the given parent, loading the definitions from the given XML files.
ClassPathXmlApplicationContext(String[] paths, Class clazz)
Create a new ClassPathXmlApplicationContext, loading the definitions from the given XML files and automatically refreshing the context.
ClassPathXmlApplicationContext(String[] paths, Class clazz, ApplicationContext parent)
Create a new ClassPathXmlApplicationContext with the given parent, loading the definitions from the given XML files and automatically refreshing the context.
ClassPathXmlApplicationContext(String path, Class clazz)
Create a new ClassPathXmlApplicationContext, loading the definitions from the given XML file and automatically refreshing the context.
Method Summary
protected  Resource[] getConfigResources()
Return an array of Resource objects, referring to the XML bean definition files that this context should be built with.
Methods inherited from class org.springframework.context.support.AbstractXmlApplicationContext
initBeanDefinitionReader, loadBeanDefinitions, loadBeanDefinitions, setValidating
Methods inherited from class org.springframework.context.support.AbstractRefreshableConfigApplicationContext
afterPropertiesSet, getConfigLocations, getDefaultConfigLocations, resolvePath, setBeanName, setConfigLocation, setConfigLocations, setId
Methods inherited from class org.springframework.context.support.AbstractRefreshableApplicationContext
cancelRefresh, closeBeanFactory, createBeanFactory, customizeBeanFactory, getBeanFactory, hasBeanFactory, refreshBeanFactory, setAllowBeanDefinitionOverriding, setAllowCircularReferences
Methods inherited from class org.springframework.context.support.AbstractApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, addListener, close, containsBean, containsBeanDefinition, containsLocalBean, destroy, destroyBeans, doClose, findAnnotationOnBean, finishBeanFactoryInitialization, finishRefresh, getAliases, getApplicationListeners, getAutowireCapableBeanFactory, getBean, getBean, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getDisplayName, getId, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getResourcePatternResolver, getResources, getStartupDate, getType, initApplicationEventMulticaster, initLifecycleProcessor, initMessageSource, invokeBeanFactoryPostProcessors, isActive, isPrototype, isRunning, isSingleton, isTypeMatch, obtainFreshBeanFactory, onClose, onRefresh, postProcessBeanFactory, prepareBeanFactory, prepareRefresh, publishEvent, refresh, registerBeanPostProcessors, registerListeners, registerShutdownHook, setDisplayName, setParent, start, stop, toString
Methods inherited from class org.springframework.core.io.DefaultResourceLoader
getClassLoader, getResource, getResourceByPath, setClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.core.io.ResourceLoader
getClassLoader, getResource

Constructor Detail

ClassPathXmlApplicationContext

public ClassPathXmlApplicationContext()
Create a new ClassPathXmlApplicationContext for bean-style configuration.

See Also:
AbstractRefreshableConfigApplicationContext.setConfigLocation(java.lang.String),
AbstractRefreshableConfigApplicationContext.setConfigLocations(java.lang.String[]),
AbstractRefreshableConfigApplicationContext.afterPropertiesSet()

ClassPathXmlApplicationContext

public ClassPathXmlApplicationContext(ApplicationContext parent)
Create a new ClassPathXmlApplicationContext for bean-style configuration.

Parameters:
parent - the parent context
See Also:
AbstractRefreshableConfigApplicationContext.setConfigLocation(java.lang.String),
AbstractRefreshableConfigApplicationContext.setConfigLocations(java.lang.String[]),
AbstractRefreshableConfigApplicationContext.afterPropertiesSet()

ClassPathXmlApplicationContext

public ClassPathXmlApplicationContext(String configLocation)
                               throws BeansException
Create a new ClassPathXmlApplicationContext, loading the definitions from the given XML file and automatically refreshing the context.

Parameters:
configLocation - resource location
Throws:
BeansException - if context creation failed

ClassPathXmlApplicationContext

public ClassPathXmlApplicationContext(String... configLocations)
                               throws BeansException
Create a new ClassPathXmlApplicationContext, loading the definitions from the given XML files and automatically refreshing the context.

Parameters:
configLocations - array of resource locations
Throws:
BeansException - if context creation failed

ClassPathXmlApplicationContext

public ClassPathXmlApplicationContext(String[] configLocations,
                                      ApplicationContext parent)
                               throws BeansException
Create a new ClassPathXmlApplicationContext with the given parent, loading the definitions from the given XML files and automatically refreshing the context.

Parameters:
configLocations - array of resource locations
parent - the parent context
Throws:
BeansException - if context creation failed

ClassPathXmlApplicationContext

public ClassPathXmlApplicationContext(String[] configLocations,
                                      boolean refresh)
                               throws BeansException
Create a new ClassPathXmlApplicationContext, loading the definitions from the given XML files.

Parameters:
configLocations - array of resource locations
refresh - whether to automatically refresh the context, loading all bean definitions and creating all singletons. Alternatively, call refresh manually after further configuring the context.
Throws:
BeansException - if context creation failed
See Also:
AbstractApplicationContext.refresh()

ClassPathXmlApplicationContext

public ClassPathXmlApplicationContext(String[] configLocations,
                                      boolean refresh,
                                      ApplicationContext parent)
                               throws BeansException
Create a new ClassPathXmlApplicationContext with the given parent, loading the definitions from the given XML files.

Parameters:
configLocations - array of resource locations
refresh - whether to automatically refresh the context, loading all bean definitions and creating all singletons. Alternatively, call refresh manually after further configuring the context.
parent - the parent context
Throws:
BeansException - if context creation failed
See Also:
AbstractApplicationContext.refresh()

ClassPathXmlApplicationContext

public ClassPathXmlApplicationContext(String path,
                                      Class clazz)
                               throws BeansException
Create a new ClassPathXmlApplicationContext, loading the definitions from the given XML file and automatically refreshing the context.

This is a convenience method to load class path resources relative to a given Class. For full flexibility, consider using a GenericApplicationContext with an XmlBeanDefinitionReader and a ClassPathResource argument.

Parameters:
path - relative (or absolute) path within the class path
clazz - the class to load resources with (basis for the given paths)
Throws:
BeansException - if context creation failed
See Also:
ClassPathResource.ClassPathResource(String, Class), GenericApplicationContext, XmlBeanDefinitionReader

ClassPathXmlApplicationContext

public ClassPathXmlApplicationContext(String[] paths,
                                      Class clazz)
                               throws BeansException
Create a new ClassPathXmlApplicationContext, loading the definitions from the given XML files and automatically refreshing the context.

Parameters:
paths - array of relative (or absolute) paths within the class path
clazz - the class to load resources with (basis for the given paths)
Throws:
BeansException - if context creation failed
See Also:
ClassPathResource.ClassPathResource(String, Class), GenericApplicationContext, XmlBeanDefinitionReader

ClassPathXmlApplicationContext

public ClassPathXmlApplicationContext(String[] paths,
                                      Class clazz,
                                      ApplicationContext parent)
                               throws BeansException
Create a new ClassPathXmlApplicationContext with the given parent, loading the definitions from the given XML files and automatically refreshing the context.

Parameters:
paths - array of relative (or absolute) paths within the class path
clazz - the class to load resources with (basis for the given paths)
parent - the parent context
Throws:
BeansException - if context creation failed
See Also:
ClassPathResource.ClassPathResource(String, Class), GenericApplicationContext, XmlBeanDefinitionReader
Method Detail

getConfigResources

protected Resource[] getConfigResources()
Description copied from class: AbstractXmlApplicationContext
Return an array of Resource objects, referring to the XML bean definition files that this context should be built with.

The default implementation returns null. Subclasses can override this to provide pre-built Resource objects rather than location Strings.

Overrides:
getConfigResources in class AbstractXmlApplicationContext
Returns:
an array of Resource objects, or null if none
See Also:
AbstractRefreshableConfigApplicationContext.getConfigLocations()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConversionServiceFactoryBean

org.springframework.context.support
Class ConversionServiceFactoryBean

java.lang.Object
    extended by  org.springframework.context.support.ConversionServiceFactoryBean
All Implemented Interfaces:
FactoryBean<ConversionService>, InitializingBean
public class ConversionServiceFactoryBean
extends Object
implements FactoryBean<ConversionService>, InitializingBean

A factory for a ConversionService that installs default converters appropriate for most environments. Set the "converters" property to supplement or override the default converters.

Since:
3.0
Author:
Keith Donald, Juergen Hoeller
See Also:
ConversionServiceFactory.createDefaultConversionService()

Constructor Summary
ConversionServiceFactoryBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected  GenericConversionService createConversionService()
Create the ConversionService instance returned by this factory bean.
 ConversionService getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<? extends ConversionService> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setConverters(Set<?> converters)
Configure the set of custom converter objects that should be added: implementing Converter, ConverterFactory, or GenericConverter.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ConversionServiceFactoryBean

public ConversionServiceFactoryBean()
Method Detail

setConverters

public void setConverters(Set<?> converters)
Configure the set of custom converter objects that should be added: implementing Converter, ConverterFactory, or GenericConverter.

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

createConversionService

protected GenericConversionService createConversionService()
Create the ConversionService instance returned by this factory bean.

Creates a simple GenericConversionService instance by default. Subclasses may override to customize the ConversionService instance that gets created.

getObject

public ConversionService getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<ConversionService>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends ConversionService> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<ConversionService>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<ConversionService>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultLifecycleProcessor

org.springframework.context.support
Class DefaultLifecycleProcessor

java.lang.Object
    extended by  org.springframework.context.support.DefaultLifecycleProcessor
All Implemented Interfaces:
BeanFactoryAware, Lifecycle, LifecycleProcessor
public class DefaultLifecycleProcessor
extends Object
implements LifecycleProcessor, BeanFactoryAware

Default implementation of the LifecycleProcessor strategy.

Since:
3.0
Author:
Mark Fisher, Juergen Hoeller

Constructor Summary
DefaultLifecycleProcessor()
Method Summary
protected Map<String,Lifecycle> | getLifecycleBeans() Retrieve all applicable Lifecycle beans: all singletons that have already been created, as well as all SmartLifecycle beans (even if they are marked as lazy-init).
protected int | getPhase(Lifecycle bean) Determine the lifecycle phase of the given bean.
boolean | isRunning() Check whether this component is currently running.
void | onClose() Notification of context close phase, e.g.
void | onRefresh() Notification of context refresh, e.g.
void | setBeanFactory(BeanFactory beanFactory) Callback that supplies the owning factory to a bean instance.
void | setTimeoutPerShutdownPhase(long timeoutPerShutdownPhase) Specify the maximum time allotted in milliseconds for the shutdown of any phase (group of SmartLifecycle beans with the same 'phase' value).
void | start() Start all registered beans that implement Lifecycle and are not already running.
void | stop() Stop all registered beans that implement Lifecycle and are currently running.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DefaultLifecycleProcessor

public DefaultLifecycleProcessor()
Method Detail

setTimeoutPerShutdownPhase

public void setTimeoutPerShutdownPhase(long timeoutPerShutdownPhase)
Specify the maximum time allotted in milliseconds for the shutdown of any phase (group of SmartLifecycle beans with the same 'phase' value). The default value is 30 seconds.

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
BeanInitializationException

start

public void start()
Start all registered beans that implement Lifecycle and are not already running. Any bean that implements SmartLifecycle will be started within its 'phase', and all phases will be ordered from lowest to highest value. All beans that do not implement SmartLifecycle will be started in the default phase 0. A bean declared as a dependency of another bean will be started before the dependent bean regardless of the declared phase.

Specified by:
start in interface Lifecycle

stop

public void stop()
Stop all registered beans that implement Lifecycle and are currently running. Any bean that implements SmartLifecycle will be stopped within its 'phase', and all phases will be ordered from highest to lowest value. All beans that do not implement SmartLifecycle will be stopped in the default phase 0. A bean declared as dependent on another bean will be stopped before the dependency bean regardless of the declared phase.

Specified by:
stop in interface Lifecycle

onRefresh

public void onRefresh()
Description copied from interface: LifecycleProcessor
Notification of context refresh, e.g. for auto-starting components.

Specified by:
onRefresh in interface LifecycleProcessor

onClose

public void onClose()
Description copied from interface: LifecycleProcessor
Notification of context close phase, e.g. for auto-stopping components.

Specified by:
onClose in interface LifecycleProcessor

isRunning

public boolean isRunning()
Description copied from interface: Lifecycle
Check whether this component is currently running.

In the case of a container, this will return true only if all components that apply are currently running.

Specified by:
isRunning in interface Lifecycle
Returns:
whether the component is currently running

getLifecycleBeans

protected Map<String,Lifecycle> getLifecycleBeans()
Retrieve all applicable Lifecycle beans: all singletons that have already been created, as well as all SmartLifecycle beans (even if they are marked as lazy-init).

Returns:
the Map of applicable beans, with bean names as keys and bean instances as values

getPhase

protected int getPhase(Lifecycle bean)
Determine the lifecycle phase of the given bean.

The default implementation checks for the Phased interface. Can be overridden to apply other/further policies.

Parameters:
bean - the bean to introspect
Returns:
the phase an an integer value. The suggested default is 0.
See Also:
Phased, SmartLifecycle
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultMessageSourceResolvable

org.springframework.context.support
Class DefaultMessageSourceResolvable

java.lang.Object
    extended by  org.springframework.context.support.DefaultMessageSourceResolvable
All Implemented Interfaces:
Serializable, MessageSourceResolvable
Direct Known Subclasses:
ObjectError
public class DefaultMessageSourceResolvable
extends Object
implements MessageSourceResolvable, Serializable

Default implementation of the MessageSourceResolvable interface. Offers an easy way to store all the necessary values needed to resolve a message via a MessageSource.

Since:
13.02.2004
Author:
Juergen Hoeller
See Also:
MessageSource.getMessage(MessageSourceResolvable, java.util.Locale), Serialized Form

Constructor Summary
DefaultMessageSourceResolvable(MessageSourceResolvable resolvable)
Copy constructor: Create a new instance from another resolvable.
DefaultMessageSourceResolvable(String code)
Create a new DefaultMessageSourceResolvable.
DefaultMessageSourceResolvable(String[] codes)
Create a new DefaultMessageSourceResolvable.
DefaultMessageSourceResolvable(String[] codes, Object[] arguments)
Create a new DefaultMessageSourceResolvable.
DefaultMessageSourceResolvable(String[] codes, Object[] arguments, String defaultMessage)
Create a new DefaultMessageSourceResolvable.
DefaultMessageSourceResolvable(String[] codes, String defaultMessage)
Create a new DefaultMessageSourceResolvable.
Method Summary
boolean | equals(Object other)
Object[] | getArguments() Return the array of arguments to be used to resolve this message.
String | getCode() Return the default code of this resolvable, that is, the last one in the codes array.
String[] | getCodes() Return the codes to be used to resolve this message, in the order that they should get tried.
String | getDefaultMessage() Return the default message to be used to resolve this message.
int | hashCode()
protected String | resolvableToString() Build a default String representation for this MessageSourceResolvable: including codes, arguments, and default message.
String | toString() Default implementation exposes the attributes of this MessageSourceResolvable.
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

DefaultMessageSourceResolvable

public DefaultMessageSourceResolvable(String code)
Create a new DefaultMessageSourceResolvable.

Parameters:
code - the code to be used to resolve this message

DefaultMessageSourceResolvable

public DefaultMessageSourceResolvable(String[] codes)
Create a new DefaultMessageSourceResolvable.

Parameters:
codes - the codes to be used to resolve this message

DefaultMessageSourceResolvable

public DefaultMessageSourceResolvable(String[] codes,
                                      String defaultMessage)
Create a new DefaultMessageSourceResolvable.

Parameters:
codes - the codes to be used to resolve this message
defaultMessage - the default message to be used to resolve this message

DefaultMessageSourceResolvable

public DefaultMessageSourceResolvable(String[] codes,
                                      Object[] arguments)
Create a new DefaultMessageSourceResolvable.

Parameters:
codes - the codes to be used to resolve this message
arguments - the array of arguments to be used to resolve this message

DefaultMessageSourceResolvable

public DefaultMessageSourceResolvable(String[] codes,
                                      Object[] arguments,
                                      String defaultMessage)
Create a new DefaultMessageSourceResolvable.

Parameters:
codes - the codes to be used to resolve this message
arguments - the array of arguments to be used to resolve this message
defaultMessage - the default message to be used to resolve this message

DefaultMessageSourceResolvable

public DefaultMessageSourceResolvable(MessageSourceResolvable resolvable)
Copy constructor: Create a new instance from another resolvable.

Parameters:
resolvable - the resolvable to copy from
Method Detail

getCodes

public String[] getCodes()
Description copied from interface: MessageSourceResolvable
Return the codes to be used to resolve this message, in the order that they should get tried. The last code will therefore be the default one.

Specified by:
getCodes in interface MessageSourceResolvable
Returns:
a String array of codes which are associated with this message

getCode

public String getCode()
Return the default code of this resolvable, that is, the last one in the codes array.

getArguments

public Object[] getArguments()
Description copied from interface: MessageSourceResolvable
Return the array of arguments to be used to resolve this message.

Specified by:
getArguments in interface MessageSourceResolvable
Returns:
an array of objects to be used as parameters to replace placeholders within the message text
See Also:
MessageFormat

getDefaultMessage

public String getDefaultMessage()
Description copied from interface: MessageSourceResolvable
Return the default message to be used to resolve this message.

Specified by:
getDefaultMessage in interface MessageSourceResolvable
Returns:
the default message, or null if no default

resolvableToString

protected final String resolvableToString()
Build a default String representation for this MessageSourceResolvable: including codes, arguments, and default message.

toString

public String toString()
Default implementation exposes the attributes of this MessageSourceResolvable. To be overridden in more specific subclasses, potentially including the resolvable content through resolvableToString().

Overrides:
toString in class Object
See Also:
resolvableToString()

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DelegatingMessageSource

org.springframework.context.support
Class DelegatingMessageSource

java.lang.Object
    extended by  org.springframework.context.support.MessageSourceSupport
        extended by  org.springframework.context.support.DelegatingMessageSource
All Implemented Interfaces:
HierarchicalMessageSource, MessageSource
public class DelegatingMessageSource
extends MessageSourceSupport
implements HierarchicalMessageSource

Empty MessageSource that delegates all calls to the parent MessageSource. If no parent is available, it simply won't resolve any message.

Used as placeholder by AbstractApplicationContext, if the context doesn't define its own MessageSource. Not intended for direct use in applications.

Since:
1.1.5
Author:
Juergen Hoeller
See Also:
AbstractApplicationContext

Field Summary
Fields inherited from class org.springframework.context.support.MessageSourceSupport
logger
Constructor Summary
DelegatingMessageSource()
Method Summary
String | getMessage(MessageSourceResolvable resolvable, Locale locale) Try to resolve the message using all the attributes contained within the MessageSourceResolvable argument that was passed in.
String | getMessage(String code, Object[] args, Locale locale) Try to resolve the message.
String | getMessage(String code, Object[] args, String defaultMessage, Locale locale) Try to resolve the message.
MessageSource | getParentMessageSource() Return the parent of this MessageSource, or null if none.
void | setParentMessageSource(MessageSource parent) Set the parent that will be used to try to resolve messages that this object can't resolve.
Methods inherited from class org.springframework.context.support.MessageSourceSupport
createMessageFormat, formatMessage, isAlwaysUseMessageFormat, renderDefaultMessage, resolveArguments, setAlwaysUseMessageFormat
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DelegatingMessageSource

public DelegatingMessageSource()
Method Detail

setParentMessageSource

public void setParentMessageSource(MessageSource parent)
Description copied from interface: HierarchicalMessageSource
Set the parent that will be used to try to resolve messages that this object can't resolve.

Specified by:
setParentMessageSource in interface HierarchicalMessageSource
Parameters:
parent - the parent MessageSource that will be used to resolve messages that this object can't resolve. May be null, in which case no further resolution is possible.

getParentMessageSource

public MessageSource getParentMessageSource()
Description copied from interface: HierarchicalMessageSource
Return the parent of this MessageSource, or null if none.

Specified by:
getParentMessageSource in interface HierarchicalMessageSource

getMessage

public String getMessage(String code,
                         Object[] args,
                         String defaultMessage,
                         Locale locale)
Description copied from interface: MessageSource
Try to resolve the message. Return default message if no message was found.

Specified by:
getMessage in interface MessageSource
Parameters:
code - the code to lookup up, such as 'calculator.noRateSet'. Users of this class are encouraged to base message names on the relevant fully qualified class name, thus avoiding conflict and ensuring maximum clarity.
args - array of arguments that will be filled in for params within the message (params look like "{0}", "{1,date}", "{2,time}" within a message), or null if none.
defaultMessage - String to return if the lookup fails
locale - the Locale in which to do the lookup
Returns:
the resolved message if the lookup was successful; otherwise the default message passed as a parameter
See Also:
MessageFormat

getMessage

public String getMessage(String code,
                         Object[] args,
                         Locale locale)
                  throws NoSuchMessageException
Description copied from interface: MessageSource
Try to resolve the message. Treat as an error if the message can't be found.

Specified by:
getMessage in interface MessageSource
Parameters:
code - the code to lookup up, such as 'calculator.noRateSet'
args - Array of arguments that will be filled in for params within the message (params look like "{0}", "{1,date}", "{2,time}" within a message), or null if none.
locale - the Locale in which to do the lookup
Returns:
the resolved message
Throws:
NoSuchMessageException - if the message wasn't found
See Also:
MessageFormat

getMessage

public String getMessage(MessageSourceResolvable resolvable,
                         Locale locale)
                  throws NoSuchMessageException
Description copied from interface: MessageSource
Try to resolve the message using all the attributes contained within the MessageSourceResolvable argument that was passed in.

NOTE: We must throw a NoSuchMessageException on this method since at the time of calling this method we aren't able to determine if the defaultMessage property of the resolvable is null or not.

Specified by:
getMessage in interface MessageSource
Parameters:
resolvable - value object storing attributes required to properly resolve a message
locale - the Locale in which to do the lookup
Returns:
the resolved message
Throws:
NoSuchMessageException - if the message wasn't found
See Also:
MessageFormat
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FileSystemXmlApplicationContext

org.springframework.context.support
Class FileSystemXmlApplicationContext

java.lang.Object
    extended by  org.springframework.core.io.DefaultResourceLoader
        extended by  org.springframework.context.support.AbstractApplicationContext
            extended by  org.springframework.context.support.AbstractRefreshableApplicationContext
                extended by  org.springframework.context.support.AbstractRefreshableConfigApplicationContext
                    extended by  org.springframework.context.support.AbstractXmlApplicationContext
                        extended by  org.springframework.context.support.FileSystemXmlApplicationContext
All Implemented Interfaces:
BeanFactory, BeanNameAware, DisposableBean, HierarchicalBeanFactory, InitializingBean, ListableBeanFactory, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, ResourceLoader, ResourcePatternResolver
public class FileSystemXmlApplicationContext
extends AbstractXmlApplicationContext

Standalone XML application context, taking the context definition files from the file system or from URLs, interpreting plain paths as relative file system locations (e.g. "mydir/myfile.txt"). Useful for test harnesses as well as for standalone environments.

NOTE: Plain paths will always be interpreted as relative to the current VM working directory, even if they start with a slash. (This is consistent with the semantics in a Servlet container.) Use an explicit "file:" prefix to enforce an absolute file path.

The config location defaults can be overridden via AbstractRefreshableConfigApplicationContext.getConfigLocations(), Config locations can either denote concrete files like "/myfiles/context.xml" or Ant-style patterns like "/myfiles/*-context.xml" (see the AntPathMatcher javadoc for pattern details).

Note: In case of multiple config locations, later bean definitions will override ones defined in earlier loaded files. This can be leveraged to deliberately override certain bean definitions via an extra XML file.

This is a simple, one-stop shop convenience ApplicationContext. Consider using the GenericApplicationContext class in combination with an XmlBeanDefinitionReader for more flexible context setup.

Author:
Rod Johnson, Juergen Hoeller
See Also:
DefaultResourceLoader.getResource(java.lang.String), getResourceByPath(java.lang.String), GenericApplicationContext

Field Summary
Fields inherited from class org.springframework.context.support.AbstractApplicationContext
APPLICATION_EVENT_MULTICASTER_BEAN_NAME, LIFECYCLE_PROCESSOR_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAME
Fields inherited from interface org.springframework.context.ConfigurableApplicationContext
CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAME
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Constructor Summary
FileSystemXmlApplicationContext()
Create a new FileSystemXmlApplicationContext for bean-style configuration.
FileSystemXmlApplicationContext(ApplicationContext parent)
Create a new FileSystemXmlApplicationContext for bean-style configuration.
FileSystemXmlApplicationContext(String... configLocations)
Create a new FileSystemXmlApplicationContext, loading the definitions from the given XML files and automatically refreshing the context.
FileSystemXmlApplicationContext(String configLocation)
Create a new FileSystemXmlApplicationContext, loading the definitions from the given XML file and automatically refreshing the context.
FileSystemXmlApplicationContext(String[] configLocations, ApplicationContext parent)
Create a new FileSystemXmlApplicationContext with the given parent, loading the definitions from the given XML files and automatically refreshing the context.
FileSystemXmlApplicationContext(String[] configLocations, boolean refresh)
Create a new FileSystemXmlApplicationContext, loading the definitions from the given XML files.
FileSystemXmlApplicationContext(String[] configLocations, boolean refresh, ApplicationContext parent)
Create a new FileSystemXmlApplicationContext with the given parent, loading the definitions from the given XML files.
Method Summary
protected  Resource getResourceByPath(String path)
Resolve resource paths as file system paths.
Methods inherited from class org.springframework.context.support.AbstractXmlApplicationContext
getConfigResources, initBeanDefinitionReader, loadBeanDefinitions, loadBeanDefinitions, setValidating
Methods inherited from class org.springframework.context.support.AbstractRefreshableConfigApplicationContext
afterPropertiesSet, getConfigLocations, getDefaultConfigLocations, resolvePath, setBeanName, setConfigLocation, setConfigLocations, setId
Methods inherited from class org.springframework.context.support.AbstractRefreshableApplicationContext
cancelRefresh, closeBeanFactory, createBeanFactory, customizeBeanFactory, getBeanFactory, hasBeanFactory, refreshBeanFactory, setAllowBeanDefinitionOverriding, setAllowCircularReferences
Methods inherited from class org.springframework.context.support.AbstractApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, addListener, close, containsBean, containsBeanDefinition, containsLocalBean, destroy, destroyBeans, doClose, findAnnotationOnBean, finishBeanFactoryInitialization, finishRefresh, getAliases, getApplicationListeners, getAutowireCapableBeanFactory, getBean, getBean, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getDisplayName, getId, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getResourcePatternResolver, getResources, getStartupDate, getType, initApplicationEventMulticaster, initLifecycleProcessor, initMessageSource, invokeBeanFactoryPostProcessors, isActive, isPrototype, isRunning, isSingleton, isTypeMatch, obtainFreshBeanFactory, onClose, onRefresh, postProcessBeanFactory, prepareBeanFactory, prepareRefresh, publishEvent, refresh, registerBeanPostProcessors, registerListeners, registerShutdownHook, setDisplayName, setParent, start, stop, toString
Methods inherited from class org.springframework.core.io.DefaultResourceLoader
getClassLoader, getResource, setClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.core.io.ResourceLoader
getClassLoader, getResource

Constructor Detail

FileSystemXmlApplicationContext

public FileSystemXmlApplicationContext()
Create a new FileSystemXmlApplicationContext for bean-style configuration.

See Also:
AbstractRefreshableConfigApplicationContext.setConfigLocation(java.lang.String),
AbstractRefreshableConfigApplicationContext.setConfigLocations(java.lang.String[]),
AbstractRefreshableConfigApplicationContext.afterPropertiesSet()

FileSystemXmlApplicationContext

public FileSystemXmlApplicationContext(ApplicationContext parent)
Create a new FileSystemXmlApplicationContext for bean-style configuration.

Parameters:
parent - the parent context
See Also:
AbstractRefreshableConfigApplicationContext.setConfigLocation(java.lang.String),
AbstractRefreshableConfigApplicationContext.setConfigLocations(java.lang.String[]),
AbstractRefreshableConfigApplicationContext.afterPropertiesSet()

FileSystemXmlApplicationContext

public FileSystemXmlApplicationContext(String configLocation)
                                throws BeansException
Create a new FileSystemXmlApplicationContext, loading the definitions from the given XML file and automatically refreshing the context.

Parameters:
configLocation - file path
Throws:
BeansException - if context creation failed

FileSystemXmlApplicationContext

public FileSystemXmlApplicationContext(String... configLocations)
                                throws BeansException
Create a new FileSystemXmlApplicationContext, loading the definitions from the given XML files and automatically refreshing the context.

Parameters:
configLocations - array of file paths
Throws:
BeansException - if context creation failed

FileSystemXmlApplicationContext

public FileSystemXmlApplicationContext(String[] configLocations,
                                       ApplicationContext parent)
                                throws BeansException
Create a new FileSystemXmlApplicationContext with the given parent, loading the definitions from the given XML files and automatically refreshing the context.

Parameters:
configLocations - array of file paths
parent - the parent context
Throws:
BeansException - if context creation failed

FileSystemXmlApplicationContext

public FileSystemXmlApplicationContext(String[] configLocations,
                                       boolean refresh)
                                throws BeansException
Create a new FileSystemXmlApplicationContext, loading the definitions from the given XML files.

Parameters:
configLocations - array of file paths
refresh - whether to automatically refresh the context, loading all bean definitions and creating all singletons. Alternatively, call refresh manually after further configuring the context.
Throws:
BeansException - if context creation failed
See Also:
AbstractApplicationContext.refresh()

FileSystemXmlApplicationContext

public FileSystemXmlApplicationContext(String[] configLocations,
                                       boolean refresh,
                                       ApplicationContext parent)
                                throws BeansException
Create a new FileSystemXmlApplicationContext with the given parent, loading the definitions from the given XML files.

Parameters:
configLocations - array of file paths
refresh - whether to automatically refresh the context, loading all bean definitions and creating all singletons. Alternatively, call refresh manually after further configuring the context.
parent - the parent context
Throws:
BeansException - if context creation failed
See Also:
AbstractApplicationContext.refresh()
Method Detail

getResourceByPath

protected Resource getResourceByPath(String path)
Resolve resource paths as file system paths.

Note: Even if a given path starts with a slash, it will get interpreted as relative to the current VM working directory. This is consistent with the semantics in a Servlet container.

Overrides:
getResourceByPath in class DefaultResourceLoader
Parameters:
path - path to the resource
Returns:
Resource handle
See Also:
AbstractRefreshableWebApplicationContext.getResourceByPath(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


GenericApplicationContext

org.springframework.context.support
Class GenericApplicationContext

java.lang.Object
    extended by  org.springframework.core.io.DefaultResourceLoader
        extended by  org.springframework.context.support.AbstractApplicationContext
            extended by  org.springframework.context.support.GenericApplicationContext
All Implemented Interfaces:
BeanFactory, DisposableBean, HierarchicalBeanFactory, ListableBeanFactory, BeanDefinitionRegistry, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, AliasRegistry, ResourceLoader, ResourcePatternResolver
Direct Known Subclasses:
AnnotationConfigApplicationContext, GenericWebApplicationContext, GenericXmlApplicationContext, ResourceAdapterApplicationContext, StaticApplicationContext
public class GenericApplicationContext
extends AbstractApplicationContext
implements BeanDefinitionRegistry

Generic ApplicationContext implementation that holds a single internal DefaultListableBeanFactory instance and does not assume a specific bean definition format. Implements the BeanDefinitionRegistry interface in order to allow for applying any bean definition readers to it.

Typical usage is to register a variety of bean definitions via the BeanDefinitionRegistry interface and then call AbstractApplicationContext.refresh() to initialize those beans with application context semantics (handling ApplicationContextAware, auto-detecting BeanFactoryPostProcessors, etc).

In contrast to other ApplicationContext implementations that create a new internal BeanFactory instance for each refresh, the internal BeanFactory of this context is available right from the start, to be able to register bean definitions on it. AbstractApplicationContext.refresh() may only be called once.

Usage example:

 GenericApplicationContext ctx = new GenericApplicationContext();
 XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(ctx);
 xmlReader.loadBeanDefinitions(new ClassPathResource("applicationContext.xml"));
 PropertiesBeanDefinitionReader propReader = new PropertiesBeanDefinitionReader(ctx);
 propReader.loadBeanDefinitions(new ClassPathResource("otherBeans.properties"));
 ctx.refresh();

 MyBean myBean = (MyBean) ctx.getBean("myBean");
 ...
For the typical case of XML bean definitions, simply use ClassPathXmlApplicationContext or FileSystemXmlApplicationContext, which are easier to set up - but less flexible, since you can just use standard resource locations for XML bean definitions, rather than mixing arbitrary bean definition formats. The equivalent in a web environment is XmlWebApplicationContext.

For custom application context implementations that are supposed to read special bean definition formats in a refreshable manner, consider deriving from the AbstractRefreshableApplicationContext base class.

Since:
1.1.2
Author:
Juergen Hoeller
See Also:
registerBeanDefinition(java.lang.String, org.springframework.beans.factory.config.BeanDefinition), AbstractApplicationContext.refresh(), XmlBeanDefinitionReader, PropertiesBeanDefinitionReader

Field Summary
Fields inherited from class org.springframework.context.support.AbstractApplicationContext
APPLICATION_EVENT_MULTICASTER_BEAN_NAME, LIFECYCLE_PROCESSOR_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAME
Fields inherited from interface org.springframework.context.ConfigurableApplicationContext
CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAME
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Constructor Summary
GenericApplicationContext()
Create a new GenericApplicationContext.
GenericApplicationContext(ApplicationContext parent)
Create a new GenericApplicationContext with the given parent.
GenericApplicationContext(DefaultListableBeanFactory beanFactory)
Create a new GenericApplicationContext with the given DefaultListableBeanFactory.
GenericApplicationContext(DefaultListableBeanFactory beanFactory, ApplicationContext parent)
Create a new GenericApplicationContext with the given DefaultListableBeanFactory.
Method Summary
protected void | closeBeanFactory() Not much to do: We hold a single internal BeanFactory that will never get released.
BeanDefinition | getBeanDefinition(String beanName) Return the BeanDefinition for the given bean name.
ConfigurableListableBeanFactory | getBeanFactory() Return the single internal BeanFactory held by this context (as ConfigurableListableBeanFactory).
DefaultListableBeanFactory | getDefaultListableBeanFactory() Return the underlying bean factory of this context, available for registering bean definitions.
Resource | getResource(String location) This implementation delegates to this context's ResourceLoader if set, falling back to the default superclass behavior else.
Resource[] | getResources(String locationPattern) This implementation delegates to this context's ResourceLoader if it implements the ResourcePatternResolver interface, falling back to the default superclass behavior else.
boolean | isAlias(String beanName) Determine whether this given name is defines as an alias (as opposed to the name of an actually registered component).
boolean | isBeanNameInUse(String beanName) Determine whether the given bean name is already in use within this registry, i.e.
protected void | refreshBeanFactory() Do nothing: We hold a single internal BeanFactory and rely on callers to register beans through our public methods (or the BeanFactory's).
void | registerAlias(String beanName, String alias) Given a name, register an alias for it.
void | registerBeanDefinition(String beanName, BeanDefinition beanDefinition) Register a new bean definition with this registry.
void | removeAlias(String alias) Remove the specified alias from this registry.
void | removeBeanDefinition(String beanName) Remove the BeanDefinition for the given name.
void | setAllowBeanDefinitionOverriding(boolean allowBeanDefinitionOverriding) Set whether it should be allowed to override bean definitions by registering a different definition with the same name, automatically replacing the former.
void | setAllowCircularReferences(boolean allowCircularReferences) Set whether to allow circular references between beans - and automatically try to resolve them.
void | setId(String id) Set the unique id of this application context.
void | setParent(ApplicationContext parent) Set the parent of this application context, also setting the parent of the internal BeanFactory accordingly.
void | setResourceLoader(ResourceLoader resourceLoader) Set a ResourceLoader to use for this context.
Methods inherited from class org.springframework.context.support.AbstractApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, addListener, cancelRefresh, close, containsBean, containsBeanDefinition, containsLocalBean, destroy, destroyBeans, doClose, findAnnotationOnBean, finishBeanFactoryInitialization, finishRefresh, getAliases, getApplicationListeners, getAutowireCapableBeanFactory, getBean, getBean, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getDisplayName, getId, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getResourcePatternResolver, getStartupDate, getType, initApplicationEventMulticaster, initLifecycleProcessor, initMessageSource, invokeBeanFactoryPostProcessors, isActive, isPrototype, isRunning, isSingleton, isTypeMatch, obtainFreshBeanFactory, onClose, onRefresh, postProcessBeanFactory, prepareBeanFactory, prepareRefresh, publishEvent, refresh, registerBeanPostProcessors, registerListeners, registerShutdownHook, setDisplayName, start, stop, toString
Methods inherited from class org.springframework.core.io.DefaultResourceLoader
getClassLoader, getResourceByPath, setClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.support.BeanDefinitionRegistry
containsBeanDefinition, getBeanDefinitionCount, getBeanDefinitionNames
Methods inherited from interface org.springframework.core.AliasRegistry
getAliases
Methods inherited from interface org.springframework.core.io.ResourceLoader
getClassLoader

Constructor Detail

GenericApplicationContext

public GenericApplicationContext()
Create a new GenericApplicationContext.

See Also:
registerBeanDefinition(java.lang.String, org.springframework.beans.factory.config.BeanDefinition), AbstractApplicationContext.refresh()

GenericApplicationContext

public GenericApplicationContext(DefaultListableBeanFactory beanFactory)
Create a new GenericApplicationContext with the given DefaultListableBeanFactory.

Parameters:
beanFactory - the DefaultListableBeanFactory instance to use for this context
See Also:
registerBeanDefinition(java.lang.String, org.springframework.beans.factory.config.BeanDefinition), AbstractApplicationContext.refresh()

GenericApplicationContext

public GenericApplicationContext(ApplicationContext parent)
Create a new GenericApplicationContext with the given parent.

Parameters:
parent - the parent application context
See Also:
registerBeanDefinition(java.lang.String, org.springframework.beans.factory.config.BeanDefinition), AbstractApplicationContext.refresh()

GenericApplicationContext

public GenericApplicationContext(DefaultListableBeanFactory beanFactory,
                                 ApplicationContext parent)
Create a new GenericApplicationContext with the given DefaultListableBeanFactory.

Parameters:
beanFactory - the DefaultListableBeanFactory instance to use for this context
parent - the parent application context
See Also:
registerBeanDefinition(java.lang.String, org.springframework.beans.factory.config.BeanDefinition), AbstractApplicationContext.refresh()
Method Detail

setParent

public void setParent(ApplicationContext parent)
Set the parent of this application context, also setting the parent of the internal BeanFactory accordingly.

Specified by:
setParent in interface ConfigurableApplicationContext
Overrides:
setParent in class AbstractApplicationContext
Parameters:
parent - the parent context
See Also:
ConfigurableBeanFactory.setParentBeanFactory(org.springframework.beans.factory.BeanFactory)

setId

public void setId(String id)
Description copied from class: AbstractApplicationContext
Set the unique id of this application context.

Default is the object id of the context instance, or the name of the context bean if the context is itself defined as a bean.

Specified by:
setId in interface ConfigurableApplicationContext
Overrides:
setId in class AbstractApplicationContext
Parameters:
id - the unique id of the context

setAllowBeanDefinitionOverriding

public void setAllowBeanDefinitionOverriding(boolean allowBeanDefinitionOverriding)
Set whether it should be allowed to override bean definitions by registering a different definition with the same name, automatically replacing the former. If not, an exception will be thrown. Default is "true".

See Also:
DefaultListableBeanFactory.setAllowBeanDefinitionOverriding(boolean)

setAllowCircularReferences

public void setAllowCircularReferences(boolean allowCircularReferences)
Set whether to allow circular references between beans - and automatically try to resolve them.

Default is "true". Turn this off to throw an exception when encountering a circular reference, disallowing them completely.

See Also:
AbstractAutowireCapableBeanFactory.setAllowCircularReferences(boolean)

setResourceLoader

public void setResourceLoader(ResourceLoader resourceLoader)
Set a ResourceLoader to use for this context. If set, the context will delegate all getResource calls to the given ResourceLoader. If not set, default resource loading will apply.

The main reason to specify a custom ResourceLoader is to resolve resource paths (withour URL prefix) in a specific fashion. The default behavior is to resolve such paths as class path locations. To resolve resource paths as file system locations, specify a FileSystemResourceLoader here.

You can also pass in a full ResourcePatternResolver, which will be autodetected by the context and used for getResources calls as well. Else, default resource pattern matching will apply.

See Also:
getResource(java.lang.String), DefaultResourceLoader, FileSystemResourceLoader, ResourcePatternResolver, getResources(java.lang.String)

getResource

public Resource getResource(String location)
This implementation delegates to this context's ResourceLoader if set, falling back to the default superclass behavior else.

Specified by:
getResource in interface ResourceLoader
Overrides:
getResource in class DefaultResourceLoader
Parameters:
location - the resource location
Returns:
a corresponding Resource handle
See Also:
setResourceLoader(org.springframework.core.io.ResourceLoader)

getResources

public Resource[] getResources(String locationPattern)
                        throws IOException
This implementation delegates to this context's ResourceLoader if it implements the ResourcePatternResolver interface, falling back to the default superclass behavior else.

Specified by:
getResources in interface ResourcePatternResolver
Overrides:
getResources in class AbstractApplicationContext
Parameters:
locationPattern - the location pattern to resolve
Returns:
the corresponding Resource objects
Throws:
IOException - in case of I/O errors
See Also:
setResourceLoader(org.springframework.core.io.ResourceLoader)

refreshBeanFactory

protected final void refreshBeanFactory()
                                 throws IllegalStateException
Do nothing: We hold a single internal BeanFactory and rely on callers to register beans through our public methods (or the BeanFactory's).

Specified by:
refreshBeanFactory in class AbstractApplicationContext
Throws:
IllegalStateException - if already initialized and multiple refresh attempts are not supported
See Also:
registerBeanDefinition(java.lang.String, org.springframework.beans.factory.config.BeanDefinition)

closeBeanFactory

protected final void closeBeanFactory()
Not much to do: We hold a single internal BeanFactory that will never get released.

Specified by:
closeBeanFactory in class AbstractApplicationContext

getBeanFactory

public final ConfigurableListableBeanFactory getBeanFactory()
Return the single internal BeanFactory held by this context (as ConfigurableListableBeanFactory).

Specified by:
getBeanFactory in interface ConfigurableApplicationContext
Specified by:
getBeanFactory in class AbstractApplicationContext
Returns:
this application context's internal bean factory (never null)
See Also:
AbstractApplicationContext.refreshBeanFactory(), AbstractApplicationContext.closeBeanFactory()

getDefaultListableBeanFactory

public final DefaultListableBeanFactory getDefaultListableBeanFactory()
Return the underlying bean factory of this context, available for registering bean definitions.

NOTE: You need to call AbstractApplicationContext.refresh() to initialize the bean factory and its contained beans with application context semantics (autodetecting BeanFactoryPostProcessors, etc).

Returns:
the internal bean factory (as DefaultListableBeanFactory)

registerBeanDefinition

public void registerBeanDefinition(String beanName,
                                   BeanDefinition beanDefinition)
                            throws BeanDefinitionStoreException
Description copied from interface: BeanDefinitionRegistry
Register a new bean definition with this registry. Must support RootBeanDefinition and ChildBeanDefinition.

Specified by:
registerBeanDefinition in interface BeanDefinitionRegistry
Parameters:
beanName - the name of the bean instance to register
beanDefinition - definition of the bean instance to register
Throws:
BeanDefinitionStoreException - if the BeanDefinition is invalid or if there is already a BeanDefinition for the specified bean name (and we are not allowed to override it)
See Also:
RootBeanDefinition, ChildBeanDefinition

removeBeanDefinition

public void removeBeanDefinition(String beanName)
                          throws NoSuchBeanDefinitionException
Description copied from interface: BeanDefinitionRegistry
Remove the BeanDefinition for the given name.

Specified by:
removeBeanDefinition in interface BeanDefinitionRegistry
Parameters:
beanName - the name of the bean instance to register
Throws:
NoSuchBeanDefinitionException - if there is no such bean definition

getBeanDefinition

public BeanDefinition getBeanDefinition(String beanName)
                                 throws NoSuchBeanDefinitionException
Description copied from interface: BeanDefinitionRegistry
Return the BeanDefinition for the given bean name.

Specified by:
getBeanDefinition in interface BeanDefinitionRegistry
Parameters:
beanName - name of the bean to find a definition for
Returns:
the BeanDefinition for the given name (never null)
Throws:
NoSuchBeanDefinitionException - if there is no such bean definition

isBeanNameInUse

public boolean isBeanNameInUse(String beanName)
Description copied from interface: BeanDefinitionRegistry
Determine whether the given bean name is already in use within this registry, i.e. whether there is a local bean or alias registered under this name.

Specified by:
isBeanNameInUse in interface BeanDefinitionRegistry
Parameters:
beanName - the name to check
Returns:
whether the given bean name is already in use

registerAlias

public void registerAlias(String beanName,
                          String alias)
Description copied from interface: AliasRegistry
Given a name, register an alias for it.

Specified by:
registerAlias in interface AliasRegistry
Parameters:
beanName - the canonical name
alias - the alias to be registered

removeAlias

public void removeAlias(String alias)
Description copied from interface: AliasRegistry
Remove the specified alias from this registry.

Specified by:
removeAlias in interface AliasRegistry
Parameters:
alias - the alias to remove

isAlias

public boolean isAlias(String beanName)
Description copied from interface: AliasRegistry
Determine whether this given name is defines as an alias (as opposed to the name of an actually registered component).

Specified by:
isAlias in interface AliasRegistry
Parameters:
beanName - the bean name to check
Returns:
whether the given name is an alias
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


GenericXmlApplicationContext

org.springframework.context.support
Class GenericXmlApplicationContext

java.lang.Object
    extended by  org.springframework.core.io.DefaultResourceLoader
        extended by  org.springframework.context.support.AbstractApplicationContext
            extended by  org.springframework.context.support.GenericApplicationContext
                extended by  org.springframework.context.support.GenericXmlApplicationContext
All Implemented Interfaces:
BeanFactory, DisposableBean, HierarchicalBeanFactory, ListableBeanFactory, BeanDefinitionRegistry, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, AliasRegistry, ResourceLoader, ResourcePatternResolver
public class GenericXmlApplicationContext
extends GenericApplicationContext

Convenient application context with built-in XML support. This is a flexible alternative to ClassPathXmlApplicationContext and FileSystemXmlApplicationContext, to be configured via setters, with an eventual AbstractApplicationContext.refresh() call activating the context.

In case of multiple configuration files, bean definitions in later files will override those defined in earlier files. This can be leveraged to deliberately override certain bean definitions via an extra configuration file.

Since:
3.0
Author:
Juergen Hoeller
See Also:
load(org.springframework.core.io.Resource...), XmlBeanDefinitionReader, AnnotationConfigApplicationContext

Field Summary
Fields inherited from class org.springframework.context.support.AbstractApplicationContext
APPLICATION_EVENT_MULTICASTER_BEAN_NAME, LIFECYCLE_PROCESSOR_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAME
Fields inherited from interface org.springframework.context.ConfigurableApplicationContext
CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAME
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Constructor Summary
GenericXmlApplicationContext()
Create a new GenericXmlApplicationContext that needs to be populated through load(org.springframework.core.io.Resource...) calls and then manually refreshed.
GenericXmlApplicationContext(Resource... resources)
Create a new GenericXmlApplicationContext, loading bean definitions from the given resources and automatically refreshing the context.
GenericXmlApplicationContext(String... resourceLocations)
Create a new GenericXmlApplicationContext, loading bean definitions from the given resource locations and automatically refreshing the context.
Method Summary
void | load(Resource... resources) Load bean definitions from the given XML resources.
void | load(String... resourceLocations) Load bean definitions from the given XML resources.
void | setValidating(boolean validating) Set whether to use XML validation.
Methods inherited from class org.springframework.context.support.GenericApplicationContext
closeBeanFactory, getBeanDefinition, getBeanFactory, getDefaultListableBeanFactory, getResource, getResources, isAlias, isBeanNameInUse, refreshBeanFactory, registerAlias, registerBeanDefinition, removeAlias, removeBeanDefinition, setAllowBeanDefinitionOverriding, setAllowCircularReferences, setId, setParent, setResourceLoader
Methods inherited from class org.springframework.context.support.AbstractApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, addListener, cancelRefresh, close, containsBean, containsBeanDefinition, containsLocalBean, destroy, destroyBeans, doClose, findAnnotationOnBean, finishBeanFactoryInitialization, finishRefresh, getAliases, getApplicationListeners, getAutowireCapableBeanFactory, getBean, getBean, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getDisplayName, getId, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getResourcePatternResolver, getStartupDate, getType, initApplicationEventMulticaster, initLifecycleProcessor, initMessageSource, invokeBeanFactoryPostProcessors, isActive, isPrototype, isRunning, isSingleton, isTypeMatch, obtainFreshBeanFactory, onClose, onRefresh, postProcessBeanFactory, prepareBeanFactory, prepareRefresh, publishEvent, refresh, registerBeanPostProcessors, registerListeners, registerShutdownHook, setDisplayName, start, stop, toString
Methods inherited from class org.springframework.core.io.DefaultResourceLoader
getClassLoader, getResourceByPath, setClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.support.BeanDefinitionRegistry
containsBeanDefinition, getBeanDefinitionCount, getBeanDefinitionNames
Methods inherited from interface org.springframework.core.AliasRegistry
getAliases
Methods inherited from interface org.springframework.core.io.ResourceLoader
getClassLoader

Constructor Detail

GenericXmlApplicationContext

public GenericXmlApplicationContext()
Create a new GenericXmlApplicationContext that needs to be populated through load(org.springframework.core.io.Resource...) calls and then manually refreshed.

GenericXmlApplicationContext

public GenericXmlApplicationContext(Resource... resources)
Create a new GenericXmlApplicationContext, loading bean definitions from the given resources and automatically refreshing the context.

Parameters:
resources - the resources to load from

GenericXmlApplicationContext

public GenericXmlApplicationContext(String... resourceLocations)
Create a new GenericXmlApplicationContext, loading bean definitions from the given resource locations and automatically refreshing the context.

Parameters:
resourceLocations - the resources to load from
Method Detail

setValidating

public void setValidating(boolean validating)
Set whether to use XML validation. Default is true.

load

public void load(Resource... resources)
Load bean definitions from the given XML resources.

Parameters:
resources - one or more resources to load from

load

public void load(String... resourceLocations)
Load bean definitions from the given XML resources.

Parameters:
resourceLocations - one or more resource locations to load from
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageSourceAccessor

org.springframework.context.support
Class MessageSourceAccessor

java.lang.Object
    extended by  org.springframework.context.support.MessageSourceAccessor

public class MessageSourceAccessor
extends Object

Helper class for easy access to messages from a MessageSource, providing various overloaded getMessage methods.

Available from ApplicationObjectSupport, but also reusable as a standalone helper to delegate to in application objects.

Since:
23.10.2003
Author:
Juergen Hoeller
See Also:
ApplicationObjectSupport.getMessageSourceAccessor()

Constructor Summary
MessageSourceAccessor(MessageSource messageSource)
Create a new MessageSourceAccessor, using LocaleContextHolder's locale as default locale.
MessageSourceAccessor(MessageSource messageSource, Locale defaultLocale)
Create a new MessageSourceAccessor, using the given default locale.
Method Summary
protected Locale | getDefaultLocale() Return the default locale to use if no explicit locale has been given.
String | getMessage(MessageSourceResolvable resolvable) Retrieve the given MessageSourceResolvable (e.g.
String | getMessage(MessageSourceResolvable resolvable, Locale locale) Retrieve the given MessageSourceResolvable (e.g.
String | getMessage(String code) Retrieve the message for the given code and the default Locale.
String | getMessage(String code, Locale locale) Retrieve the message for the given code and the given Locale.
String | getMessage(String code, Object[] args) Retrieve the message for the given code and the default Locale.
String | getMessage(String code, Object[] args, Locale locale) Retrieve the message for the given code and the given Locale.
String | getMessage(String code, Object[] args, String defaultMessage) Retrieve the message for the given code and the default Locale.
String | getMessage(String code, Object[] args, String defaultMessage, Locale locale) Retrieve the message for the given code and the given Locale.
String | getMessage(String code, String defaultMessage) Retrieve the message for the given code and the default Locale.
String | getMessage(String code, String defaultMessage, Locale locale) Retrieve the message for the given code and the given Locale.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MessageSourceAccessor

public MessageSourceAccessor(MessageSource messageSource)
Create a new MessageSourceAccessor, using LocaleContextHolder's locale as default locale.

Parameters:
messageSource - the MessageSource to wrap
See Also:
LocaleContextHolder.getLocale()

MessageSourceAccessor

public MessageSourceAccessor(MessageSource messageSource,
                             Locale defaultLocale)
Create a new MessageSourceAccessor, using the given default locale.

Parameters:
messageSource - the MessageSource to wrap
defaultLocale - the default locale to use for message access
Method Detail

getDefaultLocale

protected Locale getDefaultLocale()
Return the default locale to use if no explicit locale has been given.

The default implementation returns the default locale passed into the corresponding constructor, or LocaleContextHolder's locale as fallback. Can be overridden in subclasses.

See Also:
MessageSourceAccessor(org.springframework.context.MessageSource, java.util.Locale), LocaleContextHolder.getLocale()

getMessage

public String getMessage(String code,
                         String defaultMessage)
Retrieve the message for the given code and the default Locale.

Parameters:
code - code of the message
defaultMessage - String to return if the lookup fails
Returns:
the message

getMessage

public String getMessage(String code,
                         String defaultMessage,
                         Locale locale)
Retrieve the message for the given code and the given Locale.

Parameters:
code - code of the message
defaultMessage - String to return if the lookup fails
locale - Locale in which to do lookup
Returns:
the message

getMessage

public String getMessage(String code,
                         Object[] args,
                         String defaultMessage)
Retrieve the message for the given code and the default Locale.

Parameters:
code - code of the message
args - arguments for the message, or null if none
defaultMessage - String to return if the lookup fails
Returns:
the message

getMessage

public String getMessage(String code,
                         Object[] args,
                         String defaultMessage,
                         Locale locale)
Retrieve the message for the given code and the given Locale.

Parameters:
code - code of the message
args - arguments for the message, or null if none
defaultMessage - String to return if the lookup fails
locale - Locale in which to do lookup
Returns:
the message

getMessage

public String getMessage(String code)
                  throws NoSuchMessageException
Retrieve the message for the given code and the default Locale.

Parameters:
code - code of the message
Returns:
the message
Throws:
NoSuchMessageException - if not found

getMessage

public String getMessage(String code,
                         Locale locale)
                  throws NoSuchMessageException
Retrieve the message for the given code and the given Locale.

Parameters:
code - code of the message
locale - Locale in which to do lookup
Returns:
the message
Throws:
NoSuchMessageException - if not found

getMessage

public String getMessage(String code,
                         Object[] args)
                  throws NoSuchMessageException
Retrieve the message for the given code and the default Locale.

Parameters:
code - code of the message
args - arguments for the message, or null if none
Returns:
the message
Throws:
NoSuchMessageException - if not found

getMessage

public String getMessage(String code,
                         Object[] args,
                         Locale locale)
                  throws NoSuchMessageException
Retrieve the message for the given code and the given Locale.

Parameters:
code - code of the message
args - arguments for the message, or null if none
locale - Locale in which to do lookup
Returns:
the message
Throws:
NoSuchMessageException - if not found

getMessage

public String getMessage(MessageSourceResolvable resolvable)
                  throws NoSuchMessageException
Retrieve the given MessageSourceResolvable (e.g. an ObjectError instance) in the default Locale.

Parameters:
resolvable - the MessageSourceResolvable
Returns:
the message
Throws:
NoSuchMessageException - if not found

getMessage

public String getMessage(MessageSourceResolvable resolvable,
                         Locale locale)
                  throws NoSuchMessageException
Retrieve the given MessageSourceResolvable (e.g. an ObjectError instance) in the given Locale.

Parameters:
resolvable - the MessageSourceResolvable
locale - Locale in which to do lookup
Returns:
the message
Throws:
NoSuchMessageException - if not found
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageSourceResourceBundle

org.springframework.context.support
Class MessageSourceResourceBundle

java.lang.Object
    extended by  java.util.ResourceBundle
        extended by  org.springframework.context.support.MessageSourceResourceBundle

public class MessageSourceResourceBundle
extends ResourceBundle

Helper class that allows for accessing a Spring MessageSource as a ResourceBundle. Used for example to expose a Spring MessageSource to JSTL web views.

Since:
27.02.2003
Author:
Juergen Hoeller
See Also:
MessageSource, ResourceBundle, JstlUtils.exposeLocalizationContext(javax.servlet.http.HttpServletRequest, org.springframework.context.MessageSource)

Nested Class Summary
Nested classes/interfaces inherited from class java.util.ResourceBundle
ResourceBundle.Control
Field Summary
Fields inherited from class java.util.ResourceBundle
parent
Constructor Summary
MessageSourceResourceBundle(MessageSource source, Locale locale)
Create a new MessageSourceResourceBundle for the given MessageSource and Locale.
MessageSourceResourceBundle(MessageSource source, Locale locale, ResourceBundle parent)
Create a new MessageSourceResourceBundle for the given MessageSource and Locale.
Method Summary
 Enumeration<String> getKeys()
This implementation returns null, as a MessageSource does not allow for enumerating the defined message codes.
 Locale getLocale()
This implementation exposes the specified Locale for introspection through the standard ResourceBundle.getLocale() method.
protected  Object handleGetObject(String code)
This implementation resolves the code in the MessageSource.
Methods inherited from class java.util.ResourceBundle
clearCache, clearCache, containsKey, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getObject, getString, getStringArray, handleKeySet, keySet, setParent
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MessageSourceResourceBundle

public MessageSourceResourceBundle(MessageSource source,
                                   Locale locale)
Create a new MessageSourceResourceBundle for the given MessageSource and Locale.

Parameters:
source - the MessageSource to retrieve messages from
locale - the Locale to retrieve messages for

MessageSourceResourceBundle

public MessageSourceResourceBundle(MessageSource source,
                                   Locale locale,
                                   ResourceBundle parent)
Create a new MessageSourceResourceBundle for the given MessageSource and Locale.

Parameters:
source - the MessageSource to retrieve messages from
locale - the Locale to retrieve messages for
parent - the parent ResourceBundle to delegate to if no local message found
Method Detail

handleGetObject

protected Object handleGetObject(String code)
This implementation resolves the code in the MessageSource. Returns null if the message could not be resolved.

Specified by:
handleGetObject in class ResourceBundle

getKeys

public Enumeration<String> getKeys()
This implementation returns null, as a MessageSource does not allow for enumerating the defined message codes.

Specified by:
getKeys in class ResourceBundle

getLocale

public Locale getLocale()
This implementation exposes the specified Locale for introspection through the standard ResourceBundle.getLocale() method.

Overrides:
getLocale in class ResourceBundle
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageSourceSupport

org.springframework.context.support
Class MessageSourceSupport

java.lang.Object
    extended by  org.springframework.context.support.MessageSourceSupport
Direct Known Subclasses:
AbstractMessageSource, DelegatingMessageSource
public abstract class MessageSourceSupport
extends Object

Base class for message source implementations, providing support infrastructure such as MessageFormat handling but not implementing concrete methods defined in the MessageSource.

AbstractMessageSource derives from this class, providing concrete getMessage implementations that delegate to a central template method for message code resolution.

Since:
2.5.5
Author:
Juergen Hoeller

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
MessageSourceSupport()
Method Summary
protected MessageFormat | createMessageFormat(String msg, Locale locale) Create a MessageFormat for the given message and Locale.
protected String | formatMessage(String msg, Object[] args, Locale locale) Format the given message String, using cached MessageFormats.
protected boolean | isAlwaysUseMessageFormat() Return whether to always apply the MessageFormat rules, parsing even messages without arguments.
protected String | renderDefaultMessage(String defaultMessage, Object[] args, Locale locale) Render the given default message String.
protected Object[] | resolveArguments(Object[] args, Locale locale) Template method for resolving argument objects.
void | setAlwaysUseMessageFormat(boolean alwaysUseMessageFormat) Set whether to always apply the MessageFormat rules, parsing even messages without arguments.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

MessageSourceSupport

public MessageSourceSupport()
Method Detail

setAlwaysUseMessageFormat

public void setAlwaysUseMessageFormat(boolean alwaysUseMessageFormat)
Set whether to always apply the MessageFormat rules, parsing even messages without arguments.

Default is "false": Messages without arguments are by default returned as-is, without parsing them through MessageFormat. Set this to "true" to enforce MessageFormat for all messages, expecting all message texts to be written with MessageFormat escaping.

For example, MessageFormat expects a single quote to be escaped as "''". If your message texts are all written with such escaping, even when not defining argument placeholders, you need to set this flag to "true". Else, only message texts with actual arguments are supposed to be written with MessageFormat escaping.

See Also:
MessageFormat

isAlwaysUseMessageFormat

protected boolean isAlwaysUseMessageFormat()
Return whether to always apply the MessageFormat rules, parsing even messages without arguments.

formatMessage

protected String formatMessage(String msg,
                               Object[] args,
                               Locale locale)
Format the given message String, using cached MessageFormats. By default invoked for passed-in default messages, to resolve any argument placeholders found in them.

Parameters:
msg - the message to format
args - array of arguments that will be filled in for params within the message, or null if none.
locale - the Locale used for formatting
Returns:
the formatted message (with resolved arguments)

createMessageFormat

protected MessageFormat createMessageFormat(String msg,
                                            Locale locale)
Create a MessageFormat for the given message and Locale.

Parameters:
msg - the message to create a MessageFormat for
locale - the Locale to create a MessageFormat for
Returns:
the MessageFormat instance

resolveArguments

protected Object[] resolveArguments(Object[] args,
                                    Locale locale)
Template method for resolving argument objects.

The default implementation simply returns the given argument array as-is. Can be overridden in subclasses in order to resolve special argument types.

Parameters:
args - the original argument array
locale - the Locale to resolve against
Returns:
the resolved argument array

renderDefaultMessage

protected String renderDefaultMessage(String defaultMessage,
                                      Object[] args,
                                      Locale locale)
Render the given default message String. The default message is passed in as specified by the caller and can be rendered into a fully formatted default message shown to the user.

The default implementation passes the String to formatMessage, resolving any argument placeholders found in them. Subclasses may override this method to plug in custom processing of default messages.

Parameters:
defaultMessage - the passed-in default message String
args - array of arguments that will be filled in for params within the message, or null if none.
locale - the Locale used for formatting
Returns:
the rendered default message (with resolved arguments)
See Also:
formatMessage(String, Object[], java.util.Locale)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ReloadableResourceBundleMessageSource

org.springframework.context.support
Class ReloadableResourceBundleMessageSource

java.lang.Object
    extended by  org.springframework.context.support.MessageSourceSupport
        extended by  org.springframework.context.support.AbstractMessageSource
            extended by  org.springframework.context.support.ReloadableResourceBundleMessageSource
All Implemented Interfaces:
HierarchicalMessageSource, MessageSource, ResourceLoaderAware
public class ReloadableResourceBundleMessageSource
extends AbstractMessageSource
implements ResourceLoaderAware

MessageSource implementation that accesses resource bundles using specified basenames. This class uses Properties instances as its custom data structure for messages, loading them via a PropertiesPersister strategy: The default strategy is capable of loading properties files with a specific character encoding, if desired.

In contrast to ResourceBundleMessageSource, this class supports reloading of properties files through the "cacheSeconds" setting, and also through programmatically clearing the properties cache. Since application servers typically cache all files loaded from the classpath, it is necessary to store resources somewhere else (for example, in the "WEB-INF" directory of a web app). Otherwise changes of files in the classpath will not be reflected in the application.

Note that the base names set as "basenames" property are treated in a slightly different fashion than the "basenames" property of ResourceBundleMessageSource. It follows the basic ResourceBundle rule of not specifying file extension or language codes, but can refer to any Spring resource location (instead of being restricted to classpath resources). With a "classpath:" prefix, resources can still be loaded from the classpath, but "cacheSeconds" values other than "-1" (caching forever) will not work in this case.

This MessageSource implementation is usually slightly faster than ResourceBundleMessageSource, which builds on ResourceBundle - in the default mode, i.e. when caching forever. With "cacheSeconds" set to 1, message lookup takes about twice as long - with the benefit that changes in individual properties files are detected with a maximum delay of 1 second. Higher "cacheSeconds" values usually do not make a significant difference.

This MessageSource can easily be used outside of an ApplicationContext: It will use a DefaultResourceLoader as default, simply getting overridden with the ApplicationContext's resource loader if running in a context. It does not have any other specific dependencies.

Thanks to Thomas Achleitner for providing the initial implementation of this message source!

Author:
Juergen Hoeller
See Also:
setCacheSeconds(int), setBasenames(java.lang.String[]), setDefaultEncoding(java.lang.String), setFileEncodings(java.util.Properties), setPropertiesPersister(org.springframework.util.PropertiesPersister), setResourceLoader(org.springframework.core.io.ResourceLoader), DefaultPropertiesPersister, DefaultResourceLoader, ResourceBundleMessageSource, ResourceBundle

Nested Class Summary
protected  class ReloadableResourceBundleMessageSource.PropertiesHolder
PropertiesHolder for caching.
Field Summary
Fields inherited from class org.springframework.context.support.MessageSourceSupport
logger
Constructor Summary
ReloadableResourceBundleMessageSource()
Method Summary
protected List<String> | calculateAllFilenames(String basename, Locale locale) Calculate all filenames for the given bundle basename and Locale.
protected List<String> | calculateFilenamesForLocale(String basename, Locale locale) Calculate the filenames for the given bundle basename and Locale, appending language code, country code, and variant code.
void | clearCache() Clear the resource bundle cache.
void | clearCacheIncludingAncestors() Clear the resource bundle caches of this MessageSource and all its ancestors.
protected ReloadableResourceBundleMessageSource.PropertiesHolder | getMergedProperties(Locale locale) Get a PropertiesHolder that contains the actually visible properties for a Locale, after merging all specified resource bundles.
protected ReloadableResourceBundleMessageSource.PropertiesHolder | getProperties(String filename) Get a PropertiesHolder for the given filename, either from the cache or freshly loaded.
protected Properties | loadProperties(Resource resource, String filename) Load the properties from the given resource.
protected ReloadableResourceBundleMessageSource.PropertiesHolder | refreshProperties(String filename, ReloadableResourceBundleMessageSource.PropertiesHolder propHolder) Refresh the PropertiesHolder for the given bundle filename.
protected MessageFormat | resolveCode(String code, Locale locale) Resolves the given message code as key in the retrieved bundle files, using a cached MessageFormat instance per message code.
protected String | resolveCodeWithoutArguments(String code, Locale locale) Resolves the given message code as key in the retrieved bundle files, returning the value found in the bundle as-is (without MessageFormat parsing).
void | setBasename(String basename) Set a single basename, following the basic ResourceBundle convention of not specifying file extension or language codes, but in contrast to ResourceBundleMessageSource referring to a Spring resource location: e.g.
void | setBasenames(String[] basenames) Set an array of basenames, each following the basic ResourceBundle convention of not specifying file extension or language codes, but in contrast to ResourceBundleMessageSource referring to a Spring resource location: e.g.
void | setCacheSeconds(int cacheSeconds) Set the number of seconds to cache loaded properties files.
void | setDefaultEncoding(String defaultEncoding) Set the default charset to use for parsing properties files.
void | setFallbackToSystemLocale(boolean fallbackToSystemLocale) Set whether to fall back to the system Locale if no files for a specific Locale have been found.
void | setFileEncodings(Properties fileEncodings) Set per-file charsets to use for parsing properties files.
void | setPropertiesPersister(PropertiesPersister propertiesPersister) Set the PropertiesPersister to use for parsing properties files.
void | setResourceLoader(ResourceLoader resourceLoader) Set the ResourceLoader to use for loading bundle properties files.
String | toString()
Methods inherited from class org.springframework.context.support.AbstractMessageSource
getDefaultMessage, getMessage, getMessage, getMessage, getMessageFromParent, getMessageInternal, getParentMessageSource, isUseCodeAsDefaultMessage, renderDefaultMessage, resolveArguments, setParentMessageSource, setUseCodeAsDefaultMessage
Methods inherited from class org.springframework.context.support.MessageSourceSupport
createMessageFormat, formatMessage, isAlwaysUseMessageFormat, setAlwaysUseMessageFormat
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ReloadableResourceBundleMessageSource

public ReloadableResourceBundleMessageSource()
Method Detail

setBasename

public void setBasename(String basename)
Set a single basename, following the basic ResourceBundle convention of not specifying file extension or language codes, but in contrast to ResourceBundleMessageSource referring to a Spring resource location: e.g. "WEB-INF/messages" for "WEB-INF/messages.properties", "WEB-INF/messages_en.properties", etc.

XML properties files are also supported: .g. "WEB-INF/messages" will find and load "WEB-INF/messages.xml", "WEB-INF/messages_en.xml", etc as well.

Parameters:
basename - the single basename
See Also:
setBasenames(java.lang.String[]), ResourceEditor, ResourceBundle

setBasenames

public void setBasenames(String[] basenames)
Set an array of basenames, each following the basic ResourceBundle convention of not specifying file extension or language codes, but in contrast to ResourceBundleMessageSource referring to a Spring resource location: e.g. "WEB-INF/messages" for "WEB-INF/messages.properties", "WEB-INF/messages_en.properties", etc.

XML properties files are also supported: .g. "WEB-INF/messages" will find and load "WEB-INF/messages.xml", "WEB-INF/messages_en.xml", etc as well.

The associated resource bundles will be checked sequentially when resolving a message code. Note that message definitions in a previous resource bundle will override ones in a later bundle, due to the sequential lookup.

Parameters:
basenames - an array of basenames
See Also:
setBasename(java.lang.String), ResourceBundle

setDefaultEncoding

public void setDefaultEncoding(String defaultEncoding)
Set the default charset to use for parsing properties files. Used if no file-specific charset is specified for a file.

Default is none, using the java.util.Properties default encoding.

Only applies to classic properties files, not to XML files.

Parameters:
defaultEncoding - the default charset
See Also:
setFileEncodings(java.util.Properties), PropertiesPersister.load(java.util.Properties, java.io.InputStream)

setFileEncodings

public void setFileEncodings(Properties fileEncodings)
Set per-file charsets to use for parsing properties files.

Only applies to classic properties files, not to XML files.

Parameters:
fileEncodings - Properties with filenames as keys and charset names as values. Filenames have to match the basename syntax, with optional locale-specific appendices: e.g. "WEB-INF/messages" or "WEB-INF/messages_en".
See Also:
setBasenames(java.lang.String[]), PropertiesPersister.load(java.util.Properties, java.io.InputStream)

setFallbackToSystemLocale

public void setFallbackToSystemLocale(boolean fallbackToSystemLocale)
Set whether to fall back to the system Locale if no files for a specific Locale have been found. Default is "true"; if this is turned off, the only fallback will be the default file (e.g. "messages.properties" for basename "messages").

Falling back to the system Locale is the default behavior of java.util.ResourceBundle. However, this is often not desirable in an application server environment, where the system Locale is not relevant to the application at all: Set this flag to "false" in such a scenario.

setCacheSeconds

public void setCacheSeconds(int cacheSeconds)
Set the number of seconds to cache loaded properties files.
  • Default is "-1", indicating to cache forever (just like java.util.ResourceBundle).
  • A positive number will cache loaded properties files for the given number of seconds. This is essentially the interval between refresh checks. Note that a refresh attempt will first check the last-modified timestamp of the file before actually reloading it; so if files don't change, this interval can be set rather low, as refresh attempts will not actually reload.
  • A value of "0" will check the last-modified timestamp of the file on every message access. Do not use this in a production environment!

setPropertiesPersister

public void setPropertiesPersister(PropertiesPersister propertiesPersister)
Set the PropertiesPersister to use for parsing properties files.

The default is a DefaultPropertiesPersister.

See Also:
DefaultPropertiesPersister

setResourceLoader

public void setResourceLoader(ResourceLoader resourceLoader)
Set the ResourceLoader to use for loading bundle properties files.

The default is a DefaultResourceLoader. Will get overridden by the ApplicationContext if running in a context, as it implements the ResourceLoaderAware interface. Can be manually overridden when running outside of an ApplicationContext.

Specified by:
setResourceLoader in interface ResourceLoaderAware
Parameters:
resourceLoader - ResourceLoader object to be used by this object
See Also:
DefaultResourceLoader, ResourceLoaderAware

resolveCodeWithoutArguments

protected String resolveCodeWithoutArguments(String code,
                                             Locale locale)
Resolves the given message code as key in the retrieved bundle files, returning the value found in the bundle as-is (without MessageFormat parsing).

Overrides:
resolveCodeWithoutArguments in class AbstractMessageSource
Parameters:
code - the code of the message to resolve
locale - the Locale to resolve the code for (subclasses are encouraged to support internationalization)
Returns:
the message String, or null if not found
See Also:
AbstractMessageSource.resolveCode(java.lang.String, java.util.Locale), MessageFormat

resolveCode

protected MessageFormat resolveCode(String code,
                                    Locale locale)
Resolves the given message code as key in the retrieved bundle files, using a cached MessageFormat instance per message code.

Specified by:
resolveCode in class AbstractMessageSource
Parameters:
code - the code of the message to resolve
locale - the Locale to resolve the code for (subclasses are encouraged to support internationalization)
Returns:
the MessageFormat for the message, or null if not found
See Also:
AbstractMessageSource.resolveCodeWithoutArguments(String, java.util.Locale)

getMergedProperties

protected ReloadableResourceBundleMessageSource.PropertiesHolder getMergedProperties(Locale locale)
Get a PropertiesHolder that contains the actually visible properties for a Locale, after merging all specified resource bundles. Either fetches the holder from the cache or freshly loads it.

Only used when caching resource bundle contents forever, i.e. with cacheSeconds < 0. Therefore, merged properties are always cached forever.

calculateAllFilenames

protected List<String> calculateAllFilenames(String basename,
                                             Locale locale)
Calculate all filenames for the given bundle basename and Locale. Will calculate filenames for the given Locale, the system Locale (if applicable), and the default file.

Parameters:
basename - the basename of the bundle
locale - the locale
Returns:
the List of filenames to check
See Also:
setFallbackToSystemLocale(boolean), calculateFilenamesForLocale(java.lang.String, java.util.Locale)

calculateFilenamesForLocale

protected List<String> calculateFilenamesForLocale(String basename,
                                                   Locale locale)
Calculate the filenames for the given bundle basename and Locale, appending language code, country code, and variant code. E.g.: basename "messages", Locale "de_AT_oo" -> "messages_de_AT_OO", "messages_de_AT", "messages_de".

Follows the rules defined by Locale.toString().

Parameters:
basename - the basename of the bundle
locale - the locale
Returns:
the List of filenames to check

getProperties

protected ReloadableResourceBundleMessageSource.PropertiesHolder getProperties(String filename)
Get a PropertiesHolder for the given filename, either from the cache or freshly loaded.

Parameters:
filename - the bundle filename (basename + Locale)
Returns:
the current PropertiesHolder for the bundle

refreshProperties

protected ReloadableResourceBundleMessageSource.PropertiesHolder refreshProperties(String filename,
                                                                                ReloadableResourceBundleMessageSource.PropertiesHolder propHolder)
Refresh the PropertiesHolder for the given bundle filename. The holder can be null if not cached before, or a timed-out cache entry (potentially getting re-validated against the current last-modified timestamp).

Parameters:
filename - the bundle filename (basename + Locale)
propHolder - the current PropertiesHolder for the bundle

loadProperties

protected Properties loadProperties(Resource resource,
                                    String filename)
                             throws IOException
Load the properties from the given resource.

Parameters:
resource - the resource to load from
filename - the original bundle filename (basename + Locale)
Returns:
the populated Properties instance
Throws:
IOException - if properties loading failed

clearCache

public void clearCache()
Clear the resource bundle cache. Subsequent resolve calls will lead to reloading of the properties files.

clearCacheIncludingAncestors

public void clearCacheIncludingAncestors()
Clear the resource bundle caches of this MessageSource and all its ancestors.

See Also:
clearCache()

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ReloadableResourceBundleMessageSource.PropertiesHolder

org.springframework.context.support
Class ReloadableResourceBundleMessageSource.PropertiesHolder

java.lang.Object
    extended by  org.springframework.context.support.ReloadableResourceBundleMessageSource.PropertiesHolder
Enclosing class:
ReloadableResourceBundleMessageSource
protected class ReloadableResourceBundleMessageSource.PropertiesHolder
extends Object

PropertiesHolder for caching. Stores the last-modified timestamp of the source file for efficient change detection, and the timestamp of the last refresh attempt (updated every time the cache entry gets re-validated).

Constructor Summary
ReloadableResourceBundleMessageSource.PropertiesHolder()
ReloadableResourceBundleMessageSource.PropertiesHolder(Properties properties, long fileTimestamp)
Method Summary
long | getFileTimestamp()
MessageFormat | getMessageFormat(String code, Locale locale)
Properties | getProperties()
String | getProperty(String code)
long | getRefreshTimestamp()
void | setRefreshTimestamp(long refreshTimestamp)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ReloadableResourceBundleMessageSource.PropertiesHolder

public ReloadableResourceBundleMessageSource.PropertiesHolder(Properties properties,
                                                              long fileTimestamp)

ReloadableResourceBundleMessageSource.PropertiesHolder

public ReloadableResourceBundleMessageSource.PropertiesHolder()
Method Detail

getProperties

public Properties getProperties()

getFileTimestamp

public long getFileTimestamp()

setRefreshTimestamp

public void setRefreshTimestamp(long refreshTimestamp)

getRefreshTimestamp

public long getRefreshTimestamp()

getProperty

public String getProperty(String code)

getMessageFormat

public MessageFormat getMessageFormat(String code,
                                      Locale locale)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResourceBundleMessageSource

org.springframework.context.support
Class ResourceBundleMessageSource

java.lang.Object
    extended by  org.springframework.context.support.MessageSourceSupport
        extended by  org.springframework.context.support.AbstractMessageSource
            extended by  org.springframework.context.support.ResourceBundleMessageSource
All Implemented Interfaces:
BeanClassLoaderAware, HierarchicalMessageSource, MessageSource
public class ResourceBundleMessageSource
extends AbstractMessageSource
implements BeanClassLoaderAware

MessageSource implementation that accesses resource bundles using specified basenames. This class relies on the underlying JDK's ResourceBundle implementation, in combination with the JDK's standard message parsing provided by MessageFormat.

This MessageSource caches both the accessed ResourceBundle instances and the generated MessageFormats for each message. It also implements rendering of no-arg messages without MessageFormat, as supported by the AbstractMessageSource base class. The caching provided by this MessageSource is significantly faster than the built-in caching of the java.util.ResourceBundle class.

Unfortunately, java.util.ResourceBundle caches loaded bundles forever: Reloading a bundle during VM execution is not possible. As this MessageSource relies on ResourceBundle, it faces the same limitation. Consider ReloadableResourceBundleMessageSource for an alternative that is capable of refreshing the underlying bundle files.

Author:
Rod Johnson, Juergen Hoeller
See Also:
setBasenames(java.lang.String[]), ReloadableResourceBundleMessageSource, ResourceBundle, MessageFormat

Field Summary
Fields inherited from class org.springframework.context.support.MessageSourceSupport
logger
Constructor Summary
ResourceBundleMessageSource()
Method Summary
protected ResourceBundle | doGetBundle(String basename, Locale locale) Obtain the resource bundle for the given basename and Locale.
protected ClassLoader | getBundleClassLoader() Return the ClassLoader to load resource bundles with.
protected MessageFormat | getMessageFormat(ResourceBundle bundle, String code, Locale locale) Return a MessageFormat for the given bundle and code, fetching already generated MessageFormats from the cache.
protected ResourceBundle | getResourceBundle(String basename, Locale locale) Return a ResourceBundle for the given basename and code, fetching already generated MessageFormats from the cache.
protected MessageFormat | resolveCode(String code, Locale locale) Resolves the given message code as key in the registered resource bundles, using a cached MessageFormat instance per message code.
protected String | resolveCodeWithoutArguments(String code, Locale locale) Resolves the given message code as key in the registered resource bundles, returning the value found in the bundle as-is (without MessageFormat parsing).
void | setBasename(String basename) Set a single basename, following ResourceBundle conventions: essentially, a fully-qualified classpath location.
void | setBasenames(String[] basenames) Set an array of basenames, each following ResourceBundle conventions: essentially, a fully-qualified classpath location.
void | setBeanClassLoader(ClassLoader classLoader) Callback that supplies the bean class loader to a bean instance.
void | setBundleClassLoader(ClassLoader classLoader) Set the ClassLoader to load resource bundles with.
String | toString() Show the configuration of this MessageSource.
Methods inherited from class org.springframework.context.support.AbstractMessageSource
getDefaultMessage, getMessage, getMessage, getMessage, getMessageFromParent, getMessageInternal, getParentMessageSource, isUseCodeAsDefaultMessage, renderDefaultMessage, resolveArguments, setParentMessageSource, setUseCodeAsDefaultMessage
Methods inherited from class org.springframework.context.support.MessageSourceSupport
createMessageFormat, formatMessage, isAlwaysUseMessageFormat, setAlwaysUseMessageFormat
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ResourceBundleMessageSource

public ResourceBundleMessageSource()
Method Detail

setBasename

public void setBasename(String basename)
Set a single basename, following ResourceBundle conventions: essentially, a fully-qualified classpath location. If it doesn't contain a package qualifier (such as org.mypackage), it will be resolved from the classpath root.

Messages will normally be held in the "/lib" or "/classes" directory of a web application's WAR structure. They can also be held in jar files on the class path.

Note that ResourceBundle names are effectively classpath locations: As a consequence, the JDK's standard ResourceBundle treats dots as package separators. This means that "test.theme" is effectively equivalent to "test/theme", just like it is for programmatic java.util.ResourceBundle usage.

See Also:
setBasenames(java.lang.String[]), ResourceBundle.getBundle(String)

setBasenames

public void setBasenames(String[] basenames)
Set an array of basenames, each following ResourceBundle conventions: essentially, a fully-qualified classpath location. If it doesn't contain a package qualifier (such as org.mypackage), it will be resolved from the classpath root.

The associated resource bundles will be checked sequentially when resolving a message code. Note that message definitions in a previous resource bundle will override ones in a later bundle, due to the sequential lookup.

Note that ResourceBundle names are effectively classpath locations: As a consequence, the JDK's standard ResourceBundle treats dots as package separators. This means that "test.theme" is effectively equivalent to "test/theme", just like it is for programmatic java.util.ResourceBundle usage.

See Also:
setBasename(java.lang.String), ResourceBundle.getBundle(String)

setBundleClassLoader

public void setBundleClassLoader(ClassLoader classLoader)
Set the ClassLoader to load resource bundles with.

Default is the containing BeanFactory's bean ClassLoader, or the default ClassLoader determined by ClassUtils.getDefaultClassLoader() if not running within a BeanFactory.

getBundleClassLoader

protected ClassLoader getBundleClassLoader()
Return the ClassLoader to load resource bundles with.

Default is the containing BeanFactory's bean ClassLoader.

See Also:
setBundleClassLoader(java.lang.ClassLoader)

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

resolveCodeWithoutArguments

protected String resolveCodeWithoutArguments(String code,
                                             Locale locale)
Resolves the given message code as key in the registered resource bundles, returning the value found in the bundle as-is (without MessageFormat parsing).

Overrides:
resolveCodeWithoutArguments in class AbstractMessageSource
Parameters:
code - the code of the message to resolve
locale - the Locale to resolve the code for (subclasses are encouraged to support internationalization)
Returns:
the message String, or null if not found
See Also:
AbstractMessageSource.resolveCode(java.lang.String, java.util.Locale), MessageFormat

resolveCode

protected MessageFormat resolveCode(String code,
                                    Locale locale)
Resolves the given message code as key in the registered resource bundles, using a cached MessageFormat instance per message code.

Specified by:
resolveCode in class AbstractMessageSource
Parameters:
code - the code of the message to resolve
locale - the Locale to resolve the code for (subclasses are encouraged to support internationalization)
Returns:
the MessageFormat for the message, or null if not found
See Also:
AbstractMessageSource.resolveCodeWithoutArguments(String, java.util.Locale)

getResourceBundle

protected ResourceBundle getResourceBundle(String basename,
                                           Locale locale)
Return a ResourceBundle for the given basename and code, fetching already generated MessageFormats from the cache.

Parameters:
basename - the basename of the ResourceBundle
locale - the Locale to find the ResourceBundle for
Returns:
the resulting ResourceBundle, or null if none found for the given basename and Locale

doGetBundle

protected ResourceBundle doGetBundle(String basename,
                                     Locale locale)
                              throws MissingResourceException
Obtain the resource bundle for the given basename and Locale.

Parameters:
basename - the basename to look for
locale - the Locale to look for
Returns:
the corresponding ResourceBundle
Throws:
MissingResourceException - if no matching bundle could be found
See Also:
ResourceBundle.getBundle(String, java.util.Locale, ClassLoader), getBundleClassLoader()

getMessageFormat

protected MessageFormat getMessageFormat(ResourceBundle bundle,
                                         String code,
                                         Locale locale)
                                  throws MissingResourceException
Return a MessageFormat for the given bundle and code, fetching already generated MessageFormats from the cache.

Parameters:
bundle - the ResourceBundle to work on
code - the message code to retrieve
locale - the Locale to use to build the MessageFormat
Returns:
the resulting MessageFormat, or null if no message defined for the given code
Throws:
MissingResourceException - if thrown by the ResourceBundle

toString

public String toString()
Show the configuration of this MessageSource.

Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleThreadScope

org.springframework.context.support
Class SimpleThreadScope

java.lang.Object
    extended by  org.springframework.context.support.SimpleThreadScope
All Implemented Interfaces:
Scope
public class SimpleThreadScope
extends Object
implements Scope

Thread-backed Scope implementation.

Note that the SimpleThreadScope does not clean up any objects associated with it. As such, it's typically preferable to use the RequestScope in Web environments.

For a implementation of a thread-based Scope with support for destruction callbacks, refer to this module.

Thanks to Eugene Kuleshov for submitting the original prototype for a thread scope!

Since:
3.0
Author:
Arjen Poutsma, Juergen Hoeller
See Also:
RequestScope

Constructor Summary
SimpleThreadScope()
Method Summary
Object | get(String name, ObjectFactory objectFactory) Return the object with the given name from the underlying scope, creating it if not found in the underlying storage mechanism.
String | getConversationId() Return the conversation ID for the current underlying scope, if any.
void | registerDestructionCallback(String name, Runnable callback) Register a callback to be executed on destruction of the specified object in the scope (or at destruction of the entire scope, if the scope does not destroy individual objects but rather only terminates in its entirety).
Object | remove(String name) Remove the object with the given name from the underlying scope.
Object | resolveContextualObject(String key) Resolve the contextual object for the given key, if any.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleThreadScope

public SimpleThreadScope()
Method Detail

get

public Object get(String name,
                  ObjectFactory objectFactory)
Description copied from interface: Scope
Return the object with the given name from the underlying scope, creating it if not found in the underlying storage mechanism.

This is the central operation of a Scope, and the only operation that is absolutely required.

Specified by:
get in interface Scope
Parameters:
name - the name of the object to retrieve
objectFactory - the ObjectFactory to use to create the scoped object if it is not present in the underlying storage mechanism
Returns:
the desired object (never null)

remove

public Object remove(String name)
Description copied from interface: Scope
Remove the object with the given name from the underlying scope.

Returns null if no object was found; otherwise returns the removed Object.

Note that an implementation should also remove a registered destruction callback for the specified object, if any. It does, however, not need to execute a registered destruction callback in this case, since the object will be destroyed by the caller (if appropriate).

Note: This is an optional operation. Implementations may throw UnsupportedOperationException if they do not support explicitly removing an object.

Specified by:
remove in interface Scope
Parameters:
name - the name of the object to remove
Returns:
the removed object, or null if no object was present
See Also:
Scope.registerDestructionCallback(java.lang.String, java.lang.Runnable)

registerDestructionCallback

public void registerDestructionCallback(String name,
                                        Runnable callback)
Description copied from interface: Scope
Register a callback to be executed on destruction of the specified object in the scope (or at destruction of the entire scope, if the scope does not destroy individual objects but rather only terminates in its entirety).

Note: This is an optional operation. This method will only be called for scoped beans with actual destruction configuration (DisposableBean, destroy-method, DestructionAwareBeanPostProcessor). Implementations should do their best to execute a given callback at the appropriate time. If such a callback is not supported by the underlying runtime environment at all, the callback must be ignored and a corresponding warning should be logged.

Note that 'destruction' refers to to automatic destruction of the object as part of the scope's own lifecycle, not to the individual scoped object having been explicitly removed by the application. If a scoped object gets removed via this facade's Scope.remove(String) method, any registered destruction callback should be removed as well, assuming that the removed object will be reused or manually destroyed.

Specified by:
registerDestructionCallback in interface Scope
Parameters:
name - the name of the object to execute the destruction callback for
callback - the destruction callback to be executed. Note that the passed-in Runnable will never throw an exception, so it can safely be executed without an enclosing try-catch block. Furthermore, the Runnable will usually be serializable, provided that its target object is serializable as well.
See Also:
DisposableBean, AbstractBeanDefinition.getDestroyMethodName(), DestructionAwareBeanPostProcessor

resolveContextualObject

public Object resolveContextualObject(String key)
Description copied from interface: Scope
Resolve the contextual object for the given key, if any. E.g. the HttpServletRequest object for key "request".

Specified by:
resolveContextualObject in interface Scope
Parameters:
key - the contextual key
Returns:
the corresponding object, or null if none found

getConversationId

public String getConversationId()
Description copied from interface: Scope
Return the conversation ID for the current underlying scope, if any.

The exact meaning of the conversation ID depends on the underlying storage mechanism. In the case of session-scoped objects, the conversation ID would typically be equal to (or derived from) the session ID; in the case of a custom conversation that sits within the overall session, the specific ID for the current conversation would be appropriate.

Note: This is an optional operation. It is perfectly valid to return null in an implementation of this method if the underlying storage mechanism has no obvious candidate for such an ID.

Specified by:
getConversationId in interface Scope
Returns:
the conversation ID, or null if there is no conversation ID for the current scope
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StaticApplicationContext

org.springframework.context.support
Class StaticApplicationContext

java.lang.Object
    extended by  org.springframework.core.io.DefaultResourceLoader
        extended by  org.springframework.context.support.AbstractApplicationContext
            extended by  org.springframework.context.support.GenericApplicationContext
                extended by  org.springframework.context.support.StaticApplicationContext
All Implemented Interfaces:
BeanFactory, DisposableBean, HierarchicalBeanFactory, ListableBeanFactory, BeanDefinitionRegistry, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, AliasRegistry, ResourceLoader, ResourcePatternResolver
Direct Known Subclasses:
StaticPortletApplicationContext, StaticWebApplicationContext
public class StaticApplicationContext
extends GenericApplicationContext

ApplicationContext implementation which supports programmatic registration of beans and messages, rather than reading bean definitions from external configuration sources. Mainly useful for testing.

Author:
Rod Johnson, Juergen Hoeller
See Also:
registerSingleton(java.lang.String, java.lang.Class),
registerPrototype(java.lang.String, java.lang.Class),
GenericApplicationContext.registerBeanDefinition(java.lang.String, org.springframework.beans.factory.config.BeanDefinition),
AbstractApplicationContext.refresh()

Field Summary
Fields inherited from class org.springframework.context.support.AbstractApplicationContext
APPLICATION_EVENT_MULTICASTER_BEAN_NAME, LIFECYCLE_PROCESSOR_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAME
Fields inherited from interface org.springframework.context.ConfigurableApplicationContext
CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAME
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Constructor Summary
StaticApplicationContext()
Create a new StaticApplicationContext.
StaticApplicationContext(ApplicationContext parent)
Create a new StaticApplicationContext with the given parent.
Method Summary
void | addMessage(String code, Locale locale, String defaultMessage) Associate the given message with the given code.
StaticMessageSource | getStaticMessageSource() Return the internal StaticMessageSource used by this context.
void | registerPrototype(String name, Class clazz) Register a prototype bean with the underlying bean factory.
void | registerPrototype(String name, Class clazz, MutablePropertyValues pvs) Register a prototype bean with the underlying bean factory.
void | registerSingleton(String name, Class clazz) Register a singleton bean with the underlying bean factory.
void | registerSingleton(String name, Class clazz, MutablePropertyValues pvs) Register a singleton bean with the underlying bean factory.
Methods inherited from class org.springframework.context.support.GenericApplicationContext
closeBeanFactory, getBeanDefinition, getBeanFactory, getDefaultListableBeanFactory, getResource, getResources, isAlias, isBeanNameInUse, refreshBeanFactory, registerAlias, registerBeanDefinition, removeAlias, removeBeanDefinition, setAllowBeanDefinitionOverriding, setAllowCircularReferences, setId, setParent, setResourceLoader
Methods inherited from class org.springframework.context.support.AbstractApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, addListener, cancelRefresh, close, containsBean, containsBeanDefinition, containsLocalBean, destroy, destroyBeans, doClose, findAnnotationOnBean, finishBeanFactoryInitialization, finishRefresh, getAliases, getApplicationListeners, getAutowireCapableBeanFactory, getBean, getBean, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getDisplayName, getId, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getResourcePatternResolver, getStartupDate, getType, initApplicationEventMulticaster, initLifecycleProcessor, initMessageSource, invokeBeanFactoryPostProcessors, isActive, isPrototype, isRunning, isSingleton, isTypeMatch, obtainFreshBeanFactory, onClose, onRefresh, postProcessBeanFactory, prepareBeanFactory, prepareRefresh, publishEvent, refresh, registerBeanPostProcessors, registerListeners, registerShutdownHook, setDisplayName, start, stop, toString
Methods inherited from class org.springframework.core.io.DefaultResourceLoader
getClassLoader, getResourceByPath, setClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.support.BeanDefinitionRegistry
containsBeanDefinition, getBeanDefinitionCount, getBeanDefinitionNames
Methods inherited from interface org.springframework.core.AliasRegistry
getAliases
Methods inherited from interface org.springframework.core.io.ResourceLoader
getClassLoader

Constructor Detail

StaticApplicationContext

public StaticApplicationContext()
                         throws BeansException
Create a new StaticApplicationContext.

Throws:
BeansException
See Also:
registerSingleton(java.lang.String, java.lang.Class),
registerPrototype(java.lang.String, java.lang.Class),
GenericApplicationContext.registerBeanDefinition(java.lang.String, org.springframework.beans.factory.config.BeanDefinition),
AbstractApplicationContext.refresh()

StaticApplicationContext

public StaticApplicationContext(ApplicationContext parent)
                         throws BeansException
Create a new StaticApplicationContext with the given parent.

Throws:
BeansException
See Also:
registerSingleton(java.lang.String, java.lang.Class),
registerPrototype(java.lang.String, java.lang.Class),
GenericApplicationContext.registerBeanDefinition(java.lang.String, org.springframework.beans.factory.config.BeanDefinition),
AbstractApplicationContext.refresh()
Method Detail

getStaticMessageSource

public final StaticMessageSource getStaticMessageSource()
Return the internal StaticMessageSource used by this context. Can be used to register messages on it.

See Also:
addMessage(java.lang.String, java.util.Locale, java.lang.String)

registerSingleton

public void registerSingleton(String name,
                              Class clazz)
                       throws BeansException
Register a singleton bean with the underlying bean factory.

For more advanced needs, register with the underlying BeanFactory directly.

Throws:
BeansException
See Also:
GenericApplicationContext.getDefaultListableBeanFactory()

registerSingleton

public void registerSingleton(String name,
                              Class clazz,
                              MutablePropertyValues pvs)
                       throws BeansException
Register a singleton bean with the underlying bean factory.

For more advanced needs, register with the underlying BeanFactory directly.

Throws:
BeansException
See Also:
GenericApplicationContext.getDefaultListableBeanFactory()

registerPrototype

public void registerPrototype(String name,
                              Class clazz)
                       throws BeansException
Register a prototype bean with the underlying bean factory.

For more advanced needs, register with the underlying BeanFactory directly.

Throws:
BeansException
See Also:
GenericApplicationContext.getDefaultListableBeanFactory()

registerPrototype

public void registerPrototype(String name,
                              Class clazz,
                              MutablePropertyValues pvs)
                       throws BeansException
Register a prototype bean with the underlying bean factory.

For more advanced needs, register with the underlying BeanFactory directly.

Throws:
BeansException
See Also:
GenericApplicationContext.getDefaultListableBeanFactory()

addMessage

public void addMessage(String code,
                       Locale locale,
                       String defaultMessage)
Associate the given message with the given code.

Parameters:
code - lookup code
locale - locale message should be found within
defaultMessage - message associated with this lookup code
See Also:
getStaticMessageSource()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StaticMessageSource

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.context.support
Class StaticMessageSource

java.lang.Object
    extended by  org.springframework.context.support.MessageSourceSupport
        extended by  org.springframework.context.support.AbstractMessageSource
            extended by  org.springframework.context.support.StaticMessageSource
All Implemented Interfaces:
HierarchicalMessageSource, MessageSource
public class StaticMessageSource
extends AbstractMessageSource

Simple implementation of MessageSource which allows messages to be registered programmatically. This MessageSource supports basic internationalization.

Intended for testing rather than for use in production systems.

Author:
Rod Johnson, Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.context.support.MessageSourceSupport
logger
Constructor Summary
StaticMessageSource()
Method Summary
void | addMessage(String code, Locale locale, String msg) Associate the given message with the given code.
void | addMessages(Map<String,String> messages, Locale locale) Associate the given message values with the given keys as codes.
protected MessageFormat | resolveCode(String code, Locale locale) Subclasses must implement this method to resolve a message.
String | toString()
Methods inherited from class org.springframework.context.support.AbstractMessageSource
getDefaultMessage, getMessage, getMessage, getMessage, getMessageFromParent, getMessageInternal, getParentMessageSource, isUseCodeAsDefaultMessage, renderDefaultMessage, resolveArguments, resolveCodeWithoutArguments, setParentMessageSource, setUseCodeAsDefaultMessage
Methods inherited from class org.springframework.context.support.MessageSourceSupport
createMessageFormat, formatMessage, isAlwaysUseMessageFormat, setAlwaysUseMessageFormat
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

StaticMessageSource

public StaticMessageSource()
Method Detail

resolveCode

protected MessageFormat resolveCode(String code,
                                    Locale locale)
Description copied from class: AbstractMessageSource
Subclasses must implement this method to resolve a message.

Returns a MessageFormat instance rather than a message String, to allow for appropriate caching of MessageFormats in subclasses.

Subclasses are encouraged to provide optimized resolution for messages without arguments, not involving MessageFormat. See the AbstractMessageSource.resolveCodeWithoutArguments(java.lang.String, java.util.Locale) javadoc for details.

Specified by:
resolveCode in class AbstractMessageSource
Parameters:
code - the code of the message to resolve
locale - the Locale to resolve the code for (subclasses are encouraged to support internationalization)
Returns:
the MessageFormat for the message, or null if not found
See Also:
AbstractMessageSource.resolveCodeWithoutArguments(String, java.util.Locale)

addMessage

public void addMessage(String code,
                       Locale locale,
                       String msg)
Associate the given message with the given code.

Parameters:
code - the lookup code
locale - the locale that the message should be found within
msg - the message associated with this lookup code

addMessages

public void addMessages(Map<String,String> messages,
                        Locale locale)
Associate the given message values with the given keys as codes.

Parameters:
messages - the messages to register, with messages codes as keys and message texts as values
locale - the locale that the messages should be found within

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.context.weaving

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.context.weaving

Load-time weaving support for a Spring application context, building on Spring's LoadTimeWeaver abstraction.

See:
Description

Interface Summary
LoadTimeWeaverAware Interface to be implemented by any object that wishes to be notified of the application context's default LoadTimeWeaver.

Class Summary
AspectJWeavingEnabler | Post-processor that registers AspectJ's ClassPreProcessorAgentAdapter with the Spring application context's default LoadTimeWeaver.
DefaultContextLoadTimeWeaver | Default LoadTimeWeaver bean for use in an application context, decorating an automatically detected internal LoadTimeWeaver.
LoadTimeWeaverAwareProcessor | BeanPostProcessor implementation that passes the context's default LoadTimeWeaver to beans that implement the LoadTimeWeaverAware interface.

Package org.springframework.context.weaving Description

Load-time weaving support for a Spring application context, building on Spring's LoadTimeWeaver abstraction.


org.springframework.context.weaving Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.context.weaving

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.context.weaving.AspectJWeavingEnabler (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.context.weaving.LoadTimeWeaverAware, org.springframework.core.Ordered)
    • org.springframework.context.weaving.DefaultContextLoadTimeWeaver (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.DisposableBean, org.springframework.instrument.classloading.LoadTimeWeaver)
    • org.springframework.context.weaving.LoadTimeWeaverAwareProcessor (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.config.BeanPostProcessor)

Interface Hierarchy

  • org.springframework.context.weaving.LoadTimeWeaverAware


LoadTimeWeaverAware

org.springframework.context.weaving
Interface LoadTimeWeaverAware

All Known Implementing Classes:
AspectJWeavingEnabler, DefaultPersistenceUnitManager, LocalContainerEntityManagerFactoryBean
public interface LoadTimeWeaverAware

Interface to be implemented by any object that wishes to be notified of the application context's default LoadTimeWeaver.

Since:
2.5
Author:
Juergen Hoeller
See Also:
ConfigurableApplicationContext.LOAD_TIME_WEAVER_BEAN_NAME

Method Summary
 void setLoadTimeWeaver(LoadTimeWeaver loadTimeWeaver)
Set the LoadTimeWeaver of this object's containing ApplicationContext.

Method Detail

setLoadTimeWeaver

void setLoadTimeWeaver(LoadTimeWeaver loadTimeWeaver)
Set the LoadTimeWeaver of this object's containing ApplicationContext.

Invoked after the population of normal bean properties but before an initialization callback like InitializingBean's afterPropertiesSet() or a custom init-method. Invoked after ApplicationContextAware's setApplicationContext(..).

NOTE: This method will only be called if there actually is a LoadTimeWeaver available in the application context. If there is none, the method will simply not get invoked, assuming that the implementing object is able to activate its weaving dependency accordingly.

Parameters:
loadTimeWeaver - the LoadTimeWeaver instance (never null)
See Also:
InitializingBean.afterPropertiesSet(), ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AspectJWeavingEnabler

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.context.weaving
Class AspectJWeavingEnabler

java.lang.Object
    extended by  org.springframework.context.weaving.AspectJWeavingEnabler
All Implemented Interfaces:
BeanClassLoaderAware, BeanFactoryPostProcessor, LoadTimeWeaverAware, Ordered
public class AspectJWeavingEnabler
extends Object
implements BeanFactoryPostProcessor, BeanClassLoaderAware, LoadTimeWeaverAware, Ordered

Post-processor that registers AspectJ's ClassPreProcessorAgentAdapter with the Spring application context's default LoadTimeWeaver.

Since:
2.5
Author:
Juergen Hoeller, Ramnivas Laddad

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AspectJWeavingEnabler()
Method Summary
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
void | postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) Modify the application context's internal bean factory after its standard initialization.
void | setBeanClassLoader(ClassLoader classLoader) Callback that supplies the bean class loader to a bean instance.
void | setLoadTimeWeaver(LoadTimeWeaver loadTimeWeaver) Set the LoadTimeWeaver of this object's containing ApplicationContext.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AspectJWeavingEnabler

public AspectJWeavingEnabler()
Method Detail

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

setLoadTimeWeaver

public void setLoadTimeWeaver(LoadTimeWeaver loadTimeWeaver)
Description copied from interface: LoadTimeWeaverAware
Set the LoadTimeWeaver of this object's containing ApplicationContext.

Invoked after the population of normal bean properties but before an initialization callback like InitializingBean's afterPropertiesSet() or a custom init-method. Invoked after ApplicationContextAware's setApplicationContext(..).

NOTE: This method will only be called if there actually is a LoadTimeWeaver available in the application context. If there is none, the method will simply not get invoked, assuming that the implementing object is able to activate its weaving dependency accordingly.

Specified by:
setLoadTimeWeaver in interface LoadTimeWeaverAware
Parameters:
loadTimeWeaver - the LoadTimeWeaver instance (never null)
See Also:
InitializingBean.afterPropertiesSet(), ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

postProcessBeanFactory

public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
                            throws BeansException
Description copied from interface: BeanFactoryPostProcessor
Modify the application context's internal bean factory after its standard initialization. All bean definitions will have been loaded, but no beans will have been instantiated yet. This allows for overriding or adding properties even to eager-initializing beans.

Specified by:
postProcessBeanFactory in interface BeanFactoryPostProcessor
Parameters:
beanFactory - the bean factory used by the application context
Throws:
BeansException - in case of errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


DefaultContextLoadTimeWeaver

org.springframework.context.weaving
Class DefaultContextLoadTimeWeaver

java.lang.Object
    extended by  org.springframework.context.weaving.DefaultContextLoadTimeWeaver
All Implemented Interfaces:
BeanClassLoaderAware, DisposableBean, LoadTimeWeaver
public class DefaultContextLoadTimeWeaver
extends Object
implements LoadTimeWeaver, BeanClassLoaderAware, DisposableBean

Default LoadTimeWeaver bean for use in an application context, decorating an automatically detected internal LoadTimeWeaver.

Typically registered for the default bean name "loadTimeWeaver"; the most convenient way to achieve this is Spring's <context:load-time-weaver> XML tag.

This class implements a runtime environment check for obtaining the appropriate weaver implementation: As of Spring 2.5, it detects Sun's GlassFish, Oracle's OC4J, BEA's WebLogic 10, Spring's VM agent and any ClassLoader supported by Spring's ReflectiveLoadTimeWeaver (for example the TomcatInstrumentableClassLoader).

Since:
2.5
Author:
Juergen Hoeller, Ramnivas Laddad
See Also:
ConfigurableApplicationContext.LOAD_TIME_WEAVER_BEAN_NAME

Field Summary
protected  Log logger
Constructor Summary
DefaultContextLoadTimeWeaver()
Method Summary
void | addTransformer(ClassFileTransformer transformer) Add a ClassFileTransformer to be applied by this LoadTimeWeaver.
protected LoadTimeWeaver | createServerSpecificLoadTimeWeaver(ClassLoader classLoader)
void | destroy() Invoked by a BeanFactory on destruction of a singleton.
ClassLoader | getInstrumentableClassLoader() Return a ClassLoader that supports instrumentation through AspectJ-style load-time weaving based on user-defined ClassFileTransformers.
ClassLoader | getThrowawayClassLoader() Return a throwaway ClassLoader, enabling classes to be loaded and inspected without affecting the parent ClassLoader.
void | setBeanClassLoader(ClassLoader classLoader) Callback that supplies the bean class loader to a bean instance.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Constructor Detail

DefaultContextLoadTimeWeaver

public DefaultContextLoadTimeWeaver()
Method Detail

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

createServerSpecificLoadTimeWeaver

protected LoadTimeWeaver createServerSpecificLoadTimeWeaver(ClassLoader classLoader)

destroy

public void destroy()
Description copied from interface: DisposableBean
Invoked by a BeanFactory on destruction of a singleton.

Specified by:
destroy in interface DisposableBean

addTransformer

public void addTransformer(ClassFileTransformer transformer)
Description copied from interface: LoadTimeWeaver
Add a ClassFileTransformer to be applied by this LoadTimeWeaver.

Specified by:
addTransformer in interface LoadTimeWeaver
Parameters:
transformer - the ClassFileTransformer to add

getInstrumentableClassLoader

public ClassLoader getInstrumentableClassLoader()
Description copied from interface: LoadTimeWeaver
Return a ClassLoader that supports instrumentation through AspectJ-style load-time weaving based on user-defined ClassFileTransformers.

May be the current ClassLoader, or a ClassLoader created by this LoadTimeWeaver instance.

Specified by:
getInstrumentableClassLoader in interface LoadTimeWeaver
Returns:
the ClassLoader which will expose instrumented classes according to the registered transformers

getThrowawayClassLoader

public ClassLoader getThrowawayClassLoader()
Description copied from interface: LoadTimeWeaver
Return a throwaway ClassLoader, enabling classes to be loaded and inspected without affecting the parent ClassLoader.

Should not return the same instance of the ClassLoader returned from an invocation of LoadTimeWeaver.getInstrumentableClassLoader().

Specified by:
getThrowawayClassLoader in interface LoadTimeWeaver
Returns:
a temporary throwaway ClassLoader; should return a new instance for each call, with no existing state
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LoadTimeWeaverAwareProcessor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.context.weaving
Class LoadTimeWeaverAwareProcessor

java.lang.Object
    extended by  org.springframework.context.weaving.LoadTimeWeaverAwareProcessor
All Implemented Interfaces:
BeanFactoryAware, BeanPostProcessor
public class LoadTimeWeaverAwareProcessor
extends Object
implements BeanPostProcessor, BeanFactoryAware

BeanPostProcessor implementation that passes the context's default LoadTimeWeaver to beans that implement the LoadTimeWeaverAware interface.

Application contexts will automatically register this with their underlying bean factory, provided that a default LoadTimeWeaver is actually available.

Applications should not use this class directly.

Since:
2.5
Author:
Juergen Hoeller
See Also:
LoadTimeWeaverAware, ConfigurableApplicationContext.LOAD_TIME_WEAVER_BEAN_NAME

Constructor Summary
LoadTimeWeaverAwareProcessor()
Create a new LoadTimeWeaverAwareProcessor that will auto-retrieve the LoadTimeWeaver from the containing BeanFactory, expecting a bean named "loadTimeWeaver".
LoadTimeWeaverAwareProcessor(BeanFactory beanFactory)
Create a new LoadTimeWeaverAwareProcessor.
LoadTimeWeaverAwareProcessor(LoadTimeWeaver loadTimeWeaver)
Create a new LoadTimeWeaverAwareProcessor for the given LoadTimeWeaver.
Method Summary
Object | postProcessAfterInitialization(Object bean, String name) Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).
Object | postProcessBeforeInitialization(Object bean, String beanName) Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).
void | setBeanFactory(BeanFactory beanFactory) Callback that supplies the owning factory to a bean instance.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

LoadTimeWeaverAwareProcessor

public LoadTimeWeaverAwareProcessor()
Create a new LoadTimeWeaverAwareProcessor that will auto-retrieve the LoadTimeWeaver from the containing BeanFactory, expecting a bean named "loadTimeWeaver".

LoadTimeWeaverAwareProcessor

public LoadTimeWeaverAwareProcessor(LoadTimeWeaver loadTimeWeaver)
Create a new LoadTimeWeaverAwareProcessor for the given LoadTimeWeaver.

If the given loadTimeWeaver is null, then a LoadTimeWeaver will be auto-retrieved from the containing BeanFactory, expecting a bean named "loadTimeWeaver".

Parameters:
loadTimeWeaver - the specific LoadTimeWeaver that is to be used

LoadTimeWeaverAwareProcessor

public LoadTimeWeaverAwareProcessor(BeanFactory beanFactory)
Create a new LoadTimeWeaverAwareProcessor.

The LoadTimeWeaver will be auto-retrieved from the given BeanFactory, expecting a bean named "loadTimeWeaver".

Parameters:
beanFactory - the BeanFactory to retrieve the LoadTimeWeaver from
Method Detail

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
BeanInitializationException

postProcessBeforeInitialization

public Object postProcessBeforeInitialization(Object bean,
                                              String beanName)
                                       throws BeansException
Description copied from interface: BeanPostProcessor
Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

Specified by:
postProcessBeforeInitialization in interface BeanPostProcessor
Parameters:
bean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
Throws:
BeansException - in case of errors
See Also:
InitializingBean.afterPropertiesSet()

postProcessAfterInitialization

public Object postProcessAfterInitialization(Object bean,
                                             String name)
Description copied from interface: BeanPostProcessor
Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

In case of a FactoryBean, this callback will be invoked for both the FactoryBean instance and the objects created by the FactoryBean (as of Spring 2.0). The post-processor can decide whether to apply to either the FactoryBean or created objects or both through corresponding bean instanceof FactoryBean checks.

This callback will also be invoked after a short-circuiting triggered by a InstantiationAwareBeanPostProcessor.postProcessBeforeInstantiation(java.lang.Class, java.lang.String) method, in contrast to all other BeanPostProcessor callbacks.

Specified by:
postProcessAfterInitialization in interface BeanPostProcessor
Parameters:
bean - the new bean instance
name - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
See Also:
InitializingBean.afterPropertiesSet(), FactoryBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.core

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.core

Provides basic classes for exception handling and version detection, and other core helpers that are not specific to any part of the framework.

See:
Description

Interface Summary
AliasRegistry | Common interface for managing aliases.
AttributeAccessor | Interface defining a generic contract for attaching and accessing metadata to/from arbitrary objects.
ConcurrentMap | Deprecated. as of Spring 3.0, since standard ConcurrentMap is available on Java 5+ anyway
ControlFlow | Interface to be implemented by objects that can return information about the current call stack.
ErrorCoded | Interface that can be implemented by exceptions etc that are error coded.
InfrastructureProxy | Interface to be implemented by transparent resource proxies that need to be considered as equal to the underlying resource, for example for consistent lookup key comparisons.
Ordered | Interface that can be implemented by objects that should be orderable, for example in a Collection.
ParameterNameDiscoverer | Interface to discover parameter names for methods and constructors.
PriorityOrdered | Extension of the Ordered interface, expressing a 'priority' ordering: Order values expressed by PriorityOrdered objects always apply before order values of 'plain' Ordered values.
SmartClassLoader | Interface to be implemented by a reloading-aware ClassLoader (e.g.

Class Summary
AttributeAccessorSupport | Support class for AttributeAccessors, providing a base implementation of all methods.
BridgeMethodResolver | Helper for resolving synthetic bridge Methods to the Method being bridged.
CollectionFactory | Factory for collections, being aware of Java 5 and Java 6 collections.
ConfigurableObjectInputStream | Special ObjectInputStream subclass that resolves class names against a specific ClassLoader.
Constants | This class can be used to parse other classes containing constant definitions in public static final members.
ControlFlowFactory | Static factory to conceal the automatic choice of the ControlFlow implementation class.
Conventions | Provides methods to support various naming and other conventions used throughout the framework.
DecoratingClassLoader | Base class for decorating ClassLoaders such as OverridingClassLoader and ShadowingClassLoader, providing common handling of excluded packages and classes.
GenericCollectionTypeResolver | Helper class for determining element types of collections and maps.
GenericTypeResolver | Helper class for resolving generic types against type variables.
JdkVersion | Internal helper class used to find the Java/JVM version that Spring is operating on, to allow for automatically adapting to the present platform's capabilities.
LocalVariableTableParameterNameDiscoverer | Implementation of ParameterNameDiscoverer that uses the LocalVariableTable information in the method attributes to discover parameter names.
MethodParameter | Helper class that encapsulates the specification of a method parameter, i.e.
NamedInheritableThreadLocal<T> | InheritableThreadLocal subclass that exposes a specified name as NamedInheritableThreadLocal.toString() result (allowing for introspection).
NamedThreadLocal<T> | ThreadLocal subclass that exposes a specified name as NamedThreadLocal.toString() result (allowing for introspection).
NestedExceptionUtils | Helper class for implementing exception classes which are capable of holding nested exceptions.
OrderComparator | Comparator implementation for Ordered objects, sorting by order value ascending (resp.
OverridingClassLoader | ClassLoader that does not always delegate to the parent loader, as normal class loaders do.
PrioritizedParameterNameDiscoverer | ParameterNameDiscoverer implementation that tries several ParameterNameDiscoverers in succession.
SimpleAliasRegistry | Simple implementation of the AliasRegistry interface.
SpringVersion | Class that exposes the Spring version.

Exception Summary
ConstantException | Exception thrown when the Constants class is asked for an invalid constant name.
NestedCheckedException | Handy class for wrapping checked Exceptions with a root cause.
NestedIOException | Subclass of IOException that properly handles a root cause, exposing the root cause just like NestedChecked/RuntimeException does.
NestedRuntimeException | Handy class for wrapping runtime Exceptions with a root cause.

Package org.springframework.core Description

Provides basic classes for exception handling and version detection, and other core helpers that are not specific to any part of the framework.


org.springframework.core Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.core

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.core.AttributeAccessorSupport (implements org.springframework.core.AttributeAccessor, java.io.Serializable)
    • org.springframework.core.BridgeMethodResolver
    • java.lang.ClassLoader
      • org.springframework.core.DecoratingClassLoader
        • org.springframework.core.OverridingClassLoader
    • org.springframework.core.CollectionFactory
    • org.springframework.core.Constants
    • org.springframework.core.ControlFlowFactory
    • org.springframework.core.Conventions
    • org.springframework.core.GenericCollectionTypeResolver
    • org.springframework.core.GenericTypeResolver
    • java.io.InputStream (implements java.io.Closeable)
      • java.io.ObjectInputStream (implements java.io.ObjectInput, java.io.ObjectStreamConstants)
        • org.springframework.core.ConfigurableObjectInputStream
    • org.springframework.core.JdkVersion
    • org.springframework.core.LocalVariableTableParameterNameDiscoverer (implements org.springframework.core.ParameterNameDiscoverer)
    • org.springframework.core.MethodParameter
    • org.springframework.core.NestedExceptionUtils
    • org.springframework.core.OrderComparator (implements java.util.Comparator<T>)
    • org.springframework.core.PrioritizedParameterNameDiscoverer (implements org.springframework.core.ParameterNameDiscoverer)
    • org.springframework.core.SimpleAliasRegistry (implements org.springframework.core.AliasRegistry)
    • org.springframework.core.SpringVersion
    • java.lang.ThreadLocal<T>
      • java.lang.InheritableThreadLocal<T>
        • org.springframework.core.NamedInheritableThreadLocal<T>
      • org.springframework.core.NamedThreadLocal<T>
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.io.IOException
          • org.springframework.core.NestedIOException
        • org.springframework.core.NestedCheckedException
        • java.lang.RuntimeException
          • java.lang.IllegalArgumentException
            • org.springframework.core.ConstantException
          • org.springframework.core.NestedRuntimeException

Interface Hierarchy

  • org.springframework.core.AliasRegistry
  • org.springframework.core.AttributeAccessor
  • org.springframework.core.ControlFlow
  • org.springframework.core.ErrorCoded
  • org.springframework.core.InfrastructureProxy
  • java.util.Map<K,V>
    • org.springframework.core.ConcurrentMap
  • org.springframework.core.Ordered
    • org.springframework.core.PriorityOrdered
  • org.springframework.core.ParameterNameDiscoverer
  • org.springframework.core.SmartClassLoader


AliasRegistry

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.core
Interface AliasRegistry

All Known Subinterfaces:
BeanDefinitionRegistry
All Known Implementing Classes:
AbstractAutowireCapableBeanFactory, AbstractBeanFactory, AnnotationConfigApplicationContext, DefaultListableBeanFactory, DefaultSingletonBeanRegistry, FactoryBeanRegistrySupport, GenericApplicationContext, GenericWebApplicationContext, GenericXmlApplicationContext, ResourceAdapterApplicationContext, SimpleAliasRegistry, SimpleBeanDefinitionRegistry, StaticApplicationContext, StaticPortletApplicationContext, StaticWebApplicationContext, XmlBeanFactory
public interface AliasRegistry

Common interface for managing aliases. Serves as super-interface for BeanDefinitionRegistry.

Since:
2.5.2
Author:
Juergen Hoeller

Method Summary
String[] | getAliases(String name) Return the aliases for the given name, if defined.
boolean | isAlias(String beanName) Determine whether this given name is defines as an alias (as opposed to the name of an actually registered component).
void | registerAlias(String name, String alias) Given a name, register an alias for it.
void | removeAlias(String alias) Remove the specified alias from this registry.

Method Detail

registerAlias

void registerAlias(String name,
                   String alias)
Given a name, register an alias for it.

Parameters:
name - the canonical name
alias - the alias to be registered
Throws:
IllegalStateException - if the alias is already in use and may not be overridden

removeAlias

void removeAlias(String alias)
Remove the specified alias from this registry.

Parameters:
alias - the alias to remove
Throws:
IllegalStateException - if no such alias was found

isAlias

boolean isAlias(String beanName)
Determine whether this given name is defines as an alias (as opposed to the name of an actually registered component).

Parameters:
beanName - the bean name to check
Returns:
whether the given name is an alias

getAliases

String[] getAliases(String name)
Return the aliases for the given name, if defined.

Parameters:
name - the name to check for aliases
Returns:
the aliases, or an empty array if none
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AttributeAccessor

org.springframework.core
Interface AttributeAccessor

All Known Subinterfaces:
AnnotatedBeanDefinition, BeanDefinition
All Known Implementing Classes:
AbstractBeanDefinition, AnnotatedGenericBeanDefinition, AttributeAccessorSupport, AutowireCandidateQualifier, BeanMetadataAttributeAccessor, ChildBeanDefinition, GenericBeanDefinition, PropertyValue, RootBeanDefinition, ScannedGenericBeanDefinition, TestContext
public interface AttributeAccessor

Interface defining a generic contract for attaching and accessing metadata to/from arbitrary objects.

Since:
2.0
Author:
Rob Harrop

Method Summary
String[] | attributeNames() Return the names of all attributes.
Object | getAttribute(String name) Get the value of the attribute identified by name.
boolean | hasAttribute(String name) Return true if the attribute identified by name exists.
Object | removeAttribute(String name) Remove the attribute identified by name and return its value.
void | setAttribute(String name, Object value) Set the attribute defined by name to the supplied value.

Method Detail

setAttribute

void setAttribute(String name,
                  Object value)
Set the attribute defined by name to the supplied value. If value is null, the attribute is removed.

In general, users should take care to prevent overlaps with other metadata attributes by using fully-qualified names, perhaps using class or package names as prefix.

Parameters:
name - the unique attribute key
value - the attribute value to be attached

getAttribute

Object getAttribute(String name)
Get the value of the attribute identified by name. Return null if the attribute doesn't exist.

Parameters:
name - the unique attribute key
Returns:
the current value of the attribute, if any

removeAttribute

Object removeAttribute(String name)
Remove the attribute identified by name and return its value. Return null if no attribute under name is found.

Parameters:
name - the unique attribute key
Returns:
the last value of the attribute, if any

hasAttribute

boolean hasAttribute(String name)
Return true if the attribute identified by name exists. Otherwise return false.

Parameters:
name - the unique attribute key

attributeNames

String[] attributeNames()
Return the names of all attributes.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConcurrentMap

org.springframework.core
Interface ConcurrentMap

All Superinterfaces:
Map
Deprecated. as of Spring 3.0, since standard ConcurrentMap is available on Java 5+ anyway

@Deprecated
public interface ConcurrentMap
extends Map

Common interface for a concurrent Map, as exposed by CollectionFactory.createConcurrentMap(int). Mirrors ConcurrentMap, allowing to be backed by a JDK ConcurrentHashMap as well as a backport-concurrent ConcurrentHashMap.

Check out the ConcurrentMap javadoc for details on the interface's methods.

Since:
2.5
Author:
Juergen Hoeller

Nested Class Summary
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
Method Summary
Object | putIfAbsent(Object key, Object value) Deprecated.
boolean | remove(Object key, Object value) Deprecated.
Object | replace(Object key, Object value) Deprecated.
boolean | replace(Object key, Object oldValue, Object newValue) Deprecated.
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values

Method Detail

putIfAbsent

Object putIfAbsent(Object key,
                   Object value)
Deprecated.

remove

boolean remove(Object key,
               Object value)
Deprecated.

replace

boolean replace(Object key,
                Object oldValue,
                Object newValue)
Deprecated.

replace

Object replace(Object key,
               Object value)
Deprecated.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ControlFlow

org.springframework.core
Interface ControlFlow

public interface ControlFlow

Interface to be implemented by objects that can return information about the current call stack. Useful in AOP (as in AspectJ cflow concept) but not AOP-specific.

Since:
02.02.2004
Author:
Rod Johnson

Method Summary
boolean | under(Class clazz) Detect whether we're under the given class, according to the current stack trace.
boolean | under(Class clazz, String methodName) Detect whether we're under the given class and method, according to the current stack trace.
boolean | underToken(String token) Detect whether the current stack trace contains the given token.

Method Detail

under

boolean under(Class clazz)
Detect whether we're under the given class, according to the current stack trace.

Parameters:
clazz - the clazz to look for

under

boolean under(Class clazz,
              String methodName)
Detect whether we're under the given class and method, according to the current stack trace.

Parameters:
clazz - the clazz to look for
methodName - the name of the method to look for

underToken

boolean underToken(String token)
Detect whether the current stack trace contains the given token.

Parameters:
token - the token to look for
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ErrorCoded

org.springframework.core
Interface ErrorCoded

All Known Implementing Classes:
ConversionNotSupportedException, MethodInvocationException, PropertyAccessException, TypeMismatchException
public interface ErrorCoded

Interface that can be implemented by exceptions etc that are error coded. The error code is a String, rather than a number, so it can be given user-readable values, such as "object.failureDescription".

An error code can be resolved by a MessageSource, for example.

Author:
Rod Johnson
See Also:
MessageSource

Method Summary
 String getErrorCode()
Return the error code associated with this failure.

Method Detail

getErrorCode

String getErrorCode()
Return the error code associated with this failure. The GUI can render this any way it pleases, allowing for localization etc.

Returns:
a String error code associated with this failure, or null if not error-coded
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InfrastructureProxy

org.springframework.core
Interface InfrastructureProxy

public interface InfrastructureProxy

Interface to be implemented by transparent resource proxies that need to be considered as equal to the underlying resource, for example for consistent lookup key comparisons. Note that this interface does imply such special semantics and does not constitute a general-purpose mixin!

Such wrappers will automatically be unwrapped for key comparisons in TransactionSynchronizationManager.

Only fully transparent proxies, e.g. for redirection or service lookups, are supposed to implement this interface. Proxies that decorate the target object with new behavior, such as AOP proxies, do not qualify here!

Since:
2.5.4
Author:
Juergen Hoeller
See Also:
TransactionSynchronizationManager

Method Summary
 Object getWrappedObject()
Return the underlying resource (never null).

Method Detail

getWrappedObject

Object getWrappedObject()
Return the underlying resource (never null).

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Ordered

org.springframework.core
Interface Ordered

All Known Subinterfaces:
AspectInstanceFactory, AspectJPrecedenceInformation, MetadataAwareAspectInstanceFactory, PriorityOrdered, SmartApplicationListener
All Known Implementing Classes:
AbstractAdvisorAutoProxyCreator, AbstractAspectJAdvice, AbstractAutoProxyCreator, AbstractBeanFactoryPointcutAdvisor, AbstractControllerUrlHandlerMapping, AbstractDetectingUrlHandlerMapping, AbstractGenericPointcutAdvisor, AbstractHandlerExceptionResolver, AbstractHandlerExceptionResolver, AbstractHandlerMapping, AbstractHandlerMapping, AbstractMapBasedHandlerMapping, AbstractPointcutAdvisor, AbstractTemplateViewResolver, AbstractUrlHandlerMapping, AnnotationAwareAspectJAutoProxyCreator, AnnotationMethodHandlerAdapter, AnnotationMethodHandlerAdapter, AnnotationMethodHandlerExceptionResolver, AnnotationMethodHandlerExceptionResolver, AspectJAfterAdvice, AspectJAfterReturningAdvice, AspectJAfterThrowingAdvice, AspectJAroundAdvice, AspectJAwareAdvisorAutoProxyCreator, AspectJExpressionPointcutAdvisor, AspectJMethodBeforeAdvice, AspectJPointcutAdvisor, AspectJWeavingEnabler, AsyncAnnotationAdvisor, AsyncAnnotationBeanPostProcessor, AsyncExecutionInterceptor, AutowiredAnnotationBeanPostProcessor, BeanFactoryAspectInstanceFactory, BeanFactoryTransactionAttributeSourceAdvisor, BeanNameAutoProxyCreator, BeanNameUrlHandlerMapping, BeanNameViewResolver, CommonAnnotationBeanPostProcessor, ContentNegotiatingViewResolver, ControllerBeanNameHandlerMapping, ControllerClassNameHandlerMapping, CustomAutowireConfigurer, CustomEditorConfigurer, CustomScopeConfigurer, DefaultAdvisorAutoProxyCreator, DefaultAnnotationHandlerMapping, DefaultAnnotationHandlerMapping, DefaultBeanFactoryPointcutAdvisor, DefaultHandlerExceptionResolver, DefaultIntroductionAdvisor, DefaultPointcutAdvisor, ExposeInvocationInterceptor, FreeMarkerViewResolver, GenericApplicationListenerAdapter, InfrastructureAdvisorAutoProxyCreator, InitDestroyAnnotationBeanPostProcessor, InternalResourceViewResolver, JasperReportsViewResolver, LazySingletonAspectInstanceFactoryDecorator, NameMatchMethodPointcutAdvisor, ParameterHandlerMapping, PersistenceAnnotationBeanPostProcessor, PersistenceExceptionTranslationAdvisor, PersistenceExceptionTranslationPostProcessor, PortletModeHandlerMapping, PortletModeParameterHandlerMapping, PreferencesPlaceholderConfigurer, PropertyOverrideConfigurer, PropertyPlaceholderConfigurer, PropertyResourceConfigurer, PrototypeAspectInstanceFactory, ReflectiveAspectJAdvisorFactory.SyntheticInstantiationAdvisor, RegexpMethodPointcutAdvisor, RequiredAnnotationBeanPostProcessor, ResourceBundleViewResolver, ResponseStatusExceptionResolver, ScheduledAnnotationBeanPostProcessor, ScriptFactoryPostProcessor, ServletContextPropertyPlaceholderConfigurer, SimpleAspectInstanceFactory, SimpleBeanFactoryAwareAspectInstanceFactory, SimpleMappingExceptionResolver, SimpleMappingExceptionResolver, SimpleMetadataAwareAspectInstanceFactory, SimpleUrlHandlerMapping, SingletonAspectInstanceFactory, SingletonMetadataAwareAspectInstanceFactory, SourceFilteringListener, SpringLobCreatorSynchronization, StaticMethodMatcherPointcutAdvisor, TilesViewResolver, TransactionAttributeSourceAdvisor, TransactionSynchronizationAdapter, UrlBasedViewResolver, VelocityLayoutViewResolver, VelocityViewResolver, XmlViewResolver, XsltViewResolver
public interface Ordered

Interface that can be implemented by objects that should be orderable, for example in a Collection.

The actual order can be interpreted as prioritization, with the first object (with the lowest order value) having the highest priority.

Note that there is a 'priority' marker for this interface: PriorityOrdered. Order values expressed by PriorityOrdered objects always apply before order values of 'plain' Ordered values.

Since:
07.04.2003
Author:
Juergen Hoeller
See Also:
OrderComparator, Order

Field Summary
static int | HIGHEST_PRECEDENCE Useful constant for the highest precedence value.
static int | LOWEST_PRECEDENCE Useful constant for the lowest precedence value.
Method Summary
 int getOrder()
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Field Detail

HIGHEST_PRECEDENCE

static final int HIGHEST_PRECEDENCE
Useful constant for the highest precedence value.

See Also:
Integer.MIN_VALUE, Constant Field Values

LOWEST_PRECEDENCE

static final int LOWEST_PRECEDENCE
Useful constant for the lowest precedence value.

See Also:
Integer.MAX_VALUE, Constant Field Values
Method Detail

getOrder

int getOrder()
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Returns:
the order value
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ParameterNameDiscoverer

org.springframework.core
Interface ParameterNameDiscoverer

All Known Implementing Classes:
AspectJAdviceParameterNameDiscoverer, LocalVariableTableParameterNameDiscoverer, PrioritizedParameterNameDiscoverer
public interface ParameterNameDiscoverer

Interface to discover parameter names for methods and constructors.

Parameter name discovery is not always possible, but various strategies are available to try, such as looking for debug information that may have been emitted at compile time, and looking for argname annotation values optionally accompanying AspectJ annotated methods.

Since:
2.0
Author:
Rod Johnson, Adrian Colyer

Method Summary
String[] | getParameterNames(Constructor ctor) Return parameter names for this constructor, or null if they cannot be determined.
String[] | getParameterNames(Method method) Return parameter names for this method, or null if they cannot be determined.

Method Detail

getParameterNames

String[] getParameterNames(Method method)
Return parameter names for this method, or null if they cannot be determined.

Parameters:
method - method to find parameter names for
Returns:
an array of parameter names if the names can be resolved, or null if they cannot

getParameterNames

String[] getParameterNames(Constructor ctor)
Return parameter names for this constructor, or null if they cannot be determined.

Parameters:
ctor - constructor to find parameter names for
Returns:
an array of parameter names if the names can be resolved, or null if they cannot
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PriorityOrdered

org.springframework.core
Interface PriorityOrdered

All Superinterfaces:
Ordered
All Known Implementing Classes:
AutowiredAnnotationBeanPostProcessor, CommonAnnotationBeanPostProcessor, InitDestroyAnnotationBeanPostProcessor, PersistenceAnnotationBeanPostProcessor, PreferencesPlaceholderConfigurer, PropertyOverrideConfigurer, PropertyPlaceholderConfigurer, PropertyResourceConfigurer, RequiredAnnotationBeanPostProcessor, ServletContextPropertyPlaceholderConfigurer
public interface PriorityOrdered
extends Ordered

Extension of the Ordered interface, expressing a 'priority' ordering: Order values expressed by PriorityOrdered objects always apply before order values of 'plain' Ordered values.

This is primarily a special-purpose interface, used for objects where it is particularly important to determine 'prioritized' objects first, without even obtaining the remaining objects. A typical example: Prioritized post-processors in a Spring ApplicationContext.

Note: PriorityOrdered post-processor beans are initialized in a special phase, ahead of other post-processor beans. This subtly affects their autowiring behavior: They will only be autowired against beans which do not require eager initialization for type matching.

Since:
2.5
Author:
Juergen Hoeller
See Also:
PropertyOverrideConfigurer, PropertyPlaceholderConfigurer

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Method Summary
Methods inherited from interface org.springframework.core.Ordered
getOrder

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SmartClassLoader

org.springframework.core
Interface SmartClassLoader

public interface SmartClassLoader

Interface to be implemented by a reloading-aware ClassLoader (e.g. a Groovy-based ClassLoader). Detected for example by Spring's CGLIB proxy factory for making a caching decision.

If a ClassLoader does not implement this interface, then all of the classes obtained from it should be considered as not reloadable (i.e. cacheable).

Since:
2.5.1
Author:
Juergen Hoeller

Method Summary
 boolean isClassReloadable(Class clazz)
Determine whether the given class is reloadable (in this ClassLoader).

Method Detail

isClassReloadable

boolean isClassReloadable(Class clazz)
Determine whether the given class is reloadable (in this ClassLoader).

Typically used to check whether the result may be cached (for this ClassLoader) or whether it should be reobtained every time.

Parameters:
clazz - the class to check (usually loaded from this ClassLoader)
Returns:
whether the class should be expected to appear in a reloaded version (with a different Class object) later on
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AttributeAccessorSupport

org.springframework.core
Class AttributeAccessorSupport

java.lang.Object
    extended by  org.springframework.core.AttributeAccessorSupport
All Implemented Interfaces:
Serializable, AttributeAccessor
Direct Known Subclasses:
BeanMetadataAttributeAccessor, TestContext
public abstract class AttributeAccessorSupport
extends Object
implements AttributeAccessor, Serializable

Support class for AttributeAccessors, providing a base implementation of all methods. To be extended by subclasses.

Serializable if subclasses and all attribute values are Serializable.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
AttributeAccessorSupport()
Method Summary
String[] | attributeNames() Return the names of all attributes.
protected void | copyAttributesFrom(AttributeAccessor source) Copy the attributes from the supplied AttributeAccessor to this accessor.
boolean | equals(Object other)
Object | getAttribute(String name) Get the value of the attribute identified by name.
boolean | hasAttribute(String name) Return true if the attribute identified by name exists.
int | hashCode()
Object | removeAttribute(String name) Remove the attribute identified by name and return its value.
void | setAttribute(String name, Object value) Set the attribute defined by name to the supplied value.
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AttributeAccessorSupport

public AttributeAccessorSupport()
Method Detail

setAttribute

public void setAttribute(String name,
                         Object value)
Description copied from interface: AttributeAccessor
Set the attribute defined by name to the supplied value. If value is null, the attribute is removed.

In general, users should take care to prevent overlaps with other metadata attributes by using fully-qualified names, perhaps using class or package names as prefix.

Specified by:
setAttribute in interface AttributeAccessor
Parameters:
name - the unique attribute key
value - the attribute value to be attached

getAttribute

public Object getAttribute(String name)
Description copied from interface: AttributeAccessor
Get the value of the attribute identified by name. Return null if the attribute doesn't exist.

Specified by:
getAttribute in interface AttributeAccessor
Parameters:
name - the unique attribute key
Returns:
the current value of the attribute, if any

removeAttribute

public Object removeAttribute(String name)
Description copied from interface: AttributeAccessor
Remove the attribute identified by name and return its value. Return null if no attribute under name is found.

Specified by:
removeAttribute in interface AttributeAccessor
Parameters:
name - the unique attribute key
Returns:
the last value of the attribute, if any

hasAttribute

public boolean hasAttribute(String name)
Description copied from interface: AttributeAccessor
Return true if the attribute identified by name exists. Otherwise return false.

Specified by:
hasAttribute in interface AttributeAccessor
Parameters:
name - the unique attribute key

attributeNames

public String[] attributeNames()
Description copied from interface: AttributeAccessor
Return the names of all attributes.

Specified by:
attributeNames in interface AttributeAccessor

copyAttributesFrom

protected void copyAttributesFrom(AttributeAccessor source)
Copy the attributes from the supplied AttributeAccessor to this accessor.

Parameters:
source - the AttributeAccessor to copy from

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BridgeMethodResolver

org.springframework.core
Class BridgeMethodResolver

java.lang.Object
    extended by  org.springframework.core.BridgeMethodResolver

public abstract class BridgeMethodResolver
extends Object

Helper for resolving synthetic bridge Methods to the Method being bridged.

Given a synthetic bridge Method returns the Method being bridged. A bridge method may be created by the compiler when extending a parameterized type whose methods have parameterized arguments. During runtime invocation the bridge Method may be invoked and/or used via reflection. When attempting to locate annotations on Methods, it is wise to check for bridge Methods as appropriate and find the bridged Method.

See The Java Language Specification for more details on the use of bridge methods.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller

Constructor Summary
BridgeMethodResolver()
Method Summary
static Method findBridgedMethod(Method bridgeMethod)
Find the original method for the supplied bridge Method.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BridgeMethodResolver

public BridgeMethodResolver()
Method Detail

findBridgedMethod

public static Method findBridgedMethod(Method bridgeMethod)
Find the original method for the supplied bridge Method.

It is safe to call this method passing in a non-bridge Method instance. In such a case, the supplied Method instance is returned directly to the caller. Callers are not required to check for bridging before calling this method.

Parameters:
bridgeMethod - the method to introspect
Returns:
the original method (either the bridged method or the passed-in method if no more specific one could be found)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CollectionFactory

org.springframework.core
Class CollectionFactory

java.lang.Object
    extended by  org.springframework.core.CollectionFactory

public abstract class CollectionFactory
extends Object

Factory for collections, being aware of Java 5 and Java 6 collections. Mainly for internal use within the framework.

The goal of this class is to avoid runtime dependencies on a specific Java version, while nevertheless using the best collection implementation that is available at runtime.

Since:
1.1.1
Author:
Juergen Hoeller, Arjen Poutsma

Constructor Summary
CollectionFactory()
Method Summary
static Collection createApproximateCollection(Object collection, int initialCapacity)
Create the most approximate collection for the given collection.
static Map createApproximateMap(Object map, int initialCapacity)
Create the most approximate map for the given map.
static Collection createCollection(Class<?> collectionType, int initialCapacity)
Create the most appropriate collection for the given collection type.
static ConcurrentMap createConcurrentMap(int initialCapacity)
Deprecated. as of Spring 3.0, for usage on JDK 1.5 or higher
static Map createConcurrentMapIfPossible(int initialCapacity)
Deprecated. as of Spring 3.0, for usage on JDK 1.5 or higher
static
<T> Set<T>
createCopyOnWriteSet()
Deprecated. as of Spring 3.0, for usage on JDK 1.5 or higher
static Map createIdentityMapIfPossible(int initialCapacity)
Deprecated. as of Spring 2.5, for usage on JDK 1.4 or higher
static Map createLinkedCaseInsensitiveMapIfPossible(int initialCapacity)
Deprecated. as of Spring 3.0, for usage on JDK 1.5 or higher
static
<K,V> Map<K,V>
createLinkedMapIfPossible(int initialCapacity)
Deprecated. as of Spring 2.5, for usage on JDK 1.4 or higher
static
<T> Set<T>
createLinkedSetIfPossible(int initialCapacity)
Deprecated. as of Spring 2.5, for usage on JDK 1.4 or higher
static Map createMap(Class<?> mapType, int initialCapacity)
Create the most approximate map for the given map.
static boolean isApproximableCollectionType(Class<?> collectionType)
Determine whether the given collection type is an approximable type, i.e.
static boolean isApproximableMapType(Class<?> mapType)
Determine whether the given map type is an approximable type, i.e.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CollectionFactory

public CollectionFactory()
Method Detail

createLinkedSetIfPossible

@Deprecated
public static <T> Set<T> createLinkedSetIfPossible(int initialCapacity)
Deprecated. as of Spring 2.5, for usage on JDK 1.4 or higher

Create a linked Set if possible: This implementation always creates a LinkedHashSet, since Spring 2.5 requires JDK 1.4 anyway.

Parameters:
initialCapacity - the initial capacity of the Set
Returns:
the new Set instance

createCopyOnWriteSet

@Deprecated
public static <T> Set<T> createCopyOnWriteSet()
Deprecated. as of Spring 3.0, for usage on JDK 1.5 or higher

Create a copy-on-write Set (allowing for synchronization-less iteration) if possible: This implementation always creates a CopyOnWriteArraySet, since Spring 3 requires JDK 1.5 anyway.

Returns:
the new Set instance

createLinkedMapIfPossible

@Deprecated
public static <K,V> Map<K,V> createLinkedMapIfPossible(int initialCapacity)
Deprecated. as of Spring 2.5, for usage on JDK 1.4 or higher

Create a linked Map if possible: This implementation always creates a LinkedHashMap, since Spring 2.5 requires JDK 1.4 anyway.

Parameters:
initialCapacity - the initial capacity of the Map
Returns:
the new Map instance

createLinkedCaseInsensitiveMapIfPossible

@Deprecated
public static Map createLinkedCaseInsensitiveMapIfPossible(int initialCapacity)
Deprecated. as of Spring 3.0, for usage on JDK 1.5 or higher

Create a linked case-insensitive Map if possible: This implementation always returns a LinkedCaseInsensitiveMap.

Parameters:
initialCapacity - the initial capacity of the Map
Returns:
the new Map instance

createIdentityMapIfPossible

@Deprecated
public static Map createIdentityMapIfPossible(int initialCapacity)
Deprecated. as of Spring 2.5, for usage on JDK 1.4 or higher

Create an identity Map if possible: This implementation always creates a IdentityHashMap, since Spring 2.5 requires JDK 1.4 anyway.

Parameters:
initialCapacity - the initial capacity of the Map
Returns:
the new Map instance

createConcurrentMapIfPossible

@Deprecated
public static Map createConcurrentMapIfPossible(int initialCapacity)
Deprecated. as of Spring 3.0, for usage on JDK 1.5 or higher

Create a concurrent Map if possible: This implementation always creates a ConcurrentHashMap, since Spring 3.0 requires JDK 1.5 anyway.

Parameters:
initialCapacity - the initial capacity of the Map
Returns:
the new Map instance

createConcurrentMap

@Deprecated
public static ConcurrentMap createConcurrentMap(int initialCapacity)
Deprecated. as of Spring 3.0, for usage on JDK 1.5 or higher

Create a concurrent Map with a dedicated ConcurrentMap interface: This implementation always creates a ConcurrentHashMap, since Spring 3.0 requires JDK 1.5 anyway.

Parameters:
initialCapacity - the initial capacity of the Map
Returns:
the new ConcurrentMap instance

isApproximableCollectionType

public static boolean isApproximableCollectionType(Class<?> collectionType)
Determine whether the given collection type is an approximable type, i.e. a type that createApproximateCollection(java.lang.Object, int) can approximate.

Parameters:
collectionType - the collection type to check
Returns:
true if the type is approximable, false if it is not

createApproximateCollection

public static Collection createApproximateCollection(Object collection,
                                                     int initialCapacity)
Create the most approximate collection for the given collection.

Creates an ArrayList, TreeSet or linked Set for a List, SortedSet or Set, respectively.

Parameters:
collection - the original Collection object
initialCapacity - the initial capacity
Returns:
the new Collection instance
See Also:
ArrayList, TreeSet, LinkedHashSet

createCollection

public static Collection createCollection(Class<?> collectionType,
                                          int initialCapacity)
Create the most appropriate collection for the given collection type.

Creates an ArrayList, TreeSet or linked Set for a List, SortedSet or Set, respectively.

Parameters:
collectionType - the desired type of the target Collection
initialCapacity - the initial capacity
Returns:
the new Collection instance
See Also:
ArrayList, TreeSet, LinkedHashSet

isApproximableMapType

public static boolean isApproximableMapType(Class<?> mapType)
Determine whether the given map type is an approximable type, i.e. a type that createApproximateMap(java.lang.Object, int) can approximate.

Parameters:
mapType - the map type to check
Returns:
true if the type is approximable, false if it is not

createApproximateMap

public static Map createApproximateMap(Object map,
                                       int initialCapacity)
Create the most approximate map for the given map.

Creates a TreeMap or linked Map for a SortedMap or Map, respectively.

Parameters:
map - the original Map object
initialCapacity - the initial capacity
Returns:
the new Map instance
See Also:
TreeMap, LinkedHashMap

createMap

public static Map createMap(Class<?> mapType,
                            int initialCapacity)
Create the most approximate map for the given map.

Creates a TreeMap or linked Map for a SortedMap or Map, respectively.

Parameters:
collectionType - the desired type of the target Map
initialCapacity - the initial capacity
Returns:
the new Map instance
See Also:
TreeMap, LinkedHashMap
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConfigurableObjectInputStream

org.springframework.core
Class ConfigurableObjectInputStream

java.lang.Object
    extended by  java.io.InputStream
        extended by  java.io.ObjectInputStream
            extended by  org.springframework.core.ConfigurableObjectInputStream
All Implemented Interfaces:
Closeable, DataInput, ObjectInput, ObjectStreamConstants
Direct Known Subclasses:
CodebaseAwareObjectInputStream
public class ConfigurableObjectInputStream
extends ObjectInputStream

Special ObjectInputStream subclass that resolves class names against a specific ClassLoader. Serves as base class for CodebaseAwareObjectInputStream.

Since:
2.5.5
Author:
Juergen Hoeller

Nested Class Summary
Nested classes/interfaces inherited from class java.io.ObjectInputStream
ObjectInputStream.GetField
Field Summary
Fields inherited from interface java.io.ObjectStreamConstants
baseWireHandle, PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, SC_BLOCK_DATA, SC_ENUM, SC_EXTERNALIZABLE, SC_SERIALIZABLE, SC_WRITE_METHOD, STREAM_MAGIC, STREAM_VERSION, SUBCLASS_IMPLEMENTATION_PERMISSION, SUBSTITUTION_PERMISSION, TC_ARRAY, TC_BASE, TC_BLOCKDATA, TC_BLOCKDATALONG, TC_CLASS, TC_CLASSDESC, TC_ENDBLOCKDATA, TC_ENUM, TC_EXCEPTION, TC_LONGSTRING, TC_MAX, TC_NULL, TC_OBJECT, TC_PROXYCLASSDESC, TC_REFERENCE, TC_RESET, TC_STRING
Constructor Summary
ConfigurableObjectInputStream(InputStream in, ClassLoader classLoader)
Create a new ConfigurableObjectInputStream for the given InputStream and ClassLoader.
Method Summary
protected ClassLoader | getFallbackClassLoader() Return the fallback ClassLoader to use when no ClassLoader was specified and ObjectInputStream's own default ClassLoader failed.
protected Class | resolveClass(ObjectStreamClass classDesc)
protected Class | resolveFallbackIfPossible(String className, ClassNotFoundException ex) Resolve the given class name against a fallback class loader.
protected Class | resolveProxyClass(String[] interfaces)
Methods inherited from class java.io.ObjectInputStream
available, close, defaultReadObject, enableResolveObject, read, read, readBoolean, readByte, readChar, readClassDescriptor, readDouble, readFields, readFloat, readFully, readFully, readInt, readLine, readLong, readObject, readObjectOverride, readShort, readStreamHeader, readUnshared, readUnsignedByte, readUnsignedShort, readUTF, registerValidation, resolveObject, skipBytes
Methods inherited from class java.io.InputStream
mark, markSupported, read, reset, skip
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.io.ObjectInput
read, skip

Constructor Detail

ConfigurableObjectInputStream

public ConfigurableObjectInputStream(InputStream in,
                                     ClassLoader classLoader)
                              throws IOException
Create a new ConfigurableObjectInputStream for the given InputStream and ClassLoader.

Parameters:
in - the InputStream to read from
classLoader - the ClassLoader to use for loading local classes
Throws:
IOException
See Also:
ObjectInputStream.ObjectInputStream(java.io.InputStream)
Method Detail

resolveClass

protected Class resolveClass(ObjectStreamClass classDesc)
                      throws IOException,
                             ClassNotFoundException
Overrides:
resolveClass in class ObjectInputStream
Throws:
IOException
ClassNotFoundException

resolveProxyClass

protected Class resolveProxyClass(String[] interfaces)
                           throws IOException,
                                  ClassNotFoundException
Overrides:
resolveProxyClass in class ObjectInputStream
Throws:
IOException
ClassNotFoundException

resolveFallbackIfPossible

protected Class resolveFallbackIfPossible(String className,
                                          ClassNotFoundException ex)
                                   throws IOException,
                                          ClassNotFoundException
Resolve the given class name against a fallback class loader.

The default implementation simply rethrows the original exception, since there is no fallback available.

Parameters:
className - the class name to resolve
ex - the original exception thrown when attempting to load the class
Returns:
the newly resolved class (never null)
Throws:
IOException
ClassNotFoundException

getFallbackClassLoader

protected ClassLoader getFallbackClassLoader()
                                      throws IOException
Return the fallback ClassLoader to use when no ClassLoader was specified and ObjectInputStream's own default ClassLoader failed.

The default implementation simply returns null.

Throws:
IOException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Constants

org.springframework.core
Class Constants

java.lang.Object
    extended by  org.springframework.core.Constants

public class Constants
extends Object

This class can be used to parse other classes containing constant definitions in public static final members. The asXXXX methods of this class allow these constant values to be accessed via their string names.

Consider class Foo containing public final static int CONSTANT1 = 66; An instance of this class wrapping Foo.class will return the constant value of 66 from its asNumber method given the argument "CONSTANT1".

This class is ideal for use in PropertyEditors, enabling them to recognize the same names as the constants themselves, and freeing them from maintaining their own mapping.

Since:
16.03.2003
Author:
Rod Johnson, Juergen Hoeller

Constructor Summary
Constants(Class clazz)
Create a new Constants converter class wrapping the given class.
Method Summary
Number | asNumber(String code) Return a constant value cast to a Number.
Object | asObject(String code) Parse the given String (upper or lower case accepted) and return the appropriate value if it's the name of a constant field in the class that we're analysing.
String | asString(String code) Return a constant value as a String.
String | getClassName() Return the name of the analyzed class.
protected Map<String,Object> | getFieldCache() Exposes the field cache to subclasses: a Map from String field name to object value.
Set<String> | getNames(String namePrefix) Return all names of the given group of constants.
Set<String> | getNamesForProperty(String propertyName) Return all names of the group of constants for the given bean property name.
Set | getNamesForSuffix(String nameSuffix) Return all names of the given group of constants.
int | getSize() Return the number of constants exposed.
Set<Object> | getValues(String namePrefix) Return all values of the given group of constants.
Set<Object> | getValuesForProperty(String propertyName) Return all values of the group of constants for the given bean property name.
Set<Object> | getValuesForSuffix(String nameSuffix) Return all values of the given group of constants.
String | propertyToConstantNamePrefix(String propertyName) Convert the given bean property name to a constant name prefix.
String | toCode(Object value, String namePrefix) Look up the given value within the given group of constants.
String | toCodeForProperty(Object value, String propertyName) Look up the given value within the group of constants for the given bean property name.
String | toCodeForSuffix(Object value, String nameSuffix) Look up the given value within the given group of constants.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Constants

public Constants(Class clazz)
Create a new Constants converter class wrapping the given class.

All public static final variables will be exposed, whatever their type.

Parameters:
clazz - the class to analyze
Throws:
IllegalArgumentException - if the supplied clazz is null
Method Detail

getClassName

public final String getClassName()
Return the name of the analyzed class.

getSize

public final int getSize()
Return the number of constants exposed.

getFieldCache

protected final Map<String,Object> getFieldCache()
Exposes the field cache to subclasses: a Map from String field name to object value.

asNumber

public Number asNumber(String code)
                throws ConstantException
Return a constant value cast to a Number.

Parameters:
code - the name of the field (never null)
Returns:
the Number value
Throws:
ConstantException - if the field name wasn't found or if the type wasn't compatible with Number
See Also:
asObject(java.lang.String)

asString

public String asString(String code)
                throws ConstantException
Return a constant value as a String.

Parameters:
code - the name of the field (never null)
Returns:
the String value Works even if it's not a string (invokes toString()).
Throws:
ConstantException - if the field name wasn't found
See Also:
asObject(java.lang.String)

asObject

public Object asObject(String code)
                throws ConstantException
Parse the given String (upper or lower case accepted) and return the appropriate value if it's the name of a constant field in the class that we're analysing.

Parameters:
code - the name of the field (never null)
Returns:
the Object value
Throws:
ConstantException - if there's no such field

getNames

public Set<String> getNames(String namePrefix)
Return all names of the given group of constants.

Note that this method assumes that constants are named in accordance with the standard Java convention for constant values (i.e. all uppercase). The supplied namePrefix will be uppercased (in a locale-insensitive fashion) prior to the main logic of this method kicking in.

Parameters:
namePrefix - prefix of the constant names to search (may be null)
Returns:
the set of constant names

getNamesForProperty

public Set<String> getNamesForProperty(String propertyName)
Return all names of the group of constants for the given bean property name.

Parameters:
propertyName - the name of the bean property
Returns:
the set of values
See Also:
propertyToConstantNamePrefix(java.lang.String)

getNamesForSuffix

public Set getNamesForSuffix(String nameSuffix)
Return all names of the given group of constants.

Note that this method assumes that constants are named in accordance with the standard Java convention for constant values (i.e. all uppercase). The supplied nameSuffix will be uppercased (in a locale-insensitive fashion) prior to the main logic of this method kicking in.

Parameters:
nameSuffix - suffix of the constant names to search (may be null)
Returns:
the set of constant names

getValues

public Set<Object> getValues(String namePrefix)
Return all values of the given group of constants.

Note that this method assumes that constants are named in accordance with the standard Java convention for constant values (i.e. all uppercase). The supplied namePrefix will be uppercased (in a locale-insensitive fashion) prior to the main logic of this method kicking in.

Parameters:
namePrefix - prefix of the constant names to search (may be null)
Returns:
the set of values

getValuesForProperty

public Set<Object> getValuesForProperty(String propertyName)
Return all values of the group of constants for the given bean property name.

Parameters:
propertyName - the name of the bean property
Returns:
the set of values
See Also:
propertyToConstantNamePrefix(java.lang.String)

getValuesForSuffix

public Set<Object> getValuesForSuffix(String nameSuffix)
Return all values of the given group of constants.

Note that this method assumes that constants are named in accordance with the standard Java convention for constant values (i.e. all uppercase). The supplied nameSuffix will be uppercased (in a locale-insensitive fashion) prior to the main logic of this method kicking in.

Parameters:
nameSuffix - suffix of the constant names to search (may be null)
Returns:
the set of values

toCode

public String toCode(Object value,
                     String namePrefix)
              throws ConstantException
Look up the given value within the given group of constants.

Will return the first match.

Parameters:
value - constant value to look up
namePrefix - prefix of the constant names to search (may be null)
Returns:
the name of the constant field
Throws:
ConstantException - if the value wasn't found

toCodeForProperty

public String toCodeForProperty(Object value,
                                String propertyName)
                         throws ConstantException
Look up the given value within the group of constants for the given bean property name. Will return the first match.

Parameters:
value - constant value to look up
propertyName - the name of the bean property
Returns:
the name of the constant field
Throws:
ConstantException - if the value wasn't found
See Also:
propertyToConstantNamePrefix(java.lang.String)

toCodeForSuffix

public String toCodeForSuffix(Object value,
                              String nameSuffix)
                       throws ConstantException
Look up the given value within the given group of constants.

Will return the first match.

Parameters:
value - constant value to look up
nameSuffix - suffix of the constant names to search (may be null)
Returns:
the name of the constant field
Throws:
ConstantException - if the value wasn't found

propertyToConstantNamePrefix

public String propertyToConstantNamePrefix(String propertyName)
Convert the given bean property name to a constant name prefix.

Uses a common naming idiom: turning all lower case characters to upper case, and prepending upper case characters with an underscore.

Example: "imageSize" -> "IMAGE_SIZE"
Example: "imagesize" -> "IMAGESIZE".
Example: "ImageSize" -> "_IMAGE_SIZE".
Example: "IMAGESIZE" -> "_I_M_A_G_E_S_I_Z_E"

Parameters:
propertyName - the name of the bean property
Returns:
the corresponding constant name prefix
See Also:
getValuesForProperty(java.lang.String), toCodeForProperty(java.lang.Object, java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ControlFlowFactory

org.springframework.core
Class ControlFlowFactory

java.lang.Object
    extended by  org.springframework.core.ControlFlowFactory

public abstract class ControlFlowFactory
extends Object

Static factory to conceal the automatic choice of the ControlFlow implementation class.

This implementation always uses the efficient Java 1.4 StackTraceElement mechanism for analyzing control flows.

Since:
02.02.2004
Author:
Rod Johnson, Juergen Hoeller

Constructor Summary
ControlFlowFactory()
Method Summary
static ControlFlow createControlFlow()
Return an appropriate ControlFlow instance.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ControlFlowFactory

public ControlFlowFactory()
Method Detail

createControlFlow

public static ControlFlow createControlFlow()
Return an appropriate ControlFlow instance.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Conventions

org.springframework.core
Class Conventions

java.lang.Object
    extended by  org.springframework.core.Conventions

public abstract class Conventions
extends Object

Provides methods to support various naming and other conventions used throughout the framework. Mainly for internal use within the framework.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller

Constructor Summary
Conventions()
Method Summary
static String | attributeNameToPropertyName(String attributeName) Convert Strings in attribute name format (lowercase, hyphens separating words) into property name format (camel-cased).
static String | getQualifiedAttributeName(Class enclosingClass, String attributeName) Return an attribute name qualified by the supplied enclosing Class.
static String | getVariableName(Object value) Determine the conventional variable name for the supplied Object based on its concrete type.
static String | getVariableNameForParameter(MethodParameter parameter) Determine the conventional variable name for the supplied parameter, taking the generic collection type (if any) into account.
static String | getVariableNameForReturnType(Method method) Determine the conventional variable name for the return type of the supplied method, taking the generic collection type (if any) into account.
static String | getVariableNameForReturnType(Method method, Class resolvedType, Object value) Determine the conventional variable name for the return type of the supplied method, taking the generic collection type (if any) into account, falling back to the given return value if the method declaration is not specific enough (i.e.
static String | getVariableNameForReturnType(Method method, Object value) Determine the conventional variable name for the return type of the supplied method, taking the generic collection type (if any) into account, falling back to the given return value if the method declaration is not specific enough (i.e.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Conventions

public Conventions()
Method Detail

getVariableName

public static String getVariableName(Object value)
Determine the conventional variable name for the supplied Object based on its concrete type. The convention used is to return the uncapitalized short name of the Class, according to JavaBeans property naming rules: So, com.myapp.Product becomes product; com.myapp.MyProduct becomes myProduct; com.myapp.UKProduct becomes UKProduct.

For arrays, we use the pluralized version of the array component type. For Collections we attempt to 'peek ahead' in the Collection to determine the component type and return the pluralized version of that component type.

Parameters:
value - the value to generate a variable name for
Returns:
the generated variable name

getVariableNameForParameter

public static String getVariableNameForParameter(MethodParameter parameter)
Determine the conventional variable name for the supplied parameter, taking the generic collection type (if any) into account.

Parameters:
parameter - the method or constructor parameter to generate a variable name for
Returns:
the generated variable name

getVariableNameForReturnType

public static String getVariableNameForReturnType(Method method)
Determine the conventional variable name for the return type of the supplied method, taking the generic collection type (if any) into account.

Parameters:
method - the method to generate a variable name for
Returns:
the generated variable name

getVariableNameForReturnType

public static String getVariableNameForReturnType(Method method,
                                                  Object value)
Determine the conventional variable name for the return type of the supplied method, taking the generic collection type (if any) into account, falling back to the given return value if the method declaration is not specific enough (i.e. in case of the return type being declared as Object or as untyped collection).

Parameters:
method - the method to generate a variable name for
value - the return value (may be null if not available)
Returns:
the generated variable name

getVariableNameForReturnType

public static String getVariableNameForReturnType(Method method,
                                                  Class resolvedType,
                                                  Object value)
Determine the conventional variable name for the return type of the supplied method, taking the generic collection type (if any) into account, falling back to the given return value if the method declaration is not specific enough (i.e. in case of the return type being declared as Object or as untyped collection).

Parameters:
method - the method to generate a variable name for
resolvedType - the resolved return type of the method
value - the return value (may be null if not available)
Returns:
the generated variable name

attributeNameToPropertyName

public static String attributeNameToPropertyName(String attributeName)
Convert Strings in attribute name format (lowercase, hyphens separating words) into property name format (camel-cased). For example, transaction-manager is converted into transactionManager.

getQualifiedAttributeName

public static String getQualifiedAttributeName(Class enclosingClass,
                                               String attributeName)
Return an attribute name qualified by the supplied enclosing Class. For example, the attribute name 'foo' qualified by Class 'com.myapp.SomeClass' would be 'com.myapp.SomeClass.foo'

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DecoratingClassLoader

org.springframework.core
Class DecoratingClassLoader

java.lang.Object
    extended by  java.lang.ClassLoader
        extended by  org.springframework.core.DecoratingClassLoader
Direct Known Subclasses:
OverridingClassLoader, ShadowingClassLoader
public abstract class DecoratingClassLoader
extends ClassLoader

Base class for decorating ClassLoaders such as OverridingClassLoader and ShadowingClassLoader, providing common handling of excluded packages and classes.

Since:
2.5.2
Author:
Juergen Hoeller, Rod Johnson

Constructor Summary
DecoratingClassLoader()
Create a new DecoratingClassLoader with no parent ClassLoader.
DecoratingClassLoader(ClassLoader parent)
Create a new DecoratingClassLoader using the given parent ClassLoader for delegation.
Method Summary
void | excludeClass(String className) Add a class name to exclude from decoration (e.g.
void | excludePackage(String packageName) Add a package name to exclude from decoration (e.g.
protected boolean | isExcluded(String className) Determine whether the specified class is excluded from decoration by this class loader.
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DecoratingClassLoader

public DecoratingClassLoader()
Create a new DecoratingClassLoader with no parent ClassLoader.

DecoratingClassLoader

public DecoratingClassLoader(ClassLoader parent)
Create a new DecoratingClassLoader using the given parent ClassLoader for delegation.

Method Detail

excludePackage

public void excludePackage(String packageName)
Add a package name to exclude from decoration (e.g. overriding).

Any class whose fully-qualified name starts with the name registered here will be handled by the parent ClassLoader in the usual fashion.

Parameters:
packageName - the package name to exclude

excludeClass

public void excludeClass(String className)
Add a class name to exclude from decoration (e.g. overriding).

Any class name registered here will be handled by the parent ClassLoader in the usual fashion.

Parameters:
className - the class name to exclude

isExcluded

protected boolean isExcluded(String className)
Determine whether the specified class is excluded from decoration by this class loader.

The default implementation checks against excluded packages and classes.

Parameters:
className - the class name to check
Returns:
whether the specified class is eligible
See Also:
excludePackage(java.lang.String), excludeClass(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


GenericCollectionTypeResolver

org.springframework.core
Class GenericCollectionTypeResolver

java.lang.Object
    extended by  org.springframework.core.GenericCollectionTypeResolver

public abstract class GenericCollectionTypeResolver
extends Object

Helper class for determining element types of collections and maps.

Mainly intended for usage within the framework, determining the target type of values to be added to a collection or map (to be able to attempt type conversion if appropriate).

Since:
2.0
Author:
Juergen Hoeller

Constructor Summary
GenericCollectionTypeResolver()
Method Summary
static Class<?> | getCollectionFieldType(Field collectionField) Determine the generic element type of the given Collection field.
static Class<?> | getCollectionFieldType(Field collectionField, int nestingLevel) Determine the generic element type of the given Collection field.
static Class<?> | getCollectionParameterType(MethodParameter methodParam) Determine the generic element type of the given Collection parameter.
static Class<?> | getCollectionReturnType(Method method) Determine the generic element type of the given Collection return type.
static Class<?> | getCollectionReturnType(Method method, int nestingLevel) Determine the generic element type of the given Collection return type.
static Class<?> | getCollectionType(Class<? extends Collection> collectionClass) Determine the generic element type of the given Collection class (if it declares one through a generic superclass or generic interface).
static Class<?> | getMapKeyFieldType(Field mapField) Determine the generic key type of the given Map field.
static Class<?> | getMapKeyFieldType(Field mapField, int nestingLevel) Determine the generic key type of the given Map field.
static Class<?> | getMapKeyParameterType(MethodParameter methodParam) Determine the generic key type of the given Map parameter.
static Class<?> | getMapKeyReturnType(Method method) Determine the generic key type of the given Map return type.
static Class<?> | getMapKeyReturnType(Method method, int nestingLevel) Determine the generic key type of the given Map return type.
static Class<?> | getMapKeyType(Class<? extends Map> mapClass) Determine the generic key type of the given Map class (if it declares one through a generic superclass or generic interface).
static Class<?> | getMapValueFieldType(Field mapField) Determine the generic value type of the given Map field.
static Class<?> | getMapValueFieldType(Field mapField, int nestingLevel) Determine the generic value type of the given Map field.
static Class<?> | getMapValueParameterType(MethodParameter methodParam) Determine the generic value type of the given Map parameter.
static Class<?> | getMapValueReturnType(Method method) Determine the generic value type of the given Map return type.
static Class<?> | getMapValueReturnType(Method method, int nestingLevel) Determine the generic value type of the given Map return type.
static Class<?> | getMapValueType(Class<? extends Map> mapClass) Determine the generic value type of the given Map class (if it declares one through a generic superclass or generic interface).
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

GenericCollectionTypeResolver

public GenericCollectionTypeResolver()
Method Detail

getCollectionType

public static Class<?> getCollectionType(Class<? extends Collection> collectionClass)
Determine the generic element type of the given Collection class (if it declares one through a generic superclass or generic interface).

Parameters:
collectionClass - the collection class to introspect
Returns:
the generic type, or null if none

getMapKeyType

public static Class<?> getMapKeyType(Class<? extends Map> mapClass)
Determine the generic key type of the given Map class (if it declares one through a generic superclass or generic interface).

Parameters:
mapClass - the map class to introspect
Returns:
the generic type, or null if none

getMapValueType

public static Class<?> getMapValueType(Class<? extends Map> mapClass)
Determine the generic value type of the given Map class (if it declares one through a generic superclass or generic interface).

Parameters:
mapClass - the map class to introspect
Returns:
the generic type, or null if none

getCollectionFieldType

public static Class<?> getCollectionFieldType(Field collectionField)
Determine the generic element type of the given Collection field.

Parameters:
collectionField - the collection field to introspect
Returns:
the generic type, or null if none

getCollectionFieldType

public static Class<?> getCollectionFieldType(Field collectionField,
                                              int nestingLevel)
Determine the generic element type of the given Collection field.

Parameters:
collectionField - the collection field to introspect
nestingLevel - the nesting level of the target type (typically 1; e.g. in case of a List of Lists, 1 would indicate the nested List, whereas 2 would indicate the element of the nested List)
Returns:
the generic type, or null if none

getMapKeyFieldType

public static Class<?> getMapKeyFieldType(Field mapField)
Determine the generic key type of the given Map field.

Parameters:
mapField - the map field to introspect
Returns:
the generic type, or null if none

getMapKeyFieldType

public static Class<?> getMapKeyFieldType(Field mapField,
                                          int nestingLevel)
Determine the generic key type of the given Map field.

Parameters:
mapField - the map field to introspect
nestingLevel - the nesting level of the target type (typically 1; e.g. in case of a List of Lists, 1 would indicate the nested List, whereas 2 would indicate the element of the nested List)
Returns:
the generic type, or null if none

getMapValueFieldType

public static Class<?> getMapValueFieldType(Field mapField)
Determine the generic value type of the given Map field.

Parameters:
mapField - the map field to introspect
Returns:
the generic type, or null if none

getMapValueFieldType

public static Class<?> getMapValueFieldType(Field mapField,
                                            int nestingLevel)
Determine the generic value type of the given Map field.

Parameters:
mapField - the map field to introspect
nestingLevel - the nesting level of the target type (typically 1; e.g. in case of a List of Lists, 1 would indicate the nested List, whereas 2 would indicate the element of the nested List)
Returns:
the generic type, or null if none

getCollectionParameterType

public static Class<?> getCollectionParameterType(MethodParameter methodParam)
Determine the generic element type of the given Collection parameter.

Parameters:
methodParam - the method parameter specification
Returns:
the generic type, or null if none

getMapKeyParameterType

public static Class<?> getMapKeyParameterType(MethodParameter methodParam)
Determine the generic key type of the given Map parameter.

Parameters:
methodParam - the method parameter specification
Returns:
the generic type, or null if none

getMapValueParameterType

public static Class<?> getMapValueParameterType(MethodParameter methodParam)
Determine the generic value type of the given Map parameter.

Parameters:
methodParam - the method parameter specification
Returns:
the generic type, or null if none

getCollectionReturnType

public static Class<?> getCollectionReturnType(Method method)
Determine the generic element type of the given Collection return type.

Parameters:
method - the method to check the return type for
Returns:
the generic type, or null if none

getCollectionReturnType

public static Class<?> getCollectionReturnType(Method method,
                                               int nestingLevel)
Determine the generic element type of the given Collection return type.

If the specified nesting level is higher than 1, the element type of a nested Collection/Map will be analyzed.

Parameters:
method - the method to check the return type for
nestingLevel - the nesting level of the target type (typically 1; e.g. in case of a List of Lists, 1 would indicate the nested List, whereas 2 would indicate the element of the nested List)
Returns:
the generic type, or null if none

getMapKeyReturnType

public static Class<?> getMapKeyReturnType(Method method)
Determine the generic key type of the given Map return type.

Parameters:
method - the method to check the return type for
Returns:
the generic type, or null if none

getMapKeyReturnType

public static Class<?> getMapKeyReturnType(Method method,
                                           int nestingLevel)
Determine the generic key type of the given Map return type.

Parameters:
method - the method to check the return type for
nestingLevel - the nesting level of the target type (typically 1; e.g. in case of a List of Lists, 1 would indicate the nested List, whereas 2 would indicate the element of the nested List)
Returns:
the generic type, or null if none

getMapValueReturnType

public static Class<?> getMapValueReturnType(Method method)
Determine the generic value type of the given Map return type.

Parameters:
method - the method to check the return type for
Returns:
the generic type, or null if none

getMapValueReturnType

public static Class<?> getMapValueReturnType(Method method,
                                             int nestingLevel)
Determine the generic value type of the given Map return type.

Parameters:
method - the method to check the return type for
nestingLevel - the nesting level of the target type (typically 1; e.g. in case of a List of Lists, 1 would indicate the nested List, whereas 2 would indicate the element of the nested List)
Returns:
the generic type, or null if none
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


GenericTypeResolver

org.springframework.core
Class GenericTypeResolver

java.lang.Object
    extended by  org.springframework.core.GenericTypeResolver

public abstract class GenericTypeResolver
extends Object

Helper class for resolving generic types against type variables.

Mainly intended for usage within the framework, resolving method parameter types even when they are declared generically.

Since:
2.5.2
Author:
Juergen Hoeller, Rob Harrop
See Also:
GenericCollectionTypeResolver, JdkVersion

Constructor Summary
GenericTypeResolver()
Method Summary
static Type | getTargetType(MethodParameter methodParam) Determine the target type for the given parameter specification.
static Class<?> | resolveParameterType(MethodParameter methodParam, Class clazz) Determine the target type for the given generic parameter type.
static Class<?> | resolveReturnType(Method method, Class clazz) Determine the target type for the generic return type of the given method.
static Class<?> | resolveTypeArgument(Class clazz, Class genericIfc) Resolve the single type argument of the given generic interface against the given target class which is assumed to implement the generic interface and possibly declare a concrete type for its type variable.
static Class[] | resolveTypeArguments(Class clazz, Class genericIfc) Resolve the type arguments of the given generic interface against the given target class which is assumed to implement the generic interface and possibly declare concrete types for its type variables.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

GenericTypeResolver

public GenericTypeResolver()
Method Detail

getTargetType

public static Type getTargetType(MethodParameter methodParam)
Determine the target type for the given parameter specification.

Parameters:
methodParam - the method parameter specification
Returns:
the corresponding generic parameter type

resolveParameterType

public static Class<?> resolveParameterType(MethodParameter methodParam,
                                            Class clazz)
Determine the target type for the given generic parameter type.

Parameters:
methodParam - the method parameter specification
clazz - the class to resolve type variables against
Returns:
the corresponding generic parameter or return type

resolveReturnType

public static Class<?> resolveReturnType(Method method,
                                         Class clazz)
Determine the target type for the generic return type of the given method.

Parameters:
method - the method to introspect
clazz - the class to resolve type variables against
Returns:
the corresponding generic parameter or return type

resolveTypeArgument

public static Class<?> resolveTypeArgument(Class clazz,
                                           Class genericIfc)
Resolve the single type argument of the given generic interface against the given target class which is assumed to implement the generic interface and possibly declare a concrete type for its type variable.

Parameters:
clazz - the target class to check against
genericIfc - the generic interface to resolve the type argument from
Returns:
the resolved type of the argument, or null if not resolvable

resolveTypeArguments

public static Class[] resolveTypeArguments(Class clazz,
                                           Class genericIfc)
Resolve the type arguments of the given generic interface against the given target class which is assumed to implement the generic interface and possibly declare concrete types for its type variables.

Parameters:
clazz - the target class to check against
genericIfc - the generic interface to resolve the type argument from
Returns:
the resolved type of each argument, with the array size matching the number of actual type arguments, or null if not resolvable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JdkVersion

org.springframework.core
Class JdkVersion

java.lang.Object
    extended by  org.springframework.core.JdkVersion

public abstract class JdkVersion
extends Object

Internal helper class used to find the Java/JVM version that Spring is operating on, to allow for automatically adapting to the present platform's capabilities.

Note that Spring requires JVM 1.5 or higher, as of Spring 3.0.

Author:
Rod Johnson, Juergen Hoeller, Rick Evans

Field Summary
static int | JAVA_13 Constant identifying the 1.3.x JVM (JDK 1.3).
static int | JAVA_14 Constant identifying the 1.4.x JVM (J2SE 1.4).
static int | JAVA_15 Constant identifying the 1.5 JVM (Java 5).
static int | JAVA_16 Constant identifying the 1.6 JVM (Java 6).
static int | JAVA_17 Constant identifying the 1.7 JVM (Java 7).
Constructor Summary
JdkVersion()
Method Summary
static String getJavaVersion()
Return the full Java version string, as returned by System.getProperty("java.version").
static int getMajorJavaVersion()
Get the major version code.
static boolean isAtLeastJava14()
Deprecated. as of Spring 3.0 which requires Java 1.5+
static boolean isAtLeastJava15()
Deprecated. as of Spring 3.0 which requires Java 1.5+
static boolean isAtLeastJava16()
Deprecated. as of Spring 3.0, in favor of reflective checks for the specific Java 1.6 classes of interest
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

JAVA_13

public static final int JAVA_13
Constant identifying the 1.3.x JVM (JDK 1.3).

See Also:
Constant Field Values

JAVA_14

public static final int JAVA_14
Constant identifying the 1.4.x JVM (J2SE 1.4).

See Also:
Constant Field Values

JAVA_15

public static final int JAVA_15
Constant identifying the 1.5 JVM (Java 5).

See Also:
Constant Field Values

JAVA_16

public static final int JAVA_16
Constant identifying the 1.6 JVM (Java 6).

See Also:
Constant Field Values

JAVA_17

public static final int JAVA_17
Constant identifying the 1.7 JVM (Java 7).

See Also:
Constant Field Values
Constructor Detail

JdkVersion

public JdkVersion()
Method Detail

getJavaVersion

public static String getJavaVersion()
Return the full Java version string, as returned by System.getProperty("java.version").

Returns:
the full Java version string
See Also:
System.getProperty(String)

getMajorJavaVersion

public static int getMajorJavaVersion()
Get the major version code. This means we can do things like if (getMajorJavaVersion() < JAVA_14).

Returns:
a code comparable to the JAVA_XX codes in this class
See Also:
JAVA_13, JAVA_14, JAVA_15, JAVA_16, JAVA_17

isAtLeastJava14

@Deprecated
public static boolean isAtLeastJava14()
Deprecated. as of Spring 3.0 which requires Java 1.5+

Convenience method to determine if the current JVM is at least Java 1.4.

Returns:
true if the current JVM is at least Java 1.4
See Also:
getMajorJavaVersion(), JAVA_14, JAVA_15, JAVA_16, JAVA_17

isAtLeastJava15

@Deprecated
public static boolean isAtLeastJava15()
Deprecated. as of Spring 3.0 which requires Java 1.5+

Convenience method to determine if the current JVM is at least Java 1.5 (Java 5).

Returns:
true if the current JVM is at least Java 1.5
See Also:
getMajorJavaVersion(), JAVA_15, JAVA_16, JAVA_17

isAtLeastJava16

@Deprecated
public static boolean isAtLeastJava16()
Deprecated. as of Spring 3.0, in favor of reflective checks for the specific Java 1.6 classes of interest

Convenience method to determine if the current JVM is at least Java 1.6 (Java 6).

Returns:
true if the current JVM is at least Java 1.6
See Also:
getMajorJavaVersion(), JAVA_16, JAVA_17
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LocalVariableTableParameterNameDiscoverer

org.springframework.core
Class LocalVariableTableParameterNameDiscoverer

java.lang.Object
    extended by  org.springframework.core.LocalVariableTableParameterNameDiscoverer
All Implemented Interfaces:
ParameterNameDiscoverer
public class LocalVariableTableParameterNameDiscoverer
extends Object
implements ParameterNameDiscoverer

Implementation of ParameterNameDiscoverer that uses the LocalVariableTable information in the method attributes to discover parameter names. Returns null if the class file was compiled without debug information.

Uses ObjectWeb's ASM library for analyzing class files. Each discoverer instance caches the ASM discovered information for each introspected Class, in a thread-safe manner. It is recommended to reuse discoverer instances as far as possible.

Since:
2.0
Author:
Adrian Colyer, Costin Leau, Juergen Hoeller

Constructor Summary
LocalVariableTableParameterNameDiscoverer()
Method Summary
String[] | getParameterNames(Constructor ctor) Return parameter names for this constructor, or null if they cannot be determined.
String[] | getParameterNames(Method method) Return parameter names for this method, or null if they cannot be determined.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

LocalVariableTableParameterNameDiscoverer

public LocalVariableTableParameterNameDiscoverer()
Method Detail

getParameterNames

public String[] getParameterNames(Method method)
Description copied from interface: ParameterNameDiscoverer
Return parameter names for this method, or null if they cannot be determined.

Specified by:
getParameterNames in interface ParameterNameDiscoverer
Parameters:
method - method to find parameter names for
Returns:
an array of parameter names if the names can be resolved, or null if they cannot

getParameterNames

public String[] getParameterNames(Constructor ctor)
Description copied from interface: ParameterNameDiscoverer
Return parameter names for this constructor, or null if they cannot be determined.

Specified by:
getParameterNames in interface ParameterNameDiscoverer
Parameters:
ctor - constructor to find parameter names for
Returns:
an array of parameter names if the names can be resolved, or null if they cannot
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MethodParameter

org.springframework.core
Class MethodParameter

java.lang.Object
    extended by  org.springframework.core.MethodParameter

public class MethodParameter
extends Object

Helper class that encapsulates the specification of a method parameter, i.e. a Method or Constructor plus a parameter index and a nested type index for a declared generic type. Useful as a specification object to pass along.

Since:
2.0
Author:
Juergen Hoeller, Rob Harrop, Andy Clement
See Also:
GenericCollectionTypeResolver

Constructor Summary
MethodParameter(Constructor constructor, int parameterIndex)
Create a new MethodParameter for the given constructor, with nesting level 1.
MethodParameter(Constructor constructor, int parameterIndex, int nestingLevel)
Create a new MethodParameter for the given constructor.
MethodParameter(Method method, int parameterIndex)
Create a new MethodParameter for the given method, with nesting level 1.
MethodParameter(Method method, int parameterIndex, int nestingLevel)
Create a new MethodParameter for the given method.
MethodParameter(MethodParameter original)
Copy constructor, resulting in an independent MethodParameter object based on the same metadata and cache state that the original object was in.
Method Summary
 void decreaseNestingLevel()
Decrease this parameter's nesting level.
static MethodParameter forMethodOrConstructor(Object methodOrConstructor, int parameterIndex)
Create a new MethodParameter for the given method or constructor.
 Constructor getConstructor()
Return the wrapped Constructor, if any.
 Class getDeclaringClass()
Return the class that declares the underlying Method or Constructor.
 Type getGenericParameterType()
Return the generic type of the method/constructor parameter.
 Method getMethod()
Return the wrapped Method, if any.
<T extends Annotation>
T
getMethodAnnotation(Class<T> annotationType)
Return the method/constructor annotation of the given type, if available.
 Annotation[] getMethodAnnotations()
Return the annotations associated with the target method/constructor itself.
 int getNestingLevel()
Return the nesting level of the target type (typically 1; e.g.
<T extends Annotation>
T
getParameterAnnotation(Class<T> annotationType)
Return the parameter annotation of the given type, if available.
 Annotation[] getParameterAnnotations()
Return the annotations associated with the specific method/constructor parameter.
 int getParameterIndex()
Return the index of the method/constructor parameter.
 String getParameterName()
Return the name of the method/constructor parameter.
 Class<?> getParameterType()
Return the type of the method/constructor parameter.
 Integer getTypeIndexForCurrentLevel()
Return the type index for the current nesting level.
 Integer getTypeIndexForLevel(int nestingLevel)
Return the type index for the specified nesting level.
 void increaseNestingLevel()
Increase this parameter's nesting level.
 void initParameterNameDiscovery(ParameterNameDiscoverer parameterNameDiscoverer)
Initialize parameter name discovery for this method parameter.
 void setTypeIndexForCurrentLevel(int typeIndex)
Set the type index for the current nesting level.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MethodParameter

public MethodParameter(Method method,
                       int parameterIndex)
Create a new MethodParameter for the given method, with nesting level 1.

Parameters:
method - the Method to specify a parameter for
parameterIndex - the index of the parameter

MethodParameter

public MethodParameter(Method method,
                       int parameterIndex,
                       int nestingLevel)
Create a new MethodParameter for the given method.

Parameters:
method - the Method to specify a parameter for
parameterIndex - the index of the parameter (-1 for the method return type; 0 for the first method parameter, 1 for the second method parameter, etc)
nestingLevel - the nesting level of the target type (typically 1; e.g. in case of a List of Lists, 1 would indicate the nested List, whereas 2 would indicate the element of the nested List)

MethodParameter

public MethodParameter(Constructor constructor,
                       int parameterIndex)
Create a new MethodParameter for the given constructor, with nesting level 1.

Parameters:
constructor - the Constructor to specify a parameter for
parameterIndex - the index of the parameter

MethodParameter

public MethodParameter(Constructor constructor,
                       int parameterIndex,
                       int nestingLevel)
Create a new MethodParameter for the given constructor.

Parameters:
constructor - the Constructor to specify a parameter for
parameterIndex - the index of the parameter
nestingLevel - the nesting level of the target type (typically 1; e.g. in case of a List of Lists, 1 would indicate the nested List, whereas 2 would indicate the element of the nested List)

MethodParameter

public MethodParameter(MethodParameter original)
Copy constructor, resulting in an independent MethodParameter object based on the same metadata and cache state that the original object was in.

Parameters:
original - the original MethodParameter object to copy from
Method Detail

getMethod

public Method getMethod()
Return the wrapped Method, if any.

Note: Either Method or Constructor is available.

Returns:
the Method, or null if none

getConstructor

public Constructor getConstructor()
Return the wrapped Constructor, if any.

Note: Either Method or Constructor is available.

Returns:
the Constructor, or null if none

getDeclaringClass

public Class getDeclaringClass()
Return the class that declares the underlying Method or Constructor.

getParameterIndex

public int getParameterIndex()
Return the index of the method/constructor parameter.

Returns:
the parameter index (never negative)

getParameterType

public Class<?> getParameterType()
Return the type of the method/constructor parameter.

Returns:
the parameter type (never null)

getGenericParameterType

public Type getGenericParameterType()
Return the generic type of the method/constructor parameter.

Returns:
the parameter type (never null)

getMethodAnnotations

public Annotation[] getMethodAnnotations()
Return the annotations associated with the target method/constructor itself.

getMethodAnnotation

public <T extends Annotation> T getMethodAnnotation(Class<T> annotationType)
Return the method/constructor annotation of the given type, if available.

Parameters:
annotationType - the annotation type to look for
Returns:
the annotation object, or null if not found

getParameterAnnotations

public Annotation[] getParameterAnnotations()
Return the annotations associated with the specific method/constructor parameter.

getParameterAnnotation

public <T extends Annotation> T getParameterAnnotation(Class<T> annotationType)
Return the parameter annotation of the given type, if available.

Parameters:
annotationType - the annotation type to look for
Returns:
the annotation object, or null if not found

initParameterNameDiscovery

public void initParameterNameDiscovery(ParameterNameDiscoverer parameterNameDiscoverer)
Initialize parameter name discovery for this method parameter.

This method does not actually try to retrieve the parameter name at this point; it just allows discovery to happen when the application calls getParameterName() (if ever).

getParameterName

public String getParameterName()
Return the name of the method/constructor parameter.

Returns:
the parameter name (may be null if no parameter name metadata is contained in the class file or no ParameterNameDiscoverer has been set to begin with)

increaseNestingLevel

public void increaseNestingLevel()
Increase this parameter's nesting level.

See Also:
getNestingLevel()

decreaseNestingLevel

public void decreaseNestingLevel()
Decrease this parameter's nesting level.

See Also:
getNestingLevel()

getNestingLevel

public int getNestingLevel()
Return the nesting level of the target type (typically 1; e.g. in case of a List of Lists, 1 would indicate the nested List, whereas 2 would indicate the element of the nested List).

setTypeIndexForCurrentLevel

public void setTypeIndexForCurrentLevel(int typeIndex)
Set the type index for the current nesting level.

Parameters:
typeIndex - the corresponding type index (or null for the default type index)
See Also:
getNestingLevel()

getTypeIndexForCurrentLevel

public Integer getTypeIndexForCurrentLevel()
Return the type index for the current nesting level.

Returns:
the corresponding type index, or null if none specified (indicating the default type index)
See Also:
getNestingLevel()

getTypeIndexForLevel

public Integer getTypeIndexForLevel(int nestingLevel)
Return the type index for the specified nesting level.

Parameters:
nestingLevel - the nesting level to check
Returns:
the corresponding type index, or null if none specified (indicating the default type index)

forMethodOrConstructor

public static MethodParameter forMethodOrConstructor(Object methodOrConstructor,
                                                     int parameterIndex)
Create a new MethodParameter for the given method or constructor.

This is a convenience constructor for scenarios where a Method or Constructor reference is treated in a generic fashion.

Parameters:
methodOrConstructor - the Method or Constructor to specify a parameter for
parameterIndex - the index of the parameter
Returns:
the corresponding MethodParameter instance
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NamedInheritableThreadLocal

org.springframework.core
Class NamedInheritableThreadLocal<T>

java.lang.Object
    extended by  java.lang.ThreadLocal<T>
        extended by  java.lang.InheritableThreadLocal<T>
            extended by  org.springframework.core.NamedInheritableThreadLocal<T>

public class NamedInheritableThreadLocal<T>
extends InheritableThreadLocal<T>

InheritableThreadLocal subclass that exposes a specified name as toString() result (allowing for introspection).

Since:
2.5.2
Author:
Juergen Hoeller
See Also:
NamedThreadLocal

Constructor Summary
NamedInheritableThreadLocal(String name)
Create a new NamedInheritableThreadLocal with the given name.
Method Summary
 String toString()
Methods inherited from class java.lang.InheritableThreadLocal
childValue
Methods inherited from class java.lang.ThreadLocal
get, initialValue, remove, set
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

NamedInheritableThreadLocal

public NamedInheritableThreadLocal(String name)
Create a new NamedInheritableThreadLocal with the given name.

Parameters:
name - a descriptive name for this ThreadLocal
Method Detail

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NamedThreadLocal

org.springframework.core
Class NamedThreadLocal<T>

java.lang.Object
    extended by  java.lang.ThreadLocal<T>
        extended by  org.springframework.core.NamedThreadLocal<T>

public class NamedThreadLocal<T>
extends ThreadLocal<T>

ThreadLocal subclass that exposes a specified name as toString() result (allowing for introspection).

Since:
2.5.2
Author:
Juergen Hoeller
See Also:
NamedInheritableThreadLocal

Constructor Summary
NamedThreadLocal(String name)
Create a new NamedThreadLocal with the given name.
Method Summary
 String toString()
Methods inherited from class java.lang.ThreadLocal
get, initialValue, remove, set
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

NamedThreadLocal

public NamedThreadLocal(String name)
Create a new NamedThreadLocal with the given name.

Parameters:
name - a descriptive name for this ThreadLocal
Method Detail

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NestedExceptionUtils

org.springframework.core
Class NestedExceptionUtils

java.lang.Object
    extended by  org.springframework.core.NestedExceptionUtils

public abstract class NestedExceptionUtils
extends Object

Helper class for implementing exception classes which are capable of holding nested exceptions. Necessary because we can't share a base class among different exception types.

Mainly for use within the framework.

Since:
2.0
Author:
Juergen Hoeller
See Also:
NestedRuntimeException, NestedCheckedException, NestedIOException, NestedServletException

Constructor Summary
NestedExceptionUtils()
Method Summary
static String buildMessage(String message, Throwable cause)
Build a message for the given base message and root cause.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

NestedExceptionUtils

public NestedExceptionUtils()
Method Detail

buildMessage

public static String buildMessage(String message,
                                  Throwable cause)
Build a message for the given base message and root cause.

Parameters:
message - the base message
cause - the root cause
Returns:
the full exception message
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OrderComparator

org.springframework.core
Class OrderComparator

java.lang.Object
    extended by  org.springframework.core.OrderComparator
All Implemented Interfaces:
Comparator<Object>
Direct Known Subclasses:
AnnotationAwareOrderComparator
public class OrderComparator
extends Object
implements Comparator<Object>

Comparator implementation for Ordered objects, sorting by order value ascending (resp. by priority descending).

Non-Ordered objects are treated as greatest order values, thus ending up at the end of the list, in arbitrary order (just like same order values of Ordered objects).

Since:
07.04.2003
Author:
Juergen Hoeller
See Also:
Ordered, Collections.sort(java.util.List, java.util.Comparator), Arrays.sort(Object[], java.util.Comparator)

Field Summary
static OrderComparator INSTANCE
Shared default instance of OrderComparator.
Constructor Summary
OrderComparator()
Method Summary
int | compare(Object o1, Object o2)
protected int | getOrder(Object obj) Determine the order value for the given object.
static void | sort(List<?> list) Sort the given List with a default OrderComparator.
static void | sort(Object[] array) Sort the given array with a default OrderComparator.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals

Field Detail

INSTANCE

public static OrderComparator INSTANCE
Shared default instance of OrderComparator.

Constructor Detail

OrderComparator

public OrderComparator()
Method Detail

compare

public int compare(Object o1,
                   Object o2)
Specified by:
compare in interface Comparator<Object>

getOrder

protected int getOrder(Object obj)
Determine the order value for the given object.

The default implementation checks against the Ordered interface. Can be overridden in subclasses.

Parameters:
obj - the object to check
Returns:
the order value, or Ordered.LOWEST_PRECEDENCE as fallback

sort

public static void sort(List<?> list)
Sort the given List with a default OrderComparator.

Optimized to skip sorting for lists with size 0 or 1, in order to avoid unnecessary array extraction.

Parameters:
list - the List to sort
See Also:
Collections.sort(java.util.List, java.util.Comparator)

sort

public static void sort(Object[] array)
Sort the given array with a default OrderComparator.

Optimized to skip sorting for lists with size 0 or 1, in order to avoid unnecessary array extraction.

Parameters:
array - the array to sort
See Also:
Arrays.sort(Object[], java.util.Comparator)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OverridingClassLoader

org.springframework.core
Class OverridingClassLoader

java.lang.Object
    extended by  java.lang.ClassLoader
        extended by  org.springframework.core.DecoratingClassLoader
            extended by  org.springframework.core.OverridingClassLoader
Direct Known Subclasses:
SimpleInstrumentableClassLoader, SimpleThrowawayClassLoader
public class OverridingClassLoader
extends DecoratingClassLoader

ClassLoader that does not always delegate to the parent loader, as normal class loaders do. This enables, for example, instrumentation to be forced in the overriding ClassLoader, or a "throwaway" class loading behavior, where selected classes are temporarily loaded in the overriding ClassLoader, in order to load an instrumented version of the class in the parent ClassLoader later on.

Since:
2.0.1
Author:
Rod Johnson, Juergen Hoeller

Field Summary
static String[] DEFAULT_EXCLUDED_PACKAGES
Packages that are excluded by default
Constructor Summary
OverridingClassLoader(ClassLoader parent)
Create a new OverridingClassLoader for the given class loader.
Method Summary
protected boolean | isEligibleForOverriding(String className) Determine whether the specified class is eligible for overriding by this class loader.
protected byte[] | loadBytesForClass(String name) Load the defining bytes for the given class, to be turned into a Class object through a ClassLoader.defineClass(byte[], int, int) call.
protected Class | loadClass(String name, boolean resolve)
protected Class | loadClassForOverriding(String name) Load the specified class for overriding purposes in this ClassLoader.
protected InputStream | openStreamForClass(String name) Open an InputStream for the specified class.
protected byte[] | transformIfNecessary(String name, byte[] bytes) Transformation hook to be implemented by subclasses.
Methods inherited from class org.springframework.core.DecoratingClassLoader
excludeClass, excludePackage, isExcluded
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_EXCLUDED_PACKAGES

public static final String[] DEFAULT_EXCLUDED_PACKAGES
Packages that are excluded by default

Constructor Detail

OverridingClassLoader

public OverridingClassLoader(ClassLoader parent)
Create a new OverridingClassLoader for the given class loader.

Parameters:
parent - the ClassLoader to build an overriding ClassLoader for
Method Detail

loadClass

protected Class loadClass(String name,
                          boolean resolve)
                   throws ClassNotFoundException
Overrides:
loadClass in class ClassLoader
Throws:
ClassNotFoundException

isEligibleForOverriding

protected boolean isEligibleForOverriding(String className)
Determine whether the specified class is eligible for overriding by this class loader.

Parameters:
className - the class name to check
Returns:
whether the specified class is eligible
See Also:
DecoratingClassLoader.isExcluded(java.lang.String)

loadClassForOverriding

protected Class loadClassForOverriding(String name)
                                throws ClassNotFoundException
Load the specified class for overriding purposes in this ClassLoader.

The default implementation delegates to ClassLoader.findLoadedClass(java.lang.String), loadBytesForClass(java.lang.String) and ClassLoader.defineClass(byte[], int, int).

Parameters:
name - the name of the class
Returns:
the Class object, or null if no class defined for that name
Throws:
ClassNotFoundException - if the class for the given name couldn't be loaded

loadBytesForClass

protected byte[] loadBytesForClass(String name)
                            throws ClassNotFoundException
Load the defining bytes for the given class, to be turned into a Class object through a ClassLoader.defineClass(byte[], int, int) call.

The default implementation delegates to openStreamForClass(java.lang.String) and transformIfNecessary(java.lang.String, byte[]).

Parameters:
name - the name of the class
Returns:
the byte content (with transformers already applied), or null if no class defined for that name
Throws:
ClassNotFoundException - if the class for the given name couldn't be loaded

openStreamForClass

protected InputStream openStreamForClass(String name)
Open an InputStream for the specified class.

The default implementation loads a standard class file through the parent ClassLoader's getResourceAsStream method.

Parameters:
name - the name of the class
Returns:
the InputStream containing the byte code for the specified class

transformIfNecessary

protected byte[] transformIfNecessary(String name,
                                      byte[] bytes)
Transformation hook to be implemented by subclasses.

The default implementation simply returns the given bytes as-is.

Parameters:
name - the fully-qualified name of the class being transformed
bytes - the raw bytes of the class
Returns:
the transformed bytes (never null; same as the input bytes if the transformation produced no changes)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PrioritizedParameterNameDiscoverer

org.springframework.core
Class PrioritizedParameterNameDiscoverer

java.lang.Object
    extended by  org.springframework.core.PrioritizedParameterNameDiscoverer
All Implemented Interfaces:
ParameterNameDiscoverer
public class PrioritizedParameterNameDiscoverer
extends Object
implements ParameterNameDiscoverer

ParameterNameDiscoverer implementation that tries several ParameterNameDiscoverers in succession. Those added first in the addDiscoverer method have highest priority. If one returns null, the next will be tried.

The default behavior is always to return null if no discoverer matches.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller

Constructor Summary
PrioritizedParameterNameDiscoverer()
Method Summary
void | addDiscoverer(ParameterNameDiscoverer pnd) Add a further ParameterNameDiscoverer to the list of discoverers that this PrioritizedParameterNameDiscoverer checks.
String[] | getParameterNames(Constructor ctor) Return parameter names for this constructor, or null if they cannot be determined.
String[] | getParameterNames(Method method) Return parameter names for this method, or null if they cannot be determined.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PrioritizedParameterNameDiscoverer

public PrioritizedParameterNameDiscoverer()
Method Detail

addDiscoverer

public void addDiscoverer(ParameterNameDiscoverer pnd)
Add a further ParameterNameDiscoverer to the list of discoverers that this PrioritizedParameterNameDiscoverer checks.

getParameterNames

public String[] getParameterNames(Method method)
Description copied from interface: ParameterNameDiscoverer
Return parameter names for this method, or null if they cannot be determined.

Specified by:
getParameterNames in interface ParameterNameDiscoverer
Parameters:
method - method to find parameter names for
Returns:
an array of parameter names if the names can be resolved, or null if they cannot

getParameterNames

public String[] getParameterNames(Constructor ctor)
Description copied from interface: ParameterNameDiscoverer
Return parameter names for this constructor, or null if they cannot be determined.

Specified by:
getParameterNames in interface ParameterNameDiscoverer
Parameters:
ctor - constructor to find parameter names for
Returns:
an array of parameter names if the names can be resolved, or null if they cannot
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleAliasRegistry

org.springframework.core
Class SimpleAliasRegistry

java.lang.Object
    extended by  org.springframework.core.SimpleAliasRegistry
All Implemented Interfaces:
AliasRegistry
Direct Known Subclasses:
DefaultSingletonBeanRegistry, SimpleBeanDefinitionRegistry
public class SimpleAliasRegistry
extends Object
implements AliasRegistry

Simple implementation of the AliasRegistry interface. Serves as base class for BeanDefinitionRegistry implementations.

Since:
2.5.2
Author:
Juergen Hoeller

Constructor Summary
SimpleAliasRegistry()
Method Summary
protected boolean | allowAliasOverriding() Return whether alias overriding is allowed.
String | canonicalName(String name) Determine the raw name, resolving aliases to canonical names.
String[] | getAliases(String name) Return the aliases for the given name, if defined.
boolean | isAlias(String name) Determine whether this given name is defines as an alias (as opposed to the name of an actually registered component).
void | registerAlias(String name, String alias) Given a name, register an alias for it.
void | removeAlias(String alias) Remove the specified alias from this registry.
void | resolveAliases(StringValueResolver valueResolver) Resolve all alias target names and aliases registered in this factory, applying the given StringValueResolver to them.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleAliasRegistry

public SimpleAliasRegistry()
Method Detail

registerAlias

public void registerAlias(String name,
                          String alias)
Description copied from interface: AliasRegistry
Given a name, register an alias for it.

Specified by:
registerAlias in interface AliasRegistry
Parameters:
name - the canonical name
alias - the alias to be registered

allowAliasOverriding

protected boolean allowAliasOverriding()
Return whether alias overriding is allowed. Default is true.

removeAlias

public void removeAlias(String alias)
Description copied from interface: AliasRegistry
Remove the specified alias from this registry.

Specified by:
removeAlias in interface AliasRegistry
Parameters:
alias - the alias to remove

isAlias

public boolean isAlias(String name)
Description copied from interface: AliasRegistry
Determine whether this given name is defines as an alias (as opposed to the name of an actually registered component).

Specified by:
isAlias in interface AliasRegistry
Parameters:
name - the bean name to check
Returns:
whether the given name is an alias

getAliases

public String[] getAliases(String name)
Description copied from interface: AliasRegistry
Return the aliases for the given name, if defined.

Specified by:
getAliases in interface AliasRegistry
Parameters:
name - the name to check for aliases
Returns:
the aliases, or an empty array if none

resolveAliases

public void resolveAliases(StringValueResolver valueResolver)
Resolve all alias target names and aliases registered in this factory, applying the given StringValueResolver to them.

The value resolver may for example resolve placeholders in target bean names and even in alias names.

Parameters:
valueResolver - the StringValueResolver to apply

canonicalName

public String canonicalName(String name)
Determine the raw name, resolving aliases to canonical names.

Parameters:
name - the user-specified name
Returns:
the transformed name
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SpringVersion

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.core
Class SpringVersion

java.lang.Object
    extended by  org.springframework.core.SpringVersion

public class SpringVersion
extends Object

Class that exposes the Spring version. Fetches the "Implementation-Version" manifest attribute from the jar file.

Note that some ClassLoaders do not expose the package metadata, hence this class might not be able to determine the Spring version in all environments. Consider using a reflection-based check instead: For example, checking for the presence of a specific Spring 2.0 method that you intend to call.

Since:
1.1
Author:
Juergen Hoeller

Constructor Summary
SpringVersion()
Method Summary
static String getVersion()
Return the full version string of the present Spring codebase, or null if it cannot be determined.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SpringVersion

public SpringVersion()
Method Detail

getVersion

public static String getVersion()
Return the full version string of the present Spring codebase, or null if it cannot be determined.

See Also:
Package.getImplementationVersion()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ConstantException

org.springframework.core
Class ConstantException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  java.lang.IllegalArgumentException
                    extended by  org.springframework.core.ConstantException
All Implemented Interfaces:
Serializable
public class ConstantException
extends IllegalArgumentException

Exception thrown when the Constants class is asked for an invalid constant name.

Since:
28.04.2003
Author:
Rod Johnson
See Also:
Constants, Serialized Form

Constructor Summary
ConstantException(String className, String namePrefix, Object value)
Thrown when an invalid constant value is looked up.
ConstantException(String className, String field, String message)
Thrown when an invalid constant name is requested.
Method Summary
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ConstantException

public ConstantException(String className,
                         String field,
                         String message)
Thrown when an invalid constant name is requested.

Parameters:
className - name of the class containing the constant definitions
field - invalid constant name
message - description of the problem

ConstantException

public ConstantException(String className,
                         String namePrefix,
                         Object value)
Thrown when an invalid constant value is looked up.

Parameters:
className - name of the class containing the constant definitions
namePrefix - prefix of the searched constant names
value - the looked up constant value
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NestedCheckedException

org.springframework.core
Class NestedCheckedException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  org.springframework.core.NestedCheckedException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
MetaDataAccessException
public abstract class NestedCheckedException
extends Exception

Handy class for wrapping checked Exceptions with a root cause.

This class is abstract to force the programmer to extend the class. getMessage will include nested exception information; printStackTrace and other like methods will delegate to the wrapped exception, if any.

The similarity between this class and the NestedRuntimeException class is unavoidable, as Java forces these two classes to have different superclasses (ah, the inflexibility of concrete inheritance!).

Author:
Rod Johnson, Juergen Hoeller
See Also:
getMessage(), Throwable.printStackTrace(), NestedRuntimeException, Serialized Form

Constructor Summary
NestedCheckedException(String msg)
Construct a NestedCheckedException with the specified detail message.
NestedCheckedException(String msg, Throwable cause)
Construct a NestedCheckedException with the specified detail message and nested exception.
Method Summary
boolean | contains(Class exType) Check whether this exception contains an exception of the given type: either it is of the given class itself or it contains a nested cause of the given type.
String | getMessage() Return the detail message, including the message from the nested exception if there is one.
Throwable | getMostSpecificCause() Retrieve the most specific cause of this exception, that is, either the innermost cause (root cause) or this exception itself.
Throwable | getRootCause() Retrieve the innermost cause of this exception, if any.
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

NestedCheckedException

public NestedCheckedException(String msg)
Construct a NestedCheckedException with the specified detail message.

Parameters:
msg - the detail message

NestedCheckedException

public NestedCheckedException(String msg,
                              Throwable cause)
Construct a NestedCheckedException with the specified detail message and nested exception.

Parameters:
msg - the detail message
cause - the nested exception
Method Detail

getMessage

public String getMessage()
Return the detail message, including the message from the nested exception if there is one.

Overrides:
getMessage in class Throwable

getRootCause

public Throwable getRootCause()
Retrieve the innermost cause of this exception, if any.

Returns:
the innermost exception, or null if none

getMostSpecificCause

public Throwable getMostSpecificCause()
Retrieve the most specific cause of this exception, that is, either the innermost cause (root cause) or this exception itself.

Differs from getRootCause() in that it falls back to the present exception if there is no root cause.

Returns:
the most specific cause (never null)
Since:
2.0.3

contains

public boolean contains(Class exType)
Check whether this exception contains an exception of the given type: either it is of the given class itself or it contains a nested cause of the given type.

Parameters:
exType - the exception type to look for
Returns:
whether there is a nested exception of the specified type
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NestedIOException

org.springframework.core
Class NestedIOException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.io.IOException
                extended by  org.springframework.core.NestedIOException
All Implemented Interfaces:
Serializable
public class NestedIOException
extends IOException

Subclass of IOException that properly handles a root cause, exposing the root cause just like NestedChecked/RuntimeException does.

Proper root cause handling has not been added to standard IOException before Java 6, which is why we need to do it ourselves for Java 5 compatibility purposes.

The similarity between this class and the NestedChecked/RuntimeException class is unavoidable, as this class needs to derive from IOException.

Since:
2.0
Author:
Juergen Hoeller
See Also:
getMessage(), Throwable.printStackTrace(), NestedCheckedException, NestedRuntimeException, Serialized Form

Constructor Summary
NestedIOException(String msg)
Construct a NestedIOException with the specified detail message.
NestedIOException(String msg, Throwable cause)
Construct a NestedIOException with the specified detail message and nested exception.
Method Summary
 String getMessage()
Return the detail message, including the message from the nested exception if there is one.
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

NestedIOException

public NestedIOException(String msg)
Construct a NestedIOException with the specified detail message.

Parameters:
msg - the detail message

NestedIOException

public NestedIOException(String msg,
                         Throwable cause)
Construct a NestedIOException with the specified detail message and nested exception.

Parameters:
msg - the detail message
cause - the nested exception
Method Detail

getMessage

public String getMessage()
Return the detail message, including the message from the nested exception if there is one.

Overrides:
getMessage in class Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NestedRuntimeException

org.springframework.core
Class NestedRuntimeException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AopConfigException, AopInvocationException, BeansException, BshScriptUtils.BshExecutionException, ConversionException, DataAccessException, EjbAccessException, HandlerMethodInvocationException, HttpMessageConversionException, JmsException, JmxException, JndiLookupFailureException, JobMethodInvocationFailedException, JRubyScriptUtils.JRubyExecutionException, MailException, MultipartException, RemoteAccessException, RestClientException, SchedulingException, ScriptCompilationException, TransactionException, XmlMappingException
public abstract class NestedRuntimeException
extends RuntimeException

Handy class for wrapping runtime Exceptions with a root cause.

This class is abstract to force the programmer to extend the class. getMessage will include nested exception information; printStackTrace and other like methods will delegate to the wrapped exception, if any.

The similarity between this class and the NestedCheckedException class is unavoidable, as Java forces these two classes to have different superclasses (ah, the inflexibility of concrete inheritance!).

Author:
Rod Johnson, Juergen Hoeller
See Also:
getMessage(), Throwable.printStackTrace(), NestedCheckedException, Serialized Form

Constructor Summary
NestedRuntimeException(String msg)
Construct a NestedRuntimeException with the specified detail message.
NestedRuntimeException(String msg, Throwable cause)
Construct a NestedRuntimeException with the specified detail message and nested exception.
Method Summary
boolean | contains(Class exType) Check whether this exception contains an exception of the given type: either it is of the given class itself or it contains a nested cause of the given type.
String | getMessage() Return the detail message, including the message from the nested exception if there is one.
Throwable | getMostSpecificCause() Retrieve the most specific cause of this exception, that is, either the innermost cause (root cause) or this exception itself.
Throwable | getRootCause() Retrieve the innermost cause of this exception, if any.
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

NestedRuntimeException

public NestedRuntimeException(String msg)
Construct a NestedRuntimeException with the specified detail message.

Parameters:
msg - the detail message

NestedRuntimeException

public NestedRuntimeException(String msg,
                              Throwable cause)
Construct a NestedRuntimeException with the specified detail message and nested exception.

Parameters:
msg - the detail message
cause - the nested exception
Method Detail

getMessage

public String getMessage()
Return the detail message, including the message from the nested exception if there is one.

Overrides:
getMessage in class Throwable

getRootCause

public Throwable getRootCause()
Retrieve the innermost cause of this exception, if any.

Returns:
the innermost exception, or null if none
Since:
2.0

getMostSpecificCause

public Throwable getMostSpecificCause()
Retrieve the most specific cause of this exception, that is, either the innermost cause (root cause) or this exception itself.

Differs from getRootCause() in that it falls back to the present exception if there is no root cause.

Returns:
the most specific cause (never null)
Since:
2.0.3

contains

public boolean contains(Class exType)
Check whether this exception contains an exception of the given type: either it is of the given class itself or it contains a nested cause of the given type.

Parameters:
exType - the exception type to look for
Returns:
whether there is a nested exception of the specified type
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.core.annotation

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.core.annotation

Core support package for Java 5 annotations.

See:
Description

Class Summary
AnnotationAwareOrderComparator | Comparator implementation that checks Ordered as well as the Order annotation, with an order value provided by an Ordered instance overriding a statically defined annotation value (if any).
AnnotationUtils | General utility methods for working with annotations, handling bridge methods (which the compiler generates for generic declarations) as well as super methods (for optional "annotation inheritance").

Annotation Types Summary
Order Annotation that defines ordering.

Package org.springframework.core.annotation Description

Core support package for Java 5 annotations.


org.springframework.core.annotation Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.core.annotation

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.core.annotation.AnnotationUtils
    • org.springframework.core.OrderComparator (implements java.util.Comparator<T>)
      • org.springframework.core.annotation.AnnotationAwareOrderComparator

Annotation Type Hierarchy

  • org.springframework.core.annotation.Order (implements java.lang.annotation.Annotation)


AnnotationAwareOrderComparator

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.core.annotation
Class AnnotationAwareOrderComparator

java.lang.Object
    extended by  org.springframework.core.OrderComparator
        extended by  org.springframework.core.annotation.AnnotationAwareOrderComparator
All Implemented Interfaces:
Comparator<Object>
public class AnnotationAwareOrderComparator
extends OrderComparator

Comparator implementation that checks Ordered as well as the Order annotation, with an order value provided by an Ordered instance overriding a statically defined annotation value (if any).

Since:
2.0.1
Author:
Juergen Hoeller
See Also:
Ordered, Order

Field Summary
Fields inherited from class org.springframework.core.OrderComparator
INSTANCE
Constructor Summary
AnnotationAwareOrderComparator()
Method Summary
protected  int getOrder(Object obj)
Determine the order value for the given object.
Methods inherited from class org.springframework.core.OrderComparator
compare, sort, sort
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals

Constructor Detail

AnnotationAwareOrderComparator

public AnnotationAwareOrderComparator()
Method Detail

getOrder

protected int getOrder(Object obj)
Description copied from class: OrderComparator
Determine the order value for the given object.

The default implementation checks against the Ordered interface. Can be overridden in subclasses.

Overrides:
getOrder in class OrderComparator
Parameters:
obj - the object to check
Returns:
the order value, or Ordered.LOWEST_PRECEDENCE as fallback
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AnnotationUtils

org.springframework.core.annotation
Class AnnotationUtils

java.lang.Object
    extended by  org.springframework.core.annotation.AnnotationUtils

public abstract class AnnotationUtils
extends Object

General utility methods for working with annotations, handling bridge methods (which the compiler generates for generic declarations) as well as super methods (for optional "annotation inheritance"). Note that none of this is provided by the JDK's introspection facilities themselves.

As a general rule for runtime-retained annotations (e.g. for transaction control, authorization or service exposure), always use the lookup methods on this class (e.g., findAnnotation(Method, Class), getAnnotation(Method, Class), and getAnnotations(Method)) instead of the plain annotation lookup methods in the JDK. You can still explicitly choose between lookup on the given class level only (getAnnotation(Method, Class)) and lookup in the entire inheritance hierarchy of the given method (findAnnotation(Method, Class)).

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller, Sam Brannen, Mark Fisher
See Also:
AccessibleObject.getAnnotations(), Method.getAnnotation(Class)

Constructor Summary
AnnotationUtils()
Method Summary
static
<A extends Annotation>
A
findAnnotation(Class<?> clazz, Class<A> annotationType)
Find a single Annotation of annotationType from the supplied Class, traversing its interfaces and super classes if no annotation can be found on the given class itself.
static
<A extends Annotation>
A
findAnnotation(Method method, Class<A> annotationType)
Get a single Annotation of annotationType from the supplied Method, traversing its super methods if no annotation can be found on the given method itself.
static Class<?> findAnnotationDeclaringClass(Class<? extends Annotation> annotationType, Class<?> clazz)
Find the first Class in the inheritance hierarchy of the specified clazz (including the specified clazz itself) which declares an annotation for the specified annotationType, or null if not found.
static
<A extends Annotation>
A
getAnnotation(Method method, Class<A> annotationType)
Get a single Annotation of annotationType from the supplied Method.
static Map<String,Object> getAnnotationAttributes(Annotation annotation)
Retrieve the given annotation's attributes as a Map, preserving all attribute types as-is.
static Map<String,Object> getAnnotationAttributes(Annotation annotation, boolean classValuesAsString)
Retrieve the given annotation's attributes as a Map.
static Annotation[] getAnnotations(Method method)
Get all Annotations from the supplied Method.
static Object getDefaultValue(Annotation annotation)
Retrieve the default value of the "value" attribute of a single-element Annotation, given an annotation instance.
static Object getDefaultValue(Annotation annotation, String attributeName)
Retrieve the default value of a named Annotation attribute, given an annotation instance.
static Object getDefaultValue(Class<? extends Annotation> annotationType)
Retrieve the default value of the "value" attribute of a single-element Annotation, given the annotation type.
static Object getDefaultValue(Class<? extends Annotation> annotationType, String attributeName)
Retrieve the default value of a named Annotation attribute, given the annotation type.
static Object getValue(Annotation annotation)
Retrieve the value of the "value" attribute of a single-element Annotation, given an annotation instance.
static Object getValue(Annotation annotation, String attributeName)
Retrieve the value of a named Annotation attribute, given an annotation instance.
static boolean isAnnotationDeclaredLocally(Class<? extends Annotation> annotationType, Class<?> clazz)
Determine whether an annotation for the specified annotationType is declared locally on the supplied clazz.
static boolean isAnnotationInherited(Class<? extends Annotation> annotationType, Class<?> clazz)
Determine whether an annotation for the specified annotationType is present on the supplied clazz and is inherited i.e., not declared locally for the class).
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AnnotationUtils

public AnnotationUtils()
Method Detail

getAnnotations

public static Annotation[] getAnnotations(Method method)
Get all Annotations from the supplied Method.

Correctly handles bridge Methods generated by the compiler.

Parameters:
method - the method to look for annotations on
Returns:
the annotations found
See Also:
BridgeMethodResolver.findBridgedMethod(Method)

getAnnotation

public static <A extends Annotation> A getAnnotation(Method method,
                                                     Class<A> annotationType)
Get a single Annotation of annotationType from the supplied Method.

Correctly handles bridge Methods generated by the compiler.

Parameters:
method - the method to look for annotations on
annotationType - the annotation class to look for
Returns:
the annotations found
See Also:
BridgeMethodResolver.findBridgedMethod(Method)

findAnnotation

public static <A extends Annotation> A findAnnotation(Method method,
                                                      Class<A> annotationType)
Get a single Annotation of annotationType from the supplied Method, traversing its super methods if no annotation can be found on the given method itself.

Annotations on methods are not inherited by default, so we need to handle this explicitly.

Parameters:
method - the method to look for annotations on
annotationType - the annotation class to look for
Returns:
the annotation found, or null if none found

findAnnotation

public static <A extends Annotation> A findAnnotation(Class<?> clazz,
                                                      Class<A> annotationType)
Find a single Annotation of annotationType from the supplied Class, traversing its interfaces and super classes if no annotation can be found on the given class itself.

This method explicitly handles class-level annotations which are not declared as inherited as well as annotations on interfaces.

The algorithm operates as follows: Searches for an annotation on the given class and returns it if found. Else searches all interfaces that the given class declares, returning the annotation from the first matching candidate, if any. Else proceeds with introspection of the superclass of the given class, checking the superclass itself; if no annotation found there, proceeds with the interfaces that the superclass declares. Recursing up through the entire superclass hierarchy if no match is found.

Parameters:
clazz - the class to look for annotations on
annotationType - the annotation class to look for
Returns:
the annotation found, or null if none found

findAnnotationDeclaringClass

public static Class<?> findAnnotationDeclaringClass(Class<? extends Annotation> annotationType,
                                                    Class<?> clazz)
Find the first Class in the inheritance hierarchy of the specified clazz (including the specified clazz itself) which declares an annotation for the specified annotationType, or null if not found. If the supplied clazz is null, null will be returned.

If the supplied clazz is an interface, only the interface itself will be checked; the inheritance hierarchy for interfaces will not be traversed.

The standard Class API does not provide a mechanism for determining which class in an inheritance hierarchy actually declares an Annotation, so we need to handle this explicitly.

Parameters:
annotationType - the Class object corresponding to the annotation type
clazz - the Class object corresponding to the class on which to check for the annotation, or null.
Returns:
the first Class in the inheritance hierarchy of the specified clazz which declares an annotation for the specified annotationType, or null if not found.
See Also:
Class.isAnnotationPresent(Class), Class.getDeclaredAnnotations()

isAnnotationDeclaredLocally

public static boolean isAnnotationDeclaredLocally(Class<? extends Annotation> annotationType,
                                                  Class<?> clazz)
Determine whether an annotation for the specified annotationType is declared locally on the supplied clazz. The supplied Class may represent any type.

Note: This method does not determine if the annotation is inherited. For greater clarity regarding inherited annotations, consider using isAnnotationInherited(Class, Class) instead.

Parameters:
annotationType - the Class object corresponding to the annotation type
clazz - the Class object corresponding to the class on which to check for the annotation
Returns:
true if an annotation for the specified annotationType is declared locally on the supplied clazz
See Also:
Class.getDeclaredAnnotations(), isAnnotationInherited(Class, Class)

isAnnotationInherited

public static boolean isAnnotationInherited(Class<? extends Annotation> annotationType,
                                            Class<?> clazz)
Determine whether an annotation for the specified annotationType is present on the supplied clazz and is inherited i.e., not declared locally for the class).

If the supplied clazz is an interface, only the interface itself will be checked. In accordance with standard meta-annotation semantics, the inheritance hierarchy for interfaces will not be traversed. See the JavaDoc for the @Inherited meta-annotation for further details regarding annotation inheritance.

Parameters:
annotationType - the Class object corresponding to the annotation type
clazz - the Class object corresponding to the class on which to check for the annotation
Returns:
true if an annotation for the specified annotationType is present on the supplied clazz and is inherited
See Also:
Class.isAnnotationPresent(Class), isAnnotationDeclaredLocally(Class, Class)

getAnnotationAttributes

public static Map<String,Object> getAnnotationAttributes(Annotation annotation)
Retrieve the given annotation's attributes as a Map, preserving all attribute types as-is.

Parameters:
annotation - the annotation to retrieve the attributes for
Returns:
the Map of annotation attributes, with attribute names as keys and corresponding attribute values as values

getAnnotationAttributes

public static Map<String,Object> getAnnotationAttributes(Annotation annotation,
                                                         boolean classValuesAsString)
Retrieve the given annotation's attributes as a Map.

Parameters:
annotation - the annotation to retrieve the attributes for
classValuesAsString - whether to turn Class references into Strings (for compatibility with AnnotationMetadata or to preserve them as Class references
Returns:
the Map of annotation attributes, with attribute names as keys and corresponding attribute values as values

getValue

public static Object getValue(Annotation annotation)
Retrieve the value of the "value" attribute of a single-element Annotation, given an annotation instance.

Parameters:
annotation - the annotation instance from which to retrieve the value
Returns:
the attribute value, or null if not found
See Also:
getValue(Annotation, String)

getValue

public static Object getValue(Annotation annotation,
                              String attributeName)
Retrieve the value of a named Annotation attribute, given an annotation instance.

Parameters:
annotation - the annotation instance from which to retrieve the value
attributeName - the name of the attribute value to retrieve
Returns:
the attribute value, or null if not found
See Also:
getValue(Annotation)

getDefaultValue

public static Object getDefaultValue(Annotation annotation)
Retrieve the default value of the "value" attribute of a single-element Annotation, given an annotation instance.

Parameters:
annotation - the annotation instance from which to retrieve the default value
Returns:
the default value, or null if not found
See Also:
getDefaultValue(Annotation, String)

getDefaultValue

public static Object getDefaultValue(Annotation annotation,
                                     String attributeName)
Retrieve the default value of a named Annotation attribute, given an annotation instance.

Parameters:
annotation - the annotation instance from which to retrieve the default value
attributeName - the name of the attribute value to retrieve
Returns:
the default value of the named attribute, or null if not found.
See Also:
getDefaultValue(Class, String)

getDefaultValue

public static Object getDefaultValue(Class<? extends Annotation> annotationType)
Retrieve the default value of the "value" attribute of a single-element Annotation, given the annotation type.

Parameters:
annotationType - the annotation type for which the default value should be retrieved
Returns:
the default value, or null if not found
See Also:
getDefaultValue(Class, String)

getDefaultValue

public static Object getDefaultValue(Class<? extends Annotation> annotationType,
                                     String attributeName)
Retrieve the default value of a named Annotation attribute, given the annotation type.

Parameters:
annotationType - the annotation type for which the default value should be retrieved
attributeName - the name of the attribute value to retrieve.
Returns:
the default value of the named attribute, or null if not found
See Also:
getDefaultValue(Annotation, String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Order

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

org.springframework.core.annotation
Annotation Type Order

@Retention(value=RUNTIME)
@Target(value={TYPE,METHOD,FIELD})
public @interface Order

Annotation that defines ordering. The value is optional, and represents order value as defined in the Ordered interface. Lower values have higher priority. The default value is Ordered.LOWEST_PRECEDENCE, indicating lowest priority (losing to any other specified order value).

NOTE: Annotation-based ordering is supported for specific kinds of components only, e.g. for annotation-based AspectJ aspects. Spring container strategies, on the other hand, are typically based on the Ordered interface in order to allow for configurable ordering of each instance.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller
See Also:
Ordered, AnnotationAwareOrderComparator

Optional Element Summary
 int value
The order value.

value

public abstract int value
The order value. Default is Ordered.LOWEST_PRECEDENCE.

See Also:
Ordered.getOrder()
Default:
2147483647
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT


org.springframework.core.convert

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.core.convert

Type conversion system API.

See:
Description

Interface Summary
ConversionService A service interface for type conversion.

Class Summary
TypeDescriptor Context about a type to convert to.

Exception Summary
ConversionException | Base class for exceptions thrown by the convert system.
ConversionFailedException | Exception to be thrown when an actual type conversion attempt fails.
ConverterNotFoundException | Thrown when a suitable converter could not be found in a conversion service.

Package org.springframework.core.convert Description

Type conversion system API.


org.springframework.core.convert Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.core.convert

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.core.convert.ConversionException
              • org.springframework.core.convert.ConversionFailedException
              • org.springframework.core.convert.ConverterNotFoundException
    • org.springframework.core.convert.TypeDescriptor

Interface Hierarchy

  • org.springframework.core.convert.ConversionService


ConversionService

org.springframework.core.convert
Interface ConversionService

All Known Implementing Classes:
FormattingConversionService, GenericConversionService
public interface ConversionService

A service interface for type conversion. This is the entry point into the convert system. Call convert(Object, Class) to perform a thread-safe type conversion using this system.

Since:
3.0
Author:
Keith Donald

Method Summary
 boolean canConvert(Class<?> sourceType, Class<?> targetType)
Returns true if objects of sourceType can be converted to targetType.
 boolean canConvert(TypeDescriptor sourceType, TypeDescriptor targetType)
Returns true if objects of sourceType can be converted to the targetType.
<T> T
convert(Object source, Class<T> targetType)
Convert the source to targetType.
 Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType)
Convert the source to targetType.

Method Detail

canConvert

boolean canConvert(Class<?> sourceType,
                   Class<?> targetType)
Returns true if objects of sourceType can be converted to targetType.

Parameters:
sourceType - the source type to convert from (required)
targetType - the target type to convert to (required)
Returns:
true if a conversion can be performed, false if not

convert

<T> T convert(Object source,
              Class<T> targetType)
Convert the source to targetType.

Parameters:
source - the source object to convert (may be null)
targetType - the target type to convert to (required)
Returns:
the converted object, an instance of targetType
Throws:
ConversionException - if an exception occurred

canConvert

boolean canConvert(TypeDescriptor sourceType,
                   TypeDescriptor targetType)
Returns true if objects of sourceType can be converted to the targetType. The TypeDescriptors provide additional context about the field locations where conversion would occur, often object property locations. This flavor of the canConvert operation exists mainly for use by a general purpose data mapping framework, and not for use by user code.

Parameters:
sourceType - context about the source type to convert from (required)
targetType - context about the target type to convert to (required)
Returns:
true if a conversion can be performed between the source and target types, false if not

convert

Object convert(Object source,
               TypeDescriptor sourceType,
               TypeDescriptor targetType)
Convert the source to targetType. The TypeDescriptors provide additional context about the field locations where conversion will occur, often object property locations. This flavor of the convert operation exists mainly for use by a general purpose data mapping framework, and not for use by user code.

Parameters:
source - the source object to convert (may be null)
sourceType - context about the source type converting from (required)
targetType - context about the target type to convert to (required)
Returns:
the converted object, an instance of targetType
Throws:
ConversionException - if an exception occurred
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TypeDescriptor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.core.convert
Class TypeDescriptor

java.lang.Object
    extended by  org.springframework.core.convert.TypeDescriptor
Direct Known Subclasses:
PropertyTypeDescriptor
public class TypeDescriptor
extends Object

Context about a type to convert to.

Since:
3.0
Author:
Keith Donald, Andy Clement, Juergen Hoeller

Field Summary
static TypeDescriptor NULL
Constant defining an 'unknown' TypeDescriptor
Constructor Summary
TypeDescriptor(Field field)
Create a new type descriptor for a field.
TypeDescriptor(Field field, Class<?> type)
Create a new type descriptor for a field.
TypeDescriptor(MethodParameter methodParameter)
Create a new type descriptor from a method or constructor parameter.
TypeDescriptor(MethodParameter methodParameter, Class<?> type)
Create a new type descriptor from a method or constructor parameter.
Method Summary
String | asString() A textual representation of the type descriptor (eg.
TypeDescriptor | forElementType(Class<?> elementType) Create a copy of this type descriptor, preserving the context information but exposing the specified element type (e.g.
static TypeDescriptor | forObject(Object object) Create a new type descriptor for the class of the given object.
Annotation | getAnnotation(Class<? extends Annotation> annotationType) Obtain the annotation associated with the wrapped parameter/field, if any.
Annotation[] | getAnnotations() Obtain the annotations associated with the wrapped parameter/field, if any.
Class<?> | getElementType() If this type is an array type or Collection type, returns the underlying element type.
TypeDescriptor | getElementTypeDescriptor() Return the element type as a type descriptor.
Field | getField() Return the wrapped Field, if any.
Class<?> | getMapKeyType() Determine the generic key type of the wrapped Map parameter/field, if any.
TypeDescriptor | getMapKeyTypeDescriptor() Returns map key type as a type descriptor.
Class<?> | getMapValueType() Determine the generic value type of the wrapped Map parameter/field, if any.
TypeDescriptor | getMapValueTypeDescriptor() Returns map value type as a type descriptor.
MethodParameter | getMethodParameter() Return the wrapped MethodParameter, if any.
String | getName() Returns the name of this type: the fully qualified class name.
Class<?> | getObjectType() Determine the declared type of the wrapped parameter/field.
Class<?> | getType() Determine the declared (non-generic) type of the wrapped parameter/field.
boolean | isArray() Is this type an array type?
boolean | isAssignableTo(TypeDescriptor targetType) Returns true if an object this type can be assigned to a reference of given targetType.
boolean | isCollection() Is this type a Collection type?
boolean | isMap() Is this type a Map type?
boolean | isMapEntryTypeKnown() Is this descriptor for a map where the key type and value type are known?
boolean | isPrimitive() Is this type a primitive type?
String | toString()
static TypeDescriptor | valueOf(Class<?> type) Create a new type descriptor for the given class.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

NULL

public static final TypeDescriptor NULL
Constant defining an 'unknown' TypeDescriptor

Constructor Detail

TypeDescriptor

public TypeDescriptor(MethodParameter methodParameter)
Create a new type descriptor from a method or constructor parameter.

Use this constructor when a target conversion point originates from a method parameter, such as a setter method argument.

Parameters:
methodParameter - the MethodParameter to wrap

TypeDescriptor

public TypeDescriptor(Field field)
Create a new type descriptor for a field. Use this constructor when a target conversion point originates from a field.

Parameters:
field - the field to wrap

TypeDescriptor

public TypeDescriptor(MethodParameter methodParameter,
                      Class<?> type)
Create a new type descriptor from a method or constructor parameter.

Use this constructor when a target conversion point originates from a method parameter, such as a setter method argument.

Parameters:
methodParameter - the MethodParameter to wrap
type - the specific type to expose (may be an array/collection element)

TypeDescriptor

public TypeDescriptor(Field field,
                      Class<?> type)
Create a new type descriptor for a field. Use this constructor when a target conversion point originates from a field.

Parameters:
field - the field to wrap
Method Detail

getMethodParameter

public MethodParameter getMethodParameter()
Return the wrapped MethodParameter, if any.

Note: Either MethodParameter or Field is available.

Returns:
the MethodParameter, or null if none

getField

public Field getField()
Return the wrapped Field, if any.

Note: Either MethodParameter or Field is available.

Returns:
the Field, or null if none

getType

public Class<?> getType()
Determine the declared (non-generic) type of the wrapped parameter/field.

Returns:
the declared type, or null if this is NULL.

getObjectType

public Class<?> getObjectType()
Determine the declared type of the wrapped parameter/field. Returns the Object wrapper type if the underlying type is a primitive.

getName

public String getName()
Returns the name of this type: the fully qualified class name.

isPrimitive

public boolean isPrimitive()
Is this type a primitive type?

isArray

public boolean isArray()
Is this type an array type?

isCollection

public boolean isCollection()
Is this type a Collection type?

getElementType

public Class<?> getElementType()
If this type is an array type or Collection type, returns the underlying element type. Returns null if the type is neither an array or collection.

getElementTypeDescriptor

public TypeDescriptor getElementTypeDescriptor()
Return the element type as a type descriptor.

forElementType

public TypeDescriptor forElementType(Class<?> elementType)
Create a copy of this type descriptor, preserving the context information but exposing the specified element type (e.g. an array/collection element).

Parameters:
elementType - the desired type to expose
Returns:
the type descriptor

isMap

public boolean isMap()
Is this type a Map type?

isMapEntryTypeKnown

public boolean isMapEntryTypeKnown()
Is this descriptor for a map where the key type and value type are known?

getMapKeyType

public Class<?> getMapKeyType()
Determine the generic key type of the wrapped Map parameter/field, if any.

Returns:
the generic type, or null if none

getMapValueType

public Class<?> getMapValueType()
Determine the generic value type of the wrapped Map parameter/field, if any.

Returns:
the generic type, or null if none

getMapKeyTypeDescriptor

public TypeDescriptor getMapKeyTypeDescriptor()
Returns map key type as a type descriptor.

getMapValueTypeDescriptor

public TypeDescriptor getMapValueTypeDescriptor()
Returns map value type as a type descriptor.

getAnnotations

public Annotation[] getAnnotations()
Obtain the annotations associated with the wrapped parameter/field, if any.

getAnnotation

public Annotation getAnnotation(Class<? extends Annotation> annotationType)
Obtain the annotation associated with the wrapped parameter/field, if any.

isAssignableTo

public boolean isAssignableTo(TypeDescriptor targetType)
Returns true if an object this type can be assigned to a reference of given targetType.

Parameters:
targetType - the target type
Returns:
true if this type is assignable to the target

asString

public String asString()
A textual representation of the type descriptor (eg. Map) for use in messages

toString

public String toString()
Overrides:
toString in class Object

valueOf

public static TypeDescriptor valueOf(Class<?> type)
Create a new type descriptor for the given class.

Parameters:
type - the class
Returns:
the type descriptor

forObject

public static TypeDescriptor forObject(Object object)
Create a new type descriptor for the class of the given object.

Parameters:
object - the object
Returns:
the type descriptor
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ConversionException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.core.convert
Class ConversionException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.core.convert.ConversionException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ConversionFailedException, ConverterNotFoundException
public abstract class ConversionException
extends NestedRuntimeException

Base class for exceptions thrown by the convert system.

Since:
3.0
Author:
Keith Donald
See Also:
Serialized Form

Constructor Summary
ConversionException(String message)
Construct a new conversion exception.
ConversionException(String message, Throwable cause)
Construct a new conversion exception.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ConversionException

public ConversionException(String message,
                           Throwable cause)
Construct a new conversion exception.

Parameters:
message - the exception message
cause - the cause

ConversionException

public ConversionException(String message)
Construct a new conversion exception.

Parameters:
message - the exception message
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ConversionFailedException

org.springframework.core.convert
Class ConversionFailedException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.core.convert.ConversionException
                        extended by  org.springframework.core.convert.ConversionFailedException
All Implemented Interfaces:
Serializable
public final class ConversionFailedException
extends ConversionException

Exception to be thrown when an actual type conversion attempt fails.

Since:
3.0
Author:
Keith Donald, Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
ConversionFailedException(TypeDescriptor sourceType, TypeDescriptor targetType, Object value, Throwable cause)
Create a new conversion exception.
Method Summary
TypeDescriptor | getSourceType() Return the source type we tried to convert the value from.
TypeDescriptor | getTargetType() Return the target type we tried to convert the value to.
Object | getValue() Return the offending value.
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ConversionFailedException

public ConversionFailedException(TypeDescriptor sourceType,
                                 TypeDescriptor targetType,
                                 Object value,
                                 Throwable cause)
Create a new conversion exception.

Parameters:
sourceType - the value's original type
targetType - the value's target type
value - the value we tried to convert
cause - the cause of the conversion failure
Method Detail

getSourceType

public TypeDescriptor getSourceType()
Return the source type we tried to convert the value from.

getTargetType

public TypeDescriptor getTargetType()
Return the target type we tried to convert the value to.

getValue

public Object getValue()
Return the offending value.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConverterNotFoundException

org.springframework.core.convert
Class ConverterNotFoundException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.core.convert.ConversionException
                        extended by  org.springframework.core.convert.ConverterNotFoundException
All Implemented Interfaces:
Serializable
public final class ConverterNotFoundException
extends ConversionException

Thrown when a suitable converter could not be found in a conversion service.

Since:
3.0
Author:
Keith Donald
See Also:
Serialized Form

Constructor Summary
ConverterNotFoundException(TypeDescriptor sourceType, TypeDescriptor targetType)
Creates a new conversion executor not found exception.
Method Summary
TypeDescriptor | getSourceType() Returns the source type that was requested to convert from.
TypeDescriptor | getTargetType() Returns the target type that was requested to convert to.
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ConverterNotFoundException

public ConverterNotFoundException(TypeDescriptor sourceType,
                                  TypeDescriptor targetType)
Creates a new conversion executor not found exception.

Parameters:
sourceType - the source type requested to convert from
targetType - the target type requested to convert to
message - a descriptive message
Method Detail

getSourceType

public TypeDescriptor getSourceType()
Returns the source type that was requested to convert from.

getTargetType

public TypeDescriptor getTargetType()
Returns the target type that was requested to convert to.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.core.convert.converter

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.core.convert.converter

SPI to implement Converters.

See:
Description

Interface Summary
ConditionalGenericConverter | A generic converter that conditionally executes.
Converter<S,T> | A converter converts a source object of type S to a target of type T.
ConverterFactory<S,R> | A factory for "ranged" converters that can convert objects from S to subtypes of R.
ConverterRegistry | For registering converters with a type conversion system.
GenericConverter | Generic converter interface for converting between two or more types.

Class Summary
GenericConverter.ConvertiblePair Holder for a source-to-target class pair.

Package org.springframework.core.convert.converter Description

SPI to implement Converters.


org.springframework.core.convert.converter Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.core.convert.converter

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.core.convert.converter.GenericConverter.ConvertiblePair

Interface Hierarchy

  • org.springframework.core.convert.converter.Converter<S,T>
  • org.springframework.core.convert.converter.ConverterFactory<S,R>
  • org.springframework.core.convert.converter.ConverterRegistry
  • org.springframework.core.convert.converter.GenericConverter
    • org.springframework.core.convert.converter.ConditionalGenericConverter


ConditionalGenericConverter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.core.convert.converter
Interface ConditionalGenericConverter

All Superinterfaces:
GenericConverter
public interface ConditionalGenericConverter
extends GenericConverter

A generic converter that conditionally executes.

Applies a rule that determines if a converter between a set of convertible types matches given a client request to convert between a source field of convertible type S and a target field of convertible type T.

Often used to selectively match custom conversion logic based on the presence of a field or class-level characteristic, such as an annotation or method. For example, when converting from a String field to a Date field, an implementation might return true if the target field has also been annotated with @DateTimeFormat.

As another example, when converting from a String field to an Account field, an implementation might return true if the target Account class defines a public static findAccount(String) method.

Since:
3.0
Author:
Keith Donald

Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.core.convert.converter.GenericConverter
GenericConverter.ConvertiblePair
Method Summary
 boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType)
Should the converter from sourceType to targetType currently under consideration be selected?
Methods inherited from interface org.springframework.core.convert.converter.GenericConverter
convert, getConvertibleTypes

Method Detail

matches

boolean matches(TypeDescriptor sourceType,
                TypeDescriptor targetType)
Should the converter from sourceType to targetType currently under consideration be selected?

Parameters:
sourceType - the type descriptor of the field we are converting from
targetType - the type descriptor of the field we are converting to
Returns:
true if conversion should be performed, false otherwise
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


Converter

org.springframework.core.convert.converter
Interface Converter<S,T>

public interface Converter<S,T>

A converter converts a source object of type S to a target of type T. Implementations of this interface are thread-safe and can be shared.

Since:
3.0
Author:
Keith Donald

Method Summary
 T convert(S source)
Convert the source of type S to target type T.

Method Detail

convert

T convert(S source)
Convert the source of type S to target type T.

Parameters:
source - the source object to convert, which must be an instance of S
Returns:
the converted object, which must be an instance of T
Throws:
IllegalArgumentException - if the source could not be converted to the desired target type
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConverterFactory

org.springframework.core.convert.converter
Interface ConverterFactory<S,R>

Type Parameters:
S - The source type converters created by this factory can convert from
R - The target range (or base) type converters created by this factory can convert to; for example Number for a set of number subtypes.
public interface ConverterFactory<S,R>

A factory for "ranged" converters that can convert objects from S to subtypes of R.

Since:
3.0
Author:
Keith Donald

Method Summary
<T extends R>
Converter<S,T>
getConverter(Class<T> targetType)
Get the converter to convert from S to target type T, where T is also an instance of R.

Method Detail

getConverter

<T extends R> Converter<S,T> getConverter(Class<T> targetType)
Get the converter to convert from S to target type T, where T is also an instance of R.

Type Parameters:
T - the target type
Parameters:
targetType - the target type to convert to
Returns:
A converter from S to T
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConverterRegistry

org.springframework.core.convert.converter
Interface ConverterRegistry

All Known Subinterfaces:
FormatterRegistry
All Known Implementing Classes:
FormattingConversionService, GenericConversionService
public interface ConverterRegistry

For registering converters with a type conversion system.

Since:
3.0
Author:
Keith Donald, Juergen Hoeller

Method Summary
void | addConverter(Converter<?,?> converter) Add a plain converter to this registry.
void | addConverter(GenericConverter converter) Add a generic converter to this registry.
void | addConverterFactory(ConverterFactory<?,?> converterFactory) Add a ranged converter factory to this registry.
void | removeConvertible(Class<?> sourceType, Class<?> targetType) Remove any converters from sourceType to targetType.

Method Detail

addConverter

void addConverter(Converter<?,?> converter)
Add a plain converter to this registry.

addConverter

void addConverter(GenericConverter converter)
Add a generic converter to this registry.

addConverterFactory

void addConverterFactory(ConverterFactory<?,?> converterFactory)
Add a ranged converter factory to this registry.

removeConvertible

void removeConvertible(Class<?> sourceType,
                       Class<?> targetType)
Remove any converters from sourceType to targetType.

Parameters:
sourceType - the source type
targetType - the target type
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


GenericConverter

org.springframework.core.convert.converter
Interface GenericConverter

All Known Subinterfaces:
ConditionalGenericConverter
public interface GenericConverter

Generic converter interface for converting between two or more types.

This is the most flexible of the Converter SPI interfaces, but also the most complex. It is flexible in that a GenericConverter may support converting between multiple source/target type pairs (see getConvertibleTypes(). In addition, GenericConverter implementations have access to source/target field context during the type conversion process. This allows for resolving source and target field metadata such as annotations and generics information, which can be used influence the conversion logic.

This interface should generally not be used when the simpler Converter or ConverterFactory interfaces are sufficient.

Since:
3.0
Author:
Keith Donald, Juergen Hoeller
See Also:
TypeDescriptor, Converter, ConverterFactory

Nested Class Summary
static class GenericConverter.ConvertiblePair
Holder for a source-to-target class pair.
Method Summary
Object | convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) Convert the source to the targetType described by the TypeDescriptor.
Set<GenericConverter.ConvertiblePair> | getConvertibleTypes() Return the source and target types which this converter can convert between.

Method Detail

getConvertibleTypes

Set<GenericConverter.ConvertiblePair> getConvertibleTypes()
Return the source and target types which this converter can convert between.

Each entry is a convertible source-to-target type pair.

convert

Object convert(Object source,
               TypeDescriptor sourceType,
               TypeDescriptor targetType)
Convert the source to the targetType described by the TypeDescriptor.

Parameters:
source - the source object to convert (may be null)
sourceType - the type descriptor of the field we are converting from
targetType - the type descriptor of the field we are converting to
Returns:
the converted object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


GenericConverter.ConvertiblePair

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.core.convert.converter
Class GenericConverter.ConvertiblePair

java.lang.Object
    extended by  org.springframework.core.convert.converter.GenericConverter.ConvertiblePair
Enclosing interface:
GenericConverter
public static final class GenericConverter.ConvertiblePair
extends Object

Holder for a source-to-target class pair.

Constructor Summary
GenericConverter.ConvertiblePair(Class<?> sourceType, Class<?> targetType)
Create a new source-to-target pair.
Method Summary
Class<?> | getSourceType()
Class<?> | getTargetType()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

GenericConverter.ConvertiblePair

public GenericConverter.ConvertiblePair(Class<?> sourceType,
                                        Class<?> targetType)
Create a new source-to-target pair.

Parameters:
sourceType - the source type
targetType - the target type
Method Detail

getSourceType

public Class<?> getSourceType()

getTargetType

public Class<?> getTargetType()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.core.convert.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.core.convert.support

TypeConverter system implementation.

See:
Description

Class Summary
ConversionServiceFactory | A factory for common ConversionService configurations.
ConvertingPropertyEditorAdapter | Adapter that exposes a PropertyEditor for any given ConversionService and specific target type.
GenericConversionService | Base ConversionService implementation suitable for use in most environments.
PropertyTypeDescriptor | TypeDescriptor extension that exposes additional annotations as conversion metadata: namely, annotations on other accessor methods (getter/setter) and on the underlying field, if found.

Package org.springframework.core.convert.support Description

TypeConverter system implementation.


org.springframework.core.convert.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.core.convert.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.core.convert.support.ConversionServiceFactory
    • org.springframework.core.convert.support.GenericConversionService (implements org.springframework.core.convert.ConversionService, org.springframework.core.convert.converter.ConverterRegistry)
    • java.beans.PropertyEditorSupport (implements java.beans.PropertyEditor)
      • org.springframework.core.convert.support.ConvertingPropertyEditorAdapter
    • org.springframework.core.convert.TypeDescriptor
      • org.springframework.core.convert.support.PropertyTypeDescriptor


ConversionServiceFactory

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.core.convert.support
Class ConversionServiceFactory

java.lang.Object
    extended by  org.springframework.core.convert.support.ConversionServiceFactory

public abstract class ConversionServiceFactory
extends Object

A factory for common ConversionService configurations.

Since:
3.0
Author:
Keith Donald, Juergen Hoeller

Constructor Summary
ConversionServiceFactory()
Method Summary
static void | addDefaultConverters(GenericConversionService conversionService) Populate the given ConversionService instance with all applicable default converters.
static GenericConversionService | createDefaultConversionService() Create a new default ConversionService instance that can be safely modified.
static void | registerConverters(Set<?> converters, ConverterRegistry registry) Register the given converter objects with the given target registry.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ConversionServiceFactory

public ConversionServiceFactory()
Method Detail

createDefaultConversionService

public static GenericConversionService createDefaultConversionService()
Create a new default ConversionService instance that can be safely modified.

addDefaultConverters

public static void addDefaultConverters(GenericConversionService conversionService)
Populate the given ConversionService instance with all applicable default converters.

registerConverters

public static void registerConverters(Set<?> converters,
                                      ConverterRegistry registry)
Register the given converter objects with the given target registry.

Parameters:
converters - the converter objects: implementing Converter, ConverterFactory, or GenericConverter
registry - the target registry to register with
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ConvertingPropertyEditorAdapter

org.springframework.core.convert.support
Class ConvertingPropertyEditorAdapter

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.core.convert.support.ConvertingPropertyEditorAdapter
All Implemented Interfaces:
PropertyEditor
public class ConvertingPropertyEditorAdapter
extends PropertyEditorSupport

Adapter that exposes a PropertyEditor for any given ConversionService and specific target type.

Since:
3.0
Author:
Juergen Hoeller

Constructor Summary
ConvertingPropertyEditorAdapter(ConversionService conversionService, TypeDescriptor targetDescriptor)
Create a new ConvertingPropertyEditorAdapter for a given ConversionService and the given target type.
Method Summary
String | getAsText()
void | setAsText(String text)
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ConvertingPropertyEditorAdapter

public ConvertingPropertyEditorAdapter(ConversionService conversionService,
                                       TypeDescriptor targetDescriptor)
Create a new ConvertingPropertyEditorAdapter for a given ConversionService and the given target type.

Parameters:
conversionService - the ConversionService to delegate to
targetDescriptor - the target type to convert to
Method Detail

setAsText

public void setAsText(String text)
               throws IllegalArgumentException
Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport
Throws:
IllegalArgumentException

getAsText

public String getAsText()
Specified by:
getAsText in interface PropertyEditor
Overrides:
getAsText in class PropertyEditorSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


GenericConversionService

org.springframework.core.convert.support
Class GenericConversionService

java.lang.Object
    extended by  org.springframework.core.convert.support.GenericConversionService
All Implemented Interfaces:
ConversionService, ConverterRegistry
Direct Known Subclasses:
FormattingConversionService
public class GenericConversionService
extends Object
implements ConversionService, ConverterRegistry

Base ConversionService implementation suitable for use in most environments. Implements ConverterRegistry as registration API.

Since:
3.0
Author:
Keith Donald, Juergen Hoeller

Constructor Summary
GenericConversionService()
Method Summary
 void addConverter(Converter<?,?> converter)
Add a plain converter to this registry.
 void addConverter(GenericConverter converter)
Add a generic converter to this registry.
 void addConverterFactory(ConverterFactory<?,?> converterFactory)
Add a ranged converter factory to this registry.
 boolean canConvert(Class<?> sourceType, Class<?> targetType)
Returns true if objects of sourceType can be converted to targetType.
 boolean canConvert(TypeDescriptor sourceType, TypeDescriptor targetType)
Returns true if objects of sourceType can be converted to the targetType.
<T> T
convert(Object source, Class<T> targetType)
Convert the source to targetType.
 Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType)
Convert the source to targetType.
protected  Object convertNullSource(TypeDescriptor sourceType, TypeDescriptor targetType)
Hook method to convert a null source.
protected  GenericConverter getConverter(TypeDescriptor sourceType, TypeDescriptor targetType)
Hook method to lookup the converter for a given sourceType/targetType pair.
protected  GenericConverter getDefaultConverter(TypeDescriptor sourceType, TypeDescriptor targetType)
Return the default converter if no converter is found for the given sourceType/targetType pair.
 void removeConvertible(Class<?> sourceType, Class<?> targetType)
Remove any converters from sourceType to targetType.
 String toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

GenericConversionService

public GenericConversionService()
Method Detail

addConverter

public void addConverter(GenericConverter converter)
Description copied from interface: ConverterRegistry
Add a generic converter to this registry.

Specified by:
addConverter in interface ConverterRegistry

addConverter

public void addConverter(Converter<?,?> converter)
Description copied from interface: ConverterRegistry
Add a plain converter to this registry.

Specified by:
addConverter in interface ConverterRegistry

addConverterFactory

public void addConverterFactory(ConverterFactory<?,?> converterFactory)
Description copied from interface: ConverterRegistry
Add a ranged converter factory to this registry.

Specified by:
addConverterFactory in interface ConverterRegistry

removeConvertible

public void removeConvertible(Class<?> sourceType,
                              Class<?> targetType)
Description copied from interface: ConverterRegistry
Remove any converters from sourceType to targetType.

Specified by:
removeConvertible in interface ConverterRegistry
Parameters:
sourceType - the source type
targetType - the target type

canConvert

public boolean canConvert(Class<?> sourceType,
                          Class<?> targetType)
Description copied from interface: ConversionService
Returns true if objects of sourceType can be converted to targetType.

Specified by:
canConvert in interface ConversionService
Parameters:
sourceType - the source type to convert from (required)
targetType - the target type to convert to (required)
Returns:
true if a conversion can be performed, false if not

convert

public <T> T convert(Object source,
                     Class<T> targetType)
Description copied from interface: ConversionService
Convert the source to targetType.

Specified by:
convert in interface ConversionService
Parameters:
source - the source object to convert (may be null)
targetType - the target type to convert to (required)
Returns:
the converted object, an instance of targetType

canConvert

public boolean canConvert(TypeDescriptor sourceType,
                          TypeDescriptor targetType)
Description copied from interface: ConversionService
Returns true if objects of sourceType can be converted to the targetType. The TypeDescriptors provide additional context about the field locations where conversion would occur, often object property locations. This flavor of the canConvert operation exists mainly for use by a general purpose data mapping framework, and not for use by user code.

Specified by:
canConvert in interface ConversionService
Parameters:
sourceType - context about the source type to convert from (required)
targetType - context about the target type to convert to (required)
Returns:
true if a conversion can be performed between the source and target types, false if not

convert

public Object convert(Object source,
                      TypeDescriptor sourceType,
                      TypeDescriptor targetType)
Description copied from interface: ConversionService
Convert the source to targetType. The TypeDescriptors provide additional context about the field locations where conversion will occur, often object property locations. This flavor of the convert operation exists mainly for use by a general purpose data mapping framework, and not for use by user code.

Specified by:
convert in interface ConversionService
Parameters:
source - the source object to convert (may be null)
sourceType - context about the source type converting from (required)
targetType - context about the target type to convert to (required)
Returns:
the converted object, an instance of targetType

toString

public String toString()
Overrides:
toString in class Object

convertNullSource

protected Object convertNullSource(TypeDescriptor sourceType,
                                   TypeDescriptor targetType)
Hook method to convert a null source. Default implementation returns null. Throws a ConversionFailedException if the targetType is a primitive type, as null cannot be assigned to a primitive type. Subclasses may override to return custom null objects for specific target types.

Parameters:
sourceType - the sourceType to convert from
targetType - the targetType to convert to
Returns:
the converted null object

getConverter

protected GenericConverter getConverter(TypeDescriptor sourceType,
                                        TypeDescriptor targetType)
Hook method to lookup the converter for a given sourceType/targetType pair. First queries this ConversionService's converter map.

Returns null if this ConversionService simply cannot convert between sourceType and targetType. Subclasses may override.

Parameters:
sourceType - the source type to convert from
targetType - the target type to convert to
Returns:
the generic converter that will perform the conversion, or null if no suitable converter was found

getDefaultConverter

protected GenericConverter getDefaultConverter(TypeDescriptor sourceType,
                                               TypeDescriptor targetType)
Return the default converter if no converter is found for the given sourceType/targetType pair. Returns a NO_OP Converter if the sourceType is assignalbe to the targetType. Returns null otherwise, indicating no suitable converter could be found. Subclasses may override.

Parameters:
sourceType - the source type to convert from
targetType - the target type to convert to
Returns:
the default generic converter that will perform the conversion
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertyTypeDescriptor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.core.convert.support
Class PropertyTypeDescriptor

java.lang.Object
    extended by  org.springframework.core.convert.TypeDescriptor
        extended by  org.springframework.core.convert.support.PropertyTypeDescriptor

public class PropertyTypeDescriptor
extends TypeDescriptor

TypeDescriptor extension that exposes additional annotations as conversion metadata: namely, annotations on other accessor methods (getter/setter) and on the underlying field, if found.

Since:
3.0
Author:
Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.core.convert.TypeDescriptor
NULL
Constructor Summary
PropertyTypeDescriptor(PropertyDescriptor propertyDescriptor, MethodParameter methodParameter)
Create a new BeanTypeDescriptor for the given bean property.
PropertyTypeDescriptor(PropertyDescriptor propertyDescriptor, MethodParameter methodParameter, Class<?> type)
Create a new BeanTypeDescriptor for the given bean property.
Method Summary
Annotation[] | getAnnotations() Obtain the annotations associated with the wrapped parameter/field, if any.
PropertyDescriptor | getPropertyDescriptor() Return the underlying PropertyDescriptor.
Methods inherited from class org.springframework.core.convert.TypeDescriptor
asString, forElementType, forObject, getAnnotation, getElementType, getElementTypeDescriptor, getField, getMapKeyType, getMapKeyTypeDescriptor, getMapValueType, getMapValueTypeDescriptor, getMethodParameter, getName, getObjectType, getType, isArray, isAssignableTo, isCollection, isMap, isMapEntryTypeKnown, isPrimitive, toString, valueOf
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

PropertyTypeDescriptor

public PropertyTypeDescriptor(PropertyDescriptor propertyDescriptor,
                              MethodParameter methodParameter)
Create a new BeanTypeDescriptor for the given bean property.

Parameters:
propertyDescriptor - the corresponding JavaBean PropertyDescriptor
methodParameter - the target method parameter

PropertyTypeDescriptor

public PropertyTypeDescriptor(PropertyDescriptor propertyDescriptor,
                              MethodParameter methodParameter,
                              Class<?> type)
Create a new BeanTypeDescriptor for the given bean property.

Parameters:
propertyDescriptor - the corresponding JavaBean PropertyDescriptor
methodParameter - the target method parameter
type - the specific type to expose (may be an array/collection element)
Method Detail

getPropertyDescriptor

public PropertyDescriptor getPropertyDescriptor()
Return the underlying PropertyDescriptor.

getAnnotations

public Annotation[] getAnnotations()
Description copied from class: TypeDescriptor
Obtain the annotations associated with the wrapped parameter/field, if any.

Overrides:
getAnnotations in class TypeDescriptor
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.core.enums

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.core.enums

Interfaces and classes for type-safe enum support on JDK >= 1.3.

See:
Description

Interface Summary
LabeledEnum | Deprecated. as of Spring 3.0, in favor of Java 5 enums.
LabeledEnumResolver | Deprecated. as of Spring 3.0, in favor of Java 5 enums.

Class Summary
AbstractCachingLabeledEnumResolver | Deprecated. as of Spring 3.0, in favor of Java 5 enums.
AbstractGenericLabeledEnum | Deprecated. as of Spring 3.0, in favor of Java 5 enums.
AbstractLabeledEnum | Deprecated. as of Spring 3.0, in favor of Java 5 enums.
LetterCodedLabeledEnum | Deprecated. as of Spring 3.0, in favor of Java 5 enums.
ShortCodedLabeledEnum | Deprecated. as of Spring 3.0, in favor of Java 5 enums.
StaticLabeledEnum | Deprecated. as of Spring 3.0, in favor of Java 5 enums.
StaticLabeledEnumResolver | Deprecated. as of Spring 3.0, in favor of Java 5 enums.
StringCodedLabeledEnum | Deprecated. as of Spring 3.0, in favor of Java 5 enums.

Package org.springframework.core.enums Description

Interfaces and classes for type-safe enum support on JDK >= 1.3. This enum abstraction support codes and labels.


org.springframework.core.enums Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.core.enums

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.core.enums.AbstractCachingLabeledEnumResolver (implements org.springframework.core.enums.LabeledEnumResolver)
      • org.springframework.core.enums.StaticLabeledEnumResolver
    • org.springframework.core.enums.AbstractLabeledEnum (implements org.springframework.core.enums.LabeledEnum)
      • org.springframework.core.enums.AbstractGenericLabeledEnum
        • org.springframework.core.enums.LetterCodedLabeledEnum
        • org.springframework.core.enums.ShortCodedLabeledEnum
        • org.springframework.core.enums.StringCodedLabeledEnum
      • org.springframework.core.enums.StaticLabeledEnum

Interface Hierarchy

  • java.lang.Comparable<T>
    • org.springframework.core.enums.LabeledEnum (also extends java.io.Serializable)
  • org.springframework.core.enums.LabeledEnumResolver
  • java.io.Serializable
    • org.springframework.core.enums.LabeledEnum (also extends java.lang.Comparable<T>)


LabeledEnum

org.springframework.core.enums
Interface LabeledEnum

All Superinterfaces:
Comparable, Serializable
All Known Implementing Classes:
AbstractGenericLabeledEnum, AbstractLabeledEnum, LetterCodedLabeledEnum, ShortCodedLabeledEnum, StaticLabeledEnum, StringCodedLabeledEnum
Deprecated. as of Spring 3.0, in favor of Java 5 enums.

@Deprecated
public interface LabeledEnum
extends Comparable, Serializable

An interface for objects that represent a labeled enumeration. Each such enum instance has the following characteristics:

  • A type that identifies the enum's class. For example: com.mycompany.util.FileFormat.
  • A code that uniquely identifies the enum within the context of its type. For example: "CSV". Different classes of codes are possible (e.g., Character, Integer, String).
  • A descriptive label. For example: "the CSV File Format".

Since:
1.2.2
Author:
Keith Donald

Field Summary
static Comparator | CODE_ORDER Deprecated. Shared Comparator instance that sorts enumerations by CODE_ORDER.
static Comparator | DEFAULT_ORDER Deprecated. Shared Comparator instance that sorts enumerations by LABEL_ORDER, then CODE_ORDER.
static Comparator | LABEL_ORDER Deprecated. Shared Comparator instance that sorts enumerations by LABEL_ORDER.
Method Summary
Comparable | getCode() Deprecated. Return this enumeration's code.
String | getLabel() Deprecated. Return a descriptive, optional label.
Class | getType() Deprecated. Return this enumeration's type.
Methods inherited from interface java.lang.Comparable
compareTo

Field Detail

CODE_ORDER

static final Comparator CODE_ORDER
Deprecated.
Shared Comparator instance that sorts enumerations by CODE_ORDER.

LABEL_ORDER

static final Comparator LABEL_ORDER
Deprecated.
Shared Comparator instance that sorts enumerations by LABEL_ORDER.

DEFAULT_ORDER

static final Comparator DEFAULT_ORDER
Deprecated.
Shared Comparator instance that sorts enumerations by LABEL_ORDER, then CODE_ORDER.

Method Detail

getType

Class getType()
Deprecated.
Return this enumeration's type.

getCode

Comparable getCode()
Deprecated.
Return this enumeration's code.

Each code should be unique within enumerations of the same type.

getLabel

String getLabel()
Deprecated.
Return a descriptive, optional label.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LabeledEnumResolver

org.springframework.core.enums
Interface LabeledEnumResolver

All Known Implementing Classes:
AbstractCachingLabeledEnumResolver, StaticLabeledEnumResolver
Deprecated. as of Spring 3.0, in favor of Java 5 enums.

@Deprecated
public interface LabeledEnumResolver

Interface for looking up LabeledEnum instances.

Since:
1.2.2
Author:
Keith Donald, Juergen Hoeller

Method Summary
LabeledEnum | getLabeledEnumByCode(Class type, Comparable code) Deprecated. Resolve a single LabeledEnum by its identifying code.
LabeledEnum | getLabeledEnumByLabel(Class type, String label) Deprecated. Resolve a single LabeledEnum by its identifying code.
Map | getLabeledEnumMap(Class type) Deprecated. Return a map of enumerations of a particular type.
Set | getLabeledEnumSet(Class type) Deprecated. Return a set of enumerations of a particular type.

Method Detail

getLabeledEnumSet

Set getLabeledEnumSet(Class type)
                      throws IllegalArgumentException
Deprecated.
Return a set of enumerations of a particular type. Each element in the set should be an instance of LabeledEnum.

Parameters:
type - the enum type
Returns:
a set of localized enumeration instances for the provided type
Throws:
IllegalArgumentException - if the type is not supported

getLabeledEnumMap

Map getLabeledEnumMap(Class type)
                      throws IllegalArgumentException
Deprecated.
Return a map of enumerations of a particular type. Each element in the map should be a key/value pair, where the key is the enum code, and the value is the LabeledEnum instance.

Parameters:
type - the enum type
Returns:
a Map of localized enumeration instances, with enum code as key and LabeledEnum instance as value
Throws:
IllegalArgumentException - if the type is not supported

getLabeledEnumByCode

LabeledEnum getLabeledEnumByCode(Class type,
                                 Comparable code)
                                 throws IllegalArgumentException
Deprecated.
Resolve a single LabeledEnum by its identifying code.

Parameters:
type - the enum type
code - the enum code
Returns:
the enum
Throws:
IllegalArgumentException - if the code did not map to a valid instance

getLabeledEnumByLabel

LabeledEnum getLabeledEnumByLabel(Class type,
                                  String label)
                                  throws IllegalArgumentException
Deprecated.
Resolve a single LabeledEnum by its identifying code.

Parameters:
type - the enum type
label - the enum label
Returns:
the enum
Throws:
IllegalArgumentException - if the label did not map to a valid instance
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractCachingLabeledEnumResolver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.core.enums
Class AbstractCachingLabeledEnumResolver

java.lang.Object
    extended by  org.springframework.core.enums.AbstractCachingLabeledEnumResolver
All Implemented Interfaces:
LabeledEnumResolver
Direct Known Subclasses:
StaticLabeledEnumResolver
Deprecated. as of Spring 3.0, in favor of Java 5 enums.

@Deprecated
public abstract class AbstractCachingLabeledEnumResolver
extends Object
implements LabeledEnumResolver

Abstract base class for LabeledEnumResolver implementations, caching all retrieved LabeledEnum instances.

Subclasses need to implement the template method findLabeledEnums(Class).

Since:
1.2.2
Author:
Keith Donald, Juergen Hoeller
See Also:
findLabeledEnums(Class)

Field Summary
protected  Log logger
Deprecated.
Constructor Summary
AbstractCachingLabeledEnumResolver()
Deprecated.
Method Summary
protected abstract Set<LabeledEnum> | findLabeledEnums(Class type) Deprecated. Template method to be implemented by subclasses.
LabeledEnum | getLabeledEnumByCode(Class type, Comparable code) Deprecated. Resolve a single LabeledEnum by its identifying code.
LabeledEnum | getLabeledEnumByLabel(Class type, String label) Deprecated. Resolve a single LabeledEnum by its identifying code.
Map<Comparable,LabeledEnum> | getLabeledEnumMap(Class type) Deprecated. Return a map of enumerations of a particular type.
Set<LabeledEnum> | getLabeledEnumSet(Class type) Deprecated. Return a set of enumerations of a particular type.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final transient Log logger
Deprecated.
Constructor Detail

AbstractCachingLabeledEnumResolver

public AbstractCachingLabeledEnumResolver()
Deprecated.
Method Detail

getLabeledEnumSet

public Set<LabeledEnum> getLabeledEnumSet(Class type)
                                   throws IllegalArgumentException
Deprecated.
Description copied from interface: LabeledEnumResolver
Return a set of enumerations of a particular type. Each element in the set should be an instance of LabeledEnum.

Specified by:
getLabeledEnumSet in interface LabeledEnumResolver
Parameters:
type - the enum type
Returns:
a set of localized enumeration instances for the provided type
Throws:
IllegalArgumentException - if the type is not supported

getLabeledEnumMap

public Map<Comparable,LabeledEnum> getLabeledEnumMap(Class type)
                                              throws IllegalArgumentException
Deprecated.
Description copied from interface: LabeledEnumResolver
Return a map of enumerations of a particular type. Each element in the map should be a key/value pair, where the key is the enum code, and the value is the LabeledEnum instance.

Specified by:
getLabeledEnumMap in interface LabeledEnumResolver
Parameters:
type - the enum type
Returns:
a Map of localized enumeration instances, with enum code as key and LabeledEnum instance as value
Throws:
IllegalArgumentException - if the type is not supported

getLabeledEnumByCode

public LabeledEnum getLabeledEnumByCode(Class type,
                                        Comparable code)
                                 throws IllegalArgumentException
Deprecated.
Description copied from interface: LabeledEnumResolver
Resolve a single LabeledEnum by its identifying code.

Specified by:
getLabeledEnumByCode in interface LabeledEnumResolver
Parameters:
type - the enum type
code - the enum code
Returns:
the enum
Throws:
IllegalArgumentException - if the code did not map to a valid instance

getLabeledEnumByLabel

public LabeledEnum getLabeledEnumByLabel(Class type,
                                         String label)
                                  throws IllegalArgumentException
Deprecated.
Description copied from interface: LabeledEnumResolver
Resolve a single LabeledEnum by its identifying code.

Specified by:
getLabeledEnumByLabel in interface LabeledEnumResolver
Parameters:
type - the enum type
label - the enum label
Returns:
the enum
Throws:
IllegalArgumentException - if the label did not map to a valid instance

findLabeledEnums

protected abstract Set<LabeledEnum> findLabeledEnums(Class type)
Deprecated.
Template method to be implemented by subclasses. Supposed to find all LabeledEnum instances for the given type.

Parameters:
type - the enum type
Returns:
the Set of LabeledEnum instances
See Also:
LabeledEnum
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractGenericLabeledEnum

org.springframework.core.enums
Class AbstractGenericLabeledEnum

java.lang.Object
    extended by  org.springframework.core.enums.AbstractLabeledEnum
        extended by  org.springframework.core.enums.AbstractGenericLabeledEnum
All Implemented Interfaces:
Serializable, Comparable, LabeledEnum
Direct Known Subclasses:
LetterCodedLabeledEnum, ShortCodedLabeledEnum, StringCodedLabeledEnum
Deprecated. as of Spring 3.0, in favor of Java 5 enums.

public abstract class AbstractGenericLabeledEnum
extends AbstractLabeledEnum

Base class for labeled enum instances that aren't static.

Since:
1.2.6
Author:
Keith Donald
See Also:
Serialized Form

Field Summary
Fields inherited from interface org.springframework.core.enums.LabeledEnum
CODE_ORDER, DEFAULT_ORDER, LABEL_ORDER
Constructor Summary
protected AbstractGenericLabeledEnum(String label)
Deprecated. Create a new StaticLabeledEnum instance.
Method Summary
 String getLabel()
Deprecated. Return a descriptive, optional label.
Methods inherited from class org.springframework.core.enums.AbstractLabeledEnum
compareTo, equals, getType, hashCode, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.core.enums.LabeledEnum
getCode

Constructor Detail

AbstractGenericLabeledEnum

protected AbstractGenericLabeledEnum(String label)
Deprecated.
Create a new StaticLabeledEnum instance.

Parameters:
label - the label; if null), the enum's code will be used as label
Method Detail

getLabel

public String getLabel()
Deprecated.
Description copied from interface: LabeledEnum
Return a descriptive, optional label.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractLabeledEnum

org.springframework.core.enums
Class AbstractLabeledEnum

java.lang.Object
    extended by  org.springframework.core.enums.AbstractLabeledEnum
All Implemented Interfaces:
Serializable, Comparable, LabeledEnum
Direct Known Subclasses:
AbstractGenericLabeledEnum, StaticLabeledEnum
Deprecated. as of Spring 3.0, in favor of Java 5 enums.

@Deprecated
public abstract class AbstractLabeledEnum
extends Object
implements LabeledEnum

Abstract base superclass for LabeledEnum implementations.

Since:
1.2.2
Author:
Keith Donald, Juergen Hoeller, Sam Brannen
See Also:
Serialized Form

Field Summary
Fields inherited from interface org.springframework.core.enums.LabeledEnum
CODE_ORDER, DEFAULT_ORDER, LABEL_ORDER
Constructor Summary
protected AbstractLabeledEnum()
Deprecated. Create a new AbstractLabeledEnum instance.
Method Summary
int | compareTo(Object obj) Deprecated.
boolean | equals(Object obj) Deprecated.
Class | getType() Deprecated. Return this enumeration's type.
int | hashCode() Deprecated.
String | toString() Deprecated.
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.core.enums.LabeledEnum
getCode, getLabel

Constructor Detail

AbstractLabeledEnum

protected AbstractLabeledEnum()
Deprecated.
Create a new AbstractLabeledEnum instance.

Method Detail

getType

public Class getType()
Deprecated.
Description copied from interface: LabeledEnum
Return this enumeration's type.

Specified by:
getType in interface LabeledEnum

compareTo

public int compareTo(Object obj)
Deprecated.
Specified by:
compareTo in interface Comparable

equals

public boolean equals(Object obj)
Deprecated.
Overrides:
equals in class Object

hashCode

public int hashCode()
Deprecated.
Overrides:
hashCode in class Object

toString

public String toString()
Deprecated.
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LetterCodedLabeledEnum

org.springframework.core.enums
Class LetterCodedLabeledEnum

java.lang.Object
    extended by  org.springframework.core.enums.AbstractLabeledEnum
        extended by  org.springframework.core.enums.AbstractGenericLabeledEnum
            extended by  org.springframework.core.enums.LetterCodedLabeledEnum
All Implemented Interfaces:
Serializable, Comparable, LabeledEnum
Deprecated. as of Spring 3.0, in favor of Java 5 enums.

@Deprecated
public class LetterCodedLabeledEnum
extends AbstractGenericLabeledEnum

Implementation of LabeledEnum which uses a letter as the code type.

Should almost always be subclassed, but for some simple situations it may be used directly. Note that you will not be able to use unique type-based functionality like LabeledEnumResolver.getLabeledEnumSet(type) in this case.

Since:
1.2.2
Author:
Keith Donald
See Also:
Serialized Form

Field Summary
Fields inherited from interface org.springframework.core.enums.LabeledEnum
CODE_ORDER, DEFAULT_ORDER, LABEL_ORDER
Constructor Summary
LetterCodedLabeledEnum(char code, String label)
Deprecated. Create a new LetterCodedLabeledEnum instance.
Method Summary
Comparable | getCode() Deprecated. Return this enumeration's code.
char | getLetterCode() Deprecated. Return the letter code of this LabeledEnum instance.
Methods inherited from class org.springframework.core.enums.AbstractGenericLabeledEnum
getLabel
Methods inherited from class org.springframework.core.enums.AbstractLabeledEnum
compareTo, equals, getType, hashCode, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

LetterCodedLabeledEnum

public LetterCodedLabeledEnum(char code,
                              String label)
Deprecated.
Create a new LetterCodedLabeledEnum instance.

Parameters:
code - the letter code
label - the label (can be null)
Method Detail

getCode

public Comparable getCode()
Deprecated.
Description copied from interface: LabeledEnum
Return this enumeration's code.

Each code should be unique within enumerations of the same type.

getLetterCode

public char getLetterCode()
Deprecated.
Return the letter code of this LabeledEnum instance.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ShortCodedLabeledEnum

org.springframework.core.enums
Class ShortCodedLabeledEnum

java.lang.Object
    extended by  org.springframework.core.enums.AbstractLabeledEnum
        extended by  org.springframework.core.enums.AbstractGenericLabeledEnum
            extended by  org.springframework.core.enums.ShortCodedLabeledEnum
All Implemented Interfaces:
Serializable, Comparable, LabeledEnum
Deprecated. as of Spring 3.0, in favor of Java 5 enums.

@Deprecated
public class ShortCodedLabeledEnum
extends AbstractGenericLabeledEnum

Implementation of LabeledEnum which uses Short as the code type.

Should almost always be subclassed, but for some simple situations it may be used directly. Note that you will not be able to use unique type-based functionality like LabeledEnumResolver.getLabeledEnumSet(type) in this case.

Since:
1.2.2
Author:
Keith Donald
See Also:
Serialized Form

Field Summary
Fields inherited from interface org.springframework.core.enums.LabeledEnum
CODE_ORDER, DEFAULT_ORDER, LABEL_ORDER
Constructor Summary
ShortCodedLabeledEnum(int code, String label)
Deprecated. Create a new ShortCodedLabeledEnum instance.
Method Summary
Comparable | getCode() Deprecated. Return this enumeration's code.
short | getShortCode() Deprecated. Return the short code of this LabeledEnum instance.
Methods inherited from class org.springframework.core.enums.AbstractGenericLabeledEnum
getLabel
Methods inherited from class org.springframework.core.enums.AbstractLabeledEnum
compareTo, equals, getType, hashCode, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

ShortCodedLabeledEnum

public ShortCodedLabeledEnum(int code,
                             String label)
Deprecated.
Create a new ShortCodedLabeledEnum instance.

Parameters:
code - the short code
label - the label (can be null)
Method Detail

getCode

public Comparable getCode()
Deprecated.
Description copied from interface: LabeledEnum
Return this enumeration's code.

Each code should be unique within enumerations of the same type.

getShortCode

public short getShortCode()
Deprecated.
Return the short code of this LabeledEnum instance.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StaticLabeledEnum

org.springframework.core.enums
Class StaticLabeledEnum

java.lang.Object
    extended by  org.springframework.core.enums.AbstractLabeledEnum
        extended by  org.springframework.core.enums.StaticLabeledEnum
All Implemented Interfaces:
Serializable, Comparable, LabeledEnum
Deprecated. as of Spring 3.0, in favor of Java 5 enums.

@Deprecated
public abstract class StaticLabeledEnum
extends AbstractLabeledEnum

Base class for static type-safe labeled enum instances. Usage example:

 public class FlowSessionStatus extends StaticLabeledEnum {

     // public static final instances!
     public static FlowSessionStatus CREATED = new FlowSessionStatus(0, "Created");
     public static FlowSessionStatus ACTIVE = new FlowSessionStatus(1, "Active");
     public static FlowSessionStatus PAUSED = new FlowSessionStatus(2, "Paused");
     public static FlowSessionStatus SUSPENDED = new FlowSessionStatus(3, "Suspended");
     public static FlowSessionStatus ENDED = new FlowSessionStatus(4, "Ended");

     // private constructor!
     private FlowSessionStatus(int code, String label) {
         super(code, label);
     }

     // custom behavior
 }

Since:
1.2.6
Author:
Keith Donald
See Also:
Serialized Form

Field Summary
Fields inherited from interface org.springframework.core.enums.LabeledEnum
CODE_ORDER, DEFAULT_ORDER, LABEL_ORDER
Constructor Summary
protected StaticLabeledEnum(int code, String label)
Deprecated. Create a new StaticLabeledEnum instance.
Method Summary
Comparable | getCode() Deprecated. Return this enumeration's code.
String | getLabel() Deprecated. Return a descriptive, optional label.
protected Object | readResolve() Deprecated. Return the resolved type safe static enum instance.
short | shortValue() Deprecated. Return the code of this LabeledEnum instance as a short.
Methods inherited from class org.springframework.core.enums.AbstractLabeledEnum
compareTo, equals, getType, hashCode, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

StaticLabeledEnum

protected StaticLabeledEnum(int code,
                            String label)
Deprecated.
Create a new StaticLabeledEnum instance.

Parameters:
code - the short code
label - the label (can be null)
Method Detail

getCode

public Comparable getCode()
Deprecated.
Description copied from interface: LabeledEnum
Return this enumeration's code.

Each code should be unique within enumerations of the same type.

getLabel

public String getLabel()
Deprecated.
Description copied from interface: LabeledEnum
Return a descriptive, optional label.

shortValue

public short shortValue()
Deprecated.
Return the code of this LabeledEnum instance as a short.

readResolve

protected Object readResolve()
Deprecated.
Return the resolved type safe static enum instance.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StaticLabeledEnumResolver

org.springframework.core.enums
Class StaticLabeledEnumResolver

java.lang.Object
    extended by  org.springframework.core.enums.AbstractCachingLabeledEnumResolver
        extended by  org.springframework.core.enums.StaticLabeledEnumResolver
All Implemented Interfaces:
LabeledEnumResolver
Deprecated. as of Spring 3.0, in favor of Java 5 enums.

@Deprecated
public class StaticLabeledEnumResolver
extends AbstractCachingLabeledEnumResolver

LabeledEnumResolver that resolves statically defined enumerations. Static implies all enum instances were defined within Java code, implementing the type-safe enum pattern.

Since:
1.2.2
Author:
Keith Donald, Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.core.enums.AbstractCachingLabeledEnumResolver
logger
Constructor Summary
StaticLabeledEnumResolver()
Deprecated.
Method Summary
protected Set<LabeledEnum> | findLabeledEnums(Class type) Deprecated. Template method to be implemented by subclasses.
static StaticLabeledEnumResolver | instance() Deprecated. Return the shared StaticLabeledEnumResolver singleton instance.
Methods inherited from class org.springframework.core.enums.AbstractCachingLabeledEnumResolver
getLabeledEnumByCode, getLabeledEnumByLabel, getLabeledEnumMap, getLabeledEnumSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

StaticLabeledEnumResolver

public StaticLabeledEnumResolver()
Deprecated.
Method Detail

instance

public static StaticLabeledEnumResolver instance()
Deprecated.
Return the shared StaticLabeledEnumResolver singleton instance. Mainly for resolving unique StaticLabeledEnum references on deserialization.

See Also:
StaticLabeledEnum

findLabeledEnums

protected Set<LabeledEnum> findLabeledEnums(Class type)
Deprecated.
Description copied from class: AbstractCachingLabeledEnumResolver
Template method to be implemented by subclasses. Supposed to find all LabeledEnum instances for the given type.

Specified by:
findLabeledEnums in class AbstractCachingLabeledEnumResolver
Parameters:
type - the enum type
Returns:
the Set of LabeledEnum instances
See Also:
LabeledEnum
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StringCodedLabeledEnum

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.core.enums
Class StringCodedLabeledEnum

java.lang.Object
    extended by  org.springframework.core.enums.AbstractLabeledEnum
        extended by  org.springframework.core.enums.AbstractGenericLabeledEnum
            extended by  org.springframework.core.enums.StringCodedLabeledEnum
All Implemented Interfaces:
Serializable, Comparable, LabeledEnum
Deprecated. as of Spring 3.0, in favor of Java 5 enums.

@Deprecated
public class StringCodedLabeledEnum
extends AbstractGenericLabeledEnum

Implementation of LabeledEnum which uses a String as the code type.

Should almost always be subclassed, but for some simple situations it may be used directly. Note that you will not be able to use unique type-based functionality like LabeledEnumResolver.getLabeledEnumSet(type) in this case.

Since:
1.2.2
Author:
Keith Donald, Juergen Hoeller
See Also:
LabeledEnumResolver.getLabeledEnumSet(Class), Serialized Form

Field Summary

Fields inherited from interface org.springframework.core.enums.LabeledEnum
CODE_ORDER, DEFAULT_ORDER, LABEL_ORDER

Constructor Summary
StringCodedLabeledEnum(String code, String label)
          Deprecated. Create a new StringCodedLabeledEnum instance.

Method Summary
Comparable | getCode() Deprecated. Return this enumeration's code.
String | getStringCode() Deprecated. Return the String code of this LabeledEnum instance.

Methods inherited from class org.springframework.core.enums.AbstractGenericLabeledEnum
getLabel

Methods inherited from class org.springframework.core.enums.AbstractLabeledEnum
compareTo, equals, getType, hashCode, toString

Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

StringCodedLabeledEnum

public StringCodedLabeledEnum(String code,
                              String label)
Deprecated.
Create a new StringCodedLabeledEnum instance.

Parameters:
code - the String code
label - the label (can be null)
Method Detail

getCode

public Comparable getCode()
Deprecated.
Description copied from interface: LabeledEnum
Return this enumeration's code.

Each code should be unique within enumerations of the same type.

getStringCode

public String getStringCode()
Deprecated.
Return the String code of this LabeledEnum instance.

Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS | FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.core.io

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.core.io

Generic abstraction for (file-based) resources, used throughout the framework.

See:
Description

Interface Summary
ContextResource | Extended interface for a resource that is loaded from an enclosing 'context', e.g.
InputStreamSource | Simple interface for objects that are sources for an InputStream.
Resource | Interface for a resource descriptor that abstracts from the actual type of underlying resource, such as a file or class path resource.
ResourceLoader | Strategy interface for loading resources (e..

Class Summary
AbstractFileResolvingResource | Abstract base class for resources which resolve URLs into File references, such as UrlResource or ClassPathResource.
AbstractResource | Convenience base class for Resource implementations, pre-implementing typical behavior.
ByteArrayResource | Resource implementation for a given byte array.
ClassPathResource | Resource implementation for class path resources.
ClassRelativeResourceLoader | ResourceLoader implementation that interprets plain resource paths as relative to a given java.lang.Class.
DefaultResourceLoader | Default implementation of the ResourceLoader interface.
DescriptiveResource | Simple Resource implementation that holds a resource description but does not point to an actually readable resource.
FileSystemResource | Resource implementation for java.io.File handles.
FileSystemResourceLoader | ResourceLoader implementation that resolves plain paths as file system resources rather than as class path resources (the latter is DefaultResourceLoader's default strategy).
InputStreamResource | Resource implementation for a given InputStream.
ResourceEditor | Editor for Resource descriptors, to automatically convert String locations e.g.
UrlResource | Resource implementation for java.net.URL locators.
VfsResource | VFS based Resource implementation.

Package org.springframework.core.io Description

Generic abstraction for (file-based) resources, used throughout the framework.


org.springframework.core.io Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.core.io

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.core.io.AbstractResource (implements org.springframework.core.io.Resource)
      • org.springframework.core.io.AbstractFileResolvingResource
        • org.springframework.core.io.ClassPathResource
        • org.springframework.core.io.UrlResource
      • org.springframework.core.io.ByteArrayResource
      • org.springframework.core.io.DescriptiveResource
      • org.springframework.core.io.FileSystemResource
      • org.springframework.core.io.InputStreamResource
      • org.springframework.core.io.VfsResource
    • org.springframework.core.io.DefaultResourceLoader (implements org.springframework.core.io.ResourceLoader)
      • org.springframework.core.io.ClassRelativeResourceLoader
      • org.springframework.core.io.FileSystemResourceLoader
    • java.beans.PropertyEditorSupport (implements java.beans.PropertyEditor)
      • org.springframework.core.io.ResourceEditor

Interface Hierarchy

  • org.springframework.core.io.InputStreamSource
    • org.springframework.core.io.Resource
      • org.springframework.core.io.ContextResource
  • org.springframework.core.io.ResourceLoader


ContextResource

org.springframework.core.io
Interface ContextResource

All Superinterfaces:
InputStreamSource, Resource
All Known Implementing Classes:
PortletContextResource, ServletContextResource
public interface ContextResource
extends Resource

Extended interface for a resource that is loaded from an enclosing 'context', e.g. from a ServletContext or a PortletContext but also from plain classpath paths or relative file system paths (specified without an explicit prefix, hence applying relative to the local ResourceLoader's context).

Since:
2.5
Author:
Juergen Hoeller
See Also:
ServletContextResource, PortletContextResource

Method Summary
 String getPathWithinContext()
Return the path within the enclosing 'context'.
Methods inherited from interface org.springframework.core.io.Resource
createRelative, exists, getDescription, getFile, getFilename, getURI, getURL, isOpen, isReadable, lastModified
Methods inherited from interface org.springframework.core.io.InputStreamSource
getInputStream

Method Detail

getPathWithinContext

String getPathWithinContext()
Return the path within the enclosing 'context'.

This is typically path relative to a context-specific root directory, e.g. a ServletContext root or a PortletContext root.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InputStreamSource

org.springframework.core.io
Interface InputStreamSource

All Known Subinterfaces:
ContextResource, Resource
All Known Implementing Classes:
AbstractFileResolvingResource, AbstractResource, ByteArrayResource, ClassPathResource, DescriptiveResource, FileSystemResource, InputStreamResource, PortletContextResource, ServletContextResource, UrlResource, VfsResource
public interface InputStreamSource

Simple interface for objects that are sources for an InputStream.

This is the base interface for Spring's more extensive Resource interface.

For single-use streams, InputStreamResource can be used for any given InputStream. Spring's ByteArrayResource or any file-based Resource implementation can be used as a concrete instance, allowing one to read the underlying content stream multiple times. This makes this interface useful as an abstract content source for mail attachments, for example.

Since:
20.01.2004
Author:
Juergen Hoeller
See Also:
InputStream, Resource, InputStreamResource, ByteArrayResource

Method Summary
 InputStream getInputStream()
Return an InputStream.

Method Detail

getInputStream

InputStream getInputStream()
                           throws IOException
Return an InputStream.

It is expected that each call creates a fresh stream.

This requirement is particularly important when you consider an API such as JavaMail, which needs to be able to read the stream multiple times when creating mail attachments. For such a use case, it is required that each getInputStream() call returns a fresh stream.

Throws:
IOException - if the stream could not be opened
See Also:
MimeMessageHelper.addAttachment(String, InputStreamSource)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Resource

org.springframework.core.io
Interface Resource

All Superinterfaces:
InputStreamSource
All Known Subinterfaces:
ContextResource
All Known Implementing Classes:
AbstractFileResolvingResource, AbstractResource, ByteArrayResource, ClassPathResource, DescriptiveResource, FileSystemResource, InputStreamResource, PortletContextResource, ServletContextResource, UrlResource, VfsResource
public interface Resource
extends InputStreamSource

Interface for a resource descriptor that abstracts from the actual type of underlying resource, such as a file or class path resource.

An InputStream can be opened for every resource if it exists in physical form, but a URL or File handle can just be returned for certain resources. The actual behavior is implementation-specific.

Since:
28.12.2003
Author:
Juergen Hoeller
See Also:
InputStreamSource.getInputStream(), getURL(), getURI(), getFile(), FileSystemResource, ClassPathResource, UrlResource, ByteArrayResource, InputStreamResource, ServletContextResource

Method Summary
Resource | createRelative(String relativePath) Create a resource relative to this resource.
boolean | exists() Return whether this resource actually exists in physical form.
String | getDescription() Return a description for this resource, to be used for error output when working with the resource.
File | getFile() Return a File handle for this resource.
String | getFilename() Return a filename for this resource, i.e.
URI | getURI() Return a URI handle for this resource.
URL | getURL() Return a URL handle for this resource.
boolean | isOpen() Return whether this resource represents a handle with an open stream.
boolean | isReadable() Return whether the contents of this resource can be read, e.g.
long | lastModified() Determine the last-modified timestamp for this resource.
Methods inherited from interface org.springframework.core.io.InputStreamSource
getInputStream

Method Detail

exists

boolean exists()
Return whether this resource actually exists in physical form.

This method performs a definitive existence check, whereas the existence of a Resource handle only guarantees a valid descriptor handle.

isReadable

boolean isReadable()
Return whether the contents of this resource can be read, e.g. via InputStreamSource.getInputStream() or getFile().

Will be true for typical resource descriptors; note that actual content reading may still fail when attempted. However, a value of false is a definitive indication that the resource content cannot be read.

isOpen

boolean isOpen()
Return whether this resource represents a handle with an open stream. If true, the InputStream cannot be read multiple times, and must be read and closed to avoid resource leaks.

Will be false for typical resource descriptors.

getURL

URL getURL()
           throws IOException
Return a URL handle for this resource.

Throws:
IOException - if the resource cannot be resolved as URL, i.e. if the resource is not available as descriptor

getURI

URI getURI()
           throws IOException
Return a URI handle for this resource.

Throws:
IOException - if the resource cannot be resolved as URI, i.e. if the resource is not available as descriptor

getFile

File getFile()
             throws IOException
Return a File handle for this resource.

Throws:
IOException - if the resource cannot be resolved as absolute file path, i.e. if the resource is not available in a file system

lastModified

long lastModified()
                  throws IOException
Determine the last-modified timestamp for this resource.

Throws:
IOException - if the resource cannot be resolved (in the file system or as some other known physical resource type)

createRelative

Resource createRelative(String relativePath)
                        throws IOException
Create a resource relative to this resource.

Parameters:
relativePath - the relative path (relative to this resource)
Returns:
the resource handle for the relative resource
Throws:
IOException - if the relative resource cannot be determined

getFilename

String getFilename()
Return a filename for this resource, i.e. typically the last part of the path: for example, "myfile.txt".

getDescription

String getDescription()
Return a description for this resource, to be used for error output when working with the resource.

Implementations are also encouraged to return this value from their toString method.

See Also:
Object.toString()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResourceLoader

org.springframework.core.io
Interface ResourceLoader

All Known Subinterfaces:
ApplicationContext, ConfigurableApplicationContext, ConfigurablePortletApplicationContext, ConfigurableWebApplicationContext, ResourcePatternResolver, WebApplicationContext
All Known Implementing Classes:
AbstractApplicationContext, AbstractRefreshableApplicationContext, AbstractRefreshableConfigApplicationContext, AbstractRefreshablePortletApplicationContext, AbstractRefreshableWebApplicationContext, AbstractXmlApplicationContext, AnnotationConfigApplicationContext, AnnotationConfigWebApplicationContext, ClassPathXmlApplicationContext, ClassRelativeResourceLoader, DefaultResourceLoader, FileSystemResourceLoader, FileSystemXmlApplicationContext, GenericApplicationContext, GenericWebApplicationContext, GenericXmlApplicationContext, PathMatchingResourcePatternResolver, PortletContextResourceLoader, PortletContextResourcePatternResolver, ResourceAdapterApplicationContext, ServletContextResourceLoader, ServletContextResourcePatternResolver, StaticApplicationContext, StaticPortletApplicationContext, StaticWebApplicationContext, XmlPortletApplicationContext, XmlWebApplicationContext
public interface ResourceLoader

Strategy interface for loading resources (e.. class path or file system resources). An ApplicationContext is required to provide this functionality, plus extended ResourcePatternResolver support.

DefaultResourceLoader is a standalone implementation that is usable outside an ApplicationContext, also used by ResourceEditor.

Bean properties of type Resource and Resource array can be populated from Strings when running in an ApplicationContext, using the particular context's resource loading strategy.

Since:
10.03.2004
Author:
Juergen Hoeller
See Also:
Resource, ResourcePatternResolver, ApplicationContext, ResourceLoaderAware

Field Summary
static String CLASSPATH_URL_PREFIX
Pseudo URL prefix for loading from the class path: "classpath:"
Method Summary
ClassLoader | getClassLoader() Expose the ClassLoader used by this ResourceLoader.
Resource | getResource(String location) Return a Resource handle for the specified resource.

Field Detail

CLASSPATH_URL_PREFIX

static final String CLASSPATH_URL_PREFIX
Pseudo URL prefix for loading from the class path: "classpath:"

See Also:
Constant Field Values
Method Detail

getResource

Resource getResource(String location)
Return a Resource handle for the specified resource. The handle should always be a reusable resource descriptor, allowing for multiple InputStreamSource.getInputStream() calls.

  • Must support fully qualified URLs, e.g. "file:C:/test.dat".
  • Must support classpath pseudo-URLs, e.g. "classpath:test.dat".
  • Should support relative file paths, e.g. "WEB-INF/test.dat". (This will be implementation-specific, typically provided by an ApplicationContext implementation.)

Note that a Resource handle does not imply an existing resource; you need to invoke Resource.exists() to check for existence.

Parameters:
location - the resource location
Returns:
a corresponding Resource handle
See Also:
CLASSPATH_URL_PREFIX, Resource.exists(), InputStreamSource.getInputStream()

getClassLoader

ClassLoader getClassLoader()
Expose the ClassLoader used by this ResourceLoader.

Clients which need to access the ClassLoader directly can do so in a uniform manner with the ResourceLoader, rather than relying on the thread context ClassLoader.

Returns:
the ClassLoader (never null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractFileResolvingResource

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.core.io
Class AbstractFileResolvingResource

java.lang.Object
    extended by  org.springframework.core.io.AbstractResource
        extended by  org.springframework.core.io.AbstractFileResolvingResource
All Implemented Interfaces:
InputStreamSource, Resource
Direct Known Subclasses:
ClassPathResource, UrlResource
public abstract class AbstractFileResolvingResource
extends AbstractResource

Abstract base class for resources which resolve URLs into File references, such as UrlResource or ClassPathResource.

Detects the "file" protocol as well as the JBoss "vfs" protocol in URLs, resolving file system references accordingly.

Since:
3.0
Author:
Juergen Hoeller

Constructor Summary
AbstractFileResolvingResource()
Method Summary
File | getFile() This implementation returns a File reference for the underlying class path resource, provided that it refers to a file in the file system.
protected File | getFile(URI uri) This implementation returns a File reference for the underlying class path resource, provided that it refers to a file in the file system.
protected File | getFileForLastModifiedCheck() This implementation determines the underlying File (or jar file, in case of a resource in a jar/zip).
Methods inherited from class org.springframework.core.io.AbstractResource
createRelative, equals, exists, getFilename, getURI, getURL, hashCode, isOpen, isReadable, lastModified, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.core.io.Resource
getDescription
Methods inherited from interface org.springframework.core.io.InputStreamSource
getInputStream

Constructor Detail

AbstractFileResolvingResource

public AbstractFileResolvingResource()
Method Detail

getFile

public File getFile()
             throws IOException
This implementation returns a File reference for the underlying class path resource, provided that it refers to a file in the file system.

Specified by:
getFile in interface Resource
Overrides:
getFile in class AbstractResource
Throws:
IOException - if the resource cannot be resolved as absolute file path, i.e. if the resource is not available in a file system
See Also:
ResourceUtils.getFile(java.net.URL, String)

getFileForLastModifiedCheck

protected File getFileForLastModifiedCheck()
                                    throws IOException
This implementation determines the underlying File (or jar file, in case of a resource in a jar/zip).

Overrides:
getFileForLastModifiedCheck in class AbstractResource
Returns:
the File to use for timestamp checking (never null)
Throws:
IOException - if the resource cannot be resolved as absolute file path, i.e. if the resource is not available in a file system

getFile

protected File getFile(URI uri)
                throws IOException
This implementation returns a File reference for the underlying class path resource, provided that it refers to a file in the file system.

Throws:
IOException
See Also:
ResourceUtils.getFile(java.net.URI, String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractResource

org.springframework.core.io
Class AbstractResource

java.lang.Object
    extended by  org.springframework.core.io.AbstractResource
All Implemented Interfaces:
InputStreamSource, Resource
Direct Known Subclasses:
AbstractFileResolvingResource, ByteArrayResource, DescriptiveResource, FileSystemResource, InputStreamResource, PortletContextResource, ServletContextResource, VfsResource
public abstract class AbstractResource
extends Object
implements Resource

Convenience base class for Resource implementations, pre-implementing typical behavior.

The "exists" method will check whether a File or InputStream can be opened; "isOpen" will always return false; "getURL" and "getFile" throw an exception; and "toString" will return the description.

Since:
28.12.2003
Author:
Juergen Hoeller

Constructor Summary
AbstractResource()
Method Summary
 Resource createRelative(String relativePath)
This implementation throws a FileNotFoundException, assuming that relative resources cannot be created for this resource.
 boolean equals(Object obj)
This implementation compares description strings.
 boolean exists()
This implementation checks whether a File can be opened, falling back to whether an InputStream can be opened.
 File getFile()
This implementation throws a FileNotFoundException, assuming that the resource cannot be resolved to an absolute file path.
protected  File getFileForLastModifiedCheck()
Determine the File to use for timestamp checking.
 String getFilename()
This implementation always throws IllegalStateException, assuming that the resource does not carry a filename.
 URI getURI()
This implementation builds a URI based on the URL returned by getURL().
 URL getURL()
This implementation throws a FileNotFoundException, assuming that the resource cannot be resolved to a URL.
 int hashCode()
This implementation returns the description's hash code.
 boolean isOpen()
This implementation always returns false.
 boolean isReadable()
This implementation always returns true.
 long lastModified()
This implementation checks the timestamp of the underlying File, if available.
 String toString()
This implementation returns the description of this resource.
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.core.io.Resource
getDescription
Methods inherited from interface org.springframework.core.io.InputStreamSource
getInputStream

Constructor Detail

AbstractResource

public AbstractResource()
Method Detail

exists

public boolean exists()
This implementation checks whether a File can be opened, falling back to whether an InputStream can be opened. This will cover both directories and content resources.

Specified by:
exists in interface Resource

isReadable

public boolean isReadable()
This implementation always returns true.

Specified by:
isReadable in interface Resource

isOpen

public boolean isOpen()
This implementation always returns false.

Specified by:
isOpen in interface Resource

getURL

public URL getURL()
           throws IOException
This implementation throws a FileNotFoundException, assuming that the resource cannot be resolved to a URL.

Specified by:
getURL in interface Resource
Throws:
IOException - if the resource cannot be resolved as URL, i.e. if the resource is not available as descriptor

getURI

public URI getURI()
           throws IOException
This implementation builds a URI based on the URL returned by getURL().

Specified by:
getURI in interface Resource
Throws:
IOException - if the resource cannot be resolved as URI, i.e. if the resource is not available as descriptor

getFile

public File getFile()
             throws IOException
This implementation throws a FileNotFoundException, assuming that the resource cannot be resolved to an absolute file path.

Specified by:
getFile in interface Resource
Throws:
IOException - if the resource cannot be resolved as absolute file path, i.e. if the resource is not available in a file system

lastModified

public long lastModified()
                  throws IOException
This implementation checks the timestamp of the underlying File, if available.

Specified by:
lastModified in interface Resource
Throws:
IOException - if the resource cannot be resolved (in the file system or as some other known physical resource type)
See Also:
getFileForLastModifiedCheck()

getFileForLastModifiedCheck

protected File getFileForLastModifiedCheck()
                                    throws IOException
Determine the File to use for timestamp checking.

The default implementation delegates to getFile().

Returns:
the File to use for timestamp checking (never null)
Throws:
IOException - if the resource cannot be resolved as absolute file path, i.e. if the resource is not available in a file system

createRelative

public Resource createRelative(String relativePath)
                        throws IOException
This implementation throws a FileNotFoundException, assuming that relative resources cannot be created for this resource.

Specified by:
createRelative in interface Resource
Parameters:
relativePath - the relative path (relative to this resource)
Returns:
the resource handle for the relative resource
Throws:
IOException - if the relative resource cannot be determined

getFilename

public String getFilename()
                   throws IllegalStateException
This implementation always throws IllegalStateException, assuming that the resource does not carry a filename.

Specified by:
getFilename in interface Resource
Throws:
IllegalStateException

toString

public String toString()
This implementation returns the description of this resource.

Overrides:
toString in class Object
See Also:
Resource.getDescription()

equals

public boolean equals(Object obj)
This implementation compares description strings.

Overrides:
equals in class Object
See Also:
Resource.getDescription()

hashCode

public int hashCode()
This implementation returns the description's hash code.

Overrides:
hashCode in class Object
See Also:
Resource.getDescription()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ByteArrayResource

org.springframework.core.io
Class ByteArrayResource

java.lang.Object
    extended by  org.springframework.core.io.AbstractResource
        extended by  org.springframework.core.io.ByteArrayResource
All Implemented Interfaces:
InputStreamSource, Resource
public class ByteArrayResource
extends AbstractResource

Resource implementation for a given byte array. Creates a ByteArrayInputStreams for the given byte array.

Useful for loading content from any given byte array, without having to resort to a single-use InputStreamResource. Particularly useful for creating mail attachments from local content, where JavaMail needs to be able to read the stream multiple times.

Since:
1.2.3
Author:
Juergen Hoeller
See Also:
ByteArrayInputStream, InputStreamResource, MimeMessageHelper.addAttachment(String, InputStreamSource)

Constructor Summary
ByteArrayResource(byte[] byteArray)
Create a new ByteArrayResource.
ByteArrayResource(byte[] byteArray, String description)
Create a new ByteArrayResource.
Method Summary
boolean | equals(Object obj) This implementation compares the underlying byte array.
boolean | exists() This implementation always returns true.
byte[] | getByteArray() Return the underlying byte array.
String | getDescription() This implementation returns the passed-in description, if any.
InputStream | getInputStream() This implementation returns a ByteArrayInputStream for the underlying byte array.
int | hashCode() This implementation returns the hash code based on the underlying byte array.
Methods inherited from class org.springframework.core.io.AbstractResource
createRelative, getFile, getFileForLastModifiedCheck, getFilename, getURI, getURL, isOpen, isReadable, lastModified, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

ByteArrayResource

public ByteArrayResource(byte[] byteArray)
Create a new ByteArrayResource.

Parameters:
byteArray - the byte array to wrap

ByteArrayResource

public ByteArrayResource(byte[] byteArray,
                         String description)
Create a new ByteArrayResource.

Parameters:
byteArray - the byte array to wrap
description - where the byte array comes from
Method Detail

getByteArray

public final byte[] getByteArray()
Return the underlying byte array.

exists

public boolean exists()
This implementation always returns true.

Specified by:
exists in interface Resource
Overrides:
exists in class AbstractResource

getInputStream

public InputStream getInputStream()
                           throws IOException
This implementation returns a ByteArrayInputStream for the underlying byte array.

Throws:
IOException - if the stream could not be opened
See Also:
ByteArrayInputStream

getDescription

public String getDescription()
This implementation returns the passed-in description, if any.

See Also:
Object.toString()

equals

public boolean equals(Object obj)
This implementation compares the underlying byte array.

Overrides:
equals in class AbstractResource
See Also:
Arrays.equals(byte[], byte[])

hashCode

public int hashCode()
This implementation returns the hash code based on the underlying byte array.

Overrides:
hashCode in class AbstractResource
See Also:
Resource.getDescription()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ClassPathResource

org.springframework.core.io
Class ClassPathResource

java.lang.Object
    extended by  org.springframework.core.io.AbstractResource
        extended by  org.springframework.core.io.AbstractFileResolvingResource
            extended by  org.springframework.core.io.ClassPathResource
All Implemented Interfaces:
InputStreamSource, Resource
public class ClassPathResource
extends AbstractFileResolvingResource

Resource implementation for class path resources. Uses either a given ClassLoader or a given Class for loading resources.

Supports resolution as java.io.File if the class path resource resides in the file system, but not for resources in a JAR. Always supports resolution as URL.

Since:
28.12.2003
Author:
Juergen Hoeller
See Also:
ClassLoader.getResourceAsStream(String), Class.getResourceAsStream(String)

Constructor Summary
 | ClassPathResource(String path) Create a new ClassPathResource for ClassLoader usage.
 | ClassPathResource(String path, Class<?> clazz) Create a new ClassPathResource for Class usage.
 | ClassPathResource(String path, ClassLoader classLoader) Create a new ClassPathResource for ClassLoader usage.
protected | ClassPathResource(String path, ClassLoader classLoader, Class<?> clazz) Create a new ClassPathResource with optional ClassLoader and Class.
Method Summary
Resource | createRelative(String relativePath) This implementation creates a ClassPathResource, applying the given path relative to the path of the underlying resource of this descriptor.
boolean | equals(Object obj) This implementation compares the underlying class path locations.
ClassLoader | getClassLoader() Return the ClassLoader that this resource will be obtained from.
String | getDescription() This implementation returns a description that includes the class path location.
String | getFilename() This implementation returns the name of the file that this class path resource refers to.
InputStream | getInputStream() This implementation opens an InputStream for the given class path resource.
String | getPath() Return the path for this resource (as resource path within the class path).
URL | getURL() This implementation returns a URL for the underlying class path resource.
int | hashCode() This implementation returns the hash code of the underlying class path location.
Methods inherited from class org.springframework.core.io.AbstractFileResolvingResource
getFile, getFile, getFileForLastModifiedCheck
Methods inherited from class org.springframework.core.io.AbstractResource
exists, getURI, isOpen, isReadable, lastModified, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

ClassPathResource

public ClassPathResource(String path)
Create a new ClassPathResource for ClassLoader usage. A leading slash will be removed, as the ClassLoader resource access methods will not accept it.

The thread context class loader will be used for loading the resource.

Parameters:
path - the absolute path within the class path
See Also:
ClassLoader.getResourceAsStream(String), ClassUtils.getDefaultClassLoader()

ClassPathResource

public ClassPathResource(String path,
                         ClassLoader classLoader)
Create a new ClassPathResource for ClassLoader usage. A leading slash will be removed, as the ClassLoader resource access methods will not accept it.

Parameters:
path - the absolute path within the classpath
classLoader - the class loader to load the resource with, or null for the thread context class loader
See Also:
ClassLoader.getResourceAsStream(String)

ClassPathResource

public ClassPathResource(String path,
                         Class<?> clazz)
Create a new ClassPathResource for Class usage. The path can be relative to the given class, or absolute within the classpath via a leading slash.

Parameters:
path - relative or absolute path within the class path
clazz - the class to load resources with
See Also:
Class.getResourceAsStream(java.lang.String)

ClassPathResource

protected ClassPathResource(String path,
                            ClassLoader classLoader,
                            Class<?> clazz)
Create a new ClassPathResource with optional ClassLoader and Class. Only for internal usage.

Parameters:
path - relative or absolute path within the classpath
classLoader - the class loader to load the resource with, if any
clazz - the class to load resources with, if any
Method Detail

getPath

public final String getPath()
Return the path for this resource (as resource path within the class path).

getClassLoader

public final ClassLoader getClassLoader()
Return the ClassLoader that this resource will be obtained from.

getInputStream

public InputStream getInputStream()
                           throws IOException
This implementation opens an InputStream for the given class path resource.

Throws:
IOException - if the stream could not be opened
See Also:
ClassLoader.getResourceAsStream(String), Class.getResourceAsStream(String)

getURL

public URL getURL()
           throws IOException
This implementation returns a URL for the underlying class path resource.

Specified by:
getURL in interface Resource
Overrides:
getURL in class AbstractResource
Throws:
IOException - if the resource cannot be resolved as URL, i.e. if the resource is not available as descriptor
See Also:
ClassLoader.getResource(String), Class.getResource(String)

createRelative

public Resource createRelative(String relativePath)
This implementation creates a ClassPathResource, applying the given path relative to the path of the underlying resource of this descriptor.

Specified by:
createRelative in interface Resource
Overrides:
createRelative in class AbstractResource
Parameters:
relativePath - the relative path (relative to this resource)
Returns:
the resource handle for the relative resource
See Also:
StringUtils.applyRelativePath(String, String)

getFilename

public String getFilename()
This implementation returns the name of the file that this class path resource refers to.

Specified by:
getFilename in interface Resource
Overrides:
getFilename in class AbstractResource
See Also:
StringUtils.getFilename(String)

getDescription

public String getDescription()
This implementation returns a description that includes the class path location.

See Also:
Object.toString()

equals

public boolean equals(Object obj)
This implementation compares the underlying class path locations.

Overrides:
equals in class AbstractResource
See Also:
Resource.getDescription()

hashCode

public int hashCode()
This implementation returns the hash code of the underlying class path location.

Overrides:
hashCode in class AbstractResource
See Also:
Resource.getDescription()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ClassRelativeResourceLoader

org.springframework.core.io
Class ClassRelativeResourceLoader

java.lang.Object
    extended by  org.springframework.core.io.DefaultResourceLoader
        extended by  org.springframework.core.io.ClassRelativeResourceLoader
All Implemented Interfaces:
ResourceLoader
public class ClassRelativeResourceLoader
extends DefaultResourceLoader

ResourceLoader implementation that interprets plain resource paths as relative to a given java.lang.Class.

Since:
3.0
Author:
Juergen Hoeller
See Also:
Class.getResource(String), ClassPathResource.ClassPathResource(String, Class)

Field Summary
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Constructor Summary
ClassRelativeResourceLoader(Class clazz)
Create a new ClassRelativeResourceLoader for the given class.
Method Summary
protected  Resource getResourceByPath(String path)
Return a Resource handle for the resource at the given path.
Methods inherited from class org.springframework.core.io.DefaultResourceLoader
getClassLoader, getResource, setClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ClassRelativeResourceLoader

public ClassRelativeResourceLoader(Class clazz)
Create a new ClassRelativeResourceLoader for the given class.

Parameters:
clazz - the class to load resources through
Method Detail

getResourceByPath

protected Resource getResourceByPath(String path)
Description copied from class: DefaultResourceLoader
Return a Resource handle for the resource at the given path.

The default implementation supports class path locations. This should be appropriate for standalone implementations but can be overridden, e.g. for implementations targeted at a Servlet container.

Overrides:
getResourceByPath in class DefaultResourceLoader
Parameters:
path - the path to the resource
Returns:
the corresponding Resource handle
See Also:
ClassPathResource, FileSystemXmlApplicationContext.getResourceByPath(java.lang.String), AbstractRefreshableWebApplicationContext.getResourceByPath(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultResourceLoader

org.springframework.core.io
Class DefaultResourceLoader

java.lang.Object
    extended by  org.springframework.core.io.DefaultResourceLoader
All Implemented Interfaces:
ResourceLoader
Direct Known Subclasses:
AbstractApplicationContext, ClassRelativeResourceLoader, FileSystemResourceLoader, PortletContextResourceLoader, ServletContextResourceLoader
public class DefaultResourceLoader
extends Object
implements ResourceLoader

Default implementation of the ResourceLoader interface. Used by ResourceEditor, and serves as base class for AbstractApplicationContext. Can also be used standalone.

Will return a UrlResource if the location value is a URL, and a ClassPathResource if it is a non-URL path or a "classpath:" pseudo-URL.

Since:
10.03.2004
Author:
Juergen Hoeller
See Also:
FileSystemResourceLoader, ClassPathXmlApplicationContext

Field Summary
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Constructor Summary
DefaultResourceLoader()
Create a new DefaultResourceLoader.
DefaultResourceLoader(ClassLoader classLoader)
Create a new DefaultResourceLoader.
Method Summary
ClassLoader | getClassLoader() Return the ClassLoader to load class path resources with.
Resource | getResource(String location) Return a Resource handle for the specified resource.
protected Resource | getResourceByPath(String path) Return a Resource handle for the resource at the given path.
void | setClassLoader(ClassLoader classLoader) Specify the ClassLoader to load class path resources with, or null for using the thread context class loader at the time of actual resource access.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DefaultResourceLoader

public DefaultResourceLoader()
Create a new DefaultResourceLoader.

ClassLoader access will happen using the thread context class loader at the time of this ResourceLoader's initialization.

See Also:
Thread.getContextClassLoader()

DefaultResourceLoader

public DefaultResourceLoader(ClassLoader classLoader)
Create a new DefaultResourceLoader.

Parameters:
classLoader - the ClassLoader to load class path resources with, or null for using the thread context class loader at the time of actual resource access
Method Detail

setClassLoader

public void setClassLoader(ClassLoader classLoader)
Specify the ClassLoader to load class path resources with, or null for using the thread context class loader at the time of actual resource access.

The default is that ClassLoader access will happen using the thread context class loader at the time of this ResourceLoader's initialization.

getClassLoader

public ClassLoader getClassLoader()
Return the ClassLoader to load class path resources with.

Will get passed to ClassPathResource's constructor for all ClassPathResource objects created by this resource loader.

Specified by:
getClassLoader in interface ResourceLoader
Returns:
the ClassLoader (never null)
See Also:
ClassPathResource

getResource

public Resource getResource(String location)
Description copied from interface: ResourceLoader
Return a Resource handle for the specified resource. The handle should always be a reusable resource descriptor, allowing for multiple InputStreamSource.getInputStream() calls.

  • Must support fully qualified URLs, e.g. "file:C:/test.dat".
  • Must support classpath pseudo-URLs, e.g. "classpath:test.dat".
  • Should support relative file paths, e.g. "WEB-INF/test.dat". (This will be implementation-specific, typically provided by an ApplicationContext implementation.)

Note that a Resource handle does not imply an existing resource; you need to invoke Resource.exists() to check for existence.

Specified by:
getResource in interface ResourceLoader
Parameters:
location - the resource location
Returns:
a corresponding Resource handle
See Also:
ResourceLoader.CLASSPATH_URL_PREFIX, Resource.exists(), InputStreamSource.getInputStream()

getResourceByPath

protected Resource getResourceByPath(String path)
Return a Resource handle for the resource at the given path.

The default implementation supports class path locations. This should be appropriate for standalone implementations but can be overridden, e.g. for implementations targeted at a Servlet container.

Parameters:
path - the path to the resource
Returns:
the corresponding Resource handle
See Also:
ClassPathResource, FileSystemXmlApplicationContext.getResourceByPath(java.lang.String), AbstractRefreshableWebApplicationContext.getResourceByPath(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DescriptiveResource

org.springframework.core.io
Class DescriptiveResource

java.lang.Object
    extended by  org.springframework.core.io.AbstractResource
        extended by  org.springframework.core.io.DescriptiveResource
All Implemented Interfaces:
InputStreamSource, Resource
public class DescriptiveResource
extends AbstractResource

Simple Resource implementation that holds a resource description but does not point to an actually readable resource.

To be used as placeholder if a Resource argument is expected by an API but not necessarily used for actual reading.

Since:
1.2.6
Author:
Juergen Hoeller

Constructor Summary
DescriptiveResource(String description)
Create a new DescriptiveResource.
Method Summary
boolean | equals(Object obj) This implementation compares the underlying description String.
boolean | exists() This implementation checks whether a File can be opened, falling back to whether an InputStream can be opened.
String | getDescription() Return a description for this resource, to be used for error output when working with the resource.
InputStream | getInputStream() Return an InputStream.
int | hashCode() This implementation returns the hash code of the underlying description String.
boolean | isReadable() This implementation always returns true.
Methods inherited from class org.springframework.core.io.AbstractResource
createRelative, getFile, getFileForLastModifiedCheck, getFilename, getURI, getURL, isOpen, lastModified, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

DescriptiveResource

public DescriptiveResource(String description)
Create a new DescriptiveResource.

Parameters:
description - the resource description
Method Detail

exists

public boolean exists()
Description copied from class: AbstractResource
This implementation checks whether a File can be opened, falling back to whether an InputStream can be opened. This will cover both directories and content resources.

Specified by:
exists in interface Resource
Overrides:
exists in class AbstractResource

isReadable

public boolean isReadable()
Description copied from class: AbstractResource
This implementation always returns true.

Specified by:
isReadable in interface Resource
Overrides:
isReadable in class AbstractResource

getInputStream

public InputStream getInputStream()
                           throws IOException
Description copied from interface: InputStreamSource
Return an InputStream.

It is expected that each call creates a fresh stream.

This requirement is particularly important when you consider an API such as JavaMail, which needs to be able to read the stream multiple times when creating mail attachments. For such a use case, it is required that each getInputStream() call returns a fresh stream.

Throws:
IOException - if the stream could not be opened
See Also:
MimeMessageHelper.addAttachment(String, InputStreamSource)

getDescription

public String getDescription()
Description copied from interface: Resource
Return a description for this resource, to be used for error output when working with the resource.

Implementations are also encouraged to return this value from their toString method.

See Also:
Object.toString()

equals

public boolean equals(Object obj)
This implementation compares the underlying description String.

Overrides:
equals in class AbstractResource
See Also:
Resource.getDescription()

hashCode

public int hashCode()
This implementation returns the hash code of the underlying description String.

Overrides:
hashCode in class AbstractResource
See Also:
Resource.getDescription()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FileSystemResource

org.springframework.core.io
Class FileSystemResource

java.lang.Object
    extended by  org.springframework.core.io.AbstractResource
        extended by  org.springframework.core.io.FileSystemResource
All Implemented Interfaces:
InputStreamSource, Resource
public class FileSystemResource
extends AbstractResource

Resource implementation for java.io.File handles. Obviously supports resolution as File, and also as URL.

Since:
28.12.2003
Author:
Juergen Hoeller
See Also:
File

Constructor Summary
FileSystemResource(File file)
Create a new FileSystemResource from a File handle.
FileSystemResource(String path)
Create a new FileSystemResource from a file path.
Method Summary
Resource | createRelative(String relativePath) This implementation creates a FileSystemResource, applying the given path relative to the path of the underlying file of this resource descriptor.
boolean | equals(Object obj) This implementation compares the underlying File references.
boolean | exists() This implementation returns whether the underlying file exists.
String | getDescription() This implementation returns a description that includes the absolute path of the file.
File | getFile() This implementation returns the underlying File reference.
String | getFilename() This implementation returns the name of the file.
InputStream | getInputStream() This implementation opens a FileInputStream for the underlying file.
String | getPath() Return the file path for this resource.
URI | getURI() This implementation returns a URI for the underlying file.
URL | getURL() This implementation returns a URL for the underlying file.
int | hashCode() This implementation returns the hash code of the underlying File reference.
boolean | isReadable() This implementation checks whether the underlying file is marked as readable (and corresponds to an actual file with content, not to a directory).
Methods inherited from class org.springframework.core.io.AbstractResource
getFileForLastModifiedCheck, isOpen, lastModified, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

FileSystemResource

public FileSystemResource(File file)
Create a new FileSystemResource from a File handle.

Note: When building relative resources via createRelative(java.lang.String), the relative path will apply at the same directory level: e.g. new File("C:/dir1"), relative path "dir2" -> "C:/dir2"! If you prefer to have relative paths built underneath the given root directory, use the constructor with a file path to append a trailing slash to the root path: "C:/dir1/", which indicates this directory as root for all relative paths.

Parameters:
file - a File handle

FileSystemResource

public FileSystemResource(String path)
Create a new FileSystemResource from a file path.

Note: When building relative resources via createRelative(java.lang.String), it makes a difference whether the specified resource base path here ends with a slash or not. In the case of "C:/dir1/", relative paths will be built underneath that root: e.g. relative path "dir2" -> "C:/dir1/dir2". In the case of "C:/dir1", relative paths will apply at the same directory level: relative path "dir2" -> "C:/dir2".

Parameters:
path - a file path
Method Detail

getPath

public final String getPath()
Return the file path for this resource.

exists

public boolean exists()
This implementation returns whether the underlying file exists.

Specified by:
exists in interface Resource
Overrides:
exists in class AbstractResource
See Also:
File.exists()

isReadable

public boolean isReadable()
This implementation checks whether the underlying file is marked as readable (and corresponds to an actual file with content, not to a directory).

Specified by:
isReadable in interface Resource
Overrides:
isReadable in class AbstractResource
See Also:
File.canRead(), File.isDirectory()

getInputStream

public InputStream getInputStream()
                           throws IOException
This implementation opens a FileInputStream for the underlying file.

Throws:
IOException - if the stream could not be opened
See Also:
FileInputStream

getURL

public URL getURL()
           throws IOException
This implementation returns a URL for the underlying file.

Specified by:
getURL in interface Resource
Overrides:
getURL in class AbstractResource
Throws:
IOException - if the resource cannot be resolved as URL, i.e. if the resource is not available as descriptor
See Also:
File.toURI()

getURI

public URI getURI()
           throws IOException
This implementation returns a URI for the underlying file.

Specified by:
getURI in interface Resource
Overrides:
getURI in class AbstractResource
Throws:
IOException - if the resource cannot be resolved as URI, i.e. if the resource is not available as descriptor
See Also:
File.toURI()

getFile

public File getFile()
This implementation returns the underlying File reference.

Specified by:
getFile in interface Resource
Overrides:
getFile in class AbstractResource

createRelative

public Resource createRelative(String relativePath)
This implementation creates a FileSystemResource, applying the given path relative to the path of the underlying file of this resource descriptor.

Specified by:
createRelative in interface Resource
Overrides:
createRelative in class AbstractResource
Parameters:
relativePath - the relative path (relative to this resource)
Returns:
the resource handle for the relative resource
See Also:
StringUtils.applyRelativePath(String, String)

getFilename

public String getFilename()
This implementation returns the name of the file.

Specified by:
getFilename in interface Resource
Overrides:
getFilename in class AbstractResource
See Also:
File.getName()

getDescription

public String getDescription()
This implementation returns a description that includes the absolute path of the file.

See Also:
File.getAbsolutePath()

equals

public boolean equals(Object obj)
This implementation compares the underlying File references.

Overrides:
equals in class AbstractResource
See Also:
Resource.getDescription()

hashCode

public int hashCode()
This implementation returns the hash code of the underlying File reference.

Overrides:
hashCode in class AbstractResource
See Also:
Resource.getDescription()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FileSystemResourceLoader

org.springframework.core.io
Class FileSystemResourceLoader

java.lang.Object
    extended by  org.springframework.core.io.DefaultResourceLoader
        extended by  org.springframework.core.io.FileSystemResourceLoader
All Implemented Interfaces:
ResourceLoader
public class FileSystemResourceLoader
extends DefaultResourceLoader

ResourceLoader implementation that resolves plain paths as file system resources rather than as class path resources (the latter is DefaultResourceLoader's default strategy).

NOTE: Plain paths will always be interpreted as relative to the current VM working directory, even if they start with a slash. (This is consistent with the semantics in a Servlet container.) Use an explicit "file:" prefix to enforce an absolute file path.

FileSystemXmlApplicationContext is a full-fledged ApplicationContext implementation that provides the same resource path resolution strategy.

Since:
1.1.3
Author:
Juergen Hoeller
See Also:
DefaultResourceLoader, FileSystemXmlApplicationContext

Field Summary
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Constructor Summary
FileSystemResourceLoader()
Method Summary
protected  Resource getResourceByPath(String path)
Resolve resource paths as file system paths.
Methods inherited from class org.springframework.core.io.DefaultResourceLoader
getClassLoader, getResource, setClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

FileSystemResourceLoader

public FileSystemResourceLoader()
Method Detail

getResourceByPath

protected Resource getResourceByPath(String path)
Resolve resource paths as file system paths.

Note: Even if a given path starts with a slash, it will get interpreted as relative to the current VM working directory.

Overrides:
getResourceByPath in class DefaultResourceLoader
Parameters:
path - the path to the resource
Returns:
the corresponding Resource handle
See Also:
FileSystemResource, ServletContextResourceLoader.getResourceByPath(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InputStreamResource

org.springframework.core.io
Class InputStreamResource

java.lang.Object
    extended by  org.springframework.core.io.AbstractResource
        extended by  org.springframework.core.io.InputStreamResource
All Implemented Interfaces:
InputStreamSource, Resource
public class InputStreamResource
extends AbstractResource

Resource implementation for a given InputStream. Should only be used if no specific Resource implementation is applicable. In particular, prefer ByteArrayResource or any of the file-based Resource implementations where possible.

In contrast to other Resource implementations, this is a descriptor for an already opened resource - therefore returning "true" from isOpen(). Do not use it if you need to keep the resource descriptor somewhere, or if you need to read a stream multiple times.

Since:
28.12.2003
Author:
Juergen Hoeller
See Also:
ByteArrayResource, ClassPathResource, FileSystemResource, UrlResource

Constructor Summary
InputStreamResource(InputStream inputStream)
Create a new InputStreamResource.
InputStreamResource(InputStream inputStream, String description)
Create a new InputStreamResource.
Method Summary
boolean | equals(Object obj) This implementation compares the underlying InputStream.
boolean | exists() This implementation always returns true.
String | getDescription() This implementation returns the passed-in description, if any.
InputStream | getInputStream() This implementation throws IllegalStateException if attempting to read the underlying stream multiple times.
int | hashCode() This implementation returns the hash code of the underlying InputStream.
boolean | isOpen() This implementation always returns true.
Methods inherited from class org.springframework.core.io.AbstractResource
createRelative, getFile, getFileForLastModifiedCheck, getFilename, getURI, getURL, isReadable, lastModified, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

InputStreamResource

public InputStreamResource(InputStream inputStream)
Create a new InputStreamResource.

Parameters:
inputStream - the InputStream to use

InputStreamResource

public InputStreamResource(InputStream inputStream,
                           String description)
Create a new InputStreamResource.

Parameters:
inputStream - the InputStream to use
description - where the InputStream comes from
Method Detail

exists

public boolean exists()
This implementation always returns true.

Specified by:
exists in interface Resource
Overrides:
exists in class AbstractResource

isOpen

public boolean isOpen()
This implementation always returns true.

Specified by:
isOpen in interface Resource
Overrides:
isOpen in class AbstractResource

getInputStream

public InputStream getInputStream()
                           throws IOException,
                                  IllegalStateException
This implementation throws IllegalStateException if attempting to read the underlying stream multiple times.

Throws:
IOException - if the stream could not be opened
IllegalStateException
See Also:
MimeMessageHelper.addAttachment(String, InputStreamSource)

getDescription

public String getDescription()
This implementation returns the passed-in description, if any.

See Also:
Object.toString()

equals

public boolean equals(Object obj)
This implementation compares the underlying InputStream.

Overrides:
equals in class AbstractResource
See Also:
Resource.getDescription()

hashCode

public int hashCode()
This implementation returns the hash code of the underlying InputStream.

Overrides:
hashCode in class AbstractResource
See Also:
Resource.getDescription()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResourceEditor

org.springframework.core.io
Class ResourceEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.core.io.ResourceEditor
All Implemented Interfaces:
PropertyEditor
public class ResourceEditor
extends PropertyEditorSupport

Editor for Resource descriptors, to automatically convert String locations e.g. "file:C:/myfile.txt" or "classpath:myfile.txt") to Resource properties instead of using a String location property.

The path may contain ${...} placeholders, to be resolved as system properties: e.g. ${user.dir}. Unresolvable placeholder are ignored by default.

Delegates to a ResourceLoader to do the heavy lifting, by default using a DefaultResourceLoader.

Since:
28.12.2003
Author:
Juergen Hoeller, Dave Syer
See Also:
Resource, ResourceLoader, DefaultResourceLoader, SystemPropertyUtils.resolvePlaceholders(java.lang.String), System.getProperty(String)

Constructor Summary
ResourceEditor()
Create a new instance of the ResourceEditor class using a DefaultResourceLoader.
ResourceEditor(ResourceLoader resourceLoader)
Create a new instance of the ResourceEditor class using the given ResourceLoader.
ResourceEditor(ResourceLoader resourceLoader, boolean ignoreUnresolvablePlaceholders)
Create a new instance of the ResourceEditor class using the given ResourceLoader.
Method Summary
String | getAsText()
protected String | resolvePath(String path) Resolve the given path, replacing placeholders with corresponding system property values if necessary.
void | setAsText(String text)
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ResourceEditor

public ResourceEditor()
Create a new instance of the ResourceEditor class using a DefaultResourceLoader.

ResourceEditor

public ResourceEditor(ResourceLoader resourceLoader)
Create a new instance of the ResourceEditor class using the given ResourceLoader.

Parameters:
resourceLoader - the ResourceLoader to use

ResourceEditor

public ResourceEditor(ResourceLoader resourceLoader,
                      boolean ignoreUnresolvablePlaceholders)
Create a new instance of the ResourceEditor class using the given ResourceLoader.

Parameters:
resourceLoader - the ResourceLoader to use
ignoreUnresolvablePlaceholders - whether to ignore unresolvable placeholders if no corresponding system property could be found
Method Detail

setAsText

public void setAsText(String text)
Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport

resolvePath

protected String resolvePath(String path)
Resolve the given path, replacing placeholders with corresponding system property values if necessary.

Parameters:
path - the original file path
Returns:
the resolved file path
See Also:
SystemPropertyUtils.resolvePlaceholders(java.lang.String)

getAsText

public String getAsText()
Specified by:
getAsText in interface PropertyEditor
Overrides:
getAsText in class PropertyEditorSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UrlResource

org.springframework.core.io
Class UrlResource

java.lang.Object
    extended by  org.springframework.core.io.AbstractResource
        extended by  org.springframework.core.io.AbstractFileResolvingResource
            extended by  org.springframework.core.io.UrlResource
All Implemented Interfaces:
InputStreamSource, Resource
public class UrlResource
extends AbstractFileResolvingResource

Resource implementation for java.net.URL locators. Obviously supports resolution as URL, and also as File in case of the "file:" protocol.

Since:
28.12.2003
Author:
Juergen Hoeller
See Also:
URL

Constructor Summary
UrlResource(String path)
Create a new UrlResource.
UrlResource(URI uri)
Create a new UrlResource.
UrlResource(URL url)
Create a new UrlResource.
Method Summary
Resource | createRelative(String relativePath) This implementation creates a UrlResource, applying the given path relative to the path of the underlying URL of this resource descriptor.
boolean | equals(Object obj) This implementation compares the underlying URL references.
String | getDescription() This implementation returns a description that includes the URL.
File | getFile() This implementation returns a File reference for the underlying URL/URI, provided that it refers to a file in the file system.
String | getFilename() This implementation returns the name of the file that this URL refers to.
InputStream | getInputStream() This implementation opens an InputStream for the given URL.
URI | getURI() This implementation returns the underlying URI directly, if possible.
URL | getURL() This implementation returns the underlying URL reference.
int | hashCode() This implementation returns the hash code of the underlying URL reference.
Methods inherited from class org.springframework.core.io.AbstractFileResolvingResource
getFile, getFileForLastModifiedCheck
Methods inherited from class org.springframework.core.io.AbstractResource
exists, isOpen, isReadable, lastModified, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

UrlResource

public UrlResource(URL url)
Create a new UrlResource.

Parameters:
url - a URL

UrlResource

public UrlResource(URI uri)
            throws MalformedURLException
Create a new UrlResource.

Parameters:
uri - a URI
Throws:
MalformedURLException - if the given URL path is not valid

UrlResource

public UrlResource(String path)
            throws MalformedURLException
Create a new UrlResource.

Parameters:
path - a URL path
Throws:
MalformedURLException - if the given URL path is not valid
Method Detail

getInputStream

public InputStream getInputStream()
                           throws IOException
This implementation opens an InputStream for the given URL. It sets the "UseCaches" flag to false, mainly to avoid jar file locking on Windows.

Throws:
IOException - if the stream could not be opened
See Also:
URL.openConnection(),
URLConnection.setUseCaches(boolean),
URLConnection.getInputStream()

getURL

public URL getURL()
           throws IOException
This implementation returns the underlying URL reference.

Specified by:
getURL in interface Resource
Overrides:
getURL in class AbstractResource
Throws:
IOException - if the resource cannot be resolved as URL, i.e. if the resource is not available as descriptor

getURI

public URI getURI()
           throws IOException
This implementation returns the underlying URI directly, if possible.

Specified by:
getURI in interface Resource
Overrides:
getURI in class AbstractResource
Throws:
IOException - if the resource cannot be resolved as URI, i.e. if the resource is not available as descriptor

getFile

public File getFile()
             throws IOException
This implementation returns a File reference for the underlying URL/URI, provided that it refers to a file in the file system.

Specified by:
getFile in interface Resource
Overrides:
getFile in class AbstractFileResolvingResource
Throws:
IOException - if the resource cannot be resolved as absolute file path, i.e. if the resource is not available in a file system
See Also:
ResourceUtils.getFile(java.net.URL, String)

createRelative

public Resource createRelative(String relativePath)
                        throws MalformedURLException
This implementation creates a UrlResource, applying the given path relative to the path of the underlying URL of this resource descriptor.

Specified by:
createRelative in interface Resource
Overrides:
createRelative in class AbstractResource
Parameters:
relativePath - the relative path (relative to this resource)
Returns:
the resource handle for the relative resource
Throws:
MalformedURLException
See Also:
URL.URL(java.net.URL, String)

getFilename

public String getFilename()
This implementation returns the name of the file that this URL refers to.

Specified by:
getFilename in interface Resource
Overrides:
getFilename in class AbstractResource
See Also:
URL.getFile(), File.getName()

getDescription

public String getDescription()
This implementation returns a description that includes the URL.

See Also:
Object.toString()

equals

public boolean equals(Object obj)
This implementation compares the underlying URL references.

Overrides:
equals in class AbstractResource
See Also:
Resource.getDescription()

hashCode

public int hashCode()
This implementation returns the hash code of the underlying URL reference.

Overrides:
hashCode in class AbstractResource
See Also:
Resource.getDescription()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


VfsResource

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.core.io
Class VfsResource

java.lang.Object
    extended by  org.springframework.core.io.AbstractResource
        extended by  org.springframework.core.io.VfsResource
All Implemented Interfaces:
InputStreamSource, Resource
public class VfsResource
extends AbstractResource

VFS based Resource implementation.

Since:
3.0
Author:
Ales Justin, Juergen Hoeller
See Also:
VirtualFile

Constructor Summary
VfsResource(org.jboss.virtual.VirtualFile file)
Method Summary
 Resource createRelative(String relativePath)
This implementation throws a FileNotFoundException, assuming that relative resources cannot be created for this resource.
 boolean equals(Object obj)
This implementation compares description strings.
 boolean exists()
This implementation checks whether a File can be opened, falling back to whether an InputStream can be opened.
 String getDescription()
Return a description for this resource, to be used for error output when working with the resource.
 File getFile()
This implementation throws a FileNotFoundException, assuming that the resource cannot be resolved to an absolute file path.
 String getFilename()
This implementation always throws IllegalStateException, assuming that the resource does not carry a filename.
 InputStream getInputStream()
Return an InputStream.
 URI getURI()
This implementation builds a URI based on the URL returned by AbstractResource.getURL().
 URL getURL()
This implementation throws a FileNotFoundException, assuming that the resource cannot be resolved to a URL.
 int hashCode()
This implementation returns the description's hash code.
 boolean isReadable()
This implementation always returns true.
 long lastModified()
This implementation checks the timestamp of the underlying File, if available.
Methods inherited from class org.springframework.core.io.AbstractResource
getFileForLastModifiedCheck, isOpen, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

VfsResource

public VfsResource(org.jboss.virtual.VirtualFile file)
Method Detail

exists

public boolean exists()
Description copied from class: AbstractResource
This implementation checks whether a File can be opened, falling back to whether an InputStream can be opened. This will cover both directories and content resources.

Specified by:
exists in interface Resource
Overrides:
exists in class AbstractResource

isReadable

public boolean isReadable()
Description copied from class: AbstractResource
This implementation always returns true.

Specified by:
isReadable in interface Resource
Overrides:
isReadable in class AbstractResource

lastModified

public long lastModified()
                  throws IOException
Description copied from class: AbstractResource
This implementation checks the timestamp of the underlying File, if available.

Specified by:
lastModified in interface Resource
Overrides:
lastModified in class AbstractResource
Throws:
IOException - if the resource cannot be resolved (in the file system or as some other known physical resource type)
See Also:
AbstractResource.getFileForLastModifiedCheck()

getInputStream

public InputStream getInputStream()
                           throws IOException
Description copied from interface: InputStreamSource
Return an InputStream.

It is expected that each call creates a fresh stream.

This requirement is particularly important when you consider an API such as JavaMail, which needs to be able to read the stream multiple times when creating mail attachments. For such a use case, it is required that each getInputStream() call returns a fresh stream.

Throws:
IOException - if the stream could not be opened
See Also:
MimeMessageHelper.addAttachment(String, InputStreamSource)

getURL

public URL getURL()
           throws IOException
Description copied from class: AbstractResource
This implementation throws a FileNotFoundException, assuming that the resource cannot be resolved to a URL.

Specified by:
getURL in interface Resource
Overrides:
getURL in class AbstractResource
Throws:
IOException - if the resource cannot be resolved as URL, i.e. if the resource is not available as descriptor

getURI

public URI getURI()
           throws IOException
Description copied from class: AbstractResource
This implementation builds a URI based on the URL returned by AbstractResource.getURL().

Specified by:
getURI in interface Resource
Overrides:
getURI in class AbstractResource
Throws:
IOException - if the resource cannot be resolved as URI, i.e. if the resource is not available as descriptor

getFile

public File getFile()
             throws IOException
Description copied from class: AbstractResource
This implementation throws a FileNotFoundException, assuming that the resource cannot be resolved to an absolute file path.

Specified by:
getFile in interface Resource
Overrides:
getFile in class AbstractResource
Throws:
IOException - if the resource cannot be resolved as absolute file path, i.e. if the resource is not available in a file system

createRelative

public Resource createRelative(String relativePath)
                        throws IOException
Description copied from class: AbstractResource
This implementation throws a FileNotFoundException, assuming that relative resources cannot be created for this resource.

Specified by:
createRelative in interface Resource
Overrides:
createRelative in class AbstractResource
Parameters:
relativePath - the relative path (relative to this resource)
Returns:
the resource handle for the relative resource
Throws:
IOException - if the relative resource cannot be determined

getFilename

public String getFilename()
Description copied from class: AbstractResource
This implementation always throws IllegalStateException, assuming that the resource does not carry a filename.

Specified by:
getFilename in interface Resource
Overrides:
getFilename in class AbstractResource

getDescription

public String getDescription()
Description copied from interface: Resource
Return a description for this resource, to be used for error output when working with the resource.

Implementations are also encouraged to return this value from their toString method.

See Also:
Object.toString()

equals

public boolean equals(Object obj)
Description copied from class: AbstractResource
This implementation compares description strings.

Overrides:
equals in class AbstractResource
See Also:
Resource.getDescription()

hashCode

public int hashCode()
Description copied from class: AbstractResource
This implementation returns the description's hash code.

Overrides:
hashCode in class AbstractResource
See Also:
Resource.getDescription()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.core.io.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.core.io.support

Support classes for Spring's resource abstraction.

See:
Description

Interface Summary
ResourcePatternResolver Strategy interface for resolving a location pattern (for example, an Ant-style path pattern) into Resource objects.

Class Summary
EncodedResource | Holder that combines a Resource with a specific encoding to be used for reading from the resource.
LocalizedResourceHelper | Helper class for loading a localized resource, specified through name, extension and current locale.
PathMatchingResourcePatternResolver | A ResourcePatternResolver implementation that is able to resolve a specified resource location path into one or more matching Resources.
PropertiesLoaderSupport | Base class for JavaBean-style components that need to load properties from one or more resources.
PropertiesLoaderUtils | Convenient utility methods for loading of java.util.Properties, performing standard handling of input streams.
ResourceArrayPropertyEditor | Editor for Resource arrays, to automatically convert String location patterns (e.g.
ResourcePatternUtils | Utility class for determining whether a given URL is a resource location that can be loaded via a ResourcePatternResolver.

Package org.springframework.core.io.support Description

Support classes for Spring's resource abstraction. Includes a ResourcePatternResolver mechanism.


org.springframework.core.io.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.core.io.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.core.io.support.EncodedResource
    • org.springframework.core.io.support.LocalizedResourceHelper
    • org.springframework.core.io.support.PathMatchingResourcePatternResolver (implements org.springframework.core.io.support.ResourcePatternResolver)
    • org.springframework.core.io.support.PropertiesLoaderSupport
    • org.springframework.core.io.support.PropertiesLoaderUtils
    • java.beans.PropertyEditorSupport (implements java.beans.PropertyEditor)
      • org.springframework.core.io.support.ResourceArrayPropertyEditor
    • org.springframework.core.io.support.ResourcePatternUtils

Interface Hierarchy

  • org.springframework.core.io.ResourceLoader
    • org.springframework.core.io.support.ResourcePatternResolver


ResourcePatternResolver

org.springframework.core.io.support
Interface ResourcePatternResolver

All Superinterfaces:
ResourceLoader
All Known Subinterfaces:
ApplicationContext, ConfigurableApplicationContext, ConfigurablePortletApplicationContext, ConfigurableWebApplicationContext, WebApplicationContext
All Known Implementing Classes:
AbstractApplicationContext, AbstractRefreshableApplicationContext, AbstractRefreshableConfigApplicationContext, AbstractRefreshablePortletApplicationContext, AbstractRefreshableWebApplicationContext, AbstractXmlApplicationContext, AnnotationConfigApplicationContext, AnnotationConfigWebApplicationContext, ClassPathXmlApplicationContext, FileSystemXmlApplicationContext, GenericApplicationContext, GenericWebApplicationContext, GenericXmlApplicationContext, PathMatchingResourcePatternResolver, PortletContextResourcePatternResolver, ResourceAdapterApplicationContext, ServletContextResourcePatternResolver, StaticApplicationContext, StaticPortletApplicationContext, StaticWebApplicationContext, XmlPortletApplicationContext, XmlWebApplicationContext
public interface ResourcePatternResolver
extends ResourceLoader

Strategy interface for resolving a location pattern (for example, an Ant-style path pattern) into Resource objects.

This is an extension to the ResourceLoader interface. A passed-in ResourceLoader (for example, an ApplicationContext passed in via ResourceLoaderAware when running in a context) can be checked whether it implements this extended interface too.

PathMatchingResourcePatternResolver is a standalone implementation that is usable outside an ApplicationContext, also used by ResourceArrayPropertyEditor for populating Resource array bean properties.

Can be used with any sort of location pattern (e.g. "/WEB-INF/*-context.xml"): Input patterns have to match the strategy implementation. This interface just specifies the conversion method rather than a specific pattern format.

This interface also suggests a new resource prefix "classpath*:" for all matching resources from the class path. Note that the resource location is expected to be a path without placeholders in this case (e.g. "/beans.xml"); JAR files or classes directories can contain multiple files of the same name.

Since:
1.0.2
Author:
Juergen Hoeller
See Also:
Resource, ResourceLoader, ApplicationContext, ResourceLoaderAware

Field Summary
static String CLASSPATH_ALL_URL_PREFIX
Pseudo URL prefix for all matching resources from the class path: "classpath*:" This differs from ResourceLoader's classpath URL prefix in that it retrieves all matching resources for a given name (e.g.
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Method Summary
 Resource[] getResources(String locationPattern)
Resolve the given location pattern into Resource objects.
Methods inherited from interface org.springframework.core.io.ResourceLoader
getClassLoader, getResource

Field Detail

CLASSPATH_ALL_URL_PREFIX

static final String CLASSPATH_ALL_URL_PREFIX
Pseudo URL prefix for all matching resources from the class path: "classpath*:" This differs from ResourceLoader's classpath URL prefix in that it retrieves all matching resources for a given name (e.g. "/beans.xml"), for example in the root of all deployed JAR files.

See Also:
ResourceLoader.CLASSPATH_URL_PREFIX, Constant Field Values
Method Detail

getResources

Resource[] getResources(String locationPattern)
                        throws IOException
Resolve the given location pattern into Resource objects.

Overlapping resource entries that point to the same physical resource should be avoided, as far as possible. The result should have set semantics.

Parameters:
locationPattern - the location pattern to resolve
Returns:
the corresponding Resource objects
Throws:
IOException - in case of I/O errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EncodedResource

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.core.io.support
Class EncodedResource

java.lang.Object
    extended by  org.springframework.core.io.support.EncodedResource

public class EncodedResource
extends Object

Holder that combines a Resource with a specific encoding to be used for reading from the resource.

Used as argument for operations that support to read content with a specific encoding (usually through a java.io.Reader.

Since:
1.2.6
Author:
Juergen Hoeller
See Also:
Reader

Constructor Summary
EncodedResource(Resource resource)
Create a new EncodedResource for the given Resource, not specifying a specific encoding.
EncodedResource(Resource resource, String encoding)
Create a new EncodedResource for the given Resource, using the specified encoding.
Method Summary
boolean | equals(Object obj)
String | getEncoding() Return the encoding to use for reading from the resource, or null if none specified.
Reader | getReader() Open a java.io.Reader for the specified resource, using the specified encoding (if any).
Resource | getResource() Return the Resource held.
int | hashCode()
String | toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

EncodedResource

public EncodedResource(Resource resource)
Create a new EncodedResource for the given Resource, not specifying a specific encoding.

Parameters:
resource - the Resource to hold

EncodedResource

public EncodedResource(Resource resource,
                       String encoding)
Create a new EncodedResource for the given Resource, using the specified encoding.

Parameters:
resource - the Resource to hold
encoding - the encoding to use for reading from the resource
Method Detail

getResource

public final Resource getResource()
Return the Resource held.

getEncoding

public final String getEncoding()
Return the encoding to use for reading from the resource, or null if none specified.

getReader

public Reader getReader()
                 throws IOException
Open a java.io.Reader for the specified resource, using the specified encoding (if any).

Throws:
IOException - if opening the Reader failed

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


LocalizedResourceHelper

org.springframework.core.io.support
Class LocalizedResourceHelper

java.lang.Object
    extended by  org.springframework.core.io.support.LocalizedResourceHelper

public class LocalizedResourceHelper
extends Object

Helper class for loading a localized resource, specified through name, extension and current locale.

Since:
1.2.5
Author:
Juergen Hoeller

Field Summary
static String DEFAULT_SEPARATOR
The default separator to use inbetween file name parts: an underscore
Constructor Summary
LocalizedResourceHelper()
Create a new LocalizedResourceHelper with a DefaultResourceLoader.
LocalizedResourceHelper(ResourceLoader resourceLoader)
Create a new LocalizedResourceHelper with the given ResourceLoader.
Method Summary
Resource | findLocalizedResource(String name, String extension, Locale locale) Find the most specific localized resource for the given name, extension and locale:
void | setSeparator(String separator) Set the separator to use inbetween file name parts.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_SEPARATOR

public static final String DEFAULT_SEPARATOR
The default separator to use inbetween file name parts: an underscore

See Also:
Constant Field Values
Constructor Detail

LocalizedResourceHelper

public LocalizedResourceHelper()
Create a new LocalizedResourceHelper with a DefaultResourceLoader.

See Also:
DefaultResourceLoader

LocalizedResourceHelper

public LocalizedResourceHelper(ResourceLoader resourceLoader)
Create a new LocalizedResourceHelper with the given ResourceLoader.

Parameters:
resourceLoader - the ResourceLoader to use
Method Detail

setSeparator

public void setSeparator(String separator)
Set the separator to use inbetween file name parts. Default is an underscore ("_").

findLocalizedResource

public Resource findLocalizedResource(String name,
                                      String extension,
                                      Locale locale)
Find the most specific localized resource for the given name, extension and locale:

The file will be searched with locations in the following order, similar to java.util.ResourceBundle's search order:

  • [name]_[language]_[country]_[variant][extension]
  • [name]_[language]_[country][extension]
  • [name]_[language][extension]
  • [name][extension]

If none of the specific files can be found, a resource descriptor for the default location will be returned.

Parameters:
name - the name of the file, without localization part nor extension
extension - the file extension (e.g. ".xls")
locale - the current locale (may be null)
Returns:
the most specific localized resource found
See Also:
ResourceBundle
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PathMatchingResourcePatternResolver

org.springframework.core.io.support
Class PathMatchingResourcePatternResolver

java.lang.Object
    extended by  org.springframework.core.io.support.PathMatchingResourcePatternResolver
All Implemented Interfaces:
ResourceLoader, ResourcePatternResolver
Direct Known Subclasses:
PortletContextResourcePatternResolver, ServletContextResourcePatternResolver
public class PathMatchingResourcePatternResolver
extends Object
implements ResourcePatternResolver

A ResourcePatternResolver implementation that is able to resolve a specified resource location path into one or more matching Resources. The source path may be a simple path which has a one-to-one mapping to a target Resource, or alternatively may contain the special "classpath*:" prefix and/or internal Ant-style regular expressions (matched using Spring's AntPathMatcher utility). Both of the latter are effectively wildcards.

No Wildcards:

In the simple case, if the specified location path does not start with the "classpath*:" prefix, and does not contain a PathMatcher pattern, this resolver will simply return a single resource via a getResource() call on the underlying ResourceLoader. Examples are real URLs such as "file:C:/context.xml", pseudo-URLs such as "classpath:/context.xml", and simple unprefixed paths such as "/WEB-INF/context.xml". The latter will resolve in a fashion specific to the underlying ResourceLoader (e.g. ServletContextResource for a WebApplicationContext).

Ant-style Patterns:

When the path location contains an Ant-style pattern, e.g.:

 /WEB-INF/*-context.xml
 com/mycompany/**/applicationContext.xml
 file:C:/some/path/*-context.xml
 classpath:com/mycompany/**/applicationContext.xml
the resolver follows a more complex but defined procedure to try to resolve the wildcard. It produces a Resource for the path up to the last non-wildcard segment and obtains a URL from it. If this URL is not a "jar:" URL or container-specific variant (e.g. "zip:" in WebLogic, "wsjar" in WebSphere", etc.), then a java.io.File is obtained from it, and used to resolve the wildcard by walking the filesystem. In the case of a jar URL, the resolver either gets a java.net.JarURLConnection from it, or manually parse the jar URL, and then traverse the contents of the jar file, to resolve the wildcards.

Implications on portability:

If the specified path is already a file URL (either explicitly, or implicitly because the base ResourceLoader is a filesystem one, then wildcarding is guaranteed to work in a completely portable fashion.

If the specified path is a classpath location, then the resolver must obtain the last non-wildcard path segment URL via a Classloader.getResource() call. Since this is just a node of the path (not the file at the end) it is actually undefined (in the ClassLoader Javadocs) exactly what sort of a URL is returned in this case. In practice, it is usually a java.io.File representing the directory, where the classpath resource resolves to a filesystem location, or a jar URL of some sort, where the classpath resource resolves to a jar location. Still, there is a portability concern on this operation.

If a jar URL is obtained for the last non-wildcard segment, the resolver must be able to get a java.net.JarURLConnection from it, or manually parse the jar URL, to be able to walk the contents of the jar, and resolve the wildcard. This will work in most environments, but will fail in others, and it is strongly recommended that the wildcard resolution of resources coming from jars be thoroughly tested in your specific environment before you rely on it.

classpath*: Prefix:

There is special support for retrieving multiple class path resources with the same name, via the "classpath*:" prefix. For example, "classpath*:META-INF/beans.xml" will find all "beans.xml" files in the class path, be it in "classes" directories or in JAR files. This is particularly useful for autodetecting config files of the same name at the same location within each jar file. Internally, this happens via a ClassLoader.getResources() call, and is completely portable.

The "classpath*:" prefix can also be combined with a PathMatcher pattern in the rest of the location path, for example "classpath*:META-INF/*-beans.xml". In this case, the resolution strategy is fairly simple: a ClassLoader.getResources() call is used on the last non-wildcard path segment to get all the matching resources in the class loader hierarchy, and then off each resource the same PathMatcher resolution strategy described above is used for the wildcard subpath.

Other notes:

WARNING: Note that "classpath*:" when combined with Ant-style patterns will only work reliably with at least one root directory before the pattern starts, unless the actual target files reside in the file system. This means that a pattern like "classpath*:*.xml" will not retrieve files from the root of jar files but rather only from the root of expanded directories. This originates from a limitation in the JDK's ClassLoader.getResources() method which only returns file system locations for a passed-in empty String (indicating potential roots to search).

WARNING: Ant-style patterns with "classpath:" resources are not guaranteed to find matching resources if the root package to search is available in multiple class path locations. This is because a resource such as

     com/mycompany/package1/service-context.xml
may be in only one location, but when a path such as
     classpath:com/mycompany/**/service-context.xml
is used to try to resolve it, the resolver will work off the (first) URL returned by getResource("com/mycompany");. If this base package node exists in multiple classloader locations, the actual end resource may not be underneath. Therefore, preferably, use "classpath*:" with the same Ant-style pattern in such a case, which will search all class path locations that contain the root package.

Since:
1.0.2
Author:
Juergen Hoeller, Colin Sampaleanu, Marius Bogoevici
See Also:
ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX, AntPathMatcher, ResourceLoader.getResource(String), ClassLoader.getResources(String)

Field Summary

Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX

Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX

Constructor Summary
PathMatchingResourcePatternResolver()
          Create a new PathMatchingResourcePatternResolver with a DefaultResourceLoader.
PathMatchingResourcePatternResolver(ClassLoader classLoader)
          Create a new PathMatchingResourcePatternResolver with a DefaultResourceLoader.
PathMatchingResourcePatternResolver(ResourceLoader resourceLoader)
          Create a new PathMatchingResourcePatternResolver.

Method Summary
protected Resource | convertClassLoaderURL(URL url) Convert the given URL as returned from the ClassLoader into a Resource object.
protected String | determineRootDir(String location) Determine the root directory for the given location.
protected Set<Resource> | doFindMatchingFileSystemResources(File rootDir, String subPattern) Find all resources in the file system that match the given location pattern via the Ant-style PathMatcher.
protected Set<Resource> | doFindPathMatchingFileResources(Resource rootDirResource, String subPattern) Find all resources in the file system that match the given location pattern via the Ant-style PathMatcher.
protected Set<Resource> | doFindPathMatchingJarResources(Resource rootDirResource, String subPattern) Find all resources in jar files that match the given location pattern via the Ant-style PathMatcher.
protected void | doRetrieveMatchingFiles(String fullPattern, File dir, Set<File> result) Recursively retrieve files that match the given pattern, adding them to the given result list.
protected Resource[] | findAllClassPathResources(String location) Find all class location resources with the given location via the ClassLoader.
protected Resource[] | findPathMatchingResources(String locationPattern) Find all resources that match the given location pattern via the Ant-style PathMatcher.
ClassLoader | getClassLoader() Return the ClassLoader that this pattern resolver works with (never null).
protected JarFile | getJarFile(String jarFileUrl) Resolve the given jar file URL into a JarFile object.
PathMatcher | getPathMatcher() Return the PathMatcher that this resource pattern resolver uses.
Resource | getResource(String location) Return a Resource handle for the specified resource.
ResourceLoader | getResourceLoader() Return the ResourceLoader that this pattern resolver works with.
Resource[] | getResources(String locationPattern) Resolve the given location pattern into Resource objects.
protected boolean | isJarResource(Resource resource) Return whether the given resource handle indicates a jar resource that the doFindPathMatchingJarResources method can handle.
protected Resource | resolveRootDirResource(Resource original) Resolve the specified resource for path matching.
protected Set<File> | retrieveMatchingFiles(File rootDir, String pattern) Retrieve files that match the given path pattern, checking the given directory and its subdirectories.
void | setPathMatcher(PathMatcher pathMatcher) Set the PathMatcher implementation to use for this resource pattern resolver.

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PathMatchingResourcePatternResolver

public PathMatchingResourcePatternResolver()
Create a new PathMatchingResourcePatternResolver with a DefaultResourceLoader.

ClassLoader access will happen via the thread context class loader.

See Also:
DefaultResourceLoader

PathMatchingResourcePatternResolver

public PathMatchingResourcePatternResolver(ClassLoader classLoader)
Create a new PathMatchingResourcePatternResolver with a DefaultResourceLoader.

Parameters:
classLoader - the ClassLoader to load classpath resources with, or null for using the thread context class loader at the time of actual resource access
See Also:
DefaultResourceLoader

PathMatchingResourcePatternResolver

public PathMatchingResourcePatternResolver(ResourceLoader resourceLoader)
Create a new PathMatchingResourcePatternResolver.

ClassLoader access will happen via the thread context class loader.

Parameters:
resourceLoader - the ResourceLoader to load root directories and actual resources with
Method Detail

getResourceLoader

public ResourceLoader getResourceLoader()
Return the ResourceLoader that this pattern resolver works with.

getClassLoader

public ClassLoader getClassLoader()
Return the ClassLoader that this pattern resolver works with (never null).

Specified by:
getClassLoader in interface ResourceLoader
Returns:
the ClassLoader (never null)

setPathMatcher

public void setPathMatcher(PathMatcher pathMatcher)
Set the PathMatcher implementation to use for this resource pattern resolver. Default is AntPathMatcher.

See Also:
AntPathMatcher

getPathMatcher

public PathMatcher getPathMatcher()
Return the PathMatcher that this resource pattern resolver uses.

getResource

public Resource getResource(String location)
Description copied from interface: ResourceLoader
Return a Resource handle for the specified resource. The handle should always be a reusable resource descriptor, allowing for multiple InputStreamSource.getInputStream() calls.

  • Must support fully qualified URLs, e.g. "file:C:/test.dat".
  • Must support classpath pseudo-URLs, e.g. "classpath:test.dat".
  • Should support relative file paths, e.g. "WEB-INF/test.dat". (This will be implementation-specific, typically provided by an ApplicationContext implementation.)

Note that a Resource handle does not imply an existing resource; you need to invoke Resource.exists() to check for existence.

Specified by:
getResource in interface ResourceLoader
Parameters:
location - the resource location
Returns:
a corresponding Resource handle
See Also:
ResourceLoader.CLASSPATH_URL_PREFIX, Resource.exists(), InputStreamSource.getInputStream()

getResources

public Resource[] getResources(String locationPattern)
                        throws IOException
Description copied from interface: ResourcePatternResolver
Resolve the given location pattern into Resource objects.

Overlapping resource entries that point to the same physical resource should be avoided, as far as possible. The result should have set semantics.

Specified by:
getResources in interface ResourcePatternResolver
Parameters:
locationPattern - the location pattern to resolve
Returns:
the corresponding Resource objects
Throws:
IOException - in case of I/O errors

findAllClassPathResources

protected Resource[] findAllClassPathResources(String location)
                                        throws IOException
Find all class location resources with the given location via the ClassLoader.

Parameters:
location - the absolute path within the classpath
Returns:
the result as Resource array
Throws:
IOException - in case of I/O errors
See Also:
ClassLoader.getResources(java.lang.String), convertClassLoaderURL(java.net.URL)

convertClassLoaderURL

protected Resource convertClassLoaderURL(URL url)
Convert the given URL as returned from the ClassLoader into a Resource object.

The default implementation simply creates a UrlResource instance.

Parameters:
url - a URL as returned from the ClassLoader
Returns:
the corresponding Resource object
See Also:
ClassLoader.getResources(java.lang.String), Resource

findPathMatchingResources

protected Resource[] findPathMatchingResources(String locationPattern)
                                        throws IOException
Find all resources that match the given location pattern via the Ant-style PathMatcher. Supports resources in jar files and zip files and in the file system.

Parameters:
locationPattern - the location pattern to match
Returns:
the result as Resource array
Throws:
IOException - in case of I/O errors
See Also:
doFindPathMatchingJarResources(org.springframework.core.io.Resource, java.lang.String), doFindPathMatchingFileResources(org.springframework.core.io.Resource, java.lang.String), PathMatcher

determineRootDir

protected String determineRootDir(String location)
Determine the root directory for the given location.

Used for determining the starting point for file matching, resolving the root directory location to a java.io.File and passing it into retrieveMatchingFiles, with the remainder of the location as pattern.

Will return "/WEB-INF/" for the pattern "/WEB-INF/*.xml", for example.

Parameters:
location - the location to check
Returns:
the part of the location that denotes the root directory
See Also:
retrieveMatchingFiles(java.io.File, java.lang.String)

resolveRootDirResource

protected Resource resolveRootDirResource(Resource original)
                                   throws IOException
Resolve the specified resource for path matching.

The default implementation detects an Equinox OSGi "bundleresource:" / "bundleentry:" URL and resolves it into a standard jar file URL that can be traversed using Spring's standard jar file traversal algorithm.

Parameters:
original - the resource to resolfe
Returns:
the resolved resource (may be identical to the passed-in resource)
Throws:
IOException - in case of resolution failure

isJarResource

protected boolean isJarResource(Resource resource)
                         throws IOException
Return whether the given resource handle indicates a jar resource that the doFindPathMatchingJarResources method can handle.

The default implementation checks against the URL protocols "jar", "zip" and "wsjar" (the latter are used by BEA WebLogic Server and IBM WebSphere, respectively, but can be treated like jar files).

Parameters:
resource - the resource handle to check (usually the root directory to start path matching from)
Throws:
IOException
See Also:
doFindPathMatchingJarResources(org.springframework.core.io.Resource, java.lang.String), ResourceUtils.isJarURL(java.net.URL)

doFindPathMatchingJarResources

protected Set<Resource> doFindPathMatchingJarResources(Resource rootDirResource,
                                                       String subPattern)
                                                throws IOException
Find all resources in jar files that match the given location pattern via the Ant-style PathMatcher.

Parameters:
rootDirResource - the root directory as Resource
subPattern - the sub pattern to match (below the root directory)
Returns:
the Set of matching Resource instances
Throws:
IOException - in case of I/O errors
See Also:
JarURLConnection, PathMatcher

getJarFile

protected JarFile getJarFile(String jarFileUrl)
                      throws IOException
Resolve the given jar file URL into a JarFile object.

Throws:
IOException

doFindPathMatchingFileResources

protected Set<Resource> doFindPathMatchingFileResources(Resource rootDirResource,
                                                        String subPattern)
                                                 throws IOException
Find all resources in the file system that match the given location pattern via the Ant-style PathMatcher.

Parameters:
rootDirResource - the root directory as Resource
subPattern - the sub pattern to match (below the root directory)
Returns:
the Set of matching Resource instances
Throws:
IOException - in case of I/O errors
See Also:
retrieveMatchingFiles(java.io.File, java.lang.String), PathMatcher

doFindMatchingFileSystemResources

protected Set<Resource> doFindMatchingFileSystemResources(File rootDir,
                                                          String subPattern)
                                                   throws IOException
Find all resources in the file system that match the given location pattern via the Ant-style PathMatcher.

Parameters:
rootDir - the root directory in the file system
subPattern - the sub pattern to match (below the root directory)
Returns:
the Set of matching Resource instances
Throws:
IOException - in case of I/O errors
See Also:
retrieveMatchingFiles(java.io.File, java.lang.String), PathMatcher

retrieveMatchingFiles

protected Set<File> retrieveMatchingFiles(File rootDir,
                                          String pattern)
                                   throws IOException
Retrieve files that match the given path pattern, checking the given directory and its subdirectories.

Parameters:
rootDir - the directory to start from
pattern - the pattern to match against, relative to the root directory
Returns:
the Set of matching File instances
Throws:
IOException - if directory contents could not be retrieved

doRetrieveMatchingFiles

protected void doRetrieveMatchingFiles(String fullPattern,
                                       File dir,
                                       Set<File> result)
                                throws IOException
Recursively retrieve files that match the given pattern, adding them to the given result list.

Parameters:
fullPattern - the pattern to match against, with preprended root directory path
dir - the current directory
result - the Set of matching File instances to add to
Throws:
IOException - if directory contents could not be retrieved
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


PropertiesLoaderSupport

org.springframework.core.io.support
Class PropertiesLoaderSupport

java.lang.Object
    extended by  org.springframework.core.io.support.PropertiesLoaderSupport
Direct Known Subclasses:
PropertiesFactoryBean, PropertyResourceConfigurer
public abstract class PropertiesLoaderSupport
extends Object

Base class for JavaBean-style components that need to load properties from one or more resources. Supports local properties as well, with configurable overriding.

Since:
1.2.2
Author:
Juergen Hoeller

Field Summary
protected Log | logger Logger available to subclasses
static String | XML_FILE_EXTENSION
Constructor Summary
PropertiesLoaderSupport()
Method Summary
protected void | loadProperties(Properties props) Load properties into the given instance.
protected Properties | mergeProperties() Return a merged Properties instance containing both the loaded properties and properties set on this FactoryBean.
void | setFileEncoding(String encoding) Set the encoding to use for parsing properties files.
void | setIgnoreResourceNotFound(boolean ignoreResourceNotFound) Set if failure to find the property resource should be ignored.
void | setLocalOverride(boolean localOverride) Set whether local properties override properties from files.
void | setLocation(Resource location) Set a location of a properties file to be loaded.
void | setLocations(Resource[] locations) Set locations of properties files to be loaded.
void | setProperties(Properties properties) Set local properties, e.g.
void | setPropertiesArray(Properties[] propertiesArray) Set local properties, e.g.
void | setPropertiesPersister(PropertiesPersister propertiesPersister) Set the PropertiesPersister to use for parsing properties files.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

XML_FILE_EXTENSION

public static final String XML_FILE_EXTENSION
See Also:
Constant Field Values

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

PropertiesLoaderSupport

public PropertiesLoaderSupport()
Method Detail

setProperties

public void setProperties(Properties properties)
Set local properties, e.g. via the "props" tag in XML bean definitions. These can be considered defaults, to be overridden by properties loaded from files.

setPropertiesArray

public void setPropertiesArray(Properties[] propertiesArray)
Set local properties, e.g. via the "props" tag in XML bean definitions, allowing for merging multiple properties sets into one.

setLocation

public void setLocation(Resource location)
Set a location of a properties file to be loaded.

Can point to a classic properties file or to an XML file that follows JDK 1.5's properties XML format.

setLocations

public void setLocations(Resource[] locations)
Set locations of properties files to be loaded.

Can point to classic properties files or to XML files that follow JDK 1.5's properties XML format.

Note: Properties defined in later files will override properties defined earlier files, in case of overlapping keys. Hence, make sure that the most specific files are the last ones in the given list of locations.

setLocalOverride

public void setLocalOverride(boolean localOverride)
Set whether local properties override properties from files.

Default is "false": Properties from files override local defaults. Can be switched to "true" to let local properties override defaults from files.

setIgnoreResourceNotFound

public void setIgnoreResourceNotFound(boolean ignoreResourceNotFound)
Set if failure to find the property resource should be ignored.

"true" is appropriate if the properties file is completely optional. Default is "false".

setFileEncoding

public void setFileEncoding(String encoding)
Set the encoding to use for parsing properties files.

Default is none, using the java.util.Properties default encoding.

Only applies to classic properties files, not to XML files.

See Also:
PropertiesPersister.load(java.util.Properties, java.io.InputStream)

setPropertiesPersister

public void setPropertiesPersister(PropertiesPersister propertiesPersister)
Set the PropertiesPersister to use for parsing properties files. The default is DefaultPropertiesPersister.

See Also:
DefaultPropertiesPersister

mergeProperties

protected Properties mergeProperties()
                              throws IOException
Return a merged Properties instance containing both the loaded properties and properties set on this FactoryBean.

Throws:
IOException

loadProperties

protected void loadProperties(Properties props)
                       throws IOException
Load properties into the given instance.

Parameters:
props - the Properties instance to load into
Throws:
IOException - in case of I/O errors
See Also:
setLocations(org.springframework.core.io.Resource[])
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertiesLoaderUtils

org.springframework.core.io.support
Class PropertiesLoaderUtils

java.lang.Object
    extended by  org.springframework.core.io.support.PropertiesLoaderUtils

public abstract class PropertiesLoaderUtils
extends Object

Convenient utility methods for loading of java.util.Properties, performing standard handling of input streams.

For more configurable properties loading, including the option of a customized encoding, consider using the PropertiesLoaderSupport class.

Since:
2.0
Author:
Juergen Hoeller, Rob Harrop
See Also:
PropertiesLoaderSupport

Constructor Summary
PropertiesLoaderUtils()
Method Summary
static void | fillProperties(Properties props, Resource resource) Fill the given properties from the given resource.
static Properties | loadAllProperties(String resourceName) Load all properties from the given class path resource, using the default class loader.
static Properties | loadAllProperties(String resourceName, ClassLoader classLoader) Load all properties from the given class path resource, using the given class loader.
static Properties | loadProperties(Resource resource) Load properties from the given resource.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PropertiesLoaderUtils

public PropertiesLoaderUtils()
Method Detail

loadProperties

public static Properties loadProperties(Resource resource)
                                 throws IOException
Load properties from the given resource.

Parameters:
resource - the resource to load from
Returns:
the populated Properties instance
Throws:
IOException - if loading failed

fillProperties

public static void fillProperties(Properties props,
                                  Resource resource)
                           throws IOException
Fill the given properties from the given resource.

Parameters:
props - the Properties instance to fill
resource - the resource to load from
Throws:
IOException - if loading failed

loadAllProperties

public static Properties loadAllProperties(String resourceName)
                                    throws IOException
Load all properties from the given class path resource, using the default class loader.

Merges properties if more than one resource of the same name found in the class path.

Parameters:
resourceName - the name of the class path resource
Returns:
the populated Properties instance
Throws:
IOException - if loading failed

loadAllProperties

public static Properties loadAllProperties(String resourceName,
                                           ClassLoader classLoader)
                                    throws IOException
Load all properties from the given class path resource, using the given class loader.

Merges properties if more than one resource of the same name found in the class path.

Parameters:
resourceName - the name of the class path resource
classLoader - the ClassLoader to use for loading (or null to use the default class loader)
Returns:
the populated Properties instance
Throws:
IOException - if loading failed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResourceArrayPropertyEditor

org.springframework.core.io.support
Class ResourceArrayPropertyEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.core.io.support.ResourceArrayPropertyEditor
All Implemented Interfaces:
PropertyEditor
public class ResourceArrayPropertyEditor
extends PropertyEditorSupport

Editor for Resource arrays, to automatically convert String location patterns (e.g. "file:C:/my*.txt" or "classpath*:myfile.txt") to Resource array properties. Can also translate a collection or array of location patterns into a merged Resource array.

The path may contain ${...} placeholders, to be resolved as system properties: e.g. ${user.dir}. Unresolvable placeholder are ignored by default.

Delegates to a ResourcePatternResolver, by default using a PathMatchingResourcePatternResolver.

Since:
1.1.2
Author:
Juergen Hoeller
See Also:
Resource, ResourcePatternResolver, PathMatchingResourcePatternResolver, SystemPropertyUtils.resolvePlaceholders(java.lang.String), System.getProperty(String)

Constructor Summary
ResourceArrayPropertyEditor()
Create a new ResourceArrayPropertyEditor with a default PathMatchingResourcePatternResolver.
ResourceArrayPropertyEditor(ResourcePatternResolver resourcePatternResolver)
Create a new ResourceArrayPropertyEditor with the given ResourcePatternResolver.
ResourceArrayPropertyEditor(ResourcePatternResolver resourcePatternResolver, boolean ignoreUnresolvablePlaceholders)
Create a new ResourceArrayPropertyEditor with the given ResourcePatternResolver.
Method Summary
protected String | resolvePath(String path) Resolve the given path, replacing placeholders with corresponding system property values if necessary.
void | setAsText(String text) Treat the given text as location pattern and convert it to a Resource array.
void | setValue(Object value) Treat the given value as collection or array and convert it to a Resource array.
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getAsText, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ResourceArrayPropertyEditor

public ResourceArrayPropertyEditor()
Create a new ResourceArrayPropertyEditor with a default PathMatchingResourcePatternResolver.

See Also:
PathMatchingResourcePatternResolver

ResourceArrayPropertyEditor

public ResourceArrayPropertyEditor(ResourcePatternResolver resourcePatternResolver)
Create a new ResourceArrayPropertyEditor with the given ResourcePatternResolver.

Parameters:
resourcePatternResolver - the ResourcePatternResolver to use

ResourceArrayPropertyEditor

public ResourceArrayPropertyEditor(ResourcePatternResolver resourcePatternResolver,
                                   boolean ignoreUnresolvablePlaceholders)
Create a new ResourceArrayPropertyEditor with the given ResourcePatternResolver.

Parameters:
resourcePatternResolver - the ResourcePatternResolver to use
ignoreUnresolvablePlaceholders - whether to ignore unresolvable placeholders if no corresponding system property could be found
Method Detail

setAsText

public void setAsText(String text)
Treat the given text as location pattern and convert it to a Resource array.

Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport

setValue

public void setValue(Object value)
              throws IllegalArgumentException
Treat the given value as collection or array and convert it to a Resource array. Considers String elements as location patterns, and takes Resource elements as-is.

Specified by:
setValue in interface PropertyEditor
Overrides:
setValue in class PropertyEditorSupport
Throws:
IllegalArgumentException

resolvePath

protected String resolvePath(String path)
Resolve the given path, replacing placeholders with corresponding system property values if necessary.

Parameters:
path - the original file path
Returns:
the resolved file path
See Also:
SystemPropertyUtils.resolvePlaceholders(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResourcePatternUtils

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.core.io.support
Class ResourcePatternUtils

java.lang.Object
    extended by  org.springframework.core.io.support.ResourcePatternUtils

public abstract class ResourcePatternUtils
extends Object

Utility class for determining whether a given URL is a resource location that can be loaded via a ResourcePatternResolver.

Callers will usually assume that a location is a relative path if the isUrl(String) method returns false.

Since:
1.2.3
Author:
Juergen Hoeller

Constructor Summary
ResourcePatternUtils()
Method Summary
static ResourcePatternResolver | getResourcePatternResolver(ResourceLoader resourceLoader) Return a default ResourcePatternResolver for the given ResourceLoader.
static boolean | isUrl(String resourceLocation) Return whether the given resource location is a URL: either a special "classpath" or "classpath*" pseudo URL or a standard URL.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ResourcePatternUtils

public ResourcePatternUtils()
Method Detail

isUrl

public static boolean isUrl(String resourceLocation)
Return whether the given resource location is a URL: either a special "classpath" or "classpath*" pseudo URL or a standard URL.

Parameters:
resourceLocation - the location String to check
Returns:
whether the location qualifies as a URL
See Also:
ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX, ResourceUtils.CLASSPATH_URL_PREFIX, ResourceUtils.isUrl(String), URL

getResourcePatternResolver

public static ResourcePatternResolver getResourcePatternResolver(ResourceLoader resourceLoader)
Return a default ResourcePatternResolver for the given ResourceLoader.

This might be the ResourceLoader itself, if it implements the ResourcePatternResolver extension, or a PathMatchingResourcePatternResolver built on the given ResourceLoader.

Parameters:
resourceLoader - the ResourceLoader to build a pattern resolver for (may be null to indicate a default ResourceLoader)
Returns:
the ResourcePatternResolver
See Also:
PathMatchingResourcePatternResolver
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.core.style

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.core.style

Support for styling values as Strings, with ToStringCreator as central class.

See:
Description

Interface Summary
ToStringStyler | A strategy interface for pretty-printing toString() methods.
ValueStyler | Strategy that encapsulates value String styling algorithms according to Spring conventions.

Class Summary
DefaultToStringStyler | Spring's default toString() styler.
DefaultValueStyler | Converts objects to String form, generally for debugging purposes, using Spring's toString styling conventions.
StylerUtils | Simple utility class to allow for convenient access to value styling logic, mainly to support descriptive logging messages.
ToStringCreator | Utility class that builds pretty-printing toString() methods with pluggable styling conventions.

Package org.springframework.core.style Description

Support for styling values as Strings, with ToStringCreator as central class.


org.springframework.core.style Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.core.style

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.core.style.DefaultToStringStyler (implements org.springframework.core.style.ToStringStyler)
    • org.springframework.core.style.DefaultValueStyler (implements org.springframework.core.style.ValueStyler)
    • org.springframework.core.style.StylerUtils
    • org.springframework.core.style.ToStringCreator

Interface Hierarchy

  • org.springframework.core.style.ToStringStyler
  • org.springframework.core.style.ValueStyler


ToStringStyler

org.springframework.core.style
Interface ToStringStyler

All Known Implementing Classes:
DefaultToStringStyler
public interface ToStringStyler

A strategy interface for pretty-printing toString() methods. Encapsulates the print algorithms; some other object such as a builder should provide the workflow.

Since:
1.2.2
Author:
Keith Donald

Method Summary
 void styleEnd(StringBuilder buffer, Object obj)
Style a toString()'ed object after it's fields are styled.
 void styleField(StringBuilder buffer, String fieldName, Object value)
Style a field value as a string.
 void styleFieldSeparator(StringBuilder buffer)
Style the field separator.
 void styleStart(StringBuilder buffer, Object obj)
Style a toString()'ed object before its fields are styled.
 void styleValue(StringBuilder buffer, Object value)
Style the given value.

Method Detail

styleStart

void styleStart(StringBuilder buffer,
                Object obj)
Style a toString()'ed object before its fields are styled.

Parameters:
buffer - the buffer to print to
obj - the object to style

styleEnd

void styleEnd(StringBuilder buffer,
              Object obj)
Style a toString()'ed object after it's fields are styled.

Parameters:
buffer - the buffer to print to
obj - the object to style

styleField

void styleField(StringBuilder buffer,
                String fieldName,
                Object value)
Style a field value as a string.

Parameters:
buffer - the buffer to print to
fieldName - the he name of the field
value - the field value

styleValue

void styleValue(StringBuilder buffer,
                Object value)
Style the given value.

Parameters:
buffer - the buffer to print to
value - the field value

styleFieldSeparator

void styleFieldSeparator(StringBuilder buffer)
Style the field separator.

Parameters:
buffer - buffer to print to
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ValueStyler

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.core.style
Interface ValueStyler

All Known Implementing Classes:
DefaultValueStyler
public interface ValueStyler

Strategy that encapsulates value String styling algorithms according to Spring conventions.

Since:
1.2.2
Author:
Keith Donald

Method Summary
 String style(Object value)
Style the given value, returning a String representation.

Method Detail

style

String style(Object value)
Style the given value, returning a String representation.

Parameters:
value - the Object value to style
Returns:
the styled String
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


DefaultToStringStyler

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.core.style
Class DefaultToStringStyler

java.lang.Object
    extended by  org.springframework.core.style.DefaultToStringStyler
All Implemented Interfaces:
ToStringStyler
public class DefaultToStringStyler
extends Object
implements ToStringStyler

Spring's default toString() styler.

This class is used by ToStringCreator to style toString() output in a consistent manner according to Spring conventions.

Since:
1.2.2
Author:
Keith Donald, Juergen Hoeller

Constructor Summary
DefaultToStringStyler(ValueStyler valueStyler)
Create a new DefaultToStringStyler.
Method Summary
protected  ValueStyler getValueStyler()
Return the ValueStyler used by this ToStringStyler.
 void styleEnd(StringBuilder buffer, Object o)
Style a toString()'ed object after it's fields are styled.
 void styleField(StringBuilder buffer, String fieldName, Object value)
Style a field value as a string.
protected  void styleFieldEnd(StringBuilder buffer, String fieldName)
 void styleFieldSeparator(StringBuilder buffer)
Style the field separator.
protected  void styleFieldStart(StringBuilder buffer, String fieldName)
 void styleStart(StringBuilder buffer, Object obj)
Style a toString()'ed object before its fields are styled.
 void styleValue(StringBuilder buffer, Object value)
Style the given value.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DefaultToStringStyler

public DefaultToStringStyler(ValueStyler valueStyler)
Create a new DefaultToStringStyler.

Parameters:
valueStyler - the ValueStyler to use
Method Detail

getValueStyler

protected final ValueStyler getValueStyler()
Return the ValueStyler used by this ToStringStyler.

styleStart

public void styleStart(StringBuilder buffer,
                       Object obj)
Description copied from interface: ToStringStyler
Style a toString()'ed object before its fields are styled.

Specified by:
styleStart in interface ToStringStyler
Parameters:
buffer - the buffer to print to
obj - the object to style

styleEnd

public void styleEnd(StringBuilder buffer,
                     Object o)
Description copied from interface: ToStringStyler
Style a toString()'ed object after it's fields are styled.

Specified by:
styleEnd in interface ToStringStyler
Parameters:
buffer - the buffer to print to
o - the object to style

styleField

public void styleField(StringBuilder buffer,
                       String fieldName,
                       Object value)
Description copied from interface: ToStringStyler
Style a field value as a string.

Specified by:
styleField in interface ToStringStyler
Parameters:
buffer - the buffer to print to
fieldName - the he name of the field
value - the field value

styleFieldStart

protected void styleFieldStart(StringBuilder buffer,
                               String fieldName)

styleFieldEnd

protected void styleFieldEnd(StringBuilder buffer,
                             String fieldName)

styleValue

public void styleValue(StringBuilder buffer,
                       Object value)
Description copied from interface: ToStringStyler
Style the given value.

Specified by:
styleValue in interface ToStringStyler
Parameters:
buffer - the buffer to print to
value - the field value

styleFieldSeparator

public void styleFieldSeparator(StringBuilder buffer)
Description copied from interface: ToStringStyler
Style the field separator.

Specified by:
styleFieldSeparator in interface ToStringStyler
Parameters:
buffer - buffer to print to
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


DefaultValueStyler

org.springframework.core.style
Class DefaultValueStyler

java.lang.Object
    extended by  org.springframework.core.style.DefaultValueStyler
All Implemented Interfaces:
ValueStyler
public class DefaultValueStyler
extends Object
implements ValueStyler

Converts objects to String form, generally for debugging purposes, using Spring's toString styling conventions.

Uses the reflective visitor pattern underneath the hood to nicely encapsulate styling algorithms for each type of styled object.

Since:
1.2.2
Author:
Keith Donald, Juergen Hoeller

Constructor Summary
DefaultValueStyler()
Method Summary
 String style(Object value)
Style the given value, returning a String representation.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DefaultValueStyler

public DefaultValueStyler()
Method Detail

style

public String style(Object value)
Description copied from interface: ValueStyler
Style the given value, returning a String representation.

Specified by:
style in interface ValueStyler
Parameters:
value - the Object value to style
Returns:
the styled String
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StylerUtils

org.springframework.core.style
Class StylerUtils

java.lang.Object
    extended by  org.springframework.core.style.StylerUtils

public abstract class StylerUtils
extends Object

Simple utility class to allow for convenient access to value styling logic, mainly to support descriptive logging messages.

For more sophisticated needs, use the ValueStyler abstraction directly. This class simply uses a shared DefaultValueStyler instance underneath.

Since:
1.2.2
Author:
Keith Donald
See Also:
ValueStyler, DefaultValueStyler

Constructor Summary
StylerUtils()
Method Summary
static String style(Object value)
Style the specified value according to default conventions.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

StylerUtils

public StylerUtils()
Method Detail

style

public static String style(Object value)
Style the specified value according to default conventions.

Parameters:
value - the Object value to style
Returns:
the styled String
See Also:
DefaultValueStyler
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ToStringCreator

org.springframework.core.style
Class ToStringCreator

java.lang.Object
    extended by  org.springframework.core.style.ToStringCreator

public class ToStringCreator
extends Object

Utility class that builds pretty-printing toString() methods with pluggable styling conventions. By default, ToStringCreator adheres to Spring's toString() styling conventions.

Since:
1.2.2
Author:
Keith Donald, Juergen Hoeller

Constructor Summary
ToStringCreator(Object obj)
Create a ToStringCreator for the given object.
ToStringCreator(Object obj, ToStringStyler styler)
Create a ToStringCreator for the given object, using the provided style.
ToStringCreator(Object obj, ValueStyler styler)
Create a ToStringCreator for the given object, using the provided style.
Method Summary
ToStringCreator | append(Object value) Append the provided value.
ToStringCreator | append(String fieldName, boolean value) Append a boolean field value.
ToStringCreator | append(String fieldName, byte value) Append a byte field value.
ToStringCreator | append(String fieldName, double value) Append a double field value.
ToStringCreator | append(String fieldName, float value) Append a float field value.
ToStringCreator | append(String fieldName, int value) Append a integer field value.
ToStringCreator | append(String fieldName, long value) Append a long field value.
ToStringCreator | append(String fieldName, Object value) Append a field value.
ToStringCreator | append(String fieldName, short value) Append a short field value.
String | toString() Return the String representation that this ToStringCreator built.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ToStringCreator

public ToStringCreator(Object obj)
Create a ToStringCreator for the given object.

Parameters:
obj - the object to be stringified

ToStringCreator

public ToStringCreator(Object obj,
                       ValueStyler styler)
Create a ToStringCreator for the given object, using the provided style.

Parameters:
obj - the object to be stringified
styler - the ValueStyler encapsulating pretty-print instructions

ToStringCreator

public ToStringCreator(Object obj,
                       ToStringStyler styler)
Create a ToStringCreator for the given object, using the provided style.

Parameters:
obj - the object to be stringified
styler - the ToStringStyler encapsulating pretty-print instructions
Method Detail

append

public ToStringCreator append(String fieldName,
                              byte value)
Append a byte field value.

Parameters:
fieldName - the name of the field, usually the member variable name
value - the field value
Returns:
this, to support call-chaining

append

public ToStringCreator append(String fieldName,
                              short value)
Append a short field value.

Parameters:
fieldName - the name of the field, usually the member variable name
value - the field value
Returns:
this, to support call-chaining

append

public ToStringCreator append(String fieldName,
                              int value)
Append a integer field value.

Parameters:
fieldName - the name of the field, usually the member variable name
value - the field value
Returns:
this, to support call-chaining

append

public ToStringCreator append(String fieldName,
                              long value)
Append a long field value.

Parameters:
fieldName - the name of the field, usually the member variable name
value - the field value
Returns:
this, to support call-chaining

append

public ToStringCreator append(String fieldName,
                              float value)
Append a float field value.

Parameters:
fieldName - the name of the field, usually the member variable name
value - the field value
Returns:
this, to support call-chaining

append

public ToStringCreator append(String fieldName,
                              double value)
Append a double field value.

Parameters:
fieldName - the name of the field, usually the member variable name
value - the field value
Returns:
this, to support call-chaining

append

public ToStringCreator append(String fieldName,
                              boolean value)
Append a boolean field value.

Parameters:
fieldName - the name of the field, usually the member variable name
value - the field value
Returns:
this, to support call-chaining

append

public ToStringCreator append(String fieldName,
                              Object value)
Append a field value.

Parameters:
fieldName - the name of the field, usually the member variable name
value - the field value
Returns:
this, to support call-chaining

append

public ToStringCreator append(Object value)
Append the provided value.

Parameters:
value - The value to append
Returns:
this, to support call-chaining.

toString

public String toString()
Return the String representation that this ToStringCreator built.

Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.core.task

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.core.task

This package defines Spring's core TaskExecutor abstraction, and provides SyncTaskExecutor and SimpleAsyncTaskExecutor implementations.

See:
Description

Interface Summary
AsyncTaskExecutor | Extended interface for asynchronous TaskExecutor implementations, offering an overloaded AsyncTaskExecutor.execute(Runnable, long) variant with a start timeout parameter as well support for Callable.
TaskExecutor | Simple task executor interface that abstracts the execution of a Runnable.

Class Summary
SimpleAsyncTaskExecutor | TaskExecutor implementation that fires up a new Thread for each task, executing it asynchronously.
SyncTaskExecutor | TaskExecutor implementation that executes each task synchronously in the calling thread.

Exception Summary
TaskRejectedException | Exception thrown when a TaskExecutor rejects to accept a given task for execution.
TaskTimeoutException | Exception thrown when a AsyncTaskExecutor rejects to accept a given task for execution because of the specified timeout.

Package org.springframework.core.task Description

This package defines Spring's core TaskExecutor abstraction, and provides SyncTaskExecutor and SimpleAsyncTaskExecutor implementations.


org.springframework.core.task Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.core.task

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.util.CustomizableThreadCreator (implements java.io.Serializable)
      • org.springframework.core.task.SimpleAsyncTaskExecutor (implements org.springframework.core.task.AsyncTaskExecutor, java.io.Serializable)
    • org.springframework.core.task.SyncTaskExecutor (implements java.io.Serializable, org.springframework.core.task.TaskExecutor)
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • java.util.concurrent.RejectedExecutionException
            • org.springframework.core.task.TaskRejectedException
              • org.springframework.core.task.TaskTimeoutException

Interface Hierarchy

  • java.util.concurrent.Executor
    • org.springframework.core.task.TaskExecutor
      • org.springframework.core.task.AsyncTaskExecutor


AsyncTaskExecutor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.core.task
Interface AsyncTaskExecutor

All Superinterfaces:
Executor, TaskExecutor
All Known Subinterfaces:
SchedulingTaskExecutor
All Known Implementing Classes:
ConcurrentTaskExecutor, ConcurrentTaskExecutor, ConcurrentTaskScheduler, GlassFishWorkManagerTaskExecutor, JBossWorkManagerTaskExecutor, SimpleAsyncTaskExecutor, SimpleThreadPoolTaskExecutor, TaskExecutorAdapter, ThreadPoolTaskExecutor, ThreadPoolTaskExecutor, ThreadPoolTaskScheduler, TimerTaskExecutor, WorkManagerTaskExecutor, WorkManagerTaskExecutor
public interface AsyncTaskExecutor
extends TaskExecutor

Extended interface for asynchronous TaskExecutor implementations, offering an overloaded execute(Runnable, long) variant with a start timeout parameter as well support for Callable.

Note: The Executors class includes a set of methods that can convert some other common closure-like objects, for example, PrivilegedAction to Callable before executing them.

Implementing this interface also indicates that the TaskExecutor.execute(Runnable) method will not execute its Runnable in the caller's thread but rather asynchronously in some other thread.

Since:
2.0.3
Author:
Juergen Hoeller
See Also:
SimpleAsyncTaskExecutor, SchedulingTaskExecutor, Callable, Executors

Field Summary
static long | TIMEOUT_IMMEDIATE Constant that indicates immediate execution
static long | TIMEOUT_INDEFINITE Constant that indicates no time limit
Method Summary
 void execute(Runnable task, long startTimeout)
Execute the given task.
<T> Future<T>
submit(Callable<T> task)
Submit a Callable task for execution, receiving a Future representing that task.
 Future<?> submit(Runnable task)
Submit a Runnable task for execution, receiving a Future representing that task.
Methods inherited from interface org.springframework.core.task.TaskExecutor
execute

Field Detail

TIMEOUT_IMMEDIATE

static final long TIMEOUT_IMMEDIATE
Constant that indicates immediate execution

See Also:
Constant Field Values

TIMEOUT_INDEFINITE

static final long TIMEOUT_INDEFINITE
Constant that indicates no time limit

See Also:
Constant Field Values
Method Detail

execute

void execute(Runnable task,
             long startTimeout)
Execute the given task.

Parameters:
task - the Runnable to execute (never null)
startTimeout - the time duration (milliseconds) within which the task is supposed to start. This is intended as a hint to the executor, allowing for preferred handling of immediate tasks. Typical values are TIMEOUT_IMMEDIATE or TIMEOUT_INDEFINITE (the default as used by TaskExecutor.execute(Runnable)).
Throws:
TaskTimeoutException - in case of the task being rejected because of the timeout (i.e. it cannot be started in time)
TaskRejectedException - if the given task was not accepted

submit

Future<?> submit(Runnable task)
Submit a Runnable task for execution, receiving a Future representing that task. The Future will return a null result upon completion.

Parameters:
task - the Runnable to execute (never null)
Returns:
a Future representing pending completion of the task
Throws:
TaskRejectedException - if the given task was not accepted

submit

<T> Future<T> submit(Callable<T> task)
Submit a Callable task for execution, receiving a Future representing that task. The Future will return the Callable's result upon completion.

Parameters:
task - the Callable to execute (never null)
Returns:
a Future representing pending completion of the task
Throws:
TaskRejectedException - if the given task was not accepted
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


TaskExecutor

org.springframework.core.task
Interface TaskExecutor

All Superinterfaces:
Executor
All Known Subinterfaces:
AsyncTaskExecutor, SchedulingTaskExecutor
All Known Implementing Classes:
ConcurrentTaskExecutor, ConcurrentTaskExecutor, ConcurrentTaskScheduler, GlassFishWorkManagerTaskExecutor, JBossWorkManagerTaskExecutor, SimpleAsyncTaskExecutor, SimpleThreadPoolTaskExecutor, SyncTaskExecutor, TaskExecutorAdapter, ThreadPoolTaskExecutor, ThreadPoolTaskExecutor, ThreadPoolTaskScheduler, TimerTaskExecutor, WorkManagerTaskExecutor, WorkManagerTaskExecutor
public interface TaskExecutor
extends Executor

Simple task executor interface that abstracts the execution of a Runnable.

Implementations can use all sorts of different execution strategies, such as: synchronous, asynchronous, using a thread pool, and more.

Equivalent to JDK 1.5's Executor interface; extending it now in Spring 3.0, so that clients may declare a dependency on an Executor and receive any TaskExecutor implementation. This interface remains separate from the standard Executor interface mainly for backwards compatibility with JDK 1.4 in Spring 2.x.

Since:
2.0
Author:
Juergen Hoeller
See Also:
Executor

Method Summary
 void execute(Runnable task)
Execute the given task.

Method Detail

execute

void execute(Runnable task)
Execute the given task.

The call might return immediately if the implementation uses an asynchronous execution strategy, or might block in the case of synchronous execution.

Specified by:
execute in interface Executor
Parameters:
task - the Runnable to execute (never null)
Throws:
TaskRejectedException - if the given task was not accepted
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleAsyncTaskExecutor

org.springframework.core.task
Class SimpleAsyncTaskExecutor

java.lang.Object
    extended by  org.springframework.util.CustomizableThreadCreator
        extended by  org.springframework.core.task.SimpleAsyncTaskExecutor
All Implemented Interfaces:
Serializable, Executor, AsyncTaskExecutor, TaskExecutor
public class SimpleAsyncTaskExecutor
extends CustomizableThreadCreator
implements AsyncTaskExecutor, Serializable

TaskExecutor implementation that fires up a new Thread for each task, executing it asynchronously.

Supports limiting concurrent threads through the "concurrencyLimit" bean property. By default, the number of concurrent threads is unlimited.

NOTE: This implementation does not reuse threads! Consider a thread-pooling TaskExecutor implementation instead, in particular for executing a large number of short-lived tasks.

Since:
2.0
Author:
Juergen Hoeller
See Also:
setConcurrencyLimit(int), SyncTaskExecutor, ThreadPoolTaskExecutor, WorkManagerTaskExecutor, Serialized Form

Field Summary
static int | NO_CONCURRENCY Switch concurrency 'off': that is, don't allow any concurrent invocations.
static int | UNBOUNDED_CONCURRENCY Permit any number of concurrent invocations: that is, don't throttle concurrency.
Fields inherited from interface org.springframework.core.task.AsyncTaskExecutor
TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE
Constructor Summary
SimpleAsyncTaskExecutor()
Create a new SimpleAsyncTaskExecutor with default thread name prefix.
SimpleAsyncTaskExecutor(String threadNamePrefix)
Create a new SimpleAsyncTaskExecutor with the given thread name prefix.
SimpleAsyncTaskExecutor(ThreadFactory threadFactory)
Create a new SimpleAsyncTaskExecutor with the given external thread factory.
Method Summary
protected  void doExecute(Runnable task)
Template method for the actual execution of a task.
 void execute(Runnable task)
Executes the given task, within a concurrency throttle if configured (through the superclass's settings).
 void execute(Runnable task, long startTimeout)
Executes the given task, within a concurrency throttle if configured (through the superclass's settings).
 int getConcurrencyLimit()
Return the maximum number of parallel accesses allowed.
 ThreadFactory getThreadFactory()
Return the external factory to use for creating new Threads, if any.
 boolean isThrottleActive()
Return whether this throttle is currently active.
 void setConcurrencyLimit(int concurrencyLimit)
Set the maximum number of parallel accesses allowed.
 void setThreadFactory(ThreadFactory threadFactory)
Specify an external factory to use for creating new Threads, instead of relying on the local properties of this executor.
<T> Future<T>
submit(Callable<T> task)
Submit a Callable task for execution, receiving a Future representing that task.
 Future<?> submit(Runnable task)
Submit a Runnable task for execution, receiving a Future representing that task.
Methods inherited from class org.springframework.util.CustomizableThreadCreator
createThread, getDefaultThreadNamePrefix, getThreadGroup, getThreadNamePrefix, getThreadPriority, isDaemon, nextThreadName, setDaemon, setThreadGroup, setThreadGroupName, setThreadNamePrefix, setThreadPriority
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

UNBOUNDED_CONCURRENCY

public static final int UNBOUNDED_CONCURRENCY
Permit any number of concurrent invocations: that is, don't throttle concurrency.

See Also:
Constant Field Values

NO_CONCURRENCY

public static final int NO_CONCURRENCY
Switch concurrency 'off': that is, don't allow any concurrent invocations.

See Also:
Constant Field Values
Constructor Detail

SimpleAsyncTaskExecutor

public SimpleAsyncTaskExecutor()
Create a new SimpleAsyncTaskExecutor with default thread name prefix.

SimpleAsyncTaskExecutor

public SimpleAsyncTaskExecutor(String threadNamePrefix)
Create a new SimpleAsyncTaskExecutor with the given thread name prefix.

Parameters:
threadNamePrefix - the prefix to use for the names of newly created threads

SimpleAsyncTaskExecutor

public SimpleAsyncTaskExecutor(ThreadFactory threadFactory)
Create a new SimpleAsyncTaskExecutor with the given external thread factory.

Parameters:
threadFactory - the factory to use for creating new Threads
Method Detail

setThreadFactory

public void setThreadFactory(ThreadFactory threadFactory)
Specify an external factory to use for creating new Threads, instead of relying on the local properties of this executor.

You may specify an inner ThreadFactory bean or also a ThreadFactory reference obtained from JNDI (on a Java EE 6 server) or some other lookup mechanism.

See Also:
CustomizableThreadCreator.setThreadNamePrefix(java.lang.String), CustomizableThreadCreator.setThreadPriority(int)

getThreadFactory

public final ThreadFactory getThreadFactory()
Return the external factory to use for creating new Threads, if any.

setConcurrencyLimit

public void setConcurrencyLimit(int concurrencyLimit)
Set the maximum number of parallel accesses allowed. -1 indicates no concurrency limit at all.

In principle, this limit can be changed at runtime, although it is generally designed as a config time setting. NOTE: Do not switch between -1 and any concrete limit at runtime, as this will lead to inconsistent concurrency counts: A limit of -1 effectively turns off concurrency counting completely.

See Also:
UNBOUNDED_CONCURRENCY

getConcurrencyLimit

public final int getConcurrencyLimit()
Return the maximum number of parallel accesses allowed.

isThrottleActive

public final boolean isThrottleActive()
Return whether this throttle is currently active.

Returns:
true if the concurrency limit for this instance is active
See Also:
getConcurrencyLimit(), setConcurrencyLimit(int)

execute

public void execute(Runnable task)
Executes the given task, within a concurrency throttle if configured (through the superclass's settings).

Specified by:
execute in interface Executor
Specified by:
execute in interface TaskExecutor
Parameters:
task - the Runnable to execute (never null)
See Also:
doExecute(Runnable)

execute

public void execute(Runnable task,
                    long startTimeout)
Executes the given task, within a concurrency throttle if configured (through the superclass's settings).

Executes urgent tasks (with 'immediate' timeout) directly, bypassing the concurrency throttle (if active). All other tasks are subject to throttling.

Specified by:
execute in interface AsyncTaskExecutor
Parameters:
task - the Runnable to execute (never null)
startTimeout - the time duration (milliseconds) within which the task is supposed to start. This is intended as a hint to the executor, allowing for preferred handling of immediate tasks. Typical values are AsyncTaskExecutor.TIMEOUT_IMMEDIATE or AsyncTaskExecutor.TIMEOUT_INDEFINITE (the default as used by TaskExecutor.execute(Runnable)).
See Also:
AsyncTaskExecutor.TIMEOUT_IMMEDIATE, doExecute(Runnable)

submit

public Future<?> submit(Runnable task)
Description copied from interface: AsyncTaskExecutor
Submit a Runnable task for execution, receiving a Future representing that task. The Future will return a null result upon completion.

Specified by:
submit in interface AsyncTaskExecutor
Parameters:
task - the Runnable to execute (never null)
Returns:
a Future representing pending completion of the task

submit

public <T> Future<T> submit(Callable<T> task)
Description copied from interface: AsyncTaskExecutor
Submit a Callable task for execution, receiving a Future representing that task. The Future will return the Callable's result upon completion.

Specified by:
submit in interface AsyncTaskExecutor
Parameters:
task - the Callable to execute (never null)
Returns:
a Future representing pending completion of the task

doExecute

protected void doExecute(Runnable task)
Template method for the actual execution of a task.

The default implementation creates a new Thread and starts it.

Parameters:
task - the Runnable to execute
See Also:
setThreadFactory(java.util.concurrent.ThreadFactory),
CustomizableThreadCreator.createThread(java.lang.Runnable),
Thread.start()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SyncTaskExecutor

org.springframework.core.task
Class SyncTaskExecutor

java.lang.Object
    extended by  org.springframework.core.task.SyncTaskExecutor
All Implemented Interfaces:
Serializable, Executor, TaskExecutor
public class SyncTaskExecutor
extends Object
implements TaskExecutor, Serializable

TaskExecutor implementation that executes each task synchronously in the calling thread.

Mainly intended for testing scenarios.

Execution in the calling thread does have the advantage of participating in it's thread context, for example the thread context class loader or the thread's current transaction association. That said, in many cases, asynchronous execution will be preferable: choose an asynchronous TaskExecutor instead for such scenarios.

Since:
2.0
Author:
Juergen Hoeller
See Also:
SimpleAsyncTaskExecutor, Serialized Form

Constructor Summary
SyncTaskExecutor()
Method Summary
 void execute(Runnable task)
Executes the given task synchronously, through direct invocation of it's run() method.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SyncTaskExecutor

public SyncTaskExecutor()
Method Detail

execute

public void execute(Runnable task)
Executes the given task synchronously, through direct invocation of it's run() method.

Specified by:
execute in interface Executor
Specified by:
execute in interface TaskExecutor
Parameters:
task - the Runnable to execute (never null)
Throws:
IllegalArgumentException - if the given task is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TaskRejectedException

org.springframework.core.task
Class TaskRejectedException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  java.util.concurrent.RejectedExecutionException
                    extended by  org.springframework.core.task.TaskRejectedException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
TaskTimeoutException
public class TaskRejectedException
extends RejectedExecutionException

Exception thrown when a TaskExecutor rejects to accept a given task for execution.

Since:
2.0.1
Author:
Juergen Hoeller
See Also:
TaskExecutor.execute(Runnable), TaskTimeoutException, Serialized Form

Constructor Summary
TaskRejectedException(String msg)
Create a new TaskRejectedException with the specified detail message and no root cause.
TaskRejectedException(String msg, Throwable cause)
Create a new TaskRejectedException with the specified detail message and the given root cause.
Method Summary
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

TaskRejectedException

public TaskRejectedException(String msg)
Create a new TaskRejectedException with the specified detail message and no root cause.

Parameters:
msg - the detail message

TaskRejectedException

public TaskRejectedException(String msg,
                             Throwable cause)
Create a new TaskRejectedException with the specified detail message and the given root cause.

Parameters:
msg - the detail message
cause - the root cause (usually from using an underlying API such as the java.util.concurrent package)
See Also:
RejectedExecutionException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TaskTimeoutException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.core.task
Class TaskTimeoutException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  java.util.concurrent.RejectedExecutionException
                    extended by  org.springframework.core.task.TaskRejectedException
                        extended by  org.springframework.core.task.TaskTimeoutException
All Implemented Interfaces:
Serializable
public class TaskTimeoutException
extends TaskRejectedException

Exception thrown when a AsyncTaskExecutor rejects to accept a given task for execution because of the specified timeout.

Since:
2.0.3
Author:
Juergen Hoeller
See Also:
AsyncTaskExecutor.execute(Runnable, long), TaskRejectedException, Serialized Form

Constructor Summary
TaskTimeoutException(String msg)
Create a new TaskTimeoutException with the specified detail message and no root cause.
TaskTimeoutException(String msg, Throwable cause)
Create a new TaskTimeoutException with the specified detail message and the given root cause.
Method Summary
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

TaskTimeoutException

public TaskTimeoutException(String msg)
Create a new TaskTimeoutException with the specified detail message and no root cause.

Parameters:
msg - the detail message

TaskTimeoutException

public TaskTimeoutException(String msg,
                            Throwable cause)
Create a new TaskTimeoutException with the specified detail message and the given root cause.

Parameters:
msg - the detail message
cause - the root cause (usually from using an underlying API such as the java.util.concurrent package)
See Also:
RejectedExecutionException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.core.task.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.core.task.support

Support classes for Spring's TaskExecutor abstraction.

See:
Description

Class Summary
ConcurrentExecutorAdapter | Adapter that exposes the Executor interface for any Spring TaskExecutor.
ExecutorServiceAdapter | Adapter that takes a Spring TaskExecutor) and exposes a full java.util.concurrent.ExecutorService for it.
TaskExecutorAdapter | Adapter that takes a JDK 1.5 java.util.concurrent.Executor and exposes a Spring TaskExecutor for it.

Package org.springframework.core.task.support Description

Support classes for Spring's TaskExecutor abstraction. Includes an adapter for the standard ExecutorService interface.


org.springframework.core.task.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.core.task.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.util.concurrent.AbstractExecutorService (implements java.util.concurrent.ExecutorService)
      • org.springframework.core.task.support.ExecutorServiceAdapter
    • org.springframework.core.task.support.ConcurrentExecutorAdapter (implements java.util.concurrent.Executor)
    • org.springframework.core.task.support.TaskExecutorAdapter (implements org.springframework.core.task.AsyncTaskExecutor)


ConcurrentExecutorAdapter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.core.task.support
Class ConcurrentExecutorAdapter

java.lang.Object
    extended by  org.springframework.core.task.support.ConcurrentExecutorAdapter
All Implemented Interfaces:
Executor
public class ConcurrentExecutorAdapter
extends Object
implements Executor

Adapter that exposes the Executor interface for any Spring TaskExecutor.

This is less useful as of Spring 3.0, since TaskExecutor itself extends the Executor interface. The adapter is only relevant for hiding the TaskExecutor nature of a given object now, solely exposing the standard Executor interface to a client.

Since:
2.5
Author:
Juergen Hoeller
See Also:
Executor, TaskExecutor

Constructor Summary
ConcurrentExecutorAdapter(TaskExecutor taskExecutor)
Create a new ConcurrentExecutorAdapter for the given Spring TaskExecutor.
Method Summary
 void execute(Runnable command)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ConcurrentExecutorAdapter

public ConcurrentExecutorAdapter(TaskExecutor taskExecutor)
Create a new ConcurrentExecutorAdapter for the given Spring TaskExecutor.

Parameters:
taskExecutor - the Spring TaskExecutor to wrap
Method Detail

execute

public void execute(Runnable command)
Specified by:
execute in interface Executor
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ExecutorServiceAdapter

org.springframework.core.task.support
Class ExecutorServiceAdapter

java.lang.Object
    extended by  java.util.concurrent.AbstractExecutorService
        extended by  org.springframework.core.task.support.ExecutorServiceAdapter
All Implemented Interfaces:
Executor, ExecutorService
public class ExecutorServiceAdapter
extends AbstractExecutorService

Adapter that takes a Spring TaskExecutor) and exposes a full java.util.concurrent.ExecutorService for it.

This is primarily for adapting to client components that communicate via the java.util.concurrent.ExecutorService API. It can also be used as common ground between a local Spring TaskExecutor backend and a JNDI-located ManagedExecutorService in a Java EE 6 environment.

NOTE: This ExecutorService adapter does not support the lifecycle methods in the java.util.concurrent.ExecutorService API ("shutdown()" etc), similar to a server-wide ManagedExecutorService in a Java EE 6 environment. The lifecycle is always up to the backend pool, with this adapter acting as an access-only proxy for that target pool.

Since:
3.0
Author:
Juergen Hoeller
See Also:
ExecutorService

Constructor Summary
ExecutorServiceAdapter(TaskExecutor taskExecutor)
Create a new ExecutorServiceAdapter, using the given target executor.
Method Summary
boolean | awaitTermination(long timeout, TimeUnit unit)
void | execute(Runnable task)
boolean | isShutdown()
boolean | isTerminated()
void | shutdown()
List<Runnable> | shutdownNow()
Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ExecutorServiceAdapter

public ExecutorServiceAdapter(TaskExecutor taskExecutor)
Create a new ExecutorServiceAdapter, using the given target executor.

Parameters:
concurrentExecutor - the target executor to delegate to
Method Detail

execute

public void execute(Runnable task)

shutdown

public void shutdown()

shutdownNow

public List<Runnable> shutdownNow()

awaitTermination

public boolean awaitTermination(long timeout,
                                TimeUnit unit)
                         throws InterruptedException
Throws:
InterruptedException

isShutdown

public boolean isShutdown()

isTerminated

public boolean isTerminated()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TaskExecutorAdapter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.core.task.support
Class TaskExecutorAdapter

java.lang.Object
    extended by  org.springframework.core.task.support.TaskExecutorAdapter
All Implemented Interfaces:
Executor, AsyncTaskExecutor, TaskExecutor
public class TaskExecutorAdapter
extends Object
implements AsyncTaskExecutor

Adapter that takes a JDK 1.5 java.util.concurrent.Executor and exposes a Spring TaskExecutor for it. Also detects an extended java.util.concurrent.ExecutorService, adapting the AsyncTaskExecutor interface accordingly.

Since:
3.0
Author:
Juergen Hoeller
See Also:
Executor, ExecutorService, Executors

Field Summary
Fields inherited from interface org.springframework.core.task.AsyncTaskExecutor
TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE
Constructor Summary
TaskExecutorAdapter(Executor concurrentExecutor)
Create a new TaskExecutorAdapter, using the given JDK 1.5 concurrent executor.
Method Summary
 void execute(Runnable task)
Delegates to the specified JDK 1.5 concurrent executor.
 void execute(Runnable task, long startTimeout)
Execute the given task.
<T> Future<T>
submit(Callable<T> task)
Submit a Callable task for execution, receiving a Future representing that task.
 Future<?> submit(Runnable task)
Submit a Runnable task for execution, receiving a Future representing that task.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TaskExecutorAdapter

public TaskExecutorAdapter(Executor concurrentExecutor)
Create a new TaskExecutorAdapter, using the given JDK 1.5 concurrent executor.

Parameters:
concurrentExecutor - the JDK 1.5 concurrent executor to delegate to
Method Detail

execute

public void execute(Runnable task)
Delegates to the specified JDK 1.5 concurrent executor.

Specified by:
execute in interface Executor
Specified by:
execute in interface TaskExecutor
Parameters:
task - the Runnable to execute (never null)
See Also:
Executor.execute(Runnable)

execute

public void execute(Runnable task,
                    long startTimeout)
Description copied from interface: AsyncTaskExecutor
Execute the given task.

Specified by:
execute in interface AsyncTaskExecutor
Parameters:
task - the Runnable to execute (never null)
startTimeout - the time duration (milliseconds) within which the task is supposed to start. This is intended as a hint to the executor, allowing for preferred handling of immediate tasks. Typical values are AsyncTaskExecutor.TIMEOUT_IMMEDIATE or AsyncTaskExecutor.TIMEOUT_INDEFINITE (the default as used by TaskExecutor.execute(Runnable)).

submit

public Future<?> submit(Runnable task)
Description copied from interface: AsyncTaskExecutor
Submit a Runnable task for execution, receiving a Future representing that task. The Future will return a null result upon completion.

Specified by:
submit in interface AsyncTaskExecutor
Parameters:
task - the Runnable to execute (never null)
Returns:
a Future representing pending completion of the task

submit

public <T> Future<T> submit(Callable<T> task)
Description copied from interface: AsyncTaskExecutor
Submit a Callable task for execution, receiving a Future representing that task. The Future will return the Callable's result upon completion.

Specified by:
submit in interface AsyncTaskExecutor
Parameters:
task - the Callable to execute (never null)
Returns:
a Future representing pending completion of the task
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.core.type

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.core.type

Core support package for type introspection.

See:
Description

Interface Summary
AnnotationMetadata | Interface that defines abstract access to the annotations of a specific class, in a form that does not require that class to be loaded yet.
ClassMetadata | Interface that defines abstract metadata of a specific class, in a form that does not require that class to be loaded yet.
MethodMetadata | Interface that defines abstract access to the annotations of a specific class, in a form that does not require that class to be loaded yet.

Class Summary
StandardAnnotationMetadata | AnnotationMetadata implementation that uses standard reflection to introspect a given Class.
StandardClassMetadata | ClassMetadata implementation that uses standard reflection to introspect a given Class.
StandardMethodMetadata | MethodMetadata implementation that uses standard reflection to introspect a given Method.

Package org.springframework.core.type Description

Core support package for type introspection.


org.springframework.core.type Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.core.type

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.core.type.StandardClassMetadata (implements org.springframework.core.type.ClassMetadata)
      • org.springframework.core.type.StandardAnnotationMetadata (implements org.springframework.core.type.AnnotationMetadata)
    • org.springframework.core.type.StandardMethodMetadata (implements org.springframework.core.type.MethodMetadata)

Interface Hierarchy

  • org.springframework.core.type.ClassMetadata
    • org.springframework.core.type.AnnotationMetadata
  • org.springframework.core.type.MethodMetadata


AnnotationMetadata

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.core.type
Interface AnnotationMetadata

All Superinterfaces:
ClassMetadata
All Known Implementing Classes:
StandardAnnotationMetadata
public interface AnnotationMetadata
extends ClassMetadata

Interface that defines abstract access to the annotations of a specific class, in a form that does not require that class to be loaded yet.

Since:
2.5
Author:
Juergen Hoeller, Mark Fisher
See Also:
StandardAnnotationMetadata, MetadataReader.getAnnotationMetadata()

Method Summary
Set<MethodMetadata> | getAnnotatedMethods(String annotationType) Retrieve the method metadata for all methods that are annotated (or meta-annotated) with the given annotation type.
Map<String,Object> | getAnnotationAttributes(String annotationType) Retrieve the attributes of the annotation of the given type, if any (i.e.
Map<String,Object> | getAnnotationAttributes(String annotationType, boolean classValuesAsString) Retrieve the attributes of the annotation of the given type, if any (i.e.
Set<String> | getAnnotationTypes() Return the names of all annotation types defined on the underlying class.
Set<String> | getMetaAnnotationTypes(String annotationType) Return the names of all meta-annotation types defined on the given annotation type of the underlying class.
boolean | hasAnnotatedMethods(String annotationType) Determine whether the underlying class has any methods that are annotated (or meta-annotated) with the given annotation type.
boolean | hasAnnotation(String annotationType) Determine whether the underlying class has an annotation of the given type defined.
boolean | hasMetaAnnotation(String metaAnnotationType) Determine whether the underlying class has an annotation that is itself annotated with the meta-annotation of the given type.
boolean | isAnnotated(String annotationType) Determine whether the underlying class has an annotation or meta-annotation of the given type defined.
Methods inherited from interface org.springframework.core.type.ClassMetadata
getClassName, getEnclosingClassName, getInterfaceNames, getSuperClassName, hasEnclosingClass, hasSuperClass, isAbstract, isConcrete, isFinal, isIndependent, isInterface

Method Detail

getAnnotationTypes

Set<String> getAnnotationTypes()
Return the names of all annotation types defined on the underlying class.

Returns:
the annotation type names

getMetaAnnotationTypes

Set<String> getMetaAnnotationTypes(String annotationType)
Return the names of all meta-annotation types defined on the given annotation type of the underlying class.

Parameters:
annotationType - the meta-annotation type to look for
Returns:
the meta-annotation type names

hasAnnotation

boolean hasAnnotation(String annotationType)
Determine whether the underlying class has an annotation of the given type defined.

Parameters:
annotationType - the annotation type to look for
Returns:
whether a matching annotation is defined

hasMetaAnnotation

boolean hasMetaAnnotation(String metaAnnotationType)
Determine whether the underlying class has an annotation that is itself annotated with the meta-annotation of the given type.

Parameters:
metaAnnotationType - the meta-annotation type to look for
Returns:
whether a matching meta-annotation is defined

isAnnotated

boolean isAnnotated(String annotationType)
Determine whether the underlying class has an annotation or meta-annotation of the given type defined.

This is equivalent to a "hasAnnotation || hasMetaAnnotation" check. If this method returns true, then getAnnotationAttributes(java.lang.String) will return a non-null Map.

Parameters:
annotationType - the annotation type to look for
Returns:
whether a matching annotation is defined

getAnnotationAttributes

Map<String,Object> getAnnotationAttributes(String annotationType)
Retrieve the attributes of the annotation of the given type, if any (i.e. if defined on the underlying class, as direct annotation or as meta-annotation).

Parameters:
annotationType - the annotation type to look for
Returns:
a Map of attributes, with the attribute name as key (e.g. "value") and the defined attribute value as Map value. This return value will be null if no matching annotation is defined.

getAnnotationAttributes

Map<String,Object> getAnnotationAttributes(String annotationType,
                                           boolean classValuesAsString)
Retrieve the attributes of the annotation of the given type, if any (i.e. if defined on the underlying class, as direct annotation or as meta-annotation).

Parameters:
annotationType - the annotation type to look for
classValuesAsString - whether to convert class references to String class names for exposure as values in the returned Map, instead of Class references which might potentially have to be loaded first
Returns:
a Map of attributes, with the attribute name as key (e.g. "value") and the defined attribute value as Map value. This return value will be null if no matching annotation is defined.

hasAnnotatedMethods

boolean hasAnnotatedMethods(String annotationType)
Determine whether the underlying class has any methods that are annotated (or meta-annotated) with the given annotation type.

getAnnotatedMethods

Set<MethodMetadata> getAnnotatedMethods(String annotationType)
Retrieve the method metadata for all methods that are annotated (or meta-annotated) with the given annotation type.

For any returned method, MethodMetadata.isAnnotated(java.lang.String) will return true for the given annotation type.

Parameters:
annotationType - the annotation type to look for
Returns:
a Set of MethodMetadata for methods that have a matching annotation. The return value will be an empty set if no methods match the annotation type.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ClassMetadata

org.springframework.core.type
Interface ClassMetadata

All Known Subinterfaces:
AnnotationMetadata
All Known Implementing Classes:
StandardAnnotationMetadata, StandardClassMetadata
public interface ClassMetadata

Interface that defines abstract metadata of a specific class, in a form that does not require that class to be loaded yet.

Since:
2.5
Author:
Juergen Hoeller
See Also:
StandardClassMetadata, MetadataReader.getClassMetadata(), AnnotationMetadata

Method Summary
String | getClassName() Return the name of the underlying class.
String | getEnclosingClassName() Return the name of the enclosing class of the underlying class, or null if the underlying class is a top-level class.
String[] | getInterfaceNames() Return the name of all interfaces that the underlying class implements, or an empty array if there are none.
String | getSuperClassName() Return the name of the super class of the underlying class, or null if there is no super class defined.
boolean | hasEnclosingClass() Return whether the underlying class has an enclosing class (i.e.
boolean | hasSuperClass() Return whether the underlying class has a super class.
boolean | isAbstract() Return whether the underlying class is marked as abstract.
boolean | isConcrete() Return whether the underlying class represents a concrete class, i.e.
boolean | isFinal() Return whether the underlying class is marked as 'final'.
boolean | isIndependent() Determine whether the underlying class is independent, i.e.
boolean | isInterface() Return whether the underlying class represents an interface.

Method Detail

getClassName

String getClassName()
Return the name of the underlying class.

isInterface

boolean isInterface()
Return whether the underlying class represents an interface.

isAbstract

boolean isAbstract()
Return whether the underlying class is marked as abstract.

isConcrete

boolean isConcrete()
Return whether the underlying class represents a concrete class, i.e. neither an interface nor an abstract class.

isFinal

boolean isFinal()
Return whether the underlying class is marked as 'final'.

isIndependent

boolean isIndependent()
Determine whether the underlying class is independent, i.e. whether it is a top-level class or a nested class (static inner class) that can be constructed independent from an enclosing class.

hasEnclosingClass

boolean hasEnclosingClass()
Return whether the underlying class has an enclosing class (i.e. the underlying class is an inner/nested class or a local class within a method).

If this method returns false, then the underlying class is a top-level class.

getEnclosingClassName

String getEnclosingClassName()
Return the name of the enclosing class of the underlying class, or null if the underlying class is a top-level class.

hasSuperClass

boolean hasSuperClass()
Return whether the underlying class has a super class.

getSuperClassName

String getSuperClassName()
Return the name of the super class of the underlying class, or null if there is no super class defined.

getInterfaceNames

String[] getInterfaceNames()
Return the name of all interfaces that the underlying class implements, or an empty array if there are none.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MethodMetadata

org.springframework.core.type
Interface MethodMetadata

All Known Implementing Classes:
StandardMethodMetadata
public interface MethodMetadata

Interface that defines abstract access to the annotations of a specific class, in a form that does not require that class to be loaded yet.

Since:
3.0
Author:
Juergen Hoeller, Mark Pollack, Chris Beams
See Also:
StandardMethodMetadata, AnnotationMetadata.getAnnotatedMethods(java.lang.String)

Method Summary
Map<String,Object> | getAnnotationAttributes(String annotationType) Retrieve the attributes of the annotation of the given type, if any (i.e.
String | getDeclaringClassName() Return the fully-qualified name of the class that declares this method.
String | getMethodName() Return the name of the method.
boolean | isAnnotated(String annotationType) Determine whether the underlying method has an annotation or meta-annotation of the given type defined.
boolean | isFinal() Return whether the underlying method is marked as 'final'.
boolean | isOverridable() Return whether the underlying method is overridable, i.e.
boolean | isStatic() Return whether the underlying method is declared as 'static'.

Method Detail

getMethodName

String getMethodName()
Return the name of the method.

getDeclaringClassName

String getDeclaringClassName()
Return the fully-qualified name of the class that declares this method.

isStatic

boolean isStatic()
Return whether the underlying method is declared as 'static'.

isFinal

boolean isFinal()
Return whether the underlying method is marked as 'final'.

isOverridable

boolean isOverridable()
Return whether the underlying method is overridable, i.e. not marked as static, final or private.

isAnnotated

boolean isAnnotated(String annotationType)
Determine whether the underlying method has an annotation or meta-annotation of the given type defined.

Parameters:
annotationType - the annotation type to look for
Returns:
whether a matching annotation is defined

getAnnotationAttributes

Map<String,Object> getAnnotationAttributes(String annotationType)
Retrieve the attributes of the annotation of the given type, if any (i.e. if defined on the underlying method, as direct annotation or as meta-annotation).

Parameters:
annotationType - the annotation type to look for
Returns:
a Map of attributes, with the attribute name as key (e.g. "value") and the defined attribute value as Map value. This return value will be null if no matching annotation is defined.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StandardAnnotationMetadata

org.springframework.core.type
Class StandardAnnotationMetadata

java.lang.Object
    extended by  org.springframework.core.type.StandardClassMetadata
        extended by  org.springframework.core.type.StandardAnnotationMetadata
All Implemented Interfaces:
AnnotationMetadata, ClassMetadata
public class StandardAnnotationMetadata
extends StandardClassMetadata
implements AnnotationMetadata

AnnotationMetadata implementation that uses standard reflection to introspect a given Class.

Since:
2.5
Author:
Juergen Hoeller, Mark Fisher

Constructor Summary
StandardAnnotationMetadata(Class introspectedClass)
Create a new StandardAnnotationMetadata wrapper for the given Class.
Method Summary
Set<MethodMetadata> | getAnnotatedMethods(String annotationType) Retrieve the method metadata for all methods that are annotated (or meta-annotated) with the given annotation type.
Map<String,Object> | getAnnotationAttributes(String annotationType) Retrieve the attributes of the annotation of the given type, if any (i.e.
Map<String,Object> | getAnnotationAttributes(String annotationType, boolean classValuesAsString) Retrieve the attributes of the annotation of the given type, if any (i.e.
Set<String> | getAnnotationTypes() Return the names of all annotation types defined on the underlying class.
Set<String> | getMetaAnnotationTypes(String annotationType) Return the names of all meta-annotation types defined on the given annotation type of the underlying class.
boolean | hasAnnotatedMethods(String annotationType) Determine whether the underlying class has any methods that are annotated (or meta-annotated) with the given annotation type.
boolean | hasAnnotation(String annotationType) Determine whether the underlying class has an annotation of the given type defined.
boolean | hasMetaAnnotation(String annotationType) Determine whether the underlying class has an annotation that is itself annotated with the meta-annotation of the given type.
boolean | isAnnotated(String annotationType) Determine whether the underlying class has an annotation or meta-annotation of the given type defined.
Methods inherited from class org.springframework.core.type.StandardClassMetadata
getClassName, getEnclosingClassName, getInterfaceNames, getIntrospectedClass, getSuperClassName, hasEnclosingClass, hasSuperClass, isAbstract, isConcrete, isFinal, isIndependent, isInterface
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.core.type.ClassMetadata
getClassName, getEnclosingClassName, getInterfaceNames, getSuperClassName, hasEnclosingClass, hasSuperClass, isAbstract, isConcrete, isFinal, isIndependent, isInterface

Constructor Detail

StandardAnnotationMetadata

public StandardAnnotationMetadata(Class introspectedClass)
Create a new StandardAnnotationMetadata wrapper for the given Class.

Parameters:
introspectedClass - the Class to introspect
Method Detail

getAnnotationTypes

public Set<String> getAnnotationTypes()
Description copied from interface: AnnotationMetadata
Return the names of all annotation types defined on the underlying class.

Specified by:
getAnnotationTypes in interface AnnotationMetadata
Returns:
the annotation type names

getMetaAnnotationTypes

public Set<String> getMetaAnnotationTypes(String annotationType)
Description copied from interface: AnnotationMetadata
Return the names of all meta-annotation types defined on the given annotation type of the underlying class.

Specified by:
getMetaAnnotationTypes in interface AnnotationMetadata
Parameters:
annotationType - the meta-annotation type to look for
Returns:
the meta-annotation type names

hasAnnotation

public boolean hasAnnotation(String annotationType)
Description copied from interface: AnnotationMetadata
Determine whether the underlying class has an annotation of the given type defined.

Specified by:
hasAnnotation in interface AnnotationMetadata
Parameters:
annotationType - the annotation type to look for
Returns:
whether a matching annotation is defined

hasMetaAnnotation

public boolean hasMetaAnnotation(String annotationType)
Description copied from interface: AnnotationMetadata
Determine whether the underlying class has an annotation that is itself annotated with the meta-annotation of the given type.

Specified by:
hasMetaAnnotation in interface AnnotationMetadata
Parameters:
annotationType - the meta-annotation type to look for
Returns:
whether a matching meta-annotation is defined

isAnnotated

public boolean isAnnotated(String annotationType)
Description copied from interface: AnnotationMetadata
Determine whether the underlying class has an annotation or meta-annotation of the given type defined.

This is equivalent to a "hasAnnotation || hasMetaAnnotation" check. If this method returns true, then AnnotationMetadata.getAnnotationAttributes(java.lang.String) will return a non-null Map.

Specified by:
isAnnotated in interface AnnotationMetadata
Parameters:
annotationType - the annotation type to look for
Returns:
whether a matching annotation is defined

getAnnotationAttributes

public Map<String,Object> getAnnotationAttributes(String annotationType)
Description copied from interface: AnnotationMetadata
Retrieve the attributes of the annotation of the given type, if any (i.e. if defined on the underlying class, as direct annotation or as meta-annotation).

Specified by:
getAnnotationAttributes in interface AnnotationMetadata
Parameters:
annotationType - the annotation type to look for
Returns:
a Map of attributes, with the attribute name as key (e.g. "value") and the defined attribute value as Map value. This return value will be null if no matching annotation is defined.

getAnnotationAttributes

public Map<String,Object> getAnnotationAttributes(String annotationType,
                                                  boolean classValuesAsString)
Description copied from interface: AnnotationMetadata
Retrieve the attributes of the annotation of the given type, if any (i.e. if defined on the underlying class, as direct annotation or as meta-annotation).

Specified by:
getAnnotationAttributes in interface AnnotationMetadata
Parameters:
annotationType - the annotation type to look for
classValuesAsString - whether to convert class references to String class names for exposure as values in the returned Map, instead of Class references which might potentially have to be loaded first
Returns:
a Map of attributes, with the attribute name as key (e.g. "value") and the defined attribute value as Map value. This return value will be null if no matching annotation is defined.

hasAnnotatedMethods

public boolean hasAnnotatedMethods(String annotationType)
Description copied from interface: AnnotationMetadata
Determine whether the underlying class has any methods that are annotated (or meta-annotated) with the given annotation type.

Specified by:
hasAnnotatedMethods in interface AnnotationMetadata

getAnnotatedMethods

public Set<MethodMetadata> getAnnotatedMethods(String annotationType)
Description copied from interface: AnnotationMetadata
Retrieve the method metadata for all methods that are annotated (or meta-annotated) with the given annotation type.

For any returned method, MethodMetadata.isAnnotated(java.lang.String) will return true for the given annotation type.

Specified by:
getAnnotatedMethods in interface AnnotationMetadata
Parameters:
annotationType - the annotation type to look for
Returns:
a Set of MethodMetadata for methods that have a matching annotation. The return value will be an empty set if no methods match the annotation type.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StandardClassMetadata

org.springframework.core.type
Class StandardClassMetadata

java.lang.Object
    extended by  org.springframework.core.type.StandardClassMetadata
All Implemented Interfaces:
ClassMetadata
Direct Known Subclasses:
StandardAnnotationMetadata
public class StandardClassMetadata
extends Object
implements ClassMetadata

ClassMetadata implementation that uses standard reflection to introspect a given Class.

Since:
2.5
Author:
Juergen Hoeller

Constructor Summary
StandardClassMetadata(Class introspectedClass)
Create a new StandardClassMetadata wrapper for the given Class.
Method Summary
String | getClassName() Return the name of the underlying class.
String | getEnclosingClassName() Return the name of the enclosing class of the underlying class, or null if the underlying class is a top-level class.
String[] | getInterfaceNames() Return the name of all interfaces that the underlying class implements, or an empty array if there are none.
Class | getIntrospectedClass() Return the underlying Class.
String | getSuperClassName() Return the name of the super class of the underlying class, or null if there is no super class defined.
boolean | hasEnclosingClass() Return whether the underlying class has an enclosing class (i.e.
boolean | hasSuperClass() Return whether the underlying class has a super class.
boolean | isAbstract() Return whether the underlying class is marked as abstract.
boolean | isConcrete() Return whether the underlying class represents a concrete class, i.e.
boolean | isFinal() Return whether the underlying class is marked as 'final'.
boolean | isIndependent() Determine whether the underlying class is independent, i.e.
boolean | isInterface() Return whether the underlying class represents an interface.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

StandardClassMetadata

public StandardClassMetadata(Class introspectedClass)
Create a new StandardClassMetadata wrapper for the given Class.

Parameters:
introspectedClass - the Class to introspect
Method Detail

getIntrospectedClass

public final Class getIntrospectedClass()
Return the underlying Class.

getClassName

public String getClassName()
Description copied from interface: ClassMetadata
Return the name of the underlying class.

Specified by:
getClassName in interface ClassMetadata

isInterface

public boolean isInterface()
Description copied from interface: ClassMetadata
Return whether the underlying class represents an interface.

Specified by:
isInterface in interface ClassMetadata

isAbstract

public boolean isAbstract()
Description copied from interface: ClassMetadata
Return whether the underlying class is marked as abstract.

Specified by:
isAbstract in interface ClassMetadata

isConcrete

public boolean isConcrete()
Description copied from interface: ClassMetadata
Return whether the underlying class represents a concrete class, i.e. neither an interface nor an abstract class.

Specified by:
isConcrete in interface ClassMetadata

isFinal

public boolean isFinal()
Description copied from interface: ClassMetadata
Return whether the underlying class is marked as 'final'.

Specified by:
isFinal in interface ClassMetadata

isIndependent

public boolean isIndependent()
Description copied from interface: ClassMetadata
Determine whether the underlying class is independent, i.e. whether it is a top-level class or a nested class (static inner class) that can be constructed independent from an enclosing class.

Specified by:
isIndependent in interface ClassMetadata

hasEnclosingClass

public boolean hasEnclosingClass()
Description copied from interface: ClassMetadata
Return whether the underlying class has an enclosing class (i.e. the underlying class is an inner/nested class or a local class within a method).

If this method returns false, then the underlying class is a top-level class.

Specified by:
hasEnclosingClass in interface ClassMetadata

getEnclosingClassName

public String getEnclosingClassName()
Description copied from interface: ClassMetadata
Return the name of the enclosing class of the underlying class, or null if the underlying class is a top-level class.

Specified by:
getEnclosingClassName in interface ClassMetadata

hasSuperClass

public boolean hasSuperClass()
Description copied from interface: ClassMetadata
Return whether the underlying class has a super class.

Specified by:
hasSuperClass in interface ClassMetadata

getSuperClassName

public String getSuperClassName()
Description copied from interface: ClassMetadata
Return the name of the super class of the underlying class, or null if there is no super class defined.

Specified by:
getSuperClassName in interface ClassMetadata

getInterfaceNames

public String[] getInterfaceNames()
Description copied from interface: ClassMetadata
Return the name of all interfaces that the underlying class implements, or an empty array if there are none.

Specified by:
getInterfaceNames in interface ClassMetadata
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StandardMethodMetadata

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.core.type
Class StandardMethodMetadata

java.lang.Object
    extended by  org.springframework.core.type.StandardMethodMetadata
All Implemented Interfaces:
MethodMetadata
public class StandardMethodMetadata
extends Object
implements MethodMetadata

MethodMetadata implementation that uses standard reflection to introspect a given Method.

Since:
3.0
Author:
Juergen Hoeller, Mark Pollack, Chris Beams

Constructor Summary
StandardMethodMetadata(Method introspectedMethod)
Create a new StandardMethodMetadata wrapper for the given Method.
Method Summary
Map<String,Object> | getAnnotationAttributes(String annotationType) Retrieve the attributes of the annotation of the given type, if any (i.e.
String | getDeclaringClassName() Return the fully-qualified name of the class that declares this method.
Method | getIntrospectedMethod() Return the underlying Method.
String | getMethodName() Return the name of the method.
boolean | isAnnotated(String annotationType) Determine whether the underlying method has an annotation or meta-annotation of the given type defined.
boolean | isFinal() Return whether the underlying method is marked as 'final'.
boolean | isOverridable() Return whether the underlying method is overridable, i.e.
boolean | isStatic() Return whether the underlying method is declared as 'static'.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

StandardMethodMetadata

public StandardMethodMetadata(Method introspectedMethod)
Create a new StandardMethodMetadata wrapper for the given Method.

Parameters:
introspectedMethod - the Method to introspect
Method Detail

getIntrospectedMethod

public final Method getIntrospectedMethod()
Return the underlying Method.

getMethodName

public String getMethodName()
Description copied from interface: MethodMetadata
Return the name of the method.

Specified by:
getMethodName in interface MethodMetadata

getDeclaringClassName

public String getDeclaringClassName()
Description copied from interface: MethodMetadata
Return the fully-qualified name of the class that declares this method.

Specified by:
getDeclaringClassName in interface MethodMetadata

isStatic

public boolean isStatic()
Description copied from interface: MethodMetadata
Return whether the underlying method is declared as 'static'.

Specified by:
isStatic in interface MethodMetadata

isFinal

public boolean isFinal()
Description copied from interface: MethodMetadata
Return whether the underlying method is marked as 'final'.

Specified by:
isFinal in interface MethodMetadata

isOverridable

public boolean isOverridable()
Description copied from interface: MethodMetadata
Return whether the underlying method is overridable, i.e. not marked as static, final or private.

Specified by:
isOverridable in interface MethodMetadata

isAnnotated

public boolean isAnnotated(String annotationType)
Description copied from interface: MethodMetadata
Determine whether the underlying method has an annotation or meta-annotation of the given type defined.

Specified by:
isAnnotated in interface MethodMetadata
Parameters:
annotationType - the annotation type to look for
Returns:
whether a matching annotation is defined

getAnnotationAttributes

public Map<String,Object> getAnnotationAttributes(String annotationType)
Description copied from interface: MethodMetadata
Retrieve the attributes of the annotation of the given type, if any (i.e. if defined on the underlying method, as direct annotation or as meta-annotation).

Specified by:
getAnnotationAttributes in interface MethodMetadata
Parameters:
annotationType - the annotation type to look for
Returns:
a Map of attributes, with the attribute name as key (e.g. "value") and the defined attribute value as Map value. This return value will be null if no matching annotation is defined.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.core.type.classreading

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.core.type.classreading

Support classes for reading annotation and class-level metadata.

See:
Description

Interface Summary
MetadataReader | Simple facade for accessing class metadata, as read by an ASM org.springframework.asm.ClassReader.
MetadataReaderFactory | Factory interface for MetadataReader instances.

Class Summary
CachingMetadataReaderFactory | Caching implementation of the MetadataReaderFactory interface, caching MetadataReader per Spring Resource handle (i.e.
SimpleMetadataReaderFactory | Simple implementation of the MetadataReaderFactory interface, creating a new ASM org.springframework.asm.ClassReader for every request.

Package org.springframework.core.type.classreading Description

Support classes for reading annotation and class-level metadata.


org.springframework.core.type.classreading Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.core.type.classreading

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.core.type.classreading.SimpleMetadataReaderFactory (implements org.springframework.core.type.classreading.MetadataReaderFactory)
      • org.springframework.core.type.classreading.CachingMetadataReaderFactory

Interface Hierarchy

  • org.springframework.core.type.classreading.MetadataReader
  • org.springframework.core.type.classreading.MetadataReaderFactory


MetadataReader

org.springframework.core.type.classreading
Interface MetadataReader

public interface MetadataReader

Simple facade for accessing class metadata, as read by an ASM org.springframework.asm.ClassReader.

Since:
2.5
Author:
Juergen Hoeller

Method Summary
AnnotationMetadata | getAnnotationMetadata() Read full annotation metadata for the underlying class, including metadata for annotated methods.
ClassMetadata | getClassMetadata() Read basic class metadata for the underlying class.
Resource | getResource() Return the resource reference for the class file.

Method Detail

getResource

Resource getResource()
Return the resource reference for the class file.

getClassMetadata

ClassMetadata getClassMetadata()
Read basic class metadata for the underlying class.

getAnnotationMetadata

AnnotationMetadata getAnnotationMetadata()
Read full annotation metadata for the underlying class, including metadata for annotated methods.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MetadataReaderFactory

org.springframework.core.type.classreading
Interface MetadataReaderFactory

All Known Implementing Classes:
CachingMetadataReaderFactory, SimpleMetadataReaderFactory
public interface MetadataReaderFactory

Factory interface for MetadataReader instances. Allows for caching a MetadataReader per original resource.

Since:
2.5
Author:
Juergen Hoeller
See Also:
SimpleMetadataReaderFactory, CachingMetadataReaderFactory

Method Summary
MetadataReader | getMetadataReader(Resource resource) Obtain a MetadataReader for the given resource.
MetadataReader | getMetadataReader(String className) Obtain a MetadataReader for the given class name.

Method Detail

getMetadataReader

MetadataReader getMetadataReader(String className)
                                 throws IOException
Obtain a MetadataReader for the given class name.

Parameters:
className - the class name (to be resolved to a ".class" file)
Returns:
a holder for the ClassReader instance (never null)
Throws:
IOException - in case of I/O failure

getMetadataReader

MetadataReader getMetadataReader(Resource resource)
                                 throws IOException
Obtain a MetadataReader for the given resource.

Parameters:
resource - the resource (pointing to a ".class" file)
Returns:
a holder for the ClassReader instance (never null)
Throws:
IOException - in case of I/O failure
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CachingMetadataReaderFactory

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.core.type.classreading
Class CachingMetadataReaderFactory

java.lang.Object
    extended by  org.springframework.core.type.classreading.SimpleMetadataReaderFactory
        extended by  org.springframework.core.type.classreading.CachingMetadataReaderFactory
All Implemented Interfaces:
MetadataReaderFactory
public class CachingMetadataReaderFactory
extends SimpleMetadataReaderFactory

Caching implementation of the MetadataReaderFactory interface, caching MetadataReader per Spring Resource handle (i.e. per ".class" file).

Since:
2.5
Author:
Juergen Hoeller, Costin Leau

Constructor Summary
CachingMetadataReaderFactory()
Create a new CachingMetadataReaderFactory for the default class loader.
CachingMetadataReaderFactory(ClassLoader classLoader)
Create a new CachingMetadataReaderFactory for the given class loader.
CachingMetadataReaderFactory(ResourceLoader resourceLoader)
Create a new CachingMetadataReaderFactory for the given resource loader.
Method Summary
 MetadataReader getMetadataReader(Resource resource)
Obtain a MetadataReader for the given resource.
Methods inherited from class org.springframework.core.type.classreading.SimpleMetadataReaderFactory
getMetadataReader, getResourceLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CachingMetadataReaderFactory

public CachingMetadataReaderFactory()
Create a new CachingMetadataReaderFactory for the default class loader.

CachingMetadataReaderFactory

public CachingMetadataReaderFactory(ResourceLoader resourceLoader)
Create a new CachingMetadataReaderFactory for the given resource loader.

Parameters:
resourceLoader - the Spring ResourceLoader to use (also determines the ClassLoader to use)

CachingMetadataReaderFactory

public CachingMetadataReaderFactory(ClassLoader classLoader)
Create a new CachingMetadataReaderFactory for the given class loader.

Parameters:
classLoader - the ClassLoader to use
Method Detail

getMetadataReader

public MetadataReader getMetadataReader(Resource resource)
                                 throws IOException
Description copied from interface: MetadataReaderFactory
Obtain a MetadataReader for the given resource.

Specified by:
getMetadataReader in interface MetadataReaderFactory
Overrides:
getMetadataReader in class SimpleMetadataReaderFactory
Parameters:
resource - the resource (pointing to a ".class" file)
Returns:
a holder for the ClassReader instance (never null)
Throws:
IOException - in case of I/O failure
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


SimpleMetadataReaderFactory

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.core.type.classreading
Class SimpleMetadataReaderFactory

java.lang.Object
    extended by  org.springframework.core.type.classreading.SimpleMetadataReaderFactory
All Implemented Interfaces:
MetadataReaderFactory
Direct Known Subclasses:
CachingMetadataReaderFactory
public class SimpleMetadataReaderFactory
extends Object
implements MetadataReaderFactory

Simple implementation of the MetadataReaderFactory interface, creating a new ASM org.springframework.asm.ClassReader for every request.

Since:
2.5
Author:
Juergen Hoeller

Constructor Summary
SimpleMetadataReaderFactory()
Create a new SimpleMetadataReaderFactory for the default class loader.
SimpleMetadataReaderFactory(ClassLoader classLoader)
Create a new SimpleMetadataReaderFactory for the given class loader.
SimpleMetadataReaderFactory(ResourceLoader resourceLoader)
Create a new SimpleMetadataReaderFactory for the given resource loader.
Method Summary
MetadataReader | getMetadataReader(Resource resource) Obtain a MetadataReader for the given resource.
MetadataReader | getMetadataReader(String className) Obtain a MetadataReader for the given class name.
ResourceLoader | getResourceLoader() Return the ResourceLoader that this MetadataReaderFactory has been constructed with.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleMetadataReaderFactory

public SimpleMetadataReaderFactory()
Create a new SimpleMetadataReaderFactory for the default class loader.

SimpleMetadataReaderFactory

public SimpleMetadataReaderFactory(ResourceLoader resourceLoader)
Create a new SimpleMetadataReaderFactory for the given resource loader.

Parameters:
resourceLoader - the Spring ResourceLoader to use (also determines the ClassLoader to use)

SimpleMetadataReaderFactory

public SimpleMetadataReaderFactory(ClassLoader classLoader)
Create a new SimpleMetadataReaderFactory for the given class loader.

Parameters:
classLoader - the ClassLoader to use
Method Detail

getResourceLoader

public final ResourceLoader getResourceLoader()
Return the ResourceLoader that this MetadataReaderFactory has been constructed with.

getMetadataReader

public MetadataReader getMetadataReader(String className)
                                 throws IOException
Description copied from interface: MetadataReaderFactory
Obtain a MetadataReader for the given class name.

Specified by:
getMetadataReader in interface MetadataReaderFactory
Parameters:
className - the class name (to be resolved to a ".class" file)
Returns:
a holder for the ClassReader instance (never null)
Throws:
IOException - in case of I/O failure

getMetadataReader

public MetadataReader getMetadataReader(Resource resource)
                                 throws IOException
Description copied from interface: MetadataReaderFactory
Obtain a MetadataReader for the given resource.

Specified by:
getMetadataReader in interface MetadataReaderFactory
Parameters:
resource - the resource (pointing to a ".class" file)
Returns:
a holder for the ClassReader instance (never null)
Throws:
IOException - in case of I/O failure
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.core.type.filter

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.core.type.filter

Core support package for type filtering (e.g.

See:
Description

Interface Summary
TypeFilter Base interface for type filters using a MetadataReader.

Class Summary
AbstractClassTestingTypeFilter | Type filter that exposes a ClassMetadata object to subclasses, for class testing purposes.
AbstractTypeHierarchyTraversingFilter | Type filter that is aware of traversing over hierarchy.
AnnotationTypeFilter | A simple filter which matches classes with a given annotation, checking inherited annotations as well.
AspectJTypeFilter | Type filter that uses AspectJ type pattern for matching.
AssignableTypeFilter | A simple filter which matches classes that are assignable to a given type.
RegexPatternTypeFilter | A simple filter for matching a fully-qualified class name with a regex Pattern.

Package org.springframework.core.type.filter Description

Core support package for type filtering (e.g. for classpath scanning).


org.springframework.core.type.filter Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.core.type.filter

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.core.type.filter.AbstractClassTestingTypeFilter (implements org.springframework.core.type.filter.TypeFilter)
      • org.springframework.core.type.filter.RegexPatternTypeFilter
    • org.springframework.core.type.filter.AbstractTypeHierarchyTraversingFilter (implements org.springframework.core.type.filter.TypeFilter)
      • org.springframework.core.type.filter.AnnotationTypeFilter
      • org.springframework.core.type.filter.AssignableTypeFilter
    • org.springframework.core.type.filter.AspectJTypeFilter (implements org.springframework.core.type.filter.TypeFilter)

Interface Hierarchy

  • org.springframework.core.type.filter.TypeFilter


TypeFilter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.core.type.filter
Interface TypeFilter

All Known Implementing Classes:
AbstractClassTestingTypeFilter, AbstractTypeHierarchyTraversingFilter, AnnotationTypeFilter, AspectJTypeFilter, AssignableTypeFilter, RegexPatternTypeFilter
public interface TypeFilter

Base interface for type filters using a MetadataReader.

Since:
2.5
Author:
Costin Leau, Juergen Hoeller, Mark Fisher

Method Summary
 boolean match(MetadataReader metadataReader, MetadataReaderFactory metadataReaderFactory)
Determine whether this filter matches for the class described by the given metadata.

Method Detail

match

boolean match(MetadataReader metadataReader,
              MetadataReaderFactory metadataReaderFactory)
              throws IOException
Determine whether this filter matches for the class described by the given metadata.

Parameters:
metadataReader - the metadata reader for the target class
metadataReaderFactory - a factory for obtaining metadata readers for other classes (such as superclasses and interfaces)
Returns:
whether this filter matches
Throws:
IOException - in case of I/O failure when reading metadata
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractClassTestingTypeFilter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.core.type.filter
Class AbstractClassTestingTypeFilter

java.lang.Object
    extended by  org.springframework.core.type.filter.AbstractClassTestingTypeFilter
All Implemented Interfaces:
TypeFilter
Direct Known Subclasses:
RegexPatternTypeFilter
public abstract class AbstractClassTestingTypeFilter
extends Object
implements TypeFilter

Type filter that exposes a ClassMetadata object to subclasses, for class testing purposes.

Since:
2.5
Author:
Rod Johnson, Costin Leau, Juergen Hoeller
See Also:
match(org.springframework.core.type.ClassMetadata)

Constructor Summary
AbstractClassTestingTypeFilter()
Method Summary
protected abstract boolean | match(ClassMetadata metadata) Determine a match based on the given ClassMetadata object.
boolean | match(MetadataReader metadataReader, MetadataReaderFactory metadataReaderFactory) Determine whether this filter matches for the class described by the given metadata.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractClassTestingTypeFilter

public AbstractClassTestingTypeFilter()
Method Detail

match

public final boolean match(MetadataReader metadataReader,
                           MetadataReaderFactory metadataReaderFactory)
                    throws IOException
Description copied from interface: TypeFilter
Determine whether this filter matches for the class described by the given metadata.

Specified by:
match in interface TypeFilter
Parameters:
metadataReader - the metadata reader for the target class
metadataReaderFactory - a factory for obtaining metadata readers for other classes (such as superclasses and interfaces)
Returns:
whether this filter matches
Throws:
IOException - in case of I/O failure when reading metadata

match

protected abstract boolean match(ClassMetadata metadata)
Determine a match based on the given ClassMetadata object.

Parameters:
metadata - the ClassMetadata object
Returns:
whether this filter matches on the specified type
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractTypeHierarchyTraversingFilter

org.springframework.core.type.filter
Class AbstractTypeHierarchyTraversingFilter

java.lang.Object
    extended by  org.springframework.core.type.filter.AbstractTypeHierarchyTraversingFilter
All Implemented Interfaces:
TypeFilter
Direct Known Subclasses:
AnnotationTypeFilter, AssignableTypeFilter
public abstract class AbstractTypeHierarchyTraversingFilter
extends Object
implements TypeFilter

Type filter that is aware of traversing over hierarchy.

This filter is useful when matching needs to be made based on potentially the whole class/interface hierarchy. The algorithm employed uses succeed-fast strategy i.e. if at anytime a match is declared, no further processing is carried out.

Since:
2.5
Author:
Ramnivas Laddad, Mark Fisher

Constructor Summary
protected AbstractTypeHierarchyTraversingFilter(boolean considerInherited, boolean considerInterfaces)
Method Summary
boolean | match(MetadataReader metadataReader, MetadataReaderFactory metadataReaderFactory) Determine whether this filter matches for the class described by the given metadata.
protected boolean | matchClassName(String className) Override this to match on type name.
protected Boolean | matchInterface(String interfaceNames) Override this to match on interface type name.
protected boolean | matchSelf(MetadataReader metadataReader) Override this to match self characteristics alone.
protected Boolean | matchSuperClass(String superClassName) Override this to match on super type name.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractTypeHierarchyTraversingFilter

protected AbstractTypeHierarchyTraversingFilter(boolean considerInherited,
                                                boolean considerInterfaces)
Method Detail

match

public boolean match(MetadataReader metadataReader,
                     MetadataReaderFactory metadataReaderFactory)
              throws IOException
Description copied from interface: TypeFilter
Determine whether this filter matches for the class described by the given metadata.

Specified by:
match in interface TypeFilter
Parameters:
metadataReader - the metadata reader for the target class
metadataReaderFactory - a factory for obtaining metadata readers for other classes (such as superclasses and interfaces)
Returns:
whether this filter matches
Throws:
IOException - in case of I/O failure when reading metadata

matchSelf

protected boolean matchSelf(MetadataReader metadataReader)
Override this to match self characteristics alone. Typically, the implementation will use a visitor to extract information to perform matching.

matchClassName

protected boolean matchClassName(String className)
Override this to match on type name.

matchSuperClass

protected Boolean matchSuperClass(String superClassName)
Override this to match on super type name.

matchInterface

protected Boolean matchInterface(String interfaceNames)
Override this to match on interface type name.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AnnotationTypeFilter

org.springframework.core.type.filter
Class AnnotationTypeFilter

java.lang.Object
    extended by  org.springframework.core.type.filter.AbstractTypeHierarchyTraversingFilter
        extended by  org.springframework.core.type.filter.AnnotationTypeFilter
All Implemented Interfaces:
TypeFilter
public class AnnotationTypeFilter
extends AbstractTypeHierarchyTraversingFilter

A simple filter which matches classes with a given annotation, checking inherited annotations as well.

The matching logic mirrors that of Class.isAnnotationPresent().

Since:
2.5
Author:
Mark Fisher, Ramnivas Laddad, Juergen Hoeller

Constructor Summary
AnnotationTypeFilter(Class<? extends Annotation> annotationType)
Create a new AnnotationTypeFilter for the given annotation type.
AnnotationTypeFilter(Class<? extends Annotation> annotationType, boolean considerMetaAnnotations)
Create a new AnnotationTypeFilter for the given annotation type.
Method Summary
protected boolean | matchSelf(MetadataReader metadataReader) Override this to match self characteristics alone.
protected Boolean | matchSuperClass(String superClassName) Override this to match on super type name.
Methods inherited from class org.springframework.core.type.filter.AbstractTypeHierarchyTraversingFilter
match, matchClassName, matchInterface
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AnnotationTypeFilter

public AnnotationTypeFilter(Class<? extends Annotation> annotationType)
Create a new AnnotationTypeFilter for the given annotation type. This filter will also match meta-annotations. To disable the meta-annotation matching, use the constructor that accepts a 'considerMetaAnnotations' argument.

Parameters:
annotationType - the annotation type to match

AnnotationTypeFilter

public AnnotationTypeFilter(Class<? extends Annotation> annotationType,
                            boolean considerMetaAnnotations)
Create a new AnnotationTypeFilter for the given annotation type.

Parameters:
annotationType - the annotation type to match
considerMetaAnnotations - whether to also match on meta-annotations
Method Detail

matchSelf

protected boolean matchSelf(MetadataReader metadataReader)
Description copied from class: AbstractTypeHierarchyTraversingFilter
Override this to match self characteristics alone. Typically, the implementation will use a visitor to extract information to perform matching.

Overrides:
matchSelf in class AbstractTypeHierarchyTraversingFilter

matchSuperClass

protected Boolean matchSuperClass(String superClassName)
Description copied from class: AbstractTypeHierarchyTraversingFilter
Override this to match on super type name.

Overrides:
matchSuperClass in class AbstractTypeHierarchyTraversingFilter
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AspectJTypeFilter

org.springframework.core.type.filter
Class AspectJTypeFilter

java.lang.Object
    extended by  org.springframework.core.type.filter.AspectJTypeFilter
All Implemented Interfaces:
TypeFilter
public class AspectJTypeFilter
extends Object
implements TypeFilter

Type filter that uses AspectJ type pattern for matching.

A critical implementation details of this type filter is that it does not load the class being examined to match with a type pattern.

Since:
2.5
Author:
Ramnivas Laddad, Juergen Hoeller

Constructor Summary
AspectJTypeFilter(String typePatternExpression, ClassLoader classLoader)
Method Summary
 boolean match(MetadataReader metadataReader, MetadataReaderFactory metadataReaderFactory)
Determine whether this filter matches for the class described by the given metadata.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AspectJTypeFilter

public AspectJTypeFilter(String typePatternExpression,
                         ClassLoader classLoader)
Method Detail

match

public boolean match(MetadataReader metadataReader,
                     MetadataReaderFactory metadataReaderFactory)
              throws IOException
Description copied from interface: TypeFilter
Determine whether this filter matches for the class described by the given metadata.

Specified by:
match in interface TypeFilter
Parameters:
metadataReader - the metadata reader for the target class
metadataReaderFactory - a factory for obtaining metadata readers for other classes (such as superclasses and interfaces)
Returns:
whether this filter matches
Throws:
IOException - in case of I/O failure when reading metadata
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AssignableTypeFilter

org.springframework.core.type.filter
Class AssignableTypeFilter

java.lang.Object
    extended by  org.springframework.core.type.filter.AbstractTypeHierarchyTraversingFilter
        extended by  org.springframework.core.type.filter.AssignableTypeFilter
All Implemented Interfaces:
TypeFilter
public class AssignableTypeFilter
extends AbstractTypeHierarchyTraversingFilter

A simple filter which matches classes that are assignable to a given type.

Since:
2.5
Author:
Rod Johnson, Mark Fisher, Ramnivas Laddad

Constructor Summary
AssignableTypeFilter(Class targetType)
Create a new AssignableTypeFilter for the given type.
Method Summary
protected boolean | matchClassName(String className) Override this to match on type name.
protected Boolean | matchInterface(String interfaceName) Override this to match on interface type name.
protected Boolean | matchSuperClass(String superClassName) Override this to match on super type name.
protected Boolean | matchTargetType(String typeName)
Methods inherited from class org.springframework.core.type.filter.AbstractTypeHierarchyTraversingFilter
match, matchSelf
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AssignableTypeFilter

public AssignableTypeFilter(Class targetType)
Create a new AssignableTypeFilter for the given type.

Parameters:
targetType - the type to match
Method Detail

matchClassName

protected boolean matchClassName(String className)
Description copied from class: AbstractTypeHierarchyTraversingFilter
Override this to match on type name.

Overrides:
matchClassName in class AbstractTypeHierarchyTraversingFilter

matchSuperClass

protected Boolean matchSuperClass(String superClassName)
Description copied from class: AbstractTypeHierarchyTraversingFilter
Override this to match on super type name.

Overrides:
matchSuperClass in class AbstractTypeHierarchyTraversingFilter

matchInterface

protected Boolean matchInterface(String interfaceName)
Description copied from class: AbstractTypeHierarchyTraversingFilter
Override this to match on interface type name.

Overrides:
matchInterface in class AbstractTypeHierarchyTraversingFilter

matchTargetType

protected Boolean matchTargetType(String typeName)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RegexPatternTypeFilter

org.springframework.core.type.filter
Class RegexPatternTypeFilter

java.lang.Object
    extended by  org.springframework.core.type.filter.AbstractClassTestingTypeFilter
        extended by  org.springframework.core.type.filter.RegexPatternTypeFilter
All Implemented Interfaces:
TypeFilter
public class RegexPatternTypeFilter
extends AbstractClassTestingTypeFilter

A simple filter for matching a fully-qualified class name with a regex Pattern.

Since:
2.5
Author:
Mark Fisher, Juergen Hoeller

Constructor Summary
RegexPatternTypeFilter(Pattern pattern)
Method Summary
protected  boolean match(ClassMetadata metadata)
Determine a match based on the given ClassMetadata object.
Methods inherited from class org.springframework.core.type.filter.AbstractClassTestingTypeFilter
match
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

RegexPatternTypeFilter

public RegexPatternTypeFilter(Pattern pattern)
Method Detail

match

protected boolean match(ClassMetadata metadata)
Description copied from class: AbstractClassTestingTypeFilter
Determine a match based on the given ClassMetadata object.

Specified by:
match in class AbstractClassTestingTypeFilter
Parameters:
metadata - the ClassMetadata object
Returns:
whether this filter matches on the specified type
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.dao

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.dao

Exception hierarchy enabling sophisticated error handling independent of the data access approach in use.

See:
Description

Exception Summary
CannotAcquireLockException | Exception thrown on failure to aquire a lock during an update, for example during a "select for update" statement.
CannotSerializeTransactionException | Exception thrown on failure to complete a transaction in serialized mode due to update conflicts.
CleanupFailureDataAccessException | Exception thrown when we couldn't cleanup after a data access operation, but the actual operation went OK.
ConcurrencyFailureException | Exception thrown on concurrency failure.
DataAccessException | Root of the hierarchy of data access exceptions discussed in Expert One-On-One J2EE Design and Development.
DataAccessResourceFailureException | Data access exception thrown when a resource fails completely: for example, if we can't connect to a database using JDBC.
DataIntegrityViolationException | Exception thrown when an attempt to insert or update data results in violation of an integrity constraint.
DataRetrievalFailureException | Exception thrown if certain expected data could not be retrieved, e.g.
DeadlockLoserDataAccessException | Generic exception thrown when the current process was a deadlock loser, and its transaction rolled back.
DuplicateKeyException | Exception thrown when an attempt to insert or update data results in violation of an primary key or unique constraint.
EmptyResultDataAccessException | Data access exception thrown when a result was expected to have at least one row (or element) but zero rows (or elements) were actually returned.
IncorrectResultSizeDataAccessException | Data access exception thrown when a result was not of the expected size, for example when expecting a single row but getting 0 or more than 1 rows.
IncorrectUpdateSemanticsDataAccessException | Data access exception thrown when something unintended appears to have happened with an update, but the transaction hasn't already been rolled back.
InvalidDataAccessApiUsageException | Exception thrown on incorrect usage of the API, such as failing to "compile" a query object that needed compilation before execution.
InvalidDataAccessResourceUsageException | Root for exceptions thrown when we use a data access resource incorrectly.
NonTransientDataAccessException | Root of the hierarchy of data access exceptions that are considered non-transient - where a retry of the same operation would fail unless the cause of the Exception is corrected.
NonTransientDataAccessResourceException | Data access exception thrown when a resource fails completely and the failure is permanent.
OptimisticLockingFailureException | Exception thrown on an optimistic locking violation.
PermissionDeniedDataAccessException | Exception thrown when the underlying resource denied a permission to access a specific element, such as a specific database table.
PessimisticLockingFailureException | Exception thrown on a pessimistic locking violation.
RecoverableDataAccessException | Data access exception thrown when a previously failed operation might be able to succeed if the application performs some recovery steps and retries the entire transaction or in the case of a distributed transaction, the transaction branch.
TransientDataAccessException | Root of the hierarchy of data access exceptions that are considered transient - where a previously failed operation might be able to succeed when the operation is retried without any intervention by application-level functionality.
TransientDataAccessResourceException | Data access exception thrown when a resource fails temporarily and the operation can be retried.
TypeMismatchDataAccessException | Exception thrown on mismatch between Java type and database type: for example on an attempt to set an object of the wrong type in an RDBMS column.
UncategorizedDataAccessException | Normal superclass when we can't distinguish anything more specific than "something went wrong with the underlying resource": for example, a SQLException from JDBC we can't pinpoint more precisely.

Package org.springframework.dao Description

Exception hierarchy enabling sophisticated error handling independent of the data access approach in use. For example, when DAOs and data access frameworks use the exceptions in this package (and custom subclasses), calling code can detect and handle common problems such as deadlocks without being tied to a particular data access strategy, such as JDBC.

All these exceptions are unchecked, meaning that calling code can leave them uncaught and treat all data access exceptions as fatal.

The classes in this package are discussed in Chapter 9 of Expert One-On-One J2EE Design and Development by Rod Johnson (Wrox, 2002).


org.springframework.dao Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.dao

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.dao.DataAccessException
              • org.springframework.dao.NonTransientDataAccessException
                • org.springframework.dao.CleanupFailureDataAccessException
                • org.springframework.dao.DataIntegrityViolationException
                  • org.springframework.dao.DuplicateKeyException
                • org.springframework.dao.DataRetrievalFailureException
                  • org.springframework.dao.IncorrectResultSizeDataAccessException
                    • org.springframework.dao.EmptyResultDataAccessException
                • org.springframework.dao.InvalidDataAccessApiUsageException
                • org.springframework.dao.InvalidDataAccessResourceUsageException
                  • org.springframework.dao.IncorrectUpdateSemanticsDataAccessException
                  • org.springframework.dao.TypeMismatchDataAccessException
                • org.springframework.dao.NonTransientDataAccessResourceException
                  • org.springframework.dao.DataAccessResourceFailureException
                • org.springframework.dao.PermissionDeniedDataAccessException
                • org.springframework.dao.UncategorizedDataAccessException
              • org.springframework.dao.RecoverableDataAccessException
              • org.springframework.dao.TransientDataAccessException
                • org.springframework.dao.ConcurrencyFailureException
                  • org.springframework.dao.OptimisticLockingFailureException
                  • org.springframework.dao.PessimisticLockingFailureException
                    • org.springframework.dao.CannotAcquireLockException
                    • org.springframework.dao.CannotSerializeTransactionException
                    • org.springframework.dao.DeadlockLoserDataAccessException
                • org.springframework.dao.TransientDataAccessResourceException


CannotAcquireLockException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.dao
Class CannotAcquireLockException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.TransientDataAccessException
                            extended by  org.springframework.dao.ConcurrencyFailureException
                                extended by  org.springframework.dao.PessimisticLockingFailureException
                                    extended by  org.springframework.dao.CannotAcquireLockException
All Implemented Interfaces:
Serializable
public class CannotAcquireLockException
extends PessimisticLockingFailureException

Exception thrown on failure to aquire a lock during an update, for example during a "select for update" statement.

Author:
Rod Johnson
See Also:
Serialized Form

Constructor Summary
CannotAcquireLockException(String msg)
Constructor for CannotAcquireLockException.
CannotAcquireLockException(String msg, Throwable cause)
Constructor for CannotAcquireLockException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

CannotAcquireLockException

public CannotAcquireLockException(String msg)
Constructor for CannotAcquireLockException.

Parameters:
msg - the detail message

CannotAcquireLockException

public CannotAcquireLockException(String msg,
                                  Throwable cause)
Constructor for CannotAcquireLockException.

Parameters:
msg - the detail message
cause - the root cause from the data access API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


CannotSerializeTransactionException

org.springframework.dao
Class CannotSerializeTransactionException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.TransientDataAccessException
                            extended by  org.springframework.dao.ConcurrencyFailureException
                                extended by  org.springframework.dao.PessimisticLockingFailureException
                                    extended by  org.springframework.dao.CannotSerializeTransactionException
All Implemented Interfaces:
Serializable
public class CannotSerializeTransactionException
extends PessimisticLockingFailureException

Exception thrown on failure to complete a transaction in serialized mode due to update conflicts.

Author:
Rod Johnson
See Also:
Serialized Form

Constructor Summary
CannotSerializeTransactionException(String msg)
Constructor for CannotSerializeTransactionException.
CannotSerializeTransactionException(String msg, Throwable cause)
Constructor for CannotSerializeTransactionException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

CannotSerializeTransactionException

public CannotSerializeTransactionException(String msg)
Constructor for CannotSerializeTransactionException.

Parameters:
msg - the detail message

CannotSerializeTransactionException

public CannotSerializeTransactionException(String msg,
                                           Throwable cause)
Constructor for CannotSerializeTransactionException.

Parameters:
msg - the detail message
cause - the root cause from the data access API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CleanupFailureDataAccessException

org.springframework.dao
Class CleanupFailureDataAccessException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.CleanupFailureDataAccessException
All Implemented Interfaces:
Serializable
public class CleanupFailureDataAccessException
extends NonTransientDataAccessException

Exception thrown when we couldn't cleanup after a data access operation, but the actual operation went OK.

For example, this exception or a subclass might be thrown if a JDBC Connection couldn't be closed after it had been used successfully.

Note that data access code might perform resources cleanup in a finally block and therefore log cleanup failure rather than rethrow it, to keep the original data access exception, if any.

Author:
Rod Johnson
See Also:
Serialized Form

Constructor Summary
CleanupFailureDataAccessException(String msg, Throwable cause)
Constructor for CleanupFailureDataAccessException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

CleanupFailureDataAccessException

public CleanupFailureDataAccessException(String msg,
                                         Throwable cause)
Constructor for CleanupFailureDataAccessException.

Parameters:
msg - the detail message
cause - the root cause from the underlying data access API, such as JDBC
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConcurrencyFailureException

org.springframework.dao
Class ConcurrencyFailureException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.TransientDataAccessException
                            extended by  org.springframework.dao.ConcurrencyFailureException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
OptimisticLockingFailureException, PessimisticLockingFailureException
public class ConcurrencyFailureException
extends TransientDataAccessException

Exception thrown on concurrency failure.

This exception should be subclassed to indicate the type of failure: optimistic locking, failure to acquire lock, etc.

Since:
1.1
Author:
Thomas Risberg
See Also:
OptimisticLockingFailureException, PessimisticLockingFailureException, CannotAcquireLockException, DeadlockLoserDataAccessException, Serialized Form

Constructor Summary
ConcurrencyFailureException(String msg)
Constructor for ConcurrencyFailureException.
ConcurrencyFailureException(String msg, Throwable cause)
Constructor for ConcurrencyFailureException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ConcurrencyFailureException

public ConcurrencyFailureException(String msg)
Constructor for ConcurrencyFailureException.

Parameters:
msg - the detail message

ConcurrencyFailureException

public ConcurrencyFailureException(String msg,
                                   Throwable cause)
Constructor for ConcurrencyFailureException.

Parameters:
msg - the detail message
cause - the root cause from the data access API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DataAccessException

org.springframework.dao
Class DataAccessException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
NonTransientDataAccessException, RecoverableDataAccessException, TransientDataAccessException
public abstract class DataAccessException
extends NestedRuntimeException

Root of the hierarchy of data access exceptions discussed in Expert One-On-One J2EE Design and Development. Please see Chapter 9 of this book for detailed discussion of the motivation for this package.

This exception hierarchy aims to let user code find and handle the kind of error encountered without knowing the details of the particular data access API in use (e.g. JDBC). Thus it is possible to react to an optimistic locking failure without knowing that JDBC is being used.

As this class is a runtime exception, there is no need for user code to catch it or subclasses if any error is to be considered fatal (the usual case).

Author:
Rod Johnson
See Also:
Serialized Form

Constructor Summary
DataAccessException(String msg)
Constructor for DataAccessException.
DataAccessException(String msg, Throwable cause)
Constructor for DataAccessException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

DataAccessException

public DataAccessException(String msg)
Constructor for DataAccessException.

Parameters:
msg - the detail message

DataAccessException

public DataAccessException(String msg,
                           Throwable cause)
Constructor for DataAccessException.

Parameters:
msg - the detail message
cause - the root cause (usually from using a underlying data access API such as JDBC)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DataAccessResourceFailureException

org.springframework.dao
Class DataAccessResourceFailureException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.NonTransientDataAccessResourceException
                                extended by  org.springframework.dao.DataAccessResourceFailureException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CannotCreateRecordException, CannotGetCciConnectionException, CannotGetJdbcConnectionException, JdoResourceFailureException
public class DataAccessResourceFailureException
extends NonTransientDataAccessResourceException

Data access exception thrown when a resource fails completely: for example, if we can't connect to a database using JDBC.

Author:
Rod Johnson, Thomas Risberg
See Also:
Serialized Form

Constructor Summary
DataAccessResourceFailureException(String msg)
Constructor for DataAccessResourceFailureException.
DataAccessResourceFailureException(String msg, Throwable cause)
Constructor for DataAccessResourceFailureException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

DataAccessResourceFailureException

public DataAccessResourceFailureException(String msg)
Constructor for DataAccessResourceFailureException.

Parameters:
msg - the detail message

DataAccessResourceFailureException

public DataAccessResourceFailureException(String msg,
                                          Throwable cause)
Constructor for DataAccessResourceFailureException.

Parameters:
msg - the detail message
cause - the root cause from the data access API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DataIntegrityViolationException

org.springframework.dao
Class DataIntegrityViolationException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.DataIntegrityViolationException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DuplicateKeyException
public class DataIntegrityViolationException
extends NonTransientDataAccessException

Exception thrown when an attempt to insert or update data results in violation of an integrity constraint. Note that this is not purely a relational concept; unique primary keys are required by most database types.

Author:
Rod Johnson
See Also:
Serialized Form

Constructor Summary
DataIntegrityViolationException(String msg)
Constructor for DataIntegrityViolationException.
DataIntegrityViolationException(String msg, Throwable cause)
Constructor for DataIntegrityViolationException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

DataIntegrityViolationException

public DataIntegrityViolationException(String msg)
Constructor for DataIntegrityViolationException.

Parameters:
msg - the detail message

DataIntegrityViolationException

public DataIntegrityViolationException(String msg,
                                       Throwable cause)
Constructor for DataIntegrityViolationException.

Parameters:
msg - the detail message
cause - the root cause from the data access API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DataRetrievalFailureException

org.springframework.dao
Class DataRetrievalFailureException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.DataRetrievalFailureException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
IncorrectResultSetColumnCountException, IncorrectResultSizeDataAccessException, LobRetrievalFailureException, ObjectRetrievalFailureException
public class DataRetrievalFailureException
extends NonTransientDataAccessException

Exception thrown if certain expected data could not be retrieved, e.g. when looking up specific data via a known identifier. This exception will be thrown either by O/R mapping tools or by DAO implementations.

Since:
13.10.2003
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
DataRetrievalFailureException(String msg)
Constructor for DataRetrievalFailureException.
DataRetrievalFailureException(String msg, Throwable cause)
Constructor for DataRetrievalFailureException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

DataRetrievalFailureException

public DataRetrievalFailureException(String msg)
Constructor for DataRetrievalFailureException.

Parameters:
msg - the detail message

DataRetrievalFailureException

public DataRetrievalFailureException(String msg,
                                     Throwable cause)
Constructor for DataRetrievalFailureException.

Parameters:
msg - the detail message
cause - the root cause from the data access API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DeadlockLoserDataAccessException

org.springframework.dao
Class DeadlockLoserDataAccessException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.TransientDataAccessException
                            extended by  org.springframework.dao.ConcurrencyFailureException
                                extended by  org.springframework.dao.PessimisticLockingFailureException
                                    extended by  org.springframework.dao.DeadlockLoserDataAccessException
All Implemented Interfaces:
Serializable
public class DeadlockLoserDataAccessException
extends PessimisticLockingFailureException

Generic exception thrown when the current process was a deadlock loser, and its transaction rolled back.

Author:
Rod Johnson
See Also:
Serialized Form

Constructor Summary
DeadlockLoserDataAccessException(String msg, Throwable cause)
Constructor for DeadlockLoserDataAccessException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

DeadlockLoserDataAccessException

public DeadlockLoserDataAccessException(String msg,
                                        Throwable cause)
Constructor for DeadlockLoserDataAccessException.

Parameters:
msg - the detail message
cause - the root cause from the data access API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DuplicateKeyException

org.springframework.dao
Class DuplicateKeyException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.DataIntegrityViolationException
                                extended by  org.springframework.dao.DuplicateKeyException
All Implemented Interfaces:
Serializable
public class DuplicateKeyException
extends DataIntegrityViolationException

Exception thrown when an attempt to insert or update data results in violation of an primary key or unique constraint. Note that this is not necessarily a purely relational concept; unique primary keys are required by most database types.

Author:
Thomas Risberg
See Also:
Serialized Form

Constructor Summary
DuplicateKeyException(String msg)
Constructor for DuplicateKeyException.
DuplicateKeyException(String msg, Throwable cause)
Constructor for DuplicateKeyException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

DuplicateKeyException

public DuplicateKeyException(String msg)
Constructor for DuplicateKeyException.

Parameters:
msg - the detail message

DuplicateKeyException

public DuplicateKeyException(String msg,
                             Throwable cause)
Constructor for DuplicateKeyException.

Parameters:
msg - the detail message
cause - the root cause from the data access API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EmptyResultDataAccessException

org.springframework.dao
Class EmptyResultDataAccessException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.DataRetrievalFailureException
                                extended by  org.springframework.dao.IncorrectResultSizeDataAccessException
                                    extended by  org.springframework.dao.EmptyResultDataAccessException
All Implemented Interfaces:
Serializable
public class EmptyResultDataAccessException
extends IncorrectResultSizeDataAccessException

Data access exception thrown when a result was expected to have at least one row (or element) but zero rows (or elements) were actually returned.

Since:
2.0
Author:
Juergen Hoeller
See Also:
IncorrectResultSizeDataAccessException, Serialized Form

Constructor Summary
EmptyResultDataAccessException(int expectedSize)
Constructor for EmptyResultDataAccessException.
EmptyResultDataAccessException(String msg, int expectedSize)
Constructor for EmptyResultDataAccessException.
Method Summary
Methods inherited from class org.springframework.dao.IncorrectResultSizeDataAccessException
getActualSize, getExpectedSize
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

EmptyResultDataAccessException

public EmptyResultDataAccessException(int expectedSize)
Constructor for EmptyResultDataAccessException.

Parameters:
expectedSize - the expected result size

EmptyResultDataAccessException

public EmptyResultDataAccessException(String msg,
                                      int expectedSize)
Constructor for EmptyResultDataAccessException.

Parameters:
msg - the detail message
expectedSize - the expected result size
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


IncorrectResultSizeDataAccessException

org.springframework.dao
Class IncorrectResultSizeDataAccessException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.DataRetrievalFailureException
                                extended by  org.springframework.dao.IncorrectResultSizeDataAccessException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
EmptyResultDataAccessException
public class IncorrectResultSizeDataAccessException
extends DataRetrievalFailureException

Data access exception thrown when a result was not of the expected size, for example when expecting a single row but getting 0 or more than 1 rows.

Since:
1.0.2
Author:
Juergen Hoeller
See Also:
EmptyResultDataAccessException, Serialized Form

Constructor Summary
IncorrectResultSizeDataAccessException(int expectedSize)
Constructor for IncorrectResultSizeDataAccessException.
IncorrectResultSizeDataAccessException(int expectedSize, int actualSize)
Constructor for IncorrectResultSizeDataAccessException.
IncorrectResultSizeDataAccessException(String msg, int expectedSize)
Constructor for IncorrectResultSizeDataAccessException.
IncorrectResultSizeDataAccessException(String msg, int expectedSize, int actualSize)
Constructor for IncorrectResultSizeDataAccessException.
Method Summary
int | getActualSize() Return the actual result size (or -1 if unknown).
int | getExpectedSize() Return the expected result size.
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

IncorrectResultSizeDataAccessException

public IncorrectResultSizeDataAccessException(int expectedSize)
Constructor for IncorrectResultSizeDataAccessException.

Parameters:
expectedSize - the expected result size

IncorrectResultSizeDataAccessException

public IncorrectResultSizeDataAccessException(int expectedSize,
                                              int actualSize)
Constructor for IncorrectResultSizeDataAccessException.

Parameters:
expectedSize - the expected result size
actualSize - the actual result size (or -1 if unknown)

IncorrectResultSizeDataAccessException

public IncorrectResultSizeDataAccessException(String msg,
                                              int expectedSize)
Constructor for IncorrectResultSizeDataAccessException.

Parameters:
msg - the detail message
expectedSize - the expected result size

IncorrectResultSizeDataAccessException

public IncorrectResultSizeDataAccessException(String msg,
                                              int expectedSize,
                                              int actualSize)
Constructor for IncorrectResultSizeDataAccessException.

Parameters:
msg - the detail message
expectedSize - the expected result size
actualSize - the actual result size (or -1 if unknown)
Method Detail

getExpectedSize

public int getExpectedSize()
Return the expected result size.

getActualSize

public int getActualSize()
Return the actual result size (or -1 if unknown).

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


IncorrectUpdateSemanticsDataAccessException

org.springframework.dao
Class IncorrectUpdateSemanticsDataAccessException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.InvalidDataAccessResourceUsageException
                                extended by  org.springframework.dao.IncorrectUpdateSemanticsDataAccessException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
JdbcUpdateAffectedIncorrectNumberOfRowsException
public class IncorrectUpdateSemanticsDataAccessException
extends InvalidDataAccessResourceUsageException

Data access exception thrown when something unintended appears to have happened with an update, but the transaction hasn't already been rolled back. Thrown, for example, when we wanted to update 1 row in an RDBMS but actually updated 3.

Author:
Rod Johnson
See Also:
Serialized Form

Constructor Summary
IncorrectUpdateSemanticsDataAccessException(String msg)
Constructor for IncorrectUpdateSemanticsDataAccessException.
IncorrectUpdateSemanticsDataAccessException(String msg, Throwable cause)
Constructor for IncorrectUpdateSemanticsDataAccessException.
Method Summary
 boolean wasDataUpdated()
Return whether data was updated.
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

IncorrectUpdateSemanticsDataAccessException

public IncorrectUpdateSemanticsDataAccessException(String msg)
Constructor for IncorrectUpdateSemanticsDataAccessException.

Parameters:
msg - the detail message

IncorrectUpdateSemanticsDataAccessException

public IncorrectUpdateSemanticsDataAccessException(String msg,
                                                   Throwable cause)
Constructor for IncorrectUpdateSemanticsDataAccessException.

Parameters:
msg - the detail message
cause - the root cause from the underlying API, such as JDBC
Method Detail

wasDataUpdated

public boolean wasDataUpdated()
Return whether data was updated. If this method returns false, there's nothing to roll back.

The default implementation always returns true. This can be overridden in subclasses.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InvalidDataAccessApiUsageException

org.springframework.dao
Class InvalidDataAccessApiUsageException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.InvalidDataAccessApiUsageException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
JdoUsageException, SqlXmlFeatureNotImplementedException
public class InvalidDataAccessApiUsageException
extends NonTransientDataAccessException

Exception thrown on incorrect usage of the API, such as failing to "compile" a query object that needed compilation before execution.

This represents a problem in our Java data access framework, not the underlying data access infrastructure.

Author:
Rod Johnson
See Also:
Serialized Form

Constructor Summary
InvalidDataAccessApiUsageException(String msg)
Constructor for InvalidDataAccessApiUsageException.
InvalidDataAccessApiUsageException(String msg, Throwable cause)
Constructor for InvalidDataAccessApiUsageException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

InvalidDataAccessApiUsageException

public InvalidDataAccessApiUsageException(String msg)
Constructor for InvalidDataAccessApiUsageException.

Parameters:
msg - the detail message

InvalidDataAccessApiUsageException

public InvalidDataAccessApiUsageException(String msg,
                                          Throwable cause)
Constructor for InvalidDataAccessApiUsageException.

Parameters:
msg - the detail message
cause - the root cause from the data access API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InvalidDataAccessResourceUsageException

org.springframework.dao
Class InvalidDataAccessResourceUsageException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.InvalidDataAccessResourceUsageException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
BadSqlGrammarException, CciOperationNotSupportedException, HibernateQueryException, IncorrectUpdateSemanticsDataAccessException, InvalidResultSetAccessException, InvalidResultSetAccessException, RecordTypeNotSupportedException, TypeMismatchDataAccessException
public class InvalidDataAccessResourceUsageException
extends NonTransientDataAccessException

Root for exceptions thrown when we use a data access resource incorrectly. Thrown for example on specifying bad SQL when using a RDBMS. Resource-specific subclasses are supplied by concrete data access packages.

Author:
Rod Johnson
See Also:
Serialized Form

Constructor Summary
InvalidDataAccessResourceUsageException(String msg)
Constructor for InvalidDataAccessResourceUsageException.
InvalidDataAccessResourceUsageException(String msg, Throwable cause)
Constructor for InvalidDataAccessResourceUsageException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

InvalidDataAccessResourceUsageException

public InvalidDataAccessResourceUsageException(String msg)
Constructor for InvalidDataAccessResourceUsageException.

Parameters:
msg - the detail message

InvalidDataAccessResourceUsageException

public InvalidDataAccessResourceUsageException(String msg,
                                               Throwable cause)
Constructor for InvalidDataAccessResourceUsageException.

Parameters:
msg - the detail message
cause - the root cause from the data access API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NonTransientDataAccessException

org.springframework.dao
Class NonTransientDataAccessException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CleanupFailureDataAccessException, DataIntegrityViolationException, DataRetrievalFailureException, DataSourceLookupFailureException, InvalidDataAccessApiUsageException, InvalidDataAccessResourceUsageException, NonTransientDataAccessResourceException, PermissionDeniedDataAccessException, UncategorizedDataAccessException
public abstract class NonTransientDataAccessException
extends DataAccessException

Root of the hierarchy of data access exceptions that are considered non-transient - where a retry of the same operation would fail unless the cause of the Exception is corrected.

Since:
2.5
Author:
Thomas Risberg
See Also:
SQLNonTransientException, Serialized Form

Constructor Summary
NonTransientDataAccessException(String msg)
Constructor for NonTransientDataAccessException.
NonTransientDataAccessException(String msg, Throwable cause)
Constructor for NonTransientDataAccessException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

NonTransientDataAccessException

public NonTransientDataAccessException(String msg)
Constructor for NonTransientDataAccessException.

Parameters:
msg - the detail message

NonTransientDataAccessException

public NonTransientDataAccessException(String msg,
                                       Throwable cause)
Constructor for NonTransientDataAccessException.

Parameters:
msg - the detail message
cause - the root cause (usually from using a underlying data access API such as JDBC)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NonTransientDataAccessResourceException

org.springframework.dao
Class NonTransientDataAccessResourceException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.NonTransientDataAccessResourceException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DataAccessResourceFailureException
public class NonTransientDataAccessResourceException
extends NonTransientDataAccessException

Data access exception thrown when a resource fails completely and the failure is permanent.

Since:
2.5
Author:
Thomas Risberg
See Also:
SQLNonTransientConnectionException, Serialized Form

Constructor Summary
NonTransientDataAccessResourceException(String msg)
Constructor for NonTransientDataAccessResourceException.
NonTransientDataAccessResourceException(String msg, Throwable cause)
Constructor for NonTransientDataAccessResourceException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

NonTransientDataAccessResourceException

public NonTransientDataAccessResourceException(String msg)
Constructor for NonTransientDataAccessResourceException.

Parameters:
msg - the detail message

NonTransientDataAccessResourceException

public NonTransientDataAccessResourceException(String msg,
                                               Throwable cause)
Constructor for NonTransientDataAccessResourceException.

Parameters:
msg - the detail message
cause - the root cause from the data access API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OptimisticLockingFailureException

org.springframework.dao
Class OptimisticLockingFailureException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.TransientDataAccessException
                            extended by  org.springframework.dao.ConcurrencyFailureException
                                extended by  org.springframework.dao.OptimisticLockingFailureException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ObjectOptimisticLockingFailureException
public class OptimisticLockingFailureException
extends ConcurrencyFailureException

Exception thrown on an optimistic locking violation.

This exception will be thrown either by O/R mapping tools or by custom DAO implementations. Optimistic locking failure is typically not detected by the database itself.

Author:
Rod Johnson
See Also:
PessimisticLockingFailureException, Serialized Form

Constructor Summary
OptimisticLockingFailureException(String msg)
Constructor for OptimisticLockingFailureException.
OptimisticLockingFailureException(String msg, Throwable cause)
Constructor for OptimisticLockingFailureException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

OptimisticLockingFailureException

public OptimisticLockingFailureException(String msg)
Constructor for OptimisticLockingFailureException.

Parameters:
msg - the detail message

OptimisticLockingFailureException

public OptimisticLockingFailureException(String msg,
                                         Throwable cause)
Constructor for OptimisticLockingFailureException.

Parameters:
msg - the detail message
cause - the root cause from the data access API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PermissionDeniedDataAccessException

org.springframework.dao
Class PermissionDeniedDataAccessException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.PermissionDeniedDataAccessException
All Implemented Interfaces:
Serializable
public class PermissionDeniedDataAccessException
extends NonTransientDataAccessException

Exception thrown when the underlying resource denied a permission to access a specific element, such as a specific database table.

Since:
2.0
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
PermissionDeniedDataAccessException(String msg, Throwable cause)
Constructor for PermissionDeniedDataAccessException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

PermissionDeniedDataAccessException

public PermissionDeniedDataAccessException(String msg,
                                           Throwable cause)
Constructor for PermissionDeniedDataAccessException.

Parameters:
msg - the detail message
cause - the root cause from the underlying data access API, such as JDBC
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PessimisticLockingFailureException

org.springframework.dao
Class PessimisticLockingFailureException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.TransientDataAccessException
                            extended by  org.springframework.dao.ConcurrencyFailureException
                                extended by  org.springframework.dao.PessimisticLockingFailureException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CannotAcquireLockException, CannotSerializeTransactionException, DeadlockLoserDataAccessException
public class PessimisticLockingFailureException
extends ConcurrencyFailureException

Exception thrown on a pessimistic locking violation. Thrown by Spring's SQLException translation mechanism if a corresponding database error is encountered.

Serves as superclass for more specific exceptions, like CannotAcquireLockException and DeadlockLoserDataAccessException.

Since:
1.2
Author:
Thomas Risberg
See Also:
CannotAcquireLockException, DeadlockLoserDataAccessException, OptimisticLockingFailureException, Serialized Form

Constructor Summary
PessimisticLockingFailureException(String msg)
Constructor for PessimisticLockingFailureException.
PessimisticLockingFailureException(String msg, Throwable cause)
Constructor for PessimisticLockingFailureException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

PessimisticLockingFailureException

public PessimisticLockingFailureException(String msg)
Constructor for PessimisticLockingFailureException.

Parameters:
msg - the detail message

PessimisticLockingFailureException

public PessimisticLockingFailureException(String msg,
                                          Throwable cause)
Constructor for PessimisticLockingFailureException.

Parameters:
msg - the detail message
cause - the root cause from the data access API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RecoverableDataAccessException

org.springframework.dao
Class RecoverableDataAccessException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.RecoverableDataAccessException
All Implemented Interfaces:
Serializable
public class RecoverableDataAccessException
extends DataAccessException

Data access exception thrown when a previously failed operation might be able to succeed if the application performs some recovery steps and retries the entire transaction or in the case of a distributed transaction, the transaction branch. At a minimum, the recovery operation must include closing the current connection and getting a new connection.

Since:
2.5
Author:
Thomas Risberg
See Also:
SQLRecoverableException, Serialized Form

Constructor Summary
RecoverableDataAccessException(String msg)
Constructor for RecoverableDataAccessException.
RecoverableDataAccessException(String msg, Throwable cause)
Constructor for RecoverableDataAccessException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

RecoverableDataAccessException

public RecoverableDataAccessException(String msg)
Constructor for RecoverableDataAccessException.

Parameters:
msg - the detail message

RecoverableDataAccessException

public RecoverableDataAccessException(String msg,
                                      Throwable cause)
Constructor for RecoverableDataAccessException.

Parameters:
msg - the detail message
cause - the root cause (usually from using a underlying data access API such as JDBC)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransientDataAccessException

org.springframework.dao
Class TransientDataAccessException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.TransientDataAccessException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ConcurrencyFailureException, TransientDataAccessResourceException
public abstract class TransientDataAccessException
extends DataAccessException

Root of the hierarchy of data access exceptions that are considered transient - where a previously failed operation might be able to succeed when the operation is retried without any intervention by application-level functionality.

Since:
2.5
Author:
Thomas Risberg
See Also:
SQLTransientException, Serialized Form

Constructor Summary
TransientDataAccessException(String msg)
Constructor for TransientDataAccessException.
TransientDataAccessException(String msg, Throwable cause)
Constructor for TransientDataAccessException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

TransientDataAccessException

public TransientDataAccessException(String msg)
Constructor for TransientDataAccessException.

Parameters:
msg - the detail message

TransientDataAccessException

public TransientDataAccessException(String msg,
                                    Throwable cause)
Constructor for TransientDataAccessException.

Parameters:
msg - the detail message
cause - the root cause (usually from using a underlying data access API such as JDBC)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransientDataAccessResourceException

org.springframework.dao
Class TransientDataAccessResourceException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.TransientDataAccessException
                            extended by  org.springframework.dao.TransientDataAccessResourceException
All Implemented Interfaces:
Serializable
public class TransientDataAccessResourceException
extends TransientDataAccessException

Data access exception thrown when a resource fails temporarily and the operation can be retried.

Since:
2.5
Author:
Thomas Risberg
See Also:
SQLTransientConnectionException, Serialized Form

Constructor Summary
TransientDataAccessResourceException(String msg)
Constructor for TransientDataAccessResourceException.
TransientDataAccessResourceException(String msg, Throwable cause)
Constructor for TransientDataAccessResourceException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

TransientDataAccessResourceException

public TransientDataAccessResourceException(String msg)
Constructor for TransientDataAccessResourceException.

Parameters:
msg - the detail message

TransientDataAccessResourceException

public TransientDataAccessResourceException(String msg,
                                            Throwable cause)
Constructor for TransientDataAccessResourceException.

Parameters:
msg - the detail message
cause - the root cause from the data access API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TypeMismatchDataAccessException

org.springframework.dao
Class TypeMismatchDataAccessException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.InvalidDataAccessResourceUsageException
                                extended by  org.springframework.dao.TypeMismatchDataAccessException
All Implemented Interfaces:
Serializable
public class TypeMismatchDataAccessException
extends InvalidDataAccessResourceUsageException

Exception thrown on mismatch between Java type and database type: for example on an attempt to set an object of the wrong type in an RDBMS column.

Author:
Rod Johnson
See Also:
Serialized Form

Constructor Summary
TypeMismatchDataAccessException(String msg)
Constructor for TypeMismatchDataAccessException.
TypeMismatchDataAccessException(String msg, Throwable cause)
Constructor for TypeMismatchDataAccessException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

TypeMismatchDataAccessException

public TypeMismatchDataAccessException(String msg)
Constructor for TypeMismatchDataAccessException.

Parameters:
msg - the detail message

TypeMismatchDataAccessException

public TypeMismatchDataAccessException(String msg,
                                       Throwable cause)
Constructor for TypeMismatchDataAccessException.

Parameters:
msg - the detail message
cause - the root cause from the data access API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UncategorizedDataAccessException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.dao
Class UncategorizedDataAccessException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.UncategorizedDataAccessException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
HibernateJdbcException, HibernateSystemException, JdoSystemException, JpaSystemException, SQLWarningException, UncategorizedSQLException
public abstract class UncategorizedDataAccessException
extends NonTransientDataAccessException

Normal superclass when we can't distinguish anything more specific than "something went wrong with the underlying resource": for example, a SQLException from JDBC we can't pinpoint more precisely.

Author:
Rod Johnson
See Also:
Serialized Form

Constructor Summary
UncategorizedDataAccessException(String msg, Throwable cause)
Constructor for UncategorizedDataAccessException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

UncategorizedDataAccessException

public UncategorizedDataAccessException(String msg,
                                        Throwable cause)
Constructor for UncategorizedDataAccessException.

Parameters:
msg - the detail message
cause - the exception thrown by underlying data access API
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.dao.annotation

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.dao.annotation

Annotation support for DAOs.

See:
Description

Class Summary
PersistenceExceptionTranslationAdvisor | Spring AOP exception translation aspect for use at Repository or DAO layer level.
PersistenceExceptionTranslationPostProcessor | Bean post-processor that automatically applies persistence exception translation to any bean that carries the Repository annotation, adding a corresponding PersistenceExceptionTranslationAdvisor to the exposed proxy (either an existing AOP proxy or a newly generated proxy that implements all of the target's interfaces).

Package org.springframework.dao.annotation Description

Annotation support for DAOs. Contains a bean post-processor for translating persistence exceptions based on a repository stereotype annotation.


org.springframework.dao.annotation Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.dao.annotation

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.aop.support.AbstractPointcutAdvisor (implements org.springframework.core.Ordered, org.springframework.aop.PointcutAdvisor, java.io.Serializable)
      • org.springframework.dao.annotation.PersistenceExceptionTranslationAdvisor
    • org.springframework.aop.framework.ProxyConfig (implements java.io.Serializable)
      • org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.core.Ordered)


PersistenceExceptionTranslationAdvisor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.dao.annotation
Class PersistenceExceptionTranslationAdvisor

java.lang.Object
    extended by  org.springframework.aop.support.AbstractPointcutAdvisor
        extended by  org.springframework.dao.annotation.PersistenceExceptionTranslationAdvisor
All Implemented Interfaces:
Serializable, Advisor, PointcutAdvisor, Ordered
public class PersistenceExceptionTranslationAdvisor
extends AbstractPointcutAdvisor

Spring AOP exception translation aspect for use at Repository or DAO layer level. Translates native persistence exceptions into Spring's DataAccessException hierarchy, based on a given PersistenceExceptionTranslator.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller
See Also:
DataAccessException, PersistenceExceptionTranslator, Serialized Form

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
PersistenceExceptionTranslationAdvisor(PersistenceExceptionTranslator persistenceExceptionTranslator, Class<? extends Annotation> repositoryAnnotationType)
Create a new PersistenceExceptionTranslationAdvisor.
Method Summary
Advice | getAdvice() Return the advice part of this aspect.
Pointcut | getPointcut() Get the Pointcut that drives this advisor.
Methods inherited from class org.springframework.aop.support.AbstractPointcutAdvisor
equals, getOrder, hashCode, isPerInstance, setOrder
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PersistenceExceptionTranslationAdvisor

public PersistenceExceptionTranslationAdvisor(PersistenceExceptionTranslator persistenceExceptionTranslator,
                                              Class<? extends Annotation> repositoryAnnotationType)
Create a new PersistenceExceptionTranslationAdvisor.

Parameters:
persistenceExceptionTranslator - the PersistenceExceptionTranslator to use
repositoryAnnotationType - the annotation type to check for
Method Detail

getAdvice

public Advice getAdvice()
Description copied from interface: Advisor
Return the advice part of this aspect. An advice may be an interceptor, a before advice, a throws advice, etc.

Returns:
the advice that should apply if the pointcut matches
See Also:
MethodInterceptor, BeforeAdvice, ThrowsAdvice, AfterReturningAdvice

getPointcut

public Pointcut getPointcut()
Description copied from interface: PointcutAdvisor
Get the Pointcut that drives this advisor.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


PersistenceExceptionTranslationPostProcessor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.dao.annotation
Class PersistenceExceptionTranslationPostProcessor

java.lang.Object
    extended by  org.springframework.aop.framework.ProxyConfig
        extended by  org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor
All Implemented Interfaces:
Serializable, BeanClassLoaderAware, BeanFactoryAware, BeanPostProcessor, Ordered
public class PersistenceExceptionTranslationPostProcessor
extends ProxyConfig
implements BeanPostProcessor, BeanClassLoaderAware, BeanFactoryAware, Ordered

Bean post-processor that automatically applies persistence exception translation to any bean that carries the Repository annotation, adding a corresponding PersistenceExceptionTranslationAdvisor to the exposed proxy (either an existing AOP proxy or a newly generated proxy that implements all of the target's interfaces).

Translates native resource exceptions to Spring's DataAccessException hierarchy. Autodetects beans that implement the PersistenceExceptionTranslator interface, which are subsequently asked to translate candidate exceptions.

All of Spring's applicable resource factories implement the PersistenceExceptionTranslator interface out of the box. As a consequence, all that is usually needed to enable automatic exception translation is marking all affected beans (such as DAOs) with the Repository annotation, along with defining this post-processor as bean in the application context.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller
See Also:
PersistenceExceptionTranslationAdvisor, Repository, DataAccessException, PersistenceExceptionTranslator, Serialized Form

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
PersistenceExceptionTranslationPostProcessor()
Method Summary
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
Object | postProcessAfterInitialization(Object bean, String beanName) Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).
Object | postProcessBeforeInitialization(Object bean, String beanName) Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).
void | setBeanClassLoader(ClassLoader classLoader) Callback that supplies the bean class loader to a bean instance.
void | setBeanFactory(BeanFactory beanFactory) Callback that supplies the owning factory to a bean instance.
void | setRepositoryAnnotationType(Class<? extends Annotation> repositoryAnnotationType) Set the 'repository' annotation type.
Methods inherited from class org.springframework.aop.framework.ProxyConfig
copyFrom, isExposeProxy, isFrozen, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setFrozen, setOpaque, setOptimize, setProxyTargetClass, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

PersistenceExceptionTranslationPostProcessor

public PersistenceExceptionTranslationPostProcessor()
Method Detail

setRepositoryAnnotationType

public void setRepositoryAnnotationType(Class<? extends Annotation> repositoryAnnotationType)
Set the 'repository' annotation type. The default repository annotation type is the Repository annotation.

This setter property exists so that developers can provide their own (non-Spring-specific) annotation type to indicate that a class has a repository role.

Parameters:
repositoryAnnotationType - the desired annotation type

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
                    throws BeansException
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
Throws:
BeansException - in case of initialization errors
See Also:
BeanInitializationException

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

postProcessBeforeInitialization

public Object postProcessBeforeInitialization(Object bean,
                                              String beanName)
Description copied from interface: BeanPostProcessor
Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

Specified by:
postProcessBeforeInitialization in interface BeanPostProcessor
Parameters:
bean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
See Also:
InitializingBean.afterPropertiesSet()

postProcessAfterInitialization

public Object postProcessAfterInitialization(Object bean,
                                             String beanName)
Description copied from interface: BeanPostProcessor
Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

In case of a FactoryBean, this callback will be invoked for both the FactoryBean instance and the objects created by the FactoryBean (as of Spring 2.0). The post-processor can decide whether to apply to either the FactoryBean or created objects or both through corresponding bean instanceof FactoryBean checks.

This callback will also be invoked after a short-circuiting triggered by a InstantiationAwareBeanPostProcessor.postProcessBeforeInstantiation(java.lang.Class, java.lang.String) method, in contrast to all other BeanPostProcessor callbacks.

Specified by:
postProcessAfterInitialization in interface BeanPostProcessor
Parameters:
bean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
See Also:
InitializingBean.afterPropertiesSet(), FactoryBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.dao.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.dao.support

Support classes for DAO implementations, providing miscellaneous utility methods.

See:
Description

Interface Summary
PersistenceExceptionTranslator Interface implemented by Spring integrations with data access technologies that throw runtime exceptions, such as JPA, TopLink, JDO and Hibernate.

Class Summary
ChainedPersistenceExceptionTranslator | Implementation of PersistenceExceptionTranslator that supports chaining, allowing the addition of PersistenceExceptionTranslator instances in order.
DaoSupport | Generic base class for DAOs, defining template methods for DAO initialization.
DataAccessUtils | Miscellaneous utility methods for DAO implementations.
PersistenceExceptionTranslationInterceptor | AOP Alliance MethodInterceptor that provides persistence exception translation based on a given PersistenceExceptionTranslator.

Package org.springframework.dao.support Description

Support classes for DAO implementations, providing miscellaneous utility methods.


org.springframework.dao.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.dao.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.dao.support.ChainedPersistenceExceptionTranslator (implements org.springframework.dao.support.PersistenceExceptionTranslator)
    • org.springframework.dao.support.DaoSupport (implements org.springframework.beans.factory.InitializingBean)
    • org.springframework.dao.support.DataAccessUtils
    • org.springframework.dao.support.PersistenceExceptionTranslationInterceptor (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean, org.aopalliance.intercept.MethodInterceptor)

Interface Hierarchy

  • org.springframework.dao.support.PersistenceExceptionTranslator


PersistenceExceptionTranslator

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.dao.support
Interface PersistenceExceptionTranslator

All Known Subinterfaces:
JpaDialect
All Known Implementing Classes:
AbstractEntityManagerFactoryBean, AbstractSessionFactoryBean, AnnotationSessionFactoryBean, ChainedPersistenceExceptionTranslator, DefaultJdoDialect, DefaultJpaDialect, EclipseLinkJpaDialect, HibernateJpaDialect, LocalContainerEntityManagerFactoryBean, LocalEntityManagerFactoryBean, LocalPersistenceManagerFactoryBean, LocalSessionFactoryBean, OpenJpaDialect, TopLinkJpaDialect
public interface PersistenceExceptionTranslator

Interface implemented by Spring integrations with data access technologies that throw runtime exceptions, such as JPA, TopLink, JDO and Hibernate.

This allows consistent usage of combined exception translation functionality, without forcing a single translator to understand every single possible type of exception.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller

Method Summary
 DataAccessException translateExceptionIfPossible(RuntimeException ex)
Translate the given runtime exception thrown by a persistence framework to a corresponding exception from Spring's generic DataAccessException hierarchy, if possible.

Method Detail

translateExceptionIfPossible

DataAccessException translateExceptionIfPossible(RuntimeException ex)
Translate the given runtime exception thrown by a persistence framework to a corresponding exception from Spring's generic DataAccessException hierarchy, if possible.

Do not translate exceptions that are not understand by this translator: for example, if coming from another persistence framework, or resulting from user code and unrelated to persistence.

Of particular importance is the correct translation to DataIntegrityViolationException, for example on constraint violation. Implementations may use Spring JDBC's sophisticated exception translation to provide further information in the event of SQLException as a root cause.

Parameters:
ex - a RuntimeException thrown
Returns:
the corresponding DataAccessException (or null if the exception could not be translated, as in this case it may result from user code rather than an actual persistence problem)
See Also:
DataIntegrityViolationException, SQLExceptionTranslator
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ChainedPersistenceExceptionTranslator

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.dao.support
Class ChainedPersistenceExceptionTranslator

java.lang.Object
    extended by  org.springframework.dao.support.ChainedPersistenceExceptionTranslator
All Implemented Interfaces:
PersistenceExceptionTranslator
public class ChainedPersistenceExceptionTranslator
extends Object
implements PersistenceExceptionTranslator

Implementation of PersistenceExceptionTranslator that supports chaining, allowing the addition of PersistenceExceptionTranslator instances in order. Returns non-null on the first (if any) match.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller

Constructor Summary
ChainedPersistenceExceptionTranslator()
Method Summary
void | addDelegate(PersistenceExceptionTranslator pet) Add a PersistenceExceptionTranslator to the chained delegate list.
PersistenceExceptionTranslator[] | getDelegates() Return all registered PersistenceExceptionTranslator delegates (as array).
DataAccessException | translateExceptionIfPossible(RuntimeException ex) Translate the given runtime exception thrown by a persistence framework to a corresponding exception from Spring's generic DataAccessException hierarchy, if possible.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ChainedPersistenceExceptionTranslator

public ChainedPersistenceExceptionTranslator()
Method Detail

addDelegate

public final void addDelegate(PersistenceExceptionTranslator pet)
Add a PersistenceExceptionTranslator to the chained delegate list.

getDelegates

public final PersistenceExceptionTranslator[] getDelegates()
Return all registered PersistenceExceptionTranslator delegates (as array).

translateExceptionIfPossible

public DataAccessException translateExceptionIfPossible(RuntimeException ex)
Description copied from interface: PersistenceExceptionTranslator
Translate the given runtime exception thrown by a persistence framework to a corresponding exception from Spring's generic DataAccessException hierarchy, if possible.

Do not translate exceptions that are not understand by this translator: for example, if coming from another persistence framework, or resulting from user code and unrelated to persistence.

Of particular importance is the correct translation to DataIntegrityViolationException, for example on constraint violation. Implementations may use Spring JDBC's sophisticated exception translation to provide further information in the event of SQLException as a root cause.

Specified by:
translateExceptionIfPossible in interface PersistenceExceptionTranslator
Parameters:
ex - a RuntimeException thrown
Returns:
the corresponding DataAccessException (or null if the exception could not be translated, as in this case it may result from user code rather than an actual persistence problem)
See Also:
DataIntegrityViolationException, SQLExceptionTranslator
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


DaoSupport

org.springframework.dao.support
Class DaoSupport

java.lang.Object
    extended by  org.springframework.dao.support.DaoSupport
All Implemented Interfaces:
InitializingBean
Direct Known Subclasses:
CciDaoSupport, HibernateDaoSupport, JdbcDaoSupport, JdoDaoSupport, JpaDaoSupport, SqlMapClientDaoSupport
public abstract class DaoSupport
extends Object
implements InitializingBean

Generic base class for DAOs, defining template methods for DAO initialization.

Extended by Spring's specific DAO support classes, such as: JdbcDaoSupport, JdoDaoSupport, etc.

Since:
1.2.2
Author:
Juergen Hoeller
See Also:
JdbcDaoSupport, JdoDaoSupport

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
DaoSupport()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected abstract void | checkDaoConfig() Abstract subclasses must override this to check their configuration.
protected void | initDao() Concrete subclasses can override this for custom initialization behavior.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

DaoSupport

public DaoSupport()
Method Detail

afterPropertiesSet

public final void afterPropertiesSet()
                              throws IllegalArgumentException,
                                     BeanInitializationException
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
IllegalArgumentException
BeanInitializationException

checkDaoConfig

protected abstract void checkDaoConfig()
                                throws IllegalArgumentException
Abstract subclasses must override this to check their configuration.

Implementors should be marked as final

Throws:
IllegalArgumentException - in case of illegal configuration

initDao

protected void initDao()
                throws Exception
Concrete subclasses can override this for custom initialization behavior. Gets called after population of this instance's bean properties.

Throws:
Exception - if DAO initialization fails (will be rethrown as a BeanInitializationException)
See Also:
BeanInitializationException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DataAccessUtils

org.springframework.dao.support
Class DataAccessUtils

java.lang.Object
    extended by  org.springframework.dao.support.DataAccessUtils

public abstract class DataAccessUtils
extends Object

Miscellaneous utility methods for DAO implementations. Useful with any data access technology.

Since:
1.0.2
Author:
Juergen Hoeller

Constructor Summary
DataAccessUtils()
Method Summary
static int intResult(Collection results)
Return a unique int result from the given Collection.
static long longResult(Collection results)
Return a unique long result from the given Collection.
static
<T> T
objectResult(Collection<?> results, Class<T> requiredType)
Return a unique result object from the given Collection.
static
<T> T
requiredSingleResult(Collection<T> results)
Return a single result object from the given Collection.
static
<T> T
requiredUniqueResult(Collection<T> results)
Return a unique result object from the given Collection.
static
<T> T
singleResult(Collection<T> results)
Return a single result object from the given Collection.
static RuntimeException translateIfNecessary(RuntimeException rawException, PersistenceExceptionTranslator pet)
Return a translated exception if this is appropriate, otherwise return the input exception.
static
<T> T
uniqueResult(Collection<T> results)
Return a unique result object from the given Collection.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DataAccessUtils

public DataAccessUtils()
Method Detail

singleResult

public static <T> T singleResult(Collection<T> results)
                      throws IncorrectResultSizeDataAccessException
Return a single result object from the given Collection.

Returns null if 0 result objects found; throws an exception if more than 1 element found.

Parameters:
results - the result Collection (can be null)
Returns:
the single result object, or null if none
Throws:
IncorrectResultSizeDataAccessException - if more than one element has been found in the given Collection

requiredSingleResult

public static <T> T requiredSingleResult(Collection<T> results)
                              throws IncorrectResultSizeDataAccessException
Return a single result object from the given Collection.

Throws an exception if 0 or more than 1 element found.

Parameters:
results - the result Collection (can be null)
Returns:
the single result object
Throws:
IncorrectResultSizeDataAccessException - if more than one element has been found in the given Collection
EmptyResultDataAccessException - if no element at all has been found in the given Collection

uniqueResult

public static <T> T uniqueResult(Collection<T> results)
                      throws IncorrectResultSizeDataAccessException
Return a unique result object from the given Collection.

Returns null if 0 result objects found; throws an exception if more than 1 instance found.

Parameters:
results - the result Collection (can be null)
Returns:
the unique result object, or null if none
Throws:
IncorrectResultSizeDataAccessException - if more than one result object has been found in the given Collection
See Also:
CollectionUtils.hasUniqueObject(java.util.Collection)

requiredUniqueResult

public static <T> T requiredUniqueResult(Collection<T> results)
                              throws IncorrectResultSizeDataAccessException
Return a unique result object from the given Collection.

Throws an exception if 0 or more than 1 instance found.

Parameters:
results - the result Collection (can be null)
Returns:
the unique result object
Throws:
IncorrectResultSizeDataAccessException - if more than one result object has been found in the given Collection
EmptyResultDataAccessException - if no result object at all has been found in the given Collection
See Also:
CollectionUtils.hasUniqueObject(java.util.Collection)

objectResult

public static <T> T objectResult(Collection<?> results,
                                 Class<T> requiredType)
                      throws IncorrectResultSizeDataAccessException,
                             TypeMismatchDataAccessException
Return a unique result object from the given Collection. Throws an exception if 0 or more than 1 result objects found, of if the unique result object is not convertable to the specified required type.

Parameters:
results - the result Collection (can be null)
Returns:
the unique result object
Throws:
IncorrectResultSizeDataAccessException - if more than one result object has been found in the given Collection
EmptyResultDataAccessException - if no result object at all has been found in the given Collection
TypeMismatchDataAccessException - if the unique object does not match the specified required type

intResult

public static int intResult(Collection results)
                     throws IncorrectResultSizeDataAccessException,
                            TypeMismatchDataAccessException
Return a unique int result from the given Collection. Throws an exception if 0 or more than 1 result objects found, of if the unique result object is not convertable to an int.

Parameters:
results - the result Collection (can be null)
Returns:
the unique int result
Throws:
IncorrectResultSizeDataAccessException - if more than one result object has been found in the given Collection
EmptyResultDataAccessException - if no result object at all has been found in the given Collection
TypeMismatchDataAccessException - if the unique object in the collection is not convertable to an int

longResult

public static long longResult(Collection results)
                       throws IncorrectResultSizeDataAccessException,
                              TypeMismatchDataAccessException
Return a unique long result from the given Collection. Throws an exception if 0 or more than 1 result objects found, of if the unique result object is not convertable to a long.

Parameters:
results - the result Collection (can be null)
Returns:
the unique long result
Throws:
IncorrectResultSizeDataAccessException - if more than one result object has been found in the given Collection
EmptyResultDataAccessException - if no result object at all has been found in the given Collection
TypeMismatchDataAccessException - if the unique object in the collection is not convertable to a long

translateIfNecessary

public static RuntimeException translateIfNecessary(RuntimeException rawException,
                                                    PersistenceExceptionTranslator pet)
Return a translated exception if this is appropriate, otherwise return the input exception.

Parameters:
rawException - exception we may wish to translate
pet - PersistenceExceptionTranslator to use to perform the translation
Returns:
a translated exception if translation is possible, or the raw exception if it is not
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PersistenceExceptionTranslationInterceptor

org.springframework.dao.support
Class PersistenceExceptionTranslationInterceptor

java.lang.Object
    extended by  org.springframework.dao.support.PersistenceExceptionTranslationInterceptor
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, BeanFactoryAware, InitializingBean
public class PersistenceExceptionTranslationInterceptor
extends Object
implements MethodInterceptor, BeanFactoryAware, InitializingBean

AOP Alliance MethodInterceptor that provides persistence exception translation based on a given PersistenceExceptionTranslator.

Delegates to the given PersistenceExceptionTranslator to translate a RuntimeException thrown into Spring's DataAccessException hierarchy (if appropriate). If the RuntimeException in question is declared on the target method, it is always propagated as-is (with no translation applied).

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller
See Also:
PersistenceExceptionTranslator

Constructor Summary
PersistenceExceptionTranslationInterceptor()
Create a new PersistenceExceptionTranslationInterceptor.
PersistenceExceptionTranslationInterceptor(ListableBeanFactory beanFactory)
Create a new PersistenceExceptionTranslationInterceptor, autodetecting PersistenceExceptionTranslators in the given BeanFactory.
PersistenceExceptionTranslationInterceptor(PersistenceExceptionTranslator persistenceExceptionTranslator)
Create a new PersistenceExceptionTranslationInterceptor for the given PersistenceExceptionTranslator.
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected PersistenceExceptionTranslator | detectPersistenceExceptionTranslators(ListableBeanFactory beanFactory) Detect all PersistenceExceptionTranslators in the given BeanFactory.
Object | invoke(MethodInvocation mi)
void | setAlwaysTranslate(boolean alwaysTranslate) Specify whether to always translate the exception ("true"), or whether throw the raw exception when declared, i.e.
void | setBeanFactory(BeanFactory beanFactory) Callback that supplies the owning factory to a bean instance.
void | setPersistenceExceptionTranslator(PersistenceExceptionTranslator pet) Specify the PersistenceExceptionTranslator to use.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PersistenceExceptionTranslationInterceptor

public PersistenceExceptionTranslationInterceptor()
Create a new PersistenceExceptionTranslationInterceptor. Needs to be configured with a PersistenceExceptionTranslator afterwards.

See Also:
setPersistenceExceptionTranslator(org.springframework.dao.support.PersistenceExceptionTranslator)

PersistenceExceptionTranslationInterceptor

public PersistenceExceptionTranslationInterceptor(PersistenceExceptionTranslator persistenceExceptionTranslator)
Create a new PersistenceExceptionTranslationInterceptor for the given PersistenceExceptionTranslator.

Parameters:
persistenceExceptionTranslator - the PersistenceExceptionTranslator to use

PersistenceExceptionTranslationInterceptor

public PersistenceExceptionTranslationInterceptor(ListableBeanFactory beanFactory)
Create a new PersistenceExceptionTranslationInterceptor, autodetecting PersistenceExceptionTranslators in the given BeanFactory.

Parameters:
beanFactory - the ListableBeanFactory to obtaining all PersistenceExceptionTranslators from
Method Detail

setPersistenceExceptionTranslator

public void setPersistenceExceptionTranslator(PersistenceExceptionTranslator pet)
Specify the PersistenceExceptionTranslator to use.

Default is to autodetect all PersistenceExceptionTranslators in the containing BeanFactory, using them in a chain.

See Also:
detectPersistenceExceptionTranslators(org.springframework.beans.factory.ListableBeanFactory)

setAlwaysTranslate

public void setAlwaysTranslate(boolean alwaysTranslate)
Specify whether to always translate the exception ("true"), or whether throw the raw exception when declared, i.e. when the originating method signature's exception declarations allow for the raw exception to be thrown ("false").

Default is "false". Switch this flag to "true" in order to always translate applicable exceptions, independent from the originating method signature.

Note that the originating method does not have to declare the specific exception. Any base class will do as well, even throws Exception: As long as the originating method does explicitly declare compatible exceptions, the raw exception will be rethrown. If you would like to avoid throwing raw exceptions in any case, switch this flag to "true".

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
                    throws BeansException
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
Throws:
BeansException - in case of initialization errors
See Also:
BeanInitializationException

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

detectPersistenceExceptionTranslators

protected PersistenceExceptionTranslator detectPersistenceExceptionTranslators(ListableBeanFactory beanFactory)
Detect all PersistenceExceptionTranslators in the given BeanFactory.

Parameters:
beanFactory - the ListableBeanFactory to obtaining all PersistenceExceptionTranslators from
Returns:
a chained PersistenceExceptionTranslator, combining all PersistenceExceptionTranslators found in the factory
See Also:
ChainedPersistenceExceptionTranslator

invoke

public Object invoke(MethodInvocation mi)
              throws Throwable
Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.ejb.access

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.ejb.access

This package contains classes that allow easy access to EJBs.

See:
Description

Class Summary
AbstractRemoteSlsbInvokerInterceptor | Base class for interceptors proxying remote Stateless Session Beans.
AbstractSlsbInvokerInterceptor | Base class for AOP interceptors invoking local or remote Stateless Session Beans.
LocalSlsbInvokerInterceptor | Invoker for a local Stateless Session Bean.
LocalStatelessSessionProxyFactoryBean | Convenient FactoryBean for local Stateless Session Bean (SLSB) proxies.
SimpleRemoteSlsbInvokerInterceptor | Basic invoker for a remote Stateless Session Bean.
SimpleRemoteStatelessSessionProxyFactoryBean | Convenient FactoryBean for remote SLSB proxies.

Exception Summary
EjbAccessException Exception that gets thrown when an EJB stub cannot be accessed properly.

Package org.springframework.ejb.access Description

This package contains classes that allow easy access to EJBs. The basis are AOP interceptors run before and after the EJB invocation. In particular, the classes in this package allow transparent access to stateless session beans (SLSBs) with local interfaces, avoiding the need for application code using them to use EJB-specific APIs and JNDI lookups, and work with business interfaces that could be implemented without using EJB. This provides a valuable decoupling of client (such as web components) and business objects (which may or may not be EJBs). This gives us the choice of introducing EJB into an application (or removing EJB from an application) without affecting code using business objects.

The motivation for the classes in this package are discussed in Chapter 11 of Expert One-On-One J2EE Design and Development by Rod Johnson (Wrox, 2002).

However, the implementation and naming of classes in this package has changed. It now uses FactoryBeans and AOP, rather than the custom bean definitions described in Expert One-on-One J2EE.


org.springframework.ejb.access Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.ejb.access

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jndi.JndiAccessor
      • org.springframework.jndi.JndiLocatorSupport
        • org.springframework.jndi.JndiObjectLocator (implements org.springframework.beans.factory.InitializingBean)
          • org.springframework.ejb.access.AbstractSlsbInvokerInterceptor (implements org.aopalliance.intercept.MethodInterceptor)
            • org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor
              • org.springframework.ejb.access.SimpleRemoteSlsbInvokerInterceptor (implements org.springframework.beans.factory.DisposableBean)
                • org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.FactoryBean<T>)
            • org.springframework.ejb.access.LocalSlsbInvokerInterceptor
              • org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.FactoryBean<T>)
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.ejb.access.EjbAccessException


AbstractRemoteSlsbInvokerInterceptor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.ejb.access
Class AbstractRemoteSlsbInvokerInterceptor

java.lang.Object
    extended by  org.springframework.jndi.JndiAccessor
        extended by  org.springframework.jndi.JndiLocatorSupport
            extended by  org.springframework.jndi.JndiObjectLocator
                extended by  org.springframework.ejb.access.AbstractSlsbInvokerInterceptor
                    extended by  org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, InitializingBean
Direct Known Subclasses:
SimpleRemoteSlsbInvokerInterceptor
public abstract class AbstractRemoteSlsbInvokerInterceptor
extends AbstractSlsbInvokerInterceptor

Base class for interceptors proxying remote Stateless Session Beans. Designed for EJB 2.x, but works for EJB 3 Session Beans as well.

Such an interceptor must be the last interceptor in the advice chain. In this case, there is no target object.

Author:
Rod Johnson, Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.jndi.JndiLocatorSupport
CONTAINER_PREFIX
Fields inherited from class org.springframework.jndi.JndiAccessor
logger
Constructor Summary
AbstractRemoteSlsbInvokerInterceptor()
Method Summary
protected abstract Object | doInvoke(MethodInvocation invocation) Perform the given invocation on the current EJB home.
protected Method | getCreateMethod(Object home) Check for EJB3-style home object that serves as EJB component directly.
Object | invokeInContext(MethodInvocation invocation) Fetches an EJB home object and delegates to doInvoke.
protected boolean | isConnectFailure(RemoteException ex) Determine whether the given RMI exception indicates a connect failure.
protected boolean | isHomeRefreshable() Return whether the cached EJB home object is potentially subject to on-demand refreshing.
protected Object | lookup() This overridden lookup implementation performs a narrow operation after the JNDI lookup, provided that a home interface is specified.
protected Object | newSessionBeanInstance() Return a new instance of the stateless session bean.
protected Object | refreshAndRetry(MethodInvocation invocation) Refresh the EJB home object and retry the given invocation.
protected void | removeSessionBeanInstance(EJBObject ejb) Remove the given EJB instance.
void | setHomeInterface(Class homeInterface) Set a home interface that this invoker will narrow to before performing the parameterless SLSB create() call that returns the actual SLSB proxy.
void | setRefreshHomeOnConnectFailure(boolean refreshHomeOnConnectFailure) Set whether to refresh the EJB home on connect failure.
Methods inherited from class org.springframework.ejb.access.AbstractSlsbInvokerInterceptor
afterPropertiesSet, create, getHome, invoke, refreshHome, setCacheHome, setExposeAccessContext, setLookupHomeOnStartup
Methods inherited from class org.springframework.jndi.JndiObjectLocator
getExpectedType, getJndiName, setExpectedType, setJndiName
Methods inherited from class org.springframework.jndi.JndiLocatorSupport
convertJndiName, isResourceRef, lookup, lookup, setResourceRef
Methods inherited from class org.springframework.jndi.JndiAccessor
getJndiEnvironment, getJndiTemplate, setJndiEnvironment, setJndiTemplate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractRemoteSlsbInvokerInterceptor

public AbstractRemoteSlsbInvokerInterceptor()
Method Detail

setHomeInterface

public void setHomeInterface(Class homeInterface)
Set a home interface that this invoker will narrow to before performing the parameterless SLSB create() call that returns the actual SLSB proxy.

Default is none, which will work on all J2EE servers that are not based on CORBA. A plain javax.ejb.EJBHome interface is known to be sufficient to make a WebSphere 5.0 Remote SLSB work. On other servers, the specific home interface for the target SLSB might be necessary.

setRefreshHomeOnConnectFailure

public void setRefreshHomeOnConnectFailure(boolean refreshHomeOnConnectFailure)
Set whether to refresh the EJB home on connect failure. Default is "false".

Can be turned on to allow for hot restart of the EJB server. If a cached EJB home throws an RMI exception that indicates a remote connect failure, a fresh home will be fetched and the invocation will be retried.

See Also:
ConnectException, ConnectIOException, NoSuchObjectException

isHomeRefreshable

protected boolean isHomeRefreshable()
Description copied from class: AbstractSlsbInvokerInterceptor
Return whether the cached EJB home object is potentially subject to on-demand refreshing. Default is "false".

Overrides:
isHomeRefreshable in class AbstractSlsbInvokerInterceptor

lookup

protected Object lookup()
                 throws NamingException
This overridden lookup implementation performs a narrow operation after the JNDI lookup, provided that a home interface is specified.

Overrides:
lookup in class JndiObjectLocator
Returns:
the located target object
Throws:
NamingException - if the JNDI lookup failed or if the located JNDI object is not assigable to the expected type
See Also:
setHomeInterface(java.lang.Class), PortableRemoteObject.narrow(java.lang.Object, java.lang.Class)

getCreateMethod

protected Method getCreateMethod(Object home)
                          throws EjbAccessException
Check for EJB3-style home object that serves as EJB component directly.

Overrides:
getCreateMethod in class AbstractSlsbInvokerInterceptor
Parameters:
home - the EJB home object
Returns:
the create method
Throws:
EjbAccessException - if the method couldn't be retrieved

invokeInContext

public Object invokeInContext(MethodInvocation invocation)
                       throws Throwable
Fetches an EJB home object and delegates to doInvoke.

If configured to refresh on connect failure, it will call refreshAndRetry(org.aopalliance.intercept.MethodInvocation) on corresponding RMI exceptions.

Specified by:
invokeInContext in class AbstractSlsbInvokerInterceptor
Parameters:
invocation - the AOP method invocation
Returns:
the invocation result, if any
Throws:
Throwable - in case of invocation failure
See Also:
AbstractSlsbInvokerInterceptor.getHome(),
doInvoke(org.aopalliance.intercept.MethodInvocation),
refreshAndRetry(org.aopalliance.intercept.MethodInvocation)

isConnectFailure

protected boolean isConnectFailure(RemoteException ex)
Determine whether the given RMI exception indicates a connect failure.

The default implementation delegates to RmiClientInterceptorUtils.

Parameters:
ex - the RMI exception to check
Returns:
whether the exception should be treated as connect failure
See Also:
RmiClientInterceptorUtils.isConnectFailure(java.rmi.RemoteException)

refreshAndRetry

protected Object refreshAndRetry(MethodInvocation invocation)
                          throws Throwable
Refresh the EJB home object and retry the given invocation. Called by invoke on connect failure.

Parameters:
invocation - the AOP method invocation
Returns:
the invocation result, if any
Throws:
Throwable - in case of invocation failure
See Also:
AbstractSlsbInvokerInterceptor.invoke(org.aopalliance.intercept.MethodInvocation)

doInvoke

protected abstract Object doInvoke(MethodInvocation invocation)
                            throws Throwable
Perform the given invocation on the current EJB home. Template method to be implemented by subclasses.

Parameters:
invocation - the AOP method invocation
Returns:
the invocation result, if any
Throws:
Throwable - in case of invocation failure
See Also:
AbstractSlsbInvokerInterceptor.getHome(), newSessionBeanInstance()

newSessionBeanInstance

protected Object newSessionBeanInstance()
                                 throws NamingException,
                                        InvocationTargetException
Return a new instance of the stateless session bean. To be invoked by concrete remote SLSB invoker subclasses.

Can be overridden to change the algorithm.

Throws:
NamingException - if thrown by JNDI
InvocationTargetException - if thrown by the create method
See Also:
AbstractSlsbInvokerInterceptor.create()

removeSessionBeanInstance

protected void removeSessionBeanInstance(EJBObject ejb)
Remove the given EJB instance. To be invoked by concrete remote SLSB invoker subclasses.

Parameters:
ejb - the EJB instance to remove
See Also:
EJBObject.remove()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractSlsbInvokerInterceptor

org.springframework.ejb.access
Class AbstractSlsbInvokerInterceptor

java.lang.Object
    extended by  org.springframework.jndi.JndiAccessor
        extended by  org.springframework.jndi.JndiLocatorSupport
            extended by  org.springframework.jndi.JndiObjectLocator
                extended by  org.springframework.ejb.access.AbstractSlsbInvokerInterceptor
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, InitializingBean
Direct Known Subclasses:
AbstractRemoteSlsbInvokerInterceptor, LocalSlsbInvokerInterceptor
public abstract class AbstractSlsbInvokerInterceptor
extends JndiObjectLocator
implements MethodInterceptor

Base class for AOP interceptors invoking local or remote Stateless Session Beans. Designed for EJB 2.x, but works for EJB 3 Session Beans as well.

Such an interceptor must be the last interceptor in the advice chain. In this case, there is no direct target object: The call is handled in a special way, getting executed on an EJB instance retrieved via an EJB home.

Author:
Rod Johnson, Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.jndi.JndiLocatorSupport
CONTAINER_PREFIX
Fields inherited from class org.springframework.jndi.JndiAccessor
logger
Constructor Summary
AbstractSlsbInvokerInterceptor()
Method Summary
 void afterPropertiesSet()
Fetches EJB home on startup, if necessary.
protected  Object create()
Invokes the create() method on the cached EJB home object.
protected  Method getCreateMethod(Object home)
Determine the create method of the given EJB home object.
protected  Object getHome()
Return the EJB home object to use.
 Object invoke(MethodInvocation invocation)
Prepares the thread context if necessar, and delegates to invokeInContext(org.aopalliance.intercept.MethodInvocation).
protected abstract  Object invokeInContext(MethodInvocation invocation)
Perform the given invocation on the current EJB home, within the thread context being prepared accordingly.
protected  boolean isHomeRefreshable()
Return whether the cached EJB home object is potentially subject to on-demand refreshing.
protected  void refreshHome()
Refresh the cached home object, if applicable.
 void setCacheHome(boolean cacheHome)
Set whether to cache the EJB home object once it has been located.
 void setExposeAccessContext(boolean exposeAccessContext)
Set whether to expose the JNDI environment context for all access to the target EJB, i.e.
 void setLookupHomeOnStartup(boolean lookupHomeOnStartup)
Set whether to look up the EJB home object on startup.
Methods inherited from class org.springframework.jndi.JndiObjectLocator
getExpectedType, getJndiName, lookup, setExpectedType, setJndiName
Methods inherited from class org.springframework.jndi.JndiLocatorSupport
convertJndiName, isResourceRef, lookup, lookup, setResourceRef
Methods inherited from class org.springframework.jndi.JndiAccessor
getJndiEnvironment, getJndiTemplate, setJndiEnvironment, setJndiTemplate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractSlsbInvokerInterceptor

public AbstractSlsbInvokerInterceptor()
Method Detail

setLookupHomeOnStartup

public void setLookupHomeOnStartup(boolean lookupHomeOnStartup)
Set whether to look up the EJB home object on startup. Default is "true".

Can be turned off to allow for late start of the EJB server. In this case, the EJB home object will be fetched on first access.

See Also:
setCacheHome(boolean)

setCacheHome

public void setCacheHome(boolean cacheHome)
Set whether to cache the EJB home object once it has been located. Default is "true".

Can be turned off to allow for hot restart of the EJB server. In this case, the EJB home object will be fetched for each invocation.

See Also:
setLookupHomeOnStartup(boolean)

setExposeAccessContext

public void setExposeAccessContext(boolean exposeAccessContext)
Set whether to expose the JNDI environment context for all access to the target EJB, i.e. for all method invocations on the exposed object reference.

Default is "false", i.e. to only expose the JNDI context for object lookup. Switch this flag to "true" in order to expose the JNDI environment (including the authorization context) for each EJB invocation, as needed by WebLogic for EJBs with authorization requirements.

afterPropertiesSet

public void afterPropertiesSet()
                        throws NamingException
Fetches EJB home on startup, if necessary.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class JndiObjectLocator
Throws:
NamingException
See Also:
setLookupHomeOnStartup(boolean), refreshHome()

refreshHome

protected void refreshHome()
                    throws NamingException
Refresh the cached home object, if applicable. Also caches the create method on the home object.

Throws:
NamingException - if thrown by the JNDI lookup
See Also:
JndiObjectLocator.lookup(), getCreateMethod(java.lang.Object)

getCreateMethod

protected Method getCreateMethod(Object home)
                          throws EjbAccessException
Determine the create method of the given EJB home object.

Parameters:
home - the EJB home object
Returns:
the create method
Throws:
EjbAccessException - if the method couldn't be retrieved

getHome

protected Object getHome()
                  throws NamingException
Return the EJB home object to use. Called for each invocation.

Default implementation returns the home created on initialization, if any; else, it invokes lookup to get a new proxy for each invocation.

Can be overridden in subclasses, for example to cache a home object for a given amount of time before recreating it, or to test the home object whether it is still alive.

Returns:
the EJB home object to use for an invocation
Throws:
NamingException - if proxy creation failed
See Also:
JndiObjectLocator.lookup(), getCreateMethod(java.lang.Object)

isHomeRefreshable

protected boolean isHomeRefreshable()
Return whether the cached EJB home object is potentially subject to on-demand refreshing. Default is "false".

invoke

public Object invoke(MethodInvocation invocation)
              throws Throwable
Prepares the thread context if necessar, and delegates to invokeInContext(org.aopalliance.intercept.MethodInvocation).

Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable

invokeInContext

protected abstract Object invokeInContext(MethodInvocation invocation)
                                   throws Throwable
Perform the given invocation on the current EJB home, within the thread context being prepared accordingly. Template method to be implemented by subclasses.

Parameters:
invocation - the AOP method invocation
Returns:
the invocation result, if any
Throws:
Throwable - in case of invocation failure

create

protected Object create()
                 throws NamingException,
                        InvocationTargetException
Invokes the create() method on the cached EJB home object.

Returns:
a new EJBObject or EJBLocalObject
Throws:
NamingException - if thrown by JNDI
InvocationTargetException - if thrown by the create method
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LocalSlsbInvokerInterceptor

org.springframework.ejb.access
Class LocalSlsbInvokerInterceptor

java.lang.Object
    extended by  org.springframework.jndi.JndiAccessor
        extended by  org.springframework.jndi.JndiLocatorSupport
            extended by  org.springframework.jndi.JndiObjectLocator
                extended by  org.springframework.ejb.access.AbstractSlsbInvokerInterceptor
                    extended by  org.springframework.ejb.access.LocalSlsbInvokerInterceptor
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, InitializingBean
Direct Known Subclasses:
LocalStatelessSessionProxyFactoryBean
public class LocalSlsbInvokerInterceptor
extends AbstractSlsbInvokerInterceptor

Invoker for a local Stateless Session Bean. Designed for EJB 2.x, but works for EJB 3 Session Beans as well.

Caches the home object, since a local EJB home can never go stale. See JndiObjectLocator for info on how to specify the JNDI location of the target EJB.

In a bean container, this class is normally best used as a singleton. However, if that bean container pre-instantiates singletons (as do the XML ApplicationContext variants) you may have a problem if the bean container is loaded before the EJB container loads the target EJB. That is because by default the JNDI lookup will be performed in the init method of this class and cached, but the EJB will not have been bound at the target location yet. The best solution is to set the lookupHomeOnStartup property to false, in which case the home will be fetched on first access to the EJB. (This flag is only true by default for backwards compatibility reasons).

Author:
Rod Johnson, Juergen Hoeller
See Also:
AbstractSlsbInvokerInterceptor.setLookupHomeOnStartup(boolean), AbstractSlsbInvokerInterceptor.setCacheHome(boolean)

Field Summary
Fields inherited from class org.springframework.jndi.JndiLocatorSupport
CONTAINER_PREFIX
Fields inherited from class org.springframework.jndi.JndiAccessor
logger
Constructor Summary
LocalSlsbInvokerInterceptor()
Method Summary
protected Method | getCreateMethod(Object home) Check for EJB3-style home object that serves as EJB component directly.
protected Object | getSessionBeanInstance() Return an EJB instance to delegate the call to.
Object | invokeInContext(MethodInvocation invocation) This implementation "creates" a new EJB instance for each invocation.
protected Object | newSessionBeanInstance() Return a new instance of the stateless session bean.
protected void | releaseSessionBeanInstance(EJBLocalObject ejb) Release the given EJB instance.
protected void | removeSessionBeanInstance(EJBLocalObject ejb) Remove the given EJB instance.
Methods inherited from class org.springframework.ejb.access.AbstractSlsbInvokerInterceptor
afterPropertiesSet, create, getHome, invoke, isHomeRefreshable, refreshHome, setCacheHome, setExposeAccessContext, setLookupHomeOnStartup
Methods inherited from class org.springframework.jndi.JndiObjectLocator
getExpectedType, getJndiName, lookup, setExpectedType, setJndiName
Methods inherited from class org.springframework.jndi.JndiLocatorSupport
convertJndiName, isResourceRef, lookup, lookup, setResourceRef
Methods inherited from class org.springframework.jndi.JndiAccessor
getJndiEnvironment, getJndiTemplate, setJndiEnvironment, setJndiTemplate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

LocalSlsbInvokerInterceptor

public LocalSlsbInvokerInterceptor()
Method Detail

invokeInContext

public Object invokeInContext(MethodInvocation invocation)
                       throws Throwable
This implementation "creates" a new EJB instance for each invocation. Can be overridden for custom invocation strategies.

Alternatively, override getSessionBeanInstance() and releaseSessionBeanInstance(javax.ejb.EJBLocalObject) to change EJB instance creation, for example to hold a single shared EJB instance.

Specified by:
invokeInContext in class AbstractSlsbInvokerInterceptor
Parameters:
invocation - the AOP method invocation
Returns:
the invocation result, if any
Throws:
Throwable - in case of invocation failure

getCreateMethod

protected Method getCreateMethod(Object home)
                          throws EjbAccessException
Check for EJB3-style home object that serves as EJB component directly.

Overrides:
getCreateMethod in class AbstractSlsbInvokerInterceptor
Parameters:
home - the EJB home object
Returns:
the create method
Throws:
EjbAccessException - if the method couldn't be retrieved

getSessionBeanInstance

protected Object getSessionBeanInstance()
                                 throws NamingException,
                                        InvocationTargetException
Return an EJB instance to delegate the call to. Default implementation delegates to newSessionBeanInstance.

Throws:
NamingException - if thrown by JNDI
InvocationTargetException - if thrown by the create method
See Also:
newSessionBeanInstance()

releaseSessionBeanInstance

protected void releaseSessionBeanInstance(EJBLocalObject ejb)
Release the given EJB instance. Default implementation delegates to removeSessionBeanInstance.

Parameters:
ejb - the EJB instance to release
See Also:
removeSessionBeanInstance(javax.ejb.EJBLocalObject)

newSessionBeanInstance

protected Object newSessionBeanInstance()
                                 throws NamingException,
                                        InvocationTargetException
Return a new instance of the stateless session bean. Can be overridden to change the algorithm.

Throws:
NamingException - if thrown by JNDI
InvocationTargetException - if thrown by the create method
See Also:
AbstractSlsbInvokerInterceptor.create()

removeSessionBeanInstance

protected void removeSessionBeanInstance(EJBLocalObject ejb)
Remove the given EJB instance.

Parameters:
ejb - the EJB instance to remove
See Also:
EJBLocalObject.remove()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LocalStatelessSessionProxyFactoryBean

org.springframework.ejb.access
Class LocalStatelessSessionProxyFactoryBean

java.lang.Object
    extended by  org.springframework.jndi.JndiAccessor
        extended by  org.springframework.jndi.JndiLocatorSupport
            extended by  org.springframework.jndi.JndiObjectLocator
                extended by  org.springframework.ejb.access.AbstractSlsbInvokerInterceptor
                    extended by  org.springframework.ejb.access.LocalSlsbInvokerInterceptor
                        extended by  org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, BeanClassLoaderAware, FactoryBean<Object>, InitializingBean
public class LocalStatelessSessionProxyFactoryBean
extends LocalSlsbInvokerInterceptor
implements FactoryBean<Object>, BeanClassLoaderAware

Convenient FactoryBean for local Stateless Session Bean (SLSB) proxies. Designed for EJB 2.x, but works for EJB 3 Session Beans as well.

See JndiObjectLocator for info on how to specify the JNDI location of the target EJB.

If you want control over interceptor chaining, use an AOP ProxyFactoryBean with LocalSlsbInvokerInterceptor rather than rely on this class.

In a bean container, this class is normally best used as a singleton. However, if that bean container pre-instantiates singletons (as do the XML ApplicationContext variants) you may have a problem if the bean container is loaded before the EJB container loads the target EJB. That is because by default the JNDI lookup will be performed in the init method of this class and cached, but the EJB will not have been bound at the target location yet. The best solution is to set the "lookupHomeOnStartup" property to "false", in which case the home will be fetched on first access to the EJB. (This flag is only true by default for backwards compatibility reasons).

Since:
09.05.2003
Author:
Rod Johnson, Colin Sampaleanu
See Also:
AbstractSlsbInvokerInterceptor.setLookupHomeOnStartup(boolean), AbstractSlsbInvokerInterceptor.setCacheHome(boolean)

Field Summary
Fields inherited from class org.springframework.jndi.JndiLocatorSupport
CONTAINER_PREFIX
Fields inherited from class org.springframework.jndi.JndiAccessor
logger
Constructor Summary
LocalStatelessSessionProxyFactoryBean()
Method Summary
 void afterPropertiesSet()
Fetches EJB home on startup, if necessary.
 Class getBusinessInterface()
Return the business interface of the EJB we're proxying.
 Object getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<?> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setBeanClassLoader(ClassLoader classLoader)
Callback that supplies the bean class loader to a bean instance.
 void setBusinessInterface(Class businessInterface)
Set the business interface of the EJB we're proxying.
Methods inherited from class org.springframework.ejb.access.LocalSlsbInvokerInterceptor
getCreateMethod, getSessionBeanInstance, invokeInContext, newSessionBeanInstance, releaseSessionBeanInstance, removeSessionBeanInstance
Methods inherited from class org.springframework.ejb.access.AbstractSlsbInvokerInterceptor
create, getHome, invoke, isHomeRefreshable, refreshHome, setCacheHome, setExposeAccessContext, setLookupHomeOnStartup
Methods inherited from class org.springframework.jndi.JndiObjectLocator
getExpectedType, getJndiName, lookup, setExpectedType, setJndiName
Methods inherited from class org.springframework.jndi.JndiLocatorSupport
convertJndiName, isResourceRef, lookup, lookup, setResourceRef
Methods inherited from class org.springframework.jndi.JndiAccessor
getJndiEnvironment, getJndiTemplate, setJndiEnvironment, setJndiTemplate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

LocalStatelessSessionProxyFactoryBean

public LocalStatelessSessionProxyFactoryBean()
Method Detail

setBusinessInterface

public void setBusinessInterface(Class businessInterface)
Set the business interface of the EJB we're proxying. This will normally be a super-interface of the EJB local component interface. Using a business methods interface is a best practice when implementing EJBs.

Parameters:
businessInterface - set the business interface of the EJB

getBusinessInterface

public Class getBusinessInterface()
Return the business interface of the EJB we're proxying.

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

afterPropertiesSet

public void afterPropertiesSet()
                        throws NamingException
Description copied from class: AbstractSlsbInvokerInterceptor
Fetches EJB home on startup, if necessary.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class AbstractSlsbInvokerInterceptor
Throws:
NamingException
See Also:
AbstractSlsbInvokerInterceptor.setLookupHomeOnStartup(boolean), AbstractSlsbInvokerInterceptor.refreshHome()

getObject

public Object getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<Object>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<?> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<Object>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<Object>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleRemoteSlsbInvokerInterceptor

org.springframework.ejb.access
Class SimpleRemoteSlsbInvokerInterceptor

java.lang.Object
    extended by  org.springframework.jndi.JndiAccessor
        extended by  org.springframework.jndi.JndiLocatorSupport
            extended by  org.springframework.jndi.JndiObjectLocator
                extended by  org.springframework.ejb.access.AbstractSlsbInvokerInterceptor
                    extended by  org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor
                        extended by  org.springframework.ejb.access.SimpleRemoteSlsbInvokerInterceptor
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, DisposableBean, InitializingBean
Direct Known Subclasses:
SimpleRemoteStatelessSessionProxyFactoryBean
public class SimpleRemoteSlsbInvokerInterceptor
extends AbstractRemoteSlsbInvokerInterceptor
implements DisposableBean

Basic invoker for a remote Stateless Session Bean. Designed for EJB 2.x, but works for EJB 3 Session Beans as well.

"Creates" a new EJB instance for each invocation, or caches the session bean instance for all invocations (see setCacheSessionBean(boolean)). See JndiObjectLocator for info on how to specify the JNDI location of the target EJB.

In a bean container, this class is normally best used as a singleton. However, if that bean container pre-instantiates singletons (as do the XML ApplicationContext variants) you may have a problem if the bean container is loaded before the EJB container loads the target EJB. That is because by default the JNDI lookup will be performed in the init method of this class and cached, but the EJB will not have been bound at the target location yet. The best solution is to set the "lookupHomeOnStartup" property to "false", in which case the home will be fetched on first access to the EJB. (This flag is only true by default for backwards compatibility reasons).

This invoker is typically used with an RMI business interface, which serves as super-interface of the EJB component interface. Alternatively, this invoker can also proxy a remote SLSB with a matching non-RMI business interface, i.e. an interface that mirrors the EJB business methods but does not declare RemoteExceptions. In the latter case, RemoteExceptions thrown by the EJB stub will automatically get converted to Spring's unchecked RemoteAccessException.

Since:
09.05.2003
Author:
Rod Johnson, Juergen Hoeller
See Also:
RemoteAccessException,
AbstractSlsbInvokerInterceptor.setLookupHomeOnStartup(boolean),
AbstractSlsbInvokerInterceptor.setCacheHome(boolean),
AbstractRemoteSlsbInvokerInterceptor.setRefreshHomeOnConnectFailure(boolean)

Field Summary
Fields inherited from class org.springframework.jndi.JndiLocatorSupport
CONTAINER_PREFIX
Fields inherited from class org.springframework.jndi.JndiAccessor
logger
Constructor Summary
SimpleRemoteSlsbInvokerInterceptor()
Method Summary
void | destroy() Remove the cached session bean instance, if necessary.
protected Object | doInvoke(MethodInvocation invocation) This implementation "creates" a new EJB instance for each invocation.
protected Object | getSessionBeanInstance() Return an EJB component instance to delegate the call to.
protected void | refreshHome() Reset the cached session bean instance, if necessary.
protected void | releaseSessionBeanInstance(EJBObject ejb) Release the given EJB instance.
void | setCacheSessionBean(boolean cacheSessionBean) Set whether to cache the actual session bean object.
Methods inherited from class org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor
getCreateMethod, invokeInContext, isConnectFailure, isHomeRefreshable, lookup, newSessionBeanInstance, refreshAndRetry, removeSessionBeanInstance, setHomeInterface, setRefreshHomeOnConnectFailure
Methods inherited from class org.springframework.ejb.access.AbstractSlsbInvokerInterceptor
afterPropertiesSet, create, getHome, invoke, setCacheHome, setExposeAccessContext, setLookupHomeOnStartup
Methods inherited from class org.springframework.jndi.JndiObjectLocator
getExpectedType, getJndiName, setExpectedType, setJndiName
Methods inherited from class org.springframework.jndi.JndiLocatorSupport
convertJndiName, isResourceRef, lookup, lookup, setResourceRef
Methods inherited from class org.springframework.jndi.JndiAccessor
getJndiEnvironment, getJndiTemplate, setJndiEnvironment, setJndiTemplate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleRemoteSlsbInvokerInterceptor

public SimpleRemoteSlsbInvokerInterceptor()
Method Detail

setCacheSessionBean

public void setCacheSessionBean(boolean cacheSessionBean)
Set whether to cache the actual session bean object.

Off by default for standard EJB compliance. Turn this flag on to optimize session bean access for servers that are known to allow for caching the actual session bean object.

See Also:
AbstractSlsbInvokerInterceptor.setCacheHome(boolean)

doInvoke

protected Object doInvoke(MethodInvocation invocation)
                   throws Throwable
This implementation "creates" a new EJB instance for each invocation. Can be overridden for custom invocation strategies.

Alternatively, override getSessionBeanInstance() and releaseSessionBeanInstance(javax.ejb.EJBObject) to change EJB instance creation, for example to hold a single shared EJB component instance.

Specified by:
doInvoke in class AbstractRemoteSlsbInvokerInterceptor
Parameters:
invocation - the AOP method invocation
Returns:
the invocation result, if any
Throws:
Throwable - in case of invocation failure
See Also:
AbstractSlsbInvokerInterceptor.getHome(), AbstractRemoteSlsbInvokerInterceptor.newSessionBeanInstance()

getSessionBeanInstance

protected Object getSessionBeanInstance()
                                 throws NamingException,
                                        InvocationTargetException
Return an EJB component instance to delegate the call to.

The default implementation delegates to AbstractRemoteSlsbInvokerInterceptor.newSessionBeanInstance().

Returns:
the EJB component instance
Throws:
NamingException - if thrown by JNDI
InvocationTargetException - if thrown by the create method
See Also:
AbstractRemoteSlsbInvokerInterceptor.newSessionBeanInstance()

releaseSessionBeanInstance

protected void releaseSessionBeanInstance(EJBObject ejb)
Release the given EJB instance.

The default implementation delegates to AbstractRemoteSlsbInvokerInterceptor.removeSessionBeanInstance(javax.ejb.EJBObject).

Parameters:
ejb - the EJB component instance to release
See Also:
AbstractRemoteSlsbInvokerInterceptor.removeSessionBeanInstance(javax.ejb.EJBObject)

refreshHome

protected void refreshHome()
                    throws NamingException
Reset the cached session bean instance, if necessary.

Overrides:
refreshHome in class AbstractSlsbInvokerInterceptor
Throws:
NamingException - if thrown by the JNDI lookup
See Also:
JndiObjectLocator.lookup(), AbstractSlsbInvokerInterceptor.getCreateMethod(java.lang.Object)

destroy

public void destroy()
Remove the cached session bean instance, if necessary.

Specified by:
destroy in interface DisposableBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleRemoteStatelessSessionProxyFactoryBean

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.ejb.access
Class SimpleRemoteStatelessSessionProxyFactoryBean

java.lang.Object
    extended by  org.springframework.jndi.JndiAccessor
        extended by  org.springframework.jndi.JndiLocatorSupport
            extended by  org.springframework.jndi.JndiObjectLocator
                extended by  org.springframework.ejb.access.AbstractSlsbInvokerInterceptor
                    extended by  org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor
                        extended by  org.springframework.ejb.access.SimpleRemoteSlsbInvokerInterceptor
                            extended by  org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, BeanClassLoaderAware, DisposableBean, FactoryBean<Object>, InitializingBean
public class SimpleRemoteStatelessSessionProxyFactoryBean
extends SimpleRemoteSlsbInvokerInterceptor
implements FactoryBean<Object>, BeanClassLoaderAware

Convenient FactoryBean for remote SLSB proxies. Designed for EJB 2.x, but works for EJB 3 Session Beans as well.

See JndiObjectLocator for info on how to specify the JNDI location of the target EJB.

If you want control over interceptor chaining, use an AOP ProxyFactoryBean with SimpleRemoteSlsbInvokerInterceptor rather than rely on this class.

In a bean container, this class is normally best used as a singleton. However, if that bean container pre-instantiates singletons (as do the XML ApplicationContext variants) you may have a problem if the bean container is loaded before the EJB container loads the target EJB. That is because by default the JNDI lookup will be performed in the init method of this class and cached, but the EJB will not have been bound at the target location yet. The best solution is to set the lookupHomeOnStartup property to false, in which case the home will be fetched on first access to the EJB. (This flag is only true by default for backwards compatibility reasons).

This proxy factory is typically used with an RMI business interface, which serves as super-interface of the EJB component interface. Alternatively, this factory can also proxy a remote SLSB with a matching non-RMI business interface, i.e. an interface that mirrors the EJB business methods but does not declare RemoteExceptions. In the latter case, RemoteExceptions thrown by the EJB stub will automatically get converted to Spring's unchecked RemoteAccessException.

Since:
09.05.2003
Author:
Rod Johnson, Colin Sampaleanu, Juergen Hoeller
See Also:
RemoteAccessException,
AbstractSlsbInvokerInterceptor.setLookupHomeOnStartup(boolean),
AbstractSlsbInvokerInterceptor.setCacheHome(boolean),
AbstractRemoteSlsbInvokerInterceptor.setRefreshHomeOnConnectFailure(boolean)

Field Summary
Fields inherited from class org.springframework.jndi.JndiLocatorSupport
CONTAINER_PREFIX
Fields inherited from class org.springframework.jndi.JndiAccessor
logger
Constructor Summary
SimpleRemoteStatelessSessionProxyFactoryBean()
Method Summary
 void afterPropertiesSet()
Fetches EJB home on startup, if necessary.
 Class getBusinessInterface()
Return the business interface of the EJB we're proxying.
 Object getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<?> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setBeanClassLoader(ClassLoader classLoader)
Callback that supplies the bean class loader to a bean instance.
 void setBusinessInterface(Class businessInterface)
Set the business interface of the EJB we're proxying.
Methods inherited from class org.springframework.ejb.access.SimpleRemoteSlsbInvokerInterceptor
destroy, doInvoke, getSessionBeanInstance, refreshHome, releaseSessionBeanInstance, setCacheSessionBean
Methods inherited from class org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor
getCreateMethod, invokeInContext, isConnectFailure, isHomeRefreshable, lookup, newSessionBeanInstance, refreshAndRetry, removeSessionBeanInstance, setHomeInterface, setRefreshHomeOnConnectFailure
Methods inherited from class org.springframework.ejb.access.AbstractSlsbInvokerInterceptor
create, getHome, invoke, setCacheHome, setExposeAccessContext, setLookupHomeOnStartup
Methods inherited from class org.springframework.jndi.JndiObjectLocator
getExpectedType, getJndiName, setExpectedType, setJndiName
Methods inherited from class org.springframework.jndi.JndiLocatorSupport
convertJndiName, isResourceRef, lookup, lookup, setResourceRef
Methods inherited from class org.springframework.jndi.JndiAccessor
getJndiEnvironment, getJndiTemplate, setJndiEnvironment, setJndiTemplate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleRemoteStatelessSessionProxyFactoryBean

public SimpleRemoteStatelessSessionProxyFactoryBean()
Method Detail

setBusinessInterface

public void setBusinessInterface(Class businessInterface)
Set the business interface of the EJB we're proxying. This will normally be a super-interface of the EJB remote component interface. Using a business methods interface is a best practice when implementing EJBs.

You can also specify a matching non-RMI business interface, i.e. an interface that mirrors the EJB business methods but does not declare RemoteExceptions. In this case, RemoteExceptions thrown by the EJB stub will automatically get converted to Spring's generic RemoteAccessException.

Parameters:
businessInterface - the business interface of the EJB

getBusinessInterface

public Class getBusinessInterface()
Return the business interface of the EJB we're proxying.

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

afterPropertiesSet

public void afterPropertiesSet()
                        throws NamingException
Description copied from class: AbstractSlsbInvokerInterceptor
Fetches EJB home on startup, if necessary.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class AbstractSlsbInvokerInterceptor
Throws:
NamingException
See Also:
AbstractSlsbInvokerInterceptor.setLookupHomeOnStartup(boolean), AbstractSlsbInvokerInterceptor.refreshHome()

getObject

public Object getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<Object>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<?> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<Object>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<Object>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


EjbAccessException

org.springframework.ejb.access
Class EjbAccessException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.ejb.access.EjbAccessException
All Implemented Interfaces:
Serializable
public class EjbAccessException
extends NestedRuntimeException

Exception that gets thrown when an EJB stub cannot be accessed properly.

Since:
2.0
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
EjbAccessException(String msg)
Constructor for EjbAccessException.
EjbAccessException(String msg, Throwable cause)
Constructor for EjbAccessException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

EjbAccessException

public EjbAccessException(String msg)
Constructor for EjbAccessException.

Parameters:
msg - the detail message

EjbAccessException

public EjbAccessException(String msg,
                          Throwable cause)
Constructor for EjbAccessException.

Parameters:
msg - the detail message
cause - the root cause
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.ejb.config

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.ejb.config

Support package for EJB/J2EE-related configuration, with XML schema being the primary configuration format.

See:
Description

Class Summary
JeeNamespaceHandler NamespaceHandler for the 'jee' namespace.

Package org.springframework.ejb.config Description

Support package for EJB/J2EE-related configuration, with XML schema being the primary configuration format.


org.springframework.ejb.config Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.ejb.config

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.beans.factory.xml.NamespaceHandlerSupport (implements org.springframework.beans.factory.xml.NamespaceHandler)
      • org.springframework.ejb.config.JeeNamespaceHandler


JeeNamespaceHandler

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.ejb.config
Class JeeNamespaceHandler

java.lang.Object
    extended by  org.springframework.beans.factory.xml.NamespaceHandlerSupport
        extended by  org.springframework.ejb.config.JeeNamespaceHandler
All Implemented Interfaces:
NamespaceHandler
public class JeeNamespaceHandler
extends NamespaceHandlerSupport

NamespaceHandler for the 'jee' namespace.

Since:
2.0
Author:
Rob Harrop

Constructor Summary
JeeNamespaceHandler()
Method Summary
 void init()
Invoked by the DefaultBeanDefinitionDocumentReader after construction but before any custom elements are parsed.
Methods inherited from class org.springframework.beans.factory.xml.NamespaceHandlerSupport
decorate, parse, registerBeanDefinitionDecorator, registerBeanDefinitionDecoratorForAttribute, registerBeanDefinitionParser
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JeeNamespaceHandler

public JeeNamespaceHandler()
Method Detail

init

public void init()
Description copied from interface: NamespaceHandler
Invoked by the DefaultBeanDefinitionDocumentReader after construction but before any custom elements are parsed.

See Also:
NamespaceHandlerSupport.registerBeanDefinitionParser(String, BeanDefinitionParser)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.ejb.interceptor

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.ejb.interceptor

Support classes for EJB 3 Session Beans and Message-Driven Beans, performing injection of Spring beans through an EJB 3 interceptor that processes Spring's @Autowired annotation.

See:
Description

Class Summary
SpringBeanAutowiringInterceptor EJB3-compliant interceptor class that injects Spring beans into fields and methods which are annotated with @Autowired.

Package org.springframework.ejb.interceptor Description

Support classes for EJB 3 Session Beans and Message-Driven Beans, performing injection of Spring beans through an EJB 3 interceptor that processes Spring's @Autowired annotation.


org.springframework.ejb.interceptor Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.ejb.interceptor

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor


SpringBeanAutowiringInterceptor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.ejb.interceptor
Class SpringBeanAutowiringInterceptor

java.lang.Object
    extended by  org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor

public class SpringBeanAutowiringInterceptor
extends Object

EJB3-compliant interceptor class that injects Spring beans into fields and methods which are annotated with @Autowired. Performs injection after construction as well as after activation of a passivated bean.

To be applied through an @Interceptors annotation in the EJB Session Bean or Message-Driven Bean class, or through an interceptor-binding XML element in the EJB deployment descriptor.

Delegates to Spring's AutowiredAnnotationBeanPostProcessor underneath, allowing for customization of its specific settings through overriding the configureBeanPostProcessor(org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor, java.lang.Object) template method.

The actual BeanFactory to obtain Spring beans from is determined by the getBeanFactory(java.lang.Object) template method. The default implementation obtains the Spring ContextSingletonBeanFactoryLocator, initialized from the default resource location classpath*:beanRefContext.xml, and obtains the single ApplicationContext defined there.

NOTE: If you have more than one shared ApplicationContext definition available in your EJB class loader, you need to override the getBeanFactoryLocatorKey(java.lang.Object) method and provide a specific locator key for each autowired EJB. Alternatively, override the getBeanFactory(java.lang.Object) template method and obtain the target factory explicitly.

WARNING: Do not define the same bean as Spring-managed bean and as EJB3 session bean in the same deployment unit. In particular, be careful when using the <context:component-scan> feature in combination with the deployment of Spring-based EJB3 session beans: Make sure that the EJB3 session beans are not autodetected as Spring-managed beans as well, using appropriate package restrictions.

Since:
2.5.1
Author:
Juergen Hoeller
See Also:
Autowired, AutowiredAnnotationBeanPostProcessor, ContextSingletonBeanFactoryLocator, getBeanFactoryLocatorKey(java.lang.Object), AbstractEnterpriseBean.setBeanFactoryLocator(org.springframework.beans.factory.access.BeanFactoryLocator), AbstractEnterpriseBean.setBeanFactoryLocatorKey(java.lang.String)

Constructor Summary
SpringBeanAutowiringInterceptor()
Method Summary
void | autowireBean(javax.interceptor.InvocationContext invocationContext) Autowire the target bean after construction as well as after passivation.
protected void | configureBeanPostProcessor(AutowiredAnnotationBeanPostProcessor processor, Object target) Template method for configuring the AutowiredAnnotationBeanPostProcessor used for autowiring.
protected void | doAutowireBean(Object target) Actually autowire the target bean after construction/passivation.
protected void | doReleaseBean(Object target) Actually release the BeanFactoryReference for the given target bean.
protected BeanFactory | getBeanFactory(Object target) Determine the BeanFactory for autowiring the given target bean.
protected BeanFactoryLocator | getBeanFactoryLocator(Object target) Determine the BeanFactoryLocator to obtain the BeanFactoryReference from.
protected String | getBeanFactoryLocatorKey(Object target) Determine the BeanFactoryLocator key to use.
protected BeanFactoryReference | getBeanFactoryReference(Object target) Determine the BeanFactoryReference for the given target bean.
void | releaseBean(javax.interceptor.InvocationContext invocationContext) Release the factory which has been used for autowiring the target bean.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SpringBeanAutowiringInterceptor

public SpringBeanAutowiringInterceptor()
Method Detail

autowireBean

@PostConstruct
public void autowireBean(javax.interceptor.InvocationContext invocationContext)
Autowire the target bean after construction as well as after passivation.

Parameters:
invocationContext - the EJB3 invocation context

doAutowireBean

protected void doAutowireBean(Object target)
Actually autowire the target bean after construction/passivation.

Parameters:
target - the target bean to autowire

configureBeanPostProcessor

protected void configureBeanPostProcessor(AutowiredAnnotationBeanPostProcessor processor,
                                          Object target)
Template method for configuring the AutowiredAnnotationBeanPostProcessor used for autowiring.

Parameters:
processor - the AutowiredAnnotationBeanPostProcessor to configure
target - the target bean to autowire with this processor

getBeanFactory

protected BeanFactory getBeanFactory(Object target)
Determine the BeanFactory for autowiring the given target bean.

Parameters:
target - the target bean to autowire
Returns:
the BeanFactory to use (never null)
See Also:
getBeanFactoryReference(java.lang.Object)

getBeanFactoryReference

protected BeanFactoryReference getBeanFactoryReference(Object target)
Determine the BeanFactoryReference for the given target bean.

The default implementation delegates to getBeanFactoryLocator(java.lang.Object) and getBeanFactoryLocatorKey(java.lang.Object).

Parameters:
target - the target bean to autowire
Returns:
the BeanFactoryReference to use (never null)
See Also:
getBeanFactoryLocator(java.lang.Object),
getBeanFactoryLocatorKey(java.lang.Object),
BeanFactoryLocator.useBeanFactory(String)

getBeanFactoryLocator

protected BeanFactoryLocator getBeanFactoryLocator(Object target)
Determine the BeanFactoryLocator to obtain the BeanFactoryReference from.

The default implementation exposes Spring's default ContextSingletonBeanFactoryLocator.

Parameters:
target - the target bean to autowire
Returns:
the BeanFactoryLocator to use (never null)
See Also:
ContextSingletonBeanFactoryLocator.getInstance()

getBeanFactoryLocatorKey

protected String getBeanFactoryLocatorKey(Object target)
Determine the BeanFactoryLocator key to use. This typically indicates the bean name of the ApplicationContext definition in classpath*:beanRefContext.xml resource files.

The default is null, indicating the single ApplicationContext defined in the locator. This must be overridden if more than one shared ApplicationContext definition is available.

Parameters:
target - the target bean to autowire
Returns:
the BeanFactoryLocator key to use (or null for referring to the single ApplicationContext defined in the locator)

releaseBean

@PreDestroy
public void releaseBean(javax.interceptor.InvocationContext invocationContext)
Release the factory which has been used for autowiring the target bean.

Parameters:
invocationContext - the EJB3 invocation context

doReleaseBean

protected void doReleaseBean(Object target)
Actually release the BeanFactoryReference for the given target bean.

Parameters:
target - the target bean to release
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.ejb.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.ejb.support

Base classes to make implementing EJB 2.x beans simpler and less error-prone, as well as guaranteeing a Spring BeanFactory is available to such EJBs.

See:
Description

Interface Summary
SmartSessionBean Interface to be implemented by Session Beans that want to expose important state to cooperating classes.

Class Summary
AbstractEnterpriseBean | Base class for Spring-based EJB 2.x beans.
AbstractJmsMessageDrivenBean | Convenient base class for JMS-based EJB 2.x MDBs.
AbstractMessageDrivenBean | Convenient base class for EJB 2.x MDBs.
AbstractSessionBean | Base class for Spring-based EJB 2.x session beans.
AbstractStatefulSessionBean | Convenient base class for EJB 2.x stateful session beans (SFSBs).
AbstractStatelessSessionBean | Convenient base class for EJB 2.x stateless session beans (SLSBs), minimizing the work involved in implementing an SLSB and preventing common errors.

Package org.springframework.ejb.support Description

Base classes to make implementing EJB 2.x beans simpler and less error-prone, as well as guaranteeing a Spring BeanFactory is available to such EJBs. This promotes good practice, with EJB services used for transaction management, thread management, and (possibly) remoting, while business logic is implemented in easily testable POJOs.

In this model, the EJB is a facade, with as many POJO helpers behind the BeanFactory as required.

Note that the default behavior is to look for an EJB enviroment variable with name ejb/BeanFactoryPath that specifies the location on the classpath of an XML bean factory definition file (such as /com/mycom/mypackage/mybeans.xml). If this JNDI key is missing, your EJB subclass won't successfully initialize in the container.

Check out the org.springframework.ejb.interceptor package for equivalent support for the EJB 3 component model, providing annotation-based autowiring using an EJB 3 interceptor.


org.springframework.ejb.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.ejb.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.ejb.support.AbstractEnterpriseBean (implements javax.ejb.EnterpriseBean)
      • org.springframework.ejb.support.AbstractMessageDrivenBean (implements javax.ejb.MessageDrivenBean)
        • org.springframework.ejb.support.AbstractJmsMessageDrivenBean (implements javax.jms.MessageListener)
      • org.springframework.ejb.support.AbstractSessionBean (implements org.springframework.ejb.support.SmartSessionBean)
        • org.springframework.ejb.support.AbstractStatefulSessionBean
        • org.springframework.ejb.support.AbstractStatelessSessionBean

Interface Hierarchy

  • java.io.Serializable
    • javax.ejb.EnterpriseBean
      • javax.ejb.SessionBean
        • org.springframework.ejb.support.SmartSessionBean


SmartSessionBean

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.ejb.support
Interface SmartSessionBean

All Superinterfaces:
EnterpriseBean, Serializable, SessionBean
All Known Implementing Classes:
AbstractSessionBean, AbstractStatefulSessionBean, AbstractStatelessSessionBean
public interface SmartSessionBean
extends SessionBean

Interface to be implemented by Session Beans that want to expose important state to cooperating classes.

Implemented by Spring's AbstractSessionBean class and hence by all of Spring's specific Session Bean support classes, such as AbstractStatelessSessionBean and AbstractStatefulSessionBean.

Since:
1.2
Author:
Juergen Hoeller
See Also:
AbstractStatelessSessionBean, AbstractStatefulSessionBean

Method Summary
 SessionContext getSessionContext()
Return the SessionContext that was passed to the Session Bean by the EJB container.
Methods inherited from interface javax.ejb.SessionBean
ejbActivate, ejbPassivate, ejbRemove, setSessionContext

Method Detail

getSessionContext

SessionContext getSessionContext()
Return the SessionContext that was passed to the Session Bean by the EJB container. Can be used by cooperating infrastructure code to get access to the user credentials, for example.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractEnterpriseBean

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.ejb.support
Class AbstractEnterpriseBean

java.lang.Object
    extended by  org.springframework.ejb.support.AbstractEnterpriseBean
All Implemented Interfaces:
Serializable, EnterpriseBean
Direct Known Subclasses:
AbstractMessageDrivenBean, AbstractSessionBean
public abstract class AbstractEnterpriseBean
extends Object
implements EnterpriseBean

Base class for Spring-based EJB 2.x beans. Not intended for direct subclassing: Extend AbstractStatelessSessionBean, AbstractStatefulSessionBean or AbstractMessageDrivenBean instead.

Provides a standard way of loading a Spring BeanFactory. Subclasses act as a facade, with the business logic deferred to beans in the BeanFactory. Default is to use a ContextJndiBeanFactoryLocator, which will initialize an XML ApplicationContext from the class path (based on a JNDI name specified). For a different locator strategy, setBeanFactoryLocator may be called (before your EJB's ejbCreate method is invoked, e.g. in setSessionContext). For use of a shared ApplicationContext between multiple EJBs, where the container class loader setup supports this visibility, you may instead use a ContextSingletonBeanFactoryLocator. Alternatively, setBeanFactoryLocator(org.springframework.beans.factory.access.BeanFactoryLocator) may be called with a custom implementation of the BeanFactoryLocator interface.

Note that we cannot use final for our implementation of EJB lifecycle methods, as this would violate the EJB specification.

Author:
Rod Johnson, Colin Sampaleanu, Juergen Hoeller
See Also:
ContextJndiBeanFactoryLocator, ContextSingletonBeanFactoryLocator, Serialized Form

Field Summary
static String BEAN_FACTORY_PATH_ENVIRONMENT_KEY
Constructor Summary
AbstractEnterpriseBean()
Method Summary
 void ejbRemove()
EJB lifecycle method, implemented to invoke onEjbRemove() and unload the BeanFactory afterwards.
protected  BeanFactory getBeanFactory()
May be called after ejbCreate().
protected  void onEjbRemove()
Subclasses must implement this method to do any initialization they would otherwise have done in an ejbRemove() method.
 void setBeanFactoryLocator(BeanFactoryLocator beanFactoryLocator)
Set the BeanFactoryLocator to use for this EJB.
 void setBeanFactoryLocatorKey(String factoryKey)
Set the bean factory locator key.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

BEAN_FACTORY_PATH_ENVIRONMENT_KEY

public static final String BEAN_FACTORY_PATH_ENVIRONMENT_KEY
See Also:
Constant Field Values
Constructor Detail

AbstractEnterpriseBean

public AbstractEnterpriseBean()
Method Detail

setBeanFactoryLocator

public void setBeanFactoryLocator(BeanFactoryLocator beanFactoryLocator)
Set the BeanFactoryLocator to use for this EJB. Default is a ContextJndiBeanFactoryLocator.

Can be invoked before loadBeanFactory, for example in constructor or setSessionContext if you want to override the default locator.

Note that the BeanFactory is automatically loaded by the ejbCreate implementations of AbstractStatelessSessionBean and AbstractMessageDriverBean but needs to be explicitly loaded in custom AbstractStatefulSessionBean ejbCreate methods.

See Also:
AbstractStatelessSessionBean.ejbCreate(),
AbstractMessageDrivenBean.ejbCreate(),
AbstractStatefulSessionBean.loadBeanFactory(),
ContextJndiBeanFactoryLocator

setBeanFactoryLocatorKey

public void setBeanFactoryLocatorKey(String factoryKey)
Set the bean factory locator key.

In case of the default BeanFactoryLocator implementation, ContextJndiBeanFactoryLocator, this is the JNDI path. The default value of this property is "java:comp/env/ejb/BeanFactoryPath".

Can be invoked before loadBeanFactory(), for example in the constructor or setSessionContext if you want to override the default locator key.

See Also:
BEAN_FACTORY_PATH_ENVIRONMENT_KEY

getBeanFactory

protected BeanFactory getBeanFactory()
May be called after ejbCreate().

Returns:
the bean factory

ejbRemove

public void ejbRemove()
EJB lifecycle method, implemented to invoke onEjbRemove() and unload the BeanFactory afterwards.

Don't override it (although it can't be made final): code your shutdown in onEjbRemove().

onEjbRemove

protected void onEjbRemove()
Subclasses must implement this method to do any initialization they would otherwise have done in an ejbRemove() method. The BeanFactory will be unloaded afterwards.

This implementation is empty, to be overridden in subclasses. The same restrictions apply to the work of this method as to an ejbRemove() method.

Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS | FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractJmsMessageDrivenBean

org.springframework.ejb.support
Class AbstractJmsMessageDrivenBean

java.lang.Object
    extended by  org.springframework.ejb.support.AbstractEnterpriseBean
        extended by  org.springframework.ejb.support.AbstractMessageDrivenBean
            extended by  org.springframework.ejb.support.AbstractJmsMessageDrivenBean
All Implemented Interfaces:
Serializable, EnterpriseBean, MessageDrivenBean, MessageListener
public abstract class AbstractJmsMessageDrivenBean
extends AbstractMessageDrivenBean
implements MessageListener

Convenient base class for JMS-based EJB 2.x MDBs. Requires subclasses to implement the JMS javax.jms.MessageListener interface.

Author:
Rod Johnson
See Also:
Serialized Form

Field Summary
Fields inherited from class org.springframework.ejb.support.AbstractMessageDrivenBean
logger
Fields inherited from class org.springframework.ejb.support.AbstractEnterpriseBean
BEAN_FACTORY_PATH_ENVIRONMENT_KEY
Constructor Summary
AbstractJmsMessageDrivenBean()
Method Summary
Methods inherited from class org.springframework.ejb.support.AbstractMessageDrivenBean
ejbCreate, getMessageDrivenContext, onEjbCreate, setMessageDrivenContext
Methods inherited from class org.springframework.ejb.support.AbstractEnterpriseBean
ejbRemove, getBeanFactory, onEjbRemove, setBeanFactoryLocator, setBeanFactoryLocatorKey
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.jms.MessageListener
onMessage
Methods inherited from interface javax.ejb.MessageDrivenBean
ejbRemove

Constructor Detail

AbstractJmsMessageDrivenBean

public AbstractJmsMessageDrivenBean()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractMessageDrivenBean

org.springframework.ejb.support
Class AbstractMessageDrivenBean

java.lang.Object
    extended by  org.springframework.ejb.support.AbstractEnterpriseBean
        extended by  org.springframework.ejb.support.AbstractMessageDrivenBean
All Implemented Interfaces:
Serializable, EnterpriseBean, MessageDrivenBean
Direct Known Subclasses:
AbstractJmsMessageDrivenBean
public abstract class AbstractMessageDrivenBean
extends AbstractEnterpriseBean
implements MessageDrivenBean

Convenient base class for EJB 2.x MDBs. Doesn't require JMS, as EJB 2.1 MDBs are no longer JMS-specific; see the AbstractJmsMessageDrivenBean subclass.

This class ensures that subclasses have access to the MessageDrivenContext provided by the EJB container, and implement a no-arg ejbCreate() method as required by the EJB specification. This ejbCreate() method loads a BeanFactory, before invoking the onEjbCreate() method, which is supposed to contain subclass-specific initialization.

NB: We cannot use final methods to implement EJB API methods, as this violates the EJB specification. However, there should be no need to override the setMessageDrivenContext or ejbCreate() methods.

Author:
Rod Johnson
See Also:
Serialized Form

Field Summary
protected  Log logger
Logger available to subclasses
Fields inherited from class org.springframework.ejb.support.AbstractEnterpriseBean
BEAN_FACTORY_PATH_ENVIRONMENT_KEY
Constructor Summary
AbstractMessageDrivenBean()
Method Summary
 void ejbCreate()
Lifecycle method required by the EJB specification but not the MessageDrivenBean interface.
protected  MessageDrivenContext getMessageDrivenContext()
Convenience method for subclasses to use.
protected abstract  void onEjbCreate()
Subclasses must implement this method to do any initialization they would otherwise have done in an ejbCreate() method.
 void setMessageDrivenContext(MessageDrivenContext messageDrivenContext)
Required lifecycle method.
Methods inherited from class org.springframework.ejb.support.AbstractEnterpriseBean
ejbRemove, getBeanFactory, onEjbRemove, setBeanFactoryLocator, setBeanFactoryLocatorKey
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.ejb.MessageDrivenBean
ejbRemove

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

AbstractMessageDrivenBean

public AbstractMessageDrivenBean()
Method Detail

setMessageDrivenContext

public void setMessageDrivenContext(MessageDrivenContext messageDrivenContext)
Required lifecycle method. Sets the MessageDriven context.

Specified by:
setMessageDrivenContext in interface MessageDrivenBean
Parameters:
messageDrivenContext - MessageDrivenContext

getMessageDrivenContext

protected final MessageDrivenContext getMessageDrivenContext()
Convenience method for subclasses to use.

Returns:
the MessageDrivenContext passed to this EJB by the EJB container

ejbCreate

public void ejbCreate()
Lifecycle method required by the EJB specification but not the MessageDrivenBean interface. This implementation loads the BeanFactory.

Don't override it (although it can't be made final): code initialization in onEjbCreate(), which is called when the BeanFactory is available.

Unfortunately we can't load the BeanFactory in setSessionContext(), as resource manager access isn't permitted and the BeanFactory may require it.

onEjbCreate

protected abstract void onEjbCreate()
Subclasses must implement this method to do any initialization they would otherwise have done in an ejbCreate() method. In contrast to ejbCreate(), the BeanFactory will have been loaded here.

The same restrictions apply to the work of this method as to an ejbCreate() method.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractSessionBean

org.springframework.ejb.support
Class AbstractSessionBean

java.lang.Object
    extended by  org.springframework.ejb.support.AbstractEnterpriseBean
        extended by  org.springframework.ejb.support.AbstractSessionBean
All Implemented Interfaces:
Serializable, EnterpriseBean, SessionBean, SmartSessionBean
Direct Known Subclasses:
AbstractStatefulSessionBean, AbstractStatelessSessionBean
public abstract class AbstractSessionBean
extends AbstractEnterpriseBean
implements SmartSessionBean

Base class for Spring-based EJB 2.x session beans. Not intended for direct subclassing: Extend AbstractStatelessSessionBean or AbstractStatefulSessionBean instead.

This class saves the session context provided by the EJB container in an instance variable and exposes it through the SmartSessionBean interface.

Author:
Rod Johnson, Juergen Hoeller
See Also:
Serialized Form

Field Summary
Fields inherited from class org.springframework.ejb.support.AbstractEnterpriseBean
BEAN_FACTORY_PATH_ENVIRONMENT_KEY
Constructor Summary
AbstractSessionBean()
Method Summary
 SessionContext getSessionContext()
Convenience method for subclasses, returning the EJB session context saved on initialization (setSessionContext(javax.ejb.SessionContext)).
 void setSessionContext(SessionContext sessionContext)
Set the session context for this EJB.
Methods inherited from class org.springframework.ejb.support.AbstractEnterpriseBean
ejbRemove, getBeanFactory, onEjbRemove, setBeanFactoryLocator, setBeanFactoryLocatorKey
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.ejb.SessionBean
ejbActivate, ejbPassivate, ejbRemove

Constructor Detail

AbstractSessionBean

public AbstractSessionBean()
Method Detail

setSessionContext

public void setSessionContext(SessionContext sessionContext)
Set the session context for this EJB.

When overriding this method, be sure to invoke this form of it first.

Specified by:
setSessionContext in interface SessionBean

getSessionContext

public final SessionContext getSessionContext()
Convenience method for subclasses, returning the EJB session context saved on initialization (setSessionContext(javax.ejb.SessionContext)).

Specified by:
getSessionContext in interface SmartSessionBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractStatefulSessionBean

org.springframework.ejb.support
Class AbstractStatefulSessionBean

java.lang.Object
    extended by  org.springframework.ejb.support.AbstractEnterpriseBean
        extended by  org.springframework.ejb.support.AbstractSessionBean
            extended by  org.springframework.ejb.support.AbstractStatefulSessionBean
All Implemented Interfaces:
Serializable, EnterpriseBean, SessionBean, SmartSessionBean
public abstract class AbstractStatefulSessionBean
extends AbstractSessionBean

Convenient base class for EJB 2.x stateful session beans (SFSBs). SFSBs should extend this class, leaving them to implement the ejbActivate() and ejbPassivate() lifecycle methods to comply with the requirements of the EJB specification.

Note: Subclasses should invoke the loadBeanFactory() method in their custom ejbCreate() and ejbActivate() methods, and should invoke the unloadBeanFactory() method in their ejbPassivate method.

Note: The default BeanFactoryLocator used by this class's superclass (ContextJndiBeanFactoryLocator) is not serializable. Therefore, when using the default BeanFactoryLocator, or another variant which is not serializable, subclasses must call setBeanFactoryLocator(null) in ejbPassivate(), with a corresponding call to setBeanFactoryLocator(xxx) in ejbActivate() unless relying on the default locator.

Author:
Rod Johnson, Colin Sampaleanu
See Also:
ContextJndiBeanFactoryLocator, Serialized Form

Field Summary
Fields inherited from class org.springframework.ejb.support.AbstractEnterpriseBean
BEAN_FACTORY_PATH_ENVIRONMENT_KEY
Constructor Summary
AbstractStatefulSessionBean()
Method Summary
protected void | loadBeanFactory() Load a Spring BeanFactory namespace.
protected void | unloadBeanFactory() Unload the Spring BeanFactory instance.
Methods inherited from class org.springframework.ejb.support.AbstractSessionBean
getSessionContext, setSessionContext
Methods inherited from class org.springframework.ejb.support.AbstractEnterpriseBean
ejbRemove, getBeanFactory, onEjbRemove, setBeanFactoryLocator, setBeanFactoryLocatorKey
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.ejb.SessionBean
ejbActivate, ejbPassivate, ejbRemove

Constructor Detail

AbstractStatefulSessionBean

public AbstractStatefulSessionBean()
Method Detail

loadBeanFactory

protected void loadBeanFactory()
                        throws BeansException
Load a Spring BeanFactory namespace. Exposed for subclasses to load a BeanFactory in their ejbCreate() methods. Those callers would normally want to catch BeansException and rethrow it as CreateException. Unless the BeanFactory is known to be serializable, this method must also be called from ejbActivate(), to reload a context removed via a call to unloadBeanFactory() from the ejbPassivate() implementation.

Throws:
BeansException
See Also:
AbstractStatelessSessionBean.ejbCreate()

unloadBeanFactory

protected void unloadBeanFactory()
                          throws FatalBeanException
Unload the Spring BeanFactory instance. The default ejbRemove() method invokes this method, but subclasses which override ejbRemove() must invoke this method themselves.

Unless the BeanFactory is known to be serializable, this method must also be called from ejbPassivate(), with a corresponding call to loadBeanFactory() from ejbActivate().

Throws:
FatalBeanException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractStatelessSessionBean

org.springframework.ejb.support
Class AbstractStatelessSessionBean

java.lang.Object
    extended by  org.springframework.ejb.support.AbstractEnterpriseBean
        extended by  org.springframework.ejb.support.AbstractSessionBean
            extended by  org.springframework.ejb.support.AbstractStatelessSessionBean
All Implemented Interfaces:
Serializable, EnterpriseBean, SessionBean, SmartSessionBean
public abstract class AbstractStatelessSessionBean
extends AbstractSessionBean

Convenient base class for EJB 2.x stateless session beans (SLSBs), minimizing the work involved in implementing an SLSB and preventing common errors. Note that SLSBs are the most useful kind of EJB.

As the ejbActivate() and ejbPassivate() methods cannot be invoked on SLSBs, these methods are implemented to throw an exception and should not be overriden by subclasses. (Unfortunately the EJB specification forbids enforcing this by making EJB lifecycle methods final.)

There should be no need to override the setSessionContext() or ejbCreate() lifecycle methods.

Subclasses are left to implement the onEjbCreate() method to do whatever initialization they wish to do after their BeanFactory has already been loaded, and is available from the getBeanFactory() method.

This class provides the no-arg ejbCreate() method required by the EJB specification, but not the SessionBean interface, eliminating a common cause of EJB deployment failure.

Author:
Rod Johnson
See Also:
Serialized Form

Field Summary
protected  Log logger
Logger available to subclasses
Fields inherited from class org.springframework.ejb.support.AbstractEnterpriseBean
BEAN_FACTORY_PATH_ENVIRONMENT_KEY
Constructor Summary
AbstractStatelessSessionBean()
Method Summary
 void ejbActivate()
 void ejbCreate()
This implementation loads the BeanFactory.
 void ejbPassivate()
protected abstract  void onEjbCreate()
Subclasses must implement this method to do any initialization they would otherwise have done in an ejbCreate() method.
Methods inherited from class org.springframework.ejb.support.AbstractSessionBean
getSessionContext, setSessionContext
Methods inherited from class org.springframework.ejb.support.AbstractEnterpriseBean
ejbRemove, getBeanFactory, onEjbRemove, setBeanFactoryLocator, setBeanFactoryLocatorKey
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.ejb.SessionBean
ejbRemove

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

AbstractStatelessSessionBean

public AbstractStatelessSessionBean()
Method Detail

ejbCreate

public void ejbCreate()
               throws CreateException
This implementation loads the BeanFactory. A BeansException thrown by loadBeanFactory will simply get propagated, as it is a runtime exception.

Don't override it (although it can't be made final): code your own initialization in onEjbCreate(), which is called when the BeanFactory is available.

Unfortunately we can't load the BeanFactory in setSessionContext(), as resource manager access isn't permitted there - but the BeanFactory may require it.

Throws:
CreateException

onEjbCreate

protected abstract void onEjbCreate()
                             throws CreateException
Subclasses must implement this method to do any initialization they would otherwise have done in an ejbCreate() method. In contrast to ejbCreate, the BeanFactory will have been loaded here.

The same restrictions apply to the work of this method as to an ejbCreate() method.

Throws:
CreateException

ejbActivate

public void ejbActivate()
                 throws EJBException
Throws:
EJBException
See Also:
This method always throws an exception, as it should not be invoked by the EJB container.

ejbPassivate

public void ejbPassivate()
                  throws EJBException
Throws:
EJBException
See Also:
This method always throws an exception, as it should not be invoked by the EJB container.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.expression

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.expression

Interface Summary
ConstructorExecutor | Executors are built by resolvers and can be cached by the infrastructure to repeat an operation quickly without going back to the resolvers.
ConstructorResolver | A constructor resolver attempts locate a constructor and returns a ConstructorExecutor that can be used to invoke that constructor.
EvaluationContext | Expressions are executed in an evaluation context.
Expression | An expression capable of evaluating itself against context objects.
ExpressionParser | Parses expression strings into compiled expressions that can be evaluated.
MethodExecutor | MethodExecutors are built by the resolvers and can be cached by the infrastructure to repeat an operation quickly without going back to the resolvers.
MethodFilter | MethodFilter instances allow SpEL users to fine tune the behaviour of the method resolution process.
MethodResolver | A method resolver attempts locate a method and returns a command executor that can be used to invoke that method.
OperatorOverloader | By default the mathematical operators Operation support simple types like numbers.
ParserContext | Input provided to an expression parser that can influence an expression parsing/compilation routine.
PropertyAccessor | A property accessor is able to read (and possibly write) to object properties.
TypeComparator | Instances of a type comparator should be able to compare pairs of objects for equality, the specification of the return value is the same as for Comparable.
TypeConverter | A type converter can convert values between different types encountered during expression evaluation.
TypeLocator | Implementors of this interface are expected to be able to locate types.

Class Summary
TypedValue Encapsulates an object and a type descriptor that describes it.

Enum Summary
Operation Supported operations that an OperatorOverloader can implement for any pair of operands.

Exception Summary
AccessException | An AccessException is thrown by an accessor if it has an unexpected problem.
EvaluationException | Represent an exception that occurs during expression evaluation.
ExpressionException | Super class for exceptions that can occur whilst processing expressions
ParseException | Represent an exception that occurs during expression parsing.


org.springframework.expression Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.expression

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • org.springframework.expression.AccessException
        • java.lang.RuntimeException
          • org.springframework.expression.ExpressionException
            • org.springframework.expression.EvaluationException
            • org.springframework.expression.ParseException
    • org.springframework.expression.TypedValue

Interface Hierarchy

  • org.springframework.expression.ConstructorExecutor
  • org.springframework.expression.ConstructorResolver
  • org.springframework.expression.EvaluationContext
  • org.springframework.expression.Expression
  • org.springframework.expression.ExpressionParser
  • org.springframework.expression.MethodExecutor
  • org.springframework.expression.MethodFilter
  • org.springframework.expression.MethodResolver
  • org.springframework.expression.OperatorOverloader
  • org.springframework.expression.ParserContext
  • org.springframework.expression.PropertyAccessor
  • org.springframework.expression.TypeComparator
  • org.springframework.expression.TypeConverter
  • org.springframework.expression.TypeLocator

Enum Hierarchy

  • java.lang.Object
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)
      • org.springframework.expression.Operation


ConstructorExecutor

org.springframework.expression
Interface ConstructorExecutor

public interface ConstructorExecutor

Executors are built by resolvers and can be cached by the infrastructure to repeat an operation quickly without going back to the resolvers. For example, the particular constructor to run on a class may be discovered by the reflection constructor resolver - it will then build a ConstructorExecutor that executes that constructor and the ConstructorExecutor can be reused without needing to go back to the resolver to discover the constructor again. They can become stale, and in that case should throw an AccessException - this will cause the infrastructure to go back to the resolvers to ask for a new one.

Since:
3.0
Author:
Andy Clement

Method Summary
 TypedValue execute(EvaluationContext context, Object... arguments)
Execute a constructor in the specified context using the specified arguments.

Method Detail

execute

TypedValue execute(EvaluationContext context,
                   Object... arguments)
                   throws AccessException
Execute a constructor in the specified context using the specified arguments.

Parameters:
context - the evaluation context in which the command is being executed
arguments - the arguments to the constructor call, should match (in terms of number and type) whatever the command will need to run
Returns:
the new object
Throws:
AccessException - if there is a problem executing the command or the CommandExecutor is no longer valid
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConstructorResolver

org.springframework.expression
Interface ConstructorResolver

All Known Implementing Classes:
ReflectiveConstructorResolver
public interface ConstructorResolver

A constructor resolver attempts locate a constructor and returns a ConstructorExecutor that can be used to invoke that constructor. The ConstructorExecutor will be cached but if it 'goes stale' the resolvers will be called again.

Since:
3.0
Author:
Andy Clement

Method Summary
 ConstructorExecutor resolve(EvaluationContext context, String typeName, Class<?>[] argumentTypes)
Within the supplied context determine a suitable constructor on the supplied type that can handle the specified arguments.

Method Detail

resolve

ConstructorExecutor resolve(EvaluationContext context,
                            String typeName,
                            Class<?>[] argumentTypes)
                            throws AccessException
Within the supplied context determine a suitable constructor on the supplied type that can handle the specified arguments. Return a ConstructorExecutor that can be used to invoke that constructor (or null if no constructor could be found).

Parameters:
context - the current evaluation context
typeName - the type upon which to look for the constructor
argumentTypes - the arguments that the constructor must be able to handle
Returns:
a ConstructorExecutor that can invoke the constructor, or null if non found
Throws:
AccessException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EvaluationContext

org.springframework.expression
Interface EvaluationContext

All Known Implementing Classes:
StandardEvaluationContext
public interface EvaluationContext

Expressions are executed in an evaluation context. It is in this context that references are resolved when encountered during expression evaluation.

There is a default implementation of the EvaluationContext, StandardEvaluationContext that can be extended, rather than having to implement everything.

Since:
3.0
Author:
Andy Clement, Juergen Hoeller

Method Summary
List<ConstructorResolver> | getConstructorResolvers()
List<MethodResolver> | getMethodResolvers()
OperatorOverloader | getOperatorOverloader()
List<PropertyAccessor> | getPropertyAccessors()
TypedValue | getRootObject()
TypeComparator | getTypeComparator()
TypeConverter | getTypeConverter()
TypeLocator | getTypeLocator()
Object | lookupVariable(String name) Look up a named variable within this evaluation context.
void | setVariable(String name, Object value) Set a named variable within this evaluation context to a specified value.

Method Detail

getRootObject

TypedValue getRootObject()
Returns:
the default root context object against which unqualified properties/methods/etc should be resolved. This can be overridden when evaluating an expression.

getConstructorResolvers

List<ConstructorResolver> getConstructorResolvers()
Returns:
a list of resolvers that will be asked in turn to locate a constructor

getMethodResolvers

List<MethodResolver> getMethodResolvers()
Returns:
a list of resolvers that will be asked in turn to locate a method

getPropertyAccessors

List<PropertyAccessor> getPropertyAccessors()
Returns:
a list of accessors that will be asked in turn to read/write a property

getTypeLocator

TypeLocator getTypeLocator()
Returns:
a type locator that can be used to find types, either by short or fully qualified name.

getTypeConverter

TypeConverter getTypeConverter()
Returns:
a type converter that can convert (or coerce) a value from one type to another.

getTypeComparator

TypeComparator getTypeComparator()
Returns:
a type comparator for comparing pairs of objects for equality.

getOperatorOverloader

OperatorOverloader getOperatorOverloader()
Returns:
an operator overloader that may support mathematical operations between more than the standard set of types

setVariable

void setVariable(String name,
                 Object value)
Set a named variable within this evaluation context to a specified value.

Parameters:
name - variable to set
value - value to be placed in the variable

lookupVariable

Object lookupVariable(String name)
Look up a named variable within this evaluation context.

Parameters:
name - variable to lookup
Returns:
the value of the variable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Expression

org.springframework.expression
Interface Expression

All Known Implementing Classes:
CompositeStringExpression, LiteralExpression, SpelExpression
public interface Expression

An expression capable of evaluating itself against context objects. Encapsulates the details of a previously parsed expression string. Provides a common abstraction for expression evaluation independent of any language like OGNL or the Unified EL.

Since:
3.0
Author:
Keith Donald, Andy Clement

Method Summary
 String getExpressionString()
Returns the original string used to create this expression, unmodified.
 Object getValue()
Evaluate this expression in the default standard context.
<T> T
getValue(Class<T> desiredResultType)
Evaluate the expression in the default context.
 Object getValue(EvaluationContext context)
Evaluate this expression in the provided context and return the result of evaluation.
<T> T
getValue(EvaluationContext context, Class<T> desiredResultType)
Evaluate the expression in a specified context which can resolve references to properties, methods, types, etc - the type of the evaluation result is expected to be of a particular class and an exception will be thrown if it is not and cannot be converted to that type.
 Object getValue(EvaluationContext context, Object rootObject)
Evaluate this expression in the provided context and return the result of evaluation, but use the supplied root context as an override for any default root object specified in the context.
<T> T
getValue(EvaluationContext context, Object rootObject, Class<T> desiredResultType)
Evaluate the expression in a specified context which can resolve references to properties, methods, types, etc - the type of the evaluation result is expected to be of a particular class and an exception will be thrown if it is not and cannot be converted to that type.
 Object getValue(Object rootObject)
Evaluate this expression against the specified root object
<T> T
getValue(Object rootObject, Class<T> desiredResultType)
Evaluate the expression in the default context against the specified root object.
 Class getValueType()
Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method using the default context.
 Class getValueType(EvaluationContext context)
Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method for the given context.
 Class getValueType(EvaluationContext context, Object rootObject)
Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method for the given context.
 Class getValueType(Object rootObject)
Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method using the default context.
 TypeDescriptor getValueTypeDescriptor()
Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method using the default context.
 TypeDescriptor getValueTypeDescriptor(EvaluationContext context)
Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method for the given context.
 TypeDescriptor getValueTypeDescriptor(EvaluationContext context, Object rootObject)
Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method for the given context.
 TypeDescriptor getValueTypeDescriptor(Object rootObject)
Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method using the default context.
 boolean isWritable(EvaluationContext context)
Determine if an expression can be written to, i.e.
 boolean isWritable(EvaluationContext context, Object rootObject)
Determine if an expression can be written to, i.e.
 boolean isWritable(Object rootObject)
Determine if an expression can be written to, i.e.
 void setValue(EvaluationContext context, Object value)
Set this expression in the provided context to the value provided.
 void setValue(EvaluationContext context, Object rootObject, Object value)
Set this expression in the provided context to the value provided.
 void setValue(Object rootObject, Object value)
Set this expression in the provided context to the value provided.

Method Detail

getValue

Object getValue()
                throws EvaluationException
Evaluate this expression in the default standard context.

Returns:
the evaluation result
Throws:
EvaluationException - if there is a problem during evaluation

getValue

Object getValue(Object rootObject)
                throws EvaluationException
Evaluate this expression against the specified root object

Parameters:
rootObject - the root object against which properties/etc will be resolved
Returns:
the evaluation result
Throws:
EvaluationException - if there is a problem during evaluation

getValue

<T> T getValue(Class<T> desiredResultType)
           throws EvaluationException
Evaluate the expression in the default context. If the result of the evaluation does not match (and cannot be converted to) the expected result type then an exception will be returned.

Parameters:
desiredResultType - the class the caller would like the result to be
Returns:
the evaluation result
Throws:
EvaluationException - if there is a problem during evaluation

getValue

<T> T getValue(Object rootObject,
               Class<T> desiredResultType)
           throws EvaluationException
Evaluate the expression in the default context against the specified root object. If the result of the evaluation does not match (and cannot be converted to) the expected result type then an exception will be returned.

Parameters:
rootObject - the root object against which properties/etc will be resolved
desiredResultType - the class the caller would like the result to be
Returns:
the evaluation result
Throws:
EvaluationException - if there is a problem during evaluation

getValue

Object getValue(EvaluationContext context)
                throws EvaluationException
Evaluate this expression in the provided context and return the result of evaluation.

Parameters:
context - the context in which to evaluate the expression
Returns:
the evaluation result
Throws:
EvaluationException - if there is a problem during evaluation

getValue

Object getValue(EvaluationContext context,
                Object rootObject)
                throws EvaluationException
Evaluate this expression in the provided context and return the result of evaluation, but use the supplied root context as an override for any default root object specified in the context.

Parameters:
context - the context in which to evaluate the expression
rootObject - the root object against which properties/etc will be resolved
Returns:
the evaluation result
Throws:
EvaluationException - if there is a problem during evaluation

getValue

<T> T getValue(EvaluationContext context,
               Class<T> desiredResultType)
           throws EvaluationException
Evaluate the expression in a specified context which can resolve references to properties, methods, types, etc - the type of the evaluation result is expected to be of a particular class and an exception will be thrown if it is not and cannot be converted to that type.

Parameters:
context - the context in which to evaluate the expression
desiredResultType - the class the caller would like the result to be
Returns:
the evaluation result
Throws:
EvaluationException - if there is a problem during evaluation

getValue

<T> T getValue(EvaluationContext context,
               Object rootObject,
               Class<T> desiredResultType)
           throws EvaluationException
Evaluate the expression in a specified context which can resolve references to properties, methods, types, etc - the type of the evaluation result is expected to be of a particular class and an exception will be thrown if it is not and cannot be converted to that type. The supplied root object overrides any default specified on the supplied context.

Parameters:
context - the context in which to evaluate the expression
rootObject - the root object against which properties/etc will be resolved
desiredResultType - the class the caller would like the result to be
Returns:
the evaluation result
Throws:
EvaluationException - if there is a problem during evaluation

getValueType

Class getValueType()
                   throws EvaluationException
Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method using the default context.

Returns:
the most general type of value that can be set on this context
Throws:
EvaluationException - if there is a problem determining the type

getValueType

Class getValueType(Object rootObject)
                   throws EvaluationException
Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method using the default context.

Parameters:
rootObject - the root object against which to evaluate the expression
Returns:
the most general type of value that can be set on this context
Throws:
EvaluationException - if there is a problem determining the type

getValueType

Class getValueType(EvaluationContext context)
                   throws EvaluationException
Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method for the given context.

Parameters:
context - the context in which to evaluate the expression
Returns:
the most general type of value that can be set on this context
Throws:
EvaluationException - if there is a problem determining the type

getValueType

Class getValueType(EvaluationContext context,
                   Object rootObject)
                   throws EvaluationException
Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method for the given context. The supplied root object overrides any specified in the context.

Parameters:
context - the context in which to evaluate the expression
rootObject - the root object against which to evaluate the expression
Returns:
the most general type of value that can be set on this context
Throws:
EvaluationException - if there is a problem determining the type

getValueTypeDescriptor

TypeDescriptor getValueTypeDescriptor()
                                      throws EvaluationException
Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method using the default context.

Returns:
a type descriptor for the most general type of value that can be set on this context
Throws:
EvaluationException - if there is a problem determining the type

getValueTypeDescriptor

TypeDescriptor getValueTypeDescriptor(Object rootObject)
                                      throws EvaluationException
Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method using the default context.

Parameters:
rootObject - the root object against which to evaluate the expression
Returns:
a type descriptor for the most general type of value that can be set on this context
Throws:
EvaluationException - if there is a problem determining the type

getValueTypeDescriptor

TypeDescriptor getValueTypeDescriptor(EvaluationContext context)
                                      throws EvaluationException
Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method for the given context.

Parameters:
context - the context in which to evaluate the expression
Returns:
a type descriptor for the most general type of value that can be set on this context
Throws:
EvaluationException - if there is a problem determining the type

getValueTypeDescriptor

TypeDescriptor getValueTypeDescriptor(EvaluationContext context,
                                      Object rootObject)
                                      throws EvaluationException
Returns the most general type that can be passed to the setValue(EvaluationContext, Object) method for the given context. The supplied root object overrides any specified in the context.

Parameters:
context - the context in which to evaluate the expression
rootObject - the root object against which to evaluate the expression
Returns:
a type descriptor for the most general type of value that can be set on this context
Throws:
EvaluationException - if there is a problem determining the type

isWritable

boolean isWritable(EvaluationContext context)
                   throws EvaluationException
Determine if an expression can be written to, i.e. setValue() can be called.

Parameters:
context - the context in which the expression should be checked
Returns:
true if the expression is writable
Throws:
EvaluationException - if there is a problem determining if it is writable

isWritable

boolean isWritable(EvaluationContext context,
                   Object rootObject)
                   throws EvaluationException
Determine if an expression can be written to, i.e. setValue() can be called. The supplied root object overrides any specified in the context.

Parameters:
context - the context in which the expression should be checked
rootObject - the root object against which to evaluate the expression
Returns:
true if the expression is writable
Throws:
EvaluationException - if there is a problem determining if it is writable

isWritable

boolean isWritable(Object rootObject)
                   throws EvaluationException
Determine if an expression can be written to, i.e. setValue() can be called.

Parameters:
rootObject - the root object against which to evaluate the expression
Returns:
true if the expression is writable
Throws:
EvaluationException - if there is a problem determining if it is writable

setValue

void setValue(EvaluationContext context,
              Object value)
              throws EvaluationException
Set this expression in the provided context to the value provided.

Parameters:
context - the context in which to set the value of the expression
value - the new value
Throws:
EvaluationException - if there is a problem during evaluation

setValue

void setValue(Object rootObject,
              Object value)
              throws EvaluationException
Set this expression in the provided context to the value provided.

Parameters:
rootObject - the root object against which to evaluate the expression
value - the new value
Throws:
EvaluationException - if there is a problem during evaluation

setValue

void setValue(EvaluationContext context,
              Object rootObject,
              Object value)
              throws EvaluationException
Set this expression in the provided context to the value provided. The supplied root object overrides any specified in the context.

Parameters:
context - the context in which to set the value of the expression
rootObject - the root object against which to evaluate the expression
value - the new value
Throws:
EvaluationException - if there is a problem during evaluation

getExpressionString

String getExpressionString()
Returns the original string used to create this expression, unmodified.

Returns:
the original expression string
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ExpressionParser

org.springframework.expression
Interface ExpressionParser

All Known Implementing Classes:
SpelExpressionParser, TemplateAwareExpressionParser
public interface ExpressionParser

Parses expression strings into compiled expressions that can be evaluated. Supports parsing templates as well as standard expression strings.

Since:
3.0
Author:
Keith Donald, Andy Clement

Method Summary
Expression | parseExpression(String expressionString) Parse the expression string and return an Expression object you can use for repeated evaluation.
Expression | parseExpression(String expressionString, ParserContext context) Parse the expression string and return an Expression object you can use for repeated evaluation.

Method Detail

parseExpression

Expression parseExpression(String expressionString)
                           throws ParseException
Parse the expression string and return an Expression object you can use for repeated evaluation.

Some examples:

     3 + 4
     name.firstName

Parameters:
expressionString - the raw expression string to parse
Returns:
an evaluator for the parsed expression
Throws:
ParseException - an exception occurred during parsing

parseExpression

Expression parseExpression(String expressionString,
                           ParserContext context)
                           throws ParseException
Parse the expression string and return an Expression object you can use for repeated evaluation.

Some examples:

     3 + 4
     name.firstName

Parameters:
expressionString - the raw expression string to parse
context - a context for influencing this expression parsing routine (optional)
Returns:
an evaluator for the parsed expression
Throws:
ParseException - an exception occurred during parsing
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MethodExecutor

org.springframework.expression
Interface MethodExecutor

public interface MethodExecutor

MethodExecutors are built by the resolvers and can be cached by the infrastructure to repeat an operation quickly without going back to the resolvers. For example, the particular method to run on an object may be discovered by the reflection method resolver - it will then build a MethodExecutor that executes that method and the MethodExecutor can be reused without needing to go back to the resolver to discover the method again.

They can become stale, and in that case should throw an AccessException - this will cause the infrastructure to go back to the resolvers to ask for a new one.

Since:
3.0
Author:
Andy Clement

Method Summary
 TypedValue execute(EvaluationContext context, Object target, Object... arguments)
Execute a command using the specified arguments, and using the specified expression state.

Method Detail

execute

TypedValue execute(EvaluationContext context,
                   Object target,
                   Object... arguments)
                   throws AccessException
Execute a command using the specified arguments, and using the specified expression state.

Parameters:
context - the evaluation context in which the command is being executed
target - the target object of the call - null for static methods
arguments - the arguments to the executor, should match (in terms of number and type) whatever the command will need to run
Returns:
the value returned from execution
Throws:
AccessException - if there is a problem executing the command or the MethodExecutor is no longer valid
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MethodFilter

org.springframework.expression
Interface MethodFilter

public interface MethodFilter

MethodFilter instances allow SpEL users to fine tune the behaviour of the method resolution process. Method resolution (which translates from a method name in an expression to a real method to invoke) will normally retrieve candidate methods for invocation via a simple call to 'Class.getMethods()' and will choose the first one that is suitable for the input parameters. By registering a MethodFilter the user can receive a callback and change the methods that will be considered suitable.

Since:
3.0.1
Author:
Andy Clement

Method Summary
 List<Method> filter(List<Method> methods)
Called by the method resolver to allow the SpEL user to organize the list of candidate methods that may be invoked.

Method Detail

filter

List<Method> filter(List<Method> methods)
Called by the method resolver to allow the SpEL user to organize the list of candidate methods that may be invoked. The filter can remove methods that should not be considered candidates and it may sort the results. The resolver will then search through the methods as returned from the filter when looking for a suitable candidate to invoke.

Parameters:
methods - the full list of methods the resolver was going to choose from
Returns:
a possible subset of input methods that may be sorted by order of relevance
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MethodResolver

org.springframework.expression
Interface MethodResolver

All Known Implementing Classes:
ReflectiveMethodResolver
public interface MethodResolver

A method resolver attempts locate a method and returns a command executor that can be used to invoke that method. The command executor will be cached but if it 'goes stale' the resolvers will be called again.

Since:
3.0
Author:
Andy Clement

Method Summary
 MethodExecutor resolve(EvaluationContext context, Object targetObject, String name, Class<?>[] argumentTypes)
Within the supplied context determine a suitable method on the supplied object that can handle the specified arguments.

Method Detail

resolve

MethodExecutor resolve(EvaluationContext context,
                       Object targetObject,
                       String name,
                       Class<?>[] argumentTypes)
                       throws AccessException
Within the supplied context determine a suitable method on the supplied object that can handle the specified arguments. Return a MethodExecutor that can be used to invoke that method (or null if no method could be found).

Parameters:
context - the current evaluation context
targetObject - the object upon which the method is being called
argumentTypes - the arguments that the constructor must be able to handle
Returns:
a MethodExecutor that can invoke the method, or null if the method cannot be found
Throws:
AccessException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OperatorOverloader

org.springframework.expression
Interface OperatorOverloader

All Known Implementing Classes:
StandardOperatorOverloader
public interface OperatorOverloader

By default the mathematical operators Operation support simple types like numbers. By providing an implementation of OperatorOverloader, a user of the expression language can support these operations on other types.

Since:
3.0
Author:
Andy Clement

Method Summary
Object | operate(Operation operation, Object leftOperand, Object rightOperand) Execute the specified operation on two operands, returning a result.
boolean | overridesOperation(Operation operation, Object leftOperand, Object rightOperand) Return true if the operator overloader supports the specified operation between the two operands and so should be invoked to handle it.

Method Detail

overridesOperation

boolean overridesOperation(Operation operation,
                           Object leftOperand,
                           Object rightOperand)
                           throws EvaluationException
Return true if the operator overloader supports the specified operation between the two operands and so should be invoked to handle it.

Parameters:
operation - the operation to be performed
leftOperand - the left operand
rightOperand - the right operand
Returns:
true if the OperatorOverloader supports the specified operation between the two operands
Throws:
EvaluationException - if there is a problem performing the operation

operate

Object operate(Operation operation,
               Object leftOperand,
               Object rightOperand)
               throws EvaluationException
Execute the specified operation on two operands, returning a result. See Operation for supported operations.

Parameters:
operation - the operation to be performed
leftOperand - the left operand
rightOperand - the right operand
Returns:
the result of performing the operation on the two operands
Throws:
EvaluationException - if there is a problem performing the operation
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ParserContext

org.springframework.expression
Interface ParserContext

All Known Implementing Classes:
TemplateParserContext
public interface ParserContext

Input provided to an expression parser that can influence an expression parsing/compilation routine.

Since:
3.0
Author:
Keith Donald, Andy Clement

Field Summary
static ParserContext TEMPLATE_EXPRESSION
The default ParserContext implementation that enables template expression parsing mode.
Method Summary
String | getExpressionPrefix() For template expressions, returns the prefix that identifies the start of an expression block within a string.
String | getExpressionSuffix() For template expressions, return the prefix that identifies the end of an expression block within a string.
boolean | isTemplate() Whether or not the expression being parsed is a template.

Field Detail

TEMPLATE_EXPRESSION

static final ParserContext TEMPLATE_EXPRESSION
The default ParserContext implementation that enables template expression parsing mode. The expression prefix is #{ and the expression suffix is }.

See Also:
isTemplate()
Method Detail

isTemplate

boolean isTemplate()
Whether or not the expression being parsed is a template. A template expression consists of literal text that can be mixed with evaluatable blocks. Some examples:
           Some literal text
     Hello #{name.firstName}!
     #{3 + 4}

Returns:
true if the expression is a template, false otherwise

getExpressionPrefix

String getExpressionPrefix()
For template expressions, returns the prefix that identifies the start of an expression block within a string. For example: "${"

Returns:
the prefix that identifies the start of an expression

getExpressionSuffix

String getExpressionSuffix()
For template expressions, return the prefix that identifies the end of an expression block within a string. For example: "}"

Returns:
the suffix that identifies the end of an expression
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertyAccessor

org.springframework.expression
Interface PropertyAccessor

All Known Implementing Classes:
BeanExpressionContextAccessor, BeanFactoryAccessor, MapAccessor, ReflectivePropertyAccessor
public interface PropertyAccessor

A property accessor is able to read (and possibly write) to object properties. The interface places no restrictions and so implementors are free to access properties directly as fields or through getters or in any other way they see as appropriate. A resolver can optionally specify an array of target classes for which it should be called - but if it returns null from getSpecificTargetClasses() then it will be called for all property references and given a chance to determine if it can read or write them. Property resolvers are considered to be ordered and each will be called in turn. The only rule that affects the call order is that any naming the target class directly in getSpecifiedTargetClasses() will be called first, before the general resolvers.

Since:
3.0
Author:
Andy Clement

Method Summary
boolean | canRead(EvaluationContext context, Object target, String name) Called to determine if a resolver instance is able to access a specified property on a specified target object.
boolean | canWrite(EvaluationContext context, Object target, String name) Called to determine if a resolver instance is able to write to a specified property on a specified target object.
Class[] | getSpecificTargetClasses() Return an array of classes for which this resolver should be called.
TypedValue | read(EvaluationContext context, Object target, String name) Called to read a property from a specified target object
void | write(EvaluationContext context, Object target, String name, Object newValue) Called to write to a property on a specified target object.

Method Detail

getSpecificTargetClasses

Class[] getSpecificTargetClasses()
Return an array of classes for which this resolver should be called. Returning null indicates this is a general resolver that can be called in an attempt to resolve a property on any type.

Returns:
an array of classes that this resolver is suitable for (or null if a general resolver)

canRead

boolean canRead(EvaluationContext context,
                Object target,
                String name)
                throws AccessException
Called to determine if a resolver instance is able to access a specified property on a specified target object.

Parameters:
context - the evaluation context in which the access is being attempted
target - the target object upon which the property is being accessed
name - the name of the property being accessed
Returns:
true if this resolver is able to read the property
Throws:
AccessException - if there is any problem determining whether the property can be read

read

TypedValue read(EvaluationContext context,
                Object target,
                String name)
                throws AccessException
Called to read a property from a specified target object

Parameters:
context - the evaluation context in which the access is being attempted
target - the target object upon which the property is being accessed
name - the name of the property being accessed
Returns:
a TypedValue object wrapping the property value read and a type descriptor for it
Throws:
AccessException - if there is any problem accessing the property value

canWrite

boolean canWrite(EvaluationContext context,
                 Object target,
                 String name)
                 throws AccessException
Called to determine if a resolver instance is able to write to a specified property on a specified target object.

Parameters:
context - the evaluation context in which the access is being attempted
target - the target object upon which the property is being accessed
name - the name of the property being accessed
Returns:
true if this resolver is able to write to the property
Throws:
AccessException - if there is any problem determining whether the property can be written to

write

void write(EvaluationContext context,
           Object target,
           String name,
           Object newValue)
           throws AccessException
Called to write to a property on a specified target object. Should only succeed if canWrite() also returns true.

Parameters:
context - the evaluation context in which the access is being attempted
target - the target object upon which the property is being accessed
name - the name of the property being accessed
newValue - the new value for the property
Throws:
AccessException - if there is any problem writing to the property value
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TypeComparator

org.springframework.expression
Interface TypeComparator

All Known Implementing Classes:
StandardTypeComparator
public interface TypeComparator

Instances of a type comparator should be able to compare pairs of objects for equality, the specification of the return value is the same as for Comparable.

Since:
3.0
Author:
Andy Clement

Method Summary
boolean | canCompare(Object firstObject, Object secondObject) Return true if the comparator can compare these two objects
int | compare(Object firstObject, Object secondObject) Compare two objects.

Method Detail

compare

int compare(Object firstObject,
            Object secondObject)
            throws EvaluationException
Compare two objects.

Parameters:
firstObject - the first object
secondObject - the second object
Returns:
0 if they are equal, <0 if the first is smaller than the second, or >0 if the first is larger than the second
Throws:
EvaluationException - if a problem occurs during comparison (or they are not comparable)

canCompare

boolean canCompare(Object firstObject,
                   Object secondObject)
Return true if the comparator can compare these two objects

Parameters:
firstObject - the first object
secondObject - the second object
Returns:
true if the comparator can compare these objects
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TypeConverter

org.springframework.expression
Interface TypeConverter

All Known Implementing Classes:
StandardTypeConverter
public interface TypeConverter

A type converter can convert values between different types encountered during expression evaluation. This is an SPI for the expression parser; see ConversionService for the primary user API to Spring's conversion facilities.

Since:
3.0
Author:
Andy Clement, Juergen Hoeller

Method Summary
boolean | canConvert(Class<?> sourceType, Class<?> targetType) Return true if the type converter can convert the specified type to the desired target type.
boolean | canConvert(TypeDescriptor sourceType, TypeDescriptor targetType) Return true if the type converter can convert the specified type to the desired target type.
Object | convertValue(Object value, TypeDescriptor sourceType, TypeDescriptor targetType) Convert (may coerce) a value from one type to another, for example from a boolean to a string.

Method Detail

canConvert

boolean canConvert(Class<?> sourceType,
                   Class<?> targetType)
Return true if the type converter can convert the specified type to the desired target type.

Parameters:
sourceType - the type to be converted from
targetType - the type to be converted to
Returns:
true if that conversion can be performed

canConvert

boolean canConvert(TypeDescriptor sourceType,
                   TypeDescriptor targetType)
Return true if the type converter can convert the specified type to the desired target type.

Parameters:
sourceType - a type descriptor that describes the source type
targetType - a type descriptor that describes the requested result type
Returns:
true if that conversion can be performed

convertValue

Object convertValue(Object value,
                    TypeDescriptor sourceType,
                    TypeDescriptor targetType)
Convert (may coerce) a value from one type to another, for example from a boolean to a string. The typeDescriptor parameter enables support for typed collections - if the caller really wishes they can have a List for example, rather than simply a List.

Parameters:
value - the value to be converted
sourceType - a type descriptor that supplies extra information about the source object
targetType - a type descriptor that supplies extra information about the requested result type
Returns:
the converted value
Throws:
EvaluationException - if conversion is not possible
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TypeLocator

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.expression
Interface TypeLocator

All Known Implementing Classes:
StandardTypeLocator
public interface TypeLocator

Implementors of this interface are expected to be able to locate types. They may use custom classloaders or the and deal with common package prefixes (java.lang, etc) however they wish. See StandardTypeLocator for an example implementation.

Since:
3.0
Author:
Andy Clement

Method Summary
 Class<?> findType(String typename)
Find a type by name.

Method Detail

findType

Class<?> findType(String typename)
                  throws EvaluationException
Find a type by name. The name may or may not be fully qualified (eg. String or java.lang.String)

Parameters:
typename - the type to be located
Returns:
the class object representing that type
Throws:
EvaluationException - if there is a problem finding it
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


TypedValue

org.springframework.expression
Class TypedValue

java.lang.Object
    extended by  org.springframework.expression.TypedValue
Direct Known Subclasses:
BooleanTypedValue
public class TypedValue
extends Object

Encapsulates an object and a type descriptor that describes it. The type descriptor can hold generic information that would not be accessible through a simple getClass() call on the object.

Since:
3.0
Author:
Andy Clement

Field Summary
static TypedValue NULL
Constructor Summary
TypedValue(Object value)
Create a TypedValue for a simple object.
TypedValue(Object value, TypeDescriptor typeDescriptor)
Create a TypedValue for a particular value with a particular type descriptor.
Method Summary
TypeDescriptor | getTypeDescriptor()
Object | getValue()
String | toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

NULL

public static final TypedValue NULL
Constructor Detail

TypedValue

public TypedValue(Object value)
Create a TypedValue for a simple object. The type descriptor is inferred from the object, so no generic information is preserved.

Parameters:
value - the object value

TypedValue

public TypedValue(Object value,
                  TypeDescriptor typeDescriptor)
Create a TypedValue for a particular value with a particular type descriptor.

Parameters:
value - the object value
typeDescriptor - a type descriptor describing the type of the value
Method Detail

getValue

public Object getValue()

getTypeDescriptor

public TypeDescriptor getTypeDescriptor()

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Operation

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

org.springframework.expression
Enum Operation

java.lang.Object
    extended by  java.lang.Enum<Operation>
        extended by  org.springframework.expression.Operation
All Implemented Interfaces:
Serializable, Comparable<Operation>
public enum Operation
extends Enum<Operation>

Supported operations that an OperatorOverloader can implement for any pair of operands.

Since:
3.0
Author:
Andy Clement

Enum Constant Summary
ADD
DIVIDE
MODULUS
MULTIPLY
POWER
SUBTRACT
Method Summary
static Operation | valueOf(String name) Returns the enum constant of this type with the specified name.
static Operation[] | values() Returns an array containing the constants of this enum type, in the order they are declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

ADD

public static final Operation ADD

SUBTRACT

public static final Operation SUBTRACT

DIVIDE

public static final Operation DIVIDE

MULTIPLY

public static final Operation MULTIPLY

MODULUS

public static final Operation MODULUS

POWER

public static final Operation POWER
Method Detail

values

public static Operation[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Operation c : Operation.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Operation valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


AccessException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.expression
Class AccessException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  org.springframework.expression.AccessException
All Implemented Interfaces:
Serializable
public class AccessException
extends Exception

An AccessException is thrown by an accessor if it has an unexpected problem.

Since:
3.0
Author:
Andy Clement
See Also:
Serialized Form

Constructor Summary
AccessException(String message)
Create an AccessException with a specific message.
AccessException(String message, Exception cause)
Create an AccessException with a specific message and cause.
Method Summary
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AccessException

public AccessException(String message,
                       Exception cause)
Create an AccessException with a specific message and cause.

Parameters:
message - the message
cause - the cause

AccessException

public AccessException(String message)
Create an AccessException with a specific message.

Parameters:
message - the message
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


EvaluationException

org.springframework.expression
Class EvaluationException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.expression.ExpressionException
                    extended by  org.springframework.expression.EvaluationException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
SpelEvaluationException
public class EvaluationException
extends ExpressionException

Represent an exception that occurs during expression evaluation.

Since:
3.0
Author:
Andy Clement
See Also:
Serialized Form

Field Summary
Fields inherited from class org.springframework.expression.ExpressionException
expressionString, position
Constructor Summary
EvaluationException(int position, String message)
Creates a new expression evaluation exception.
EvaluationException(int position, String message, Throwable cause)
Creates a new expression evaluation exception.
EvaluationException(String message)
Creates a new expression evaluation exception.
EvaluationException(String expressionString, String message)
Creates a new expression evaluation exception.
EvaluationException(String message, Throwable cause)
Method Summary
Methods inherited from class org.springframework.expression.ExpressionException
getExpressionString, getPosition, toDetailedString
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

EvaluationException

public EvaluationException(int position,
                           String message)
Creates a new expression evaluation exception.

Parameters:
position - the position in the expression where the problem occurred
message - description of the problem that occurred

EvaluationException

public EvaluationException(String expressionString,
                           String message)
Creates a new expression evaluation exception.

Parameters:
expressionString - the expression that could not be evaluated
message - description of the problem that occurred

EvaluationException

public EvaluationException(int position,
                           String message,
                           Throwable cause)
Creates a new expression evaluation exception.

Parameters:
position - the position in the expression where the problem occurred
message - description of the problem that occurred
cause - the underlying cause of this exception

EvaluationException

public EvaluationException(String message)
Creates a new expression evaluation exception.

Parameters:
message - description of the problem that occurred

EvaluationException

public EvaluationException(String message,
                           Throwable cause)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ExpressionException

org.springframework.expression
Class ExpressionException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.expression.ExpressionException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
EvaluationException, ParseException
public class ExpressionException
extends RuntimeException

Super class for exceptions that can occur whilst processing expressions

Since:
3.0
Author:
Andy Clement
See Also:
Serialized Form

Field Summary
protected String | expressionString
protected int | position
Constructor Summary
ExpressionException(int position, String message)
Creates a new expression exception.
ExpressionException(int position, String message, Throwable cause)
Creates a new expression exception.
ExpressionException(String message)
Creates a new expression exception.
ExpressionException(String expressionString, int position, String message)
Creates a new expression exception.
ExpressionException(String expressionString, String message)
Creates a new expression exception.
ExpressionException(String message, Throwable cause)
Method Summary
String | getExpressionString()
int | getPosition()
String | toDetailedString()
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

expressionString

protected String expressionString

position

protected int position
Constructor Detail

ExpressionException

public ExpressionException(String expressionString,
                           String message)
Creates a new expression exception.

Parameters:
expressionString - the expression string
message - a descriptive message

ExpressionException

public ExpressionException(String expressionString,
                           int position,
                           String message)
Creates a new expression exception.

Parameters:
expressionString - the expression string
position - the position in the expression string where the problem occurred
message - a descriptive message

ExpressionException

public ExpressionException(int position,
                           String message)
Creates a new expression exception.

Parameters:
position - the position in the expression string where the problem occurred
message - a descriptive message

ExpressionException

public ExpressionException(int position,
                           String message,
                           Throwable cause)
Creates a new expression exception.

Parameters:
position - the position in the expression string where the problem occurred
message - a descriptive message
cause - the underlying cause of this exception

ExpressionException

public ExpressionException(String message)
Creates a new expression exception.

Parameters:
message - a descriptive message

ExpressionException

public ExpressionException(String message,
                           Throwable cause)
Method Detail

toDetailedString

public String toDetailedString()

getExpressionString

public final String getExpressionString()

getPosition

public final int getPosition()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ParseException

org.springframework.expression
Class ParseException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.expression.ExpressionException
                    extended by  org.springframework.expression.ParseException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
SpelParseException
public class ParseException
extends ExpressionException

Represent an exception that occurs during expression parsing.

Since:
3.0
Author:
Andy Clement
See Also:
Serialized Form

Field Summary
Fields inherited from class org.springframework.expression.ExpressionException
expressionString, position
Constructor Summary
ParseException(int position, String message)
Creates a new expression parsing exception.
ParseException(int position, String message, Throwable cause)
Creates a new expression parsing exception.
ParseException(String expressionString, int position, String message)
Creates a new expression parsing exception.
Method Summary
Methods inherited from class org.springframework.expression.ExpressionException
getExpressionString, getPosition, toDetailedString
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ParseException

public ParseException(String expressionString,
                      int position,
                      String message)
Creates a new expression parsing exception.

Parameters:
expressionString - the expression string that could not be parsed
position - the position in the expression string where the problem occurred
message - description of the problem that occurred

ParseException

public ParseException(int position,
                      String message,
                      Throwable cause)
Creates a new expression parsing exception.

Parameters:
position - the position in the expression string where the problem occurred
message - description of the problem that occurred
cause - the underlying cause of this exception

ParseException

public ParseException(int position,
                      String message)
Creates a new expression parsing exception.

Parameters:
position - the position in the expression string where the problem occurred
message - description of the problem that occurred
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.expression.common

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.expression.common

Class Summary
CompositeStringExpression | Represents a template expression broken into pieces.
ExpressionUtils | Common utility functions that may be used by any Expression Language provider.
LiteralExpression | A very simple hardcoded implementation of the Expression interface that represents a string literal.
TemplateAwareExpressionParser | An expression parser that understands templates.
TemplateParserContext | Configurable ParserContext implementation for template parsing.


org.springframework.expression.common Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.expression.common

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.expression.common.CompositeStringExpression (implements org.springframework.expression.Expression)
    • org.springframework.expression.common.ExpressionUtils
    • org.springframework.expression.common.LiteralExpression (implements org.springframework.expression.Expression)
    • org.springframework.expression.common.TemplateAwareExpressionParser (implements org.springframework.expression.ExpressionParser)
    • org.springframework.expression.common.TemplateParserContext (implements org.springframework.expression.ParserContext)


CompositeStringExpression

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.expression.common
Class CompositeStringExpression

java.lang.Object
    extended by  org.springframework.expression.common.CompositeStringExpression
All Implemented Interfaces:
Expression
public class CompositeStringExpression
extends Object
implements Expression

Represents a template expression broken into pieces. Each piece will be an Expression but pure text parts to the template will be represented as LiteralExpression objects. An example of a template expression might be:

 "Hello ${getName()}"
which will be represented as a CompositeStringExpression of two parts. The first part being a LiteralExpression representing 'Hello ' and the second part being a real expression that will call getName() when invoked.

Since:
3.0
Author:
Andy Clement, Juergen Hoeller

Constructor Summary
CompositeStringExpression(String expressionString, Expression[] expressions)
Method Summary
 Expression[] getExpressions()
 String getExpressionString()
Returns the original string used to create this expression, unmodified.
 String getValue()
Evaluate this expression in the default standard context.
<T> T
getValue(Class<T> expectedResultType)
Evaluate the expression in the default context.
 String getValue(EvaluationContext context)
Evaluate this expression in the provided context and return the result of evaluation.
<T> T
getValue(EvaluationContext context, Class<T> expectedResultType)
Evaluate the expression in a specified context which can resolve references to properties, methods, types, etc - the type of the evaluation result is expected to be of a particular class and an exception will be thrown if it is not and cannot be converted to that type.
 String getValue(EvaluationContext context, Object rootObject)
Evaluate this expression in the provided context and return the result of evaluation, but use the supplied root context as an override for any default root object specified in the context.
<T> T
getValue(EvaluationContext context, Object rootObject, Class<T> desiredResultType)
Evaluate the expression in a specified context which can resolve references to properties, methods, types, etc - the type of the evaluation result is expected to be of a particular class and an exception will be thrown if it is not and cannot be converted to that type.
 String getValue(Object rootObject)
Evaluate this expression against the specified root object
<T> T
getValue(Object rootObject, Class<T> desiredResultType)
Evaluate the expression in the default context against the specified root object.
 Class getValueType()
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method using the default context.
 Class getValueType(EvaluationContext context)
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method for the given context.
 Class getValueType(EvaluationContext context, Object rootObject)
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method for the given context.
 Class getValueType(Object rootObject)
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method using the default context.
 TypeDescriptor getValueTypeDescriptor()
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method using the default context.
 TypeDescriptor getValueTypeDescriptor(EvaluationContext context)
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method for the given context.
 TypeDescriptor getValueTypeDescriptor(EvaluationContext context, Object rootObject)
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method for the given context.
 TypeDescriptor getValueTypeDescriptor(Object rootObject)
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method using the default context.
 boolean isWritable(EvaluationContext context)
Determine if an expression can be written to, i.e.
 boolean isWritable(EvaluationContext context, Object rootObject)
Determine if an expression can be written to, i.e.
 boolean isWritable(Object rootObject)
Determine if an expression can be written to, i.e.
 void setValue(EvaluationContext context, Object value)
Set this expression in the provided context to the value provided.
 void setValue(EvaluationContext context, Object rootObject, Object value)
Set this expression in the provided context to the value provided.
 void setValue(Object rootObject, Object value)
Set this expression in the provided context to the value provided.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CompositeStringExpression

public CompositeStringExpression(String expressionString,
                                 Expression[] expressions)
Method Detail

getExpressionString

public final String getExpressionString()
Description copied from interface: Expression
Returns the original string used to create this expression, unmodified.

Specified by:
getExpressionString in interface Expression
Returns:
the original expression string

getValue

public String getValue()
                throws EvaluationException
Description copied from interface: Expression
Evaluate this expression in the default standard context.

Specified by:
getValue in interface Expression
Returns:
the evaluation result
Throws:
EvaluationException - if there is a problem during evaluation

getValue

public String getValue(Object rootObject)
                throws EvaluationException
Description copied from interface: Expression
Evaluate this expression against the specified root object

Specified by:
getValue in interface Expression
Parameters:
rootObject - the root object against which properties/etc will be resolved
Returns:
the evaluation result
Throws:
EvaluationException - if there is a problem during evaluation

getValue

public String getValue(EvaluationContext context)
                throws EvaluationException
Description copied from interface: Expression
Evaluate this expression in the provided context and return the result of evaluation.

Specified by:
getValue in interface Expression
Parameters:
context - the context in which to evaluate the expression
Returns:
the evaluation result
Throws:
EvaluationException - if there is a problem during evaluation

getValue

public String getValue(EvaluationContext context,
                       Object rootObject)
                throws EvaluationException
Description copied from interface: Expression
Evaluate this expression in the provided context and return the result of evaluation, but use the supplied root context as an override for any default root object specified in the context.

Specified by:
getValue in interface Expression
Parameters:
context - the context in which to evaluate the expression
rootObject - the root object against which properties/etc will be resolved
Returns:
the evaluation result
Throws:
EvaluationException - if there is a problem during evaluation

getValueType

public Class getValueType(EvaluationContext context)
Description copied from interface: Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method for the given context.

Specified by:
getValueType in interface Expression
Parameters:
context - the context in which to evaluate the expression
Returns:
the most general type of value that can be set on this context

getValueType

public Class getValueType()
Description copied from interface: Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method using the default context.

Specified by:
getValueType in interface Expression
Returns:
the most general type of value that can be set on this context

getValueTypeDescriptor

public TypeDescriptor getValueTypeDescriptor(EvaluationContext context)
Description copied from interface: Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method for the given context.

Specified by:
getValueTypeDescriptor in interface Expression
Parameters:
context - the context in which to evaluate the expression
Returns:
a type descriptor for the most general type of value that can be set on this context

getValueTypeDescriptor

public TypeDescriptor getValueTypeDescriptor()
Description copied from interface: Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method using the default context.

Specified by:
getValueTypeDescriptor in interface Expression
Returns:
a type descriptor for the most general type of value that can be set on this context

setValue

public void setValue(EvaluationContext context,
                     Object value)
              throws EvaluationException
Description copied from interface: Expression
Set this expression in the provided context to the value provided.

Specified by:
setValue in interface Expression
Parameters:
context - the context in which to set the value of the expression
value - the new value
Throws:
EvaluationException - if there is a problem during evaluation

getValue

public <T> T getValue(EvaluationContext context,
                      Class<T> expectedResultType)
           throws EvaluationException
Description copied from interface: Expression
Evaluate the expression in a specified context which can resolve references to properties, methods, types, etc - the type of the evaluation result is expected to be of a particular class and an exception will be thrown if it is not and cannot be converted to that type.

Specified by:
getValue in interface Expression
Parameters:
context - the context in which to evaluate the expression
expectedResultType - the class the caller would like the result to be
Returns:
the evaluation result
Throws:
EvaluationException - if there is a problem during evaluation

getValue

public <T> T getValue(Class<T> expectedResultType)
           throws EvaluationException
Description copied from interface: Expression
Evaluate the expression in the default context. If the result of the evaluation does not match (and cannot be converted to) the expected result type then an exception will be returned.

Specified by:
getValue in interface Expression
Parameters:
expectedResultType - the class the caller would like the result to be
Returns:
the evaluation result
Throws:
EvaluationException - if there is a problem during evaluation

isWritable

public boolean isWritable(EvaluationContext context)
Description copied from interface: Expression
Determine if an expression can be written to, i.e. setValue() can be called.

Specified by:
isWritable in interface Expression
Parameters:
context - the context in which the expression should be checked
Returns:
true if the expression is writable

getExpressions

public Expression[] getExpressions()

getValue

public <T> T getValue(Object rootObject,
                      Class<T> desiredResultType)
           throws EvaluationException
Description copied from interface: Expression
Evaluate the expression in the default context against the specified root object. If the result of the evaluation does not match (and cannot be converted to) the expected result type then an exception will be returned.

Specified by:
getValue in interface Expression
Parameters:
rootObject - the root object against which properties/etc will be resolved
desiredResultType - the class the caller would like the result to be
Returns:
the evaluation result
Throws:
EvaluationException - if there is a problem during evaluation

getValue

public <T> T getValue(EvaluationContext context,
                      Object rootObject,
                      Class<T> desiredResultType)
           throws EvaluationException
Description copied from interface: Expression
Evaluate the expression in a specified context which can resolve references to properties, methods, types, etc - the type of the evaluation result is expected to be of a particular class and an exception will be thrown if it is not and cannot be converted to that type. The supplied root object overrides any default specified on the supplied context.

Specified by:
getValue in interface Expression
Parameters:
context - the context in which to evaluate the expression
rootObject - the root object against which properties/etc will be resolved
desiredResultType - the class the caller would like the result to be
Returns:
the evaluation result
Throws:
EvaluationException - if there is a problem during evaluation

getValueType

public Class getValueType(Object rootObject)
                   throws EvaluationException
Description copied from interface: Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method using the default context.

Specified by:
getValueType in interface Expression
Parameters:
rootObject - the root object against which to evaluate the expression
Returns:
the most general type of value that can be set on this context
Throws:
EvaluationException - if there is a problem determining the type

getValueType

public Class getValueType(EvaluationContext context,
                          Object rootObject)
                   throws EvaluationException
Description copied from interface: Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method for the given context. The supplied root object overrides any specified in the context.

Specified by:
getValueType in interface Expression
Parameters:
context - the context in which to evaluate the expression
rootObject - the root object against which to evaluate the expression
Returns:
the most general type of value that can be set on this context
Throws:
EvaluationException - if there is a problem determining the type

getValueTypeDescriptor

public TypeDescriptor getValueTypeDescriptor(Object rootObject)
                                      throws EvaluationException
Description copied from interface: Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method using the default context.

Specified by:
getValueTypeDescriptor in interface Expression
Parameters:
rootObject - the root object against which to evaluate the expression
Returns:
a type descriptor for the most general type of value that can be set on this context
Throws:
EvaluationException - if there is a problem determining the type

getValueTypeDescriptor

public TypeDescriptor getValueTypeDescriptor(EvaluationContext context,
                                             Object rootObject)
                                      throws EvaluationException
Description copied from interface: Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method for the given context. The supplied root object overrides any specified in the context.

Specified by:
getValueTypeDescriptor in interface Expression
Parameters:
context - the context in which to evaluate the expression
rootObject - the root object against which to evaluate the expression
Returns:
a type descriptor for the most general type of value that can be set on this context
Throws:
EvaluationException - if there is a problem determining the type

isWritable

public boolean isWritable(EvaluationContext context,
                          Object rootObject)
                   throws EvaluationException
Description copied from interface: Expression
Determine if an expression can be written to, i.e. setValue() can be called. The supplied root object overrides any specified in the context.

Specified by:
isWritable in interface Expression
Parameters:
context - the context in which the expression should be checked
rootObject - the root object against which to evaluate the expression
Returns:
true if the expression is writable
Throws:
EvaluationException - if there is a problem determining if it is writable

setValue

public void setValue(EvaluationContext context,
                     Object rootObject,
                     Object value)
              throws EvaluationException
Description copied from interface: Expression
Set this expression in the provided context to the value provided. The supplied root object overrides any specified in the context.

Specified by:
setValue in interface Expression
Parameters:
context - the context in which to set the value of the expression
rootObject - the root object against which to evaluate the expression
value - the new value
Throws:
EvaluationException - if there is a problem during evaluation

isWritable

public boolean isWritable(Object rootObject)
                   throws EvaluationException
Description copied from interface: Expression
Determine if an expression can be written to, i.e. setValue() can be called.

Specified by:
isWritable in interface Expression
Parameters:
rootObject - the root object against which to evaluate the expression
Returns:
true if the expression is writable
Throws:
EvaluationException - if there is a problem determining if it is writable

setValue

public void setValue(Object rootObject,
                     Object value)
              throws EvaluationException
Description copied from interface: Expression
Set this expression in the provided context to the value provided.

Specified by:
setValue in interface Expression
Parameters:
rootObject - the root object against which to evaluate the expression
value - the new value
Throws:
EvaluationException - if there is a problem during evaluation
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ExpressionUtils

org.springframework.expression.common
Class ExpressionUtils

java.lang.Object
    extended by  org.springframework.expression.common.ExpressionUtils

public abstract class ExpressionUtils
extends Object

Common utility functions that may be used by any Expression Language provider.

Since:
3.0
Author:
Andy Clement, Juergen Hoeller

Constructor Summary
ExpressionUtils()
Method Summary
static
<T> T
convert(EvaluationContext context, Object value, Class<T> targetType)
Determines if there is a type converter available in the specified context and attempts to use it to convert the supplied value to the specified type.
static
<T> T
convertTypedValue(EvaluationContext context, TypedValue typedValue, Class<T> targetType)
Determines if there is a type converter available in the specified context and attempts to use it to convert the supplied value to the specified type.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ExpressionUtils

public ExpressionUtils()
Method Detail

convert

public static <T> T convert(EvaluationContext context,
                            Object value,
                            Class<T> targetType)
                 throws EvaluationException
Determines if there is a type converter available in the specified context and attempts to use it to convert the supplied value to the specified type. Throws an exception if conversion is not possible.

Parameters:
context - the evaluation context that may define a type converter
value - the value to convert (may be null)
targetType - the type to attempt conversion to
Returns:
the converted value
Throws:
EvaluationException - if there is a problem during conversion or conversion of the value to the specified type is not supported

convertTypedValue

public static <T> T convertTypedValue(EvaluationContext context,
                                      TypedValue typedValue,
                                      Class<T> targetType)
Determines if there is a type converter available in the specified context and attempts to use it to convert the supplied value to the specified type. Throws an exception if conversion is not possible.

Parameters:
context - the evaluation context that may define a type converter
typedValue - the value to convert and a type descriptor describing it
targetType - the type to attempt conversion to
Returns:
the converted value
Throws:
EvaluationException - if there is a problem during conversion or conversion of the value to the specified type is not supported
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LiteralExpression

org.springframework.expression.common
Class LiteralExpression

java.lang.Object
    extended by  org.springframework.expression.common.LiteralExpression
All Implemented Interfaces:
Expression
public class LiteralExpression
extends Object
implements Expression

A very simple hardcoded implementation of the Expression interface that represents a string literal. It is used with CompositeStringExpression when representing a template expression which is made up of pieces - some being real expressions to be handled by an EL implementation like Spel, and some being just textual elements.

Since:
3.0
Author:
Andy Clement

Constructor Summary
LiteralExpression(String literalValue)
Method Summary
 String getExpressionString()
Returns the original string used to create this expression, unmodified.
 String getValue()
Evaluate this expression in the default standard context.
<T> T
getValue(Class<T> expectedResultType)
Evaluate the expression in the default context.
 String getValue(EvaluationContext context)
Evaluate this expression in the provided context and return the result of evaluation.
<T> T
getValue(EvaluationContext context, Class<T> expectedResultType)
Evaluate the expression in a specified context which can resolve references to properties, methods, types, etc - the type of the evaluation result is expected to be of a particular class and an exception will be thrown if it is not and cannot be converted to that type.
 String getValue(EvaluationContext context, Object rootObject)
Evaluate this expression in the provided context and return the result of evaluation, but use the supplied root context as an override for any default root object specified in the context.
<T> T
getValue(EvaluationContext context, Object rootObject, Class<T> desiredResultType)
Evaluate the expression in a specified context which can resolve references to properties, methods, types, etc - the type of the evaluation result is expected to be of a particular class and an exception will be thrown if it is not and cannot be converted to that type.
 String getValue(Object rootObject)
Evaluate this expression against the specified root object
<T> T
getValue(Object rootObject, Class<T> desiredResultType)
Evaluate the expression in the default context against the specified root object.
 Class getValueType()
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method using the default context.
 Class getValueType(EvaluationContext context)
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method for the given context.
 Class getValueType(EvaluationContext context, Object rootObject)
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method for the given context.
 Class getValueType(Object rootObject)
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method using the default context.
 TypeDescriptor getValueTypeDescriptor()
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method using the default context.
 TypeDescriptor getValueTypeDescriptor(EvaluationContext context)
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method for the given context.
 TypeDescriptor getValueTypeDescriptor(EvaluationContext context, Object rootObject)
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method for the given context.
 TypeDescriptor getValueTypeDescriptor(Object rootObject)
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method using the default context.
 boolean isWritable(EvaluationContext context)
Determine if an expression can be written to, i.e.
 boolean isWritable(EvaluationContext context, Object rootObject)
Determine if an expression can be written to, i.e.
 boolean isWritable(Object rootObject)
Determine if an expression can be written to, i.e.
 void setValue(EvaluationContext context, Object value)
Set this expression in the provided context to the value provided.
 void setValue(EvaluationContext context, Object rootObject, Object value)
Set this expression in the provided context to the value provided.
 void setValue(Object rootObject, Object value)
Set this expression in the provided context to the value provided.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

LiteralExpression

public LiteralExpression(String literalValue)
Method Detail

getExpressionString

public final String getExpressionString()
Description copied from interface: Expression
Returns the original string used to create this expression, unmodified.

Specified by:
getExpressionString in interface Expression
Returns:
the original expression string

getValue

public String getValue()
Description copied from interface: Expression
Evaluate this expression in the default standard context.

Specified by:
getValue in interface Expression
Returns:
the evaluation result

getValue

public String getValue(EvaluationContext context)
Description copied from interface: Expression
Evaluate this expression in the provided context and return the result of evaluation.

Specified by:
getValue in interface Expression
Parameters:
context - the context in which to evaluate the expression
Returns:
the evaluation result

getValue

public String getValue(Object rootObject)
Description copied from interface: Expression
Evaluate this expression against the specified root object

Specified by:
getValue in interface Expression
Parameters:
rootObject - the root object against which properties/etc will be resolved
Returns:
the evaluation result

getValueType

public Class getValueType(EvaluationContext context)
Description copied from interface: Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method for the given context.

Specified by:
getValueType in interface Expression
Parameters:
context - the context in which to evaluate the expression
Returns:
the most general type of value that can be set on this context

getValueTypeDescriptor

public TypeDescriptor getValueTypeDescriptor(EvaluationContext context)
Description copied from interface: Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method for the given context.

Specified by:
getValueTypeDescriptor in interface Expression
Parameters:
context - the context in which to evaluate the expression
Returns:
a type descriptor for the most general type of value that can be set on this context

getValueTypeDescriptor

public TypeDescriptor getValueTypeDescriptor()
Description copied from interface: Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method using the default context.

Specified by:
getValueTypeDescriptor in interface Expression
Returns:
a type descriptor for the most general type of value that can be set on this context

setValue

public void setValue(EvaluationContext context,
                     Object value)
              throws EvaluationException
Description copied from interface: Expression
Set this expression in the provided context to the value provided.

Specified by:
setValue in interface Expression
Parameters:
context - the context in which to set the value of the expression
value - the new value
Throws:
EvaluationException - if there is a problem during evaluation

getValue

public <T> T getValue(EvaluationContext context,
                      Class<T> expectedResultType)
           throws EvaluationException
Description copied from interface: Expression
Evaluate the expression in a specified context which can resolve references to properties, methods, types, etc - the type of the evaluation result is expected to be of a particular class and an exception will be thrown if it is not and cannot be converted to that type.

Specified by:
getValue in interface Expression
Parameters:
context - the context in which to evaluate the expression
expectedResultType - the class the caller would like the result to be
Returns:
the evaluation result
Throws:
EvaluationException - if there is a problem during evaluation

getValue

public <T> T getValue(Class<T> expectedResultType)
           throws EvaluationException
Description copied from interface: Expression
Evaluate the expression in the default context. If the result of the evaluation does not match (and cannot be converted to) the expected result type then an exception will be returned.

Specified by:
getValue in interface Expression
Parameters:
expectedResultType - the class the caller would like the result to be
Returns:
the evaluation result
Throws:
EvaluationException - if there is a problem during evaluation

isWritable

public boolean isWritable(EvaluationContext context)
Description copied from interface: Expression
Determine if an expression can be written to, i.e. setValue() can be called.

Specified by:
isWritable in interface Expression
Parameters:
context - the context in which the expression should be checked
Returns:
true if the expression is writable

getValueType

public Class getValueType()
Description copied from interface: Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method using the default context.

Specified by:
getValueType in interface Expression
Returns:
the most general type of value that can be set on this context

getValue

public <T> T getValue(Object rootObject,
                      Class<T> desiredResultType)
           throws EvaluationException
Description copied from interface: Expression
Evaluate the expression in the default context against the specified root object. If the result of the evaluation does not match (and cannot be converted to) the expected result type then an exception will be returned.

Specified by:
getValue in interface Expression
Parameters:
rootObject - the root object against which properties/etc will be resolved
desiredResultType - the class the caller would like the result to be
Returns:
the evaluation result
Throws:
EvaluationException - if there is a problem during evaluation

getValue

public String getValue(EvaluationContext context,
                       Object rootObject)
                throws EvaluationException
Description copied from interface: Expression
Evaluate this expression in the provided context and return the result of evaluation, but use the supplied root context as an override for any default root object specified in the context.

Specified by:
getValue in interface Expression
Parameters:
context - the context in which to evaluate the expression
rootObject - the root object against which properties/etc will be resolved
Returns:
the evaluation result
Throws:
EvaluationException - if there is a problem during evaluation

getValue

public <T> T getValue(EvaluationContext context,
                      Object rootObject,
                      Class<T> desiredResultType)
           throws EvaluationException
Description copied from interface: Expression
Evaluate the expression in a specified context which can resolve references to properties, methods, types, etc - the type of the evaluation result is expected to be of a particular class and an exception will be thrown if it is not and cannot be converted to that type. The supplied root object overrides any default specified on the supplied context.

Specified by:
getValue in interface Expression
Parameters:
context - the context in which to evaluate the expression
rootObject - the root object against which properties/etc will be resolved
desiredResultType - the class the caller would like the result to be
Returns:
the evaluation result
Throws:
EvaluationException - if there is a problem during evaluation

getValueType

public Class getValueType(Object rootObject)
                   throws EvaluationException
Description copied from interface: Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method using the default context.

Specified by:
getValueType in interface Expression
Parameters:
rootObject - the root object against which to evaluate the expression
Returns:
the most general type of value that can be set on this context
Throws:
EvaluationException - if there is a problem determining the type

getValueType

public Class getValueType(EvaluationContext context,
                          Object rootObject)
                   throws EvaluationException
Description copied from interface: Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method for the given context. The supplied root object overrides any specified in the context.

Specified by:
getValueType in interface Expression
Parameters:
context - the context in which to evaluate the expression
rootObject - the root object against which to evaluate the expression
Returns:
the most general type of value that can be set on this context
Throws:
EvaluationException - if there is a problem determining the type

getValueTypeDescriptor

public TypeDescriptor getValueTypeDescriptor(Object rootObject)
                                      throws EvaluationException
Description copied from interface: Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method using the default context.

Specified by:
getValueTypeDescriptor in interface Expression
Parameters:
rootObject - the root object against which to evaluate the expression
Returns:
a type descriptor for the most general type of value that can be set on this context
Throws:
EvaluationException - if there is a problem determining the type

getValueTypeDescriptor

public TypeDescriptor getValueTypeDescriptor(EvaluationContext context,
                                             Object rootObject)
                                      throws EvaluationException
Description copied from interface: Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method for the given context. The supplied root object overrides any specified in the context.

Specified by:
getValueTypeDescriptor in interface Expression
Parameters:
context - the context in which to evaluate the expression
rootObject - the root object against which to evaluate the expression
Returns:
a type descriptor for the most general type of value that can be set on this context
Throws:
EvaluationException - if there is a problem determining the type

isWritable

public boolean isWritable(EvaluationContext context,
                          Object rootObject)
                   throws EvaluationException
Description copied from interface: Expression
Determine if an expression can be written to, i.e. setValue() can be called. The supplied root object overrides any specified in the context.

Specified by:
isWritable in interface Expression
Parameters:
context - the context in which the expression should be checked
rootObject - the root object against which to evaluate the expression
Returns:
true if the expression is writable
Throws:
EvaluationException - if there is a problem determining if it is writable

setValue

public void setValue(EvaluationContext context,
                     Object rootObject,
                     Object value)
              throws EvaluationException
Description copied from interface: Expression
Set this expression in the provided context to the value provided. The supplied root object overrides any specified in the context.

Specified by:
setValue in interface Expression
Parameters:
context - the context in which to set the value of the expression
rootObject - the root object against which to evaluate the expression
value - the new value
Throws:
EvaluationException - if there is a problem during evaluation

isWritable

public boolean isWritable(Object rootObject)
                   throws EvaluationException
Description copied from interface: Expression
Determine if an expression can be written to, i.e. setValue() can be called.

Specified by:
isWritable in interface Expression
Parameters:
rootObject - the root object against which to evaluate the expression
Returns:
true if the expression is writable
Throws:
EvaluationException - if there is a problem determining if it is writable

setValue

public void setValue(Object rootObject,
                     Object value)
              throws EvaluationException
Description copied from interface: Expression
Set this expression in the provided context to the value provided.

Specified by:
setValue in interface Expression
Parameters:
rootObject - the root object against which to evaluate the expression
value - the new value
Throws:
EvaluationException - if there is a problem during evaluation
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TemplateAwareExpressionParser

org.springframework.expression.common
Class TemplateAwareExpressionParser

java.lang.Object
    extended by  org.springframework.expression.common.TemplateAwareExpressionParser
All Implemented Interfaces:
ExpressionParser
Direct Known Subclasses:
SpelExpressionParser
public abstract class TemplateAwareExpressionParser
extends Object
implements ExpressionParser

An expression parser that understands templates. It can be subclassed by expression parsers that do not offer first class support for templating.

Since:
3.0
Author:
Keith Donald, Juergen Hoeller, Andy Clement

Constructor Summary
TemplateAwareExpressionParser()
Method Summary
protected abstract Expression | doParseExpression(String expressionString, ParserContext context) Actually parse the expression string and return an Expression object.
Expression | parseExpression(String expressionString) Parse the expression string and return an Expression object you can use for repeated evaluation.
Expression | parseExpression(String expressionString, ParserContext context) Parse the expression string and return an Expression object you can use for repeated evaluation.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TemplateAwareExpressionParser

public TemplateAwareExpressionParser()
Method Detail

parseExpression

public Expression parseExpression(String expressionString)
                           throws ParseException
Description copied from interface: ExpressionParser
Parse the expression string and return an Expression object you can use for repeated evaluation.

Some examples:

     3 + 4
     name.firstName

Specified by:
parseExpression in interface ExpressionParser
Parameters:
expressionString - the raw expression string to parse
Returns:
an evaluator for the parsed expression
Throws:
ParseException - an exception occurred during parsing

parseExpression

public Expression parseExpression(String expressionString,
                                  ParserContext context)
                           throws ParseException
Description copied from interface: ExpressionParser
Parse the expression string and return an Expression object you can use for repeated evaluation.

Some examples:

     3 + 4
     name.firstName

Specified by:
parseExpression in interface ExpressionParser
Parameters:
expressionString - the raw expression string to parse
context - a context for influencing this expression parsing routine (optional)
Returns:
an evaluator for the parsed expression
Throws:
ParseException - an exception occurred during parsing

doParseExpression

protected abstract Expression doParseExpression(String expressionString,
                                                ParserContext context)
                                         throws ParseException
Actually parse the expression string and return an Expression object.

Parameters:
expressionString - the raw expression string to parse
context - a context for influencing this expression parsing routine (optional)
Returns:
an evaluator for the parsed expression
Throws:
ParseException - an exception occurred during parsing
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TemplateParserContext

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.expression.common
Class TemplateParserContext

java.lang.Object
    extended by  org.springframework.expression.common.TemplateParserContext
All Implemented Interfaces:
ParserContext
public class TemplateParserContext
extends Object
implements ParserContext

Configurable ParserContext implementation for template parsing. Expects the expression prefix and suffix as constructor arguments.

Since:
3.0
Author:
Juergen Hoeller

Field Summary
Fields inherited from interface org.springframework.expression.ParserContext
TEMPLATE_EXPRESSION
Constructor Summary
TemplateParserContext()
Create a new TemplateParserContext with the default "#{" prefix and "}" suffix.
TemplateParserContext(String expressionPrefix, String expressionSuffix)
Create a new TemplateParserContext for the given prefix and suffix.
Method Summary
String | getExpressionPrefix() For template expressions, returns the prefix that identifies the start of an expression block within a string.
String | getExpressionSuffix() For template expressions, return the prefix that identifies the end of an expression block within a string.
boolean | isTemplate() Whether or not the expression being parsed is a template.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TemplateParserContext

public TemplateParserContext()
Create a new TemplateParserContext with the default "#{" prefix and "}" suffix.

TemplateParserContext

public TemplateParserContext(String expressionPrefix,
                             String expressionSuffix)
Create a new TemplateParserContext for the given prefix and suffix.

Parameters:
expressionPrefix - the expression prefix to use
expressionSuffix - the expression suffix to use
Method Detail

isTemplate

public final boolean isTemplate()
Description copied from interface: ParserContext
Whether or not the expression being parsed is a template. A template expression consists of literal text that can be mixed with evaluatable blocks. Some examples:
           Some literal text
     Hello #{name.firstName}!
     #{3 + 4}

Specified by:
isTemplate in interface ParserContext
Returns:
true if the expression is a template, false otherwise

getExpressionPrefix

public final String getExpressionPrefix()
Description copied from interface: ParserContext
For template expressions, returns the prefix that identifies the start of an expression block within a string. For example: "${"

Specified by:
getExpressionPrefix in interface ParserContext
Returns:
the prefix that identifies the start of an expression

getExpressionSuffix

public final String getExpressionSuffix()
Description copied from interface: ParserContext
For template expressions, return the prefix that identifies the end of an expression block within a string. For example: "}"

Specified by:
getExpressionSuffix in interface ParserContext
Returns:
the suffix that identifies the end of an expression
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.expression.spel

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.expression.spel

Interface Summary
SpelNode Represents a node in the Ast for a parsed expression.

Class Summary
ExpressionState | An ExpressionState is for maintaining per-expression-evaluation state, any changes to it are not seen by other expressions but it gives a place to hold local variables and for component expressions in a compound expression to communicate state.
SpelParserConfiguration | Configuration object for the SpEL expression parser.

Enum Summary
SpelMessage | Contains all the messages that can be produced by the Spring Expression Language.
SpelMessage.Kind |

Exception Summary
InternalParseException | Wraps a real parse exception.
SpelEvaluationException | Root exception for Spring EL related exceptions.
SpelParseException | Root exception for Spring EL related exceptions.


org.springframework.expression.spel Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.expression.spel

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.expression.spel.ExpressionState
    • org.springframework.expression.spel.SpelParserConfiguration
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.expression.ExpressionException
            • org.springframework.expression.EvaluationException
              • org.springframework.expression.spel.SpelEvaluationException
            • org.springframework.expression.ParseException
              • org.springframework.expression.spel.SpelParseException
          • org.springframework.expression.spel.InternalParseException

Interface Hierarchy

  • org.springframework.expression.spel.SpelNode

Enum Hierarchy

  • java.lang.Object
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)
      • org.springframework.expression.spel.SpelMessage
      • org.springframework.expression.spel.SpelMessage.Kind


SpelNode

org.springframework.expression.spel
Interface SpelNode

All Known Implementing Classes:
Assign, BooleanLiteral, CompoundExpression, ConstructorReference, Elvis, FunctionReference, Identifier, Indexer, IntLiteral, Literal, LongLiteral, MethodReference, NullLiteral, OpAnd, OpDivide, OpEQ, Operator, OperatorBetween, OperatorInstanceof, OperatorMatches, OperatorNot, OperatorPower, OpGE, OpGT, OpLE, OpLT, OpMinus, OpModulus, OpMultiply, OpNE, OpOr, OpPlus, Projection, PropertyOrFieldReference, QualifiedIdentifier, RealLiteral, Selection, SpelNodeImpl, StringLiteral, Ternary, TypeReference, VariableReference
public interface SpelNode

Represents a node in the Ast for a parsed expression.

Since:
3.0
Author:
Andy Clement

Method Summary
SpelNode | getChild(int index) Helper method that returns a SpelNode rather than an Antlr Tree node.
int | getChildCount()
int | getEndPosition()
Class<?> | getObjectClass(Object obj) Determine the class of the object passed in, unless it is already a class object.
int | getStartPosition()
TypedValue | getTypedValue(ExpressionState expressionState) Evaluate the expression node in the context of the supplied expression state and return the typed value.
Object | getValue(ExpressionState expressionState) Evaluate the expression node in the context of the supplied expression state and return the value.
boolean | isWritable(ExpressionState expressionState) Determine if this expression node will support a setValue() call.
void | setValue(ExpressionState expressionState, Object newValue) Evaluate the expression to a node and then set the new value on that node.
String | toStringAST()

Method Detail

getValue

Object getValue(ExpressionState expressionState)
                throws EvaluationException
Evaluate the expression node in the context of the supplied expression state and return the value.

Parameters:
expressionState - the current expression state (includes the context)
Returns:
the value of this node evaluated against the specified state
Throws:
EvaluationException

getTypedValue

TypedValue getTypedValue(ExpressionState expressionState)
                         throws EvaluationException
Evaluate the expression node in the context of the supplied expression state and return the typed value.

Parameters:
expressionState - the current expression state (includes the context)
Returns:
the type value of this node evaluated against the specified state
Throws:
EvaluationException

isWritable

boolean isWritable(ExpressionState expressionState)
                   throws EvaluationException
Determine if this expression node will support a setValue() call.

Parameters:
expressionState - the current expression state (includes the context)
Returns:
true if the expression node will allow setValue()
Throws:
EvaluationException - if something went wrong trying to determine if the node supports writing

setValue

void setValue(ExpressionState expressionState,
              Object newValue)
              throws EvaluationException
Evaluate the expression to a node and then set the new value on that node. For example, if the expression evaluates to a property reference then the property will be set to the new value.

Parameters:
expressionState - the current expression state (includes the context)
newValue - the new value
Throws:
EvaluationException - if any problem occurs evaluating the expression or setting the new value

toStringAST

String toStringAST()
Returns:
the string form of this AST node

getChildCount

int getChildCount()
Returns:
the number of children under this node

getChild

SpelNode getChild(int index)
Helper method that returns a SpelNode rather than an Antlr Tree node.

Returns:
the child node cast to a SpelNode

getObjectClass

Class<?> getObjectClass(Object obj)
Determine the class of the object passed in, unless it is already a class object.

Parameters:
o - the object that the caller wants the class of
Returns:
the class of the object if it is not already a class object, or null if the object is null

getStartPosition

int getStartPosition()
Returns:
the start position of this Ast node in the expression string

getEndPosition

int getEndPosition()
Returns:
the end position of this Ast node in the expression string
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ExpressionState

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.expression.spel
Class ExpressionState

java.lang.Object
    extended by  org.springframework.expression.spel.ExpressionState

public class ExpressionState
extends Object

An ExpressionState is for maintaining per-expression-evaluation state, any changes to it are not seen by other expressions but it gives a place to hold local variables and for component expressions in a compound expression to communicate state. This is in contrast to the EvaluationContext, which is shared amongst expression evaluations, and any changes to it will be seen by other expressions or any code that chooses to ask questions of the context.

It also acts as a place for to define common utility routines that the various Ast nodes might need.

Since:
3.0
Author:
Andy Clement

Constructor Summary
ExpressionState(EvaluationContext context)
ExpressionState(EvaluationContext context, SpelParserConfiguration configuration)
ExpressionState(EvaluationContext context, TypedValue rootObject)
ExpressionState(EvaluationContext context, TypedValue rootObject, SpelParserConfiguration configuration)
Method Summary
Object | convertValue(Object value, TypeDescriptor targetTypeDescriptor)
Object | convertValue(TypedValue value, TypeDescriptor targetTypeDescriptor)
void | enterScope(Map<String,Object> argMap)
void | enterScope(String name, Object value)
void | exitScope()
Class<?> | findType(String type)
TypedValue | getActiveContextObject() The active context object is what unqualified references to properties/etc are resolved against.
SpelParserConfiguration | getConfiguration()
EvaluationContext | getEvaluationContext()
List<PropertyAccessor> | getPropertyAccessors()
TypedValue | getRootContextObject()
TypeComparator | getTypeComparator()
Object | lookupLocalVariable(String name)
TypedValue | lookupVariable(String name)
TypedValue | operate(Operation op, Object left, Object right)
void | popActiveContextObject()
void | pushActiveContextObject(TypedValue obj)
void | setLocalVariable(String name, Object value)
void | setVariable(String name, Object value)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ExpressionState

public ExpressionState(EvaluationContext context)

ExpressionState

public ExpressionState(EvaluationContext context,
                       SpelParserConfiguration configuration)

ExpressionState

public ExpressionState(EvaluationContext context,
                       TypedValue rootObject)

ExpressionState

public ExpressionState(EvaluationContext context,
                       TypedValue rootObject,
                       SpelParserConfiguration configuration)
Method Detail

getActiveContextObject

public TypedValue getActiveContextObject()
The active context object is what unqualified references to properties/etc are resolved against.

pushActiveContextObject

public void pushActiveContextObject(TypedValue obj)

popActiveContextObject

public void popActiveContextObject()

getRootContextObject

public TypedValue getRootContextObject()

setVariable

public void setVariable(String name,
                        Object value)

lookupVariable

public TypedValue lookupVariable(String name)

getTypeComparator

public TypeComparator getTypeComparator()

findType

public Class<?> findType(String type)
                  throws EvaluationException
Throws:
EvaluationException

convertValue

public Object convertValue(Object value,
                           TypeDescriptor targetTypeDescriptor)
                    throws EvaluationException
Throws:
EvaluationException

convertValue

public Object convertValue(TypedValue value,
                           TypeDescriptor targetTypeDescriptor)
                    throws EvaluationException
Throws:
EvaluationException

enterScope

public void enterScope(Map<String,Object> argMap)

enterScope

public void enterScope(String name,
                       Object value)

exitScope

public void exitScope()

setLocalVariable

public void setLocalVariable(String name,
                             Object value)

lookupLocalVariable

public Object lookupLocalVariable(String name)

operate

public TypedValue operate(Operation op,
                          Object left,
                          Object right)
                   throws EvaluationException
Throws:
EvaluationException

getPropertyAccessors

public List<PropertyAccessor> getPropertyAccessors()

getEvaluationContext

public EvaluationContext getEvaluationContext()

getConfiguration

public SpelParserConfiguration getConfiguration()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


SpelParserConfiguration

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.expression.spel
Class SpelParserConfiguration

java.lang.Object
    extended by  org.springframework.expression.spel.SpelParserConfiguration

public class SpelParserConfiguration
extends Object

Configuration object for the SpEL expression parser.

Since:
3.0
Author:
Juergen Hoeller
See Also:
SpelExpressionParser.SpelExpressionParser(SpelParserConfiguration)

Constructor Summary
SpelParserConfiguration(boolean autoGrowNullReferences, boolean autoGrowCollections)
Method Summary
boolean | isAutoGrowCollections()
boolean | isAutoGrowNullReferences()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SpelParserConfiguration

public SpelParserConfiguration(boolean autoGrowNullReferences,
                               boolean autoGrowCollections)
Method Detail

isAutoGrowNullReferences

public boolean isAutoGrowNullReferences()

isAutoGrowCollections

public boolean isAutoGrowCollections()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


SpelMessage

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

org.springframework.expression.spel
Enum SpelMessage

java.lang.Object
    extended by  java.lang.Enum<SpelMessage>
        extended by  org.springframework.expression.spel.SpelMessage
All Implemented Interfaces:
Serializable, Comparable<SpelMessage>
public enum SpelMessage
extends Enum<SpelMessage>

Contains all the messages that can be produced by the Spring Expression Language. Each message has a kind (info, warn, error) and a code number. Tests can be written to expect particular code numbers rather than particular text, enabling the message text to more easily be modified and the tests to run successfully in different locales.

When a message is formatted, it will have this kind of form

 <code>
 EL1004E: (pos 34): Type cannot be found 'String'
The prefix captures the code and the error kind, whilst the position is included if it is known.

Since:
3.0
Author:
Andy Clement

Nested Class Summary
static class SpelMessage.Kind
Enum Constant Summary
ARGLIST_SHOULD_NOT_BE_EVALUATED
ARRAY_INDEX_OUT_OF_BOUNDS
BETWEEN_RIGHT_OPERAND_MUST_BE_TWO_ELEMENT_LIST
CANNOT_INDEX_INTO_NULL_VALUE
COLLECTION_INDEX_OUT_OF_BOUNDS
CONSTRUCTOR_INVOCATION_PROBLEM
CONSTRUCTOR_NOT_FOUND
EXCEPTION_DURING_FUNCTION_CALL
EXCEPTION_DURING_METHOD_INVOCATION
EXCEPTION_DURING_PROPERTY_READ
EXCEPTION_DURING_PROPERTY_WRITE
FUNCTION_MUST_BE_STATIC
FUNCTION_NOT_DEFINED
FUNCTION_REFERENCE_CANNOT_BE_INVOKED
INCORRECT_NUMBER_OF_ARGUMENTS_TO_FUNCTION
INDEXING_NOT_SUPPORTED_FOR_TYPE
INSTANCEOF_OPERATOR_NEEDS_CLASS_OPERAND
INVALID_FIRST_OPERAND_FOR_MATCHES_OPERATOR
INVALID_PATTERN
INVALID_SECOND_OPERAND_FOR_MATCHES_OPERATOR
INVALID_TYPE_FOR_SELECTION
METHOD_CALL_ON_NULL_OBJECT_NOT_ALLOWED
METHOD_NOT_FOUND
MISSING_CONSTRUCTOR_ARGS
MISSING_LEADING_ZERO_FOR_NUMBER
MORE_INPUT
MULTIPLE_POSSIBLE_METHODS
NON_TERMINATING_DOUBLE_QUOTED_STRING
NON_TERMINATING_QUOTED_STRING
NOT_A_LONG
NOT_A_REAL
NOT_AN_INTEGER
NOT_COMPARABLE
NOT_EXPECTED_TOKEN
OOD
OPERATOR_NOT_SUPPORTED_BETWEEN_TYPES
PROBLEM_LOCATING_METHOD
PROJECTION_NOT_SUPPORTED_ON_TYPE
PROPERTY_OR_FIELD_NOT_READABLE
PROPERTY_OR_FIELD_NOT_READABLE_ON_NULL
PROPERTY_OR_FIELD_NOT_WRITABLE
PROPERTY_OR_FIELD_NOT_WRITABLE_ON_NULL
REAL_CANNOT_BE_LONG
RESULT_OF_SELECTION_CRITERIA_IS_NOT_BOOLEAN
RIGHT_OPERAND_PROBLEM
RUN_OUT_OF_ARGUMENTS
SETVALUE_NOT_SUPPORTED
STRING_INDEX_OUT_OF_BOUNDS
TYPE_CONVERSION_ERROR
TYPE_NOT_FOUND
UNABLE_TO_CREATE_LIST_FOR_INDEXING
UNABLE_TO_CREATE_MAP_FOR_INDEXING
UNABLE_TO_DYNAMICALLY_CREATE_OBJECT
UNABLE_TO_GROW_COLLECTION
UNABLE_TO_GROW_COLLECTION_UNKNOWN_ELEMENT_TYPE
UNEXPECTED_DATA_AFTER_DOT
Method Summary
String | formatMessage(int pos, Object... inserts) Produce a complete message including the prefix, the position (if known) and with the inserts applied to the message.
static SpelMessage | valueOf(String name) Returns the enum constant of this type with the specified name.
static SpelMessage[] | values() Returns an array containing the constants of this enum type, in the order they are declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

TYPE_CONVERSION_ERROR

public static final SpelMessage TYPE_CONVERSION_ERROR

CONSTRUCTOR_NOT_FOUND

public static final SpelMessage CONSTRUCTOR_NOT_FOUND

CONSTRUCTOR_INVOCATION_PROBLEM

public static final SpelMessage CONSTRUCTOR_INVOCATION_PROBLEM

METHOD_NOT_FOUND

public static final SpelMessage METHOD_NOT_FOUND

TYPE_NOT_FOUND

public static final SpelMessage TYPE_NOT_FOUND

FUNCTION_NOT_DEFINED

public static final SpelMessage FUNCTION_NOT_DEFINED

PROPERTY_OR_FIELD_NOT_READABLE_ON_NULL

public static final SpelMessage PROPERTY_OR_FIELD_NOT_READABLE_ON_NULL

PROPERTY_OR_FIELD_NOT_READABLE

public static final SpelMessage PROPERTY_OR_FIELD_NOT_READABLE

PROPERTY_OR_FIELD_NOT_WRITABLE_ON_NULL

public static final SpelMessage PROPERTY_OR_FIELD_NOT_WRITABLE_ON_NULL

PROPERTY_OR_FIELD_NOT_WRITABLE

public static final SpelMessage PROPERTY_OR_FIELD_NOT_WRITABLE

METHOD_CALL_ON_NULL_OBJECT_NOT_ALLOWED

public static final SpelMessage METHOD_CALL_ON_NULL_OBJECT_NOT_ALLOWED

CANNOT_INDEX_INTO_NULL_VALUE

public static final SpelMessage CANNOT_INDEX_INTO_NULL_VALUE

NOT_COMPARABLE

public static final SpelMessage NOT_COMPARABLE

INCORRECT_NUMBER_OF_ARGUMENTS_TO_FUNCTION

public static final SpelMessage INCORRECT_NUMBER_OF_ARGUMENTS_TO_FUNCTION

INVALID_TYPE_FOR_SELECTION

public static final SpelMessage INVALID_TYPE_FOR_SELECTION

RESULT_OF_SELECTION_CRITERIA_IS_NOT_BOOLEAN

public static final SpelMessage RESULT_OF_SELECTION_CRITERIA_IS_NOT_BOOLEAN

BETWEEN_RIGHT_OPERAND_MUST_BE_TWO_ELEMENT_LIST

public static final SpelMessage BETWEEN_RIGHT_OPERAND_MUST_BE_TWO_ELEMENT_LIST

INVALID_PATTERN

public static final SpelMessage INVALID_PATTERN

PROJECTION_NOT_SUPPORTED_ON_TYPE

public static final SpelMessage PROJECTION_NOT_SUPPORTED_ON_TYPE

ARGLIST_SHOULD_NOT_BE_EVALUATED

public static final SpelMessage ARGLIST_SHOULD_NOT_BE_EVALUATED

EXCEPTION_DURING_PROPERTY_READ

public static final SpelMessage EXCEPTION_DURING_PROPERTY_READ

FUNCTION_REFERENCE_CANNOT_BE_INVOKED

public static final SpelMessage FUNCTION_REFERENCE_CANNOT_BE_INVOKED

EXCEPTION_DURING_FUNCTION_CALL

public static final SpelMessage EXCEPTION_DURING_FUNCTION_CALL

ARRAY_INDEX_OUT_OF_BOUNDS

public static final SpelMessage ARRAY_INDEX_OUT_OF_BOUNDS

COLLECTION_INDEX_OUT_OF_BOUNDS

public static final SpelMessage COLLECTION_INDEX_OUT_OF_BOUNDS

STRING_INDEX_OUT_OF_BOUNDS

public static final SpelMessage STRING_INDEX_OUT_OF_BOUNDS

INDEXING_NOT_SUPPORTED_FOR_TYPE

public static final SpelMessage INDEXING_NOT_SUPPORTED_FOR_TYPE

INSTANCEOF_OPERATOR_NEEDS_CLASS_OPERAND

public static final SpelMessage INSTANCEOF_OPERATOR_NEEDS_CLASS_OPERAND

EXCEPTION_DURING_METHOD_INVOCATION

public static final SpelMessage EXCEPTION_DURING_METHOD_INVOCATION

OPERATOR_NOT_SUPPORTED_BETWEEN_TYPES

public static final SpelMessage OPERATOR_NOT_SUPPORTED_BETWEEN_TYPES

PROBLEM_LOCATING_METHOD

public static final SpelMessage PROBLEM_LOCATING_METHOD

SETVALUE_NOT_SUPPORTED

public static final SpelMessage SETVALUE_NOT_SUPPORTED

MULTIPLE_POSSIBLE_METHODS

public static final SpelMessage MULTIPLE_POSSIBLE_METHODS

EXCEPTION_DURING_PROPERTY_WRITE

public static final SpelMessage EXCEPTION_DURING_PROPERTY_WRITE

NOT_AN_INTEGER

public static final SpelMessage NOT_AN_INTEGER

NOT_A_LONG

public static final SpelMessage NOT_A_LONG

INVALID_FIRST_OPERAND_FOR_MATCHES_OPERATOR

public static final SpelMessage INVALID_FIRST_OPERAND_FOR_MATCHES_OPERATOR

INVALID_SECOND_OPERAND_FOR_MATCHES_OPERATOR

public static final SpelMessage INVALID_SECOND_OPERAND_FOR_MATCHES_OPERATOR

FUNCTION_MUST_BE_STATIC

public static final SpelMessage FUNCTION_MUST_BE_STATIC

NOT_A_REAL

public static final SpelMessage NOT_A_REAL

MORE_INPUT

public static final SpelMessage MORE_INPUT

RIGHT_OPERAND_PROBLEM

public static final SpelMessage RIGHT_OPERAND_PROBLEM

NOT_EXPECTED_TOKEN

public static final SpelMessage NOT_EXPECTED_TOKEN

OOD

public static final SpelMessage OOD

NON_TERMINATING_DOUBLE_QUOTED_STRING

public static final SpelMessage NON_TERMINATING_DOUBLE_QUOTED_STRING

NON_TERMINATING_QUOTED_STRING

public static final SpelMessage NON_TERMINATING_QUOTED_STRING

MISSING_LEADING_ZERO_FOR_NUMBER

public static final SpelMessage MISSING_LEADING_ZERO_FOR_NUMBER

REAL_CANNOT_BE_LONG

public static final SpelMessage REAL_CANNOT_BE_LONG

UNEXPECTED_DATA_AFTER_DOT

public static final SpelMessage UNEXPECTED_DATA_AFTER_DOT

MISSING_CONSTRUCTOR_ARGS

public static final SpelMessage MISSING_CONSTRUCTOR_ARGS

RUN_OUT_OF_ARGUMENTS

public static final SpelMessage RUN_OUT_OF_ARGUMENTS

UNABLE_TO_GROW_COLLECTION

public static final SpelMessage UNABLE_TO_GROW_COLLECTION

UNABLE_TO_GROW_COLLECTION_UNKNOWN_ELEMENT_TYPE

public static final SpelMessage UNABLE_TO_GROW_COLLECTION_UNKNOWN_ELEMENT_TYPE

UNABLE_TO_CREATE_LIST_FOR_INDEXING

public static final SpelMessage UNABLE_TO_CREATE_LIST_FOR_INDEXING

UNABLE_TO_CREATE_MAP_FOR_INDEXING

public static final SpelMessage UNABLE_TO_CREATE_MAP_FOR_INDEXING

UNABLE_TO_DYNAMICALLY_CREATE_OBJECT

public static final SpelMessage UNABLE_TO_DYNAMICALLY_CREATE_OBJECT
Method Detail

values

public static SpelMessage[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (SpelMessage c : SpelMessage.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static SpelMessage valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

formatMessage

public String formatMessage(int pos,
                            Object... inserts)
Produce a complete message including the prefix, the position (if known) and with the inserts applied to the message.

Parameters:
pos - the position, if less than zero it is ignored and not included in the message
inserts - the inserts to put into the formatted message
Returns:
a formatted message
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


SpelMessage.Kind

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

org.springframework.expression.spel
Enum SpelMessage.Kind

java.lang.Object
    extended by  java.lang.Enum<SpelMessage.Kind>
        extended by  org.springframework.expression.spel.SpelMessage.Kind
All Implemented Interfaces:
Serializable, Comparable<SpelMessage.Kind>
Enclosing class:
SpelMessage
public static enum SpelMessage.Kind
extends Enum<SpelMessage.Kind>

Enum Constant Summary
ERROR
INFO
WARNING
Method Summary
static SpelMessage.Kind | valueOf(String name) Returns the enum constant of this type with the specified name.
static SpelMessage.Kind[] | values() Returns an array containing the constants of this enum type, in the order they are declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

INFO

public static final SpelMessage.Kind INFO

WARNING

public static final SpelMessage.Kind WARNING

ERROR

public static final SpelMessage.Kind ERROR
Method Detail

values

public static SpelMessage.Kind[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (SpelMessage.Kind c : SpelMessage.Kind.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static SpelMessage.Kind valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


InternalParseException

org.springframework.expression.spel
Class InternalParseException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.expression.spel.InternalParseException
All Implemented Interfaces:
Serializable
public class InternalParseException
extends RuntimeException

Wraps a real parse exception. This exception flows to the top parse method and then the wrapped exception is thrown as the real problem.

Since:
3.0
Author:
Andy Clement
See Also:
Serialized Form

Constructor Summary
InternalParseException(SpelParseException cause)
Method Summary
 SpelParseException getCause()
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

InternalParseException

public InternalParseException(SpelParseException cause)
Method Detail

getCause

public SpelParseException getCause()
Overrides:
getCause in class Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SpelEvaluationException

org.springframework.expression.spel
Class SpelEvaluationException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.expression.ExpressionException
                    extended by  org.springframework.expression.EvaluationException
                        extended by  org.springframework.expression.spel.SpelEvaluationException
All Implemented Interfaces:
Serializable
public class SpelEvaluationException
extends EvaluationException

Root exception for Spring EL related exceptions. Rather than holding a hard coded string indicating the problem, it records a message key and the inserts for the message. See SpelMessage for the list of all possible messages that can occur.

Since:
3.0
Author:
Andy Clement
See Also:
Serialized Form

Field Summary
Fields inherited from class org.springframework.expression.ExpressionException
expressionString, position
Constructor Summary
SpelEvaluationException(int position, SpelMessage message, Object... inserts)
SpelEvaluationException(int position, Throwable cause, SpelMessage message, Object... inserts)
SpelEvaluationException(SpelMessage message, Object... inserts)
SpelEvaluationException(Throwable cause, SpelMessage message, Object... inserts)
Method Summary
Object[] | getInserts()
String | getMessage()
SpelMessage | getMessageCode()
void | setPosition(int position) Set the position in the related expression which gave rise to this exception.
Methods inherited from class org.springframework.expression.ExpressionException
getExpressionString, getPosition, toDetailedString
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

SpelEvaluationException

public SpelEvaluationException(SpelMessage message,
                               Object... inserts)

SpelEvaluationException

public SpelEvaluationException(int position,
                               SpelMessage message,
                               Object... inserts)

SpelEvaluationException

public SpelEvaluationException(int position,
                               Throwable cause,
                               SpelMessage message,
                               Object... inserts)

SpelEvaluationException

public SpelEvaluationException(Throwable cause,
                               SpelMessage message,
                               Object... inserts)
Method Detail

getMessage

public String getMessage()
Overrides:
getMessage in class Throwable
Returns:
a formatted message with inserts applied

getMessageCode

public SpelMessage getMessageCode()
Returns:
the message code

setPosition

public void setPosition(int position)
Set the position in the related expression which gave rise to this exception.

Parameters:
position - the position in the expression that gave rise to the exception

getInserts

public Object[] getInserts()
Returns:
the message inserts
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SpelParseException

org.springframework.expression.spel
Class SpelParseException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.expression.ExpressionException
                    extended by  org.springframework.expression.ParseException
                        extended by  org.springframework.expression.spel.SpelParseException
All Implemented Interfaces:
Serializable
public class SpelParseException
extends ParseException

Root exception for Spring EL related exceptions. Rather than holding a hard coded string indicating the problem, it records a message key and the inserts for the message. See SpelMessage for the list of all possible messages that can occur.

Since:
3.0
Author:
Andy Clement
See Also:
Serialized Form

Field Summary
Fields inherited from class org.springframework.expression.ExpressionException
expressionString, position
Constructor Summary
SpelParseException(int position, SpelMessage message, Object... inserts)
SpelParseException(int position, Throwable cause, SpelMessage message, Object... inserts)
SpelParseException(String expressionString, int position, SpelMessage message, Object... inserts)
Method Summary
Object[] | getInserts()
String | getMessage()
SpelMessage | getMessageCode()
Methods inherited from class org.springframework.expression.ExpressionException
getExpressionString, getPosition, toDetailedString
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

SpelParseException

public SpelParseException(String expressionString,
                          int position,
                          SpelMessage message,
                          Object... inserts)

SpelParseException

public SpelParseException(int position,
                          SpelMessage message,
                          Object... inserts)

SpelParseException

public SpelParseException(int position,
                          Throwable cause,
                          SpelMessage message,
                          Object... inserts)
Method Detail

getMessage

public String getMessage()
Overrides:
getMessage in class Throwable
Returns:
a formatted message with inserts applied

getMessageCode

public SpelMessage getMessageCode()
Returns:
the message code

getInserts

public Object[] getInserts()
Returns:
the message inserts
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.expression.spel.ast

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.expression.spel.ast

Class Summary
Assign | Represents assignment.
AstUtils | Utilities methods for use in the Ast classes.
BooleanLiteral | Represents the literal values TRUE and FALSE.
CompoundExpression | Represents a DOT separated expression sequence, such as 'property1.property2.methodOne()'
ConstructorReference | Represents the invocation of a constructor.
Elvis | Represents the elvis operator ?:.
FormatHelper | Utility methods (formatters, etc) used during parsing and evaluation.
FunctionReference | A function reference is of the form "#someFunction(a,b,c)".
Identifier |
Indexer | An Indexer can index into some proceeding structure to access a particular piece of it.
IntLiteral | Expression language AST node that represents an integer literal.
Literal | Common superclass for nodes representing literals (boolean, string, number, etc).
LongLiteral | Expression language AST node that represents a long integer literal.
MethodReference |
NullLiteral |
OpAnd | Represents the boolean AND operation.
OpDivide | Implements division operator.
OpEQ | Implements equality operator.
Operator | Common supertype for operators that operate on either one or two operands.
OperatorBetween | Represents the between operator.
OperatorInstanceof | The operator 'instanceof' checks if an object is of the class specified in the right hand operand, in the same way that instanceof does in Java.
OperatorMatches | Implements the matches operator.
OperatorNot | Represents a NOT operation.
OperatorPower | The power operator.
OpGE | Implements greater-than-or-equal operator.
OpGT | Implements greater-than operator.
OpLE | Implements the less-than-or-equal operator.
OpLT | Implements the less-than operator.
OpMinus | The minus operator supports: subtraction of doubles (floats are represented as doubles) subtraction of longs subtraction of integers subtraction of an int from a string of one character (effectively decreasing that character), so 'd'-3='a' It can be used as a unary operator for numbers (double/long/int).
OpModulus | Implements the modulus operator.
OpMultiply | Implements the multiply operator.
OpNE | Implements the not-equal operator.
OpOr | Represents the boolean OR operation.
OpPlus | The plus operator will: add doubles (floats are represented as doubles) add longs add integers concatenate strings It can be used as a unary operator for numbers (double/long/int).
Projection | Represents projection, where a given operation is performed on all elements in some input sequence, returning a new sequence of the same size.
PropertyOrFieldReference | Represents a simple property or field reference.
QualifiedIdentifier | Represents a dot separated sequence of strings that indicate a package qualified type reference.
RealLiteral |
Selection | Represents selection over a map or collection.
SpelNodeImpl | The common supertype of all AST nodes in a parsed Spring Expression Language format expression.
StringLiteral |
Ternary | Represents a ternary expression, for example: "someCheck()?true:false".
TypeReference | Represents a reference to a type, for example "T(String)" or "T(com.somewhere.Foo)"
VariableReference | Represents a variable reference, eg.

Enum Summary
TypeCode


org.springframework.expression.spel.ast Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.expression.spel.ast

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.expression.spel.ast.AstUtils
    • org.springframework.expression.spel.ast.FormatHelper
    • org.springframework.expression.spel.ast.SpelNodeImpl (implements org.springframework.expression.spel.SpelNode)
      • org.springframework.expression.spel.ast.Assign
      • org.springframework.expression.spel.ast.CompoundExpression
      • org.springframework.expression.spel.ast.ConstructorReference
      • org.springframework.expression.spel.ast.Elvis
      • org.springframework.expression.spel.ast.FunctionReference
      • org.springframework.expression.spel.ast.Identifier
      • org.springframework.expression.spel.ast.Indexer
      • org.springframework.expression.spel.ast.Literal
        • org.springframework.expression.spel.ast.BooleanLiteral
        • org.springframework.expression.spel.ast.IntLiteral
        • org.springframework.expression.spel.ast.LongLiteral
        • org.springframework.expression.spel.ast.NullLiteral
        • org.springframework.expression.spel.ast.RealLiteral
        • org.springframework.expression.spel.ast.StringLiteral
      • org.springframework.expression.spel.ast.MethodReference
      • org.springframework.expression.spel.ast.Operator
        • org.springframework.expression.spel.ast.OpAnd
        • org.springframework.expression.spel.ast.OpDivide
        • org.springframework.expression.spel.ast.OpEQ
        • org.springframework.expression.spel.ast.OperatorBetween
        • org.springframework.expression.spel.ast.OperatorInstanceof
        • org.springframework.expression.spel.ast.OperatorMatches
        • org.springframework.expression.spel.ast.OperatorPower
        • org.springframework.expression.spel.ast.OpGE
        • org.springframework.expression.spel.ast.OpGT
        • org.springframework.expression.spel.ast.OpLE
        • org.springframework.expression.spel.ast.OpLT
        • org.springframework.expression.spel.ast.OpMinus
        • org.springframework.expression.spel.ast.OpModulus
        • org.springframework.expression.spel.ast.OpMultiply
        • org.springframework.expression.spel.ast.OpNE
        • org.springframework.expression.spel.ast.OpOr
        • org.springframework.expression.spel.ast.OpPlus
      • org.springframework.expression.spel.ast.OperatorNot
      • org.springframework.expression.spel.ast.Projection
      • org.springframework.expression.spel.ast.PropertyOrFieldReference
      • org.springframework.expression.spel.ast.QualifiedIdentifier
      • org.springframework.expression.spel.ast.Selection
      • org.springframework.expression.spel.ast.Ternary
      • org.springframework.expression.spel.ast.TypeReference
      • org.springframework.expression.spel.ast.VariableReference

Enum Hierarchy

  • java.lang.Object
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)
      • org.springframework.expression.spel.ast.TypeCode


Assign

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.expression.spel.ast
Class Assign

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Assign
All Implemented Interfaces:
SpelNode
public class Assign
extends SpelNodeImpl

Represents assignment. An alternative to calling setValue() for an expression is to use an assign.

Example: 'someNumberProperty=42'

Since:
3.0
Author:
Andy Clement

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
Assign(int pos, SpelNodeImpl... operands)
Method Summary
TypedValue | getValueInternal(ExpressionState state)
String | toStringAST()
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Assign

public Assign(int pos,
              SpelNodeImpl... operands)
Method Detail

getValueInternal

public TypedValue getValueInternal(ExpressionState state)
                            throws EvaluationException
Specified by:
getValueInternal in class SpelNodeImpl
Throws:
EvaluationException

toStringAST

public String toStringAST()
Specified by:
toStringAST in interface SpelNode
Specified by:
toStringAST in class SpelNodeImpl
Returns:
the string form of this AST node
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AstUtils

org.springframework.expression.spel.ast
Class AstUtils

java.lang.Object
    extended by  org.springframework.expression.spel.ast.AstUtils

public class AstUtils
extends Object

Utilities methods for use in the Ast classes.

Since:
3.0.2
Author:
Andy Clement

Constructor Summary
AstUtils()
Method Summary
static List<PropertyAccessor> getPropertyAccessorsToTry(Class<?> targetType, ExpressionState state)
Determines the set of property resolvers that should be used to try and access a property on the specified target type.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AstUtils

public AstUtils()
Method Detail

getPropertyAccessorsToTry

public static List<PropertyAccessor> getPropertyAccessorsToTry(Class<?> targetType,
                                                               ExpressionState state)
Determines the set of property resolvers that should be used to try and access a property on the specified target type. The resolvers are considered to be in an ordered list, however in the returned list any that are exact matches for the input target type (as opposed to 'general' resolvers that could work for any type) are placed at the start of the list. In addition, there are specific resolvers that exactly name the class in question and resolvers that name a specific class but it is a supertype of the class we have. These are put at the end of the specific resolvers set and will be tried after exactly matching accessors but before generic accessors.

Parameters:
targetType - the type upon which property access is being attempted
Returns:
a list of resolvers that should be tried in order to access the property
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BooleanLiteral

org.springframework.expression.spel.ast
Class BooleanLiteral

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Literal
            extended by  org.springframework.expression.spel.ast.BooleanLiteral
All Implemented Interfaces:
SpelNode
public class BooleanLiteral
extends Literal

Represents the literal values TRUE and FALSE.

Since:
3.0
Author:
Andy Clement

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.Literal
literalValue
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
BooleanLiteral(String payload, int pos, boolean value)
Method Summary
 BooleanTypedValue getLiteralValue()
Methods inherited from class org.springframework.expression.spel.ast.Literal
getIntLiteral, getLongLiteral, getRealLiteral, getValueInternal, toString, toStringAST
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

BooleanLiteral

public BooleanLiteral(String payload,
                      int pos,
                      boolean value)
Method Detail

getLiteralValue

public BooleanTypedValue getLiteralValue()
Specified by:
getLiteralValue in class Literal
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CompoundExpression

org.springframework.expression.spel.ast
Class CompoundExpression

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.CompoundExpression
All Implemented Interfaces:
SpelNode
public class CompoundExpression
extends SpelNodeImpl

Represents a DOT separated expression sequence, such as 'property1.property2.methodOne()'

Since:
3.0
Author:
Andy Clement

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
CompoundExpression(int pos, SpelNodeImpl... expressionComponents)
Method Summary
TypedValue | getValueInternal(ExpressionState state) Evalutes a compound expression.
boolean | isWritable(ExpressionState state) Determine if this expression node will support a setValue() call.
void | setValue(ExpressionState state, Object value) Evaluate the expression to a node and then set the new value on that node.
String | toStringAST()
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, nextChildIs
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CompoundExpression

public CompoundExpression(int pos,
                          SpelNodeImpl... expressionComponents)
Method Detail

getValueInternal

public TypedValue getValueInternal(ExpressionState state)
                            throws EvaluationException
Evalutes a compound expression. This involves evaluating each piece in turn and the return value from each piece is the active context object for the subsequent piece.

Specified by:
getValueInternal in class SpelNodeImpl
Parameters:
state - the state in which the expression is being evaluated
Returns:
the final value from the last piece of the compound expression
Throws:
EvaluationException

setValue

public void setValue(ExpressionState state,
                     Object value)
              throws EvaluationException
Description copied from interface: SpelNode
Evaluate the expression to a node and then set the new value on that node. For example, if the expression evaluates to a property reference then the property will be set to the new value.

Specified by:
setValue in interface SpelNode
Overrides:
setValue in class SpelNodeImpl
Parameters:
state - the current expression state (includes the context)
value - the new value
Throws:
EvaluationException - if any problem occurs evaluating the expression or setting the new value

isWritable

public boolean isWritable(ExpressionState state)
                   throws EvaluationException
Description copied from interface: SpelNode
Determine if this expression node will support a setValue() call.

Specified by:
isWritable in interface SpelNode
Overrides:
isWritable in class SpelNodeImpl
Parameters:
state - the current expression state (includes the context)
Returns:
true if the expression node will allow setValue()
Throws:
EvaluationException - if something went wrong trying to determine if the node supports writing

toStringAST

public String toStringAST()
Specified by:
toStringAST in interface SpelNode
Specified by:
toStringAST in class SpelNodeImpl
Returns:
the string form of this AST node
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConstructorReference

org.springframework.expression.spel.ast
Class ConstructorReference

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.ConstructorReference
All Implemented Interfaces:
SpelNode
public class ConstructorReference
extends SpelNodeImpl

Represents the invocation of a constructor. Either a constructor on a regular type or construction of an array. When an array is constructed, an initializer can be specified.

Examples:
new String('hello world')
new int[]{1,2,3,4}
new int[3] new int[3]{1,2,3}

Since:
3.0
Author:
Andy Clement, Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
ConstructorReference(int pos, SpelNodeImpl... arguments)
Create a constructor reference.
Method Summary
TypedValue | getValueInternal(ExpressionState state) Implements getValue() - delegating to the code for building an array or a simple type.
String | toStringAST()
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ConstructorReference

public ConstructorReference(int pos,
                            SpelNodeImpl... arguments)
Create a constructor reference. The first argument is the type, the rest are the parameters to the constructor call

Method Detail

getValueInternal

public TypedValue getValueInternal(ExpressionState state)
                            throws EvaluationException
Implements getValue() - delegating to the code for building an array or a simple type.

Specified by:
getValueInternal in class SpelNodeImpl
Throws:
EvaluationException

toStringAST

public String toStringAST()
Specified by:
toStringAST in interface SpelNode
Specified by:
toStringAST in class SpelNodeImpl
Returns:
the string form of this AST node
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Elvis

org.springframework.expression.spel.ast
Class Elvis

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Elvis
All Implemented Interfaces:
SpelNode
public class Elvis
extends SpelNodeImpl

Represents the elvis operator ?:. For an expression "a?:b" if a is not null, the value of the expression is "a", if a is null then the value of the expression is "b".

Since:
3.0
Author:
Andy Clement

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
Elvis(int pos, SpelNodeImpl... args)
Method Summary
TypedValue | getValueInternal(ExpressionState state) Evaluate the condition and if not null, return it.
String | toStringAST()
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Elvis

public Elvis(int pos,
             SpelNodeImpl... args)
Method Detail

getValueInternal

public TypedValue getValueInternal(ExpressionState state)
                            throws EvaluationException
Evaluate the condition and if not null, return it. If it is null return the other value.

Specified by:
getValueInternal in class SpelNodeImpl
Parameters:
state - the expression state
Throws:
EvaluationException - if the condition does not evaluate correctly to a boolean or there is a problem executing the chosen alternative

toStringAST

public String toStringAST()
Specified by:
toStringAST in interface SpelNode
Specified by:
toStringAST in class SpelNodeImpl
Returns:
the string form of this AST node
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FormatHelper

org.springframework.expression.spel.ast
Class FormatHelper

java.lang.Object
    extended by  org.springframework.expression.spel.ast.FormatHelper

public class FormatHelper
extends Object

Utility methods (formatters, etc) used during parsing and evaluation.

Author:
Andy Clement

Constructor Summary
FormatHelper()
Method Summary
static String | formatClassNameForMessage(Class<?> clazz) Produce a nice string for a given class object.
static String | formatMethodForMessage(String name, Class<?>... argumentTypes) Produce a nice string for a given method name with specified arguments.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

FormatHelper

public FormatHelper()
Method Detail

formatMethodForMessage

public static String formatMethodForMessage(String name,
                                            Class<?>... argumentTypes)
Produce a nice string for a given method name with specified arguments.

Parameters:
name - the name of the method
argumentTypes - the types of the arguments to the method
Returns:
nicely formatted string, eg. foo(String,int)

formatClassNameForMessage

public static String formatClassNameForMessage(Class<?> clazz)
Produce a nice string for a given class object. For example a string array will have the formatted name "java.lang.String[]".

Parameters:
clazz - The class whose name is to be formatted
Returns:
a formatted string suitable for message inclusion
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FunctionReference

org.springframework.expression.spel.ast
Class FunctionReference

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.FunctionReference
All Implemented Interfaces:
SpelNode
public class FunctionReference
extends SpelNodeImpl

A function reference is of the form "#someFunction(a,b,c)". Functions may be defined in the context prior to the expression being evaluated or within the expression itself using a lambda function definition. For example: Lambda function definition in an expression: "(#max = {|x,y|$x>$y?$x:$y};max(2,3))" Calling context defined function: "#isEven(37)". Functions may also be static java methods, registered in the context prior to invocation of the expression. Functions are very simplistic, the arguments are not part of the definition (right now), so the names must be unique.

Since:
3.0
Author:
Andy Clement

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
FunctionReference(String functionName, int pos, SpelNodeImpl... arguments)
Method Summary
TypedValue | getValueInternal(ExpressionState state)
String | toStringAST()
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

FunctionReference

public FunctionReference(String functionName,
                         int pos,
                         SpelNodeImpl... arguments)
Method Detail

getValueInternal

public TypedValue getValueInternal(ExpressionState state)
                            throws EvaluationException
Specified by:
getValueInternal in class SpelNodeImpl
Throws:
EvaluationException

toStringAST

public String toStringAST()
Specified by:
toStringAST in interface SpelNode
Specified by:
toStringAST in class SpelNodeImpl
Returns:
the string form of this AST node
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Identifier

org.springframework.expression.spel.ast
Class Identifier

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Identifier
All Implemented Interfaces:
SpelNode
public class Identifier
extends SpelNodeImpl

Since:
3.0
Author:
Andy Clement

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
Identifier(String payload, int pos)
Method Summary
TypedValue | getValueInternal(ExpressionState state)
String | toStringAST()
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Identifier

public Identifier(String payload,
                  int pos)
Method Detail

toStringAST

public String toStringAST()
Specified by:
toStringAST in interface SpelNode
Specified by:
toStringAST in class SpelNodeImpl
Returns:
the string form of this AST node

getValueInternal

public TypedValue getValueInternal(ExpressionState state)
Specified by:
getValueInternal in class SpelNodeImpl
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Indexer

org.springframework.expression.spel.ast
Class Indexer

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Indexer
All Implemented Interfaces:
SpelNode
public class Indexer
extends SpelNodeImpl

An Indexer can index into some proceeding structure to access a particular piece of it. Supported structures are: strings/collections (lists/sets)/arrays

Since:
3.0
Author:
Andy Clement

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
Indexer(int pos, SpelNodeImpl expr)
Method Summary
TypedValue | getValueInternal(ExpressionState state)
boolean | isWritable(ExpressionState expressionState) Determine if this expression node will support a setValue() call.
void | setValue(ExpressionState state, Object newValue) Evaluate the expression to a node and then set the new value on that node.
String | toStringAST()
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, nextChildIs
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Indexer

public Indexer(int pos,
               SpelNodeImpl expr)
Method Detail

getValueInternal

public TypedValue getValueInternal(ExpressionState state)
                            throws EvaluationException
Specified by:
getValueInternal in class SpelNodeImpl
Throws:
EvaluationException

isWritable

public boolean isWritable(ExpressionState expressionState)
                   throws SpelEvaluationException
Description copied from interface: SpelNode
Determine if this expression node will support a setValue() call.

Specified by:
isWritable in interface SpelNode
Overrides:
isWritable in class SpelNodeImpl
Parameters:
expressionState - the current expression state (includes the context)
Returns:
true if the expression node will allow setValue()
Throws:
SpelEvaluationException

setValue

public void setValue(ExpressionState state,
                     Object newValue)
              throws EvaluationException
Description copied from interface: SpelNode
Evaluate the expression to a node and then set the new value on that node. For example, if the expression evaluates to a property reference then the property will be set to the new value.

Specified by:
setValue in interface SpelNode
Overrides:
setValue in class SpelNodeImpl
Parameters:
state - the current expression state (includes the context)
newValue - the new value
Throws:
EvaluationException - if any problem occurs evaluating the expression or setting the new value

toStringAST

public String toStringAST()
Specified by:
toStringAST in interface SpelNode
Specified by:
toStringAST in class SpelNodeImpl
Returns:
the string form of this AST node
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


IntLiteral

org.springframework.expression.spel.ast
Class IntLiteral

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Literal
            extended by  org.springframework.expression.spel.ast.IntLiteral
All Implemented Interfaces:
SpelNode
public class IntLiteral
extends Literal

Expression language AST node that represents an integer literal.

Since:
3.0
Author:
Andy Clement

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.Literal
literalValue
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Method Summary
 TypedValue getLiteralValue()
Methods inherited from class org.springframework.expression.spel.ast.Literal
getIntLiteral, getLongLiteral, getRealLiteral, getValueInternal, toString, toStringAST
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Method Detail

getLiteralValue

public TypedValue getLiteralValue()
Specified by:
getLiteralValue in class Literal
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Literal

org.springframework.expression.spel.ast
Class Literal

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Literal
All Implemented Interfaces:
SpelNode
Direct Known Subclasses:
BooleanLiteral, IntLiteral, LongLiteral, NullLiteral, RealLiteral, StringLiteral
public abstract class Literal
extends SpelNodeImpl

Common superclass for nodes representing literals (boolean, string, number, etc).

Author:
Andy Clement

Field Summary
protected  String literalValue
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
Literal(String payload, int pos)
Method Summary
static Literal | getIntLiteral(String numberToken, int pos, int radix) Process the string form of a number, using the specified base if supplied and return an appropriate literal to hold it.
abstract TypedValue | getLiteralValue()
static Literal | getLongLiteral(String numberToken, int pos, int radix)
static Literal | getRealLiteral(String numberToken, int pos, boolean isFloat)
TypedValue | getValueInternal(ExpressionState state)
String | toString()
String | toStringAST()
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

literalValue

protected String literalValue
Constructor Detail

Literal

public Literal(String payload,
               int pos)
Method Detail

getLiteralValue

public abstract TypedValue getLiteralValue()

getValueInternal

public final TypedValue getValueInternal(ExpressionState state)
                                  throws SpelEvaluationException
Specified by:
getValueInternal in class SpelNodeImpl
Throws:
SpelEvaluationException

toString

public String toString()
Overrides:
toString in class Object

toStringAST

public String toStringAST()
Specified by:
toStringAST in interface SpelNode
Specified by:
toStringAST in class SpelNodeImpl
Returns:
the string form of this AST node

getIntLiteral

public static Literal getIntLiteral(String numberToken,
                                    int pos,
                                    int radix)
Process the string form of a number, using the specified base if supplied and return an appropriate literal to hold it. Any suffix to indicate a long will be taken into account (either 'l' or 'L' is supported).

Parameters:
numberToken - the token holding the number as its payload (eg. 1234 or 0xCAFE)
radix - the base of number
Returns:
a subtype of Literal that can represent it

getLongLiteral

public static Literal getLongLiteral(String numberToken,
                                     int pos,
                                     int radix)

getRealLiteral

public static Literal getRealLiteral(String numberToken,
                                     int pos,
                                     boolean isFloat)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LongLiteral

org.springframework.expression.spel.ast
Class LongLiteral

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Literal
            extended by  org.springframework.expression.spel.ast.LongLiteral
All Implemented Interfaces:
SpelNode
public class LongLiteral
extends Literal

Expression language AST node that represents a long integer literal.

Since:
3.0
Author:
Andy Clement

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.Literal
literalValue
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Method Summary
 TypedValue getLiteralValue()
Methods inherited from class org.springframework.expression.spel.ast.Literal
getIntLiteral, getLongLiteral, getRealLiteral, getValueInternal, toString, toStringAST
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Method Detail

getLiteralValue

public TypedValue getLiteralValue()
Specified by:
getLiteralValue in class Literal
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MethodReference

org.springframework.expression.spel.ast
Class MethodReference

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.MethodReference
All Implemented Interfaces:
SpelNode
public class MethodReference
extends SpelNodeImpl

Since:
3.0
Author:
Andy Clement, Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
MethodReference(boolean nullSafe, String methodName, int pos, SpelNodeImpl... arguments)
Method Summary
TypedValue | getValueInternal(ExpressionState state)
String | toStringAST()
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MethodReference

public MethodReference(boolean nullSafe,
                       String methodName,
                       int pos,
                       SpelNodeImpl... arguments)
Method Detail

getValueInternal

public TypedValue getValueInternal(ExpressionState state)
                            throws EvaluationException
Specified by:
getValueInternal in class SpelNodeImpl
Throws:
EvaluationException

toStringAST

public String toStringAST()
Specified by:
toStringAST in interface SpelNode
Specified by:
toStringAST in class SpelNodeImpl
Returns:
the string form of this AST node
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NullLiteral

org.springframework.expression.spel.ast
Class NullLiteral

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Literal
            extended by  org.springframework.expression.spel.ast.NullLiteral
All Implemented Interfaces:
SpelNode
public class NullLiteral
extends Literal

Since:
3.0
Author:
Andy Clement

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.Literal
literalValue
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
NullLiteral(int pos)
Method Summary
TypedValue | getLiteralValue()
String | toString()
Methods inherited from class org.springframework.expression.spel.ast.Literal
getIntLiteral, getLongLiteral, getRealLiteral, getValueInternal, toStringAST
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

NullLiteral

public NullLiteral(int pos)
Method Detail

getLiteralValue

public TypedValue getLiteralValue()
Specified by:
getLiteralValue in class Literal

toString

public String toString()
Overrides:
toString in class Literal
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OpAnd

org.springframework.expression.spel.ast
Class OpAnd

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Operator
            extended by  org.springframework.expression.spel.ast.OpAnd
All Implemented Interfaces:
SpelNode
public class OpAnd
extends Operator

Represents the boolean AND operation.

Since:
3.0
Author:
Andy Clement, Mark Fisher

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
OpAnd(int pos, SpelNodeImpl... operands)
Method Summary
 TypedValue getValueInternal(ExpressionState state)
Methods inherited from class org.springframework.expression.spel.ast.Operator
getLeftOperand, getOperatorName, getRightOperand, toStringAST
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OpAnd

public OpAnd(int pos,
             SpelNodeImpl... operands)
Method Detail

getValueInternal

public TypedValue getValueInternal(ExpressionState state)
                            throws EvaluationException
Specified by:
getValueInternal in class SpelNodeImpl
Throws:
EvaluationException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OpDivide

org.springframework.expression.spel.ast
Class OpDivide

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Operator
            extended by  org.springframework.expression.spel.ast.OpDivide
All Implemented Interfaces:
SpelNode
public class OpDivide
extends Operator

Implements division operator.

Since:
3.0
Author:
Andy Clement

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
OpDivide(int pos, SpelNodeImpl... operands)
Method Summary
 TypedValue getValueInternal(ExpressionState state)
Methods inherited from class org.springframework.expression.spel.ast.Operator
getLeftOperand, getOperatorName, getRightOperand, toStringAST
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OpDivide

public OpDivide(int pos,
                SpelNodeImpl... operands)
Method Detail

getValueInternal

public TypedValue getValueInternal(ExpressionState state)
                            throws EvaluationException
Specified by:
getValueInternal in class SpelNodeImpl
Throws:
EvaluationException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OpEQ

org.springframework.expression.spel.ast
Class OpEQ

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Operator
            extended by  org.springframework.expression.spel.ast.OpEQ
All Implemented Interfaces:
SpelNode
public class OpEQ
extends Operator

Implements equality operator.

Since:
3.0
Author:
Andy Clement

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
OpEQ(int pos, SpelNodeImpl... operands)
Method Summary
 BooleanTypedValue getValueInternal(ExpressionState state)
Methods inherited from class org.springframework.expression.spel.ast.Operator
getLeftOperand, getOperatorName, getRightOperand, toStringAST
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OpEQ

public OpEQ(int pos,
            SpelNodeImpl... operands)
Method Detail

getValueInternal

public BooleanTypedValue getValueInternal(ExpressionState state)
                                   throws EvaluationException
Specified by:
getValueInternal in class SpelNodeImpl
Throws:
EvaluationException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Operator

org.springframework.expression.spel.ast
Class Operator

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Operator
All Implemented Interfaces:
SpelNode
Direct Known Subclasses:
OpAnd, OpDivide, OpEQ, OperatorBetween, OperatorInstanceof, OperatorMatches, OperatorPower, OpGE, OpGT, OpLE, OpLT, OpMinus, OpModulus, OpMultiply, OpNE, OpOr, OpPlus
public abstract class Operator
extends SpelNodeImpl

Common supertype for operators that operate on either one or two operands. In the case of multiply or divide there would be two operands, but for unary plus or minus, there is only one.

Since:
3.0
Author:
Andy Clement

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
Operator(String payload, int pos, SpelNodeImpl... operands)
Method Summary
SpelNodeImpl | getLeftOperand()
String | getOperatorName()
SpelNodeImpl | getRightOperand()
String | toStringAST() String format for all operators is the same '(' [operand] [operator] [operand] ')'
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, getValueInternal, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Operator

public Operator(String payload,
                int pos,
                SpelNodeImpl... operands)
Method Detail

getLeftOperand

public SpelNodeImpl getLeftOperand()

getRightOperand

public SpelNodeImpl getRightOperand()

getOperatorName

public final String getOperatorName()

toStringAST

public String toStringAST()
String format for all operators is the same '(' [operand] [operator] [operand] ')'

Specified by:
toStringAST in interface SpelNode
Specified by:
toStringAST in class SpelNodeImpl
Returns:
the string form of this AST node
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OperatorBetween

org.springframework.expression.spel.ast
Class OperatorBetween

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Operator
            extended by  org.springframework.expression.spel.ast.OperatorBetween
All Implemented Interfaces:
SpelNode
public class OperatorBetween
extends Operator

Represents the between operator. The left operand to between must be a single value and the right operand must be a list - this operator returns true if the left operand is between (using the registered comparator) the two elements in the list. The definition of between being inclusive follows the SQL BETWEEN definition.

Since:
3.0
Author:
Andy Clement

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
OperatorBetween(int pos, SpelNodeImpl... operands)
Method Summary
 BooleanTypedValue getValueInternal(ExpressionState state)
Returns a boolean based on whether a value is in the range expressed.
Methods inherited from class org.springframework.expression.spel.ast.Operator
getLeftOperand, getOperatorName, getRightOperand, toStringAST
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OperatorBetween

public OperatorBetween(int pos,
                       SpelNodeImpl... operands)
Method Detail

getValueInternal

public BooleanTypedValue getValueInternal(ExpressionState state)
                                   throws EvaluationException
Returns a boolean based on whether a value is in the range expressed. The first operand is any value whilst the second is a list of two values - those two values being the bounds allowed for the first operand (inclusive).

Specified by:
getValueInternal in class SpelNodeImpl
Parameters:
state - the expression state
Returns:
true if the left operand is in the range specified, false otherwise
Throws:
EvaluationException - if there is a problem evaluating the expression
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OperatorInstanceof

org.springframework.expression.spel.ast
Class OperatorInstanceof

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Operator
            extended by  org.springframework.expression.spel.ast.OperatorInstanceof
All Implemented Interfaces:
SpelNode
public class OperatorInstanceof
extends Operator

The operator 'instanceof' checks if an object is of the class specified in the right hand operand, in the same way that instanceof does in Java.

Since:
3.0
Author:
Andy Clement

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
OperatorInstanceof(int pos, SpelNodeImpl... operands)
Method Summary
 BooleanTypedValue getValueInternal(ExpressionState state)
Compare the left operand to see it is an instance of the type specified as the right operand.
Methods inherited from class org.springframework.expression.spel.ast.Operator
getLeftOperand, getOperatorName, getRightOperand, toStringAST
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OperatorInstanceof

public OperatorInstanceof(int pos,
                          SpelNodeImpl... operands)
Method Detail

getValueInternal

public BooleanTypedValue getValueInternal(ExpressionState state)
                                   throws EvaluationException
Compare the left operand to see it is an instance of the type specified as the right operand. The right operand must be a class.

Specified by:
getValueInternal in class SpelNodeImpl
Parameters:
state - the expression state
Returns:
true if the left operand is an instanceof of the right operand, otherwise false
Throws:
EvaluationException - if there is a problem evaluating the expression
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OperatorMatches

org.springframework.expression.spel.ast
Class OperatorMatches

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Operator
            extended by  org.springframework.expression.spel.ast.OperatorMatches
All Implemented Interfaces:
SpelNode
public class OperatorMatches
extends Operator

Implements the matches operator. Matches takes two operands. The first is a string and the second is a java regex. It will return true when getValue() is called if the first operand matches the regex.

Since:
3.0
Author:
Andy Clement

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
OperatorMatches(int pos, SpelNodeImpl... operands)
Method Summary
 BooleanTypedValue getValueInternal(ExpressionState state)
Check the first operand matches the regex specified as the second operand.
Methods inherited from class org.springframework.expression.spel.ast.Operator
getLeftOperand, getOperatorName, getRightOperand, toStringAST
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OperatorMatches

public OperatorMatches(int pos,
                       SpelNodeImpl... operands)
Method Detail

getValueInternal

public BooleanTypedValue getValueInternal(ExpressionState state)
                                   throws EvaluationException
Check the first operand matches the regex specified as the second operand.

Specified by:
getValueInternal in class SpelNodeImpl
Parameters:
state - the expression state
Returns:
true if the first operand matches the regex specified as the second operand, otherwise false
Throws:
EvaluationException - if there is a problem evaluating the expression (e.g. the regex is invalid)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OperatorNot

org.springframework.expression.spel.ast
Class OperatorNot

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.OperatorNot
All Implemented Interfaces:
SpelNode
public class OperatorNot
extends SpelNodeImpl

Represents a NOT operation.

Since:
3.0
Author:
Andy Clement, Mark Fisher

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
OperatorNot(int pos, SpelNodeImpl operand)
Method Summary
BooleanTypedValue | getValueInternal(ExpressionState state)
String | toStringAST()
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OperatorNot

public OperatorNot(int pos,
                   SpelNodeImpl operand)
Method Detail

getValueInternal

public BooleanTypedValue getValueInternal(ExpressionState state)
                                   throws EvaluationException
Specified by:
getValueInternal in class SpelNodeImpl
Throws:
EvaluationException

toStringAST

public String toStringAST()
Specified by:
toStringAST in interface SpelNode
Specified by:
toStringAST in class SpelNodeImpl
Returns:
the string form of this AST node
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OperatorPower

org.springframework.expression.spel.ast
Class OperatorPower

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Operator
            extended by  org.springframework.expression.spel.ast.OperatorPower
All Implemented Interfaces:
SpelNode
public class OperatorPower
extends Operator

The power operator.

Since:
3.0
Author:
Andy Clement

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
OperatorPower(int pos, SpelNodeImpl... operands)
Method Summary
 TypedValue getValueInternal(ExpressionState state)
Methods inherited from class org.springframework.expression.spel.ast.Operator
getLeftOperand, getOperatorName, getRightOperand, toStringAST
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OperatorPower

public OperatorPower(int pos,
                     SpelNodeImpl... operands)
Method Detail

getValueInternal

public TypedValue getValueInternal(ExpressionState state)
                            throws EvaluationException
Specified by:
getValueInternal in class SpelNodeImpl
Throws:
EvaluationException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OpGE

org.springframework.expression.spel.ast
Class OpGE

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Operator
            extended by  org.springframework.expression.spel.ast.OpGE
All Implemented Interfaces:
SpelNode
public class OpGE
extends Operator

Implements greater-than-or-equal operator.

Since:
3.0
Author:
Andy Clement

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
OpGE(int pos, SpelNodeImpl... operands)
Method Summary
 BooleanTypedValue getValueInternal(ExpressionState state)
Methods inherited from class org.springframework.expression.spel.ast.Operator
getLeftOperand, getOperatorName, getRightOperand, toStringAST
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OpGE

public OpGE(int pos,
            SpelNodeImpl... operands)
Method Detail

getValueInternal

public BooleanTypedValue getValueInternal(ExpressionState state)
                                   throws EvaluationException
Specified by:
getValueInternal in class SpelNodeImpl
Throws:
EvaluationException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OpGT

org.springframework.expression.spel.ast
Class OpGT

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Operator
            extended by  org.springframework.expression.spel.ast.OpGT
All Implemented Interfaces:
SpelNode
public class OpGT
extends Operator

Implements greater-than operator.

Since:
3.0
Author:
Andy Clement

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
OpGT(int pos, SpelNodeImpl... operands)
Method Summary
 BooleanTypedValue getValueInternal(ExpressionState state)
Methods inherited from class org.springframework.expression.spel.ast.Operator
getLeftOperand, getOperatorName, getRightOperand, toStringAST
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OpGT

public OpGT(int pos,
            SpelNodeImpl... operands)
Method Detail

getValueInternal

public BooleanTypedValue getValueInternal(ExpressionState state)
                                   throws EvaluationException
Specified by:
getValueInternal in class SpelNodeImpl
Throws:
EvaluationException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OpLE

org.springframework.expression.spel.ast
Class OpLE

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Operator
            extended by  org.springframework.expression.spel.ast.OpLE
All Implemented Interfaces:
SpelNode
public class OpLE
extends Operator

Implements the less-than-or-equal operator.

Since:
3.0
Author:
Andy Clement

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
OpLE(int pos, SpelNodeImpl... operands)
Method Summary
 BooleanTypedValue getValueInternal(ExpressionState state)
Methods inherited from class org.springframework.expression.spel.ast.Operator
getLeftOperand, getOperatorName, getRightOperand, toStringAST
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OpLE

public OpLE(int pos,
            SpelNodeImpl... operands)
Method Detail

getValueInternal

public BooleanTypedValue getValueInternal(ExpressionState state)
                                   throws EvaluationException
Specified by:
getValueInternal in class SpelNodeImpl
Throws:
EvaluationException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OpLT

org.springframework.expression.spel.ast
Class OpLT

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Operator
            extended by  org.springframework.expression.spel.ast.OpLT
All Implemented Interfaces:
SpelNode
public class OpLT
extends Operator

Implements the less-than operator.

Since:
3.0
Author:
Andy Clement

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
OpLT(int pos, SpelNodeImpl... operands)
Method Summary
 BooleanTypedValue getValueInternal(ExpressionState state)
Methods inherited from class org.springframework.expression.spel.ast.Operator
getLeftOperand, getOperatorName, getRightOperand, toStringAST
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OpLT

public OpLT(int pos,
            SpelNodeImpl... operands)
Method Detail

getValueInternal

public BooleanTypedValue getValueInternal(ExpressionState state)
                                   throws EvaluationException
Specified by:
getValueInternal in class SpelNodeImpl
Throws:
EvaluationException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OpMinus

org.springframework.expression.spel.ast
Class OpMinus

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Operator
            extended by  org.springframework.expression.spel.ast.OpMinus
All Implemented Interfaces:
SpelNode
public class OpMinus
extends Operator

The minus operator supports:

  • subtraction of doubles (floats are represented as doubles)
  • subtraction of longs
  • subtraction of integers
  • subtraction of an int from a string of one character (effectively decreasing that character), so 'd'-3='a'
It can be used as a unary operator for numbers (double/long/int). The standard promotions are performed when the operand types vary (double-int=double). For other options it defers to the registered overloader.

Since:
3.0
Author:
Andy Clement

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
OpMinus(int pos, SpelNodeImpl... operands)
Method Summary
SpelNodeImpl | getRightOperand()
TypedValue | getValueInternal(ExpressionState state)
String | toStringAST() String format for all operators is the same '(' [operand] [operator] [operand] ')'
Methods inherited from class org.springframework.expression.spel.ast.Operator
getLeftOperand, getOperatorName
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OpMinus

public OpMinus(int pos,
               SpelNodeImpl... operands)
Method Detail

getValueInternal

public TypedValue getValueInternal(ExpressionState state)
                            throws EvaluationException
Specified by:
getValueInternal in class SpelNodeImpl
Throws:
EvaluationException

toStringAST

public String toStringAST()
Description copied from class: Operator
String format for all operators is the same '(' [operand] [operator] [operand] ')'

Specified by:
toStringAST in interface SpelNode
Overrides:
toStringAST in class Operator
Returns:
the string form of this AST node

getRightOperand

public SpelNodeImpl getRightOperand()
Overrides:
getRightOperand in class Operator
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OpModulus

org.springframework.expression.spel.ast
Class OpModulus

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Operator
            extended by  org.springframework.expression.spel.ast.OpModulus
All Implemented Interfaces:
SpelNode
public class OpModulus
extends Operator

Implements the modulus operator.

Since:
3.0
Author:
Andy Clement

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
OpModulus(int pos, SpelNodeImpl... operands)
Method Summary
 TypedValue getValueInternal(ExpressionState state)
Methods inherited from class org.springframework.expression.spel.ast.Operator
getLeftOperand, getOperatorName, getRightOperand, toStringAST
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OpModulus

public OpModulus(int pos,
                 SpelNodeImpl... operands)
Method Detail

getValueInternal

public TypedValue getValueInternal(ExpressionState state)
                            throws EvaluationException
Specified by:
getValueInternal in class SpelNodeImpl
Throws:
EvaluationException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OpMultiply

org.springframework.expression.spel.ast
Class OpMultiply

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Operator
            extended by  org.springframework.expression.spel.ast.OpMultiply
All Implemented Interfaces:
SpelNode
public class OpMultiply
extends Operator

Implements the multiply operator. Conversions and promotions: http://java.sun.com/docs/books/jls/third_edition/html/conversions.html Section 5.6.2:

If any of the operands is of a reference type, unboxing conversion (¤5.1.8) is performed. Then:
If either operand is of type double, the other is converted to double.
Otherwise, if either operand is of type float, the other is converted to float.
Otherwise, if either operand is of type long, the other is converted to long.
Otherwise, both operands are converted to type int.

Since:
3.0
Author:
Andy Clement

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
OpMultiply(int pos, SpelNodeImpl... operands)
Method Summary
 TypedValue getValueInternal(ExpressionState state)
Implements multiply directly here for some types of operand, otherwise delegates to any registered overloader for types it does not recognize.
Methods inherited from class org.springframework.expression.spel.ast.Operator
getLeftOperand, getOperatorName, getRightOperand, toStringAST
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OpMultiply

public OpMultiply(int pos,
                  SpelNodeImpl... operands)
Method Detail

getValueInternal

public TypedValue getValueInternal(ExpressionState state)
                            throws EvaluationException
Implements multiply directly here for some types of operand, otherwise delegates to any registered overloader for types it does not recognize. Supported types here are:
  • integers
  • doubles
  • string and int ('abc' * 2 == 'abcabc')

Specified by:
getValueInternal in class SpelNodeImpl
Throws:
EvaluationException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OpNE

org.springframework.expression.spel.ast
Class OpNE

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Operator
            extended by  org.springframework.expression.spel.ast.OpNE
All Implemented Interfaces:
SpelNode
public class OpNE
extends Operator

Implements the not-equal operator.

Since:
3.0
Author:
Andy Clement

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
OpNE(int pos, SpelNodeImpl... operands)
Method Summary
 BooleanTypedValue getValueInternal(ExpressionState state)
Methods inherited from class org.springframework.expression.spel.ast.Operator
getLeftOperand, getOperatorName, getRightOperand, toStringAST
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OpNE

public OpNE(int pos,
            SpelNodeImpl... operands)
Method Detail

getValueInternal

public BooleanTypedValue getValueInternal(ExpressionState state)
                                   throws EvaluationException
Specified by:
getValueInternal in class SpelNodeImpl
Throws:
EvaluationException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OpOr

org.springframework.expression.spel.ast
Class OpOr

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Operator
            extended by  org.springframework.expression.spel.ast.OpOr
All Implemented Interfaces:
SpelNode
public class OpOr
extends Operator

Represents the boolean OR operation.

Since:
3.0
Author:
Andy Clement, Mark Fisher

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
OpOr(int pos, SpelNodeImpl... operands)
Method Summary
 BooleanTypedValue getValueInternal(ExpressionState state)
Methods inherited from class org.springframework.expression.spel.ast.Operator
getLeftOperand, getOperatorName, getRightOperand, toStringAST
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OpOr

public OpOr(int pos,
            SpelNodeImpl... operands)
Method Detail

getValueInternal

public BooleanTypedValue getValueInternal(ExpressionState state)
                                   throws EvaluationException
Specified by:
getValueInternal in class SpelNodeImpl
Throws:
EvaluationException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OpPlus

org.springframework.expression.spel.ast
Class OpPlus

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Operator
            extended by  org.springframework.expression.spel.ast.OpPlus
All Implemented Interfaces:
SpelNode
public class OpPlus
extends Operator

The plus operator will:

  • add doubles (floats are represented as doubles)
  • add longs
  • add integers
  • concatenate strings
It can be used as a unary operator for numbers (double/long/int). The standard promotions are performed when the operand types vary (double+int=double). For other options it defers to the registered overloader.

Since:
3.0
Author:
Andy Clement

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
OpPlus(int pos, SpelNodeImpl... operands)
Method Summary
SpelNodeImpl | getRightOperand()
TypedValue | getValueInternal(ExpressionState state)
String | toStringAST() String format for all operators is the same '(' [operand] [operator] [operand] ')'
Methods inherited from class org.springframework.expression.spel.ast.Operator
getLeftOperand, getOperatorName
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OpPlus

public OpPlus(int pos,
              SpelNodeImpl... operands)
Method Detail

getValueInternal

public TypedValue getValueInternal(ExpressionState state)
                            throws EvaluationException
Specified by:
getValueInternal in class SpelNodeImpl
Throws:
EvaluationException

toStringAST

public String toStringAST()
Description copied from class: Operator
String format for all operators is the same '(' [operand] [operator] [operand] ')'

Specified by:
toStringAST in interface SpelNode
Overrides:
toStringAST in class Operator
Returns:
the string form of this AST node

getRightOperand

public SpelNodeImpl getRightOperand()
Overrides:
getRightOperand in class Operator
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Projection

org.springframework.expression.spel.ast
Class Projection

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Projection
All Implemented Interfaces:
SpelNode
public class Projection
extends SpelNodeImpl

Represents projection, where a given operation is performed on all elements in some input sequence, returning a new sequence of the same size. For example: "{1,2,3,4,5,6,7,8,9,10}.!{#isEven(#this)}" returns "[n, y, n, y, n, y, n, y, n, y]"

Since:
3.0
Author:
Andy Clement, Mark Fisher

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
Projection(boolean nullSafe, int pos, SpelNodeImpl expression)
Method Summary
TypedValue | getValueInternal(ExpressionState state)
String | toStringAST()
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Projection

public Projection(boolean nullSafe,
                  int pos,
                  SpelNodeImpl expression)
Method Detail

getValueInternal

public TypedValue getValueInternal(ExpressionState state)
                            throws EvaluationException
Specified by:
getValueInternal in class SpelNodeImpl
Throws:
EvaluationException

toStringAST

public String toStringAST()
Specified by:
toStringAST in interface SpelNode
Specified by:
toStringAST in class SpelNodeImpl
Returns:
the string form of this AST node
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertyOrFieldReference

org.springframework.expression.spel.ast
Class PropertyOrFieldReference

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.PropertyOrFieldReference
All Implemented Interfaces:
SpelNode
public class PropertyOrFieldReference
extends SpelNodeImpl

Represents a simple property or field reference.

Since:
3.0
Author:
Andy Clement, Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
PropertyOrFieldReference(boolean nullSafe, String propertyOrFieldName, int pos)
Method Summary
String | getName()
TypedValue | getValueInternal(ExpressionState state)
boolean | isNullSafe()
boolean | isWritable(ExpressionState state) Determine if this expression node will support a setValue() call.
boolean | isWritableProperty(String name, ExpressionState state)
void | setValue(ExpressionState state, Object newValue) Evaluate the expression to a node and then set the new value on that node.
String | toStringAST()
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, nextChildIs
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PropertyOrFieldReference

public PropertyOrFieldReference(boolean nullSafe,
                                String propertyOrFieldName,
                                int pos)
Method Detail

isNullSafe

public boolean isNullSafe()

getName

public String getName()

getValueInternal

public TypedValue getValueInternal(ExpressionState state)
                            throws EvaluationException
Specified by:
getValueInternal in class SpelNodeImpl
Throws:
EvaluationException

setValue

public void setValue(ExpressionState state,
                     Object newValue)
              throws SpelEvaluationException
Description copied from interface: SpelNode
Evaluate the expression to a node and then set the new value on that node. For example, if the expression evaluates to a property reference then the property will be set to the new value.

Specified by:
setValue in interface SpelNode
Overrides:
setValue in class SpelNodeImpl
Parameters:
state - the current expression state (includes the context)
newValue - the new value
Throws:
SpelEvaluationException

isWritable

public boolean isWritable(ExpressionState state)
                   throws SpelEvaluationException
Description copied from interface: SpelNode
Determine if this expression node will support a setValue() call.

Specified by:
isWritable in interface SpelNode
Overrides:
isWritable in class SpelNodeImpl
Parameters:
state - the current expression state (includes the context)
Returns:
true if the expression node will allow setValue()
Throws:
SpelEvaluationException

toStringAST

public String toStringAST()
Specified by:
toStringAST in interface SpelNode
Specified by:
toStringAST in class SpelNodeImpl
Returns:
the string form of this AST node

isWritableProperty

public boolean isWritableProperty(String name,
                                  ExpressionState state)
                           throws SpelEvaluationException
Throws:
SpelEvaluationException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


QualifiedIdentifier

org.springframework.expression.spel.ast
Class QualifiedIdentifier

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.QualifiedIdentifier
All Implemented Interfaces:
SpelNode
public class QualifiedIdentifier
extends SpelNodeImpl

Represents a dot separated sequence of strings that indicate a package qualified type reference.

Example: "java.lang.String" as in the expression "new java.lang.String('hello')"

Since:
3.0
Author:
Andy Clement

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
QualifiedIdentifier(int pos, SpelNodeImpl... operands)
Method Summary
TypedValue | getValueInternal(ExpressionState state)
String | toStringAST()
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

QualifiedIdentifier

public QualifiedIdentifier(int pos,
                           SpelNodeImpl... operands)
Method Detail

getValueInternal

public TypedValue getValueInternal(ExpressionState state)
                            throws EvaluationException
Specified by:
getValueInternal in class SpelNodeImpl
Throws:
EvaluationException

toStringAST

public String toStringAST()
Specified by:
toStringAST in interface SpelNode
Specified by:
toStringAST in class SpelNodeImpl
Returns:
the string form of this AST node
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RealLiteral

org.springframework.expression.spel.ast
Class RealLiteral

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Literal
            extended by  org.springframework.expression.spel.ast.RealLiteral
All Implemented Interfaces:
SpelNode
public class RealLiteral
extends Literal

Since:
3.0
Author:
Andy Clement

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.Literal
literalValue
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
RealLiteral(String payload, int pos, double value)
Method Summary
 TypedValue getLiteralValue()
Methods inherited from class org.springframework.expression.spel.ast.Literal
getIntLiteral, getLongLiteral, getRealLiteral, getValueInternal, toString, toStringAST
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

RealLiteral

public RealLiteral(String payload,
                   int pos,
                   double value)
Method Detail

getLiteralValue

public TypedValue getLiteralValue()
Specified by:
getLiteralValue in class Literal
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Selection

org.springframework.expression.spel.ast
Class Selection

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Selection
All Implemented Interfaces:
SpelNode
public class Selection
extends SpelNodeImpl

Represents selection over a map or collection. For example: {1,2,3,4,5,6,7,8,9,10}.?{#isEven(#this) == 'y'} returns [2, 4, 6, 8, 10] Basically a subset of the input data is returned based on the evaluation of the expression supplied as selection criteria.

Since:
3.0
Author:
Andy Clement, Mark Fisher

Field Summary
static int | ALL
static int | FIRST
static int | LAST
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
Selection(boolean nullSafe, int variant, int pos, SpelNodeImpl expression)
Method Summary
TypedValue | getValueInternal(ExpressionState state)
String | toStringAST()
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

ALL

public static final int ALL
See Also:
Constant Field Values

FIRST

public static final int FIRST
See Also:
Constant Field Values

LAST

public static final int LAST
See Also:
Constant Field Values
Constructor Detail

Selection

public Selection(boolean nullSafe,
                 int variant,
                 int pos,
                 SpelNodeImpl expression)
Method Detail

getValueInternal

public TypedValue getValueInternal(ExpressionState state)
                            throws EvaluationException
Specified by:
getValueInternal in class SpelNodeImpl
Throws:
EvaluationException

toStringAST

public String toStringAST()
Specified by:
toStringAST in interface SpelNode
Specified by:
toStringAST in class SpelNodeImpl
Returns:
the string form of this AST node
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SpelNodeImpl

org.springframework.expression.spel.ast
Class SpelNodeImpl

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
All Implemented Interfaces:
SpelNode
Direct Known Subclasses:
Assign, CompoundExpression, ConstructorReference, Elvis, FunctionReference, Identifier, Indexer, Literal, MethodReference, Operator, OperatorNot, Projection, PropertyOrFieldReference, QualifiedIdentifier, Selection, Ternary, TypeReference, VariableReference
public abstract class SpelNodeImpl
extends Object
implements SpelNode

The common supertype of all AST nodes in a parsed Spring Expression Language format expression.

Since:
3.0
Author:
Andy Clement

Field Summary
protected SpelNodeImpl[] | children
protected int | pos
Constructor Summary
SpelNodeImpl(int pos, SpelNodeImpl... operands)
Method Summary
 SpelNode getChild(int index)
Helper method that returns a SpelNode rather than an Antlr Tree node.
 int getChildCount()
 int getEndPosition()
 Class<?> getObjectClass(Object obj)
Determine the class of the object passed in, unless it is already a class object.
protected  SpelNodeImpl getPreviousChild()
 int getStartPosition()
 TypedValue getTypedValue(ExpressionState expressionState)
Evaluate the expression node in the context of the supplied expression state and return the typed value.
 Object getValue(ExpressionState expressionState)
Evaluate the expression node in the context of the supplied expression state and return the value.
protected
<T> T
getValue(ExpressionState state, Class<T> desiredReturnType)
abstract  TypedValue getValueInternal(ExpressionState expressionState)
 boolean isWritable(ExpressionState expressionState)
Determine if this expression node will support a setValue() call.
protected  boolean nextChildIs(Class... clazzes)
 void setValue(ExpressionState expressionState, Object newValue)
Evaluate the expression to a node and then set the new value on that node.
abstract  String toStringAST()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

pos

protected int pos

children

protected SpelNodeImpl[] children
Constructor Detail

SpelNodeImpl

public SpelNodeImpl(int pos,
                    SpelNodeImpl... operands)
Method Detail

getPreviousChild

protected SpelNodeImpl getPreviousChild()

nextChildIs

protected boolean nextChildIs(Class... clazzes)
Returns:
true if the next child is one of the specified classes

getValue

public final Object getValue(ExpressionState expressionState)
                      throws EvaluationException
Description copied from interface: SpelNode
Evaluate the expression node in the context of the supplied expression state and return the value.

Specified by:
getValue in interface SpelNode
Parameters:
expressionState - the current expression state (includes the context)
Returns:
the value of this node evaluated against the specified state
Throws:
EvaluationException

getTypedValue

public final TypedValue getTypedValue(ExpressionState expressionState)
                               throws EvaluationException
Description copied from interface: SpelNode
Evaluate the expression node in the context of the supplied expression state and return the typed value.

Specified by:
getTypedValue in interface SpelNode
Parameters:
expressionState - the current expression state (includes the context)
Returns:
the type value of this node evaluated against the specified state
Throws:
EvaluationException

isWritable

public boolean isWritable(ExpressionState expressionState)
                   throws EvaluationException
Description copied from interface: SpelNode
Determine if this expression node will support a setValue() call.

Specified by:
isWritable in interface SpelNode
Parameters:
expressionState - the current expression state (includes the context)
Returns:
true if the expression node will allow setValue()
Throws:
EvaluationException - if something went wrong trying to determine if the node supports writing

setValue

public void setValue(ExpressionState expressionState,
                     Object newValue)
              throws EvaluationException
Description copied from interface: SpelNode
Evaluate the expression to a node and then set the new value on that node. For example, if the expression evaluates to a property reference then the property will be set to the new value.

Specified by:
setValue in interface SpelNode
Parameters:
expressionState - the current expression state (includes the context)
newValue - the new value
Throws:
EvaluationException - if any problem occurs evaluating the expression or setting the new value

getChild

public SpelNode getChild(int index)
Description copied from interface: SpelNode
Helper method that returns a SpelNode rather than an Antlr Tree node.

Specified by:
getChild in interface SpelNode
Returns:
the child node cast to a SpelNode

getChildCount

public int getChildCount()
Specified by:
getChildCount in interface SpelNode
Returns:
the number of children under this node

getObjectClass

public Class<?> getObjectClass(Object obj)
Description copied from interface: SpelNode
Determine the class of the object passed in, unless it is already a class object.

Specified by:
getObjectClass in interface SpelNode
Returns:
the class of the object if it is not already a class object, or null if the object is null

getValue

protected final <T> T getValue(ExpressionState state,
                               Class<T> desiredReturnType)
                    throws EvaluationException
Throws:
EvaluationException

getValueInternal

public abstract TypedValue getValueInternal(ExpressionState expressionState)
                                     throws EvaluationException
Throws:
EvaluationException

toStringAST

public abstract String toStringAST()
Specified by:
toStringAST in interface SpelNode
Returns:
the string form of this AST node

getStartPosition

public int getStartPosition()
Specified by:
getStartPosition in interface SpelNode
Returns:
the start position of this Ast node in the expression string

getEndPosition

public int getEndPosition()
Specified by:
getEndPosition in interface SpelNode
Returns:
the end position of this Ast node in the expression string
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StringLiteral

org.springframework.expression.spel.ast
Class StringLiteral

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Literal
            extended by  org.springframework.expression.spel.ast.StringLiteral
All Implemented Interfaces:
SpelNode
public class StringLiteral
extends Literal

Since:
3.0
Author:
Andy Clement, Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.Literal
literalValue
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
StringLiteral(String payload, int pos, String value)
Method Summary
TypedValue | getLiteralValue()
String | toString()
Methods inherited from class org.springframework.expression.spel.ast.Literal
getIntLiteral, getLongLiteral, getRealLiteral, getValueInternal, toStringAST
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

StringLiteral

public StringLiteral(String payload,
                     int pos,
                     String value)
Method Detail

getLiteralValue

public TypedValue getLiteralValue()
Specified by:
getLiteralValue in class Literal

toString

public String toString()
Overrides:
toString in class Literal
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Ternary

org.springframework.expression.spel.ast
Class Ternary

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.Ternary
All Implemented Interfaces:
SpelNode
public class Ternary
extends SpelNodeImpl

Represents a ternary expression, for example: "someCheck()?true:false".

Since:
3.0
Author:
Andy Clement, Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
Ternary(int pos, SpelNodeImpl... args)
Method Summary
TypedValue | getValueInternal(ExpressionState state) Evaluate the condition and if true evaluate the first alternative, otherwise evaluate the second alternative.
String | toStringAST()
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Ternary

public Ternary(int pos,
               SpelNodeImpl... args)
Method Detail

getValueInternal

public TypedValue getValueInternal(ExpressionState state)
                            throws EvaluationException
Evaluate the condition and if true evaluate the first alternative, otherwise evaluate the second alternative.

Specified by:
getValueInternal in class SpelNodeImpl
Parameters:
state - the expression state
Throws:
EvaluationException - if the condition does not evaluate correctly to a boolean or there is a problem executing the chosen alternative

toStringAST

public String toStringAST()
Specified by:
toStringAST in interface SpelNode
Specified by:
toStringAST in class SpelNodeImpl
Returns:
the string form of this AST node
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TypeReference

org.springframework.expression.spel.ast
Class TypeReference

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.TypeReference
All Implemented Interfaces:
SpelNode
public class TypeReference
extends SpelNodeImpl

Represents a reference to a type, for example "T(String)" or "T(com.somewhere.Foo)"

Author:
Andy Clement

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
TypeReference(int pos, SpelNodeImpl qualifiedId)
Method Summary
TypedValue | getValueInternal(ExpressionState state)
String | toStringAST()
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TypeReference

public TypeReference(int pos,
                     SpelNodeImpl qualifiedId)
Method Detail

getValueInternal

public TypedValue getValueInternal(ExpressionState state)
                            throws EvaluationException
Specified by:
getValueInternal in class SpelNodeImpl
Throws:
EvaluationException

toStringAST

public String toStringAST()
Specified by:
toStringAST in interface SpelNode
Specified by:
toStringAST in class SpelNodeImpl
Returns:
the string form of this AST node
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


VariableReference

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.expression.spel.ast
Class VariableReference

java.lang.Object
    extended by  org.springframework.expression.spel.ast.SpelNodeImpl
        extended by  org.springframework.expression.spel.ast.VariableReference
All Implemented Interfaces:
SpelNode
public class VariableReference
extends SpelNodeImpl

Represents a variable reference, eg. #someVar. Note this is different to a *local* variable like $someVar

Since:
3.0
Author:
Andy Clement

Field Summary
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
children, pos
Constructor Summary
VariableReference(String variableName, int pos)
Method Summary
TypedValue | getValueInternal(ExpressionState state)
boolean | isWritable(ExpressionState expressionState) Determine if this expression node will support a setValue() call.
void | setValue(ExpressionState state, Object value) Evaluate the expression to a node and then set the new value on that node.
String | toStringAST()
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, nextChildIs
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

VariableReference

public VariableReference(String variableName,
                         int pos)
Method Detail

getValueInternal

public TypedValue getValueInternal(ExpressionState state)
                            throws SpelEvaluationException
Specified by:
getValueInternal in class SpelNodeImpl
Throws:
SpelEvaluationException

setValue

public void setValue(ExpressionState state,
                     Object value)
              throws SpelEvaluationException
Description copied from interface: SpelNode
Evaluate the expression to a node and then set the new value on that node. For example, if the expression evaluates to a property reference then the property will be set to the new value.

Specified by:
setValue in interface SpelNode
Overrides:
setValue in class SpelNodeImpl
Parameters:
state - the current expression state (includes the context)
value - the new value
Throws:
SpelEvaluationException

toStringAST

public String toStringAST()
Specified by:
toStringAST in interface SpelNode
Specified by:
toStringAST in class SpelNodeImpl
Returns:
the string form of this AST node

isWritable

public boolean isWritable(ExpressionState expressionState)
                   throws SpelEvaluationException
Description copied from interface: SpelNode
Determine if this expression node will support a setValue() call.

Specified by:
isWritable in interface SpelNode
Overrides:
isWritable in class SpelNodeImpl
Parameters:
expressionState - the current expression state (includes the context)
Returns:
true if the expression node will allow setValue()
Throws:
SpelEvaluationException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


TypeCode

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

org.springframework.expression.spel.ast
Enum TypeCode

java.lang.Object
    extended by  java.lang.Enum<TypeCode>
        extended by  org.springframework.expression.spel.ast.TypeCode
All Implemented Interfaces:
Serializable, Comparable<TypeCode>
public enum TypeCode
extends Enum<TypeCode>

Enum Constant Summary
BOOLEAN
BYTE
CHAR
DOUBLE
FLOAT
INT
LONG
OBJECT
SHORT
Method Summary
Class<?> | getType()
static TypeCode | valueOf(String name) Returns the enum constant of this type with the specified name.
static TypeCode[] | values() Returns an array containing the constants of this enum type, in the order they are declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

OBJECT

public static final TypeCode OBJECT

BOOLEAN

public static final TypeCode BOOLEAN

BYTE

public static final TypeCode BYTE

CHAR

public static final TypeCode CHAR

SHORT

public static final TypeCode SHORT

INT

public static final TypeCode INT

LONG

public static final TypeCode LONG

FLOAT

public static final TypeCode FLOAT

DOUBLE

public static final TypeCode DOUBLE
Method Detail

values

public static TypeCode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (TypeCode c : TypeCode.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static TypeCode valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getType

public Class<?> getType()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


org.springframework.expression.spel.standard

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.expression.spel.standard

Class Summary
SpelExpression | A SpelExpressions represents a parsed (valid) expression that is ready to be evaluated in a specified context.
SpelExpressionParser | SpEL parser.


org.springframework.expression.spel.standard Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.expression.spel.standard

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.expression.spel.standard.SpelExpression (implements org.springframework.expression.Expression)
    • org.springframework.expression.common.TemplateAwareExpressionParser (implements org.springframework.expression.ExpressionParser)
      • org.springframework.expression.spel.standard.SpelExpressionParser


SpelExpression

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.expression.spel.standard
Class SpelExpression

java.lang.Object
    extended by  org.springframework.expression.spel.standard.SpelExpression
All Implemented Interfaces:
Expression
public class SpelExpression
extends Object
implements Expression

A SpelExpressions represents a parsed (valid) expression that is ready to be evaluated in a specified context. An expression can be evaluated standalone or in a specified context. During expression evaluation the context may be asked to resolve references to types, beans, properties, methods.

Since:
3.0
Author:
Andy Clement

Constructor Summary
SpelExpression(String expression, SpelNodeImpl ast, SpelParserConfiguration configuration)
Construct an expression, only used by the parser.
Method Summary
 SpelNode getAST()
 EvaluationContext getEvaluationContext()
Return the default evaluation context that will be used if none is supplied on an evaluation call
 String getExpressionString()
Returns the original string used to create this expression, unmodified.
 Object getValue()
Evaluate this expression in the default standard context.
<T> T
getValue(Class<T> expectedResultType)
Evaluate the expression in the default context.
 Object getValue(EvaluationContext context)
Evaluate this expression in the provided context and return the result of evaluation.
<T> T
getValue(EvaluationContext context, Class<T> expectedResultType)
Evaluate the expression in a specified context which can resolve references to properties, methods, types, etc - the type of the evaluation result is expected to be of a particular class and an exception will be thrown if it is not and cannot be converted to that type.
 Object getValue(EvaluationContext context, Object rootObject)
Evaluate this expression in the provided context and return the result of evaluation, but use the supplied root context as an override for any default root object specified in the context.
<T> T
getValue(EvaluationContext context, Object rootObject, Class<T> expectedResultType)
Evaluate the expression in a specified context which can resolve references to properties, methods, types, etc - the type of the evaluation result is expected to be of a particular class and an exception will be thrown if it is not and cannot be converted to that type.
 Object getValue(Object rootObject)
Evaluate this expression against the specified root object
<T> T
getValue(Object rootObject, Class<T> expectedResultType)
Evaluate the expression in the default context against the specified root object.
 Class getValueType()
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method using the default context.
 Class getValueType(EvaluationContext context)
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method for the given context.
 Class getValueType(EvaluationContext context, Object rootObject)
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method for the given context.
 Class getValueType(Object rootObject)
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method using the default context.
 TypeDescriptor getValueTypeDescriptor()
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method using the default context.
 TypeDescriptor getValueTypeDescriptor(EvaluationContext context)
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method for the given context.
 TypeDescriptor getValueTypeDescriptor(EvaluationContext context, Object rootObject)
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method for the given context.
 TypeDescriptor getValueTypeDescriptor(Object rootObject)
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method using the default context.
 boolean isWritable(EvaluationContext context)
Determine if an expression can be written to, i.e.
 boolean isWritable(EvaluationContext context, Object rootObject)
Determine if an expression can be written to, i.e.
 boolean isWritable(Object rootObject)
Determine if an expression can be written to, i.e.
 void setEvaluationContext(EvaluationContext context)
Set the evaluation context that will be used if none is specified on an evaluation call.
 void setValue(EvaluationContext context, Object value)
Set this expression in the provided context to the value provided.
 void setValue(EvaluationContext context, Object rootObject, Object value)
Set this expression in the provided context to the value provided.
 void setValue(Object rootObject, Object value)
Set this expression in the provided context to the value provided.
 String toStringAST()
Produce a string representation of the Abstract Syntax Tree for the expression, this should ideally look like the input expression, but properly formatted since any unnecessary whitespace will have been discarded during the parse of the expression.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SpelExpression

public SpelExpression(String expression,
                      SpelNodeImpl ast,
                      SpelParserConfiguration configuration)
Construct an expression, only used by the parser.

Method Detail

getValue

public Object getValue()
                throws EvaluationException
Description copied from interface: Expression
Evaluate this expression in the default standard context.

Specified by:
getValue in interface Expression
Returns:
the evaluation result
Throws:
EvaluationException - if there is a problem during evaluation

getValue

public Object getValue(Object rootObject)
                throws EvaluationException
Description copied from interface: Expression
Evaluate this expression against the specified root object

Specified by:
getValue in interface Expression
Parameters:
rootObject - the root object against which properties/etc will be resolved
Returns:
the evaluation result
Throws:
EvaluationException - if there is a problem during evaluation

getValue

public <T> T getValue(Class<T> expectedResultType)
           throws EvaluationException
Description copied from interface: Expression
Evaluate the expression in the default context. If the result of the evaluation does not match (and cannot be converted to) the expected result type then an exception will be returned.

Specified by:
getValue in interface Expression
Parameters:
expectedResultType - the class the caller would like the result to be
Returns:
the evaluation result
Throws:
EvaluationException - if there is a problem during evaluation

getValue

public <T> T getValue(Object rootObject,
                      Class<T> expectedResultType)
           throws EvaluationException
Description copied from interface: Expression
Evaluate the expression in the default context against the specified root object. If the result of the evaluation does not match (and cannot be converted to) the expected result type then an exception will be returned.

Specified by:
getValue in interface Expression
Parameters:
rootObject - the root object against which properties/etc will be resolved
expectedResultType - the class the caller would like the result to be
Returns:
the evaluation result
Throws:
EvaluationException - if there is a problem during evaluation

getValue

public Object getValue(EvaluationContext context)
                throws EvaluationException
Description copied from interface: Expression
Evaluate this expression in the provided context and return the result of evaluation.

Specified by:
getValue in interface Expression
Parameters:
context - the context in which to evaluate the expression
Returns:
the evaluation result
Throws:
EvaluationException - if there is a problem during evaluation

getValue

public Object getValue(EvaluationContext context,
                       Object rootObject)
                throws EvaluationException
Description copied from interface: Expression
Evaluate this expression in the provided context and return the result of evaluation, but use the supplied root context as an override for any default root object specified in the context.

Specified by:
getValue in interface Expression
Parameters:
context - the context in which to evaluate the expression
rootObject - the root object against which properties/etc will be resolved
Returns:
the evaluation result
Throws:
EvaluationException - if there is a problem during evaluation

getValue

public <T> T getValue(EvaluationContext context,
                      Class<T> expectedResultType)
           throws EvaluationException
Description copied from interface: Expression
Evaluate the expression in a specified context which can resolve references to properties, methods, types, etc - the type of the evaluation result is expected to be of a particular class and an exception will be thrown if it is not and cannot be converted to that type.

Specified by:
getValue in interface Expression
Parameters:
context - the context in which to evaluate the expression
expectedResultType - the class the caller would like the result to be
Returns:
the evaluation result
Throws:
EvaluationException - if there is a problem during evaluation

getValue

public <T> T getValue(EvaluationContext context,
                      Object rootObject,
                      Class<T> expectedResultType)
           throws EvaluationException
Description copied from interface: Expression
Evaluate the expression in a specified context which can resolve references to properties, methods, types, etc - the type of the evaluation result is expected to be of a particular class and an exception will be thrown if it is not and cannot be converted to that type. The supplied root object overrides any default specified on the supplied context.

Specified by:
getValue in interface Expression
Parameters:
context - the context in which to evaluate the expression
rootObject - the root object against which properties/etc will be resolved
expectedResultType - the class the caller would like the result to be
Returns:
the evaluation result
Throws:
EvaluationException - if there is a problem during evaluation

getValueType

public Class getValueType()
                   throws EvaluationException
Description copied from interface: Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method using the default context.

Specified by:
getValueType in interface Expression
Returns:
the most general type of value that can be set on this context
Throws:
EvaluationException - if there is a problem determining the type

getValueType

public Class getValueType(EvaluationContext context)
                   throws EvaluationException
Description copied from interface: Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method for the given context.

Specified by:
getValueType in interface Expression
Parameters:
context - the context in which to evaluate the expression
Returns:
the most general type of value that can be set on this context
Throws:
EvaluationException - if there is a problem determining the type

getValueType

public Class getValueType(EvaluationContext context,
                          Object rootObject)
                   throws EvaluationException
Description copied from interface: Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method for the given context. The supplied root object overrides any specified in the context.

Specified by:
getValueType in interface Expression
Parameters:
context - the context in which to evaluate the expression
rootObject - the root object against which to evaluate the expression
Returns:
the most general type of value that can be set on this context
Throws:
EvaluationException - if there is a problem determining the type

getValueType

public Class getValueType(Object rootObject)
                   throws EvaluationException
Description copied from interface: Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method using the default context.

Specified by:
getValueType in interface Expression
Parameters:
rootObject - the root object against which to evaluate the expression
Returns:
the most general type of value that can be set on this context
Throws:
EvaluationException - if there is a problem determining the type

getValueTypeDescriptor

public TypeDescriptor getValueTypeDescriptor()
                                      throws EvaluationException
Description copied from interface: Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method using the default context.

Specified by:
getValueTypeDescriptor in interface Expression
Returns:
a type descriptor for the most general type of value that can be set on this context
Throws:
EvaluationException - if there is a problem determining the type

getValueTypeDescriptor

public TypeDescriptor getValueTypeDescriptor(Object rootObject)
                                      throws EvaluationException
Description copied from interface: Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method using the default context.

Specified by:
getValueTypeDescriptor in interface Expression
Parameters:
rootObject - the root object against which to evaluate the expression
Returns:
a type descriptor for the most general type of value that can be set on this context
Throws:
EvaluationException - if there is a problem determining the type

getValueTypeDescriptor

public TypeDescriptor getValueTypeDescriptor(EvaluationContext context)
                                      throws EvaluationException
Description copied from interface: Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method for the given context.

Specified by:
getValueTypeDescriptor in interface Expression
Parameters:
context - the context in which to evaluate the expression
Returns:
a type descriptor for the most general type of value that can be set on this context
Throws:
EvaluationException - if there is a problem determining the type

getValueTypeDescriptor

public TypeDescriptor getValueTypeDescriptor(EvaluationContext context,
                                             Object rootObject)
                                      throws EvaluationException
Description copied from interface: Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method for the given context. The supplied root object overrides any specified in the context.

Specified by:
getValueTypeDescriptor in interface Expression
Parameters:
context - the context in which to evaluate the expression
rootObject - the root object against which to evaluate the expression
Returns:
a type descriptor for the most general type of value that can be set on this context
Throws:
EvaluationException - if there is a problem determining the type

getExpressionString

public String getExpressionString()
Description copied from interface: Expression
Returns the original string used to create this expression, unmodified.

Specified by:
getExpressionString in interface Expression
Returns:
the original expression string

isWritable

public boolean isWritable(EvaluationContext context)
                   throws EvaluationException
Description copied from interface: Expression
Determine if an expression can be written to, i.e. setValue() can be called.

Specified by:
isWritable in interface Expression
Parameters:
context - the context in which the expression should be checked
Returns:
true if the expression is writable
Throws:
EvaluationException - if there is a problem determining if it is writable

isWritable

public boolean isWritable(Object rootObject)
                   throws EvaluationException
Description copied from interface: Expression
Determine if an expression can be written to, i.e. setValue() can be called.

Specified by:
isWritable in interface Expression
Parameters:
rootObject - the root object against which to evaluate the expression
Returns:
true if the expression is writable
Throws:
EvaluationException - if there is a problem determining if it is writable

isWritable

public boolean isWritable(EvaluationContext context,
                          Object rootObject)
                   throws EvaluationException
Description copied from interface: Expression
Determine if an expression can be written to, i.e. setValue() can be called. The supplied root object overrides any specified in the context.

Specified by:
isWritable in interface Expression
Parameters:
context - the context in which the expression should be checked
rootObject - the root object against which to evaluate the expression
Returns:
true if the expression is writable
Throws:
EvaluationException - if there is a problem determining if it is writable

setValue

public void setValue(EvaluationContext context,
                     Object value)
              throws EvaluationException
Description copied from interface: Expression
Set this expression in the provided context to the value provided.

Specified by:
setValue in interface Expression
Parameters:
context - the context in which to set the value of the expression
value - the new value
Throws:
EvaluationException - if there is a problem during evaluation

setValue

public void setValue(Object rootObject,
                     Object value)
              throws EvaluationException
Description copied from interface: Expression
Set this expression in the provided context to the value provided.

Specified by:
setValue in interface Expression
Parameters:
rootObject - the root object against which to evaluate the expression
value - the new value
Throws:
EvaluationException - if there is a problem during evaluation

setValue

public void setValue(EvaluationContext context,
                     Object rootObject,
                     Object value)
              throws EvaluationException
Description copied from interface: Expression
Set this expression in the provided context to the value provided. The supplied root object overrides any specified in the context.

Specified by:
setValue in interface Expression
Parameters:
context - the context in which to set the value of the expression
rootObject - the root object against which to evaluate the expression
value - the new value
Throws:
EvaluationException - if there is a problem during evaluation

getAST

public SpelNode getAST()
Returns:
return the Abstract Syntax Tree for the expression

toStringAST

public String toStringAST()
Produce a string representation of the Abstract Syntax Tree for the expression, this should ideally look like the input expression, but properly formatted since any unnecessary whitespace will have been discarded during the parse of the expression.

Returns:
the string representation of the AST

getEvaluationContext

public EvaluationContext getEvaluationContext()
Return the default evaluation context that will be used if none is supplied on an evaluation call

Returns:
the default evaluation context

setEvaluationContext

public void setEvaluationContext(EvaluationContext context)
Set the evaluation context that will be used if none is specified on an evaluation call.

Parameters:
context - an evaluation context
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


SpelExpressionParser

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.expression.spel.standard
Class SpelExpressionParser

java.lang.Object
    extended by  org.springframework.expression.common.TemplateAwareExpressionParser
        extended by  org.springframework.expression.spel.standard.SpelExpressionParser
All Implemented Interfaces:
ExpressionParser
public class SpelExpressionParser
extends TemplateAwareExpressionParser

SpEL parser. Instances are reusable and thread-safe.

Since:
3.0
Author:
Andy Clement, Juergen Hoeller

Constructor Summary
SpelExpressionParser()
Create a parser with standard configuration.
SpelExpressionParser(SpelParserConfiguration configuration)
Create a parser with some configured behavior.
Method Summary
protected SpelExpression | doParseExpression(String expressionString, ParserContext context) Actually parse the expression string and return an Expression object.
SpelExpression | parseRaw(String expressionString)
Methods inherited from class org.springframework.expression.common.TemplateAwareExpressionParser
parseExpression, parseExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SpelExpressionParser

public SpelExpressionParser()
Create a parser with standard configuration.

SpelExpressionParser

public SpelExpressionParser(SpelParserConfiguration configuration)
Create a parser with some configured behavior.

Parameters:
configuration - custom configuration options
Method Detail

doParseExpression

protected SpelExpression doParseExpression(String expressionString,
                                           ParserContext context)
                                    throws ParseException
Description copied from class: TemplateAwareExpressionParser
Actually parse the expression string and return an Expression object.

Specified by:
doParseExpression in class TemplateAwareExpressionParser
Parameters:
expressionString - the raw expression string to parse
context - a context for influencing this expression parsing routine (optional)
Returns:
an evaluator for the parsed expression
Throws:
ParseException - an exception occurred during parsing

parseRaw

public SpelExpression parseRaw(String expressionString)
                        throws ParseException
Throws:
ParseException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.expression.spel.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.expression.spel.support

Class Summary
BooleanTypedValue |
ReflectionHelper | Utility methods used by the reflection resolver code to discover the appropriae methods/constructors and fields that should be used in expressions.
ReflectionHelper.ArgumentsMatchInfo | An instance of ArgumentsMatchInfo describes what kind of match was achieved between two sets of arguments - the set that a method/constructor is expecting and the set that are being supplied at the point of invocation.
ReflectiveConstructorResolver | A constructor resolver that uses reflection to locate the constructor that should be invoked
ReflectiveMethodResolver | A method resolver that uses reflection to locate the method that should be invoked
ReflectivePropertyAccessor | Simple PropertyAccessor that uses reflection to access properties for reading and writing.
StandardEvaluationContext | Provides a default EvaluationContext implementation.
StandardOperatorOverloader |
StandardTypeComparator | A simple basic TypeComparator implementation.
StandardTypeConverter | Default implementation of the TypeConverter interface, delegating to a core Spring ConversionService.
StandardTypeLocator | A default implementation of a TypeLocator that uses the context classloader (or any classloader set upon it).

Enum Summary
ReflectionHelper.ArgsMatchKind


org.springframework.expression.spel.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.expression.spel.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.expression.spel.support.ReflectionHelper
    • org.springframework.expression.spel.support.ReflectionHelper.ArgumentsMatchInfo
    • org.springframework.expression.spel.support.ReflectiveConstructorResolver (implements org.springframework.expression.ConstructorResolver)
    • org.springframework.expression.spel.support.ReflectiveMethodResolver (implements org.springframework.expression.MethodResolver)
    • org.springframework.expression.spel.support.ReflectivePropertyAccessor (implements org.springframework.expression.PropertyAccessor)
    • org.springframework.expression.spel.support.StandardEvaluationContext (implements org.springframework.expression.EvaluationContext)
    • org.springframework.expression.spel.support.StandardOperatorOverloader (implements org.springframework.expression.OperatorOverloader)
    • org.springframework.expression.spel.support.StandardTypeComparator (implements org.springframework.expression.TypeComparator)
    • org.springframework.expression.spel.support.StandardTypeConverter (implements org.springframework.expression.TypeConverter)
    • org.springframework.expression.spel.support.StandardTypeLocator (implements org.springframework.expression.TypeLocator)
    • org.springframework.expression.TypedValue
      • org.springframework.expression.spel.support.BooleanTypedValue

Enum Hierarchy

  • java.lang.Object
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)
      • org.springframework.expression.spel.support.ReflectionHelper.ArgsMatchKind


BooleanTypedValue

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.expression.spel.support
Class BooleanTypedValue

java.lang.Object
    extended by  org.springframework.expression.TypedValue
        extended by  org.springframework.expression.spel.support.BooleanTypedValue

public class BooleanTypedValue
extends TypedValue

Since:
3.0
Author:
Andy Clement

Field Summary
static BooleanTypedValue | FALSE
static BooleanTypedValue | TRUE
Fields inherited from class org.springframework.expression.TypedValue
NULL
Method Summary
static BooleanTypedValue forValue(boolean b)
Methods inherited from class org.springframework.expression.TypedValue
getTypeDescriptor, getValue, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

TRUE

public static final BooleanTypedValue TRUE

FALSE

public static final BooleanTypedValue FALSE
Method Detail

forValue

public static BooleanTypedValue forValue(boolean b)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ReflectionHelper

org.springframework.expression.spel.support
Class ReflectionHelper

java.lang.Object
    extended by  org.springframework.expression.spel.support.ReflectionHelper

public class ReflectionHelper
extends Object

Utility methods used by the reflection resolver code to discover the appropriae methods/constructors and fields that should be used in expressions.

Since:
3.0
Author:
Andy Clement, Juergen Hoeller

Nested Class Summary
static class | ReflectionHelper.ArgsMatchKind
static class | ReflectionHelper.ArgumentsMatchInfo An instance of ArgumentsMatchInfo describes what kind of match was achieved between two sets of arguments - the set that a method/constructor is expecting and the set that are being supplied at the point of invocation.
Constructor Summary
ReflectionHelper()
Method Summary
static ReflectionHelper.ArgumentsMatchInfo | compareArguments(Class[] expectedArgTypes, Class[] suppliedArgTypes, TypeConverter typeConverter) Compare argument arrays and return information about whether they match.
static ReflectionHelper.ArgumentsMatchInfo | compareArgumentsVarargs(Class[] expectedArgTypes, Class[] suppliedArgTypes, TypeConverter typeConverter) Compare argument arrays and return information about whether they match.
static void | convertAllArguments(Class[] parameterTypes, boolean isVarargs, TypeConverter converter, Object[] arguments) Convert a supplied set of arguments into the requested types.
static void | convertArguments(Class[] requiredParameterTypes, boolean isVarargs, TypeConverter converter, int[] argumentsRequiringConversion, Object[] arguments) Takes an input set of argument values and, following the positions specified in the int array, it converts them to the types specified as the required parameter types.
static Object[] | setupArgumentsForVarargsInvocation(Class[] requiredParameterTypes, Object... args) Package up the arguments so that they correctly match what is expected in parameterTypes.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ReflectionHelper

public ReflectionHelper()
Method Detail

compareArguments

public static ReflectionHelper.ArgumentsMatchInfo compareArguments(Class[] expectedArgTypes,
                                                                   Class[] suppliedArgTypes,
                                                                   TypeConverter typeConverter)
Compare argument arrays and return information about whether they match. A supplied type converter and conversionAllowed flag allow for matches to take into account that a type may be transformed into a different type by the converter.

Parameters:
expectedArgTypes - the array of types the method/constructor is expecting
suppliedArgTypes - the array of types that are being supplied at the point of invocation
typeConverter - a registered type converter
Returns:
a MatchInfo object indicating what kind of match it was or null if it was not a match

compareArgumentsVarargs

public static ReflectionHelper.ArgumentsMatchInfo compareArgumentsVarargs(Class[] expectedArgTypes,
                                                                          Class[] suppliedArgTypes,
                                                                          TypeConverter typeConverter)
Compare argument arrays and return information about whether they match. A supplied type converter and conversionAllowed flag allow for matches to take into account that a type may be transformed into a different type by the converter. This variant of compareArguments also allows for a varargs match.

Parameters:
expectedArgTypes - the array of types the method/constructor is expecting
suppliedArgTypes - the array of types that are being supplied at the point of invocation
typeConverter - a registered type converter
Returns:
a MatchInfo object indicating what kind of match it was or null if it was not a match

convertArguments

public static void convertArguments(Class[] requiredParameterTypes,
                                    boolean isVarargs,
                                    TypeConverter converter,
                                    int[] argumentsRequiringConversion,
                                    Object[] arguments)
                             throws EvaluationException
Takes an input set of argument values and, following the positions specified in the int array, it converts them to the types specified as the required parameter types. The arguments are converted 'in-place' in the input array.

Parameters:
requiredParameterTypes - the types that the caller would like to have
isVarargs - whether the requiredParameterTypes is a varargs list
converter - the type converter to use for attempting conversions
argumentsRequiringConversion - details which of the input arguments need conversion
arguments - the actual arguments that need conversion
Throws:
EvaluationException - if a problem occurs during conversion

convertAllArguments

public static void convertAllArguments(Class[] parameterTypes,
                                       boolean isVarargs,
                                       TypeConverter converter,
                                       Object[] arguments)
                                throws SpelEvaluationException
Convert a supplied set of arguments into the requested types. If the parameterTypes are related to a varargs method then the final entry in the parameterTypes array is going to be an array itself whose component type should be used as the conversion target for extraneous arguments. (For example, if the parameterTypes are {Integer, String[]} and the input arguments are {Integer, boolean, float} then both the boolean and float must be converted to strings). This method does not repackage the arguments into a form suitable for the varargs invocation

Parameters:
parameterTypes - the types to be converted to
isVarargs - whether parameterTypes relates to a varargs method
converter - the converter to use for type conversions
arguments - the arguments to convert to the requested parameter types
Throws:
SpelEvaluationException - if there is a problem with conversion

setupArgumentsForVarargsInvocation

public static Object[] setupArgumentsForVarargsInvocation(Class[] requiredParameterTypes,
                                                          Object... args)
Package up the arguments so that they correctly match what is expected in parameterTypes. For example, if parameterTypes is (int, String[]) because the second parameter was declared String... then if arguments is [1,"a","b"] then it must be repackaged as [1,new String[]{"a","b"}] in order to match the expected parameterTypes.

Parameters:
requiredParameterTypes - the types of the parameters for the invocation
args - the arguments to be setup ready for the invocation
Returns:
a repackaged array of arguments where any varargs setup has been done
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ReflectionHelper.ArgsMatchKind

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

org.springframework.expression.spel.support
Enum ReflectionHelper.ArgsMatchKind

java.lang.Object
    extended by  java.lang.Enum<ReflectionHelper.ArgsMatchKind>
        extended by  org.springframework.expression.spel.support.ReflectionHelper.ArgsMatchKind
All Implemented Interfaces:
Serializable, Comparable<ReflectionHelper.ArgsMatchKind>
Enclosing class:
ReflectionHelper
public static enum ReflectionHelper.ArgsMatchKind
extends Enum<ReflectionHelper.ArgsMatchKind>

Enum Constant Summary
CLOSE
EXACT
REQUIRES_CONVERSION
Method Summary
static ReflectionHelper.ArgsMatchKind | valueOf(String name) Returns the enum constant of this type with the specified name.
static ReflectionHelper.ArgsMatchKind[] | values() Returns an array containing the constants of this enum type, in the order they are declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

EXACT

public static final ReflectionHelper.ArgsMatchKind EXACT

CLOSE

public static final ReflectionHelper.ArgsMatchKind CLOSE

REQUIRES_CONVERSION

public static final ReflectionHelper.ArgsMatchKind REQUIRES_CONVERSION
Method Detail

values

public static ReflectionHelper.ArgsMatchKind[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ReflectionHelper.ArgsMatchKind c : ReflectionHelper.ArgsMatchKind.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static ReflectionHelper.ArgsMatchKind valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


ReflectionHelper.ArgumentsMatchInfo

org.springframework.expression.spel.support
Class ReflectionHelper.ArgumentsMatchInfo

java.lang.Object
    extended by  org.springframework.expression.spel.support.ReflectionHelper.ArgumentsMatchInfo
Enclosing class:
ReflectionHelper
public static class ReflectionHelper.ArgumentsMatchInfo
extends Object

An instance of ArgumentsMatchInfo describes what kind of match was achieved between two sets of arguments - the set that a method/constructor is expecting and the set that are being supplied at the point of invocation. If the kind indicates that conversion is required for some of the arguments then the arguments that require conversion are listed in the argsRequiringConversion array.

Field Summary
int[] | argsRequiringConversion
ReflectionHelper.ArgsMatchKind | kind
Method Summary
boolean | isCloseMatch()
boolean | isExactMatch()
boolean | isMatchRequiringConversion()
String | toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

kind

public final ReflectionHelper.ArgsMatchKind kind

argsRequiringConversion

public int[] argsRequiringConversion
Method Detail

isExactMatch

public boolean isExactMatch()

isCloseMatch

public boolean isCloseMatch()

isMatchRequiringConversion

public boolean isMatchRequiringConversion()

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ReflectiveConstructorResolver

org.springframework.expression.spel.support
Class ReflectiveConstructorResolver

java.lang.Object
    extended by  org.springframework.expression.spel.support.ReflectiveConstructorResolver
All Implemented Interfaces:
ConstructorResolver
public class ReflectiveConstructorResolver
extends Object
implements ConstructorResolver

A constructor resolver that uses reflection to locate the constructor that should be invoked

Since:
3.0
Author:
Andy Clement, Juergen Hoeller

Constructor Summary
ReflectiveConstructorResolver()
Method Summary
 ConstructorExecutor resolve(EvaluationContext context, String typename, Class<?>[] argumentTypes)
Locate a constructor on the type.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ReflectiveConstructorResolver

public ReflectiveConstructorResolver()
Method Detail

resolve

public ConstructorExecutor resolve(EvaluationContext context,
                                   String typename,
                                   Class<?>[] argumentTypes)
                            throws AccessException
Locate a constructor on the type. There are three kinds of match that might occur:
  1. An exact match where the types of the arguments match the types of the constructor
  2. An in-exact match where the types we are looking for are subtypes of those defined on the constructor
  3. A match where we are able to convert the arguments into those expected by the constructor, according to the registered type converter.

Specified by:
resolve in interface ConstructorResolver
Parameters:
context - the current evaluation context
typename - the type upon which to look for the constructor
argumentTypes - the arguments that the constructor must be able to handle
Returns:
a ConstructorExecutor that can invoke the constructor, or null if non found
Throws:
AccessException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ReflectiveMethodResolver

org.springframework.expression.spel.support
Class ReflectiveMethodResolver

java.lang.Object
    extended by  org.springframework.expression.spel.support.ReflectiveMethodResolver
All Implemented Interfaces:
MethodResolver
public class ReflectiveMethodResolver
extends Object
implements MethodResolver

A method resolver that uses reflection to locate the method that should be invoked

Since:
3.0
Author:
Andy Clement

Constructor Summary
ReflectiveMethodResolver()
Method Summary
void | registerMethodFilter(Class<?> type, MethodFilter filter)
MethodExecutor | resolve(EvaluationContext context, Object targetObject, String name, Class<?>[] argumentTypes) Locate a method on a type.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ReflectiveMethodResolver

public ReflectiveMethodResolver()
Method Detail

resolve

public MethodExecutor resolve(EvaluationContext context,
                              Object targetObject,
                              String name,
                              Class<?>[] argumentTypes)
                       throws AccessException
Locate a method on a type. There are three kinds of match that might occur:
  1. An exact match where the types of the arguments match the types of the constructor
  2. An in-exact match where the types we are looking for are subtypes of those defined on the constructor
  3. A match where we are able to convert the arguments into those expected by the constructor, according to the registered type converter.

Specified by:
resolve in interface MethodResolver
Parameters:
context - the current evaluation context
targetObject - the object upon which the method is being called
argumentTypes - the arguments that the constructor must be able to handle
Returns:
a MethodExecutor that can invoke the method, or null if the method cannot be found
Throws:
AccessException

registerMethodFilter

public void registerMethodFilter(Class<?> type,
                                 MethodFilter filter)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ReflectivePropertyAccessor

org.springframework.expression.spel.support
Class ReflectivePropertyAccessor

java.lang.Object
    extended by  org.springframework.expression.spel.support.ReflectivePropertyAccessor
All Implemented Interfaces:
PropertyAccessor
public class ReflectivePropertyAccessor
extends Object
implements PropertyAccessor

Simple PropertyAccessor that uses reflection to access properties for reading and writing. A property can be accessed if it is accessible as a field on the object or through a getter (if being read) or a setter (if being written).

Since:
3.0
Author:
Andy Clement, Juergen Hoeller

Field Summary
protected Map<org.springframework.expression.spel.support.ReflectivePropertyAccessor.CacheKey,org.springframework.expression.spel.support.ReflectivePropertyAccessor.InvokerPair> | readerCache
protected Map<org.springframework.expression.spel.support.ReflectivePropertyAccessor.CacheKey,TypeDescriptor> | typeDescriptorCache
protected Map<org.springframework.expression.spel.support.ReflectivePropertyAccessor.CacheKey,Member> | writerCache
Constructor Summary
ReflectivePropertyAccessor()
Method Summary
boolean | canRead(EvaluationContext context, Object target, String name) Called to determine if a resolver instance is able to access a specified property on a specified target object.
boolean | canWrite(EvaluationContext context, Object target, String name) Called to determine if a resolver instance is able to write to a specified property on a specified target object.
PropertyAccessor | createOptimalAccessor(EvaluationContext eContext, Object target, String name) Attempt to create an optimized property accessor tailored for a property of a particular name on a particular class.
protected Field | findField(String name, Class<?> clazz, boolean mustBeStatic) Find a field of a certain name on a specified class
protected Method | findGetterForProperty(String propertyName, Class<?> clazz, boolean mustBeStatic) Find a getter method for the specified property.
protected Method | findSetterForProperty(String propertyName, Class<?> clazz, boolean mustBeStatic) Find a setter method for the specified property.
Class<?>[] | getSpecificTargetClasses() Return an array of classes for which this resolver should be called.
TypedValue | read(EvaluationContext context, Object target, String name) Called to read a property from a specified target object
void | write(EvaluationContext context, Object target, String name, Object newValue) Called to write to a property on a specified target object.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

readerCache

protected Map<org.springframework.expression.spel.support.ReflectivePropertyAccessor.CacheKey,org.springframework.expression.spel.support.ReflectivePropertyAccessor.InvokerPair> readerCache

writerCache

protected Map<org.springframework.expression.spel.support.ReflectivePropertyAccessor.CacheKey,Member> writerCache

typeDescriptorCache

protected Map<org.springframework.expression.spel.support.ReflectivePropertyAccessor.CacheKey,TypeDescriptor> typeDescriptorCache
Constructor Detail

ReflectivePropertyAccessor

public ReflectivePropertyAccessor()
Method Detail

getSpecificTargetClasses

public Class<?>[] getSpecificTargetClasses()
Description copied from interface: PropertyAccessor
Return an array of classes for which this resolver should be called. Returning null indicates this is a general resolver that can be called in an attempt to resolve a property on any type.

Specified by:
getSpecificTargetClasses in interface PropertyAccessor
Returns:
null which means this is a general purpose accessor

canRead

public boolean canRead(EvaluationContext context,
                       Object target,
                       String name)
                throws AccessException
Description copied from interface: PropertyAccessor
Called to determine if a resolver instance is able to access a specified property on a specified target object.

Specified by:
canRead in interface PropertyAccessor
Parameters:
context - the evaluation context in which the access is being attempted
target - the target object upon which the property is being accessed
name - the name of the property being accessed
Returns:
true if this resolver is able to read the property
Throws:
AccessException - if there is any problem determining whether the property can be read

read

public TypedValue read(EvaluationContext context,
                       Object target,
                       String name)
                throws AccessException
Description copied from interface: PropertyAccessor
Called to read a property from a specified target object

Specified by:
read in interface PropertyAccessor
Parameters:
context - the evaluation context in which the access is being attempted
target - the target object upon which the property is being accessed
name - the name of the property being accessed
Returns:
a TypedValue object wrapping the property value read and a type descriptor for it
Throws:
AccessException - if there is any problem accessing the property value

canWrite

public boolean canWrite(EvaluationContext context,
                        Object target,
                        String name)
                 throws AccessException
Description copied from interface: PropertyAccessor
Called to determine if a resolver instance is able to write to a specified property on a specified target object.

Specified by:
canWrite in interface PropertyAccessor
Parameters:
context - the evaluation context in which the access is being attempted
target - the target object upon which the property is being accessed
name - the name of the property being accessed
Returns:
true if this resolver is able to write to the property
Throws:
AccessException - if there is any problem determining whether the property can be written to

write

public void write(EvaluationContext context,
                  Object target,
                  String name,
                  Object newValue)
           throws AccessException
Description copied from interface: PropertyAccessor
Called to write to a property on a specified target object. Should only succeed if canWrite() also returns true.

Specified by:
write in interface PropertyAccessor
Parameters:
context - the evaluation context in which the access is being attempted
target - the target object upon which the property is being accessed
name - the name of the property being accessed
newValue - the new value for the property
Throws:
AccessException - if there is any problem writing to the property value

findGetterForProperty

protected Method findGetterForProperty(String propertyName,
                                       Class<?> clazz,
                                       boolean mustBeStatic)
Find a getter method for the specified property. A getter is defined as a method whose name start with the prefix 'get' and the rest of the name is the same as the property name (with the first character uppercased).

findSetterForProperty

protected Method findSetterForProperty(String propertyName,
                                       Class<?> clazz,
                                       boolean mustBeStatic)
Find a setter method for the specified property.

findField

protected Field findField(String name,
                          Class<?> clazz,
                          boolean mustBeStatic)
Find a field of a certain name on a specified class

createOptimalAccessor

public PropertyAccessor createOptimalAccessor(EvaluationContext eContext,
                                              Object target,
                                              String name)
Attempt to create an optimized property accessor tailored for a property of a particular name on a particular class. The general ReflectivePropertyAccessor will always work but is not optimal due to the need to lookup which reflective member (method/field) to use each time read() is called. This method will just return the ReflectivePropertyAccessor instance if it is unable to build something more optimal.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StandardEvaluationContext

org.springframework.expression.spel.support
Class StandardEvaluationContext

java.lang.Object
    extended by  org.springframework.expression.spel.support.StandardEvaluationContext
All Implemented Interfaces:
EvaluationContext
public class StandardEvaluationContext
extends Object
implements EvaluationContext

Provides a default EvaluationContext implementation.

To resolve properties/methods/fields this context uses a reflection mechanism.

Since:
3.0
Author:
Andy Clement, Juergen Hoeller

Constructor Summary
StandardEvaluationContext()
StandardEvaluationContext(Object rootObject)
Method Summary
void | addConstructorResolver(ConstructorResolver resolver)
void | addMethodResolver(MethodResolver resolver)
void | addPropertyAccessor(PropertyAccessor accessor)
List<ConstructorResolver> | getConstructorResolvers()
List<MethodResolver> | getMethodResolvers()
OperatorOverloader | getOperatorOverloader()
List<PropertyAccessor> | getPropertyAccessors()
TypedValue | getRootObject()
TypeComparator | getTypeComparator()
TypeConverter | getTypeConverter()
TypeLocator | getTypeLocator()
Object | lookupVariable(String name) Look up a named variable within this evaluation context.
void | registerFunction(String name, Method method)
void | registerMethodFilter(Class<?> type, MethodFilter filter) Register a MethodFilter which will be called during method resolution for the specified type.
boolean | removeConstructorResolver(ConstructorResolver resolver)
boolean | removeMethodResolver(MethodResolver methodResolver)
boolean | removePropertyAccessor(PropertyAccessor accessor)
void | setConstructorResolvers(List<ConstructorResolver> constructorResolvers)
void | setMethodResolvers(List<MethodResolver> methodResolvers)
void | setOperatorOverloader(OperatorOverloader operatorOverloader)
void | setPropertyAccessors(List<PropertyAccessor> propertyAccessors)
void | setRootObject(Object rootObject)
void | setRootObject(Object rootObject, TypeDescriptor typeDescriptor)
void | setTypeComparator(TypeComparator typeComparator)
void | setTypeConverter(TypeConverter typeConverter)
void | setTypeLocator(TypeLocator typeLocator)
void | setVariable(String name, Object value) Set a named variable within this evaluation context to a specified value.
void | setVariables(Map<String,Object> variables)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

StandardEvaluationContext

public StandardEvaluationContext()

StandardEvaluationContext

public StandardEvaluationContext(Object rootObject)
Method Detail

setRootObject

public void setRootObject(Object rootObject)

setRootObject

public void setRootObject(Object rootObject,
                          TypeDescriptor typeDescriptor)

getRootObject

public TypedValue getRootObject()
Specified by:
getRootObject in interface EvaluationContext
Returns:
the default root context object against which unqualified properties/methods/etc should be resolved. This can be overridden when evaluating an expression.

addConstructorResolver

public void addConstructorResolver(ConstructorResolver resolver)

removeConstructorResolver

public boolean removeConstructorResolver(ConstructorResolver resolver)

getConstructorResolvers

public List<ConstructorResolver> getConstructorResolvers()
Specified by:
getConstructorResolvers in interface EvaluationContext
Returns:
a list of resolvers that will be asked in turn to locate a constructor

setConstructorResolvers

public void setConstructorResolvers(List<ConstructorResolver> constructorResolvers)

addMethodResolver

public void addMethodResolver(MethodResolver resolver)

removeMethodResolver

public boolean removeMethodResolver(MethodResolver methodResolver)

getMethodResolvers

public List<MethodResolver> getMethodResolvers()
Specified by:
getMethodResolvers in interface EvaluationContext
Returns:
a list of resolvers that will be asked in turn to locate a method

setMethodResolvers

public void setMethodResolvers(List<MethodResolver> methodResolvers)

addPropertyAccessor

public void addPropertyAccessor(PropertyAccessor accessor)

removePropertyAccessor

public boolean removePropertyAccessor(PropertyAccessor accessor)

getPropertyAccessors

public List<PropertyAccessor> getPropertyAccessors()
Specified by:
getPropertyAccessors in interface EvaluationContext
Returns:
a list of accessors that will be asked in turn to read/write a property

setPropertyAccessors

public void setPropertyAccessors(List<PropertyAccessor> propertyAccessors)

setTypeLocator

public void setTypeLocator(TypeLocator typeLocator)

getTypeLocator

public TypeLocator getTypeLocator()
Specified by:
getTypeLocator in interface EvaluationContext
Returns:
a type locator that can be used to find types, either by short or fully qualified name.

setTypeConverter

public void setTypeConverter(TypeConverter typeConverter)

getTypeConverter

public TypeConverter getTypeConverter()
Specified by:
getTypeConverter in interface EvaluationContext
Returns:
a type converter that can convert (or coerce) a value from one type to another.

setTypeComparator

public void setTypeComparator(TypeComparator typeComparator)

getTypeComparator

public TypeComparator getTypeComparator()
Specified by:
getTypeComparator in interface EvaluationContext
Returns:
a type comparator for comparing pairs of objects for equality.

setOperatorOverloader

public void setOperatorOverloader(OperatorOverloader operatorOverloader)

getOperatorOverloader

public OperatorOverloader getOperatorOverloader()
Specified by:
getOperatorOverloader in interface EvaluationContext
Returns:
an operator overloader that may support mathematical operations between more than the standard set of types

setVariable

public void setVariable(String name,
                        Object value)
Description copied from interface: EvaluationContext
Set a named variable within this evaluation context to a specified value.

Specified by:
setVariable in interface EvaluationContext
Parameters:
name - variable to set
value - value to be placed in the variable

setVariables

public void setVariables(Map<String,Object> variables)

registerFunction

public void registerFunction(String name,
                             Method method)

lookupVariable

public Object lookupVariable(String name)
Description copied from interface: EvaluationContext
Look up a named variable within this evaluation context.

Specified by:
lookupVariable in interface EvaluationContext
Parameters:
name - variable to lookup
Returns:
the value of the variable

registerMethodFilter

public void registerMethodFilter(Class<?> type,
                                 MethodFilter filter)
Register a MethodFilter which will be called during method resolution for the specified type. The MethodFilter may remove methods and/or sort the methods which will then be used by SpEL as the candidates to look through for a match.

Parameters:
type - the type for which the filter should be called
filter - a MethodFilter, or NULL to deregister a filter for the type
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StandardOperatorOverloader

org.springframework.expression.spel.support
Class StandardOperatorOverloader

java.lang.Object
    extended by  org.springframework.expression.spel.support.StandardOperatorOverloader
All Implemented Interfaces:
OperatorOverloader
public class StandardOperatorOverloader
extends Object
implements OperatorOverloader

Since:
3.0
Author:
Juergen Hoeller

Constructor Summary
StandardOperatorOverloader()
Method Summary
Object | operate(Operation operation, Object leftOperand, Object rightOperand) Execute the specified operation on two operands, returning a result.
boolean | overridesOperation(Operation operation, Object leftOperand, Object rightOperand) Return true if the operator overloader supports the specified operation between the two operands and so should be invoked to handle it.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

StandardOperatorOverloader

public StandardOperatorOverloader()
Method Detail

overridesOperation

public boolean overridesOperation(Operation operation,
                                  Object leftOperand,
                                  Object rightOperand)
                           throws EvaluationException
Description copied from interface: OperatorOverloader
Return true if the operator overloader supports the specified operation between the two operands and so should be invoked to handle it.

Specified by:
overridesOperation in interface OperatorOverloader
Parameters:
operation - the operation to be performed
leftOperand - the left operand
rightOperand - the right operand
Returns:
true if the OperatorOverloader supports the specified operation between the two operands
Throws:
EvaluationException - if there is a problem performing the operation

operate

public Object operate(Operation operation,
                      Object leftOperand,
                      Object rightOperand)
               throws EvaluationException
Description copied from interface: OperatorOverloader
Execute the specified operation on two operands, returning a result. See Operation for supported operations.

Specified by:
operate in interface OperatorOverloader
Parameters:
operation - the operation to be performed
leftOperand - the left operand
rightOperand - the right operand
Returns:
the result of performing the operation on the two operands
Throws:
EvaluationException - if there is a problem performing the operation
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StandardTypeComparator

org.springframework.expression.spel.support
Class StandardTypeComparator

java.lang.Object
    extended by  org.springframework.expression.spel.support.StandardTypeComparator
All Implemented Interfaces:
TypeComparator
public class StandardTypeComparator
extends Object
implements TypeComparator

A simple basic TypeComparator implementation. It supports comparison of numbers and types implementing Comparable.

Since:
3.0
Author:
Andy Clement, Juergen Hoeller

Constructor Summary
StandardTypeComparator()
Method Summary
boolean | canCompare(Object left, Object right) Return true if the comparator can compare these two objects
int | compare(Object left, Object right) Compare two objects.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

StandardTypeComparator

public StandardTypeComparator()
Method Detail

compare

public int compare(Object left,
                   Object right)
            throws SpelEvaluationException
Description copied from interface: TypeComparator
Compare two objects.

Specified by:
compare in interface TypeComparator
Parameters:
left - the first object
right - the second object
Returns:
0 if they are equal, <0 if the first is smaller than the second, or >0 if the first is larger than the second
Throws:
SpelEvaluationException

canCompare

public boolean canCompare(Object left,
                          Object right)
Description copied from interface: TypeComparator
Return true if the comparator can compare these two objects

Specified by:
canCompare in interface TypeComparator
Parameters:
left - the first object
right - the second object
Returns:
true if the comparator can compare these objects
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StandardTypeConverter

org.springframework.expression.spel.support
Class StandardTypeConverter

java.lang.Object
    extended by  org.springframework.expression.spel.support.StandardTypeConverter
All Implemented Interfaces:
TypeConverter
public class StandardTypeConverter
extends Object
implements TypeConverter

Default implementation of the TypeConverter interface, delegating to a core Spring ConversionService.

Since:
3.0
Author:
Juergen Hoeller, Andy Clement
See Also:
ConversionService

Constructor Summary
StandardTypeConverter()
StandardTypeConverter(ConversionService conversionService)
Method Summary
boolean | canConvert(Class<?> sourceType, Class<?> targetType) Return true if the type converter can convert the specified type to the desired target type.
boolean | canConvert(TypeDescriptor sourceType, TypeDescriptor targetType) Return true if the type converter can convert the specified type to the desired target type.
Object | convertValue(Object value, TypeDescriptor sourceType, TypeDescriptor targetType) Convert (may coerce) a value from one type to another, for example from a boolean to a string.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

StandardTypeConverter

public StandardTypeConverter()

StandardTypeConverter

public StandardTypeConverter(ConversionService conversionService)
Method Detail

canConvert

public boolean canConvert(Class<?> sourceType,
                          Class<?> targetType)
Description copied from interface: TypeConverter
Return true if the type converter can convert the specified type to the desired target type.

Specified by:
canConvert in interface TypeConverter
Parameters:
sourceType - the type to be converted from
targetType - the type to be converted to
Returns:
true if that conversion can be performed

canConvert

public boolean canConvert(TypeDescriptor sourceType,
                          TypeDescriptor targetType)
Description copied from interface: TypeConverter
Return true if the type converter can convert the specified type to the desired target type.

Specified by:
canConvert in interface TypeConverter
Parameters:
sourceType - a type descriptor that describes the source type
targetType - a type descriptor that describes the requested result type
Returns:
true if that conversion can be performed

convertValue

public Object convertValue(Object value,
                           TypeDescriptor sourceType,
                           TypeDescriptor targetType)
Description copied from interface: TypeConverter
Convert (may coerce) a value from one type to another, for example from a boolean to a string. The typeDescriptor parameter enables support for typed collections - if the caller really wishes they can have a List for example, rather than simply a List.

Specified by:
convertValue in interface TypeConverter
Parameters:
value - the value to be converted
sourceType - a type descriptor that supplies extra information about the source object
targetType - a type descriptor that supplies extra information about the requested result type
Returns:
the converted value
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StandardTypeLocator

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.expression.spel.support
Class StandardTypeLocator

java.lang.Object
    extended by  org.springframework.expression.spel.support.StandardTypeLocator
All Implemented Interfaces:
TypeLocator
public class StandardTypeLocator
extends Object
implements TypeLocator

A default implementation of a TypeLocator that uses the context classloader (or any classloader set upon it). It supports 'well known' packages so if a type cannot be found it will try the registered imports to locate it.

Since:
3.0
Author:
Andy Clement, Juergen Hoeller

Constructor Summary
StandardTypeLocator()
StandardTypeLocator(ClassLoader loader)
Method Summary
Class<?> | findType(String typename) Find a (possibly unqualified) type reference - first using the typename as is, then trying any registered prefixes if the typename cannot be found.
List<String> | getImportPrefixes() Return a list of all the import prefixes registered with this StandardTypeLocator.
void | registerImport(String prefix) Register a new import prefix that will be used when searching for unqualified types.
void | removeImport(String prefix)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

StandardTypeLocator

public StandardTypeLocator()

StandardTypeLocator

public StandardTypeLocator(ClassLoader loader)
Method Detail

findType

public Class<?> findType(String typename)
                  throws EvaluationException
Find a (possibly unqualified) type reference - first using the typename as is, then trying any registered prefixes if the typename cannot be found.

Specified by:
findType in interface TypeLocator
Parameters:
typename - the type to locate
Returns:
the class object for the type
Throws:
EvaluationException - if the type cannot be found

registerImport

public void registerImport(String prefix)
Register a new import prefix that will be used when searching for unqualified types. Expected format is something like "java.lang".

Parameters:
prefix - the prefix to register

getImportPrefixes

public List<String> getImportPrefixes()
Return a list of all the import prefixes registered with this StandardTypeLocator.

Returns:
list of registered import prefixes

removeImport

public void removeImport(String prefix)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.format

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.format

An API for defining Formatters to format field model values for display in a UI.

See:
Description

Interface Summary
AnnotationFormatterFactory<A extends Annotation> | A factory that creates formatters to format values of fields annotated with a particular Annotation.
Formatter<T> | Formats objects of type T.
FormatterRegistry | A registry of field formatting logic.
Parser<T> | Parses text strings to produce instances of T.
Printer<T> | Prints objects of type T for display.

Package org.springframework.format Description

An API for defining Formatters to format field model values for display in a UI.


org.springframework.format Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.format

Package Hierarchies:
All Packages

Interface Hierarchy

  • org.springframework.format.AnnotationFormatterFactory<A>
  • org.springframework.core.convert.converter.ConverterRegistry
    • org.springframework.format.FormatterRegistry
  • org.springframework.format.Parser<T>
    • org.springframework.format.Formatter<T> (also extends org.springframework.format.Printer<T>)
  • org.springframework.format.Printer<T>
    • org.springframework.format.Formatter<T> (also extends org.springframework.format.Parser<T>)


AnnotationFormatterFactory

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.format
Interface AnnotationFormatterFactory<A extends Annotation>

Type Parameters:
A - the annotation type that should trigger formatting
All Known Implementing Classes:
JodaDateTimeFormatAnnotationFormatterFactory, NumberFormatAnnotationFormatterFactory
public interface AnnotationFormatterFactory<A extends Annotation>

A factory that creates formatters to format values of fields annotated with a particular Annotation.

For example, a DateTimeFormatAnnotationFormatterFactory might create a formatter that formats Date values set on fields annotated with @DateTimeFormat.

Since:
3.0
Author:
Keith Donald

Method Summary
Set<Class<?>> | getFieldTypes() The types of fields that may be annotated with the <A> annotation.
Parser<?> | getParser(A annotation, Class<?> fieldType) Get the Parser to parse a submitted value for a field of fieldType annotated with annotation.
Printer<?> | getPrinter(A annotation, Class<?> fieldType) Get the Printer to print the value of a field of fieldType annotated with annotation.

Method Detail

getFieldTypes

Set<Class<?>> getFieldTypes()
The types of fields that may be annotated with the <A> annotation.

getPrinter

Printer<?> getPrinter(A annotation,
                      Class<?> fieldType)
Get the Printer to print the value of a field of fieldType annotated with annotation. If the type <T> the printer accepts is not assignable to fieldType, a coersion from fieldType to <T> will be attempted before the Printer is invoked.

Parameters:
annotation - the annotation instance
fieldType - the type of field that was annotated
Returns:
the printer

getParser

Parser<?> getParser(A annotation,
                    Class<?> fieldType)
Get the Parser to parse a submitted value for a field of fieldType annotated with annotation. If the object the parser returns is not assignable to fieldType, a coersion to fieldType will be attempted before the field is set.

Parameters:
annotation - the annotation instance
fieldType - the type of field that was annotated
Returns:
the parser
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


Formatter

org.springframework.format
Interface Formatter<T>

Type Parameters:
T - the type of object this Formatter formats
All Superinterfaces:
Parser<T>, Printer<T>
All Known Implementing Classes:
AbstractNumberFormatter, CurrencyFormatter, DateFormatter, NumberFormatter, PercentFormatter
public interface Formatter<T>
extends Printer<T>, Parser<T>

Formats objects of type T. A Formatter is both a Printer and a Parser for an object type.

Since:
3.0
Author:
Keith Donald

Method Summary
Methods inherited from interface org.springframework.format.Printer
print
Methods inherited from interface org.springframework.format.Parser
parse

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FormatterRegistry

org.springframework.format
Interface FormatterRegistry

All Superinterfaces:
ConverterRegistry
All Known Implementing Classes:
FormattingConversionService
public interface FormatterRegistry
extends ConverterRegistry

A registry of field formatting logic.

Since:
3.0
Author:
Keith Donald, Juergen Hoeller

Method Summary
void | addFormatterForFieldAnnotation(AnnotationFormatterFactory<? extends Annotation> annotationFormatterFactory) Adds a Formatter to format fields annotated with a specific format annotation.
void | addFormatterForFieldType(Class<?> fieldType, Formatter<?> formatter) Adds a Formatter to format fields of a specific type.
void | addFormatterForFieldType(Class<?> fieldType, Printer<?> printer, Parser<?> parser) Adds a Printer/Parser pair to format fields of a specific type.
Methods inherited from interface org.springframework.core.convert.converter.ConverterRegistry
addConverter, addConverter, addConverterFactory, removeConvertible

Method Detail

addFormatterForFieldType

void addFormatterForFieldType(Class<?> fieldType,
                              Formatter<?> formatter)
Adds a Formatter to format fields of a specific type.

On print, if the Formatter's type T is declared and fieldType is not assignable to T, a coersion to T will be attempted before delegating to formatter to print a field value. On parse, if the parsed object returned by formatter is not assignable to the runtime field type, a coersion to the field type will be attempted before returning the parsed field value.

Parameters:
fieldType - the field type to format
formatter - the formatter to add

addFormatterForFieldType

void addFormatterForFieldType(Class<?> fieldType,
                              Printer<?> printer,
                              Parser<?> parser)
Adds a Printer/Parser pair to format fields of a specific type. The formatter will delegate to the specified printer for printing and the specified parser for parsing.

On print, if the Printer's type T is declared and fieldType is not assignable to T, a coersion to T will be attempted before delegating to printer to print a field value. On parse, if the object returned by the Parser is not assignable to the runtime field type, a coersion to the field type will be attempted before returning the parsed field value.

Parameters:
fieldType - the field type to format
printer - the printing part of the formatter
parser - the parsing part of the formatter

addFormatterForFieldAnnotation

void addFormatterForFieldAnnotation(AnnotationFormatterFactory<? extends Annotation> annotationFormatterFactory)
Adds a Formatter to format fields annotated with a specific format annotation.

Parameters:
annotationFormatterFactory - the annotation formatter factory to add
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Parser

org.springframework.format
Interface Parser<T>

Type Parameters:
T - the type of object this Parser produces
All Known Subinterfaces:
Formatter<T>
All Known Implementing Classes:
AbstractNumberFormatter, CurrencyFormatter, DateFormatter, DateTimeParser, NumberFormatter, PercentFormatter
public interface Parser<T>

Parses text strings to produce instances of T.

Since:
3.0
Author:
Keith Donald

Method Summary
 T parse(String text, Locale locale)
Parse a text String to produce a T.

Method Detail

parse

T parse(String text,
        Locale locale)
        throws ParseException
Parse a text String to produce a T.

Parameters:
text - the text string
locale - the current user locale
Returns:
an instance of T
Throws:
ParseException - when a parse exception occurs in a java.text parsing library
IllegalArgumentException - when a parse exception occurs
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Printer

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.format
Interface Printer<T>

Type Parameters:
T - the type of object this Printer prints
All Known Subinterfaces:
Formatter<T>
All Known Implementing Classes:
AbstractNumberFormatter, CurrencyFormatter, DateFormatter, MillisecondInstantPrinter, NumberFormatter, PercentFormatter, ReadableInstantPrinter, ReadablePartialPrinter
public interface Printer<T>

Prints objects of type T for display.

Since:
3.0
Author:
Keith Donald

Method Summary
 String print(T object, Locale locale)
Print the object of type T for display.

Method Detail

print

String print(T object,
             Locale locale)
Print the object of type T for display.

Parameters:
object - the instance to print
locale - the current user locale
Returns:
the printed text string
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.format.annotation

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.format.annotation

Annotations for declaratively configuring field formatting rules.

See:
Description

Enum Summary
DateTimeFormat.ISO | Common ISO date time format patterns.
NumberFormat.Style | Common number format styles.

Annotation Types Summary
DateTimeFormat | Declares that a field should be formatted as a date time.
NumberFormat | Declares that a field should be formatted as a number.

Package org.springframework.format.annotation Description

Annotations for declaratively configuring field formatting rules.


org.springframework.format.annotation Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.format.annotation

Package Hierarchies:
All Packages

Annotation Type Hierarchy

  • org.springframework.format.annotation.NumberFormat (implements java.lang.annotation.Annotation)
  • org.springframework.format.annotation.DateTimeFormat (implements java.lang.annotation.Annotation)

Enum Hierarchy

  • java.lang.Object
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)
      • org.springframework.format.annotation.NumberFormat.Style
      • org.springframework.format.annotation.DateTimeFormat.ISO


DateTimeFormat

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

org.springframework.format.annotation
Annotation Type DateTimeFormat

@Target(value={METHOD,FIELD,PARAMETER})
@Retention(value=RUNTIME)
public @interface DateTimeFormat

Declares that a field should be formatted as a date time. Supports formatting by style pattern, ISO date time pattern, or custom format pattern string. Can be applied to java.util.Date, java.util.Calendar, java.long.Long, or Joda Time fields.

For style-based formatting, set the style() attribute to be the style pattern code. The first character of the code is the date style, and the second character is the time style. Specify a character of 'S' for short style, 'M' for medium, 'L' for long, and 'F' for full. A date or time may be omitted by specifying the style character '-'.

For ISO-based formatting, set the iso() attribute to be the desired DateTimeFormat.ISO format, such as DateTimeFormat.ISO.DATE.

For custom formatting, set the pattern() attribute to be the DateTime pattern, such as yyyy/mm/dd h:mm:ss a.

Each attribute is mutually exclusive, so only set one attribute per annotation instance (the one most convenient one for your formatting needs). When the pattern attribute is specified, it takes precedence over both the style and ISO attribute. When the iso attribute is specified, if takes precedence over the style attribute. When no annotation attributes are specified, the default format applied is style-based with a style code of 'SS' (short date, short time).

Since:
3.0
Author:
Keith Donald
See Also:
DateTimeFormat

Optional Element Summary
DateTimeFormat.ISO | iso The ISO pattern to use to format the field.
String | pattern The custom pattern to use to format the field.
String | style The style pattern to use to format the field.

style

public abstract String style
The style pattern to use to format the field. Defaults to 'SS' for short date time. Set this attribute when you wish to format your field in accordance with a common style other than the default style.

Default:
"SS"

iso

public abstract DateTimeFormat.ISO iso
The ISO pattern to use to format the field. The possible ISO patterns are defined in the DateTimeFormat.ISO enum. Defaults to ISO.NONE, indicating this attribute should be ignored. Set this attribute when you wish to format your field in accordance with an ISO date time format.

Default:
org.springframework.format.annotation.DateTimeFormat.ISO.NONE

pattern

public abstract String pattern
The custom pattern to use to format the field. Defaults to empty String, indicating no custom pattern String has been specified. Set this attribute when you wish to format your field in accordance with a custom date time pattern not represented by a style or ISO format.

Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT


NumberFormat

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.format.annotation
Annotation Type NumberFormat

@Target(value={METHOD,FIELD,PARAMETER})
@Retention(value=RUNTIME)
public @interface NumberFormat

Declares that a field should be formatted as a number. Supports formatting by style or custom pattern string. Can be applied to any JDK java.lang.Number type.

For style-based formatting, set the style() attribute to be the desired NumberFormat.Style. For custom formatting, set the pattern() attribute to be the number pattern, such as #,###.##.

Each attribute is mutually exclusive, so only set one attribute per annotation instance (the one most convenient one for your formatting needs). When the pattern attribute is specified, it takes precedence over the style attribute. When no annotation attributes are specified, the default format applied is style-based with a style of NumberFormat.Style.NUMBER.

Since:
3.0
Author:
Keith Donald
See Also:
NumberFormat

Optional Element Summary
String | pattern The custom pattern to use to format the field.
NumberFormat.Style | style The style pattern to use to format the field.

style

public abstract NumberFormat.Style style
The style pattern to use to format the field. Defaults to NumberFormat.Style.NUMBER for general-purpose number formatter. Set this attribute when you wish to format your field in accordance with a common style other than the default style.

Default:
org.springframework.format.annotation.NumberFormat.Style.NUMBER

pattern

public abstract String pattern
The custom pattern to use to format the field. Defaults to empty String, indicating no custom pattern String has been specified. Set this attribute when you wish to format your field in accordance with a custom number pattern not represented by a style.

Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


org.springframework.format.datetime

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.format.datetime

Formatters for java.util.Date properties.

See:
Description

Class Summary
DateFormatter A formatter for Date types.

Package org.springframework.format.datetime Description

Formatters for java.util.Date properties.


org.springframework.format.datetime Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.format.datetime

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.format.datetime.DateFormatter (implements org.springframework.format.Formatter<T>)


DateFormatter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.format.datetime
Class DateFormatter

java.lang.Object
    extended by  org.springframework.format.datetime.DateFormatter
All Implemented Interfaces:
Formatter<Date>, Parser<Date>, Printer<Date>
public class DateFormatter
extends Object
implements Formatter<Date>

A formatter for Date types. Allows the configuration of an explicit date pattern and locale.

Since:
3.0
Author:
Keith Donald, Juergen Hoeller
See Also:
SimpleDateFormat

Constructor Summary
DateFormatter()
Create a new default DateFormatter.
DateFormatter(String pattern)
Create a new DateFormatter for the given date pattern.
Method Summary
protected DateFormat | getDateFormat(Locale locale)
Date | parse(String text, Locale locale) Parse a text String to produce a T.
String | print(Date date, Locale locale) Print the object of type T for display.
void | setLenient(boolean lenient) Specify whether or not parsing is to be lenient.
void | setPattern(String pattern) Set the pattern to use to format date values.
void | setStyle(int style) Set the style to use to format date values.
void | setTimeZone(TimeZone timeZone) Set the TimeZone to normalize the date values into, if any.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DateFormatter

public DateFormatter()
Create a new default DateFormatter.

DateFormatter

public DateFormatter(String pattern)
Create a new DateFormatter for the given date pattern.

Method Detail

setPattern

public void setPattern(String pattern)
Set the pattern to use to format date values.

If not specified, DateFormat's default style will be used.

setStyle

public void setStyle(int style)
Set the style to use to format date values.

If not specified, DateFormat's default style will be used.

See Also:
DateFormat.DEFAULT, DateFormat.SHORT, DateFormat.MEDIUM, DateFormat.LONG, DateFormat.FULL

setTimeZone

public void setTimeZone(TimeZone timeZone)
Set the TimeZone to normalize the date values into, if any.

setLenient

public void setLenient(boolean lenient)
Specify whether or not parsing is to be lenient. Default is false.

With lenient parsing, the parser may allow inputs that do not precisely match the format. With strict parsing, inputs must match the format exactly.

print

public String print(Date date,
                    Locale locale)
Description copied from interface: Printer
Print the object of type T for display.

Specified by:
print in interface Printer<Date>
Parameters:
date - the instance to print
locale - the current user locale
Returns:
the printed text string

parse

public Date parse(String text,
                  Locale locale)
           throws ParseException
Description copied from interface: Parser
Parse a text String to produce a T.

Specified by:
parse in interface Parser<Date>
Parameters:
text - the text string
locale - the current user locale
Returns:
an instance of T
Throws:
ParseException - when a parse exception occurs in a java.text parsing library

getDateFormat

protected DateFormat getDateFormat(Locale locale)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.format.datetime.joda

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.format.datetime.joda

Integration with the Joda Time for formatting Joda types as well as standard JDK Date types.

See:
Description

Class Summary
DateTimeParser | Parses Joda Time DateTime instances using a DateTimeFormatter.
JodaDateTimeFormatAnnotationFormatterFactory | Formats fields annotated with the DateTimeFormat annotation.
JodaTimeContext | A context that holds user-specific Joda Time settings such as the user's Chronology (calendar system) and time zone.
JodaTimeContextHolder | A holder for a thread-local user JodaTimeContext.
JodaTimeFormattingConfigurer | Configures Joda Time's Formatting system for use with Spring.
MillisecondInstantPrinter | Prints Long instances using a DateTimeFormatter.
ReadableInstantPrinter | Prints JodaTime ReadableInstant instances using a DateTimeFormatter.
ReadablePartialPrinter | Prints JodaTime ReadablePartial instances using a DateTimeFormatter.

Package org.springframework.format.datetime.joda Description

Integration with the Joda Time for formatting Joda types as well as standard JDK Date types.


org.springframework.format.datetime.joda Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.format.datetime.joda

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.format.datetime.joda.DateTimeParser (implements org.springframework.format.Parser<T>)
    • org.springframework.format.datetime.joda.JodaDateTimeFormatAnnotationFormatterFactory (implements org.springframework.format.AnnotationFormatterFactory<A>)
    • org.springframework.format.datetime.joda.JodaTimeContext
    • org.springframework.format.datetime.joda.JodaTimeContextHolder
    • org.springframework.format.datetime.joda.JodaTimeFormattingConfigurer
    • org.springframework.format.datetime.joda.MillisecondInstantPrinter (implements org.springframework.format.Printer<T>)
    • org.springframework.format.datetime.joda.ReadableInstantPrinter (implements org.springframework.format.Printer<T>)
    • org.springframework.format.datetime.joda.ReadablePartialPrinter (implements org.springframework.format.Printer<T>)


DateTimeParser

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.format.datetime.joda
Class DateTimeParser

java.lang.Object
    extended by  org.springframework.format.datetime.joda.DateTimeParser
All Implemented Interfaces:
Parser<org.joda.time.DateTime>
public final class DateTimeParser
extends Object
implements Parser<org.joda.time.DateTime>

Parses Joda Time DateTime instances using a DateTimeFormatter.

Since:
3.0
Author:
Keith Donald

Constructor Summary
DateTimeParser(org.joda.time.format.DateTimeFormatter formatter)
Create a new DateTimeParser.
Method Summary
 org.joda.time.DateTime parse(String text, Locale locale)
Parse a text String to produce a T.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DateTimeParser

public DateTimeParser(org.joda.time.format.DateTimeFormatter formatter)
Create a new DateTimeParser.

Parameters:
formatter - the Joda DateTimeFormatter instance
Method Detail

parse

public org.joda.time.DateTime parse(String text,
                                    Locale locale)
                             throws ParseException
Description copied from interface: Parser
Parse a text String to produce a T.

Specified by:
parse in interface Parser<org.joda.time.DateTime>
Parameters:
text - the text string
locale - the current user locale
Returns:
an instance of T
Throws:
ParseException - when a parse exception occurs in a java.text parsing library
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


JodaDateTimeFormatAnnotationFormatterFactory

org.springframework.format.datetime.joda
Class JodaDateTimeFormatAnnotationFormatterFactory

java.lang.Object
    extended by  org.springframework.format.datetime.joda.JodaDateTimeFormatAnnotationFormatterFactory
All Implemented Interfaces:
AnnotationFormatterFactory<DateTimeFormat>
public final class JodaDateTimeFormatAnnotationFormatterFactory
extends Object
implements AnnotationFormatterFactory<DateTimeFormat>

Formats fields annotated with the DateTimeFormat annotation.

Since:
3.0
Author:
Keith Donald, Juergen Hoeller
See Also:
DateTimeFormat

Constructor Summary
JodaDateTimeFormatAnnotationFormatterFactory()
Method Summary
Set<Class<?>> | getFieldTypes() The types of fields that may be annotated with the <A> annotation.
Parser<org.joda.time.DateTime> | getParser(DateTimeFormat annotation, Class<?> fieldType) Get the Parser to parse a submitted value for a field of fieldType annotated with annotation.
Printer<?> | getPrinter(DateTimeFormat annotation, Class<?> fieldType) Get the Printer to print the value of a field of fieldType annotated with annotation.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JodaDateTimeFormatAnnotationFormatterFactory

public JodaDateTimeFormatAnnotationFormatterFactory()
Method Detail

getFieldTypes

public Set<Class<?>> getFieldTypes()
Description copied from interface: AnnotationFormatterFactory
The types of fields that may be annotated with the <A> annotation.

Specified by:
getFieldTypes in interface AnnotationFormatterFactory<DateTimeFormat>

getPrinter

public Printer<?> getPrinter(DateTimeFormat annotation,
                             Class<?> fieldType)
Description copied from interface: AnnotationFormatterFactory
Get the Printer to print the value of a field of fieldType annotated with annotation. If the type <T> the printer accepts is not assignable to fieldType, a coersion from fieldType to <T> will be attempted before the Printer is invoked.

Specified by:
getPrinter in interface AnnotationFormatterFactory<DateTimeFormat>
Parameters:
annotation - the annotation instance
fieldType - the type of field that was annotated
Returns:
the printer

getParser

public Parser<org.joda.time.DateTime> getParser(DateTimeFormat annotation,
                                                Class<?> fieldType)
Description copied from interface: AnnotationFormatterFactory
Get the Parser to parse a submitted value for a field of fieldType annotated with annotation. If the object the parser returns is not assignable to fieldType, a coersion to fieldType will be attempted before the field is set.

Specified by:
getParser in interface AnnotationFormatterFactory<DateTimeFormat>
Parameters:
annotation - the annotation instance
fieldType - the type of field that was annotated
Returns:
the parser
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JodaTimeContext

org.springframework.format.datetime.joda
Class JodaTimeContext

java.lang.Object
    extended by  org.springframework.format.datetime.joda.JodaTimeContext

public class JodaTimeContext
extends Object

A context that holds user-specific Joda Time settings such as the user's Chronology (calendar system) and time zone. A null property value indicate the user has not specified a setting.

Since:
3.0
Author:
Keith Donald
See Also:
JodaTimeContextHolder

Constructor Summary
JodaTimeContext()
Method Summary
org.joda.time.Chronology | getChronology() The user's chronology (calendar system).
org.joda.time.format.DateTimeFormatter | getFormatter(org.joda.time.format.DateTimeFormatter formatter) Gets the Formatter with the this context's settings applied to the base formatter.
org.joda.time.DateTimeZone | getTimeZone() The user's timezone.
void | setChronology(org.joda.time.Chronology chronology) Set the user's chronology.
void | setTimeZone(org.joda.time.DateTimeZone timeZone) Set the user's timezone.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JodaTimeContext

public JodaTimeContext()
Method Detail

setChronology

public void setChronology(org.joda.time.Chronology chronology)
Set the user's chronology.

getChronology

public org.joda.time.Chronology getChronology()
The user's chronology (calendar system). Null if not specified.

setTimeZone

public void setTimeZone(org.joda.time.DateTimeZone timeZone)
Set the user's timezone.

getTimeZone

public org.joda.time.DateTimeZone getTimeZone()
The user's timezone. Null if not specified.

getFormatter

public org.joda.time.format.DateTimeFormatter getFormatter(org.joda.time.format.DateTimeFormatter formatter)
Gets the Formatter with the this context's settings applied to the base formatter.

Parameters:
formatter - the base formatter that establishes default formatting rules, generally context independent
Returns:
the context DateTimeFormatter
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JodaTimeContextHolder

org.springframework.format.datetime.joda
Class JodaTimeContextHolder

java.lang.Object
    extended by  org.springframework.format.datetime.joda.JodaTimeContextHolder

public final class JodaTimeContextHolder
extends Object

A holder for a thread-local user JodaTimeContext.

Since:
3.0
Author:
Keith Donald

Constructor Summary
JodaTimeContextHolder()
Method Summary
static org.joda.time.format.DateTimeFormatter | getFormatter(org.joda.time.format.DateTimeFormatter formatter, Locale locale) Gets the Formatter with the user-specific settings applied to thefrom the base formatter.
static JodaTimeContext | getJodaTimeContext() Return the JodaTimeContext associated with the current thread, if any.
static void | setJodaTimeContext(JodaTimeContext context) Associate the given JodaTimeContext with the current thread.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JodaTimeContextHolder

public JodaTimeContextHolder()
Method Detail

setJodaTimeContext

public static void setJodaTimeContext(JodaTimeContext context)
Associate the given JodaTimeContext with the current thread.

Parameters:
context - the current JodaTimeContext, or null to clear the thread-bound context

getJodaTimeContext

public static JodaTimeContext getJodaTimeContext()
Return the JodaTimeContext associated with the current thread, if any.

Returns:
the current JodaTimeContext, or null if none

getFormatter

public static org.joda.time.format.DateTimeFormatter getFormatter(org.joda.time.format.DateTimeFormatter formatter,
                                                                  Locale locale)
Gets the Formatter with the user-specific settings applied to thefrom the base formatter.

Parameters:
formatter - the base formatter that establishes default formatting rules, generally user independent
locale - the current user locale (may be null if not known)
Returns:
the user's DateTimeFormatter
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JodaTimeFormattingConfigurer

org.springframework.format.datetime.joda
Class JodaTimeFormattingConfigurer

java.lang.Object
    extended by  org.springframework.format.datetime.joda.JodaTimeFormattingConfigurer

public class JodaTimeFormattingConfigurer
extends Object

Configures Joda Time's Formatting system for use with Spring.

Since:
3.0
Author:
Keith Donald, Juergen Hoeller
See Also:
setDateStyle(java.lang.String),
setTimeStyle(java.lang.String),
setDateTimeStyle(java.lang.String),
setUseIsoFormat(boolean),
installJodaTimeFormatting(org.springframework.format.FormatterRegistry)

Constructor Summary
JodaTimeFormattingConfigurer()
Method Summary
void | installJodaTimeFormatting(FormatterRegistry formatterRegistry) Install Joda Time formatters given the current configuration of this JodaTimeFormattingConfigurer.
void | setDateStyle(String dateStyle) Set the default format style of Joda LocalDate objects.
void | setDateTimeStyle(String dateTimeStyle) Set the default format style of Joda LocalDateTime and DateTime objects, as well as JDK Date and Calendar objects.
void | setTimeStyle(String timeStyle) Set the default format style of Joda LocalTime objects.
void | setUseIsoFormat(boolean useIsoFormat) Set whether standard ISO formatting should be applied to all Date/Time types.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JodaTimeFormattingConfigurer

public JodaTimeFormattingConfigurer()
Method Detail

setDateStyle

public void setDateStyle(String dateStyle)
Set the default format style of Joda LocalDate objects. Default is DateTimeFormat.shortDate().

setTimeStyle

public void setTimeStyle(String timeStyle)
Set the default format style of Joda LocalTime objects. Default is DateTimeFormat.shortTime().

setDateTimeStyle

public void setDateTimeStyle(String dateTimeStyle)
Set the default format style of Joda LocalDateTime and DateTime objects, as well as JDK Date and Calendar objects. Default is DateTimeFormat.shortDateTime().

setUseIsoFormat

public void setUseIsoFormat(boolean useIsoFormat)
Set whether standard ISO formatting should be applied to all Date/Time types. Default is false (no). If set to true, the dateStyle, timeStyle, and dateTimeStyle properties are ignored.

installJodaTimeFormatting

public void installJodaTimeFormatting(FormatterRegistry formatterRegistry)
Install Joda Time formatters given the current configuration of this JodaTimeFormattingConfigurer.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MillisecondInstantPrinter

org.springframework.format.datetime.joda
Class MillisecondInstantPrinter

java.lang.Object
    extended by  org.springframework.format.datetime.joda.MillisecondInstantPrinter
All Implemented Interfaces:
Printer<Long>
public final class MillisecondInstantPrinter
extends Object
implements Printer<Long>

Prints Long instances using a DateTimeFormatter.

Since:
3.0
Author:
Keith Donald

Constructor Summary
MillisecondInstantPrinter(org.joda.time.format.DateTimeFormatter formatter)
Create a new ReadableInstantPrinter.
Method Summary
 String print(Long instant, Locale locale)
Print the object of type T for display.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MillisecondInstantPrinter

public MillisecondInstantPrinter(org.joda.time.format.DateTimeFormatter formatter)
Create a new ReadableInstantPrinter.

Parameters:
formatter - the Joda DateTimeFormatter instance
Method Detail

print

public String print(Long instant,
                    Locale locale)
Description copied from interface: Printer
Print the object of type T for display.

Specified by:
print in interface Printer<Long>
Parameters:
instant - the instance to print
locale - the current user locale
Returns:
the printed text string
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ReadableInstantPrinter

org.springframework.format.datetime.joda
Class ReadableInstantPrinter

java.lang.Object
    extended by  org.springframework.format.datetime.joda.ReadableInstantPrinter
All Implemented Interfaces:
Printer<org.joda.time.ReadableInstant>
public final class ReadableInstantPrinter
extends Object
implements Printer<org.joda.time.ReadableInstant>

Prints JodaTime ReadableInstant instances using a DateTimeFormatter.

Since:
3.0
Author:
Keith Donald

Constructor Summary
ReadableInstantPrinter(org.joda.time.format.DateTimeFormatter formatter)
Create a new ReadableInstantPrinter.
Method Summary
 String print(org.joda.time.ReadableInstant instant, Locale locale)
Print the object of type T for display.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ReadableInstantPrinter

public ReadableInstantPrinter(org.joda.time.format.DateTimeFormatter formatter)
Create a new ReadableInstantPrinter.

Parameters:
formatter - the Joda DateTimeFormatter instance
Method Detail

print

public String print(org.joda.time.ReadableInstant instant,
                    Locale locale)
Description copied from interface: Printer
Print the object of type T for display.

Specified by:
print in interface Printer<org.joda.time.ReadableInstant>
Parameters:
instant - the instance to print
locale - the current user locale
Returns:
the printed text string
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ReadablePartialPrinter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.format.datetime.joda
Class ReadablePartialPrinter

java.lang.Object
    extended by  org.springframework.format.datetime.joda.ReadablePartialPrinter
All Implemented Interfaces:
Printer<org.joda.time.ReadablePartial>
public final class ReadablePartialPrinter
extends Object
implements Printer<org.joda.time.ReadablePartial>

Prints JodaTime ReadablePartial instances using a DateTimeFormatter.

Since:
3.0
Author:
Keith Donald

Constructor Summary
ReadablePartialPrinter(org.joda.time.format.DateTimeFormatter formatter)
Create a new ReadableInstantPrinter.
Method Summary
 String print(org.joda.time.ReadablePartial partial, Locale locale)
Print the object of type T for display.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ReadablePartialPrinter

public ReadablePartialPrinter(org.joda.time.format.DateTimeFormatter formatter)
Create a new ReadableInstantPrinter.

Parameters:
formatter - the Joda DateTimeFormatter instance
Method Detail

print

public String print(org.joda.time.ReadablePartial partial,
                    Locale locale)
Description copied from interface: Printer
Print the object of type T for display.

Specified by:
print in interface Printer<org.joda.time.ReadablePartial>
Parameters:
partial - the instance to print
locale - the current user locale
Returns:
the printed text string
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.format.number

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.format.number

Formatters for java.lang.Number properties.

See:
Description

Class Summary
AbstractNumberFormatter | Abstract formatter for Numbers, providing a AbstractNumberFormatter.getNumberFormat(java.util.Locale) template method.
CurrencyFormatter | A BigDecimal formatter for currency values.
NumberFormatAnnotationFormatterFactory | Formats fields annotated with the NumberFormat annotation.
NumberFormatter | A general-purpose Number formatter.
PercentFormatter | A Number formatter for percent values.

Package org.springframework.format.number Description

Formatters for java.lang.Number properties.


org.springframework.format.number Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.format.number

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.format.number.AbstractNumberFormatter (implements org.springframework.format.Formatter<T>)
      • org.springframework.format.number.CurrencyFormatter
      • org.springframework.format.number.NumberFormatter
      • org.springframework.format.number.PercentFormatter
    • org.springframework.format.number.NumberFormatAnnotationFormatterFactory (implements org.springframework.format.AnnotationFormatterFactory<A>)


AbstractNumberFormatter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.format.number
Class AbstractNumberFormatter

java.lang.Object
    extended by  org.springframework.format.number.AbstractNumberFormatter
All Implemented Interfaces:
Formatter<Number>, Parser<Number>, Printer<Number>
Direct Known Subclasses:
CurrencyFormatter, NumberFormatter, PercentFormatter
public abstract class AbstractNumberFormatter
extends Object
implements Formatter<Number>

Abstract formatter for Numbers, providing a getNumberFormat(java.util.Locale) template method.

Since:
3.0
Author:
Juergen Hoeller, Keith Donald

Constructor Summary
AbstractNumberFormatter()
Method Summary
protected abstract NumberFormat | getNumberFormat(Locale locale) Obtain a concrete NumberFormat for the specified locale.
Number | parse(String text, Locale locale) Parse a text String to produce a T.
String | print(Number number, Locale locale) Print the object of type T for display.
void | setLenient(boolean lenient) Specify whether or not parsing is to be lenient.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractNumberFormatter

public AbstractNumberFormatter()
Method Detail

setLenient

public void setLenient(boolean lenient)
Specify whether or not parsing is to be lenient. Default is false.

With lenient parsing, the parser may allow inputs that do not precisely match the format. With strict parsing, inputs must match the format exactly.

print

public String print(Number number,
                    Locale locale)
Description copied from interface: Printer
Print the object of type T for display.

Specified by:
print in interface Printer<Number>
Parameters:
number - the instance to print
locale - the current user locale
Returns:
the printed text string

parse

public Number parse(String text,
                    Locale locale)
             throws ParseException
Description copied from interface: Parser
Parse a text String to produce a T.

Specified by:
parse in interface Parser<Number>
Parameters:
text - the text string
locale - the current user locale
Returns:
an instance of T
Throws:
ParseException - when a parse exception occurs in a java.text parsing library

getNumberFormat

protected abstract NumberFormat getNumberFormat(Locale locale)
Obtain a concrete NumberFormat for the specified locale.

Parameters:
locale - the current locale
Returns:
the NumberFormat instance (never null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


CurrencyFormatter

org.springframework.format.number
Class CurrencyFormatter

java.lang.Object
    extended by  org.springframework.format.number.AbstractNumberFormatter
        extended by  org.springframework.format.number.CurrencyFormatter
All Implemented Interfaces:
Formatter<Number>, Parser<Number>, Printer<Number>
public final class CurrencyFormatter
extends AbstractNumberFormatter

A BigDecimal formatter for currency values.

Delegates to NumberFormat.getCurrencyInstance(Locale). Configures BigDecimal parsing so there is no loss of precision. Can apply a specified RoundingMode to parsed values.

Since:
3.0
Author:
Keith Donald, Juergen Hoeller
See Also:
AbstractNumberFormatter.setLenient(boolean), setRoundingMode(java.math.RoundingMode)

Constructor Summary
CurrencyFormatter()
Method Summary
protected NumberFormat | getNumberFormat(Locale locale) Obtain a concrete NumberFormat for the specified locale.
BigDecimal | parse(String text, Locale locale) Parse a text String to produce a T.
void | setCurrency(Currency currency) Specify the currency, if known.
void | setFractionDigits(int fractionDigits) Specify the desired number of fraction digits.
void | setRoundingMode(RoundingMode roundingMode) Specify the rounding mode to use for decimal parsing.
Methods inherited from class org.springframework.format.number.AbstractNumberFormatter
print, setLenient
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CurrencyFormatter

public CurrencyFormatter()
Method Detail

setFractionDigits

public void setFractionDigits(int fractionDigits)
Specify the desired number of fraction digits. Default is 2.

setRoundingMode

public void setRoundingMode(RoundingMode roundingMode)
Specify the rounding mode to use for decimal parsing. Default is RoundingMode.UNNECESSARY.

setCurrency

public void setCurrency(Currency currency)
Specify the currency, if known.

parse

public BigDecimal parse(String text,
                        Locale locale)
                 throws ParseException
Description copied from interface: Parser
Parse a text String to produce a T.

Specified by:
parse in interface Parser<Number>
Overrides:
parse in class AbstractNumberFormatter
Parameters:
text - the text string
locale - the current user locale
Returns:
an instance of T
Throws:
ParseException - when a parse exception occurs in a java.text parsing library

getNumberFormat

protected NumberFormat getNumberFormat(Locale locale)
Description copied from class: AbstractNumberFormatter
Obtain a concrete NumberFormat for the specified locale.

Specified by:
getNumberFormat in class AbstractNumberFormatter
Parameters:
locale - the current locale
Returns:
the NumberFormat instance (never null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NumberFormatAnnotationFormatterFactory

org.springframework.format.number
Class NumberFormatAnnotationFormatterFactory

java.lang.Object
    extended by  org.springframework.format.number.NumberFormatAnnotationFormatterFactory
All Implemented Interfaces:
AnnotationFormatterFactory<NumberFormat>
public final class NumberFormatAnnotationFormatterFactory
extends Object
implements AnnotationFormatterFactory<NumberFormat>

Formats fields annotated with the NumberFormat annotation.

Since:
3.0
Author:
Keith Donald
See Also:
NumberFormat

Constructor Summary
NumberFormatAnnotationFormatterFactory()
Method Summary
Set<Class<?>> | getFieldTypes() The types of fields that may be annotated with the <A> annotation.
Parser<Number> | getParser(NumberFormat annotation, Class<?> fieldType) Get the Parser to parse a submitted value for a field of fieldType annotated with annotation.
Printer<Number> | getPrinter(NumberFormat annotation, Class<?> fieldType) Get the Printer to print the value of a field of fieldType annotated with annotation.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

NumberFormatAnnotationFormatterFactory

public NumberFormatAnnotationFormatterFactory()
Method Detail

getFieldTypes

public Set<Class<?>> getFieldTypes()
Description copied from interface: AnnotationFormatterFactory
The types of fields that may be annotated with the <A> annotation.

Specified by:
getFieldTypes in interface AnnotationFormatterFactory<NumberFormat>

getPrinter

public Printer<Number> getPrinter(NumberFormat annotation,
                                  Class<?> fieldType)
Description copied from interface: AnnotationFormatterFactory
Get the Printer to print the value of a field of fieldType annotated with annotation. If the type <T> the printer accepts is not assignable to fieldType, a coersion from fieldType to <T> will be attempted before the Printer is invoked.

Specified by:
getPrinter in interface AnnotationFormatterFactory<NumberFormat>
Parameters:
annotation - the annotation instance
fieldType - the type of field that was annotated
Returns:
the printer

getParser

public Parser<Number> getParser(NumberFormat annotation,
                                Class<?> fieldType)
Description copied from interface: AnnotationFormatterFactory
Get the Parser to parse a submitted value for a field of fieldType annotated with annotation. If the object the parser returns is not assignable to fieldType, a coersion to fieldType will be attempted before the field is set.

Specified by:
getParser in interface AnnotationFormatterFactory<NumberFormat>
Parameters:
annotation - the annotation instance
fieldType - the type of field that was annotated
Returns:
the parser
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NumberFormatter

org.springframework.format.number
Class NumberFormatter

java.lang.Object
    extended by  org.springframework.format.number.AbstractNumberFormatter
        extended by  org.springframework.format.number.NumberFormatter
All Implemented Interfaces:
Formatter<Number>, Parser<Number>, Printer<Number>
public final class NumberFormatter
extends AbstractNumberFormatter

A general-purpose Number formatter.

Delegates to NumberFormat.getInstance(Locale). Configures BigDecimal parsing so there is no loss in precision. Allows configuration over the decimal number pattern. The AbstractNumberFormatter.parse(String, Locale) routine always returns a BigDecimal.

Since:
3.0
Author:
Keith Donald, Juergen Hoeller
See Also:
setPattern(java.lang.String), AbstractNumberFormatter.setLenient(boolean)

Constructor Summary
NumberFormatter()
Create a new NumberFormatter without a pattern.
NumberFormatter(String pattern)
Create a new NumberFormatter with the specified pattern.
Method Summary
NumberFormat | getNumberFormat(Locale locale) Obtain a concrete NumberFormat for the specified locale.
void | setPattern(String pattern) Sets the pattern to use to format number values.
Methods inherited from class org.springframework.format.number.AbstractNumberFormatter
parse, print, setLenient
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

NumberFormatter

public NumberFormatter()
Create a new NumberFormatter without a pattern.

NumberFormatter

public NumberFormatter(String pattern)
Create a new NumberFormatter with the specified pattern.

Parameters:
pattern - the format pattern
See Also:
setPattern(java.lang.String)
Method Detail

setPattern

public void setPattern(String pattern)
Sets the pattern to use to format number values. If not specified, the default DecimalFormat pattern is used.

See Also:
DecimalFormat.applyPattern(String)

getNumberFormat

public NumberFormat getNumberFormat(Locale locale)
Description copied from class: AbstractNumberFormatter
Obtain a concrete NumberFormat for the specified locale.

Specified by:
getNumberFormat in class AbstractNumberFormatter
Parameters:
locale - the current locale
Returns:
the NumberFormat instance (never null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PercentFormatter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.format.number
Class PercentFormatter

java.lang.Object
    extended by  org.springframework.format.number.AbstractNumberFormatter
        extended by  org.springframework.format.number.PercentFormatter
All Implemented Interfaces:
Formatter<Number>, Parser<Number>, Printer<Number>
public final class PercentFormatter
extends AbstractNumberFormatter

A Number formatter for percent values.

Delegates to NumberFormat.getPercentInstance(Locale). Configures BigDecimal parsing so there is no loss in precision. The AbstractNumberFormatter.parse(String, Locale) routine always returns a BigDecimal.

Since:
3.0
Author:
Keith Donald, Juergen Hoeller
See Also:
AbstractNumberFormatter.setLenient(boolean)

Constructor Summary
PercentFormatter()
Method Summary
protected  NumberFormat getNumberFormat(Locale locale)
Obtain a concrete NumberFormat for the specified locale.
Methods inherited from class org.springframework.format.number.AbstractNumberFormatter
parse, print, setLenient
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PercentFormatter

public PercentFormatter()
Method Detail

getNumberFormat

protected NumberFormat getNumberFormat(Locale locale)
Description copied from class: AbstractNumberFormatter
Obtain a concrete NumberFormat for the specified locale.

Specified by:
getNumberFormat in class AbstractNumberFormatter
Parameters:
locale - the current locale
Returns:
the NumberFormat instance (never null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.format.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.format.support

Support classes for the formatting package, providing common implementations as well as adapters.

See:
Description

Class Summary
FormattingConversionService | A ConversionService implementation designed to be configured as a FormatterRegistry.
FormattingConversionServiceFactoryBean | A factory for a FormattingConversionService that installs default formatters for common types such as numbers and datetimes.

Package org.springframework.format.support Description

Support classes for the formatting package, providing common implementations as well as adapters.


org.springframework.format.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.format.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.format.support.FormattingConversionServiceFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.core.convert.support.GenericConversionService (implements org.springframework.core.convert.ConversionService, org.springframework.core.convert.converter.ConverterRegistry)
      • org.springframework.format.support.FormattingConversionService (implements org.springframework.format.FormatterRegistry)


FormattingConversionService

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.format.support
Class FormattingConversionService

java.lang.Object
    extended by  org.springframework.core.convert.support.GenericConversionService
        extended by  org.springframework.format.support.FormattingConversionService
All Implemented Interfaces:
ConversionService, ConverterRegistry, FormatterRegistry
public class FormattingConversionService
extends GenericConversionService
implements FormatterRegistry

A ConversionService implementation designed to be configured as a FormatterRegistry.

Since:
3.0
Author:
Keith Donald, Juergen Hoeller

Constructor Summary
FormattingConversionService()
Method Summary
void | addFormatterForFieldAnnotation(AnnotationFormatterFactory annotationFormatterFactory) Adds a Formatter to format fields annotated with a specific format annotation.
void | addFormatterForFieldType(Class<?> fieldType, Formatter<?> formatter) Adds a Formatter to format fields of a specific type.
void | addFormatterForFieldType(Class<?> fieldType, Printer<?> printer, Parser<?> parser) Adds a Printer/Parser pair to format fields of a specific type.
Methods inherited from class org.springframework.core.convert.support.GenericConversionService
addConverter, addConverter, addConverterFactory, canConvert, canConvert, convert, convert, convertNullSource, getConverter, getDefaultConverter, removeConvertible, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.core.convert.converter.ConverterRegistry
addConverter, addConverter, addConverterFactory, removeConvertible

Constructor Detail

FormattingConversionService

public FormattingConversionService()
Method Detail

addFormatterForFieldType

public void addFormatterForFieldType(Class<?> fieldType,
                                     Formatter<?> formatter)
Description copied from interface: FormatterRegistry
Adds a Formatter to format fields of a specific type.

On print, if the Formatter's type T is declared and fieldType is not assignable to T, a coersion to T will be attempted before delegating to formatter to print a field value. On parse, if the parsed object returned by formatter is not assignable to the runtime field type, a coersion to the field type will be attempted before returning the parsed field value.

Specified by:
addFormatterForFieldType in interface FormatterRegistry
Parameters:
fieldType - the field type to format
formatter - the formatter to add

addFormatterForFieldType

public void addFormatterForFieldType(Class<?> fieldType,
                                     Printer<?> printer,
                                     Parser<?> parser)
Description copied from interface: FormatterRegistry
Adds a Printer/Parser pair to format fields of a specific type. The formatter will delegate to the specified printer for printing and the specified parser for parsing.

On print, if the Printer's type T is declared and fieldType is not assignable to T, a coersion to T will be attempted before delegating to printer to print a field value. On parse, if the object returned by the Parser is not assignable to the runtime field type, a coersion to the field type will be attempted before returning the parsed field value.

Specified by:
addFormatterForFieldType in interface FormatterRegistry
Parameters:
fieldType - the field type to format
printer - the printing part of the formatter
parser - the parsing part of the formatter

addFormatterForFieldAnnotation

public void addFormatterForFieldAnnotation(AnnotationFormatterFactory annotationFormatterFactory)
Description copied from interface: FormatterRegistry
Adds a Formatter to format fields annotated with a specific format annotation.

Specified by:
addFormatterForFieldAnnotation in interface FormatterRegistry
Parameters:
annotationFormatterFactory - the annotation formatter factory to add
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


FormattingConversionServiceFactoryBean

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.format.support
Class FormattingConversionServiceFactoryBean

java.lang.Object
    extended by  org.springframework.format.support.FormattingConversionServiceFactoryBean
All Implemented Interfaces:
FactoryBean<FormattingConversionService>, InitializingBean
public class FormattingConversionServiceFactoryBean
extends Object
implements FactoryBean<FormattingConversionService>, InitializingBean

A factory for a FormattingConversionService that installs default formatters for common types such as numbers and datetimes.

Subclasses may override installFormatters(FormatterRegistry) to register custom formatters.

Since:
3.0
Author:
Keith Donald, Juergen Hoeller

Constructor Summary
FormattingConversionServiceFactoryBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 FormattingConversionService getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<? extends FormattingConversionService> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
protected  void installFormatters(FormatterRegistry registry)
Install Formatters and Converters into the new FormattingConversionService using the FormatterRegistry SPI.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setConverters(Set<?> converters)
Configure the set of custom converter objects that should be added: implementing Converter, ConverterFactory, or GenericConverter.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

FormattingConversionServiceFactoryBean

public FormattingConversionServiceFactoryBean()
Method Detail

setConverters

public void setConverters(Set<?> converters)
Configure the set of custom converter objects that should be added: implementing Converter, ConverterFactory, or GenericConverter.

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

getObject

public FormattingConversionService getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<FormattingConversionService>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends FormattingConversionService> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<FormattingConversionService>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<FormattingConversionService>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()

installFormatters

protected void installFormatters(FormatterRegistry registry)
Install Formatters and Converters into the new FormattingConversionService using the FormatterRegistry SPI. Subclasses may override to customize the set of formatters and/or converters that are installed.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.http

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.http

Contains a basic abstraction over client/server-side HTTP.

See:
Description

Interface Summary
HttpInputMessage | Represents an HTTP output message, consisting of headers and a readable body.
HttpMessage | Represents the base interface for HTTP request and response messages.
HttpOutputMessage | Represents an HTTP output message, consisting of headers and a writable body.

Class Summary
HttpEntity<T> | Represents an HTTP request or response entity, consisting of headers and body.
HttpHeaders | Represents HTTP request and response headers, mapping string header names to list of string values.
MediaType | Represents an Internet Media Type, as defined in the HTTP specification.
MediaTypeEditor | Editor for MediaType descriptors, to automatically convert String specifications (e.g.
ResponseEntity<T> | Extension of HttpEntity that adds a HttpStatus status code.

Enum Summary
HttpMethod | Java 5 enumeration of HTTP request methods.
HttpStatus | Java 5 enumeration of HTTP status codes.
HttpStatus.Series | Java 5 enumeration of HTTP status series.

Package org.springframework.http Description

Contains a basic abstraction over client/server-side HTTP. This package contains the HttpInputMessage and HttpOutputMessage interfaces.


org.springframework.http Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.http

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.http.HttpEntity<T>
      • org.springframework.http.ResponseEntity<T>
    • org.springframework.http.HttpHeaders (implements org.springframework.util.MultiValueMap<K,V>)
    • org.springframework.http.MediaType (implements java.lang.Comparable<T>)
    • java.beans.PropertyEditorSupport (implements java.beans.PropertyEditor)
      • org.springframework.http.MediaTypeEditor

Interface Hierarchy

  • org.springframework.http.HttpMessage
    • org.springframework.http.HttpInputMessage
    • org.springframework.http.HttpOutputMessage

Enum Hierarchy

  • java.lang.Object
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)
      • org.springframework.http.HttpStatus
      • org.springframework.http.HttpStatus.Series
      • org.springframework.http.HttpMethod


HttpInputMessage

org.springframework.http
Interface HttpInputMessage

All Superinterfaces:
HttpMessage
All Known Subinterfaces:
ClientHttpResponse, ServerHttpRequest
All Known Implementing Classes:
ServletServerHttpRequest
public interface HttpInputMessage
extends HttpMessage

Represents an HTTP output message, consisting of headers and a readable body.

Typically implemented by an HTTP request on the server-side, or a response on the client-side.

Since:
3.0
Author:
Arjen Poutsma

Method Summary
 InputStream getBody()
Return the body of the message as an input stream.
Methods inherited from interface org.springframework.http.HttpMessage
getHeaders

Method Detail

getBody

InputStream getBody()
                    throws IOException
Return the body of the message as an input stream.

Returns:
the input stream body
Throws:
IOException - in case of I/O Errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HttpMessage

org.springframework.http
Interface HttpMessage

All Known Subinterfaces:
ClientHttpRequest, ClientHttpResponse, HttpInputMessage, HttpOutputMessage, ServerHttpRequest, ServerHttpResponse
All Known Implementing Classes:
AbstractClientHttpRequest, ServletServerHttpRequest, ServletServerHttpResponse
public interface HttpMessage

Represents the base interface for HTTP request and response messages. Consists of HttpHeaders, retrievable via getHeaders().

Since:
3.0
Author:
Arjen Poutsma

Method Summary
 HttpHeaders getHeaders()
Return the headers of this message.

Method Detail

getHeaders

HttpHeaders getHeaders()
Return the headers of this message.

Returns:
a corresponding HttpHeaders object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HttpOutputMessage

org.springframework.http
Interface HttpOutputMessage

All Superinterfaces:
HttpMessage
All Known Subinterfaces:
ClientHttpRequest, ServerHttpResponse
All Known Implementing Classes:
AbstractClientHttpRequest, ServletServerHttpResponse
public interface HttpOutputMessage
extends HttpMessage

Represents an HTTP output message, consisting of headers and a writable body.

Typically implemented by an HTTP request on the client-side, or a response on the server-side.

Since:
3.0
Author:
Arjen Poutsma

Method Summary
 OutputStream getBody()
Return the body of the message as an output stream.
Methods inherited from interface org.springframework.http.HttpMessage
getHeaders

Method Detail

getBody

OutputStream getBody()
                     throws IOException
Return the body of the message as an output stream.

Returns:
the output stream body
Throws:
IOException - in case of I/O Errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HttpEntity

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.http
Class HttpEntity<T>

java.lang.Object
    extended by  org.springframework.http.HttpEntity<T>
Direct Known Subclasses:
ResponseEntity
public class HttpEntity<T>
extends Object

Represents an HTTP request or response entity, consisting of headers and body.

Typically used in combination with the RestTemplate, like so:

 HttpHeaders headers = new HttpHeaders();
 headers.setContentType(MediaType.TEXT_PLAIN);
 HttpEntity<String> entity = new HttpEntity<String>(helloWorld, headers);
 URI location = template.postForLocation("http://example.com", entity);
or
 HttpEntity<String> entity = template.getForEntity("http://example.com", String.class);
 String body = entity.getBody();
 MediaType contentType = entity.getHeaders().getContentType();
Can also be used in Spring MVC, as a return value from a @Controller method:
 @RequestMapping("/handle")
 public HttpEntity<String> handle() {
   HttpHeaders responseHeaders = new HttpHeaders();
   responseHeaders.set("MyResponseHeader", "MyValue");
   return new HttpEntity<String>("Hello World", responseHeaders);
 }

Since:
3.0.2
Author:
Arjen Poutsma
See Also:
RestTemplate, getBody(), getHeaders()

Field Summary
static HttpEntity EMPTY
The empty HttpEntity, with no body or headers.
Constructor Summary
HttpEntity(MultiValueMap<String,String> headers)
Create a new HttpEntity with the given headers and no body.
HttpEntity(T body)
Create a new HttpEntity with the given body and no headers.
HttpEntity(T body, MultiValueMap<String,String> headers)
Create a new HttpEntity with the given body and headers.
Method Summary
T | getBody() Returns the body of this entity.
HttpHeaders | getHeaders() Returns the headers of this entity.
boolean | hasBody() Indicates whether this entity has a body.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

EMPTY

public static final HttpEntity EMPTY
The empty HttpEntity, with no body or headers.

Constructor Detail

HttpEntity

public HttpEntity(T body)
Create a new HttpEntity with the given body and no headers.

Parameters:
body - the entity body

HttpEntity

public HttpEntity(MultiValueMap<String,String> headers)
Create a new HttpEntity with the given headers and no body.

Parameters:
headers - the entity headers

HttpEntity

public HttpEntity(T body,
                  MultiValueMap<String,String> headers)
Create a new HttpEntity with the given body and headers.

Parameters:
body - the entity body
headers - the entity headers
Method Detail

getHeaders

public HttpHeaders getHeaders()
Returns the headers of this entity.

getBody

public T getBody()
Returns the body of this entity.

hasBody

public boolean hasBody()
Indicates whether this entity has a body.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


HttpHeaders

org.springframework.http
Class HttpHeaders

java.lang.Object
    extended by  org.springframework.http.HttpHeaders
All Implemented Interfaces:
Map<String,List<String>>, MultiValueMap<String,String>
public class HttpHeaders
extends Object
implements MultiValueMap<String,String>

Represents HTTP request and response headers, mapping string header names to list of string values.

In addition to the normal methods defined by Map, this class offers the following convenience methods:

  • getFirst(String) returns the first value associated with a given header name
  • add(String, String) adds a header value to the list of values for a header name
  • set(String, String) sets the header value to a single string value

Inspired by Headers.

Since:
3.0
Author:
Arjen Poutsma

Nested Class Summary
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
Constructor Summary
HttpHeaders()
Constructs a new, empty instance of the HttpHeaders object.
Method Summary
void | add(String headerName, String headerValue) Add the given, single header value under the given name.
void | clear()
boolean | containsKey(Object key)
boolean | containsValue(Object value)
Set<Map.Entry<String,List<String>>> | entrySet()
boolean | equals(Object other)
List<String> | get(Object key)
List<MediaType> | getAccept() Return the list of acceptable media types, as specified by the Accept header.
List<Charset> | getAcceptCharset() Return the list of acceptable charsets, as specified by the Accept-Charset header.
Set<HttpMethod> | getAllow() Return the set of allowed HTTP methods, as specified by the Allow header.
String | getCacheControl() Returns the value of the Cache-Control header.
long | getContentLength() Return the length of the body in bytes, as specified by the Content-Length header.
MediaType | getContentType() Return the media type of the body, as specified by the Content-Type header.
long | getDate() Returns the date and time at which the message was created, as specified by the Date header.
String | getETag() Returns the entity tag of the body, as specified by the ETag header.
long | getExpires() Returns the date and time at which the message is no longer valid, as specified by the Expires header.
String | getFirst(String headerName) Return the first header value for the given header name, if any.
List<String> | getIfNoneMatch() Returns the value of the If-None-Match header.
long | getIfNotModifiedSince() Returns the value of the IfModifiedSince header.
long | getLastModified() Returns the time the resource was last changed, as specified by the Last-Modified header.
URI | getLocation() Return the (new) location of a resource, as specified by the Location header.
String | getPragma() Returns the value of the Pragma header.
int | hashCode()
boolean | isEmpty()
Set<String> | keySet()
List<String> | put(String key, List<String> value)
void | putAll(Map<? extends String,? extends List<String>> m)
static HttpHeaders | readOnlyHttpHeaders(HttpHeaders headers) Returns HttpHeaders object that can only be read, not written to.
List<String> | remove(Object key)
void | set(String headerName, String headerValue) Set the given, single header value under the given name.
void | setAccept(List<MediaType> acceptableMediaTypes) Set the list of acceptable media types, as specified by the Accept header.
void | setAcceptCharset(List<Charset> acceptableCharsets) Set the list of acceptable charsets, as specified by the Accept-Charset header.
void | setAll(Map<String,String> values) Set the given values under.
void | setAllow(Set<HttpMethod> allowedMethods) Set the set of allowed HTTP methods, as specified by the Allow header.
void | setCacheControl(String cacheControl) Sets the (new) value of the Cache-Control header.
void | setContentDispositionFormData(String name, String filename) Sets the (new) value of the Content-Disposition header for form-data.
void | setContentLength(long contentLength) Set the length of the body in bytes, as specified by the Content-Length header.
void | setContentType(MediaType mediaType) Set the media type of the body, as specified by the Content-Type header.
void | setDate(long date) Sets the date and time at which the message was created, as specified by the Date header.
void | setETag(String eTag) Sets the (new) entity tag of the body, as specified by the ETag header.
void | setExpires(long expires) Sets the date and time at which the message is no longer valid, as specified by the Expires header.
void | setIfModifiedSince(long ifModifiedSince) Sets the (new) value of the If-Modified-Since header.
void | setIfNoneMatch(List<String> ifNoneMatchList) Sets the (new) values of the If-None-Match header.
void | setIfNoneMatch(String ifNoneMatch) Sets the (new) value of the If-None-Match header.
void | setLastModified(long lastModified) Sets the time the resource was last changed, as specified by the Last-Modified header.
void | setLocation(URI location) Set the (new) location of a resource, as specified by the Location header.
void | setPragma(String pragma) Sets the (new) value of the Pragma header.
int | size()
Map<String,String> | toSingleValueMap() Returns the first values contained in this MultiValueMap.
String | toString()
Collection<List<String>> | values()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

HttpHeaders

public HttpHeaders()
Constructs a new, empty instance of the HttpHeaders object.

Method Detail

readOnlyHttpHeaders

public static HttpHeaders readOnlyHttpHeaders(HttpHeaders headers)
Returns HttpHeaders object that can only be read, not written to.

setAccept

public void setAccept(List<MediaType> acceptableMediaTypes)
Set the list of acceptable media types, as specified by the Accept header.

Parameters:
acceptableMediaTypes - the acceptable media types

getAccept

public List<MediaType> getAccept()
Return the list of acceptable media types, as specified by the Accept header.

Returns an empty list when the acceptable media types are unspecified.

Returns:
the acceptable media types

setAcceptCharset

public void setAcceptCharset(List<Charset> acceptableCharsets)
Set the list of acceptable charsets, as specified by the Accept-Charset header.

Parameters:
acceptableCharsets - the acceptable charsets

getAcceptCharset

public List<Charset> getAcceptCharset()
Return the list of acceptable charsets, as specified by the Accept-Charset header.

Returns:
the acceptable charsets

setAllow

public void setAllow(Set<HttpMethod> allowedMethods)
Set the set of allowed HTTP methods, as specified by the Allow header.

Parameters:
allowedMethods - the allowed methods

getAllow

public Set<HttpMethod> getAllow()
Return the set of allowed HTTP methods, as specified by the Allow header.

Returns an empty set when the allowed methods are unspecified.

Returns:
the allowed methods

setCacheControl

public void setCacheControl(String cacheControl)
Sets the (new) value of the Cache-Control header.

Parameters:
cacheControl - the value of the header

getCacheControl

public String getCacheControl()
Returns the value of the Cache-Control header.

Returns:
the value of the header

setContentDispositionFormData

public void setContentDispositionFormData(String name,
                                          String filename)
Sets the (new) value of the Content-Disposition header for form-data.

Parameters:
name - the control name
filename - the filename, may be null

setContentLength

public void setContentLength(long contentLength)
Set the length of the body in bytes, as specified by the Content-Length header.

Parameters:
contentLength - the content length

getContentLength

public long getContentLength()
Return the length of the body in bytes, as specified by the Content-Length header.

Returns -1 when the content-length is unknown.

Returns:
the content length

setContentType

public void setContentType(MediaType mediaType)
Set the media type of the body, as specified by the Content-Type header.

Parameters:
mediaType - the media type

getContentType

public MediaType getContentType()
Return the media type of the body, as specified by the Content-Type header.

Returns null when the content-type is unknown.

Returns:
the content type

setDate

public void setDate(long date)
Sets the date and time at which the message was created, as specified by the Date header.

The date should be specified as the number of milliseconds since January 1, 1970 GMT.

Parameters:
date - the date

getDate

public long getDate()
Returns the date and time at which the message was created, as specified by the Date header.

The date is returned as the number of milliseconds since January 1, 1970 GMT. Returns -1 when the date is unknown.

Returns:
the creation date/time
Throws:
IllegalArgumentException - if the value can't be converted to a date

setETag

public void setETag(String eTag)
Sets the (new) entity tag of the body, as specified by the ETag header.

Parameters:
eTag - the new entity tag

getETag

public String getETag()
Returns the entity tag of the body, as specified by the ETag header.

Returns:
the entity tag

setExpires

public void setExpires(long expires)
Sets the date and time at which the message is no longer valid, as specified by the Expires header.

The date should be specified as the number of milliseconds since January 1, 1970 GMT.

Parameters:
expires - the new expires header value

getExpires

public long getExpires()
Returns the date and time at which the message is no longer valid, as specified by the Expires header.

The date is returned as the number of milliseconds since January 1, 1970 GMT. Returns -1 when the date is unknown.

Returns:
the expires value

setIfModifiedSince

public void setIfModifiedSince(long ifModifiedSince)
Sets the (new) value of the If-Modified-Since header.

The date should be specified as the number of milliseconds since January 1, 1970 GMT.

Parameters:
ifModifiedSince - the new value of the header

getIfNotModifiedSince

public long getIfNotModifiedSince()
Returns the value of the IfModifiedSince header.

The date is returned as the number of milliseconds since January 1, 1970 GMT. Returns -1 when the date is unknown.

Returns:
the header value

setIfNoneMatch

public void setIfNoneMatch(String ifNoneMatch)
Sets the (new) value of the If-None-Match header.

Parameters:
ifNoneMatch - the new value of the header

setIfNoneMatch

public void setIfNoneMatch(List<String> ifNoneMatchList)
Sets the (new) values of the If-None-Match header.

Parameters:
ifNoneMatchList - the new value of the header

getIfNoneMatch

public List<String> getIfNoneMatch()
Returns the value of the If-None-Match header.

Returns:
the header value

setLastModified

public void setLastModified(long lastModified)
Sets the time the resource was last changed, as specified by the Last-Modified header.

The date should be specified as the number of milliseconds since January 1, 1970 GMT.

Parameters:
lastModified - the last modified date

getLastModified

public long getLastModified()
Returns the time the resource was last changed, as specified by the Last-Modified header.

The date is returned as the number of milliseconds since January 1, 1970 GMT. Returns -1 when the date is unknown.

Returns:
the last modified date

setLocation

public void setLocation(URI location)
Set the (new) location of a resource, as specified by the Location header.

Parameters:
location - the location

getLocation

public URI getLocation()
Return the (new) location of a resource, as specified by the Location header.

Returns null when the location is unknown.

Returns:
the location

setPragma

public void setPragma(String pragma)
Sets the (new) value of the Pragma header.

Parameters:
pragma - the value of the header

getPragma

public String getPragma()
Returns the value of the Pragma header.

Returns:
the value of the header

getFirst

public String getFirst(String headerName)
Return the first header value for the given header name, if any.

Specified by:
getFirst in interface MultiValueMap<String,String>
Parameters:
headerName - the header name
Returns:
the first header value; or null

add

public void add(String headerName,
                String headerValue)
Add the given, single header value under the given name.

Specified by:
add in interface MultiValueMap<String,String>
Parameters:
headerName - the header name
headerValue - the header value
Throws:
UnsupportedOperationException - if adding headers is not supported
See Also:
put(String, List), set(String, String)

set

public void set(String headerName,
                String headerValue)
Set the given, single header value under the given name.

Specified by:
set in interface MultiValueMap<String,String>
Parameters:
headerName - the header name
headerValue - the header value
Throws:
UnsupportedOperationException - if adding headers is not supported
See Also:
put(String, List), add(String, String)

setAll

public void setAll(Map<String,String> values)
Description copied from interface: MultiValueMap
Set the given values under.

Specified by:
setAll in interface MultiValueMap<String,String>
Parameters:
values - the values.

toSingleValueMap

public Map<String,String> toSingleValueMap()
Description copied from interface: MultiValueMap
Returns the first values contained in this MultiValueMap.

Specified by:
toSingleValueMap in interface MultiValueMap<String,String>
Returns:
a single value representation of this map

size

public int size()
Specified by:
size in interface Map<String,List<String>>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Map<String,List<String>>

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map<String,List<String>>

containsValue

public boolean containsValue(Object value)
Specified by:
containsValue in interface Map<String,List<String>>

get

public List<String> get(Object key)
Specified by:
get in interface Map<String,List<String>>

put

public List<String> put(String key,
                        List<String> value)
Specified by:
put in interface Map<String,List<String>>

remove

public List<String> remove(Object key)
Specified by:
remove in interface Map<String,List<String>>

putAll

public void putAll(Map<? extends String,? extends List<String>> m)
Specified by:
putAll in interface Map<String,List<String>>

clear

public void clear()
Specified by:
clear in interface Map<String,List<String>>

keySet

public Set<String> keySet()
Specified by:
keySet in interface Map<String,List<String>>

values

public Collection<List<String>> values()
Specified by:
values in interface Map<String,List<String>>

entrySet

public Set<Map.Entry<String,List<String>>> entrySet()
Specified by:
entrySet in interface Map<String,List<String>>

equals

public boolean equals(Object other)
Specified by:
equals in interface Map<String,List<String>>
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface Map<String,List<String>>
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MediaType

org.springframework.http
Class MediaType

java.lang.Object
    extended by  org.springframework.http.MediaType
All Implemented Interfaces:
Comparable<MediaType>
public class MediaType
extends Object
implements Comparable<MediaType>

Represents an Internet Media Type, as defined in the HTTP specification.

Consists of a type and a subtype. Also has functionality to parse media types from a string using parseMediaType(String), or multiple comma-separated media types using parseMediaTypes(String).

Since:
3.0
Author:
Arjen Poutsma, Juergen Hoeller
See Also:
HTTP 1.1, section 3.7

Field Summary
static MediaType | ALL Public constant media type that includes all media ranges (i.e.
static MediaType | APPLICATION_ATOM_XML Public constant media type for application/atom+xml.
static MediaType | APPLICATION_FORM_URLENCODED Public constant media type for application/x-www-form-urlencoded.
static MediaType | APPLICATION_JSON Public constant media type for application/json.
static MediaType | APPLICATION_OCTET_STREAM Public constant media type for application/octet-stream.
static MediaType | APPLICATION_XHTML_XML Public constant media type for application/xhtml+xml.
static MediaType | APPLICATION_XML Public constant media type for image/xml.
static MediaType | IMAGE_GIF Public constant media type for image/gif.
static MediaType | IMAGE_JPEG Public constant media type for image/jpeg.
static MediaType | IMAGE_PNG Public constant media type for image/png.
static MediaType | MULTIPART_FORM_DATA Public constant media type for multipart/form-data.
static MediaType | TEXT_HTML Public constant media type for text/html.
static MediaType | TEXT_PLAIN Public constant media type for text/plain.
static MediaType | TEXT_XML Public constant media type for text/xml.
Constructor Summary
MediaType(MediaType other, Map<String,String> parameters)
Copy-constructor that copies the type and subtype of the given MediaType, and allows for different parameter.
MediaType(String type)
Create a new MediaType for the given primary type.
MediaType(String type, String subtype)
Create a new MediaType for the given primary type and subtype.
MediaType(String type, String subtype, Charset charSet)
Create a new MediaType for the given type, subtype, and character set.
MediaType(String type, String subtype, double qualityValue)
Create a new MediaType for the given type, subtype, and quality value.
MediaType(String type, String subtype, Map<String,String> parameters)
Create a new MediaType for the given type, subtype, and parameters.
Method Summary
int | compareTo(MediaType other) Compares this MediaType to another alphabetically.
boolean | equals(Object other)
Charset | getCharSet() Return the character set, as indicated by a charset parameter, if any.
String | getParameter(String name) Return a generic parameter value, given a parameter name.
double | getQualityValue() Return the quality value, as indicated by a q parameter, if any.
String | getSubtype() Return the subtype.
String | getType() Return the primary type.
int | hashCode()
boolean | includes(MediaType other) Indicate whether this MediaType includes the given media type.
boolean | isCompatibleWith(MediaType other) Indicate whether this MediaType is compatible with the given media type.
boolean | isWildcardSubtype() Indicate whether the subtype is the wildcard character * or not.
boolean | isWildcardType() Indicate whether the type is the wildcard character * or not.
static MediaType | parseMediaType(String mediaType) Parse the given String into a single MediaType.
static List<MediaType> | parseMediaTypes(String mediaTypes) Parse the given, comma-seperated string into a list of MediaType objects.
static void | sortByQualityValue(List<MediaType> mediaTypes) Sorts the given list of MediaType objects by quality value.
static void | sortBySpecificity(List<MediaType> mediaTypes) Sorts the given list of MediaType objects by specificity.
String | toString()
static String | toString(Collection<MediaType> mediaTypes) Return a string representation of the given list of MediaType objects.
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail

ALL

public static final MediaType ALL
Public constant media type that includes all media ranges (i.e. */*).

APPLICATION_ATOM_XML

public static final MediaType APPLICATION_ATOM_XML
Public constant media type for application/atom+xml.

APPLICATION_FORM_URLENCODED

public static final MediaType APPLICATION_FORM_URLENCODED
Public constant media type for application/x-www-form-urlencoded.

APPLICATION_JSON

public static final MediaType APPLICATION_JSON
Public constant media type for application/json.

APPLICATION_OCTET_STREAM

public static final MediaType APPLICATION_OCTET_STREAM
Public constant media type for application/octet-stream.

APPLICATION_XHTML_XML

public static final MediaType APPLICATION_XHTML_XML
Public constant media type for application/xhtml+xml.

IMAGE_GIF

public static final MediaType IMAGE_GIF
Public constant media type for image/gif.

IMAGE_JPEG

public static final MediaType IMAGE_JPEG
Public constant media type for image/jpeg.

IMAGE_PNG

public static final MediaType IMAGE_PNG
Public constant media type for image/png.

APPLICATION_XML

public static final MediaType APPLICATION_XML
Public constant media type for image/xml.

MULTIPART_FORM_DATA

public static final MediaType MULTIPART_FORM_DATA
Public constant media type for multipart/form-data.

TEXT_HTML

public static final MediaType TEXT_HTML
Public constant media type for text/html.

TEXT_PLAIN

public static final MediaType TEXT_PLAIN
Public constant media type for text/plain.

TEXT_XML

public static final MediaType TEXT_XML
Public constant media type for text/xml.

Constructor Detail

MediaType

public MediaType(String type)
Create a new MediaType for the given primary type.

The subtype is set to *, parameters empty.

Parameters:
type - the primary type
Throws:
IllegalArgumentException - if any of the parameters contain illegal characters

MediaType

public MediaType(String type,
                 String subtype)
Create a new MediaType for the given primary type and subtype.

The parameters are empty.

Parameters:
type - the primary type
subtype - the subtype
Throws:
IllegalArgumentException - if any of the parameters contain illegal characters

MediaType

public MediaType(String type,
                 String subtype,
                 Charset charSet)
Create a new MediaType for the given type, subtype, and character set.

Parameters:
type - the primary type
subtype - the subtype
charSet - the character set
Throws:
IllegalArgumentException - if any of the parameters contain illegal characters

MediaType

public MediaType(String type,
                 String subtype,
                 double qualityValue)
Create a new MediaType for the given type, subtype, and quality value.

Parameters:
type - the primary type
subtype - the subtype
qualityValue - the quality value
Throws:
IllegalArgumentException - if any of the parameters contain illegal characters

MediaType

public MediaType(MediaType other,
                 Map<String,String> parameters)
Copy-constructor that copies the type and subtype of the given MediaType, and allows for different parameter.

Parameters:
other - the other media type
parameters - the parameters, may be null
Throws:
IllegalArgumentException - if any of the parameters contain illegal characters

MediaType

public MediaType(String type,
                 String subtype,
                 Map<String,String> parameters)
Create a new MediaType for the given type, subtype, and parameters.

Parameters:
type - the primary type
subtype - the subtype
parameters - the parameters, may be null
Throws:
IllegalArgumentException - if any of the parameters contain illegal characters
Method Detail

getType

public String getType()
Return the primary type.

isWildcardType

public boolean isWildcardType()
Indicate whether the type is the wildcard character * or not.

getSubtype

public String getSubtype()
Return the subtype.

isWildcardSubtype

public boolean isWildcardSubtype()
Indicate whether the subtype is the wildcard character * or not.

Returns:
whether the subtype is *

getCharSet

public Charset getCharSet()
Return the character set, as indicated by a charset parameter, if any.

Returns:
the character set; or null if not available

getQualityValue

public double getQualityValue()
Return the quality value, as indicated by a q parameter, if any. Defaults to 1.0.

Returns:
the quality factory

getParameter

public String getParameter(String name)
Return a generic parameter value, given a parameter name.

Parameters:
name - the parameter name
Returns:
the parameter value; or null if not present

includes

public boolean includes(MediaType other)
Indicate whether this MediaType includes the given media type.

For instance, text/* includes text/plain, text/html, and application/*+xml includes application/soap+xml, etc. This method is non-symmetic.

Parameters:
other - the reference media type with which to compare
Returns:
true if this media type includes the given media type; false otherwise

isCompatibleWith

public boolean isCompatibleWith(MediaType other)
Indicate whether this MediaType is compatible with the given media type.

For instance, text/* is compatible with text/plain, text/html, and vice versa. In effect, this method is similar to includes(MediaType), except that it's symmetric.

Parameters:
other - the reference media type with which to compare
Returns:
true if this media type is compatible with the given media type; false otherwise

compareTo

public int compareTo(MediaType other)
Compares this MediaType to another alphabetically.

Specified by:
compareTo in interface Comparable<MediaType>
Parameters:
other - media type to compare to
See Also:
sortBySpecificity(List)

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

parseMediaType

public static MediaType parseMediaType(String mediaType)
Parse the given String into a single MediaType.

Parameters:
mediaType - the string to parse
Returns:
the media type
Throws:
IllegalArgumentException - if the string cannot be parsed

parseMediaTypes

public static List<MediaType> parseMediaTypes(String mediaTypes)
Parse the given, comma-seperated string into a list of MediaType objects.

This method can be used to parse an Accept or Content-Type header.

Parameters:
mediaTypes - the string to parse
Returns:
the list of media types
Throws:
IllegalArgumentException - if the string cannot be parsed

toString

public static String toString(Collection<MediaType> mediaTypes)
Return a string representation of the given list of MediaType objects.

This method can be used to for an Accept or Content-Type header.

Parameters:
mediaTypes - the string to parse
Returns:
the list of media types
Throws:
IllegalArgumentException - if the String cannot be parsed

sortBySpecificity

public static void sortBySpecificity(List<MediaType> mediaTypes)
Sorts the given list of MediaType objects by specificity.

Given two media types:

  1. if either media type has a wildcard type, then the media type without the wildcard is ordered before the other.
  2. if the two media types have different types, then they are considered equal and remain their current order.
  3. if either media type has a wildcard subtype, then the media type without the wildcard is sorted before the other.
  4. if the two media types have different subtypes, then they are considered equal and remain their current order.
  5. if the two media types have different quality value, then the media type with the highest quality value is ordered before the other.
  6. if the two media types have a different amount of parameters, then the media type with the most parameters is ordered before the other.

For example:

audio/basic < audio/* < */*
audio/* < audio/*;q=0.7; audio/*;q=0.3
audio/basic;level=1 < audio/basic
audio/basic == text/html
audio/basic == audio/wave

Parameters:
mediaTypes - the list of media types to be sorted
See Also:
HTTP 1.1, section 14.1

sortByQualityValue

public static void sortByQualityValue(List<MediaType> mediaTypes)
Sorts the given list of MediaType objects by quality value.

Given two media types:

  1. if the two media types have different quality value, then the media type with the highest quality value is ordered before the other.
  2. if either media type has a wildcard type, then the media type without the wildcard is ordered before the other.
  3. if the two media types have different types, then they are considered equal and remain their current order.
  4. if either media type has a wildcard subtype, then the media type without the wildcard is sorted before the other.
  5. if the two media types have different subtypes, then they are considered equal and remain their current order.
  6. if the two media types have a different amount of parameters, then the media type with the most parameters is ordered before the other.

Parameters:
mediaTypes - the list of media types to be sorted
See Also:
getQualityValue()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MediaTypeEditor

org.springframework.http
Class MediaTypeEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.http.MediaTypeEditor
All Implemented Interfaces:
PropertyEditor
public class MediaTypeEditor
extends PropertyEditorSupport

Editor for MediaType descriptors, to automatically convert String specifications (e.g. "text/html") to MediaType properties.

Since:
3.0
Author:
Juergen Hoeller
See Also:
MediaType

Constructor Summary
MediaTypeEditor()
Method Summary
String | getAsText()
void | setAsText(String text)
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MediaTypeEditor

public MediaTypeEditor()
Method Detail

setAsText

public void setAsText(String text)
Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport

getAsText

public String getAsText()
Specified by:
getAsText in interface PropertyEditor
Overrides:
getAsText in class PropertyEditorSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResponseEntity

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.http
Class ResponseEntity<T>

java.lang.Object
    extended by  org.springframework.http.HttpEntity<T>
        extended by  org.springframework.http.ResponseEntity<T>

public class ResponseEntity<T>
extends HttpEntity<T>

Extension of HttpEntity that adds a HttpStatus status code.

Returned by RestTemplate.getForEntity(java.lang.String, java.lang.Class, java.lang.Object...):

 ResponseEntity<String> entity = template.getForEntity("http://example.com", String.class);
 String body = entity.getBody();
 MediaType contentType = entity.getHeaders().getContentType();
 HttpStatus statusCode = entity.getStatusCode();
Can also be used in Spring MVC, as a return value from a @Controller method:

Can be used in Spring MVC, as a return value from a @Controller method:

 @RequestMapping("/handle")
 public ResponseEntity<String> handle() {
   HttpHeaders responseHeaders = new HttpHeaders();
   responseHeaders.set("MyResponseHeader", "MyValue");
   return new ResponseEntity<String>("Hello World", responseHeaders, HttpStatus.CREATED);
 }

Since:
3.0.2
Author:
Arjen Poutsma
See Also:
getStatusCode()

Field Summary
Fields inherited from class org.springframework.http.HttpEntity
EMPTY
Constructor Summary
ResponseEntity(MultiValueMap<String,String> headers, HttpStatus statusCode)
Create a new HttpEntity with the given headers and status code, and no body.
ResponseEntity(T body, HttpStatus statusCode)
Create a new ResponseEntity with the given body and status code, and no headers.
ResponseEntity(T body, MultiValueMap<String,String> headers, HttpStatus statusCode)
Create a new HttpEntity with the given body, headers, and status code.
Method Summary
 HttpStatus getStatusCode()
Return the HTTP status code of the response.
Methods inherited from class org.springframework.http.HttpEntity
getBody, getHeaders, hasBody
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ResponseEntity

public ResponseEntity(T body,
                      HttpStatus statusCode)
Create a new ResponseEntity with the given body and status code, and no headers.

Parameters:
body - the entity body
statusCode - the status code

ResponseEntity

public ResponseEntity(MultiValueMap<String,String> headers,
                      HttpStatus statusCode)
Create a new HttpEntity with the given headers and status code, and no body.

Parameters:
headers - the entity headers
statusCode - the status code

ResponseEntity

public ResponseEntity(T body,
                      MultiValueMap<String,String> headers,
                      HttpStatus statusCode)
Create a new HttpEntity with the given body, headers, and status code.

Parameters:
body - the entity body
headers - the entity headers
statusCode - the status code
Method Detail

getStatusCode

public HttpStatus getStatusCode()
Return the HTTP status code of the response.

Returns:
the HTTP status as an HttpStatus enum value
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


HttpMethod

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

org.springframework.http
Enum HttpMethod

java.lang.Object
    extended by  java.lang.Enum<HttpMethod>
        extended by  org.springframework.http.HttpMethod
All Implemented Interfaces:
Serializable, Comparable<HttpMethod>
public enum HttpMethod
extends Enum<HttpMethod>

Java 5 enumeration of HTTP request methods. Intended for use with ClientHttpRequest and RestTemplate.

Since:
3.0
Author:
Arjen Poutsma

Enum Constant Summary
DELETE
GET
HEAD
OPTIONS
POST
PUT
TRACE
Method Summary
static HttpMethod | valueOf(String name) Returns the enum constant of this type with the specified name.
static HttpMethod[] | values() Returns an array containing the constants of this enum type, in the order they are declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

GET

public static final HttpMethod GET

POST

public static final HttpMethod POST

HEAD

public static final HttpMethod HEAD

OPTIONS

public static final HttpMethod OPTIONS

PUT

public static final HttpMethod PUT

DELETE

public static final HttpMethod DELETE

TRACE

public static final HttpMethod TRACE
Method Detail

values

public static HttpMethod[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (HttpMethod c : HttpMethod.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static HttpMethod valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


HttpStatus

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

org.springframework.http
Enum HttpStatus

java.lang.Object
    extended by  java.lang.Enum<HttpStatus>
        extended by  org.springframework.http.HttpStatus
All Implemented Interfaces:
Serializable, Comparable<HttpStatus>
public enum HttpStatus
extends Enum<HttpStatus>

Java 5 enumeration of HTTP status codes.

The HTTP status code series can be retrieved via series().

Author:
Arjen Poutsma
See Also:
HttpStatus.Series, HTTP Status Code Registry

Nested Class Summary
static class HttpStatus.Series
Java 5 enumeration of HTTP status series.
Enum Constant Summary
ACCEPTED
202 Accepted.
ALREADY_REPORTED
208 Already Reported.
BAD_GATEWAY
502 Bad Gateway.
BAD_REQUEST
400 Bad Request.
CONFLICT
409 Conflict.
CONTINUE
100 Continue.
CREATED
201 Created.
DESTINATION_LOCKED
421 Destination Locked.
EXPECTATION_FAILED
417 Expectation Failed.
FAILED_DEPENDENCY
424 Failed Dependency.
FORBIDDEN
403 Forbidden.
FOUND
302 Found.
GATEWAY_TIMEOUT
504 Gateway Timeout.
GONE
410 Gone.
HTTP_VERSION_NOT_SUPPORTED
505 HTTP Version Not Supported.
IM_USED
226 IM Used.
INSUFFICIENT_SPACE_ON_RESOURCE
419 Insufficient Space on Resource.
INSUFFICIENT_STORAGE
507 Insufficient Storage
INTERNAL_SERVER_ERROR
500 Internal Server Error.
LENGTH_REQUIRED
411 Length Required.
LOCKED
423 Locked.
LOOP_DETECTED
508 Loop Detected
METHOD_FAILURE
420 Method Failure.
METHOD_NOT_ALLOWED
405 Method Not Allowed.
MOVED_PERMANENTLY
301 Moved Permanently.
MOVED_TEMPORARILY
302 Moved Temporarily.
MULTI_STATUS
207 Multi-Status.
MULTIPLE_CHOICES
300 Multiple Choices.
NO_CONTENT
204 No Content.
NON_AUTHORITATIVE_INFORMATION
203 Non-Authoritative Information.
NOT_ACCEPTABLE
406 Not Acceptable.
NOT_EXTENDED
510 Not Extended
NOT_FOUND
404 Not Found.
NOT_IMPLEMENTED
501 Not Implemented.
NOT_MODIFIED
304 Not Modified.
OK
200 OK.
PARTIAL_CONTENT
206 Partial Content.
PAYMENT_REQUIRED
402 Payment Required.
PRECONDITION_FAILED
412 Precondition failed.
PROCESSING
102 Processing.
PROXY_AUTHENTICATION_REQUIRED
407 Proxy Authentication Required.
REQUEST_ENTITY_TOO_LARGE
413 Request Entity Too Large.
REQUEST_TIMEOUT
408 Request Timeout.
REQUEST_URI_TOO_LONG
414 Request-URI Too Long.
REQUESTED_RANGE_NOT_SATISFIABLE
416 Requested Range Not Satisfiable.
RESET_CONTENT
205 Reset Content.
SEE_OTHER
303 See Other.
SERVICE_UNAVAILABLE
503 Service Unavailable.
SWITCHING_PROTOCOLS
101 Switching Protocols.
TEMPORARY_REDIRECT
307 Temporary Redirect.
UNAUTHORIZED
401 Unauthorized.
UNPROCESSABLE_ENTITY
422 Unprocessable Entity.
UNSUPPORTED_MEDIA_TYPE
415 Unsupported Media Type.
UPGRADE_REQUIRED
426 Upgrade Required.
USE_PROXY
305 Use Proxy.
VARIANT_ALSO_NEGOTIATES
506 Variant Also Negotiates
Method Summary
HttpStatus.Series | series() Returns the HTTP status series of this status code.
String | toString() Return a string representation of this status code.
int | value() Return the integer value of this status code.
static HttpStatus | valueOf(int statusCode) Return the enum constant of this type with the specified numeric value.
static HttpStatus | valueOf(String name) Returns the enum constant of this type with the specified name.
static HttpStatus[] | values() Returns an array containing the constants of this enum type, in the order they are declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

CONTINUE

public static final HttpStatus CONTINUE
100 Continue.

See Also:
HTTP/1.1

SWITCHING_PROTOCOLS

public static final HttpStatus SWITCHING_PROTOCOLS
101 Switching Protocols.

See Also:
HTTP/1.1

PROCESSING

public static final HttpStatus PROCESSING
102 Processing.

See Also:
WebDAV

OK

public static final HttpStatus OK
200 OK.

See Also:
HTTP/1.1

CREATED

public static final HttpStatus CREATED
201 Created.

See Also:
HTTP/1.1

ACCEPTED

public static final HttpStatus ACCEPTED
202 Accepted.

See Also:
HTTP/1.1

NON_AUTHORITATIVE_INFORMATION

public static final HttpStatus NON_AUTHORITATIVE_INFORMATION
203 Non-Authoritative Information.

See Also:
HTTP/1.1

NO_CONTENT

public static final HttpStatus NO_CONTENT
204 No Content.

See Also:
HTTP/1.1

RESET_CONTENT

public static final HttpStatus RESET_CONTENT
205 Reset Content.

See Also:
HTTP/1.1

PARTIAL_CONTENT

public static final HttpStatus PARTIAL_CONTENT
206 Partial Content.

See Also:
HTTP/1.1

MULTI_STATUS

public static final HttpStatus MULTI_STATUS
207 Multi-Status.

See Also:
WebDAV

ALREADY_REPORTED

public static final HttpStatus ALREADY_REPORTED
208 Already Reported.

See Also:
WebDAV Binding Extensions

IM_USED

public static final HttpStatus IM_USED
226 IM Used.

See Also:
Delta encoding in HTTP

MULTIPLE_CHOICES

public static final HttpStatus MULTIPLE_CHOICES
300 Multiple Choices.

See Also:
HTTP/1.1

MOVED_PERMANENTLY

public static final HttpStatus MOVED_PERMANENTLY
301 Moved Permanently.

See Also:
HTTP/1.1

FOUND

public static final HttpStatus FOUND
302 Found.

See Also:
HTTP/1.1

MOVED_TEMPORARILY

public static final HttpStatus MOVED_TEMPORARILY
302 Moved Temporarily.

See Also:
HTTP/1.0

SEE_OTHER

public static final HttpStatus SEE_OTHER
303 See Other.

See Also:
HTTP/1.1

NOT_MODIFIED

public static final HttpStatus NOT_MODIFIED
304 Not Modified.

See Also:
HTTP/1.1

USE_PROXY

public static final HttpStatus USE_PROXY
305 Use Proxy.

See Also:
HTTP/1.1

TEMPORARY_REDIRECT

public static final HttpStatus TEMPORARY_REDIRECT
307 Temporary Redirect.

See Also:
HTTP/1.1

BAD_REQUEST

public static final HttpStatus BAD_REQUEST
400 Bad Request.

See Also:
HTTP/1.1

UNAUTHORIZED

public static final HttpStatus UNAUTHORIZED
401 Unauthorized.

See Also:
HTTP/1.1

PAYMENT_REQUIRED

public static final HttpStatus PAYMENT_REQUIRED
402 Payment Required.

See Also:
HTTP/1.1

FORBIDDEN

public static final HttpStatus FORBIDDEN
403 Forbidden.

See Also:
HTTP/1.1

NOT_FOUND

public static final HttpStatus NOT_FOUND
404 Not Found.

See Also:
HTTP/1.1

METHOD_NOT_ALLOWED

public static final HttpStatus METHOD_NOT_ALLOWED
405 Method Not Allowed.

See Also:
HTTP/1.1

NOT_ACCEPTABLE

public static final HttpStatus NOT_ACCEPTABLE
406 Not Acceptable.

See Also:
HTTP/1.1

PROXY_AUTHENTICATION_REQUIRED

public static final HttpStatus PROXY_AUTHENTICATION_REQUIRED
407 Proxy Authentication Required.

See Also:
HTTP/1.1

REQUEST_TIMEOUT

public static final HttpStatus REQUEST_TIMEOUT
408 Request Timeout.

See Also:
HTTP/1.1

CONFLICT

public static final HttpStatus CONFLICT
409 Conflict.

See Also:
HTTP/1.1

GONE

public static final HttpStatus GONE
410 Gone.

See Also:
HTTP/1.1

LENGTH_REQUIRED

public static final HttpStatus LENGTH_REQUIRED
411 Length Required.

See Also:
HTTP/1.1

PRECONDITION_FAILED

public static final HttpStatus PRECONDITION_FAILED
412 Precondition failed.

See Also:
HTTP/1.1

REQUEST_ENTITY_TOO_LARGE

public static final HttpStatus REQUEST_ENTITY_TOO_LARGE
413 Request Entity Too Large.

See Also:
HTTP/1.1

REQUEST_URI_TOO_LONG

public static final HttpStatus REQUEST_URI_TOO_LONG
414 Request-URI Too Long.

See Also:
HTTP/1.1

UNSUPPORTED_MEDIA_TYPE

public static final HttpStatus UNSUPPORTED_MEDIA_TYPE
415 Unsupported Media Type.

See Also:
HTTP/1.1

REQUESTED_RANGE_NOT_SATISFIABLE

public static final HttpStatus REQUESTED_RANGE_NOT_SATISFIABLE
416 Requested Range Not Satisfiable.

See Also:
HTTP/1.1

EXPECTATION_FAILED

public static final HttpStatus EXPECTATION_FAILED
417 Expectation Failed.

See Also:
HTTP/1.1

INSUFFICIENT_SPACE_ON_RESOURCE

public static final HttpStatus INSUFFICIENT_SPACE_ON_RESOURCE
419 Insufficient Space on Resource.

See Also:
WebDAV Draft

METHOD_FAILURE

public static final HttpStatus METHOD_FAILURE
420 Method Failure.

See Also:
WebDAV Draft

DESTINATION_LOCKED

public static final HttpStatus DESTINATION_LOCKED
421 Destination Locked.

See Also:
WebDAV Draft

UNPROCESSABLE_ENTITY

public static final HttpStatus UNPROCESSABLE_ENTITY
422 Unprocessable Entity.

See Also:
WebDAV

LOCKED

public static final HttpStatus LOCKED
423 Locked.

See Also:
WebDAV

FAILED_DEPENDENCY

public static final HttpStatus FAILED_DEPENDENCY
424 Failed Dependency.

See Also:
WebDAV

UPGRADE_REQUIRED

public static final HttpStatus UPGRADE_REQUIRED
426 Upgrade Required.

See Also:
Upgrading to TLS Within HTTP/1.1

INTERNAL_SERVER_ERROR

public static final HttpStatus INTERNAL_SERVER_ERROR
500 Internal Server Error.

See Also:
HTTP/1.1

NOT_IMPLEMENTED

public static final HttpStatus NOT_IMPLEMENTED
501 Not Implemented.

See Also:
HTTP/1.1

BAD_GATEWAY

public static final HttpStatus BAD_GATEWAY
502 Bad Gateway.

See Also:
HTTP/1.1

SERVICE_UNAVAILABLE

public static final HttpStatus SERVICE_UNAVAILABLE
503 Service Unavailable.

See Also:
HTTP/1.1

GATEWAY_TIMEOUT

public static final HttpStatus GATEWAY_TIMEOUT
504 Gateway Timeout.

See Also:
HTTP/1.1

HTTP_VERSION_NOT_SUPPORTED

public static final HttpStatus HTTP_VERSION_NOT_SUPPORTED
505 HTTP Version Not Supported.

See Also:
HTTP/1.1

VARIANT_ALSO_NEGOTIATES

public static final HttpStatus VARIANT_ALSO_NEGOTIATES
506 Variant Also Negotiates

See Also:
Transparent Content Negotiation

INSUFFICIENT_STORAGE

public static final HttpStatus INSUFFICIENT_STORAGE
507 Insufficient Storage

See Also:
WebDAV

LOOP_DETECTED

public static final HttpStatus LOOP_DETECTED
508 Loop Detected

See Also:
WebDAV Binding Extensions

NOT_EXTENDED

public static final HttpStatus NOT_EXTENDED
510 Not Extended

See Also:
HTTP Extension Framework
Method Detail

values

public static HttpStatus[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (HttpStatus c : HttpStatus.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static HttpStatus valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

value

public int value()
Return the integer value of this status code.

series

public HttpStatus.Series series()
Returns the HTTP status series of this status code.

See Also:
HttpStatus.Series

toString

public String toString()
Return a string representation of this status code.

Overrides:
toString in class Enum<HttpStatus>

valueOf

public static HttpStatus valueOf(int statusCode)
Return the enum constant of this type with the specified numeric value.

Parameters:
statusCode - the numeric value of the enum to be returned
Returns:
the enum constant with the specified numeric value
Throws:
IllegalArgumentException - if this enum has no constant for the specified numeric value
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


HttpStatus.Series

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

org.springframework.http
Enum HttpStatus.Series

java.lang.Object
    extended by  java.lang.Enum<HttpStatus.Series>
        extended by  org.springframework.http.HttpStatus.Series
All Implemented Interfaces:
Serializable, Comparable<HttpStatus.Series>
Enclosing class:
HttpStatus
public static enum HttpStatus.Series
extends Enum<HttpStatus.Series>

Java 5 enumeration of HTTP status series.

Retrievable via HttpStatus.series().

Enum Constant Summary
CLIENT_ERROR
INFORMATIONAL
REDIRECTION
SERVER_ERROR
SUCCESSFUL
Method Summary
int | value() Return the integer value of this status series.
static HttpStatus.Series | valueOf(String name) Returns the enum constant of this type with the specified name.
static HttpStatus.Series[] | values() Returns an array containing the constants of this enum type, in the order they are declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

INFORMATIONAL

public static final HttpStatus.Series INFORMATIONAL

SUCCESSFUL

public static final HttpStatus.Series SUCCESSFUL

REDIRECTION

public static final HttpStatus.Series REDIRECTION

CLIENT_ERROR

public static final HttpStatus.Series CLIENT_ERROR

SERVER_ERROR

public static final HttpStatus.Series SERVER_ERROR
Method Detail

values

public static HttpStatus.Series[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (HttpStatus.Series c : HttpStatus.Series.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static HttpStatus.Series valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

value

public int value()
Return the integer value of this status series. Ranges from 1 to 5.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


org.springframework.http.client

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.http.client

Contains an abstraction over client-side HTTP.

See:
Description

Interface Summary
ClientHttpRequest | Represents a client-side HTTP request.
ClientHttpRequestFactory | Factory for ClientHttpRequest objects.
ClientHttpResponse | Represents a client-side HTTP response.

Class Summary
AbstractClientHttpRequest | Abstract base for ClientHttpRequest that makes sure that headers and body are not written multiple times.
CommonsClientHttpRequestFactory | ClientHttpRequestFactory implementation that uses Jakarta Commons HttpClient to create requests.
SimpleClientHttpRequestFactory | ClientHttpRequestFactory implementation that uses standard J2SE facilities.

Package org.springframework.http.client Description

Contains an abstraction over client-side HTTP. This package contains the ClientHttpRequest and ClientHttpResponse, as well as a basic implementation of these interfaces.


org.springframework.http.client Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.http.client

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.http.client.AbstractClientHttpRequest (implements org.springframework.http.client.ClientHttpRequest)
    • org.springframework.http.client.CommonsClientHttpRequestFactory (implements org.springframework.http.client.ClientHttpRequestFactory, org.springframework.beans.factory.DisposableBean)
    • org.springframework.http.client.SimpleClientHttpRequestFactory (implements org.springframework.http.client.ClientHttpRequestFactory)

Interface Hierarchy

  • org.springframework.http.client.ClientHttpRequestFactory
  • org.springframework.http.HttpMessage
    • org.springframework.http.HttpInputMessage
      • org.springframework.http.client.ClientHttpResponse
    • org.springframework.http.HttpOutputMessage
      • org.springframework.http.client.ClientHttpRequest


ClientHttpRequest

org.springframework.http.client
Interface ClientHttpRequest

All Superinterfaces:
HttpMessage, HttpOutputMessage
All Known Implementing Classes:
AbstractClientHttpRequest
public interface ClientHttpRequest
extends HttpOutputMessage

Represents a client-side HTTP request. Created via an implementation of the ClientHttpRequestFactory.

A HttpRequest can be executed, getting a ClientHttpResponse which can be read from.

Since:
3.0
Author:
Arjen Poutsma
See Also:
ClientHttpRequestFactory.createRequest(java.net.URI, HttpMethod)

Method Summary
ClientHttpResponse | execute() Execute this request, resulting in a ClientHttpResponse that can be read.
HttpMethod | getMethod() Return the HTTP method of the request.
Methods inherited from interface org.springframework.http.HttpOutputMessage
getBody
Methods inherited from interface org.springframework.http.HttpMessage
getHeaders

Method Detail

getMethod

HttpMethod getMethod()
Return the HTTP method of the request.

Returns:
the HTTP method as an HttpMethod enum value

execute

ClientHttpResponse execute()
                           throws IOException
Execute this request, resulting in a ClientHttpResponse that can be read.

Returns:
the response result of the execution
Throws:
IOException - in case of I/O errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ClientHttpRequestFactory

org.springframework.http.client
Interface ClientHttpRequestFactory

All Known Implementing Classes:
CommonsClientHttpRequestFactory, SimpleClientHttpRequestFactory
public interface ClientHttpRequestFactory

Factory for ClientHttpRequest objects. Requests are created by the createRequest(URI, HttpMethod) method.

Since:
3.0
Author:
Arjen Poutsma

Method Summary
 ClientHttpRequest createRequest(URI uri, HttpMethod httpMethod)
Create a new ClientHttpRequest for the specified URI and HTTP method.

Method Detail

createRequest

ClientHttpRequest createRequest(URI uri,
                                HttpMethod httpMethod)
                                throws IOException
Create a new ClientHttpRequest for the specified URI and HTTP method.

The returned request can be written to, and then executed by calling ClientHttpRequest.execute().

Parameters:
uri - the URI to create a request for
httpMethod - the HTTP method to execute
Returns:
the created request
Throws:
IOException - in case of I/O errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ClientHttpResponse

org.springframework.http.client
Interface ClientHttpResponse

All Superinterfaces:
HttpInputMessage, HttpMessage
public interface ClientHttpResponse
extends HttpInputMessage

Represents a client-side HTTP response. Obtained via an calling of the ClientHttpRequest.execute().

A ClientHttpResponse must be closed, typically in a finally block.

Since:
3.0
Author:
Arjen Poutsma

Method Summary
void | close() Closes this response, freeing any resources created.
HttpStatus | getStatusCode() Return the HTTP status code of the response.
String | getStatusText() Return the HTTP status text of the response.
Methods inherited from interface org.springframework.http.HttpInputMessage
getBody
Methods inherited from interface org.springframework.http.HttpMessage
getHeaders

Method Detail

getStatusCode

HttpStatus getStatusCode()
                         throws IOException
Return the HTTP status code of the response.

Returns:
the HTTP status as an HttpStatus enum value
Throws:
IOException - in case of I/O errors

getStatusText

String getStatusText()
                     throws IOException
Return the HTTP status text of the response.

Returns:
the HTTP status text
Throws:
IOException - in case of I/O errors

close

void close()
Closes this response, freeing any resources created.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractClientHttpRequest

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.http.client
Class AbstractClientHttpRequest

java.lang.Object
    extended by  org.springframework.http.client.AbstractClientHttpRequest
All Implemented Interfaces:
ClientHttpRequest, HttpMessage, HttpOutputMessage
public abstract class AbstractClientHttpRequest
extends Object
implements ClientHttpRequest

Abstract base for ClientHttpRequest that makes sure that headers and body are not written multiple times.

Since:
3.0
Author:
Arjen Poutsma

Constructor Summary
AbstractClientHttpRequest()
Method Summary
ClientHttpResponse | execute() Execute this request, resulting in a ClientHttpResponse that can be read.
protected abstract ClientHttpResponse | executeInternal(HttpHeaders headers, byte[] bufferedOutput) Abstract template method that writes the given headers and content to the HTTP request.
OutputStream | getBody() Return the body of the message as an output stream.
HttpHeaders | getHeaders() Return the headers of this message.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.http.client.ClientHttpRequest
getMethod

Constructor Detail

AbstractClientHttpRequest

public AbstractClientHttpRequest()
Method Detail

getHeaders

public final HttpHeaders getHeaders()
Description copied from interface: HttpMessage
Return the headers of this message.

Specified by:
getHeaders in interface HttpMessage
Returns:
a corresponding HttpHeaders object

getBody

public final OutputStream getBody()
                           throws IOException
Description copied from interface: HttpOutputMessage
Return the body of the message as an output stream.

Specified by:
getBody in interface HttpOutputMessage
Returns:
the output stream body
Throws:
IOException - in case of I/O Errors

execute

public final ClientHttpResponse execute()
                                 throws IOException
Description copied from interface: ClientHttpRequest
Execute this request, resulting in a ClientHttpResponse that can be read.

Specified by:
execute in interface ClientHttpRequest
Returns:
the response result of the execution
Throws:
IOException - in case of I/O errors

executeInternal

protected abstract ClientHttpResponse executeInternal(HttpHeaders headers,
                                                      byte[] bufferedOutput)
                                               throws IOException
Abstract template method that writes the given headers and content to the HTTP request.

Parameters:
headers - the HTTP headers
bufferedOutput - the body content
Returns:
the response object for the executed request
Throws:
IOException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


CommonsClientHttpRequestFactory

org.springframework.http.client
Class CommonsClientHttpRequestFactory

java.lang.Object
    extended by  org.springframework.http.client.CommonsClientHttpRequestFactory
All Implemented Interfaces:
DisposableBean, ClientHttpRequestFactory
public class CommonsClientHttpRequestFactory
extends Object
implements ClientHttpRequestFactory, DisposableBean

ClientHttpRequestFactory implementation that uses Jakarta Commons HttpClient to create requests.

Allows to use a pre-configured HttpClient instance - potentially with authentication, HTTP connection pooling, etc.

Since:
3.0
Author:
Arjen Poutsma
See Also:
SimpleClientHttpRequestFactory

Constructor Summary
CommonsClientHttpRequestFactory()
Create a new instance of the CommonsHttpRequestFactory with a default HttpClient that uses a default MultiThreadedHttpConnectionManager.
CommonsClientHttpRequestFactory(HttpClient httpClient)
Create a new instance of the CommonsHttpRequestFactory with the given HttpClient instance.
Method Summary
protected HttpMethodBase | createCommonsHttpMethod(HttpMethod httpMethod, String uri) Create a Commons HttpMethodBase object for the given HTTP method and URI specification.
ClientHttpRequest | createRequest(URI uri, HttpMethod httpMethod) Create a new ClientHttpRequest for the specified URI and HTTP method.
void | destroy() Shutdown hook that closes the underlying HttpConnectionManager's connection pool, if any.
HttpClient | getHttpClient() Return the HttpClient used by this factory.
protected void | postProcessCommonsHttpMethod(HttpMethodBase httpMethod) Template method that allows for manipulating the HttpMethodBase before it is returned as part of a CommonsClientHttpRequest.
void | setHttpClient(HttpClient httpClient) Set the HttpClient used by this factory.
void | setReadTimeout(int timeout) Set the socket read timeout for the underlying HttpClient.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CommonsClientHttpRequestFactory

public CommonsClientHttpRequestFactory()
Create a new instance of the CommonsHttpRequestFactory with a default HttpClient that uses a default MultiThreadedHttpConnectionManager.

CommonsClientHttpRequestFactory

public CommonsClientHttpRequestFactory(HttpClient httpClient)
Create a new instance of the CommonsHttpRequestFactory with the given HttpClient instance.

Parameters:
httpClient - the HttpClient instance to use for this factory
Method Detail

setHttpClient

public void setHttpClient(HttpClient httpClient)
Set the HttpClient used by this factory.

getHttpClient

public HttpClient getHttpClient()
Return the HttpClient used by this factory.

setReadTimeout

public void setReadTimeout(int timeout)
Set the socket read timeout for the underlying HttpClient. A value of 0 means never timeout.

Parameters:
timeout - the timeout value in milliseconds
See Also:
HttpConnectionParams.setSoTimeout(int)

createRequest

public ClientHttpRequest createRequest(URI uri,
                                       HttpMethod httpMethod)
                                throws IOException
Description copied from interface: ClientHttpRequestFactory
Create a new ClientHttpRequest for the specified URI and HTTP method.

The returned request can be written to, and then executed by calling ClientHttpRequest.execute().

Specified by:
createRequest in interface ClientHttpRequestFactory
Parameters:
uri - the URI to create a request for
httpMethod - the HTTP method to execute
Returns:
the created request
Throws:
IOException - in case of I/O errors

createCommonsHttpMethod

protected HttpMethodBase createCommonsHttpMethod(HttpMethod httpMethod,
                                                 String uri)
Create a Commons HttpMethodBase object for the given HTTP method and URI specification.

Parameters:
httpMethod - the HTTP method
uri - the URI
Returns:
the Commons HttpMethodBase object

postProcessCommonsHttpMethod

protected void postProcessCommonsHttpMethod(HttpMethodBase httpMethod)
Template method that allows for manipulating the HttpMethodBase before it is returned as part of a CommonsClientHttpRequest.

The default implementation is empty.

Parameters:
httpMethod - the Commons HTTP method object to process

destroy

public void destroy()
Shutdown hook that closes the underlying HttpConnectionManager's connection pool, if any.

Specified by:
destroy in interface DisposableBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleClientHttpRequestFactory

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.http.client
Class SimpleClientHttpRequestFactory

java.lang.Object
    extended by  org.springframework.http.client.SimpleClientHttpRequestFactory
All Implemented Interfaces:
ClientHttpRequestFactory
public class SimpleClientHttpRequestFactory
extends Object
implements ClientHttpRequestFactory

ClientHttpRequestFactory implementation that uses standard J2SE facilities.

Since:
3.0
Author:
Arjen Poutsma
See Also:
HttpURLConnection, CommonsClientHttpRequestFactory

Constructor Summary
SimpleClientHttpRequestFactory()
Method Summary
ClientHttpRequest | createRequest(URI uri, HttpMethod httpMethod) Create a new ClientHttpRequest for the specified URI and HTTP method.
protected void | prepareConnection(HttpURLConnection connection, String httpMethod) Template method for preparing the given HttpURLConnection.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleClientHttpRequestFactory

public SimpleClientHttpRequestFactory()
Method Detail

createRequest

public ClientHttpRequest createRequest(URI uri,
                                       HttpMethod httpMethod)
                                throws IOException
Description copied from interface: ClientHttpRequestFactory
Create a new ClientHttpRequest for the specified URI and HTTP method.

The returned request can be written to, and then executed by calling ClientHttpRequest.execute().

Specified by:
createRequest in interface ClientHttpRequestFactory
Parameters:
uri - the URI to create a request for
httpMethod - the HTTP method to execute
Returns:
the created request
Throws:
IOException - in case of I/O errors

prepareConnection

protected void prepareConnection(HttpURLConnection connection,
                                 String httpMethod)
                          throws IOException
Template method for preparing the given HttpURLConnection.

The default implementation prepares the connection for input and output, and sets the HTTP method.

Parameters:
connection - the connection to prepare
httpMethod - the HTTP request method (GET, POST, etc.)
Throws:
IOException - in case of I/O errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.http.client.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.http.client.support

This package provides generic HTTP support classes, to be used by higher-level classes like RestTemplate.

See:
Description

Class Summary
HttpAccessor Base class for RestTemplate and other HTTP accessing gateway helpers, defining common properties such as the ClientHttpRequestFactory to operate on.

Package org.springframework.http.client.support Description

This package provides generic HTTP support classes, to be used by higher-level classes like RestTemplate.


org.springframework.http.client.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.http.client.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.http.client.support.HttpAccessor


HttpAccessor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.http.client.support
Class HttpAccessor

java.lang.Object
    extended by  org.springframework.http.client.support.HttpAccessor
Direct Known Subclasses:
RestTemplate
public abstract class HttpAccessor
extends Object

Base class for RestTemplate and other HTTP accessing gateway helpers, defining common properties such as the ClientHttpRequestFactory to operate on.

Not intended to be used directly. See RestTemplate.

Since:
3.0
Author:
Arjen Poutsma
See Also:
RestTemplate

Field Summary
protected  Log logger
Logger available to subclasses.
Constructor Summary
HttpAccessor()
Method Summary
protected ClientHttpRequest | createRequest(URI url, HttpMethod method) Create a new ClientHttpRequest via this template's ClientHttpRequestFactory.
ClientHttpRequestFactory | getRequestFactory() Return the request factory that this accessor uses for obtaining HttpRequests.
void | setRequestFactory(ClientHttpRequestFactory requestFactory) Set the request factory that this accessor uses for obtaining HttpRequests.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses.

Constructor Detail

HttpAccessor

public HttpAccessor()
Method Detail

setRequestFactory

public void setRequestFactory(ClientHttpRequestFactory requestFactory)
Set the request factory that this accessor uses for obtaining HttpRequests.

getRequestFactory

public ClientHttpRequestFactory getRequestFactory()
Return the request factory that this accessor uses for obtaining HttpRequests.

createRequest

protected ClientHttpRequest createRequest(URI url,
                                          HttpMethod method)
                                   throws IOException
Create a new ClientHttpRequest via this template's ClientHttpRequestFactory.

Parameters:
url - the URL to connect to
method - the HTTP method to exectute (GET, POST, etc.)
Returns:
the created request
Throws:
IOException - in case of I/O errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.http.converter

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.http.converter

Provides an HttpMessageConverter abstraction to convert between Java objects and HTTP input/output messages.

See:
Description

Interface Summary
HttpMessageConverter<T> Strategy interface that specifies a converter that can convert from and to HTTP requests and responses.

Class Summary
AbstractHttpMessageConverter<T> | Abstract base class for most HttpMessageConverter implementations.
BufferedImageHttpMessageConverter | Implementation of HttpMessageConverter that can read and write BufferedImages.
ByteArrayHttpMessageConverter | Implementation of HttpMessageConverter that can read and write byte arrays.
FormHttpMessageConverter | Implementation of HttpMessageConverter that can handle form data, including multipart form data (i.e.
ResourceHttpMessageConverter | Implementation of HttpMessageConverter that can read and write Resources.
StringHttpMessageConverter | Implementation of HttpMessageConverter that can read and write strings.

Exception Summary
HttpMessageConversionException | Thrown by HttpMessageConverter implementations when the conversion fails.
HttpMessageNotReadableException | Thrown by HttpMessageConverter implementations when the read method fails.
HttpMessageNotWritableException | Thrown by HttpMessageConverter implementations when the write method fails.

Package org.springframework.http.converter Description

Provides an HttpMessageConverter abstraction to convert between Java objects and HTTP input/output messages.


org.springframework.http.converter Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.http.converter

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.http.converter.AbstractHttpMessageConverter<T> (implements org.springframework.http.converter.HttpMessageConverter<T>)
      • org.springframework.http.converter.ByteArrayHttpMessageConverter
      • org.springframework.http.converter.StringHttpMessageConverter
    • org.springframework.http.converter.BufferedImageHttpMessageConverter (implements org.springframework.http.converter.HttpMessageConverter<T>)
    • org.springframework.http.converter.FormHttpMessageConverter (implements org.springframework.http.converter.HttpMessageConverter<T>)
    • org.springframework.http.converter.ResourceHttpMessageConverter (implements org.springframework.http.converter.HttpMessageConverter<T>)
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.http.converter.HttpMessageConversionException
              • org.springframework.http.converter.HttpMessageNotReadableException
              • org.springframework.http.converter.HttpMessageNotWritableException

Interface Hierarchy

  • org.springframework.http.converter.HttpMessageConverter<T>


HttpMessageConverter

org.springframework.http.converter
Interface HttpMessageConverter<T>

All Known Implementing Classes:
AbstractHttpMessageConverter, AbstractJaxb2HttpMessageConverter, AbstractWireFeedHttpMessageConverter, AbstractXmlHttpMessageConverter, AtomFeedHttpMessageConverter, BufferedImageHttpMessageConverter, ByteArrayHttpMessageConverter, FormHttpMessageConverter, Jaxb2RootElementHttpMessageConverter, MappingJacksonHttpMessageConverter, MarshallingHttpMessageConverter, ResourceHttpMessageConverter, RssChannelHttpMessageConverter, SourceHttpMessageConverter, StringHttpMessageConverter
public interface HttpMessageConverter<T>

Strategy interface that specifies a converter that can convert from and to HTTP requests and responses.

Since:
3.0
Author:
Arjen Poutsma, Juergen Hoeller

Method Summary
boolean | canRead(Class<?> clazz, MediaType mediaType) Indicates whether the given class can be read by this converter.
boolean | canWrite(Class<?> clazz, MediaType mediaType) Indicates whether the given class can be written by this converter.
List<MediaType> | getSupportedMediaTypes() Return the list of MediaType objects supported by this converter.
T | read(Class<? extends T> clazz, HttpInputMessage inputMessage) Read an object of the given type form the given input message, and returns it.
void | write(T t, MediaType contentType, HttpOutputMessage outputMessage) Write an given object to the given output message.

Method Detail

canRead

boolean canRead(Class<?> clazz,
                MediaType mediaType)
Indicates whether the given class can be read by this converter.

Parameters:
clazz - the class to test for readability
mediaType - the media type to read, can be null if not specified. Typically the value of a Content-Type header.
Returns:
true if readable; false otherwise

canWrite

boolean canWrite(Class<?> clazz,
                 MediaType mediaType)
Indicates whether the given class can be written by this converter.

Parameters:
clazz - the class to test for writability
mediaType - the media type to write, can be null if not specified. Typically the value of an Accept header.
Returns:
true if writable; false otherwise

getSupportedMediaTypes

List<MediaType> getSupportedMediaTypes()
Return the list of MediaType objects supported by this converter.

Returns:
the list of supported media types

read

T read(Class<? extends T> clazz,
       HttpInputMessage inputMessage)
       throws IOException,
              HttpMessageNotReadableException
Read an object of the given type form the given input message, and returns it.

Parameters:
clazz - the type of object to return. This type must have previously been passed to the canRead method of this interface, which must have returned true.
inputMessage - the HTTP input message to read from
Returns:
the converted object
Throws:
IOException - in case of I/O errors
HttpMessageNotReadableException - in case of conversion errors

write

void write(T t,
           MediaType contentType,
           HttpOutputMessage outputMessage)
           throws IOException,
                  HttpMessageNotWritableException
Write an given object to the given output message.

Parameters:
t - the object to write to the output message. The type of this object must have previously been passed to the canWrite method of this interface, which must have returned true.
contentType - the content type to use when writing. May be null to indicate that the default content type of the converter must be used. If not null, this media type must have previously been passed to the canWrite method of this interface, which must have returned true.
outputMessage - the message to write to
Throws:
IOException - in case of I/O errors
HttpMessageNotWritableException - in case of conversion errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractHttpMessageConverter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.http.converter
Class AbstractHttpMessageConverter<T>

java.lang.Object
    extended by  org.springframework.http.converter.AbstractHttpMessageConverter<T>
All Implemented Interfaces:
HttpMessageConverter<T>
Direct Known Subclasses:
AbstractWireFeedHttpMessageConverter, AbstractXmlHttpMessageConverter, ByteArrayHttpMessageConverter, MappingJacksonHttpMessageConverter, StringHttpMessageConverter
public abstract class AbstractHttpMessageConverter<T>
extends Object
implements HttpMessageConverter<T>

Abstract base class for most HttpMessageConverter implementations.

This base class adds support for setting supported MediaTypes, through the supportedMediaTypes bean property. It also adds support for Content-Type and Content-Length when writing to output messages.

Since:
3.0
Author:
Arjen Poutsma, Juergen Hoeller

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
protected | AbstractHttpMessageConverter() Construct an AbstractHttpMessageConverter with no supported media types.
protected | AbstractHttpMessageConverter(MediaType... supportedMediaTypes) Construct an AbstractHttpMessageConverter with multiple supported media type.
protected | AbstractHttpMessageConverter(MediaType supportedMediaType) Construct an AbstractHttpMessageConverter with one supported media type.
Method Summary
boolean | canRead(Class<?> clazz, MediaType mediaType) Indicates whether the given class can be read by this converter.
protected boolean | canRead(MediaType mediaType) Returns true if any of the supported media types include the given media type.
boolean | canWrite(Class<?> clazz, MediaType mediaType) Indicates whether the given class can be written by this converter.
protected boolean | canWrite(MediaType mediaType) Returns true if the given media type includes any of the supported media types.
protected Long | getContentLength(T t, MediaType contentType) Returns the content length for the given type.
protected MediaType | getDefaultContentType(T t) Returns the default content type for the given type.
List<MediaType> | getSupportedMediaTypes() Return the list of MediaType objects supported by this converter.
T | read(Class<? extends T> clazz, HttpInputMessage inputMessage) Read an object of the given type form the given input message, and returns it.
protected abstract T | readInternal(Class<? extends T> clazz, HttpInputMessage inputMessage) Abstract template method that reads the actualy object.
void | setSupportedMediaTypes(List<MediaType> supportedMediaTypes) Set the list of MediaType objects supported by this converter.
protected abstract boolean | supports(Class<?> clazz) Indicates whether the given class is supported by this converter.
void | write(T t, MediaType contentType, HttpOutputMessage outputMessage) Write an given object to the given output message.
protected abstract void | writeInternal(T t, HttpOutputMessage outputMessage) Abstract template method that writes the actual body.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

AbstractHttpMessageConverter

protected AbstractHttpMessageConverter()
Construct an AbstractHttpMessageConverter with no supported media types.

See Also:
setSupportedMediaTypes(java.util.List)

AbstractHttpMessageConverter

protected AbstractHttpMessageConverter(MediaType supportedMediaType)
Construct an AbstractHttpMessageConverter with one supported media type.

Parameters:
supportedMediaType - the supported media type

AbstractHttpMessageConverter

protected AbstractHttpMessageConverter(MediaType... supportedMediaTypes)
Construct an AbstractHttpMessageConverter with multiple supported media type.

Parameters:
supportedMediaTypes - the supported media types
Method Detail

setSupportedMediaTypes

public void setSupportedMediaTypes(List<MediaType> supportedMediaTypes)
Set the list of MediaType objects supported by this converter.

getSupportedMediaTypes

public List<MediaType> getSupportedMediaTypes()
Description copied from interface: HttpMessageConverter
Return the list of MediaType objects supported by this converter.

Specified by:
getSupportedMediaTypes in interface HttpMessageConverter<T>
Returns:
the list of supported media types

canRead

public boolean canRead(Class<?> clazz,
                       MediaType mediaType)
Indicates whether the given class can be read by this converter.

This implementation checks if the given class is supported, and if the supported media types include the given media type.

Specified by:
canRead in interface HttpMessageConverter<T>
Parameters:
clazz - the class to test for readability
mediaType - the media type to read, can be null if not specified. Typically the value of a Content-Type header.
Returns:
true if readable; false otherwise

canRead

protected boolean canRead(MediaType mediaType)
Returns true if any of the supported media types include the given media type.

Parameters:
mediaType - the media type to read, can be null if not specified. Typically the value of a Content-Type header.
Returns:
true if the supported media types include the media type, or if the media type is null

canWrite

public boolean canWrite(Class<?> clazz,
                        MediaType mediaType)
Indicates whether the given class can be written by this converter.

This implementation checks if the given class is supported, and if the supported media types include the given media type.

Specified by:
canWrite in interface HttpMessageConverter<T>
Parameters:
clazz - the class to test for writability
mediaType - the media type to write, can be null if not specified. Typically the value of an Accept header.
Returns:
true if writable; false otherwise

canWrite

protected boolean canWrite(MediaType mediaType)
Returns true if the given media type includes any of the supported media types.

Parameters:
mediaType - the media type to write, can be null if not specified. Typically the value of an Accept header.
Returns:
true if the supported media types are compatible with the media type, or if the media type is null

read

public final T read(Class<? extends T> clazz,
                    HttpInputMessage inputMessage)
             throws IOException
Read an object of the given type form the given input message, and returns it.

This implementation simple delegates to readInternal(Class, HttpInputMessage). Future implementations might add some default behavior, however.

Specified by:
read in interface HttpMessageConverter<T>
Parameters:
clazz - the type of object to return. This type must have previously been passed to the canRead method of this interface, which must have returned true.
inputMessage - the HTTP input message to read from
Returns:
the converted object
Throws:
IOException - in case of I/O errors

write

public final void write(T t,
                        MediaType contentType,
                        HttpOutputMessage outputMessage)
                 throws IOException,
                        HttpMessageNotWritableException
Write an given object to the given output message.

This implementation delegates to getDefaultContentType(Object) if a content type was not provided, calls getContentLength(T, org.springframework.http.MediaType), and sets the corresponding headers on the output message. It then calls writeInternal(T, org.springframework.http.HttpOutputMessage).

Specified by:
write in interface HttpMessageConverter<T>
Parameters:
t - the object to write to the output message. The type of this object must have previously been passed to the canWrite method of this interface, which must have returned true.
contentType - the content type to use when writing. May be null to indicate that the default content type of the converter must be used. If not null, this media type must have previously been passed to the canWrite method of this interface, which must have returned true.
outputMessage - the message to write to
Throws:
IOException - in case of I/O errors
HttpMessageNotWritableException - in case of conversion errors

getDefaultContentType

protected MediaType getDefaultContentType(T t)
Returns the default content type for the given type. Called when write(T, org.springframework.http.MediaType, org.springframework.http.HttpOutputMessage) is invoked without a specified content type parameter.

By default, this returns the first element of the supportedMediaTypes property, if any. Can be overridden in subclasses.

Parameters:
t - the type to return the content type for
Returns:
the content type, or null if not known

getContentLength

protected Long getContentLength(T t,
                                MediaType contentType)
Returns the content length for the given type.

By default, this returns null, meaning that the content length is unknown. Can be overridden in subclasses.

Parameters:
t - the type to return the content length for
Returns:
the content length, or null if not known

supports

protected abstract boolean supports(Class<?> clazz)
Indicates whether the given class is supported by this converter.

Parameters:
clazz - the class to test for support
Returns:
true if supported; false otherwise

readInternal

protected abstract T readInternal(Class<? extends T> clazz,
                                  HttpInputMessage inputMessage)
                           throws IOException,
                                  HttpMessageNotReadableException
Abstract template method that reads the actualy object. Invoked from read(java.lang.Class, org.springframework.http.HttpInputMessage).

Parameters:
clazz - the type of object to return
inputMessage - the HTTP input message to read from
Returns:
the converted object
Throws:
IOException - in case of I/O errors
HttpMessageNotReadableException - in case of conversion errors

writeInternal

protected abstract void writeInternal(T t,
                                      HttpOutputMessage outputMessage)
                               throws IOException,
                                      HttpMessageNotWritableException
Abstract template method that writes the actual body. Invoked from write(T, org.springframework.http.MediaType, org.springframework.http.HttpOutputMessage).

Parameters:
t - the object to write to the output message
outputMessage - the message to write to
Throws:
IOException - in case of I/O errors
HttpMessageNotWritableException - in case of conversion errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


BufferedImageHttpMessageConverter

org.springframework.http.converter
Class BufferedImageHttpMessageConverter

java.lang.Object
    extended by  org.springframework.http.converter.BufferedImageHttpMessageConverter
All Implemented Interfaces:
HttpMessageConverter<BufferedImage>
public class BufferedImageHttpMessageConverter
extends Object
implements HttpMessageConverter<BufferedImage>

Implementation of HttpMessageConverter that can read and write BufferedImages.

By default, this converter can read all media types that are supported by the registered image readers, and writes using the media type of the first available registered image writer. This behavior can be overriden by setting the #setContentType(org.springframework.http.MediaType) contentType} properties.

If the cacheDir property is set to an existing directory, this converter will cache image data.

The process(ImageReadParam) and process(ImageWriteParam) template methods allow subclasses to override Image I/O parameters.

Since:
3.0
Author:
Arjen Poutsma

Constructor Summary
BufferedImageHttpMessageConverter()
Method Summary
boolean | canRead(Class<?> clazz, MediaType mediaType) Indicates whether the given class can be read by this converter.
boolean | canWrite(Class<?> clazz, MediaType mediaType) Indicates whether the given class can be written by this converter.
MediaType | getDefaultContentType() Returns the default Content-Type to be used for writing.
List<MediaType> | getSupportedMediaTypes() Return the list of MediaType objects supported by this converter.
protected void | process(ImageReadParam irp) Template method that allows for manipulating the ImageReadParam before it is used to read an image.
protected void | process(ImageWriteParam iwp) Template method that allows for manipulating the ImageWriteParam before it is used to write an image.
BufferedImage | read(Class<? extends BufferedImage> clazz, HttpInputMessage inputMessage) Read an object of the given type form the given input message, and returns it.
void | setCacheDir(File cacheDir) Sets the cache directory.
void | setDefaultContentType(MediaType defaultContentType) Sets the default Content-Type to be used for writing.
void | write(BufferedImage image, MediaType contentType, HttpOutputMessage outputMessage) Write an given object to the given output message.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BufferedImageHttpMessageConverter

public BufferedImageHttpMessageConverter()
Method Detail

setDefaultContentType

public void setDefaultContentType(MediaType defaultContentType)
Sets the default Content-Type to be used for writing.

Throws:
IllegalArgumentException - if the given content type is not supported by the Java Image I/O API

getDefaultContentType

public MediaType getDefaultContentType()
Returns the default Content-Type to be used for writing. Called when write(java.awt.image.BufferedImage, org.springframework.http.MediaType, org.springframework.http.HttpOutputMessage) is invoked without a specified content type parameter.

setCacheDir

public void setCacheDir(File cacheDir)
Sets the cache directory. If this property is set to an existing directory, this converter will cache image data.

canRead

public boolean canRead(Class<?> clazz,
                       MediaType mediaType)
Description copied from interface: HttpMessageConverter
Indicates whether the given class can be read by this converter.

Specified by:
canRead in interface HttpMessageConverter<BufferedImage>
Parameters:
clazz - the class to test for readability
mediaType - the media type to read, can be null if not specified. Typically the value of a Content-Type header.
Returns:
true if readable; false otherwise

canWrite

public boolean canWrite(Class<?> clazz,
                        MediaType mediaType)
Description copied from interface: HttpMessageConverter
Indicates whether the given class can be written by this converter.

Specified by:
canWrite in interface HttpMessageConverter<BufferedImage>
Parameters:
clazz - the class to test for writability
mediaType - the media type to write, can be null if not specified. Typically the value of an Accept header.
Returns:
true if writable; false otherwise

getSupportedMediaTypes

public List<MediaType> getSupportedMediaTypes()
Description copied from interface: HttpMessageConverter
Return the list of MediaType objects supported by this converter.

Specified by:
getSupportedMediaTypes in interface HttpMessageConverter<BufferedImage>
Returns:
the list of supported media types

read

public BufferedImage read(Class<? extends BufferedImage> clazz,
                          HttpInputMessage inputMessage)
                   throws IOException,
                          HttpMessageNotReadableException
Description copied from interface: HttpMessageConverter
Read an object of the given type form the given input message, and returns it.

Specified by:
read in interface HttpMessageConverter<BufferedImage>
Parameters:
clazz - the type of object to return. This type must have previously been passed to the canRead method of this interface, which must have returned true.
inputMessage - the HTTP input message to read from
Returns:
the converted object
Throws:
IOException - in case of I/O errors
HttpMessageNotReadableException - in case of conversion errors

write

public void write(BufferedImage image,
                  MediaType contentType,
                  HttpOutputMessage outputMessage)
           throws IOException,
                  HttpMessageNotWritableException
Description copied from interface: HttpMessageConverter
Write an given object to the given output message.

Specified by:
write in interface HttpMessageConverter<BufferedImage>
Parameters:
image - the object to write to the output message. The type of this object must have previously been passed to the canWrite method of this interface, which must have returned true.
contentType - the content type to use when writing. May be null to indicate that the default content type of the converter must be used. If not null, this media type must have previously been passed to the canWrite method of this interface, which must have returned true.
outputMessage - the message to write to
Throws:
IOException - in case of I/O errors
HttpMessageNotWritableException - in case of conversion errors

process

protected void process(ImageReadParam irp)
Template method that allows for manipulating the ImageReadParam before it is used to read an image.

Default implementation is empty.

process

protected void process(ImageWriteParam iwp)
Template method that allows for manipulating the ImageWriteParam before it is used to write an image.

Default implementation is empty.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ByteArrayHttpMessageConverter

org.springframework.http.converter
Class ByteArrayHttpMessageConverter

java.lang.Object
    extended by  org.springframework.http.converter.AbstractHttpMessageConverter<byte[]>
        extended by  org.springframework.http.converter.ByteArrayHttpMessageConverter
All Implemented Interfaces:
HttpMessageConverter<byte[]>
public class ByteArrayHttpMessageConverter
extends AbstractHttpMessageConverter<byte[]>

Implementation of HttpMessageConverter that can read and write byte arrays.

By default, this converter supports all media types (*/*), and writes with a Content-Type of application/octet-stream. This can be overridden by setting the supportedMediaTypes property.

Since:
3.0
Author:
Arjen Poutsma

Field Summary
Fields inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
logger
Constructor Summary
ByteArrayHttpMessageConverter()
Creates a new instance of the ByteArrayHttpMessageConverter.
Method Summary
protected Long | getContentLength(byte[] bytes, MediaType contentType) Returns the content length for the given type.
byte[] | readInternal(Class clazz, HttpInputMessage inputMessage) Abstract template method that reads the actualy object.
boolean | supports(Class<?> clazz) Indicates whether the given class is supported by this converter.
protected void | writeInternal(byte[] bytes, HttpOutputMessage outputMessage) Abstract template method that writes the actual body.
Methods inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
canRead, canRead, canWrite, canWrite, getDefaultContentType, getSupportedMediaTypes, read, setSupportedMediaTypes, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ByteArrayHttpMessageConverter

public ByteArrayHttpMessageConverter()
Creates a new instance of the ByteArrayHttpMessageConverter.

Method Detail

supports

public boolean supports(Class<?> clazz)
Description copied from class: AbstractHttpMessageConverter
Indicates whether the given class is supported by this converter.

Specified by:
supports in class AbstractHttpMessageConverter<byte[]>
Parameters:
clazz - the class to test for support
Returns:
true if supported; false otherwise

readInternal

public byte[] readInternal(Class clazz,
                           HttpInputMessage inputMessage)
                    throws IOException
Description copied from class: AbstractHttpMessageConverter
Abstract template method that reads the actualy object. Invoked from AbstractHttpMessageConverter.read(java.lang.Class, org.springframework.http.HttpInputMessage).

Specified by:
readInternal in class AbstractHttpMessageConverter<byte[]>
Parameters:
clazz - the type of object to return
inputMessage - the HTTP input message to read from
Returns:
the converted object
Throws:
IOException - in case of I/O errors

getContentLength

protected Long getContentLength(byte[] bytes,
                                MediaType contentType)
Description copied from class: AbstractHttpMessageConverter
Returns the content length for the given type.

By default, this returns null, meaning that the content length is unknown. Can be overridden in subclasses.

Overrides:
getContentLength in class AbstractHttpMessageConverter<byte[]>
Parameters:
bytes - the type to return the content length for
Returns:
the content length, or null if not known

writeInternal

protected void writeInternal(byte[] bytes,
                             HttpOutputMessage outputMessage)
                      throws IOException
Description copied from class: AbstractHttpMessageConverter
Abstract template method that writes the actual body. Invoked from AbstractHttpMessageConverter.write(T, org.springframework.http.MediaType, org.springframework.http.HttpOutputMessage).

Specified by:
writeInternal in class AbstractHttpMessageConverter<byte[]>
Parameters:
bytes - the object to write to the output message
outputMessage - the message to write to
Throws:
IOException - in case of I/O errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FormHttpMessageConverter

org.springframework.http.converter
Class FormHttpMessageConverter

java.lang.Object
    extended by  org.springframework.http.converter.FormHttpMessageConverter
All Implemented Interfaces:
HttpMessageConverter<MultiValueMap<String,?>>
public class FormHttpMessageConverter
extends Object
implements HttpMessageConverter<MultiValueMap<String,?>>

Implementation of HttpMessageConverter that can handle form data, including multipart form data (i.e. file uploads).

This converter can write the application/x-www-form-urlencoded and multipart/form-data media types, and read the application/x-www-form-urlencoded) media type (but not multipart/form-data).

In other words, this converter can read and write 'normal' HTML forms (as MultiValueMap<String, String>), and it can write multipart form (as MultiValueMap<String, Object>. When writing multipart, this converter uses other HttpMessageConverters to write the respective MIME parts. By default, basic converters are registered (supporting Strings and Resources, for instance); these can be overridden by setting the partConverters property.

For example, the following snippet shows how to submit an HTML form:

 RestTemplate template = new RestTemplate(); // FormHttpMessageConverter is configured by default
 MultiValueMap<String, String> form = new LinkedMultiValueMap<String, String>();
 form.add("field 1", "value 1");
 form.add("field 2", "value 2");
 form.add("field 2", "value 3");
 template.postForLocation("http://example.com/myForm", form);

The following snippet shows how to do a file upload:

 MultiValueMap<String, Object> parts = new LinkedMultiValueMap<String, Object>();
 parts.add("field 1", "value 1");
 parts.add("file", new ClassPathResource("myFile.jpg"));
 template.postForLocation("http://example.com/myFileUpload", parts);

Some methods in this class were inspired by MultipartRequestEntity.

Since:
3.0
Author:
Arjen Poutsma
See Also:
MultiValueMap

Constructor Summary
FormHttpMessageConverter()
Method Summary
boolean | canRead(Class<?> clazz, MediaType mediaType) Indicates whether the given class can be read by this converter.
boolean | canWrite(Class<?> clazz, MediaType mediaType) Indicates whether the given class can be written by this converter.
protected byte[] | generateMultipartBoundary() Generate a multipart boundary.
protected String | getFilename(Object part) Returns the filename of the given multipart part.
List<MediaType> | getSupportedMediaTypes() Return the list of MediaType objects supported by this converter.
MultiValueMap<String,String> | read(Class<? extends MultiValueMap<String,?>> clazz, HttpInputMessage inputMessage) Read an object of the given type form the given input message, and returns it.
void | setCharset(Charset charset) Sets the character set used for writing form data.
void | setPartConverters(List<HttpMessageConverter<?>> partConverters) Set the message body converters to use.
void | write(MultiValueMap<String,?> map, MediaType contentType, HttpOutputMessage outputMessage) Write an given object to the given output message.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

FormHttpMessageConverter

public FormHttpMessageConverter()
Method Detail

setPartConverters

public void setPartConverters(List<HttpMessageConverter<?>> partConverters)
Set the message body converters to use. These converters are used to convert objects to MIME parts.

setCharset

public void setCharset(Charset charset)
Sets the character set used for writing form data.

canRead

public boolean canRead(Class<?> clazz,
                       MediaType mediaType)
Description copied from interface: HttpMessageConverter
Indicates whether the given class can be read by this converter.

Specified by:
canRead in interface HttpMessageConverter<MultiValueMap<String,?>>
Parameters:
clazz - the class to test for readability
mediaType - the media type to read, can be null if not specified. Typically the value of a Content-Type header.
Returns:
true if readable; false otherwise

canWrite

public boolean canWrite(Class<?> clazz,
                        MediaType mediaType)
Description copied from interface: HttpMessageConverter
Indicates whether the given class can be written by this converter.

Specified by:
canWrite in interface HttpMessageConverter<MultiValueMap<String,?>>
Parameters:
clazz - the class to test for writability
mediaType - the media type to write, can be null if not specified. Typically the value of an Accept header.
Returns:
true if writable; false otherwise

getSupportedMediaTypes

public List<MediaType> getSupportedMediaTypes()
Description copied from interface: HttpMessageConverter
Return the list of MediaType objects supported by this converter.

Specified by:
getSupportedMediaTypes in interface HttpMessageConverter<MultiValueMap<String,?>>
Returns:
the list of supported media types

read

public MultiValueMap<String,String> read(Class<? extends MultiValueMap<String,?>> clazz,
                                         HttpInputMessage inputMessage)
                                  throws IOException,
                                         HttpMessageNotReadableException
Description copied from interface: HttpMessageConverter
Read an object of the given type form the given input message, and returns it.

Specified by:
read in interface HttpMessageConverter<MultiValueMap<String,?>>
Parameters:
clazz - the type of object to return. This type must have previously been passed to the canRead method of this interface, which must have returned true.
inputMessage - the HTTP input message to read from
Returns:
the converted object
Throws:
IOException - in case of I/O errors
HttpMessageNotReadableException - in case of conversion errors

write

public void write(MultiValueMap<String,?> map,
                  MediaType contentType,
                  HttpOutputMessage outputMessage)
           throws IOException,
                  HttpMessageNotWritableException
Description copied from interface: HttpMessageConverter
Write an given object to the given output message.

Specified by:
write in interface HttpMessageConverter<MultiValueMap<String,?>>
Parameters:
map - the object to write to the output message. The type of this object must have previously been passed to the canWrite method of this interface, which must have returned true.
contentType - the content type to use when writing. May be null to indicate that the default content type of the converter must be used. If not null, this media type must have previously been passed to the canWrite method of this interface, which must have returned true.
outputMessage - the message to write to
Throws:
IOException - in case of I/O errors
HttpMessageNotWritableException - in case of conversion errors

generateMultipartBoundary

protected byte[] generateMultipartBoundary()
Generate a multipart boundary.

Default implementation returns a random boundary. Can be overridden in subclasses.

getFilename

protected String getFilename(Object part)
Returns the filename of the given multipart part. This value will be used for the Content-Disposition header.

Default implementation returns Resource.getFilename() if the part is a Resource, and null in other cases. Can be overridden in subclasses.

Parameters:
part - the part to determine the file name for
Returns:
the filename, or null if not known
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResourceHttpMessageConverter

org.springframework.http.converter
Class ResourceHttpMessageConverter

java.lang.Object
    extended by  org.springframework.http.converter.ResourceHttpMessageConverter
All Implemented Interfaces:
HttpMessageConverter<Resource>
public class ResourceHttpMessageConverter
extends Object
implements HttpMessageConverter<Resource>

Implementation of HttpMessageConverter that can read and write Resources.

By default, this converter can read all media types. The Java Activation Framework (JAF) - if available - is used to determine the Content-Type of written resources. If JAF is not available, application/octet-stream is used.

Since:
3.0.2
Author:
Arjen Poutsma

Constructor Summary
ResourceHttpMessageConverter()
Method Summary
boolean | canRead(Class<?> clazz, MediaType mediaType) Indicates whether the given class can be read by this converter.
boolean | canWrite(Class<?> clazz, MediaType mediaType) Indicates whether the given class can be written by this converter.
protected Long | getContentLength(Resource resource, MediaType contentType)
List<MediaType> | getSupportedMediaTypes() Return the list of MediaType objects supported by this converter.
Resource | read(Class<? extends Resource> clazz, HttpInputMessage inputMessage) Read an object of the given type form the given input message, and returns it.
void | write(Resource resource, MediaType contentType, HttpOutputMessage outputMessage) Write an given object to the given output message.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ResourceHttpMessageConverter

public ResourceHttpMessageConverter()
Method Detail

canRead

public boolean canRead(Class<?> clazz,
                       MediaType mediaType)
Description copied from interface: HttpMessageConverter
Indicates whether the given class can be read by this converter.

Specified by:
canRead in interface HttpMessageConverter<Resource>
Parameters:
clazz - the class to test for readability
mediaType - the media type to read, can be null if not specified. Typically the value of a Content-Type header.
Returns:
true if readable; false otherwise

canWrite

public boolean canWrite(Class<?> clazz,
                        MediaType mediaType)
Description copied from interface: HttpMessageConverter
Indicates whether the given class can be written by this converter.

Specified by:
canWrite in interface HttpMessageConverter<Resource>
Parameters:
clazz - the class to test for writability
mediaType - the media type to write, can be null if not specified. Typically the value of an Accept header.
Returns:
true if writable; false otherwise

getSupportedMediaTypes

public List<MediaType> getSupportedMediaTypes()
Description copied from interface: HttpMessageConverter
Return the list of MediaType objects supported by this converter.

Specified by:
getSupportedMediaTypes in interface HttpMessageConverter<Resource>
Returns:
the list of supported media types

read

public Resource read(Class<? extends Resource> clazz,
                     HttpInputMessage inputMessage)
              throws IOException,
                     HttpMessageNotReadableException
Description copied from interface: HttpMessageConverter
Read an object of the given type form the given input message, and returns it.

Specified by:
read in interface HttpMessageConverter<Resource>
Parameters:
clazz - the type of object to return. This type must have previously been passed to the canRead method of this interface, which must have returned true.
inputMessage - the HTTP input message to read from
Returns:
the converted object
Throws:
IOException - in case of I/O errors
HttpMessageNotReadableException - in case of conversion errors

write

public void write(Resource resource,
                  MediaType contentType,
                  HttpOutputMessage outputMessage)
           throws IOException,
                  HttpMessageNotWritableException
Description copied from interface: HttpMessageConverter
Write an given object to the given output message.

Specified by:
write in interface HttpMessageConverter<Resource>
Parameters:
resource - the object to write to the output message. The type of this object must have previously been passed to the canWrite method of this interface, which must have returned true.
contentType - the content type to use when writing. May be null to indicate that the default content type of the converter must be used. If not null, this media type must have previously been passed to the canWrite method of this interface, which must have returned true.
outputMessage - the message to write to
Throws:
IOException - in case of I/O errors
HttpMessageNotWritableException - in case of conversion errors

getContentLength

protected Long getContentLength(Resource resource,
                                MediaType contentType)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StringHttpMessageConverter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.http.converter
Class StringHttpMessageConverter

java.lang.Object
    extended by  org.springframework.http.converter.AbstractHttpMessageConverter<String>
        extended by  org.springframework.http.converter.StringHttpMessageConverter
All Implemented Interfaces:
HttpMessageConverter<String>
public class StringHttpMessageConverter
extends AbstractHttpMessageConverter<String>

Implementation of HttpMessageConverter that can read and write strings.

By default, this converter supports all media types (*/*), and writes with a Content-Type of text/plain. This can be overridden by setting the supportedMediaTypes property.

Since:
3.0
Author:
Arjen Poutsma

Field Summary
static Charset DEFAULT_CHARSET
Fields inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
logger
Constructor Summary
StringHttpMessageConverter()
Method Summary
protected List<Charset> | getAcceptedCharsets() Return the list of supported Charset.
protected Long | getContentLength(String s, MediaType contentType) Returns the content length for the given type.
protected String | readInternal(Class clazz, HttpInputMessage inputMessage) Abstract template method that reads the actualy object.
void | setWriteAcceptCharset(boolean writeAcceptCharset) Indicates whether the Accept-Charset should be written to any outgoing request.
boolean | supports(Class<?> clazz) Indicates whether the given class is supported by this converter.
protected void | writeInternal(String s, HttpOutputMessage outputMessage) Abstract template method that writes the actual body.
Methods inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
canRead, canRead, canWrite, canWrite, getDefaultContentType, getSupportedMediaTypes, read, setSupportedMediaTypes, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_CHARSET

public static final Charset DEFAULT_CHARSET
Constructor Detail

StringHttpMessageConverter

public StringHttpMessageConverter()
Method Detail

setWriteAcceptCharset

public void setWriteAcceptCharset(boolean writeAcceptCharset)
Indicates whether the Accept-Charset should be written to any outgoing request.

Default is true.

supports

public boolean supports(Class<?> clazz)
Description copied from class: AbstractHttpMessageConverter
Indicates whether the given class is supported by this converter.

Specified by:
supports in class AbstractHttpMessageConverter<String>
Parameters:
clazz - the class to test for support
Returns:
true if supported; false otherwise

readInternal

protected String readInternal(Class clazz,
                              HttpInputMessage inputMessage)
                       throws IOException
Description copied from class: AbstractHttpMessageConverter
Abstract template method that reads the actualy object. Invoked from AbstractHttpMessageConverter.read(java.lang.Class, org.springframework.http.HttpInputMessage).

Specified by:
readInternal in class AbstractHttpMessageConverter<String>
Parameters:
clazz - the type of object to return
inputMessage - the HTTP input message to read from
Returns:
the converted object
Throws:
IOException - in case of I/O errors

getContentLength

protected Long getContentLength(String s,
                                MediaType contentType)
Description copied from class: AbstractHttpMessageConverter
Returns the content length for the given type.

By default, this returns null, meaning that the content length is unknown. Can be overridden in subclasses.

Overrides:
getContentLength in class AbstractHttpMessageConverter<String>
Parameters:
s - the type to return the content length for
Returns:
the content length, or null if not known

writeInternal

protected void writeInternal(String s,
                             HttpOutputMessage outputMessage)
                      throws IOException
Description copied from class: AbstractHttpMessageConverter
Abstract template method that writes the actual body. Invoked from AbstractHttpMessageConverter.write(T, org.springframework.http.MediaType, org.springframework.http.HttpOutputMessage).

Specified by:
writeInternal in class AbstractHttpMessageConverter<String>
Parameters:
s - the object to write to the output message
outputMessage - the message to write to
Throws:
IOException - in case of I/O errors

getAcceptedCharsets

protected List<Charset> getAcceptedCharsets()
Return the list of supported Charset.

By default, returns Charset.availableCharsets(). Can be overridden in subclasses.

Returns:
the list of accepted charsets
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


HttpMessageConversionException

org.springframework.http.converter
Class HttpMessageConversionException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.http.converter.HttpMessageConversionException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
HttpMessageNotReadableException, HttpMessageNotWritableException
public class HttpMessageConversionException
extends NestedRuntimeException

Thrown by HttpMessageConverter implementations when the conversion fails.

Since:
3.0
Author:
Arjen Poutsma
See Also:
Serialized Form

Constructor Summary
HttpMessageConversionException(String msg)
Create a new HttpMessageConversionException.
HttpMessageConversionException(String msg, Throwable cause)
Create a new HttpMessageConversionException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

HttpMessageConversionException

public HttpMessageConversionException(String msg)
Create a new HttpMessageConversionException.

Parameters:
msg - the detail message

HttpMessageConversionException

public HttpMessageConversionException(String msg,
                                      Throwable cause)
Create a new HttpMessageConversionException.

Parameters:
msg - the detail message
cause - the root cause (if any)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HttpMessageNotReadableException

org.springframework.http.converter
Class HttpMessageNotReadableException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.http.converter.HttpMessageConversionException
                        extended by  org.springframework.http.converter.HttpMessageNotReadableException
All Implemented Interfaces:
Serializable
public class HttpMessageNotReadableException
extends HttpMessageConversionException

Thrown by HttpMessageConverter implementations when the read method fails.

Since:
3.0
Author:
Arjen Poutsma
See Also:
Serialized Form

Constructor Summary
HttpMessageNotReadableException(String msg)
Create a new HttpMessageNotReadableException.
HttpMessageNotReadableException(String msg, Throwable cause)
Create a new HttpMessageNotReadableException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

HttpMessageNotReadableException

public HttpMessageNotReadableException(String msg)
Create a new HttpMessageNotReadableException.

Parameters:
msg - the detail message

HttpMessageNotReadableException

public HttpMessageNotReadableException(String msg,
                                       Throwable cause)
Create a new HttpMessageNotReadableException.

Parameters:
msg - the detail message
cause - the root cause (if any)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HttpMessageNotWritableException

org.springframework.http.converter
Class HttpMessageNotWritableException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.http.converter.HttpMessageConversionException
                        extended by  org.springframework.http.converter.HttpMessageNotWritableException
All Implemented Interfaces:
Serializable
public class HttpMessageNotWritableException
extends HttpMessageConversionException

Thrown by HttpMessageConverter implementations when the write method fails.

Since:
3.0
Author:
Arjen Poutsma
See Also:
Serialized Form

Constructor Summary
HttpMessageNotWritableException(String msg)
Create a new HttpMessageNotWritableException.
HttpMessageNotWritableException(String msg, Throwable cause)
Create a new HttpMessageNotWritableException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

HttpMessageNotWritableException

public HttpMessageNotWritableException(String msg)
Create a new HttpMessageNotWritableException.

Parameters:
msg - the detail message

HttpMessageNotWritableException

public HttpMessageNotWritableException(String msg,
                                       Throwable cause)
Create a new HttpMessageNotWritableException.

Parameters:
msg - the detail message
cause - the root cause (if any)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.http.converter.feed

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.http.converter.feed

Provides HttpMessageConverter implementations for handling Atom and RSS feeds.

See:
Description

Class Summary
AbstractWireFeedHttpMessageConverter<T extends WireFeed> | Abstract base class for Atom and RSS Feed message converters, using java.net's ROME package.
AtomFeedHttpMessageConverter | Implementation of HttpMessageConverter that can read and write Atom feeds.
RssChannelHttpMessageConverter | Implementation of HttpMessageConverter that can read and write RSS feeds.

Package org.springframework.http.converter.feed Description

Provides HttpMessageConverter implementations for handling Atom and RSS feeds.


org.springframework.http.converter.feed Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.http.converter.feed

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.http.converter.AbstractHttpMessageConverter<T> (implements org.springframework.http.converter.HttpMessageConverter<T>)
      • org.springframework.http.converter.feed.AbstractWireFeedHttpMessageConverter<T>
        • org.springframework.http.converter.feed.AtomFeedHttpMessageConverter
        • org.springframework.http.converter.feed.RssChannelHttpMessageConverter


AbstractWireFeedHttpMessageConverter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.http.converter.feed
Class AbstractWireFeedHttpMessageConverter<T extends com.sun.syndication.feed.WireFeed>

java.lang.Object
    extended by  org.springframework.http.converter.AbstractHttpMessageConverter<T>
        extended by  org.springframework.http.converter.feed.AbstractWireFeedHttpMessageConverter<T>
All Implemented Interfaces:
HttpMessageConverter<T>
Direct Known Subclasses:
AtomFeedHttpMessageConverter, RssChannelHttpMessageConverter
public abstract class AbstractWireFeedHttpMessageConverter<T extends com.sun.syndication.feed.WireFeed>
extends AbstractHttpMessageConverter<T>

Abstract base class for Atom and RSS Feed message converters, using java.net's ROME package.

Since:
3.0.2
Author:
Arjen Poutsma
See Also:
AtomFeedHttpMessageConverter, RssChannelHttpMessageConverter

Field Summary
static Charset DEFAULT_CHARSET
Fields inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
logger
Constructor Summary
protected AbstractWireFeedHttpMessageConverter(MediaType supportedMediaType)
Method Summary
protected T | readInternal(Class<? extends T> clazz, HttpInputMessage inputMessage) Abstract template method that reads the actualy object.
protected void | writeInternal(T wireFeed, HttpOutputMessage outputMessage) Abstract template method that writes the actual body.
Methods inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
canRead, canRead, canWrite, canWrite, getContentLength, getDefaultContentType, getSupportedMediaTypes, read, setSupportedMediaTypes, supports, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_CHARSET

public static final Charset DEFAULT_CHARSET
Constructor Detail

AbstractWireFeedHttpMessageConverter

protected AbstractWireFeedHttpMessageConverter(MediaType supportedMediaType)
Method Detail

readInternal

protected T readInternal(Class<? extends T> clazz,
                         HttpInputMessage inputMessage)
                                                            throws IOException,
                                                                   HttpMessageNotReadableException
Description copied from class: AbstractHttpMessageConverter
Abstract template method that reads the actualy object. Invoked from AbstractHttpMessageConverter.read(java.lang.Class, org.springframework.http.HttpInputMessage).

Specified by:
readInternal in class AbstractHttpMessageConverter<T extends com.sun.syndication.feed.WireFeed>
Parameters:
clazz - the type of object to return
inputMessage - the HTTP input message to read from
Returns:
the converted object
Throws:
IOException - in case of I/O errors
HttpMessageNotReadableException - in case of conversion errors

writeInternal

protected void writeInternal(T wireFeed,
                             HttpOutputMessage outputMessage)
                      throws IOException,
                             HttpMessageNotWritableException
Description copied from class: AbstractHttpMessageConverter
Abstract template method that writes the actual body. Invoked from AbstractHttpMessageConverter.write(T, org.springframework.http.MediaType, org.springframework.http.HttpOutputMessage).

Specified by:
writeInternal in class AbstractHttpMessageConverter<T extends com.sun.syndication.feed.WireFeed>
Parameters:
wireFeed - the object to write to the output message
outputMessage - the message to write to
Throws:
IOException - in case of I/O errors
HttpMessageNotWritableException - in case of conversion errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AtomFeedHttpMessageConverter

org.springframework.http.converter.feed
Class AtomFeedHttpMessageConverter

java.lang.Object
    extended by  org.springframework.http.converter.AbstractHttpMessageConverter<T>
        extended by  org.springframework.http.converter.feed.AbstractWireFeedHttpMessageConverter<com.sun.syndication.feed.atom.Feed>
            extended by  org.springframework.http.converter.feed.AtomFeedHttpMessageConverter
All Implemented Interfaces:
HttpMessageConverter<com.sun.syndication.feed.atom.Feed>
public class AtomFeedHttpMessageConverter
extends AbstractWireFeedHttpMessageConverter<com.sun.syndication.feed.atom.Feed>

Implementation of HttpMessageConverter that can read and write Atom feeds. Specifically, this converter can handle Feed objects, from the ROME project.

By default, this converter reads and writes the media type (application/atom+xml). This can be overridden by setting the supportedMediaTypes property.

Since:
3.0.2
Author:
Arjen Poutsma
See Also:
Feed

Field Summary
Fields inherited from class org.springframework.http.converter.feed.AbstractWireFeedHttpMessageConverter
DEFAULT_CHARSET
Fields inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
logger
Constructor Summary
AtomFeedHttpMessageConverter()
Method Summary
protected  boolean supports(Class<?> clazz)
Indicates whether the given class is supported by this converter.
Methods inherited from class org.springframework.http.converter.feed.AbstractWireFeedHttpMessageConverter
readInternal, writeInternal
Methods inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
canRead, canRead, canWrite, canWrite, getContentLength, getDefaultContentType, getSupportedMediaTypes, read, setSupportedMediaTypes, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AtomFeedHttpMessageConverter

public AtomFeedHttpMessageConverter()
Method Detail

supports

protected boolean supports(Class<?> clazz)
Description copied from class: AbstractHttpMessageConverter
Indicates whether the given class is supported by this converter.

Specified by:
supports in class AbstractHttpMessageConverter<com.sun.syndication.feed.atom.Feed>
Parameters:
clazz - the class to test for support
Returns:
true if supported; false otherwise
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RssChannelHttpMessageConverter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.http.converter.feed
Class RssChannelHttpMessageConverter

java.lang.Object
    extended by  org.springframework.http.converter.AbstractHttpMessageConverter<T>
        extended by  org.springframework.http.converter.feed.AbstractWireFeedHttpMessageConverter<com.sun.syndication.feed.rss.Channel>
            extended by  org.springframework.http.converter.feed.RssChannelHttpMessageConverter
All Implemented Interfaces:
HttpMessageConverter<com.sun.syndication.feed.rss.Channel>
public class RssChannelHttpMessageConverter
extends AbstractWireFeedHttpMessageConverter<com.sun.syndication.feed.rss.Channel>

Implementation of HttpMessageConverter that can read and write RSS feeds. Specifically, this converter can handle Channel objects, from the ROME project.

By default, this converter reads and writes the media type (application/rss+xml). This can be overridden by setting the supportedMediaTypes property.

Since:
3.0.2
Author:
Arjen Poutsma
See Also:
Channel

Field Summary
Fields inherited from class org.springframework.http.converter.feed.AbstractWireFeedHttpMessageConverter
DEFAULT_CHARSET
Fields inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
logger
Constructor Summary
RssChannelHttpMessageConverter()
Method Summary
protected  boolean supports(Class<?> clazz)
Indicates whether the given class is supported by this converter.
Methods inherited from class org.springframework.http.converter.feed.AbstractWireFeedHttpMessageConverter
readInternal, writeInternal
Methods inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
canRead, canRead, canWrite, canWrite, getContentLength, getDefaultContentType, getSupportedMediaTypes, read, setSupportedMediaTypes, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

RssChannelHttpMessageConverter

public RssChannelHttpMessageConverter()
Method Detail

supports

protected boolean supports(Class<?> clazz)
Description copied from class: AbstractHttpMessageConverter
Indicates whether the given class is supported by this converter.

Specified by:
supports in class AbstractHttpMessageConverter<com.sun.syndication.feed.rss.Channel>
Parameters:
clazz - the class to test for support
Returns:
true if supported; false otherwise
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.http.converter.json

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.http.converter.json

Provides an HttpMessageConverter implementations for handling JSON.

See:
Description

Class Summary
MappingJacksonHttpMessageConverter Implementation of HttpMessageConverter that can read and write JSON using Jackson's ObjectMapper.

Package org.springframework.http.converter.json Description

Provides an HttpMessageConverter implementations for handling JSON.


org.springframework.http.converter.json Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.http.converter.json

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.http.converter.AbstractHttpMessageConverter<T> (implements org.springframework.http.converter.HttpMessageConverter<T>)
      • org.springframework.http.converter.json.MappingJacksonHttpMessageConverter


MappingJacksonHttpMessageConverter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.http.converter.json
Class MappingJacksonHttpMessageConverter

java.lang.Object
    extended by  org.springframework.http.converter.AbstractHttpMessageConverter<Object>
        extended by  org.springframework.http.converter.json.MappingJacksonHttpMessageConverter
All Implemented Interfaces:
HttpMessageConverter<Object>
public class MappingJacksonHttpMessageConverter
extends AbstractHttpMessageConverter<Object>

Implementation of HttpMessageConverter that can read and write JSON using Jackson's ObjectMapper.

This converter can be used to bind to typed beans, or untyped HashMap instances.

By default, this converter supports application/json. This can be overridden by setting the supportedMediaTypes property.

Since:
3.0
Author:
Arjen Poutsma
See Also:
org.springframework.web.servlet.view.json.BindingJacksonJsonView

Field Summary
static Charset DEFAULT_CHARSET
Fields inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
logger
Constructor Summary
MappingJacksonHttpMessageConverter()
Construct a new BindingJacksonHttpMessageConverter.
Method Summary
boolean | canRead(Class<?> clazz, MediaType mediaType) Indicates whether the given class can be read by this converter.
boolean | canWrite(Class<?> clazz, MediaType mediaType) Indicates whether the given class can be written by this converter.
protected org.codehaus.jackson.type.JavaType | getJavaType(Class<?> clazz) Returns the Jackson JavaType for the specific class.
protected Object | readInternal(Class<?> clazz, HttpInputMessage inputMessage) Abstract template method that reads the actualy object.
void | setObjectMapper(org.codehaus.jackson.map.ObjectMapper objectMapper) Sets the ObjectMapper for this view.
void | setPrefixJson(boolean prefixJson) Indicates whether the JSON output by this view should be prefixed with "{} &&".
protected boolean | supports(Class<?> clazz) Indicates whether the given class is supported by this converter.
protected void | writeInternal(Object o, HttpOutputMessage outputMessage) Abstract template method that writes the actual body.
Methods inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
canRead, canWrite, getContentLength, getDefaultContentType, getSupportedMediaTypes, read, setSupportedMediaTypes, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_CHARSET

public static final Charset DEFAULT_CHARSET
Constructor Detail

MappingJacksonHttpMessageConverter

public MappingJacksonHttpMessageConverter()
Construct a new BindingJacksonHttpMessageConverter.

Method Detail

setObjectMapper

public void setObjectMapper(org.codehaus.jackson.map.ObjectMapper objectMapper)
Sets the ObjectMapper for this view. If not set, a default ObjectMapper is used.

Setting a custom-configured ObjectMapper is one way to take further control of the JSON serialization process. For example, an extended SerializerFactory can be configured that provides custom serializers for specific types. The other option for refining the serialization process is to use Jackson's provided annotations on the types to be serialized, in which case a custom-configured ObjectMapper is unnecessary.

setPrefixJson

public void setPrefixJson(boolean prefixJson)
Indicates whether the JSON output by this view should be prefixed with "{} &&". Default is false.

Prefixing the JSON string in this manner is used to help prevent JSON Hijacking. The prefix renders the string syntactically invalid as a script so that it cannot be hijacked. This prefix does not affect the evaluation of JSON, but if JSON validation is performed on the string, the prefix would need to be ignored.

canRead

public boolean canRead(Class<?> clazz,
                       MediaType mediaType)
Description copied from class: AbstractHttpMessageConverter
Indicates whether the given class can be read by this converter.

This implementation checks if the given class is supported, and if the supported media types include the given media type.

Specified by:
canRead in interface HttpMessageConverter<Object>
Overrides:
canRead in class AbstractHttpMessageConverter<Object>
Parameters:
clazz - the class to test for readability
mediaType - the media type to read, can be null if not specified. Typically the value of a Content-Type header.
Returns:
true if readable; false otherwise

getJavaType

protected org.codehaus.jackson.type.JavaType getJavaType(Class<?> clazz)
Returns the Jackson JavaType for the specific class.

Default implementation returns TypeFactory.type(java.lang.reflect.Type), but this can be overridden in subclasses, to allow for custom generic collection handling. For instance:

 protected JavaType getJavaType(Class<?> clazz) {
   if (List.class.isAssignableFrom(clazz)) {
     return TypeFactory.collectionType(ArrayList.class, MyBean.class);
   } else {
     return super.getJavaType(clazz);
   }
 }

Parameters:
clazz - the class to return the java type for
Returns:
the java type

canWrite

public boolean canWrite(Class<?> clazz,
                        MediaType mediaType)
Description copied from class: AbstractHttpMessageConverter
Indicates whether the given class can be written by this converter.

This implementation checks if the given class is supported, and if the supported media types include the given media type.

Specified by:
canWrite in interface HttpMessageConverter<Object>
Overrides:
canWrite in class AbstractHttpMessageConverter<Object>
Parameters:
clazz - the class to test for writability
mediaType - the media type to write, can be null if not specified. Typically the value of an Accept header.
Returns:
true if writable; false otherwise

supports

protected boolean supports(Class<?> clazz)
Description copied from class: AbstractHttpMessageConverter
Indicates whether the given class is supported by this converter.

Specified by:
supports in class AbstractHttpMessageConverter<Object>
Parameters:
clazz - the class to test for support
Returns:
true if supported; false otherwise

readInternal

protected Object readInternal(Class<?> clazz,
                              HttpInputMessage inputMessage)
                       throws IOException,
                              HttpMessageNotReadableException
Description copied from class: AbstractHttpMessageConverter
Abstract template method that reads the actualy object. Invoked from AbstractHttpMessageConverter.read(java.lang.Class, org.springframework.http.HttpInputMessage).

Specified by:
readInternal in class AbstractHttpMessageConverter<Object>
Parameters:
clazz - the type of object to return
inputMessage - the HTTP input message to read from
Returns:
the converted object
Throws:
IOException - in case of I/O errors
HttpMessageNotReadableException - in case of conversion errors

writeInternal

protected void writeInternal(Object o,
                             HttpOutputMessage outputMessage)
                      throws IOException,
                             HttpMessageNotWritableException
Description copied from class: AbstractHttpMessageConverter
Abstract template method that writes the actual body. Invoked from AbstractHttpMessageConverter.write(T, org.springframework.http.MediaType, org.springframework.http.HttpOutputMessage).

Specified by:
writeInternal in class AbstractHttpMessageConverter<Object>
Parameters:
o - the object to write to the output message
outputMessage - the message to write to
Throws:
IOException - in case of I/O errors
HttpMessageNotWritableException - in case of conversion errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.http.converter.xml

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.http.converter.xml

Provides an HttpMessageConverter implementations for handling XML.

See:
Description

Class Summary
AbstractJaxb2HttpMessageConverter<T> | Abstract base class for HttpMessageConverters that use JAXB2.
AbstractXmlHttpMessageConverter<T> | Abstract base class for HttpMessageConverters that convert from/to XML.
Jaxb2RootElementHttpMessageConverter | Implementation of HttpMessageConverter that can read and write XML using JAXB2.
MarshallingHttpMessageConverter | Implementation of HttpMessageConverter that can read and write XML using Spring's Marshaller and Unmarshaller abstractions.
SourceHttpMessageConverter<T extends Source> | Implementation of HttpMessageConverter that can read and write Source objects.

Package org.springframework.http.converter.xml Description

Provides an HttpMessageConverter implementations for handling XML.


org.springframework.http.converter.xml Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.http.converter.xml

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.http.converter.AbstractHttpMessageConverter<T> (implements org.springframework.http.converter.HttpMessageConverter<T>)
      • org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter<T>
        • org.springframework.http.converter.xml.AbstractJaxb2HttpMessageConverter<T>
          • org.springframework.http.converter.xml.Jaxb2RootElementHttpMessageConverter
        • org.springframework.http.converter.xml.MarshallingHttpMessageConverter
        • org.springframework.http.converter.xml.SourceHttpMessageConverter<T>


AbstractJaxb2HttpMessageConverter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.http.converter.xml
Class AbstractJaxb2HttpMessageConverter<T>

java.lang.Object
    extended by  org.springframework.http.converter.AbstractHttpMessageConverter<T>
        extended by  org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter<T>
            extended by  org.springframework.http.converter.xml.AbstractJaxb2HttpMessageConverter<T>
All Implemented Interfaces:
HttpMessageConverter<T>
Direct Known Subclasses:
Jaxb2RootElementHttpMessageConverter
public abstract class AbstractJaxb2HttpMessageConverter<T>
extends AbstractXmlHttpMessageConverter<T>

Abstract base class for HttpMessageConverters that use JAXB2. Creates JAXBContext object lazily.

Since:
3.0
Author:
Arjen Poutsma

Field Summary
Fields inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
logger
Constructor Summary
AbstractJaxb2HttpMessageConverter()
Method Summary
protected Marshaller | createMarshaller(Class clazz) Creates a new Marshaller for the given class.
protected Unmarshaller | createUnmarshaller(Class clazz) Creates a new Unmarshaller for the given class.
protected JAXBContext | getJaxbContext(Class clazz) Returns a JAXBContext for the given class.
Methods inherited from class org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter
readFromSource, readInternal, transform, writeInternal, writeToResult
Methods inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
canRead, canRead, canWrite, canWrite, getContentLength, getDefaultContentType, getSupportedMediaTypes, read, setSupportedMediaTypes, supports, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractJaxb2HttpMessageConverter

public AbstractJaxb2HttpMessageConverter()
Method Detail

createMarshaller

protected final Marshaller createMarshaller(Class clazz)
Creates a new Marshaller for the given class.

Parameters:
clazz - the class to create the marshaller for
Returns:
the Marshaller
Throws:
HttpMessageConversionException - in case of JAXB errors

createUnmarshaller

protected final Unmarshaller createUnmarshaller(Class clazz)
                                         throws JAXBException
Creates a new Unmarshaller for the given class.

Parameters:
clazz - the class to create the unmarshaller for
Returns:
the Unmarshaller
Throws:
HttpMessageConversionException - in case of JAXB errors
JAXBException

getJaxbContext

protected final JAXBContext getJaxbContext(Class clazz)
Returns a JAXBContext for the given class.

Parameters:
clazz - the class to return the context for
Returns:
the JAXBContext
Throws:
HttpMessageConversionException - in case of JAXB errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractXmlHttpMessageConverter

org.springframework.http.converter.xml
Class AbstractXmlHttpMessageConverter<T>

java.lang.Object
    extended by  org.springframework.http.converter.AbstractHttpMessageConverter<T>
        extended by  org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter<T>
All Implemented Interfaces:
HttpMessageConverter<T>
Direct Known Subclasses:
AbstractJaxb2HttpMessageConverter, MarshallingHttpMessageConverter, SourceHttpMessageConverter
public abstract class AbstractXmlHttpMessageConverter<T>
extends AbstractHttpMessageConverter<T>

Abstract base class for HttpMessageConverters that convert from/to XML.

By default, subclasses of this converter support text/xml, application/xml, and application/*-xml. This can be overridden by setting the supportedMediaTypes property.

Since:
3.0
Author:
Arjen Poutsma

Field Summary
Fields inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
logger
Constructor Summary
protected AbstractXmlHttpMessageConverter()
Protected constructor that sets the supportedMediaTypes to text/xml and application/xml, and application/*-xml.
Method Summary
protected abstract  T readFromSource(Class<? extends T> clazz, HttpHeaders headers, Source source)
Abstract template method called from AbstractHttpMessageConverter.read(Class, HttpInputMessage).
 T readInternal(Class<? extends T> clazz, HttpInputMessage inputMessage)
Abstract template method that reads the actualy object.
protected  void transform(Source source, Result result)
Transforms the given Source to the Result.
protected  void writeInternal(T t, HttpOutputMessage outputMessage)
Abstract template method that writes the actual body.
protected abstract  void writeToResult(T t, HttpHeaders headers, Result result)
Abstract template method called from writeInternal(Object, HttpOutputMessage).
Methods inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
canRead, canRead, canWrite, canWrite, getContentLength, getDefaultContentType, getSupportedMediaTypes, read, setSupportedMediaTypes, supports, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractXmlHttpMessageConverter

protected AbstractXmlHttpMessageConverter()
Protected constructor that sets the supportedMediaTypes to text/xml and application/xml, and application/*-xml.

Method Detail

readInternal

public final T readInternal(Class<? extends T> clazz,
                            HttpInputMessage inputMessage)
                     throws IOException
Description copied from class: AbstractHttpMessageConverter
Abstract template method that reads the actualy object. Invoked from AbstractHttpMessageConverter.read(java.lang.Class, org.springframework.http.HttpInputMessage).

Specified by:
readInternal in class AbstractHttpMessageConverter<T>
Parameters:
clazz - the type of object to return
inputMessage - the HTTP input message to read from
Returns:
the converted object
Throws:
IOException - in case of I/O errors

writeInternal

protected final void writeInternal(T t,
                                   HttpOutputMessage outputMessage)
                            throws IOException
Description copied from class: AbstractHttpMessageConverter
Abstract template method that writes the actual body. Invoked from AbstractHttpMessageConverter.write(T, org.springframework.http.MediaType, org.springframework.http.HttpOutputMessage).

Specified by:
writeInternal in class AbstractHttpMessageConverter<T>
Parameters:
t - the object to write to the output message
outputMessage - the message to write to
Throws:
IOException - in case of I/O errors

transform

protected void transform(Source source,
                         Result result)
                  throws TransformerException
Transforms the given Source to the Result.

Parameters:
source - the source to transform from
result - the result to transform to
Throws:
HttpMessageConversionException - in case of transformation errors
TransformerException

readFromSource

protected abstract T readFromSource(Class<? extends T> clazz,
                                    HttpHeaders headers,
                                    Source source)
                             throws IOException
Abstract template method called from AbstractHttpMessageConverter.read(Class, HttpInputMessage).

Parameters:
clazz - the type of object to return
headers - the HTTP input headers
source - the HTTP input body
Returns:
the converted object
Throws:
IOException - in case of I/O errors
HttpMessageConversionException - in case of conversion errors

writeToResult

protected abstract void writeToResult(T t,
                                      HttpHeaders headers,
                                      Result result)
                               throws IOException
Abstract template method called from writeInternal(Object, HttpOutputMessage).

Parameters:
t - the object to write to the output message
headers - the HTTP output headers
result - the HTTP output body
Throws:
IOException - in case of I/O errors
HttpMessageConversionException - in case of conversion errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Jaxb2RootElementHttpMessageConverter

org.springframework.http.converter.xml
Class Jaxb2RootElementHttpMessageConverter

java.lang.Object
    extended by  org.springframework.http.converter.AbstractHttpMessageConverter<T>
        extended by  org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter<T>
            extended by  org.springframework.http.converter.xml.AbstractJaxb2HttpMessageConverter<Object>
                extended by  org.springframework.http.converter.xml.Jaxb2RootElementHttpMessageConverter
All Implemented Interfaces:
HttpMessageConverter<Object>
public class Jaxb2RootElementHttpMessageConverter
extends AbstractJaxb2HttpMessageConverter<Object>

Implementation of HttpMessageConverter that can read and write XML using JAXB2.

This converter can read classes annotated with XmlRootElement and XmlType, and write classes annotated with with XmlRootElement, or subclasses thereof.

Since:
3.0
Author:
Arjen Poutsma

Field Summary
Fields inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
logger
Constructor Summary
Jaxb2RootElementHttpMessageConverter()
Method Summary
 boolean canRead(Class<?> clazz, MediaType mediaType)
Indicates whether the given class can be read by this converter.
 boolean canWrite(Class<?> clazz, MediaType mediaType)
Indicates whether the given class can be written by this converter.
protected  Object readFromSource(Class<?> clazz, HttpHeaders headers, Source source)
Abstract template method called from AbstractHttpMessageConverter.read(Class, HttpInputMessage).
protected  boolean supports(Class<?> clazz)
Indicates whether the given class is supported by this converter.
protected  void writeToResult(Object o, HttpHeaders headers, Result result)
Abstract template method called from AbstractXmlHttpMessageConverter.writeInternal(Object, HttpOutputMessage).
Methods inherited from class org.springframework.http.converter.xml.AbstractJaxb2HttpMessageConverter
createMarshaller, createUnmarshaller, getJaxbContext
Methods inherited from class org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter
readInternal, transform, writeInternal
Methods inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
canRead, canWrite, getContentLength, getDefaultContentType, getSupportedMediaTypes, read, setSupportedMediaTypes, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Jaxb2RootElementHttpMessageConverter

public Jaxb2RootElementHttpMessageConverter()
Method Detail

canRead

public boolean canRead(Class<?> clazz,
                       MediaType mediaType)
Description copied from class: AbstractHttpMessageConverter
Indicates whether the given class can be read by this converter.

This implementation checks if the given class is supported, and if the supported media types include the given media type.

Specified by:
canRead in interface HttpMessageConverter<Object>
Overrides:
canRead in class AbstractHttpMessageConverter<Object>
Parameters:
clazz - the class to test for readability
mediaType - the media type to read, can be null if not specified. Typically the value of a Content-Type header.
Returns:
true if readable; false otherwise

canWrite

public boolean canWrite(Class<?> clazz,
                        MediaType mediaType)
Description copied from class: AbstractHttpMessageConverter
Indicates whether the given class can be written by this converter.

This implementation checks if the given class is supported, and if the supported media types include the given media type.

Specified by:
canWrite in interface HttpMessageConverter<Object>
Overrides:
canWrite in class AbstractHttpMessageConverter<Object>
Parameters:
clazz - the class to test for writability
mediaType - the media type to write, can be null if not specified. Typically the value of an Accept header.
Returns:
true if writable; false otherwise

supports

protected boolean supports(Class<?> clazz)
Description copied from class: AbstractHttpMessageConverter
Indicates whether the given class is supported by this converter.

Specified by:
supports in class AbstractHttpMessageConverter<Object>
Parameters:
clazz - the class to test for support
Returns:
true if supported; false otherwise

readFromSource

protected Object readFromSource(Class<?> clazz,
                                HttpHeaders headers,
                                Source source)
                         throws IOException
Description copied from class: AbstractXmlHttpMessageConverter
Abstract template method called from AbstractHttpMessageConverter.read(Class, HttpInputMessage).

Specified by:
readFromSource in class AbstractXmlHttpMessageConverter<Object>
Parameters:
clazz - the type of object to return
headers - the HTTP input headers
source - the HTTP input body
Returns:
the converted object
Throws:
IOException - in case of I/O errors

writeToResult

protected void writeToResult(Object o,
                             HttpHeaders headers,
                             Result result)
                      throws IOException
Description copied from class: AbstractXmlHttpMessageConverter
Abstract template method called from AbstractXmlHttpMessageConverter.writeInternal(Object, HttpOutputMessage).

Specified by:
writeToResult in class AbstractXmlHttpMessageConverter<Object>
Parameters:
o - the object to write to the output message
headers - the HTTP output headers
result - the HTTP output body
Throws:
IOException - in case of I/O errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MarshallingHttpMessageConverter

org.springframework.http.converter.xml
Class MarshallingHttpMessageConverter

java.lang.Object
    extended by  org.springframework.http.converter.AbstractHttpMessageConverter<T>
        extended by  org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter<Object>
            extended by  org.springframework.http.converter.xml.MarshallingHttpMessageConverter
All Implemented Interfaces:
HttpMessageConverter<Object>
public class MarshallingHttpMessageConverter
extends AbstractXmlHttpMessageConverter<Object>

Implementation of HttpMessageConverter that can read and write XML using Spring's Marshaller and Unmarshaller abstractions.

This converter requires a Marshaller and Unmarshaller before it can be used. These can be injected by the constructor or bean properties.

By default, this converter supports text/xml and application/xml. This can be overridden by setting the supportedMediaTypes property.

Since:
3.0
Author:
Arjen Poutsma

Field Summary
Fields inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
logger
Constructor Summary
MarshallingHttpMessageConverter()
Construct a new MarshallingHttpMessageConverter with no Marshaller or Unmarshaller set.
MarshallingHttpMessageConverter(Marshaller marshaller)
Construct a new MarshallingMessageConverter with the given Marshaller set.
MarshallingHttpMessageConverter(Marshaller marshaller, Unmarshaller unmarshaller)
Construct a new MarshallingMessageConverter with the given Marshaller and Unmarshaller.
Method Summary
protected  Object readFromSource(Class<?> clazz, HttpHeaders headers, Source source)
Abstract template method called from AbstractHttpMessageConverter.read(Class, HttpInputMessage).
 void setMarshaller(Marshaller marshaller)
Set the Marshaller to be used by this message converter.
 void setUnmarshaller(Unmarshaller unmarshaller)
Set the Unmarshaller to be used by this message converter.
 boolean supports(Class<?> clazz)
Indicates whether the given class is supported by this converter.
protected  void writeToResult(Object o, HttpHeaders headers, Result result)
Abstract template method called from AbstractXmlHttpMessageConverter.writeInternal(Object, HttpOutputMessage).
Methods inherited from class org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter
readInternal, transform, writeInternal
Methods inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
canRead, canRead, canWrite, canWrite, getContentLength, getDefaultContentType, getSupportedMediaTypes, read, setSupportedMediaTypes, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MarshallingHttpMessageConverter

public MarshallingHttpMessageConverter()
Construct a new MarshallingHttpMessageConverter with no Marshaller or Unmarshaller set. The marshaller and unmarshaller must be set after construction by invoking setMarshaller(Marshaller) and setUnmarshaller(Unmarshaller) .

MarshallingHttpMessageConverter

public MarshallingHttpMessageConverter(Marshaller marshaller)
Construct a new MarshallingMessageConverter with the given Marshaller set.

If the given Marshaller also implements the Unmarshaller interface, it is used for both marshalling and unmarshalling. Otherwise, an exception is thrown.

Note that all Marshaller implementations in Spring also implement the Unmarshaller interface, so that you can safely use this constructor.

Parameters:
marshaller - object used as marshaller and unmarshaller

MarshallingHttpMessageConverter

public MarshallingHttpMessageConverter(Marshaller marshaller,
                                       Unmarshaller unmarshaller)
Construct a new MarshallingMessageConverter with the given Marshaller and Unmarshaller.

Parameters:
marshaller - the Marshaller to use
unmarshaller - the Unmarshaller to use
Method Detail

setMarshaller

public void setMarshaller(Marshaller marshaller)
Set the Marshaller to be used by this message converter.

setUnmarshaller

public void setUnmarshaller(Unmarshaller unmarshaller)
Set the Unmarshaller to be used by this message converter.

supports

public boolean supports(Class<?> clazz)
Description copied from class: AbstractHttpMessageConverter
Indicates whether the given class is supported by this converter.

Specified by:
supports in class AbstractHttpMessageConverter<Object>
Parameters:
clazz - the class to test for support
Returns:
true if supported; false otherwise

readFromSource

protected Object readFromSource(Class<?> clazz,
                                HttpHeaders headers,
                                Source source)
                         throws IOException
Description copied from class: AbstractXmlHttpMessageConverter
Abstract template method called from AbstractHttpMessageConverter.read(Class, HttpInputMessage).

Specified by:
readFromSource in class AbstractXmlHttpMessageConverter<Object>
Parameters:
clazz - the type of object to return
headers - the HTTP input headers
source - the HTTP input body
Returns:
the converted object
Throws:
IOException - in case of I/O errors

writeToResult

protected void writeToResult(Object o,
                             HttpHeaders headers,
                             Result result)
                      throws IOException
Description copied from class: AbstractXmlHttpMessageConverter
Abstract template method called from AbstractXmlHttpMessageConverter.writeInternal(Object, HttpOutputMessage).

Specified by:
writeToResult in class AbstractXmlHttpMessageConverter<Object>
Parameters:
o - the object to write to the output message
headers - the HTTP output headers
result - the HTTP output body
Throws:
IOException - in case of I/O errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SourceHttpMessageConverter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.http.converter.xml
Class SourceHttpMessageConverter<T extends Source>

java.lang.Object
    extended by  org.springframework.http.converter.AbstractHttpMessageConverter<T>
        extended by  org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter<T>
            extended by  org.springframework.http.converter.xml.SourceHttpMessageConverter<T>
All Implemented Interfaces:
HttpMessageConverter<T>
public class SourceHttpMessageConverter<T extends Source>
extends AbstractXmlHttpMessageConverter<T>

Implementation of HttpMessageConverter that can read and write Source objects.

Since:
3.0
Author:
Arjen Poutsma

Field Summary
Fields inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
logger
Constructor Summary
SourceHttpMessageConverter()
Method Summary
protected  T readFromSource(Class clazz, HttpHeaders headers, Source source)
Abstract template method called from AbstractHttpMessageConverter.read(Class, HttpInputMessage).
 boolean supports(Class<?> clazz)
Indicates whether the given class is supported by this converter.
protected  void writeToResult(T t, HttpHeaders headers, Result result)
Abstract template method called from AbstractXmlHttpMessageConverter.writeInternal(Object, HttpOutputMessage).
Methods inherited from class org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter
readInternal, transform, writeInternal
Methods inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
canRead, canRead, canWrite, canWrite, getContentLength, getDefaultContentType, getSupportedMediaTypes, read, setSupportedMediaTypes, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SourceHttpMessageConverter

public SourceHttpMessageConverter()
Method Detail

supports

public boolean supports(Class<?> clazz)
Description copied from class: AbstractHttpMessageConverter
Indicates whether the given class is supported by this converter.

Specified by:
supports in class AbstractHttpMessageConverter<T extends Source>
Parameters:
clazz - the class to test for support
Returns:
true if supported; false otherwise

readFromSource

protected T readFromSource(Class clazz,
                           HttpHeaders headers,
                           Source source)
                                   throws IOException
Description copied from class: AbstractXmlHttpMessageConverter
Abstract template method called from AbstractHttpMessageConverter.read(Class, HttpInputMessage).

Specified by:
readFromSource in class AbstractXmlHttpMessageConverter<T extends Source>
Parameters:
clazz - the type of object to return
headers - the HTTP input headers
source - the HTTP input body
Returns:
the converted object
Throws:
IOException - in case of I/O errors

writeToResult

protected void writeToResult(T t,
                             HttpHeaders headers,
                             Result result)
                      throws IOException
Description copied from class: AbstractXmlHttpMessageConverter
Abstract template method called from AbstractXmlHttpMessageConverter.writeInternal(Object, HttpOutputMessage).

Specified by:
writeToResult in class AbstractXmlHttpMessageConverter<T extends Source>
Parameters:
t - the object to write to the output message
headers - the HTTP output headers
result - the HTTP output body
Throws:
IOException - in case of I/O errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.http.server

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.http.server

Contains an abstraction over server-side HTTP.

See:
Description

Interface Summary
ServerHttpRequest | Represents a server-side HTTP request.
ServerHttpResponse | Represents a server-side HTTP response.

Class Summary
ServletServerHttpRequest | ServerHttpRequest implementation that is based on a HttpServletRequest.
ServletServerHttpResponse | ServerHttpResponse implementation that is based on a HttpServletResponse.

Package org.springframework.http.server Description

Contains an abstraction over server-side HTTP. This package contains the ServerHttpRequest and ServerHttpResponse, as well as a Servlet-based implementation of these interfaces.


org.springframework.http.server Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.http.server

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.http.server.ServletServerHttpRequest (implements org.springframework.http.server.ServerHttpRequest)
    • org.springframework.http.server.ServletServerHttpResponse (implements org.springframework.http.server.ServerHttpResponse)

Interface Hierarchy

  • org.springframework.http.HttpMessage
    • org.springframework.http.HttpInputMessage
      • org.springframework.http.server.ServerHttpRequest
    • org.springframework.http.HttpOutputMessage
      • org.springframework.http.server.ServerHttpResponse


ServerHttpRequest

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.http.server
Interface ServerHttpRequest

All Superinterfaces:
HttpInputMessage, HttpMessage
All Known Implementing Classes:
ServletServerHttpRequest
public interface ServerHttpRequest
extends HttpInputMessage

Represents a server-side HTTP request.

Since:
3.0
Author:
Arjen Poutsma

Method Summary
 HttpMethod getMethod()
Return the HTTP method of the request.
Methods inherited from interface org.springframework.http.HttpInputMessage
getBody
Methods inherited from interface org.springframework.http.HttpMessage
getHeaders

Method Detail

getMethod

HttpMethod getMethod()
Return the HTTP method of the request.

Returns:
the HTTP method as an HttpMethod enum value
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ServerHttpResponse

org.springframework.http.server
Interface ServerHttpResponse

All Superinterfaces:
HttpMessage, HttpOutputMessage
All Known Implementing Classes:
ServletServerHttpResponse
public interface ServerHttpResponse
extends HttpOutputMessage

Represents a server-side HTTP response.

Since:
3.0
Author:
Arjen Poutsma

Method Summary
void | close() Close this response, freeing any resources created.
void | setStatusCode(HttpStatus status) Set the HTTP status code of the response.
Methods inherited from interface org.springframework.http.HttpOutputMessage
getBody
Methods inherited from interface org.springframework.http.HttpMessage
getHeaders

Method Detail

setStatusCode

void setStatusCode(HttpStatus status)
Set the HTTP status code of the response.

Parameters:
status - the HTTP status as an HttpStatus enum value

close

void close()
Close this response, freeing any resources created.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletServerHttpRequest

org.springframework.http.server
Class ServletServerHttpRequest

java.lang.Object
    extended by  org.springframework.http.server.ServletServerHttpRequest
All Implemented Interfaces:
HttpInputMessage, HttpMessage, ServerHttpRequest
public class ServletServerHttpRequest
extends Object
implements ServerHttpRequest

ServerHttpRequest implementation that is based on a HttpServletRequest.

Since:
3.0
Author:
Arjen Poutsma

Constructor Summary
ServletServerHttpRequest(HttpServletRequest servletRequest)
Construct a new instance of the ServletServerHttpRequest based on the given HttpServletRequest
Method Summary
InputStream | getBody() Return the body of the message as an input stream.
HttpHeaders | getHeaders() Return the headers of this message.
HttpMethod | getMethod() Return the HTTP method of the request.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ServletServerHttpRequest

public ServletServerHttpRequest(HttpServletRequest servletRequest)
Construct a new instance of the ServletServerHttpRequest based on the given HttpServletRequest

Parameters:
servletRequest - the HttpServletRequest
Method Detail

getMethod

public HttpMethod getMethod()
Description copied from interface: ServerHttpRequest
Return the HTTP method of the request.

Specified by:
getMethod in interface ServerHttpRequest
Returns:
the HTTP method as an HttpMethod enum value

getHeaders

public HttpHeaders getHeaders()
Description copied from interface: HttpMessage
Return the headers of this message.

Specified by:
getHeaders in interface HttpMessage
Returns:
a corresponding HttpHeaders object

getBody

public InputStream getBody()
                    throws IOException
Description copied from interface: HttpInputMessage
Return the body of the message as an input stream.

Specified by:
getBody in interface HttpInputMessage
Returns:
the input stream body
Throws:
IOException - in case of I/O Errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletServerHttpResponse

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.http.server
Class ServletServerHttpResponse

java.lang.Object
    extended by  org.springframework.http.server.ServletServerHttpResponse
All Implemented Interfaces:
HttpMessage, HttpOutputMessage, ServerHttpResponse
public class ServletServerHttpResponse
extends Object
implements ServerHttpResponse

ServerHttpResponse implementation that is based on a HttpServletResponse.

Since:
3.0
Author:
Arjen Poutsma

Constructor Summary
ServletServerHttpResponse(HttpServletResponse servletResponse)
Construct a new instance of the ServletServerHttpResponse based on the given HttpServletResponse.
Method Summary
void | close() Close this response, freeing any resources created.
OutputStream | getBody() Return the body of the message as an output stream.
HttpHeaders | getHeaders() Return the headers of this message.
void | setStatusCode(HttpStatus status) Set the HTTP status code of the response.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ServletServerHttpResponse

public ServletServerHttpResponse(HttpServletResponse servletResponse)
Construct a new instance of the ServletServerHttpResponse based on the given HttpServletResponse.

Parameters:
servletResponse - the HTTP Servlet response
Method Detail

setStatusCode

public void setStatusCode(HttpStatus status)
Description copied from interface: ServerHttpResponse
Set the HTTP status code of the response.

Specified by:
setStatusCode in interface ServerHttpResponse
Parameters:
status - the HTTP status as an HttpStatus enum value

getHeaders

public HttpHeaders getHeaders()
Description copied from interface: HttpMessage
Return the headers of this message.

Specified by:
getHeaders in interface HttpMessage
Returns:
a corresponding HttpHeaders object

getBody

public OutputStream getBody()
                     throws IOException
Description copied from interface: HttpOutputMessage
Return the body of the message as an output stream.

Specified by:
getBody in interface HttpOutputMessage
Returns:
the output stream body
Throws:
IOException - in case of I/O Errors

close

public void close()
Description copied from interface: ServerHttpResponse
Close this response, freeing any resources created.

Specified by:
close in interface ServerHttpResponse
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.instrument

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.instrument

Class Summary
InstrumentationSavingAgent Java agent that saves the Instrumentation interface from the JVM for later use.


org.springframework.instrument Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.instrument

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.instrument.InstrumentationSavingAgent


InstrumentationSavingAgent

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.instrument
Class InstrumentationSavingAgent

java.lang.Object
    extended by  org.springframework.instrument.InstrumentationSavingAgent

public class InstrumentationSavingAgent
extends Object

Java agent that saves the Instrumentation interface from the JVM for later use.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller
See Also:
InstrumentationLoadTimeWeaver

Constructor Summary
InstrumentationSavingAgent()
Method Summary
static Instrumentation | getInstrumentation() Return the Instrumentation interface exposed by the JVM.
static void | premain(String agentArgs, Instrumentation inst) Save the Instrumentation interface exposed by the JVM.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

InstrumentationSavingAgent

public InstrumentationSavingAgent()
Method Detail

premain

public static void premain(String agentArgs,
                           Instrumentation inst)
Save the Instrumentation interface exposed by the JVM.

getInstrumentation

public static Instrumentation getInstrumentation()
Return the Instrumentation interface exposed by the JVM.

Note that this agent class will typically not be available in the classpath unless the agent is actually specified on JVM startup. If you intend to do conditional checking with respect to agent availability, consider using InstrumentationLoadTimeWeaver.getInstrumentation() instead - which will work without the agent class in the classpath as well.

Returns:
the Instrumentation instance previously saved when the premain(java.lang.String, java.lang.instrument.Instrumentation) method was called by the JVM; will be null if this class was not used as Java agent when this JVM was started.
See Also:
InstrumentationLoadTimeWeaver.getInstrumentation()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.instrument.classloading

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.instrument.classloading

Support package for load time weaving based on class loaders, as required by JPA providers (but not JPA-specific).

See:
Description

Interface Summary
LoadTimeWeaver Defines the contract for adding one or more ClassFileTransformers to a ClassLoader.

Class Summary
InstrumentationLoadTimeWeaver | LoadTimeWeaver relying on VM Instrumentation.
ReflectiveLoadTimeWeaver | LoadTimeWeaver which uses reflection to delegate to an underlying ClassLoader with well-known transformation hooks.
ResourceOverridingShadowingClassLoader | Subclass of ShadowingClassLoader that overrides attempts to locate certain files.
ShadowingClassLoader | ClassLoader decorator that shadows an enclosing ClassLoader, applying registered transformers to all affected classes.
SimpleInstrumentableClassLoader | Simplistic implementation of an instrumentable ClassLoader.
SimpleLoadTimeWeaver | LoadTimeWeaver that builds and exposes a SimpleInstrumentableClassLoader.
SimpleThrowawayClassLoader | ClassLoader that can be used to load classes without bringing them into the parent loader.
WeavingTransformer | ClassFileTransformer-based weaver, allowing for a list of transformers to be applied on a class byte array.

Package org.springframework.instrument.classloading Description

Support package for load time weaving based on class loaders, as required by JPA providers (but not JPA-specific).


org.springframework.instrument.classloading Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.instrument.classloading

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.lang.ClassLoader
      • org.springframework.core.DecoratingClassLoader
        • org.springframework.core.OverridingClassLoader
          • org.springframework.instrument.classloading.SimpleInstrumentableClassLoader
          • org.springframework.instrument.classloading.SimpleThrowawayClassLoader
        • org.springframework.instrument.classloading.ShadowingClassLoader
          • org.springframework.instrument.classloading.ResourceOverridingShadowingClassLoader
    • org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver (implements org.springframework.instrument.classloading.LoadTimeWeaver)
    • org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver (implements org.springframework.instrument.classloading.LoadTimeWeaver)
    • org.springframework.instrument.classloading.SimpleLoadTimeWeaver (implements org.springframework.instrument.classloading.LoadTimeWeaver)
    • org.springframework.instrument.classloading.WeavingTransformer

Interface Hierarchy

  • org.springframework.instrument.classloading.LoadTimeWeaver


LoadTimeWeaver

org.springframework.instrument.classloading
Interface LoadTimeWeaver

All Known Implementing Classes:
DefaultContextLoadTimeWeaver, GlassFishLoadTimeWeaver, InstrumentationLoadTimeWeaver, JBossLoadTimeWeaver, OC4JLoadTimeWeaver, ReflectiveLoadTimeWeaver, SimpleLoadTimeWeaver, WebLogicLoadTimeWeaver
public interface LoadTimeWeaver

Defines the contract for adding one or more ClassFileTransformers to a ClassLoader.

Implementations may operate on the current context ClassLoader or expose their own instrumentable ClassLoader.

Since:
2.0
Author:
Rod Johnson, Costin Leau
See Also:
ClassFileTransformer

Method Summary
void | addTransformer(ClassFileTransformer transformer) Add a ClassFileTransformer to be applied by this LoadTimeWeaver.
ClassLoader | getInstrumentableClassLoader() Return a ClassLoader that supports instrumentation through AspectJ-style load-time weaving based on user-defined ClassFileTransformers.
ClassLoader | getThrowawayClassLoader() Return a throwaway ClassLoader, enabling classes to be loaded and inspected without affecting the parent ClassLoader.

Method Detail

addTransformer

void addTransformer(ClassFileTransformer transformer)
Add a ClassFileTransformer to be applied by this LoadTimeWeaver.

Parameters:
transformer - the ClassFileTransformer to add

getInstrumentableClassLoader

ClassLoader getInstrumentableClassLoader()
Return a ClassLoader that supports instrumentation through AspectJ-style load-time weaving based on user-defined ClassFileTransformers.

May be the current ClassLoader, or a ClassLoader created by this LoadTimeWeaver instance.

Returns:
the ClassLoader which will expose instrumented classes according to the registered transformers

getThrowawayClassLoader

ClassLoader getThrowawayClassLoader()
Return a throwaway ClassLoader, enabling classes to be loaded and inspected without affecting the parent ClassLoader.

Should not return the same instance of the ClassLoader returned from an invocation of getInstrumentableClassLoader().

Returns:
a temporary throwaway ClassLoader; should return a new instance for each call, with no existing state
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InstrumentationLoadTimeWeaver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.instrument.classloading
Class InstrumentationLoadTimeWeaver

java.lang.Object
    extended by  org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver
All Implemented Interfaces:
LoadTimeWeaver
public class InstrumentationLoadTimeWeaver
extends Object
implements LoadTimeWeaver

LoadTimeWeaver relying on VM Instrumentation.

Start the JVM specifying the Java agent to be used, like as follows:

-javaagent:path/to/org.springframework.instrument.jar

where org.springframework.instrument.jar is a JAR file containing the InstrumentationSavingAgent class, as shipped with Spring.

In Eclipse, for example, set the "Run configuration"'s JVM args to be of the form:

-javaagent:${project_loc}/lib/org.springframework.instrument.jar

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller
See Also:
InstrumentationSavingAgent

Constructor Summary
InstrumentationLoadTimeWeaver()
Create a new InstrumentationLoadTimeWeaver for the default ClassLoader.
InstrumentationLoadTimeWeaver(ClassLoader classLoader)
Create a new InstrumentationLoadTimeWeaver for the given ClassLoader.
Method Summary
void | addTransformer(ClassFileTransformer transformer) Add a ClassFileTransformer to be applied by this LoadTimeWeaver.
ClassLoader | getInstrumentableClassLoader() We have the ability to weave the current class loader when starting the JVM in this way, so the instrumentable class loader will always be the current loader.
ClassLoader | getThrowawayClassLoader() This implementation always returns a SimpleThrowawayClassLoader.
static boolean | isInstrumentationAvailable() Check whether an Instrumentation instance is available for the current VM.
void | removeTransformers() Remove all registered transformers, in inverse order of registration.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

InstrumentationLoadTimeWeaver

public InstrumentationLoadTimeWeaver()
Create a new InstrumentationLoadTimeWeaver for the default ClassLoader.

InstrumentationLoadTimeWeaver

public InstrumentationLoadTimeWeaver(ClassLoader classLoader)
Create a new InstrumentationLoadTimeWeaver for the given ClassLoader.

Parameters:
classLoader - the ClassLoader that registered transformers are supposed to apply to
Method Detail

addTransformer

public void addTransformer(ClassFileTransformer transformer)
Description copied from interface: LoadTimeWeaver
Add a ClassFileTransformer to be applied by this LoadTimeWeaver.

Specified by:
addTransformer in interface LoadTimeWeaver
Parameters:
transformer - the ClassFileTransformer to add

getInstrumentableClassLoader

public ClassLoader getInstrumentableClassLoader()
We have the ability to weave the current class loader when starting the JVM in this way, so the instrumentable class loader will always be the current loader.

Specified by:
getInstrumentableClassLoader in interface LoadTimeWeaver
Returns:
the ClassLoader which will expose instrumented classes according to the registered transformers

getThrowawayClassLoader

public ClassLoader getThrowawayClassLoader()
This implementation always returns a SimpleThrowawayClassLoader.

Specified by:
getThrowawayClassLoader in interface LoadTimeWeaver
Returns:
a temporary throwaway ClassLoader; should return a new instance for each call, with no existing state

removeTransformers

public void removeTransformers()
Remove all registered transformers, in inverse order of registration.

isInstrumentationAvailable

public static boolean isInstrumentationAvailable()
Check whether an Instrumentation instance is available for the current VM.

See Also:
getInstrumentation()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ReflectiveLoadTimeWeaver

org.springframework.instrument.classloading
Class ReflectiveLoadTimeWeaver

java.lang.Object
    extended by  org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver
All Implemented Interfaces:
LoadTimeWeaver
public class ReflectiveLoadTimeWeaver
extends Object
implements LoadTimeWeaver

LoadTimeWeaver which uses reflection to delegate to an underlying ClassLoader with well-known transformation hooks. The underlying ClassLoader is expected to support the following weaving methods (as defined in the LoadTimeWeaver interface):

  • public void addTransformer(java.lang.instrument.ClassFileTransformer): for registering the given ClassFileTransformer on this ClassLoader
  • public ClassLoader getThrowawayClassLoader(): for obtaining a throwaway class loader for this ClassLoader (optional; ReflectiveLoadTimeWeaver will fall back to a SimpleThrowawayClassLoader if that method isn't available)

Please note that the above methods must reside in a class that is publicly accessible, although the class itself does not have to be visible to the application's class loader.

The reflective nature of this LoadTimeWeaver is particularly useful when the underlying ClassLoader implementation is loaded in a different class loader itself (such as the application server's class loader which is not visible to the web application). There is no direct API dependency between this LoadTimeWeaver adapter and the underlying ClassLoader, just a 'loose' method contract.

This is the LoadTimeWeaver to use in combination with Spring's TomcatInstrumentableClassLoader for Tomcat 5.0+ as well as with the Resin application server version 3.1+.

Since:
2.0
Author:
Costin Leau, Juergen Hoeller
See Also:
addTransformer(java.lang.instrument.ClassFileTransformer), getThrowawayClassLoader(), SimpleThrowawayClassLoader, TomcatInstrumentableClassLoader

Constructor Summary
ReflectiveLoadTimeWeaver()
Create a new ReflectiveLoadTimeWeaver for the current context class loader, which needs to support the required weaving methods.
ReflectiveLoadTimeWeaver(ClassLoader classLoader)
Create a new SimpleLoadTimeWeaver for the given class loader.
Method Summary
void | addTransformer(ClassFileTransformer transformer) Add a ClassFileTransformer to be applied by this LoadTimeWeaver.
ClassLoader | getInstrumentableClassLoader() Return a ClassLoader that supports instrumentation through AspectJ-style load-time weaving based on user-defined ClassFileTransformers.
ClassLoader | getThrowawayClassLoader() Return a throwaway ClassLoader, enabling classes to be loaded and inspected without affecting the parent ClassLoader.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ReflectiveLoadTimeWeaver

public ReflectiveLoadTimeWeaver()
Create a new ReflectiveLoadTimeWeaver for the current context class loader, which needs to support the required weaving methods.

ReflectiveLoadTimeWeaver

public ReflectiveLoadTimeWeaver(ClassLoader classLoader)
Create a new SimpleLoadTimeWeaver for the given class loader.

Parameters:
classLoader - the ClassLoader to delegate to for weaving (must support the required weaving methods).
Throws:
IllegalStateException - if the supplied ClassLoader does not support the required weaving methods
Method Detail

addTransformer

public void addTransformer(ClassFileTransformer transformer)
Description copied from interface: LoadTimeWeaver
Add a ClassFileTransformer to be applied by this LoadTimeWeaver.

Specified by:
addTransformer in interface LoadTimeWeaver
Parameters:
transformer - the ClassFileTransformer to add

getInstrumentableClassLoader

public ClassLoader getInstrumentableClassLoader()
Description copied from interface: LoadTimeWeaver
Return a ClassLoader that supports instrumentation through AspectJ-style load-time weaving based on user-defined ClassFileTransformers.

May be the current ClassLoader, or a ClassLoader created by this LoadTimeWeaver instance.

Specified by:
getInstrumentableClassLoader in interface LoadTimeWeaver
Returns:
the ClassLoader which will expose instrumented classes according to the registered transformers

getThrowawayClassLoader

public ClassLoader getThrowawayClassLoader()
Description copied from interface: LoadTimeWeaver
Return a throwaway ClassLoader, enabling classes to be loaded and inspected without affecting the parent ClassLoader.

Should not return the same instance of the ClassLoader returned from an invocation of LoadTimeWeaver.getInstrumentableClassLoader().

Specified by:
getThrowawayClassLoader in interface LoadTimeWeaver
Returns:
a temporary throwaway ClassLoader; should return a new instance for each call, with no existing state
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResourceOverridingShadowingClassLoader

org.springframework.instrument.classloading
Class ResourceOverridingShadowingClassLoader

java.lang.Object
    extended by  java.lang.ClassLoader
        extended by  org.springframework.core.DecoratingClassLoader
            extended by  org.springframework.instrument.classloading.ShadowingClassLoader
                extended by  org.springframework.instrument.classloading.ResourceOverridingShadowingClassLoader

public class ResourceOverridingShadowingClassLoader
extends ShadowingClassLoader

Subclass of ShadowingClassLoader that overrides attempts to locate certain files.

Since:
2.0
Author:
Rod Johnson, Adrian Colyer

Field Summary
Fields inherited from class org.springframework.instrument.classloading.ShadowingClassLoader
DEFAULT_EXCLUDED_PACKAGES
Constructor Summary
ResourceOverridingShadowingClassLoader(ClassLoader enclosingClassLoader)
Create a new ResourceOverridingShadowingClassLoader, decorating the given ClassLoader.
Method Summary
void | copyOverrides(ResourceOverridingShadowingClassLoader other) Copy all overrides from the given ClassLoader.
URL | getResource(String requestedPath)
InputStream | getResourceAsStream(String requestedPath)
Enumeration<URL> | getResources(String requestedPath)
void | override(String oldPath, String newPath) Return the resource (if any) at the new path on an attempt to locate a resource at the old path.
void | suppress(String oldPath) Ensure that a resource with the given path is not found.
Methods inherited from class org.springframework.instrument.classloading.ShadowingClassLoader
addTransformer, copyTransformers, isEligibleForShadowing, loadClass
Methods inherited from class org.springframework.core.DecoratingClassLoader
excludeClass, excludePackage, isExcluded
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ResourceOverridingShadowingClassLoader

public ResourceOverridingShadowingClassLoader(ClassLoader enclosingClassLoader)
Create a new ResourceOverridingShadowingClassLoader, decorating the given ClassLoader.

Parameters:
enclosingClassLoader - the ClassLoader to decorate
Method Detail

override

public void override(String oldPath,
                     String newPath)
Return the resource (if any) at the new path on an attempt to locate a resource at the old path.

Parameters:
oldPath - the path requested
newPath - the actual path to be looked up

suppress

public void suppress(String oldPath)
Ensure that a resource with the given path is not found.

Parameters:
oldPath - the path of the resource to hide even if it exists in the parent ClassLoader

copyOverrides

public void copyOverrides(ResourceOverridingShadowingClassLoader other)
Copy all overrides from the given ClassLoader.

Parameters:
other - the other ClassLoader to copy from

getResource

public URL getResource(String requestedPath)
Overrides:
getResource in class ShadowingClassLoader

getResourceAsStream

public InputStream getResourceAsStream(String requestedPath)
Overrides:
getResourceAsStream in class ShadowingClassLoader

getResources

public Enumeration<URL> getResources(String requestedPath)
                              throws IOException
Overrides:
getResources in class ShadowingClassLoader
Throws:
IOException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ShadowingClassLoader

org.springframework.instrument.classloading
Class ShadowingClassLoader

java.lang.Object
    extended by  java.lang.ClassLoader
        extended by  org.springframework.core.DecoratingClassLoader
            extended by  org.springframework.instrument.classloading.ShadowingClassLoader
Direct Known Subclasses:
ResourceOverridingShadowingClassLoader
public class ShadowingClassLoader
extends DecoratingClassLoader

ClassLoader decorator that shadows an enclosing ClassLoader, applying registered transformers to all affected classes.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller, Costin Leau
See Also:
addTransformer(java.lang.instrument.ClassFileTransformer), OverridingClassLoader

Field Summary
static String[] DEFAULT_EXCLUDED_PACKAGES
Packages that are excluded by default
Constructor Summary
ShadowingClassLoader(ClassLoader enclosingClassLoader)
Create a new ShadowingClassLoader, decorating the given ClassLoader.
Method Summary
void | addTransformer(ClassFileTransformer transformer) Add the given ClassFileTransformer to the list of transformers that this ClassLoader will apply.
void | copyTransformers(ShadowingClassLoader other) Copy all ClassFileTransformers from the given ClassLoader to the list of transformers that this ClassLoader will apply.
URL | getResource(String name)
InputStream | getResourceAsStream(String name)
Enumeration<URL> | getResources(String name)
protected boolean | isEligibleForShadowing(String className) Determine whether the specified class is eligible for shadowing by this class loader.
Class<?> | loadClass(String name)
Methods inherited from class org.springframework.core.DecoratingClassLoader
excludeClass, excludePackage, isExcluded
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_EXCLUDED_PACKAGES

public static final String[] DEFAULT_EXCLUDED_PACKAGES
Packages that are excluded by default

Constructor Detail

ShadowingClassLoader

public ShadowingClassLoader(ClassLoader enclosingClassLoader)
Create a new ShadowingClassLoader, decorating the given ClassLoader.

Parameters:
enclosingClassLoader - the ClassLoader to decorate
Method Detail

addTransformer

public void addTransformer(ClassFileTransformer transformer)
Add the given ClassFileTransformer to the list of transformers that this ClassLoader will apply.

Parameters:
transformer - the ClassFileTransformer

copyTransformers

public void copyTransformers(ShadowingClassLoader other)
Copy all ClassFileTransformers from the given ClassLoader to the list of transformers that this ClassLoader will apply.

Parameters:
other - the ClassLoader to copy from

loadClass

public Class<?> loadClass(String name)
                   throws ClassNotFoundException
Overrides:
loadClass in class ClassLoader
Throws:
ClassNotFoundException

isEligibleForShadowing

protected boolean isEligibleForShadowing(String className)
Determine whether the specified class is eligible for shadowing by this class loader.

Parameters:
className - the class name to check
Returns:
whether the specified class is eligible
See Also:
DecoratingClassLoader.isExcluded(java.lang.String)

getResource

public URL getResource(String name)
Overrides:
getResource in class ClassLoader

getResourceAsStream

public InputStream getResourceAsStream(String name)
Overrides:
getResourceAsStream in class ClassLoader

getResources

public Enumeration<URL> getResources(String name)
                              throws IOException
Overrides:
getResources in class ClassLoader
Throws:
IOException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleInstrumentableClassLoader

org.springframework.instrument.classloading
Class SimpleInstrumentableClassLoader

java.lang.Object
    extended by  java.lang.ClassLoader
        extended by  org.springframework.core.DecoratingClassLoader
            extended by  org.springframework.core.OverridingClassLoader
                extended by  org.springframework.instrument.classloading.SimpleInstrumentableClassLoader

public class SimpleInstrumentableClassLoader
extends OverridingClassLoader

Simplistic implementation of an instrumentable ClassLoader.

Usable in tests and standalone environments.

Since:
2.0
Author:
Rod Johnson, Costin Leau

Field Summary
Fields inherited from class org.springframework.core.OverridingClassLoader
DEFAULT_EXCLUDED_PACKAGES
Constructor Summary
SimpleInstrumentableClassLoader(ClassLoader parent)
Create a new SimpleLoadTimeWeaver for the given ClassLoader.
Method Summary
void | addTransformer(ClassFileTransformer transformer) Add a ClassFileTransformer to be applied by this ClassLoader.
protected byte[] | transformIfNecessary(String name, byte[] bytes) Transformation hook to be implemented by subclasses.
Methods inherited from class org.springframework.core.OverridingClassLoader
isEligibleForOverriding, loadBytesForClass, loadClass, loadClassForOverriding, openStreamForClass
Methods inherited from class org.springframework.core.DecoratingClassLoader
excludeClass, excludePackage, isExcluded
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleInstrumentableClassLoader

public SimpleInstrumentableClassLoader(ClassLoader parent)
Create a new SimpleLoadTimeWeaver for the given ClassLoader.

Parameters:
parent - the ClassLoader to build a simple instrumentable ClassLoader for
Method Detail

addTransformer

public void addTransformer(ClassFileTransformer transformer)
Add a ClassFileTransformer to be applied by this ClassLoader.

Parameters:
transformer - the ClassFileTransformer to register

transformIfNecessary

protected byte[] transformIfNecessary(String name,
                                      byte[] bytes)
Description copied from class: OverridingClassLoader
Transformation hook to be implemented by subclasses.

The default implementation simply returns the given bytes as-is.

Overrides:
transformIfNecessary in class OverridingClassLoader
Parameters:
name - the fully-qualified name of the class being transformed
bytes - the raw bytes of the class
Returns:
the transformed bytes (never null; same as the input bytes if the transformation produced no changes)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleLoadTimeWeaver

org.springframework.instrument.classloading
Class SimpleLoadTimeWeaver

java.lang.Object
    extended by  org.springframework.instrument.classloading.SimpleLoadTimeWeaver
All Implemented Interfaces:
LoadTimeWeaver
public class SimpleLoadTimeWeaver
extends Object
implements LoadTimeWeaver

LoadTimeWeaver that builds and exposes a SimpleInstrumentableClassLoader.

Mainly intended for testing environments, where it is sufficient to perform all class transformation on a newly created ClassLoader instance.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller
See Also:
getInstrumentableClassLoader(), SimpleInstrumentableClassLoader, ReflectiveLoadTimeWeaver

Constructor Summary
SimpleLoadTimeWeaver()
Create a new SimpleLoadTimeWeaver for the current context ClassLoader.
SimpleLoadTimeWeaver(SimpleInstrumentableClassLoader classLoader)
Create a new SimpleLoadTimeWeaver for the given ClassLoader.
Method Summary
void | addTransformer(ClassFileTransformer transformer) Add a ClassFileTransformer to be applied by this LoadTimeWeaver.
ClassLoader | getInstrumentableClassLoader() Return a ClassLoader that supports instrumentation through AspectJ-style load-time weaving based on user-defined ClassFileTransformers.
ClassLoader | getThrowawayClassLoader() This implementation builds a SimpleThrowawayClassLoader.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleLoadTimeWeaver

public SimpleLoadTimeWeaver()
Create a new SimpleLoadTimeWeaver for the current context ClassLoader.

See Also:
SimpleInstrumentableClassLoader

SimpleLoadTimeWeaver

public SimpleLoadTimeWeaver(SimpleInstrumentableClassLoader classLoader)
Create a new SimpleLoadTimeWeaver for the given ClassLoader.

Parameters:
classLoader - the ClassLoader to build a simple instrumentable ClassLoader on top of
Method Detail

addTransformer

public void addTransformer(ClassFileTransformer transformer)
Description copied from interface: LoadTimeWeaver
Add a ClassFileTransformer to be applied by this LoadTimeWeaver.

Specified by:
addTransformer in interface LoadTimeWeaver
Parameters:
transformer - the ClassFileTransformer to add

getInstrumentableClassLoader

public ClassLoader getInstrumentableClassLoader()
Description copied from interface: LoadTimeWeaver
Return a ClassLoader that supports instrumentation through AspectJ-style load-time weaving based on user-defined ClassFileTransformers.

May be the current ClassLoader, or a ClassLoader created by this LoadTimeWeaver instance.

Specified by:
getInstrumentableClassLoader in interface LoadTimeWeaver
Returns:
the ClassLoader which will expose instrumented classes according to the registered transformers

getThrowawayClassLoader

public ClassLoader getThrowawayClassLoader()
This implementation builds a SimpleThrowawayClassLoader.

Specified by:
getThrowawayClassLoader in interface LoadTimeWeaver
Returns:
a temporary throwaway ClassLoader; should return a new instance for each call, with no existing state
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleThrowawayClassLoader

org.springframework.instrument.classloading
Class SimpleThrowawayClassLoader

java.lang.Object
    extended by  java.lang.ClassLoader
        extended by  org.springframework.core.DecoratingClassLoader
            extended by  org.springframework.core.OverridingClassLoader
                extended by  org.springframework.instrument.classloading.SimpleThrowawayClassLoader

public class SimpleThrowawayClassLoader
extends OverridingClassLoader

ClassLoader that can be used to load classes without bringing them into the parent loader. Intended to support JPA "temp class loader" requirement, but not JPA-specific.

Since:
2.0
Author:
Rod Johnson

Field Summary
Fields inherited from class org.springframework.core.OverridingClassLoader
DEFAULT_EXCLUDED_PACKAGES
Constructor Summary
SimpleThrowawayClassLoader(ClassLoader parent)
Create a new SimpleThrowawayClassLoader for the given class loader.
Method Summary
Methods inherited from class org.springframework.core.OverridingClassLoader
isEligibleForOverriding, loadBytesForClass, loadClass, loadClassForOverriding, openStreamForClass, transformIfNecessary
Methods inherited from class org.springframework.core.DecoratingClassLoader
excludeClass, excludePackage, isExcluded
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleThrowawayClassLoader

public SimpleThrowawayClassLoader(ClassLoader parent)
Create a new SimpleThrowawayClassLoader for the given class loader.

Parameters:
parent - the ClassLoader to build a throwaway ClassLoader for
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WeavingTransformer

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.instrument.classloading
Class WeavingTransformer

java.lang.Object
    extended by  org.springframework.instrument.classloading.WeavingTransformer

public class WeavingTransformer
extends Object

ClassFileTransformer-based weaver, allowing for a list of transformers to be applied on a class byte array. Normally used inside class loaders.

Note: This class is deliberately implemented for minimal external dependencies, since it is included in weaver jars (to be deployed into application servers).

Since:
2.0
Author:
Rod Johnson, Costin Leau, Juergen Hoeller

Constructor Summary
WeavingTransformer(ClassLoader classLoader)
Create a new WeavingTransformer for the given class loader.
Method Summary
void | addTransformer(ClassFileTransformer transformer) Add a class file transformer to be applied by this weaver.
byte[] | transformIfNecessary(String className, byte[] bytes) Apply transformation on a given class byte definition.
byte[] | transformIfNecessary(String className, String internalName, byte[] bytes, ProtectionDomain pd) Apply transformation on a given class byte definition.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

WeavingTransformer

public WeavingTransformer(ClassLoader classLoader)
Create a new WeavingTransformer for the given class loader.

Parameters:
classLoader - the ClassLoader to build a transformer for
Method Detail

addTransformer

public void addTransformer(ClassFileTransformer transformer)
Add a class file transformer to be applied by this weaver.

Parameters:
transformer - the class file transformer to register

transformIfNecessary

public byte[] transformIfNecessary(String className,
                                   byte[] bytes)
Apply transformation on a given class byte definition. The method will always return a non-null byte array (if no transformation has taken place the array content will be identical to the original one).

Parameters:
className - the full qualified name of the class in dot format (i.e. some.package.SomeClass)
bytes - class byte definition
Returns:
(possibly transformed) class byte definition

transformIfNecessary

public byte[] transformIfNecessary(String className,
                                   String internalName,
                                   byte[] bytes,
                                   ProtectionDomain pd)
Apply transformation on a given class byte definition. The method will always return a non-null byte array (if no transformation has taken place the array content will be identical to the original one).

Parameters:
className - the full qualified name of the class in dot format (i.e. some.package.SomeClass)
internalName - class name internal name in / format (i.e. some/package/SomeClass)
bytes - class byte definition
pd - protection domain to be used (can be null)
Returns:
(possibly transformed) class byte definition
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.instrument.classloading.glassfish

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.instrument.classloading.glassfish

Support for class instrumentation on GlassFish / Sun Application Server.

See:
Description

Class Summary
GlassFishLoadTimeWeaver LoadTimeWeaver implementation for GlassFish's InstrumentableClassLoader.

Package org.springframework.instrument.classloading.glassfish Description

Support for class instrumentation on GlassFish / Sun Application Server.


org.springframework.instrument.classloading.glassfish Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.instrument.classloading.glassfish

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.instrument.classloading.glassfish.GlassFishLoadTimeWeaver (implements org.springframework.instrument.classloading.LoadTimeWeaver)


GlassFishLoadTimeWeaver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.instrument.classloading.glassfish
Class GlassFishLoadTimeWeaver

java.lang.Object
    extended by  org.springframework.instrument.classloading.glassfish.GlassFishLoadTimeWeaver
All Implemented Interfaces:
LoadTimeWeaver
public class GlassFishLoadTimeWeaver
extends Object
implements LoadTimeWeaver

LoadTimeWeaver implementation for GlassFish's InstrumentableClassLoader.

As of Spring 3.0, GlassFish V3 is supported as well.

Since:
2.0.1
Author:
Costin Leau, Juergen Hoeller

Constructor Summary
GlassFishLoadTimeWeaver()
Creates a new instance of the GlassFishLoadTimeWeaver class using the default ClassLoader.
GlassFishLoadTimeWeaver(ClassLoader classLoader)
Creates a new instance of the GlassFishLoadTimeWeaver class.
Method Summary
void | addTransformer(ClassFileTransformer transformer) Add a ClassFileTransformer to be applied by this LoadTimeWeaver.
ClassLoader | getInstrumentableClassLoader() Return a ClassLoader that supports instrumentation through AspectJ-style load-time weaving based on user-defined ClassFileTransformers.
ClassLoader | getThrowawayClassLoader() Return a throwaway ClassLoader, enabling classes to be loaded and inspected without affecting the parent ClassLoader.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

GlassFishLoadTimeWeaver

public GlassFishLoadTimeWeaver()
Creates a new instance of the GlassFishLoadTimeWeaver class using the default ClassLoader.

See Also:
GlassFishLoadTimeWeaver(ClassLoader)

GlassFishLoadTimeWeaver

public GlassFishLoadTimeWeaver(ClassLoader classLoader)
Creates a new instance of the GlassFishLoadTimeWeaver class.

Parameters:
classLoader - the specific ClassLoader to use; must not be null
Throws:
IllegalArgumentException - if the supplied classLoader is null; or if the supplied classLoader is not an InstrumentableClassLoader
Method Detail

addTransformer

public void addTransformer(ClassFileTransformer transformer)
Description copied from interface: LoadTimeWeaver
Add a ClassFileTransformer to be applied by this LoadTimeWeaver.

Specified by:
addTransformer in interface LoadTimeWeaver
Parameters:
transformer - the ClassFileTransformer to add

getInstrumentableClassLoader

public ClassLoader getInstrumentableClassLoader()
Description copied from interface: LoadTimeWeaver
Return a ClassLoader that supports instrumentation through AspectJ-style load-time weaving based on user-defined ClassFileTransformers.

May be the current ClassLoader, or a ClassLoader created by this LoadTimeWeaver instance.

Specified by:
getInstrumentableClassLoader in interface LoadTimeWeaver
Returns:
the ClassLoader which will expose instrumented classes according to the registered transformers

getThrowawayClassLoader

public ClassLoader getThrowawayClassLoader()
Description copied from interface: LoadTimeWeaver
Return a throwaway ClassLoader, enabling classes to be loaded and inspected without affecting the parent ClassLoader.

Should not return the same instance of the ClassLoader returned from an invocation of LoadTimeWeaver.getInstrumentableClassLoader().

Specified by:
getThrowawayClassLoader in interface LoadTimeWeaver
Returns:
a temporary throwaway ClassLoader; should return a new instance for each call, with no existing state
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.instrument.classloading.jboss

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.instrument.classloading.jboss

Support for class instrumentation on JBoss AS 5.x / JBoss MC 2.0.x.

See:
Description

Class Summary
JBossLoadTimeWeaver LoadTimeWeaver implementation for JBoss's instrumentable ClassLoader.

Package org.springframework.instrument.classloading.jboss Description

Support for class instrumentation on JBoss AS 5.x / JBoss MC 2.0.x.


org.springframework.instrument.classloading.jboss Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.instrument.classloading.jboss

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.instrument.classloading.jboss.JBossLoadTimeWeaver (implements org.springframework.instrument.classloading.LoadTimeWeaver)


JBossLoadTimeWeaver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.instrument.classloading.jboss
Class JBossLoadTimeWeaver

java.lang.Object
    extended by  org.springframework.instrument.classloading.jboss.JBossLoadTimeWeaver
All Implemented Interfaces:
LoadTimeWeaver
public class JBossLoadTimeWeaver
extends Object
implements LoadTimeWeaver

LoadTimeWeaver implementation for JBoss's instrumentable ClassLoader.

NOTE: Requires JBoss AS version 5.0.0 or higher.

Thanks to Ales Justin and Marius Bogoevici for the initial prototype.

Since:
3.0
Author:
Costin Leau

Constructor Summary
JBossLoadTimeWeaver()
Create a new instance of the JBossLoadTimeWeaver class using the default class loader.
JBossLoadTimeWeaver(ClassLoader classLoader)
Create a new instance of the JBossLoadTimeWeaver class using the supplied ClassLoader.
Method Summary
void | addTransformer(ClassFileTransformer transformer) Add a ClassFileTransformer to be applied by this LoadTimeWeaver.
ClassLoader | getInstrumentableClassLoader() Return a ClassLoader that supports instrumentation through AspectJ-style load-time weaving based on user-defined ClassFileTransformers.
ClassLoader | getThrowawayClassLoader() Return a throwaway ClassLoader, enabling classes to be loaded and inspected without affecting the parent ClassLoader.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JBossLoadTimeWeaver

public JBossLoadTimeWeaver()
Create a new instance of the JBossLoadTimeWeaver class using the default class loader.

See Also:
ClassUtils.getDefaultClassLoader()

JBossLoadTimeWeaver

public JBossLoadTimeWeaver(ClassLoader classLoader)
Create a new instance of the JBossLoadTimeWeaver class using the supplied ClassLoader.

Parameters:
classLoader - the ClassLoader to delegate to for weaving (must not be null)
Method Detail

addTransformer

public void addTransformer(ClassFileTransformer transformer)
Description copied from interface: LoadTimeWeaver
Add a ClassFileTransformer to be applied by this LoadTimeWeaver.

Specified by:
addTransformer in interface LoadTimeWeaver
Parameters:
transformer - the ClassFileTransformer to add

getInstrumentableClassLoader

public ClassLoader getInstrumentableClassLoader()
Description copied from interface: LoadTimeWeaver
Return a ClassLoader that supports instrumentation through AspectJ-style load-time weaving based on user-defined ClassFileTransformers.

May be the current ClassLoader, or a ClassLoader created by this LoadTimeWeaver instance.

Specified by:
getInstrumentableClassLoader in interface LoadTimeWeaver
Returns:
the ClassLoader which will expose instrumented classes according to the registered transformers

getThrowawayClassLoader

public ClassLoader getThrowawayClassLoader()
Description copied from interface: LoadTimeWeaver
Return a throwaway ClassLoader, enabling classes to be loaded and inspected without affecting the parent ClassLoader.

Should not return the same instance of the ClassLoader returned from an invocation of LoadTimeWeaver.getInstrumentableClassLoader().

Specified by:
getThrowawayClassLoader in interface LoadTimeWeaver
Returns:
a temporary throwaway ClassLoader; should return a new instance for each call, with no existing state
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.instrument.classloading.oc4j

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.instrument.classloading.oc4j

Support for class instrumentation on Oracle OC4J.

See:
Description

Class Summary
OC4JLoadTimeWeaver LoadTimeWeaver implementation for OC4J's instrumentable ClassLoader.

Package org.springframework.instrument.classloading.oc4j Description

Support for class instrumentation on Oracle OC4J.


org.springframework.instrument.classloading.oc4j Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.instrument.classloading.oc4j

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.instrument.classloading.oc4j.OC4JLoadTimeWeaver (implements org.springframework.instrument.classloading.LoadTimeWeaver)


OC4JLoadTimeWeaver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.instrument.classloading.oc4j
Class OC4JLoadTimeWeaver

java.lang.Object
    extended by  org.springframework.instrument.classloading.oc4j.OC4JLoadTimeWeaver
All Implemented Interfaces:
LoadTimeWeaver
public class OC4JLoadTimeWeaver
extends Object
implements LoadTimeWeaver

LoadTimeWeaver implementation for OC4J's instrumentable ClassLoader.

NOTE: Requires Oracle OC4J version 10.1.3.1 or higher.

Many thanks to Mike Keith for his assistance.

Since:
2.0
Author:
Costin Leau, Juergen Hoeller

Constructor Summary
OC4JLoadTimeWeaver()
Creates a new instance of thie OC4JLoadTimeWeaver class using the default class loader.
OC4JLoadTimeWeaver(ClassLoader classLoader)
Creates a new instance of the OC4JLoadTimeWeaver class using the supplied ClassLoader.
Method Summary
void | addTransformer(ClassFileTransformer transformer) Add a ClassFileTransformer to be applied by this LoadTimeWeaver.
ClassLoader | getInstrumentableClassLoader() Return a ClassLoader that supports instrumentation through AspectJ-style load-time weaving based on user-defined ClassFileTransformers.
ClassLoader | getThrowawayClassLoader() Return a throwaway ClassLoader, enabling classes to be loaded and inspected without affecting the parent ClassLoader.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OC4JLoadTimeWeaver

public OC4JLoadTimeWeaver()
Creates a new instance of thie OC4JLoadTimeWeaver class using the default class loader.

See Also:
ClassUtils.getDefaultClassLoader()

OC4JLoadTimeWeaver

public OC4JLoadTimeWeaver(ClassLoader classLoader)
Creates a new instance of the OC4JLoadTimeWeaver class using the supplied ClassLoader.

Parameters:
classLoader - the ClassLoader to delegate to for weaving
Method Detail

addTransformer

public void addTransformer(ClassFileTransformer transformer)
Description copied from interface: LoadTimeWeaver
Add a ClassFileTransformer to be applied by this LoadTimeWeaver.

Specified by:
addTransformer in interface LoadTimeWeaver
Parameters:
transformer - the ClassFileTransformer to add

getInstrumentableClassLoader

public ClassLoader getInstrumentableClassLoader()
Description copied from interface: LoadTimeWeaver
Return a ClassLoader that supports instrumentation through AspectJ-style load-time weaving based on user-defined ClassFileTransformers.

May be the current ClassLoader, or a ClassLoader created by this LoadTimeWeaver instance.

Specified by:
getInstrumentableClassLoader in interface LoadTimeWeaver
Returns:
the ClassLoader which will expose instrumented classes according to the registered transformers

getThrowawayClassLoader

public ClassLoader getThrowawayClassLoader()
Description copied from interface: LoadTimeWeaver
Return a throwaway ClassLoader, enabling classes to be loaded and inspected without affecting the parent ClassLoader.

Should not return the same instance of the ClassLoader returned from an invocation of LoadTimeWeaver.getInstrumentableClassLoader().

Specified by:
getThrowawayClassLoader in interface LoadTimeWeaver
Returns:
a temporary throwaway ClassLoader; should return a new instance for each call, with no existing state
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.instrument.classloading.tomcat

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.instrument.classloading.tomcat

Support for class instrumentation on Apache Tomcat.

See:
Description

Class Summary
TomcatInstrumentableClassLoader Extension of Tomcat's default class loader which adds instrumentation to loaded classes without the need to use a VM-wide agent.

Package org.springframework.instrument.classloading.tomcat Description

Support for class instrumentation on Apache Tomcat.


org.springframework.instrument.classloading.tomcat Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.instrument.classloading.tomcat

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.lang.ClassLoader
      • java.security.SecureClassLoader
        • java.net.URLClassLoader
          • org.apache.catalina.loader.WebappClassLoader (implements org.apache.catalina.Lifecycle, org.apache.catalina.loader.Reloader)
            • org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader


TomcatInstrumentableClassLoader

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.instrument.classloading.tomcat
Class TomcatInstrumentableClassLoader

java.lang.Object
    extended by  java.lang.ClassLoader
        extended by  java.security.SecureClassLoader
            extended by  java.net.URLClassLoader
                extended by  org.apache.catalina.loader.WebappClassLoader
                    extended by  org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader
All Implemented Interfaces:
org.apache.catalina.Lifecycle, org.apache.catalina.loader.Reloader
public class TomcatInstrumentableClassLoader
extends org.apache.catalina.loader.WebappClassLoader

Extension of Tomcat's default class loader which adds instrumentation to loaded classes without the need to use a VM-wide agent.

To be registered using a Loader tag in Tomcat's Context definition in the server.xml file, with the Spring-provided "spring-tomcat-weaver.jar" file deployed into Tomcat's "server/lib" (for Tomcat 5.x) or "lib" (for Tomcat 6.x) directory. The required configuration tag looks as follows:

<Loader loaderClass="org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader"/>

Typically used in combination with a ReflectiveLoadTimeWeaver defined in the Spring application context. The addTransformer and getThrowawayClassLoader methods mirror the corresponding methods in the LoadTimeWeaver interface, as expected by ReflectiveLoadTimeWeaver.

See the PetClinic sample application for a full example of this ClassLoader in action.

NOTE: Requires Apache Tomcat version 5.0 or higher.

Since:
2.0
Author:
Costin Leau, Juergen Hoeller
See Also:
addTransformer(java.lang.instrument.ClassFileTransformer), getThrowawayClassLoader(), ReflectiveLoadTimeWeaver

Nested Class Summary
Nested classes/interfaces inherited from class org.apache.catalina.loader.WebappClassLoader
org.apache.catalina.loader.WebappClassLoader.PrivilegedFindResource
Field Summary
Fields inherited from class org.apache.catalina.loader.WebappClassLoader
allPermission, delegate, ENABLE_CLEAR_REFERENCES, files, hasExternalRepositories, jarFiles, jarNames, jarPath, jarRealFiles, lastJarAccessed, lastModifiedDates, loaderDir, loaderPC, log, needConvert, notFoundResources, packageTriggers, parent, paths, permissionList, repositories, repositoryURLs, resourceEntries, resources, securityManager, sm, started, system, triggers
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, DESTROY_EVENT, INIT_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT
Constructor Summary
TomcatInstrumentableClassLoader()
Create a new TomcatInstrumentableClassLoader using the current context class loader.
TomcatInstrumentableClassLoader(ClassLoader parent)
Create a new TomcatInstrumentableClassLoader with the supplied class loader as parent.
Method Summary
void | addTransformer(ClassFileTransformer transformer) Delegate for LoadTimeWeaver's addTransformer method.
protected org.apache.catalina.loader.ResourceEntry | findResourceInternal(String name, String path)
ClassLoader | getThrowawayClassLoader() Delegate for LoadTimeWeaver's getThrowawayClassLoader method.
String | toString()
Methods inherited from class org.apache.catalina.loader.WebappClassLoader
addLifecycleListener, addPermission, addPermission, addPermission, addRepository, addURL, clearReferences, closeJARs, deleteDir, filter, findClass, findClassInternal, findLifecycleListeners, findLoadedClass0, findLoadedResource, findRepositories, findResource, findResourceInternal, findResources, getAntiJARLocking, getDelegate, getJarPath, getPermissions, getResource, getResourceAsStream, getResources, getURI, getURL, getURLs, isPackageSealed, loadClass, loadClass, loadedByThisOrChild, modified, nullInstance, openJARs, refreshPolicy, removeLifecycleListener, setAntiJARLocking, setDelegate, setJarPath, setParentClassLoader, setResources, setWorkDir, start, stop, validate, validateJarFile
Methods inherited from class java.net.URLClassLoader
definePackage, newInstance, newInstance
Methods inherited from class java.security.SecureClassLoader
defineClass, defineClass
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

TomcatInstrumentableClassLoader

public TomcatInstrumentableClassLoader()
Create a new TomcatInstrumentableClassLoader using the current context class loader.

See Also:
TomcatInstrumentableClassLoader(ClassLoader)

TomcatInstrumentableClassLoader

public TomcatInstrumentableClassLoader(ClassLoader parent)
Create a new TomcatInstrumentableClassLoader with the supplied class loader as parent.

Parameters:
parent - the parent ClassLoader to be used
Method Detail

addTransformer

public void addTransformer(ClassFileTransformer transformer)
Delegate for LoadTimeWeaver's addTransformer method. Typically called through ReflectiveLoadTimeWeaver.

See Also:
LoadTimeWeaver.addTransformer(java.lang.instrument.ClassFileTransformer), ReflectiveLoadTimeWeaver

getThrowawayClassLoader

public ClassLoader getThrowawayClassLoader()
Delegate for LoadTimeWeaver's getThrowawayClassLoader method. Typically called through ReflectiveLoadTimeWeaver.

See Also:
LoadTimeWeaver.getThrowawayClassLoader(), ReflectiveLoadTimeWeaver

findResourceInternal

protected org.apache.catalina.loader.ResourceEntry findResourceInternal(String name,
                                                                        String path)
Overrides:
findResourceInternal in class org.apache.catalina.loader.WebappClassLoader

toString

public String toString()
Overrides:
toString in class org.apache.catalina.loader.WebappClassLoader
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.instrument.classloading.weblogic

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.instrument.classloading.weblogic

Support for class instrumentation on BEA WebLogic 10.

See:
Description

Class Summary
WebLogicLoadTimeWeaver LoadTimeWeaver implementation for WebLogic's instrumentable ClassLoader.

Package org.springframework.instrument.classloading.weblogic Description

Support for class instrumentation on BEA WebLogic 10.


org.springframework.instrument.classloading.weblogic Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.instrument.classloading.weblogic

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.instrument.classloading.weblogic.WebLogicLoadTimeWeaver (implements org.springframework.instrument.classloading.LoadTimeWeaver)


WebLogicLoadTimeWeaver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.instrument.classloading.weblogic
Class WebLogicLoadTimeWeaver

java.lang.Object
    extended by  org.springframework.instrument.classloading.weblogic.WebLogicLoadTimeWeaver
All Implemented Interfaces:
LoadTimeWeaver
public class WebLogicLoadTimeWeaver
extends Object
implements LoadTimeWeaver

LoadTimeWeaver implementation for WebLogic's instrumentable ClassLoader.

NOTE: Requires BEA WebLogic version 10 or higher.

Since:
2.5
Author:
Costin Leau, Juergen Hoeller

Constructor Summary
WebLogicLoadTimeWeaver()
Creates a new instance of the WebLogicLoadTimeWeaver class using the default class loader.
WebLogicLoadTimeWeaver(ClassLoader classLoader)
Creates a new instance of the WebLogicLoadTimeWeaver class using the supplied ClassLoader.
Method Summary
void | addTransformer(ClassFileTransformer transformer) Add a ClassFileTransformer to be applied by this LoadTimeWeaver.
ClassLoader | getInstrumentableClassLoader() Return a ClassLoader that supports instrumentation through AspectJ-style load-time weaving based on user-defined ClassFileTransformers.
ClassLoader | getThrowawayClassLoader() Return a throwaway ClassLoader, enabling classes to be loaded and inspected without affecting the parent ClassLoader.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

WebLogicLoadTimeWeaver

public WebLogicLoadTimeWeaver()
Creates a new instance of the WebLogicLoadTimeWeaver class using the default class loader.

See Also:
ClassUtils.getDefaultClassLoader()

WebLogicLoadTimeWeaver

public WebLogicLoadTimeWeaver(ClassLoader classLoader)
Creates a new instance of the WebLogicLoadTimeWeaver class using the supplied ClassLoader.

Parameters:
classLoader - the ClassLoader to delegate to for weaving (must not be null)
Method Detail

addTransformer

public void addTransformer(ClassFileTransformer transformer)
Description copied from interface: LoadTimeWeaver
Add a ClassFileTransformer to be applied by this LoadTimeWeaver.

Specified by:
addTransformer in interface LoadTimeWeaver
Parameters:
transformer - the ClassFileTransformer to add

getInstrumentableClassLoader

public ClassLoader getInstrumentableClassLoader()
Description copied from interface: LoadTimeWeaver
Return a ClassLoader that supports instrumentation through AspectJ-style load-time weaving based on user-defined ClassFileTransformers.

May be the current ClassLoader, or a ClassLoader created by this LoadTimeWeaver instance.

Specified by:
getInstrumentableClassLoader in interface LoadTimeWeaver
Returns:
the ClassLoader which will expose instrumented classes according to the registered transformers

getThrowawayClassLoader

public ClassLoader getThrowawayClassLoader()
Description copied from interface: LoadTimeWeaver
Return a throwaway ClassLoader, enabling classes to be loaded and inspected without affecting the parent ClassLoader.

Should not return the same instance of the ClassLoader returned from an invocation of LoadTimeWeaver.getInstrumentableClassLoader().

Specified by:
getThrowawayClassLoader in interface LoadTimeWeaver
Returns:
a temporary throwaway ClassLoader; should return a new instance for each call, with no existing state
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jca.cci

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jca.cci

This package contains Spring's support for the Common Client Interface (CCI), as defined by the J2EE Connector Architecture.

See:
Description

Exception Summary
CannotCreateRecordException | Exception thrown when the creating of a CCI Record failed for connector-internal reasons.
CannotGetCciConnectionException | Fatal exception thrown when we can't connect to an EIS using CCI.
CciOperationNotSupportedException | Exception thrown when the connector doesn't support a specific CCI operation.
InvalidResultSetAccessException | Exception thrown when a ResultSet has been accessed in an invalid fashion.
RecordTypeNotSupportedException | Exception thrown when the creating of a CCI Record failed because the connector doesn't support the desired CCI Record type.

Package org.springframework.jca.cci Description

This package contains Spring's support for the Common Client Interface (CCI), as defined by the J2EE Connector Architecture. It is conceptually similar to the org.springframework.jdbc package, providing the same levels of data access abstraction.


org.springframework.jca.cci Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jca.cci

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.dao.DataAccessException
              • org.springframework.dao.NonTransientDataAccessException
                • org.springframework.dao.InvalidDataAccessResourceUsageException
                  • org.springframework.jca.cci.CciOperationNotSupportedException
                  • org.springframework.jca.cci.InvalidResultSetAccessException
                  • org.springframework.jca.cci.RecordTypeNotSupportedException
                • org.springframework.dao.NonTransientDataAccessResourceException
                  • org.springframework.dao.DataAccessResourceFailureException
                    • org.springframework.jca.cci.CannotCreateRecordException
                    • org.springframework.jca.cci.CannotGetCciConnectionException


CannotCreateRecordException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jca.cci
Class CannotCreateRecordException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.NonTransientDataAccessResourceException
                                extended by  org.springframework.dao.DataAccessResourceFailureException
                                    extended by  org.springframework.jca.cci.CannotCreateRecordException
All Implemented Interfaces:
Serializable
public class CannotCreateRecordException
extends DataAccessResourceFailureException

Exception thrown when the creating of a CCI Record failed for connector-internal reasons.

Since:
1.2
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
CannotCreateRecordException(String msg, ResourceException ex)
Constructor for CannotCreateRecordException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

CannotCreateRecordException

public CannotCreateRecordException(String msg,
                                   ResourceException ex)
Constructor for CannotCreateRecordException.

Parameters:
msg - message
ex - ResourceException root cause
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


CannotGetCciConnectionException

org.springframework.jca.cci
Class CannotGetCciConnectionException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.NonTransientDataAccessResourceException
                                extended by  org.springframework.dao.DataAccessResourceFailureException
                                    extended by  org.springframework.jca.cci.CannotGetCciConnectionException
All Implemented Interfaces:
Serializable
public class CannotGetCciConnectionException
extends DataAccessResourceFailureException

Fatal exception thrown when we can't connect to an EIS using CCI.

Since:
1.2
Author:
Thierry Templier, Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
CannotGetCciConnectionException(String msg, ResourceException ex)
Constructor for CannotGetCciConnectionException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

CannotGetCciConnectionException

public CannotGetCciConnectionException(String msg,
                                       ResourceException ex)
Constructor for CannotGetCciConnectionException.

Parameters:
msg - message
ex - ResourceException root cause
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CciOperationNotSupportedException

org.springframework.jca.cci
Class CciOperationNotSupportedException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.InvalidDataAccessResourceUsageException
                                extended by  org.springframework.jca.cci.CciOperationNotSupportedException
All Implemented Interfaces:
Serializable
public class CciOperationNotSupportedException
extends InvalidDataAccessResourceUsageException

Exception thrown when the connector doesn't support a specific CCI operation.

Since:
1.2
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
CciOperationNotSupportedException(String msg, ResourceException ex)
Constructor for CciOperationNotSupportedException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

CciOperationNotSupportedException

public CciOperationNotSupportedException(String msg,
                                         ResourceException ex)
Constructor for CciOperationNotSupportedException.

Parameters:
msg - message
ex - ResourceException root cause
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InvalidResultSetAccessException

org.springframework.jca.cci
Class InvalidResultSetAccessException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.InvalidDataAccessResourceUsageException
                                extended by  org.springframework.jca.cci.InvalidResultSetAccessException
All Implemented Interfaces:
Serializable
public class InvalidResultSetAccessException
extends InvalidDataAccessResourceUsageException

Exception thrown when a ResultSet has been accessed in an invalid fashion. Such exceptions always have a java.sql.SQLException root cause.

This typically happens when an invalid ResultSet column index or name has been specified.

Since:
1.2
Author:
Juergen Hoeller
See Also:
ResultSet, Serialized Form

Constructor Summary
InvalidResultSetAccessException(String msg, SQLException ex)
Constructor for InvalidResultSetAccessException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

InvalidResultSetAccessException

public InvalidResultSetAccessException(String msg,
                                       SQLException ex)
Constructor for InvalidResultSetAccessException.

Parameters:
msg - message
ex - the root cause
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RecordTypeNotSupportedException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jca.cci
Class RecordTypeNotSupportedException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.InvalidDataAccessResourceUsageException
                                extended by  org.springframework.jca.cci.RecordTypeNotSupportedException
All Implemented Interfaces:
Serializable
public class RecordTypeNotSupportedException
extends InvalidDataAccessResourceUsageException

Exception thrown when the creating of a CCI Record failed because the connector doesn't support the desired CCI Record type.

Since:
1.2
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
RecordTypeNotSupportedException(String msg, ResourceException ex)
Constructor for RecordTypeNotSupportedException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

RecordTypeNotSupportedException

public RecordTypeNotSupportedException(String msg,
                                       ResourceException ex)
Constructor for RecordTypeNotSupportedException.

Parameters:
msg - message
ex - ResourceException root cause
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jca.cci.connection

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jca.cci.connection

Provides a utility class for easy ConnectionFactory access, a PlatformTransactionManager for local CCI transactions, and various simple ConnectionFactory proxies/adapters.

See:
Description

Class Summary
CciLocalTransactionManager | PlatformTransactionManager implementation that manages local transactions for a single CCI ConnectionFactory.
ConnectionFactoryUtils | Helper class that provides static methods for obtaining CCI Connections from a ConnectionFactory.
ConnectionHolder | Connection holder, wrapping a CCI Connection.
ConnectionSpecConnectionFactoryAdapter | An adapter for a target CCI ConnectionFactory, applying the given ConnectionSpec to every standard getConnection() call, that is, implicitly invoking getConnection(ConnectionSpec) on the target.
DelegatingConnectionFactory | CCI ConnectionFactory implementation that delegates all calls to a given target ConnectionFactory.
NotSupportedRecordFactory | Implementation of the CCI RecordFactory interface that always throws NotSupportedException.
SingleConnectionFactory | A CCI ConnectionFactory adapter that returns the same Connection on all getConnection calls, and ignores calls to Connection.close().
TransactionAwareConnectionFactoryProxy | Proxy for a target CCI ConnectionFactory, adding awareness of Spring-managed transactions.

Package org.springframework.jca.cci.connection Description

Provides a utility class for easy ConnectionFactory access, a PlatformTransactionManager for local CCI transactions, and various simple ConnectionFactory proxies/adapters.


org.springframework.jca.cci.connection Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jca.cci.connection

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.transaction.support.AbstractPlatformTransactionManager (implements org.springframework.transaction.PlatformTransactionManager, java.io.Serializable)
      • org.springframework.jca.cci.connection.CciLocalTransactionManager (implements org.springframework.beans.factory.InitializingBean, org.springframework.transaction.support.ResourceTransactionManager)
    • org.springframework.jca.cci.connection.ConnectionFactoryUtils
    • org.springframework.jca.cci.connection.DelegatingConnectionFactory (implements javax.resource.cci.ConnectionFactory, org.springframework.beans.factory.InitializingBean)
      • org.springframework.jca.cci.connection.ConnectionSpecConnectionFactoryAdapter
      • org.springframework.jca.cci.connection.SingleConnectionFactory (implements org.springframework.beans.factory.DisposableBean)
      • org.springframework.jca.cci.connection.TransactionAwareConnectionFactoryProxy
    • org.springframework.jca.cci.connection.NotSupportedRecordFactory (implements javax.resource.cci.RecordFactory)
    • org.springframework.transaction.support.ResourceHolderSupport (implements org.springframework.transaction.support.ResourceHolder)
      • org.springframework.jca.cci.connection.ConnectionHolder


CciLocalTransactionManager

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jca.cci.connection
Class CciLocalTransactionManager

java.lang.Object
    extended by  org.springframework.transaction.support.AbstractPlatformTransactionManager
        extended by  org.springframework.jca.cci.connection.CciLocalTransactionManager
All Implemented Interfaces:
Serializable, InitializingBean, PlatformTransactionManager, ResourceTransactionManager
public class CciLocalTransactionManager
extends AbstractPlatformTransactionManager
implements ResourceTransactionManager, InitializingBean

PlatformTransactionManager implementation that manages local transactions for a single CCI ConnectionFactory. Binds a CCI Connection from the specified ConnectionFactory to the thread, potentially allowing for one thread-bound Connection per ConnectionFactory.

Application code is required to retrieve the CCI Connection via ConnectionFactoryUtils.getConnection(ConnectionFactory) instead of a standard J2EE-style ConnectionFactory.getConnection() call. Spring classes such as CciTemplate use this strategy implicitly. If not used in combination with this transaction manager, the ConnectionFactoryUtils lookup strategy behaves exactly like the native DataSource lookup; it can thus be used in a portable fashion.

Alternatively, you can allow application code to work with the standard J2EE lookup pattern ConnectionFactory.getConnection(), for example for legacy code that is not aware of Spring at all. In that case, define a TransactionAwareConnectionFactoryProxy for your target ConnectionFactory, which will automatically participate in Spring-managed transactions.

Since:
1.2
Author:
Thierry Templier, Juergen Hoeller
See Also:
ConnectionFactoryUtils.getConnection(javax.resource.cci.ConnectionFactory), ConnectionFactoryUtils.releaseConnection(javax.resource.cci.Connection, javax.resource.cci.ConnectionFactory), TransactionAwareConnectionFactoryProxy, CciTemplate, Serialized Form

Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
AbstractPlatformTransactionManager.SuspendedResourcesHolder
Field Summary
Fields inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
logger, SYNCHRONIZATION_ALWAYS, SYNCHRONIZATION_NEVER, SYNCHRONIZATION_ON_ACTUAL_TRANSACTION
Constructor Summary
CciLocalTransactionManager()
Create a new CciLocalTransactionManager instance.
CciLocalTransactionManager(ConnectionFactory connectionFactory)
Create a new CciLocalTransactionManager instance.
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected void | doBegin(Object transaction, TransactionDefinition definition) Begin a new transaction with semantics according to the given transaction definition.
protected void | doCleanupAfterCompletion(Object transaction) Cleanup resources after transaction completion.
protected void | doCommit(DefaultTransactionStatus status) Perform an actual commit of the given transaction.
protected Object | doGetTransaction() Return a transaction object for the current transaction state.
protected void | doResume(Object transaction, Object suspendedResources) Resume the resources of the current transaction.
protected void | doRollback(DefaultTransactionStatus status) Perform an actual rollback of the given transaction.
protected void | doSetRollbackOnly(DefaultTransactionStatus status) Set the given transaction rollback-only.
protected Object | doSuspend(Object transaction) Suspend the resources of the current transaction.
ConnectionFactory | getConnectionFactory() Return the CCI ConnectionFactory that this instance manages local transactions for.
Object | getResourceFactory() Return the resource factory that this transaction manager operates on, e.g.
protected boolean | isExistingTransaction(Object transaction) Check if the given transaction object indicates an existing transaction (that is, a transaction which has already started).
protected boolean | isRollbackOnly(Object transaction)
void | setConnectionFactory(ConnectionFactory cf) Set the CCI ConnectionFactory that this instance should manage local transactions for.
Methods inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
commit, determineTimeout, getDefaultTimeout, getTransaction, getTransactionSynchronization, invokeAfterCompletion, isFailEarlyOnGlobalRollbackOnly, isGlobalRollbackOnParticipationFailure, isNestedTransactionAllowed, isRollbackOnCommitFailure, isValidateExistingTransaction, newTransactionStatus, prepareForCommit, prepareSynchronization, prepareTransactionStatus, registerAfterCompletionWithExistingTransaction, resume, rollback, setDefaultTimeout, setFailEarlyOnGlobalRollbackOnly, setGlobalRollbackOnParticipationFailure, setNestedTransactionAllowed, setRollbackOnCommitFailure, setTransactionSynchronization, setTransactionSynchronizationName, setValidateExistingTransaction, shouldCommitOnGlobalRollbackOnly, suspend, triggerBeforeCommit, triggerBeforeCompletion, useSavepointForNestedTransaction
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.transaction.PlatformTransactionManager
commit, getTransaction, rollback

Constructor Detail

CciLocalTransactionManager

public CciLocalTransactionManager()
Create a new CciLocalTransactionManager instance. A ConnectionFactory has to be set to be able to use it.

See Also:
setConnectionFactory(javax.resource.cci.ConnectionFactory)

CciLocalTransactionManager

public CciLocalTransactionManager(ConnectionFactory connectionFactory)
Create a new CciLocalTransactionManager instance.

Parameters:
connectionFactory - CCI ConnectionFactory to manage local transactions for
Method Detail

setConnectionFactory

public void setConnectionFactory(ConnectionFactory cf)
Set the CCI ConnectionFactory that this instance should manage local transactions for.

getConnectionFactory

public ConnectionFactory getConnectionFactory()
Return the CCI ConnectionFactory that this instance manages local transactions for.

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

getResourceFactory

public Object getResourceFactory()
Description copied from interface: ResourceTransactionManager
Return the resource factory that this transaction manager operates on, e.g. a JDBC DataSource or a JMS ConnectionFactory.

This target resource factory is usually used as resource key for TransactionSynchronizationManager's resource bindings per thread.

Specified by:
getResourceFactory in interface ResourceTransactionManager
Returns:
the target resource factory (never null)
See Also:
TransactionSynchronizationManager.bindResource(java.lang.Object, java.lang.Object), TransactionSynchronizationManager.getResource(java.lang.Object)

doGetTransaction

protected Object doGetTransaction()
Description copied from class: AbstractPlatformTransactionManager
Return a transaction object for the current transaction state.

The returned object will usually be specific to the concrete transaction manager implementation, carrying corresponding transaction state in a modifiable fashion. This object will be passed into the other template methods (e.g. doBegin and doCommit), either directly or as part of a DefaultTransactionStatus instance.

The returned object should contain information about any existing transaction, that is, a transaction that has already started before the current getTransaction call on the transaction manager. Consequently, a doGetTransaction implementation will usually look for an existing transaction and store corresponding state in the returned transaction object.

Specified by:
doGetTransaction in class AbstractPlatformTransactionManager
Returns:
the current transaction object
See Also:
AbstractPlatformTransactionManager.doBegin(java.lang.Object, org.springframework.transaction.TransactionDefinition),
AbstractPlatformTransactionManager.doCommit(org.springframework.transaction.support.DefaultTransactionStatus),
AbstractPlatformTransactionManager.doRollback(org.springframework.transaction.support.DefaultTransactionStatus),
DefaultTransactionStatus.getTransaction()

isExistingTransaction

protected boolean isExistingTransaction(Object transaction)
Description copied from class: AbstractPlatformTransactionManager
Check if the given transaction object indicates an existing transaction (that is, a transaction which has already started).

The result will be evaluated according to the specified propagation behavior for the new transaction. An existing transaction might get suspended (in case of PROPAGATION_REQUIRES_NEW), or the new transaction might participate in the existing one (in case of PROPAGATION_REQUIRED).

The default implementation returns false, assuming that participating in existing transactions is generally not supported. Subclasses are of course encouraged to provide such support.

Overrides:
isExistingTransaction in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
Returns:
if there is an existing transaction
See Also:
AbstractPlatformTransactionManager.doGetTransaction()

doBegin

protected void doBegin(Object transaction,
                       TransactionDefinition definition)
Description copied from class: AbstractPlatformTransactionManager
Begin a new transaction with semantics according to the given transaction definition. Does not have to care about applying the propagation behavior, as this has already been handled by this abstract manager.

This method gets called when the transaction manager has decided to actually start a new transaction. Either there wasn't any transaction before, or the previous transaction has been suspended.

A special scenario is a nested transaction without savepoint: If useSavepointForNestedTransaction() returns "false", this method will be called to start a nested transaction when necessary. In such a context, there will be an active transaction: The implementation of this method has to detect this and start an appropriate nested transaction.

Specified by:
doBegin in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
definition - TransactionDefinition instance, describing propagation behavior, isolation level, read-only flag, timeout, and transaction name

doSuspend

protected Object doSuspend(Object transaction)
Description copied from class: AbstractPlatformTransactionManager
Suspend the resources of the current transaction. Transaction synchronization will already have been suspended.

The default implementation throws a TransactionSuspensionNotSupportedException, assuming that transaction suspension is generally not supported.

Overrides:
doSuspend in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
Returns:
an object that holds suspended resources (will be kept unexamined for passing it into doResume)
See Also:
AbstractPlatformTransactionManager.doResume(java.lang.Object, java.lang.Object)

doResume

protected void doResume(Object transaction,
                        Object suspendedResources)
Description copied from class: AbstractPlatformTransactionManager
Resume the resources of the current transaction. Transaction synchronization will be resumed afterwards.

The default implementation throws a TransactionSuspensionNotSupportedException, assuming that transaction suspension is generally not supported.

Overrides:
doResume in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
suspendedResources - the object that holds suspended resources, as returned by doSuspend
See Also:
AbstractPlatformTransactionManager.doSuspend(java.lang.Object)

isRollbackOnly

protected boolean isRollbackOnly(Object transaction)
                          throws TransactionException
Throws:
TransactionException

doCommit

protected void doCommit(DefaultTransactionStatus status)
Description copied from class: AbstractPlatformTransactionManager
Perform an actual commit of the given transaction.

An implementation does not need to check the "new transaction" flag or the rollback-only flag; this will already have been handled before. Usually, a straight commit will be performed on the transaction object contained in the passed-in status.

Specified by:
doCommit in class AbstractPlatformTransactionManager
Parameters:
status - the status representation of the transaction
See Also:
DefaultTransactionStatus.getTransaction()

doRollback

protected void doRollback(DefaultTransactionStatus status)
Description copied from class: AbstractPlatformTransactionManager
Perform an actual rollback of the given transaction.

An implementation does not need to check the "new transaction" flag; this will already have been handled before. Usually, a straight rollback will be performed on the transaction object contained in the passed-in status.

Specified by:
doRollback in class AbstractPlatformTransactionManager
Parameters:
status - the status representation of the transaction
See Also:
DefaultTransactionStatus.getTransaction()

doSetRollbackOnly

protected void doSetRollbackOnly(DefaultTransactionStatus status)
Description copied from class: AbstractPlatformTransactionManager
Set the given transaction rollback-only. Only called on rollback if the current transaction participates in an existing one.

The default implementation throws an IllegalTransactionStateException, assuming that participating in existing transactions is generally not supported. Subclasses are of course encouraged to provide such support.

Overrides:
doSetRollbackOnly in class AbstractPlatformTransactionManager
Parameters:
status - the status representation of the transaction

doCleanupAfterCompletion

protected void doCleanupAfterCompletion(Object transaction)
Description copied from class: AbstractPlatformTransactionManager
Cleanup resources after transaction completion.

Called after doCommit and doRollback execution, on any outcome. The default implementation does nothing.

Should not throw any exceptions but just issue warnings on errors.

Overrides:
doCleanupAfterCompletion in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ConnectionFactoryUtils

org.springframework.jca.cci.connection
Class ConnectionFactoryUtils

java.lang.Object
    extended by  org.springframework.jca.cci.connection.ConnectionFactoryUtils

public abstract class ConnectionFactoryUtils
extends Object

Helper class that provides static methods for obtaining CCI Connections from a ConnectionFactory. Includes special support for Spring-managed transactional Connections, e.g. managed by CciLocalTransactionManager or JtaTransactionManager.

Used internally by CciTemplate, Spring's CCI operation objects and the CciLocalTransactionManager. Can also be used directly in application code.

Since:
1.2
Author:
Thierry Templier, Juergen Hoeller
See Also:
getConnection(javax.resource.cci.ConnectionFactory), releaseConnection(javax.resource.cci.Connection, javax.resource.cci.ConnectionFactory), CciLocalTransactionManager, JtaTransactionManager, TransactionSynchronizationManager

Constructor Summary
ConnectionFactoryUtils()
Method Summary
static Connection | doGetConnection(ConnectionFactory cf) Actually obtain a CCI Connection from the given ConnectionFactory.
static void | doReleaseConnection(Connection con, ConnectionFactory cf) Actually close the given Connection, obtained from the given ConnectionFactory.
static Connection | getConnection(ConnectionFactory cf) Obtain a Connection from the given ConnectionFactory.
static Connection | getConnection(ConnectionFactory cf, ConnectionSpec spec) Obtain a Connection from the given ConnectionFactory.
static boolean | isConnectionTransactional(Connection con, ConnectionFactory cf) Determine whether the given JCA CCI Connection is transactional, that is, bound to the current thread by Spring's transaction facilities.
static void | releaseConnection(Connection con, ConnectionFactory cf) Close the given Connection, obtained from the given ConnectionFactory, if it is not managed externally (that is, not bound to the thread).
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ConnectionFactoryUtils

public ConnectionFactoryUtils()
Method Detail

getConnection

public static Connection getConnection(ConnectionFactory cf)
                                throws CannotGetCciConnectionException
Obtain a Connection from the given ConnectionFactory. Translates ResourceExceptions into the Spring hierarchy of unchecked generic data access exceptions, simplifying calling code and making any exception that is thrown more meaningful.

Is aware of a corresponding Connection bound to the current thread, for example when using CciLocalTransactionManager. Will bind a Connection to the thread if transaction synchronization is active (e.g. if in a JTA transaction).

Parameters:
cf - the ConnectionFactory to obtain Connection from
Returns:
a CCI Connection from the given ConnectionFactory
Throws:
CannotGetCciConnectionException - if the attempt to get a Connection failed
See Also:
releaseConnection(javax.resource.cci.Connection, javax.resource.cci.ConnectionFactory)

getConnection

public static Connection getConnection(ConnectionFactory cf,
                                       ConnectionSpec spec)
                                throws CannotGetCciConnectionException
Obtain a Connection from the given ConnectionFactory. Translates ResourceExceptions into the Spring hierarchy of unchecked generic data access exceptions, simplifying calling code and making any exception that is thrown more meaningful.

Is aware of a corresponding Connection bound to the current thread, for example when using CciLocalTransactionManager. Will bind a Connection to the thread if transaction synchronization is active (e.g. if in a JTA transaction).

Parameters:
cf - the ConnectionFactory to obtain Connection from
spec - the ConnectionSpec for the desired Connection (may be null). Note: If this is specified, a new Connection will be obtained for every call, without participating in a shared transactional Connection.
Returns:
a CCI Connection from the given ConnectionFactory
Throws:
CannotGetCciConnectionException - if the attempt to get a Connection failed
See Also:
releaseConnection(javax.resource.cci.Connection, javax.resource.cci.ConnectionFactory)

doGetConnection

public static Connection doGetConnection(ConnectionFactory cf)
                                  throws ResourceException
Actually obtain a CCI Connection from the given ConnectionFactory. Same as getConnection(javax.resource.cci.ConnectionFactory), but throwing the original ResourceException.

Is aware of a corresponding Connection bound to the current thread, for example when using CciLocalTransactionManager. Will bind a Connection to the thread if transaction synchronization is active (e.g. if in a JTA transaction).

Directly accessed by TransactionAwareConnectionFactoryProxy.

Parameters:
cf - the ConnectionFactory to obtain Connection from
Returns:
a CCI Connection from the given ConnectionFactory
Throws:
ResourceException - if thrown by CCI API methods
See Also:
doReleaseConnection(javax.resource.cci.Connection, javax.resource.cci.ConnectionFactory)

isConnectionTransactional

public static boolean isConnectionTransactional(Connection con,
                                                ConnectionFactory cf)
Determine whether the given JCA CCI Connection is transactional, that is, bound to the current thread by Spring's transaction facilities.

Parameters:
con - the Connection to check
cf - the ConnectionFactory that the Connection was obtained from (may be null)
Returns:
whether the Connection is transactional

releaseConnection

public static void releaseConnection(Connection con,
                                     ConnectionFactory cf)
Close the given Connection, obtained from the given ConnectionFactory, if it is not managed externally (that is, not bound to the thread).

Parameters:
con - the Connection to close if necessary (if this is null, the call will be ignored)
cf - the ConnectionFactory that the Connection was obtained from (can be null)
See Also:
getConnection(javax.resource.cci.ConnectionFactory)

doReleaseConnection

public static void doReleaseConnection(Connection con,
                                       ConnectionFactory cf)
                                throws ResourceException
Actually close the given Connection, obtained from the given ConnectionFactory. Same as releaseConnection(javax.resource.cci.Connection, javax.resource.cci.ConnectionFactory), but throwing the original ResourceException.

Directly accessed by TransactionAwareConnectionFactoryProxy.

Parameters:
con - the Connection to close if necessary (if this is null, the call will be ignored)
cf - the ConnectionFactory that the Connection was obtained from (can be null)
Throws:
ResourceException - if thrown by JCA CCI methods
See Also:
doGetConnection(javax.resource.cci.ConnectionFactory)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConnectionHolder

org.springframework.jca.cci.connection
Class ConnectionHolder

java.lang.Object
    extended by  org.springframework.transaction.support.ResourceHolderSupport
        extended by  org.springframework.jca.cci.connection.ConnectionHolder
All Implemented Interfaces:
ResourceHolder
public class ConnectionHolder
extends ResourceHolderSupport

Connection holder, wrapping a CCI Connection.

CciLocalTransactionManager binds instances of this class to the thread, for a given ConnectionFactory.

Note: This is an SPI class, not intended to be used by applications.

Since:
1.2
Author:
Thierry Templier, Juergen Hoeller
See Also:
CciLocalTransactionManager, ConnectionFactoryUtils

Constructor Summary
ConnectionHolder(Connection connection)
Method Summary
 Connection getConnection()
Methods inherited from class org.springframework.transaction.support.ResourceHolderSupport
clear, getDeadline, getTimeToLiveInMillis, getTimeToLiveInSeconds, hasTimeout, isOpen, isRollbackOnly, isSynchronizedWithTransaction, isVoid, released, requested, reset, setRollbackOnly, setSynchronizedWithTransaction, setTimeoutInMillis, setTimeoutInSeconds, unbound
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ConnectionHolder

public ConnectionHolder(Connection connection)
Method Detail

getConnection

public Connection getConnection()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConnectionSpecConnectionFactoryAdapter

org.springframework.jca.cci.connection
Class ConnectionSpecConnectionFactoryAdapter

java.lang.Object
    extended by  org.springframework.jca.cci.connection.DelegatingConnectionFactory
        extended by  org.springframework.jca.cci.connection.ConnectionSpecConnectionFactoryAdapter
All Implemented Interfaces:
Serializable, Referenceable, ConnectionFactory, InitializingBean
public class ConnectionSpecConnectionFactoryAdapter
extends DelegatingConnectionFactory

An adapter for a target CCI ConnectionFactory, applying the given ConnectionSpec to every standard getConnection() call, that is, implicitly invoking getConnection(ConnectionSpec) on the target. All other methods simply delegate to the corresponding methods of the target ConnectionFactory.

Can be used to proxy a target JNDI ConnectionFactory that does not have a ConnectionSpec configured. Client code can work with the ConnectionFactory without passing in a ConnectionSpec on every getConnection() call.

In the following example, client code can simply transparently work with the preconfigured "myConnectionFactory", implicitly accessing "myTargetConnectionFactory" with the specified user credentials.

 <bean id="myTargetConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
   <property name="jndiName" value="java:comp/env/cci/mycf"/>
 </bean>

 <bean id="myConnectionFactory" class="org.springframework.jca.cci.connection.ConnectionSpecConnectionFactoryAdapter">
   <property name="targetConnectionFactory" ref="myTargetConnectionFactory"/>
   <property name="connectionSpec">
     <bean class="your.resource.adapter.ConnectionSpecImpl">
       <property name="username" value="myusername"/>
       <property name="password" value="mypassword"/>
     </bean>
   </property>
 </bean>

If the "connectionSpec" is empty, this proxy will simply delegate to the standard getConnection() method of the target ConnectionFactory. This can be used to keep a UserCredentialsConnectionFactoryAdapter bean definition just for the option of implicitly passing in a ConnectionSpec if the particular target ConnectionFactory requires it.

Since:
1.2
Author:
Juergen Hoeller
See Also:
getConnection(), Serialized Form

Constructor Summary
ConnectionSpecConnectionFactoryAdapter()
Method Summary
protected Connection | doGetConnection(ConnectionSpec spec) This implementation delegates to the getConnection(ConnectionSpec) method of the target ConnectionFactory, passing in the specified user credentials.
Connection | getConnection() Determine whether there is currently a thread-bound ConnectionSpec, using it if available, falling back to the statically specified "connectionSpec" property else.
void | removeConnectionSpecFromCurrentThread() Remove any ConnectionSpec for this proxy from the current thread.
void | setConnectionSpec(ConnectionSpec connectionSpec) Set the ConnectionSpec that this adapter should use for retrieving Connections.
void | setConnectionSpecForCurrentThread(ConnectionSpec spec) Set a ConnectionSpec for this proxy and the current thread.
Methods inherited from class org.springframework.jca.cci.connection.DelegatingConnectionFactory
afterPropertiesSet, getConnection, getMetaData, getRecordFactory, getReference, getTargetConnectionFactory, setReference, setTargetConnectionFactory
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ConnectionSpecConnectionFactoryAdapter

public ConnectionSpecConnectionFactoryAdapter()
Method Detail

setConnectionSpec

public void setConnectionSpec(ConnectionSpec connectionSpec)
Set the ConnectionSpec that this adapter should use for retrieving Connections. Default is none.

setConnectionSpecForCurrentThread

public void setConnectionSpecForCurrentThread(ConnectionSpec spec)
Set a ConnectionSpec for this proxy and the current thread. The given ConnectionSpec will be applied to all subsequent getConnection() calls on this ConnectionFactory proxy.

This will override any statically specified "connectionSpec" property.

Parameters:
spec - the ConnectionSpec to apply
See Also:
removeConnectionSpecFromCurrentThread()

removeConnectionSpecFromCurrentThread

public void removeConnectionSpecFromCurrentThread()
Remove any ConnectionSpec for this proxy from the current thread. A statically specified ConnectionSpec applies again afterwards.

See Also:
setConnectionSpecForCurrentThread(javax.resource.cci.ConnectionSpec)

getConnection

public final Connection getConnection()
                               throws ResourceException
Determine whether there is currently a thread-bound ConnectionSpec, using it if available, falling back to the statically specified "connectionSpec" property else.

Specified by:
getConnection in interface ConnectionFactory
Overrides:
getConnection in class DelegatingConnectionFactory
Throws:
ResourceException
See Also:
doGetConnection(javax.resource.cci.ConnectionSpec)

doGetConnection

protected Connection doGetConnection(ConnectionSpec spec)
                              throws ResourceException
This implementation delegates to the getConnection(ConnectionSpec) method of the target ConnectionFactory, passing in the specified user credentials. If the specified username is empty, it will simply delegate to the standard getConnection() method of the target ConnectionFactory.

Parameters:
spec - the ConnectionSpec to apply
Returns:
the Connection
Throws:
ResourceException
See Also:
ConnectionFactory.getConnection(javax.resource.cci.ConnectionSpec), ConnectionFactory.getConnection()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DelegatingConnectionFactory

org.springframework.jca.cci.connection
Class DelegatingConnectionFactory

java.lang.Object
    extended by  org.springframework.jca.cci.connection.DelegatingConnectionFactory
All Implemented Interfaces:
Serializable, Referenceable, ConnectionFactory, InitializingBean
Direct Known Subclasses:
ConnectionSpecConnectionFactoryAdapter, SingleConnectionFactory, TransactionAwareConnectionFactoryProxy
public class DelegatingConnectionFactory
extends Object
implements ConnectionFactory, InitializingBean

CCI ConnectionFactory implementation that delegates all calls to a given target ConnectionFactory.

This class is meant to be subclassed, with subclasses overriding only those methods (such as getConnection()) that should not simply delegate to the target ConnectionFactory.

Since:
1.2
Author:
Juergen Hoeller
See Also:
getConnection(), Serialized Form

Constructor Summary
DelegatingConnectionFactory()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
Connection | getConnection()
Connection | getConnection(ConnectionSpec connectionSpec)
ResourceAdapterMetaData | getMetaData()
RecordFactory | getRecordFactory()
Reference | getReference()
ConnectionFactory | getTargetConnectionFactory() Return the target ConnectionFactory that this ConnectionFactory should delegate to.
void | setReference(Reference reference)
void | setTargetConnectionFactory(ConnectionFactory targetConnectionFactory) Set the target ConnectionFactory that this ConnectionFactory should delegate to.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DelegatingConnectionFactory

public DelegatingConnectionFactory()
Method Detail

setTargetConnectionFactory

public void setTargetConnectionFactory(ConnectionFactory targetConnectionFactory)
Set the target ConnectionFactory that this ConnectionFactory should delegate to.

getTargetConnectionFactory

public ConnectionFactory getTargetConnectionFactory()
Return the target ConnectionFactory that this ConnectionFactory should delegate to.

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

getConnection

public Connection getConnection()
                         throws ResourceException
Specified by:
getConnection in interface ConnectionFactory
Throws:
ResourceException

getConnection

public Connection getConnection(ConnectionSpec connectionSpec)
                         throws ResourceException
Specified by:
getConnection in interface ConnectionFactory
Throws:
ResourceException

getRecordFactory

public RecordFactory getRecordFactory()
                               throws ResourceException
Specified by:
getRecordFactory in interface ConnectionFactory
Throws:
ResourceException

getMetaData

public ResourceAdapterMetaData getMetaData()
                                    throws ResourceException
Specified by:
getMetaData in interface ConnectionFactory
Throws:
ResourceException

getReference

public Reference getReference()
                       throws NamingException
Specified by:
getReference in interface Referenceable
Throws:
NamingException

setReference

public void setReference(Reference reference)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NotSupportedRecordFactory

org.springframework.jca.cci.connection
Class NotSupportedRecordFactory

java.lang.Object
    extended by  org.springframework.jca.cci.connection.NotSupportedRecordFactory
All Implemented Interfaces:
RecordFactory
public class NotSupportedRecordFactory
extends Object
implements RecordFactory

Implementation of the CCI RecordFactory interface that always throws NotSupportedException.

Useful as a placeholder for a RecordFactory argument (for example as defined by the RecordCreator callback), in particular when the connector's ConnectionFactory.getRecordFactory() implementation happens to throw NotSupportedException early rather than throwing the exception from RecordFactory's methods.

Since:
1.2.4
Author:
Juergen Hoeller
See Also:
RecordCreator.createRecord(javax.resource.cci.RecordFactory),
CciTemplate.getRecordFactory(javax.resource.cci.ConnectionFactory),
ConnectionFactory.getRecordFactory(),
NotSupportedException

Constructor Summary
NotSupportedRecordFactory()
Method Summary
IndexedRecord | createIndexedRecord(String name)
MappedRecord | createMappedRecord(String name)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

NotSupportedRecordFactory

public NotSupportedRecordFactory()
Method Detail

createMappedRecord

public MappedRecord createMappedRecord(String name)
                                throws ResourceException
Specified by:
createMappedRecord in interface RecordFactory
Throws:
ResourceException

createIndexedRecord

public IndexedRecord createIndexedRecord(String name)
                                  throws ResourceException
Specified by:
createIndexedRecord in interface RecordFactory
Throws:
ResourceException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SingleConnectionFactory

org.springframework.jca.cci.connection
Class SingleConnectionFactory

java.lang.Object
    extended by  org.springframework.jca.cci.connection.DelegatingConnectionFactory
        extended by  org.springframework.jca.cci.connection.SingleConnectionFactory
All Implemented Interfaces:
Serializable, Referenceable, ConnectionFactory, DisposableBean, InitializingBean
public class SingleConnectionFactory
extends DelegatingConnectionFactory
implements DisposableBean

A CCI ConnectionFactory adapter that returns the same Connection on all getConnection calls, and ignores calls to Connection.close().

Useful for testing and standalone environments, to keep using the same Connection for multiple CciTemplate calls, without having a pooling ConnectionFactory, also spanning any number of transactions.

You can either pass in a CCI Connection directly, or let this factory lazily create a Connection via a given target ConnectionFactory.

Since:
1.2
Author:
Juergen Hoeller
See Also:
getConnection(), Connection.close(), CciTemplate, Serialized Form

Field Summary
protected  Log logger
Constructor Summary
SingleConnectionFactory()
Create a new SingleConnectionFactory for bean-style usage.
SingleConnectionFactory(Connection target)
Create a new SingleConnectionFactory that always returns the given Connection.
SingleConnectionFactory(ConnectionFactory targetConnectionFactory)
Create a new SingleConnectionFactory that always returns a single Connection which it will lazily create via the given target ConnectionFactory.
Method Summary
void | afterPropertiesSet() Make sure a Connection or ConnectionFactory has been set.
protected void | closeConnection(Connection con) Close the given Connection.
void | destroy() Close the underlying Connection.
protected Connection | doCreateConnection() Create a CCI Connection via this template's ConnectionFactory.
protected Connection | getCloseSuppressingConnectionProxy(Connection target) Wrap the given Connection with a proxy that delegates every method call to it but suppresses close calls.
Connection | getConnection()
Connection | getConnection(ConnectionSpec connectionSpec)
void | initConnection() Initialize the single underlying Connection.
protected void | prepareConnection(Connection con) Prepare the given Connection before it is exposed.
void | resetConnection() Reset the underlying shared Connection, to be reinitialized on next access.
Methods inherited from class org.springframework.jca.cci.connection.DelegatingConnectionFactory
getMetaData, getRecordFactory, getReference, getTargetConnectionFactory, setReference, setTargetConnectionFactory
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Constructor Detail

SingleConnectionFactory

public SingleConnectionFactory()
Create a new SingleConnectionFactory for bean-style usage.

See Also:
DelegatingConnectionFactory.setTargetConnectionFactory(javax.resource.cci.ConnectionFactory)

SingleConnectionFactory

public SingleConnectionFactory(Connection target)
Create a new SingleConnectionFactory that always returns the given Connection.

Parameters:
target - the single Connection

SingleConnectionFactory

public SingleConnectionFactory(ConnectionFactory targetConnectionFactory)
Create a new SingleConnectionFactory that always returns a single Connection which it will lazily create via the given target ConnectionFactory.

Parameters:
targetConnectionFactory - the target ConnectionFactory
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
Make sure a Connection or ConnectionFactory has been set.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class DelegatingConnectionFactory

getConnection

public Connection getConnection()
                         throws ResourceException
Specified by:
getConnection in interface ConnectionFactory
Overrides:
getConnection in class DelegatingConnectionFactory
Throws:
ResourceException

getConnection

public Connection getConnection(ConnectionSpec connectionSpec)
                         throws ResourceException
Specified by:
getConnection in interface ConnectionFactory
Overrides:
getConnection in class DelegatingConnectionFactory
Throws:
ResourceException

destroy

public void destroy()
Close the underlying Connection. The provider of this ConnectionFactory needs to care for proper shutdown.

As this bean implements DisposableBean, a bean factory will automatically invoke this on destruction of its cached singletons.

Specified by:
destroy in interface DisposableBean

initConnection

public void initConnection()
                    throws ResourceException
Initialize the single underlying Connection.

Closes and reinitializes the Connection if an underlying Connection is present already.

Throws:
ResourceException - if thrown by CCI API methods

resetConnection

public void resetConnection()
Reset the underlying shared Connection, to be reinitialized on next access.

doCreateConnection

protected Connection doCreateConnection()
                                 throws ResourceException
Create a CCI Connection via this template's ConnectionFactory.

Returns:
the new CCI Connection
Throws:
ResourceException - if thrown by CCI API methods

prepareConnection

protected void prepareConnection(Connection con)
                          throws ResourceException
Prepare the given Connection before it is exposed.

The default implementation is empty. Can be overridden in subclasses.

Parameters:
con - the Connection to prepare
Throws:
ResourceException

closeConnection

protected void closeConnection(Connection con)
Close the given Connection.

Parameters:
con - the Connection to close

getCloseSuppressingConnectionProxy

protected Connection getCloseSuppressingConnectionProxy(Connection target)
Wrap the given Connection with a proxy that delegates every method call to it but suppresses close calls. This is useful for allowing application code to handle a special framework Connection just like an ordinary Connection from a CCI ConnectionFactory.

Parameters:
target - the original Connection to wrap
Returns:
the wrapped Connection
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionAwareConnectionFactoryProxy

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jca.cci.connection
Class TransactionAwareConnectionFactoryProxy

java.lang.Object
    extended by  org.springframework.jca.cci.connection.DelegatingConnectionFactory
        extended by  org.springframework.jca.cci.connection.TransactionAwareConnectionFactoryProxy
All Implemented Interfaces:
Serializable, Referenceable, ConnectionFactory, InitializingBean
public class TransactionAwareConnectionFactoryProxy
extends DelegatingConnectionFactory

Proxy for a target CCI ConnectionFactory, adding awareness of Spring-managed transactions. Similar to a transactional JNDI ConnectionFactory as provided by a J2EE server.

Data access code that should remain unaware of Spring's data access support can work with this proxy to seamlessly participate in Spring-managed transactions. Note that the transaction manager, for example the CciLocalTransactionManager, still needs to work with underlying ConnectionFactory, not with this proxy.

Make sure that TransactionAwareConnectionFactoryProxy is the outermost ConnectionFactory of a chain of ConnectionFactory proxies/adapters. TransactionAwareConnectionFactoryProxy can delegate either directly to the target connection pool or to some intermediate proxy/adapter like ConnectionSpecConnectionFactoryAdapter.

Delegates to ConnectionFactoryUtils for automatically participating in thread-bound transactions, for example managed by CciLocalTransactionManager. getConnection calls and close calls on returned Connections will behave properly within a transaction, i.e. always operate on the transactional Connection. If not within a transaction, normal ConnectionFactory behavior applies.

This proxy allows data access code to work with the plain JCA CCI API and still participate in Spring-managed transactions, similar to CCI code in a J2EE/JTA environment. However, if possible, use Spring's ConnectionFactoryUtils, CciTemplate or CCI operation objects to get transaction participation even without a proxy for the target ConnectionFactory, avoiding the need to define such a proxy in the first place.

NOTE: This ConnectionFactory proxy needs to return wrapped Connections in order to handle close calls properly. Therefore, the returned Connections cannot be cast to a native CCI Connection type or to a connection pool implementation type.

Since:
1.2
Author:
Juergen Hoeller
See Also:
ConnectionFactory.getConnection(),
Connection.close(),
ConnectionFactoryUtils.doGetConnection(javax.resource.cci.ConnectionFactory),
ConnectionFactoryUtils.doReleaseConnection(javax.resource.cci.Connection, javax.resource.cci.ConnectionFactory),
Serialized Form

Constructor Summary
TransactionAwareConnectionFactoryProxy()
Create a new TransactionAwareConnectionFactoryProxy.
TransactionAwareConnectionFactoryProxy(ConnectionFactory targetConnectionFactory)
Create a new TransactionAwareConnectionFactoryProxy.
Method Summary
Connection | getConnection() Delegate to ConnectionFactoryUtils for automatically participating in Spring-managed transactions.
protected Connection | getTransactionAwareConnectionProxy(Connection target, ConnectionFactory cf) Wrap the given Connection with a proxy that delegates every method call to it but delegates close calls to ConnectionFactoryUtils.
Methods inherited from class org.springframework.jca.cci.connection.DelegatingConnectionFactory
afterPropertiesSet, getConnection, getMetaData, getRecordFactory, getReference, getTargetConnectionFactory, setReference, setTargetConnectionFactory
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TransactionAwareConnectionFactoryProxy

public TransactionAwareConnectionFactoryProxy()
Create a new TransactionAwareConnectionFactoryProxy.

See Also:
DelegatingConnectionFactory.setTargetConnectionFactory(javax.resource.cci.ConnectionFactory)

TransactionAwareConnectionFactoryProxy

public TransactionAwareConnectionFactoryProxy(ConnectionFactory targetConnectionFactory)
Create a new TransactionAwareConnectionFactoryProxy.

Parameters:
targetConnectionFactory - the target ConnectionFactory
Method Detail

getConnection

public Connection getConnection()
                         throws ResourceException
Delegate to ConnectionFactoryUtils for automatically participating in Spring-managed transactions. Throws the original ResourceException, if any.

Specified by:
getConnection in interface ConnectionFactory
Overrides:
getConnection in class DelegatingConnectionFactory
Returns:
a transactional Connection if any, a new one else
Throws:
ResourceException
See Also:
ConnectionFactoryUtils.doGetConnection(javax.resource.cci.ConnectionFactory)

getTransactionAwareConnectionProxy

protected Connection getTransactionAwareConnectionProxy(Connection target,
                                                        ConnectionFactory cf)
Wrap the given Connection with a proxy that delegates every method call to it but delegates close calls to ConnectionFactoryUtils.

Parameters:
target - the original Connection to wrap
cf - ConnectionFactory that the Connection came from
Returns:
the wrapped Connection
See Also:
Connection.close(), ConnectionFactoryUtils.doReleaseConnection(javax.resource.cci.Connection, javax.resource.cci.ConnectionFactory)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jca.cci.core

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jca.cci.core

Provides the core JCA CCI support, based on CciTemplate and its associated callback interfaces.

See:
Description

Interface Summary
CciOperations | Interface that specifies a basic set of CCI operations on an EIS.
ConnectionCallback<T> | Generic callback interface for code that operates on a CCI Connection.
InteractionCallback<T> | Generic callback interface for code that operates on a CCI Interaction.
RecordCreator | Callback interface for creating a CCI Record instance, usually based on the passed-in CCI RecordFactory.
RecordExtractor<T> | Callback interface for extracting a result object from a CCI Record instance.

Class Summary
CciTemplate This is the central class in the CCI core package. It simplifies the use of CCI and helps to avoid common errors.

Package org.springframework.jca.cci.core Description

Provides the core JCA CCI support, based on CciTemplate and its associated callback interfaces.


org.springframework.jca.cci.core Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jca.cci.core

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jca.cci.core.CciTemplate (implements org.springframework.jca.cci.core.CciOperations)

Interface Hierarchy

  • org.springframework.jca.cci.core.CciOperations
  • org.springframework.jca.cci.core.ConnectionCallback<T>
  • org.springframework.jca.cci.core.InteractionCallback<T>
  • org.springframework.jca.cci.core.RecordCreator
  • org.springframework.jca.cci.core.RecordExtractor<T>


CciOperations

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jca.cci.core
Interface CciOperations

All Known Implementing Classes:
CciTemplate
public interface CciOperations

Interface that specifies a basic set of CCI operations on an EIS. Implemented by CciTemplate. Not often used, but a useful option to enhance testability, as it can easily be mocked or stubbed.

Alternatively, the standard CCI infrastructure can be mocked. However, mocking this interface constitutes significantly less work.

Since:
1.2
Author:
Juergen Hoeller
See Also:
CciTemplate

Method Summary
<T> T
execute(ConnectionCallback<T> action)
Execute a request on an EIS with CCI, implemented as callback action working on a CCI Connection.
<T> T
execute(InteractionCallback<T> action)
Execute a request on an EIS with CCI, implemented as callback action working on a CCI Interaction.
 Record execute(InteractionSpec spec, Record inputRecord)
Execute the specified interaction on an EIS with CCI.
 Record execute(InteractionSpec spec, RecordCreator inputCreator)
Execute the specified interaction on an EIS with CCI.
<T> T
execute(InteractionSpec spec, RecordCreator inputCreator, RecordExtractor<T> outputExtractor)
Execute the specified interaction on an EIS with CCI.
 void execute(InteractionSpec spec, Record inputRecord, Record outputRecord)
Execute the specified interaction on an EIS with CCI.
<T> T
execute(InteractionSpec spec, Record inputRecord, RecordExtractor<T> outputExtractor)
Execute the specified interaction on an EIS with CCI.

Method Detail

execute

<T> T execute(ConnectionCallback<T> action)
          throws DataAccessException
Execute a request on an EIS with CCI, implemented as callback action working on a CCI Connection. This allows for implementing arbitrary data access operations, within Spring's managed CCI environment: that is, participating in Spring-managed transactions and converting JCA ResourceExceptions into Spring's DataAccessException hierarchy.

The callback action can return a result object, for example a domain object or a collection of domain objects.

Parameters:
action - the callback object that specifies the action
Returns:
the result object returned by the action, if any
Throws:
DataAccessException - if there is any problem

execute

<T> T execute(InteractionCallback<T> action)
          throws DataAccessException
Execute a request on an EIS with CCI, implemented as callback action working on a CCI Interaction. This allows for implementing arbitrary data access operations on a single Interaction, within Spring's managed CCI environment: that is, participating in Spring-managed transactions and converting JCA ResourceExceptions into Spring's DataAccessException hierarchy.

The callback action can return a result object, for example a domain object or a collection of domain objects.

Parameters:
action - the callback object that specifies the action
Returns:
the result object returned by the action, if any
Throws:
DataAccessException - if there is any problem

execute

Record execute(InteractionSpec spec,
               Record inputRecord)
               throws DataAccessException
Execute the specified interaction on an EIS with CCI.

Parameters:
spec - the CCI InteractionSpec instance that defines the interaction (connector-specific)
inputRecord - the input record
Returns:
the output record
Throws:
DataAccessException - if there is any problem

execute

void execute(InteractionSpec spec,
             Record inputRecord,
             Record outputRecord)
             throws DataAccessException
Execute the specified interaction on an EIS with CCI.

Parameters:
spec - the CCI InteractionSpec instance that defines the interaction (connector-specific)
inputRecord - the input record
outputRecord - the output record
Throws:
DataAccessException - if there is any problem

execute

Record execute(InteractionSpec spec,
               RecordCreator inputCreator)
               throws DataAccessException
Execute the specified interaction on an EIS with CCI.

Parameters:
spec - the CCI InteractionSpec instance that defines the interaction (connector-specific)
inputCreator - object that creates the input record to use
Returns:
the output record
Throws:
DataAccessException - if there is any problem

execute

<T> T execute(InteractionSpec spec,
              Record inputRecord,
              RecordExtractor<T> outputExtractor)
          throws DataAccessException
Execute the specified interaction on an EIS with CCI.

Parameters:
spec - the CCI InteractionSpec instance that defines the interaction (connector-specific)
inputRecord - the input record
outputExtractor - object to convert the output record to a result object
Returns:
the output data extracted with the RecordExtractor object
Throws:
DataAccessException - if there is any problem

execute

<T> T execute(InteractionSpec spec,
              RecordCreator inputCreator,
              RecordExtractor<T> outputExtractor)
          throws DataAccessException
Execute the specified interaction on an EIS with CCI.

Parameters:
spec - the CCI InteractionSpec instance that defines the interaction (connector-specific)
inputCreator - object that creates the input record to use
outputExtractor - object to convert the output record to a result object
Returns:
the output data extracted with the RecordExtractor object
Throws:
DataAccessException - if there is any problem
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ConnectionCallback

org.springframework.jca.cci.core
Interface ConnectionCallback<T>

public interface ConnectionCallback<T>

Generic callback interface for code that operates on a CCI Connection. Allows to execute any number of operations on a single Connection, using any type and number of Interaction.

This is particularly useful for delegating to existing data access code that expects a Connection to work on and throws ResourceException. For newly written code, it is strongly recommended to use CciTemplate's more specific execute variants.

Since:
1.2
Author:
Thierry Templier, Juergen Hoeller
See Also:
CciTemplate.execute(ConnectionCallback),
CciTemplate.execute(javax.resource.cci.InteractionSpec, javax.resource.cci.Record),
CciTemplate.execute(javax.resource.cci.InteractionSpec, RecordCreator, RecordExtractor)

Method Summary
 T doInConnection(Connection connection, ConnectionFactory connectionFactory)
Gets called by CciTemplate.execute with an active CCI Connection.

Method Detail

doInConnection

T doInConnection(Connection connection,
                 ConnectionFactory connectionFactory)
                 throws ResourceException,
                        SQLException,
                        DataAccessException
Gets called by CciTemplate.execute with an active CCI Connection. Does not need to care about activating or closing the Connection, or handling transactions.

If called without a thread-bound CCI transaction (initiated by CciLocalTransactionManager), the code will simply get executed on the CCI Connection with its transactional semantics. If CciTemplate is configured to use a JTA-aware ConnectionFactory, the CCI Connection and thus the callback code will be transactional if a JTA transaction is active.

Allows for returning a result object created within the callback, i.e. a domain object or a collection of domain objects. Note that there's special support for single step actions: see the CciTemplate.execute variants. A thrown RuntimeException is treated as application exception: it gets propagated to the caller of the template.

Parameters:
connection - active CCI Connection
connectionFactory - the CCI ConnectionFactory that the Connection was created with (gives access to RecordFactory and ResourceAdapterMetaData)
Returns:
a result object, or null if none
Throws:
ResourceException - if thrown by a CCI method, to be auto-converted to a DataAccessException
SQLException - if thrown by a ResultSet method, to be auto-converted to a DataAccessException
DataAccessException - in case of custom exceptions
See Also:
ConnectionFactory.getRecordFactory(),
ConnectionFactory.getMetaData(),
CciTemplate.execute(javax.resource.cci.InteractionSpec, RecordCreator, RecordExtractor)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InteractionCallback

org.springframework.jca.cci.core
Interface InteractionCallback<T>

public interface InteractionCallback<T>

Generic callback interface for code that operates on a CCI Interaction. Allows to execute any number of operations on a single Interaction, for example a single execute call or repeated execute calls with varying parameters.

This is particularly useful for delegating to existing data access code that expects an Interaction to work on and throws ResourceException. For newly written code, it is strongly recommended to use CciTemplate's more specific execute variants.

Since:
1.2
Author:
Thierry Templier, Juergen Hoeller
See Also:
CciTemplate.execute(InteractionCallback),
CciTemplate.execute(javax.resource.cci.InteractionSpec, javax.resource.cci.Record),
CciTemplate.execute(javax.resource.cci.InteractionSpec, RecordCreator, RecordExtractor)

Method Summary
 T doInInteraction(Interaction interaction, ConnectionFactory connectionFactory)
Gets called by CciTemplate.execute with an active CCI Interaction.

Method Detail

doInInteraction

T doInInteraction(Interaction interaction,
                  ConnectionFactory connectionFactory)
                  throws ResourceException,
                         SQLException,
                         DataAccessException
Gets called by CciTemplate.execute with an active CCI Interaction. Does not need to care about activating or closing the Interaction, or handling transactions.

If called without a thread-bound CCI transaction (initiated by CciLocalTransactionManager), the code will simply get executed on the CCI Interaction with its transactional semantics. If CciTemplate is configured to use a JTA-aware ConnectionFactory, the CCI Interaction and thus the callback code will be transactional if a JTA transaction is active.

Allows for returning a result object created within the callback, i.e. a domain object or a collection of domain objects. Note that there's special support for single step actions: see the CciTemplate.execute variants. A thrown RuntimeException is treated as application exception: it gets propagated to the caller of the template.

Parameters:
interaction - active CCI Interaction
connectionFactory - the CCI ConnectionFactory that the Connection was created with (gives access to RecordFactory and ResourceAdapterMetaData)
Returns:
a result object, or null if none
Throws:
ResourceException - if thrown by a CCI method, to be auto-converted to a DataAccessException
SQLException - if thrown by a ResultSet method, to be auto-converted to a DataAccessException
DataAccessException - in case of custom exceptions
See Also:
ConnectionFactory.getRecordFactory(),
ConnectionFactory.getMetaData(),
CciTemplate.execute(javax.resource.cci.InteractionSpec, RecordCreator, RecordExtractor)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RecordCreator

org.springframework.jca.cci.core
Interface RecordCreator

All Known Implementing Classes:
MappingRecordOperation.RecordCreatorImpl
public interface RecordCreator

Callback interface for creating a CCI Record instance, usually based on the passed-in CCI RecordFactory.

Used for input Record creation in CciTemplate. Alternatively, Record instances can be passed into CciTemplate's corresponding execute methods directly, either instantiated manually or created through CciTemplate's Record factory methods.

Also used for creating default output Records in CciTemplate. This is useful when the JCA connector needs an explicit output Record instance, but no output Records should be passed into CciTemplate's execute methods.

Since:
1.2
Author:
Thierry Templier, Juergen Hoeller
See Also:
CciTemplate.execute(javax.resource.cci.InteractionSpec, RecordCreator),
CciTemplate.execute(javax.resource.cci.InteractionSpec, RecordCreator, RecordExtractor),
CciTemplate.createIndexedRecord(String),
CciTemplate.createMappedRecord(String),
CciTemplate.setOutputRecordCreator(RecordCreator)

Method Summary
 Record createRecord(RecordFactory recordFactory)
Create a CCI Record instance, usually based on the passed-in CCI RecordFactory.

Method Detail

createRecord

Record createRecord(RecordFactory recordFactory)
                    throws ResourceException,
                           DataAccessException
Create a CCI Record instance, usually based on the passed-in CCI RecordFactory.

For use as input creator with CciTemplate's execute methods, this method should create a populated Record instance. For use as output Record creator, it should return an empty Record instance.

Parameters:
recordFactory - the CCI RecordFactory (never null, but not guaranteed to be supported by the connector: its create methods might throw NotSupportedException)
Returns:
the Record instance
Throws:
ResourceException - if thrown by a CCI method, to be auto-converted to a DataAccessException
DataAccessException - in case of custom exceptions
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RecordExtractor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jca.cci.core
Interface RecordExtractor<T>

All Known Implementing Classes:
MappingRecordOperation.RecordExtractorImpl
public interface RecordExtractor<T>

Callback interface for extracting a result object from a CCI Record instance.

Used for output object creation in CciTemplate. Alternatively, output Records can also be returned to client code as-is. In case of a CCI ResultSet as execution result, you will almost always want to implement a RecordExtractor, to be able to read the ResultSet in a managed fashion, with the CCI Connection still open while reading the ResultSet.

Implementations of this interface perform the actual work of extracting results, but don't need to worry about exception handling. ResourceExceptions will be caught and handled correctly by the CciTemplate class.

Since:
1.2
Author:
Thierry Templier, Juergen Hoeller
See Also:
CciTemplate.execute(javax.resource.cci.InteractionSpec, Record, RecordExtractor), CciTemplate.execute(javax.resource.cci.InteractionSpec, RecordCreator, RecordExtractor), ResultSet

Method Summary
 T extractData(Record record)
Process the data in the given Record, creating a corresponding result object.

Method Detail

extractData

T extractData(Record record)
              throws ResourceException,
                     SQLException,
                     DataAccessException
Process the data in the given Record, creating a corresponding result object.

Parameters:
record - the Record to extract data from (possibly a CCI ResultSet)
Returns:
an arbitrary result object, or null if none (the extractor will typically be stateful in the latter case)
Throws:
ResourceException - if thrown by a CCI method, to be auto-converted to a DataAccessException
SQLException - if thrown by a ResultSet method, to be auto-converted to a DataAccessException
DataAccessException - in case of custom exceptions
See Also:
ResultSet
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


CciTemplate

org.springframework.jca.cci.core
Class CciTemplate

java.lang.Object
    extended by  org.springframework.jca.cci.core.CciTemplate
All Implemented Interfaces:
CciOperations
public class CciTemplate
extends Object
implements CciOperations

This is the central class in the CCI core package. It simplifies the use of CCI and helps to avoid common errors. It executes core CCI workflow, leaving application code to provide parameters to CCI and extract results. This class executes EIS queries or updates, catching ResourceExceptions and translating them to the generic exception hierarchy defined in the org.springframework.dao package.

Code using this class can pass in and receive Record instances, or alternatively implement callback interfaces for creating input Records and extracting result objects from output Records (or CCI ResultSets).

Can be used within a service implementation via direct instantiation with a ConnectionFactory reference, or get prepared in an application context and given to services as bean reference. Note: The ConnectionFactory should always be configured as a bean in the application context, in the first case given to the service directly, in the second case to the prepared template.

Since:
1.2
Author:
Thierry Templier, Juergen Hoeller
See Also:
RecordCreator, RecordExtractor

Constructor Summary
CciTemplate()
Construct a new CciTemplate for bean usage.
CciTemplate(ConnectionFactory connectionFactory)
Construct a new CciTemplate, given a ConnectionFactory to obtain Connections from.
CciTemplate(ConnectionFactory connectionFactory, ConnectionSpec connectionSpec)
Construct a new CciTemplate, given a ConnectionFactory to obtain Connections from.
Method Summary
 void afterPropertiesSet()
 IndexedRecord createIndexedRecord(String name)
Create an indexed Record through the ConnectionFactory's RecordFactory.
 MappedRecord createMappedRecord(String name)
Create a mapped Record from the ConnectionFactory's RecordFactory.
protected  Record createRecord(RecordCreator recordCreator)
Invoke the given RecordCreator, converting JCA ResourceExceptions to Spring's DataAccessException hierarchy.
protected
<T> T
doExecute(InteractionSpec spec, Record inputRecord, Record outputRecord, RecordExtractor<T> outputExtractor)
Execute the specified interaction on an EIS with CCI.
<T> T
execute(ConnectionCallback<T> action)
Execute a request on an EIS with CCI, implemented as callback action working on a CCI Connection.
<T> T
execute(InteractionCallback<T> action)
Execute a request on an EIS with CCI, implemented as callback action working on a CCI Interaction.
 Record execute(InteractionSpec spec, Record inputRecord)
Execute the specified interaction on an EIS with CCI.
 Record execute(InteractionSpec spec, RecordCreator inputCreator)
Execute the specified interaction on an EIS with CCI.
<T> T
execute(InteractionSpec spec, RecordCreator inputCreator, RecordExtractor<T> outputExtractor)
Execute the specified interaction on an EIS with CCI.
 void execute(InteractionSpec spec, Record inputRecord, Record outputRecord)
Execute the specified interaction on an EIS with CCI.
<T> T
execute(InteractionSpec spec, Record inputRecord, RecordExtractor<T> outputExtractor)
Execute the specified interaction on an EIS with CCI.
 ConnectionFactory getConnectionFactory()
Return the CCI ConnectionFactory used by this template.
 ConnectionSpec getConnectionSpec()
Return the CCI ConnectionSpec used by this template, if any.
 CciTemplate getDerivedTemplate(ConnectionSpec connectionSpec)
Create a template derived from this template instance, inheriting the ConnectionFactory and other settings but overriding the ConnectionSpec used for obtaining Connections.
 RecordCreator getOutputRecordCreator()
Return a RecordCreator that should be used for creating default output Records.
protected  RecordFactory getRecordFactory(ConnectionFactory connectionFactory)
Return a RecordFactory for the given ConnectionFactory.
 void setConnectionFactory(ConnectionFactory connectionFactory)
Set the CCI ConnectionFactory to obtain Connections from.
 void setConnectionSpec(ConnectionSpec connectionSpec)
Set the CCI ConnectionSpec that this template instance is supposed to obtain Connections for.
 void setOutputRecordCreator(RecordCreator creator)
Set a RecordCreator that should be used for creating default output Records.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CciTemplate

public CciTemplate()
Construct a new CciTemplate for bean usage.

Note: The ConnectionFactory has to be set before using the instance.

See Also:
setConnectionFactory(javax.resource.cci.ConnectionFactory)

CciTemplate

public CciTemplate(ConnectionFactory connectionFactory)
Construct a new CciTemplate, given a ConnectionFactory to obtain Connections from. Note: This will trigger eager initialization of the exception translator.

Parameters:
connectionFactory - JCA ConnectionFactory to obtain Connections from

CciTemplate

public CciTemplate(ConnectionFactory connectionFactory,
                   ConnectionSpec connectionSpec)
Construct a new CciTemplate, given a ConnectionFactory to obtain Connections from. Note: This will trigger eager initialization of the exception translator.

Parameters:
connectionFactory - JCA ConnectionFactory to obtain Connections from
connectionSpec - the CCI ConnectionSpec to obtain Connections for (may be null)
Method Detail

setConnectionFactory

public void setConnectionFactory(ConnectionFactory connectionFactory)
Set the CCI ConnectionFactory to obtain Connections from.

getConnectionFactory

public ConnectionFactory getConnectionFactory()
Return the CCI ConnectionFactory used by this template.

setConnectionSpec

public void setConnectionSpec(ConnectionSpec connectionSpec)
Set the CCI ConnectionSpec that this template instance is supposed to obtain Connections for.

getConnectionSpec

public ConnectionSpec getConnectionSpec()
Return the CCI ConnectionSpec used by this template, if any.

setOutputRecordCreator

public void setOutputRecordCreator(RecordCreator creator)
Set a RecordCreator that should be used for creating default output Records.

Default is none: When no explicit output Record gets passed into an execute method, CCI's Interaction.execute variant that returns an output Record will be called.

Specify a RecordCreator here if you always need to call CCI's Interaction.execute variant with a passed-in output Record. Unless there is an explicitly specified output Record, CciTemplate will then invoke this RecordCreator to create a default output Record instance.

See Also:
Interaction.execute(javax.resource.cci.InteractionSpec, Record), Interaction.execute(javax.resource.cci.InteractionSpec, Record, Record)

getOutputRecordCreator

public RecordCreator getOutputRecordCreator()
Return a RecordCreator that should be used for creating default output Records.

afterPropertiesSet

public void afterPropertiesSet()

getDerivedTemplate

public CciTemplate getDerivedTemplate(ConnectionSpec connectionSpec)
Create a template derived from this template instance, inheriting the ConnectionFactory and other settings but overriding the ConnectionSpec used for obtaining Connections.

Parameters:
connectionSpec - the CCI ConnectionSpec that the derived template instance is supposed to obtain Connections for
Returns:
the derived template instance
See Also:
setConnectionSpec(javax.resource.cci.ConnectionSpec)

execute

public <T> T execute(ConnectionCallback<T> action)
          throws DataAccessException
Description copied from interface: CciOperations
Execute a request on an EIS with CCI, implemented as callback action working on a CCI Connection. This allows for implementing arbitrary data access operations, within Spring's managed CCI environment: that is, participating in Spring-managed transactions and converting JCA ResourceExceptions into Spring's DataAccessException hierarchy.

The callback action can return a result object, for example a domain object or a collection of domain objects.

Specified by:
execute in interface CciOperations
Parameters:
action - the callback object that specifies the action
Returns:
the result object returned by the action, if any
Throws:
DataAccessException - if there is any problem

execute

public <T> T execute(InteractionCallback<T> action)
          throws DataAccessException
Description copied from interface: CciOperations
Execute a request on an EIS with CCI, implemented as callback action working on a CCI Interaction. This allows for implementing arbitrary data access operations on a single Interaction, within Spring's managed CCI environment: that is, participating in Spring-managed transactions and converting JCA ResourceExceptions into Spring's DataAccessException hierarchy.

The callback action can return a result object, for example a domain object or a collection of domain objects.

Specified by:
execute in interface CciOperations
Parameters:
action - the callback object that specifies the action
Returns:
the result object returned by the action, if any
Throws:
DataAccessException - if there is any problem

execute

public Record execute(InteractionSpec spec,
                      Record inputRecord)
               throws DataAccessException
Description copied from interface: CciOperations
Execute the specified interaction on an EIS with CCI.

Specified by:
execute in interface CciOperations
Parameters:
spec - the CCI InteractionSpec instance that defines the interaction (connector-specific)
inputRecord - the input record
Returns:
the output record
Throws:
DataAccessException - if there is any problem

execute

public void execute(InteractionSpec spec,
                    Record inputRecord,
                    Record outputRecord)
             throws DataAccessException
Description copied from interface: CciOperations
Execute the specified interaction on an EIS with CCI.

Specified by:
execute in interface CciOperations
Parameters:
spec - the CCI InteractionSpec instance that defines the interaction (connector-specific)
inputRecord - the input record
outputRecord - the output record
Throws:
DataAccessException - if there is any problem

execute

public Record execute(InteractionSpec spec,
                      RecordCreator inputCreator)
               throws DataAccessException
Description copied from interface: CciOperations
Execute the specified interaction on an EIS with CCI.

Specified by:
execute in interface CciOperations
Parameters:
spec - the CCI InteractionSpec instance that defines the interaction (connector-specific)
inputCreator - object that creates the input record to use
Returns:
the output record
Throws:
DataAccessException - if there is any problem

execute

public <T> T execute(InteractionSpec spec,
                     Record inputRecord,
                     RecordExtractor<T> outputExtractor)
          throws DataAccessException
Description copied from interface: CciOperations
Execute the specified interaction on an EIS with CCI.

Specified by:
execute in interface CciOperations
Parameters:
spec - the CCI InteractionSpec instance that defines the interaction (connector-specific)
inputRecord - the input record
outputExtractor - object to convert the output record to a result object
Returns:
the output data extracted with the RecordExtractor object
Throws:
DataAccessException - if there is any problem

execute

public <T> T execute(InteractionSpec spec,
                     RecordCreator inputCreator,
                     RecordExtractor<T> outputExtractor)
          throws DataAccessException
Description copied from interface: CciOperations
Execute the specified interaction on an EIS with CCI.

Specified by:
execute in interface CciOperations
Parameters:
spec - the CCI InteractionSpec instance that defines the interaction (connector-specific)
inputCreator - object that creates the input record to use
outputExtractor - object to convert the output record to a result object
Returns:
the output data extracted with the RecordExtractor object
Throws:
DataAccessException - if there is any problem

doExecute

protected <T> T doExecute(InteractionSpec spec,
                          Record inputRecord,
                          Record outputRecord,
                          RecordExtractor<T> outputExtractor)
               throws DataAccessException
Execute the specified interaction on an EIS with CCI. All other interaction execution methods go through this.

Parameters:
spec - the CCI InteractionSpec instance that defines the interaction (connector-specific)
inputRecord - the input record
outputRecord - output record (can be null)
outputExtractor - object to convert the output record to a result object
Returns:
the output data extracted with the RecordExtractor object
Throws:
DataAccessException - if there is any problem

createIndexedRecord

public IndexedRecord createIndexedRecord(String name)
                                  throws DataAccessException
Create an indexed Record through the ConnectionFactory's RecordFactory.

Parameters:
name - the name of the record
Returns:
the Record
Throws:
DataAccessException - if creation of the Record failed
See Also:
getRecordFactory(javax.resource.cci.ConnectionFactory), RecordFactory.createIndexedRecord(String)

createMappedRecord

public MappedRecord createMappedRecord(String name)
                                throws DataAccessException
Create a mapped Record from the ConnectionFactory's RecordFactory.

Parameters:
name - record name
Returns:
the Record
Throws:
DataAccessException - if creation of the Record failed
See Also:
getRecordFactory(javax.resource.cci.ConnectionFactory), RecordFactory.createMappedRecord(String)

createRecord

protected Record createRecord(RecordCreator recordCreator)
                       throws DataAccessException
Invoke the given RecordCreator, converting JCA ResourceExceptions to Spring's DataAccessException hierarchy.

Parameters:
recordCreator - the RecordCreator to invoke
Returns:
the created Record
Throws:
DataAccessException - if creation of the Record failed
See Also:
getRecordFactory(javax.resource.cci.ConnectionFactory), RecordCreator.createRecord(javax.resource.cci.RecordFactory)

getRecordFactory

protected RecordFactory getRecordFactory(ConnectionFactory connectionFactory)
                                  throws ResourceException
Return a RecordFactory for the given ConnectionFactory.

Default implementation returns the connector's RecordFactory if available, falling back to a NotSupportedRecordFactory placeholder. This allows to invoke a RecordCreator callback with a non-null RecordFactory reference in any case.

Parameters:
connectionFactory - the CCI ConnectionFactory
Returns:
the CCI RecordFactory for the ConnectionFactory
Throws:
ResourceException - if thrown by CCI methods
See Also:
NotSupportedRecordFactory
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.jca.cci.core.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jca.cci.core.support

Classes supporting the org.springframework.jca.cci.core package.

See:
Description

Class Summary
CciDaoSupport | Convenient super class for CCI-based data access objects.
CommAreaRecord | CCI Record implementation for a COMMAREA, holding a byte array.

Package org.springframework.jca.cci.core.support Description

Classes supporting the org.springframework.jca.cci.core package. Contains a DAO base class for CciTemplate usage.


org.springframework.jca.cci.core.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jca.cci.core.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jca.cci.core.support.CommAreaRecord (implements javax.resource.cci.Record, javax.resource.cci.Streamable)
    • org.springframework.dao.support.DaoSupport (implements org.springframework.beans.factory.InitializingBean)
      • org.springframework.jca.cci.core.support.CciDaoSupport


CciDaoSupport

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jca.cci.core.support
Class CciDaoSupport

java.lang.Object
    extended by  org.springframework.dao.support.DaoSupport
        extended by  org.springframework.jca.cci.core.support.CciDaoSupport
All Implemented Interfaces:
InitializingBean
public abstract class CciDaoSupport
extends DaoSupport

Convenient super class for CCI-based data access objects.

Requires a ConnectionFactory to be set, providing a CciTemplate based on it to subclasses through the getCciTemplate() method.

This base class is mainly intended for CciTemplate usage but can also be used when working with a Connection directly or when using org.springframework.jca.cci.object classes.

Since:
1.2
Author:
Thierry Templier, Juergen Hoeller
See Also:
setConnectionFactory(javax.resource.cci.ConnectionFactory), getCciTemplate(), CciTemplate

Field Summary
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
Constructor Summary
CciDaoSupport()
Method Summary
protected void | checkDaoConfig() Abstract subclasses must override this to check their configuration.
protected CciTemplate | createCciTemplate(ConnectionFactory connectionFactory) Create a CciTemplate for the given ConnectionFactory.
CciTemplate | getCciTemplate() Return the CciTemplate for this DAO, pre-initialized with the ConnectionFactory or set explicitly.
protected CciTemplate | getCciTemplate(ConnectionSpec connectionSpec) Obtain a CciTemplate derived from the main template instance, inheriting the ConnectionFactory and other settings but overriding the ConnectionSpec used for obtaining Connections.
protected Connection | getConnection() Get a CCI Connection, either from the current transaction or a new one.
ConnectionFactory | getConnectionFactory() Return the ConnectionFactory used by this DAO.
protected void | releaseConnection(Connection con) Close the given CCI Connection, created via this bean's ConnectionFactory, if it isn't bound to the thread.
void | setCciTemplate(CciTemplate cciTemplate) Set the CciTemplate for this DAO explicitly, as an alternative to specifying a ConnectionFactory.
void | setConnectionFactory(ConnectionFactory connectionFactory) Set the ConnectionFactory to be used by this DAO.
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CciDaoSupport

public CciDaoSupport()
Method Detail

setConnectionFactory

public final void setConnectionFactory(ConnectionFactory connectionFactory)
Set the ConnectionFactory to be used by this DAO.

createCciTemplate

protected CciTemplate createCciTemplate(ConnectionFactory connectionFactory)
Create a CciTemplate for the given ConnectionFactory. Only invoked if populating the DAO with a ConnectionFactory reference!

Can be overridden in subclasses to provide a CciTemplate instance with different configuration, or a custom CciTemplate subclass.

Parameters:
connectionFactory - the CCI ConnectionFactory to create a CciTemplate for
Returns:
the new CciTemplate instance
See Also:
setConnectionFactory(javax.resource.cci.ConnectionFactory)

getConnectionFactory

public final ConnectionFactory getConnectionFactory()
Return the ConnectionFactory used by this DAO.

setCciTemplate

public final void setCciTemplate(CciTemplate cciTemplate)
Set the CciTemplate for this DAO explicitly, as an alternative to specifying a ConnectionFactory.

getCciTemplate

public final CciTemplate getCciTemplate()
Return the CciTemplate for this DAO, pre-initialized with the ConnectionFactory or set explicitly.

checkDaoConfig

protected final void checkDaoConfig()
Description copied from class: DaoSupport
Abstract subclasses must override this to check their configuration.

Implementors should be marked as final

Specified by:
checkDaoConfig in class DaoSupport

getCciTemplate

protected final CciTemplate getCciTemplate(ConnectionSpec connectionSpec)
Obtain a CciTemplate derived from the main template instance, inheriting the ConnectionFactory and other settings but overriding the ConnectionSpec used for obtaining Connections.

Parameters:
connectionSpec - the CCI ConnectionSpec that the returned template instance is supposed to obtain Connections for
Returns:
the derived template instance
See Also:
CciTemplate.getDerivedTemplate(javax.resource.cci.ConnectionSpec)

getConnection

protected final Connection getConnection()
                                  throws CannotGetCciConnectionException
Get a CCI Connection, either from the current transaction or a new one.

Returns:
the CCI Connection
Throws:
CannotGetCciConnectionException - if the attempt to get a Connection failed
See Also:
ConnectionFactoryUtils.getConnection(javax.resource.cci.ConnectionFactory)

releaseConnection

protected final void releaseConnection(Connection con)
Close the given CCI Connection, created via this bean's ConnectionFactory, if it isn't bound to the thread.

Parameters:
con - Connection to close
See Also:
ConnectionFactoryUtils.releaseConnection(javax.resource.cci.Connection, javax.resource.cci.ConnectionFactory)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


CommAreaRecord

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jca.cci.core.support
Class CommAreaRecord

java.lang.Object
    extended by  org.springframework.jca.cci.core.support.CommAreaRecord
All Implemented Interfaces:
Serializable, Cloneable, Record, Streamable
public class CommAreaRecord
extends Object
implements Record, Streamable

CCI Record implementation for a COMMAREA, holding a byte array.

Since:
1.2
Author:
Thierry Templier, Juergen Hoeller
See Also:
MappingCommAreaOperation, Serialized Form

Constructor Summary
CommAreaRecord()
Create a new CommAreaRecord.
CommAreaRecord(byte[] bytes)
Create a new CommAreaRecord.
Method Summary
Object | clone()
String | getRecordName()
String | getRecordShortDescription()
void | read(InputStream in)
void | setRecordName(String recordName)
void | setRecordShortDescription(String recordShortDescription)
byte[] | toByteArray()
void | write(OutputStream out)
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.resource.cci.Record
equals, hashCode

Constructor Detail

CommAreaRecord

public CommAreaRecord()
Create a new CommAreaRecord.

See Also:
read(java.io.InputStream)

CommAreaRecord

public CommAreaRecord(byte[] bytes)
Create a new CommAreaRecord.

Parameters:
bytes - the bytes to fill the record with
Method Detail

setRecordName

public void setRecordName(String recordName)
Specified by:
setRecordName in interface Record

getRecordName

public String getRecordName()
Specified by:
getRecordName in interface Record

setRecordShortDescription

public void setRecordShortDescription(String recordShortDescription)
Specified by:
setRecordShortDescription in interface Record

getRecordShortDescription

public String getRecordShortDescription()
Specified by:
getRecordShortDescription in interface Record

read

public void read(InputStream in)
          throws IOException
Specified by:
read in interface Streamable
Throws:
IOException

write

public void write(OutputStream out)
           throws IOException
Specified by:
write in interface Streamable
Throws:
IOException

toByteArray

public byte[] toByteArray()

clone

public Object clone()
Specified by:
clone in interface Record
Overrides:
clone in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jca.cci.object

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jca.cci.object

The classes in this package represent EIS operations as threadsafe, reusable objects.

See:
Description

Class Summary
EisOperation | Base class for EIS operation objects that work with the CCI API.
MappingCommAreaOperation | EIS operation object for access to COMMAREA records.
MappingRecordOperation | EIS operation object that expects mapped input and output objects, converting to and from CCI Records.
SimpleRecordOperation | EIS operation object that accepts a passed-in CCI input Record and returns a corresponding CCI output Record.

Package org.springframework.jca.cci.object Description

The classes in this package represent EIS operations as threadsafe, reusable objects. This higher level of CCI abstraction depends on the lower-level abstraction in the org.springframework.jca.cci.core package. Exceptions thrown are as in the org.springframework.dao package, meaning that code using this package does not need to worry about error handling.


org.springframework.jca.cci.object Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jca.cci.object

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jca.cci.object.EisOperation (implements org.springframework.beans.factory.InitializingBean)
      • org.springframework.jca.cci.object.MappingRecordOperation
        • org.springframework.jca.cci.object.MappingCommAreaOperation
      • org.springframework.jca.cci.object.SimpleRecordOperation
    • org.springframework.jca.cci.object.MappingRecordOperation.RecordCreatorImpl (implements org.springframework.jca.cci.core.RecordCreator)
    • org.springframework.jca.cci.object.MappingRecordOperation.RecordExtractorImpl (implements org.springframework.jca.cci.core.RecordExtractor<T>)


EisOperation

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jca.cci.object
Class EisOperation

java.lang.Object
    extended by  org.springframework.jca.cci.object.EisOperation
All Implemented Interfaces:
InitializingBean
Direct Known Subclasses:
MappingRecordOperation, SimpleRecordOperation
public abstract class EisOperation
extends Object
implements InitializingBean

Base class for EIS operation objects that work with the CCI API. Encapsulates a CCI ConnectionFactory and a CCI InteractionSpec.

Works with a CciTemplate instance underneath. EIS operation objects are an alternative to working with a CciTemplate directly.

Since:
1.2
Author:
Juergen Hoeller
See Also:
setConnectionFactory(javax.resource.cci.ConnectionFactory), setInteractionSpec(javax.resource.cci.InteractionSpec)

Constructor Summary
EisOperation()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
CciTemplate | getCciTemplate() Return the CciTemplate used by this operation.
InteractionSpec | getInteractionSpec() Return the CCI InteractionSpec for this operation.
void | setCciTemplate(CciTemplate cciTemplate) Set the CciTemplate to be used by this operation.
void | setConnectionFactory(ConnectionFactory connectionFactory) Set the CCI ConnectionFactory to be used by this operation.
void | setInteractionSpec(InteractionSpec interactionSpec) Set the CCI InteractionSpec for this operation.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

EisOperation

public EisOperation()
Method Detail

setCciTemplate

public void setCciTemplate(CciTemplate cciTemplate)
Set the CciTemplate to be used by this operation. Alternatively, specify a CCI ConnectionFactory.

See Also:
setConnectionFactory(javax.resource.cci.ConnectionFactory)

getCciTemplate

public CciTemplate getCciTemplate()
Return the CciTemplate used by this operation.

setConnectionFactory

public void setConnectionFactory(ConnectionFactory connectionFactory)
Set the CCI ConnectionFactory to be used by this operation.

setInteractionSpec

public void setInteractionSpec(InteractionSpec interactionSpec)
Set the CCI InteractionSpec for this operation.

getInteractionSpec

public InteractionSpec getInteractionSpec()
Return the CCI InteractionSpec for this operation.

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


MappingCommAreaOperation

org.springframework.jca.cci.object
Class MappingCommAreaOperation

java.lang.Object
    extended by  org.springframework.jca.cci.object.EisOperation
        extended by  org.springframework.jca.cci.object.MappingRecordOperation
            extended by  org.springframework.jca.cci.object.MappingCommAreaOperation
All Implemented Interfaces:
InitializingBean
public abstract class MappingCommAreaOperation
extends MappingRecordOperation

EIS operation object for access to COMMAREA records. Subclass of the generic MappingRecordOperation class.

Since:
1.2
Author:
Thierry Templier

Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.jca.cci.object.MappingRecordOperation
MappingRecordOperation.RecordCreatorImpl, MappingRecordOperation.RecordExtractorImpl
Constructor Summary
MappingCommAreaOperation()
Create a new MappingCommAreaQuery.
MappingCommAreaOperation(ConnectionFactory connectionFactory, InteractionSpec interactionSpec)
Create a new MappingCommAreaQuery.
Method Summary
protected abstract Object | bytesToObject(byte[] bytes) Method used to convert the COMMAREA's bytes to an object.
protected Record | createInputRecord(RecordFactory recordFactory, Object inObject) Subclasses must implement this method to generate an input Record from an input object passed into the execute method.
protected Object | extractOutputData(Record record) Subclasses must implement this method to convert the Record returned by CCI execution into a result object for the execute method.
protected abstract byte[] | objectToBytes(Object inObject) Method used to convert an object into COMMAREA bytes.
Methods inherited from class org.springframework.jca.cci.object.MappingRecordOperation
execute, setOutputRecordCreator
Methods inherited from class org.springframework.jca.cci.object.EisOperation
afterPropertiesSet, getCciTemplate, getInteractionSpec, setCciTemplate, setConnectionFactory, setInteractionSpec
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MappingCommAreaOperation

public MappingCommAreaOperation()
Create a new MappingCommAreaQuery.

See Also:
EisOperation.setConnectionFactory(javax.resource.cci.ConnectionFactory), EisOperation.setInteractionSpec(javax.resource.cci.InteractionSpec)

MappingCommAreaOperation

public MappingCommAreaOperation(ConnectionFactory connectionFactory,
                                InteractionSpec interactionSpec)
Create a new MappingCommAreaQuery.

Parameters:
connectionFactory - ConnectionFactory to use to obtain connections
interactionSpec - specification to configure the interaction
Method Detail

createInputRecord

protected final Record createInputRecord(RecordFactory recordFactory,
                                         Object inObject)
Description copied from class: MappingRecordOperation
Subclasses must implement this method to generate an input Record from an input object passed into the execute method.

Specified by:
createInputRecord in class MappingRecordOperation
inObject - the passed-in input object
Returns:
the CCI input Record
See Also:
MappingRecordOperation.execute(Object)

extractOutputData

protected final Object extractOutputData(Record record)
                                  throws DataAccessException
Description copied from class: MappingRecordOperation
Subclasses must implement this method to convert the Record returned by CCI execution into a result object for the execute method.

Specified by:
extractOutputData in class MappingRecordOperation
Parameters:
record - the Record returned by CCI execution
Returns:
the result object
Throws:
DataAccessException
See Also:
MappingRecordOperation.execute(Object)

objectToBytes

protected abstract byte[] objectToBytes(Object inObject)
                                 throws IOException,
                                        DataAccessException
Method used to convert an object into COMMAREA bytes.

Parameters:
inObject - the input data
Returns:
the COMMAREA's bytes
Throws:
IOException - if thrown by I/O methods
DataAccessException - if conversion failed

bytesToObject

protected abstract Object bytesToObject(byte[] bytes)
                                 throws IOException,
                                        DataAccessException
Method used to convert the COMMAREA's bytes to an object.

Parameters:
bytes - the COMMAREA's bytes
Returns:
the output data
Throws:
IOException - if thrown by I/O methods
DataAccessException - if conversion failed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MappingRecordOperation

org.springframework.jca.cci.object
Class MappingRecordOperation

java.lang.Object
    extended by  org.springframework.jca.cci.object.EisOperation
        extended by  org.springframework.jca.cci.object.MappingRecordOperation
All Implemented Interfaces:
InitializingBean
Direct Known Subclasses:
MappingCommAreaOperation
public abstract class MappingRecordOperation
extends EisOperation

EIS operation object that expects mapped input and output objects, converting to and from CCI Records.

Concrete subclasses must implement the abstract createInputRecord(RecordFactory, Object) and extractOutputData(Record) methods, to create an input Record from an object and to convert an output Record into an object, respectively.

Since:
1.2
Author:
Thierry Templier, Juergen Hoeller
See Also:
createInputRecord(javax.resource.cci.RecordFactory, Object), extractOutputData(javax.resource.cci.Record)

Nested Class Summary
protected class | MappingRecordOperation.RecordCreatorImpl Implementation of RecordCreator that calls the enclosing class's createInputRecord method.
protected class | MappingRecordOperation.RecordExtractorImpl Implementation of RecordExtractor that calls the enclosing class's extractOutputData method.
Constructor Summary
MappingRecordOperation()
Constructor that allows use as a JavaBean.
MappingRecordOperation(ConnectionFactory connectionFactory, InteractionSpec interactionSpec)
Convenient constructor with ConnectionFactory and specifications (connection and interaction).
Method Summary
protected abstract Record | createInputRecord(RecordFactory recordFactory, Object inputObject) Subclasses must implement this method to generate an input Record from an input object passed into the execute method.
Object | execute(Object inputObject) Execute the interaction encapsulated by this operation object.
protected abstract Object | extractOutputData(Record outputRecord) Subclasses must implement this method to convert the Record returned by CCI execution into a result object for the execute method.
void | setOutputRecordCreator(RecordCreator creator) Set a RecordCreator that should be used for creating default output Records.
Methods inherited from class org.springframework.jca.cci.object.EisOperation
afterPropertiesSet, getCciTemplate, getInteractionSpec, setCciTemplate, setConnectionFactory, setInteractionSpec
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MappingRecordOperation

public MappingRecordOperation()
Constructor that allows use as a JavaBean.

MappingRecordOperation

public MappingRecordOperation(ConnectionFactory connectionFactory,
                              InteractionSpec interactionSpec)
Convenient constructor with ConnectionFactory and specifications (connection and interaction).

Parameters:
connectionFactory - ConnectionFactory to use to obtain connections
Method Detail

setOutputRecordCreator

public void setOutputRecordCreator(RecordCreator creator)
Set a RecordCreator that should be used for creating default output Records.

Default is none: CCI's Interaction.execute variant that returns an output Record will be called.

Specify a RecordCreator here if you always need to call CCI's Interaction.execute variant with a passed-in output Record. This RecordCreator will then be invoked to create a default output Record instance.

See Also:
Interaction.execute(javax.resource.cci.InteractionSpec, Record),
Interaction.execute(javax.resource.cci.InteractionSpec, Record, Record),
CciTemplate.setOutputRecordCreator(org.springframework.jca.cci.core.RecordCreator)

execute

public Object execute(Object inputObject)
               throws DataAccessException
Execute the interaction encapsulated by this operation object.

Parameters:
inputObject - the input data, to be converted to a Record by the createInputRecord method
Returns:
the output data extracted with the extractOutputData method
Throws:
DataAccessException - if there is any problem
See Also:
createInputRecord(javax.resource.cci.RecordFactory, java.lang.Object), extractOutputData(javax.resource.cci.Record)

createInputRecord

protected abstract Record createInputRecord(RecordFactory recordFactory,
                                            Object inputObject)
                                     throws ResourceException,
                                            DataAccessException
Subclasses must implement this method to generate an input Record from an input object passed into the execute method.

Parameters:
inputObject - the passed-in input object
Returns:
the CCI input Record
Throws:
ResourceException - if thrown by a CCI method, to be auto-converted to a DataAccessException
DataAccessException
See Also:
execute(Object)

extractOutputData

protected abstract Object extractOutputData(Record outputRecord)
                                     throws ResourceException,
                                            SQLException,
                                            DataAccessException
Subclasses must implement this method to convert the Record returned by CCI execution into a result object for the execute method.

Parameters:
outputRecord - the Record returned by CCI execution
Returns:
the result object
Throws:
ResourceException - if thrown by a CCI method, to be auto-converted to a DataAccessException
SQLException
DataAccessException
See Also:
execute(Object)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MappingRecordOperation.RecordCreatorImpl

org.springframework.jca.cci.object
Class MappingRecordOperation.RecordCreatorImpl

java.lang.Object
    extended by  org.springframework.jca.cci.object.MappingRecordOperation.RecordCreatorImpl
All Implemented Interfaces:
RecordCreator
Enclosing class:
MappingRecordOperation
protected class MappingRecordOperation.RecordCreatorImpl
extends Object
implements RecordCreator

Implementation of RecordCreator that calls the enclosing class's createInputRecord method.

Constructor Summary
MappingRecordOperation.RecordCreatorImpl(Object inObject)
Method Summary
 Record createRecord(RecordFactory recordFactory)
Create a CCI Record instance, usually based on the passed-in CCI RecordFactory.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MappingRecordOperation.RecordCreatorImpl

public MappingRecordOperation.RecordCreatorImpl(Object inObject)
Method Detail

createRecord

public Record createRecord(RecordFactory recordFactory)
                    throws ResourceException,
                           DataAccessException
Description copied from interface: RecordCreator
Create a CCI Record instance, usually based on the passed-in CCI RecordFactory.

For use as input creator with CciTemplate's execute methods, this method should create a populated Record instance. For use as output Record creator, it should return an empty Record instance.

Specified by:
createRecord in interface RecordCreator
Parameters:
recordFactory - the CCI RecordFactory (never null, but not guaranteed to be supported by the connector: its create methods might throw NotSupportedException)
Returns:
the Record instance
Throws:
ResourceException - if thrown by a CCI method, to be auto-converted to a DataAccessException
DataAccessException - in case of custom exceptions
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MappingRecordOperation.RecordExtractorImpl

org.springframework.jca.cci.object
Class MappingRecordOperation.RecordExtractorImpl

java.lang.Object
    extended by  org.springframework.jca.cci.object.MappingRecordOperation.RecordExtractorImpl
All Implemented Interfaces:
RecordExtractor
Enclosing class:
MappingRecordOperation
protected class MappingRecordOperation.RecordExtractorImpl
extends Object
implements RecordExtractor

Implementation of RecordExtractor that calls the enclosing class's extractOutputData method.

Constructor Summary
protected MappingRecordOperation.RecordExtractorImpl()
Method Summary
 Object extractData(Record record)
Process the data in the given Record, creating a corresponding result object.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MappingRecordOperation.RecordExtractorImpl

protected MappingRecordOperation.RecordExtractorImpl()
Method Detail

extractData

public Object extractData(Record record)
                   throws ResourceException,
                          SQLException,
                          DataAccessException
Description copied from interface: RecordExtractor
Process the data in the given Record, creating a corresponding result object.

Specified by:
extractData in interface RecordExtractor
Parameters:
record - the Record to extract data from (possibly a CCI ResultSet)
Returns:
an arbitrary result object, or null if none (the extractor will typically be stateful in the latter case)
Throws:
ResourceException - if thrown by a CCI method, to be auto-converted to a DataAccessException
SQLException - if thrown by a ResultSet method, to be auto-converted to a DataAccessException
DataAccessException - in case of custom exceptions
See Also:
ResultSet
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleRecordOperation

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jca.cci.object
Class SimpleRecordOperation

java.lang.Object
    extended by  org.springframework.jca.cci.object.EisOperation
        extended by  org.springframework.jca.cci.object.SimpleRecordOperation
All Implemented Interfaces:
InitializingBean
public class SimpleRecordOperation
extends EisOperation

EIS operation object that accepts a passed-in CCI input Record and returns a corresponding CCI output Record.

Since:
1.2
Author:
Juergen Hoeller

Constructor Summary
SimpleRecordOperation()
Constructor that allows use as a JavaBean.
SimpleRecordOperation(ConnectionFactory connectionFactory, InteractionSpec interactionSpec)
Convenient constructor with ConnectionFactory and specifications (connection and interaction).
Method Summary
Record | execute(Record inputRecord) Execute the CCI interaction encapsulated by this operation object.
void | execute(Record inputRecord, Record outputRecord) Execute the CCI interaction encapsulated by this operation object.
Methods inherited from class org.springframework.jca.cci.object.EisOperation
afterPropertiesSet, getCciTemplate, getInteractionSpec, setCciTemplate, setConnectionFactory, setInteractionSpec
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleRecordOperation

public SimpleRecordOperation()
Constructor that allows use as a JavaBean.

SimpleRecordOperation

public SimpleRecordOperation(ConnectionFactory connectionFactory,
                             InteractionSpec interactionSpec)
Convenient constructor with ConnectionFactory and specifications (connection and interaction).

Parameters:
connectionFactory - ConnectionFactory to use to obtain connections
Method Detail

execute

public Record execute(Record inputRecord)
               throws DataAccessException
Execute the CCI interaction encapsulated by this operation object.

This method will call CCI's Interaction.execute variant that returns an output Record.

Parameters:
inputRecord - the input record
Returns:
the output record
Throws:
DataAccessException - if there is any problem
See Also:
Interaction.execute(javax.resource.cci.InteractionSpec, Record)

execute

public void execute(Record inputRecord,
                    Record outputRecord)
             throws DataAccessException
Execute the CCI interaction encapsulated by this operation object.

This method will call CCI's Interaction.execute variant with a passed-in output Record.

Parameters:
inputRecord - the input record
outputRecord - the output record
Throws:
DataAccessException - if there is any problem
See Also:
Interaction.execute(javax.resource.cci.InteractionSpec, Record, Record)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jca.context

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jca.context

Integration package that allows for deploying a Spring application context as a JCA 1.5 compliant RAR file.

See:
Description

Interface Summary
BootstrapContextAware Interface to be implemented by any object that wishes to be notified of the BootstrapContext (typically determined by the ResourceAdapterApplicationContext) that it runs in.

Class Summary
ResourceAdapterApplicationContext | ApplicationContext implementation for a JCA ResourceAdapter.
SpringContextResourceAdapter | JCA 1.5 ResourceAdapter implementation that loads a Spring ApplicationContext, starting and stopping Spring-managed beans as part of the ResourceAdapter's lifecycle.

Package org.springframework.jca.context Description

Integration package that allows for deploying a Spring application context as a JCA 1.5 compliant RAR file.


org.springframework.jca.context Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jca.context

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.core.io.DefaultResourceLoader (implements org.springframework.core.io.ResourceLoader)
      • org.springframework.context.support.AbstractApplicationContext (implements org.springframework.context.ConfigurableApplicationContext, org.springframework.beans.factory.DisposableBean)
        • org.springframework.context.support.GenericApplicationContext (implements org.springframework.beans.factory.support.BeanDefinitionRegistry)
          • org.springframework.jca.context.ResourceAdapterApplicationContext
    • org.springframework.jca.context.SpringContextResourceAdapter (implements javax.resource.spi.ResourceAdapter)

Interface Hierarchy

  • org.springframework.jca.context.BootstrapContextAware


BootstrapContextAware

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jca.context
Interface BootstrapContextAware

All Known Implementing Classes:
GlassFishWorkManagerTaskExecutor, JBossWorkManagerTaskExecutor, WorkManagerTaskExecutor
public interface BootstrapContextAware

Interface to be implemented by any object that wishes to be notified of the BootstrapContext (typically determined by the ResourceAdapterApplicationContext) that it runs in.

Since:
2.5
Author:
Juergen Hoeller
See Also:
BootstrapContext

Method Summary
 void setBootstrapContext(BootstrapContext bootstrapContext)
Set the BootstrapContext that this object runs in.

Method Detail

setBootstrapContext

void setBootstrapContext(BootstrapContext bootstrapContext)
Set the BootstrapContext that this object runs in.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked after ApplicationContextAware's setApplicationContext.

Parameters:
bootstrapContext - BootstrapContext object to be used by this object
See Also:
InitializingBean.afterPropertiesSet(), ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ResourceAdapterApplicationContext

org.springframework.jca.context
Class ResourceAdapterApplicationContext

java.lang.Object
    extended by  org.springframework.core.io.DefaultResourceLoader
        extended by  org.springframework.context.support.AbstractApplicationContext
            extended by  org.springframework.context.support.GenericApplicationContext
                extended by  org.springframework.jca.context.ResourceAdapterApplicationContext
All Implemented Interfaces:
BeanFactory, DisposableBean, HierarchicalBeanFactory, ListableBeanFactory, BeanDefinitionRegistry, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, AliasRegistry, ResourceLoader, ResourcePatternResolver
public class ResourceAdapterApplicationContext
extends GenericApplicationContext

ApplicationContext implementation for a JCA ResourceAdapter. Needs to be initialized with the JCA BootstrapContext, passing it on to Spring-managed beans that implement BootstrapContextAware.

Since:
2.5
Author:
Juergen Hoeller
See Also:
SpringContextResourceAdapter, BootstrapContextAware

Field Summary
Fields inherited from class org.springframework.context.support.AbstractApplicationContext
APPLICATION_EVENT_MULTICASTER_BEAN_NAME, LIFECYCLE_PROCESSOR_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAME
Fields inherited from interface org.springframework.context.ConfigurableApplicationContext
CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAME
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Constructor Summary
ResourceAdapterApplicationContext(BootstrapContext bootstrapContext)
Create a new ResourceAdapterApplicationContext for the given BootstrapContext.
Method Summary
protected  void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
Modify the application context's internal bean factory after its standard initialization.
Methods inherited from class org.springframework.context.support.GenericApplicationContext
closeBeanFactory, getBeanDefinition, getBeanFactory, getDefaultListableBeanFactory, getResource, getResources, isAlias, isBeanNameInUse, refreshBeanFactory, registerAlias, registerBeanDefinition, removeAlias, removeBeanDefinition, setAllowBeanDefinitionOverriding, setAllowCircularReferences, setId, setParent, setResourceLoader
Methods inherited from class org.springframework.context.support.AbstractApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, addListener, cancelRefresh, close, containsBean, containsBeanDefinition, containsLocalBean, destroy, destroyBeans, doClose, findAnnotationOnBean, finishBeanFactoryInitialization, finishRefresh, getAliases, getApplicationListeners, getAutowireCapableBeanFactory, getBean, getBean, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getDisplayName, getId, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getResourcePatternResolver, getStartupDate, getType, initApplicationEventMulticaster, initLifecycleProcessor, initMessageSource, invokeBeanFactoryPostProcessors, isActive, isPrototype, isRunning, isSingleton, isTypeMatch, obtainFreshBeanFactory, onClose, onRefresh, prepareBeanFactory, prepareRefresh, publishEvent, refresh, registerBeanPostProcessors, registerListeners, registerShutdownHook, setDisplayName, start, stop, toString
Methods inherited from class org.springframework.core.io.DefaultResourceLoader
getClassLoader, getResourceByPath, setClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.support.BeanDefinitionRegistry
containsBeanDefinition, getBeanDefinitionCount, getBeanDefinitionNames
Methods inherited from interface org.springframework.core.AliasRegistry
getAliases
Methods inherited from interface org.springframework.core.io.ResourceLoader
getClassLoader

Constructor Detail

ResourceAdapterApplicationContext

public ResourceAdapterApplicationContext(BootstrapContext bootstrapContext)
Create a new ResourceAdapterApplicationContext for the given BootstrapContext.

Parameters:
bootstrapContext - the JCA BootstrapContext that the ResourceAdapter has been started with
Method Detail

postProcessBeanFactory

protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
                               throws BeansException
Description copied from class: AbstractApplicationContext
Modify the application context's internal bean factory after its standard initialization. All bean definitions will have been loaded, but no beans will have been instantiated yet. This allows for registering special BeanPostProcessors etc in certain ApplicationContext implementations.

Overrides:
postProcessBeanFactory in class AbstractApplicationContext
Parameters:
beanFactory - the bean factory used by the application context
Throws:
BeansException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SpringContextResourceAdapter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jca.context
Class SpringContextResourceAdapter

java.lang.Object
    extended by  org.springframework.jca.context.SpringContextResourceAdapter
All Implemented Interfaces:
ResourceAdapter
public class SpringContextResourceAdapter
extends Object
implements ResourceAdapter

JCA 1.5 ResourceAdapter implementation that loads a Spring ApplicationContext, starting and stopping Spring-managed beans as part of the ResourceAdapter's lifecycle.

Ideal for application contexts that do not need any HTTP entry points but rather just consist of message endpoints and scheduled jobs etc. Beans in such a context may use application server resources such as the JTA transaction manager and JNDI-bound JDBC DataSources and JMS ConnectionFactory instances, and may also register with the platform's JMX server - all through Spring's standard transaction management and JNDI and JMX support facilities.

If the need for scheduling asynchronous work arises, consider using Spring's WorkManagerTaskExecutor as a standard bean definition, to be injected into application beans through dependency injection. This WorkManagerTaskExecutor will automatically use the JCA WorkManager from the BootstrapContext that has been provided to this ResourceAdapter.

The JCA BootstrapContext may also be accessed directly, through application components that implement the BootstrapContextAware interface. When deployed using this ResourceAdapter, the BootstrapContext is guaranteed to be passed on to such components.

This ResourceAdapter is to be defined in a "META-INF/ra.xml" file within a J2EE ".rar" deployment unit like as follows:

 <?xml version="1.0" encoding="UTF-8"?>
 <connector xmlns="http://java.sun.com/xml/ns/j2ee"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
                 version="1.5">
         <vendor-name>Spring Framework</vendor-name>
         <eis-type>Spring Connector</eis-type>
         <resourceadapter-version>1.0</resourceadapter-version>
         <resourceadapter>
                 <resourceadapter-class>org.springframework.jca.context.SpringContextResourceAdapter</resourceadapter-class>
                 <config-property>
                         <config-property-name>ContextConfigLocation</config-property-name>
                         <config-property-type>java.lang.String</config-property-type>
                         <config-property-value>META-INF/applicationContext.xml</config-property-value>
                 </config-property>
         </resourceadapter>
 </connector>
Note that "META-INF/applicationContext.xml" is the default context config location, so it doesn't have to specified unless you intend to specify different/additional config files. So in the default case, you may remove the entire config-property section above.

For simple deployment needs, all you need to do is the following: Package all application classes into a RAR file (which is just a standard JAR file with a different file extension), add all required library jars into the root of the RAR archive, add a "META-INF/ra.xml" deployment descriptor as shown above as well as the corresponding Spring XML bean definition file(s) (typically "META-INF/applicationContext.xml"), and drop the resulting RAR file into your application server's deployment directory!

Since:
2.5
Author:
Juergen Hoeller
See Also:
setContextConfigLocation(java.lang.String), loadBeanDefinitions(org.springframework.beans.factory.support.BeanDefinitionRegistry, java.lang.String[]), ResourceAdapterApplicationContext

Field Summary
static String | CONFIG_LOCATION_DELIMITERS Any number of these characters are considered delimiters between multiple context config paths in a single String value.
static String | DEFAULT_CONTEXT_CONFIG_LOCATION
protected Log | logger
Constructor Summary
SpringContextResourceAdapter()
Method Summary
protected ConfigurableApplicationContext | createApplicationContext(BootstrapContext bootstrapContext) Build a Spring ApplicationContext for the given JCA BootstrapContext.
void | endpointActivation(MessageEndpointFactory messageEndpointFactory, ActivationSpec activationSpec) This implementation always throws a NotSupportedException.
void | endpointDeactivation(MessageEndpointFactory messageEndpointFactory, ActivationSpec activationSpec) This implementation does nothing.
protected String | getContextConfigLocation() Return the specified context configuration files.
XAResource[] | getXAResources(ActivationSpec[] activationSpecs) This implementation always returns null.
protected void | loadBeanDefinitions(BeanDefinitionRegistry registry, String[] configLocations) Load the bean definitions into the given registry, based on the specified configuration files.
void | setContextConfigLocation(String contextConfigLocation) Set the location of the context configuration files, within the resource adapter's deployment unit.
void | start(BootstrapContext bootstrapContext) This implementation loads a Spring ApplicationContext through the createApplicationContext(javax.resource.spi.BootstrapContext) template method.
void | stop() This implementation closes the Spring ApplicationContext.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

CONFIG_LOCATION_DELIMITERS

public static final String CONFIG_LOCATION_DELIMITERS
Any number of these characters are considered delimiters between multiple context config paths in a single String value.

See Also:
setContextConfigLocation(java.lang.String), Constant Field Values

DEFAULT_CONTEXT_CONFIG_LOCATION

public static final String DEFAULT_CONTEXT_CONFIG_LOCATION
See Also:
Constant Field Values

logger

protected final Log logger
Constructor Detail

SpringContextResourceAdapter

public SpringContextResourceAdapter()
Method Detail

setContextConfigLocation

public void setContextConfigLocation(String contextConfigLocation)
Set the location of the context configuration files, within the resource adapter's deployment unit. This can be a delimited String that consists of multiple resource location, separated by commas, semicolons, whitespace, or line breaks.

This can be specified as "ContextConfigLocation" config property in the ra.xml deployment descriptor.

The default is "classpath:META-INF/applicationContext.xml".

getContextConfigLocation

protected String getContextConfigLocation()
Return the specified context configuration files.

start

public void start(BootstrapContext bootstrapContext)
           throws ResourceAdapterInternalException
This implementation loads a Spring ApplicationContext through the createApplicationContext(javax.resource.spi.BootstrapContext) template method.

Specified by:
start in interface ResourceAdapter
Throws:
ResourceAdapterInternalException

createApplicationContext

protected ConfigurableApplicationContext createApplicationContext(BootstrapContext bootstrapContext)
Build a Spring ApplicationContext for the given JCA BootstrapContext.

The default implementation builds a ResourceAdapterApplicationContext and delegates to loadBeanDefinitions(org.springframework.beans.factory.support.BeanDefinitionRegistry, java.lang.String[]) for actually parsing the specified configuration files.

Parameters:
bootstrapContext - this ResourceAdapter's BootstrapContext
Returns:
the Spring ApplicationContext instance

loadBeanDefinitions

protected void loadBeanDefinitions(BeanDefinitionRegistry registry,
                                   String[] configLocations)
Load the bean definitions into the given registry, based on the specified configuration files.

Parameters:
registry - the registry to load into
configLocations - the parsed config locations
See Also:
setContextConfigLocation(java.lang.String)

stop

public void stop()
This implementation closes the Spring ApplicationContext.

Specified by:
stop in interface ResourceAdapter

endpointActivation

public void endpointActivation(MessageEndpointFactory messageEndpointFactory,
                               ActivationSpec activationSpec)
                        throws ResourceException
This implementation always throws a NotSupportedException.

Specified by:
endpointActivation in interface ResourceAdapter
Throws:
ResourceException

endpointDeactivation

public void endpointDeactivation(MessageEndpointFactory messageEndpointFactory,
                                 ActivationSpec activationSpec)
This implementation does nothing.

Specified by:
endpointDeactivation in interface ResourceAdapter

getXAResources

public XAResource[] getXAResources(ActivationSpec[] activationSpecs)
                            throws ResourceException
This implementation always returns null.

Specified by:
getXAResources in interface ResourceAdapter
Throws:
ResourceException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jca.endpoint

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jca.endpoint

This package provides a facility for generic JCA message endpoint management.

See:
Description

Class Summary
AbstractMessageEndpointFactory | Abstract base implementation of the JCA 1.5 MessageEndpointFactory interface, providing transaction management capabilities as well as ClassLoader exposure for endpoint invocations.
GenericMessageEndpointFactory | Generic implementation of the JCA 1.5 MessageEndpointFactory interface, providing transaction management capabilities for any kind of message listener object (e.g.
GenericMessageEndpointManager | Generic bean that manages JCA 1.5 message endpoints within a Spring application context, activating and deactivating the endpoint as part of the application context's lifecycle.

Exception Summary
GenericMessageEndpointFactory.InternalResourceException Internal exception thrown when a ResourceExeption has been encountered during the endpoint invocation.

Package org.springframework.jca.endpoint Description

This package provides a facility for generic JCA message endpoint management.


org.springframework.jca.endpoint Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jca.endpoint

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jca.endpoint.AbstractMessageEndpointFactory (implements javax.resource.spi.endpoint.MessageEndpointFactory)
      • org.springframework.jca.endpoint.GenericMessageEndpointFactory
    • org.springframework.jca.endpoint.AbstractMessageEndpointFactory.AbstractMessageEndpoint (implements javax.resource.spi.endpoint.MessageEndpoint)
    • org.springframework.jca.endpoint.GenericMessageEndpointManager (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.SmartLifecycle)
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.jca.endpoint.GenericMessageEndpointFactory.InternalResourceException


AbstractMessageEndpointFactory

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jca.endpoint
Class AbstractMessageEndpointFactory

java.lang.Object
    extended by  org.springframework.jca.endpoint.AbstractMessageEndpointFactory
All Implemented Interfaces:
MessageEndpointFactory
Direct Known Subclasses:
GenericMessageEndpointFactory, JmsMessageEndpointFactory
public abstract class AbstractMessageEndpointFactory
extends Object
implements MessageEndpointFactory

Abstract base implementation of the JCA 1.5 MessageEndpointFactory interface, providing transaction management capabilities as well as ClassLoader exposure for endpoint invocations.

Since:
2.5
Author:
Juergen Hoeller
See Also:
setTransactionManager(java.lang.Object)

Nested Class Summary
protected  class AbstractMessageEndpointFactory.AbstractMessageEndpoint
Inner class for actual endpoint implementations, based on template method to allow for any kind of concrete endpoint implementation.
Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
AbstractMessageEndpointFactory()
Method Summary
MessageEndpoint | createEndpoint(XAResource xaResource) This implementation delegates to createEndpointInternal(), initializing the endpoint's XAResource before the endpoint gets invoked.
protected abstract AbstractMessageEndpointFactory.AbstractMessageEndpoint | createEndpointInternal() Create the actual endpoint instance, as a subclass of the AbstractMessageEndpointFactory.AbstractMessageEndpoint inner class of this factory.
boolean | isDeliveryTransacted(Method method) This implementation returns true if a transaction manager has been specified; false otherwise.
void | setTransactionFactory(TransactionFactory transactionFactory) Set the Spring TransactionFactory to use for wrapping endpoint invocations, enlisting the endpoint resource in each such transaction.
void | setTransactionManager(Object transactionManager) Set the the XA transaction manager to use for wrapping endpoint invocations, enlisting the endpoint resource in each such transaction.
void | setTransactionName(String transactionName) Specify the name of the transaction, if any.
void | setTransactionTimeout(int transactionTimeout) Specify the transaction timeout, if any.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

AbstractMessageEndpointFactory

public AbstractMessageEndpointFactory()
Method Detail

setTransactionManager

public void setTransactionManager(Object transactionManager)
Set the the XA transaction manager to use for wrapping endpoint invocations, enlisting the endpoint resource in each such transaction.

The passed-in object may be a transaction manager which implements Spring's TransactionFactory interface, or a plain TransactionManager.

If no transaction manager is specified, the endpoint invocation will simply not be wrapped in an XA transaction. Check out your resource provider's ActivationSpec documentation for local transaction options of your particular provider.

See Also:
setTransactionName(java.lang.String), setTransactionTimeout(int)

setTransactionFactory

public void setTransactionFactory(TransactionFactory transactionFactory)
Set the Spring TransactionFactory to use for wrapping endpoint invocations, enlisting the endpoint resource in each such transaction.

Alternatively, specify an appropriate transaction manager through the "transactionManager" property.

If no transaction factory is specified, the endpoint invocation will simply not be wrapped in an XA transaction. Check out your resource provider's ActivationSpec documentation for local transaction options of your particular provider.

See Also:
setTransactionName(java.lang.String), setTransactionTimeout(int)

setTransactionName

public void setTransactionName(String transactionName)
Specify the name of the transaction, if any.

Default is none. A specified name will be passed on to the transaction manager, allowing to identify the transaction in a transaction monitor.

setTransactionTimeout

public void setTransactionTimeout(int transactionTimeout)
Specify the transaction timeout, if any.

Default is -1: rely on the transaction manager's default timeout. Specify a concrete timeout to restrict the maximum duration of each endpoint invocation.

isDeliveryTransacted

public boolean isDeliveryTransacted(Method method)
                             throws NoSuchMethodException
This implementation returns true if a transaction manager has been specified; false otherwise.

Specified by:
isDeliveryTransacted in interface MessageEndpointFactory
Throws:
NoSuchMethodException
See Also:
setTransactionManager(java.lang.Object), setTransactionFactory(org.springframework.transaction.jta.TransactionFactory)

createEndpoint

public MessageEndpoint createEndpoint(XAResource xaResource)
                               throws UnavailableException
This implementation delegates to createEndpointInternal(), initializing the endpoint's XAResource before the endpoint gets invoked.

Specified by:
createEndpoint in interface MessageEndpointFactory
Throws:
UnavailableException

createEndpointInternal

protected abstract AbstractMessageEndpointFactory.AbstractMessageEndpoint createEndpointInternal()
                                                                                throws UnavailableException
Create the actual endpoint instance, as a subclass of the AbstractMessageEndpointFactory.AbstractMessageEndpoint inner class of this factory.

Returns:
the actual endpoint instance (never null)
Throws:
UnavailableException - if no endpoint is available at present
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractMessageEndpointFactory.AbstractMessageEndpoint

org.springframework.jca.endpoint
Class AbstractMessageEndpointFactory.AbstractMessageEndpoint

java.lang.Object
    extended by  org.springframework.jca.endpoint.AbstractMessageEndpointFactory.AbstractMessageEndpoint
All Implemented Interfaces:
MessageEndpoint
Enclosing class:
AbstractMessageEndpointFactory
protected abstract class AbstractMessageEndpointFactory.AbstractMessageEndpoint
extends Object
implements MessageEndpoint

Inner class for actual endpoint implementations, based on template method to allow for any kind of concrete endpoint implementation.

Constructor Summary
protected AbstractMessageEndpointFactory.AbstractMessageEndpoint()
Method Summary
 void afterDelivery()
This afterDelivery implementation resets the thread context ClassLoader and completes the transaction, if any.
 void beforeDelivery(Method method)
This beforeDelivery implementation starts a transaction, if necessary, and exposes the endpoint ClassLoader as current thread context ClassLoader.
protected abstract  ClassLoader getEndpointClassLoader()
Template method for exposing the endpoint's ClassLoader (typically the ClassLoader that the message listener class has been loaded with).
protected  boolean hasBeforeDeliveryBeenCalled()
Return whether the beforeDelivery(java.lang.reflect.Method) method of this endpoint has already been called.
protected  void onEndpointException(Throwable ex)
Callback method for notifying the endpoint base class that the concrete endpoint invocation led to an exception.
 void release()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractMessageEndpointFactory.AbstractMessageEndpoint

protected AbstractMessageEndpointFactory.AbstractMessageEndpoint()
Method Detail

beforeDelivery

public void beforeDelivery(Method method)
                    throws ResourceException
This beforeDelivery implementation starts a transaction, if necessary, and exposes the endpoint ClassLoader as current thread context ClassLoader.

Note that the JCA 1.5 specification does not require a ResourceAdapter to call this method before invoking the concrete endpoint. If this method has not been called (check hasBeforeDeliveryBeenCalled()), the concrete endpoint method should call beforeDelivery and its sibling afterDelivery() explicitly, as part of its own processing.

Specified by:
beforeDelivery in interface MessageEndpoint
Throws:
ResourceException

getEndpointClassLoader

protected abstract ClassLoader getEndpointClassLoader()
Template method for exposing the endpoint's ClassLoader (typically the ClassLoader that the message listener class has been loaded with).

Returns:
the endpoint ClassLoader (never null)

hasBeforeDeliveryBeenCalled

protected final boolean hasBeforeDeliveryBeenCalled()
Return whether the beforeDelivery(java.lang.reflect.Method) method of this endpoint has already been called.

onEndpointException

protected final void onEndpointException(Throwable ex)
Callback method for notifying the endpoint base class that the concrete endpoint invocation led to an exception.

To be invoked by subclasses in case of the concrete endpoint throwing an exception.

Parameters:
ex - the exception thrown from the concrete endpoint

afterDelivery

public void afterDelivery()
                   throws ResourceException
This afterDelivery implementation resets the thread context ClassLoader and completes the transaction, if any.

Note that the JCA 1.5 specification does not require a ResourceAdapter to call this method after invoking the concrete endpoint. See the explanation in beforeDelivery(java.lang.reflect.Method)'s javadoc.

Specified by:
afterDelivery in interface MessageEndpoint
Throws:
ResourceException

release

public void release()
Specified by:
release in interface MessageEndpoint
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


GenericMessageEndpointFactory

org.springframework.jca.endpoint
Class GenericMessageEndpointFactory

java.lang.Object
    extended by  org.springframework.jca.endpoint.AbstractMessageEndpointFactory
        extended by  org.springframework.jca.endpoint.GenericMessageEndpointFactory
All Implemented Interfaces:
MessageEndpointFactory
public class GenericMessageEndpointFactory
extends AbstractMessageEndpointFactory

Generic implementation of the JCA 1.5 MessageEndpointFactory interface, providing transaction management capabilities for any kind of message listener object (e.g. MessageListener objects or MessageListener objects.

Uses AOP proxies for concrete endpoint instances, simply wrapping the specified message listener object and exposing all of its implemented interfaces on the endpoint instance.

Typically used with Spring's GenericMessageEndpointManager, but not tied to it. As a consequence, this endpoint factory could also be used with programmatic endpoint management on a native ResourceAdapter instance.

Since:
2.5
Author:
Juergen Hoeller
See Also:
setMessageListener(java.lang.Object), AbstractMessageEndpointFactory.setTransactionManager(java.lang.Object), GenericMessageEndpointManager

Nested Class Summary
static class GenericMessageEndpointFactory.InternalResourceException
Internal exception thrown when a ResourceExeption has been encountered during the endpoint invocation.
Nested classes/interfaces inherited from class org.springframework.jca.endpoint.AbstractMessageEndpointFactory
AbstractMessageEndpointFactory.AbstractMessageEndpoint
Field Summary
Fields inherited from class org.springframework.jca.endpoint.AbstractMessageEndpointFactory
logger
Constructor Summary
GenericMessageEndpointFactory()
Method Summary
MessageEndpoint | createEndpoint(XAResource xaResource) Wrap each concrete endpoint instance with an AOP proxy, exposing the message listener's interfaces as well as the endpoint SPI through an AOP introduction.
protected AbstractMessageEndpointFactory.AbstractMessageEndpoint | createEndpointInternal() Creates a concrete generic message endpoint, internal to this factory.
void | setMessageListener(Object messageListener) Specify the message listener object that the endpoint should expose (e.g.
Methods inherited from class org.springframework.jca.endpoint.AbstractMessageEndpointFactory
isDeliveryTransacted, setTransactionFactory, setTransactionManager, setTransactionName, setTransactionTimeout
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

GenericMessageEndpointFactory

public GenericMessageEndpointFactory()
Method Detail

setMessageListener

public void setMessageListener(Object messageListener)
Specify the message listener object that the endpoint should expose (e.g. a MessageListener objects or MessageListener implementation).

createEndpoint

public MessageEndpoint createEndpoint(XAResource xaResource)
                               throws UnavailableException
Wrap each concrete endpoint instance with an AOP proxy, exposing the message listener's interfaces as well as the endpoint SPI through an AOP introduction.

Specified by:
createEndpoint in interface MessageEndpointFactory
Overrides:
createEndpoint in class AbstractMessageEndpointFactory
Throws:
UnavailableException

createEndpointInternal

protected AbstractMessageEndpointFactory.AbstractMessageEndpoint createEndpointInternal()
                                                                                throws UnavailableException
Creates a concrete generic message endpoint, internal to this factory.

Specified by:
createEndpointInternal in class AbstractMessageEndpointFactory
Returns:
the actual endpoint instance (never null)
Throws:
UnavailableException - if no endpoint is available at present
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


GenericMessageEndpointFactory.InternalResourceException

org.springframework.jca.endpoint
Class GenericMessageEndpointFactory.InternalResourceException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.jca.endpoint.GenericMessageEndpointFactory.InternalResourceException
All Implemented Interfaces:
Serializable
Enclosing class:
GenericMessageEndpointFactory
public static class GenericMessageEndpointFactory.InternalResourceException
extends RuntimeException

Internal exception thrown when a ResourceExeption has been encountered during the endpoint invocation.

Will only be used if the ResourceAdapter does not invoke the endpoint's beforeDelivery and afterDelivery directly, leavng it up to the concrete endpoint to apply those - and to handle any ResourceExceptions thrown from them.

See Also:
Serialized Form

Constructor Summary
protected GenericMessageEndpointFactory.InternalResourceException(ResourceException cause)
Method Summary
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

GenericMessageEndpointFactory.InternalResourceException

protected GenericMessageEndpointFactory.InternalResourceException(ResourceException cause)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


GenericMessageEndpointManager

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jca.endpoint
Class GenericMessageEndpointManager

java.lang.Object
    extended by  org.springframework.jca.endpoint.GenericMessageEndpointManager
All Implemented Interfaces:
DisposableBean, InitializingBean, Lifecycle, Phased, SmartLifecycle
Direct Known Subclasses:
JmsMessageEndpointManager
public class GenericMessageEndpointManager
extends Object
implements SmartLifecycle, InitializingBean, DisposableBean

Generic bean that manages JCA 1.5 message endpoints within a Spring application context, activating and deactivating the endpoint as part of the application context's lifecycle.

This class is completely generic in that it may work with any ResourceAdapter, any MessageEndpointFactory, and any ActivationSpec. It can be configured in standard bean style, for example through Spring's XML bean definition format, as follows:

 <bean class="org.springframework.jca.endpoint.GenericMessageEndpointManager">
         <property name="resourceAdapter" ref="resourceAdapter"/>
         <property name="messageEndpointFactory">
     <bean class="org.springframework.jca.endpoint.GenericMessageEndpointFactory">
       <property name="messageListener" ref="messageListener"/>
     </bean>
         </property>
         <property name="activationSpec">
     <bean class="org.apache.activemq.ra.ActiveMQActivationSpec">
       <property name="destination" value="myQueue"/>
       <property name="destinationType" value="javax.jms.Queue"/>
     </bean>
   </property>
 </bean>
In this example, Spring's own GenericMessageEndpointFactory is used to point to a standard message listener object that happens to be supported by the specified target ResourceAdapter: in this case, a JMS MessageListener object as supported by the ActiveMQ message broker, defined as a Spring bean:
 <bean id="messageListener" class="com.myorg.messaging.myMessageListener">
   ...
 </bean>
The target ResourceAdapter may be configured as a local Spring bean as well (the typical case) or obtained from JNDI (e.g. on WebLogic). For the example above, a local ResourceAdapter bean could be defined as follows (matching the "resourceAdapter" bean reference above):
 <bean id="resourceAdapter" class="org.springframework.jca.support.ResourceAdapterFactoryBean">
   <property name="resourceAdapter">
     <bean class="org.apache.activemq.ra.ActiveMQResourceAdapter">
       <property name="serverUrl" value="tcp://localhost:61616"/>
     </bean>
   </property>
   <property name="workManager">
     <bean class="org.springframework.jca.work.SimpleTaskWorkManager"/>
   </property>
 </bean>
For a different target resource, the configuration would simply point to a different ResourceAdapter and a different ActivationSpec object (which are both specific to the resource provider), and possibly a different message listener (e.g. a CCI MessageListener for a resource adapter which is based on the JCA Common Client Interface).

The asynchronous execution strategy can be customized through the "workManager" property on the ResourceAdapterFactoryBean (as shown above). Check out SimpleTaskWorkManager's javadoc for its configuration options; alternatively, any other JCA-compliant WorkManager can be used (e.g. Geronimo's).

Transactional execution is a responsibility of the concrete message endpoint, as built by the specified MessageEndpointFactory. GenericMessageEndpointFactory supports XA transaction participation through its "transactionManager" property, typically with a Spring JtaTransactionManager or a plain TransactionManager implementation specified there.

 <bean class="org.springframework.jca.endpoint.GenericMessageEndpointManager">
         <property name="resourceAdapter" ref="resourceAdapter"/>
         <property name="messageEndpointFactory">
     <bean class="org.springframework.jca.endpoint.GenericMessageEndpointFactory">
       <property name="messageListener" ref="messageListener"/>
       <property name="transactionManager" ref="transactionManager"/>
     </bean>
         </property>
         <property name="activationSpec">
     <bean class="org.apache.activemq.ra.ActiveMQActivationSpec">
       <property name="destination" value="myQueue"/>
       <property name="destinationType" value="javax.jms.Queue"/>
     </bean>
   </property>
 </bean>

 <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"/>
Alternatively, check out your resource provider's ActivationSpec object, which should support local transactions through a provider-specific config flag, e.g. ActiveMQActivationSpec's "useRAManagedTransaction" bean property.
 <bean class="org.springframework.jca.endpoint.GenericMessageEndpointManager">
         <property name="resourceAdapter" ref="resourceAdapter"/>
         <property name="messageEndpointFactory">
     <bean class="org.springframework.jca.endpoint.GenericMessageEndpointFactory">
       <property name="messageListener" ref="messageListener"/>
     </bean>
         </property>
         <property name="activationSpec">
     <bean class="org.apache.activemq.ra.ActiveMQActivationSpec">
       <property name="destination" value="myQueue"/>
       <property name="destinationType" value="javax.jms.Queue"/>
       <property name="useRAManagedTransaction" value="true"/>
     </bean>
   </property>
 </bean>

Since:
2.5
Author:
Juergen Hoeller
See Also:
ResourceAdapter.endpointActivation(javax.resource.spi.endpoint.MessageEndpointFactory, javax.resource.spi.ActivationSpec), ResourceAdapter.endpointDeactivation(javax.resource.spi.endpoint.MessageEndpointFactory, javax.resource.spi.ActivationSpec), MessageEndpointFactory, ActivationSpec

Constructor Summary
GenericMessageEndpointManager()
Method Summary
void | afterPropertiesSet() Prepares the message endpoint, and automatically activates it if the "autoStartup" flag is set to "true".
void | destroy() Deactivates the message endpoint, preparing it for shutdown.
ActivationSpec | getActivationSpec() Return the JCA ActivationSpec to use for activating the endpoint.
MessageEndpointFactory | getMessageEndpointFactory() Return the JCA MessageEndpointFactory to activate.
int | getPhase() Return the phase in which this endpoint manager will be started and stopped.
ResourceAdapter | getResourceAdapter() Return the JCA ResourceAdapter to manage endpoints for.
boolean | isAutoStartup() Return the value for the 'autoStartup' property.
boolean | isRunning() Return whether the configured message endpoint is currently active.
void | setActivationSpec(ActivationSpec activationSpec) Set the JCA ActivationSpec to use for activating the endpoint.
void | setAutoStartup(boolean autoStartup) Set whether to auto-start the endpoint activation after this endpoint manager has been initialized and the context has been refreshed.
void | setMessageEndpointFactory(MessageEndpointFactory messageEndpointFactory) Set the JCA MessageEndpointFactory to activate, pointing to a MessageListener object that the endpoints will delegate to.
void | setPhase(int phase) Specify the phase in which this endpoint manager should be started and stopped.
void | setResourceAdapter(ResourceAdapter resourceAdapter) Set the JCA ResourceAdapter to manage endpoints for.
void | start() Activates the configured message endpoint.
void | stop() Deactivates the configured message endpoint.
void | stop(Runnable callback) Indicates that a Lifecycle component must stop if it is currently running.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

GenericMessageEndpointManager

public GenericMessageEndpointManager()
Method Detail

setResourceAdapter

public void setResourceAdapter(ResourceAdapter resourceAdapter)
Set the JCA ResourceAdapter to manage endpoints for.

getResourceAdapter

public ResourceAdapter getResourceAdapter()
Return the JCA ResourceAdapter to manage endpoints for.

setMessageEndpointFactory

public void setMessageEndpointFactory(MessageEndpointFactory messageEndpointFactory)
Set the JCA MessageEndpointFactory to activate, pointing to a MessageListener object that the endpoints will delegate to.

A MessageEndpointFactory instance may be shared across multiple endpoints (i.e. multiple GenericMessageEndpointManager instances), with different ActivationSpec objects applied.

See Also:
GenericMessageEndpointFactory.setMessageListener(java.lang.Object)

getMessageEndpointFactory

public MessageEndpointFactory getMessageEndpointFactory()
Return the JCA MessageEndpointFactory to activate.

setActivationSpec

public void setActivationSpec(ActivationSpec activationSpec)
Set the JCA ActivationSpec to use for activating the endpoint.

Note that this ActivationSpec instance should not be shared across multiple ResourceAdapter instances.

getActivationSpec

public ActivationSpec getActivationSpec()
Return the JCA ActivationSpec to use for activating the endpoint.

setAutoStartup

public void setAutoStartup(boolean autoStartup)
Set whether to auto-start the endpoint activation after this endpoint manager has been initialized and the context has been refreshed.

Default is "true". Turn this flag off to defer the endpoint activation until an explicit {#start()} call.

isAutoStartup

public boolean isAutoStartup()
Return the value for the 'autoStartup' property. If "true", this endpoint manager will start upon a ContextRefreshedEvent.

Specified by:
isAutoStartup in interface SmartLifecycle

setPhase

public void setPhase(int phase)
Specify the phase in which this endpoint manager should be started and stopped. The startup order proceeds from lowest to highest, and the shutdown order is the reverse of that. By default this value is Integer.MAX_VALUE meaning that this endpoint manager starts as late as possible and stops as soon as possible.

getPhase

public int getPhase()
Return the phase in which this endpoint manager will be started and stopped.

Specified by:
getPhase in interface Phased

afterPropertiesSet

public void afterPropertiesSet()
                        throws ResourceException
Prepares the message endpoint, and automatically activates it if the "autoStartup" flag is set to "true".

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
ResourceException

start

public void start()
Activates the configured message endpoint.

Specified by:
start in interface Lifecycle

stop

public void stop()
Deactivates the configured message endpoint.

Specified by:
stop in interface Lifecycle

stop

public void stop(Runnable callback)
Description copied from interface: SmartLifecycle
Indicates that a Lifecycle component must stop if it is currently running.

The provided callback is used by the LifecycleProcessor to support an ordered, and potentially concurrent, shutdown of all components having a common shutdown order value. The callback must be executed after the SmartLifecycle component does indeed stop.

Specified by:
stop in interface SmartLifecycle

isRunning

public boolean isRunning()
Return whether the configured message endpoint is currently active.

Specified by:
isRunning in interface Lifecycle
Returns:
whether the component is currently running

destroy

public void destroy()
Deactivates the message endpoint, preparing it for shutdown.

Specified by:
destroy in interface DisposableBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jca.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jca.support

Provides generic support classes for JCA usage within Spring, mainly for local setup of a JCA ResourceAdapter and/or ConnectionFactory.

See:
Description

Class Summary
LocalConnectionFactoryBean | FactoryBean that creates a local JCA connection factory in "non-managed" mode (as defined by the Java Connector Architecture specification).
ResourceAdapterFactoryBean | FactoryBean that bootstraps the specified JCA 1.5 ResourceAdapter, starting it with a local BootstrapContext and exposing it for bean references.
SimpleBootstrapContext | Simple implementation of the JCA 1.5 BootstrapContext interface, used for bootstrapping a JCA ResourceAdapter in a local environment.

Package org.springframework.jca.support Description

Provides generic support classes for JCA usage within Spring, mainly for local setup of a JCA ResourceAdapter and/or ConnectionFactory.


org.springframework.jca.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jca.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jca.support.LocalConnectionFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.jca.support.ResourceAdapterFactoryBean (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.jca.support.SimpleBootstrapContext (implements javax.resource.spi.BootstrapContext)


LocalConnectionFactoryBean

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jca.support
Class LocalConnectionFactoryBean

java.lang.Object
    extended by  org.springframework.jca.support.LocalConnectionFactoryBean
All Implemented Interfaces:
FactoryBean<Object>, InitializingBean
public class LocalConnectionFactoryBean
extends Object
implements FactoryBean<Object>, InitializingBean

FactoryBean that creates a local JCA connection factory in "non-managed" mode (as defined by the Java Connector Architecture specification). This is a direct alternative to a JndiObjectFactoryBean definition that obtains a connection factory handle from a J2EE server's naming environment.

The type of the connection factory is dependent on the actual connector: the connector can either expose its native API (such as a JDBC DataSource or a JMS ConnectionFactory) or follow the standard Common Client Interface (CCI), as defined by the JCA spec. The exposed interface in the CCI case is ConnectionFactory.

In order to use this FactoryBean, you must specify the connector's "managedConnectionFactory" (usually configured as separate JavaBean), which will be used to create the actual connection factory reference as exposed to the application. Optionally, you can also specify a "connectionManager", in order to use a custom ConnectionManager instead of the connector's default.

NOTE: In non-managed mode, a connector is not deployed on an application server, or more specificially not interacting with an application server. Consequently, it cannot use a J2EE server's system contracts: connection management, transaction management, and security management. A custom ConnectionManager implementation has to be used for applying those services in conjunction with a standalone transaction coordinator etc.

The connector will use a local ConnectionManager (included in the connector) by default, which cannot participate in global transactions due to the lack of XA enlistment. You need to specify an XA-capable ConnectionManager in order to make the connector interact with an XA transaction coordinator. Alternatively, simply use the native local transaction facilities of the exposed API (e.g. CCI local transactions), or use a corresponding implementation of Spring's PlatformTransactionManager SPI (e.g. CciLocalTransactionManager) to drive local transactions.

Since:
1.2
Author:
Juergen Hoeller
See Also:
setManagedConnectionFactory(javax.resource.spi.ManagedConnectionFactory), setConnectionManager(javax.resource.spi.ConnectionManager), ConnectionFactory, Connection.getLocalTransaction(), CciLocalTransactionManager

Constructor Summary
LocalConnectionFactoryBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 Object getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<?> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setConnectionManager(ConnectionManager connectionManager)
Set the JCA ConnectionManager that should be used to create the desired connection factory.
 void setManagedConnectionFactory(ManagedConnectionFactory managedConnectionFactory)
Set the JCA ManagerConnectionFactory that should be used to create the desired connection factory.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

LocalConnectionFactoryBean

public LocalConnectionFactoryBean()
Method Detail

setManagedConnectionFactory

public void setManagedConnectionFactory(ManagedConnectionFactory managedConnectionFactory)
Set the JCA ManagerConnectionFactory that should be used to create the desired connection factory.

The ManagerConnectionFactory will usually be set up as separate bean (potentially as inner bean), populated with JavaBean properties: a ManagerConnectionFactory is encouraged to follow the JavaBean pattern by the JCA specification, analogous to a JDBC DataSource and a JDO PersistenceManagerFactory.

Note that the ManagerConnectionFactory implementation might expect a reference to its JCA 1.5 ResourceAdapter, expressed through the ResourceAdapterAssociation interface. Simply inject the corresponding ResourceAdapter instance into its "resourceAdapter" bean property in this case, before passing the ManagerConnectionFactory into this LocalConnectionFactoryBean.

See Also:
ManagedConnectionFactory.createConnectionFactory()

setConnectionManager

public void setConnectionManager(ConnectionManager connectionManager)
Set the JCA ConnectionManager that should be used to create the desired connection factory.

A ConnectionManager implementation for local usage is often included with a JCA connector. Such an included ConnectionManager might be set as default, with no need to explicitly specify one.

See Also:
ManagedConnectionFactory.createConnectionFactory(javax.resource.spi.ConnectionManager)

afterPropertiesSet

public void afterPropertiesSet()
                        throws ResourceException
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
ResourceException

getObject

public Object getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<Object>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<?> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<Object>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<Object>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ResourceAdapterFactoryBean

org.springframework.jca.support
Class ResourceAdapterFactoryBean

java.lang.Object
    extended by  org.springframework.jca.support.ResourceAdapterFactoryBean
All Implemented Interfaces:
DisposableBean, FactoryBean<ResourceAdapter>, InitializingBean
public class ResourceAdapterFactoryBean
extends Object
implements FactoryBean<ResourceAdapter>, InitializingBean, DisposableBean

FactoryBean that bootstraps the specified JCA 1.5 ResourceAdapter, starting it with a local BootstrapContext and exposing it for bean references. It will also stop the ResourceAdapter on context shutdown. This corresponds to 'non-managed' bootstrap in a local environment, according to the JCA 1.5 specification.

This is essentially an adapter for bean-style bootstrapping of a JCA ResourceAdapter, allowing the BootstrapContext or its elements (such as the JCA WorkManager) to be specified through bean properties.

Since:
2.0.3
Author:
Juergen Hoeller
See Also:
setResourceAdapter(javax.resource.spi.ResourceAdapter),
setBootstrapContext(javax.resource.spi.BootstrapContext),
setWorkManager(javax.resource.spi.work.WorkManager),
ResourceAdapter.start(javax.resource.spi.BootstrapContext),
ResourceAdapter.stop()

Constructor Summary
ResourceAdapterFactoryBean()
Method Summary
 void afterPropertiesSet()
Builds the BootstrapContext and starts the ResourceAdapter with it.
 void destroy()
Stops the ResourceAdapter.
 ResourceAdapter getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<? extends ResourceAdapter> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setBootstrapContext(BootstrapContext bootstrapContext)
Specify the JCA BootstrapContext to use for starting the ResourceAdapter.
 void setResourceAdapter(ResourceAdapter resourceAdapter)
Specify the target JCA ResourceAdapter, passed in as configured instance which hasn't been started yet.
 void setResourceAdapterClass(Class resourceAdapterClass)
Specify the target JCA ResourceAdapter as class, to be instantiated with its default configuration.
 void setWorkManager(WorkManager workManager)
Specify the JCA WorkManager to use for bootstrapping the ResourceAdapter.
 void setXaTerminator(XATerminator xaTerminator)
Specify the JCA XATerminator to use for bootstrapping the ResourceAdapter.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ResourceAdapterFactoryBean

public ResourceAdapterFactoryBean()
Method Detail

setResourceAdapterClass

public void setResourceAdapterClass(Class resourceAdapterClass)
Specify the target JCA ResourceAdapter as class, to be instantiated with its default configuration.

Alternatively, specify a pre-configured ResourceAdapter instance through the "resourceAdapter" property.

See Also:
setResourceAdapter(javax.resource.spi.ResourceAdapter)

setResourceAdapter

public void setResourceAdapter(ResourceAdapter resourceAdapter)
Specify the target JCA ResourceAdapter, passed in as configured instance which hasn't been started yet. This will typically happen as an inner bean definition, configuring the ResourceAdapter instance through its vendor-specific bean properties.

setBootstrapContext

public void setBootstrapContext(BootstrapContext bootstrapContext)
Specify the JCA BootstrapContext to use for starting the ResourceAdapter.

Alternatively, you can specify the individual parts (such as the JCA WorkManager) as individual references.

See Also:
setWorkManager(javax.resource.spi.work.WorkManager), setXaTerminator(javax.resource.spi.XATerminator)

setWorkManager

public void setWorkManager(WorkManager workManager)
Specify the JCA WorkManager to use for bootstrapping the ResourceAdapter.

See Also:
setBootstrapContext(javax.resource.spi.BootstrapContext)

setXaTerminator

public void setXaTerminator(XATerminator xaTerminator)
Specify the JCA XATerminator to use for bootstrapping the ResourceAdapter.

See Also:
setBootstrapContext(javax.resource.spi.BootstrapContext)

afterPropertiesSet

public void afterPropertiesSet()
                        throws ResourceException
Builds the BootstrapContext and starts the ResourceAdapter with it.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
ResourceException
See Also:
ResourceAdapter.start(javax.resource.spi.BootstrapContext)

getObject

public ResourceAdapter getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<ResourceAdapter>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends ResourceAdapter> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<ResourceAdapter>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<ResourceAdapter>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()

destroy

public void destroy()
Stops the ResourceAdapter.

Specified by:
destroy in interface DisposableBean
See Also:
ResourceAdapter.stop()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleBootstrapContext

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jca.support
Class SimpleBootstrapContext

java.lang.Object
    extended by  org.springframework.jca.support.SimpleBootstrapContext
All Implemented Interfaces:
BootstrapContext
public class SimpleBootstrapContext
extends Object
implements BootstrapContext

Simple implementation of the JCA 1.5 BootstrapContext interface, used for bootstrapping a JCA ResourceAdapter in a local environment.

Delegates to the given WorkManager and XATerminator, if any. Creates simple local instances of java.util.Timer.

Since:
2.0.3
Author:
Juergen Hoeller
See Also:
ResourceAdapter.start(javax.resource.spi.BootstrapContext), ResourceAdapterFactoryBean

Constructor Summary
SimpleBootstrapContext(WorkManager workManager)
Create a new SimpleBootstrapContext for the given WorkManager, with no XATerminator available.
SimpleBootstrapContext(WorkManager workManager, XATerminator xaTerminator)
Create a new SimpleBootstrapContext for the given WorkManager and XATerminator.
Method Summary
Timer | createTimer()
WorkManager | getWorkManager()
XATerminator | getXATerminator()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleBootstrapContext

public SimpleBootstrapContext(WorkManager workManager)
Create a new SimpleBootstrapContext for the given WorkManager, with no XATerminator available.

Parameters:
workManager - the JCA WorkManager to use (may be null)

SimpleBootstrapContext

public SimpleBootstrapContext(WorkManager workManager,
                              XATerminator xaTerminator)
Create a new SimpleBootstrapContext for the given WorkManager and XATerminator.

Parameters:
workManager - the JCA WorkManager to use (may be null)
xaTerminator - the JCA XATerminator to use (may be null)
Method Detail

getWorkManager

public WorkManager getWorkManager()
Specified by:
getWorkManager in interface BootstrapContext

getXATerminator

public XATerminator getXATerminator()
Specified by:
getXATerminator in interface BootstrapContext

createTimer

public Timer createTimer()
                  throws UnavailableException
Specified by:
createTimer in interface BootstrapContext
Throws:
UnavailableException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jca.work

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jca.work

Convenience classes for scheduling based on the JCA 1.5 WorkManager facility, as supported within JCA 1.5 ResourceAdapters.

See:
Description

Class Summary
DelegatingWork | Simple Work adapter that delegates to a given Runnable.
SimpleTaskWorkManager | Simple JCA 1.5 WorkManager implementation that delegates to a Spring TaskExecutor.
WorkManagerTaskExecutor | TaskExecutor implementation that delegates to a JCA 1.5 WorkManager, implementing the WorkManager interface.

Package org.springframework.jca.work Description

Convenience classes for scheduling based on the JCA 1.5 WorkManager facility, as supported within JCA 1.5 ResourceAdapters.


org.springframework.jca.work Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jca.work

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jca.work.DelegatingWork (implements javax.resource.spi.work.Work)
    • org.springframework.jndi.JndiAccessor
      • org.springframework.jndi.JndiLocatorSupport
        • org.springframework.jca.work.WorkManagerTaskExecutor (implements org.springframework.core.task.AsyncTaskExecutor, org.springframework.jca.context.BootstrapContextAware, org.springframework.beans.factory.InitializingBean, org.springframework.scheduling.SchedulingTaskExecutor, javax.resource.spi.work.WorkManager)
    • org.springframework.jca.work.SimpleTaskWorkManager (implements javax.resource.spi.work.WorkManager)


DelegatingWork

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jca.work
Class DelegatingWork

java.lang.Object
    extended by  org.springframework.jca.work.DelegatingWork
All Implemented Interfaces:
Runnable, Work
public class DelegatingWork
extends Object
implements Work

Simple Work adapter that delegates to a given Runnable.

Since:
2.0.3
Author:
Juergen Hoeller
See Also:
Work, Runnable

Constructor Summary
DelegatingWork(Runnable delegate)
Create a new DelegatingWork.
Method Summary
Runnable | getDelegate() Return the wrapped Runnable implementation.
void | release() This implementation is empty, since we expect the Runnable to terminate based on some specific shutdown signal.
void | run() Delegates execution to the underlying Runnable.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DelegatingWork

public DelegatingWork(Runnable delegate)
Create a new DelegatingWork.

Parameters:
delegate - the Runnable implementation to delegate to
Method Detail

getDelegate

public final Runnable getDelegate()
Return the wrapped Runnable implementation.

run

public void run()
Delegates execution to the underlying Runnable.

Specified by:
run in interface Runnable

release

public void release()
This implementation is empty, since we expect the Runnable to terminate based on some specific shutdown signal.

Specified by:
release in interface Work
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


SimpleTaskWorkManager

org.springframework.jca.work
Class SimpleTaskWorkManager

java.lang.Object
    extended by  org.springframework.jca.work.SimpleTaskWorkManager
All Implemented Interfaces:
WorkManager
public class SimpleTaskWorkManager
extends Object
implements WorkManager

Simple JCA 1.5 WorkManager implementation that delegates to a Spring TaskExecutor. Provides simple task execution including start timeouts, but without support for a JCA ExecutionContext (i.e. without support for imported transactions).

Uses a SyncTaskExecutor for doWork(javax.resource.spi.work.Work) calls and a SimpleAsyncTaskExecutor for startWork(javax.resource.spi.work.Work) and scheduleWork(javax.resource.spi.work.Work) calls, by default. These default task executors can be overridden through configuration.

NOTE: This WorkManager does not provide thread pooling by default! Specify a ThreadPoolTaskExecutor (or any other thread-pooling TaskExecutor) as "asyncTaskExecutor" in order to achieve actual thread pooling.

This WorkManager automatically detects a specified AsyncTaskExecutor implementation and uses its extended timeout functionality where appropriate. JCA WorkListeners are fully supported in any case.

Since:
2.0.3
Author:
Juergen Hoeller
See Also:
setSyncTaskExecutor(org.springframework.core.task.TaskExecutor), setAsyncTaskExecutor(org.springframework.core.task.AsyncTaskExecutor)

Field Summary
Fields inherited from interface javax.resource.spi.work.WorkManager
IMMEDIATE, INDEFINITE, UNKNOWN
Constructor Summary
SimpleTaskWorkManager()
Method Summary
void | doWork(Work work)
void | doWork(Work work, long startTimeout, ExecutionContext executionContext, WorkListener workListener)
protected long | executeWork(TaskExecutor taskExecutor, Work work, long startTimeout, boolean blockUntilStarted, ExecutionContext executionContext, WorkListener workListener) Execute the given Work on the specified TaskExecutor.
void | scheduleWork(Work work)
void | scheduleWork(Work work, long startTimeout, ExecutionContext executionContext, WorkListener workListener)
void | setAsyncTaskExecutor(AsyncTaskExecutor asyncTaskExecutor) Specify the TaskExecutor to use for asynchronous work execution (i.e.
void | setSyncTaskExecutor(TaskExecutor syncTaskExecutor) Specify the TaskExecutor to use for synchronous work execution (i.e.
long | startWork(Work work)
long | startWork(Work work, long startTimeout, ExecutionContext executionContext, WorkListener workListener)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleTaskWorkManager

public SimpleTaskWorkManager()
Method Detail

setSyncTaskExecutor

public void setSyncTaskExecutor(TaskExecutor syncTaskExecutor)
Specify the TaskExecutor to use for synchronous work execution (i.e. doWork(javax.resource.spi.work.Work) calls).

Default is a SyncTaskExecutor.

setAsyncTaskExecutor

public void setAsyncTaskExecutor(AsyncTaskExecutor asyncTaskExecutor)
Specify the TaskExecutor to use for asynchronous work execution (i.e. startWork(javax.resource.spi.work.Work) and scheduleWork(javax.resource.spi.work.Work) calls).

This will typically (but not necessarily) be an AsyncTaskExecutor implementation. Default is a SimpleAsyncTaskExecutor.

doWork

public void doWork(Work work)
            throws WorkException
Specified by:
doWork in interface WorkManager
Throws:
WorkException

doWork

public void doWork(Work work,
                   long startTimeout,
                   ExecutionContext executionContext,
                   WorkListener workListener)
            throws WorkException
Specified by:
doWork in interface WorkManager
Throws:
WorkException

startWork

public long startWork(Work work)
               throws WorkException
Specified by:
startWork in interface WorkManager
Throws:
WorkException

startWork

public long startWork(Work work,
                      long startTimeout,
                      ExecutionContext executionContext,
                      WorkListener workListener)
               throws WorkException
Specified by:
startWork in interface WorkManager
Throws:
WorkException

scheduleWork

public void scheduleWork(Work work)
                  throws WorkException
Specified by:
scheduleWork in interface WorkManager
Throws:
WorkException

scheduleWork

public void scheduleWork(Work work,
                         long startTimeout,
                         ExecutionContext executionContext,
                         WorkListener workListener)
                  throws WorkException
Specified by:
scheduleWork in interface WorkManager
Throws:
WorkException

executeWork

protected long executeWork(TaskExecutor taskExecutor,
                           Work work,
                           long startTimeout,
                           boolean blockUntilStarted,
                           ExecutionContext executionContext,
                           WorkListener workListener)
                    throws WorkException
Execute the given Work on the specified TaskExecutor.

Parameters:
taskExecutor - the TaskExecutor to use
work - the Work to execute
startTimeout - the time duration within which the Work is supposed to start
blockUntilStarted - whether to block until the Work has started
executionContext - the JCA ExecutionContext for the given Work
workListener - the WorkListener to clal for the given Work
Returns:
the time elapsed from Work acceptance until start of execution (or -1 if not applicable or not known)
Throws:
WorkException - if the TaskExecutor did not accept the Work
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WorkManagerTaskExecutor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jca.work
Class WorkManagerTaskExecutor

java.lang.Object
    extended by  org.springframework.jndi.JndiAccessor
        extended by  org.springframework.jndi.JndiLocatorSupport
            extended by  org.springframework.jca.work.WorkManagerTaskExecutor
All Implemented Interfaces:
Executor, WorkManager, InitializingBean, AsyncTaskExecutor, TaskExecutor, BootstrapContextAware, SchedulingTaskExecutor
Direct Known Subclasses:
GlassFishWorkManagerTaskExecutor, JBossWorkManagerTaskExecutor
public class WorkManagerTaskExecutor
extends JndiLocatorSupport
implements SchedulingTaskExecutor, AsyncTaskExecutor, WorkManager, BootstrapContextAware, InitializingBean

TaskExecutor implementation that delegates to a JCA 1.5 WorkManager, implementing the WorkManager interface.

This is mainly intended for use within a JCA ResourceAdapter implementation, but may also be used in a standalone environment, delegating to a locally embedded WorkManager implementation (such as Geronimo's).

Also implements the JCA 1.5 WorkManager interface itself, delegating all calls to the target WorkManager. Hence, a caller can choose whether it wants to talk to this executor through the Spring TaskExecutor interface or the JCA 1.5 WorkManager interface.

This adapter is also capable of obtaining a JCA WorkManager from JNDI. This is for example appropriate on the Geronimo application server, where WorkManager GBeans (e.g. Geronimo's default "DefaultWorkManager" GBean) can be linked into the J2EE environment through "gbean-ref" entries in the geronimo-web.xml deployment descriptor.

On JBoss and GlassFish, obtaining the default JCA WorkManager requires special lookup steps. See the JBossWorkManagerTaskExecutor GlassFishWorkManagerTaskExecutor classes which are the direct equivalent of this generic JCA adapter class.

Since:
2.0.3
Author:
Juergen Hoeller
See Also:
setWorkManager(javax.resource.spi.work.WorkManager), WorkManager.scheduleWork(javax.resource.spi.work.Work)

Field Summary
Fields inherited from class org.springframework.jndi.JndiLocatorSupport
CONTAINER_PREFIX
Fields inherited from class org.springframework.jndi.JndiAccessor
logger
Fields inherited from interface org.springframework.core.task.AsyncTaskExecutor
TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE
Fields inherited from interface javax.resource.spi.work.WorkManager
IMMEDIATE, INDEFINITE, UNKNOWN
Constructor Summary
WorkManagerTaskExecutor()
Create a new WorkManagerTaskExecutor, expecting bean-style configuration.
WorkManagerTaskExecutor(WorkManager workManager)
Create a new WorkManagerTaskExecutor for the given WorkManager.
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 void doWork(Work work)
 void doWork(Work work, long delay, ExecutionContext executionContext, WorkListener workListener)
 void execute(Runnable task)
Execute the given task.
 void execute(Runnable task, long startTimeout)
Execute the given task.
protected  WorkManager getDefaultWorkManager()
Obtain a default WorkManager to delegate to.
 boolean prefersShortLivedTasks()
This task executor prefers short-lived work units.
 void scheduleWork(Work work)
 void scheduleWork(Work work, long delay, ExecutionContext executionContext, WorkListener workListener)
 void setBlockUntilCompleted(boolean blockUntilCompleted)
Set whether to let execute(java.lang.Runnable) block until the work has been completed.
 void setBlockUntilStarted(boolean blockUntilStarted)
Set whether to let execute(java.lang.Runnable) block until the work has been actually started.
 void setBootstrapContext(BootstrapContext bootstrapContext)
Specify the JCA BootstrapContext that contains the WorkManager to delegate to.
 void setWorkListener(WorkListener workListener)
Specify a JCA 1.5 WorkListener to apply, if any.
 void setWorkManager(WorkManager workManager)
Specify the JCA WorkManager instance to delegate to.
 void setWorkManagerName(String workManagerName)
Set the JNDI name of the JCA WorkManager.
 long startWork(Work work)
 long startWork(Work work, long delay, ExecutionContext executionContext, WorkListener workListener)
<T> Future<T>
submit(Callable<T> task)
Submit a Callable task for execution, receiving a Future representing that task.
 Future<?> submit(Runnable task)
Submit a Runnable task for execution, receiving a Future representing that task.
Methods inherited from class org.springframework.jndi.JndiLocatorSupport
convertJndiName, isResourceRef, lookup, lookup, setResourceRef
Methods inherited from class org.springframework.jndi.JndiAccessor
getJndiEnvironment, getJndiTemplate, setJndiEnvironment, setJndiTemplate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

WorkManagerTaskExecutor

public WorkManagerTaskExecutor()
Create a new WorkManagerTaskExecutor, expecting bean-style configuration.

See Also:
setWorkManager(javax.resource.spi.work.WorkManager)

WorkManagerTaskExecutor

public WorkManagerTaskExecutor(WorkManager workManager)
Create a new WorkManagerTaskExecutor for the given WorkManager.

Parameters:
workManager - the JCA WorkManager to delegate to
Method Detail

setWorkManager

public void setWorkManager(WorkManager workManager)
Specify the JCA WorkManager instance to delegate to.

setWorkManagerName

public void setWorkManagerName(String workManagerName)
Set the JNDI name of the JCA WorkManager.

This can either be a fully qualified JNDI name, or the JNDI name relative to the current environment naming context if "resourceRef" is set to "true".

See Also:
setWorkManager(javax.resource.spi.work.WorkManager), JndiLocatorSupport.setResourceRef(boolean)

setBootstrapContext

public void setBootstrapContext(BootstrapContext bootstrapContext)
Specify the JCA BootstrapContext that contains the WorkManager to delegate to.

Specified by:
setBootstrapContext in interface BootstrapContextAware
Parameters:
bootstrapContext - BootstrapContext object to be used by this object
See Also:
InitializingBean.afterPropertiesSet(), ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)

setBlockUntilStarted

public void setBlockUntilStarted(boolean blockUntilStarted)
Set whether to let execute(java.lang.Runnable) block until the work has been actually started.

Uses the JCA startWork operation underneath, instead of the default scheduleWork.

See Also:
WorkManager.startWork(javax.resource.spi.work.Work), WorkManager.scheduleWork(javax.resource.spi.work.Work)

setBlockUntilCompleted

public void setBlockUntilCompleted(boolean blockUntilCompleted)
Set whether to let execute(java.lang.Runnable) block until the work has been completed.

Uses the JCA doWork operation underneath, instead of the default scheduleWork.

See Also:
WorkManager.doWork(javax.resource.spi.work.Work), WorkManager.scheduleWork(javax.resource.spi.work.Work)

setWorkListener

public void setWorkListener(WorkListener workListener)
Specify a JCA 1.5 WorkListener to apply, if any.

This shared WorkListener instance will be passed on to the WorkManager by all execute(java.lang.Runnable) calls on this TaskExecutor.

afterPropertiesSet

public void afterPropertiesSet()
                        throws NamingException
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
NamingException

getDefaultWorkManager

protected WorkManager getDefaultWorkManager()
Obtain a default WorkManager to delegate to. Called if no explicit WorkManager or WorkManager JNDI name has been specified.

The default implementation returns a SimpleTaskWorkManager. Can be overridden in subclasses.

execute

public void execute(Runnable task)
Description copied from interface: TaskExecutor
Execute the given task.

The call might return immediately if the implementation uses an asynchronous execution strategy, or might block in the case of synchronous execution.

Specified by:
execute in interface Executor
Specified by:
execute in interface TaskExecutor
Parameters:
task - the Runnable to execute (never null)

execute

public void execute(Runnable task,
                    long startTimeout)
Description copied from interface: AsyncTaskExecutor
Execute the given task.

Specified by:
execute in interface AsyncTaskExecutor
Parameters:
task - the Runnable to execute (never null)
startTimeout - the time duration (milliseconds) within which the task is supposed to start. This is intended as a hint to the executor, allowing for preferred handling of immediate tasks. Typical values are AsyncTaskExecutor.TIMEOUT_IMMEDIATE or AsyncTaskExecutor.TIMEOUT_INDEFINITE (the default as used by TaskExecutor.execute(Runnable)).

submit

public Future<?> submit(Runnable task)
Description copied from interface: AsyncTaskExecutor
Submit a Runnable task for execution, receiving a Future representing that task. The Future will return a null result upon completion.

Specified by:
submit in interface AsyncTaskExecutor
Parameters:
task - the Runnable to execute (never null)
Returns:
a Future representing pending completion of the task

submit

public <T> Future<T> submit(Callable<T> task)
Description copied from interface: AsyncTaskExecutor
Submit a Callable task for execution, receiving a Future representing that task. The Future will return the Callable's result upon completion.

Specified by:
submit in interface AsyncTaskExecutor
Parameters:
task - the Callable to execute (never null)
Returns:
a Future representing pending completion of the task

prefersShortLivedTasks

public boolean prefersShortLivedTasks()
This task executor prefers short-lived work units.

Specified by:
prefersShortLivedTasks in interface SchedulingTaskExecutor
Returns:
true if this TaskExecutor prefers short-lived tasks

doWork

public void doWork(Work work)
            throws WorkException
Specified by:
doWork in interface WorkManager
Throws:
WorkException

doWork

public void doWork(Work work,
                   long delay,
                   ExecutionContext executionContext,
                   WorkListener workListener)
            throws WorkException
Specified by:
doWork in interface WorkManager
Throws:
WorkException

startWork

public long startWork(Work work)
               throws WorkException
Specified by:
startWork in interface WorkManager
Throws:
WorkException

startWork

public long startWork(Work work,
                      long delay,
                      ExecutionContext executionContext,
                      WorkListener workListener)
               throws WorkException
Specified by:
startWork in interface WorkManager
Throws:
WorkException

scheduleWork

public void scheduleWork(Work work)
                  throws WorkException
Specified by:
scheduleWork in interface WorkManager
Throws:
WorkException

scheduleWork

public void scheduleWork(Work work,
                         long delay,
                         ExecutionContext executionContext,
                         WorkListener workListener)
                  throws WorkException
Specified by:
scheduleWork in interface WorkManager
Throws:
WorkException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jca.work.glassfish

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jca.work.glassfish

Convenience package for obtaining a GlassFish JCA WorkManager for use in web applications.

See:
Description

Class Summary
GlassFishWorkManagerTaskExecutor Spring TaskExecutor adapter for the GlassFish JCA WorkManager.

Package org.springframework.jca.work.glassfish Description

Convenience package for obtaining a GlassFish JCA WorkManager for use in web applications. Provides a Spring TaskExecutor adapter for GlassFish.


org.springframework.jca.work.glassfish Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jca.work.glassfish

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jndi.JndiAccessor
      • org.springframework.jndi.JndiLocatorSupport
        • org.springframework.jca.work.WorkManagerTaskExecutor (implements org.springframework.core.task.AsyncTaskExecutor, org.springframework.jca.context.BootstrapContextAware, org.springframework.beans.factory.InitializingBean, org.springframework.scheduling.SchedulingTaskExecutor, javax.resource.spi.work.WorkManager)
          • org.springframework.jca.work.glassfish.GlassFishWorkManagerTaskExecutor


GlassFishWorkManagerTaskExecutor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jca.work.glassfish
Class GlassFishWorkManagerTaskExecutor

java.lang.Object
    extended by  org.springframework.jndi.JndiAccessor
        extended by  org.springframework.jndi.JndiLocatorSupport
            extended by  org.springframework.jca.work.WorkManagerTaskExecutor
                extended by  org.springframework.jca.work.glassfish.GlassFishWorkManagerTaskExecutor
All Implemented Interfaces:
Executor, WorkManager, InitializingBean, AsyncTaskExecutor, TaskExecutor, BootstrapContextAware, SchedulingTaskExecutor
public class GlassFishWorkManagerTaskExecutor
extends WorkManagerTaskExecutor

Spring TaskExecutor adapter for the GlassFish JCA WorkManager. Can be defined in web applications to make a TaskExecutor reference available, talking to the GlassFish WorkManager (thread pool) underneath.

This is the GlassFish equivalent of the CommonJ WorkManagerTaskExecutor adapter for WebLogic and WebSphere.

Since:
2.5.2
Author:
Juergen Hoeller
See Also:
com.sun.enterprise.connectors.work.WorkManagerFactory

Field Summary
Fields inherited from class org.springframework.jndi.JndiLocatorSupport
CONTAINER_PREFIX
Fields inherited from class org.springframework.jndi.JndiAccessor
logger
Fields inherited from interface org.springframework.core.task.AsyncTaskExecutor
TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE
Fields inherited from interface javax.resource.spi.work.WorkManager
IMMEDIATE, INDEFINITE, UNKNOWN
Constructor Summary
GlassFishWorkManagerTaskExecutor()
Method Summary
protected WorkManager | getDefaultWorkManager() Obtains GlassFish's default thread pool.
void | setThreadPoolName(String threadPoolName) Identify a specific GlassFish thread pool to talk to.
Methods inherited from class org.springframework.jca.work.WorkManagerTaskExecutor
afterPropertiesSet, doWork, doWork, execute, execute, prefersShortLivedTasks, scheduleWork, scheduleWork, setBlockUntilCompleted, setBlockUntilStarted, setBootstrapContext, setWorkListener, setWorkManager, setWorkManagerName, startWork, startWork, submit, submit
Methods inherited from class org.springframework.jndi.JndiLocatorSupport
convertJndiName, isResourceRef, lookup, lookup, setResourceRef
Methods inherited from class org.springframework.jndi.JndiAccessor
getJndiEnvironment, getJndiTemplate, setJndiEnvironment, setJndiTemplate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

GlassFishWorkManagerTaskExecutor

public GlassFishWorkManagerTaskExecutor()
Method Detail

setThreadPoolName

public void setThreadPoolName(String threadPoolName)
Identify a specific GlassFish thread pool to talk to.

The thread pool name matches the resource adapter name in default RAR deployment scenarios.

getDefaultWorkManager

protected WorkManager getDefaultWorkManager()
Obtains GlassFish's default thread pool.

Overrides:
getDefaultWorkManager in class WorkManagerTaskExecutor
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jca.work.jboss

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jca.work.jboss

Convenience package for obtaining a JBoss JCA WorkManager for use in web applications.

See:
Description

Class Summary
JBossWorkManagerTaskExecutor | Spring TaskExecutor adapter for the JBoss JCA WorkManager.
JBossWorkManagerUtils | Utility class for obtaining the JBoss JCA WorkManager, typically for use in web applications.

Package org.springframework.jca.work.jboss Description

Convenience package for obtaining a JBoss JCA WorkManager for use in web applications. Provides a Spring TaskExecutor adapter for JBoss.


org.springframework.jca.work.jboss Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jca.work.jboss

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jca.work.jboss.JBossWorkManagerUtils
    • org.springframework.jndi.JndiAccessor
      • org.springframework.jndi.JndiLocatorSupport
        • org.springframework.jca.work.WorkManagerTaskExecutor (implements org.springframework.core.task.AsyncTaskExecutor, org.springframework.jca.context.BootstrapContextAware, org.springframework.beans.factory.InitializingBean, org.springframework.scheduling.SchedulingTaskExecutor, javax.resource.spi.work.WorkManager)
          • org.springframework.jca.work.jboss.JBossWorkManagerTaskExecutor


JBossWorkManagerTaskExecutor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jca.work.jboss
Class JBossWorkManagerTaskExecutor

java.lang.Object
    extended by  org.springframework.jndi.JndiAccessor
        extended by  org.springframework.jndi.JndiLocatorSupport
            extended by  org.springframework.jca.work.WorkManagerTaskExecutor
                extended by  org.springframework.jca.work.jboss.JBossWorkManagerTaskExecutor
All Implemented Interfaces:
Executor, WorkManager, InitializingBean, AsyncTaskExecutor, TaskExecutor, BootstrapContextAware, SchedulingTaskExecutor
public class JBossWorkManagerTaskExecutor
extends WorkManagerTaskExecutor

Spring TaskExecutor adapter for the JBoss JCA WorkManager. Can be defined in web applications to make a TaskExecutor reference available, talking to the JBoss WorkManager (thread pool) underneath.

This is the JBoss equivalent of the CommonJ WorkManagerTaskExecutor adapter for WebLogic and WebSphere.

Since:
2.5.2
Author:
Juergen Hoeller
See Also:
org.jboss.resource.work.JBossWorkManagerMBean

Field Summary
Fields inherited from class org.springframework.jndi.JndiLocatorSupport
CONTAINER_PREFIX
Fields inherited from class org.springframework.jndi.JndiAccessor
logger
Fields inherited from interface org.springframework.core.task.AsyncTaskExecutor
TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE
Fields inherited from interface javax.resource.spi.work.WorkManager
IMMEDIATE, INDEFINITE, UNKNOWN
Constructor Summary
JBossWorkManagerTaskExecutor()
Method Summary
protected WorkManager | getDefaultWorkManager() Obtains the default JBoss JCA WorkManager through a JMX lookup for the JBossWorkManagerMBean.
void | setWorkManagerMBeanName(String mbeanName) Identify a specific JBossWorkManagerMBean to talk to, through its JMX object name.
Methods inherited from class org.springframework.jca.work.WorkManagerTaskExecutor
afterPropertiesSet, doWork, doWork, execute, execute, prefersShortLivedTasks, scheduleWork, scheduleWork, setBlockUntilCompleted, setBlockUntilStarted, setBootstrapContext, setWorkListener, setWorkManager, setWorkManagerName, startWork, startWork, submit, submit
Methods inherited from class org.springframework.jndi.JndiLocatorSupport
convertJndiName, isResourceRef, lookup, lookup, setResourceRef
Methods inherited from class org.springframework.jndi.JndiAccessor
getJndiEnvironment, getJndiTemplate, setJndiEnvironment, setJndiTemplate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JBossWorkManagerTaskExecutor

public JBossWorkManagerTaskExecutor()
Method Detail

setWorkManagerMBeanName

public void setWorkManagerMBeanName(String mbeanName)
Identify a specific JBossWorkManagerMBean to talk to, through its JMX object name.

The default MBean name is "jboss.jca:service=WorkManager".

See Also:
JBossWorkManagerUtils.getWorkManager(String)

getDefaultWorkManager

protected WorkManager getDefaultWorkManager()
Obtains the default JBoss JCA WorkManager through a JMX lookup for the JBossWorkManagerMBean.

Overrides:
getDefaultWorkManager in class WorkManagerTaskExecutor
See Also:
JBossWorkManagerUtils.getWorkManager()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


JBossWorkManagerUtils

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jca.work.jboss
Class JBossWorkManagerUtils

java.lang.Object
    extended by  org.springframework.jca.work.jboss.JBossWorkManagerUtils

public abstract class JBossWorkManagerUtils
extends Object

Utility class for obtaining the JBoss JCA WorkManager, typically for use in web applications.

Since:
2.5.2
Author:
Juergen Hoeller

Constructor Summary
JBossWorkManagerUtils()
Method Summary
static WorkManager | getWorkManager() Obtain the default JBoss JCA WorkManager through a JMX lookup for the default JBossWorkManagerMBean.
static WorkManager | getWorkManager(String mbeanName) Obtain the default JBoss JCA WorkManager through a JMX lookup for the JBossWorkManagerMBean.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JBossWorkManagerUtils

public JBossWorkManagerUtils()
Method Detail

getWorkManager

public static WorkManager getWorkManager()
Obtain the default JBoss JCA WorkManager through a JMX lookup for the default JBossWorkManagerMBean.

See Also:
org.jboss.resource.work.JBossWorkManagerMBean

getWorkManager

public static WorkManager getWorkManager(String mbeanName)
Obtain the default JBoss JCA WorkManager through a JMX lookup for the JBossWorkManagerMBean.

Parameters:
workManagerObjectName - the JMX object name to use
See Also:
org.jboss.resource.work.JBossWorkManagerMBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jdbc

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jdbc

The classes in this package make JDBC easier to use and reduce the likelihood of common errors.

See:
Description

Exception Summary
BadSqlGrammarException | Exception thrown when SQL specified is invalid.
CannotGetJdbcConnectionException | Fatal exception thrown when we can't connect to an RDBMS using JDBC.
IncorrectResultSetColumnCountException | Data access exception thrown when a result set did not have the correct column count, for example when expecting a single column but getting 0 or more than 1 columns.
InvalidResultSetAccessException | Exception thrown when a ResultSet has been accessed in an invalid fashion.
JdbcUpdateAffectedIncorrectNumberOfRowsException | Exception thrown when a JDBC update affects an unexpected number of rows.
LobRetrievalFailureException | Exception to be thrown when a LOB could not be retrieved.
SQLWarningException | Exception thrown when we're not ignoring SQLWarnings.
UncategorizedSQLException | Exception thrown when we can't classify a SQLException into one of our generic data access exceptions.

Package org.springframework.jdbc Description

The classes in this package make JDBC easier to use and reduce the likelihood of common errors. In particular, they:

  • Simplify error handling, avoiding the need for try/catch/final blocks in application code.
  • Present exceptions to application code in a generic hierarchy of unchecked exceptions, enabling applications to catch data access exceptions without being dependent on JDBC, and to ignore fatal exceptions there is no value in catching.
  • Allow the implementation of error handling to be modified to target different RDBMSes without introducing proprietary dependencies into application code.

This package and related packages are discussed in Chapter 9 of Expert One-On-One J2EE Design and Development by Rod Johnson (Wrox, 2002).


org.springframework.jdbc Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jdbc

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.dao.DataAccessException
              • org.springframework.dao.NonTransientDataAccessException
                • org.springframework.dao.DataRetrievalFailureException
                  • org.springframework.jdbc.IncorrectResultSetColumnCountException
                  • org.springframework.jdbc.LobRetrievalFailureException
                • org.springframework.dao.InvalidDataAccessResourceUsageException
                  • org.springframework.jdbc.BadSqlGrammarException
                  • org.springframework.dao.IncorrectUpdateSemanticsDataAccessException
                    • org.springframework.jdbc.JdbcUpdateAffectedIncorrectNumberOfRowsException
                  • org.springframework.jdbc.InvalidResultSetAccessException
                • org.springframework.dao.NonTransientDataAccessResourceException
                  • org.springframework.dao.DataAccessResourceFailureException
                    • org.springframework.jdbc.CannotGetJdbcConnectionException
                • org.springframework.dao.UncategorizedDataAccessException
                  • org.springframework.jdbc.SQLWarningException
                  • org.springframework.jdbc.UncategorizedSQLException


BadSqlGrammarException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc
Class BadSqlGrammarException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.InvalidDataAccessResourceUsageException
                                extended by  org.springframework.jdbc.BadSqlGrammarException
All Implemented Interfaces:
Serializable
public class BadSqlGrammarException
extends InvalidDataAccessResourceUsageException

Exception thrown when SQL specified is invalid. Such exceptions always have a java.sql.SQLException root cause.

It would be possible to have subclasses for no such table, no such column etc. A custom SQLExceptionTranslator could create such more specific exceptions, without affecting code using this class.

Author:
Rod Johnson
See Also:
InvalidResultSetAccessException, Serialized Form

Constructor Summary
BadSqlGrammarException(String task, String sql, SQLException ex)
Constructor for BadSqlGrammarException.
Method Summary
String | getSql() Return the SQL that caused the problem.
SQLException | getSQLException() Return the wrapped SQLException.
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

BadSqlGrammarException

public BadSqlGrammarException(String task,
                              String sql,
                              SQLException ex)
Constructor for BadSqlGrammarException.

Parameters:
task - name of current task
sql - the offending SQL statement
ex - the root cause
Method Detail

getSQLException

public SQLException getSQLException()
Return the wrapped SQLException.

getSql

public String getSql()
Return the SQL that caused the problem.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


CannotGetJdbcConnectionException

org.springframework.jdbc
Class CannotGetJdbcConnectionException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.NonTransientDataAccessResourceException
                                extended by  org.springframework.dao.DataAccessResourceFailureException
                                    extended by  org.springframework.jdbc.CannotGetJdbcConnectionException
All Implemented Interfaces:
Serializable
public class CannotGetJdbcConnectionException
extends DataAccessResourceFailureException

Fatal exception thrown when we can't connect to an RDBMS using JDBC.

Author:
Rod Johnson
See Also:
Serialized Form

Constructor Summary
CannotGetJdbcConnectionException(String msg, ClassNotFoundException ex)
Deprecated. since Spring 2.5, in favor of throwing an IllegalStateException in case of the driver not being found
CannotGetJdbcConnectionException(String msg, SQLException ex)
Constructor for CannotGetJdbcConnectionException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

CannotGetJdbcConnectionException

public CannotGetJdbcConnectionException(String msg,
                                        SQLException ex)
Constructor for CannotGetJdbcConnectionException.

Parameters:
msg - the detail message
ex - SQLException root cause

CannotGetJdbcConnectionException

@Deprecated
public CannotGetJdbcConnectionException(String msg,
                                                   ClassNotFoundException ex)
Deprecated. since Spring 2.5, in favor of throwing an IllegalStateException in case of the driver not being found

Constructor for CannotGetJdbcConnectionException.

Parameters:
msg - the detail message
ex - ClassNotFoundException root cause
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


IncorrectResultSetColumnCountException

org.springframework.jdbc
Class IncorrectResultSetColumnCountException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.DataRetrievalFailureException
                                extended by  org.springframework.jdbc.IncorrectResultSetColumnCountException
All Implemented Interfaces:
Serializable
public class IncorrectResultSetColumnCountException
extends DataRetrievalFailureException

Data access exception thrown when a result set did not have the correct column count, for example when expecting a single column but getting 0 or more than 1 columns.

Since:
2.0
Author:
Juergen Hoeller
See Also:
IncorrectResultSizeDataAccessException, Serialized Form

Constructor Summary
IncorrectResultSetColumnCountException(int expectedCount, int actualCount)
Constructor for IncorrectResultSetColumnCountException.
IncorrectResultSetColumnCountException(String msg, int expectedCount, int actualCount)
Constructor for IncorrectResultCountDataAccessException.
Method Summary
int | getActualCount() Return the actual column count.
int | getExpectedCount() Return the expected column count.
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

IncorrectResultSetColumnCountException

public IncorrectResultSetColumnCountException(int expectedCount,
                                              int actualCount)
Constructor for IncorrectResultSetColumnCountException.

Parameters:
expectedCount - the expected column count
actualCount - the actual column count

IncorrectResultSetColumnCountException

public IncorrectResultSetColumnCountException(String msg,
                                              int expectedCount,
                                              int actualCount)
Constructor for IncorrectResultCountDataAccessException.

Parameters:
msg - the detail message
expectedCount - the expected column count
actualCount - the actual column count
Method Detail

getExpectedCount

public int getExpectedCount()
Return the expected column count.

getActualCount

public int getActualCount()
Return the actual column count.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InvalidResultSetAccessException

org.springframework.jdbc
Class InvalidResultSetAccessException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.InvalidDataAccessResourceUsageException
                                extended by  org.springframework.jdbc.InvalidResultSetAccessException
All Implemented Interfaces:
Serializable
public class InvalidResultSetAccessException
extends InvalidDataAccessResourceUsageException

Exception thrown when a ResultSet has been accessed in an invalid fashion. Such exceptions always have a java.sql.SQLException root cause.

This typically happens when an invalid ResultSet column index or name has been specified. Also thrown by disconnected SqlRowSets.

Since:
1.2
Author:
Juergen Hoeller
See Also:
BadSqlGrammarException, SqlRowSet, Serialized Form

Constructor Summary
InvalidResultSetAccessException(SQLException ex)
Constructor for InvalidResultSetAccessException.
InvalidResultSetAccessException(String task, String sql, SQLException ex)
Constructor for InvalidResultSetAccessException.
Method Summary
String | getSql() Return the SQL that caused the problem.
SQLException | getSQLException() Return the wrapped SQLException.
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

InvalidResultSetAccessException

public InvalidResultSetAccessException(String task,
                                       String sql,
                                       SQLException ex)
Constructor for InvalidResultSetAccessException.

Parameters:
task - name of current task
sql - the offending SQL statement
ex - the root cause

InvalidResultSetAccessException

public InvalidResultSetAccessException(SQLException ex)
Constructor for InvalidResultSetAccessException.

Parameters:
ex - the root cause
Method Detail

getSQLException

public SQLException getSQLException()
Return the wrapped SQLException.

getSql

public String getSql()
Return the SQL that caused the problem.

Returns:
the offending SQL, if known
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JdbcUpdateAffectedIncorrectNumberOfRowsException

org.springframework.jdbc
Class JdbcUpdateAffectedIncorrectNumberOfRowsException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.InvalidDataAccessResourceUsageException
                                extended by  org.springframework.dao.IncorrectUpdateSemanticsDataAccessException
                                    extended by  org.springframework.jdbc.JdbcUpdateAffectedIncorrectNumberOfRowsException
All Implemented Interfaces:
Serializable
public class JdbcUpdateAffectedIncorrectNumberOfRowsException
extends IncorrectUpdateSemanticsDataAccessException

Exception thrown when a JDBC update affects an unexpected number of rows. Typically we expect an update to affect a single row, meaning it's an error if it affects multiple rows.

Author:
Rod Johnson, Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
JdbcUpdateAffectedIncorrectNumberOfRowsException(String sql, int expected, int actual)
Constructor for JdbcUpdateAffectedIncorrectNumberOfRowsException.
Method Summary
int | getActualRowsAffected() Return the number of rows that have actually been affected.
int | getExpectedRowsAffected() Return the number of rows that should have been affected.
boolean | wasDataUpdated() Return whether data was updated.
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

JdbcUpdateAffectedIncorrectNumberOfRowsException

public JdbcUpdateAffectedIncorrectNumberOfRowsException(String sql,
                                                        int expected,
                                                        int actual)
Constructor for JdbcUpdateAffectedIncorrectNumberOfRowsException.

Parameters:
sql - SQL we were tring to execute
expected - the expected number of rows affected
actual - the actual number of rows affected
Method Detail

getExpectedRowsAffected

public int getExpectedRowsAffected()
Return the number of rows that should have been affected.

getActualRowsAffected

public int getActualRowsAffected()
Return the number of rows that have actually been affected.

wasDataUpdated

public boolean wasDataUpdated()
Description copied from class: IncorrectUpdateSemanticsDataAccessException
Return whether data was updated. If this method returns false, there's nothing to roll back.

The default implementation always returns true. This can be overridden in subclasses.

Overrides:
wasDataUpdated in class IncorrectUpdateSemanticsDataAccessException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LobRetrievalFailureException

org.springframework.jdbc
Class LobRetrievalFailureException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.DataRetrievalFailureException
                                extended by  org.springframework.jdbc.LobRetrievalFailureException
All Implemented Interfaces:
Serializable
public class LobRetrievalFailureException
extends DataRetrievalFailureException

Exception to be thrown when a LOB could not be retrieved.

Since:
1.0.2
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
LobRetrievalFailureException(String msg)
Constructor for LobRetrievalFailureException.
LobRetrievalFailureException(String msg, IOException ex)
Constructor for LobRetrievalFailureException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

LobRetrievalFailureException

public LobRetrievalFailureException(String msg)
Constructor for LobRetrievalFailureException.

Parameters:
msg - the detail message

LobRetrievalFailureException

public LobRetrievalFailureException(String msg,
                                    IOException ex)
Constructor for LobRetrievalFailureException.

Parameters:
msg - the detail message
ex - IOException root cause
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SQLWarningException

org.springframework.jdbc
Class SQLWarningException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.UncategorizedDataAccessException
                                extended by  org.springframework.jdbc.SQLWarningException
All Implemented Interfaces:
Serializable
public class SQLWarningException
extends UncategorizedDataAccessException

Exception thrown when we're not ignoring SQLWarnings.

If a SQLWarning is reported, the operation completed, so we will need to explicitly roll it back if we're not happy when looking at the warning. We might choose to ignore (and log) the warning, or to wrap and throw it in the shape of this SQLWarningException instead.

Author:
Rod Johnson, Juergen Hoeller
See Also:
JdbcTemplate.setIgnoreWarnings(boolean), Serialized Form

Constructor Summary
SQLWarningException(String msg, SQLWarning ex)
Constructor for SQLWarningException.
Method Summary
 SQLWarning SQLWarning()
Return the underlying SQLWarning.
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

SQLWarningException

public SQLWarningException(String msg,
                           SQLWarning ex)
Constructor for SQLWarningException.

Parameters:
msg - the detail message
ex - the JDBC warning
Method Detail

SQLWarning

public SQLWarning SQLWarning()
Return the underlying SQLWarning.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UncategorizedSQLException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc
Class UncategorizedSQLException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.UncategorizedDataAccessException
                                extended by  org.springframework.jdbc.UncategorizedSQLException
All Implemented Interfaces:
Serializable
public class UncategorizedSQLException
extends UncategorizedDataAccessException

Exception thrown when we can't classify a SQLException into one of our generic data access exceptions.

Author:
Rod Johnson, Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
UncategorizedSQLException(String task, String sql, SQLException ex)
Constructor for UncategorizedSQLException.
Method Summary
String | getSql() Return the SQL that led to the problem.
SQLException | getSQLException() Return the underlying SQLException.
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

UncategorizedSQLException

public UncategorizedSQLException(String task,
                                 String sql,
                                 SQLException ex)
Constructor for UncategorizedSQLException.

Parameters:
task - name of current task
sql - the offending SQL statement
ex - the root cause
Method Detail

getSQLException

public SQLException getSQLException()
Return the underlying SQLException.

getSql

public String getSql()
Return the SQL that led to the problem.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jdbc.config

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jdbc.config

Defines the Spring JDBC configuration namespace.

See:
Description

Class Summary
EmbeddedDatabaseBeanDefinitionParser | BeanDefinitionParser that parses embedded-database element and creates a BeanDefinition for EmbeddedDatabaseFactoryBean.
InitializeDatabaseBeanDefinitionParser | BeanDefinitionParser that parses an initialize-database element and creates a BeanDefinition of type DataSourceInitializer.
JdbcNamespaceHandler | NamespaceHandler for JDBC configuration namespace.
SortedResourcesFactoryBean | FactoryBean implementation that takes a list of location Strings and creates a sorted array of Resource instances.

Package org.springframework.jdbc.config Description

Defines the Spring JDBC configuration namespace.


org.springframework.jdbc.config Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jdbc.config

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.beans.factory.xml.AbstractBeanDefinitionParser (implements org.springframework.beans.factory.xml.BeanDefinitionParser)
      • org.springframework.jdbc.config.EmbeddedDatabaseBeanDefinitionParser
      • org.springframework.jdbc.config.InitializeDatabaseBeanDefinitionParser
    • org.springframework.beans.factory.config.AbstractFactoryBean<T> (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
      • org.springframework.jdbc.config.SortedResourcesFactoryBean (implements org.springframework.context.ResourceLoaderAware)
    • org.springframework.beans.factory.xml.NamespaceHandlerSupport (implements org.springframework.beans.factory.xml.NamespaceHandler)
      • org.springframework.jdbc.config.JdbcNamespaceHandler


EmbeddedDatabaseBeanDefinitionParser

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.config
Class EmbeddedDatabaseBeanDefinitionParser

java.lang.Object
    extended by  org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
        extended by  org.springframework.jdbc.config.EmbeddedDatabaseBeanDefinitionParser
All Implemented Interfaces:
BeanDefinitionParser
public class EmbeddedDatabaseBeanDefinitionParser
extends AbstractBeanDefinitionParser

BeanDefinitionParser that parses embedded-database element and creates a BeanDefinition for EmbeddedDatabaseFactoryBean. Picks up nested script elements and configures a ResourceDatabasePopulator for them.

Since:
3.0
Author:
Oliver Gierke

Field Summary
Fields inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
ID_ATTRIBUTE, NAME_ATTRIBUTE
Constructor Summary
EmbeddedDatabaseBeanDefinitionParser()
Method Summary
protected  AbstractBeanDefinition parseInternal(Element element, ParserContext context)
Central template method to actually parse the supplied Element into one or more BeanDefinitions.
Methods inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
parse, postProcessComponentDefinition, registerBeanDefinition, resolveId, shouldFireEvents, shouldGenerateId, shouldGenerateIdAsFallback
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

EmbeddedDatabaseBeanDefinitionParser

public EmbeddedDatabaseBeanDefinitionParser()
Method Detail

parseInternal

protected AbstractBeanDefinition parseInternal(Element element,
                                               ParserContext context)
Description copied from class: AbstractBeanDefinitionParser
Central template method to actually parse the supplied Element into one or more BeanDefinitions.

Specified by:
parseInternal in class AbstractBeanDefinitionParser
Parameters:
element - the element that is to be parsed into one or more BeanDefinitions
context - the object encapsulating the current state of the parsing process; provides access to a BeanDefinitionRegistry
Returns:
the primary BeanDefinition resulting from the parsing of the supplied Element
See Also:
AbstractBeanDefinitionParser.parse(org.w3c.dom.Element, ParserContext), AbstractBeanDefinitionParser.postProcessComponentDefinition(org.springframework.beans.factory.parsing.BeanComponentDefinition)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


InitializeDatabaseBeanDefinitionParser

org.springframework.jdbc.config
Class InitializeDatabaseBeanDefinitionParser

java.lang.Object
    extended by  org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
        extended by  org.springframework.jdbc.config.InitializeDatabaseBeanDefinitionParser
All Implemented Interfaces:
BeanDefinitionParser
public class InitializeDatabaseBeanDefinitionParser
extends AbstractBeanDefinitionParser

BeanDefinitionParser that parses an initialize-database element and creates a BeanDefinition of type DataSourceInitializer. Picks up nested script elements and configures a ResourceDatabasePopulator for them.

Since:
3.0
Author:
Dave Syer

Field Summary
Fields inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
ID_ATTRIBUTE, NAME_ATTRIBUTE
Constructor Summary
InitializeDatabaseBeanDefinitionParser()
Method Summary
protected AbstractBeanDefinition | parseInternal(Element element, ParserContext context) Central template method to actually parse the supplied Element into one or more BeanDefinitions.
protected boolean | shouldGenerateId() Should an ID be generated instead of read from the passed in Element?
Methods inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
parse, postProcessComponentDefinition, registerBeanDefinition, resolveId, shouldFireEvents, shouldGenerateIdAsFallback
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

InitializeDatabaseBeanDefinitionParser

public InitializeDatabaseBeanDefinitionParser()
Method Detail

parseInternal

protected AbstractBeanDefinition parseInternal(Element element,
                                               ParserContext context)
Description copied from class: AbstractBeanDefinitionParser
Central template method to actually parse the supplied Element into one or more BeanDefinitions.

Specified by:
parseInternal in class AbstractBeanDefinitionParser
Parameters:
element - the element that is to be parsed into one or more BeanDefinitions
context - the object encapsulating the current state of the parsing process; provides access to a BeanDefinitionRegistry
Returns:
the primary BeanDefinition resulting from the parsing of the supplied Element
See Also:
AbstractBeanDefinitionParser.parse(org.w3c.dom.Element, ParserContext), AbstractBeanDefinitionParser.postProcessComponentDefinition(org.springframework.beans.factory.parsing.BeanComponentDefinition)

shouldGenerateId

protected boolean shouldGenerateId()
Description copied from class: AbstractBeanDefinitionParser
Should an ID be generated instead of read from the passed in Element?

Disabled by default; subclasses can override this to enable ID generation. Note that this flag is about always generating an ID; the parser won't even check for an "id" attribute in this case.

Overrides:
shouldGenerateId in class AbstractBeanDefinitionParser
Returns:
whether the parser should always generate an id
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JdbcNamespaceHandler

org.springframework.jdbc.config
Class JdbcNamespaceHandler

java.lang.Object
    extended by  org.springframework.beans.factory.xml.NamespaceHandlerSupport
        extended by  org.springframework.jdbc.config.JdbcNamespaceHandler
All Implemented Interfaces:
NamespaceHandler
public class JdbcNamespaceHandler
extends NamespaceHandlerSupport

NamespaceHandler for JDBC configuration namespace.

Author:
Oliver Gierke, Dave Syer

Constructor Summary
JdbcNamespaceHandler()
Method Summary
 void init()
Invoked by the DefaultBeanDefinitionDocumentReader after construction but before any custom elements are parsed.
Methods inherited from class org.springframework.beans.factory.xml.NamespaceHandlerSupport
decorate, parse, registerBeanDefinitionDecorator, registerBeanDefinitionDecoratorForAttribute, registerBeanDefinitionParser
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JdbcNamespaceHandler

public JdbcNamespaceHandler()
Method Detail

init

public void init()
Description copied from interface: NamespaceHandler
Invoked by the DefaultBeanDefinitionDocumentReader after construction but before any custom elements are parsed.

See Also:
NamespaceHandlerSupport.registerBeanDefinitionParser(String, BeanDefinitionParser)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SortedResourcesFactoryBean

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.config
Class SortedResourcesFactoryBean

java.lang.Object
    extended by  org.springframework.beans.factory.config.AbstractFactoryBean<Resource[]>
        extended by  org.springframework.jdbc.config.SortedResourcesFactoryBean
All Implemented Interfaces:
BeanClassLoaderAware, BeanFactoryAware, DisposableBean, FactoryBean<Resource[]>, InitializingBean, ResourceLoaderAware
public class SortedResourcesFactoryBean
extends AbstractFactoryBean<Resource[]>
implements ResourceLoaderAware

FactoryBean implementation that takes a list of location Strings and creates a sorted array of Resource instances.

Since:
3.0
Author:
Dave Syer, Juergen Hoeller, Christian Dupuis

Field Summary
Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
logger
Constructor Summary
SortedResourcesFactoryBean(List<String> locations)
SortedResourcesFactoryBean(ResourceLoader resourceLoader, List<String> locations)
Method Summary
protected Resource[] | createInstance() Template method that subclasses must override to construct the object returned by this factory.
Class<? extends Resource[]> | getObjectType() This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.
void | setResourceLoader(ResourceLoader resourceLoader) Set the ResourceLoader that this object runs in.
Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SortedResourcesFactoryBean

public SortedResourcesFactoryBean(List<String> locations)

SortedResourcesFactoryBean

public SortedResourcesFactoryBean(ResourceLoader resourceLoader,
                                  List<String> locations)
Method Detail

setResourceLoader

public void setResourceLoader(ResourceLoader resourceLoader)
Description copied from interface: ResourceLoaderAware
Set the ResourceLoader that this object runs in.

This might be a ResourcePatternResolver, which can be checked through instanceof ResourcePatternResolver. See also the ResourcePatternUtils.getResourcePatternResolver method.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked before ApplicationContextAware's setApplicationContext.

Specified by:
setResourceLoader in interface ResourceLoaderAware
Parameters:
resourceLoader - ResourceLoader object to be used by this object
See Also:
ResourcePatternResolver, ResourcePatternUtils.getResourcePatternResolver(org.springframework.core.io.ResourceLoader)

getObjectType

public Class<? extends Resource[]> getObjectType()
Description copied from class: AbstractFactoryBean
This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.

Specified by:
getObjectType in interface FactoryBean<Resource[]>
Specified by:
getObjectType in class AbstractFactoryBean<Resource[]>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
FactoryBean.getObjectType()

createInstance

protected Resource[] createInstance()
                             throws Exception
Description copied from class: AbstractFactoryBean
Template method that subclasses must override to construct the object returned by this factory.

Invoked on initialization of this FactoryBean in case of a singleton; else, on each AbstractFactoryBean.getObject() call.

Specified by:
createInstance in class AbstractFactoryBean<Resource[]>
Returns:
the object returned by this factory
Throws:
Exception - if an exception occured during object creation
See Also:
AbstractFactoryBean.getObject()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jdbc.core

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jdbc.core

Provides the core JDBC framework, based on JdbcTemplate and its associated callback interfaces and helper objects.

See:
Description

Interface Summary
BatchPreparedStatementSetter | Batch update callback interface used by the JdbcTemplate class.
CallableStatementCallback<T> | Generic callback interface for code that operates on a CallableStatement.
CallableStatementCreator | One of the three central callback interfaces used by the JdbcTemplate class.
ConnectionCallback<T> | Generic callback interface for code that operates on a JDBC Connection.
DisposableSqlTypeValue | Subinterface of SqlTypeValue that adds a cleanup callback, to be invoked after the value has been set and the corresponding statement has been executed.
InterruptibleBatchPreparedStatementSetter | Extension of the BatchPreparedStatementSetter interface, adding a batch exhaustion check.
JdbcOperations | Interface specifying a basic set of JDBC operations.
ParameterDisposer | Interface to be implemented by objects that can close resources allocated by parameters like SqlLobValues.
ParameterMapper | Implement this interface when parameters need to be customized based on the connection.
PreparedStatementCallback<T> | Generic callback interface for code that operates on a PreparedStatement.
PreparedStatementCreator | One of the two central callback interfaces used by the JdbcTemplate class.
PreparedStatementSetter | General callback interface used by the JdbcTemplate class.
ResultSetExtractor<T> | Callback interface used by JdbcTemplate's query methods.
RowCallbackHandler | An interface used by JdbcTemplate for processing rows of a ResultSet on a per-row basis.
RowMapper<T> | An interface used by JdbcTemplate for mapping rows of a ResultSet on a per-row basis.
SqlProvider | Interface to be implemented by objects that can provide SQL strings.
SqlReturnType | Interface to be implemented for retrieving values for more complex database-specific types not supported by the standard CallableStatement.getObject method.
SqlTypeValue | Interface to be implemented for setting values for more complex database-specific types not supported by the standard setObject method.
StatementCallback<T> | Generic callback interface for code that operates on a JDBC Statement.

Class Summary
BatchUpdateUtils | Generic utility methods for working with JDBC batch statements.
BeanPropertyRowMapper<T> | RowMapper implementation that converts a row into a new instance of the specified mapped target class.
CallableStatementCreatorFactory | Helper class that efficiently creates multiple CallableStatementCreator objects with different parameters based on a SQL statement and a single set of parameter declarations.
ColumnMapRowMapper | RowMapper implementation that creates a java.util.Map for each row, representing all columns as key-value pairs: one entry for each column, with the column name as key.
JdbcTemplate | This is the central class in the JDBC core package. It simplifies the use of JDBC and helps to avoid common errors.
PreparedStatementCreatorFactory | Helper class that efficiently creates multiple PreparedStatementCreator objects with different parameters based on a SQL statement and a single set of parameter declarations.
ResultSetSupportingSqlParameter | Common base class for ResultSet-supporting SqlParameters like SqlOutParameter and SqlReturnResultSet.
RowCountCallbackHandler | Implementation of RowCallbackHandler.
RowMapperResultSetExtractor<T> | Adapter implementation of the ResultSetExtractor interface that delegates to a RowMapper which is supposed to create an object for each row.
SingleColumnRowMapper<T> | RowMapper implementation that converts a single column into a single result value per row.
SqlInOutParameter | Subclass of SqlOutParameter to represent an INOUT parameter.
SqlOutParameter | Subclass of SqlParameter to represent an output parameter.
SqlParameter | Object to represent a SQL parameter definition.
SqlParameterValue | Object to represent a SQL parameter value, including parameter metadata such as the SQL type and the scale for numeric values.
SqlReturnResultSet | Represents a returned ResultSet from a stored procedure call.
SqlReturnUpdateCount | Represents a returned update count from a stored procedure call.
SqlRowSetResultSetExtractor | ResultSetExtractor implementation that returns a Spring SqlRowSet representation for each given ResultSet.
StatementCreatorUtils | Utility methods for PreparedStatementSetter/Creator and CallableStatementCreator implementations, providing sophisticated parameter management (including support for LOB values).

Package org.springframework.jdbc.core Description

Provides the core JDBC framework, based on JdbcTemplate and its associated callback interfaces and helper objects.


org.springframework.jdbc.core Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jdbc.core

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jdbc.core.BatchUpdateUtils
    • org.springframework.jdbc.core.BeanPropertyRowMapper<T> (implements org.springframework.jdbc.core.RowMapper<T>)
    • org.springframework.jdbc.core.CallableStatementCreatorFactory
    • org.springframework.jdbc.core.ColumnMapRowMapper (implements org.springframework.jdbc.core.RowMapper<T>)
    • org.springframework.jdbc.support.JdbcAccessor (implements org.springframework.beans.factory.InitializingBean)
      • org.springframework.jdbc.core.JdbcTemplate (implements org.springframework.jdbc.core.JdbcOperations)
    • org.springframework.jdbc.core.PreparedStatementCreatorFactory
    • org.springframework.jdbc.core.RowCountCallbackHandler (implements org.springframework.jdbc.core.RowCallbackHandler)
    • org.springframework.jdbc.core.RowMapperResultSetExtractor<T> (implements org.springframework.jdbc.core.ResultSetExtractor<T>)
    • org.springframework.jdbc.core.SingleColumnRowMapper<T> (implements org.springframework.jdbc.core.RowMapper<T>)
    • org.springframework.jdbc.core.SqlParameter
      • org.springframework.jdbc.core.ResultSetSupportingSqlParameter
        • org.springframework.jdbc.core.SqlOutParameter
          • org.springframework.jdbc.core.SqlInOutParameter
        • org.springframework.jdbc.core.SqlReturnResultSet
      • org.springframework.jdbc.core.SqlParameterValue
      • org.springframework.jdbc.core.SqlReturnUpdateCount
    • org.springframework.jdbc.core.SqlRowSetResultSetExtractor (implements org.springframework.jdbc.core.ResultSetExtractor<T>)
    • org.springframework.jdbc.core.StatementCreatorUtils

Interface Hierarchy

  • org.springframework.jdbc.core.BatchPreparedStatementSetter
    • org.springframework.jdbc.core.InterruptibleBatchPreparedStatementSetter
  • org.springframework.jdbc.core.CallableStatementCallback<T>
  • org.springframework.jdbc.core.CallableStatementCreator
  • org.springframework.jdbc.core.ConnectionCallback<T>
  • org.springframework.jdbc.core.JdbcOperations
  • org.springframework.jdbc.core.ParameterDisposer
  • org.springframework.jdbc.core.ParameterMapper
  • org.springframework.jdbc.core.PreparedStatementCallback<T>
  • org.springframework.jdbc.core.PreparedStatementCreator
  • org.springframework.jdbc.core.PreparedStatementSetter
  • org.springframework.jdbc.core.ResultSetExtractor<T>
  • org.springframework.jdbc.core.RowCallbackHandler
  • org.springframework.jdbc.core.RowMapper<T>
  • org.springframework.jdbc.core.SqlProvider
  • org.springframework.jdbc.core.SqlReturnType
  • org.springframework.jdbc.core.SqlTypeValue
    • org.springframework.jdbc.core.DisposableSqlTypeValue
  • org.springframework.jdbc.core.StatementCallback<T>


BatchPreparedStatementSetter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.core
Interface BatchPreparedStatementSetter

All Known Subinterfaces:
InterruptibleBatchPreparedStatementSetter
All Known Implementing Classes:
AbstractInterruptibleBatchPreparedStatementSetter
public interface BatchPreparedStatementSetter

Batch update callback interface used by the JdbcTemplate class.

This interface sets values on a PreparedStatement provided by the JdbcTemplate class, for each of a number of updates in a batch using the same SQL. Implementations are responsible for setting any necessary parameters. SQL with placeholders will already have been supplied.

Implementations do not need to concern themselves with SQLExceptions that may be thrown from operations they attempt. The JdbcTemplate class will catch and handle SQLExceptions appropriately.

Since:
March 2, 2003
Author:
Rod Johnson
See Also:
JdbcTemplate.batchUpdate(String, BatchPreparedStatementSetter), InterruptibleBatchPreparedStatementSetter

Method Summary
int | getBatchSize() Return the size of the batch.
void | setValues(PreparedStatement ps, int i) Set parameter values on the given PreparedStatement.

Method Detail

setValues

void setValues(PreparedStatement ps,
               int i)
               throws SQLException
Set parameter values on the given PreparedStatement.

Parameters:
ps - the PreparedStatement to invoke setter methods on
i - index of the statement we're issuing in the batch, starting from 0
Throws:
SQLException - if a SQLException is encountered (i.e. there is no need to catch SQLException)

getBatchSize

int getBatchSize()
Return the size of the batch.

Returns:
the number of statements in the batch
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


CallableStatementCallback

org.springframework.jdbc.core
Interface CallableStatementCallback<T>

public interface CallableStatementCallback<T>

Generic callback interface for code that operates on a CallableStatement. Allows to execute any number of operations on a single CallableStatement, for example a single execute call or repeated execute calls with varying parameters.

Used internally by JdbcTemplate, but also useful for application code. Note that the passed-in CallableStatement can have been created by the framework or by a custom CallableStatementCreator. However, the latter is hardly ever necessary, as most custom callback actions will perform updates in which case a standard CallableStatement is fine. Custom actions will always set parameter values themselves, so that CallableStatementCreator capability is not needed either.

Since:
16.03.2004
Author:
Juergen Hoeller
See Also:
JdbcTemplate.execute(String, CallableStatementCallback), JdbcTemplate.execute(CallableStatementCreator, CallableStatementCallback)

Method Summary
 T doInCallableStatement(CallableStatement cs)
Gets called by JdbcTemplate.execute with an active JDBC CallableStatement.

Method Detail

doInCallableStatement

T doInCallableStatement(CallableStatement cs)
                        throws SQLException,
                               DataAccessException
Gets called by JdbcTemplate.execute with an active JDBC CallableStatement. Does not need to care about closing the Statement or the Connection, or about handling transactions: this will all be handled by Spring's JdbcTemplate.

NOTE: Any ResultSets opened should be closed in finally blocks within the callback implementation. Spring will close the Statement object after the callback returned, but this does not necessarily imply that the ResultSet resources will be closed: the Statement objects might get pooled by the connection pool, with close calls only returning the object to the pool but not physically closing the resources.

If called without a thread-bound JDBC transaction (initiated by DataSourceTransactionManager), the code will simply get executed on the JDBC connection with its transactional semantics. If JdbcTemplate is configured to use a JTA-aware DataSource, the JDBC connection and thus the callback code will be transactional if a JTA transaction is active.

Allows for returning a result object created within the callback, i.e. a domain object or a collection of domain objects. A thrown RuntimeException is treated as application exception: it gets propagated to the caller of the template.

Parameters:
cs - active JDBC CallableStatement
Returns:
a result object, or null if none
Throws:
SQLException - if thrown by a JDBC method, to be auto-converted into a DataAccessException by a SQLExceptionTranslator
DataAccessException - in case of custom exceptions
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CallableStatementCreator

org.springframework.jdbc.core
Interface CallableStatementCreator

public interface CallableStatementCreator

One of the three central callback interfaces used by the JdbcTemplate class. This interface creates a CallableStatement given a connection, provided by the JdbcTemplate class. Implementations are responsible for providing SQL and any necessary parameters.

Implementations do not need to concern themselves with SQLExceptions that may be thrown from operations they attempt. The JdbcTemplate class will catch and handle SQLExceptions appropriately.

A PreparedStatementCreator should also implement the SqlProvider interface if it is able to provide the SQL it uses for PreparedStatement creation. This allows for better contextual information in case of exceptions.

Author:
Rod Johnson, Thomas Risberg
See Also:
JdbcTemplate.execute(CallableStatementCreator, CallableStatementCallback), JdbcTemplate.call(org.springframework.jdbc.core.CallableStatementCreator, java.util.List), SqlProvider

Method Summary
 CallableStatement createCallableStatement(Connection con)
Create a callable statement in this connection.

Method Detail

createCallableStatement

CallableStatement createCallableStatement(Connection con)
                                          throws SQLException
Create a callable statement in this connection. Allows implementations to use CallableStatements.

Parameters:
con - Connection to use to create statement
Returns:
a callable statement
Throws:
SQLException - there is no need to catch SQLExceptions that may be thrown in the implementation of this method. The JdbcTemplate class will handle them.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConnectionCallback

org.springframework.jdbc.core
Interface ConnectionCallback<T>

public interface ConnectionCallback<T>

Generic callback interface for code that operates on a JDBC Connection. Allows to execute any number of operations on a single Connection, using any type and number of Statements.

This is particularly useful for delegating to existing data access code that expects a Connection to work on and throws SQLException. For newly written code, it is strongly recommended to use JdbcTemplate's more specific operations, for example a query or update variant.

Since:
1.1.3
Author:
Juergen Hoeller
See Also:
JdbcTemplate.execute(ConnectionCallback),
JdbcTemplate.query(java.lang.String, org.springframework.jdbc.core.ResultSetExtractor),
JdbcTemplate.update(java.lang.String)

Method Summary
 T doInConnection(Connection con)
Gets called by JdbcTemplate.execute with an active JDBC Connection.

Method Detail

doInConnection

T doInConnection(Connection con)
                 throws SQLException,
                        DataAccessException
Gets called by JdbcTemplate.execute with an active JDBC Connection. Does not need to care about activating or closing the Connection, or handling transactions.

If called without a thread-bound JDBC transaction (initiated by DataSourceTransactionManager), the code will simply get executed on the JDBC connection with its transactional semantics. If JdbcTemplate is configured to use a JTA-aware DataSource, the JDBC Connection and thus the callback code will be transactional if a JTA transaction is active.

Allows for returning a result object created within the callback, i.e. a domain object or a collection of domain objects. Note that there's special support for single step actions: see JdbcTemplate.queryForObject etc. A thrown RuntimeException is treated as application exception: it gets propagated to the caller of the template.

Parameters:
con - active JDBC Connection
Returns:
a result object, or null if none
Throws:
SQLException - if thrown by a JDBC method, to be auto-converted to a DataAccessException by a SQLExceptionTranslator
DataAccessException - in case of custom exceptions
See Also:
JdbcTemplate.queryForObject(String, Class), JdbcTemplate.queryForRowSet(String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DisposableSqlTypeValue

org.springframework.jdbc.core
Interface DisposableSqlTypeValue

All Superinterfaces:
SqlTypeValue
All Known Implementing Classes:
SqlLobValue
public interface DisposableSqlTypeValue
extends SqlTypeValue

Subinterface of SqlTypeValue that adds a cleanup callback, to be invoked after the value has been set and the corresponding statement has been executed.

Since:
1.1
Author:
Juergen Hoeller
See Also:
SqlLobValue

Field Summary
Fields inherited from interface org.springframework.jdbc.core.SqlTypeValue
TYPE_UNKNOWN
Method Summary
 void cleanup()
Clean up resources held by this type value, for example the LobCreator in case of a SqlLobValue.
Methods inherited from interface org.springframework.jdbc.core.SqlTypeValue
setTypeValue

Method Detail

cleanup

void cleanup()
Clean up resources held by this type value, for example the LobCreator in case of a SqlLobValue.

See Also:
SqlLobValue.cleanup(), SqlValue.cleanup()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InterruptibleBatchPreparedStatementSetter

org.springframework.jdbc.core
Interface InterruptibleBatchPreparedStatementSetter

All Superinterfaces:
BatchPreparedStatementSetter
All Known Implementing Classes:
AbstractInterruptibleBatchPreparedStatementSetter
public interface InterruptibleBatchPreparedStatementSetter
extends BatchPreparedStatementSetter

Extension of the BatchPreparedStatementSetter interface, adding a batch exhaustion check.

This interface allows you to signal the end of a batch rather than having to determine the exact batch size upfront. Batch size is still being honored but it is now the maximum size of the batch.

The isBatchExhausted(int) method is called after each call to BatchPreparedStatementSetter.setValues(java.sql.PreparedStatement, int) to determine whether there were some values added, or if the batch was determined to be complete and no additional values were provided during the last call to setValues.

Consider extending the AbstractInterruptibleBatchPreparedStatementSetter base class instead of implementing this interface directly, using a single setValuesIfAvailable callback method that checks for available values and sets them, returning whether values have actually been provided.

Since:
2.0
Author:
Thomas Risberg, Juergen Hoeller
See Also:
JdbcTemplate.batchUpdate(String, BatchPreparedStatementSetter), AbstractInterruptibleBatchPreparedStatementSetter

Method Summary
 boolean isBatchExhausted(int i)
Return whether the batch is complete, that is, whether there were no additional values added during the last setValues call.
Methods inherited from interface org.springframework.jdbc.core.BatchPreparedStatementSetter
getBatchSize, setValues

Method Detail

isBatchExhausted

boolean isBatchExhausted(int i)
Return whether the batch is complete, that is, whether there were no additional values added during the last setValues call.

NOTE: If this method returns true, any parameters that might have been set during the last setValues call will be ignored! Make sure that you set a corresponding internal flag if you detect exhaustion at the beginning of your setValues implementation, letting this method return true based on the flag.

Parameters:
i - index of the statement we're issuing in the batch, starting from 0
Returns:
whether the batch is already exhausted
See Also:
BatchPreparedStatementSetter.setValues(java.sql.PreparedStatement, int), AbstractInterruptibleBatchPreparedStatementSetter.setValuesIfAvailable(java.sql.PreparedStatement, int)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JdbcOperations

org.springframework.jdbc.core
Interface JdbcOperations

All Known Implementing Classes:
JdbcTemplate
public interface JdbcOperations

Interface specifying a basic set of JDBC operations. Implemented by JdbcTemplate. Not often used directly, but a useful option to enhance testability, as it can easily be mocked or stubbed.

Alternatively, the standard JDBC infrastructure can be mocked. However, mocking this interface constitutes significantly less work. As an alternative to a mock objects approach to testing data access code, consider the powerful integration testing support provided in the org.springframework.test package, shipped in spring-mock.jar.

Author:
Rod Johnson, Juergen Hoeller
See Also:
JdbcTemplate

Method Summary
 int[] batchUpdate(String[] sql)
Issue multiple SQL updates on a single JDBC Statement using batching.
 int[] batchUpdate(String sql, BatchPreparedStatementSetter pss)
Issue multiple update statements on a single PreparedStatement, using batch updates and a BatchPreparedStatementSetter to set values.
 Map<String,Object> call(CallableStatementCreator csc, List<SqlParameter> declaredParameters)
Execute a SQL call using a CallableStatementCreator to provide SQL and any required parameters.
<T> T
execute(CallableStatementCreator csc, CallableStatementCallback<T> action)
Execute a JDBC data access operation, implemented as callback action working on a JDBC CallableStatement.
<T> T
execute(ConnectionCallback<T> action)
Execute a JDBC data access operation, implemented as callback action working on a JDBC Connection.
<T> T
execute(PreparedStatementCreator psc, PreparedStatementCallback<T> action)
Execute a JDBC data access operation, implemented as callback action working on a JDBC PreparedStatement.
<T> T
execute(StatementCallback<T> action)
Execute a JDBC data access operation, implemented as callback action working on a JDBC Statement.
 void execute(String sql)
Issue a single SQL execute, typically a DDL statement.
<T> T
execute(String callString, CallableStatementCallback<T> action)
Execute a JDBC data access operation, implemented as callback action working on a JDBC CallableStatement.
<T> T
execute(String sql, PreparedStatementCallback<T> action)
Execute a JDBC data access operation, implemented as callback action working on a JDBC PreparedStatement.
<T> T
query(PreparedStatementCreator psc, ResultSetExtractor<T> rse)
Query using a prepared statement, reading the ResultSet with a ResultSetExtractor.
 void query(PreparedStatementCreator psc, RowCallbackHandler rch)
Query using a prepared statement, reading the ResultSet on a per-row basis with a RowCallbackHandler.
<T> List<T>
query(PreparedStatementCreator psc, RowMapper<T> rowMapper)
Query using a prepared statement, mapping each row to a Java object via a RowMapper.
<T> T
query(String sql, Object[] args, int[] argTypes, ResultSetExtractor<T> rse)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.
 void query(String sql, Object[] args, int[] argTypes, RowCallbackHandler rch)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.
<T> List<T>
query(String sql, Object[] args, int[] argTypes, RowMapper<T> rowMapper)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.
<T> T
query(String sql, Object[] args, ResultSetExtractor<T> rse)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.
 void query(String sql, Object[] args, RowCallbackHandler rch)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.
<T> List<T>
query(String sql, Object[] args, RowMapper<T> rowMapper)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.
<T> T
query(String sql, PreparedStatementSetter pss, ResultSetExtractor<T> rse)
Query using a prepared statement, reading the ResultSet with a ResultSetExtractor.
 void query(String sql, PreparedStatementSetter pss, RowCallbackHandler rch)
Query given SQL to create a prepared statement from SQL and a PreparedStatementSetter implementation that knows how to bind values to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.
<T> List<T>
query(String sql, PreparedStatementSetter pss, RowMapper<T> rowMapper)
Query given SQL to create a prepared statement from SQL and a PreparedStatementSetter implementation that knows how to bind values to the query, mapping each row to a Java object via a RowMapper.
<T> T
query(String sql, ResultSetExtractor<T> rse)
Execute a query given static SQL, reading the ResultSet with a ResultSetExtractor.
<T> T
query(String sql, ResultSetExtractor<T> rse, Object... args)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.
 void query(String sql, RowCallbackHandler rch)
Execute a query given static SQL, reading the ResultSet on a per-row basis with a RowCallbackHandler.
 void query(String sql, RowCallbackHandler rch, Object... args)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.
<T> List<T>
query(String sql, RowMapper<T> rowMapper)
Execute a query given static SQL, mapping each row to a Java object via a RowMapper.
<T> List<T>
query(String sql, RowMapper<T> rowMapper, Object... args)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.
 int queryForInt(String sql)
Execute a query that results in an int value, given static SQL.
 int queryForInt(String sql, Object... args)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in an int value.
 int queryForInt(String sql, Object[] args, int[] argTypes)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in an int value.
 List<Map<String,Object>> queryForList(String sql)
Execute a query for a result list, given static SQL.
<T> List<T>
queryForList(String sql, Class<T> elementType)
Execute a query for a result list, given static SQL.
<T> List<T>
queryForList(String sql, Class<T> elementType, Object... args)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
 List<Map<String,Object>> queryForList(String sql, Object... args)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
<T> List<T>
queryForList(String sql, Object[] args, Class<T> elementType)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
 List<Map<String,Object>> queryForList(String sql, Object[] args, int[] argTypes)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
<T> List<T>
queryForList(String sql, Object[] args, int[] argTypes, Class<T> elementType)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
 long queryForLong(String sql)
Execute a query that results in a long value, given static SQL.
 long queryForLong(String sql, Object... args)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in a long value.
 long queryForLong(String sql, Object[] args, int[] argTypes)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in a long value.
 Map<String,Object> queryForMap(String sql)
Execute a query for a result Map, given static SQL.
 Map<String,Object> queryForMap(String sql, Object... args)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result Map.
 Map<String,Object> queryForMap(String sql, Object[] args, int[] argTypes)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result Map.
<T> T
queryForObject(String sql, Class<T> requiredType)
Execute a query for a result object, given static SQL.
<T> T
queryForObject(String sql, Class<T> requiredType, Object... args)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.
<T> T
queryForObject(String sql, Object[] args, Class<T> requiredType)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.
<T> T
queryForObject(String sql, Object[] args, int[] argTypes, Class<T> requiredType)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.
<T> T
queryForObject(String sql, Object[] args, int[] argTypes, RowMapper<T> rowMapper)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.
<T> T
queryForObject(String sql, Object[] args, RowMapper<T> rowMapper)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.
<T> T
queryForObject(String sql, RowMapper<T> rowMapper)
Execute a query given static SQL, mapping a single result row to a Java object via a RowMapper.
<T> T
queryForObject(String sql, RowMapper<T> rowMapper, Object... args)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.
 SqlRowSet queryForRowSet(String sql)
Execute a query for a SqlRowSet, given static SQL.
 SqlRowSet queryForRowSet(String sql, Object... args)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a SqlRowSet.
 SqlRowSet queryForRowSet(String sql, Object[] args, int[] argTypes)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a SqlRowSet.
 int update(PreparedStatementCreator psc)
Issue a single SQL update operation (such as an insert, update or delete statement) using a PreparedStatementCreator to provide SQL and any required parameters.
 int update(PreparedStatementCreator psc, KeyHolder generatedKeyHolder)
Issue an update statement using a PreparedStatementCreator to provide SQL and any required parameters.
 int update(String sql)
Issue a single SQL update operation (such as an insert, update or delete statement).
 int update(String sql, Object... args)
Issue a single SQL update operation (such as an insert, update or delete statement) via a prepared statement, binding the given arguments.
 int update(String sql, Object[] args, int[] argTypes)
Issue a single SQL update operation (such as an insert, update or delete statement) via a prepared statement, binding the given arguments.
 int update(String sql, PreparedStatementSetter pss)
Issue an update statement using a PreparedStatementSetter to set bind parameters, with given SQL.

Method Detail

execute

<T> T execute(ConnectionCallback<T> action)
          throws DataAccessException
Execute a JDBC data access operation, implemented as callback action working on a JDBC Connection. This allows for implementing arbitrary data access operations, within Spring's managed JDBC environment: that is, participating in Spring-managed transactions and converting JDBC SQLExceptions into Spring's DataAccessException hierarchy.

The callback action can return a result object, for example a domain object or a collection of domain objects.

Parameters:
action - the callback object that specifies the action
Returns:
a result object returned by the action, or null
Throws:
DataAccessException - if there is any problem

execute

<T> T execute(StatementCallback<T> action)
          throws DataAccessException
Execute a JDBC data access operation, implemented as callback action working on a JDBC Statement. This allows for implementing arbitrary data access operations on a single Statement, within Spring's managed JDBC environment: that is, participating in Spring-managed transactions and converting JDBC SQLExceptions into Spring's DataAccessException hierarchy.

The callback action can return a result object, for example a domain object or a collection of domain objects.

Parameters:
action - callback object that specifies the action
Returns:
a result object returned by the action, or null
Throws:
DataAccessException - if there is any problem

execute

void execute(String sql)
             throws DataAccessException
Issue a single SQL execute, typically a DDL statement.

Parameters:
sql - static SQL to execute
Throws:
DataAccessException - if there is any problem

query

<T> T query(String sql,
            ResultSetExtractor<T> rse)
        throws DataAccessException
Execute a query given static SQL, reading the ResultSet with a ResultSetExtractor.

Uses a JDBC Statement, not a PreparedStatement. If you want to execute a static query with a PreparedStatement, use the overloaded query method with null as argument array.

Parameters:
sql - SQL query to execute
rse - object that will extract all rows of results
Returns:
an arbitrary result object, as returned by the ResultSetExtractor
Throws:
DataAccessException - if there is any problem executing the query
See Also:
query(String, Object[], ResultSetExtractor)

query

void query(String sql,
           RowCallbackHandler rch)
           throws DataAccessException
Execute a query given static SQL, reading the ResultSet on a per-row basis with a RowCallbackHandler.

Uses a JDBC Statement, not a PreparedStatement. If you want to execute a static query with a PreparedStatement, use the overloaded query method with null as argument array.

Parameters:
sql - SQL query to execute
rch - object that will extract results, one row at a time
Throws:
DataAccessException - if there is any problem executing the query
See Also:
query(String, Object[], RowCallbackHandler)

query

<T> List<T> query(String sql,
                  RowMapper<T> rowMapper)
              throws DataAccessException
Execute a query given static SQL, mapping each row to a Java object via a RowMapper.

Uses a JDBC Statement, not a PreparedStatement. If you want to execute a static query with a PreparedStatement, use the overloaded query method with null as argument array.

Parameters:
sql - SQL query to execute
rowMapper - object that will map one object per row
Returns:
the result List, containing mapped objects
Throws:
DataAccessException - if there is any problem executing the query
See Also:
query(String, Object[], RowMapper)

queryForObject

<T> T queryForObject(String sql,
                     RowMapper<T> rowMapper)
                 throws DataAccessException
Execute a query given static SQL, mapping a single result row to a Java object via a RowMapper.

Uses a JDBC Statement, not a PreparedStatement. If you want to execute a static query with a PreparedStatement, use the overloaded queryForObject method with null as argument array.

Parameters:
sql - SQL query to execute
rowMapper - object that will map one object per row
Returns:
the single mapped object
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row
DataAccessException - if there is any problem executing the query
See Also:
queryForObject(String, Object[], RowMapper)

queryForObject

<T> T queryForObject(String sql,
                     Class<T> requiredType)
                 throws DataAccessException
Execute a query for a result object, given static SQL.

Uses a JDBC Statement, not a PreparedStatement. If you want to execute a static query with a PreparedStatement, use the overloaded queryForObject method with null as argument array.

This method is useful for running static SQL with a known outcome. The query is expected to be a single row/single column query; the returned result will be directly mapped to the corresponding object type.

Parameters:
sql - SQL query to execute
requiredType - the type that the result object is expected to match
Returns:
the result object of the required type, or null in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if there is any problem executing the query
See Also:
queryForObject(String, Object[], Class)

queryForMap

Map<String,Object> queryForMap(String sql)
                               throws DataAccessException
Execute a query for a result Map, given static SQL.

Uses a JDBC Statement, not a PreparedStatement. If you want to execute a static query with a PreparedStatement, use the overloaded queryForMap method with null as argument array.

The query is expected to be a single row query; the result row will be mapped to a Map (one entry for each column, using the column name as the key).

Parameters:
sql - SQL query to execute
Returns:
the result Map (one entry for each column, using the column name as the key)
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row
DataAccessException - if there is any problem executing the query
See Also:
queryForMap(String, Object[]), ColumnMapRowMapper

queryForLong

long queryForLong(String sql)
                  throws DataAccessException
Execute a query that results in a long value, given static SQL.

Uses a JDBC Statement, not a PreparedStatement. If you want to execute a static query with a PreparedStatement, use the overloaded queryForLong method with null as argument array.

This method is useful for running static SQL with a known outcome. The query is expected to be a single row/single column query that results in a long value.

Parameters:
sql - SQL query to execute
Returns:
the long value, or 0 in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if there is any problem executing the query
See Also:
queryForLong(String, Object[])

queryForInt

int queryForInt(String sql)
                throws DataAccessException
Execute a query that results in an int value, given static SQL.

Uses a JDBC Statement, not a PreparedStatement. If you want to execute a static query with a PreparedStatement, use the overloaded queryForInt method with null as argument array.

This method is useful for running static SQL with a known outcome. The query is expected to be a single row/single column query that results in an int value.

Parameters:
sql - SQL query to execute
Returns:
the int value, or 0 in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if there is any problem executing the query
See Also:
queryForInt(String, Object[])

queryForList

<T> List<T> queryForList(String sql,
                         Class<T> elementType)
                     throws DataAccessException
Execute a query for a result list, given static SQL.

Uses a JDBC Statement, not a PreparedStatement. If you want to execute a static query with a PreparedStatement, use the overloaded queryForList method with null as argument array.

The results will be mapped to a List (one entry for each row) of result objects, each of them matching the specified element type.

Parameters:
sql - SQL query to execute
elementType - the required type of element in the result list (for example, Integer.class)
Returns:
a List of objects that match the specified element type
Throws:
DataAccessException - if there is any problem executing the query
See Also:
queryForList(String, Object[], Class), SingleColumnRowMapper

queryForList

List<Map<String,Object>> queryForList(String sql)
                                      throws DataAccessException
Execute a query for a result list, given static SQL.

Uses a JDBC Statement, not a PreparedStatement. If you want to execute a static query with a PreparedStatement, use the overloaded queryForList method with null as argument array.

The results will be mapped to a List (one entry for each row) of Maps (one entry for each column using the column name as the key). Each element in the list will be of the form returned by this interface's queryForMap() methods.

Parameters:
sql - SQL query to execute
Returns:
an List that contains a Map per row
Throws:
DataAccessException - if there is any problem executing the query
See Also:
queryForList(String, Object[])

queryForRowSet

SqlRowSet queryForRowSet(String sql)
                         throws DataAccessException
Execute a query for a SqlRowSet, given static SQL.

Uses a JDBC Statement, not a PreparedStatement. If you want to execute a static query with a PreparedStatement, use the overloaded queryForRowSet method with null as argument array.

The results will be mapped to an SqlRowSet which holds the data in a disconnected fashion. This wrapper will translate any SQLExceptions thrown.

Note that that, for the default implementation, JDBC RowSet support needs to be available at runtime: by default, Sun's com.sun.rowset.CachedRowSetImpl class is used, which is part of JDK 1.5+ and also available separately as part of Sun's JDBC RowSet Implementations download (rowset.jar).

Parameters:
sql - SQL query to execute
Returns:
a SqlRowSet representation (possibly a wrapper around a javax.sql.rowset.CachedRowSet)
Throws:
DataAccessException - if there is any problem executing the query
See Also:
queryForRowSet(String, Object[]), SqlRowSetResultSetExtractor, CachedRowSet

update

int update(String sql)
           throws DataAccessException
Issue a single SQL update operation (such as an insert, update or delete statement).

Parameters:
sql - static SQL to execute
Returns:
the number of rows affected
Throws:
DataAccessException - if there is any problem.

batchUpdate

int[] batchUpdate(String[] sql)
                  throws DataAccessException
Issue multiple SQL updates on a single JDBC Statement using batching.

Will fall back to separate updates on a single Statement if the JDBC driver does not support batch updates.

Parameters:
sql - defining an array of SQL statements that will be executed.
Returns:
an array of the number of rows affected by each statement
Throws:
DataAccessException - if there is any problem executing the batch

execute

<T> T execute(PreparedStatementCreator psc,
              PreparedStatementCallback<T> action)
          throws DataAccessException
Execute a JDBC data access operation, implemented as callback action working on a JDBC PreparedStatement. This allows for implementing arbitrary data access operations on a single Statement, within Spring's managed JDBC environment: that is, participating in Spring-managed transactions and converting JDBC SQLExceptions into Spring's DataAccessException hierarchy.

The callback action can return a result object, for example a domain object or a collection of domain objects.

Parameters:
psc - object that can create a PreparedStatement given a Connection
action - callback object that specifies the action
Returns:
a result object returned by the action, or null
Throws:
DataAccessException - if there is any problem

execute

<T> T execute(String sql,
              PreparedStatementCallback<T> action)
          throws DataAccessException
Execute a JDBC data access operation, implemented as callback action working on a JDBC PreparedStatement. This allows for implementing arbitrary data access operations on a single Statement, within Spring's managed JDBC environment: that is, participating in Spring-managed transactions and converting JDBC SQLExceptions into Spring's DataAccessException hierarchy.

The callback action can return a result object, for example a domain object or a collection of domain objects.

Parameters:
sql - SQL to execute
action - callback object that specifies the action
Returns:
a result object returned by the action, or null
Throws:
DataAccessException - if there is any problem

query

<T> T query(PreparedStatementCreator psc,
            ResultSetExtractor<T> rse)
        throws DataAccessException
Query using a prepared statement, reading the ResultSet with a ResultSetExtractor.

A PreparedStatementCreator can either be implemented directly or configured through a PreparedStatementCreatorFactory.

Parameters:
psc - object that can create a PreparedStatement given a Connection
rse - object that will extract results
Returns:
an arbitrary result object, as returned by the ResultSetExtractor
Throws:
DataAccessException - if there is any problem
See Also:
PreparedStatementCreatorFactory

query

<T> T query(String sql,
            PreparedStatementSetter pss,
            ResultSetExtractor<T> rse)
        throws DataAccessException
Query using a prepared statement, reading the ResultSet with a ResultSetExtractor.

Parameters:
sql - SQL query to execute
pss - object that knows how to set values on the prepared statement. If this is null, the SQL will be assumed to contain no bind parameters. Even if there are no bind parameters, this object may be used to set fetch size and other performance options.
rse - object that will extract results
Returns:
an arbitrary result object, as returned by the ResultSetExtractor
Throws:
DataAccessException - if there is any problem

query

<T> T query(String sql,
            Object[] args,
            int[] argTypes,
            ResultSetExtractor<T> rse)
        throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.

Parameters:
sql - SQL query to execute
args - arguments to bind to the query
argTypes - SQL types of the arguments (constants from java.sql.Types)
rse - object that will extract results
Returns:
an arbitrary result object, as returned by the ResultSetExtractor
Throws:
DataAccessException - if the query fails
See Also:
Types

query

<T> T query(String sql,
            Object[] args,
            ResultSetExtractor<T> rse)
        throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.

Parameters:
sql - SQL query to execute
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
rse - object that will extract results
Returns:
an arbitrary result object, as returned by the ResultSetExtractor
Throws:
DataAccessException - if the query fails

query

<T> T query(String sql,
            ResultSetExtractor<T> rse,
            Object... args)
        throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.

Parameters:
sql - SQL query to execute
rse - object that will extract results
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
Returns:
an arbitrary result object, as returned by the ResultSetExtractor
Throws:
DataAccessException - if the query fails

query

void query(PreparedStatementCreator psc,
           RowCallbackHandler rch)
           throws DataAccessException
Query using a prepared statement, reading the ResultSet on a per-row basis with a RowCallbackHandler.

A PreparedStatementCreator can either be implemented directly or configured through a PreparedStatementCreatorFactory.

Parameters:
psc - object that can create a PreparedStatement given a Connection
rch - object that will extract results, one row at a time
Throws:
DataAccessException - if there is any problem
See Also:
PreparedStatementCreatorFactory

query

void query(String sql,
           PreparedStatementSetter pss,
           RowCallbackHandler rch)
           throws DataAccessException
Query given SQL to create a prepared statement from SQL and a PreparedStatementSetter implementation that knows how to bind values to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.

Parameters:
sql - SQL query to execute
pss - object that knows how to set values on the prepared statement. If this is null, the SQL will be assumed to contain no bind parameters. Even if there are no bind parameters, this object may be used to set fetch size and other performance options.
rch - object that will extract results, one row at a time
Throws:
DataAccessException - if the query fails

query

void query(String sql,
           Object[] args,
           int[] argTypes,
           RowCallbackHandler rch)
           throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.

Parameters:
sql - SQL query to execute
args - arguments to bind to the query
argTypes - SQL types of the arguments (constants from java.sql.Types)
rch - object that will extract results, one row at a time
Throws:
DataAccessException - if the query fails
See Also:
Types

query

void query(String sql,
           Object[] args,
           RowCallbackHandler rch)
           throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.

Parameters:
sql - SQL query to execute
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
rch - object that will extract results, one row at a time
Throws:
DataAccessException - if the query fails

query

void query(String sql,
           RowCallbackHandler rch,
           Object... args)
           throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.

Parameters:
sql - SQL query to execute
rch - object that will extract results, one row at a time
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
Throws:
DataAccessException - if the query fails

query

<T> List<T> query(PreparedStatementCreator psc,
                  RowMapper<T> rowMapper)
              throws DataAccessException
Query using a prepared statement, mapping each row to a Java object via a RowMapper.

A PreparedStatementCreator can either be implemented directly or configured through a PreparedStatementCreatorFactory.

Parameters:
psc - object that can create a PreparedStatement given a Connection
rowMapper - object that will map one object per row
Returns:
the result List, containing mapped objects
Throws:
DataAccessException - if there is any problem
See Also:
PreparedStatementCreatorFactory

query

<T> List<T> query(String sql,
                  PreparedStatementSetter pss,
                  RowMapper<T> rowMapper)
              throws DataAccessException
Query given SQL to create a prepared statement from SQL and a PreparedStatementSetter implementation that knows how to bind values to the query, mapping each row to a Java object via a RowMapper.

Parameters:
sql - SQL query to execute
pss - object that knows how to set values on the prepared statement. If this is null, the SQL will be assumed to contain no bind parameters. Even if there are no bind parameters, this object may be used to set fetch size and other performance options.
rowMapper - object that will map one object per row
Returns:
the result List, containing mapped objects
Throws:
DataAccessException - if the query fails

query

<T> List<T> query(String sql,
                  Object[] args,
                  int[] argTypes,
                  RowMapper<T> rowMapper)
              throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.

Parameters:
sql - SQL query to execute
args - arguments to bind to the query
argTypes - SQL types of the arguments (constants from java.sql.Types)
rowMapper - object that will map one object per row
Returns:
the result List, containing mapped objects
Throws:
DataAccessException - if the query fails
See Also:
Types

query

<T> List<T> query(String sql,
                  Object[] args,
                  RowMapper<T> rowMapper)
              throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.

Parameters:
sql - SQL query to execute
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
rowMapper - object that will map one object per row
Returns:
the result List, containing mapped objects
Throws:
DataAccessException - if the query fails

query

<T> List<T> query(String sql,
                  RowMapper<T> rowMapper,
                  Object... args)
              throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.

Parameters:
sql - SQL query to execute
rowMapper - object that will map one object per row
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
Returns:
the result List, containing mapped objects
Throws:
DataAccessException - if the query fails

queryForObject

<T> T queryForObject(String sql,
                     Object[] args,
                     int[] argTypes,
                     RowMapper<T> rowMapper)
                 throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.

Parameters:
sql - SQL query to execute
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
argTypes - SQL types of the arguments (constants from java.sql.Types)
rowMapper - object that will map one object per row
Returns:
the single mapped object
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row
DataAccessException - if the query fails

queryForObject

<T> T queryForObject(String sql,
                     Object[] args,
                     RowMapper<T> rowMapper)
                 throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.

Parameters:
sql - SQL query to execute
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
rowMapper - object that will map one object per row
Returns:
the single mapped object
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row
DataAccessException - if the query fails

queryForObject

<T> T queryForObject(String sql,
                     RowMapper<T> rowMapper,
                     Object... args)
                 throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.

Parameters:
sql - SQL query to execute
rowMapper - object that will map one object per row
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
Returns:
the single mapped object
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row
DataAccessException - if the query fails

queryForObject

<T> T queryForObject(String sql,
                     Object[] args,
                     int[] argTypes,
                     Class<T> requiredType)
                 throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.

The query is expected to be a single row/single column query; the returned result will be directly mapped to the corresponding object type.

Parameters:
sql - SQL query to execute
args - arguments to bind to the query
argTypes - SQL types of the arguments (constants from java.sql.Types)
requiredType - the type that the result object is expected to match
Returns:
the result object of the required type, or null in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails
See Also:
queryForObject(String, Class), Types

queryForObject

<T> T queryForObject(String sql,
                     Object[] args,
                     Class<T> requiredType)
                 throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.

The query is expected to be a single row/single column query; the returned result will be directly mapped to the corresponding object type.

Parameters:
sql - SQL query to execute
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
requiredType - the type that the result object is expected to match
Returns:
the result object of the required type, or null in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails
See Also:
queryForObject(String, Class)

queryForObject

<T> T queryForObject(String sql,
                     Class<T> requiredType,
                     Object... args)
                 throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.

The query is expected to be a single row/single column query; the returned result will be directly mapped to the corresponding object type.

Parameters:
sql - SQL query to execute
requiredType - the type that the result object is expected to match
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
Returns:
the result object of the required type, or null in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails
See Also:
queryForObject(String, Class)

queryForMap

Map<String,Object> queryForMap(String sql,
                               Object[] args,
                               int[] argTypes)
                               throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result Map.

The query is expected to be a single row query; the result row will be mapped to a Map (one entry for each column, using the column name as the key).

Parameters:
sql - SQL query to execute
args - arguments to bind to the query
argTypes - SQL types of the arguments (constants from java.sql.Types)
Returns:
the result Map (one entry for each column, using the column name as the key)
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row
DataAccessException - if the query fails
See Also:
queryForMap(String), ColumnMapRowMapper, Types

queryForMap

Map<String,Object> queryForMap(String sql,
                               Object... args)
                               throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result Map. The queryForMap() methods defined by this interface are appropriate when you don't have a domain model. Otherwise, consider using one of the queryForObject() methods.

The query is expected to be a single row query; the result row will be mapped to a Map (one entry for each column, using the column name as the key).

Parameters:
sql - SQL query to execute
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
Returns:
the result Map (one entry for each column, using the column name as the key)
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row
DataAccessException - if the query fails
See Also:
queryForMap(String), ColumnMapRowMapper

queryForLong

long queryForLong(String sql,
                  Object[] args,
                  int[] argTypes)
                  throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in a long value.

The query is expected to be a single row/single column query that results in a long value.

Parameters:
sql - SQL query to execute
args - arguments to bind to the query
argTypes - SQL types of the arguments (constants from java.sql.Types)
Returns:
the long value, or 0 in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails
See Also:
queryForLong(String), Types

queryForLong

long queryForLong(String sql,
                  Object... args)
                  throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in a long value.

The query is expected to be a single row/single column query that results in a long value.

Parameters:
sql - SQL query to execute
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
Returns:
the long value, or 0 in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails
See Also:
queryForLong(String)

queryForInt

int queryForInt(String sql,
                Object[] args,
                int[] argTypes)
                throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in an int value.

The query is expected to be a single row/single column query that results in an int value.

Parameters:
sql - SQL query to execute
args - arguments to bind to the query
argTypes - SQL types of the arguments (constants from java.sql.Types)
Returns:
the int value, or 0 in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails
See Also:
queryForInt(String), Types

queryForInt

int queryForInt(String sql,
                Object... args)
                throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in an int value.

The query is expected to be a single row/single column query that results in an int value.

Parameters:
sql - SQL query to execute
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
Returns:
the int value, or 0 in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails
See Also:
queryForInt(String)

queryForList

<T> List<T> queryForList(String sql,
                         Object[] args,
                         int[] argTypes,
                         Class<T> elementType)
                     throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.

The results will be mapped to a List (one entry for each row) of result objects, each of them matching the specified element type.

Parameters:
sql - SQL query to execute
args - arguments to bind to the query
argTypes - SQL types of the arguments (constants from java.sql.Types)
elementType - the required type of element in the result list (for example, Integer.class)
Returns:
a List of objects that match the specified element type
Throws:
DataAccessException - if the query fails
See Also:
queryForList(String, Class), SingleColumnRowMapper

queryForList

<T> List<T> queryForList(String sql,
                         Object[] args,
                         Class<T> elementType)
                     throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.

The results will be mapped to a List (one entry for each row) of result objects, each of them matching the specified element type.

Parameters:
sql - SQL query to execute
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
elementType - the required type of element in the result list (for example, Integer.class)
Returns:
a List of objects that match the specified element type
Throws:
DataAccessException - if the query fails
See Also:
queryForList(String, Class), SingleColumnRowMapper

queryForList

<T> List<T> queryForList(String sql,
                         Class<T> elementType,
                         Object... args)
                     throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.

The results will be mapped to a List (one entry for each row) of result objects, each of them matching the specified element type.

Parameters:
sql - SQL query to execute
elementType - the required type of element in the result list (for example, Integer.class)
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
Returns:
a List of objects that match the specified element type
Throws:
DataAccessException - if the query fails
See Also:
queryForList(String, Class), SingleColumnRowMapper

queryForList

List<Map<String,Object>> queryForList(String sql,
                                      Object[] args,
                                      int[] argTypes)
                                      throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.

The results will be mapped to a List (one entry for each row) of Maps (one entry for each column, using the column name as the key). Thus Each element in the list will be of the form returned by this interface's queryForMap() methods.

Parameters:
sql - SQL query to execute
args - arguments to bind to the query
argTypes - SQL types of the arguments (constants from java.sql.Types)
Returns:
a List that contains a Map per row
Throws:
DataAccessException - if the query fails
See Also:
queryForList(String), Types

queryForList

List<Map<String,Object>> queryForList(String sql,
                                      Object... args)
                                      throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.

The results will be mapped to a List (one entry for each row) of Maps (one entry for each column, using the column name as the key). Each element in the list will be of the form returned by this interface's queryForMap() methods.

Parameters:
sql - SQL query to execute
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
Returns:
a List that contains a Map per row
Throws:
DataAccessException - if the query fails
See Also:
queryForList(String)

queryForRowSet

SqlRowSet queryForRowSet(String sql,
                         Object[] args,
                         int[] argTypes)
                         throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a SqlRowSet.

The results will be mapped to an SqlRowSet which holds the data in a disconnected fashion. This wrapper will translate any SQLExceptions thrown.

Note that that, for the default implementation, JDBC RowSet support needs to be available at runtime: by default, Sun's com.sun.rowset.CachedRowSetImpl class is used, which is part of JDK 1.5+ and also available separately as part of Sun's JDBC RowSet Implementations download (rowset.jar).

Parameters:
sql - SQL query to execute
args - arguments to bind to the query
argTypes - SQL types of the arguments (constants from java.sql.Types)
Returns:
a SqlRowSet representation (possibly a wrapper around a javax.sql.rowset.CachedRowSet)
Throws:
DataAccessException - if there is any problem executing the query
See Also:
queryForRowSet(String), SqlRowSetResultSetExtractor, CachedRowSet, Types

queryForRowSet

SqlRowSet queryForRowSet(String sql,
                         Object... args)
                         throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a SqlRowSet.

The results will be mapped to an SqlRowSet which holds the data in a disconnected fashion. This wrapper will translate any SQLExceptions thrown.

Note that that, for the default implementation, JDBC RowSet support needs to be available at runtime: by default, Sun's com.sun.rowset.CachedRowSetImpl class is used, which is part of JDK 1.5+ and also available separately as part of Sun's JDBC RowSet Implementations download (rowset.jar).

Parameters:
sql - SQL query to execute
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
Returns:
a SqlRowSet representation (possibly a wrapper around a javax.sql.rowset.CachedRowSet)
Throws:
DataAccessException - if there is any problem executing the query
See Also:
queryForRowSet(String), SqlRowSetResultSetExtractor, CachedRowSet

update

int update(PreparedStatementCreator psc)
           throws DataAccessException
Issue a single SQL update operation (such as an insert, update or delete statement) using a PreparedStatementCreator to provide SQL and any required parameters.

A PreparedStatementCreator can either be implemented directly or configured through a PreparedStatementCreatorFactory.

Parameters:
psc - object that provides SQL and any necessary parameters
Returns:
the number of rows affected
Throws:
DataAccessException - if there is any problem issuing the update
See Also:
PreparedStatementCreatorFactory

update

int update(PreparedStatementCreator psc,
           KeyHolder generatedKeyHolder)
           throws DataAccessException
Issue an update statement using a PreparedStatementCreator to provide SQL and any required parameters. Generated keys will be put into the given KeyHolder.

Note that the given PreparedStatementCreator has to create a statement with activated extraction of generated keys (a JDBC 3.0 feature). This can either be done directly or through using a PreparedStatementCreatorFactory.

Parameters:
psc - object that provides SQL and any necessary parameters
generatedKeyHolder - KeyHolder that will hold the generated keys
Returns:
the number of rows affected
Throws:
DataAccessException - if there is any problem issuing the update
See Also:
PreparedStatementCreatorFactory, GeneratedKeyHolder

update

int update(String sql,
           PreparedStatementSetter pss)
           throws DataAccessException
Issue an update statement using a PreparedStatementSetter to set bind parameters, with given SQL. Simpler than using a PreparedStatementCreator as this method will create the PreparedStatement: The PreparedStatementSetter just needs to set parameters.

Parameters:
sql - SQL containing bind parameters
pss - helper that sets bind parameters. If this is null we run an update with static SQL.
Returns:
the number of rows affected
Throws:
DataAccessException - if there is any problem issuing the update

update

int update(String sql,
           Object[] args,
           int[] argTypes)
           throws DataAccessException
Issue a single SQL update operation (such as an insert, update or delete statement) via a prepared statement, binding the given arguments.

Parameters:
sql - SQL containing bind parameters
args - arguments to bind to the query
argTypes - SQL types of the arguments (constants from java.sql.Types)
Returns:
the number of rows affected
Throws:
DataAccessException - if there is any problem issuing the update
See Also:
Types

update

int update(String sql,
           Object... args)
           throws DataAccessException
Issue a single SQL update operation (such as an insert, update or delete statement) via a prepared statement, binding the given arguments.

Parameters:
sql - SQL containing bind parameters
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
Returns:
the number of rows affected
Throws:
DataAccessException - if there is any problem issuing the update

batchUpdate

int[] batchUpdate(String sql,
                  BatchPreparedStatementSetter pss)
                  throws DataAccessException
Issue multiple update statements on a single PreparedStatement, using batch updates and a BatchPreparedStatementSetter to set values.

Will fall back to separate updates on a single PreparedStatement if the JDBC driver does not support batch updates.

Parameters:
sql - defining PreparedStatement that will be reused. All statements in the batch will use the same SQL.
pss - object to set parameters on the PreparedStatement created by this method
Returns:
an array of the number of rows affected by each statement
Throws:
DataAccessException - if there is any problem issuing the update

execute

<T> T execute(CallableStatementCreator csc,
              CallableStatementCallback<T> action)
          throws DataAccessException
Execute a JDBC data access operation, implemented as callback action working on a JDBC CallableStatement. This allows for implementing arbitrary data access operations on a single Statement, within Spring's managed JDBC environment: that is, participating in Spring-managed transactions and converting JDBC SQLExceptions into Spring's DataAccessException hierarchy.

The callback action can return a result object, for example a domain object or a collection of domain objects.

Parameters:
csc - object that can create a CallableStatement given a Connection
action - callback object that specifies the action
Returns:
a result object returned by the action, or null
Throws:
DataAccessException - if there is any problem

execute

<T> T execute(String callString,
              CallableStatementCallback<T> action)
          throws DataAccessException
Execute a JDBC data access operation, implemented as callback action working on a JDBC CallableStatement. This allows for implementing arbitrary data access operations on a single Statement, within Spring's managed JDBC environment: that is, participating in Spring-managed transactions and converting JDBC SQLExceptions into Spring's DataAccessException hierarchy.

The callback action can return a result object, for example a domain object or a collection of domain objects.

Parameters:
callString - the SQL call string to execute
action - callback object that specifies the action
Returns:
a result object returned by the action, or null
Throws:
DataAccessException - if there is any problem

call

Map<String,Object> call(CallableStatementCreator csc,
                        List<SqlParameter> declaredParameters)
                        throws DataAccessException
Execute a SQL call using a CallableStatementCreator to provide SQL and any required parameters.

Parameters:
csc - object that provides SQL and any necessary parameters
declaredParameters - list of declared SqlParameter objects
Returns:
Map of extracted out parameters
Throws:
DataAccessException - if there is any problem issuing the update
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ParameterDisposer

org.springframework.jdbc.core
Interface ParameterDisposer

public interface ParameterDisposer

Interface to be implemented by objects that can close resources allocated by parameters like SqlLobValues.

Typically implemented by PreparedStatementCreators and PreparedStatementSetters that support DisposableSqlTypeValue objects (e.g. SqlLobValue) as parameters.

Since:
1.1
Author:
Thomas Risberg, Juergen Hoeller
See Also:
PreparedStatementCreator, PreparedStatementSetter, DisposableSqlTypeValue, SqlLobValue

Method Summary
 void cleanupParameters()
Close the resources allocated by parameters that the implementing object holds, for example in case of a DisposableSqlTypeValue (like a SqlLobValue).

Method Detail

cleanupParameters

void cleanupParameters()
Close the resources allocated by parameters that the implementing object holds, for example in case of a DisposableSqlTypeValue (like a SqlLobValue).

See Also:
DisposableSqlTypeValue.cleanup(), SqlLobValue.cleanup()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ParameterMapper

org.springframework.jdbc.core
Interface ParameterMapper

public interface ParameterMapper

Implement this interface when parameters need to be customized based on the connection. We might need to do this to make use of proprietary features, available only with a specific Connection type.

Author:
Rod Johnson, Thomas Risberg
See Also:
CallableStatementCreatorFactory.newCallableStatementCreator(ParameterMapper), StoredProcedure.execute(ParameterMapper)

Method Summary
 Map<String,?> createMap(Connection con)
Create a Map of input parameters, keyed by name.

Method Detail

createMap

Map<String,?> createMap(Connection con)
                        throws SQLException
Create a Map of input parameters, keyed by name.

Parameters:
con - JDBC connection. This is useful (and the purpose of this interface) if we need to do something RDBMS-specific with a proprietary Connection implementation class. This class conceals such proprietary details. However, it is best to avoid using such proprietary RDBMS features if possible.
Returns:
Map of input parameters, keyed by name (never null)
Throws:
SQLException - if a SQLException is encountered setting parameter values (that is, there's no need to catch SQLException)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PreparedStatementCallback

org.springframework.jdbc.core
Interface PreparedStatementCallback<T>

All Known Implementing Classes:
AbstractLobCreatingPreparedStatementCallback
public interface PreparedStatementCallback<T>

Generic callback interface for code that operates on a PreparedStatement. Allows to execute any number of operations on a single PreparedStatement, for example a single executeUpdate call or repeated executeUpdate calls with varying parameters.

Used internally by JdbcTemplate, but also useful for application code. Note that the passed-in PreparedStatement can have been created by the framework or by a custom PreparedStatementCreator. However, the latter is hardly ever necessary, as most custom callback actions will perform updates in which case a standard PreparedStatement is fine. Custom actions will always set parameter values themselves, so that PreparedStatementCreator capability is not needed either.

Since:
16.03.2004
Author:
Juergen Hoeller
See Also:
JdbcTemplate.execute(String, PreparedStatementCallback), JdbcTemplate.execute(PreparedStatementCreator, PreparedStatementCallback)

Method Summary
 T doInPreparedStatement(PreparedStatement ps)
Gets called by JdbcTemplate.execute with an active JDBC PreparedStatement.

Method Detail

doInPreparedStatement

T doInPreparedStatement(PreparedStatement ps)
                        throws SQLException,
                               DataAccessException
Gets called by JdbcTemplate.execute with an active JDBC PreparedStatement. Does not need to care about closing the Statement or the Connection, or about handling transactions: this will all be handled by Spring's JdbcTemplate.

NOTE: Any ResultSets opened should be closed in finally blocks within the callback implementation. Spring will close the Statement object after the callback returned, but this does not necessarily imply that the ResultSet resources will be closed: the Statement objects might get pooled by the connection pool, with close calls only returning the object to the pool but not physically closing the resources.

If called without a thread-bound JDBC transaction (initiated by DataSourceTransactionManager), the code will simply get executed on the JDBC connection with its transactional semantics. If JdbcTemplate is configured to use a JTA-aware DataSource, the JDBC connection and thus the callback code will be transactional if a JTA transaction is active.

Allows for returning a result object created within the callback, i.e. a domain object or a collection of domain objects. Note that there's special support for single step actions: see JdbcTemplate.queryForObject etc. A thrown RuntimeException is treated as application exception, it gets propagated to the caller of the template.

Parameters:
ps - active JDBC PreparedStatement
Returns:
a result object, or null if none
Throws:
SQLException - if thrown by a JDBC method, to be auto-converted to a DataAccessException by a SQLExceptionTranslator
DataAccessException - in case of custom exceptions
See Also:
JdbcTemplate.queryForObject(String, Object[], Class), JdbcTemplate.queryForList(String, Object[])
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PreparedStatementCreator

org.springframework.jdbc.core
Interface PreparedStatementCreator

public interface PreparedStatementCreator

One of the two central callback interfaces used by the JdbcTemplate class. This interface creates a PreparedStatement given a connection, provided by the JdbcTemplate class. Implementations are responsible for providing SQL and any necessary parameters.

Implementations do not need to concern themselves with SQLExceptions that may be thrown from operations they attempt. The JdbcTemplate class will catch and handle SQLExceptions appropriately.

A PreparedStatementCreator should also implement the SqlProvider interface if it is able to provide the SQL it uses for PreparedStatement creation. This allows for better contextual information in case of exceptions.

Author:
Rod Johnson
See Also:
JdbcTemplate.execute(PreparedStatementCreator, PreparedStatementCallback),
JdbcTemplate.query(PreparedStatementCreator, RowCallbackHandler),
JdbcTemplate.update(PreparedStatementCreator),
SqlProvider

Method Summary
 PreparedStatement createPreparedStatement(Connection con)
Create a statement in this connection.

Method Detail

createPreparedStatement

PreparedStatement createPreparedStatement(Connection con)
                                          throws SQLException
Create a statement in this connection. Allows implementations to use PreparedStatements. The JdbcTemplate will close the created statement.

Parameters:
con - Connection to use to create statement
Returns:
a prepared statement
Throws:
SQLException - there is no need to catch SQLExceptions that may be thrown in the implementation of this method. The JdbcTemplate class will handle them.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PreparedStatementSetter

org.springframework.jdbc.core
Interface PreparedStatementSetter

public interface PreparedStatementSetter

General callback interface used by the JdbcTemplate class.

This interface sets values on a PreparedStatement provided by the JdbcTemplate class, for each of a number of updates in a batch using the same SQL. Implementations are responsible for setting any necessary parameters. SQL with placeholders will already have been supplied.

It's easier to use this interface than PreparedStatementCreator: The JdbcTemplate will create the PreparedStatement, with the callback only being responsible for setting parameter values.

Implementations do not need to concern themselves with SQLExceptions that may be thrown from operations they attempt. The JdbcTemplate class will catch and handle SQLExceptions appropriately.

Since:
March 2, 2003
Author:
Rod Johnson
See Also:
JdbcTemplate.update(String, PreparedStatementSetter), JdbcTemplate.query(String, PreparedStatementSetter, ResultSetExtractor)

Method Summary
 void setValues(PreparedStatement ps)
Set parameter values on the given PreparedStatement.

Method Detail

setValues

void setValues(PreparedStatement ps)
               throws SQLException
Set parameter values on the given PreparedStatement.

Parameters:
ps - the PreparedStatement to invoke setter methods on
Throws:
SQLException - if a SQLException is encountered (i.e. there is no need to catch SQLException)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResultSetExtractor

org.springframework.jdbc.core
Interface ResultSetExtractor<T>

All Known Implementing Classes:
AbstractLobStreamingResultSetExtractor, RowMapperResultSetExtractor, SqlRowSetResultSetExtractor
public interface ResultSetExtractor<T>

Callback interface used by JdbcTemplate's query methods. Implementations of this interface perform the actual work of extracting results from a ResultSet, but don't need to worry about exception handling. SQLExceptions will be caught and handled by the calling JdbcTemplate.

This interface is mainly used within the JDBC framework itself. A RowMapper is usually a simpler choice for ResultSet processing, mapping one result object per row instead of one result object for the entire ResultSet.

Note: In contrast to a RowCallbackHandler, a ResultSetExtractor object is typically stateless and thus reusable, as long as it doesn't access stateful resources (such as output streams when streaming LOB contents) or keep result state within the object.

Since:
April 24, 2003
Author:
Rod Johnson, Juergen Hoeller
See Also:
JdbcTemplate, RowCallbackHandler, RowMapper, AbstractLobStreamingResultSetExtractor

Method Summary
 T extractData(ResultSet rs)
Implementations must implement this method to process the entire ResultSet.

Method Detail

extractData

T extractData(ResultSet rs)
              throws SQLException,
                     DataAccessException
Implementations must implement this method to process the entire ResultSet.

Parameters:
rs - ResultSet to extract data from. Implementations should not close this: it will be closed by the calling JdbcTemplate.
Returns:
an arbitrary result object, or null if none (the extractor will typically be stateful in the latter case).
Throws:
SQLException - if a SQLException is encountered getting column values or navigating (that is, there's no need to catch SQLException)
DataAccessException - in case of custom exceptions
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RowCallbackHandler

org.springframework.jdbc.core
Interface RowCallbackHandler

All Known Implementing Classes:
RowCountCallbackHandler
public interface RowCallbackHandler

An interface used by JdbcTemplate for processing rows of a ResultSet on a per-row basis. Implementations of this interface perform the actual work of processing each row but don't need to worry about exception handling. SQLExceptions will be caught and handled by the calling JdbcTemplate.

In contrast to a ResultSetExtractor, a RowCallbackHandler object is typically stateful: It keeps the result state within the object, to be available for later inspection. See RowCountCallbackHandler for a usage example.

Consider using a RowMapper instead if you need to map exactly one result object per row, assembling them into a List.

Author:
Rod Johnson, Juergen Hoeller
See Also:
JdbcTemplate, RowMapper, ResultSetExtractor, RowCountCallbackHandler

Method Summary
 void processRow(ResultSet rs)
Implementations must implement this method to process each row of data in the ResultSet.

Method Detail

processRow

void processRow(ResultSet rs)
                throws SQLException
Implementations must implement this method to process each row of data in the ResultSet. This method should not call next() on the ResultSet; it is only supposed to extract values of the current row.

Exactly what the implementation chooses to do is up to it: A trivial implementation might simply count rows, while another implementation might build an XML document.

Parameters:
rs - the ResultSet to process (pre-initialized for the current row)
Throws:
SQLException - if a SQLException is encountered getting column values (that is, there's no need to catch SQLException)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RowMapper

org.springframework.jdbc.core
Interface RowMapper<T>

All Known Subinterfaces:
ParameterizedRowMapper<T>
All Known Implementing Classes:
BeanPropertyRowMapper, ColumnMapRowMapper, MappingSqlQueryWithParameters.RowMapperImpl, ParameterizedBeanPropertyRowMapper, ParameterizedSingleColumnRowMapper, SingleColumnRowMapper, UpdatableSqlQuery.RowMapperImpl
public interface RowMapper<T>

An interface used by JdbcTemplate for mapping rows of a ResultSet on a per-row basis. Implementations of this interface perform the actual work of mapping each row to a result object, but don't need to worry about exception handling. SQLExceptions will be caught and handled by the calling JdbcTemplate.

Typically used either for JdbcTemplate's query methods or for out parameters of stored procedures. RowMapper objects are typically stateless and thus reusable; they are an ideal choice for implementing row-mapping logic in a single place.

Alternatively, consider subclassing MappingSqlQuery from the jdbc.object package: Instead of working with separate JdbcTemplate and RowMapper objects, you can build executable query objects (containing row-mapping logic) in that style.

Author:
Thomas Risberg, Juergen Hoeller
See Also:
JdbcTemplate, RowCallbackHandler, ResultSetExtractor, MappingSqlQuery

Method Summary
 T mapRow(ResultSet rs, int rowNum)
Implementations must implement this method to map each row of data in the ResultSet.

Method Detail

mapRow

T mapRow(ResultSet rs,
         int rowNum)
         throws SQLException
Implementations must implement this method to map each row of data in the ResultSet. This method should not call next() on the ResultSet; it is only supposed to map values of the current row.

Parameters:
rs - the ResultSet to map (pre-initialized for the current row)
rowNum - the number of the current row
Returns:
the result object for the current row
Throws:
SQLException - if a SQLException is encountered getting column values (that is, there's no need to catch SQLException)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SqlProvider

org.springframework.jdbc.core
Interface SqlProvider

public interface SqlProvider

Interface to be implemented by objects that can provide SQL strings.

Typically implemented by PreparedStatementCreators, CallableStatementCreators and StatementCallbacks that want to expose the SQL they use to create their statements, to allow for better contextual information in case of exceptions.

Since:
16.03.2004
Author:
Juergen Hoeller
See Also:
PreparedStatementCreator, CallableStatementCreator, StatementCallback

Method Summary
 String getSql()
Return the SQL string for this object, i.e.

Method Detail

getSql

String getSql()
Return the SQL string for this object, i.e. typically the SQL used for creating statements.

Returns:
the SQL string, or null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SqlReturnType

org.springframework.jdbc.core
Interface SqlReturnType

public interface SqlReturnType

Interface to be implemented for retrieving values for more complex database-specific types not supported by the standard CallableStatement.getObject method.

Implementations perform the actual work of getting the actual values. They must implement the callback method getTypeValue which can throw SQLExceptions that will be caught and translated by the calling code. This callback method has access to the underlying Connection via the given CallableStatement object, if that should be needed to create any database-specific objects.

Since:
1.1
Author:
Thomas Risberg
See Also:
Types, CallableStatement.getObject(int), StoredProcedure.execute(java.util.Map)

Field Summary
static int TYPE_UNKNOWN
Constant that indicates an unknown (or unspecified) SQL type.
Method Summary
 Object getTypeValue(CallableStatement cs, int paramIndex, int sqlType, String typeName)
Get the type value from the specific object.

Field Detail

TYPE_UNKNOWN

static final int TYPE_UNKNOWN
Constant that indicates an unknown (or unspecified) SQL type. Passed into setTypeValue if the original operation method does not specify a SQL type.

See Also:
Types, JdbcOperations.update(String, Object[]), Constant Field Values
Method Detail

getTypeValue

Object getTypeValue(CallableStatement cs,
                    int paramIndex,
                    int sqlType,
                    String typeName)
                    throws SQLException
Get the type value from the specific object.

Parameters:
cs - the CallableStatement to operate on
paramIndex - the index of the parameter for which we need to set the value
sqlType - SQL type of the parameter we are setting
typeName - the type name of the parameter
Returns:
the target value
Throws:
SQLException - if a SQLException is encountered setting parameter values (that is, there's no need to catch SQLException)
See Also:
Types, CallableStatement.getObject(int)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SqlTypeValue

org.springframework.jdbc.core
Interface SqlTypeValue

All Known Subinterfaces:
DisposableSqlTypeValue
All Known Implementing Classes:
AbstractSqlTypeValue, SqlLobValue
public interface SqlTypeValue

Interface to be implemented for setting values for more complex database-specific types not supported by the standard setObject method. This is effectively an extended variant of SqlValue.

Implementations perform the actual work of setting the actual values. They must implement the callback method setTypeValue which can throw SQLExceptions that will be caught and translated by the calling code. This callback method has access to the underlying Connection via the given PreparedStatement object, if that should be needed to create any database-specific objects.

Since:
1.1
Author:
Thomas Risberg, Juergen Hoeller
See Also:
Types, PreparedStatement.setObject(int, java.lang.Object, int), JdbcOperations.update(String, Object[], int[]), SqlValue

Field Summary
static int TYPE_UNKNOWN
Constant that indicates an unknown (or unspecified) SQL type.
Method Summary
 void setTypeValue(PreparedStatement ps, int paramIndex, int sqlType, String typeName)
Set the type value on the given PreparedStatement.

Field Detail

TYPE_UNKNOWN

static final int TYPE_UNKNOWN
Constant that indicates an unknown (or unspecified) SQL type. Passed into setTypeValue if the original operation method does not specify a SQL type.

See Also:
Types, JdbcOperations.update(String, Object[]), Constant Field Values
Method Detail

setTypeValue

void setTypeValue(PreparedStatement ps,
                  int paramIndex,
                  int sqlType,
                  String typeName)
                  throws SQLException
Set the type value on the given PreparedStatement.

Parameters:
ps - the PreparedStatement to work on
paramIndex - the index of the parameter for which we need to set the value
sqlType - SQL type of the parameter we are setting
typeName - the type name of the parameter (optional)
Throws:
SQLException - if a SQLException is encountered while setting parameter values
See Also:
Types, PreparedStatement.setObject(int, java.lang.Object, int)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StatementCallback

org.springframework.jdbc.core
Interface StatementCallback<T>

public interface StatementCallback<T>

Generic callback interface for code that operates on a JDBC Statement. Allows to execute any number of operations on a single Statement, for example a single executeUpdate call or repeated executeUpdate calls with varying SQL.

Used internally by JdbcTemplate, but also useful for application code.

Since:
16.03.2004
Author:
Juergen Hoeller
See Also:
JdbcTemplate.execute(StatementCallback)

Method Summary
 T doInStatement(Statement stmt)
Gets called by JdbcTemplate.execute with an active JDBC Statement.

Method Detail

doInStatement

T doInStatement(Statement stmt)
                throws SQLException,
                       DataAccessException
Gets called by JdbcTemplate.execute with an active JDBC Statement. Does not need to care about closing the Statement or the Connection, or about handling transactions: this will all be handled by Spring's JdbcTemplate.

NOTE: Any ResultSets opened should be closed in finally blocks within the callback implementation. Spring will close the Statement object after the callback returned, but this does not necessarily imply that the ResultSet resources will be closed: the Statement objects might get pooled by the connection pool, with close calls only returning the object to the pool but not physically closing the resources.

If called without a thread-bound JDBC transaction (initiated by DataSourceTransactionManager), the code will simply get executed on the JDBC connection with its transactional semantics. If JdbcTemplate is configured to use a JTA-aware DataSource, the JDBC connection and thus the callback code will be transactional if a JTA transaction is active.

Allows for returning a result object created within the callback, i.e. a domain object or a collection of domain objects. Note that there's special support for single step actions: see JdbcTemplate.queryForObject etc. A thrown RuntimeException is treated as application exception, it gets propagated to the caller of the template.

Parameters:
stmt - active JDBC Statement
Returns:
a result object, or null if none
Throws:
SQLException - if thrown by a JDBC method, to be auto-converted to a DataAccessException by a SQLExceptionTranslator
DataAccessException - in case of custom exceptions
See Also:
JdbcTemplate.queryForObject(String, Class), JdbcTemplate.queryForRowSet(String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BatchUpdateUtils

org.springframework.jdbc.core
Class BatchUpdateUtils

java.lang.Object
    extended by  org.springframework.jdbc.core.BatchUpdateUtils
Direct Known Subclasses:
NamedParameterBatchUpdateUtils
public abstract class BatchUpdateUtils
extends Object

Generic utility methods for working with JDBC batch statements. Mainly for internal use within the framework.

Author:
Thomas Risberg

Constructor Summary
BatchUpdateUtils()
Method Summary
static int[] | executeBatchUpdate(String sql, List<Object[]> batchValues, int[] columnTypes, JdbcOperations jdbcOperations)
protected static void | setStatementParameters(Object[] values, PreparedStatement ps, int[] columnTypes)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BatchUpdateUtils

public BatchUpdateUtils()
Method Detail

executeBatchUpdate

public static int[] executeBatchUpdate(String sql,
                                       List<Object[]> batchValues,
                                       int[] columnTypes,
                                       JdbcOperations jdbcOperations)

setStatementParameters

protected static void setStatementParameters(Object[] values,
                                             PreparedStatement ps,
                                             int[] columnTypes)
                                      throws SQLException
Throws:
SQLException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanPropertyRowMapper

org.springframework.jdbc.core
Class BeanPropertyRowMapper<T>

java.lang.Object
    extended by  org.springframework.jdbc.core.BeanPropertyRowMapper<T>
All Implemented Interfaces:
RowMapper<T>
Direct Known Subclasses:
ParameterizedBeanPropertyRowMapper
public class BeanPropertyRowMapper<T>
extends Object
implements RowMapper<T>

RowMapper implementation that converts a row into a new instance of the specified mapped target class. The mapped target class must be a top-level class and it must have a default or no-arg constructor.

Column values are mapped based on matching the column name as obtained from result set metadata to public setters for the corresponding properties. The names are matched either directly or by transforming a name separating the parts with underscores to the same name using "camel" case.

Mapping is provided for fields in the target class for many common types, e.g.: String, boolean, Boolean, byte, Byte, short, Short, int, Integer, long, Long, float, Float, double, Double, BigDecimal, java.util.Date, etc.

To facilitate mapping between columns and fields that don't have matching names, try using column aliases in the SQL statement like "select fname as first_name from customer".

For 'null' values read from the databasem, we will attempt to call the setter, but in the case of Java primitives, this causes a TypeMismatchException. This class can be configured (using the primitivesDefaultedForNullValue property) to trap this exception and use the primitives default value. Be aware that if you use the values from the generated bean to update the database the primitive value will have been set to the primitive's default value instead of null.

Please note that this class is designed to provide convenience rather than high performance. For best performance consider using a custom RowMapper.

Since:
2.5
Author:
Thomas Risberg, Juergen Hoeller

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
BeanPropertyRowMapper()
Create a new BeanPropertyRowMapper for bean-style configuration.
BeanPropertyRowMapper(Class<T> mappedClass)
Create a new BeanPropertyRowMapper, accepting unpopulated properties in the target bean.
BeanPropertyRowMapper(Class<T> mappedClass, boolean checkFullyPopulated)
Create a new BeanPropertyRowMapper.
Method Summary
protected  Object getColumnValue(ResultSet rs, int index, PropertyDescriptor pd)
Retrieve a JDBC object value for the specified column.
 Class<T> getMappedClass()
Get the class that we are mapping to.
protected  void initBeanWrapper(BeanWrapper bw)
Initialize the given BeanWrapper to be used for row mapping.
protected  void initialize(Class<T> mappedClass)
Initialize the mapping metadata for the given class.
 boolean isCheckFullyPopulated()
Return whether we're strictly validating that all bean properties have been mapped from corresponding database fields.
 boolean isPrimitivesDefaultedForNullValue()
Return whether we're defaulting Java primitives in the case of mapping a null value from corresponding database fields.
 T mapRow(ResultSet rs, int rowNumber)
Extract the values for all columns in the current row.
static
<T> BeanPropertyRowMapper<T>
newInstance(Class<T> mappedClass)
Static factory method to create a new BeanPropertyRowMapper (with the mapped class specified only once).
 void setCheckFullyPopulated(boolean checkFullyPopulated)
Set whether we're strictly validating that all bean properties have been mapped from corresponding database fields.
 void setMappedClass(Class<T> mappedClass)
Set the class that each row should be mapped to.
 void setPrimitivesDefaultedForNullValue(boolean primitivesDefaultedForNullValue)
Set whether we're defaulting Java primitives in the case of mapping a null value from corresponding database fields.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

BeanPropertyRowMapper

public BeanPropertyRowMapper()
Create a new BeanPropertyRowMapper for bean-style configuration.

See Also:
setMappedClass(java.lang.Class), setCheckFullyPopulated(boolean)

BeanPropertyRowMapper

public BeanPropertyRowMapper(Class<T> mappedClass)
Create a new BeanPropertyRowMapper, accepting unpopulated properties in the target bean.

Consider using the newInstance(java.lang.Class) factory method instead, which allows for specifying the mapped type once only.

Parameters:
mappedClass - the class that each row should be mapped to

BeanPropertyRowMapper

public BeanPropertyRowMapper(Class<T> mappedClass,
                             boolean checkFullyPopulated)
Create a new BeanPropertyRowMapper.

Parameters:
mappedClass - the class that each row should be mapped to
checkFullyPopulated - whether we're strictly validating that all bean properties have been mapped from corresponding database fields
Method Detail

setMappedClass

public void setMappedClass(Class<T> mappedClass)
Set the class that each row should be mapped to.

initialize

protected void initialize(Class<T> mappedClass)
Initialize the mapping metadata for the given class.

Parameters:
mappedClass - the mapped class.

getMappedClass

public final Class<T> getMappedClass()
Get the class that we are mapping to.

setCheckFullyPopulated

public void setCheckFullyPopulated(boolean checkFullyPopulated)
Set whether we're strictly validating that all bean properties have been mapped from corresponding database fields.

Default is false, accepting unpopulated properties in the target bean.

isCheckFullyPopulated

public boolean isCheckFullyPopulated()
Return whether we're strictly validating that all bean properties have been mapped from corresponding database fields.

setPrimitivesDefaultedForNullValue

public void setPrimitivesDefaultedForNullValue(boolean primitivesDefaultedForNullValue)
Set whether we're defaulting Java primitives in the case of mapping a null value from corresponding database fields.

Default is false, throwing an exception when nulls are mapped to Java primitives.

isPrimitivesDefaultedForNullValue

public boolean isPrimitivesDefaultedForNullValue()
Return whether we're defaulting Java primitives in the case of mapping a null value from corresponding database fields.

mapRow

public T mapRow(ResultSet rs,
                int rowNumber)
         throws SQLException
Extract the values for all columns in the current row.

Utilizes public setters and result set metadata.

Specified by:
mapRow in interface RowMapper<T>
Parameters:
rs - the ResultSet to map (pre-initialized for the current row)
rowNumber - the number of the current row
Returns:
the result object for the current row
Throws:
SQLException - if a SQLException is encountered getting column values (that is, there's no need to catch SQLException)
See Also:
ResultSetMetaData

initBeanWrapper

protected void initBeanWrapper(BeanWrapper bw)
Initialize the given BeanWrapper to be used for row mapping. To be called for each row.

The default implementation is empty. Can be overridden in subclasses.

Parameters:
bw - the BeanWrapper to initialize

getColumnValue

protected Object getColumnValue(ResultSet rs,
                                int index,
                                PropertyDescriptor pd)
                         throws SQLException
Retrieve a JDBC object value for the specified column.

The default implementation calls JdbcUtils.getResultSetValue(java.sql.ResultSet, int, Class). Subclasses may override this to check specific value types upfront, or to post-process values return from getResultSetValue.

Parameters:
rs - is the ResultSet holding the data
index - is the column index
pd - the bean property that each result object is expected to match (or null if none specified)
Returns:
the Object value
Throws:
SQLException - in case of extraction failure
See Also:
JdbcUtils.getResultSetValue(java.sql.ResultSet, int, Class)

newInstance

public static <T> BeanPropertyRowMapper<T> newInstance(Class<T> mappedClass)
Static factory method to create a new BeanPropertyRowMapper (with the mapped class specified only once).

Parameters:
mappedClass - the class that each row should be mapped to
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CallableStatementCreatorFactory

org.springframework.jdbc.core
Class CallableStatementCreatorFactory

java.lang.Object
    extended by  org.springframework.jdbc.core.CallableStatementCreatorFactory

public class CallableStatementCreatorFactory
extends Object

Helper class that efficiently creates multiple CallableStatementCreator objects with different parameters based on a SQL statement and a single set of parameter declarations.

Author:
Rod Johnson, Thomas Risberg, Juergen Hoeller

Constructor Summary
CallableStatementCreatorFactory(String callString)
Create a new factory.
CallableStatementCreatorFactory(String callString, List<SqlParameter> declaredParameters)
Create a new factory with the given SQL and the given parameters.
Method Summary
void | addParameter(SqlParameter param) Add a new declared parameter.
CallableStatementCreator | newCallableStatementCreator(Map<String,?> params) Return a new CallableStatementCreator instance given this parameters.
CallableStatementCreator | newCallableStatementCreator(ParameterMapper inParamMapper) Return a new CallableStatementCreator instance given this parameter mapper.
void | setNativeJdbcExtractor(NativeJdbcExtractor nativeJdbcExtractor) Specify the NativeJdbcExtractor to use for unwrapping CallableStatements, if any.
void | setResultSetType(int resultSetType) Set whether to use prepared statements that return a specific type of ResultSet.
void | setUpdatableResults(boolean updatableResults) Set whether to use prepared statements capable of returning updatable ResultSets.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CallableStatementCreatorFactory

public CallableStatementCreatorFactory(String callString)
Create a new factory. Will need to add parameters via the addParameter(org.springframework.jdbc.core.SqlParameter) method or have no parameters.

CallableStatementCreatorFactory

public CallableStatementCreatorFactory(String callString,
                                       List<SqlParameter> declaredParameters)
Create a new factory with the given SQL and the given parameters.

Parameters:
callString - the SQL call string
declaredParameters - list of SqlParameter objects
Method Detail

addParameter

public void addParameter(SqlParameter param)
Add a new declared parameter.

Order of parameter addition is significant.

Parameters:
param - the parameter to add to the list of declared parameters

setResultSetType

public void setResultSetType(int resultSetType)
Set whether to use prepared statements that return a specific type of ResultSet. specific type of ResultSet.

Parameters:
resultSetType - the ResultSet type
See Also:
ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.TYPE_SCROLL_SENSITIVE

setUpdatableResults

public void setUpdatableResults(boolean updatableResults)
Set whether to use prepared statements capable of returning updatable ResultSets.

setNativeJdbcExtractor

public void setNativeJdbcExtractor(NativeJdbcExtractor nativeJdbcExtractor)
Specify the NativeJdbcExtractor to use for unwrapping CallableStatements, if any.

newCallableStatementCreator

public CallableStatementCreator newCallableStatementCreator(Map<String,?> params)
Return a new CallableStatementCreator instance given this parameters.

Parameters:
params - list of parameters (may be null)

newCallableStatementCreator

public CallableStatementCreator newCallableStatementCreator(ParameterMapper inParamMapper)
Return a new CallableStatementCreator instance given this parameter mapper.

Parameters:
inParamMapper - ParameterMapper implementation that will return a Map of parameters
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ColumnMapRowMapper

org.springframework.jdbc.core
Class ColumnMapRowMapper

java.lang.Object
    extended by  org.springframework.jdbc.core.ColumnMapRowMapper
All Implemented Interfaces:
RowMapper<Map<String,Object>>
public class ColumnMapRowMapper
extends Object
implements RowMapper<Map<String,Object>>

RowMapper implementation that creates a java.util.Map for each row, representing all columns as key-value pairs: one entry for each column, with the column name as key.

The Map implementation to use and the key to use for each column in the column Map can be customized through overriding createColumnMap(int) and getColumnKey(java.lang.String), respectively.

Note: By default, ColumnMapRowMapper will try to build a linked Map with case-insensitive keys, to preserve column order as well as allow any casing to be used for column names. This requires Commons Collections on the classpath (which will be autodetected). Else, the fallback is a standard linked HashMap, which will still preserve column order but requires the application to specify the column names in the same casing as exposed by the driver.

Since:
1.2
Author:
Juergen Hoeller
See Also:
JdbcTemplate.queryForList(String), JdbcTemplate.queryForMap(String)

Constructor Summary
ColumnMapRowMapper()
Method Summary
protected Map<String,Object> | createColumnMap(int columnCount) Create a Map instance to be used as column map.
protected String | getColumnKey(String columnName) Determine the key to use for the given column in the column Map.
protected Object | getColumnValue(ResultSet rs, int index) Retrieve a JDBC object value for the specified column.
Map<String,Object> | mapRow(ResultSet rs, int rowNum) Implementations must implement this method to map each row of data in the ResultSet.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ColumnMapRowMapper

public ColumnMapRowMapper()
Method Detail

mapRow

public Map<String,Object> mapRow(ResultSet rs,
                                 int rowNum)
                          throws SQLException
Description copied from interface: RowMapper
Implementations must implement this method to map each row of data in the ResultSet. This method should not call next() on the ResultSet; it is only supposed to map values of the current row.

Specified by:
mapRow in interface RowMapper<Map<String,Object>>
Parameters:
rs - the ResultSet to map (pre-initialized for the current row)
rowNum - the number of the current row
Returns:
the result object for the current row
Throws:
SQLException - if a SQLException is encountered getting column values (that is, there's no need to catch SQLException)

createColumnMap

protected Map<String,Object> createColumnMap(int columnCount)
Create a Map instance to be used as column map.

By default, a linked case-insensitive Map will be created.

Parameters:
columnCount - the column count, to be used as initial capacity for the Map
Returns:
the new Map instance
See Also:
LinkedCaseInsensitiveMap

getColumnKey

protected String getColumnKey(String columnName)
Determine the key to use for the given column in the column Map.

Parameters:
columnName - the column name as returned by the ResultSet
Returns:
the column key to use
See Also:
ResultSetMetaData.getColumnName(int)

getColumnValue

protected Object getColumnValue(ResultSet rs,
                                int index)
                         throws SQLException
Retrieve a JDBC object value for the specified column.

The default implementation uses the getObject method. Additionally, this implementation includes a "hack" to get around Oracle returning a non standard object for their TIMESTAMP datatype.

Parameters:
rs - is the ResultSet holding the data
index - is the column index
Returns:
the Object returned
Throws:
SQLException
See Also:
JdbcUtils.getResultSetValue(java.sql.ResultSet, int, java.lang.Class)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JdbcTemplate

org.springframework.jdbc.core
Class JdbcTemplate

java.lang.Object
    extended by  org.springframework.jdbc.support.JdbcAccessor
        extended by  org.springframework.jdbc.core.JdbcTemplate
All Implemented Interfaces:
InitializingBean, JdbcOperations
public class JdbcTemplate
extends JdbcAccessor
implements JdbcOperations

This is the central class in the JDBC core package. It simplifies the use of JDBC and helps to avoid common errors. It executes core JDBC workflow, leaving application code to provide SQL and extract results. This class executes SQL queries or updates, initiating iteration over ResultSets and catching JDBC exceptions and translating them to the generic, more informative exception hierarchy defined in the org.springframework.dao package.

Code using this class need only implement callback interfaces, giving them a clearly defined contract. The PreparedStatementCreator callback interface creates a prepared statement given a Connection, providing SQL and any necessary parameters. The ResultSetExtractor interface extracts values from a ResultSet. See also PreparedStatementSetter and RowMapper for two popular alternative callback interfaces.

Can be used within a service implementation via direct instantiation with a DataSource reference, or get prepared in an application context and given to services as bean reference. Note: The DataSource should always be configured as a bean in the application context, in the first case given to the service directly, in the second case to the prepared template.

Because this class is parameterizable by the callback interfaces and the SQLExceptionTranslator interface, there should be no need to subclass it.

All SQL operations performed by this class are logged at debug level, using "org.springframework.jdbc.core.JdbcTemplate" as log category.

Since:
May 3, 2001
Author:
Rod Johnson, Juergen Hoeller, Thomas Risberg
See Also:
PreparedStatementCreator, PreparedStatementSetter, CallableStatementCreator, PreparedStatementCallback, CallableStatementCallback, ResultSetExtractor, RowCallbackHandler, RowMapper, SQLExceptionTranslator

Field Summary
Fields inherited from class org.springframework.jdbc.support.JdbcAccessor
logger
Constructor Summary
JdbcTemplate()
Construct a new JdbcTemplate for bean usage.
JdbcTemplate(DataSource dataSource)
Construct a new JdbcTemplate, given a DataSource to obtain connections from.
JdbcTemplate(DataSource dataSource, boolean lazyInit)
Construct a new JdbcTemplate, given a DataSource to obtain connections from.
Method Summary
protected  void applyStatementSettings(Statement stmt)
Prepare the given JDBC Statement (or PreparedStatement or CallableStatement), applying statement settings such as fetch size, max rows, and query timeout.
 int[] batchUpdate(String[] sql)
Issue multiple SQL updates on a single JDBC Statement using batching.
 int[] batchUpdate(String sql, BatchPreparedStatementSetter pss)
Issue multiple update statements on a single PreparedStatement, using batch updates and a BatchPreparedStatementSetter to set values.
 Map<String,Object> call(CallableStatementCreator csc, List<SqlParameter> declaredParameters)
Execute a SQL call using a CallableStatementCreator to provide SQL and any required parameters.
protected  Connection createConnectionProxy(Connection con)
Create a close-suppressing proxy for the given JDBC Connection.
protected  Map<String,Object> createResultsMap()
Create a Map instance to be used as results map.
<T> T
execute(CallableStatementCreator csc, CallableStatementCallback<T> action)
Execute a JDBC data access operation, implemented as callback action working on a JDBC CallableStatement.
<T> T
execute(ConnectionCallback<T> action)
Execute a JDBC data access operation, implemented as callback action working on a JDBC Connection.
<T> T
execute(PreparedStatementCreator psc, PreparedStatementCallback<T> action)
Execute a JDBC data access operation, implemented as callback action working on a JDBC PreparedStatement.
<T> T
execute(StatementCallback<T> action)
Execute a JDBC data access operation, implemented as callback action working on a JDBC Statement.
 void execute(String sql)
Issue a single SQL execute, typically a DDL statement.
<T> T
execute(String callString, CallableStatementCallback<T> action)
Execute a JDBC data access operation, implemented as callback action working on a JDBC CallableStatement.
<T> T
execute(String sql, PreparedStatementCallback<T> action)
Execute a JDBC data access operation, implemented as callback action working on a JDBC PreparedStatement.
protected  Map<String,Object> extractOutputParameters(CallableStatement cs, List<SqlParameter> parameters)
Extract output parameters from the completed stored procedure.
protected  Map<String,Object> extractReturnedResults(CallableStatement cs, List updateCountParameters, List resultSetParameters, int updateCount)
Extract returned ResultSets from the completed stored procedure.
protected  RowMapper<Map<String,Object>> getColumnMapRowMapper()
Create a new RowMapper for reading columns as key-value pairs.
 int getFetchSize()
Return the fetch size specified for this JdbcTemplate.
 int getMaxRows()
Return the maximum number of rows specified for this JdbcTemplate.
 NativeJdbcExtractor getNativeJdbcExtractor()
Return the current NativeJdbcExtractor implementation.
 int getQueryTimeout()
Return the query timeout for statements that this JdbcTemplate executes.
protected
<T> RowMapper<T>
getSingleColumnRowMapper(Class<T> requiredType)
Create a new RowMapper for reading result objects from a single column.
protected  void handleWarnings(SQLWarning warning)
Throw an SQLWarningException if encountering an actual warning.
protected  void handleWarnings(Statement stmt)
Throw an SQLWarningException if we're not ignoring warnings, else log the warnings (at debug level).
 boolean isIgnoreWarnings()
Return whether or not we ignore SQLWarnings.
 boolean isResultsMapCaseInsensitive()
Return whether execution of a CallableStatement will return the results in a Map that uses case insensitive names for the parameters.
 boolean isSkipResultsProcessing()
Return whether results processing should be skipped.
 boolean isSkipUndeclaredResults()
Return whether undeclared results should be skipped.
protected  PreparedStatementSetter newArgPreparedStatementSetter(Object[] args)
Create a new ArgPreparedStatementSetter using the args passed in.
protected  PreparedStatementSetter newArgTypePreparedStatementSetter(Object[] args, int[] argTypes)
Create a new ArgTypePreparedStatementSetter using the args and argTypes passed in.
protected  Map<String,Object> processResultSet(ResultSet rs, ResultSetSupportingSqlParameter param)
Process the given ResultSet from a stored procedure.
<T> T
query(PreparedStatementCreator psc, PreparedStatementSetter pss, ResultSetExtractor<T> rse)
Query using a prepared statement, allowing for a PreparedStatementCreator and a PreparedStatementSetter.
<T> T
query(PreparedStatementCreator psc, ResultSetExtractor<T> rse)
Query using a prepared statement, reading the ResultSet with a ResultSetExtractor.
 void query(PreparedStatementCreator psc, RowCallbackHandler rch)
Query using a prepared statement, reading the ResultSet on a per-row basis with a RowCallbackHandler.
<T> List<T>
query(PreparedStatementCreator psc, RowMapper<T> rowMapper)
Query using a prepared statement, mapping each row to a Java object via a RowMapper.
<T> T
query(String sql, Object[] args, int[] argTypes, ResultSetExtractor<T> rse)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.
 void query(String sql, Object[] args, int[] argTypes, RowCallbackHandler rch)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.
<T> List<T>
query(String sql, Object[] args, int[] argTypes, RowMapper<T> rowMapper)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.
<T> T
query(String sql, Object[] args, ResultSetExtractor<T> rse)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.
 void query(String sql, Object[] args, RowCallbackHandler rch)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.
<T> List<T>
query(String sql, Object[] args, RowMapper<T> rowMapper)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.
<T> T
query(String sql, PreparedStatementSetter pss, ResultSetExtractor<T> rse)
Query using a prepared statement, reading the ResultSet with a ResultSetExtractor.
 void query(String sql, PreparedStatementSetter pss, RowCallbackHandler rch)
Query given SQL to create a prepared statement from SQL and a PreparedStatementSetter implementation that knows how to bind values to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.
<T> List<T>
query(String sql, PreparedStatementSetter pss, RowMapper<T> rowMapper)
Query given SQL to create a prepared statement from SQL and a PreparedStatementSetter implementation that knows how to bind values to the query, mapping each row to a Java object via a RowMapper.
<T> T
query(String sql, ResultSetExtractor<T> rse)
Execute a query given static SQL, reading the ResultSet with a ResultSetExtractor.
<T> T
query(String sql, ResultSetExtractor<T> rse, Object... args)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.
 void query(String sql, RowCallbackHandler rch)
Execute a query given static SQL, reading the ResultSet on a per-row basis with a RowCallbackHandler.
 void query(String sql, RowCallbackHandler rch, Object... args)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.
<T> List<T>
query(String sql, RowMapper<T> rowMapper)
Execute a query given static SQL, mapping each row to a Java object via a RowMapper.
<T> List<T>
query(String sql, RowMapper<T> rowMapper, Object... args)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.
 int queryForInt(String sql)
Execute a query that results in an int value, given static SQL.
 int queryForInt(String sql, Object... args)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in an int value.
 int queryForInt(String sql, Object[] args, int[] argTypes)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in an int value.
 List<Map<String,Object>> queryForList(String sql)
Execute a query for a result list, given static SQL.
<T> List<T>
queryForList(String sql, Class<T> elementType)
Execute a query for a result list, given static SQL.
<T> List<T>
queryForList(String sql, Class<T> elementType, Object... args)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
 List<Map<String,Object>> queryForList(String sql, Object... args)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
<T> List<T>
queryForList(String sql, Object[] args, Class<T> elementType)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
 List<Map<String,Object>> queryForList(String sql, Object[] args, int[] argTypes)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
<T> List<T>
queryForList(String sql, Object[] args, int[] argTypes, Class<T> elementType)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
 long queryForLong(String sql)
Execute a query that results in a long value, given static SQL.
 long queryForLong(String sql, Object... args)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in a long value.
 long queryForLong(String sql, Object[] args, int[] argTypes)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in a long value.
 Map<String,Object> queryForMap(String sql)
Execute a query for a result Map, given static SQL.
 Map<String,Object> queryForMap(String sql, Object... args)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result Map.
 Map<String,Object> queryForMap(String sql, Object[] args, int[] argTypes)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result Map.
<T> T
queryForObject(String sql, Class<T> requiredType)
Execute a query for a result object, given static SQL.
<T> T
queryForObject(String sql, Class<T> requiredType, Object... args)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.
<T> T
queryForObject(String sql, Object[] args, Class<T> requiredType)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.
<T> T
queryForObject(String sql, Object[] args, int[] argTypes, Class<T> requiredType)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.
<T> T
queryForObject(String sql, Object[] args, int[] argTypes, RowMapper<T> rowMapper)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.
<T> T
queryForObject(String sql, Object[] args, RowMapper<T> rowMapper)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.
<T> T
queryForObject(String sql, RowMapper<T> rowMapper)
Execute a query given static SQL, mapping a single result row to a Java object via a RowMapper.
<T> T
queryForObject(String sql, RowMapper<T> rowMapper, Object... args)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.
 SqlRowSet queryForRowSet(String sql)
Execute a query for a SqlRowSet, given static SQL.
 SqlRowSet queryForRowSet(String sql, Object... args)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a SqlRowSet.
 SqlRowSet queryForRowSet(String sql, Object[] args, int[] argTypes)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a SqlRowSet.
 void setFetchSize(int fetchSize)
Set the fetch size for this JdbcTemplate.
 void setIgnoreWarnings(boolean ignoreWarnings)
Set whether or not we want to ignore SQLWarnings.
 void setMaxRows(int maxRows)
Set the maximum number of rows for this JdbcTemplate.
 void setNativeJdbcExtractor(NativeJdbcExtractor extractor)
Set a NativeJdbcExtractor to extract native JDBC objects from wrapped handles.
 void setQueryTimeout(int queryTimeout)
Set the query timeout for statements that this JdbcTemplate executes.
 void setResultsMapCaseInsensitive(boolean resultsMapCaseInsensitive)
Set whether execution of a CallableStatement will return the results in a Map that uses case insensitive names for the parameters.
 void setSkipResultsProcessing(boolean skipResultsProcessing)
Set whether results processing should be skipped.
 void setSkipUndeclaredResults(boolean skipUndeclaredResults)
Set whether undelared results should be skipped.
 int update(PreparedStatementCreator psc)
Issue a single SQL update operation (such as an insert, update or delete statement) using a PreparedStatementCreator to provide SQL and any required parameters.
 int update(PreparedStatementCreator psc, KeyHolder generatedKeyHolder)
Issue an update statement using a PreparedStatementCreator to provide SQL and any required parameters.
protected  int update(PreparedStatementCreator psc, PreparedStatementSetter pss)
 int update(String sql)
Issue a single SQL update operation (such as an insert, update or delete statement).
 int update(String sql, Object... args)
Issue a single SQL update operation (such as an insert, update or delete statement) via a prepared statement, binding the given arguments.
 int update(String sql, Object[] args, int[] argTypes)
Issue a single SQL update operation (such as an insert, update or delete statement) via a prepared statement, binding the given arguments.
 int update(String sql, PreparedStatementSetter pss)
Issue an update statement using a PreparedStatementSetter to set bind parameters, with given SQL.
Methods inherited from class org.springframework.jdbc.support.JdbcAccessor
afterPropertiesSet, getDataSource, getExceptionTranslator, isLazyInit, setDatabaseProductName, setDataSource, setExceptionTranslator, setLazyInit
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JdbcTemplate

public JdbcTemplate()
Construct a new JdbcTemplate for bean usage.

Note: The DataSource has to be set before using the instance.

See Also:
JdbcAccessor.setDataSource(javax.sql.DataSource)

JdbcTemplate

public JdbcTemplate(DataSource dataSource)
Construct a new JdbcTemplate, given a DataSource to obtain connections from.

Note: This will not trigger initialization of the exception translator.

Parameters:
dataSource - the JDBC DataSource to obtain connections from

JdbcTemplate

public JdbcTemplate(DataSource dataSource,
                    boolean lazyInit)
Construct a new JdbcTemplate, given a DataSource to obtain connections from.

Note: Depending on the "lazyInit" flag, initialization of the exception translator will be triggered.

Parameters:
dataSource - the JDBC DataSource to obtain connections from
lazyInit - whether to lazily initialize the SQLExceptionTranslator
Method Detail

setNativeJdbcExtractor

public void setNativeJdbcExtractor(NativeJdbcExtractor extractor)
Set a NativeJdbcExtractor to extract native JDBC objects from wrapped handles. Useful if native Statement and/or ResultSet handles are expected for casting to database-specific implementation classes, but a connection pool that wraps JDBC objects is used (note: any pool will return wrapped Connections).

getNativeJdbcExtractor

public NativeJdbcExtractor getNativeJdbcExtractor()
Return the current NativeJdbcExtractor implementation.

setIgnoreWarnings

public void setIgnoreWarnings(boolean ignoreWarnings)
Set whether or not we want to ignore SQLWarnings.

Default is "true", swallowing and logging all warnings. Switch this flag to "false" to make the JdbcTemplate throw a SQLWarningException instead.

See Also:
SQLWarning, SQLWarningException, handleWarnings(java.sql.Statement)

isIgnoreWarnings

public boolean isIgnoreWarnings()
Return whether or not we ignore SQLWarnings.

setFetchSize

public void setFetchSize(int fetchSize)
Set the fetch size for this JdbcTemplate. This is important for processing large result sets: Setting this higher than the default value will increase processing speed at the cost of memory consumption; setting this lower can avoid transferring row data that will never be read by the application.

Default is 0, indicating to use the JDBC driver's default.

See Also:
Statement.setFetchSize(int)

getFetchSize

public int getFetchSize()
Return the fetch size specified for this JdbcTemplate.

setMaxRows

public void setMaxRows(int maxRows)
Set the maximum number of rows for this JdbcTemplate. This is important for processing subsets of large result sets, avoiding to read and hold the entire result set in the database or in the JDBC driver if we're never interested in the entire result in the first place (for example, when performing searches that might return a large number of matches).

Default is 0, indicating to use the JDBC driver's default.

See Also:
Statement.setMaxRows(int)

getMaxRows

public int getMaxRows()
Return the maximum number of rows specified for this JdbcTemplate.

setQueryTimeout

public void setQueryTimeout(int queryTimeout)
Set the query timeout for statements that this JdbcTemplate executes.

Default is 0, indicating to use the JDBC driver's default.

Note: Any timeout specified here will be overridden by the remaining transaction timeout when executing within a transaction that has a timeout specified at the transaction level.

See Also:
Statement.setQueryTimeout(int)

getQueryTimeout

public int getQueryTimeout()
Return the query timeout for statements that this JdbcTemplate executes.

setSkipResultsProcessing

public void setSkipResultsProcessing(boolean skipResultsProcessing)
Set whether results processing should be skipped. Can be used to optimize callable statement processing when we know that no results are being passed back - the processing of out parameter will still take place. This can be used to avoid a bug in some older Oracle JDBC drivers like 10.1.0.2.

isSkipResultsProcessing

public boolean isSkipResultsProcessing()
Return whether results processing should be skipped.

setSkipUndeclaredResults

public void setSkipUndeclaredResults(boolean skipUndeclaredResults)
Set whether undelared results should be skipped.

isSkipUndeclaredResults

public boolean isSkipUndeclaredResults()
Return whether undeclared results should be skipped.

setResultsMapCaseInsensitive

public void setResultsMapCaseInsensitive(boolean resultsMapCaseInsensitive)
Set whether execution of a CallableStatement will return the results in a Map that uses case insensitive names for the parameters.

isResultsMapCaseInsensitive

public boolean isResultsMapCaseInsensitive()
Return whether execution of a CallableStatement will return the results in a Map that uses case insensitive names for the parameters.

execute

public <T> T execute(ConnectionCallback<T> action)
          throws DataAccessException
Description copied from interface: JdbcOperations
Execute a JDBC data access operation, implemented as callback action working on a JDBC Connection. This allows for implementing arbitrary data access operations, within Spring's managed JDBC environment: that is, participating in Spring-managed transactions and converting JDBC SQLExceptions into Spring's DataAccessException hierarchy.

The callback action can return a result object, for example a domain object or a collection of domain objects.

Specified by:
execute in interface JdbcOperations
Parameters:
action - the callback object that specifies the action
Returns:
a result object returned by the action, or null
Throws:
DataAccessException - if there is any problem

createConnectionProxy

protected Connection createConnectionProxy(Connection con)
Create a close-suppressing proxy for the given JDBC Connection. Called by the execute method.

The proxy also prepares returned JDBC Statements, applying statement settings such as fetch size, max rows, and query timeout.

Parameters:
con - the JDBC Connection to create a proxy for
Returns:
the Connection proxy
See Also:
Connection.close(), execute(ConnectionCallback), applyStatementSettings(java.sql.Statement)

execute

public <T> T execute(StatementCallback<T> action)
          throws DataAccessException
Description copied from interface: JdbcOperations
Execute a JDBC data access operation, implemented as callback action working on a JDBC Statement. This allows for implementing arbitrary data access operations on a single Statement, within Spring's managed JDBC environment: that is, participating in Spring-managed transactions and converting JDBC SQLExceptions into Spring's DataAccessException hierarchy.

The callback action can return a result object, for example a domain object or a collection of domain objects.

Specified by:
execute in interface JdbcOperations
Parameters:
action - callback object that specifies the action
Returns:
a result object returned by the action, or null
Throws:
DataAccessException - if there is any problem

execute

public void execute(String sql)
             throws DataAccessException
Description copied from interface: JdbcOperations
Issue a single SQL execute, typically a DDL statement.

Specified by:
execute in interface JdbcOperations
Parameters:
sql - static SQL to execute
Throws:
DataAccessException - if there is any problem

query

public <T> T query(String sql,
                   ResultSetExtractor<T> rse)
        throws DataAccessException
Description copied from interface: JdbcOperations
Execute a query given static SQL, reading the ResultSet with a ResultSetExtractor.

Uses a JDBC Statement, not a PreparedStatement. If you want to execute a static query with a PreparedStatement, use the overloaded query method with null as argument array.

Specified by:
query in interface JdbcOperations
Parameters:
sql - SQL query to execute
rse - object that will extract all rows of results
Returns:
an arbitrary result object, as returned by the ResultSetExtractor
Throws:
DataAccessException - if there is any problem executing the query
See Also:
JdbcOperations.query(String, Object[], ResultSetExtractor)

query

public void query(String sql,
                  RowCallbackHandler rch)
           throws DataAccessException
Description copied from interface: JdbcOperations
Execute a query given static SQL, reading the ResultSet on a per-row basis with a RowCallbackHandler.

Uses a JDBC Statement, not a PreparedStatement. If you want to execute a static query with a PreparedStatement, use the overloaded query method with null as argument array.

Specified by:
query in interface JdbcOperations
Parameters:
sql - SQL query to execute
rch - object that will extract results, one row at a time
Throws:
DataAccessException - if there is any problem executing the query
See Also:
JdbcOperations.query(String, Object[], RowCallbackHandler)

query

public <T> List<T> query(String sql,
                         RowMapper<T> rowMapper)
              throws DataAccessException
Description copied from interface: JdbcOperations
Execute a query given static SQL, mapping each row to a Java object via a RowMapper.

Uses a JDBC Statement, not a PreparedStatement. If you want to execute a static query with a PreparedStatement, use the overloaded query method with null as argument array.

Specified by:
query in interface JdbcOperations
Parameters:
sql - SQL query to execute
rowMapper - object that will map one object per row
Returns:
the result List, containing mapped objects
Throws:
DataAccessException - if there is any problem executing the query
See Also:
JdbcOperations.query(String, Object[], RowMapper)

queryForMap

public Map<String,Object> queryForMap(String sql)
                               throws DataAccessException
Description copied from interface: JdbcOperations
Execute a query for a result Map, given static SQL.

Uses a JDBC Statement, not a PreparedStatement. If you want to execute a static query with a PreparedStatement, use the overloaded queryForMap method with null as argument array.

The query is expected to be a single row query; the result row will be mapped to a Map (one entry for each column, using the column name as the key).

Specified by:
queryForMap in interface JdbcOperations
Parameters:
sql - SQL query to execute
Returns:
the result Map (one entry for each column, using the column name as the key)
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row
DataAccessException - if there is any problem executing the query
See Also:
JdbcOperations.queryForMap(String, Object[]), ColumnMapRowMapper

queryForObject

public <T> T queryForObject(String sql,
                            RowMapper<T> rowMapper)
                 throws DataAccessException
Description copied from interface: JdbcOperations
Execute a query given static SQL, mapping a single result row to a Java object via a RowMapper.

Uses a JDBC Statement, not a PreparedStatement. If you want to execute a static query with a PreparedStatement, use the overloaded queryForObject method with null as argument array.

Specified by:
queryForObject in interface JdbcOperations
Parameters:
sql - SQL query to execute
rowMapper - object that will map one object per row
Returns:
the single mapped object
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row
DataAccessException - if there is any problem executing the query
See Also:
JdbcOperations.queryForObject(String, Object[], RowMapper)

queryForObject

public <T> T queryForObject(String sql,
                            Class<T> requiredType)
                 throws DataAccessException
Description copied from interface: JdbcOperations
Execute a query for a result object, given static SQL.

Uses a JDBC Statement, not a PreparedStatement. If you want to execute a static query with a PreparedStatement, use the overloaded queryForObject method with null as argument array.

This method is useful for running static SQL with a known outcome. The query is expected to be a single row/single column query; the returned result will be directly mapped to the corresponding object type.

Specified by:
queryForObject in interface JdbcOperations
Parameters:
sql - SQL query to execute
requiredType - the type that the result object is expected to match
Returns:
the result object of the required type, or null in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if there is any problem executing the query
See Also:
JdbcOperations.queryForObject(String, Object[], Class)

queryForLong

public long queryForLong(String sql)
                  throws DataAccessException
Description copied from interface: JdbcOperations
Execute a query that results in a long value, given static SQL.

Uses a JDBC Statement, not a PreparedStatement. If you want to execute a static query with a PreparedStatement, use the overloaded queryForLong method with null as argument array.

This method is useful for running static SQL with a known outcome. The query is expected to be a single row/single column query that results in a long value.

Specified by:
queryForLong in interface JdbcOperations
Parameters:
sql - SQL query to execute
Returns:
the long value, or 0 in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if there is any problem executing the query
See Also:
JdbcOperations.queryForLong(String, Object[])

queryForInt

public int queryForInt(String sql)
                throws DataAccessException
Description copied from interface: JdbcOperations
Execute a query that results in an int value, given static SQL.

Uses a JDBC Statement, not a PreparedStatement. If you want to execute a static query with a PreparedStatement, use the overloaded queryForInt method with null as argument array.

This method is useful for running static SQL with a known outcome. The query is expected to be a single row/single column query that results in an int value.

Specified by:
queryForInt in interface JdbcOperations
Parameters:
sql - SQL query to execute
Returns:
the int value, or 0 in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if there is any problem executing the query
See Also:
JdbcOperations.queryForInt(String, Object[])

queryForList

public <T> List<T> queryForList(String sql,
                                Class<T> elementType)
                     throws DataAccessException
Description copied from interface: JdbcOperations
Execute a query for a result list, given static SQL.

Uses a JDBC Statement, not a PreparedStatement. If you want to execute a static query with a PreparedStatement, use the overloaded queryForList method with null as argument array.

The results will be mapped to a List (one entry for each row) of result objects, each of them matching the specified element type.

Specified by:
queryForList in interface JdbcOperations
Parameters:
sql - SQL query to execute
elementType - the required type of element in the result list (for example, Integer.class)
Returns:
a List of objects that match the specified element type
Throws:
DataAccessException - if there is any problem executing the query
See Also:
JdbcOperations.queryForList(String, Object[], Class), SingleColumnRowMapper

queryForList

public List<Map<String,Object>> queryForList(String sql)
                                      throws DataAccessException
Description copied from interface: JdbcOperations
Execute a query for a result list, given static SQL.

Uses a JDBC Statement, not a PreparedStatement. If you want to execute a static query with a PreparedStatement, use the overloaded queryForList method with null as argument array.

The results will be mapped to a List (one entry for each row) of Maps (one entry for each column using the column name as the key). Each element in the list will be of the form returned by this interface's queryForMap() methods.

Specified by:
queryForList in interface JdbcOperations
Parameters:
sql - SQL query to execute
Returns:
an List that contains a Map per row
Throws:
DataAccessException - if there is any problem executing the query
See Also:
JdbcOperations.queryForList(String, Object[])

queryForRowSet

public SqlRowSet queryForRowSet(String sql)
                         throws DataAccessException
Description copied from interface: JdbcOperations
Execute a query for a SqlRowSet, given static SQL.

Uses a JDBC Statement, not a PreparedStatement. If you want to execute a static query with a PreparedStatement, use the overloaded queryForRowSet method with null as argument array.

The results will be mapped to an SqlRowSet which holds the data in a disconnected fashion. This wrapper will translate any SQLExceptions thrown.

Note that that, for the default implementation, JDBC RowSet support needs to be available at runtime: by default, Sun's com.sun.rowset.CachedRowSetImpl class is used, which is part of JDK 1.5+ and also available separately as part of Sun's JDBC RowSet Implementations download (rowset.jar).

Specified by:
queryForRowSet in interface JdbcOperations
Parameters:
sql - SQL query to execute
Returns:
a SqlRowSet representation (possibly a wrapper around a javax.sql.rowset.CachedRowSet)
Throws:
DataAccessException - if there is any problem executing the query
See Also:
JdbcOperations.queryForRowSet(String, Object[]), SqlRowSetResultSetExtractor, CachedRowSet

update

public int update(String sql)
           throws DataAccessException
Description copied from interface: JdbcOperations
Issue a single SQL update operation (such as an insert, update or delete statement).

Specified by:
update in interface JdbcOperations
Parameters:
sql - static SQL to execute
Returns:
the number of rows affected
Throws:
DataAccessException - if there is any problem.

batchUpdate

public int[] batchUpdate(String[] sql)
                  throws DataAccessException
Description copied from interface: JdbcOperations
Issue multiple SQL updates on a single JDBC Statement using batching.

Will fall back to separate updates on a single Statement if the JDBC driver does not support batch updates.

Specified by:
batchUpdate in interface JdbcOperations
Parameters:
sql - defining an array of SQL statements that will be executed.
Returns:
an array of the number of rows affected by each statement
Throws:
DataAccessException - if there is any problem executing the batch

execute

public <T> T execute(PreparedStatementCreator psc,
                     PreparedStatementCallback<T> action)
          throws DataAccessException
Description copied from interface: JdbcOperations
Execute a JDBC data access operation, implemented as callback action working on a JDBC PreparedStatement. This allows for implementing arbitrary data access operations on a single Statement, within Spring's managed JDBC environment: that is, participating in Spring-managed transactions and converting JDBC SQLExceptions into Spring's DataAccessException hierarchy.

The callback action can return a result object, for example a domain object or a collection of domain objects.

Specified by:
execute in interface JdbcOperations
Parameters:
psc - object that can create a PreparedStatement given a Connection
action - callback object that specifies the action
Returns:
a result object returned by the action, or null
Throws:
DataAccessException - if there is any problem

execute

public <T> T execute(String sql,
                     PreparedStatementCallback<T> action)
          throws DataAccessException
Description copied from interface: JdbcOperations
Execute a JDBC data access operation, implemented as callback action working on a JDBC PreparedStatement. This allows for implementing arbitrary data access operations on a single Statement, within Spring's managed JDBC environment: that is, participating in Spring-managed transactions and converting JDBC SQLExceptions into Spring's DataAccessException hierarchy.

The callback action can return a result object, for example a domain object or a collection of domain objects.

Specified by:
execute in interface JdbcOperations
Parameters:
sql - SQL to execute
action - callback object that specifies the action
Returns:
a result object returned by the action, or null
Throws:
DataAccessException - if there is any problem

query

public <T> T query(PreparedStatementCreator psc,
                   PreparedStatementSetter pss,
                   ResultSetExtractor<T> rse)
        throws DataAccessException
Query using a prepared statement, allowing for a PreparedStatementCreator and a PreparedStatementSetter. Most other query methods use this method, but application code will always work with either a creator or a setter.

Parameters:
psc - Callback handler that can create a PreparedStatement given a Connection
pss - object that knows how to set values on the prepared statement. If this is null, the SQL will be assumed to contain no bind parameters.
rse - object that will extract results.
Returns:
an arbitrary result object, as returned by the ResultSetExtractor
Throws:
DataAccessException - if there is any problem

query

public <T> T query(PreparedStatementCreator psc,
                   ResultSetExtractor<T> rse)
        throws DataAccessException
Description copied from interface: JdbcOperations
Query using a prepared statement, reading the ResultSet with a ResultSetExtractor.

A PreparedStatementCreator can either be implemented directly or configured through a PreparedStatementCreatorFactory.

Specified by:
query in interface JdbcOperations
Parameters:
psc - object that can create a PreparedStatement given a Connection
rse - object that will extract results
Returns:
an arbitrary result object, as returned by the ResultSetExtractor
Throws:
DataAccessException - if there is any problem
See Also:
PreparedStatementCreatorFactory

query

public <T> T query(String sql,
                   PreparedStatementSetter pss,
                   ResultSetExtractor<T> rse)
        throws DataAccessException
Description copied from interface: JdbcOperations
Query using a prepared statement, reading the ResultSet with a ResultSetExtractor.

Specified by:
query in interface JdbcOperations
Parameters:
sql - SQL query to execute
pss - object that knows how to set values on the prepared statement. If this is null, the SQL will be assumed to contain no bind parameters. Even if there are no bind parameters, this object may be used to set fetch size and other performance options.
rse - object that will extract results
Returns:
an arbitrary result object, as returned by the ResultSetExtractor
Throws:
DataAccessException - if there is any problem

query

public <T> T query(String sql,
                   Object[] args,
                   int[] argTypes,
                   ResultSetExtractor<T> rse)
        throws DataAccessException
Description copied from interface: JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.

Specified by:
query in interface JdbcOperations
Parameters:
sql - SQL query to execute
args - arguments to bind to the query
argTypes - SQL types of the arguments (constants from java.sql.Types)
rse - object that will extract results
Returns:
an arbitrary result object, as returned by the ResultSetExtractor
Throws:
DataAccessException - if the query fails
See Also:
Types

query

public <T> T query(String sql,
                   Object[] args,
                   ResultSetExtractor<T> rse)
        throws DataAccessException
Description copied from interface: JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.

Specified by:
query in interface JdbcOperations
Parameters:
sql - SQL query to execute
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
rse - object that will extract results
Returns:
an arbitrary result object, as returned by the ResultSetExtractor
Throws:
DataAccessException - if the query fails

query

public <T> T query(String sql,
                   ResultSetExtractor<T> rse,
                   Object... args)
        throws DataAccessException
Description copied from interface: JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.

Specified by:
query in interface JdbcOperations
Parameters:
sql - SQL query to execute
rse - object that will extract results
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
Returns:
an arbitrary result object, as returned by the ResultSetExtractor
Throws:
DataAccessException - if the query fails

query

public void query(PreparedStatementCreator psc,
                  RowCallbackHandler rch)
           throws DataAccessException
Description copied from interface: JdbcOperations
Query using a prepared statement, reading the ResultSet on a per-row basis with a RowCallbackHandler.

A PreparedStatementCreator can either be implemented directly or configured through a PreparedStatementCreatorFactory.

Specified by:
query in interface JdbcOperations
Parameters:
psc - object that can create a PreparedStatement given a Connection
rch - object that will extract results, one row at a time
Throws:
DataAccessException - if there is any problem
See Also:
PreparedStatementCreatorFactory

query

public void query(String sql,
                  PreparedStatementSetter pss,
                  RowCallbackHandler rch)
           throws DataAccessException
Description copied from interface: JdbcOperations
Query given SQL to create a prepared statement from SQL and a PreparedStatementSetter implementation that knows how to bind values to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.

Specified by:
query in interface JdbcOperations
Parameters:
sql - SQL query to execute
pss - object that knows how to set values on the prepared statement. If this is null, the SQL will be assumed to contain no bind parameters. Even if there are no bind parameters, this object may be used to set fetch size and other performance options.
rch - object that will extract results, one row at a time
Throws:
DataAccessException - if the query fails

query

public void query(String sql,
                  Object[] args,
                  int[] argTypes,
                  RowCallbackHandler rch)
           throws DataAccessException
Description copied from interface: JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.

Specified by:
query in interface JdbcOperations
Parameters:
sql - SQL query to execute
args - arguments to bind to the query
argTypes - SQL types of the arguments (constants from java.sql.Types)
rch - object that will extract results, one row at a time
Throws:
DataAccessException - if the query fails
See Also:
Types

query

public void query(String sql,
                  Object[] args,
                  RowCallbackHandler rch)
           throws DataAccessException
Description copied from interface: JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.

Specified by:
query in interface JdbcOperations
Parameters:
sql - SQL query to execute
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
rch - object that will extract results, one row at a time
Throws:
DataAccessException - if the query fails

query

public void query(String sql,
                  RowCallbackHandler rch,
                  Object... args)
           throws DataAccessException
Description copied from interface: JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.

Specified by:
query in interface JdbcOperations
Parameters:
sql - SQL query to execute
rch - object that will extract results, one row at a time
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
Throws:
DataAccessException - if the query fails

query

public <T> List<T> query(PreparedStatementCreator psc,
                         RowMapper<T> rowMapper)
              throws DataAccessException
Description copied from interface: JdbcOperations
Query using a prepared statement, mapping each row to a Java object via a RowMapper.

A PreparedStatementCreator can either be implemented directly or configured through a PreparedStatementCreatorFactory.

Specified by:
query in interface JdbcOperations
Parameters:
psc - object that can create a PreparedStatement given a Connection
rowMapper - object that will map one object per row
Returns:
the result List, containing mapped objects
Throws:
DataAccessException - if there is any problem
See Also:
PreparedStatementCreatorFactory

query

public <T> List<T> query(String sql,
                         PreparedStatementSetter pss,
                         RowMapper<T> rowMapper)
              throws DataAccessException
Description copied from interface: JdbcOperations
Query given SQL to create a prepared statement from SQL and a PreparedStatementSetter implementation that knows how to bind values to the query, mapping each row to a Java object via a RowMapper.

Specified by:
query in interface JdbcOperations
Parameters:
sql - SQL query to execute
pss - object that knows how to set values on the prepared statement. If this is null, the SQL will be assumed to contain no bind parameters. Even if there are no bind parameters, this object may be used to set fetch size and other performance options.
rowMapper - object that will map one object per row
Returns:
the result List, containing mapped objects
Throws:
DataAccessException - if the query fails

query

public <T> List<T> query(String sql,
                         Object[] args,
                         int[] argTypes,
                         RowMapper<T> rowMapper)
              throws DataAccessException
Description copied from interface: JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.

Specified by:
query in interface JdbcOperations
Parameters:
sql - SQL query to execute
args - arguments to bind to the query
argTypes - SQL types of the arguments (constants from java.sql.Types)
rowMapper - object that will map one object per row
Returns:
the result List, containing mapped objects
Throws:
DataAccessException - if the query fails
See Also:
Types

query

public <T> List<T> query(String sql,
                         Object[] args,
                         RowMapper<T> rowMapper)
              throws DataAccessException
Description copied from interface: JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.

Specified by:
query in interface JdbcOperations
Parameters:
sql - SQL query to execute
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
rowMapper - object that will map one object per row
Returns:
the result List, containing mapped objects
Throws:
DataAccessException - if the query fails

query

public <T> List<T> query(String sql,
                         RowMapper<T> rowMapper,
                         Object... args)
              throws DataAccessException
Description copied from interface: JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.

Specified by:
query in interface JdbcOperations
Parameters:
sql - SQL query to execute
rowMapper - object that will map one object per row
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
Returns:
the result List, containing mapped objects
Throws:
DataAccessException - if the query fails

queryForObject

public <T> T queryForObject(String sql,
                            Object[] args,
                            int[] argTypes,
                            RowMapper<T> rowMapper)
                 throws DataAccessException
Description copied from interface: JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.

Specified by:
queryForObject in interface JdbcOperations
Parameters:
sql - SQL query to execute
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
argTypes - SQL types of the arguments (constants from java.sql.Types)
rowMapper - object that will map one object per row
Returns:
the single mapped object
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row
DataAccessException - if the query fails

queryForObject

public <T> T queryForObject(String sql,
                            Object[] args,
                            RowMapper<T> rowMapper)
                 throws DataAccessException
Description copied from interface: JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.

Specified by:
queryForObject in interface JdbcOperations
Parameters:
sql - SQL query to execute
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
rowMapper - object that will map one object per row
Returns:
the single mapped object
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row
DataAccessException - if the query fails

queryForObject

public <T> T queryForObject(String sql,
                            RowMapper<T> rowMapper,
                            Object... args)
                 throws DataAccessException
Description copied from interface: JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.

Specified by:
queryForObject in interface JdbcOperations
Parameters:
sql - SQL query to execute
rowMapper - object that will map one object per row
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
Returns:
the single mapped object
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row
DataAccessException - if the query fails

queryForObject

public <T> T queryForObject(String sql,
                            Object[] args,
                            int[] argTypes,
                            Class<T> requiredType)
                 throws DataAccessException
Description copied from interface: JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.

The query is expected to be a single row/single column query; the returned result will be directly mapped to the corresponding object type.

Specified by:
queryForObject in interface JdbcOperations
Parameters:
sql - SQL query to execute
args - arguments to bind to the query
argTypes - SQL types of the arguments (constants from java.sql.Types)
requiredType - the type that the result object is expected to match
Returns:
the result object of the required type, or null in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails
See Also:
JdbcOperations.queryForObject(String, Class), Types

queryForObject

public <T> T queryForObject(String sql,
                            Object[] args,
                            Class<T> requiredType)
                 throws DataAccessException
Description copied from interface: JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.

The query is expected to be a single row/single column query; the returned result will be directly mapped to the corresponding object type.

Specified by:
queryForObject in interface JdbcOperations
Parameters:
sql - SQL query to execute
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
requiredType - the type that the result object is expected to match
Returns:
the result object of the required type, or null in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails
See Also:
JdbcOperations.queryForObject(String, Class)

queryForObject

public <T> T queryForObject(String sql,
                            Class<T> requiredType,
                            Object... args)
                 throws DataAccessException
Description copied from interface: JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.

The query is expected to be a single row/single column query; the returned result will be directly mapped to the corresponding object type.

Specified by:
queryForObject in interface JdbcOperations
Parameters:
sql - SQL query to execute
requiredType - the type that the result object is expected to match
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
Returns:
the result object of the required type, or null in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails
See Also:
JdbcOperations.queryForObject(String, Class)

queryForMap

public Map<String,Object> queryForMap(String sql,
                                      Object[] args,
                                      int[] argTypes)
                               throws DataAccessException
Description copied from interface: JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result Map.

The query is expected to be a single row query; the result row will be mapped to a Map (one entry for each column, using the column name as the key).

Specified by:
queryForMap in interface JdbcOperations
Parameters:
sql - SQL query to execute
args - arguments to bind to the query
argTypes - SQL types of the arguments (constants from java.sql.Types)
Returns:
the result Map (one entry for each column, using the column name as the key)
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row
DataAccessException - if the query fails
See Also:
JdbcOperations.queryForMap(String), ColumnMapRowMapper, Types

queryForMap

public Map<String,Object> queryForMap(String sql,
                                      Object... args)
                               throws DataAccessException
Description copied from interface: JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result Map. The queryForMap() methods defined by this interface are appropriate when you don't have a domain model. Otherwise, consider using one of the queryForObject() methods.

The query is expected to be a single row query; the result row will be mapped to a Map (one entry for each column, using the column name as the key).

Specified by:
queryForMap in interface JdbcOperations
Parameters:
sql - SQL query to execute
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
Returns:
the result Map (one entry for each column, using the column name as the key)
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row
DataAccessException - if the query fails
See Also:
JdbcOperations.queryForMap(String), ColumnMapRowMapper

queryForLong

public long queryForLong(String sql,
                         Object[] args,
                         int[] argTypes)
                  throws DataAccessException
Description copied from interface: JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in a long value.

The query is expected to be a single row/single column query that results in a long value.

Specified by:
queryForLong in interface JdbcOperations
Parameters:
sql - SQL query to execute
args - arguments to bind to the query
argTypes - SQL types of the arguments (constants from java.sql.Types)
Returns:
the long value, or 0 in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails
See Also:
JdbcOperations.queryForLong(String), Types

queryForLong

public long queryForLong(String sql,
                         Object... args)
                  throws DataAccessException
Description copied from interface: JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in a long value.

The query is expected to be a single row/single column query that results in a long value.

Specified by:
queryForLong in interface JdbcOperations
Parameters:
sql - SQL query to execute
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
Returns:
the long value, or 0 in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails
See Also:
JdbcOperations.queryForLong(String)

queryForInt

public int queryForInt(String sql,
                       Object[] args,
                       int[] argTypes)
                throws DataAccessException
Description copied from interface: JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in an int value.

The query is expected to be a single row/single column query that results in an int value.

Specified by:
queryForInt in interface JdbcOperations
Parameters:
sql - SQL query to execute
args - arguments to bind to the query
argTypes - SQL types of the arguments (constants from java.sql.Types)
Returns:
the int value, or 0 in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails
See Also:
JdbcOperations.queryForInt(String), Types

queryForInt

public int queryForInt(String sql,
                       Object... args)
                throws DataAccessException
Description copied from interface: JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in an int value.

The query is expected to be a single row/single column query that results in an int value.

Specified by:
queryForInt in interface JdbcOperations
Parameters:
sql - SQL query to execute
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
Returns:
the int value, or 0 in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails
See Also:
JdbcOperations.queryForInt(String)

queryForList

public <T> List<T> queryForList(String sql,
                                Object[] args,
                                int[] argTypes,
                                Class<T> elementType)
                     throws DataAccessException
Description copied from interface: JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.

The results will be mapped to a List (one entry for each row) of result objects, each of them matching the specified element type.

Specified by:
queryForList in interface JdbcOperations
Parameters:
sql - SQL query to execute
args - arguments to bind to the query
argTypes - SQL types of the arguments (constants from java.sql.Types)
elementType - the required type of element in the result list (for example, Integer.class)
Returns:
a List of objects that match the specified element type
Throws:
DataAccessException - if the query fails
See Also:
JdbcOperations.queryForList(String, Class), SingleColumnRowMapper

queryForList

public <T> List<T> queryForList(String sql,
                                Object[] args,
                                Class<T> elementType)
                     throws DataAccessException
Description copied from interface: JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.

The results will be mapped to a List (one entry for each row) of result objects, each of them matching the specified element type.

Specified by:
queryForList in interface JdbcOperations
Parameters:
sql - SQL query to execute
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
elementType - the required type of element in the result list (for example, Integer.class)
Returns:
a List of objects that match the specified element type
Throws:
DataAccessException - if the query fails
See Also:
JdbcOperations.queryForList(String, Class), SingleColumnRowMapper

queryForList

public <T> List<T> queryForList(String sql,
                                Class<T> elementType,
                                Object... args)
                     throws DataAccessException
Description copied from interface: JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.

The results will be mapped to a List (one entry for each row) of result objects, each of them matching the specified element type.

Specified by:
queryForList in interface JdbcOperations
Parameters:
sql - SQL query to execute
elementType - the required type of element in the result list (for example, Integer.class)
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
Returns:
a List of objects that match the specified element type
Throws:
DataAccessException - if the query fails
See Also:
JdbcOperations.queryForList(String, Class), SingleColumnRowMapper

queryForList

public List<Map<String,Object>> queryForList(String sql,
                                             Object[] args,
                                             int[] argTypes)
                                      throws DataAccessException
Description copied from interface: JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.

The results will be mapped to a List (one entry for each row) of Maps (one entry for each column, using the column name as the key). Thus Each element in the list will be of the form returned by this interface's queryForMap() methods.

Specified by:
queryForList in interface JdbcOperations
Parameters:
sql - SQL query to execute
args - arguments to bind to the query
argTypes - SQL types of the arguments (constants from java.sql.Types)
Returns:
a List that contains a Map per row
Throws:
DataAccessException - if the query fails
See Also:
JdbcOperations.queryForList(String), Types

queryForList

public List<Map<String,Object>> queryForList(String sql,
                                             Object... args)
                                      throws DataAccessException
Description copied from interface: JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.

The results will be mapped to a List (one entry for each row) of Maps (one entry for each column, using the column name as the key). Each element in the list will be of the form returned by this interface's queryForMap() methods.

Specified by:
queryForList in interface JdbcOperations
Parameters:
sql - SQL query to execute
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
Returns:
a List that contains a Map per row
Throws:
DataAccessException - if the query fails
See Also:
JdbcOperations.queryForList(String)

queryForRowSet

public SqlRowSet queryForRowSet(String sql,
                                Object[] args,
                                int[] argTypes)
                         throws DataAccessException
Description copied from interface: JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a SqlRowSet.

The results will be mapped to an SqlRowSet which holds the data in a disconnected fashion. This wrapper will translate any SQLExceptions thrown.

Note that that, for the default implementation, JDBC RowSet support needs to be available at runtime: by default, Sun's com.sun.rowset.CachedRowSetImpl class is used, which is part of JDK 1.5+ and also available separately as part of Sun's JDBC RowSet Implementations download (rowset.jar).

Specified by:
queryForRowSet in interface JdbcOperations
Parameters:
sql - SQL query to execute
args - arguments to bind to the query
argTypes - SQL types of the arguments (constants from java.sql.Types)
Returns:
a SqlRowSet representation (possibly a wrapper around a javax.sql.rowset.CachedRowSet)
Throws:
DataAccessException - if there is any problem executing the query
See Also:
JdbcOperations.queryForRowSet(String), SqlRowSetResultSetExtractor, CachedRowSet, Types

queryForRowSet

public SqlRowSet queryForRowSet(String sql,
                                Object... args)
                         throws DataAccessException
Description copied from interface: JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a SqlRowSet.

The results will be mapped to an SqlRowSet which holds the data in a disconnected fashion. This wrapper will translate any SQLExceptions thrown.

Note that that, for the default implementation, JDBC RowSet support needs to be available at runtime: by default, Sun's com.sun.rowset.CachedRowSetImpl class is used, which is part of JDK 1.5+ and also available separately as part of Sun's JDBC RowSet Implementations download (rowset.jar).

Specified by:
queryForRowSet in interface JdbcOperations
Parameters:
sql - SQL query to execute
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
Returns:
a SqlRowSet representation (possibly a wrapper around a javax.sql.rowset.CachedRowSet)
Throws:
DataAccessException - if there is any problem executing the query
See Also:
JdbcOperations.queryForRowSet(String), SqlRowSetResultSetExtractor, CachedRowSet

update

protected int update(PreparedStatementCreator psc,
                     PreparedStatementSetter pss)
              throws DataAccessException
Throws:
DataAccessException

update

public int update(PreparedStatementCreator psc)
           throws DataAccessException
Description copied from interface: JdbcOperations
Issue a single SQL update operation (such as an insert, update or delete statement) using a PreparedStatementCreator to provide SQL and any required parameters.

A PreparedStatementCreator can either be implemented directly or configured through a PreparedStatementCreatorFactory.

Specified by:
update in interface JdbcOperations
Parameters:
psc - object that provides SQL and any necessary parameters
Returns:
the number of rows affected
Throws:
DataAccessException - if there is any problem issuing the update
See Also:
PreparedStatementCreatorFactory

update

public int update(PreparedStatementCreator psc,
                  KeyHolder generatedKeyHolder)
           throws DataAccessException
Description copied from interface: JdbcOperations
Issue an update statement using a PreparedStatementCreator to provide SQL and any required parameters. Generated keys will be put into the given KeyHolder.

Note that the given PreparedStatementCreator has to create a statement with activated extraction of generated keys (a JDBC 3.0 feature). This can either be done directly or through using a PreparedStatementCreatorFactory.

Specified by:
update in interface JdbcOperations
Parameters:
psc - object that provides SQL and any necessary parameters
generatedKeyHolder - KeyHolder that will hold the generated keys
Returns:
the number of rows affected
Throws:
DataAccessException - if there is any problem issuing the update
See Also:
PreparedStatementCreatorFactory, GeneratedKeyHolder

update

public int update(String sql,
                  PreparedStatementSetter pss)
           throws DataAccessException
Description copied from interface: JdbcOperations
Issue an update statement using a PreparedStatementSetter to set bind parameters, with given SQL. Simpler than using a PreparedStatementCreator as this method will create the PreparedStatement: The PreparedStatementSetter just needs to set parameters.

Specified by:
update in interface JdbcOperations
Parameters:
sql - SQL containing bind parameters
pss - helper that sets bind parameters. If this is null we run an update with static SQL.
Returns:
the number of rows affected
Throws:
DataAccessException - if there is any problem issuing the update

update

public int update(String sql,
                  Object[] args,
                  int[] argTypes)
           throws DataAccessException
Description copied from interface: JdbcOperations
Issue a single SQL update operation (such as an insert, update or delete statement) via a prepared statement, binding the given arguments.

Specified by:
update in interface JdbcOperations
Parameters:
sql - SQL containing bind parameters
args - arguments to bind to the query
argTypes - SQL types of the arguments (constants from java.sql.Types)
Returns:
the number of rows affected
Throws:
DataAccessException - if there is any problem issuing the update
See Also:
Types

update

public int update(String sql,
                  Object... args)
           throws DataAccessException
Description copied from interface: JdbcOperations
Issue a single SQL update operation (such as an insert, update or delete statement) via a prepared statement, binding the given arguments.

Specified by:
update in interface JdbcOperations
Parameters:
sql - SQL containing bind parameters
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
Returns:
the number of rows affected
Throws:
DataAccessException - if there is any problem issuing the update

batchUpdate

public int[] batchUpdate(String sql,
                         BatchPreparedStatementSetter pss)
                  throws DataAccessException
Description copied from interface: JdbcOperations
Issue multiple update statements on a single PreparedStatement, using batch updates and a BatchPreparedStatementSetter to set values.

Will fall back to separate updates on a single PreparedStatement if the JDBC driver does not support batch updates.

Specified by:
batchUpdate in interface JdbcOperations
Parameters:
sql - defining PreparedStatement that will be reused. All statements in the batch will use the same SQL.
pss - object to set parameters on the PreparedStatement created by this method
Returns:
an array of the number of rows affected by each statement
Throws:
DataAccessException - if there is any problem issuing the update

execute

public <T> T execute(CallableStatementCreator csc,
                     CallableStatementCallback<T> action)
          throws DataAccessException
Description copied from interface: JdbcOperations
Execute a JDBC data access operation, implemented as callback action working on a JDBC CallableStatement. This allows for implementing arbitrary data access operations on a single Statement, within Spring's managed JDBC environment: that is, participating in Spring-managed transactions and converting JDBC SQLExceptions into Spring's DataAccessException hierarchy.

The callback action can return a result object, for example a domain object or a collection of domain objects.

Specified by:
execute in interface JdbcOperations
Parameters:
csc - object that can create a CallableStatement given a Connection
action - callback object that specifies the action
Returns:
a result object returned by the action, or null
Throws:
DataAccessException - if there is any problem

execute

public <T> T execute(String callString,
                     CallableStatementCallback<T> action)
          throws DataAccessException
Description copied from interface: JdbcOperations
Execute a JDBC data access operation, implemented as callback action working on a JDBC CallableStatement. This allows for implementing arbitrary data access operations on a single Statement, within Spring's managed JDBC environment: that is, participating in Spring-managed transactions and converting JDBC SQLExceptions into Spring's DataAccessException hierarchy.

The callback action can return a result object, for example a domain object or a collection of domain objects.

Specified by:
execute in interface JdbcOperations
Parameters:
callString - the SQL call string to execute
action - callback object that specifies the action
Returns:
a result object returned by the action, or null
Throws:
DataAccessException - if there is any problem

call

public Map<String,Object> call(CallableStatementCreator csc,
                               List<SqlParameter> declaredParameters)
                        throws DataAccessException
Description copied from interface: JdbcOperations
Execute a SQL call using a CallableStatementCreator to provide SQL and any required parameters.

Specified by:
call in interface JdbcOperations
Parameters:
csc - object that provides SQL and any necessary parameters
declaredParameters - list of declared SqlParameter objects
Returns:
Map of extracted out parameters
Throws:
DataAccessException - if there is any problem issuing the update

extractReturnedResults

protected Map<String,Object> extractReturnedResults(CallableStatement cs,
                                                    List updateCountParameters,
                                                    List resultSetParameters,
                                                    int updateCount)
                                             throws SQLException
Extract returned ResultSets from the completed stored procedure.

Parameters:
cs - JDBC wrapper for the stored procedure
updateCountParameters - Parameter list of declared update count parameters for the stored procedure
resultSetParameters - Parameter list of declared resturn resultSet parameters for the stored procedure
Returns:
Map that contains returned results
Throws:
SQLException

extractOutputParameters

protected Map<String,Object> extractOutputParameters(CallableStatement cs,
                                                     List<SqlParameter> parameters)
                                              throws SQLException
Extract output parameters from the completed stored procedure.

Parameters:
cs - JDBC wrapper for the stored procedure
parameters - parameter list for the stored procedure
Returns:
Map that contains returned results
Throws:
SQLException

processResultSet

protected Map<String,Object> processResultSet(ResultSet rs,
                                              ResultSetSupportingSqlParameter param)
                                       throws SQLException
Process the given ResultSet from a stored procedure.

Parameters:
rs - the ResultSet to process
param - the corresponding stored procedure parameter
Returns:
Map that contains returned results
Throws:
SQLException

getColumnMapRowMapper

protected RowMapper<Map<String,Object>> getColumnMapRowMapper()
Create a new RowMapper for reading columns as key-value pairs.

Returns:
the RowMapper to use
See Also:
ColumnMapRowMapper

getSingleColumnRowMapper

protected <T> RowMapper<T> getSingleColumnRowMapper(Class<T> requiredType)
Create a new RowMapper for reading result objects from a single column.

Parameters:
requiredType - the type that each result object is expected to match
Returns:
the RowMapper to use
See Also:
SingleColumnRowMapper

createResultsMap

protected Map<String,Object> createResultsMap()
Create a Map instance to be used as results map.

If "isResultsMapCaseInsensitive" has been set to true, a linked case-insensitive Map will be created.

Returns:
the results Map instance
See Also:
setResultsMapCaseInsensitive(boolean)

applyStatementSettings

protected void applyStatementSettings(Statement stmt)
                               throws SQLException
Prepare the given JDBC Statement (or PreparedStatement or CallableStatement), applying statement settings such as fetch size, max rows, and query timeout.

Parameters:
stmt - the JDBC Statement to prepare
Throws:
SQLException - if thrown by JDBC API
See Also:
setFetchSize(int), setMaxRows(int), setQueryTimeout(int), DataSourceUtils.applyTransactionTimeout(java.sql.Statement, javax.sql.DataSource)

newArgPreparedStatementSetter

protected PreparedStatementSetter newArgPreparedStatementSetter(Object[] args)
Create a new ArgPreparedStatementSetter using the args passed in. This method allows the creation to be overridden by sub-classes.

Parameters:
args - object array woth arguments
Returns:
the new PreparedStatementSetter

newArgTypePreparedStatementSetter

protected PreparedStatementSetter newArgTypePreparedStatementSetter(Object[] args,
                                                                    int[] argTypes)
Create a new ArgTypePreparedStatementSetter using the args and argTypes passed in. This method allows the creation to be overridden by sub-classes.

Parameters:
args - object array woth arguments
argTypes - int array of SQLTypes for arguments
Returns:
the new PreparedStatementSetter

handleWarnings

protected void handleWarnings(Statement stmt)
                       throws SQLException
Throw an SQLWarningException if we're not ignoring warnings, else log the warnings (at debug level).

Parameters:
stmt - the current JDBC statement
Throws:
SQLWarningException - if not ignoring warnings
SQLException
See Also:
SQLWarningException

handleWarnings

protected void handleWarnings(SQLWarning warning)
                       throws SQLWarningException
Throw an SQLWarningException if encountering an actual warning.

Parameters:
warning - the warnings object from the current statement. May be null, in which case this method does nothing.
Throws:
SQLWarningException - in case of an actual warning to be raised
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PreparedStatementCreatorFactory

org.springframework.jdbc.core
Class PreparedStatementCreatorFactory

java.lang.Object
    extended by  org.springframework.jdbc.core.PreparedStatementCreatorFactory

public class PreparedStatementCreatorFactory
extends Object

Helper class that efficiently creates multiple PreparedStatementCreator objects with different parameters based on a SQL statement and a single set of parameter declarations.

Author:
Rod Johnson, Thomas Risberg, Juergen Hoeller

Constructor Summary
PreparedStatementCreatorFactory(String sql)
Create a new factory.
PreparedStatementCreatorFactory(String sql, int[] types)
Create a new factory with the given SQL and JDBC types.
PreparedStatementCreatorFactory(String sql, List<SqlParameter> declaredParameters)
Create a new factory with the given SQL and parameters.
Method Summary
void | addParameter(SqlParameter param) Add a new declared parameter.
PreparedStatementCreator | newPreparedStatementCreator(List<?> params) Return a new PreparedStatementCreator for the given parameters.
PreparedStatementCreator | newPreparedStatementCreator(Object[] params) Return a new PreparedStatementCreator for the given parameters.
PreparedStatementCreator | newPreparedStatementCreator(String sqlToUse, Object[] params) Return a new PreparedStatementCreator for the given parameters.
PreparedStatementSetter | newPreparedStatementSetter(List params) Return a new PreparedStatementSetter for the given parameters.
PreparedStatementSetter | newPreparedStatementSetter(Object[] params) Return a new PreparedStatementSetter for the given parameters.
void | setGeneratedKeysColumnNames(String[] names) Set the column names of the auto-generated keys.
void | setNativeJdbcExtractor(NativeJdbcExtractor nativeJdbcExtractor) Specify the NativeJdbcExtractor to use for unwrapping PreparedStatements, if any.
void | setResultSetType(int resultSetType) Set whether to use prepared statements that return a specific type of ResultSet.
void | setReturnGeneratedKeys(boolean returnGeneratedKeys) Set whether prepared statements should be capable of returning auto-generated keys.
void | setUpdatableResults(boolean updatableResults) Set whether to use prepared statements capable of returning updatable ResultSets.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PreparedStatementCreatorFactory

public PreparedStatementCreatorFactory(String sql)
Create a new factory. Will need to add parameters via the addParameter(org.springframework.jdbc.core.SqlParameter) method or have no parameters.

PreparedStatementCreatorFactory

public PreparedStatementCreatorFactory(String sql,
                                       int[] types)
Create a new factory with the given SQL and JDBC types.

Parameters:
sql - SQL to execute
types - int array of JDBC types

PreparedStatementCreatorFactory

public PreparedStatementCreatorFactory(String sql,
                                       List<SqlParameter> declaredParameters)
Create a new factory with the given SQL and parameters.

Parameters:
sql - SQL
declaredParameters - list of SqlParameter objects
See Also:
SqlParameter
Method Detail

addParameter

public void addParameter(SqlParameter param)
Add a new declared parameter.

Order of parameter addition is significant.

Parameters:
param - the parameter to add to the list of declared parameters

setResultSetType

public void setResultSetType(int resultSetType)
Set whether to use prepared statements that return a specific type of ResultSet.

Parameters:
resultSetType - the ResultSet type
See Also:
ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.TYPE_SCROLL_SENSITIVE

setUpdatableResults

public void setUpdatableResults(boolean updatableResults)
Set whether to use prepared statements capable of returning updatable ResultSets.

setReturnGeneratedKeys

public void setReturnGeneratedKeys(boolean returnGeneratedKeys)
Set whether prepared statements should be capable of returning auto-generated keys.

setGeneratedKeysColumnNames

public void setGeneratedKeysColumnNames(String[] names)
Set the column names of the auto-generated keys.

setNativeJdbcExtractor

public void setNativeJdbcExtractor(NativeJdbcExtractor nativeJdbcExtractor)
Specify the NativeJdbcExtractor to use for unwrapping PreparedStatements, if any.

newPreparedStatementSetter

public PreparedStatementSetter newPreparedStatementSetter(List params)
Return a new PreparedStatementSetter for the given parameters.

Parameters:
params - list of parameters (may be null)

newPreparedStatementSetter

public PreparedStatementSetter newPreparedStatementSetter(Object[] params)
Return a new PreparedStatementSetter for the given parameters.

Parameters:
params - the parameter array (may be null)

newPreparedStatementCreator

public PreparedStatementCreator newPreparedStatementCreator(List<?> params)
Return a new PreparedStatementCreator for the given parameters.

Parameters:
params - list of parameters (may be null)

newPreparedStatementCreator

public PreparedStatementCreator newPreparedStatementCreator(Object[] params)
Return a new PreparedStatementCreator for the given parameters.

Parameters:
params - the parameter array (may be null)

newPreparedStatementCreator

public PreparedStatementCreator newPreparedStatementCreator(String sqlToUse,
                                                            Object[] params)
Return a new PreparedStatementCreator for the given parameters.

Parameters:
sqlToUse - the actual SQL statement to use (if different from the factory's, for example because of named parameter expanding)
params - the parameter array (may be null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResultSetSupportingSqlParameter

org.springframework.jdbc.core
Class ResultSetSupportingSqlParameter

java.lang.Object
    extended by  org.springframework.jdbc.core.SqlParameter
        extended by  org.springframework.jdbc.core.ResultSetSupportingSqlParameter
Direct Known Subclasses:
SqlOutParameter, SqlReturnResultSet
public class ResultSetSupportingSqlParameter
extends SqlParameter

Common base class for ResultSet-supporting SqlParameters like SqlOutParameter and SqlReturnResultSet.

Since:
1.0.2
Author:
Juergen Hoeller

Constructor Summary
ResultSetSupportingSqlParameter(String name, int sqlType)
Create a new ResultSetSupportingSqlParameter.
ResultSetSupportingSqlParameter(String name, int sqlType, int scale)
Create a new ResultSetSupportingSqlParameter.
ResultSetSupportingSqlParameter(String name, int sqlType, ResultSetExtractor rse)
Create a new ResultSetSupportingSqlParameter.
ResultSetSupportingSqlParameter(String name, int sqlType, RowCallbackHandler rch)
Create a new ResultSetSupportingSqlParameter.
ResultSetSupportingSqlParameter(String name, int sqlType, RowMapper rm)
Create a new ResultSetSupportingSqlParameter.
ResultSetSupportingSqlParameter(String name, int sqlType, String typeName)
Create a new ResultSetSupportingSqlParameter.
Method Summary
ResultSetExtractor | getResultSetExtractor() Return the ResultSetExtractor held by this parameter, if any.
RowCallbackHandler | getRowCallbackHandler() Return the RowCallbackHandler held by this parameter, if any.
RowMapper | getRowMapper() Return the RowMapper held by this parameter, if any.
boolean | isInputValueProvided() This implementation always returns false.
boolean | isResultSetSupported() Does this parameter support a ResultSet, i.e.
Methods inherited from class org.springframework.jdbc.core.SqlParameter
getName, getScale, getSqlType, getTypeName, isResultsParameter, sqlTypesToAnonymousParameterList
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ResultSetSupportingSqlParameter

public ResultSetSupportingSqlParameter(String name,
                                       int sqlType)
Create a new ResultSetSupportingSqlParameter.

Parameters:
name - name of the parameter, as used in input and output maps
sqlType - SQL type of the parameter according to java.sql.Types

ResultSetSupportingSqlParameter

public ResultSetSupportingSqlParameter(String name,
                                       int sqlType,
                                       int scale)
Create a new ResultSetSupportingSqlParameter.

Parameters:
name - name of the parameter, as used in input and output maps
sqlType - SQL type of the parameter according to java.sql.Types
scale - the number of digits after the decimal point (for DECIMAL and NUMERIC types)

ResultSetSupportingSqlParameter

public ResultSetSupportingSqlParameter(String name,
                                       int sqlType,
                                       String typeName)
Create a new ResultSetSupportingSqlParameter.

Parameters:
name - name of the parameter, as used in input and output maps
sqlType - SQL type of the parameter according to java.sql.Types
typeName - the type name of the parameter (optional)

ResultSetSupportingSqlParameter

public ResultSetSupportingSqlParameter(String name,
                                       int sqlType,
                                       ResultSetExtractor rse)
Create a new ResultSetSupportingSqlParameter.

Parameters:
name - name of the parameter, as used in input and output maps
sqlType - SQL type of the parameter according to java.sql.Types
rse - ResultSetExtractor to use for parsing the ResultSet

ResultSetSupportingSqlParameter

public ResultSetSupportingSqlParameter(String name,
                                       int sqlType,
                                       RowCallbackHandler rch)
Create a new ResultSetSupportingSqlParameter.

Parameters:
name - name of the parameter, as used in input and output maps
sqlType - SQL type of the parameter according to java.sql.Types
rch - RowCallbackHandler to use for parsing the ResultSet

ResultSetSupportingSqlParameter

public ResultSetSupportingSqlParameter(String name,
                                       int sqlType,
                                       RowMapper rm)
Create a new ResultSetSupportingSqlParameter.

Parameters:
name - name of the parameter, as used in input and output maps
sqlType - SQL type of the parameter according to java.sql.Types
rm - RowMapper to use for parsing the ResultSet
Method Detail

isResultSetSupported

public boolean isResultSetSupported()
Does this parameter support a ResultSet, i.e. does it hold a ResultSetExtractor, RowCallbackHandler or RowMapper?

getResultSetExtractor

public ResultSetExtractor getResultSetExtractor()
Return the ResultSetExtractor held by this parameter, if any.

getRowCallbackHandler

public RowCallbackHandler getRowCallbackHandler()
Return the RowCallbackHandler held by this parameter, if any.

getRowMapper

public RowMapper getRowMapper()
Return the RowMapper held by this parameter, if any.

isInputValueProvided

public boolean isInputValueProvided()

This implementation always returns false.

Overrides:
isInputValueProvided in class SqlParameter
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RowCountCallbackHandler

org.springframework.jdbc.core
Class RowCountCallbackHandler

java.lang.Object
    extended by  org.springframework.jdbc.core.RowCountCallbackHandler
All Implemented Interfaces:
RowCallbackHandler
public class RowCountCallbackHandler
extends Object
implements RowCallbackHandler

Implementation of RowCallbackHandler. Convenient superclass for callback handlers. An instance can only be used once.

We can either use this on its own (for example, in a test case, to ensure that our result sets have valid dimensions), or use it as a superclass for callback handlers that actually do something, and will benefit from the dimension information it provides.

A usage example with JdbcTemplate:

JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);  // reusable object

 RowCountCallbackHandler countCallback = new RowCountCallbackHandler();  // not reusable
 jdbcTemplate.query("select * from user", countCallback);
 int rowCount = countCallback.getRowCount();

Since:
May 3, 2001
Author:
Rod Johnson

Constructor Summary
RowCountCallbackHandler()
Method Summary
int | getColumnCount() Return the number of columns in this result set.
String[] | getColumnNames() Return the names of the columns.
int[] | getColumnTypes() Return the types of the columns as java.sql.Types constants Valid after processRow is invoked the first time.
int | getRowCount() Return the row count of this ResultSet Only valid after processing is complete
void | processRow(ResultSet rs) Implementation of ResultSetCallbackHandler.
protected void | processRow(ResultSet rs, int rowNum) Subclasses may override this to perform custom extraction or processing.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

RowCountCallbackHandler

public RowCountCallbackHandler()
Method Detail

processRow

public final void processRow(ResultSet rs)
                      throws SQLException
Implementation of ResultSetCallbackHandler. Work out column size if this is the first row, otherwise just count rows.

Subclasses can perform custom extraction or processing by overriding the processRow(ResultSet, int) method.

Specified by:
processRow in interface RowCallbackHandler
Parameters:
rs - the ResultSet to process (pre-initialized for the current row)
Throws:
SQLException - if a SQLException is encountered getting column values (that is, there's no need to catch SQLException)
See Also:
processRow(java.sql.ResultSet, int)

processRow

protected void processRow(ResultSet rs,
                          int rowNum)
                   throws SQLException
Subclasses may override this to perform custom extraction or processing. This class's implementation does nothing.

Parameters:
rs - ResultSet to extract data from. This method is invoked for each row
rowNum - number of the current row (starting from 0)
Throws:
SQLException

getColumnTypes

public final int[] getColumnTypes()
Return the types of the columns as java.sql.Types constants Valid after processRow is invoked the first time.

Returns:
the types of the columns as java.sql.Types constants. Indexed from 0 to n-1.

getColumnNames

public final String[] getColumnNames()
Return the names of the columns. Valid after processRow is invoked the first time.

Returns:
the names of the columns. Indexed from 0 to n-1.

getRowCount

public final int getRowCount()
Return the row count of this ResultSet Only valid after processing is complete

Returns:
the number of rows in this ResultSet

getColumnCount

public final int getColumnCount()
Return the number of columns in this result set. Valid once we've seen the first row, so subclasses can use it during processing

Returns:
the number of columns in this result set
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RowMapperResultSetExtractor

org.springframework.jdbc.core
Class RowMapperResultSetExtractor<T>

java.lang.Object
    extended by  org.springframework.jdbc.core.RowMapperResultSetExtractor<T>
All Implemented Interfaces:
ResultSetExtractor<List<T>>
public class RowMapperResultSetExtractor<T>
extends Object
implements ResultSetExtractor<List<T>>

Adapter implementation of the ResultSetExtractor interface that delegates to a RowMapper which is supposed to create an object for each row. Each object is added to the results List of this ResultSetExtractor.

Useful for the typical case of one object per row in the database table. The number of entries in the results list will match the number of rows.

Note that a RowMapper object is typically stateless and thus reusable; just the RowMapperResultSetExtractor adapter is stateful.

A usage example with JdbcTemplate:

JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);  // reusable object
 RowMapper rowMapper = new UserRowMapper();  // reusable object

 List allUsers = (List) jdbcTemplate.query(
     "select * from user",
     new RowMapperResultSetExtractor(rowMapper, 10));

 User user = (User) jdbcTemplate.queryForObject(
     "select * from user where id=?", new Object[] {id},
     new RowMapperResultSetExtractor(rowMapper, 1));

Alternatively, consider subclassing MappingSqlQuery from the jdbc.object package: Instead of working with separate JdbcTemplate and RowMapper objects, you can have executable query objects (containing row-mapping logic) there.

Since:
1.0.2
Author:
Juergen Hoeller
See Also:
RowMapper, JdbcTemplate, MappingSqlQuery

Constructor Summary
RowMapperResultSetExtractor(RowMapper<T> rowMapper)
Create a new RowMapperResultSetExtractor.
RowMapperResultSetExtractor(RowMapper<T> rowMapper, int rowsExpected)
Create a new RowMapperResultSetExtractor.
Method Summary
 List<T> extractData(ResultSet rs)
Implementations must implement this method to process the entire ResultSet.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

RowMapperResultSetExtractor

public RowMapperResultSetExtractor(RowMapper<T> rowMapper)
Create a new RowMapperResultSetExtractor.

Parameters:
rowMapper - the RowMapper which creates an object for each row

RowMapperResultSetExtractor

public RowMapperResultSetExtractor(RowMapper<T> rowMapper,
                                   int rowsExpected)
Create a new RowMapperResultSetExtractor.

Parameters:
rowMapper - the RowMapper which creates an object for each row
rowsExpected - the number of expected rows (just used for optimized collection handling)
Method Detail

extractData

public List<T> extractData(ResultSet rs)
                    throws SQLException
Description copied from interface: ResultSetExtractor
Implementations must implement this method to process the entire ResultSet.

Specified by:
extractData in interface ResultSetExtractor<List<T>>
Parameters:
rs - ResultSet to extract data from. Implementations should not close this: it will be closed by the calling JdbcTemplate.
Returns:
an arbitrary result object, or null if none (the extractor will typically be stateful in the latter case).
Throws:
SQLException - if a SQLException is encountered getting column values or navigating (that is, there's no need to catch SQLException)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SingleColumnRowMapper

org.springframework.jdbc.core
Class SingleColumnRowMapper<T>

java.lang.Object
    extended by  org.springframework.jdbc.core.SingleColumnRowMapper<T>
All Implemented Interfaces:
RowMapper<T>
Direct Known Subclasses:
ParameterizedSingleColumnRowMapper
public class SingleColumnRowMapper<T>
extends Object
implements RowMapper<T>

RowMapper implementation that converts a single column into a single result value per row. Expects to operate on a java.sql.ResultSet that just contains a single column.

The type of the result value for each row can be specified. The value for the single column will be extracted from the ResultSet and converted into the specified target type.

Since:
1.2
Author:
Juergen Hoeller
See Also:
JdbcTemplate.queryForList(String, Class), JdbcTemplate.queryForObject(String, Class)

Constructor Summary
SingleColumnRowMapper()
Create a new SingleColumnRowMapper.
SingleColumnRowMapper(Class<T> requiredType)
Create a new SingleColumnRowMapper.
Method Summary
protected Object | convertValueToRequiredType(Object value, Class requiredType) Convert the given column value to the specified required type.
protected Object | getColumnValue(ResultSet rs, int index) Retrieve a JDBC object value for the specified column, using the most appropriate value type.
protected Object | getColumnValue(ResultSet rs, int index, Class requiredType) Retrieve a JDBC object value for the specified column.
T | mapRow(ResultSet rs, int rowNum) Extract a value for the single column in the current row.
void | setRequiredType(Class<T> requiredType) Set the type that each result object is expected to match.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SingleColumnRowMapper

public SingleColumnRowMapper()
Create a new SingleColumnRowMapper.

See Also:
setRequiredType(java.lang.Class)

SingleColumnRowMapper

public SingleColumnRowMapper(Class<T> requiredType)
Create a new SingleColumnRowMapper.

Parameters:
requiredType - the type that each result object is expected to match
Method Detail

setRequiredType

public void setRequiredType(Class<T> requiredType)
Set the type that each result object is expected to match.

If not specified, the column value will be exposed as returned by the JDBC driver.

mapRow

public T mapRow(ResultSet rs,
                int rowNum)
         throws SQLException
Extract a value for the single column in the current row.

Validates that there is only one column selected, then delegates to getColumnValue() and also convertValueToRequiredType, if necessary.

Specified by:
mapRow in interface RowMapper<T>
Parameters:
rs - the ResultSet to map (pre-initialized for the current row)
rowNum - the number of the current row
Returns:
the result object for the current row
Throws:
SQLException - if a SQLException is encountered getting column values (that is, there's no need to catch SQLException)
See Also:
ResultSetMetaData.getColumnCount(),
getColumnValue(java.sql.ResultSet, int, Class),
convertValueToRequiredType(Object, Class)

getColumnValue

protected Object getColumnValue(ResultSet rs,
                                int index,
                                Class requiredType)
                         throws SQLException
Retrieve a JDBC object value for the specified column.

The default implementation calls JdbcUtils.getResultSetValue(java.sql.ResultSet, int, Class). If no required type has been specified, this method delegates to getColumnValue(rs, index), which basically calls ResultSet.getObject(index) but applies some additional default conversion to appropriate value types.

Parameters:
rs - is the ResultSet holding the data
index - is the column index
requiredType - the type that each result object is expected to match (or null if none specified)
Returns:
the Object value
Throws:
SQLException - in case of extraction failure
See Also:
JdbcUtils.getResultSetValue(java.sql.ResultSet, int, Class), getColumnValue(java.sql.ResultSet, int)

getColumnValue

protected Object getColumnValue(ResultSet rs,
                                int index)
                         throws SQLException
Retrieve a JDBC object value for the specified column, using the most appropriate value type. Called if no required type has been specified.

The default implementation delegates to JdbcUtils.getResultSetValue(), which uses the ResultSet.getObject(index) method. Additionally, it includes a "hack" to get around Oracle returning a non-standard object for their TIMESTAMP datatype. See the JdbcUtils#getResultSetValue() javadoc for details.

Parameters:
rs - is the ResultSet holding the data
index - is the column index
Returns:
the Object value
Throws:
SQLException - in case of extraction failure
See Also:
JdbcUtils.getResultSetValue(java.sql.ResultSet, int)

convertValueToRequiredType

protected Object convertValueToRequiredType(Object value,
                                            Class requiredType)
Convert the given column value to the specified required type. Only called if the extracted column value does not match already.

If the required type is String, the value will simply get stringified via toString(). In case of a Number, the value will be converted into a Number, either through number conversion or through String parsing (depending on the value type).

Parameters:
value - the column value as extracted from getColumnValue() (never null)
requiredType - the type that each result object is expected to match (never null)
Returns:
the converted value
See Also:
getColumnValue(java.sql.ResultSet, int, Class)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SqlInOutParameter

org.springframework.jdbc.core
Class SqlInOutParameter

java.lang.Object
    extended by  org.springframework.jdbc.core.SqlParameter
        extended by  org.springframework.jdbc.core.ResultSetSupportingSqlParameter
            extended by  org.springframework.jdbc.core.SqlOutParameter
                extended by  org.springframework.jdbc.core.SqlInOutParameter

public class SqlInOutParameter
extends SqlOutParameter

Subclass of SqlOutParameter to represent an INOUT parameter. Will return true for SqlParameter's isInputValueProvided() test, in contrast to a standard SqlOutParameter.

Output parameters - like all stored procedure parameters - must have names.

Since:
2.0
Author:
Thomas Risberg, Juergen Hoeller

Constructor Summary
SqlInOutParameter(String name, int sqlType)
Create a new SqlInOutParameter.
SqlInOutParameter(String name, int sqlType, int scale)
Create a new SqlInOutParameter.
SqlInOutParameter(String name, int sqlType, ResultSetExtractor rse)
Create a new SqlInOutParameter.
SqlInOutParameter(String name, int sqlType, RowCallbackHandler rch)
Create a new SqlInOutParameter.
SqlInOutParameter(String name, int sqlType, RowMapper rm)
Create a new SqlInOutParameter.
SqlInOutParameter(String name, int sqlType, String typeName)
Create a new SqlInOutParameter.
SqlInOutParameter(String name, int sqlType, String typeName, SqlReturnType sqlReturnType)
Create a new SqlInOutParameter.
Method Summary
 boolean isInputValueProvided()
This implementation always returns true.
Methods inherited from class org.springframework.jdbc.core.SqlOutParameter
getSqlReturnType, isReturnTypeSupported
Methods inherited from class org.springframework.jdbc.core.ResultSetSupportingSqlParameter
getResultSetExtractor, getRowCallbackHandler, getRowMapper, isResultSetSupported
Methods inherited from class org.springframework.jdbc.core.SqlParameter
getName, getScale, getSqlType, getTypeName, isResultsParameter, sqlTypesToAnonymousParameterList
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SqlInOutParameter

public SqlInOutParameter(String name,
                         int sqlType)
Create a new SqlInOutParameter.

Parameters:
name - name of the parameter, as used in input and output maps
sqlType - SQL type of the parameter according to java.sql.Types

SqlInOutParameter

public SqlInOutParameter(String name,
                         int sqlType,
                         int scale)
Create a new SqlInOutParameter.

Parameters:
name - name of the parameter, as used in input and output maps
sqlType - SQL type of the parameter according to java.sql.Types
scale - the number of digits after the decimal point (for DECIMAL and NUMERIC types)

SqlInOutParameter

public SqlInOutParameter(String name,
                         int sqlType,
                         String typeName)
Create a new SqlInOutParameter.

Parameters:
name - name of the parameter, as used in input and output maps
sqlType - SQL type of the parameter according to java.sql.Types
typeName - the type name of the parameter (optional)

SqlInOutParameter

public SqlInOutParameter(String name,
                         int sqlType,
                         String typeName,
                         SqlReturnType sqlReturnType)
Create a new SqlInOutParameter.

Parameters:
name - name of the parameter, as used in input and output maps
sqlType - SQL type of the parameter according to java.sql.Types
typeName - the type name of the parameter (optional)
sqlReturnType - custom value handler for complex type (optional)

SqlInOutParameter

public SqlInOutParameter(String name,
                         int sqlType,
                         ResultSetExtractor rse)
Create a new SqlInOutParameter.

Parameters:
name - name of the parameter, as used in input and output maps
sqlType - SQL type of the parameter according to java.sql.Types
rse - ResultSetExtractor to use for parsing the ResultSet

SqlInOutParameter

public SqlInOutParameter(String name,
                         int sqlType,
                         RowCallbackHandler rch)
Create a new SqlInOutParameter.

Parameters:
name - name of the parameter, as used in input and output maps
sqlType - SQL type of the parameter according to java.sql.Types
rch - RowCallbackHandler to use for parsing the ResultSet

SqlInOutParameter

public SqlInOutParameter(String name,
                         int sqlType,
                         RowMapper rm)
Create a new SqlInOutParameter.

Parameters:
name - name of the parameter, as used in input and output maps
sqlType - SQL type of the parameter according to java.sql.Types
rm - RowMapper to use for parsing the ResultSet
Method Detail

isInputValueProvided

public boolean isInputValueProvided()
This implementation always returns true.

Overrides:
isInputValueProvided in class ResultSetSupportingSqlParameter
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SqlOutParameter

org.springframework.jdbc.core
Class SqlOutParameter

java.lang.Object
    extended by  org.springframework.jdbc.core.SqlParameter
        extended by  org.springframework.jdbc.core.ResultSetSupportingSqlParameter
            extended by  org.springframework.jdbc.core.SqlOutParameter
Direct Known Subclasses:
SqlInOutParameter
public class SqlOutParameter
extends ResultSetSupportingSqlParameter

Subclass of SqlParameter to represent an output parameter. No additional properties: instanceof will be used to check for such types.

Output parameters - like all stored procedure parameters - must have names.

Author:
Rod Johnson, Thomas Risberg, Juergen Hoeller
See Also:
SqlReturnResultSet, SqlInOutParameter

Constructor Summary
SqlOutParameter(String name, int sqlType)
Create a new SqlOutParameter.
SqlOutParameter(String name, int sqlType, int scale)
Create a new SqlOutParameter.
SqlOutParameter(String name, int sqlType, ResultSetExtractor rse)
Create a new SqlOutParameter.
SqlOutParameter(String name, int sqlType, RowCallbackHandler rch)
Create a new SqlOutParameter.
SqlOutParameter(String name, int sqlType, RowMapper rm)
Create a new SqlOutParameter.
SqlOutParameter(String name, int sqlType, String typeName)
Create a new SqlOutParameter.
SqlOutParameter(String name, int sqlType, String typeName, SqlReturnType sqlReturnType)
Create a new SqlOutParameter.
Method Summary
SqlReturnType | getSqlReturnType() Return the custom return type, if any.
boolean | isReturnTypeSupported() Return whether this parameter holds a custom return type.
Methods inherited from class org.springframework.jdbc.core.ResultSetSupportingSqlParameter
getResultSetExtractor, getRowCallbackHandler, getRowMapper, isInputValueProvided, isResultSetSupported
Methods inherited from class org.springframework.jdbc.core.SqlParameter
getName, getScale, getSqlType, getTypeName, isResultsParameter, sqlTypesToAnonymousParameterList
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SqlOutParameter

public SqlOutParameter(String name,
                       int sqlType)
Create a new SqlOutParameter.

Parameters:
name - name of the parameter, as used in input and output maps
sqlType - SQL type of the parameter according to java.sql.Types

SqlOutParameter

public SqlOutParameter(String name,
                       int sqlType,
                       int scale)
Create a new SqlOutParameter.

Parameters:
name - name of the parameter, as used in input and output maps
sqlType - SQL type of the parameter according to java.sql.Types
scale - the number of digits after the decimal point (for DECIMAL and NUMERIC types)

SqlOutParameter

public SqlOutParameter(String name,
                       int sqlType,
                       String typeName)
Create a new SqlOutParameter.

Parameters:
name - name of the parameter, as used in input and output maps
sqlType - SQL type of the parameter according to java.sql.Types
typeName - the type name of the parameter (optional)

SqlOutParameter

public SqlOutParameter(String name,
                       int sqlType,
                       String typeName,
                       SqlReturnType sqlReturnType)
Create a new SqlOutParameter.

Parameters:
name - name of the parameter, as used in input and output maps
sqlType - SQL type of the parameter according to java.sql.Types
typeName - the type name of the parameter (optional)
sqlReturnType - custom value handler for complex type (optional)

SqlOutParameter

public SqlOutParameter(String name,
                       int sqlType,
                       ResultSetExtractor rse)
Create a new SqlOutParameter.

Parameters:
name - name of the parameter, as used in input and output maps
sqlType - SQL type of the parameter according to java.sql.Types
rse - ResultSetExtractor to use for parsing the ResultSet

SqlOutParameter

public SqlOutParameter(String name,
                       int sqlType,
                       RowCallbackHandler rch)
Create a new SqlOutParameter.

Parameters:
name - name of the parameter, as used in input and output maps
sqlType - SQL type of the parameter according to java.sql.Types
rch - RowCallbackHandler to use for parsing the ResultSet

SqlOutParameter

public SqlOutParameter(String name,
                       int sqlType,
                       RowMapper rm)
Create a new SqlOutParameter.

Parameters:
name - name of the parameter, as used in input and output maps
sqlType - SQL type of the parameter according to java.sql.Types
rm - RowMapper to use for parsing the ResultSet
Method Detail

getSqlReturnType

public SqlReturnType getSqlReturnType()
Return the custom return type, if any.

isReturnTypeSupported

public boolean isReturnTypeSupported()
Return whether this parameter holds a custom return type.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SqlParameter

org.springframework.jdbc.core
Class SqlParameter

java.lang.Object
    extended by  org.springframework.jdbc.core.SqlParameter
Direct Known Subclasses:
ResultSetSupportingSqlParameter, SqlParameterValue, SqlReturnUpdateCount
public class SqlParameter
extends Object

Object to represent a SQL parameter definition.

Parameters may be anonymous, in which case "name" is null. However, all parameters must define a SQL type according to Types.

Author:
Rod Johnson, Thomas Risberg, Juergen Hoeller
See Also:
Types

Constructor Summary
SqlParameter(int sqlType)
Create a new anonymous SqlParameter, supplying the SQL type.
SqlParameter(int sqlType, int scale)
Create a new anonymous SqlParameter, supplying the SQL type.
SqlParameter(int sqlType, String typeName)
Create a new anonymous SqlParameter, supplying the SQL type.
SqlParameter(SqlParameter otherParam)
Copy constructor.
SqlParameter(String name, int sqlType)
Create a new SqlParameter, supplying name and SQL type.
SqlParameter(String name, int sqlType, int scale)
Create a new SqlParameter, supplying name and SQL type.
SqlParameter(String name, int sqlType, String typeName)
Create a new SqlParameter, supplying name and SQL type.
Method Summary
String | getName() Return the name of the parameter.
Integer | getScale() Return the scale of the parameter, if any.
int | getSqlType() Return the SQL type of the parameter.
String | getTypeName() Return the type name of the parameter, if any.
boolean | isInputValueProvided() Return whether this parameter holds input values that should be set before execution even if they are null.
boolean | isResultsParameter() Return whether this parameter is an implicit return parameter used during the results preocessing of the CallableStatement.getMoreResults/getUpdateCount.
static List<SqlParameter> | sqlTypesToAnonymousParameterList(int[] types) Convert a list of JDBC types, as defined in java.sql.Types, to a List of SqlParameter objects as used in this package.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SqlParameter

public SqlParameter(int sqlType)
Create a new anonymous SqlParameter, supplying the SQL type.

Parameters:
sqlType - SQL type of the parameter according to java.sql.Types

SqlParameter

public SqlParameter(int sqlType,
                    String typeName)
Create a new anonymous SqlParameter, supplying the SQL type.

Parameters:
sqlType - SQL type of the parameter according to java.sql.Types
typeName - the type name of the parameter (optional)

SqlParameter

public SqlParameter(int sqlType,
                    int scale)
Create a new anonymous SqlParameter, supplying the SQL type.

Parameters:
sqlType - SQL type of the parameter according to java.sql.Types
scale - the number of digits after the decimal point (for DECIMAL and NUMERIC types)

SqlParameter

public SqlParameter(String name,
                    int sqlType)
Create a new SqlParameter, supplying name and SQL type.

Parameters:
name - name of the parameter, as used in input and output maps
sqlType - SQL type of the parameter according to java.sql.Types

SqlParameter

public SqlParameter(String name,
                    int sqlType,
                    String typeName)
Create a new SqlParameter, supplying name and SQL type.

Parameters:
name - name of the parameter, as used in input and output maps
sqlType - SQL type of the parameter according to java.sql.Types
typeName - the type name of the parameter (optional)

SqlParameter

public SqlParameter(String name,
                    int sqlType,
                    int scale)
Create a new SqlParameter, supplying name and SQL type.

Parameters:
name - name of the parameter, as used in input and output maps
sqlType - SQL type of the parameter according to java.sql.Types
scale - the number of digits after the decimal point (for DECIMAL and NUMERIC types)

SqlParameter

public SqlParameter(SqlParameter otherParam)
Copy constructor.

Parameters:
otherParam - the SqlParameter object to copy from
Method Detail

getName

public String getName()
Return the name of the parameter.

getSqlType

public int getSqlType()
Return the SQL type of the parameter.

getTypeName

public String getTypeName()
Return the type name of the parameter, if any.

getScale

public Integer getScale()
Return the scale of the parameter, if any.

isInputValueProvided

public boolean isInputValueProvided()
Return whether this parameter holds input values that should be set before execution even if they are null.

This implementation always returns true.

isResultsParameter

public boolean isResultsParameter()
Return whether this parameter is an implicit return parameter used during the results preocessing of the CallableStatement.getMoreResults/getUpdateCount.

This implementation always returns false.

sqlTypesToAnonymousParameterList

public static List<SqlParameter> sqlTypesToAnonymousParameterList(int[] types)
Convert a list of JDBC types, as defined in java.sql.Types, to a List of SqlParameter objects as used in this package.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SqlParameterValue

org.springframework.jdbc.core
Class SqlParameterValue

java.lang.Object
    extended by  org.springframework.jdbc.core.SqlParameter
        extended by  org.springframework.jdbc.core.SqlParameterValue

public class SqlParameterValue
extends SqlParameter

Object to represent a SQL parameter value, including parameter metadata such as the SQL type and the scale for numeric values.

Designed for use with JdbcTemplate's operations that take an array of argument values: Each such argument value may be a SqlParameterValue, indicating the SQL type (and optionally the scale) instead of letting the template guess a default type. Note that this only applies to the operations with a 'plain' argument array, not to the overloaded variants with an explicit type array.

Since:
2.0.5
Author:
Juergen Hoeller
See Also:
Types,
JdbcTemplate.query(String, Object[], ResultSetExtractor),
JdbcTemplate.query(String, Object[], RowCallbackHandler),
JdbcTemplate.query(String, Object[], RowMapper),
JdbcTemplate.update(String, Object[])

Constructor Summary
SqlParameterValue(int sqlType, int scale, Object value)
Create a new SqlParameterValue, supplying the SQL type.
SqlParameterValue(int sqlType, Object value)
Create a new SqlParameterValue, supplying the SQL type.
SqlParameterValue(int sqlType, String typeName, Object value)
Create a new SqlParameterValue, supplying the SQL type.
SqlParameterValue(SqlParameter declaredParam, Object value)
Create a new SqlParameterValue based on the given SqlParameter declaration.
Method Summary
 Object getValue()
Return the value object that this parameter value holds.
Methods inherited from class org.springframework.jdbc.core.SqlParameter
getName, getScale, getSqlType, getTypeName, isInputValueProvided, isResultsParameter, sqlTypesToAnonymousParameterList
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SqlParameterValue

public SqlParameterValue(int sqlType,
                         Object value)
Create a new SqlParameterValue, supplying the SQL type.

Parameters:
sqlType - SQL type of the parameter according to java.sql.Types
value - the value object

SqlParameterValue

public SqlParameterValue(int sqlType,
                         String typeName,
                         Object value)
Create a new SqlParameterValue, supplying the SQL type.

Parameters:
sqlType - SQL type of the parameter according to java.sql.Types
typeName - the type name of the parameter (optional)
value - the value object

SqlParameterValue

public SqlParameterValue(int sqlType,
                         int scale,
                         Object value)
Create a new SqlParameterValue, supplying the SQL type.

Parameters:
sqlType - SQL type of the parameter according to java.sql.Types
scale - the number of digits after the decimal point (for DECIMAL and NUMERIC types)
value - the value object

SqlParameterValue

public SqlParameterValue(SqlParameter declaredParam,
                         Object value)
Create a new SqlParameterValue based on the given SqlParameter declaration.

Parameters:
declaredParam - the declared SqlParameter to define a value for
value - the value object
Method Detail

getValue

public Object getValue()
Return the value object that this parameter value holds.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SqlReturnResultSet

org.springframework.jdbc.core
Class SqlReturnResultSet

java.lang.Object
    extended by  org.springframework.jdbc.core.SqlParameter
        extended by  org.springframework.jdbc.core.ResultSetSupportingSqlParameter
            extended by  org.springframework.jdbc.core.SqlReturnResultSet

public class SqlReturnResultSet
extends ResultSetSupportingSqlParameter

Represents a returned ResultSet from a stored procedure call.

A ResultSetExtractor, RowCallbackHandler or RowMapper must be provided to handle any returned rows.

Returned ResultSets - like all stored procedure parameters - must have names.

Author:
Thomas Risberg, Juergen Hoeller

Constructor Summary
SqlReturnResultSet(String name, ResultSetExtractor extractor)
Create a new instance of the SqlReturnResultSet class.
SqlReturnResultSet(String name, RowCallbackHandler handler)
Create a new instance of the SqlReturnResultSet class.
SqlReturnResultSet(String name, RowMapper mapper)
Create a new instance of the SqlReturnResultSet class.
Method Summary
 boolean isResultsParameter()
Return whether this parameter is an implicit return parameter used during the results preocessing of the CallableStatement.getMoreResults/getUpdateCount.
Methods inherited from class org.springframework.jdbc.core.ResultSetSupportingSqlParameter
getResultSetExtractor, getRowCallbackHandler, getRowMapper, isInputValueProvided, isResultSetSupported
Methods inherited from class org.springframework.jdbc.core.SqlParameter
getName, getScale, getSqlType, getTypeName, sqlTypesToAnonymousParameterList
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SqlReturnResultSet

public SqlReturnResultSet(String name,
                          ResultSetExtractor extractor)
Create a new instance of the SqlReturnResultSet class.

Parameters:
name - name of the parameter, as used in input and output maps
extractor - ResultSetExtractor to use for parsing the ResultSet

SqlReturnResultSet

public SqlReturnResultSet(String name,
                          RowCallbackHandler handler)
Create a new instance of the SqlReturnResultSet class.

Parameters:
name - name of the parameter, as used in input and output maps
handler - RowCallbackHandler to use for parsing the ResultSet

SqlReturnResultSet

public SqlReturnResultSet(String name,
                          RowMapper mapper)
Create a new instance of the SqlReturnResultSet class.

Parameters:
name - name of the parameter, as used in input and output maps
mapper - RowMapper to use for parsing the ResultSet
Method Detail

isResultsParameter

public boolean isResultsParameter()
Return whether this parameter is an implicit return parameter used during the results preocessing of the CallableStatement.getMoreResults/getUpdateCount.

This implementation always returns true.

Overrides:
isResultsParameter in class SqlParameter
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SqlReturnUpdateCount

org.springframework.jdbc.core
Class SqlReturnUpdateCount

java.lang.Object
    extended by  org.springframework.jdbc.core.SqlParameter
        extended by  org.springframework.jdbc.core.SqlReturnUpdateCount

public class SqlReturnUpdateCount
extends SqlParameter

Represents a returned update count from a stored procedure call.

Returned update counts - like all stored procedure parameters - must have names.

Author:
Thomas Risberg

Constructor Summary
SqlReturnUpdateCount(String name)
Create a new instance of the SqlReturnUpdateCount class.
Method Summary
boolean | isInputValueProvided() Return whether this parameter holds input values that should be set before execution even if they are null.
boolean | isResultsParameter() Return whether this parameter is an implicit return parameter used during the results preocessing of the CallableStatement.getMoreResults/getUpdateCount.
Methods inherited from class org.springframework.jdbc.core.SqlParameter
getName, getScale, getSqlType, getTypeName, sqlTypesToAnonymousParameterList
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SqlReturnUpdateCount

public SqlReturnUpdateCount(String name)
Create a new instance of the SqlReturnUpdateCount class.

Parameters:
name - name of the parameter, as used in input and output maps
Method Detail

isInputValueProvided

public boolean isInputValueProvided()
Return whether this parameter holds input values that should be set before execution even if they are null.

This implementation always returns false.

Overrides:
isInputValueProvided in class SqlParameter

isResultsParameter

public boolean isResultsParameter()
Return whether this parameter is an implicit return parameter used during the results preocessing of the CallableStatement.getMoreResults/getUpdateCount.

This implementation always returns true.

Overrides:
isResultsParameter in class SqlParameter
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SqlRowSetResultSetExtractor

org.springframework.jdbc.core
Class SqlRowSetResultSetExtractor

java.lang.Object
    extended by  org.springframework.jdbc.core.SqlRowSetResultSetExtractor
All Implemented Interfaces:
ResultSetExtractor<SqlRowSet>
public class SqlRowSetResultSetExtractor
extends Object
implements ResultSetExtractor<SqlRowSet>

ResultSetExtractor implementation that returns a Spring SqlRowSet representation for each given ResultSet.

The default implementation uses a standard JDBC CachedRowSet underneath. This means that JDBC RowSet support needs to be available at runtime: by default, Sun's com.sun.rowset.CachedRowSetImpl class.

Since:
1.2
Author:
Juergen Hoeller
See Also:
newCachedRowSet(), SqlRowSet, JdbcTemplate.queryForRowSet(String), CachedRowSet

Constructor Summary
SqlRowSetResultSetExtractor()
Method Summary
protected SqlRowSet | createSqlRowSet(ResultSet rs) Create a SqlRowSet that wraps the given ResultSet, representing its data in a disconnected fashion.
SqlRowSet | extractData(ResultSet rs) Implementations must implement this method to process the entire ResultSet.
protected CachedRowSet | newCachedRowSet() Create a new CachedRowSet instance, to be populated by the createSqlRowSet implementation.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SqlRowSetResultSetExtractor

public SqlRowSetResultSetExtractor()
Method Detail

extractData

public SqlRowSet extractData(ResultSet rs)
                      throws SQLException
Description copied from interface: ResultSetExtractor
Implementations must implement this method to process the entire ResultSet.

Specified by:
extractData in interface ResultSetExtractor<SqlRowSet>
Parameters:
rs - ResultSet to extract data from. Implementations should not close this: it will be closed by the calling JdbcTemplate.
Returns:
an arbitrary result object, or null if none (the extractor will typically be stateful in the latter case).
Throws:
SQLException - if a SQLException is encountered getting column values or navigating (that is, there's no need to catch SQLException)

createSqlRowSet

protected SqlRowSet createSqlRowSet(ResultSet rs)
                             throws SQLException
Create a SqlRowSet that wraps the given ResultSet, representing its data in a disconnected fashion.

This implementation creates a Spring ResultSetWrappingSqlRowSet instance that wraps a standard JDBC CachedRowSet instance. Can be overridden to use a different implementation.

Parameters:
rs - the original ResultSet (connected)
Returns:
the disconnected SqlRowSet
Throws:
SQLException - if thrown by JDBC methods
See Also:
newCachedRowSet(), ResultSetWrappingSqlRowSet

newCachedRowSet

protected CachedRowSet newCachedRowSet()
                                throws SQLException
Create a new CachedRowSet instance, to be populated by the createSqlRowSet implementation.

The default implementation creates a new instance of Sun's com.sun.rowset.CachedRowSetImpl class.

Returns:
a new CachedRowSet instance
Throws:
SQLException - if thrown by JDBC methods
See Also:
createSqlRowSet(java.sql.ResultSet), CachedRowSetImpl
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StatementCreatorUtils

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.core
Class StatementCreatorUtils

java.lang.Object
    extended by  org.springframework.jdbc.core.StatementCreatorUtils

public abstract class StatementCreatorUtils
extends Object

Utility methods for PreparedStatementSetter/Creator and CallableStatementCreator implementations, providing sophisticated parameter management (including support for LOB values).

Used by PreparedStatementCreatorFactory and CallableStatementCreatorFactory, but also available for direct use in custom setter/creator implementations.

Since:
1.1
Author:
Thomas Risberg, Juergen Hoeller
See Also:
PreparedStatementSetter, PreparedStatementCreator, CallableStatementCreator, PreparedStatementCreatorFactory, CallableStatementCreatorFactory, SqlParameter, SqlTypeValue, SqlLobValue

Constructor Summary
StatementCreatorUtils()
Method Summary
static void | cleanupParameters(Collection paramValues) Clean up all resources held by parameter values which were passed to an execute method.
static void | cleanupParameters(Object[] paramValues) Clean up all resources held by parameter values which were passed to an execute method.
static int | javaTypeToSqlParameterType(Class javaType) Derive a default SQL type from the given Java type.
static void | setParameterValue(PreparedStatement ps, int paramIndex, int sqlType, Object inValue) Set the value for a parameter.
static void | setParameterValue(PreparedStatement ps, int paramIndex, int sqlType, String typeName, Object inValue) Set the value for a parameter.
static void | setParameterValue(PreparedStatement ps, int paramIndex, SqlParameter param, Object inValue) Set the value for a parameter.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

StatementCreatorUtils

public StatementCreatorUtils()
Method Detail

javaTypeToSqlParameterType

public static int javaTypeToSqlParameterType(Class javaType)
Derive a default SQL type from the given Java type.

Parameters:
javaType - the Java type to translate
Returns:
the corresponding SQL type, or null if none found

setParameterValue

public static void setParameterValue(PreparedStatement ps,
                                     int paramIndex,
                                     SqlParameter param,
                                     Object inValue)
                              throws SQLException
Set the value for a parameter. The method used is based on the SQL type of the parameter and we can handle complex types like arrays and LOBs.

Parameters:
ps - the prepared statement or callable statement
paramIndex - index of the parameter we are setting
param - the parameter as it is declared including type
inValue - the value to set
Throws:
SQLException - if thrown by PreparedStatement methods

setParameterValue

public static void setParameterValue(PreparedStatement ps,
                                     int paramIndex,
                                     int sqlType,
                                     Object inValue)
                              throws SQLException
Set the value for a parameter. The method used is based on the SQL type of the parameter and we can handle complex types like arrays and LOBs.

Parameters:
ps - the prepared statement or callable statement
paramIndex - index of the parameter we are setting
sqlType - the SQL type of the parameter
inValue - the value to set (plain value or a SqlTypeValue)
Throws:
SQLException - if thrown by PreparedStatement methods
See Also:
SqlTypeValue

setParameterValue

public static void setParameterValue(PreparedStatement ps,
                                     int paramIndex,
                                     int sqlType,
                                     String typeName,
                                     Object inValue)
                              throws SQLException
Set the value for a parameter. The method used is based on the SQL type of the parameter and we can handle complex types like arrays and LOBs.

Parameters:
ps - the prepared statement or callable statement
paramIndex - index of the parameter we are setting
sqlType - the SQL type of the parameter
typeName - the type name of the parameter (optional, only used for SQL NULL and SqlTypeValue)
inValue - the value to set (plain value or a SqlTypeValue)
Throws:
SQLException - if thrown by PreparedStatement methods
See Also:
SqlTypeValue

cleanupParameters

public static void cleanupParameters(Object[] paramValues)
Clean up all resources held by parameter values which were passed to an execute method. This is for example important for closing LOB values.

Parameters:
paramValues - parameter values supplied. May be null.
See Also:
DisposableSqlTypeValue.cleanup(), SqlLobValue.cleanup()

cleanupParameters

public static void cleanupParameters(Collection paramValues)
Clean up all resources held by parameter values which were passed to an execute method. This is for example important for closing LOB values.

Parameters:
paramValues - parameter values supplied. May be null.
See Also:
DisposableSqlTypeValue.cleanup(), SqlLobValue.cleanup()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jdbc.core.metadata

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jdbc.core.metadata

Context metadata abstraction for the configuration and execution of a stored procedure call.

See:
Description

Interface Summary
CallMetaDataProvider | Interface specifying the API to be implemented by a class providing call metadata.
TableMetaDataProvider | Interface specifying the API to be implemented by a class providing table metedata.

Class Summary
CallMetaDataContext | Class to manage context metadata used for the configuration and execution of the call.
CallMetaDataProviderFactory | Factory used to create a CallMetaDataProvider implementation based on the type of databse being used.
CallParameterMetaData | Holder of metadata for a specific parameter that is used for call processing.
Db2CallMetaDataProvider | DB2 specific implementation for the CallMetaDataProvider interface.
DerbyCallMetaDataProvider | Derby specific implementation for the CallMetaDataProvider interface.
DerbyTableMetaDataProvider | The Derby specific implementation of the TableMetaDataProvider.
GenericCallMetaDataProvider | Generic implementation for the CallMetaDataProvider interface.
GenericTableMetaDataProvider | A generic implementation of the TableMetaDataProvider that should provide enough features for all supported databases.
HsqlTableMetaDataProvider | The HSQL specific implementation of the TableMetaDataProvider.
OracleCallMetaDataProvider | Oracle specific implementation for the CallMetaDataProvider interface.
OracleTableMetaDataProvider | The Oracle specific implementation of the TableMetaDataProvider.
PostgresCallMetaDataProvider | Oracle specific implementation for the CallMetaDataProvider interface.
PostgresTableMetaDataProvider | The PostgreSQL specific implementation of the TableMetaDataProvider.
SqlServerCallMetaDataProvider | SQL Server specific implementation for the CallMetaDataProvider interface.
SybaseCallMetaDataProvider | Sybase specific implementation for the CallMetaDataProvider interface.
TableMetaDataContext | Class to manage context metadata used for the configuration and execution of operations on a database table.
TableMetaDataProviderFactory | Factory used to create a TableMetaDataProvider implementation based on the type of databse being used.
TableParameterMetaData | Holder of metadata for a specific parameter that is used for table processing.

Package org.springframework.jdbc.core.metadata Description

Context metadata abstraction for the configuration and execution of a stored procedure call.


org.springframework.jdbc.core.metadata Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jdbc.core.metadata

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jdbc.core.metadata.CallMetaDataContext
    • org.springframework.jdbc.core.metadata.CallMetaDataProviderFactory
    • org.springframework.jdbc.core.metadata.CallParameterMetaData
    • org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider (implements org.springframework.jdbc.core.metadata.CallMetaDataProvider)
      • org.springframework.jdbc.core.metadata.Db2CallMetaDataProvider
      • org.springframework.jdbc.core.metadata.DerbyCallMetaDataProvider
      • org.springframework.jdbc.core.metadata.OracleCallMetaDataProvider
      • org.springframework.jdbc.core.metadata.PostgresCallMetaDataProvider
      • org.springframework.jdbc.core.metadata.SqlServerCallMetaDataProvider
      • org.springframework.jdbc.core.metadata.SybaseCallMetaDataProvider
    • org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider (implements org.springframework.jdbc.core.metadata.TableMetaDataProvider)
      • org.springframework.jdbc.core.metadata.DerbyTableMetaDataProvider
      • org.springframework.jdbc.core.metadata.HsqlTableMetaDataProvider
      • org.springframework.jdbc.core.metadata.OracleTableMetaDataProvider
      • org.springframework.jdbc.core.metadata.PostgresTableMetaDataProvider
    • org.springframework.jdbc.core.metadata.TableMetaDataContext
    • org.springframework.jdbc.core.metadata.TableMetaDataProviderFactory
    • org.springframework.jdbc.core.metadata.TableParameterMetaData

Interface Hierarchy

  • org.springframework.jdbc.core.metadata.CallMetaDataProvider
  • org.springframework.jdbc.core.metadata.TableMetaDataProvider


CallMetaDataProvider

org.springframework.jdbc.core.metadata
Interface CallMetaDataProvider

All Known Implementing Classes:
Db2CallMetaDataProvider, DerbyCallMetaDataProvider, GenericCallMetaDataProvider, OracleCallMetaDataProvider, PostgresCallMetaDataProvider, SqlServerCallMetaDataProvider, SybaseCallMetaDataProvider
public interface CallMetaDataProvider

Interface specifying the API to be implemented by a class providing call metadata. This is intended for internal use by Spring's SimpleJdbcTemplate.

Since:
2.5
Author:
Thomas Risberg

Method Summary
 boolean byPassReturnParameter(String parameterName)
Should we bypass the return parameter with the specified name.
 String catalogNameToUse(String catalogName)
Provide any modification of the catalog name passed in to match the meta data currently used.
 SqlParameter createDefaultInOutParameter(String parameterName, CallParameterMetaData meta)
Create a default inout parameter based on the provided meta data.
 SqlParameter createDefaultInParameter(String parameterName, CallParameterMetaData meta)
Create a default in parameter based on the provided meta data.
 SqlParameter createDefaultOutParameter(String parameterName, CallParameterMetaData meta)
Create a default out parameter based on the provided meta data.
 List<CallParameterMetaData> getCallParameterMetaData()
Get the call parameter metadata that is currently used.
 int getRefCursorSqlType()
Get the Types type for columns that return resultsets as ref cursors if this feature is supported.
 String getUserName()
Get the name of the current user.
 void initializeWithMetaData(DatabaseMetaData databaseMetaData)
Initialize using the provided DatabaseMetData.
 void initializeWithProcedureColumnMetaData(DatabaseMetaData databaseMetaData, String catalogName, String schemaName, String procedureName)
Initialize the database specific management of procedure column meta data.
 boolean isProcedureColumnMetaDataUsed()
Are we using the meta data for the procedure columns?
 boolean isRefCursorSupported()
Does this database support returning resultsets as ref cursors to be retrieved with CallableStatement.getObject(int) for the specified column.
 boolean isReturnResultSetSupported()
Does this database support returning resultsets that should be retrieved with the JDBC call Statement.getResultSet()
 boolean isSupportsCatalogsInProcedureCalls()
Does the database support the use of catalog name in procedure calls
 boolean isSupportsSchemasInProcedureCalls()
Does the database support the use of schema name in procedure calls
 String metaDataCatalogNameToUse(String catalogName)
Provide any modification of the catalog name passed in to match the meta data currently used.
 String metaDataSchemaNameToUse(String schemaName)
Provide any modification of the schema name passed in to match the meta data currently used.
 String parameterNameToUse(String parameterName)
Provide any modification of the column name passed in to match the meta data currently used.
 String procedureNameToUse(String procedureName)
Provide any modification of the procedure name passed in to match the meta data currently used.
 String schemaNameToUse(String schemaName)
Provide any modification of the schema name passed in to match the meta data currently used.

Method Detail

initializeWithMetaData

void initializeWithMetaData(DatabaseMetaData databaseMetaData)
                            throws SQLException
Initialize using the provided DatabaseMetData.

Parameters:
databaseMetaData - used to retrieve database specific information
Throws:
SQLException - in case of initialization failure

initializeWithProcedureColumnMetaData

void initializeWithProcedureColumnMetaData(DatabaseMetaData databaseMetaData,
                                           String catalogName,
                                           String schemaName,
                                           String procedureName)
                                           throws SQLException
Initialize the database specific management of procedure column meta data. This is only called for databases that are supported. This initalization can be turned off by specifying that column meta data should not be used.

Parameters:
databaseMetaData - used to retrieve database specific information
catalogName - name of catalog to use or null
schemaName - name of schema name to use or null
procedureName - name of the stored procedure
Throws:
SQLException - in case of initialization failure
See Also:
SimpleJdbcCall.withoutProcedureColumnMetaDataAccess()

procedureNameToUse

String procedureNameToUse(String procedureName)
Provide any modification of the procedure name passed in to match the meta data currently used. This could include alterig the case.

catalogNameToUse

String catalogNameToUse(String catalogName)
Provide any modification of the catalog name passed in to match the meta data currently used. This could include alterig the case.

schemaNameToUse

String schemaNameToUse(String schemaName)
Provide any modification of the schema name passed in to match the meta data currently used. This could include alterig the case.

metaDataCatalogNameToUse

String metaDataCatalogNameToUse(String catalogName)
Provide any modification of the catalog name passed in to match the meta data currently used. The reyurned value will be used for meta data lookups. This could include alterig the case used or providing a base catalog if mone provided.

metaDataSchemaNameToUse

String metaDataSchemaNameToUse(String schemaName)
Provide any modification of the schema name passed in to match the meta data currently used. The reyurned value will be used for meta data lookups. This could include alterig the case used or providing a base schema if mone provided.

parameterNameToUse

String parameterNameToUse(String parameterName)
Provide any modification of the column name passed in to match the meta data currently used. This could include alterig the case.

Parameters:
parameterName - name of the parameter of column

createDefaultOutParameter

SqlParameter createDefaultOutParameter(String parameterName,
                                       CallParameterMetaData meta)
Create a default out parameter based on the provided meta data. This is used when no expicit parameter declaration has been made.

Parameters:
parameterName - the name of the parameter
meta - meta data used for this call
Returns:
the configured SqlOutParameter

createDefaultInOutParameter

SqlParameter createDefaultInOutParameter(String parameterName,
                                         CallParameterMetaData meta)
Create a default inout parameter based on the provided meta data. This is used when no expicit parameter declaration has been made.

Parameters:
parameterName - the name of the parameter
meta - meta data used for this call
Returns:
the configured SqlInOutParameter

createDefaultInParameter

SqlParameter createDefaultInParameter(String parameterName,
                                      CallParameterMetaData meta)
Create a default in parameter based on the provided meta data. This is used when no expicit parameter declaration has been made.

Parameters:
parameterName - the name of the parameter
meta - meta data used for this call
Returns:
the configured SqlParameter

getUserName

String getUserName()
Get the name of the current user. Useful for meta data lookups etc.

Returns:
current user name from database connection

isReturnResultSetSupported

boolean isReturnResultSetSupported()
Does this database support returning resultsets that should be retrieved with the JDBC call Statement.getResultSet()

isRefCursorSupported

boolean isRefCursorSupported()
Does this database support returning resultsets as ref cursors to be retrieved with CallableStatement.getObject(int) for the specified column.

getRefCursorSqlType

int getRefCursorSqlType()
Get the Types type for columns that return resultsets as ref cursors if this feature is supported.

isProcedureColumnMetaDataUsed

boolean isProcedureColumnMetaDataUsed()
Are we using the meta data for the procedure columns?

byPassReturnParameter

boolean byPassReturnParameter(String parameterName)
Should we bypass the return parameter with the specified name. This allows the database specific implementation to skip the processing for specific results returned by the database call.

getCallParameterMetaData

List<CallParameterMetaData> getCallParameterMetaData()
Get the call parameter metadata that is currently used.

Returns:
List of CallParameterMetaData

isSupportsCatalogsInProcedureCalls

boolean isSupportsCatalogsInProcedureCalls()
Does the database support the use of catalog name in procedure calls

isSupportsSchemasInProcedureCalls

boolean isSupportsSchemasInProcedureCalls()
Does the database support the use of schema name in procedure calls

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TableMetaDataProvider

org.springframework.jdbc.core.metadata
Interface TableMetaDataProvider

All Known Implementing Classes:
DerbyTableMetaDataProvider, GenericTableMetaDataProvider, HsqlTableMetaDataProvider, OracleTableMetaDataProvider, PostgresTableMetaDataProvider
public interface TableMetaDataProvider

Interface specifying the API to be implemented by a class providing table metedata. This is intended for internal use by the Simple JDBC classes.

Since:
2.5
Author:
Thomas Risberg

Method Summary
 String catalogNameToUse(String catalogName)
Get the catalog name formatted based on metadata information.
 String getSimpleQueryForGetGeneratedKey(String tableName, String keyColumnName)
Get the simple query to retrieve a generated key
 List<TableParameterMetaData> getTableParameterMetaData()
Get the table parameter metadata that is currently used.
 void initializeWithMetaData(DatabaseMetaData databaseMetaData)
Initialize using the database metedata provided
 void initializeWithTableColumnMetaData(DatabaseMetaData databaseMetaData, String catalogName, String schemaName, String tableName)
Initialize using provided database metadata, table and column information.
 boolean isGeneratedKeysColumnNameArraySupported()
Does this database support a column name String array for retreiving generated keys Connection.createStruct(String, Object[])
 boolean isGetGeneratedKeysSimulated()
Does this database support a simple quey to retrieve the generated key whe the JDBC 3.0 feature of retreiving generated keys is not supported DatabaseMetaData.supportsGetGeneratedKeys()
 boolean isGetGeneratedKeysSupported()
Does this database support the JDBC 3.0 feature of retreiving generated keys DatabaseMetaData.supportsGetGeneratedKeys()
 boolean isTableColumnMetaDataUsed()
Are we using the meta data for the table columns?
 String metaDataCatalogNameToUse(String catalogName)
Provide any modification of the catalog name passed in to match the meta data currently used.
 String metaDataSchemaNameToUse(String schemaName)
Provide any modification of the schema name passed in to match the meta data currently used.
 String schemaNameToUse(String schemaName)
Get the schema name formatted based on metadata information.
 String tableNameToUse(String tableName)
Get the table name formatted based on metadata information.

Method Detail

initializeWithMetaData

void initializeWithMetaData(DatabaseMetaData databaseMetaData)
                            throws SQLException
Initialize using the database metedata provided

Parameters:
databaseMetaData -
Throws:
SQLException

initializeWithTableColumnMetaData

void initializeWithTableColumnMetaData(DatabaseMetaData databaseMetaData,
                                       String catalogName,
                                       String schemaName,
                                       String tableName)
                                       throws SQLException
Initialize using provided database metadata, table and column information. This initalization can be turned off by specifying that column meta data should not be used.

Parameters:
databaseMetaData - used to retrieve database specific information
catalogName - name of catalog to use or null
schemaName - name of schema name to use or null
tableName - name of the table
Throws:
SQLException

tableNameToUse

String tableNameToUse(String tableName)
Get the table name formatted based on metadata information. This could include altering the case.

Parameters:
tableName -
Returns:
table name formatted

catalogNameToUse

String catalogNameToUse(String catalogName)
Get the catalog name formatted based on metadata information. This could include altering the case.

Parameters:
catalogName -
Returns:
catalog name formatted

schemaNameToUse

String schemaNameToUse(String schemaName)
Get the schema name formatted based on metadata information. This could include altering the case.

Parameters:
schemaName -
Returns:
schema name formatted

metaDataCatalogNameToUse

String metaDataCatalogNameToUse(String catalogName)
Provide any modification of the catalog name passed in to match the meta data currently used. The reyurned value will be used for meta data lookups. This could include alterig the case used or providing a base catalog if mone provided.

Parameters:
catalogName -
Returns:
catalog name to use

metaDataSchemaNameToUse

String metaDataSchemaNameToUse(String schemaName)
Provide any modification of the schema name passed in to match the meta data currently used. The reyurned value will be used for meta data lookups. This could include alterig the case used or providing a base schema if mone provided.

Parameters:
schemaName -
Returns:
schema name to use

isTableColumnMetaDataUsed

boolean isTableColumnMetaDataUsed()
Are we using the meta data for the table columns?

isGetGeneratedKeysSupported

boolean isGetGeneratedKeysSupported()
Does this database support the JDBC 3.0 feature of retreiving generated keys DatabaseMetaData.supportsGetGeneratedKeys()

isGetGeneratedKeysSimulated

boolean isGetGeneratedKeysSimulated()
Does this database support a simple quey to retrieve the generated key whe the JDBC 3.0 feature of retreiving generated keys is not supported DatabaseMetaData.supportsGetGeneratedKeys()

getSimpleQueryForGetGeneratedKey

String getSimpleQueryForGetGeneratedKey(String tableName,
                                        String keyColumnName)
Get the simple query to retrieve a generated key

isGeneratedKeysColumnNameArraySupported

boolean isGeneratedKeysColumnNameArraySupported()
Does this database support a column name String array for retreiving generated keys Connection.createStruct(String, Object[])

getTableParameterMetaData

List<TableParameterMetaData> getTableParameterMetaData()
Get the table parameter metadata that is currently used.

Returns:
List of TableParameterMetaData
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CallMetaDataContext

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.core.metadata
Class CallMetaDataContext

java.lang.Object
    extended by  org.springframework.jdbc.core.metadata.CallMetaDataContext

public class CallMetaDataContext
extends Object

Class to manage context metadata used for the configuration and execution of the call.

Since:
2.5
Author:
Thomas Risberg, Juergen Hoeller

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
CallMetaDataContext()
Method Summary
String | createCallString() Build the call string based on configuration and metadata information.
SqlParameter | createReturnResultSetParameter(String parameterName, RowMapper rowMapper) Create a ReturnResultSetParameter/SqlOutParameter depending on the support provided by the JDBC driver used for the database in use.
List<SqlParameter> | getCallParameters() Get the List of SqlParameter objects to be used in call execution
String | getCatalogName() Get the name of the catalog.
String | getFunctionReturnName() Get the name used for the return value of the function.
Set<String> | getLimitedInParameterNames() Get a limited set of in parameters to be used.
List<String> | getOutParameterNames() Get a list of the out parameter names.
String | getProcedureName() Get the name of the procedure.
String | getScalarOutParameterName() Get the name of the single out parameter for this call.
String | getSchemaName() Get the name of the schema.
void | initializeMetaData(DataSource dataSource) Initialize this class with metadata from the database
boolean | isAccessCallParameterMetaData() Check whether call parameter metadata should be accessed.
boolean | isFunction() Check whether this call is a function call.
boolean | isReturnValueRequired() Check whether a return value is required.
Map<String,?> | matchInParameterValuesWithCallParameters(Map<String,?> inParameters) Match input parameter values with the parameters declared to be used in the call.
Map<String,?> | matchInParameterValuesWithCallParameters(Object[] parameterValues)
Map<String,Object> | matchInParameterValuesWithCallParameters(SqlParameterSource parameterSource) Match input parameter values with the parameters declared to be used in the call.
void | processParameters(List<SqlParameter> parameters) Process the list of parameters provided and if procedure column metedata is used the parameters will be matched against the metadata information and any missing ones will be automatically included
void | setAccessCallParameterMetaData(boolean accessCallParameterMetaData) Specify whether call parameter metadata should be accessed.
void | setCatalogName(String catalogName) Specify the name of the catalog.
void | setFunction(boolean function) Specify whether this call is a function call.
void | setFunctionReturnName(String functionReturnName) Specify the name used for the return value of the function.
void | setLimitedInParameterNames(Set<String> limitedInParameterNames) Specify a limited set of in parameters to be used.
void | setOutParameterNames(List<String> outParameterNames) Specify the names of the out parameters.
void | setProcedureName(String procedureName) Specify the name of the procedure.
void | setReturnValueRequired(boolean returnValueRequired) Specify whether a return value is required.
void | setSchemaName(String schemaName) Secify the name of the schema.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

CallMetaDataContext

public CallMetaDataContext()
Method Detail

setFunctionReturnName

public void setFunctionReturnName(String functionReturnName)
Specify the name used for the return value of the function.

getFunctionReturnName

public String getFunctionReturnName()
Get the name used for the return value of the function.

setLimitedInParameterNames

public void setLimitedInParameterNames(Set<String> limitedInParameterNames)
Specify a limited set of in parameters to be used.

getLimitedInParameterNames

public Set<String> getLimitedInParameterNames()
Get a limited set of in parameters to be used.

setOutParameterNames

public void setOutParameterNames(List<String> outParameterNames)
Specify the names of the out parameters.

getOutParameterNames

public List<String> getOutParameterNames()
Get a list of the out parameter names.

setProcedureName

public void setProcedureName(String procedureName)
Specify the name of the procedure.

getProcedureName

public String getProcedureName()
Get the name of the procedure.

setCatalogName

public void setCatalogName(String catalogName)
Specify the name of the catalog.

getCatalogName

public String getCatalogName()
Get the name of the catalog.

setSchemaName

public void setSchemaName(String schemaName)
Secify the name of the schema.

getSchemaName

public String getSchemaName()
Get the name of the schema.

setFunction

public void setFunction(boolean function)
Specify whether this call is a function call.

isFunction

public boolean isFunction()
Check whether this call is a function call.

setReturnValueRequired

public void setReturnValueRequired(boolean returnValueRequired)
Specify whether a return value is required.

isReturnValueRequired

public boolean isReturnValueRequired()
Check whether a return value is required.

setAccessCallParameterMetaData

public void setAccessCallParameterMetaData(boolean accessCallParameterMetaData)
Specify whether call parameter metadata should be accessed.

isAccessCallParameterMetaData

public boolean isAccessCallParameterMetaData()
Check whether call parameter metadata should be accessed.

createReturnResultSetParameter

public SqlParameter createReturnResultSetParameter(String parameterName,
                                                   RowMapper rowMapper)
Create a ReturnResultSetParameter/SqlOutParameter depending on the support provided by the JDBC driver used for the database in use.

Parameters:
parameterName - the name of the parameter (also used as the name of the List returned in the output)
rowMapper - a RowMapper implementation used to map the data retuned in the result set
Returns:
the appropriate SqlParameter

getScalarOutParameterName

public String getScalarOutParameterName()
Get the name of the single out parameter for this call. If there are multiple parameters then the name of the first one is returned.

getCallParameters

public List<SqlParameter> getCallParameters()
Get the List of SqlParameter objects to be used in call execution

initializeMetaData

public void initializeMetaData(DataSource dataSource)
Initialize this class with metadata from the database

Parameters:
dataSource - the DataSource used to retrieve metadata

processParameters

public void processParameters(List<SqlParameter> parameters)
Process the list of parameters provided and if procedure column metedata is used the parameters will be matched against the metadata information and any missing ones will be automatically included

Parameters:
parameters - the list of parameters to use as a base

matchInParameterValuesWithCallParameters

public Map<String,Object> matchInParameterValuesWithCallParameters(SqlParameterSource parameterSource)
Match input parameter values with the parameters declared to be used in the call.

Parameters:
parameterSource - the input values
Returns:
a Map containing the matched parameter names with the value taken from the input

matchInParameterValuesWithCallParameters

public Map<String,?> matchInParameterValuesWithCallParameters(Map<String,?> inParameters)
Match input parameter values with the parameters declared to be used in the call.

Parameters:
inParameters - the input values
Returns:
a Map containing the matched parameter names with the value taken from the input

matchInParameterValuesWithCallParameters

public Map<String,?> matchInParameterValuesWithCallParameters(Object[] parameterValues)

createCallString

public String createCallString()
Build the call string based on configuration and metadata information.

Returns:
the call string to be used
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


CallMetaDataProviderFactory

org.springframework.jdbc.core.metadata
Class CallMetaDataProviderFactory

java.lang.Object
    extended by  org.springframework.jdbc.core.metadata.CallMetaDataProviderFactory

public class CallMetaDataProviderFactory
extends Object

Factory used to create a CallMetaDataProvider implementation based on the type of databse being used.

Since:
2.5
Author:
Thomas Risberg

Field Summary
static List<String> | supportedDatabaseProductsForFunctions List of supported database products for function calls
static List<String> | supportedDatabaseProductsForProcedures List of supported database products for procedure calls
Constructor Summary
CallMetaDataProviderFactory()
Method Summary
static CallMetaDataProvider createMetaDataProvider(DataSource dataSource, CallMetaDataContext context)
Create a CallMetaDataProvider based on the database metedata
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

supportedDatabaseProductsForProcedures

public static final List<String> supportedDatabaseProductsForProcedures
List of supported database products for procedure calls

supportedDatabaseProductsForFunctions

public static final List<String> supportedDatabaseProductsForFunctions
List of supported database products for function calls

Constructor Detail

CallMetaDataProviderFactory

public CallMetaDataProviderFactory()
Method Detail

createMetaDataProvider

public static CallMetaDataProvider createMetaDataProvider(DataSource dataSource,
                                                          CallMetaDataContext context)
Create a CallMetaDataProvider based on the database metedata

Parameters:
dataSource - used to retrieve metedata
context - the class that holds configuration and metedata
Returns:
instance of the CallMetaDataProvider implementation to be used
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CallParameterMetaData

org.springframework.jdbc.core.metadata
Class CallParameterMetaData

java.lang.Object
    extended by  org.springframework.jdbc.core.metadata.CallParameterMetaData

public class CallParameterMetaData
extends Object

Holder of metadata for a specific parameter that is used for call processing.

Since:
2.5
Author:
Thomas Risberg

Constructor Summary
CallParameterMetaData(String columnName, int columnType, int sqlType, String typeName, boolean nullable)
Constructor taking all the properties
Method Summary
String | getParameterName() Get the parameter name.
int | getParameterType() Get the parameter type.
int | getSqlType() Get the parameter SQL type.
String | getTypeName() Get the parameter type name.
boolean | isNullable() Get whether the parameter is nullable.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CallParameterMetaData

public CallParameterMetaData(String columnName,
                             int columnType,
                             int sqlType,
                             String typeName,
                             boolean nullable)
Constructor taking all the properties

Method Detail

getParameterName

public String getParameterName()
Get the parameter name.

getParameterType

public int getParameterType()
Get the parameter type.

getSqlType

public int getSqlType()
Get the parameter SQL type.

getTypeName

public String getTypeName()
Get the parameter type name.

isNullable

public boolean isNullable()
Get whether the parameter is nullable.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Db2CallMetaDataProvider

org.springframework.jdbc.core.metadata
Class Db2CallMetaDataProvider

java.lang.Object
    extended by  org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
        extended by  org.springframework.jdbc.core.metadata.Db2CallMetaDataProvider
All Implemented Interfaces:
CallMetaDataProvider
public class Db2CallMetaDataProvider
extends GenericCallMetaDataProvider

DB2 specific implementation for the CallMetaDataProvider interface. This class is intended for internal use by the Simple JDBC classes.

Since:
2.5
Author:
Thomas Risberg

Field Summary
Fields inherited from class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
logger
Constructor Summary
Db2CallMetaDataProvider(DatabaseMetaData databaseMetaData)
Method Summary
void | initializeWithMetaData(DatabaseMetaData databaseMetaData) Initialize using the provided DatabaseMetData.
String | metaDataSchemaNameToUse(String schemaName) Provide any modification of the schema name passed in to match the meta data currently used.
Methods inherited from class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
byPassReturnParameter, catalogNameToUse, createDefaultInOutParameter, createDefaultInParameter, createDefaultOutParameter, getCallParameterMetaData, getRefCursorSqlType, getUserName, initializeWithProcedureColumnMetaData, isProcedureColumnMetaDataUsed, isRefCursorSupported, isReturnResultSetSupported, isStoresLowerCaseIdentifiers, isStoresUpperCaseIdentifiers, isSupportsCatalogsInProcedureCalls, isSupportsSchemasInProcedureCalls, metaDataCatalogNameToUse, parameterNameToUse, procedureNameToUse, schemaNameToUse, setStoresLowerCaseIdentifiers, setStoresUpperCaseIdentifiers, setSupportsCatalogsInProcedureCalls, setSupportsSchemasInProcedureCalls
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Db2CallMetaDataProvider

public Db2CallMetaDataProvider(DatabaseMetaData databaseMetaData)
                        throws SQLException
Throws:
SQLException
Method Detail

initializeWithMetaData

public void initializeWithMetaData(DatabaseMetaData databaseMetaData)
                            throws SQLException
Description copied from interface: CallMetaDataProvider
Initialize using the provided DatabaseMetData.

Specified by:
initializeWithMetaData in interface CallMetaDataProvider
Overrides:
initializeWithMetaData in class GenericCallMetaDataProvider
Parameters:
databaseMetaData - used to retrieve database specific information
Throws:
SQLException - in case of initialization failure

metaDataSchemaNameToUse

public String metaDataSchemaNameToUse(String schemaName)
Description copied from interface: CallMetaDataProvider
Provide any modification of the schema name passed in to match the meta data currently used. The reyurned value will be used for meta data lookups. This could include alterig the case used or providing a base schema if mone provided.

Specified by:
metaDataSchemaNameToUse in interface CallMetaDataProvider
Overrides:
metaDataSchemaNameToUse in class GenericCallMetaDataProvider
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DerbyCallMetaDataProvider

org.springframework.jdbc.core.metadata
Class DerbyCallMetaDataProvider

java.lang.Object
    extended by  org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
        extended by  org.springframework.jdbc.core.metadata.DerbyCallMetaDataProvider
All Implemented Interfaces:
CallMetaDataProvider
public class DerbyCallMetaDataProvider
extends GenericCallMetaDataProvider

Derby specific implementation for the CallMetaDataProvider interface. This class is intended for internal use by the Simple JDBC classes.

Since:
2.5
Author:
Thomas Risberg

Field Summary
Fields inherited from class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
logger
Constructor Summary
DerbyCallMetaDataProvider(DatabaseMetaData databaseMetaData)
Method Summary
 String metaDataSchemaNameToUse(String schemaName)
Provide any modification of the schema name passed in to match the meta data currently used.
Methods inherited from class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
byPassReturnParameter, catalogNameToUse, createDefaultInOutParameter, createDefaultInParameter, createDefaultOutParameter, getCallParameterMetaData, getRefCursorSqlType, getUserName, initializeWithMetaData, initializeWithProcedureColumnMetaData, isProcedureColumnMetaDataUsed, isRefCursorSupported, isReturnResultSetSupported, isStoresLowerCaseIdentifiers, isStoresUpperCaseIdentifiers, isSupportsCatalogsInProcedureCalls, isSupportsSchemasInProcedureCalls, metaDataCatalogNameToUse, parameterNameToUse, procedureNameToUse, schemaNameToUse, setStoresLowerCaseIdentifiers, setStoresUpperCaseIdentifiers, setSupportsCatalogsInProcedureCalls, setSupportsSchemasInProcedureCalls
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DerbyCallMetaDataProvider

public DerbyCallMetaDataProvider(DatabaseMetaData databaseMetaData)
                          throws SQLException
Throws:
SQLException
Method Detail

metaDataSchemaNameToUse

public String metaDataSchemaNameToUse(String schemaName)
Description copied from interface: CallMetaDataProvider
Provide any modification of the schema name passed in to match the meta data currently used. The reyurned value will be used for meta data lookups. This could include alterig the case used or providing a base schema if mone provided.

Specified by:
metaDataSchemaNameToUse in interface CallMetaDataProvider
Overrides:
metaDataSchemaNameToUse in class GenericCallMetaDataProvider
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DerbyTableMetaDataProvider

org.springframework.jdbc.core.metadata
Class DerbyTableMetaDataProvider

java.lang.Object
    extended by  org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
        extended by  org.springframework.jdbc.core.metadata.DerbyTableMetaDataProvider
All Implemented Interfaces:
TableMetaDataProvider
public class DerbyTableMetaDataProvider
extends GenericTableMetaDataProvider

The Derby specific implementation of the TableMetaDataProvider. Overrides the Derby metadata info regarding retreiving generated keys. It seems to work OK so not sure why they claim it's not supported.

Since:
3.0
Author:
Thomas Risberg

Field Summary
Fields inherited from class org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
logger
Constructor Summary
DerbyTableMetaDataProvider(DatabaseMetaData databaseMetaData)
Method Summary
 void initializeWithMetaData(DatabaseMetaData databaseMetaData)
Initialize using the database metedata provided
 boolean isGetGeneratedKeysSupported()
Does this database support the JDBC 3.0 feature of retreiving generated keys DatabaseMetaData.supportsGetGeneratedKeys()
Methods inherited from class org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
catalogNameToUse, getDatabaseVersion, getSimpleQueryForGetGeneratedKey, getTableParameterMetaData, initializeWithTableColumnMetaData, isGeneratedKeysColumnNameArraySupported, isGetGeneratedKeysSimulated, isStoresLowerCaseIdentifiers, isStoresUpperCaseIdentifiers, isTableColumnMetaDataUsed, metaDataCatalogNameToUse, metaDataSchemaNameToUse, schemaNameToUse, setGeneratedKeysColumnNameArraySupported, setGetGeneratedKeysSupported, setStoresLowerCaseIdentifiers, setStoresUpperCaseIdentifiers, tableNameToUse
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DerbyTableMetaDataProvider

public DerbyTableMetaDataProvider(DatabaseMetaData databaseMetaData)
                           throws SQLException
Throws:
SQLException
Method Detail

initializeWithMetaData

public void initializeWithMetaData(DatabaseMetaData databaseMetaData)
                            throws SQLException
Description copied from interface: TableMetaDataProvider
Initialize using the database metedata provided

Specified by:
initializeWithMetaData in interface TableMetaDataProvider
Overrides:
initializeWithMetaData in class GenericTableMetaDataProvider
Throws:
SQLException

isGetGeneratedKeysSupported

public boolean isGetGeneratedKeysSupported()
Description copied from interface: TableMetaDataProvider
Does this database support the JDBC 3.0 feature of retreiving generated keys DatabaseMetaData.supportsGetGeneratedKeys()

Specified by:
isGetGeneratedKeysSupported in interface TableMetaDataProvider
Overrides:
isGetGeneratedKeysSupported in class GenericTableMetaDataProvider
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


GenericCallMetaDataProvider

org.springframework.jdbc.core.metadata
Class GenericCallMetaDataProvider

java.lang.Object
    extended by  org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
All Implemented Interfaces:
CallMetaDataProvider
Direct Known Subclasses:
Db2CallMetaDataProvider, DerbyCallMetaDataProvider, OracleCallMetaDataProvider, PostgresCallMetaDataProvider, SqlServerCallMetaDataProvider, SybaseCallMetaDataProvider
public class GenericCallMetaDataProvider
extends Object
implements CallMetaDataProvider

Generic implementation for the CallMetaDataProvider interface. This class can be extended to provide database specific behavior.

Since:
2.5
Author:
Thomas Risberg

Field Summary
protected static Log logger
Logger available to subclasses
Constructor Summary
protected GenericCallMetaDataProvider(DatabaseMetaData databaseMetaData)
Constructor used to initialize with provided database meta data.
Method Summary
 boolean byPassReturnParameter(String parameterName)
Should we bypass the return parameter with the specified name.
 String catalogNameToUse(String catalogName)
Provide any modification of the catalog name passed in to match the meta data currently used.
 SqlParameter createDefaultInOutParameter(String parameterName, CallParameterMetaData meta)
Create a default inout parameter based on the provided meta data.
 SqlParameter createDefaultInParameter(String parameterName, CallParameterMetaData meta)
Create a default in parameter based on the provided meta data.
 SqlParameter createDefaultOutParameter(String parameterName, CallParameterMetaData meta)
Create a default out parameter based on the provided meta data.
 List<CallParameterMetaData> getCallParameterMetaData()
Get the call parameter metadata that is currently used.
 int getRefCursorSqlType()
Get the Types type for columns that return resultsets as ref cursors if this feature is supported.
 String getUserName()
Get the name of the current user.
 void initializeWithMetaData(DatabaseMetaData databaseMetaData)
Initialize using the provided DatabaseMetData.
 void initializeWithProcedureColumnMetaData(DatabaseMetaData databaseMetaData, String catalogName, String schemaName, String procedureName)
Initialize the database specific management of procedure column meta data.
 boolean isProcedureColumnMetaDataUsed()
Are we using the meta data for the procedure columns?
 boolean isRefCursorSupported()
Does this database support returning resultsets as ref cursors to be retrieved with CallableStatement.getObject(int) for the specified column.
 boolean isReturnResultSetSupported()
Does this database support returning resultsets that should be retrieved with the JDBC call Statement.getResultSet()
protected  boolean isStoresLowerCaseIdentifiers()
Does the database use lower case for identifiers
protected  boolean isStoresUpperCaseIdentifiers()
Does the database use upper case for identifiers
 boolean isSupportsCatalogsInProcedureCalls()
Does the database support the use of catalog name in procedure calls
 boolean isSupportsSchemasInProcedureCalls()
Does the database support the use of schema name in procedure calls
 String metaDataCatalogNameToUse(String catalogName)
Provide any modification of the catalog name passed in to match the meta data currently used.
 String metaDataSchemaNameToUse(String schemaName)
Provide any modification of the schema name passed in to match the meta data currently used.
 String parameterNameToUse(String parameterName)
Provide any modification of the column name passed in to match the meta data currently used.
 String procedureNameToUse(String procedureName)
Provide any modification of the procedure name passed in to match the meta data currently used.
 String schemaNameToUse(String schemaName)
Provide any modification of the schema name passed in to match the meta data currently used.
protected  void setStoresLowerCaseIdentifiers(boolean storesLowerCaseIdentifiers)
Specify whether the database uses lower case for identifiers
protected  void setStoresUpperCaseIdentifiers(boolean storesUpperCaseIdentifiers)
Specify whether the database uses upper case for identifiers
protected  void setSupportsCatalogsInProcedureCalls(boolean supportsCatalogsInProcedureCalls)
Specify whether the database supports the use of catalog name in procedure calls
protected  void setSupportsSchemasInProcedureCalls(boolean supportsSchemasInProcedureCalls)
Specify whether the database supports the use of schema name in procedure calls
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected static final Log logger
Logger available to subclasses

Constructor Detail

GenericCallMetaDataProvider

protected GenericCallMetaDataProvider(DatabaseMetaData databaseMetaData)
                               throws SQLException
Constructor used to initialize with provided database meta data.

Parameters:
databaseMetaData - meta data to be used
Throws:
SQLException
Method Detail

initializeWithMetaData

public void initializeWithMetaData(DatabaseMetaData databaseMetaData)
                            throws SQLException
Description copied from interface: CallMetaDataProvider
Initialize using the provided DatabaseMetData.

Specified by:
initializeWithMetaData in interface CallMetaDataProvider
Parameters:
databaseMetaData - used to retrieve database specific information
Throws:
SQLException - in case of initialization failure

initializeWithProcedureColumnMetaData

public void initializeWithProcedureColumnMetaData(DatabaseMetaData databaseMetaData,
                                                  String catalogName,
                                                  String schemaName,
                                                  String procedureName)
                                           throws SQLException
Description copied from interface: CallMetaDataProvider
Initialize the database specific management of procedure column meta data. This is only called for databases that are supported. This initalization can be turned off by specifying that column meta data should not be used.

Specified by:
initializeWithProcedureColumnMetaData in interface CallMetaDataProvider
Parameters:
databaseMetaData - used to retrieve database specific information
catalogName - name of catalog to use or null
schemaName - name of schema name to use or null
procedureName - name of the stored procedure
Throws:
SQLException - in case of initialization failure
See Also:
SimpleJdbcCall.withoutProcedureColumnMetaDataAccess()

getCallParameterMetaData

public List<CallParameterMetaData> getCallParameterMetaData()
Description copied from interface: CallMetaDataProvider
Get the call parameter metadata that is currently used.

Specified by:
getCallParameterMetaData in interface CallMetaDataProvider
Returns:
List of CallParameterMetaData

procedureNameToUse

public String procedureNameToUse(String procedureName)
Description copied from interface: CallMetaDataProvider
Provide any modification of the procedure name passed in to match the meta data currently used. This could include alterig the case.

Specified by:
procedureNameToUse in interface CallMetaDataProvider

catalogNameToUse

public String catalogNameToUse(String catalogName)
Description copied from interface: CallMetaDataProvider
Provide any modification of the catalog name passed in to match the meta data currently used. This could include alterig the case.

Specified by:
catalogNameToUse in interface CallMetaDataProvider

schemaNameToUse

public String schemaNameToUse(String schemaName)
Description copied from interface: CallMetaDataProvider
Provide any modification of the schema name passed in to match the meta data currently used. This could include alterig the case.

Specified by:
schemaNameToUse in interface CallMetaDataProvider

metaDataCatalogNameToUse

public String metaDataCatalogNameToUse(String catalogName)
Description copied from interface: CallMetaDataProvider
Provide any modification of the catalog name passed in to match the meta data currently used. The reyurned value will be used for meta data lookups. This could include alterig the case used or providing a base catalog if mone provided.

Specified by:
metaDataCatalogNameToUse in interface CallMetaDataProvider

metaDataSchemaNameToUse

public String metaDataSchemaNameToUse(String schemaName)
Description copied from interface: CallMetaDataProvider
Provide any modification of the schema name passed in to match the meta data currently used. The reyurned value will be used for meta data lookups. This could include alterig the case used or providing a base schema if mone provided.

Specified by:
metaDataSchemaNameToUse in interface CallMetaDataProvider

parameterNameToUse

public String parameterNameToUse(String parameterName)
Description copied from interface: CallMetaDataProvider
Provide any modification of the column name passed in to match the meta data currently used. This could include alterig the case.

Specified by:
parameterNameToUse in interface CallMetaDataProvider
Parameters:
parameterName - name of the parameter of column

byPassReturnParameter

public boolean byPassReturnParameter(String parameterName)
Description copied from interface: CallMetaDataProvider
Should we bypass the return parameter with the specified name. This allows the database specific implementation to skip the processing for specific results returned by the database call.

Specified by:
byPassReturnParameter in interface CallMetaDataProvider

createDefaultOutParameter

public SqlParameter createDefaultOutParameter(String parameterName,
                                              CallParameterMetaData meta)
Description copied from interface: CallMetaDataProvider
Create a default out parameter based on the provided meta data. This is used when no expicit parameter declaration has been made.

Specified by:
createDefaultOutParameter in interface CallMetaDataProvider
Parameters:
parameterName - the name of the parameter
meta - meta data used for this call
Returns:
the configured SqlOutParameter

createDefaultInOutParameter

public SqlParameter createDefaultInOutParameter(String parameterName,
                                                CallParameterMetaData meta)
Description copied from interface: CallMetaDataProvider
Create a default inout parameter based on the provided meta data. This is used when no expicit parameter declaration has been made.

Specified by:
createDefaultInOutParameter in interface CallMetaDataProvider
Parameters:
parameterName - the name of the parameter
meta - meta data used for this call
Returns:
the configured SqlInOutParameter

createDefaultInParameter

public SqlParameter createDefaultInParameter(String parameterName,
                                             CallParameterMetaData meta)
Description copied from interface: CallMetaDataProvider
Create a default in parameter based on the provided meta data. This is used when no expicit parameter declaration has been made.

Specified by:
createDefaultInParameter in interface CallMetaDataProvider
Parameters:
parameterName - the name of the parameter
meta - meta data used for this call
Returns:
the configured SqlParameter

getUserName

public String getUserName()
Description copied from interface: CallMetaDataProvider
Get the name of the current user. Useful for meta data lookups etc.

Specified by:
getUserName in interface CallMetaDataProvider
Returns:
current user name from database connection

isReturnResultSetSupported

public boolean isReturnResultSetSupported()
Description copied from interface: CallMetaDataProvider
Does this database support returning resultsets that should be retrieved with the JDBC call Statement.getResultSet()

Specified by:
isReturnResultSetSupported in interface CallMetaDataProvider

isRefCursorSupported

public boolean isRefCursorSupported()
Description copied from interface: CallMetaDataProvider
Does this database support returning resultsets as ref cursors to be retrieved with CallableStatement.getObject(int) for the specified column.

Specified by:
isRefCursorSupported in interface CallMetaDataProvider

getRefCursorSqlType

public int getRefCursorSqlType()
Description copied from interface: CallMetaDataProvider
Get the Types type for columns that return resultsets as ref cursors if this feature is supported.

Specified by:
getRefCursorSqlType in interface CallMetaDataProvider

isProcedureColumnMetaDataUsed

public boolean isProcedureColumnMetaDataUsed()
Description copied from interface: CallMetaDataProvider
Are we using the meta data for the procedure columns?

Specified by:
isProcedureColumnMetaDataUsed in interface CallMetaDataProvider

setSupportsCatalogsInProcedureCalls

protected void setSupportsCatalogsInProcedureCalls(boolean supportsCatalogsInProcedureCalls)
Specify whether the database supports the use of catalog name in procedure calls

isSupportsCatalogsInProcedureCalls

public boolean isSupportsCatalogsInProcedureCalls()
Does the database support the use of catalog name in procedure calls

Specified by:
isSupportsCatalogsInProcedureCalls in interface CallMetaDataProvider

setSupportsSchemasInProcedureCalls

protected void setSupportsSchemasInProcedureCalls(boolean supportsSchemasInProcedureCalls)
Specify whether the database supports the use of schema name in procedure calls

isSupportsSchemasInProcedureCalls

public boolean isSupportsSchemasInProcedureCalls()
Does the database support the use of schema name in procedure calls

Specified by:
isSupportsSchemasInProcedureCalls in interface CallMetaDataProvider

setStoresUpperCaseIdentifiers

protected void setStoresUpperCaseIdentifiers(boolean storesUpperCaseIdentifiers)
Specify whether the database uses upper case for identifiers

isStoresUpperCaseIdentifiers

protected boolean isStoresUpperCaseIdentifiers()
Does the database use upper case for identifiers

setStoresLowerCaseIdentifiers

protected void setStoresLowerCaseIdentifiers(boolean storesLowerCaseIdentifiers)
Specify whether the database uses lower case for identifiers

isStoresLowerCaseIdentifiers

protected boolean isStoresLowerCaseIdentifiers()
Does the database use lower case for identifiers

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


GenericTableMetaDataProvider

org.springframework.jdbc.core.metadata
Class GenericTableMetaDataProvider

java.lang.Object
    extended by  org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
All Implemented Interfaces:
TableMetaDataProvider
Direct Known Subclasses:
DerbyTableMetaDataProvider, HsqlTableMetaDataProvider, OracleTableMetaDataProvider, PostgresTableMetaDataProvider
public class GenericTableMetaDataProvider
extends Object
implements TableMetaDataProvider

A generic implementation of the TableMetaDataProvider that should provide enough features for all supported databases.

Since:
2.5
Author:
Thomas Risberg

Field Summary
protected static Log logger
Logger available to subclasses
Constructor Summary
protected GenericTableMetaDataProvider(DatabaseMetaData databaseMetaData)
Constructor used to initialize with provided database meta data.
Method Summary
 String catalogNameToUse(String catalogName)
Get the catalog name formatted based on metadata information.
protected  String getDatabaseVersion()
Provide access to version info for subclasses
 String getSimpleQueryForGetGeneratedKey(String tableName, String keyColumnName)
Get the simple query to retrieve a generated key
 List<TableParameterMetaData> getTableParameterMetaData()
Get the table parameter metadata that is currently used.
 void initializeWithMetaData(DatabaseMetaData databaseMetaData)
Initialize using the database metedata provided
 void initializeWithTableColumnMetaData(DatabaseMetaData databaseMetaData, String catalogName, String schemaName, String tableName)
Initialize using provided database metadata, table and column information.
 boolean isGeneratedKeysColumnNameArraySupported()
Does this database support a column name String array for retreiving generated keys Connection.createStruct(String, Object[])
 boolean isGetGeneratedKeysSimulated()
Does this database support a simple quey to retrieve the generated key whe the JDBC 3.0 feature of retreiving generated keys is not supported DatabaseMetaData.supportsGetGeneratedKeys()
 boolean isGetGeneratedKeysSupported()
Does this database support the JDBC 3.0 feature of retreiving generated keys DatabaseMetaData.supportsGetGeneratedKeys()
 boolean isStoresLowerCaseIdentifiers()
Get whether identifiers use lower case
 boolean isStoresUpperCaseIdentifiers()
Get whether identifiers use upper case
 boolean isTableColumnMetaDataUsed()
Are we using the meta data for the table columns?
 String metaDataCatalogNameToUse(String catalogName)
Provide any modification of the catalog name passed in to match the meta data currently used.
 String metaDataSchemaNameToUse(String schemaName)
Provide any modification of the schema name passed in to match the meta data currently used.
 String schemaNameToUse(String schemaName)
Get the schema name formatted based on metadata information.
 void setGeneratedKeysColumnNameArraySupported(boolean generatedKeysColumnNameArraySupported)
Specify whether a column name array is supported for generated keys
 void setGetGeneratedKeysSupported(boolean getGeneratedKeysSupported)
Specify whether a column name array is supported for generated keys
 void setStoresLowerCaseIdentifiers(boolean storesLowerCaseIdentifiers)
Specify whether identifiers use lower case
 void setStoresUpperCaseIdentifiers(boolean storesUpperCaseIdentifiers)
Specify whether identifiers use upper case
 String tableNameToUse(String tableName)
Get the table name formatted based on metadata information.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected static final Log logger
Logger available to subclasses

Constructor Detail

GenericTableMetaDataProvider

protected GenericTableMetaDataProvider(DatabaseMetaData databaseMetaData)
                                throws SQLException
Constructor used to initialize with provided database meta data.

Parameters:
databaseMetaData - meta data to be used
Throws:
SQLException
Method Detail

isStoresUpperCaseIdentifiers

public boolean isStoresUpperCaseIdentifiers()
Get whether identifiers use upper case

setStoresUpperCaseIdentifiers

public void setStoresUpperCaseIdentifiers(boolean storesUpperCaseIdentifiers)
Specify whether identifiers use upper case

isStoresLowerCaseIdentifiers

public boolean isStoresLowerCaseIdentifiers()
Get whether identifiers use lower case

setStoresLowerCaseIdentifiers

public void setStoresLowerCaseIdentifiers(boolean storesLowerCaseIdentifiers)
Specify whether identifiers use lower case

isTableColumnMetaDataUsed

public boolean isTableColumnMetaDataUsed()
Description copied from interface: TableMetaDataProvider
Are we using the meta data for the table columns?

Specified by:
isTableColumnMetaDataUsed in interface TableMetaDataProvider

getTableParameterMetaData

public List<TableParameterMetaData> getTableParameterMetaData()
Description copied from interface: TableMetaDataProvider
Get the table parameter metadata that is currently used.

Specified by:
getTableParameterMetaData in interface TableMetaDataProvider
Returns:
List of TableParameterMetaData

isGetGeneratedKeysSupported

public boolean isGetGeneratedKeysSupported()
Description copied from interface: TableMetaDataProvider
Does this database support the JDBC 3.0 feature of retreiving generated keys DatabaseMetaData.supportsGetGeneratedKeys()

Specified by:
isGetGeneratedKeysSupported in interface TableMetaDataProvider

isGetGeneratedKeysSimulated

public boolean isGetGeneratedKeysSimulated()
Description copied from interface: TableMetaDataProvider
Does this database support a simple quey to retrieve the generated key whe the JDBC 3.0 feature of retreiving generated keys is not supported DatabaseMetaData.supportsGetGeneratedKeys()

Specified by:
isGetGeneratedKeysSimulated in interface TableMetaDataProvider

getSimpleQueryForGetGeneratedKey

public String getSimpleQueryForGetGeneratedKey(String tableName,
                                               String keyColumnName)
Description copied from interface: TableMetaDataProvider
Get the simple query to retrieve a generated key

Specified by:
getSimpleQueryForGetGeneratedKey in interface TableMetaDataProvider

setGetGeneratedKeysSupported

public void setGetGeneratedKeysSupported(boolean getGeneratedKeysSupported)
Specify whether a column name array is supported for generated keys

isGeneratedKeysColumnNameArraySupported

public boolean isGeneratedKeysColumnNameArraySupported()
Description copied from interface: TableMetaDataProvider
Does this database support a column name String array for retreiving generated keys Connection.createStruct(String, Object[])

Specified by:
isGeneratedKeysColumnNameArraySupported in interface TableMetaDataProvider

setGeneratedKeysColumnNameArraySupported

public void setGeneratedKeysColumnNameArraySupported(boolean generatedKeysColumnNameArraySupported)
Specify whether a column name array is supported for generated keys

initializeWithMetaData

public void initializeWithMetaData(DatabaseMetaData databaseMetaData)
                            throws SQLException
Description copied from interface: TableMetaDataProvider
Initialize using the database metedata provided

Specified by:
initializeWithMetaData in interface TableMetaDataProvider
Throws:
SQLException

initializeWithTableColumnMetaData

public void initializeWithTableColumnMetaData(DatabaseMetaData databaseMetaData,
                                              String catalogName,
                                              String schemaName,
                                              String tableName)
                                       throws SQLException
Description copied from interface: TableMetaDataProvider
Initialize using provided database metadata, table and column information. This initalization can be turned off by specifying that column meta data should not be used.

Specified by:
initializeWithTableColumnMetaData in interface TableMetaDataProvider
Parameters:
databaseMetaData - used to retrieve database specific information
catalogName - name of catalog to use or null
schemaName - name of schema name to use or null
tableName - name of the table
Throws:
SQLException

tableNameToUse

public String tableNameToUse(String tableName)
Description copied from interface: TableMetaDataProvider
Get the table name formatted based on metadata information. This could include altering the case.

Specified by:
tableNameToUse in interface TableMetaDataProvider
Returns:
table name formatted

catalogNameToUse

public String catalogNameToUse(String catalogName)
Description copied from interface: TableMetaDataProvider
Get the catalog name formatted based on metadata information. This could include altering the case.

Specified by:
catalogNameToUse in interface TableMetaDataProvider
Returns:
catalog name formatted

schemaNameToUse

public String schemaNameToUse(String schemaName)
Description copied from interface: TableMetaDataProvider
Get the schema name formatted based on metadata information. This could include altering the case.

Specified by:
schemaNameToUse in interface TableMetaDataProvider
Returns:
schema name formatted

metaDataCatalogNameToUse

public String metaDataCatalogNameToUse(String catalogName)
Description copied from interface: TableMetaDataProvider
Provide any modification of the catalog name passed in to match the meta data currently used. The reyurned value will be used for meta data lookups. This could include alterig the case used or providing a base catalog if mone provided.

Specified by:
metaDataCatalogNameToUse in interface TableMetaDataProvider
Returns:
catalog name to use

metaDataSchemaNameToUse

public String metaDataSchemaNameToUse(String schemaName)
Description copied from interface: TableMetaDataProvider
Provide any modification of the schema name passed in to match the meta data currently used. The reyurned value will be used for meta data lookups. This could include alterig the case used or providing a base schema if mone provided.

Specified by:
metaDataSchemaNameToUse in interface TableMetaDataProvider
Returns:
schema name to use

getDatabaseVersion

protected String getDatabaseVersion()
Provide access to version info for subclasses

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HsqlTableMetaDataProvider

org.springframework.jdbc.core.metadata
Class HsqlTableMetaDataProvider

java.lang.Object
    extended by  org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
        extended by  org.springframework.jdbc.core.metadata.HsqlTableMetaDataProvider
All Implemented Interfaces:
TableMetaDataProvider
public class HsqlTableMetaDataProvider
extends GenericTableMetaDataProvider

The HSQL specific implementation of the TableMetaDataProvider. Suports a feature for retreiving generated keys without the JDBC 3.0 getGeneratedKeys support.

Since:
2.5
Author:
Thomas Risberg

Field Summary
Fields inherited from class org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
logger
Constructor Summary
HsqlTableMetaDataProvider(DatabaseMetaData databaseMetaData)
Method Summary
 String getSimpleQueryForGetGeneratedKey(String tableName, String keyColumnName)
Get the simple query to retrieve a generated key
 boolean isGetGeneratedKeysSimulated()
Does this database support a simple quey to retrieve the generated key whe the JDBC 3.0 feature of retreiving generated keys is not supported DatabaseMetaData.supportsGetGeneratedKeys()
Methods inherited from class org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
catalogNameToUse, getDatabaseVersion, getTableParameterMetaData, initializeWithMetaData, initializeWithTableColumnMetaData, isGeneratedKeysColumnNameArraySupported, isGetGeneratedKeysSupported, isStoresLowerCaseIdentifiers, isStoresUpperCaseIdentifiers, isTableColumnMetaDataUsed, metaDataCatalogNameToUse, metaDataSchemaNameToUse, schemaNameToUse, setGeneratedKeysColumnNameArraySupported, setGetGeneratedKeysSupported, setStoresLowerCaseIdentifiers, setStoresUpperCaseIdentifiers, tableNameToUse
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

HsqlTableMetaDataProvider

public HsqlTableMetaDataProvider(DatabaseMetaData databaseMetaData)
                          throws SQLException
Throws:
SQLException
Method Detail

isGetGeneratedKeysSimulated

public boolean isGetGeneratedKeysSimulated()
Description copied from interface: TableMetaDataProvider
Does this database support a simple quey to retrieve the generated key whe the JDBC 3.0 feature of retreiving generated keys is not supported DatabaseMetaData.supportsGetGeneratedKeys()

Specified by:
isGetGeneratedKeysSimulated in interface TableMetaDataProvider
Overrides:
isGetGeneratedKeysSimulated in class GenericTableMetaDataProvider

getSimpleQueryForGetGeneratedKey

public String getSimpleQueryForGetGeneratedKey(String tableName,
                                               String keyColumnName)
Description copied from interface: TableMetaDataProvider
Get the simple query to retrieve a generated key

Specified by:
getSimpleQueryForGetGeneratedKey in interface TableMetaDataProvider
Overrides:
getSimpleQueryForGetGeneratedKey in class GenericTableMetaDataProvider
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OracleCallMetaDataProvider

org.springframework.jdbc.core.metadata
Class OracleCallMetaDataProvider

java.lang.Object
    extended by  org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
        extended by  org.springframework.jdbc.core.metadata.OracleCallMetaDataProvider
All Implemented Interfaces:
CallMetaDataProvider
public class OracleCallMetaDataProvider
extends GenericCallMetaDataProvider

Oracle specific implementation for the CallMetaDataProvider interface. This class is intended for internal use by the Simple JDBC classes.

Since:
2.5
Author:
Thomas Risberg

Field Summary
Fields inherited from class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
logger
Constructor Summary
OracleCallMetaDataProvider(DatabaseMetaData databaseMetaData)
Method Summary
 SqlParameter createDefaultOutParameter(String parameterName, CallParameterMetaData meta)
Create a default out parameter based on the provided meta data.
 int getRefCursorSqlType()
Get the Types type for columns that return resultsets as ref cursors if this feature is supported.
 boolean isRefCursorSupported()
Does this database support returning resultsets as ref cursors to be retrieved with CallableStatement.getObject(int) for the specified column.
 boolean isReturnResultSetSupported()
Does this database support returning resultsets that should be retrieved with the JDBC call Statement.getResultSet()
 String metaDataCatalogNameToUse(String catalogName)
Provide any modification of the catalog name passed in to match the meta data currently used.
 String metaDataSchemaNameToUse(String schemaName)
Provide any modification of the schema name passed in to match the meta data currently used.
Methods inherited from class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
byPassReturnParameter, catalogNameToUse, createDefaultInOutParameter, createDefaultInParameter, getCallParameterMetaData, getUserName, initializeWithMetaData, initializeWithProcedureColumnMetaData, isProcedureColumnMetaDataUsed, isStoresLowerCaseIdentifiers, isStoresUpperCaseIdentifiers, isSupportsCatalogsInProcedureCalls, isSupportsSchemasInProcedureCalls, parameterNameToUse, procedureNameToUse, schemaNameToUse, setStoresLowerCaseIdentifiers, setStoresUpperCaseIdentifiers, setSupportsCatalogsInProcedureCalls, setSupportsSchemasInProcedureCalls
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OracleCallMetaDataProvider

public OracleCallMetaDataProvider(DatabaseMetaData databaseMetaData)
                           throws SQLException
Throws:
SQLException
Method Detail

isReturnResultSetSupported

public boolean isReturnResultSetSupported()
Description copied from interface: CallMetaDataProvider
Does this database support returning resultsets that should be retrieved with the JDBC call Statement.getResultSet()

Specified by:
isReturnResultSetSupported in interface CallMetaDataProvider
Overrides:
isReturnResultSetSupported in class GenericCallMetaDataProvider

isRefCursorSupported

public boolean isRefCursorSupported()
Description copied from interface: CallMetaDataProvider
Does this database support returning resultsets as ref cursors to be retrieved with CallableStatement.getObject(int) for the specified column.

Specified by:
isRefCursorSupported in interface CallMetaDataProvider
Overrides:
isRefCursorSupported in class GenericCallMetaDataProvider

getRefCursorSqlType

public int getRefCursorSqlType()
Description copied from interface: CallMetaDataProvider
Get the Types type for columns that return resultsets as ref cursors if this feature is supported.

Specified by:
getRefCursorSqlType in interface CallMetaDataProvider
Overrides:
getRefCursorSqlType in class GenericCallMetaDataProvider

metaDataCatalogNameToUse

public String metaDataCatalogNameToUse(String catalogName)
Description copied from interface: CallMetaDataProvider
Provide any modification of the catalog name passed in to match the meta data currently used. The reyurned value will be used for meta data lookups. This could include alterig the case used or providing a base catalog if mone provided.

Specified by:
metaDataCatalogNameToUse in interface CallMetaDataProvider
Overrides:
metaDataCatalogNameToUse in class GenericCallMetaDataProvider

metaDataSchemaNameToUse

public String metaDataSchemaNameToUse(String schemaName)
Description copied from interface: CallMetaDataProvider
Provide any modification of the schema name passed in to match the meta data currently used. The reyurned value will be used for meta data lookups. This could include alterig the case used or providing a base schema if mone provided.

Specified by:
metaDataSchemaNameToUse in interface CallMetaDataProvider
Overrides:
metaDataSchemaNameToUse in class GenericCallMetaDataProvider

createDefaultOutParameter

public SqlParameter createDefaultOutParameter(String parameterName,
                                              CallParameterMetaData meta)
Description copied from interface: CallMetaDataProvider
Create a default out parameter based on the provided meta data. This is used when no expicit parameter declaration has been made.

Specified by:
createDefaultOutParameter in interface CallMetaDataProvider
Overrides:
createDefaultOutParameter in class GenericCallMetaDataProvider
Parameters:
parameterName - the name of the parameter
meta - meta data used for this call
Returns:
the configured SqlOutParameter
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OracleTableMetaDataProvider

org.springframework.jdbc.core.metadata
Class OracleTableMetaDataProvider

java.lang.Object
    extended by  org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
        extended by  org.springframework.jdbc.core.metadata.OracleTableMetaDataProvider
All Implemented Interfaces:
TableMetaDataProvider
public class OracleTableMetaDataProvider
extends GenericTableMetaDataProvider

The Oracle specific implementation of the TableMetaDataProvider. Supports a feature for including synonyms in the metadata lookup.

Since:
3.0
Author:
Thomas Risberg

Field Summary
Fields inherited from class org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
logger
Constructor Summary
OracleTableMetaDataProvider(DatabaseMetaData databaseMetaData)
OracleTableMetaDataProvider(DatabaseMetaData databaseMetaData, boolean includeSynonyms)
Method Summary
 void initializeWithTableColumnMetaData(DatabaseMetaData databaseMetaData, String catalogName, String schemaName, String tableName)
Initialize using provided database metadata, table and column information.
Methods inherited from class org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
catalogNameToUse, getDatabaseVersion, getSimpleQueryForGetGeneratedKey, getTableParameterMetaData, initializeWithMetaData, isGeneratedKeysColumnNameArraySupported, isGetGeneratedKeysSimulated, isGetGeneratedKeysSupported, isStoresLowerCaseIdentifiers, isStoresUpperCaseIdentifiers, isTableColumnMetaDataUsed, metaDataCatalogNameToUse, metaDataSchemaNameToUse, schemaNameToUse, setGeneratedKeysColumnNameArraySupported, setGetGeneratedKeysSupported, setStoresLowerCaseIdentifiers, setStoresUpperCaseIdentifiers, tableNameToUse
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OracleTableMetaDataProvider

public OracleTableMetaDataProvider(DatabaseMetaData databaseMetaData)
                            throws SQLException
Throws:
SQLException

OracleTableMetaDataProvider

public OracleTableMetaDataProvider(DatabaseMetaData databaseMetaData,
                                   boolean includeSynonyms)
                            throws SQLException
Throws:
SQLException
Method Detail

initializeWithTableColumnMetaData

public void initializeWithTableColumnMetaData(DatabaseMetaData databaseMetaData,
                                              String catalogName,
                                              String schemaName,
                                              String tableName)
                                       throws SQLException
Description copied from interface: TableMetaDataProvider
Initialize using provided database metadata, table and column information. This initalization can be turned off by specifying that column meta data should not be used.

Specified by:
initializeWithTableColumnMetaData in interface TableMetaDataProvider
Overrides:
initializeWithTableColumnMetaData in class GenericTableMetaDataProvider
Parameters:
databaseMetaData - used to retrieve database specific information
catalogName - name of catalog to use or null
schemaName - name of schema name to use or null
tableName - name of the table
Throws:
SQLException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PostgresCallMetaDataProvider

org.springframework.jdbc.core.metadata
Class PostgresCallMetaDataProvider

java.lang.Object
    extended by  org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
        extended by  org.springframework.jdbc.core.metadata.PostgresCallMetaDataProvider
All Implemented Interfaces:
CallMetaDataProvider
public class PostgresCallMetaDataProvider
extends GenericCallMetaDataProvider

Oracle specific implementation for the CallMetaDataProvider interface. This class is intended for internal use by the Simple JDBC classes.

Since:
2.5
Author:
Thomas Risberg

Field Summary
Fields inherited from class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
logger
Constructor Summary
PostgresCallMetaDataProvider(DatabaseMetaData databaseMetaData)
Method Summary
 boolean byPassReturnParameter(String parameterName)
Should we bypass the return parameter with the specified name.
 SqlParameter createDefaultOutParameter(String parameterName, CallParameterMetaData meta)
Create a default out parameter based on the provided meta data.
 int getRefCursorSqlType()
Get the Types type for columns that return resultsets as ref cursors if this feature is supported.
 boolean isRefCursorSupported()
Does this database support returning resultsets as ref cursors to be retrieved with CallableStatement.getObject(int) for the specified column.
 boolean isReturnResultSetSupported()
Does this database support returning resultsets that should be retrieved with the JDBC call Statement.getResultSet()
 String metaDataSchemaNameToUse(String schemaName)
Provide any modification of the schema name passed in to match the meta data currently used.
Methods inherited from class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
catalogNameToUse, createDefaultInOutParameter, createDefaultInParameter, getCallParameterMetaData, getUserName, initializeWithMetaData, initializeWithProcedureColumnMetaData, isProcedureColumnMetaDataUsed, isStoresLowerCaseIdentifiers, isStoresUpperCaseIdentifiers, isSupportsCatalogsInProcedureCalls, isSupportsSchemasInProcedureCalls, metaDataCatalogNameToUse, parameterNameToUse, procedureNameToUse, schemaNameToUse, setStoresLowerCaseIdentifiers, setStoresUpperCaseIdentifiers, setSupportsCatalogsInProcedureCalls, setSupportsSchemasInProcedureCalls
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PostgresCallMetaDataProvider

public PostgresCallMetaDataProvider(DatabaseMetaData databaseMetaData)
                             throws SQLException
Throws:
SQLException
Method Detail

isReturnResultSetSupported

public boolean isReturnResultSetSupported()
Description copied from interface: CallMetaDataProvider
Does this database support returning resultsets that should be retrieved with the JDBC call Statement.getResultSet()

Specified by:
isReturnResultSetSupported in interface CallMetaDataProvider
Overrides:
isReturnResultSetSupported in class GenericCallMetaDataProvider

isRefCursorSupported

public boolean isRefCursorSupported()
Description copied from interface: CallMetaDataProvider
Does this database support returning resultsets as ref cursors to be retrieved with CallableStatement.getObject(int) for the specified column.

Specified by:
isRefCursorSupported in interface CallMetaDataProvider
Overrides:
isRefCursorSupported in class GenericCallMetaDataProvider

getRefCursorSqlType

public int getRefCursorSqlType()
Description copied from interface: CallMetaDataProvider
Get the Types type for columns that return resultsets as ref cursors if this feature is supported.

Specified by:
getRefCursorSqlType in interface CallMetaDataProvider
Overrides:
getRefCursorSqlType in class GenericCallMetaDataProvider

metaDataSchemaNameToUse

public String metaDataSchemaNameToUse(String schemaName)
Description copied from interface: CallMetaDataProvider
Provide any modification of the schema name passed in to match the meta data currently used. The reyurned value will be used for meta data lookups. This could include alterig the case used or providing a base schema if mone provided.

Specified by:
metaDataSchemaNameToUse in interface CallMetaDataProvider
Overrides:
metaDataSchemaNameToUse in class GenericCallMetaDataProvider

createDefaultOutParameter

public SqlParameter createDefaultOutParameter(String parameterName,
                                              CallParameterMetaData meta)
Description copied from interface: CallMetaDataProvider
Create a default out parameter based on the provided meta data. This is used when no expicit parameter declaration has been made.

Specified by:
createDefaultOutParameter in interface CallMetaDataProvider
Overrides:
createDefaultOutParameter in class GenericCallMetaDataProvider
Parameters:
parameterName - the name of the parameter
meta - meta data used for this call
Returns:
the configured SqlOutParameter

byPassReturnParameter

public boolean byPassReturnParameter(String parameterName)
Description copied from interface: CallMetaDataProvider
Should we bypass the return parameter with the specified name. This allows the database specific implementation to skip the processing for specific results returned by the database call.

Specified by:
byPassReturnParameter in interface CallMetaDataProvider
Overrides:
byPassReturnParameter in class GenericCallMetaDataProvider
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PostgresTableMetaDataProvider

org.springframework.jdbc.core.metadata
Class PostgresTableMetaDataProvider

java.lang.Object
    extended by  org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
        extended by  org.springframework.jdbc.core.metadata.PostgresTableMetaDataProvider
All Implemented Interfaces:
TableMetaDataProvider
public class PostgresTableMetaDataProvider
extends GenericTableMetaDataProvider

The PostgreSQL specific implementation of the TableMetaDataProvider. Suports a feature for retreiving generated keys without the JDBC 3.0 getGeneratedKeys support.

Since:
2.5
Author:
Thomas Risberg

Field Summary
Fields inherited from class org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
logger
Constructor Summary
PostgresTableMetaDataProvider(DatabaseMetaData databaseMetaData)
Method Summary
 String getSimpleQueryForGetGeneratedKey(String tableName, String keyColumnName)
Get the simple query to retrieve a generated key
 boolean isGetGeneratedKeysSimulated()
Does this database support a simple quey to retrieve the generated key whe the JDBC 3.0 feature of retreiving generated keys is not supported DatabaseMetaData.supportsGetGeneratedKeys()
Methods inherited from class org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
catalogNameToUse, getDatabaseVersion, getTableParameterMetaData, initializeWithMetaData, initializeWithTableColumnMetaData, isGeneratedKeysColumnNameArraySupported, isGetGeneratedKeysSupported, isStoresLowerCaseIdentifiers, isStoresUpperCaseIdentifiers, isTableColumnMetaDataUsed, metaDataCatalogNameToUse, metaDataSchemaNameToUse, schemaNameToUse, setGeneratedKeysColumnNameArraySupported, setGetGeneratedKeysSupported, setStoresLowerCaseIdentifiers, setStoresUpperCaseIdentifiers, tableNameToUse
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PostgresTableMetaDataProvider

public PostgresTableMetaDataProvider(DatabaseMetaData databaseMetaData)
                              throws SQLException
Throws:
SQLException
Method Detail

isGetGeneratedKeysSimulated

public boolean isGetGeneratedKeysSimulated()
Description copied from interface: TableMetaDataProvider
Does this database support a simple quey to retrieve the generated key whe the JDBC 3.0 feature of retreiving generated keys is not supported DatabaseMetaData.supportsGetGeneratedKeys()

Specified by:
isGetGeneratedKeysSimulated in interface TableMetaDataProvider
Overrides:
isGetGeneratedKeysSimulated in class GenericTableMetaDataProvider

getSimpleQueryForGetGeneratedKey

public String getSimpleQueryForGetGeneratedKey(String tableName,
                                               String keyColumnName)
Description copied from interface: TableMetaDataProvider
Get the simple query to retrieve a generated key

Specified by:
getSimpleQueryForGetGeneratedKey in interface TableMetaDataProvider
Overrides:
getSimpleQueryForGetGeneratedKey in class GenericTableMetaDataProvider
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SqlServerCallMetaDataProvider

org.springframework.jdbc.core.metadata
Class SqlServerCallMetaDataProvider

java.lang.Object
    extended by  org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
        extended by  org.springframework.jdbc.core.metadata.SqlServerCallMetaDataProvider
All Implemented Interfaces:
CallMetaDataProvider
public class SqlServerCallMetaDataProvider
extends GenericCallMetaDataProvider

SQL Server specific implementation for the CallMetaDataProvider interface. This class is intended for internal use by the Simple JDBC classes.

Since:
2.5
Author:
Thomas Risberg

Field Summary
Fields inherited from class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
logger
Constructor Summary
SqlServerCallMetaDataProvider(DatabaseMetaData databaseMetaData)
Method Summary
boolean | byPassReturnParameter(String parameterName) Should we bypass the return parameter with the specified name.
String | parameterNameToUse(String parameterName) Provide any modification of the column name passed in to match the meta data currently used.
Methods inherited from class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
catalogNameToUse, createDefaultInOutParameter, createDefaultInParameter, createDefaultOutParameter, getCallParameterMetaData, getRefCursorSqlType, getUserName, initializeWithMetaData, initializeWithProcedureColumnMetaData, isProcedureColumnMetaDataUsed, isRefCursorSupported, isReturnResultSetSupported, isStoresLowerCaseIdentifiers, isStoresUpperCaseIdentifiers, isSupportsCatalogsInProcedureCalls, isSupportsSchemasInProcedureCalls, metaDataCatalogNameToUse, metaDataSchemaNameToUse, procedureNameToUse, schemaNameToUse, setStoresLowerCaseIdentifiers, setStoresUpperCaseIdentifiers, setSupportsCatalogsInProcedureCalls, setSupportsSchemasInProcedureCalls
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SqlServerCallMetaDataProvider

public SqlServerCallMetaDataProvider(DatabaseMetaData databaseMetaData)
                              throws SQLException
Throws:
SQLException
Method Detail

parameterNameToUse

public String parameterNameToUse(String parameterName)
Description copied from interface: CallMetaDataProvider
Provide any modification of the column name passed in to match the meta data currently used. This could include alterig the case.

Specified by:
parameterNameToUse in interface CallMetaDataProvider
Overrides:
parameterNameToUse in class GenericCallMetaDataProvider
Parameters:
parameterName - name of the parameter of column

byPassReturnParameter

public boolean byPassReturnParameter(String parameterName)
Description copied from interface: CallMetaDataProvider
Should we bypass the return parameter with the specified name. This allows the database specific implementation to skip the processing for specific results returned by the database call.

Specified by:
byPassReturnParameter in interface CallMetaDataProvider
Overrides:
byPassReturnParameter in class GenericCallMetaDataProvider
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SybaseCallMetaDataProvider

org.springframework.jdbc.core.metadata
Class SybaseCallMetaDataProvider

java.lang.Object
    extended by  org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
        extended by  org.springframework.jdbc.core.metadata.SybaseCallMetaDataProvider
All Implemented Interfaces:
CallMetaDataProvider
public class SybaseCallMetaDataProvider
extends GenericCallMetaDataProvider

Sybase specific implementation for the CallMetaDataProvider interface. This class is intended for internal use by the Simple JDBC classes.

Since:
2.5
Author:
Thomas Risberg

Field Summary
Fields inherited from class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
logger
Constructor Summary
SybaseCallMetaDataProvider(DatabaseMetaData databaseMetaData)
Method Summary
boolean | byPassReturnParameter(String parameterName) Should we bypass the return parameter with the specified name.
String | parameterNameToUse(String parameterName) Provide any modification of the column name passed in to match the meta data currently used.
Methods inherited from class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
catalogNameToUse, createDefaultInOutParameter, createDefaultInParameter, createDefaultOutParameter, getCallParameterMetaData, getRefCursorSqlType, getUserName, initializeWithMetaData, initializeWithProcedureColumnMetaData, isProcedureColumnMetaDataUsed, isRefCursorSupported, isReturnResultSetSupported, isStoresLowerCaseIdentifiers, isStoresUpperCaseIdentifiers, isSupportsCatalogsInProcedureCalls, isSupportsSchemasInProcedureCalls, metaDataCatalogNameToUse, metaDataSchemaNameToUse, procedureNameToUse, schemaNameToUse, setStoresLowerCaseIdentifiers, setStoresUpperCaseIdentifiers, setSupportsCatalogsInProcedureCalls, setSupportsSchemasInProcedureCalls
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SybaseCallMetaDataProvider

public SybaseCallMetaDataProvider(DatabaseMetaData databaseMetaData)
                           throws SQLException
Throws:
SQLException
Method Detail

parameterNameToUse

public String parameterNameToUse(String parameterName)
Description copied from interface: CallMetaDataProvider
Provide any modification of the column name passed in to match the meta data currently used. This could include alterig the case.

Specified by:
parameterNameToUse in interface CallMetaDataProvider
Overrides:
parameterNameToUse in class GenericCallMetaDataProvider
Parameters:
parameterName - name of the parameter of column

byPassReturnParameter

public boolean byPassReturnParameter(String parameterName)
Description copied from interface: CallMetaDataProvider
Should we bypass the return parameter with the specified name. This allows the database specific implementation to skip the processing for specific results returned by the database call.

Specified by:
byPassReturnParameter in interface CallMetaDataProvider
Overrides:
byPassReturnParameter in class GenericCallMetaDataProvider
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TableMetaDataContext

org.springframework.jdbc.core.metadata
Class TableMetaDataContext

java.lang.Object
    extended by  org.springframework.jdbc.core.metadata.TableMetaDataContext

public class TableMetaDataContext
extends Object

Class to manage context metadata used for the configuration and execution of operations on a database table.

Since:
2.5
Author:
Thomas Risberg

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
TableMetaDataContext()
Method Summary
 String createInsertString(String[] generatedKeyNames)
Build the insert string based on configuration and metadata information
 int[] createInsertTypes()
Build the array of Types based on configuration and metadata information
 String getCatalogName()
Get the name of the catalog for this context.
 String getSchemaName()
Get the name of the schema for this context.
 String getSimulationQueryForGetGeneratedKey(String tableName, String keyColumnName)
Does this database support simple query to retrieve generated keys when the JDBC 3.0 feature is not supported DatabaseMetaData.supportsGetGeneratedKeys()?
 List<String> getTableColumns()
Get a List of the table column names.
 String getTableName()
Get the name of the table for this context.
 boolean isAccessTableColumnMetaData()
Are we accessing table meta data?
 boolean isGeneratedKeysColumnNameArraySupported()
Is a column name String array for retreiving generated keys supported Connection.createStruct(String, Object[])?
 boolean isGetGeneratedKeysSimulated()
Does this database support simple query to retrieve generated keys when the JDBC 3.0 feature is not supported DatabaseMetaData.supportsGetGeneratedKeys()?
 boolean isGetGeneratedKeysSupported()
Does this database support the JDBC 3.0 feature of retreiving generated keys DatabaseMetaData.supportsGetGeneratedKeys()?
 boolean isOverrideIncludeSynonymsDefault()
Are we overrding include synonyms default?
 List<Object> matchInParameterValuesWithInsertColumns(Map<String,Object> inParameters)
Match the provided column names and values with the list of columns used.
 List<Object> matchInParameterValuesWithInsertColumns(SqlParameterSource parameterSource)
Match the provided column names and values with the list of columns used.
 void processMetaData(DataSource dataSource, List<String> declaredColumns, String[] generatedKeyNames)
Process the current meta data with the provided configuration options
 void setAccessTableColumnMetaData(boolean accessTableColumnMetaData)
Specify whether we should access table column meta data.
 void setCatalogName(String catalogName)
Set the name of the catalog for this context.
 void setOverrideIncludeSynonymsDefault(boolean override)
Specify whether we should override default for accessing synonyms.
 void setSchemaName(String schemaName)
Set the name of the schema for this context.
 void setTableName(String tableName)
Set the name of the table for this context.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

TableMetaDataContext

public TableMetaDataContext()
Method Detail

setTableName

public void setTableName(String tableName)
Set the name of the table for this context.

getTableName

public String getTableName()
Get the name of the table for this context.

setCatalogName

public void setCatalogName(String catalogName)
Set the name of the catalog for this context.

getCatalogName

public String getCatalogName()
Get the name of the catalog for this context.

setSchemaName

public void setSchemaName(String schemaName)
Set the name of the schema for this context.

getSchemaName

public String getSchemaName()
Get the name of the schema for this context.

setAccessTableColumnMetaData

public void setAccessTableColumnMetaData(boolean accessTableColumnMetaData)
Specify whether we should access table column meta data.

isAccessTableColumnMetaData

public boolean isAccessTableColumnMetaData()
Are we accessing table meta data?

setOverrideIncludeSynonymsDefault

public void setOverrideIncludeSynonymsDefault(boolean override)
Specify whether we should override default for accessing synonyms.

isOverrideIncludeSynonymsDefault

public boolean isOverrideIncludeSynonymsDefault()
Are we overrding include synonyms default?

getTableColumns

public List<String> getTableColumns()
Get a List of the table column names.

isGetGeneratedKeysSupported

public boolean isGetGeneratedKeysSupported()
Does this database support the JDBC 3.0 feature of retreiving generated keys DatabaseMetaData.supportsGetGeneratedKeys()?

isGetGeneratedKeysSimulated

public boolean isGetGeneratedKeysSimulated()
Does this database support simple query to retrieve generated keys when the JDBC 3.0 feature is not supported DatabaseMetaData.supportsGetGeneratedKeys()?

getSimulationQueryForGetGeneratedKey

public String getSimulationQueryForGetGeneratedKey(String tableName,
                                                   String keyColumnName)
Does this database support simple query to retrieve generated keys when the JDBC 3.0 feature is not supported DatabaseMetaData.supportsGetGeneratedKeys()?

isGeneratedKeysColumnNameArraySupported

public boolean isGeneratedKeysColumnNameArraySupported()
Is a column name String array for retreiving generated keys supported Connection.createStruct(String, Object[])?

processMetaData

public void processMetaData(DataSource dataSource,
                            List<String> declaredColumns,
                            String[] generatedKeyNames)
Process the current meta data with the provided configuration options

Parameters:
dataSource - the DataSource being used
declaredColumns - any coluns that are declared
generatedKeyNames - name of generated keys

matchInParameterValuesWithInsertColumns

public List<Object> matchInParameterValuesWithInsertColumns(SqlParameterSource parameterSource)
Match the provided column names and values with the list of columns used.

Parameters:
parameterSource - the parameter names and values

matchInParameterValuesWithInsertColumns

public List<Object> matchInParameterValuesWithInsertColumns(Map<String,Object> inParameters)
Match the provided column names and values with the list of columns used.

Parameters:
inParameters - the parameter names and values

createInsertString

public String createInsertString(String[] generatedKeyNames)
Build the insert string based on configuration and metadata information

Returns:
the insert string to be used

createInsertTypes

public int[] createInsertTypes()
Build the array of Types based on configuration and metadata information

Returns:
the array of types to be used
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TableMetaDataProviderFactory

org.springframework.jdbc.core.metadata
Class TableMetaDataProviderFactory

java.lang.Object
    extended by  org.springframework.jdbc.core.metadata.TableMetaDataProviderFactory

public class TableMetaDataProviderFactory
extends Object

Factory used to create a TableMetaDataProvider implementation based on the type of databse being used.

Since:
2.5
Author:
Thomas Risberg

Constructor Summary
TableMetaDataProviderFactory()
Method Summary
static TableMetaDataProvider createMetaDataProvider(DataSource dataSource, TableMetaDataContext context)
Create a TableMetaDataProvider based on the database metedata
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TableMetaDataProviderFactory

public TableMetaDataProviderFactory()
Method Detail

createMetaDataProvider

public static TableMetaDataProvider createMetaDataProvider(DataSource dataSource,
                                                           TableMetaDataContext context)
Create a TableMetaDataProvider based on the database metedata

Parameters:
dataSource - used to retrieve metedata
context - the class that holds configuration and metedata
Returns:
instance of the TableMetaDataProvider implementation to be used
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TableParameterMetaData

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.core.metadata
Class TableParameterMetaData

java.lang.Object
    extended by  org.springframework.jdbc.core.metadata.TableParameterMetaData

public class TableParameterMetaData
extends Object

Holder of metadata for a specific parameter that is used for table processing.

Since:
2.5
Author:
Thomas Risberg

Constructor Summary
TableParameterMetaData(String columnName, int sqlType, boolean nullable)
Constructor taking all the properties.
Method Summary
String | getParameterName() Get the parameter name.
int | getSqlType() Get the parameter SQL type.
boolean | isNullable() Get whether the parameter/column is nullable.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TableParameterMetaData

public TableParameterMetaData(String columnName,
                              int sqlType,
                              boolean nullable)
Constructor taking all the properties.

Method Detail

getParameterName

public String getParameterName()
Get the parameter name.

getSqlType

public int getSqlType()
Get the parameter SQL type.

isNullable

public boolean isNullable()
Get whether the parameter/column is nullable.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jdbc.core.namedparam

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jdbc.core.namedparam

JdbcTemplate variant with named parameter support.

See:
Description

Interface Summary
NamedParameterJdbcOperations | Interface specifying a basic set of JDBC operations allowing the use of named parameters rather than the traditional '?' placeholders.
SqlParameterSource | Interface that defines common functionality for objects that can offer parameter values for named SQL parameters, serving as argument for NamedParameterJdbcTemplate operations.

Class Summary
AbstractSqlParameterSource | Abstract base class for SqlParameterSource implementations.
BeanPropertySqlParameterSource | SqlParameterSource implementation that obtains parameter values from bean properties of a given JavaBean object.
MapSqlParameterSource | SqlParameterSource implementation that holds a given Map of parameters.
NamedParameterBatchUpdateUtils | Generic utility methods for working with JDBC batch statements using named parameters.
NamedParameterJdbcDaoSupport | Extension of JdbcDaoSupport that exposes a NamedParameterJdbcTemplate as well.
NamedParameterJdbcTemplate | Template class with a basic set of JDBC operations, allowing the use of named parameters rather than traditional '?' placeholders.
NamedParameterUtils | Helper methods for named parameter parsing.
ParsedSql | Holds information about a parsed SQL statement.
SqlParameterSourceUtils | Class that provides helper methods for the use of SqlParameterSource with SimpleJdbc classes.

Package org.springframework.jdbc.core.namedparam Description

JdbcTemplate variant with named parameter support.

NamedParameterJdbcTemplate is a wrapper around JdbcTemplate that adds support for named parameter parsing. It does not implement the JdbcOperations interface or extend JdbcTemplate, but implements the dedicated NamedParameterJdbcOperations interface.

If you need the full power of Spring JDBC for less common operations, use the getJdbcOperations() method of NamedParameterJdbcTemplate and work with the returned classic template, or use a JdbcTemplate instance directly.


org.springframework.jdbc.core.namedparam Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jdbc.core.namedparam

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jdbc.core.namedparam.AbstractSqlParameterSource (implements org.springframework.jdbc.core.namedparam.SqlParameterSource)
      • org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource
      • org.springframework.jdbc.core.namedparam.MapSqlParameterSource
    • org.springframework.jdbc.core.BatchUpdateUtils
      • org.springframework.jdbc.core.namedparam.NamedParameterBatchUpdateUtils
    • org.springframework.dao.support.DaoSupport (implements org.springframework.beans.factory.InitializingBean)
      • org.springframework.jdbc.core.support.JdbcDaoSupport
        • org.springframework.jdbc.core.namedparam.NamedParameterJdbcDaoSupport
    • org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate (implements org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations)
    • org.springframework.jdbc.core.namedparam.NamedParameterUtils
    • org.springframework.jdbc.core.namedparam.ParsedSql
    • org.springframework.jdbc.core.namedparam.SqlParameterSourceUtils

Interface Hierarchy

  • org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
  • org.springframework.jdbc.core.namedparam.SqlParameterSource


NamedParameterJdbcOperations

org.springframework.jdbc.core.namedparam
Interface NamedParameterJdbcOperations

All Known Implementing Classes:
NamedParameterJdbcTemplate
public interface NamedParameterJdbcOperations

Interface specifying a basic set of JDBC operations allowing the use of named parameters rather than the traditional '?' placeholders.

This is an alternative to the classic JdbcOperations interface, implemented by NamedParameterJdbcTemplate. This interface is not often used directly, but provides a useful option to enhance testability, as it can easily be mocked or stubbed.

Since:
2.0
Author:
Thomas Risberg, Juergen Hoeller
See Also:
NamedParameterJdbcTemplate, JdbcOperations

Method Summary
 int[] batchUpdate(String sql, Map<String,?>[] batchValues)
Executes a batch using the supplied SQL statement with the batch of supplied arguments.
 int[] batchUpdate(String sql, SqlParameterSource[] batchArgs)
Execute a batch using the supplied SQL statement with the batch of supplied arguments.
<T> T
execute(String sql, Map<String,?> paramMap, PreparedStatementCallback<T> action)
Execute a JDBC data access operation, implemented as callback action working on a JDBC PreparedStatement.
<T> T
execute(String sql, SqlParameterSource paramSource, PreparedStatementCallback<T> action)
Execute a JDBC data access operation, implemented as callback action working on a JDBC PreparedStatement.
 JdbcOperations getJdbcOperations()
Expose the classic Spring JdbcTemplate to allow invocation of classic JDBC operations.
<T> T
query(String sql, Map<String,?> paramMap, ResultSetExtractor<T> rse)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.
 void query(String sql, Map<String,?> paramMap, RowCallbackHandler rch)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.
<T> List<T>
query(String sql, Map<String,?> paramMap, RowMapper<T> rowMapper)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.
<T> T
query(String sql, SqlParameterSource paramSource, ResultSetExtractor<T> rse)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.
 void query(String sql, SqlParameterSource paramSource, RowCallbackHandler rch)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.
<T> List<T>
query(String sql, SqlParameterSource paramSource, RowMapper<T> rowMapper)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.
 int queryForInt(String sql, Map<String,?> paramMap)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in an int value.
 int queryForInt(String sql, SqlParameterSource paramSource)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in an int value.
 List<Map<String,Object>> queryForList(String sql, Map<String,?> paramMap)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
<T> List<T>
queryForList(String sql, Map<String,?> paramMap, Class<T> elementType)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
 List<Map<String,Object>> queryForList(String sql, SqlParameterSource paramSource)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
<T> List<T>
queryForList(String sql, SqlParameterSource paramSource, Class<T> elementType)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
 long queryForLong(String sql, Map<String,?> paramMap)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in a long value.
 long queryForLong(String sql, SqlParameterSource paramSource)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in a long value.
 Map<String,Object> queryForMap(String sql, Map<String,?> paramMap)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result Map.
 Map<String,Object> queryForMap(String sql, SqlParameterSource paramSource)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result Map.
<T> T
queryForObject(String sql, Map<String,?> paramMap, Class<T> requiredType)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.
<T> T
queryForObject(String sql, Map<String,?> paramMap, RowMapper<T> rowMapper)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.
<T> T
queryForObject(String sql, SqlParameterSource paramSource, Class<T> requiredType)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.
<T> T
queryForObject(String sql, SqlParameterSource paramSource, RowMapper<T> rowMapper)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.
 SqlRowSet queryForRowSet(String sql, Map<String,?> paramMap)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a SqlRowSet.
 SqlRowSet queryForRowSet(String sql, SqlParameterSource paramSource)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a SqlRowSet.
 int update(String sql, Map<String,?> paramMap)
Issue an update via a prepared statement, binding the given arguments.
 int update(String sql, SqlParameterSource paramSource)
Issue an update via a prepared statement, binding the given arguments.
 int update(String sql, SqlParameterSource paramSource, KeyHolder generatedKeyHolder)
Issue an update via a prepared statement, binding the given arguments, returning generated keys.
 int update(String sql, SqlParameterSource paramSource, KeyHolder generatedKeyHolder, String[] keyColumnNames)
Issue an update via a prepared statement, binding the given arguments, returning generated keys.

Method Detail

getJdbcOperations

JdbcOperations getJdbcOperations()
Expose the classic Spring JdbcTemplate to allow invocation of classic JDBC operations.

execute

<T> T execute(String sql,
              SqlParameterSource paramSource,
              PreparedStatementCallback<T> action)
          throws DataAccessException
Execute a JDBC data access operation, implemented as callback action working on a JDBC PreparedStatement. This allows for implementing arbitrary data access operations on a single Statement, within Spring's managed JDBC environment: that is, participating in Spring-managed transactions and converting JDBC SQLExceptions into Spring's DataAccessException hierarchy.

The callback action can return a result object, for example a domain object or a collection of domain objects.

Parameters:
sql - SQL to execute
paramSource - container of arguments to bind to the query
action - callback object that specifies the action
Returns:
a result object returned by the action, or null
Throws:
DataAccessException - if there is any problem

execute

<T> T execute(String sql,
              Map<String,?> paramMap,
              PreparedStatementCallback<T> action)
          throws DataAccessException
Execute a JDBC data access operation, implemented as callback action working on a JDBC PreparedStatement. This allows for implementing arbitrary data access operations on a single Statement, within Spring's managed JDBC environment: that is, participating in Spring-managed transactions and converting JDBC SQLExceptions into Spring's DataAccessException hierarchy.

The callback action can return a result object, for example a domain object or a collection of domain objects.

Parameters:
sql - SQL to execute
paramMap - map of parameters to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
action - callback object that specifies the action
Returns:
a result object returned by the action, or null
Throws:
DataAccessException - if there is any problem

query

<T> T query(String sql,
            SqlParameterSource paramSource,
            ResultSetExtractor<T> rse)
        throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.

Parameters:
sql - SQL query to execute
paramSource - container of arguments to bind to the query
rse - object that will extract results
Returns:
an arbitrary result object, as returned by the ResultSetExtractor
Throws:
DataAccessException - if the query fails

query

<T> T query(String sql,
            Map<String,?> paramMap,
            ResultSetExtractor<T> rse)
        throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.

Parameters:
sql - SQL query to execute
paramMap - map of parameters to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
rse - object that will extract results
Returns:
an arbitrary result object, as returned by the ResultSetExtractor
Throws:
DataAccessException - if the query fails

query

void query(String sql,
           SqlParameterSource paramSource,
           RowCallbackHandler rch)
           throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.

Parameters:
sql - SQL query to execute
paramSource - container of arguments to bind to the query
rch - object that will extract results, one row at a time
Throws:
DataAccessException - if the query fails

query

void query(String sql,
           Map<String,?> paramMap,
           RowCallbackHandler rch)
           throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.

Parameters:
sql - SQL query to execute
paramMap - map of parameters to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
rch - object that will extract results, one row at a time
Throws:
DataAccessException - if the query fails

query

<T> List<T> query(String sql,
                  SqlParameterSource paramSource,
                  RowMapper<T> rowMapper)
              throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.

Parameters:
sql - SQL query to execute
paramSource - container of arguments to bind to the query
rowMapper - object that will map one object per row
Returns:
the result List, containing mapped objects
Throws:
DataAccessException - if the query fails

query

<T> List<T> query(String sql,
                  Map<String,?> paramMap,
                  RowMapper<T> rowMapper)
              throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.

Parameters:
sql - SQL query to execute
paramMap - map of parameters to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
rowMapper - object that will map one object per row
Returns:
the result List, containing mapped objects
Throws:
DataAccessException - if the query fails

queryForObject

<T> T queryForObject(String sql,
                     SqlParameterSource paramSource,
                     RowMapper<T> rowMapper)
                 throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.

Parameters:
sql - SQL query to execute
paramSource - container of arguments to bind to the query
rowMapper - object that will map one object per row
Returns:
the single mapped object
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails

queryForObject

<T> T queryForObject(String sql,
                     Map<String,?> paramMap,
                     RowMapper<T> rowMapper)
                 throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.

Parameters:
sql - SQL query to execute
paramMap - map of parameters to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
rowMapper - object that will map one object per row
Returns:
the single mapped object
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails

queryForObject

<T> T queryForObject(String sql,
                     SqlParameterSource paramSource,
                     Class<T> requiredType)
                 throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.

The query is expected to be a single row/single column query; the returned result will be directly mapped to the corresponding object type.

Parameters:
sql - SQL query to execute
paramSource - container of arguments to bind to the query
requiredType - the type that the result object is expected to match
Returns:
the result object of the required type, or null in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails
See Also:
JdbcTemplate.queryForObject(String, Class)

queryForObject

<T> T queryForObject(String sql,
                     Map<String,?> paramMap,
                     Class<T> requiredType)
                 throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.

The query is expected to be a single row/single column query; the returned result will be directly mapped to the corresponding object type.

Parameters:
sql - SQL query to execute
paramMap - map of parameters to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
requiredType - the type that the result object is expected to match
Returns:
the result object of the required type, or null in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails
See Also:
JdbcTemplate.queryForObject(String, Class)

queryForMap

Map<String,Object> queryForMap(String sql,
                               SqlParameterSource paramSource)
                               throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result Map.

The query is expected to be a single row query; the result row will be mapped to a Map (one entry for each column, using the column name as the key).

Parameters:
sql - SQL query to execute
paramSource - container of arguments to bind to the query
Returns:
the result Map (one entry for each column, using the column name as the key)
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails
See Also:
JdbcTemplate.queryForMap(String), ColumnMapRowMapper

queryForMap

Map<String,Object> queryForMap(String sql,
                               Map<String,?> paramMap)
                               throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result Map. The queryForMap() methods defined by this interface are appropriate when you don't have a domain model. Otherwise, consider using one of the queryForObject() methods.

The query is expected to be a single row query; the result row will be mapped to a Map (one entry for each column, using the column name as the key).

Parameters:
sql - SQL query to execute
paramMap - map of parameters to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
Returns:
the result Map (one entry for each column, using the column name as the key)
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails
See Also:
JdbcTemplate.queryForMap(String), ColumnMapRowMapper

queryForLong

long queryForLong(String sql,
                  SqlParameterSource paramSource)
                  throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in a long value.

The query is expected to be a single row/single column query that results in a long value.

Parameters:
sql - SQL query to execute
paramSource - container of arguments to bind to the query
Returns:
the long value, or 0 in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails
See Also:
JdbcTemplate.queryForLong(String)

queryForLong

long queryForLong(String sql,
                  Map<String,?> paramMap)
                  throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in a long value.

The query is expected to be a single row/single column query that results in a long value.

Parameters:
sql - SQL query to execute
paramMap - map of parameters to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
Returns:
the long value, or 0 in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails
See Also:
JdbcTemplate.queryForLong(String)

queryForInt

int queryForInt(String sql,
                SqlParameterSource paramSource)
                throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in an int value.

The query is expected to be a single row/single column query that results in an int value.

Parameters:
sql - SQL query to execute
paramSource - container of arguments to bind to the query
Returns:
the int value, or 0 in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails
See Also:
JdbcTemplate.queryForInt(String)

queryForInt

int queryForInt(String sql,
                Map<String,?> paramMap)
                throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in an int value.

The query is expected to be a single row/single column query that results in an int value.

Parameters:
sql - SQL query to execute
paramMap - map of parameters to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
Returns:
the int value, or 0 in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails
See Also:
JdbcTemplate.queryForInt(String)

queryForList

<T> List<T> queryForList(String sql,
                         SqlParameterSource paramSource,
                         Class<T> elementType)
                     throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.

The results will be mapped to a List (one entry for each row) of result objects, each of them matching the specified element type.

Parameters:
sql - SQL query to execute
paramSource - container of arguments to bind to the query
elementType - the required type of element in the result list (for example, Integer.class)
Returns:
a List of objects that match the specified element type
Throws:
DataAccessException - if the query fails
See Also:
JdbcTemplate.queryForList(String, Class), SingleColumnRowMapper

queryForList

<T> List<T> queryForList(String sql,
                         Map<String,?> paramMap,
                         Class<T> elementType)
                     throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.

The results will be mapped to a List (one entry for each row) of result objects, each of them matching the specified element type.

Parameters:
sql - SQL query to execute
paramMap - map of parameters to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
elementType - the required type of element in the result list (for example, Integer.class)
Returns:
a List of objects that match the specified element type
Throws:
DataAccessException - if the query fails
See Also:
JdbcTemplate.queryForList(String, Class), SingleColumnRowMapper

queryForList

List<Map<String,Object>> queryForList(String sql,
                                      SqlParameterSource paramSource)
                                      throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.

The results will be mapped to a List (one entry for each row) of Maps (one entry for each column, using the column name as the key). Thus Each element in the list will be of the form returned by this interface's queryForMap() methods.

Parameters:
sql - SQL query to execute
paramSource - container of arguments to bind to the query
Returns:
a List that contains a Map per row
Throws:
DataAccessException - if the query fails
See Also:
JdbcTemplate.queryForList(String)

queryForList

List<Map<String,Object>> queryForList(String sql,
                                      Map<String,?> paramMap)
                                      throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.

The results will be mapped to a List (one entry for each row) of Maps (one entry for each column, using the column name as the key). Each element in the list will be of the form returned by this interface's queryForMap() methods.

Parameters:
sql - SQL query to execute
paramMap - map of parameters to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
Returns:
a List that contains a Map per row
Throws:
DataAccessException - if the query fails
See Also:
JdbcTemplate.queryForList(String)

queryForRowSet

SqlRowSet queryForRowSet(String sql,
                         SqlParameterSource paramSource)
                         throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a SqlRowSet.

The results will be mapped to an SqlRowSet which holds the data in a disconnected fashion. This wrapper will translate any SQLExceptions thrown.

Note that that, for the default implementation, JDBC RowSet support needs to be available at runtime: by default, Sun's com.sun.rowset.CachedRowSetImpl class is used, which is part of JDK 1.5+ and also available separately as part of Sun's JDBC RowSet Implementations download (rowset.jar).

Parameters:
sql - SQL query to execute
paramSource - container of arguments to bind to the query
Returns:
a SqlRowSet representation (possibly a wrapper around a javax.sql.rowset.CachedRowSet)
Throws:
DataAccessException - if there is any problem executing the query
See Also:
JdbcTemplate.queryForRowSet(String), SqlRowSetResultSetExtractor, CachedRowSet

queryForRowSet

SqlRowSet queryForRowSet(String sql,
                         Map<String,?> paramMap)
                         throws DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a SqlRowSet.

The results will be mapped to an SqlRowSet which holds the data in a disconnected fashion. This wrapper will translate any SQLExceptions thrown.

Note that that, for the default implementation, JDBC RowSet support needs to be available at runtime: by default, Sun's com.sun.rowset.CachedRowSetImpl class is used, which is part of JDK 1.5+ and also available separately as part of Sun's JDBC RowSet Implementations download (rowset.jar).

Parameters:
sql - SQL query to execute
paramMap - map of parameters to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
Returns:
a SqlRowSet representation (possibly a wrapper around a javax.sql.rowset.CachedRowSet)
Throws:
DataAccessException - if there is any problem executing the query
See Also:
JdbcTemplate.queryForRowSet(String), SqlRowSetResultSetExtractor, CachedRowSet

update

int update(String sql,
           SqlParameterSource paramSource)
           throws DataAccessException
Issue an update via a prepared statement, binding the given arguments.

Parameters:
sql - SQL containing named parameters
paramSource - container of arguments and SQL types to bind to the query
Returns:
the number of rows affected
Throws:
DataAccessException - if there is any problem issuing the update

update

int update(String sql,
           Map<String,?> paramMap)
           throws DataAccessException
Issue an update via a prepared statement, binding the given arguments.

Parameters:
sql - SQL containing named parameters
paramMap - map of parameters to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
Returns:
the number of rows affected
Throws:
DataAccessException - if there is any problem issuing the update

update

int update(String sql,
           SqlParameterSource paramSource,
           KeyHolder generatedKeyHolder)
           throws DataAccessException
Issue an update via a prepared statement, binding the given arguments, returning generated keys.

Parameters:
sql - SQL containing named parameters
paramSource - container of arguments and SQL types to bind to the query
generatedKeyHolder - KeyHolder that will hold the generated keys
Returns:
the number of rows affected
Throws:
DataAccessException - if there is any problem issuing the update
See Also:
MapSqlParameterSource, GeneratedKeyHolder

update

int update(String sql,
           SqlParameterSource paramSource,
           KeyHolder generatedKeyHolder,
           String[] keyColumnNames)
           throws DataAccessException
Issue an update via a prepared statement, binding the given arguments, returning generated keys.

Parameters:
sql - SQL containing named parameters
paramSource - container of arguments and SQL types to bind to the query
generatedKeyHolder - KeyHolder that will hold the generated keys
keyColumnNames - names of the columns that will have keys generated for them
Returns:
the number of rows affected
Throws:
DataAccessException - if there is any problem issuing the update
See Also:
MapSqlParameterSource, GeneratedKeyHolder

batchUpdate

int[] batchUpdate(String sql,
                  Map<String,?>[] batchValues)
Executes a batch using the supplied SQL statement with the batch of supplied arguments.

Parameters:
sql - the SQL statement to execute
batchValues - the array of Maps containing the batch of arguments for the query
Returns:
an array containing the numbers of rows affected by each update in the batch

batchUpdate

int[] batchUpdate(String sql,
                  SqlParameterSource[] batchArgs)
Execute a batch using the supplied SQL statement with the batch of supplied arguments.

Parameters:
sql - the SQL statement to execute
batchArgs - the array of SqlParameterSource containing the batch of arguments for the query
Returns:
an array containing the numbers of rows affected by each update in the batch
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SqlParameterSource

org.springframework.jdbc.core.namedparam
Interface SqlParameterSource

All Known Implementing Classes:
AbstractSqlParameterSource, BeanPropertySqlParameterSource, MapSqlParameterSource
public interface SqlParameterSource

Interface that defines common functionality for objects that can offer parameter values for named SQL parameters, serving as argument for NamedParameterJdbcTemplate operations.

This interface allows for the specification of SQL type in addition to parameter values. All parameter values and types are identified by specifying the name of the parameter.

Intended to wrap various implementations like a Map or a JavaBean with a consistent interface.

Since:
2.0
Author:
Thomas Risberg, Juergen Hoeller
See Also:
NamedParameterJdbcOperations, NamedParameterJdbcTemplate, MapSqlParameterSource, BeanPropertySqlParameterSource

Field Summary
static int TYPE_UNKNOWN
Constant that indicates an unknown (or unspecified) SQL type.
Method Summary
int | getSqlType(String paramName) Determine the SQL type for the specified named parameter.
String | getTypeName(String paramName) Determine the type name for the specified named parameter.
Object | getValue(String paramName) Return the parameter value for the requested named parameter.
boolean | hasValue(String paramName) Determine whether there is a value for the specified named parameter.

Field Detail

TYPE_UNKNOWN

static final int TYPE_UNKNOWN
Constant that indicates an unknown (or unspecified) SQL type. To be returned from getType when no specific SQL type known.

See Also:
getSqlType(java.lang.String), Types, Constant Field Values
Method Detail

hasValue

boolean hasValue(String paramName)
Determine whether there is a value for the specified named parameter.

Parameters:
paramName - the name of the parameter
Returns:
whether there is a value defined

getValue

Object getValue(String paramName)
                throws IllegalArgumentException
Return the parameter value for the requested named parameter.

Parameters:
paramName - the name of the parameter
Returns:
the value of the specified parameter
Throws:
IllegalArgumentException - if there is no value for the requested parameter

getSqlType

int getSqlType(String paramName)
Determine the SQL type for the specified named parameter.

Parameters:
paramName - the name of the parameter
Returns:
the SQL type of the specified parameter, or TYPE_UNKNOWN if not known
See Also:
TYPE_UNKNOWN

getTypeName

String getTypeName(String paramName)
Determine the type name for the specified named parameter.

Parameters:
paramName - the name of the parameter
Returns:
the type name of the specified parameter, or null if not known
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractSqlParameterSource

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.core.namedparam
Class AbstractSqlParameterSource

java.lang.Object
    extended by  org.springframework.jdbc.core.namedparam.AbstractSqlParameterSource
All Implemented Interfaces:
SqlParameterSource
Direct Known Subclasses:
BeanPropertySqlParameterSource, MapSqlParameterSource
public abstract class AbstractSqlParameterSource
extends Object
implements SqlParameterSource

Abstract base class for SqlParameterSource implementations. Provides registration of SQL types per parameter.

Since:
2.0
Author:
Juergen Hoeller

Field Summary
Fields inherited from interface org.springframework.jdbc.core.namedparam.SqlParameterSource
TYPE_UNKNOWN
Constructor Summary
AbstractSqlParameterSource()
Method Summary
int | getSqlType(String paramName) Return the SQL type for the given parameter, if registered.
String | getTypeName(String paramName) Return the type name for the given parameter, if registered.
void | registerSqlType(String paramName, int sqlType) Register a SQL type for the given parameter.
void | registerTypeName(String paramName, String typeName) Register a SQL type for the given parameter.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.jdbc.core.namedparam.SqlParameterSource
getValue, hasValue

Constructor Detail

AbstractSqlParameterSource

public AbstractSqlParameterSource()
Method Detail

registerSqlType

public void registerSqlType(String paramName,
                            int sqlType)
Register a SQL type for the given parameter.

Parameters:
paramName - the name of the parameter
sqlType - the SQL type of the parameter

registerTypeName

public void registerTypeName(String paramName,
                             String typeName)
Register a SQL type for the given parameter.

Parameters:
paramName - the name of the parameter
typeName - the type name of the parameter

getSqlType

public int getSqlType(String paramName)
Return the SQL type for the given parameter, if registered.

Specified by:
getSqlType in interface SqlParameterSource
Parameters:
paramName - the name of the parameter
Returns:
the SQL type of the parameter, or TYPE_UNKNOWN if not registered
See Also:
SqlParameterSource.TYPE_UNKNOWN

getTypeName

public String getTypeName(String paramName)
Return the type name for the given parameter, if registered.

Specified by:
getTypeName in interface SqlParameterSource
Parameters:
paramName - the name of the parameter
Returns:
the type name of the parameter, or null if not registered
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


BeanPropertySqlParameterSource

org.springframework.jdbc.core.namedparam
Class BeanPropertySqlParameterSource

java.lang.Object
    extended by  org.springframework.jdbc.core.namedparam.AbstractSqlParameterSource
        extended by  org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource
All Implemented Interfaces:
SqlParameterSource
public class BeanPropertySqlParameterSource
extends AbstractSqlParameterSource

SqlParameterSource implementation that obtains parameter values from bean properties of a given JavaBean object. The names of the bean properties have to match the parameter names.

Uses a Spring BeanWrapper for bean property access underneath.

Since:
2.0
Author:
Thomas Risberg, Juergen Hoeller
See Also:
NamedParameterJdbcTemplate, BeanWrapper

Field Summary
Fields inherited from interface org.springframework.jdbc.core.namedparam.SqlParameterSource
TYPE_UNKNOWN
Constructor Summary
BeanPropertySqlParameterSource(Object object)
Create a new BeanPropertySqlParameterSource for the given bean.
Method Summary
String[] | getReadablePropertyNames() Provide access to the property names of the wrapped bean.
int | getSqlType(String paramName) Derives a default SQL type from the corresponding property type.
Object | getValue(String paramName) Return the parameter value for the requested named parameter.
boolean | hasValue(String paramName) Determine whether there is a value for the specified named parameter.
Methods inherited from class org.springframework.jdbc.core.namedparam.AbstractSqlParameterSource
getTypeName, registerSqlType, registerTypeName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BeanPropertySqlParameterSource

public BeanPropertySqlParameterSource(Object object)
Create a new BeanPropertySqlParameterSource for the given bean.

Parameters:
object - the bean instance to wrap
Method Detail

hasValue

public boolean hasValue(String paramName)
Description copied from interface: SqlParameterSource
Determine whether there is a value for the specified named parameter.

Parameters:
paramName - the name of the parameter
Returns:
whether there is a value defined

getValue

public Object getValue(String paramName)
                throws IllegalArgumentException
Description copied from interface: SqlParameterSource
Return the parameter value for the requested named parameter.

Parameters:
paramName - the name of the parameter
Returns:
the value of the specified parameter
Throws:
IllegalArgumentException - if there is no value for the requested parameter

getReadablePropertyNames

public String[] getReadablePropertyNames()
Provide access to the property names of the wrapped bean. Uses support provided in the PropertyAccessor interface.

Returns:
an array containing all the known property names

getSqlType

public int getSqlType(String paramName)
Derives a default SQL type from the corresponding property type.

Specified by:
getSqlType in interface SqlParameterSource
Overrides:
getSqlType in class AbstractSqlParameterSource
Parameters:
paramName - the name of the parameter
Returns:
the SQL type of the parameter, or TYPE_UNKNOWN if not registered
See Also:
StatementCreatorUtils.javaTypeToSqlParameterType(java.lang.Class)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MapSqlParameterSource

org.springframework.jdbc.core.namedparam
Class MapSqlParameterSource

java.lang.Object
    extended by  org.springframework.jdbc.core.namedparam.AbstractSqlParameterSource
        extended by  org.springframework.jdbc.core.namedparam.MapSqlParameterSource
All Implemented Interfaces:
SqlParameterSource
public class MapSqlParameterSource
extends AbstractSqlParameterSource

SqlParameterSource implementation that holds a given Map of parameters.

This class is intended for passing in a simple Map of parameter values to the methods of the NamedParameterJdbcTemplate class.

The addValue methods on this class will make adding several values easier. The methods return a reference to the MapSqlParameterSource itself, so you can chain several method calls together within a single statement.

Since:
2.0
Author:
Thomas Risberg, Juergen Hoeller
See Also:
addValue(String, Object),
addValue(String, Object, int),
AbstractSqlParameterSource.registerSqlType(java.lang.String, int),
NamedParameterJdbcTemplate

Field Summary
Fields inherited from interface org.springframework.jdbc.core.namedparam.SqlParameterSource
TYPE_UNKNOWN
Constructor Summary
MapSqlParameterSource()
Create an empty MapSqlParameterSource, with values to be added via addValue.
MapSqlParameterSource(Map<String,?> values)
Create a new MapSqlParameterSource based on a Map.
MapSqlParameterSource(String paramName, Object value)
Create a new MapSqlParameterSource, with one value comprised of the supplied arguments.
Method Summary
MapSqlParameterSource | addValue(String paramName, Object value) Add a parameter to this parameter source.
MapSqlParameterSource | addValue(String paramName, Object value, int sqlType) Add a parameter to this parameter source.
MapSqlParameterSource | addValue(String paramName, Object value, int sqlType, String typeName) Add a parameter to this parameter source.
MapSqlParameterSource | addValues(Map<String,?> values) Add a Map of parameters to this parameter source.
Object | getValue(String paramName) Return the parameter value for the requested named parameter.
Map<String,Object> | getValues() Expose the current parameter values as read-only Map.
boolean | hasValue(String paramName) Determine whether there is a value for the specified named parameter.
Methods inherited from class org.springframework.jdbc.core.namedparam.AbstractSqlParameterSource
getSqlType, getTypeName, registerSqlType, registerTypeName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MapSqlParameterSource

public MapSqlParameterSource()
Create an empty MapSqlParameterSource, with values to be added via addValue.

See Also:
addValue(String, Object)

MapSqlParameterSource

public MapSqlParameterSource(String paramName,
                             Object value)
Create a new MapSqlParameterSource, with one value comprised of the supplied arguments.

Parameters:
paramName - the name of the parameter
value - the value of the parameter
See Also:
addValue(String, Object)

MapSqlParameterSource

public MapSqlParameterSource(Map<String,?> values)
Create a new MapSqlParameterSource based on a Map.

Parameters:
values - a Map holding existing parameter values (can be null)
Method Detail

addValue

public MapSqlParameterSource addValue(String paramName,
                                      Object value)
Add a parameter to this parameter source.

Parameters:
paramName - the name of the parameter
value - the value of the parameter
Returns:
a reference to this parameter source, so it's possible to chain several calls together

addValue

public MapSqlParameterSource addValue(String paramName,
                                      Object value,
                                      int sqlType)
Add a parameter to this parameter source.

Parameters:
paramName - the name of the parameter
value - the value of the parameter
sqlType - the SQL type of the parameter
Returns:
a reference to this parameter source, so it's possible to chain several calls together

addValue

public MapSqlParameterSource addValue(String paramName,
                                      Object value,
                                      int sqlType,
                                      String typeName)
Add a parameter to this parameter source.

Parameters:
paramName - the name of the parameter
value - the value of the parameter
sqlType - the SQL type of the parameter
typeName - the type name of the parameter
Returns:
a reference to this parameter source, so it's possible to chain several calls together

addValues

public MapSqlParameterSource addValues(Map<String,?> values)
Add a Map of parameters to this parameter source.

Parameters:
values - a Map holding existing parameter values (can be null)
Returns:
a reference to this parameter source, so it's possible to chain several calls together

getValues

public Map<String,Object> getValues()
Expose the current parameter values as read-only Map.

hasValue

public boolean hasValue(String paramName)
Description copied from interface: SqlParameterSource
Determine whether there is a value for the specified named parameter.

Parameters:
paramName - the name of the parameter
Returns:
whether there is a value defined

getValue

public Object getValue(String paramName)
Description copied from interface: SqlParameterSource
Return the parameter value for the requested named parameter.

Parameters:
paramName - the name of the parameter
Returns:
the value of the specified parameter
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NamedParameterBatchUpdateUtils

org.springframework.jdbc.core.namedparam
Class NamedParameterBatchUpdateUtils

java.lang.Object
    extended by  org.springframework.jdbc.core.BatchUpdateUtils
        extended by  org.springframework.jdbc.core.namedparam.NamedParameterBatchUpdateUtils

public class NamedParameterBatchUpdateUtils
extends BatchUpdateUtils

Generic utility methods for working with JDBC batch statements using named parameters. Mainly for internal use within the framework.

Author:
Thomas Risberg

Constructor Summary
NamedParameterBatchUpdateUtils()
Method Summary
static int[] executeBatchUpdateWithNamedParameters(ParsedSql parsedSql, SqlParameterSource[] batchArgs, JdbcOperations jdbcOperations)
Methods inherited from class org.springframework.jdbc.core.BatchUpdateUtils
executeBatchUpdate, setStatementParameters
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

NamedParameterBatchUpdateUtils

public NamedParameterBatchUpdateUtils()
Method Detail

executeBatchUpdateWithNamedParameters

public static int[] executeBatchUpdateWithNamedParameters(ParsedSql parsedSql,
                                                          SqlParameterSource[] batchArgs,
                                                          JdbcOperations jdbcOperations)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NamedParameterJdbcDaoSupport

org.springframework.jdbc.core.namedparam
Class NamedParameterJdbcDaoSupport

java.lang.Object
    extended by  org.springframework.dao.support.DaoSupport
        extended by  org.springframework.jdbc.core.support.JdbcDaoSupport
            extended by  org.springframework.jdbc.core.namedparam.NamedParameterJdbcDaoSupport
All Implemented Interfaces:
InitializingBean
public class NamedParameterJdbcDaoSupport
extends JdbcDaoSupport

Extension of JdbcDaoSupport that exposes a NamedParameterJdbcTemplate as well.

Since:
2.0
Author:
Thomas Risberg, Juergen Hoeller
See Also:
NamedParameterJdbcTemplate

Field Summary
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
Constructor Summary
NamedParameterJdbcDaoSupport()
Method Summary
NamedParameterJdbcTemplate | getNamedParameterJdbcTemplate() Return a NamedParameterJdbcTemplate wrapping the configured JdbcTemplate.
protected void | initTemplateConfig() Create a NamedParameterJdbcTemplate based on the configured JdbcTemplate.
Methods inherited from class org.springframework.jdbc.core.support.JdbcDaoSupport
checkDaoConfig, createJdbcTemplate, getConnection, getDataSource, getExceptionTranslator, getJdbcTemplate, releaseConnection, setDataSource, setJdbcTemplate
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

NamedParameterJdbcDaoSupport

public NamedParameterJdbcDaoSupport()
Method Detail

initTemplateConfig

protected void initTemplateConfig()
Create a NamedParameterJdbcTemplate based on the configured JdbcTemplate.

Overrides:
initTemplateConfig in class JdbcDaoSupport
See Also:
JdbcDaoSupport.getJdbcTemplate()

getNamedParameterJdbcTemplate

public NamedParameterJdbcTemplate getNamedParameterJdbcTemplate()
Return a NamedParameterJdbcTemplate wrapping the configured JdbcTemplate.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NamedParameterJdbcTemplate

org.springframework.jdbc.core.namedparam
Class NamedParameterJdbcTemplate

java.lang.Object
    extended by  org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
All Implemented Interfaces:
NamedParameterJdbcOperations
public class NamedParameterJdbcTemplate
extends Object
implements NamedParameterJdbcOperations

Template class with a basic set of JDBC operations, allowing the use of named parameters rather than traditional '?' placeholders.

This class delegates to a wrapped JdbcTemplate once the substitution from named parameters to JDBC style '?' placeholders is done at execution time. It also allows for expanding a List of values to the appropriate number of placeholders.

The underlying JdbcTemplate is exposed to allow for convenient access to the traditional JdbcTemplate methods.

Since:
2.0
Author:
Thomas Risberg, Juergen Hoeller
See Also:
NamedParameterJdbcOperations, JdbcTemplate

Constructor Summary
NamedParameterJdbcTemplate(DataSource dataSource)
Create a new NamedParameterJdbcTemplate for the given DataSource.
NamedParameterJdbcTemplate(JdbcOperations classicJdbcTemplate)
Create a new NamedParameterJdbcTemplate for the given classic Spring JdbcTemplate.
Method Summary
 int[] batchUpdate(String sql, Map<String,?>[] batchValues)
Executes a batch using the supplied SQL statement with the batch of supplied arguments.
 int[] batchUpdate(String sql, SqlParameterSource[] batchArgs)
Execute a batch using the supplied SQL statement with the batch of supplied arguments.
<T> T
execute(String sql, Map<String,?> paramMap, PreparedStatementCallback<T> action)
Execute a JDBC data access operation, implemented as callback action working on a JDBC PreparedStatement.
<T> T
execute(String sql, SqlParameterSource paramSource, PreparedStatementCallback<T> action)
Execute a JDBC data access operation, implemented as callback action working on a JDBC PreparedStatement.
 JdbcOperations getJdbcOperations()
Expose the classic Spring JdbcTemplate to allow invocation of less commonly used methods.
protected  ParsedSql getParsedSql(String sql)
Obtain a parsed representation of the given SQL statement.
protected  PreparedStatementCreator getPreparedStatementCreator(String sql, SqlParameterSource paramSource)
Build a PreparedStatementCreator based on the given SQL and named parameters.
<T> T
query(String sql, Map<String,?> paramMap, ResultSetExtractor<T> rse)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.
 void query(String sql, Map<String,?> paramMap, RowCallbackHandler rch)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.
<T> List<T>
query(String sql, Map<String,?> paramMap, RowMapper<T> rowMapper)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.
<T> T
query(String sql, SqlParameterSource paramSource, ResultSetExtractor<T> rse)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.
 void query(String sql, SqlParameterSource paramSource, RowCallbackHandler rch)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.
<T> List<T>
query(String sql, SqlParameterSource paramSource, RowMapper<T> rowMapper)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.
 int queryForInt(String sql, Map<String,?> paramMap)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in an int value.
 int queryForInt(String sql, SqlParameterSource paramSource)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in an int value.
 List<Map<String,Object>> queryForList(String sql, Map<String,?> paramMap)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
<T> List<T>
queryForList(String sql, Map<String,?> paramMap, Class<T> elementType)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
 List<Map<String,Object>> queryForList(String sql, SqlParameterSource paramSource)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
<T> List<T>
queryForList(String sql, SqlParameterSource paramSource, Class<T> elementType)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
 long queryForLong(String sql, Map<String,?> paramMap)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in a long value.
 long queryForLong(String sql, SqlParameterSource paramSource)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in a long value.
 Map<String,Object> queryForMap(String sql, Map<String,?> paramMap)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result Map.
 Map<String,Object> queryForMap(String sql, SqlParameterSource paramSource)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result Map.
<T> T
queryForObject(String sql, Map<String,?> paramMap, Class<T> requiredType)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.
<T> T
queryForObject(String sql, Map<String,?> paramMap, RowMapper<T> rowMapper)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.
<T> T
queryForObject(String sql, SqlParameterSource paramSource, Class<T> requiredType)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.
<T> T
queryForObject(String sql, SqlParameterSource paramSource, RowMapper<T> rowMapper)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.
 SqlRowSet queryForRowSet(String sql, Map<String,?> paramMap)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a SqlRowSet.
 SqlRowSet queryForRowSet(String sql, SqlParameterSource paramSource)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a SqlRowSet.
 int update(String sql, Map<String,?> paramMap)
Issue an update via a prepared statement, binding the given arguments.
 int update(String sql, SqlParameterSource paramSource)
Issue an update via a prepared statement, binding the given arguments.
 int update(String sql, SqlParameterSource paramSource, KeyHolder generatedKeyHolder)
Issue an update via a prepared statement, binding the given arguments, returning generated keys.
 int update(String sql, SqlParameterSource paramSource, KeyHolder generatedKeyHolder, String[] keyColumnNames)
Issue an update via a prepared statement, binding the given arguments, returning generated keys.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

NamedParameterJdbcTemplate

public NamedParameterJdbcTemplate(DataSource dataSource)
Create a new NamedParameterJdbcTemplate for the given DataSource.

Creates a classic Spring JdbcTemplate and wraps it.

Parameters:
dataSource - the JDBC DataSource to access

NamedParameterJdbcTemplate

public NamedParameterJdbcTemplate(JdbcOperations classicJdbcTemplate)
Create a new NamedParameterJdbcTemplate for the given classic Spring JdbcTemplate.

Parameters:
classicJdbcTemplate - the classic Spring JdbcTemplate to wrap
Method Detail

getJdbcOperations

public JdbcOperations getJdbcOperations()
Expose the classic Spring JdbcTemplate to allow invocation of less commonly used methods.

Specified by:
getJdbcOperations in interface NamedParameterJdbcOperations

execute

public <T> T execute(String sql,
                     SqlParameterSource paramSource,
                     PreparedStatementCallback<T> action)
          throws DataAccessException
Description copied from interface: NamedParameterJdbcOperations
Execute a JDBC data access operation, implemented as callback action working on a JDBC PreparedStatement. This allows for implementing arbitrary data access operations on a single Statement, within Spring's managed JDBC environment: that is, participating in Spring-managed transactions and converting JDBC SQLExceptions into Spring's DataAccessException hierarchy.

The callback action can return a result object, for example a domain object or a collection of domain objects.

Specified by:
execute in interface NamedParameterJdbcOperations
Parameters:
sql - SQL to execute
paramSource - container of arguments to bind to the query
action - callback object that specifies the action
Returns:
a result object returned by the action, or null
Throws:
DataAccessException - if there is any problem

execute

public <T> T execute(String sql,
                     Map<String,?> paramMap,
                     PreparedStatementCallback<T> action)
          throws DataAccessException
Description copied from interface: NamedParameterJdbcOperations
Execute a JDBC data access operation, implemented as callback action working on a JDBC PreparedStatement. This allows for implementing arbitrary data access operations on a single Statement, within Spring's managed JDBC environment: that is, participating in Spring-managed transactions and converting JDBC SQLExceptions into Spring's DataAccessException hierarchy.

The callback action can return a result object, for example a domain object or a collection of domain objects.

Specified by:
execute in interface NamedParameterJdbcOperations
Parameters:
sql - SQL to execute
paramMap - map of parameters to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
action - callback object that specifies the action
Returns:
a result object returned by the action, or null
Throws:
DataAccessException - if there is any problem

query

public <T> T query(String sql,
                   SqlParameterSource paramSource,
                   ResultSetExtractor<T> rse)
        throws DataAccessException
Description copied from interface: NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.

Specified by:
query in interface NamedParameterJdbcOperations
Parameters:
sql - SQL query to execute
paramSource - container of arguments to bind to the query
rse - object that will extract results
Returns:
an arbitrary result object, as returned by the ResultSetExtractor
Throws:
DataAccessException - if the query fails

query

public <T> T query(String sql,
                   Map<String,?> paramMap,
                   ResultSetExtractor<T> rse)
        throws DataAccessException
Description copied from interface: NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.

Specified by:
query in interface NamedParameterJdbcOperations
Parameters:
sql - SQL query to execute
paramMap - map of parameters to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
rse - object that will extract results
Returns:
an arbitrary result object, as returned by the ResultSetExtractor
Throws:
DataAccessException - if the query fails

query

public void query(String sql,
                  SqlParameterSource paramSource,
                  RowCallbackHandler rch)
           throws DataAccessException
Description copied from interface: NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.

Specified by:
query in interface NamedParameterJdbcOperations
Parameters:
sql - SQL query to execute
paramSource - container of arguments to bind to the query
rch - object that will extract results, one row at a time
Throws:
DataAccessException - if the query fails

query

public void query(String sql,
                  Map<String,?> paramMap,
                  RowCallbackHandler rch)
           throws DataAccessException
Description copied from interface: NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.

Specified by:
query in interface NamedParameterJdbcOperations
Parameters:
sql - SQL query to execute
paramMap - map of parameters to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
rch - object that will extract results, one row at a time
Throws:
DataAccessException - if the query fails

query

public <T> List<T> query(String sql,
                         SqlParameterSource paramSource,
                         RowMapper<T> rowMapper)
              throws DataAccessException
Description copied from interface: NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.

Specified by:
query in interface NamedParameterJdbcOperations
Parameters:
sql - SQL query to execute
paramSource - container of arguments to bind to the query
rowMapper - object that will map one object per row
Returns:
the result List, containing mapped objects
Throws:
DataAccessException - if the query fails

query

public <T> List<T> query(String sql,
                         Map<String,?> paramMap,
                         RowMapper<T> rowMapper)
              throws DataAccessException
Description copied from interface: NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.

Specified by:
query in interface NamedParameterJdbcOperations
Parameters:
sql - SQL query to execute
paramMap - map of parameters to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
rowMapper - object that will map one object per row
Returns:
the result List, containing mapped objects
Throws:
DataAccessException - if the query fails

queryForObject

public <T> T queryForObject(String sql,
                            SqlParameterSource paramSource,
                            RowMapper<T> rowMapper)
                 throws DataAccessException
Description copied from interface: NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.

Specified by:
queryForObject in interface NamedParameterJdbcOperations
Parameters:
sql - SQL query to execute
paramSource - container of arguments to bind to the query
rowMapper - object that will map one object per row
Returns:
the single mapped object
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails

queryForObject

public <T> T queryForObject(String sql,
                            Map<String,?> paramMap,
                            RowMapper<T> rowMapper)
                 throws DataAccessException
Description copied from interface: NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.

Specified by:
queryForObject in interface NamedParameterJdbcOperations
Parameters:
sql - SQL query to execute
paramMap - map of parameters to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
rowMapper - object that will map one object per row
Returns:
the single mapped object
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails

queryForObject

public <T> T queryForObject(String sql,
                            SqlParameterSource paramSource,
                            Class<T> requiredType)
                 throws DataAccessException
Description copied from interface: NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.

The query is expected to be a single row/single column query; the returned result will be directly mapped to the corresponding object type.

Specified by:
queryForObject in interface NamedParameterJdbcOperations
Parameters:
sql - SQL query to execute
paramSource - container of arguments to bind to the query
requiredType - the type that the result object is expected to match
Returns:
the result object of the required type, or null in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails
See Also:
JdbcTemplate.queryForObject(String, Class)

queryForObject

public <T> T queryForObject(String sql,
                            Map<String,?> paramMap,
                            Class<T> requiredType)
                 throws DataAccessException
Description copied from interface: NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.

The query is expected to be a single row/single column query; the returned result will be directly mapped to the corresponding object type.

Specified by:
queryForObject in interface NamedParameterJdbcOperations
Parameters:
sql - SQL query to execute
paramMap - map of parameters to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
requiredType - the type that the result object is expected to match
Returns:
the result object of the required type, or null in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails
See Also:
JdbcTemplate.queryForObject(String, Class)

queryForMap

public Map<String,Object> queryForMap(String sql,
                                      SqlParameterSource paramSource)
                               throws DataAccessException
Description copied from interface: NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result Map.

The query is expected to be a single row query; the result row will be mapped to a Map (one entry for each column, using the column name as the key).

Specified by:
queryForMap in interface NamedParameterJdbcOperations
Parameters:
sql - SQL query to execute
paramSource - container of arguments to bind to the query
Returns:
the result Map (one entry for each column, using the column name as the key)
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails
See Also:
JdbcTemplate.queryForMap(String), ColumnMapRowMapper

queryForMap

public Map<String,Object> queryForMap(String sql,
                                      Map<String,?> paramMap)
                               throws DataAccessException
Description copied from interface: NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result Map. The queryForMap() methods defined by this interface are appropriate when you don't have a domain model. Otherwise, consider using one of the queryForObject() methods.

The query is expected to be a single row query; the result row will be mapped to a Map (one entry for each column, using the column name as the key).

Specified by:
queryForMap in interface NamedParameterJdbcOperations
Parameters:
sql - SQL query to execute
paramMap - map of parameters to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
Returns:
the result Map (one entry for each column, using the column name as the key)
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails
See Also:
JdbcTemplate.queryForMap(String), ColumnMapRowMapper

queryForLong

public long queryForLong(String sql,
                         SqlParameterSource paramSource)
                  throws DataAccessException
Description copied from interface: NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in a long value.

The query is expected to be a single row/single column query that results in a long value.

Specified by:
queryForLong in interface NamedParameterJdbcOperations
Parameters:
sql - SQL query to execute
paramSource - container of arguments to bind to the query
Returns:
the long value, or 0 in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails
See Also:
JdbcTemplate.queryForLong(String)

queryForLong

public long queryForLong(String sql,
                         Map<String,?> paramMap)
                  throws DataAccessException
Description copied from interface: NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in a long value.

The query is expected to be a single row/single column query that results in a long value.

Specified by:
queryForLong in interface NamedParameterJdbcOperations
Parameters:
sql - SQL query to execute
paramMap - map of parameters to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
Returns:
the long value, or 0 in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails
See Also:
JdbcTemplate.queryForLong(String)

queryForInt

public int queryForInt(String sql,
                       SqlParameterSource paramSource)
                throws DataAccessException
Description copied from interface: NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in an int value.

The query is expected to be a single row/single column query that results in an int value.

Specified by:
queryForInt in interface NamedParameterJdbcOperations
Parameters:
sql - SQL query to execute
paramSource - container of arguments to bind to the query
Returns:
the int value, or 0 in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails
See Also:
JdbcTemplate.queryForInt(String)

queryForInt

public int queryForInt(String sql,
                       Map<String,?> paramMap)
                throws DataAccessException
Description copied from interface: NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in an int value.

The query is expected to be a single row/single column query that results in an int value.

Specified by:
queryForInt in interface NamedParameterJdbcOperations
Parameters:
sql - SQL query to execute
paramMap - map of parameters to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
Returns:
the int value, or 0 in case of SQL NULL
Throws:
IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactly one column in that row
DataAccessException - if the query fails
See Also:
JdbcTemplate.queryForInt(String)

queryForList

public <T> List<T> queryForList(String sql,
                                SqlParameterSource paramSource,
                                Class<T> elementType)
                     throws DataAccessException
Description copied from interface: NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.

The results will be mapped to a List (one entry for each row) of result objects, each of them matching the specified element type.

Specified by:
queryForList in interface NamedParameterJdbcOperations
Parameters:
sql - SQL query to execute
paramSource - container of arguments to bind to the query
elementType - the required type of element in the result list (for example, Integer.class)
Returns:
a List of objects that match the specified element type
Throws:
DataAccessException - if the query fails
See Also:
JdbcTemplate.queryForList(String, Class), SingleColumnRowMapper

queryForList

public <T> List<T> queryForList(String sql,
                                Map<String,?> paramMap,
                                Class<T> elementType)
                     throws DataAccessException
Description copied from interface: NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.

The results will be mapped to a List (one entry for each row) of result objects, each of them matching the specified element type.

Specified by:
queryForList in interface NamedParameterJdbcOperations
Parameters:
sql - SQL query to execute
paramMap - map of parameters to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
elementType - the required type of element in the result list (for example, Integer.class)
Returns:
a List of objects that match the specified element type
Throws:
DataAccessException - if the query fails
See Also:
JdbcTemplate.queryForList(String, Class), SingleColumnRowMapper

queryForList

public List<Map<String,Object>> queryForList(String sql,
                                             SqlParameterSource paramSource)
                                      throws DataAccessException
Description copied from interface: NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.

The results will be mapped to a List (one entry for each row) of Maps (one entry for each column, using the column name as the key). Thus Each element in the list will be of the form returned by this interface's queryForMap() methods.

Specified by:
queryForList in interface NamedParameterJdbcOperations
Parameters:
sql - SQL query to execute
paramSource - container of arguments to bind to the query
Returns:
a List that contains a Map per row
Throws:
DataAccessException - if the query fails
See Also:
JdbcTemplate.queryForList(String)

queryForList

public List<Map<String,Object>> queryForList(String sql,
                                             Map<String,?> paramMap)
                                      throws DataAccessException
Description copied from interface: NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.

The results will be mapped to a List (one entry for each row) of Maps (one entry for each column, using the column name as the key). Each element in the list will be of the form returned by this interface's queryForMap() methods.

Specified by:
queryForList in interface NamedParameterJdbcOperations
Parameters:
sql - SQL query to execute
paramMap - map of parameters to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
Returns:
a List that contains a Map per row
Throws:
DataAccessException - if the query fails
See Also:
JdbcTemplate.queryForList(String)

queryForRowSet

public SqlRowSet queryForRowSet(String sql,
                                SqlParameterSource paramSource)
                         throws DataAccessException
Description copied from interface: NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a SqlRowSet.

The results will be mapped to an SqlRowSet which holds the data in a disconnected fashion. This wrapper will translate any SQLExceptions thrown.

Note that that, for the default implementation, JDBC RowSet support needs to be available at runtime: by default, Sun's com.sun.rowset.CachedRowSetImpl class is used, which is part of JDK 1.5+ and also available separately as part of Sun's JDBC RowSet Implementations download (rowset.jar).

Specified by:
queryForRowSet in interface NamedParameterJdbcOperations
Parameters:
sql - SQL query to execute
paramSource - container of arguments to bind to the query
Returns:
a SqlRowSet representation (possibly a wrapper around a javax.sql.rowset.CachedRowSet)
Throws:
DataAccessException - if there is any problem executing the query
See Also:
JdbcTemplate.queryForRowSet(String), SqlRowSetResultSetExtractor, CachedRowSet

queryForRowSet

public SqlRowSet queryForRowSet(String sql,
                                Map<String,?> paramMap)
                         throws DataAccessException
Description copied from interface: NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a SqlRowSet.

The results will be mapped to an SqlRowSet which holds the data in a disconnected fashion. This wrapper will translate any SQLExceptions thrown.

Note that that, for the default implementation, JDBC RowSet support needs to be available at runtime: by default, Sun's com.sun.rowset.CachedRowSetImpl class is used, which is part of JDK 1.5+ and also available separately as part of Sun's JDBC RowSet Implementations download (rowset.jar).

Specified by:
queryForRowSet in interface NamedParameterJdbcOperations
Parameters:
sql - SQL query to execute
paramMap - map of parameters to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
Returns:
a SqlRowSet representation (possibly a wrapper around a javax.sql.rowset.CachedRowSet)
Throws:
DataAccessException - if there is any problem executing the query
See Also:
JdbcTemplate.queryForRowSet(String), SqlRowSetResultSetExtractor, CachedRowSet

update

public int update(String sql,
                  SqlParameterSource paramSource)
           throws DataAccessException
Description copied from interface: NamedParameterJdbcOperations
Issue an update via a prepared statement, binding the given arguments.

Specified by:
update in interface NamedParameterJdbcOperations
Parameters:
sql - SQL containing named parameters
paramSource - container of arguments and SQL types to bind to the query
Returns:
the number of rows affected
Throws:
DataAccessException - if there is any problem issuing the update

update

public int update(String sql,
                  Map<String,?> paramMap)
           throws DataAccessException
Description copied from interface: NamedParameterJdbcOperations
Issue an update via a prepared statement, binding the given arguments.

Specified by:
update in interface NamedParameterJdbcOperations
Parameters:
sql - SQL containing named parameters
paramMap - map of parameters to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
Returns:
the number of rows affected
Throws:
DataAccessException - if there is any problem issuing the update

update

public int update(String sql,
                  SqlParameterSource paramSource,
                  KeyHolder generatedKeyHolder)
           throws DataAccessException
Description copied from interface: NamedParameterJdbcOperations
Issue an update via a prepared statement, binding the given arguments, returning generated keys.

Specified by:
update in interface NamedParameterJdbcOperations
Parameters:
sql - SQL containing named parameters
paramSource - container of arguments and SQL types to bind to the query
generatedKeyHolder - KeyHolder that will hold the generated keys
Returns:
the number of rows affected
Throws:
DataAccessException - if there is any problem issuing the update
See Also:
MapSqlParameterSource, GeneratedKeyHolder

update

public int update(String sql,
                  SqlParameterSource paramSource,
                  KeyHolder generatedKeyHolder,
                  String[] keyColumnNames)
           throws DataAccessException
Description copied from interface: NamedParameterJdbcOperations
Issue an update via a prepared statement, binding the given arguments, returning generated keys.

Specified by:
update in interface NamedParameterJdbcOperations
Parameters:
sql - SQL containing named parameters
paramSource - container of arguments and SQL types to bind to the query
generatedKeyHolder - KeyHolder that will hold the generated keys
keyColumnNames - names of the columns that will have keys generated for them
Returns:
the number of rows affected
Throws:
DataAccessException - if there is any problem issuing the update
See Also:
MapSqlParameterSource, GeneratedKeyHolder

batchUpdate

public int[] batchUpdate(String sql,
                         Map<String,?>[] batchValues)
Description copied from interface: NamedParameterJdbcOperations
Executes a batch using the supplied SQL statement with the batch of supplied arguments.

Specified by:
batchUpdate in interface NamedParameterJdbcOperations
Parameters:
sql - the SQL statement to execute
batchValues - the array of Maps containing the batch of arguments for the query
Returns:
an array containing the numbers of rows affected by each update in the batch

batchUpdate

public int[] batchUpdate(String sql,
                         SqlParameterSource[] batchArgs)
Description copied from interface: NamedParameterJdbcOperations
Execute a batch using the supplied SQL statement with the batch of supplied arguments.

Specified by:
batchUpdate in interface NamedParameterJdbcOperations
Parameters:
sql - the SQL statement to execute
batchArgs - the array of SqlParameterSource containing the batch of arguments for the query
Returns:
an array containing the numbers of rows affected by each update in the batch

getPreparedStatementCreator

protected PreparedStatementCreator getPreparedStatementCreator(String sql,
                                                               SqlParameterSource paramSource)
Build a PreparedStatementCreator based on the given SQL and named parameters.

Note: Not used for the update variant with generated key handling.

Parameters:
sql - SQL to execute
paramSource - container of arguments to bind
Returns:
the corresponding PreparedStatementCreator

getParsedSql

protected ParsedSql getParsedSql(String sql)
Obtain a parsed representation of the given SQL statement.

Parameters:
sql - the original SQL
Returns:
a representation of the parsed SQL statement
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NamedParameterUtils

org.springframework.jdbc.core.namedparam
Class NamedParameterUtils

java.lang.Object
    extended by  org.springframework.jdbc.core.namedparam.NamedParameterUtils

public abstract class NamedParameterUtils
extends Object

Helper methods for named parameter parsing. Only intended for internal use within Spring's JDBC framework.

Since:
2.0
Author:
Thomas Risberg, Juergen Hoeller

Constructor Summary
NamedParameterUtils()
Method Summary
static int[] | buildSqlTypeArray(ParsedSql parsedSql, SqlParameterSource paramSource) Convert a Map of parameter types to a corresponding int array.
static Object[] | buildValueArray(ParsedSql parsedSql, SqlParameterSource paramSource, List<SqlParameter> declaredParams) Convert a Map of named parameter values to a corresponding array.
static Object[] | buildValueArray(String sql, Map<String,?> paramMap) Convert a Map of named parameter values to a corresponding array.
static ParsedSql | parseSqlStatement(String sql) Parse the SQL statement and locate any placeholders or named parameters.
static String | parseSqlStatementIntoString(String sql) Parse the SQL statement and locate any placeholders or named parameters.
static String | substituteNamedParameters(ParsedSql parsedSql, SqlParameterSource paramSource) Parse the SQL statement and locate any placeholders or named parameters.
static String | substituteNamedParameters(String sql, SqlParameterSource paramSource) Parse the SQL statement and locate any placeholders or named parameters.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

NamedParameterUtils

public NamedParameterUtils()
Method Detail

parseSqlStatement

public static ParsedSql parseSqlStatement(String sql)
Parse the SQL statement and locate any placeholders or named parameters. Named parameters are substituted for a JDBC placeholder.

Parameters:
sql - the SQL statement
Returns:
the parsed statement, represented as ParsedSql instance

substituteNamedParameters

public static String substituteNamedParameters(ParsedSql parsedSql,
                                               SqlParameterSource paramSource)
Parse the SQL statement and locate any placeholders or named parameters. Named parameters are substituted for a JDBC placeholder and any select list is expanded to the required number of placeholders. Select lists may contain an array of objects and in that case the placeholders will be grouped and enclosed with parantheses. This allows for the use of "expression lists" in the SQL statement like:
select id, name, state from table where (name, age) in (('John', 35), ('Ann', 50))

The parameter values passed in are used to determine the number of placeholder to be used for a select list. Select lists should be limited to 100 or fewer elements. A larger number of elements is not guaramteed to be supported by the database and is strictly vendor-dependent.

Parameters:
parsedSql - the parsed represenation of the SQL statement
paramSource - the source for named parameters
Returns:
the SQL statement with substituted parameters
See Also:
parseSqlStatement(java.lang.String)

buildValueArray

public static Object[] buildValueArray(ParsedSql parsedSql,
                                       SqlParameterSource paramSource,
                                       List<SqlParameter> declaredParams)
Convert a Map of named parameter values to a corresponding array.

Parameters:
parsedSql - the parsed SQL statement
paramSource - the source for named parameters
declaredParams - the List of declared SqlParameter objects (may be null). If specified, the parameter metadata will be built into the value array in the form of SqlParameterValue objects.
Returns:
the array of values

buildSqlTypeArray

public static int[] buildSqlTypeArray(ParsedSql parsedSql,
                                      SqlParameterSource paramSource)
Convert a Map of parameter types to a corresponding int array. This is necessary in order to reuse existing methods on JdbcTemplate. Any named parameter types are placed in the correct position in the Object array based on the parsed SQL statement info.

Parameters:
parsedSql - the parsed SQL statement
paramSource - the source for named parameters

parseSqlStatementIntoString

public static String parseSqlStatementIntoString(String sql)
Parse the SQL statement and locate any placeholders or named parameters. Named parameters are substituted for a JDBC placeholder.

This is a shortcut version of parseSqlStatement(String) in combination with substituteNamedParameters(ParsedSql, SqlParameterSource).

Parameters:
sql - the SQL statement
Returns:
the actual (parsed) SQL statement

substituteNamedParameters

public static String substituteNamedParameters(String sql,
                                               SqlParameterSource paramSource)
Parse the SQL statement and locate any placeholders or named parameters. Named parameters are substituted for a JDBC placeholder and any select list is expanded to the required number of placeholders.

This is a shortcut version of substituteNamedParameters(ParsedSql, SqlParameterSource).

Parameters:
sql - the SQL statement
paramSource - the source for named parameters
Returns:
the SQL statement with substituted parameters

buildValueArray

public static Object[] buildValueArray(String sql,
                                       Map<String,?> paramMap)
Convert a Map of named parameter values to a corresponding array.

This is a shortcut version of buildValueArray(ParsedSql, SqlParameterSource, java.util.List).

Parameters:
sql - the SQL statement
paramMap - the Map of parameters
Returns:
the array of values
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ParsedSql

org.springframework.jdbc.core.namedparam
Class ParsedSql

java.lang.Object
    extended by  org.springframework.jdbc.core.namedparam.ParsedSql

public class ParsedSql
extends Object

Holds information about a parsed SQL statement.

Since:
2.0
Author:
Thomas Risberg, Juergen Hoeller

Method Summary
 String toString()
Exposes the original SQL String.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Method Detail

toString

public String toString()
Exposes the original SQL String.

Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SqlParameterSourceUtils

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.core.namedparam
Class SqlParameterSourceUtils

java.lang.Object
    extended by  org.springframework.jdbc.core.namedparam.SqlParameterSourceUtils

public class SqlParameterSourceUtils
extends Object

Class that provides helper methods for the use of SqlParameterSource with SimpleJdbc classes.

Since:
2.5
Author:
Thomas Risberg
See Also:
SimpleJdbcTemplate

Constructor Summary
SqlParameterSourceUtils()
Method Summary
static SqlParameterSource[] | createBatch(Map[] valueMaps) Create an array of MapSqlParameterSource objects populated with data from the values passed in.
static SqlParameterSource[] | createBatch(Object[] beans) Create an array of BeanPropertySqlParameterSource objects populated with data from the values passed in.
static Map | extractCaseInsensitiveParameterNames(SqlParameterSource parameterSource) Create a Map of case insensitive parameter names together with the original name.
static Object | getTypedValue(SqlParameterSource source, String parameterName) Create a wrapped value if parameter has type information, plain object if not.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SqlParameterSourceUtils

public SqlParameterSourceUtils()
Method Detail

createBatch

public static SqlParameterSource[] createBatch(Map[] valueMaps)
Create an array of MapSqlParameterSource objects populated with data from the values passed in. This will define what is included in a batch operation.

Parameters:
valueMaps - array of Maps containing the values to be used
Returns:
an array of SqlParameterSource

createBatch

public static SqlParameterSource[] createBatch(Object[] beans)
Create an array of BeanPropertySqlParameterSource objects populated with data from the values passed in. This will define what is included in a batch operation.

Parameters:
beans - object array of beans containing the values to be used
Returns:
an array of SqlParameterSource

getTypedValue

public static Object getTypedValue(SqlParameterSource source,
                                   String parameterName)
Create a wrapped value if parameter has type information, plain object if not.

Parameters:
source - the source of paramer values and type information
parameterName - the name of the parameter
Returns:
the value object

extractCaseInsensitiveParameterNames

public static Map extractCaseInsensitiveParameterNames(SqlParameterSource parameterSource)
Create a Map of case insensitive parameter names together with the original name.

Parameters:
parameterSource - the source of paramer names
Returns:
the Map that can be used for case insensitive matching of parameter names
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jdbc.core.simple

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jdbc.core.simple

Simplification layer over JdbcTemplate for Java 5 and above.

See:
Description

Interface Summary
ParameterizedRowMapper<T> | Extension of the RowMapper interface, adding type parameterization.
SimpleJdbcCallOperations | Interface specifying the API for a Simple JDBC Call implemented by SimpleJdbcCall.
SimpleJdbcInsertOperations | Interface specifying the API for a Simple JDBC Insert implemented by SimpleJdbcInsert.
SimpleJdbcOperations | JDBC operations interface usable on Java 5 and above, exposing a set of common JDBC operations, whose interface is simplified through the use of varargs and autoboxing.

Class Summary
AbstractJdbcCall | Abstract class to provide base functionality for easy stored procedure calls based on configuration options and database metadata.
AbstractJdbcInsert | Abstract class to provide base functionality for easy inserts based on configuration options and database metadata.
ParameterizedBeanPropertyRowMapper<T> | ParameterizedRowMapper implementation that converts a row into a new instance of the specified mapped target class.
ParameterizedSingleColumnRowMapper<T> | ParameterizedRowMapper implementation that converts a single column into a single result value per row.
SimpleJdbcCall | A SimpleJdbcCall is a multi-threaded, reusable object representing a call to a stored procedure or a stored function.
SimpleJdbcDaoSupport | Extension of JdbcDaoSupport that exposes a SimpleJdbcTemplate as well.
SimpleJdbcInsert | A SimpleJdbcInsert is a multi-threaded, reusable object providing easy insert capabilities for a table.
SimpleJdbcTemplate | Java-5-based convenience wrapper for the classic Spring JdbcTemplate, taking advantage of varargs and autoboxing, and exposing only the most commonly required operations in order to simplify JdbcTemplate usage.

Package org.springframework.jdbc.core.simple Description

Simplification layer over JdbcTemplate for Java 5 and above.

SimpleJdbcTemplate is a wrapper around JdbcTemplate that takes advantage of varargs and autoboxing. It also offers only a subset of the methods available on JdbcTemplate: Hence, it does not implement the JdbcOperations interface or extend JdbcTemplate, but implements the dedicated SimpleJdbcOperations interface.

If you need the full power of Spring JDBC for less common operations, use the getJdbcOperations() method of SimpleJdbcTemplate and work with the returned classic template, or use a JdbcTemplate instance directly.


org.springframework.jdbc.core.simple Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jdbc.core.simple

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jdbc.core.simple.AbstractJdbcCall
      • org.springframework.jdbc.core.simple.SimpleJdbcCall (implements org.springframework.jdbc.core.simple.SimpleJdbcCallOperations)
    • org.springframework.jdbc.core.simple.AbstractJdbcInsert
      • org.springframework.jdbc.core.simple.SimpleJdbcInsert (implements org.springframework.jdbc.core.simple.SimpleJdbcInsertOperations)
    • org.springframework.jdbc.core.BeanPropertyRowMapper<T> (implements org.springframework.jdbc.core.RowMapper<T>)
      • org.springframework.jdbc.core.simple.ParameterizedBeanPropertyRowMapper<T> (implements org.springframework.jdbc.core.simple.ParameterizedRowMapper<T>)
    • org.springframework.dao.support.DaoSupport (implements org.springframework.beans.factory.InitializingBean)
      • org.springframework.jdbc.core.support.JdbcDaoSupport
        • org.springframework.jdbc.core.simple.SimpleJdbcDaoSupport
    • org.springframework.jdbc.core.simple.SimpleJdbcTemplate (implements org.springframework.jdbc.core.simple.SimpleJdbcOperations)
    • org.springframework.jdbc.core.SingleColumnRowMapper<T> (implements org.springframework.jdbc.core.RowMapper<T>)
      • org.springframework.jdbc.core.simple.ParameterizedSingleColumnRowMapper<T> (implements org.springframework.jdbc.core.simple.ParameterizedRowMapper<T>)

Interface Hierarchy

  • org.springframework.jdbc.core.RowMapper<T>
    • org.springframework.jdbc.core.simple.ParameterizedRowMapper<T>
  • org.springframework.jdbc.core.simple.SimpleJdbcCallOperations
  • org.springframework.jdbc.core.simple.SimpleJdbcInsertOperations
  • org.springframework.jdbc.core.simple.SimpleJdbcOperations


ParameterizedRowMapper

org.springframework.jdbc.core.simple
Interface ParameterizedRowMapper<T>

All Superinterfaces:
RowMapper<T>
All Known Implementing Classes:
ParameterizedBeanPropertyRowMapper, ParameterizedSingleColumnRowMapper
public interface ParameterizedRowMapper<T>
extends RowMapper<T>

Extension of the RowMapper interface, adding type parameterization. As of Spring 3.0, this is equivalent to using the RowMapper interface directly.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
See Also:
SimpleJdbcOperations

Method Summary
Methods inherited from interface org.springframework.jdbc.core.RowMapper
mapRow

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleJdbcCallOperations

org.springframework.jdbc.core.simple
Interface SimpleJdbcCallOperations

All Known Implementing Classes:
SimpleJdbcCall
public interface SimpleJdbcCallOperations

Interface specifying the API for a Simple JDBC Call implemented by SimpleJdbcCall. This interface is not often used directly, but provides the option to enhance testability, as it can easily be mocked or stubbed.

Since:
2.5
Author:
Thomas Risberg

Method Summary
 SimpleJdbcCallOperations declareParameters(SqlParameter... sqlParameters)
Specify one or more parameters if desired.
 Map<String,Object> execute(Map<String,?> args)
Execute the stored procedure and return a map of output params, keyed by name as in parameter declarations..
 Map<String,Object> execute(Object... args)
Execute the stored procedure and return a map of output params, keyed by name as in parameter declarations.
 Map<String,Object> execute(SqlParameterSource args)
Execute the stored procedure and return a map of output params, keyed by name as in parameter declarations..
<T> T
executeFunction(Class<T> returnType, Map<String,?> args)
Execute the stored function and return the results obtained as an Object of the specified return type.
<T> T
executeFunction(Class<T> returnType, Object... args)
Execute the stored function and return the results obtained as an Object of the specified return type.
<T> T
executeFunction(Class<T> returnType, SqlParameterSource args)
Execute the stored function and return the results obtained as an Object of the specified return type.
<T> T
executeObject(Class<T> returnType, Map<String,?> args)
Execute the stored procedure and return the single out parameter as an Object of the specified return type.
<T> T
executeObject(Class<T> returnType, Object... args)
Execute the stored procedure and return the single out parameter as an Object of the specified return type.
<T> T
executeObject(Class<T> returnType, SqlParameterSource args)
Execute the stored procedure and return the single out parameter as an Object of the specified return type.
 SimpleJdbcCallOperations returningResultSet(String parameterName, ParameterizedRowMapper rowMapper)
Deprecated. in favor of returningResultSet(String, org.springframework.jdbc.core.RowMapper)
 SimpleJdbcCallOperations returningResultSet(String parameterName, RowMapper rowMapper)
Used to specify when a ResultSet is returned by the stored procedure and you want it mapped by a RowMapper.
 SimpleJdbcCallOperations useInParameterNames(String... inParameterNames)
Not used yet
 SimpleJdbcCallOperations withCatalogName(String catalogName)
Optionally, specify the name of the catalog that contins the stored procedure.
 SimpleJdbcCallOperations withFunctionName(String functionName)
Specify the procedure name to be used - this implies that we will be calling a stored function.
 SimpleJdbcCallOperations withoutProcedureColumnMetaDataAccess()
Turn off any processing of parameter meta data information obtained via JDBC.
 SimpleJdbcCallOperations withProcedureName(String procedureName)
Specify the procedure name to be used - this implies that we will be calling a stored procedure.
 SimpleJdbcCallOperations withReturnValue()
Indicates the procedure's return value should be included in the results returned.
 SimpleJdbcCallOperations withSchemaName(String schemaName)
Optionally, specify the name of the schema that contins the stored procedure.

Method Detail

withProcedureName

SimpleJdbcCallOperations withProcedureName(String procedureName)
Specify the procedure name to be used - this implies that we will be calling a stored procedure.

Parameters:
procedureName - the name of the stored procedure
Returns:
the instance of this SimpleJdbcCall

withFunctionName

SimpleJdbcCallOperations withFunctionName(String functionName)
Specify the procedure name to be used - this implies that we will be calling a stored function.

Parameters:
functionName - the name of the stored function
Returns:
the instance of this SimpleJdbcCall

withSchemaName

SimpleJdbcCallOperations withSchemaName(String schemaName)
Optionally, specify the name of the schema that contins the stored procedure.

Parameters:
schemaName - the name of the schema
Returns:
the instance of this SimpleJdbcCall

withCatalogName

SimpleJdbcCallOperations withCatalogName(String catalogName)
Optionally, specify the name of the catalog that contins the stored procedure. To provide consistency with the Oracle DatabaseMetaData, this is used to specify the package name if the procedure is declared as part of a package.

Parameters:
catalogName - the catalog or package name
Returns:
the instance of this SimpleJdbcCall

withReturnValue

SimpleJdbcCallOperations withReturnValue()
Indicates the procedure's return value should be included in the results returned.

Returns:
the instance of this SimpleJdbcCall

declareParameters

SimpleJdbcCallOperations declareParameters(SqlParameter... sqlParameters)
Specify one or more parameters if desired. These parameters will be supplemented with any parameter information retrieved from the database meta data. Note that only parameters declared as SqlParameter and SqlInOutParameter will be used to provide input values. This is different from the StoredProcedure class which for backwards compatibility reasons allows input values to be provided for parameters declared as SqlOutParameter.

Parameters:
sqlParameters - the parameters to use
Returns:
the instance of this SimpleJdbcCall

useInParameterNames

SimpleJdbcCallOperations useInParameterNames(String... inParameterNames)
Not used yet

returningResultSet

SimpleJdbcCallOperations returningResultSet(String parameterName,
                                            RowMapper rowMapper)
Used to specify when a ResultSet is returned by the stored procedure and you want it mapped by a RowMapper. The results will be returned using the parameter name specified. Multiple ResultSets must be declared in the correct order. If the database you are using uses ref cursors then the name specified must match the name of the parameter declared for the procedure in the database.

Parameters:
parameterName - the name of the returned results and/or the name of the ref cursor parameter
rowMapper - the RowMapper implementation that will map the data returned for each row

returningResultSet

@Deprecated
SimpleJdbcCallOperations returningResultSet(String parameterName,
                                                       ParameterizedRowMapper rowMapper)
Deprecated. in favor of returningResultSet(String, org.springframework.jdbc.core.RowMapper)

Used to specify when a ResultSet is returned by the stored procedure and you want it mapped by a RowMapper. The results will be returned using the parameter name specified. Multiple ResultSets must be declared in the correct order. If the database you are using uses ref cursors then the name specified must match the name of the parameter declared for the procedure in the database.

withoutProcedureColumnMetaDataAccess

SimpleJdbcCallOperations withoutProcedureColumnMetaDataAccess()
Turn off any processing of parameter meta data information obtained via JDBC.

Returns:
the instance of this SimpleJdbcCall

executeFunction

<T> T executeFunction(Class<T> returnType,
                      Object... args)
Execute the stored function and return the results obtained as an Object of the specified return type.

Parameters:
returnType - the type of the value to return
args - optional array containing the in parameter values to be used in the call. Parameter values must be provided in the same order as the parameters are defined for the stored procedure.

executeFunction

<T> T executeFunction(Class<T> returnType,
                      Map<String,?> args)
Execute the stored function and return the results obtained as an Object of the specified return type.

Parameters:
returnType - the type of the value to return
args - Map containing the parameter values to be used in the call.

executeFunction

<T> T executeFunction(Class<T> returnType,
                      SqlParameterSource args)
Execute the stored function and return the results obtained as an Object of the specified return type.

Parameters:
returnType - the type of the value to return
args - MapSqlParameterSource containing the parameter values to be used in the call.

executeObject

<T> T executeObject(Class<T> returnType,
                    Object... args)
Execute the stored procedure and return the single out parameter as an Object of the specified return type. In the case where there are multiple out parameters, the first one is returned and additional out parameters are ignored.

Parameters:
returnType - the type of the value to return
args - optional array containing the in parameter values to be used in the call. Parameter values must be provided in the same order as the parameters are defined for the stored procedure.

executeObject

<T> T executeObject(Class<T> returnType,
                    Map<String,?> args)
Execute the stored procedure and return the single out parameter as an Object of the specified return type. In the case where there are multiple out parameters, the first one is returned and additional out parameters are ignored.

Parameters:
returnType - the type of the value to return
args - Map containing the parameter values to be used in the call.

executeObject

<T> T executeObject(Class<T> returnType,
                    SqlParameterSource args)
Execute the stored procedure and return the single out parameter as an Object of the specified return type. In the case where there are multiple out parameters, the first one is returned and additional out parameters are ignored.

Parameters:
returnType - the type of the value to return
args - MapSqlParameterSource containing the parameter values to be used in the call.

execute

Map<String,Object> execute(Object... args)
Execute the stored procedure and return a map of output params, keyed by name as in parameter declarations.

Parameters:
args - optional array containing the in parameter values to be used in the call. Parameter values must be provided in the same order as the parameters are defined for the stored procedure.
Returns:
map of output params.

execute

Map<String,Object> execute(Map<String,?> args)
Execute the stored procedure and return a map of output params, keyed by name as in parameter declarations..

Parameters:
args - Map containing the parameter values to be used in the call.
Returns:
map of output params.

execute

Map<String,Object> execute(SqlParameterSource args)
Execute the stored procedure and return a map of output params, keyed by name as in parameter declarations..

Parameters:
args - SqlParameterSource containing the parameter values to be used in the call.
Returns:
map of output params.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleJdbcInsertOperations

org.springframework.jdbc.core.simple
Interface SimpleJdbcInsertOperations

All Known Implementing Classes:
SimpleJdbcInsert
public interface SimpleJdbcInsertOperations

Interface specifying the API for a Simple JDBC Insert implemented by SimpleJdbcInsert. This interface is not often used directly, but provides the option to enhance testability, as it can easily be mocked or stubbed.

Since:
2.5
Author:
Thomas Risberg

Method Summary
int | execute(Map<String,Object> args) Execute the insert using the values passed in.
int | execute(SqlParameterSource parameterSource) Execute the insert using the values passed in.
Number | executeAndReturnKey(Map<String,Object> args) Execute the insert using the values passed in and return the generated key.
Number | executeAndReturnKey(SqlParameterSource parameterSource) Execute the insert using the values passed in and return the generated key.
KeyHolder | executeAndReturnKeyHolder(Map<String,Object> args) Execute the insert using the values passed in and return the generated keys.
KeyHolder | executeAndReturnKeyHolder(SqlParameterSource parameterSource) Execute the insert using the values passed in and return the generated keys.
int[] | executeBatch(Map<String,Object>[] batch) Execute a batch insert using the batch of values passed in.
int[] | executeBatch(SqlParameterSource[] batch) Execute a batch insert using the batch of values passed in.
SimpleJdbcInsertOperations | includeSynonymsForTableColumnMetaData() Include synonyms for the column meta data lookups via JDBC.
SimpleJdbcInsertOperations | usingColumns(String... columnNames) Specify the column names that the insert statement should be limited to use.
SimpleJdbcInsertOperations | usingGeneratedKeyColumns(String... columnNames) Specify the name sof any columns that have auto generated keys.
SimpleJdbcInsertOperations | withCatalogName(String catalogName) Specify the catalog name, if any, to be used for the insert.
SimpleJdbcInsertOperations | withoutTableColumnMetaDataAccess() Turn off any processing of column meta data information obtained via JDBC.
SimpleJdbcInsertOperations | withSchemaName(String schemaName) Specify the shema name, if any, to be used for the insert.
SimpleJdbcInsertOperations | withTableName(String tableName) Specify the table name to be used for the insert.

Method Detail

withTableName

SimpleJdbcInsertOperations withTableName(String tableName)
Specify the table name to be used for the insert.

Parameters:
tableName - the name of the stored table
Returns:
the instance of this SimpleJdbcInsert

withSchemaName

SimpleJdbcInsertOperations withSchemaName(String schemaName)
Specify the shema name, if any, to be used for the insert.

Parameters:
schemaName - the name of the schema
Returns:
the instance of this SimpleJdbcInsert

withCatalogName

SimpleJdbcInsertOperations withCatalogName(String catalogName)
Specify the catalog name, if any, to be used for the insert.

Parameters:
catalogName - the name of the catalog
Returns:
the instance of this SimpleJdbcInsert

usingColumns

SimpleJdbcInsertOperations usingColumns(String... columnNames)
Specify the column names that the insert statement should be limited to use.

Parameters:
columnNames - one or more column names
Returns:
the instance of this SimpleJdbcInsert

usingGeneratedKeyColumns

SimpleJdbcInsertOperations usingGeneratedKeyColumns(String... columnNames)
Specify the name sof any columns that have auto generated keys.

Parameters:
columnNames - one or more column names
Returns:
the instance of this SimpleJdbcInsert

withoutTableColumnMetaDataAccess

SimpleJdbcInsertOperations withoutTableColumnMetaDataAccess()
Turn off any processing of column meta data information obtained via JDBC.

Returns:
the instance of this SimpleJdbcInsert

includeSynonymsForTableColumnMetaData

SimpleJdbcInsertOperations includeSynonymsForTableColumnMetaData()
Include synonyms for the column meta data lookups via JDBC. Note: this is only necessary to include for Oracle since other databases supporting synonyms seems to include the synonyms automatically.

Returns:
the instance of this SimpleJdbcInsert

execute

int execute(Map<String,Object> args)
Execute the insert using the values passed in.

Parameters:
args - Map containing column names and corresponding value
Returns:
the number of rows affected as returned by the JDBC driver

execute

int execute(SqlParameterSource parameterSource)
Execute the insert using the values passed in.

Parameters:
parameterSource - SqlParameterSource containing values to use for insert
Returns:
the number of rows affected as returned by the JDBC driver

executeAndReturnKey

Number executeAndReturnKey(Map<String,Object> args)
Execute the insert using the values passed in and return the generated key. This requires that the name of the columns with auto generated keys have been specified. This method will always return a key or throw an exception if a key was not returned.

Parameters:
args - Map containing column names and corresponding value
Returns:
the generated key value

executeAndReturnKey

Number executeAndReturnKey(SqlParameterSource parameterSource)
Execute the insert using the values passed in and return the generated key. This requires that the name of the columns with auto generated keys have been specified. This method will always return a key or throw an exception if a key was not returned.

Parameters:
parameterSource - SqlParameterSource containing values to use for insert
Returns:
the generated key value.

executeAndReturnKeyHolder

KeyHolder executeAndReturnKeyHolder(Map<String,Object> args)
Execute the insert using the values passed in and return the generated keys. This requires that the name of the columns with auto generated keys have been specified. This method will always return a KeyHolder but the caller must verify that it actually contains the generated keys.

Parameters:
args - Map containing column names and corresponding value
Returns:
the KeyHolder containing all generated keys

executeAndReturnKeyHolder

KeyHolder executeAndReturnKeyHolder(SqlParameterSource parameterSource)
Execute the insert using the values passed in and return the generated keys. This requires that the name of the columns with auto generated keys have been specified. This method will always return a KeyHolder but the caller must verify that it actually contains the generated keys.

Parameters:
parameterSource - SqlParameterSource containing values to use for insert
Returns:
the KeyHolder containing all generated keys

executeBatch

int[] executeBatch(Map<String,Object>[] batch)
Execute a batch insert using the batch of values passed in.

Parameters:
batch - an array of Maps containing a batch of column names and corresponding value
Returns:
the array of number of rows affected as returned by the JDBC driver

executeBatch

int[] executeBatch(SqlParameterSource[] batch)
Execute a batch insert using the batch of values passed in.

Parameters:
batch - an array of SqlParameterSource containing values for the batch
Returns:
the array of number of rows affected as returned by the JDBC driver
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleJdbcOperations

org.springframework.jdbc.core.simple
Interface SimpleJdbcOperations

All Known Implementing Classes:
SimpleJdbcTemplate
public interface SimpleJdbcOperations

JDBC operations interface usable on Java 5 and above, exposing a set of common JDBC operations, whose interface is simplified through the use of varargs and autoboxing.

Since:
2.0
Author:
Rod Johnson, Rob Harrop, Thomas Risberg
See Also:
NamedParameterJdbcTemplate, SimpleJdbcTemplate, JdbcOperations

Method Summary
 int[] batchUpdate(String sql, List<Object[]> batchArgs)
Execute a batch using the supplied SQL statement with the batch of supplied arguments.
 int[] batchUpdate(String sql, List<Object[]> batchArgs, int[] argTypes)
Execute a batch using the supplied SQL statement with the batch of supplied arguments.
 int[] batchUpdate(String sql, Map<String,?>[] batchValues)
Executes a batch using the supplied SQL statement with the batch of supplied arguments.
 int[] batchUpdate(String sql, SqlParameterSource[] batchArgs)
Execute a batch using the supplied SQL statement with the batch of supplied arguments.
 JdbcOperations getJdbcOperations()
Expose the classic Spring JdbcTemplate to allow invocation of less commonly used methods.
 NamedParameterJdbcOperations getNamedParameterJdbcOperations()
Expose the Spring NamedParameterJdbcTemplate to allow invocation of less commonly used methods.
<T> List<T>
query(String sql, ParameterizedRowMapper<T> rm, Map<String,?> args)
Deprecated. as of Spring 3.0: Use the method using the newly genericized RowMapper interface instead since the RowMapper and ParameterizedRowMapper interfaces are equivalent now.
<T> List<T>
query(String sql, ParameterizedRowMapper<T> rm, Object... args)
Deprecated. as of Spring 3.0: Use the method using the newly genericized RowMapper interface instead since the RowMapper and ParameterizedRowMapper interfaces are equivalent now.
<T> List<T>
query(String sql, ParameterizedRowMapper<T> rm, SqlParameterSource args)
Deprecated. as of Spring 3.0: Use the method using the newly genericized RowMapper interface instead since the RowMapper and ParameterizedRowMapper interfaces are equivalent now.
<T> List<T>
query(String sql, RowMapper<T> rm, Map<String,?> args)
Query for a List of Objects of type T using the supplied RowMapper to the query results to the object.
<T> List<T>
query(String sql, RowMapper<T> rm, Object... args)
Query for a List of Objects of type T using the supplied RowMapper to the query results to the object.
<T> List<T>
query(String sql, RowMapper<T> rm, SqlParameterSource args)
Query for a List of Objects of type T using the supplied RowMapper to the query results to the object.
 int queryForInt(String sql, Map<String,?> args)
Query for an int passing in a SQL query using the named parameter support provided by the NamedParameterJdbcTemplate and a map containing the arguments.
 int queryForInt(String sql, Object... args)
Query for an int passing in a SQL query using the standard '?' placeholders for parameters and a variable number of arguments.
 int queryForInt(String sql, SqlParameterSource args)
Query for an int passing in a SQL query using the named parameter support provided by the NamedParameterJdbcTemplate and a SqlParameterSource containing the arguments.
 List<Map<String,Object>> queryForList(String sql, Map<String,?> args)
Execute the supplied query with the supplied arguments.
 List<Map<String,Object>> queryForList(String sql, Object... args)
Execute the supplied query with the (optional) supplied arguments.
 List<Map<String,Object>> queryForList(String sql, SqlParameterSource args)
Execute the supplied query with the supplied arguments.
 long queryForLong(String sql, Map<String,?> args)
Query for an long passing in a SQL query using the named parameter support provided by the NamedParameterJdbcTemplate and a map containing the arguments.
 long queryForLong(String sql, Object... args)
Query for an long passing in a SQL query using the standard '?' placeholders for parameters and a variable number of arguments.
 long queryForLong(String sql, SqlParameterSource args)
Query for an long passing in a SQL query using the named parameter support provided by the NamedParameterJdbcTemplate and a SqlParameterSource containing the arguments.
 Map<String,Object> queryForMap(String sql, Map<String,?> args)
Execute the supplied query with the supplied arguments.
 Map<String,Object> queryForMap(String sql, Object... args)
Execute the supplied query with the (optional) supplied arguments.
 Map<String,Object> queryForMap(String sql, SqlParameterSource args)
Execute the supplied query with the supplied arguments.
<T> T
queryForObject(String sql, Class<T> requiredType, Map<String,?> args)
Query for an object of type T identified by the supplied @Class.
<T> T
queryForObject(String sql, Class<T> requiredType, Object... args)
Query for an object of type T identified by the supplied @Class.
<T> T
queryForObject(String sql, Class<T> requiredType, SqlParameterSource args)
Query for an object of type T identified by the supplied @Class.
<T> T
queryForObject(String sql, ParameterizedRowMapper<T> rm, Map<String,?> args)
Deprecated. as of Spring 3.0: Use the method using the newly genericized RowMapper interface instead since the RowMapper and ParameterizedRowMapper interfaces are equivalent now.
<T> T
queryForObject(String sql, ParameterizedRowMapper<T> rm, Object... args)
Deprecated. as of Spring 3.0: Use the method using the newly genericized RowMapper interface instead since the RowMapper and ParameterizedRowMapper interfaces are equivalent now.
<T> T
queryForObject(String sql, ParameterizedRowMapper<T> rm, SqlParameterSource args)
Deprecated. as of Spring 3.0: Use the method using the newly genericized RowMapper interface instead since the RowMapper and ParameterizedRowMapper interfaces are equivalent now.
<T> T
queryForObject(String sql, RowMapper<T> rm, Map<String,?> args)
Query for an object of type T using the supplied RowMapper to the query results to the object.
<T> T
queryForObject(String sql, RowMapper<T> rm, Object... args)
Query for an object of type T using the supplied RowMapper to the query results to the object.
<T> T
queryForObject(String sql, RowMapper<T> rm, SqlParameterSource args)
Query for an object of type T using the supplied RowMapper to the query results to the object.
 int update(String sql, Map<String,?> args)
Execute the supplied SQL statement with (optional) supplied arguments.
 int update(String sql, Object... args)
Execute the supplied SQL statement with supplied arguments.
 int update(String sql, SqlParameterSource args)
Execute the supplied SQL statement with supplied arguments.

Method Detail

getJdbcOperations

JdbcOperations getJdbcOperations()
Expose the classic Spring JdbcTemplate to allow invocation of less commonly used methods.

getNamedParameterJdbcOperations

NamedParameterJdbcOperations getNamedParameterJdbcOperations()
Expose the Spring NamedParameterJdbcTemplate to allow invocation of less commonly used methods.

queryForInt

int queryForInt(String sql,
                Map<String,?> args)
                throws DataAccessException
Query for an int passing in a SQL query using the named parameter support provided by the NamedParameterJdbcTemplate and a map containing the arguments.

Parameters:
sql - the SQL query to run.
args - the map containing the arguments for the query
Throws:
DataAccessException

queryForInt

int queryForInt(String sql,
                SqlParameterSource args)
                throws DataAccessException
Query for an int passing in a SQL query using the named parameter support provided by the NamedParameterJdbcTemplate and a SqlParameterSource containing the arguments.

Parameters:
sql - the SQL query to run.
args - the SqlParameterSource containing the arguments for the query.
Throws:
DataAccessException

queryForInt

int queryForInt(String sql,
                Object... args)
                throws DataAccessException
Query for an int passing in a SQL query using the standard '?' placeholders for parameters and a variable number of arguments.

Parameters:
sql - the SQL query to run.
args - the variable number of arguments for the query
Throws:
DataAccessException

queryForLong

long queryForLong(String sql,
                  Map<String,?> args)
                  throws DataAccessException
Query for an long passing in a SQL query using the named parameter support provided by the NamedParameterJdbcTemplate and a map containing the arguments.

Parameters:
sql - the SQL query to run.
args - the map containing the arguments for the query
Throws:
DataAccessException

queryForLong

long queryForLong(String sql,
                  SqlParameterSource args)
                  throws DataAccessException
Query for an long passing in a SQL query using the named parameter support provided by the NamedParameterJdbcTemplate and a SqlParameterSource containing the arguments.

Parameters:
sql - the SQL query to run.
args - the SqlParameterSource containing the arguments for the query
Throws:
DataAccessException

queryForLong

long queryForLong(String sql,
                  Object... args)
                  throws DataAccessException
Query for an long passing in a SQL query using the standard '?' placeholders for parameters and a variable number of arguments.

Parameters:
sql - the SQL query to run.
args - the variable number of arguments for the query
Throws:
DataAccessException

queryForObject

<T> T queryForObject(String sql,
                     Class<T> requiredType,
                     Map<String,?> args)
                 throws DataAccessException
Query for an object of type T identified by the supplied @Class. Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Parameters:
sql - the SQL query to run
requiredType - the required type of the return value
args - the map containing the arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForObject(String, Class), JdbcOperations.queryForObject(String, Object[], Class)

queryForObject

<T> T queryForObject(String sql,
                     Class<T> requiredType,
                     SqlParameterSource args)
                 throws DataAccessException
Query for an object of type T identified by the supplied @Class. Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Parameters:
sql - the SQL query to run
requiredType - the required type of the return value
args - the SqlParameterSource containing the arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForObject(String, Class), JdbcOperations.queryForObject(String, Object[], Class)

queryForObject

<T> T queryForObject(String sql,
                     Class<T> requiredType,
                     Object... args)
                 throws DataAccessException
Query for an object of type T identified by the supplied @Class. Uses sql with the standard '?' placeholders for parameters

Parameters:
sql - the SQL query to run
requiredType - the required type of the return value
args - the variable number of arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForObject(String, Class), JdbcOperations.queryForObject(String, Object[], Class)

queryForObject

<T> T queryForObject(String sql,
                     RowMapper<T> rm,
                     Map<String,?> args)
                 throws DataAccessException
Query for an object of type T using the supplied RowMapper to the query results to the object. Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Parameters:
sql - the SQL query to run
rm - the @RowMapper to use for result mapping
args - the map containing the arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper), JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)

queryForObject

@Deprecated
<T> T queryForObject(String sql,
                                ParameterizedRowMapper<T> rm,
                                Map<String,?> args)
                 throws DataAccessException
Deprecated. as of Spring 3.0: Use the method using the newly genericized RowMapper interface instead since the RowMapper and ParameterizedRowMapper interfaces are equivalent now.

Query for an object of type T using the supplied ParameterizedRowMapper to the query results to the object. Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Parameters:
sql - the SQL query to run
rm - the @ParameterizedRowMapper to use for result mapping
args - the map containing the arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper), JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)

queryForObject

<T> T queryForObject(String sql,
                     RowMapper<T> rm,
                     SqlParameterSource args)
                 throws DataAccessException
Query for an object of type T using the supplied RowMapper to the query results to the object. Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Parameters:
sql - the SQL query to run
rm - the @RowMapper to use for result mapping
args - the SqlParameterSource containing the arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper), JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)

queryForObject

@Deprecated
<T> T queryForObject(String sql,
                                ParameterizedRowMapper<T> rm,
                                SqlParameterSource args)
                 throws DataAccessException
Deprecated. as of Spring 3.0: Use the method using the newly genericized RowMapper interface instead since the RowMapper and ParameterizedRowMapper interfaces are equivalent now.

Query for an object of type T using the supplied ParameterizedRowMapper to the query results to the object. Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Parameters:
sql - the SQL query to run
rm - the @ParameterizedRowMapper to use for result mapping
args - the SqlParameterSource containing the arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper), JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)

queryForObject

<T> T queryForObject(String sql,
                     RowMapper<T> rm,
                     Object... args)
                 throws DataAccessException
Query for an object of type T using the supplied RowMapper to the query results to the object. Uses sql with the standard '?' placeholders for parameters

Parameters:
sql - the SQL query to run
rm - the @RowMapper to use for result mapping
args - the variable number of arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper), JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)

queryForObject

@Deprecated
<T> T queryForObject(String sql,
                                ParameterizedRowMapper<T> rm,
                                Object... args)
                 throws DataAccessException
Deprecated. as of Spring 3.0: Use the method using the newly genericized RowMapper interface instead since the RowMapper and ParameterizedRowMapper interfaces are equivalent now.

Query for an object of type T using the supplied ParameterizedRowMapper to the query results to the object. Uses sql with the standard '?' placeholders for parameters

Parameters:
sql - the SQL query to run
rm - the @ParameterizedRowMapper to use for result mapping
args - the variable number of arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper), JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)

query

<T> List<T> query(String sql,
                  RowMapper<T> rm,
                  Map<String,?> args)
              throws DataAccessException
Query for a List of Objects of type T using the supplied RowMapper to the query results to the object. Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Parameters:
sql - the SQL query to run
rm - the @RowMapper to use for result mapping
args - the map containing the arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper), JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)

query

@Deprecated
<T> List<T> query(String sql,
                             ParameterizedRowMapper<T> rm,
                             Map<String,?> args)
              throws DataAccessException
Deprecated. as of Spring 3.0: Use the method using the newly genericized RowMapper interface instead since the RowMapper and ParameterizedRowMapper interfaces are equivalent now.

Query for a List of Objects of type T using the supplied ParameterizedRowMapper to the query results to the object. Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Parameters:
sql - the SQL query to run
rm - the @ParameterizedRowMapper to use for result mapping
args - the map containing the arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper), JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)

query

<T> List<T> query(String sql,
                  RowMapper<T> rm,
                  SqlParameterSource args)
              throws DataAccessException
Query for a List of Objects of type T using the supplied RowMapper to the query results to the object. Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Parameters:
sql - the SQL query to run
rm - the @RowMapper to use for result mapping
args - the SqlParameterSource containing the arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper), JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)

query

@Deprecated
<T> List<T> query(String sql,
                             ParameterizedRowMapper<T> rm,
                             SqlParameterSource args)
              throws DataAccessException
Deprecated. as of Spring 3.0: Use the method using the newly genericized RowMapper interface instead since the RowMapper and ParameterizedRowMapper interfaces are equivalent now.

Query for a List of Objects of type T using the supplied ParameterizedRowMapper to the query results to the object. Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Parameters:
sql - the SQL query to run
rm - the @ParameterizedRowMapper to use for result mapping
args - the SqlParameterSource containing the arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper), JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)

query

<T> List<T> query(String sql,
                  RowMapper<T> rm,
                  Object... args)
              throws DataAccessException
Query for a List of Objects of type T using the supplied RowMapper to the query results to the object. Uses sql with the standard '?' placeholders for parameters

Parameters:
sql - the SQL query to run
rm - the @RowMapper to use for result mapping
args - the variable number of arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper), JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)

query

@Deprecated
<T> List<T> query(String sql,
                             ParameterizedRowMapper<T> rm,
                             Object... args)
              throws DataAccessException
Deprecated. as of Spring 3.0: Use the method using the newly genericized RowMapper interface instead since the RowMapper and ParameterizedRowMapper interfaces are equivalent now.

Query for a List of Objects of type T using the supplied ParameterizedRowMapper to the query results to the object. Uses sql with the standard '?' placeholders for parameters

Parameters:
sql - the SQL query to run
rm - the @ParameterizedRowMapper to use for result mapping
args - the variable number of arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper), JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)

queryForMap

Map<String,Object> queryForMap(String sql,
                               Map<String,?> args)
                               throws DataAccessException
Execute the supplied query with the supplied arguments.

The query is expected to be a single row query; the result row will be mapped to a Map (one entry for each column, using the column name as the key). Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Parameters:
sql - the SQL query to run
args - the map containing the arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForMap(String), JdbcOperations.queryForMap(String, Object[])

queryForMap

Map<String,Object> queryForMap(String sql,
                               SqlParameterSource args)
                               throws DataAccessException
Execute the supplied query with the supplied arguments.

The query is expected to be a single row query; the result row will be mapped to a Map (one entry for each column, using the column name as the key). Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Parameters:
sql - the SQL query to run
args - the SqlParameterSource containing the arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForMap(String), JdbcOperations.queryForMap(String, Object[])

queryForMap

Map<String,Object> queryForMap(String sql,
                               Object... args)
                               throws DataAccessException
Execute the supplied query with the (optional) supplied arguments.

The query is expected to be a single row query; the result row will be mapped to a Map (one entry for each column, using the column name as the key). Uses sql with the standard '?' placeholders for parameters

Parameters:
sql - the SQL query to run
args - the variable number of arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForMap(String), JdbcOperations.queryForMap(String, Object[])

queryForList

List<Map<String,Object>> queryForList(String sql,
                                      Map<String,?> args)
                                      throws DataAccessException
Execute the supplied query with the supplied arguments.

Each element in the returned List is constructed as a Map as described in queryForMap(java.lang.String, java.util.Map) Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Parameters:
sql - the SQL query to run
args - the map containing the arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForList(String), JdbcOperations.queryForList(String, Object[])

queryForList

List<Map<String,Object>> queryForList(String sql,
                                      SqlParameterSource args)
                                      throws DataAccessException
Execute the supplied query with the supplied arguments.

Each element in the returned List is constructed as a Map as described in queryForMap(java.lang.String, java.util.Map) Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Parameters:
sql - the SQL query to run
args - the SqlParameterSource containing the arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForList(String), JdbcOperations.queryForList(String, Object[])

queryForList

List<Map<String,Object>> queryForList(String sql,
                                      Object... args)
                                      throws DataAccessException
Execute the supplied query with the (optional) supplied arguments.

Each element in the returned List is constructed as a Map as described in queryForMap(java.lang.String, java.util.Map) Uses sql with the standard '?' placeholders for parameters

Parameters:
sql - the SQL query to run
args - the variable number of arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForList(String), JdbcOperations.queryForList(String, Object[])

update

int update(String sql,
           Map<String,?> args)
           throws DataAccessException
Execute the supplied SQL statement with (optional) supplied arguments. Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Parameters:
sql - the SQL statement to execute
args - the map containing the arguments for the query
Returns:
the numbers of rows affected by the update
Throws:
DataAccessException
See Also:
NamedParameterJdbcOperations.update(String, Map)

update

int update(String sql,
           SqlParameterSource args)
           throws DataAccessException
Execute the supplied SQL statement with supplied arguments. Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Parameters:
sql - the SQL statement to execute
args - the SqlParameterSource containing the arguments for the statement
Returns:
the numbers of rows affected by the update
Throws:
DataAccessException
See Also:
NamedParameterJdbcOperations.update(String, SqlParameterSource)

update

int update(String sql,
           Object... args)
           throws DataAccessException
Execute the supplied SQL statement with supplied arguments. Uses sql with the standard '?' placeholders for parameters

Parameters:
sql - the SQL statement to execute
args - the variable number of arguments for the query
Returns:
the numbers of rows affected by the update
Throws:
DataAccessException
See Also:
JdbcOperations.update(String), JdbcOperations.update(String, Object[])

batchUpdate

int[] batchUpdate(String sql,
                  Map<String,?>[] batchValues)
Executes a batch using the supplied SQL statement with the batch of supplied arguments. Uses sql with the named parameter support.

Parameters:
sql - the SQL statement to execute
batchValues - the array of Maps containing the batch of arguments for the query
Returns:
an array containing the numbers of rows affected by each update in the batch

batchUpdate

int[] batchUpdate(String sql,
                  SqlParameterSource[] batchArgs)
Execute a batch using the supplied SQL statement with the batch of supplied arguments. Uses sql with the named parameter support.

Parameters:
sql - the SQL statement to execute
batchArgs - the array of SqlParameterSource containing the batch of arguments for the query
Returns:
an array containing the numbers of rows affected by each update in the batch

batchUpdate

int[] batchUpdate(String sql,
                  List<Object[]> batchArgs)
Execute a batch using the supplied SQL statement with the batch of supplied arguments. Uses sql with the standard '?' placeholders for parameters

Parameters:
sql - the SQL statement to execute
batchArgs - the List of Object arrays containing the batch of arguments for the query
Returns:
an array containing the numbers of rows affected by each update in the batch

batchUpdate

int[] batchUpdate(String sql,
                  List<Object[]> batchArgs,
                  int[] argTypes)
Execute a batch using the supplied SQL statement with the batch of supplied arguments. Uses sql with the standard '?' placeholders for parameters

Parameters:
sql - the SQL statement to execute.
batchArgs - the List of Object arrays containing the batch of arguments for the query
argTypes - SQL types of the arguments (constants from java.sql.Types)
Returns:
an array containing the numbers of rows affected by each update in the batch
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractJdbcCall

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.core.simple
Class AbstractJdbcCall

java.lang.Object
    extended by  org.springframework.jdbc.core.simple.AbstractJdbcCall
Direct Known Subclasses:
SimpleJdbcCall
public abstract class AbstractJdbcCall
extends Object

Abstract class to provide base functionality for easy stored procedure calls based on configuration options and database metadata. This class provides the base SPI for SimpleJdbcCall.

Since:
2.5
Author:
Thomas Risberg

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
protected | AbstractJdbcCall(DataSource dataSource) Constructor to be used when initializing using a DataSource.
protected | AbstractJdbcCall(JdbcTemplate jdbcTemplate) Constructor to be used when initializing using a JdbcTemplate.
Method Summary
 void addDeclaredParameter(SqlParameter parameter)
Add a declared parameter to the list of parameters for the call.
 void addDeclaredRowMapper(String parameterName, ParameterizedRowMapper rowMapper)
Deprecated. in favor of addDeclaredRowMapper(String, org.springframework.jdbc.core.RowMapper)
 void addDeclaredRowMapper(String parameterName, RowMapper rowMapper)
Add a RowMapper for the specified parameter or column.
protected  void checkCompiled()
Check whether this operation has been compiled already; lazily compile it if not already compiled.
 void compile()
Compile this JdbcCall using provided parameters and meta data plus other settings.
protected  void compileInternal()
Method to perform the actual compilation.
protected  Map<String,Object> doExecute(Map<String,?> args)
Method that provides execution of the call using the passed in Map of parameters
protected  Map<String,Object> doExecute(Object[] args)
Method that provides execution of the call using the passed in array of parameters
protected  Map<String,Object> doExecute(SqlParameterSource parameterSource)
Method that provides execution of the call using the passed in SqlParameterSource
protected  CallableStatementCreatorFactory getCallableStatementFactory()
Get the CallableStatementCreatorFactory being used
protected  List<SqlParameter> getCallParameters()
Get a List of all the call parameters to be used for call.
 String getCallString()
Get the call string that should be used based on parameters and meta data
 String getCatalogName()
Get the catalog name used.
 Set<String> getInParameterNames()
Get the names of in parameters to be used.
 JdbcTemplate getJdbcTemplate()
Get the configured JdbcTemplate
 String getProcedureName()
Get the name of the stored procedure.
protected  String getScalarOutParameterName()
Get the name of a single out parameter or return value.
 String getSchemaName()
Get the schema name used.
 boolean isCompiled()
Is this operation "compiled"?
 boolean isFunction()
Is this call a function call?
 boolean isReturnValueRequired()
Does the call require a return value?
protected  Map<String,?> matchInParameterValuesWithCallParameters(Map<String,?> args)
Match the provided in parameter values with registered parameters and parameters defined via metadata processing.
protected  Map<String,Object> matchInParameterValuesWithCallParameters(SqlParameterSource parameterSource)
Match the provided in parameter values with registered parameters and parameters defined via metadata processing.
protected  void onCompileInternal()
Hook method that subclasses may override to react to compilation.
 void setAccessCallParameterMetaData(boolean accessCallParameterMetaData)
Specify whether the parameter metadata for the call should be used.
 void setCatalogName(String catalogName)
Set the catalog name to use.
 void setFunction(boolean function)
Specify whether this call is a function call.
 void setInParameterNames(Set<String> inParameterNames)
Set the names of in parameters to be used.
 void setProcedureName(String procedureName)
Set the name of the stored procedure.
 void setReturnValueRequired(boolean b)
Specify whether the call requires a rerurn value.
 void setSchemaName(String schemaName)
Set the schema name to use,
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

AbstractJdbcCall

protected AbstractJdbcCall(DataSource dataSource)
Constructor to be used when initializing using a DataSource.

Parameters:
dataSource - the DataSource to be used

AbstractJdbcCall

protected AbstractJdbcCall(JdbcTemplate jdbcTemplate)
Constructor to be used when initializing using a JdbcTemplate.

Parameters:
jdbcTemplate - the JdbcTemplate to use
Method Detail

getJdbcTemplate

public JdbcTemplate getJdbcTemplate()
Get the configured JdbcTemplate

getCallableStatementFactory

protected CallableStatementCreatorFactory getCallableStatementFactory()
Get the CallableStatementCreatorFactory being used

setProcedureName

public void setProcedureName(String procedureName)
Set the name of the stored procedure.

getProcedureName

public String getProcedureName()
Get the name of the stored procedure.

setInParameterNames

public void setInParameterNames(Set<String> inParameterNames)
Set the names of in parameters to be used.

getInParameterNames

public Set<String> getInParameterNames()
Get the names of in parameters to be used.

setCatalogName

public void setCatalogName(String catalogName)
Set the catalog name to use.

getCatalogName

public String getCatalogName()
Get the catalog name used.

setSchemaName

public void setSchemaName(String schemaName)
Set the schema name to use,

getSchemaName

public String getSchemaName()
Get the schema name used.

setFunction

public void setFunction(boolean function)
Specify whether this call is a function call.

isFunction

public boolean isFunction()
Is this call a function call?

setReturnValueRequired

public void setReturnValueRequired(boolean b)
Specify whether the call requires a rerurn value.

isReturnValueRequired

public boolean isReturnValueRequired()
Does the call require a return value?

addDeclaredParameter

public void addDeclaredParameter(SqlParameter parameter)
Add a declared parameter to the list of parameters for the call. Only parameters declared as SqlParameter and SqlInOutParameter will be used to provide input values. This is different from the StoredProcedure class which for backwards compatibility reasons allows input values to be provided for parameters declared as SqlOutParameter.

Parameters:
parameter - the SqlParameter to add

addDeclaredRowMapper

public void addDeclaredRowMapper(String parameterName,
                                 RowMapper rowMapper)
Add a RowMapper for the specified parameter or column.

Parameters:
parameterName - name of parameter or column
rowMapper - the RowMapper implementation to use

addDeclaredRowMapper

@Deprecated
public void addDeclaredRowMapper(String parameterName,
                                            ParameterizedRowMapper rowMapper)
Deprecated. in favor of addDeclaredRowMapper(String, org.springframework.jdbc.core.RowMapper)

Add a RowMapper for the specified parameter or column.

getCallString

public String getCallString()
Get the call string that should be used based on parameters and meta data

setAccessCallParameterMetaData

public void setAccessCallParameterMetaData(boolean accessCallParameterMetaData)
Specify whether the parameter metadata for the call should be used. The default is true.

compile

public final void compile()
                   throws InvalidDataAccessApiUsageException
Compile this JdbcCall using provided parameters and meta data plus other settings. This finalizes the configuration for this object and subsequent attempts to compile are ignored. This will be implicitly called the first time an un-compiled call is executed.

Throws:
InvalidDataAccessApiUsageException - if the object hasn't been correctly initialized, for example if no DataSource has been provided

compileInternal

protected void compileInternal()
Method to perform the actual compilation. Subclasses can override this template method to perform their own compilation. Invoked after this base class's compilation is complete.

onCompileInternal

protected void onCompileInternal()
Hook method that subclasses may override to react to compilation. This implementation does nothing.

isCompiled

public boolean isCompiled()
Is this operation "compiled"?

Returns:
whether this operation is compiled, and ready to use.

checkCompiled

protected void checkCompiled()
Check whether this operation has been compiled already; lazily compile it if not already compiled.

Automatically called by doExecute.

doExecute

protected Map<String,Object> doExecute(SqlParameterSource parameterSource)
Method that provides execution of the call using the passed in SqlParameterSource

Parameters:
parameterSource - parameter names and values to be used in call
Returns:
Map of out parameters

doExecute

protected Map<String,Object> doExecute(Object[] args)
Method that provides execution of the call using the passed in array of parameters

Parameters:
args - array of parameter values; order must match the order declared for the stored procedure
Returns:
Map of out parameters

doExecute

protected Map<String,Object> doExecute(Map<String,?> args)
Method that provides execution of the call using the passed in Map of parameters

Parameters:
args - Map of parameter name and values
Returns:
Map of out parameters

getScalarOutParameterName

protected String getScalarOutParameterName()
Get the name of a single out parameter or return value. Used for functions or procedures with one out parameter.

matchInParameterValuesWithCallParameters

protected Map<String,Object> matchInParameterValuesWithCallParameters(SqlParameterSource parameterSource)
Match the provided in parameter values with registered parameters and parameters defined via metadata processing.

Parameters:
parameterSource - the parameter vakues provided as a SqlParameterSource
Returns:
Map with parameter names and values

matchInParameterValuesWithCallParameters

protected Map<String,?> matchInParameterValuesWithCallParameters(Map<String,?> args)
Match the provided in parameter values with registered parameters and parameters defined via metadata processing.

Parameters:
args - the parameter values provided in a Map
Returns:
Map with parameter names and values

getCallParameters

protected List<SqlParameter> getCallParameters()
Get a List of all the call parameters to be used for call. This includes any parameters added based on meta data processing.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractJdbcInsert

org.springframework.jdbc.core.simple
Class AbstractJdbcInsert

java.lang.Object
    extended by  org.springframework.jdbc.core.simple.AbstractJdbcInsert
Direct Known Subclasses:
SimpleJdbcInsert
public abstract class AbstractJdbcInsert
extends Object

Abstract class to provide base functionality for easy inserts based on configuration options and database metadata. This class provides the base SPI for SimpleJdbcInsert.

Since:
2.5
Author:
Thomas Risberg

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
protected | AbstractJdbcInsert(DataSource dataSource) Constructor for sublasses to delegate to for setting the DataSource.
protected | AbstractJdbcInsert(JdbcTemplate jdbcTemplate) Constructor for sublasses to delegate to for setting the JdbcTemplate.
Method Summary
protected void | checkCompiled() Check whether this operation has been compiled already; lazily compile it if not already compiled.
protected void | checkIfConfigurationModificationIsAllowed() Method to check whether we are allowd to make any configuration changes at this time.
void | compile() Compile this JdbcInsert using provided parameters and meta data plus other settings.
protected void | compileInternal() Method to perform the actual compilation.
protected int | doExecute(Map<String,Object> args) Method that provides execution of the insert using the passed in Map of parameters
protected int | doExecute(SqlParameterSource parameterSource) Method that provides execution of the insert using the passed in SqlParameterSource
protected Number | doExecuteAndReturnKey(Map<String,Object> args) Method that provides execution of the insert using the passed in Map of parameters and returning a generated key
protected Number | doExecuteAndReturnKey(SqlParameterSource parameterSource) Method that provides execution of the insert using the passed in SqlParameterSource and returning a generated key
protected KeyHolder | doExecuteAndReturnKeyHolder(Map<String,Object> args) Method that provides execution of the insert using the passed in Map of parameters and returning all generated keys
protected KeyHolder | doExecuteAndReturnKeyHolder(SqlParameterSource parameterSource) Method that provides execution of the insert using the passed in SqlParameterSource and returning all generated keys
protected int[] | doExecuteBatch(Map<String,Object>[] batch) Method that provides execution of a batch insert using the passed in Maps of parameters
protected int[] | doExecuteBatch(SqlParameterSource[] batch) Method that provides execution of a batch insert using the passed in array of SqlParameterSource
String | getCatalogName() Get the name of the catalog for this insert
List<String> | getColumnNames() Get the names of the columns used
String[] | getGeneratedKeyNames() Get the names of any generated keys
String | getInsertString() Get the insert string to be used
int[] | getInsertTypes() Get the array of Types to be used for insert
protected JdbcTemplate | getJdbcTemplate() Get the JdbcTemplate that is configured to be used
String | getSchemaName() Get the name of the schema for this insert
String | getTableName() Get the name of the table for this insert
boolean | isCompiled() Is this operation "compiled"?
protected List<Object> | matchInParameterValuesWithInsertColumns(Map<String,Object> args) Match the provided in parameter values with regitered parameters and parameters defined via metedata processing.
protected List<Object> | matchInParameterValuesWithInsertColumns(SqlParameterSource parameterSource) Match the provided in parameter values with regitered parameters and parameters defined via metedata processing.
protected void | onCompileInternal() Hook method that subclasses may override to react to compilation.
void | setAccessTableColumnMetaData(boolean accessTableColumnMetaData) Specify whether the parameter metadata for the call should be used.
void | setCatalogName(String catalogName) Set the name of the catalog for this insert
void | setColumnNames(List<String> columnNames) Set the names of the columns to be used
void | setGeneratedKeyName(String generatedKeyName) Specify the name of a single generated key column
void | setGeneratedKeyNames(String[] generatedKeyNames) Set the names of any generated keys
void | setOverrideIncludeSynonymsDefault(boolean override) Specify whether the default for including synonyms should be changed.
void | setSchemaName(String schemaName) Set the name of the schema for this insert
void | setTableName(String tableName) Set the name of the table for this insert
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

AbstractJdbcInsert

protected AbstractJdbcInsert(DataSource dataSource)
Constructor for sublasses to delegate to for setting the DataSource.

AbstractJdbcInsert

protected AbstractJdbcInsert(JdbcTemplate jdbcTemplate)
Constructor for sublasses to delegate to for setting the JdbcTemplate.

Method Detail

getTableName

public String getTableName()
Get the name of the table for this insert

setTableName

public void setTableName(String tableName)
Set the name of the table for this insert

getSchemaName

public String getSchemaName()
Get the name of the schema for this insert

setSchemaName

public void setSchemaName(String schemaName)
Set the name of the schema for this insert

getCatalogName

public String getCatalogName()
Get the name of the catalog for this insert

setCatalogName

public void setCatalogName(String catalogName)
Set the name of the catalog for this insert

setColumnNames

public void setColumnNames(List<String> columnNames)
Set the names of the columns to be used

getColumnNames

public List<String> getColumnNames()
Get the names of the columns used

getGeneratedKeyNames

public String[] getGeneratedKeyNames()
Get the names of any generated keys

setGeneratedKeyNames

public void setGeneratedKeyNames(String[] generatedKeyNames)
Set the names of any generated keys

setGeneratedKeyName

public void setGeneratedKeyName(String generatedKeyName)
Specify the name of a single generated key column

setAccessTableColumnMetaData

public void setAccessTableColumnMetaData(boolean accessTableColumnMetaData)
Specify whether the parameter metadata for the call should be used. The default is true.

setOverrideIncludeSynonymsDefault

public void setOverrideIncludeSynonymsDefault(boolean override)
Specify whether the default for including synonyms should be changed. The default is false.

getInsertString

public String getInsertString()
Get the insert string to be used

getInsertTypes

public int[] getInsertTypes()
Get the array of Types to be used for insert

getJdbcTemplate

protected JdbcTemplate getJdbcTemplate()
Get the JdbcTemplate that is configured to be used

compile

public final void compile()
                   throws InvalidDataAccessApiUsageException
Compile this JdbcInsert using provided parameters and meta data plus other settings. This finalizes the configuration for this object and subsequent attempts to compile are ignored. This will be implicitly called the first time an un-compiled insert is executed.

Throws:
InvalidDataAccessApiUsageException - if the object hasn't been correctly initialized, for example if no DataSource has been provided

compileInternal

protected void compileInternal()
Method to perform the actual compilation. Subclasses can override this template method to perform their own compilation. Invoked after this base class's compilation is complete.

onCompileInternal

protected void onCompileInternal()
Hook method that subclasses may override to react to compilation. This implementation does nothing.

isCompiled

public boolean isCompiled()
Is this operation "compiled"?

Returns:
whether this operation is compiled, and ready to use.

checkCompiled

protected void checkCompiled()
Check whether this operation has been compiled already; lazily compile it if not already compiled.

Automatically called by validateParameters.

checkIfConfigurationModificationIsAllowed

protected void checkIfConfigurationModificationIsAllowed()
Method to check whether we are allowd to make any configuration changes at this time. If the class has been compiled, then no further changes to the configuration are allowed.

doExecute

protected int doExecute(Map<String,Object> args)
Method that provides execution of the insert using the passed in Map of parameters

Parameters:
args - Map with parameter names and values to be used in insert
Returns:
number of rows affected

doExecute

protected int doExecute(SqlParameterSource parameterSource)
Method that provides execution of the insert using the passed in SqlParameterSource

Parameters:
parameterSource - parameter names and values to be used in insert
Returns:
number of rows affected

doExecuteAndReturnKey

protected Number doExecuteAndReturnKey(Map<String,Object> args)
Method that provides execution of the insert using the passed in Map of parameters and returning a generated key

Parameters:
args - Map with parameter names and values to be used in insert
Returns:
the key generated by the insert

doExecuteAndReturnKey

protected Number doExecuteAndReturnKey(SqlParameterSource parameterSource)
Method that provides execution of the insert using the passed in SqlParameterSource and returning a generated key

Parameters:
parameterSource - parameter names and values to be used in insert
Returns:
the key generated by the insert

doExecuteAndReturnKeyHolder

protected KeyHolder doExecuteAndReturnKeyHolder(Map<String,Object> args)
Method that provides execution of the insert using the passed in Map of parameters and returning all generated keys

Parameters:
args - Map with parameter names and values to be used in insert
Returns:
the KeyHolder containing keys generated by the insert

doExecuteAndReturnKeyHolder

protected KeyHolder doExecuteAndReturnKeyHolder(SqlParameterSource parameterSource)
Method that provides execution of the insert using the passed in SqlParameterSource and returning all generated keys

Parameters:
parameterSource - parameter names and values to be used in insert
Returns:
the KeyHolder containing keys generated by the insert

doExecuteBatch

protected int[] doExecuteBatch(Map<String,Object>[] batch)
Method that provides execution of a batch insert using the passed in Maps of parameters

Parameters:
batch - array of Maps with parameter names and values to be used in batch insert
Returns:
array of number of rows affected

doExecuteBatch

protected int[] doExecuteBatch(SqlParameterSource[] batch)
Method that provides execution of a batch insert using the passed in array of SqlParameterSource

Parameters:
batch - array of SqlParameterSource with parameter names and values to be used in insert
Returns:
array of number of rows affected

matchInParameterValuesWithInsertColumns

protected List<Object> matchInParameterValuesWithInsertColumns(SqlParameterSource parameterSource)
Match the provided in parameter values with regitered parameters and parameters defined via metedata processing.

Parameters:
parameterSource - the parameter vakues provided as a SqlParameterSource
Returns:
Map with parameter names and values

matchInParameterValuesWithInsertColumns

protected List<Object> matchInParameterValuesWithInsertColumns(Map<String,Object> args)
Match the provided in parameter values with regitered parameters and parameters defined via metedata processing.

Parameters:
args - the parameter values provided in a Map
Returns:
Map with parameter names and values
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ParameterizedBeanPropertyRowMapper

org.springframework.jdbc.core.simple
Class ParameterizedBeanPropertyRowMapper<T>

java.lang.Object
    extended by  org.springframework.jdbc.core.BeanPropertyRowMapper<T>
        extended by  org.springframework.jdbc.core.simple.ParameterizedBeanPropertyRowMapper<T>
All Implemented Interfaces:
RowMapper<T>, ParameterizedRowMapper<T>
public class ParameterizedBeanPropertyRowMapper<T>
extends BeanPropertyRowMapper<T>
implements ParameterizedRowMapper<T>

ParameterizedRowMapper implementation that converts a row into a new instance of the specified mapped target class. The mapped target class must be a top-level class and it must have a default or no-arg constructor.

Uses Java 5 covariant return types to override the return type of the BeanPropertyRowMapper.mapRow(java.sql.ResultSet, int) method to be the type parameter T.

Column values are mapped based on matching the column name as obtained from result set metadata to public setters for the corresponding properties. The names are matched either directly or by transforming a name separating the parts with underscores to the same name using "camel" case.

Mapping is provided for fields in the target class for many common types, e.g.: String, boolean, Boolean, byte, Byte, short, Short, int, Integer, long, Long, float, Float, double, Double, BigDecimal, java.util.Date, etc.

The mapper can be configured to use the primitives default value when mapping null values by setting the 'primitivesDefaultedForNullValue' flag to 'true'.

To facilitate mapping between columns and fields that don't have matching names, try using column aliases in the SQL statement like "select fname as first_name from customer".

Please note that this class is designed to provide convenience rather than high performance. For best performance consider using a custom RowMapper.

Since:
2.5
Author:
Thomas Risberg, Juergen Hoeller
See Also:
ParameterizedRowMapper

Field Summary
Fields inherited from class org.springframework.jdbc.core.BeanPropertyRowMapper
logger
Constructor Summary
ParameterizedBeanPropertyRowMapper()
Method Summary
static
<T> ParameterizedBeanPropertyRowMapper<T>
newInstance(Class<T> mappedClass)
Static factory method to create a new ParameterizedBeanPropertyRowMapper (with the mapped class specified only once).
Methods inherited from class org.springframework.jdbc.core.BeanPropertyRowMapper
getColumnValue, getMappedClass, initBeanWrapper, initialize, isCheckFullyPopulated, isPrimitivesDefaultedForNullValue, mapRow, setCheckFullyPopulated, setMappedClass, setPrimitivesDefaultedForNullValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.jdbc.core.RowMapper
mapRow

Constructor Detail

ParameterizedBeanPropertyRowMapper

public ParameterizedBeanPropertyRowMapper()
Method Detail

newInstance

public static <T> ParameterizedBeanPropertyRowMapper<T> newInstance(Class<T> mappedClass)
Static factory method to create a new ParameterizedBeanPropertyRowMapper (with the mapped class specified only once).

Parameters:
mappedClass - the class that each row should be mapped to
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ParameterizedSingleColumnRowMapper

org.springframework.jdbc.core.simple
Class ParameterizedSingleColumnRowMapper<T>

java.lang.Object
    extended by  org.springframework.jdbc.core.SingleColumnRowMapper<T>
        extended by  org.springframework.jdbc.core.simple.ParameterizedSingleColumnRowMapper<T>
All Implemented Interfaces:
RowMapper<T>, ParameterizedRowMapper<T>
public class ParameterizedSingleColumnRowMapper<T>
extends SingleColumnRowMapper<T>
implements ParameterizedRowMapper<T>

ParameterizedRowMapper implementation that converts a single column into a single result value per row. Expects to operate on a java.sql.ResultSet that just contains a single column.

The type of the result value for each row can be specified. The value for the single column will be extracted from the ResultSet and converted into the specified target type.

Uses Java 5 covariant return types to override the return type of the SingleColumnRowMapper.mapRow(java.sql.ResultSet, int) method to be the type parameter T.

Since:
2.5.2
Author:
Juergen Hoeller

Constructor Summary
ParameterizedSingleColumnRowMapper()
Method Summary
static
<T> ParameterizedSingleColumnRowMapper<T>
newInstance(Class<T> requiredType)
Static factory method to create a new ParameterizedSingleColumnRowMapper (with the required type specified only once).
Methods inherited from class org.springframework.jdbc.core.SingleColumnRowMapper
convertValueToRequiredType, getColumnValue, getColumnValue, mapRow, setRequiredType
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.jdbc.core.RowMapper
mapRow

Constructor Detail

ParameterizedSingleColumnRowMapper

public ParameterizedSingleColumnRowMapper()
Method Detail

newInstance

public static <T> ParameterizedSingleColumnRowMapper<T> newInstance(Class<T> requiredType)
Static factory method to create a new ParameterizedSingleColumnRowMapper (with the required type specified only once).

Parameters:
requiredType - the type that each result object is expected to match
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleJdbcCall

org.springframework.jdbc.core.simple
Class SimpleJdbcCall

java.lang.Object
    extended by  org.springframework.jdbc.core.simple.AbstractJdbcCall
        extended by  org.springframework.jdbc.core.simple.SimpleJdbcCall
All Implemented Interfaces:
SimpleJdbcCallOperations
public class SimpleJdbcCall
extends AbstractJdbcCall
implements SimpleJdbcCallOperations

A SimpleJdbcCall is a multi-threaded, reusable object representing a call to a stored procedure or a stored function. It provides meta data processing to simplify the code needed to access basic stored procedures/functions. All you need to provide is the name of the procedure/function and a Map containing the parameters when you execute the call. The names of the supplied parameters will be matched up with in and out parameters declared when the stored procedure was created.

The meta data processing is based on the DatabaseMetaData provided by the JDBC driver. Since we rely on the JDBC driver this "auto-detection" can only be used for databases that are known to provide accurate meta data. These currently include Derby, MySQL, Microsoft SQL Server, Oracle, DB2, Sybase and PostgreSQL. For any other databases you are required to declare all parameters explicitly. You can of course declare all parameters explicitly even if the database provides the necessary meta data. In that case your declared parameters will take precedence. You can also turn off any mete data processing if you want to use parameter names that do not match what is declared during the stored procedure compilation.

The actual insert is being handled using Spring's JdbcTemplate.

Many of the configuration methods return the current instance of the SimpleJdbcCall to provide the ability to string multiple ones together in a "fluid" interface style.

Since:
2.5
Author:
Thomas Risberg
See Also:
DatabaseMetaData, JdbcTemplate

Field Summary
Fields inherited from class org.springframework.jdbc.core.simple.AbstractJdbcCall
logger
Constructor Summary
SimpleJdbcCall(DataSource dataSource)
Constructor that takes one parameter with the JDBC DataSource to use when creating the JdbcTemplate.
SimpleJdbcCall(JdbcTemplate jdbcTemplate)
Alternative Constructor that takes one parameter with the JdbcTemplate to be used.
Method Summary
 SimpleJdbcCall declareParameters(SqlParameter... sqlParameters)
Specify one or more parameters if desired.
 Map<String,Object> execute(Map<String,?> args)
Execute the stored procedure and return a map of output params, keyed by name as in parameter declarations..
 Map<String,Object> execute(Object... args)
Execute the stored procedure and return a map of output params, keyed by name as in parameter declarations.
 Map<String,Object> execute(SqlParameterSource parameterSource)
Execute the stored procedure and return a map of output params, keyed by name as in parameter declarations..
<T> T
executeFunction(Class<T> returnType, Map<String,?> args)
Execute the stored function and return the results obtained as an Object of the specified return type.
<T> T
executeFunction(Class<T> returnType, Object... args)
Execute the stored function and return the results obtained as an Object of the specified return type.
<T> T
executeFunction(Class<T> returnType, SqlParameterSource args)
Execute the stored function and return the results obtained as an Object of the specified return type.
<T> T
executeObject(Class<T> returnType, Map<String,?> args)
Execute the stored procedure and return the single out parameter as an Object of the specified return type.
<T> T
executeObject(Class<T> returnType, Object... args)
Execute the stored procedure and return the single out parameter as an Object of the specified return type.
<T> T
executeObject(Class<T> returnType, SqlParameterSource args)
Execute the stored procedure and return the single out parameter as an Object of the specified return type.
 SimpleJdbcCall returningResultSet(String parameterName, ParameterizedRowMapper rowMapper)
Deprecated. in favor of returningResultSet(String, org.springframework.jdbc.core.RowMapper)
 SimpleJdbcCall returningResultSet(String parameterName, RowMapper rowMapper)
Used to specify when a ResultSet is returned by the stored procedure and you want it mapped by a RowMapper.
 SimpleJdbcCall useInParameterNames(String... inParameterNames)
Not used yet
 SimpleJdbcCall withCatalogName(String catalogName)
Optionally, specify the name of the catalog that contins the stored procedure.
 SimpleJdbcCall withFunctionName(String functionName)
Specify the procedure name to be used - this implies that we will be calling a stored function.
 SimpleJdbcCall withoutProcedureColumnMetaDataAccess()
Turn off any processing of parameter meta data information obtained via JDBC.
 SimpleJdbcCall withProcedureName(String procedureName)
Specify the procedure name to be used - this implies that we will be calling a stored procedure.
 SimpleJdbcCall withReturnValue()
Indicates the procedure's return value should be included in the results returned.
 SimpleJdbcCall withSchemaName(String schemaName)
Optionally, specify the name of the schema that contins the stored procedure.
Methods inherited from class org.springframework.jdbc.core.simple.AbstractJdbcCall
addDeclaredParameter, addDeclaredRowMapper, addDeclaredRowMapper, checkCompiled, compile, compileInternal, doExecute, doExecute, doExecute, getCallableStatementFactory, getCallParameters, getCallString, getCatalogName, getInParameterNames, getJdbcTemplate, getProcedureName, getScalarOutParameterName, getSchemaName, isCompiled, isFunction, isReturnValueRequired, matchInParameterValuesWithCallParameters, matchInParameterValuesWithCallParameters, onCompileInternal, setAccessCallParameterMetaData, setCatalogName, setFunction, setInParameterNames, setProcedureName, setReturnValueRequired, setSchemaName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleJdbcCall

public SimpleJdbcCall(DataSource dataSource)
Constructor that takes one parameter with the JDBC DataSource to use when creating the JdbcTemplate.

Parameters:
dataSource - the DataSource to use
See Also:
JdbcAccessor.setDataSource(javax.sql.DataSource)

SimpleJdbcCall

public SimpleJdbcCall(JdbcTemplate jdbcTemplate)
Alternative Constructor that takes one parameter with the JdbcTemplate to be used.

Parameters:
jdbcTemplate - the JdbcTemplate to use
See Also:
JdbcAccessor.setDataSource(javax.sql.DataSource)
Method Detail

withProcedureName

public SimpleJdbcCall withProcedureName(String procedureName)
Description copied from interface: SimpleJdbcCallOperations
Specify the procedure name to be used - this implies that we will be calling a stored procedure.

Specified by:
withProcedureName in interface SimpleJdbcCallOperations
Parameters:
procedureName - the name of the stored procedure
Returns:
the instance of this SimpleJdbcCall

withFunctionName

public SimpleJdbcCall withFunctionName(String functionName)
Description copied from interface: SimpleJdbcCallOperations
Specify the procedure name to be used - this implies that we will be calling a stored function.

Specified by:
withFunctionName in interface SimpleJdbcCallOperations
Parameters:
functionName - the name of the stored function
Returns:
the instance of this SimpleJdbcCall

withSchemaName

public SimpleJdbcCall withSchemaName(String schemaName)
Description copied from interface: SimpleJdbcCallOperations
Optionally, specify the name of the schema that contins the stored procedure.

Specified by:
withSchemaName in interface SimpleJdbcCallOperations
Parameters:
schemaName - the name of the schema
Returns:
the instance of this SimpleJdbcCall

withCatalogName

public SimpleJdbcCall withCatalogName(String catalogName)
Description copied from interface: SimpleJdbcCallOperations
Optionally, specify the name of the catalog that contins the stored procedure. To provide consistency with the Oracle DatabaseMetaData, this is used to specify the package name if the procedure is declared as part of a package.

Specified by:
withCatalogName in interface SimpleJdbcCallOperations
Parameters:
catalogName - the catalog or package name
Returns:
the instance of this SimpleJdbcCall

withReturnValue

public SimpleJdbcCall withReturnValue()
Description copied from interface: SimpleJdbcCallOperations
Indicates the procedure's return value should be included in the results returned.

Specified by:
withReturnValue in interface SimpleJdbcCallOperations
Returns:
the instance of this SimpleJdbcCall

declareParameters

public SimpleJdbcCall declareParameters(SqlParameter... sqlParameters)
Description copied from interface: SimpleJdbcCallOperations
Specify one or more parameters if desired. These parameters will be supplemented with any parameter information retrieved from the database meta data. Note that only parameters declared as SqlParameter and SqlInOutParameter will be used to provide input values. This is different from the StoredProcedure class which for backwards compatibility reasons allows input values to be provided for parameters declared as SqlOutParameter.

Specified by:
declareParameters in interface SimpleJdbcCallOperations
Parameters:
sqlParameters - the parameters to use
Returns:
the instance of this SimpleJdbcCall

useInParameterNames

public SimpleJdbcCall useInParameterNames(String... inParameterNames)
Description copied from interface: SimpleJdbcCallOperations
Not used yet

Specified by:
useInParameterNames in interface SimpleJdbcCallOperations

returningResultSet

public SimpleJdbcCall returningResultSet(String parameterName,
                                         RowMapper rowMapper)
Description copied from interface: SimpleJdbcCallOperations
Used to specify when a ResultSet is returned by the stored procedure and you want it mapped by a RowMapper. The results will be returned using the parameter name specified. Multiple ResultSets must be declared in the correct order. If the database you are using uses ref cursors then the name specified must match the name of the parameter declared for the procedure in the database.

Specified by:
returningResultSet in interface SimpleJdbcCallOperations
Parameters:
parameterName - the name of the returned results and/or the name of the ref cursor parameter
rowMapper - the RowMapper implementation that will map the data returned for each row

returningResultSet

@Deprecated
public SimpleJdbcCall returningResultSet(String parameterName,
                                                    ParameterizedRowMapper rowMapper)
Deprecated. in favor of returningResultSet(String, org.springframework.jdbc.core.RowMapper)

Description copied from interface: SimpleJdbcCallOperations
Used to specify when a ResultSet is returned by the stored procedure and you want it mapped by a RowMapper. The results will be returned using the parameter name specified. Multiple ResultSets must be declared in the correct order. If the database you are using uses ref cursors then the name specified must match the name of the parameter declared for the procedure in the database.

Specified by:
returningResultSet in interface SimpleJdbcCallOperations

withoutProcedureColumnMetaDataAccess

public SimpleJdbcCall withoutProcedureColumnMetaDataAccess()
Description copied from interface: SimpleJdbcCallOperations
Turn off any processing of parameter meta data information obtained via JDBC.

Specified by:
withoutProcedureColumnMetaDataAccess in interface SimpleJdbcCallOperations
Returns:
the instance of this SimpleJdbcCall

executeFunction

public <T> T executeFunction(Class<T> returnType,
                             Object... args)
Description copied from interface: SimpleJdbcCallOperations
Execute the stored function and return the results obtained as an Object of the specified return type.

Specified by:
executeFunction in interface SimpleJdbcCallOperations
Parameters:
returnType - the type of the value to return
args - optional array containing the in parameter values to be used in the call. Parameter values must be provided in the same order as the parameters are defined for the stored procedure.

executeFunction

public <T> T executeFunction(Class<T> returnType,
                             Map<String,?> args)
Description copied from interface: SimpleJdbcCallOperations
Execute the stored function and return the results obtained as an Object of the specified return type.

Specified by:
executeFunction in interface SimpleJdbcCallOperations
Parameters:
returnType - the type of the value to return
args - Map containing the parameter values to be used in the call.

executeFunction

public <T> T executeFunction(Class<T> returnType,
                             SqlParameterSource args)
Description copied from interface: SimpleJdbcCallOperations
Execute the stored function and return the results obtained as an Object of the specified return type.

Specified by:
executeFunction in interface SimpleJdbcCallOperations
Parameters:
returnType - the type of the value to return
args - MapSqlParameterSource containing the parameter values to be used in the call.

executeObject

public <T> T executeObject(Class<T> returnType,
                           Object... args)
Description copied from interface: SimpleJdbcCallOperations
Execute the stored procedure and return the single out parameter as an Object of the specified return type. In the case where there are multiple out parameters, the first one is returned and additional out parameters are ignored.

Specified by:
executeObject in interface SimpleJdbcCallOperations
Parameters:
returnType - the type of the value to return
args - optional array containing the in parameter values to be used in the call. Parameter values must be provided in the same order as the parameters are defined for the stored procedure.

executeObject

public <T> T executeObject(Class<T> returnType,
                           Map<String,?> args)
Description copied from interface: SimpleJdbcCallOperations
Execute the stored procedure and return the single out parameter as an Object of the specified return type. In the case where there are multiple out parameters, the first one is returned and additional out parameters are ignored.

Specified by:
executeObject in interface SimpleJdbcCallOperations
Parameters:
returnType - the type of the value to return
args - Map containing the parameter values to be used in the call.

executeObject

public <T> T executeObject(Class<T> returnType,
                           SqlParameterSource args)
Description copied from interface: SimpleJdbcCallOperations
Execute the stored procedure and return the single out parameter as an Object of the specified return type. In the case where there are multiple out parameters, the first one is returned and additional out parameters are ignored.

Specified by:
executeObject in interface SimpleJdbcCallOperations
Parameters:
returnType - the type of the value to return
args - MapSqlParameterSource containing the parameter values to be used in the call.

execute

public Map<String,Object> execute(Object... args)
Description copied from interface: SimpleJdbcCallOperations
Execute the stored procedure and return a map of output params, keyed by name as in parameter declarations.

Specified by:
execute in interface SimpleJdbcCallOperations
Parameters:
args - optional array containing the in parameter values to be used in the call. Parameter values must be provided in the same order as the parameters are defined for the stored procedure.
Returns:
map of output params.

execute

public Map<String,Object> execute(Map<String,?> args)
Description copied from interface: SimpleJdbcCallOperations
Execute the stored procedure and return a map of output params, keyed by name as in parameter declarations..

Specified by:
execute in interface SimpleJdbcCallOperations
Parameters:
args - Map containing the parameter values to be used in the call.
Returns:
map of output params.

execute

public Map<String,Object> execute(SqlParameterSource parameterSource)
Description copied from interface: SimpleJdbcCallOperations
Execute the stored procedure and return a map of output params, keyed by name as in parameter declarations..

Specified by:
execute in interface SimpleJdbcCallOperations
Parameters:
parameterSource - SqlParameterSource containing the parameter values to be used in the call.
Returns:
map of output params.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleJdbcDaoSupport

org.springframework.jdbc.core.simple
Class SimpleJdbcDaoSupport

java.lang.Object
    extended by  org.springframework.dao.support.DaoSupport
        extended by  org.springframework.jdbc.core.support.JdbcDaoSupport
            extended by  org.springframework.jdbc.core.simple.SimpleJdbcDaoSupport
All Implemented Interfaces:
InitializingBean
public class SimpleJdbcDaoSupport
extends JdbcDaoSupport

Extension of JdbcDaoSupport that exposes a SimpleJdbcTemplate as well. Only usable on Java 5 and above.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller
See Also:
SimpleJdbcTemplate

Field Summary
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
Constructor Summary
SimpleJdbcDaoSupport()
Method Summary
SimpleJdbcTemplate | getSimpleJdbcTemplate() Return a SimpleJdbcTemplate wrapping the configured JdbcTemplate.
protected void | initTemplateConfig() Create a SimpleJdbcTemplate based on the configured JdbcTemplate.
Methods inherited from class org.springframework.jdbc.core.support.JdbcDaoSupport
checkDaoConfig, createJdbcTemplate, getConnection, getDataSource, getExceptionTranslator, getJdbcTemplate, releaseConnection, setDataSource, setJdbcTemplate
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleJdbcDaoSupport

public SimpleJdbcDaoSupport()
Method Detail

initTemplateConfig

protected void initTemplateConfig()
Create a SimpleJdbcTemplate based on the configured JdbcTemplate.

Overrides:
initTemplateConfig in class JdbcDaoSupport
See Also:
JdbcDaoSupport.getJdbcTemplate()

getSimpleJdbcTemplate

public SimpleJdbcTemplate getSimpleJdbcTemplate()
Return a SimpleJdbcTemplate wrapping the configured JdbcTemplate.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleJdbcInsert

org.springframework.jdbc.core.simple
Class SimpleJdbcInsert

java.lang.Object
    extended by  org.springframework.jdbc.core.simple.AbstractJdbcInsert
        extended by  org.springframework.jdbc.core.simple.SimpleJdbcInsert
All Implemented Interfaces:
SimpleJdbcInsertOperations
public class SimpleJdbcInsert
extends AbstractJdbcInsert
implements SimpleJdbcInsertOperations

A SimpleJdbcInsert is a multi-threaded, reusable object providing easy insert capabilities for a table. It provides meta data processing to simplify the code needed to construct a basic insert statement. All you need to provide is the name of the table and a Map containing the column names and the column values.

The meta data processing is based on the DatabaseMetaData provided by the JDBC driver. As long as the JBDC driver can provide the names of the columns for a specified table than we can rely on this auto-detection feature. If that is not the case then the column names must be specified explicitly.

The actual insert is being handled using Spring's JdbcTemplate.

Many of the configuration methods return the current instance of the SimpleJdbcInsert to provide the ability to string multiple ones together in a "fluid" interface style.

Since:
2.5
Author:
Thomas Risberg
See Also:
DatabaseMetaData, JdbcTemplate

Field Summary
Fields inherited from class org.springframework.jdbc.core.simple.AbstractJdbcInsert
logger
Constructor Summary
SimpleJdbcInsert(DataSource dataSource)
Constructor that takes one parameter with the JDBC DataSource to use when creating the JdbcTemplate.
SimpleJdbcInsert(JdbcTemplate jdbcTemplate)
Alternative Constructor that takes one parameter with the JdbcTemplate to be used.
Method Summary
int | execute(Map<String,Object> args) Execute the insert using the values passed in.
int | execute(SqlParameterSource parameterSource) Execute the insert using the values passed in.
Number | executeAndReturnKey(Map<String,Object> args) Execute the insert using the values passed in and return the generated key.
Number | executeAndReturnKey(SqlParameterSource parameterSource) Execute the insert using the values passed in and return the generated key.
KeyHolder | executeAndReturnKeyHolder(Map<String,Object> args) Execute the insert using the values passed in and return the generated keys.
KeyHolder | executeAndReturnKeyHolder(SqlParameterSource parameterSource) Execute the insert using the values passed in and return the generated keys.
int[] | executeBatch(Map<String,Object>[] batch) Execute a batch insert using the batch of values passed in.
int[] | executeBatch(SqlParameterSource[] batch) Execute a batch insert using the batch of values passed in.
SimpleJdbcInsertOperations | includeSynonymsForTableColumnMetaData() Include synonyms for the column meta data lookups via JDBC.
SimpleJdbcInsert | usingColumns(String... columnNames) Specify the column names that the insert statement should be limited to use.
SimpleJdbcInsert | usingGeneratedKeyColumns(String... columnNames) Specify the name sof any columns that have auto generated keys.
SimpleJdbcInsert | withCatalogName(String catalogName) Specify the catalog name, if any, to be used for the insert.
SimpleJdbcInsertOperations | withoutTableColumnMetaDataAccess() Turn off any processing of column meta data information obtained via JDBC.
SimpleJdbcInsert | withSchemaName(String schemaName) Specify the shema name, if any, to be used for the insert.
SimpleJdbcInsert | withTableName(String tableName) Specify the table name to be used for the insert.
Methods inherited from class org.springframework.jdbc.core.simple.AbstractJdbcInsert
checkCompiled, checkIfConfigurationModificationIsAllowed, compile, compileInternal, doExecute, doExecute, doExecuteAndReturnKey, doExecuteAndReturnKey, doExecuteAndReturnKeyHolder, doExecuteAndReturnKeyHolder, doExecuteBatch, doExecuteBatch, getCatalogName, getColumnNames, getGeneratedKeyNames, getInsertString, getInsertTypes, getJdbcTemplate, getSchemaName, getTableName, isCompiled, matchInParameterValuesWithInsertColumns, matchInParameterValuesWithInsertColumns, onCompileInternal, setAccessTableColumnMetaData, setCatalogName, setColumnNames, setGeneratedKeyName, setGeneratedKeyNames, setOverrideIncludeSynonymsDefault, setSchemaName, setTableName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleJdbcInsert

public SimpleJdbcInsert(DataSource dataSource)
Constructor that takes one parameter with the JDBC DataSource to use when creating the JdbcTemplate.

Parameters:
dataSource - the DataSource to use
See Also:
JdbcAccessor.setDataSource(javax.sql.DataSource)

SimpleJdbcInsert

public SimpleJdbcInsert(JdbcTemplate jdbcTemplate)
Alternative Constructor that takes one parameter with the JdbcTemplate to be used.

Parameters:
jdbcTemplate - the JdbcTemplate to use
See Also:
JdbcAccessor.setDataSource(javax.sql.DataSource)
Method Detail

withTableName

public SimpleJdbcInsert withTableName(String tableName)
Description copied from interface: SimpleJdbcInsertOperations
Specify the table name to be used for the insert.

Specified by:
withTableName in interface SimpleJdbcInsertOperations
Parameters:
tableName - the name of the stored table
Returns:
the instance of this SimpleJdbcInsert

withSchemaName

public SimpleJdbcInsert withSchemaName(String schemaName)
Description copied from interface: SimpleJdbcInsertOperations
Specify the shema name, if any, to be used for the insert.

Specified by:
withSchemaName in interface SimpleJdbcInsertOperations
Parameters:
schemaName - the name of the schema
Returns:
the instance of this SimpleJdbcInsert

withCatalogName

public SimpleJdbcInsert withCatalogName(String catalogName)
Description copied from interface: SimpleJdbcInsertOperations
Specify the catalog name, if any, to be used for the insert.

Specified by:
withCatalogName in interface SimpleJdbcInsertOperations
Parameters:
catalogName - the name of the catalog
Returns:
the instance of this SimpleJdbcInsert

usingColumns

public SimpleJdbcInsert usingColumns(String... columnNames)
Description copied from interface: SimpleJdbcInsertOperations
Specify the column names that the insert statement should be limited to use.

Specified by:
usingColumns in interface SimpleJdbcInsertOperations
Parameters:
columnNames - one or more column names
Returns:
the instance of this SimpleJdbcInsert

usingGeneratedKeyColumns

public SimpleJdbcInsert usingGeneratedKeyColumns(String... columnNames)
Description copied from interface: SimpleJdbcInsertOperations
Specify the name sof any columns that have auto generated keys.

Specified by:
usingGeneratedKeyColumns in interface SimpleJdbcInsertOperations
Parameters:
columnNames - one or more column names
Returns:
the instance of this SimpleJdbcInsert

withoutTableColumnMetaDataAccess

public SimpleJdbcInsertOperations withoutTableColumnMetaDataAccess()
Description copied from interface: SimpleJdbcInsertOperations
Turn off any processing of column meta data information obtained via JDBC.

Specified by:
withoutTableColumnMetaDataAccess in interface SimpleJdbcInsertOperations
Returns:
the instance of this SimpleJdbcInsert

includeSynonymsForTableColumnMetaData

public SimpleJdbcInsertOperations includeSynonymsForTableColumnMetaData()
Description copied from interface: SimpleJdbcInsertOperations
Include synonyms for the column meta data lookups via JDBC. Note: this is only necessary to include for Oracle since other databases supporting synonyms seems to include the synonyms automatically.

Specified by:
includeSynonymsForTableColumnMetaData in interface SimpleJdbcInsertOperations
Returns:
the instance of this SimpleJdbcInsert

execute

public int execute(Map<String,Object> args)
Description copied from interface: SimpleJdbcInsertOperations
Execute the insert using the values passed in.

Specified by:
execute in interface SimpleJdbcInsertOperations
Parameters:
args - Map containing column names and corresponding value
Returns:
the number of rows affected as returned by the JDBC driver

execute

public int execute(SqlParameterSource parameterSource)
Description copied from interface: SimpleJdbcInsertOperations
Execute the insert using the values passed in.

Specified by:
execute in interface SimpleJdbcInsertOperations
Parameters:
parameterSource - SqlParameterSource containing values to use for insert
Returns:
the number of rows affected as returned by the JDBC driver

executeAndReturnKey

public Number executeAndReturnKey(Map<String,Object> args)
Description copied from interface: SimpleJdbcInsertOperations
Execute the insert using the values passed in and return the generated key. This requires that the name of the columns with auto generated keys have been specified. This method will always return a key or throw an exception if a key was not returned.

Specified by:
executeAndReturnKey in interface SimpleJdbcInsertOperations
Parameters:
args - Map containing column names and corresponding value
Returns:
the generated key value

executeAndReturnKey

public Number executeAndReturnKey(SqlParameterSource parameterSource)
Description copied from interface: SimpleJdbcInsertOperations
Execute the insert using the values passed in and return the generated key. This requires that the name of the columns with auto generated keys have been specified. This method will always return a key or throw an exception if a key was not returned.

Specified by:
executeAndReturnKey in interface SimpleJdbcInsertOperations
Parameters:
parameterSource - SqlParameterSource containing values to use for insert
Returns:
the generated key value.

executeAndReturnKeyHolder

public KeyHolder executeAndReturnKeyHolder(Map<String,Object> args)
Description copied from interface: SimpleJdbcInsertOperations
Execute the insert using the values passed in and return the generated keys. This requires that the name of the columns with auto generated keys have been specified. This method will always return a KeyHolder but the caller must verify that it actually contains the generated keys.

Specified by:
executeAndReturnKeyHolder in interface SimpleJdbcInsertOperations
Parameters:
args - Map containing column names and corresponding value
Returns:
the KeyHolder containing all generated keys

executeAndReturnKeyHolder

public KeyHolder executeAndReturnKeyHolder(SqlParameterSource parameterSource)
Description copied from interface: SimpleJdbcInsertOperations
Execute the insert using the values passed in and return the generated keys. This requires that the name of the columns with auto generated keys have been specified. This method will always return a KeyHolder but the caller must verify that it actually contains the generated keys.

Specified by:
executeAndReturnKeyHolder in interface SimpleJdbcInsertOperations
Parameters:
parameterSource - SqlParameterSource containing values to use for insert
Returns:
the KeyHolder containing all generated keys

executeBatch

public int[] executeBatch(Map<String,Object>[] batch)
Description copied from interface: SimpleJdbcInsertOperations
Execute a batch insert using the batch of values passed in.

Specified by:
executeBatch in interface SimpleJdbcInsertOperations
Parameters:
batch - an array of Maps containing a batch of column names and corresponding value
Returns:
the array of number of rows affected as returned by the JDBC driver

executeBatch

public int[] executeBatch(SqlParameterSource[] batch)
Description copied from interface: SimpleJdbcInsertOperations
Execute a batch insert using the batch of values passed in.

Specified by:
executeBatch in interface SimpleJdbcInsertOperations
Parameters:
batch - an array of SqlParameterSource containing values for the batch
Returns:
the array of number of rows affected as returned by the JDBC driver
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleJdbcTemplate

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.core.simple
Class SimpleJdbcTemplate

java.lang.Object
    extended by  org.springframework.jdbc.core.simple.SimpleJdbcTemplate
All Implemented Interfaces:
SimpleJdbcOperations
public class SimpleJdbcTemplate
extends Object
implements SimpleJdbcOperations

Java-5-based convenience wrapper for the classic Spring JdbcTemplate, taking advantage of varargs and autoboxing, and exposing only the most commonly required operations in order to simplify JdbcTemplate usage.

Use the getJdbcOperations() method (or a straight JdbcTemplate) if you need to invoke less commonly used template methods. This includes any methods specifying SQL types, methods using less commonly used callbacks such as RowCallbackHandler, updates with PreparedStatementSetters rather than argument arrays, and stored procedures as well as batch operations.

Since:
2.0
Author:
Rod Johnson, Rob Harrop, Juergen Hoeller, Thomas Risberg
See Also:
ParameterizedRowMapper, SimpleJdbcDaoSupport, JdbcTemplate

Constructor Summary
SimpleJdbcTemplate(DataSource dataSource)
Create a new SimpleJdbcTemplate for the given DataSource.
SimpleJdbcTemplate(JdbcOperations classicJdbcTemplate)
Create a new SimpleJdbcTemplate for the given classic Spring JdbcTemplate.
SimpleJdbcTemplate(NamedParameterJdbcOperations namedParameterJdbcTemplate)
Create a new SimpleJdbcTemplate for the given Spring NamedParameterJdbcTemplate.
Method Summary
 int[] batchUpdate(String sql, List<Object[]> batchArgs)
Execute a batch using the supplied SQL statement with the batch of supplied arguments.
 int[] batchUpdate(String sql, List<Object[]> batchArgs, int[] argTypes)
Execute a batch using the supplied SQL statement with the batch of supplied arguments.
 int[] batchUpdate(String sql, Map<String,?>[] batchValues)
Executes a batch using the supplied SQL statement with the batch of supplied arguments.
 int[] batchUpdate(String sql, SqlParameterSource[] batchArgs)
Execute a batch using the supplied SQL statement with the batch of supplied arguments.
 JdbcOperations getJdbcOperations()
Expose the classic Spring JdbcTemplate to allow invocation of less commonly used methods.
 NamedParameterJdbcOperations getNamedParameterJdbcOperations()
Expose the Spring NamedParameterJdbcTemplate to allow invocation of less commonly used methods.
<T> List<T>
query(String sql, ParameterizedRowMapper<T> rm, Map<String,?> args)
Deprecated.
<T> List<T>
query(String sql, ParameterizedRowMapper<T> rm, Object... args)
Deprecated.
<T> List<T>
query(String sql, ParameterizedRowMapper<T> rm, SqlParameterSource args)
Deprecated.
<T> List<T>
query(String sql, RowMapper<T> rm, Map<String,?> args)
Query for a List of Objects of type T using the supplied RowMapper to the query results to the object.
<T> List<T>
query(String sql, RowMapper<T> rm, Object... args)
Query for a List of Objects of type T using the supplied RowMapper to the query results to the object.
<T> List<T>
query(String sql, RowMapper<T> rm, SqlParameterSource args)
Query for a List of Objects of type T using the supplied RowMapper to the query results to the object.
 int queryForInt(String sql, Map<String,?> args)
Query for an int passing in a SQL query using the named parameter support provided by the NamedParameterJdbcTemplate and a map containing the arguments.
 int queryForInt(String sql, Object... args)
Query for an int passing in a SQL query using the standard '?' placeholders for parameters and a variable number of arguments.
 int queryForInt(String sql, SqlParameterSource args)
Query for an int passing in a SQL query using the named parameter support provided by the NamedParameterJdbcTemplate and a SqlParameterSource containing the arguments.
 List<Map<String,Object>> queryForList(String sql, Map<String,?> args)
Execute the supplied query with the supplied arguments.
 List<Map<String,Object>> queryForList(String sql, Object... args)
Execute the supplied query with the (optional) supplied arguments.
 List<Map<String,Object>> queryForList(String sql, SqlParameterSource args)
Execute the supplied query with the supplied arguments.
 long queryForLong(String sql, Map<String,?> args)
Query for an long passing in a SQL query using the named parameter support provided by the NamedParameterJdbcTemplate and a map containing the arguments.
 long queryForLong(String sql, Object... args)
Query for an long passing in a SQL query using the standard '?' placeholders for parameters and a variable number of arguments.
 long queryForLong(String sql, SqlParameterSource args)
Query for an long passing in a SQL query using the named parameter support provided by the NamedParameterJdbcTemplate and a SqlParameterSource containing the arguments.
 Map<String,Object> queryForMap(String sql, Map<String,?> args)
Execute the supplied query with the supplied arguments.
 Map<String,Object> queryForMap(String sql, Object... args)
Execute the supplied query with the (optional) supplied arguments.
 Map<String,Object> queryForMap(String sql, SqlParameterSource args)
Execute the supplied query with the supplied arguments.
<T> T
queryForObject(String sql, Class<T> requiredType, Map<String,?> args)
Query for an object of type T identified by the supplied @Class.
<T> T
queryForObject(String sql, Class<T> requiredType, Object... args)
Query for an object of type T identified by the supplied @Class.
<T> T
queryForObject(String sql, Class<T> requiredType, SqlParameterSource args)
Query for an object of type T identified by the supplied @Class.
<T> T
queryForObject(String sql, ParameterizedRowMapper<T> rm, Map<String,?> args)
Deprecated.
<T> T
queryForObject(String sql, ParameterizedRowMapper<T> rm, Object... args)
Deprecated.
<T> T
queryForObject(String sql, ParameterizedRowMapper<T> rm, SqlParameterSource args)
Deprecated.
<T> T
queryForObject(String sql, RowMapper<T> rm, Map<String,?> args)
Query for an object of type T using the supplied RowMapper to the query results to the object.
<T> T
queryForObject(String sql, RowMapper<T> rm, Object... args)
Query for an object of type T using the supplied RowMapper to the query results to the object.
<T> T
queryForObject(String sql, RowMapper<T> rm, SqlParameterSource args)
Query for an object of type T using the supplied RowMapper to the query results to the object.
 int update(String sql, Map<String,?> args)
Execute the supplied SQL statement with (optional) supplied arguments.
 int update(String sql, Object... args)
Execute the supplied SQL statement with supplied arguments.
 int update(String sql, SqlParameterSource args)
Execute the supplied SQL statement with supplied arguments.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleJdbcTemplate

public SimpleJdbcTemplate(DataSource dataSource)
Create a new SimpleJdbcTemplate for the given DataSource.

Creates a classic Spring JdbcTemplate and wraps it.

Parameters:
dataSource - the JDBC DataSource to access

SimpleJdbcTemplate

public SimpleJdbcTemplate(JdbcOperations classicJdbcTemplate)
Create a new SimpleJdbcTemplate for the given classic Spring JdbcTemplate.

Parameters:
classicJdbcTemplate - the classic Spring JdbcTemplate to wrap

SimpleJdbcTemplate

public SimpleJdbcTemplate(NamedParameterJdbcOperations namedParameterJdbcTemplate)
Create a new SimpleJdbcTemplate for the given Spring NamedParameterJdbcTemplate.

Parameters:
namedParameterJdbcTemplate - the Spring NamedParameterJdbcTemplate to wrap
Method Detail

getJdbcOperations

public JdbcOperations getJdbcOperations()
Expose the classic Spring JdbcTemplate to allow invocation of less commonly used methods.

Specified by:
getJdbcOperations in interface SimpleJdbcOperations

getNamedParameterJdbcOperations

public NamedParameterJdbcOperations getNamedParameterJdbcOperations()
Expose the Spring NamedParameterJdbcTemplate to allow invocation of less commonly used methods.

Specified by:
getNamedParameterJdbcOperations in interface SimpleJdbcOperations

queryForInt

public int queryForInt(String sql,
                       Map<String,?> args)
                throws DataAccessException
Description copied from interface: SimpleJdbcOperations
Query for an int passing in a SQL query using the named parameter support provided by the NamedParameterJdbcTemplate and a map containing the arguments.

Specified by:
queryForInt in interface SimpleJdbcOperations
Parameters:
sql - the SQL query to run.
args - the map containing the arguments for the query
Throws:
DataAccessException

queryForInt

public int queryForInt(String sql,
                       SqlParameterSource args)
                throws DataAccessException
Description copied from interface: SimpleJdbcOperations
Query for an int passing in a SQL query using the named parameter support provided by the NamedParameterJdbcTemplate and a SqlParameterSource containing the arguments.

Specified by:
queryForInt in interface SimpleJdbcOperations
Parameters:
sql - the SQL query to run.
args - the SqlParameterSource containing the arguments for the query.
Throws:
DataAccessException

queryForInt

public int queryForInt(String sql,
                       Object... args)
                throws DataAccessException
Description copied from interface: SimpleJdbcOperations
Query for an int passing in a SQL query using the standard '?' placeholders for parameters and a variable number of arguments.

Specified by:
queryForInt in interface SimpleJdbcOperations
Parameters:
sql - the SQL query to run.
args - the variable number of arguments for the query
Throws:
DataAccessException

queryForLong

public long queryForLong(String sql,
                         Map<String,?> args)
                  throws DataAccessException
Description copied from interface: SimpleJdbcOperations
Query for an long passing in a SQL query using the named parameter support provided by the NamedParameterJdbcTemplate and a map containing the arguments.

Specified by:
queryForLong in interface SimpleJdbcOperations
Parameters:
sql - the SQL query to run.
args - the map containing the arguments for the query
Throws:
DataAccessException

queryForLong

public long queryForLong(String sql,
                         SqlParameterSource args)
                  throws DataAccessException
Description copied from interface: SimpleJdbcOperations
Query for an long passing in a SQL query using the named parameter support provided by the NamedParameterJdbcTemplate and a SqlParameterSource containing the arguments.

Specified by:
queryForLong in interface SimpleJdbcOperations
Parameters:
sql - the SQL query to run.
args - the SqlParameterSource containing the arguments for the query
Throws:
DataAccessException

queryForLong

public long queryForLong(String sql,
                         Object... args)
                  throws DataAccessException
Description copied from interface: SimpleJdbcOperations
Query for an long passing in a SQL query using the standard '?' placeholders for parameters and a variable number of arguments.

Specified by:
queryForLong in interface SimpleJdbcOperations
Parameters:
sql - the SQL query to run.
args - the variable number of arguments for the query
Throws:
DataAccessException

queryForObject

public <T> T queryForObject(String sql,
                            Class<T> requiredType,
                            Map<String,?> args)
                 throws DataAccessException
Description copied from interface: SimpleJdbcOperations
Query for an object of type T identified by the supplied @Class. Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Specified by:
queryForObject in interface SimpleJdbcOperations
Parameters:
sql - the SQL query to run
requiredType - the required type of the return value
args - the map containing the arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForObject(String, Class), JdbcOperations.queryForObject(String, Object[], Class)

queryForObject

public <T> T queryForObject(String sql,
                            Class<T> requiredType,
                            SqlParameterSource args)
                 throws DataAccessException
Description copied from interface: SimpleJdbcOperations
Query for an object of type T identified by the supplied @Class. Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Specified by:
queryForObject in interface SimpleJdbcOperations
Parameters:
sql - the SQL query to run
requiredType - the required type of the return value
args - the SqlParameterSource containing the arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForObject(String, Class), JdbcOperations.queryForObject(String, Object[], Class)

queryForObject

public <T> T queryForObject(String sql,
                            Class<T> requiredType,
                            Object... args)
                 throws DataAccessException
Description copied from interface: SimpleJdbcOperations
Query for an object of type T identified by the supplied @Class. Uses sql with the standard '?' placeholders for parameters

Specified by:
queryForObject in interface SimpleJdbcOperations
Parameters:
sql - the SQL query to run
requiredType - the required type of the return value
args - the variable number of arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForObject(String, Class), JdbcOperations.queryForObject(String, Object[], Class)

queryForObject

public <T> T queryForObject(String sql,
                            RowMapper<T> rm,
                            Map<String,?> args)
                 throws DataAccessException
Description copied from interface: SimpleJdbcOperations
Query for an object of type T using the supplied RowMapper to the query results to the object. Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Specified by:
queryForObject in interface SimpleJdbcOperations
Parameters:
sql - the SQL query to run
rm - the @RowMapper to use for result mapping
args - the map containing the arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper), JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)

queryForObject

@Deprecated
public <T> T queryForObject(String sql,
                                       ParameterizedRowMapper<T> rm,
                                       Map<String,?> args)
                 throws DataAccessException
Deprecated.

Description copied from interface: SimpleJdbcOperations
Query for an object of type T using the supplied ParameterizedRowMapper to the query results to the object. Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Specified by:
queryForObject in interface SimpleJdbcOperations
Parameters:
sql - the SQL query to run
rm - the @ParameterizedRowMapper to use for result mapping
args - the map containing the arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper), JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)

queryForObject

public <T> T queryForObject(String sql,
                            RowMapper<T> rm,
                            SqlParameterSource args)
                 throws DataAccessException
Description copied from interface: SimpleJdbcOperations
Query for an object of type T using the supplied RowMapper to the query results to the object. Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Specified by:
queryForObject in interface SimpleJdbcOperations
Parameters:
sql - the SQL query to run
rm - the @RowMapper to use for result mapping
args - the SqlParameterSource containing the arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper), JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)

queryForObject

@Deprecated
public <T> T queryForObject(String sql,
                                       ParameterizedRowMapper<T> rm,
                                       SqlParameterSource args)
                 throws DataAccessException
Deprecated.

Description copied from interface: SimpleJdbcOperations
Query for an object of type T using the supplied ParameterizedRowMapper to the query results to the object. Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Specified by:
queryForObject in interface SimpleJdbcOperations
Parameters:
sql - the SQL query to run
rm - the @ParameterizedRowMapper to use for result mapping
args - the SqlParameterSource containing the arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper), JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)

queryForObject

public <T> T queryForObject(String sql,
                            RowMapper<T> rm,
                            Object... args)
                 throws DataAccessException
Description copied from interface: SimpleJdbcOperations
Query for an object of type T using the supplied RowMapper to the query results to the object. Uses sql with the standard '?' placeholders for parameters

Specified by:
queryForObject in interface SimpleJdbcOperations
Parameters:
sql - the SQL query to run
rm - the @RowMapper to use for result mapping
args - the variable number of arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper), JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)

queryForObject

@Deprecated
public <T> T queryForObject(String sql,
                                       ParameterizedRowMapper<T> rm,
                                       Object... args)
                 throws DataAccessException
Deprecated.

Description copied from interface: SimpleJdbcOperations
Query for an object of type T using the supplied ParameterizedRowMapper to the query results to the object. Uses sql with the standard '?' placeholders for parameters

Specified by:
queryForObject in interface SimpleJdbcOperations
Parameters:
sql - the SQL query to run
rm - the @ParameterizedRowMapper to use for result mapping
args - the variable number of arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper), JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)

query

public <T> List<T> query(String sql,
                         RowMapper<T> rm,
                         Map<String,?> args)
              throws DataAccessException
Description copied from interface: SimpleJdbcOperations
Query for a List of Objects of type T using the supplied RowMapper to the query results to the object. Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Specified by:
query in interface SimpleJdbcOperations
Parameters:
sql - the SQL query to run
rm - the @RowMapper to use for result mapping
args - the map containing the arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper), JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)

query

@Deprecated
public <T> List<T> query(String sql,
                                    ParameterizedRowMapper<T> rm,
                                    Map<String,?> args)
              throws DataAccessException
Deprecated.

Description copied from interface: SimpleJdbcOperations
Query for a List of Objects of type T using the supplied ParameterizedRowMapper to the query results to the object. Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Specified by:
query in interface SimpleJdbcOperations
Parameters:
sql - the SQL query to run
rm - the @ParameterizedRowMapper to use for result mapping
args - the map containing the arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper), JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)

query

public <T> List<T> query(String sql,
                         RowMapper<T> rm,
                         SqlParameterSource args)
              throws DataAccessException
Description copied from interface: SimpleJdbcOperations
Query for a List of Objects of type T using the supplied RowMapper to the query results to the object. Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Specified by:
query in interface SimpleJdbcOperations
Parameters:
sql - the SQL query to run
rm - the @RowMapper to use for result mapping
args - the SqlParameterSource containing the arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper), JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)

query

@Deprecated
public <T> List<T> query(String sql,
                                    ParameterizedRowMapper<T> rm,
                                    SqlParameterSource args)
              throws DataAccessException
Deprecated.

Description copied from interface: SimpleJdbcOperations
Query for a List of Objects of type T using the supplied ParameterizedRowMapper to the query results to the object. Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Specified by:
query in interface SimpleJdbcOperations
Parameters:
sql - the SQL query to run
rm - the @ParameterizedRowMapper to use for result mapping
args - the SqlParameterSource containing the arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper), JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)

query

public <T> List<T> query(String sql,
                         RowMapper<T> rm,
                         Object... args)
              throws DataAccessException
Description copied from interface: SimpleJdbcOperations
Query for a List of Objects of type T using the supplied RowMapper to the query results to the object. Uses sql with the standard '?' placeholders for parameters

Specified by:
query in interface SimpleJdbcOperations
Parameters:
sql - the SQL query to run
rm - the @RowMapper to use for result mapping
args - the variable number of arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper), JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)

query

@Deprecated
public <T> List<T> query(String sql,
                                    ParameterizedRowMapper<T> rm,
                                    Object... args)
              throws DataAccessException
Deprecated.

Description copied from interface: SimpleJdbcOperations
Query for a List of Objects of type T using the supplied ParameterizedRowMapper to the query results to the object. Uses sql with the standard '?' placeholders for parameters

Specified by:
query in interface SimpleJdbcOperations
Parameters:
sql - the SQL query to run
rm - the @ParameterizedRowMapper to use for result mapping
args - the variable number of arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForObject(String, org.springframework.jdbc.core.RowMapper), JdbcOperations.queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)

queryForMap

public Map<String,Object> queryForMap(String sql,
                                      Map<String,?> args)
                               throws DataAccessException
Description copied from interface: SimpleJdbcOperations
Execute the supplied query with the supplied arguments.

The query is expected to be a single row query; the result row will be mapped to a Map (one entry for each column, using the column name as the key). Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Specified by:
queryForMap in interface SimpleJdbcOperations
Parameters:
sql - the SQL query to run
args - the map containing the arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForMap(String), JdbcOperations.queryForMap(String, Object[])

queryForMap

public Map<String,Object> queryForMap(String sql,
                                      SqlParameterSource args)
                               throws DataAccessException
Description copied from interface: SimpleJdbcOperations
Execute the supplied query with the supplied arguments.

The query is expected to be a single row query; the result row will be mapped to a Map (one entry for each column, using the column name as the key). Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Specified by:
queryForMap in interface SimpleJdbcOperations
Parameters:
sql - the SQL query to run
args - the SqlParameterSource containing the arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForMap(String), JdbcOperations.queryForMap(String, Object[])

queryForMap

public Map<String,Object> queryForMap(String sql,
                                      Object... args)
                               throws DataAccessException
Description copied from interface: SimpleJdbcOperations
Execute the supplied query with the (optional) supplied arguments.

The query is expected to be a single row query; the result row will be mapped to a Map (one entry for each column, using the column name as the key). Uses sql with the standard '?' placeholders for parameters

Specified by:
queryForMap in interface SimpleJdbcOperations
Parameters:
sql - the SQL query to run
args - the variable number of arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForMap(String), JdbcOperations.queryForMap(String, Object[])

queryForList

public List<Map<String,Object>> queryForList(String sql,
                                             Map<String,?> args)
                                      throws DataAccessException
Description copied from interface: SimpleJdbcOperations
Execute the supplied query with the supplied arguments.

Each element in the returned List is constructed as a Map as described in SimpleJdbcOperations.queryForMap(java.lang.String, java.util.Map) Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Specified by:
queryForList in interface SimpleJdbcOperations
Parameters:
sql - the SQL query to run
args - the map containing the arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForList(String), JdbcOperations.queryForList(String, Object[])

queryForList

public List<Map<String,Object>> queryForList(String sql,
                                             SqlParameterSource args)
                                      throws DataAccessException
Description copied from interface: SimpleJdbcOperations
Execute the supplied query with the supplied arguments.

Each element in the returned List is constructed as a Map as described in SimpleJdbcOperations.queryForMap(java.lang.String, java.util.Map) Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Specified by:
queryForList in interface SimpleJdbcOperations
Parameters:
sql - the SQL query to run
args - the SqlParameterSource containing the arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForList(String), JdbcOperations.queryForList(String, Object[])

queryForList

public List<Map<String,Object>> queryForList(String sql,
                                             Object... args)
                                      throws DataAccessException
Description copied from interface: SimpleJdbcOperations
Execute the supplied query with the (optional) supplied arguments.

Each element in the returned List is constructed as a Map as described in SimpleJdbcOperations.queryForMap(java.lang.String, java.util.Map) Uses sql with the standard '?' placeholders for parameters

Specified by:
queryForList in interface SimpleJdbcOperations
Parameters:
sql - the SQL query to run
args - the variable number of arguments for the query
Throws:
DataAccessException
See Also:
JdbcOperations.queryForList(String), JdbcOperations.queryForList(String, Object[])

update

public int update(String sql,
                  Map<String,?> args)
           throws DataAccessException
Description copied from interface: SimpleJdbcOperations
Execute the supplied SQL statement with (optional) supplied arguments. Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Specified by:
update in interface SimpleJdbcOperations
Parameters:
sql - the SQL statement to execute
args - the map containing the arguments for the query
Returns:
the numbers of rows affected by the update
Throws:
DataAccessException
See Also:
NamedParameterJdbcOperations.update(String, Map)

update

public int update(String sql,
                  SqlParameterSource args)
           throws DataAccessException
Description copied from interface: SimpleJdbcOperations
Execute the supplied SQL statement with supplied arguments. Uses sql with the named parameter support provided by the NamedParameterJdbcTemplate

Specified by:
update in interface SimpleJdbcOperations
Parameters:
sql - the SQL statement to execute
args - the SqlParameterSource containing the arguments for the statement
Returns:
the numbers of rows affected by the update
Throws:
DataAccessException
See Also:
NamedParameterJdbcOperations.update(String, SqlParameterSource)

update

public int update(String sql,
                  Object... args)
           throws DataAccessException
Description copied from interface: SimpleJdbcOperations
Execute the supplied SQL statement with supplied arguments. Uses sql with the standard '?' placeholders for parameters

Specified by:
update in interface SimpleJdbcOperations
Parameters:
sql - the SQL statement to execute
args - the variable number of arguments for the query
Returns:
the numbers of rows affected by the update
Throws:
DataAccessException
See Also:
JdbcOperations.update(String), JdbcOperations.update(String, Object[])

batchUpdate

public int[] batchUpdate(String sql,
                         List<Object[]> batchArgs)
Description copied from interface: SimpleJdbcOperations
Execute a batch using the supplied SQL statement with the batch of supplied arguments. Uses sql with the standard '?' placeholders for parameters

Specified by:
batchUpdate in interface SimpleJdbcOperations
Parameters:
sql - the SQL statement to execute
batchArgs - the List of Object arrays containing the batch of arguments for the query
Returns:
an array containing the numbers of rows affected by each update in the batch

batchUpdate

public int[] batchUpdate(String sql,
                         List<Object[]> batchArgs,
                         int[] argTypes)
Description copied from interface: SimpleJdbcOperations
Execute a batch using the supplied SQL statement with the batch of supplied arguments. Uses sql with the standard '?' placeholders for parameters

Specified by:
batchUpdate in interface SimpleJdbcOperations
Parameters:
sql - the SQL statement to execute.
batchArgs - the List of Object arrays containing the batch of arguments for the query
argTypes - SQL types of the arguments (constants from java.sql.Types)
Returns:
an array containing the numbers of rows affected by each update in the batch

batchUpdate

public int[] batchUpdate(String sql,
                         Map<String,?>[] batchValues)
Description copied from interface: SimpleJdbcOperations
Executes a batch using the supplied SQL statement with the batch of supplied arguments. Uses sql with the named parameter support.

Specified by:
batchUpdate in interface SimpleJdbcOperations
Parameters:
sql - the SQL statement to execute
batchValues - the array of Maps containing the batch of arguments for the query
Returns:
an array containing the numbers of rows affected by each update in the batch

batchUpdate

public int[] batchUpdate(String sql,
                         SqlParameterSource[] batchArgs)
Description copied from interface: SimpleJdbcOperations
Execute a batch using the supplied SQL statement with the batch of supplied arguments. Uses sql with the named parameter support.

Specified by:
batchUpdate in interface SimpleJdbcOperations
Parameters:
sql - the SQL statement to execute
batchArgs - the array of SqlParameterSource containing the batch of arguments for the query
Returns:
an array containing the numbers of rows affected by each update in the batch
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jdbc.core.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jdbc.core.support

Classes supporting the org.springframework.jdbc.core package.

See:
Description

Class Summary
AbstractInterruptibleBatchPreparedStatementSetter | Abstract implementation of the InterruptibleBatchPreparedStatementSetter interface, combining the check for available values and setting of those into a single callback method AbstractInterruptibleBatchPreparedStatementSetter.setValuesIfAvailable(java.sql.PreparedStatement, int).
AbstractLobCreatingPreparedStatementCallback | Abstract PreparedStatementCallback implementation that manages a LobCreator.
AbstractLobStreamingResultSetExtractor | Abstract ResultSetExtractor implementation that assumes streaming of LOB data.
AbstractSqlTypeValue | Abstract implementation of the SqlTypeValue interface, for convenient creation of type values that are supposed to be passed into the PreparedStatement.setObject method.
JdbcBeanDefinitionReader | Bean definition reader that reads values from a database table, based on a given SQL statement.
JdbcDaoSupport | Convenient super class for JDBC-based data access objects.
SqlLobValue | Object to represent an SQL BLOB/CLOB value parameter.

Package org.springframework.jdbc.core.support Description

Classes supporting the org.springframework.jdbc.core package. Contains a DAO base class for JdbcTemplate usage.


org.springframework.jdbc.core.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jdbc.core.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jdbc.core.support.AbstractInterruptibleBatchPreparedStatementSetter (implements org.springframework.jdbc.core.InterruptibleBatchPreparedStatementSetter)
    • org.springframework.jdbc.core.support.AbstractLobCreatingPreparedStatementCallback (implements org.springframework.jdbc.core.PreparedStatementCallback<T>)
    • org.springframework.jdbc.core.support.AbstractLobStreamingResultSetExtractor (implements org.springframework.jdbc.core.ResultSetExtractor<T>)
    • org.springframework.jdbc.core.support.AbstractSqlTypeValue (implements org.springframework.jdbc.core.SqlTypeValue)
    • org.springframework.dao.support.DaoSupport (implements org.springframework.beans.factory.InitializingBean)
      • org.springframework.jdbc.core.support.JdbcDaoSupport
    • org.springframework.jdbc.core.support.JdbcBeanDefinitionReader
    • org.springframework.jdbc.core.support.SqlLobValue (implements org.springframework.jdbc.core.DisposableSqlTypeValue)


AbstractInterruptibleBatchPreparedStatementSetter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.core.support
Class AbstractInterruptibleBatchPreparedStatementSetter

java.lang.Object
    extended by  org.springframework.jdbc.core.support.AbstractInterruptibleBatchPreparedStatementSetter
All Implemented Interfaces:
BatchPreparedStatementSetter, InterruptibleBatchPreparedStatementSetter
public abstract class AbstractInterruptibleBatchPreparedStatementSetter
extends Object
implements InterruptibleBatchPreparedStatementSetter

Abstract implementation of the InterruptibleBatchPreparedStatementSetter interface, combining the check for available values and setting of those into a single callback method setValuesIfAvailable(java.sql.PreparedStatement, int).

Since:
2.0
Author:
Juergen Hoeller
See Also:
setValuesIfAvailable(java.sql.PreparedStatement, int)

Constructor Summary
AbstractInterruptibleBatchPreparedStatementSetter()
Method Summary
 int getBatchSize()
This implementation returns Integer.MAX_VALUE.
 boolean isBatchExhausted(int i)
This implementation return this instance's current exhaustion flag.
 void setValues(PreparedStatement ps, int i)
This implementation calls setValuesIfAvailable(java.sql.PreparedStatement, int) and sets this instance's exhaustion flag accordingly.
protected abstract  boolean setValuesIfAvailable(PreparedStatement ps, int i)
Check for available values and set them on the given PreparedStatement.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractInterruptibleBatchPreparedStatementSetter

public AbstractInterruptibleBatchPreparedStatementSetter()
Method Detail

setValues

public final void setValues(PreparedStatement ps,
                            int i)
                     throws SQLException
This implementation calls setValuesIfAvailable(java.sql.PreparedStatement, int) and sets this instance's exhaustion flag accordingly.

Specified by:
setValues in interface BatchPreparedStatementSetter
Parameters:
ps - the PreparedStatement to invoke setter methods on
i - index of the statement we're issuing in the batch, starting from 0
Throws:
SQLException - if a SQLException is encountered (i.e. there is no need to catch SQLException)

isBatchExhausted

public final boolean isBatchExhausted(int i)
This implementation return this instance's current exhaustion flag.

Specified by:
isBatchExhausted in interface InterruptibleBatchPreparedStatementSetter
Parameters:
i - index of the statement we're issuing in the batch, starting from 0
Returns:
whether the batch is already exhausted
See Also:
BatchPreparedStatementSetter.setValues(java.sql.PreparedStatement, int), setValuesIfAvailable(java.sql.PreparedStatement, int)

getBatchSize

public int getBatchSize()
This implementation returns Integer.MAX_VALUE. Can be overridden in subclasses to lower the maximum batch size.

Specified by:
getBatchSize in interface BatchPreparedStatementSetter
Returns:
the number of statements in the batch

setValuesIfAvailable

protected abstract boolean setValuesIfAvailable(PreparedStatement ps,
                                                int i)
                                         throws SQLException
Check for available values and set them on the given PreparedStatement. If no values are available anymore, return false.

Parameters:
ps - PreparedStatement we'll invoke setter methods on
i - index of the statement we're issuing in the batch, starting from 0
Returns:
whether there were values to apply (that is, whether the applied parameters should be added to the batch and this method should be called for a further iteration)
Throws:
SQLException - if a SQLException is encountered (i.e. there is no need to catch SQLException)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractLobCreatingPreparedStatementCallback

org.springframework.jdbc.core.support
Class AbstractLobCreatingPreparedStatementCallback

java.lang.Object
    extended by  org.springframework.jdbc.core.support.AbstractLobCreatingPreparedStatementCallback
All Implemented Interfaces:
PreparedStatementCallback<Integer>
public abstract class AbstractLobCreatingPreparedStatementCallback
extends Object
implements PreparedStatementCallback<Integer>

Abstract PreparedStatementCallback implementation that manages a LobCreator. Typically used as inner class, with access to surrounding method arguments.

Delegates to the setValues template method for setting values on the PreparedStatement, using a given LobCreator for BLOB/CLOB arguments.

A usage example with JdbcTemplate:

JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);  // reusable object
 LobHandler lobHandler = new DefaultLobHandler();  // reusable object

 jdbcTemplate.execute(
     "INSERT INTO imagedb (image_name, content, description) VALUES (?, ?, ?)",
     new AbstractLobCreatingPreparedStatementCallback(lobHandler) {
       protected void setValues(PreparedStatement ps, LobCreator lobCreator) throws SQLException {
         ps.setString(1, name);
         lobCreator.setBlobAsBinaryStream(ps, 2, contentStream, contentLength);
         lobCreator.setClobAsString(ps, 3, description);
       }
     }
 );

Since:
1.0.2
Author:
Juergen Hoeller
See Also:
LobCreator

Constructor Summary
AbstractLobCreatingPreparedStatementCallback(LobHandler lobHandler)
Create a new AbstractLobCreatingPreparedStatementCallback for the given LobHandler.
Method Summary
Integer | doInPreparedStatement(PreparedStatement ps) Gets called by JdbcTemplate.execute with an active JDBC PreparedStatement.
protected abstract void | setValues(PreparedStatement ps, LobCreator lobCreator) Set values on the given PreparedStatement, using the given LobCreator for BLOB/CLOB arguments.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractLobCreatingPreparedStatementCallback

public AbstractLobCreatingPreparedStatementCallback(LobHandler lobHandler)
Create a new AbstractLobCreatingPreparedStatementCallback for the given LobHandler.

Parameters:
lobHandler - the LobHandler to create LobCreators with
Method Detail

doInPreparedStatement

public final Integer doInPreparedStatement(PreparedStatement ps)
                                    throws SQLException,
                                           DataAccessException
Description copied from interface: PreparedStatementCallback
Gets called by JdbcTemplate.execute with an active JDBC PreparedStatement. Does not need to care about closing the Statement or the Connection, or about handling transactions: this will all be handled by Spring's JdbcTemplate.

NOTE: Any ResultSets opened should be closed in finally blocks within the callback implementation. Spring will close the Statement object after the callback returned, but this does not necessarily imply that the ResultSet resources will be closed: the Statement objects might get pooled by the connection pool, with close calls only returning the object to the pool but not physically closing the resources.

If called without a thread-bound JDBC transaction (initiated by DataSourceTransactionManager), the code will simply get executed on the JDBC connection with its transactional semantics. If JdbcTemplate is configured to use a JTA-aware DataSource, the JDBC connection and thus the callback code will be transactional if a JTA transaction is active.

Allows for returning a result object created within the callback, i.e. a domain object or a collection of domain objects. Note that there's special support for single step actions: see JdbcTemplate.queryForObject etc. A thrown RuntimeException is treated as application exception, it gets propagated to the caller of the template.

Specified by:
doInPreparedStatement in interface PreparedStatementCallback<Integer>
Parameters:
ps - active JDBC PreparedStatement
Returns:
a result object, or null if none
Throws:
SQLException - if thrown by a JDBC method, to be auto-converted to a DataAccessException by a SQLExceptionTranslator
DataAccessException - in case of custom exceptions
See Also:
JdbcTemplate.queryForObject(String, Object[], Class), JdbcTemplate.queryForList(String, Object[])

setValues

protected abstract void setValues(PreparedStatement ps,
                                  LobCreator lobCreator)
                           throws SQLException,
                                  DataAccessException
Set values on the given PreparedStatement, using the given LobCreator for BLOB/CLOB arguments.

Parameters:
ps - the PreparedStatement to use
lobCreator - the LobCreator to use
Throws:
SQLException - if thrown by JDBC methods
DataAccessException - in case of custom exceptions
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractLobStreamingResultSetExtractor

org.springframework.jdbc.core.support
Class AbstractLobStreamingResultSetExtractor

java.lang.Object
    extended by  org.springframework.jdbc.core.support.AbstractLobStreamingResultSetExtractor
All Implemented Interfaces:
ResultSetExtractor
public abstract class AbstractLobStreamingResultSetExtractor
extends Object
implements ResultSetExtractor

Abstract ResultSetExtractor implementation that assumes streaming of LOB data. Typically used as inner class, with access to surrounding method arguments.

Delegates to the streamData template method for streaming LOB content to some OutputStream, typically using a LobHandler. Converts an IOException thrown during streaming to a LobRetrievalFailureException.

A usage example with JdbcTemplate:

JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);  // reusable object
 final LobHandler lobHandler = new DefaultLobHandler();  // reusable object

 jdbcTemplate.query(
                 "SELECT content FROM imagedb WHERE image_name=?", new Object[] {name},
                 new AbstractLobStreamingResultSetExtractor() {
                         public void streamData(ResultSet rs) throws SQLException, IOException {
                                 FileCopyUtils.copy(lobHandler.getBlobAsBinaryStream(rs, 1), contentStream);
                         }
                 }
 );

Since:
1.0.2
Author:
Juergen Hoeller
See Also:
LobHandler, LobRetrievalFailureException

Constructor Summary
AbstractLobStreamingResultSetExtractor()
Method Summary
Object | extractData(ResultSet rs) Delegates to handleNoRowFound, handleMultipleRowsFound and streamData, according to the ResultSet state.
protected void | handleMultipleRowsFound() Handle the case where the ResultSet contains multiple rows.
protected void | handleNoRowFound() Handle the case where the ResultSet does not contain a row.
protected abstract void | streamData(ResultSet rs) Stream LOB content from the given ResultSet to some OutputStream.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractLobStreamingResultSetExtractor

public AbstractLobStreamingResultSetExtractor()
Method Detail

extractData

public final Object extractData(ResultSet rs)
                         throws SQLException,
                                DataAccessException
Delegates to handleNoRowFound, handleMultipleRowsFound and streamData, according to the ResultSet state. Converts an IOException thrown by streamData to a LobRetrievalFailureException.

Specified by:
extractData in interface ResultSetExtractor
Parameters:
rs - ResultSet to extract data from. Implementations should not close this: it will be closed by the calling JdbcTemplate.
Returns:
an arbitrary result object, or null if none (the extractor will typically be stateful in the latter case).
Throws:
SQLException - if a SQLException is encountered getting column values or navigating (that is, there's no need to catch SQLException)
DataAccessException - in case of custom exceptions
See Also:
handleNoRowFound(),
handleMultipleRowsFound(),
streamData(java.sql.ResultSet),
LobRetrievalFailureException

handleNoRowFound

protected void handleNoRowFound()
                         throws DataAccessException
Handle the case where the ResultSet does not contain a row.

Throws:
DataAccessException - a corresponding exception, by default an EmptyResultDataAccessException
See Also:
EmptyResultDataAccessException

handleMultipleRowsFound

protected void handleMultipleRowsFound()
                                throws DataAccessException
Handle the case where the ResultSet contains multiple rows.

Throws:
DataAccessException - a corresponding exception, by default an IncorrectResultSizeDataAccessException
See Also:
IncorrectResultSizeDataAccessException

streamData

protected abstract void streamData(ResultSet rs)
                            throws SQLException,
                                   IOException,
                                   DataAccessException
Stream LOB content from the given ResultSet to some OutputStream.

Typically used as inner class, with access to surrounding method arguments and to a LobHandler instance variable of the surrounding class.

Parameters:
rs - the ResultSet to take the LOB content from
Throws:
SQLException - if thrown by JDBC methods
IOException - if thrown by stream access methods
DataAccessException - in case of custom exceptions
See Also:
LobHandler.getBlobAsBinaryStream(java.sql.ResultSet, java.lang.String), FileCopyUtils
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractSqlTypeValue

org.springframework.jdbc.core.support
Class AbstractSqlTypeValue

java.lang.Object
    extended by  org.springframework.jdbc.core.support.AbstractSqlTypeValue
All Implemented Interfaces:
SqlTypeValue
public abstract class AbstractSqlTypeValue
extends Object
implements SqlTypeValue

Abstract implementation of the SqlTypeValue interface, for convenient creation of type values that are supposed to be passed into the PreparedStatement.setObject method. The createTypeValue callback method has access to the underlying Connection, if that should be needed to create any database-specific objects.

A usage example from a StoredProcedure (compare this to the plain SqlTypeValue version in the superclass javadoc):

proc.declareParameter(new SqlParameter("myarray", Types.ARRAY, "NUMBERS"));
 ...

 Map<String, Object> in = new HashMap<String, Object>();
 in.put("myarray", new AbstractSqlTypeValue() {
   public Object createTypeValue(Connection con, int sqlType, String typeName) throws SQLException {
           oracle.sql.ArrayDescriptor desc = new oracle.sql.ArrayDescriptor(typeName, con);
           return new oracle.sql.ARRAY(desc, con, seats);
   }
 });
 Map out = execute(in);

Since:
1.1
Author:
Juergen Hoeller
See Also:
PreparedStatement.setObject(int, Object, int), StoredProcedure

Field Summary
Fields inherited from interface org.springframework.jdbc.core.SqlTypeValue
TYPE_UNKNOWN
Constructor Summary
AbstractSqlTypeValue()
Method Summary
protected abstract Object | createTypeValue(Connection con, int sqlType, String typeName) Create the type value to be passed into PreparedStatement.setObject.
void | setTypeValue(PreparedStatement ps, int paramIndex, int sqlType, String typeName) Set the type value on the given PreparedStatement.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractSqlTypeValue

public AbstractSqlTypeValue()
Method Detail

setTypeValue

public final void setTypeValue(PreparedStatement ps,
                               int paramIndex,
                               int sqlType,
                               String typeName)
                        throws SQLException
Description copied from interface: SqlTypeValue
Set the type value on the given PreparedStatement.

Specified by:
setTypeValue in interface SqlTypeValue
Parameters:
ps - the PreparedStatement to work on
paramIndex - the index of the parameter for which we need to set the value
sqlType - SQL type of the parameter we are setting
typeName - the type name of the parameter (optional)
Throws:
SQLException - if a SQLException is encountered while setting parameter values
See Also:
Types, PreparedStatement.setObject(int, java.lang.Object, int)

createTypeValue

protected abstract Object createTypeValue(Connection con,
                                          int sqlType,
                                          String typeName)
                                   throws SQLException
Create the type value to be passed into PreparedStatement.setObject.

Parameters:
con - the JDBC Connection, if needed to create any database-specific objects
sqlType - SQL type of the parameter we are setting
typeName - the type name of the parameter
Returns:
the type value
Throws:
SQLException - if a SQLException is encountered setting parameter values (that is, there's no need to catch SQLException)
See Also:
PreparedStatement.setObject(int, Object, int)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JdbcBeanDefinitionReader

org.springframework.jdbc.core.support
Class JdbcBeanDefinitionReader

java.lang.Object
    extended by  org.springframework.jdbc.core.support.JdbcBeanDefinitionReader

public class JdbcBeanDefinitionReader
extends Object

Bean definition reader that reads values from a database table, based on a given SQL statement.

Expects columns for bean name, property name and value as String. Formats for each are identical to the properties format recognized by PropertiesBeanDefinitionReader.

NOTE: This is mainly intended as an example for a custom JDBC-based bean definition reader. It does not aim to offer comprehensive functionality.

Author:
Rod Johnson, Juergen Hoeller
See Also:
loadBeanDefinitions(java.lang.String), PropertiesBeanDefinitionReader

Constructor Summary
JdbcBeanDefinitionReader(BeanDefinitionRegistry beanFactory)
Create a new JdbcBeanDefinitionReader for the given bean factory, using a default PropertiesBeanDefinitionReader underneath.
JdbcBeanDefinitionReader(PropertiesBeanDefinitionReader beanDefinitionReader)
Create a new JdbcBeanDefinitionReader that delegates to the given PropertiesBeanDefinitionReader underneath.
Method Summary
void | loadBeanDefinitions(String sql) Load bean definitions from the database via the given SQL string.
void | setDataSource(DataSource dataSource) Set the DataSource to use to obtain database connections.
void | setJdbcTemplate(JdbcTemplate jdbcTemplate) Set the JdbcTemplate to be used by this bean factory.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JdbcBeanDefinitionReader

public JdbcBeanDefinitionReader(BeanDefinitionRegistry beanFactory)
Create a new JdbcBeanDefinitionReader for the given bean factory, using a default PropertiesBeanDefinitionReader underneath.

DataSource or JdbcTemplate still need to be set.

See Also:
setDataSource(javax.sql.DataSource), setJdbcTemplate(org.springframework.jdbc.core.JdbcTemplate)

JdbcBeanDefinitionReader

public JdbcBeanDefinitionReader(PropertiesBeanDefinitionReader beanDefinitionReader)
Create a new JdbcBeanDefinitionReader that delegates to the given PropertiesBeanDefinitionReader underneath.

DataSource or JdbcTemplate still need to be set.

See Also:
setDataSource(javax.sql.DataSource), setJdbcTemplate(org.springframework.jdbc.core.JdbcTemplate)
Method Detail

setDataSource

public void setDataSource(DataSource dataSource)
Set the DataSource to use to obtain database connections. Will implicitly create a new JdbcTemplate with the given DataSource.

setJdbcTemplate

public void setJdbcTemplate(JdbcTemplate jdbcTemplate)
Set the JdbcTemplate to be used by this bean factory. Contains settings for DataSource, SQLExceptionTranslator, NativeJdbcExtractor, etc.

loadBeanDefinitions

public void loadBeanDefinitions(String sql)
Load bean definitions from the database via the given SQL string.

Parameters:
sql - SQL query to use for loading bean definitions. The first three columns must be bean name, property name and value. Any join and any other columns are permitted: e.g. SELECT BEAN_NAME, PROPERTY, VALUE FROM CONFIG WHERE CONFIG.APP_ID = 1 It's also possible to perform a join. Column names are not significant -- only the ordering of these first three columns.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JdbcDaoSupport

org.springframework.jdbc.core.support
Class JdbcDaoSupport

java.lang.Object
    extended by  org.springframework.dao.support.DaoSupport
        extended by  org.springframework.jdbc.core.support.JdbcDaoSupport
All Implemented Interfaces:
InitializingBean
Direct Known Subclasses:
NamedParameterJdbcDaoSupport, SimpleJdbcDaoSupport
public abstract class JdbcDaoSupport
extends DaoSupport

Convenient super class for JDBC-based data access objects.

Requires a DataSource to be set, providing a JdbcTemplate based on it to subclasses through the getJdbcTemplate() method.

This base class is mainly intended for JdbcTemplate usage but can also be used when working with a Connection directly or when using org.springframework.jdbc.object operation objects.

Since:
28.07.2003
Author:
Juergen Hoeller
See Also:
setDataSource(javax.sql.DataSource), getJdbcTemplate(), JdbcTemplate

Field Summary
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
Constructor Summary
JdbcDaoSupport()
Method Summary
protected void | checkDaoConfig() Abstract subclasses must override this to check their configuration.
protected JdbcTemplate | createJdbcTemplate(DataSource dataSource) Create a JdbcTemplate for the given DataSource.
protected Connection | getConnection() Get a JDBC Connection, either from the current transaction or a new one.
DataSource | getDataSource() Return the JDBC DataSource used by this DAO.
protected SQLExceptionTranslator | getExceptionTranslator() Return the SQLExceptionTranslator of this DAO's JdbcTemplate, for translating SQLExceptions in custom JDBC access code.
JdbcTemplate | getJdbcTemplate() Return the JdbcTemplate for this DAO, pre-initialized with the DataSource or set explicitly.
protected void | initTemplateConfig() Initialize the template-based configuration of this DAO.
protected void | releaseConnection(Connection con) Close the given JDBC Connection, created via this DAO's DataSource, if it isn't bound to the thread.
void | setDataSource(DataSource dataSource) Set the JDBC DataSource to be used by this DAO.
void | setJdbcTemplate(JdbcTemplate jdbcTemplate) Set the JdbcTemplate for this DAO explicitly, as an alternative to specifying a DataSource.
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JdbcDaoSupport

public JdbcDaoSupport()
Method Detail

setDataSource

public final void setDataSource(DataSource dataSource)
Set the JDBC DataSource to be used by this DAO.

createJdbcTemplate

protected JdbcTemplate createJdbcTemplate(DataSource dataSource)
Create a JdbcTemplate for the given DataSource. Only invoked if populating the DAO with a DataSource reference!

Can be overridden in subclasses to provide a JdbcTemplate instance with different configuration, or a custom JdbcTemplate subclass.

Parameters:
dataSource - the JDBC DataSource to create a JdbcTemplate for
Returns:
the new JdbcTemplate instance
See Also:
setDataSource(javax.sql.DataSource)

getDataSource

public final DataSource getDataSource()
Return the JDBC DataSource used by this DAO.

setJdbcTemplate

public final void setJdbcTemplate(JdbcTemplate jdbcTemplate)
Set the JdbcTemplate for this DAO explicitly, as an alternative to specifying a DataSource.

getJdbcTemplate

public final JdbcTemplate getJdbcTemplate()
Return the JdbcTemplate for this DAO, pre-initialized with the DataSource or set explicitly.

initTemplateConfig

protected void initTemplateConfig()
Initialize the template-based configuration of this DAO. Called after a new JdbcTemplate has been set, either directly or through a DataSource.

This implementation is empty. Subclasses may override this to configure further objects based on the JdbcTemplate.

See Also:
getJdbcTemplate()

checkDaoConfig

protected void checkDaoConfig()
Description copied from class: DaoSupport
Abstract subclasses must override this to check their configuration.

Implementors should be marked as final

Specified by:
checkDaoConfig in class DaoSupport

getExceptionTranslator

protected final SQLExceptionTranslator getExceptionTranslator()
Return the SQLExceptionTranslator of this DAO's JdbcTemplate, for translating SQLExceptions in custom JDBC access code.

See Also:
JdbcAccessor.getExceptionTranslator()

getConnection

protected final Connection getConnection()
                                  throws CannotGetJdbcConnectionException
Get a JDBC Connection, either from the current transaction or a new one.

Returns:
the JDBC Connection
Throws:
CannotGetJdbcConnectionException - if the attempt to get a Connection failed
See Also:
DataSourceUtils.getConnection(javax.sql.DataSource)

releaseConnection

protected final void releaseConnection(Connection con)
Close the given JDBC Connection, created via this DAO's DataSource, if it isn't bound to the thread.

Parameters:
con - Connection to close
See Also:
DataSourceUtils.releaseConnection(java.sql.Connection, javax.sql.DataSource)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SqlLobValue

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.core.support
Class SqlLobValue

java.lang.Object
    extended by  org.springframework.jdbc.core.support.SqlLobValue
All Implemented Interfaces:
DisposableSqlTypeValue, SqlTypeValue
public class SqlLobValue
extends Object
implements DisposableSqlTypeValue

Object to represent an SQL BLOB/CLOB value parameter. BLOBs can either be an InputStream or a byte array. CLOBs can be in the form of a Reader, InputStream or String. Each CLOB/BLOB value will be stored together with its length. The type is based on which constructor is used. Objects of this class are immutable except for the LobCreator reference. Use them and discard them.

This class holds a reference to a LocCreator that must be closed after the update has completed. This is done via a call to the closeLobCreator method. All handling of the LobCreator is done by the framework classes that use it - no need to set or close the LobCreator for end users of this class.

A usage example:

JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);  // reusable object
 LobHandler lobHandler = new DefaultLobHandler();  // reusable object

 jdbcTemplate.update(
     "INSERT INTO imagedb (image_name, content, description) VALUES (?, ?, ?)",
     new Object[] {
       name,
       new SqlLobValue(contentStream, contentLength, lobHandler),
       new SqlLobValue(description, lobHandler)
     },
     new int[] {Types.VARCHAR, Types.BLOB, Types.CLOB});

Since:
1.1
Author:
Thomas Risberg, Juergen Hoeller
See Also:
LobHandler,
LobCreator,
JdbcTemplate.update(String, Object[], int[]),
SqlUpdate.update(Object[]),
StoredProcedure.execute(java.util.Map)

Field Summary
Fields inherited from interface org.springframework.jdbc.core.SqlTypeValue
TYPE_UNKNOWN
Constructor Summary
SqlLobValue(byte[] bytes)
Create a new BLOB value with the given byte array, using a DefaultLobHandler.
SqlLobValue(byte[] bytes, LobHandler lobHandler)
Create a new BLOB value with the given byte array.
SqlLobValue(InputStream stream, int length)
Create a new BLOB/CLOB value with the given stream, using a DefaultLobHandler.
SqlLobValue(InputStream stream, int length, LobHandler lobHandler)
Create a new BLOB/CLOB value with the given stream.
SqlLobValue(Reader reader, int length)
Create a new CLOB value with the given character stream, using a DefaultLobHandler.
SqlLobValue(Reader reader, int length, LobHandler lobHandler)
Create a new CLOB value with the given character stream.
SqlLobValue(String content)
Create a new CLOB value with the given content string, using a DefaultLobHandler.
SqlLobValue(String content, LobHandler lobHandler)
Create a new CLOB value with the given content string.
Method Summary
void | cleanup() Close the LobCreator, if any.
void | setTypeValue(PreparedStatement ps, int paramIndex, int sqlType, String typeName) Set the specified content via the LobCreator.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SqlLobValue

public SqlLobValue(byte[] bytes)
Create a new BLOB value with the given byte array, using a DefaultLobHandler.

Parameters:
bytes - the byte array containing the BLOB value
See Also:
DefaultLobHandler

SqlLobValue

public SqlLobValue(byte[] bytes,
                   LobHandler lobHandler)
Create a new BLOB value with the given byte array.

Parameters:
bytes - the byte array containing the BLOB value
lobHandler - the LobHandler to be used

SqlLobValue

public SqlLobValue(String content)
Create a new CLOB value with the given content string, using a DefaultLobHandler.

Parameters:
content - the String containing the CLOB value
See Also:
DefaultLobHandler

SqlLobValue

public SqlLobValue(String content,
                   LobHandler lobHandler)
Create a new CLOB value with the given content string.

Parameters:
content - the String containing the CLOB value
lobHandler - the LobHandler to be used

SqlLobValue

public SqlLobValue(InputStream stream,
                   int length)
Create a new BLOB/CLOB value with the given stream, using a DefaultLobHandler.

Parameters:
stream - the stream containing the LOB value
length - the length of the LOB value
See Also:
DefaultLobHandler

SqlLobValue

public SqlLobValue(InputStream stream,
                   int length,
                   LobHandler lobHandler)
Create a new BLOB/CLOB value with the given stream.

Parameters:
stream - the stream containing the LOB value
length - the length of the LOB value
lobHandler - the LobHandler to be used

SqlLobValue

public SqlLobValue(Reader reader,
                   int length)
Create a new CLOB value with the given character stream, using a DefaultLobHandler.

Parameters:
reader - the character stream containing the CLOB value
length - the length of the CLOB value
See Also:
DefaultLobHandler

SqlLobValue

public SqlLobValue(Reader reader,
                   int length,
                   LobHandler lobHandler)
Create a new CLOB value with the given character stream.

Parameters:
reader - the character stream containing the CLOB value
length - the length of the CLOB value
lobHandler - the LobHandler to be used
Method Detail

setTypeValue

public void setTypeValue(PreparedStatement ps,
                         int paramIndex,
                         int sqlType,
                         String typeName)
                  throws SQLException
Set the specified content via the LobCreator.

Specified by:
setTypeValue in interface SqlTypeValue
Parameters:
ps - the PreparedStatement to work on
paramIndex - the index of the parameter for which we need to set the value
sqlType - SQL type of the parameter we are setting
typeName - the type name of the parameter (optional)
Throws:
SQLException - if a SQLException is encountered while setting parameter values
See Also:
Types, PreparedStatement.setObject(int, java.lang.Object, int)

cleanup

public void cleanup()
Close the LobCreator, if any.

Specified by:
cleanup in interface DisposableSqlTypeValue
See Also:
cleanup(), SqlValue.cleanup()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jdbc.datasource

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jdbc.datasource

Provides a utility class for easy DataSource access, a PlatformTransactionManager for a single DataSource, and various simple DataSource implementations.

See:
Description

Interface Summary
ConnectionHandle | Simple interface to be implemented by handles for a JDBC Connection.
ConnectionProxy | Subinterface of Connection to be implemented by Connection proxies.
SmartDataSource | Extension of the javax.sql.DataSource interface, to be implemented by special DataSources that return JDBC Connections in an unwrapped fashion.

Class Summary
AbstractDataSource | Abstract base class for Spring's DataSource implementations, taking care of the padding.
AbstractDriverBasedDataSource | Abstract base class for JDBC DataSource implementations that operate on a JDBC Driver.
ConnectionHolder | Connection holder, wrapping a JDBC Connection.
DataSourceTransactionManager | PlatformTransactionManager implementation for a single JDBC DataSource.
DataSourceUtils | Helper class that provides static methods for obtaining JDBC Connections from a DataSource.
DelegatingDataSource | JDBC DataSource implementation that delegates all calls to a given target DataSource.
DriverManagerDataSource | Simple implementation of the standard JDBC DataSource interface, configuring the plain old JDBC DriverManager via bean properties, and returning a new Connection from every getConnection call.
IsolationLevelDataSourceAdapter | An adapter for a target DataSource, applying the current Spring transaction's isolation level (and potentially specified user credentials) to every getConnection call.
JdbcTransactionObjectSupport | Convenient base class for JDBC-aware transaction objects.
LazyConnectionDataSourceProxy | Proxy for a target DataSource, fetching actual JDBC Connections lazily, i.e.
SimpleConnectionHandle | Simple implementation of the ConnectionHandle interface, containing a given JDBC Connection.
SimpleDriverDataSource | Simple implementation of the standard JDBC DataSource interface, configuring a plain old JDBC Driver via bean properties, and returning a new Connection from every getConnection call.
SingleConnectionDataSource | Implementation of SmartDataSource that wraps a single JDBC Connection which is not closed after use.
TransactionAwareDataSourceProxy | Proxy for a target JDBC DataSource, adding awareness of Spring-managed transactions.
UserCredentialsDataSourceAdapter | An adapter for a target JDBC DataSource, applying the specified user credentials to every standard getConnection() call, implicitly invoking getConnection(username, password) on the target.
WebSphereDataSourceAdapter | DataSource implementation that delegates all calls to a WebSphere target DataSource, typically obtained from JNDI, applying a current isolation level and/or current user credentials to every Connection obtained from it.

Package org.springframework.jdbc.datasource Description

Provides a utility class for easy DataSource access, a PlatformTransactionManager for a single DataSource, and various simple DataSource implementations.


org.springframework.jdbc.datasource Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jdbc.datasource

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jdbc.datasource.AbstractDataSource (implements javax.sql.DataSource)
      • org.springframework.jdbc.datasource.AbstractDriverBasedDataSource
        • org.springframework.jdbc.datasource.DriverManagerDataSource
          • org.springframework.jdbc.datasource.SingleConnectionDataSource (implements org.springframework.beans.factory.DisposableBean, org.springframework.jdbc.datasource.SmartDataSource)
        • org.springframework.jdbc.datasource.SimpleDriverDataSource
    • org.springframework.transaction.support.AbstractPlatformTransactionManager (implements org.springframework.transaction.PlatformTransactionManager, java.io.Serializable)
      • org.springframework.jdbc.datasource.DataSourceTransactionManager (implements org.springframework.beans.factory.InitializingBean, org.springframework.transaction.support.ResourceTransactionManager)
    • org.springframework.jdbc.datasource.DataSourceUtils
    • org.springframework.jdbc.datasource.DelegatingDataSource (implements javax.sql.DataSource, org.springframework.beans.factory.InitializingBean)
      • org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy
      • org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy
      • org.springframework.jdbc.datasource.UserCredentialsDataSourceAdapter
        • org.springframework.jdbc.datasource.IsolationLevelDataSourceAdapter
          • org.springframework.jdbc.datasource.WebSphereDataSourceAdapter
    • org.springframework.jdbc.datasource.JdbcTransactionObjectSupport (implements org.springframework.transaction.SavepointManager, org.springframework.transaction.support.SmartTransactionObject)
    • org.springframework.transaction.support.ResourceHolderSupport (implements org.springframework.transaction.support.ResourceHolder)
      • org.springframework.jdbc.datasource.ConnectionHolder
    • org.springframework.jdbc.datasource.SimpleConnectionHandle (implements org.springframework.jdbc.datasource.ConnectionHandle)

Interface Hierarchy

  • javax.sql.CommonDataSource
    • javax.sql.DataSource (also extends java.sql.Wrapper)
      • org.springframework.jdbc.datasource.SmartDataSource
  • org.springframework.jdbc.datasource.ConnectionHandle
  • java.sql.Wrapper
    • java.sql.Connection
      • org.springframework.jdbc.datasource.ConnectionProxy
    • javax.sql.DataSource (also extends javax.sql.CommonDataSource)
      • org.springframework.jdbc.datasource.SmartDataSource


ConnectionHandle

org.springframework.jdbc.datasource
Interface ConnectionHandle

All Known Implementing Classes:
SimpleConnectionHandle
public interface ConnectionHandle

Simple interface to be implemented by handles for a JDBC Connection. Used by JdoDialect, for example.

Since:
1.1
Author:
Juergen Hoeller
See Also:
SimpleConnectionHandle, ConnectionHolder, JdoDialect.getJdbcConnection(javax.jdo.PersistenceManager, boolean)

Method Summary
Connection | getConnection() Fetch the JDBC Connection that this handle refers to.
void | releaseConnection(Connection con) Release the JDBC Connection that this handle refers to.

Method Detail

getConnection

Connection getConnection()
Fetch the JDBC Connection that this handle refers to.

releaseConnection

void releaseConnection(Connection con)
Release the JDBC Connection that this handle refers to.

Parameters:
con - the JDBC Connection to release
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConnectionProxy

org.springframework.jdbc.datasource
Interface ConnectionProxy

All Superinterfaces:
Connection, Wrapper
public interface ConnectionProxy
extends Connection

Subinterface of Connection to be implemented by Connection proxies. Allows access to the underlying target Connection.

This interface can be checked when there is a need to cast to a native JDBC Connection such as Oracle's OracleConnection. Spring's NativeJdbcExtractorAdapter automatically detects such proxies before delegating to the actual unwrapping for a specific connection pool.

Since:
1.1
Author:
Juergen Hoeller
See Also:
TransactionAwareDataSourceProxy, LazyConnectionDataSourceProxy, DataSourceUtils.getTargetConnection(java.sql.Connection)

Field Summary
Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
Method Summary
 Connection getTargetConnection()
Return the target Connection of this proxy.
Methods inherited from interface java.sql.Connection
clearWarnings, close, commit, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStatement, createStatement, createStatement, createStruct, getAutoCommit, getCatalog, getClientInfo, getClientInfo, getHoldability, getMetaData, getTransactionIsolation, getTypeMap, getWarnings, isClosed, isReadOnly, isValid, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, rollback, setAutoCommit, setCatalog, setClientInfo, setClientInfo, setHoldability, setReadOnly, setSavepoint, setSavepoint, setTransactionIsolation, setTypeMap
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap

Method Detail

getTargetConnection

Connection getTargetConnection()
Return the target Connection of this proxy.

This will typically be the native driver Connection or a wrapper from a connection pool.

Returns:
the underlying Connection (never null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SmartDataSource

org.springframework.jdbc.datasource
Interface SmartDataSource

All Superinterfaces:
CommonDataSource, DataSource, Wrapper
All Known Implementing Classes:
SingleConnectionDataSource
public interface SmartDataSource
extends DataSource

Extension of the javax.sql.DataSource interface, to be implemented by special DataSources that return JDBC Connections in an unwrapped fashion.

Classes using this interface can query whether or not the Connection should be closed after an operation. Spring's DataSourceUtils and JdbcTemplate classes automatically perform such a check.

Author:
Rod Johnson, Juergen Hoeller
See Also:
SingleConnectionDataSource.shouldClose(java.sql.Connection), DataSourceUtils.releaseConnection(java.sql.Connection, javax.sql.DataSource), JdbcTemplate

Method Summary
 boolean shouldClose(Connection con)
Should we close this Connection, obtained from this DataSource?
Methods inherited from interface javax.sql.DataSource
getConnection, getConnection
Methods inherited from interface javax.sql.CommonDataSource
getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap

Method Detail

shouldClose

boolean shouldClose(Connection con)
Should we close this Connection, obtained from this DataSource?

Code that uses Connections from a SmartDataSource should always perform a check via this method before invoking close().

Note that the JdbcTemplate class in the 'jdbc.core' package takes care of releasing JDBC Connections, freeing application code of this responsibility.

Parameters:
con - the Connection to check
Returns:
whether the given Connection should be closed
See Also:
Connection.close()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractDataSource

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.datasource
Class AbstractDataSource

java.lang.Object
    extended by  org.springframework.jdbc.datasource.AbstractDataSource
All Implemented Interfaces:
Wrapper, CommonDataSource, DataSource
Direct Known Subclasses:
AbstractDriverBasedDataSource, AbstractRoutingDataSource
public abstract class AbstractDataSource
extends Object
implements DataSource

Abstract base class for Spring's DataSource implementations, taking care of the padding.

'Padding' in the context of this class means default implementations for certain methods from the DataSource interface, such as getLoginTimeout(), setLoginTimeout(int), and so forth.

Since:
07.05.2003
Author:
Juergen Hoeller
See Also:
DriverManagerDataSource

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
AbstractDataSource()
Method Summary
 int getLoginTimeout()
Returns 0, indicating the default system timeout is to be used.
 PrintWriter getLogWriter()
LogWriter methods are not supported.
 boolean isWrapperFor(Class<?> iface)
 void setLoginTimeout(int timeout)
Setting a login timeout is not supported.
 void setLogWriter(PrintWriter pw)
LogWriter methods are not supported.
<T> T
unwrap(Class<T> iface)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.sql.DataSource
getConnection, getConnection

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

AbstractDataSource

public AbstractDataSource()
Method Detail

getLoginTimeout

public int getLoginTimeout()
                    throws SQLException
Returns 0, indicating the default system timeout is to be used.

Specified by:
getLoginTimeout in interface CommonDataSource
Throws:
SQLException

setLoginTimeout

public void setLoginTimeout(int timeout)
                     throws SQLException
Setting a login timeout is not supported.

Specified by:
setLoginTimeout in interface CommonDataSource
Throws:
SQLException

getLogWriter

public PrintWriter getLogWriter()
LogWriter methods are not supported.

Specified by:
getLogWriter in interface CommonDataSource

setLogWriter

public void setLogWriter(PrintWriter pw)
                  throws SQLException
LogWriter methods are not supported.

Specified by:
setLogWriter in interface CommonDataSource
Throws:
SQLException

unwrap

public <T> T unwrap(Class<T> iface)
         throws SQLException
Specified by:
unwrap in interface Wrapper
Throws:
SQLException

isWrapperFor

public boolean isWrapperFor(Class<?> iface)
                     throws SQLException
Specified by:
isWrapperFor in interface Wrapper
Throws:
SQLException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractDriverBasedDataSource

org.springframework.jdbc.datasource
Class AbstractDriverBasedDataSource

java.lang.Object
    extended by  org.springframework.jdbc.datasource.AbstractDataSource
        extended by  org.springframework.jdbc.datasource.AbstractDriverBasedDataSource
All Implemented Interfaces:
Wrapper, CommonDataSource, DataSource
Direct Known Subclasses:
DriverManagerDataSource, SimpleDriverDataSource
public abstract class AbstractDriverBasedDataSource
extends AbstractDataSource

Abstract base class for JDBC DataSource implementations that operate on a JDBC Driver.

Since:
2.5.5
Author:
Juergen Hoeller
See Also:
SimpleDriverDataSource, DriverManagerDataSource

Field Summary
Fields inherited from class org.springframework.jdbc.datasource.AbstractDataSource
logger
Constructor Summary
AbstractDriverBasedDataSource()
Method Summary
Connection | getConnection() This implementation delegates to getConnectionFromDriver, using the default username and password of this DataSource.
Connection | getConnection(String username, String password) This implementation delegates to getConnectionFromDriver, using the given username and password.
protected abstract Connection | getConnectionFromDriver(Properties props) Obtain a Connection using the given properties.
protected Connection | getConnectionFromDriver(String username, String password) Build properties for the Driver, including the given username and password (if any), and obtain a corresponding Connection.
Properties | getConnectionProperties() Return the connection properties to be passed to the Driver, if any.
String | getPassword() Return the JDBC password to use for connecting through the Driver.
String | getUrl() Return the JDBC URL to use for connecting through the Driver.
String | getUsername() Return the JDBC username to use for connecting through the Driver.
void | setConnectionProperties(Properties connectionProperties) Specify arbitrary connection properties as key/value pairs, to be passed to the Driver.
void | setPassword(String password) Set the JDBC password to use for connecting through the Driver.
void | setUrl(String url) Set the JDBC URL to use for connecting through the Driver.
void | setUsername(String username) Set the JDBC username to use for connecting through the Driver.
Methods inherited from class org.springframework.jdbc.datasource.AbstractDataSource
getLoginTimeout, getLogWriter, isWrapperFor, setLoginTimeout, setLogWriter, unwrap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractDriverBasedDataSource

public AbstractDriverBasedDataSource()
Method Detail

setUrl

public void setUrl(String url)
Set the JDBC URL to use for connecting through the Driver.

See Also:
Driver.connect(String, java.util.Properties)

getUrl

public String getUrl()
Return the JDBC URL to use for connecting through the Driver.

setUsername

public void setUsername(String username)
Set the JDBC username to use for connecting through the Driver.

See Also:
Driver.connect(String, java.util.Properties)

getUsername

public String getUsername()
Return the JDBC username to use for connecting through the Driver.

setPassword

public void setPassword(String password)
Set the JDBC password to use for connecting through the Driver.

See Also:
Driver.connect(String, java.util.Properties)

getPassword

public String getPassword()
Return the JDBC password to use for connecting through the Driver.

setConnectionProperties

public void setConnectionProperties(Properties connectionProperties)
Specify arbitrary connection properties as key/value pairs, to be passed to the Driver.

Can also contain "user" and "password" properties. However, any "username" and "password" bean properties specified on this DataSource will override the corresponding connection properties.

See Also:
Driver.connect(String, java.util.Properties)

getConnectionProperties

public Properties getConnectionProperties()
Return the connection properties to be passed to the Driver, if any.

getConnection

public Connection getConnection()
                         throws SQLException
This implementation delegates to getConnectionFromDriver, using the default username and password of this DataSource.

Throws:
SQLException
See Also:
getConnectionFromDriver(String, String),
setUsername(java.lang.String),
setPassword(java.lang.String)

getConnection

public Connection getConnection(String username,
                                String password)
                         throws SQLException
This implementation delegates to getConnectionFromDriver, using the given username and password.

Throws:
SQLException
See Also:
getConnectionFromDriver(String, String)

getConnectionFromDriver

protected Connection getConnectionFromDriver(String username,
                                             String password)
                                      throws SQLException
Build properties for the Driver, including the given username and password (if any), and obtain a corresponding Connection.

Parameters:
username - the name of the user
password - the password to use
Returns:
the obtained Connection
Throws:
SQLException - in case of failure
See Also:
Driver.connect(String, java.util.Properties)

getConnectionFromDriver

protected abstract Connection getConnectionFromDriver(Properties props)
                                               throws SQLException
Obtain a Connection using the given properties.

Template method to be implemented by subclasses.

Parameters:
props - the merged connection properties
Returns:
the obtained Connection
Throws:
SQLException - in case of failure
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConnectionHolder

org.springframework.jdbc.datasource
Class ConnectionHolder

java.lang.Object
    extended by  org.springframework.transaction.support.ResourceHolderSupport
        extended by  org.springframework.jdbc.datasource.ConnectionHolder
All Implemented Interfaces:
ResourceHolder
public class ConnectionHolder
extends ResourceHolderSupport

Connection holder, wrapping a JDBC Connection. DataSourceTransactionManager binds instances of this class to the thread, for a specific DataSource.

Inherits rollback-only support for nested JDBC transactions and reference count functionality from the base class.

Note: This is an SPI class, not intended to be used by applications.

Since:
06.05.2003
Author:
Juergen Hoeller
See Also:
DataSourceTransactionManager, DataSourceUtils

Field Summary
static String SAVEPOINT_NAME_PREFIX
Constructor Summary
ConnectionHolder(Connection connection)
Create a new ConnectionHolder for the given JDBC Connection, wrapping it with a SimpleConnectionHandle, assuming that there is no ongoing transaction.
ConnectionHolder(Connection connection, boolean transactionActive)
Create a new ConnectionHolder for the given JDBC Connection, wrapping it with a SimpleConnectionHandle.
ConnectionHolder(ConnectionHandle connectionHandle)
Create a new ConnectionHolder for the given ConnectionHandle.
Method Summary
void | clear() Clear the transactional state of this resource holder.
Savepoint | createSavepoint() Create a new JDBC 3.0 Savepoint for the current Connection, using generated savepoint names that are unique for the Connection.
Connection | getConnection() Return the current Connection held by this ConnectionHolder.
ConnectionHandle | getConnectionHandle() Return the ConnectionHandle held by this ConnectionHolder.
protected boolean | hasConnection() Return whether this holder currently has a Connection.
protected boolean | isTransactionActive() Return whether this holder represents an active, JDBC-managed transaction.
void | released() Releases the current Connection held by this ConnectionHolder.
protected void | setConnection(Connection connection) Override the existing Connection handle with the given Connection.
protected void | setTransactionActive(boolean transactionActive) Set whether this holder represents an active, JDBC-managed transaction.
boolean | supportsSavepoints() Return whether JDBC 3.0 Savepoints are supported.
Methods inherited from class org.springframework.transaction.support.ResourceHolderSupport
getDeadline, getTimeToLiveInMillis, getTimeToLiveInSeconds, hasTimeout, isOpen, isRollbackOnly, isSynchronizedWithTransaction, isVoid, requested, reset, setRollbackOnly, setSynchronizedWithTransaction, setTimeoutInMillis, setTimeoutInSeconds, unbound
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

SAVEPOINT_NAME_PREFIX

public static final String SAVEPOINT_NAME_PREFIX
See Also:
Constant Field Values
Constructor Detail

ConnectionHolder

public ConnectionHolder(ConnectionHandle connectionHandle)
Create a new ConnectionHolder for the given ConnectionHandle.

Parameters:
connectionHandle - the ConnectionHandle to hold

ConnectionHolder

public ConnectionHolder(Connection connection)
Create a new ConnectionHolder for the given JDBC Connection, wrapping it with a SimpleConnectionHandle, assuming that there is no ongoing transaction.

Parameters:
connection - the JDBC Connection to hold
See Also:
SimpleConnectionHandle, ConnectionHolder(java.sql.Connection, boolean)

ConnectionHolder

public ConnectionHolder(Connection connection,
                        boolean transactionActive)
Create a new ConnectionHolder for the given JDBC Connection, wrapping it with a SimpleConnectionHandle.

Parameters:
connection - the JDBC Connection to hold
transactionActive - whether the given Connection is involved in an ongoing transaction
See Also:
SimpleConnectionHandle
Method Detail

getConnectionHandle

public ConnectionHandle getConnectionHandle()
Return the ConnectionHandle held by this ConnectionHolder.

hasConnection

protected boolean hasConnection()
Return whether this holder currently has a Connection.

setTransactionActive

protected void setTransactionActive(boolean transactionActive)
Set whether this holder represents an active, JDBC-managed transaction.

See Also:
DataSourceTransactionManager

isTransactionActive

protected boolean isTransactionActive()
Return whether this holder represents an active, JDBC-managed transaction.

setConnection

protected void setConnection(Connection connection)
Override the existing Connection handle with the given Connection. Reset the handle if given null.

Used for releasing the Connection on suspend (with a null argument) and setting a fresh Connection on resume.

getConnection

public Connection getConnection()
Return the current Connection held by this ConnectionHolder.

This will be the same Connection until released gets called on the ConnectionHolder, which will reset the held Connection, fetching a new Connection on demand.

See Also:
ConnectionHandle.getConnection(), released()

supportsSavepoints

public boolean supportsSavepoints()
                           throws SQLException
Return whether JDBC 3.0 Savepoints are supported. Caches the flag for the lifetime of this ConnectionHolder.

Throws:
SQLException - if thrown by the JDBC driver

createSavepoint

public Savepoint createSavepoint()
                          throws SQLException
Create a new JDBC 3.0 Savepoint for the current Connection, using generated savepoint names that are unique for the Connection.

Returns:
the new Savepoint
Throws:
SQLException - if thrown by the JDBC driver

released

public void released()
Releases the current Connection held by this ConnectionHolder.

This is necessary for ConnectionHandles that expect "Connection borrowing", where each returned Connection is only temporarily leased and needs to be returned once the data operation is done, to make the Connection available for other operations within the same transaction. This is the case with JDO 2.0 DataStoreConnections, for example.

Overrides:
released in class ResourceHolderSupport
See Also:
DefaultJdoDialect.getJdbcConnection(javax.jdo.PersistenceManager, boolean)

clear

public void clear()
Description copied from class: ResourceHolderSupport
Clear the transactional state of this resource holder.

Overrides:
clear in class ResourceHolderSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DataSourceTransactionManager

org.springframework.jdbc.datasource
Class DataSourceTransactionManager

java.lang.Object
    extended by  org.springframework.transaction.support.AbstractPlatformTransactionManager
        extended by  org.springframework.jdbc.datasource.DataSourceTransactionManager
All Implemented Interfaces:
Serializable, InitializingBean, PlatformTransactionManager, ResourceTransactionManager
public class DataSourceTransactionManager
extends AbstractPlatformTransactionManager
implements ResourceTransactionManager, InitializingBean

PlatformTransactionManager implementation for a single JDBC DataSource. This class is capable of working in any environment with any JDBC driver, as long as the setup uses a JDBC 2.0 Standard Extensions / JDBC 3.0 javax.sql.DataSource as its Connection factory mechanism. Binds a JDBC Connection from the specified DataSource to the current thread, potentially allowing for one thread-bound Connection per DataSource.

Note: The DataSource that this transaction manager operates on needs to return independent Connections. The Connections may come from a pool (the typical case), but the DataSource must not return thread-scoped / request-scoped Connections or the like. This transaction manager will associate Connections with thread-bound transactions itself, according to the specified propagation behavior. It assumes that a separate, independent Connection can be obtained even during an ongoing transaction.

Application code is required to retrieve the JDBC Connection via DataSourceUtils.getConnection(DataSource) instead of a standard J2EE-style DataSource.getConnection() call. Spring classes such as JdbcTemplate use this strategy implicitly. If not used in combination with this transaction manager, the DataSourceUtils lookup strategy behaves exactly like the native DataSource lookup; it can thus be used in a portable fashion.

Alternatively, you can allow application code to work with the standard J2EE-style lookup pattern DataSource.getConnection(), for example for legacy code that is not aware of Spring at all. In that case, define a TransactionAwareDataSourceProxy for your target DataSource, and pass that proxy DataSource to your DAOs, which will automatically participate in Spring-managed transactions when accessing it.

Supports custom isolation levels, and timeouts which get applied as appropriate JDBC statement timeouts. To support the latter, application code must either use JdbcTemplate, call DataSourceUtils.applyTransactionTimeout(java.sql.Statement, javax.sql.DataSource) for each created JDBC Statement, or go through a TransactionAwareDataSourceProxy which will create timeout-aware JDBC Connections and Statements automatically.

Consider defining a LazyConnectionDataSourceProxy for your target DataSource, pointing both this transaction manager and your DAOs to it. This will lead to optimized handling of "empty" transactions, i.e. of transactions without any JDBC statements executed. A LazyConnectionDataSourceProxy will not fetch an actual JDBC Connection from the target DataSource until a Statement gets executed, lazily applying the specified transaction settings to the target Connection.

On JDBC 3.0, this transaction manager supports nested transactions via the JDBC 3.0 Savepoint mechanism. The "nestedTransactionAllowed" flag defaults to "true", since nested transactions will work without restrictions on JDBC drivers that support savepoints (such as the Oracle JDBC driver).

This transaction manager can be used as a replacement for the JtaTransactionManager in the single resource case, as it does not require a container that supports JTA, typically in combination with a locally defined JDBC DataSource (e.g. a Jakarta Commons DBCP connection pool). Switching between this local strategy and a JTA environment is just a matter of configuration!

Since:
02.05.2003
Author:
Juergen Hoeller
See Also:
AbstractPlatformTransactionManager.setNestedTransactionAllowed(boolean), Savepoint, DataSourceUtils.getConnection(javax.sql.DataSource), DataSourceUtils.applyTransactionTimeout(java.sql.Statement, javax.sql.DataSource), DataSourceUtils.releaseConnection(java.sql.Connection, javax.sql.DataSource), TransactionAwareDataSourceProxy, LazyConnectionDataSourceProxy, JdbcTemplate, Serialized Form

Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
AbstractPlatformTransactionManager.SuspendedResourcesHolder
Field Summary
Fields inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
logger, SYNCHRONIZATION_ALWAYS, SYNCHRONIZATION_NEVER, SYNCHRONIZATION_ON_ACTUAL_TRANSACTION
Constructor Summary
DataSourceTransactionManager()
Create a new DataSourceTransactionManager instance.
DataSourceTransactionManager(DataSource dataSource)
Create a new DataSourceTransactionManager instance.
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected void | doBegin(Object transaction, TransactionDefinition definition) This implementation sets the isolation level but ignores the timeout.
protected void | doCleanupAfterCompletion(Object transaction) Cleanup resources after transaction completion.
protected void | doCommit(DefaultTransactionStatus status) Perform an actual commit of the given transaction.
protected Object | doGetTransaction() Return a transaction object for the current transaction state.
protected void | doResume(Object transaction, Object suspendedResources) Resume the resources of the current transaction.
protected void | doRollback(DefaultTransactionStatus status) Perform an actual rollback of the given transaction.
protected void | doSetRollbackOnly(DefaultTransactionStatus status) Set the given transaction rollback-only.
protected Object | doSuspend(Object transaction) Suspend the resources of the current transaction.
DataSource | getDataSource() Return the JDBC DataSource that this instance manages transactions for.
Object | getResourceFactory() Return the resource factory that this transaction manager operates on, e.g.
protected boolean | isExistingTransaction(Object transaction) Check if the given transaction object indicates an existing transaction (that is, a transaction which has already started).
void | setDataSource(DataSource dataSource) Set the JDBC DataSource that this instance should manage transactions for.
Methods inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
commit, determineTimeout, getDefaultTimeout, getTransaction, getTransactionSynchronization, invokeAfterCompletion, isFailEarlyOnGlobalRollbackOnly, isGlobalRollbackOnParticipationFailure, isNestedTransactionAllowed, isRollbackOnCommitFailure, isValidateExistingTransaction, newTransactionStatus, prepareForCommit, prepareSynchronization, prepareTransactionStatus, registerAfterCompletionWithExistingTransaction, resume, rollback, setDefaultTimeout, setFailEarlyOnGlobalRollbackOnly, setGlobalRollbackOnParticipationFailure, setNestedTransactionAllowed, setRollbackOnCommitFailure, setTransactionSynchronization, setTransactionSynchronizationName, setValidateExistingTransaction, shouldCommitOnGlobalRollbackOnly, suspend, triggerBeforeCommit, triggerBeforeCompletion, useSavepointForNestedTransaction
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.transaction.PlatformTransactionManager
commit, getTransaction, rollback

Constructor Detail

DataSourceTransactionManager

public DataSourceTransactionManager()
Create a new DataSourceTransactionManager instance. A DataSource has to be set to be able to use it.

See Also:
setDataSource(javax.sql.DataSource)

DataSourceTransactionManager

public DataSourceTransactionManager(DataSource dataSource)
Create a new DataSourceTransactionManager instance.

Parameters:
dataSource - JDBC DataSource to manage transactions for
Method Detail

setDataSource

public void setDataSource(DataSource dataSource)
Set the JDBC DataSource that this instance should manage transactions for.

This will typically be a locally defined DataSource, for example a Jakarta Commons DBCP connection pool. Alternatively, you can also drive transactions for a non-XA J2EE DataSource fetched from JNDI. For an XA DataSource, use JtaTransactionManager.

The DataSource specified here should be the target DataSource to manage transactions for, not a TransactionAwareDataSourceProxy. Only data access code may work with TransactionAwareDataSourceProxy, while the transaction manager needs to work on the underlying target DataSource. If there's nevertheless a TransactionAwareDataSourceProxy passed in, it will be unwrapped to extract its target DataSource.

The DataSource passed in here needs to return independent Connections. The Connections may come from a pool (the typical case), but the DataSource must not return thread-scoped / request-scoped Connections or the like.

See Also:
TransactionAwareDataSourceProxy, JtaTransactionManager

getDataSource

public DataSource getDataSource()
Return the JDBC DataSource that this instance manages transactions for.

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

getResourceFactory

public Object getResourceFactory()
Description copied from interface: ResourceTransactionManager
Return the resource factory that this transaction manager operates on, e.g. a JDBC DataSource or a JMS ConnectionFactory.

This target resource factory is usually used as resource key for TransactionSynchronizationManager's resource bindings per thread.

Specified by:
getResourceFactory in interface ResourceTransactionManager
Returns:
the target resource factory (never null)
See Also:
TransactionSynchronizationManager.bindResource(java.lang.Object, java.lang.Object), TransactionSynchronizationManager.getResource(java.lang.Object)

doGetTransaction

protected Object doGetTransaction()
Description copied from class: AbstractPlatformTransactionManager
Return a transaction object for the current transaction state.

The returned object will usually be specific to the concrete transaction manager implementation, carrying corresponding transaction state in a modifiable fashion. This object will be passed into the other template methods (e.g. doBegin and doCommit), either directly or as part of a DefaultTransactionStatus instance.

The returned object should contain information about any existing transaction, that is, a transaction that has already started before the current getTransaction call on the transaction manager. Consequently, a doGetTransaction implementation will usually look for an existing transaction and store corresponding state in the returned transaction object.

Specified by:
doGetTransaction in class AbstractPlatformTransactionManager
Returns:
the current transaction object
See Also:
AbstractPlatformTransactionManager.doBegin(java.lang.Object, org.springframework.transaction.TransactionDefinition),
AbstractPlatformTransactionManager.doCommit(org.springframework.transaction.support.DefaultTransactionStatus),
AbstractPlatformTransactionManager.doRollback(org.springframework.transaction.support.DefaultTransactionStatus),
DefaultTransactionStatus.getTransaction()

isExistingTransaction

protected boolean isExistingTransaction(Object transaction)
Description copied from class: AbstractPlatformTransactionManager
Check if the given transaction object indicates an existing transaction (that is, a transaction which has already started).

The result will be evaluated according to the specified propagation behavior for the new transaction. An existing transaction might get suspended (in case of PROPAGATION_REQUIRES_NEW), or the new transaction might participate in the existing one (in case of PROPAGATION_REQUIRED).

The default implementation returns false, assuming that participating in existing transactions is generally not supported. Subclasses are of course encouraged to provide such support.

Overrides:
isExistingTransaction in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
Returns:
if there is an existing transaction
See Also:
AbstractPlatformTransactionManager.doGetTransaction()

doBegin

protected void doBegin(Object transaction,
                       TransactionDefinition definition)
This implementation sets the isolation level but ignores the timeout.

Specified by:
doBegin in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
definition - TransactionDefinition instance, describing propagation behavior, isolation level, read-only flag, timeout, and transaction name

doSuspend

protected Object doSuspend(Object transaction)
Description copied from class: AbstractPlatformTransactionManager
Suspend the resources of the current transaction. Transaction synchronization will already have been suspended.

The default implementation throws a TransactionSuspensionNotSupportedException, assuming that transaction suspension is generally not supported.

Overrides:
doSuspend in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
Returns:
an object that holds suspended resources (will be kept unexamined for passing it into doResume)
See Also:
AbstractPlatformTransactionManager.doResume(java.lang.Object, java.lang.Object)

doResume

protected void doResume(Object transaction,
                        Object suspendedResources)
Description copied from class: AbstractPlatformTransactionManager
Resume the resources of the current transaction. Transaction synchronization will be resumed afterwards.

The default implementation throws a TransactionSuspensionNotSupportedException, assuming that transaction suspension is generally not supported.

Overrides:
doResume in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
suspendedResources - the object that holds suspended resources, as returned by doSuspend
See Also:
AbstractPlatformTransactionManager.doSuspend(java.lang.Object)

doCommit

protected void doCommit(DefaultTransactionStatus status)
Description copied from class: AbstractPlatformTransactionManager
Perform an actual commit of the given transaction.

An implementation does not need to check the "new transaction" flag or the rollback-only flag; this will already have been handled before. Usually, a straight commit will be performed on the transaction object contained in the passed-in status.

Specified by:
doCommit in class AbstractPlatformTransactionManager
Parameters:
status - the status representation of the transaction
See Also:
DefaultTransactionStatus.getTransaction()

doRollback

protected void doRollback(DefaultTransactionStatus status)
Description copied from class: AbstractPlatformTransactionManager
Perform an actual rollback of the given transaction.

An implementation does not need to check the "new transaction" flag; this will already have been handled before. Usually, a straight rollback will be performed on the transaction object contained in the passed-in status.

Specified by:
doRollback in class AbstractPlatformTransactionManager
Parameters:
status - the status representation of the transaction
See Also:
DefaultTransactionStatus.getTransaction()

doSetRollbackOnly

protected void doSetRollbackOnly(DefaultTransactionStatus status)
Description copied from class: AbstractPlatformTransactionManager
Set the given transaction rollback-only. Only called on rollback if the current transaction participates in an existing one.

The default implementation throws an IllegalTransactionStateException, assuming that participating in existing transactions is generally not supported. Subclasses are of course encouraged to provide such support.

Overrides:
doSetRollbackOnly in class AbstractPlatformTransactionManager
Parameters:
status - the status representation of the transaction

doCleanupAfterCompletion

protected void doCleanupAfterCompletion(Object transaction)
Description copied from class: AbstractPlatformTransactionManager
Cleanup resources after transaction completion.

Called after doCommit and doRollback execution, on any outcome. The default implementation does nothing.

Should not throw any exceptions but just issue warnings on errors.

Overrides:
doCleanupAfterCompletion in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DataSourceUtils

org.springframework.jdbc.datasource
Class DataSourceUtils

java.lang.Object
    extended by  org.springframework.jdbc.datasource.DataSourceUtils

public abstract class DataSourceUtils
extends Object

Helper class that provides static methods for obtaining JDBC Connections from a DataSource. Includes special support for Spring-managed transactional Connections, e.g. managed by DataSourceTransactionManager or JtaTransactionManager.

Used internally by Spring's JdbcTemplate, Spring's JDBC operation objects and the JDBC DataSourceTransactionManager. Can also be used directly in application code.

Author:
Rod Johnson, Juergen Hoeller
See Also:
getConnection(javax.sql.DataSource), releaseConnection(java.sql.Connection, javax.sql.DataSource), DataSourceTransactionManager, JtaTransactionManager, TransactionSynchronizationManager

Field Summary
static int CONNECTION_SYNCHRONIZATION_ORDER
Order value for TransactionSynchronization objects that clean up JDBC Connections.
Constructor Summary
DataSourceUtils()
Method Summary
static void | applyTimeout(Statement stmt, DataSource dataSource, int timeout) Apply the specified timeout - overridden by the current transaction timeout, if any - to the given JDBC Statement object.
static void | applyTransactionTimeout(Statement stmt, DataSource dataSource) Apply the current transaction timeout, if any, to the given JDBC Statement object.
static Connection | doGetConnection(DataSource dataSource) Actually obtain a JDBC Connection from the given DataSource.
static void | doReleaseConnection(Connection con, DataSource dataSource) Actually close the given Connection, obtained from the given DataSource.
static Connection | getConnection(DataSource dataSource) Obtain a Connection from the given DataSource.
static Connection | getTargetConnection(Connection con) Return the innermost target Connection of the given Connection.
static boolean | isConnectionTransactional(Connection con, DataSource dataSource) Determine whether the given JDBC Connection is transactional, that is, bound to the current thread by Spring's transaction facilities.
static Integer | prepareConnectionForTransaction(Connection con, TransactionDefinition definition) Prepare the given Connection with the given transaction semantics.
static void | releaseConnection(Connection con, DataSource dataSource) Close the given Connection, obtained from the given DataSource, if it is not managed externally (that is, not bound to the thread).
static void | resetConnectionAfterTransaction(Connection con, Integer previousIsolationLevel) Reset the given Connection after a transaction, regarding read-only flag and isolation level.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

CONNECTION_SYNCHRONIZATION_ORDER

public static final int CONNECTION_SYNCHRONIZATION_ORDER
Order value for TransactionSynchronization objects that clean up JDBC Connections.

See Also:
Constant Field Values
Constructor Detail

DataSourceUtils

public DataSourceUtils()
Method Detail

getConnection

public static Connection getConnection(DataSource dataSource)
                                throws CannotGetJdbcConnectionException
Obtain a Connection from the given DataSource. Translates SQLExceptions into the Spring hierarchy of unchecked generic data access exceptions, simplifying calling code and making any exception that is thrown more meaningful.

Is aware of a corresponding Connection bound to the current thread, for example when using DataSourceTransactionManager. Will bind a Connection to the thread if transaction synchronization is active, e.g. when running within a JTA transaction).

Parameters:
dataSource - the DataSource to obtain Connections from
Returns:
a JDBC Connection from the given DataSource
Throws:
CannotGetJdbcConnectionException - if the attempt to get a Connection failed
See Also:
releaseConnection(java.sql.Connection, javax.sql.DataSource)

doGetConnection

public static Connection doGetConnection(DataSource dataSource)
                                  throws SQLException
Actually obtain a JDBC Connection from the given DataSource. Same as getConnection(javax.sql.DataSource), but throwing the original SQLException.

Is aware of a corresponding Connection bound to the current thread, for example when using DataSourceTransactionManager. Will bind a Connection to the thread if transaction synchronization is active (e.g. if in a JTA transaction).

Directly accessed by TransactionAwareDataSourceProxy.

Parameters:
dataSource - the DataSource to obtain Connections from
Returns:
a JDBC Connection from the given DataSource
Throws:
SQLException - if thrown by JDBC methods
See Also:
doReleaseConnection(java.sql.Connection, javax.sql.DataSource)

prepareConnectionForTransaction

public static Integer prepareConnectionForTransaction(Connection con,
                                                      TransactionDefinition definition)
                                               throws SQLException
Prepare the given Connection with the given transaction semantics.

Parameters:
con - the Connection to prepare
definition - the transaction definition to apply
Returns:
the previous isolation level, if any
Throws:
SQLException - if thrown by JDBC methods
See Also:
resetConnectionAfterTransaction(java.sql.Connection, java.lang.Integer)

resetConnectionAfterTransaction

public static void resetConnectionAfterTransaction(Connection con,
                                                   Integer previousIsolationLevel)
Reset the given Connection after a transaction, regarding read-only flag and isolation level.

Parameters:
con - the Connection to reset
previousIsolationLevel - the isolation level to restore, if any
See Also:
prepareConnectionForTransaction(java.sql.Connection, org.springframework.transaction.TransactionDefinition)

isConnectionTransactional

public static boolean isConnectionTransactional(Connection con,
                                                DataSource dataSource)
Determine whether the given JDBC Connection is transactional, that is, bound to the current thread by Spring's transaction facilities.

Parameters:
con - the Connection to check
dataSource - the DataSource that the Connection was obtained from (may be null)
Returns:
whether the Connection is transactional

applyTransactionTimeout

public static void applyTransactionTimeout(Statement stmt,
                                           DataSource dataSource)
                                    throws SQLException
Apply the current transaction timeout, if any, to the given JDBC Statement object.

Parameters:
stmt - the JDBC Statement object
dataSource - the DataSource that the Connection was obtained from
Throws:
SQLException - if thrown by JDBC methods
See Also:
Statement.setQueryTimeout(int)

applyTimeout

public static void applyTimeout(Statement stmt,
                                DataSource dataSource,
                                int timeout)
                         throws SQLException
Apply the specified timeout - overridden by the current transaction timeout, if any - to the given JDBC Statement object.

Parameters:
stmt - the JDBC Statement object
dataSource - the DataSource that the Connection was obtained from
timeout - the timeout to apply (or 0 for no timeout outside of a transaction)
Throws:
SQLException - if thrown by JDBC methods
See Also:
Statement.setQueryTimeout(int)

releaseConnection

public static void releaseConnection(Connection con,
                                     DataSource dataSource)
Close the given Connection, obtained from the given DataSource, if it is not managed externally (that is, not bound to the thread).

Parameters:
con - the Connection to close if necessary (if this is null, the call will be ignored)
dataSource - the DataSource that the Connection was obtained from (may be null)
See Also:
getConnection(javax.sql.DataSource)

doReleaseConnection

public static void doReleaseConnection(Connection con,
                                       DataSource dataSource)
                                throws SQLException
Actually close the given Connection, obtained from the given DataSource. Same as releaseConnection(java.sql.Connection, javax.sql.DataSource), but throwing the original SQLException.

Directly accessed by TransactionAwareDataSourceProxy.

Parameters:
con - the Connection to close if necessary (if this is null, the call will be ignored)
dataSource - the DataSource that the Connection was obtained from (may be null)
Throws:
SQLException - if thrown by JDBC methods
See Also:
doGetConnection(javax.sql.DataSource)

getTargetConnection

public static Connection getTargetConnection(Connection con)
Return the innermost target Connection of the given Connection. If the given Connection is a proxy, it will be unwrapped until a non-proxy Connection is found. Otherwise, the passed-in Connection will be returned as-is.

Parameters:
con - the Connection proxy to unwrap
Returns:
the innermost target Connection, or the passed-in one if no proxy
See Also:
ConnectionProxy.getTargetConnection()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DelegatingDataSource

org.springframework.jdbc.datasource
Class DelegatingDataSource

java.lang.Object
    extended by  org.springframework.jdbc.datasource.DelegatingDataSource
All Implemented Interfaces:
Wrapper, CommonDataSource, DataSource, InitializingBean
Direct Known Subclasses:
LazyConnectionDataSourceProxy, TransactionAwareDataSourceProxy, UserCredentialsDataSourceAdapter
public class DelegatingDataSource
extends Object
implements DataSource, InitializingBean

JDBC DataSource implementation that delegates all calls to a given target DataSource.

This class is meant to be subclassed, with subclasses overriding only those methods (such as getConnection()) that should not simply delegate to the target DataSource.

Since:
1.1
Author:
Juergen Hoeller
See Also:
getConnection()

Constructor Summary
DelegatingDataSource()
Create a new DelegatingDataSource.
DelegatingDataSource(DataSource targetDataSource)
Create a new DelegatingDataSource.
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 Connection getConnection()
 Connection getConnection(String username, String password)
 int getLoginTimeout()
 PrintWriter getLogWriter()
 DataSource getTargetDataSource()
Return the target DataSource that this DataSource should delegate to.
 boolean isWrapperFor(Class<?> iface)
 void setLoginTimeout(int seconds)
 void setLogWriter(PrintWriter out)
 void setTargetDataSource(DataSource targetDataSource)
Set the target DataSource that this DataSource should delegate to.
<T> T
unwrap(Class<T> iface)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DelegatingDataSource

public DelegatingDataSource()
Create a new DelegatingDataSource.

See Also:
setTargetDataSource(javax.sql.DataSource)

DelegatingDataSource

public DelegatingDataSource(DataSource targetDataSource)
Create a new DelegatingDataSource.

Parameters:
targetDataSource - the target DataSource
Method Detail

setTargetDataSource

public void setTargetDataSource(DataSource targetDataSource)
Set the target DataSource that this DataSource should delegate to.

getTargetDataSource

public DataSource getTargetDataSource()
Return the target DataSource that this DataSource should delegate to.

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

getConnection

public Connection getConnection()
                         throws SQLException
Specified by:
getConnection in interface DataSource
Throws:
SQLException

getConnection

public Connection getConnection(String username,
                                String password)
                         throws SQLException
Specified by:
getConnection in interface DataSource
Throws:
SQLException

getLogWriter

public PrintWriter getLogWriter()
                         throws SQLException
Specified by:
getLogWriter in interface CommonDataSource
Throws:
SQLException

setLogWriter

public void setLogWriter(PrintWriter out)
                  throws SQLException
Specified by:
setLogWriter in interface CommonDataSource
Throws:
SQLException

getLoginTimeout

public int getLoginTimeout()
                    throws SQLException
Specified by:
getLoginTimeout in interface CommonDataSource
Throws:
SQLException

setLoginTimeout

public void setLoginTimeout(int seconds)
                     throws SQLException
Specified by:
setLoginTimeout in interface CommonDataSource
Throws:
SQLException

unwrap

public <T> T unwrap(Class<T> iface)
         throws SQLException
Specified by:
unwrap in interface Wrapper
Throws:
SQLException

isWrapperFor

public boolean isWrapperFor(Class<?> iface)
                     throws SQLException
Specified by:
isWrapperFor in interface Wrapper
Throws:
SQLException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DriverManagerDataSource

org.springframework.jdbc.datasource
Class DriverManagerDataSource

java.lang.Object
    extended by  org.springframework.jdbc.datasource.AbstractDataSource
        extended by  org.springframework.jdbc.datasource.AbstractDriverBasedDataSource
            extended by  org.springframework.jdbc.datasource.DriverManagerDataSource
All Implemented Interfaces:
Wrapper, CommonDataSource, DataSource
Direct Known Subclasses:
SingleConnectionDataSource
public class DriverManagerDataSource
extends AbstractDriverBasedDataSource

Simple implementation of the standard JDBC DataSource interface, configuring the plain old JDBC DriverManager via bean properties, and returning a new Connection from every getConnection call.

NOTE: This class is not an actual connection pool; it does not actually pool Connections. It just serves as simple replacement for a full-blown connection pool, implementing the same standard interface, but creating new Connections on every call.

Useful for test or standalone environments outside of a J2EE container, either as a DataSource bean in a corresponding ApplicationContext or in conjunction with a simple JNDI environment. Pool-assuming Connection.close() calls will simply close the Connection, so any DataSource-aware persistence code should work.

NOTE: Within special class loading environments such as OSGi, this class is effectively superseded by SimpleDriverDataSource due to general class loading issues with the JDBC DriverManager that be resolved through direct Driver usage (which is exactly what SimpleDriverDataSource does).

In a J2EE container, it is recommended to use a JNDI DataSource provided by the container. Such a DataSource can be exposed as a DataSource bean in a Spring ApplicationContext via JndiObjectFactoryBean, for seamless switching to and from a local DataSource bean like this class. For tests, you can then either set up a mock JNDI environment through Spring's SimpleNamingContextBuilder, or switch the bean definition to a local DataSource (which is simpler and thus recommended).

If you need a "real" connection pool outside of a J2EE container, consider Apache's Jakarta Commons DBCP or C3P0. Commons DBCP's BasicDataSource and C3P0's ComboPooledDataSource are full connection pool beans, supporting the same basic properties as this class plus specific settings (such as minimal/maximal pool size etc).

Since:
14.03.2003
Author:
Juergen Hoeller
See Also:
SimpleDriverDataSource

Field Summary
Fields inherited from class org.springframework.jdbc.datasource.AbstractDataSource
logger
Constructor Summary
DriverManagerDataSource()
Constructor for bean-style configuration.
DriverManagerDataSource(String url)
Create a new DriverManagerDataSource with the given JDBC URL, not specifying a username or password for JDBC access.
DriverManagerDataSource(String url, Properties conProps)
Create a new DriverManagerDataSource with the given JDBC URL, not specifying a username or password for JDBC access.
DriverManagerDataSource(String url, String username, String password)
Create a new DriverManagerDataSource with the given standard DriverManager parameters.
DriverManagerDataSource(String driverClassName, String url, String username, String password)
Deprecated. since Spring 2.5. DriverManagerDataSource is primarily intended for accessing pre-registered JDBC drivers. If you need to register a new driver, consider using SimpleDriverDataSource instead.
Method Summary
protected Connection | getConnectionFromDriver(Properties props) Obtain a Connection using the given properties.
protected Connection | getConnectionFromDriverManager(String url, Properties props) Getting a Connection using the nasty static from DriverManager is extracted into a protected method to allow for easy unit testing.
void | setDriverClassName(String driverClassName) Set the JDBC driver class name.
Methods inherited from class org.springframework.jdbc.datasource.AbstractDriverBasedDataSource
getConnection, getConnection, getConnectionFromDriver, getConnectionProperties, getPassword, getUrl, getUsername, setConnectionProperties, setPassword, setUrl, setUsername
Methods inherited from class org.springframework.jdbc.datasource.AbstractDataSource
getLoginTimeout, getLogWriter, isWrapperFor, setLoginTimeout, setLogWriter, unwrap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DriverManagerDataSource

public DriverManagerDataSource()
Constructor for bean-style configuration.

DriverManagerDataSource

public DriverManagerDataSource(String url)
Create a new DriverManagerDataSource with the given JDBC URL, not specifying a username or password for JDBC access.

Parameters:
url - the JDBC URL to use for accessing the DriverManager
See Also:
DriverManager.getConnection(String)

DriverManagerDataSource

public DriverManagerDataSource(String url,
                               String username,
                               String password)
Create a new DriverManagerDataSource with the given standard DriverManager parameters.

Parameters:
url - the JDBC URL to use for accessing the DriverManager
username - the JDBC username to use for accessing the DriverManager
password - the JDBC password to use for accessing the DriverManager
See Also:
DriverManager.getConnection(String, String, String)

DriverManagerDataSource

public DriverManagerDataSource(String url,
                               Properties conProps)
Create a new DriverManagerDataSource with the given JDBC URL, not specifying a username or password for JDBC access.

Parameters:
url - the JDBC URL to use for accessing the DriverManager
conProps - JDBC connection properties
See Also:
DriverManager.getConnection(String)

DriverManagerDataSource

@Deprecated
public DriverManagerDataSource(String driverClassName,
                                          String url,
                                          String username,
                                          String password)
Deprecated. since Spring 2.5. DriverManagerDataSource is primarily intended for accessing pre-registered JDBC drivers. If you need to register a new driver, consider using SimpleDriverDataSource instead.

Create a new DriverManagerDataSource with the given standard DriverManager parameters.

Parameters:
driverClassName - the JDBC driver class name
url - the JDBC URL to use for accessing the DriverManager
username - the JDBC username to use for accessing the DriverManager
password - the JDBC password to use for accessing the DriverManager
Method Detail

setDriverClassName

public void setDriverClassName(String driverClassName)
Set the JDBC driver class name. This driver will get initialized on startup, registering itself with the JDK's DriverManager.

NOTE: DriverManagerDataSource is primarily intended for accessing pre-registered JDBC drivers. If you need to register a new driver, consider using SimpleDriverDataSource instead. Alternatively, consider initializing the JDBC driver yourself before instantiating this DataSource. The "driverClassName" property is mainly preserved for backwards compatibility, as well as for migrating between Commons DBCP and this DataSource.

See Also:
DriverManager.registerDriver(java.sql.Driver), SimpleDriverDataSource

getConnectionFromDriver

protected Connection getConnectionFromDriver(Properties props)
                                      throws SQLException
Description copied from class: AbstractDriverBasedDataSource
Obtain a Connection using the given properties.

Template method to be implemented by subclasses.

Specified by:
getConnectionFromDriver in class AbstractDriverBasedDataSource
Parameters:
props - the merged connection properties
Returns:
the obtained Connection
Throws:
SQLException - in case of failure

getConnectionFromDriverManager

protected Connection getConnectionFromDriverManager(String url,
                                                    Properties props)
                                             throws SQLException
Getting a Connection using the nasty static from DriverManager is extracted into a protected method to allow for easy unit testing.

Throws:
SQLException
See Also:
DriverManager.getConnection(String, java.util.Properties)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


IsolationLevelDataSourceAdapter

org.springframework.jdbc.datasource
Class IsolationLevelDataSourceAdapter

java.lang.Object
    extended by  org.springframework.jdbc.datasource.DelegatingDataSource
        extended by  org.springframework.jdbc.datasource.UserCredentialsDataSourceAdapter
            extended by  org.springframework.jdbc.datasource.IsolationLevelDataSourceAdapter
All Implemented Interfaces:
Wrapper, CommonDataSource, DataSource, InitializingBean
Direct Known Subclasses:
WebSphereDataSourceAdapter
public class IsolationLevelDataSourceAdapter
extends UserCredentialsDataSourceAdapter

An adapter for a target DataSource, applying the current Spring transaction's isolation level (and potentially specified user credentials) to every getConnection call. Also applies the read-only flag, if specified.

Can be used to proxy a target JNDI DataSource that does not have the desired isolation level (and user credentials) configured. Client code can work with this DataSource as usual, not worrying about such settings.

Inherits the capability to apply specific user credentials from its superclass UserCredentialsDataSourceAdapter; see the latter's javadoc for details on that functionality (e.g. UserCredentialsDataSourceAdapter.setCredentialsForCurrentThread(java.lang.String, java.lang.String)).

WARNING: This adapter simply calls Connection.setTransactionIsolation(int) and/or Connection.setReadOnly(boolean) for every Connection obtained from it. It does, however, not reset those settings; it rather expects the target DataSource to perform such resetting as part of its connection pool handling. Make sure that the target DataSource properly cleans up such transaction state.

Since:
2.0.3
Author:
Juergen Hoeller
See Also:
setIsolationLevel(int),
setIsolationLevelName(java.lang.String),
UserCredentialsDataSourceAdapter.setUsername(java.lang.String),
UserCredentialsDataSourceAdapter.setPassword(java.lang.String)

Constructor Summary
IsolationLevelDataSourceAdapter()
Method Summary
protected Connection | doGetConnection(String username, String password) Applies the current isolation level value and read-only flag to the returned Connection.
protected Integer | getCurrentIsolationLevel() Determine the current isolation level: either the transaction's isolation level or a statically defined isolation level.
protected Boolean | getCurrentReadOnlyFlag() Determine the current read-only flag: by default, the transaction's read-only hint.
protected Integer | getIsolationLevel() Return the statically specified isolation level, or null if none.
void | setIsolationLevel(int isolationLevel) Specify the default isolation level to use for Connection retrieval, according to the JDBC Connection constants (equivalent to the corresponding Spring TransactionDefinition constants).
void | setIsolationLevelName(String constantName) Set the default isolation level by the name of the corresponding constant in TransactionDefinition, e.g.
Methods inherited from class org.springframework.jdbc.datasource.UserCredentialsDataSourceAdapter
getConnection, getConnection, removeCredentialsFromCurrentThread, setCredentialsForCurrentThread, setPassword, setUsername
Methods inherited from class org.springframework.jdbc.datasource.DelegatingDataSource
afterPropertiesSet, getLoginTimeout, getLogWriter, getTargetDataSource, isWrapperFor, setLoginTimeout, setLogWriter, setTargetDataSource, unwrap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

IsolationLevelDataSourceAdapter

public IsolationLevelDataSourceAdapter()
Method Detail

setIsolationLevelName

public final void setIsolationLevelName(String constantName)
                                 throws IllegalArgumentException
Set the default isolation level by the name of the corresponding constant in TransactionDefinition, e.g. "ISOLATION_SERIALIZABLE".

If not specified, the target DataSource's default will be used. Note that a transaction-specific isolation value will always override any isolation setting specified at the DataSource level.

Parameters:
constantName - name of the constant
Throws:
IllegalArgumentException
See Also:
TransactionDefinition.ISOLATION_READ_UNCOMMITTED, TransactionDefinition.ISOLATION_READ_COMMITTED, TransactionDefinition.ISOLATION_REPEATABLE_READ, TransactionDefinition.ISOLATION_SERIALIZABLE, setIsolationLevel(int)

setIsolationLevel

public void setIsolationLevel(int isolationLevel)
Specify the default isolation level to use for Connection retrieval, according to the JDBC Connection constants (equivalent to the corresponding Spring TransactionDefinition constants).

If not specified, the target DataSource's default will be used. Note that a transaction-specific isolation value will always override any isolation setting specified at the DataSource level.

See Also:
Connection.TRANSACTION_READ_UNCOMMITTED, Connection.TRANSACTION_READ_COMMITTED, Connection.TRANSACTION_REPEATABLE_READ, Connection.TRANSACTION_SERIALIZABLE, TransactionDefinition.ISOLATION_READ_UNCOMMITTED, TransactionDefinition.ISOLATION_READ_COMMITTED, TransactionDefinition.ISOLATION_REPEATABLE_READ, TransactionDefinition.ISOLATION_SERIALIZABLE, TransactionDefinition.getIsolationLevel(), TransactionSynchronizationManager.getCurrentTransactionIsolationLevel()

getIsolationLevel

protected Integer getIsolationLevel()
Return the statically specified isolation level, or null if none.

doGetConnection

protected Connection doGetConnection(String username,
                                     String password)
                              throws SQLException
Applies the current isolation level value and read-only flag to the returned Connection.

Overrides:
doGetConnection in class UserCredentialsDataSourceAdapter
Parameters:
username - the username to use
password - the password to use
Returns:
the Connection
Throws:
SQLException
See Also:
getCurrentIsolationLevel(), getCurrentReadOnlyFlag()

getCurrentIsolationLevel

protected Integer getCurrentIsolationLevel()
Determine the current isolation level: either the transaction's isolation level or a statically defined isolation level.

Returns:
the current isolation level, or null if none
See Also:
TransactionSynchronizationManager.getCurrentTransactionIsolationLevel(), setIsolationLevel(int)

getCurrentReadOnlyFlag

protected Boolean getCurrentReadOnlyFlag()
Determine the current read-only flag: by default, the transaction's read-only hint.

Returns:
whether there is a read-only hint for the current scope
See Also:
TransactionSynchronizationManager.isCurrentTransactionReadOnly()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JdbcTransactionObjectSupport

org.springframework.jdbc.datasource
Class JdbcTransactionObjectSupport

java.lang.Object
    extended by  org.springframework.jdbc.datasource.JdbcTransactionObjectSupport
All Implemented Interfaces:
SavepointManager, SmartTransactionObject
public abstract class JdbcTransactionObjectSupport
extends Object
implements SavepointManager, SmartTransactionObject

Convenient base class for JDBC-aware transaction objects. Can contain a ConnectionHolder, and implements the SavepointManager interface based on that ConnectionHolder.

Allows for programmatic management of JDBC 3.0 Savepoints. Spring's DefaultTransactionStatus will automatically delegate to this, as it autodetects transaction objects that implement the SavepointManager interface.

Note that savepoints are only supported for drivers which support JDBC 3.0 or higher.

Since:
1.1
Author:
Juergen Hoeller

Constructor Summary
JdbcTransactionObjectSupport()
Method Summary
Object | createSavepoint() This implementation creates a JDBC 3.0 Savepoint and returns it.
void | flush() Flush the underlying sessions to the datastore, if applicable: for example, all affected Hibernate/JPA sessions.
ConnectionHolder | getConnectionHolder()
protected ConnectionHolder | getConnectionHolderForSavepoint()
Integer | getPreviousIsolationLevel()
boolean | hasConnectionHolder()
boolean | isSavepointAllowed()
void | releaseSavepoint(Object savepoint) This implementation releases the given JDBC 3.0 Savepoint.
void | rollbackToSavepoint(Object savepoint) This implementation rolls back to the given JDBC 3.0 Savepoint.
void | setConnectionHolder(ConnectionHolder connectionHolder)
void | setPreviousIsolationLevel(Integer previousIsolationLevel)
void | setSavepointAllowed(boolean savepointAllowed)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.transaction.support.SmartTransactionObject
isRollbackOnly

Constructor Detail

JdbcTransactionObjectSupport

public JdbcTransactionObjectSupport()
Method Detail

setConnectionHolder

public void setConnectionHolder(ConnectionHolder connectionHolder)

getConnectionHolder

public ConnectionHolder getConnectionHolder()

hasConnectionHolder

public boolean hasConnectionHolder()

setPreviousIsolationLevel

public void setPreviousIsolationLevel(Integer previousIsolationLevel)

getPreviousIsolationLevel

public Integer getPreviousIsolationLevel()

setSavepointAllowed

public void setSavepointAllowed(boolean savepointAllowed)

isSavepointAllowed

public boolean isSavepointAllowed()

flush

public void flush()
Description copied from interface: SmartTransactionObject
Flush the underlying sessions to the datastore, if applicable: for example, all affected Hibernate/JPA sessions.

Specified by:
flush in interface SmartTransactionObject

createSavepoint

public Object createSavepoint()
                       throws TransactionException
This implementation creates a JDBC 3.0 Savepoint and returns it.

Specified by:
createSavepoint in interface SavepointManager
Returns:
a savepoint object, to be passed into rollbackToSavepoint or releaseSavepoint
Throws:
NestedTransactionNotSupportedException - if the underlying transaction does not support savepoints
TransactionException - if the savepoint could not be created, for example because the transaction is not in an appropriate state
See Also:
Connection.setSavepoint()

rollbackToSavepoint

public void rollbackToSavepoint(Object savepoint)
                         throws TransactionException
This implementation rolls back to the given JDBC 3.0 Savepoint.

Specified by:
rollbackToSavepoint in interface SavepointManager
Parameters:
savepoint - the savepoint to roll back to
Throws:
NestedTransactionNotSupportedException - if the underlying transaction does not support savepoints
TransactionException - if the rollback failed
See Also:
Connection.rollback(java.sql.Savepoint)

releaseSavepoint

public void releaseSavepoint(Object savepoint)
                      throws TransactionException
This implementation releases the given JDBC 3.0 Savepoint.

Specified by:
releaseSavepoint in interface SavepointManager
Parameters:
savepoint - the savepoint to release
Throws:
NestedTransactionNotSupportedException - if the underlying transaction does not support savepoints
TransactionException - if the release failed
See Also:
Connection.releaseSavepoint(java.sql.Savepoint)

getConnectionHolderForSavepoint

protected ConnectionHolder getConnectionHolderForSavepoint()
                                                    throws TransactionException
Throws:
TransactionException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LazyConnectionDataSourceProxy

org.springframework.jdbc.datasource
Class LazyConnectionDataSourceProxy

java.lang.Object
    extended by  org.springframework.jdbc.datasource.DelegatingDataSource
        extended by  org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy
All Implemented Interfaces:
Wrapper, CommonDataSource, DataSource, InitializingBean
public class LazyConnectionDataSourceProxy
extends DelegatingDataSource

Proxy for a target DataSource, fetching actual JDBC Connections lazily, i.e. not until first creation of a Statement. Connection initialization properties like auto-commit mode, transaction isolation and read-only mode will be kept and applied to the actual JDBC Connection as soon as an actual Connection is fetched (if ever). Consequently, commit and rollback calls will be ignored if no Statements have been created.

This DataSource proxy allows to avoid fetching JDBC Connections from a pool unless actually necessary. JDBC transaction control can happen without fetching a Connection from the pool or communicating with the database; this will be done lazily on first creation of a JDBC Statement.

If you configure both a LazyConnectionDataSourceProxy and a TransactionAwareDataSourceProxy, make sure that the latter is the outermost DataSource. In such a scenario, data access code will talk to the transaction-aware DataSource, which will in turn work with the LazyConnectionDataSourceProxy.

Lazy fetching of physical JDBC Connections is particularly beneficial in a generic transaction demarcation environment. It allows you to demarcate transactions on all methods that could potentially perform data access, without paying a performance penalty if no actual data access happens.

This DataSource proxy gives you behavior analogous to JTA and a transactional JNDI DataSource (as provided by the J2EE server), even with a local transaction strategy like DataSourceTransactionManager or HibernateTransactionManager. It does not add value with Spring's JtaTransactionManager as transaction strategy.

Lazy fetching of JDBC Connections is also recommended for read-only operations with Hibernate, in particular if the chances of resolving the result in the second-level cache are high. This avoids the need to communicate with the database at all for such read-only operations. You will get the same effect with non-transactional reads, but lazy fetching of JDBC Connections allows you to still perform reads in transactions.

NOTE: This DataSource proxy needs to return wrapped Connections to handle lazy fetching of an actual JDBC Connection. Therefore, the returned Connections cannot be cast to a native JDBC Connection type like OracleConnection, or to a connection pool implementation type. Use a corresponding NativeJdbcExtractor to retrieve the native JDBC Connection.

Since:
1.1.4
Author:
Juergen Hoeller
See Also:
ConnectionProxy, DataSourceTransactionManager, HibernateTransactionManager, NativeJdbcExtractor

Constructor Summary
LazyConnectionDataSourceProxy()
Create a new LazyConnectionDataSourceProxy.
LazyConnectionDataSourceProxy(DataSource targetDataSource)
Create a new LazyConnectionDataSourceProxy.
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected void | checkDefaultConnectionProperties(Connection con) Check the default connection properties (auto-commit, transaction isolation), keeping them to be able to expose them correctly without fetching an actual JDBC Connection from the target DataSource.
protected Boolean | defaultAutoCommit() Expose the default auto-commit value.
protected Integer | defaultTransactionIsolation() Expose the default transaction isolation value.
Connection | getConnection() Return a Connection handle that lazily fetches an actual JDBC Connection when asked for a Statement (or PreparedStatement or CallableStatement).
Connection | getConnection(String username, String password) Return a Connection handle that lazily fetches an actual JDBC Connection when asked for a Statement (or PreparedStatement or CallableStatement).
void | setDefaultAutoCommit(boolean defaultAutoCommit) Set the default auto-commit mode to expose when no target Connection has been fetched yet (-> actual JDBC Connection default not known yet).
void | setDefaultTransactionIsolation(int defaultTransactionIsolation) Set the default transaction isolation level to expose when no target Connection has been fetched yet (-> actual JDBC Connection default not known yet).
void | setDefaultTransactionIsolationName(String constantName) Set the default transaction isolation level by the name of the corresponding constant in Connection, e.g.
Methods inherited from class org.springframework.jdbc.datasource.DelegatingDataSource
getLoginTimeout, getLogWriter, getTargetDataSource, isWrapperFor, setLoginTimeout, setLogWriter, setTargetDataSource, unwrap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

LazyConnectionDataSourceProxy

public LazyConnectionDataSourceProxy()
Create a new LazyConnectionDataSourceProxy.

See Also:
DelegatingDataSource.setTargetDataSource(javax.sql.DataSource)

LazyConnectionDataSourceProxy

public LazyConnectionDataSourceProxy(DataSource targetDataSource)
Create a new LazyConnectionDataSourceProxy.

Parameters:
targetDataSource - the target DataSource
Method Detail

setDefaultAutoCommit

public void setDefaultAutoCommit(boolean defaultAutoCommit)
Set the default auto-commit mode to expose when no target Connection has been fetched yet (-> actual JDBC Connection default not known yet).

If not specified, the default gets determined by checking a target Connection on startup. If that check fails, the default will be determined lazily on first access of a Connection.

See Also:
Connection.setAutoCommit(boolean)

setDefaultTransactionIsolation

public void setDefaultTransactionIsolation(int defaultTransactionIsolation)
Set the default transaction isolation level to expose when no target Connection has been fetched yet (-> actual JDBC Connection default not known yet).

This property accepts the int constant value (e.g. 8) as defined in the Connection interface; it is mainly intended for programmatic use. Consider using the "defaultTransactionIsolationName" property for setting the value by name (e.g. "TRANSACTION_SERIALIZABLE").

If not specified, the default gets determined by checking a target Connection on startup. If that check fails, the default will be determined lazily on first access of a Connection.

See Also:
setDefaultTransactionIsolationName(java.lang.String), Connection.setTransactionIsolation(int)

setDefaultTransactionIsolationName

public void setDefaultTransactionIsolationName(String constantName)
Set the default transaction isolation level by the name of the corresponding constant in Connection, e.g. "TRANSACTION_SERIALIZABLE".

Parameters:
constantName - name of the constant
See Also:
setDefaultTransactionIsolation(int), Connection.TRANSACTION_READ_UNCOMMITTED, Connection.TRANSACTION_READ_COMMITTED, Connection.TRANSACTION_REPEATABLE_READ, Connection.TRANSACTION_SERIALIZABLE

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class DelegatingDataSource

checkDefaultConnectionProperties

protected void checkDefaultConnectionProperties(Connection con)
                                         throws SQLException
Check the default connection properties (auto-commit, transaction isolation), keeping them to be able to expose them correctly without fetching an actual JDBC Connection from the target DataSource.

This will be invoked once on startup, but also for each retrieval of a target Connection. If the check failed on startup (because the database was down), we'll lazily retrieve those settings.

Parameters:
con - the Connection to use for checking
Throws:
SQLException - if thrown by Connection methods

defaultAutoCommit

protected Boolean defaultAutoCommit()
Expose the default auto-commit value.

defaultTransactionIsolation

protected Integer defaultTransactionIsolation()
Expose the default transaction isolation value.

getConnection

public Connection getConnection()
                         throws SQLException
Return a Connection handle that lazily fetches an actual JDBC Connection when asked for a Statement (or PreparedStatement or CallableStatement).

The returned Connection handle implements the ConnectionProxy interface, allowing to retrieve the underlying target Connection.

Specified by:
getConnection in interface DataSource
Overrides:
getConnection in class DelegatingDataSource
Returns:
a lazy Connection handle
Throws:
SQLException
See Also:
ConnectionProxy.getTargetConnection()

getConnection

public Connection getConnection(String username,
                                String password)
                         throws SQLException
Return a Connection handle that lazily fetches an actual JDBC Connection when asked for a Statement (or PreparedStatement or CallableStatement).

The returned Connection handle implements the ConnectionProxy interface, allowing to retrieve the underlying target Connection.

Specified by:
getConnection in interface DataSource
Overrides:
getConnection in class DelegatingDataSource
Parameters:
username - the per-Connection username
password - the per-Connection password
Returns:
a lazy Connection handle
Throws:
SQLException
See Also:
ConnectionProxy.getTargetConnection()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleConnectionHandle

org.springframework.jdbc.datasource
Class SimpleConnectionHandle

java.lang.Object
    extended by  org.springframework.jdbc.datasource.SimpleConnectionHandle
All Implemented Interfaces:
ConnectionHandle
public class SimpleConnectionHandle
extends Object
implements ConnectionHandle

Simple implementation of the ConnectionHandle interface, containing a given JDBC Connection.

Since:
1.1
Author:
Juergen Hoeller

Constructor Summary
SimpleConnectionHandle(Connection connection)
Create a new SimpleConnectionHandle for the given Connection.
Method Summary
Connection | getConnection() Return the specified Connection as-is.
void | releaseConnection(Connection con) This implementation is empty, as we're using a standard Connection handle that does not have to be released.
String | toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

SimpleConnectionHandle

public SimpleConnectionHandle(Connection connection)
Create a new SimpleConnectionHandle for the given Connection.

Parameters:
connection - the JDBC Connection
Method Detail

getConnection

public Connection getConnection()
Return the specified Connection as-is.

Specified by:
getConnection in interface ConnectionHandle

releaseConnection

public void releaseConnection(Connection con)
This implementation is empty, as we're using a standard Connection handle that does not have to be released.

Specified by:
releaseConnection in interface ConnectionHandle
Parameters:
con - the JDBC Connection to release

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleDriverDataSource

org.springframework.jdbc.datasource
Class SimpleDriverDataSource

java.lang.Object
    extended by  org.springframework.jdbc.datasource.AbstractDataSource
        extended by  org.springframework.jdbc.datasource.AbstractDriverBasedDataSource
            extended by  org.springframework.jdbc.datasource.SimpleDriverDataSource
All Implemented Interfaces:
Wrapper, CommonDataSource, DataSource
public class SimpleDriverDataSource
extends AbstractDriverBasedDataSource

Simple implementation of the standard JDBC DataSource interface, configuring a plain old JDBC Driver via bean properties, and returning a new Connection from every getConnection call.

NOTE: This class is not an actual connection pool; it does not actually pool Connections. It just serves as simple replacement for a full-blown connection pool, implementing the same standard interface, but creating new Connections on every call.

In a J2EE container, it is recommended to use a JNDI DataSource provided by the container. Such a DataSource can be exposed as a DataSource bean in a Spring ApplicationContext via JndiObjectFactoryBean, for seamless switching to and from a local DataSource bean like this class.

If you need a "real" connection pool outside of a J2EE container, consider Apache's Jakarta Commons DBCP or C3P0. Commons DBCP's BasicDataSource and C3P0's ComboPooledDataSource are full connection pool beans, supporting the same basic properties as this class plus specific settings (such as minimal/maximal pool size etc).

Since:
2.5.5
Author:
Juergen Hoeller
See Also:
DriverManagerDataSource

Field Summary
Fields inherited from class org.springframework.jdbc.datasource.AbstractDataSource
logger
Constructor Summary
SimpleDriverDataSource()
Constructor for bean-style configuration.
SimpleDriverDataSource(Driver driver, String url)
Create a new DriverManagerDataSource with the given standard Driver parameters.
SimpleDriverDataSource(Driver driver, String url, Properties conProps)
Create a new DriverManagerDataSource with the given standard Driver parameters.
SimpleDriverDataSource(Driver driver, String url, String username, String password)
Create a new DriverManagerDataSource with the given standard Driver parameters.
Method Summary
protected Connection | getConnectionFromDriver(Properties props) Obtain a Connection using the given properties.
Driver | getDriver() Return the JDBC Driver instance to use.
void | setDriver(Driver driver) Specify the JDBC Driver instance to use.
void | setDriverClass(Class<? extends Driver> driverClass) Specify the JDBC Driver implementation class to use.
Methods inherited from class org.springframework.jdbc.datasource.AbstractDriverBasedDataSource
getConnection, getConnection, getConnectionFromDriver, getConnectionProperties, getPassword, getUrl, getUsername, setConnectionProperties, setPassword, setUrl, setUsername
Methods inherited from class org.springframework.jdbc.datasource.AbstractDataSource
getLoginTimeout, getLogWriter, isWrapperFor, setLoginTimeout, setLogWriter, unwrap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleDriverDataSource

public SimpleDriverDataSource()
Constructor for bean-style configuration.

SimpleDriverDataSource

public SimpleDriverDataSource(Driver driver,
                              String url)
Create a new DriverManagerDataSource with the given standard Driver parameters.

Parameters:
driver - the JDBC Driver object
url - the JDBC URL to use for accessing the DriverManager
See Also:
Driver.connect(String, java.util.Properties)

SimpleDriverDataSource

public SimpleDriverDataSource(Driver driver,
                              String url,
                              String username,
                              String password)
Create a new DriverManagerDataSource with the given standard Driver parameters.

Parameters:
driver - the JDBC Driver object
url - the JDBC URL to use for accessing the DriverManager
username - the JDBC username to use for accessing the DriverManager
password - the JDBC password to use for accessing the DriverManager
See Also:
Driver.connect(String, java.util.Properties)

SimpleDriverDataSource

public SimpleDriverDataSource(Driver driver,
                              String url,
                              Properties conProps)
Create a new DriverManagerDataSource with the given standard Driver parameters.

Parameters:
driver - the JDBC Driver object
url - the JDBC URL to use for accessing the DriverManager
conProps - JDBC connection properties
See Also:
Driver.connect(String, java.util.Properties)
Method Detail

setDriverClass

public void setDriverClass(Class<? extends Driver> driverClass)
Specify the JDBC Driver implementation class to use.

An instance of this Driver class will be created and held within the SimpleDriverDataSource.

See Also:
setDriver(java.sql.Driver)

setDriver

public void setDriver(Driver driver)
Specify the JDBC Driver instance to use.

This allows for passing in a shared, possibly pre-configured Driver instance.

See Also:
setDriverClass(java.lang.Class)

getDriver

public Driver getDriver()
Return the JDBC Driver instance to use.

getConnectionFromDriver

protected Connection getConnectionFromDriver(Properties props)
                                      throws SQLException
Description copied from class: AbstractDriverBasedDataSource
Obtain a Connection using the given properties.

Template method to be implemented by subclasses.

Specified by:
getConnectionFromDriver in class AbstractDriverBasedDataSource
Parameters:
props - the merged connection properties
Returns:
the obtained Connection
Throws:
SQLException - in case of failure
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SingleConnectionDataSource

org.springframework.jdbc.datasource
Class SingleConnectionDataSource

java.lang.Object
    extended by  org.springframework.jdbc.datasource.AbstractDataSource
        extended by  org.springframework.jdbc.datasource.AbstractDriverBasedDataSource
            extended by  org.springframework.jdbc.datasource.DriverManagerDataSource
                extended by  org.springframework.jdbc.datasource.SingleConnectionDataSource
All Implemented Interfaces:
Wrapper, CommonDataSource, DataSource, DisposableBean, SmartDataSource
public class SingleConnectionDataSource
extends DriverManagerDataSource
implements SmartDataSource, DisposableBean

Implementation of SmartDataSource that wraps a single JDBC Connection which is not closed after use. Obviously, this is not multi-threading capable.

Note that at shutdown, someone should close the underlying Connection via the close() method. Client code will never call close on the Connection handle if it is SmartDataSource-aware (e.g. uses DataSourceUtils.releaseConnection).

If client code will call close() in the assumption of a pooled Connection, like when using persistence tools, set "suppressClose" to "true". This will return a close-suppressing proxy instead of the physical Connection. Be aware that you will not be able to cast this to a native OracleConnection or the like anymore; you need to use a NativeJdbcExtractor then.

This is primarily intended for testing. For example, it enables easy testing outside an application server, for code that expects to work on a DataSource. In contrast to DriverManagerDataSource, it reuses the same Connection all the time, avoiding excessive creation of physical Connections.

Author:
Rod Johnson, Juergen Hoeller
See Also:
getConnection(),
Connection.close(),
DataSourceUtils.releaseConnection(java.sql.Connection, javax.sql.DataSource),
NativeJdbcExtractor

Field Summary
Fields inherited from class org.springframework.jdbc.datasource.AbstractDataSource
logger
Constructor Summary
SingleConnectionDataSource()
Constructor for bean-style configuration.
SingleConnectionDataSource(Connection target, boolean suppressClose)
Create a new SingleConnectionDataSource with a given Connection.
SingleConnectionDataSource(String url, boolean suppressClose)
Create a new SingleConnectionDataSource with the given standard DriverManager parameters.
SingleConnectionDataSource(String url, String username, String password, boolean suppressClose)
Create a new SingleConnectionDataSource with the given standard DriverManager parameters.
SingleConnectionDataSource(String driverClassName, String url, String username, String password, boolean suppressClose)
Deprecated. since Spring 2.5. Driver parameter usage is generally not recommended for a SingleConnectionDataSource. If you insist on using driver parameters directly, set up the Driver class manually before invoking this DataSource.
Method Summary
void | destroy() Close the underlying Connection.
protected Boolean | getAutoCommitValue() Return whether the returned Connection's "autoCommit" setting should be overridden.
protected Connection | getCloseSuppressingConnectionProxy(Connection target) Wrap the given Connection with a proxy that delegates every method call to it but suppresses close calls.
Connection | getConnection() This implementation delegates to getConnectionFromDriver, using the default username and password of this DataSource.
Connection | getConnection(String username, String password) Specifying a custom username and password doesn't make sense with a single Connection.
void | initConnection() Initialize the underlying Connection via the DriverManager.
protected boolean | isSuppressClose() Return whether the returned Connection will be a close-suppressing proxy or the physical Connection.
protected void | prepareConnection(Connection con) Prepare the given Connection before it is exposed.
void | resetConnection() Reset the underlying shared Connection, to be reinitialized on next access.
void | setAutoCommit(boolean autoCommit) Set whether the returned Connection's "autoCommit" setting should be overridden.
void | setSuppressClose(boolean suppressClose) Set whether the returned Connection should be a close-suppressing proxy or the physical Connection.
boolean | shouldClose(Connection con) This is a single Connection: Do not close it when returning to the "pool".
Methods inherited from class org.springframework.jdbc.datasource.DriverManagerDataSource
getConnectionFromDriver, getConnectionFromDriverManager, setDriverClassName
Methods inherited from class org.springframework.jdbc.datasource.AbstractDriverBasedDataSource
getConnectionFromDriver, getConnectionProperties, getPassword, getUrl, getUsername, setConnectionProperties, setPassword, setUrl, setUsername
Methods inherited from class org.springframework.jdbc.datasource.AbstractDataSource
getLoginTimeout, getLogWriter, isWrapperFor, setLoginTimeout, setLogWriter, unwrap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.sql.CommonDataSource
getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap

Constructor Detail

SingleConnectionDataSource

public SingleConnectionDataSource()
Constructor for bean-style configuration.

SingleConnectionDataSource

@Deprecated
public SingleConnectionDataSource(String driverClassName,
                                             String url,
                                             String username,
                                             String password,
                                             boolean suppressClose)
Deprecated. since Spring 2.5. Driver parameter usage is generally not recommended for a SingleConnectionDataSource. If you insist on using driver parameters directly, set up the Driver class manually before invoking this DataSource.

Create a new SingleConnectionDataSource with the given standard DriverManager parameters.

Parameters:
driverClassName - the JDBC driver class name
url - the JDBC URL to use for accessing the DriverManager
username - the JDBC username to use for accessing the DriverManager
password - the JDBC password to use for accessing the DriverManager
suppressClose - if the returned Connection should be a close-suppressing proxy or the physical Connection
See Also:
DriverManager.getConnection(String, String, String)

SingleConnectionDataSource

public SingleConnectionDataSource(String url,
                                  String username,
                                  String password,
                                  boolean suppressClose)
Create a new SingleConnectionDataSource with the given standard DriverManager parameters.

Parameters:
url - the JDBC URL to use for accessing the DriverManager
username - the JDBC username to use for accessing the DriverManager
password - the JDBC password to use for accessing the DriverManager
suppressClose - if the returned Connection should be a close-suppressing proxy or the physical Connection
See Also:
DriverManager.getConnection(String, String, String)

SingleConnectionDataSource

public SingleConnectionDataSource(String url,
                                  boolean suppressClose)
Create a new SingleConnectionDataSource with the given standard DriverManager parameters.

Parameters:
url - the JDBC URL to use for accessing the DriverManager
suppressClose - if the returned Connection should be a close-suppressing proxy or the physical Connection
See Also:
DriverManager.getConnection(String, String, String)

SingleConnectionDataSource

public SingleConnectionDataSource(Connection target,
                                  boolean suppressClose)
Create a new SingleConnectionDataSource with a given Connection.

Parameters:
target - underlying target Connection
suppressClose - if the Connection should be wrapped with a Connection that suppresses close() calls (to allow for normal close() usage in applications that expect a pooled Connection but do not know our SmartDataSource interface)
Method Detail

setSuppressClose

public void setSuppressClose(boolean suppressClose)
Set whether the returned Connection should be a close-suppressing proxy or the physical Connection.

isSuppressClose

protected boolean isSuppressClose()
Return whether the returned Connection will be a close-suppressing proxy or the physical Connection.

setAutoCommit

public void setAutoCommit(boolean autoCommit)
Set whether the returned Connection's "autoCommit" setting should be overridden.

getAutoCommitValue

protected Boolean getAutoCommitValue()
Return whether the returned Connection's "autoCommit" setting should be overridden.

Returns:
the "autoCommit" value, or null if none to be applied

getConnection

public Connection getConnection()
                         throws SQLException
Description copied from class: AbstractDriverBasedDataSource
This implementation delegates to getConnectionFromDriver, using the default username and password of this DataSource.

Specified by:
getConnection in interface DataSource
Overrides:
getConnection in class AbstractDriverBasedDataSource
Throws:
SQLException
See Also:
AbstractDriverBasedDataSource.getConnectionFromDriver(String, String),
AbstractDriverBasedDataSource.setUsername(java.lang.String),
AbstractDriverBasedDataSource.setPassword(java.lang.String)

getConnection

public Connection getConnection(String username,
                                String password)
                         throws SQLException
Specifying a custom username and password doesn't make sense with a single Connection. Returns the single Connection if given the same username and password; throws a SQLException else.

Specified by:
getConnection in interface DataSource
Overrides:
getConnection in class AbstractDriverBasedDataSource
Throws:
SQLException
See Also:
AbstractDriverBasedDataSource.getConnectionFromDriver(String, String)

shouldClose

public boolean shouldClose(Connection con)
This is a single Connection: Do not close it when returning to the "pool".

Specified by:
shouldClose in interface SmartDataSource
Parameters:
con - the Connection to check
Returns:
whether the given Connection should be closed
See Also:
Connection.close()

destroy

public void destroy()
Close the underlying Connection. The provider of this DataSource needs to care for proper shutdown.

As this bean implements DisposableBean, a bean factory will automatically invoke this on destruction of its cached singletons.

Specified by:
destroy in interface DisposableBean

initConnection

public void initConnection()
                    throws SQLException
Initialize the underlying Connection via the DriverManager.

Throws:
SQLException

resetConnection

public void resetConnection()
Reset the underlying shared Connection, to be reinitialized on next access.

prepareConnection

protected void prepareConnection(Connection con)
                          throws SQLException
Prepare the given Connection before it is exposed.

The default implementation applies the auto-commit flag, if necessary. Can be overridden in subclasses.

Parameters:
con - the Connection to prepare
Throws:
SQLException
See Also:
setAutoCommit(boolean)

getCloseSuppressingConnectionProxy

protected Connection getCloseSuppressingConnectionProxy(Connection target)
Wrap the given Connection with a proxy that delegates every method call to it but suppresses close calls.

Parameters:
target - the original Connection to wrap
Returns:
the wrapped Connection
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionAwareDataSourceProxy

org.springframework.jdbc.datasource
Class TransactionAwareDataSourceProxy

java.lang.Object
    extended by  org.springframework.jdbc.datasource.DelegatingDataSource
        extended by  org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy
All Implemented Interfaces:
Wrapper, CommonDataSource, DataSource, InitializingBean
public class TransactionAwareDataSourceProxy
extends DelegatingDataSource

Proxy for a target JDBC DataSource, adding awareness of Spring-managed transactions. Similar to a transactional JNDI DataSource as provided by a J2EE server.

Data access code that should remain unaware of Spring's data access support can work with this proxy to seamlessly participate in Spring-managed transactions. Note that the transaction manager, for example DataSourceTransactionManager, still needs to work with the underlying DataSource, not with this proxy.

Make sure that TransactionAwareDataSourceProxy is the outermost DataSource of a chain of DataSource proxies/adapters. TransactionAwareDataSourceProxy can delegate either directly to the target connection pool or to some intermediary proxy/adapter like LazyConnectionDataSourceProxy or UserCredentialsDataSourceAdapter.

Delegates to DataSourceUtils for automatically participating in thread-bound transactions, for example managed by DataSourceTransactionManager. getConnection calls and close calls on returned Connections will behave properly within a transaction, i.e. always operate on the transactional Connection. If not within a transaction, normal DataSource behavior applies.

This proxy allows data access code to work with the plain JDBC API and still participate in Spring-managed transactions, similar to JDBC code in a J2EE/JTA environment. However, if possible, use Spring's DataSourceUtils, JdbcTemplate or JDBC operation objects to get transaction participation even without a proxy for the target DataSource, avoiding the need to define such a proxy in the first place.

As a further effect, using a transaction-aware DataSource will apply remaining transaction timeouts to all created JDBC (Prepared/Callable)Statement. This means that all operations performed through standard JDBC will automatically participate in Spring-managed transaction timeouts.

NOTE: This DataSource proxy needs to return wrapped Connections (which implement the ConnectionProxy interface) in order to handle close calls properly. Therefore, the returned Connections cannot be cast to a native JDBC Connection type like OracleConnection or to a connection pool implementation type. Use a corresponding NativeJdbcExtractor to retrieve the native JDBC Connection.

Since:
1.1
Author:
Juergen Hoeller
See Also:
DataSource.getConnection(),
Connection.close(),
DataSourceUtils.doGetConnection(javax.sql.DataSource),
DataSourceUtils.applyTransactionTimeout(java.sql.Statement, javax.sql.DataSource),
DataSourceUtils.doReleaseConnection(java.sql.Connection, javax.sql.DataSource)

Constructor Summary
TransactionAwareDataSourceProxy()
Create a new TransactionAwareDataSourceProxy.
TransactionAwareDataSourceProxy(DataSource targetDataSource)
Create a new TransactionAwareDataSourceProxy.
Method Summary
Connection | getConnection() Delegates to DataSourceUtils for automatically participating in Spring-managed transactions.
protected Connection | getTransactionAwareConnectionProxy(DataSource targetDataSource) Wraps the given Connection with a proxy that delegates every method call to it but delegates close() calls to DataSourceUtils.
void | setReobtainTransactionalConnections(boolean reobtainTransactionalConnections) Specify whether to reobtain the target Connection for each operation performed within a transaction.
protected boolean | shouldObtainFixedConnection(DataSource targetDataSource) Determine whether to obtain a fixed target Connection for the proxy or to reobtain the target Connection for each operation.
Methods inherited from class org.springframework.jdbc.datasource.DelegatingDataSource
afterPropertiesSet, getConnection, getLoginTimeout, getLogWriter, getTargetDataSource, isWrapperFor, setLoginTimeout, setLogWriter, setTargetDataSource, unwrap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TransactionAwareDataSourceProxy

public TransactionAwareDataSourceProxy()
Create a new TransactionAwareDataSourceProxy.

See Also:
DelegatingDataSource.setTargetDataSource(javax.sql.DataSource)

TransactionAwareDataSourceProxy

public TransactionAwareDataSourceProxy(DataSource targetDataSource)
Create a new TransactionAwareDataSourceProxy.

Parameters:
targetDataSource - the target DataSource
Method Detail

setReobtainTransactionalConnections

public void setReobtainTransactionalConnections(boolean reobtainTransactionalConnections)
Specify whether to reobtain the target Connection for each operation performed within a transaction.

The default is "false". Specify "true" to reobtain transactional Connections for every call on the Connection proxy; this is advisable on JBoss if you hold on to a Connection handle across transaction boundaries.

The effect of this setting is similar to the "hibernate.connection.release_mode" value "after_statement".

getConnection

public Connection getConnection()
                         throws SQLException
Delegates to DataSourceUtils for automatically participating in Spring-managed transactions. Throws the original SQLException, if any.

The returned Connection handle implements the ConnectionProxy interface, allowing to retrieve the underlying target Connection.

Specified by:
getConnection in interface DataSource
Overrides:
getConnection in class DelegatingDataSource
Returns:
a transactional Connection if any, a new one else
Throws:
SQLException
See Also:
DataSourceUtils.doGetConnection(javax.sql.DataSource), ConnectionProxy.getTargetConnection()

getTransactionAwareConnectionProxy

protected Connection getTransactionAwareConnectionProxy(DataSource targetDataSource)
Wraps the given Connection with a proxy that delegates every method call to it but delegates close() calls to DataSourceUtils.

Parameters:
targetDataSource - DataSource that the Connection came from
Returns:
the wrapped Connection
See Also:
Connection.close(), DataSourceUtils.doReleaseConnection(java.sql.Connection, javax.sql.DataSource)

shouldObtainFixedConnection

protected boolean shouldObtainFixedConnection(DataSource targetDataSource)
Determine whether to obtain a fixed target Connection for the proxy or to reobtain the target Connection for each operation.

The default implementation returns true for all standard cases. This can be overridden through the "reobtainTransactionalConnections" flag, which enforces a non-fixed target Connection within an active transaction. Note that non-transactional access will always use a fixed Connection.

Parameters:
targetDataSource - the target DataSource
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UserCredentialsDataSourceAdapter

org.springframework.jdbc.datasource
Class UserCredentialsDataSourceAdapter

java.lang.Object
    extended by  org.springframework.jdbc.datasource.DelegatingDataSource
        extended by  org.springframework.jdbc.datasource.UserCredentialsDataSourceAdapter
All Implemented Interfaces:
Wrapper, CommonDataSource, DataSource, InitializingBean
Direct Known Subclasses:
IsolationLevelDataSourceAdapter
public class UserCredentialsDataSourceAdapter
extends DelegatingDataSource

An adapter for a target JDBC DataSource, applying the specified user credentials to every standard getConnection() call, implicitly invoking getConnection(username, password) on the target. All other methods simply delegate to the corresponding methods of the target DataSource.

Can be used to proxy a target JNDI DataSource that does not have user credentials configured. Client code can work with this DataSource as usual, using the standard getConnection() call.

In the following example, client code can simply transparently work with the preconfigured "myDataSource", implicitly accessing "myTargetDataSource" with the specified user credentials.

 <bean id="myTargetDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
   <property name="jndiName" value="java:comp/env/jdbc/myds"/>
 </bean>

 <bean id="myDataSource" class="org.springframework.jdbc.datasource.UserCredentialsDataSourceAdapter">
   <property name="targetDataSource" ref="myTargetDataSource"/>
   <property name="username" value="myusername"/>
   <property name="password" value="mypassword"/>
 </bean>

If the "username" is empty, this proxy will simply delegate to the standard getConnection() method of the target DataSource. This can be used to keep a UserCredentialsDataSourceAdapter bean definition just for the option of implicitly passing in user credentials if the particular target DataSource requires it.

Since:
1.0.2
Author:
Juergen Hoeller
See Also:
getConnection()

Constructor Summary
UserCredentialsDataSourceAdapter()
Method Summary
protected  Connection doGetConnection(String username, String password)
This implementation delegates to the getConnection(username, password) method of the target DataSource, passing in the specified user credentials.
 Connection getConnection()
Determine whether there are currently thread-bound credentials, using them if available, falling back to the statically specified username and password (i.e.
 Connection getConnection(String username, String password)
Simply delegates to doGetConnection(String, String), keeping the given user credentials as-is.
 void removeCredentialsFromCurrentThread()
Remove any user credentials for this proxy from the current thread.
 void setCredentialsForCurrentThread(String username, String password)
Set user credententials for this proxy and the current thread.
 void setPassword(String password)
Set the default user's password that this adapter should use for retrieving Connections.
 void setUsername(String username)
Set the default username that this adapter should use for retrieving Connections.
Methods inherited from class org.springframework.jdbc.datasource.DelegatingDataSource
afterPropertiesSet, getLoginTimeout, getLogWriter, getTargetDataSource, isWrapperFor, setLoginTimeout, setLogWriter, setTargetDataSource, unwrap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

UserCredentialsDataSourceAdapter

public UserCredentialsDataSourceAdapter()
Method Detail

setUsername

public void setUsername(String username)
Set the default username that this adapter should use for retrieving Connections.

Default is no specific user. Note that an explicitly specified username will always override any username/password specified at the DataSource level.

See Also:
setPassword(java.lang.String),
setCredentialsForCurrentThread(String, String),
getConnection(String, String)

setPassword

public void setPassword(String password)
Set the default user's password that this adapter should use for retrieving Connections.

Default is no specific password. Note that an explicitly specified username will always override any username/password specified at the DataSource level.

See Also:
setUsername(java.lang.String),
setCredentialsForCurrentThread(String, String),
getConnection(String, String)

setCredentialsForCurrentThread

public void setCredentialsForCurrentThread(String username,
                                           String password)
Set user credententials for this proxy and the current thread. The given username and password will be applied to all subsequent getConnection() calls on this DataSource proxy.

This will override any statically specified user credentials, that is, values of the "username" and "password" bean properties.

Parameters:
username - the username to apply
password - the password to apply
See Also:
removeCredentialsFromCurrentThread()

removeCredentialsFromCurrentThread

public void removeCredentialsFromCurrentThread()
Remove any user credentials for this proxy from the current thread. Statically specified user credentials apply again afterwards.

See Also:
setCredentialsForCurrentThread(java.lang.String, java.lang.String)

getConnection

public Connection getConnection()
                         throws SQLException
Determine whether there are currently thread-bound credentials, using them if available, falling back to the statically specified username and password (i.e. values of the bean properties) else.

Delegates to doGetConnection(String, String) with the determined credentials as parameters.

Specified by:
getConnection in interface DataSource
Overrides:
getConnection in class DelegatingDataSource
Throws:
SQLException

getConnection

public Connection getConnection(String username,
                                String password)
                         throws SQLException
Simply delegates to doGetConnection(String, String), keeping the given user credentials as-is.

Specified by:
getConnection in interface DataSource
Overrides:
getConnection in class DelegatingDataSource
Throws:
SQLException

doGetConnection

protected Connection doGetConnection(String username,
                                     String password)
                              throws SQLException
This implementation delegates to the getConnection(username, password) method of the target DataSource, passing in the specified user credentials. If the specified username is empty, it will simply delegate to the standard getConnection() method of the target DataSource.

Parameters:
username - the username to use
password - the password to use
Returns:
the Connection
Throws:
SQLException
See Also:
DataSource.getConnection(String, String), DataSource.getConnection()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WebSphereDataSourceAdapter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.datasource
Class WebSphereDataSourceAdapter

java.lang.Object
    extended by  org.springframework.jdbc.datasource.DelegatingDataSource
        extended by  org.springframework.jdbc.datasource.UserCredentialsDataSourceAdapter
            extended by  org.springframework.jdbc.datasource.IsolationLevelDataSourceAdapter
                extended by  org.springframework.jdbc.datasource.WebSphereDataSourceAdapter
All Implemented Interfaces:
Wrapper, CommonDataSource, DataSource, InitializingBean
public class WebSphereDataSourceAdapter
extends IsolationLevelDataSourceAdapter

DataSource implementation that delegates all calls to a WebSphere target DataSource, typically obtained from JNDI, applying a current isolation level and/or current user credentials to every Connection obtained from it.

Uses IBM-specific API to get a JDBC Connection with a specific isolation level (and read-only flag) from a WebSphere DataSource (IBM code example). Supports the transaction-specific isolation level exposed by TransactionSynchronizationManager.getCurrentTransactionIsolationLevel(). It's also possible to specify a default isolation level, to be applied when the current Spring-managed transaction does not define a specific isolation level.

Usage example, defining the target DataSource as an inner-bean JNDI lookup (of course, you can link to any WebSphere DataSource through a bean reference):

 <bean id="myDataSource" class="org.springframework.jdbc.datasource.WebSphereDataSourceAdapter">
   <property name="targetDataSource">
     <bean class="org.springframework.jndi.JndiObjectFactoryBean">
       <property name="jndiName" value="jdbc/myds"/>
     </bean>
   </property>
 </bean>
Thanks to Ricardo Olivieri for submitting the original implementation of this approach!

Since:
2.0.3
Author:
Juergen Hoeller, Lari Hotari, Ricardo N. Olivieri
See Also:
com.ibm.websphere.rsadapter.JDBCConnectionSpec,
com.ibm.websphere.rsadapter.WSDataSource#getConnection(com.ibm.websphere.rsadapter.JDBCConnectionSpec),
TransactionSynchronizationManager.getCurrentTransactionIsolationLevel(),
TransactionSynchronizationManager.isCurrentTransactionReadOnly()

Field Summary
protected  Log logger
Constructor Summary
WebSphereDataSourceAdapter()
This constructor retrieves the WebSphere JDBC connection spec API, so we can get obtain specific WebSphere Connections using reflection.
Method Summary
 void afterPropertiesSet()
Checks that the specified 'targetDataSource' actually is a WebSphere WSDataSource.
protected  Object createConnectionSpec(Integer isolationLevel, Boolean readOnlyFlag, String username, String password)
Create a WebSphere JDBCConnectionSpec object for the given charateristics.
protected  Connection doGetConnection(String username, String password)
Builds a WebSphere JDBCConnectionSpec object for the current settings and calls WSDataSource.getConnection(JDBCConnectionSpec).
Methods inherited from class org.springframework.jdbc.datasource.IsolationLevelDataSourceAdapter
getCurrentIsolationLevel, getCurrentReadOnlyFlag, getIsolationLevel, setIsolationLevel, setIsolationLevelName
Methods inherited from class org.springframework.jdbc.datasource.UserCredentialsDataSourceAdapter
getConnection, getConnection, removeCredentialsFromCurrentThread, setCredentialsForCurrentThread, setPassword, setUsername
Methods inherited from class org.springframework.jdbc.datasource.DelegatingDataSource
getLoginTimeout, getLogWriter, getTargetDataSource, isWrapperFor, setLoginTimeout, setLogWriter, setTargetDataSource, unwrap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Constructor Detail

WebSphereDataSourceAdapter

public WebSphereDataSourceAdapter()
This constructor retrieves the WebSphere JDBC connection spec API, so we can get obtain specific WebSphere Connections using reflection.

Method Detail

afterPropertiesSet

public void afterPropertiesSet()
Checks that the specified 'targetDataSource' actually is a WebSphere WSDataSource.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class DelegatingDataSource

doGetConnection

protected Connection doGetConnection(String username,
                                     String password)
                              throws SQLException
Builds a WebSphere JDBCConnectionSpec object for the current settings and calls WSDataSource.getConnection(JDBCConnectionSpec).

Overrides:
doGetConnection in class IsolationLevelDataSourceAdapter
Parameters:
username - the username to use
password - the password to use
Returns:
the Connection
Throws:
SQLException
See Also:
createConnectionSpec(java.lang.Integer, java.lang.Boolean, java.lang.String, java.lang.String), com.ibm.websphere.rsadapter.WSDataSource#getConnection(com.ibm.websphere.rsadapter.JDBCConnectionSpec)

createConnectionSpec

protected Object createConnectionSpec(Integer isolationLevel,
                                      Boolean readOnlyFlag,
                                      String username,
                                      String password)
                               throws SQLException
Create a WebSphere JDBCConnectionSpec object for the given charateristics.

The default implementation uses reflection to apply the given settings. Can be overridden in subclasses to customize the JDBCConnectionSpec object (JDBCConnectionSpec javadoc; IBM developerWorks article).

Parameters:
isolationLevel - the isolation level to apply (or null if none)
readOnlyFlag - the read-only flag to apply (or null if none)
username - the username to apply (null or empty indicates the default)
password - the password to apply (may be null or empty)
Throws:
SQLException - if thrown by JDBCConnectionSpec API methods
See Also:
com.ibm.websphere.rsadapter.JDBCConnectionSpec
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jdbc.datasource.embedded

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jdbc.datasource.embedded

Provides extensible support for creating embedded database instances.

See:
Description

Interface Summary
ConnectionProperties | DataSourceFactory helper that allows essential JDBC connection properties to be configured consistently, independent of the actual DataSource implementation.
DataSourceFactory | Encapsulates the creation of a particular DataSource implementation, such as a SimpleDriverDataSource or connection pool such as Apache DBCP or C3P0.
EmbeddedDatabase | A handle to an EmbeddedDatabase instance.
EmbeddedDatabaseConfigurer | Encapsulates the configuration required to create, connect to, and shutdown a specific type of embedded database such as HSQL or H2.

Class Summary
EmbeddedDatabaseBuilder | A builder that provides a fluent API for constructing an embedded database.
EmbeddedDatabaseFactory | Creates a EmbeddedDatabase instance.
EmbeddedDatabaseFactoryBean | A subclass of EmbeddedDatabaseFactory that implements FactoryBean for registration as a Spring bean.
OutputStreamFactory | Internal helper for exposing dummy OutputStreams to embedded databases such as Derby, preventing the creation of a log file.

Enum Summary
EmbeddedDatabaseType A supported embedded database type.

Package org.springframework.jdbc.datasource.embedded Description

Provides extensible support for creating embedded database instances. HSQL in-memory support provided natively


org.springframework.jdbc.datasource.embedded Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jdbc.datasource.embedded

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder
    • org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory
      • org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactoryBean (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.jdbc.datasource.embedded.OutputStreamFactory

Interface Hierarchy

  • javax.sql.CommonDataSource
    • javax.sql.DataSource (also extends java.sql.Wrapper)
      • org.springframework.jdbc.datasource.embedded.EmbeddedDatabase
  • org.springframework.jdbc.datasource.embedded.ConnectionProperties
  • org.springframework.jdbc.datasource.embedded.DataSourceFactory
  • org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseConfigurer
  • java.sql.Wrapper
    • javax.sql.DataSource (also extends javax.sql.CommonDataSource)
      • org.springframework.jdbc.datasource.embedded.EmbeddedDatabase

Enum Hierarchy

  • java.lang.Object
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)
      • org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType


ConnectionProperties

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.datasource.embedded
Interface ConnectionProperties

public interface ConnectionProperties

DataSourceFactory helper that allows essential JDBC connection properties to be configured consistently, independent of the actual DataSource implementation.

Since:
3.0
Author:
Keith Donald
See Also:
DataSourceFactory

Method Summary
void | setDriverClass(Class<? extends Driver> driverClass) Set the JDBC driver to use to connect to the database.
void | setPassword(String password) Sets the password to use to connect to the database.
void | setUrl(String url) Sets the JDBC connection URL of the database.
void | setUsername(String username) Sets the username to use to connect to the database.

Method Detail

setDriverClass

void setDriverClass(Class<? extends Driver> driverClass)
Set the JDBC driver to use to connect to the database.

Parameters:
driverClass - the jdbc driver class

setUrl

void setUrl(String url)
Sets the JDBC connection URL of the database.

Parameters:
url - the connection url

setUsername

void setUsername(String username)
Sets the username to use to connect to the database.

Parameters:
username - the username

setPassword

void setPassword(String password)
Sets the password to use to connect to the database.

Parameters:
password - the password
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


DataSourceFactory

org.springframework.jdbc.datasource.embedded
Interface DataSourceFactory

public interface DataSourceFactory

Encapsulates the creation of a particular DataSource implementation, such as a SimpleDriverDataSource or connection pool such as Apache DBCP or C3P0.

Call getConnectionProperties() to configure normalized DataSource properties before calling getDataSource() to actually get the configured DataSource instance.

Since:
3.0
Author:
Keith Donald

Method Summary
ConnectionProperties | getConnectionProperties() Allows properties of the DataSource to be configured.
DataSource | getDataSource() Returns the DataSource with the connection properties applied.

Method Detail

getConnectionProperties

ConnectionProperties getConnectionProperties()
Allows properties of the DataSource to be configured.

getDataSource

DataSource getDataSource()
Returns the DataSource with the connection properties applied.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EmbeddedDatabase

org.springframework.jdbc.datasource.embedded
Interface EmbeddedDatabase

All Superinterfaces:
CommonDataSource, DataSource, Wrapper
public interface EmbeddedDatabase
extends DataSource

A handle to an EmbeddedDatabase instance. Is a DataSource. Adds a shutdown operation so the embedded database instance can be shutdown.

Since:
3.0
Author:
Keith Donald

Method Summary
 void shutdown()
Shutdown this embedded database.
Methods inherited from interface javax.sql.DataSource
getConnection, getConnection
Methods inherited from interface javax.sql.CommonDataSource
getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap

Method Detail

shutdown

void shutdown()
Shutdown this embedded database.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EmbeddedDatabaseConfigurer

org.springframework.jdbc.datasource.embedded
Interface EmbeddedDatabaseConfigurer

public interface EmbeddedDatabaseConfigurer

Encapsulates the configuration required to create, connect to, and shutdown a specific type of embedded database such as HSQL or H2. Create a implementation for each database type you wish to support; for example HSQL, H2, or some other type.

Since:
3.0
Author:
Keith Donald

Method Summary
void | configureConnectionProperties(ConnectionProperties properties, String databaseName) Configure the properties required to create and connect to the embedded database instance.
void | shutdown(DataSource dataSource, String databaseName) Shutdown the embedded database instance that backs dataSource.

Method Detail

configureConnectionProperties

void configureConnectionProperties(ConnectionProperties properties,
                                   String databaseName)
Configure the properties required to create and connect to the embedded database instance.

Parameters:
dataSource - the data source to configure
databaseName - the name of the test database

shutdown

void shutdown(DataSource dataSource,
              String databaseName)
Shutdown the embedded database instance that backs dataSource.

Parameters:
dataSource - the data source
databaseName - the name of the database being shutdown
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EmbeddedDatabaseBuilder

org.springframework.jdbc.datasource.embedded
Class EmbeddedDatabaseBuilder

java.lang.Object
    extended by  org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder

public class EmbeddedDatabaseBuilder
extends Object

A builder that provides a fluent API for constructing an embedded database.

Usage example:

 EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();
 EmbeddedDatabase db = builder.setType(H2).addScript("schema.sql").addScript("data.sql").build();
 db.shutdown();

Since:
3.0
Author:
Keith Donald, Juergen Hoeller, Dave Syer

Constructor Summary
EmbeddedDatabaseBuilder()
Create a new embedded database builder.
EmbeddedDatabaseBuilder(ResourceLoader resourceLoader)
Create a new embedded database builder with the given ResourceLoader.
Method Summary
EmbeddedDatabaseBuilder | addDefaultScripts() Add default scripts to execute to populate the database.
EmbeddedDatabaseBuilder | addScript(String sqlResource) Adds a SQL script to execute to populate the database.
EmbeddedDatabase | build() Build the embedded database.
EmbeddedDatabaseBuilder | setName(String databaseName) Sets the name of the embedded database Defaults to 'testdb' if not called.
EmbeddedDatabaseBuilder | setType(EmbeddedDatabaseType databaseType) Sets the type of embedded database.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

EmbeddedDatabaseBuilder

public EmbeddedDatabaseBuilder()
Create a new embedded database builder.

EmbeddedDatabaseBuilder

public EmbeddedDatabaseBuilder(ResourceLoader resourceLoader)
Create a new embedded database builder with the given ResourceLoader.

Parameters:
resourceLoader - the ResourceLoader to delegate to
Method Detail

setName

public EmbeddedDatabaseBuilder setName(String databaseName)
Sets the name of the embedded database Defaults to 'testdb' if not called.

Parameters:
databaseName - the database name
Returns:
this, for fluent call chaining

setType

public EmbeddedDatabaseBuilder setType(EmbeddedDatabaseType databaseType)
Sets the type of embedded database. Defaults to HSQL if not called.

Parameters:
databaseType - the database type
Returns:
this, for fluent call chaining

addScript

public EmbeddedDatabaseBuilder addScript(String sqlResource)
Adds a SQL script to execute to populate the database.

Parameters:
sqlResource - the sql resource location
Returns:
this, for fluent call chaining

addDefaultScripts

public EmbeddedDatabaseBuilder addDefaultScripts()
Add default scripts to execute to populate the database. The default scripts are schema.sql to create the db schema and data.sql to populate the db with data.

Returns:
this, for fluent call chaining

build

public EmbeddedDatabase build()
Build the embedded database.

Returns:
the embedded database
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EmbeddedDatabaseFactory

org.springframework.jdbc.datasource.embedded
Class EmbeddedDatabaseFactory

java.lang.Object
    extended by  org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory
Direct Known Subclasses:
EmbeddedDatabaseFactoryBean
public class EmbeddedDatabaseFactory
extends Object

Creates a EmbeddedDatabase instance. Callers are guaranteed that the returned database has been fully initialized and populated.

Can be configured:
Call setDatabaseName(String) to change the name of the database.
Call setDatabaseType(EmbeddedDatabaseType) to set the database type if you wish to use one of the supported types.
Call setDatabaseConfigurer(EmbeddedDatabaseConfigurer) to configure support for your own embedded database type.
Call setDatabasePopulator(DatabasePopulator) to change the algorithm used to populate the database.
Call setDataSourceFactory(DataSourceFactory) to change the type of DataSource used to connect to the database.
Call getDatabase() to get the EmbeddedDatabase instance.

Since:
3.0
Author:
Keith Donald, Juergen Hoeller

Constructor Summary
EmbeddedDatabaseFactory()
Method Summary
EmbeddedDatabase | getDatabase() Factory method that returns the embedded database instance.
protected DataSource | getDataSource() Hook that gets the DataSource that provides the connectivity to the embedded database.
protected void | initDatabase() Hook to initialize the embedded database.
void | setDatabaseConfigurer(EmbeddedDatabaseConfigurer configurer) Set the strategy that will be used to configure the embedded database instance.
void | setDatabaseName(String databaseName) Set the name of the database.
void | setDatabasePopulator(DatabasePopulator populator) Set the strategy that will be used to populate the embedded database.
void | setDatabaseType(EmbeddedDatabaseType type) Set the type of embedded database to use.
void | setDataSourceFactory(DataSourceFactory dataSourceFactory) Set the factory to use to create the DataSource instance that connects to the embedded database.
protected void | shutdownDatabase() Hook to shutdown the embedded database.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

EmbeddedDatabaseFactory

public EmbeddedDatabaseFactory()
Method Detail

setDatabaseName

public void setDatabaseName(String databaseName)
Set the name of the database. Defaults to "testdb".

Parameters:
databaseName - name of the test database

setDatabaseType

public void setDatabaseType(EmbeddedDatabaseType type)
Set the type of embedded database to use. Call this when you wish to configure one of the pre-supported types. Defaults to HSQL.

Parameters:
type - the test database type

setDatabaseConfigurer

public void setDatabaseConfigurer(EmbeddedDatabaseConfigurer configurer)
Set the strategy that will be used to configure the embedded database instance. Call this when you wish to use an embedded database type not already supported.

Parameters:
configurer - the embedded database configurer

setDatabasePopulator

public void setDatabasePopulator(DatabasePopulator populator)
Set the strategy that will be used to populate the embedded database. Defaults to null.

Parameters:
populator - the database populator

setDataSourceFactory

public void setDataSourceFactory(DataSourceFactory dataSourceFactory)
Set the factory to use to create the DataSource instance that connects to the embedded database. Defaults to SimpleDriverDataSourceFactory.

Parameters:
dataSourceFactory - the data source factory

getDatabase

public EmbeddedDatabase getDatabase()
Factory method that returns the embedded database instance.

initDatabase

protected void initDatabase()
Hook to initialize the embedded database. Subclasses may call to force initialization. After calling this method, getDataSource() returns the DataSource providing connectivity to the db.

getDataSource

protected DataSource getDataSource()
Hook that gets the DataSource that provides the connectivity to the embedded database.

Returns null if the DataSource has not been initialized or the database has been shut down. Subclasses may call to access the datasource instance directly.

shutdownDatabase

protected void shutdownDatabase()
Hook to shutdown the embedded database. Subclasses may call to force shutdown. After calling, getDataSource() returns null. Does nothing if no embedded database has been initialized.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EmbeddedDatabaseFactoryBean

org.springframework.jdbc.datasource.embedded
Class EmbeddedDatabaseFactoryBean

java.lang.Object
    extended by  org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory
        extended by  org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactoryBean
All Implemented Interfaces:
DisposableBean, FactoryBean<DataSource>, InitializingBean
public class EmbeddedDatabaseFactoryBean
extends EmbeddedDatabaseFactory
implements FactoryBean<DataSource>, InitializingBean, DisposableBean

A subclass of EmbeddedDatabaseFactory that implements FactoryBean for registration as a Spring bean. Returns the actual DataSource that provides connectivity to the embedded database to Spring.

The target DataSource is returned instead of a EmbeddedDatabase proxy since the FactoryBean will manage the initialization and destruction lifecycle of the database instance.

Implements DisposableBean to shutdown the embedded database when the managing Spring container is shutdown.

Since:
3.0
Author:
Keith Donald

Constructor Summary
EmbeddedDatabaseFactoryBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 void destroy()
Invoked by a BeanFactory on destruction of a singleton.
 DataSource getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<? extends DataSource> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
Methods inherited from class org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory
getDatabase, getDataSource, initDatabase, setDatabaseConfigurer, setDatabaseName, setDatabasePopulator, setDatabaseType, setDataSourceFactory, shutdownDatabase
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

EmbeddedDatabaseFactoryBean

public EmbeddedDatabaseFactoryBean()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

getObject

public DataSource getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<DataSource>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends DataSource> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<DataSource>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<DataSource>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()

destroy

public void destroy()
Description copied from interface: DisposableBean
Invoked by a BeanFactory on destruction of a singleton.

Specified by:
destroy in interface DisposableBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OutputStreamFactory

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.datasource.embedded
Class OutputStreamFactory

java.lang.Object
    extended by  org.springframework.jdbc.datasource.embedded.OutputStreamFactory

public class OutputStreamFactory
extends Object

Internal helper for exposing dummy OutputStreams to embedded databases such as Derby, preventing the creation of a log file.

Since:
3.0
Author:
Juergen Hoeller

Constructor Summary
OutputStreamFactory()
Method Summary
static OutputStream getNoopOutputStream()
Returns an OutputStream that ignores all data given to it.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OutputStreamFactory

public OutputStreamFactory()
Method Detail

getNoopOutputStream

public static OutputStream getNoopOutputStream()
Returns an OutputStream that ignores all data given to it.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


EmbeddedDatabaseType

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

org.springframework.jdbc.datasource.embedded
Enum EmbeddedDatabaseType

java.lang.Object
    extended by  java.lang.Enum<EmbeddedDatabaseType>
        extended by  org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType
All Implemented Interfaces:
Serializable, Comparable<EmbeddedDatabaseType>
public enum EmbeddedDatabaseType
extends Enum<EmbeddedDatabaseType>

A supported embedded database type.

Since:
3.0
Author:
Keith Donald, Oliver Gierke

Enum Constant Summary
DERBY
The Apache Derby Embedded SQL Database (http://db.apache.org/derby)
H2
The H2 Embedded Java SQL Database Engine (http://h2database.com)
HSQL
The Hypersonic Embedded Java SQL Database (http://hsqldb.org)
Method Summary
static EmbeddedDatabaseType | valueOf(String name) Returns the enum constant of this type with the specified name.
static EmbeddedDatabaseType[] | values() Returns an array containing the constants of this enum type, in the order they are declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

HSQL

public static final EmbeddedDatabaseType HSQL
The Hypersonic Embedded Java SQL Database (http://hsqldb.org)

H2

public static final EmbeddedDatabaseType H2
The H2 Embedded Java SQL Database Engine (http://h2database.com)

DERBY

public static final EmbeddedDatabaseType DERBY
The Apache Derby Embedded SQL Database (http://db.apache.org/derby)

Method Detail

values

public static EmbeddedDatabaseType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (EmbeddedDatabaseType c : EmbeddedDatabaseType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static EmbeddedDatabaseType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


org.springframework.jdbc.datasource.init

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jdbc.datasource.init

Interface Summary
DatabasePopulator Strategy used to populate a database during initialization.

Class Summary
DataSourceInitializer | Used to populate a database during initialization.
ResourceDatabasePopulator | Populates a database from SQL scripts defined in external resources.

Exception Summary
CannotReadScriptException Thrown by ResourceDatabasePopulator if one of its SQL scripts could not be read during population.


org.springframework.jdbc.datasource.init Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jdbc.datasource.init

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jdbc.datasource.init.DataSourceInitializer (implements org.springframework.beans.factory.InitializingBean)
    • org.springframework.jdbc.datasource.init.ResourceDatabasePopulator (implements org.springframework.jdbc.datasource.init.DatabasePopulator)
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.jdbc.datasource.init.CannotReadScriptException

Interface Hierarchy

  • org.springframework.jdbc.datasource.init.DatabasePopulator


DatabasePopulator

org.springframework.jdbc.datasource.init
Interface DatabasePopulator

All Known Implementing Classes:
ResourceDatabasePopulator
public interface DatabasePopulator

Strategy used to populate a database during initialization.

Since:
3.0
Author:
Keith Donald
See Also:
ResourceDatabasePopulator

Method Summary
 void populate(Connection connection)
Populate the database using the JDBC connection provided.

Method Detail

populate

void populate(Connection connection)
              throws SQLException
Populate the database using the JDBC connection provided.

Parameters:
connection - the JDBC connection to use to populate the db; already configured and ready to use
Throws:
SQLException - if an unrecoverable data access exception occurs during database population
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DataSourceInitializer

org.springframework.jdbc.datasource.init
Class DataSourceInitializer

java.lang.Object
    extended by  org.springframework.jdbc.datasource.init.DataSourceInitializer
All Implemented Interfaces:
InitializingBean
public class DataSourceInitializer
extends Object
implements InitializingBean

Used to populate a database during initialization.

Since:
3.0
Author:
Dave Syer
See Also:
DatabasePopulator

Constructor Summary
DataSourceInitializer()
Method Summary
void | afterPropertiesSet() Use the populator to set up data in the data source.
void | setDatabasePopulator(DatabasePopulator databasePopulator) The DatabasePopulator to use to populate the data source.
void | setDataSource(DataSource dataSource) The DataSource to populate when this component is initialized.
void | setEnabled(boolean enabled) Flag to explicitly enable or disable the database populator.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DataSourceInitializer

public DataSourceInitializer()
Method Detail

setEnabled

public void setEnabled(boolean enabled)
Flag to explicitly enable or disable the database populator.

Parameters:
enabled - true if the database populator will be called on startup

setDatabasePopulator

public void setDatabasePopulator(DatabasePopulator databasePopulator)
The DatabasePopulator to use to populate the data source. Mandatory with no default.

Parameters:
databasePopulator - the database populator to use.

setDataSource

public void setDataSource(DataSource dataSource)
The DataSource to populate when this component is initialized. Mandatory with no default.

Parameters:
dataSource - the DataSource

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Use the populator to set up data in the data source. Both properties are mandatory with no defaults.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception - in the event of misconfiguration (such as failure to set an essential property) or if initialization fails.
See Also:
InitializingBean.afterPropertiesSet()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResourceDatabasePopulator

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.datasource.init
Class ResourceDatabasePopulator

java.lang.Object
    extended by  org.springframework.jdbc.datasource.init.ResourceDatabasePopulator
All Implemented Interfaces:
DatabasePopulator
public class ResourceDatabasePopulator
extends Object
implements DatabasePopulator

Populates a database from SQL scripts defined in external resources.

Call addScript(Resource) to add a SQL script location.
Call setSqlScriptEncoding(String) to set the encoding for all added scripts.

Since:
3.0
Author:
Keith Donald, Dave Syer, Juergen Hoeller

Constructor Summary
ResourceDatabasePopulator()
Method Summary
void | addScript(Resource script) Add a script to execute to populate the database.
void | populate(Connection connection) Populate the database using the JDBC connection provided.
void | setCommentPrefix(String commentPrefix) Set the line prefix that identifies comments in the SQL script.
void | setContinueOnError(boolean continueOnError) Flag to indicate that all failures in SQL should be logged but not cause a failure.
void | setIgnoreFailedDrops(boolean ignoreFailedDrops) Flag to indicate that a failed SQL DROP statement can be ignored.
void | setScripts(Resource[] scripts) Set the scripts to execute to populate the database.
void | setSqlScriptEncoding(String sqlScriptEncoding) Specify the encoding for SQL scripts, if different from the platform encoding.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ResourceDatabasePopulator

public ResourceDatabasePopulator()
Method Detail

addScript

public void addScript(Resource script)
Add a script to execute to populate the database.

Parameters:
script - the path to a SQL script

setScripts

public void setScripts(Resource[] scripts)
Set the scripts to execute to populate the database.

Parameters:
scripts - the scripts to execute

setSqlScriptEncoding

public void setSqlScriptEncoding(String sqlScriptEncoding)
Specify the encoding for SQL scripts, if different from the platform encoding. Note setting this property has no effect on added scripts that are already encoded resources.

See Also:
addScript(Resource)

setCommentPrefix

public void setCommentPrefix(String commentPrefix)
Set the line prefix that identifies comments in the SQL script. Default is "--".

setContinueOnError

public void setContinueOnError(boolean continueOnError)
Flag to indicate that all failures in SQL should be logged but not cause a failure. Defaults to false.

setIgnoreFailedDrops

public void setIgnoreFailedDrops(boolean ignoreFailedDrops)
Flag to indicate that a failed SQL DROP statement can be ignored.

This is useful for non-embedded databases whose SQL dialect does not support an IF EXISTS clause in a DROP. The default is false so that if the populator runs accidentally, it will fail fast when the script starts with a DROP.

populate

public void populate(Connection connection)
              throws SQLException
Description copied from interface: DatabasePopulator
Populate the database using the JDBC connection provided.

Specified by:
populate in interface DatabasePopulator
Parameters:
connection - the JDBC connection to use to populate the db; already configured and ready to use
Throws:
SQLException - if an unrecoverable data access exception occurs during database population
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


CannotReadScriptException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.datasource.init
Class CannotReadScriptException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.jdbc.datasource.init.CannotReadScriptException
All Implemented Interfaces:
Serializable
public class CannotReadScriptException
extends RuntimeException

Thrown by ResourceDatabasePopulator if one of its SQL scripts could not be read during population.

Since:
3.0
Author:
Keith Donald
See Also:
Serialized Form

Constructor Summary
CannotReadScriptException(EncodedResource resource, Throwable cause)
Constructor a new CannotReadScriptException.
Method Summary
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

CannotReadScriptException

public CannotReadScriptException(EncodedResource resource,
                                 Throwable cause)
Constructor a new CannotReadScriptException.

Parameters:
resource - the resource that could not be read from
cause - the underlying cause of the resource access failure
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jdbc.datasource.lookup

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jdbc.datasource.lookup

Provides a strategy for looking up JDBC DataSources by name.

See:
Description

Interface Summary
DataSourceLookup Strategy interface for looking up DataSources by name.

Class Summary
AbstractRoutingDataSource | Abstract DataSource implementation that routes AbstractRoutingDataSource.getConnection() calls to one of various target DataSources based on a lookup key.
BeanFactoryDataSourceLookup | DataSourceLookup implementation based on a Spring BeanFactory.
IsolationLevelDataSourceRouter | DataSource that routes to one of various target DataSources based on the current transaction isolation level.
JndiDataSourceLookup | JNDI-based DataSourceLookup implementation.
MapDataSourceLookup | Simple DataSourceLookup implementation that relies on a map for doing lookups.
SingleDataSourceLookup | An implementation of the DataSourceLookup that simply wraps a single given DataSource, returned for any data source name.

Exception Summary
DataSourceLookupFailureException Exception to be thrown by a DataSourceLookup implementation, indicating that the specified DataSource could not be obtained.

Package org.springframework.jdbc.datasource.lookup Description

Provides a strategy for looking up JDBC DataSources by name.


org.springframework.jdbc.datasource.lookup Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jdbc.datasource.lookup

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jdbc.datasource.AbstractDataSource (implements javax.sql.DataSource)
      • org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource (implements org.springframework.beans.factory.InitializingBean)
        • org.springframework.jdbc.datasource.lookup.IsolationLevelDataSourceRouter
    • org.springframework.jdbc.datasource.lookup.BeanFactoryDataSourceLookup (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.jdbc.datasource.lookup.DataSourceLookup)
    • org.springframework.jndi.JndiAccessor
      • org.springframework.jndi.JndiLocatorSupport
        • org.springframework.jdbc.datasource.lookup.JndiDataSourceLookup (implements org.springframework.jdbc.datasource.lookup.DataSourceLookup)
    • org.springframework.jdbc.datasource.lookup.MapDataSourceLookup (implements org.springframework.jdbc.datasource.lookup.DataSourceLookup)
    • org.springframework.jdbc.datasource.lookup.SingleDataSourceLookup (implements org.springframework.jdbc.datasource.lookup.DataSourceLookup)
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.dao.DataAccessException
              • org.springframework.dao.NonTransientDataAccessException
                • org.springframework.jdbc.datasource.lookup.DataSourceLookupFailureException

Interface Hierarchy

  • org.springframework.jdbc.datasource.lookup.DataSourceLookup


DataSourceLookup

org.springframework.jdbc.datasource.lookup
Interface DataSourceLookup

All Known Implementing Classes:
BeanFactoryDataSourceLookup, JndiDataSourceLookup, MapDataSourceLookup, SingleDataSourceLookup
public interface DataSourceLookup

Strategy interface for looking up DataSources by name.

Used, for example, to resolve data source names in JPA persistence.xml files.

Since:
2.0
Author:
Costin Leau, Juergen Hoeller
See Also:
DefaultPersistenceUnitManager.setDataSourceLookup(org.springframework.jdbc.datasource.lookup.DataSourceLookup)

Method Summary
 DataSource getDataSource(String dataSourceName)
Retrieve the DataSource identified by the given name.

Method Detail

getDataSource

DataSource getDataSource(String dataSourceName)
                         throws DataSourceLookupFailureException
Retrieve the DataSource identified by the given name.

Parameters:
dataSourceName - the name of the DataSource
Returns:
the DataSource (never null)
Throws:
DataSourceLookupFailureException - if the lookup failed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractRoutingDataSource

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.datasource.lookup
Class AbstractRoutingDataSource

java.lang.Object
    extended by  org.springframework.jdbc.datasource.AbstractDataSource
        extended by  org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
All Implemented Interfaces:
Wrapper, CommonDataSource, DataSource, InitializingBean
Direct Known Subclasses:
IsolationLevelDataSourceRouter
public abstract class AbstractRoutingDataSource
extends AbstractDataSource
implements InitializingBean

Abstract DataSource implementation that routes getConnection() calls to one of various target DataSources based on a lookup key. The latter is usually (but not necessarily) determined through some thread-bound transaction context.

Since:
2.0.1
Author:
Juergen Hoeller
See Also:
setTargetDataSources(java.util.Map),
setDefaultTargetDataSource(java.lang.Object),
determineCurrentLookupKey()

Field Summary
Fields inherited from class org.springframework.jdbc.datasource.AbstractDataSource
logger
Constructor Summary
AbstractRoutingDataSource()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected abstract Object | determineCurrentLookupKey() Determine the current lookup key.
protected DataSource | determineTargetDataSource() Retrieve the current target DataSource.
Connection | getConnection()
Connection | getConnection(String username, String password)
protected DataSource | resolveSpecifiedDataSource(Object dataSource) Resolve the specified data source object into a DataSource instance.
protected Object | resolveSpecifiedLookupKey(Object lookupKey) Resolve the given lookup key object, as specified in the targetDataSources map, into the actual lookup key to be used for matching with the current lookup key.
void | setDataSourceLookup(DataSourceLookup dataSourceLookup) Set the DataSourceLookup implementation to use for resolving data source name Strings in the targetDataSources map.
void | setDefaultTargetDataSource(Object defaultTargetDataSource) Specify the default target DataSource, if any.
void | setLenientFallback(boolean lenientFallback) Specify whether to apply a lenient fallback to the default DataSource if no specific DataSource could be found for the current lookup key.
void | setTargetDataSources(Map<Object,Object> targetDataSources) Specify the map of target DataSources, with the lookup key as key.
Methods inherited from class org.springframework.jdbc.datasource.AbstractDataSource
getLoginTimeout, getLogWriter, isWrapperFor, setLoginTimeout, setLogWriter, unwrap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractRoutingDataSource

public AbstractRoutingDataSource()
Method Detail

setTargetDataSources

public void setTargetDataSources(Map<Object,Object> targetDataSources)
Specify the map of target DataSources, with the lookup key as key. The mapped value can either be a corresponding DataSource instance or a data source name String (to be resolved via a DataSourceLookup).

The key can be of arbitrary type; this class implements the generic lookup process only. The concrete key representation will be handled by resolveSpecifiedLookupKey(Object) and determineCurrentLookupKey().

setDefaultTargetDataSource

public void setDefaultTargetDataSource(Object defaultTargetDataSource)
Specify the default target DataSource, if any.

The mapped value can either be a corresponding DataSource instance or a data source name String (to be resolved via a DataSourceLookup).

This DataSource will be used as target if none of the keyed targetDataSources match the determineCurrentLookupKey() current lookup key.

setLenientFallback

public void setLenientFallback(boolean lenientFallback)
Specify whether to apply a lenient fallback to the default DataSource if no specific DataSource could be found for the current lookup key.

Default is "true", accepting lookup keys without a corresponding entry in the target DataSource map - simply falling back to the default DataSource in that case.

Switch this flag to "false" if you would prefer the fallback to only apply if the lookup key was null. Lookup keys without a DataSource entry will then lead to an IllegalStateException.

See Also:
setTargetDataSources(java.util.Map),
setDefaultTargetDataSource(java.lang.Object),
determineCurrentLookupKey()

setDataSourceLookup

public void setDataSourceLookup(DataSourceLookup dataSourceLookup)
Set the DataSourceLookup implementation to use for resolving data source name Strings in the targetDataSources map.

Default is a JndiDataSourceLookup, allowing the JNDI names of application server DataSources to be specified directly.

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

resolveSpecifiedDataSource

protected DataSource resolveSpecifiedDataSource(Object dataSource)
                                         throws IllegalArgumentException
Resolve the specified data source object into a DataSource instance.

The default implementation handles DataSource instances and data source names (to be resolved via a DataSourceLookup).

Parameters:
dataSource - the data source value object as specified in the targetDataSources map
Returns:
the resolved DataSource (never null)
Throws:
IllegalArgumentException - in case of an unsupported value type

getConnection

public Connection getConnection()
                         throws SQLException
Specified by:
getConnection in interface DataSource
Throws:
SQLException

getConnection

public Connection getConnection(String username,
                                String password)
                         throws SQLException
Specified by:
getConnection in interface DataSource
Throws:
SQLException

determineTargetDataSource

protected DataSource determineTargetDataSource()
Retrieve the current target DataSource. Determines the current lookup key, performs a lookup in the targetDataSources map, falls back to the specified default target DataSource if necessary.

See Also:
determineCurrentLookupKey()

resolveSpecifiedLookupKey

protected Object resolveSpecifiedLookupKey(Object lookupKey)
Resolve the given lookup key object, as specified in the targetDataSources map, into the actual lookup key to be used for matching with the current lookup key.

The default implementation simply returns the given key as-is.

Parameters:
lookupKey - the lookup key object as specified by the user
Returns:
the lookup key as needed for matching

determineCurrentLookupKey

protected abstract Object determineCurrentLookupKey()
Determine the current lookup key. This will typically be implemented to check a thread-bound transaction context.

Allows for arbitrary keys. The returned key needs to match the stored lookup key type, as resolved by the resolveSpecifiedLookupKey(java.lang.Object) method.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


BeanFactoryDataSourceLookup

org.springframework.jdbc.datasource.lookup
Class BeanFactoryDataSourceLookup

java.lang.Object
    extended by  org.springframework.jdbc.datasource.lookup.BeanFactoryDataSourceLookup
All Implemented Interfaces:
BeanFactoryAware, DataSourceLookup
public class BeanFactoryDataSourceLookup
extends Object
implements DataSourceLookup, BeanFactoryAware

DataSourceLookup implementation based on a Spring BeanFactory.

Will lookup Spring managed beans identified by bean name, expecting them to be of type javax.sql.DataSource.

Since:
2.0
Author:
Costin Leau, Juergen Hoeller
See Also:
BeanFactory

Constructor Summary
BeanFactoryDataSourceLookup()
Create a new instance of the BeanFactoryDataSourceLookup class.
BeanFactoryDataSourceLookup(BeanFactory beanFactory)
Create a new instance of the BeanFactoryDataSourceLookup class.
Method Summary
DataSource | getDataSource(String dataSourceName) Retrieve the DataSource identified by the given name.
void | setBeanFactory(BeanFactory beanFactory) Callback that supplies the owning factory to a bean instance.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BeanFactoryDataSourceLookup

public BeanFactoryDataSourceLookup()
Create a new instance of the BeanFactoryDataSourceLookup class.

The BeanFactory to access must be set via setBeanFactory.

See Also:
setBeanFactory(org.springframework.beans.factory.BeanFactory)

BeanFactoryDataSourceLookup

public BeanFactoryDataSourceLookup(BeanFactory beanFactory)
Create a new instance of the BeanFactoryDataSourceLookup class.

Use of this constructor is redundant if this object is being created by a Spring IoC container, as the supplied BeanFactory will be replaced by the BeanFactory that creates it (c.f. the BeanFactoryAware contract). So only use this constructor if you are using this class outside the context of a Spring IoC container.

Parameters:
beanFactory - the bean factory to be used to lookup DataSources
Method Detail

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
BeanInitializationException

getDataSource

public DataSource getDataSource(String dataSourceName)
                         throws DataSourceLookupFailureException
Description copied from interface: DataSourceLookup
Retrieve the DataSource identified by the given name.

Specified by:
getDataSource in interface DataSourceLookup
Parameters:
dataSourceName - the name of the DataSource
Returns:
the DataSource (never null)
Throws:
DataSourceLookupFailureException - if the lookup failed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


IsolationLevelDataSourceRouter

org.springframework.jdbc.datasource.lookup
Class IsolationLevelDataSourceRouter

java.lang.Object
    extended by  org.springframework.jdbc.datasource.AbstractDataSource
        extended by  org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
            extended by  org.springframework.jdbc.datasource.lookup.IsolationLevelDataSourceRouter
All Implemented Interfaces:
Wrapper, CommonDataSource, DataSource, InitializingBean
public class IsolationLevelDataSourceRouter
extends AbstractRoutingDataSource

DataSource that routes to one of various target DataSources based on the current transaction isolation level. The target DataSources need to be configured with the isolation level name as key, as defined on the TransactionDefinition interface.

This is particularly useful in combination with JTA transaction management (typically through Spring's JtaTransactionManager). Standard JTA does not support transaction-specific isolation levels. Some JTA providers support isolation levels as a vendor-specific extension (e.g. WebLogic), which is the preferred way of addressing this. As alternative (e.g. on WebSphere), the target database can be represented through multiple JNDI DataSources, each configured with a different isolation level (for the entire DataSource). The present DataSource router allows to transparently switch to the appropriate DataSource based on the current transaction's isolation level.

The configuration can for example look like this, assuming that the target DataSources are defined as individual Spring beans with names "myRepeatableReadDataSource", "mySerializableDataSource" and "myDefaultDataSource":

 <bean id="dataSourceRouter" class="org.springframework.jdbc.datasource.lookup.IsolationLevelDataSourceRouter">
   <property name="targetDataSources">
     <map>
       <entry key="ISOLATION_REPEATABLE_READ" value-ref="myRepeatableReadDataSource"/>
       <entry key="ISOLATION_SERIALIZABLE" value-ref="mySerializableDataSource"/>
     </map>
   </property>
   <property name="defaultTargetDataSource" ref="myDefaultDataSource"/>
 </bean>
Alternatively, the keyed values can also be data source names, to be resolved through a DataSourceLookup: by default, JNDI names for a standard JNDI lookup. This allows for a single concise definition without the need for separate DataSource bean definitions.
 <bean id="dataSourceRouter" class="org.springframework.jdbc.datasource.lookup.IsolationLevelDataSourceRouter">
   <property name="targetDataSources">
     <map>
       <entry key="ISOLATION_REPEATABLE_READ" value="java:comp/env/jdbc/myrrds"/>
       <entry key="ISOLATION_SERIALIZABLE" value="java:comp/env/jdbc/myserds"/>
     </map>
   </property>
   <property name="defaultTargetDataSource" value="java:comp/env/jdbc/mydefds"/>
 </bean>
Note: If you are using this router in combination with Spring's JtaTransactionManager, don't forget to switch the "allowCustomIsolationLevels" flag to "true". (By default, JtaTransactionManager will only accept a default isolation level because of the lack of isolation level support in standard JTA itself.)
 <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
   <property name="allowCustomIsolationLevels" value="true"/>
 </bean>

Since:
2.0.1
Author:
Juergen Hoeller
See Also:
AbstractRoutingDataSource.setTargetDataSources(java.util.Map), AbstractRoutingDataSource.setDefaultTargetDataSource(java.lang.Object), TransactionDefinition.ISOLATION_READ_UNCOMMITTED, TransactionDefinition.ISOLATION_READ_COMMITTED, TransactionDefinition.ISOLATION_REPEATABLE_READ, TransactionDefinition.ISOLATION_SERIALIZABLE, JtaTransactionManager

Field Summary
Fields inherited from class org.springframework.jdbc.datasource.AbstractDataSource
logger
Constructor Summary
IsolationLevelDataSourceRouter()
Method Summary
protected Object | determineCurrentLookupKey() Determine the current lookup key.
protected Object | resolveSpecifiedLookupKey(Object lookupKey) Supports Integer values for the isolation level constants as well as isolation level names as defined on the TransactionDefinition interface.
Methods inherited from class org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
afterPropertiesSet, determineTargetDataSource, getConnection, getConnection, resolveSpecifiedDataSource, setDataSourceLookup, setDefaultTargetDataSource, setLenientFallback, setTargetDataSources
Methods inherited from class org.springframework.jdbc.datasource.AbstractDataSource
getLoginTimeout, getLogWriter, isWrapperFor, setLoginTimeout, setLogWriter, unwrap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

IsolationLevelDataSourceRouter

public IsolationLevelDataSourceRouter()
Method Detail

resolveSpecifiedLookupKey

protected Object resolveSpecifiedLookupKey(Object lookupKey)
Supports Integer values for the isolation level constants as well as isolation level names as defined on the TransactionDefinition interface.

Overrides:
resolveSpecifiedLookupKey in class AbstractRoutingDataSource
Parameters:
lookupKey - the lookup key object as specified by the user
Returns:
the lookup key as needed for matching

determineCurrentLookupKey

protected Object determineCurrentLookupKey()
Description copied from class: AbstractRoutingDataSource
Determine the current lookup key. This will typically be implemented to check a thread-bound transaction context.

Allows for arbitrary keys. The returned key needs to match the stored lookup key type, as resolved by the AbstractRoutingDataSource.resolveSpecifiedLookupKey(java.lang.Object) method.

Specified by:
determineCurrentLookupKey in class AbstractRoutingDataSource
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JndiDataSourceLookup

org.springframework.jdbc.datasource.lookup
Class JndiDataSourceLookup

java.lang.Object
    extended by  org.springframework.jndi.JndiAccessor
        extended by  org.springframework.jndi.JndiLocatorSupport
            extended by  org.springframework.jdbc.datasource.lookup.JndiDataSourceLookup
All Implemented Interfaces:
DataSourceLookup
public class JndiDataSourceLookup
extends JndiLocatorSupport
implements DataSourceLookup

JNDI-based DataSourceLookup implementation.

For specific JNDI configuration, it is recommended to configure the "jndiEnvironment"/"jndiTemplate" properties.

Since:
2.0
Author:
Costin Leau, Juergen Hoeller
See Also:
JndiAccessor.setJndiEnvironment(java.util.Properties), JndiAccessor.setJndiTemplate(org.springframework.jndi.JndiTemplate)

Field Summary
Fields inherited from class org.springframework.jndi.JndiLocatorSupport
CONTAINER_PREFIX
Fields inherited from class org.springframework.jndi.JndiAccessor
logger
Constructor Summary
JndiDataSourceLookup()
Method Summary
 DataSource getDataSource(String dataSourceName)
Retrieve the DataSource identified by the given name.
Methods inherited from class org.springframework.jndi.JndiLocatorSupport
convertJndiName, isResourceRef, lookup, lookup, setResourceRef
Methods inherited from class org.springframework.jndi.JndiAccessor
getJndiEnvironment, getJndiTemplate, setJndiEnvironment, setJndiTemplate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JndiDataSourceLookup

public JndiDataSourceLookup()
Method Detail

getDataSource

public DataSource getDataSource(String dataSourceName)
                         throws DataSourceLookupFailureException
Description copied from interface: DataSourceLookup
Retrieve the DataSource identified by the given name.

Specified by:
getDataSource in interface DataSourceLookup
Parameters:
dataSourceName - the name of the DataSource
Returns:
the DataSource (never null)
Throws:
DataSourceLookupFailureException - if the lookup failed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MapDataSourceLookup

org.springframework.jdbc.datasource.lookup
Class MapDataSourceLookup

java.lang.Object
    extended by  org.springframework.jdbc.datasource.lookup.MapDataSourceLookup
All Implemented Interfaces:
DataSourceLookup
public class MapDataSourceLookup
extends Object
implements DataSourceLookup

Simple DataSourceLookup implementation that relies on a map for doing lookups.

Useful for testing environments or applications that need to match arbitrary String names to target DataSource objects.

Since:
2.0
Author:
Costin Leau, Juergen Hoeller, Rick Evans

Constructor Summary
MapDataSourceLookup()
Create a new instance of the MapDataSourceLookup class.
MapDataSourceLookup(Map<String,DataSource> dataSources)
Create a new instance of the MapDataSourceLookup class.
MapDataSourceLookup(String dataSourceName, DataSource dataSource)
Create a new instance of the MapDataSourceLookup class.
Method Summary
void | addDataSource(String dataSourceName, DataSource dataSource) Add the supplied DataSource to the map of DataSources maintained by this object.
DataSource | getDataSource(String dataSourceName) Retrieve the DataSource identified by the given name.
Map<String,DataSource> | getDataSources() Get the Map of DataSources maintained by this object.
void | setDataSources(Map<String,DataSource> dataSources) Set the Map of DataSources; the keys are Strings, the values are actual DataSource instances.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MapDataSourceLookup

public MapDataSourceLookup()
Create a new instance of the MapDataSourceLookup class.

MapDataSourceLookup

public MapDataSourceLookup(Map<String,DataSource> dataSources)
Create a new instance of the MapDataSourceLookup class.

Parameters:
dataSources - the Map of DataSources; the keys are Strings, the values are actual DataSource instances.

MapDataSourceLookup

public MapDataSourceLookup(String dataSourceName,
                           DataSource dataSource)
Create a new instance of the MapDataSourceLookup class.

Parameters:
dataSourceName - the name under which the supplied DataSource is to be added
dataSource - the DataSource to be added
Method Detail

setDataSources

public void setDataSources(Map<String,DataSource> dataSources)
Set the Map of DataSources; the keys are Strings, the values are actual DataSource instances.

If the supplied Map is null, then this method call effectively has no effect.

Parameters:
dataSources - said Map of DataSources

getDataSources

public Map<String,DataSource> getDataSources()
Get the Map of DataSources maintained by this object.

The returned Map is unmodifiable.

Returns:
said Map of DataSources (never null)

addDataSource

public void addDataSource(String dataSourceName,
                          DataSource dataSource)
Add the supplied DataSource to the map of DataSources maintained by this object.

Parameters:
dataSourceName - the name under which the supplied DataSource is to be added
dataSource - the DataSource to be so added

getDataSource

public DataSource getDataSource(String dataSourceName)
                         throws DataSourceLookupFailureException
Description copied from interface: DataSourceLookup
Retrieve the DataSource identified by the given name.

Specified by:
getDataSource in interface DataSourceLookup
Parameters:
dataSourceName - the name of the DataSource
Returns:
the DataSource (never null)
Throws:
DataSourceLookupFailureException - if the lookup failed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SingleDataSourceLookup

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.datasource.lookup
Class SingleDataSourceLookup

java.lang.Object
    extended by  org.springframework.jdbc.datasource.lookup.SingleDataSourceLookup
All Implemented Interfaces:
DataSourceLookup
public class SingleDataSourceLookup
extends Object
implements DataSourceLookup

An implementation of the DataSourceLookup that simply wraps a single given DataSource, returned for any data source name.

Since:
2.0
Author:
Juergen Hoeller

Constructor Summary
SingleDataSourceLookup(DataSource dataSource)
Create a new instance of the SingleDataSourceLookup class.
Method Summary
 DataSource getDataSource(String dataSourceName)
Retrieve the DataSource identified by the given name.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SingleDataSourceLookup

public SingleDataSourceLookup(DataSource dataSource)
Create a new instance of the SingleDataSourceLookup class.

Parameters:
dataSource - the single DataSource to wrap
Method Detail

getDataSource

public DataSource getDataSource(String dataSourceName)
Description copied from interface: DataSourceLookup
Retrieve the DataSource identified by the given name.

Specified by:
getDataSource in interface DataSourceLookup
Parameters:
dataSourceName - the name of the DataSource
Returns:
the DataSource (never null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


DataSourceLookupFailureException

org.springframework.jdbc.datasource.lookup
Class DataSourceLookupFailureException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.jdbc.datasource.lookup.DataSourceLookupFailureException
All Implemented Interfaces:
Serializable
public class DataSourceLookupFailureException
extends NonTransientDataAccessException

Exception to be thrown by a DataSourceLookup implementation, indicating that the specified DataSource could not be obtained.

Since:
2.0
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
DataSourceLookupFailureException(String msg)
Constructor for DataSourceLookupFailureException.
DataSourceLookupFailureException(String msg, Throwable cause)
Constructor for DataSourceLookupFailureException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

DataSourceLookupFailureException

public DataSourceLookupFailureException(String msg)
Constructor for DataSourceLookupFailureException.

Parameters:
msg - the detail message

DataSourceLookupFailureException

public DataSourceLookupFailureException(String msg,
                                        Throwable cause)
Constructor for DataSourceLookupFailureException.

Parameters:
msg - the detail message
cause - the root cause (usually from using a underlying lookup API such as JNDI)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.jdbc.object

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jdbc.object

The classes in this package represent RDBMS queries, updates, and stored procedures as threadsafe, reusable objects.

See:
Description

Class Summary
BatchSqlUpdate | SqlUpdate subclass that performs batch update operations.
GenericSqlQuery |
GenericStoredProcedure | Concrete implementation making it possible to define the RDBMS stored procedures in an application context without writing a custom Java implementation class.
MappingSqlQuery<T> | Reusable query in which concrete subclasses must implement the abstract mapRow(ResultSet, int) method to convert each row of the JDBC ResultSet into an object.
MappingSqlQueryWithParameters<T> | Reusable RDBMS query in which concrete subclasses must implement the abstract mapRow(ResultSet, int) method to map each row of the JDBC ResultSet into an object.
RdbmsOperation | An "RDBMS operation" is a multi-threaded, reusable object representing a query, update, or stored procedure call.
SqlCall | RdbmsOperation using a JdbcTemplate and representing a SQL-based call such as a stored procedure or a stored function.
SqlFunction<T> | SQL "function" wrapper for a query that returns a single row of results.
SqlOperation | Operation object representing a SQL-based operation such as a query or update, as opposed to a stored procedure.
SqlQuery<T> | Reusable operation object representing a SQL query.
SqlUpdate | Reusable operation object representing a SQL update.
StoredProcedure | Superclass for object abstractions of RDBMS stored procedures.
UpdatableSqlQuery<T> | Reusable RDBMS query in which concrete subclasses must implement the abstract updateRow(ResultSet, int, context) method to update each row of the JDBC ResultSet and optionally map contents into an object.

Package org.springframework.jdbc.object Description

The classes in this package represent RDBMS queries, updates, and stored procedures as threadsafe, reusable objects. This approach is modelled by JDO, although of course objects returned by queries are "disconnected" from the database.

This higher level of JDBC abstraction depends on the lower-level abstraction in the org.springframework.jdbc.core package. Exceptions thrown are as in the org.springframework.dao package, meaning that code using this package does not need to implement JDBC or RDBMS-specific error handling.

This package and related packages are discussed in Chapter 9 of Expert One-On-One J2EE Design and Development by Rod Johnson (Wrox, 2002).


org.springframework.jdbc.object Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jdbc.object

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jdbc.object.MappingSqlQueryWithParameters.RowMapperImpl (implements org.springframework.jdbc.core.RowMapper<T>)
    • org.springframework.jdbc.object.RdbmsOperation (implements org.springframework.beans.factory.InitializingBean)
      • org.springframework.jdbc.object.SqlCall
        • org.springframework.jdbc.object.StoredProcedure
          • org.springframework.jdbc.object.GenericStoredProcedure
      • org.springframework.jdbc.object.SqlOperation
        • org.springframework.jdbc.object.SqlQuery<T>
          • org.springframework.jdbc.object.GenericSqlQuery
          • org.springframework.jdbc.object.MappingSqlQueryWithParameters<T>
            • org.springframework.jdbc.object.MappingSqlQuery<T>
              • org.springframework.jdbc.object.SqlFunction<T>
          • org.springframework.jdbc.object.UpdatableSqlQuery<T>
        • org.springframework.jdbc.object.SqlUpdate
          • org.springframework.jdbc.object.BatchSqlUpdate
    • org.springframework.jdbc.object.UpdatableSqlQuery.RowMapperImpl (implements org.springframework.jdbc.core.RowMapper<T>)


BatchSqlUpdate

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.object
Class BatchSqlUpdate

java.lang.Object
    extended by  org.springframework.jdbc.object.RdbmsOperation
        extended by  org.springframework.jdbc.object.SqlOperation
            extended by  org.springframework.jdbc.object.SqlUpdate
                extended by  org.springframework.jdbc.object.BatchSqlUpdate
All Implemented Interfaces:
InitializingBean
public class BatchSqlUpdate
extends SqlUpdate

SqlUpdate subclass that performs batch update operations. Encapsulates queuing up records to be updated, and adds them as a single batch once flush is called or the given batch size has been met.

Note that this class is a non-thread-safe object, in contrast to all other JDBC operations objects in this package. You need to create a new instance of it for each use, or call reset before reuse within the same thread.

Since:
1.1
Author:
Keith Donald, Juergen Hoeller
See Also:
flush(), reset()

Field Summary
static int DEFAULT_BATCH_SIZE
Default number of inserts to accumulate before commiting a batch (5000).
Fields inherited from class org.springframework.jdbc.object.RdbmsOperation
logger
Constructor Summary
BatchSqlUpdate()
Constructor to allow use as a JavaBean.
BatchSqlUpdate(DataSource ds, String sql)
Construct an update object with a given DataSource and SQL.
BatchSqlUpdate(DataSource ds, String sql, int[] types)
Construct an update object with a given DataSource, SQL and anonymous parameters.
BatchSqlUpdate(DataSource ds, String sql, int[] types, int batchSize)
Construct an update object with a given DataSource, SQL, anonymous parameters and specifying the maximum number of rows that may be affected.
Method Summary
int[] | flush() Trigger any queued update operations to be added as a final batch.
int | getExecutionCount() Return the number of already executed statements.
int | getQueueCount() Return the current number of statements or statement parameters in the queue.
int[] | getRowsAffected() Return the number of affected rows for all already executed statements.
void | reset() Reset the statement parameter queue, the rows affected cache, and the execution count.
void | setBatchSize(int batchSize) Set the number of statements that will trigger an automatic intermediate flush.
void | setTrackRowsAffected(boolean trackRowsAffected) Set whether to track the rows affected by batch updates performed by this operation object.
protected boolean | supportsLobParameters() BatchSqlUpdate does not support BLOB or CLOB parameters.
int | update(Object... params) Overridden version of update that adds the given statement parameters to the queue rather than executing them immediately.
Methods inherited from class org.springframework.jdbc.object.SqlUpdate
checkRowsAffected, setMaxRowsAffected, setRequiredRowsAffected, update, update, update, update, update, update, update, update, updateByNamedParam, updateByNamedParam
Methods inherited from class org.springframework.jdbc.object.SqlOperation
compileInternal, getParsedSql, newPreparedStatementCreator, newPreparedStatementCreator, newPreparedStatementSetter, onCompileInternal
Methods inherited from class org.springframework.jdbc.object.RdbmsOperation
afterPropertiesSet, allowsUnusedParameters, checkCompiled, compile, declareParameter, getDeclaredParameters, getGeneratedKeysColumnNames, getJdbcTemplate, getResultSetType, getSql, isCompiled, isReturnGeneratedKeys, isUpdatableResults, setDataSource, setFetchSize, setGeneratedKeysColumnNames, setJdbcTemplate, setMaxRows, setParameters, setQueryTimeout, setResultSetType, setReturnGeneratedKeys, setSql, setTypes, setUpdatableResults, validateNamedParameters, validateParameters
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_BATCH_SIZE

public static int DEFAULT_BATCH_SIZE
Default number of inserts to accumulate before commiting a batch (5000).

Constructor Detail

BatchSqlUpdate

public BatchSqlUpdate()
Constructor to allow use as a JavaBean. DataSource and SQL must be supplied before compilation and use.

See Also:
RdbmsOperation.setDataSource(javax.sql.DataSource), RdbmsOperation.setSql(java.lang.String)

BatchSqlUpdate

public BatchSqlUpdate(DataSource ds,
                      String sql)
Construct an update object with a given DataSource and SQL.

Parameters:
ds - DataSource to use to obtain connections
sql - SQL statement to execute

BatchSqlUpdate

public BatchSqlUpdate(DataSource ds,
                      String sql,
                      int[] types)
Construct an update object with a given DataSource, SQL and anonymous parameters.

Parameters:
ds - DataSource to use to obtain connections
sql - SQL statement to execute
types - SQL types of the parameters, as defined in the java.sql.Types class
See Also:
Types

BatchSqlUpdate

public BatchSqlUpdate(DataSource ds,
                      String sql,
                      int[] types,
                      int batchSize)
Construct an update object with a given DataSource, SQL, anonymous parameters and specifying the maximum number of rows that may be affected.

Parameters:
ds - DataSource to use to obtain connections
sql - SQL statement to execute
types - SQL types of the parameters, as defined in the java.sql.Types class
batchSize - the number of statements that will trigger an automatic intermediate flush
See Also:
Types
Method Detail

setBatchSize

public void setBatchSize(int batchSize)
Set the number of statements that will trigger an automatic intermediate flush. update calls or the given statement parameters will be queued until the batch size is met, at which point it will empty the queue and execute the batch.

You can also flush already queued statements with an explicit flush call. Note that you need to this after queueing all parameters to guarantee that all statements have been flushed.

setTrackRowsAffected

public void setTrackRowsAffected(boolean trackRowsAffected)
Set whether to track the rows affected by batch updates performed by this operation object.

Default is "true". Turn this off to save the memory needed for the list of row counts.

See Also:
getRowsAffected()

supportsLobParameters

protected boolean supportsLobParameters()
BatchSqlUpdate does not support BLOB or CLOB parameters.

Overrides:
supportsLobParameters in class RdbmsOperation

update

public int update(Object... params)
           throws DataAccessException
Overridden version of update that adds the given statement parameters to the queue rather than executing them immediately. All other update methods of the SqlUpdate base class go through this method and will thus behave similarly.

You need to call flush to actually execute the batch. If the specified batch size is reached, an implicit flush will happen; you still need to finally call flush to flush all statements.

Overrides:
update in class SqlUpdate
Parameters:
params - array of parameter objects
Returns:
the number of rows affected by the update (always -1, meaning "not applicable", as the statement is not actually executed by this method)
Throws:
DataAccessException
See Also:
flush()

flush

public int[] flush()
Trigger any queued update operations to be added as a final batch.

Returns:
an array of the number of rows affected by each statement

getQueueCount

public int getQueueCount()
Return the current number of statements or statement parameters in the queue.

getExecutionCount

public int getExecutionCount()
Return the number of already executed statements.

getRowsAffected

public int[] getRowsAffected()
Return the number of affected rows for all already executed statements. Accumulates all of flush's return values until reset is invoked.

Returns:
an array of the number of rows affected by each statement
See Also:
reset()

reset

public void reset()
Reset the statement parameter queue, the rows affected cache, and the execution count.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


GenericSqlQuery

org.springframework.jdbc.object
Class GenericSqlQuery

java.lang.Object
    extended by  org.springframework.jdbc.object.RdbmsOperation
        extended by  org.springframework.jdbc.object.SqlOperation
            extended by  org.springframework.jdbc.object.SqlQuery
                extended by  org.springframework.jdbc.object.GenericSqlQuery
All Implemented Interfaces:
InitializingBean
public class GenericSqlQuery
extends SqlQuery

Field Summary
Fields inherited from class org.springframework.jdbc.object.RdbmsOperation
logger
Constructor Summary
GenericSqlQuery()
Method Summary
void | afterPropertiesSet() Ensures compilation if used in a bean factory.
protected RowMapper | newRowMapper(Object[] parameters, Map context) Subclasses must implement this method to extract an object per row, to be returned by the execute method as an aggregated List.
void | setRowMapperClass(Class rowMapperClass)
Methods inherited from class org.springframework.jdbc.object.SqlQuery
execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, executeByNamedParam, executeByNamedParam, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObjectByNamedParam, findObjectByNamedParam, getRowsExpected, setRowsExpected
Methods inherited from class org.springframework.jdbc.object.SqlOperation
compileInternal, getParsedSql, newPreparedStatementCreator, newPreparedStatementCreator, newPreparedStatementSetter, onCompileInternal
Methods inherited from class org.springframework.jdbc.object.RdbmsOperation
allowsUnusedParameters, checkCompiled, compile, declareParameter, getDeclaredParameters, getGeneratedKeysColumnNames, getJdbcTemplate, getResultSetType, getSql, isCompiled, isReturnGeneratedKeys, isUpdatableResults, setDataSource, setFetchSize, setGeneratedKeysColumnNames, setJdbcTemplate, setMaxRows, setParameters, setQueryTimeout, setResultSetType, setReturnGeneratedKeys, setSql, setTypes, setUpdatableResults, supportsLobParameters, validateNamedParameters, validateParameters
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

GenericSqlQuery

public GenericSqlQuery()
Method Detail

setRowMapperClass

public void setRowMapperClass(Class rowMapperClass)
                       throws IllegalAccessException,
                              InstantiationException
Throws:
IllegalAccessException
InstantiationException

afterPropertiesSet

public void afterPropertiesSet()
Description copied from class: RdbmsOperation
Ensures compilation if used in a bean factory.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class RdbmsOperation

newRowMapper

protected RowMapper newRowMapper(Object[] parameters,
                                 Map context)
Description copied from class: SqlQuery
Subclasses must implement this method to extract an object per row, to be returned by the execute method as an aggregated List.

Specified by:
newRowMapper in class SqlQuery
Parameters:
parameters - the parameters to the execute() method, in case subclass is interested; may be null if there were no parameters.
context - contextual information passed to the mapRow callback method. The JDBC operation itself doesn't rely on this parameter, but it can be useful for creating the objects of the result list.
See Also:
SqlQuery.execute(java.lang.Object[], java.util.Map)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


GenericStoredProcedure

org.springframework.jdbc.object
Class GenericStoredProcedure

java.lang.Object
    extended by  org.springframework.jdbc.object.RdbmsOperation
        extended by  org.springframework.jdbc.object.SqlCall
            extended by  org.springframework.jdbc.object.StoredProcedure
                extended by  org.springframework.jdbc.object.GenericStoredProcedure
All Implemented Interfaces:
InitializingBean
public class GenericStoredProcedure
extends StoredProcedure

Concrete implementation making it possible to define the RDBMS stored procedures in an application context without writing a custom Java implementation class.

This implementation does not provide a typed method for invocation so executions must use one of the generic StoredProcedure.execute(java.util.Map) or StoredProcedure.execute(org.springframework.jdbc.core.ParameterMapper) methods.

Author:
Thomas Risberg
See Also:
StoredProcedure

Field Summary
Fields inherited from class org.springframework.jdbc.object.RdbmsOperation
logger
Constructor Summary
GenericStoredProcedure()
Method Summary
Methods inherited from class org.springframework.jdbc.object.StoredProcedure
allowsUnusedParameters, declareParameter, execute, execute, execute
Methods inherited from class org.springframework.jdbc.object.SqlCall
compileInternal, getCallString, isFunction, isSqlReadyForUse, newCallableStatementCreator, newCallableStatementCreator, onCompileInternal, setFunction, setSqlReadyForUse
Methods inherited from class org.springframework.jdbc.object.RdbmsOperation
afterPropertiesSet, checkCompiled, compile, getDeclaredParameters, getGeneratedKeysColumnNames, getJdbcTemplate, getResultSetType, getSql, isCompiled, isReturnGeneratedKeys, isUpdatableResults, setDataSource, setFetchSize, setGeneratedKeysColumnNames, setJdbcTemplate, setMaxRows, setParameters, setQueryTimeout, setResultSetType, setReturnGeneratedKeys, setSql, setTypes, setUpdatableResults, supportsLobParameters, validateNamedParameters, validateParameters
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

GenericStoredProcedure

public GenericStoredProcedure()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MappingSqlQuery

org.springframework.jdbc.object
Class MappingSqlQuery<T>

java.lang.Object
    extended by  org.springframework.jdbc.object.RdbmsOperation
        extended by  org.springframework.jdbc.object.SqlOperation
            extended by  org.springframework.jdbc.object.SqlQuery<T>
                extended by  org.springframework.jdbc.object.MappingSqlQueryWithParameters<T>
                    extended by  org.springframework.jdbc.object.MappingSqlQuery<T>
All Implemented Interfaces:
InitializingBean
Direct Known Subclasses:
SqlFunction
public abstract class MappingSqlQuery<T>
extends MappingSqlQueryWithParameters<T>

Reusable query in which concrete subclasses must implement the abstract mapRow(ResultSet, int) method to convert each row of the JDBC ResultSet into an object.

Simplifies MappingSqlQueryWithParameters API by dropping parameters and context. Most subclasses won't care about parameters. If you don't use contextual information, subclass this instead of MappingSqlQueryWithParameters.

Author:
Rod Johnson, Thomas Risberg, Jean-Pierre Pawlak
See Also:
MappingSqlQueryWithParameters

Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.jdbc.object.MappingSqlQueryWithParameters
MappingSqlQueryWithParameters.RowMapperImpl
Field Summary
Fields inherited from class org.springframework.jdbc.object.RdbmsOperation
logger
Constructor Summary
MappingSqlQuery()
Constructor that allows use as a JavaBean.
MappingSqlQuery(DataSource ds, String sql)
Convenient constructor with DataSource and SQL string.
Method Summary
protected abstract T | mapRow(ResultSet rs, int rowNum) Subclasses must implement this method to convert each row of the ResultSet into an object of the result type.
protected T | mapRow(ResultSet rs, int rowNum, Object[] parameters, Map context) This method is implemented to invoke the simpler mapRow template method, ignoring parameters.
Methods inherited from class org.springframework.jdbc.object.MappingSqlQueryWithParameters
newRowMapper
Methods inherited from class org.springframework.jdbc.object.SqlQuery
execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, executeByNamedParam, executeByNamedParam, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObjectByNamedParam, findObjectByNamedParam, getRowsExpected, setRowsExpected
Methods inherited from class org.springframework.jdbc.object.SqlOperation
compileInternal, getParsedSql, newPreparedStatementCreator, newPreparedStatementCreator, newPreparedStatementSetter, onCompileInternal
Methods inherited from class org.springframework.jdbc.object.RdbmsOperation
afterPropertiesSet, allowsUnusedParameters, checkCompiled, compile, declareParameter, getDeclaredParameters, getGeneratedKeysColumnNames, getJdbcTemplate, getResultSetType, getSql, isCompiled, isReturnGeneratedKeys, isUpdatableResults, setDataSource, setFetchSize, setGeneratedKeysColumnNames, setJdbcTemplate, setMaxRows, setParameters, setQueryTimeout, setResultSetType, setReturnGeneratedKeys, setSql, setTypes, setUpdatableResults, supportsLobParameters, validateNamedParameters, validateParameters
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MappingSqlQuery

public MappingSqlQuery()
Constructor that allows use as a JavaBean.

MappingSqlQuery

public MappingSqlQuery(DataSource ds,
                       String sql)
Convenient constructor with DataSource and SQL string.

Parameters:
ds - DataSource to use to obtain connections
sql - SQL to run
Method Detail

mapRow

protected final T mapRow(ResultSet rs,
                         int rowNum,
                         Object[] parameters,
                         Map context)
                  throws SQLException
This method is implemented to invoke the simpler mapRow template method, ignoring parameters.

Specified by:
mapRow in class MappingSqlQueryWithParameters<T>
Parameters:
rs - ResultSet we're working through
rowNum - row number (from 0) we're up to
parameters - to the query (passed to the execute() method). Subclasses are rarely interested in these. It can be null if there are no parameters.
context - passed to the execute() method. It can be null if no contextual information is need.
Returns:
an object of the result type
Throws:
SQLException - if there's an error extracting data. Subclasses can simply not catch SQLExceptions, relying on the framework to clean up.
See Also:
mapRow(ResultSet, int)

mapRow

protected abstract T mapRow(ResultSet rs,
                            int rowNum)
                     throws SQLException
Subclasses must implement this method to convert each row of the ResultSet into an object of the result type.

Subclasses of this class, as opposed to direct subclasses of MappingSqlQueryWithParameters, don't need to concern themselves with the parameters to the execute method of the query object.

Parameters:
rs - ResultSet we're working through
rowNum - row number (from 0) we're up to
Returns:
an object of the result type
Throws:
SQLException - if there's an error extracting data. Subclasses can simply not catch SQLExceptions, relying on the framework to clean up.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MappingSqlQueryWithParameters

org.springframework.jdbc.object
Class MappingSqlQueryWithParameters<T>

java.lang.Object
    extended by  org.springframework.jdbc.object.RdbmsOperation
        extended by  org.springframework.jdbc.object.SqlOperation
            extended by  org.springframework.jdbc.object.SqlQuery<T>
                extended by  org.springframework.jdbc.object.MappingSqlQueryWithParameters<T>
All Implemented Interfaces:
InitializingBean
Direct Known Subclasses:
MappingSqlQuery
public abstract class MappingSqlQueryWithParameters<T>
extends SqlQuery<T>

Reusable RDBMS query in which concrete subclasses must implement the abstract mapRow(ResultSet, int) method to map each row of the JDBC ResultSet into an object.

Such manual mapping is usually preferable to "automatic" mapping using reflection, which can become complex in non-trivial cases. For example, the present class allows different objects to be used for different rows (for example, if a subclass is indicated). It allows computed fields to be set. And there's no need for ResultSet columns to have the same names as bean properties. The Pareto Principle in action: going the extra mile to automate the extraction process makes the framework much more complex and delivers little real benefit.

Subclasses can be constructed providing SQL, parameter types and a DataSource. SQL will often vary between subclasses.

Author:
Rod Johnson, Thomas Risberg, Jean-Pierre Pawlak
See Also:
MappingSqlQuery, SqlQuery

Nested Class Summary
protected  class MappingSqlQueryWithParameters.RowMapperImpl
Implementation of RowMapper that calls the enclosing class's mapRow method for each row.
Field Summary
Fields inherited from class org.springframework.jdbc.object.RdbmsOperation
logger
Constructor Summary
MappingSqlQueryWithParameters()
Constructor to allow use as a JavaBean
MappingSqlQueryWithParameters(DataSource ds, String sql)
Convenient constructor with DataSource and SQL string.
Method Summary
protected abstract T | mapRow(ResultSet rs, int rowNum, Object[] parameters, Map context) Subclasses must implement this method to convert each row of the ResultSet into an object of the result type.
protected RowMapper<T> | newRowMapper(Object[] parameters, Map context) Implementation of protected abstract method.
Methods inherited from class org.springframework.jdbc.object.SqlQuery
execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, executeByNamedParam, executeByNamedParam, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObjectByNamedParam, findObjectByNamedParam, getRowsExpected, setRowsExpected
Methods inherited from class org.springframework.jdbc.object.SqlOperation
compileInternal, getParsedSql, newPreparedStatementCreator, newPreparedStatementCreator, newPreparedStatementSetter, onCompileInternal
Methods inherited from class org.springframework.jdbc.object.RdbmsOperation
afterPropertiesSet, allowsUnusedParameters, checkCompiled, compile, declareParameter, getDeclaredParameters, getGeneratedKeysColumnNames, getJdbcTemplate, getResultSetType, getSql, isCompiled, isReturnGeneratedKeys, isUpdatableResults, setDataSource, setFetchSize, setGeneratedKeysColumnNames, setJdbcTemplate, setMaxRows, setParameters, setQueryTimeout, setResultSetType, setReturnGeneratedKeys, setSql, setTypes, setUpdatableResults, supportsLobParameters, validateNamedParameters, validateParameters
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MappingSqlQueryWithParameters

public MappingSqlQueryWithParameters()
Constructor to allow use as a JavaBean

MappingSqlQueryWithParameters

public MappingSqlQueryWithParameters(DataSource ds,
                                     String sql)
Convenient constructor with DataSource and SQL string.

Parameters:
ds - DataSource to use to get connections
sql - SQL to run
Method Detail

newRowMapper

protected RowMapper<T> newRowMapper(Object[] parameters,
                                    Map context)
Implementation of protected abstract method. This invokes the subclass's implementation of the mapRow() method.

Specified by:
newRowMapper in class SqlQuery<T>
Parameters:
parameters - the parameters to the execute() method, in case subclass is interested; may be null if there were no parameters.
context - contextual information passed to the mapRow callback method. The JDBC operation itself doesn't rely on this parameter, but it can be useful for creating the objects of the result list.
See Also:
SqlQuery.execute(java.lang.Object[], java.util.Map)

mapRow

protected abstract T mapRow(ResultSet rs,
                            int rowNum,
                            Object[] parameters,
                            Map context)
                     throws SQLException
Subclasses must implement this method to convert each row of the ResultSet into an object of the result type.

Parameters:
rs - ResultSet we're working through
rowNum - row number (from 0) we're up to
parameters - to the query (passed to the execute() method). Subclasses are rarely interested in these. It can be null if there are no parameters.
context - passed to the execute() method. It can be null if no contextual information is need.
Returns:
an object of the result type
Throws:
SQLException - if there's an error extracting data. Subclasses can simply not catch SQLExceptions, relying on the framework to clean up.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MappingSqlQueryWithParameters.RowMapperImpl

org.springframework.jdbc.object
Class MappingSqlQueryWithParameters.RowMapperImpl

java.lang.Object
    extended by  org.springframework.jdbc.object.MappingSqlQueryWithParameters.RowMapperImpl
All Implemented Interfaces:
RowMapper<T>
Enclosing class:
MappingSqlQueryWithParameters<T>
protected class MappingSqlQueryWithParameters.RowMapperImpl
extends Object
implements RowMapper<T>

Implementation of RowMapper that calls the enclosing class's mapRow method for each row.

Constructor Summary
MappingSqlQueryWithParameters.RowMapperImpl(Object[] parameters, Map context)
Use an array results.
Method Summary
 T mapRow(ResultSet rs, int rowNum)
Implementations must implement this method to map each row of data in the ResultSet.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MappingSqlQueryWithParameters.RowMapperImpl

public MappingSqlQueryWithParameters.RowMapperImpl(Object[] parameters,
                                                   Map context)
Use an array results. More efficient if we know how many results to expect.

Method Detail

mapRow

public T mapRow(ResultSet rs,
                int rowNum)
         throws SQLException
Description copied from interface: RowMapper
Implementations must implement this method to map each row of data in the ResultSet. This method should not call next() on the ResultSet; it is only supposed to map values of the current row.

Specified by:
mapRow in interface RowMapper<T>
Parameters:
rs - the ResultSet to map (pre-initialized for the current row)
rowNum - the number of the current row
Returns:
the result object for the current row
Throws:
SQLException - if a SQLException is encountered getting column values (that is, there's no need to catch SQLException)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RdbmsOperation

org.springframework.jdbc.object
Class RdbmsOperation

java.lang.Object
    extended by  org.springframework.jdbc.object.RdbmsOperation
All Implemented Interfaces:
InitializingBean
Direct Known Subclasses:
SqlCall, SqlOperation
public abstract class RdbmsOperation
extends Object
implements InitializingBean

An "RDBMS operation" is a multi-threaded, reusable object representing a query, update, or stored procedure call. An RDBMS operation is not a command, as a command is not reusable. However, execute methods may take commands as arguments. Subclasses should be JavaBeans, allowing easy configuration.

This class and subclasses throw runtime exceptions, defined in the (and as thrown by the org.springframework.jdbc.core package, which the classes in this package use under the hood to perform raw JDBC operations).

Subclasses should set SQL and add parameters before invoking the compile() method. The order in which parameters are added is significant. The appropriate execute or update method can then be invoked.

Author:
Rod Johnson, Juergen Hoeller
See Also:
SqlQuery, SqlUpdate, StoredProcedure, JdbcTemplate

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
RdbmsOperation()
Method Summary
 void afterPropertiesSet()
Ensures compilation if used in a bean factory.
protected  boolean allowsUnusedParameters()
Return whether this operation accepts additional parameters that are given but not actually used.
protected  void checkCompiled()
Check whether this operation has been compiled already; lazily compile it if not already compiled.
 void compile()
Compile this query.
protected abstract  void compileInternal()
Subclasses must implement this template method to perform their own compilation.
 void declareParameter(SqlParameter param)
Declare a parameter for this operation.
protected  List<SqlParameter> getDeclaredParameters()
Return a list of the declared SqlParameter objects.
 String[] getGeneratedKeysColumnNames()
Return the column names of the auto generated keys.
 JdbcTemplate getJdbcTemplate()
Return the JdbcTemplate object used by this object.
 int getResultSetType()
Return whether statements will return a specific type of ResultSet.
 String getSql()
Subclasses can override this to supply dynamic SQL if they wish, but SQL is normally set by calling the setSql() method or in a subclass constructor.
 boolean isCompiled()
Is this operation "compiled"? Compilation, as in JDO, means that the operation is fully configured, and ready to use.
 boolean isReturnGeneratedKeys()
Return whether statements should be capable of returning auto-generated keys.
 boolean isUpdatableResults()
Return whether statements will return updatable ResultSets.
 void setDataSource(DataSource dataSource)
Set the JDBC DataSource to obtain connections from.
 void setFetchSize(int fetchSize)
Set the fetch size for this RDBMS operation.
 void setGeneratedKeysColumnNames(String[] names)
Set the column names of the auto-generated keys.
 void setJdbcTemplate(JdbcTemplate jdbcTemplate)
An alternative to the more commonly used setDataSource() when you want to use the same JdbcTemplate in multiple RdbmsOperations.
 void setMaxRows(int maxRows)
Set the maximum number of rows for this RDBMS operation.
 void setParameters(SqlParameter[] parameters)
Add one or more declared parameters.
 void setQueryTimeout(int queryTimeout)
Set the query timeout for statements that this RDBMS operation executes.
 void setResultSetType(int resultSetType)
Set whether to use statements that return a specific type of ResultSet.
 void setReturnGeneratedKeys(boolean returnGeneratedKeys)
Set whether prepared statements should be capable of returning auto-generated keys.
 void setSql(String sql)
Set the SQL executed by this operation.
 void setTypes(int[] types)
Add anonymous parameters, specifying only their SQL types as defined in the java.sql.Types class.
 void setUpdatableResults(boolean updatableResults)
Set whether to use statements that are capable of returning updatable ResultSets.
protected  boolean supportsLobParameters()
Return whether BLOB/CLOB parameters are supported for this kind of operation.
protected  void validateNamedParameters(Map<String,?> parameters)
Validate the named parameters passed to an execute method based on declared parameters.
protected  void validateParameters(Object[] parameters)
Validate the parameters passed to an execute method based on declared parameters.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

RdbmsOperation

public RdbmsOperation()
Method Detail

setJdbcTemplate

public void setJdbcTemplate(JdbcTemplate jdbcTemplate)
An alternative to the more commonly used setDataSource() when you want to use the same JdbcTemplate in multiple RdbmsOperations. This is appropriate if the JdbcTemplate has special configuration such as a SQLExceptionTranslator that should apply to multiple RdbmsOperation objects.

getJdbcTemplate

public JdbcTemplate getJdbcTemplate()
Return the JdbcTemplate object used by this object.

setDataSource

public void setDataSource(DataSource dataSource)
Set the JDBC DataSource to obtain connections from.

See Also:
JdbcAccessor.setDataSource(javax.sql.DataSource)

setFetchSize

public void setFetchSize(int fetchSize)
Set the fetch size for this RDBMS operation. This is important for processing large result sets: Setting this higher than the default value will increase processing speed at the cost of memory consumption; setting this lower can avoid transferring row data that will never be read by the application.

Default is 0, indicating to use the driver's default.

See Also:
JdbcTemplate.setFetchSize(int)

setMaxRows

public void setMaxRows(int maxRows)
Set the maximum number of rows for this RDBMS operation. This is important for processing subsets of large result sets, avoiding to read and hold the entire result set in the database or in the JDBC driver.

Default is 0, indicating to use the driver's default.

See Also:
JdbcTemplate.setMaxRows(int)

setQueryTimeout

public void setQueryTimeout(int queryTimeout)
Set the query timeout for statements that this RDBMS operation executes.

Default is 0, indicating to use the JDBC driver's default.

Note: Any timeout specified here will be overridden by the remaining transaction timeout when executing within a transaction that has a timeout specified at the transaction level.

setResultSetType

public void setResultSetType(int resultSetType)
Set whether to use statements that return a specific type of ResultSet.

Parameters:
resultSetType - the ResultSet type
See Also:
ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.TYPE_SCROLL_SENSITIVE, Connection.prepareStatement(String, int, int)

getResultSetType

public int getResultSetType()
Return whether statements will return a specific type of ResultSet.

setUpdatableResults

public void setUpdatableResults(boolean updatableResults)
Set whether to use statements that are capable of returning updatable ResultSets.

See Also:
Connection.prepareStatement(String, int, int)

isUpdatableResults

public boolean isUpdatableResults()
Return whether statements will return updatable ResultSets.

setReturnGeneratedKeys

public void setReturnGeneratedKeys(boolean returnGeneratedKeys)
Set whether prepared statements should be capable of returning auto-generated keys.

See Also:
Connection.prepareStatement(String, int)

isReturnGeneratedKeys

public boolean isReturnGeneratedKeys()
Return whether statements should be capable of returning auto-generated keys.

setGeneratedKeysColumnNames

public void setGeneratedKeysColumnNames(String[] names)
Set the column names of the auto-generated keys.

See Also:
Connection.prepareStatement(String, String[])

getGeneratedKeysColumnNames

public String[] getGeneratedKeysColumnNames()
Return the column names of the auto generated keys.

setSql

public void setSql(String sql)
Set the SQL executed by this operation.

getSql

public String getSql()
Subclasses can override this to supply dynamic SQL if they wish, but SQL is normally set by calling the setSql() method or in a subclass constructor.

setTypes

public void setTypes(int[] types)
              throws InvalidDataAccessApiUsageException
Add anonymous parameters, specifying only their SQL types as defined in the java.sql.Types class.

Parameter ordering is significant. This method is an alternative to the declareParameter(org.springframework.jdbc.core.SqlParameter) method, which should normally be preferred.

Parameters:
types - array of SQL types as defined in the java.sql.Types class
Throws:
InvalidDataAccessApiUsageException - if the operation is already compiled

declareParameter

public void declareParameter(SqlParameter param)
                      throws InvalidDataAccessApiUsageException
Declare a parameter for this operation.

The order in which this method is called is significant when using positional parameters. It is not significant when using named parameters with named SqlParameter objects here; it remains significant when using named parameters in combination with unnamed SqlParameter objects here.

Parameters:
param - the SqlParameter to add. This will specify SQL type and (optionally) the parameter's name. Note that you typically use the SqlParameter class itself here, not any of its subclasses.
Throws:
InvalidDataAccessApiUsageException - if the operation is already compiled, and hence cannot be configured further

setParameters

public void setParameters(SqlParameter[] parameters)
Add one or more declared parameters. Used for configuring this operation when used in a bean factory. Each parameter will specify SQL type and (optionally) the parameter's name.

Parameters:
parameters - Array containing the declared SqlParameter objects
See Also:
declaredParameters

getDeclaredParameters

protected List<SqlParameter> getDeclaredParameters()
Return a list of the declared SqlParameter objects.

afterPropertiesSet

public void afterPropertiesSet()
Ensures compilation if used in a bean factory.

Specified by:
afterPropertiesSet in interface InitializingBean

compile

public final void compile()
                   throws InvalidDataAccessApiUsageException
Compile this query. Ignores subsequent attempts to compile.

Throws:
InvalidDataAccessApiUsageException - if the object hasn't been correctly initialized, for example if no DataSource has been provided

isCompiled

public boolean isCompiled()
Is this operation "compiled"? Compilation, as in JDO, means that the operation is fully configured, and ready to use. The exact meaning of compilation will vary between subclasses.

Returns:
whether this operation is compiled, and ready to use.

checkCompiled

protected void checkCompiled()
Check whether this operation has been compiled already; lazily compile it if not already compiled.

Automatically called by validateParameters.

See Also:
validateParameters(java.lang.Object[])

validateParameters

protected void validateParameters(Object[] parameters)
                           throws InvalidDataAccessApiUsageException
Validate the parameters passed to an execute method based on declared parameters. Subclasses should invoke this method before every executeQuery() or update() method.

Parameters:
parameters - parameters supplied (may be null)
Throws:
InvalidDataAccessApiUsageException - if the parameters are invalid

validateNamedParameters

protected void validateNamedParameters(Map<String,?> parameters)
                                throws InvalidDataAccessApiUsageException
Validate the named parameters passed to an execute method based on declared parameters. Subclasses should invoke this method before every executeQuery() or update() method.

Parameters:
parameters - parameter Map supplied. May be null.
Throws:
InvalidDataAccessApiUsageException - if the parameters are invalid

compileInternal

protected abstract void compileInternal()
                                 throws InvalidDataAccessApiUsageException
Subclasses must implement this template method to perform their own compilation. Invoked after this base class's compilation is complete.

Subclasses can assume that SQL and a DataSource have been supplied.

Throws:
InvalidDataAccessApiUsageException - if the subclass hasn't been properly configured

supportsLobParameters

protected boolean supportsLobParameters()
Return whether BLOB/CLOB parameters are supported for this kind of operation.

The default is true.

allowsUnusedParameters

protected boolean allowsUnusedParameters()
Return whether this operation accepts additional parameters that are given but not actually used. Applies in particular to parameter Maps.

The default is false.

See Also:
StoredProcedure
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SqlCall

org.springframework.jdbc.object
Class SqlCall

java.lang.Object
    extended by  org.springframework.jdbc.object.RdbmsOperation
        extended by  org.springframework.jdbc.object.SqlCall
All Implemented Interfaces:
InitializingBean
Direct Known Subclasses:
StoredProcedure
public abstract class SqlCall
extends RdbmsOperation

RdbmsOperation using a JdbcTemplate and representing a SQL-based call such as a stored procedure or a stored function.

Configures a CallableStatementCreatorFactory based on the declared parameters.

Author:
Rod Johnson, Thomas Risberg
See Also:
CallableStatementCreatorFactory

Field Summary
Fields inherited from class org.springframework.jdbc.object.RdbmsOperation
logger
Constructor Summary
SqlCall()
Constructor to allow use as a JavaBean.
SqlCall(DataSource ds, String sql)
Create a new SqlCall object with SQL, but without parameters.
Method Summary
protected void | compileInternal() Overridden method to configure the CallableStatementCreatorFactory based on our declared parameters.
String | getCallString() Get the call string.
boolean | isFunction() Return whether this call is for a function.
boolean | isSqlReadyForUse() Return whether the SQL can be used as is.
protected CallableStatementCreator | newCallableStatementCreator(Map<String,?> inParams) Return a CallableStatementCreator to perform an operation with this parameters.
protected CallableStatementCreator | newCallableStatementCreator(ParameterMapper inParamMapper) Return a CallableStatementCreator to perform an operation with the parameters returned from this ParameterMapper.
protected void | onCompileInternal() Hook method that subclasses may override to react to compilation.
void | setFunction(boolean function) Set whether this call is for a function.
void | setSqlReadyForUse(boolean sqlReadyForUse) Set whether the SQL can be used as is.
Methods inherited from class org.springframework.jdbc.object.RdbmsOperation
afterPropertiesSet, allowsUnusedParameters, checkCompiled, compile, declareParameter, getDeclaredParameters, getGeneratedKeysColumnNames, getJdbcTemplate, getResultSetType, getSql, isCompiled, isReturnGeneratedKeys, isUpdatableResults, setDataSource, setFetchSize, setGeneratedKeysColumnNames, setJdbcTemplate, setMaxRows, setParameters, setQueryTimeout, setResultSetType, setReturnGeneratedKeys, setSql, setTypes, setUpdatableResults, supportsLobParameters, validateNamedParameters, validateParameters
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SqlCall

public SqlCall()
Constructor to allow use as a JavaBean. A DataSource, SQL and any parameters must be supplied before invoking the compile method and using this object.

See Also:
RdbmsOperation.setDataSource(javax.sql.DataSource),
RdbmsOperation.setSql(java.lang.String),
RdbmsOperation.compile()

SqlCall

public SqlCall(DataSource ds,
               String sql)
Create a new SqlCall object with SQL, but without parameters. Must add parameters or settle with none.

Parameters:
ds - DataSource to obtain connections from
sql - SQL to execute
Method Detail

setFunction

public void setFunction(boolean function)
Set whether this call is for a function.

isFunction

public boolean isFunction()
Return whether this call is for a function.

setSqlReadyForUse

public void setSqlReadyForUse(boolean sqlReadyForUse)
Set whether the SQL can be used as is.

isSqlReadyForUse

public boolean isSqlReadyForUse()
Return whether the SQL can be used as is.

compileInternal

protected final void compileInternal()
Overridden method to configure the CallableStatementCreatorFactory based on our declared parameters.

Specified by:
compileInternal in class RdbmsOperation
See Also:
RdbmsOperation.compileInternal()

onCompileInternal

protected void onCompileInternal()
Hook method that subclasses may override to react to compilation. This implementation does nothing.

getCallString

public String getCallString()
Get the call string.

newCallableStatementCreator

protected CallableStatementCreator newCallableStatementCreator(Map<String,?> inParams)
Return a CallableStatementCreator to perform an operation with this parameters.

Parameters:
inParams - parameters. May be null.

newCallableStatementCreator

protected CallableStatementCreator newCallableStatementCreator(ParameterMapper inParamMapper)
Return a CallableStatementCreator to perform an operation with the parameters returned from this ParameterMapper.

Parameters:
inParamMapper - parametermapper. May not be null.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SqlFunction

org.springframework.jdbc.object
Class SqlFunction<T>

java.lang.Object
    extended by  org.springframework.jdbc.object.RdbmsOperation
        extended by  org.springframework.jdbc.object.SqlOperation
            extended by  org.springframework.jdbc.object.SqlQuery<T>
                extended by  org.springframework.jdbc.object.MappingSqlQueryWithParameters<T>
                    extended by  org.springframework.jdbc.object.MappingSqlQuery<T>
                        extended by  org.springframework.jdbc.object.SqlFunction<T>
All Implemented Interfaces:
InitializingBean
public class SqlFunction<T>
extends MappingSqlQuery<T>

SQL "function" wrapper for a query that returns a single row of results. The default behavior is to return an int, but that can be overridden by using the constructor with an extra return type parameter.

Intended to use to call SQL functions that return a single result using a query like "select user()" or "select sysdate from dual". It is not intended for calling more complex stored functions or for using a CallableStatement to invoke a stored procedure or stored function. Use StoredProcedure or SqlCall for this type of processing.

This is a concrete class, which there is often no need to subclass. Code using this package can create an object of this type, declaring SQL and parameters, and then invoke the appropriate run method repeatedly to execute the function. Subclasses are only supposed to add specialized run methods for specific parameter and return types.

Like all RdbmsOperation objects, SqlFunction objects are thread-safe.

Author:
Rod Johnson, Juergen Hoeller, Jean-Pierre Pawlak
See Also:
StoredProcedure

Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.jdbc.object.MappingSqlQueryWithParameters
MappingSqlQueryWithParameters.RowMapperImpl
Field Summary
Fields inherited from class org.springframework.jdbc.object.RdbmsOperation
logger
Constructor Summary
SqlFunction()
Constructor to allow use as a JavaBean.
SqlFunction(DataSource ds, String sql)
Create a new SqlFunction object with SQL, but without parameters.
SqlFunction(DataSource ds, String sql, int[] types)
Create a new SqlFunction object with SQL and parameters.
SqlFunction(DataSource ds, String sql, int[] types, Class<T> resultType)
Create a new SqlFunction object with SQL, parameters and a result type.
Method Summary
protected  T mapRow(ResultSet rs, int rowNum)
This implementation of this method extracts a single value from the single row returned by the function.
 int run()
Convenient method to run the function without arguments.
 int run(int parameter)
Convenient method to run the function with a single int argument.
 int run(Object... parameters)
Analogous to the SqlQuery.execute([]) method.
 Object runGeneric()
Convenient method to run the function without arguments, returning the value as an object.
 Object runGeneric(int parameter)
Convenient method to run the function with a single int argument.
 Object runGeneric(Object[] parameters)
Analogous to the SqlQuery.findObject(Object[]) method.
 void setResultType(Class<T> resultType)
Specify the type that the result object is required to match.
Methods inherited from class org.springframework.jdbc.object.MappingSqlQuery
mapRow
Methods inherited from class org.springframework.jdbc.object.MappingSqlQueryWithParameters
newRowMapper
Methods inherited from class org.springframework.jdbc.object.SqlQuery
execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, executeByNamedParam, executeByNamedParam, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObjectByNamedParam, findObjectByNamedParam, getRowsExpected, setRowsExpected
Methods inherited from class org.springframework.jdbc.object.SqlOperation
compileInternal, getParsedSql, newPreparedStatementCreator, newPreparedStatementCreator, newPreparedStatementSetter, onCompileInternal
Methods inherited from class org.springframework.jdbc.object.RdbmsOperation
afterPropertiesSet, allowsUnusedParameters, checkCompiled, compile, declareParameter, getDeclaredParameters, getGeneratedKeysColumnNames, getJdbcTemplate, getResultSetType, getSql, isCompiled, isReturnGeneratedKeys, isUpdatableResults, setDataSource, setFetchSize, setGeneratedKeysColumnNames, setJdbcTemplate, setMaxRows, setParameters, setQueryTimeout, setResultSetType, setReturnGeneratedKeys, setSql, setTypes, setUpdatableResults, supportsLobParameters, validateNamedParameters, validateParameters
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SqlFunction

public SqlFunction()
Constructor to allow use as a JavaBean. A DataSource, SQL and any parameters must be supplied before invoking the compile method and using this object.

See Also:
RdbmsOperation.setDataSource(javax.sql.DataSource),
RdbmsOperation.setSql(java.lang.String),
RdbmsOperation.compile()

SqlFunction

public SqlFunction(DataSource ds,
                   String sql)
Create a new SqlFunction object with SQL, but without parameters. Must add parameters or settle with none.

Parameters:
ds - DataSource to obtain connections from
sql - SQL to execute

SqlFunction

public SqlFunction(DataSource ds,
                   String sql,
                   int[] types)
Create a new SqlFunction object with SQL and parameters.

Parameters:
ds - DataSource to obtain connections from
sql - SQL to execute
types - SQL types of the parameters, as defined in the java.sql.Types class
See Also:
Types

SqlFunction

public SqlFunction(DataSource ds,
                   String sql,
                   int[] types,
                   Class<T> resultType)
Create a new SqlFunction object with SQL, parameters and a result type.

Parameters:
ds - DataSource to obtain connections from
sql - SQL to execute
types - SQL types of the parameters, as defined in the java.sql.Types class
resultType - the type that the result object is required to match
See Also:
setResultType(Class), Types
Method Detail

setResultType

public void setResultType(Class<T> resultType)
Specify the type that the result object is required to match.

If not specified, the result value will be exposed as returned by the JDBC driver.

mapRow

protected T mapRow(ResultSet rs,
                   int rowNum)
            throws SQLException
This implementation of this method extracts a single value from the single row returned by the function. If there are a different number of rows returned, this is treated as an error.

Specified by:
mapRow in class MappingSqlQuery<T>
Parameters:
rs - ResultSet we're working through
rowNum - row number (from 0) we're up to
Returns:
an object of the result type
Throws:
SQLException - if there's an error extracting data. Subclasses can simply not catch SQLExceptions, relying on the framework to clean up.

run

public int run()
Convenient method to run the function without arguments.

Returns:
the value of the function

run

public int run(int parameter)
Convenient method to run the function with a single int argument.

Parameters:
parameter - single int parameter
Returns:
the value of the function

run

public int run(Object... parameters)
Analogous to the SqlQuery.execute([]) method. This is a generic method to execute a query, taken a number of arguments.

Parameters:
parameters - array of parameters. These will be objects or object wrapper types for primitives.
Returns:
the value of the function

runGeneric

public Object runGeneric()
Convenient method to run the function without arguments, returning the value as an object.

Returns:
the value of the function

runGeneric

public Object runGeneric(int parameter)
Convenient method to run the function with a single int argument.

Parameters:
parameter - single int parameter
Returns:
the value of the function as an Object

runGeneric

public Object runGeneric(Object[] parameters)
Analogous to the SqlQuery.findObject(Object[]) method. This is a generic method to execute a query, taken a number of arguments.

Parameters:
parameters - array of parameters. These will be objects or object wrapper types for primitives.
Returns:
the value of the function, as an Object
See Also:
SqlQuery.execute(Object[])
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SqlOperation

org.springframework.jdbc.object
Class SqlOperation

java.lang.Object
    extended by  org.springframework.jdbc.object.RdbmsOperation
        extended by  org.springframework.jdbc.object.SqlOperation
All Implemented Interfaces:
InitializingBean
Direct Known Subclasses:
SqlQuery, SqlUpdate
public abstract class SqlOperation
extends RdbmsOperation

Operation object representing a SQL-based operation such as a query or update, as opposed to a stored procedure.

Configures a PreparedStatementCreatorFactory based on the declared parameters.

Author:
Rod Johnson, Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.jdbc.object.RdbmsOperation
logger
Constructor Summary
SqlOperation()
Method Summary
protected void | compileInternal() Overridden method to configure the PreparedStatementCreatorFactory based on our declared parameters.
protected ParsedSql | getParsedSql() Obtain a parsed representation of this operation's SQL statement.
protected PreparedStatementCreator | newPreparedStatementCreator(Object[] params) Return a PreparedStatementCreator to perform an operation with the given parameters.
protected PreparedStatementCreator | newPreparedStatementCreator(String sqlToUse, Object[] params) Return a PreparedStatementCreator to perform an operation with the given parameters.
protected PreparedStatementSetter | newPreparedStatementSetter(Object[] params) Return a PreparedStatementSetter to perform an operation with the given parameters.
protected void | onCompileInternal() Hook method that subclasses may override to post-process compilation.
Methods inherited from class org.springframework.jdbc.object.RdbmsOperation
afterPropertiesSet, allowsUnusedParameters, checkCompiled, compile, declareParameter, getDeclaredParameters, getGeneratedKeysColumnNames, getJdbcTemplate, getResultSetType, getSql, isCompiled, isReturnGeneratedKeys, isUpdatableResults, setDataSource, setFetchSize, setGeneratedKeysColumnNames, setJdbcTemplate, setMaxRows, setParameters, setQueryTimeout, setResultSetType, setReturnGeneratedKeys, setSql, setTypes, setUpdatableResults, supportsLobParameters, validateNamedParameters, validateParameters
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SqlOperation

public SqlOperation()
Method Detail

compileInternal

protected final void compileInternal()
Overridden method to configure the PreparedStatementCreatorFactory based on our declared parameters.

Specified by:
compileInternal in class RdbmsOperation

onCompileInternal

protected void onCompileInternal()
Hook method that subclasses may override to post-process compilation. This implementation does nothing.

See Also:
compileInternal()

getParsedSql

protected ParsedSql getParsedSql()
Obtain a parsed representation of this operation's SQL statement.

Typically used for named parameter parsing.

newPreparedStatementSetter

protected final PreparedStatementSetter newPreparedStatementSetter(Object[] params)
Return a PreparedStatementSetter to perform an operation with the given parameters.

Parameters:
params - the parameter array (may be null)

newPreparedStatementCreator

protected final PreparedStatementCreator newPreparedStatementCreator(Object[] params)
Return a PreparedStatementCreator to perform an operation with the given parameters.

Parameters:
params - the parameter array (may be null)

newPreparedStatementCreator

protected final PreparedStatementCreator newPreparedStatementCreator(String sqlToUse,
                                                                     Object[] params)
Return a PreparedStatementCreator to perform an operation with the given parameters.

Parameters:
sqlToUse - the actual SQL statement to use (if different from the factory's, for example because of named parameter expanding)
params - the parameter array (may be null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SqlQuery

org.springframework.jdbc.object
Class SqlQuery<T>

java.lang.Object
    extended by  org.springframework.jdbc.object.RdbmsOperation
        extended by  org.springframework.jdbc.object.SqlOperation
            extended by  org.springframework.jdbc.object.SqlQuery<T>
All Implemented Interfaces:
InitializingBean
Direct Known Subclasses:
GenericSqlQuery, MappingSqlQueryWithParameters, UpdatableSqlQuery
public abstract class SqlQuery<T>
extends SqlOperation

Reusable operation object representing a SQL query.

Subclasses must implement the newRowMapper(java.lang.Object[], java.util.Map) method to provide an object that can extract the results of iterating over the ResultSet created during the execution of the query.

This class provides a number of public execute methods that are analogous to the different convenient JDO query execute methods. Subclasses can either rely on one of these inherited methods, or can add their own custom execution methods, with meaningful names and typed parameters (definitely a best practice). Each custom query method will invoke one of this class's untyped query methods.

Like all RdbmsOperation classes that ship with the Spring Framework, SqlQuery instances are thread-safe after their initialization is complete. That is, after they are constructed and configured via their setter methods, they can be used safely from multiple threads.

Author:
Rod Johnson, Juergen Hoeller, Thomas Risberg
See Also:
SqlUpdate

Field Summary
Fields inherited from class org.springframework.jdbc.object.RdbmsOperation
logger
Constructor Summary
SqlQuery()
Constructor to allow use as a JavaBean.
SqlQuery(DataSource ds, String sql)
Convenient constructor with a DataSource and SQL string.
Method Summary
List<T> | execute() Convenient method to execute without parameters nor context.
List<T> | execute(int p1) Convenient method to execute with a single int parameter.
List<T> | execute(int p1, int p2) Convenient method to execute with two int parameters.
List<T> | execute(int p1, int p2, Map context) Convenient method to execute with two int parameters and context.
List<T> | execute(int p1, Map context) Convenient method to execute with a single int parameter and context.
List<T> | execute(long p1) Convenient method to execute with a single long parameter.
List<T> | execute(long p1, Map context) Convenient method to execute with a single long parameter and context.
List<T> | execute(Map context) Convenient method to execute without parameters.
List<T> | execute(Object... params) Convenient method to execute without context.
List<T> | execute(Object[] params, Map context) Central execution method.
List<T> | execute(String p1) Convenient method to execute with a single String parameter.
List<T> | execute(String p1, Map context) Convenient method to execute with a single String parameter and context.
List<T> | executeByNamedParam(Map<String,?> paramMap) Convenient method to execute without context.
List<T> | executeByNamedParam(Map<String,?> paramMap, Map context) Central execution method.
T | findObject(int p1) Convenient method to find a single object given a single int parameter.
T | findObject(int p1, int p2) Convenient method to find a single object given two int parameters.
T | findObject(int p1, int p2, Map context) Convenient method to find a single object given two int parameters and a context.
T | findObject(int p1, Map context) Convenient method to find a single object given a single int parameter and a context.
T | findObject(long p1) Convenient method to find a single object given a single long parameter.
T | findObject(long p1, Map context) Convenient method to find a single object given a single long parameter and a context.
T | findObject(Object... params) Convenient method to find a single object without context.
T | findObject(Object[] params, Map context) Generic object finder method, used by all other findObject methods.
T | findObject(String p1) Convenient method to find a single object given a single String parameter.
T | findObject(String p1, Map context) Convenient method to find a single object given a single String parameter and a context.
T | findObjectByNamedParam(Map<String,?> paramMap) Convenient method to execute without context.
T | findObjectByNamedParam(Map<String,?> paramMap, Map context) Generic object finder method for named parameters.
int | getRowsExpected() Get the number of rows expected.
protected abstract RowMapper<T> | newRowMapper(Object[] parameters, Map context) Subclasses must implement this method to extract an object per row, to be returned by the execute method as an aggregated List.
void | setRowsExpected(int rowsExpected) Set the number of rows expected.
Methods inherited from class org.springframework.jdbc.object.SqlOperation
compileInternal, getParsedSql, newPreparedStatementCreator, newPreparedStatementCreator, newPreparedStatementSetter, onCompileInternal
Methods inherited from class org.springframework.jdbc.object.RdbmsOperation
afterPropertiesSet, allowsUnusedParameters, checkCompiled, compile, declareParameter, getDeclaredParameters, getGeneratedKeysColumnNames, getJdbcTemplate, getResultSetType, getSql, isCompiled, isReturnGeneratedKeys, isUpdatableResults, setDataSource, setFetchSize, setGeneratedKeysColumnNames, setJdbcTemplate, setMaxRows, setParameters, setQueryTimeout, setResultSetType, setReturnGeneratedKeys, setSql, setTypes, setUpdatableResults, supportsLobParameters, validateNamedParameters, validateParameters
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SqlQuery

public SqlQuery()
Constructor to allow use as a JavaBean.

The DataSource and SQL must be supplied before compilation and use.

SqlQuery

public SqlQuery(DataSource ds,
                String sql)
Convenient constructor with a DataSource and SQL string.

Parameters:
ds - the DataSource to use to get connections
sql - the SQL to execute; SQL can also be supplied at runtime by overriding the RdbmsOperation.getSql() method.
Method Detail

setRowsExpected

public void setRowsExpected(int rowsExpected)
Set the number of rows expected.

This can be used to ensure efficient storage of results. The default behavior is not to expect any specific number of rows.

getRowsExpected

public int getRowsExpected()
Get the number of rows expected.

execute

public List<T> execute(Object[] params,
                       Map context)
                throws DataAccessException
Central execution method. All un-named parameter execution goes through this method.

Parameters:
params - parameters, similar to JDO query parameters. Primitive parameters must be represented by their Object wrapper type. The ordering of parameters is significant.
context - contextual information passed to the mapRow callback method. The JDBC operation itself doesn't rely on this parameter, but it can be useful for creating the objects of the result list.
Returns:
a List of objects, one per row of the ResultSet. Normally all these will be of the same class, although it is possible to use different types.
Throws:
DataAccessException

execute

public List<T> execute(Object... params)
                throws DataAccessException
Convenient method to execute without context.

Parameters:
params - parameters for the query. Primitive parameters must be represented by their Object wrapper type. The ordering of parameters is significant.
Throws:
DataAccessException

execute

public List<T> execute(Map context)
                throws DataAccessException
Convenient method to execute without parameters.

Parameters:
context - the contextual information for object creation
Throws:
DataAccessException

execute

public List<T> execute()
                throws DataAccessException
Convenient method to execute without parameters nor context.

Throws:
DataAccessException

execute

public List<T> execute(int p1,
                       Map context)
                throws DataAccessException
Convenient method to execute with a single int parameter and context.

Parameters:
p1 - single int parameter
context - the contextual information for object creation
Throws:
DataAccessException

execute

public List<T> execute(int p1)
                throws DataAccessException
Convenient method to execute with a single int parameter.

Parameters:
p1 - single int parameter
Throws:
DataAccessException

execute

public List<T> execute(int p1,
                       int p2,
                       Map context)
                throws DataAccessException
Convenient method to execute with two int parameters and context.

Parameters:
p1 - first int parameter
p2 - second int parameter
context - the contextual information for object creation
Throws:
DataAccessException

execute

public List<T> execute(int p1,
                       int p2)
                throws DataAccessException
Convenient method to execute with two int parameters.

Parameters:
p1 - first int parameter
p2 - second int parameter
Throws:
DataAccessException

execute

public List<T> execute(long p1,
                       Map context)
                throws DataAccessException
Convenient method to execute with a single long parameter and context.

Parameters:
p1 - single long parameter
context - the contextual information for object creation
Throws:
DataAccessException

execute

public List<T> execute(long p1)
                throws DataAccessException
Convenient method to execute with a single long parameter.

Parameters:
p1 - single long parameter
Throws:
DataAccessException

execute

public List<T> execute(String p1,
                       Map context)
                throws DataAccessException
Convenient method to execute with a single String parameter and context.

Parameters:
p1 - single String parameter
context - the contextual information for object creation
Throws:
DataAccessException

execute

public List<T> execute(String p1)
                throws DataAccessException
Convenient method to execute with a single String parameter.

Parameters:
p1 - single String parameter
Throws:
DataAccessException

executeByNamedParam

public List<T> executeByNamedParam(Map<String,?> paramMap,
                                   Map context)
                            throws DataAccessException
Central execution method. All named parameter execution goes through this method.

Parameters:
paramMap - parameters associated with the name specified while declaring the SqlParameters. Primitive parameters must be represented by their Object wrapper type. The ordering of parameters is not significant since they are supplied in a SqlParameterMap which is an implementation of the Map interface.
context - contextual information passed to the mapRow callback method. The JDBC operation itself doesn't rely on this parameter, but it can be useful for creating the objects of the result list.
Returns:
a List of objects, one per row of the ResultSet. Normally all these will be of the same class, although it is possible to use different types.
Throws:
DataAccessException

executeByNamedParam

public List<T> executeByNamedParam(Map<String,?> paramMap)
                            throws DataAccessException
Convenient method to execute without context.

Parameters:
paramMap - parameters associated with the name specified while declaring the SqlParameters. Primitive parameters must be represented by their Object wrapper type. The ordering of parameters is not significant.
Throws:
DataAccessException

findObject

public T findObject(Object[] params,
                    Map context)
             throws DataAccessException
Generic object finder method, used by all other findObject methods. Object finder methods are like EJB entity bean finders, in that it is considered an error if they return more than one result.

Returns:
the result object, or null if not found. Subclasses may choose to treat this as an error and throw an exception.
Throws:
DataAccessException
See Also:
DataAccessUtils.singleResult(java.util.Collection)

findObject

public T findObject(Object... params)
             throws DataAccessException
Convenient method to find a single object without context.

Throws:
DataAccessException

findObject

public T findObject(int p1,
                    Map context)
             throws DataAccessException
Convenient method to find a single object given a single int parameter and a context.

Throws:
DataAccessException

findObject

public T findObject(int p1)
             throws DataAccessException
Convenient method to find a single object given a single int parameter.

Throws:
DataAccessException

findObject

public T findObject(int p1,
                    int p2,
                    Map context)
             throws DataAccessException
Convenient method to find a single object given two int parameters and a context.

Throws:
DataAccessException

findObject

public T findObject(int p1,
                    int p2)
             throws DataAccessException
Convenient method to find a single object given two int parameters.

Throws:
DataAccessException

findObject

public T findObject(long p1,
                    Map context)
             throws DataAccessException
Convenient method to find a single object given a single long parameter and a context.

Throws:
DataAccessException

findObject

public T findObject(long p1)
             throws DataAccessException
Convenient method to find a single object given a single long parameter.

Throws:
DataAccessException

findObject

public T findObject(String p1,
                    Map context)
             throws DataAccessException
Convenient method to find a single object given a single String parameter and a context.

Throws:
DataAccessException

findObject

public T findObject(String p1)
             throws DataAccessException
Convenient method to find a single object given a single String parameter.

Throws:
DataAccessException

findObjectByNamedParam

public T findObjectByNamedParam(Map<String,?> paramMap,
                                Map context)
                         throws DataAccessException
Generic object finder method for named parameters.

Parameters:
paramMap - Map of parameter name to parameter object, matching named parameters specified in the SQL statement. Ordering is not significant.
context - contextual information passed to the mapRow callback method. The JDBC operation itself doesn't rely on this parameter, but it can be useful for creating the objects of the result list.
Returns:
a List of objects, one per row of the ResultSet. Normally all these will be of the same class, although it is possible to use different types.
Throws:
DataAccessException

findObjectByNamedParam

public T findObjectByNamedParam(Map<String,?> paramMap)
                         throws DataAccessException
Convenient method to execute without context.

Parameters:
paramMap - Map of parameter name to parameter object, matching named parameters specified in the SQL statement. Ordering is not significant.
Throws:
DataAccessException

newRowMapper

protected abstract RowMapper<T> newRowMapper(Object[] parameters,
                                             Map context)
Subclasses must implement this method to extract an object per row, to be returned by the execute method as an aggregated List.

Parameters:
parameters - the parameters to the execute() method, in case subclass is interested; may be null if there were no parameters.
context - contextual information passed to the mapRow callback method. The JDBC operation itself doesn't rely on this parameter, but it can be useful for creating the objects of the result list.
See Also:
execute(java.lang.Object[], java.util.Map)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SqlUpdate

org.springframework.jdbc.object
Class SqlUpdate

java.lang.Object
    extended by  org.springframework.jdbc.object.RdbmsOperation
        extended by  org.springframework.jdbc.object.SqlOperation
            extended by  org.springframework.jdbc.object.SqlUpdate
All Implemented Interfaces:
InitializingBean
Direct Known Subclasses:
BatchSqlUpdate
public class SqlUpdate
extends SqlOperation

Reusable operation object representing a SQL update.

This class provides a number of update methods, analogous to the execute methods of query objects.

This class is concrete. Although it can be subclassed (for example to add a custom update method) it can easily be parameterized by setting SQL and declaring parameters.

Like all RdbmsOperation classes that ship with the Spring Framework, SqlQuery instances are thread-safe after their initialization is complete. That is, after they are constructed and configured via their setter methods, they can be used safely from multiple threads.

Author:
Rod Johnson, Thomas Risberg, Juergen Hoeller
See Also:
SqlQuery

Field Summary
Fields inherited from class org.springframework.jdbc.object.RdbmsOperation
logger
Constructor Summary
SqlUpdate()
Constructor to allow use as a JavaBean.
SqlUpdate(DataSource ds, String sql)
Constructs an update object with a given DataSource and SQL.
SqlUpdate(DataSource ds, String sql, int[] types)
Construct an update object with a given DataSource, SQL and anonymous parameters.
SqlUpdate(DataSource ds, String sql, int[] types, int maxRowsAffected)
Construct an update object with a given DataSource, SQL, anonymous parameters and specifying the maximum number of rows that may be affected.
Method Summary
protected void | checkRowsAffected(int rowsAffected) Check the given number of affected rows against the specified maximum number or required number.
void | setMaxRowsAffected(int maxRowsAffected) Set the maximum number of rows that may be affected by this update.
void | setRequiredRowsAffected(int requiredRowsAffected) Set the exact number of rows that must be affected by this update.
int | update() Convenience method to execute an update with no parameters.
int | update(int p1) Convenient method to execute an update given one int arg.
int | update(int p1, int p2) Convenient method to execute an update given two int args.
int | update(long p1) Convenient method to execute an update given one long arg.
int | update(long p1, long p2) Convenient method to execute an update given two long args.
int | update(Object... params) Generic method to execute the update given parameters.
int | update(Object[] params, KeyHolder generatedKeyHolder) Method to execute the update given arguments and retrieve the generated keys using a KeyHolder.
int | update(String p) Convenient method to execute an update given one String arg.
int | update(String p1, String p2) Convenient method to execute an update given two String args.
int | updateByNamedParam(Map<String,?> paramMap) Generic method to execute the update given named parameters.
int | updateByNamedParam(Map<String,?> paramMap, KeyHolder generatedKeyHolder) Method to execute the update given arguments and retrieve the generated keys using a KeyHolder.
Methods inherited from class org.springframework.jdbc.object.SqlOperation
compileInternal, getParsedSql, newPreparedStatementCreator, newPreparedStatementCreator, newPreparedStatementSetter, onCompileInternal
Methods inherited from class org.springframework.jdbc.object.RdbmsOperation
afterPropertiesSet, allowsUnusedParameters, checkCompiled, compile, declareParameter, getDeclaredParameters, getGeneratedKeysColumnNames, getJdbcTemplate, getResultSetType, getSql, isCompiled, isReturnGeneratedKeys, isUpdatableResults, setDataSource, setFetchSize, setGeneratedKeysColumnNames, setJdbcTemplate, setMaxRows, setParameters, setQueryTimeout, setResultSetType, setReturnGeneratedKeys, setSql, setTypes, setUpdatableResults, supportsLobParameters, validateNamedParameters, validateParameters
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SqlUpdate

public SqlUpdate()
Constructor to allow use as a JavaBean. DataSource and SQL must be supplied before compilation and use.

See Also:
RdbmsOperation.setDataSource(javax.sql.DataSource), RdbmsOperation.setSql(java.lang.String)

SqlUpdate

public SqlUpdate(DataSource ds,
                 String sql)
Constructs an update object with a given DataSource and SQL.

Parameters:
ds - DataSource to use to obtain connections
sql - SQL statement to execute

SqlUpdate

public SqlUpdate(DataSource ds,
                 String sql,
                 int[] types)
Construct an update object with a given DataSource, SQL and anonymous parameters.

Parameters:
ds - DataSource to use to obtain connections
sql - SQL statement to execute
types - SQL types of the parameters, as defined in the java.sql.Types class
See Also:
Types

SqlUpdate

public SqlUpdate(DataSource ds,
                 String sql,
                 int[] types,
                 int maxRowsAffected)
Construct an update object with a given DataSource, SQL, anonymous parameters and specifying the maximum number of rows that may be affected.

Parameters:
ds - DataSource to use to obtain connections
sql - SQL statement to execute
types - SQL types of the parameters, as defined in the java.sql.Types class
maxRowsAffected - the maximum number of rows that may be affected by the update
See Also:
Types
Method Detail

setMaxRowsAffected

public void setMaxRowsAffected(int maxRowsAffected)
Set the maximum number of rows that may be affected by this update. The default value is 0, which does not limit the number of rows affected.

Parameters:
maxRowsAffected - the maximum number of rows that can be affected by this update without this class's update method considering it an error

setRequiredRowsAffected

public void setRequiredRowsAffected(int requiredRowsAffected)
Set the exact number of rows that must be affected by this update. The default value is 0, which allows any number of rows to be affected.

This is an alternative to setting the maximum number of rows that may be affected.

Parameters:
requiredRowsAffected - the exact number of rows that must be affected by this update without this class's update method considering it an error

checkRowsAffected

protected void checkRowsAffected(int rowsAffected)
                          throws JdbcUpdateAffectedIncorrectNumberOfRowsException
Check the given number of affected rows against the specified maximum number or required number.

Parameters:
rowsAffected - the number of affected rows
Throws:
JdbcUpdateAffectedIncorrectNumberOfRowsException - if the actually affected rows are out of bounds
See Also:
setMaxRowsAffected(int), setRequiredRowsAffected(int)

update

public int update(Object... params)
           throws DataAccessException
Generic method to execute the update given parameters. All other update methods invoke this method.

Parameters:
params - array of parameters objects
Returns:
the number of rows affected by the update
Throws:
DataAccessException

update

public int update(Object[] params,
                  KeyHolder generatedKeyHolder)
           throws DataAccessException
Method to execute the update given arguments and retrieve the generated keys using a KeyHolder.

Parameters:
params - array of parameter objects
generatedKeyHolder - KeyHolder that will hold the generated keys
Returns:
the number of rows affected by the update
Throws:
DataAccessException

update

public int update()
           throws DataAccessException
Convenience method to execute an update with no parameters.

Throws:
DataAccessException

update

public int update(int p1)
           throws DataAccessException
Convenient method to execute an update given one int arg.

Throws:
DataAccessException

update

public int update(int p1,
                  int p2)
           throws DataAccessException
Convenient method to execute an update given two int args.

Throws:
DataAccessException

update

public int update(long p1)
           throws DataAccessException
Convenient method to execute an update given one long arg.

Throws:
DataAccessException

update

public int update(long p1,
                  long p2)
           throws DataAccessException
Convenient method to execute an update given two long args.

Throws:
DataAccessException

update

public int update(String p)
           throws DataAccessException
Convenient method to execute an update given one String arg.

Throws:
DataAccessException

update

public int update(String p1,
                  String p2)
           throws DataAccessException
Convenient method to execute an update given two String args.

Throws:
DataAccessException

updateByNamedParam

public int updateByNamedParam(Map<String,?> paramMap)
                       throws DataAccessException
Generic method to execute the update given named parameters. All other update methods invoke this method.

Parameters:
paramMap - Map of parameter name to parameter object, matching named parameters specified in the SQL statement
Returns:
the number of rows affected by the update
Throws:
DataAccessException

updateByNamedParam

public int updateByNamedParam(Map<String,?> paramMap,
                              KeyHolder generatedKeyHolder)
                       throws DataAccessException
Method to execute the update given arguments and retrieve the generated keys using a KeyHolder.

Parameters:
paramMap - Map of parameter name to parameter object, matching named parameters specified in the SQL statement
generatedKeyHolder - KeyHolder that will hold the generated keys
Returns:
the number of rows affected by the update
Throws:
DataAccessException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StoredProcedure

org.springframework.jdbc.object
Class StoredProcedure

java.lang.Object
    extended by  org.springframework.jdbc.object.RdbmsOperation
        extended by  org.springframework.jdbc.object.SqlCall
            extended by  org.springframework.jdbc.object.StoredProcedure
All Implemented Interfaces:
InitializingBean
Direct Known Subclasses:
GenericStoredProcedure
public abstract class StoredProcedure
extends SqlCall

Superclass for object abstractions of RDBMS stored procedures. This class is abstract and it is intended that subclasses will provide a typed method for invocation that delegates to the supplied execute(java.lang.Object...) method.

The inherited sql property is the name of the stored procedure in the RDBMS. Note that JDBC 3.0 introduces named parameters, although the other features provided by this class are still necessary in JDBC 3.0.

Author:
Rod Johnson, Thomas Risberg
See Also:
RdbmsOperation.setSql(java.lang.String)

Field Summary
Fields inherited from class org.springframework.jdbc.object.RdbmsOperation
logger
Constructor Summary
protected | StoredProcedure() Allow use as a bean.
protected | StoredProcedure(DataSource ds, String name) Create a new object wrapper for a stored procedure.
protected | StoredProcedure(JdbcTemplate jdbcTemplate, String name) Create a new object wrapper for a stored procedure.
Method Summary
protected boolean | allowsUnusedParameters() StoredProcedure parameter Maps are by default allowed to contain additional entries that are not actually used as parameters.
void | declareParameter(SqlParameter param) Declare a parameter.
Map<String,Object> | execute(Map<String,?> inParams) Execute the stored procedure.
Map<String,Object> | execute(Object... inParams) Execute the stored procedure with the provided parameter values.
Map<String,Object> | execute(ParameterMapper inParamMapper) Execute the stored procedure.
Methods inherited from class org.springframework.jdbc.object.SqlCall
compileInternal, getCallString, isFunction, isSqlReadyForUse, newCallableStatementCreator, newCallableStatementCreator, onCompileInternal, setFunction, setSqlReadyForUse
Methods inherited from class org.springframework.jdbc.object.RdbmsOperation
afterPropertiesSet, checkCompiled, compile, getDeclaredParameters, getGeneratedKeysColumnNames, getJdbcTemplate, getResultSetType, getSql, isCompiled, isReturnGeneratedKeys, isUpdatableResults, setDataSource, setFetchSize, setGeneratedKeysColumnNames, setJdbcTemplate, setMaxRows, setParameters, setQueryTimeout, setResultSetType, setReturnGeneratedKeys, setSql, setTypes, setUpdatableResults, supportsLobParameters, validateNamedParameters, validateParameters
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

StoredProcedure

protected StoredProcedure()
Allow use as a bean.

StoredProcedure

protected StoredProcedure(DataSource ds,
                          String name)
Create a new object wrapper for a stored procedure.

Parameters:
ds - DataSource to use throughout the lifetime of this object to obtain connections
name - name of the stored procedure in the database

StoredProcedure

protected StoredProcedure(JdbcTemplate jdbcTemplate,
                          String name)
Create a new object wrapper for a stored procedure.

Parameters:
jdbcTemplate - JdbcTemplate which wraps DataSource
name - name of the stored procedure in the database
Method Detail

allowsUnusedParameters

protected boolean allowsUnusedParameters()
StoredProcedure parameter Maps are by default allowed to contain additional entries that are not actually used as parameters.

Overrides:
allowsUnusedParameters in class RdbmsOperation
See Also:
StoredProcedure

declareParameter

public void declareParameter(SqlParameter param)
                      throws InvalidDataAccessApiUsageException
Declare a parameter. Overridden method. Parameters declared as SqlParameter and SqlInOutParameter will always be used to provide input values. In addition to this any parameter declared as SqlOutParameter where an non-null input value is provided will also be used as an input paraneter. Note: Calls to declareParameter must be made in the same order as they appear in the database's stored procedure parameter list. Names are purely used to help mapping.

Overrides:
declareParameter in class RdbmsOperation
Parameters:
param - parameter object
Throws:
InvalidDataAccessApiUsageException - if the operation is already compiled, and hence cannot be configured further

execute

public Map<String,Object> execute(Object... inParams)
Execute the stored procedure with the provided parameter values. This is a convenience method where the order of the passed in parameter values must match the order that the parameters where declared in.

Parameters:
inParams - variable number of input parameters. Output parameters should not be included in this map. It is legal for values to be null, and this will produce the correct behavior using a NULL argument to the stored procedure.
Returns:
map of output params, keyed by name as in parameter declarations. Output parameters will appear here, with their values after the stored procedure has been called.

execute

public Map<String,Object> execute(Map<String,?> inParams)
                           throws DataAccessException
Execute the stored procedure. Subclasses should define a strongly typed execute method (with a meaningful name) that invokes this method, populating the input map and extracting typed values from the output map. Subclass execute methods will often take domain objects as arguments and return values. Alternatively, they can return void.

Parameters:
inParams - map of input parameters, keyed by name as in parameter declarations. Output parameters need not (but can) be included in this map. It is legal for map entries to be null, and this will produce the correct behavior using a NULL argument to the stored procedure.
Returns:
map of output params, keyed by name as in parameter declarations. Output parameters will appear here, with their values after the stored procedure has been called.
Throws:
DataAccessException

execute

public Map<String,Object> execute(ParameterMapper inParamMapper)
                           throws DataAccessException
Execute the stored procedure. Subclasses should define a strongly typed execute method (with a meaningful name) that invokes this method, passing in a ParameterMapper that will populate the input map. This allows mapping database specific features since the ParameterMapper has access to the Connection object. The execute method is also responsible for extracting typed values from the output map. Subclass execute methods will often take domain objects as arguments and return values. Alternatively, they can return void.

Parameters:
inParamMapper - map of input parameters, keyed by name as in parameter declarations. Output parameters need not (but can) be included in this map. It is legal for map entries to be null, and this will produce the correct behavior using a NULL argument to the stored procedure.
Returns:
map of output params, keyed by name as in parameter declarations. Output parameters will appear here, with their values after the stored procedure has been called.
Throws:
DataAccessException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UpdatableSqlQuery

org.springframework.jdbc.object
Class UpdatableSqlQuery<T>

java.lang.Object
    extended by  org.springframework.jdbc.object.RdbmsOperation
        extended by  org.springframework.jdbc.object.SqlOperation
            extended by  org.springframework.jdbc.object.SqlQuery<T>
                extended by  org.springframework.jdbc.object.UpdatableSqlQuery<T>
All Implemented Interfaces:
InitializingBean
public abstract class UpdatableSqlQuery<T>
extends SqlQuery<T>

Reusable RDBMS query in which concrete subclasses must implement the abstract updateRow(ResultSet, int, context) method to update each row of the JDBC ResultSet and optionally map contents into an object.

Subclasses can be constructed providing SQL, parameter types and a DataSource. SQL will often vary between subclasses.

Author:
Thomas Risberg
See Also:
SqlQuery

Nested Class Summary
protected  class UpdatableSqlQuery.RowMapperImpl
Implementation of RowMapper that calls the enclosing class's updateRow() method for each row.
Field Summary
Fields inherited from class org.springframework.jdbc.object.RdbmsOperation
logger
Constructor Summary
UpdatableSqlQuery()
Constructor to allow use as a JavaBean
UpdatableSqlQuery(DataSource ds, String sql)
Convenient constructor with DataSource and SQL string.
Method Summary
protected RowMapper<T> | newRowMapper(Object[] parameters, Map context) Implementation of the superclass template method.
protected abstract T | updateRow(ResultSet rs, int rowNum, Map context) Subclasses must implement this method to update each row of the ResultSet and optionally create object of the result type.
Methods inherited from class org.springframework.jdbc.object.SqlQuery
execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, executeByNamedParam, executeByNamedParam, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObjectByNamedParam, findObjectByNamedParam, getRowsExpected, setRowsExpected
Methods inherited from class org.springframework.jdbc.object.SqlOperation
compileInternal, getParsedSql, newPreparedStatementCreator, newPreparedStatementCreator, newPreparedStatementSetter, onCompileInternal
Methods inherited from class org.springframework.jdbc.object.RdbmsOperation
afterPropertiesSet, allowsUnusedParameters, checkCompiled, compile, declareParameter, getDeclaredParameters, getGeneratedKeysColumnNames, getJdbcTemplate, getResultSetType, getSql, isCompiled, isReturnGeneratedKeys, isUpdatableResults, setDataSource, setFetchSize, setGeneratedKeysColumnNames, setJdbcTemplate, setMaxRows, setParameters, setQueryTimeout, setResultSetType, setReturnGeneratedKeys, setSql, setTypes, setUpdatableResults, supportsLobParameters, validateNamedParameters, validateParameters
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

UpdatableSqlQuery

public UpdatableSqlQuery()
Constructor to allow use as a JavaBean

UpdatableSqlQuery

public UpdatableSqlQuery(DataSource ds,
                         String sql)
Convenient constructor with DataSource and SQL string.

Parameters:
ds - DataSource to use to get connections
sql - SQL to run
Method Detail

newRowMapper

protected RowMapper<T> newRowMapper(Object[] parameters,
                                    Map context)
Implementation of the superclass template method. This invokes the subclass's implementation of the updateRow() method.

Specified by:
newRowMapper in class SqlQuery<T>
Parameters:
parameters - the parameters to the execute() method, in case subclass is interested; may be null if there were no parameters.
context - contextual information passed to the mapRow callback method. The JDBC operation itself doesn't rely on this parameter, but it can be useful for creating the objects of the result list.
See Also:
SqlQuery.execute(java.lang.Object[], java.util.Map)

updateRow

protected abstract T updateRow(ResultSet rs,
                               int rowNum,
                               Map context)
                        throws SQLException
Subclasses must implement this method to update each row of the ResultSet and optionally create object of the result type.

Parameters:
rs - ResultSet we're working through
rowNum - row number (from 0) we're up to
context - passed to the execute() method. It can be null if no contextual information is need. If you need to pass in data for each row, you can pass in a HashMap with the primary key of the row being the key for the HashMap. That way it is easy to locate the updates for each row
Returns:
an object of the result type
Throws:
SQLException - if there's an error updateing data. Subclasses can simply not catch SQLExceptions, relying on the framework to clean up.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UpdatableSqlQuery.RowMapperImpl

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.object
Class UpdatableSqlQuery.RowMapperImpl

java.lang.Object
    extended by  org.springframework.jdbc.object.UpdatableSqlQuery.RowMapperImpl
All Implemented Interfaces:
RowMapper<T>
Enclosing class:
UpdatableSqlQuery<T>
protected class UpdatableSqlQuery.RowMapperImpl
extends Object
implements RowMapper<T>

Implementation of RowMapper that calls the enclosing class's updateRow() method for each row.

Constructor Summary
UpdatableSqlQuery.RowMapperImpl(Map context)
Method Summary
 T mapRow(ResultSet rs, int rowNum)
Implementations must implement this method to map each row of data in the ResultSet.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

UpdatableSqlQuery.RowMapperImpl

public UpdatableSqlQuery.RowMapperImpl(Map context)
Method Detail

mapRow

public T mapRow(ResultSet rs,
                int rowNum)
         throws SQLException
Description copied from interface: RowMapper
Implementations must implement this method to map each row of data in the ResultSet. This method should not call next() on the ResultSet; it is only supposed to map values of the current row.

Specified by:
mapRow in interface RowMapper<T>
Parameters:
rs - the ResultSet to map (pre-initialized for the current row)
rowNum - the number of the current row
Returns:
the result object for the current row
Throws:
SQLException - if a SQLException is encountered getting column values (that is, there's no need to catch SQLException)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jdbc.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jdbc.support

Support classes for the JDBC framework, used by the classes in the jdbc.core and jdbc.object packages.

See:
Description

Interface Summary
DatabaseMetaDataCallback | A callback interface used by the JdbcUtils class.
KeyHolder | Interface for retrieving keys, typically used for auto-generated keys as potentially returned by JDBC insert statements.
SQLExceptionTranslator | Strategy interface for translating between SQLExceptions and Spring's data access strategy-agnostic DataAccessException hierarchy.
SqlValue | Simple interface for complex types to be set as statement parameters.

Class Summary
AbstractFallbackSQLExceptionTranslator | Base class for SQLExceptionTranslator implementations that allow for fallback to some other SQLExceptionTranslator.
CustomSQLErrorCodesTranslation | JavaBean for holding custom JDBC error codes translation for a particular database.
DatabaseStartupValidator | Bean that checks if a database has already started up.
GeneratedKeyHolder | Default implementation of the KeyHolder interface, to be used for holding auto-generated keys (as potentially returned by JDBC insert statements).
JdbcAccessor | Base class for JdbcTemplate and other JDBC-accessing DAO helpers, defining common properties such as DataSource and exception translator.
JdbcUtils | Generic utility methods for working with JDBC.
SQLErrorCodes | JavaBean for holding JDBC error codes for a particular database.
SQLErrorCodesFactory | Factory for creating SQLErrorCodes based on the "databaseProductName" taken from the DatabaseMetaData.
SQLErrorCodeSQLExceptionTranslator | Implementation of SQLExceptionTranslator that analyzes vendor-specific error codes.
SQLExceptionSubclassTranslator | SQLExceptionTranslator implementation which analyzes the specific SQLException subclass thrown by the JDBC driver.
SQLStateSQLExceptionTranslator | SQLExceptionTranslator implementation that analyzes the SQL state in the SQLException based on the first two digits (the SQL state "class").

Exception Summary
MetaDataAccessException Exception indicating that something went wrong during JDBC metadata lookup.

Package org.springframework.jdbc.support Description

Support classes for the JDBC framework, used by the classes in the jdbc.core and jdbc.object packages. Provides a translator from SQLExceptions Spring's generic DataAccessExceptions.

Can be used independently, for example in custom JDBC access code, or in JDBC-based O/R mapping layers.


org.springframework.jdbc.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jdbc.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator (implements org.springframework.jdbc.support.SQLExceptionTranslator)
      • org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator
      • org.springframework.jdbc.support.SQLExceptionSubclassTranslator
      • org.springframework.jdbc.support.SQLStateSQLExceptionTranslator
    • org.springframework.jdbc.support.CustomSQLErrorCodesTranslation
    • org.springframework.jdbc.support.DatabaseStartupValidator (implements org.springframework.beans.factory.InitializingBean)
    • org.springframework.jdbc.support.GeneratedKeyHolder (implements org.springframework.jdbc.support.KeyHolder)
    • org.springframework.jdbc.support.JdbcAccessor (implements org.springframework.beans.factory.InitializingBean)
    • org.springframework.jdbc.support.JdbcUtils
    • org.springframework.jdbc.support.SQLErrorCodes
    • org.springframework.jdbc.support.SQLErrorCodesFactory
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • org.springframework.core.NestedCheckedException
          • org.springframework.jdbc.support.MetaDataAccessException

Interface Hierarchy

  • org.springframework.jdbc.support.DatabaseMetaDataCallback
  • org.springframework.jdbc.support.KeyHolder
  • org.springframework.jdbc.support.SQLExceptionTranslator
  • org.springframework.jdbc.support.SqlValue


DatabaseMetaDataCallback

org.springframework.jdbc.support
Interface DatabaseMetaDataCallback

public interface DatabaseMetaDataCallback

A callback interface used by the JdbcUtils class. Implementations of this interface perform the actual work of extracting database meta data, but don't need to worry about exception handling. SQLExceptions will be caught and handled correctly by the JdbcUtils class.

Author:
Thomas Risberg
See Also:
JdbcUtils.extractDatabaseMetaData(javax.sql.DataSource, org.springframework.jdbc.support.DatabaseMetaDataCallback)

Method Summary
 Object processMetaData(DatabaseMetaData dbmd)
Implementations must implement this method to process the meta data passed in.

Method Detail

processMetaData

Object processMetaData(DatabaseMetaData dbmd)
                       throws SQLException,
                              MetaDataAccessException
Implementations must implement this method to process the meta data passed in. Exactly what the implementation chooses to do is up to it.

Parameters:
dbmd - the DatabaseMetaData to process
Returns:
a result object extracted from the meta data (can be an arbitrary object, as needed by the implementation)
Throws:
SQLException - if a SQLException is encountered getting column values (that is, there's no need to catch SQLException)
MetaDataAccessException - in case of other failures while extracting meta data (for example, reflection failure)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


KeyHolder

org.springframework.jdbc.support
Interface KeyHolder

All Known Implementing Classes:
GeneratedKeyHolder
public interface KeyHolder

Interface for retrieving keys, typically used for auto-generated keys as potentially returned by JDBC insert statements.

Implementations of this interface can hold any number of keys. In the general case, the keys are returned as a List containing one Map for each row of keys.

Most applications only use on key per row and process only one row at a time in an insert statement. In these cases, just call getKey to retrieve the key. The returned value is a Number here, which is the usual type for auto-generated keys.

Since:
1.1
Author:
Thomas Risberg, Juergen Hoeller
See Also:
JdbcTemplate, SqlUpdate

Method Summary
Number | getKey() Retrieve the first item from the first map, assuming that there is just one item and just one map, and that the item is a number.
List<Map<String,Object>> | getKeyList() Return a reference to the List that contains the keys.
Map<String,Object> | getKeys() Retrieve the first map of keys.

Method Detail

getKey

Number getKey()
              throws InvalidDataAccessApiUsageException
Retrieve the first item from the first map, assuming that there is just one item and just one map, and that the item is a number. This is the typical case: a single, numeric generated key.

Keys are held in a List of Maps, where each item in the list represents the keys for each row. If there are multiple columns, then the Map will have multiple entries as well. If this method encounters multiple entries in either the map or the list meaning that multiple keys were returned, then an InvalidDataAccessApiUsageException is thrown.

Returns:
the generated key
Throws:
InvalidDataAccessApiUsageException - if multiple keys are encountered.

getKeys

Map<String,Object> getKeys()
                           throws InvalidDataAccessApiUsageException
Retrieve the first map of keys. If there are multiple entries in the list (meaning that multiple rows had keys returned), then an InvalidDataAccessApiUsageException is thrown.

Returns:
the Map of generated keys
Throws:
InvalidDataAccessApiUsageException - if keys for multiple rows are encountered

getKeyList

List<Map<String,Object>> getKeyList()
Return a reference to the List that contains the keys. Can be used for extracting keys for multiple rows (an unusual case), and also for adding new maps of keys.

Returns:
the List for the generated keys, with each entry being a Map of column names and key values
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SQLExceptionTranslator

org.springframework.jdbc.support
Interface SQLExceptionTranslator

All Known Implementing Classes:
AbstractFallbackSQLExceptionTranslator, SQLErrorCodeSQLExceptionTranslator, SQLExceptionSubclassTranslator, SQLStateSQLExceptionTranslator
public interface SQLExceptionTranslator

Strategy interface for translating between SQLExceptions and Spring's data access strategy-agnostic DataAccessException hierarchy.

Implementations can be generic (for example, using SQLState codes for JDBC) or wholly proprietary (for example, using Oracle error codes) for greater precision.

Author:
Rod Johnson, Juergen Hoeller
See Also:
DataAccessException

Method Summary
 DataAccessException translate(String task, String sql, SQLException ex)
Translate the given SQLException into a generic DataAccessException.

Method Detail

translate

DataAccessException translate(String task,
                              String sql,
                              SQLException ex)
Translate the given SQLException into a generic DataAccessException.

The returned DataAccessException is supposed to contain the original SQLException as root cause. However, client code may not generally rely on this due to DataAccessExceptions possibly being caused by other resource APIs as well. That said, a getRootCause() instanceof SQLException check (and subsequent cast) is considered reliable when expecting JDBC-based access to have happened.

Parameters:
task - readable text describing the task being attempted
sql - SQL query or update that caused the problem (may be null)
ex - the offending SQLException
Returns:
the DataAccessException, wrapping the SQLException
See Also:
NestedRuntimeException.getRootCause()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SqlValue

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.support
Interface SqlValue

All Known Subinterfaces:
SqlXmlValue
public interface SqlValue

Simple interface for complex types to be set as statement parameters.

Implementations perform the actual work of setting the actual values. They must implement the callback method setValue which can throw SQLExceptions that will be caught and translated by the calling code. This callback method has access to the underlying Connection via the given PreparedStatement object, if that should be needed to create any database-specific objects.

Since:
2.5.6
Author:
Juergen Hoeller
See Also:
SqlTypeValue, DisposableSqlTypeValue

Method Summary
void | cleanup() Clean up resources held by this value object.
void | setValue(PreparedStatement ps, int paramIndex) Set the value on the given PreparedStatement.

Method Detail

setValue

void setValue(PreparedStatement ps,
              int paramIndex)
              throws SQLException
Set the value on the given PreparedStatement.

Parameters:
ps - the PreparedStatement to work on
paramIndex - the index of the parameter for which we need to set the value
Throws:
SQLException - if a SQLException is encountered while setting parameter values

cleanup

void cleanup()
Clean up resources held by this value object.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractFallbackSQLExceptionTranslator

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.support
Class AbstractFallbackSQLExceptionTranslator

java.lang.Object
    extended by  org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator
All Implemented Interfaces:
SQLExceptionTranslator
Direct Known Subclasses:
SQLErrorCodeSQLExceptionTranslator, SQLExceptionSubclassTranslator, SQLStateSQLExceptionTranslator
public abstract class AbstractFallbackSQLExceptionTranslator
extends Object
implements SQLExceptionTranslator

Base class for SQLExceptionTranslator implementations that allow for fallback to some other SQLExceptionTranslator.

Since:
2.5.6
Author:
Juergen Hoeller

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
AbstractFallbackSQLExceptionTranslator()
Method Summary
protected  String buildMessage(String task, String sql, SQLException ex)
Build a message String for the given SQLException.
protected abstract  DataAccessException doTranslate(String task, String sql, SQLException ex)
Template method for actually translating the given exception.
 SQLExceptionTranslator getFallbackTranslator()
Return the fallback exception translator, if any.
 void setFallbackTranslator(SQLExceptionTranslator fallback)
Override the default SQL state fallback translator (typically a SQLStateSQLExceptionTranslator).
 DataAccessException translate(String task, String sql, SQLException ex)
Pre-checks the arguments, calls doTranslate(java.lang.String, java.lang.String, java.sql.SQLException), and invokes the fallback translator if necessary.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

AbstractFallbackSQLExceptionTranslator

public AbstractFallbackSQLExceptionTranslator()
Method Detail

setFallbackTranslator

public void setFallbackTranslator(SQLExceptionTranslator fallback)
Override the default SQL state fallback translator (typically a SQLStateSQLExceptionTranslator).

getFallbackTranslator

public SQLExceptionTranslator getFallbackTranslator()
Return the fallback exception translator, if any.

translate

public DataAccessException translate(String task,
                                     String sql,
                                     SQLException ex)
Pre-checks the arguments, calls doTranslate(java.lang.String, java.lang.String, java.sql.SQLException), and invokes the fallback translator if necessary.

Specified by:
translate in interface SQLExceptionTranslator
Parameters:
task - readable text describing the task being attempted
sql - SQL query or update that caused the problem (may be null)
ex - the offending SQLException
Returns:
the DataAccessException, wrapping the SQLException
See Also:
NestedRuntimeException.getRootCause()

doTranslate

protected abstract DataAccessException doTranslate(String task,
                                                   String sql,
                                                   SQLException ex)
Template method for actually translating the given exception.

The passed-in arguments will have been pre-checked. Furthermore, this method is allowed to return null to indicate that no exception match has been found and that fallback translation should kick in.

Parameters:
task - readable text describing the task being attempted
sql - SQL query or update that caused the problem (may be null)
ex - the offending SQLException
Returns:
the DataAccessException, wrapping the SQLException; or null if no exception match found

buildMessage

protected String buildMessage(String task,
                              String sql,
                              SQLException ex)
Build a message String for the given SQLException.

To be called by translator subclasses when creating an instance of a generic DataAccessException class.

Parameters:
task - readable text describing the task being attempted
sql - the SQL statement that caused the problem (may be null)
ex - the offending SQLException
Returns:
the message String to use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


CustomSQLErrorCodesTranslation

org.springframework.jdbc.support
Class CustomSQLErrorCodesTranslation

java.lang.Object
    extended by  org.springframework.jdbc.support.CustomSQLErrorCodesTranslation

public class CustomSQLErrorCodesTranslation
extends Object

JavaBean for holding custom JDBC error codes translation for a particular database. The "exceptionClass" property defines which exception will be thrown for the list of error codes specified in the errorCodes property.

Since:
1.1
Author:
Thomas Risberg
See Also:
SQLErrorCodeSQLExceptionTranslator

Constructor Summary
CustomSQLErrorCodesTranslation()
Method Summary
String[] | getErrorCodes() Return the SQL error codes to match.
Class | getExceptionClass() Return the exception class for the specified error codes.
void | setErrorCodes(String[] errorCodes) Set the SQL error codes to match.
void | setExceptionClass(Class exceptionClass) Set the exception class for the specified error codes.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CustomSQLErrorCodesTranslation

public CustomSQLErrorCodesTranslation()
Method Detail

setErrorCodes

public void setErrorCodes(String[] errorCodes)
Set the SQL error codes to match.

getErrorCodes

public String[] getErrorCodes()
Return the SQL error codes to match.

setExceptionClass

public void setExceptionClass(Class exceptionClass)
Set the exception class for the specified error codes.

getExceptionClass

public Class getExceptionClass()
Return the exception class for the specified error codes.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DatabaseStartupValidator

org.springframework.jdbc.support
Class DatabaseStartupValidator

java.lang.Object
    extended by  org.springframework.jdbc.support.DatabaseStartupValidator
All Implemented Interfaces:
InitializingBean
public class DatabaseStartupValidator
extends Object
implements InitializingBean

Bean that checks if a database has already started up. To be referenced via "depends-on" from beans that depend on database startup, like a Hibernate SessionFactory or custom data access objects that access a DataSource directly.

Useful to defer application initialization until a database has started up. Particularly appropriate for waiting on a slowly starting Oracle database.

Since:
18.12.2003
Author:
Juergen Hoeller

Field Summary
static int | DEFAULT_INTERVAL
static int | DEFAULT_TIMEOUT
protected Log | logger
Constructor Summary
DatabaseStartupValidator()
Method Summary
void | afterPropertiesSet() Check whether the validation query can be executed on a Connection from the specified DataSource, with the specified interval between checks, until the specified timeout.
void | setDataSource(DataSource dataSource) Set the DataSource to validate.
void | setInterval(int interval) Set the interval between validation runs (in seconds).
void | setTimeout(int timeout) Set the timeout (in seconds) after which a fatal exception will be thrown.
void | setValidationQuery(String validationQuery) Set the SQL query string to use for validation.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_INTERVAL

public static final int DEFAULT_INTERVAL
See Also:
Constant Field Values

DEFAULT_TIMEOUT

public static final int DEFAULT_TIMEOUT
See Also:
Constant Field Values

logger

protected final Log logger
Constructor Detail

DatabaseStartupValidator

public DatabaseStartupValidator()
Method Detail

setDataSource

public void setDataSource(DataSource dataSource)
Set the DataSource to validate.

setValidationQuery

public void setValidationQuery(String validationQuery)
Set the SQL query string to use for validation.

setInterval

public void setInterval(int interval)
Set the interval between validation runs (in seconds). Default is 1.

setTimeout

public void setTimeout(int timeout)
Set the timeout (in seconds) after which a fatal exception will be thrown. Default is 60.

afterPropertiesSet

public void afterPropertiesSet()
Check whether the validation query can be executed on a Connection from the specified DataSource, with the specified interval between checks, until the specified timeout.

Specified by:
afterPropertiesSet in interface InitializingBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


GeneratedKeyHolder

org.springframework.jdbc.support
Class GeneratedKeyHolder

java.lang.Object
    extended by  org.springframework.jdbc.support.GeneratedKeyHolder
All Implemented Interfaces:
KeyHolder
public class GeneratedKeyHolder
extends Object
implements KeyHolder

Default implementation of the KeyHolder interface, to be used for holding auto-generated keys (as potentially returned by JDBC insert statements).

Create an instance of this class for each insert operation, and pass it to the corresponding JdbcTemplate or {org.springframework.jdbc.object.SqlUpdate} methods.

Since:
1.1
Author:
Thomas Risberg, Juergen Hoeller

Constructor Summary
GeneratedKeyHolder()
Create a new GeneratedKeyHolder with a default list.
GeneratedKeyHolder(List<Map<String,Object>> keyList)
Create a new GeneratedKeyHolder with a given list.
Method Summary
Number | getKey() Retrieve the first item from the first map, assuming that there is just one item and just one map, and that the item is a number.
List<Map<String,Object>> | getKeyList() Return a reference to the List that contains the keys.
Map<String,Object> | getKeys() Retrieve the first map of keys.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

GeneratedKeyHolder

public GeneratedKeyHolder()
Create a new GeneratedKeyHolder with a default list.

GeneratedKeyHolder

public GeneratedKeyHolder(List<Map<String,Object>> keyList)
Create a new GeneratedKeyHolder with a given list.

Parameters:
keyList - a list to hold maps of keys
Method Detail

getKey

public Number getKey()
              throws InvalidDataAccessApiUsageException,
                     DataRetrievalFailureException
Description copied from interface: KeyHolder
Retrieve the first item from the first map, assuming that there is just one item and just one map, and that the item is a number. This is the typical case: a single, numeric generated key.

Keys are held in a List of Maps, where each item in the list represents the keys for each row. If there are multiple columns, then the Map will have multiple entries as well. If this method encounters multiple entries in either the map or the list meaning that multiple keys were returned, then an InvalidDataAccessApiUsageException is thrown.

Specified by:
getKey in interface KeyHolder
Returns:
the generated key
Throws:
InvalidDataAccessApiUsageException - if multiple keys are encountered.
DataRetrievalFailureException

getKeys

public Map<String,Object> getKeys()
                           throws InvalidDataAccessApiUsageException
Description copied from interface: KeyHolder
Retrieve the first map of keys. If there are multiple entries in the list (meaning that multiple rows had keys returned), then an InvalidDataAccessApiUsageException is thrown.

Specified by:
getKeys in interface KeyHolder
Returns:
the Map of generated keys
Throws:
InvalidDataAccessApiUsageException - if keys for multiple rows are encountered

getKeyList

public List<Map<String,Object>> getKeyList()
Description copied from interface: KeyHolder
Return a reference to the List that contains the keys. Can be used for extracting keys for multiple rows (an unusual case), and also for adding new maps of keys.

Specified by:
getKeyList in interface KeyHolder
Returns:
the List for the generated keys, with each entry being a Map of column names and key values
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JdbcAccessor

org.springframework.jdbc.support
Class JdbcAccessor

java.lang.Object
    extended by  org.springframework.jdbc.support.JdbcAccessor
All Implemented Interfaces:
InitializingBean
Direct Known Subclasses:
JdbcTemplate, SqlMapClientTemplate
public abstract class JdbcAccessor
extends Object
implements InitializingBean

Base class for JdbcTemplate and other JDBC-accessing DAO helpers, defining common properties such as DataSource and exception translator.

Not intended to be used directly. See JdbcTemplate.

Since:
28.11.2003
Author:
Juergen Hoeller
See Also:
JdbcTemplate

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
JdbcAccessor()
Method Summary
void | afterPropertiesSet() Eagerly initialize the exception translator, if demanded, creating a default one for the specified DataSource if none set.
DataSource | getDataSource() Return the DataSource used by this template.
SQLExceptionTranslator | getExceptionTranslator() Return the exception translator for this instance.
boolean | isLazyInit() Return whether to lazily initialize the SQLExceptionTranslator for this accessor.
void | setDatabaseProductName(String dbName) Specify the database product name for the DataSource that this accessor uses.
void | setDataSource(DataSource dataSource) Set the JDBC DataSource to obtain connections from.
void | setExceptionTranslator(SQLExceptionTranslator exceptionTranslator) Set the exception translator for this instance.
void | setLazyInit(boolean lazyInit) Set whether to lazily initialize the SQLExceptionTranslator for this accessor, on first encounter of a SQLException.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

JdbcAccessor

public JdbcAccessor()
Method Detail

setDataSource

public void setDataSource(DataSource dataSource)
Set the JDBC DataSource to obtain connections from.

getDataSource

public DataSource getDataSource()
Return the DataSource used by this template.

setDatabaseProductName

public void setDatabaseProductName(String dbName)
Specify the database product name for the DataSource that this accessor uses. This allows to initialize a SQLErrorCodeSQLExceptionTranslator without obtaining a Connection from the DataSource to get the metadata.

Parameters:
dbName - the database product name that identifies the error codes entry
See Also:
SQLErrorCodeSQLExceptionTranslator.setDatabaseProductName(java.lang.String), DatabaseMetaData.getDatabaseProductName()

setExceptionTranslator

public void setExceptionTranslator(SQLExceptionTranslator exceptionTranslator)
Set the exception translator for this instance.

If no custom translator is provided, a default SQLErrorCodeSQLExceptionTranslator is used which examines the SQLException's vendor-specific error code.

See Also:
SQLErrorCodeSQLExceptionTranslator, SQLStateSQLExceptionTranslator

getExceptionTranslator

public SQLExceptionTranslator getExceptionTranslator()
Return the exception translator for this instance.

Creates a default SQLErrorCodeSQLExceptionTranslator for the specified DataSource if none set, or a SQLStateSQLExceptionTranslator in case of no DataSource.

See Also:
getDataSource()

setLazyInit

public void setLazyInit(boolean lazyInit)
Set whether to lazily initialize the SQLExceptionTranslator for this accessor, on first encounter of a SQLException. Default is "true"; can be switched to "false" for initialization on startup.

Early initialization just applies if afterPropertiesSet() is called.

See Also:
getExceptionTranslator(), afterPropertiesSet()

isLazyInit

public boolean isLazyInit()
Return whether to lazily initialize the SQLExceptionTranslator for this accessor.

See Also:
getExceptionTranslator()

afterPropertiesSet

public void afterPropertiesSet()
Eagerly initialize the exception translator, if demanded, creating a default one for the specified DataSource if none set.

Specified by:
afterPropertiesSet in interface InitializingBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JdbcUtils

org.springframework.jdbc.support
Class JdbcUtils

java.lang.Object
    extended by  org.springframework.jdbc.support.JdbcUtils

public abstract class JdbcUtils
extends Object

Generic utility methods for working with JDBC. Mainly for internal use within the framework, but also useful for custom JDBC access code.

Author:
Thomas Risberg, Juergen Hoeller

Field Summary
static int TYPE_UNKNOWN
Constant that indicates an unknown (or unspecified) SQL type.
Constructor Summary
JdbcUtils()
Method Summary
static void | closeConnection(Connection con) Close the given JDBC Connection and ignore any thrown exception.
static void | closeResultSet(ResultSet rs) Close the given JDBC ResultSet and ignore any thrown exception.
static void | closeStatement(Statement stmt) Close the given JDBC Statement and ignore any thrown exception.
static String | commonDatabaseName(String source) Extract a common name for the database in use even if various drivers/platforms provide varying names.
static String | convertUnderscoreNameToPropertyName(String name) Convert a column name with underscores to the corresponding property name using "camel case".
static Object | extractDatabaseMetaData(DataSource dataSource, DatabaseMetaDataCallback action) Extract database meta data via the given DatabaseMetaDataCallback.
static Object | extractDatabaseMetaData(DataSource dataSource, String metaDataMethodName) Call the specified method on DatabaseMetaData for the given DataSource, and extract the invocation result.
static Object | getResultSetValue(ResultSet rs, int index) Retrieve a JDBC column value from a ResultSet, using the most appropriate value type.
static Object | getResultSetValue(ResultSet rs, int index, Class requiredType) Retrieve a JDBC column value from a ResultSet, using the specified value type.
static boolean | isNumeric(int sqlType) Check whether the given SQL type is numeric.
static String | lookupColumnName(ResultSetMetaData resultSetMetaData, int columnIndex) Determine the column name to use.
static boolean | supportsBatchUpdates(Connection con) Return whether the given JDBC driver supports JDBC 2.0 batch updates.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

TYPE_UNKNOWN

public static final int TYPE_UNKNOWN
Constant that indicates an unknown (or unspecified) SQL type.

See Also:
Types, Constant Field Values
Constructor Detail

JdbcUtils

public JdbcUtils()
Method Detail

closeConnection

public static void closeConnection(Connection con)
Close the given JDBC Connection and ignore any thrown exception. This is useful for typical finally blocks in manual JDBC code.

Parameters:
con - the JDBC Connection to close (may be null)

closeStatement

public static void closeStatement(Statement stmt)
Close the given JDBC Statement and ignore any thrown exception. This is useful for typical finally blocks in manual JDBC code.

Parameters:
stmt - the JDBC Statement to close (may be null)

closeResultSet

public static void closeResultSet(ResultSet rs)
Close the given JDBC ResultSet and ignore any thrown exception. This is useful for typical finally blocks in manual JDBC code.

Parameters:
rs - the JDBC ResultSet to close (may be null)

getResultSetValue

public static Object getResultSetValue(ResultSet rs,
                                       int index,
                                       Class requiredType)
                                throws SQLException
Retrieve a JDBC column value from a ResultSet, using the specified value type.

Uses the specifically typed ResultSet accessor methods, falling back to getResultSetValue(java.sql.ResultSet, int) for unknown types.

Note that the returned value may not be assignable to the specified required type, in case of an unknown type. Calling code needs to deal with this case appropriately, e.g. throwing a corresponding exception.

Parameters:
rs - is the ResultSet holding the data
index - is the column index
requiredType - the required value type (may be null)
Returns:
the value object
Throws:
SQLException - if thrown by the JDBC API

getResultSetValue

public static Object getResultSetValue(ResultSet rs,
                                       int index)
                                throws SQLException
Retrieve a JDBC column value from a ResultSet, using the most appropriate value type. The returned value should be a detached value object, not having any ties to the active ResultSet: in particular, it should not be a Blob or Clob object but rather a byte array respectively String representation.

Uses the getObject(index) method, but includes additional "hacks" to get around Oracle 10g returning a non-standard object for its TIMESTAMP datatype and a java.sql.Date for DATE columns leaving out the time portion: These columns will explicitly be extracted as standard java.sql.Timestamp object.

Parameters:
rs - is the ResultSet holding the data
index - is the column index
Returns:
the value object
Throws:
SQLException - if thrown by the JDBC API
See Also:
Blob, Clob, Timestamp

extractDatabaseMetaData

public static Object extractDatabaseMetaData(DataSource dataSource,
                                             DatabaseMetaDataCallback action)
                                      throws MetaDataAccessException
Extract database meta data via the given DatabaseMetaDataCallback.

This method will open a connection to the database and retrieve the database metadata. Since this method is called before the exception translation feature is configured for a datasource, this method can not rely on the SQLException translation functionality.

Any exceptions will be wrapped in a MetaDataAccessException. This is a checked exception and any calling code should catch and handle this exception. You can just log the error and hope for the best, but there is probably a more serious error that will reappear when you try to access the database again.

Parameters:
dataSource - the DataSource to extract metadata for
action - callback that will do the actual work
Returns:
object containing the extracted information, as returned by the DatabaseMetaDataCallback's processMetaData method
Throws:
MetaDataAccessException - if meta data access failed

extractDatabaseMetaData

public static Object extractDatabaseMetaData(DataSource dataSource,
                                             String metaDataMethodName)
                                      throws MetaDataAccessException
Call the specified method on DatabaseMetaData for the given DataSource, and extract the invocation result.

Parameters:
dataSource - the DataSource to extract meta data for
metaDataMethodName - the name of the DatabaseMetaData method to call
Returns:
the object returned by the specified DatabaseMetaData method
Throws:
MetaDataAccessException - if we couldn't access the DatabaseMetaData or failed to invoke the specified method
See Also:
DatabaseMetaData

supportsBatchUpdates

public static boolean supportsBatchUpdates(Connection con)
Return whether the given JDBC driver supports JDBC 2.0 batch updates.

Typically invoked right before execution of a given set of statements: to decide whether the set of SQL statements should be executed through the JDBC 2.0 batch mechanism or simply in a traditional one-by-one fashion.

Logs a warning if the "supportsBatchUpdates" methods throws an exception and simply returns false in that case.

Parameters:
con - the Connection to check
Returns:
whether JDBC 2.0 batch updates are supported
See Also:
DatabaseMetaData.supportsBatchUpdates()

commonDatabaseName

public static String commonDatabaseName(String source)
Extract a common name for the database in use even if various drivers/platforms provide varying names.

Parameters:
source - the name as provided in database metedata
Returns:
the common name to be used

isNumeric

public static boolean isNumeric(int sqlType)
Check whether the given SQL type is numeric.

Parameters:
sqlType - the SQL type to be checked
Returns:
whether the type is numeric

lookupColumnName

public static String lookupColumnName(ResultSetMetaData resultSetMetaData,
                                      int columnIndex)
                               throws SQLException
Determine the column name to use. The column name is determined based on a lookup using ResultSetMetaData.

This method implementation takes into account recent clarifications expressed in the JDBC 4.0 specification:

columnLabel - the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column.

Parameters:
resultSetMetaData - the current meta data to use
columnIndex - the index of the column for the look up
Returns:
the column name to use
Throws:
SQLException - in case of lookup failure

convertUnderscoreNameToPropertyName

public static String convertUnderscoreNameToPropertyName(String name)
Convert a column name with underscores to the corresponding property name using "camel case". A name like "customer_number" would match a "customerNumber" property name.

Parameters:
name - the column name to be converted
Returns:
the name using "camel case"
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SQLErrorCodes

org.springframework.jdbc.support
Class SQLErrorCodes

java.lang.Object
    extended by  org.springframework.jdbc.support.SQLErrorCodes

public class SQLErrorCodes
extends Object

JavaBean for holding JDBC error codes for a particular database. Instances of this class are normally loaded through a bean factory.

Used by Spring's SQLErrorCodeSQLExceptionTranslator. The file "sql-error-codes.xml" in this package contains default SQLErrorCodes instances for various databases.

Author:
Thomas Risberg, Juergen Hoeller
See Also:
SQLErrorCodesFactory, SQLErrorCodeSQLExceptionTranslator

Constructor Summary
SQLErrorCodes()
Method Summary
String[] | getBadSqlGrammarCodes()
String[] | getCannotAcquireLockCodes()
String[] | getCannotSerializeTransactionCodes()
SQLExceptionTranslator | getCustomSqlExceptionTranslator()
CustomSQLErrorCodesTranslation[] | getCustomTranslations()
String[] | getDataAccessResourceFailureCodes()
String | getDatabaseProductName()
String[] | getDatabaseProductNames()
String[] | getDataIntegrityViolationCodes()
String[] | getDeadlockLoserCodes()
String[] | getDuplicateKeyCodes()
String[] | getInvalidResultSetAccessCodes()
String[] | getPermissionDeniedCodes()
String[] | getTransientDataAccessResourceCodes()
boolean | isUseSqlStateForTranslation()
void | setBadSqlGrammarCodes(String[] badSqlGrammarCodes)
void | setCannotAcquireLockCodes(String[] cannotAcquireLockCodes)
void | setCannotSerializeTransactionCodes(String[] cannotSerializeTransactionCodes)
void | setCustomSqlExceptionTranslatorClass(Class customSqlExceptionTranslatorClass)
void | setCustomTranslations(CustomSQLErrorCodesTranslation[] customTranslations)
void | setDataAccessResourceFailureCodes(String[] dataAccessResourceFailureCodes)
void | setDatabaseProductName(String databaseProductName) Set this property if the database name contains spaces, in which case we can not use the bean name for lookup.
void | setDatabaseProductNames(String[] databaseProductNames) Set this property to specify multiple database names that contains spaces, in which case we can not use bean names for lookup.
void | setDataIntegrityViolationCodes(String[] dataIntegrityViolationCodes)
void | setDeadlockLoserCodes(String[] deadlockLoserCodes)
void | setDuplicateKeyCodes(String[] duplicateKeyCodes)
void | setInvalidResultSetAccessCodes(String[] invalidResultSetAccessCodes)
void | setPermissionDeniedCodes(String[] permissionDeniedCodes)
void | setTransientDataAccessResourceCodes(String[] transientDataAccessResourceCodes)
void | setUseSqlStateForTranslation(boolean useStateCodeForTranslation) Set this property to true for databases that do not provide an error code but that do provide SQL State (this includes PostgreSQL).
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SQLErrorCodes

public SQLErrorCodes()
Method Detail

setDatabaseProductName

public void setDatabaseProductName(String databaseProductName)
Set this property if the database name contains spaces, in which case we can not use the bean name for lookup.

getDatabaseProductName

public String getDatabaseProductName()

setDatabaseProductNames

public void setDatabaseProductNames(String[] databaseProductNames)
Set this property to specify multiple database names that contains spaces, in which case we can not use bean names for lookup.

getDatabaseProductNames

public String[] getDatabaseProductNames()

setUseSqlStateForTranslation

public void setUseSqlStateForTranslation(boolean useStateCodeForTranslation)
Set this property to true for databases that do not provide an error code but that do provide SQL State (this includes PostgreSQL).

isUseSqlStateForTranslation

public boolean isUseSqlStateForTranslation()

getCustomSqlExceptionTranslator

public SQLExceptionTranslator getCustomSqlExceptionTranslator()

setCustomSqlExceptionTranslatorClass

public void setCustomSqlExceptionTranslatorClass(Class customSqlExceptionTranslatorClass)

setBadSqlGrammarCodes

public void setBadSqlGrammarCodes(String[] badSqlGrammarCodes)

getBadSqlGrammarCodes

public String[] getBadSqlGrammarCodes()

setInvalidResultSetAccessCodes

public void setInvalidResultSetAccessCodes(String[] invalidResultSetAccessCodes)

getInvalidResultSetAccessCodes

public String[] getInvalidResultSetAccessCodes()

getDuplicateKeyCodes

public String[] getDuplicateKeyCodes()

setDuplicateKeyCodes

public void setDuplicateKeyCodes(String[] duplicateKeyCodes)

setDataIntegrityViolationCodes

public void setDataIntegrityViolationCodes(String[] dataIntegrityViolationCodes)

getDataIntegrityViolationCodes

public String[] getDataIntegrityViolationCodes()

setPermissionDeniedCodes

public void setPermissionDeniedCodes(String[] permissionDeniedCodes)

getPermissionDeniedCodes

public String[] getPermissionDeniedCodes()

setDataAccessResourceFailureCodes

public void setDataAccessResourceFailureCodes(String[] dataAccessResourceFailureCodes)

getDataAccessResourceFailureCodes

public String[] getDataAccessResourceFailureCodes()

setTransientDataAccessResourceCodes

public void setTransientDataAccessResourceCodes(String[] transientDataAccessResourceCodes)

getTransientDataAccessResourceCodes

public String[] getTransientDataAccessResourceCodes()

setCannotAcquireLockCodes

public void setCannotAcquireLockCodes(String[] cannotAcquireLockCodes)

getCannotAcquireLockCodes

public String[] getCannotAcquireLockCodes()

setDeadlockLoserCodes

public void setDeadlockLoserCodes(String[] deadlockLoserCodes)

getDeadlockLoserCodes

public String[] getDeadlockLoserCodes()

setCannotSerializeTransactionCodes

public void setCannotSerializeTransactionCodes(String[] cannotSerializeTransactionCodes)

getCannotSerializeTransactionCodes

public String[] getCannotSerializeTransactionCodes()

setCustomTranslations

public void setCustomTranslations(CustomSQLErrorCodesTranslation[] customTranslations)

getCustomTranslations

public CustomSQLErrorCodesTranslation[] getCustomTranslations()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SQLErrorCodesFactory

org.springframework.jdbc.support
Class SQLErrorCodesFactory

java.lang.Object
    extended by  org.springframework.jdbc.support.SQLErrorCodesFactory

public class SQLErrorCodesFactory
extends Object

Factory for creating SQLErrorCodes based on the "databaseProductName" taken from the DatabaseMetaData.

Returns SQLErrorCodes populated with vendor codes defined in a configuration file named "sql-error-codes.xml". Reads the default file in this package if not overridden by a file in the root of the class path (for example in the "/WEB-INF/classes" directory).

Author:
Thomas Risberg, Rod Johnson, Juergen Hoeller
See Also:
DatabaseMetaData.getDatabaseProductName()

Field Summary
static String | SQL_ERROR_CODE_DEFAULT_PATH The name of default SQL error code files, loading from the class path.
static String | SQL_ERROR_CODE_OVERRIDE_PATH The name of custom SQL error codes file, loading from the root of the class path (e.g.
Constructor Summary
protected SQLErrorCodesFactory()
Create a new instance of the SQLErrorCodesFactory class.
Method Summary
SQLErrorCodes | getErrorCodes(DataSource dataSource) Return SQLErrorCodes for the given DataSource, evaluating "databaseProductName" from the DatabaseMetaData, or an empty error codes instance if no SQLErrorCodes were found.
SQLErrorCodes | getErrorCodes(String dbName) Return the SQLErrorCodes instance for the given database.
static SQLErrorCodesFactory | getInstance() Return the singleton instance.
protected Resource | loadResource(String path) Load the given resource from the class path.
SQLErrorCodes | registerDatabase(DataSource dataSource, String dbName) Associate the specified database name with the given DataSource.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

SQL_ERROR_CODE_OVERRIDE_PATH

public static final String SQL_ERROR_CODE_OVERRIDE_PATH
The name of custom SQL error codes file, loading from the root of the class path (e.g. from the "/WEB-INF/classes" directory).

See Also:
Constant Field Values

SQL_ERROR_CODE_DEFAULT_PATH

public static final String SQL_ERROR_CODE_DEFAULT_PATH
The name of default SQL error code files, loading from the class path.

See Also:
Constant Field Values
Constructor Detail

SQLErrorCodesFactory

protected SQLErrorCodesFactory()
Create a new instance of the SQLErrorCodesFactory class.

Not public to enforce Singleton design pattern. Would be private except to allow testing via overriding the loadResource(String) method.

Do not subclass in application code.

See Also:
loadResource(String)
Method Detail

getInstance

public static SQLErrorCodesFactory getInstance()
Return the singleton instance.

loadResource

protected Resource loadResource(String path)
Load the given resource from the class path.

Not to be overridden by application developers, who should obtain instances of this class from the static getInstance() method.

Protected for testability.

Parameters:
path - resource path; either a custom path or one of either SQL_ERROR_CODE_DEFAULT_PATH or SQL_ERROR_CODE_OVERRIDE_PATH.
Returns:
the resource, or null if the resource wasn't found
See Also:
getInstance()

getErrorCodes

public SQLErrorCodes getErrorCodes(String dbName)
Return the SQLErrorCodes instance for the given database.

No need for a database metadata lookup.

Parameters:
dbName - the database name (must not be null)
Returns:
the SQLErrorCodes instance for the given database
Throws:
IllegalArgumentException - if the supplied database name is null

getErrorCodes

public SQLErrorCodes getErrorCodes(DataSource dataSource)
Return SQLErrorCodes for the given DataSource, evaluating "databaseProductName" from the DatabaseMetaData, or an empty error codes instance if no SQLErrorCodes were found.

Parameters:
dataSource - the DataSource identifying the database
Returns:
the corresponding SQLErrorCodes object
See Also:
DatabaseMetaData.getDatabaseProductName()

registerDatabase

public SQLErrorCodes registerDatabase(DataSource dataSource,
                                      String dbName)
Associate the specified database name with the given DataSource.

Parameters:
dataSource - the DataSource identifying the database
dbName - the corresponding database name as stated in the error codes definition file (must not be null)
Returns:
the corresponding SQLErrorCodes object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SQLErrorCodeSQLExceptionTranslator

org.springframework.jdbc.support
Class SQLErrorCodeSQLExceptionTranslator

java.lang.Object
    extended by  org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator
        extended by  org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator
All Implemented Interfaces:
SQLExceptionTranslator
public class SQLErrorCodeSQLExceptionTranslator
extends AbstractFallbackSQLExceptionTranslator

Implementation of SQLExceptionTranslator that analyzes vendor-specific error codes. More precise than an implementation based on SQL state, but heavily vendor-specific.

This class applies the following matching rules:

  • Try custom translation implemented by any subclass. Note that this class is concrete and is typically used itself, in which case this rule doesn't apply.
  • Apply error code matching. Error codes are obtained from the SQLErrorCodesFactory by default. This factory loads a "sql-error-codes.xml" file from the class path, defining error code mappings for database names from database metadata.
  • Fallback to a fallback translator. SQLStateSQLExceptionTranslator is the default fallback translator, analyzing the exception's SQL state only. On Java 6 which introduces its own SQLException subclass hierarchy, we will use SQLExceptionSubclassTranslator by default, which in turns falls back to Spring's own SQL state translation when not encountering specific subclasses.

The configuration file named "sql-error-codes.xml" is by default read from this package. It can be overridden through a file of the same name in the root of the class path (e.g. in the "/WEB-INF/classes" directory), as long as the Spring JDBC package is loaded from the same ClassLoader.

Author:
Rod Johnson, Thomas Risberg, Juergen Hoeller
See Also:
SQLErrorCodesFactory, SQLStateSQLExceptionTranslator

Field Summary
Fields inherited from class org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator
logger
Constructor Summary
SQLErrorCodeSQLExceptionTranslator()
Constructor for use as a JavaBean.
SQLErrorCodeSQLExceptionTranslator(DataSource dataSource)
Create a SQL error code translator for the given DataSource.
SQLErrorCodeSQLExceptionTranslator(SQLErrorCodes sec)
Create a SQLErrorCode translator given these error codes.
SQLErrorCodeSQLExceptionTranslator(String dbName)
Create a SQL error code translator for the given database product name.
Method Summary
protected DataAccessException | createCustomException(String task, String sql, SQLException sqlEx, Class exceptionClass) Create a custom DataAccessException, based on a given exception class from a CustomSQLErrorCodesTranslation definition.
protected DataAccessException | customTranslate(String task, String sql, SQLException sqlEx) Subclasses can override this method to attempt a custom mapping from SQLException to DataAccessException.
protected DataAccessException | doTranslate(String task, String sql, SQLException ex) Template method for actually translating the given exception.
SQLErrorCodes | getSqlErrorCodes() Return the error codes used by this translator.
void | setDatabaseProductName(String dbName) Set the database product name for this translator.
void | setDataSource(DataSource dataSource) Set the DataSource for this translator.
void | setSqlErrorCodes(SQLErrorCodes sec) Set custom error codes to be used for translation.
Methods inherited from class org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator
buildMessage, getFallbackTranslator, setFallbackTranslator, translate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SQLErrorCodeSQLExceptionTranslator

public SQLErrorCodeSQLExceptionTranslator()
Constructor for use as a JavaBean. The SqlErrorCodes or DataSource property must be set.

SQLErrorCodeSQLExceptionTranslator

public SQLErrorCodeSQLExceptionTranslator(DataSource dataSource)
Create a SQL error code translator for the given DataSource. Invoking this constructor will cause a Connection to be obtained from the DataSource to get the metadata.

Parameters:
dataSource - DataSource to use to find metadata and establish which error codes are usable
See Also:
SQLErrorCodesFactory

SQLErrorCodeSQLExceptionTranslator

public SQLErrorCodeSQLExceptionTranslator(String dbName)
Create a SQL error code translator for the given database product name. Invoking this constructor will avoid obtaining a Connection from the DataSource to get the metadata.

Parameters:
dbName - the database product name that identifies the error codes entry
See Also:
SQLErrorCodesFactory, DatabaseMetaData.getDatabaseProductName()

SQLErrorCodeSQLExceptionTranslator

public SQLErrorCodeSQLExceptionTranslator(SQLErrorCodes sec)
Create a SQLErrorCode translator given these error codes. Does not require a database metadata lookup to be performed using a connection.

Parameters:
sec - error codes
Method Detail

setDataSource

public void setDataSource(DataSource dataSource)
Set the DataSource for this translator.

Setting this property will cause a Connection to be obtained from the DataSource to get the metadata.

Parameters:
dataSource - DataSource to use to find metadata and establish which error codes are usable
See Also:
SQLErrorCodesFactory.getErrorCodes(javax.sql.DataSource), DatabaseMetaData.getDatabaseProductName()

setDatabaseProductName

public void setDatabaseProductName(String dbName)
Set the database product name for this translator.

Setting this property will avoid obtaining a Connection from the DataSource to get the metadata.

Parameters:
dbName - the database product name that identifies the error codes entry
See Also:
SQLErrorCodesFactory.getErrorCodes(String), DatabaseMetaData.getDatabaseProductName()

setSqlErrorCodes

public void setSqlErrorCodes(SQLErrorCodes sec)
Set custom error codes to be used for translation.

Parameters:
sec - custom error codes to use

getSqlErrorCodes

public SQLErrorCodes getSqlErrorCodes()
Return the error codes used by this translator. Usually determined via a DataSource.

See Also:
setDataSource(javax.sql.DataSource)

doTranslate

protected DataAccessException doTranslate(String task,
                                          String sql,
                                          SQLException ex)
Description copied from class: AbstractFallbackSQLExceptionTranslator
Template method for actually translating the given exception.

The passed-in arguments will have been pre-checked. Furthermore, this method is allowed to return null to indicate that no exception match has been found and that fallback translation should kick in.

Specified by:
doTranslate in class AbstractFallbackSQLExceptionTranslator
Parameters:
task - readable text describing the task being attempted
sql - SQL query or update that caused the problem (may be null)
ex - the offending SQLException
Returns:
the DataAccessException, wrapping the SQLException; or null if no exception match found

customTranslate

protected DataAccessException customTranslate(String task,
                                              String sql,
                                              SQLException sqlEx)
Subclasses can override this method to attempt a custom mapping from SQLException to DataAccessException.

Parameters:
task - readable text describing the task being attempted
sql - SQL query or update that caused the problem. May be null.
sqlEx - the offending SQLException
Returns:
null if no custom translation was possible, otherwise a DataAccessException resulting from custom translation. This exception should include the sqlEx parameter as a nested root cause. This implementation always returns null, meaning that the translator always falls back to the default error codes.

createCustomException

protected DataAccessException createCustomException(String task,
                                                    String sql,
                                                    SQLException sqlEx,
                                                    Class exceptionClass)
Create a custom DataAccessException, based on a given exception class from a CustomSQLErrorCodesTranslation definition.

Parameters:
task - readable text describing the task being attempted
sql - SQL query or update that caused the problem. May be null.
sqlEx - the offending SQLException
exceptionClass - the exception class to use, as defined in the CustomSQLErrorCodesTranslation definition
Returns:
null if the custom exception could not be created, otherwise the resulting DataAccessException. This exception should include the sqlEx parameter as a nested root cause.
See Also:
CustomSQLErrorCodesTranslation.setExceptionClass(java.lang.Class)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SQLExceptionSubclassTranslator

org.springframework.jdbc.support
Class SQLExceptionSubclassTranslator

java.lang.Object
    extended by  org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator
        extended by  org.springframework.jdbc.support.SQLExceptionSubclassTranslator
All Implemented Interfaces:
SQLExceptionTranslator
public class SQLExceptionSubclassTranslator
extends AbstractFallbackSQLExceptionTranslator

SQLExceptionTranslator implementation which analyzes the specific SQLException subclass thrown by the JDBC driver.

This is only available with JDBC 4.0 and later drivers when using Java 6 or later. Falls back to a standard SQLStateSQLExceptionTranslator if the JDBC driver does not actually expose JDBC 4 compliant SQLException subclasses.

Since:
2.5
Author:
Thomas Risberg, Juergen Hoeller
See Also:
SQLTransientException, SQLTransientException, SQLRecoverableException

Field Summary
Fields inherited from class org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator
logger
Constructor Summary
SQLExceptionSubclassTranslator()
Method Summary
protected  DataAccessException doTranslate(String task, String sql, SQLException ex)
Template method for actually translating the given exception.
Methods inherited from class org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator
buildMessage, getFallbackTranslator, setFallbackTranslator, translate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SQLExceptionSubclassTranslator

public SQLExceptionSubclassTranslator()
Method Detail

doTranslate

protected DataAccessException doTranslate(String task,
                                          String sql,
                                          SQLException ex)
Description copied from class: AbstractFallbackSQLExceptionTranslator
Template method for actually translating the given exception.

The passed-in arguments will have been pre-checked. Furthermore, this method is allowed to return null to indicate that no exception match has been found and that fallback translation should kick in.

Specified by:
doTranslate in class AbstractFallbackSQLExceptionTranslator
Parameters:
task - readable text describing the task being attempted
sql - SQL query or update that caused the problem (may be null)
ex - the offending SQLException
Returns:
the DataAccessException, wrapping the SQLException; or null if no exception match found
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SQLStateSQLExceptionTranslator

org.springframework.jdbc.support
Class SQLStateSQLExceptionTranslator

java.lang.Object
    extended by  org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator
        extended by  org.springframework.jdbc.support.SQLStateSQLExceptionTranslator
All Implemented Interfaces:
SQLExceptionTranslator
public class SQLStateSQLExceptionTranslator
extends AbstractFallbackSQLExceptionTranslator

SQLExceptionTranslator implementation that analyzes the SQL state in the SQLException based on the first two digits (the SQL state "class"). Detects standard SQL state values and well-known vendor-specific SQL states.

Not able to diagnose all problems, but is portable between databases and does not require special initialization (no database vendor detection, etc.). For more precise translation, consider SQLErrorCodeSQLExceptionTranslator.

Author:
Rod Johnson, Juergen Hoeller, Thomas Risberg
See Also:
SQLException.getSQLState(), SQLErrorCodeSQLExceptionTranslator

Field Summary
Fields inherited from class org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator
logger
Constructor Summary
SQLStateSQLExceptionTranslator()
Method Summary
protected  DataAccessException doTranslate(String task, String sql, SQLException ex)
Template method for actually translating the given exception.
Methods inherited from class org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator
buildMessage, getFallbackTranslator, setFallbackTranslator, translate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SQLStateSQLExceptionTranslator

public SQLStateSQLExceptionTranslator()
Method Detail

doTranslate

protected DataAccessException doTranslate(String task,
                                          String sql,
                                          SQLException ex)
Description copied from class: AbstractFallbackSQLExceptionTranslator
Template method for actually translating the given exception.

The passed-in arguments will have been pre-checked. Furthermore, this method is allowed to return null to indicate that no exception match has been found and that fallback translation should kick in.

Specified by:
doTranslate in class AbstractFallbackSQLExceptionTranslator
Parameters:
task - readable text describing the task being attempted
sql - SQL query or update that caused the problem (may be null)
ex - the offending SQLException
Returns:
the DataAccessException, wrapping the SQLException; or null if no exception match found
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MetaDataAccessException

org.springframework.jdbc.support
Class MetaDataAccessException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  org.springframework.core.NestedCheckedException
                extended by  org.springframework.jdbc.support.MetaDataAccessException
All Implemented Interfaces:
Serializable
public class MetaDataAccessException
extends NestedCheckedException

Exception indicating that something went wrong during JDBC metadata lookup.

This is a checked exception since we want it to be caught, logged and handled rather than cause the application to fail. Failure to read JDBC metadata is usually not a fatal problem.

Since:
1.0.1
Author:
Thomas Risberg
See Also:
Serialized Form

Constructor Summary
MetaDataAccessException(String msg)
Constructor for MetaDataAccessException.
MetaDataAccessException(String msg, Throwable cause)
Constructor for MetaDataAccessException.
Method Summary
Methods inherited from class org.springframework.core.NestedCheckedException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

MetaDataAccessException

public MetaDataAccessException(String msg)
Constructor for MetaDataAccessException.

Parameters:
msg - the detail message

MetaDataAccessException

public MetaDataAccessException(String msg,
                               Throwable cause)
Constructor for MetaDataAccessException.

Parameters:
msg - the detail message
cause - the root cause from the data access API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.jdbc.support.incrementer

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jdbc.support.incrementer

Provides a support framework for incrementing database table values via sequences, with implementations for various databases.

See:
Description

Interface Summary
DataFieldMaxValueIncrementer Interface that defines contract of incrementing any data store field's maximum value.

Class Summary
AbstractColumnMaxValueIncrementer | Abstract base class for DataFieldMaxValueIncrementer implementations that use a column in a custom sequence table.
AbstractDataFieldMaxValueIncrementer | Base implementation of DataFieldMaxValueIncrementer that delegates to a single AbstractDataFieldMaxValueIncrementer.getNextKey() template method that returns a long.
AbstractSequenceMaxValueIncrementer | Abstract base class for DataFieldMaxValueIncrementer implementations that use a database sequence.
DB2MainframeSequenceMaxValueIncrementer | DataFieldMaxValueIncrementer that retrieves the next value of a given sequence on DB2/390 or DB2/400.
DB2SequenceMaxValueIncrementer | DataFieldMaxValueIncrementer that retrieves the next value of a given sequence on DB2 UDB (for Unix and Windows).
DerbyMaxValueIncrementer | DataFieldMaxValueIncrementer that increments the maximum value of a given Derby table with the equivalent of an auto-increment column.
H2SequenceMaxValueIncrementer | DataFieldMaxValueIncrementer that retrieves the next value of a given H2 Database sequence.
HsqlMaxValueIncrementer | DataFieldMaxValueIncrementer that increments the maximum value of a given HSQL table with the equivalent of an auto-increment column.
HsqlSequenceMaxValueIncrementer | DataFieldMaxValueIncrementer that retrieves the next value of a given HSQL sequence.
MySQLMaxValueIncrementer | DataFieldMaxValueIncrementer that increments the maximum value of a given MySQL table with the equivalent of an auto-increment column.
OracleSequenceMaxValueIncrementer | DataFieldMaxValueIncrementer that retrieves the next value of a given Oracle sequence.
PostgreSQLSequenceMaxValueIncrementer | DataFieldMaxValueIncrementer that retrieves the next value of a given PostgreSQL sequence.
SqlServerMaxValueIncrementer | DataFieldMaxValueIncrementer that increments the maximum value of a given SQL Server table with the equivalent of an auto-increment column.
SybaseMaxValueIncrementer | DataFieldMaxValueIncrementer that increments the maximum value of a given SQL Server table with the equivalent of an auto-increment column.

Package org.springframework.jdbc.support.incrementer Description

Provides a support framework for incrementing database table values via sequences, with implementations for various databases.

Can be used independently, for example in custom JDBC access code.


org.springframework.jdbc.support.incrementer Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jdbc.support.incrementer

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer (implements org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer, org.springframework.beans.factory.InitializingBean)
      • org.springframework.jdbc.support.incrementer.AbstractColumnMaxValueIncrementer
        • org.springframework.jdbc.support.incrementer.DerbyMaxValueIncrementer
        • org.springframework.jdbc.support.incrementer.HsqlMaxValueIncrementer
        • org.springframework.jdbc.support.incrementer.MySQLMaxValueIncrementer
        • org.springframework.jdbc.support.incrementer.SqlServerMaxValueIncrementer
        • org.springframework.jdbc.support.incrementer.SybaseMaxValueIncrementer
      • org.springframework.jdbc.support.incrementer.AbstractSequenceMaxValueIncrementer
        • org.springframework.jdbc.support.incrementer.DB2MainframeSequenceMaxValueIncrementer
        • org.springframework.jdbc.support.incrementer.DB2SequenceMaxValueIncrementer
        • org.springframework.jdbc.support.incrementer.H2SequenceMaxValueIncrementer
        • org.springframework.jdbc.support.incrementer.HsqlSequenceMaxValueIncrementer
        • org.springframework.jdbc.support.incrementer.OracleSequenceMaxValueIncrementer
        • org.springframework.jdbc.support.incrementer.PostgreSQLSequenceMaxValueIncrementer

Interface Hierarchy

  • org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer


DataFieldMaxValueIncrementer

org.springframework.jdbc.support.incrementer
Interface DataFieldMaxValueIncrementer

All Known Implementing Classes:
AbstractColumnMaxValueIncrementer, AbstractDataFieldMaxValueIncrementer, AbstractSequenceMaxValueIncrementer, DB2MainframeSequenceMaxValueIncrementer, DB2SequenceMaxValueIncrementer, DerbyMaxValueIncrementer, H2SequenceMaxValueIncrementer, HsqlMaxValueIncrementer, HsqlSequenceMaxValueIncrementer, MySQLMaxValueIncrementer, OracleSequenceMaxValueIncrementer, PostgreSQLSequenceMaxValueIncrementer, SqlServerMaxValueIncrementer, SybaseMaxValueIncrementer
public interface DataFieldMaxValueIncrementer

Interface that defines contract of incrementing any data store field's maximum value. Works much like a sequence number generator.

Typical implementations may use standard SQL, native RDBMS sequences or Stored Procedures to do the job.

Author:
Dmitriy Kopylenko, Jean-Pierre Pawlak, Juergen Hoeller

Method Summary
int | nextIntValue() Increment the data store field's max value as int.
long | nextLongValue() Increment the data store field's max value as long.
String | nextStringValue() Increment the data store field's max value as String.

Method Detail

nextIntValue

int nextIntValue()
                 throws DataAccessException
Increment the data store field's max value as int.

Returns:
int next data store value such as max + 1
Throws:
DataAccessException - in case of errors

nextLongValue

long nextLongValue()
                   throws DataAccessException
Increment the data store field's max value as long.

Returns:
int next data store value such as max + 1
Throws:
DataAccessException - in case of errors

nextStringValue

String nextStringValue()
                       throws DataAccessException
Increment the data store field's max value as String.

Returns:
next data store value such as max + 1
Throws:
DataAccessException - in case of errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractColumnMaxValueIncrementer

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.support.incrementer
Class AbstractColumnMaxValueIncrementer

java.lang.Object
    extended by  org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
        extended by  org.springframework.jdbc.support.incrementer.AbstractColumnMaxValueIncrementer
All Implemented Interfaces:
InitializingBean, DataFieldMaxValueIncrementer
Direct Known Subclasses:
DerbyMaxValueIncrementer, HsqlMaxValueIncrementer, MySQLMaxValueIncrementer, SqlServerMaxValueIncrementer, SybaseMaxValueIncrementer
public abstract class AbstractColumnMaxValueIncrementer
extends AbstractDataFieldMaxValueIncrementer

Abstract base class for DataFieldMaxValueIncrementer implementations that use a column in a custom sequence table. Subclasses need to provide the specific handling of that table in their AbstractDataFieldMaxValueIncrementer.getNextKey() implementation..

Since:
2.5.3
Author:
Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
paddingLength
Constructor Summary
AbstractColumnMaxValueIncrementer()
Default constructor for bean property style usage.
AbstractColumnMaxValueIncrementer(DataSource dataSource, String incrementerName, String columnName)
Convenience constructor.
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
int | getCacheSize() Return the number of buffered keys.
String | getColumnName() Return the name of the column in the sequence table.
void | setCacheSize(int cacheSize) Set the number of buffered keys.
void | setColumnName(String columnName) Set the name of the column in the sequence table.
Methods inherited from class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
getDataSource, getIncrementerName, getNextKey, getPaddingLength, nextIntValue, nextLongValue, nextStringValue, setDataSource, setIncrementerName, setPaddingLength
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractColumnMaxValueIncrementer

public AbstractColumnMaxValueIncrementer()
Default constructor for bean property style usage.

See Also:
AbstractDataFieldMaxValueIncrementer.setDataSource(javax.sql.DataSource),
AbstractDataFieldMaxValueIncrementer.setIncrementerName(java.lang.String),
setColumnName(java.lang.String)

AbstractColumnMaxValueIncrementer

public AbstractColumnMaxValueIncrementer(DataSource dataSource,
                                         String incrementerName,
                                         String columnName)
Convenience constructor.

Parameters:
dataSource - the DataSource to use
incrementerName - the name of the sequence/table to use
columnName - the name of the column in the sequence table to use
Method Detail

setColumnName

public void setColumnName(String columnName)
Set the name of the column in the sequence table.

getColumnName

public String getColumnName()
Return the name of the column in the sequence table.

setCacheSize

public void setCacheSize(int cacheSize)
Set the number of buffered keys.

getCacheSize

public int getCacheSize()
Return the number of buffered keys.

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class AbstractDataFieldMaxValueIncrementer
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractDataFieldMaxValueIncrementer

org.springframework.jdbc.support.incrementer
Class AbstractDataFieldMaxValueIncrementer

java.lang.Object
    extended by  org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
All Implemented Interfaces:
InitializingBean, DataFieldMaxValueIncrementer
Direct Known Subclasses:
AbstractColumnMaxValueIncrementer, AbstractSequenceMaxValueIncrementer
public abstract class AbstractDataFieldMaxValueIncrementer
extends Object
implements DataFieldMaxValueIncrementer, InitializingBean

Base implementation of DataFieldMaxValueIncrementer that delegates to a single getNextKey() template method that returns a long. Uses longs for String values, padding with zeroes if required.

Author:
Dmitriy Kopylenko, Juergen Hoeller, Jean-Pierre Pawlak, Juergen Hoeller

Field Summary
protected  int paddingLength
The length to which a string result should be pre-pended with zeroes
Constructor Summary
AbstractDataFieldMaxValueIncrementer()
Default constructor for bean property style usage.
AbstractDataFieldMaxValueIncrementer(DataSource dataSource, String incrementerName)
Convenience constructor.
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
DataSource | getDataSource() Return the data source to retrieve the value from.
String | getIncrementerName() Return the name of the sequence/table.
protected abstract long | getNextKey() Determine the next key to use, as a long.
int | getPaddingLength() Return the padding length for String values.
int | nextIntValue() Increment the data store field's max value as int.
long | nextLongValue() Increment the data store field's max value as long.
String | nextStringValue() Increment the data store field's max value as String.
void | setDataSource(DataSource dataSource) Set the data source to retrieve the value from.
void | setIncrementerName(String incrementerName) Set the name of the sequence/table.
void | setPaddingLength(int paddingLength) Set the padding length, i.e.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

paddingLength

protected int paddingLength
The length to which a string result should be pre-pended with zeroes

Constructor Detail

AbstractDataFieldMaxValueIncrementer

public AbstractDataFieldMaxValueIncrementer()
Default constructor for bean property style usage.

See Also:
setDataSource(javax.sql.DataSource), setIncrementerName(java.lang.String)

AbstractDataFieldMaxValueIncrementer

public AbstractDataFieldMaxValueIncrementer(DataSource dataSource,
                                            String incrementerName)
Convenience constructor.

Parameters:
dataSource - the DataSource to use
incrementerName - the name of the sequence/table to use
Method Detail

setDataSource

public void setDataSource(DataSource dataSource)
Set the data source to retrieve the value from.

getDataSource

public DataSource getDataSource()
Return the data source to retrieve the value from.

setIncrementerName

public void setIncrementerName(String incrementerName)
Set the name of the sequence/table.

getIncrementerName

public String getIncrementerName()
Return the name of the sequence/table.

setPaddingLength

public void setPaddingLength(int paddingLength)
Set the padding length, i.e. the length to which a string result should be pre-pended with zeroes.

getPaddingLength

public int getPaddingLength()
Return the padding length for String values.

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

nextIntValue

public int nextIntValue()
                 throws DataAccessException
Description copied from interface: DataFieldMaxValueIncrementer
Increment the data store field's max value as int.

Specified by:
nextIntValue in interface DataFieldMaxValueIncrementer
Returns:
int next data store value such as max + 1
Throws:
DataAccessException - in case of errors

nextLongValue

public long nextLongValue()
                   throws DataAccessException
Description copied from interface: DataFieldMaxValueIncrementer
Increment the data store field's max value as long.

Specified by:
nextLongValue in interface DataFieldMaxValueIncrementer
Returns:
int next data store value such as max + 1
Throws:
DataAccessException - in case of errors

nextStringValue

public String nextStringValue()
                       throws DataAccessException
Description copied from interface: DataFieldMaxValueIncrementer
Increment the data store field's max value as String.

Specified by:
nextStringValue in interface DataFieldMaxValueIncrementer
Returns:
next data store value such as max + 1
Throws:
DataAccessException - in case of errors

getNextKey

protected abstract long getNextKey()
Determine the next key to use, as a long.

Returns:
the key to use as a long. It will eventually be converted later in another format by the public concrete methods of this class.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractSequenceMaxValueIncrementer

org.springframework.jdbc.support.incrementer
Class AbstractSequenceMaxValueIncrementer

java.lang.Object
    extended by  org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
        extended by  org.springframework.jdbc.support.incrementer.AbstractSequenceMaxValueIncrementer
All Implemented Interfaces:
InitializingBean, DataFieldMaxValueIncrementer
Direct Known Subclasses:
DB2MainframeSequenceMaxValueIncrementer, DB2SequenceMaxValueIncrementer, H2SequenceMaxValueIncrementer, HsqlSequenceMaxValueIncrementer, OracleSequenceMaxValueIncrementer, PostgreSQLSequenceMaxValueIncrementer
public abstract class AbstractSequenceMaxValueIncrementer
extends AbstractDataFieldMaxValueIncrementer

Abstract base class for DataFieldMaxValueIncrementer implementations that use a database sequence. Subclasses need to provide the database-specific SQL to use.

Since:
26.02.2004
Author:
Juergen Hoeller
See Also:
getSequenceQuery()

Field Summary
Fields inherited from class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
paddingLength
Constructor Summary
AbstractSequenceMaxValueIncrementer()
Default constructor for bean property style usage.
AbstractSequenceMaxValueIncrementer(DataSource dataSource, String incrementerName)
Convenience constructor.
Method Summary
protected  long getNextKey()
Executes the SQL as specified by getSequenceQuery().
protected abstract  String getSequenceQuery()
Return the database-specific query to use for retrieving a sequence value.
Methods inherited from class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
afterPropertiesSet, getDataSource, getIncrementerName, getPaddingLength, nextIntValue, nextLongValue, nextStringValue, setDataSource, setIncrementerName, setPaddingLength
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractSequenceMaxValueIncrementer

public AbstractSequenceMaxValueIncrementer()
Default constructor for bean property style usage.

See Also:
AbstractDataFieldMaxValueIncrementer.setDataSource(javax.sql.DataSource), AbstractDataFieldMaxValueIncrementer.setIncrementerName(java.lang.String)

AbstractSequenceMaxValueIncrementer

public AbstractSequenceMaxValueIncrementer(DataSource dataSource,
                                           String incrementerName)
Convenience constructor.

Parameters:
dataSource - the DataSource to use
incrementerName - the name of the sequence/table to use
Method Detail

getNextKey

protected long getNextKey()
                   throws DataAccessException
Executes the SQL as specified by getSequenceQuery().

Specified by:
getNextKey in class AbstractDataFieldMaxValueIncrementer
Returns:
the key to use as a long. It will eventually be converted later in another format by the public concrete methods of this class.
Throws:
DataAccessException

getSequenceQuery

protected abstract String getSequenceQuery()
Return the database-specific query to use for retrieving a sequence value.

The provided SQL is supposed to result in a single row with a single column that allows for extracting a long value.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DB2MainframeSequenceMaxValueIncrementer

org.springframework.jdbc.support.incrementer
Class DB2MainframeSequenceMaxValueIncrementer

java.lang.Object
    extended by  org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
        extended by  org.springframework.jdbc.support.incrementer.AbstractSequenceMaxValueIncrementer
            extended by  org.springframework.jdbc.support.incrementer.DB2MainframeSequenceMaxValueIncrementer
All Implemented Interfaces:
InitializingBean, DataFieldMaxValueIncrementer
public class DB2MainframeSequenceMaxValueIncrementer
extends AbstractSequenceMaxValueIncrementer

DataFieldMaxValueIncrementer that retrieves the next value of a given sequence on DB2/390 or DB2/400. Thanks to Jens Eickmeyer for the suggestion!

Since:
2.5.3
Author:
Juergen Hoeller
See Also:
DB2SequenceMaxValueIncrementer

Field Summary
Fields inherited from class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
paddingLength
Constructor Summary
DB2MainframeSequenceMaxValueIncrementer()
Default constructor for bean property style usage.
DB2MainframeSequenceMaxValueIncrementer(DataSource dataSource, String incrementerName)
Convenience constructor.
Method Summary
protected  String getSequenceQuery()
Return the database-specific query to use for retrieving a sequence value.
Methods inherited from class org.springframework.jdbc.support.incrementer.AbstractSequenceMaxValueIncrementer
getNextKey
Methods inherited from class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
afterPropertiesSet, getDataSource, getIncrementerName, getPaddingLength, nextIntValue, nextLongValue, nextStringValue, setDataSource, setIncrementerName, setPaddingLength
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DB2MainframeSequenceMaxValueIncrementer

public DB2MainframeSequenceMaxValueIncrementer()
Default constructor for bean property style usage.

See Also:
AbstractDataFieldMaxValueIncrementer.setDataSource(javax.sql.DataSource), AbstractDataFieldMaxValueIncrementer.setIncrementerName(java.lang.String)

DB2MainframeSequenceMaxValueIncrementer

public DB2MainframeSequenceMaxValueIncrementer(DataSource dataSource,
                                               String incrementerName)
Convenience constructor.

Parameters:
dataSource - the DataSource to use
incrementerName - the name of the sequence/table to use
Method Detail

getSequenceQuery

protected String getSequenceQuery()
Description copied from class: AbstractSequenceMaxValueIncrementer
Return the database-specific query to use for retrieving a sequence value.

The provided SQL is supposed to result in a single row with a single column that allows for extracting a long value.

Specified by:
getSequenceQuery in class AbstractSequenceMaxValueIncrementer
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DB2SequenceMaxValueIncrementer

org.springframework.jdbc.support.incrementer
Class DB2SequenceMaxValueIncrementer

java.lang.Object
    extended by  org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
        extended by  org.springframework.jdbc.support.incrementer.AbstractSequenceMaxValueIncrementer
            extended by  org.springframework.jdbc.support.incrementer.DB2SequenceMaxValueIncrementer
All Implemented Interfaces:
InitializingBean, DataFieldMaxValueIncrementer
public class DB2SequenceMaxValueIncrementer
extends AbstractSequenceMaxValueIncrementer

DataFieldMaxValueIncrementer that retrieves the next value of a given sequence on DB2 UDB (for Unix and Windows). Thanks to Mark MacMahon for the suggestion!

Since:
1.1.3
Author:
Juergen Hoeller
See Also:
DB2MainframeSequenceMaxValueIncrementer

Field Summary
Fields inherited from class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
paddingLength
Constructor Summary
DB2SequenceMaxValueIncrementer()
Default constructor for bean property style usage.
DB2SequenceMaxValueIncrementer(DataSource dataSource, String incrementerName)
Convenience constructor.
Method Summary
protected  String getSequenceQuery()
Return the database-specific query to use for retrieving a sequence value.
Methods inherited from class org.springframework.jdbc.support.incrementer.AbstractSequenceMaxValueIncrementer
getNextKey
Methods inherited from class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
afterPropertiesSet, getDataSource, getIncrementerName, getPaddingLength, nextIntValue, nextLongValue, nextStringValue, setDataSource, setIncrementerName, setPaddingLength
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DB2SequenceMaxValueIncrementer

public DB2SequenceMaxValueIncrementer()
Default constructor for bean property style usage.

See Also:
AbstractDataFieldMaxValueIncrementer.setDataSource(javax.sql.DataSource), AbstractDataFieldMaxValueIncrementer.setIncrementerName(java.lang.String)

DB2SequenceMaxValueIncrementer

public DB2SequenceMaxValueIncrementer(DataSource dataSource,
                                      String incrementerName)
Convenience constructor.

Parameters:
dataSource - the DataSource to use
incrementerName - the name of the sequence/table to use
Method Detail

getSequenceQuery

protected String getSequenceQuery()
Description copied from class: AbstractSequenceMaxValueIncrementer
Return the database-specific query to use for retrieving a sequence value.

The provided SQL is supposed to result in a single row with a single column that allows for extracting a long value.

Specified by:
getSequenceQuery in class AbstractSequenceMaxValueIncrementer
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DerbyMaxValueIncrementer

org.springframework.jdbc.support.incrementer
Class DerbyMaxValueIncrementer

java.lang.Object
    extended by  org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
        extended by  org.springframework.jdbc.support.incrementer.AbstractColumnMaxValueIncrementer
            extended by  org.springframework.jdbc.support.incrementer.DerbyMaxValueIncrementer
All Implemented Interfaces:
InitializingBean, DataFieldMaxValueIncrementer
public class DerbyMaxValueIncrementer
extends AbstractColumnMaxValueIncrementer

DataFieldMaxValueIncrementer that increments the maximum value of a given Derby table with the equivalent of an auto-increment column. Note: If you use this class, your Derby key column should NOT be defined as an IDENTITY column, as the sequence table does the job.

The sequence is kept in a table. There should be one sequence table per table that needs an auto-generated key.

Derby requires an additional column to be used for the insert since it is impossible to insert a null into the identity column and have the value generated. This is solved by providing the name of a dummy column that also must be created in the sequence table.

Example:

create table tab (id int not null primary key, text varchar(100));
 create table tab_sequence (value int generated always as identity, dummy char(1));
 insert into tab_sequence (dummy) values(null);
If "cacheSize" is set, the intermediate values are served without querying the database. If the server or your application is stopped or crashes or a transaction is rolled back, the unused values will never be served. The maximum hole size in numbering is consequently the value of cacheSize. HINT: Since Derby supports the JDBC 3.0 getGeneratedKeys method, it is recommended to use IDENTITY columns directly in the tables and then utilizing a KeyHolder when calling the with the update(PreparedStatementCreator psc, KeyHolder generatedKeyHolder) method of the JdbcTemplate.

Thanks to Endre Stolsvik for the suggestion!

Since:
2.5
Author:
Thomas Risberg, Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
paddingLength
Constructor Summary
DerbyMaxValueIncrementer()
Default constructor for bean property style usage.
DerbyMaxValueIncrementer(DataSource dataSource, String incrementerName, String columnName)
Convenience constructor.
DerbyMaxValueIncrementer(DataSource dataSource, String incrementerName, String columnName, String dummyName)
Convenience constructor.
Method Summary
String | getDummyName() Return the name of the dummy column.
protected long | getNextKey() Determine the next key to use, as a long.
void | setDummyName(String dummyName) Set the name of the dummy column.
Methods inherited from class org.springframework.jdbc.support.incrementer.AbstractColumnMaxValueIncrementer
afterPropertiesSet, getCacheSize, getColumnName, setCacheSize, setColumnName
Methods inherited from class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
getDataSource, getIncrementerName, getPaddingLength, nextIntValue, nextLongValue, nextStringValue, setDataSource, setIncrementerName, setPaddingLength
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DerbyMaxValueIncrementer

public DerbyMaxValueIncrementer()
Default constructor for bean property style usage.

See Also:
AbstractDataFieldMaxValueIncrementer.setDataSource(javax.sql.DataSource),
AbstractDataFieldMaxValueIncrementer.setIncrementerName(java.lang.String),
AbstractColumnMaxValueIncrementer.setColumnName(java.lang.String)

DerbyMaxValueIncrementer

public DerbyMaxValueIncrementer(DataSource dataSource,
                                String incrementerName,
                                String columnName)
Convenience constructor.

Parameters:
dataSource - the DataSource to use
incrementerName - the name of the sequence/table to use
columnName - the name of the column in the sequence table to use

DerbyMaxValueIncrementer

public DerbyMaxValueIncrementer(DataSource dataSource,
                                String incrementerName,
                                String columnName,
                                String dummyName)
Convenience constructor.

Parameters:
dataSource - the DataSource to use
incrementerName - the name of the sequence/table to use
columnName - the name of the column in the sequence table to use
dummyName - the name of the dummy column used for inserts
Method Detail

setDummyName

public void setDummyName(String dummyName)
Set the name of the dummy column.

getDummyName

public String getDummyName()
Return the name of the dummy column.

getNextKey

protected long getNextKey()
                   throws DataAccessException
Description copied from class: AbstractDataFieldMaxValueIncrementer
Determine the next key to use, as a long.

Specified by:
getNextKey in class AbstractDataFieldMaxValueIncrementer
Returns:
the key to use as a long. It will eventually be converted later in another format by the public concrete methods of this class.
Throws:
DataAccessException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


H2SequenceMaxValueIncrementer

org.springframework.jdbc.support.incrementer
Class H2SequenceMaxValueIncrementer

java.lang.Object
    extended by  org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
        extended by  org.springframework.jdbc.support.incrementer.AbstractSequenceMaxValueIncrementer
            extended by  org.springframework.jdbc.support.incrementer.H2SequenceMaxValueIncrementer
All Implemented Interfaces:
InitializingBean, DataFieldMaxValueIncrementer
public class H2SequenceMaxValueIncrementer
extends AbstractSequenceMaxValueIncrementer

DataFieldMaxValueIncrementer that retrieves the next value of a given H2 Database sequence.

Since:
2.5
Author:
Thomas Risberg

Field Summary
Fields inherited from class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
paddingLength
Constructor Summary
H2SequenceMaxValueIncrementer()
Default constructor for bean property style usage.
H2SequenceMaxValueIncrementer(DataSource dataSource, String incrementerName)
Convenience constructor.
Method Summary
protected  String getSequenceQuery()
Return the database-specific query to use for retrieving a sequence value.
Methods inherited from class org.springframework.jdbc.support.incrementer.AbstractSequenceMaxValueIncrementer
getNextKey
Methods inherited from class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
afterPropertiesSet, getDataSource, getIncrementerName, getPaddingLength, nextIntValue, nextLongValue, nextStringValue, setDataSource, setIncrementerName, setPaddingLength
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

H2SequenceMaxValueIncrementer

public H2SequenceMaxValueIncrementer()
Default constructor for bean property style usage.

See Also:
AbstractDataFieldMaxValueIncrementer.setDataSource(javax.sql.DataSource), AbstractDataFieldMaxValueIncrementer.setIncrementerName(java.lang.String)

H2SequenceMaxValueIncrementer

public H2SequenceMaxValueIncrementer(DataSource dataSource,
                                     String incrementerName)
Convenience constructor.

Parameters:
dataSource - the DataSource to use
incrementerName - the name of the sequence/table to use
Method Detail

getSequenceQuery

protected String getSequenceQuery()
Description copied from class: AbstractSequenceMaxValueIncrementer
Return the database-specific query to use for retrieving a sequence value.

The provided SQL is supposed to result in a single row with a single column that allows for extracting a long value.

Specified by:
getSequenceQuery in class AbstractSequenceMaxValueIncrementer
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HsqlMaxValueIncrementer

org.springframework.jdbc.support.incrementer
Class HsqlMaxValueIncrementer

java.lang.Object
    extended by  org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
        extended by  org.springframework.jdbc.support.incrementer.AbstractColumnMaxValueIncrementer
            extended by  org.springframework.jdbc.support.incrementer.HsqlMaxValueIncrementer
All Implemented Interfaces:
InitializingBean, DataFieldMaxValueIncrementer
public class HsqlMaxValueIncrementer
extends AbstractColumnMaxValueIncrementer

DataFieldMaxValueIncrementer that increments the maximum value of a given HSQL table with the equivalent of an auto-increment column. Note: If you use this class, your HSQL key column should NOT be auto-increment, as the sequence table does the job.

The sequence is kept in a table. There should be one sequence table per table that needs an auto-generated key.

Example:

create table tab (id int not null primary key, text varchar(100));
 create table tab_sequence (value identity);
 insert into tab_sequence values(0);
If "cacheSize" is set, the intermediate values are served without querying the database. If the server or your application is stopped or crashes or a transaction is rolled back, the unused values will never be served. The maximum hole size in numbering is consequently the value of cacheSize.

NOTE: HSQL now supports sequences and you should consider using them instead: HsqlSequenceMaxValueIncrementer

Author:
Jean-Pierre Pawlak, Thomas Risberg, Juergen Hoeller
See Also:
HsqlSequenceMaxValueIncrementer

Field Summary
Fields inherited from class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
paddingLength
Constructor Summary
HsqlMaxValueIncrementer()
Default constructor for bean property style usage.
HsqlMaxValueIncrementer(DataSource dataSource, String incrementerName, String columnName)
Convenience constructor.
Method Summary
protected  long getNextKey()
Determine the next key to use, as a long.
Methods inherited from class org.springframework.jdbc.support.incrementer.AbstractColumnMaxValueIncrementer
afterPropertiesSet, getCacheSize, getColumnName, setCacheSize, setColumnName
Methods inherited from class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
getDataSource, getIncrementerName, getPaddingLength, nextIntValue, nextLongValue, nextStringValue, setDataSource, setIncrementerName, setPaddingLength
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

HsqlMaxValueIncrementer

public HsqlMaxValueIncrementer()
Default constructor for bean property style usage.

See Also:
AbstractDataFieldMaxValueIncrementer.setDataSource(javax.sql.DataSource),
AbstractDataFieldMaxValueIncrementer.setIncrementerName(java.lang.String),
AbstractColumnMaxValueIncrementer.setColumnName(java.lang.String)

HsqlMaxValueIncrementer

public HsqlMaxValueIncrementer(DataSource dataSource,
                               String incrementerName,
                               String columnName)
Convenience constructor.

Parameters:
dataSource - the DataSource to use
incrementerName - the name of the sequence/table to use
columnName - the name of the column in the sequence table to use
Method Detail

getNextKey

protected long getNextKey()
                   throws DataAccessException
Description copied from class: AbstractDataFieldMaxValueIncrementer
Determine the next key to use, as a long.

Specified by:
getNextKey in class AbstractDataFieldMaxValueIncrementer
Returns:
the key to use as a long. It will eventually be converted later in another format by the public concrete methods of this class.
Throws:
DataAccessException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HsqlSequenceMaxValueIncrementer

org.springframework.jdbc.support.incrementer
Class HsqlSequenceMaxValueIncrementer

java.lang.Object
    extended by  org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
        extended by  org.springframework.jdbc.support.incrementer.AbstractSequenceMaxValueIncrementer
            extended by  org.springframework.jdbc.support.incrementer.HsqlSequenceMaxValueIncrementer
All Implemented Interfaces:
InitializingBean, DataFieldMaxValueIncrementer
public class HsqlSequenceMaxValueIncrementer
extends AbstractSequenceMaxValueIncrementer

DataFieldMaxValueIncrementer that retrieves the next value of a given HSQL sequence. Thanks to Guillaume Bilodeau for the suggestion!

NOTE: This is an alternative to using a regular table to support generating unique keys that was necessary in previous versions of HSQL.

Since:
2.5
Author:
Thomas Risberg
See Also:
HsqlMaxValueIncrementer

Field Summary
Fields inherited from class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
paddingLength
Constructor Summary
HsqlSequenceMaxValueIncrementer()
Default constructor for bean property style usage.
HsqlSequenceMaxValueIncrementer(DataSource dataSource, String incrementerName)
Convenience constructor.
Method Summary
protected  String getSequenceQuery()
Return the database-specific query to use for retrieving a sequence value.
Methods inherited from class org.springframework.jdbc.support.incrementer.AbstractSequenceMaxValueIncrementer
getNextKey
Methods inherited from class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
afterPropertiesSet, getDataSource, getIncrementerName, getPaddingLength, nextIntValue, nextLongValue, nextStringValue, setDataSource, setIncrementerName, setPaddingLength
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

HsqlSequenceMaxValueIncrementer

public HsqlSequenceMaxValueIncrementer()
Default constructor for bean property style usage.

See Also:
AbstractDataFieldMaxValueIncrementer.setDataSource(javax.sql.DataSource), AbstractDataFieldMaxValueIncrementer.setIncrementerName(java.lang.String)

HsqlSequenceMaxValueIncrementer

public HsqlSequenceMaxValueIncrementer(DataSource dataSource,
                                       String incrementerName)
Convenience constructor.

Parameters:
dataSource - the DataSource to use
incrementerName - the name of the sequence/table to use
Method Detail

getSequenceQuery

protected String getSequenceQuery()
Description copied from class: AbstractSequenceMaxValueIncrementer
Return the database-specific query to use for retrieving a sequence value.

The provided SQL is supposed to result in a single row with a single column that allows for extracting a long value.

Specified by:
getSequenceQuery in class AbstractSequenceMaxValueIncrementer
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MySQLMaxValueIncrementer

org.springframework.jdbc.support.incrementer
Class MySQLMaxValueIncrementer

java.lang.Object
    extended by  org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
        extended by  org.springframework.jdbc.support.incrementer.AbstractColumnMaxValueIncrementer
            extended by  org.springframework.jdbc.support.incrementer.MySQLMaxValueIncrementer
All Implemented Interfaces:
InitializingBean, DataFieldMaxValueIncrementer
public class MySQLMaxValueIncrementer
extends AbstractColumnMaxValueIncrementer

DataFieldMaxValueIncrementer that increments the maximum value of a given MySQL table with the equivalent of an auto-increment column. Note: If you use this class, your MySQL key column should NOT be auto-increment, as the sequence table does the job.

The sequence is kept in a table; there should be one sequence table per table that needs an auto-generated key. The table type of the sequence table should be MyISAM so the sequences are allocated without regard to any transactions that might be in progress.

Example:

create table tab (id int unsigned not null primary key, text varchar(100));
 create table tab_sequence (value int not null) type=MYISAM;
 insert into tab_sequence values(0);
If "cacheSize" is set, the intermediate values are served without querying the database. If the server or your application is stopped or crashes or a transaction is rolled back, the unused values will never be served. The maximum hole size in numbering is consequently the value of cacheSize.

Author:
Jean-Pierre Pawlak, Thomas Risberg, Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
paddingLength
Constructor Summary
MySQLMaxValueIncrementer()
Default constructor for bean property style usage.
MySQLMaxValueIncrementer(DataSource dataSource, String incrementerName, String columnName)
Convenience constructor.
Method Summary
protected  long getNextKey()
Determine the next key to use, as a long.
Methods inherited from class org.springframework.jdbc.support.incrementer.AbstractColumnMaxValueIncrementer
afterPropertiesSet, getCacheSize, getColumnName, setCacheSize, setColumnName
Methods inherited from class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
getDataSource, getIncrementerName, getPaddingLength, nextIntValue, nextLongValue, nextStringValue, setDataSource, setIncrementerName, setPaddingLength
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MySQLMaxValueIncrementer

public MySQLMaxValueIncrementer()
Default constructor for bean property style usage.

See Also:
AbstractDataFieldMaxValueIncrementer.setDataSource(javax.sql.DataSource),
AbstractDataFieldMaxValueIncrementer.setIncrementerName(java.lang.String),
AbstractColumnMaxValueIncrementer.setColumnName(java.lang.String)

MySQLMaxValueIncrementer

public MySQLMaxValueIncrementer(DataSource dataSource,
                                String incrementerName,
                                String columnName)
Convenience constructor.

Parameters:
dataSource - the DataSource to use
incrementerName - the name of the sequence/table to use
columnName - the name of the column in the sequence table to use
Method Detail

getNextKey

protected long getNextKey()
                   throws DataAccessException
Description copied from class: AbstractDataFieldMaxValueIncrementer
Determine the next key to use, as a long.

Specified by:
getNextKey in class AbstractDataFieldMaxValueIncrementer
Returns:
the key to use as a long. It will eventually be converted later in another format by the public concrete methods of this class.
Throws:
DataAccessException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OracleSequenceMaxValueIncrementer

org.springframework.jdbc.support.incrementer
Class OracleSequenceMaxValueIncrementer

java.lang.Object
    extended by  org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
        extended by  org.springframework.jdbc.support.incrementer.AbstractSequenceMaxValueIncrementer
            extended by  org.springframework.jdbc.support.incrementer.OracleSequenceMaxValueIncrementer
All Implemented Interfaces:
InitializingBean, DataFieldMaxValueIncrementer
public class OracleSequenceMaxValueIncrementer
extends AbstractSequenceMaxValueIncrementer

DataFieldMaxValueIncrementer that retrieves the next value of a given Oracle sequence.

Author:
Dmitriy Kopylenko, Thomas Risberg, Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
paddingLength
Constructor Summary
OracleSequenceMaxValueIncrementer()
Default constructor for bean property style usage.
OracleSequenceMaxValueIncrementer(DataSource dataSource, String incrementerName)
Convenience constructor.
Method Summary
protected  String getSequenceQuery()
Return the database-specific query to use for retrieving a sequence value.
Methods inherited from class org.springframework.jdbc.support.incrementer.AbstractSequenceMaxValueIncrementer
getNextKey
Methods inherited from class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
afterPropertiesSet, getDataSource, getIncrementerName, getPaddingLength, nextIntValue, nextLongValue, nextStringValue, setDataSource, setIncrementerName, setPaddingLength
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OracleSequenceMaxValueIncrementer

public OracleSequenceMaxValueIncrementer()
Default constructor for bean property style usage.

See Also:
AbstractDataFieldMaxValueIncrementer.setDataSource(javax.sql.DataSource), AbstractDataFieldMaxValueIncrementer.setIncrementerName(java.lang.String)

OracleSequenceMaxValueIncrementer

public OracleSequenceMaxValueIncrementer(DataSource dataSource,
                                         String incrementerName)
Convenience constructor.

Parameters:
dataSource - the DataSource to use
incrementerName - the name of the sequence/table to use
Method Detail

getSequenceQuery

protected String getSequenceQuery()
Description copied from class: AbstractSequenceMaxValueIncrementer
Return the database-specific query to use for retrieving a sequence value.

The provided SQL is supposed to result in a single row with a single column that allows for extracting a long value.

Specified by:
getSequenceQuery in class AbstractSequenceMaxValueIncrementer
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PostgreSQLSequenceMaxValueIncrementer

org.springframework.jdbc.support.incrementer
Class PostgreSQLSequenceMaxValueIncrementer

java.lang.Object
    extended by  org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
        extended by  org.springframework.jdbc.support.incrementer.AbstractSequenceMaxValueIncrementer
            extended by  org.springframework.jdbc.support.incrementer.PostgreSQLSequenceMaxValueIncrementer
All Implemented Interfaces:
InitializingBean, DataFieldMaxValueIncrementer
public class PostgreSQLSequenceMaxValueIncrementer
extends AbstractSequenceMaxValueIncrementer

DataFieldMaxValueIncrementer that retrieves the next value of a given PostgreSQL sequence. Thanks to Tomislav Urban for the suggestion!

Author:
Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
paddingLength
Constructor Summary
PostgreSQLSequenceMaxValueIncrementer()
Default constructor for bean property style usage.
PostgreSQLSequenceMaxValueIncrementer(DataSource dataSource, String incrementerName)
Convenience constructor.
Method Summary
protected  String getSequenceQuery()
Return the database-specific query to use for retrieving a sequence value.
Methods inherited from class org.springframework.jdbc.support.incrementer.AbstractSequenceMaxValueIncrementer
getNextKey
Methods inherited from class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
afterPropertiesSet, getDataSource, getIncrementerName, getPaddingLength, nextIntValue, nextLongValue, nextStringValue, setDataSource, setIncrementerName, setPaddingLength
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PostgreSQLSequenceMaxValueIncrementer

public PostgreSQLSequenceMaxValueIncrementer()
Default constructor for bean property style usage.

See Also:
AbstractDataFieldMaxValueIncrementer.setDataSource(javax.sql.DataSource), AbstractDataFieldMaxValueIncrementer.setIncrementerName(java.lang.String)

PostgreSQLSequenceMaxValueIncrementer

public PostgreSQLSequenceMaxValueIncrementer(DataSource dataSource,
                                             String incrementerName)
Convenience constructor.

Parameters:
dataSource - the DataSource to use
incrementerName - the name of the sequence/table to use
Method Detail

getSequenceQuery

protected String getSequenceQuery()
Description copied from class: AbstractSequenceMaxValueIncrementer
Return the database-specific query to use for retrieving a sequence value.

The provided SQL is supposed to result in a single row with a single column that allows for extracting a long value.

Specified by:
getSequenceQuery in class AbstractSequenceMaxValueIncrementer
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SqlServerMaxValueIncrementer

org.springframework.jdbc.support.incrementer
Class SqlServerMaxValueIncrementer

java.lang.Object
    extended by  org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
        extended by  org.springframework.jdbc.support.incrementer.AbstractColumnMaxValueIncrementer
            extended by  org.springframework.jdbc.support.incrementer.SqlServerMaxValueIncrementer
All Implemented Interfaces:
InitializingBean, DataFieldMaxValueIncrementer
public class SqlServerMaxValueIncrementer
extends AbstractColumnMaxValueIncrementer

DataFieldMaxValueIncrementer that increments the maximum value of a given SQL Server table with the equivalent of an auto-increment column. Note: If you use this class, your Derby key column should NOT be defined as an IDENTITY column, as the sequence table does the job.

This class is inteded to be used with Microsoft SQL Server.

The sequence is kept in a table. There should be one sequence table per table that needs an auto-generated key.

Example:

 create table tab (id int not null primary key, text varchar(100))
 create table tab_sequence (id bigint identity)
 insert into tab_sequence default values
If "cacheSize" is set, the intermediate values are served without querying the database. If the server or your application is stopped or crashes or a transaction is rolled back, the unused values will never be served. The maximum hole size in numbering is consequently the value of cacheSize. HINT: Since Microsoft SQL Server supports the JDBC 3.0 getGeneratedKeys method, it is recommended to use IDENTITY columns directly in the tables and then using a SimpleJdbcInsert or utilizing a KeyHolder when calling the with the update(PreparedStatementCreator psc, KeyHolder generatedKeyHolder) method of the JdbcTemplate.

Thanks to Preben Nilsson for the suggestion!

Since:
2.5.5
Author:
Thomas Risberg

Field Summary
Fields inherited from class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
paddingLength
Constructor Summary
SqlServerMaxValueIncrementer()
Default constructor for bean property style usage.
SqlServerMaxValueIncrementer(DataSource dataSource, String incrementerName, String columnName)
Convenience constructor.
Method Summary
protected  long getNextKey()
Determine the next key to use, as a long.
Methods inherited from class org.springframework.jdbc.support.incrementer.AbstractColumnMaxValueIncrementer
afterPropertiesSet, getCacheSize, getColumnName, setCacheSize, setColumnName
Methods inherited from class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
getDataSource, getIncrementerName, getPaddingLength, nextIntValue, nextLongValue, nextStringValue, setDataSource, setIncrementerName, setPaddingLength
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SqlServerMaxValueIncrementer

public SqlServerMaxValueIncrementer()
Default constructor for bean property style usage.

See Also:
AbstractDataFieldMaxValueIncrementer.setDataSource(javax.sql.DataSource),
AbstractDataFieldMaxValueIncrementer.setIncrementerName(java.lang.String),
AbstractColumnMaxValueIncrementer.setColumnName(java.lang.String)

SqlServerMaxValueIncrementer

public SqlServerMaxValueIncrementer(DataSource dataSource,
                                    String incrementerName,
                                    String columnName)
Convenience constructor.

Parameters:
dataSource - the DataSource to use
incrementerName - the name of the sequence/table to use
columnName - the name of the column in the sequence table to use
Method Detail

getNextKey

protected long getNextKey()
                   throws DataAccessException
Description copied from class: AbstractDataFieldMaxValueIncrementer
Determine the next key to use, as a long.

Specified by:
getNextKey in class AbstractDataFieldMaxValueIncrementer
Returns:
the key to use as a long. It will eventually be converted later in another format by the public concrete methods of this class.
Throws:
DataAccessException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SybaseMaxValueIncrementer

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.support.incrementer
Class SybaseMaxValueIncrementer

java.lang.Object
    extended by  org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
        extended by  org.springframework.jdbc.support.incrementer.AbstractColumnMaxValueIncrementer
            extended by  org.springframework.jdbc.support.incrementer.SybaseMaxValueIncrementer
All Implemented Interfaces:
InitializingBean, DataFieldMaxValueIncrementer
public class SybaseMaxValueIncrementer
extends AbstractColumnMaxValueIncrementer

DataFieldMaxValueIncrementer that increments the maximum value of a given SQL Server table with the equivalent of an auto-increment column. Note: If you use this class, your Derby key column should NOT be defined as an IDENTITY column, as the sequence table does the job.

This class is inteded to be used with Sybase Adaptive Server.

The sequence is kept in a table. There should be one sequence table per table that needs an auto-generated key.

Example:

 create table tab (id int not null primary key, text varchar(100))
 create table tab_sequence (id bigint identity)
 insert into tab_sequence values()
If "cacheSize" is set, the intermediate values are served without querying the database. If the server or your application is stopped or crashes or a transaction is rolled back, the unused values will never be served. The maximum hole size in numbering is consequently the value of cacheSize. HINT: Since Sybase supports the JDBC 3.0 getGeneratedKeys method, it is recommended to use IDENTITY columns directly in the tables and then using a SimpleJdbcInsert or utilizing a KeyHolder when calling the with the update(PreparedStatementCreator psc, KeyHolder generatedKeyHolder) method of the JdbcTemplate.

Thanks to Yinwei Liu for the suggestion!

Since:
2.5.5
Author:
Thomas Risberg

Field Summary
Fields inherited from class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
paddingLength
Constructor Summary
SybaseMaxValueIncrementer()
Default constructor for bean property style usage.
SybaseMaxValueIncrementer(DataSource dataSource, String incrementerName, String columnName)
Convenience constructor.
Method Summary
protected  long getNextKey()
Determine the next key to use, as a long.
Methods inherited from class org.springframework.jdbc.support.incrementer.AbstractColumnMaxValueIncrementer
afterPropertiesSet, getCacheSize, getColumnName, setCacheSize, setColumnName
Methods inherited from class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
getDataSource, getIncrementerName, getPaddingLength, nextIntValue, nextLongValue, nextStringValue, setDataSource, setIncrementerName, setPaddingLength
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SybaseMaxValueIncrementer

public SybaseMaxValueIncrementer()
Default constructor for bean property style usage.

See Also:
AbstractDataFieldMaxValueIncrementer.setDataSource(javax.sql.DataSource),
AbstractDataFieldMaxValueIncrementer.setIncrementerName(java.lang.String),
AbstractColumnMaxValueIncrementer.setColumnName(java.lang.String)

SybaseMaxValueIncrementer

public SybaseMaxValueIncrementer(DataSource dataSource,
                                 String incrementerName,
                                 String columnName)
Convenience constructor.

Parameters:
dataSource - the DataSource to use
incrementerName - the name of the sequence/table to use
columnName - the name of the column in the sequence table to use
Method Detail

getNextKey

protected long getNextKey()
                   throws DataAccessException
Description copied from class: AbstractDataFieldMaxValueIncrementer
Determine the next key to use, as a long.

Specified by:
getNextKey in class AbstractDataFieldMaxValueIncrementer
Returns:
the key to use as a long. It will eventually be converted later in another format by the public concrete methods of this class.
Throws:
DataAccessException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jdbc.support.lob

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jdbc.support.lob

Provides a stategy interface for Large OBject handling, with implementations for various databases.

See:
Description

Interface Summary
LobCreator | Interface that abstracts potentially database-specific creation of large binary fields and large text fields.
LobHandler | Abstraction for handling large binary fields and large text fields in specific databases, no matter if represented as simple types or Large OBjects.
OracleLobHandler.LobCallback | Internal callback interface for use with createLob.

Class Summary
AbstractLobHandler | Abstract base class for LobHandler implementations.
DefaultLobHandler | Default implementation of the LobHandler interface.
JtaLobCreatorSynchronization | Callback for resource cleanup at the end of a JTA transaction.
LobCreatorUtils | Helper class for registering a transaction synchronization for closing a LobCreator, preferring Spring transaction synchronization and falling back to plain JTA transaction synchronization.
OracleLobHandler | LobHandler implementation for Oracle databases.
SpringLobCreatorSynchronization | Callback for resource cleanup at the end of a Spring transaction.

Package org.springframework.jdbc.support.lob Description

Provides a stategy interface for Large OBject handling, with implementations for various databases.

Can be used independently from jdbc.core and jdbc.object, for example in custom JDBC access code.


org.springframework.jdbc.support.lob Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jdbc.support.lob

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jdbc.support.lob.AbstractLobHandler (implements org.springframework.jdbc.support.lob.LobHandler)
      • org.springframework.jdbc.support.lob.DefaultLobHandler
      • org.springframework.jdbc.support.lob.OracleLobHandler
    • org.springframework.jdbc.support.lob.DefaultLobHandler.DefaultLobCreator (implements org.springframework.jdbc.support.lob.LobCreator)
    • org.springframework.jdbc.support.lob.JtaLobCreatorSynchronization (implements javax.transaction.Synchronization)
    • org.springframework.jdbc.support.lob.LobCreatorUtils
    • org.springframework.jdbc.support.lob.OracleLobHandler.OracleLobCreator (implements org.springframework.jdbc.support.lob.LobCreator)
    • org.springframework.transaction.support.TransactionSynchronizationAdapter (implements org.springframework.core.Ordered, org.springframework.transaction.support.TransactionSynchronization)
      • org.springframework.jdbc.support.lob.SpringLobCreatorSynchronization

Interface Hierarchy

  • org.springframework.jdbc.support.lob.LobCreator
  • org.springframework.jdbc.support.lob.LobHandler
  • org.springframework.jdbc.support.lob.OracleLobHandler.LobCallback


LobCreator

org.springframework.jdbc.support.lob
Interface LobCreator

All Known Implementing Classes:
DefaultLobHandler.DefaultLobCreator, OracleLobHandler.OracleLobCreator
public interface LobCreator

Interface that abstracts potentially database-specific creation of large binary fields and large text fields. Does not work with java.sql.Blob and java.sql.Clob instances in the API, as some JDBC drivers do not support these types as such.

The LOB creation part is where LobHandler implementations usually differ. Possible strategies include usage of PreparedStatement.setBinaryStream/setCharacterStream but also PreparedStatement.setBlob/setClob with either a stream argument (requires JDBC 4.0) or java.sql.Blob/Clob wrapper objects.

A LobCreator represents a session for creating BLOBs: It is not thread-safe and needs to be instantiated for each statement execution or for each transaction. Each LobCreator needs to be closed after completion.

For convenient working with a PreparedStatement and a LobCreator, consider using JdbcTemplate with an AbstractLobCreatingPreparedStatementCallback implementation. See the latter's javadoc for details.

Since:
04.12.2003
Author:
Juergen Hoeller
See Also:
close(),
LobHandler.getLobCreator(),
DefaultLobHandler.DefaultLobCreator,
OracleLobHandler.OracleLobCreator,
PreparedStatement.setBlob(int, java.sql.Blob),
PreparedStatement.setClob(int, java.sql.Clob),
PreparedStatement.setBytes(int, byte[]),
PreparedStatement.setBinaryStream(int, java.io.InputStream, int),
PreparedStatement.setString(int, java.lang.String),
PreparedStatement.setAsciiStream(int, java.io.InputStream, int),
PreparedStatement.setCharacterStream(int, java.io.Reader, int)

Method Summary
void | close() Close this LobCreator session and free its temporarily created BLOBs and CLOBs.
void | setBlobAsBinaryStream(PreparedStatement ps, int paramIndex, InputStream contentStream, int contentLength) Set the given content as binary stream on the given statement, using the given parameter index.
void | setBlobAsBytes(PreparedStatement ps, int paramIndex, byte[] content) Set the given content as bytes on the given statement, using the given parameter index.
void | setClobAsAsciiStream(PreparedStatement ps, int paramIndex, InputStream asciiStream, int contentLength) Set the given content as ASCII stream on the given statement, using the given parameter index.
void | setClobAsCharacterStream(PreparedStatement ps, int paramIndex, Reader characterStream, int contentLength) Set the given content as character stream on the given statement, using the given parameter index.
void | setClobAsString(PreparedStatement ps, int paramIndex, String content) Set the given content as String on the given statement, using the given parameter index.

Method Detail

setBlobAsBytes

void setBlobAsBytes(PreparedStatement ps,
                    int paramIndex,
                    byte[] content)
                    throws SQLException
Set the given content as bytes on the given statement, using the given parameter index. Might simply invoke PreparedStatement.setBytes or create a Blob instance for it, depending on the database and driver.

Parameters:
ps - the PreparedStatement to the set the content on
paramIndex - the parameter index to use
content - the content as byte array, or null for SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
PreparedStatement.setBytes(int, byte[])

setBlobAsBinaryStream

void setBlobAsBinaryStream(PreparedStatement ps,
                           int paramIndex,
                           InputStream contentStream,
                           int contentLength)
                           throws SQLException
Set the given content as binary stream on the given statement, using the given parameter index. Might simply invoke PreparedStatement.setBinaryStream or create a Blob instance for it, depending on the database and driver.

Parameters:
ps - the PreparedStatement to the set the content on
paramIndex - the parameter index to use
contentStream - the content as binary stream, or null for SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
PreparedStatement.setBinaryStream(int, java.io.InputStream, int)

setClobAsString

void setClobAsString(PreparedStatement ps,
                     int paramIndex,
                     String content)
                     throws SQLException
Set the given content as String on the given statement, using the given parameter index. Might simply invoke PreparedStatement.setString or create a Clob instance for it, depending on the database and driver.

Parameters:
ps - the PreparedStatement to the set the content on
paramIndex - the parameter index to use
content - the content as String, or null for SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
PreparedStatement.setBytes(int, byte[])

setClobAsAsciiStream

void setClobAsAsciiStream(PreparedStatement ps,
                          int paramIndex,
                          InputStream asciiStream,
                          int contentLength)
                          throws SQLException
Set the given content as ASCII stream on the given statement, using the given parameter index. Might simply invoke PreparedStatement.setAsciiStream or create a Clob instance for it, depending on the database and driver.

Parameters:
ps - the PreparedStatement to the set the content on
paramIndex - the parameter index to use
asciiStream - the content as ASCII stream, or null for SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
PreparedStatement.setAsciiStream(int, java.io.InputStream, int)

setClobAsCharacterStream

void setClobAsCharacterStream(PreparedStatement ps,
                              int paramIndex,
                              Reader characterStream,
                              int contentLength)
                              throws SQLException
Set the given content as character stream on the given statement, using the given parameter index. Might simply invoke PreparedStatement.setCharacterStream or create a Clob instance for it, depending on the database and driver.

Parameters:
ps - the PreparedStatement to the set the content on
paramIndex - the parameter index to use
characterStream - the content as character stream, or null for SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
PreparedStatement.setCharacterStream(int, java.io.Reader, int)

close

void close()
Close this LobCreator session and free its temporarily created BLOBs and CLOBs. Will not need to do anything if using PreparedStatement's standard methods, but might be necessary to free database resources if using proprietary means.

NOTE: Needs to be invoked after the involved PreparedStatements have been executed or the affected O/R mapping sessions have been flushed. Otherwise, the database resources for the temporary BLOBs might stay allocated.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LobHandler

org.springframework.jdbc.support.lob
Interface LobHandler

All Known Implementing Classes:
AbstractLobHandler, DefaultLobHandler, OracleLobHandler
public interface LobHandler

Abstraction for handling large binary fields and large text fields in specific databases, no matter if represented as simple types or Large OBjects. Its main purpose is to isolate Oracle's peculiar handling of LOBs in OracleLobHandler; most other databases should be able to work with the provided DefaultLobHandler.

Provides accessor methods for BLOBs and CLOBs, and acts as factory for LobCreator instances, to be used as sessions for creating BLOBs or CLOBs. LobCreators are typically instantiated for each statement execution or for each transaction; they are not thread-safe because they might track allocated database resources in order to free them after execution.

Most databases/drivers should be able to work with DefaultLobHandler, which by default delegates to JDBC's direct accessor methods, avoiding the java.sql.Blob and java.sql.Clob API completely. DefaultLobHandler can also be configured to access LOBs using PreparedStatement.setBlob/setClob (e.g. for PostgreSQL), through setting the "wrapAsLob" property.

Unfortunately, Oracle 9i just accepts Blob/Clob instances created via its own proprietary BLOB/CLOB API, and additionally doesn't accept large streams for PreparedStatement's corresponding setter methods. Therefore, you need to use OracleLobHandler there, which uses Oracle's BLOB/CLOB API for both types of access. The Oracle 10g JDBC driver should basically work with DefaultLobHandler as well, with some limitations in terms of LOB sizes.

Of course, you need to declare different field types for each database. In Oracle, any binary content needs to go into a BLOB, and all character content beyond 4000 bytes needs to go into a CLOB. In MySQL, there is no notion of a CLOB type but rather a LONGTEXT type that behaves like a VARCHAR. For complete portability, use a LobHandler for fields that might typically require LOBs on some database because of the field size (take Oracle's numbers as a guideline).

Summarizing the recommended options (for actual LOB fields):

  • JDBC 4.0 driver: DefaultLobHandler with streamAsLob=true.
  • PostgreSQL: DefaultLobHandler with wrapAsLob=true.
  • Oracle 9i/10g: OracleLobHandler with a connection-pool-specific NativeJdbcExtractor.
  • For all other database drivers (and for non-LOB fields that might potentially turn into LOBs on some databases): a plain DefaultLobHandler.

Since:
23.12.2003
Author:
Juergen Hoeller
See Also:
DefaultLobHandler,
OracleLobHandler,
ResultSet.getBlob(int),
ResultSet.getClob(int),
ResultSet.getBytes(int),
ResultSet.getBinaryStream(int),
ResultSet.getString(int),
ResultSet.getAsciiStream(int),
ResultSet.getCharacterStream(int)

Method Summary
InputStream | getBlobAsBinaryStream(ResultSet rs, int columnIndex) Retrieve the given column as binary stream from the given ResultSet.
InputStream | getBlobAsBinaryStream(ResultSet rs, String columnName) Retrieve the given column as binary stream from the given ResultSet.
byte[] | getBlobAsBytes(ResultSet rs, int columnIndex) Retrieve the given column as bytes from the given ResultSet.
byte[] | getBlobAsBytes(ResultSet rs, String columnName) Retrieve the given column as bytes from the given ResultSet.
InputStream | getClobAsAsciiStream(ResultSet rs, int columnIndex) Retrieve the given column as ASCII stream from the given ResultSet.
InputStream | getClobAsAsciiStream(ResultSet rs, String columnName) Retrieve the given column as ASCII stream from the given ResultSet.
Reader | getClobAsCharacterStream(ResultSet rs, int columnIndex) Retrieve the given column as character stream from the given ResultSet.
Reader | getClobAsCharacterStream(ResultSet rs, String columnName) Retrieve the given column as character stream from the given ResultSet.
String | getClobAsString(ResultSet rs, int columnIndex) Retrieve the given column as String from the given ResultSet.
String | getClobAsString(ResultSet rs, String columnName) Retrieve the given column as String from the given ResultSet.
LobCreator | getLobCreator() Create a new LobCreator instance, i.e.

Method Detail

getBlobAsBytes

byte[] getBlobAsBytes(ResultSet rs,
                      String columnName)
                      throws SQLException
Retrieve the given column as bytes from the given ResultSet. Might simply invoke ResultSet.getBytes or work with ResultSet.getBlob, depending on the database and driver.

Parameters:
rs - the ResultSet to retrieve the content from
columnName - the column name to use
Returns:
the content as byte array, or null in case of SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getBytes(int)

getBlobAsBytes

byte[] getBlobAsBytes(ResultSet rs,
                      int columnIndex)
                      throws SQLException
Retrieve the given column as bytes from the given ResultSet. Might simply invoke ResultSet.getBytes or work with ResultSet.getBlob, depending on the database and driver.

Parameters:
rs - the ResultSet to retrieve the content from
columnIndex - the column index to use
Returns:
the content as byte array, or null in case of SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getBytes(int)

getBlobAsBinaryStream

InputStream getBlobAsBinaryStream(ResultSet rs,
                                  String columnName)
                                  throws SQLException
Retrieve the given column as binary stream from the given ResultSet. Might simply invoke ResultSet.getBinaryStream or work with ResultSet.getBlob, depending on the database and driver.

Parameters:
rs - the ResultSet to retrieve the content from
columnName - the column name to use
Returns:
the content as binary stream, or null in case of SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getBinaryStream(int)

getBlobAsBinaryStream

InputStream getBlobAsBinaryStream(ResultSet rs,
                                  int columnIndex)
                                  throws SQLException
Retrieve the given column as binary stream from the given ResultSet. Might simply invoke ResultSet.getBinaryStream or work with ResultSet.getBlob, depending on the database and driver.

Parameters:
rs - the ResultSet to retrieve the content from
columnIndex - the column index to use
Returns:
the content as binary stream, or null in case of SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getBinaryStream(int)

getClobAsString

String getClobAsString(ResultSet rs,
                       String columnName)
                       throws SQLException
Retrieve the given column as String from the given ResultSet. Might simply invoke ResultSet.getString or work with ResultSet.getClob, depending on the database and driver.

Parameters:
rs - the ResultSet to retrieve the content from
columnName - the column name to use
Returns:
the content as String, or null in case of SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getString(int)

getClobAsString

String getClobAsString(ResultSet rs,
                       int columnIndex)
                       throws SQLException
Retrieve the given column as String from the given ResultSet. Might simply invoke ResultSet.getString or work with ResultSet.getClob, depending on the database and driver.

Parameters:
rs - the ResultSet to retrieve the content from
columnIndex - the column index to use
Returns:
the content as String, or null in case of SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getString(int)

getClobAsAsciiStream

InputStream getClobAsAsciiStream(ResultSet rs,
                                 String columnName)
                                 throws SQLException
Retrieve the given column as ASCII stream from the given ResultSet. Might simply invoke ResultSet.getAsciiStream or work with ResultSet.getClob, depending on the database and driver.

Parameters:
rs - the ResultSet to retrieve the content from
columnName - the column name to use
Returns:
the content as ASCII stream, or null in case of SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getAsciiStream(int)

getClobAsAsciiStream

InputStream getClobAsAsciiStream(ResultSet rs,
                                 int columnIndex)
                                 throws SQLException
Retrieve the given column as ASCII stream from the given ResultSet. Might simply invoke ResultSet.getAsciiStream or work with ResultSet.getClob, depending on the database and driver.

Parameters:
rs - the ResultSet to retrieve the content from
columnIndex - the column index to use
Returns:
the content as ASCII stream, or null in case of SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getAsciiStream(int)

getClobAsCharacterStream

Reader getClobAsCharacterStream(ResultSet rs,
                                String columnName)
                                throws SQLException
Retrieve the given column as character stream from the given ResultSet. Might simply invoke ResultSet.getCharacterStream or work with ResultSet.getClob, depending on the database and driver.

Parameters:
rs - the ResultSet to retrieve the content from
columnName - the column name to use
Returns:
the content as character stream
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getCharacterStream(int)

getClobAsCharacterStream

Reader getClobAsCharacterStream(ResultSet rs,
                                int columnIndex)
                                throws SQLException
Retrieve the given column as character stream from the given ResultSet. Might simply invoke ResultSet.getCharacterStream or work with ResultSet.getClob, depending on the database and driver.

Parameters:
rs - the ResultSet to retrieve the content from
columnIndex - the column index to use
Returns:
the content as character stream
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getCharacterStream(int)

getLobCreator

LobCreator getLobCreator()
Create a new LobCreator instance, i.e. a session for creating BLOBs and CLOBs. Needs to be closed after the created LOBs are not needed anymore - typically after statement execution or transaction completion.

Returns:
the new LobCreator instance
See Also:
LobCreator.close()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractLobHandler

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.support.lob
Class AbstractLobHandler

java.lang.Object
    extended by  org.springframework.jdbc.support.lob.AbstractLobHandler
All Implemented Interfaces:
LobHandler
Direct Known Subclasses:
DefaultLobHandler, OracleLobHandler
public abstract class AbstractLobHandler
extends Object
implements LobHandler

Abstract base class for LobHandler implementations.

Implements all accessor methods for column names through a column lookup and delegating to the corresponding accessor that takes a column index.

Since:
1.2
Author:
Juergen Hoeller
See Also:
ResultSet.findColumn(java.lang.String)

Constructor Summary
AbstractLobHandler()
Method Summary
InputStream | getBlobAsBinaryStream(ResultSet rs, String columnName) Retrieve the given column as binary stream from the given ResultSet.
byte[] | getBlobAsBytes(ResultSet rs, String columnName) Retrieve the given column as bytes from the given ResultSet.
InputStream | getClobAsAsciiStream(ResultSet rs, String columnName) Retrieve the given column as ASCII stream from the given ResultSet.
Reader | getClobAsCharacterStream(ResultSet rs, String columnName) Retrieve the given column as character stream from the given ResultSet.
String | getClobAsString(ResultSet rs, String columnName) Retrieve the given column as String from the given ResultSet.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.jdbc.support.lob.LobHandler
getBlobAsBinaryStream, getBlobAsBytes, getClobAsAsciiStream, getClobAsCharacterStream, getClobAsString, getLobCreator

Constructor Detail

AbstractLobHandler

public AbstractLobHandler()
Method Detail

getBlobAsBytes

public byte[] getBlobAsBytes(ResultSet rs,
                             String columnName)
                      throws SQLException
Description copied from interface: LobHandler
Retrieve the given column as bytes from the given ResultSet. Might simply invoke ResultSet.getBytes or work with ResultSet.getBlob, depending on the database and driver.

Specified by:
getBlobAsBytes in interface LobHandler
Parameters:
rs - the ResultSet to retrieve the content from
columnName - the column name to use
Returns:
the content as byte array, or null in case of SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getBytes(int)

getBlobAsBinaryStream

public InputStream getBlobAsBinaryStream(ResultSet rs,
                                         String columnName)
                                  throws SQLException
Description copied from interface: LobHandler
Retrieve the given column as binary stream from the given ResultSet. Might simply invoke ResultSet.getBinaryStream or work with ResultSet.getBlob, depending on the database and driver.

Specified by:
getBlobAsBinaryStream in interface LobHandler
Parameters:
rs - the ResultSet to retrieve the content from
columnName - the column name to use
Returns:
the content as binary stream, or null in case of SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getBinaryStream(int)

getClobAsString

public String getClobAsString(ResultSet rs,
                              String columnName)
                       throws SQLException
Description copied from interface: LobHandler
Retrieve the given column as String from the given ResultSet. Might simply invoke ResultSet.getString or work with ResultSet.getClob, depending on the database and driver.

Specified by:
getClobAsString in interface LobHandler
Parameters:
rs - the ResultSet to retrieve the content from
columnName - the column name to use
Returns:
the content as String, or null in case of SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getString(int)

getClobAsAsciiStream

public InputStream getClobAsAsciiStream(ResultSet rs,
                                        String columnName)
                                 throws SQLException
Description copied from interface: LobHandler
Retrieve the given column as ASCII stream from the given ResultSet. Might simply invoke ResultSet.getAsciiStream or work with ResultSet.getClob, depending on the database and driver.

Specified by:
getClobAsAsciiStream in interface LobHandler
Parameters:
rs - the ResultSet to retrieve the content from
columnName - the column name to use
Returns:
the content as ASCII stream, or null in case of SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getAsciiStream(int)

getClobAsCharacterStream

public Reader getClobAsCharacterStream(ResultSet rs,
                                       String columnName)
                                throws SQLException
Description copied from interface: LobHandler
Retrieve the given column as character stream from the given ResultSet. Might simply invoke ResultSet.getCharacterStream or work with ResultSet.getClob, depending on the database and driver.

Specified by:
getClobAsCharacterStream in interface LobHandler
Parameters:
rs - the ResultSet to retrieve the content from
columnName - the column name to use
Returns:
the content as character stream
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getCharacterStream(int)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


DefaultLobHandler

org.springframework.jdbc.support.lob
Class DefaultLobHandler

java.lang.Object
    extended by  org.springframework.jdbc.support.lob.AbstractLobHandler
        extended by  org.springframework.jdbc.support.lob.DefaultLobHandler
All Implemented Interfaces:
LobHandler
public class DefaultLobHandler
extends AbstractLobHandler

Default implementation of the LobHandler interface. Invokes the direct accessor methods that java.sql.ResultSet and java.sql.PreparedStatement offer.

This LobHandler should work for any JDBC driver that is JDBC compliant in terms of the spec's suggestions regarding simple BLOB and CLOB handling. This does not apply to Oracle 9i, and only to a limited degree to Oracle 10g! As a consequence, use OracleLobHandler for accessing Oracle BLOBs/CLOBs.

Some JDBC drivers require values with a BLOB/CLOB target column to be explicitly set through the JDBC setBlob / setClob API: for example, PostgreSQL's driver. Switch the "wrapAsLob" property to "true" when operating against such a driver.

On JDBC 4.0, this LobHandler also supports streaming the BLOB/CLOB content via the setBlob / setClob variants that take a stream argument directly. Consider switching the "streamAsLob" property to "true" when operating against a fully compliant JDBC 4.0 driver.

See the LobHandler javadoc for a summary of recommendations.

Since:
04.12.2003
Author:
Juergen Hoeller
See Also:
setStreamAsLob(boolean),
ResultSet.getBytes(int),
ResultSet.getBinaryStream(int),
ResultSet.getString(int),
ResultSet.getAsciiStream(int),
ResultSet.getCharacterStream(int),
PreparedStatement.setBytes(int, byte[]),
PreparedStatement.setBinaryStream(int, java.io.InputStream, int),
PreparedStatement.setString(int, java.lang.String),
PreparedStatement.setAsciiStream(int, java.io.InputStream, int),
PreparedStatement.setCharacterStream(int, java.io.Reader, int)

Nested Class Summary
protected  class DefaultLobHandler.DefaultLobCreator
Default LobCreator implementation as inner class.
Field Summary
protected  Log logger
Constructor Summary
DefaultLobHandler()
Method Summary
InputStream | getBlobAsBinaryStream(ResultSet rs, int columnIndex) Retrieve the given column as binary stream from the given ResultSet.
byte[] | getBlobAsBytes(ResultSet rs, int columnIndex) Retrieve the given column as bytes from the given ResultSet.
InputStream | getClobAsAsciiStream(ResultSet rs, int columnIndex) Retrieve the given column as ASCII stream from the given ResultSet.
Reader | getClobAsCharacterStream(ResultSet rs, int columnIndex) Retrieve the given column as character stream from the given ResultSet.
String | getClobAsString(ResultSet rs, int columnIndex) Retrieve the given column as String from the given ResultSet.
LobCreator | getLobCreator() Create a new LobCreator instance, i.e.
void | setStreamAsLob(boolean streamAsLob) Specify whether to submit a binary stream / character stream to the JDBC driver as explicit LOB content, using the JDBC 4.0 setBlob / setClob method with a stream argument.
void | setWrapAsLob(boolean wrapAsLob) Specify whether to submit a byte array / String to the JDBC driver wrapped in a JDBC Blob / Clob object, using the JDBC setBlob / setClob method with a Blob / Clob argument.
Methods inherited from class org.springframework.jdbc.support.lob.AbstractLobHandler
getBlobAsBinaryStream, getBlobAsBytes, getClobAsAsciiStream, getClobAsCharacterStream, getClobAsString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Constructor Detail

DefaultLobHandler

public DefaultLobHandler()
Method Detail

setWrapAsLob

public void setWrapAsLob(boolean wrapAsLob)
Specify whether to submit a byte array / String to the JDBC driver wrapped in a JDBC Blob / Clob object, using the JDBC setBlob / setClob method with a Blob / Clob argument.

Default is "false", using the common JDBC 2.0 setBinaryStream / setCharacterStream method for setting the content. Switch this to "true" for explicit Blob / Clob wrapping against JDBC drivers that are known to require such wrapping (e.g. PostgreSQL's).

This setting affects byte array / String arguments as well as stream arguments, unless "streamAsLob" overrides this handling to use JDBC 4.0's new explicit streaming support (if available).

See Also:
PreparedStatement.setBlob(int, java.sql.Blob), PreparedStatement.setClob(int, java.sql.Clob)

setStreamAsLob

public void setStreamAsLob(boolean streamAsLob)
Specify whether to submit a binary stream / character stream to the JDBC driver as explicit LOB content, using the JDBC 4.0 setBlob / setClob method with a stream argument.

Default is "false", using the common JDBC 2.0 setBinaryStream / setCharacterStream method for setting the content. Switch this to "true" for explicit JDBC 4.0 usage, provided that your JDBC driver actually supports those JDBC 4.0 operations (e.g. Derby's).

This setting affects stream arguments as well as byte array / String arguments, requiring JDBC 4.0 support. For supporting LOB content against JDBC 3.0, check out the "wrapAsLob" setting.

See Also:
PreparedStatement.setBlob(int, java.io.InputStream, long), PreparedStatement.setClob(int, java.io.Reader, long)

getBlobAsBytes

public byte[] getBlobAsBytes(ResultSet rs,
                             int columnIndex)
                      throws SQLException
Description copied from interface: LobHandler
Retrieve the given column as bytes from the given ResultSet. Might simply invoke ResultSet.getBytes or work with ResultSet.getBlob, depending on the database and driver.

Parameters:
rs - the ResultSet to retrieve the content from
columnIndex - the column index to use
Returns:
the content as byte array, or null in case of SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getBytes(int)

getBlobAsBinaryStream

public InputStream getBlobAsBinaryStream(ResultSet rs,
                                         int columnIndex)
                                  throws SQLException
Description copied from interface: LobHandler
Retrieve the given column as binary stream from the given ResultSet. Might simply invoke ResultSet.getBinaryStream or work with ResultSet.getBlob, depending on the database and driver.

Parameters:
rs - the ResultSet to retrieve the content from
columnIndex - the column index to use
Returns:
the content as binary stream, or null in case of SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getBinaryStream(int)

getClobAsString

public String getClobAsString(ResultSet rs,
                              int columnIndex)
                       throws SQLException
Description copied from interface: LobHandler
Retrieve the given column as String from the given ResultSet. Might simply invoke ResultSet.getString or work with ResultSet.getClob, depending on the database and driver.

Parameters:
rs - the ResultSet to retrieve the content from
columnIndex - the column index to use
Returns:
the content as String, or null in case of SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getString(int)

getClobAsAsciiStream

public InputStream getClobAsAsciiStream(ResultSet rs,
                                        int columnIndex)
                                 throws SQLException
Description copied from interface: LobHandler
Retrieve the given column as ASCII stream from the given ResultSet. Might simply invoke ResultSet.getAsciiStream or work with ResultSet.getClob, depending on the database and driver.

Parameters:
rs - the ResultSet to retrieve the content from
columnIndex - the column index to use
Returns:
the content as ASCII stream, or null in case of SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getAsciiStream(int)

getClobAsCharacterStream

public Reader getClobAsCharacterStream(ResultSet rs,
                                       int columnIndex)
                                throws SQLException
Description copied from interface: LobHandler
Retrieve the given column as character stream from the given ResultSet. Might simply invoke ResultSet.getCharacterStream or work with ResultSet.getClob, depending on the database and driver.

Parameters:
rs - the ResultSet to retrieve the content from
columnIndex - the column index to use
Returns:
the content as character stream
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getCharacterStream(int)

getLobCreator

public LobCreator getLobCreator()
Description copied from interface: LobHandler
Create a new LobCreator instance, i.e. a session for creating BLOBs and CLOBs. Needs to be closed after the created LOBs are not needed anymore - typically after statement execution or transaction completion.

Returns:
the new LobCreator instance
See Also:
LobCreator.close()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultLobHandler.DefaultLobCreator

org.springframework.jdbc.support.lob
Class DefaultLobHandler.DefaultLobCreator

java.lang.Object
    extended by  org.springframework.jdbc.support.lob.DefaultLobHandler.DefaultLobCreator
All Implemented Interfaces:
LobCreator
Enclosing class:
DefaultLobHandler
protected class DefaultLobHandler.DefaultLobCreator
extends Object
implements LobCreator

Default LobCreator implementation as inner class. Can be subclassed in DefaultLobHandler extensions.

Constructor Summary
protected DefaultLobHandler.DefaultLobCreator()
Method Summary
void | close() Close this LobCreator session and free its temporarily created BLOBs and CLOBs.
void | setBlobAsBinaryStream(PreparedStatement ps, int paramIndex, InputStream binaryStream, int contentLength) Set the given content as binary stream on the given statement, using the given parameter index.
void | setBlobAsBytes(PreparedStatement ps, int paramIndex, byte[] content) Set the given content as bytes on the given statement, using the given parameter index.
void | setClobAsAsciiStream(PreparedStatement ps, int paramIndex, InputStream asciiStream, int contentLength) Set the given content as ASCII stream on the given statement, using the given parameter index.
void | setClobAsCharacterStream(PreparedStatement ps, int paramIndex, Reader characterStream, int contentLength) Set the given content as character stream on the given statement, using the given parameter index.
void | setClobAsString(PreparedStatement ps, int paramIndex, String content) Set the given content as String on the given statement, using the given parameter index.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DefaultLobHandler.DefaultLobCreator

protected DefaultLobHandler.DefaultLobCreator()
Method Detail

setBlobAsBytes

public void setBlobAsBytes(PreparedStatement ps,
                           int paramIndex,
                           byte[] content)
                    throws SQLException
Description copied from interface: LobCreator
Set the given content as bytes on the given statement, using the given parameter index. Might simply invoke PreparedStatement.setBytes or create a Blob instance for it, depending on the database and driver.

Specified by:
setBlobAsBytes in interface LobCreator
Parameters:
ps - the PreparedStatement to the set the content on
paramIndex - the parameter index to use
content - the content as byte array, or null for SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
PreparedStatement.setBytes(int, byte[])

setBlobAsBinaryStream

public void setBlobAsBinaryStream(PreparedStatement ps,
                                  int paramIndex,
                                  InputStream binaryStream,
                                  int contentLength)
                           throws SQLException
Description copied from interface: LobCreator
Set the given content as binary stream on the given statement, using the given parameter index. Might simply invoke PreparedStatement.setBinaryStream or create a Blob instance for it, depending on the database and driver.

Specified by:
setBlobAsBinaryStream in interface LobCreator
Parameters:
ps - the PreparedStatement to the set the content on
paramIndex - the parameter index to use
binaryStream - the content as binary stream, or null for SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
PreparedStatement.setBinaryStream(int, java.io.InputStream, int)

setClobAsString

public void setClobAsString(PreparedStatement ps,
                            int paramIndex,
                            String content)
                     throws SQLException
Description copied from interface: LobCreator
Set the given content as String on the given statement, using the given parameter index. Might simply invoke PreparedStatement.setString or create a Clob instance for it, depending on the database and driver.

Specified by:
setClobAsString in interface LobCreator
Parameters:
ps - the PreparedStatement to the set the content on
paramIndex - the parameter index to use
content - the content as String, or null for SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
PreparedStatement.setBytes(int, byte[])

setClobAsAsciiStream

public void setClobAsAsciiStream(PreparedStatement ps,
                                 int paramIndex,
                                 InputStream asciiStream,
                                 int contentLength)
                          throws SQLException
Description copied from interface: LobCreator
Set the given content as ASCII stream on the given statement, using the given parameter index. Might simply invoke PreparedStatement.setAsciiStream or create a Clob instance for it, depending on the database and driver.

Specified by:
setClobAsAsciiStream in interface LobCreator
Parameters:
ps - the PreparedStatement to the set the content on
paramIndex - the parameter index to use
asciiStream - the content as ASCII stream, or null for SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
PreparedStatement.setAsciiStream(int, java.io.InputStream, int)

setClobAsCharacterStream

public void setClobAsCharacterStream(PreparedStatement ps,
                                     int paramIndex,
                                     Reader characterStream,
                                     int contentLength)
                              throws SQLException
Description copied from interface: LobCreator
Set the given content as character stream on the given statement, using the given parameter index. Might simply invoke PreparedStatement.setCharacterStream or create a Clob instance for it, depending on the database and driver.

Specified by:
setClobAsCharacterStream in interface LobCreator
Parameters:
ps - the PreparedStatement to the set the content on
paramIndex - the parameter index to use
characterStream - the content as character stream, or null for SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
PreparedStatement.setCharacterStream(int, java.io.Reader, int)

close

public void close()
Description copied from interface: LobCreator
Close this LobCreator session and free its temporarily created BLOBs and CLOBs. Will not need to do anything if using PreparedStatement's standard methods, but might be necessary to free database resources if using proprietary means.

NOTE: Needs to be invoked after the involved PreparedStatements have been executed or the affected O/R mapping sessions have been flushed. Otherwise, the database resources for the temporary BLOBs might stay allocated.

Specified by:
close in interface LobCreator
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JtaLobCreatorSynchronization

org.springframework.jdbc.support.lob
Class JtaLobCreatorSynchronization

java.lang.Object
    extended by  org.springframework.jdbc.support.lob.JtaLobCreatorSynchronization
All Implemented Interfaces:
Synchronization
public class JtaLobCreatorSynchronization
extends Object
implements Synchronization

Callback for resource cleanup at the end of a JTA transaction. Invokes LobCreator.close() to clean up temporary LOBs that might have been created.

Since:
2.0
Author:
Juergen Hoeller
See Also:
LobCreator.close(), Transaction.registerSynchronization(javax.transaction.Synchronization)

Constructor Summary
JtaLobCreatorSynchronization(LobCreator lobCreator)
Create a JtaLobCreatorSynchronization for the given LobCreator.
Method Summary
void | afterCompletion(int status)
void | beforeCompletion()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JtaLobCreatorSynchronization

public JtaLobCreatorSynchronization(LobCreator lobCreator)
Create a JtaLobCreatorSynchronization for the given LobCreator.

Parameters:
lobCreator - the LobCreator to close after transaction completion
Method Detail

beforeCompletion

public void beforeCompletion()
Specified by:
beforeCompletion in interface Synchronization

afterCompletion

public void afterCompletion(int status)
Specified by:
afterCompletion in interface Synchronization
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LobCreatorUtils

org.springframework.jdbc.support.lob
Class LobCreatorUtils

java.lang.Object
    extended by  org.springframework.jdbc.support.lob.LobCreatorUtils

public abstract class LobCreatorUtils
extends Object

Helper class for registering a transaction synchronization for closing a LobCreator, preferring Spring transaction synchronization and falling back to plain JTA transaction synchronization.

Since:
2.0
Author:
Juergen Hoeller
See Also:
SpringLobCreatorSynchronization, TransactionSynchronizationManager, JtaLobCreatorSynchronization, Transaction.registerSynchronization(javax.transaction.Synchronization)

Constructor Summary
LobCreatorUtils()
Method Summary
static void registerTransactionSynchronization(LobCreator lobCreator, TransactionManager jtaTransactionManager)
Register a transaction synchronization for closing the given LobCreator, preferring Spring transaction synchronization and falling back to plain JTA transaction synchronization.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

LobCreatorUtils

public LobCreatorUtils()
Method Detail

registerTransactionSynchronization

public static void registerTransactionSynchronization(LobCreator lobCreator,
                                                      TransactionManager jtaTransactionManager)
                                               throws IllegalStateException
Register a transaction synchronization for closing the given LobCreator, preferring Spring transaction synchronization and falling back to plain JTA transaction synchronization.

Parameters:
lobCreator - the LobCreator to close after transaction completion
jtaTransactionManager - the JTA TransactionManager to fall back to when no Spring transaction synchronization is active (may be null)
Throws:
IllegalStateException - if there is neither active Spring transaction synchronization nor active JTA transaction synchronization
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OracleLobHandler

org.springframework.jdbc.support.lob
Class OracleLobHandler

java.lang.Object
    extended by  org.springframework.jdbc.support.lob.AbstractLobHandler
        extended by  org.springframework.jdbc.support.lob.OracleLobHandler
All Implemented Interfaces:
LobHandler
public class OracleLobHandler
extends AbstractLobHandler

LobHandler implementation for Oracle databases. Uses proprietary API to create oracle.sql.BLOB and oracle.sql.CLOB instances, as necessary when working with Oracle's JDBC driver. Note that this LobHandler requires Oracle JDBC driver 9i or higher!

While most databases are able to work with DefaultLobHandler, Oracle just accepts Blob/Clob instances created via its own proprietary BLOB/CLOB API, and additionally doesn't accept large streams for PreparedStatement's corresponding setter methods. Therefore, you need to use a strategy like this LobHandler implementation.

Needs to work on a native JDBC Connection, to be able to cast it to oracle.jdbc.OracleConnection. If you pass in Connections from a connection pool (the usual case in a J2EE environment), you need to set an appropriate NativeJdbcExtractor to allow for automatical retrieval of the underlying native JDBC Connection. LobHandler and NativeJdbcExtractor are separate concerns, therefore they are represented by separate strategy interfaces.

Coded via reflection to avoid dependencies on Oracle classes. Even reads in Oracle constants via reflection because of different Oracle drivers (classes12, ojdbc14, ojdbc5, ojdbc6) having different constant values! As this LobHandler initializes Oracle classes on instantiation, do not define this as eager-initializing singleton if you do not want to depend on the Oracle JAR being in the class path: use "lazy-init=true" to avoid this issue.

Since:
04.12.2003
Author:
Juergen Hoeller, Thomas Risberg
See Also:
setNativeJdbcExtractor(org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor), oracle.sql.BLOB, oracle.sql.CLOB

Nested Class Summary
protected static interface | OracleLobHandler.LobCallback Internal callback interface for use with createLob.
protected class | OracleLobHandler.OracleLobCreator LobCreator implementation for Oracle databases.
Field Summary
protected  Log logger
Constructor Summary
OracleLobHandler()
Method Summary
InputStream | getBlobAsBinaryStream(ResultSet rs, int columnIndex) Retrieve the given column as binary stream from the given ResultSet.
byte[] | getBlobAsBytes(ResultSet rs, int columnIndex) Retrieve the given column as bytes from the given ResultSet.
InputStream | getClobAsAsciiStream(ResultSet rs, int columnIndex) Retrieve the given column as ASCII stream from the given ResultSet.
Reader | getClobAsCharacterStream(ResultSet rs, int columnIndex) Retrieve the given column as character stream from the given ResultSet.
String | getClobAsString(ResultSet rs, int columnIndex) Retrieve the given column as String from the given ResultSet.
LobCreator | getLobCreator() Create a new LobCreator instance, i.e.
protected void | initializeResourcesBeforeRead(Connection con, Object lob) Initialize any LOB resources before a read is done.
protected void | initOracleDriverClasses(Connection con) Retrieve the oracle.sql.BLOB and oracle.sql.CLOB classes via reflection, and initialize the values for the DURATION_SESSION, MODE_READWRITE and MODE_READONLY constants defined there.
protected void | releaseResourcesAfterRead(Connection con, Object lob) Release any LOB resources after read is complete.
void | setCache(boolean cache) Set whether to cache the temporary LOB in the buffer cache.
void | setNativeJdbcExtractor(NativeJdbcExtractor nativeJdbcExtractor) Set an appropriate NativeJdbcExtractor to be able to retrieve the underlying native oracle.jdbc.OracleConnection.
void | setReleaseResourcesAfterRead(boolean releaseResources) Set whether to agressively release any resources used by the LOB.
Methods inherited from class org.springframework.jdbc.support.lob.AbstractLobHandler
getBlobAsBinaryStream, getBlobAsBytes, getClobAsAsciiStream, getClobAsCharacterStream, getClobAsString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Constructor Detail

OracleLobHandler

public OracleLobHandler()
Method Detail

setNativeJdbcExtractor

public void setNativeJdbcExtractor(NativeJdbcExtractor nativeJdbcExtractor)
Set an appropriate NativeJdbcExtractor to be able to retrieve the underlying native oracle.jdbc.OracleConnection. This is necessary for DataSource-based connection pools, as those need to return wrapped JDBC Connection handles that cannot be cast to a native Connection implementation.

Effectively, this LobHandler just invokes a single NativeJdbcExtractor method, namely getNativeConnectionFromStatement with a PreparedStatement argument (falling back to a PreparedStatement.getConnection() call if no extractor is set).

A common choice is SimpleNativeJdbcExtractor, whose Connection unwrapping (which is what OracleLobHandler needs) will work with many connection pools. See SimpleNativeJdbcExtractor's javadoc for details.

See Also:
NativeJdbcExtractor.getNativeConnectionFromStatement(java.sql.Statement), SimpleNativeJdbcExtractor, oracle.jdbc.OracleConnection

setCache

public void setCache(boolean cache)
Set whether to cache the temporary LOB in the buffer cache. This value will be passed into BLOB/CLOB.createTemporary.

Default is true.

See Also:
oracle.sql.BLOB#createTemporary, oracle.sql.CLOB#createTemporary

setReleaseResourcesAfterRead

public void setReleaseResourcesAfterRead(boolean releaseResources)
Set whether to agressively release any resources used by the LOB. If set to true then you can only read the LOB values once. Any subsequent reads will fail since the resources have been closed.

Setting this property to true can be useful when your queries generates large temporary LOBs that occupy space in the TEMPORARY tablespace or when you want to free up any memory allocated by the driver for the LOB reading.

Default is false.

Since:
3.0
See Also:
oracle.sql.BLOB#freeTemporary, oracle.sql.CLOB#freeTemporary, oracle.sql.BLOB#open, oracle.sql.CLOB#open, oracle.sql.BLOB#close, oracle.sql.CLOB#close

initOracleDriverClasses

protected void initOracleDriverClasses(Connection con)
Retrieve the oracle.sql.BLOB and oracle.sql.CLOB classes via reflection, and initialize the values for the DURATION_SESSION, MODE_READWRITE and MODE_READONLY constants defined there.

Parameters:
con - the Oracle Connection, for using the exact same class loader that the Oracle driver was loaded with
See Also:
oracle.sql.BLOB#DURATION_SESSION, oracle.sql.BLOB#MODE_READWRITE, oracle.sql.BLOB#MODE_READONLY, oracle.sql.CLOB#DURATION_SESSION, oracle.sql.CLOB#MODE_READWRITE, oracle.sql.CLOB#MODE_READONLY

getBlobAsBytes

public byte[] getBlobAsBytes(ResultSet rs,
                             int columnIndex)
                      throws SQLException
Description copied from interface: LobHandler
Retrieve the given column as bytes from the given ResultSet. Might simply invoke ResultSet.getBytes or work with ResultSet.getBlob, depending on the database and driver.

Parameters:
rs - the ResultSet to retrieve the content from
columnIndex - the column index to use
Returns:
the content as byte array, or null in case of SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getBytes(int)

getBlobAsBinaryStream

public InputStream getBlobAsBinaryStream(ResultSet rs,
                                         int columnIndex)
                                  throws SQLException
Description copied from interface: LobHandler
Retrieve the given column as binary stream from the given ResultSet. Might simply invoke ResultSet.getBinaryStream or work with ResultSet.getBlob, depending on the database and driver.

Parameters:
rs - the ResultSet to retrieve the content from
columnIndex - the column index to use
Returns:
the content as binary stream, or null in case of SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getBinaryStream(int)

getClobAsString

public String getClobAsString(ResultSet rs,
                              int columnIndex)
                       throws SQLException
Description copied from interface: LobHandler
Retrieve the given column as String from the given ResultSet. Might simply invoke ResultSet.getString or work with ResultSet.getClob, depending on the database and driver.

Parameters:
rs - the ResultSet to retrieve the content from
columnIndex - the column index to use
Returns:
the content as String, or null in case of SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getString(int)

getClobAsAsciiStream

public InputStream getClobAsAsciiStream(ResultSet rs,
                                        int columnIndex)
                                 throws SQLException
Description copied from interface: LobHandler
Retrieve the given column as ASCII stream from the given ResultSet. Might simply invoke ResultSet.getAsciiStream or work with ResultSet.getClob, depending on the database and driver.

Parameters:
rs - the ResultSet to retrieve the content from
columnIndex - the column index to use
Returns:
the content as ASCII stream, or null in case of SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getAsciiStream(int)

getClobAsCharacterStream

public Reader getClobAsCharacterStream(ResultSet rs,
                                       int columnIndex)
                                throws SQLException
Description copied from interface: LobHandler
Retrieve the given column as character stream from the given ResultSet. Might simply invoke ResultSet.getCharacterStream or work with ResultSet.getClob, depending on the database and driver.

Parameters:
rs - the ResultSet to retrieve the content from
columnIndex - the column index to use
Returns:
the content as character stream
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getCharacterStream(int)

getLobCreator

public LobCreator getLobCreator()
Description copied from interface: LobHandler
Create a new LobCreator instance, i.e. a session for creating BLOBs and CLOBs. Needs to be closed after the created LOBs are not needed anymore - typically after statement execution or transaction completion.

Returns:
the new LobCreator instance
See Also:
LobCreator.close()

initializeResourcesBeforeRead

protected void initializeResourcesBeforeRead(Connection con,
                                             Object lob)
Initialize any LOB resources before a read is done.

This implementation calls BLOB.open(BLOB.MODE_READONLY) or CLOB.open(CLOB.MODE_READONLY) on any non-temporary LOBs if releaseResourcesAfterRead property is set to true.

This method can be overridden by sublcasses if different behavior is desired.

Parameters:
con - the connection to be usde for initilization
lob - the LOB to initialize

releaseResourcesAfterRead

protected void releaseResourcesAfterRead(Connection con,
                                         Object lob)
Release any LOB resources after read is complete.

If releaseResourcesAfterRead property is set to true then this implementation calls BLOB.close() or CLOB.close() on any non-temporary LOBs that are open or BLOB.freeTemporary() or CLOB.freeTemporary() on any temporary LOBs.

This method can be overridden by sublcasses if different behavior is desired.

Parameters:
con - the connection to be usde for initilization
lob - the LOB to initialize
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OracleLobHandler.LobCallback

org.springframework.jdbc.support.lob
Interface OracleLobHandler.LobCallback

Enclosing class:
OracleLobHandler
protected static interface OracleLobHandler.LobCallback

Internal callback interface for use with createLob.

Method Summary
 void populateLob(Object lob)
Populate the given BLOB or CLOB instance with content.

Method Detail

populateLob

void populateLob(Object lob)
                 throws Exception
Populate the given BLOB or CLOB instance with content.

Throws:
Exception - any exception including InvocationTargetException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OracleLobHandler.OracleLobCreator

org.springframework.jdbc.support.lob
Class OracleLobHandler.OracleLobCreator

java.lang.Object
    extended by  org.springframework.jdbc.support.lob.OracleLobHandler.OracleLobCreator
All Implemented Interfaces:
LobCreator
Enclosing class:
OracleLobHandler
protected class OracleLobHandler.OracleLobCreator
extends Object
implements LobCreator

LobCreator implementation for Oracle databases. Creates Oracle-style temporary BLOBs and CLOBs that it frees on close.

See Also:
close()

Constructor Summary
protected OracleLobHandler.OracleLobCreator()
Method Summary
void | close() Free all temporary BLOBs and CLOBs created by this creator.
protected Object | createLob(PreparedStatement ps, boolean clob, OracleLobHandler.LobCallback callback) Create a LOB instance for the given PreparedStatement, populating it via the given callback.
protected Connection | getOracleConnection(PreparedStatement ps) Retrieve the underlying OracleConnection, using a NativeJdbcExtractor if set.
protected Object | prepareLob(Connection con, Class lobClass) Create and open an oracle.sql.BLOB/CLOB instance via reflection.
void | setBlobAsBinaryStream(PreparedStatement ps, int paramIndex, InputStream binaryStream, int contentLength) Set the given content as binary stream on the given statement, using the given parameter index.
void | setBlobAsBytes(PreparedStatement ps, int paramIndex, byte[] content) Set the given content as bytes on the given statement, using the given parameter index.
void | setClobAsAsciiStream(PreparedStatement ps, int paramIndex, InputStream asciiStream, int contentLength) Set the given content as ASCII stream on the given statement, using the given parameter index.
void | setClobAsCharacterStream(PreparedStatement ps, int paramIndex, Reader characterStream, int contentLength) Set the given content as character stream on the given statement, using the given parameter index.
void | setClobAsString(PreparedStatement ps, int paramIndex, String content) Set the given content as String on the given statement, using the given parameter index.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OracleLobHandler.OracleLobCreator

protected OracleLobHandler.OracleLobCreator()
Method Detail

setBlobAsBytes

public void setBlobAsBytes(PreparedStatement ps,
                           int paramIndex,
                           byte[] content)
                    throws SQLException
Description copied from interface: LobCreator
Set the given content as bytes on the given statement, using the given parameter index. Might simply invoke PreparedStatement.setBytes or create a Blob instance for it, depending on the database and driver.

Specified by:
setBlobAsBytes in interface LobCreator
Parameters:
ps - the PreparedStatement to the set the content on
paramIndex - the parameter index to use
content - the content as byte array, or null for SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
PreparedStatement.setBytes(int, byte[])

setBlobAsBinaryStream

public void setBlobAsBinaryStream(PreparedStatement ps,
                                  int paramIndex,
                                  InputStream binaryStream,
                                  int contentLength)
                           throws SQLException
Description copied from interface: LobCreator
Set the given content as binary stream on the given statement, using the given parameter index. Might simply invoke PreparedStatement.setBinaryStream or create a Blob instance for it, depending on the database and driver.

Specified by:
setBlobAsBinaryStream in interface LobCreator
Parameters:
ps - the PreparedStatement to the set the content on
paramIndex - the parameter index to use
binaryStream - the content as binary stream, or null for SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
PreparedStatement.setBinaryStream(int, java.io.InputStream, int)

setClobAsString

public void setClobAsString(PreparedStatement ps,
                            int paramIndex,
                            String content)
                     throws SQLException
Description copied from interface: LobCreator
Set the given content as String on the given statement, using the given parameter index. Might simply invoke PreparedStatement.setString or create a Clob instance for it, depending on the database and driver.

Specified by:
setClobAsString in interface LobCreator
Parameters:
ps - the PreparedStatement to the set the content on
paramIndex - the parameter index to use
content - the content as String, or null for SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
PreparedStatement.setBytes(int, byte[])

setClobAsAsciiStream

public void setClobAsAsciiStream(PreparedStatement ps,
                                 int paramIndex,
                                 InputStream asciiStream,
                                 int contentLength)
                          throws SQLException
Description copied from interface: LobCreator
Set the given content as ASCII stream on the given statement, using the given parameter index. Might simply invoke PreparedStatement.setAsciiStream or create a Clob instance for it, depending on the database and driver.

Specified by:
setClobAsAsciiStream in interface LobCreator
Parameters:
ps - the PreparedStatement to the set the content on
paramIndex - the parameter index to use
asciiStream - the content as ASCII stream, or null for SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
PreparedStatement.setAsciiStream(int, java.io.InputStream, int)

setClobAsCharacterStream

public void setClobAsCharacterStream(PreparedStatement ps,
                                     int paramIndex,
                                     Reader characterStream,
                                     int contentLength)
                              throws SQLException
Description copied from interface: LobCreator
Set the given content as character stream on the given statement, using the given parameter index. Might simply invoke PreparedStatement.setCharacterStream or create a Clob instance for it, depending on the database and driver.

Specified by:
setClobAsCharacterStream in interface LobCreator
Parameters:
ps - the PreparedStatement to the set the content on
paramIndex - the parameter index to use
characterStream - the content as character stream, or null for SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
PreparedStatement.setCharacterStream(int, java.io.Reader, int)

createLob

protected Object createLob(PreparedStatement ps,
                           boolean clob,
                           OracleLobHandler.LobCallback callback)
                    throws SQLException
Create a LOB instance for the given PreparedStatement, populating it via the given callback.

Throws:
SQLException

getOracleConnection

protected Connection getOracleConnection(PreparedStatement ps)
                                  throws SQLException,
                                         ClassNotFoundException
Retrieve the underlying OracleConnection, using a NativeJdbcExtractor if set.

Throws:
SQLException
ClassNotFoundException

prepareLob

protected Object prepareLob(Connection con,
                            Class lobClass)
                     throws Exception
Create and open an oracle.sql.BLOB/CLOB instance via reflection.

Throws:
Exception

close

public void close()
Free all temporary BLOBs and CLOBs created by this creator.

Specified by:
close in interface LobCreator
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SpringLobCreatorSynchronization

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.support.lob
Class SpringLobCreatorSynchronization

java.lang.Object
    extended by  org.springframework.transaction.support.TransactionSynchronizationAdapter
        extended by  org.springframework.jdbc.support.lob.SpringLobCreatorSynchronization
All Implemented Interfaces:
Ordered, TransactionSynchronization
public class SpringLobCreatorSynchronization
extends TransactionSynchronizationAdapter

Callback for resource cleanup at the end of a Spring transaction. Invokes LobCreator.close() to clean up temporary LOBs that might have been created.

Since:
2.0
Author:
Juergen Hoeller
See Also:
LobCreator.close()

Field Summary
static int LOB_CREATOR_SYNCHRONIZATION_ORDER
Order value for TransactionSynchronization objects that clean up LobCreators.
Fields inherited from interface org.springframework.transaction.support.TransactionSynchronization
STATUS_COMMITTED, STATUS_ROLLED_BACK, STATUS_UNKNOWN
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
SpringLobCreatorSynchronization(LobCreator lobCreator)
Create a SpringLobCreatorSynchronization for the given LobCreator.
Method Summary
void | afterCompletion(int status) Invoked after transaction commit/rollback.
void | beforeCompletion() Invoked before transaction commit/rollback.
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
Methods inherited from class org.springframework.transaction.support.TransactionSynchronizationAdapter
afterCommit, beforeCommit, flush, resume, suspend
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

LOB_CREATOR_SYNCHRONIZATION_ORDER

public static final int LOB_CREATOR_SYNCHRONIZATION_ORDER
Order value for TransactionSynchronization objects that clean up LobCreators. Return CONNECTION_SYNCHRONIZATION_ORDER - 200 to execute LobCreator cleanup before Hibernate Session (- 100) and JDBC Connection cleanup, if any.

See Also:
DataSourceUtils.CONNECTION_SYNCHRONIZATION_ORDER, Constant Field Values
Constructor Detail

SpringLobCreatorSynchronization

public SpringLobCreatorSynchronization(LobCreator lobCreator)
Create a SpringLobCreatorSynchronization for the given LobCreator.

Parameters:
lobCreator - the LobCreator to close after transaction completion
Method Detail

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Overrides:
getOrder in class TransactionSynchronizationAdapter
Returns:
the order value

beforeCompletion

public void beforeCompletion()
Description copied from interface: TransactionSynchronization
Invoked before transaction commit/rollback. Can perform resource cleanup before transaction completion.

This method will be invoked after beforeCommit, even when beforeCommit threw an exception. This callback allows for closing resources before transaction completion, for any outcome.

Specified by:
beforeCompletion in interface TransactionSynchronization
Overrides:
beforeCompletion in class TransactionSynchronizationAdapter
See Also:
TransactionSynchronization.beforeCommit(boolean), TransactionSynchronization.afterCompletion(int)

afterCompletion

public void afterCompletion(int status)
Description copied from interface: TransactionSynchronization
Invoked after transaction commit/rollback. Can perform resource cleanup after transaction completion.

NOTE: The transaction will have been committed or rolled back already, but the transactional resources might still be active and accessible. As a consequence, any data access code triggered at this point will still "participate" in the original transaction, allowing to perform some cleanup (with no commit following anymore!), unless it explicitly declares that it needs to run in a separate transaction. Hence: Use PROPAGATION_REQUIRES_NEW for any transactional operation that is called from here.

Specified by:
afterCompletion in interface TransactionSynchronization
Overrides:
afterCompletion in class TransactionSynchronizationAdapter
Parameters:
status - completion status according to the STATUS_* constants
See Also:
TransactionSynchronization.STATUS_COMMITTED, TransactionSynchronization.STATUS_ROLLED_BACK, TransactionSynchronization.STATUS_UNKNOWN, TransactionSynchronization.beforeCompletion()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jdbc.support.nativejdbc

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jdbc.support.nativejdbc

Provides a mechanism for extracting native implementations of JDBC interfaces from wrapper objects that got returned from connection pools.

See:
Description

Interface Summary
NativeJdbcExtractor Interface for extracting native JDBC objects from wrapped objects coming from connection pools.

Class Summary
C3P0NativeJdbcExtractor | Implementation of the NativeJdbcExtractor interface for the C3P0 connection pool.
CommonsDbcpNativeJdbcExtractor | Implementation of the NativeJdbcExtractor interface for the Jakarta Commons DBCP connection pool, version 1.1 or higher.
JBossNativeJdbcExtractor | Implementation of the NativeJdbcExtractor interface for JBoss, supporting JBoss Application Server 3.2.4+.
Jdbc4NativeJdbcExtractor | NativeJdbcExtractor implementation that delegates to JDBC 4.0's unwrap method, as defined by Wrapper.
NativeJdbcExtractorAdapter | Abstract adapter class for the NativeJdbcExtractor interface, for simplified implementation of basic extractors.
SimpleNativeJdbcExtractor | Simple implementation of the NativeJdbcExtractor interface.
WebLogicNativeJdbcExtractor | Implementation of the NativeJdbcExtractor interface for WebLogic, supporting WebLogic Server 8.1 and higher.
WebSphereNativeJdbcExtractor | Implementation of the NativeJdbcExtractor interface for WebSphere, supporting WebSphere Application Server 5.1 and higher.

Package org.springframework.jdbc.support.nativejdbc Description

Provides a mechanism for extracting native implementations of JDBC interfaces from wrapper objects that got returned from connection pools.

Can be used independently, for example in custom JDBC access code.


org.springframework.jdbc.support.nativejdbc Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jdbc.support.nativejdbc

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter (implements org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor)
      • org.springframework.jdbc.support.nativejdbc.C3P0NativeJdbcExtractor
      • org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor
      • org.springframework.jdbc.support.nativejdbc.JBossNativeJdbcExtractor
      • org.springframework.jdbc.support.nativejdbc.Jdbc4NativeJdbcExtractor
      • org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor
      • org.springframework.jdbc.support.nativejdbc.WebLogicNativeJdbcExtractor
      • org.springframework.jdbc.support.nativejdbc.WebSphereNativeJdbcExtractor

Interface Hierarchy

  • org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor


NativeJdbcExtractor

org.springframework.jdbc.support.nativejdbc
Interface NativeJdbcExtractor

All Known Implementing Classes:
C3P0NativeJdbcExtractor, CommonsDbcpNativeJdbcExtractor, JBossNativeJdbcExtractor, Jdbc4NativeJdbcExtractor, NativeJdbcExtractorAdapter, SimpleNativeJdbcExtractor, WebLogicNativeJdbcExtractor, WebSphereNativeJdbcExtractor
public interface NativeJdbcExtractor

Interface for extracting native JDBC objects from wrapped objects coming from connection pools. This is necessary to allow for casting to native implementations like OracleConnection or OracleResultSet in application code, for example to create Blobs or to access vendor-specific features.

Note: Setting a custom NativeJdbcExtractor is just necessary if you intend to cast to database-specific implementations like OracleConnection or OracleResultSet. Otherwise, any wrapped JDBC object will be fine, with no need for unwrapping.

Note: To be able to support any pool's strategy of native ResultSet wrapping, it is advisable to get both the native Statement and the native ResultSet via this extractor. Some pools just allow to unwrap the Statement, some just to unwrap the ResultSet - the above strategy will cover both. It is typically not necessary to unwrap the Connection to retrieve a native ResultSet.

When working with a simple connection pool that wraps Connections but not Statements, a SimpleNativeJdbcExtractor is often sufficient. However, some pools (like Jakarta's Commons DBCP) wrap all JDBC objects that they return: Therefore, you need to use a specific NativeJdbcExtractor (like CommonsDbcpNativeJdbcExtractor) with them.

JdbcTemplate can properly apply a NativeJdbcExtractor if specified, unwrapping all JDBC objects that it creates. Note that this is just necessary if you intend to cast to native implementations in your data access code.

OracleLobHandler, the Oracle-specific implementation of Spring's LobHandler interface, requires a NativeJdbcExtractor for obtaining the native OracleConnection. This is also necessary for other Oracle-specific features that you may want to leverage in your applications, such as Oracle InterMedia.

Since:
25.08.2003
Author:
Juergen Hoeller
See Also:
SimpleNativeJdbcExtractor, CommonsDbcpNativeJdbcExtractor, JdbcTemplate.setNativeJdbcExtractor(org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor), OracleLobHandler.setNativeJdbcExtractor(org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor)

Method Summary
CallableStatement | getNativeCallableStatement(CallableStatement cs) Retrieve the underlying native JDBC CallableStatement for the given statement.
Connection | getNativeConnection(Connection con) Retrieve the underlying native JDBC Connection for the given Connection.
Connection | getNativeConnectionFromStatement(Statement stmt) Retrieve the underlying native JDBC Connection for the given Statement.
PreparedStatement | getNativePreparedStatement(PreparedStatement ps) Retrieve the underlying native JDBC PreparedStatement for the given statement.
ResultSet | getNativeResultSet(ResultSet rs) Retrieve the underlying native JDBC ResultSet for the given statement.
Statement | getNativeStatement(Statement stmt) Retrieve the underlying native JDBC Statement for the given Statement.
boolean | isNativeConnectionNecessaryForNativeCallableStatements() Return whether it is necessary to work on the native Connection to receive native CallableStatements.
boolean | isNativeConnectionNecessaryForNativePreparedStatements() Return whether it is necessary to work on the native Connection to receive native PreparedStatements.
boolean | isNativeConnectionNecessaryForNativeStatements() Return whether it is necessary to work on the native Connection to receive native Statements.

Method Detail

isNativeConnectionNecessaryForNativeStatements

boolean isNativeConnectionNecessaryForNativeStatements()
Return whether it is necessary to work on the native Connection to receive native Statements.

This should be true if the connection pool does not allow to extract the native JDBC objects from its Statement wrapper but supports a way to retrieve the native JDBC Connection. This way, applications can still receive native Statements and ResultSet via working on the native JDBC Connection.

isNativeConnectionNecessaryForNativePreparedStatements

boolean isNativeConnectionNecessaryForNativePreparedStatements()
Return whether it is necessary to work on the native Connection to receive native PreparedStatements.

This should be true if the connection pool does not allow to extract the native JDBC objects from its PreparedStatement wrappers but supports a way to retrieve the native JDBC Connection. This way, applications can still receive native Statements and ResultSet via working on the native JDBC Connection.

isNativeConnectionNecessaryForNativeCallableStatements

boolean isNativeConnectionNecessaryForNativeCallableStatements()
Return whether it is necessary to work on the native Connection to receive native CallableStatements.

This should be true if the connection pool does not allow to extract the native JDBC objects from its CallableStatement wrappers but supports a way to retrieve the native JDBC Connection. This way, applications can still receive native Statements and ResultSet via working on the native JDBC Connection.

getNativeConnection

Connection getNativeConnection(Connection con)
                               throws SQLException
Retrieve the underlying native JDBC Connection for the given Connection. Supposed to return the given Connection if not capable of unwrapping.

Parameters:
con - the Connection handle, potentially wrapped by a connection pool
Returns:
the underlying native JDBC Connection, if possible; else, the original Connection
Throws:
SQLException - if thrown by JDBC methods

getNativeConnectionFromStatement

Connection getNativeConnectionFromStatement(Statement stmt)
                                            throws SQLException
Retrieve the underlying native JDBC Connection for the given Statement. Supposed to return the Statement.getConnection() if not capable of unwrapping.

Having this extra method allows for more efficient unwrapping if data access code already has a Statement. Statement.getConnection() often returns the native JDBC Connection even if the Statement itself is wrapped by a pool.

Parameters:
stmt - the Statement handle, potentially wrapped by a connection pool
Returns:
the underlying native JDBC Connection, if possible; else, the original Connection
Throws:
SQLException - if thrown by JDBC methods
See Also:
Statement.getConnection()

getNativeStatement

Statement getNativeStatement(Statement stmt)
                             throws SQLException
Retrieve the underlying native JDBC Statement for the given Statement. Supposed to return the given Statement if not capable of unwrapping.

Parameters:
stmt - the Statement handle, potentially wrapped by a connection pool
Returns:
the underlying native JDBC Statement, if possible; else, the original Statement
Throws:
SQLException - if thrown by JDBC methods

getNativePreparedStatement

PreparedStatement getNativePreparedStatement(PreparedStatement ps)
                                             throws SQLException
Retrieve the underlying native JDBC PreparedStatement for the given statement. Supposed to return the given PreparedStatement if not capable of unwrapping.

Parameters:
ps - the PreparedStatement handle, potentially wrapped by a connection pool
Returns:
the underlying native JDBC PreparedStatement, if possible; else, the original PreparedStatement
Throws:
SQLException - if thrown by JDBC methods

getNativeCallableStatement

CallableStatement getNativeCallableStatement(CallableStatement cs)
                                             throws SQLException
Retrieve the underlying native JDBC CallableStatement for the given statement. Supposed to return the given CallableStatement if not capable of unwrapping.

Parameters:
cs - the CallableStatement handle, potentially wrapped by a connection pool
Returns:
the underlying native JDBC CallableStatement, if possible; else, the original CallableStatement
Throws:
SQLException - if thrown by JDBC methods

getNativeResultSet

ResultSet getNativeResultSet(ResultSet rs)
                             throws SQLException
Retrieve the underlying native JDBC ResultSet for the given statement. Supposed to return the given ResultSet if not capable of unwrapping.

Parameters:
rs - the ResultSet handle, potentially wrapped by a connection pool
Returns:
the underlying native JDBC ResultSet, if possible; else, the original ResultSet
Throws:
SQLException - if thrown by JDBC methods
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


C3P0NativeJdbcExtractor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.support.nativejdbc
Class C3P0NativeJdbcExtractor

java.lang.Object
    extended by  org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
        extended by  org.springframework.jdbc.support.nativejdbc.C3P0NativeJdbcExtractor
All Implemented Interfaces:
NativeJdbcExtractor
public class C3P0NativeJdbcExtractor
extends NativeJdbcExtractorAdapter

Implementation of the NativeJdbcExtractor interface for the C3P0 connection pool.

Returns underlying native Connections to application code instead of C3P0's wrapper implementations; unwraps the Connection for native Statements. The returned JDBC classes can then safely be cast, e.g. to oracle.jdbc.OracleConnection.

This NativeJdbcExtractor can be set just to allow working with a C3P0 DataSource: If a given object is not a C3P0 wrapper, it will be returned as-is.

Note that this class requires C3P0 0.8.5 or later; for earlier C3P0 versions, use SimpleNativeJdbcExtractor (which won't work for C3P0 0.8.5 or later).

Since:
1.1.5
Author:
Juergen Hoeller
See Also:
C3P0ProxyConnection.rawConnectionOperation(java.lang.reflect.Method, java.lang.Object, java.lang.Object[]), SimpleNativeJdbcExtractor

Constructor Summary
C3P0NativeJdbcExtractor()
Method Summary
protected Connection | doGetNativeConnection(Connection con) Retrieve the Connection via C3P0's rawConnectionOperation API, using the getRawConnection as callback to get access to the raw Connection (which is otherwise not directly supported by C3P0).
static Connection | getRawConnection(Connection con) This method is not meant to be used directly; it rather serves as callback method for C3P0's "rawConnectionOperation" API.
boolean | isNativeConnectionNecessaryForNativeCallableStatements() Return false by default.
boolean | isNativeConnectionNecessaryForNativePreparedStatements() Return false by default.
boolean | isNativeConnectionNecessaryForNativeStatements() Return false by default.
Methods inherited from class org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
getNativeCallableStatement, getNativeConnection, getNativeConnectionFromStatement, getNativePreparedStatement, getNativeResultSet, getNativeStatement
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

C3P0NativeJdbcExtractor

public C3P0NativeJdbcExtractor()
Method Detail

getRawConnection

public static Connection getRawConnection(Connection con)
This method is not meant to be used directly; it rather serves as callback method for C3P0's "rawConnectionOperation" API.

Parameters:
con - a native Connection handle
Returns:
the native Connection handle, as-is

isNativeConnectionNecessaryForNativeStatements

public boolean isNativeConnectionNecessaryForNativeStatements()
Description copied from class: NativeJdbcExtractorAdapter
Return false by default.

Specified by:
isNativeConnectionNecessaryForNativeStatements in interface NativeJdbcExtractor
Overrides:
isNativeConnectionNecessaryForNativeStatements in class NativeJdbcExtractorAdapter

isNativeConnectionNecessaryForNativePreparedStatements

public boolean isNativeConnectionNecessaryForNativePreparedStatements()
Description copied from class: NativeJdbcExtractorAdapter
Return false by default.

Specified by:
isNativeConnectionNecessaryForNativePreparedStatements in interface NativeJdbcExtractor
Overrides:
isNativeConnectionNecessaryForNativePreparedStatements in class NativeJdbcExtractorAdapter

isNativeConnectionNecessaryForNativeCallableStatements

public boolean isNativeConnectionNecessaryForNativeCallableStatements()
Description copied from class: NativeJdbcExtractorAdapter
Return false by default.

Specified by:
isNativeConnectionNecessaryForNativeCallableStatements in interface NativeJdbcExtractor
Overrides:
isNativeConnectionNecessaryForNativeCallableStatements in class NativeJdbcExtractorAdapter

doGetNativeConnection

protected Connection doGetNativeConnection(Connection con)
                                    throws SQLException
Retrieve the Connection via C3P0's rawConnectionOperation API, using the getRawConnection as callback to get access to the raw Connection (which is otherwise not directly supported by C3P0).

Overrides:
doGetNativeConnection in class NativeJdbcExtractorAdapter
Throws:
SQLException
See Also:
getRawConnection(java.sql.Connection)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


CommonsDbcpNativeJdbcExtractor

org.springframework.jdbc.support.nativejdbc
Class CommonsDbcpNativeJdbcExtractor

java.lang.Object
    extended by  org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
        extended by  org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor
All Implemented Interfaces:
NativeJdbcExtractor
public class CommonsDbcpNativeJdbcExtractor
extends NativeJdbcExtractorAdapter

Implementation of the NativeJdbcExtractor interface for the Jakarta Commons DBCP connection pool, version 1.1 or higher.

Returns the underlying native Connection, Statement, etc to application code instead of DBCP's wrapper implementations. The returned JDBC classes can then safely be cast, e.g. to oracle.jdbc.OracleConnection.

This NativeJdbcExtractor can be set just to allow working with a Commons DBCP DataSource: If a given object is not a Commons DBCP wrapper, it will be returned as-is.

Note that this version of CommonsDbcpNativeJdbcExtractor will work against the original Commons DBCP in org.apache.commons.dbcp as well as against Tomcat 5.5's relocated Commons DBCP version in the org.apache.tomcat.dbcp.dbcp package.

Since:
25.08.2003
Author:
Juergen Hoeller

Constructor Summary
CommonsDbcpNativeJdbcExtractor()
Method Summary
protected Connection | doGetNativeConnection(Connection con) Not able to unwrap: return passed-in Connection.
CallableStatement | getNativeCallableStatement(CallableStatement cs) Not able to unwrap: return passed-in CallableStatement.
PreparedStatement | getNativePreparedStatement(PreparedStatement ps) Not able to unwrap: return passed-in PreparedStatement.
ResultSet | getNativeResultSet(ResultSet rs) Not able to unwrap: return passed-in ResultSet.
Statement | getNativeStatement(Statement stmt) Not able to unwrap: return passed-in Statement.
Methods inherited from class org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
getNativeConnection, getNativeConnectionFromStatement, isNativeConnectionNecessaryForNativeCallableStatements, isNativeConnectionNecessaryForNativePreparedStatements, isNativeConnectionNecessaryForNativeStatements
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CommonsDbcpNativeJdbcExtractor

public CommonsDbcpNativeJdbcExtractor()
Method Detail

doGetNativeConnection

protected Connection doGetNativeConnection(Connection con)
                                    throws SQLException
Description copied from class: NativeJdbcExtractorAdapter
Not able to unwrap: return passed-in Connection.

Overrides:
doGetNativeConnection in class NativeJdbcExtractorAdapter
Throws:
SQLException

getNativeStatement

public Statement getNativeStatement(Statement stmt)
                             throws SQLException
Description copied from class: NativeJdbcExtractorAdapter
Not able to unwrap: return passed-in Statement.

Specified by:
getNativeStatement in interface NativeJdbcExtractor
Overrides:
getNativeStatement in class NativeJdbcExtractorAdapter
Parameters:
stmt - the Statement handle, potentially wrapped by a connection pool
Returns:
the underlying native JDBC Statement, if possible; else, the original Statement
Throws:
SQLException - if thrown by JDBC methods

getNativePreparedStatement

public PreparedStatement getNativePreparedStatement(PreparedStatement ps)
                                             throws SQLException
Description copied from class: NativeJdbcExtractorAdapter
Not able to unwrap: return passed-in PreparedStatement.

Specified by:
getNativePreparedStatement in interface NativeJdbcExtractor
Overrides:
getNativePreparedStatement in class NativeJdbcExtractorAdapter
Parameters:
ps - the PreparedStatement handle, potentially wrapped by a connection pool
Returns:
the underlying native JDBC PreparedStatement, if possible; else, the original PreparedStatement
Throws:
SQLException - if thrown by JDBC methods

getNativeCallableStatement

public CallableStatement getNativeCallableStatement(CallableStatement cs)
                                             throws SQLException
Description copied from class: NativeJdbcExtractorAdapter
Not able to unwrap: return passed-in CallableStatement.

Specified by:
getNativeCallableStatement in interface NativeJdbcExtractor
Overrides:
getNativeCallableStatement in class NativeJdbcExtractorAdapter
Parameters:
cs - the CallableStatement handle, potentially wrapped by a connection pool
Returns:
the underlying native JDBC CallableStatement, if possible; else, the original CallableStatement
Throws:
SQLException - if thrown by JDBC methods

getNativeResultSet

public ResultSet getNativeResultSet(ResultSet rs)
                             throws SQLException
Description copied from class: NativeJdbcExtractorAdapter
Not able to unwrap: return passed-in ResultSet.

Specified by:
getNativeResultSet in interface NativeJdbcExtractor
Overrides:
getNativeResultSet in class NativeJdbcExtractorAdapter
Parameters:
rs - the ResultSet handle, potentially wrapped by a connection pool
Returns:
the underlying native JDBC ResultSet, if possible; else, the original ResultSet
Throws:
SQLException - if thrown by JDBC methods
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JBossNativeJdbcExtractor

org.springframework.jdbc.support.nativejdbc
Class JBossNativeJdbcExtractor

java.lang.Object
    extended by  org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
        extended by  org.springframework.jdbc.support.nativejdbc.JBossNativeJdbcExtractor
All Implemented Interfaces:
NativeJdbcExtractor
public class JBossNativeJdbcExtractor
extends NativeJdbcExtractorAdapter

Implementation of the NativeJdbcExtractor interface for JBoss, supporting JBoss Application Server 3.2.4+.

Returns the underlying native Connection, Statement, etc to application code instead of JBoss' wrapper implementations. The returned JDBC classes can then safely be cast, e.g. to oracle.jdbc.OracleConnection.

This NativeJdbcExtractor can be set just to allow working with a JBoss connection pool: If a given object is not a JBoss wrapper, it will be returned as-is.

Since:
03.01.2004
Author:
Juergen Hoeller
See Also:
org.jboss.resource.adapter.jdbc.WrappedConnection#getUnderlyingConnection, org.jboss.resource.adapter.jdbc.WrappedStatement#getUnderlyingStatement, org.jboss.resource.adapter.jdbc.WrappedResultSet#getUnderlyingResultSet

Constructor Summary
JBossNativeJdbcExtractor()
This constructor retrieves JBoss JDBC wrapper classes, so we can get the underlying vendor connection using reflection.
Method Summary
protected Connection | doGetNativeConnection(Connection con) Retrieve the Connection via JBoss' getUnderlyingConnection method.
CallableStatement | getNativeCallableStatement(CallableStatement cs) Retrieve the Connection via JBoss' getUnderlyingStatement method.
PreparedStatement | getNativePreparedStatement(PreparedStatement ps) Retrieve the Connection via JBoss' getUnderlyingStatement method.
ResultSet | getNativeResultSet(ResultSet rs) Retrieve the Connection via JBoss' getUnderlyingResultSet method.
Statement | getNativeStatement(Statement stmt) Retrieve the Connection via JBoss' getUnderlyingStatement method.
Methods inherited from class org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
getNativeConnection, getNativeConnectionFromStatement, isNativeConnectionNecessaryForNativeCallableStatements, isNativeConnectionNecessaryForNativePreparedStatements, isNativeConnectionNecessaryForNativeStatements
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JBossNativeJdbcExtractor

public JBossNativeJdbcExtractor()
This constructor retrieves JBoss JDBC wrapper classes, so we can get the underlying vendor connection using reflection.

Method Detail

doGetNativeConnection

protected Connection doGetNativeConnection(Connection con)
                                    throws SQLException
Retrieve the Connection via JBoss' getUnderlyingConnection method.

Overrides:
doGetNativeConnection in class NativeJdbcExtractorAdapter
Throws:
SQLException

getNativeStatement

public Statement getNativeStatement(Statement stmt)
                             throws SQLException
Retrieve the Connection via JBoss' getUnderlyingStatement method.

Specified by:
getNativeStatement in interface NativeJdbcExtractor
Overrides:
getNativeStatement in class NativeJdbcExtractorAdapter
Parameters:
stmt - the Statement handle, potentially wrapped by a connection pool
Returns:
the underlying native JDBC Statement, if possible; else, the original Statement
Throws:
SQLException - if thrown by JDBC methods

getNativePreparedStatement

public PreparedStatement getNativePreparedStatement(PreparedStatement ps)
                                             throws SQLException
Retrieve the Connection via JBoss' getUnderlyingStatement method.

Specified by:
getNativePreparedStatement in interface NativeJdbcExtractor
Overrides:
getNativePreparedStatement in class NativeJdbcExtractorAdapter
Parameters:
ps - the PreparedStatement handle, potentially wrapped by a connection pool
Returns:
the underlying native JDBC PreparedStatement, if possible; else, the original PreparedStatement
Throws:
SQLException - if thrown by JDBC methods

getNativeCallableStatement

public CallableStatement getNativeCallableStatement(CallableStatement cs)
                                             throws SQLException
Retrieve the Connection via JBoss' getUnderlyingStatement method.

Specified by:
getNativeCallableStatement in interface NativeJdbcExtractor
Overrides:
getNativeCallableStatement in class NativeJdbcExtractorAdapter
Parameters:
cs - the CallableStatement handle, potentially wrapped by a connection pool
Returns:
the underlying native JDBC CallableStatement, if possible; else, the original CallableStatement
Throws:
SQLException - if thrown by JDBC methods

getNativeResultSet

public ResultSet getNativeResultSet(ResultSet rs)
                             throws SQLException
Retrieve the Connection via JBoss' getUnderlyingResultSet method.

Specified by:
getNativeResultSet in interface NativeJdbcExtractor
Overrides:
getNativeResultSet in class NativeJdbcExtractorAdapter
Parameters:
rs - the ResultSet handle, potentially wrapped by a connection pool
Returns:
the underlying native JDBC ResultSet, if possible; else, the original ResultSet
Throws:
SQLException - if thrown by JDBC methods
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Jdbc4NativeJdbcExtractor

org.springframework.jdbc.support.nativejdbc
Class Jdbc4NativeJdbcExtractor

java.lang.Object
    extended by  org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
        extended by  org.springframework.jdbc.support.nativejdbc.Jdbc4NativeJdbcExtractor
All Implemented Interfaces:
NativeJdbcExtractor
public class Jdbc4NativeJdbcExtractor
extends NativeJdbcExtractorAdapter

NativeJdbcExtractor implementation that delegates to JDBC 4.0's unwrap method, as defined by Wrapper.

Note: Only use this when actually running against a JDBC 4.0 driver, with a connection pool that supports the JDBC 4.0 API (i.e. at least accepts JDBC 4.0 API calls and passes them through to the underlying driver)!

Since:
2.5
Author:
Juergen Hoeller
See Also:
Wrapper.unwrap(java.lang.Class), SimpleNativeJdbcExtractor, JdbcTemplate.setNativeJdbcExtractor(org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor), OracleLobHandler.setNativeJdbcExtractor(org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor)

Constructor Summary
Jdbc4NativeJdbcExtractor()
Method Summary
protected Connection | doGetNativeConnection(Connection con) Not able to unwrap: return passed-in Connection.
CallableStatement | getNativeCallableStatement(CallableStatement cs) Not able to unwrap: return passed-in CallableStatement.
PreparedStatement | getNativePreparedStatement(PreparedStatement ps) Not able to unwrap: return passed-in PreparedStatement.
ResultSet | getNativeResultSet(ResultSet rs) Not able to unwrap: return passed-in ResultSet.
Statement | getNativeStatement(Statement stmt) Not able to unwrap: return passed-in Statement.
Methods inherited from class org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
getNativeConnection, getNativeConnectionFromStatement, isNativeConnectionNecessaryForNativeCallableStatements, isNativeConnectionNecessaryForNativePreparedStatements, isNativeConnectionNecessaryForNativeStatements
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Jdbc4NativeJdbcExtractor

public Jdbc4NativeJdbcExtractor()
Method Detail

doGetNativeConnection

protected Connection doGetNativeConnection(Connection con)
                                    throws SQLException
Description copied from class: NativeJdbcExtractorAdapter
Not able to unwrap: return passed-in Connection.

Overrides:
doGetNativeConnection in class NativeJdbcExtractorAdapter
Throws:
SQLException

getNativeStatement

public Statement getNativeStatement(Statement stmt)
                             throws SQLException
Description copied from class: NativeJdbcExtractorAdapter
Not able to unwrap: return passed-in Statement.

Specified by:
getNativeStatement in interface NativeJdbcExtractor
Overrides:
getNativeStatement in class NativeJdbcExtractorAdapter
Parameters:
stmt - the Statement handle, potentially wrapped by a connection pool
Returns:
the underlying native JDBC Statement, if possible; else, the original Statement
Throws:
SQLException - if thrown by JDBC methods

getNativePreparedStatement

public PreparedStatement getNativePreparedStatement(PreparedStatement ps)
                                             throws SQLException
Description copied from class: NativeJdbcExtractorAdapter
Not able to unwrap: return passed-in PreparedStatement.

Specified by:
getNativePreparedStatement in interface NativeJdbcExtractor
Overrides:
getNativePreparedStatement in class NativeJdbcExtractorAdapter
Parameters:
ps - the PreparedStatement handle, potentially wrapped by a connection pool
Returns:
the underlying native JDBC PreparedStatement, if possible; else, the original PreparedStatement
Throws:
SQLException - if thrown by JDBC methods

getNativeCallableStatement

public CallableStatement getNativeCallableStatement(CallableStatement cs)
                                             throws SQLException
Description copied from class: NativeJdbcExtractorAdapter
Not able to unwrap: return passed-in CallableStatement.

Specified by:
getNativeCallableStatement in interface NativeJdbcExtractor
Overrides:
getNativeCallableStatement in class NativeJdbcExtractorAdapter
Parameters:
cs - the CallableStatement handle, potentially wrapped by a connection pool
Returns:
the underlying native JDBC CallableStatement, if possible; else, the original CallableStatement
Throws:
SQLException - if thrown by JDBC methods

getNativeResultSet

public ResultSet getNativeResultSet(ResultSet rs)
                             throws SQLException
Description copied from class: NativeJdbcExtractorAdapter
Not able to unwrap: return passed-in ResultSet.

Specified by:
getNativeResultSet in interface NativeJdbcExtractor
Overrides:
getNativeResultSet in class NativeJdbcExtractorAdapter
Parameters:
rs - the ResultSet handle, potentially wrapped by a connection pool
Returns:
the underlying native JDBC ResultSet, if possible; else, the original ResultSet
Throws:
SQLException - if thrown by JDBC methods
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NativeJdbcExtractorAdapter

org.springframework.jdbc.support.nativejdbc
Class NativeJdbcExtractorAdapter

java.lang.Object
    extended by  org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
All Implemented Interfaces:
NativeJdbcExtractor
Direct Known Subclasses:
C3P0NativeJdbcExtractor, CommonsDbcpNativeJdbcExtractor, JBossNativeJdbcExtractor, Jdbc4NativeJdbcExtractor, SimpleNativeJdbcExtractor, WebLogicNativeJdbcExtractor, WebSphereNativeJdbcExtractor
public abstract class NativeJdbcExtractorAdapter
extends Object
implements NativeJdbcExtractor

Abstract adapter class for the NativeJdbcExtractor interface, for simplified implementation of basic extractors. Basically returns the passed-in JDBC objects on all methods.

getNativeConnection checks for a ConnectionProxy chain, for example from a TransactionAwareDataSourceProxy, before delegating to doGetNativeConnection for actual unwrapping. You can override either of the two for a specific connection pool, but the latter is recommended to participate in ConnectionProxy unwrapping.

getNativeConnection also applies a fallback if the first native extraction process failed, that is, returned the same Connection as passed in. It assumes that some additional proxying is going in this case: Hence, it retrieves the underlying native Connection from the DatabaseMetaData via conHandle.getMetaData().getConnection() and retries the native extraction process based on that Connection handle. This works, for example, for the Connection proxies exposed by Hibernate 3.1's Session.connection().

The getNativeConnectionFromStatement method is implemented to simply delegate to getNativeConnection with the Statement's Connection. This is what most extractor implementations will stick to, unless there's a more efficient version for a specific pool.

Since:
1.1
Author:
Juergen Hoeller
See Also:
getNativeConnection(java.sql.Connection), getNativeConnectionFromStatement(java.sql.Statement), ConnectionProxy

Constructor Summary
NativeJdbcExtractorAdapter()
Method Summary
protected Connection | doGetNativeConnection(Connection con) Not able to unwrap: return passed-in Connection.
CallableStatement | getNativeCallableStatement(CallableStatement cs) Not able to unwrap: return passed-in CallableStatement.
Connection | getNativeConnection(Connection con) Check for a ConnectionProxy chain, then delegate to doGetNativeConnection.
Connection | getNativeConnectionFromStatement(Statement stmt) Retrieve the Connection via the Statement's Connection.
PreparedStatement | getNativePreparedStatement(PreparedStatement ps) Not able to unwrap: return passed-in PreparedStatement.
ResultSet | getNativeResultSet(ResultSet rs) Not able to unwrap: return passed-in ResultSet.
Statement | getNativeStatement(Statement stmt) Not able to unwrap: return passed-in Statement.
boolean | isNativeConnectionNecessaryForNativeCallableStatements() Return false by default.
boolean | isNativeConnectionNecessaryForNativePreparedStatements() Return false by default.
boolean | isNativeConnectionNecessaryForNativeStatements() Return false by default.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

NativeJdbcExtractorAdapter

public NativeJdbcExtractorAdapter()
Method Detail

isNativeConnectionNecessaryForNativeStatements

public boolean isNativeConnectionNecessaryForNativeStatements()
Return false by default.

Specified by:
isNativeConnectionNecessaryForNativeStatements in interface NativeJdbcExtractor

isNativeConnectionNecessaryForNativePreparedStatements

public boolean isNativeConnectionNecessaryForNativePreparedStatements()
Return false by default.

Specified by:
isNativeConnectionNecessaryForNativePreparedStatements in interface NativeJdbcExtractor

isNativeConnectionNecessaryForNativeCallableStatements

public boolean isNativeConnectionNecessaryForNativeCallableStatements()
Return false by default.

Specified by:
isNativeConnectionNecessaryForNativeCallableStatements in interface NativeJdbcExtractor

getNativeConnection

public Connection getNativeConnection(Connection con)
                               throws SQLException
Check for a ConnectionProxy chain, then delegate to doGetNativeConnection.

ConnectionProxy is used by Spring's TransactionAwareDataSourceProxy and LazyConnectionDataSourceProxy. The target connection behind it is typically one from a local connection pool, to be unwrapped by the doGetNativeConnection implementation of a concrete subclass.

Specified by:
getNativeConnection in interface NativeJdbcExtractor
Parameters:
con - the Connection handle, potentially wrapped by a connection pool
Returns:
the underlying native JDBC Connection, if possible; else, the original Connection
Throws:
SQLException - if thrown by JDBC methods
See Also:
doGetNativeConnection(java.sql.Connection), ConnectionProxy, DataSourceUtils.getTargetConnection(java.sql.Connection), TransactionAwareDataSourceProxy, LazyConnectionDataSourceProxy

doGetNativeConnection

protected Connection doGetNativeConnection(Connection con)
                                    throws SQLException
Not able to unwrap: return passed-in Connection.

Throws:
SQLException

getNativeConnectionFromStatement

public Connection getNativeConnectionFromStatement(Statement stmt)
                                            throws SQLException
Retrieve the Connection via the Statement's Connection.

Specified by:
getNativeConnectionFromStatement in interface NativeJdbcExtractor
Parameters:
stmt - the Statement handle, potentially wrapped by a connection pool
Returns:
the underlying native JDBC Connection, if possible; else, the original Connection
Throws:
SQLException - if thrown by JDBC methods
See Also:
getNativeConnection(java.sql.Connection), Statement.getConnection()

getNativeStatement

public Statement getNativeStatement(Statement stmt)
                             throws SQLException
Not able to unwrap: return passed-in Statement.

Specified by:
getNativeStatement in interface NativeJdbcExtractor
Parameters:
stmt - the Statement handle, potentially wrapped by a connection pool
Returns:
the underlying native JDBC Statement, if possible; else, the original Statement
Throws:
SQLException - if thrown by JDBC methods

getNativePreparedStatement

public PreparedStatement getNativePreparedStatement(PreparedStatement ps)
                                             throws SQLException
Not able to unwrap: return passed-in PreparedStatement.

Specified by:
getNativePreparedStatement in interface NativeJdbcExtractor
Parameters:
ps - the PreparedStatement handle, potentially wrapped by a connection pool
Returns:
the underlying native JDBC PreparedStatement, if possible; else, the original PreparedStatement
Throws:
SQLException - if thrown by JDBC methods

getNativeCallableStatement

public CallableStatement getNativeCallableStatement(CallableStatement cs)
                                             throws SQLException
Not able to unwrap: return passed-in CallableStatement.

Specified by:
getNativeCallableStatement in interface NativeJdbcExtractor
Parameters:
cs - the CallableStatement handle, potentially wrapped by a connection pool
Returns:
the underlying native JDBC CallableStatement, if possible; else, the original CallableStatement
Throws:
SQLException - if thrown by JDBC methods

getNativeResultSet

public ResultSet getNativeResultSet(ResultSet rs)
                             throws SQLException
Not able to unwrap: return passed-in ResultSet.

Specified by:
getNativeResultSet in interface NativeJdbcExtractor
Parameters:
rs - the ResultSet handle, potentially wrapped by a connection pool
Returns:
the underlying native JDBC ResultSet, if possible; else, the original ResultSet
Throws:
SQLException - if thrown by JDBC methods
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleNativeJdbcExtractor

org.springframework.jdbc.support.nativejdbc
Class SimpleNativeJdbcExtractor

java.lang.Object
    extended by  org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
        extended by  org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor
All Implemented Interfaces:
NativeJdbcExtractor
public class SimpleNativeJdbcExtractor
extends NativeJdbcExtractorAdapter

Simple implementation of the NativeJdbcExtractor interface. Assumes a pool that wraps Connection handles but not DatabaseMetaData: In this case, the underlying native Connection can be retrieved by simply calling conHandle.getMetaData().getConnection(). All other JDBC objects will be returned as passed in.

This extractor should work with any pool that does not wrap DatabaseMetaData, and will also work with any plain JDBC driver. Note that a pool can still wrap Statements, PreparedStatements, etc: The only requirement of this extractor is that java.sql.DatabaseMetaData does not get wrapped, returning the native Connection of the JDBC driver on metaData.getConnection().

Customize this extractor by setting the "nativeConnectionNecessaryForXxx" flags accordingly: If Statements, PreparedStatements, and/or CallableStatements are wrapped by your pool, set the corresponding "nativeConnectionNecessaryForXxx" flags to "true". If none of the statement types is wrapped - or you solely need Connection unwrapping in the first place -, the defaults are fine.

SimpleNativeJdbcExtractor is a common choice for use with OracleLobHandler, which just needs Connection unwrapping via the NativeJdbcExtractorAdapter.getNativeConnectionFromStatement(java.sql.Statement) method. This usage will work with almost any connection pool. Known to work are, for example:

  • Caucho Resin 2.1.x, 3.0.x
  • Sun Java System Application Server 8
  • Oracle OC4J 9.0.3, 9.0.4
  • C3P0 0.8.x
  • Jakarta Commons DBCP 1.0, 1.1, 1.2 (used in Tomcat 4.1.x, 5.0.x)
  • JBoss 3.2.x

For full usage with JdbcTemplate, i.e. to also provide Statement unwrapping:

  • Use a default SimpleNativeJdbcExtractor for Resin and SJSAS (no JDBC Statement objects are wrapped, therefore no special unwrapping is necessary).
  • Use a SimpleNativeJdbcExtractor with all "nativeConnectionNecessaryForXxx" flags set to "true" for OC4J and C3P0 (all JDBC Statement objects are wrapped, but none of the wrappers allow for unwrapping).
  • Use a CommonsDbcpNativeJdbcExtractor for Jakarta Commons DBCP respectively a JBossNativeJdbcExtractor for JBoss (all JDBC Statement objects are wrapped, but all of them can be extracted by casting to implementation classes).

Since:
05.12.2003
Author:
Juergen Hoeller
See Also:
setNativeConnectionNecessaryForNativeStatements(boolean), setNativeConnectionNecessaryForNativePreparedStatements(boolean), setNativeConnectionNecessaryForNativeCallableStatements(boolean), Jdbc4NativeJdbcExtractor, JdbcTemplate.setNativeJdbcExtractor(org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor), OracleLobHandler.setNativeJdbcExtractor(org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor)

Constructor Summary
SimpleNativeJdbcExtractor()
Method Summary
boolean | isNativeConnectionNecessaryForNativeCallableStatements() Return false by default.
boolean | isNativeConnectionNecessaryForNativePreparedStatements() Return false by default.
boolean | isNativeConnectionNecessaryForNativeStatements() Return false by default.
void | setNativeConnectionNecessaryForNativeCallableStatements(boolean nativeConnectionNecessary) Set whether it is necessary to work on the native Connection to receive native CallableStatements.
void | setNativeConnectionNecessaryForNativePreparedStatements(boolean nativeConnectionNecessary) Set whether it is necessary to work on the native Connection to receive native PreparedStatements.
void | setNativeConnectionNecessaryForNativeStatements(boolean nativeConnectionNecessaryForNativeStatements) Set whether it is necessary to work on the native Connection to receive native Statements.
Methods inherited from class org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
doGetNativeConnection, getNativeCallableStatement, getNativeConnection, getNativeConnectionFromStatement, getNativePreparedStatement, getNativeResultSet, getNativeStatement
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleNativeJdbcExtractor

public SimpleNativeJdbcExtractor()
Method Detail

setNativeConnectionNecessaryForNativeStatements

public void setNativeConnectionNecessaryForNativeStatements(boolean nativeConnectionNecessaryForNativeStatements)
Set whether it is necessary to work on the native Connection to receive native Statements. Default is "false". If true, the Connection will be unwrapped first to create a Statement.

This makes sense if you need to work with native Statements from a pool that does not allow to extract the native JDBC objects from its wrappers but returns the native Connection on DatabaseMetaData.getConnection.

The standard SimpleNativeJdbcExtractor is unable to unwrap statements, so set this to true if your connection pool wraps Statements.

See Also:
Connection.createStatement(), DatabaseMetaData.getConnection()

isNativeConnectionNecessaryForNativeStatements

public boolean isNativeConnectionNecessaryForNativeStatements()
Description copied from class: NativeJdbcExtractorAdapter
Return false by default.

Specified by:
isNativeConnectionNecessaryForNativeStatements in interface NativeJdbcExtractor
Overrides:
isNativeConnectionNecessaryForNativeStatements in class NativeJdbcExtractorAdapter

setNativeConnectionNecessaryForNativePreparedStatements

public void setNativeConnectionNecessaryForNativePreparedStatements(boolean nativeConnectionNecessary)
Set whether it is necessary to work on the native Connection to receive native PreparedStatements. Default is "false". If true, the Connection will be unwrapped first to create a PreparedStatement.

This makes sense if you need to work with native PreparedStatements from a pool that does not allow to extract the native JDBC objects from its wrappers but returns the native Connection on Statement.getConnection.

The standard SimpleNativeJdbcExtractor is unable to unwrap statements, so set this to true if your connection pool wraps PreparedStatements.

See Also:
Connection.prepareStatement(java.lang.String), DatabaseMetaData.getConnection()

isNativeConnectionNecessaryForNativePreparedStatements

public boolean isNativeConnectionNecessaryForNativePreparedStatements()
Description copied from class: NativeJdbcExtractorAdapter
Return false by default.

Specified by:
isNativeConnectionNecessaryForNativePreparedStatements in interface NativeJdbcExtractor
Overrides:
isNativeConnectionNecessaryForNativePreparedStatements in class NativeJdbcExtractorAdapter

setNativeConnectionNecessaryForNativeCallableStatements

public void setNativeConnectionNecessaryForNativeCallableStatements(boolean nativeConnectionNecessary)
Set whether it is necessary to work on the native Connection to receive native CallableStatements. Default is "false". If true, the Connection will be unwrapped first to create a CallableStatement.

This makes sense if you need to work with native CallableStatements from a pool that does not allow to extract the native JDBC objects from its wrappers but returns the native Connection on Statement.getConnection.

The standard SimpleNativeJdbcExtractor is unable to unwrap statements, so set this to true if your connection pool wraps CallableStatements.

See Also:
Connection.prepareCall(java.lang.String), DatabaseMetaData.getConnection()

isNativeConnectionNecessaryForNativeCallableStatements

public boolean isNativeConnectionNecessaryForNativeCallableStatements()
Description copied from class: NativeJdbcExtractorAdapter
Return false by default.

Specified by:
isNativeConnectionNecessaryForNativeCallableStatements in interface NativeJdbcExtractor
Overrides:
isNativeConnectionNecessaryForNativeCallableStatements in class NativeJdbcExtractorAdapter
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WebLogicNativeJdbcExtractor

org.springframework.jdbc.support.nativejdbc
Class WebLogicNativeJdbcExtractor

java.lang.Object
    extended by  org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
        extended by  org.springframework.jdbc.support.nativejdbc.WebLogicNativeJdbcExtractor
All Implemented Interfaces:
NativeJdbcExtractor
public class WebLogicNativeJdbcExtractor
extends NativeJdbcExtractorAdapter

Implementation of the NativeJdbcExtractor interface for WebLogic, supporting WebLogic Server 8.1 and higher.

Returns the underlying native Connection to application code instead of WebLogic's wrapper implementation; unwraps the Connection for native statements. The returned JDBC classes can then safely be cast, e.g. to oracle.jdbc.OracleConnection.

This NativeJdbcExtractor can be set just to allow working with a WebLogic DataSource: If a given object is not a WebLogic Connection wrapper, it will be returned as-is.

Since:
1.0.2
Author:
Thomas Risberg, Juergen Hoeller
See Also:
NativeJdbcExtractorAdapter.getNativeConnection(java.sql.Connection), weblogic.jdbc.extensions.WLConnection#getVendorConnection

Constructor Summary
WebLogicNativeJdbcExtractor()
This constructor retrieves the WebLogic JDBC extension interface, so we can get the underlying vendor connection using reflection.
Method Summary
protected Connection | doGetNativeConnection(Connection con) Retrieve the Connection via WebLogic's getVendorConnection method.
boolean | isNativeConnectionNecessaryForNativeCallableStatements() Return true, as WebLogic returns wrapped CallableStatements.
boolean | isNativeConnectionNecessaryForNativePreparedStatements() Return true, as WebLogic returns wrapped PreparedStatements.
boolean | isNativeConnectionNecessaryForNativeStatements() Return true, as WebLogic returns wrapped Statements.
Methods inherited from class org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
getNativeCallableStatement, getNativeConnection, getNativeConnectionFromStatement, getNativePreparedStatement, getNativeResultSet, getNativeStatement
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

WebLogicNativeJdbcExtractor

public WebLogicNativeJdbcExtractor()
This constructor retrieves the WebLogic JDBC extension interface, so we can get the underlying vendor connection using reflection.

Method Detail

isNativeConnectionNecessaryForNativeStatements

public boolean isNativeConnectionNecessaryForNativeStatements()
Return true, as WebLogic returns wrapped Statements.

Specified by:
isNativeConnectionNecessaryForNativeStatements in interface NativeJdbcExtractor
Overrides:
isNativeConnectionNecessaryForNativeStatements in class NativeJdbcExtractorAdapter

isNativeConnectionNecessaryForNativePreparedStatements

public boolean isNativeConnectionNecessaryForNativePreparedStatements()
Return true, as WebLogic returns wrapped PreparedStatements.

Specified by:
isNativeConnectionNecessaryForNativePreparedStatements in interface NativeJdbcExtractor
Overrides:
isNativeConnectionNecessaryForNativePreparedStatements in class NativeJdbcExtractorAdapter

isNativeConnectionNecessaryForNativeCallableStatements

public boolean isNativeConnectionNecessaryForNativeCallableStatements()
Return true, as WebLogic returns wrapped CallableStatements.

Specified by:
isNativeConnectionNecessaryForNativeCallableStatements in interface NativeJdbcExtractor
Overrides:
isNativeConnectionNecessaryForNativeCallableStatements in class NativeJdbcExtractorAdapter

doGetNativeConnection

protected Connection doGetNativeConnection(Connection con)
                                    throws SQLException
Retrieve the Connection via WebLogic's getVendorConnection method.

Overrides:
doGetNativeConnection in class NativeJdbcExtractorAdapter
Throws:
SQLException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WebSphereNativeJdbcExtractor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.support.nativejdbc
Class WebSphereNativeJdbcExtractor

java.lang.Object
    extended by  org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
        extended by  org.springframework.jdbc.support.nativejdbc.WebSphereNativeJdbcExtractor
All Implemented Interfaces:
NativeJdbcExtractor
public class WebSphereNativeJdbcExtractor
extends NativeJdbcExtractorAdapter

Implementation of the NativeJdbcExtractor interface for WebSphere, supporting WebSphere Application Server 5.1 and higher.

Returns the underlying native Connection to application code instead of WebSphere's wrapper implementation; unwraps the Connection for native statements. The returned JDBC classes can then safely be cast, e.g. to oracle.jdbc.OracleConnection.

This NativeJdbcExtractor can be set just to allow working with a WebSphere DataSource: If a given object is not a WebSphere Connection wrapper, it will be returned as-is.

Since:
1.1
Author:
Juergen Hoeller
See Also:
com.ibm.ws.rsadapter.jdbc.WSJdbcConnection, com.ibm.ws.rsadapter.jdbc.WSJdbcUtil#getNativeConnection

Constructor Summary
WebSphereNativeJdbcExtractor()
This constructor retrieves WebSphere JDBC adapter classes, so we can get the underlying vendor connection using reflection.
Method Summary
protected Connection | doGetNativeConnection(Connection con) Retrieve the Connection via WebSphere's getNativeConnection method.
boolean | isNativeConnectionNecessaryForNativeCallableStatements() Return true, as WebSphere returns wrapped CallableStatements.
boolean | isNativeConnectionNecessaryForNativePreparedStatements() Return true, as WebSphere returns wrapped PreparedStatements.
boolean | isNativeConnectionNecessaryForNativeStatements() Return true, as WebSphere returns wrapped Statements.
Methods inherited from class org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
getNativeCallableStatement, getNativeConnection, getNativeConnectionFromStatement, getNativePreparedStatement, getNativeResultSet, getNativeStatement
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

WebSphereNativeJdbcExtractor

public WebSphereNativeJdbcExtractor()
This constructor retrieves WebSphere JDBC adapter classes, so we can get the underlying vendor connection using reflection.

Method Detail

isNativeConnectionNecessaryForNativeStatements

public boolean isNativeConnectionNecessaryForNativeStatements()
Return true, as WebSphere returns wrapped Statements.

Specified by:
isNativeConnectionNecessaryForNativeStatements in interface NativeJdbcExtractor
Overrides:
isNativeConnectionNecessaryForNativeStatements in class NativeJdbcExtractorAdapter

isNativeConnectionNecessaryForNativePreparedStatements

public boolean isNativeConnectionNecessaryForNativePreparedStatements()
Return true, as WebSphere returns wrapped PreparedStatements.

Specified by:
isNativeConnectionNecessaryForNativePreparedStatements in interface NativeJdbcExtractor
Overrides:
isNativeConnectionNecessaryForNativePreparedStatements in class NativeJdbcExtractorAdapter

isNativeConnectionNecessaryForNativeCallableStatements

public boolean isNativeConnectionNecessaryForNativeCallableStatements()
Return true, as WebSphere returns wrapped CallableStatements.

Specified by:
isNativeConnectionNecessaryForNativeCallableStatements in interface NativeJdbcExtractor
Overrides:
isNativeConnectionNecessaryForNativeCallableStatements in class NativeJdbcExtractorAdapter

doGetNativeConnection

protected Connection doGetNativeConnection(Connection con)
                                    throws SQLException
Retrieve the Connection via WebSphere's getNativeConnection method.

Overrides:
doGetNativeConnection in class NativeJdbcExtractorAdapter
Throws:
SQLException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jdbc.support.rowset

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jdbc.support.rowset

Provides a convenient holder for disconnected result sets.

See:
Description

Interface Summary
SqlRowSet | Mirror interface for javax.sql.RowSet, representing disconnected java.sql.ResultSet data.
SqlRowSetMetaData | Meta data interface for Spring's SqlRowSet, analogous to javax.sql.ResultSetMetaData

Class Summary
ResultSetWrappingSqlRowSet | Default implementation of Spring's SqlRowSet interface.
ResultSetWrappingSqlRowSetMetaData | Default implementation of Spring's SqlRowSetMetaData interface.

Package org.springframework.jdbc.support.rowset Description

Provides a convenient holder for disconnected result sets. Supported by JdbcTemplate, but can be used independently too.


org.springframework.jdbc.support.rowset Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jdbc.support.rowset

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet (implements org.springframework.jdbc.support.rowset.SqlRowSet)
    • org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSetMetaData (implements org.springframework.jdbc.support.rowset.SqlRowSetMetaData)

Interface Hierarchy

  • java.io.Serializable
    • org.springframework.jdbc.support.rowset.SqlRowSet
  • org.springframework.jdbc.support.rowset.SqlRowSetMetaData


SqlRowSet

org.springframework.jdbc.support.rowset
Interface SqlRowSet

All Superinterfaces:
Serializable
All Known Implementing Classes:
ResultSetWrappingSqlRowSet
public interface SqlRowSet
extends Serializable

Mirror interface for javax.sql.RowSet, representing disconnected java.sql.ResultSet data.

The main difference to the standard JDBC RowSet is that an SQLException is never thrown here. This allows a SqlRowSet to be used without having to deal with checked exceptions. A SqlRowSet will throw Spring's org.springframework.jdbc.InvalidResultSetAccessException instead (when appropriate).

Note: This interface extends the java.io.Serializable marker interface. Implementations, which typically hold disconnected data, are encouraged to be actually serializable (as far as possible).

Since:
1.2
Author:
Thomas Risberg, Juergen Hoeller
See Also:
RowSet, ResultSet, InvalidResultSetAccessException, JdbcTemplate.queryForRowSet(java.lang.String)

Method Summary
boolean | absolute(int row) Moves the cursor to the given row number in the RowSet, just after the last row.
void | afterLast() Moves the cursor to the end of this RowSet.
void | beforeFirst() Moves the cursor to the front of this RowSet, just before the first row.
int | findColumn(String columnName) Maps the given column name to its column index.
boolean | first() Moves the cursor to the first row of this RowSet.
BigDecimal | getBigDecimal(int columnIndex) Retrieves the value of the indicated column in the current row as an BigDecimal object.
BigDecimal | getBigDecimal(String columnName) Retrieves the value of the indicated column in the current row as an BigDecimal object.
boolean | getBoolean(int columnIndex) Retrieves the value of the indicated column in the current row as a boolean.
boolean | getBoolean(String columnName) Retrieves the value of the indicated column in the current row as a boolean.
byte | getByte(int columnIndex) Retrieves the value of the indicated column in the current row as a byte.
byte | getByte(String columnName) Retrieves the value of the indicated column in the current row as a byte.
Date | getDate(int columnIndex) Retrieves the value of the indicated column in the current row as a Date object.
Date | getDate(int columnIndex, Calendar cal) Retrieves the value of the indicated column in the current row as a Date object.
Date | getDate(String columnName) Retrieves the value of the indicated column in the current row as a Date object.
Date | getDate(String columnName, Calendar cal) Retrieves the value of the indicated column in the current row as a Date object.
double | getDouble(int columnIndex) Retrieves the value of the indicated column in the current row as a Double object.
double | getDouble(String columnName) Retrieves the value of the indicated column in the current row as a Double object.
float | getFloat(int columnIndex) Retrieves the value of the indicated column in the current row as a float.
float | getFloat(String columnName) Retrieves the value of the indicated column in the current row as a float.
int | getInt(int columnIndex) Retrieves the value of the indicated column in the current row as an int.
int | getInt(String columnName) Retrieves the value of the indicated column in the current row as an int.
long | getLong(int columnIndex) Retrieves the value of the indicated column in the current row as a long.
long | getLong(String columnName) Retrieves the value of the indicated column in the current row as a long.
SqlRowSetMetaData | getMetaData() Retrieves the meta data (number, types and properties for the columns) of this row set.
Object | getObject(int columnIndex) Retrieves the value of the indicated column in the current row as an Object.
Object | getObject(int columnIndex, Map map) Retrieves the value of the indicated column in the current row as an Object.
Object | getObject(String columnName) Retrieves the value of the indicated column in the current row as an Object.
Object | getObject(String columnName, Map map) Retrieves the value of the indicated column in the current row as an Object.
int | getRow() Retrieves the current row number.
short | getShort(int columnIndex) Retrieves the value of the indicated column in the current row as a short.
short | getShort(String columnName) Retrieves the value of the indicated column in the current row as a short.
String | getString(int columnIndex) Retrieves the value of the indicated column in the current row as a String.
String | getString(String columnName) Retrieves the value of the indicated column in the current row as a String.
Time | getTime(int columnIndex) Retrieves the value of the indicated column in the current row as a Time object.
Time | getTime(int columnIndex, Calendar cal) Retrieves the value of the indicated column in the current row as a Time object.
Time | getTime(String columnName) Retrieves the value of the indicated column in the current row as a Time object.
Time | getTime(String columnName, Calendar cal) Retrieves the value of the indicated column in the current row as a Time object.
Timestamp | getTimestamp(int columnIndex) Retrieves the value of the indicated column in the current row as a Timestamp object.
Timestamp | getTimestamp(int columnIndex, Calendar cal) Retrieves the value of the indicated column in the current row as a Timestamp object.
Timestamp | getTimestamp(String columnName) Retrieves the value of the indicated column in the current row as a Timestamp object.
Timestamp | getTimestamp(String columnName, Calendar cal) Retrieves the value of the indicated column in the current row as a Timestamp object.
boolean | isAfterLast() Retrieves whether the cursor is after the last row of this RowSet.
boolean | isBeforeFirst() Retrieves whether the cursor is after the first row of this RowSet.
boolean | isFirst() Retrieves whether the cursor is on the first row of this RowSet.
boolean | isLast() Retrieves whether the cursor is on the last row of this RowSet.
boolean | last() Moves the cursor to the last row of this RowSet.
boolean | next() Moves the cursor to the next row.
boolean | previous() Moves the cursor to the previous row.
boolean | relative(int rows) Moves the cursor a relative number f rows, either positive or negative.
boolean | wasNull() Reports whether the last column read had a value of SQL NULL.

Method Detail

getMetaData

SqlRowSetMetaData getMetaData()
Retrieves the meta data (number, types and properties for the columns) of this row set.

Returns:
a corresponding SqlRowSetMetaData instance
See Also:
ResultSet.getMetaData()

findColumn

int findColumn(String columnName)
               throws InvalidResultSetAccessException
Maps the given column name to its column index.

Parameters:
columnName - the name of the column
Returns:
the column index for the given column name
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.findColumn(String)

getBigDecimal

BigDecimal getBigDecimal(int columnIndex)
                         throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as an BigDecimal object.

Parameters:
columnIndex - the column index
Returns:
an BigDecimal object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getBigDecimal(int)

getBigDecimal

BigDecimal getBigDecimal(String columnName)
                         throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as an BigDecimal object.

Parameters:
columnName - the column name
Returns:
an BigDecimal object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getBigDecimal(java.lang.String)

getBoolean

boolean getBoolean(int columnIndex)
                   throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as a boolean.

Parameters:
columnIndex - the column index
Returns:
a boolean representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getBoolean(int)

getBoolean

boolean getBoolean(String columnName)
                   throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as a boolean.

Parameters:
columnName - the column name
Returns:
a boolean representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getBoolean(java.lang.String)

getByte

byte getByte(int columnIndex)
             throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as a byte.

Parameters:
columnIndex - the column index
Returns:
a byte representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getByte(int)

getByte

byte getByte(String columnName)
             throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as a byte.

Parameters:
columnName - the column name
Returns:
a byte representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getByte(java.lang.String)

getDate

Date getDate(int columnIndex,
             Calendar cal)
             throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as a Date object.

Parameters:
columnIndex - the column index
cal - the Calendar to use in constructing the Date
Returns:
a Date object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getDate(int, java.util.Calendar)

getDate

Date getDate(int columnIndex)
             throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as a Date object.

Parameters:
columnIndex - the column index
Returns:
a Date object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getDate(int)

getDate

Date getDate(String columnName,
             Calendar cal)
             throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as a Date object.

Parameters:
columnName - the column name
cal - the Calendar to use in constructing the Date
Returns:
a Date object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getDate(java.lang.String, java.util.Calendar)

getDate

Date getDate(String columnName)
             throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as a Date object.

Parameters:
columnName - the column name
Returns:
a Date object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getDate(java.lang.String)

getDouble

double getDouble(int columnIndex)
                 throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as a Double object.

Parameters:
columnIndex - the column index
Returns:
a Double object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getDouble(int)

getDouble

double getDouble(String columnName)
                 throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as a Double object.

Parameters:
columnName - the column name
Returns:
a Double object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getDouble(java.lang.String)

getFloat

float getFloat(int columnIndex)
               throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as a float.

Parameters:
columnIndex - the column index
Returns:
a float representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getFloat(int)

getFloat

float getFloat(String columnName)
               throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as a float.

Parameters:
columnName - the column name
Returns:
a float representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getFloat(java.lang.String)

getInt

int getInt(int columnIndex)
           throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as an int.

Parameters:
columnIndex - the column index
Returns:
an int representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getInt(int)

getInt

int getInt(String columnName)
           throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as an int.

Parameters:
columnName - the column name
Returns:
an int representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getInt(java.lang.String)

getLong

long getLong(int columnIndex)
             throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as a long.

Parameters:
columnIndex - the column index
Returns:
a long representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getLong(int)

getLong

long getLong(String columnName)
             throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as a long.

Parameters:
columnName - the column name
Returns:
a long representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getLong(java.lang.String)

getObject

Object getObject(int columnIndex,
                 Map map)
                 throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as an Object.

Parameters:
columnIndex - the column index
map - a Map object containing the mapping from SQL types to Java types
Returns:
a Object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getObject(int, java.util.Map)

getObject

Object getObject(int columnIndex)
                 throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as an Object.

Parameters:
columnIndex - the column index
Returns:
a Object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getObject(int)

getObject

Object getObject(String columnName,
                 Map map)
                 throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as an Object.

Parameters:
columnName - the column name
map - a Map object containing the mapping from SQL types to Java types
Returns:
a Object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getObject(java.lang.String, java.util.Map)

getObject

Object getObject(String columnName)
                 throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as an Object.

Parameters:
columnName - the column name
Returns:
a Object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getObject(java.lang.String)

getShort

short getShort(int columnIndex)
               throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as a short.

Parameters:
columnIndex - the column index
Returns:
a short representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getShort(int)

getShort

short getShort(String columnName)
               throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as a short.

Parameters:
columnName - the column name
Returns:
a short representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getShort(java.lang.String)

getString

String getString(int columnIndex)
                 throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as a String.

Parameters:
columnIndex - the column index
Returns:
a String representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getString(int)

getString

String getString(String columnName)
                 throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as a String.

Parameters:
columnName - the column name
Returns:
a String representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getString(java.lang.String)

getTime

Time getTime(int columnIndex,
             Calendar cal)
             throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as a Time object.

Parameters:
columnIndex - the column index
cal - the Calendar to use in constructing the Date
Returns:
a Time object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getTime(int, java.util.Calendar)

getTime

Time getTime(int columnIndex)
             throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as a Time object.

Parameters:
columnIndex - the column index
Returns:
a Time object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getTime(int)

getTime

Time getTime(String columnName,
             Calendar cal)
             throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as a Time object.

Parameters:
columnName - the column name
cal - the Calendar to use in constructing the Date
Returns:
a Time object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getTime(java.lang.String, java.util.Calendar)

getTime

Time getTime(String columnName)
             throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as a Time object.

Parameters:
columnName - the column name
Returns:
a Time object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getTime(java.lang.String)

getTimestamp

Timestamp getTimestamp(int columnIndex,
                       Calendar cal)
                       throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as a Timestamp object.

Parameters:
columnIndex - the column index
cal - the Calendar to use in constructing the Date
Returns:
a Timestamp object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getTimestamp(int, java.util.Calendar)

getTimestamp

Timestamp getTimestamp(int columnIndex)
                       throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as a Timestamp object.

Parameters:
columnIndex - the column index
Returns:
a Timestamp object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getTimestamp(int)

getTimestamp

Timestamp getTimestamp(String columnName,
                       Calendar cal)
                       throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as a Timestamp object.

Parameters:
columnName - the column name
cal - the Calendar to use in constructing the Date
Returns:
a Timestamp object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getTimestamp(java.lang.String, java.util.Calendar)

getTimestamp

Timestamp getTimestamp(String columnName)
                       throws InvalidResultSetAccessException
Retrieves the value of the indicated column in the current row as a Timestamp object.

Parameters:
columnName - the column name
Returns:
a Timestamp object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getTimestamp(java.lang.String)

absolute

boolean absolute(int row)
                 throws InvalidResultSetAccessException
Moves the cursor to the given row number in the RowSet, just after the last row.

Parameters:
row - the number of the row where the cursor should move
Returns:
true if the cursor is on the RowSet, false otherwise
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.absolute(int)

afterLast

void afterLast()
               throws InvalidResultSetAccessException
Moves the cursor to the end of this RowSet.

Throws:
InvalidResultSetAccessException
See Also:
ResultSet.afterLast()

beforeFirst

void beforeFirst()
                 throws InvalidResultSetAccessException
Moves the cursor to the front of this RowSet, just before the first row.

Throws:
InvalidResultSetAccessException
See Also:
ResultSet.beforeFirst()

first

boolean first()
              throws InvalidResultSetAccessException
Moves the cursor to the first row of this RowSet.

Returns:
true if the cursor is on a valid row, false otherwise
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.first()

getRow

int getRow()
           throws InvalidResultSetAccessException
Retrieves the current row number.

Returns:
the current row number
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getRow()

isAfterLast

boolean isAfterLast()
                    throws InvalidResultSetAccessException
Retrieves whether the cursor is after the last row of this RowSet.

Returns:
true if the cursor is after the last row, false otherwise
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.isAfterLast()

isBeforeFirst

boolean isBeforeFirst()
                      throws InvalidResultSetAccessException
Retrieves whether the cursor is after the first row of this RowSet.

Returns:
true if the cursor is after the first row, false otherwise
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.isBeforeFirst()

isFirst

boolean isFirst()
                throws InvalidResultSetAccessException
Retrieves whether the cursor is on the first row of this RowSet.

Returns:
true if the cursor is after the first row, false otherwise
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.isFirst()

isLast

boolean isLast()
               throws InvalidResultSetAccessException
Retrieves whether the cursor is on the last row of this RowSet.

Returns:
true if the cursor is after the last row, false otherwise
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.isLast()

last

boolean last()
             throws InvalidResultSetAccessException
Moves the cursor to the last row of this RowSet.

Returns:
true if the cursor is on a valid row, false otherwise
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.last()

next

boolean next()
             throws InvalidResultSetAccessException
Moves the cursor to the next row.

Returns:
true if the new row is valid, false if there are no more rows
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.next()

previous

boolean previous()
                 throws InvalidResultSetAccessException
Moves the cursor to the previous row.

Returns:
true if the new row is valid, false if it is off the RowSet
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.previous()

relative

boolean relative(int rows)
                 throws InvalidResultSetAccessException
Moves the cursor a relative number f rows, either positive or negative.

Returns:
true if the cursor is on a row, false otherwise
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.relative(int)

wasNull

boolean wasNull()
                throws InvalidResultSetAccessException
Reports whether the last column read had a value of SQL NULL. Note that you must first call one of the getter methods and then call the wasNull method.

Returns:
true if the most recent coumn retrieved was SQL NULL, false otherwise
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.wasNull()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SqlRowSetMetaData

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.support.rowset
Interface SqlRowSetMetaData

All Known Implementing Classes:
ResultSetWrappingSqlRowSetMetaData
public interface SqlRowSetMetaData

Meta data interface for Spring's SqlRowSet, analogous to javax.sql.ResultSetMetaData

The main difference to the standard JDBC RowSetMetaData is that an SQLException is never thrown here. This allows a SqlRowSetMetaData to be used without having to deal with checked exceptions. A SqlRowSetMetaData will throw Spring's org.springframework.jdbc.InvalidResultSetAccessException instead (when appropriate).

Since:
1.2
Author:
Thomas Risberg
See Also:
SqlRowSet.getMetaData(), ResultSetMetaData, InvalidResultSetAccessException

Method Summary
String | getCatalogName(int columnIndex) Retrieves the catalog name of the table that served as the source for the specified column.
String | getColumnClassName(int columnIndex) Retrieves the fully qualified class that the specified column will be mapped to.
int | getColumnCount() Retrives the number of columns in the RowSet.
int | getColumnDisplaySize(int columnIndex) Retrieves the maximum width of the designated column.
String | getColumnLabel(int columnIndex) Retrieve the suggested column title for the column specified.
String | getColumnName(int columnIndex) Retrieve the column name for the indicated column.
String[] | getColumnNames() Return the column names of the table that the result set represents.
int | getColumnType(int columnIndex) Retrieve the SQL type code for the indicated column.
String | getColumnTypeName(int columnIndex) Retrieves the DBMS-specific type name for the indicated column.
int | getPrecision(int columnIndex) Retrieves the precision for the indicated column.
int | getScale(int columnIndex) Retrieves the scale of the indicated column.
String | getSchemaName(int columnIndex) Retrieves the schema name of the table that served as the source for the specified column.
String | getTableName(int columnIndex) Retrieves the name of the table that served as the source for the specified column.
boolean | isCaseSensitive(int columnIndex) Indicates whether the case of the designated column is significant.
boolean | isCurrency(int columnIndex) Indicates whether the designated column contains a currency value.
boolean | isSigned(int columnIndex) Indicates whether the designated column contains a signed number.

Method Detail

getCatalogName

String getCatalogName(int columnIndex)
                      throws InvalidResultSetAccessException
Retrieves the catalog name of the table that served as the source for the specified column.

Parameters:
columnIndex - the index of the column
Returns:
the catalog name
Throws:
InvalidResultSetAccessException
See Also:
ResultSetMetaData.getCatalogName(int)

getColumnClassName

String getColumnClassName(int columnIndex)
                          throws InvalidResultSetAccessException
Retrieves the fully qualified class that the specified column will be mapped to.

Parameters:
columnIndex - the index of the column
Returns:
the class name as a String
Throws:
InvalidResultSetAccessException
See Also:
ResultSetMetaData.getColumnClassName(int)

getColumnCount

int getColumnCount()
                   throws InvalidResultSetAccessException
Retrives the number of columns in the RowSet.

Returns:
the number of columns
Throws:
InvalidResultSetAccessException
See Also:
ResultSetMetaData.getColumnCount()

getColumnNames

String[] getColumnNames()
                        throws InvalidResultSetAccessException
Return the column names of the table that the result set represents.

Returns:
the column names
Throws:
InvalidResultSetAccessException

getColumnDisplaySize

int getColumnDisplaySize(int columnIndex)
                         throws InvalidResultSetAccessException
Retrieves the maximum width of the designated column.

Parameters:
columnIndex - the index of the column
Returns:
the width of the column
Throws:
InvalidResultSetAccessException
See Also:
ResultSetMetaData.getColumnDisplaySize(int)

getColumnLabel

String getColumnLabel(int columnIndex)
                      throws InvalidResultSetAccessException
Retrieve the suggested column title for the column specified.

Parameters:
columnIndex - the index of the column
Returns:
the column title
Throws:
InvalidResultSetAccessException
See Also:
ResultSetMetaData.getColumnLabel(int)

getColumnName

String getColumnName(int columnIndex)
                     throws InvalidResultSetAccessException
Retrieve the column name for the indicated column.

Parameters:
columnIndex - the index of the column
Returns:
the column name
Throws:
InvalidResultSetAccessException
See Also:
ResultSetMetaData.getColumnName(int)

getColumnType

int getColumnType(int columnIndex)
                  throws InvalidResultSetAccessException
Retrieve the SQL type code for the indicated column.

Parameters:
columnIndex - the index of the column
Returns:
the SQL type code
Throws:
InvalidResultSetAccessException
See Also:
ResultSetMetaData.getColumnType(int), Types

getColumnTypeName

String getColumnTypeName(int columnIndex)
                         throws InvalidResultSetAccessException
Retrieves the DBMS-specific type name for the indicated column.

Parameters:
columnIndex - the index of the column
Returns:
the type name
Throws:
InvalidResultSetAccessException
See Also:
ResultSetMetaData.getColumnTypeName(int)

getPrecision

int getPrecision(int columnIndex)
                 throws InvalidResultSetAccessException
Retrieves the precision for the indicated column.

Parameters:
columnIndex - the index of the column
Returns:
the precision
Throws:
InvalidResultSetAccessException
See Also:
ResultSetMetaData.getPrecision(int)

getScale

int getScale(int columnIndex)
             throws InvalidResultSetAccessException
Retrieves the scale of the indicated column.

Parameters:
columnIndex - the index of the column
Returns:
the scale
Throws:
InvalidResultSetAccessException
See Also:
ResultSetMetaData.getScale(int)

getSchemaName

String getSchemaName(int columnIndex)
                     throws InvalidResultSetAccessException
Retrieves the schema name of the table that served as the source for the specified column.

Parameters:
columnIndex - the index of the column
Returns:
the schema name
Throws:
InvalidResultSetAccessException
See Also:
ResultSetMetaData.getSchemaName(int)

getTableName

String getTableName(int columnIndex)
                    throws InvalidResultSetAccessException
Retrieves the name of the table that served as the source for the specified column.

Parameters:
columnIndex - the index of the column
Returns:
the name of the table
Throws:
InvalidResultSetAccessException
See Also:
ResultSetMetaData.getTableName(int)

isCaseSensitive

boolean isCaseSensitive(int columnIndex)
                        throws InvalidResultSetAccessException
Indicates whether the case of the designated column is significant.

Parameters:
columnIndex - the index of the column
Returns:
true if the case sensitive, false otherwise
Throws:
InvalidResultSetAccessException
See Also:
ResultSetMetaData.isCaseSensitive(int)

isCurrency

boolean isCurrency(int columnIndex)
                   throws InvalidResultSetAccessException
Indicates whether the designated column contains a currency value.

Parameters:
columnIndex - the index of the column
Returns:
true if the value is a currency value, false otherwise
Throws:
InvalidResultSetAccessException
See Also:
ResultSetMetaData.isCurrency(int)

isSigned

boolean isSigned(int columnIndex)
                 throws InvalidResultSetAccessException
Indicates whether the designated column contains a signed number.

Parameters:
columnIndex - the index of the column
Returns:
true if the column contains a signed number, false otherwise
Throws:
InvalidResultSetAccessException
See Also:
ResultSetMetaData.isSigned(int)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ResultSetWrappingSqlRowSet

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.support.rowset
Class ResultSetWrappingSqlRowSet

java.lang.Object
    extended by  org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
All Implemented Interfaces:
Serializable, SqlRowSet
public class ResultSetWrappingSqlRowSet
extends Object
implements SqlRowSet

Default implementation of Spring's SqlRowSet interface.

This implementation wraps a javax.sql.ResultSet, catching any SQLExceptions and translating them to the appropriate Spring InvalidResultSetAccessException.

The passed-in ResultSets should already be disconnected if the SqlRowSet is supposed to be usable in a disconnected fashion. This means that you will usually pass in a javax.sql.rowset.CachedRowSet, which implements the ResultSet interface.

Note: This class implements the java.io.Serializable marker interface through the SqlRowSet interface, but is only actually serializable if the disconnected ResultSet/RowSet contained in it is serializable. Most CachedRowSet implementations are actually serializable.

Since:
1.2
Author:
Thomas Risberg, Juergen Hoeller
See Also:
ResultSet, CachedRowSet, Serialized Form

Constructor Summary
ResultSetWrappingSqlRowSet(ResultSet resultSet)
Create a new ResultSetWrappingSqlRowSet for the given ResultSet.
Method Summary
boolean | absolute(int row) Moves the cursor to the given row number in the RowSet, just after the last row.
void | afterLast() Moves the cursor to the end of this RowSet.
void | beforeFirst() Moves the cursor to the front of this RowSet, just before the first row.
int | findColumn(String columnName) Maps the given column name to its column index.
boolean | first() Moves the cursor to the first row of this RowSet.
BigDecimal | getBigDecimal(int columnIndex) Retrieves the value of the indicated column in the current row as an BigDecimal object.
BigDecimal | getBigDecimal(String columnName) Retrieves the value of the indicated column in the current row as an BigDecimal object.
boolean | getBoolean(int columnIndex) Retrieves the value of the indicated column in the current row as a boolean.
boolean | getBoolean(String columnName) Retrieves the value of the indicated column in the current row as a boolean.
byte | getByte(int columnIndex) Retrieves the value of the indicated column in the current row as a byte.
byte | getByte(String columnName) Retrieves the value of the indicated column in the current row as a byte.
Date | getDate(int columnIndex) Retrieves the value of the indicated column in the current row as a Date object.
Date | getDate(int columnIndex, Calendar cal) Retrieves the value of the indicated column in the current row as a Date object.
Date | getDate(String columnName) Retrieves the value of the indicated column in the current row as a Date object.
Date | getDate(String columnName, Calendar cal) Retrieves the value of the indicated column in the current row as a Date object.
double | getDouble(int columnIndex) Retrieves the value of the indicated column in the current row as a Double object.
double | getDouble(String columnName) Retrieves the value of the indicated column in the current row as a Double object.
float | getFloat(int columnIndex) Retrieves the value of the indicated column in the current row as a float.
float | getFloat(String columnName) Retrieves the value of the indicated column in the current row as a float.
int | getInt(int columnIndex) Retrieves the value of the indicated column in the current row as an int.
int | getInt(String columnName) Retrieves the value of the indicated column in the current row as an int.
long | getLong(int columnIndex) Retrieves the value of the indicated column in the current row as a long.
long | getLong(String columnName) Retrieves the value of the indicated column in the current row as a long.
SqlRowSetMetaData | getMetaData() Retrieves the meta data (number, types and properties for the columns) of this row set.
Object | getObject(int columnIndex) Retrieves the value of the indicated column in the current row as an Object.
Object | getObject(int i, Map map) Retrieves the value of the indicated column in the current row as an Object.
Object | getObject(String columnName) Retrieves the value of the indicated column in the current row as an Object.
Object | getObject(String columnName, Map map) Retrieves the value of the indicated column in the current row as an Object.
ResultSet | getResultSet() Return the underlying ResultSet (usually a javax.sql.rowset.CachedRowSet).
int | getRow() Retrieves the current row number.
short | getShort(int columnIndex) Retrieves the value of the indicated column in the current row as a short.
short | getShort(String columnName) Retrieves the value of the indicated column in the current row as a short.
String | getString(int columnIndex) Retrieves the value of the indicated column in the current row as a String.
String | getString(String columnName) Retrieves the value of the indicated column in the current row as a String.
Time | getTime(int columnIndex) Retrieves the value of the indicated column in the current row as a Time object.
Time | getTime(int columnIndex, Calendar cal) Retrieves the value of the indicated column in the current row as a Time object.
Time | getTime(String columnName) Retrieves the value of the indicated column in the current row as a Time object.
Time | getTime(String columnName, Calendar cal) Retrieves the value of the indicated column in the current row as a Time object.
Timestamp | getTimestamp(int columnIndex) Retrieves the value of the indicated column in the current row as a Timestamp object.
Timestamp | getTimestamp(int columnIndex, Calendar cal) Retrieves the value of the indicated column in the current row as a Timestamp object.
Timestamp | getTimestamp(String columnName) Retrieves the value of the indicated column in the current row as a Timestamp object.
Timestamp | getTimestamp(String columnName, Calendar cal) Retrieves the value of the indicated column in the current row as a Timestamp object.
boolean | isAfterLast() Retrieves whether the cursor is after the last row of this RowSet.
boolean | isBeforeFirst() Retrieves whether the cursor is after the first row of this RowSet.
boolean | isFirst() Retrieves whether the cursor is on the first row of this RowSet.
boolean | isLast() Retrieves whether the cursor is on the last row of this RowSet.
boolean | last() Moves the cursor to the last row of this RowSet.
boolean | next() Moves the cursor to the next row.
boolean | previous() Moves the cursor to the previous row.
boolean | relative(int rows) Moves the cursor a relative number f rows, either positive or negative.
boolean | wasNull() Reports whether the last column read had a value of SQL NULL.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ResultSetWrappingSqlRowSet

public ResultSetWrappingSqlRowSet(ResultSet resultSet)
                           throws InvalidResultSetAccessException
Create a new ResultSetWrappingSqlRowSet for the given ResultSet.

Parameters:
resultSet - a disconnected ResultSet to wrap (usually a javax.sql.rowset.CachedRowSet)
Throws:
InvalidResultSetAccessException - if extracting the ResultSetMetaData failed
See Also:
CachedRowSet, ResultSet.getMetaData(), ResultSetWrappingSqlRowSetMetaData
Method Detail

getResultSet

public final ResultSet getResultSet()
Return the underlying ResultSet (usually a javax.sql.rowset.CachedRowSet).

See Also:
CachedRowSet

getMetaData

public final SqlRowSetMetaData getMetaData()
Description copied from interface: SqlRowSet
Retrieves the meta data (number, types and properties for the columns) of this row set.

Specified by:
getMetaData in interface SqlRowSet
Returns:
a corresponding SqlRowSetMetaData instance
See Also:
ResultSetMetaData.getCatalogName(int)

findColumn

public int findColumn(String columnName)
               throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Maps the given column name to its column index.

Specified by:
findColumn in interface SqlRowSet
Parameters:
columnName - the name of the column
Returns:
the column index for the given column name
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.findColumn(String)

getBigDecimal

public BigDecimal getBigDecimal(int columnIndex)
                         throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as an BigDecimal object.

Specified by:
getBigDecimal in interface SqlRowSet
Parameters:
columnIndex - the column index
Returns:
an BigDecimal object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getBigDecimal(int)

getBigDecimal

public BigDecimal getBigDecimal(String columnName)
                         throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as an BigDecimal object.

Specified by:
getBigDecimal in interface SqlRowSet
Parameters:
columnName - the column name
Returns:
an BigDecimal object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getBigDecimal(String)

getBoolean

public boolean getBoolean(int columnIndex)
                   throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as a boolean.

Specified by:
getBoolean in interface SqlRowSet
Parameters:
columnIndex - the column index
Returns:
a boolean representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getBoolean(int)

getBoolean

public boolean getBoolean(String columnName)
                   throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as a boolean.

Specified by:
getBoolean in interface SqlRowSet
Parameters:
columnName - the column name
Returns:
a boolean representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getBoolean(String)

getByte

public byte getByte(int columnIndex)
             throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as a byte.

Specified by:
getByte in interface SqlRowSet
Parameters:
columnIndex - the column index
Returns:
a byte representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getByte(int)

getByte

public byte getByte(String columnName)
             throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as a byte.

Specified by:
getByte in interface SqlRowSet
Parameters:
columnName - the column name
Returns:
a byte representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getByte(String)

getDate

public Date getDate(int columnIndex,
                    Calendar cal)
             throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as a Date object.

Specified by:
getDate in interface SqlRowSet
Parameters:
columnIndex - the column index
cal - the Calendar to use in constructing the Date
Returns:
a Date object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getDate(int, java.util.Calendar)

getDate

public Date getDate(int columnIndex)
             throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as a Date object.

Specified by:
getDate in interface SqlRowSet
Parameters:
columnIndex - the column index
Returns:
a Date object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getDate(int)

getDate

public Date getDate(String columnName,
                    Calendar cal)
             throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as a Date object.

Specified by:
getDate in interface SqlRowSet
Parameters:
columnName - the column name
cal - the Calendar to use in constructing the Date
Returns:
a Date object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getDate(String, java.util.Calendar)

getDate

public Date getDate(String columnName)
             throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as a Date object.

Specified by:
getDate in interface SqlRowSet
Parameters:
columnName - the column name
Returns:
a Date object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getDate(String)

getDouble

public double getDouble(int columnIndex)
                 throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as a Double object.

Specified by:
getDouble in interface SqlRowSet
Parameters:
columnIndex - the column index
Returns:
a Double object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getDouble(int)

getDouble

public double getDouble(String columnName)
                 throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as a Double object.

Specified by:
getDouble in interface SqlRowSet
Parameters:
columnName - the column name
Returns:
a Double object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getDouble(String)

getFloat

public float getFloat(int columnIndex)
               throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as a float.

Specified by:
getFloat in interface SqlRowSet
Parameters:
columnIndex - the column index
Returns:
a float representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getFloat(int)

getFloat

public float getFloat(String columnName)
               throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as a float.

Specified by:
getFloat in interface SqlRowSet
Parameters:
columnName - the column name
Returns:
a float representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getFloat(String)

getInt

public int getInt(int columnIndex)
           throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as an int.

Specified by:
getInt in interface SqlRowSet
Parameters:
columnIndex - the column index
Returns:
an int representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getInt(int)

getInt

public int getInt(String columnName)
           throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as an int.

Specified by:
getInt in interface SqlRowSet
Parameters:
columnName - the column name
Returns:
an int representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getInt(String)

getLong

public long getLong(int columnIndex)
             throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as a long.

Specified by:
getLong in interface SqlRowSet
Parameters:
columnIndex - the column index
Returns:
a long representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getLong(int)

getLong

public long getLong(String columnName)
             throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as a long.

Specified by:
getLong in interface SqlRowSet
Parameters:
columnName - the column name
Returns:
a long representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getLong(String)

getObject

public Object getObject(int i,
                        Map map)
                 throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as an Object.

Specified by:
getObject in interface SqlRowSet
Parameters:
i - the column index
map - a Map object containing the mapping from SQL types to Java types
Returns:
a Object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getObject(int, java.util.Map)

getObject

public Object getObject(int columnIndex)
                 throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as an Object.

Specified by:
getObject in interface SqlRowSet
Parameters:
columnIndex - the column index
Returns:
a Object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getObject(int)

getObject

public Object getObject(String columnName,
                        Map map)
                 throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as an Object.

Specified by:
getObject in interface SqlRowSet
Parameters:
columnName - the column name
map - a Map object containing the mapping from SQL types to Java types
Returns:
a Object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getObject(String, java.util.Map)

getObject

public Object getObject(String columnName)
                 throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as an Object.

Specified by:
getObject in interface SqlRowSet
Parameters:
columnName - the column name
Returns:
a Object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getObject(String)

getShort

public short getShort(int columnIndex)
               throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as a short.

Specified by:
getShort in interface SqlRowSet
Parameters:
columnIndex - the column index
Returns:
a short representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getShort(int)

getShort

public short getShort(String columnName)
               throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as a short.

Specified by:
getShort in interface SqlRowSet
Parameters:
columnName - the column name
Returns:
a short representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getShort(String)

getString

public String getString(int columnIndex)
                 throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as a String.

Specified by:
getString in interface SqlRowSet
Parameters:
columnIndex - the column index
Returns:
a String representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getString(int)

getString

public String getString(String columnName)
                 throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as a String.

Specified by:
getString in interface SqlRowSet
Parameters:
columnName - the column name
Returns:
a String representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getString(String)

getTime

public Time getTime(int columnIndex,
                    Calendar cal)
             throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as a Time object.

Specified by:
getTime in interface SqlRowSet
Parameters:
columnIndex - the column index
cal - the Calendar to use in constructing the Date
Returns:
a Time object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getTime(int, java.util.Calendar)

getTime

public Time getTime(int columnIndex)
             throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as a Time object.

Specified by:
getTime in interface SqlRowSet
Parameters:
columnIndex - the column index
Returns:
a Time object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getTime(int)

getTime

public Time getTime(String columnName,
                    Calendar cal)
             throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as a Time object.

Specified by:
getTime in interface SqlRowSet
Parameters:
columnName - the column name
cal - the Calendar to use in constructing the Date
Returns:
a Time object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getTime(String, java.util.Calendar)

getTime

public Time getTime(String columnName)
             throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as a Time object.

Specified by:
getTime in interface SqlRowSet
Parameters:
columnName - the column name
Returns:
a Time object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getTime(String)

getTimestamp

public Timestamp getTimestamp(int columnIndex,
                              Calendar cal)
                       throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as a Timestamp object.

Specified by:
getTimestamp in interface SqlRowSet
Parameters:
columnIndex - the column index
cal - the Calendar to use in constructing the Date
Returns:
a Timestamp object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getTimestamp(int, java.util.Calendar)

getTimestamp

public Timestamp getTimestamp(int columnIndex)
                       throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as a Timestamp object.

Specified by:
getTimestamp in interface SqlRowSet
Parameters:
columnIndex - the column index
Returns:
a Timestamp object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getTimestamp(int)

getTimestamp

public Timestamp getTimestamp(String columnName,
                              Calendar cal)
                       throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as a Timestamp object.

Specified by:
getTimestamp in interface SqlRowSet
Parameters:
columnName - the column name
cal - the Calendar to use in constructing the Date
Returns:
a Timestamp object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getTimestamp(String, java.util.Calendar)

getTimestamp

public Timestamp getTimestamp(String columnName)
                       throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the value of the indicated column in the current row as a Timestamp object.

Specified by:
getTimestamp in interface SqlRowSet
Parameters:
columnName - the column name
Returns:
a Timestamp object representing the column value
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getTimestamp(String)

absolute

public boolean absolute(int row)
                 throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Moves the cursor to the given row number in the RowSet, just after the last row.

Specified by:
absolute in interface SqlRowSet
Parameters:
row - the number of the row where the cursor should move
Returns:
true if the cursor is on the RowSet, false otherwise
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.absolute(int)

afterLast

public void afterLast()
               throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Moves the cursor to the end of this RowSet.

Specified by:
afterLast in interface SqlRowSet
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.afterLast()

beforeFirst

public void beforeFirst()
                 throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Moves the cursor to the front of this RowSet, just before the first row.

Specified by:
beforeFirst in interface SqlRowSet
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.beforeFirst()

first

public boolean first()
              throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Moves the cursor to the first row of this RowSet.

Specified by:
first in interface SqlRowSet
Returns:
true if the cursor is on a valid row, false otherwise
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.first()

getRow

public int getRow()
           throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves the current row number.

Specified by:
getRow in interface SqlRowSet
Returns:
the current row number
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.getRow()

isAfterLast

public boolean isAfterLast()
                    throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves whether the cursor is after the last row of this RowSet.

Specified by:
isAfterLast in interface SqlRowSet
Returns:
true if the cursor is after the last row, false otherwise
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.isAfterLast()

isBeforeFirst

public boolean isBeforeFirst()
                      throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves whether the cursor is after the first row of this RowSet.

Specified by:
isBeforeFirst in interface SqlRowSet
Returns:
true if the cursor is after the first row, false otherwise
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.isBeforeFirst()

isFirst

public boolean isFirst()
                throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves whether the cursor is on the first row of this RowSet.

Specified by:
isFirst in interface SqlRowSet
Returns:
true if the cursor is after the first row, false otherwise
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.isFirst()

isLast

public boolean isLast()
               throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Retrieves whether the cursor is on the last row of this RowSet.

Specified by:
isLast in interface SqlRowSet
Returns:
true if the cursor is after the last row, false otherwise
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.isLast()

last

public boolean last()
             throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Moves the cursor to the last row of this RowSet.

Specified by:
last in interface SqlRowSet
Returns:
true if the cursor is on a valid row, false otherwise
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.last()

next

public boolean next()
             throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Moves the cursor to the next row.

Specified by:
next in interface SqlRowSet
Returns:
true if the new row is valid, false if there are no more rows
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.next()

previous

public boolean previous()
                 throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Moves the cursor to the previous row.

Specified by:
previous in interface SqlRowSet
Returns:
true if the new row is valid, false if it is off the RowSet
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.previous()

relative

public boolean relative(int rows)
                 throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Moves the cursor a relative number f rows, either positive or negative.

Specified by:
relative in interface SqlRowSet
Returns:
true if the cursor is on a row, false otherwise
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.relative(int)

wasNull

public boolean wasNull()
                throws InvalidResultSetAccessException
Description copied from interface: SqlRowSet
Reports whether the last column read had a value of SQL NULL. Note that you must first call one of the getter methods and then call the wasNull method.

Specified by:
wasNull in interface SqlRowSet
Returns:
true if the most recent coumn retrieved was SQL NULL, false otherwise
Throws:
InvalidResultSetAccessException
See Also:
ResultSet.wasNull()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ResultSetWrappingSqlRowSetMetaData

org.springframework.jdbc.support.rowset
Class ResultSetWrappingSqlRowSetMetaData

java.lang.Object
    extended by  org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSetMetaData
All Implemented Interfaces:
SqlRowSetMetaData
public class ResultSetWrappingSqlRowSetMetaData
extends Object
implements SqlRowSetMetaData

Default implementation of Spring's SqlRowSetMetaData interface. Used by ResultSetWrappingSqlRowSet.

This implementation wraps a javax.sql.ResultSetMetaData instance, catching any SQLExceptions and translating them to the appropriate Spring DataAccessException.

Since:
1.2
Author:
Thomas Risberg, Juergen Hoeller
See Also:
ResultSetWrappingSqlRowSet.getMetaData()

Constructor Summary
ResultSetWrappingSqlRowSetMetaData(ResultSetMetaData resultSetMetaData)
Create a new ResultSetWrappingSqlRowSetMetaData object for the given ResultSetMetaData instance.
Method Summary
String | getCatalogName(int column) Retrieves the catalog name of the table that served as the source for the specified column.
String | getColumnClassName(int column) Retrieves the fully qualified class that the specified column will be mapped to.
int | getColumnCount() Retrives the number of columns in the RowSet.
int | getColumnDisplaySize(int column) Retrieves the maximum width of the designated column.
String | getColumnLabel(int column) Retrieve the suggested column title for the column specified.
String | getColumnName(int column) Retrieve the column name for the indicated column.
String[] | getColumnNames() Return the column names of the table that the result set represents.
int | getColumnType(int column) Retrieve the SQL type code for the indicated column.
String | getColumnTypeName(int column) Retrieves the DBMS-specific type name for the indicated column.
int | getPrecision(int column) Retrieves the precision for the indicated column.
int | getScale(int column) Retrieves the scale of the indicated column.
String | getSchemaName(int column) Retrieves the schema name of the table that served as the source for the specified column.
String | getTableName(int column) Retrieves the name of the table that served as the source for the specified column.
boolean | isCaseSensitive(int column) Indicates whether the case of the designated column is significant.
boolean | isCurrency(int column) Indicates whether the designated column contains a currency value.
boolean | isSigned(int column) Indicates whether the designated column contains a signed number.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ResultSetWrappingSqlRowSetMetaData

public ResultSetWrappingSqlRowSetMetaData(ResultSetMetaData resultSetMetaData)
Create a new ResultSetWrappingSqlRowSetMetaData object for the given ResultSetMetaData instance.

Parameters:
resultSetMetaData - a disconnected ResultSetMetaData instance to wrap (usually a javax.sql.RowSetMetaData instance)
See Also:
ResultSet.getMetaData(), RowSetMetaData, ResultSetWrappingSqlRowSet.getMetaData()
Method Detail

getCatalogName

public String getCatalogName(int column)
                      throws InvalidResultSetAccessException
Description copied from interface: SqlRowSetMetaData
Retrieves the catalog name of the table that served as the source for the specified column.

Specified by:
getCatalogName in interface SqlRowSetMetaData
Parameters:
column - the index of the column
Returns:
the catalog name
Throws:
InvalidResultSetAccessException
See Also:
ResultSetMetaData.getCatalogName(int)

getColumnClassName

public String getColumnClassName(int column)
                          throws InvalidResultSetAccessException
Description copied from interface: SqlRowSetMetaData
Retrieves the fully qualified class that the specified column will be mapped to.

Specified by:
getColumnClassName in interface SqlRowSetMetaData
Parameters:
column - the index of the column
Returns:
the class name as a String
Throws:
InvalidResultSetAccessException
See Also:
ResultSetMetaData.getColumnClassName(int)

getColumnCount

public int getColumnCount()
                   throws InvalidResultSetAccessException
Description copied from interface: SqlRowSetMetaData
Retrives the number of columns in the RowSet.

Specified by:
getColumnCount in interface SqlRowSetMetaData
Returns:
the number of columns
Throws:
InvalidResultSetAccessException
See Also:
ResultSetMetaData.getColumnCount()

getColumnNames

public String[] getColumnNames()
                        throws InvalidResultSetAccessException
Description copied from interface: SqlRowSetMetaData
Return the column names of the table that the result set represents.

Specified by:
getColumnNames in interface SqlRowSetMetaData
Returns:
the column names
Throws:
InvalidResultSetAccessException

getColumnDisplaySize

public int getColumnDisplaySize(int column)
                         throws InvalidResultSetAccessException
Description copied from interface: SqlRowSetMetaData
Retrieves the maximum width of the designated column.

Specified by:
getColumnDisplaySize in interface SqlRowSetMetaData
Parameters:
column - the index of the column
Returns:
the width of the column
Throws:
InvalidResultSetAccessException
See Also:
ResultSetMetaData.getColumnDisplaySize(int)

getColumnLabel

public String getColumnLabel(int column)
                      throws InvalidResultSetAccessException
Description copied from interface: SqlRowSetMetaData
Retrieve the suggested column title for the column specified.

Specified by:
getColumnLabel in interface SqlRowSetMetaData
Parameters:
column - the index of the column
Returns:
the column title
Throws:
InvalidResultSetAccessException
See Also:
ResultSetMetaData.getColumnLabel(int)

getColumnName

public String getColumnName(int column)
                     throws InvalidResultSetAccessException
Description copied from interface: SqlRowSetMetaData
Retrieve the column name for the indicated column.

Specified by:
getColumnName in interface SqlRowSetMetaData
Parameters:
column - the index of the column
Returns:
the column name
Throws:
InvalidResultSetAccessException
See Also:
ResultSetMetaData.getColumnName(int)

getColumnType

public int getColumnType(int column)
                  throws InvalidResultSetAccessException
Description copied from interface: SqlRowSetMetaData
Retrieve the SQL type code for the indicated column.

Specified by:
getColumnType in interface SqlRowSetMetaData
Parameters:
column - the index of the column
Returns:
the SQL type code
Throws:
InvalidResultSetAccessException
See Also:
ResultSetMetaData.getColumnType(int), Types

getColumnTypeName

public String getColumnTypeName(int column)
                         throws InvalidResultSetAccessException
Description copied from interface: SqlRowSetMetaData
Retrieves the DBMS-specific type name for the indicated column.

Specified by:
getColumnTypeName in interface SqlRowSetMetaData
Parameters:
column - the index of the column
Returns:
the type name
Throws:
InvalidResultSetAccessException
See Also:
ResultSetMetaData.getColumnTypeName(int)

getPrecision

public int getPrecision(int column)
                 throws InvalidResultSetAccessException
Description copied from interface: SqlRowSetMetaData
Retrieves the precision for the indicated column.

Specified by:
getPrecision in interface SqlRowSetMetaData
Parameters:
column - the index of the column
Returns:
the precision
Throws:
InvalidResultSetAccessException
See Also:
ResultSetMetaData.getPrecision(int)

getScale

public int getScale(int column)
             throws InvalidResultSetAccessException
Description copied from interface: SqlRowSetMetaData
Retrieves the scale of the indicated column.

Specified by:
getScale in interface SqlRowSetMetaData
Parameters:
column - the index of the column
Returns:
the scale
Throws:
InvalidResultSetAccessException
See Also:
ResultSetMetaData.getScale(int)

getSchemaName

public String getSchemaName(int column)
                     throws InvalidResultSetAccessException
Description copied from interface: SqlRowSetMetaData
Retrieves the schema name of the table that served as the source for the specified column.

Specified by:
getSchemaName in interface SqlRowSetMetaData
Parameters:
column - the index of the column
Returns:
the schema name
Throws:
InvalidResultSetAccessException
See Also:
ResultSetMetaData.getSchemaName(int)

getTableName

public String getTableName(int column)
                    throws InvalidResultSetAccessException
Description copied from interface: SqlRowSetMetaData
Retrieves the name of the table that served as the source for the specified column.

Specified by:
getTableName in interface SqlRowSetMetaData
Parameters:
column - the index of the column
Returns:
the name of the table
Throws:
InvalidResultSetAccessException
See Also:
ResultSetMetaData.getTableName(int)

isCaseSensitive

public boolean isCaseSensitive(int column)
                        throws InvalidResultSetAccessException
Description copied from interface: SqlRowSetMetaData
Indicates whether the case of the designated column is significant.

Specified by:
isCaseSensitive in interface SqlRowSetMetaData
Parameters:
column - the index of the column
Returns:
true if the case sensitive, false otherwise
Throws:
InvalidResultSetAccessException
See Also:
ResultSetMetaData.isCaseSensitive(int)

isCurrency

public boolean isCurrency(int column)
                   throws InvalidResultSetAccessException
Description copied from interface: SqlRowSetMetaData
Indicates whether the designated column contains a currency value.

Specified by:
isCurrency in interface SqlRowSetMetaData
Parameters:
column - the index of the column
Returns:
true if the value is a currency value, false otherwise
Throws:
InvalidResultSetAccessException
See Also:
ResultSetMetaData.isCurrency(int)

isSigned

public boolean isSigned(int column)
                 throws InvalidResultSetAccessException
Description copied from interface: SqlRowSetMetaData
Indicates whether the designated column contains a signed number.

Specified by:
isSigned in interface SqlRowSetMetaData
Parameters:
column - the index of the column
Returns:
true if the column contains a signed number, false otherwise
Throws:
InvalidResultSetAccessException
See Also:
ResultSetMetaData.isSigned(int)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.jdbc.support.xml

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jdbc.support.xml

Abstraction for handling fields of SQLXML data type.

See:
Description

Interface Summary
SqlXmlHandler | Abstraction for handling XML fields in specific databases.
SqlXmlObjectMappingHandler | Abstraction for handling XML object mapping to fields in a database.
SqlXmlValue | Subinterface of SqlValue that supports passing in XML data to specified column and adds a cleanup callback, to be invoked after the value has been set and the corresponding statement has been executed.
XmlBinaryStreamProvider | Interface defining handling involved with providing OutputStream data for XML input.
XmlCharacterStreamProvider | Interface defining handling involved with providing Writer data for XML input.
XmlResultProvider | Interface defining handling involved with providing Result data for XML input.

Class Summary
Jdbc4SqlXmlHandler Default implementation of the SqlXmlHandler interface.

Exception Summary
SqlXmlFeatureNotImplementedException Exception thrown when the underlying implementation does not support the requested feature of the API.

Package org.springframework.jdbc.support.xml Description

Abstraction for handling fields of SQLXML data type.


org.springframework.jdbc.support.xml Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jdbc.support.xml

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jdbc.support.xml.Jdbc4SqlXmlHandler (implements org.springframework.jdbc.support.xml.SqlXmlHandler)
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.dao.DataAccessException
              • org.springframework.dao.NonTransientDataAccessException
                • org.springframework.dao.InvalidDataAccessApiUsageException
                  • org.springframework.jdbc.support.xml.SqlXmlFeatureNotImplementedException

Interface Hierarchy

  • org.springframework.jdbc.support.SqlValue
    • org.springframework.jdbc.support.xml.SqlXmlValue
  • org.springframework.jdbc.support.xml.SqlXmlHandler
    • org.springframework.jdbc.support.xml.SqlXmlObjectMappingHandler
  • org.springframework.jdbc.support.xml.XmlBinaryStreamProvider
  • org.springframework.jdbc.support.xml.XmlCharacterStreamProvider
  • org.springframework.jdbc.support.xml.XmlResultProvider


SqlXmlHandler

org.springframework.jdbc.support.xml
Interface SqlXmlHandler

All Known Subinterfaces:
SqlXmlObjectMappingHandler
All Known Implementing Classes:
Jdbc4SqlXmlHandler
public interface SqlXmlHandler

Abstraction for handling XML fields in specific databases. Its main purpose is to isolate database-specific handling of XML stored in the database.

JDBC 4.0 introduces the new data type java.sql.SQLXML but most databases and their drivers currently rely on database-specific data types and features.

Provides accessor methods for XML fields and acts as factory for SqlXmlValue instances.

Since:
2.5.5
Author:
Thomas Risberg
See Also:
Jdbc4SqlXmlHandler, SQLXML, ResultSet.getSQLXML(int), PreparedStatement.setSQLXML(int, java.sql.SQLXML)

Method Summary
InputStream | getXmlAsBinaryStream(ResultSet rs, int columnIndex) Retrieve the given column as binary stream from the given ResultSet.
InputStream | getXmlAsBinaryStream(ResultSet rs, String columnName) Retrieve the given column as binary stream from the given ResultSet.
Reader | getXmlAsCharacterStream(ResultSet rs, int columnIndex) Retrieve the given column as character stream from the given ResultSet.
Reader | getXmlAsCharacterStream(ResultSet rs, String columnName) Retrieve the given column as character stream from the given ResultSet.
Source | getXmlAsSource(ResultSet rs, int columnIndex, Class sourceClass) Retrieve the given column as Source implemented using the specified source class from the given ResultSet.
Source | getXmlAsSource(ResultSet rs, String columnName, Class sourceClass) Retrieve the given column as Source implemented using the specified source class from the given ResultSet.
String | getXmlAsString(ResultSet rs, int columnIndex) Retrieve the given column as String from the given ResultSet.
String | getXmlAsString(ResultSet rs, String columnName) Retrieve the given column as String from the given ResultSet.
SqlXmlValue | newSqlXmlValue(Class resultClass, XmlResultProvider provider) Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.
SqlXmlValue | newSqlXmlValue(Document doc) Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.
SqlXmlValue | newSqlXmlValue(String value) Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.
SqlXmlValue | newSqlXmlValue(XmlBinaryStreamProvider provider) Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.
SqlXmlValue | newSqlXmlValue(XmlCharacterStreamProvider provider) Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.

Method Detail

getXmlAsString

String getXmlAsString(ResultSet rs,
                      String columnName)
                      throws SQLException
Retrieve the given column as String from the given ResultSet.

Might simply invoke ResultSet.getString or work with SQLXML or database-specific classes depending on the database and driver.

Parameters:
rs - the ResultSet to retrieve the content from
columnName - the column name to use
Returns:
the content as String, or null in case of SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getString(int), ResultSet.getSQLXML(int)

getXmlAsString

String getXmlAsString(ResultSet rs,
                      int columnIndex)
                      throws SQLException
Retrieve the given column as String from the given ResultSet.

Might simply invoke ResultSet.getString or work with SQLXML or database-specific classes depending on the database and driver.

Parameters:
rs - the ResultSet to retrieve the content from
columnIndex - the column index to use
Returns:
the content as String, or null in case of SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getString(int), ResultSet.getSQLXML(int)

getXmlAsBinaryStream

InputStream getXmlAsBinaryStream(ResultSet rs,
                                 String columnName)
                                 throws SQLException
Retrieve the given column as binary stream from the given ResultSet.

Might simply invoke ResultSet.getAsciiStream or work with SQLXML or database-specific classes depending on the database and driver.

Parameters:
rs - the ResultSet to retrieve the content from
columnName - the column name to use
Returns:
the content as a binary stream, or null in case of SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getSQLXML(int), SQLXML.getBinaryStream()

getXmlAsBinaryStream

InputStream getXmlAsBinaryStream(ResultSet rs,
                                 int columnIndex)
                                 throws SQLException
Retrieve the given column as binary stream from the given ResultSet.

Might simply invoke ResultSet.getAsciiStream or work with SQLXML or database-specific classes depending on the database and driver.

Parameters:
rs - the ResultSet to retrieve the content from
columnIndex - the column index to use
Returns:
the content as binary stream, or null in case of SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getSQLXML(int), SQLXML.getBinaryStream()

getXmlAsCharacterStream

Reader getXmlAsCharacterStream(ResultSet rs,
                               String columnName)
                               throws SQLException
Retrieve the given column as character stream from the given ResultSet.

Might simply invoke ResultSet.getCharacterStream or work with SQLXML or database-specific classes depending on the database and driver.

Parameters:
rs - the ResultSet to retrieve the content from
columnName - the column name to use
Returns:
the content as character stream
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getSQLXML(int), SQLXML.getCharacterStream()

getXmlAsCharacterStream

Reader getXmlAsCharacterStream(ResultSet rs,
                               int columnIndex)
                               throws SQLException
Retrieve the given column as character stream from the given ResultSet.

Might simply invoke ResultSet.getCharacterStream or work with SQLXML or database-specific classes depending on the database and driver.

Parameters:
rs - the ResultSet to retrieve the content from
columnIndex - the column index to use
Returns:
the content as character stream
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getSQLXML(int), SQLXML.getCharacterStream()

getXmlAsSource

Source getXmlAsSource(ResultSet rs,
                      String columnName,
                      Class sourceClass)
                      throws SQLException
Retrieve the given column as Source implemented using the specified source class from the given ResultSet.

Might work with SQLXML or database-specific classes depending on the database and driver.

Parameters:
rs - the ResultSet to retrieve the content from
columnName - the column name to use
sourceClass - the implementation class to be used
Returns:
the content as character stream
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getSQLXML(int), SQLXML.getSource(java.lang.Class)

getXmlAsSource

Source getXmlAsSource(ResultSet rs,
                      int columnIndex,
                      Class sourceClass)
                      throws SQLException
Retrieve the given column as Source implemented using the specified source class from the given ResultSet.

Might work with SQLXML or database-specific classes depending on the database and driver.

Parameters:
rs - the ResultSet to retrieve the content from
columnIndex - the column index to use
sourceClass - the implementation class to be used
Returns:
the content as character stream
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getSQLXML(int), SQLXML.getSource(java.lang.Class)

newSqlXmlValue

SqlXmlValue newSqlXmlValue(String value)
Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.

Parameters:
value - the XML String value providing XML data
Returns:
the implementation specific instance
See Also:
SqlXmlValue, SQLXML.setString(String)

newSqlXmlValue

SqlXmlValue newSqlXmlValue(XmlBinaryStreamProvider provider)
Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.

Parameters:
provider - the XmlBinaryStreamProvider providing XML data
Returns:
the implementation specific instance
See Also:
SqlXmlValue, SQLXML.setBinaryStream()

newSqlXmlValue

SqlXmlValue newSqlXmlValue(XmlCharacterStreamProvider provider)
Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.

Parameters:
provider - the XmlCharacterStreamProvider providing XML data
Returns:
the implementation specific instance
See Also:
SqlXmlValue, SQLXML.setCharacterStream()

newSqlXmlValue

SqlXmlValue newSqlXmlValue(Class resultClass,
                           XmlResultProvider provider)
Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.

Parameters:
resultClass - the Result implementation class to be used
provider - the XmlResultProvider that will provide the XML data
Returns:
the implementation specific instance
See Also:
SqlXmlValue, SQLXML.setResult(Class)

newSqlXmlValue

SqlXmlValue newSqlXmlValue(Document doc)
Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.

Parameters:
doc - the XML Document to be used
Returns:
the implementation specific instance
See Also:
SqlXmlValue
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SqlXmlObjectMappingHandler

org.springframework.jdbc.support.xml
Interface SqlXmlObjectMappingHandler

All Superinterfaces:
SqlXmlHandler
public interface SqlXmlObjectMappingHandler
extends SqlXmlHandler

Abstraction for handling XML object mapping to fields in a database.

Provides accessor methods for XML fields unmarshalled to an Object, and acts as factory for SqlXmlValue instances for marshalling purposes.

Since:
2.5.5
Author:
Thomas Risberg
See Also:
ResultSet.getSQLXML(int), SQLXML

Method Summary
Object | getXmlAsObject(ResultSet rs, int columnIndex) Retrieve the given column as an object marshalled from the XML data retrieved from the given ResultSet.
Object | getXmlAsObject(ResultSet rs, String columnName) Retrieve the given column as an object marshalled from the XML data retrieved from the given ResultSet.
SqlXmlValue | newMarshallingSqlXmlValue(Object value) Get an instance of an SqlXmlValue implementation to be used together with the database specific implementation of this SqlXmlObjectMappingHandler.
Methods inherited from interface org.springframework.jdbc.support.xml.SqlXmlHandler
getXmlAsBinaryStream, getXmlAsBinaryStream, getXmlAsCharacterStream, getXmlAsCharacterStream, getXmlAsSource, getXmlAsSource, getXmlAsString, getXmlAsString, newSqlXmlValue, newSqlXmlValue, newSqlXmlValue, newSqlXmlValue, newSqlXmlValue

Method Detail

getXmlAsObject

Object getXmlAsObject(ResultSet rs,
                      String columnName)
                      throws SQLException
Retrieve the given column as an object marshalled from the XML data retrieved from the given ResultSet.

Works with an internal Object to XML Mapping implementation.

Parameters:
rs - the ResultSet to retrieve the content from
columnName - the column name to use
Returns:
the content as an Object, or null in case of SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getSQLXML(int)

getXmlAsObject

Object getXmlAsObject(ResultSet rs,
                      int columnIndex)
                      throws SQLException
Retrieve the given column as an object marshalled from the XML data retrieved from the given ResultSet.

Works with an internal Object to XML Mapping implementation.

Parameters:
rs - the ResultSet to retrieve the content from
columnIndex - the column index to use
Returns:
the content as an Object, or null in case of SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getSQLXML(int)

newMarshallingSqlXmlValue

SqlXmlValue newMarshallingSqlXmlValue(Object value)
Get an instance of an SqlXmlValue implementation to be used together with the database specific implementation of this SqlXmlObjectMappingHandler.

Parameters:
value - the Object to be marshalled to XML
Returns:
the implementation specific instance
See Also:
SqlXmlValue
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SqlXmlValue

org.springframework.jdbc.support.xml
Interface SqlXmlValue

All Superinterfaces:
SqlValue
public interface SqlXmlValue
extends SqlValue

Subinterface of SqlValue that supports passing in XML data to specified column and adds a cleanup callback, to be invoked after the value has been set and the corresponding statement has been executed.

Since:
2.5.5
Author:
Thomas Risberg
See Also:
SqlValue

Method Summary
Methods inherited from interface org.springframework.jdbc.support.SqlValue
cleanup, setValue

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XmlBinaryStreamProvider

org.springframework.jdbc.support.xml
Interface XmlBinaryStreamProvider

public interface XmlBinaryStreamProvider

Interface defining handling involved with providing OutputStream data for XML input.

Since:
2.5.5
Author:
Thomas Risberg
See Also:
OutputStream

Method Summary
 void provideXml(OutputStream outputStream)
Implementations must implement this method to provide the XML content for the OutputStream.

Method Detail

provideXml

void provideXml(OutputStream outputStream)
                throws IOException
Implementations must implement this method to provide the XML content for the OutputStream.

Parameters:
outputStream - the OutputStream object being used to provide the XML input
Throws:
IOException - if an I/O error occurs while providing the XML
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XmlCharacterStreamProvider

org.springframework.jdbc.support.xml
Interface XmlCharacterStreamProvider

public interface XmlCharacterStreamProvider

Interface defining handling involved with providing Writer data for XML input.

Since:
2.5.5
Author:
Thomas Risberg
See Also:
Writer

Method Summary
 void provideXml(Writer writer)
Implementations must implement this method to provide the XML content for the Writer.

Method Detail

provideXml

void provideXml(Writer writer)
                throws IOException
Implementations must implement this method to provide the XML content for the Writer.

Parameters:
writer - the Writer object being used to provide the XML input
Throws:
IOException - if an I/O error occurs while providing the XML
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XmlResultProvider

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.support.xml
Interface XmlResultProvider

public interface XmlResultProvider

Interface defining handling involved with providing Result data for XML input.

Since:
2.5.5
Author:
Thomas Risberg
See Also:
Result

Method Summary
 void provideXml(Result result)
Implementations must implement this method to provide the XML content for the Result.

Method Detail

provideXml

void provideXml(Result result)
Implementations must implement this method to provide the XML content for the Result. Implementations will vary depending on the Result implementation used.

Parameters:
result - the Result object being used to provide the XML input
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


Jdbc4SqlXmlHandler

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jdbc.support.xml
Class Jdbc4SqlXmlHandler

java.lang.Object
    extended by  org.springframework.jdbc.support.xml.Jdbc4SqlXmlHandler
All Implemented Interfaces:
SqlXmlHandler
public class Jdbc4SqlXmlHandler
extends Object
implements SqlXmlHandler

Default implementation of the SqlXmlHandler interface. Provides database-specific implementations for storing and retrieving XML documents to and from fields in a database, relying on the JDBC 4.0 java.sql.SQLXML facility.

Since:
2.5.6
Author:
Thomas Risberg, Juergen Hoeller
See Also:
SQLXML, ResultSet.getSQLXML(int), PreparedStatement.setSQLXML(int, java.sql.SQLXML)

Constructor Summary
Jdbc4SqlXmlHandler()
Method Summary
InputStream | getXmlAsBinaryStream(ResultSet rs, int columnIndex) Retrieve the given column as binary stream from the given ResultSet.
InputStream | getXmlAsBinaryStream(ResultSet rs, String columnName) Retrieve the given column as binary stream from the given ResultSet.
Reader | getXmlAsCharacterStream(ResultSet rs, int columnIndex) Retrieve the given column as character stream from the given ResultSet.
Reader | getXmlAsCharacterStream(ResultSet rs, String columnName) Retrieve the given column as character stream from the given ResultSet.
Source | getXmlAsSource(ResultSet rs, int columnIndex, Class sourceClass) Retrieve the given column as Source implemented using the specified source class from the given ResultSet.
Source | getXmlAsSource(ResultSet rs, String columnName, Class sourceClass) Retrieve the given column as Source implemented using the specified source class from the given ResultSet.
String | getXmlAsString(ResultSet rs, int columnIndex) Retrieve the given column as String from the given ResultSet.
String | getXmlAsString(ResultSet rs, String columnName) Retrieve the given column as String from the given ResultSet.
SqlXmlValue | newSqlXmlValue(Class resultClass, XmlResultProvider provider) Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.
SqlXmlValue | newSqlXmlValue(Document document) Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.
SqlXmlValue | newSqlXmlValue(String value) Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.
SqlXmlValue | newSqlXmlValue(XmlBinaryStreamProvider provider) Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.
SqlXmlValue | newSqlXmlValue(XmlCharacterStreamProvider provider) Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Jdbc4SqlXmlHandler

public Jdbc4SqlXmlHandler()
Method Detail

getXmlAsString

public String getXmlAsString(ResultSet rs,
                             String columnName)
                      throws SQLException
Description copied from interface: SqlXmlHandler
Retrieve the given column as String from the given ResultSet.

Might simply invoke ResultSet.getString or work with SQLXML or database-specific classes depending on the database and driver.

Specified by:
getXmlAsString in interface SqlXmlHandler
Parameters:
rs - the ResultSet to retrieve the content from
columnName - the column name to use
Returns:
the content as String, or null in case of SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getString(int), ResultSet.getSQLXML(int)

getXmlAsString

public String getXmlAsString(ResultSet rs,
                             int columnIndex)
                      throws SQLException
Description copied from interface: SqlXmlHandler
Retrieve the given column as String from the given ResultSet.

Might simply invoke ResultSet.getString or work with SQLXML or database-specific classes depending on the database and driver.

Specified by:
getXmlAsString in interface SqlXmlHandler
Parameters:
rs - the ResultSet to retrieve the content from
columnIndex - the column index to use
Returns:
the content as String, or null in case of SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getString(int), ResultSet.getSQLXML(int)

getXmlAsBinaryStream

public InputStream getXmlAsBinaryStream(ResultSet rs,
                                        String columnName)
                                 throws SQLException
Description copied from interface: SqlXmlHandler
Retrieve the given column as binary stream from the given ResultSet.

Might simply invoke ResultSet.getAsciiStream or work with SQLXML or database-specific classes depending on the database and driver.

Specified by:
getXmlAsBinaryStream in interface SqlXmlHandler
Parameters:
rs - the ResultSet to retrieve the content from
columnName - the column name to use
Returns:
the content as a binary stream, or null in case of SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getSQLXML(int), SQLXML.getBinaryStream()

getXmlAsBinaryStream

public InputStream getXmlAsBinaryStream(ResultSet rs,
                                        int columnIndex)
                                 throws SQLException
Description copied from interface: SqlXmlHandler
Retrieve the given column as binary stream from the given ResultSet.

Might simply invoke ResultSet.getAsciiStream or work with SQLXML or database-specific classes depending on the database and driver.

Specified by:
getXmlAsBinaryStream in interface SqlXmlHandler
Parameters:
rs - the ResultSet to retrieve the content from
columnIndex - the column index to use
Returns:
the content as binary stream, or null in case of SQL NULL
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getSQLXML(int), SQLXML.getBinaryStream()

getXmlAsCharacterStream

public Reader getXmlAsCharacterStream(ResultSet rs,
                                      String columnName)
                               throws SQLException
Description copied from interface: SqlXmlHandler
Retrieve the given column as character stream from the given ResultSet.

Might simply invoke ResultSet.getCharacterStream or work with SQLXML or database-specific classes depending on the database and driver.

Specified by:
getXmlAsCharacterStream in interface SqlXmlHandler
Parameters:
rs - the ResultSet to retrieve the content from
columnName - the column name to use
Returns:
the content as character stream
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getSQLXML(int), SQLXML.getCharacterStream()

getXmlAsCharacterStream

public Reader getXmlAsCharacterStream(ResultSet rs,
                                      int columnIndex)
                               throws SQLException
Description copied from interface: SqlXmlHandler
Retrieve the given column as character stream from the given ResultSet.

Might simply invoke ResultSet.getCharacterStream or work with SQLXML or database-specific classes depending on the database and driver.

Specified by:
getXmlAsCharacterStream in interface SqlXmlHandler
Parameters:
rs - the ResultSet to retrieve the content from
columnIndex - the column index to use
Returns:
the content as character stream
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getSQLXML(int), SQLXML.getCharacterStream()

getXmlAsSource

public Source getXmlAsSource(ResultSet rs,
                             String columnName,
                             Class sourceClass)
                      throws SQLException
Description copied from interface: SqlXmlHandler
Retrieve the given column as Source implemented using the specified source class from the given ResultSet.

Might work with SQLXML or database-specific classes depending on the database and driver.

Specified by:
getXmlAsSource in interface SqlXmlHandler
Parameters:
rs - the ResultSet to retrieve the content from
columnName - the column name to use
sourceClass - the implementation class to be used
Returns:
the content as character stream
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getSQLXML(int), SQLXML.getSource(java.lang.Class)

getXmlAsSource

public Source getXmlAsSource(ResultSet rs,
                             int columnIndex,
                             Class sourceClass)
                      throws SQLException
Description copied from interface: SqlXmlHandler
Retrieve the given column as Source implemented using the specified source class from the given ResultSet.

Might work with SQLXML or database-specific classes depending on the database and driver.

Specified by:
getXmlAsSource in interface SqlXmlHandler
Parameters:
rs - the ResultSet to retrieve the content from
columnIndex - the column index to use
sourceClass - the implementation class to be used
Returns:
the content as character stream
Throws:
SQLException - if thrown by JDBC methods
See Also:
ResultSet.getSQLXML(int), SQLXML.getSource(java.lang.Class)

newSqlXmlValue

public SqlXmlValue newSqlXmlValue(String value)
Description copied from interface: SqlXmlHandler
Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.

Specified by:
newSqlXmlValue in interface SqlXmlHandler
Parameters:
value - the XML String value providing XML data
Returns:
the implementation specific instance
See Also:
SqlXmlValue, SQLXML.setString(String)

newSqlXmlValue

public SqlXmlValue newSqlXmlValue(XmlBinaryStreamProvider provider)
Description copied from interface: SqlXmlHandler
Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.

Specified by:
newSqlXmlValue in interface SqlXmlHandler
Parameters:
provider - the XmlBinaryStreamProvider providing XML data
Returns:
the implementation specific instance
See Also:
SqlXmlValue, SQLXML.setBinaryStream()

newSqlXmlValue

public SqlXmlValue newSqlXmlValue(XmlCharacterStreamProvider provider)
Description copied from interface: SqlXmlHandler
Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.

Specified by:
newSqlXmlValue in interface SqlXmlHandler
Parameters:
provider - the XmlCharacterStreamProvider providing XML data
Returns:
the implementation specific instance
See Also:
SqlXmlValue, SQLXML.setCharacterStream()

newSqlXmlValue

public SqlXmlValue newSqlXmlValue(Class resultClass,
                                  XmlResultProvider provider)
Description copied from interface: SqlXmlHandler
Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.

Specified by:
newSqlXmlValue in interface SqlXmlHandler
Parameters:
resultClass - the Result implementation class to be used
provider - the XmlResultProvider that will provide the XML data
Returns:
the implementation specific instance
See Also:
SqlXmlValue, SQLXML.setResult(Class)

newSqlXmlValue

public SqlXmlValue newSqlXmlValue(Document document)
Description copied from interface: SqlXmlHandler
Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.

Specified by:
newSqlXmlValue in interface SqlXmlHandler
Parameters:
document - the XML Document to be used
Returns:
the implementation specific instance
See Also:
SqlXmlValue
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


SqlXmlFeatureNotImplementedException

org.springframework.jdbc.support.xml
Class SqlXmlFeatureNotImplementedException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.InvalidDataAccessApiUsageException
                                extended by  org.springframework.jdbc.support.xml.SqlXmlFeatureNotImplementedException
All Implemented Interfaces:
Serializable
public class SqlXmlFeatureNotImplementedException
extends InvalidDataAccessApiUsageException

Exception thrown when the underlying implementation does not support the requested feature of the API.

Since:
2.5.5
Author:
Thomas Risberg
See Also:
Serialized Form

Constructor Summary
SqlXmlFeatureNotImplementedException(String msg)
Constructor for SqlXmlFeatureNotImplementedException.
SqlXmlFeatureNotImplementedException(String msg, Throwable cause)
Constructor for SqlXmlFeatureNotImplementedException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

SqlXmlFeatureNotImplementedException

public SqlXmlFeatureNotImplementedException(String msg)
Constructor for SqlXmlFeatureNotImplementedException.

Parameters:
msg - the detail message

SqlXmlFeatureNotImplementedException

public SqlXmlFeatureNotImplementedException(String msg,
                                            Throwable cause)
Constructor for SqlXmlFeatureNotImplementedException.

Parameters:
msg - the detail message
cause - the root cause from the data access API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.jms

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jms

This package contains integration classes for JMS, allowing for Spring-style JMS access.

See:
Description

Exception Summary
IllegalStateException | Runtime exception mirroring the JMS IllegalStateException.
InvalidClientIDException | Runtime exception mirroring the JMS InvalidClientIDException.
InvalidDestinationException | Runtime exception mirroring the JMS InvalidDestinationException.
InvalidSelectorException | Runtime exception mirroring the JMS InvalidSelectorException.
JmsException | Base class for exception thrown by the framework whenever it encounters a problem related to JMS.
JmsSecurityException | Runtime exception mirroring the JMS JMSSecurityException.
MessageEOFException | Runtime exception mirroring the JMS MessageEOFException.
MessageFormatException | Runtime exception mirroring the JMS MessageFormatException.
MessageNotReadableException | Runtime exception mirroring the JMS MessageNotReadableException.
MessageNotWriteableException | Runtime exception mirroring the JMS MessageNotWriteableException.
ResourceAllocationException | Runtime exception mirroring the JMS ResourceAllocationException.
TransactionInProgressException | Runtime exception mirroring the JMS TransactionInProgressException.
TransactionRolledBackException | Runtime exception mirroring the JMS TransactionRolledBackException.
UncategorizedJmsException | JmsException to be thrown when no other matching subclass found.

Package org.springframework.jms Description

This package contains integration classes for JMS, allowing for Spring-style JMS access.


org.springframework.jms Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jms

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.jms.JmsException
              • org.springframework.jms.IllegalStateException
              • org.springframework.jms.InvalidClientIDException
              • org.springframework.jms.InvalidDestinationException
              • org.springframework.jms.InvalidSelectorException
              • org.springframework.jms.JmsSecurityException
              • org.springframework.jms.MessageEOFException
              • org.springframework.jms.MessageFormatException
              • org.springframework.jms.MessageNotReadableException
              • org.springframework.jms.MessageNotWriteableException
              • org.springframework.jms.ResourceAllocationException
              • org.springframework.jms.TransactionInProgressException
              • org.springframework.jms.TransactionRolledBackException
              • org.springframework.jms.UncategorizedJmsException


IllegalStateException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jms
Class IllegalStateException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.jms.JmsException
                        extended by  org.springframework.jms.IllegalStateException
All Implemented Interfaces:
Serializable
public class IllegalStateException
extends JmsException

Runtime exception mirroring the JMS IllegalStateException.

Since:
1.1
Author:
Mark Pollack
See Also:
IllegalStateException, Serialized Form

Constructor Summary
IllegalStateException(IllegalStateException cause)
Method Summary
Methods inherited from class org.springframework.jms.JmsException
getErrorCode, getMessage
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

IllegalStateException

public IllegalStateException(IllegalStateException cause)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


InvalidClientIDException

org.springframework.jms
Class InvalidClientIDException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.jms.JmsException
                        extended by  org.springframework.jms.InvalidClientIDException
All Implemented Interfaces:
Serializable
public class InvalidClientIDException
extends JmsException

Runtime exception mirroring the JMS InvalidClientIDException.

Since:
1.1
Author:
Mark Pollack
See Also:
InvalidClientIDException, Serialized Form

Constructor Summary
InvalidClientIDException(InvalidClientIDException cause)
Method Summary
Methods inherited from class org.springframework.jms.JmsException
getErrorCode, getMessage
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

InvalidClientIDException

public InvalidClientIDException(InvalidClientIDException cause)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InvalidDestinationException

org.springframework.jms
Class InvalidDestinationException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.jms.JmsException
                        extended by  org.springframework.jms.InvalidDestinationException
All Implemented Interfaces:
Serializable
public class InvalidDestinationException
extends JmsException

Runtime exception mirroring the JMS InvalidDestinationException.

Since:
1.1
Author:
Mark Pollack
See Also:
InvalidDestinationException, Serialized Form

Constructor Summary
InvalidDestinationException(InvalidDestinationException cause)
Method Summary
Methods inherited from class org.springframework.jms.JmsException
getErrorCode, getMessage
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

InvalidDestinationException

public InvalidDestinationException(InvalidDestinationException cause)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InvalidSelectorException

org.springframework.jms
Class InvalidSelectorException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.jms.JmsException
                        extended by  org.springframework.jms.InvalidSelectorException
All Implemented Interfaces:
Serializable
public class InvalidSelectorException
extends JmsException

Runtime exception mirroring the JMS InvalidSelectorException.

Since:
1.1
Author:
Mark Pollack
See Also:
InvalidSelectorException, Serialized Form

Constructor Summary
InvalidSelectorException(InvalidSelectorException cause)
Method Summary
Methods inherited from class org.springframework.jms.JmsException
getErrorCode, getMessage
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

InvalidSelectorException

public InvalidSelectorException(InvalidSelectorException cause)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JmsException

org.springframework.jms
Class JmsException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.jms.JmsException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DestinationResolutionException, IllegalStateException, InvalidClientIDException, InvalidDestinationException, InvalidSelectorException, JmsSecurityException, ListenerExecutionFailedException, MessageConversionException, MessageEOFException, MessageFormatException, MessageNotReadableException, MessageNotWriteableException, ResourceAllocationException, SynchedLocalTransactionFailedException, TransactionInProgressException, TransactionRolledBackException, UncategorizedJmsException
public abstract class JmsException
extends NestedRuntimeException

Base class for exception thrown by the framework whenever it encounters a problem related to JMS.

Since:
1.1
Author:
Mark Pollack, Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
JmsException(String msg)
Constructor that takes a message.
JmsException(String msg, Throwable cause)
Constructor that takes a message and a root cause.
JmsException(Throwable cause)
Constructor that takes a plain root cause, intended for subclasses mirroring corresponding javax.jms exceptions.
Method Summary
String | getErrorCode() Convenience method to get the vendor specific error code if the root cause was an instance of JMSException.
String | getMessage() Return the detail message, including the message from the linked exception if there is one.
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

JmsException

public JmsException(String msg)
Constructor that takes a message.

Parameters:
msg - the detail message

JmsException

public JmsException(String msg,
                    Throwable cause)
Constructor that takes a message and a root cause.

Parameters:
msg - the detail message
cause - the cause of the exception. This argument is generally expected to be a proper subclass of JMSException, but can also be a JNDI NamingException or the like.

JmsException

public JmsException(Throwable cause)
Constructor that takes a plain root cause, intended for subclasses mirroring corresponding javax.jms exceptions.

Parameters:
cause - the cause of the exception. This argument is generally expected to be a proper subclass of JMSException.
Method Detail

getErrorCode

public String getErrorCode()
Convenience method to get the vendor specific error code if the root cause was an instance of JMSException.

Returns:
a string specifying the vendor-specific error code if the root cause is an instance of JMSException, or null

getMessage

public String getMessage()
Return the detail message, including the message from the linked exception if there is one.

Overrides:
getMessage in class NestedRuntimeException
See Also:
JMSException.getLinkedException()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JmsSecurityException

org.springframework.jms
Class JmsSecurityException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.jms.JmsException
                        extended by  org.springframework.jms.JmsSecurityException
All Implemented Interfaces:
Serializable
public class JmsSecurityException
extends JmsException

Runtime exception mirroring the JMS JMSSecurityException.

Since:
1.1
Author:
Mark Pollack
See Also:
JMSSecurityException, Serialized Form

Constructor Summary
JmsSecurityException(JMSSecurityException cause)
Method Summary
Methods inherited from class org.springframework.jms.JmsException
getErrorCode, getMessage
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

JmsSecurityException

public JmsSecurityException(JMSSecurityException cause)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageEOFException

org.springframework.jms
Class MessageEOFException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.jms.JmsException
                        extended by  org.springframework.jms.MessageEOFException
All Implemented Interfaces:
Serializable
public class MessageEOFException
extends JmsException

Runtime exception mirroring the JMS MessageEOFException.

Since:
1.1
Author:
Mark Pollack
See Also:
MessageEOFException, Serialized Form

Constructor Summary
MessageEOFException(MessageEOFException cause)
Method Summary
Methods inherited from class org.springframework.jms.JmsException
getErrorCode, getMessage
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

MessageEOFException

public MessageEOFException(MessageEOFException cause)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageFormatException

org.springframework.jms
Class MessageFormatException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.jms.JmsException
                        extended by  org.springframework.jms.MessageFormatException
All Implemented Interfaces:
Serializable
public class MessageFormatException
extends JmsException

Runtime exception mirroring the JMS MessageFormatException.

Since:
1.1
Author:
Mark Pollack
See Also:
MessageFormatException, Serialized Form

Constructor Summary
MessageFormatException(MessageFormatException cause)
Method Summary
Methods inherited from class org.springframework.jms.JmsException
getErrorCode, getMessage
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

MessageFormatException

public MessageFormatException(MessageFormatException cause)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageNotReadableException

org.springframework.jms
Class MessageNotReadableException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.jms.JmsException
                        extended by  org.springframework.jms.MessageNotReadableException
All Implemented Interfaces:
Serializable
public class MessageNotReadableException
extends JmsException

Runtime exception mirroring the JMS MessageNotReadableException.

Since:
1.1
Author:
Mark Pollack
See Also:
MessageNotReadableException, Serialized Form

Constructor Summary
MessageNotReadableException(MessageNotReadableException cause)
Method Summary
Methods inherited from class org.springframework.jms.JmsException
getErrorCode, getMessage
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

MessageNotReadableException

public MessageNotReadableException(MessageNotReadableException cause)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageNotWriteableException

org.springframework.jms
Class MessageNotWriteableException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.jms.JmsException
                        extended by  org.springframework.jms.MessageNotWriteableException
All Implemented Interfaces:
Serializable
public class MessageNotWriteableException
extends JmsException

Runtime exception mirroring the JMS MessageNotWriteableException.

Since:
1.1
Author:
Mark Pollack
See Also:
MessageNotWriteableException, Serialized Form

Constructor Summary
MessageNotWriteableException(MessageNotWriteableException cause)
Method Summary
Methods inherited from class org.springframework.jms.JmsException
getErrorCode, getMessage
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

MessageNotWriteableException

public MessageNotWriteableException(MessageNotWriteableException cause)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResourceAllocationException

org.springframework.jms
Class ResourceAllocationException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.jms.JmsException
                        extended by  org.springframework.jms.ResourceAllocationException
All Implemented Interfaces:
Serializable
public class ResourceAllocationException
extends JmsException

Runtime exception mirroring the JMS ResourceAllocationException.

Since:
1.1
Author:
Mark Pollack
See Also:
ResourceAllocationException, Serialized Form

Constructor Summary
ResourceAllocationException(ResourceAllocationException cause)
Method Summary
Methods inherited from class org.springframework.jms.JmsException
getErrorCode, getMessage
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ResourceAllocationException

public ResourceAllocationException(ResourceAllocationException cause)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionInProgressException

org.springframework.jms
Class TransactionInProgressException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.jms.JmsException
                        extended by  org.springframework.jms.TransactionInProgressException
All Implemented Interfaces:
Serializable
public class TransactionInProgressException
extends JmsException

Runtime exception mirroring the JMS TransactionInProgressException.

Since:
1.1
Author:
Mark Pollack
See Also:
TransactionInProgressException, Serialized Form

Constructor Summary
TransactionInProgressException(TransactionInProgressException cause)
Method Summary
Methods inherited from class org.springframework.jms.JmsException
getErrorCode, getMessage
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

TransactionInProgressException

public TransactionInProgressException(TransactionInProgressException cause)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionRolledBackException

org.springframework.jms
Class TransactionRolledBackException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.jms.JmsException
                        extended by  org.springframework.jms.TransactionRolledBackException
All Implemented Interfaces:
Serializable
public class TransactionRolledBackException
extends JmsException

Runtime exception mirroring the JMS TransactionRolledBackException.

Since:
1.1
Author:
Mark Pollack
See Also:
TransactionRolledBackException, Serialized Form

Constructor Summary
TransactionRolledBackException(TransactionRolledBackException cause)
Method Summary
Methods inherited from class org.springframework.jms.JmsException
getErrorCode, getMessage
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

TransactionRolledBackException

public TransactionRolledBackException(TransactionRolledBackException cause)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UncategorizedJmsException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jms
Class UncategorizedJmsException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.jms.JmsException
                        extended by  org.springframework.jms.UncategorizedJmsException
All Implemented Interfaces:
Serializable
public class UncategorizedJmsException
extends JmsException

JmsException to be thrown when no other matching subclass found.

Since:
1.1
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
UncategorizedJmsException(String msg)
Constructor that takes a message.
UncategorizedJmsException(String msg, Throwable cause)
Constructor that takes a message and a root cause.
UncategorizedJmsException(Throwable cause)
Constructor that takes a root cause only.
Method Summary
Methods inherited from class org.springframework.jms.JmsException
getErrorCode, getMessage
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

UncategorizedJmsException

public UncategorizedJmsException(String msg)
Constructor that takes a message.

Parameters:
msg - the detail message

UncategorizedJmsException

public UncategorizedJmsException(String msg,
                                 Throwable cause)
Constructor that takes a message and a root cause.

Parameters:
msg - the detail message
cause - the cause of the exception. This argument is generally expected to be a proper subclass of JMSException, but can also be a JNDI NamingException or the like.

UncategorizedJmsException

public UncategorizedJmsException(Throwable cause)
Constructor that takes a root cause only.

Parameters:
cause - the cause of the exception. This argument is generally expected to be a proper subclass of JMSException, but can also be a JNDI NamingException or the like.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jms.config

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jms.config

Support package for declarative messaging configuration, with XML schema being the primary configuration format.

See:
Description

Class Summary
JmsNamespaceHandler A NamespaceHandler for the JMS namespace.

Package org.springframework.jms.config Description

Support package for declarative messaging configuration, with XML schema being the primary configuration format.


org.springframework.jms.config Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jms.config

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.beans.factory.xml.NamespaceHandlerSupport (implements org.springframework.beans.factory.xml.NamespaceHandler)
      • org.springframework.jms.config.JmsNamespaceHandler


JmsNamespaceHandler

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jms.config
Class JmsNamespaceHandler

java.lang.Object
    extended by  org.springframework.beans.factory.xml.NamespaceHandlerSupport
        extended by  org.springframework.jms.config.JmsNamespaceHandler
All Implemented Interfaces:
NamespaceHandler
public class JmsNamespaceHandler
extends NamespaceHandlerSupport

A NamespaceHandler for the JMS namespace.

Since:
2.5
Author:
Mark Fisher, Juergen Hoeller

Constructor Summary
JmsNamespaceHandler()
Method Summary
 void init()
Invoked by the DefaultBeanDefinitionDocumentReader after construction but before any custom elements are parsed.
Methods inherited from class org.springframework.beans.factory.xml.NamespaceHandlerSupport
decorate, parse, registerBeanDefinitionDecorator, registerBeanDefinitionDecoratorForAttribute, registerBeanDefinitionParser
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JmsNamespaceHandler

public JmsNamespaceHandler()
Method Detail

init

public void init()
Description copied from interface: NamespaceHandler
Invoked by the DefaultBeanDefinitionDocumentReader after construction but before any custom elements are parsed.

See Also:
NamespaceHandlerSupport.registerBeanDefinitionParser(String, BeanDefinitionParser)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jms.connection

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jms.connection

Provides a PlatformTransactionManager implementation for a single JMS ConnectionFactory, and a SingleConnectionFactory adapter.

See:
Description

Interface Summary
ConnectionFactoryUtils.ResourceFactory | Callback interface for resource creation.
SessionProxy | Subinterface of Session to be implemented by Session proxies.
SmartConnectionFactory | Extension of the javax.jms.ConnectionFactory interface, indicating how to release Connections obtained from it.

Class Summary
CachingConnectionFactory | SingleConnectionFactory subclass that adds Session caching as well MessageProducer caching.
ChainedExceptionListener | Implementation of the JMS ExceptionListener interface that supports chaining, allowing the addition of multiple ExceptionListener instances in order.
ConnectionFactoryUtils | Helper class for managing a JMS ConnectionFactory, in particular for obtaining transactional JMS resources for a given ConnectionFactory.
DelegatingConnectionFactory | ConnectionFactory implementation that delegates all calls to a given target ConnectionFactory, adapting specific create(Queue/Topic)Connection calls to the target ConnectionFactory if necessary (e.g.
JmsResourceHolder | JMS resource holder, wrapping a JMS Connection and a JMS Session.
JmsTransactionManager | PlatformTransactionManager implementation for a single JMS ConnectionFactory.
JmsTransactionManager102 | Deprecated. as of Spring 3.0, in favor of the JMS 1.1 based JmsTransactionManager
SingleConnectionFactory | A JMS ConnectionFactory adapter that returns the same Connection from all SingleConnectionFactory.createConnection() calls, and ignores calls to Connection.close().
SingleConnectionFactory102 | Deprecated. as of Spring 3.0, in favor of the JMS 1.1 based SingleConnectionFactory
TransactionAwareConnectionFactoryProxy | Proxy for a target JMS ConnectionFactory, adding awareness of Spring-managed transactions.
UserCredentialsConnectionFactoryAdapter | An adapter for a target JMS ConnectionFactory, applying the given user credentials to every standard createConnection() call, that is, implicitly invoking createConnection(username, password) on the target.

Exception Summary
SynchedLocalTransactionFailedException Exception thrown when a synchronized local transaction failed to complete (after the main transaction has already completed).

Package org.springframework.jms.connection Description

Provides a PlatformTransactionManager implementation for a single JMS ConnectionFactory, and a SingleConnectionFactory adapter.


org.springframework.jms.connection Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jms.connection

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.transaction.support.AbstractPlatformTransactionManager (implements org.springframework.transaction.PlatformTransactionManager, java.io.Serializable)
      • org.springframework.jms.connection.JmsTransactionManager (implements org.springframework.beans.factory.InitializingBean, org.springframework.transaction.support.ResourceTransactionManager)
        • org.springframework.jms.connection.JmsTransactionManager102
    • org.springframework.jms.connection.ChainedExceptionListener (implements javax.jms.ExceptionListener)
    • org.springframework.jms.connection.ConnectionFactoryUtils
    • org.springframework.jms.connection.DelegatingConnectionFactory (implements org.springframework.beans.factory.InitializingBean, javax.jms.QueueConnectionFactory, org.springframework.jms.connection.SmartConnectionFactory, javax.jms.TopicConnectionFactory)
    • org.springframework.transaction.support.ResourceHolderSupport (implements org.springframework.transaction.support.ResourceHolder)
      • org.springframework.jms.connection.JmsResourceHolder
    • org.springframework.jms.connection.SingleConnectionFactory (implements javax.jms.ConnectionFactory, org.springframework.beans.factory.DisposableBean, javax.jms.ExceptionListener, org.springframework.beans.factory.InitializingBean, javax.jms.QueueConnectionFactory, javax.jms.TopicConnectionFactory)
      • org.springframework.jms.connection.CachingConnectionFactory
      • org.springframework.jms.connection.SingleConnectionFactory102
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.jms.JmsException
              • org.springframework.jms.connection.SynchedLocalTransactionFailedException
    • org.springframework.jms.connection.TransactionAwareConnectionFactoryProxy (implements javax.jms.ConnectionFactory, javax.jms.QueueConnectionFactory, javax.jms.TopicConnectionFactory)
    • org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter (implements javax.jms.ConnectionFactory, org.springframework.beans.factory.InitializingBean, javax.jms.QueueConnectionFactory, javax.jms.TopicConnectionFactory)

Interface Hierarchy

  • javax.jms.ConnectionFactory
    • org.springframework.jms.connection.SmartConnectionFactory
  • org.springframework.jms.connection.ConnectionFactoryUtils.ResourceFactory
  • java.lang.Runnable
    • javax.jms.Session
      • org.springframework.jms.connection.SessionProxy


SessionProxy

org.springframework.jms.connection
Interface SessionProxy

All Superinterfaces:
Runnable, Session
public interface SessionProxy
extends Session

Subinterface of Session to be implemented by Session proxies. Allows access to the the underlying target Session.

Since:
2.0.4
Author:
Juergen Hoeller
See Also:
TransactionAwareConnectionFactoryProxy, CachingConnectionFactory, ConnectionFactoryUtils.getTargetSession(javax.jms.Session)

Field Summary
Fields inherited from interface javax.jms.Session
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED
Method Summary
 Session getTargetSession()
Return the target Session of this proxy.
Methods inherited from interface javax.jms.Session
close, commit, createBrowser, createBrowser, createBytesMessage, createConsumer, createConsumer, createConsumer, createDurableSubscriber, createDurableSubscriber, createMapMessage, createMessage, createObjectMessage, createObjectMessage, createProducer, createQueue, createStreamMessage, createTemporaryQueue, createTemporaryTopic, createTextMessage, createTextMessage, createTopic, getAcknowledgeMode, getMessageListener, getTransacted, recover, rollback, run, setMessageListener, unsubscribe

Method Detail

getTargetSession

Session getTargetSession()
Return the target Session of this proxy.

This will typically be the native provider Session or a wrapper from a session pool.

Returns:
the underlying Session (never null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SmartConnectionFactory

org.springframework.jms.connection
Interface SmartConnectionFactory

All Superinterfaces:
ConnectionFactory
All Known Implementing Classes:
DelegatingConnectionFactory
public interface SmartConnectionFactory
extends ConnectionFactory

Extension of the javax.jms.ConnectionFactory interface, indicating how to release Connections obtained from it.

Since:
2.0.2
Author:
Juergen Hoeller

Method Summary
 boolean shouldStop(Connection con)
Should we stop the Connection, obtained from this ConnectionFactory?
Methods inherited from interface javax.jms.ConnectionFactory
createConnection, createConnection

Method Detail

shouldStop

boolean shouldStop(Connection con)
Should we stop the Connection, obtained from this ConnectionFactory?

Parameters:
con - the Connection to check
Returns:
whether a stop call is necessary
See Also:
Connection.stop()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CachingConnectionFactory

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jms.connection
Class CachingConnectionFactory

java.lang.Object
    extended by  org.springframework.jms.connection.SingleConnectionFactory
        extended by  org.springframework.jms.connection.CachingConnectionFactory
All Implemented Interfaces:
ConnectionFactory, ExceptionListener, QueueConnectionFactory, TopicConnectionFactory, DisposableBean, InitializingBean
public class CachingConnectionFactory
extends SingleConnectionFactory

SingleConnectionFactory subclass that adds Session caching as well MessageProducer caching. This ConnectionFactory also switches the "reconnectOnException" property to "true" by default, allowing for automatic recovery of the underlying Connection.

By default, only one single Session will be cached, with further requested Sessions being created and disposed on demand. Consider raising the "sessionCacheSize" value in case of a high-concurrency environment.

NOTE: This ConnectionFactory decorator requires JMS 1.1 or higher. You may use it through the JMS 1.0.2 API; however, the target JMS driver needs to be compliant with JMS 1.1.

When using the JMS 1.0.2 API, this ConnectionFactory will switch into queue/topic mode according to the JMS API methods used at runtime: createQueueConnection and createTopicConnection will lead to queue/topic mode, respectively; generic createConnection calls will lead to a JMS 1.1 connection which is able to serve both modes.

NOTE: This ConnectionFactory requires explicit closing of all Sessions obtained from its shared Connection. This is the usual recommendation for native JMS access code anyway. However, with this ConnectionFactory, its use is mandatory in order to actually allow for Session reuse.

Note also that MessageConsumers obtained from a cached Session won't get closed until the Session will eventually be removed from the pool. This may lead to semantic side effects in some cases. For a durable subscriber, the logical Session.close() call will also close the subscription. Re-registering a durable consumer for the same subscription on the same Session handle is not supported; close and reobtain a cached Session first.

Since:
2.5.3
Author:
Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.jms.connection.SingleConnectionFactory
logger
Constructor Summary
CachingConnectionFactory()
Create a new CachingConnectionFactory for bean-style usage.
CachingConnectionFactory(ConnectionFactory targetConnectionFactory)
Create a new CachingConnectionFactory for the given target ConnectionFactory.
Method Summary
protected Session | getCachedSessionProxy(Session target, LinkedList<Session> sessionList) Wrap the given Session with a proxy that delegates every method call to it but adapts close calls.
protected Session | getSession(Connection con, Integer mode) Checks for a cached Session for the given mode.
int | getSessionCacheSize() Return the desired size for the JMS Session cache (per JMS Session type).
boolean | isCacheConsumers() Return whether to cache JMS MessageConsumers per JMS Session instance.
boolean | isCacheProducers() Return whether to cache JMS MessageProducers per JMS Session instance.
void | resetConnection() Resets the Session cache as well.
void | setCacheConsumers(boolean cacheConsumers) Specify whether to cache JMS MessageConsumers per JMS Session instance (more specifically: one MessageConsumer per Destination, selector String and Session).
void | setCacheProducers(boolean cacheProducers) Specify whether to cache JMS MessageProducers per JMS Session instance (more specifically: one MessageProducer per Destination and Session).
void | setSessionCacheSize(int sessionCacheSize) Specify the desired size for the JMS Session cache (per JMS Session type).
Methods inherited from class org.springframework.jms.connection.SingleConnectionFactory
afterPropertiesSet, closeConnection, createConnection, createConnection, createQueueConnection, createQueueConnection, createSession, createTopicConnection, createTopicConnection, destroy, doCreateConnection, getClientId, getExceptionListener, getSharedConnectionProxy, getTargetConnectionFactory, initConnection, isReconnectOnException, onException, prepareConnection, setClientId, setExceptionListener, setReconnectOnException, setTargetConnectionFactory
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CachingConnectionFactory

public CachingConnectionFactory()
Create a new CachingConnectionFactory for bean-style usage.

See Also:
SingleConnectionFactory.setTargetConnectionFactory(javax.jms.ConnectionFactory)

CachingConnectionFactory

public CachingConnectionFactory(ConnectionFactory targetConnectionFactory)
Create a new CachingConnectionFactory for the given target ConnectionFactory.

Parameters:
targetConnectionFactory - the target ConnectionFactory
Method Detail

setSessionCacheSize

public void setSessionCacheSize(int sessionCacheSize)
Specify the desired size for the JMS Session cache (per JMS Session type).

This cache size is the maximum limit for the number of cached Sessions per session acknowledgement type (auto, client, dups_ok, transacted). As a consequence, the actual number of cached Sessions may be up to four times as high as the specified value - in the unlikely case of mixing and matching different acknowledgement types.

Default is 1: caching a single Session, (re-)creating further ones on demand. Specify a number like 10 if you'd like to raise the number of cached Sessions; that said, 1 may be sufficient for low-concurrency scenarios.

See Also:
setCacheProducers(boolean)

getSessionCacheSize

public int getSessionCacheSize()
Return the desired size for the JMS Session cache (per JMS Session type).

setCacheProducers

public void setCacheProducers(boolean cacheProducers)
Specify whether to cache JMS MessageProducers per JMS Session instance (more specifically: one MessageProducer per Destination and Session).

Default is "true". Switch this to "false" in order to always recreate MessageProducers on demand.

isCacheProducers

public boolean isCacheProducers()
Return whether to cache JMS MessageProducers per JMS Session instance.

setCacheConsumers

public void setCacheConsumers(boolean cacheConsumers)
Specify whether to cache JMS MessageConsumers per JMS Session instance (more specifically: one MessageConsumer per Destination, selector String and Session). Note that durable subscribers will only be cached until logical closing of the Session handle.

Default is "true". Switch this to "false" in order to always recreate MessageConsumers on demand.

isCacheConsumers

public boolean isCacheConsumers()
Return whether to cache JMS MessageConsumers per JMS Session instance.

resetConnection

public void resetConnection()
Resets the Session cache as well.

Overrides:
resetConnection in class SingleConnectionFactory

getSession

protected Session getSession(Connection con,
                             Integer mode)
                      throws JMSException
Checks for a cached Session for the given mode.

Overrides:
getSession in class SingleConnectionFactory
Parameters:
con - the JMS Connection to operate on
mode - the Session acknowledgement mode (Session.TRANSACTED or one of the common modes)
Returns:
the Session to use, or null to indicate creation of a raw standard Session
Throws:
JMSException - if thrown by the JMS API

getCachedSessionProxy

protected Session getCachedSessionProxy(Session target,
                                        LinkedList<Session> sessionList)
Wrap the given Session with a proxy that delegates every method call to it but adapts close calls. This is useful for allowing application code to handle a special framework Session just like an ordinary Session.

Parameters:
target - the original Session to wrap
sessionList - the List of cached Sessions that the given Session belongs to
Returns:
the wrapped Session
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ChainedExceptionListener

org.springframework.jms.connection
Class ChainedExceptionListener

java.lang.Object
    extended by  org.springframework.jms.connection.ChainedExceptionListener
All Implemented Interfaces:
ExceptionListener
public class ChainedExceptionListener
extends Object
implements ExceptionListener

Implementation of the JMS ExceptionListener interface that supports chaining, allowing the addition of multiple ExceptionListener instances in order.

Since:
2.0
Author:
Juergen Hoeller

Constructor Summary
ChainedExceptionListener()
Method Summary
void | addDelegate(ExceptionListener listener) Add an ExceptionListener to the chained delegate list.
ExceptionListener[] | getDelegates() Return all registered ExceptionListener delegates (as array).
void | onException(JMSException ex)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ChainedExceptionListener

public ChainedExceptionListener()
Method Detail

addDelegate

public final void addDelegate(ExceptionListener listener)
Add an ExceptionListener to the chained delegate list.

getDelegates

public final ExceptionListener[] getDelegates()
Return all registered ExceptionListener delegates (as array).

onException

public void onException(JMSException ex)
Specified by:
onException in interface ExceptionListener
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConnectionFactoryUtils

org.springframework.jms.connection
Class ConnectionFactoryUtils

java.lang.Object
    extended by  org.springframework.jms.connection.ConnectionFactoryUtils

public abstract class ConnectionFactoryUtils
extends Object

Helper class for managing a JMS ConnectionFactory, in particular for obtaining transactional JMS resources for a given ConnectionFactory.

Mainly for internal use within the framework. Used by JmsTemplate as well as DefaultMessageListenerContainer.

Since:
2.0
Author:
Juergen Hoeller
See Also:
SmartConnectionFactory

Nested Class Summary
static interface ConnectionFactoryUtils.ResourceFactory
Callback interface for resource creation.
Constructor Summary
ConnectionFactoryUtils()
Method Summary
static Session | doGetTransactionalSession(ConnectionFactory connectionFactory, ConnectionFactoryUtils.ResourceFactory resourceFactory) Obtain a JMS Session that is synchronized with the current transaction, if any.
static Session | doGetTransactionalSession(ConnectionFactory connectionFactory, ConnectionFactoryUtils.ResourceFactory resourceFactory, boolean startConnection) Obtain a JMS Session that is synchronized with the current transaction, if any.
static Session | getTargetSession(Session session) Return the innermost target Session of the given Session.
static QueueSession | getTransactionalQueueSession(QueueConnectionFactory cf, QueueConnection existingCon, boolean synchedLocalTransactionAllowed) Obtain a JMS QueueSession that is synchronized with the current transaction, if any.
static Session | getTransactionalSession(ConnectionFactory cf, Connection existingCon, boolean synchedLocalTransactionAllowed) Obtain a JMS Session that is synchronized with the current transaction, if any.
static TopicSession | getTransactionalTopicSession(TopicConnectionFactory cf, TopicConnection existingCon, boolean synchedLocalTransactionAllowed) Obtain a JMS TopicSession that is synchronized with the current transaction, if any.
static boolean | isSessionTransactional(Session session, ConnectionFactory cf) Determine whether the given JMS Session is transactional, that is, bound to the current thread by Spring's transaction facilities.
static void | releaseConnection(Connection con, ConnectionFactory cf, boolean started) Release the given Connection, stopping it (if necessary) and eventually closing it.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ConnectionFactoryUtils

public ConnectionFactoryUtils()
Method Detail

releaseConnection

public static void releaseConnection(Connection con,
                                     ConnectionFactory cf,
                                     boolean started)
Release the given Connection, stopping it (if necessary) and eventually closing it.

Checks SmartConnectionFactory.shouldStop(javax.jms.Connection), if available. This is essentially a more sophisticated version of JmsUtils.closeConnection(javax.jms.Connection).

Parameters:
con - the Connection to release (if this is null, the call will be ignored)
cf - the ConnectionFactory that the Connection was obtained from (may be null)
started - whether the Connection might have been started by the application
See Also:
SmartConnectionFactory.shouldStop(javax.jms.Connection), JmsUtils.closeConnection(javax.jms.Connection)

getTargetSession

public static Session getTargetSession(Session session)
Return the innermost target Session of the given Session. If the given Session is a proxy, it will be unwrapped until a non-proxy Session is found. Otherwise, the passed-in Session will be returned as-is.

Parameters:
session - the Session proxy to unwrap
Returns:
the innermost target Session, or the passed-in one if no proxy
See Also:
SessionProxy.getTargetSession()

isSessionTransactional

public static boolean isSessionTransactional(Session session,
                                             ConnectionFactory cf)
Determine whether the given JMS Session is transactional, that is, bound to the current thread by Spring's transaction facilities.

Parameters:
session - the JMS Session to check
cf - the JMS ConnectionFactory that the Session originated from
Returns:
whether the Session is transactional

getTransactionalSession

public static Session getTransactionalSession(ConnectionFactory cf,
                                              Connection existingCon,
                                              boolean synchedLocalTransactionAllowed)
                                       throws JMSException
Obtain a JMS Session that is synchronized with the current transaction, if any.

Parameters:
cf - the ConnectionFactory to obtain a Session for
existingCon - the existing JMS Connection to obtain a Session for (may be null)
synchedLocalTransactionAllowed - whether to allow for a local JMS transaction that is synchronized with a Spring-managed transaction (where the main transaction might be a JDBC-based one for a specific DataSource, for example), with the JMS transaction committing right after the main transaction. If not allowed, the given ConnectionFactory needs to handle transaction enlistment underneath the covers.
Returns:
the transactional Session, or null if none found
Throws:
JMSException - in case of JMS failure

getTransactionalQueueSession

public static QueueSession getTransactionalQueueSession(QueueConnectionFactory cf,
                                                        QueueConnection existingCon,
                                                        boolean synchedLocalTransactionAllowed)
                                                 throws JMSException
Obtain a JMS QueueSession that is synchronized with the current transaction, if any.

Mainly intended for use with the JMS 1.0.2 API.

Parameters:
cf - the ConnectionFactory to obtain a Session for
existingCon - the existing JMS Connection to obtain a Session for (may be null)
synchedLocalTransactionAllowed - whether to allow for a local JMS transaction that is synchronized with a Spring-managed transaction (where the main transaction might be a JDBC-based one for a specific DataSource, for example), with the JMS transaction committing right after the main transaction. If not allowed, the given ConnectionFactory needs to handle transaction enlistment underneath the covers.
Returns:
the transactional Session, or null if none found
Throws:
JMSException - in case of JMS failure

getTransactionalTopicSession

public static TopicSession getTransactionalTopicSession(TopicConnectionFactory cf,
                                                        TopicConnection existingCon,
                                                        boolean synchedLocalTransactionAllowed)
                                                 throws JMSException
Obtain a JMS TopicSession that is synchronized with the current transaction, if any.

Mainly intended for use with the JMS 1.0.2 API.

Parameters:
cf - the ConnectionFactory to obtain a Session for
existingCon - the existing JMS Connection to obtain a Session for (may be null)
synchedLocalTransactionAllowed - whether to allow for a local JMS transaction that is synchronized with a Spring-managed transaction (where the main transaction might be a JDBC-based one for a specific DataSource, for example), with the JMS transaction committing right after the main transaction. If not allowed, the given ConnectionFactory needs to handle transaction enlistment underneath the covers.
Returns:
the transactional Session, or null if none found
Throws:
JMSException - in case of JMS failure

doGetTransactionalSession

public static Session doGetTransactionalSession(ConnectionFactory connectionFactory,
                                                ConnectionFactoryUtils.ResourceFactory resourceFactory)
                                         throws JMSException
Obtain a JMS Session that is synchronized with the current transaction, if any.

This doGetTransactionalSession variant always starts the underlying JMS Connection, assuming that the Session will be used for receiving messages.

Parameters:
connectionFactory - the JMS ConnectionFactory to bind for (used as TransactionSynchronizationManager key)
resourceFactory - the ResourceFactory to use for extracting or creating JMS resources
Returns:
the transactional Session, or null if none found
Throws:
JMSException - in case of JMS failure
See Also:
doGetTransactionalSession(javax.jms.ConnectionFactory, ResourceFactory, boolean)

doGetTransactionalSession

public static Session doGetTransactionalSession(ConnectionFactory connectionFactory,
                                                ConnectionFactoryUtils.ResourceFactory resourceFactory,
                                                boolean startConnection)
                                         throws JMSException
Obtain a JMS Session that is synchronized with the current transaction, if any.

Parameters:
connectionFactory - the JMS ConnectionFactory to bind for (used as TransactionSynchronizationManager key)
resourceFactory - the ResourceFactory to use for extracting or creating JMS resources
startConnection - whether the underlying JMS Connection approach should be started in order to allow for receiving messages. Note that a reused Connection may already have been started before, even if this flag is false.
Returns:
the transactional Session, or null if none found
Throws:
JMSException - in case of JMS failure
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConnectionFactoryUtils.ResourceFactory

org.springframework.jms.connection
Interface ConnectionFactoryUtils.ResourceFactory

Enclosing class:
ConnectionFactoryUtils
public static interface ConnectionFactoryUtils.ResourceFactory

Callback interface for resource creation. Serving as argument for the doGetTransactionalSession method.

Method Summary
Connection | createConnection() Create a new JMS Connection for registration with a JmsResourceHolder.
Session | createSession(Connection con) Create a new JMS Session for registration with a JmsResourceHolder.
Connection | getConnection(JmsResourceHolder holder) Fetch an appropriate Connection from the given JmsResourceHolder.
Session | getSession(JmsResourceHolder holder) Fetch an appropriate Session from the given JmsResourceHolder.
boolean | isSynchedLocalTransactionAllowed() Return whether to allow for a local JMS transaction that is synchronized with a Spring-managed transaction (where the main transaction might be a JDBC-based one for a specific DataSource, for example), with the JMS transaction committing right after the main transaction.

Method Detail

getSession

Session getSession(JmsResourceHolder holder)
Fetch an appropriate Session from the given JmsResourceHolder.

Parameters:
holder - the JmsResourceHolder
Returns:
an appropriate Session fetched from the holder, or null if none found

getConnection

Connection getConnection(JmsResourceHolder holder)
Fetch an appropriate Connection from the given JmsResourceHolder.

Parameters:
holder - the JmsResourceHolder
Returns:
an appropriate Connection fetched from the holder, or null if none found

createConnection

Connection createConnection()
                            throws JMSException
Create a new JMS Connection for registration with a JmsResourceHolder.

Returns:
the new JMS Connection
Throws:
JMSException - if thrown by JMS API methods

createSession

Session createSession(Connection con)
                      throws JMSException
Create a new JMS Session for registration with a JmsResourceHolder.

Parameters:
con - the JMS Connection to create a Session for
Returns:
the new JMS Session
Throws:
JMSException - if thrown by JMS API methods

isSynchedLocalTransactionAllowed

boolean isSynchedLocalTransactionAllowed()
Return whether to allow for a local JMS transaction that is synchronized with a Spring-managed transaction (where the main transaction might be a JDBC-based one for a specific DataSource, for example), with the JMS transaction committing right after the main transaction.

Returns:
whether to allow for synchronizing a local JMS transaction
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DelegatingConnectionFactory

org.springframework.jms.connection
Class DelegatingConnectionFactory

java.lang.Object
    extended by  org.springframework.jms.connection.DelegatingConnectionFactory
All Implemented Interfaces:
ConnectionFactory, QueueConnectionFactory, TopicConnectionFactory, InitializingBean, SmartConnectionFactory
public class DelegatingConnectionFactory
extends Object
implements SmartConnectionFactory, QueueConnectionFactory, TopicConnectionFactory, InitializingBean

ConnectionFactory implementation that delegates all calls to a given target ConnectionFactory, adapting specific create(Queue/Topic)Connection calls to the target ConnectionFactory if necessary (e.g. when running JMS 1.0.2 API based code against a generic JMS 1.1 ConnectionFactory, such as ActiveMQ's PooledConnectionFactory).

This class allows for being subclassed, with subclasses overriding only those methods (such as createConnection()) that should not simply delegate to the target ConnectionFactory.

Can also be defined as-is, wrapping a specific target ConnectionFactory, using the "shouldStopConnections" flag to indicate whether Connections obtained from the target factory are supposed to be stopped before closed. The latter may be necessary for some connection pools that simply return released connections to the pool, not stopping them while they sit in the pool.

Since:
2.0.2
Author:
Juergen Hoeller
See Also:
createConnection(), setShouldStopConnections(boolean), ConnectionFactoryUtils.releaseConnection(javax.jms.Connection, javax.jms.ConnectionFactory, boolean)

Constructor Summary
DelegatingConnectionFactory()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
Connection | createConnection()
Connection | createConnection(String username, String password)
QueueConnection | createQueueConnection()
QueueConnection | createQueueConnection(String username, String password)
TopicConnection | createTopicConnection()
TopicConnection | createTopicConnection(String username, String password)
ConnectionFactory | getTargetConnectionFactory() Return the target ConnectionFactory that this ConnectionFactory delegates to.
void | setShouldStopConnections(boolean shouldStopConnections) Indicate whether Connections obtained from the target factory are supposed to be stopped before closed ("true") or simply closed ("false").
void | setTargetConnectionFactory(ConnectionFactory targetConnectionFactory) Set the target ConnectionFactory that this ConnectionFactory should delegate to.
boolean | shouldStop(Connection con) Should we stop the Connection, obtained from this ConnectionFactory?
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DelegatingConnectionFactory

public DelegatingConnectionFactory()
Method Detail

setTargetConnectionFactory

public void setTargetConnectionFactory(ConnectionFactory targetConnectionFactory)
Set the target ConnectionFactory that this ConnectionFactory should delegate to.

getTargetConnectionFactory

public ConnectionFactory getTargetConnectionFactory()
Return the target ConnectionFactory that this ConnectionFactory delegates to.

setShouldStopConnections

public void setShouldStopConnections(boolean shouldStopConnections)
Indicate whether Connections obtained from the target factory are supposed to be stopped before closed ("true") or simply closed ("false"). The latter may be necessary for some connection pools that simply return released connections to the pool, not stopping them while they sit in the pool.

Default is "false", simply closing Connections.

See Also:
ConnectionFactoryUtils.releaseConnection(javax.jms.Connection, javax.jms.ConnectionFactory, boolean)

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

createConnection

public Connection createConnection()
                            throws JMSException
Specified by:
createConnection in interface ConnectionFactory
Throws:
JMSException

createConnection

public Connection createConnection(String username,
                                   String password)
                            throws JMSException
Specified by:
createConnection in interface ConnectionFactory
Throws:
JMSException

createQueueConnection

public QueueConnection createQueueConnection()
                                      throws JMSException
Specified by:
createQueueConnection in interface QueueConnectionFactory
Throws:
JMSException

createQueueConnection

public QueueConnection createQueueConnection(String username,
                                             String password)
                                      throws JMSException
Specified by:
createQueueConnection in interface QueueConnectionFactory
Throws:
JMSException

createTopicConnection

public TopicConnection createTopicConnection()
                                      throws JMSException
Specified by:
createTopicConnection in interface TopicConnectionFactory
Throws:
JMSException

createTopicConnection

public TopicConnection createTopicConnection(String username,
                                             String password)
                                      throws JMSException
Specified by:
createTopicConnection in interface TopicConnectionFactory
Throws:
JMSException

shouldStop

public boolean shouldStop(Connection con)
Description copied from interface: SmartConnectionFactory
Should we stop the Connection, obtained from this ConnectionFactory?

Specified by:
shouldStop in interface SmartConnectionFactory
Parameters:
con - the Connection to check
Returns:
whether a stop call is necessary
See Also:
Connection.stop()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JmsResourceHolder

org.springframework.jms.connection
Class JmsResourceHolder

java.lang.Object
    extended by  org.springframework.transaction.support.ResourceHolderSupport
        extended by  org.springframework.jms.connection.JmsResourceHolder
All Implemented Interfaces:
ResourceHolder
public class JmsResourceHolder
extends ResourceHolderSupport

JMS resource holder, wrapping a JMS Connection and a JMS Session. JmsTransactionManager binds instances of this class to the thread, for a given JMS ConnectionFactory.

Note: This is an SPI class, not intended to be used by applications.

Since:
1.1
Author:
Juergen Hoeller
See Also:
JmsTransactionManager, JmsTemplate

Constructor Summary
JmsResourceHolder()
Create a new JmsResourceHolder that is open for resources to be added.
JmsResourceHolder(ConnectionFactory connectionFactory)
Create a new JmsResourceHolder that is open for resources to be added.
JmsResourceHolder(ConnectionFactory connectionFactory, Connection connection, Session session)
Create a new JmsResourceHolder for the given JMS resources.
JmsResourceHolder(Connection connection, Session session)
Create a new JmsResourceHolder for the given JMS resources.
JmsResourceHolder(Session session)
Create a new JmsResourceHolder for the given JMS Session.
Method Summary
void | addConnection(Connection connection)
void | addSession(Session session)
void | addSession(Session session, Connection connection)
void | closeAll()
void | commitAll()
boolean | containsSession(Session session)
Connection | getConnection()
Connection | getConnection(Class<? extends Connection> connectionType)
Session | getSession()
Session | getSession(Class<? extends Session> sessionType)
Session | getSession(Class<? extends Session> sessionType, Connection connection)
boolean | isFrozen()
Methods inherited from class org.springframework.transaction.support.ResourceHolderSupport
clear, getDeadline, getTimeToLiveInMillis, getTimeToLiveInSeconds, hasTimeout, isOpen, isRollbackOnly, isSynchronizedWithTransaction, isVoid, released, requested, reset, setRollbackOnly, setSynchronizedWithTransaction, setTimeoutInMillis, setTimeoutInSeconds, unbound
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JmsResourceHolder

public JmsResourceHolder()
Create a new JmsResourceHolder that is open for resources to be added.

See Also:
addConnection(javax.jms.Connection), addSession(javax.jms.Session)

JmsResourceHolder

public JmsResourceHolder(ConnectionFactory connectionFactory)
Create a new JmsResourceHolder that is open for resources to be added.

Parameters:
connectionFactory - the JMS ConnectionFactory that this resource holder is associated with (may be null)

JmsResourceHolder

public JmsResourceHolder(Session session)
Create a new JmsResourceHolder for the given JMS Session.

Parameters:
session - the JMS Session

JmsResourceHolder

public JmsResourceHolder(Connection connection,
                         Session session)
Create a new JmsResourceHolder for the given JMS resources.

Parameters:
connection - the JMS Connection
session - the JMS Session

JmsResourceHolder

public JmsResourceHolder(ConnectionFactory connectionFactory,
                         Connection connection,
                         Session session)
Create a new JmsResourceHolder for the given JMS resources.

Parameters:
connectionFactory - the JMS ConnectionFactory that this resource holder is associated with (may be null)
connection - the JMS Connection
session - the JMS Session
Method Detail

isFrozen

public final boolean isFrozen()

addConnection

public final void addConnection(Connection connection)

addSession

public final void addSession(Session session)

addSession

public final void addSession(Session session,
                             Connection connection)

containsSession

public boolean containsSession(Session session)

getConnection

public Connection getConnection()

getConnection

public Connection getConnection(Class<? extends Connection> connectionType)

getSession

public Session getSession()

getSession

public Session getSession(Class<? extends Session> sessionType)

getSession

public Session getSession(Class<? extends Session> sessionType,
                          Connection connection)

commitAll

public void commitAll()
               throws JMSException
Throws:
JMSException

closeAll

public void closeAll()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JmsTransactionManager

org.springframework.jms.connection
Class JmsTransactionManager

java.lang.Object
    extended by  org.springframework.transaction.support.AbstractPlatformTransactionManager
        extended by  org.springframework.jms.connection.JmsTransactionManager
All Implemented Interfaces:
Serializable, InitializingBean, PlatformTransactionManager, ResourceTransactionManager
Direct Known Subclasses:
JmsTransactionManager102
public class JmsTransactionManager
extends AbstractPlatformTransactionManager
implements ResourceTransactionManager, InitializingBean

PlatformTransactionManager implementation for a single JMS ConnectionFactory. Binds a JMS Connection/Session pair from the specified ConnectionFactory to the thread, potentially allowing for one thread-bound Session per ConnectionFactory.

This local strategy is an alternative to executing JMS operations within JTA transactions. Its advantage is that it is able to work in any environment, for example a standalone application or a test suite, with any message broker as target. However, this strategy is not able to provide XA transactions, for example in order to share transactions between messaging and database access. A full JTA/XA setup is required for XA transactions, typically using Spring's JtaTransactionManager as strategy.

Application code is required to retrieve the transactional JMS Session via ConnectionFactoryUtils.getTransactionalSession(javax.jms.ConnectionFactory, javax.jms.Connection, boolean) instead of a standard J2EE-style ConnectionFactory.createConnection() call with subsequent Session creation. Spring's JmsTemplate will autodetect a thread-bound Session and automatically participate in it.

Alternatively, you can allow application code to work with the standard J2EE-style lookup pattern on a ConnectionFactory, for example for legacy code that is not aware of Spring at all. In that case, define a TransactionAwareConnectionFactoryProxy for your target ConnectionFactory, which will automatically participate in Spring-managed transactions.

The use of CachingConnectionFactory as a target for this transaction manager is strongly recommended. CachingConnectionFactory uses a single JMS Connection for all JMS access in order to avoid the overhead of repeated Connection creation, as well as maintaining a cache of Sessions. Each transaction will then share the same JMS Connection, while still using its own individual JMS Session.

The use of a raw target ConnectionFactory would not only be inefficient because of the lack of resource reuse. It might also lead to strange effects when your JMS driver doesn't accept MessageProducer.close() calls and/or MessageConsumer.close() calls before Session.commit(), with the latter supposed to commit all the messages that have been sent through the producer handle and received through the consumer handle. As a safe general solution, always pass in a CachingConnectionFactory into this transaction manager's "connectionFactory" property.

Transaction synchronization is turned off by default, as this manager might be used alongside a datastore-based Spring transaction manager such as the JDBC DataSourceTransactionManager, which has stronger needs for synchronization.

Since:
1.1
Author:
Juergen Hoeller
See Also:
ConnectionFactoryUtils.getTransactionalSession(javax.jms.ConnectionFactory, javax.jms.Connection, boolean), TransactionAwareConnectionFactoryProxy, JmsTemplate, Serialized Form

Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
AbstractPlatformTransactionManager.SuspendedResourcesHolder
Field Summary
Fields inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
logger, SYNCHRONIZATION_ALWAYS, SYNCHRONIZATION_NEVER, SYNCHRONIZATION_ON_ACTUAL_TRANSACTION
Constructor Summary
JmsTransactionManager()
Create a new JmsTransactionManager for bean-style usage.
JmsTransactionManager(ConnectionFactory connectionFactory)
Create a new JmsTransactionManager, given a ConnectionFactory.
Method Summary
void | afterPropertiesSet() Make sure the ConnectionFactory has been set.
protected Connection | createConnection() Create a JMS Connection via this template's ConnectionFactory.
protected Session | createSession(Connection con) Create a JMS Session for the given Connection.
protected void | doBegin(Object transaction, TransactionDefinition definition) Begin a new transaction with semantics according to the given transaction definition.
protected void | doCleanupAfterCompletion(Object transaction) Cleanup resources after transaction completion.
protected void | doCommit(DefaultTransactionStatus status) Perform an actual commit of the given transaction.
protected Object | doGetTransaction() Return a transaction object for the current transaction state.
protected void | doResume(Object transaction, Object suspendedResources) Resume the resources of the current transaction.
protected void | doRollback(DefaultTransactionStatus status) Perform an actual rollback of the given transaction.
protected void | doSetRollbackOnly(DefaultTransactionStatus status) Set the given transaction rollback-only.
protected Object | doSuspend(Object transaction) Suspend the resources of the current transaction.
ConnectionFactory | getConnectionFactory() Return the JMS ConnectionFactory that this instance should manage transactions for.
Object | getResourceFactory() Return the resource factory that this transaction manager operates on, e.g.
protected boolean | isExistingTransaction(Object transaction) Check if the given transaction object indicates an existing transaction (that is, a transaction which has already started).
void | setConnectionFactory(ConnectionFactory cf) Set the JMS ConnectionFactory that this instance should manage transactions for.
Methods inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
commit, determineTimeout, getDefaultTimeout, getTransaction, getTransactionSynchronization, invokeAfterCompletion, isFailEarlyOnGlobalRollbackOnly, isGlobalRollbackOnParticipationFailure, isNestedTransactionAllowed, isRollbackOnCommitFailure, isValidateExistingTransaction, newTransactionStatus, prepareForCommit, prepareSynchronization, prepareTransactionStatus, registerAfterCompletionWithExistingTransaction, resume, rollback, setDefaultTimeout, setFailEarlyOnGlobalRollbackOnly, setGlobalRollbackOnParticipationFailure, setNestedTransactionAllowed, setRollbackOnCommitFailure, setTransactionSynchronization, setTransactionSynchronizationName, setValidateExistingTransaction, shouldCommitOnGlobalRollbackOnly, suspend, triggerBeforeCommit, triggerBeforeCompletion, useSavepointForNestedTransaction
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.transaction.PlatformTransactionManager
commit, getTransaction, rollback

Constructor Detail

JmsTransactionManager

public JmsTransactionManager()
Create a new JmsTransactionManager for bean-style usage.

Note: The ConnectionFactory has to be set before using the instance. This constructor can be used to prepare a JmsTemplate via a BeanFactory, typically setting the ConnectionFactory via setConnectionFactory.

Turns off transaction synchronization by default, as this manager might be used alongside a datastore-based Spring transaction manager like DataSourceTransactionManager, which has stronger needs for synchronization. Only one manager is allowed to drive synchronization at any point of time.

See Also:
setConnectionFactory(javax.jms.ConnectionFactory), AbstractPlatformTransactionManager.setTransactionSynchronization(int)

JmsTransactionManager

public JmsTransactionManager(ConnectionFactory connectionFactory)
Create a new JmsTransactionManager, given a ConnectionFactory.

Parameters:
connectionFactory - the ConnectionFactory to obtain connections from
Method Detail

setConnectionFactory

public void setConnectionFactory(ConnectionFactory cf)
Set the JMS ConnectionFactory that this instance should manage transactions for.

getConnectionFactory

public ConnectionFactory getConnectionFactory()
Return the JMS ConnectionFactory that this instance should manage transactions for.

afterPropertiesSet

public void afterPropertiesSet()
Make sure the ConnectionFactory has been set.

Specified by:
afterPropertiesSet in interface InitializingBean

getResourceFactory

public Object getResourceFactory()
Description copied from interface: ResourceTransactionManager
Return the resource factory that this transaction manager operates on, e.g. a JDBC DataSource or a JMS ConnectionFactory.

This target resource factory is usually used as resource key for TransactionSynchronizationManager's resource bindings per thread.

Specified by:
getResourceFactory in interface ResourceTransactionManager
Returns:
the target resource factory (never null)
See Also:
TransactionSynchronizationManager.bindResource(java.lang.Object, java.lang.Object), TransactionSynchronizationManager.getResource(java.lang.Object)

doGetTransaction

protected Object doGetTransaction()
Description copied from class: AbstractPlatformTransactionManager
Return a transaction object for the current transaction state.

The returned object will usually be specific to the concrete transaction manager implementation, carrying corresponding transaction state in a modifiable fashion. This object will be passed into the other template methods (e.g. doBegin and doCommit), either directly or as part of a DefaultTransactionStatus instance.

The returned object should contain information about any existing transaction, that is, a transaction that has already started before the current getTransaction call on the transaction manager. Consequently, a doGetTransaction implementation will usually look for an existing transaction and store corresponding state in the returned transaction object.

Specified by:
doGetTransaction in class AbstractPlatformTransactionManager
Returns:
the current transaction object
See Also:
AbstractPlatformTransactionManager.doBegin(java.lang.Object, org.springframework.transaction.TransactionDefinition),
AbstractPlatformTransactionManager.doCommit(org.springframework.transaction.support.DefaultTransactionStatus),
AbstractPlatformTransactionManager.doRollback(org.springframework.transaction.support.DefaultTransactionStatus),
DefaultTransactionStatus.getTransaction()

isExistingTransaction

protected boolean isExistingTransaction(Object transaction)
Description copied from class: AbstractPlatformTransactionManager
Check if the given transaction object indicates an existing transaction (that is, a transaction which has already started).

The result will be evaluated according to the specified propagation behavior for the new transaction. An existing transaction might get suspended (in case of PROPAGATION_REQUIRES_NEW), or the new transaction might participate in the existing one (in case of PROPAGATION_REQUIRED).

The default implementation returns false, assuming that participating in existing transactions is generally not supported. Subclasses are of course encouraged to provide such support.

Overrides:
isExistingTransaction in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
Returns:
if there is an existing transaction
See Also:
AbstractPlatformTransactionManager.doGetTransaction()

doBegin

protected void doBegin(Object transaction,
                       TransactionDefinition definition)
Description copied from class: AbstractPlatformTransactionManager
Begin a new transaction with semantics according to the given transaction definition. Does not have to care about applying the propagation behavior, as this has already been handled by this abstract manager.

This method gets called when the transaction manager has decided to actually start a new transaction. Either there wasn't any transaction before, or the previous transaction has been suspended.

A special scenario is a nested transaction without savepoint: If useSavepointForNestedTransaction() returns "false", this method will be called to start a nested transaction when necessary. In such a context, there will be an active transaction: The implementation of this method has to detect this and start an appropriate nested transaction.

Specified by:
doBegin in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
definition - TransactionDefinition instance, describing propagation behavior, isolation level, read-only flag, timeout, and transaction name

doSuspend

protected Object doSuspend(Object transaction)
Description copied from class: AbstractPlatformTransactionManager
Suspend the resources of the current transaction. Transaction synchronization will already have been suspended.

The default implementation throws a TransactionSuspensionNotSupportedException, assuming that transaction suspension is generally not supported.

Overrides:
doSuspend in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
Returns:
an object that holds suspended resources (will be kept unexamined for passing it into doResume)
See Also:
AbstractPlatformTransactionManager.doResume(java.lang.Object, java.lang.Object)

doResume

protected void doResume(Object transaction,
                        Object suspendedResources)
Description copied from class: AbstractPlatformTransactionManager
Resume the resources of the current transaction. Transaction synchronization will be resumed afterwards.

The default implementation throws a TransactionSuspensionNotSupportedException, assuming that transaction suspension is generally not supported.

Overrides:
doResume in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
suspendedResources - the object that holds suspended resources, as returned by doSuspend
See Also:
AbstractPlatformTransactionManager.doSuspend(java.lang.Object)

doCommit

protected void doCommit(DefaultTransactionStatus status)
Description copied from class: AbstractPlatformTransactionManager
Perform an actual commit of the given transaction.

An implementation does not need to check the "new transaction" flag or the rollback-only flag; this will already have been handled before. Usually, a straight commit will be performed on the transaction object contained in the passed-in status.

Specified by:
doCommit in class AbstractPlatformTransactionManager
Parameters:
status - the status representation of the transaction
See Also:
DefaultTransactionStatus.getTransaction()

doRollback

protected void doRollback(DefaultTransactionStatus status)
Description copied from class: AbstractPlatformTransactionManager
Perform an actual rollback of the given transaction.

An implementation does not need to check the "new transaction" flag; this will already have been handled before. Usually, a straight rollback will be performed on the transaction object contained in the passed-in status.

Specified by:
doRollback in class AbstractPlatformTransactionManager
Parameters:
status - the status representation of the transaction
See Also:
DefaultTransactionStatus.getTransaction()

doSetRollbackOnly

protected void doSetRollbackOnly(DefaultTransactionStatus status)
Description copied from class: AbstractPlatformTransactionManager
Set the given transaction rollback-only. Only called on rollback if the current transaction participates in an existing one.

The default implementation throws an IllegalTransactionStateException, assuming that participating in existing transactions is generally not supported. Subclasses are of course encouraged to provide such support.

Overrides:
doSetRollbackOnly in class AbstractPlatformTransactionManager
Parameters:
status - the status representation of the transaction

doCleanupAfterCompletion

protected void doCleanupAfterCompletion(Object transaction)
Description copied from class: AbstractPlatformTransactionManager
Cleanup resources after transaction completion.

Called after doCommit and doRollback execution, on any outcome. The default implementation does nothing.

Should not throw any exceptions but just issue warnings on errors.

Overrides:
doCleanupAfterCompletion in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction

createConnection

protected Connection createConnection()
                               throws JMSException
Create a JMS Connection via this template's ConnectionFactory.

This implementation uses JMS 1.1 API.

Returns:
the new JMS Connection
Throws:
JMSException - if thrown by JMS API methods

createSession

protected Session createSession(Connection con)
                         throws JMSException
Create a JMS Session for the given Connection.

This implementation uses JMS 1.1 API.

Parameters:
con - the JMS Connection to create a Session for
Returns:
the new JMS Session
Throws:
JMSException - if thrown by JMS API methods
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JmsTransactionManager102

org.springframework.jms.connection
Class JmsTransactionManager102

java.lang.Object
    extended by  org.springframework.transaction.support.AbstractPlatformTransactionManager
        extended by  org.springframework.jms.connection.JmsTransactionManager
            extended by  org.springframework.jms.connection.JmsTransactionManager102
All Implemented Interfaces:
Serializable, InitializingBean, PlatformTransactionManager, ResourceTransactionManager
Deprecated. as of Spring 3.0, in favor of the JMS 1.1 based JmsTransactionManager

@Deprecated
public class JmsTransactionManager102
extends JmsTransactionManager

A subclass of JmsTransactionManager for the JMS 1.0.2 specification, not relying on JMS 1.1 methods like JmsTransactionManager itself. This class can be used for JMS 1.0.2 providers, offering the same API as JmsTransactionManager does for JMS 1.1 providers.

You need to set the "pubSubDomain" property, since this class will always explicitly differentiate between a QueueConnection and a TopicConnection.

Since:
1.1
Author:
Juergen Hoeller
See Also:
JmsTransactionManager.setConnectionFactory(javax.jms.ConnectionFactory), setPubSubDomain(boolean), Serialized Form

Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
AbstractPlatformTransactionManager.SuspendedResourcesHolder
Field Summary
Fields inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
logger, SYNCHRONIZATION_ALWAYS, SYNCHRONIZATION_NEVER, SYNCHRONIZATION_ON_ACTUAL_TRANSACTION
Constructor Summary
JmsTransactionManager102()
Deprecated. Create a new JmsTransactionManager102 for bean-style usage.
JmsTransactionManager102(ConnectionFactory connectionFactory, boolean pubSubDomain)
Deprecated. Create a new JmsTransactionManager102, given a ConnectionFactory.
Method Summary
void | afterPropertiesSet() Deprecated. In addition to checking if the connection factory is set, make sure that the supplied connection factory is of the appropriate type for the specified destination type: QueueConnectionFactory for queues, and TopicConnectionFactory for topics.
protected Connection | createConnection() Deprecated. This implementation overrides the superclass method to use JMS 1.0.2 API.
protected Session | createSession(Connection con) Deprecated. This implementation overrides the superclass method to use JMS 1.0.2 API.
boolean | isPubSubDomain() Deprecated. Return whether the Publish/Subscribe domain (Topics) is used.
void | setPubSubDomain(boolean pubSubDomain) Deprecated. Configure the transaction manager with knowledge of the JMS domain used.
Methods inherited from class org.springframework.jms.connection.JmsTransactionManager
doBegin, doCleanupAfterCompletion, doCommit, doGetTransaction, doResume, doRollback, doSetRollbackOnly, doSuspend, getConnectionFactory, getResourceFactory, isExistingTransaction, setConnectionFactory
Methods inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
commit, determineTimeout, getDefaultTimeout, getTransaction, getTransactionSynchronization, invokeAfterCompletion, isFailEarlyOnGlobalRollbackOnly, isGlobalRollbackOnParticipationFailure, isNestedTransactionAllowed, isRollbackOnCommitFailure, isValidateExistingTransaction, newTransactionStatus, prepareForCommit, prepareSynchronization, prepareTransactionStatus, registerAfterCompletionWithExistingTransaction, resume, rollback, setDefaultTimeout, setFailEarlyOnGlobalRollbackOnly, setGlobalRollbackOnParticipationFailure, setNestedTransactionAllowed, setRollbackOnCommitFailure, setTransactionSynchronization, setTransactionSynchronizationName, setValidateExistingTransaction, shouldCommitOnGlobalRollbackOnly, suspend, triggerBeforeCommit, triggerBeforeCompletion, useSavepointForNestedTransaction
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.transaction.PlatformTransactionManager
commit, getTransaction, rollback

Constructor Detail

JmsTransactionManager102

public JmsTransactionManager102()
Deprecated.
Create a new JmsTransactionManager102 for bean-style usage.

Note: The ConnectionFactory has to be set before using the instance. This constructor can be used to prepare a JmsTemplate via a BeanFactory, typically setting the ConnectionFactory via setConnectionFactory.

See Also:
JmsTransactionManager.setConnectionFactory(javax.jms.ConnectionFactory)

JmsTransactionManager102

public JmsTransactionManager102(ConnectionFactory connectionFactory,
                                boolean pubSubDomain)
Deprecated.
Create a new JmsTransactionManager102, given a ConnectionFactory.

Parameters:
connectionFactory - the ConnectionFactory to manage transactions for
pubSubDomain - whether the Publish/Subscribe domain (Topics) or Point-to-Point domain (Queues) should be used
See Also:
setPubSubDomain(boolean)
Method Detail

setPubSubDomain

public void setPubSubDomain(boolean pubSubDomain)
Deprecated.
Configure the transaction manager with knowledge of the JMS domain used. This tells the JMS 1.0.2 provider which class hierarchy to use for creating Connections and Sessions.

Default is Point-to-Point (Queues).

Parameters:
pubSubDomain - true for Publish/Subscribe domain (Topics), false for Point-to-Point domain (Queues)

isPubSubDomain

public boolean isPubSubDomain()
Deprecated.
Return whether the Publish/Subscribe domain (Topics) is used. Otherwise, the Point-to-Point domain (Queues) is used.

afterPropertiesSet

public void afterPropertiesSet()
Deprecated.
In addition to checking if the connection factory is set, make sure that the supplied connection factory is of the appropriate type for the specified destination type: QueueConnectionFactory for queues, and TopicConnectionFactory for topics.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class JmsTransactionManager

createConnection

protected Connection createConnection()
                               throws JMSException
Deprecated.
This implementation overrides the superclass method to use JMS 1.0.2 API.

Overrides:
createConnection in class JmsTransactionManager
Returns:
the new JMS Connection
Throws:
JMSException - if thrown by JMS API methods

createSession

protected Session createSession(Connection con)
                         throws JMSException
Deprecated.
This implementation overrides the superclass method to use JMS 1.0.2 API.

Overrides:
createSession in class JmsTransactionManager
Parameters:
con - the JMS Connection to create a Session for
Returns:
the new JMS Session
Throws:
JMSException - if thrown by JMS API methods
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SingleConnectionFactory

org.springframework.jms.connection
Class SingleConnectionFactory

java.lang.Object
    extended by  org.springframework.jms.connection.SingleConnectionFactory
All Implemented Interfaces:
ConnectionFactory, ExceptionListener, QueueConnectionFactory, TopicConnectionFactory, DisposableBean, InitializingBean
Direct Known Subclasses:
CachingConnectionFactory, SingleConnectionFactory102
public class SingleConnectionFactory
extends Object
implements ConnectionFactory, QueueConnectionFactory, TopicConnectionFactory, ExceptionListener, InitializingBean, DisposableBean

A JMS ConnectionFactory adapter that returns the same Connection from all createConnection() calls, and ignores calls to Connection.close(). According to the JMS Connection model, this is perfectly thread-safe (in contrast to e.g. JDBC). The shared Connection can be automatically recovered in case of an Exception.

You can either pass in a specific JMS Connection directly or let this factory lazily create a Connection via a given target ConnectionFactory. This factory generally works with JMS 1.1 as well as the JMS 1.0.2 API.

Note that when using the JMS 1.0.2 API, this ConnectionFactory will switch into queue/topic mode according to the JMS API methods used at runtime: createQueueConnection and createTopicConnection will lead to queue/topic mode, respectively; generic createConnection calls will lead to a JMS 1.1 connection which is able to serve both modes.

Useful for testing and standalone environments in order to keep using the same Connection for multiple JmsTemplate calls, without having a pooling ConnectionFactory underneath. This may span any number of transactions, even concurrently executing transactions.

Note that Spring's message listener containers support the use of a shared Connection within each listener container instance. Using SingleConnectionFactory in combination only really makes sense for sharing a single JMS Connection across multiple listener containers.

Since:
1.1
Author:
Juergen Hoeller, Mark Pollack
See Also:
JmsTemplate, SimpleMessageListenerContainer, DefaultMessageListenerContainer.setCacheLevel(int)

Field Summary
protected  Log logger
Constructor Summary
SingleConnectionFactory()
Create a new SingleConnectionFactory for bean-style usage.
SingleConnectionFactory(Connection target)
Create a new SingleConnectionFactory that always returns the given Connection.
SingleConnectionFactory(ConnectionFactory targetConnectionFactory)
Create a new SingleConnectionFactory that always returns a single Connection that it will lazily create via the given target ConnectionFactory.
Method Summary
void | afterPropertiesSet() Make sure a Connection or ConnectionFactory has been set.
protected void | closeConnection(Connection con) Close the given Connection.
Connection | createConnection()
Connection | createConnection(String username, String password)
QueueConnection | createQueueConnection()
QueueConnection | createQueueConnection(String username, String password)
protected Session | createSession(Connection con, Integer mode) Create a default Session for this ConnectionFactory, adaptign to JMS 1.0.2 style queue/topic mode if necessary.
TopicConnection | createTopicConnection()
TopicConnection | createTopicConnection(String username, String password)
void | destroy() Close the underlying shared connection.
protected Connection | doCreateConnection() Create a JMS Connection via this template's ConnectionFactory.
protected String | getClientId() Return a JMS client ID for the single Connection created and exposed by this ConnectionFactory, if any.
protected ExceptionListener | getExceptionListener() Return the JMS ExceptionListener implementation that should be registered with with the single Connection created by this factory, if any.
protected Session | getSession(Connection con, Integer mode) Template method for obtaining a (potentially cached) Session.
protected Connection | getSharedConnectionProxy(Connection target) Wrap the given Connection with a proxy that delegates every method call to it but suppresses close calls.
ConnectionFactory | getTargetConnectionFactory() Return the target ConnectionFactory which will be used to lazily create a single Connection, if any.
void | initConnection() Initialize the underlying shared Connection.
protected boolean | isReconnectOnException() Return whether the single Connection should be renewed when a JMSException is reported by the underlying Connection.
void | onException(JMSException ex) Exception listener callback that renews the underlying single Connection.
protected void | prepareConnection(Connection con) Prepare the given Connection before it is exposed.
void | resetConnection() Reset the underlying shared Connection, to be reinitialized on next access.
void | setClientId(String clientId) Specify a JMS client ID for the single Connection created and exposed by this ConnectionFactory.
void | setExceptionListener(ExceptionListener exceptionListener) Specify an JMS ExceptionListener implementation that should be registered with with the single Connection created by this factory.
void | setReconnectOnException(boolean reconnectOnException) Specify whether the single Connection should be reset (to be subsequently renewed) when a JMSException is reported by the underlying Connection.
void | setTargetConnectionFactory(ConnectionFactory targetConnectionFactory) Set the target ConnectionFactory which will be used to lazily create a single Connection.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Constructor Detail

SingleConnectionFactory

public SingleConnectionFactory()
Create a new SingleConnectionFactory for bean-style usage.

See Also:
setTargetConnectionFactory(javax.jms.ConnectionFactory)

SingleConnectionFactory

public SingleConnectionFactory(Connection target)
Create a new SingleConnectionFactory that always returns the given Connection.

Parameters:
target - the single Connection

SingleConnectionFactory

public SingleConnectionFactory(ConnectionFactory targetConnectionFactory)
Create a new SingleConnectionFactory that always returns a single Connection that it will lazily create via the given target ConnectionFactory.

Parameters:
targetConnectionFactory - the target ConnectionFactory
Method Detail

setTargetConnectionFactory

public void setTargetConnectionFactory(ConnectionFactory targetConnectionFactory)
Set the target ConnectionFactory which will be used to lazily create a single Connection.

getTargetConnectionFactory

public ConnectionFactory getTargetConnectionFactory()
Return the target ConnectionFactory which will be used to lazily create a single Connection, if any.

setClientId

public void setClientId(String clientId)
Specify a JMS client ID for the single Connection created and exposed by this ConnectionFactory.

Note that client IDs need to be unique among all active Connections of the underlying JMS provider. Furthermore, a client ID can only be assigned if the original ConnectionFactory hasn't already assigned one.

See Also:
Connection.setClientID(java.lang.String), setTargetConnectionFactory(javax.jms.ConnectionFactory)

getClientId

protected String getClientId()
Return a JMS client ID for the single Connection created and exposed by this ConnectionFactory, if any.

setExceptionListener

public void setExceptionListener(ExceptionListener exceptionListener)
Specify an JMS ExceptionListener implementation that should be registered with with the single Connection created by this factory.

See Also:
setReconnectOnException(boolean)

getExceptionListener

protected ExceptionListener getExceptionListener()
Return the JMS ExceptionListener implementation that should be registered with with the single Connection created by this factory, if any.

setReconnectOnException

public void setReconnectOnException(boolean reconnectOnException)
Specify whether the single Connection should be reset (to be subsequently renewed) when a JMSException is reported by the underlying Connection.

Default is "false". Switch this to "true" to automatically trigger recovery based on your JMS provider's exception notifications.

Internally, this will lead to a special JMS ExceptionListener (this SingleConnectionFactory itself) being registered with the underlying Connection. This can also be combined with a user-specified ExceptionListener, if desired.

See Also:
setExceptionListener(javax.jms.ExceptionListener)

isReconnectOnException

protected boolean isReconnectOnException()
Return whether the single Connection should be renewed when a JMSException is reported by the underlying Connection.

afterPropertiesSet

public void afterPropertiesSet()
Make sure a Connection or ConnectionFactory has been set.

Specified by:
afterPropertiesSet in interface InitializingBean

createConnection

public Connection createConnection()
                            throws JMSException
Specified by:
createConnection in interface ConnectionFactory
Throws:
JMSException

createConnection

public Connection createConnection(String username,
                                   String password)
                            throws JMSException
Specified by:
createConnection in interface ConnectionFactory
Throws:
JMSException

createQueueConnection

public QueueConnection createQueueConnection()
                                      throws JMSException
Specified by:
createQueueConnection in interface QueueConnectionFactory
Throws:
JMSException

createQueueConnection

public QueueConnection createQueueConnection(String username,
                                             String password)
                                      throws JMSException
Specified by:
createQueueConnection in interface QueueConnectionFactory
Throws:
JMSException

createTopicConnection

public TopicConnection createTopicConnection()
                                      throws JMSException
Specified by:
createTopicConnection in interface TopicConnectionFactory
Throws:
JMSException

createTopicConnection

public TopicConnection createTopicConnection(String username,
                                             String password)
                                      throws JMSException
Specified by:
createTopicConnection in interface TopicConnectionFactory
Throws:
JMSException

initConnection

public void initConnection()
                    throws JMSException
Initialize the underlying shared Connection.

Closes and reinitializes the Connection if an underlying Connection is present already.

Throws:
JMSException - if thrown by JMS API methods

onException

public void onException(JMSException ex)
Exception listener callback that renews the underlying single Connection.

Specified by:
onException in interface ExceptionListener

destroy

public void destroy()
Close the underlying shared connection. The provider of this ConnectionFactory needs to care for proper shutdown.

As this bean implements DisposableBean, a bean factory will automatically invoke this on destruction of its cached singletons.

Specified by:
destroy in interface DisposableBean

resetConnection

public void resetConnection()
Reset the underlying shared Connection, to be reinitialized on next access.

doCreateConnection

protected Connection doCreateConnection()
                                 throws JMSException
Create a JMS Connection via this template's ConnectionFactory.

Returns:
the new JMS Connection
Throws:
JMSException - if thrown by JMS API methods

prepareConnection

protected void prepareConnection(Connection con)
                          throws JMSException
Prepare the given Connection before it is exposed.

The default implementation applies ExceptionListener and client id. Can be overridden in subclasses.

Parameters:
con - the Connection to prepare
Throws:
JMSException - if thrown by JMS API methods
See Also:
setExceptionListener(javax.jms.ExceptionListener), setReconnectOnException(boolean)

getSession

protected Session getSession(Connection con,
                             Integer mode)
                      throws JMSException
Template method for obtaining a (potentially cached) Session.

The default implementation always returns null. Subclasses may override this for exposing specific Session handles, possibly delegating to createSession(javax.jms.Connection, java.lang.Integer) for the creation of raw Session objects that will then get wrapped and returned from here.

Parameters:
con - the JMS Connection to operate on
mode - the Session acknowledgement mode (Session.TRANSACTED or one of the common modes)
Returns:
the Session to use, or null to indicate creation of a raw standard Session
Throws:
JMSException - if thrown by the JMS API

createSession

protected Session createSession(Connection con,
                                Integer mode)
                         throws JMSException
Create a default Session for this ConnectionFactory, adaptign to JMS 1.0.2 style queue/topic mode if necessary.

Parameters:
con - the JMS Connection to operate on
mode - the Session acknowledgement mode (Session.TRANSACTED or one of the common modes)
Returns:
the newly created Session
Throws:
JMSException - if thrown by the JMS API

closeConnection

protected void closeConnection(Connection con)
Close the given Connection.

Parameters:
con - the Connection to close

getSharedConnectionProxy

protected Connection getSharedConnectionProxy(Connection target)
Wrap the given Connection with a proxy that delegates every method call to it but suppresses close calls. This is useful for allowing application code to handle a special framework Connection just like an ordinary Connection from a JMS ConnectionFactory.

Parameters:
target - the original Connection to wrap
Returns:
the wrapped Connection
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SingleConnectionFactory102

org.springframework.jms.connection
Class SingleConnectionFactory102

java.lang.Object
    extended by  org.springframework.jms.connection.SingleConnectionFactory
        extended by  org.springframework.jms.connection.SingleConnectionFactory102
All Implemented Interfaces:
ConnectionFactory, ExceptionListener, QueueConnectionFactory, TopicConnectionFactory, DisposableBean, InitializingBean
Deprecated. as of Spring 3.0, in favor of the JMS 1.1 based SingleConnectionFactory

@Deprecated
public class SingleConnectionFactory102
extends SingleConnectionFactory

A subclass of SingleConnectionFactory for the JMS 1.0.2 specification, not relying on JMS 1.1 methods like SingleConnectionFactory itself. This class can be used for JMS 1.0.2 providers, offering the same API as SingleConnectionFactory does for JMS 1.1 providers.

You need to set the "pubSubDomain" property, since this class will always explicitly differentiate between a QueueConnection and a TopicConnection.

Since:
1.1
Author:
Juergen Hoeller
See Also:
SingleConnectionFactory.setTargetConnectionFactory(javax.jms.ConnectionFactory), setPubSubDomain(boolean)

Field Summary
Fields inherited from class org.springframework.jms.connection.SingleConnectionFactory
logger
Constructor Summary
SingleConnectionFactory102()
Deprecated. Create a new SingleConnectionFactory102 for bean-style usage.
SingleConnectionFactory102(ConnectionFactory connectionFactory, boolean pubSubDomain)
Deprecated. Create a new SingleConnectionFactory102 that always returns a single Connection that it will lazily create via the given target ConnectionFactory.
Method Summary
void | afterPropertiesSet() Deprecated. In addition to checking whether the target ConnectionFactory is set, make sure that the supplied factory is of the appropriate type for the specified destination type: QueueConnectionFactory for queues, TopicConnectionFactory for topics.
protected Connection | doCreateConnection() Deprecated. This implementation overrides the superclass method to use JMS 1.0.2 API.
boolean | isPubSubDomain() Deprecated. Return whether the Publish/Subscribe domain (Topics) is used.
void | setPubSubDomain(boolean pubSubDomain) Deprecated. Configure the factory with knowledge of the JMS domain used.
Methods inherited from class org.springframework.jms.connection.SingleConnectionFactory
closeConnection, createConnection, createConnection, createQueueConnection, createQueueConnection, createSession, createTopicConnection, createTopicConnection, destroy, getClientId, getExceptionListener, getSession, getSharedConnectionProxy, getTargetConnectionFactory, initConnection, isReconnectOnException, onException, prepareConnection, resetConnection, setClientId, setExceptionListener, setReconnectOnException, setTargetConnectionFactory
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SingleConnectionFactory102

public SingleConnectionFactory102()
Deprecated.
Create a new SingleConnectionFactory102 for bean-style usage.

SingleConnectionFactory102

public SingleConnectionFactory102(ConnectionFactory connectionFactory,
                                  boolean pubSubDomain)
Deprecated.
Create a new SingleConnectionFactory102 that always returns a single Connection that it will lazily create via the given target ConnectionFactory.

Parameters:
connectionFactory - the target ConnectionFactory
pubSubDomain - whether the Publish/Subscribe domain (Topics) or Point-to-Point domain (Queues) should be used
Method Detail

setPubSubDomain

public void setPubSubDomain(boolean pubSubDomain)
Deprecated.
Configure the factory with knowledge of the JMS domain used. This tells the JMS 1.0.2 provider which class hierarchy to use for creating Connections and Sessions.

Default is Point-to-Point (Queues).

Parameters:
pubSubDomain - true for Publish/Subscribe domain (Topics), false for Point-to-Point domain (Queues)

isPubSubDomain

public boolean isPubSubDomain()
Deprecated.
Return whether the Publish/Subscribe domain (Topics) is used. Otherwise, the Point-to-Point domain (Queues) is used.

afterPropertiesSet

public void afterPropertiesSet()
Deprecated.
In addition to checking whether the target ConnectionFactory is set, make sure that the supplied factory is of the appropriate type for the specified destination type: QueueConnectionFactory for queues, TopicConnectionFactory for topics.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class SingleConnectionFactory

doCreateConnection

protected Connection doCreateConnection()
                                 throws JMSException
Deprecated.
This implementation overrides the superclass method to use JMS 1.0.2 API.

Overrides:
doCreateConnection in class SingleConnectionFactory
Returns:
the new JMS Connection
Throws:
JMSException - if thrown by JMS API methods
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionAwareConnectionFactoryProxy

org.springframework.jms.connection
Class TransactionAwareConnectionFactoryProxy

java.lang.Object
    extended by  org.springframework.jms.connection.TransactionAwareConnectionFactoryProxy
All Implemented Interfaces:
ConnectionFactory, QueueConnectionFactory, TopicConnectionFactory
public class TransactionAwareConnectionFactoryProxy
extends Object
implements ConnectionFactory, QueueConnectionFactory, TopicConnectionFactory

Proxy for a target JMS ConnectionFactory, adding awareness of Spring-managed transactions. Similar to a transactional JNDI ConnectionFactory as provided by a J2EE server.

Messaging code which should remain unaware of Spring's JMS support can work with this proxy to seamlessly participate in Spring-managed transactions. Note that the transaction manager, for example JmsTransactionManager, still needs to work with the underlying ConnectionFactory, not with this proxy.

Make sure that TransactionAwareConnectionFactoryProxy is the outermost ConnectionFactory of a chain of ConnectionFactory proxies/adapters. TransactionAwareConnectionFactoryProxy can delegate either directly to the target factory or to some intermediary adapter like UserCredentialsConnectionFactoryAdapter.

Delegates to ConnectionFactoryUtils for automatically participating in thread-bound transactions, for example managed by JmsTransactionManager. createSession calls and close calls on returned Sessions will behave properly within a transaction, that is, always work on the transactional Session. If not within a transaction, normal ConnectionFactory behavior applies.

Note that transactional JMS Sessions will be registered on a per-Connection basis. To share the same JMS Session across a transaction, make sure that you operate on the same JMS Connection handle - either through reusing the handle or through configuring a SingleConnectionFactory underneath.

Returned transactional Session proxies will implement the SessionProxy interface to allow for access to the underlying target Session. This is only intended for accessing vendor-specific Session API or for testing purposes (e.g. to perform manual transaction control). For typical application purposes, simply use the standard JMS Session interface.

Since:
2.0
Author:
Juergen Hoeller
See Also:
UserCredentialsConnectionFactoryAdapter, SingleConnectionFactory

Constructor Summary
TransactionAwareConnectionFactoryProxy()
Create a new TransactionAwareConnectionFactoryProxy.
TransactionAwareConnectionFactoryProxy(ConnectionFactory targetConnectionFactory)
Create a new TransactionAwareConnectionFactoryProxy.
Method Summary
Connection | createConnection()
Connection | createConnection(String username, String password)
QueueConnection | createQueueConnection()
QueueConnection | createQueueConnection(String username, String password)
TopicConnection | createTopicConnection()
TopicConnection | createTopicConnection(String username, String password)
protected ConnectionFactory | getTargetConnectionFactory() Return the target ConnectionFactory that this ConnectionFactory should delegate to.
protected Connection | getTransactionAwareConnectionProxy(Connection target) Wrap the given Connection with a proxy that delegates every method call to it but handles Session lookup in a transaction-aware fashion.
protected boolean | isSynchedLocalTransactionAllowed() Return whether to allow for a local JMS transaction that is synchronized with a Spring-managed transaction.
void | setSynchedLocalTransactionAllowed(boolean synchedLocalTransactionAllowed) Set whether to allow for a local JMS transaction that is synchronized with a Spring-managed transaction (where the main transaction might be a JDBC-based one for a specific DataSource, for example), with the JMS transaction committing right after the main transaction.
void | setTargetConnectionFactory(ConnectionFactory targetConnectionFactory) Set the target ConnectionFactory that this ConnectionFactory should delegate to.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TransactionAwareConnectionFactoryProxy

public TransactionAwareConnectionFactoryProxy()
Create a new TransactionAwareConnectionFactoryProxy.

TransactionAwareConnectionFactoryProxy

public TransactionAwareConnectionFactoryProxy(ConnectionFactory targetConnectionFactory)
Create a new TransactionAwareConnectionFactoryProxy.

Parameters:
targetConnectionFactory - the target ConnectionFactory
Method Detail

setTargetConnectionFactory

public final void setTargetConnectionFactory(ConnectionFactory targetConnectionFactory)
Set the target ConnectionFactory that this ConnectionFactory should delegate to.

getTargetConnectionFactory

protected ConnectionFactory getTargetConnectionFactory()
Return the target ConnectionFactory that this ConnectionFactory should delegate to.

setSynchedLocalTransactionAllowed

public void setSynchedLocalTransactionAllowed(boolean synchedLocalTransactionAllowed)
Set whether to allow for a local JMS transaction that is synchronized with a Spring-managed transaction (where the main transaction might be a JDBC-based one for a specific DataSource, for example), with the JMS transaction committing right after the main transaction. If not allowed, the given ConnectionFactory needs to handle transaction enlistment underneath the covers.

Default is "false": If not within a managed transaction that encompasses the underlying JMS ConnectionFactory, standard Sessions will be returned. Turn this flag on to allow participation in any Spring-managed transaction, with a local JMS transaction synchronized with the main transaction.

isSynchedLocalTransactionAllowed

protected boolean isSynchedLocalTransactionAllowed()
Return whether to allow for a local JMS transaction that is synchronized with a Spring-managed transaction.

createConnection

public Connection createConnection()
                            throws JMSException
Specified by:
createConnection in interface ConnectionFactory
Throws:
JMSException

createConnection

public Connection createConnection(String username,
                                   String password)
                            throws JMSException
Specified by:
createConnection in interface ConnectionFactory
Throws:
JMSException

createQueueConnection

public QueueConnection createQueueConnection()
                                      throws JMSException
Specified by:
createQueueConnection in interface QueueConnectionFactory
Throws:
JMSException

createQueueConnection

public QueueConnection createQueueConnection(String username,
                                             String password)
                                      throws JMSException
Specified by:
createQueueConnection in interface QueueConnectionFactory
Throws:
JMSException

createTopicConnection

public TopicConnection createTopicConnection()
                                      throws JMSException
Specified by:
createTopicConnection in interface TopicConnectionFactory
Throws:
JMSException

createTopicConnection

public TopicConnection createTopicConnection(String username,
                                             String password)
                                      throws JMSException
Specified by:
createTopicConnection in interface TopicConnectionFactory
Throws:
JMSException

getTransactionAwareConnectionProxy

protected Connection getTransactionAwareConnectionProxy(Connection target)
Wrap the given Connection with a proxy that delegates every method call to it but handles Session lookup in a transaction-aware fashion.

Parameters:
target - the original Connection to wrap
Returns:
the wrapped Connection
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UserCredentialsConnectionFactoryAdapter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jms.connection
Class UserCredentialsConnectionFactoryAdapter

java.lang.Object
    extended by  org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter
All Implemented Interfaces:
ConnectionFactory, QueueConnectionFactory, TopicConnectionFactory, InitializingBean
public class UserCredentialsConnectionFactoryAdapter
extends Object
implements ConnectionFactory, QueueConnectionFactory, TopicConnectionFactory, InitializingBean

An adapter for a target JMS ConnectionFactory, applying the given user credentials to every standard createConnection() call, that is, implicitly invoking createConnection(username, password) on the target. All other methods simply delegate to the corresponding methods of the target ConnectionFactory.

Can be used to proxy a target JNDI ConnectionFactory that does not have user credentials configured. Client code can work with the ConnectionFactory without passing in username and password on every createConnection() call.

In the following example, client code can simply transparently work with the preconfigured "myConnectionFactory", implicitly accessing "myTargetConnectionFactory" with the specified user credentials.

 <bean id="myTargetConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
   <property name="jndiName" value="java:comp/env/jms/mycf"/>
 </bean>

 <bean id="myConnectionFactory" class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
   <property name="targetConnectionFactory" ref="myTargetConnectionFactory"/>
   <property name="username" value="myusername"/>
   <property name="password" value="mypassword"/>
 </bean>

If the "username" is empty, this proxy will simply delegate to the standard createConnection() method of the target ConnectionFactory. This can be used to keep a UserCredentialsConnectionFactoryAdapter bean definition just for the option of implicitly passing in user credentials if the particular target ConnectionFactory requires it.

Since:
1.2
Author:
Juergen Hoeller
See Also:
createConnection(),
createQueueConnection(),
createTopicConnection()

Constructor Summary
UserCredentialsConnectionFactoryAdapter()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 Connection createConnection()
Determine whether there are currently thread-bound credentials, using them if available, falling back to the statically specified username and password (i.e.
 Connection createConnection(String username, String password)
Delegate the call straight to the target ConnectionFactory.
 QueueConnection createQueueConnection()
Determine whether there are currently thread-bound credentials, using them if available, falling back to the statically specified username and password (i.e.
 QueueConnection createQueueConnection(String username, String password)
Delegate the call straight to the target QueueConnectionFactory.
 TopicConnection createTopicConnection()
Determine whether there are currently thread-bound credentials, using them if available, falling back to the statically specified username and password (i.e.
 TopicConnection createTopicConnection(String username, String password)
Delegate the call straight to the target TopicConnectionFactory.
protected  Connection doCreateConnection(String username, String password)
This implementation delegates to the createConnection(username, password) method of the target ConnectionFactory, passing in the specified user credentials.
protected  QueueConnection doCreateQueueConnection(String username, String password)
This implementation delegates to the createQueueConnection(username, password) method of the target QueueConnectionFactory, passing in the specified user credentials.
protected  TopicConnection doCreateTopicConnection(String username, String password)
This implementation delegates to the createTopicConnection(username, password) method of the target TopicConnectionFactory, passing in the specified user credentials.
 void removeCredentialsFromCurrentThread()
Remove any user credentials for this proxy from the current thread.
 void setCredentialsForCurrentThread(String username, String password)
Set user credententials for this proxy and the current thread.
 void setPassword(String password)
Set the password that this adapter should use for retrieving Connections.
 void setTargetConnectionFactory(ConnectionFactory targetConnectionFactory)
Set the target ConnectionFactory that this ConnectionFactory should delegate to.
 void setUsername(String username)
Set the username that this adapter should use for retrieving Connections.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

UserCredentialsConnectionFactoryAdapter

public UserCredentialsConnectionFactoryAdapter()
Method Detail

setTargetConnectionFactory

public void setTargetConnectionFactory(ConnectionFactory targetConnectionFactory)
Set the target ConnectionFactory that this ConnectionFactory should delegate to.

setUsername

public void setUsername(String username)
Set the username that this adapter should use for retrieving Connections. Default is no specific user.

setPassword

public void setPassword(String password)
Set the password that this adapter should use for retrieving Connections. Default is no specific password.

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

setCredentialsForCurrentThread

public void setCredentialsForCurrentThread(String username,
                                           String password)
Set user credententials for this proxy and the current thread. The given username and password will be applied to all subsequent createConnection() calls on this ConnectionFactory proxy.

This will override any statically specified user credentials, that is, values of the "username" and "password" bean properties.

Parameters:
username - the username to apply
password - the password to apply
See Also:
removeCredentialsFromCurrentThread()

removeCredentialsFromCurrentThread

public void removeCredentialsFromCurrentThread()
Remove any user credentials for this proxy from the current thread. Statically specified user credentials apply again afterwards.

See Also:
setCredentialsForCurrentThread(java.lang.String, java.lang.String)

createConnection

public final Connection createConnection()
                                  throws JMSException
Determine whether there are currently thread-bound credentials, using them if available, falling back to the statically specified username and password (i.e. values of the bean properties) else.

Specified by:
createConnection in interface ConnectionFactory
Throws:
JMSException
See Also:
doCreateConnection(java.lang.String, java.lang.String)

createConnection

public Connection createConnection(String username,
                                   String password)
                            throws JMSException
Delegate the call straight to the target ConnectionFactory.

Specified by:
createConnection in interface ConnectionFactory
Throws:
JMSException

doCreateConnection

protected Connection doCreateConnection(String username,
                                        String password)
                                 throws JMSException
This implementation delegates to the createConnection(username, password) method of the target ConnectionFactory, passing in the specified user credentials. If the specified username is empty, it will simply delegate to the standard createConnection() method of the target ConnectionFactory.

Parameters:
username - the username to use
password - the password to use
Returns:
the Connection
Throws:
JMSException
See Also:
ConnectionFactory.createConnection(String, String), ConnectionFactory.createConnection()

createQueueConnection

public final QueueConnection createQueueConnection()
                                            throws JMSException
Determine whether there are currently thread-bound credentials, using them if available, falling back to the statically specified username and password (i.e. values of the bean properties) else.

Specified by:
createQueueConnection in interface QueueConnectionFactory
Throws:
JMSException
See Also:
doCreateQueueConnection(java.lang.String, java.lang.String)

createQueueConnection

public QueueConnection createQueueConnection(String username,
                                             String password)
                                      throws JMSException
Delegate the call straight to the target QueueConnectionFactory.

Specified by:
createQueueConnection in interface QueueConnectionFactory
Throws:
JMSException

doCreateQueueConnection

protected QueueConnection doCreateQueueConnection(String username,
                                                  String password)
                                           throws JMSException
This implementation delegates to the createQueueConnection(username, password) method of the target QueueConnectionFactory, passing in the specified user credentials. If the specified username is empty, it will simply delegate to the standard createQueueConnection() method of the target ConnectionFactory.

Parameters:
username - the username to use
password - the password to use
Returns:
the Connection
Throws:
JMSException
See Also:
QueueConnectionFactory.createQueueConnection(String, String), QueueConnectionFactory.createQueueConnection()

createTopicConnection

public final TopicConnection createTopicConnection()
                                            throws JMSException
Determine whether there are currently thread-bound credentials, using them if available, falling back to the statically specified username and password (i.e. values of the bean properties) else.

Specified by:
createTopicConnection in interface TopicConnectionFactory
Throws:
JMSException
See Also:
doCreateTopicConnection(java.lang.String, java.lang.String)

createTopicConnection

public TopicConnection createTopicConnection(String username,
                                             String password)
                                      throws JMSException
Delegate the call straight to the target TopicConnectionFactory.

Specified by:
createTopicConnection in interface TopicConnectionFactory
Throws:
JMSException

doCreateTopicConnection

protected TopicConnection doCreateTopicConnection(String username,
                                                  String password)
                                           throws JMSException
This implementation delegates to the createTopicConnection(username, password) method of the target TopicConnectionFactory, passing in the specified user credentials. If the specified username is empty, it will simply delegate to the standard createTopicConnection() method of the target ConnectionFactory.

Parameters:
username - the username to use
password - the password to use
Returns:
the Connection
Throws:
JMSException
See Also:
TopicConnectionFactory.createTopicConnection(String, String), TopicConnectionFactory.createTopicConnection()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


SynchedLocalTransactionFailedException

org.springframework.jms.connection
Class SynchedLocalTransactionFailedException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.jms.JmsException
                        extended by  org.springframework.jms.connection.SynchedLocalTransactionFailedException
All Implemented Interfaces:
Serializable
public class SynchedLocalTransactionFailedException
extends JmsException

Exception thrown when a synchronized local transaction failed to complete (after the main transaction has already completed).

Since:
2.0
Author:
Juergen Hoeller
See Also:
ConnectionFactoryUtils, Serialized Form

Constructor Summary
SynchedLocalTransactionFailedException(String msg, JMSException cause)
Create a new SynchedLocalTransactionFailedException.
Method Summary
Methods inherited from class org.springframework.jms.JmsException
getErrorCode, getMessage
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

SynchedLocalTransactionFailedException

public SynchedLocalTransactionFailedException(String msg,
                                              JMSException cause)
Create a new SynchedLocalTransactionFailedException.

Parameters:
msg - the detail message
cause - the root cause
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.jms.core

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jms.core

Core package of the JMS support.

See:
Description

Interface Summary
BrowserCallback<T> | Callback for browsing the messages in a JMS queue.
JmsOperations | Specifies a basic set of JMS operations.
MessageCreator | Creates a JMS message given a Session.
MessagePostProcessor | To be used with JmsTemplate's send method that convert an object to a message.
ProducerCallback<T> | Callback for sending a message to a JMS destination.
SessionCallback<T> | Callback for executing any number of operations on a provided Session.

Class Summary
JmsTemplate | Helper class that simplifies synchronous JMS access code.
JmsTemplate102 | Deprecated. as of Spring 3.0, in favor of the JMS 1.1 based JmsTemplate

Package org.springframework.jms.core Description

Core package of the JMS support. Provides a JmsTemplate class and various callback interfaces.


org.springframework.jms.core Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jms.core

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jms.support.JmsAccessor (implements org.springframework.beans.factory.InitializingBean)
      • org.springframework.jms.support.destination.JmsDestinationAccessor
        • org.springframework.jms.core.JmsTemplate (implements org.springframework.jms.core.JmsOperations)
          • org.springframework.jms.core.JmsTemplate102

Interface Hierarchy

  • org.springframework.jms.core.BrowserCallback<T>
  • org.springframework.jms.core.JmsOperations
  • org.springframework.jms.core.MessageCreator
  • org.springframework.jms.core.MessagePostProcessor
  • org.springframework.jms.core.ProducerCallback<T>
  • org.springframework.jms.core.SessionCallback<T>


BrowserCallback

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jms.core
Interface BrowserCallback<T>

public interface BrowserCallback<T>

Callback for browsing the messages in a JMS queue.

To be used with JmsTemplate's callback methods that take a BrowserCallback argument, often implemented as an anonymous inner class.

Since:
2.5.1
Author:
Juergen Hoeller
See Also:
JmsTemplate.browse(BrowserCallback), JmsTemplate.browseSelected(String, BrowserCallback)

Method Summary
 T doInJms(Session session, QueueBrowser browser)
Perform operations on the given Session and QueueBrowser.

Method Detail

doInJms

T doInJms(Session session,
          QueueBrowser browser)
          throws JMSException
Perform operations on the given Session and QueueBrowser.

The message producer is not associated with any destination.

Parameters:
session - the JMS Session object to use
browser - the JMS QueueBrowser object to use
Returns:
a result object from working with the Session, if any (can be null)
Throws:
JMSException - if thrown by JMS API methods
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


JmsOperations

org.springframework.jms.core
Interface JmsOperations

All Known Implementing Classes:
JmsTemplate, JmsTemplate102
public interface JmsOperations

Specifies a basic set of JMS operations.

Implemented by JmsTemplate. Not often used but a useful option to enhance testability, as it can easily be mocked or stubbed.

Provides JmsTemplate's send(..) and receive(..) methods that mirror various JMS API methods. See the JMS specification and javadocs for details on those methods.

Since:
1.1
Author:
Mark Pollack, Juergen Hoeller
See Also:
JmsTemplate, Destination, Session, MessageProducer, MessageConsumer

Method Summary
<T> T
browse(BrowserCallback<T> action)
Browse messages in the default JMS queue.
<T> T
browse(Queue queue, BrowserCallback<T> action)
Browse messages in a JMS queue.
<T> T
browse(String queueName, BrowserCallback<T> action)
Browse messages in a JMS queue.
<T> T
browseSelected(Queue queue, String messageSelector, BrowserCallback<T> action)
Browse selected messages in a JMS queue.
<T> T
browseSelected(String messageSelector, BrowserCallback<T> action)
Browse selected messages in a JMS queue.
<T> T
browseSelected(String queueName, String messageSelector, BrowserCallback<T> action)
Browse selected messages in a JMS queue.
 void convertAndSend(Destination destination, Object message)
Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter.
 void convertAndSend(Destination destination, Object message, MessagePostProcessor postProcessor)
Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter.
 void convertAndSend(Object message)
Send the given object to the default destination, converting the object to a JMS message with a configured MessageConverter.
 void convertAndSend(Object message, MessagePostProcessor postProcessor)
Send the given object to the default destination, converting the object to a JMS message with a configured MessageConverter.
 void convertAndSend(String destinationName, Object message)
Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter.
 void convertAndSend(String destinationName, Object message, MessagePostProcessor postProcessor)
Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter.
<T> T
execute(Destination destination, ProducerCallback<T> action)
Send messages to a JMS destination.
<T> T
execute(ProducerCallback<T> action)
Send messages to the default JMS destination (or one specified for each send operation).
<T> T
execute(SessionCallback<T> action)
Execute the action specified by the given action object within a JMS Session.
<T> T
execute(String destinationName, ProducerCallback<T> action)
Send messages to a JMS destination.
 Message receive()
Receive a message synchronously from the default destination, but only wait up to a specified time for delivery.
 Message receive(Destination destination)
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.
 Message receive(String destinationName)
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.
 Object receiveAndConvert()
Receive a message synchronously from the default destination, but only wait up to a specified time for delivery.
 Object receiveAndConvert(Destination destination)
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.
 Object receiveAndConvert(String destinationName)
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.
 Message receiveSelected(Destination destination, String messageSelector)
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.
 Message receiveSelected(String messageSelector)
Receive a message synchronously from the default destination, but only wait up to a specified time for delivery.
 Message receiveSelected(String destinationName, String messageSelector)
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.
 Object receiveSelectedAndConvert(Destination destination, String messageSelector)
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.
 Object receiveSelectedAndConvert(String messageSelector)
Receive a message synchronously from the default destination, but only wait up to a specified time for delivery.
 Object receiveSelectedAndConvert(String destinationName, String messageSelector)
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.
 void send(Destination destination, MessageCreator messageCreator)
Send a message to the specified destination.
 void send(MessageCreator messageCreator)
Send a message to the default destination.
 void send(String destinationName, MessageCreator messageCreator)
Send a message to the specified destination.

Method Detail

execute

<T> T execute(SessionCallback<T> action)
          throws JmsException
Execute the action specified by the given action object within a JMS Session.

When used with a 1.0.2 provider, you may need to downcast to the appropriate domain implementation, either QueueSession or TopicSession in the action objects doInJms callback method.

Parameters:
action - callback object that exposes the session
Returns:
the result object from working with the session
Throws:
JmsException - if there is any problem

execute

<T> T execute(ProducerCallback<T> action)
          throws JmsException
Send messages to the default JMS destination (or one specified for each send operation). The callback gives access to the JMS Session and MessageProducer in order to perform complex send operations.

Parameters:
action - callback object that exposes the session/producer pair
Returns:
the result object from working with the session
Throws:
JmsException - checked JMSException converted to unchecked

execute

<T> T execute(Destination destination,
              ProducerCallback<T> action)
          throws JmsException
Send messages to a JMS destination. The callback gives access to the JMS Session and MessageProducer in order to perform complex send operations.

Parameters:
destination - the destination to send messages to
action - callback object that exposes the session/producer pair
Returns:
the result object from working with the session
Throws:
JmsException - checked JMSException converted to unchecked

execute

<T> T execute(String destinationName,
              ProducerCallback<T> action)
          throws JmsException
Send messages to a JMS destination. The callback gives access to the JMS Session and MessageProducer in order to perform complex send operations.

Parameters:
destinationName - the name of the destination to send messages to (to be resolved to an actual destination by a DestinationResolver)
action - callback object that exposes the session/producer pair
Returns:
the result object from working with the session
Throws:
JmsException - checked JMSException converted to unchecked

send

void send(MessageCreator messageCreator)
          throws JmsException
Send a message to the default destination.

This will only work with a default destination specified!

Parameters:
messageCreator - callback to create a message
Throws:
JmsException - checked JMSException converted to unchecked

send

void send(Destination destination,
          MessageCreator messageCreator)
          throws JmsException
Send a message to the specified destination. The MessageCreator callback creates the message given a Session.

Parameters:
destination - the destination to send this message to
messageCreator - callback to create a message
Throws:
JmsException - checked JMSException converted to unchecked

send

void send(String destinationName,
          MessageCreator messageCreator)
          throws JmsException
Send a message to the specified destination. The MessageCreator callback creates the message given a Session.

Parameters:
destinationName - the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver)
messageCreator - callback to create a message
Throws:
JmsException - checked JMSException converted to unchecked

convertAndSend

void convertAndSend(Object message)
                    throws JmsException
Send the given object to the default destination, converting the object to a JMS message with a configured MessageConverter.

This will only work with a default destination specified!

Parameters:
message - the object to convert to a message
Throws:
JmsException - converted checked JMSException to unchecked

convertAndSend

void convertAndSend(Destination destination,
                    Object message)
                    throws JmsException
Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter.

Parameters:
destination - the destination to send this message to
message - the object to convert to a message
Throws:
JmsException - converted checked JMSException to unchecked

convertAndSend

void convertAndSend(String destinationName,
                    Object message)
                    throws JmsException
Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter.

Parameters:
destinationName - the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver)
message - the object to convert to a message
Throws:
JmsException - checked JMSException converted to unchecked

convertAndSend

void convertAndSend(Object message,
                    MessagePostProcessor postProcessor)
                    throws JmsException
Send the given object to the default destination, converting the object to a JMS message with a configured MessageConverter. The MessagePostProcessor callback allows for modification of the message after conversion.

This will only work with a default destination specified!

Parameters:
message - the object to convert to a message
postProcessor - the callback to modify the message
Throws:
JmsException - checked JMSException converted to unchecked

convertAndSend

void convertAndSend(Destination destination,
                    Object message,
                    MessagePostProcessor postProcessor)
                    throws JmsException
Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter. The MessagePostProcessor callback allows for modification of the message after conversion.

Parameters:
destination - the destination to send this message to
message - the object to convert to a message
postProcessor - the callback to modify the message
Throws:
JmsException - checked JMSException converted to unchecked

convertAndSend

void convertAndSend(String destinationName,
                    Object message,
                    MessagePostProcessor postProcessor)
                    throws JmsException
Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter. The MessagePostProcessor callback allows for modification of the message after conversion.

Parameters:
destinationName - the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver)
message - the object to convert to a message.
postProcessor - the callback to modify the message
Throws:
JmsException - checked JMSException converted to unchecked

receive

Message receive()
                throws JmsException
Receive a message synchronously from the default destination, but only wait up to a specified time for delivery.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

This will only work with a default destination specified!

Returns:
the message received by the consumer, or null if the timeout expires
Throws:
JmsException - checked JMSException converted to unchecked

receive

Message receive(Destination destination)
                throws JmsException
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

Parameters:
destination - the destination to receive a message from
Returns:
the message received by the consumer, or null if the timeout expires
Throws:
JmsException - checked JMSException converted to unchecked

receive

Message receive(String destinationName)
                throws JmsException
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

Parameters:
destinationName - the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver)
Returns:
the message received by the consumer, or null if the timeout expires
Throws:
JmsException - checked JMSException converted to unchecked

receiveSelected

Message receiveSelected(String messageSelector)
                        throws JmsException
Receive a message synchronously from the default destination, but only wait up to a specified time for delivery.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

This will only work with a default destination specified!

Parameters:
messageSelector - the JMS message selector expression (or null if none). See the JMS specification for a detailed definition of selector expressions.
Returns:
the message received by the consumer, or null if the timeout expires
Throws:
JmsException - checked JMSException converted to unchecked

receiveSelected

Message receiveSelected(Destination destination,
                        String messageSelector)
                        throws JmsException
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

Parameters:
destination - the destination to receive a message from
messageSelector - the JMS message selector expression (or null if none). See the JMS specification for a detailed definition of selector expressions.
Returns:
the message received by the consumer, or null if the timeout expires
Throws:
JmsException - checked JMSException converted to unchecked

receiveSelected

Message receiveSelected(String destinationName,
                        String messageSelector)
                        throws JmsException
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

Parameters:
destinationName - the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver)
messageSelector - the JMS message selector expression (or null if none). See the JMS specification for a detailed definition of selector expressions.
Returns:
the message received by the consumer, or null if the timeout expires
Throws:
JmsException - checked JMSException converted to unchecked

receiveAndConvert

Object receiveAndConvert()
                         throws JmsException
Receive a message synchronously from the default destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured MessageConverter.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

This will only work with a default destination specified!

Returns:
the message produced for the consumer or null if the timeout expires.
Throws:
JmsException - checked JMSException converted to unchecked

receiveAndConvert

Object receiveAndConvert(Destination destination)
                         throws JmsException
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured MessageConverter.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

Parameters:
destination - the destination to receive a message from
Returns:
the message produced for the consumer or null if the timeout expires.
Throws:
JmsException - checked JMSException converted to unchecked

receiveAndConvert

Object receiveAndConvert(String destinationName)
                         throws JmsException
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured MessageConverter.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

Parameters:
destinationName - the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver)
Returns:
the message produced for the consumer or null if the timeout expires.
Throws:
JmsException - checked JMSException converted to unchecked

receiveSelectedAndConvert

Object receiveSelectedAndConvert(String messageSelector)
                                 throws JmsException
Receive a message synchronously from the default destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured MessageConverter.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

This will only work with a default destination specified!

Parameters:
messageSelector - the JMS message selector expression (or null if none). See the JMS specification for a detailed definition of selector expressions.
Returns:
the message produced for the consumer or null if the timeout expires.
Throws:
JmsException - checked JMSException converted to unchecked

receiveSelectedAndConvert

Object receiveSelectedAndConvert(Destination destination,
                                 String messageSelector)
                                 throws JmsException
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured MessageConverter.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

Parameters:
destination - the destination to receive a message from
messageSelector - the JMS message selector expression (or null if none). See the JMS specification for a detailed definition of selector expressions.
Returns:
the message produced for the consumer or null if the timeout expires.
Throws:
JmsException - checked JMSException converted to unchecked

receiveSelectedAndConvert

Object receiveSelectedAndConvert(String destinationName,
                                 String messageSelector)
                                 throws JmsException
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured MessageConverter.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

Parameters:
destinationName - the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver)
messageSelector - the JMS message selector expression (or null if none). See the JMS specification for a detailed definition of selector expressions.
Returns:
the message produced for the consumer or null if the timeout expires.
Throws:
JmsException - checked JMSException converted to unchecked

browse

<T> T browse(BrowserCallback<T> action)
         throws JmsException
Browse messages in the default JMS queue. The callback gives access to the JMS Session and QueueBrowser in order to browse the queue and react to the contents.

Parameters:
action - callback object that exposes the session/browser pair
Returns:
the result object from working with the session
Throws:
JmsException - checked JMSException converted to unchecked

browse

<T> T browse(Queue queue,
             BrowserCallback<T> action)
         throws JmsException
Browse messages in a JMS queue. The callback gives access to the JMS Session and QueueBrowser in order to browse the queue and react to the contents.

Parameters:
queue - the queue to browse
action - callback object that exposes the session/browser pair
Returns:
the result object from working with the session
Throws:
JmsException - checked JMSException converted to unchecked

browse

<T> T browse(String queueName,
             BrowserCallback<T> action)
         throws JmsException
Browse messages in a JMS queue. The callback gives access to the JMS Session and QueueBrowser in order to browse the queue and react to the contents.

Parameters:
queueName - the name of the queue to browse (to be resolved to an actual destination by a DestinationResolver)
action - callback object that exposes the session/browser pair
Returns:
the result object from working with the session
Throws:
JmsException - checked JMSException converted to unchecked

browseSelected

<T> T browseSelected(String messageSelector,
                     BrowserCallback<T> action)
                 throws JmsException
Browse selected messages in a JMS queue. The callback gives access to the JMS Session and QueueBrowser in order to browse the queue and react to the contents.

Parameters:
messageSelector - the JMS message selector expression (or null if none). See the JMS specification for a detailed definition of selector expressions.
action - callback object that exposes the session/browser pair
Returns:
the result object from working with the session
Throws:
JmsException - checked JMSException converted to unchecked

browseSelected

<T> T browseSelected(Queue queue,
                     String messageSelector,
                     BrowserCallback<T> action)
                 throws JmsException
Browse selected messages in a JMS queue. The callback gives access to the JMS Session and QueueBrowser in order to browse the queue and react to the contents.

Parameters:
queue - the queue to browse
messageSelector - the JMS message selector expression (or null if none). See the JMS specification for a detailed definition of selector expressions.
action - callback object that exposes the session/browser pair
Returns:
the result object from working with the session
Throws:
JmsException - checked JMSException converted to unchecked

browseSelected

<T> T browseSelected(String queueName,
                     String messageSelector,
                     BrowserCallback<T> action)
                 throws JmsException
Browse selected messages in a JMS queue. The callback gives access to the JMS Session and QueueBrowser in order to browse the queue and react to the contents.

Parameters:
queueName - the name of the queue to browse (to be resolved to an actual destination by a DestinationResolver)
messageSelector - the JMS message selector expression (or null if none). See the JMS specification for a detailed definition of selector expressions.
action - callback object that exposes the session/browser pair
Returns:
the result object from working with the session
Throws:
JmsException - checked JMSException converted to unchecked
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageCreator

org.springframework.jms.core
Interface MessageCreator

public interface MessageCreator

Creates a JMS message given a Session.

The Session typically is provided by an instance of the JmsTemplate class.

Implementations do not need to concern themselves with checked JMSExceptions (from the 'javax.jms' package) that may be thrown from operations they attempt. The JmsTemplate will catch and handle these JMSExceptions appropriately.

Since:
1.1
Author:
Mark Pollack

Method Summary
 Message createMessage(Session session)
Create a Message to be sent.

Method Detail

createMessage

Message createMessage(Session session)
                      throws JMSException
Create a Message to be sent.

Parameters:
session - the JMS Session to be used to create the Message (never null)
Returns:
the Message to be sent
Throws:
JMSException - if thrown by JMS API methods
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessagePostProcessor

org.springframework.jms.core
Interface MessagePostProcessor

public interface MessagePostProcessor

To be used with JmsTemplate's send method that convert an object to a message. It allows for further modification of the message after it has been processed by the converter. This is useful for setting of JMS Header and Properties.

This often as an anonymous class within a method implementation.

Since:
1.1
Author:
Mark Pollack
See Also:
JmsTemplate.convertAndSend(String, Object, MessagePostProcessor), JmsTemplate.convertAndSend(javax.jms.Destination, Object, MessagePostProcessor), MessageConverter

Method Summary
 Message postProcessMessage(Message message)
Apply a MessagePostProcessor to the message.

Method Detail

postProcessMessage

Message postProcessMessage(Message message)
                           throws JMSException
Apply a MessagePostProcessor to the message. The returned message is typically a modified version of the original.

Parameters:
message - the JMS message from the MessageConverter
Returns:
the modified version of the Message
Throws:
JMSException - if thrown by JMS API methods
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ProducerCallback

org.springframework.jms.core
Interface ProducerCallback<T>

public interface ProducerCallback<T>

Callback for sending a message to a JMS destination.

To be used with JmsTemplate's callback methods that take a ProducerCallback argument, often implemented as an anonymous inner class.

The typical implementation will perform multiple operations on the supplied JMS Session and MessageProducer. When used with a 1.0.2 provider, you need to downcast to the appropriate domain implementation, either QueueSender or TopicPublisher, to actually send a message.

Since:
1.1
Author:
Mark Pollack
See Also:
JmsTemplate.execute(ProducerCallback),
JmsTemplate.execute(javax.jms.Destination, ProducerCallback),
JmsTemplate.execute(String, ProducerCallback)

Method Summary
 T doInJms(Session session, MessageProducer producer)
Perform operations on the given Session and MessageProducer.

Method Detail

doInJms

T doInJms(Session session,
          MessageProducer producer)
          throws JMSException
Perform operations on the given Session and MessageProducer.

The message producer is not associated with any destination unless when specified in the JmsTemplate call.

Parameters:
session - the JMS Session object to use
producer - the JMS MessageProducer object to use
Returns:
a result object from working with the Session, if any (can be null)
Throws:
JMSException - if thrown by JMS API methods
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SessionCallback

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jms.core
Interface SessionCallback<T>

public interface SessionCallback<T>

Callback for executing any number of operations on a provided Session.

To be used with the JmsTemplate.execute(SessionCallback) method, often implemented as an anonymous inner class.

Since:
1.1
Author:
Mark Pollack
See Also:
JmsTemplate.execute(SessionCallback)

Method Summary
 T doInJms(Session session)
Execute any number of operations against the supplied JMS Session, possibly returning a result.

Method Detail

doInJms

T doInJms(Session session)
          throws JMSException
Execute any number of operations against the supplied JMS Session, possibly returning a result.

Parameters:
session - the JMS Session
Returns:
a result object from working with the Session, if any (so can be null)
Throws:
JMSException - if thrown by JMS API methods
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


JmsTemplate

org.springframework.jms.core
Class JmsTemplate

java.lang.Object
    extended by  org.springframework.jms.support.JmsAccessor
        extended by  org.springframework.jms.support.destination.JmsDestinationAccessor
            extended by  org.springframework.jms.core.JmsTemplate
All Implemented Interfaces:
InitializingBean, JmsOperations
Direct Known Subclasses:
JmsTemplate102
public class JmsTemplate
extends JmsDestinationAccessor
implements JmsOperations

Helper class that simplifies synchronous JMS access code.

If you want to use dynamic destination creation, you must specify the type of JMS destination to create, using the "pubSubDomain" property. For other operations, this is not necessary, in contrast to when working with JmsTemplate102. Point-to-Point (Queues) is the default domain.

Default settings for JMS Sessions are "not transacted" and "auto-acknowledge". As defined by the J2EE specification, the transaction and acknowledgement parameters are ignored when a JMS Session is created inside an active transaction, no matter if a JTA transaction or a Spring-managed transaction. To configure them for native JMS usage, specify appropriate values for the "sessionTransacted" and "sessionAcknowledgeMode" bean properties.

This template uses a DynamicDestinationResolver and a SimpleMessageConverter as default strategies for resolving a destination name or converting a message, respectively. These defaults can be overridden through the "destinationResolver" and "messageConverter" bean properties.

NOTE: The ConnectionFactory used with this template should return pooled Connections (or a single shared Connection) as well as pooled Sessions and MessageProducers. Otherwise, performance of ad-hoc JMS operations is going to suffer. The simplest option is to use the Spring-provided SingleConnectionFactory as a decorator for your target ConnectionFactory, reusing a single JMS Connection in a thread-safe fashion; this is often good enough for the purpose of sending messages via this template. In a J2EE environment, make sure that the ConnectionFactory is obtained from the application's environment naming context via JNDI; application servers typically expose pooled, transaction-aware factories there.

Since:
1.1
Author:
Mark Pollack, Juergen Hoeller
See Also:
JmsAccessor.setConnectionFactory(javax.jms.ConnectionFactory),
JmsDestinationAccessor.setPubSubDomain(boolean),
JmsDestinationAccessor.setDestinationResolver(org.springframework.jms.support.destination.DestinationResolver),
setMessageConverter(org.springframework.jms.support.converter.MessageConverter),
MessageProducer,
MessageConsumer

Field Summary
static long | RECEIVE_TIMEOUT_INDEFINITE_WAIT Timeout value indicating a blocking receive without timeout.
static long | RECEIVE_TIMEOUT_NO_WAIT Timeout value indicating that a receive operation should check if a message is immediately available without blocking.
Fields inherited from class org.springframework.jms.support.JmsAccessor
logger
Constructor Summary
JmsTemplate()
Create a new JmsTemplate for bean-style usage.
JmsTemplate(ConnectionFactory connectionFactory)
Create a new JmsTemplate, given a ConnectionFactory.
Method Summary
<T> T
browse(BrowserCallback<T> action)
Browse messages in the default JMS queue.
<T> T
browse(Queue queue, BrowserCallback<T> action)
Browse messages in a JMS queue.
<T> T
browse(String queueName, BrowserCallback<T> action)
Browse messages in a JMS queue.
<T> T
browseSelected(Queue queue, String messageSelector, BrowserCallback<T> action)
Browse selected messages in a JMS queue.
<T> T
browseSelected(String messageSelector, BrowserCallback<T> action)
Browse selected messages in a JMS queue.
<T> T
browseSelected(String queueName, String messageSelector, BrowserCallback<T> action)
Browse selected messages in a JMS queue.
 void convertAndSend(Destination destination, Object message)
Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter.
 void convertAndSend(Destination destination, Object message, MessagePostProcessor postProcessor)
Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter.
 void convertAndSend(Object message)
Send the given object to the default destination, converting the object to a JMS message with a configured MessageConverter.
 void convertAndSend(Object message, MessagePostProcessor postProcessor)
Send the given object to the default destination, converting the object to a JMS message with a configured MessageConverter.
 void convertAndSend(String destinationName, Object message)
Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter.
 void convertAndSend(String destinationName, Object message, MessagePostProcessor postProcessor)
Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter.
protected  QueueBrowser createBrowser(Session session, Queue queue, String messageSelector)
Create a JMS MessageProducer for the given Session and Destination, configuring it to disable message ids and/or timestamps (if necessary).
protected  MessageConsumer createConsumer(Session session, Destination destination, String messageSelector)
Create a JMS MessageConsumer for the given Session and Destination.
protected  MessageProducer createProducer(Session session, Destination destination)
Create a JMS MessageProducer for the given Session and Destination, configuring it to disable message ids and/or timestamps (if necessary).
protected  Object doConvertFromMessage(Message message)
Extract the content from the given JMS message.
protected  MessageProducer doCreateProducer(Session session, Destination destination)
Create a raw JMS MessageProducer for the given Session and Destination.
protected  Message doReceive(Session session, Destination destination, String messageSelector)
Receive a JMS message.
protected  Message doReceive(Session session, MessageConsumer consumer)
Actually receive a JMS message.
protected  void doSend(MessageProducer producer, Message message)
Actually send the given JMS message.
protected  void doSend(Session session, Destination destination, MessageCreator messageCreator)
Send the given JMS message.
<T> T
execute(Destination destination, ProducerCallback<T> action)
Send messages to a JMS destination.
<T> T
execute(ProducerCallback<T> action)
Send messages to the default JMS destination (or one specified for each send operation).
<T> T
execute(SessionCallback<T> action)
Execute the action specified by the given action object within a JMS Session.
<T> T
execute(SessionCallback<T> action, boolean startConnection)
Execute the action specified by the given action object within a JMS Session.
<T> T
execute(String destinationName, ProducerCallback<T> action)
Send messages to a JMS destination.
protected  Connection getConnection(JmsResourceHolder holder)
Fetch an appropriate Connection from the given JmsResourceHolder.
 Destination getDefaultDestination()
Return the destination to be used on send/receive operations that do not have a destination parameter.
 String getDefaultDestinationName()
Return the destination name to be used on send/receive operations that do not have a destination parameter.
 int getDeliveryMode()
Return the delivery mode to use when sending a message.
 MessageConverter getMessageConverter()
Return the message converter for this template.
 int getPriority()
Return the priority of a message when sending.
 long getReceiveTimeout()
Return the timeout to use for receive calls (in milliseconds).
protected  Session getSession(JmsResourceHolder holder)
Fetch an appropriate Session from the given JmsResourceHolder.
 long getTimeToLive()
Return the time-to-live of the message when sending.
protected  void initDefaultStrategies()
Initialize the default implementations for the template's strategies: DynamicDestinationResolver and SimpleMessageConverter.
 boolean isExplicitQosEnabled()
If "true", then the values of deliveryMode, priority, and timeToLive will be used when sending a message.
 boolean isMessageIdEnabled()
Return whether message IDs are enabled.
 boolean isMessageTimestampEnabled()
Return whether message timestamps are enabled.
 boolean isPubSubNoLocal()
Return whether to inhibit the delivery of messages published by its own connection.
protected  boolean isSessionLocallyTransacted(Session session)
Check whether the given Session is locally transacted, that is, whether its transaction is managed by this listener container's Session handling and not by an external transaction coordinator.
 Message receive()
Receive a message synchronously from the default destination, but only wait up to a specified time for delivery.
 Message receive(Destination destination)
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.
 Message receive(String destinationName)
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.
 Object receiveAndConvert()
Receive a message synchronously from the default destination, but only wait up to a specified time for delivery.
 Object receiveAndConvert(Destination destination)
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.
 Object receiveAndConvert(String destinationName)
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.
 Message receiveSelected(Destination destination, String messageSelector)
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.
 Message receiveSelected(String messageSelector)
Receive a message synchronously from the default destination, but only wait up to a specified time for delivery.
 Message receiveSelected(String destinationName, String messageSelector)
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.
 Object receiveSelectedAndConvert(Destination destination, String messageSelector)
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.
 Object receiveSelectedAndConvert(String messageSelector)
Receive a message synchronously from the default destination, but only wait up to a specified time for delivery.
 Object receiveSelectedAndConvert(String destinationName, String messageSelector)
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.
 void send(Destination destination, MessageCreator messageCreator)
Send a message to the specified destination.
 void send(MessageCreator messageCreator)
Send a message to the default destination.
 void send(String destinationName, MessageCreator messageCreator)
Send a message to the specified destination.
 void setDefaultDestination(Destination destination)
Set the destination to be used on send/receive operations that do not have a destination parameter.
 void setDefaultDestinationName(String destinationName)
Set the destination name to be used on send/receive operations that do not have a destination parameter.
 void setDeliveryMode(int deliveryMode)
Set the delivery mode to use when sending a message.
 void setDeliveryPersistent(boolean deliveryPersistent)
Set whether message delivery should be persistent or non-persistent, specified as boolean value ("true" or "false").
 void setExplicitQosEnabled(boolean explicitQosEnabled)
Set if the QOS values (deliveryMode, priority, timeToLive) should be used for sending a message.
 void setMessageConverter(MessageConverter messageConverter)
Set the message converter for this template.
 void setMessageIdEnabled(boolean messageIdEnabled)
Set whether message IDs are enabled.
 void setMessageTimestampEnabled(boolean messageTimestampEnabled)
Set whether message timestamps are enabled.
 void setPriority(int priority)
Set the priority of a message when sending.
 void setPubSubNoLocal(boolean pubSubNoLocal)
Set whether to inhibit the delivery of messages published by its own connection.
 void setReceiveTimeout(long receiveTimeout)
Set the timeout to use for receive calls (in milliseconds).
 void setTimeToLive(long timeToLive)
Set the time-to-live of the message when sending.
Methods inherited from class org.springframework.jms.support.destination.JmsDestinationAccessor
getDestinationResolver, isPubSubDomain, resolveDestinationName, setDestinationResolver, setPubSubDomain
Methods inherited from class org.springframework.jms.support.JmsAccessor
afterPropertiesSet, convertJmsAccessException, createConnection, createSession, getConnectionFactory, getSessionAcknowledgeMode, isClientAcknowledge, isSessionTransacted, setConnectionFactory, setSessionAcknowledgeMode, setSessionAcknowledgeModeName, setSessionTransacted
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

RECEIVE_TIMEOUT_NO_WAIT

public static final long RECEIVE_TIMEOUT_NO_WAIT
Timeout value indicating that a receive operation should check if a message is immediately available without blocking.

See Also:
Constant Field Values

RECEIVE_TIMEOUT_INDEFINITE_WAIT

public static final long RECEIVE_TIMEOUT_INDEFINITE_WAIT
Timeout value indicating a blocking receive without timeout.

See Also:
Constant Field Values
Constructor Detail

JmsTemplate

public JmsTemplate()
Create a new JmsTemplate for bean-style usage.

Note: The ConnectionFactory has to be set before using the instance. This constructor can be used to prepare a JmsTemplate via a BeanFactory, typically setting the ConnectionFactory via setConnectionFactory.

See Also:
JmsAccessor.setConnectionFactory(javax.jms.ConnectionFactory)

JmsTemplate

public JmsTemplate(ConnectionFactory connectionFactory)
Create a new JmsTemplate, given a ConnectionFactory.

Parameters:
connectionFactory - the ConnectionFactory to obtain Connections from
Method Detail

initDefaultStrategies

protected void initDefaultStrategies()
Initialize the default implementations for the template's strategies: DynamicDestinationResolver and SimpleMessageConverter.

See Also:
JmsDestinationAccessor.setDestinationResolver(org.springframework.jms.support.destination.DestinationResolver), setMessageConverter(org.springframework.jms.support.converter.MessageConverter), DynamicDestinationResolver, SimpleMessageConverter

setDefaultDestination

public void setDefaultDestination(Destination destination)
Set the destination to be used on send/receive operations that do not have a destination parameter.

Alternatively, specify a "defaultDestinationName", to be dynamically resolved via the DestinationResolver.

See Also:
send(MessageCreator), convertAndSend(Object), convertAndSend(Object, MessagePostProcessor), setDefaultDestinationName(String)

getDefaultDestination

public Destination getDefaultDestination()
Return the destination to be used on send/receive operations that do not have a destination parameter.

setDefaultDestinationName

public void setDefaultDestinationName(String destinationName)
Set the destination name to be used on send/receive operations that do not have a destination parameter. The specified name will be dynamically resolved via the DestinationResolver.

Alternatively, specify a JMS Destination object as "defaultDestination".

See Also:
send(MessageCreator),
convertAndSend(Object),
convertAndSend(Object, MessagePostProcessor),
JmsDestinationAccessor.setDestinationResolver(org.springframework.jms.support.destination.DestinationResolver),
setDefaultDestination(javax.jms.Destination)

getDefaultDestinationName

public String getDefaultDestinationName()
Return the destination name to be used on send/receive operations that do not have a destination parameter.

setMessageConverter

public void setMessageConverter(MessageConverter messageConverter)
Set the message converter for this template. Used to resolve Object parameters to convertAndSend methods and Object results from receiveAndConvert methods.

The default converter is a SimpleMessageConverter, which is able to handle BytesMessages, TextMessages and ObjectMessages.

See Also:
convertAndSend(java.lang.Object), receiveAndConvert(), SimpleMessageConverter

getMessageConverter

public MessageConverter getMessageConverter()
Return the message converter for this template.

setMessageIdEnabled

public void setMessageIdEnabled(boolean messageIdEnabled)
Set whether message IDs are enabled. Default is "true".

This is only a hint to the JMS producer. See the JMS javadocs for details.

See Also:
MessageProducer.setDisableMessageID(boolean)

isMessageIdEnabled

public boolean isMessageIdEnabled()
Return whether message IDs are enabled.

setMessageTimestampEnabled

public void setMessageTimestampEnabled(boolean messageTimestampEnabled)
Set whether message timestamps are enabled. Default is "true".

This is only a hint to the JMS producer. See the JMS javadocs for details.

See Also:
MessageProducer.setDisableMessageTimestamp(boolean)

isMessageTimestampEnabled

public boolean isMessageTimestampEnabled()
Return whether message timestamps are enabled.

setPubSubNoLocal

public void setPubSubNoLocal(boolean pubSubNoLocal)
Set whether to inhibit the delivery of messages published by its own connection. Default is "false".

See Also:
TopicSession.createSubscriber(javax.jms.Topic, String, boolean)

isPubSubNoLocal

public boolean isPubSubNoLocal()
Return whether to inhibit the delivery of messages published by its own connection.

setReceiveTimeout

public void setReceiveTimeout(long receiveTimeout)
Set the timeout to use for receive calls (in milliseconds).

The default is RECEIVE_TIMEOUT_INDEFINITE_WAIT, which indicates a blocking receive without timeout.

Specify RECEIVE_TIMEOUT_NO_WAIT to inidicate that a receive operation should check if a message is immediately available without blocking.

See Also:
MessageConsumer.receive(long),
MessageConsumer.receive(),
MessageConsumer.receiveNoWait()

getReceiveTimeout

public long getReceiveTimeout()
Return the timeout to use for receive calls (in milliseconds).

setExplicitQosEnabled

public void setExplicitQosEnabled(boolean explicitQosEnabled)
Set if the QOS values (deliveryMode, priority, timeToLive) should be used for sending a message.

See Also:
setDeliveryMode(int), setPriority(int), setTimeToLive(long)

isExplicitQosEnabled

public boolean isExplicitQosEnabled()
If "true", then the values of deliveryMode, priority, and timeToLive will be used when sending a message. Otherwise, the default values, that may be set administratively, will be used.

Returns:
true if overriding default values of QOS parameters (deliveryMode, priority, and timeToLive)
See Also:
setDeliveryMode(int), setPriority(int), setTimeToLive(long)

setDeliveryPersistent

public void setDeliveryPersistent(boolean deliveryPersistent)
Set whether message delivery should be persistent or non-persistent, specified as boolean value ("true" or "false"). This will set the delivery mode accordingly, to either "PERSISTENT" (1) or "NON_PERSISTENT" (2).

Default it "true" aka delivery mode "PERSISTENT".

See Also:
setDeliveryMode(int), DeliveryMode.PERSISTENT, DeliveryMode.NON_PERSISTENT

setDeliveryMode

public void setDeliveryMode(int deliveryMode)
Set the delivery mode to use when sending a message. Default is the Message default: "PERSISTENT".

Since a default value may be defined administratively, this is only used when "isExplicitQosEnabled" equals "true".

Parameters:
deliveryMode - the delivery mode to use
See Also:
isExplicitQosEnabled(), DeliveryMode.PERSISTENT, DeliveryMode.NON_PERSISTENT, Message.DEFAULT_DELIVERY_MODE, MessageProducer.send(javax.jms.Message, int, int, long)

getDeliveryMode

public int getDeliveryMode()
Return the delivery mode to use when sending a message.

setPriority

public void setPriority(int priority)
Set the priority of a message when sending.

Since a default value may be defined administratively, this is only used when "isExplicitQosEnabled" equals "true".

See Also:
isExplicitQosEnabled(), Message.DEFAULT_PRIORITY, MessageProducer.send(javax.jms.Message, int, int, long)

getPriority

public int getPriority()
Return the priority of a message when sending.

setTimeToLive

public void setTimeToLive(long timeToLive)
Set the time-to-live of the message when sending.

Since a default value may be defined administratively, this is only used when "isExplicitQosEnabled" equals "true".

Parameters:
timeToLive - the message's lifetime (in milliseconds)
See Also:
isExplicitQosEnabled(), Message.DEFAULT_TIME_TO_LIVE, MessageProducer.send(javax.jms.Message, int, int, long)

getTimeToLive

public long getTimeToLive()
Return the time-to-live of the message when sending.

execute

public <T> T execute(SessionCallback<T> action)
          throws JmsException
Description copied from interface: JmsOperations
Execute the action specified by the given action object within a JMS Session.

When used with a 1.0.2 provider, you may need to downcast to the appropriate domain implementation, either QueueSession or TopicSession in the action objects doInJms callback method.

Specified by:
execute in interface JmsOperations
Parameters:
action - callback object that exposes the session
Returns:
the result object from working with the session
Throws:
JmsException - if there is any problem

execute

public <T> T execute(SessionCallback<T> action,
                     boolean startConnection)
          throws JmsException
Execute the action specified by the given action object within a JMS Session. Generalized version of execute(SessionCallback), allowing the JMS Connection to be started on the fly.

Use execute(SessionCallback) for the general case. Starting the JMS Connection is just necessary for receiving messages, which is preferably achieved through the receive methods.

Parameters:
action - callback object that exposes the Session
startConnection - whether to start the Connection
Returns:
the result object from working with the Session
Throws:
JmsException - if there is any problem
See Also:
execute(SessionCallback), receive()

execute

public <T> T execute(ProducerCallback<T> action)
          throws JmsException
Description copied from interface: JmsOperations
Send messages to the default JMS destination (or one specified for each send operation). The callback gives access to the JMS Session and MessageProducer in order to perform complex send operations.

Specified by:
execute in interface JmsOperations
Parameters:
action - callback object that exposes the session/producer pair
Returns:
the result object from working with the session
Throws:
JmsException - checked JMSException converted to unchecked

execute

public <T> T execute(Destination destination,
                     ProducerCallback<T> action)
          throws JmsException
Description copied from interface: JmsOperations
Send messages to a JMS destination. The callback gives access to the JMS Session and MessageProducer in order to perform complex send operations.

Specified by:
execute in interface JmsOperations
Parameters:
destination - the destination to send messages to
action - callback object that exposes the session/producer pair
Returns:
the result object from working with the session
Throws:
JmsException - checked JMSException converted to unchecked

execute

public <T> T execute(String destinationName,
                     ProducerCallback<T> action)
          throws JmsException
Description copied from interface: JmsOperations
Send messages to a JMS destination. The callback gives access to the JMS Session and MessageProducer in order to perform complex send operations.

Specified by:
execute in interface JmsOperations
Parameters:
destinationName - the name of the destination to send messages to (to be resolved to an actual destination by a DestinationResolver)
action - callback object that exposes the session/producer pair
Returns:
the result object from working with the session
Throws:
JmsException - checked JMSException converted to unchecked

send

public void send(MessageCreator messageCreator)
          throws JmsException
Description copied from interface: JmsOperations
Send a message to the default destination.

This will only work with a default destination specified!

Specified by:
send in interface JmsOperations
Parameters:
messageCreator - callback to create a message
Throws:
JmsException - checked JMSException converted to unchecked

send

public void send(Destination destination,
                 MessageCreator messageCreator)
          throws JmsException
Description copied from interface: JmsOperations
Send a message to the specified destination. The MessageCreator callback creates the message given a Session.

Specified by:
send in interface JmsOperations
Parameters:
destination - the destination to send this message to
messageCreator - callback to create a message
Throws:
JmsException - checked JMSException converted to unchecked

send

public void send(String destinationName,
                 MessageCreator messageCreator)
          throws JmsException
Description copied from interface: JmsOperations
Send a message to the specified destination. The MessageCreator callback creates the message given a Session.

Specified by:
send in interface JmsOperations
Parameters:
destinationName - the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver)
messageCreator - callback to create a message
Throws:
JmsException - checked JMSException converted to unchecked

doSend

protected void doSend(Session session,
                      Destination destination,
                      MessageCreator messageCreator)
               throws JMSException
Send the given JMS message.

Parameters:
session - the JMS Session to operate on
destination - the JMS Destination to send to
messageCreator - callback to create a JMS Message
Throws:
JMSException - if thrown by JMS API methods

doSend

protected void doSend(MessageProducer producer,
                      Message message)
               throws JMSException
Actually send the given JMS message.

Parameters:
producer - the JMS MessageProducer to send with
message - the JMS Message to send
Throws:
JMSException - if thrown by JMS API methods

convertAndSend

public void convertAndSend(Object message)
                    throws JmsException
Description copied from interface: JmsOperations
Send the given object to the default destination, converting the object to a JMS message with a configured MessageConverter.

This will only work with a default destination specified!

Specified by:
convertAndSend in interface JmsOperations
Parameters:
message - the object to convert to a message
Throws:
JmsException - converted checked JMSException to unchecked

convertAndSend

public void convertAndSend(Destination destination,
                           Object message)
                    throws JmsException
Description copied from interface: JmsOperations
Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter.

Specified by:
convertAndSend in interface JmsOperations
Parameters:
destination - the destination to send this message to
message - the object to convert to a message
Throws:
JmsException - converted checked JMSException to unchecked

convertAndSend

public void convertAndSend(String destinationName,
                           Object message)
                    throws JmsException
Description copied from interface: JmsOperations
Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter.

Specified by:
convertAndSend in interface JmsOperations
Parameters:
destinationName - the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver)
message - the object to convert to a message
Throws:
JmsException - checked JMSException converted to unchecked

convertAndSend

public void convertAndSend(Object message,
                           MessagePostProcessor postProcessor)
                    throws JmsException
Description copied from interface: JmsOperations
Send the given object to the default destination, converting the object to a JMS message with a configured MessageConverter. The MessagePostProcessor callback allows for modification of the message after conversion.

This will only work with a default destination specified!

Specified by:
convertAndSend in interface JmsOperations
Parameters:
message - the object to convert to a message
postProcessor - the callback to modify the message
Throws:
JmsException - checked JMSException converted to unchecked

convertAndSend

public void convertAndSend(Destination destination,
                           Object message,
                           MessagePostProcessor postProcessor)
                    throws JmsException
Description copied from interface: JmsOperations
Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter. The MessagePostProcessor callback allows for modification of the message after conversion.

Specified by:
convertAndSend in interface JmsOperations
Parameters:
destination - the destination to send this message to
message - the object to convert to a message
postProcessor - the callback to modify the message
Throws:
JmsException - checked JMSException converted to unchecked

convertAndSend

public void convertAndSend(String destinationName,
                           Object message,
                           MessagePostProcessor postProcessor)
                    throws JmsException
Description copied from interface: JmsOperations
Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter. The MessagePostProcessor callback allows for modification of the message after conversion.

Specified by:
convertAndSend in interface JmsOperations
Parameters:
destinationName - the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver)
message - the object to convert to a message.
postProcessor - the callback to modify the message
Throws:
JmsException - checked JMSException converted to unchecked

receive

public Message receive()
                throws JmsException
Description copied from interface: JmsOperations
Receive a message synchronously from the default destination, but only wait up to a specified time for delivery.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

This will only work with a default destination specified!

Specified by:
receive in interface JmsOperations
Returns:
the message received by the consumer, or null if the timeout expires
Throws:
JmsException - checked JMSException converted to unchecked

receive

public Message receive(Destination destination)
                throws JmsException
Description copied from interface: JmsOperations
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

Specified by:
receive in interface JmsOperations
Parameters:
destination - the destination to receive a message from
Returns:
the message received by the consumer, or null if the timeout expires
Throws:
JmsException - checked JMSException converted to unchecked

receive

public Message receive(String destinationName)
                throws JmsException
Description copied from interface: JmsOperations
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

Specified by:
receive in interface JmsOperations
Parameters:
destinationName - the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver)
Returns:
the message received by the consumer, or null if the timeout expires
Throws:
JmsException - checked JMSException converted to unchecked

receiveSelected

public Message receiveSelected(String messageSelector)
                        throws JmsException
Description copied from interface: JmsOperations
Receive a message synchronously from the default destination, but only wait up to a specified time for delivery.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

This will only work with a default destination specified!

Specified by:
receiveSelected in interface JmsOperations
Parameters:
messageSelector - the JMS message selector expression (or null if none). See the JMS specification for a detailed definition of selector expressions.
Returns:
the message received by the consumer, or null if the timeout expires
Throws:
JmsException - checked JMSException converted to unchecked

receiveSelected

public Message receiveSelected(Destination destination,
                               String messageSelector)
                        throws JmsException
Description copied from interface: JmsOperations
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

Specified by:
receiveSelected in interface JmsOperations
Parameters:
destination - the destination to receive a message from
messageSelector - the JMS message selector expression (or null if none). See the JMS specification for a detailed definition of selector expressions.
Returns:
the message received by the consumer, or null if the timeout expires
Throws:
JmsException - checked JMSException converted to unchecked

receiveSelected

public Message receiveSelected(String destinationName,
                               String messageSelector)
                        throws JmsException
Description copied from interface: JmsOperations
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

Specified by:
receiveSelected in interface JmsOperations
Parameters:
destinationName - the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver)
messageSelector - the JMS message selector expression (or null if none). See the JMS specification for a detailed definition of selector expressions.
Returns:
the message received by the consumer, or null if the timeout expires
Throws:
JmsException - checked JMSException converted to unchecked

doReceive

protected Message doReceive(Session session,
                            Destination destination,
                            String messageSelector)
                     throws JMSException
Receive a JMS message.

Parameters:
session - the JMS Session to operate on
destination - the JMS Destination to receive from
messageSelector - the message selector for this consumer (can be null)
Returns:
the JMS Message received, or null if none
Throws:
JMSException - if thrown by JMS API methods

doReceive

protected Message doReceive(Session session,
                            MessageConsumer consumer)
                     throws JMSException
Actually receive a JMS message.

Parameters:
session - the JMS Session to operate on
consumer - the JMS MessageConsumer to receive with
Returns:
the JMS Message received, or null if none
Throws:
JMSException - if thrown by JMS API methods

receiveAndConvert

public Object receiveAndConvert()
                         throws JmsException
Description copied from interface: JmsOperations
Receive a message synchronously from the default destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured MessageConverter.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

This will only work with a default destination specified!

Specified by:
receiveAndConvert in interface JmsOperations
Returns:
the message produced for the consumer or null if the timeout expires.
Throws:
JmsException - checked JMSException converted to unchecked

receiveAndConvert

public Object receiveAndConvert(Destination destination)
                         throws JmsException
Description copied from interface: JmsOperations
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured MessageConverter.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

Specified by:
receiveAndConvert in interface JmsOperations
Parameters:
destination - the destination to receive a message from
Returns:
the message produced for the consumer or null if the timeout expires.
Throws:
JmsException - checked JMSException converted to unchecked

receiveAndConvert

public Object receiveAndConvert(String destinationName)
                         throws JmsException
Description copied from interface: JmsOperations
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured MessageConverter.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

Specified by:
receiveAndConvert in interface JmsOperations
Parameters:
destinationName - the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver)
Returns:
the message produced for the consumer or null if the timeout expires.
Throws:
JmsException - checked JMSException converted to unchecked

receiveSelectedAndConvert

public Object receiveSelectedAndConvert(String messageSelector)
                                 throws JmsException
Description copied from interface: JmsOperations
Receive a message synchronously from the default destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured MessageConverter.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

This will only work with a default destination specified!

Specified by:
receiveSelectedAndConvert in interface JmsOperations
Parameters:
messageSelector - the JMS message selector expression (or null if none). See the JMS specification for a detailed definition of selector expressions.
Returns:
the message produced for the consumer or null if the timeout expires.
Throws:
JmsException - checked JMSException converted to unchecked

receiveSelectedAndConvert

public Object receiveSelectedAndConvert(Destination destination,
                                        String messageSelector)
                                 throws JmsException
Description copied from interface: JmsOperations
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured MessageConverter.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

Specified by:
receiveSelectedAndConvert in interface JmsOperations
Parameters:
destination - the destination to receive a message from
messageSelector - the JMS message selector expression (or null if none). See the JMS specification for a detailed definition of selector expressions.
Returns:
the message produced for the consumer or null if the timeout expires.
Throws:
JmsException - checked JMSException converted to unchecked

receiveSelectedAndConvert

public Object receiveSelectedAndConvert(String destinationName,
                                        String messageSelector)
                                 throws JmsException
Description copied from interface: JmsOperations
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured MessageConverter.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

Specified by:
receiveSelectedAndConvert in interface JmsOperations
Parameters:
destinationName - the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver)
messageSelector - the JMS message selector expression (or null if none). See the JMS specification for a detailed definition of selector expressions.
Returns:
the message produced for the consumer or null if the timeout expires.
Throws:
JmsException - checked JMSException converted to unchecked

doConvertFromMessage

protected Object doConvertFromMessage(Message message)
Extract the content from the given JMS message.

Parameters:
message - the JMS Message to convert (can be null)
Returns:
the content of the message, or null if none

browse

public <T> T browse(BrowserCallback<T> action)
         throws JmsException
Description copied from interface: JmsOperations
Browse messages in the default JMS queue. The callback gives access to the JMS Session and QueueBrowser in order to browse the queue and react to the contents.

Specified by:
browse in interface JmsOperations
Parameters:
action - callback object that exposes the session/browser pair
Returns:
the result object from working with the session
Throws:
JmsException - checked JMSException converted to unchecked

browse

public <T> T browse(Queue queue,
                    BrowserCallback<T> action)
         throws JmsException
Description copied from interface: JmsOperations
Browse messages in a JMS queue. The callback gives access to the JMS Session and QueueBrowser in order to browse the queue and react to the contents.

Specified by:
browse in interface JmsOperations
Parameters:
queue - the queue to browse
action - callback object that exposes the session/browser pair
Returns:
the result object from working with the session
Throws:
JmsException - checked JMSException converted to unchecked

browse

public <T> T browse(String queueName,
                    BrowserCallback<T> action)
         throws JmsException
Description copied from interface: JmsOperations
Browse messages in a JMS queue. The callback gives access to the JMS Session and QueueBrowser in order to browse the queue and react to the contents.

Specified by:
browse in interface JmsOperations
Parameters:
queueName - the name of the queue to browse (to be resolved to an actual destination by a DestinationResolver)
action - callback object that exposes the session/browser pair
Returns:
the result object from working with the session
Throws:
JmsException - checked JMSException converted to unchecked

browseSelected

public <T> T browseSelected(String messageSelector,
                            BrowserCallback<T> action)
                 throws JmsException
Description copied from interface: JmsOperations
Browse selected messages in a JMS queue. The callback gives access to the JMS Session and QueueBrowser in order to browse the queue and react to the contents.

Specified by:
browseSelected in interface JmsOperations
Parameters:
messageSelector - the JMS message selector expression (or null if none). See the JMS specification for a detailed definition of selector expressions.
action - callback object that exposes the session/browser pair
Returns:
the result object from working with the session
Throws:
JmsException - checked JMSException converted to unchecked

browseSelected

public <T> T browseSelected(Queue queue,
                            String messageSelector,
                            BrowserCallback<T> action)
                 throws JmsException
Description copied from interface: JmsOperations
Browse selected messages in a JMS queue. The callback gives access to the JMS Session and QueueBrowser in order to browse the queue and react to the contents.

Specified by:
browseSelected in interface JmsOperations
Parameters:
queue - the queue to browse
messageSelector - the JMS message selector expression (or null if none). See the JMS specification for a detailed definition of selector expressions.
action - callback object that exposes the session/browser pair
Returns:
the result object from working with the session
Throws:
JmsException - checked JMSException converted to unchecked

browseSelected

public <T> T browseSelected(String queueName,
                            String messageSelector,
                            BrowserCallback<T> action)
                 throws JmsException
Description copied from interface: JmsOperations
Browse selected messages in a JMS queue. The callback gives access to the JMS Session and QueueBrowser in order to browse the queue and react to the contents.

Specified by:
browseSelected in interface JmsOperations
Parameters:
queueName - the name of the queue to browse (to be resolved to an actual destination by a DestinationResolver)
messageSelector - the JMS message selector expression (or null if none). See the JMS specification for a detailed definition of selector expressions.
action - callback object that exposes the session/browser pair
Returns:
the result object from working with the session
Throws:
JmsException - checked JMSException converted to unchecked

getConnection

protected Connection getConnection(JmsResourceHolder holder)
Fetch an appropriate Connection from the given JmsResourceHolder.

This implementation accepts any JMS 1.1 Connection.

Parameters:
holder - the JmsResourceHolder
Returns:
an appropriate Connection fetched from the holder, or null if none found

getSession

protected Session getSession(JmsResourceHolder holder)
Fetch an appropriate Session from the given JmsResourceHolder.

This implementation accepts any JMS 1.1 Session.

Parameters:
holder - the JmsResourceHolder
Returns:
an appropriate Session fetched from the holder, or null if none found

isSessionLocallyTransacted

protected boolean isSessionLocallyTransacted(Session session)
Check whether the given Session is locally transacted, that is, whether its transaction is managed by this listener container's Session handling and not by an external transaction coordinator.

Note: The Session's own transacted flag will already have been checked before. This method is about finding out whether the Session's transaction is local or externally coordinated.

Parameters:
session - the Session to check
Returns:
whether the given Session is locally transacted
See Also:
JmsAccessor.isSessionTransacted(), ConnectionFactoryUtils.isSessionTransactional(javax.jms.Session, javax.jms.ConnectionFactory)

createProducer

protected MessageProducer createProducer(Session session,
                                         Destination destination)
                                  throws JMSException
Create a JMS MessageProducer for the given Session and Destination, configuring it to disable message ids and/or timestamps (if necessary).

Delegates to doCreateProducer(javax.jms.Session, javax.jms.Destination) for creation of the raw JMS MessageProducer, which needs to be specific to JMS 1.1 or 1.0.2.

Parameters:
session - the JMS Session to create a MessageProducer for
destination - the JMS Destination to create a MessageProducer for
Returns:
the new JMS MessageProducer
Throws:
JMSException - if thrown by JMS API methods
See Also:
setMessageIdEnabled(boolean), setMessageTimestampEnabled(boolean)

doCreateProducer

protected MessageProducer doCreateProducer(Session session,
                                           Destination destination)
                                    throws JMSException
Create a raw JMS MessageProducer for the given Session and Destination.

This implementation uses JMS 1.1 API.

Parameters:
session - the JMS Session to create a MessageProducer for
destination - the JMS Destination to create a MessageProducer for
Returns:
the new JMS MessageProducer
Throws:
JMSException - if thrown by JMS API methods

createConsumer

protected MessageConsumer createConsumer(Session session,
                                         Destination destination,
                                         String messageSelector)
                                  throws JMSException
Create a JMS MessageConsumer for the given Session and Destination.

This implementation uses JMS 1.1 API.

Parameters:
session - the JMS Session to create a MessageConsumer for
destination - the JMS Destination to create a MessageConsumer for
messageSelector - the message selector for this consumer (can be null)
Returns:
the new JMS MessageConsumer
Throws:
JMSException - if thrown by JMS API methods

createBrowser

protected QueueBrowser createBrowser(Session session,
                                     Queue queue,
                                     String messageSelector)
                              throws JMSException
Create a JMS MessageProducer for the given Session and Destination, configuring it to disable message ids and/or timestamps (if necessary).

Delegates to doCreateProducer(javax.jms.Session, javax.jms.Destination) for creation of the raw JMS MessageProducer, which needs to be specific to JMS 1.1 or 1.0.2.

Parameters:
session - the JMS Session to create a QueueBrowser for
queue - the JMS Queue to create a QueueBrowser for
messageSelector - the message selector for this consumer (can be null)
Returns:
the new JMS QueueBrowser
Throws:
JMSException - if thrown by JMS API methods
See Also:
setMessageIdEnabled(boolean), setMessageTimestampEnabled(boolean)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JmsTemplate102

org.springframework.jms.core
Class JmsTemplate102

java.lang.Object
    extended by  org.springframework.jms.support.JmsAccessor
        extended by  org.springframework.jms.support.destination.JmsDestinationAccessor
            extended by  org.springframework.jms.core.JmsTemplate
                extended by  org.springframework.jms.core.JmsTemplate102
All Implemented Interfaces:
InitializingBean, JmsOperations
Deprecated. as of Spring 3.0, in favor of the JMS 1.1 based JmsTemplate

@Deprecated
public class JmsTemplate102
extends JmsTemplate

A subclass of JmsTemplate for the JMS 1.0.2 specification, not relying on JMS 1.1 methods like JmsTemplate itself. This class can be used for JMS 1.0.2 providers, offering the same API as JmsTemplate does for JMS 1.1 providers.

You must specify the domain (or style) of messaging to be either Point-to-Point (Queues) or Publish/Subscribe (Topics), using the "pubSubDomain" property. Point-to-Point (Queues) is the default domain.

The "pubSubDomain" property is an important setting due to the use of similar but separate class hierarchies in the JMS 1.0.2 API. JMS 1.1 provides a new domain-independent API that allows for easy mix-and-match use of Point-to-Point and Publish/Subscribe styles.

This template uses a DynamicDestinationResolver and a SimpleMessageConverter102 as default strategies for resolving a destination name and converting a message, respectively.

Since:
1.1
Author:
Mark Pollack, Juergen Hoeller
See Also:
JmsAccessor.setConnectionFactory(javax.jms.ConnectionFactory), JmsDestinationAccessor.setPubSubDomain(boolean), Queue, Topic, QueueSession, TopicSession, QueueSender, TopicPublisher, QueueReceiver, TopicSubscriber

Field Summary
Fields inherited from class org.springframework.jms.core.JmsTemplate
RECEIVE_TIMEOUT_INDEFINITE_WAIT, RECEIVE_TIMEOUT_NO_WAIT
Fields inherited from class org.springframework.jms.support.JmsAccessor
logger
Constructor Summary
JmsTemplate102()
Deprecated. Create a new JmsTemplate102 for bean-style usage.
JmsTemplate102(ConnectionFactory connectionFactory, boolean pubSubDomain)
Deprecated. Create a new JmsTemplate102, given a ConnectionFactory.
Method Summary
void | afterPropertiesSet() Deprecated. In addition to checking if the connection factory is set, make sure that the supplied connection factory is of the appropriate type for the specified destination type: QueueConnectionFactory for queues, and TopicConnectionFactory for topics.
protected QueueBrowser | createBrowser(Session session, Queue queue, String messageSelector) Deprecated. Create a JMS MessageProducer for the given Session and Destination, configuring it to disable message ids and/or timestamps (if necessary).
protected Connection | createConnection() Deprecated. This implementation overrides the superclass method to use JMS 1.0.2 API.
protected MessageConsumer | createConsumer(Session session, Destination destination, String messageSelector) Deprecated. This implementation overrides the superclass method to use JMS 1.0.2 API.
protected Session | createSession(Connection con) Deprecated. This implementation overrides the superclass method to use JMS 1.0.2 API.
protected MessageProducer | doCreateProducer(Session session, Destination destination) Deprecated. This implementation overrides the superclass method to use JMS 1.0.2 API.
protected void | doSend(MessageProducer producer, Message message) Deprecated. This implementation overrides the superclass method to use JMS 1.0.2 API.
protected Connection | getConnection(JmsResourceHolder holder) Deprecated. This implementation overrides the superclass method to accept either a QueueConnection or a TopicConnection, depending on the domain.
protected Session | getSession(JmsResourceHolder holder) Deprecated. This implementation overrides the superclass method to accept either a QueueSession or a TopicSession, depending on the domain.
protected void | initDefaultStrategies() Deprecated. Initialize the default implementations for the template's strategies: DynamicDestinationResolver and SimpleMessageConverter102.
protected boolean | isClientAcknowledge(Session session) Deprecated. This implementation overrides the superclass method to avoid using JMS 1.1's Session getAcknowledgeMode() method.
Methods inherited from class org.springframework.jms.core.JmsTemplate
browse, browse, browse, browseSelected, browseSelected, browseSelected, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, createProducer, doConvertFromMessage, doReceive, doReceive, doSend, execute, execute, execute, execute, execute, getDefaultDestination, getDefaultDestinationName, getDeliveryMode, getMessageConverter, getPriority, getReceiveTimeout, getTimeToLive, isExplicitQosEnabled, isMessageIdEnabled, isMessageTimestampEnabled, isPubSubNoLocal, isSessionLocallyTransacted, receive, receive, receive, receiveAndConvert, receiveAndConvert, receiveAndConvert, receiveSelected, receiveSelected, receiveSelected, receiveSelectedAndConvert, receiveSelectedAndConvert, receiveSelectedAndConvert, send, send, send, setDefaultDestination, setDefaultDestinationName, setDeliveryMode, setDeliveryPersistent, setExplicitQosEnabled, setMessageConverter, setMessageIdEnabled, setMessageTimestampEnabled, setPriority, setPubSubNoLocal, setReceiveTimeout, setTimeToLive
Methods inherited from class org.springframework.jms.support.destination.JmsDestinationAccessor
getDestinationResolver, isPubSubDomain, resolveDestinationName, setDestinationResolver, setPubSubDomain
Methods inherited from class org.springframework.jms.support.JmsAccessor
convertJmsAccessException, getConnectionFactory, getSessionAcknowledgeMode, isSessionTransacted, setConnectionFactory, setSessionAcknowledgeMode, setSessionAcknowledgeModeName, setSessionTransacted
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JmsTemplate102

public JmsTemplate102()
Deprecated.
Create a new JmsTemplate102 for bean-style usage.

Note: The ConnectionFactory has to be set before using the instance. This constructor can be used to prepare a JmsTemplate via a BeanFactory, typically setting the ConnectionFactory via setConnectionFactory.

See Also:
JmsAccessor.setConnectionFactory(javax.jms.ConnectionFactory)

JmsTemplate102

public JmsTemplate102(ConnectionFactory connectionFactory,
                      boolean pubSubDomain)
Deprecated.
Create a new JmsTemplate102, given a ConnectionFactory.

Parameters:
connectionFactory - the ConnectionFactory to obtain Connections from
pubSubDomain - whether the Publish/Subscribe domain (Topics) or Point-to-Point domain (Queues) should be used
See Also:
JmsDestinationAccessor.setPubSubDomain(boolean)
Method Detail

initDefaultStrategies

protected void initDefaultStrategies()
Deprecated.
Initialize the default implementations for the template's strategies: DynamicDestinationResolver and SimpleMessageConverter102.

Overrides:
initDefaultStrategies in class JmsTemplate
See Also:
JmsDestinationAccessor.setDestinationResolver(org.springframework.jms.support.destination.DestinationResolver), JmsTemplate.setMessageConverter(org.springframework.jms.support.converter.MessageConverter), DynamicDestinationResolver, SimpleMessageConverter102

afterPropertiesSet

public void afterPropertiesSet()
Deprecated.
In addition to checking if the connection factory is set, make sure that the supplied connection factory is of the appropriate type for the specified destination type: QueueConnectionFactory for queues, and TopicConnectionFactory for topics.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class JmsAccessor

getConnection

protected Connection getConnection(JmsResourceHolder holder)
Deprecated.
This implementation overrides the superclass method to accept either a QueueConnection or a TopicConnection, depending on the domain.

Overrides:
getConnection in class JmsTemplate
Parameters:
holder - the JmsResourceHolder
Returns:
an appropriate Connection fetched from the holder, or null if none found

getSession

protected Session getSession(JmsResourceHolder holder)
Deprecated.
This implementation overrides the superclass method to accept either a QueueSession or a TopicSession, depending on the domain.

Overrides:
getSession in class JmsTemplate
Parameters:
holder - the JmsResourceHolder
Returns:
an appropriate Session fetched from the holder, or null if none found

createConnection

protected Connection createConnection()
                               throws JMSException
Deprecated.
This implementation overrides the superclass method to use JMS 1.0.2 API.

Overrides:
createConnection in class JmsAccessor
Returns:
the new JMS Connection
Throws:
JMSException - if thrown by JMS API methods
See Also:
ConnectionFactory.createConnection()

createSession

protected Session createSession(Connection con)
                         throws JMSException
Deprecated.
This implementation overrides the superclass method to use JMS 1.0.2 API.

Overrides:
createSession in class JmsAccessor
Parameters:
con - the JMS Connection to create a Session for
Returns:
the new JMS Session
Throws:
JMSException - if thrown by JMS API methods
See Also:
Connection.createSession(boolean, int)

doCreateProducer

protected MessageProducer doCreateProducer(Session session,
                                           Destination destination)
                                    throws JMSException
Deprecated.
This implementation overrides the superclass method to use JMS 1.0.2 API.

Overrides:
doCreateProducer in class JmsTemplate
Parameters:
session - the JMS Session to create a MessageProducer for
destination - the JMS Destination to create a MessageProducer for
Returns:
the new JMS MessageProducer
Throws:
JMSException - if thrown by JMS API methods

createConsumer

protected MessageConsumer createConsumer(Session session,
                                         Destination destination,
                                         String messageSelector)
                                  throws JMSException
Deprecated.
This implementation overrides the superclass method to use JMS 1.0.2 API.

Overrides:
createConsumer in class JmsTemplate
Parameters:
session - the JMS Session to create a MessageConsumer for
destination - the JMS Destination to create a MessageConsumer for
messageSelector - the message selector for this consumer (can be null)
Returns:
the new JMS MessageConsumer
Throws:
JMSException - if thrown by JMS API methods

createBrowser

protected QueueBrowser createBrowser(Session session,
                                     Queue queue,
                                     String messageSelector)
                              throws JMSException
Deprecated.
Description copied from class: JmsTemplate
Create a JMS MessageProducer for the given Session and Destination, configuring it to disable message ids and/or timestamps (if necessary).

Delegates to JmsTemplate.doCreateProducer(javax.jms.Session, javax.jms.Destination) for creation of the raw JMS MessageProducer, which needs to be specific to JMS 1.1 or 1.0.2.

Overrides:
createBrowser in class JmsTemplate
Parameters:
session - the JMS Session to create a QueueBrowser for
queue - the JMS Queue to create a QueueBrowser for
messageSelector - the message selector for this consumer (can be null)
Returns:
the new JMS QueueBrowser
Throws:
JMSException - if thrown by JMS API methods
See Also:
JmsTemplate.setMessageIdEnabled(boolean), JmsTemplate.setMessageTimestampEnabled(boolean)

doSend

protected void doSend(MessageProducer producer,
                      Message message)
               throws JMSException
Deprecated.
This implementation overrides the superclass method to use JMS 1.0.2 API.

Overrides:
doSend in class JmsTemplate
Parameters:
producer - the JMS MessageProducer to send with
message - the JMS Message to send
Throws:
JMSException - if thrown by JMS API methods

isClientAcknowledge

protected boolean isClientAcknowledge(Session session)
                               throws JMSException
Deprecated.
This implementation overrides the superclass method to avoid using JMS 1.1's Session getAcknowledgeMode() method. The best we can do here is to check the setting on the template.

Overrides:
isClientAcknowledge in class JmsAccessor
Parameters:
session - the JMS Session to check
Returns:
whether the given Session is in client acknowledge mode
Throws:
JMSException - if thrown by JMS API methods
See Also:
JmsAccessor.getSessionAcknowledgeMode()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.jms.core.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jms.core.support

Classes supporting the org.springframework.jms.core package.

See:
Description

Class Summary
JmsGatewaySupport Convenient super class for application classes that need JMS access.

Package org.springframework.jms.core.support Description

Classes supporting the org.springframework.jms.core package. Contains a base class for JmsTemplate usage.


org.springframework.jms.core.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jms.core.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jms.core.support.JmsGatewaySupport (implements org.springframework.beans.factory.InitializingBean)


JmsGatewaySupport

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jms.core.support
Class JmsGatewaySupport

java.lang.Object
    extended by  org.springframework.jms.core.support.JmsGatewaySupport
All Implemented Interfaces:
InitializingBean
public abstract class JmsGatewaySupport
extends Object
implements InitializingBean

Convenient super class for application classes that need JMS access.

Requires a ConnectionFactory or a JmsTemplate instance to be set. It will create its own JmsTemplate if a ConnectionFactory is passed in. A custom JmsTemplate instance can be created for a given ConnectionFactory through overriding the createJmsTemplate(javax.jms.ConnectionFactory) method.

Since:
1.1.1
Author:
Mark Pollack
See Also:
setConnectionFactory(javax.jms.ConnectionFactory),
setJmsTemplate(org.springframework.jms.core.JmsTemplate),
createJmsTemplate(javax.jms.ConnectionFactory),
JmsTemplate

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
JmsGatewaySupport()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected JmsTemplate | createJmsTemplate(ConnectionFactory connectionFactory) Create a JmsTemplate for the given ConnectionFactory.
ConnectionFactory | getConnectionFactory() Return the JMS ConnectionFactory used by the gateway.
JmsTemplate | getJmsTemplate() Return the JmsTemplate for the gateway.
protected void | initGateway() Subclasses can override this for custom initialization behavior.
void | setConnectionFactory(ConnectionFactory connectionFactory) Set the JMS connection factory to be used by the gateway.
void | setJmsTemplate(JmsTemplate jmsTemplate) Set the JmsTemplate for the gateway.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

JmsGatewaySupport

public JmsGatewaySupport()
Method Detail

setConnectionFactory

public final void setConnectionFactory(ConnectionFactory connectionFactory)
Set the JMS connection factory to be used by the gateway. Will automatically create a JmsTemplate for the given ConnectionFactory.

Parameters:
connectionFactory -
See Also:
createJmsTemplate(javax.jms.ConnectionFactory), setConnectionFactory(javax.jms.ConnectionFactory)

createJmsTemplate

protected JmsTemplate createJmsTemplate(ConnectionFactory connectionFactory)
Create a JmsTemplate for the given ConnectionFactory. Only invoked if populating the gateway with a ConnectionFactory reference.

Can be overridden in subclasses to provide a JmsTemplate instance with a different configuration or the JMS 1.0.2 version, JmsTemplate102.

Parameters:
connectionFactory - the JMS ConnectionFactory to create a JmsTemplate for
Returns:
the new JmsTemplate instance
See Also:
setConnectionFactory(javax.jms.ConnectionFactory), JmsTemplate102

getConnectionFactory

public final ConnectionFactory getConnectionFactory()
Return the JMS ConnectionFactory used by the gateway.

setJmsTemplate

public final void setJmsTemplate(JmsTemplate jmsTemplate)
Set the JmsTemplate for the gateway.

Parameters:
jmsTemplate -
See Also:
setConnectionFactory(javax.jms.ConnectionFactory)

getJmsTemplate

public final JmsTemplate getJmsTemplate()
Return the JmsTemplate for the gateway.

afterPropertiesSet

public final void afterPropertiesSet()
                              throws IllegalArgumentException,
                                     BeanInitializationException
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
IllegalArgumentException
BeanInitializationException

initGateway

protected void initGateway()
                    throws Exception
Subclasses can override this for custom initialization behavior. Gets called after population of this instance's bean properties.

Throws:
Exception - if initialization fails
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jms.listener

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jms.listener

This package contains the base message listener container facility.

See:
Description

Interface Summary
SessionAwareMessageListener<M extends Message> | Variant of the standard JMS MessageListener interface, offering not only the received Message but also the underlying JMS Session object.
SubscriptionNameProvider | Interface to be implemented by message listener objects that suggest a specific name for a durable subscription that they might be registered with.

Class Summary
AbstractJmsListeningContainer | Common base class for all containers which need to implement listening based on a JMS Connection (either shared or freshly obtained for each attempt).
AbstractMessageListenerContainer | Abstract base class for message listener containers.
AbstractPollingMessageListenerContainer | Base class for listener container implementations which are based on polling.
DefaultMessageListenerContainer | Message listener container variant that uses plain JMS client API, specifically a loop of MessageConsumer.receive() calls that also allow for transactional reception of messages (registering them with XA transactions).
DefaultMessageListenerContainer102 | Deprecated. as of Spring 3.0, in favor of the JMS 1.1 based DefaultMessageListenerContainer
SimpleMessageListenerContainer | Message listener container that uses the plain JMS client API's MessageConsumer.setMessageListener() method to create concurrent MessageConsumers for the specified listeners.
SimpleMessageListenerContainer102 | Deprecated. as of Spring 3.0, in favor of the JMS 1.1 based SimpleMessageListenerContainer

Exception Summary
AbstractJmsListeningContainer.SharedConnectionNotInitializedException Exception that indicates that the initial setup of this container's shared JMS Connection failed.

Package org.springframework.jms.listener Description

This package contains the base message listener container facility. It also offers the DefaultMessageListenerContainer and SimpleMessageListenerContainer implementations, based on the plain JMS client API.


org.springframework.jms.listener Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jms.listener

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jms.support.JmsAccessor (implements org.springframework.beans.factory.InitializingBean)
      • org.springframework.jms.support.destination.JmsDestinationAccessor
        • org.springframework.jms.listener.AbstractJmsListeningContainer (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.context.SmartLifecycle)
          • org.springframework.jms.listener.AbstractMessageListenerContainer
            • org.springframework.jms.listener.AbstractPollingMessageListenerContainer (implements org.springframework.beans.factory.BeanNameAware)
              • org.springframework.jms.listener.DefaultMessageListenerContainer
                • org.springframework.jms.listener.DefaultMessageListenerContainer102
            • org.springframework.jms.listener.SimpleMessageListenerContainer (implements javax.jms.ExceptionListener)
              • org.springframework.jms.listener.SimpleMessageListenerContainer102
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.jms.listener.AbstractJmsListeningContainer.SharedConnectionNotInitializedException

Interface Hierarchy

  • org.springframework.jms.listener.SessionAwareMessageListener<M>
  • org.springframework.jms.listener.SubscriptionNameProvider


SessionAwareMessageListener

org.springframework.jms.listener
Interface SessionAwareMessageListener<M extends Message>

All Known Implementing Classes:
JmsInvokerServiceExporter, MessageListenerAdapter, MessageListenerAdapter102
public interface SessionAwareMessageListener<M extends Message>

Variant of the standard JMS MessageListener interface, offering not only the received Message but also the underlying JMS Session object. The latter can be used to send reply messages, without the need to access an external Connection/Session, i.e. without the need to access the underlying ConnectionFactory.

Supported by Spring's DefaultMessageListenerContainer and SimpleMessageListenerContainer, as direct alternative to the standard JMS MessageListener interface. Typically not supported by JCA-based listener containers: For maximum compatibility, implement a standard JMS MessageListener instead.

Since:
2.0
Author:
Juergen Hoeller
See Also:
AbstractMessageListenerContainer.setMessageListener(java.lang.Object), DefaultMessageListenerContainer, SimpleMessageListenerContainer, JmsMessageEndpointManager, MessageListener

Method Summary
 void onMessage(M message, Session session)
Callback for processing a received JMS message.

Method Detail

onMessage

void onMessage(M message,
               Session session)
               throws JMSException
Callback for processing a received JMS message.

Implementors are supposed to process the given Message, typically sending reply messages through the given Session.

Parameters:
message - the received JMS message (never null)
session - the underlying JMS Session (never null)
Throws:
JMSException - if thrown by JMS methods
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SubscriptionNameProvider

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jms.listener
Interface SubscriptionNameProvider

All Known Implementing Classes:
MessageListenerAdapter, MessageListenerAdapter102
public interface SubscriptionNameProvider

Interface to be implemented by message listener objects that suggest a specific name for a durable subscription that they might be registered with. Otherwise the listener class name will be used as a default subscription name.

Applies to MessageListener objects as well as to SessionAwareMessageListener objects and plain listener methods (as supported by MessageListenerAdapter.

Since:
2.5.6
Author:
Juergen Hoeller

Method Summary
 String getSubscriptionName()
Determine the subscription name for this message listener object.

Method Detail

getSubscriptionName

String getSubscriptionName()
Determine the subscription name for this message listener object.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractJmsListeningContainer

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jms.listener
Class AbstractJmsListeningContainer

java.lang.Object
    extended by  org.springframework.jms.support.JmsAccessor
        extended by  org.springframework.jms.support.destination.JmsDestinationAccessor
            extended by  org.springframework.jms.listener.AbstractJmsListeningContainer
All Implemented Interfaces:
BeanNameAware, DisposableBean, InitializingBean, Lifecycle, Phased, SmartLifecycle
Direct Known Subclasses:
AbstractMessageListenerContainer
public abstract class AbstractJmsListeningContainer
extends JmsDestinationAccessor
implements SmartLifecycle, BeanNameAware, DisposableBean

Common base class for all containers which need to implement listening based on a JMS Connection (either shared or freshly obtained for each attempt). Inherits basic Connection and Session configuration handling from the JmsAccessor base class.

This class provides basic lifecycle management, in particular management of a shared JMS Connection. Subclasses are supposed to plug into this lifecycle, implementing the sharedConnectionEnabled() as well as the doInitialize() and doShutdown() template methods.

This base class does not assume any specific listener programming model or listener invoker mechanism. It just provides the general runtime lifecycle management needed for any kind of JMS-based listening mechanism that operates on a JMS Connection/Session.

For a concrete listener programming model, check out the AbstractMessageListenerContainer subclass. For a concrete listener invoker mechanism, check out the DefaultMessageListenerContainer class.

Since:
2.0.3
Author:
Juergen Hoeller
See Also:
sharedConnectionEnabled(),
doInitialize(),
doShutdown()

Nested Class Summary
static class AbstractJmsListeningContainer.SharedConnectionNotInitializedException
Exception that indicates that the initial setup of this container's shared JMS Connection failed.
Field Summary
protected Object | lifecycleMonitor
protected Object | sharedConnectionMonitor
Fields inherited from class org.springframework.jms.support.JmsAccessor
logger
Constructor Summary
AbstractJmsListeningContainer()
Method Summary
 void afterPropertiesSet()
Delegates to validateConfiguration() and initialize().
protected  Connection createSharedConnection()
Create a shared Connection for this container.
 void destroy()
Calls shutdown() when the BeanFactory destroys the container instance.
protected abstract  void doInitialize()
Register any invokers within this container.
protected  void doRescheduleTask(Object task)
Reschedule the given task object immediately.
protected abstract  void doShutdown()
Close the registered invokers.
protected  void doStart()
Start the shared Connection, if any, and notify all invoker tasks.
protected  void doStop()
Notify all invoker tasks and stop the shared Connection, if any.
protected  void establishSharedConnection()
Establish a shared Connection for this container.
protected  String getBeanName()
Return the bean name that this listener container has been assigned in its containing bean factory, if any.
 String getClientId()
Return the JMS client ID for the shared Connection created and used by this container, if any.
 int getPausedTaskCount()
 int getPhase()
Return the phase in which this container will be started and stopped.
protected  Connection getSharedConnection()
Return the shared JMS Connection maintained by this container.
 void initialize()
Initialize this container.
 boolean isActive()
Return whether this container is currently active, that is, whether it has been set up but not shut down yet.
 boolean isAutoStartup()
Return whether this Lifecycle component should be started automatically by the container when the ApplicationContext is refreshed.
 boolean isRunning()
Determine whether this container is currently running, that is, whether it has been started and not stopped yet.
protected  void logRejectedTask(Object task, RuntimeException ex)
Log a task that has been rejected by doRescheduleTask(java.lang.Object).
protected  void prepareSharedConnection(Connection connection)
Prepare the given Connection, which is about to be registered as shared Connection for this container.
protected  void refreshSharedConnection()
Refresh the shared Connection that this container holds.
protected  boolean rescheduleTaskIfNecessary(Object task)
Take the given task object and reschedule it, either immediately if this container is currently running, or later once this container has been restarted.
protected  void resumePausedTasks()
Try to resume all paused tasks.
protected  boolean runningAllowed()
Check whether this container's listeners are generally allowed to run.
 void setAutoStartup(boolean autoStartup)
Set whether to automatically start the container after initialization.
 void setBeanName(String beanName)
Set the name of the bean in the bean factory that created this bean.
 void setClientId(String clientId)
Specify the JMS client id for a shared Connection created and used by this container.
 void setPhase(int phase)
Specify the phase in which this container should be started and stopped.
protected abstract  boolean sharedConnectionEnabled()
Return whether a shared JMS Connection should be maintained by this container base class.
 void shutdown()
Stop the shared Connection, call doShutdown(), and close this container.
 void start()
Start this container.
protected  void startSharedConnection()
Start the shared Connection.
 void stop()
Stop this container.
 void stop(Runnable callback)
Indicates that a Lifecycle component must stop if it is currently running.
protected  void stopSharedConnection()
Stop the shared Connection.
protected  void validateConfiguration()
Validate the configuration of this container.
Methods inherited from class org.springframework.jms.support.destination.JmsDestinationAccessor
getDestinationResolver, isPubSubDomain, resolveDestinationName, setDestinationResolver, setPubSubDomain
Methods inherited from class org.springframework.jms.support.JmsAccessor
convertJmsAccessException, createConnection, createSession, getConnectionFactory, getSessionAcknowledgeMode, isClientAcknowledge, isSessionTransacted, setConnectionFactory, setSessionAcknowledgeMode, setSessionAcknowledgeModeName, setSessionTransacted
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

sharedConnectionMonitor

protected final Object sharedConnectionMonitor

lifecycleMonitor

protected final Object lifecycleMonitor
Constructor Detail

AbstractJmsListeningContainer

public AbstractJmsListeningContainer()
Method Detail

setClientId

public void setClientId(String clientId)
Specify the JMS client id for a shared Connection created and used by this container.

Note that client ids need to be unique among all active Connections of the underlying JMS provider. Furthermore, a client id can only be assigned if the original ConnectionFactory hasn't already assigned one.

See Also:
Connection.setClientID(java.lang.String), JmsAccessor.setConnectionFactory(javax.jms.ConnectionFactory)

getClientId

public String getClientId()
Return the JMS client ID for the shared Connection created and used by this container, if any.

setAutoStartup

public void setAutoStartup(boolean autoStartup)
Set whether to automatically start the container after initialization.

Default is "true"; set this to "false" to allow for manual startup through the start() method.

isAutoStartup

public boolean isAutoStartup()
Description copied from interface: SmartLifecycle
Return whether this Lifecycle component should be started automatically by the container when the ApplicationContext is refreshed. A value of "false" indicates that the component is intended to be started manually.

Specified by:
isAutoStartup in interface SmartLifecycle

setPhase

public void setPhase(int phase)
Specify the phase in which this container should be started and stopped. The startup order proceeds from lowest to highest, and the shutdown order is the reverse of that. By default this value is Integer.MAX_VALUE meaning that this container starts as late as possible and stops as soon as possible.

getPhase

public int getPhase()
Return the phase in which this container will be started and stopped.

Specified by:
getPhase in interface Phased

setBeanName

public void setBeanName(String beanName)
Description copied from interface: BeanNameAware
Set the name of the bean in the bean factory that created this bean.

Invoked after population of normal bean properties but before an init callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanName in interface BeanNameAware
Parameters:
beanName - the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use the BeanFactoryUtils.originalBeanName(String) method to extract the original bean name (without suffix), if desired.

getBeanName

protected final String getBeanName()
Return the bean name that this listener container has been assigned in its containing bean factory, if any.

afterPropertiesSet

public void afterPropertiesSet()
Delegates to validateConfiguration() and initialize().

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class JmsAccessor

validateConfiguration

protected void validateConfiguration()
Validate the configuration of this container.

The default implementation is empty. To be overridden in subclasses.

destroy

public void destroy()
Calls shutdown() when the BeanFactory destroys the container instance.

Specified by:
destroy in interface DisposableBean
See Also:
shutdown()

initialize

public void initialize()
                throws JmsException
Initialize this container.

Creates a JMS Connection, starts the Connection (if "autoStartup" hasn't been turned off), and calls doInitialize().

Throws:
JmsException - if startup failed

shutdown

public void shutdown()
              throws JmsException
Stop the shared Connection, call doShutdown(), and close this container.

Throws:
JmsException - if shutdown failed

isActive

public final boolean isActive()
Return whether this container is currently active, that is, whether it has been set up but not shut down yet.

start

public void start()
           throws JmsException
Start this container.

Specified by:
start in interface Lifecycle
Throws:
JmsException - if starting failed
See Also:
doStart()

doStart

protected void doStart()
                throws JMSException
Start the shared Connection, if any, and notify all invoker tasks.

Throws:
JMSException - if thrown by JMS API methods
See Also:
startSharedConnection()

stop

public void stop()
          throws JmsException
Stop this container.

Specified by:
stop in interface Lifecycle
Throws:
JmsException - if stopping failed
See Also:
doStop()

stop

public void stop(Runnable callback)
Description copied from interface: SmartLifecycle
Indicates that a Lifecycle component must stop if it is currently running.

The provided callback is used by the LifecycleProcessor to support an ordered, and potentially concurrent, shutdown of all components having a common shutdown order value. The callback must be executed after the SmartLifecycle component does indeed stop.

Specified by:
stop in interface SmartLifecycle

doStop

protected void doStop()
               throws JMSException
Notify all invoker tasks and stop the shared Connection, if any.

Throws:
JMSException - if thrown by JMS API methods
See Also:
stopSharedConnection()

isRunning

public final boolean isRunning()
Determine whether this container is currently running, that is, whether it has been started and not stopped yet.

Specified by:
isRunning in interface Lifecycle
Returns:
whether the component is currently running
See Also:
start(),
stop(),
runningAllowed()

runningAllowed

protected boolean runningAllowed()
Check whether this container's listeners are generally allowed to run.

This implementation always returns true; the default 'running' state is purely determined by start() / stop().

Subclasses may override this method to check against temporary conditions that prevent listeners from actually running. In other words, they may apply further restrictions to the 'running' state, returning false if such a restriction prevents listeners from running.

establishSharedConnection

protected void establishSharedConnection()
                                  throws JMSException
Establish a shared Connection for this container.

The default implementation delegates to createSharedConnection(), which does one immediate attempt and throws an exception if it fails. Can be overridden to have a recovery process in place, retrying until a Connection can be successfully established.

Throws:
JMSException - if thrown by JMS API methods

refreshSharedConnection

protected final void refreshSharedConnection()
                                      throws JMSException
Refresh the shared Connection that this container holds.

Called on startup and also after an infrastructure exception that occurred during invoker setup and/or execution.

Throws:
JMSException - if thrown by JMS API methods

createSharedConnection

protected Connection createSharedConnection()
                                     throws JMSException
Create a shared Connection for this container.

The default implementation creates a standard Connection and prepares it through prepareSharedConnection(javax.jms.Connection).

Returns:
the prepared Connection
Throws:
JMSException - if the creation failed

prepareSharedConnection

protected void prepareSharedConnection(Connection connection)
                                throws JMSException
Prepare the given Connection, which is about to be registered as shared Connection for this container.

The default implementation sets the specified client id, if any. Subclasses can override this to apply further settings.

Parameters:
connection - the Connection to prepare
Throws:
JMSException - if the preparation efforts failed
See Also:
getClientId()

startSharedConnection

protected void startSharedConnection()
                              throws JMSException
Start the shared Connection.

Throws:
JMSException - if thrown by JMS API methods
See Also:
Connection.start()

stopSharedConnection

protected void stopSharedConnection()
                             throws JMSException
Stop the shared Connection.

Throws:
JMSException - if thrown by JMS API methods
See Also:
Connection.start()

getSharedConnection

protected final Connection getSharedConnection()
Return the shared JMS Connection maintained by this container. Available after initialization.

Returns:
the shared Connection (never null)
Throws:
IllegalStateException - if this container does not maintain a shared Connection, or if the Connection hasn't been initialized yet
See Also:
sharedConnectionEnabled()

rescheduleTaskIfNecessary

protected final boolean rescheduleTaskIfNecessary(Object task)
Take the given task object and reschedule it, either immediately if this container is currently running, or later once this container has been restarted.

If this container has already been shut down, the task will not get rescheduled at all.

Parameters:
task - the task object to reschedule
Returns:
whether the task has been rescheduled (either immediately or for a restart of this container)
See Also:
doRescheduleTask(java.lang.Object)

resumePausedTasks

protected void resumePausedTasks()
Try to resume all paused tasks. Tasks for which rescheduling failed simply remain in paused mode.

getPausedTaskCount

public int getPausedTaskCount()

doRescheduleTask

protected void doRescheduleTask(Object task)
Reschedule the given task object immediately.

To be implemented by subclasses if they ever call rescheduleTaskIfNecessary. This implementation throws an UnsupportedOperationException.

Parameters:
task - the task object to reschedule
See Also:
rescheduleTaskIfNecessary(java.lang.Object)

logRejectedTask

protected void logRejectedTask(Object task,
                               RuntimeException ex)
Log a task that has been rejected by doRescheduleTask(java.lang.Object).

The default implementation simply logs a corresponding message at debug level.

Parameters:
task - the rejected task object
ex - the exception thrown from doRescheduleTask(java.lang.Object)

sharedConnectionEnabled

protected abstract boolean sharedConnectionEnabled()
Return whether a shared JMS Connection should be maintained by this container base class.

See Also:
getSharedConnection()

doInitialize

protected abstract void doInitialize()
                              throws JMSException
Register any invokers within this container.

Subclasses need to implement this method for their specific invoker management process.

A shared JMS Connection, if any, will already have been started at this point.

Throws:
JMSException - if registration failed
See Also:
getSharedConnection()

doShutdown

protected abstract void doShutdown()
                            throws JMSException
Close the registered invokers.

Subclasses need to implement this method for their specific invoker management process.

A shared JMS Connection, if any, will automatically be closed afterwards.

Throws:
JMSException - if shutdown failed
See Also:
shutdown()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractJmsListeningContainer.SharedConnectionNotInitializedException

org.springframework.jms.listener
Class AbstractJmsListeningContainer.SharedConnectionNotInitializedException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.jms.listener.AbstractJmsListeningContainer.SharedConnectionNotInitializedException
All Implemented Interfaces:
Serializable
Enclosing class:
AbstractJmsListeningContainer
public static class AbstractJmsListeningContainer.SharedConnectionNotInitializedException
extends RuntimeException

Exception that indicates that the initial setup of this container's shared JMS Connection failed. This is indicating to invokers that they need to establish the shared Connection themselves on first access.

See Also:
Serialized Form

Constructor Summary
protected AbstractJmsListeningContainer.SharedConnectionNotInitializedException(String msg)
Create a new SharedConnectionNotInitializedException.
Method Summary
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AbstractJmsListeningContainer.SharedConnectionNotInitializedException

protected AbstractJmsListeningContainer.SharedConnectionNotInitializedException(String msg)
Create a new SharedConnectionNotInitializedException.

Parameters:
msg - the detail message
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractMessageListenerContainer

org.springframework.jms.listener
Class AbstractMessageListenerContainer

java.lang.Object
    extended by  org.springframework.jms.support.JmsAccessor
        extended by  org.springframework.jms.support.destination.JmsDestinationAccessor
            extended by  org.springframework.jms.listener.AbstractJmsListeningContainer
                extended by  org.springframework.jms.listener.AbstractMessageListenerContainer
All Implemented Interfaces:
BeanNameAware, DisposableBean, InitializingBean, Lifecycle, Phased, SmartLifecycle
Direct Known Subclasses:
AbstractPollingMessageListenerContainer, SimpleMessageListenerContainer
public abstract class AbstractMessageListenerContainer
extends AbstractJmsListeningContainer

Abstract base class for message listener containers. Can either host a standard JMS MessageListener or a Spring-specific SessionAwareMessageListener.

Usually holds a single JMS Connection that all listeners are supposed to be registered on, which is the standard JMS way of managing listeners. Can alternatively also be used with a fresh Connection per listener, for J2EE-style XA-aware JMS messaging. The actual registration process is up to concrete subclasses.

NOTE: The default behavior of this message listener container is to never propagate an exception thrown by a message listener up to the JMS provider. Instead, it will log any such exception at the error level. This means that from the perspective of the attendant JMS provider no such listener will ever fail. However, if error handling is necessary, then any implementation of the ErrorHandler strategy may be provided to the setErrorHandler(ErrorHandler) method. Note that JMSExceptions will be passed to the ErrorHandler in addition to (but after) being passed to an ExceptionListener, if one has been provided.

The listener container offers the following message acknowledgment options:

  • "sessionAcknowledgeMode" set to "AUTO_ACKNOWLEDGE" (default): Automatic message acknowledgment before listener execution; no redelivery in case of exception thrown.
  • "sessionAcknowledgeMode" set to "CLIENT_ACKNOWLEDGE": Automatic message acknowledgment after successful listener execution; no redelivery in case of exception thrown.
  • "sessionAcknowledgeMode" set to "DUPS_OK_ACKNOWLEDGE": Lazy message acknowledgment during or after listener execution; potential redelivery in case of exception thrown.
  • "sessionTransacted" set to "true": Transactional acknowledgment after successful listener execution; guaranteed redelivery in case of exception thrown.
The exact behavior might vary according to the concrete listener container and JMS provider used.

There are two solutions to the duplicate processing problem:

  • Either add duplicate message detection to your listener, in the form of a business entity existence check or a protocol table check. This usually just needs to be done in case of the JMSRedelivered flag being set on the incoming message (else just process straightforwardly).
  • Or wrap the entire processing with an XA transaction, covering the reception of the message as well as the execution of the message listener. This is only supported by DefaultMessageListenerContainer, through specifying a "transactionManager" (typically a JtaTransactionManager, with a corresponding XA-aware JMS ConnectionFactory passed in as "connectionFactory").
Note that XA transaction coordination adds significant runtime overhead, so it might be feasible to avoid it unless absolutely necessary.

Recommendations:

  • The general recommendation is to set "sessionTransacted" to "true", typically in combination with local database transactions triggered by the listener implementation, through Spring's standard transaction facilities. This will work nicely in Tomcat or in a standalone environment, often combined with custom duplicate message detection (if it is unacceptable to ever process the same message twice).
  • Alternatively, specify a JtaTransactionManager as "transactionManager" for a fully XA-aware JMS provider - typically when running on a J2EE server, but also for other environments with a JTA transaction manager present. This will give full "exactly-once" guarantees without custom duplicate message checks, at the price of additional runtime processing overhead.

Note that it is also possible to specify a JmsTransactionManager as external "transactionManager", providing fully synchronized Spring transactions based on local JMS transactions. The effect is similar to "sessionTransacted" set to "true", the difference being that this external transaction management will also affect independent JMS access code within the service layer (e.g. based on JmsTemplate or TransactionAwareConnectionFactoryProxy), not just direct JMS Session usage in a SessionAwareMessageListener.

Since:
2.0
Author:
Juergen Hoeller
See Also:
setMessageListener(java.lang.Object), MessageListener, SessionAwareMessageListener, handleListenerException(java.lang.Throwable), DefaultMessageListenerContainer, SimpleMessageListenerContainer, JmsMessageEndpointManager

Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.jms.listener.AbstractJmsListeningContainer
AbstractJmsListeningContainer.SharedConnectionNotInitializedException
Field Summary
Fields inherited from class org.springframework.jms.listener.AbstractJmsListeningContainer
lifecycleMonitor, sharedConnectionMonitor
Fields inherited from class org.springframework.jms.support.JmsAccessor
logger
Constructor Summary
AbstractMessageListenerContainer()
Method Summary
protected void | checkMessageListener(Object messageListener) Check the given message listener, throwing an exception if it does not correspond to a supported listener type.
protected void | commitIfNecessary(Session session, Message message) Perform a commit or message acknowledgement, as appropriate.
protected void | doExecuteListener(Session session, Message message) Execute the specified listener, committing or rolling back the transaction afterwards (if necessary).
protected void | doInvokeListener(MessageListener listener, Message message) Invoke the specified listener as standard JMS MessageListener.
protected void | doInvokeListener(SessionAwareMessageListener listener, Session session, Message message) Invoke the specified listener as Spring SessionAwareMessageListener, exposing a new JMS Session (potentially with its own transaction) to the listener if demanded.
protected void | executeListener(Session session, Message message) Execute the specified listener, committing or rolling back the transaction afterwards (if necessary).
protected String | getDefaultSubscriptionName(Object messageListener) Determine the default subscription name for the given message listener.
Destination | getDestination() Return the destination to receive messages from.
protected String | getDestinationDescription() Return a descriptive String for this container's JMS destination (never null).
String | getDestinationName() Return the name of the destination to receive messages from.
String | getDurableSubscriptionName() Return the name of a durable subscription to create, if any.
ExceptionListener | getExceptionListener() Return the JMS ExceptionListener to notify in case of a JMSException thrown by the registered message listener or the invocation infrastructure, if any.
Object | getMessageListener() Return the message listener object to register.
String | getMessageSelector() Return the JMS message selector expression (or null if none).
protected void | handleListenerException(Throwable ex) Handle the given exception that arose during listener execution.
protected void | invokeErrorHandler(Throwable ex) Invoke the registered ErrorHandler, if any.
protected void | invokeExceptionListener(JMSException ex) Invoke the registered JMS ExceptionListener, if any.
protected void | invokeListener(Session session, Message message) Invoke the specified listener: either as standard JMS MessageListener or (preferably) as Spring SessionAwareMessageListener.
boolean | isAcceptMessagesWhileStopping() Return whether to accept received messages while the listener container in the process of stopping.
boolean | isExposeListenerSession() Return whether to expose the listener JMS Session to a registered SessionAwareMessageListener.
protected boolean | isSessionLocallyTransacted(Session session) Check whether the given Session is locally transacted, that is, whether its transaction is managed by this listener container's Session handling and not by an external transaction coordinator.
boolean | isSubscriptionDurable() Return whether to make the subscription durable.
protected void | rollbackIfNecessary(Session session) Perform a rollback, if appropriate.
protected void | rollbackOnExceptionIfNecessary(Session session, Throwable ex) Perform a rollback, handling rollback exceptions properly.
void | setAcceptMessagesWhileStopping(boolean acceptMessagesWhileStopping) Set whether to accept received messages while the listener container in the process of stopping.
void | setDestination(Destination destination) Set the destination to receive messages from.
void | setDestinationName(String destinationName) Set the name of the destination to receive messages from.
void | setDurableSubscriptionName(String durableSubscriptionName) Set the name of a durable subscription to create.
void | setErrorHandler(ErrorHandler errorHandler) Set an ErrorHandler to be invoked in case of any uncaught exceptions thrown while processing a Message.
void | setExceptionListener(ExceptionListener exceptionListener) Set the JMS ExceptionListener to notify in case of a JMSException thrown by the registered message listener or the invocation infrastructure.
void | setExposeListenerSession(boolean exposeListenerSession) Set whether to expose the listener JMS Session to a registered SessionAwareMessageListener as well as to JmsTemplate calls.
void | setMessageListener(Object messageListener) Set the message listener implementation to register.
void | setMessageSelector(String messageSelector) Set the JMS message selector expression (or null if none).
void | setSubscriptionDurable(boolean subscriptionDurable) Set whether to make the subscription durable.
protected void | validateConfiguration() Validate the configuration of this container.
Methods inherited from class org.springframework.jms.listener.AbstractJmsListeningContainer
afterPropertiesSet, createSharedConnection, destroy, doInitialize, doRescheduleTask, doShutdown, doStart, doStop, establishSharedConnection, getBeanName, getClientId, getPausedTaskCount, getPhase, getSharedConnection, initialize, isActive, isAutoStartup, isRunning, logRejectedTask, prepareSharedConnection, refreshSharedConnection, rescheduleTaskIfNecessary, resumePausedTasks, runningAllowed, setAutoStartup, setBeanName, setClientId, setPhase, sharedConnectionEnabled, shutdown, start, startSharedConnection, stop, stop, stopSharedConnection
Methods inherited from class org.springframework.jms.support.destination.JmsDestinationAccessor
getDestinationResolver, isPubSubDomain, resolveDestinationName, setDestinationResolver, setPubSubDomain
Methods inherited from class org.springframework.jms.support.JmsAccessor
convertJmsAccessException, createConnection, createSession, getConnectionFactory, getSessionAcknowledgeMode, isClientAcknowledge, isSessionTransacted, setConnectionFactory, setSessionAcknowledgeMode, setSessionAcknowledgeModeName, setSessionTransacted
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractMessageListenerContainer

public AbstractMessageListenerContainer()
Method Detail

setDestination

public void setDestination(Destination destination)
Set the destination to receive messages from.

Alternatively, specify a "destinationName", to be dynamically resolved via the DestinationResolver.

Note: The destination may be replaced at runtime, with the listener container picking up the new destination immediately (works e.g. with DefaultMessageListenerContainer, as long as the cache level is less than CACHE_CONSUMER). However, this is considered advanced usage; use it with care!

See Also:
setDestinationName(String)

getDestination

public Destination getDestination()
Return the destination to receive messages from. Will be null if the configured destination is not an actual Destination type; c.f. when the destination is a String.

setDestinationName

public void setDestinationName(String destinationName)
Set the name of the destination to receive messages from.

The specified name will be dynamically resolved via the configured destination resolver.

Alternatively, specify a JMS Destination object as "destination".

Note: The destination may be replaced at runtime, with the listener container picking up the new destination immediately (works e.g. with DefaultMessageListenerContainer, as long as the cache level is less than CACHE_CONSUMER). However, this is considered advanced usage; use it with care!

Parameters:
destinationName - the desired destination (can be null)
See Also:
setDestination(javax.jms.Destination)

getDestinationName

public String getDestinationName()
Return the name of the destination to receive messages from. Will be null if the configured destination is not a String type; c.f. when it is an actual Destination.

getDestinationDescription

protected String getDestinationDescription()
Return a descriptive String for this container's JMS destination (never null).

setMessageSelector

public void setMessageSelector(String messageSelector)
Set the JMS message selector expression (or null if none). Default is none.

See the JMS specification for a detailed definition of selector expressions.

Note: The message selector may be replaced at runtime, with the listener container picking up the new selector value immediately (works e.g. with DefaultMessageListenerContainer, as long as the cache level is less than CACHE_CONSUMER). However, this is considered advanced usage; use it with care!

getMessageSelector

public String getMessageSelector()
Return the JMS message selector expression (or null if none).

setMessageListener

public void setMessageListener(Object messageListener)
Set the message listener implementation to register. This can be either a standard JMS MessageListener object or a Spring SessionAwareMessageListener object.

Note: The message listener may be replaced at runtime, with the listener container picking up the new listener object immediately (works e.g. with DefaultMessageListenerContainer, as long as the cache level is less than CACHE_CONSUMER). However, this is considered advanced usage; use it with care!

Throws:
IllegalArgumentException - if the supplied listener is not a MessageListener or a SessionAwareMessageListener
See Also:
MessageListener, SessionAwareMessageListener

getMessageListener

public Object getMessageListener()
Return the message listener object to register.

checkMessageListener

protected void checkMessageListener(Object messageListener)
Check the given message listener, throwing an exception if it does not correspond to a supported listener type.

By default, only a standard JMS MessageListener object or a Spring SessionAwareMessageListener object will be accepted.

Parameters:
messageListener - the message listener object to check
Throws:
IllegalArgumentException - if the supplied listener is not a MessageListener or a SessionAwareMessageListener
See Also:
MessageListener, SessionAwareMessageListener

getDefaultSubscriptionName

protected String getDefaultSubscriptionName(Object messageListener)
Determine the default subscription name for the given message listener.

Parameters:
messageListener - the message listener object to check
Returns:
the default subscription name
See Also:
SubscriptionNameProvider

setSubscriptionDurable

public void setSubscriptionDurable(boolean subscriptionDurable)
Set whether to make the subscription durable. The durable subscription name to be used can be specified through the "durableSubscriptionName" property.

Default is "false". Set this to "true" to register a durable subscription, typically in combination with a "durableSubscriptionName" value (unless your message listener class name is good enough as subscription name).

Only makes sense when listening to a topic (pub-sub domain).

See Also:
setDurableSubscriptionName(java.lang.String)

isSubscriptionDurable

public boolean isSubscriptionDurable()
Return whether to make the subscription durable.

setDurableSubscriptionName

public void setDurableSubscriptionName(String durableSubscriptionName)
Set the name of a durable subscription to create. To be applied in case of a topic (pub-sub domain) with subscription durability activated.

The durable subscription name needs to be unique within this client's JMS client id. Default is the class name of the specified message listener.

Note: Only 1 concurrent consumer (which is the default of this message listener container) is allowed for each durable subscription.

See Also:
setSubscriptionDurable(boolean), AbstractJmsListeningContainer.setClientId(java.lang.String), setMessageListener(java.lang.Object)

getDurableSubscriptionName

public String getDurableSubscriptionName()
Return the name of a durable subscription to create, if any.

setExceptionListener

public void setExceptionListener(ExceptionListener exceptionListener)
Set the JMS ExceptionListener to notify in case of a JMSException thrown by the registered message listener or the invocation infrastructure.

getExceptionListener

public ExceptionListener getExceptionListener()
Return the JMS ExceptionListener to notify in case of a JMSException thrown by the registered message listener or the invocation infrastructure, if any.

setErrorHandler

public void setErrorHandler(ErrorHandler errorHandler)
Set an ErrorHandler to be invoked in case of any uncaught exceptions thrown while processing a Message. By default there will be no ErrorHandler so that error-level logging is the only result.

setExposeListenerSession

public void setExposeListenerSession(boolean exposeListenerSession)
Set whether to expose the listener JMS Session to a registered SessionAwareMessageListener as well as to JmsTemplate calls.

Default is "true", reusing the listener's Session. Turn this off to expose a fresh JMS Session fetched from the same underlying JMS Connection instead, which might be necessary on some JMS providers.

Note that Sessions managed by an external transaction manager will always get exposed to JmsTemplate calls. So in terms of JmsTemplate exposure, this setting only affects locally transacted Sessions.

See Also:
SessionAwareMessageListener

isExposeListenerSession

public boolean isExposeListenerSession()
Return whether to expose the listener JMS Session to a registered SessionAwareMessageListener.

setAcceptMessagesWhileStopping

public void setAcceptMessagesWhileStopping(boolean acceptMessagesWhileStopping)
Set whether to accept received messages while the listener container in the process of stopping.

Default is "false", rejecting such messages through aborting the receive attempt. Switch this flag on to fully process such messages even in the stopping phase, with the drawback that even newly sent messages might still get processed (if coming in before all receive timeouts have expired).

NOTE: Aborting receive attempts for such incoming messages might lead to the provider's retry count decreasing for the affected messages. If you have a high number of concurrent consumers, make sure that the number of retries is higher than the number of consumers, to be on the safe side for all potential stopping scenarios.

isAcceptMessagesWhileStopping

public boolean isAcceptMessagesWhileStopping()
Return whether to accept received messages while the listener container in the process of stopping.

validateConfiguration

protected void validateConfiguration()
Description copied from class: AbstractJmsListeningContainer
Validate the configuration of this container.

The default implementation is empty. To be overridden in subclasses.

Overrides:
validateConfiguration in class AbstractJmsListeningContainer

executeListener

protected void executeListener(Session session,
                               Message message)
Execute the specified listener, committing or rolling back the transaction afterwards (if necessary).

Parameters:
session - the JMS Session to operate on
message - the received JMS Message
See Also:
invokeListener(javax.jms.Session, javax.jms.Message),
commitIfNecessary(javax.jms.Session, javax.jms.Message),
rollbackOnExceptionIfNecessary(javax.jms.Session, java.lang.Throwable),
handleListenerException(java.lang.Throwable)

doExecuteListener

protected void doExecuteListener(Session session,
                                 Message message)
                          throws JMSException
Execute the specified listener, committing or rolling back the transaction afterwards (if necessary).

Parameters:
session - the JMS Session to operate on
message - the received JMS Message
Throws:
JMSException - if thrown by JMS API methods
See Also:
invokeListener(javax.jms.Session, javax.jms.Message),
commitIfNecessary(javax.jms.Session, javax.jms.Message),
rollbackOnExceptionIfNecessary(javax.jms.Session, java.lang.Throwable),
JmsAccessor.convertJmsAccessException(javax.jms.JMSException)

invokeListener

protected void invokeListener(Session session,
                              Message message)
                       throws JMSException
Invoke the specified listener: either as standard JMS MessageListener or (preferably) as Spring SessionAwareMessageListener.

Parameters:
session - the JMS Session to operate on
message - the received JMS Message
Throws:
JMSException - if thrown by JMS API methods
See Also:
setMessageListener(java.lang.Object)

doInvokeListener

protected void doInvokeListener(SessionAwareMessageListener listener,
                                Session session,
                                Message message)
                         throws JMSException
Invoke the specified listener as Spring SessionAwareMessageListener, exposing a new JMS Session (potentially with its own transaction) to the listener if demanded.

Parameters:
listener - the Spring SessionAwareMessageListener to invoke
session - the JMS Session to operate on
message - the received JMS Message
Throws:
JMSException - if thrown by JMS API methods
See Also:
SessionAwareMessageListener, setExposeListenerSession(boolean)

doInvokeListener

protected void doInvokeListener(MessageListener listener,
                                Message message)
                         throws JMSException
Invoke the specified listener as standard JMS MessageListener.

Default implementation performs a plain invocation of the onMessage method.

Parameters:
listener - the JMS MessageListener to invoke
message - the received JMS Message
Throws:
JMSException - if thrown by JMS API methods
See Also:
MessageListener.onMessage(javax.jms.Message)

commitIfNecessary

protected void commitIfNecessary(Session session,
                                 Message message)
                          throws JMSException
Perform a commit or message acknowledgement, as appropriate.

Parameters:
session - the JMS Session to commit
message - the Message to acknowledge
Throws:
JMSException - in case of commit failure

rollbackIfNecessary

protected void rollbackIfNecessary(Session session)
                            throws JMSException
Perform a rollback, if appropriate.

Parameters:
session - the JMS Session to rollback
Throws:
JMSException - in case of a rollback error

rollbackOnExceptionIfNecessary

protected void rollbackOnExceptionIfNecessary(Session session,
                                              Throwable ex)
                                       throws JMSException
Perform a rollback, handling rollback exceptions properly.

Parameters:
session - the JMS Session to rollback
ex - the thrown application exception or error
Throws:
JMSException - in case of a rollback error

isSessionLocallyTransacted

protected boolean isSessionLocallyTransacted(Session session)
Check whether the given Session is locally transacted, that is, whether its transaction is managed by this listener container's Session handling and not by an external transaction coordinator.

Note: The Session's own transacted flag will already have been checked before. This method is about finding out whether the Session's transaction is local or externally coordinated.

Parameters:
session - the Session to check
Returns:
whether the given Session is locally transacted
See Also:
JmsAccessor.isSessionTransacted(), ConnectionFactoryUtils.isSessionTransactional(javax.jms.Session, javax.jms.ConnectionFactory)

handleListenerException

protected void handleListenerException(Throwable ex)
Handle the given exception that arose during listener execution.

The default implementation logs the exception at error level, not propagating it to the JMS provider - assuming that all handling of acknowledgement and/or transactions is done by this listener container. This can be overridden in subclasses.

Parameters:
ex - the exception to handle

invokeExceptionListener

protected void invokeExceptionListener(JMSException ex)
Invoke the registered JMS ExceptionListener, if any.

Parameters:
ex - the exception that arose during JMS processing
See Also:
setExceptionListener(javax.jms.ExceptionListener)

invokeErrorHandler

protected void invokeErrorHandler(Throwable ex)
Invoke the registered ErrorHandler, if any. Log at error level otherwise.

Parameters:
ex - the uncaught error that arose during JMS processing.
See Also:
setErrorHandler(org.springframework.util.ErrorHandler)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractPollingMessageListenerContainer

org.springframework.jms.listener
Class AbstractPollingMessageListenerContainer

java.lang.Object
    extended by  org.springframework.jms.support.JmsAccessor
        extended by  org.springframework.jms.support.destination.JmsDestinationAccessor
            extended by  org.springframework.jms.listener.AbstractJmsListeningContainer
                extended by  org.springframework.jms.listener.AbstractMessageListenerContainer
                    extended by  org.springframework.jms.listener.AbstractPollingMessageListenerContainer
All Implemented Interfaces:
BeanNameAware, DisposableBean, InitializingBean, Lifecycle, Phased, SmartLifecycle
Direct Known Subclasses:
DefaultMessageListenerContainer
public abstract class AbstractPollingMessageListenerContainer
extends AbstractMessageListenerContainer
implements BeanNameAware

Base class for listener container implementations which are based on polling. Provides support for listener handling based on MessageConsumer, optionally participating in externally managed transactions.

This listener container variant is built for repeated polling attempts, each invoking the receiveAndExecute(java.lang.Object, javax.jms.Session, javax.jms.MessageConsumer) method. The MessageConsumer used may be reobtained fo reach attempt or cached inbetween attempts; this is up to the concrete implementation. The receive timeout for each attempt can be configured through the "receiveTimeout" property.

The underlying mechanism is based on standard JMS MessageConsumer handling, which is perfectly compatible with both native JMS and JMS in a J2EE environment. Neither the JMS MessageConsumer.setMessageListener facility nor the JMS ServerSessionPool facility is required. A further advantage of this approach is full control over the listening process, allowing for custom scaling and throttling and of concurrent message processing (which is up to concrete subclasses).

Message reception and listener execution can automatically be wrapped in transactions through passing a Spring PlatformTransactionManager into the "transactionManager" property. This will usually be a JtaTransactionManager in a J2EE enviroment, in combination with a JTA-aware JMS ConnectionFactory obtained from JNDI (check your J2EE server's documentation).

This base class does not assume any specific mechanism for asynchronous execution of polling invokers. Check out DefaultMessageListenerContainer for a concrete implementation which is based on Spring's TaskExecutor abstraction, including dynamic scaling of concurrent consumers and automatic self recovery.

Since:
2.0.3
Author:
Juergen Hoeller
See Also:
createListenerConsumer(javax.jms.Session),
receiveAndExecute(java.lang.Object, javax.jms.Session, javax.jms.MessageConsumer),
setTransactionManager(org.springframework.transaction.PlatformTransactionManager)

Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.jms.listener.AbstractJmsListeningContainer
AbstractJmsListeningContainer.SharedConnectionNotInitializedException
Field Summary
static long DEFAULT_RECEIVE_TIMEOUT
The default receive timeout: 1000 ms = 1 second.
Fields inherited from class org.springframework.jms.listener.AbstractJmsListeningContainer
lifecycleMonitor, sharedConnectionMonitor
Fields inherited from class org.springframework.jms.support.JmsAccessor
logger
Constructor Summary
AbstractPollingMessageListenerContainer()
Method Summary
protected MessageConsumer | createConsumer(Session session, Destination destination) Create a JMS MessageConsumer for the given Session and Destination.
protected MessageConsumer | createListenerConsumer(Session session) Create a MessageConsumer for the given JMS Session, registering a MessageListener for the specified listener.
protected boolean | doReceiveAndExecute(Object invoker, Session session, MessageConsumer consumer, TransactionStatus status) Actually execute the listener for a message received from the given consumer, fetching all requires resources and invoking the listener.
protected Connection | getConnection(JmsResourceHolder holder) Fetch an appropriate Connection from the given JmsResourceHolder.
protected Session | getSession(JmsResourceHolder holder) Fetch an appropriate Session from the given JmsResourceHolder.
protected PlatformTransactionManager | getTransactionManager() Return the Spring PlatformTransactionManager to use for transactional wrapping of message reception plus listener execution.
void | initialize() Initialize this container.
protected boolean | isPubSubNoLocal() Return whether to inhibit the delivery of messages published by its own connection.
protected boolean | isSessionLocallyTransacted(Session session) This implementation checks whether the Session is externally synchronized.
protected void | messageReceived(Object invoker, Session session) Template method that gets called right when a new message has been received, before attempting to process it.
protected void | noMessageReceived(Object invoker, Session session) Template method that gets called right no message has been received, before attempting to process it.
protected boolean | receiveAndExecute(Object invoker, Session session, MessageConsumer consumer) Execute the listener for a message received from the given consumer, wrapping the entire operation in an external transaction if demanded.
protected Message | receiveMessage(MessageConsumer consumer) Receive a message from the given consumer.
void | setPubSubNoLocal(boolean pubSubNoLocal) Set whether to inhibit the delivery of messages published by its own connection.
void | setReceiveTimeout(long receiveTimeout) Set the timeout to use for receive calls, in milliseconds.
void | setSessionTransacted(boolean sessionTransacted) Set the transaction mode that is used when creating a JMS Session.
void | setTransactionManager(PlatformTransactionManager transactionManager) Specify the Spring PlatformTransactionManager to use for transactional wrapping of message reception plus listener execution.
void | setTransactionName(String transactionName) Specify the transaction name to use for transactional wrapping.
void | setTransactionTimeout(int transactionTimeout) Specify the transaction timeout to use for transactional wrapping, in seconds.
Methods inherited from class org.springframework.jms.listener.AbstractMessageListenerContainer
checkMessageListener, commitIfNecessary, doExecuteListener, doInvokeListener, doInvokeListener, executeListener, getDefaultSubscriptionName, getDestination, getDestinationDescription, getDestinationName, getDurableSubscriptionName, getExceptionListener, getMessageListener, getMessageSelector, handleListenerException, invokeErrorHandler, invokeExceptionListener, invokeListener, isAcceptMessagesWhileStopping, isExposeListenerSession, isSubscriptionDurable, rollbackIfNecessary, rollbackOnExceptionIfNecessary, setAcceptMessagesWhileStopping, setDestination, setDestinationName, setDurableSubscriptionName, setErrorHandler, setExceptionListener, setExposeListenerSession, setMessageListener, setMessageSelector, setSubscriptionDurable, validateConfiguration
Methods inherited from class org.springframework.jms.listener.AbstractJmsListeningContainer
afterPropertiesSet, createSharedConnection, destroy, doInitialize, doRescheduleTask, doShutdown, doStart, doStop, establishSharedConnection, getBeanName, getClientId, getPausedTaskCount, getPhase, getSharedConnection, isActive, isAutoStartup, isRunning, logRejectedTask, prepareSharedConnection, refreshSharedConnection, rescheduleTaskIfNecessary, resumePausedTasks, runningAllowed, setAutoStartup, setBeanName, setClientId, setPhase, sharedConnectionEnabled, shutdown, start, startSharedConnection, stop, stop, stopSharedConnection
Methods inherited from class org.springframework.jms.support.destination.JmsDestinationAccessor
getDestinationResolver, isPubSubDomain, resolveDestinationName, setDestinationResolver, setPubSubDomain
Methods inherited from class org.springframework.jms.support.JmsAccessor
convertJmsAccessException, createConnection, createSession, getConnectionFactory, getSessionAcknowledgeMode, isClientAcknowledge, isSessionTransacted, setConnectionFactory, setSessionAcknowledgeMode, setSessionAcknowledgeModeName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.BeanNameAware
setBeanName

Field Detail

DEFAULT_RECEIVE_TIMEOUT

public static final long DEFAULT_RECEIVE_TIMEOUT
The default receive timeout: 1000 ms = 1 second.

See Also:
Constant Field Values
Constructor Detail

AbstractPollingMessageListenerContainer

public AbstractPollingMessageListenerContainer()
Method Detail

setSessionTransacted

public void setSessionTransacted(boolean sessionTransacted)
Description copied from class: JmsAccessor
Set the transaction mode that is used when creating a JMS Session. Default is "false".

Note that within a JTA transaction, the parameters passed to create(Queue/Topic)Session(boolean transacted, int acknowledgeMode) method are not taken into account. Depending on the J2EE transaction context, the container makes its own decisions on these values. Analogously, these parameters are not taken into account within a locally managed transaction either, since the accessor operates on an existing JMS Session in this case.

Setting this flag to "true" will use a short local JMS transaction when running outside of a managed transaction, and a synchronized local JMS transaction in case of a managed transaction (other than an XA transaction) being present. The latter has the effect of a local JMS transaction being managed alongside the main transaction (which might be a native JDBC transaction), with the JMS transaction committing right after the main transaction.

Overrides:
setSessionTransacted in class JmsAccessor
See Also:
Connection.createSession(boolean, int)

setPubSubNoLocal

public void setPubSubNoLocal(boolean pubSubNoLocal)
Set whether to inhibit the delivery of messages published by its own connection. Default is "false".

See Also:
TopicSession.createSubscriber(javax.jms.Topic, String, boolean)

isPubSubNoLocal

protected boolean isPubSubNoLocal()
Return whether to inhibit the delivery of messages published by its own connection.

setTransactionManager

public void setTransactionManager(PlatformTransactionManager transactionManager)
Specify the Spring PlatformTransactionManager to use for transactional wrapping of message reception plus listener execution.

Default is none, not performing any transactional wrapping. If specified, this will usually be a Spring JtaTransactionManager or one of its subclasses, in combination with a JTA-aware ConnectionFactory that this message listener container obtains its Connections from.

Note: Consider the use of local JMS transactions instead. Simply switch the "sessionTransacted" flag to "true" in order to use a locally transacted JMS Session for the entire receive processing, including any Session operations performed by a SessionAwareMessageListener (e.g. sending a response message). Alternatively, a JmsTransactionManager may be used for fully synchronized Spring transactions based on local JMS transactions. Check AbstractMessageListenerContainer's javadoc for a discussion of transaction choices and message redelivery scenarios.

See Also:
JtaTransactionManager, JmsTransactionManager

getTransactionManager

protected final PlatformTransactionManager getTransactionManager()
Return the Spring PlatformTransactionManager to use for transactional wrapping of message reception plus listener execution.

setTransactionName

public void setTransactionName(String transactionName)
Specify the transaction name to use for transactional wrapping. Default is the bean name of this listener container, if any.

See Also:
TransactionDefinition.getName()

setTransactionTimeout

public void setTransactionTimeout(int transactionTimeout)
Specify the transaction timeout to use for transactional wrapping, in seconds. Default is none, using the transaction manager's default timeout.

See Also:
TransactionDefinition.getTimeout(), setReceiveTimeout(long)

setReceiveTimeout

public void setReceiveTimeout(long receiveTimeout)
Set the timeout to use for receive calls, in milliseconds. The default is 1000 ms, that is, 1 second.

NOTE: This value needs to be smaller than the transaction timeout used by the transaction manager (in the appropriate unit, of course). -1 indicates no timeout at all; however, this is only feasible if not running within a transaction manager.

See Also:
MessageConsumer.receive(long),
MessageConsumer.receive(),
setTransactionTimeout(int)

initialize

public void initialize()
Description copied from class: AbstractJmsListeningContainer
Initialize this container.

Creates a JMS Connection, starts the Connection (if "autoStartup" hasn't been turned off), and calls AbstractJmsListeningContainer.doInitialize().

Overrides:
initialize in class AbstractJmsListeningContainer

createListenerConsumer

protected MessageConsumer createListenerConsumer(Session session)
                                          throws JMSException
Create a MessageConsumer for the given JMS Session, registering a MessageListener for the specified listener.

Parameters:
session - the JMS Session to work on
Returns:
the MessageConsumer
Throws:
JMSException - if thrown by JMS methods
See Also:
receiveAndExecute(java.lang.Object, javax.jms.Session, javax.jms.MessageConsumer)

receiveAndExecute

protected boolean receiveAndExecute(Object invoker,
                                    Session session,
                                    MessageConsumer consumer)
                             throws JMSException
Execute the listener for a message received from the given consumer, wrapping the entire operation in an external transaction if demanded.

Parameters:
session - the JMS Session to work on
consumer - the MessageConsumer to work on
Returns:
whether a message has been received
Throws:
JMSException - if thrown by JMS methods
See Also:
doReceiveAndExecute(java.lang.Object, javax.jms.Session, javax.jms.MessageConsumer, org.springframework.transaction.TransactionStatus)

doReceiveAndExecute

protected boolean doReceiveAndExecute(Object invoker,
                                      Session session,
                                      MessageConsumer consumer,
                                      TransactionStatus status)
                               throws JMSException
Actually execute the listener for a message received from the given consumer, fetching all requires resources and invoking the listener.

Parameters:
session - the JMS Session to work on
consumer - the MessageConsumer to work on
status - the TransactionStatus (may be null)
Returns:
whether a message has been received
Throws:
JMSException - if thrown by JMS methods
See Also:
AbstractMessageListenerContainer.doExecuteListener(javax.jms.Session, javax.jms.Message)

isSessionLocallyTransacted

protected boolean isSessionLocallyTransacted(Session session)
This implementation checks whether the Session is externally synchronized. In this case, the Session is not locally transacted, despite the listener container's "sessionTransacted" flag being set to "true".

Overrides:
isSessionLocallyTransacted in class AbstractMessageListenerContainer
Parameters:
session - the Session to check
Returns:
whether the given Session is locally transacted
See Also:
JmsResourceHolder

receiveMessage

protected Message receiveMessage(MessageConsumer consumer)
                          throws JMSException
Receive a message from the given consumer.

Parameters:
consumer - the MessageConsumer to use
Returns:
the Message, or null if none
Throws:
JMSException - if thrown by JMS methods

messageReceived

protected void messageReceived(Object invoker,
                               Session session)
Template method that gets called right when a new message has been received, before attempting to process it. Allows subclasses to react to the event of an actual incoming message, for example adapting their consumer count.

Parameters:
invoker - the invoker object (passed through)
session - the receiving JMS Session

noMessageReceived

protected void noMessageReceived(Object invoker,
                                 Session session)
Template method that gets called right no message has been received, before attempting to process it. Allows subclasses to react to the event of an actual incoming message, for example marking .

Parameters:
invoker - the invoker object (passed through)
session - the receiving JMS Session

getConnection

protected Connection getConnection(JmsResourceHolder holder)
Fetch an appropriate Connection from the given JmsResourceHolder.

This implementation accepts any JMS 1.1 Connection.

Parameters:
holder - the JmsResourceHolder
Returns:
an appropriate Connection fetched from the holder, or null if none found

getSession

protected Session getSession(JmsResourceHolder holder)
Fetch an appropriate Session from the given JmsResourceHolder.

This implementation accepts any JMS 1.1 Session.

Parameters:
holder - the JmsResourceHolder
Returns:
an appropriate Session fetched from the holder, or null if none found

createConsumer

protected MessageConsumer createConsumer(Session session,
                                         Destination destination)
                                  throws JMSException
Create a JMS MessageConsumer for the given Session and Destination.

This implementation uses JMS 1.1 API.

Parameters:
session - the JMS Session to create a MessageConsumer for
destination - the JMS Destination to create a MessageConsumer for
Returns:
the new JMS MessageConsumer
Throws:
JMSException - if thrown by JMS API methods
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultMessageListenerContainer

org.springframework.jms.listener
Class DefaultMessageListenerContainer

java.lang.Object
    extended by  org.springframework.jms.support.JmsAccessor
        extended by  org.springframework.jms.support.destination.JmsDestinationAccessor
            extended by  org.springframework.jms.listener.AbstractJmsListeningContainer
                extended by  org.springframework.jms.listener.AbstractMessageListenerContainer
                    extended by  org.springframework.jms.listener.AbstractPollingMessageListenerContainer
                        extended by  org.springframework.jms.listener.DefaultMessageListenerContainer
All Implemented Interfaces:
BeanNameAware, DisposableBean, InitializingBean, Lifecycle, Phased, SmartLifecycle
Direct Known Subclasses:
DefaultMessageListenerContainer102
public class DefaultMessageListenerContainer
extends AbstractPollingMessageListenerContainer

Message listener container variant that uses plain JMS client API, specifically a loop of MessageConsumer.receive() calls that also allow for transactional reception of messages (registering them with XA transactions). Designed to work in a native JMS environment as well as in a J2EE environment, with only minimal differences in configuration.

This is a simple but nevertheless powerful form of message listener container. On startup, it obtains a fixed number of JMS Sessions to invoke the listener, and optionally allows for dynamic adaptation at runtime (up until a maximum number). Like SimpleMessageListenerContainer, its main advantage is its low level of runtime complexity, in particular the minimal requirements on the JMS provider: Not even the JMS ServerSessionPool facility is required. Beyond that, it is fully self-recovering in case of the broker being temporarily unavailable, and allows for stops/restarts as well as runtime changes to its configuration.

Actual MessageListener execution happens in asynchronous work units which are created through Spring's TaskExecutor abstraction. By default, the specified number of invoker tasks will be created on startup, according to the "concurrentConsumers" setting. Specify an alternative TaskExecutor to integrate with an existing thread pool facility (such as a J2EE server's), for example using a CommonJ WorkManager. With a native JMS setup, each of those listener threads is going to use a cached JMS Session and MessageConsumer (only refreshed in case of failure), using the JMS provider's resources as efficiently as possible.

Message reception and listener execution can automatically be wrapped in transactions through passing a Spring PlatformTransactionManager into the "transactionManager" property. This will usually be a JtaTransactionManager in a J2EE enviroment, in combination with a JTA-aware JMS ConnectionFactory obtained from JNDI (check your J2EE server's documentation). Note that this listener container will automatically reobtain all JMS handles for each transaction in case of an external transaction manager specified, for compatibility with all J2EE servers (in particular JBoss). This non-caching behavior can be overridden through the "cacheLevel" / "cacheLevelName" property, enforcing caching of the Connection (or also Session and MessageConsumer) even in case of an external transaction manager being involved.

Dynamic scaling of the number of concurrent invokers can be activated through specifying a "maxConcurrentConsumers" value that is higher than the "concurrentConsumers" value. Since the latter's default is 1, you can also simply specify a "maxConcurrentConsumers" of e.g. 5, which will lead to dynamic scaling up to 5 concurrent consumers in case of increasing message load, as well as dynamic shrinking back to the standard number of consumers once the load decreases. Consider adapting the "idleTaskExecutionLimit" setting to control the lifespan of each new task, to avoid frequent scaling up and down, in particular if the ConnectionFactory does not pool JMS Sessions and/or the TaskExecutor does not pool threads (check your configuration!). Note that dynamic scaling only really makes sense for a queue in the first place; for a topic, you will typically stick with the default number of 1 consumer, else you'd receive the same message multiple times on the same node.

It is strongly recommended to either set "sessionTransacted" to "true" or specify an external "transactionManager". See the AbstractMessageListenerContainer javadoc for details on acknowledge modes and native transaction options, as well as the AbstractPollingMessageListenerContainer javadoc for details on configuring an external transaction manager.

Since:
2.0
Author:
Juergen Hoeller
See Also:
AbstractPollingMessageListenerContainer.setTransactionManager(org.springframework.transaction.PlatformTransactionManager), setCacheLevel(int), MessageConsumer.receive(long), SimpleMessageListenerContainer, JmsMessageEndpointManager

Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.jms.listener.AbstractJmsListeningContainer
AbstractJmsListeningContainer.SharedConnectionNotInitializedException
Field Summary
static int | CACHE_AUTO Constant that indicates automatic choice of an appropriate caching level (depending on the transaction management strategy).
static int | CACHE_CONNECTION Constant that indicates to cache a shared JMS Connection.
static int | CACHE_CONSUMER Constant that indicates to cache a shared JMS Connection and a JMS Session for each listener thread, as well as a JMS MessageConsumer for each listener thread.
static int | CACHE_NONE Constant that indicates to cache no JMS resources at all.
static int | CACHE_SESSION Constant that indicates to cache a shared JMS Connection and a JMS Session for each listener thread.
static long | DEFAULT_RECOVERY_INTERVAL The default recovery interval: 5000 ms = 5 seconds.
static String | DEFAULT_THREAD_NAME_PREFIX Default thread name prefix: "DefaultMessageListenerContainer-".
Fields inherited from class org.springframework.jms.listener.AbstractPollingMessageListenerContainer
DEFAULT_RECEIVE_TIMEOUT
Fields inherited from class org.springframework.jms.listener.AbstractJmsListeningContainer
lifecycleMonitor, sharedConnectionMonitor
Fields inherited from class org.springframework.jms.support.JmsAccessor
logger
Constructor Summary
DefaultMessageListenerContainer()
Method Summary
protected  TaskExecutor createDefaultTaskExecutor()
Create a default TaskExecutor.
protected  void doInitialize()
Creates the specified number of concurrent consumers, in the form of a JMS Session plus associated MessageConsumer running in a separate thread.
protected  void doRescheduleTask(Object task)
Re-executes the given task via this listener container's TaskExecutor.
protected  void doShutdown()
Destroy the registered JMS Sessions and associated MessageConsumers.
protected  void establishSharedConnection()
Overridden to accept a failure in the initial setup - leaving it up to the asynchronous invokers to establish the shared Connection on first access.
 int getActiveConsumerCount()
Return the number of currently active consumers.
 int getCacheLevel()
Return the level of caching that this listener container is allowed to apply.
 int getConcurrentConsumers()
Return the "concurrentConsumer" setting.
 int getIdleTaskExecutionLimit()
Return the limit for idle executions of a receive task.
 int getMaxConcurrentConsumers()
Return the "maxConcurrentConsumer" setting.
 int getMaxMessagesPerTask()
Return the maximum number of messages to process in one task.
 int getScheduledConsumerCount()
Return the number of currently scheduled consumers.
protected  void handleListenerSetupFailure(Throwable ex, boolean alreadyRecovered)
Handle the given exception that arose during setup of a listener.
 void initialize()
Initialize this container.
protected  void messageReceived(Object invoker, Session session)
Tries scheduling a new invoker, since we know messages are coming in...
protected  void noMessageReceived(Object invoker, Session session)
Marks the affected invoker as idle.
protected  void recoverAfterListenerSetupFailure()
Recover this listener container after a listener failed to set itself up, for example reestablishing the underlying Connection.
protected  void refreshConnectionUntilSuccessful()
Refresh the underlying Connection, not returning before an attempt has been successful.
protected  void refreshDestination()
Refresh the JMS destination that this listener container operates on.
protected  void scheduleNewInvokerIfAppropriate()
Schedule a new invoker, increasing the total number of scheduled invokers for this listener container, but only if the specified "maxConcurrentConsumers" limit has not been reached yet, and only if this listener container does not currently have idle invokers that are waiting for new messages already.
 void setCacheLevel(int cacheLevel)
Specify the level of caching that this listener container is allowed to apply.
 void setCacheLevelName(String constantName)
Specify the level of caching that this listener container is allowed to apply, in the form of the name of the corresponding constant: e.g.
 void setConcurrency(String concurrency)
Specify concurrency limits via a "lower-upper" String, e.g.
 void setConcurrentConsumers(int concurrentConsumers)
Specify the number of concurrent consumers to create.
 void setIdleTaskExecutionLimit(int idleTaskExecutionLimit)
Specify the limit for idle executions of a receive task, not having received any message within its execution.
 void setMaxConcurrentConsumers(int maxConcurrentConsumers)
Specify the maximum number of concurrent consumers to create.
 void setMaxMessagesPerTask(int maxMessagesPerTask)
Specify the maximum number of messages to process in one task.
 void setRecoveryInterval(long recoveryInterval)
Specify the interval between recovery attempts, in milliseconds.
 void setTaskExecutor(Executor taskExecutor)
Set the Spring TaskExecutor to use for running the listener threads.
protected  boolean sharedConnectionEnabled()
Use a shared JMS Connection depending on the "cacheLevel" setting.
protected  void sleepInbetweenRecoveryAttempts()
Sleep according to the specified recovery interval.
 void start()
Overridden to reset the stop callback, if any.
protected  void startSharedConnection()
This implementations proceeds even after an exception thrown from Connection.start(), relying on listeners to perform appropriate recovery.
 void stop(Runnable callback)
Stop this listener container, invoking the specific callback once all listener processing has actually stopped.
protected  void stopSharedConnection()
This implementations proceeds even after an exception thrown from Connection.stop(), relying on listeners to perform appropriate recovery after a restart.
protected  void validateConfiguration()
Validate the configuration of this container.
Methods inherited from class org.springframework.jms.listener.AbstractPollingMessageListenerContainer
createConsumer, createListenerConsumer, doReceiveAndExecute, getConnection, getSession, getTransactionManager, isPubSubNoLocal, isSessionLocallyTransacted, receiveAndExecute, receiveMessage, setPubSubNoLocal, setReceiveTimeout, setSessionTransacted, setTransactionManager, setTransactionName, setTransactionTimeout
Methods inherited from class org.springframework.jms.listener.AbstractMessageListenerContainer
checkMessageListener, commitIfNecessary, doExecuteListener, doInvokeListener, doInvokeListener, executeListener, getDefaultSubscriptionName, getDestination, getDestinationDescription, getDestinationName, getDurableSubscriptionName, getExceptionListener, getMessageListener, getMessageSelector, handleListenerException, invokeErrorHandler, invokeExceptionListener, invokeListener, isAcceptMessagesWhileStopping, isExposeListenerSession, isSubscriptionDurable, rollbackIfNecessary, rollbackOnExceptionIfNecessary, setAcceptMessagesWhileStopping, setDestination, setDestinationName, setDurableSubscriptionName, setErrorHandler, setExceptionListener, setExposeListenerSession, setMessageListener, setMessageSelector, setSubscriptionDurable
Methods inherited from class org.springframework.jms.listener.AbstractJmsListeningContainer
afterPropertiesSet, createSharedConnection, destroy, doStart, doStop, getBeanName, getClientId, getPausedTaskCount, getPhase, getSharedConnection, isActive, isAutoStartup, isRunning, logRejectedTask, prepareSharedConnection, refreshSharedConnection, rescheduleTaskIfNecessary, resumePausedTasks, runningAllowed, setAutoStartup, setBeanName, setClientId, setPhase, shutdown, stop
Methods inherited from class org.springframework.jms.support.destination.JmsDestinationAccessor
getDestinationResolver, isPubSubDomain, resolveDestinationName, setDestinationResolver, setPubSubDomain
Methods inherited from class org.springframework.jms.support.JmsAccessor
convertJmsAccessException, createConnection, createSession, getConnectionFactory, getSessionAcknowledgeMode, isClientAcknowledge, isSessionTransacted, setConnectionFactory, setSessionAcknowledgeMode, setSessionAcknowledgeModeName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.BeanNameAware
setBeanName

Field Detail

DEFAULT_THREAD_NAME_PREFIX

public static final String DEFAULT_THREAD_NAME_PREFIX
Default thread name prefix: "DefaultMessageListenerContainer-".

DEFAULT_RECOVERY_INTERVAL

public static final long DEFAULT_RECOVERY_INTERVAL
The default recovery interval: 5000 ms = 5 seconds.

See Also:
Constant Field Values

CACHE_NONE

public static final int CACHE_NONE
Constant that indicates to cache no JMS resources at all.

See Also:
setCacheLevel(int), Constant Field Values

CACHE_CONNECTION

public static final int CACHE_CONNECTION
Constant that indicates to cache a shared JMS Connection.

See Also:
setCacheLevel(int), Constant Field Values

CACHE_SESSION

public static final int CACHE_SESSION
Constant that indicates to cache a shared JMS Connection and a JMS Session for each listener thread.

See Also:
setCacheLevel(int), Constant Field Values

CACHE_CONSUMER

public static final int CACHE_CONSUMER
Constant that indicates to cache a shared JMS Connection and a JMS Session for each listener thread, as well as a JMS MessageConsumer for each listener thread.

See Also:
setCacheLevel(int), Constant Field Values

CACHE_AUTO

public static final int CACHE_AUTO
Constant that indicates automatic choice of an appropriate caching level (depending on the transaction management strategy).

See Also:
setCacheLevel(int), Constant Field Values
Constructor Detail

DefaultMessageListenerContainer

public DefaultMessageListenerContainer()
Method Detail

setTaskExecutor

public void setTaskExecutor(Executor taskExecutor)
Set the Spring TaskExecutor to use for running the listener threads.

Default is a SimpleAsyncTaskExecutor, starting up a number of new threads, according to the specified number of concurrent consumers.

Specify an alternative TaskExecutor for integration with an existing thread pool. Note that this really only adds value if the threads are managed in a specific fashion, for example within a J2EE environment. A plain thread pool does not add much value, as this listener container will occupy a number of threads for its entire lifetime.

See Also:
setConcurrentConsumers(int), SimpleAsyncTaskExecutor, WorkManagerTaskExecutor

setRecoveryInterval

public void setRecoveryInterval(long recoveryInterval)
Specify the interval between recovery attempts, in milliseconds. The default is 5000 ms, that is, 5 seconds.

See Also:
handleListenerSetupFailure(java.lang.Throwable, boolean)

setCacheLevelName

public void setCacheLevelName(String constantName)
                       throws IllegalArgumentException
Specify the level of caching that this listener container is allowed to apply, in the form of the name of the corresponding constant: e.g. "CACHE_CONNECTION".

Throws:
IllegalArgumentException
See Also:
setCacheLevel(int)

setCacheLevel

public void setCacheLevel(int cacheLevel)
Specify the level of caching that this listener container is allowed to apply.

Default is CACHE_NONE if an external transaction manager has been specified (to reobtain all resources freshly within the scope of the external transaction), and CACHE_CONSUMER else (operating with local JMS resources).

Some J2EE servers only register their JMS resources with an ongoing XA transaction in case of a freshly obtained JMS Connection and Session, which is why this listener container does by default not cache any of those. However, if you want to optimize for a specific server, consider switching this setting to at least CACHE_CONNECTION or CACHE_SESSION even in conjunction with an external transaction manager.

Currently known servers that absolutely require CACHE_NONE for XA transaction processing: JBoss 4. For any others, consider raising the cache level.

See Also:
CACHE_NONE, CACHE_CONNECTION, CACHE_SESSION, CACHE_CONSUMER, setCacheLevelName(java.lang.String), AbstractPollingMessageListenerContainer.setTransactionManager(org.springframework.transaction.PlatformTransactionManager)

getCacheLevel

public int getCacheLevel()
Return the level of caching that this listener container is allowed to apply.

setConcurrency

public void setConcurrency(String concurrency)
Specify concurrency limits via a "lower-upper" String, e.g. "5-10", or a simple upper limit String, e.g. "10" (the lower limit will be 1 in this case).

This listener container will always hold on to the minimum number of consumers (setConcurrentConsumers(int)) and will slowly scale up to the maximum number of consumers setMaxConcurrentConsumers(int) in case of increasing load.

setConcurrentConsumers

public void setConcurrentConsumers(int concurrentConsumers)
Specify the number of concurrent consumers to create. Default is 1.

Specifying a higher value for this setting will increase the standard level of scheduled concurrent consumers at runtime: This is effectively the minimum number of concurrent consumers which will be scheduled at any given time. This is a static setting; for dynamic scaling, consider specifying the "maxConcurrentConsumers" setting instead.

Raising the number of concurrent consumers is recommendable in order to scale the consumption of messages coming in from a queue. However, note that any ordering guarantees are lost once multiple consumers are registered. In general, stick with 1 consumer for low-volume queues.

Do not raise the number of concurrent consumers for a topic. This would lead to concurrent consumption of the same message, which is hardly ever desirable.

This setting can be modified at runtime, for example through JMX.

See Also:
setMaxConcurrentConsumers(int)

getConcurrentConsumers

public final int getConcurrentConsumers()
Return the "concurrentConsumer" setting.

This returns the currently configured "concurrentConsumers" value; the number of currently scheduled/active consumers might differ.

See Also:
getScheduledConsumerCount(), getActiveConsumerCount()

setMaxConcurrentConsumers

public void setMaxConcurrentConsumers(int maxConcurrentConsumers)
Specify the maximum number of concurrent consumers to create. Default is 1.

If this setting is higher than "concurrentConsumers", the listener container will dynamically schedule new consumers at runtime, provided that enough incoming messages are encountered. Once the load goes down again, the number of consumers will be reduced to the standard level ("concurrentConsumers") again.

Raising the number of concurrent consumers is recommendable in order to scale the consumption of messages coming in from a queue. However, note that any ordering guarantees are lost once multiple consumers are registered. In general, stick with 1 consumer for low-volume queues.

Do not raise the number of concurrent consumers for a topic. This would lead to concurrent consumption of the same message, which is hardly ever desirable.

This setting can be modified at runtime, for example through JMX.

See Also:
setConcurrentConsumers(int)

getMaxConcurrentConsumers

public final int getMaxConcurrentConsumers()
Return the "maxConcurrentConsumer" setting.

This returns the currently configured "maxConcurrentConsumers" value; the number of currently scheduled/active consumers might differ.

See Also:
getScheduledConsumerCount(), getActiveConsumerCount()

setMaxMessagesPerTask

public void setMaxMessagesPerTask(int maxMessagesPerTask)
Specify the maximum number of messages to process in one task. More concretely, this limits the number of message reception attempts per task, which includes receive iterations that did not actually pick up a message until they hit their timeout (see the "receiveTimeout" property).

Default is unlimited (-1) in case of a standard TaskExecutor, reusing the original invoker threads until shutdown (at the expense of limited dynamic scheduling).

In case of a SchedulingTaskExecutor indicating a preference for short-lived tasks, the default is 10 instead. Specify a number of 10 to 100 messages to balance between rather long-lived and rather short-lived tasks here.

Long-lived tasks avoid frequent thread context switches through sticking with the same thread all the way through, while short-lived tasks allow thread pools to control the scheduling. Hence, thread pools will usually prefer short-lived tasks.

This setting can be modified at runtime, for example through JMX.

See Also:
setTaskExecutor(java.util.concurrent.Executor),
AbstractPollingMessageListenerContainer.setReceiveTimeout(long),
SchedulingTaskExecutor.prefersShortLivedTasks()

getMaxMessagesPerTask

public int getMaxMessagesPerTask()
Return the maximum number of messages to process in one task.

setIdleTaskExecutionLimit

public void setIdleTaskExecutionLimit(int idleTaskExecutionLimit)
Specify the limit for idle executions of a receive task, not having received any message within its execution. If this limit is reached, the task will shut down and leave receiving to other executing tasks.

Default is 1, closing idle resources early once a task didn't receive a message. This applies to dynamic scheduling only; see the "maxConcurrentConsumers" setting. The minimum number of consumers (see "concurrentConsumers") will be kept around until shutdown in any case.

Within each task execution, a number of message reception attempts (according to the "maxMessagesPerTask" setting) will each wait for an incoming message (according to the "receiveTimeout" setting). If all of those receive attempts in a given task return without a message, the task is considered idle with respect to received messages. Such a task may still be rescheduled; however, once it reached the specified "idleTaskExecutionLimit", it will shut down (in case of dynamic scaling).

Raise this limit if you encounter too frequent scaling up and down. With this limit being higher, an idle consumer will be kept around longer, avoiding the restart of a consumer once a new load of messages comes in. Alternatively, specify a higher "maxMessagesPerTask" and/or "receiveTimeout" value, which will also lead to idle consumers being kept around for a longer time (while also increasing the average execution time of each scheduled task).

This setting can be modified at runtime, for example through JMX.

See Also:
setMaxMessagesPerTask(int), AbstractPollingMessageListenerContainer.setReceiveTimeout(long)

getIdleTaskExecutionLimit

public int getIdleTaskExecutionLimit()
Return the limit for idle executions of a receive task.

validateConfiguration

protected void validateConfiguration()
Description copied from class: AbstractJmsListeningContainer
Validate the configuration of this container.

The default implementation is empty. To be overridden in subclasses.

Overrides:
validateConfiguration in class AbstractMessageListenerContainer

initialize

public void initialize()
Description copied from class: AbstractJmsListeningContainer
Initialize this container.

Creates a JMS Connection, starts the Connection (if "autoStartup" hasn't been turned off), and calls AbstractJmsListeningContainer.doInitialize().

Overrides:
initialize in class AbstractPollingMessageListenerContainer

doInitialize

protected void doInitialize()
                     throws JMSException
Creates the specified number of concurrent consumers, in the form of a JMS Session plus associated MessageConsumer running in a separate thread.

Specified by:
doInitialize in class AbstractJmsListeningContainer
Throws:
JMSException - if registration failed
See Also:
scheduleNewInvoker(), setTaskExecutor(java.util.concurrent.Executor)

doShutdown

protected void doShutdown()
                   throws JMSException
Destroy the registered JMS Sessions and associated MessageConsumers.

Specified by:
doShutdown in class AbstractJmsListeningContainer
Throws:
JMSException - if shutdown failed
See Also:
AbstractJmsListeningContainer.shutdown()

start

public void start()
           throws JmsException
Overridden to reset the stop callback, if any.

Specified by:
start in interface Lifecycle
Overrides:
start in class AbstractJmsListeningContainer
Throws:
JmsException - if starting failed
See Also:
AbstractJmsListeningContainer.doStart()

stop

public void stop(Runnable callback)
          throws JmsException
Stop this listener container, invoking the specific callback once all listener processing has actually stopped.

Note: Further stop(runnable) calls (before processing has actually stopped) will override the specified callback. Only the latest specified callback will be invoked.

If a subsequent start() call restarts the listener container before it has fully stopped, the callback will not get invoked at all.

Specified by:
stop in interface SmartLifecycle
Overrides:
stop in class AbstractJmsListeningContainer
Parameters:
callback - the callback to invoke once listener processing has fully stopped
Throws:
JmsException - if stopping failed
See Also:
AbstractJmsListeningContainer.stop()

getScheduledConsumerCount

public final int getScheduledConsumerCount()
Return the number of currently scheduled consumers.

This number will always be inbetween "concurrentConsumers" and "maxConcurrentConsumers", but might be higher than "activeConsumerCount" (in case of some consumers being scheduled but not executed at the moment).

See Also:
getConcurrentConsumers(),
getMaxConcurrentConsumers(),
getActiveConsumerCount()

getActiveConsumerCount

public final int getActiveConsumerCount()
Return the number of currently active consumers.

This number will always be inbetween "concurrentConsumers" and "maxConcurrentConsumers", but might be lower than "scheduledConsumerCount". (in case of some consumers being scheduled but not executed at the moment).

See Also:
getConcurrentConsumers(),
getMaxConcurrentConsumers(),
getActiveConsumerCount()

createDefaultTaskExecutor

protected TaskExecutor createDefaultTaskExecutor()
Create a default TaskExecutor. Called if no explicit TaskExecutor has been specified.

The default implementation builds a SimpleAsyncTaskExecutor with the specified bean name (or the class name, if no bean name specified) as thread name prefix.

See Also:
SimpleAsyncTaskExecutor.SimpleAsyncTaskExecutor(String)

sharedConnectionEnabled

protected final boolean sharedConnectionEnabled()
Use a shared JMS Connection depending on the "cacheLevel" setting.

Specified by:
sharedConnectionEnabled in class AbstractJmsListeningContainer
See Also:
setCacheLevel(int), CACHE_CONNECTION

doRescheduleTask

protected void doRescheduleTask(Object task)
Re-executes the given task via this listener container's TaskExecutor.

Overrides:
doRescheduleTask in class AbstractJmsListeningContainer
Parameters:
task - the task object to reschedule
See Also:
setTaskExecutor(java.util.concurrent.Executor)

messageReceived

protected void messageReceived(Object invoker,
                               Session session)
Tries scheduling a new invoker, since we know messages are coming in...

Overrides:
messageReceived in class AbstractPollingMessageListenerContainer
Parameters:
invoker - the invoker object (passed through)
session - the receiving JMS Session
See Also:
scheduleNewInvokerIfAppropriate()

noMessageReceived

protected void noMessageReceived(Object invoker,
                                 Session session)
Marks the affected invoker as idle.

Overrides:
noMessageReceived in class AbstractPollingMessageListenerContainer
Parameters:
invoker - the invoker object (passed through)
session - the receiving JMS Session

scheduleNewInvokerIfAppropriate

protected void scheduleNewInvokerIfAppropriate()
Schedule a new invoker, increasing the total number of scheduled invokers for this listener container, but only if the specified "maxConcurrentConsumers" limit has not been reached yet, and only if this listener container does not currently have idle invokers that are waiting for new messages already.

Called once a message has been received, to scale up while processing the message in the invoker that originally received it.

See Also:
setTaskExecutor(java.util.concurrent.Executor), getMaxConcurrentConsumers()

establishSharedConnection

protected void establishSharedConnection()
Overridden to accept a failure in the initial setup - leaving it up to the asynchronous invokers to establish the shared Connection on first access.

Overrides:
establishSharedConnection in class AbstractJmsListeningContainer
See Also:
refreshConnectionUntilSuccessful()

startSharedConnection

protected void startSharedConnection()
This implementations proceeds even after an exception thrown from Connection.start(), relying on listeners to perform appropriate recovery.

Overrides:
startSharedConnection in class AbstractJmsListeningContainer
See Also:
Connection.start()

stopSharedConnection

protected void stopSharedConnection()
This implementations proceeds even after an exception thrown from Connection.stop(), relying on listeners to perform appropriate recovery after a restart.

Overrides:
stopSharedConnection in class AbstractJmsListeningContainer
See Also:
Connection.start()

handleListenerSetupFailure

protected void handleListenerSetupFailure(Throwable ex,
                                          boolean alreadyRecovered)
Handle the given exception that arose during setup of a listener. Called for every such exception in every concurrent listener.

The default implementation logs the exception at info level if not recovered yet, and at debug level if already recovered. Can be overridden in subclasses.

Parameters:
ex - the exception to handle
alreadyRecovered - whether a previously executing listener already recovered from the present listener setup failure (this usually indicates a follow-up failure than can be ignored other than for debug log purposes)
See Also:
recoverAfterListenerSetupFailure()

recoverAfterListenerSetupFailure

protected void recoverAfterListenerSetupFailure()
Recover this listener container after a listener failed to set itself up, for example reestablishing the underlying Connection.

The default implementation delegates to DefaultMessageListenerContainer's recovery-capable refreshConnectionUntilSuccessful() method, which will try to re-establish a Connection to the JMS provider both for the shared and the non-shared Connection case.

See Also:
refreshConnectionUntilSuccessful(), refreshDestination()

refreshConnectionUntilSuccessful

protected void refreshConnectionUntilSuccessful()
Refresh the underlying Connection, not returning before an attempt has been successful. Called in case of a shared Connection as well as without shared Connection, so either needs to operate on the shared Connection or on a temporary Connection that just gets established for validation purposes.

The default implementation retries until it successfully established a Connection, for as long as this message listener container is active. Applies the specified recovery interval between retries.

See Also:
setRecoveryInterval(long)

refreshDestination

protected void refreshDestination()
Refresh the JMS destination that this listener container operates on.

Called after listener setup failure, assuming that a cached Destination object might have become invalid (a typical case on WebLogic JMS).

The default implementation removes the destination from a DestinationResolver's cache, in case of a CachingDestinationResolver.

See Also:
AbstractMessageListenerContainer.setDestinationName(java.lang.String), CachingDestinationResolver

sleepInbetweenRecoveryAttempts

protected void sleepInbetweenRecoveryAttempts()
Sleep according to the specified recovery interval. Called inbetween recovery attempts.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultMessageListenerContainer102

org.springframework.jms.listener
Class DefaultMessageListenerContainer102

java.lang.Object
    extended by  org.springframework.jms.support.JmsAccessor
        extended by  org.springframework.jms.support.destination.JmsDestinationAccessor
            extended by  org.springframework.jms.listener.AbstractJmsListeningContainer
                extended by  org.springframework.jms.listener.AbstractMessageListenerContainer
                    extended by  org.springframework.jms.listener.AbstractPollingMessageListenerContainer
                        extended by  org.springframework.jms.listener.DefaultMessageListenerContainer
                            extended by  org.springframework.jms.listener.DefaultMessageListenerContainer102
All Implemented Interfaces:
BeanNameAware, DisposableBean, InitializingBean, Lifecycle, Phased, SmartLifecycle
Deprecated. as of Spring 3.0, in favor of the JMS 1.1 based DefaultMessageListenerContainer

@Deprecated
public class DefaultMessageListenerContainer102
extends DefaultMessageListenerContainer

A subclass of DefaultMessageListenerContainer for the JMS 1.0.2 specification, not relying on JMS 1.1 methods like SimpleMessageListenerContainer itself.

This class can be used for JMS 1.0.2 providers, offering the same facility as DefaultMessageListenerContainer does for JMS 1.1 providers.

Since:
2.0
Author:
Juergen Hoeller

Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.jms.listener.AbstractJmsListeningContainer
AbstractJmsListeningContainer.SharedConnectionNotInitializedException
Field Summary
Fields inherited from class org.springframework.jms.listener.DefaultMessageListenerContainer
CACHE_AUTO, CACHE_CONNECTION, CACHE_CONSUMER, CACHE_NONE, CACHE_SESSION, DEFAULT_RECOVERY_INTERVAL, DEFAULT_THREAD_NAME_PREFIX
Fields inherited from class org.springframework.jms.listener.AbstractPollingMessageListenerContainer
DEFAULT_RECEIVE_TIMEOUT
Fields inherited from class org.springframework.jms.listener.AbstractJmsListeningContainer
lifecycleMonitor, sharedConnectionMonitor
Fields inherited from class org.springframework.jms.support.JmsAccessor
logger
Constructor Summary
DefaultMessageListenerContainer102()
Deprecated.
Method Summary
protected Connection | createConnection() Deprecated. This implementation overrides the superclass method to use JMS 1.0.2 API.
protected MessageConsumer | createConsumer(Session session, Destination destination) Deprecated. This implementation overrides the superclass method to use JMS 1.0.2 API.
protected Session | createSession(Connection con) Deprecated. This implementation overrides the superclass method to use JMS 1.0.2 API.
protected Connection | getConnection(JmsResourceHolder holder) Deprecated. This implementation overrides the superclass method to accept either a QueueConnection or a TopicConnection, depending on the domain.
protected Session | getSession(JmsResourceHolder holder) Deprecated. This implementation overrides the superclass method to accept either a QueueSession or a TopicSession, depending on the domain.
protected boolean | isClientAcknowledge(Session session) Deprecated. This implementation overrides the superclass method to avoid using JMS 1.1's Session getAcknowledgeMode() method.
Methods inherited from class org.springframework.jms.listener.DefaultMessageListenerContainer
createDefaultTaskExecutor, doInitialize, doRescheduleTask, doShutdown, establishSharedConnection, getActiveConsumerCount, getCacheLevel, getConcurrentConsumers, getIdleTaskExecutionLimit, getMaxConcurrentConsumers, getMaxMessagesPerTask, getScheduledConsumerCount, handleListenerSetupFailure, initialize, messageReceived, noMessageReceived, recoverAfterListenerSetupFailure, refreshConnectionUntilSuccessful, refreshDestination, scheduleNewInvokerIfAppropriate, setCacheLevel, setCacheLevelName, setConcurrency, setConcurrentConsumers, setIdleTaskExecutionLimit, setMaxConcurrentConsumers, setMaxMessagesPerTask, setRecoveryInterval, setTaskExecutor, sharedConnectionEnabled, sleepInbetweenRecoveryAttempts, start, startSharedConnection, stop, stopSharedConnection, validateConfiguration
Methods inherited from class org.springframework.jms.listener.AbstractPollingMessageListenerContainer
createListenerConsumer, doReceiveAndExecute, getTransactionManager, isPubSubNoLocal, isSessionLocallyTransacted, receiveAndExecute, receiveMessage, setPubSubNoLocal, setReceiveTimeout, setSessionTransacted, setTransactionManager, setTransactionName, setTransactionTimeout
Methods inherited from class org.springframework.jms.listener.AbstractMessageListenerContainer
checkMessageListener, commitIfNecessary, doExecuteListener, doInvokeListener, doInvokeListener, executeListener, getDefaultSubscriptionName, getDestination, getDestinationDescription, getDestinationName, getDurableSubscriptionName, getExceptionListener, getMessageListener, getMessageSelector, handleListenerException, invokeErrorHandler, invokeExceptionListener, invokeListener, isAcceptMessagesWhileStopping, isExposeListenerSession, isSubscriptionDurable, rollbackIfNecessary, rollbackOnExceptionIfNecessary, setAcceptMessagesWhileStopping, setDestination, setDestinationName, setDurableSubscriptionName, setErrorHandler, setExceptionListener, setExposeListenerSession, setMessageListener, setMessageSelector, setSubscriptionDurable
Methods inherited from class org.springframework.jms.listener.AbstractJmsListeningContainer
afterPropertiesSet, createSharedConnection, destroy, doStart, doStop, getBeanName, getClientId, getPausedTaskCount, getPhase, getSharedConnection, isActive, isAutoStartup, isRunning, logRejectedTask, prepareSharedConnection, refreshSharedConnection, rescheduleTaskIfNecessary, resumePausedTasks, runningAllowed, setAutoStartup, setBeanName, setClientId, setPhase, shutdown, stop
Methods inherited from class org.springframework.jms.support.destination.JmsDestinationAccessor
getDestinationResolver, isPubSubDomain, resolveDestinationName, setDestinationResolver, setPubSubDomain
Methods inherited from class org.springframework.jms.support.JmsAccessor
convertJmsAccessException, getConnectionFactory, getSessionAcknowledgeMode, isSessionTransacted, setConnectionFactory, setSessionAcknowledgeMode, setSessionAcknowledgeModeName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.BeanNameAware
setBeanName

Constructor Detail

DefaultMessageListenerContainer102

public DefaultMessageListenerContainer102()
Deprecated.
Method Detail

getConnection

protected Connection getConnection(JmsResourceHolder holder)
Deprecated.
This implementation overrides the superclass method to accept either a QueueConnection or a TopicConnection, depending on the domain.

Overrides:
getConnection in class AbstractPollingMessageListenerContainer
Parameters:
holder - the JmsResourceHolder
Returns:
an appropriate Connection fetched from the holder, or null if none found

getSession

protected Session getSession(JmsResourceHolder holder)
Deprecated.
This implementation overrides the superclass method to accept either a QueueSession or a TopicSession, depending on the domain.

Overrides:
getSession in class AbstractPollingMessageListenerContainer
Parameters:
holder - the JmsResourceHolder
Returns:
an appropriate Session fetched from the holder, or null if none found

createConnection

protected Connection createConnection()
                               throws JMSException
Deprecated.
This implementation overrides the superclass method to use JMS 1.0.2 API.

Overrides:
createConnection in class JmsAccessor
Returns:
the new JMS Connection
Throws:
JMSException - if thrown by JMS API methods
See Also:
ConnectionFactory.createConnection()

createSession

protected Session createSession(Connection con)
                         throws JMSException
Deprecated.
This implementation overrides the superclass method to use JMS 1.0.2 API.

Overrides:
createSession in class JmsAccessor
Parameters:
con - the JMS Connection to create a Session for
Returns:
the new JMS Session
Throws:
JMSException - if thrown by JMS API methods
See Also:
Connection.createSession(boolean, int)

createConsumer

protected MessageConsumer createConsumer(Session session,
                                         Destination destination)
                                  throws JMSException
Deprecated.
This implementation overrides the superclass method to use JMS 1.0.2 API.

Overrides:
createConsumer in class AbstractPollingMessageListenerContainer
Parameters:
session - the JMS Session to create a MessageConsumer for
destination - the JMS Destination to create a MessageConsumer for
Returns:
the new JMS MessageConsumer
Throws:
JMSException - if thrown by JMS API methods

isClientAcknowledge

protected boolean isClientAcknowledge(Session session)
                               throws JMSException
Deprecated.
This implementation overrides the superclass method to avoid using JMS 1.1's Session getAcknowledgeMode() method. The best we can do here is to check the setting on the listener container.

Overrides:
isClientAcknowledge in class JmsAccessor
Parameters:
session - the JMS Session to check
Returns:
whether the given Session is in client acknowledge mode
Throws:
JMSException - if thrown by JMS API methods
See Also:
Session.getAcknowledgeMode(), Session.CLIENT_ACKNOWLEDGE
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleMessageListenerContainer

org.springframework.jms.listener
Class SimpleMessageListenerContainer

java.lang.Object
    extended by  org.springframework.jms.support.JmsAccessor
        extended by  org.springframework.jms.support.destination.JmsDestinationAccessor
            extended by  org.springframework.jms.listener.AbstractJmsListeningContainer
                extended by  org.springframework.jms.listener.AbstractMessageListenerContainer
                    extended by  org.springframework.jms.listener.SimpleMessageListenerContainer
All Implemented Interfaces:
ExceptionListener, BeanNameAware, DisposableBean, InitializingBean, Lifecycle, Phased, SmartLifecycle
Direct Known Subclasses:
SimpleMessageListenerContainer102
public class SimpleMessageListenerContainer
extends AbstractMessageListenerContainer
implements ExceptionListener

Message listener container that uses the plain JMS client API's MessageConsumer.setMessageListener() method to create concurrent MessageConsumers for the specified listeners.

This is the simplest form of a message listener container. It creates a fixed number of JMS Sessions to invoke the listener, not allowing for dynamic adaptation to runtime demands. Its main advantage is its low level of complexity and the minimum requirements on the JMS provider: Not even the ServerSessionPool facility is required.

See the AbstractMessageListenerContainer javadoc for details on acknowledge modes and transaction options.

For a different style of MessageListener handling, through looped MessageConsumer.receive() calls that also allow for transactional reception of messages (registering them with XA transactions), see DefaultMessageListenerContainer.

Since:
2.0
Author:
Juergen Hoeller
See Also:
MessageConsumer.setMessageListener(javax.jms.MessageListener), DefaultMessageListenerContainer, JmsMessageEndpointManager

Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.jms.listener.AbstractJmsListeningContainer
AbstractJmsListeningContainer.SharedConnectionNotInitializedException
Field Summary
Fields inherited from class org.springframework.jms.listener.AbstractJmsListeningContainer
lifecycleMonitor, sharedConnectionMonitor
Fields inherited from class org.springframework.jms.support.JmsAccessor
logger
Constructor Summary
SimpleMessageListenerContainer()
Method Summary
protected MessageConsumer | createConsumer(Session session, Destination destination) Create a JMS MessageConsumer for the given Session and Destination.
protected MessageConsumer | createListenerConsumer(Session session) Create a MessageConsumer for the given JMS Session, registering a MessageListener for the specified listener.
protected void | doInitialize() Creates the specified number of concurrent consumers, in the form of a JMS Session plus associated MessageConsumer.
protected void | doShutdown() Destroy the registered JMS Sessions and associated MessageConsumers.
protected void | doStart() Re-initializes this container's JMS message consumers, if not initialized already.
protected void | initializeConsumers() Initialize the JMS Sessions and MessageConsumers for this container.
protected boolean | isPubSubNoLocal() Return whether to inhibit the delivery of messages published by its own connection.
void | onException(JMSException ex) JMS ExceptionListener implementation, invoked by the JMS provider in case of connection failures.
protected void | prepareSharedConnection(Connection connection) Registers this listener container as JMS ExceptionListener on the shared connection.
protected void | processMessage(Message message, Session session) Process a message received from the provider.
void | setConcurrency(String concurrency) Specify concurrency limits via a "lower-upper" String, e.g.
void | setConcurrentConsumers(int concurrentConsumers) Specify the number of concurrent consumers to create.
void | setPubSubNoLocal(boolean pubSubNoLocal) Set whether to inhibit the delivery of messages published by its own connection.
void | setTaskExecutor(Executor taskExecutor) Set the Spring TaskExecutor to use for executing the listener once a message has been received by the provider.
protected boolean | sharedConnectionEnabled() Always use a shared JMS Connection.
protected void | validateConfiguration() Validate the configuration of this container.
Methods inherited from class org.springframework.jms.listener.AbstractMessageListenerContainer
checkMessageListener, commitIfNecessary, doExecuteListener, doInvokeListener, doInvokeListener, executeListener, getDefaultSubscriptionName, getDestination, getDestinationDescription, getDestinationName, getDurableSubscriptionName, getExceptionListener, getMessageListener, getMessageSelector, handleListenerException, invokeErrorHandler, invokeExceptionListener, invokeListener, isAcceptMessagesWhileStopping, isExposeListenerSession, isSessionLocallyTransacted, isSubscriptionDurable, rollbackIfNecessary, rollbackOnExceptionIfNecessary, setAcceptMessagesWhileStopping, setDestination, setDestinationName, setDurableSubscriptionName, setErrorHandler, setExceptionListener, setExposeListenerSession, setMessageListener, setMessageSelector, setSubscriptionDurable
Methods inherited from class org.springframework.jms.listener.AbstractJmsListeningContainer
afterPropertiesSet, createSharedConnection, destroy, doRescheduleTask, doStop, establishSharedConnection, getBeanName, getClientId, getPausedTaskCount, getPhase, getSharedConnection, initialize, isActive, isAutoStartup, isRunning, logRejectedTask, refreshSharedConnection, rescheduleTaskIfNecessary, resumePausedTasks, runningAllowed, setAutoStartup, setBeanName, setClientId, setPhase, shutdown, start, startSharedConnection, stop, stop, stopSharedConnection
Methods inherited from class org.springframework.jms.support.destination.JmsDestinationAccessor
getDestinationResolver, isPubSubDomain, resolveDestinationName, setDestinationResolver, setPubSubDomain
Methods inherited from class org.springframework.jms.support.JmsAccessor
convertJmsAccessException, createConnection, createSession, getConnectionFactory, getSessionAcknowledgeMode, isClientAcknowledge, isSessionTransacted, setConnectionFactory, setSessionAcknowledgeMode, setSessionAcknowledgeModeName, setSessionTransacted
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleMessageListenerContainer

public SimpleMessageListenerContainer()
Method Detail

setPubSubNoLocal

public void setPubSubNoLocal(boolean pubSubNoLocal)
Set whether to inhibit the delivery of messages published by its own connection. Default is "false".

See Also:
TopicSession.createSubscriber(javax.jms.Topic, String, boolean)

isPubSubNoLocal

protected boolean isPubSubNoLocal()
Return whether to inhibit the delivery of messages published by its own connection.

setConcurrency

public void setConcurrency(String concurrency)
Specify concurrency limits via a "lower-upper" String, e.g. "5-10", or a simple upper limit String, e.g. "10".

This listener container will always hold on to the maximum number of consumers setConcurrentConsumers(int) since it is unable to scale.

This property is primarily supported for configuration compatibility with DefaultMessageListenerContainer. For this local listener container, generally use setConcurrentConsumers(int) instead.

setConcurrentConsumers

public void setConcurrentConsumers(int concurrentConsumers)
Specify the number of concurrent consumers to create. Default is 1.

Raising the number of concurrent consumers is recommendable in order to scale the consumption of messages coming in from a queue. However, note that any ordering guarantees are lost once multiple consumers are registered. In general, stick with 1 consumer for low-volume queues.

Do not raise the number of concurrent consumers for a topic. This would lead to concurrent consumption of the same message, which is hardly ever desirable.

setTaskExecutor

public void setTaskExecutor(Executor taskExecutor)
Set the Spring TaskExecutor to use for executing the listener once a message has been received by the provider.

Default is none, that is, to run in the JMS provider's own receive thread, blocking the provider's receive endpoint while executing the listener.

Specify a TaskExecutor for executing the listener in a different thread, rather than blocking the JMS provider, usually integrating with an existing thread pool. This allows to keep the number of concurrent consumers low (1) while still processing messages concurrently (decoupled from receiving!).

NOTE: Specifying a TaskExecutor for listener execution affects acknowledgement semantics. Messages will then always get acknowledged before listener execution, with the underlying Session immediately reused for receiving the next message. Using this in combination with a transacted session or with client acknowledgement will lead to unspecified results!

NOTE: Concurrent listener execution via a TaskExecutor will lead to concurrent processing of messages that have been received by the same underlying Session. As a consequence, it is not recommended to use this setting with a SessionAwareMessageListener, at least not if the latter performs actual work on the given Session. A standard MessageListener will work fine, in general.

See Also:
setConcurrentConsumers(int), SimpleAsyncTaskExecutor, WorkManagerTaskExecutor

validateConfiguration

protected void validateConfiguration()
Description copied from class: AbstractJmsListeningContainer
Validate the configuration of this container.

The default implementation is empty. To be overridden in subclasses.

Overrides:
validateConfiguration in class AbstractMessageListenerContainer

sharedConnectionEnabled

protected final boolean sharedConnectionEnabled()
Always use a shared JMS Connection.

Specified by:
sharedConnectionEnabled in class AbstractJmsListeningContainer
See Also:
AbstractJmsListeningContainer.getSharedConnection()

doInitialize

protected void doInitialize()
                     throws JMSException
Creates the specified number of concurrent consumers, in the form of a JMS Session plus associated MessageConsumer.

Specified by:
doInitialize in class AbstractJmsListeningContainer
Throws:
JMSException - if registration failed
See Also:
createListenerConsumer(javax.jms.Session)

doStart

protected void doStart()
                throws JMSException
Re-initializes this container's JMS message consumers, if not initialized already.

Overrides:
doStart in class AbstractJmsListeningContainer
Throws:
JMSException - if thrown by JMS API methods
See Also:
AbstractJmsListeningContainer.startSharedConnection()

prepareSharedConnection

protected void prepareSharedConnection(Connection connection)
                                throws JMSException
Registers this listener container as JMS ExceptionListener on the shared connection.

Overrides:
prepareSharedConnection in class AbstractJmsListeningContainer
Parameters:
connection - the Connection to prepare
Throws:
JMSException - if the preparation efforts failed
See Also:
AbstractJmsListeningContainer.getClientId()

onException

public void onException(JMSException ex)
JMS ExceptionListener implementation, invoked by the JMS provider in case of connection failures. Re-initializes this listener container's shared connection and its sessions and consumers.

Specified by:
onException in interface ExceptionListener
Parameters:
ex - the reported connection exception

initializeConsumers

protected void initializeConsumers()
                            throws JMSException
Initialize the JMS Sessions and MessageConsumers for this container.

Throws:
JMSException - in case of setup failure

createListenerConsumer

protected MessageConsumer createListenerConsumer(Session session)
                                          throws JMSException
Create a MessageConsumer for the given JMS Session, registering a MessageListener for the specified listener.

Parameters:
session - the JMS Session to work on
Returns:
the MessageConsumer
Throws:
JMSException - if thrown by JMS methods
See Also:
AbstractMessageListenerContainer.executeListener(javax.jms.Session, javax.jms.Message)

processMessage

protected void processMessage(Message message,
                              Session session)
Process a message received from the provider.

Executes the listener, exposing the current JMS Session as thread-bound resource (if "exposeListenerSession" is "true").

Parameters:
message - the received JMS Message
session - the JMS Session to operate on
See Also:
AbstractMessageListenerContainer.executeListener(javax.jms.Session, javax.jms.Message), AbstractMessageListenerContainer.setExposeListenerSession(boolean)

doShutdown

protected void doShutdown()
                   throws JMSException
Destroy the registered JMS Sessions and associated MessageConsumers.

Specified by:
doShutdown in class AbstractJmsListeningContainer
Throws:
JMSException - if shutdown failed
See Also:
AbstractJmsListeningContainer.shutdown()

createConsumer

protected MessageConsumer createConsumer(Session session,
                                         Destination destination)
                                  throws JMSException
Create a JMS MessageConsumer for the given Session and Destination.

This implementation uses JMS 1.1 API.

Parameters:
session - the JMS Session to create a MessageConsumer for
destination - the JMS Destination to create a MessageConsumer for
Returns:
the new JMS MessageConsumer
Throws:
JMSException - if thrown by JMS API methods
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleMessageListenerContainer102

org.springframework.jms.listener
Class SimpleMessageListenerContainer102

java.lang.Object
    extended by  org.springframework.jms.support.JmsAccessor
        extended by  org.springframework.jms.support.destination.JmsDestinationAccessor
            extended by  org.springframework.jms.listener.AbstractJmsListeningContainer
                extended by  org.springframework.jms.listener.AbstractMessageListenerContainer
                    extended by  org.springframework.jms.listener.SimpleMessageListenerContainer
                        extended by  org.springframework.jms.listener.SimpleMessageListenerContainer102
All Implemented Interfaces:
ExceptionListener, BeanNameAware, DisposableBean, InitializingBean, Lifecycle, Phased, SmartLifecycle
Deprecated. as of Spring 3.0, in favor of the JMS 1.1 based SimpleMessageListenerContainer

@Deprecated
public class SimpleMessageListenerContainer102
extends SimpleMessageListenerContainer

A subclass of SimpleMessageListenerContainer for the JMS 1.0.2 specification, not relying on JMS 1.1 methods like SimpleMessageListenerContainer itself.

This class can be used for JMS 1.0.2 providers, offering the same facility as SimpleMessageListenerContainer does for JMS 1.1 providers.

Since:
2.0
Author:
Juergen Hoeller

Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.jms.listener.AbstractJmsListeningContainer
AbstractJmsListeningContainer.SharedConnectionNotInitializedException
Field Summary
Fields inherited from class org.springframework.jms.listener.AbstractJmsListeningContainer
lifecycleMonitor, sharedConnectionMonitor
Fields inherited from class org.springframework.jms.support.JmsAccessor
logger
Constructor Summary
SimpleMessageListenerContainer102()
Deprecated.
Method Summary
protected Connection | createConnection() Deprecated. This implementation overrides the superclass method to use JMS 1.0.2 API.
protected MessageConsumer | createConsumer(Session session, Destination destination) Deprecated. This implementation overrides the superclass method to use JMS 1.0.2 API.
protected Session | createSession(Connection con) Deprecated. This implementation overrides the superclass method to use JMS 1.0.2 API.
protected boolean | isClientAcknowledge(Session session) Deprecated. This implementation overrides the superclass method to avoid using JMS 1.1's Session getAcknowledgeMode() method.
Methods inherited from class org.springframework.jms.listener.SimpleMessageListenerContainer
createListenerConsumer, doInitialize, doShutdown, doStart, initializeConsumers, isPubSubNoLocal, onException, prepareSharedConnection, processMessage, setConcurrency, setConcurrentConsumers, setPubSubNoLocal, setTaskExecutor, sharedConnectionEnabled, validateConfiguration
Methods inherited from class org.springframework.jms.listener.AbstractMessageListenerContainer
checkMessageListener, commitIfNecessary, doExecuteListener, doInvokeListener, doInvokeListener, executeListener, getDefaultSubscriptionName, getDestination, getDestinationDescription, getDestinationName, getDurableSubscriptionName, getExceptionListener, getMessageListener, getMessageSelector, handleListenerException, invokeErrorHandler, invokeExceptionListener, invokeListener, isAcceptMessagesWhileStopping, isExposeListenerSession, isSessionLocallyTransacted, isSubscriptionDurable, rollbackIfNecessary, rollbackOnExceptionIfNecessary, setAcceptMessagesWhileStopping, setDestination, setDestinationName, setDurableSubscriptionName, setErrorHandler, setExceptionListener, setExposeListenerSession, setMessageListener, setMessageSelector, setSubscriptionDurable
Methods inherited from class org.springframework.jms.listener.AbstractJmsListeningContainer
afterPropertiesSet, createSharedConnection, destroy, doRescheduleTask, doStop, establishSharedConnection, getBeanName, getClientId, getPausedTaskCount, getPhase, getSharedConnection, initialize, isActive, isAutoStartup, isRunning, logRejectedTask, refreshSharedConnection, rescheduleTaskIfNecessary, resumePausedTasks, runningAllowed, setAutoStartup, setBeanName, setClientId, setPhase, shutdown, start, startSharedConnection, stop, stop, stopSharedConnection
Methods inherited from class org.springframework.jms.support.destination.JmsDestinationAccessor
getDestinationResolver, isPubSubDomain, resolveDestinationName, setDestinationResolver, setPubSubDomain
Methods inherited from class org.springframework.jms.support.JmsAccessor
convertJmsAccessException, getConnectionFactory, getSessionAcknowledgeMode, isSessionTransacted, setConnectionFactory, setSessionAcknowledgeMode, setSessionAcknowledgeModeName, setSessionTransacted
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleMessageListenerContainer102

public SimpleMessageListenerContainer102()
Deprecated.
Method Detail

createConnection

protected Connection createConnection()
                               throws JMSException
Deprecated.
This implementation overrides the superclass method to use JMS 1.0.2 API.

Overrides:
createConnection in class JmsAccessor
Returns:
the new JMS Connection
Throws:
JMSException - if thrown by JMS API methods
See Also:
ConnectionFactory.createConnection()

createSession

protected Session createSession(Connection con)
                         throws JMSException
Deprecated.
This implementation overrides the superclass method to use JMS 1.0.2 API.

Overrides:
createSession in class JmsAccessor
Parameters:
con - the JMS Connection to create a Session for
Returns:
the new JMS Session
Throws:
JMSException - if thrown by JMS API methods
See Also:
Connection.createSession(boolean, int)

createConsumer

protected MessageConsumer createConsumer(Session session,
                                         Destination destination)
                                  throws JMSException
Deprecated.
This implementation overrides the superclass method to use JMS 1.0.2 API.

Overrides:
createConsumer in class SimpleMessageListenerContainer
Parameters:
session - the JMS Session to create a MessageConsumer for
destination - the JMS Destination to create a MessageConsumer for
Returns:
the new JMS MessageConsumer
Throws:
JMSException - if thrown by JMS API methods

isClientAcknowledge

protected boolean isClientAcknowledge(Session session)
                               throws JMSException
Deprecated.
This implementation overrides the superclass method to avoid using JMS 1.1's Session getAcknowledgeMode() method. The best we can do here is to check the setting on the listener container.

Overrides:
isClientAcknowledge in class JmsAccessor
Parameters:
session - the JMS Session to check
Returns:
whether the given Session is in client acknowledge mode
Throws:
JMSException - if thrown by JMS API methods
See Also:
Session.getAcknowledgeMode(), Session.CLIENT_ACKNOWLEDGE
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.jms.listener.adapter

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jms.listener.adapter

Message listener adapter mechanism that delegates to target listener methods, converting messages to appropriate message content types (such as String or byte array) that get passed into listener methods.

See:
Description

Class Summary
MessageListenerAdapter | Message listener adapter that delegates the handling of messages to target listener methods via reflection, with flexible message type conversion.
MessageListenerAdapter102 | Deprecated. as of Spring 3.0, in favor of the JMS 1.1 based MessageListenerAdapter

Exception Summary
ListenerExecutionFailedException Exception to be thrown when the execution of a listener method failed.

Package org.springframework.jms.listener.adapter Description

Message listener adapter mechanism that delegates to target listener methods, converting messages to appropriate message content types (such as String or byte array) that get passed into listener methods.


org.springframework.jms.listener.adapter Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jms.listener.adapter

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jms.listener.adapter.MessageListenerAdapter (implements javax.jms.MessageListener, org.springframework.jms.listener.SessionAwareMessageListener<M>, org.springframework.jms.listener.SubscriptionNameProvider)
      • org.springframework.jms.listener.adapter.MessageListenerAdapter102
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.jms.JmsException
              • org.springframework.jms.listener.adapter.ListenerExecutionFailedException


MessageListenerAdapter

org.springframework.jms.listener.adapter
Class MessageListenerAdapter

java.lang.Object
    extended by  org.springframework.jms.listener.adapter.MessageListenerAdapter
All Implemented Interfaces:
MessageListener, SessionAwareMessageListener<Message>, SubscriptionNameProvider
Direct Known Subclasses:
MessageListenerAdapter102
public class MessageListenerAdapter
extends Object
implements MessageListener, SessionAwareMessageListener<Message>, SubscriptionNameProvider

Message listener adapter that delegates the handling of messages to target listener methods via reflection, with flexible message type conversion. Allows listener methods to operate on message content types, completely independent from the JMS API.

By default, the content of incoming JMS messages gets extracted before being passed into the target listener method, to let the target method operate on message content types such as String or byte array instead of the raw Message. Message type conversion is delegated to a Spring JMS MessageConverter. By default, a SimpleMessageConverter will be used. (If you do not want such automatic message conversion taking place, then be sure to set the MessageConverter to null.)

If a target listener method returns a non-null object (typically of a message content type such as String or byte array), it will get wrapped in a JMS Message and sent to the response destination (either the JMS "reply-to" destination or a specified default destination).

Note: The sending of response messages is only available when using the SessionAwareMessageListener entry point (typically through a Spring message listener container). Usage as standard JMS MessageListener does not support the generation of response messages.

Find below some examples of method signatures compliant with this adapter class. This first example handles all Message types and gets passed the contents of each Message type as an argument. No Message will be sent back as all of these methods return void.

public interface MessageContentsDelegate {
    void handleMessage(String text);
    void handleMessage(Map map);
    void handleMessage(byte[] bytes);
    void handleMessage(Serializable obj);
 }
This next example handles all Message types and gets passed the actual (raw) Message as an argument. Again, no Message will be sent back as all of these methods return void.
public interface RawMessageDelegate {
    void handleMessage(TextMessage message);
    void handleMessage(MapMessage message);
    void handleMessage(BytesMessage message);
    void handleMessage(ObjectMessage message);
 }
This next example illustrates a Message delegate that just consumes the String contents of TextMessages. Notice also how the name of the Message handling method is different from the original (this will have to be configured in the attandant bean definition). Again, no Message will be sent back as the method returns void.
public interface TextMessageContentDelegate {
    void onMessage(String text);
 }
This final example illustrates a Message delegate that just consumes the String contents of TextMessages. Notice how the return type of this method is String: This will result in the configured MessageListenerAdapter sending a TextMessage in response.
public interface ResponsiveTextMessageContentDelegate {
    String handleMessage(String text);
 }
For further examples and discussion please do refer to the Spring reference documentation which describes this class (and it's attendant XML configuration) in detail.

Since:
2.0
Author:
Juergen Hoeller
See Also:
setDelegate(java.lang.Object),
setDefaultListenerMethod(java.lang.String),
setDefaultResponseDestination(javax.jms.Destination),
setMessageConverter(org.springframework.jms.support.converter.MessageConverter),
SimpleMessageConverter,
SessionAwareMessageListener,
AbstractMessageListenerContainer.setMessageListener(java.lang.Object)

Field Summary
protected Log | logger Logger available to subclasses
static String | ORIGINAL_DEFAULT_LISTENER_METHOD Out-of-the-box value for the default listener method: "handleMessage".
Constructor Summary
MessageListenerAdapter()
Create a new MessageListenerAdapter with default settings.
MessageListenerAdapter(Object delegate)
Create a new MessageListenerAdapter for the given delegate.
Method Summary
protected Object[] | buildListenerArguments(Object extractedMessage) Build an array of arguments to be passed into the target listener method.
protected Message | buildMessage(Session session, Object result) Build a JMS message to be sent as response based on the given result object.
protected Object | extractMessage(Message message) Extract the message body from the given JMS message.
protected String | getDefaultListenerMethod() Return the name of the default listener method to delegate to.
protected Object | getDelegate() Return the target object to delegate message listening to.
protected DestinationResolver | getDestinationResolver() Return the DestinationResolver for this adapter.
protected String | getListenerMethodName(Message originalMessage, Object extractedMessage) Determine the name of the listener method that is supposed to handle the given message.
protected MessageConverter | getMessageConverter() Return the converter that will convert incoming JMS messages to listener method arguments, and objects returned from listener methods back to JMS messages.
protected Destination | getResponseDestination(Message request, Message response, Session session) Determine a response destination for the given message.
String | getSubscriptionName() Determine the subscription name for this message listener object.
protected void | handleListenerException(Throwable ex) Handle the given exception that arose during listener execution.
protected void | handleResult(Object result, Message request, Session session) Handle the given result object returned from the listener method, sending a response message back.
protected void | initDefaultStrategies() Initialize the default implementations for the adapter's strategies.
protected Object | invokeListenerMethod(String methodName, Object[] arguments) Invoke the specified listener method.
void | onMessage(Message message) Standard JMS MessageListener entry point.
void | onMessage(Message message, Session session) Spring SessionAwareMessageListener entry point.
protected void | postProcessProducer(MessageProducer producer, Message response) Post-process the given message producer before using it to send the response.
protected void | postProcessResponse(Message request, Message response) Post-process the given response message before it will be sent.
protected Destination | resolveDefaultResponseDestination(Session session) Resolve the default response destination into a JMS Destination, using this accessor's DestinationResolver in case of a destination name.
protected void | sendResponse(Session session, Destination destination, Message response) Send the given response message to the given destination.
void | setDefaultListenerMethod(String defaultListenerMethod) Specify the name of the default listener method to delegate to, for the case where no specific listener method has been determined.
void | setDefaultResponseDestination(Destination destination) Set the default destination to send response messages to.
void | setDefaultResponseQueueName(String destinationName) Set the name of the default response queue to send response messages to.
void | setDefaultResponseTopicName(String destinationName) Set the name of the default response topic to send response messages to.
void | setDelegate(Object delegate) Set a target object to delegate message listening to.
void | setDestinationResolver(DestinationResolver destinationResolver) Set the DestinationResolver that should be used to resolve response destination names for this adapter.
void | setMessageConverter(MessageConverter messageConverter) Set the converter that will convert incoming JMS messages to listener method arguments, and objects returned from listener methods back to JMS messages.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

ORIGINAL_DEFAULT_LISTENER_METHOD

public static final String ORIGINAL_DEFAULT_LISTENER_METHOD
Out-of-the-box value for the default listener method: "handleMessage".

See Also:
Constant Field Values

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

MessageListenerAdapter

public MessageListenerAdapter()
Create a new MessageListenerAdapter with default settings.

MessageListenerAdapter

public MessageListenerAdapter(Object delegate)
Create a new MessageListenerAdapter for the given delegate.

Parameters:
delegate - the delegate object
Method Detail

setDelegate

public void setDelegate(Object delegate)
Set a target object to delegate message listening to. Specified listener methods have to be present on this target object.

If no explicit delegate object has been specified, listener methods are expected to present on this adapter instance, that is, on a custom subclass of this adapter, defining listener methods.

getDelegate

protected Object getDelegate()
Return the target object to delegate message listening to.

setDefaultListenerMethod

public void setDefaultListenerMethod(String defaultListenerMethod)
Specify the name of the default listener method to delegate to, for the case where no specific listener method has been determined. Out-of-the-box value is "handleMessage".

See Also:
getListenerMethodName(javax.jms.Message, java.lang.Object)

getDefaultListenerMethod

protected String getDefaultListenerMethod()
Return the name of the default listener method to delegate to.

setDefaultResponseDestination

public void setDefaultResponseDestination(Destination destination)
Set the default destination to send response messages to. This will be applied in case of a request message that does not carry a "JMSReplyTo" field.

Response destinations are only relevant for listener methods that return result objects, which will be wrapped in a response message and sent to a response destination.

Alternatively, specify a "defaultResponseQueueName" or "defaultResponseTopicName", to be dynamically resolved via the DestinationResolver.

See Also:
setDefaultResponseQueueName(String), setDefaultResponseTopicName(String), getResponseDestination(javax.jms.Message, javax.jms.Message, javax.jms.Session)

setDefaultResponseQueueName

public void setDefaultResponseQueueName(String destinationName)
Set the name of the default response queue to send response messages to. This will be applied in case of a request message that does not carry a "JMSReplyTo" field.

Alternatively, specify a JMS Destination object as "defaultResponseDestination".

See Also:
setDestinationResolver(org.springframework.jms.support.destination.DestinationResolver), setDefaultResponseDestination(javax.jms.Destination)

setDefaultResponseTopicName

public void setDefaultResponseTopicName(String destinationName)
Set the name of the default response topic to send response messages to. This will be applied in case of a request message that does not carry a "JMSReplyTo" field.

Alternatively, specify a JMS Destination object as "defaultResponseDestination".

See Also:
setDestinationResolver(org.springframework.jms.support.destination.DestinationResolver), setDefaultResponseDestination(javax.jms.Destination)

setDestinationResolver

public void setDestinationResolver(DestinationResolver destinationResolver)
Set the DestinationResolver that should be used to resolve response destination names for this adapter.

The default resolver is a DynamicDestinationResolver. Specify a JndiDestinationResolver for resolving destination names as JNDI locations.

See Also:
DynamicDestinationResolver, JndiDestinationResolver

getDestinationResolver

protected DestinationResolver getDestinationResolver()
Return the DestinationResolver for this adapter.

setMessageConverter

public void setMessageConverter(MessageConverter messageConverter)
Set the converter that will convert incoming JMS messages to listener method arguments, and objects returned from listener methods back to JMS messages.

The default converter is a SimpleMessageConverter, which is able to handle BytesMessages, TextMessages and ObjectMessages.

getMessageConverter

protected MessageConverter getMessageConverter()
Return the converter that will convert incoming JMS messages to listener method arguments, and objects returned from listener methods back to JMS messages.

onMessage

public void onMessage(Message message)
Standard JMS MessageListener entry point.

Delegates the message to the target listener method, with appropriate conversion of the message argument. In case of an exception, the handleListenerException(Throwable) method will be invoked.

Note: Does not support sending response messages based on result objects returned from listener methods. Use the SessionAwareMessageListener entry point (typically through a Spring message listener container) for handling result objects as well.

Specified by:
onMessage in interface MessageListener
Parameters:
message - the incoming JMS message
See Also:
handleListenerException(java.lang.Throwable), onMessage(javax.jms.Message, javax.jms.Session)

onMessage

public void onMessage(Message message,
                      Session session)
               throws JMSException
Spring SessionAwareMessageListener entry point.

Delegates the message to the target listener method, with appropriate conversion of the message argument. If the target method returns a non-null object, wrap in a JMS message and send it back.

Specified by:
onMessage in interface SessionAwareMessageListener<Message>
Parameters:
message - the incoming JMS message
session - the JMS session to operate on
Throws:
JMSException - if thrown by JMS API methods

getSubscriptionName

public String getSubscriptionName()
Description copied from interface: SubscriptionNameProvider
Determine the subscription name for this message listener object.

Specified by:
getSubscriptionName in interface SubscriptionNameProvider

initDefaultStrategies

protected void initDefaultStrategies()
Initialize the default implementations for the adapter's strategies.

See Also:
setMessageConverter(org.springframework.jms.support.converter.MessageConverter), SimpleMessageConverter

handleListenerException

protected void handleListenerException(Throwable ex)
Handle the given exception that arose during listener execution. The default implementation logs the exception at error level.

This method only applies when used as standard JMS MessageListener. In case of the Spring SessionAwareMessageListener mechanism, exceptions get handled by the caller instead.

Parameters:
ex - the exception to handle
See Also:
onMessage(javax.jms.Message)

extractMessage

protected Object extractMessage(Message message)
                         throws JMSException
Extract the message body from the given JMS message.

Parameters:
message - the JMS Message
Returns:
the content of the message, to be passed into the listener method as argument
Throws:
JMSException - if thrown by JMS API methods

getListenerMethodName

protected String getListenerMethodName(Message originalMessage,
                                       Object extractedMessage)
                                throws JMSException
Determine the name of the listener method that is supposed to handle the given message.

The default implementation simply returns the configured default listener method, if any.

Parameters:
originalMessage - the JMS request message
extractedMessage - the converted JMS request message, to be passed into the listener method as argument
Returns:
the name of the listener method (never null)
Throws:
JMSException - if thrown by JMS API methods
See Also:
setDefaultListenerMethod(java.lang.String)

buildListenerArguments

protected Object[] buildListenerArguments(Object extractedMessage)
Build an array of arguments to be passed into the target listener method. Allows for multiple method arguments to be built from a single message object.

The default implementation builds an array with the given message object as sole element. This means that the extracted message will always be passed into a single method argument, even if it is an array, with the target method having a corresponding single argument of the array's type declared.

This can be overridden to treat special message content such as arrays differently, for example passing in each element of the message array as distinct method argument.

Parameters:
extractedMessage - the content of the message
Returns:
the array of arguments to be passed into the listener method (each element of the array corresponding to a distinct method argument)

invokeListenerMethod

protected Object invokeListenerMethod(String methodName,
                                      Object[] arguments)
                               throws JMSException
Invoke the specified listener method.

Parameters:
methodName - the name of the listener method
arguments - the message arguments to be passed in
Returns:
the result returned from the listener method
Throws:
JMSException - if thrown by JMS API methods
See Also:
getListenerMethodName(javax.jms.Message, java.lang.Object), buildListenerArguments(java.lang.Object)

handleResult

protected void handleResult(Object result,
                            Message request,
                            Session session)
                     throws JMSException
Handle the given result object returned from the listener method, sending a response message back.

Parameters:
result - the result object to handle (never null)
request - the original request message
session - the JMS Session to operate on (may be null)
Throws:
JMSException - if thrown by JMS API methods
See Also:
buildMessage(javax.jms.Session, java.lang.Object),
postProcessResponse(javax.jms.Message, javax.jms.Message),
getResponseDestination(javax.jms.Message, javax.jms.Message, javax.jms.Session),
sendResponse(javax.jms.Session, javax.jms.Destination, javax.jms.Message)

buildMessage

protected Message buildMessage(Session session,
                               Object result)
                        throws JMSException
Build a JMS message to be sent as response based on the given result object.

Parameters:
session - the JMS Session to operate on
result - the content of the message, as returned from the listener method
Returns:
the JMS Message (never null)
Throws:
JMSException - if thrown by JMS API methods
See Also:
setMessageConverter(org.springframework.jms.support.converter.MessageConverter)

postProcessResponse

protected void postProcessResponse(Message request,
                                   Message response)
                            throws JMSException
Post-process the given response message before it will be sent.

The default implementation sets the response's correlation id to the request message's correlation id, if any; otherwise to the request message id.

Parameters:
request - the original incoming JMS message
response - the outgoing JMS message about to be sent
Throws:
JMSException - if thrown by JMS API methods
See Also:
Message.setJMSCorrelationID(java.lang.String)

getResponseDestination

protected Destination getResponseDestination(Message request,
                                             Message response,
                                             Session session)
                                      throws JMSException
Determine a response destination for the given message.

The default implementation first checks the JMS Reply-To Destination of the supplied request; if that is not null it is returned; if it is null, then the configured default response destination is returned; if this too is null, then an InvalidDestinationException is thrown.

Parameters:
request - the original incoming JMS message
response - the outgoing JMS message about to be sent
session - the JMS Session to operate on
Returns:
the response destination (never null)
Throws:
JMSException - if thrown by JMS API methods
InvalidDestinationException - if no Destination can be determined
See Also:
setDefaultResponseDestination(javax.jms.Destination), Message.getJMSReplyTo()

resolveDefaultResponseDestination

protected Destination resolveDefaultResponseDestination(Session session)
                                                 throws JMSException
Resolve the default response destination into a JMS Destination, using this accessor's DestinationResolver in case of a destination name.

Returns:
the located Destination
Throws:
JMSException - if resolution failed
See Also:
setDefaultResponseDestination(javax.jms.Destination),
setDefaultResponseQueueName(java.lang.String),
setDefaultResponseTopicName(java.lang.String),
setDestinationResolver(org.springframework.jms.support.destination.DestinationResolver)

sendResponse

protected void sendResponse(Session session,
                            Destination destination,
                            Message response)
                     throws JMSException
Send the given response message to the given destination.

Parameters:
response - the JMS message to send
destination - the JMS destination to send to
session - the JMS session to operate on
Throws:
JMSException - if thrown by JMS API methods
See Also:
postProcessProducer(javax.jms.MessageProducer, javax.jms.Message),
Session.createProducer(javax.jms.Destination),
MessageProducer.send(javax.jms.Message)

postProcessProducer

protected void postProcessProducer(MessageProducer producer,
                                   Message response)
                            throws JMSException
Post-process the given message producer before using it to send the response.

The default implementation is empty.

Parameters:
producer - the JMS message producer that will be used to send the message
response - the outgoing JMS message about to be sent
Throws:
JMSException - if thrown by JMS API methods
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageListenerAdapter102

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jms.listener.adapter
Class MessageListenerAdapter102

java.lang.Object
    extended by  org.springframework.jms.listener.adapter.MessageListenerAdapter
        extended by  org.springframework.jms.listener.adapter.MessageListenerAdapter102
All Implemented Interfaces:
MessageListener, SessionAwareMessageListener<Message>, SubscriptionNameProvider
Deprecated. as of Spring 3.0, in favor of the JMS 1.1 based MessageListenerAdapter

@Deprecated
public class MessageListenerAdapter102
extends MessageListenerAdapter

A MessageListenerAdapter subclass for the JMS 1.0.2 specification, not relying on JMS 1.1 methods like MessageListenerAdapter itself.

This class can be used for JMS 1.0.2 providers, offering the same facility as MessageListenerAdapter does for JMS 1.1 providers.

Since:
2.0
Author:
Juergen Hoeller, Rick Evans

Field Summary
Fields inherited from class org.springframework.jms.listener.adapter.MessageListenerAdapter
logger, ORIGINAL_DEFAULT_LISTENER_METHOD
Constructor Summary
MessageListenerAdapter102()
Deprecated. Create a new instance of the MessageListenerAdapter102 class with the default settings.
MessageListenerAdapter102(Object delegate)
Deprecated. Create a new instance of the MessageListenerAdapter102 class for the given delegate.
Method Summary
protected void | initDefaultStrategies() Deprecated. Initialize the default implementations for the adapter's strategies: SimpleMessageConverter102.
protected void | sendResponse(Session session, Destination destination, Message response) Deprecated. Overrides the superclass method to use the JMS 1.0.2 API to send a response.
Methods inherited from class org.springframework.jms.listener.adapter.MessageListenerAdapter
buildListenerArguments, buildMessage, extractMessage, getDefaultListenerMethod, getDelegate, getDestinationResolver, getListenerMethodName, getMessageConverter, getResponseDestination, getSubscriptionName, handleListenerException, handleResult, invokeListenerMethod, onMessage, onMessage, postProcessProducer, postProcessResponse, resolveDefaultResponseDestination, setDefaultListenerMethod, setDefaultResponseDestination, setDefaultResponseQueueName, setDefaultResponseTopicName, setDelegate, setDestinationResolver, setMessageConverter
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MessageListenerAdapter102

public MessageListenerAdapter102()
Deprecated.
Create a new instance of the MessageListenerAdapter102 class with the default settings.

MessageListenerAdapter102

public MessageListenerAdapter102(Object delegate)
Deprecated.
Create a new instance of the MessageListenerAdapter102 class for the given delegate.

Parameters:
delegate - the target object to delegate message listening to
Method Detail

initDefaultStrategies

protected void initDefaultStrategies()
Deprecated.
Initialize the default implementations for the adapter's strategies: SimpleMessageConverter102.

Overrides:
initDefaultStrategies in class MessageListenerAdapter
See Also:
MessageListenerAdapter.setMessageConverter(org.springframework.jms.support.converter.MessageConverter), SimpleMessageConverter102

sendResponse

protected void sendResponse(Session session,
                            Destination destination,
                            Message response)
                     throws JMSException
Deprecated.
Overrides the superclass method to use the JMS 1.0.2 API to send a response.

Uses the JMS pub-sub API if the given destination is a topic, else uses the JMS queue API.

Overrides:
sendResponse in class MessageListenerAdapter
Parameters:
session - the JMS session to operate on
destination - the JMS destination to send to
response - the JMS message to send
Throws:
JMSException - if thrown by JMS API methods
See Also:
MessageListenerAdapter.postProcessProducer(javax.jms.MessageProducer, javax.jms.Message),
Session.createProducer(javax.jms.Destination),
MessageProducer.send(javax.jms.Message)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ListenerExecutionFailedException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jms.listener.adapter
Class ListenerExecutionFailedException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.jms.JmsException
                        extended by  org.springframework.jms.listener.adapter.ListenerExecutionFailedException
All Implemented Interfaces:
Serializable
public class ListenerExecutionFailedException
extends JmsException

Exception to be thrown when the execution of a listener method failed.

Since:
2.0
Author:
Juergen Hoeller
See Also:
MessageListenerAdapter, Serialized Form

Constructor Summary
ListenerExecutionFailedException(String msg, Throwable cause)
Constructor for ListenerExecutionFailedException.
Method Summary
Methods inherited from class org.springframework.jms.JmsException
getErrorCode, getMessage
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ListenerExecutionFailedException

public ListenerExecutionFailedException(String msg,
                                        Throwable cause)
Constructor for ListenerExecutionFailedException.

Parameters:
msg - the detail message
cause - the exception thrown by the listener method
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jms.listener.endpoint

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jms.listener.endpoint

This package provides JCA-based endpoint management for JMS message listeners.

See:
Description

Interface Summary
JmsActivationSpecFactory Strategy interface for creating JCA 1.5 ActivationSpec objects based on a configured JmsActivationSpecConfig object.

Class Summary
DefaultJmsActivationSpecFactory | Default implementation of the JmsActivationSpecFactory interface.
JmsActivationSpecConfig | Common configuration object for activating a JMS message endpoint.
JmsMessageEndpointFactory | JMS-specific implementation of the JCA 1.5 MessageEndpointFactory interface, providing transaction management capabilities for a JMS listener object (e.g.
JmsMessageEndpointManager | Extension of the generic JCA 1.5 GenericMessageEndpointManager, adding JMS-specific support for ActivationSpec configuration.
StandardJmsActivationSpecFactory | Standard implementation of the JmsActivationSpecFactory interface.

Exception Summary
JmsMessageEndpointFactory.JmsResourceException Internal exception thrown when a ResourceExeption has been encountered during the endpoint invocation.

Package org.springframework.jms.listener.endpoint Description

This package provides JCA-based endpoint management for JMS message listeners.


org.springframework.jms.listener.endpoint Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jms.listener.endpoint

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jca.endpoint.AbstractMessageEndpointFactory (implements javax.resource.spi.endpoint.MessageEndpointFactory)
      • org.springframework.jms.listener.endpoint.JmsMessageEndpointFactory
    • org.springframework.jca.endpoint.GenericMessageEndpointManager (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.SmartLifecycle)
      • org.springframework.jms.listener.endpoint.JmsMessageEndpointManager
    • org.springframework.jms.listener.endpoint.JmsActivationSpecConfig
    • org.springframework.jms.listener.endpoint.StandardJmsActivationSpecFactory (implements org.springframework.jms.listener.endpoint.JmsActivationSpecFactory)
      • org.springframework.jms.listener.endpoint.DefaultJmsActivationSpecFactory
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.jms.listener.endpoint.JmsMessageEndpointFactory.JmsResourceException

Interface Hierarchy

  • org.springframework.jms.listener.endpoint.JmsActivationSpecFactory


JmsActivationSpecFactory

org.springframework.jms.listener.endpoint
Interface JmsActivationSpecFactory

All Known Implementing Classes:
DefaultJmsActivationSpecFactory, StandardJmsActivationSpecFactory
public interface JmsActivationSpecFactory

Strategy interface for creating JCA 1.5 ActivationSpec objects based on a configured JmsActivationSpecConfig object.

JCA 1.5 ActivationSpec objects are typically JavaBeans, but unfortunately provider-specific. This strategy interface allows for plugging in any JCA-based JMS provider, creating corresponding ActivationSpec objects based on common JMS configuration settings.

Since:
2.5
Author:
Juergen Hoeller
See Also:
JmsActivationSpecConfig, JmsMessageEndpointManager.setActivationSpecFactory(org.springframework.jms.listener.endpoint.JmsActivationSpecFactory), ResourceAdapter.endpointActivation(javax.resource.spi.endpoint.MessageEndpointFactory, javax.resource.spi.ActivationSpec)

Method Summary
 ActivationSpec createActivationSpec(ResourceAdapter adapter, JmsActivationSpecConfig config)
Create a JCA 1.5 ActivationSpec object based on the given JmsActivationSpecConfig object.

Method Detail

createActivationSpec

ActivationSpec createActivationSpec(ResourceAdapter adapter,
                                    JmsActivationSpecConfig config)
Create a JCA 1.5 ActivationSpec object based on the given JmsActivationSpecConfig object.

Parameters:
adapter - the ResourceAdapter to create an ActivationSpec object for
config - the configured object holding common JMS settings
Returns:
the provider-specific JCA ActivationSpec object, representing the same settings
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultJmsActivationSpecFactory

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jms.listener.endpoint
Class DefaultJmsActivationSpecFactory

java.lang.Object
    extended by  org.springframework.jms.listener.endpoint.StandardJmsActivationSpecFactory
        extended by  org.springframework.jms.listener.endpoint.DefaultJmsActivationSpecFactory
All Implemented Interfaces:
JmsActivationSpecFactory
public class DefaultJmsActivationSpecFactory
extends StandardJmsActivationSpecFactory

Default implementation of the JmsActivationSpecFactory interface. Supports the standard JMS properties as defined by the JMS 1.5 specification, as well as Spring's extended "maxConcurrency" and "prefetchSize" settings through autodetection of well-known vendor-specific provider properties.

An ActivationSpec factory is effectively dependent on the concrete JMS provider, e.g. on ActiveMQ. This default implementation simply guesses the ActivationSpec class name from the provider's class name ("ActiveMQResourceAdapter" -> "ActiveMQActivationSpec" in the same package, or "ActivationSpecImpl" in the same package as the ResourceAdapter class), and populates the ActivationSpec properties as suggested by the JCA 1.5 specification (Appendix B). Specify the 'activationSpecClass' property explicitly if these default naming rules do not apply.

Note: ActiveMQ, JORAM and WebSphere are supported in terms of extended settings (through the detection of their bean property naming conventions). The default ActivationSpec class detection rules may apply to other JMS providers as well.

Thanks to Agim Emruli and Laurie Chan for pointing out WebSphere MQ settings and contributing corresponding tests!

Since:
2.5
Author:
Juergen Hoeller
See Also:
StandardJmsActivationSpecFactory.setActivationSpecClass(java.lang.Class)

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
DefaultJmsActivationSpecFactory()
Method Summary
protected void | applyAcknowledgeMode(BeanWrapper bw, int ackMode) This implementation maps SESSION_TRANSACTED onto an ActivationSpec property named "useRAManagedTransaction", if available (following ActiveMQ's naming conventions).
protected Class | determineActivationSpecClass(ResourceAdapter adapter) This implementation guesses the ActivationSpec class name from the provider's class name: e.g.
protected void | populateActivationSpecProperties(BeanWrapper bw, JmsActivationSpecConfig config) This implementation supports Spring's extended "maxConcurrency" and "prefetchSize" settings through detecting corresponding ActivationSpec properties: "maxSessions"/"maxNumberOfWorks" and "maxMessagesPerSessions"/"maxMessages", respectively (following ActiveMQ's and JORAM's naming conventions).
Methods inherited from class org.springframework.jms.listener.endpoint.StandardJmsActivationSpecFactory
createActivationSpec, setActivationSpecClass, setDefaultProperties, setDestinationResolver
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

DefaultJmsActivationSpecFactory

public DefaultJmsActivationSpecFactory()
Method Detail

determineActivationSpecClass

protected Class determineActivationSpecClass(ResourceAdapter adapter)
This implementation guesses the ActivationSpec class name from the provider's class name: e.g. "ActiveMQResourceAdapter" -> "ActiveMQActivationSpec" in the same package, or a class named "ActivationSpecImpl" in the same package as the ResourceAdapter class.

Overrides:
determineActivationSpecClass in class StandardJmsActivationSpecFactory
Parameters:
adapter - the ResourceAdapter to check
Returns:
the corresponding ActivationSpec class, or null if not determinable
See Also:
StandardJmsActivationSpecFactory.setActivationSpecClass(java.lang.Class)

populateActivationSpecProperties

protected void populateActivationSpecProperties(BeanWrapper bw,
                                                JmsActivationSpecConfig config)
This implementation supports Spring's extended "maxConcurrency" and "prefetchSize" settings through detecting corresponding ActivationSpec properties: "maxSessions"/"maxNumberOfWorks" and "maxMessagesPerSessions"/"maxMessages", respectively (following ActiveMQ's and JORAM's naming conventions).

Overrides:
populateActivationSpecProperties in class StandardJmsActivationSpecFactory
Parameters:
bw - the BeanWrapper wrapping the ActivationSpec object
config - the configured object holding common JMS settings

applyAcknowledgeMode

protected void applyAcknowledgeMode(BeanWrapper bw,
                                    int ackMode)
This implementation maps SESSION_TRANSACTED onto an ActivationSpec property named "useRAManagedTransaction", if available (following ActiveMQ's naming conventions).

Overrides:
applyAcknowledgeMode in class StandardJmsActivationSpecFactory
Parameters:
bw - the BeanWrapper wrapping the ActivationSpec object
ackMode - the configured acknowledge mode (according to the constants in Session
See Also:
Session.AUTO_ACKNOWLEDGE, Session.DUPS_OK_ACKNOWLEDGE, Session.CLIENT_ACKNOWLEDGE, Session.SESSION_TRANSACTED
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


JmsActivationSpecConfig

org.springframework.jms.listener.endpoint
Class JmsActivationSpecConfig

java.lang.Object
    extended by  org.springframework.jms.listener.endpoint.JmsActivationSpecConfig

public class JmsActivationSpecConfig
extends Object

Common configuration object for activating a JMS message endpoint. Gets converted into a provider-specific JCA 1.5 ActivationSpec object for activating the endpoint.

Typically used in combination with JmsMessageEndpointManager, but not tied to it.

Since:
2.5
Author:
Juergen Hoeller
See Also:
JmsActivationSpecFactory, JmsMessageEndpointManager.setActivationSpecConfig(org.springframework.jms.listener.endpoint.JmsActivationSpecConfig), ResourceAdapter.endpointActivation(javax.resource.spi.endpoint.MessageEndpointFactory, javax.resource.spi.ActivationSpec)

Constructor Summary
JmsActivationSpecConfig()
Method Summary
int | getAcknowledgeMode() Return the JMS acknowledgement mode to use.
String | getClientId()
String | getDestinationName()
String | getDurableSubscriptionName()
int | getMaxConcurrency() Return the maximum number of consumers/sessions to use.
String | getMessageSelector()
int | getPrefetchSize() Return the maximum number of messages to load into a session.
boolean | isPubSubDomain()
boolean | isSubscriptionDurable()
void | setAcknowledgeMode(int acknowledgeMode) Set the JMS acknowledgement mode to use.
void | setAcknowledgeModeName(String constantName) Set the JMS acknowledgement mode by the name of the corresponding constant in the JMS Session interface, e.g.
void | setClientId(String clientId)
void | setConcurrency(String concurrency) Specify concurrency limits via a "lower-upper" String, e.g.
void | setDestinationName(String destinationName)
void | setDurableSubscriptionName(String durableSubscriptionName)
void | setMaxConcurrency(int maxConcurrency) Specify the maximum number of consumers/sessions to use, effectively controlling the number of concurrent invocations on the target listener.
void | setMessageSelector(String messageSelector)
void | setPrefetchSize(int prefetchSize) Specify the maximum number of messages to load into a session (a kind of batch size).
void | setPubSubDomain(boolean pubSubDomain)
void | setSubscriptionDurable(boolean subscriptionDurable)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JmsActivationSpecConfig

public JmsActivationSpecConfig()
Method Detail

setDestinationName

public void setDestinationName(String destinationName)

getDestinationName

public String getDestinationName()

setPubSubDomain

public void setPubSubDomain(boolean pubSubDomain)

isPubSubDomain

public boolean isPubSubDomain()

setSubscriptionDurable

public void setSubscriptionDurable(boolean subscriptionDurable)

isSubscriptionDurable

public boolean isSubscriptionDurable()

setDurableSubscriptionName

public void setDurableSubscriptionName(String durableSubscriptionName)

getDurableSubscriptionName

public String getDurableSubscriptionName()

setClientId

public void setClientId(String clientId)

getClientId

public String getClientId()

setMessageSelector

public void setMessageSelector(String messageSelector)

getMessageSelector

public String getMessageSelector()

setAcknowledgeModeName

public void setAcknowledgeModeName(String constantName)
Set the JMS acknowledgement mode by the name of the corresponding constant in the JMS Session interface, e.g. "CLIENT_ACKNOWLEDGE".

Note that JCA resource adapters generally only support auto and dups-ok (see Spring's StandardJmsActivationSpecFactory). ActiveMQ also supports "SESSION_TRANSACTED" in the form of RA-managed transactions (automatically translated by Spring's DefaultJmsActivationSpecFactory.

Parameters:
constantName - the name of the Session acknowledge mode constant
See Also:
Session.AUTO_ACKNOWLEDGE, Session.CLIENT_ACKNOWLEDGE, Session.DUPS_OK_ACKNOWLEDGE, Session.SESSION_TRANSACTED, StandardJmsActivationSpecFactory, DefaultJmsActivationSpecFactory

setAcknowledgeMode

public void setAcknowledgeMode(int acknowledgeMode)
Set the JMS acknowledgement mode to use.

See Also:
Session.AUTO_ACKNOWLEDGE, Session.CLIENT_ACKNOWLEDGE, Session.DUPS_OK_ACKNOWLEDGE, Session.SESSION_TRANSACTED

getAcknowledgeMode

public int getAcknowledgeMode()
Return the JMS acknowledgement mode to use.

setConcurrency

public void setConcurrency(String concurrency)
Specify concurrency limits via a "lower-upper" String, e.g. "5-10", or a simple upper limit String, e.g. "10".

JCA listener containers will always scale from zero to the given upper limit. A specified lower limit will effectively be ignored.

This property is primarily supported for configuration compatibility with DefaultMessageListenerContainer. For this activation config, generally use setMaxConcurrency(int) instead.

setMaxConcurrency

public void setMaxConcurrency(int maxConcurrency)
Specify the maximum number of consumers/sessions to use, effectively controlling the number of concurrent invocations on the target listener.

getMaxConcurrency

public int getMaxConcurrency()
Return the maximum number of consumers/sessions to use.

setPrefetchSize

public void setPrefetchSize(int prefetchSize)
Specify the maximum number of messages to load into a session (a kind of batch size).

getPrefetchSize

public int getPrefetchSize()
Return the maximum number of messages to load into a session.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JmsMessageEndpointFactory

org.springframework.jms.listener.endpoint
Class JmsMessageEndpointFactory

java.lang.Object
    extended by  org.springframework.jca.endpoint.AbstractMessageEndpointFactory
        extended by  org.springframework.jms.listener.endpoint.JmsMessageEndpointFactory
All Implemented Interfaces:
MessageEndpointFactory
public class JmsMessageEndpointFactory
extends AbstractMessageEndpointFactory

JMS-specific implementation of the JCA 1.5 MessageEndpointFactory interface, providing transaction management capabilities for a JMS listener object (e.g. a MessageListener object).

Uses a static endpoint implementation, simply wrapping the specified message listener object and exposing all of its implemented interfaces on the endpoint instance.

Typically used with Spring's JmsMessageEndpointManager, but not tied to it. As a consequence, this endpoint factory could also be used with programmatic endpoint management on a native ResourceAdapter instance.

Since:
2.5
Author:
Juergen Hoeller
See Also:
setMessageListener(javax.jms.MessageListener), AbstractMessageEndpointFactory.setTransactionManager(java.lang.Object), JmsMessageEndpointManager

Nested Class Summary
static class JmsMessageEndpointFactory.JmsResourceException
Internal exception thrown when a ResourceExeption has been encountered during the endpoint invocation.
Nested classes/interfaces inherited from class org.springframework.jca.endpoint.AbstractMessageEndpointFactory
AbstractMessageEndpointFactory.AbstractMessageEndpoint
Field Summary
Fields inherited from class org.springframework.jca.endpoint.AbstractMessageEndpointFactory
logger
Constructor Summary
JmsMessageEndpointFactory()
Method Summary
protected AbstractMessageEndpointFactory.AbstractMessageEndpoint | createEndpointInternal() Creates a concrete JMS message endpoint, internal to this factory.
void | setMessageListener(MessageListener messageListener) Set the JMS MessageListener for this endpoint.
Methods inherited from class org.springframework.jca.endpoint.AbstractMessageEndpointFactory
createEndpoint, isDeliveryTransacted, setTransactionFactory, setTransactionManager, setTransactionName, setTransactionTimeout
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JmsMessageEndpointFactory

public JmsMessageEndpointFactory()
Method Detail

setMessageListener

public void setMessageListener(MessageListener messageListener)
Set the JMS MessageListener for this endpoint.

createEndpointInternal

protected AbstractMessageEndpointFactory.AbstractMessageEndpoint createEndpointInternal()
                                                                                throws UnavailableException
Creates a concrete JMS message endpoint, internal to this factory.

Specified by:
createEndpointInternal in class AbstractMessageEndpointFactory
Returns:
the actual endpoint instance (never null)
Throws:
UnavailableException - if no endpoint is available at present
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JmsMessageEndpointFactory.JmsResourceException

org.springframework.jms.listener.endpoint
Class JmsMessageEndpointFactory.JmsResourceException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.jms.listener.endpoint.JmsMessageEndpointFactory.JmsResourceException
All Implemented Interfaces:
Serializable
Enclosing class:
JmsMessageEndpointFactory
public static class JmsMessageEndpointFactory.JmsResourceException
extends RuntimeException

Internal exception thrown when a ResourceExeption has been encountered during the endpoint invocation.

Will only be used if the ResourceAdapter does not invoke the endpoint's beforeDelivery and afterDelivery directly, leavng it up to the concrete endpoint to apply those - and to handle any ResourceExceptions thrown from them.

See Also:
Serialized Form

Constructor Summary
JmsMessageEndpointFactory.JmsResourceException(ResourceException cause)
Method Summary
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

JmsMessageEndpointFactory.JmsResourceException

public JmsMessageEndpointFactory.JmsResourceException(ResourceException cause)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JmsMessageEndpointManager

org.springframework.jms.listener.endpoint
Class JmsMessageEndpointManager

java.lang.Object
    extended by  org.springframework.jca.endpoint.GenericMessageEndpointManager
        extended by  org.springframework.jms.listener.endpoint.JmsMessageEndpointManager
All Implemented Interfaces:
DisposableBean, InitializingBean, Lifecycle, Phased, SmartLifecycle
public class JmsMessageEndpointManager
extends GenericMessageEndpointManager

Extension of the generic JCA 1.5 GenericMessageEndpointManager, adding JMS-specific support for ActivationSpec configuration.

Allows for defining a common JmsActivationSpecConfig object that gets converted into a provider-specific JCA 1.5 ActivationSpec object for activating the endpoint.

NOTE: This JCA-based endpoint manager supports standard JMS MessageListener endpoints only. It does not support Spring's SessionAwareMessageListener variant, simply because the JCA endpoint management contract does not allow for obtaining the current JMS Session.

Since:
2.5
Author:
Juergen Hoeller
See Also:
MessageListener, setActivationSpecConfig(org.springframework.jms.listener.endpoint.JmsActivationSpecConfig), JmsActivationSpecConfig, JmsActivationSpecFactory, JmsMessageEndpointFactory

Constructor Summary
JmsMessageEndpointManager()
Method Summary
void | afterPropertiesSet() Prepares the message endpoint, and automatically activates it if the "autoStartup" flag is set to "true".
void | setActivationSpecConfig(JmsActivationSpecConfig activationSpecConfig) Specify the JmsActivationSpecConfig object that this endpoint manager should use for activating its listener.
void | setActivationSpecFactory(JmsActivationSpecFactory activationSpecFactory) Set the factory for concrete JCA 1.5 ActivationSpec objects, creating JCA ActivationSpecs based on JmsActivationSpecConfig objects.
void | setDestinationResolver(DestinationResolver destinationResolver) Set the DestinationResolver to use for resolving destination names into the JCA 1.5 ActivationSpec "destination" property.
void | setMessageListener(MessageListener messageListener) Set the JMS MessageListener for this endpoint.
void | setTransactionManager(Object transactionManager) Set the XA transaction manager to use for wrapping endpoint invocations, enlisting the endpoint resource in each such transaction.
Methods inherited from class org.springframework.jca.endpoint.GenericMessageEndpointManager
destroy, getActivationSpec, getMessageEndpointFactory, getPhase, getResourceAdapter, isAutoStartup, isRunning, setActivationSpec, setAutoStartup, setMessageEndpointFactory, setPhase, setResourceAdapter, start, stop, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JmsMessageEndpointManager

public JmsMessageEndpointManager()
Method Detail

setMessageListener

public void setMessageListener(MessageListener messageListener)
Set the JMS MessageListener for this endpoint.

This is a shortcut for configuring a dedicated JmsMessageEndpointFactory.

See Also:
JmsMessageEndpointFactory.setMessageListener(javax.jms.MessageListener)

setTransactionManager

public void setTransactionManager(Object transactionManager)
Set the XA transaction manager to use for wrapping endpoint invocations, enlisting the endpoint resource in each such transaction.

The passed-in object may be a transaction manager which implements Spring's TransactionFactory interface, or a plain TransactionManager.

If no transaction manager is specified, the endpoint invocation will simply not be wrapped in an XA transaction. Consult your resource provider's ActivationSpec documentation for the local transaction options of your particular provider.

This is a shortcut for configuring a dedicated JmsMessageEndpointFactory.

See Also:
AbstractMessageEndpointFactory.setTransactionManager(java.lang.Object)

setActivationSpecFactory

public void setActivationSpecFactory(JmsActivationSpecFactory activationSpecFactory)
Set the factory for concrete JCA 1.5 ActivationSpec objects, creating JCA ActivationSpecs based on JmsActivationSpecConfig objects.

This factory is dependent on the concrete JMS provider, e.g. on ActiveMQ. The default implementation simply guesses the ActivationSpec class name from the provider's class name (e.g. "ActiveMQResourceAdapter" -> "ActiveMQActivationSpec" in the same package), and populates the ActivationSpec properties as suggested by the JCA 1.5 specification (plus a couple of autodetected vendor-specific properties).

See Also:
DefaultJmsActivationSpecFactory

setDestinationResolver

public void setDestinationResolver(DestinationResolver destinationResolver)
Set the DestinationResolver to use for resolving destination names into the JCA 1.5 ActivationSpec "destination" property.

If not specified, destination names will simply be passed in as Strings. If specified, destination names will be resolved into Destination objects first.

Note that a DestinationResolver is usually specified on the JmsActivationSpecFactory (see StandardJmsActivationSpecFactory.setDestinationResolver(org.springframework.jms.support.destination.DestinationResolver)). This is simply a shortcut for parameterizing the default JmsActivationSpecFactory; it will replace any custom JmsActivationSpecFactory that might have been set before.

See Also:
StandardJmsActivationSpecFactory.setDestinationResolver(org.springframework.jms.support.destination.DestinationResolver)

setActivationSpecConfig

public void setActivationSpecConfig(JmsActivationSpecConfig activationSpecConfig)
Specify the JmsActivationSpecConfig object that this endpoint manager should use for activating its listener.

This config object will be turned into a concrete JCA 1.5 ActivationSpec object through a JmsActivationSpecFactory.

afterPropertiesSet

public void afterPropertiesSet()
                        throws ResourceException
Description copied from class: GenericMessageEndpointManager
Prepares the message endpoint, and automatically activates it if the "autoStartup" flag is set to "true".

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class GenericMessageEndpointManager
Throws:
ResourceException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StandardJmsActivationSpecFactory

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jms.listener.endpoint
Class StandardJmsActivationSpecFactory

java.lang.Object
    extended by  org.springframework.jms.listener.endpoint.StandardJmsActivationSpecFactory
All Implemented Interfaces:
JmsActivationSpecFactory
Direct Known Subclasses:
DefaultJmsActivationSpecFactory
public class StandardJmsActivationSpecFactory
extends Object
implements JmsActivationSpecFactory

Standard implementation of the JmsActivationSpecFactory interface. Supports the standard JMS properties as defined by the JMS 1.5 specification (Appendix B); ignores Spring's "maxConcurrency" and "prefetchSize" settings.

The 'activationSpecClass' property is required, explicitly defining the fully-qualified class name of the provider's ActivationSpec class (e.g. "org.apache.activemq.ra.ActiveMQActivationSpec").

Check out DefaultJmsActivationSpecFactory for an extended variant of this class, supporting some further default conventions beyond the plain JMS 1.5 specification.

Since:
2.5
Author:
Juergen Hoeller
See Also:
setActivationSpecClass(java.lang.Class), DefaultJmsActivationSpecFactory

Constructor Summary
StandardJmsActivationSpecFactory()
Method Summary
protected void | applyAcknowledgeMode(BeanWrapper bw, int ackMode) Apply the specified acknowledge mode to the ActivationSpec object.
ActivationSpec | createActivationSpec(ResourceAdapter adapter, JmsActivationSpecConfig config) Create a JCA 1.5 ActivationSpec object based on the given JmsActivationSpecConfig object.
protected Class | determineActivationSpecClass(ResourceAdapter adapter) Determine the ActivationSpec class for the given ResourceAdapter, if possible.
protected void | populateActivationSpecProperties(BeanWrapper bw, JmsActivationSpecConfig config) Populate the given ApplicationSpec object with the settings defined in the given configuration object.
void | setActivationSpecClass(Class activationSpecClass) Specify the fully-qualified ActivationSpec class name for the target provider (e.g.
void | setDefaultProperties(Map<String,String> defaultProperties) Specify custom default properties, with String keys and String values.
void | setDestinationResolver(DestinationResolver destinationResolver) Set the DestinationResolver to use for resolving destination names into the JCA 1.5 ActivationSpec "destination" property.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

StandardJmsActivationSpecFactory

public StandardJmsActivationSpecFactory()
Method Detail

setActivationSpecClass

public void setActivationSpecClass(Class activationSpecClass)
Specify the fully-qualified ActivationSpec class name for the target provider (e.g. "org.apache.activemq.ra.ActiveMQActivationSpec").

setDefaultProperties

public void setDefaultProperties(Map<String,String> defaultProperties)
Specify custom default properties, with String keys and String values.

Applied to each ActivationSpec object before it gets populated with listener-specific settings. Allows for configuring vendor-specific properties beyond the Spring-defined settings in JmsActivationSpecConfig.

setDestinationResolver

public void setDestinationResolver(DestinationResolver destinationResolver)
Set the DestinationResolver to use for resolving destination names into the JCA 1.5 ActivationSpec "destination" property.

If not specified, destination names will simply be passed in as Strings. If specified, destination names will be resolved into Destination objects first.

Note that a DestinationResolver for use with this factory must be able to work without an active JMS Session: e.g. JndiDestinationResolver or BeanFactoryDestinationResolver but not DynamicDestinationResolver.

createActivationSpec

public ActivationSpec createActivationSpec(ResourceAdapter adapter,
                                           JmsActivationSpecConfig config)
Description copied from interface: JmsActivationSpecFactory
Create a JCA 1.5 ActivationSpec object based on the given JmsActivationSpecConfig object.

Specified by:
createActivationSpec in interface JmsActivationSpecFactory
Parameters:
adapter - the ResourceAdapter to create an ActivationSpec object for
config - the configured object holding common JMS settings
Returns:
the provider-specific JCA ActivationSpec object, representing the same settings

determineActivationSpecClass

protected Class determineActivationSpecClass(ResourceAdapter adapter)
Determine the ActivationSpec class for the given ResourceAdapter, if possible. Called if no 'activationSpecClass' has been set explicitly

Parameters:
adapter - the ResourceAdapter to check
Returns:
the corresponding ActivationSpec class, or null if not determinable
See Also:
setActivationSpecClass(java.lang.Class)

populateActivationSpecProperties

protected void populateActivationSpecProperties(BeanWrapper bw,
                                                JmsActivationSpecConfig config)
Populate the given ApplicationSpec object with the settings defined in the given configuration object.

This implementation applies all standard JMS settings, but ignores "maxConcurrency" and "prefetchSize" - not supported in standard JCA 1.5.

Parameters:
bw - the BeanWrapper wrapping the ActivationSpec object
config - the configured object holding common JMS settings

applyAcknowledgeMode

protected void applyAcknowledgeMode(BeanWrapper bw,
                                    int ackMode)
Apply the specified acknowledge mode to the ActivationSpec object.

This implementation applies the standard JCA 1.5 acknowledge modes "Auto-acknowledge" and "Dups-ok-acknowledge". It throws an exception in case of CLIENT_ACKNOWLEDGE or SESSION_TRANSACTED having been requested.

Parameters:
bw - the BeanWrapper wrapping the ActivationSpec object
ackMode - the configured acknowledge mode (according to the constants in Session
See Also:
Session.AUTO_ACKNOWLEDGE, Session.DUPS_OK_ACKNOWLEDGE, Session.CLIENT_ACKNOWLEDGE, Session.SESSION_TRANSACTED
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jms.remoting

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jms.remoting

Remoting classes for transparent Java-to-Java remoting via a JMS provider.

See:
Description

Class Summary
JmsInvokerClientInterceptor | MethodInterceptor for accessing a JMS-based remote service.
JmsInvokerProxyFactoryBean | FactoryBean for JMS invoker proxies.
JmsInvokerServiceExporter | JMS message listener that exports the specified service bean as a JMS service endpoint, accessible via a JMS invoker proxy.

Package org.springframework.jms.remoting Description

Remoting classes for transparent Java-to-Java remoting via a JMS provider.

Allows the target service to be load-balanced across a number of queue receivers, and provides a level of indirection between the client and the service: They only need to agree on a queue name and a service interface.


org.springframework.jms.remoting Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jms.remoting

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jms.remoting.JmsInvokerClientInterceptor (implements org.springframework.beans.factory.InitializingBean, org.aopalliance.intercept.MethodInterceptor)
      • org.springframework.jms.remoting.JmsInvokerProxyFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.FactoryBean<T>)
    • org.springframework.remoting.support.RemotingSupport (implements org.springframework.beans.factory.BeanClassLoaderAware)
      • org.springframework.remoting.support.RemoteExporter
        • org.springframework.remoting.support.RemoteInvocationBasedExporter
          • org.springframework.jms.remoting.JmsInvokerServiceExporter (implements org.springframework.beans.factory.InitializingBean, org.springframework.jms.listener.SessionAwareMessageListener<M>)


JmsInvokerClientInterceptor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jms.remoting
Class JmsInvokerClientInterceptor

java.lang.Object
    extended by  org.springframework.jms.remoting.JmsInvokerClientInterceptor
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, InitializingBean
Direct Known Subclasses:
JmsInvokerProxyFactoryBean
public class JmsInvokerClientInterceptor
extends Object
implements MethodInterceptor, InitializingBean

MethodInterceptor for accessing a JMS-based remote service.

Serializes remote invocation objects and deserializes remote invocation result objects. Uses Java serialization just like RMI, but with the JMS provider as communication infrastructure.

To be configured with a QueueConnectionFactory and a target queue (either as Queue reference or as queue name).

Thanks to James Strachan for the original prototype that this JMS invoker mechanism was inspired by!

Since:
2.0
Author:
Juergen Hoeller, James Strachan
See Also:
setConnectionFactory(javax.jms.ConnectionFactory),
setQueue(javax.jms.Queue),
setQueueName(java.lang.String),
JmsInvokerServiceExporter,
JmsInvokerProxyFactoryBean

Constructor Summary
JmsInvokerClientInterceptor()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected RemoteAccessException | convertJmsInvokerAccessException(JMSException ex) Convert the given JMS invoker access exception to an appropriate Spring RemoteAccessException.
protected Connection | createConnection() Create a new JMS Connection for this JMS invoker, ideally a javax.jms.QueueConnection.
protected RemoteInvocation | createRemoteInvocation(MethodInvocation methodInvocation) Create a new RemoteInvocation object for the given AOP method invocation.
protected Message | createRequestMessage(Session session, RemoteInvocation invocation) Create the invoker request message.
protected Session | createSession(Connection con) Create a new JMS Session for this JMS invoker, ideally a javax.jms.QueueSession.
protected Message | doExecuteRequest(Session session, Queue queue, Message requestMessage) Actually execute the given request, sending the invoker request message to the specified target queue and waiting for a corresponding response.
protected RemoteInvocationResult | executeRequest(RemoteInvocation invocation) Execute the given remote invocation, sending an invoker request message to this accessor's target queue and waiting for a corresponding response.
protected RemoteInvocationResult | extractInvocationResult(Message responseMessage) Extract the invocation result from the response message.
protected ConnectionFactory | getConnectionFactory() Return the QueueConnectionFactory to use for obtaining JMS QueueConnections.
protected long | getReceiveTimeout() Return the timeout to use for receiving the response message for a request (in milliseconds).
Object | invoke(MethodInvocation methodInvocation)
protected RemoteInvocationResult | onInvalidResponse(Message responseMessage) Callback that is invoked by extractInvocationResult when it encounters an invalid response message.
protected Object | recreateRemoteInvocationResult(RemoteInvocationResult result) Recreate the invocation result contained in the given RemoteInvocationResult object.
protected Queue | resolveQueue(Session session) Resolve this accessor's target queue.
protected Queue | resolveQueueName(Session session, String queueName) Resolve the given queue name into a JMS Queue, via this accessor's DestinationResolver.
void | setConnectionFactory(ConnectionFactory connectionFactory) Set the QueueConnectionFactory to use for obtaining JMS QueueConnections.
void | setDestinationResolver(DestinationResolver destinationResolver) Set the DestinationResolver that is to be used to resolve Queue references for this accessor.
void | setMessageConverter(MessageConverter messageConverter) Specify the MessageConverter to use for turning RemoteInvocation objects into request messages, as well as response messages into RemoteInvocationResult objects.
void | setQueue(Queue queue) Set the target Queue to send invoker requests to.
void | setQueueName(String queueName) Set the name of target queue to send invoker requests to.
void | setReceiveTimeout(long receiveTimeout) Set the timeout to use for receiving the response message for a request (in milliseconds).
void | setRemoteInvocationFactory(RemoteInvocationFactory remoteInvocationFactory) Set the RemoteInvocationFactory to use for this accessor.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JmsInvokerClientInterceptor

public JmsInvokerClientInterceptor()
Method Detail

setConnectionFactory

public void setConnectionFactory(ConnectionFactory connectionFactory)
Set the QueueConnectionFactory to use for obtaining JMS QueueConnections.

getConnectionFactory

protected ConnectionFactory getConnectionFactory()
Return the QueueConnectionFactory to use for obtaining JMS QueueConnections.

setQueue

public void setQueue(Queue queue)
Set the target Queue to send invoker requests to.

setQueueName

public void setQueueName(String queueName)
Set the name of target queue to send invoker requests to. The specified name will be dynamically resolved via the DestinationResolver.

setDestinationResolver

public void setDestinationResolver(DestinationResolver destinationResolver)
Set the DestinationResolver that is to be used to resolve Queue references for this accessor.

The default resolver is a DynamicDestinationResolver. Specify a JndiDestinationResolver for resolving destination names as JNDI locations.

See Also:
DynamicDestinationResolver, JndiDestinationResolver

setRemoteInvocationFactory

public void setRemoteInvocationFactory(RemoteInvocationFactory remoteInvocationFactory)
Set the RemoteInvocationFactory to use for this accessor. Default is a DefaultRemoteInvocationFactory.

A custom invocation factory can add further context information to the invocation, for example user credentials.

setMessageConverter

public void setMessageConverter(MessageConverter messageConverter)
Specify the MessageConverter to use for turning RemoteInvocation objects into request messages, as well as response messages into RemoteInvocationResult objects.

Default is a SimpleMessageConverter, using a standard JMS ObjectMessage for each invocation / invocation result object.

Custom implementations may generally adapt Serializables into special kinds of messages, or might be specifically tailored for translating RemoteInvocation(Result)s into specific kinds of messages.

setReceiveTimeout

public void setReceiveTimeout(long receiveTimeout)
Set the timeout to use for receiving the response message for a request (in milliseconds).

The default is 0, which indicates a blocking receive without timeout.

See Also:
MessageConsumer.receive(long), MessageConsumer.receive()

getReceiveTimeout

protected long getReceiveTimeout()
Return the timeout to use for receiving the response message for a request (in milliseconds).

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

invoke

public Object invoke(MethodInvocation methodInvocation)
              throws Throwable
Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable

createRemoteInvocation

protected RemoteInvocation createRemoteInvocation(MethodInvocation methodInvocation)
Create a new RemoteInvocation object for the given AOP method invocation. The default implementation delegates to the RemoteInvocationFactory.

Can be overridden in subclasses to provide custom RemoteInvocation subclasses, containing additional invocation parameters like user credentials. Note that it is preferable to use a custom RemoteInvocationFactory which is a reusable strategy.

Parameters:
methodInvocation - the current AOP method invocation
Returns:
the RemoteInvocation object
See Also:
RemoteInvocationFactory.createRemoteInvocation(org.aopalliance.intercept.MethodInvocation)

executeRequest

protected RemoteInvocationResult executeRequest(RemoteInvocation invocation)
                                         throws JMSException
Execute the given remote invocation, sending an invoker request message to this accessor's target queue and waiting for a corresponding response.

Parameters:
invocation - the RemoteInvocation to execute
Returns:
the RemoteInvocationResult object
Throws:
JMSException - in case of JMS failure
See Also:
doExecuteRequest(javax.jms.Session, javax.jms.Queue, javax.jms.Message)

createConnection

protected Connection createConnection()
                               throws JMSException
Create a new JMS Connection for this JMS invoker, ideally a javax.jms.QueueConnection.

The default implementation uses the javax.jms.QueueConnectionFactory API if available, falling back to a standard JMS 1.1 ConnectionFactory otherwise. This is necessary for working with generic JMS 1.1 connection pools (such as ActiveMQ's org.apache.activemq.pool.PooledConnectionFactory).

Throws:
JMSException

createSession

protected Session createSession(Connection con)
                         throws JMSException
Create a new JMS Session for this JMS invoker, ideally a javax.jms.QueueSession.

The default implementation uses the javax.jms.QueueConnection API if available, falling back to a standard JMS 1.1 Connection otherwise. This is necessary for working with generic JMS 1.1 connection pools (such as ActiveMQ's org.apache.activemq.pool.PooledConnectionFactory).

Throws:
JMSException

resolveQueue

protected Queue resolveQueue(Session session)
                      throws JMSException
Resolve this accessor's target queue.

Parameters:
session - the current JMS Session
Returns:
the resolved target Queue
Throws:
JMSException - if resolution failed

resolveQueueName

protected Queue resolveQueueName(Session session,
                                 String queueName)
                          throws JMSException
Resolve the given queue name into a JMS Queue, via this accessor's DestinationResolver.

Parameters:
session - the current JMS Session
queueName - the name of the queue
Returns:
the located Queue
Throws:
JMSException - if resolution failed
See Also:
setDestinationResolver(org.springframework.jms.support.destination.DestinationResolver)

createRequestMessage

protected Message createRequestMessage(Session session,
                                       RemoteInvocation invocation)
                                throws JMSException
Create the invoker request message.

The default implementation creates a JMS ObjectMessage for the given RemoteInvocation object.

Parameters:
session - the current JMS Session
invocation - the remote invocation to send
Returns:
the JMS Message to send
Throws:
JMSException - if the message could not be created

doExecuteRequest

protected Message doExecuteRequest(Session session,
                                   Queue queue,
                                   Message requestMessage)
                            throws JMSException
Actually execute the given request, sending the invoker request message to the specified target queue and waiting for a corresponding response.

The default implementation is based on standard JMS send/receive, using a TemporaryQueue for receiving the response.

Parameters:
session - the JMS Session to use
queue - the resolved target Queue to send to
requestMessage - the JMS Message to send
Returns:
the RemoteInvocationResult object
Throws:
JMSException - in case of JMS failure

extractInvocationResult

protected RemoteInvocationResult extractInvocationResult(Message responseMessage)
                                                  throws JMSException
Extract the invocation result from the response message.

The default implementation expects a JMS ObjectMessage carrying a RemoteInvocationResult object. If an invalid response message is encountered, the onInvalidResponse callback gets invoked.

Parameters:
responseMessage - the response message
Returns:
the invocation result
Throws:
JMSException - is thrown if a JMS exception occurs
See Also:
onInvalidResponse(javax.jms.Message)

onInvalidResponse

protected RemoteInvocationResult onInvalidResponse(Message responseMessage)
                                            throws JMSException
Callback that is invoked by extractInvocationResult when it encounters an invalid response message.

The default implementation throws a MessageFormatException.

Parameters:
responseMessage - the invalid response message
Returns:
an alternative invocation result that should be returned to the caller (if desired)
Throws:
JMSException - if the invalid response should lead to an infrastructure exception propagated to the caller
See Also:
extractInvocationResult(javax.jms.Message)

recreateRemoteInvocationResult

protected Object recreateRemoteInvocationResult(RemoteInvocationResult result)
                                         throws Throwable
Recreate the invocation result contained in the given RemoteInvocationResult object. The default implementation calls the default recreate method.

Can be overridden in subclass to provide custom recreation, potentially processing the returned result object.

Parameters:
result - the RemoteInvocationResult to recreate
Returns:
a return value if the invocation result is a successful return
Throws:
Throwable - if the invocation result is an exception
See Also:
RemoteInvocationResult.recreate()

convertJmsInvokerAccessException

protected RemoteAccessException convertJmsInvokerAccessException(JMSException ex)
Convert the given JMS invoker access exception to an appropriate Spring RemoteAccessException.

Parameters:
ex - the exception to convert
Returns:
the RemoteAccessException to throw
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


JmsInvokerProxyFactoryBean

org.springframework.jms.remoting
Class JmsInvokerProxyFactoryBean

java.lang.Object
    extended by  org.springframework.jms.remoting.JmsInvokerClientInterceptor
        extended by  org.springframework.jms.remoting.JmsInvokerProxyFactoryBean
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, BeanClassLoaderAware, FactoryBean<Object>, InitializingBean
public class JmsInvokerProxyFactoryBean
extends JmsInvokerClientInterceptor
implements FactoryBean<Object>, BeanClassLoaderAware

FactoryBean for JMS invoker proxies. Exposes the proxied service for use as a bean reference, using the specified service interface.

Serializes remote invocation objects and deserializes remote invocation result objects. Uses Java serialization just like RMI, but with the JMS provider as communication infrastructure.

To be configured with a QueueConnectionFactory and a target queue (either as Queue reference or as queue name).

Since:
2.0
Author:
Juergen Hoeller
See Also:
JmsInvokerClientInterceptor.setConnectionFactory(javax.jms.ConnectionFactory),
JmsInvokerClientInterceptor.setQueueName(java.lang.String),
setServiceInterface(java.lang.Class),
JmsInvokerClientInterceptor,
JmsInvokerServiceExporter

Constructor Summary
JmsInvokerProxyFactoryBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 Object getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<?> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setBeanClassLoader(ClassLoader classLoader)
Callback that supplies the bean class loader to a bean instance.
 void setServiceInterface(Class serviceInterface)
Set the interface that the proxy must implement.
Methods inherited from class org.springframework.jms.remoting.JmsInvokerClientInterceptor
convertJmsInvokerAccessException, createConnection, createRemoteInvocation, createRequestMessage, createSession, doExecuteRequest, executeRequest, extractInvocationResult, getConnectionFactory, getReceiveTimeout, invoke, onInvalidResponse, recreateRemoteInvocationResult, resolveQueue, resolveQueueName, setConnectionFactory, setDestinationResolver, setMessageConverter, setQueue, setQueueName, setReceiveTimeout, setRemoteInvocationFactory
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JmsInvokerProxyFactoryBean

public JmsInvokerProxyFactoryBean()
Method Detail

setServiceInterface

public void setServiceInterface(Class serviceInterface)
Set the interface that the proxy must implement.

Parameters:
serviceInterface - the interface that the proxy must implement
Throws:
IllegalArgumentException - if the supplied serviceInterface is null, or if the supplied serviceInterface is not an interface type

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class JmsInvokerClientInterceptor

getObject

public Object getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<Object>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<?> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<Object>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<Object>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JmsInvokerServiceExporter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jms.remoting
Class JmsInvokerServiceExporter

java.lang.Object
    extended by  org.springframework.remoting.support.RemotingSupport
        extended by  org.springframework.remoting.support.RemoteExporter
            extended by  org.springframework.remoting.support.RemoteInvocationBasedExporter
                extended by  org.springframework.jms.remoting.JmsInvokerServiceExporter
All Implemented Interfaces:
BeanClassLoaderAware, InitializingBean, SessionAwareMessageListener<Message>
public class JmsInvokerServiceExporter
extends RemoteInvocationBasedExporter
implements SessionAwareMessageListener<Message>, InitializingBean

JMS message listener that exports the specified service bean as a JMS service endpoint, accessible via a JMS invoker proxy.

Note that this class implements Spring's SessionAwareMessageListener interface, since it requires access to the active JMS Session. Hence, this class can only be used with message listener containers which support the SessionAwareMessageListener interface (e.g. Spring's DefaultMessageListenerContainer).

Thanks to James Strachan for the original prototype that this JMS invoker mechanism was inspired by!

Since:
2.0
Author:
Juergen Hoeller, James Strachan
See Also:
JmsInvokerClientInterceptor, JmsInvokerProxyFactoryBean

Field Summary
Fields inherited from class org.springframework.remoting.support.RemotingSupport
logger
Constructor Summary
JmsInvokerServiceExporter()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected Message | createResponseMessage(Message request, Session session, RemoteInvocationResult result) Create the invocation result response message.
protected RemoteInvocation | onInvalidRequest(Message requestMessage) Callback that is invoked by readRemoteInvocation(javax.jms.Message) when it encounters an invalid request message.
void | onMessage(Message requestMessage, Session session) Callback for processing a received JMS message.
protected RemoteInvocation | readRemoteInvocation(Message requestMessage) Read a RemoteInvocation from the given JMS message.
void | setIgnoreInvalidRequests(boolean ignoreInvalidRequests) Set whether invalidly formatted messages should be discarded.
void | setMessageConverter(MessageConverter messageConverter) Specify the MessageConverter to use for turning request messages into RemoteInvocation objects, as well as RemoteInvocationResult objects into response messages.
protected void | writeRemoteInvocationResult(Message requestMessage, Session session, RemoteInvocationResult result) Send the given RemoteInvocationResult as a JMS message to the originator.
Methods inherited from class org.springframework.remoting.support.RemoteInvocationBasedExporter
getRemoteInvocationExecutor, invoke, invokeAndCreateResult, setRemoteInvocationExecutor
Methods inherited from class org.springframework.remoting.support.RemoteExporter
checkService, checkServiceInterface, getExporterName, getProxyForService, getService, getServiceInterface, setInterceptors, setRegisterTraceInterceptor, setService, setServiceInterface
Methods inherited from class org.springframework.remoting.support.RemotingSupport
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JmsInvokerServiceExporter

public JmsInvokerServiceExporter()
Method Detail

setMessageConverter

public void setMessageConverter(MessageConverter messageConverter)
Specify the MessageConverter to use for turning request messages into RemoteInvocation objects, as well as RemoteInvocationResult objects into response messages.

Default is a SimpleMessageConverter, using a standard JMS ObjectMessage for each invocation / invocation result object.

Custom implementations may generally adapt Serializables into special kinds of messages, or might be specifically tailored for translating RemoteInvocation(Result)s into specific kinds of messages.

setIgnoreInvalidRequests

public void setIgnoreInvalidRequests(boolean ignoreInvalidRequests)
Set whether invalidly formatted messages should be discarded. Default is "true".

Switch this flag to "false" to throw an exception back to the listener container. This will typically lead to redelivery of the message, which is usually undesirable - since the message content will be the same (that is, still invalid).

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

onMessage

public void onMessage(Message requestMessage,
                      Session session)
               throws JMSException
Description copied from interface: SessionAwareMessageListener
Callback for processing a received JMS message.

Implementors are supposed to process the given Message, typically sending reply messages through the given Session.

Specified by:
onMessage in interface SessionAwareMessageListener<Message>
Parameters:
requestMessage - the received JMS message (never null)
session - the underlying JMS Session (never null)
Throws:
JMSException - if thrown by JMS methods

readRemoteInvocation

protected RemoteInvocation readRemoteInvocation(Message requestMessage)
                                         throws JMSException
Read a RemoteInvocation from the given JMS message.

Parameters:
requestMessage - current request message
Returns:
the RemoteInvocation object (or null in case of an invalid message that will simply be ignored)
Throws:
JMSException - in case of message access failure

writeRemoteInvocationResult

protected void writeRemoteInvocationResult(Message requestMessage,
                                           Session session,
                                           RemoteInvocationResult result)
                                    throws JMSException
Send the given RemoteInvocationResult as a JMS message to the originator.

Parameters:
requestMessage - current request message
session - the JMS Session to use
result - the RemoteInvocationResult object
Throws:
JMSException - if thrown by trying to send the message

createResponseMessage

protected Message createResponseMessage(Message request,
                                        Session session,
                                        RemoteInvocationResult result)
                                 throws JMSException
Create the invocation result response message.

The default implementation creates a JMS ObjectMessage for the given RemoteInvocationResult object. It sets the response's correlation id to the request message's correlation id, if any; otherwise to the request message id.

Parameters:
request - the original request message
session - the JMS session to use
result - the invocation result
Returns:
the message response to send
Throws:
JMSException - if creating the messsage failed

onInvalidRequest

protected RemoteInvocation onInvalidRequest(Message requestMessage)
                                     throws JMSException
Callback that is invoked by readRemoteInvocation(javax.jms.Message) when it encounters an invalid request message.

The default implementation either discards the invalid message or throws a MessageFormatException - according to the "ignoreInvalidRequests" flag, which is set to "true" (that is, discard invalid messages) by default.

Parameters:
requestMessage - the invalid request message
Returns:
the RemoteInvocation to expose for the invalid request (typically null in case of an invalid message that will simply be ignored)
Throws:
JMSException - in case of the invalid request supposed to lead to an exception (instead of ignoring it)
See Also:
readRemoteInvocation(javax.jms.Message), setIgnoreInvalidRequests(boolean)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jms.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jms.support

This package provides generic JMS support classes, to be used by higher-level classes like JmsTemplate.

See:
Description

Class Summary
JmsAccessor | Base class for JmsTemplate and other JMS-accessing gateway helpers, defining common properties such as the JMS ConnectionFactory to operate on.
JmsUtils | Generic utility methods for working with JMS.

Package org.springframework.jms.support Description

This package provides generic JMS support classes, to be used by higher-level classes like JmsTemplate.


org.springframework.jms.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jms.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jms.support.JmsAccessor (implements org.springframework.beans.factory.InitializingBean)
    • org.springframework.jms.support.JmsUtils


JmsAccessor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jms.support
Class JmsAccessor

java.lang.Object
    extended by  org.springframework.jms.support.JmsAccessor
All Implemented Interfaces:
InitializingBean
Direct Known Subclasses:
JmsDestinationAccessor
public abstract class JmsAccessor
extends Object
implements InitializingBean

Base class for JmsTemplate and other JMS-accessing gateway helpers, defining common properties such as the JMS ConnectionFactory to operate on. The subclass JmsDestinationAccessor adds further, destination-related properties.

Not intended to be used directly. See JmsTemplate.

Since:
1.2
Author:
Juergen Hoeller
See Also:
JmsDestinationAccessor, JmsTemplate

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
JmsAccessor()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected JmsException | convertJmsAccessException(JMSException ex) Convert the specified checked JMSException to a Spring runtime JmsException equivalent.
protected Connection | createConnection() Create a JMS Connection via this template's ConnectionFactory.
protected Session | createSession(Connection con) Create a JMS Session for the given Connection.
ConnectionFactory | getConnectionFactory() Return the ConnectionFactory that this accessor uses for obtaining JMS Connections.
int | getSessionAcknowledgeMode() Return the acknowledgement mode for JMS sessions.
protected boolean | isClientAcknowledge(Session session) Determine whether the given Session is in client acknowledge mode.
boolean | isSessionTransacted() Return whether the JMS sessions used by this accessor are supposed to be transacted.
void | setConnectionFactory(ConnectionFactory connectionFactory) Set the ConnectionFactory to use for obtaining JMS Connections.
void | setSessionAcknowledgeMode(int sessionAcknowledgeMode) Set the JMS acknowledgement mode that is used when creating a JMS Session to send a message.
void | setSessionAcknowledgeModeName(String constantName) Set the JMS acknowledgement mode by the name of the corresponding constant in the JMS Session interface, e.g.
void | setSessionTransacted(boolean sessionTransacted) Set the transaction mode that is used when creating a JMS Session.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

JmsAccessor

public JmsAccessor()
Method Detail

setConnectionFactory

public void setConnectionFactory(ConnectionFactory connectionFactory)
Set the ConnectionFactory to use for obtaining JMS Connections.

getConnectionFactory

public ConnectionFactory getConnectionFactory()
Return the ConnectionFactory that this accessor uses for obtaining JMS Connections.

setSessionTransacted

public void setSessionTransacted(boolean sessionTransacted)
Set the transaction mode that is used when creating a JMS Session. Default is "false".

Note that within a JTA transaction, the parameters passed to create(Queue/Topic)Session(boolean transacted, int acknowledgeMode) method are not taken into account. Depending on the J2EE transaction context, the container makes its own decisions on these values. Analogously, these parameters are not taken into account within a locally managed transaction either, since the accessor operates on an existing JMS Session in this case.

Setting this flag to "true" will use a short local JMS transaction when running outside of a managed transaction, and a synchronized local JMS transaction in case of a managed transaction (other than an XA transaction) being present. The latter has the effect of a local JMS transaction being managed alongside the main transaction (which might be a native JDBC transaction), with the JMS transaction committing right after the main transaction.

See Also:
Connection.createSession(boolean, int)

isSessionTransacted

public boolean isSessionTransacted()
Return whether the JMS sessions used by this accessor are supposed to be transacted.

See Also:
setSessionTransacted(boolean)

setSessionAcknowledgeModeName

public void setSessionAcknowledgeModeName(String constantName)
Set the JMS acknowledgement mode by the name of the corresponding constant in the JMS Session interface, e.g. "CLIENT_ACKNOWLEDGE".

If you want to use vendor-specific extensions to the acknowledgment mode, use setSessionAcknowledgeModeName(String) instead.

Parameters:
constantName - the name of the Session acknowledge mode constant
See Also:
Session.AUTO_ACKNOWLEDGE, Session.CLIENT_ACKNOWLEDGE, Session.DUPS_OK_ACKNOWLEDGE, Connection.createSession(boolean, int)

setSessionAcknowledgeMode

public void setSessionAcknowledgeMode(int sessionAcknowledgeMode)
Set the JMS acknowledgement mode that is used when creating a JMS Session to send a message.

Default is Session.AUTO_ACKNOWLEDGE.

Vendor-specific extensions to the acknowledgment mode can be set here as well.

Note that that inside an EJB the parameters to create(Queue/Topic)Session(boolean transacted, int acknowledgeMode) method are not taken into account. Depending on the transaction context in the EJB, the container makes its own decisions on these values. See section 17.3.5 of the EJB spec.

Parameters:
sessionAcknowledgeMode - the acknowledgement mode constant
See Also:
Session.AUTO_ACKNOWLEDGE, Session.CLIENT_ACKNOWLEDGE, Session.DUPS_OK_ACKNOWLEDGE, Connection.createSession(boolean, int)

getSessionAcknowledgeMode

public int getSessionAcknowledgeMode()
Return the acknowledgement mode for JMS sessions.

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

convertJmsAccessException

protected JmsException convertJmsAccessException(JMSException ex)
Convert the specified checked JMSException to a Spring runtime JmsException equivalent.

The default implementation delegates to the JmsUtils.convertJmsAccessException(javax.jms.JMSException) method.

Parameters:
ex - the original checked JMSException to convert
Returns:
the Spring runtime JmsException wrapping ex
See Also:
JmsUtils.convertJmsAccessException(javax.jms.JMSException)

createConnection

protected Connection createConnection()
                               throws JMSException
Create a JMS Connection via this template's ConnectionFactory.

This implementation uses JMS 1.1 API.

Returns:
the new JMS Connection
Throws:
JMSException - if thrown by JMS API methods
See Also:
ConnectionFactory.createConnection()

createSession

protected Session createSession(Connection con)
                         throws JMSException
Create a JMS Session for the given Connection.

This implementation uses JMS 1.1 API.

Parameters:
con - the JMS Connection to create a Session for
Returns:
the new JMS Session
Throws:
JMSException - if thrown by JMS API methods
See Also:
Connection.createSession(boolean, int)

isClientAcknowledge

protected boolean isClientAcknowledge(Session session)
                               throws JMSException
Determine whether the given Session is in client acknowledge mode.

This implementation uses JMS 1.1 API.

Parameters:
session - the JMS Session to check
Returns:
whether the given Session is in client acknowledge mode
Throws:
JMSException - if thrown by JMS API methods
See Also:
Session.getAcknowledgeMode(), Session.CLIENT_ACKNOWLEDGE
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


JmsUtils

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jms.support
Class JmsUtils

java.lang.Object
    extended by  org.springframework.jms.support.JmsUtils

public abstract class JmsUtils
extends Object

Generic utility methods for working with JMS. Mainly for internal use within the framework, but also useful for custom JMS access code.

Since:
1.1
Author:
Juergen Hoeller

Constructor Summary
JmsUtils()
Method Summary
static String | buildExceptionMessage(JMSException ex) Build a descriptive exception message for the given JMSException, incorporating a linked exception's message if appropriate.
static void | closeConnection(Connection con) Close the given JMS Connection and ignore any thrown exception.
static void | closeConnection(Connection con, boolean stop) Close the given JMS Connection and ignore any thrown exception.
static void | closeMessageConsumer(MessageConsumer consumer) Close the given JMS MessageConsumer and ignore any thrown exception.
static void | closeMessageProducer(MessageProducer producer) Close the given JMS MessageProducer and ignore any thrown exception.
static void | closeQueueBrowser(QueueBrowser browser) Close the given JMS QueueBrowser and ignore any thrown exception.
static void | closeQueueRequestor(QueueRequestor requestor) Close the given JMS QueueRequestor and ignore any thrown exception.
static void | closeSession(Session session) Close the given JMS Session and ignore any thrown exception.
static void | commitIfNecessary(Session session) Commit the Session if not within a JTA transaction.
static JmsException | convertJmsAccessException(JMSException ex) Convert the specified checked JMSException to a Spring runtime JmsException equivalent.
static void | rollbackIfNecessary(Session session) Rollback the Session if not within a JTA transaction.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JmsUtils

public JmsUtils()
Method Detail

closeConnection

public static void closeConnection(Connection con)
Close the given JMS Connection and ignore any thrown exception. This is useful for typical finally blocks in manual JMS code.

Parameters:
con - the JMS Connection to close (may be null)

closeConnection

public static void closeConnection(Connection con,
                                   boolean stop)
Close the given JMS Connection and ignore any thrown exception. This is useful for typical finally blocks in manual JMS code.

Parameters:
con - the JMS Connection to close (may be null)
stop - whether to call stop() before closing

closeSession

public static void closeSession(Session session)
Close the given JMS Session and ignore any thrown exception. This is useful for typical finally blocks in manual JMS code.

Parameters:
session - the JMS Session to close (may be null)

closeMessageProducer

public static void closeMessageProducer(MessageProducer producer)
Close the given JMS MessageProducer and ignore any thrown exception. This is useful for typical finally blocks in manual JMS code.

Parameters:
producer - the JMS MessageProducer to close (may be null)

closeMessageConsumer

public static void closeMessageConsumer(MessageConsumer consumer)
Close the given JMS MessageConsumer and ignore any thrown exception. This is useful for typical finally blocks in manual JMS code.

Parameters:
consumer - the JMS MessageConsumer to close (may be null)

closeQueueBrowser

public static void closeQueueBrowser(QueueBrowser browser)
Close the given JMS QueueBrowser and ignore any thrown exception. This is useful for typical finally blocks in manual JMS code.

Parameters:
browser - the JMS QueueBrowser to close (may be null)

closeQueueRequestor

public static void closeQueueRequestor(QueueRequestor requestor)
Close the given JMS QueueRequestor and ignore any thrown exception. This is useful for typical finally blocks in manual JMS code.

Parameters:
requestor - the JMS QueueRequestor to close (may be null)

commitIfNecessary

public static void commitIfNecessary(Session session)
                              throws JMSException
Commit the Session if not within a JTA transaction.

Parameters:
session - the JMS Session to commit
Throws:
JMSException - if committing failed

rollbackIfNecessary

public static void rollbackIfNecessary(Session session)
                                throws JMSException
Rollback the Session if not within a JTA transaction.

Parameters:
session - the JMS Session to rollback
Throws:
JMSException - if committing failed

buildExceptionMessage

public static String buildExceptionMessage(JMSException ex)
Build a descriptive exception message for the given JMSException, incorporating a linked exception's message if appropriate.

Parameters:
ex - the JMSException to build a message for
Returns:
the descriptive message String
See Also:
JMSException.getLinkedException()

convertJmsAccessException

public static JmsException convertJmsAccessException(JMSException ex)
Convert the specified checked JMSException to a Spring runtime JmsException equivalent.

Parameters:
ex - the original checked JMSException to convert
Returns:
the Spring runtime JmsException wrapping the given exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jms.support.converter

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jms.support.converter

Provides a MessageConverter abstraction to convert between Java objects and JMS messages.

See:
Description

Interface Summary
MessageConverter Strategy interface that specifies a converter between Java objects and JMS messages.

Class Summary
MarshallingMessageConverter | Spring JMS MessageConverter that uses a Marshaller and Unmarshaller.
SimpleMessageConverter | A simple message converter which is able to handle TextMessages, BytesMessages, MapMessages, and ObjectMessages.
SimpleMessageConverter102 | Deprecated. as of Spring 3.0, in favor of the JMS 1.1 based SimpleMessageConverter

Enum Summary
MessageType Constants that indicate a target message type to convert to: a TextMessage, a BytesMessage, a MapMessage or an ObjectMessage.

Exception Summary
MessageConversionException Thrown by MessageConverter implementations when the conversion of an object to/from a Message fails.

Package org.springframework.jms.support.converter Description

Provides a MessageConverter abstraction to convert between Java objects and JMS messages.


org.springframework.jms.support.converter Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jms.support.converter

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jms.support.converter.MarshallingMessageConverter (implements org.springframework.beans.factory.InitializingBean, org.springframework.jms.support.converter.MessageConverter)
    • org.springframework.jms.support.converter.SimpleMessageConverter (implements org.springframework.jms.support.converter.MessageConverter)
      • org.springframework.jms.support.converter.SimpleMessageConverter102
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.jms.JmsException
              • org.springframework.jms.support.converter.MessageConversionException

Interface Hierarchy

  • org.springframework.jms.support.converter.MessageConverter

Enum Hierarchy

  • java.lang.Object
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)
      • org.springframework.jms.support.converter.MessageType


MessageConverter

org.springframework.jms.support.converter
Interface MessageConverter

All Known Implementing Classes:
MarshallingMessageConverter, SimpleMessageConverter, SimpleMessageConverter102
public interface MessageConverter

Strategy interface that specifies a converter between Java objects and JMS messages.

Check out SimpleMessageConverter for a default implementation, converting between the 'standard' message payloads and JMS Message types.

Since:
1.1
Author:
Mark Pollack, Juergen Hoeller
See Also:
JmsTemplate.setMessageConverter(org.springframework.jms.support.converter.MessageConverter),
MessageListenerAdapter.setMessageConverter(org.springframework.jms.support.converter.MessageConverter),
JmsInvokerClientInterceptor.setMessageConverter(org.springframework.jms.support.converter.MessageConverter),
JmsInvokerServiceExporter.setMessageConverter(org.springframework.jms.support.converter.MessageConverter)

Method Summary
Object | fromMessage(Message message) Convert from a JMS Message to a Java object.
Message | toMessage(Object object, Session session) Convert a Java object to a JMS Message using the supplied session to create the message object.

Method Detail

toMessage

Message toMessage(Object object,
                  Session session)
                  throws JMSException,
                         MessageConversionException
Convert a Java object to a JMS Message using the supplied session to create the message object.

Parameters:
object - the object to convert
session - the Session to use for creating a JMS Message
Returns:
the JMS Message
Throws:
JMSException - if thrown by JMS API methods
MessageConversionException - in case of conversion failure

fromMessage

Object fromMessage(Message message)
                   throws JMSException,
                          MessageConversionException
Convert from a JMS Message to a Java object.

Parameters:
message - the message to convert
Returns:
the converted Java object
Throws:
JMSException - if thrown by JMS API methods
MessageConversionException - in case of conversion failure
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MarshallingMessageConverter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jms.support.converter
Class MarshallingMessageConverter

java.lang.Object
    extended by  org.springframework.jms.support.converter.MarshallingMessageConverter
All Implemented Interfaces:
InitializingBean, MessageConverter
public class MarshallingMessageConverter
extends Object
implements MessageConverter, InitializingBean

Spring JMS MessageConverter that uses a Marshaller and Unmarshaller. Marshals an object to a BytesMessage, or to a TextMessage if the marshalTo is set to MessageType.TEXT. Unmarshals from a TextMessage or BytesMessage to an object.

Since:
3.0
Author:
Arjen Poutsma, Juergen Hoeller
See Also:
JmsTemplate.convertAndSend(java.lang.Object), JmsTemplate.receiveAndConvert()

Constructor Summary
MarshallingMessageConverter()
Construct a new MarshallingMessageConverter with no Marshaller or Unmarshaller set.
MarshallingMessageConverter(Marshaller marshaller)
Construct a new MarshallingMessageConverter with the given Marshaller set.
MarshallingMessageConverter(Marshaller marshaller, Unmarshaller unmarshaller)
Construct a new MarshallingMessageConverter with the given Marshaller and Unmarshaller.
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
Object | fromMessage(Message message) This implementation unmarshals the given Message into an object.
protected BytesMessage | marshalToBytesMessage(Object object, Session session, Marshaller marshaller) Marshal the given object to a BytesMessage.
protected Message | marshalToMessage(Object object, Session session, Marshaller marshaller, MessageType targetType) Template method that allows for custom message marshalling.
protected TextMessage | marshalToTextMessage(Object object, Session session, Marshaller marshaller) Marshal the given object to a TextMessage.
void | setMarshaller(Marshaller marshaller) Set the Marshaller to be used by this message converter.
void | setTargetType(MessageType targetType) Specify whether toMessage(Object, Session) should marshal to a BytesMessage or a TextMessage.
void | setUnmarshaller(Unmarshaller unmarshaller) Set the Unmarshaller to be used by this message converter.
Message | toMessage(Object object, Session session) This implementation marshals the given object to a TextMessage or BytesMessage.
protected Object | unmarshalFromBytesMessage(BytesMessage message, Unmarshaller unmarshaller) Unmarshal the given BytesMessage into an object.
protected Object | unmarshalFromMessage(Message message, Unmarshaller unmarshaller) Template method that allows for custom message unmarshalling.
protected Object | unmarshalFromTextMessage(TextMessage message, Unmarshaller unmarshaller) Unmarshal the given TextMessage into an object.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MarshallingMessageConverter

public MarshallingMessageConverter()
Construct a new MarshallingMessageConverter with no Marshaller or Unmarshaller set. The marshaller must be set after construction by invoking setMarshaller(Marshaller) and setUnmarshaller(Unmarshaller) .

MarshallingMessageConverter

public MarshallingMessageConverter(Marshaller marshaller)
Construct a new MarshallingMessageConverter with the given Marshaller set.

If the given Marshaller also implements the Unmarshaller interface, it is used for both marshalling and unmarshalling. Otherwise, an exception is thrown.

Note that all Marshaller implementations in Spring also implement the Unmarshaller interface, so that you can safely use this constructor.

Parameters:
marshaller - object used as marshaller and unmarshaller
Throws:
IllegalArgumentException - when marshaller does not implement the Unmarshaller interface as well

MarshallingMessageConverter

public MarshallingMessageConverter(Marshaller marshaller,
                                   Unmarshaller unmarshaller)
Construct a new MarshallingMessageConverter with the given Marshaller and Unmarshaller.

Parameters:
marshaller - the Marshaller to use
unmarshaller - the Unmarshaller to use
Method Detail

setMarshaller

public void setMarshaller(Marshaller marshaller)
Set the Marshaller to be used by this message converter.

setUnmarshaller

public void setUnmarshaller(Unmarshaller unmarshaller)
Set the Unmarshaller to be used by this message converter.

setTargetType

public void setTargetType(MessageType targetType)
Specify whether toMessage(Object, Session) should marshal to a BytesMessage or a TextMessage.

The default is MessageType.BYTES, i.e. this converter marshals to a BytesMessage. Note that the default version of this converter supports MessageType.BYTES and MessageType.TEXT only.

See Also:
MessageType.BYTES, MessageType.TEXT

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

toMessage

public Message toMessage(Object object,
                         Session session)
                  throws JMSException,
                         MessageConversionException
This implementation marshals the given object to a TextMessage or BytesMessage. The desired message type can be defined by setting the "marshalTo" property.

Specified by:
toMessage in interface MessageConverter
Parameters:
object - the object to convert
session - the Session to use for creating a JMS Message
Returns:
the JMS Message
Throws:
JMSException - if thrown by JMS API methods
MessageConversionException - in case of conversion failure
See Also:
marshalToTextMessage(java.lang.Object, javax.jms.Session, org.springframework.oxm.Marshaller), marshalToBytesMessage(java.lang.Object, javax.jms.Session, org.springframework.oxm.Marshaller)

fromMessage

public Object fromMessage(Message message)
                   throws JMSException,
                          MessageConversionException
This implementation unmarshals the given Message into an object.

Specified by:
fromMessage in interface MessageConverter
Parameters:
message - the message to convert
Returns:
the converted Java object
Throws:
JMSException - if thrown by JMS API methods
MessageConversionException - in case of conversion failure
See Also:
unmarshalFromTextMessage(javax.jms.TextMessage, org.springframework.oxm.Unmarshaller), unmarshalFromBytesMessage(javax.jms.BytesMessage, org.springframework.oxm.Unmarshaller)

marshalToTextMessage

protected TextMessage marshalToTextMessage(Object object,
                                           Session session,
                                           Marshaller marshaller)
                                    throws JMSException,
                                           IOException,
                                           XmlMappingException
Marshal the given object to a TextMessage.

Parameters:
object - the object to be marshalled
session - current JMS session
marshaller - the marshaller to use
Returns:
the resulting message
Throws:
JMSException - if thrown by JMS methods
IOException - in case of I/O errors
XmlMappingException - in case of OXM mapping errors
See Also:
Session.createTextMessage(), Marshaller.marshal(Object, Result)

marshalToBytesMessage

protected BytesMessage marshalToBytesMessage(Object object,
                                             Session session,
                                             Marshaller marshaller)
                                      throws JMSException,
                                             IOException,
                                             XmlMappingException
Marshal the given object to a BytesMessage.

Parameters:
object - the object to be marshalled
session - current JMS session
marshaller - the marshaller to use
Returns:
the resulting message
Throws:
JMSException - if thrown by JMS methods
IOException - in case of I/O errors
XmlMappingException - in case of OXM mapping errors
See Also:
Session.createBytesMessage(), Marshaller.marshal(Object, Result)

marshalToMessage

protected Message marshalToMessage(Object object,
                                   Session session,
                                   Marshaller marshaller,
                                   MessageType targetType)
                            throws JMSException,
                                   IOException,
                                   XmlMappingException
Template method that allows for custom message marshalling. Invoked when setTargetType(org.springframework.jms.support.converter.MessageType) is not MessageType.TEXT or MessageType.BYTES.

The default implementation throws an IllegalArgumentException.

Parameters:
object - the object to marshal
session - the JMS session
marshaller - the marshaller to use
targetType - the target message type (other than TEXT or BYTES)
Returns:
the resulting message
Throws:
JMSException - if thrown by JMS methods
IOException - in case of I/O errors
XmlMappingException - in case of OXM mapping errors

unmarshalFromTextMessage

protected Object unmarshalFromTextMessage(TextMessage message,
                                          Unmarshaller unmarshaller)
                                   throws JMSException,
                                          IOException,
                                          XmlMappingException
Unmarshal the given TextMessage into an object.

Parameters:
message - the message
unmarshaller - the unmarshaller to use
Returns:
the unmarshalled object
Throws:
JMSException - if thrown by JMS methods
IOException - in case of I/O errors
XmlMappingException - in case of OXM mapping errors
See Also:
Unmarshaller.unmarshal(Source)

unmarshalFromBytesMessage

protected Object unmarshalFromBytesMessage(BytesMessage message,
                                           Unmarshaller unmarshaller)
                                    throws JMSException,
                                           IOException,
                                           XmlMappingException
Unmarshal the given BytesMessage into an object.

Parameters:
message - the message
unmarshaller - the unmarshaller to use
Returns:
the unmarshalled object
Throws:
JMSException - if thrown by JMS methods
IOException - in case of I/O errors
XmlMappingException - in case of OXM mapping errors
See Also:
Unmarshaller.unmarshal(Source)

unmarshalFromMessage

protected Object unmarshalFromMessage(Message message,
                                      Unmarshaller unmarshaller)
                               throws JMSException,
                                      IOException,
                                      XmlMappingException
Template method that allows for custom message unmarshalling. Invoked when fromMessage(Message) is invoked with a message that is not a TextMessage or BytesMessage.

The default implemenetation throws an IllegalArgumentException.

Parameters:
message - the message
unmarshaller - the unmarshaller to use
Returns:
the unmarshalled object
Throws:
JMSException - if thrown by JMS methods
IOException - in case of I/O errors
XmlMappingException - in case of OXM mapping errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


SimpleMessageConverter

org.springframework.jms.support.converter
Class SimpleMessageConverter

java.lang.Object
    extended by  org.springframework.jms.support.converter.SimpleMessageConverter
All Implemented Interfaces:
MessageConverter
Direct Known Subclasses:
SimpleMessageConverter102
public class SimpleMessageConverter
extends Object
implements MessageConverter

A simple message converter which is able to handle TextMessages, BytesMessages, MapMessages, and ObjectMessages. Used as default conversion strategy by JmsTemplate, for convertAndSend and receiveAndConvert operations.

Converts a String to a TextMessage, a byte array to a BytesMessage, a Map to a MapMessage, and a Serializable object to a ObjectMessage (or vice versa).

Since:
1.1
Author:
Juergen Hoeller
See Also:
JmsTemplate.convertAndSend(java.lang.Object), JmsTemplate.receiveAndConvert()

Constructor Summary
SimpleMessageConverter()
Method Summary
protected BytesMessage | createMessageForByteArray(byte[] bytes, Session session) Create a JMS BytesMessage for the given byte array.
protected MapMessage | createMessageForMap(Map<?,?> map, Session session) Create a JMS MapMessage for the given Map.
protected ObjectMessage | createMessageForSerializable(Serializable object, Session session) Create a JMS ObjectMessage for the given Serializable object.
protected TextMessage | createMessageForString(String text, Session session) Create a JMS TextMessage for the given String.
protected byte[] | extractByteArrayFromMessage(BytesMessage message) Extract a byte array from the given BytesMessage.
protected Map | extractMapFromMessage(MapMessage message) Extract a Map from the given MapMessage.
protected Serializable | extractSerializableFromMessage(ObjectMessage message) Extract a Serializable object from the given ObjectMessage.
protected String | extractStringFromMessage(TextMessage message) Extract a String from the given TextMessage.
Object | fromMessage(Message message) This implementation converts a TextMessage back to a String, a ByteMessage back to a byte array, a MapMessage back to a Map, and an ObjectMessage back to a Serializable object.
Message | toMessage(Object object, Session session) This implementation creates a TextMessage for a String, a BytesMessage for a byte array, a MapMessage for a Map, and an ObjectMessage for a Serializable object.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleMessageConverter

public SimpleMessageConverter()
Method Detail

toMessage

public Message toMessage(Object object,
                         Session session)
                  throws JMSException,
                         MessageConversionException
This implementation creates a TextMessage for a String, a BytesMessage for a byte array, a MapMessage for a Map, and an ObjectMessage for a Serializable object.

Specified by:
toMessage in interface MessageConverter
Parameters:
object - the object to convert
session - the Session to use for creating a JMS Message
Returns:
the JMS Message
Throws:
JMSException - if thrown by JMS API methods
MessageConversionException - in case of conversion failure
See Also:
createMessageForString(java.lang.String, javax.jms.Session),
createMessageForByteArray(byte[], javax.jms.Session),
createMessageForMap(java.util.Map, javax.jms.Session),
createMessageForSerializable(java.io.Serializable, javax.jms.Session)

fromMessage

public Object fromMessage(Message message)
                   throws JMSException,
                          MessageConversionException
This implementation converts a TextMessage back to a String, a ByteMessage back to a byte array, a MapMessage back to a Map, and an ObjectMessage back to a Serializable object. Returns the plain Message object in case of an unknown message type.

Specified by:
fromMessage in interface MessageConverter
Parameters:
message - the message to convert
Returns:
the converted Java object
Throws:
JMSException - if thrown by JMS API methods
MessageConversionException - in case of conversion failure
See Also:
extractStringFromMessage(javax.jms.TextMessage),
extractByteArrayFromMessage(javax.jms.BytesMessage),
extractMapFromMessage(javax.jms.MapMessage),
extractSerializableFromMessage(javax.jms.ObjectMessage)

createMessageForString

protected TextMessage createMessageForString(String text,
                                             Session session)
                                      throws JMSException
Create a JMS TextMessage for the given String.

Parameters:
text - the String to convert
session - current JMS session
Returns:
the resulting message
Throws:
JMSException - if thrown by JMS methods
See Also:
Session.createTextMessage()

createMessageForByteArray

protected BytesMessage createMessageForByteArray(byte[] bytes,
                                                 Session session)
                                          throws JMSException
Create a JMS BytesMessage for the given byte array.

Parameters:
bytes - the byyte array to convert
session - current JMS session
Returns:
the resulting message
Throws:
JMSException - if thrown by JMS methods
See Also:
Session.createBytesMessage()

createMessageForMap

protected MapMessage createMessageForMap(Map<?,?> map,
                                         Session session)
                                  throws JMSException
Create a JMS MapMessage for the given Map.

Parameters:
map - the Map to convert
session - current JMS session
Returns:
the resulting message
Throws:
JMSException - if thrown by JMS methods
See Also:
Session.createMapMessage()

createMessageForSerializable

protected ObjectMessage createMessageForSerializable(Serializable object,
                                                     Session session)
                                              throws JMSException
Create a JMS ObjectMessage for the given Serializable object.

Parameters:
object - the Serializable object to convert
session - current JMS session
Returns:
the resulting message
Throws:
JMSException - if thrown by JMS methods
See Also:
Session.createObjectMessage()

extractStringFromMessage

protected String extractStringFromMessage(TextMessage message)
                                   throws JMSException
Extract a String from the given TextMessage.

Parameters:
message - the message to convert
Returns:
the resulting String
Throws:
JMSException - if thrown by JMS methods

extractByteArrayFromMessage

protected byte[] extractByteArrayFromMessage(BytesMessage message)
                                      throws JMSException
Extract a byte array from the given BytesMessage.

Parameters:
message - the message to convert
Returns:
the resulting byte array
Throws:
JMSException - if thrown by JMS methods

extractMapFromMessage

protected Map extractMapFromMessage(MapMessage message)
                             throws JMSException
Extract a Map from the given MapMessage.

Parameters:
message - the message to convert
Returns:
the resulting Map
Throws:
JMSException - if thrown by JMS methods

extractSerializableFromMessage

protected Serializable extractSerializableFromMessage(ObjectMessage message)
                                               throws JMSException
Extract a Serializable object from the given ObjectMessage.

Parameters:
message - the message to convert
Returns:
the resulting Serializable object
Throws:
JMSException - if thrown by JMS methods
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleMessageConverter102

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jms.support.converter
Class SimpleMessageConverter102

java.lang.Object
    extended by  org.springframework.jms.support.converter.SimpleMessageConverter
        extended by  org.springframework.jms.support.converter.SimpleMessageConverter102
All Implemented Interfaces:
MessageConverter
Deprecated. as of Spring 3.0, in favor of the JMS 1.1 based SimpleMessageConverter

@Deprecated
public class SimpleMessageConverter102
extends SimpleMessageConverter

A subclass of SimpleMessageConverter for the JMS 1.0.2 specification, not relying on JMS 1.1 methods like SimpleMessageConverter itself. This class can be used for JMS 1.0.2 providers, offering the same functionality as SimpleMessageConverter does for JMS 1.1 providers.

The only difference to the default SimpleMessageConverter is that BytesMessage is handled differently: namely, without using the getBodyLength() method which has been introduced in JMS 1.1 and is therefore not available on a JMS 1.0.2 provider.

Since:
1.1.1
Author:
Juergen Hoeller
See Also:
BytesMessage.getBodyLength()

Field Summary
static int BUFFER_SIZE
Deprecated.
Constructor Summary
SimpleMessageConverter102()
Deprecated.
Method Summary
protected  byte[] extractByteArrayFromMessage(BytesMessage message)
Deprecated. Overrides superclass method to copy bytes from the message into a ByteArrayOutputStream, using a buffer, to avoid using the getBodyLength() method which has been introduced in JMS 1.1 and is therefore not available on a JMS 1.0.2 provider.
Methods inherited from class org.springframework.jms.support.converter.SimpleMessageConverter
createMessageForByteArray, createMessageForMap, createMessageForSerializable, createMessageForString, extractMapFromMessage, extractSerializableFromMessage, extractStringFromMessage, fromMessage, toMessage
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

BUFFER_SIZE

public static final int BUFFER_SIZE
Deprecated.
See Also:
Constant Field Values
Constructor Detail

SimpleMessageConverter102

public SimpleMessageConverter102()
Deprecated.
Method Detail

extractByteArrayFromMessage

protected byte[] extractByteArrayFromMessage(BytesMessage message)
                                      throws JMSException
Deprecated.
Overrides superclass method to copy bytes from the message into a ByteArrayOutputStream, using a buffer, to avoid using the getBodyLength() method which has been introduced in JMS 1.1 and is therefore not available on a JMS 1.0.2 provider.

Overrides:
extractByteArrayFromMessage in class SimpleMessageConverter
Parameters:
message - the message to convert
Returns:
the resulting byte array
Throws:
JMSException - if thrown by JMS methods
See Also:
BytesMessage.getBodyLength()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


MessageType

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

org.springframework.jms.support.converter
Enum MessageType

java.lang.Object
    extended by  java.lang.Enum<MessageType>
        extended by  org.springframework.jms.support.converter.MessageType
All Implemented Interfaces:
Serializable, Comparable<MessageType>
public enum MessageType
extends Enum<MessageType>

Constants that indicate a target message type to convert to: a TextMessage, a BytesMessage, a MapMessage or an ObjectMessage.

Since:
3.0
Author:
Juergen Hoeller
See Also:
MarshallingMessageConverter.setTargetType(org.springframework.jms.support.converter.MessageType)

Enum Constant Summary
BYTES
MAP
OBJECT
TEXT
Method Summary
static MessageType | valueOf(String name) Returns the enum constant of this type with the specified name.
static MessageType[] | values() Returns an array containing the constants of this enum type, in the order they are declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

TEXT

public static final MessageType TEXT

BYTES

public static final MessageType BYTES

MAP

public static final MessageType MAP

OBJECT

public static final MessageType OBJECT
Method Detail

values

public static MessageType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (MessageType c : MessageType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static MessageType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


MessageConversionException

org.springframework.jms.support.converter
Class MessageConversionException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.jms.JmsException
                        extended by  org.springframework.jms.support.converter.MessageConversionException
All Implemented Interfaces:
Serializable
public class MessageConversionException
extends JmsException

Thrown by MessageConverter implementations when the conversion of an object to/from a Message fails.

Since:
1.1
Author:
Mark Pollack
See Also:
MessageConverter, Serialized Form

Constructor Summary
MessageConversionException(String msg)
Create a new MessageConversionException.
MessageConversionException(String msg, Throwable cause)
Create a new MessageConversionException.
Method Summary
Methods inherited from class org.springframework.jms.JmsException
getErrorCode, getMessage
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

MessageConversionException

public MessageConversionException(String msg)
Create a new MessageConversionException.

Parameters:
msg - the detail message

MessageConversionException

public MessageConversionException(String msg,
                                  Throwable cause)
Create a new MessageConversionException.

Parameters:
msg - the detail message
cause - the root cause (if any)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.jms.support.destination

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jms.support.destination

Support classes for Spring's JMS framework.

See:
Description

Interface Summary
CachingDestinationResolver | Extension of the DestinationResolver interface, exposing methods for clearing the cache.
DestinationResolver | Strategy interface for resolving JMS destinations.

Class Summary
BeanFactoryDestinationResolver | DestinationResolver implementation based on a Spring BeanFactory.
DynamicDestinationResolver | Simple DestinationResolver implementation resolving destination names as dynamic destinations.
JmsDestinationAccessor | Base class for JmsTemplate and other JMS-accessing gateway helpers, adding destination-related properties to JmsAccessor's common properties.
JndiDestinationResolver | DestinationResolver implementation which interprets destination names as JNDI locations (with a configurable fallback strategy).

Exception Summary
DestinationResolutionException Thrown by a DestinationResolver when it cannot resolve a destination name.

Package org.springframework.jms.support.destination Description

Support classes for Spring's JMS framework.


org.springframework.jms.support.destination Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jms.support.destination

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jms.support.destination.BeanFactoryDestinationResolver (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.jms.support.destination.DestinationResolver)
    • org.springframework.jms.support.destination.DynamicDestinationResolver (implements org.springframework.jms.support.destination.DestinationResolver)
    • org.springframework.jms.support.JmsAccessor (implements org.springframework.beans.factory.InitializingBean)
      • org.springframework.jms.support.destination.JmsDestinationAccessor
    • org.springframework.jndi.JndiAccessor
      • org.springframework.jndi.JndiLocatorSupport
        • org.springframework.jms.support.destination.JndiDestinationResolver (implements org.springframework.jms.support.destination.CachingDestinationResolver)
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.jms.JmsException
              • org.springframework.jms.support.destination.DestinationResolutionException

Interface Hierarchy

  • org.springframework.jms.support.destination.DestinationResolver
    • org.springframework.jms.support.destination.CachingDestinationResolver


CachingDestinationResolver

org.springframework.jms.support.destination
Interface CachingDestinationResolver

All Superinterfaces:
DestinationResolver
All Known Implementing Classes:
JndiDestinationResolver
public interface CachingDestinationResolver
extends DestinationResolver

Extension of the DestinationResolver interface, exposing methods for clearing the cache.

Since:
2.0
Author:
Juergen Hoeller

Method Summary
void | clearCache() Clear the entire destination cache.
void | removeFromCache(String destinationName) Remove the destination with the given name from the cache (if cached by this resolver in the first place).
Methods inherited from interface org.springframework.jms.support.destination.DestinationResolver
resolveDestinationName

Method Detail

removeFromCache

void removeFromCache(String destinationName)
Remove the destination with the given name from the cache (if cached by this resolver in the first place).

To be called if access to the specified destination failed, assuming that the JMS Destination object might have become invalid.

Parameters:
destinationName - the name of the destination

clearCache

void clearCache()
Clear the entire destination cache.

To be called in case of general JMS provider failure.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DestinationResolver

org.springframework.jms.support.destination
Interface DestinationResolver

All Known Subinterfaces:
CachingDestinationResolver
All Known Implementing Classes:
BeanFactoryDestinationResolver, DynamicDestinationResolver, JndiDestinationResolver
public interface DestinationResolver

Strategy interface for resolving JMS destinations.

Used by JmsTemplate for resolving destination names from simple Strings to actual Destination implementation instances.

The default DestinationResolver implementation used by JmsTemplate instances is the DynamicDestinationResolver class. Consider using the JndiDestinationResolver for more advanced scenarios.

Since:
1.1
Author:
Juergen Hoeller
See Also:
JmsDestinationAccessor.setDestinationResolver(org.springframework.jms.support.destination.DestinationResolver), DynamicDestinationResolver, JndiDestinationResolver

Method Summary
 Destination resolveDestinationName(Session session, String destinationName, boolean pubSubDomain)
Resolve the given destination name, either as located resource or as dynamic destination.

Method Detail

resolveDestinationName

Destination resolveDestinationName(Session session,
                                   String destinationName,
                                   boolean pubSubDomain)
                                   throws JMSException
Resolve the given destination name, either as located resource or as dynamic destination.

Parameters:
session - the current JMS Session (may be null if the resolver implementation is able to work without it)
destinationName - the name of the destination
pubSubDomain - true if the domain is pub-sub, false if P2P
Returns:
the JMS destination (either a topic or a queue)
Throws:
JMSException - if the JMS Session failed to resolve the destination
DestinationResolutionException - in case of general destination resolution failure
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanFactoryDestinationResolver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jms.support.destination
Class BeanFactoryDestinationResolver

java.lang.Object
    extended by  org.springframework.jms.support.destination.BeanFactoryDestinationResolver
All Implemented Interfaces:
BeanFactoryAware, DestinationResolver
public class BeanFactoryDestinationResolver
extends Object
implements DestinationResolver, BeanFactoryAware

DestinationResolver implementation based on a Spring BeanFactory.

Will lookup Spring managed beans identified by bean name, expecting them to be of type javax.jms.Destination.

Since:
2.5
Author:
Juergen Hoeller
See Also:
BeanFactory

Constructor Summary
BeanFactoryDestinationResolver()
Create a new instance of the BeanFactoryDestinationResolver class.
BeanFactoryDestinationResolver(BeanFactory beanFactory)
Create a new instance of the BeanFactoryDestinationResolver class.
Method Summary
Destination | resolveDestinationName(Session session, String destinationName, boolean pubSubDomain) Resolve the given destination name, either as located resource or as dynamic destination.
void | setBeanFactory(BeanFactory beanFactory) Callback that supplies the owning factory to a bean instance.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BeanFactoryDestinationResolver

public BeanFactoryDestinationResolver()
Create a new instance of the BeanFactoryDestinationResolver class.

The BeanFactory to access must be set via setBeanFactory.

See Also:
setBeanFactory(org.springframework.beans.factory.BeanFactory)

BeanFactoryDestinationResolver

public BeanFactoryDestinationResolver(BeanFactory beanFactory)
Create a new instance of the BeanFactoryDestinationResolver class.

Use of this constructor is redundant if this object is being created by a Spring IoC container, as the supplied BeanFactory will be replaced by the BeanFactory that creates it (c.f. the BeanFactoryAware contract). So only use this constructor if you are using this class outside the context of a Spring IoC container.

Parameters:
beanFactory - the bean factory to be used to lookup Destinatiosn
Method Detail

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
BeanInitializationException

resolveDestinationName

public Destination resolveDestinationName(Session session,
                                          String destinationName,
                                          boolean pubSubDomain)
                                   throws JMSException
Description copied from interface: DestinationResolver
Resolve the given destination name, either as located resource or as dynamic destination.

Specified by:
resolveDestinationName in interface DestinationResolver
Parameters:
session - the current JMS Session (may be null if the resolver implementation is able to work without it)
destinationName - the name of the destination
pubSubDomain - true if the domain is pub-sub, false if P2P
Returns:
the JMS destination (either a topic or a queue)
Throws:
JMSException - if the JMS Session failed to resolve the destination
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


DynamicDestinationResolver

org.springframework.jms.support.destination
Class DynamicDestinationResolver

java.lang.Object
    extended by  org.springframework.jms.support.destination.DynamicDestinationResolver
All Implemented Interfaces:
DestinationResolver
public class DynamicDestinationResolver
extends Object
implements DestinationResolver

Simple DestinationResolver implementation resolving destination names as dynamic destinations.

This implementation will work on both JMS 1.1 and JMS 1.0.2, because it uses the QueueSession or TopicSession methods if possible, falling back to JMS 1.1's generic Session methods.

Since:
1.1
Author:
Juergen Hoeller
See Also:
QueueSession.createQueue(java.lang.String),
TopicSession.createTopic(java.lang.String),
Session.createQueue(java.lang.String),
Session.createTopic(java.lang.String)

Constructor Summary
DynamicDestinationResolver()
Method Summary
Destination | resolveDestinationName(Session session, String destinationName, boolean pubSubDomain) Resolve the specified destination name as a dynamic destination.
protected Queue | resolveQueue(Session session, String queueName) Resolve the given destination name to a Queue.
protected Topic | resolveTopic(Session session, String topicName) Resolve the given destination name to a Topic.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DynamicDestinationResolver

public DynamicDestinationResolver()
Method Detail

resolveDestinationName

public Destination resolveDestinationName(Session session,
                                          String destinationName,
                                          boolean pubSubDomain)
                                   throws JMSException
Resolve the specified destination name as a dynamic destination.

Specified by:
resolveDestinationName in interface DestinationResolver
Parameters:
session - the current JMS Session
destinationName - the name of the destination
pubSubDomain - true if the domain is pub-sub, false if P2P
Returns:
the JMS destination (either a topic or a queue)
Throws:
JMSException - if resolution failed
See Also:
resolveTopic(javax.jms.Session, String), resolveQueue(javax.jms.Session, String)

resolveTopic

protected Topic resolveTopic(Session session,
                             String topicName)
                      throws JMSException
Resolve the given destination name to a Topic.

Parameters:
session - the current JMS Session
topicName - the name of the desired Topic
Returns:
the JMS Topic
Throws:
JMSException - if resolution failed
See Also:
Session.createTopic(String)

resolveQueue

protected Queue resolveQueue(Session session,
                             String queueName)
                      throws JMSException
Resolve the given destination name to a Queue.

Parameters:
session - the current JMS Session
queueName - the name of the desired Queue
Returns:
the JMS Queue
Throws:
JMSException - if resolution failed
See Also:
Session.createQueue(String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JmsDestinationAccessor

org.springframework.jms.support.destination
Class JmsDestinationAccessor

java.lang.Object
    extended by  org.springframework.jms.support.JmsAccessor
        extended by  org.springframework.jms.support.destination.JmsDestinationAccessor
All Implemented Interfaces:
InitializingBean
Direct Known Subclasses:
AbstractJmsListeningContainer, JmsTemplate
public abstract class JmsDestinationAccessor
extends JmsAccessor

Base class for JmsTemplate and other JMS-accessing gateway helpers, adding destination-related properties to JmsAccessor's common properties.

Not intended to be used directly. See JmsTemplate.

Since:
1.2.5
Author:
Juergen Hoeller
See Also:
JmsAccessor, JmsTemplate

Field Summary
Fields inherited from class org.springframework.jms.support.JmsAccessor
logger
Constructor Summary
JmsDestinationAccessor()
Method Summary
DestinationResolver | getDestinationResolver() Return the DestinationResolver for this accessor (never null).
boolean | isPubSubDomain() Return whether the Publish/Subscribe domain (Topics) is used.
protected Destination | resolveDestinationName(Session session, String destinationName) Resolve the given destination name into a JMS Destination, via this accessor's DestinationResolver.
void | setDestinationResolver(DestinationResolver destinationResolver) Set the DestinationResolver that is to be used to resolve Destination references for this accessor.
void | setPubSubDomain(boolean pubSubDomain) Configure the destination accessor with knowledge of the JMS domain used.
Methods inherited from class org.springframework.jms.support.JmsAccessor
afterPropertiesSet, convertJmsAccessException, createConnection, createSession, getConnectionFactory, getSessionAcknowledgeMode, isClientAcknowledge, isSessionTransacted, setConnectionFactory, setSessionAcknowledgeMode, setSessionAcknowledgeModeName, setSessionTransacted
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JmsDestinationAccessor

public JmsDestinationAccessor()
Method Detail

setDestinationResolver

public void setDestinationResolver(DestinationResolver destinationResolver)
Set the DestinationResolver that is to be used to resolve Destination references for this accessor.

The default resolver is a DynamicDestinationResolver. Specify a JndiDestinationResolver for resolving destination names as JNDI locations.

See Also:
DynamicDestinationResolver, JndiDestinationResolver

getDestinationResolver

public DestinationResolver getDestinationResolver()
Return the DestinationResolver for this accessor (never null).

setPubSubDomain

public void setPubSubDomain(boolean pubSubDomain)
Configure the destination accessor with knowledge of the JMS domain used. Default is Point-to-Point (Queues).

For JMS 1.0.2 based accessors, this tells the JMS provider which class hierarchy to use in the implementation of its operations. For JMS 1.1 based accessors, this setting does usually not affect operations. However, for both JMS versions, this setting tells what type of destination to resolve if dynamic destinations are enabled.

Parameters:
pubSubDomain - "true" for the Publish/Subscribe domain (Topics), "false" for the Point-to-Point domain (Queues)
See Also:
setDestinationResolver(org.springframework.jms.support.destination.DestinationResolver)

isPubSubDomain

public boolean isPubSubDomain()
Return whether the Publish/Subscribe domain (Topics) is used. Otherwise, the Point-to-Point domain (Queues) is used.

resolveDestinationName

protected Destination resolveDestinationName(Session session,
                                             String destinationName)
                                      throws JMSException
Resolve the given destination name into a JMS Destination, via this accessor's DestinationResolver.

Parameters:
session - the current JMS Session
destinationName - the name of the destination
Returns:
the located Destination
Throws:
JMSException - if resolution failed
See Also:
setDestinationResolver(org.springframework.jms.support.destination.DestinationResolver)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JndiDestinationResolver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jms.support.destination
Class JndiDestinationResolver

java.lang.Object
    extended by  org.springframework.jndi.JndiAccessor
        extended by  org.springframework.jndi.JndiLocatorSupport
            extended by  org.springframework.jms.support.destination.JndiDestinationResolver
All Implemented Interfaces:
CachingDestinationResolver, DestinationResolver
public class JndiDestinationResolver
extends JndiLocatorSupport
implements CachingDestinationResolver

DestinationResolver implementation which interprets destination names as JNDI locations (with a configurable fallback strategy).

Allows for customizing the JNDI environment if necessary, for example specifying appropriate JNDI environment properties.

Dynamic queues and topics get cached by destination name. As a consequence, you need to use unique destination names across both queues and topics. Caching can be turned off through the "cache" flag.

Note that the fallback to resolution of dynamic destinations is turned off by default. Switch the "fallbackToDynamicDestination" flag on to enable this functionality.

Since:
1.1
Author:
Mark Pollack, Juergen Hoeller
See Also:
JndiAccessor.setJndiTemplate(org.springframework.jndi.JndiTemplate), JndiAccessor.setJndiEnvironment(java.util.Properties), setCache(boolean), setFallbackToDynamicDestination(boolean)

Field Summary
Fields inherited from class org.springframework.jndi.JndiLocatorSupport
CONTAINER_PREFIX
Fields inherited from class org.springframework.jndi.JndiAccessor
logger
Constructor Summary
JndiDestinationResolver()
Method Summary
void | clearCache() Clear the entire destination cache.
void | removeFromCache(String destinationName) Remove the destination with the given name from the cache (if cached by this resolver in the first place).
Destination | resolveDestinationName(Session session, String destinationName, boolean pubSubDomain) Resolve the given destination name, either as located resource or as dynamic destination.
void | setCache(boolean cache) Set whether to cache resolved destinations.
void | setDynamicDestinationResolver(DestinationResolver dynamicDestinationResolver) Set the DestinationResolver to use when falling back to dynamic destinations.
void | setFallbackToDynamicDestination(boolean fallbackToDynamicDestination) Set whether this resolver is supposed to create dynamic destinations if the destination name is not found in JNDI.
protected void | validateDestination(Destination destination, String destinationName, boolean pubSubDomain) Validate the given Destination object, checking whether it matches the expected type.
Methods inherited from class org.springframework.jndi.JndiLocatorSupport
convertJndiName, isResourceRef, lookup, lookup, setResourceRef
Methods inherited from class org.springframework.jndi.JndiAccessor
getJndiEnvironment, getJndiTemplate, setJndiEnvironment, setJndiTemplate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JndiDestinationResolver

public JndiDestinationResolver()
Method Detail

setCache

public void setCache(boolean cache)
Set whether to cache resolved destinations. Default is "true".

This flag can be turned off to re-lookup a destination for each operation, which allows for hot restarting of destinations. This is mainly useful during development.

Note that dynamic queues and topics get cached by destination name. As a consequence, you need to use unique destination names across both queues and topics.

setFallbackToDynamicDestination

public void setFallbackToDynamicDestination(boolean fallbackToDynamicDestination)
Set whether this resolver is supposed to create dynamic destinations if the destination name is not found in JNDI. Default is "false".

Turn this flag on to enable transparent fallback to dynamic destinations.

See Also:
setDynamicDestinationResolver(org.springframework.jms.support.destination.DestinationResolver)

setDynamicDestinationResolver

public void setDynamicDestinationResolver(DestinationResolver dynamicDestinationResolver)
Set the DestinationResolver to use when falling back to dynamic destinations.

The default is Spring's standard DynamicDestinationResolver.

See Also:
setFallbackToDynamicDestination(boolean), DynamicDestinationResolver

resolveDestinationName

public Destination resolveDestinationName(Session session,
                                          String destinationName,
                                          boolean pubSubDomain)
                                   throws JMSException
Description copied from interface: DestinationResolver
Resolve the given destination name, either as located resource or as dynamic destination.

Specified by:
resolveDestinationName in interface DestinationResolver
Parameters:
session - the current JMS Session (may be null if the resolver implementation is able to work without it)
destinationName - the name of the destination
pubSubDomain - true if the domain is pub-sub, false if P2P
Returns:
the JMS destination (either a topic or a queue)
Throws:
JMSException - if the JMS Session failed to resolve the destination

validateDestination

protected void validateDestination(Destination destination,
                                   String destinationName,
                                   boolean pubSubDomain)
Validate the given Destination object, checking whether it matches the expected type.

Parameters:
destination - the Destination object to validate
destinationName - the name of the destination
pubSubDomain - true if a Topic is expected, false in case of a Queue

removeFromCache

public void removeFromCache(String destinationName)
Description copied from interface: CachingDestinationResolver
Remove the destination with the given name from the cache (if cached by this resolver in the first place).

To be called if access to the specified destination failed, assuming that the JMS Destination object might have become invalid.

Specified by:
removeFromCache in interface CachingDestinationResolver
Parameters:
destinationName - the name of the destination

clearCache

public void clearCache()
Description copied from interface: CachingDestinationResolver
Clear the entire destination cache.

To be called in case of general JMS provider failure.

Specified by:
clearCache in interface CachingDestinationResolver
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


DestinationResolutionException

org.springframework.jms.support.destination
Class DestinationResolutionException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.jms.JmsException
                        extended by  org.springframework.jms.support.destination.DestinationResolutionException
All Implemented Interfaces:
Serializable
public class DestinationResolutionException
extends JmsException

Thrown by a DestinationResolver when it cannot resolve a destination name.

Since:
1.1
Author:
Juergen Hoeller
See Also:
DestinationResolver, Serialized Form

Constructor Summary
DestinationResolutionException(String msg)
Create a new DestinationResolutionException.
DestinationResolutionException(String msg, Throwable cause)
Create a new DestinationResolutionException.
Method Summary
Methods inherited from class org.springframework.jms.JmsException
getErrorCode, getMessage
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

DestinationResolutionException

public DestinationResolutionException(String msg)
Create a new DestinationResolutionException.

Parameters:
msg - the detail message

DestinationResolutionException

public DestinationResolutionException(String msg,
                                      Throwable cause)
Create a new DestinationResolutionException.

Parameters:
msg - the detail message
cause - the root cause (if any)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.jmx

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jmx

This package contains Spring's JMX support, which includes registration of Spring-managed beans as JMX MBeans as well as access to remote JMX MBeans.

See:
Description

Exception Summary
JmxException | General base exception to be thrown on JMX errors.
MBeanServerNotFoundException | Exception thrown when we cannot locate an instance of an MBeanServer, or when more than one instance is found.

Package org.springframework.jmx Description

This package contains Spring's JMX support, which includes registration of Spring-managed beans as JMX MBeans as well as access to remote JMX MBeans.


org.springframework.jmx Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jmx

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.jmx.JmxException
              • org.springframework.jmx.MBeanServerNotFoundException


JmxException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jmx
Class JmxException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.jmx.JmxException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
InvalidMetadataException, InvocationFailureException, MBeanConnectFailureException, MBeanExportException, MBeanInfoRetrievalException, MBeanServerNotFoundException, UnableToSendNotificationException
public class JmxException
extends NestedRuntimeException

General base exception to be thrown on JMX errors. Unchecked since JMX failures are usually fatal.

Since:
2.0
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
JmxException(String msg)
Constructor for JmxException.
JmxException(String msg, Throwable cause)
Constructor for JmxException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

JmxException

public JmxException(String msg)
Constructor for JmxException.

Parameters:
msg - the detail message

JmxException

public JmxException(String msg,
                    Throwable cause)
Constructor for JmxException.

Parameters:
msg - the detail message
cause - the root cause (usually a raw JMX API exception)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


MBeanServerNotFoundException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jmx
Class MBeanServerNotFoundException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.jmx.JmxException
                        extended by  org.springframework.jmx.MBeanServerNotFoundException
All Implemented Interfaces:
Serializable
public class MBeanServerNotFoundException
extends JmxException

Exception thrown when we cannot locate an instance of an MBeanServer, or when more than one instance is found.

Since:
1.2
Author:
Rob Harrop, Juergen Hoeller
See Also:
JmxUtils.locateMBeanServer(), Serialized Form

Constructor Summary
MBeanServerNotFoundException(String msg)
Create a new MBeanServerNotFoundException with the supplied error message.
MBeanServerNotFoundException(String msg, Throwable cause)
Create a new MBeanServerNotFoundException with the specified error message and root cause.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

MBeanServerNotFoundException

public MBeanServerNotFoundException(String msg)
Create a new MBeanServerNotFoundException with the supplied error message.

Parameters:
msg - the error message

MBeanServerNotFoundException

public MBeanServerNotFoundException(String msg,
                                    Throwable cause)
Create a new MBeanServerNotFoundException with the specified error message and root cause.

Parameters:
msg - the error message
cause - the root cause
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jmx.access

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jmx.access

Provides support for accessing remote MBean resources.

See:
Description

Class Summary
MBeanClientInterceptor | MethodInterceptor that routes calls to an MBean running on the supplied MBeanServerConnection.
MBeanProxyFactoryBean | Creates a proxy to a managed resource running either locally or remotely.
NotificationListenerRegistrar | Registrar object that associates a specific NotificationListener with one or more MBeans in an MBeanServer (typically via a MBeanServerConnection).

Exception Summary
InvalidInvocationException | Thrown when trying to invoke an operation on a proxy that is not exposed by the proxied MBean resource's management interface.
InvocationFailureException | Thrown when an invocation on an MBean resource failed with an exception (either a reflection exception or an exception thrown by the target method itself).
MBeanConnectFailureException | Thrown when an invocation failed because of an I/O problem on the MBeanServerConnection.
MBeanInfoRetrievalException | Thrown if an exception is encountered when trying to retrieve MBean metadata.

Package org.springframework.jmx.access Description

Provides support for accessing remote MBean resources. Requires JMX 1.2 or above.


org.springframework.jmx.access Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jmx.access

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jmx.access.MBeanClientInterceptor (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.aopalliance.intercept.MethodInterceptor)
      • org.springframework.jmx.access.MBeanProxyFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.jmx.support.NotificationListenerHolder
      • org.springframework.jmx.access.NotificationListenerRegistrar (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean)
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • javax.management.JMRuntimeException
            • org.springframework.jmx.access.InvalidInvocationException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.jmx.JmxException
              • org.springframework.jmx.access.InvocationFailureException
              • org.springframework.jmx.access.MBeanConnectFailureException
              • org.springframework.jmx.access.MBeanInfoRetrievalException


MBeanClientInterceptor

org.springframework.jmx.access
Class MBeanClientInterceptor

java.lang.Object
    extended by  org.springframework.jmx.access.MBeanClientInterceptor
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, BeanClassLoaderAware, DisposableBean, InitializingBean
Direct Known Subclasses:
MBeanProxyFactoryBean
public class MBeanClientInterceptor
extends Object
implements MethodInterceptor, BeanClassLoaderAware, InitializingBean, DisposableBean

MethodInterceptor that routes calls to an MBean running on the supplied MBeanServerConnection. Works for both local and remote MBeanServerConnections.

By default, the MBeanClientInterceptor will connect to the MBeanServer and cache MBean metadata at startup. This can be undesirable when running against a remote MBeanServer that may not be running when the application starts. Through setting the connectOnStartup property to "false", you can defer this process until the first invocation against the proxy.

This functionality is usually used through MBeanProxyFactoryBean. See the javadoc of that class for more information.

Since:
1.2
Author:
Rob Harrop, Juergen Hoeller
See Also:
MBeanProxyFactoryBean, setConnectOnStartup(boolean)

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
MBeanClientInterceptor()
Method Summary
void | afterPropertiesSet() Prepares the MBeanServerConnection if the "connectOnStartup" is turned on (which it is by default).
protected Object | convertResultValueIfNecessary(Object result, MethodParameter parameter) Convert the given result object (from attribute access or operation invocation) to the specified target class for returning from the proxy method.
void | destroy() Invoked by a BeanFactory on destruction of a singleton.
protected Object | doInvoke(MethodInvocation invocation) Route the invocation to the configured managed resource.
Map<String,?> | getEnvironment() Allow Map access to the environment to be set for the connector, with the option to add or override specific entries.
protected Class | getManagementInterface() Return the management interface of the target MBean, or null if none specified.
protected Object | handleConnectFailure(MethodInvocation invocation, Exception ex) Refresh the connection and retry the MBean invocation if possible.
Object | invoke(MethodInvocation invocation) Route the invocation to the configured managed resource..
protected boolean | isPrepared() Return whether this client interceptor has already been prepared, i.e.
void | prepare() Ensures that an MBeanServerConnection is configured and attempts to detect a local connection if one is not supplied.
void | setAgentId(String agentId) Set the agent id of the MBeanServer to locate.
void | setBeanClassLoader(ClassLoader beanClassLoader) Callback that supplies the bean class loader to a bean instance.
void | setConnectOnStartup(boolean connectOnStartup) Set whether or not the proxy should connect to the MBeanServer at creation time ("true") or the first time it is invoked ("false").
void | setEnvironment(Map<String,?> environment) Specify the environment for the JMX connector.
void | setManagementInterface(Class managementInterface) Set the management interface of the target MBean, exposing bean property setters and getters for MBean attributes and conventional Java methods for MBean operations.
void | setObjectName(Object objectName) Set the ObjectName of the MBean which calls are routed to, as ObjectName instance or as String.
void | setRefreshOnConnectFailure(boolean refreshOnConnectFailure) Set whether to refresh the MBeanServer connection on connect failure.
void | setServer(MBeanServerConnection server) Set the MBeanServerConnection used to connect to the MBean which all invocations are routed to.
void | setServiceUrl(String url) Set the service URL of the remote MBeanServer.
void | setUseStrictCasing(boolean useStrictCasing) Set whether to use strict casing for attributes.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

MBeanClientInterceptor

public MBeanClientInterceptor()
Method Detail

setServer

public void setServer(MBeanServerConnection server)
Set the MBeanServerConnection used to connect to the MBean which all invocations are routed to.

setServiceUrl

public void setServiceUrl(String url)
                   throws MalformedURLException
Set the service URL of the remote MBeanServer.

Throws:
MalformedURLException

setEnvironment

public void setEnvironment(Map<String,?> environment)
Specify the environment for the JMX connector.

See Also:
JMXConnectorFactory.connect(javax.management.remote.JMXServiceURL, java.util.Map)

getEnvironment

public Map<String,?> getEnvironment()
Allow Map access to the environment to be set for the connector, with the option to add or override specific entries.

Useful for specifying entries directly, for example via "environment[myKey]". This is particularly useful for adding or overriding entries in child bean definitions.

setAgentId

public void setAgentId(String agentId)
Set the agent id of the MBeanServer to locate.

Default is none. If specified, this will result in an attempt being made to locate the attendant MBeanServer, unless the "serviceUrl" property has been set.

See Also:

Specifying the empty String indicates the platform MBeanServer.

setConnectOnStartup

public void setConnectOnStartup(boolean connectOnStartup)
Set whether or not the proxy should connect to the MBeanServer at creation time ("true") or the first time it is invoked ("false"). Default is "true".

setRefreshOnConnectFailure

public void setRefreshOnConnectFailure(boolean refreshOnConnectFailure)
Set whether to refresh the MBeanServer connection on connect failure. Default is "false".

Can be turned on to allow for hot restart of the JMX server, automatically reconnecting and retrying in case of an IOException.

setObjectName

public void setObjectName(Object objectName)
                   throws MalformedObjectNameException
Set the ObjectName of the MBean which calls are routed to, as ObjectName instance or as String.

Throws:
MalformedObjectNameException

setUseStrictCasing

public void setUseStrictCasing(boolean useStrictCasing)
Set whether to use strict casing for attributes. Enabled by default.

When using strict casing, a JavaBean property with a getter such as getFoo() translates to an attribute called Foo. With strict casing disabled, getFoo() would translate to just foo.

setManagementInterface

public void setManagementInterface(Class managementInterface)
Set the management interface of the target MBean, exposing bean property setters and getters for MBean attributes and conventional Java methods for MBean operations.

getManagementInterface

protected final Class getManagementInterface()
Return the management interface of the target MBean, or null if none specified.

setBeanClassLoader

public void setBeanClassLoader(ClassLoader beanClassLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
beanClassLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

afterPropertiesSet

public void afterPropertiesSet()
Prepares the MBeanServerConnection if the "connectOnStartup" is turned on (which it is by default).

Specified by:
afterPropertiesSet in interface InitializingBean

prepare

public void prepare()
Ensures that an MBeanServerConnection is configured and attempts to detect a local connection if one is not supplied.

isPrepared

protected boolean isPrepared()
Return whether this client interceptor has already been prepared, i.e. has already looked up the server and cached all metadata.

invoke

public Object invoke(MethodInvocation invocation)
              throws Throwable
Route the invocation to the configured managed resource..

Specified by:
invoke in interface MethodInterceptor
Parameters:
invocation - the MethodInvocation to re-route
Returns:
the value returned as a result of the re-routed invocation
Throws:
Throwable - an invocation error propagated to the user
See Also:
doInvoke(org.aopalliance.intercept.MethodInvocation), handleConnectFailure(org.aopalliance.intercept.MethodInvocation, java.lang.Exception)

handleConnectFailure

protected Object handleConnectFailure(MethodInvocation invocation,
                                      Exception ex)
                               throws Throwable
Refresh the connection and retry the MBean invocation if possible.

If not configured to refresh on connect failure, this method simply rethrows the original exception.

Parameters:
invocation - the invocation that failed
ex - the exception raised on remote invocation
Returns:
the result value of the new invocation, if succeeded
Throws:
Throwable - an exception raised by the new invocation, if it failed as well
See Also:
setRefreshOnConnectFailure(boolean), doInvoke(org.aopalliance.intercept.MethodInvocation)

doInvoke

protected Object doInvoke(MethodInvocation invocation)
                   throws Throwable
Route the invocation to the configured managed resource. Correctly routes JavaBean property access to MBeanServerConnection.get/setAttribute and method invocation to MBeanServerConnection.invoke.

Parameters:
invocation - the MethodInvocation to re-route
Returns:
the value returned as a result of the re-routed invocation
Throws:
Throwable - an invocation error propagated to the user

convertResultValueIfNecessary

protected Object convertResultValueIfNecessary(Object result,
                                               MethodParameter parameter)
Convert the given result object (from attribute access or operation invocation) to the specified target class for returning from the proxy method.

Parameters:
result - the result object as returned by the MBeanServer
targetClass - the result type of the proxy method that's been invoked
Returns:
the converted result object, or the passed-in object if no conversion is necessary

destroy

public void destroy()
Description copied from interface: DisposableBean
Invoked by a BeanFactory on destruction of a singleton.

Specified by:
destroy in interface DisposableBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MBeanProxyFactoryBean

org.springframework.jmx.access
Class MBeanProxyFactoryBean

java.lang.Object
    extended by  org.springframework.jmx.access.MBeanClientInterceptor
        extended by  org.springframework.jmx.access.MBeanProxyFactoryBean
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, BeanClassLoaderAware, DisposableBean, FactoryBean<Object>, InitializingBean
public class MBeanProxyFactoryBean
extends MBeanClientInterceptor
implements FactoryBean<Object>, BeanClassLoaderAware, InitializingBean

Creates a proxy to a managed resource running either locally or remotely. The "proxyInterface" property defines the interface that the generated proxy is supposed to implement. This interface should define methods and properties that correspond to operations and attributes in the management interface of the resource you wish to proxy.

There is no need for the managed resource to implement the proxy interface, although you may find it convenient to do. It is not required that every operation and attribute in the management interface is matched by a corresponding property or method in the proxy interface.

Attempting to invoke or access any method or property on the proxy interface that does not correspond to the management interface will lead to an InvalidInvocationException.

Since:
1.2
Author:
Rob Harrop, Juergen Hoeller
See Also:
MBeanClientInterceptor, InvalidInvocationException

Field Summary
Fields inherited from class org.springframework.jmx.access.MBeanClientInterceptor
logger
Constructor Summary
MBeanProxyFactoryBean()
Method Summary
 void afterPropertiesSet()
Checks that the proxyInterface has been specified and then generates the proxy for the target MBean.
 Object getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<?> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setBeanClassLoader(ClassLoader classLoader)
Callback that supplies the bean class loader to a bean instance.
 void setProxyInterface(Class proxyInterface)
Set the interface that the generated proxy will implement.
Methods inherited from class org.springframework.jmx.access.MBeanClientInterceptor
convertResultValueIfNecessary, destroy, doInvoke, getEnvironment, getManagementInterface, handleConnectFailure, invoke, isPrepared, prepare, setAgentId, setConnectOnStartup, setEnvironment, setManagementInterface, setObjectName, setRefreshOnConnectFailure, setServer, setServiceUrl, setUseStrictCasing
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MBeanProxyFactoryBean

public MBeanProxyFactoryBean()
Method Detail

setProxyInterface

public void setProxyInterface(Class proxyInterface)
Set the interface that the generated proxy will implement.

This will usually be a management interface that matches the target MBean, exposing bean property setters and getters for MBean attributes and conventional Java methods for MBean operations.

See Also:
MBeanClientInterceptor.setObjectName(java.lang.Object)

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Overrides:
setBeanClassLoader in class MBeanClientInterceptor
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

afterPropertiesSet

public void afterPropertiesSet()
                        throws MBeanServerNotFoundException,
                               MBeanInfoRetrievalException
Checks that the proxyInterface has been specified and then generates the proxy for the target MBean.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class MBeanClientInterceptor
Throws:
MBeanServerNotFoundException
MBeanInfoRetrievalException

getObject

public Object getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<Object>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<?> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<Object>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<Object>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NotificationListenerRegistrar

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jmx.access
Class NotificationListenerRegistrar

java.lang.Object
    extended by  org.springframework.jmx.support.NotificationListenerHolder
        extended by  org.springframework.jmx.access.NotificationListenerRegistrar
All Implemented Interfaces:
DisposableBean, InitializingBean
public class NotificationListenerRegistrar
extends NotificationListenerHolder
implements InitializingBean, DisposableBean

Registrar object that associates a specific NotificationListener with one or more MBeans in an MBeanServer (typically via a MBeanServerConnection).

Since:
2.5.2
Author:
Juergen Hoeller
See Also:
setServer(javax.management.MBeanServerConnection),
NotificationListenerHolder.setMappedObjectNames(java.lang.Object[]),
NotificationListenerHolder.setNotificationListener(javax.management.NotificationListener)

Field Summary
protected  Log logger
Logger available to subclasses
Fields inherited from class org.springframework.jmx.support.NotificationListenerHolder
mappedObjectNames
Constructor Summary
NotificationListenerRegistrar()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
void | destroy() Unregisters the specified NotificationListener.
Map<String,?> | getEnvironment() Allow Map access to the environment to be set for the connector, with the option to add or override specific entries.
void | prepare() Registers the specified NotificationListener.
void | setAgentId(String agentId) Set the agent id of the MBeanServer to locate.
void | setEnvironment(Map<String,?> environment) Specify the environment for the JMX connector.
void | setServer(MBeanServerConnection server) Set the MBeanServerConnection used to connect to the MBean which all invocations are routed to.
void | setServiceUrl(String url) Set the service URL of the remote MBeanServer.
Methods inherited from class org.springframework.jmx.support.NotificationListenerHolder
equals, getHandback, getNotificationFilter, getNotificationListener, getResolvedObjectNames, hashCode, setHandback, setMappedObjectName, setMappedObjectNames, setNotificationFilter, setNotificationListener
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

NotificationListenerRegistrar

public NotificationListenerRegistrar()
Method Detail

setServer

public void setServer(MBeanServerConnection server)
Set the MBeanServerConnection used to connect to the MBean which all invocations are routed to.

setEnvironment

public void setEnvironment(Map<String,?> environment)
Specify the environment for the JMX connector.

See Also:
JMXConnectorFactory.connect(javax.management.remote.JMXServiceURL, java.util.Map)

getEnvironment

public Map<String,?> getEnvironment()
Allow Map access to the environment to be set for the connector, with the option to add or override specific entries.

Useful for specifying entries directly, for example via "environment[myKey]". This is particularly useful for adding or overriding entries in child bean definitions.

setServiceUrl

public void setServiceUrl(String url)
                   throws MalformedURLException
Set the service URL of the remote MBeanServer.

Throws:
MalformedURLException

setAgentId

public void setAgentId(String agentId)
Set the agent id of the MBeanServer to locate.

Default is none. If specified, this will result in an attempt being made to locate the attendant MBeanServer, unless the "serviceUrl" property has been set.

See Also:

Specifying the empty String indicates the platform MBeanServer.

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

prepare

public void prepare()
Registers the specified NotificationListener.

Ensures that an MBeanServerConnection is configured and attempts to detect a local connection if one is not supplied.

destroy

public void destroy()
Unregisters the specified NotificationListener.

Specified by:
destroy in interface DisposableBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


InvalidInvocationException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jmx.access
Class InvalidInvocationException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.management.JMRuntimeException
                    extended by  org.springframework.jmx.access.InvalidInvocationException
All Implemented Interfaces:
Serializable
public class InvalidInvocationException
extends JMRuntimeException

Thrown when trying to invoke an operation on a proxy that is not exposed by the proxied MBean resource's management interface.

Since:
1.2
Author:
Rob Harrop, Juergen Hoeller
See Also:
MBeanClientInterceptor, Serialized Form

Constructor Summary
InvalidInvocationException(String msg)
Create a new InvalidInvocationException with the supplied error message.
Method Summary
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

InvalidInvocationException

public InvalidInvocationException(String msg)
Create a new InvalidInvocationException with the supplied error message.

Parameters:
msg - the detail message
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


InvocationFailureException

org.springframework.jmx.access
Class InvocationFailureException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.jmx.JmxException
                        extended by  org.springframework.jmx.access.InvocationFailureException
All Implemented Interfaces:
Serializable
public class InvocationFailureException
extends JmxException

Thrown when an invocation on an MBean resource failed with an exception (either a reflection exception or an exception thrown by the target method itself).

Since:
1.2
Author:
Juergen Hoeller
See Also:
MBeanClientInterceptor, Serialized Form

Constructor Summary
InvocationFailureException(String msg)
Create a new InvocationFailureException with the supplied error message.
InvocationFailureException(String msg, Throwable cause)
Create a new InvocationFailureException with the specified error message and root cause.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

InvocationFailureException

public InvocationFailureException(String msg)
Create a new InvocationFailureException with the supplied error message.

Parameters:
msg - the detail message

InvocationFailureException

public InvocationFailureException(String msg,
                                  Throwable cause)
Create a new InvocationFailureException with the specified error message and root cause.

Parameters:
msg - the detail message
cause - the root cause
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MBeanConnectFailureException

org.springframework.jmx.access
Class MBeanConnectFailureException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.jmx.JmxException
                        extended by  org.springframework.jmx.access.MBeanConnectFailureException
All Implemented Interfaces:
Serializable
public class MBeanConnectFailureException
extends JmxException

Thrown when an invocation failed because of an I/O problem on the MBeanServerConnection.

Since:
2.5.6
Author:
Juergen Hoeller
See Also:
MBeanClientInterceptor, Serialized Form

Constructor Summary
MBeanConnectFailureException(String msg, Throwable cause)
Create a new MBeanConnectFailureException with the specified error message and root cause.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

MBeanConnectFailureException

public MBeanConnectFailureException(String msg,
                                    Throwable cause)
Create a new MBeanConnectFailureException with the specified error message and root cause.

Parameters:
msg - the detail message
cause - the root cause
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MBeanInfoRetrievalException

org.springframework.jmx.access
Class MBeanInfoRetrievalException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.jmx.JmxException
                        extended by  org.springframework.jmx.access.MBeanInfoRetrievalException
All Implemented Interfaces:
Serializable
public class MBeanInfoRetrievalException
extends JmxException

Thrown if an exception is encountered when trying to retrieve MBean metadata.

Since:
1.2
Author:
Rob Harrop, Juergen Hoeller
See Also:
MBeanClientInterceptor, MBeanProxyFactoryBean, Serialized Form

Constructor Summary
MBeanInfoRetrievalException(String msg)
Create a new MBeanInfoRetrievalException with the specified error message.
MBeanInfoRetrievalException(String msg, Throwable cause)
Create a new MBeanInfoRetrievalException with the specified error message and root cause.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

MBeanInfoRetrievalException

public MBeanInfoRetrievalException(String msg)
Create a new MBeanInfoRetrievalException with the specified error message.

Parameters:
msg - the detail message

MBeanInfoRetrievalException

public MBeanInfoRetrievalException(String msg,
                                   Throwable cause)
Create a new MBeanInfoRetrievalException with the specified error message and root cause.

Parameters:
msg - the detail message
cause - the root cause
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.jmx.export

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jmx.export

This package provides declarative creation and registration of Spring-managed beans as JMX MBeans.

See:
Description

Interface Summary
MBeanExporterListener | A listener that allows application code to be notified when an MBean is registered and unregistered via an MBeanExporter.
MBeanExportOperations | Interface that defines the set of MBean export operations that are intended to be accessed by application developers during application runtime.

Class Summary
MBeanExporter | JMX exporter that allows for exposing any Spring-managed bean to a JMX MBeanServer, without the need to define any JMX-specific information in the bean classes.
NotificationListenerBean | Helper class that aggregates a NotificationListener, a NotificationFilter, and an arbitrary handback object.
SpringModelMBean | Extension of the RequiredModelMBean class that ensures the thread context ClassLoader is switched for the managed resource's ClassLoader before any invocations occur.

Exception Summary
MBeanExportException | Exception thrown in case of failure when exporting an MBean.
UnableToRegisterMBeanException | Exception thrown when we are unable to register an MBean, for example because of a naming conflict.

Package org.springframework.jmx.export Description

This package provides declarative creation and registration of Spring-managed beans as JMX MBeans.


org.springframework.jmx.export Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jmx.export

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jmx.support.MBeanRegistrationSupport
      • org.springframework.jmx.export.MBeanExporter (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.jmx.export.MBeanExportOperations)
    • org.springframework.jmx.support.NotificationListenerHolder
      • org.springframework.jmx.export.NotificationListenerBean (implements org.springframework.beans.factory.InitializingBean)
    • javax.management.modelmbean.RequiredModelMBean (implements javax.management.MBeanRegistration, javax.management.modelmbean.ModelMBean, javax.management.NotificationEmitter)
      • org.springframework.jmx.export.SpringModelMBean
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.jmx.JmxException
              • org.springframework.jmx.export.MBeanExportException
                • org.springframework.jmx.export.UnableToRegisterMBeanException

Interface Hierarchy

  • org.springframework.jmx.export.MBeanExporterListener
  • org.springframework.jmx.export.MBeanExportOperations


MBeanExporterListener

org.springframework.jmx.export
Interface MBeanExporterListener

public interface MBeanExporterListener

A listener that allows application code to be notified when an MBean is registered and unregistered via an MBeanExporter.

Since:
1.2.2
Author:
Rob Harrop
See Also:
MBeanExporter.setListeners(org.springframework.jmx.export.MBeanExporterListener[])

Method Summary
void | mbeanRegistered(ObjectName objectName) Called by MBeanExporter after an MBean has been successfully registered with an MBeanServer.
void | mbeanUnregistered(ObjectName objectName) Called by MBeanExporter after an MBean has been successfully unregistered from an MBeanServer.

Method Detail

mbeanRegistered

void mbeanRegistered(ObjectName objectName)
Called by MBeanExporter after an MBean has been successfully registered with an MBeanServer.

Parameters:
objectName - the ObjectName of the registered MBean

mbeanUnregistered

void mbeanUnregistered(ObjectName objectName)
Called by MBeanExporter after an MBean has been successfully unregistered from an MBeanServer.

Parameters:
objectName - the ObjectName of the unregistered MBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MBeanExportOperations

org.springframework.jmx.export
Interface MBeanExportOperations

All Known Implementing Classes:
AnnotationMBeanExporter, MBeanExporter
public interface MBeanExportOperations

Interface that defines the set of MBean export operations that are intended to be accessed by application developers during application runtime.

This interface should be used to export application resources to JMX using Spring's management interface generation capabilties and, optionally, it's ObjectName generation capabilities.

Since:
2.0
Author:
Rob Harrop
See Also:
MBeanExporter

Method Summary
ObjectName | registerManagedResource(Object managedResource) Register the supplied resource with JMX.
void | registerManagedResource(Object managedResource, ObjectName objectName) Register the supplied resource with JMX.
void | unregisterManagedResource(ObjectName objectName) Remove the specified MBean from the underlying MBeanServer registry.

Method Detail

registerManagedResource

ObjectName registerManagedResource(Object managedResource)
                                   throws MBeanExportException
Register the supplied resource with JMX. If the resource is not a valid MBean already, Spring will generate a management interface for it. The exact interface generated will depend on the implementation and its configuration. This call also generates an ObjectName for the managed resource and returns this to the caller.

Parameters:
managedResource - the resource to expose via JMX
Returns:
the ObjectName under which the resource was exposed
Throws:
MBeanExportException - if Spring is unable to generate an ObjectName or register the MBean

registerManagedResource

void registerManagedResource(Object managedResource,
                             ObjectName objectName)
                             throws MBeanExportException
Register the supplied resource with JMX. If the resource is not a valid MBean already, Spring will generate a management interface for it. The exact interface generated will depend on the implementation and its configuration.

Parameters:
managedResource - the resource to expose via JMX
objectName - the ObjectName under which to expose the resource
Throws:
MBeanExportException - if Spring is unable to register the MBean

unregisterManagedResource

void unregisterManagedResource(ObjectName objectName)
Remove the specified MBean from the underlying MBeanServer registry.

Parameters:
objectName - the ObjectName of the resource to remove
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MBeanExporter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jmx.export
Class MBeanExporter

java.lang.Object
    extended by  org.springframework.jmx.support.MBeanRegistrationSupport
        extended by  org.springframework.jmx.export.MBeanExporter
All Implemented Interfaces:
BeanClassLoaderAware, BeanFactoryAware, DisposableBean, InitializingBean, MBeanExportOperations
Direct Known Subclasses:
AnnotationMBeanExporter
public class MBeanExporter
extends MBeanRegistrationSupport
implements MBeanExportOperations, BeanClassLoaderAware, BeanFactoryAware, InitializingBean, DisposableBean

JMX exporter that allows for exposing any Spring-managed bean to a JMX MBeanServer, without the need to define any JMX-specific information in the bean classes.

If a bean implements one of the JMX management interfaces, MBeanExporter can simply register the MBean with the server through its autodetection process.

If a bean does not implement one of the JMX management interfaces, MBeanExporter will create the management information using the supplied MBeanInfoAssembler.

A list of MBeanExporterListeners can be registered via the listeners property, allowing application code to be notified of MBean registration and unregistration events.

This exporter is compatible with JMX 1.2 on Java 5 and above. As of Spring 2.5, it also autodetects and exports Java 6 MXBeans.

Since:
1.2
Author:
Rob Harrop, Juergen Hoeller, Rick Evans, Mark Fisher
See Also:
setBeans(java.util.Map), setAutodetect(boolean), setAssembler(org.springframework.jmx.export.assembler.MBeanInfoAssembler), setListeners(org.springframework.jmx.export.MBeanExporterListener[]), MBeanInfoAssembler, MBeanExporterListener

Field Summary
static int | AUTODETECT_ALL Autodetection mode indicating that all autodetection mechanisms should be used.
static int | AUTODETECT_ASSEMBLER Autodetection mode indicating that only the MBeanInfoAssembler should be able to autodetect beans.
static int | AUTODETECT_MBEAN Autodetection mode indicating that only valid MBeans should be autodetected.
static int | AUTODETECT_NONE Autodetection mode indicating that no autodetection should be used.
Fields inherited from class org.springframework.jmx.support.MBeanRegistrationSupport
logger, registeredBeans, REGISTRATION_FAIL_ON_EXISTING, REGISTRATION_IGNORE_EXISTING, REGISTRATION_REPLACE_EXISTING, server
Constructor Summary
MBeanExporter()
Method Summary
protected DynamicMBean | adaptMBeanIfPossible(Object bean) Build an adapted MBean for the given bean instance, if possible.
void | afterPropertiesSet() Start bean registration automatically when deployed in an ApplicationContext.
protected ModelMBean | createAndConfigureMBean(Object managedResource, String beanKey) Creates an MBean that is configured with the appropriate management interface for the supplied managed resource.
protected ModelMBean | createModelMBean() Create an instance of a class that implements ModelMBean.
void | destroy() Unregisters all beans that this exported has exposed via JMX when the enclosing ApplicationContext is destroyed.
protected ObjectName | getObjectName(Object bean, String beanKey) Retrieve the ObjectName for a bean.
protected boolean | isBeanDefinitionLazyInit(ListableBeanFactory beanFactory, String beanName) Return whether the specified bean definition should be considered as lazy-init.
protected boolean | isMBean(Class beanClass) Determine whether the given bean class qualifies as an MBean as-is.
protected void | onRegister(ObjectName objectName) Called when an MBean is registered.
protected void | onUnregister(ObjectName objectName) Called when an MBean is unregistered.
protected ObjectName | registerBeanNameOrInstance(Object mapValue, String beanKey) Registers an individual bean with the MBeanServer.
protected void | registerBeans() Registers the defined beans with the MBeanServer.
ObjectName | registerManagedResource(Object managedResource) Register the supplied resource with JMX.
void | registerManagedResource(Object managedResource, ObjectName objectName) Register the supplied resource with JMX.
void | setAllowEagerInit(boolean allowEagerInit) Specify whether to allow eager initialization of candidate beans when autodetecting MBeans in the Spring application context.
void | setAssembler(MBeanInfoAssembler assembler) Set the implementation of the MBeanInfoAssembler interface to use for this exporter.
void | setAutodetect(boolean autodetect) Set whether to autodetect MBeans in the bean factory that this exporter runs in.
void | setAutodetectMode(int autodetectMode) Set the autodetection mode to use.
void | setAutodetectModeName(String constantName) Set the autodetection mode to use by name.
void | setBeanClassLoader(ClassLoader classLoader) Callback that supplies the bean class loader to a bean instance.
void | setBeanFactory(BeanFactory beanFactory) This callback is only required for resolution of bean names in the "beans" Map and for autodetection of MBeans (in the latter case, a ListableBeanFactory is required).
void | setBeans(Map<String,Object> beans) Supply a Map of beans to be registered with the JMX MBeanServer.
void | setEnsureUniqueRuntimeObjectNames(boolean ensureUniqueRuntimeObjectNames) Indicates whether Spring should ensure that ObjectNames generated by the configured ObjectNamingStrategy for runtime-registered MBeans (registerManagedResource(java.lang.Object)) should get modified: to ensure uniqueness for every instance of a managed Class.
void | setExcludedBeans(String[] excludedBeans) Set the list of names for beans that should be excluded from autodetection.
void | setExposeManagedResourceClassLoader(boolean exposeManagedResourceClassLoader) Indicates whether or not the managed resource should be exposed on the thread context ClassLoader before allowing any invocations on the MBean to occur.
void | setListeners(MBeanExporterListener[] listeners) Set the MBeanExporterListeners that should be notified of MBean registration and unregistration events.
void | setNamingStrategy(ObjectNamingStrategy namingStrategy) Set the implementation of the ObjectNamingStrategy interface to use for this exporter.
void | setNotificationListenerMappings(Map<?,? extends NotificationListener> listeners) Set the NotificationListeners to register with the MBeanServer.
void | setNotificationListeners(NotificationListenerBean[] notificationListeners) Set the NotificationListenerBeans containing the NotificationListeners that will be registered with the MBeanServer.
void | unregisterManagedResource(ObjectName objectName) Remove the specified MBean from the underlying MBeanServer registry.
Methods inherited from class org.springframework.jmx.support.MBeanRegistrationSupport
doRegister, doUnregister, getRegisteredObjectNames, getServer, onRegister, setRegistrationBehavior, setRegistrationBehaviorName, setServer, unregisterBeans
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

AUTODETECT_NONE

public static final int AUTODETECT_NONE
Autodetection mode indicating that no autodetection should be used.

See Also:
Constant Field Values

AUTODETECT_MBEAN

public static final int AUTODETECT_MBEAN
Autodetection mode indicating that only valid MBeans should be autodetected.

See Also:
Constant Field Values

AUTODETECT_ASSEMBLER

public static final int AUTODETECT_ASSEMBLER
Autodetection mode indicating that only the MBeanInfoAssembler should be able to autodetect beans.

See Also:
Constant Field Values

AUTODETECT_ALL

public static final int AUTODETECT_ALL
Autodetection mode indicating that all autodetection mechanisms should be used.

See Also:
Constant Field Values
Constructor Detail

MBeanExporter

public MBeanExporter()
Method Detail

setBeans

public void setBeans(Map<String,Object> beans)
Supply a Map of beans to be registered with the JMX MBeanServer.

The String keys are the basis for the creation of JMX object names. By default, a JMX ObjectName will be created straight from the given key. This can be customized through specifying a custom NamingStrategy.

Both bean instances and bean names are allowed as values. Bean instances are typically linked in through bean references. Bean names will be resolved as beans in the current factory, respecting lazy-init markers (that is, not triggering initialization of such beans).

Parameters:
beans - Map with JMX names as keys and bean instances or bean names as values
See Also:
setNamingStrategy(org.springframework.jmx.export.naming.ObjectNamingStrategy), KeyNamingStrategy, ObjectName.ObjectName(String)

setAutodetect

public void setAutodetect(boolean autodetect)
Set whether to autodetect MBeans in the bean factory that this exporter runs in. Will also ask an AutodetectCapableMBeanInfoAssembler if available.

This feature is turned off by default. Explicitly specify true here to enable autodetection.

See Also:
setAssembler(org.springframework.jmx.export.assembler.MBeanInfoAssembler), AutodetectCapableMBeanInfoAssembler, isMBean(java.lang.Class)

setAutodetectMode

public void setAutodetectMode(int autodetectMode)
Set the autodetection mode to use.

Throws:
IllegalArgumentException - if the supplied value is not one of the AUTODETECT_ constants
See Also:
setAutodetectModeName(String), AUTODETECT_ALL, AUTODETECT_ASSEMBLER, AUTODETECT_MBEAN, AUTODETECT_NONE

setAutodetectModeName

public void setAutodetectModeName(String constantName)
Set the autodetection mode to use by name.

Throws:
IllegalArgumentException - if the supplied value is not resolvable to one of the AUTODETECT_ constants or is null
See Also:
setAutodetectMode(int), AUTODETECT_ALL, AUTODETECT_ASSEMBLER, AUTODETECT_MBEAN, AUTODETECT_NONE

setAllowEagerInit

public void setAllowEagerInit(boolean allowEagerInit)
Specify whether to allow eager initialization of candidate beans when autodetecting MBeans in the Spring application context.

Default is "false", respecting lazy-init flags on bean definitions. Switch this to "true" in order to search lazy-init beans as well, including FactoryBean-produced objects that haven't been initialized yet.

setAssembler

public void setAssembler(MBeanInfoAssembler assembler)
Set the implementation of the MBeanInfoAssembler interface to use for this exporter. Default is a SimpleReflectiveMBeanInfoAssembler.

The passed-in assembler can optionally implement the AutodetectCapableMBeanInfoAssembler interface, which enables it to participate in the exporter's MBean autodetection process.

See Also:
SimpleReflectiveMBeanInfoAssembler, AutodetectCapableMBeanInfoAssembler, MetadataMBeanInfoAssembler, setAutodetect(boolean)

setNamingStrategy

public void setNamingStrategy(ObjectNamingStrategy namingStrategy)
Set the implementation of the ObjectNamingStrategy interface to use for this exporter. Default is a KeyNamingStrategy.

See Also:
KeyNamingStrategy, MetadataNamingStrategy

setListeners

public void setListeners(MBeanExporterListener[] listeners)
Set the MBeanExporterListeners that should be notified of MBean registration and unregistration events.

See Also:
MBeanExporterListener

setExcludedBeans

public void setExcludedBeans(String[] excludedBeans)
Set the list of names for beans that should be excluded from autodetection.

setEnsureUniqueRuntimeObjectNames

public void setEnsureUniqueRuntimeObjectNames(boolean ensureUniqueRuntimeObjectNames)
Indicates whether Spring should ensure that ObjectNames generated by the configured ObjectNamingStrategy for runtime-registered MBeans (registerManagedResource(java.lang.Object)) should get modified: to ensure uniqueness for every instance of a managed Class.

The default value is true.

See Also:
registerManagedResource(java.lang.Object), JmxUtils.appendIdentityToObjectName(javax.management.ObjectName, Object)

setExposeManagedResourceClassLoader

public void setExposeManagedResourceClassLoader(boolean exposeManagedResourceClassLoader)
Indicates whether or not the managed resource should be exposed on the thread context ClassLoader before allowing any invocations on the MBean to occur.

The default value is true, exposing a SpringModelMBean which performs thread context ClassLoader management. Switch this flag off to expose a standard JMX RequiredModelMBean.

setNotificationListeners

public void setNotificationListeners(NotificationListenerBean[] notificationListeners)
Set the NotificationListenerBeans containing the NotificationListeners that will be registered with the MBeanServer.

See Also:
setNotificationListenerMappings(java.util.Map), NotificationListenerBean

setNotificationListenerMappings

public void setNotificationListenerMappings(Map<?,? extends NotificationListener> listeners)
Set the NotificationListeners to register with the MBeanServer.

The key of each entry in the Map is a String representation of the ObjectName or the bean name of the MBean the listener should be registered for. Specifying an asterisk (*) for a key will cause the listener to be associated with all MBeans registered by this class at startup time.

The value of each entry is the NotificationListener to register. For more advanced options such as registering NotificationFilters and handback objects see setNotificationListeners(NotificationListenerBean[]).

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
This callback is only required for resolution of bean names in the "beans" Map and for autodetection of MBeans (in the latter case, a ListableBeanFactory is required).

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
setBeans(java.util.Map), setAutodetect(boolean)

afterPropertiesSet

public void afterPropertiesSet()
Start bean registration automatically when deployed in an ApplicationContext.

Specified by:
afterPropertiesSet in interface InitializingBean
See Also:
registerBeans()

destroy

public void destroy()
Unregisters all beans that this exported has exposed via JMX when the enclosing ApplicationContext is destroyed.

Specified by:
destroy in interface DisposableBean

registerManagedResource

public ObjectName registerManagedResource(Object managedResource)
                                   throws MBeanExportException
Description copied from interface: MBeanExportOperations
Register the supplied resource with JMX. If the resource is not a valid MBean already, Spring will generate a management interface for it. The exact interface generated will depend on the implementation and its configuration. This call also generates an ObjectName for the managed resource and returns this to the caller.

Specified by:
registerManagedResource in interface MBeanExportOperations
Parameters:
managedResource - the resource to expose via JMX
Returns:
the ObjectName under which the resource was exposed
Throws:
MBeanExportException - if Spring is unable to generate an ObjectName or register the MBean

registerManagedResource

public void registerManagedResource(Object managedResource,
                                    ObjectName objectName)
                             throws MBeanExportException
Description copied from interface: MBeanExportOperations
Register the supplied resource with JMX. If the resource is not a valid MBean already, Spring will generate a management interface for it. The exact interface generated will depend on the implementation and its configuration.

Specified by:
registerManagedResource in interface MBeanExportOperations
Parameters:
managedResource - the resource to expose via JMX
objectName - the ObjectName under which to expose the resource
Throws:
MBeanExportException - if Spring is unable to register the MBean

unregisterManagedResource

public void unregisterManagedResource(ObjectName objectName)
Description copied from interface: MBeanExportOperations
Remove the specified MBean from the underlying MBeanServer registry.

Specified by:
unregisterManagedResource in interface MBeanExportOperations
Parameters:
objectName - the ObjectName of the resource to remove

registerBeans

protected void registerBeans()
Registers the defined beans with the MBeanServer.

Each bean is exposed to the MBeanServer via a ModelMBean. The actual implemetation of the ModelMBean interface used depends on the implementation of the ModelMBeanProvider interface that is configured. By default the RequiredModelMBean class that is supplied with all JMX implementations is used.

The management interface produced for each bean is dependent on the MBeanInfoAssembler implementation being used. The ObjectName given to each bean is dependent on the implementation of the ObjectNamingStrategy interface being used.

isBeanDefinitionLazyInit

protected boolean isBeanDefinitionLazyInit(ListableBeanFactory beanFactory,
                                           String beanName)
Return whether the specified bean definition should be considered as lazy-init.

Parameters:
beanFactory - the bean factory that is supposed to contain the bean definition
beanName - the name of the bean to check
See Also:
ConfigurableListableBeanFactory.getBeanDefinition(java.lang.String), BeanDefinition.isLazyInit()

registerBeanNameOrInstance

protected ObjectName registerBeanNameOrInstance(Object mapValue,
                                                String beanKey)
                                         throws MBeanExportException
Registers an individual bean with the MBeanServer.

This method is responsible for deciding how a bean should be exposed to the MBeanServer. Specifically, if the supplied mapValue is the name of a bean that is configured for lazy initialization, then a proxy to the resource is registered with the MBeanServer so that the the lazy load behavior is honored. If the bean is already an MBean then it will be registered directly with the MBeanServer without any intervention. For all other beans or bean names, the resource itself is registered with the MBeanServer directly.

Parameters:
mapValue - the value configured for this bean in the beans map; may be either the String name of a bean, or the bean itself
beanKey - the key associated with this bean in the beans map
Returns:
the ObjectName under which the resource was registered
Throws:
MBeanExportException - if the export failed
See Also:
setBeans(java.util.Map),
registerBeanInstance(java.lang.Object, java.lang.String),
registerLazyInit(java.lang.String, java.lang.String)

getObjectName

protected ObjectName getObjectName(Object bean,
                                   String beanKey)
                            throws MalformedObjectNameException
Retrieve the ObjectName for a bean.

If the bean implements the SelfNaming interface, then the ObjectName will be retrieved using SelfNaming.getObjectName(). Otherwise, the configured ObjectNamingStrategy is used.

Parameters:
bean - the name of the bean in the BeanFactory
beanKey - the key associated with the bean in the beans map
Returns:
the ObjectName for the supplied bean
Throws:
MalformedObjectNameException - if the retrieved ObjectName is malformed

isMBean

protected boolean isMBean(Class beanClass)
Determine whether the given bean class qualifies as an MBean as-is.

The default implementation delegates to JmxUtils.isMBean(java.lang.Class), which checks for DynamicMBean classes as well as classes with corresponding "*MBean" interface (Standard MBeans) or corresponding "*MXBean" interface (Java 6 MXBeans).

Parameters:
beanClass - the bean class to analyze
Returns:
whether the class qualifies as an MBean
See Also:
JmxUtils.isMBean(Class)

adaptMBeanIfPossible

protected DynamicMBean adaptMBeanIfPossible(Object bean)
                                     throws JMException
Build an adapted MBean for the given bean instance, if possible.

The default implementation builds a JMX 1.2 StandardMBean for the target's MBean/MXBean interface in case of an AOP proxy, delegating the interface's management operations to the proxy.

Parameters:
bean - the original bean instance
Returns:
the adapted MBean, or null if not possible
Throws:
JMException

createAndConfigureMBean

protected ModelMBean createAndConfigureMBean(Object managedResource,
                                             String beanKey)
                                      throws MBeanExportException
Creates an MBean that is configured with the appropriate management interface for the supplied managed resource.

Parameters:
managedResource - the resource that is to be exported as an MBean
beanKey - the key associated with the managed bean
Throws:
MBeanExportException
See Also:
createModelMBean(), getMBeanInfo(Object, String)

createModelMBean

protected ModelMBean createModelMBean()
                               throws MBeanException
Create an instance of a class that implements ModelMBean.

This method is called to obtain a ModelMBean instance to use when registering a bean. This method is called once per bean during the registration phase and must return a new instance of ModelMBean

Returns:
a new instance of a class that implements ModelMBean
Throws:
MBeanException - if creation of the ModelMBean failed

onRegister

protected void onRegister(ObjectName objectName)
Called when an MBean is registered. Notifies all registered MBeanExporterListeners of the registration event.

Please note that if an MBeanExporterListener throws a (runtime) exception when notified, this will essentially interrupt the notification process and any remaining listeners that have yet to be notified will not (obviously) receive the MBeanExporterListener.mbeanRegistered(javax.management.ObjectName) callback.

Overrides:
onRegister in class MBeanRegistrationSupport
Parameters:
objectName - the ObjectName of the registered MBean

onUnregister

protected void onUnregister(ObjectName objectName)
Called when an MBean is unregistered. Notifies all registered MBeanExporterListeners of the unregistration event.

Please note that if an MBeanExporterListener throws a (runtime) exception when notified, this will essentially interrupt the notification process and any remaining listeners that have yet to be notified will not (obviously) receive the MBeanExporterListener.mbeanUnregistered(javax.management.ObjectName) callback.

Overrides:
onUnregister in class MBeanRegistrationSupport
Parameters:
objectName - the ObjectName of the unregistered MBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


NotificationListenerBean

org.springframework.jmx.export
Class NotificationListenerBean

java.lang.Object
    extended by  org.springframework.jmx.support.NotificationListenerHolder
        extended by  org.springframework.jmx.export.NotificationListenerBean
All Implemented Interfaces:
InitializingBean
public class NotificationListenerBean
extends NotificationListenerHolder
implements InitializingBean

Helper class that aggregates a NotificationListener, a NotificationFilter, and an arbitrary handback object.

Also provides support for associating the encapsulated NotificationListener with any number of MBeans from which it wishes to receive Notifications via the mappedObjectNames property.

Note: This class supports Spring bean names as "mappedObjectNames" as well, as alternative to specifying JMX object names. Note that only beans exported by the same MBeanExporter are supported for such bean names.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
See Also:
MBeanExporter.setNotificationListeners(org.springframework.jmx.export.NotificationListenerBean[])

Field Summary
Fields inherited from class org.springframework.jmx.support.NotificationListenerHolder
mappedObjectNames
Constructor Summary
NotificationListenerBean()
Create a new instance of the NotificationListenerBean class.
NotificationListenerBean(NotificationListener notificationListener)
Create a new instance of the NotificationListenerBean class.
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
Methods inherited from class org.springframework.jmx.support.NotificationListenerHolder
equals, getHandback, getNotificationFilter, getNotificationListener, getResolvedObjectNames, hashCode, setHandback, setMappedObjectName, setMappedObjectNames, setNotificationFilter, setNotificationListener
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

NotificationListenerBean

public NotificationListenerBean()
Create a new instance of the NotificationListenerBean class.

NotificationListenerBean

public NotificationListenerBean(NotificationListener notificationListener)
Create a new instance of the NotificationListenerBean class.

Parameters:
notificationListener - the encapsulated listener
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SpringModelMBean

org.springframework.jmx.export
Class SpringModelMBean

java.lang.Object
    extended by  javax.management.modelmbean.RequiredModelMBean
        extended by  org.springframework.jmx.export.SpringModelMBean
All Implemented Interfaces:
DynamicMBean, MBeanRegistration, ModelMBean, ModelMBeanNotificationBroadcaster, NotificationBroadcaster, NotificationEmitter, PersistentMBean
public class SpringModelMBean
extends RequiredModelMBean

Extension of the RequiredModelMBean class that ensures the thread context ClassLoader is switched for the managed resource's ClassLoader before any invocations occur.

Since:
2.0
Author:
Rob Harrop
See Also:
RequiredModelMBean

Constructor Summary
SpringModelMBean()
Construct a new SpringModelMBean instance with an empty ModelMBeanInfo.
SpringModelMBean(ModelMBeanInfo mbi)
Construct a new SpringModelMBean instance with the given ModelMBeanInfo.
Method Summary
Object | getAttribute(String attrName) Switches the context ClassLoader for the managed resources ClassLoader before allowing the invocation to occur.
AttributeList | getAttributes(String[] attrNames) Switches the context ClassLoader for the managed resources ClassLoader before allowing the invocation to occur.
Object | invoke(String opName, Object[] opArgs, String[] sig) Switches the context ClassLoader for the managed resources ClassLoader before allowing the invocation to occur.
void | setAttribute(Attribute attribute) Switches the context ClassLoader for the managed resources ClassLoader before allowing the invocation to occur.
AttributeList | setAttributes(AttributeList attributes) Switches the context ClassLoader for the managed resources ClassLoader before allowing the invocation to occur.
void | setManagedResource(Object managedResource, String managedResourceType) Sets managed resource to expose and stores its ClassLoader.
Methods inherited from class javax.management.modelmbean.RequiredModelMBean
addAttributeChangeNotificationListener, addNotificationListener, getClassLoaderRepository, getMBeanInfo, getNotificationInfo, load, postDeregister, postRegister, preDeregister, preRegister, removeAttributeChangeNotificationListener, removeNotificationListener, removeNotificationListener, sendAttributeChangeNotification, sendAttributeChangeNotification, sendNotification, sendNotification, setModelMBeanInfo, store
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SpringModelMBean

public SpringModelMBean()
                 throws MBeanException,
                        RuntimeOperationsException
Construct a new SpringModelMBean instance with an empty ModelMBeanInfo.

Throws:
MBeanException
RuntimeOperationsException
See Also:
RequiredModelMBean.RequiredModelMBean()

SpringModelMBean

public SpringModelMBean(ModelMBeanInfo mbi)
                 throws MBeanException,
                        RuntimeOperationsException
Construct a new SpringModelMBean instance with the given ModelMBeanInfo.

Throws:
MBeanException
RuntimeOperationsException
See Also:
RequiredModelMBean.RequiredModelMBean(ModelMBeanInfo)
Method Detail

setManagedResource

public void setManagedResource(Object managedResource,
                               String managedResourceType)
                        throws MBeanException,
                               InstanceNotFoundException,
                               InvalidTargetObjectTypeException
Sets managed resource to expose and stores its ClassLoader.

Specified by:
setManagedResource in interface ModelMBean
Overrides:
setManagedResource in class RequiredModelMBean
Throws:
MBeanException
InstanceNotFoundException
InvalidTargetObjectTypeException

invoke

public Object invoke(String opName,
                     Object[] opArgs,
                     String[] sig)
              throws MBeanException,
                     ReflectionException
Switches the context ClassLoader for the managed resources ClassLoader before allowing the invocation to occur.

Specified by:
invoke in interface DynamicMBean
Overrides:
invoke in class RequiredModelMBean
Throws:
MBeanException
ReflectionException
See Also:
DynamicMBean.invoke(java.lang.String, java.lang.Object[], java.lang.String[])

getAttribute

public Object getAttribute(String attrName)
                    throws AttributeNotFoundException,
                           MBeanException,
                           ReflectionException
Switches the context ClassLoader for the managed resources ClassLoader before allowing the invocation to occur.

Specified by:
getAttribute in interface DynamicMBean
Overrides:
getAttribute in class RequiredModelMBean
Throws:
AttributeNotFoundException
MBeanException
ReflectionException
See Also:
DynamicMBean.getAttribute(java.lang.String)

getAttributes

public AttributeList getAttributes(String[] attrNames)
Switches the context ClassLoader for the managed resources ClassLoader before allowing the invocation to occur.

Specified by:
getAttributes in interface DynamicMBean
Overrides:
getAttributes in class RequiredModelMBean
See Also:
DynamicMBean.getAttributes(java.lang.String[])

setAttribute

public void setAttribute(Attribute attribute)
                  throws AttributeNotFoundException,
                         InvalidAttributeValueException,
                         MBeanException,
                         ReflectionException
Switches the context ClassLoader for the managed resources ClassLoader before allowing the invocation to occur.

Specified by:
setAttribute in interface DynamicMBean
Overrides:
setAttribute in class RequiredModelMBean
Throws:
AttributeNotFoundException
InvalidAttributeValueException
MBeanException
ReflectionException
See Also:
DynamicMBean.setAttribute(javax.management.Attribute)

setAttributes

public AttributeList setAttributes(AttributeList attributes)
Switches the context ClassLoader for the managed resources ClassLoader before allowing the invocation to occur.

Specified by:
setAttributes in interface DynamicMBean
Overrides:
setAttributes in class RequiredModelMBean
See Also:
DynamicMBean.setAttributes(javax.management.AttributeList)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MBeanExportException

org.springframework.jmx.export
Class MBeanExportException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.jmx.JmxException
                        extended by  org.springframework.jmx.export.MBeanExportException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
UnableToRegisterMBeanException
public class MBeanExportException
extends JmxException

Exception thrown in case of failure when exporting an MBean.

Since:
2.0
Author:
Rob Harrop
See Also:
MBeanExportOperations, Serialized Form

Constructor Summary
MBeanExportException(String msg)
Create a new MBeanExportException with the specified error message.
MBeanExportException(String msg, Throwable cause)
Create a new MBeanExportException with the specified error message and root cause.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

MBeanExportException

public MBeanExportException(String msg)
Create a new MBeanExportException with the specified error message.

Parameters:
msg - the detail message

MBeanExportException

public MBeanExportException(String msg,
                            Throwable cause)
Create a new MBeanExportException with the specified error message and root cause.

Parameters:
msg - the detail message
cause - the root cause
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UnableToRegisterMBeanException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jmx.export
Class UnableToRegisterMBeanException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.jmx.JmxException
                        extended by  org.springframework.jmx.export.MBeanExportException
                            extended by  org.springframework.jmx.export.UnableToRegisterMBeanException
All Implemented Interfaces:
Serializable
public class UnableToRegisterMBeanException
extends MBeanExportException

Exception thrown when we are unable to register an MBean, for example because of a naming conflict.

Since:
2.0
Author:
Rob Harrop
See Also:
Serialized Form

Constructor Summary
UnableToRegisterMBeanException(String msg)
Create a new UnableToRegisterMBeanException with the specified error message.
UnableToRegisterMBeanException(String msg, Throwable cause)
Create a new UnableToRegisterMBeanException with the specified error message and root cause.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

UnableToRegisterMBeanException

public UnableToRegisterMBeanException(String msg)
Create a new UnableToRegisterMBeanException with the specified error message.

Parameters:
msg - the detail message

UnableToRegisterMBeanException

public UnableToRegisterMBeanException(String msg,
                                      Throwable cause)
Create a new UnableToRegisterMBeanException with the specified error message and root cause.

Parameters:
msg - the detail message
cause - the root caus
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jmx.export.annotation

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jmx.export.annotation

JDK 1.5+ annotations for MBean exposure.

See:
Description

Class Summary
AnnotationJmxAttributeSource | Implementation of the JmxAttributeSource interface that reads JDK 1.5+ annotations and exposes the corresponding attributes.
AnnotationMBeanExporter | Convenient subclass of Spring's standard MBeanExporter, activating Java 5 annotation usage for JMX exposure of Spring beans: ManagedResource, ManagedAttribute, ManagedOperation, etc.

Annotation Types Summary
ManagedAttribute | JDK 1.5+ method-level annotation that indicates to expose a given bean property as JMX attribute, corresponding to the ManagedAttribute attribute.
ManagedMetric | JDK 1.5+ method-level annotation that indicates to expose a given bean property as JMX attribute, with added Descriptor properties to indicate that it is a metric.
ManagedNotification | JDK 1.5+ method-level annotation that indicates a JMX notification emitted by a bean.
ManagedNotifications | JDK 1.5+ method-level annotation that indicates JMX notifications emitted by a bean, containing multiple ManagedNotifications
ManagedOperation | JDK 1.5+ method-level annotation that indicates to expose a given method as JMX operation, corresponding to the ManagedOperation attribute.
ManagedOperationParameter | JDK 1.5+ method-level annotation used to provide metadata about operation parameters, corresponding to a ManagedOperationParameter attribute.
ManagedOperationParameters | JDK 1.5+ method-level annotation used to provide metadata about operation parameters, corresponding to an array of ManagedOperationParameter attributes.
ManagedResource | JDK 1.5+ class-level annotation that indicates to register instances of a class with a JMX server, corresponding to the ManagedResource attribute.

Package org.springframework.jmx.export.annotation Description

JDK 1.5+ annotations for MBean exposure. Hooked into Spring's JMX export infrastructure via a special JmxAttributeSource implementation.


org.springframework.jmx.export.annotation Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jmx.export.annotation

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource (implements org.springframework.jmx.export.metadata.JmxAttributeSource)
    • org.springframework.jmx.support.MBeanRegistrationSupport
      • org.springframework.jmx.export.MBeanExporter (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.jmx.export.MBeanExportOperations)
        • org.springframework.jmx.export.annotation.AnnotationMBeanExporter

Annotation Type Hierarchy

  • org.springframework.jmx.export.annotation.ManagedResource (implements java.lang.annotation.Annotation)
  • org.springframework.jmx.export.annotation.ManagedOperationParameters (implements java.lang.annotation.Annotation)
  • org.springframework.jmx.export.annotation.ManagedOperationParameter (implements java.lang.annotation.Annotation)
  • org.springframework.jmx.export.annotation.ManagedOperation (implements java.lang.annotation.Annotation)
  • org.springframework.jmx.export.annotation.ManagedNotifications (implements java.lang.annotation.Annotation)
  • org.springframework.jmx.export.annotation.ManagedNotification (implements java.lang.annotation.Annotation)
  • org.springframework.jmx.export.annotation.ManagedMetric (implements java.lang.annotation.Annotation)
  • org.springframework.jmx.export.annotation.ManagedAttribute (implements java.lang.annotation.Annotation)


AnnotationJmxAttributeSource

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jmx.export.annotation
Class AnnotationJmxAttributeSource

java.lang.Object
    extended by  org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource
All Implemented Interfaces:
JmxAttributeSource
public class AnnotationJmxAttributeSource
extends Object
implements JmxAttributeSource

Implementation of the JmxAttributeSource interface that reads JDK 1.5+ annotations and exposes the corresponding attributes.

Since:
1.2
Author:
Rob Harrop, Juergen Hoeller, Jennifer Hickey
See Also:
ManagedResource, ManagedAttribute, ManagedOperation

Constructor Summary
AnnotationJmxAttributeSource()
Method Summary
ManagedAttribute | getManagedAttribute(Method method) Implementations should return an instance of ManagedAttribute if the supplied Method has the corresponding metadata.
ManagedMetric | getManagedMetric(Method method) Implementations should return an instance of ManagedMetric if the supplied Method has the corresponding metadata.
ManagedNotification[] | getManagedNotifications(Class<?> clazz) Implementations should return an array of ManagedNotifications if the supplied the Class has the corresponding metadata.
ManagedOperation | getManagedOperation(Method method) Implementations should return an instance of ManagedOperation if the supplied Method has the corresponding metadata.
ManagedOperationParameter[] | getManagedOperationParameters(Method method) Implementations should return an array of ManagedOperationParameter if the supplied Method has the corresponding metadata.
ManagedResource | getManagedResource(Class<?> beanClass) Implementations should return an instance of ManagedResource if the supplied Class has the appropriate metadata.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AnnotationJmxAttributeSource

public AnnotationJmxAttributeSource()
Method Detail

getManagedResource

public ManagedResource getManagedResource(Class<?> beanClass)
                                   throws InvalidMetadataException
Description copied from interface: JmxAttributeSource
Implementations should return an instance of ManagedResource if the supplied Class has the appropriate metadata. Otherwise should return null.

Specified by:
getManagedResource in interface JmxAttributeSource
Parameters:
beanClass - the class to read the attribute data from
Returns:
the attribute, or null if not found
Throws:
InvalidMetadataException - in case of invalid attributes

getManagedAttribute

public ManagedAttribute getManagedAttribute(Method method)
                                     throws InvalidMetadataException
Description copied from interface: JmxAttributeSource
Implementations should return an instance of ManagedAttribute if the supplied Method has the corresponding metadata. Otherwise should return null.

Specified by:
getManagedAttribute in interface JmxAttributeSource
Parameters:
method - the method to read the attribute data from
Returns:
the attribute, or null if not found
Throws:
InvalidMetadataException - in case of invalid attributes

getManagedMetric

public ManagedMetric getManagedMetric(Method method)
                               throws InvalidMetadataException
Description copied from interface: JmxAttributeSource
Implementations should return an instance of ManagedMetric if the supplied Method has the corresponding metadata. Otherwise should return null.

Specified by:
getManagedMetric in interface JmxAttributeSource
Parameters:
method - the method to read the attribute data from
Returns:
the metric, or null if not found
Throws:
InvalidMetadataException - in case of invalid attributes

getManagedOperation

public ManagedOperation getManagedOperation(Method method)
                                     throws InvalidMetadataException
Description copied from interface: JmxAttributeSource
Implementations should return an instance of ManagedOperation if the supplied Method has the corresponding metadata. Otherwise should return null.

Specified by:
getManagedOperation in interface JmxAttributeSource
Parameters:
method - the method to read the attribute data from
Returns:
the attribute, or null if not found
Throws:
InvalidMetadataException - in case of invalid attributes

getManagedOperationParameters

public ManagedOperationParameter[] getManagedOperationParameters(Method method)
                                                          throws InvalidMetadataException
Description copied from interface: JmxAttributeSource
Implementations should return an array of ManagedOperationParameter if the supplied Method has the corresponding metadata. Otherwise should return an empty array if no metadata is found.

Specified by:
getManagedOperationParameters in interface JmxAttributeSource
Parameters:
method - the Method to read the metadata from
Returns:
the parameter information.
Throws:
InvalidMetadataException - in the case of invalid attributes.

getManagedNotifications

public ManagedNotification[] getManagedNotifications(Class<?> clazz)
                                              throws InvalidMetadataException
Description copied from interface: JmxAttributeSource
Implementations should return an array of ManagedNotifications if the supplied the Class has the corresponding metadata. Otherwise should return an empty array.

Specified by:
getManagedNotifications in interface JmxAttributeSource
Parameters:
clazz - the Class to read the metadata from
Returns:
the notification information
Throws:
InvalidMetadataException - in the case of invalid metadata
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AnnotationMBeanExporter

org.springframework.jmx.export.annotation
Class AnnotationMBeanExporter

java.lang.Object
    extended by  org.springframework.jmx.support.MBeanRegistrationSupport
        extended by  org.springframework.jmx.export.MBeanExporter
            extended by  org.springframework.jmx.export.annotation.AnnotationMBeanExporter
All Implemented Interfaces:
BeanClassLoaderAware, BeanFactoryAware, DisposableBean, InitializingBean, MBeanExportOperations
public class AnnotationMBeanExporter
extends MBeanExporter

Convenient subclass of Spring's standard MBeanExporter, activating Java 5 annotation usage for JMX exposure of Spring beans: ManagedResource, ManagedAttribute, ManagedOperation, etc.

Sets a MetadataNamingStrategy and a MetadataMBeanInfoAssembler with an AnnotationJmxAttributeSource, and activates the MBeanExporter.AUTODETECT_ALL mode by default.

Since:
2.5
Author:
Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.jmx.export.MBeanExporter
AUTODETECT_ALL, AUTODETECT_ASSEMBLER, AUTODETECT_MBEAN, AUTODETECT_NONE
Fields inherited from class org.springframework.jmx.support.MBeanRegistrationSupport
logger, registeredBeans, REGISTRATION_FAIL_ON_EXISTING, REGISTRATION_IGNORE_EXISTING, REGISTRATION_REPLACE_EXISTING, server
Constructor Summary
AnnotationMBeanExporter()
Method Summary
 void setDefaultDomain(String defaultDomain)
Specify the default domain to be used for generating ObjectNames when no source-level metadata has been specified.
Methods inherited from class org.springframework.jmx.export.MBeanExporter
adaptMBeanIfPossible, afterPropertiesSet, createAndConfigureMBean, createModelMBean, destroy, getObjectName, isBeanDefinitionLazyInit, isMBean, onRegister, onUnregister, registerBeanNameOrInstance, registerBeans, registerManagedResource, registerManagedResource, setAllowEagerInit, setAssembler, setAutodetect, setAutodetectMode, setAutodetectModeName, setBeanClassLoader, setBeanFactory, setBeans, setEnsureUniqueRuntimeObjectNames, setExcludedBeans, setExposeManagedResourceClassLoader, setListeners, setNamingStrategy, setNotificationListenerMappings, setNotificationListeners, unregisterManagedResource
Methods inherited from class org.springframework.jmx.support.MBeanRegistrationSupport
doRegister, doUnregister, getRegisteredObjectNames, getServer, onRegister, setRegistrationBehavior, setRegistrationBehaviorName, setServer, unregisterBeans
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AnnotationMBeanExporter

public AnnotationMBeanExporter()
Method Detail

setDefaultDomain

public void setDefaultDomain(String defaultDomain)
Specify the default domain to be used for generating ObjectNames when no source-level metadata has been specified.

The default is to use the domain specified in the bean name (if the bean name follows the JMX ObjectName syntax); else, the package name of the managed bean class.

See Also:
MetadataNamingStrategy.setDefaultDomain(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ManagedAttribute

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.jmx.export.annotation
Annotation Type ManagedAttribute

@Target(value=METHOD)
@Retention(value=RUNTIME)
@Documented
public @interface ManagedAttribute

JDK 1.5+ method-level annotation that indicates to expose a given bean property as JMX attribute, corresponding to the ManagedAttribute attribute. Only valid when used on a JavaBean getter or setter.

Since:
1.2
Author:
Rob Harrop
See Also:
ManagedAttribute

Optional Element Summary
int | currencyTimeLimit
String | defaultValue
String | description
int | persistPeriod
String | persistPolicy

defaultValue

public abstract String defaultValue
Default:
""

description

public abstract String description
Default:
""

currencyTimeLimit

public abstract int currencyTimeLimit
Default:
-1

persistPolicy

public abstract String persistPolicy
Default:
""

persistPeriod

public abstract int persistPeriod
Default:
-1
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


ManagedMetric

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.jmx.export.annotation
Annotation Type ManagedMetric

@Target(value=METHOD)
@Retention(value=RUNTIME)
@Documented
public @interface ManagedMetric

JDK 1.5+ method-level annotation that indicates to expose a given bean property as JMX attribute, with added Descriptor properties to indicate that it is a metric. Only valid when used on a JavaBean getter.

Since:
3.0
Author:
Jennifer Hickey
See Also:
ManagedMetric

Optional Element Summary
String | category
int | currencyTimeLimit
String | description
String | displayName
MetricType | metricType
int | persistPeriod
String | persistPolicy
String | unit

category

public abstract String category
Default:
""

currencyTimeLimit

public abstract int currencyTimeLimit
Default:
-1

description

public abstract String description
Default:
""

displayName

public abstract String displayName
Default:
""

metricType

public abstract MetricType metricType
Default:
org.springframework.jmx.support.MetricType.GAUGE

persistPeriod

public abstract int persistPeriod
Default:
-1

persistPolicy

public abstract String persistPolicy
Default:
""

unit

public abstract String unit
Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


ManagedNotification

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.jmx.export.annotation
Annotation Type ManagedNotification

@Target(value=TYPE)
@Retention(value=RUNTIME)
@Inherited
@Documented
public @interface ManagedNotification

JDK 1.5+ method-level annotation that indicates a JMX notification emitted by a bean.

Since:
2.0
Author:
Rob Harrop
See Also:
ManagedNotification

Required Element Summary
String | name
String[] | notificationTypes
Optional Element Summary
 String description

Element Detail

name

public abstract String name

notificationTypes

public abstract String[] notificationTypes

description

public abstract String description
Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


ManagedNotifications

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.jmx.export.annotation
Annotation Type ManagedNotifications

@Target(value=TYPE)
@Retention(value=RUNTIME)
@Inherited
@Documented
public @interface ManagedNotifications

JDK 1.5+ method-level annotation that indicates JMX notifications emitted by a bean, containing multiple ManagedNotifications

Since:
2.0
Author:
Rob Harrop

Required Element Summary
 ManagedNotification[] value

Element Detail

value

public abstract ManagedNotification[] value
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


ManagedOperation

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.jmx.export.annotation
Annotation Type ManagedOperation

@Target(value=METHOD)
@Retention(value=RUNTIME)
@Documented
public @interface ManagedOperation

JDK 1.5+ method-level annotation that indicates to expose a given method as JMX operation, corresponding to the ManagedOperation attribute. Only valid when used on a method that is not a JavaBean getter or setter.

Since:
1.2
Author:
Rob Harrop
See Also:
ManagedOperation

Optional Element Summary
int | currencyTimeLimit
String | description

description

public abstract String description
Default:
""

currencyTimeLimit

public abstract int currencyTimeLimit
Default:
-1
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


ManagedOperationParameter

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.jmx.export.annotation
Annotation Type ManagedOperationParameter

public @interface ManagedOperationParameter

JDK 1.5+ method-level annotation used to provide metadata about operation parameters, corresponding to a ManagedOperationParameter attribute. Used as part of a ManagedOperationParameters annotation.

Since:
1.2
Author:
Rob Harrop
See Also:
ManagedOperationParameters.value(), ManagedOperationParameter

Required Element Summary
String | description
String | name

Element Detail

name

public abstract String name

description

public abstract String description
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


ManagedOperationParameters

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.jmx.export.annotation
Annotation Type ManagedOperationParameters

@Target(value=METHOD)
@Retention(value=RUNTIME)
@Documented
public @interface ManagedOperationParameters

JDK 1.5+ method-level annotation used to provide metadata about operation parameters, corresponding to an array of ManagedOperationParameter attributes.

Since:
1.2
Author:
Rob Harrop
See Also:
ManagedOperationParameter

Optional Element Summary
 ManagedOperationParameter[] value

value

public abstract ManagedOperationParameter[] value
Default:
{}
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


ManagedResource

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

org.springframework.jmx.export.annotation
Annotation Type ManagedResource

@Target(value=TYPE)
@Retention(value=RUNTIME)
@Inherited
@Documented
public @interface ManagedResource

JDK 1.5+ class-level annotation that indicates to register instances of a class with a JMX server, corresponding to the ManagedResource attribute.

Note: This annotation is marked as inherited, allowing for generic management-aware base classes. In such a scenario, it is recommended to not specify an object name value since this would lead to naming collisions in case of multiple subclasses getting registered.

Since:
1.2
Author:
Rob Harrop, Juergen Hoeller
See Also:
ManagedResource

Optional Element Summary
int | currencyTimeLimit
String | description
boolean | log
String | logFile
String | objectName
String | persistLocation
String | persistName
int | persistPeriod
String | persistPolicy
String | value The annotation value is equivalent to the objectName attribute, for simple default usage.

value

public abstract String value
The annotation value is equivalent to the objectName attribute, for simple default usage.

Default:
""

objectName

public abstract String objectName
Default:
""

description

public abstract String description
Default:
""

currencyTimeLimit

public abstract int currencyTimeLimit
Default:
-1

log

public abstract boolean log
Default:
false

logFile

public abstract String logFile
Default:
""

persistPolicy

public abstract String persistPolicy
Default:
""

persistPeriod

public abstract int persistPeriod
Default:
-1

persistName

public abstract String persistName
Default:
""

persistLocation

public abstract String persistLocation
Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT


org.springframework.jmx.export.assembler

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jmx.export.assembler

Provides a strategy for MBeanInfo assembly.

See:
Description

Interface Summary
AutodetectCapableMBeanInfoAssembler | Extends the MBeanInfoAssembler to add autodetection logic.
MBeanInfoAssembler | Interface to be implemented by all classes that can create management interface metadata for a managed resource.

Class Summary
AbstractConfigurableMBeanInfoAssembler | Base class for MBeanInfoAssemblers that support configurable JMX notification behavior.
AbstractMBeanInfoAssembler | Abstract implementation of the MBeanInfoAssembler interface that encapsulates the creation of a ModelMBeanInfo instance but delegates the creation of metadata to subclasses.
AbstractReflectiveMBeanInfoAssembler | Builds on the AbstractMBeanInfoAssembler superclass to add a basic algorithm for building metadata based on the reflective metadata of the MBean class.
InterfaceBasedMBeanInfoAssembler | Subclass of AbstractReflectiveMBeanInfoAssembler that allows for the management interface of a bean to be defined using arbitrary interfaces.
MetadataMBeanInfoAssembler | Implementation of the MBeanInfoAssembler interface that reads the management interface information from source level metadata.
MethodExclusionMBeanInfoAssembler | AbstractReflectiveMBeanInfoAssembler subclass that allows method names to be explicitly excluded as MBean operations and attributes.
MethodNameBasedMBeanInfoAssembler | Subclass of AbstractReflectiveMBeanInfoAssembler that allows to specify method names to be exposed as MBean operations and attributes.
SimpleReflectiveMBeanInfoAssembler | Simple subclass of AbstractReflectiveMBeanInfoAssembler that always votes yes for method and property inclusion, effectively exposing all public methods and properties as operations and attributes.

Package org.springframework.jmx.export.assembler Description

Provides a strategy for MBeanInfo assembly. Used by MBeanExporter to determine the attributes and operations to expose for Spring-managed beans.


org.springframework.jmx.export.assembler Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jmx.export.assembler

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler (implements org.springframework.jmx.export.assembler.MBeanInfoAssembler)
      • org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
        • org.springframework.jmx.export.assembler.AbstractConfigurableMBeanInfoAssembler
          • org.springframework.jmx.export.assembler.InterfaceBasedMBeanInfoAssembler (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.InitializingBean)
          • org.springframework.jmx.export.assembler.MethodExclusionMBeanInfoAssembler
          • org.springframework.jmx.export.assembler.MethodNameBasedMBeanInfoAssembler
          • org.springframework.jmx.export.assembler.SimpleReflectiveMBeanInfoAssembler
        • org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler (implements org.springframework.jmx.export.assembler.AutodetectCapableMBeanInfoAssembler, org.springframework.beans.factory.InitializingBean)

Interface Hierarchy

  • org.springframework.jmx.export.assembler.MBeanInfoAssembler
    • org.springframework.jmx.export.assembler.AutodetectCapableMBeanInfoAssembler


AutodetectCapableMBeanInfoAssembler

org.springframework.jmx.export.assembler
Interface AutodetectCapableMBeanInfoAssembler

All Superinterfaces:
MBeanInfoAssembler
All Known Implementing Classes:
MetadataMBeanInfoAssembler
public interface AutodetectCapableMBeanInfoAssembler
extends MBeanInfoAssembler

Extends the MBeanInfoAssembler to add autodetection logic. Implementations of this interface are given the opportunity by the MBeanExporter to include additional beans in the registration process.

The exact mechanism for deciding which beans to include is left to implementing classes.

Since:
1.2
Author:
Rob Harrop
See Also:
MBeanExporter

Method Summary
 boolean includeBean(Class beanClass, String beanName)
Indicate whether a particular bean should be included in the registration process, if it is not specified in the beans map of the MBeanExporter.
Methods inherited from interface org.springframework.jmx.export.assembler.MBeanInfoAssembler
getMBeanInfo

Method Detail

includeBean

boolean includeBean(Class beanClass,
                    String beanName)
Indicate whether a particular bean should be included in the registration process, if it is not specified in the beans map of the MBeanExporter.

Parameters:
beanClass - the class of the bean (might be a proxy class)
beanName - the name of the bean in the bean factory
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MBeanInfoAssembler

org.springframework.jmx.export.assembler
Interface MBeanInfoAssembler

All Known Subinterfaces:
AutodetectCapableMBeanInfoAssembler
All Known Implementing Classes:
AbstractConfigurableMBeanInfoAssembler, AbstractMBeanInfoAssembler, AbstractReflectiveMBeanInfoAssembler, InterfaceBasedMBeanInfoAssembler, MetadataMBeanInfoAssembler, MethodExclusionMBeanInfoAssembler, MethodNameBasedMBeanInfoAssembler, SimpleReflectiveMBeanInfoAssembler
public interface MBeanInfoAssembler

Interface to be implemented by all classes that can create management interface metadata for a managed resource.

Used by the MBeanExporter to generate the management interface for any bean that is not an MBean.

Since:
1.2
Author:
Rob Harrop, Juergen Hoeller
See Also:
MBeanExporter

Method Summary
 ModelMBeanInfo getMBeanInfo(Object managedBean, String beanKey)
Create the ModelMBeanInfo for the given managed resource.

Method Detail

getMBeanInfo

ModelMBeanInfo getMBeanInfo(Object managedBean,
                            String beanKey)
                            throws JMException
Create the ModelMBeanInfo for the given managed resource.

Parameters:
managedBean - the bean that will be exposed (might be an AOP proxy)
beanKey - the key associated with the managed bean
Returns:
the ModelMBeanInfo metadata object
Throws:
JMException - in case of errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractConfigurableMBeanInfoAssembler

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jmx.export.assembler
Class AbstractConfigurableMBeanInfoAssembler

java.lang.Object
    extended by  org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler
        extended by  org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
            extended by  org.springframework.jmx.export.assembler.AbstractConfigurableMBeanInfoAssembler
All Implemented Interfaces:
MBeanInfoAssembler
Direct Known Subclasses:
InterfaceBasedMBeanInfoAssembler, MethodExclusionMBeanInfoAssembler, MethodNameBasedMBeanInfoAssembler, SimpleReflectiveMBeanInfoAssembler
public abstract class AbstractConfigurableMBeanInfoAssembler
extends AbstractReflectiveMBeanInfoAssembler

Base class for MBeanInfoAssemblers that support configurable JMX notification behavior.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
ATTRIBUTE_OPERATION_VISIBILITY, FIELD_CLASS, FIELD_CURRENCY_TIME_LIMIT, FIELD_DEFAULT, FIELD_DISPLAY_NAME, FIELD_GET_METHOD, FIELD_LOG, FIELD_LOG_FILE, FIELD_METRIC_CATEGORY, FIELD_METRIC_TYPE, FIELD_PERSIST_LOCATION, FIELD_PERSIST_NAME, FIELD_PERSIST_PERIOD, FIELD_PERSIST_POLICY, FIELD_ROLE, FIELD_SET_METHOD, FIELD_UNITS, FIELD_VISIBILITY, ROLE_GETTER, ROLE_OPERATION, ROLE_SETTER
Constructor Summary
AbstractConfigurableMBeanInfoAssembler()
Method Summary
protected ModelMBeanNotificationInfo[] | getNotificationInfo(Object managedBean, String beanKey) Get the notification metadata for the MBean resource.
void | setNotificationInfoMappings(Map<String,Object> notificationInfoMappings)
void | setNotificationInfos(ManagedNotification[] notificationInfos)
Methods inherited from class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
applyCurrencyTimeLimit, applyDefaultCurrencyTimeLimit, createModelMBeanOperationInfo, getAttributeDescription, getAttributeInfo, getClassForDescriptor, getDefaultCurrencyTimeLimit, getOperationDescription, getOperationInfo, getOperationParameters, includeOperation, includeReadAttribute, includeWriteAttribute, isExposeClassDescriptor, isUseStrictCasing, populateAttributeDescriptor, populateMBeanDescriptor, populateOperationDescriptor, setDefaultCurrencyTimeLimit, setExposeClassDescriptor, setUseStrictCasing
Methods inherited from class org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler
checkManagedBean, getClassName, getClassToExpose, getClassToExpose, getConstructorInfo, getDescription, getMBeanInfo, getTargetClass
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractConfigurableMBeanInfoAssembler

public AbstractConfigurableMBeanInfoAssembler()
Method Detail

setNotificationInfos

public void setNotificationInfos(ManagedNotification[] notificationInfos)

setNotificationInfoMappings

public void setNotificationInfoMappings(Map<String,Object> notificationInfoMappings)

getNotificationInfo

protected ModelMBeanNotificationInfo[] getNotificationInfo(Object managedBean,
                                                           String beanKey)
Description copied from class: AbstractMBeanInfoAssembler
Get the notification metadata for the MBean resource. Subclasses should implement this method to return the appropriate metadata for all notifications that should be exposed in the management interface for the managed resource.

Default implementation returns an empty array of ModelMBeanNotificationInfo.

Overrides:
getNotificationInfo in class AbstractMBeanInfoAssembler
Parameters:
managedBean - the bean instance (might be an AOP proxy)
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
Returns:
the notification metadata
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractMBeanInfoAssembler

org.springframework.jmx.export.assembler
Class AbstractMBeanInfoAssembler

java.lang.Object
    extended by  org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler
All Implemented Interfaces:
MBeanInfoAssembler
Direct Known Subclasses:
AbstractReflectiveMBeanInfoAssembler
public abstract class AbstractMBeanInfoAssembler
extends Object
implements MBeanInfoAssembler

Abstract implementation of the MBeanInfoAssembler interface that encapsulates the creation of a ModelMBeanInfo instance but delegates the creation of metadata to subclasses.

This class offers two flavors of Class extraction from a managed bean instance: getTargetClass(java.lang.Object), extracting the target class behind any kind of AOP proxy, and getClassToExpose(java.lang.Object), returning the class or interface that will be searched for annotations and exposed to the JMX runtime.

Since:
1.2
Author:
Rob Harrop, Juergen Hoeller

Constructor Summary
AbstractMBeanInfoAssembler()
Method Summary
protected void | checkManagedBean(Object managedBean) Check the given bean instance, throwing an IllegalArgumentException if it is not eligible for exposure with this assembler.
protected abstract ModelMBeanAttributeInfo[] | getAttributeInfo(Object managedBean, String beanKey) Get the attribute metadata for the MBean resource.
protected String | getClassName(Object managedBean, String beanKey) Get the class name of the MBean resource.
protected Class | getClassToExpose(Class beanClass) Return the class or interface to expose for the given bean class.
protected Class | getClassToExpose(Object managedBean) Return the class or interface to expose for the given bean.
protected ModelMBeanConstructorInfo[] | getConstructorInfo(Object managedBean, String beanKey) Get the constructor metadata for the MBean resource.
protected String | getDescription(Object managedBean, String beanKey) Get the description of the MBean resource.
ModelMBeanInfo | getMBeanInfo(Object managedBean, String beanKey) Create an instance of the ModelMBeanInfoSupport class supplied with all JMX implementations and populates the metadata through calls to the subclass.
protected ModelMBeanNotificationInfo[] | getNotificationInfo(Object managedBean, String beanKey) Get the notification metadata for the MBean resource.
protected abstract ModelMBeanOperationInfo[] | getOperationInfo(Object managedBean, String beanKey) Get the operation metadata for the MBean resource.
protected Class | getTargetClass(Object managedBean) Return the actual bean class of the given bean instance.
protected void | populateMBeanDescriptor(Descriptor descriptor, Object managedBean, String beanKey) Called after the ModelMBeanInfo instance has been constructed but before it is passed to the MBeanExporter.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractMBeanInfoAssembler

public AbstractMBeanInfoAssembler()
Method Detail

getMBeanInfo

public ModelMBeanInfo getMBeanInfo(Object managedBean,
                                   String beanKey)
                            throws JMException
Create an instance of the ModelMBeanInfoSupport class supplied with all JMX implementations and populates the metadata through calls to the subclass.

Specified by:
getMBeanInfo in interface MBeanInfoAssembler
Parameters:
managedBean - the bean that will be exposed (might be an AOP proxy)
beanKey - the key associated with the managed bean
Returns:
the populated ModelMBeanInfo instance
Throws:
JMException - in case of errors
See Also:
getDescription(Object, String),
getAttributeInfo(Object, String),
getConstructorInfo(Object, String),
getOperationInfo(Object, String),
getNotificationInfo(Object, String),
populateMBeanDescriptor(javax.management.Descriptor, Object, String)

checkManagedBean

protected void checkManagedBean(Object managedBean)
                         throws IllegalArgumentException
Check the given bean instance, throwing an IllegalArgumentException if it is not eligible for exposure with this assembler.

Default implementation is empty, accepting every bean instance.

Parameters:
managedBean - the bean that will be exposed (might be an AOP proxy)
Throws:
IllegalArgumentException - the bean is not valid for exposure

getTargetClass

protected Class getTargetClass(Object managedBean)
Return the actual bean class of the given bean instance. This is the class exposed to description-style JMX properties.

Default implementation returns the target class for an AOP proxy, and the plain bean class else.

Parameters:
managedBean - the bean instance (might be an AOP proxy)
Returns:
the bean class to expose
See Also:
org.springframework.aop.framework.AopProxyUtils#getTargetClass

getClassToExpose

protected Class getClassToExpose(Object managedBean)
Return the class or interface to expose for the given bean. This is the class that will be searched for attributes and operations (for example, checked for annotations).

Parameters:
managedBean - the bean instance (might be an AOP proxy)
Returns:
the bean class to expose
See Also:
JmxUtils.getClassToExpose(Object)

getClassToExpose

protected Class getClassToExpose(Class beanClass)
Return the class or interface to expose for the given bean class. This is the class that will be searched for attributes and operations

Parameters:
beanClass - the bean class (might be an AOP proxy class)
Returns:
the bean class to expose
See Also:
JmxUtils.getClassToExpose(Class)

getClassName

protected String getClassName(Object managedBean,
                              String beanKey)
                       throws JMException
Get the class name of the MBean resource.

Default implementation returns a simple description for the MBean based on the class name.

Parameters:
managedBean - the bean instance (might be an AOP proxy)
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
Returns:
the MBean description
Throws:
JMException - in case of errors

getDescription

protected String getDescription(Object managedBean,
                                String beanKey)
                         throws JMException
Get the description of the MBean resource.

Default implementation returns a simple description for the MBean based on the class name.

Parameters:
managedBean - the bean instance (might be an AOP proxy)
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
Throws:
JMException - in case of errors

populateMBeanDescriptor

protected void populateMBeanDescriptor(Descriptor descriptor,
                                       Object managedBean,
                                       String beanKey)
                                throws JMException
Called after the ModelMBeanInfo instance has been constructed but before it is passed to the MBeanExporter.

Subclasses can implement this method to add additional descriptors to the MBean metadata. Default implementation is empty.

Parameters:
descriptor - the Descriptor for the MBean resource.
managedBean - the bean instance (might be an AOP proxy)
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
Throws:
JMException - in case of errors

getConstructorInfo

protected ModelMBeanConstructorInfo[] getConstructorInfo(Object managedBean,
                                                         String beanKey)
                                                  throws JMException
Get the constructor metadata for the MBean resource. Subclasses should implement this method to return the appropriate metadata for all constructors that should be exposed in the management interface for the managed resource.

Default implementation returns an empty array of ModelMBeanConstructorInfo.

Parameters:
managedBean - the bean instance (might be an AOP proxy)
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
Returns:
the constructor metadata
Throws:
JMException - in case of errors

getNotificationInfo

protected ModelMBeanNotificationInfo[] getNotificationInfo(Object managedBean,
                                                           String beanKey)
                                                    throws JMException
Get the notification metadata for the MBean resource. Subclasses should implement this method to return the appropriate metadata for all notifications that should be exposed in the management interface for the managed resource.

Default implementation returns an empty array of ModelMBeanNotificationInfo.

Parameters:
managedBean - the bean instance (might be an AOP proxy)
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
Returns:
the notification metadata
Throws:
JMException - in case of errors

getAttributeInfo

protected abstract ModelMBeanAttributeInfo[] getAttributeInfo(Object managedBean,
                                                              String beanKey)
                                                       throws JMException
Get the attribute metadata for the MBean resource. Subclasses should implement this method to return the appropriate metadata for all the attributes that should be exposed in the management interface for the managed resource.

Parameters:
managedBean - the bean instance (might be an AOP proxy)
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
Returns:
the attribute metadata
Throws:
JMException - in case of errors

getOperationInfo

protected abstract ModelMBeanOperationInfo[] getOperationInfo(Object managedBean,
                                                              String beanKey)
                                                       throws JMException
Get the operation metadata for the MBean resource. Subclasses should implement this method to return the appropriate metadata for all operations that should be exposed in the management interface for the managed resource.

Parameters:
managedBean - the bean instance (might be an AOP proxy)
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
Returns:
the operation metadata
Throws:
JMException - in case of errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractReflectiveMBeanInfoAssembler

org.springframework.jmx.export.assembler
Class AbstractReflectiveMBeanInfoAssembler

java.lang.Object
    extended by  org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler
        extended by  org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
All Implemented Interfaces:
MBeanInfoAssembler
Direct Known Subclasses:
AbstractConfigurableMBeanInfoAssembler, MetadataMBeanInfoAssembler
public abstract class AbstractReflectiveMBeanInfoAssembler
extends AbstractMBeanInfoAssembler

Builds on the AbstractMBeanInfoAssembler superclass to add a basic algorithm for building metadata based on the reflective metadata of the MBean class.

The logic for creating MBean metadata from the reflective metadata is contained in this class, but this class makes no decisions as to which methods and properties are to be exposed. Instead it gives subclasses a chance to 'vote' on each property or method through the includeXXX methods.

Subclasses are also given the opportunity to populate attribute and operation metadata with additional descriptors once the metadata is assembled through the populateXXXDescriptor methods.

Since:
1.2
Author:
Rob Harrop, Juergen Hoeller
See Also:
includeOperation(java.lang.reflect.Method, java.lang.String),
includeReadAttribute(java.lang.reflect.Method, java.lang.String),
includeWriteAttribute(java.lang.reflect.Method, java.lang.String),
populateAttributeDescriptor(javax.management.Descriptor, java.lang.reflect.Method, java.lang.reflect.Method, java.lang.String),
populateOperationDescriptor(javax.management.Descriptor, java.lang.reflect.Method, java.lang.String)

Field Summary
protected static int | ATTRIBUTE_OPERATION_VISIBILITY Lowest visibility, used for operations that correspond to accessors or mutators for attributes.
protected static String | FIELD_CLASS Constant identifier for the class field in a JMX Descriptor.
protected static String | FIELD_CURRENCY_TIME_LIMIT Constant identifier for the currency time limit field in a JMX Descriptor.
protected static String | FIELD_DEFAULT Constant identifier for the default field in a JMX Descriptor.
protected static String | FIELD_DISPLAY_NAME Constant identifier for the displayName field in a JMX Descriptor.
protected static String | FIELD_GET_METHOD Identifies a getter method in a JMX Descriptor.
protected static String | FIELD_LOG Constant identifier for the log field in a JMX Descriptor.
protected static String | FIELD_LOG_FILE Constant identifier for the logfile field in a JMX Descriptor.
protected static String | FIELD_METRIC_CATEGORY Constant identifier for the custom metricCategory field in a JMX Descriptor.
protected static String | FIELD_METRIC_TYPE Constant identifier for the metricType field in a JMX Descriptor.
protected static String | FIELD_PERSIST_LOCATION Constant identifier for the persistLocation field in a JMX Descriptor.
protected static String | FIELD_PERSIST_NAME Constant identifier for the persistName field in a JMX Descriptor.
protected static String | FIELD_PERSIST_PERIOD Constant identifier for the persistPeriod field in a JMX Descriptor.
protected static String | FIELD_PERSIST_POLICY Constant identifier for the persistPolicy field in a JMX Descriptor.
protected static String | FIELD_ROLE Constant identifier for the role field in a JMX Descriptor.
protected static String | FIELD_SET_METHOD Identifies a setter method in a JMX Descriptor.
protected static String | FIELD_UNITS Constant identifier for the units field in a JMX Descriptor.
protected static String | FIELD_VISIBILITY Constant identifier for the visibility field in a JMX Descriptor.
protected static String | ROLE_GETTER Constant identifier for the getter role field value in a JMX Descriptor.
protected static String | ROLE_OPERATION Identifies an operation (method) in a JMX Descriptor.
protected static String | ROLE_SETTER Constant identifier for the setter role field value in a JMX Descriptor.
Constructor Summary
AbstractReflectiveMBeanInfoAssembler()
Method Summary
protected void | applyCurrencyTimeLimit(Descriptor desc, int currencyTimeLimit) Apply the given JMX "currencyTimeLimit" value to the given descriptor.
protected void | applyDefaultCurrencyTimeLimit(Descriptor desc) Set the currencyTimeLimit field to the specified "defaultCurrencyTimeLimit", if any (by default none).
protected ModelMBeanOperationInfo | createModelMBeanOperationInfo(Method method, String name, String beanKey) Creates an instance of ModelMBeanOperationInfo for the given method.
protected String | getAttributeDescription(PropertyDescriptor propertyDescriptor, String beanKey) Get the description for a particular attribute.
protected ModelMBeanAttributeInfo[] | getAttributeInfo(Object managedBean, String beanKey) Iterate through all properties on the MBean class and gives subclasses the chance to vote on the inclusion of both the accessor and mutator.
protected Class | getClassForDescriptor(Object managedBean) Return the class to be used for the JMX descriptor field "class".
protected Integer | getDefaultCurrencyTimeLimit() Return default value for the JMX field "currencyTimeLimit", if any.
protected String | getOperationDescription(Method method, String beanKey) Get the description for a particular operation.
protected ModelMBeanOperationInfo[] | getOperationInfo(Object managedBean, String beanKey) Iterate through all methods on the MBean class and gives subclasses the chance to vote on their inclusion.
protected MBeanParameterInfo[] | getOperationParameters(Method method, String beanKey) Create parameter info for the given method.
protected abstract boolean | includeOperation(Method method, String beanKey) Allows subclasses to vote on the inclusion of a particular operation.
protected abstract boolean | includeReadAttribute(Method method, String beanKey) Allows subclasses to vote on the inclusion of a particular attribute accessor.
protected abstract boolean | includeWriteAttribute(Method method, String beanKey) Allows subclasses to vote on the inclusion of a particular attribute mutator.
protected boolean | isExposeClassDescriptor() Return whether to expose the JMX descriptor field "class" for managed operations.
protected boolean | isUseStrictCasing() Return whether strict casing for attributes is enabled.
protected void | populateAttributeDescriptor(Descriptor desc, Method getter, Method setter, String beanKey) Allows subclasses to add extra fields to the Descriptor for a particular attribute.
protected void | populateMBeanDescriptor(Descriptor descriptor, Object managedBean, String beanKey) Allows subclasses to add extra fields to the Descriptor for an MBean.
protected void | populateOperationDescriptor(Descriptor desc, Method method, String beanKey) Allows subclasses to add extra fields to the Descriptor for a particular operation.
void | setDefaultCurrencyTimeLimit(Integer defaultCurrencyTimeLimit) Set the default for the JMX field "currencyTimeLimit".
void | setExposeClassDescriptor(boolean exposeClassDescriptor) Set whether to expose the JMX descriptor field "class" for managed operations.
void | setUseStrictCasing(boolean useStrictCasing) Set whether to use strict casing for attributes.
Methods inherited from class org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler
checkManagedBean, getClassName, getClassToExpose, getClassToExpose, getConstructorInfo, getDescription, getMBeanInfo, getNotificationInfo, getTargetClass
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

FIELD_GET_METHOD

protected static final String FIELD_GET_METHOD
Identifies a getter method in a JMX Descriptor.

See Also:
Constant Field Values

FIELD_SET_METHOD

protected static final String FIELD_SET_METHOD
Identifies a setter method in a JMX Descriptor.

See Also:
Constant Field Values

FIELD_ROLE

protected static final String FIELD_ROLE
Constant identifier for the role field in a JMX Descriptor.

See Also:
Constant Field Values

ROLE_GETTER

protected static final String ROLE_GETTER
Constant identifier for the getter role field value in a JMX Descriptor.

See Also:
Constant Field Values

ROLE_SETTER

protected static final String ROLE_SETTER
Constant identifier for the setter role field value in a JMX Descriptor.

See Also:
Constant Field Values

ROLE_OPERATION

protected static final String ROLE_OPERATION
Identifies an operation (method) in a JMX Descriptor.

See Also:
Constant Field Values

FIELD_VISIBILITY

protected static final String FIELD_VISIBILITY
Constant identifier for the visibility field in a JMX Descriptor.

See Also:
Constant Field Values

ATTRIBUTE_OPERATION_VISIBILITY

protected static final int ATTRIBUTE_OPERATION_VISIBILITY
Lowest visibility, used for operations that correspond to accessors or mutators for attributes.

See Also:
FIELD_VISIBILITY, Constant Field Values

FIELD_CLASS

protected static final String FIELD_CLASS
Constant identifier for the class field in a JMX Descriptor.

See Also:
Constant Field Values

FIELD_LOG

protected static final String FIELD_LOG
Constant identifier for the log field in a JMX Descriptor.

See Also:
Constant Field Values

FIELD_LOG_FILE

protected static final String FIELD_LOG_FILE
Constant identifier for the logfile field in a JMX Descriptor.

See Also:
Constant Field Values

FIELD_CURRENCY_TIME_LIMIT

protected static final String FIELD_CURRENCY_TIME_LIMIT
Constant identifier for the currency time limit field in a JMX Descriptor.

See Also:
Constant Field Values

FIELD_DEFAULT

protected static final String FIELD_DEFAULT
Constant identifier for the default field in a JMX Descriptor.

See Also:
Constant Field Values

FIELD_PERSIST_POLICY

protected static final String FIELD_PERSIST_POLICY
Constant identifier for the persistPolicy field in a JMX Descriptor.

See Also:
Constant Field Values

FIELD_PERSIST_PERIOD

protected static final String FIELD_PERSIST_PERIOD
Constant identifier for the persistPeriod field in a JMX Descriptor.

See Also:
Constant Field Values

FIELD_PERSIST_LOCATION

protected static final String FIELD_PERSIST_LOCATION
Constant identifier for the persistLocation field in a JMX Descriptor.

See Also:
Constant Field Values

FIELD_PERSIST_NAME

protected static final String FIELD_PERSIST_NAME
Constant identifier for the persistName field in a JMX Descriptor.

See Also:
Constant Field Values

FIELD_DISPLAY_NAME

protected static final String FIELD_DISPLAY_NAME
Constant identifier for the displayName field in a JMX Descriptor.

See Also:
Constant Field Values

FIELD_UNITS

protected static final String FIELD_UNITS
Constant identifier for the units field in a JMX Descriptor.

See Also:
Constant Field Values

FIELD_METRIC_TYPE

protected static final String FIELD_METRIC_TYPE
Constant identifier for the metricType field in a JMX Descriptor.

See Also:
Constant Field Values

FIELD_METRIC_CATEGORY

protected static final String FIELD_METRIC_CATEGORY
Constant identifier for the custom metricCategory field in a JMX Descriptor.

See Also:
Constant Field Values
Constructor Detail

AbstractReflectiveMBeanInfoAssembler

public AbstractReflectiveMBeanInfoAssembler()
Method Detail

setDefaultCurrencyTimeLimit

public void setDefaultCurrencyTimeLimit(Integer defaultCurrencyTimeLimit)
Set the default for the JMX field "currencyTimeLimit". The default will usually indicate to never cache attribute values.

Default is none, not explicitly setting that field, as recommended by the JMX 1.2 specification. This should result in "never cache" behavior, always reading attribute values freshly (which corresponds to a "currencyTimeLimit" of -1 in JMX 1.2).

However, some JMX implementations (that do not follow the JMX 1.2 spec in that respect) might require an explicit value to be set here to get "never cache" behavior: for example, JBoss 3.2.x.

Note that the "currencyTimeLimit" value can also be specified on a managed attribute or operation. The default value will apply if not overridden with a "currencyTimeLimit" value >= 0 there: a metadata "currencyTimeLimit" value of -1 indicates to use the default; a value of 0 indicates to "always cache" and will be translated to Integer.MAX_VALUE; a positive value indicates the number of cache seconds.

See Also:
AbstractJmxAttribute.setCurrencyTimeLimit(int), applyCurrencyTimeLimit(javax.management.Descriptor, int)

getDefaultCurrencyTimeLimit

protected Integer getDefaultCurrencyTimeLimit()
Return default value for the JMX field "currencyTimeLimit", if any.

setUseStrictCasing

public void setUseStrictCasing(boolean useStrictCasing)
Set whether to use strict casing for attributes. Enabled by default.

When using strict casing, a JavaBean property with a getter such as getFoo() translates to an attribute called Foo. With strict casing disabled, getFoo() would translate to just foo.

isUseStrictCasing

protected boolean isUseStrictCasing()
Return whether strict casing for attributes is enabled.

setExposeClassDescriptor

public void setExposeClassDescriptor(boolean exposeClassDescriptor)
Set whether to expose the JMX descriptor field "class" for managed operations. Default is "false", letting the JMX implementation determine the actual class through reflection.

Set this property to true for JMX implementations that require the "class" field to be specified, for example WebLogic's. In that case, Spring will expose the target class name there, in case of a plain bean instance or a CGLIB proxy. When encountering a JDK dynamic proxy, the first interface implemented by the proxy will be specified.

WARNING: Review your proxy definitions when exposing a JDK dynamic proxy through JMX, in particular with this property turned to true: the specified interface list should start with your management interface in this case, with all other interfaces following. In general, consider exposing your target bean directly or a CGLIB proxy for it instead.

See Also:
getClassForDescriptor(Object)

isExposeClassDescriptor

protected boolean isExposeClassDescriptor()
Return whether to expose the JMX descriptor field "class" for managed operations.

getAttributeInfo

protected ModelMBeanAttributeInfo[] getAttributeInfo(Object managedBean,
                                                     String beanKey)
                                              throws JMException
Iterate through all properties on the MBean class and gives subclasses the chance to vote on the inclusion of both the accessor and mutator. If a particular accessor or mutator is voted for inclusion, the appropriate metadata is assembled and passed to the subclass for descriptor population.

Specified by:
getAttributeInfo in class AbstractMBeanInfoAssembler
Parameters:
managedBean - the bean instance (might be an AOP proxy)
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
Returns:
the attribute metadata
Throws:
JMException - in case of errors
See Also:
populateAttributeDescriptor(javax.management.Descriptor, java.lang.reflect.Method, java.lang.reflect.Method, java.lang.String)

getOperationInfo

protected ModelMBeanOperationInfo[] getOperationInfo(Object managedBean,
                                                     String beanKey)
Iterate through all methods on the MBean class and gives subclasses the chance to vote on their inclusion. If a particular method corresponds to the accessor or mutator of an attribute that is inclued in the managment interface, then the corresponding operation is exposed with the "role" descriptor field set to the appropriate value.

Specified by:
getOperationInfo in class AbstractMBeanInfoAssembler
Parameters:
managedBean - the bean instance (might be an AOP proxy)
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
Returns:
the operation metadata
See Also:
populateOperationDescriptor(javax.management.Descriptor, java.lang.reflect.Method, java.lang.String)

createModelMBeanOperationInfo

protected ModelMBeanOperationInfo createModelMBeanOperationInfo(Method method,
                                                                String name,
                                                                String beanKey)
Creates an instance of ModelMBeanOperationInfo for the given method. Populates the parameter info for the operation.

Parameters:
method - the Method to create a ModelMBeanOperationInfo for
name - the name for the operation info
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
Returns:
the ModelMBeanOperationInfo

getClassForDescriptor

protected Class getClassForDescriptor(Object managedBean)
Return the class to be used for the JMX descriptor field "class". Only applied when the "exposeClassDescriptor" property is "true".

Default implementation returns the first implemented interface for a JDK proxy, and the target class else.

Parameters:
managedBean - the bean instance (might be an AOP proxy)
Returns:
the class to expose in the descriptor field "class"
See Also:
setExposeClassDescriptor(boolean), AbstractMBeanInfoAssembler.getClassToExpose(Class), AopProxyUtils.proxiedUserInterfaces(Object)

includeReadAttribute

protected abstract boolean includeReadAttribute(Method method,
                                                String beanKey)
Allows subclasses to vote on the inclusion of a particular attribute accessor.

Parameters:
method - the accessor Method
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
Returns:
true if the accessor should be included in the management interface, otherwise false

includeWriteAttribute

protected abstract boolean includeWriteAttribute(Method method,
                                                 String beanKey)
Allows subclasses to vote on the inclusion of a particular attribute mutator.

Parameters:
method - the mutator Method.
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
Returns:
true if the mutator should be included in the management interface, otherwise false

includeOperation

protected abstract boolean includeOperation(Method method,
                                            String beanKey)
Allows subclasses to vote on the inclusion of a particular operation.

Parameters:
method - the operation method
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
Returns:
whether the operation should be included in the management interface

getAttributeDescription

protected String getAttributeDescription(PropertyDescriptor propertyDescriptor,
                                         String beanKey)
Get the description for a particular attribute.

Default implementation returns a description for the operation that is the name of corresponding Method.

Parameters:
propertyDescriptor - the PropertyDescriptor for the attribute
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
Returns:
the description for the attribute

getOperationDescription

protected String getOperationDescription(Method method,
                                         String beanKey)
Get the description for a particular operation.

Default implementation returns a description for the operation that is the name of corresponding Method.

Parameters:
method - the operation method
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
Returns:
the description for the operation

getOperationParameters

protected MBeanParameterInfo[] getOperationParameters(Method method,
                                                      String beanKey)
Create parameter info for the given method. Default implementation returns an empty arry of MBeanParameterInfo.

Parameters:
method - the Method to get the parameter information for
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
Returns:
the MBeanParameterInfo array

populateMBeanDescriptor

protected void populateMBeanDescriptor(Descriptor descriptor,
                                       Object managedBean,
                                       String beanKey)
Allows subclasses to add extra fields to the Descriptor for an MBean. Default implementation sets the currencyTimeLimit field to the specified "defaultCurrencyTimeLimit", if any (by default none).

Overrides:
populateMBeanDescriptor in class AbstractMBeanInfoAssembler
Parameters:
descriptor - the Descriptor for the MBean resource.
managedBean - the bean instance (might be an AOP proxy)
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
See Also:
setDefaultCurrencyTimeLimit(Integer), applyDefaultCurrencyTimeLimit(javax.management.Descriptor)

populateAttributeDescriptor

protected void populateAttributeDescriptor(Descriptor desc,
                                           Method getter,
                                           Method setter,
                                           String beanKey)
Allows subclasses to add extra fields to the Descriptor for a particular attribute. Default implementation sets the currencyTimeLimit field to the specified "defaultCurrencyTimeLimit", if any (by default none).

Parameters:
desc - the attribute descriptor
getter - the accessor method for the attribute
setter - the mutator method for the attribute
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
See Also:
setDefaultCurrencyTimeLimit(Integer), applyDefaultCurrencyTimeLimit(javax.management.Descriptor)

populateOperationDescriptor

protected void populateOperationDescriptor(Descriptor desc,
                                           Method method,
                                           String beanKey)
Allows subclasses to add extra fields to the Descriptor for a particular operation. Default implementation sets the currencyTimeLimit field to the specified "defaultCurrencyTimeLimit", if any (by default none).

Parameters:
desc - the operation descriptor
method - the method corresponding to the operation
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
See Also:
setDefaultCurrencyTimeLimit(Integer), applyDefaultCurrencyTimeLimit(javax.management.Descriptor)

applyDefaultCurrencyTimeLimit

protected final void applyDefaultCurrencyTimeLimit(Descriptor desc)
Set the currencyTimeLimit field to the specified "defaultCurrencyTimeLimit", if any (by default none).

Parameters:
desc - the JMX attribute or operation descriptor
See Also:
setDefaultCurrencyTimeLimit(Integer)

applyCurrencyTimeLimit

protected void applyCurrencyTimeLimit(Descriptor desc,
                                      int currencyTimeLimit)
Apply the given JMX "currencyTimeLimit" value to the given descriptor.

Default implementation sets a value >0 as-is (as number of cache seconds), turns a value of 0 into Integer.MAX_VALUE ("always cache") and sets the "defaultCurrencyTimeLimit" (if any, indicating "never cache") in case of a value <0. This follows the recommendation in the JMX 1.2 specification.

Parameters:
desc - the JMX attribute or operation descriptor
currencyTimeLimit - the "currencyTimeLimit" value to apply
See Also:
setDefaultCurrencyTimeLimit(Integer), applyDefaultCurrencyTimeLimit(javax.management.Descriptor)
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


InterfaceBasedMBeanInfoAssembler

org.springframework.jmx.export.assembler
Class InterfaceBasedMBeanInfoAssembler

java.lang.Object
    extended by  org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler
        extended by  org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
            extended by  org.springframework.jmx.export.assembler.AbstractConfigurableMBeanInfoAssembler
                extended by  org.springframework.jmx.export.assembler.InterfaceBasedMBeanInfoAssembler
All Implemented Interfaces:
BeanClassLoaderAware, InitializingBean, MBeanInfoAssembler
public class InterfaceBasedMBeanInfoAssembler
extends AbstractConfigurableMBeanInfoAssembler
implements BeanClassLoaderAware, InitializingBean

Subclass of AbstractReflectiveMBeanInfoAssembler that allows for the management interface of a bean to be defined using arbitrary interfaces. Any methods or properties that are defined in those interfaces are exposed as MBean operations and attributes.

By default, this class votes on the inclusion of each operation or attribute based on the interfaces implemented by the bean class. However, you can supply an array of interfaces via the managedInterfaces property that will be used instead. If you have multiple beans and you wish each bean to use a different set of interfaces, then you can map bean keys (that is the name used to pass the bean to the MBeanExporter) to a list of interface names using the interfaceMappings property.

If you specify values for both interfaceMappings and managedInterfaces, Spring will attempt to find interfaces in the mappings first. If no interfaces for the bean are found, it will use the interfaces defined by managedInterfaces.

Since:
1.2
Author:
Rob Harrop, Juergen Hoeller
See Also:
setManagedInterfaces(java.lang.Class[]), setInterfaceMappings(java.util.Properties), MethodNameBasedMBeanInfoAssembler, SimpleReflectiveMBeanInfoAssembler, MBeanExporter

Field Summary
Fields inherited from class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
ATTRIBUTE_OPERATION_VISIBILITY, FIELD_CLASS, FIELD_CURRENCY_TIME_LIMIT, FIELD_DEFAULT, FIELD_DISPLAY_NAME, FIELD_GET_METHOD, FIELD_LOG, FIELD_LOG_FILE, FIELD_METRIC_CATEGORY, FIELD_METRIC_TYPE, FIELD_PERSIST_LOCATION, FIELD_PERSIST_NAME, FIELD_PERSIST_PERIOD, FIELD_PERSIST_POLICY, FIELD_ROLE, FIELD_SET_METHOD, FIELD_UNITS, FIELD_VISIBILITY, ROLE_GETTER, ROLE_OPERATION, ROLE_SETTER
Constructor Summary
InterfaceBasedMBeanInfoAssembler()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected boolean | includeOperation(Method method, String beanKey) Check to see if the Method is declared in one of the configured interfaces and that it is public.
protected boolean | includeReadAttribute(Method method, String beanKey) Check to see if the Method is declared in one of the configured interfaces and that it is public.
protected boolean | includeWriteAttribute(Method method, String beanKey) Check to see if the Method is declared in one of the configured interfaces and that it is public.
void | setBeanClassLoader(ClassLoader beanClassLoader) Callback that supplies the bean class loader to a bean instance.
void | setInterfaceMappings(Properties mappings) Set the mappings of bean keys to a comma-separated list of interface names.
void | setManagedInterfaces(Class[] managedInterfaces) Set the array of interfaces to use for creating the management info.
Methods inherited from class org.springframework.jmx.export.assembler.AbstractConfigurableMBeanInfoAssembler
getNotificationInfo, setNotificationInfoMappings, setNotificationInfos
Methods inherited from class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
applyCurrencyTimeLimit, applyDefaultCurrencyTimeLimit, createModelMBeanOperationInfo, getAttributeDescription, getAttributeInfo, getClassForDescriptor, getDefaultCurrencyTimeLimit, getOperationDescription, getOperationInfo, getOperationParameters, isExposeClassDescriptor, isUseStrictCasing, populateAttributeDescriptor, populateMBeanDescriptor, populateOperationDescriptor, setDefaultCurrencyTimeLimit, setExposeClassDescriptor, setUseStrictCasing
Methods inherited from class org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler
checkManagedBean, getClassName, getClassToExpose, getClassToExpose, getConstructorInfo, getDescription, getMBeanInfo, getTargetClass
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

InterfaceBasedMBeanInfoAssembler

public InterfaceBasedMBeanInfoAssembler()
Method Detail

setManagedInterfaces

public void setManagedInterfaces(Class[] managedInterfaces)
Set the array of interfaces to use for creating the management info. These interfaces will be used for a bean if no entry corresponding to that bean is found in the interfaceMappings property.

Parameters:
managedInterfaces - an array of classes indicating the interfaces to use. Each entry MUST be an interface.
See Also:
setInterfaceMappings(java.util.Properties)

setInterfaceMappings

public void setInterfaceMappings(Properties mappings)
Set the mappings of bean keys to a comma-separated list of interface names.

The property key should match the bean key and the property value should match the list of interface names. When searching for interfaces for a bean, Spring will check these mappings first.

Parameters:
mappings - the mappins of bean keys to interface names

setBeanClassLoader

public void setBeanClassLoader(ClassLoader beanClassLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
beanClassLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

includeReadAttribute

protected boolean includeReadAttribute(Method method,
                                       String beanKey)
Check to see if the Method is declared in one of the configured interfaces and that it is public.

Specified by:
includeReadAttribute in class AbstractReflectiveMBeanInfoAssembler
Parameters:
method - the accessor Method.
beanKey - the key associated with the MBean in the beans Map.
Returns:
true if the Method is declared in one of the configured interfaces, otherwise false.

includeWriteAttribute

protected boolean includeWriteAttribute(Method method,
                                        String beanKey)
Check to see if the Method is declared in one of the configured interfaces and that it is public.

Specified by:
includeWriteAttribute in class AbstractReflectiveMBeanInfoAssembler
Parameters:
method - the mutator Method.
beanKey - the key associated with the MBean in the beans Map.
Returns:
true if the Method is declared in one of the configured interfaces, otherwise false.

includeOperation

protected boolean includeOperation(Method method,
                                   String beanKey)
Check to see if the Method is declared in one of the configured interfaces and that it is public.

Specified by:
includeOperation in class AbstractReflectiveMBeanInfoAssembler
Parameters:
method - the operation Method.
beanKey - the key associated with the MBean in the beans Map.
Returns:
true if the Method is declared in one of the configured interfaces, otherwise false.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MetadataMBeanInfoAssembler

org.springframework.jmx.export.assembler
Class MetadataMBeanInfoAssembler

java.lang.Object
    extended by  org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler
        extended by  org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
            extended by  org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler
All Implemented Interfaces:
InitializingBean, AutodetectCapableMBeanInfoAssembler, MBeanInfoAssembler
public class MetadataMBeanInfoAssembler
extends AbstractReflectiveMBeanInfoAssembler
implements AutodetectCapableMBeanInfoAssembler, InitializingBean

Implementation of the MBeanInfoAssembler interface that reads the management interface information from source level metadata.

Uses the JmxAttributeSource strategy interface, so that metadata can be read using any supported implementation. Out of the box, Spring provides an implementation based on JDK 1.5+ annotations, AnnotationJmxAttributeSource.

Since:
1.2
Author:
Rob Harrop, Juergen Hoeller, Jennifer Hickey
See Also:
setAttributeSource(org.springframework.jmx.export.metadata.JmxAttributeSource), AnnotationJmxAttributeSource

Field Summary
Fields inherited from class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
ATTRIBUTE_OPERATION_VISIBILITY, FIELD_CLASS, FIELD_CURRENCY_TIME_LIMIT, FIELD_DEFAULT, FIELD_DISPLAY_NAME, FIELD_GET_METHOD, FIELD_LOG, FIELD_LOG_FILE, FIELD_METRIC_CATEGORY, FIELD_METRIC_TYPE, FIELD_PERSIST_LOCATION, FIELD_PERSIST_NAME, FIELD_PERSIST_PERIOD, FIELD_PERSIST_POLICY, FIELD_ROLE, FIELD_SET_METHOD, FIELD_UNITS, FIELD_VISIBILITY, ROLE_GETTER, ROLE_OPERATION, ROLE_SETTER
Constructor Summary
MetadataMBeanInfoAssembler()
Create a new MetadataMBeanInfoAssembler which needs to be configured through the setAttributeSource(org.springframework.jmx.export.metadata.JmxAttributeSource) method.
MetadataMBeanInfoAssembler(JmxAttributeSource attributeSource)
Create a new MetadataMBeanInfoAssembler for the given JmxAttributeSource.
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected void | checkManagedBean(Object managedBean) Throws an IllegalArgumentException if it encounters a JDK dynamic proxy.
protected String | getAttributeDescription(PropertyDescriptor propertyDescriptor, String beanKey) Creates a description for the attribute corresponding to this property descriptor.
protected String | getDescription(Object managedBean, String beanKey) Reads managed resource description from the source level metadata.
protected ModelMBeanNotificationInfo[] | getNotificationInfo(Object managedBean, String beanKey) Reads the ManagedNotification metadata from the Class of the managed resource and generates and returns the corresponding ModelMBeanNotificationInfo metadata.
protected String | getOperationDescription(Method method, String beanKey) Retrieves the description for the supplied Method from the metadata.
protected MBeanParameterInfo[] | getOperationParameters(Method method, String beanKey) Reads MBeanParameterInfo from the ManagedOperationParameter attributes attached to a method.
boolean | includeBean(Class beanClass, String beanName) Used for autodetection of beans.
protected boolean | includeOperation(Method method, String beanKey) Votes on the inclusion of an operation.
protected boolean | includeReadAttribute(Method method, String beanKey) Vote on the inclusion of an attribute accessor.
protected boolean | includeWriteAttribute(Method method, String beanKey) Votes on the inclusion of an attribute mutator.
protected void | populateAttributeDescriptor(Descriptor desc, Method getter, Method setter, String beanKey) Adds descriptor fields from the ManagedAttribute attribute or the ManagedMetric attribute to the attribute descriptor.
protected void | populateMBeanDescriptor(Descriptor desc, Object managedBean, String beanKey) Adds descriptor fields from the ManagedResource attribute to the MBean descriptor.
protected void | populateOperationDescriptor(Descriptor desc, Method method, String beanKey) Adds descriptor fields from the ManagedAttribute attribute to the attribute descriptor.
void | setAttributeSource(JmxAttributeSource attributeSource) Set the JmxAttributeSource implementation to use for reading the metadata from the bean class.
Methods inherited from class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
applyCurrencyTimeLimit, applyDefaultCurrencyTimeLimit, createModelMBeanOperationInfo, getAttributeInfo, getClassForDescriptor, getDefaultCurrencyTimeLimit, getOperationInfo, isExposeClassDescriptor, isUseStrictCasing, setDefaultCurrencyTimeLimit, setExposeClassDescriptor, setUseStrictCasing
Methods inherited from class org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler
getClassName, getClassToExpose, getClassToExpose, getConstructorInfo, getMBeanInfo, getTargetClass
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.jmx.export.assembler.MBeanInfoAssembler
getMBeanInfo

Constructor Detail

MetadataMBeanInfoAssembler

public MetadataMBeanInfoAssembler()
Create a new MetadataMBeanInfoAssembler which needs to be configured through the setAttributeSource(org.springframework.jmx.export.metadata.JmxAttributeSource) method.

MetadataMBeanInfoAssembler

public MetadataMBeanInfoAssembler(JmxAttributeSource attributeSource)
Create a new MetadataMBeanInfoAssembler for the given JmxAttributeSource.

Parameters:
attributeSource - the JmxAttributeSource to use
Method Detail

setAttributeSource

public void setAttributeSource(JmxAttributeSource attributeSource)
Set the JmxAttributeSource implementation to use for reading the metadata from the bean class.

See Also:
AnnotationJmxAttributeSource

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

checkManagedBean

protected void checkManagedBean(Object managedBean)
                         throws IllegalArgumentException
Throws an IllegalArgumentException if it encounters a JDK dynamic proxy. Metadata can only be read from target classes and CGLIB proxies!

Overrides:
checkManagedBean in class AbstractMBeanInfoAssembler
Parameters:
managedBean - the bean that will be exposed (might be an AOP proxy)
Throws:
IllegalArgumentException - the bean is not valid for exposure

includeBean

public boolean includeBean(Class beanClass,
                           String beanName)
Used for autodetection of beans. Checks to see if the bean's class has a ManagedResource attribute. If so it will add it list of included beans.

Specified by:
includeBean in interface AutodetectCapableMBeanInfoAssembler
Parameters:
beanClass - the class of the bean
beanName - the name of the bean in the bean factory

includeReadAttribute

protected boolean includeReadAttribute(Method method,
                                       String beanKey)
Vote on the inclusion of an attribute accessor.

Specified by:
includeReadAttribute in class AbstractReflectiveMBeanInfoAssembler
Parameters:
method - the accessor method
beanKey - the key associated with the MBean in the beans map
Returns:
whether the method has the appropriate metadata

includeWriteAttribute

protected boolean includeWriteAttribute(Method method,
                                        String beanKey)
Votes on the inclusion of an attribute mutator.

Specified by:
includeWriteAttribute in class AbstractReflectiveMBeanInfoAssembler
Parameters:
method - the mutator method
beanKey - the key associated with the MBean in the beans map
Returns:
whether the method has the appropriate metadata

includeOperation

protected boolean includeOperation(Method method,
                                   String beanKey)
Votes on the inclusion of an operation.

Specified by:
includeOperation in class AbstractReflectiveMBeanInfoAssembler
Parameters:
method - the operation method
beanKey - the key associated with the MBean in the beans map
Returns:
whether the method has the appropriate metadata

getDescription

protected String getDescription(Object managedBean,
                                String beanKey)
Reads managed resource description from the source level metadata. Returns an empty String if no description can be found.

Overrides:
getDescription in class AbstractMBeanInfoAssembler
Parameters:
managedBean - the bean instance (might be an AOP proxy)
beanKey - the key associated with the MBean in the beans map of the MBeanExporter

getAttributeDescription

protected String getAttributeDescription(PropertyDescriptor propertyDescriptor,
                                         String beanKey)
Creates a description for the attribute corresponding to this property descriptor. Attempts to create the description using metadata from either the getter or setter attributes, otherwise uses the property name.

Overrides:
getAttributeDescription in class AbstractReflectiveMBeanInfoAssembler
Parameters:
propertyDescriptor - the PropertyDescriptor for the attribute
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
Returns:
the description for the attribute

getOperationDescription

protected String getOperationDescription(Method method,
                                         String beanKey)
Retrieves the description for the supplied Method from the metadata. Uses the method name is no description is present in the metadata.

Overrides:
getOperationDescription in class AbstractReflectiveMBeanInfoAssembler
Parameters:
method - the operation method
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
Returns:
the description for the operation

getOperationParameters

protected MBeanParameterInfo[] getOperationParameters(Method method,
                                                      String beanKey)
Reads MBeanParameterInfo from the ManagedOperationParameter attributes attached to a method. Returns an empty array of MBeanParameterInfo if no attributes are found.

Overrides:
getOperationParameters in class AbstractReflectiveMBeanInfoAssembler
Parameters:
method - the Method to get the parameter information for
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
Returns:
the MBeanParameterInfo array

getNotificationInfo

protected ModelMBeanNotificationInfo[] getNotificationInfo(Object managedBean,
                                                           String beanKey)
Reads the ManagedNotification metadata from the Class of the managed resource and generates and returns the corresponding ModelMBeanNotificationInfo metadata.

Overrides:
getNotificationInfo in class AbstractMBeanInfoAssembler
Parameters:
managedBean - the bean instance (might be an AOP proxy)
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
Returns:
the notification metadata

populateMBeanDescriptor

protected void populateMBeanDescriptor(Descriptor desc,
                                       Object managedBean,
                                       String beanKey)
Adds descriptor fields from the ManagedResource attribute to the MBean descriptor. Specifically, adds the currencyTimeLimit, persistPolicy, persistPeriod, persistLocation and persistName descriptor fields if they are present in the metadata.

Overrides:
populateMBeanDescriptor in class AbstractReflectiveMBeanInfoAssembler
Parameters:
desc - the Descriptor for the MBean resource.
managedBean - the bean instance (might be an AOP proxy)
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
See Also:
AbstractReflectiveMBeanInfoAssembler.setDefaultCurrencyTimeLimit(Integer), AbstractReflectiveMBeanInfoAssembler.applyDefaultCurrencyTimeLimit(javax.management.Descriptor)

populateAttributeDescriptor

protected void populateAttributeDescriptor(Descriptor desc,
                                           Method getter,
                                           Method setter,
                                           String beanKey)
Adds descriptor fields from the ManagedAttribute attribute or the ManagedMetric attribute to the attribute descriptor.

Overrides:
populateAttributeDescriptor in class AbstractReflectiveMBeanInfoAssembler
Parameters:
desc - the attribute descriptor
getter - the accessor method for the attribute
setter - the mutator method for the attribute
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
See Also:
AbstractReflectiveMBeanInfoAssembler.setDefaultCurrencyTimeLimit(Integer), AbstractReflectiveMBeanInfoAssembler.applyDefaultCurrencyTimeLimit(javax.management.Descriptor)

populateOperationDescriptor

protected void populateOperationDescriptor(Descriptor desc,
                                           Method method,
                                           String beanKey)
Adds descriptor fields from the ManagedAttribute attribute to the attribute descriptor. Specifically, adds the currencyTimeLimit descriptor field if it is present in the metadata.

Overrides:
populateOperationDescriptor in class AbstractReflectiveMBeanInfoAssembler
Parameters:
desc - the operation descriptor
method - the method corresponding to the operation
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
See Also:
AbstractReflectiveMBeanInfoAssembler.setDefaultCurrencyTimeLimit(Integer), AbstractReflectiveMBeanInfoAssembler.applyDefaultCurrencyTimeLimit(javax.management.Descriptor)
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


MethodExclusionMBeanInfoAssembler

org.springframework.jmx.export.assembler
Class MethodExclusionMBeanInfoAssembler

java.lang.Object
    extended by  org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler
        extended by  org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
            extended by  org.springframework.jmx.export.assembler.AbstractConfigurableMBeanInfoAssembler
                extended by  org.springframework.jmx.export.assembler.MethodExclusionMBeanInfoAssembler
All Implemented Interfaces:
MBeanInfoAssembler
public class MethodExclusionMBeanInfoAssembler
extends AbstractConfigurableMBeanInfoAssembler

AbstractReflectiveMBeanInfoAssembler subclass that allows method names to be explicitly excluded as MBean operations and attributes.

Any method not explicitly excluded from the management interface will be exposed to JMX. JavaBean getters and setters will automatically be exposed as JMX attributes.

You can supply an array of method names via the ignoredMethods property. If you have multiple beans and you wish each bean to use a different set of method names, then you can map bean keys (that is the name used to pass the bean to the MBeanExporter) to a list of method names using the ignoredMethodMappings property.

If you specify values for both ignoredMethodMappings and ignoredMethods, Spring will attempt to find method names in the mappings first. If no method names for the bean are found, it will use the method names defined by ignoredMethods.

Since:
1.2.5
Author:
Rob Harrop, Seth Ladd
See Also:
setIgnoredMethods(java.lang.String[]), setIgnoredMethodMappings(java.util.Properties), InterfaceBasedMBeanInfoAssembler, SimpleReflectiveMBeanInfoAssembler, MethodNameBasedMBeanInfoAssembler, MBeanExporter

Field Summary
Fields inherited from class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
ATTRIBUTE_OPERATION_VISIBILITY, FIELD_CLASS, FIELD_CURRENCY_TIME_LIMIT, FIELD_DEFAULT, FIELD_DISPLAY_NAME, FIELD_GET_METHOD, FIELD_LOG, FIELD_LOG_FILE, FIELD_METRIC_CATEGORY, FIELD_METRIC_TYPE, FIELD_PERSIST_LOCATION, FIELD_PERSIST_NAME, FIELD_PERSIST_PERIOD, FIELD_PERSIST_POLICY, FIELD_ROLE, FIELD_SET_METHOD, FIELD_UNITS, FIELD_VISIBILITY, ROLE_GETTER, ROLE_OPERATION, ROLE_SETTER
Constructor Summary
MethodExclusionMBeanInfoAssembler()
Method Summary
protected boolean | includeOperation(Method method, String beanKey) Allows subclasses to vote on the inclusion of a particular operation.
protected boolean | includeReadAttribute(Method method, String beanKey) Allows subclasses to vote on the inclusion of a particular attribute accessor.
protected boolean | includeWriteAttribute(Method method, String beanKey) Allows subclasses to vote on the inclusion of a particular attribute mutator.
protected boolean | isNotIgnored(Method method, String beanKey) Determine whether the given method is supposed to be included, that is, not configured as to be ignored.
void | setIgnoredMethodMappings(Properties mappings) Set the mappings of bean keys to a comma-separated list of method names.
void | setIgnoredMethods(String[] ignoredMethodNames) Set the array of method names to be ignored when creating the management info.
Methods inherited from class org.springframework.jmx.export.assembler.AbstractConfigurableMBeanInfoAssembler
getNotificationInfo, setNotificationInfoMappings, setNotificationInfos
Methods inherited from class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
applyCurrencyTimeLimit, applyDefaultCurrencyTimeLimit, createModelMBeanOperationInfo, getAttributeDescription, getAttributeInfo, getClassForDescriptor, getDefaultCurrencyTimeLimit, getOperationDescription, getOperationInfo, getOperationParameters, isExposeClassDescriptor, isUseStrictCasing, populateAttributeDescriptor, populateMBeanDescriptor, populateOperationDescriptor, setDefaultCurrencyTimeLimit, setExposeClassDescriptor, setUseStrictCasing
Methods inherited from class org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler
checkManagedBean, getClassName, getClassToExpose, getClassToExpose, getConstructorInfo, getDescription, getMBeanInfo, getTargetClass
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MethodExclusionMBeanInfoAssembler

public MethodExclusionMBeanInfoAssembler()
Method Detail

setIgnoredMethods

public void setIgnoredMethods(String[] ignoredMethodNames)
Set the array of method names to be ignored when creating the management info.

These method names will be used for a bean if no entry corresponding to that bean is found in the ignoredMethodsMappings property.

See Also:
setIgnoredMethodMappings(java.util.Properties)

setIgnoredMethodMappings

public void setIgnoredMethodMappings(Properties mappings)
Set the mappings of bean keys to a comma-separated list of method names.

These method names are ignored when creating the management interface.

The property key must match the bean key and the property value must match the list of method names. When searching for method names to ignore for a bean, Spring will check these mappings first.

includeReadAttribute

protected boolean includeReadAttribute(Method method,
                                       String beanKey)
Description copied from class: AbstractReflectiveMBeanInfoAssembler
Allows subclasses to vote on the inclusion of a particular attribute accessor.

Specified by:
includeReadAttribute in class AbstractReflectiveMBeanInfoAssembler
Parameters:
method - the accessor Method
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
Returns:
true if the accessor should be included in the management interface, otherwise false

includeWriteAttribute

protected boolean includeWriteAttribute(Method method,
                                        String beanKey)
Description copied from class: AbstractReflectiveMBeanInfoAssembler
Allows subclasses to vote on the inclusion of a particular attribute mutator.

Specified by:
includeWriteAttribute in class AbstractReflectiveMBeanInfoAssembler
Parameters:
method - the mutator Method.
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
Returns:
true if the mutator should be included in the management interface, otherwise false

includeOperation

protected boolean includeOperation(Method method,
                                   String beanKey)
Description copied from class: AbstractReflectiveMBeanInfoAssembler
Allows subclasses to vote on the inclusion of a particular operation.

Specified by:
includeOperation in class AbstractReflectiveMBeanInfoAssembler
Parameters:
method - the operation method
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
Returns:
whether the operation should be included in the management interface

isNotIgnored

protected boolean isNotIgnored(Method method,
                               String beanKey)
Determine whether the given method is supposed to be included, that is, not configured as to be ignored.

Parameters:
method - the operation method
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


MethodNameBasedMBeanInfoAssembler

org.springframework.jmx.export.assembler
Class MethodNameBasedMBeanInfoAssembler

java.lang.Object
    extended by  org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler
        extended by  org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
            extended by  org.springframework.jmx.export.assembler.AbstractConfigurableMBeanInfoAssembler
                extended by  org.springframework.jmx.export.assembler.MethodNameBasedMBeanInfoAssembler
All Implemented Interfaces:
MBeanInfoAssembler
public class MethodNameBasedMBeanInfoAssembler
extends AbstractConfigurableMBeanInfoAssembler

Subclass of AbstractReflectiveMBeanInfoAssembler that allows to specify method names to be exposed as MBean operations and attributes. JavaBean getters and setters will automatically be exposed as JMX attributes.

You can supply an array of method names via the managedMethods property. If you have multiple beans and you wish each bean to use a different set of method names, then you can map bean keys (that is the name used to pass the bean to the MBeanExporter) to a list of method names using the methodMappings property.

If you specify values for both methodMappings and managedMethods, Spring will attempt to find method names in the mappings first. If no method names for the bean are found, it will use the method names defined by managedMethods.

Since:
1.2
Author:
Juergen Hoeller
See Also:
setManagedMethods(java.lang.String[]), setMethodMappings(java.util.Properties), InterfaceBasedMBeanInfoAssembler, SimpleReflectiveMBeanInfoAssembler, MethodExclusionMBeanInfoAssembler, MBeanExporter

Field Summary
Fields inherited from class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
ATTRIBUTE_OPERATION_VISIBILITY, FIELD_CLASS, FIELD_CURRENCY_TIME_LIMIT, FIELD_DEFAULT, FIELD_DISPLAY_NAME, FIELD_GET_METHOD, FIELD_LOG, FIELD_LOG_FILE, FIELD_METRIC_CATEGORY, FIELD_METRIC_TYPE, FIELD_PERSIST_LOCATION, FIELD_PERSIST_NAME, FIELD_PERSIST_PERIOD, FIELD_PERSIST_POLICY, FIELD_ROLE, FIELD_SET_METHOD, FIELD_UNITS, FIELD_VISIBILITY, ROLE_GETTER, ROLE_OPERATION, ROLE_SETTER
Constructor Summary
MethodNameBasedMBeanInfoAssembler()
Method Summary
protected boolean | includeOperation(Method method, String beanKey) Allows subclasses to vote on the inclusion of a particular operation.
protected boolean | includeReadAttribute(Method method, String beanKey) Allows subclasses to vote on the inclusion of a particular attribute accessor.
protected boolean | includeWriteAttribute(Method method, String beanKey) Allows subclasses to vote on the inclusion of a particular attribute mutator.
protected boolean | isMatch(Method method, String beanKey)
void | setManagedMethods(String[] methodNames) Set the array of method names to use for creating the management info.
void | setMethodMappings(Properties mappings) Set the mappings of bean keys to a comma-separated list of method names.
Methods inherited from class org.springframework.jmx.export.assembler.AbstractConfigurableMBeanInfoAssembler
getNotificationInfo, setNotificationInfoMappings, setNotificationInfos
Methods inherited from class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
applyCurrencyTimeLimit, applyDefaultCurrencyTimeLimit, createModelMBeanOperationInfo, getAttributeDescription, getAttributeInfo, getClassForDescriptor, getDefaultCurrencyTimeLimit, getOperationDescription, getOperationInfo, getOperationParameters, isExposeClassDescriptor, isUseStrictCasing, populateAttributeDescriptor, populateMBeanDescriptor, populateOperationDescriptor, setDefaultCurrencyTimeLimit, setExposeClassDescriptor, setUseStrictCasing
Methods inherited from class org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler
checkManagedBean, getClassName, getClassToExpose, getClassToExpose, getConstructorInfo, getDescription, getMBeanInfo, getTargetClass
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MethodNameBasedMBeanInfoAssembler

public MethodNameBasedMBeanInfoAssembler()
Method Detail

setManagedMethods

public void setManagedMethods(String[] methodNames)
Set the array of method names to use for creating the management info. These method names will be used for a bean if no entry corresponding to that bean is found in the methodMappings property.

Parameters:
methodNames - an array of method names indicating the methods to use
See Also:
setMethodMappings(java.util.Properties)

setMethodMappings

public void setMethodMappings(Properties mappings)
Set the mappings of bean keys to a comma-separated list of method names. The property key should match the bean key and the property value should match the list of method names. When searching for method names for a bean, Spring will check these mappings first.

Parameters:
mappings - the mappins of bean keys to method names

includeReadAttribute

protected boolean includeReadAttribute(Method method,
                                       String beanKey)
Description copied from class: AbstractReflectiveMBeanInfoAssembler
Allows subclasses to vote on the inclusion of a particular attribute accessor.

Specified by:
includeReadAttribute in class AbstractReflectiveMBeanInfoAssembler
Parameters:
method - the accessor Method
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
Returns:
true if the accessor should be included in the management interface, otherwise false

includeWriteAttribute

protected boolean includeWriteAttribute(Method method,
                                        String beanKey)
Description copied from class: AbstractReflectiveMBeanInfoAssembler
Allows subclasses to vote on the inclusion of a particular attribute mutator.

Specified by:
includeWriteAttribute in class AbstractReflectiveMBeanInfoAssembler
Parameters:
method - the mutator Method.
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
Returns:
true if the mutator should be included in the management interface, otherwise false

includeOperation

protected boolean includeOperation(Method method,
                                   String beanKey)
Description copied from class: AbstractReflectiveMBeanInfoAssembler
Allows subclasses to vote on the inclusion of a particular operation.

Specified by:
includeOperation in class AbstractReflectiveMBeanInfoAssembler
Parameters:
method - the operation method
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
Returns:
whether the operation should be included in the management interface

isMatch

protected boolean isMatch(Method method,
                          String beanKey)
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


SimpleReflectiveMBeanInfoAssembler

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jmx.export.assembler
Class SimpleReflectiveMBeanInfoAssembler

java.lang.Object
    extended by  org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler
        extended by  org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
            extended by  org.springframework.jmx.export.assembler.AbstractConfigurableMBeanInfoAssembler
                extended by  org.springframework.jmx.export.assembler.SimpleReflectiveMBeanInfoAssembler
All Implemented Interfaces:
MBeanInfoAssembler
public class SimpleReflectiveMBeanInfoAssembler
extends AbstractConfigurableMBeanInfoAssembler

Simple subclass of AbstractReflectiveMBeanInfoAssembler that always votes yes for method and property inclusion, effectively exposing all public methods and properties as operations and attributes.

Since:
1.2
Author:
Rob Harrop, Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
ATTRIBUTE_OPERATION_VISIBILITY, FIELD_CLASS, FIELD_CURRENCY_TIME_LIMIT, FIELD_DEFAULT, FIELD_DISPLAY_NAME, FIELD_GET_METHOD, FIELD_LOG, FIELD_LOG_FILE, FIELD_METRIC_CATEGORY, FIELD_METRIC_TYPE, FIELD_PERSIST_LOCATION, FIELD_PERSIST_NAME, FIELD_PERSIST_PERIOD, FIELD_PERSIST_POLICY, FIELD_ROLE, FIELD_SET_METHOD, FIELD_UNITS, FIELD_VISIBILITY, ROLE_GETTER, ROLE_OPERATION, ROLE_SETTER
Constructor Summary
SimpleReflectiveMBeanInfoAssembler()
Method Summary
protected boolean | includeOperation(Method method, String beanKey) Always returns true.
protected boolean | includeReadAttribute(Method method, String beanKey) Always returns true.
protected boolean | includeWriteAttribute(Method method, String beanKey) Always returns true.
Methods inherited from class org.springframework.jmx.export.assembler.AbstractConfigurableMBeanInfoAssembler
getNotificationInfo, setNotificationInfoMappings, setNotificationInfos
Methods inherited from class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
applyCurrencyTimeLimit, applyDefaultCurrencyTimeLimit, createModelMBeanOperationInfo, getAttributeDescription, getAttributeInfo, getClassForDescriptor, getDefaultCurrencyTimeLimit, getOperationDescription, getOperationInfo, getOperationParameters, isExposeClassDescriptor, isUseStrictCasing, populateAttributeDescriptor, populateMBeanDescriptor, populateOperationDescriptor, setDefaultCurrencyTimeLimit, setExposeClassDescriptor, setUseStrictCasing
Methods inherited from class org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler
checkManagedBean, getClassName, getClassToExpose, getClassToExpose, getConstructorInfo, getDescription, getMBeanInfo, getTargetClass
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleReflectiveMBeanInfoAssembler

public SimpleReflectiveMBeanInfoAssembler()
Method Detail

includeReadAttribute

protected boolean includeReadAttribute(Method method,
                                       String beanKey)
Always returns true.

Specified by:
includeReadAttribute in class AbstractReflectiveMBeanInfoAssembler
Parameters:
method - the accessor Method
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
Returns:
true if the accessor should be included in the management interface, otherwise false

includeWriteAttribute

protected boolean includeWriteAttribute(Method method,
                                        String beanKey)
Always returns true.

Specified by:
includeWriteAttribute in class AbstractReflectiveMBeanInfoAssembler
Parameters:
method - the mutator Method.
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
Returns:
true if the mutator should be included in the management interface, otherwise false

includeOperation

protected boolean includeOperation(Method method,
                                   String beanKey)
Always returns true.

Specified by:
includeOperation in class AbstractReflectiveMBeanInfoAssembler
Parameters:
method - the operation method
beanKey - the key associated with the MBean in the beans map of the MBeanExporter
Returns:
whether the operation should be included in the management interface
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS | FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jmx.export.metadata

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jmx.export.metadata

Provides generic JMX metadata classes and basic support for reading JMX metadata in a provider-agnostic manner.

See:
Description

Interface Summary
JmxAttributeSource Interface used by the MetadataMBeanInfoAssembler to read source-level metadata from a managed resource's class.

Class Summary
AbstractJmxAttribute | Base class for all JMX metadata classes.
JmxMetadataUtils | Utility methods for converting Spring JMX metadata into their plain JMX equivalents.
ManagedAttribute | Metadata that indicates to expose a given bean property as JMX attribute.
ManagedMetric | Metadata that indicates to expose a given bean property as a JMX attribute, with additional descriptor properties that indicate that the attribute is a metric.
ManagedNotification | Metadata that indicates a JMX notification emitted by a bean.
ManagedOperation | Metadata that indicates to expose a given method as JMX operation.
ManagedOperationParameter | Metadata about JMX operation parameters.
ManagedResource | Metadata indicating that instances of an annotated class are to be registered with a JMX server.

Exception Summary
InvalidMetadataException Thrown by the JmxAttributeSource when it encounters incorrect metadata on a managed resource or one of its methods.

Package org.springframework.jmx.export.metadata Description

Provides generic JMX metadata classes and basic support for reading JMX metadata in a provider-agnostic manner.


org.springframework.jmx.export.metadata Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jmx.export.metadata

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jmx.export.metadata.AbstractJmxAttribute
      • org.springframework.jmx.export.metadata.ManagedAttribute
      • org.springframework.jmx.export.metadata.ManagedMetric
      • org.springframework.jmx.export.metadata.ManagedOperation
      • org.springframework.jmx.export.metadata.ManagedResource
    • org.springframework.jmx.export.metadata.JmxMetadataUtils
    • org.springframework.jmx.export.metadata.ManagedNotification
    • org.springframework.jmx.export.metadata.ManagedOperationParameter
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.jmx.JmxException
              • org.springframework.jmx.export.metadata.InvalidMetadataException

Interface Hierarchy

  • org.springframework.jmx.export.metadata.JmxAttributeSource


JmxAttributeSource

org.springframework.jmx.export.metadata
Interface JmxAttributeSource

All Known Implementing Classes:
AnnotationJmxAttributeSource
public interface JmxAttributeSource

Interface used by the MetadataMBeanInfoAssembler to read source-level metadata from a managed resource's class.

Since:
1.2
Author:
Rob Harrop, Jennifer Hickey
See Also:
MetadataMBeanInfoAssembler.setAttributeSource(org.springframework.jmx.export.metadata.JmxAttributeSource), MBeanExporter.setAssembler(org.springframework.jmx.export.assembler.MBeanInfoAssembler)

Method Summary
ManagedAttribute | getManagedAttribute(Method method) Implementations should return an instance of ManagedAttribute if the supplied Method has the corresponding metadata.
ManagedMetric | getManagedMetric(Method method) Implementations should return an instance of ManagedMetric if the supplied Method has the corresponding metadata.
ManagedNotification[] | getManagedNotifications(Class<?> clazz) Implementations should return an array of ManagedNotifications if the supplied the Class has the corresponding metadata.
ManagedOperation | getManagedOperation(Method method) Implementations should return an instance of ManagedOperation if the supplied Method has the corresponding metadata.
ManagedOperationParameter[] | getManagedOperationParameters(Method method) Implementations should return an array of ManagedOperationParameter if the supplied Method has the corresponding metadata.
ManagedResource | getManagedResource(Class<?> clazz) Implementations should return an instance of ManagedResource if the supplied Class has the appropriate metadata.

Method Detail

getManagedResource

ManagedResource getManagedResource(Class<?> clazz)
                                   throws InvalidMetadataException
Implementations should return an instance of ManagedResource if the supplied Class has the appropriate metadata. Otherwise should return null.

Parameters:
clazz - the class to read the attribute data from
Returns:
the attribute, or null if not found
Throws:
InvalidMetadataException - in case of invalid attributes

getManagedAttribute

ManagedAttribute getManagedAttribute(Method method)
                                     throws InvalidMetadataException
Implementations should return an instance of ManagedAttribute if the supplied Method has the corresponding metadata. Otherwise should return null.

Parameters:
method - the method to read the attribute data from
Returns:
the attribute, or null if not found
Throws:
InvalidMetadataException - in case of invalid attributes

getManagedMetric

ManagedMetric getManagedMetric(Method method)
                               throws InvalidMetadataException
Implementations should return an instance of ManagedMetric if the supplied Method has the corresponding metadata. Otherwise should return null.

Parameters:
method - the method to read the attribute data from
Returns:
the metric, or null if not found
Throws:
InvalidMetadataException - in case of invalid attributes

getManagedOperation

ManagedOperation getManagedOperation(Method method)
                                     throws InvalidMetadataException
Implementations should return an instance of ManagedOperation if the supplied Method has the corresponding metadata. Otherwise should return null.

Parameters:
method - the method to read the attribute data from
Returns:
the attribute, or null if not found
Throws:
InvalidMetadataException - in case of invalid attributes

getManagedOperationParameters

ManagedOperationParameter[] getManagedOperationParameters(Method method)
                                                          throws InvalidMetadataException
Implementations should return an array of ManagedOperationParameter if the supplied Method has the corresponding metadata. Otherwise should return an empty array if no metadata is found.

Parameters:
method - the Method to read the metadata from
Returns:
the parameter information.
Throws:
InvalidMetadataException - in the case of invalid attributes.

getManagedNotifications

ManagedNotification[] getManagedNotifications(Class<?> clazz)
                                              throws InvalidMetadataException
Implementations should return an array of ManagedNotifications if the supplied the Class has the corresponding metadata. Otherwise should return an empty array.

Parameters:
clazz - the Class to read the metadata from
Returns:
the notification information
Throws:
InvalidMetadataException - in the case of invalid metadata
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractJmxAttribute

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jmx.export.metadata
Class AbstractJmxAttribute

java.lang.Object
    extended by  org.springframework.jmx.export.metadata.AbstractJmxAttribute
Direct Known Subclasses:
ManagedAttribute, ManagedMetric, ManagedOperation, ManagedResource
public class AbstractJmxAttribute
extends Object

Base class for all JMX metadata classes.

Since:
1.2
Author:
Rob Harrop

Constructor Summary
AbstractJmxAttribute()
Method Summary
int | getCurrencyTimeLimit() Return a currency time limit for this attribute.
String | getDescription() Return a description for this attribute.
void | setCurrencyTimeLimit(int currencyTimeLimit) Set a currency time limit for this attribute.
void | setDescription(String description) Set a description for this attribute.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractJmxAttribute

public AbstractJmxAttribute()
Method Detail

setDescription

public void setDescription(String description)
Set a description for this attribute.

getDescription

public String getDescription()
Return a description for this attribute.

setCurrencyTimeLimit

public void setCurrencyTimeLimit(int currencyTimeLimit)
Set a currency time limit for this attribute.

getCurrencyTimeLimit

public int getCurrencyTimeLimit()
Return a currency time limit for this attribute.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


JmxMetadataUtils

org.springframework.jmx.export.metadata
Class JmxMetadataUtils

java.lang.Object
    extended by  org.springframework.jmx.export.metadata.JmxMetadataUtils

public abstract class JmxMetadataUtils
extends Object

Utility methods for converting Spring JMX metadata into their plain JMX equivalents.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller

Constructor Summary
JmxMetadataUtils()
Method Summary
static ModelMBeanNotificationInfo convertToModelMBeanNotificationInfo(ManagedNotification notificationInfo)
Convert the supplied ManagedNotification into the corresponding ModelMBeanNotificationInfo.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JmxMetadataUtils

public JmxMetadataUtils()
Method Detail

convertToModelMBeanNotificationInfo

public static ModelMBeanNotificationInfo convertToModelMBeanNotificationInfo(ManagedNotification notificationInfo)
Convert the supplied ManagedNotification into the corresponding ModelMBeanNotificationInfo.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ManagedAttribute

org.springframework.jmx.export.metadata
Class ManagedAttribute

java.lang.Object
    extended by  org.springframework.jmx.export.metadata.AbstractJmxAttribute
        extended by  org.springframework.jmx.export.metadata.ManagedAttribute

public class ManagedAttribute
extends AbstractJmxAttribute

Metadata that indicates to expose a given bean property as JMX attribute. Only valid when used on a JavaBean getter or setter.

Since:
1.2
Author:
Rob Harrop
See Also:
MetadataMBeanInfoAssembler, MBeanExporter

Field Summary
static ManagedAttribute EMPTY
Constructor Summary
ManagedAttribute()
Method Summary
Object | getDefaultValue() Return the default value of this attribute.
int | getPersistPeriod()
String | getPersistPolicy()
void | setDefaultValue(Object defaultValue) Set the default value of this attribute.
void | setPersistPeriod(int persistPeriod)
void | setPersistPolicy(String persistPolicy)
Methods inherited from class org.springframework.jmx.export.metadata.AbstractJmxAttribute
getCurrencyTimeLimit, getDescription, setCurrencyTimeLimit, setDescription
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

EMPTY

public static final ManagedAttribute EMPTY
Constructor Detail

ManagedAttribute

public ManagedAttribute()
Method Detail

setDefaultValue

public void setDefaultValue(Object defaultValue)
Set the default value of this attribute.

getDefaultValue

public Object getDefaultValue()
Return the default value of this attribute.

setPersistPolicy

public void setPersistPolicy(String persistPolicy)

getPersistPolicy

public String getPersistPolicy()

setPersistPeriod

public void setPersistPeriod(int persistPeriod)

getPersistPeriod

public int getPersistPeriod()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ManagedMetric

org.springframework.jmx.export.metadata
Class ManagedMetric

java.lang.Object
    extended by  org.springframework.jmx.export.metadata.AbstractJmxAttribute
        extended by  org.springframework.jmx.export.metadata.ManagedMetric

public class ManagedMetric
extends AbstractJmxAttribute

Metadata that indicates to expose a given bean property as a JMX attribute, with additional descriptor properties that indicate that the attribute is a metric. Only valid when used on a JavaBean getter.

Since:
3.0
Author:
Jennifer Hickey
See Also:
MetadataMBeanInfoAssembler

Constructor Summary
ManagedMetric()
Method Summary
String | getCategory() The category of this metric (ex.
String | getDisplayName() A display name for this metric.
MetricType | getMetricType() A description of how this metric's values change over time.
int | getPersistPeriod() The persist period for this metric.
String | getPersistPolicy() The persist policy for this metric.
String | getUnit() The expected unit of measurement values.
void | setCategory(String category) The category of this metric (ex.
void | setDisplayName(String displayName) A display name for this metric.
void | setMetricType(MetricType metricType) A description of how this metric's values change over time.
void | setPersistPeriod(int persistPeriod) The persist period for this metric.
void | setPersistPolicy(String persistPolicy) The persist policy for this metric.
void | setUnit(String unit) The expected unit of measurement values.
Methods inherited from class org.springframework.jmx.export.metadata.AbstractJmxAttribute
getCurrencyTimeLimit, getDescription, setCurrencyTimeLimit, setDescription
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ManagedMetric

public ManagedMetric()
Method Detail

setCategory

public void setCategory(String category)
The category of this metric (ex. throughput, performance, utilization).

getCategory

public String getCategory()
The category of this metric (ex. throughput, performance, utilization).

setDisplayName

public void setDisplayName(String displayName)
A display name for this metric.

getDisplayName

public String getDisplayName()
A display name for this metric.

setMetricType

public void setMetricType(MetricType metricType)
A description of how this metric's values change over time.

getMetricType

public MetricType getMetricType()
A description of how this metric's values change over time.

setPersistPeriod

public void setPersistPeriod(int persistPeriod)
The persist period for this metric.

getPersistPeriod

public int getPersistPeriod()
The persist period for this metric.

setPersistPolicy

public void setPersistPolicy(String persistPolicy)
The persist policy for this metric.

getPersistPolicy

public String getPersistPolicy()
The persist policy for this metric.

setUnit

public void setUnit(String unit)
The expected unit of measurement values.

getUnit

public String getUnit()
The expected unit of measurement values.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ManagedNotification

org.springframework.jmx.export.metadata
Class ManagedNotification

java.lang.Object
    extended by  org.springframework.jmx.export.metadata.ManagedNotification

public class ManagedNotification
extends Object

Metadata that indicates a JMX notification emitted by a bean.

Since:
2.0
Author:
Rob Harrop

Constructor Summary
ManagedNotification()
Method Summary
String | getDescription() Return a description for this notification.
String | getName() Return the name of this notification.
String[] | getNotificationTypes() Return the list of notification types.
void | setDescription(String description) Set a description for this notification.
void | setName(String name) Set the name of this notification.
void | setNotificationType(String notificationType) Set a single notification type, or a list of notification types as comma-delimited String.
void | setNotificationTypes(String[] notificationTypes) Set a list of notification types.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ManagedNotification

public ManagedNotification()
Method Detail

setNotificationType

public void setNotificationType(String notificationType)
Set a single notification type, or a list of notification types as comma-delimited String.

setNotificationTypes

public void setNotificationTypes(String[] notificationTypes)
Set a list of notification types.

getNotificationTypes

public String[] getNotificationTypes()
Return the list of notification types.

setName

public void setName(String name)
Set the name of this notification.

getName

public String getName()
Return the name of this notification.

setDescription

public void setDescription(String description)
Set a description for this notification.

getDescription

public String getDescription()
Return a description for this notification.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ManagedOperation

org.springframework.jmx.export.metadata
Class ManagedOperation

java.lang.Object
    extended by  org.springframework.jmx.export.metadata.AbstractJmxAttribute
        extended by  org.springframework.jmx.export.metadata.ManagedOperation

public class ManagedOperation
extends AbstractJmxAttribute

Metadata that indicates to expose a given method as JMX operation. Only valid when used on a method that is not a JavaBean getter or setter.

Since:
1.2
Author:
Rob Harrop
See Also:
MetadataMBeanInfoAssembler, MBeanExporter

Constructor Summary
ManagedOperation()
Method Summary
Methods inherited from class org.springframework.jmx.export.metadata.AbstractJmxAttribute
getCurrencyTimeLimit, getDescription, setCurrencyTimeLimit, setDescription
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ManagedOperation

public ManagedOperation()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ManagedOperationParameter

org.springframework.jmx.export.metadata
Class ManagedOperationParameter

java.lang.Object
    extended by  org.springframework.jmx.export.metadata.ManagedOperationParameter

public class ManagedOperationParameter
extends Object

Metadata about JMX operation parameters. Used in conjunction with a ManagedOperation attribute.

Since:
1.2
Author:
Rob Harrop

Constructor Summary
ManagedOperationParameter()
Method Summary
String | getDescription() Return a description for this parameter.
int | getIndex() Return the index of this parameter in the operation signature.
String | getName() Return the name of this parameter in the operation signature.
void | setDescription(String description) Set a description for this parameter.
void | setIndex(int index) Set the index of this parameter in the operation signature.
void | setName(String name) Set the name of this parameter in the operation signature.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ManagedOperationParameter

public ManagedOperationParameter()
Method Detail

setIndex

public void setIndex(int index)
Set the index of this parameter in the operation signature.

getIndex

public int getIndex()
Return the index of this parameter in the operation signature.

setName

public void setName(String name)
Set the name of this parameter in the operation signature.

getName

public String getName()
Return the name of this parameter in the operation signature.

setDescription

public void setDescription(String description)
Set a description for this parameter.

getDescription

public String getDescription()
Return a description for this parameter.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ManagedResource

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jmx.export.metadata
Class ManagedResource

java.lang.Object
    extended by  org.springframework.jmx.export.metadata.AbstractJmxAttribute
        extended by  org.springframework.jmx.export.metadata.ManagedResource

public class ManagedResource
extends AbstractJmxAttribute

Metadata indicating that instances of an annotated class are to be registered with a JMX server. Only valid when used on a Class.

Since:
1.2
Author:
Rob Harrop
See Also:
MetadataMBeanInfoAssembler, MetadataNamingStrategy, MBeanExporter

Constructor Summary
ManagedResource()
Method Summary
String | getLogFile()
String | getObjectName() Return the JMX ObjectName of this managed resource.
String | getPersistLocation()
String | getPersistName()
int | getPersistPeriod()
String | getPersistPolicy()
boolean | isLog()
void | setLog(boolean log)
void | setLogFile(String logFile)
void | setObjectName(String objectName) Set the JMX ObjectName of this managed resource.
void | setPersistLocation(String persistLocation)
void | setPersistName(String persistName)
void | setPersistPeriod(int persistPeriod)
void | setPersistPolicy(String persistPolicy)
Methods inherited from class org.springframework.jmx.export.metadata.AbstractJmxAttribute
getCurrencyTimeLimit, getDescription, setCurrencyTimeLimit, setDescription
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ManagedResource

public ManagedResource()
Method Detail

setObjectName

public void setObjectName(String objectName)
Set the JMX ObjectName of this managed resource.

getObjectName

public String getObjectName()
Return the JMX ObjectName of this managed resource.

setLog

public void setLog(boolean log)

isLog

public boolean isLog()

setLogFile

public void setLogFile(String logFile)

getLogFile

public String getLogFile()

setPersistPolicy

public void setPersistPolicy(String persistPolicy)

getPersistPolicy

public String getPersistPolicy()

setPersistPeriod

public void setPersistPeriod(int persistPeriod)

getPersistPeriod

public int getPersistPeriod()

setPersistName

public void setPersistName(String persistName)

getPersistName

public String getPersistName()

setPersistLocation

public void setPersistLocation(String persistLocation)

getPersistLocation

public String getPersistLocation()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


InvalidMetadataException

org.springframework.jmx.export.metadata
Class InvalidMetadataException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.jmx.JmxException
                        extended by  org.springframework.jmx.export.metadata.InvalidMetadataException
All Implemented Interfaces:
Serializable
public class InvalidMetadataException
extends JmxException

Thrown by the JmxAttributeSource when it encounters incorrect metadata on a managed resource or one of its methods.

Since:
1.2
Author:
Rob Harrop
See Also:
JmxAttributeSource, MetadataMBeanInfoAssembler, Serialized Form

Constructor Summary
InvalidMetadataException(String msg)
Create a new InvalidMetadataException with the supplied error message.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

InvalidMetadataException

public InvalidMetadataException(String msg)
Create a new InvalidMetadataException with the supplied error message.

Parameters:
msg - the detail message
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.jmx.export.naming

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jmx.export.naming

Provides a strategy for ObjectName creation.

See:
Description

Interface Summary
ObjectNamingStrategy | Strategy interface that encapsulates the creation of ObjectName instances.
SelfNaming | Interface that allows infrastructure components to provide their own ObjectNames to the MBeanExporter.

Class Summary
IdentityNamingStrategy | An implementation of the ObjectNamingStrategy interface that creates a name based on the the identity of a given instance.
KeyNamingStrategy | ObjectNamingStrategy implementation that builds ObjectName instances from the key used in the "beans" map passed to MBeanExporter.
MetadataNamingStrategy | An implementation of the ObjectNamingStrategy interface that reads the ObjectName from the source-level metadata.

Package org.springframework.jmx.export.naming Description

Provides a strategy for ObjectName creation. Used by MBeanExporter to determine the JMX names to use for exported Spring-managed beans.


org.springframework.jmx.export.naming Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jmx.export.naming

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jmx.export.naming.IdentityNamingStrategy (implements org.springframework.jmx.export.naming.ObjectNamingStrategy)
    • org.springframework.jmx.export.naming.KeyNamingStrategy (implements org.springframework.beans.factory.InitializingBean, org.springframework.jmx.export.naming.ObjectNamingStrategy)
    • org.springframework.jmx.export.naming.MetadataNamingStrategy (implements org.springframework.beans.factory.InitializingBean, org.springframework.jmx.export.naming.ObjectNamingStrategy)

Interface Hierarchy

  • org.springframework.jmx.export.naming.ObjectNamingStrategy
  • org.springframework.jmx.export.naming.SelfNaming


ObjectNamingStrategy

org.springframework.jmx.export.naming
Interface ObjectNamingStrategy

All Known Implementing Classes:
IdentityNamingStrategy, KeyNamingStrategy, MetadataNamingStrategy
public interface ObjectNamingStrategy

Strategy interface that encapsulates the creation of ObjectName instances.

Used by the MBeanExporter to obtain ObjectNames when registering beans.

Since:
1.2
Author:
Rob Harrop
See Also:
MBeanExporter, ObjectName

Method Summary
 ObjectName getObjectName(Object managedBean, String beanKey)
Obtain an ObjectName for the supplied bean.

Method Detail

getObjectName

ObjectName getObjectName(Object managedBean,
                         String beanKey)
                         throws MalformedObjectNameException
Obtain an ObjectName for the supplied bean.

Parameters:
managedBean - the bean that will be exposed under the returned ObjectName
beanKey - the key associated with this bean in the beans map passed to the MBeanExporter
Returns:
the ObjectName instance
Throws:
MalformedObjectNameException - if the resulting ObjectName is invalid
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SelfNaming

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jmx.export.naming
Interface SelfNaming

public interface SelfNaming

Interface that allows infrastructure components to provide their own ObjectNames to the MBeanExporter.

Note: This interface is mainly intended for internal usage.

Since:
1.2.2
Author:
Rob Harrop
See Also:
MBeanExporter

Method Summary
 ObjectName getObjectName()
Return the ObjectName for the implementing object.

Method Detail

getObjectName

ObjectName getObjectName()
                         throws MalformedObjectNameException
Return the ObjectName for the implementing object.

Throws:
MalformedObjectNameException - if thrown by the ObjectName constructor
See Also:
ObjectName.ObjectName(String),
ObjectName.getInstance(String),
ObjectNameManager.getInstance(String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


IdentityNamingStrategy

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jmx.export.naming
Class IdentityNamingStrategy

java.lang.Object
    extended by  org.springframework.jmx.export.naming.IdentityNamingStrategy
All Implemented Interfaces:
ObjectNamingStrategy
public class IdentityNamingStrategy
extends Object
implements ObjectNamingStrategy

An implementation of the ObjectNamingStrategy interface that creates a name based on the the identity of a given instance.

The resulting ObjectName will be in the form package:class=class name,hashCode=identity hash (in hex)

Since:
1.2
Author:
Rob Harrop, Juergen Hoeller

Field Summary
static String | HASH_CODE_KEY
static String | TYPE_KEY
Constructor Summary
IdentityNamingStrategy()
Method Summary
 ObjectName getObjectName(Object managedBean, String beanKey)
Returns an instance of ObjectName based on the identity of the managed resource.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

TYPE_KEY

public static final String TYPE_KEY
See Also:
Constant Field Values

HASH_CODE_KEY

public static final String HASH_CODE_KEY
See Also:
Constant Field Values
Constructor Detail

IdentityNamingStrategy

public IdentityNamingStrategy()
Method Detail

getObjectName

public ObjectName getObjectName(Object managedBean,
                                String beanKey)
                         throws MalformedObjectNameException
Returns an instance of ObjectName based on the identity of the managed resource.

Specified by:
getObjectName in interface ObjectNamingStrategy
Parameters:
managedBean - the bean that will be exposed under the returned ObjectName
beanKey - the key associated with this bean in the beans map passed to the MBeanExporter
Returns:
the ObjectName instance
Throws:
MalformedObjectNameException - if the resulting ObjectName is invalid
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


KeyNamingStrategy

org.springframework.jmx.export.naming
Class KeyNamingStrategy

java.lang.Object
    extended by  org.springframework.jmx.export.naming.KeyNamingStrategy
All Implemented Interfaces:
InitializingBean, ObjectNamingStrategy
public class KeyNamingStrategy
extends Object
implements ObjectNamingStrategy, InitializingBean

ObjectNamingStrategy implementation that builds ObjectName instances from the key used in the "beans" map passed to MBeanExporter.

Can also check object name mappings, given as Properties or as mappingLocations of properties files. The key used to look up is the key used in MBeanExporter's "beans" map. If no mapping is found for a given key, the key itself is used to build an ObjectName.

Since:
1.2
Author:
Rob Harrop, Juergen Hoeller
See Also:
setMappings(java.util.Properties),
setMappingLocation(org.springframework.core.io.Resource),
setMappingLocations(org.springframework.core.io.Resource[]),
MBeanExporter.setBeans(java.util.Map)

Field Summary
protected  Log logger
Log instance for this class.
Constructor Summary
KeyNamingStrategy()
Method Summary
void | afterPropertiesSet() Merges the Properties configured in the mappings and mappingLocations into the final Properties instance used for ObjectName resolution.
ObjectName | getObjectName(Object managedBean, String beanKey) Attempts to retrieve the ObjectName via the given key, trying to find a mapped value in the mappings first.
void | setMappingLocation(Resource location) Set a location of a properties file to be loaded, containing object name mappings.
void | setMappingLocations(Resource[] mappingLocations) Set location of properties files to be loaded, containing object name mappings.
void | setMappings(Properties mappings) Set local properties, containing object name mappings, e.g.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Log instance for this class.

Constructor Detail

KeyNamingStrategy

public KeyNamingStrategy()
Method Detail

setMappings

public void setMappings(Properties mappings)
Set local properties, containing object name mappings, e.g. via the "props" tag in XML bean definitions. These can be considered defaults, to be overridden by properties loaded from files.

setMappingLocation

public void setMappingLocation(Resource location)
Set a location of a properties file to be loaded, containing object name mappings.

setMappingLocations

public void setMappingLocations(Resource[] mappingLocations)
Set location of properties files to be loaded, containing object name mappings.

afterPropertiesSet

public void afterPropertiesSet()
                        throws IOException
Merges the Properties configured in the mappings and mappingLocations into the final Properties instance used for ObjectName resolution.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
IOException

getObjectName

public ObjectName getObjectName(Object managedBean,
                                String beanKey)
                         throws MalformedObjectNameException
Attempts to retrieve the ObjectName via the given key, trying to find a mapped value in the mappings first.

Specified by:
getObjectName in interface ObjectNamingStrategy
Parameters:
managedBean - the bean that will be exposed under the returned ObjectName
beanKey - the key associated with this bean in the beans map passed to the MBeanExporter
Returns:
the ObjectName instance
Throws:
MalformedObjectNameException - if the resulting ObjectName is invalid
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MetadataNamingStrategy

org.springframework.jmx.export.naming
Class MetadataNamingStrategy

java.lang.Object
    extended by  org.springframework.jmx.export.naming.MetadataNamingStrategy
All Implemented Interfaces:
InitializingBean, ObjectNamingStrategy
public class MetadataNamingStrategy
extends Object
implements ObjectNamingStrategy, InitializingBean

An implementation of the ObjectNamingStrategy interface that reads the ObjectName from the source-level metadata. Falls back to the bean key (bean name) if no ObjectName can be found in source-level metadata.

Uses the JmxAttributeSource strategy interface, so that metadata can be read using any supported implementation. Out of the box, AnnotationJmxAttributeSource introspects a well-defined set of Java 5 annotations that come with Spring.

Since:
1.2
Author:
Rob Harrop, Juergen Hoeller
See Also:
ObjectNamingStrategy, AnnotationJmxAttributeSource

Constructor Summary
MetadataNamingStrategy()
Create a new MetadataNamingStrategy which needs to be configured through the setAttributeSource(org.springframework.jmx.export.metadata.JmxAttributeSource) method.
MetadataNamingStrategy(JmxAttributeSource attributeSource)
Create a new MetadataNamingStrategy for the given JmxAttributeSource.
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
ObjectName | getObjectName(Object managedBean, String beanKey) Reads the ObjectName from the source-level metadata associated with the managed resource's Class.
void | setAttributeSource(JmxAttributeSource attributeSource) Set the implementation of the JmxAttributeSource interface to use when reading the source-level metadata.
void | setDefaultDomain(String defaultDomain) Specify the default domain to be used for generating ObjectNames when no source-level metadata has been specified.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MetadataNamingStrategy

public MetadataNamingStrategy()
Create a new MetadataNamingStrategy which needs to be configured through the setAttributeSource(org.springframework.jmx.export.metadata.JmxAttributeSource) method.

MetadataNamingStrategy

public MetadataNamingStrategy(JmxAttributeSource attributeSource)
Create a new MetadataNamingStrategy for the given JmxAttributeSource.

Parameters:
attributeSource - the JmxAttributeSource to use
Method Detail

setAttributeSource

public void setAttributeSource(JmxAttributeSource attributeSource)
Set the implementation of the JmxAttributeSource interface to use when reading the source-level metadata.

setDefaultDomain

public void setDefaultDomain(String defaultDomain)
Specify the default domain to be used for generating ObjectNames when no source-level metadata has been specified.

The default is to use the domain specified in the bean name (if the bean name follows the JMX ObjectName syntax); else, the package name of the managed bean class.

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

getObjectName

public ObjectName getObjectName(Object managedBean,
                                String beanKey)
                         throws MalformedObjectNameException
Reads the ObjectName from the source-level metadata associated with the managed resource's Class.

Specified by:
getObjectName in interface ObjectNamingStrategy
Parameters:
managedBean - the bean that will be exposed under the returned ObjectName
beanKey - the key associated with this bean in the beans map passed to the MBeanExporter
Returns:
the ObjectName instance
Throws:
MalformedObjectNameException - if the resulting ObjectName is invalid
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


org.springframework.jmx.export.notification

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jmx.export.notification

Provides supporting infrastructure to allow Spring-created MBeans to send JMX notifications.

See:
Description

Interface Summary
NotificationPublisher | Simple interface allowing Spring-managed MBeans to publish JMX notifications without being aware of how those notifications are being transmitted to the MBeanServer.
NotificationPublisherAware | Interface to be implemented by any Spring-managed resource that is to be registered with an MBeanServer and wishes to send JMX javax.management.Notifications.

Class Summary
ModelMBeanNotificationPublisher NotificationPublisher implementation that uses the infrastructure provided by the ModelMBean interface to track javax.management.NotificationListeners and send Notifications to those listeners.

Exception Summary
UnableToSendNotificationException Thrown when a JMX Notification is unable to be sent.

Package org.springframework.jmx.export.notification Description

Provides supporting infrastructure to allow Spring-created MBeans to send JMX notifications.


org.springframework.jmx.export.notification Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jmx.export.notification

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jmx.export.notification.ModelMBeanNotificationPublisher (implements org.springframework.jmx.export.notification.NotificationPublisher)
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.jmx.JmxException
              • org.springframework.jmx.export.notification.UnableToSendNotificationException

Interface Hierarchy

  • org.springframework.jmx.export.notification.NotificationPublisher
  • org.springframework.jmx.export.notification.NotificationPublisherAware


NotificationPublisher

org.springframework.jmx.export.notification
Interface NotificationPublisher

All Known Implementing Classes:
ModelMBeanNotificationPublisher
public interface NotificationPublisher

Simple interface allowing Spring-managed MBeans to publish JMX notifications without being aware of how those notifications are being transmitted to the MBeanServer.

Managed resources can access a NotificationPublisher by implementing the NotificationPublisherAware interface. After a particular managed resource instance is registered with the MBeanServer, Spring will inject a NotificationPublisher instance into it if that resource implements the NotificationPublisherAware inteface.

Each managed resource instance will have a distinct instance of a NotificationPublisher implementation. This instance will keep track of all the NotificationListeners registered for a particular mananaged resource.

Any existing, user-defined MBeans should use standard JMX APIs for notification publication; this interface is intended for use only by Spring-created MBeans.

Since:
2.0
Author:
Rob Harrop
See Also:
NotificationPublisherAware, MBeanExporter

Method Summary
 void sendNotification(Notification notification)
Send the specified Notification to all registered NotificationListeners.

Method Detail

sendNotification

void sendNotification(Notification notification)
                      throws UnableToSendNotificationException
Send the specified Notification to all registered NotificationListeners. Managed resources are not responsible for managing the list of registered NotificationListeners; that is performed automatically.

Parameters:
notification - the JMX Notification to send
Throws:
UnableToSendNotificationException - if sending failed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NotificationPublisherAware

org.springframework.jmx.export.notification
Interface NotificationPublisherAware

public interface NotificationPublisherAware

Interface to be implemented by any Spring-managed resource that is to be registered with an MBeanServer and wishes to send JMX javax.management.Notifications.

Provides Spring-created managed resources with a NotificationPublisher as soon as they are registered with the MBeanServer.

NOTE: This interface only applies to simple Spring-managed beans which happen to get exported through Spring's MBeanExporter. It does not apply to any non-exported beans; neither does it apply to standard MBeans exported by Spring. For standard JMX MBeans, consider implementing the ModelMBeanNotificationBroadcaster interface (or implementing a full ModelMBean).

Since:
2.0
Author:
Rob Harrop
See Also:
NotificationPublisher

Method Summary
 void setNotificationPublisher(NotificationPublisher notificationPublisher)
Set the NotificationPublisher instance for the current managed resource instance.

Method Detail

setNotificationPublisher

void setNotificationPublisher(NotificationPublisher notificationPublisher)
Set the NotificationPublisher instance for the current managed resource instance.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ModelMBeanNotificationPublisher

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jmx.export.notification
Class ModelMBeanNotificationPublisher

java.lang.Object
    extended by  org.springframework.jmx.export.notification.ModelMBeanNotificationPublisher
All Implemented Interfaces:
NotificationPublisher
public class ModelMBeanNotificationPublisher
extends Object
implements NotificationPublisher

NotificationPublisher implementation that uses the infrastructure provided by the ModelMBean interface to track javax.management.NotificationListeners and send Notifications to those listeners.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller, Rick Evans
See Also:
ModelMBeanNotificationBroadcaster, NotificationPublisherAware

Constructor Summary
ModelMBeanNotificationPublisher(ModelMBeanNotificationBroadcaster modelMBean, ObjectName objectName, Object managedResource)
Create a new instance of the ModelMBeanNotificationPublisher class that will publish all Notifications to the supplied ModelMBean.
Method Summary
 void sendNotification(Notification notification)
Send the supplied Notification using the wrapped ModelMBean instance.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ModelMBeanNotificationPublisher

public ModelMBeanNotificationPublisher(ModelMBeanNotificationBroadcaster modelMBean,
                                       ObjectName objectName,
                                       Object managedResource)
Create a new instance of the ModelMBeanNotificationPublisher class that will publish all Notifications to the supplied ModelMBean.

Parameters:
modelMBean - the target ModelMBean; must not be null
objectName - the ObjectName of the source ModelMBean
managedResource - the managed resource exposed by the supplied ModelMBean
Throws:
IllegalArgumentException - if any of the parameters is null
Method Detail

sendNotification

public void sendNotification(Notification notification)
Send the supplied Notification using the wrapped ModelMBean instance.

Specified by:
sendNotification in interface NotificationPublisher
Parameters:
notification - the Notification to be sent
Throws:
IllegalArgumentException - if the supplied notification is null
UnableToSendNotificationException - if the supplied notification could not be sent
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


UnableToSendNotificationException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jmx.export.notification
Class UnableToSendNotificationException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.jmx.JmxException
                        extended by  org.springframework.jmx.export.notification.UnableToSendNotificationException
All Implemented Interfaces:
Serializable
public class UnableToSendNotificationException
extends JmxException

Thrown when a JMX Notification is unable to be sent.

The root cause of just why a particular notification could not be sent will typically be available via the Throwable.getCause() property.

Since:
2.0
Author:
Rob Harrop
See Also:
NotificationPublisher, Serialized Form

Constructor Summary
UnableToSendNotificationException(String msg)
Create a new instance of the UnableToSendNotificationException class with the specified error message.
UnableToSendNotificationException(String msg, Throwable cause)
Create a new instance of the UnableToSendNotificationException with the specified error message and root cause.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

UnableToSendNotificationException

public UnableToSendNotificationException(String msg)
Create a new instance of the UnableToSendNotificationException class with the specified error message.

Parameters:
msg - the detail message

UnableToSendNotificationException

public UnableToSendNotificationException(String msg,
                                         Throwable cause)
Create a new instance of the UnableToSendNotificationException with the specified error message and root cause.

Parameters:
msg - the detail message
cause - the root cause
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jmx.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jmx.support

Contains support classes for connecting to local and remote MBeanServers and for exposing an MBeanServer to remote clients.

See:
Description

Class Summary
ConnectorServerFactoryBean | FactoryBean that creates a JSR-160 JMXConnectorServer, optionally registers it with the MBeanServer and then starts it.
JmxUtils | Collection of generic utility methods to support Spring JMX.
MBeanRegistrationSupport | Provides supporting infrastructure for registering MBeans with an MBeanServer.
MBeanServerConnectionFactoryBean | FactoryBean that creates a JMX 1.2 MBeanServerConnection to a remote MBeanServer exposed via a JMXServerConnector.
MBeanServerFactoryBean | FactoryBean that obtains an MBeanServer reference through the standard JMX 1.2 MBeanServerFactory API (which is available on JDK 1.5 or as part of a JMX 1.2 provider).
NotificationListenerHolder | Helper class that aggregates a NotificationListener, a NotificationFilter, and an arbitrary handback object, as well as the names of MBeans from which the listener wishes to receive Notifications.
ObjectNameManager | Helper class for the creation of ObjectName instances.
WebSphereMBeanServerFactoryBean | FactoryBean that obtains a WebSphere MBeanServer reference through WebSphere's proprietary AdminServiceFactory API, available on WebSphere 5.1 and higher.

Enum Summary
MetricType Represents how the measurement values of a ManagedMetric will change over time

Package org.springframework.jmx.support Description

Contains support classes for connecting to local and remote MBeanServers and for exposing an MBeanServer to remote clients.


org.springframework.jmx.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jmx.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jmx.support.JmxUtils
    • org.springframework.jmx.support.MBeanRegistrationSupport
      • org.springframework.jmx.support.ConnectorServerFactoryBean (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.jmx.support.MBeanServerConnectionFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.jmx.support.MBeanServerFactoryBean (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.jmx.support.NotificationListenerHolder
    • org.springframework.jmx.support.ObjectNameManager
    • org.springframework.jmx.support.WebSphereMBeanServerFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)

Enum Hierarchy

  • java.lang.Object
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)
      • org.springframework.jmx.support.MetricType


ConnectorServerFactoryBean

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jmx.support
Class ConnectorServerFactoryBean

java.lang.Object
    extended by  org.springframework.jmx.support.MBeanRegistrationSupport
        extended by  org.springframework.jmx.support.ConnectorServerFactoryBean
All Implemented Interfaces:
DisposableBean, FactoryBean<JMXConnectorServer>, InitializingBean
public class ConnectorServerFactoryBean
extends MBeanRegistrationSupport
implements FactoryBean<JMXConnectorServer>, InitializingBean, DisposableBean

FactoryBean that creates a JSR-160 JMXConnectorServer, optionally registers it with the MBeanServer and then starts it.

The JMXConnectorServer can be started in a separate thread by setting the threaded property to true. You can configure this thread to be a daemon thread by setting the daemon property to true.

The JMXConnectorServer is correctly shutdown when an instance of this class is destroyed on shutdown of the containing ApplicationContext.

Since:
1.2
Author:
Rob Harrop, Juergen Hoeller
See Also:
FactoryBean, JMXConnectorServer, MBeanServer

Field Summary
static String DEFAULT_SERVICE_URL
The default service URL
Fields inherited from class org.springframework.jmx.support.MBeanRegistrationSupport
logger, registeredBeans, REGISTRATION_FAIL_ON_EXISTING, REGISTRATION_IGNORE_EXISTING, REGISTRATION_REPLACE_EXISTING, server
Constructor Summary
ConnectorServerFactoryBean()
Method Summary
 void afterPropertiesSet()
Start the connector server.
 void destroy()
Stop the JMXConnectorServer managed by an instance of this class.
 JMXConnectorServer getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<? extends JMXConnectorServer> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setDaemon(boolean daemon)
Set whether any threads started for the JMXConnectorServer should be started as daemon threads.
 void setEnvironment(Properties environment)
Set the environment properties used to construct the JMXConnectorServer as java.util.Properties (String key/value pairs).
 void setEnvironmentMap(Map<String,?> environment)
Set the environment properties used to construct the JMXConnector as a Map of String keys and arbitrary Object values.
 void setObjectName(Object objectName)
Set the ObjectName used to register the JMXConnectorServer itself with the MBeanServer, as ObjectName instance or as String.
 void setServiceUrl(String serviceUrl)
Set the service URL for the JMXConnectorServer.
 void setThreaded(boolean threaded)
Set whether the JMXConnectorServer should be started in a separate thread.
Methods inherited from class org.springframework.jmx.support.MBeanRegistrationSupport
doRegister, doUnregister, getRegisteredObjectNames, getServer, onRegister, onRegister, onUnregister, setRegistrationBehavior, setRegistrationBehaviorName, setServer, unregisterBeans
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_SERVICE_URL

public static final String DEFAULT_SERVICE_URL
The default service URL

See Also:
Constant Field Values
Constructor Detail

ConnectorServerFactoryBean

public ConnectorServerFactoryBean()
Method Detail

setServiceUrl

public void setServiceUrl(String serviceUrl)
Set the service URL for the JMXConnectorServer.

setEnvironment

public void setEnvironment(Properties environment)
Set the environment properties used to construct the JMXConnectorServer as java.util.Properties (String key/value pairs).

setEnvironmentMap

public void setEnvironmentMap(Map<String,?> environment)
Set the environment properties used to construct the JMXConnector as a Map of String keys and arbitrary Object values.

setObjectName

public void setObjectName(Object objectName)
                   throws MalformedObjectNameException
Set the ObjectName used to register the JMXConnectorServer itself with the MBeanServer, as ObjectName instance or as String.

Throws:
MalformedObjectNameException - if the ObjectName is malformed

setThreaded

public void setThreaded(boolean threaded)
Set whether the JMXConnectorServer should be started in a separate thread.

setDaemon

public void setDaemon(boolean daemon)
Set whether any threads started for the JMXConnectorServer should be started as daemon threads.

afterPropertiesSet

public void afterPropertiesSet()
                        throws JMException,
                               IOException
Start the connector server. If the threaded flag is set to true, the JMXConnectorServer will be started in a separate thread. If the daemon flag is set to true, that thread will be started as a daemon thread.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
JMException - if a problem occured when registering the connector server with the MBeanServer
IOException - if there is a problem starting the connector server

getObject

public JMXConnectorServer getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<JMXConnectorServer>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends JMXConnectorServer> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<JMXConnectorServer>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<JMXConnectorServer>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()

destroy

public void destroy()
             throws IOException
Stop the JMXConnectorServer managed by an instance of this class. Automatically called on ApplicationContext shutdown.

Specified by:
destroy in interface DisposableBean
Throws:
IOException - if there is an error stopping the connector server
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


JmxUtils

org.springframework.jmx.support
Class JmxUtils

java.lang.Object
    extended by  org.springframework.jmx.support.JmxUtils

public abstract class JmxUtils
extends Object

Collection of generic utility methods to support Spring JMX. Includes a convenient method to locate an MBeanServer.

Since:
1.2
Author:
Rob Harrop, Juergen Hoeller
See Also:
locateMBeanServer()

Field Summary
static String IDENTITY_OBJECT_NAME_KEY
The key used when extending an existing ObjectName with the identity hash code of its corresponding managed resource.
Constructor Summary
JmxUtils()
Method Summary
static ObjectName | appendIdentityToObjectName(ObjectName objectName, Object managedResource) Append an additional key/value pair to an existing ObjectName with the key being the static value identity and the value being the identity hash code of the managed resource being exposed on the supplied ObjectName.
static String | getAttributeName(PropertyDescriptor property, boolean useStrictCasing) Return the JMX attribute name to use for the given JavaBeans property.
static Class<?> | getClassToExpose(Class<?> clazz) Return the class or interface to expose for the given bean class.
static Class<?> | getClassToExpose(Object managedBean) Return the class or interface to expose for the given bean.
static Class<?> | getMBeanInterface(Class<?> clazz) Return the Standard MBean interface for the given class, if any (that is, an interface whose name matches the class name of the given class but with suffix "MBean").
static String[] | getMethodSignature(Method method) Create a String[] representing the argument signature of a method.
static Class<?> | getMXBeanInterface(Class<?> clazz) Return the Java 6 MXBean interface exists for the given class, if any (that is, an interface whose name ends with "MXBean" and/or carries an appropriate MXBean annotation).
static boolean | isMBean(Class<?> clazz) Determine whether the given bean class qualifies as an MBean as-is.
static boolean | isMXBeanSupportAvailable() Check whether MXBean support is available, i.e.
static MBeanServer | locateMBeanServer() Attempt to find a locally running MBeanServer.
static MBeanServer | locateMBeanServer(String agentId) Attempt to find a locally running MBeanServer.
static Class[] | parameterInfoToTypes(MBeanParameterInfo[] paramInfo) Convert an array of MBeanParameterInfo into an array of Class instances corresponding to the parameters.
static Class[] | parameterInfoToTypes(MBeanParameterInfo[] paramInfo, ClassLoader classLoader) Convert an array of MBeanParameterInfo into an array of Class instances corresponding to the parameters.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

IDENTITY_OBJECT_NAME_KEY

public static final String IDENTITY_OBJECT_NAME_KEY
The key used when extending an existing ObjectName with the identity hash code of its corresponding managed resource.

See Also:
Constant Field Values
Constructor Detail

JmxUtils

public JmxUtils()
Method Detail

locateMBeanServer

public static MBeanServer locateMBeanServer()
                                     throws MBeanServerNotFoundException
Attempt to find a locally running MBeanServer. Fails if no MBeanServer can be found. Logs a warning if more than one MBeanServer found, returning the first one from the list.

Returns:
the MBeanServer if found
Throws:
MBeanServerNotFoundException - if no MBeanServer could be found
See Also:
MBeanServerFactory.findMBeanServer(java.lang.String)

locateMBeanServer

public static MBeanServer locateMBeanServer(String agentId)
                                     throws MBeanServerNotFoundException
Attempt to find a locally running MBeanServer. Fails if no MBeanServer can be found. Logs a warning if more than one MBeanServer found, returning the first one from the list.

Parameters:
agentId - the agent identifier of the MBeanServer to retrieve. If this parameter is null, all registered MBeanServers are considered. If the empty String is given, the platform MBeanServer will be returned.
Returns:
the MBeanServer if found
Throws:
MBeanServerNotFoundException - if no MBeanServer could be found
See Also:
MBeanServerFactory.findMBeanServer(String)

parameterInfoToTypes

public static Class[] parameterInfoToTypes(MBeanParameterInfo[] paramInfo)
                                    throws ClassNotFoundException
Convert an array of MBeanParameterInfo into an array of Class instances corresponding to the parameters.

Parameters:
paramInfo - the JMX parameter info
Returns:
the parameter types as classes
Throws:
ClassNotFoundException - if a parameter type could not be resolved

parameterInfoToTypes

public static Class[] parameterInfoToTypes(MBeanParameterInfo[] paramInfo,
                                           ClassLoader classLoader)
                                    throws ClassNotFoundException
Convert an array of MBeanParameterInfo into an array of Class instances corresponding to the parameters.

Parameters:
paramInfo - the JMX parameter info
classLoader - the ClassLoader to use for loading parameter types
Returns:
the parameter types as classes
Throws:
ClassNotFoundException - if a parameter type could not be resolved

getMethodSignature

public static String[] getMethodSignature(Method method)
Create a String[] representing the argument signature of a method. Each element in the array is the fully qualified class name of the corresponding argument in the methods signature.

Parameters:
method - the method to build an argument signature for
Returns:
the signature as array of argument types

getAttributeName

public static String getAttributeName(PropertyDescriptor property,
                                      boolean useStrictCasing)
Return the JMX attribute name to use for the given JavaBeans property.

When using strict casing, a JavaBean property with a getter method such as getFoo() translates to an attribute called Foo. With strict casing disabled, getFoo() would translate to just foo.

Parameters:
property - the JavaBeans property descriptor
useStrictCasing - whether to use strict casing
Returns:
the JMX attribute name to use

appendIdentityToObjectName

public static ObjectName appendIdentityToObjectName(ObjectName objectName,
                                                    Object managedResource)
                                             throws MalformedObjectNameException
Append an additional key/value pair to an existing ObjectName with the key being the static value identity and the value being the identity hash code of the managed resource being exposed on the supplied ObjectName. This can be used to provide a unique ObjectName for each distinct instance of a particular bean or class. Useful when generating ObjectNames at runtime for a set of managed resources based on the template value supplied by a ObjectNamingStrategy.

Parameters:
objectName - the original JMX ObjectName
managedResource - the MBean instance
Returns:
an ObjectName with the MBean identity added
Throws:
MalformedObjectNameException - in case of an invalid object name specification
See Also:
ObjectUtils.getIdentityHexString(Object)

getClassToExpose

public static Class<?> getClassToExpose(Object managedBean)
Return the class or interface to expose for the given bean. This is the class that will be searched for attributes and operations (for example, checked for annotations).

This implementation returns the superclass for a CGLIB proxy and the class of the given bean else (for a JDK proxy or a plain bean class).

Parameters:
managedBean - the bean instance (might be an AOP proxy)
Returns:
the bean class to expose
See Also:
ClassUtils.getUserClass(Object)

getClassToExpose

public static Class<?> getClassToExpose(Class<?> clazz)
Return the class or interface to expose for the given bean class. This is the class that will be searched for attributes and operations (for example, checked for annotations).

This implementation returns the superclass for a CGLIB proxy and the class of the given bean else (for a JDK proxy or a plain bean class).

Parameters:
clazz - the bean class (might be an AOP proxy class)
Returns:
the bean class to expose
See Also:
ClassUtils.getUserClass(Class)

isMBean

public static boolean isMBean(Class<?> clazz)
Determine whether the given bean class qualifies as an MBean as-is.

This implementation checks for DynamicMBean classes as well as classes with corresponding "*MBean" interface (Standard MBeans) or corresponding "*MXBean" interface (Java 6 MXBeans).

Parameters:
clazz - the bean class to analyze
Returns:
whether the class qualifies as an MBean
See Also:
MBeanExporter.isMBean(Class)

getMBeanInterface

public static Class<?> getMBeanInterface(Class<?> clazz)
Return the Standard MBean interface for the given class, if any (that is, an interface whose name matches the class name of the given class but with suffix "MBean").

Parameters:
clazz - the class to check
Returns:
the Standard MBean interface for the given class

getMXBeanInterface

public static Class<?> getMXBeanInterface(Class<?> clazz)
Return the Java 6 MXBean interface exists for the given class, if any (that is, an interface whose name ends with "MXBean" and/or carries an appropriate MXBean annotation).

Parameters:
clazz - the class to check
Returns:
whether there is an MXBean interface for the given class

isMXBeanSupportAvailable

public static boolean isMXBeanSupportAvailable()
Check whether MXBean support is available, i.e. whether we're running on Java 6 or above.

Returns:
true if available; false otherwise
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MBeanRegistrationSupport

org.springframework.jmx.support
Class MBeanRegistrationSupport

java.lang.Object
    extended by  org.springframework.jmx.support.MBeanRegistrationSupport
Direct Known Subclasses:
ConnectorServerFactoryBean, MBeanExporter
public class MBeanRegistrationSupport
extends Object

Provides supporting infrastructure for registering MBeans with an MBeanServer. The behavior when encountering an existing MBean at a given ObjectName is fully configurable allowing for flexible registration settings.

All registered MBeans are tracked and can be unregistered by calling the #unregisterBeans() method.

Sub-classes can receive notifications when an MBean is registered or unregistered by overriding the onRegister(ObjectName) and onUnregister(ObjectName) methods respectively.

By default, the registration process will fail if attempting to register an MBean using a ObjectName that is already used.

By setting the registrationBehaviorName property to REGISTRATION_IGNORE_EXISTING the registration process will simply ignore existing MBeans leaving them registered. This is useful in settings where multiple applications want to share a common MBean in a shared MBeanServer.

Setting registrationBehaviorName property to REGISTRATION_REPLACE_EXISTING will cause existing MBeans to be replaced during registration if necessary. This is useful in situations where you can't guarantee the state of your MBeanServer.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
See Also:
setServer(javax.management.MBeanServer), setRegistrationBehaviorName(java.lang.String), MBeanExporter

Field Summary
protected Log | logger Log instance for this class.
protected Set<ObjectName> | registeredBeans The beans that have been registered by this exporter.
static int | REGISTRATION_FAIL_ON_EXISTING Constant indicating that registration should fail when attempting to register an MBean under a name that already exists.
static int | REGISTRATION_IGNORE_EXISTING Constant indicating that registration should ignore the affected MBean when attempting to register an MBean under a name that already exists.
static int | REGISTRATION_REPLACE_EXISTING Constant indicating that registration should replace the affected MBean when attempting to register an MBean under a name that already exists.
protected MBeanServer | server The MBeanServer instance being used to register beans.
Constructor Summary
MBeanRegistrationSupport()
Method Summary
protected void | doRegister(Object mbean, ObjectName objectName) Actually register the MBean with the server.
protected void | doUnregister(ObjectName objectName) Actually unregister the specified MBean from the server.
protected ObjectName[] | getRegisteredObjectNames() Return the ObjectNames of all registered beans.
MBeanServer | getServer() Return the MBeanServer that the beans will be registered with.
protected void | onRegister(ObjectName objectName) Called when an MBean is registered under the given ObjectName.
protected void | onRegister(ObjectName objectName, Object mbean) Called when an MBean is registered under the given ObjectName.
protected void | onUnregister(ObjectName objectName) Called when an MBean is unregistered under the given ObjectName.
void | setRegistrationBehavior(int registrationBehavior) Specify what action should be taken when attempting to register an MBean under an ObjectName that already exists.
void | setRegistrationBehaviorName(String registrationBehavior) Set the registration behavior by the name of the corresponding constant, e.g.
void | setServer(MBeanServer server) Specify the MBeanServer instance with which all beans should be registered.
protected void | unregisterBeans() Unregisters all beans that have been registered by an instance of this class.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

REGISTRATION_FAIL_ON_EXISTING

public static final int REGISTRATION_FAIL_ON_EXISTING
Constant indicating that registration should fail when attempting to register an MBean under a name that already exists.

This is the default registration behavior.

See Also:
Constant Field Values

REGISTRATION_IGNORE_EXISTING

public static final int REGISTRATION_IGNORE_EXISTING
Constant indicating that registration should ignore the affected MBean when attempting to register an MBean under a name that already exists.

See Also:
Constant Field Values

REGISTRATION_REPLACE_EXISTING

public static final int REGISTRATION_REPLACE_EXISTING
Constant indicating that registration should replace the affected MBean when attempting to register an MBean under a name that already exists.

See Also:
Constant Field Values

logger

protected final Log logger
Log instance for this class.

server

protected MBeanServer server
The MBeanServer instance being used to register beans.

registeredBeans

protected final Set<ObjectName> registeredBeans
The beans that have been registered by this exporter.

Constructor Detail

MBeanRegistrationSupport

public MBeanRegistrationSupport()
Method Detail

setServer

public void setServer(MBeanServer server)
Specify the MBeanServer instance with which all beans should be registered. The MBeanExporter will attempt to locate an existing MBeanServer if none is supplied.

getServer

public final MBeanServer getServer()
Return the MBeanServer that the beans will be registered with.

setRegistrationBehaviorName

public void setRegistrationBehaviorName(String registrationBehavior)
Set the registration behavior by the name of the corresponding constant, e.g. "REGISTRATION_IGNORE_EXISTING".

See Also:
setRegistrationBehavior(int), REGISTRATION_FAIL_ON_EXISTING, REGISTRATION_IGNORE_EXISTING, REGISTRATION_REPLACE_EXISTING

setRegistrationBehavior

public void setRegistrationBehavior(int registrationBehavior)
Specify what action should be taken when attempting to register an MBean under an ObjectName that already exists.

Default is REGISTRATION_FAIL_ON_EXISTING.

See Also:
setRegistrationBehaviorName(String), REGISTRATION_FAIL_ON_EXISTING, REGISTRATION_IGNORE_EXISTING, REGISTRATION_REPLACE_EXISTING

doRegister

protected void doRegister(Object mbean,
                          ObjectName objectName)
                   throws JMException
Actually register the MBean with the server. The behavior when encountering an existing MBean can be configured using the setRegistrationBehavior(int) and setRegistrationBehaviorName(String) methods.

Parameters:
mbean - the MBean instance
objectName - the suggested ObjectName for the MBean
Throws:
JMException - if the registration failed

unregisterBeans

protected void unregisterBeans()
Unregisters all beans that have been registered by an instance of this class.

doUnregister

protected void doUnregister(ObjectName objectName)
Actually unregister the specified MBean from the server.

Parameters:
objectName - the suggested ObjectName for the MBean

getRegisteredObjectNames

protected final ObjectName[] getRegisteredObjectNames()
Return the ObjectNames of all registered beans.

onRegister

protected void onRegister(ObjectName objectName,
                          Object mbean)
Called when an MBean is registered under the given ObjectName. Allows subclasses to perform additional processing when an MBean is registered.

The default implementation delegates to onRegister(ObjectName).

Parameters:
objectName - the actual ObjectName that the MBean was registered with
mbean - the registered MBean instance

onRegister

protected void onRegister(ObjectName objectName)
Called when an MBean is registered under the given ObjectName. Allows subclasses to perform additional processing when an MBean is registered.

The default implementation is empty. Can be overridden in subclasses.

Parameters:
objectName - the actual ObjectName that the MBean was registered with

onUnregister

protected void onUnregister(ObjectName objectName)
Called when an MBean is unregistered under the given ObjectName. Allows subclasses to perform additional processing when an MBean is unregistered.

The default implementation is empty. Can be overridden in subclasses.

Parameters:
objectName - the ObjectName that the MBean was registered with
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MBeanServerConnectionFactoryBean

org.springframework.jmx.support
Class MBeanServerConnectionFactoryBean

java.lang.Object
    extended by  org.springframework.jmx.support.MBeanServerConnectionFactoryBean
All Implemented Interfaces:
BeanClassLoaderAware, DisposableBean, FactoryBean<MBeanServerConnection>, InitializingBean
public class MBeanServerConnectionFactoryBean
extends Object
implements FactoryBean<MBeanServerConnection>, BeanClassLoaderAware, InitializingBean, DisposableBean

FactoryBean that creates a JMX 1.2 MBeanServerConnection to a remote MBeanServer exposed via a JMXServerConnector. Exposes the MBeanServer for bean references.

Since:
1.2
Author:
Rob Harrop, Juergen Hoeller
See Also:
MBeanServerFactoryBean, ConnectorServerFactoryBean, MBeanClientInterceptor.setServer(javax.management.MBeanServerConnection), NotificationListenerRegistrar.setServer(javax.management.MBeanServerConnection)

Constructor Summary
MBeanServerConnectionFactoryBean()
Method Summary
 void afterPropertiesSet()
Creates a JMXConnector for the given settings and exposes the associated MBeanServerConnection.
 void destroy()
Closes the underlying JMXConnector.
 MBeanServerConnection getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<? extends MBeanServerConnection> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setBeanClassLoader(ClassLoader classLoader)
Callback that supplies the bean class loader to a bean instance.
 void setConnectOnStartup(boolean connectOnStartup)
Set whether to connect to the server on startup.
 void setEnvironment(Properties environment)
Set the environment properties used to construct the JMXConnector as java.util.Properties (String key/value pairs).
 void setEnvironmentMap(Map<String,?> environment)
Set the environment properties used to construct the JMXConnector as a Map of String keys and arbitrary Object values.
 void setServiceUrl(String url)
Set the service URL of the remote MBeanServer.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MBeanServerConnectionFactoryBean

public MBeanServerConnectionFactoryBean()
Method Detail

setServiceUrl

public void setServiceUrl(String url)
                   throws MalformedURLException
Set the service URL of the remote MBeanServer.

Throws:
MalformedURLException

setEnvironment

public void setEnvironment(Properties environment)
Set the environment properties used to construct the JMXConnector as java.util.Properties (String key/value pairs).

setEnvironmentMap

public void setEnvironmentMap(Map<String,?> environment)
Set the environment properties used to construct the JMXConnector as a Map of String keys and arbitrary Object values.

setConnectOnStartup

public void setConnectOnStartup(boolean connectOnStartup)
Set whether to connect to the server on startup. Default is "true".

Can be turned off to allow for late start of the JMX server. In this case, the JMX connector will be fetched on first access.

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

afterPropertiesSet

public void afterPropertiesSet()
                        throws IOException
Creates a JMXConnector for the given settings and exposes the associated MBeanServerConnection.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
IOException

getObject

public MBeanServerConnection getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<MBeanServerConnection>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends MBeanServerConnection> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<MBeanServerConnection>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<MBeanServerConnection>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()

destroy

public void destroy()
             throws IOException
Closes the underlying JMXConnector.

Specified by:
destroy in interface DisposableBean
Throws:
IOException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MBeanServerFactoryBean

org.springframework.jmx.support
Class MBeanServerFactoryBean

java.lang.Object
    extended by  org.springframework.jmx.support.MBeanServerFactoryBean
All Implemented Interfaces:
DisposableBean, FactoryBean<MBeanServer>, InitializingBean
public class MBeanServerFactoryBean
extends Object
implements FactoryBean<MBeanServer>, InitializingBean, DisposableBean

FactoryBean that obtains an MBeanServer reference through the standard JMX 1.2 MBeanServerFactory API (which is available on JDK 1.5 or as part of a JMX 1.2 provider). Exposes the MBeanServer for bean references.

By default, MBeanServerFactoryBean will always create a new MBeanServer even if one is already running. To have the MBeanServerFactoryBean attempt to locate a running MBeanServer first, set the value of the "locateExistingServerIfPossible" property to "true".

Since:
1.2
Author:
Rob Harrop, Juergen Hoeller
See Also:
setLocateExistingServerIfPossible(boolean), locateMBeanServer(java.lang.String), MBeanServer, MBeanServerFactory.findMBeanServer(java.lang.String), MBeanServerFactory.createMBeanServer(), MBeanServerFactory.newMBeanServer(), MBeanServerConnectionFactoryBean, ConnectorServerFactoryBean

Field Summary
protected  Log logger
Constructor Summary
MBeanServerFactoryBean()
Method Summary
 void afterPropertiesSet()
Creates the MBeanServer instance.
protected  MBeanServer createMBeanServer(String defaultDomain, boolean registerWithFactory)
Create a new MBeanServer instance and register it with the MBeanServerFactory, if desired.
 void destroy()
Unregisters the MBeanServer instance, if necessary.
 MBeanServer getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<? extends MBeanServer> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
protected  MBeanServer locateMBeanServer(String agentId)
Attempt to locate an existing MBeanServer.
 void setAgentId(String agentId)
Set the agent id of the MBeanServer to locate.
 void setDefaultDomain(String defaultDomain)
Set the default domain to be used by the MBeanServer, to be passed to MBeanServerFactory.createMBeanServer() or MBeanServerFactory.findMBeanServer().
 void setLocateExistingServerIfPossible(boolean locateExistingServerIfPossible)
Set whether or not the MBeanServerFactoryBean should attempt to locate a running MBeanServer before creating one.
 void setRegisterWithFactory(boolean registerWithFactory)
Set whether to register the MBeanServer with the MBeanServerFactory, making it available through MBeanServerFactory.findMBeanServer().
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Constructor Detail

MBeanServerFactoryBean

public MBeanServerFactoryBean()
Method Detail

setLocateExistingServerIfPossible

public void setLocateExistingServerIfPossible(boolean locateExistingServerIfPossible)
Set whether or not the MBeanServerFactoryBean should attempt to locate a running MBeanServer before creating one.

Default is false.

setAgentId

public void setAgentId(String agentId)
Set the agent id of the MBeanServer to locate.

Default is none. If specified, this will result in an automatic attempt being made to locate the attendant MBeanServer, and (importantly) if said MBeanServer cannot be located no attempt will be made to create a new MBeanServer (and an MBeanServerNotFoundException will be thrown at resolution time).

Specifying the empty String indicates the platform MBeanServer.

See Also:
MBeanServerFactory.findMBeanServer(String)

setDefaultDomain

public void setDefaultDomain(String defaultDomain)
Set the default domain to be used by the MBeanServer, to be passed to MBeanServerFactory.createMBeanServer() or MBeanServerFactory.findMBeanServer().

Default is none.

See Also:
MBeanServerFactory.createMBeanServer(String), MBeanServerFactory.findMBeanServer(String)

setRegisterWithFactory

public void setRegisterWithFactory(boolean registerWithFactory)
Set whether to register the MBeanServer with the MBeanServerFactory, making it available through MBeanServerFactory.findMBeanServer().

See Also:
MBeanServerFactory.createMBeanServer(), MBeanServerFactory.findMBeanServer(java.lang.String)

afterPropertiesSet

public void afterPropertiesSet()
                        throws MBeanServerNotFoundException
Creates the MBeanServer instance.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
MBeanServerNotFoundException

locateMBeanServer

protected MBeanServer locateMBeanServer(String agentId)
                                 throws MBeanServerNotFoundException
Attempt to locate an existing MBeanServer. Called if locateExistingServerIfPossible is set to true.

The default implementation attempts to find an MBeanServer using a standard lookup. Subclasses may override to add additional location logic.

Parameters:
agentId - the agent identifier of the MBeanServer to retrieve. If this parameter is null, all registered MBeanServers are considered.
Returns:
the MBeanServer if found
Throws:
MBeanServerNotFoundException - if no MBeanServer could be found
See Also:
setLocateExistingServerIfPossible(boolean), JmxUtils.locateMBeanServer(String), MBeanServerFactory.findMBeanServer(String)

createMBeanServer

protected MBeanServer createMBeanServer(String defaultDomain,
                                        boolean registerWithFactory)
Create a new MBeanServer instance and register it with the MBeanServerFactory, if desired.

Parameters:
defaultDomain - the default domain, or null if none
registerWithFactory - whether to register the MBeanServer with the MBeanServerFactory
See Also:
MBeanServerFactory.createMBeanServer(), MBeanServerFactory.newMBeanServer()

getObject

public MBeanServer getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<MBeanServer>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends MBeanServer> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<MBeanServer>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<MBeanServer>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()

destroy

public void destroy()
Unregisters the MBeanServer instance, if necessary.

Specified by:
destroy in interface DisposableBean
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


NotificationListenerHolder

org.springframework.jmx.support
Class NotificationListenerHolder

java.lang.Object
    extended by  org.springframework.jmx.support.NotificationListenerHolder
Direct Known Subclasses:
NotificationListenerBean, NotificationListenerRegistrar
public class NotificationListenerHolder
extends Object

Helper class that aggregates a NotificationListener, a NotificationFilter, and an arbitrary handback object, as well as the names of MBeans from which the listener wishes to receive Notifications.

Since:
2.5.2
Author:
Juergen Hoeller
See Also:
NotificationListenerBean, NotificationListenerRegistrar

Field Summary
protected  Set<Object> mappedObjectNames
Constructor Summary
NotificationListenerHolder()
Method Summary
boolean | equals(Object other)
Object | getHandback() Return the (arbitrary) object that will be 'handed back' as-is by an NotificationBroadcaster when notifying any NotificationListener.
NotificationFilter | getNotificationFilter() Return the NotificationFilter associated with the encapsulated NotificationFilter.
NotificationListener | getNotificationListener() Get the NotificationListener.
ObjectName[] | getResolvedObjectNames() Return the list of ObjectName String representations for which the encapsulated NotificationFilter will be registered as a listener for Notifications.
int | hashCode()
void | setHandback(Object handback) Set the (arbitrary) object that will be 'handed back' as-is by an NotificationBroadcaster when notifying any NotificationListener.
void | setMappedObjectName(Object mappedObjectName) Set the ObjectName-style name of the single MBean that the encapsulated NotificationFilter will be registered with to listen for Notifications.
void | setMappedObjectNames(Object[] mappedObjectNames) Set an array of ObjectName-style names of the MBeans that the encapsulated NotificationFilter will be registered with to listen for Notifications.
void | setNotificationFilter(NotificationFilter notificationFilter) Set the NotificationFilter associated with the encapsulated NotificationFilter.
void | setNotificationListener(NotificationListener notificationListener) Set the NotificationListener.
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Field Detail

mappedObjectNames

protected Set<Object> mappedObjectNames
Constructor Detail

NotificationListenerHolder

public NotificationListenerHolder()
Method Detail

setNotificationListener

public void setNotificationListener(NotificationListener notificationListener)
Set the NotificationListener.

getNotificationListener

public NotificationListener getNotificationListener()
Get the NotificationListener.

setNotificationFilter

public void setNotificationFilter(NotificationFilter notificationFilter)
Set the NotificationFilter associated with the encapsulated NotificationFilter.

May be null.

getNotificationFilter

public NotificationFilter getNotificationFilter()
Return the NotificationFilter associated with the encapsulated NotificationFilter.

May be null.

setHandback

public void setHandback(Object handback)
Set the (arbitrary) object that will be 'handed back' as-is by an NotificationBroadcaster when notifying any NotificationListener.

Parameters:
handback - the handback object (can be null)
See Also:
NotificationListener.handleNotification(javax.management.Notification, Object)

getHandback

public Object getHandback()
Return the (arbitrary) object that will be 'handed back' as-is by an NotificationBroadcaster when notifying any NotificationListener.

Returns:
the handback object (may be null)
See Also:
NotificationListener.handleNotification(javax.management.Notification, Object)

setMappedObjectName

public void setMappedObjectName(Object mappedObjectName)
Set the ObjectName-style name of the single MBean that the encapsulated NotificationFilter will be registered with to listen for Notifications. Can be specified as ObjectName instance or as String.

See Also:
setMappedObjectNames(java.lang.Object[])

setMappedObjectNames

public void setMappedObjectNames(Object[] mappedObjectNames)
Set an array of ObjectName-style names of the MBeans that the encapsulated NotificationFilter will be registered with to listen for Notifications. Can be specified as ObjectName instances or as Strings.

See Also:
setMappedObjectName(java.lang.Object)

getResolvedObjectNames

public ObjectName[] getResolvedObjectNames()
                                    throws MalformedObjectNameException
Return the list of ObjectName String representations for which the encapsulated NotificationFilter will be registered as a listener for Notifications.

Throws:
MalformedObjectNameException - if an ObjectName is malformed

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ObjectNameManager

org.springframework.jmx.support
Class ObjectNameManager

java.lang.Object
    extended by  org.springframework.jmx.support.ObjectNameManager

public class ObjectNameManager
extends Object

Helper class for the creation of ObjectName instances.

Since:
1.2
Author:
Rob Harrop, Juergen Hoeller
See Also:
ObjectName.getInstance(String)

Constructor Summary
ObjectNameManager()
Method Summary
static ObjectName | getInstance(Object objectName) Retrieve the ObjectName instance corresponding to the supplied name.
static ObjectName | getInstance(String objectName) Retrieve the ObjectName instance corresponding to the supplied name.
static ObjectName | getInstance(String domainName, Hashtable<String,String> properties) Retrieve an ObjectName instance with the specified domain name and the supplied key/name properties.
static ObjectName | getInstance(String domainName, String key, String value) Retrieve an ObjectName instance for the specified domain and a single property with the supplied key and value.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ObjectNameManager

public ObjectNameManager()
Method Detail

getInstance

public static ObjectName getInstance(Object objectName)
                              throws MalformedObjectNameException
Retrieve the ObjectName instance corresponding to the supplied name.

Parameters:
objectName - the ObjectName in ObjectName or String format
Returns:
the ObjectName instance
Throws:
MalformedObjectNameException - in case of an invalid object name specification
See Also:
ObjectName.ObjectName(String), ObjectName.getInstance(String)

getInstance

public static ObjectName getInstance(String objectName)
                              throws MalformedObjectNameException
Retrieve the ObjectName instance corresponding to the supplied name.

Parameters:
objectName - the ObjectName in String format
Returns:
the ObjectName instance
Throws:
MalformedObjectNameException - in case of an invalid object name specification
See Also:
ObjectName.ObjectName(String), ObjectName.getInstance(String)

getInstance

public static ObjectName getInstance(String domainName,
                                     String key,
                                     String value)
                              throws MalformedObjectNameException
Retrieve an ObjectName instance for the specified domain and a single property with the supplied key and value.

Parameters:
domainName - the domain name for the ObjectName
key - the key for the single property in the ObjectName
value - the value for the single property in the ObjectName
Returns:
the ObjectName instance
Throws:
MalformedObjectNameException - in case of an invalid object name specification
See Also:
ObjectName.ObjectName(String, String, String), ObjectName.getInstance(String, String, String)

getInstance

public static ObjectName getInstance(String domainName,
                                     Hashtable<String,String> properties)
                              throws MalformedObjectNameException
Retrieve an ObjectName instance with the specified domain name and the supplied key/name properties.

Parameters:
domainName - the domain name for the ObjectName
properties - the properties for the ObjectName
Returns:
the ObjectName instance
Throws:
MalformedObjectNameException - in case of an invalid object name specification
See Also:
ObjectName.ObjectName(String, java.util.Hashtable), ObjectName.getInstance(String, java.util.Hashtable)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WebSphereMBeanServerFactoryBean

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jmx.support
Class WebSphereMBeanServerFactoryBean

java.lang.Object
    extended by  org.springframework.jmx.support.WebSphereMBeanServerFactoryBean
All Implemented Interfaces:
FactoryBean<MBeanServer>, InitializingBean
public class WebSphereMBeanServerFactoryBean
extends Object
implements FactoryBean<MBeanServer>, InitializingBean

FactoryBean that obtains a WebSphere MBeanServer reference through WebSphere's proprietary AdminServiceFactory API, available on WebSphere 5.1 and higher.

Exposes the MBeanServer for bean references. This FactoryBean is a direct alternative to MBeanServerFactoryBean, which uses standard JMX 1.2 API to access the platform's MBeanServer.

Since:
2.0.3
Author:
Juergen Hoeller, Rob Harrop
See Also:
com.ibm.websphere.management.AdminServiceFactory#getMBeanFactory(), com.ibm.websphere.management.MBeanFactory#getMBeanServer(), MBeanServer, MBeanServerFactoryBean

Constructor Summary
WebSphereMBeanServerFactoryBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 MBeanServer getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<? extends MBeanServer> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

WebSphereMBeanServerFactoryBean

public WebSphereMBeanServerFactoryBean()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws MBeanServerNotFoundException
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
MBeanServerNotFoundException

getObject

public MBeanServer getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<MBeanServer>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends MBeanServer> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<MBeanServer>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<MBeanServer>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


MetricType

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

org.springframework.jmx.support
Enum MetricType

java.lang.Object
    extended by  java.lang.Enum<MetricType>
        extended by  org.springframework.jmx.support.MetricType
All Implemented Interfaces:
Serializable, Comparable<MetricType>
public enum MetricType
extends Enum<MetricType>

Represents how the measurement values of a ManagedMetric will change over time

Since:
3.0
Author:
Jennifer Hickey

Enum Constant Summary
COUNTER
The measurement values will always increase
GAUGE
The measurement values may go up or down over time
Method Summary
static MetricType | valueOf(String name) Returns the enum constant of this type with the specified name.
static MetricType[] | values() Returns an array containing the constants of this enum type, in the order they are declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

GAUGE

public static final MetricType GAUGE
The measurement values may go up or down over time

COUNTER

public static final MetricType COUNTER
The measurement values will always increase

Method Detail

values

public static MetricType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (MetricType c : MetricType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static MetricType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


org.springframework.jndi

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jndi

The classes in this package make JNDI easier to use, facilitating the accessing of configuration stored in JNDI, and provide useful superclasses for JNDI access classes.

See:
Description

Interface Summary
JndiCallback<T> Callback interface to be implemented by classes that need to perform an operation (such as a lookup) in a JNDI context.

Class Summary
JndiAccessor | Convenient superclass for JNDI accessors, providing "jndiTemplate" and "jndiEnvironment" bean properties.
JndiLocatorDelegate | JndiLocatorSupport subclass with public lookup methods, for convenient use as a delegate.
JndiLocatorSupport | Convenient superclass for classes that can locate any number of JNDI objects.
JndiObjectFactoryBean | FactoryBean that looks up a JNDI object.
JndiObjectLocator | Convenient superclass for JNDI-based service locators, providing configurable lookup of a specific JNDI resource.
JndiObjectTargetSource | AOP TargetSource that provides configurable JNDI lookups for getTarget() calls.
JndiTemplate | Helper class that simplifies JNDI operations.
JndiTemplateEditor | Properties editor for JndiTemplate objects.

Exception Summary
JndiLookupFailureException | RuntimeException to be thrown in case of JNDI lookup failures, in particular from code that does not declare JNDI's checked NamingException: for example, from Spring's JndiObjectTargetSource.
TypeMismatchNamingException | Exception thrown if a type mismatch is encountered for an object located in a JNDI environment.

Package org.springframework.jndi Description

The classes in this package make JNDI easier to use, facilitating the accessing of configuration stored in JNDI, and provide useful superclasses for JNDI access classes.

The classes in this package are discussed in Chapter 11 of Expert One-On-One J2EE Design and Development by Rod Johnson (Wrox, 2002).


org.springframework.jndi Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jndi

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jndi.JndiAccessor
      • org.springframework.jndi.JndiLocatorSupport
        • org.springframework.jndi.JndiLocatorDelegate
        • org.springframework.jndi.JndiObjectLocator (implements org.springframework.beans.factory.InitializingBean)
          • org.springframework.jndi.JndiObjectFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.FactoryBean<T>)
          • org.springframework.jndi.JndiObjectTargetSource (implements org.springframework.aop.TargetSource)
    • org.springframework.jndi.JndiTemplate
    • java.beans.PropertyEditorSupport (implements java.beans.PropertyEditor)
      • org.springframework.jndi.JndiTemplateEditor
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • javax.naming.NamingException
          • org.springframework.jndi.TypeMismatchNamingException
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.jndi.JndiLookupFailureException

Interface Hierarchy

  • org.springframework.jndi.JndiCallback<T>


JndiCallback

org.springframework.jndi
Interface JndiCallback<T>

public interface JndiCallback<T>

Callback interface to be implemented by classes that need to perform an operation (such as a lookup) in a JNDI context. This callback approach is valuable in simplifying error handling, which is performed by the JndiTemplate class. This is a similar to JdbcTemplate's approach.

Note that there is hardly any need to implement this callback interface, as JndiTemplate provides all usual JNDI operations via convenience methods.

Author:
Rod Johnson
See Also:
JndiTemplate, JdbcTemplate

Method Summary
 T doInContext(Context ctx)
Do something with the given JNDI context.

Method Detail

doInContext

T doInContext(Context ctx)
              throws NamingException
Do something with the given JNDI context.

Implementations don't need to worry about error handling or cleanup, as the JndiTemplate class will handle this.

Parameters:
ctx - the current JNDI context
Returns:
a result object, or null
Throws:
NamingException - if thrown by JNDI methods
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JndiAccessor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jndi
Class JndiAccessor

java.lang.Object
    extended by  org.springframework.jndi.JndiAccessor
Direct Known Subclasses:
JndiLocatorSupport
public class JndiAccessor
extends Object

Convenient superclass for JNDI accessors, providing "jndiTemplate" and "jndiEnvironment" bean properties.

Since:
1.1
Author:
Juergen Hoeller
See Also:
setJndiTemplate(org.springframework.jndi.JndiTemplate), setJndiEnvironment(java.util.Properties)

Field Summary
protected  Log logger
Logger, available to subclasses.
Constructor Summary
JndiAccessor()
Method Summary
Properties | getJndiEnvironment() Return the JNDI environment to use for JNDI lookups.
JndiTemplate | getJndiTemplate() Return the JNDI template to use for JNDI lookups.
void | setJndiEnvironment(Properties jndiEnvironment) Set the JNDI environment to use for JNDI lookups.
void | setJndiTemplate(JndiTemplate jndiTemplate) Set the JNDI template to use for JNDI lookups.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger, available to subclasses.

Constructor Detail

JndiAccessor

public JndiAccessor()
Method Detail

setJndiTemplate

public void setJndiTemplate(JndiTemplate jndiTemplate)
Set the JNDI template to use for JNDI lookups.

You can also specify JNDI environment settings via "jndiEnvironment".

See Also:
setJndiEnvironment(java.util.Properties)

getJndiTemplate

public JndiTemplate getJndiTemplate()
Return the JNDI template to use for JNDI lookups.

setJndiEnvironment

public void setJndiEnvironment(Properties jndiEnvironment)
Set the JNDI environment to use for JNDI lookups.

Creates a JndiTemplate with the given environment settings.

See Also:
setJndiTemplate(org.springframework.jndi.JndiTemplate)

getJndiEnvironment

public Properties getJndiEnvironment()
Return the JNDI environment to use for JNDI lookups.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


JndiLocatorDelegate

org.springframework.jndi
Class JndiLocatorDelegate

java.lang.Object
    extended by  org.springframework.jndi.JndiAccessor
        extended by  org.springframework.jndi.JndiLocatorSupport
            extended by  org.springframework.jndi.JndiLocatorDelegate

public class JndiLocatorDelegate
extends JndiLocatorSupport

JndiLocatorSupport subclass with public lookup methods, for convenient use as a delegate.

Since:
3.0.1
Author:
Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.jndi.JndiLocatorSupport
CONTAINER_PREFIX
Fields inherited from class org.springframework.jndi.JndiAccessor
logger
Constructor Summary
JndiLocatorDelegate()
Method Summary
 Object lookup(String jndiName)
Perform an actual JNDI lookup for the given name via the JndiTemplate.
<T> T
lookup(String jndiName, Class<T> requiredType)
Perform an actual JNDI lookup for the given name via the JndiTemplate.
Methods inherited from class org.springframework.jndi.JndiLocatorSupport
convertJndiName, isResourceRef, setResourceRef
Methods inherited from class org.springframework.jndi.JndiAccessor
getJndiEnvironment, getJndiTemplate, setJndiEnvironment, setJndiTemplate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JndiLocatorDelegate

public JndiLocatorDelegate()
Method Detail

lookup

public Object lookup(String jndiName)
              throws NamingException
Description copied from class: JndiLocatorSupport
Perform an actual JNDI lookup for the given name via the JndiTemplate.

If the name doesn't begin with "java:comp/env/", this prefix is added if "resourceRef" is set to "true".

Overrides:
lookup in class JndiLocatorSupport
Parameters:
jndiName - the JNDI name to look up
Returns:
the obtained object
Throws:
NamingException - if the JNDI lookup failed
See Also:
JndiLocatorSupport.setResourceRef(boolean)

lookup

public <T> T lookup(String jndiName,
                    Class<T> requiredType)
         throws NamingException
Description copied from class: JndiLocatorSupport
Perform an actual JNDI lookup for the given name via the JndiTemplate.

If the name doesn't begin with "java:comp/env/", this prefix is added if "resourceRef" is set to "true".

Overrides:
lookup in class JndiLocatorSupport
Parameters:
jndiName - the JNDI name to look up
requiredType - the required type of the object
Returns:
the obtained object
Throws:
NamingException - if the JNDI lookup failed
See Also:
JndiLocatorSupport.setResourceRef(boolean)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JndiLocatorSupport

org.springframework.jndi
Class JndiLocatorSupport

java.lang.Object
    extended by  org.springframework.jndi.JndiAccessor
        extended by  org.springframework.jndi.JndiLocatorSupport
Direct Known Subclasses:
ContextJndiBeanFactoryLocator, JndiDataSourceLookup, JndiDestinationResolver, JndiLocatorDelegate, JndiObjectLocator, SimpleJndiBeanFactory, TimerManagerAccessor, WorkManagerTaskExecutor, WorkManagerTaskExecutor
public abstract class JndiLocatorSupport
extends JndiAccessor

Convenient superclass for classes that can locate any number of JNDI objects. Derives from JndiAccessor to inherit the "jndiTemplate" and "jndiEnvironment" bean properties.

JNDI names may or may not include the "java:comp/env/" prefix expected by J2EE applications when accessing a locally mapped (ENC - Environmental Naming Context) resource. If it doesn't, the "java:comp/env/" prefix will be prepended if the "resourceRef" property is true (the default is false) and no other scheme (e.g. "java:") is given.

Since:
1.1
Author:
Juergen Hoeller
See Also:
JndiAccessor.setJndiTemplate(org.springframework.jndi.JndiTemplate),
JndiAccessor.setJndiEnvironment(java.util.Properties),
setResourceRef(boolean)

Field Summary
static String CONTAINER_PREFIX
JNDI prefix used in a J2EE container
Fields inherited from class org.springframework.jndi.JndiAccessor
logger
Constructor Summary
JndiLocatorSupport()
Method Summary
protected  String convertJndiName(String jndiName)
Convert the given JNDI name into the actual JNDI name to use.
 boolean isResourceRef()
Return whether the lookup occurs in a J2EE container.
protected  Object lookup(String jndiName)
Perform an actual JNDI lookup for the given name via the JndiTemplate.
protected
<T> T
lookup(String jndiName, Class<T> requiredType)
Perform an actual JNDI lookup for the given name via the JndiTemplate.
 void setResourceRef(boolean resourceRef)
Set whether the lookup occurs in a J2EE container, i.e.
Methods inherited from class org.springframework.jndi.JndiAccessor
getJndiEnvironment, getJndiTemplate, setJndiEnvironment, setJndiTemplate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

CONTAINER_PREFIX

public static final String CONTAINER_PREFIX
JNDI prefix used in a J2EE container

See Also:
Constant Field Values
Constructor Detail

JndiLocatorSupport

public JndiLocatorSupport()
Method Detail

setResourceRef

public void setResourceRef(boolean resourceRef)
Set whether the lookup occurs in a J2EE container, i.e. if the prefix "java:comp/env/" needs to be added if the JNDI name doesn't already contain it. Default is "false".

Note: Will only get applied if no other scheme (e.g. "java:") is given.

isResourceRef

public boolean isResourceRef()
Return whether the lookup occurs in a J2EE container.

lookup

protected Object lookup(String jndiName)
                 throws NamingException
Perform an actual JNDI lookup for the given name via the JndiTemplate.

If the name doesn't begin with "java:comp/env/", this prefix is added if "resourceRef" is set to "true".

Parameters:
jndiName - the JNDI name to look up
Returns:
the obtained object
Throws:
NamingException - if the JNDI lookup failed
See Also:
setResourceRef(boolean)

lookup

protected <T> T lookup(String jndiName,
                       Class<T> requiredType)
            throws NamingException
Perform an actual JNDI lookup for the given name via the JndiTemplate.

If the name doesn't begin with "java:comp/env/", this prefix is added if "resourceRef" is set to "true".

Parameters:
jndiName - the JNDI name to look up
requiredType - the required type of the object
Returns:
the obtained object
Throws:
NamingException - if the JNDI lookup failed
See Also:
setResourceRef(boolean)

convertJndiName

protected String convertJndiName(String jndiName)
Convert the given JNDI name into the actual JNDI name to use.

The default implementation applies the "java:comp/env/" prefix if "resourceRef" is "true" and no other scheme (e.g. "java:") is given.

Parameters:
jndiName - the original JNDI name
Returns:
the JNDI name to use
See Also:
CONTAINER_PREFIX, setResourceRef(boolean)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JndiObjectFactoryBean

org.springframework.jndi
Class JndiObjectFactoryBean

java.lang.Object
    extended by  org.springframework.jndi.JndiAccessor
        extended by  org.springframework.jndi.JndiLocatorSupport
            extended by  org.springframework.jndi.JndiObjectLocator
                extended by  org.springframework.jndi.JndiObjectFactoryBean
All Implemented Interfaces:
BeanClassLoaderAware, FactoryBean<Object>, InitializingBean
public class JndiObjectFactoryBean
extends JndiObjectLocator
implements FactoryBean<Object>, BeanClassLoaderAware

FactoryBean that looks up a JNDI object. Exposes the object found in JNDI for bean references, e.g. for data access object's "dataSource" property in case of a DataSource.

The typical usage will be to register this as singleton factory (e.g. for a certain JNDI-bound DataSource) in an application context, and give bean references to application services that need it.

The default behavior is to look up the JNDI object on startup and cache it. This can be customized through the "lookupOnStartup" and "cache" properties, using a JndiObjectTargetSource underneath. Note that you need to specify a "proxyInterface" in such a scenario, since the actual JNDI object type is not known in advance.

Of course, bean classes in a Spring environment may lookup e.g. a DataSource from JNDI themselves. This class simply enables central configuration of the JNDI name, and easy switching to non-JNDI alternatives. The latter is particularly convenient for test setups, reuse in standalone clients, etc.

Note that switching to e.g. DriverManagerDataSource is just a matter of configuration: Simply replace the definition of this FactoryBean with a DriverManagerDataSource definition!

Since:
22.05.2003
Author:
Juergen Hoeller
See Also:
setProxyInterface(java.lang.Class), setLookupOnStartup(boolean), setCache(boolean), JndiObjectTargetSource

Field Summary
Fields inherited from class org.springframework.jndi.JndiLocatorSupport
CONTAINER_PREFIX
Fields inherited from class org.springframework.jndi.JndiAccessor
logger
Constructor Summary
JndiObjectFactoryBean()
Method Summary
 void afterPropertiesSet()
Look up the JNDI object and store it.
protected  Class createCompositeInterface(Class[] interfaces)
Create a composite interface Class for the given interfaces, implementing the given interfaces in one single Class.
 Object getObject()
Return the singleton JNDI object.
 Class<?> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
protected  Object lookupWithFallback()
Lookup variant that that returns the specified "defaultObject" (if any) in case of lookup failure.
 void setBeanClassLoader(ClassLoader classLoader)
Callback that supplies the bean class loader to a bean instance.
 void setCache(boolean cache)
Set whether to cache the JNDI object once it has been located.
 void setDefaultObject(Object defaultObject)
Specify a default object to fall back to if the JNDI lookup fails.
 void setExposeAccessContext(boolean exposeAccessContext)
Set whether to expose the JNDI environment context for all access to the target object, i.e.
 void setLookupOnStartup(boolean lookupOnStartup)
Set whether to look up the JNDI object on startup.
 void setProxyInterface(Class proxyInterface)
Specify the proxy interface to use for the JNDI object.
 void setProxyInterfaces(Class[] proxyInterfaces)
Specify multiple proxy interfaces to use for the JNDI object.
Methods inherited from class org.springframework.jndi.JndiObjectLocator
getExpectedType, getJndiName, lookup, setExpectedType, setJndiName
Methods inherited from class org.springframework.jndi.JndiLocatorSupport
convertJndiName, isResourceRef, lookup, lookup, setResourceRef
Methods inherited from class org.springframework.jndi.JndiAccessor
getJndiEnvironment, getJndiTemplate, setJndiEnvironment, setJndiTemplate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JndiObjectFactoryBean

public JndiObjectFactoryBean()
Method Detail

setProxyInterface

public void setProxyInterface(Class proxyInterface)
Specify the proxy interface to use for the JNDI object.

Typically used in conjunction with "lookupOnStartup"=false and/or "cache"=false. Needs to be specified because the actual JNDI object type is not known in advance in case of a lazy lookup.

See Also:
setProxyInterfaces(java.lang.Class[]), setLookupOnStartup(boolean), setCache(boolean)

setProxyInterfaces

public void setProxyInterfaces(Class[] proxyInterfaces)
Specify multiple proxy interfaces to use for the JNDI object.

Typically used in conjunction with "lookupOnStartup"=false and/or "cache"=false. Note that proxy interfaces will be autodetected from a specified "expectedType", if necessary.

See Also:
JndiObjectLocator.setExpectedType(java.lang.Class), setLookupOnStartup(boolean), setCache(boolean)

setLookupOnStartup

public void setLookupOnStartup(boolean lookupOnStartup)
Set whether to look up the JNDI object on startup. Default is "true".

Can be turned off to allow for late availability of the JNDI object. In this case, the JNDI object will be fetched on first access.

For a lazy lookup, a proxy interface needs to be specified.

See Also:
setProxyInterface(java.lang.Class), setCache(boolean)

setCache

public void setCache(boolean cache)
Set whether to cache the JNDI object once it has been located. Default is "true".

Can be turned off to allow for hot redeployment of JNDI objects. In this case, the JNDI object will be fetched for each invocation.

For hot redeployment, a proxy interface needs to be specified.

See Also:
setProxyInterface(java.lang.Class), setLookupOnStartup(boolean)

setExposeAccessContext

public void setExposeAccessContext(boolean exposeAccessContext)
Set whether to expose the JNDI environment context for all access to the target object, i.e. for all method invocations on the exposed object reference.

Default is "false", i.e. to only expose the JNDI context for object lookup. Switch this flag to "true" in order to expose the JNDI environment (including the authorization context) for each method invocation, as needed by WebLogic for JNDI-obtained factories (e.g. JDBC DataSource, JMS ConnectionFactory) with authorization requirements.

setDefaultObject

public void setDefaultObject(Object defaultObject)
Specify a default object to fall back to if the JNDI lookup fails. Default is none.

This can be an arbitrary bean reference or literal value. It is typically used for literal values in scenarios where the JNDI environment might define specific config settings but those are not required to be present.

Note: This is only supported for lookup on startup.

See Also:
setLookupOnStartup(boolean)

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

afterPropertiesSet

public void afterPropertiesSet()
                        throws IllegalArgumentException,
                               NamingException
Look up the JNDI object and store it.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class JndiObjectLocator
Throws:
IllegalArgumentException
NamingException

lookupWithFallback

protected Object lookupWithFallback()
                             throws NamingException
Lookup variant that that returns the specified "defaultObject" (if any) in case of lookup failure.

Returns:
the located object, or the "defaultObject" as fallback
Throws:
NamingException - in case of lookup failure without fallback
See Also:
setDefaultObject(java.lang.Object)

getObject

public Object getObject()
Return the singleton JNDI object.

Specified by:
getObject in interface FactoryBean<Object>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<?> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<Object>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<Object>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()

createCompositeInterface

protected Class createCompositeInterface(Class[] interfaces)
Create a composite interface Class for the given interfaces, implementing the given interfaces in one single Class.

The default implementation builds a JDK proxy class for the given interfaces.

Parameters:
interfaces - the interfaces to merge
Returns:
the merged interface as Class
See Also:
Proxy.getProxyClass(java.lang.ClassLoader, java.lang.Class...)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JndiObjectLocator

org.springframework.jndi
Class JndiObjectLocator

java.lang.Object
    extended by  org.springframework.jndi.JndiAccessor
        extended by  org.springframework.jndi.JndiLocatorSupport
            extended by  org.springframework.jndi.JndiObjectLocator
All Implemented Interfaces:
InitializingBean
Direct Known Subclasses:
AbstractSlsbInvokerInterceptor, JndiObjectFactoryBean, JndiObjectTargetSource, JndiRmiClientInterceptor
public abstract class JndiObjectLocator
extends JndiLocatorSupport
implements InitializingBean

Convenient superclass for JNDI-based service locators, providing configurable lookup of a specific JNDI resource.

Exposes a "jndiName" property. This may or may not include the "java:comp/env/" prefix expected by J2EE applications when accessing a locally mapped (Environmental Naming Context) resource. If it doesn't, the "java:comp/env/" prefix will be prepended if the "resourceRef" property is true (the default is false) and no other scheme (e.g. "java:") is given.

Subclasses may invoke the lookup() method whenever it is appropriate. Some classes might do this on initialization, while others might do it on demand. The latter strategy is more flexible in that it allows for initialization of the locator before the JNDI object is available.

Since:
1.1
Author:
Juergen Hoeller
See Also:
setJndiName(java.lang.String),
JndiAccessor.setJndiTemplate(org.springframework.jndi.JndiTemplate),
JndiAccessor.setJndiEnvironment(java.util.Properties),
JndiLocatorSupport.setResourceRef(boolean),
lookup()

Field Summary
Fields inherited from class org.springframework.jndi.JndiLocatorSupport
CONTAINER_PREFIX
Fields inherited from class org.springframework.jndi.JndiAccessor
logger
Constructor Summary
JndiObjectLocator()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
Class | getExpectedType() Return the type that the located JNDI object is supposed to be assignable to, if any.
String | getJndiName() Return the JNDI name to look up.
protected Object | lookup() Perform the actual JNDI lookup for this locator's target resource.
void | setExpectedType(Class expectedType) Specify the type that the located JNDI object is supposed to be assignable to, if any.
void | setJndiName(String jndiName) Specify the JNDI name to look up.
Methods inherited from class org.springframework.jndi.JndiLocatorSupport
convertJndiName, isResourceRef, lookup, lookup, setResourceRef
Methods inherited from class org.springframework.jndi.JndiAccessor
getJndiEnvironment, getJndiTemplate, setJndiEnvironment, setJndiTemplate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JndiObjectLocator

public JndiObjectLocator()
Method Detail

setJndiName

public void setJndiName(String jndiName)
Specify the JNDI name to look up. If it doesn't begin with "java:comp/env/" this prefix is added automatically if "resourceRef" is set to "true".

Parameters:
jndiName - the JNDI name to look up
See Also:
JndiLocatorSupport.setResourceRef(boolean)

getJndiName

public String getJndiName()
Return the JNDI name to look up.

setExpectedType

public void setExpectedType(Class expectedType)
Specify the type that the located JNDI object is supposed to be assignable to, if any.

getExpectedType

public Class getExpectedType()
Return the type that the located JNDI object is supposed to be assignable to, if any.

afterPropertiesSet

public void afterPropertiesSet()
                        throws IllegalArgumentException,
                               NamingException
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
IllegalArgumentException
NamingException

lookup

protected Object lookup()
                 throws NamingException
Perform the actual JNDI lookup for this locator's target resource.

Returns:
the located target object
Throws:
NamingException - if the JNDI lookup failed or if the located JNDI object is not assigable to the expected type
See Also:
setJndiName(java.lang.String),
setExpectedType(java.lang.Class),
JndiLocatorSupport.lookup(String, Class)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JndiObjectTargetSource

org.springframework.jndi
Class JndiObjectTargetSource

java.lang.Object
    extended by  org.springframework.jndi.JndiAccessor
        extended by  org.springframework.jndi.JndiLocatorSupport
            extended by  org.springframework.jndi.JndiObjectLocator
                extended by  org.springframework.jndi.JndiObjectTargetSource
All Implemented Interfaces:
TargetClassAware, TargetSource, InitializingBean
public class JndiObjectTargetSource
extends JndiObjectLocator
implements TargetSource

AOP TargetSource that provides configurable JNDI lookups for getTarget() calls.

Can be used as alternative to JndiObjectFactoryBean, to allow for relocating a JNDI object lazily or for each operation (see "lookupOnStartup" and "cache" properties). This is particularly useful during development, as it allows for hot restarting of the JNDI server (for example, a remote JMS server).

Example:

 <bean id="queueConnectionFactoryTarget" class="org.springframework.jndi.JndiObjectTargetSource">
   <property name="jndiName" value="JmsQueueConnectionFactory"/>
   <property name="lookupOnStartup" value="false"/>
 </bean>

 <bean id="queueConnectionFactory" class="org.springframework.aop.framework.ProxyFactoryBean">
   <property name="proxyInterfaces" value="javax.jms.QueueConnectionFactory"/>
   <property name="targetSource" ref="queueConnectionFactoryTarget"/>
 </bean>
A createQueueConnection call on the "queueConnectionFactory" proxy will cause a lazy JNDI lookup for "JmsQueueConnectionFactory" and a subsequent delegating call to the retrieved QueueConnectionFactory's createQueueConnection.

Alternatively, use a JndiObjectFactoryBean with a "proxyInterface". "lookupOnStartup" and "cache" can then be specified on the JndiObjectFactoryBean, creating a JndiObjectTargetSource underneath (instead of defining separate ProxyFactoryBean and JndiObjectTargetSource beans).

Since:
1.1
Author:
Juergen Hoeller
See Also:
setLookupOnStartup(boolean), setCache(boolean), AdvisedSupport.setTargetSource(org.springframework.aop.TargetSource), JndiObjectFactoryBean.setProxyInterface(java.lang.Class)

Field Summary
Fields inherited from class org.springframework.jndi.JndiLocatorSupport
CONTAINER_PREFIX
Fields inherited from class org.springframework.jndi.JndiAccessor
logger
Constructor Summary
JndiObjectTargetSource()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 Object getTarget()
Return a target instance.
 Class getTargetClass()
Return the type of targets returned by this TargetSource.
 boolean isStatic()
Will all calls to TargetSource.getTarget() return the same object?
 void releaseTarget(Object target)
Release the given target object obtained from the TargetSource.getTarget() method.
 void setCache(boolean cache)
Set whether to cache the JNDI object once it has been located.
 void setLookupOnStartup(boolean lookupOnStartup)
Set whether to look up the JNDI object on startup.
Methods inherited from class org.springframework.jndi.JndiObjectLocator
getExpectedType, getJndiName, lookup, setExpectedType, setJndiName
Methods inherited from class org.springframework.jndi.JndiLocatorSupport
convertJndiName, isResourceRef, lookup, lookup, setResourceRef
Methods inherited from class org.springframework.jndi.JndiAccessor
getJndiEnvironment, getJndiTemplate, setJndiEnvironment, setJndiTemplate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JndiObjectTargetSource

public JndiObjectTargetSource()
Method Detail

setLookupOnStartup

public void setLookupOnStartup(boolean lookupOnStartup)
Set whether to look up the JNDI object on startup. Default is "true".

Can be turned off to allow for late availability of the JNDI object. In this case, the JNDI object will be fetched on first access.

See Also:
setCache(boolean)

setCache

public void setCache(boolean cache)
Set whether to cache the JNDI object once it has been located. Default is "true".

Can be turned off to allow for hot redeployment of JNDI objects. In this case, the JNDI object will be fetched for each invocation.

See Also:
setLookupOnStartup(boolean)

afterPropertiesSet

public void afterPropertiesSet()
                        throws NamingException
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class JndiObjectLocator
Throws:
NamingException

getTargetClass

public Class getTargetClass()
Description copied from interface: TargetSource
Return the type of targets returned by this TargetSource.

Can return null, although certain usages of a TargetSource might just work with a predetermined target class.

Specified by:
getTargetClass in interface TargetClassAware
Specified by:
getTargetClass in interface TargetSource
Returns:
the type of targets returned by this TargetSource

isStatic

public boolean isStatic()
Description copied from interface: TargetSource
Will all calls to TargetSource.getTarget() return the same object?

In that case, there will be no need to invoke TargetSource.releaseTarget(Object), and the AOP framework can cache the return value of TargetSource.getTarget().

Specified by:
isStatic in interface TargetSource
Returns:
true if the target is immutable
See Also:
TargetSource.getTarget()

getTarget

public Object getTarget()
Description copied from interface: TargetSource
Return a target instance. Invoked immediately before the AOP framework calls the "target" of an AOP method invocation.

Specified by:
getTarget in interface TargetSource
Returns:
the target object, which contains the joinpoint

releaseTarget

public void releaseTarget(Object target)
Description copied from interface: TargetSource
Release the given target object obtained from the TargetSource.getTarget() method.

Specified by:
releaseTarget in interface TargetSource
Parameters:
target - object obtained from a call to TargetSource.getTarget()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JndiTemplate

org.springframework.jndi
Class JndiTemplate

java.lang.Object
    extended by  org.springframework.jndi.JndiTemplate
Direct Known Subclasses:
ExpectedLookupTemplate
public class JndiTemplate
extends Object

Helper class that simplifies JNDI operations. It provides methods to lookup and bind objects, and allows implementations of the JndiCallback interface to perform any operation they like with a JNDI naming context provided.

Author:
Rod Johnson, Juergen Hoeller
See Also:
JndiCallback, execute(org.springframework.jndi.JndiCallback)

Field Summary
protected  Log logger
Constructor Summary
JndiTemplate()
Create a new JndiTemplate instance.
JndiTemplate(Properties environment)
Create a new JndiTemplate instance, using the given environment.
Method Summary
 void bind(String name, Object object)
Bind the given object to the current JNDI context, using the given name.
protected  Context createInitialContext()
Create a new JNDI initial context.
<T> T
execute(JndiCallback<T> contextCallback)
Execute the given JNDI context callback implementation.
 Context getContext()
Obtain a JNDI context corresponding to this template's configuration.
 Properties getEnvironment()
Return the environment for the JNDI InitialContext, if any.
 Object lookup(String name)
Look up the object with the given name in the current JNDI context.
<T> T
lookup(String name, Class<T> requiredType)
Look up the object with the given name in the current JNDI context.
 void rebind(String name, Object object)
Rebind the given object to the current JNDI context, using the given name.
 void releaseContext(Context ctx)
Release a JNDI context as obtained from getContext().
 void setEnvironment(Properties environment)
Set the environment for the JNDI InitialContext.
 void unbind(String name)
Remove the binding for the given name from the current JNDI context.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Constructor Detail

JndiTemplate

public JndiTemplate()
Create a new JndiTemplate instance.

JndiTemplate

public JndiTemplate(Properties environment)
Create a new JndiTemplate instance, using the given environment.

Method Detail

setEnvironment

public void setEnvironment(Properties environment)
Set the environment for the JNDI InitialContext.

getEnvironment

public Properties getEnvironment()
Return the environment for the JNDI InitialContext, if any.

execute

public <T> T execute(JndiCallback<T> contextCallback)
          throws NamingException
Execute the given JNDI context callback implementation.

Parameters:
contextCallback - JndiCallback implementation
Returns:
a result object returned by the callback, or null
Throws:
NamingException - thrown by the callback implementation
See Also:
createInitialContext()

getContext

public Context getContext()
                   throws NamingException
Obtain a JNDI context corresponding to this template's configuration. Called by execute(org.springframework.jndi.JndiCallback); may also be called directly.

The default implementation delegates to createInitialContext().

Returns:
the JNDI context (never null)
Throws:
NamingException - if context retrieval failed
See Also:
releaseContext(javax.naming.Context)

releaseContext

public void releaseContext(Context ctx)
Release a JNDI context as obtained from getContext().

Parameters:
ctx - the JNDI context to release (may be null)
See Also:
getContext()

createInitialContext

protected Context createInitialContext()
                                throws NamingException
Create a new JNDI initial context. Invoked by getContext().

The default implementation use this template's environment settings. Can be subclassed for custom contexts, e.g. for testing.

Returns:
the initial Context instance
Throws:
NamingException - in case of initialization errors

lookup

public Object lookup(String name)
              throws NamingException
Look up the object with the given name in the current JNDI context.

Parameters:
name - the JNDI name of the object
Returns:
object found (cannot be null; if a not so well-behaved JNDI implementations returns null, a NamingException gets thrown)
Throws:
NamingException - if there is no object with the given name bound to JNDI

lookup

public <T> T lookup(String name,
                    Class<T> requiredType)
         throws NamingException
Look up the object with the given name in the current JNDI context.

Parameters:
name - the JNDI name of the object
requiredType - type the JNDI object must match. Can be an interface or superclass of the actual class, or null for any match. For example, if the value is Object.class, this method will succeed whatever the class of the returned instance.
Returns:
object found (cannot be null; if a not so well-behaved JNDI implementations returns null, a NamingException gets thrown)
Throws:
NamingException - if there is no object with the given name bound to JNDI

bind

public void bind(String name,
                 Object object)
          throws NamingException
Bind the given object to the current JNDI context, using the given name.

Parameters:
name - the JNDI name of the object
object - the object to bind
Throws:
NamingException - thrown by JNDI, mostly name already bound

rebind

public void rebind(String name,
                   Object object)
            throws NamingException
Rebind the given object to the current JNDI context, using the given name. Overwrites any existing binding.

Parameters:
name - the JNDI name of the object
object - the object to rebind
Throws:
NamingException - thrown by JNDI

unbind

public void unbind(String name)
            throws NamingException
Remove the binding for the given name from the current JNDI context.

Parameters:
name - the JNDI name of the object
Throws:
NamingException - thrown by JNDI, mostly name not found
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JndiTemplateEditor

org.springframework.jndi
Class JndiTemplateEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.jndi.JndiTemplateEditor
All Implemented Interfaces:
PropertyEditor
public class JndiTemplateEditor
extends PropertyEditorSupport

Properties editor for JndiTemplate objects. Allows properties of type JndiTemplate to be populated with a properties-format string.

Since:
09.05.2003
Author:
Rod Johnson

Constructor Summary
JndiTemplateEditor()
Method Summary
 void setAsText(String text)
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getAsText, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JndiTemplateEditor

public JndiTemplateEditor()
Method Detail

setAsText

public void setAsText(String text)
               throws IllegalArgumentException
Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport
Throws:
IllegalArgumentException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JndiLookupFailureException

org.springframework.jndi
Class JndiLookupFailureException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.jndi.JndiLookupFailureException
All Implemented Interfaces:
Serializable
public class JndiLookupFailureException
extends NestedRuntimeException

RuntimeException to be thrown in case of JNDI lookup failures, in particular from code that does not declare JNDI's checked NamingException: for example, from Spring's JndiObjectTargetSource.

Since:
2.0.3
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
JndiLookupFailureException(String msg, NamingException cause)
Construct a new JndiLookupFailureException, wrapping the given JNDI NamingException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

JndiLookupFailureException

public JndiLookupFailureException(String msg,
                                  NamingException cause)
Construct a new JndiLookupFailureException, wrapping the given JNDI NamingException.

Parameters:
msg - the detail message
cause - the NamingException root cause
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TypeMismatchNamingException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jndi
Class TypeMismatchNamingException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.naming.NamingException
                extended by  org.springframework.jndi.TypeMismatchNamingException
All Implemented Interfaces:
Serializable
public class TypeMismatchNamingException
extends NamingException

Exception thrown if a type mismatch is encountered for an object located in a JNDI environment. Thrown by JndiTemplate.

Since:
1.2.8
Author:
Juergen Hoeller
See Also:
JndiTemplate.lookup(String, Class), Serialized Form

Field Summary
Fields inherited from class javax.naming.NamingException
remainingName, resolvedName, resolvedObj, rootException
Constructor Summary
TypeMismatchNamingException(String explanation)
Construct a new TypeMismatchNamingException.
TypeMismatchNamingException(String jndiName, Class requiredType, Class actualType)
Construct a new TypeMismatchNamingException, building an explanation text from the given arguments.
Method Summary
Class | getActualType() Return the actual type that the lookup returned, if available.
Class | getRequiredType() Return the required type for the lookup, if available.
Methods inherited from class javax.naming.NamingException
appendRemainingComponent, appendRemainingName, getCause, getExplanation, getRemainingName, getResolvedName, getResolvedObj, getRootCause, initCause, setRemainingName, setResolvedName, setResolvedObj, setRootCause, toString, toString
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, printStackTrace, printStackTrace, printStackTrace, setStackTrace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

TypeMismatchNamingException

public TypeMismatchNamingException(String jndiName,
                                   Class requiredType,
                                   Class actualType)
Construct a new TypeMismatchNamingException, building an explanation text from the given arguments.

Parameters:
jndiName - the JNDI name
requiredType - the required type for the lookup
actualType - the actual type that the lookup returned

TypeMismatchNamingException

public TypeMismatchNamingException(String explanation)
Construct a new TypeMismatchNamingException.

Parameters:
explanation - the explanation text
Method Detail

getRequiredType

public final Class getRequiredType()
Return the required type for the lookup, if available.

getActualType

public final Class getActualType()
Return the actual type that the lookup returned, if available.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.jndi.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.jndi.support

Support classes for JNDI usage, including a JNDI-based BeanFactory implementation.

See:
Description

Class Summary
SimpleJndiBeanFactory Simple JNDI-based implementation of Spring's BeanFactory interface.

Package org.springframework.jndi.support Description

Support classes for JNDI usage, including a JNDI-based BeanFactory implementation.


org.springframework.jndi.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.jndi.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jndi.JndiAccessor
      • org.springframework.jndi.JndiLocatorSupport
        • org.springframework.jndi.support.SimpleJndiBeanFactory (implements org.springframework.beans.factory.BeanFactory)


SimpleJndiBeanFactory

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.jndi.support
Class SimpleJndiBeanFactory

java.lang.Object
    extended by  org.springframework.jndi.JndiAccessor
        extended by  org.springframework.jndi.JndiLocatorSupport
            extended by  org.springframework.jndi.support.SimpleJndiBeanFactory
All Implemented Interfaces:
BeanFactory
public class SimpleJndiBeanFactory
extends JndiLocatorSupport
implements BeanFactory

Simple JNDI-based implementation of Spring's BeanFactory interface. Does not support enumerating bean definitions, hence doesn't implement the ListableBeanFactory interface.

This factory resolves given bean names as JNDI names within the J2EE application's "java:comp/env/" namespace. It caches the resolved types for all obtained objects, and optionally also caches shareable objects (if they are explicitly marked as shareable resource.

The main intent of this factory is usage in combination with Spring's CommonAnnotationBeanPostProcessor, configured as "resourceFactory" for resolving @Resource annotations as JNDI objects without intermediate bean definitions. It may be used for similar lookup scenarios as well, of course, in particular if BeanFactory-style type checking is required.

Since:
2.5
Author:
Juergen Hoeller
See Also:
DefaultListableBeanFactory, CommonAnnotationBeanPostProcessor

Field Summary
Fields inherited from class org.springframework.jndi.JndiLocatorSupport
CONTAINER_PREFIX
Fields inherited from class org.springframework.jndi.JndiAccessor
logger
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Constructor Summary
SimpleJndiBeanFactory()
Method Summary
 void addShareableResource(String shareableResource)
Add the name of a shareable JNDI resource, which this factory is allowed to cache once obtained.
 boolean containsBean(String name)
Does this bean factory contain a bean with the given name? More specifically, is BeanFactory.getBean(java.lang.String) able to obtain a bean instance for the given name?
 String[] getAliases(String name)
Return the aliases for the given bean name, if any.
<T> T
getBean(Class<T> requiredType)
Return the bean instance that uniquely matches the given object type, if any.
 Object getBean(String name)
Return an instance, which may be shared or independent, of the specified bean.
<T> T
getBean(String name, Class<T> requiredType)
Return an instance, which may be shared or independent, of the specified bean.
 Object getBean(String name, Object... args)
Return an instance, which may be shared or independent, of the specified bean.
 Class<?> getType(String name)
Determine the type of the bean with the given name.
 boolean isPrototype(String name)
Is this bean a prototype? That is, will BeanFactory.getBean(java.lang.String) always return independent instances?
 boolean isSingleton(String name)
Is this bean a shared singleton? That is, will BeanFactory.getBean(java.lang.String) always return the same instance?
 boolean isTypeMatch(String name, Class targetType)
Check whether the bean with the given name matches the specified type.
 void setShareableResources(String[] shareableResources)
Set a list of names of shareable JNDI resources, which this factory is allowed to cache once obtained.
Methods inherited from class org.springframework.jndi.JndiLocatorSupport
convertJndiName, isResourceRef, lookup, lookup, setResourceRef
Methods inherited from class org.springframework.jndi.JndiAccessor
getJndiEnvironment, getJndiTemplate, setJndiEnvironment, setJndiTemplate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleJndiBeanFactory

public SimpleJndiBeanFactory()
Method Detail

setShareableResources

public void setShareableResources(String[] shareableResources)
Set a list of names of shareable JNDI resources, which this factory is allowed to cache once obtained.

Parameters:
shareableResources - the JNDI names (typically within the "java:comp/env/" namespace)

addShareableResource

public void addShareableResource(String shareableResource)
Add the name of a shareable JNDI resource, which this factory is allowed to cache once obtained.

Parameters:
shareableResource - the JNDI name (typically within the "java:comp/env/" namespace)

getBean

public Object getBean(String name)
               throws BeansException
Description copied from interface: BeanFactory
Return an instance, which may be shared or independent, of the specified bean.

This method allows a Spring BeanFactory to be used as a replacement for the Singleton or Prototype design pattern. Callers may retain references to returned objects in the case of Singleton beans.

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Specified by:
getBean in interface BeanFactory
Parameters:
name - the name of the bean to retrieve
Returns:
an instance of the bean
Throws:
NoSuchBeanDefinitionException - if there is no bean definition with the specified name
BeansException - if the bean could not be obtained

getBean

public <T> T getBean(String name,
                     Class<T> requiredType)
          throws BeansException
Description copied from interface: BeanFactory
Return an instance, which may be shared or independent, of the specified bean.

Behaves the same as BeanFactory.getBean(String), but provides a measure of type safety by throwing a BeanNotOfRequiredTypeException if the bean is not of the required type. This means that ClassCastException can't be thrown on casting the result correctly, as can happen with BeanFactory.getBean(String).

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Specified by:
getBean in interface BeanFactory
Parameters:
name - the name of the bean to retrieve
requiredType - type the bean must match. Can be an interface or superclass of the actual class, or null for any match. For example, if the value is Object.class, this method will succeed whatever the class of the returned instance.
Returns:
an instance of the bean
Throws:
NoSuchBeanDefinitionException - if there's no such bean definition
BeanNotOfRequiredTypeException - if the bean is not of the required type
BeansException - if the bean could not be created

getBean

public <T> T getBean(Class<T> requiredType)
          throws BeansException
Description copied from interface: BeanFactory
Return the bean instance that uniquely matches the given object type, if any.

Specified by:
getBean in interface BeanFactory
Parameters:
requiredType - type the bean must match; can be an interface or superclass. null is disallowed.

This method goes into ListableBeanFactory by-type lookup territory but may also be translated into a conventional by-name lookup based on the name of the given type. For more extensive retrieval operations across sets of beans, use ListableBeanFactory and/or BeanFactoryUtils.

Returns:
an instance of the single bean matching the required type
Throws:
NoSuchBeanDefinitionException - if there is not exactly one matching bean found
BeansException
See Also:
ListableBeanFactory

getBean

public Object getBean(String name,
                      Object... args)
               throws BeansException
Description copied from interface: BeanFactory
Return an instance, which may be shared or independent, of the specified bean.

Allows for specifying explicit constructor arguments / factory method arguments, overriding the specified default arguments (if any) in the bean definition.

Specified by:
getBean in interface BeanFactory
Parameters:
name - the name of the bean to retrieve
args - arguments to use if creating a prototype using explicit arguments to a static factory method. It is invalid to use a non-null args value in any other case.
Returns:
an instance of the bean
Throws:
NoSuchBeanDefinitionException - if there's no such bean definition
BeanDefinitionStoreException - if arguments have been given but the affected bean isn't a prototype
BeansException - if the bean could not be created

containsBean

public boolean containsBean(String name)
Description copied from interface: BeanFactory
Does this bean factory contain a bean with the given name? More specifically, is BeanFactory.getBean(java.lang.String) able to obtain a bean instance for the given name?

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Specified by:
containsBean in interface BeanFactory
Parameters:
name - the name of the bean to query
Returns:
whether a bean with the given name is defined

isSingleton

public boolean isSingleton(String name)
                    throws NoSuchBeanDefinitionException
Description copied from interface: BeanFactory
Is this bean a shared singleton? That is, will BeanFactory.getBean(java.lang.String) always return the same instance?

Note: This method returning false does not clearly indicate independent instances. It indicates non-singleton instances, which may correspond to a scoped bean as well. Use the BeanFactory.isPrototype(java.lang.String) operation to explicitly check for independent instances.

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Specified by:
isSingleton in interface BeanFactory
Parameters:
name - the name of the bean to query
Returns:
whether this bean corresponds to a singleton instance
Throws:
NoSuchBeanDefinitionException - if there is no bean with the given name
See Also:
BeanFactory.getBean(java.lang.String), BeanFactory.isPrototype(java.lang.String)

isPrototype

public boolean isPrototype(String name)
                    throws NoSuchBeanDefinitionException
Description copied from interface: BeanFactory
Is this bean a prototype? That is, will BeanFactory.getBean(java.lang.String) always return independent instances?

Note: This method returning false does not clearly indicate a singleton object. It indicates non-independent instances, which may correspond to a scoped bean as well. Use the BeanFactory.isSingleton(java.lang.String) operation to explicitly check for a shared singleton instance.

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Specified by:
isPrototype in interface BeanFactory
Parameters:
name - the name of the bean to query
Returns:
whether this bean will always deliver independent instances
Throws:
NoSuchBeanDefinitionException - if there is no bean with the given name
See Also:
BeanFactory.getBean(java.lang.String), BeanFactory.isSingleton(java.lang.String)

isTypeMatch

public boolean isTypeMatch(String name,
                           Class targetType)
                    throws NoSuchBeanDefinitionException
Description copied from interface: BeanFactory
Check whether the bean with the given name matches the specified type. More specifically, check whether a BeanFactory.getBean(java.lang.String) call for the given name would return an object that is assignable to the specified target type.

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Specified by:
isTypeMatch in interface BeanFactory
Parameters:
name - the name of the bean to query
targetType - the type to match against
Returns:
true if the bean type matches, false if it doesn't match or cannot be determined yet
Throws:
NoSuchBeanDefinitionException - if there is no bean with the given name
See Also:
BeanFactory.getBean(java.lang.String), BeanFactory.getType(java.lang.String)

getType

public Class<?> getType(String name)
                 throws NoSuchBeanDefinitionException
Description copied from interface: BeanFactory
Determine the type of the bean with the given name. More specifically, determine the type of object that BeanFactory.getBean(java.lang.String) would return for the given name.

For a FactoryBean, return the type of object that the FactoryBean creates, as exposed by FactoryBean.getObjectType().

Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.

Specified by:
getType in interface BeanFactory
Parameters:
name - the name of the bean to query
Returns:
the type of the bean, or null if not determinable
Throws:
NoSuchBeanDefinitionException - if there is no bean with the given name
See Also:
BeanFactory.getBean(java.lang.String), BeanFactory.isTypeMatch(java.lang.String, java.lang.Class)

getAliases

public String[] getAliases(String name)
Description copied from interface: BeanFactory
Return the aliases for the given bean name, if any. All of those aliases point to the same bean when used in a BeanFactory.getBean(java.lang.String) call.

If the given name is an alias, the corresponding original bean name and other aliases (if any) will be returned, with the original bean name being the first element in the array.

Will ask the parent factory if the bean cannot be found in this factory instance.

Specified by:
getAliases in interface BeanFactory
Parameters:
name - the bean name to check for aliases
Returns:
the aliases, or an empty array if none
See Also:
BeanFactory.getBean(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.mail

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.mail

Spring's generic mail infrastructure.

See:
Description

Interface Summary
MailMessage | This is a common interface for mail messages, allowing a user to set key values required in assembling a mail message, without needing to know if the underlying message is a simple text message or a more sophisticated MIME message.
MailSender | This interface defines a strategy for sending simple mails.

Class Summary
SimpleMailMessage Models a simple mail message, including data such as the from, to, cc, subject, and text fields.

Exception Summary
MailAuthenticationException | Exception thrown on failed authentication.
MailException | Base class for all mail exceptions.
MailParseException | Exception thrown if illegal message properties are encountered.
MailPreparationException | Exception to be thrown by user code if a mail cannot be prepared properly, for example when a Velocity template cannot be rendered for the mail text.
MailSendException | Exception thrown when a mail sending error is encountered.

Package org.springframework.mail Description

Spring's generic mail infrastructure. Concrete implementations are provided in the subpackages.


org.springframework.mail Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.mail

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.mail.SimpleMailMessage (implements org.springframework.mail.MailMessage, java.io.Serializable)
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.mail.MailException
              • org.springframework.mail.MailAuthenticationException
              • org.springframework.mail.MailParseException
              • org.springframework.mail.MailPreparationException
              • org.springframework.mail.MailSendException

Interface Hierarchy

  • org.springframework.mail.MailMessage
  • org.springframework.mail.MailSender


MailMessage

org.springframework.mail
Interface MailMessage

All Known Implementing Classes:
MimeMailMessage, SimpleMailMessage
public interface MailMessage

This is a common interface for mail messages, allowing a user to set key values required in assembling a mail message, without needing to know if the underlying message is a simple text message or a more sophisticated MIME message.

Implemented by both SimpleMailMessage and MimeMessageHelper, to let message population code interact with a simple message or a MIME message through a common interface.

Since:
1.1.5
Author:
Juergen Hoeller
See Also:
SimpleMailMessage, MimeMessageHelper

Method Summary
void | setBcc(String bcc)
void | setBcc(String[] bcc)
void | setCc(String cc)
void | setCc(String[] cc)
void | setFrom(String from)
void | setReplyTo(String replyTo)
void | setSentDate(Date sentDate)
void | setSubject(String subject)
void | setText(String text)
void | setTo(String to)
void | setTo(String[] to)

Method Detail

setFrom

void setFrom(String from)
             throws MailParseException
Throws:
MailParseException

setReplyTo

void setReplyTo(String replyTo)
                throws MailParseException
Throws:
MailParseException

setTo

void setTo(String to)
           throws MailParseException
Throws:
MailParseException

setTo

void setTo(String[] to)
           throws MailParseException
Throws:
MailParseException

setCc

void setCc(String cc)
           throws MailParseException
Throws:
MailParseException

setCc

void setCc(String[] cc)
           throws MailParseException
Throws:
MailParseException

setBcc

void setBcc(String bcc)
            throws MailParseException
Throws:
MailParseException

setBcc

void setBcc(String[] bcc)
            throws MailParseException
Throws:
MailParseException

setSentDate

void setSentDate(Date sentDate)
                 throws MailParseException
Throws:
MailParseException

setSubject

void setSubject(String subject)
                throws MailParseException
Throws:
MailParseException

setText

void setText(String text)
             throws MailParseException
Throws:
MailParseException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MailSender

org.springframework.mail
Interface MailSender

All Known Subinterfaces:
JavaMailSender
All Known Implementing Classes:
JavaMailSenderImpl
public interface MailSender

This interface defines a strategy for sending simple mails. Can be implemented for a variety of mailing systems due to the simple requirements. For richer functionality like MIME messages, consider JavaMailSender.

Allows for easy testing of clients, as it does not depend on JavaMail's infrastructure classes: no mocking of JavaMail Session or Transport necessary.

Since:
10.09.2003
Author:
Dmitriy Kopylenko, Juergen Hoeller
See Also:
JavaMailSender

Method Summary
void | send(SimpleMailMessage simpleMessage) Send the given simple mail message.
void | send(SimpleMailMessage[] simpleMessages) Send the given array of simple mail messages in batch.

Method Detail

send

void send(SimpleMailMessage simpleMessage)
          throws MailException
Send the given simple mail message.

Parameters:
simpleMessage - the message to send
Throws:
MailParseException - in case of failure when parsing the message
MailAuthenticationException - in case of authentication failure
MailSendException - in case of failure when sending the message
MailException

send

void send(SimpleMailMessage[] simpleMessages)
          throws MailException
Send the given array of simple mail messages in batch.

Parameters:
simpleMessages - the messages to send
Throws:
MailParseException - in case of failure when parsing a message
MailAuthenticationException - in case of authentication failure
MailSendException - in case of failure when sending a message
MailException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleMailMessage

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.mail
Class SimpleMailMessage

java.lang.Object
    extended by  org.springframework.mail.SimpleMailMessage
All Implemented Interfaces:
Serializable, MailMessage
public class SimpleMailMessage
extends Object
implements MailMessage, Serializable

Models a simple mail message, including data such as the from, to, cc, subject, and text fields.

Consider JavaMailSender and JavaMail MimeMessages for creating more sophisticated messages, for example messages with attachments, special character encodings, or personal names that accompany mail addresses.

Since:
10.09.2003
Author:
Dmitriy Kopylenko, Juergen Hoeller
See Also:
MailSender, JavaMailSender, MimeMessagePreparator, MimeMessageHelper, MimeMailMessage, Serialized Form

Constructor Summary
SimpleMailMessage()
Create a new SimpleMailMessage.
SimpleMailMessage(SimpleMailMessage original)
Copy constructor for creating a new SimpleMailMessage from the state of an existing SimpleMailMessage instance.
Method Summary
void | copyTo(MailMessage target) Copy the contents of this message to the given target message.
boolean | equals(Object other)
String[] | getBcc()
String[] | getCc()
String | getFrom()
String | getReplyTo()
Date | getSentDate()
String | getSubject()
String | getText()
String[] | getTo()
int | hashCode()
void | setBcc(String bcc)
void | setBcc(String[] bcc)
void | setCc(String cc)
void | setCc(String[] cc)
void | setFrom(String from)
void | setReplyTo(String replyTo)
void | setSentDate(Date sentDate)
void | setSubject(String subject)
void | setText(String text)
void | setTo(String to)
void | setTo(String[] to)
String | toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

SimpleMailMessage

public SimpleMailMessage()
Create a new SimpleMailMessage.

SimpleMailMessage

public SimpleMailMessage(SimpleMailMessage original)
Copy constructor for creating a new SimpleMailMessage from the state of an existing SimpleMailMessage instance.

Throws:
IllegalArgumentException - if the supplied message is null
Method Detail

setFrom

public void setFrom(String from)
Specified by:
setFrom in interface MailMessage

getFrom

public String getFrom()

setReplyTo

public void setReplyTo(String replyTo)
Specified by:
setReplyTo in interface MailMessage

getReplyTo

public String getReplyTo()

setTo

public void setTo(String to)
Specified by:
setTo in interface MailMessage

setTo

public void setTo(String[] to)
Specified by:
setTo in interface MailMessage

getTo

public String[] getTo()

setCc

public void setCc(String cc)
Specified by:
setCc in interface MailMessage

setCc

public void setCc(String[] cc)
Specified by:
setCc in interface MailMessage

getCc

public String[] getCc()

setBcc

public void setBcc(String bcc)
Specified by:
setBcc in interface MailMessage

setBcc

public void setBcc(String[] bcc)
Specified by:
setBcc in interface MailMessage

getBcc

public String[] getBcc()

setSentDate

public void setSentDate(Date sentDate)
Specified by:
setSentDate in interface MailMessage

getSentDate

public Date getSentDate()

setSubject

public void setSubject(String subject)
Specified by:
setSubject in interface MailMessage

getSubject

public String getSubject()

setText

public void setText(String text)
Specified by:
setText in interface MailMessage

getText

public String getText()

copyTo

public void copyTo(MailMessage target)
Copy the contents of this message to the given target message.

Parameters:
target - the MailMessage to copy to
Throws:
IllegalArgumentException - if the supplied target is null

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


MailAuthenticationException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.mail
Class MailAuthenticationException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.mail.MailException
                        extended by  org.springframework.mail.MailAuthenticationException
All Implemented Interfaces:
Serializable
public class MailAuthenticationException
extends MailException

Exception thrown on failed authentication.

Author:
Dmitriy Kopylenko, Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
MailAuthenticationException(String msg)
Constructor for MailAuthenticationException.
MailAuthenticationException(String msg, Throwable cause)
Constructor for MailAuthenticationException.
MailAuthenticationException(Throwable cause)
Constructor for MailAuthenticationException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

MailAuthenticationException

public MailAuthenticationException(String msg)
Constructor for MailAuthenticationException.

Parameters:
msg - message

MailAuthenticationException

public MailAuthenticationException(String msg,
                                   Throwable cause)
Constructor for MailAuthenticationException.

Parameters:
msg - the detail message
cause - the root cause from the mail API in use

MailAuthenticationException

public MailAuthenticationException(Throwable cause)
Constructor for MailAuthenticationException.

Parameters:
cause - the root cause from the mail API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


MailException

org.springframework.mail
Class MailException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.mail.MailException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
MailAuthenticationException, MailParseException, MailPreparationException, MailSendException
public abstract class MailException
extends NestedRuntimeException

Base class for all mail exceptions.

Author:
Dmitriy Kopylenko
See Also:
Serialized Form

Constructor Summary
MailException(String msg)
Constructor for MailException.
MailException(String msg, Throwable cause)
Constructor for MailException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

MailException

public MailException(String msg)
Constructor for MailException.

Parameters:
msg - the detail message

MailException

public MailException(String msg,
                     Throwable cause)
Constructor for MailException.

Parameters:
msg - the detail message
cause - the root cause from the mail API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MailParseException

org.springframework.mail
Class MailParseException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.mail.MailException
                        extended by  org.springframework.mail.MailParseException
All Implemented Interfaces:
Serializable
public class MailParseException
extends MailException

Exception thrown if illegal message properties are encountered.

Author:
Dmitriy Kopylenko, Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
MailParseException(String msg)
Constructor for MailParseException.
MailParseException(String msg, Throwable cause)
Constructor for MailParseException.
MailParseException(Throwable cause)
Constructor for MailParseException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

MailParseException

public MailParseException(String msg)
Constructor for MailParseException.

Parameters:
msg - the detail message

MailParseException

public MailParseException(String msg,
                          Throwable cause)
Constructor for MailParseException.

Parameters:
msg - the detail message
cause - the root cause from the mail API in use

MailParseException

public MailParseException(Throwable cause)
Constructor for MailParseException.

Parameters:
cause - the root cause from the mail API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MailPreparationException

org.springframework.mail
Class MailPreparationException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.mail.MailException
                        extended by  org.springframework.mail.MailPreparationException
All Implemented Interfaces:
Serializable
public class MailPreparationException
extends MailException

Exception to be thrown by user code if a mail cannot be prepared properly, for example when a Velocity template cannot be rendered for the mail text.

Since:
1.1
Author:
Juergen Hoeller
See Also:
VelocityEngineUtils.mergeTemplateIntoString(org.apache.velocity.app.VelocityEngine, java.lang.String, java.util.Map), FreeMarkerTemplateUtils.processTemplateIntoString(freemarker.template.Template, java.lang.Object), Serialized Form

Constructor Summary
MailPreparationException(String msg)
Constructor for MailPreparationException.
MailPreparationException(String msg, Throwable cause)
Constructor for MailPreparationException.
MailPreparationException(Throwable cause)
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

MailPreparationException

public MailPreparationException(String msg)
Constructor for MailPreparationException.

Parameters:
msg - the detail message

MailPreparationException

public MailPreparationException(String msg,
                                Throwable cause)
Constructor for MailPreparationException.

Parameters:
msg - the detail message
cause - the root cause from the mail API in use

MailPreparationException

public MailPreparationException(Throwable cause)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MailSendException

org.springframework.mail
Class MailSendException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.mail.MailException
                        extended by  org.springframework.mail.MailSendException
All Implemented Interfaces:
Serializable
public class MailSendException
extends MailException

Exception thrown when a mail sending error is encountered. Can register failed messages with their exceptions.

Author:
Dmitriy Kopylenko, Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
MailSendException(Map<Object,Exception> failedMessages)
Constructor for registration of failed messages, with the messages that failed as keys, and the thrown exceptions as values.
MailSendException(String msg)
Constructor for MailSendException.
MailSendException(String msg, Throwable cause)
Constructor for MailSendException.
Method Summary
Map<Object,Exception> | getFailedMessages() Return a Map with the failed messages as keys, and the thrown exceptions as values.
String | getMessage() Return the detail message, including the message from the nested exception if there is one.
Exception[] | getMessageExceptions() Return an array with thrown message exceptions.
void | printStackTrace(PrintStream ps)
void | printStackTrace(PrintWriter pw)
String | toString()
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, setStackTrace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

MailSendException

public MailSendException(String msg)
Constructor for MailSendException.

Parameters:
msg - the detail message

MailSendException

public MailSendException(String msg,
                         Throwable cause)
Constructor for MailSendException.

Parameters:
msg - the detail message
cause - the root cause from the mail API in use

MailSendException

public MailSendException(Map<Object,Exception> failedMessages)
Constructor for registration of failed messages, with the messages that failed as keys, and the thrown exceptions as values.

The messages should be the same that were originally passed to the invoked send method.

Parameters:
failedMessages - Map of failed messages as keys and thrown exceptions as values
Method Detail

getFailedMessages

public final Map<Object,Exception> getFailedMessages()
Return a Map with the failed messages as keys, and the thrown exceptions as values.

Note that a general mail server connection failure will not result in failed messages being returned here: A message will only be contained here if actually sending it was attempted but failed.

The messages will be the same that were originally passed to the invoked send method, that is, SimpleMailMessages in case of using the generic MailSender interface.

In case of sending MimeMessage instances via JavaMailSender, the messages will be of type MimeMessage.

NOTE: This Map will not be available after serialization. Use getMessageExceptions() in such a scenario, which will be available after serialization as well.

Returns:
the Map of failed messages as keys and thrown exceptions as values
See Also:
SimpleMailMessage, MimeMessage

getMessageExceptions

public final Exception[] getMessageExceptions()
Return an array with thrown message exceptions.

Note that a general mail server connection failure will not result in failed messages being returned here: A message will only be contained here if actually sending it was attempted but failed.

Returns:
the array of thrown message exceptions, or an empty array if no failed messages

getMessage

public String getMessage()
Description copied from class: NestedRuntimeException
Return the detail message, including the message from the nested exception if there is one.

Overrides:
getMessage in class NestedRuntimeException

toString

public String toString()
Overrides:
toString in class Throwable

printStackTrace

public void printStackTrace(PrintStream ps)
Overrides:
printStackTrace in class Throwable

printStackTrace

public void printStackTrace(PrintWriter pw)
Overrides:
printStackTrace in class Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.mail.javamail

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.mail.javamail

JavaMail support for Spring's mail infrastructure.

See:
Description

Interface Summary
JavaMailSender | Extended MailSender interface for JavaMail, supporting MIME messages both as direct arguments and through preparation callbacks.
MimeMessagePreparator | Callback interface for the preparation of JavaMail MIME messages.

Class Summary
ConfigurableMimeFileTypeMap | Spring-configurable FileTypeMap implementation that will read MIME type to file extension mappings from a standard JavaMail MIME type mapping file, using a standard MimetypesFileTypeMap underneath.
InternetAddressEditor | Editor for java.mail.internet.InternetAddress, to directly populate an InternetAddress property.
JavaMailSenderImpl | Production implementation of the JavaMailSender interface, supporting both JavaMail MimeMessages and Spring SimpleMailMessages.
MimeMailMessage | Implementation of the MailMessage interface for a JavaMail MIME message, to let message population code interact with a simple message or a MIME message through a common interface.
MimeMessageHelper | Helper class for populating a MimeMessage.

Package org.springframework.mail.javamail Description

JavaMail support for Spring's mail infrastructure. Provides an extended JavaMailSender interface and a MimeMessageHelper class for convenient population of a JavaMail MimeMessage.


org.springframework.mail.javamail Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.mail.javamail

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.activation.FileTypeMap
      • org.springframework.mail.javamail.ConfigurableMimeFileTypeMap (implements org.springframework.beans.factory.InitializingBean)
    • org.springframework.mail.javamail.JavaMailSenderImpl (implements org.springframework.mail.javamail.JavaMailSender)
    • org.springframework.mail.javamail.MimeMailMessage (implements org.springframework.mail.MailMessage)
    • org.springframework.mail.javamail.MimeMessageHelper
    • java.beans.PropertyEditorSupport (implements java.beans.PropertyEditor)
      • org.springframework.mail.javamail.InternetAddressEditor

Interface Hierarchy

  • org.springframework.mail.MailSender
    • org.springframework.mail.javamail.JavaMailSender
  • org.springframework.mail.javamail.MimeMessagePreparator


JavaMailSender

org.springframework.mail.javamail
Interface JavaMailSender

All Superinterfaces:
MailSender
All Known Implementing Classes:
JavaMailSenderImpl
public interface JavaMailSender
extends MailSender

Extended MailSender interface for JavaMail, supporting MIME messages both as direct arguments and through preparation callbacks. Typically used in conjunction with the MimeMessageHelper class for convenient creation of JavaMail MimeMessages, including attachments etc.

Clients should talk to the mail sender through this interface if they need mail functionality beyond SimpleMailMessage. The production implementation is JavaMailSenderImpl; for testing, mocks can be created based on this interface. Clients will typically receive the JavaMailSender reference through dependency injection.

The recommended way of using this interface is the MimeMessagePreparator mechanism, possibly using a MimeMessageHelper for populating the message. See MimeMessageHelper's javadoc for an example.

The entire JavaMail Session management is abstracted by the JavaMailSender. Client code should not deal with a Session in any way, rather leave the entire JavaMail configuration and resource handling to the JavaMailSender implementation. This also increases testability.

A JavaMailSender client is not as easy to test as a plain MailSender client, but still straightforward compared to traditional JavaMail code: Just let createMimeMessage() return a plain MimeMessage created with a Session.getInstance(new Properties()) call, and check the passed-in messages in your mock implementations of the various send methods.

Since:
07.10.2003
Author:
Juergen Hoeller
See Also:
MimeMessage, Session, JavaMailSenderImpl, MimeMessagePreparator, MimeMessageHelper

Method Summary
MimeMessage | createMimeMessage() Create a new JavaMail MimeMessage for the underlying JavaMail Session of this sender.
MimeMessage | createMimeMessage(InputStream contentStream) Create a new JavaMail MimeMessage for the underlying JavaMail Session of this sender, using the given input stream as the message source.
void | send(MimeMessage mimeMessage) Send the given JavaMail MIME message.
void | send(MimeMessage[] mimeMessages) Send the given array of JavaMail MIME messages in batch.
void | send(MimeMessagePreparator mimeMessagePreparator) Send the JavaMail MIME message prepared by the given MimeMessagePreparator.
void | send(MimeMessagePreparator[] mimeMessagePreparators) Send the JavaMail MIME messages prepared by the given MimeMessagePreparators.
Methods inherited from interface org.springframework.mail.MailSender
send, send

Method Detail

createMimeMessage

MimeMessage createMimeMessage()
Create a new JavaMail MimeMessage for the underlying JavaMail Session of this sender. Needs to be called to create MimeMessage instances that can be prepared by the client and passed to send(MimeMessage).

Returns:
the new MimeMessage instance
See Also:
send(MimeMessage), send(MimeMessage[])

createMimeMessage

MimeMessage createMimeMessage(InputStream contentStream)
                              throws MailException
Create a new JavaMail MimeMessage for the underlying JavaMail Session of this sender, using the given input stream as the message source.

Parameters:
contentStream - the raw MIME input stream for the message
Returns:
the new MimeMessage instance
Throws:
MailParseException - in case of message creation failure
MailException

send

void send(MimeMessage mimeMessage)
          throws MailException
Send the given JavaMail MIME message. The message needs to have been created with createMimeMessage().

Parameters:
mimeMessage - message to send
Throws:
MailAuthenticationException - in case of authentication failure
MailSendException - in case of failure when sending the message
MailException
See Also:
createMimeMessage()

send

void send(MimeMessage[] mimeMessages)
          throws MailException
Send the given array of JavaMail MIME messages in batch. The messages need to have been created with createMimeMessage().

Parameters:
mimeMessages - messages to send
Throws:
MailAuthenticationException - in case of authentication failure
MailSendException - in case of failure when sending a message
MailException
See Also:
createMimeMessage()

send

void send(MimeMessagePreparator mimeMessagePreparator)
          throws MailException
Send the JavaMail MIME message prepared by the given MimeMessagePreparator.

Alternative way to prepare MimeMessage instances, instead of createMimeMessage() and send(MimeMessage) calls. Takes care of proper exception conversion.

Parameters:
mimeMessagePreparator - the preparator to use
Throws:
MailPreparationException - in case of failure when preparing the message
MailParseException - in case of failure when parsing the message
MailAuthenticationException - in case of authentication failure
MailSendException - in case of failure when sending the message
MailException

send

void send(MimeMessagePreparator[] mimeMessagePreparators)
          throws MailException
Send the JavaMail MIME messages prepared by the given MimeMessagePreparators.

Alternative way to prepare MimeMessage instances, instead of createMimeMessage() and send(MimeMessage[]) calls. Takes care of proper exception conversion.

Parameters:
mimeMessagePreparators - the preparator to use
Throws:
MailPreparationException - in case of failure when preparing a message
MailParseException - in case of failure when parsing a message
MailAuthenticationException - in case of authentication failure
MailSendException - in case of failure when sending a message
MailException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MimeMessagePreparator

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.mail.javamail
Interface MimeMessagePreparator

public interface MimeMessagePreparator

Callback interface for the preparation of JavaMail MIME messages.

The corresponding send methods of JavaMailSender will take care of the actual creation of a MimeMessage instance, and of proper exception conversion.

It is often convenient to use a MimeMessageHelper for populating the passed-in MimeMessage, in particular when working with attachments or special character encodings. See MimeMessageHelper's javadoc for an example.

Since:
07.10.2003
Author:
Juergen Hoeller
See Also:
JavaMailSender.send(MimeMessagePreparator), JavaMailSender.send(MimeMessagePreparator[]), MimeMessageHelper

Method Summary
 void prepare(MimeMessage mimeMessage)
Prepare the given new MimeMessage instance.

Method Detail

prepare

void prepare(MimeMessage mimeMessage)
             throws Exception
Prepare the given new MimeMessage instance.

Parameters:
mimeMessage - the message to prepare
Throws:
MessagingException - passing any exceptions thrown by MimeMessage methods through for automatic conversion to the MailException hierarchy
IOException - passing any exceptions thrown by MimeMessage methods through for automatic conversion to the MailException hierarchy
Exception - if mail preparation failed, for example when a Velocity template cannot be rendered for the mail text
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ConfigurableMimeFileTypeMap

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.mail.javamail
Class ConfigurableMimeFileTypeMap

java.lang.Object
    extended by  javax.activation.FileTypeMap
        extended by  org.springframework.mail.javamail.ConfigurableMimeFileTypeMap
All Implemented Interfaces:
InitializingBean
public class ConfigurableMimeFileTypeMap
extends FileTypeMap
implements InitializingBean

Spring-configurable FileTypeMap implementation that will read MIME type to file extension mappings from a standard JavaMail MIME type mapping file, using a standard MimetypesFileTypeMap underneath.

The mapping file should be in the following format, as specified by the Java Activation Framework:

 # map text/html to .htm and .html files
 text/html  html htm HTML HTM
Lines starting with # are treated as comments and are ignored. All other lines are treated as mappings. Each mapping line should contain the MIME type as the first entry and then each file extension to map to that MIME type as subsequent entries. Each entry is separated by spaces or tabs.

By default, the mappings in the mime.types file located in the same package as this class are used, which cover many common file extensions (in contrast to the out-of-the-box mappings in activation.jar). This can be overridden using the mappingLocation property.

Additional mappings can be added via the mappings bean property, as lines that follow the mime.types file format.

Since:
1.2
Author:
Rob Harrop, Juergen Hoeller
See Also:
setMappingLocation(org.springframework.core.io.Resource), setMappings(java.lang.String[]), MimetypesFileTypeMap

Constructor Summary
ConfigurableMimeFileTypeMap()

Method Summary
 void afterPropertiesSet()
          Creates the final merged mapping set.
protected  FileTypeMap createFileTypeMap(Resource mappingLocation, String[] mappings)
          Compile a FileTypeMap from the mappings in the given mapping file and the given mapping entries.
 String getContentType(File file)
          Delegates to the underlying FileTypeMap.
 String getContentType(String fileName)
          Delegates to the underlying FileTypeMap.
protected  FileTypeMap getFileTypeMap()
          Return the delegate FileTypeMap, compiled from the mappings in the mapping file and the entries in the mappings property.
 void setMappingLocation(Resource mappingLocation)
          Specify the Resource from which mappings are loaded.
 void setMappings(String[] mappings)
          Specify additional MIME type mappings as lines that follow the mime.types file format, as specified by the Java Activation Framework, for example:
text/html html htm HTML HTM

Methods inherited from class javax.activation.FileTypeMap
getDefaultFileTypeMap, setDefaultFileTypeMap

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ConfigurableMimeFileTypeMap

public ConfigurableMimeFileTypeMap()
Method Detail

setMappingLocation

public void setMappingLocation(Resource mappingLocation)
Specify the Resource from which mappings are loaded.

Needs to follow the mime.types file format, as specified by the Java Activation Framework, containing lines such as:
text/html html htm HTML HTM

setMappings

public void setMappings(String[] mappings)
Specify additional MIME type mappings as lines that follow the mime.types file format, as specified by the Java Activation Framework, for example:
text/html html htm HTML HTM

afterPropertiesSet

public void afterPropertiesSet()
Creates the final merged mapping set.

Specified by:
afterPropertiesSet in interface InitializingBean

getFileTypeMap

protected final FileTypeMap getFileTypeMap()
Return the delegate FileTypeMap, compiled from the mappings in the mapping file and the entries in the mappings property.

See Also:
setMappingLocation(org.springframework.core.io.Resource),
setMappings(java.lang.String[]),
createFileTypeMap(org.springframework.core.io.Resource, java.lang.String[])

createFileTypeMap

protected FileTypeMap createFileTypeMap(Resource mappingLocation,
                                        String[] mappings)
                                 throws IOException
Compile a FileTypeMap from the mappings in the given mapping file and the given mapping entries.

The default implementation creates an Activation Framework MimetypesFileTypeMap, passing in an InputStream from the mapping resource (if any) and registering the mapping lines programmatically.

Parameters:
mappingLocation - a mime.types mapping resource (can be null)
mappings - MIME type mapping lines (can be null)
Returns:
the compiled FileTypeMap
Throws:
IOException - if resource access failed
See Also:
MimetypesFileTypeMap.MimetypesFileTypeMap(java.io.InputStream), MimetypesFileTypeMap.addMimeTypes(String)

getContentType

public String getContentType(File file)
Delegates to the underlying FileTypeMap.

Specified by:
getContentType in class FileTypeMap
See Also:
getFileTypeMap()

getContentType

public String getContentType(String fileName)
Delegates to the underlying FileTypeMap.

Specified by:
getContentType in class FileTypeMap
See Also:
getFileTypeMap()
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS | FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


InternetAddressEditor

org.springframework.mail.javamail
Class InternetAddressEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.mail.javamail.InternetAddressEditor
All Implemented Interfaces:
PropertyEditor
public class InternetAddressEditor
extends PropertyEditorSupport

Editor for java.mail.internet.InternetAddress, to directly populate an InternetAddress property.

Expects the same syntax as InternetAddress's constructor with a String argument. Converts empty Strings into null values.

Since:
1.2.3
Author:
Juergen Hoeller
See Also:
InternetAddress

Constructor Summary
InternetAddressEditor()
Method Summary
String | getAsText()
void | setAsText(String text)
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

InternetAddressEditor

public InternetAddressEditor()
Method Detail

setAsText

public void setAsText(String text)
               throws IllegalArgumentException
Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport
Throws:
IllegalArgumentException

getAsText

public String getAsText()
Specified by:
getAsText in interface PropertyEditor
Overrides:
getAsText in class PropertyEditorSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JavaMailSenderImpl

org.springframework.mail.javamail
Class JavaMailSenderImpl

java.lang.Object
    extended by  org.springframework.mail.javamail.JavaMailSenderImpl
All Implemented Interfaces:
JavaMailSender, MailSender
public class JavaMailSenderImpl
extends Object
implements JavaMailSender

Production implementation of the JavaMailSender interface, supporting both JavaMail MimeMessages and Spring SimpleMailMessages. Can also be used as a plain MailSender implementation.

Allows for defining all settings locally as bean properties. Alternatively, a pre-configured JavaMail Session can be specified, possibly pulled from an application server's JNDI environment.

Non-default properties in this object will always override the settings in the JavaMail Session. Note that if overriding all values locally, there is no added value in setting a pre-configured Session.

Since:
10.09.2003
Author:
Dmitriy Kopylenko, Juergen Hoeller
See Also:
MimeMessage,
Session,
setSession(javax.mail.Session),
setJavaMailProperties(java.util.Properties),
setHost(java.lang.String),
setPort(int),
setUsername(java.lang.String),
setPassword(java.lang.String)

Field Summary
static int | DEFAULT_PORT The default port: -1
static String | DEFAULT_PROTOCOL The default protocol: 'smtp'
Constructor Summary
JavaMailSenderImpl()
Create a new instance of the JavaMailSenderImpl class.
Method Summary
MimeMessage | createMimeMessage() This implementation creates a SmartMimeMessage, holding the specified default encoding and default FileTypeMap.
MimeMessage | createMimeMessage(InputStream contentStream) Create a new JavaMail MimeMessage for the underlying JavaMail Session of this sender, using the given input stream as the message source.
protected void | doSend(MimeMessage[] mimeMessages, Object[] originalMessages) Actually send the given array of MimeMessages via JavaMail.
String | getDefaultEncoding() Return the default encoding for MimeMessages, or null if none.
FileTypeMap | getDefaultFileTypeMap() Return the default Java Activation FileTypeMap for MimeMessages, or null if none.
String | getHost() Return the mail server host.
Properties | getJavaMailProperties() Allow Map access to the JavaMail properties of this sender, with the option to add or override specific entries.
String | getPassword() Return the password for the account at the mail host.
int | getPort() Return the mail server port.
String | getProtocol() Return the mail protocol.
Session | getSession() Return the JavaMail Session, lazily initializing it if hasn't been specified explicitly.
protected Transport | getTransport(Session session) Obtain a Transport object from the given JavaMail Session, using the configured protocol.
String | getUsername() Return the username for the account at the mail host.
void | send(MimeMessage mimeMessage) Send the given JavaMail MIME message.
void | send(MimeMessage[] mimeMessages) Send the given array of JavaMail MIME messages in batch.
void | send(MimeMessagePreparator mimeMessagePreparator) Send the JavaMail MIME message prepared by the given MimeMessagePreparator.
void | send(MimeMessagePreparator[] mimeMessagePreparators) Send the JavaMail MIME messages prepared by the given MimeMessagePreparators.
void | send(SimpleMailMessage simpleMessage) Send the given simple mail message.
void | send(SimpleMailMessage[] simpleMessages) Send the given array of simple mail messages in batch.
void | setDefaultEncoding(String defaultEncoding) Set the default encoding to use for MimeMessages created by this instance.
void | setDefaultFileTypeMap(FileTypeMap defaultFileTypeMap) Set the default Java Activation FileTypeMap to use for MimeMessages created by this instance.
void | setHost(String host) Set the mail server host, typically an SMTP host.
void | setJavaMailProperties(Properties javaMailProperties) Set JavaMail properties for the Session.
void | setPassword(String password) Set the password for the account at the mail host, if any.
void | setPort(int port) Set the mail server port.
void | setProtocol(String protocol) Set the mail protocol.
void | setSession(Session session) Set the JavaMail Session, possibly pulled from JNDI.
void | setUsername(String username) Set the username for the account at the mail host, if any.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_PROTOCOL

public static final String DEFAULT_PROTOCOL
The default protocol: 'smtp'

See Also:
Constant Field Values

DEFAULT_PORT

public static final int DEFAULT_PORT
The default port: -1

See Also:
Constant Field Values
Constructor Detail

JavaMailSenderImpl

public JavaMailSenderImpl()
Create a new instance of the JavaMailSenderImpl class.

Initializes the "defaultFileTypeMap" property with a default ConfigurableMimeFileTypeMap.

Method Detail

setJavaMailProperties

public void setJavaMailProperties(Properties javaMailProperties)
Set JavaMail properties for the Session.

A new Session will be created with those properties. Use either this method or setSession(javax.mail.Session), but not both.

Non-default properties in this instance will override given JavaMail properties.

getJavaMailProperties

public Properties getJavaMailProperties()
Allow Map access to the JavaMail properties of this sender, with the option to add or override specific entries.

Useful for specifying entries directly, for example via "javaMailProperties[mail.smtp.auth]".

setSession

public void setSession(Session session)
Set the JavaMail Session, possibly pulled from JNDI.

Default is a new Session without defaults, that is completely configured via this instance's properties.

If using a pre-configured Session, non-default properties in this instance will override the settings in the Session.

See Also:
setJavaMailProperties(java.util.Properties)

getSession

public Session getSession()
Return the JavaMail Session, lazily initializing it if hasn't been specified explicitly.

setProtocol

public void setProtocol(String protocol)
Set the mail protocol. Default is "smtp".

getProtocol

public String getProtocol()
Return the mail protocol.

setHost

public void setHost(String host)
Set the mail server host, typically an SMTP host.

Default is the default host of the underlying JavaMail Session.

getHost

public String getHost()
Return the mail server host.

setPort

public void setPort(int port)
Set the mail server port.

Default is DEFAULT_PORT, letting JavaMail use the default SMTP port (25).

getPort

public int getPort()
Return the mail server port.

setUsername

public void setUsername(String username)
Set the username for the account at the mail host, if any.

Note that the underlying JavaMail Session has to be configured with the property "mail.smtp.auth" set to true, else the specified username will not be sent to the mail server by the JavaMail runtime. If you are not explicitly passing in a Session to use, simply specify this setting via setJavaMailProperties(java.util.Properties).

See Also:
setSession(javax.mail.Session), setPassword(java.lang.String)

getUsername

public String getUsername()
Return the username for the account at the mail host.

setPassword

public void setPassword(String password)
Set the password for the account at the mail host, if any.

Note that the underlying JavaMail Session has to be configured with the property "mail.smtp.auth" set to true, else the specified password will not be sent to the mail server by the JavaMail runtime. If you are not explicitly passing in a Session to use, simply specify this setting via setJavaMailProperties(java.util.Properties).

See Also:
setSession(javax.mail.Session), setUsername(java.lang.String)

getPassword

public String getPassword()
Return the password for the account at the mail host.

setDefaultEncoding

public void setDefaultEncoding(String defaultEncoding)
Set the default encoding to use for MimeMessages created by this instance.

Such an encoding will be auto-detected by MimeMessageHelper.

getDefaultEncoding

public String getDefaultEncoding()
Return the default encoding for MimeMessages, or null if none.

setDefaultFileTypeMap

public void setDefaultFileTypeMap(FileTypeMap defaultFileTypeMap)
Set the default Java Activation FileTypeMap to use for MimeMessages created by this instance.

A FileTypeMap specified here will be autodetected by MimeMessageHelper, avoiding the need to specify the FileTypeMap for each MimeMessageHelper instance.

For example, you can specify a custom instance of Spring's ConfigurableMimeFileTypeMap here. If not explicitly specified, a default ConfigurableMimeFileTypeMap will be used, containing an extended set of MIME type mappings (as defined by the mime.types file contained in the Spring jar).

See Also:
MimeMessageHelper.setFileTypeMap(javax.activation.FileTypeMap)

getDefaultFileTypeMap

public FileTypeMap getDefaultFileTypeMap()
Return the default Java Activation FileTypeMap for MimeMessages, or null if none.

send

public void send(SimpleMailMessage simpleMessage)
          throws MailException
Description copied from interface: MailSender
Send the given simple mail message.

Specified by:
send in interface MailSender
Parameters:
simpleMessage - the message to send
Throws:
MailParseException - in case of failure when parsing the message
MailAuthenticationException - in case of authentication failure
MailSendException - in case of failure when sending the message
MailException

send

public void send(SimpleMailMessage[] simpleMessages)
          throws MailException
Description copied from interface: MailSender
Send the given array of simple mail messages in batch.

Specified by:
send in interface MailSender
Parameters:
simpleMessages - the messages to send
Throws:
MailParseException - in case of failure when parsing a message
MailAuthenticationException - in case of authentication failure
MailSendException - in case of failure when sending a message
MailException

createMimeMessage

public MimeMessage createMimeMessage()
This implementation creates a SmartMimeMessage, holding the specified default encoding and default FileTypeMap. This special defaults-carrying message will be autodetected by MimeMessageHelper, which will use the carried encoding and FileTypeMap unless explicitly overridden.

Specified by:
createMimeMessage in interface JavaMailSender
Returns:
the new MimeMessage instance
See Also:
setDefaultEncoding(java.lang.String), setDefaultFileTypeMap(javax.activation.FileTypeMap)

createMimeMessage

public MimeMessage createMimeMessage(InputStream contentStream)
                              throws MailException
Description copied from interface: JavaMailSender
Create a new JavaMail MimeMessage for the underlying JavaMail Session of this sender, using the given input stream as the message source.

Specified by:
createMimeMessage in interface JavaMailSender
Parameters:
contentStream - the raw MIME input stream for the message
Returns:
the new MimeMessage instance
Throws:
MailParseException - in case of message creation failure
MailException

send

public void send(MimeMessage mimeMessage)
          throws MailException
Description copied from interface: JavaMailSender
Send the given JavaMail MIME message. The message needs to have been created with JavaMailSender.createMimeMessage().

Specified by:
send in interface JavaMailSender
Parameters:
mimeMessage - message to send
Throws:
MailAuthenticationException - in case of authentication failure
MailSendException - in case of failure when sending the message
MailException
See Also:
JavaMailSender.createMimeMessage()

send

public void send(MimeMessage[] mimeMessages)
          throws MailException
Description copied from interface: JavaMailSender
Send the given array of JavaMail MIME messages in batch. The messages need to have been created with JavaMailSender.createMimeMessage().

Specified by:
send in interface JavaMailSender
Parameters:
mimeMessages - messages to send
Throws:
MailAuthenticationException - in case of authentication failure
MailSendException - in case of failure when sending a message
MailException
See Also:
JavaMailSender.createMimeMessage()

send

public void send(MimeMessagePreparator mimeMessagePreparator)
          throws MailException
Description copied from interface: JavaMailSender
Send the JavaMail MIME message prepared by the given MimeMessagePreparator.

Alternative way to prepare MimeMessage instances, instead of JavaMailSender.createMimeMessage() and JavaMailSender.send(MimeMessage) calls. Takes care of proper exception conversion.

Specified by:
send in interface JavaMailSender
Parameters:
mimeMessagePreparator - the preparator to use
Throws:
MailPreparationException - in case of failure when preparing the message
MailParseException - in case of failure when parsing the message
MailAuthenticationException - in case of authentication failure
MailSendException - in case of failure when sending the message
MailException

send

public void send(MimeMessagePreparator[] mimeMessagePreparators)
          throws MailException
Description copied from interface: JavaMailSender
Send the JavaMail MIME messages prepared by the given MimeMessagePreparators.

Alternative way to prepare MimeMessage instances, instead of JavaMailSender.createMimeMessage() and JavaMailSender.send(MimeMessage[]) calls. Takes care of proper exception conversion.

Specified by:
send in interface JavaMailSender
Parameters:
mimeMessagePreparators - the preparator to use
Throws:
MailPreparationException - in case of failure when preparing a message
MailParseException - in case of failure when parsing a message
MailAuthenticationException - in case of authentication failure
MailSendException - in case of failure when sending a message
MailException

doSend

protected void doSend(MimeMessage[] mimeMessages,
                      Object[] originalMessages)
               throws MailException
Actually send the given array of MimeMessages via JavaMail.

Parameters:
mimeMessages - MimeMessage objects to send
originalMessages - corresponding original message objects that the MimeMessages have been created from (with same array length and indices as the "mimeMessages" array), if any
Throws:
MailAuthenticationException - in case of authentication failure
MailSendException - in case of failure when sending a message
MailException

getTransport

protected Transport getTransport(Session session)
                          throws NoSuchProviderException
Obtain a Transport object from the given JavaMail Session, using the configured protocol.

Can be overridden in subclasses, e.g. to return a mock Transport object.

Throws:
NoSuchProviderException
See Also:
Session.getTransport(String), getProtocol()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MimeMailMessage

org.springframework.mail.javamail
Class MimeMailMessage

java.lang.Object
    extended by  org.springframework.mail.javamail.MimeMailMessage
All Implemented Interfaces:
MailMessage
public class MimeMailMessage
extends Object
implements MailMessage

Implementation of the MailMessage interface for a JavaMail MIME message, to let message population code interact with a simple message or a MIME message through a common interface.

Uses a MimeMessageHelper underneath. Can either be created with a MimeMessageHelper instance or with a JavaMail MimeMessage instance.

Since:
1.1.5
Author:
Juergen Hoeller
See Also:
MimeMessageHelper, MimeMessage

Constructor Summary
MimeMailMessage(MimeMessage mimeMessage)
Create a new MimeMailMessage based on the given JavaMail MimeMessage.
MimeMailMessage(MimeMessageHelper mimeMessageHelper)
Create a new MimeMailMessage based on the given MimeMessageHelper.
Method Summary
MimeMessage | getMimeMessage() Return the JavaMail MimeMessage that this MimeMailMessage is based on.
MimeMessageHelper | getMimeMessageHelper() Return the MimeMessageHelper that this MimeMailMessage is based on.
void | setBcc(String bcc)
void | setBcc(String[] bcc)
void | setCc(String cc)
void | setCc(String[] cc)
void | setFrom(String from)
void | setReplyTo(String replyTo)
void | setSentDate(Date sentDate)
void | setSubject(String subject)
void | setText(String text)
void | setTo(String to)
void | setTo(String[] to)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MimeMailMessage

public MimeMailMessage(MimeMessageHelper mimeMessageHelper)
Create a new MimeMailMessage based on the given MimeMessageHelper.

Parameters:
mimeMessageHelper - the MimeMessageHelper

MimeMailMessage

public MimeMailMessage(MimeMessage mimeMessage)
Create a new MimeMailMessage based on the given JavaMail MimeMessage.

Parameters:
mimeMessage - the JavaMail MimeMessage
Method Detail

getMimeMessageHelper

public final MimeMessageHelper getMimeMessageHelper()
Return the MimeMessageHelper that this MimeMailMessage is based on.

getMimeMessage

public final MimeMessage getMimeMessage()
Return the JavaMail MimeMessage that this MimeMailMessage is based on.

setFrom

public void setFrom(String from)
             throws MailParseException
Specified by:
setFrom in interface MailMessage
Throws:
MailParseException

setReplyTo

public void setReplyTo(String replyTo)
                throws MailParseException
Specified by:
setReplyTo in interface MailMessage
Throws:
MailParseException

setTo

public void setTo(String to)
           throws MailParseException
Specified by:
setTo in interface MailMessage
Throws:
MailParseException

setTo

public void setTo(String[] to)
           throws MailParseException
Specified by:
setTo in interface MailMessage
Throws:
MailParseException

setCc

public void setCc(String cc)
           throws MailParseException
Specified by:
setCc in interface MailMessage
Throws:
MailParseException

setCc

public void setCc(String[] cc)
           throws MailParseException
Specified by:
setCc in interface MailMessage
Throws:
MailParseException

setBcc

public void setBcc(String bcc)
            throws MailParseException
Specified by:
setBcc in interface MailMessage
Throws:
MailParseException

setBcc

public void setBcc(String[] bcc)
            throws MailParseException
Specified by:
setBcc in interface MailMessage
Throws:
MailParseException

setSentDate

public void setSentDate(Date sentDate)
                 throws MailParseException
Specified by:
setSentDate in interface MailMessage
Throws:
MailParseException

setSubject

public void setSubject(String subject)
                throws MailParseException
Specified by:
setSubject in interface MailMessage
Throws:
MailParseException

setText

public void setText(String text)
             throws MailParseException
Specified by:
setText in interface MailMessage
Throws:
MailParseException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MimeMessageHelper

org.springframework.mail.javamail
Class MimeMessageHelper

java.lang.Object
    extended by  org.springframework.mail.javamail.MimeMessageHelper

public class MimeMessageHelper
extends Object

Helper class for populating a MimeMessage.

Mirrors the simple setters of SimpleMailMessage, directly applying the values to the underlying MimeMessage. Allows for defining a character encoding for the entire message, automatically applied by all methods of this helper class.

Offers support for HTML text content, inline elements such as images, and typical mail attachments. Also supports personal names that accompany mail addresses. Note that advanced settings can still be applied directly to the underlying MimeMessage object!

Typically used in MimeMessagePreparator implementations or JavaMailSender client code: simply instantiating it as a MimeMessage wrapper, invoking setters on the wrapper, using the underlying MimeMessage for mail sending. Also used internally by JavaMailSenderImpl.

Sample code for an HTML mail with an inline image and a PDF attachment:

 mailSender.send(new MimeMessagePreparator() {
   public void prepare(MimeMessage mimeMessage) throws MessagingException {
     MimeMessageHelper message = new MimeMessageHelper(mimeMessage, true, "UTF-8");
     message.setFrom("me@mail.com");
     message.setTo("you@mail.com");
     message.setSubject("my subject");
     message.setText("my text <img src='cid:myLogo'>", true);
     message.addInline("myLogo", new ClassPathResource("img/mylogo.gif"));
     message.addAttachment("myDocument.pdf", new ClassPathResource("doc/myDocument.pdf"));
   }
 });
Consider using MimeMailMessage (which implements the common MailMessage interface, just like SimpleMailMessage) on top of this helper, in order to let message population code interact with a simple message or a MIME message through a common interface.

Warning regarding multipart mails: Simple MIME messages that just contain HTML text but no inline elements or attachments will work on more or less any email client that is capable of HTML rendering. However, inline elements and attachments are still a major compatibility issue between email clients: It's virtually impossible to get inline elements and attachments working across Microsoft Outlook, Lotus Notes and Mac Mail. Consider choosing a specific multipart mode for your needs: The javadoc on the MULTIPART_MODE constants contains more detailed information.

Since:
19.01.2004
Author:
Juergen Hoeller
See Also:
setText(String, boolean),
setText(String, String),
addInline(String, org.springframework.core.io.Resource),
addAttachment(String, org.springframework.core.io.InputStreamSource),
MULTIPART_MODE_MIXED_RELATED,
MULTIPART_MODE_RELATED,
getMimeMessage(),
JavaMailSender

Field Summary
static int | MULTIPART_MODE_MIXED Constant indicating a multipart message with a single root multipart element of type "mixed".
static int | MULTIPART_MODE_MIXED_RELATED Constant indicating a multipart message with a root multipart element "mixed" plus a nested multipart element of type "related".
static int | MULTIPART_MODE_NO Constant indicating a non-multipart message.
static int | MULTIPART_MODE_RELATED Constant indicating a multipart message with a single root multipart element of type "related".
Constructor Summary
MimeMessageHelper(MimeMessage mimeMessage)
Create a new MimeMessageHelper for the given MimeMessage, assuming a simple text message (no multipart content, i.e.
MimeMessageHelper(MimeMessage mimeMessage, boolean multipart)
Create a new MimeMessageHelper for the given MimeMessage, in multipart mode (supporting alternative texts, inline elements and attachments) if requested.
MimeMessageHelper(MimeMessage mimeMessage, boolean multipart, String encoding)
Create a new MimeMessageHelper for the given MimeMessage, in multipart mode (supporting alternative texts, inline elements and attachments) if requested.
MimeMessageHelper(MimeMessage mimeMessage, int multipartMode)
Create a new MimeMessageHelper for the given MimeMessage, in multipart mode (supporting alternative texts, inline elements and attachments) if requested.
MimeMessageHelper(MimeMessage mimeMessage, int multipartMode, String encoding)
Create a new MimeMessageHelper for the given MimeMessage, in multipart mode (supporting alternative texts, inline elements and attachments) if requested.
MimeMessageHelper(MimeMessage mimeMessage, String encoding)
Create a new MimeMessageHelper for the given MimeMessage, assuming a simple text message (no multipart content, i.e.
Method Summary
void | addAttachment(String attachmentFilename, DataSource dataSource) Add an attachment to the MimeMessage, taking the content from a javax.activation.DataSource.
void | addAttachment(String attachmentFilename, File file) Add an attachment to the MimeMessage, taking the content from a java.io.File.
void | addAttachment(String attachmentFilename, InputStreamSource inputStreamSource) Add an attachment to the MimeMessage, taking the content from an org.springframework.core.io.InputStreamResource.
void | addAttachment(String attachmentFilename, InputStreamSource inputStreamSource, String contentType) Add an attachment to the MimeMessage, taking the content from an org.springframework.core.io.InputStreamResource.
void | addBcc(InternetAddress bcc)
void | addBcc(String bcc)
void | addBcc(String bcc, String personal)
void | addCc(InternetAddress cc)
void | addCc(String cc)
void | addCc(String cc, String personal)
void | addInline(String contentId, DataSource dataSource) Add an inline element to the MimeMessage, taking the content from a javax.activation.DataSource.
void | addInline(String contentId, File file) Add an inline element to the MimeMessage, taking the content from a java.io.File.
void | addInline(String contentId, InputStreamSource inputStreamSource, String contentType) Add an inline element to the MimeMessage, taking the content from an org.springframework.core.InputStreamResource, and specifying the content type explicitly.
void | addInline(String contentId, Resource resource) Add an inline element to the MimeMessage, taking the content from a org.springframework.core.io.Resource.
void | addTo(InternetAddress to)
void | addTo(String to)
void | addTo(String to, String personal)
protected DataSource | createDataSource(InputStreamSource inputStreamSource, String contentType, String name) Create an Activation Framework DataSource for the given InputStreamSource.
protected void | createMimeMultiparts(MimeMessage mimeMessage, int multipartMode) Determine the MimeMultipart objects to use, which will be used to store attachments on the one hand and text(s) and inline elements on the other hand.
protected String | getDefaultEncoding(MimeMessage mimeMessage) Determine the default encoding for the given MimeMessage.
protected FileTypeMap | getDefaultFileTypeMap(MimeMessage mimeMessage) Determine the default Java Activation FileTypeMap for the given MimeMessage.
String | getEncoding() Return the specific character encoding used for this message, if any.
FileTypeMap | getFileTypeMap() Return the FileTypeMap used by this MimeMessageHelper.
MimeMessage | getMimeMessage() Return the underlying MimeMessage object.
MimeMultipart | getMimeMultipart() Return the underlying MIME "multipart/related" object, if any.
MimeMultipart | getRootMimeMultipart() Return the root MIME "multipart/mixed" object, if any.
boolean | isMultipart() Return whether this helper is in multipart mode, i.e.
boolean | isValidateAddresses() Return whether this helper will validate all addresses passed to it.
void | setBcc(InternetAddress bcc)
void | setBcc(InternetAddress[] bcc)
void | setBcc(String bcc)
void | setBcc(String[] bcc)
void | setCc(InternetAddress cc)
void | setCc(InternetAddress[] cc)
void | setCc(String cc)
void | setCc(String[] cc)
void | setFileTypeMap(FileTypeMap fileTypeMap) Set the Java Activation Framework FileTypeMap to use for determining the content type of inline content and attachments that get added to the message.
void | setFrom(InternetAddress from)
void | setFrom(String from)
void | setFrom(String from, String personal)
protected void | setMimeMultiparts(MimeMultipart root, MimeMultipart main) Set the given MimeMultipart objects for use by this MimeMessageHelper.
void | setPriority(int priority) Set the priority ("X-Priority" header) of the message.
void | setReplyTo(InternetAddress replyTo)
void | setReplyTo(String replyTo)
void | setReplyTo(String replyTo, String personal)
void | setSentDate(Date sentDate) Set the sent-date of the message.
void | setSubject(String subject) Set the subject of the message, using the correct encoding.
void | setText(String text) Set the given text directly as content in non-multipart mode or as default body part in multipart mode.
void | setText(String text, boolean html) Set the given text directly as content in non-multipart mode or as default body part in multipart mode.
void | setText(String plainText, String htmlText) Set the given plain text and HTML text as alternatives, offering both options to the email client.
void | setTo(InternetAddress to)
void | setTo(InternetAddress[] to)
void | setTo(String to)
void | setTo(String[] to)
void | setValidateAddresses(boolean validateAddresses) Set whether to validate all addresses which get passed to this helper.
protected void | validateAddress(InternetAddress address) Validate the given mail address.
protected void | validateAddresses(InternetAddress[] addresses) Validate all given mail addresses.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

MULTIPART_MODE_NO

public static final int MULTIPART_MODE_NO
Constant indicating a non-multipart message.

See Also:
Constant Field Values

MULTIPART_MODE_MIXED

public static final int MULTIPART_MODE_MIXED
Constant indicating a multipart message with a single root multipart element of type "mixed". Texts, inline elements and attachements will all get added to that root element.

This was Spring 1.0's default behavior. It is known to work properly on Outlook. However, other mail clients tend to misinterpret inline elements as attachments and/or show attachments inline as well.

See Also:
Constant Field Values

MULTIPART_MODE_RELATED

public static final int MULTIPART_MODE_RELATED
Constant indicating a multipart message with a single root multipart element of type "related". Texts, inline elements and attachements will all get added to that root element.

This was the default behavior from Spring 1.1 up to 1.2 final. This is the "Microsoft multipart mode", as natively sent by Outlook. It is known to work properly on Outlook, Outlook Express, Yahoo Mail, and to a large degree also on Mac Mail (with an additional attachment listed for an inline element, despite the inline element also shown inline). Does not work properly on Lotus Notes (attachments won't be shown there).

See Also:
Constant Field Values

MULTIPART_MODE_MIXED_RELATED

public static final int MULTIPART_MODE_MIXED_RELATED
Constant indicating a multipart message with a root multipart element "mixed" plus a nested multipart element of type "related". Texts and inline elements will get added to the nested "related" element, while attachments will get added to the "mixed" root element.

This is the default since Spring 1.2.1. This is arguably the most correct MIME structure, according to the MIME spec: It is known to work properly on Outlook, Outlook Express, Yahoo Mail, and Lotus Notes. Does not work properly on Mac Mail. If you target Mac Mail or experience issues with specific mails on Outlook, consider using MULTIPART_MODE_RELATED instead.

See Also:
Constant Field Values
Constructor Detail

MimeMessageHelper

public MimeMessageHelper(MimeMessage mimeMessage)
Create a new MimeMessageHelper for the given MimeMessage, assuming a simple text message (no multipart content, i.e. no alternative texts and no inline elements or attachments).

The character encoding for the message will be taken from the passed-in MimeMessage object, if carried there. Else, JavaMail's default encoding will be used.

Parameters:
mimeMessage - MimeMessage to work on
See Also:
MimeMessageHelper(javax.mail.internet.MimeMessage, boolean),
getDefaultEncoding(javax.mail.internet.MimeMessage),
JavaMailSenderImpl.setDefaultEncoding(java.lang.String)

MimeMessageHelper

public MimeMessageHelper(MimeMessage mimeMessage,
                         String encoding)
Create a new MimeMessageHelper for the given MimeMessage, assuming a simple text message (no multipart content, i.e. no alternative texts and no inline elements or attachments).

Parameters:
mimeMessage - MimeMessage to work on
encoding - the character encoding to use for the message
See Also:
MimeMessageHelper(javax.mail.internet.MimeMessage, boolean)

MimeMessageHelper

public MimeMessageHelper(MimeMessage mimeMessage,
                         boolean multipart)
                  throws MessagingException
Create a new MimeMessageHelper for the given MimeMessage, in multipart mode (supporting alternative texts, inline elements and attachments) if requested.

Consider using the MimeMessageHelper constructor that takes a multipartMode argument to choose a specific multipart mode other than MULTIPART_MODE_MIXED_RELATED.

The character encoding for the message will be taken from the passed-in MimeMessage object, if carried there. Else, JavaMail's default encoding will be used.

Parameters:
mimeMessage - MimeMessage to work on
multipart - whether to create a multipart message that supports alternative texts, inline elements and attachments (corresponds to MULTIPART_MODE_MIXED_RELATED)
Throws:
MessagingException - if multipart creation failed
See Also:
MimeMessageHelper(javax.mail.internet.MimeMessage, int),
getDefaultEncoding(javax.mail.internet.MimeMessage),
JavaMailSenderImpl.setDefaultEncoding(java.lang.String)

MimeMessageHelper

public MimeMessageHelper(MimeMessage mimeMessage,
                         boolean multipart,
                         String encoding)
                  throws MessagingException
Create a new MimeMessageHelper for the given MimeMessage, in multipart mode (supporting alternative texts, inline elements and attachments) if requested.

Consider using the MimeMessageHelper constructor that takes a multipartMode argument to choose a specific multipart mode other than MULTIPART_MODE_MIXED_RELATED.

Parameters:
mimeMessage - MimeMessage to work on
multipart - whether to create a multipart message that supports alternative texts, inline elements and attachments (corresponds to MULTIPART_MODE_MIXED_RELATED)
encoding - the character encoding to use for the message
Throws:
MessagingException - if multipart creation failed
See Also:
MimeMessageHelper(javax.mail.internet.MimeMessage, int, String)

MimeMessageHelper

public MimeMessageHelper(MimeMessage mimeMessage,
                         int multipartMode)
                  throws MessagingException
Create a new MimeMessageHelper for the given MimeMessage, in multipart mode (supporting alternative texts, inline elements and attachments) if requested.

The character encoding for the message will be taken from the passed-in MimeMessage object, if carried there. Else, JavaMail's default encoding will be used.

Parameters:
mimeMessage - MimeMessage to work on
multipartMode - which kind of multipart message to create (MIXED, RELATED, MIXED_RELATED, or NO)
Throws:
MessagingException - if multipart creation failed
See Also:
MULTIPART_MODE_NO, MULTIPART_MODE_MIXED, MULTIPART_MODE_RELATED, MULTIPART_MODE_MIXED_RELATED, getDefaultEncoding(javax.mail.internet.MimeMessage), JavaMailSenderImpl.setDefaultEncoding(java.lang.String)

MimeMessageHelper

public MimeMessageHelper(MimeMessage mimeMessage,
                         int multipartMode,
                         String encoding)
                  throws MessagingException
Create a new MimeMessageHelper for the given MimeMessage, in multipart mode (supporting alternative texts, inline elements and attachments) if requested.

Parameters:
mimeMessage - MimeMessage to work on
multipartMode - which kind of multipart message to create (MIXED, RELATED, MIXED_RELATED, or NO)
encoding - the character encoding to use for the message
Throws:
MessagingException - if multipart creation failed
See Also:
MULTIPART_MODE_NO, MULTIPART_MODE_MIXED, MULTIPART_MODE_RELATED, MULTIPART_MODE_MIXED_RELATED
Method Detail

getMimeMessage

public final MimeMessage getMimeMessage()
Return the underlying MimeMessage object.

createMimeMultiparts

protected void createMimeMultiparts(MimeMessage mimeMessage,
                                    int multipartMode)
                             throws MessagingException
Determine the MimeMultipart objects to use, which will be used to store attachments on the one hand and text(s) and inline elements on the other hand.

Texts and inline elements can either be stored in the root element itself (MULTIPART_MODE_MIXED, MULTIPART_MODE_RELATED) or in a nested element rather than the root element directly (MULTIPART_MODE_MIXED_RELATED).

By default, the root MimeMultipart element will be of type "mixed" (MULTIPART_MODE_MIXED) or "related" (MULTIPART_MODE_RELATED). The main multipart element will either be added as nested element of type "related" (MULTIPART_MODE_MIXED_RELATED) or be identical to the root element itself (MULTIPART_MODE_MIXED, MULTIPART_MODE_RELATED).

Parameters:
mimeMessage - the MimeMessage object to add the root MimeMultipart object to
multipartMode - the multipart mode, as passed into the constructor (MIXED, RELATED, MIXED_RELATED, or NO)
Throws:
MessagingException - if multipart creation failed
See Also:
setMimeMultiparts(javax.mail.internet.MimeMultipart, javax.mail.internet.MimeMultipart), MULTIPART_MODE_NO, MULTIPART_MODE_MIXED, MULTIPART_MODE_RELATED, MULTIPART_MODE_MIXED_RELATED

setMimeMultiparts

protected final void setMimeMultiparts(MimeMultipart root,
                                       MimeMultipart main)
Set the given MimeMultipart objects for use by this MimeMessageHelper.

Parameters:
root - the root MimeMultipart object, which attachments will be added to; or null to indicate no multipart at all
main - the main MimeMultipart object, which text(s) and inline elements will be added to (can be the same as the root multipart object, or an element nested underneath the root multipart element)

isMultipart

public final boolean isMultipart()
Return whether this helper is in multipart mode, i.e. whether it holds a multipart message.

See Also:
MimeMessageHelper(MimeMessage, boolean)

getRootMimeMultipart

public final MimeMultipart getRootMimeMultipart()
                                         throws IllegalStateException
Return the root MIME "multipart/mixed" object, if any. Can be used to manually add attachments.

This will be the direct content of the MimeMessage, in case of a multipart mail.

Throws:
IllegalStateException - if this helper is not in multipart mode
See Also:
isMultipart(),
getMimeMessage(),
Multipart.addBodyPart(javax.mail.BodyPart)

getMimeMultipart

public final MimeMultipart getMimeMultipart()
                                     throws IllegalStateException
Return the underlying MIME "multipart/related" object, if any. Can be used to manually add body parts, inline elements, etc.

This will be nested within the root MimeMultipart, in case of a multipart mail.

Throws:
IllegalStateException - if this helper is not in multipart mode
See Also:
isMultipart(),
getRootMimeMultipart(),
Multipart.addBodyPart(javax.mail.BodyPart)

getDefaultEncoding

protected String getDefaultEncoding(MimeMessage mimeMessage)
Determine the default encoding for the given MimeMessage.

Parameters:
mimeMessage - the passed-in MimeMessage
Returns:
the default encoding associated with the MimeMessage, or null if none found

getEncoding

public String getEncoding()
Return the specific character encoding used for this message, if any.

getDefaultFileTypeMap

protected FileTypeMap getDefaultFileTypeMap(MimeMessage mimeMessage)
Determine the default Java Activation FileTypeMap for the given MimeMessage.

Parameters:
mimeMessage - the passed-in MimeMessage
Returns:
the default FileTypeMap associated with the MimeMessage, or a default ConfigurableMimeFileTypeMap if none found for the message
See Also:
ConfigurableMimeFileTypeMap

setFileTypeMap

public void setFileTypeMap(FileTypeMap fileTypeMap)
Set the Java Activation Framework FileTypeMap to use for determining the content type of inline content and attachments that get added to the message.

Default is the FileTypeMap that the underlying MimeMessage carries, if any, or the Activation Framework's default FileTypeMap instance else.

See Also:
addInline(java.lang.String, javax.activation.DataSource),
addAttachment(java.lang.String, javax.activation.DataSource),
getDefaultFileTypeMap(javax.mail.internet.MimeMessage),
JavaMailSenderImpl.setDefaultFileTypeMap(javax.activation.FileTypeMap),
FileTypeMap.getDefaultFileTypeMap(),
ConfigurableMimeFileTypeMap

getFileTypeMap

public FileTypeMap getFileTypeMap()
Return the FileTypeMap used by this MimeMessageHelper.

setValidateAddresses

public void setValidateAddresses(boolean validateAddresses)
Set whether to validate all addresses which get passed to this helper. Default is "false".

Note that this is by default just available for JavaMail >= 1.3. You can override the default validateAddress method for validation on older JavaMail versions (or for custom validation).

See Also:
validateAddress(javax.mail.internet.InternetAddress)

isValidateAddresses

public boolean isValidateAddresses()
Return whether this helper will validate all addresses passed to it.

validateAddress

protected void validateAddress(InternetAddress address)
                        throws AddressException
Validate the given mail address. Called by all of MimeMessageHelper's address setters and adders.

Default implementation invokes InternetAddress.validate(), provided that address validation is activated for the helper instance.

Note that this method will just work on JavaMail >= 1.3. You can override it for validation on older JavaMail versions or for custom validation.

Parameters:
address - the address to validate
Throws:
AddressException - if validation failed
See Also:
isValidateAddresses(), InternetAddress.validate()

validateAddresses

protected void validateAddresses(InternetAddress[] addresses)
                          throws AddressException
Validate all given mail addresses. Default implementation simply delegates to validateAddress for each address.

Parameters:
addresses - the addresses to validate
Throws:
AddressException - if validation failed
See Also:
validateAddress(InternetAddress)

setFrom

public void setFrom(InternetAddress from)
             throws MessagingException
Throws:
MessagingException

setFrom

public void setFrom(String from)
             throws MessagingException
Throws:
MessagingException

setFrom

public void setFrom(String from,
                    String personal)
             throws MessagingException,
                    UnsupportedEncodingException
Throws:
MessagingException
UnsupportedEncodingException

setReplyTo

public void setReplyTo(InternetAddress replyTo)
                throws MessagingException
Throws:
MessagingException

setReplyTo

public void setReplyTo(String replyTo)
                throws MessagingException
Throws:
MessagingException

setReplyTo

public void setReplyTo(String replyTo,
                       String personal)
                throws MessagingException,
                       UnsupportedEncodingException
Throws:
MessagingException
UnsupportedEncodingException

setTo

public void setTo(InternetAddress to)
           throws MessagingException
Throws:
MessagingException

setTo

public void setTo(InternetAddress[] to)
           throws MessagingException
Throws:
MessagingException

setTo

public void setTo(String to)
           throws MessagingException
Throws:
MessagingException

setTo

public void setTo(String[] to)
           throws MessagingException
Throws:
MessagingException

addTo

public void addTo(InternetAddress to)
           throws MessagingException
Throws:
MessagingException

addTo

public void addTo(String to)
           throws MessagingException
Throws:
MessagingException

addTo

public void addTo(String to,
                  String personal)
           throws MessagingException,
                  UnsupportedEncodingException
Throws:
MessagingException
UnsupportedEncodingException

setCc

public void setCc(InternetAddress cc)
           throws MessagingException
Throws:
MessagingException

setCc

public void setCc(InternetAddress[] cc)
           throws MessagingException
Throws:
MessagingException

setCc

public void setCc(String cc)
           throws MessagingException
Throws:
MessagingException

setCc

public void setCc(String[] cc)
           throws MessagingException
Throws:
MessagingException

addCc

public void addCc(InternetAddress cc)
           throws MessagingException
Throws:
MessagingException

addCc

public void addCc(String cc)
           throws MessagingException
Throws:
MessagingException

addCc

public void addCc(String cc,
                  String personal)
           throws MessagingException,
                  UnsupportedEncodingException
Throws:
MessagingException
UnsupportedEncodingException

setBcc

public void setBcc(InternetAddress bcc)
            throws MessagingException
Throws:
MessagingException

setBcc

public void setBcc(InternetAddress[] bcc)
            throws MessagingException
Throws:
MessagingException

setBcc

public void setBcc(String bcc)
            throws MessagingException
Throws:
MessagingException

setBcc

public void setBcc(String[] bcc)
            throws MessagingException
Throws:
MessagingException

addBcc

public void addBcc(InternetAddress bcc)
            throws MessagingException
Throws:
MessagingException

addBcc

public void addBcc(String bcc)
            throws MessagingException
Throws:
MessagingException

addBcc

public void addBcc(String bcc,
                   String personal)
            throws MessagingException,
                   UnsupportedEncodingException
Throws:
MessagingException
UnsupportedEncodingException

setPriority

public void setPriority(int priority)
                 throws MessagingException
Set the priority ("X-Priority" header) of the message.

Parameters:
priority - the priority value; typically between 1 (highest) and 5 (lowest)
Throws:
MessagingException - in case of errors

setSentDate

public void setSentDate(Date sentDate)
                 throws MessagingException
Set the sent-date of the message.

Parameters:
sentDate - the date to set (never null)
Throws:
MessagingException - in case of errors

setSubject

public void setSubject(String subject)
                throws MessagingException
Set the subject of the message, using the correct encoding.

Parameters:
subject - the subject text
Throws:
MessagingException - in case of errors

setText

public void setText(String text)
             throws MessagingException
Set the given text directly as content in non-multipart mode or as default body part in multipart mode. Always applies the default content type "text/plain".

NOTE: Invoke addInline(java.lang.String, javax.activation.DataSource) after setText; else, mail readers might not be able to resolve inline references correctly.

Parameters:
text - the text for the message
Throws:
MessagingException - in case of errors

setText

public void setText(String text,
                    boolean html)
             throws MessagingException
Set the given text directly as content in non-multipart mode or as default body part in multipart mode. The "html" flag determines the content type to apply.

NOTE: Invoke addInline(java.lang.String, javax.activation.DataSource) after setText; else, mail readers might not be able to resolve inline references correctly.

Parameters:
text - the text for the message
html - whether to apply content type "text/html" for an HTML mail, using default content type ("text/plain") else
Throws:
MessagingException - in case of errors

setText

public void setText(String plainText,
                    String htmlText)
             throws MessagingException
Set the given plain text and HTML text as alternatives, offering both options to the email client. Requires multipart mode.

NOTE: Invoke addInline(java.lang.String, javax.activation.DataSource) after setText; else, mail readers might not be able to resolve inline references correctly.

Parameters:
plainText - the plain text for the message
htmlText - the HTML text for the message
Throws:
MessagingException - in case of errors

addInline

public void addInline(String contentId,
                      DataSource dataSource)
               throws MessagingException
Add an inline element to the MimeMessage, taking the content from a javax.activation.DataSource.

Note that the InputStream returned by the DataSource implementation needs to be a fresh one on each call, as JavaMail will invoke getInputStream() multiple times.

NOTE: Invoke addInline after setText(java.lang.String); else, mail readers might not be able to resolve inline references correctly.

Parameters:
contentId - the content ID to use. Will end up as "Content-ID" header in the body part, surrounded by angle brackets: e.g. "myId" -> "<myId>". Can be referenced in HTML source via src="cid:myId" expressions.
dataSource - the javax.activation.DataSource to take the content from, determining the InputStream and the content type
Throws:
MessagingException - in case of errors
See Also:
addInline(String, java.io.File), addInline(String, org.springframework.core.io.Resource)

addInline

public void addInline(String contentId,
                      File file)
               throws MessagingException
Add an inline element to the MimeMessage, taking the content from a java.io.File.

The content type will be determined by the name of the given content file. Do not use this for temporary files with arbitrary filenames (possibly ending in ".tmp" or the like)!

NOTE: Invoke addInline after setText(java.lang.String); else, mail readers might not be able to resolve inline references correctly.

Parameters:
contentId - the content ID to use. Will end up as "Content-ID" header in the body part, surrounded by angle brackets: e.g. "myId" -> "<myId>". Can be referenced in HTML source via src="cid:myId" expressions.
file - the File resource to take the content from
Throws:
MessagingException - in case of errors
See Also:
setText(java.lang.String),
addInline(String, org.springframework.core.io.Resource),
addInline(String, javax.activation.DataSource)

addInline

public void addInline(String contentId,
                      Resource resource)
               throws MessagingException
Add an inline element to the MimeMessage, taking the content from a org.springframework.core.io.Resource.

The content type will be determined by the name of the given content file. Do not use this for temporary files with arbitrary filenames (possibly ending in ".tmp" or the like)!

Note that the InputStream returned by the Resource implementation needs to be a fresh one on each call, as JavaMail will invoke getInputStream() multiple times.

NOTE: Invoke addInline after setText(java.lang.String); else, mail readers might not be able to resolve inline references correctly.

Parameters:
contentId - the content ID to use. Will end up as "Content-ID" header in the body part, surrounded by angle brackets: e.g. "myId" -> "<myId>". Can be referenced in HTML source via src="cid:myId" expressions.
resource - the resource to take the content from
Throws:
MessagingException - in case of errors
See Also:
setText(java.lang.String),
addInline(String, java.io.File),
addInline(String, javax.activation.DataSource)

addInline

public void addInline(String contentId,
                      InputStreamSource inputStreamSource,
                      String contentType)
               throws MessagingException
Add an inline element to the MimeMessage, taking the content from an org.springframework.core.InputStreamResource, and specifying the content type explicitly.

You can determine the content type for any given filename via a Java Activation Framework's FileTypeMap, for example the one held by this helper.

Note that the InputStream returned by the InputStreamSource implementation needs to be a fresh one on each call, as JavaMail will invoke getInputStream() multiple times.

NOTE: Invoke addInline after setText; else, mail readers might not be able to resolve inline references correctly.

Parameters:
contentId - the content ID to use. Will end up as "Content-ID" header in the body part, surrounded by angle brackets: e.g. "myId" -> "<myId>". Can be referenced in HTML source via src="cid:myId" expressions.
inputStreamSource - the resource to take the content from
contentType - the content type to use for the element
Throws:
MessagingException - in case of errors
See Also:
setText(java.lang.String),
getFileTypeMap(),
addInline(String, org.springframework.core.io.Resource),
addInline(String, javax.activation.DataSource)

addAttachment

public void addAttachment(String attachmentFilename,
                          DataSource dataSource)
                   throws MessagingException
Add an attachment to the MimeMessage, taking the content from a javax.activation.DataSource.

Note that the InputStream returned by the DataSource implementation needs to be a fresh one on each call, as JavaMail will invoke getInputStream() multiple times.

Parameters:
attachmentFilename - the name of the attachment as it will appear in the mail (the content type will be determined by this)
dataSource - the javax.activation.DataSource to take the content from, determining the InputStream and the content type
Throws:
MessagingException - in case of errors
See Also:
addAttachment(String, org.springframework.core.io.InputStreamSource), addAttachment(String, java.io.File)

addAttachment

public void addAttachment(String attachmentFilename,
                          File file)
                   throws MessagingException
Add an attachment to the MimeMessage, taking the content from a java.io.File.

The content type will be determined by the name of the given content file. Do not use this for temporary files with arbitrary filenames (possibly ending in ".tmp" or the like)!

Parameters:
attachmentFilename - the name of the attachment as it will appear in the mail
file - the File resource to take the content from
Throws:
MessagingException - in case of errors
See Also:
addAttachment(String, org.springframework.core.io.InputStreamSource), addAttachment(String, javax.activation.DataSource)

addAttachment

public void addAttachment(String attachmentFilename,
                          InputStreamSource inputStreamSource)
                   throws MessagingException
Add an attachment to the MimeMessage, taking the content from an org.springframework.core.io.InputStreamResource.

The content type will be determined by the given filename for the attachment. Thus, any content source will be fine, including temporary files with arbitrary filenames.

Note that the InputStream returned by the InputStreamSource implementation needs to be a fresh one on each call, as JavaMail will invoke getInputStream() multiple times.

Parameters:
attachmentFilename - the name of the attachment as it will appear in the mail
inputStreamSource - the resource to take the content from (all of Spring's Resource implementations can be passed in here)
Throws:
MessagingException - in case of errors
See Also:
addAttachment(String, java.io.File), addAttachment(String, javax.activation.DataSource), Resource

addAttachment

public void addAttachment(String attachmentFilename,
                          InputStreamSource inputStreamSource,
                          String contentType)
                   throws MessagingException
Add an attachment to the MimeMessage, taking the content from an org.springframework.core.io.InputStreamResource.

Note that the InputStream returned by the InputStreamSource implementation needs to be a fresh one on each call, as JavaMail will invoke getInputStream() multiple times.

Parameters:
attachmentFilename - the name of the attachment as it will appear in the mail
inputStreamSource - the resource to take the content from (all of Spring's Resource implementations can be passed in here)
contentType - the content type to use for the element
Throws:
MessagingException - in case of errors
See Also:
addAttachment(String, java.io.File), addAttachment(String, javax.activation.DataSource), Resource

createDataSource

protected DataSource createDataSource(InputStreamSource inputStreamSource,
                                      String contentType,
                                      String name)
Create an Activation Framework DataSource for the given InputStreamSource.

Parameters:
inputStreamSource - the InputStreamSource (typically a Spring Resource)
contentType - the content type
name - the name of the DataSource
Returns:
the Activation Framework DataSource
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.mock.jndi

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.mock.jndi

The simplest implementation of the JNDI SPI that could possibly work.

See:
Description

Class Summary
ExpectedLookupTemplate | Simple extension of the JndiTemplate class that always returns a given object.
SimpleNamingContext | Simple implementation of a JNDI naming context.
SimpleNamingContextBuilder | Simple implementation of a JNDI naming context builder.

Package org.springframework.mock.jndi Description

The simplest implementation of the JNDI SPI that could possibly work.

Useful for setting up a simple JNDI environment for test suites or stand-alone applications. If, for example, JDBC DataSources get bound to the same JNDI names as within a Java EE container, both application code and configuration can be reused without changes.


org.springframework.mock.jndi Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.mock.jndi

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jndi.JndiTemplate
      • org.springframework.mock.jndi.ExpectedLookupTemplate
    • org.springframework.mock.jndi.SimpleNamingContext (implements javax.naming.Context)
    • org.springframework.mock.jndi.SimpleNamingContextBuilder (implements javax.naming.spi.InitialContextFactoryBuilder)


ExpectedLookupTemplate

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.mock.jndi
Class ExpectedLookupTemplate

java.lang.Object
    extended by  org.springframework.jndi.JndiTemplate
        extended by  org.springframework.mock.jndi.ExpectedLookupTemplate

public class ExpectedLookupTemplate
extends JndiTemplate

Simple extension of the JndiTemplate class that always returns a given object. Very useful for testing. Effectively a mock object.

Author:
Rod Johnson, Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.jndi.JndiTemplate
logger
Constructor Summary
ExpectedLookupTemplate()
Construct a new JndiTemplate that will always return given objects for given names.
ExpectedLookupTemplate(String name, Object object)
Construct a new JndiTemplate that will always return the given object, but honour only requests for the given name.
Method Summary
void | addObject(String name, Object object) Add the given object to the list of JNDI objects that this template will expose.
Object | lookup(String name) If the name is the expected name specified in the constructor, return the object provided in the constructor.
Methods inherited from class org.springframework.jndi.JndiTemplate
bind, createInitialContext, execute, getContext, getEnvironment, lookup, rebind, releaseContext, setEnvironment, unbind
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ExpectedLookupTemplate

public ExpectedLookupTemplate()
Construct a new JndiTemplate that will always return given objects for given names. To be populated through addObject calls.

See Also:
addObject(String, Object)

ExpectedLookupTemplate

public ExpectedLookupTemplate(String name,
                              Object object)
Construct a new JndiTemplate that will always return the given object, but honour only requests for the given name.

Parameters:
name - the name the client is expected to look up
object - the object that will be returned
Method Detail

addObject

public void addObject(String name,
                      Object object)
Add the given object to the list of JNDI objects that this template will expose.

Parameters:
name - the name the client is expected to look up
object - the object that will be returned

lookup

public Object lookup(String name)
              throws NamingException
If the name is the expected name specified in the constructor, return the object provided in the constructor. If the name is unexpected, a respective NamingException gets thrown.

Overrides:
lookup in class JndiTemplate
Parameters:
name - the JNDI name of the object
Returns:
object found (cannot be null; if a not so well-behaved JNDI implementations returns null, a NamingException gets thrown)
Throws:
NamingException - if there is no object with the given name bound to JNDI
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


SimpleNamingContext

org.springframework.mock.jndi
Class SimpleNamingContext

java.lang.Object
    extended by  org.springframework.mock.jndi.SimpleNamingContext
All Implemented Interfaces:
Context
public class SimpleNamingContext
extends Object
implements Context

Simple implementation of a JNDI naming context. Only supports binding plain Objects to String names. Mainly for test environments, but also usable for standalone applications.

This class is not intended for direct usage by applications, although it can be used for example to override JndiTemplate's createInitialContext method in unit tests. Typically, SimpleNamingContextBuilder will be used to set up a JVM-level JNDI environment.

Author:
Rod Johnson, Juergen Hoeller
See Also:
SimpleNamingContextBuilder, JndiTemplate.createInitialContext()

Field Summary
Fields inherited from interface javax.naming.Context
APPLET, AUTHORITATIVE, BATCHSIZE, DNS_URL, INITIAL_CONTEXT_FACTORY, LANGUAGE, OBJECT_FACTORIES, PROVIDER_URL, REFERRAL, SECURITY_AUTHENTICATION, SECURITY_CREDENTIALS, SECURITY_PRINCIPAL, SECURITY_PROTOCOL, STATE_FACTORIES, URL_PKG_PREFIXES
Constructor Summary
SimpleNamingContext()
Create a new naming context.
SimpleNamingContext(String root)
Create a new naming context with the given naming root.
SimpleNamingContext(String root, Hashtable<String,Object> boundObjects, Hashtable<String,Object> env)
Create a new naming context with the given naming root, the given name/object map, and the JNDI environment entries.
Method Summary
Object | addToEnvironment(String propName, Object propVal)
void | bind(Name name, Object obj)
void | bind(String name, Object obj) Bind the given object to the given name.
void | close()
Name | composeName(Name name, Name prefix)
String | composeName(String name, String prefix)
Context | createSubcontext(Name name)
Context | createSubcontext(String name)
void | destroySubcontext(Name name)
void | destroySubcontext(String name)
Hashtable<String,Object> | getEnvironment()
String | getNameInNamespace()
NameParser | getNameParser(Name name)
NameParser | getNameParser(String name)
NamingEnumeration<NameClassPair> | list(Name name)
NamingEnumeration<NameClassPair> | list(String root)
NamingEnumeration<Binding> | listBindings(Name name)
NamingEnumeration<Binding> | listBindings(String root)
Object | lookup(Name name)
Object | lookup(String lookupName) Look up the object with the given name.
Object | lookupLink(Name name)
Object | lookupLink(String name)
void | rebind(Name name, Object obj)
void | rebind(String name, Object obj)
Object | removeFromEnvironment(String propName)
void | rename(Name oldName, Name newName)
void | rename(String oldName, String newName)
void | unbind(Name name)
void | unbind(String name)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleNamingContext

public SimpleNamingContext()
Create a new naming context.

SimpleNamingContext

public SimpleNamingContext(String root)
Create a new naming context with the given naming root.

SimpleNamingContext

public SimpleNamingContext(String root,
                           Hashtable<String,Object> boundObjects,
                           Hashtable<String,Object> env)
Create a new naming context with the given naming root, the given name/object map, and the JNDI environment entries.

Method Detail

list

public NamingEnumeration<NameClassPair> list(String root)
                                      throws NamingException
Specified by:
list in interface Context
Throws:
NamingException

listBindings

public NamingEnumeration<Binding> listBindings(String root)
                                        throws NamingException
Specified by:
listBindings in interface Context
Throws:
NamingException

lookup

public Object lookup(String lookupName)
              throws NameNotFoundException
Look up the object with the given name.

Note: Not intended for direct use by applications. Will be used by any standard InitialContext JNDI lookups.

Specified by:
lookup in interface Context
Throws:
NameNotFoundException - if the object could not be found

lookupLink

public Object lookupLink(String name)
                  throws NameNotFoundException
Specified by:
lookupLink in interface Context
Throws:
NameNotFoundException

bind

public void bind(String name,
                 Object obj)
Bind the given object to the given name. Note: Not intended for direct use by applications if setting up a JVM-level JNDI environment. Use SimpleNamingContextBuilder to set up JNDI bindings then.

Specified by:
bind in interface Context
See Also:
SimpleNamingContextBuilder.bind(java.lang.String, java.lang.Object)

unbind

public void unbind(String name)
Specified by:
unbind in interface Context

rebind

public void rebind(String name,
                   Object obj)
Specified by:
rebind in interface Context

rename

public void rename(String oldName,
                   String newName)
            throws NameNotFoundException
Specified by:
rename in interface Context
Throws:
NameNotFoundException

createSubcontext

public Context createSubcontext(String name)
Specified by:
createSubcontext in interface Context

destroySubcontext

public void destroySubcontext(String name)
Specified by:
destroySubcontext in interface Context

composeName

public String composeName(String name,
                          String prefix)
Specified by:
composeName in interface Context

getEnvironment

public Hashtable<String,Object> getEnvironment()
Specified by:
getEnvironment in interface Context

addToEnvironment

public Object addToEnvironment(String propName,
                               Object propVal)
Specified by:
addToEnvironment in interface Context

removeFromEnvironment

public Object removeFromEnvironment(String propName)
Specified by:
removeFromEnvironment in interface Context

close

public void close()
Specified by:
close in interface Context

list

public NamingEnumeration<NameClassPair> list(Name name)
                                      throws NamingException
Specified by:
list in interface Context
Throws:
NamingException

listBindings

public NamingEnumeration<Binding> listBindings(Name name)
                                        throws NamingException
Specified by:
listBindings in interface Context
Throws:
NamingException

lookup

public Object lookup(Name name)
              throws NamingException
Specified by:
lookup in interface Context
Throws:
NamingException

lookupLink

public Object lookupLink(Name name)
                  throws NamingException
Specified by:
lookupLink in interface Context
Throws:
NamingException

bind

public void bind(Name name,
                 Object obj)
          throws NamingException
Specified by:
bind in interface Context
Throws:
NamingException

unbind

public void unbind(Name name)
            throws NamingException
Specified by:
unbind in interface Context
Throws:
NamingException

rebind

public void rebind(Name name,
                   Object obj)
            throws NamingException
Specified by:
rebind in interface Context
Throws:
NamingException

rename

public void rename(Name oldName,
                   Name newName)
            throws NamingException
Specified by:
rename in interface Context
Throws:
NamingException

createSubcontext

public Context createSubcontext(Name name)
                         throws NamingException
Specified by:
createSubcontext in interface Context
Throws:
NamingException

destroySubcontext

public void destroySubcontext(Name name)
                       throws NamingException
Specified by:
destroySubcontext in interface Context
Throws:
NamingException

getNameInNamespace

public String getNameInNamespace()
                          throws NamingException
Specified by:
getNameInNamespace in interface Context
Throws:
NamingException

getNameParser

public NameParser getNameParser(Name name)
                         throws NamingException
Specified by:
getNameParser in interface Context
Throws:
NamingException

getNameParser

public NameParser getNameParser(String name)
                         throws NamingException
Specified by:
getNameParser in interface Context
Throws:
NamingException

composeName

public Name composeName(Name name,
                        Name prefix)
                 throws NamingException
Specified by:
composeName in interface Context
Throws:
NamingException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleNamingContextBuilder

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.mock.jndi
Class SimpleNamingContextBuilder

java.lang.Object
    extended by  org.springframework.mock.jndi.SimpleNamingContextBuilder
All Implemented Interfaces:
InitialContextFactoryBuilder
public class SimpleNamingContextBuilder
extends Object
implements InitialContextFactoryBuilder

Simple implementation of a JNDI naming context builder.

Mainly targeted at test environments, where each test case can configure JNDI appropriately, so that new InitialContext() will expose the required objects. Also usable for standalone applications, e.g. for binding a JDBC DataSource to a well-known JNDI location, to be able to use traditional J2EE data access code outside of a J2EE container.

There are various choices for DataSource implementations:

  • SingleConnectionDataSource (using the same Connection for all getConnection calls);
  • DriverManagerDataSource (creating a new Connection on each getConnection call);
  • Apache's Jakarta Commons DBCP offers BasicDataSource (a real pool).

Typical usage in bootstrap code:

 SimpleNamingContextBuilder builder = new SimpleNamingContextBuilder();
 DataSource ds = new DriverManagerDataSource(...);
 builder.bind("java:comp/env/jdbc/myds", ds);
 builder.activate();
Note that it's impossible to activate multiple builders within the same JVM, due to JNDI restrictions. Thus to configure a fresh builder repeatedly, use the following code to get a reference to either an already activated builder or a newly activated one:
 SimpleNamingContextBuilder builder = SimpleNamingContextBuilder.emptyActivatedContextBuilder();
 DataSource ds = new DriverManagerDataSource(...);
 builder.bind("java:comp/env/jdbc/myds", ds);
Note that you should not call activate() on a builder from this factory method, as there will already be an activated one in any case.

An instance of this class is only necessary at setup time. An application does not need to keep a reference to it after activation.

Author:
Juergen Hoeller, Rod Johnson
See Also:
emptyActivatedContextBuilder(), bind(String, Object), activate(), SimpleNamingContext, SingleConnectionDataSource, DriverManagerDataSource, BasicDataSource

Constructor Summary
SimpleNamingContextBuilder()
Method Summary
void | activate() Register the context builder by registering it with the JNDI NamingManager.
void | bind(String name, Object obj) Bind the given object under the given name, for all naming contexts that this context builder will generate.
void | clear() Clear all bindings in this context builder, while keeping it active.
InitialContextFactory | createInitialContextFactory(Hashtable<?,?> environment) Simple InitialContextFactoryBuilder implementation, creating a new SimpleNamingContext instance.
void | deactivate() Temporarily deactivate this context builder.
static SimpleNamingContextBuilder | emptyActivatedContextBuilder() If no SimpleNamingContextBuilder is already configuring JNDI, create and activate one.
static SimpleNamingContextBuilder | getCurrentContextBuilder() Checks if a SimpleNamingContextBuilder is active.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleNamingContextBuilder

public SimpleNamingContextBuilder()
Method Detail

getCurrentContextBuilder

public static SimpleNamingContextBuilder getCurrentContextBuilder()
Checks if a SimpleNamingContextBuilder is active.

Returns:
the current SimpleNamingContextBuilder instance, or null if none

emptyActivatedContextBuilder

public static SimpleNamingContextBuilder emptyActivatedContextBuilder()
                                                               throws NamingException
If no SimpleNamingContextBuilder is already configuring JNDI, create and activate one. Otherwise take the existing activate SimpleNamingContextBuilder, clear it and return it.

This is mainly intended for test suites that want to reinitialize JNDI bindings from scratch repeatedly.

Returns:
an empty SimpleNamingContextBuilder that can be used to control JNDI bindings
Throws:
NamingException

activate

public void activate()
              throws IllegalStateException,
                     NamingException
Register the context builder by registering it with the JNDI NamingManager. Note that once this has been done, new InitialContext() will always return a context from this factory. Use the emptyActivatedContextBuilder() static method to get an empty context (for example, in test methods).

Throws:
IllegalStateException - if there's already a naming context builder registered with the JNDI NamingManager
NamingException

deactivate

public void deactivate()
Temporarily deactivate this context builder. It will remain registered with the JNDI NamingManager but will delegate to the standard JNDI InitialContextFactory (if configured) instead of exposing its own bound objects.

Call activate() again in order to expose this context builder's own bound objects again. Such activate/deactivate sequences can be applied any number of times (e.g. within a larger integration test suite running in the same VM).

See Also:
activate()

clear

public void clear()
Clear all bindings in this context builder, while keeping it active.

bind

public void bind(String name,
                 Object obj)
Bind the given object under the given name, for all naming contexts that this context builder will generate.

Parameters:
name - the JNDI name of the object (e.g. "java:comp/env/jdbc/myds")
obj - the object to bind (e.g. a DataSource implementation)

createInitialContextFactory

public InitialContextFactory createInitialContextFactory(Hashtable<?,?> environment)
Simple InitialContextFactoryBuilder implementation, creating a new SimpleNamingContext instance.

Specified by:
createInitialContextFactory in interface InitialContextFactoryBuilder
See Also:
SimpleNamingContext
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.mock.staticmock

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.mock.staticmock

Annotation Types Summary
MockStaticEntityMethods Annotation to indicate a test class for whose @Test methods static methods on Entity classes should be mocked.


org.springframework.mock.staticmock Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.mock.staticmock

Package Hierarchies:
All Packages

Annotation Type Hierarchy

  • org.springframework.mock.staticmock.MockStaticEntityMethods (implements java.lang.annotation.Annotation)


MockStaticEntityMethods

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

org.springframework.mock.staticmock
Annotation Type MockStaticEntityMethods

@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface MockStaticEntityMethods

Annotation to indicate a test class for whose @Test methods static methods on Entity classes should be mocked.

Author:
Rod Johnson
See Also:
AbstractMethodMockingControl

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT


org.springframework.mock.web

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.mock.web

A comprehensive set of Servlet API 2.5 mock objects, targeted at usage with Spring's web MVC framework.

See:
Description

Class Summary
DelegatingServletInputStream | Delegating implementation of ServletInputStream.
DelegatingServletOutputStream | Delegating implementation of ServletOutputStream.
MockBodyContent | Mock implementation of the BodyContent class.
MockExpressionEvaluator | Mock implementation of the JSP 2.0 ExpressionEvaluator interface, delegating to the Jakarta JSTL ExpressionEvaluatorManager.
MockFilterChain | Mock implementation of the FilterConfig interface.
MockFilterConfig | Mock implementation of the FilterConfig interface.
MockHttpServletRequest | Mock implementation of the HttpServletRequest interface.
MockHttpServletResponse | Mock implementation of the HttpServletResponse interface.
MockHttpSession | Mock implementation of the HttpSession interface.
MockJspWriter | Mock implementation of the JspWriter class.
MockMultipartFile | Mock implementation of the MultipartFile interface.
MockMultipartHttpServletRequest | Mock implementation of the MultipartHttpServletRequest interface.
MockPageContext | Mock implementation of the PageContext interface.
MockRequestDispatcher | Mock implementation of the RequestDispatcher interface.
MockServletConfig | Mock implementation of the ServletConfig interface.
MockServletContext | Mock implementation of the ServletContext interface.
PassThroughFilterChain | Implementation of the FilterConfig interface which simply passes the call through to a given Filter/FilterChain combination (indicating the next Filter in the chain along with the FilterChain that it is supposed to work on) or to a given Servlet (indicating the end of the chain).

Package org.springframework.mock.web Description

A comprehensive set of Servlet API 2.5 mock objects, targeted at usage with Spring's web MVC framework. Useful for testing web contexts and controllers.

More convenient to use than dynamic mock objects (EasyMock) or existing Servlet API mock objects (MockObjects).


org.springframework.mock.web Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.mock.web

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.servlet.jsp.el.ExpressionEvaluator
      • org.springframework.mock.web.MockExpressionEvaluator
    • java.io.InputStream (implements java.io.Closeable)
      • javax.servlet.ServletInputStream
        • org.springframework.mock.web.DelegatingServletInputStream
    • javax.servlet.jsp.JspContext
      • javax.servlet.jsp.PageContext
        • org.springframework.mock.web.MockPageContext
    • org.springframework.mock.web.MockFilterChain (implements javax.servlet.FilterChain)
    • org.springframework.mock.web.MockFilterConfig (implements javax.servlet.FilterConfig)
    • org.springframework.mock.web.MockHttpServletRequest (implements javax.servlet.http.HttpServletRequest)
      • org.springframework.mock.web.MockMultipartHttpServletRequest (implements org.springframework.web.multipart.MultipartHttpServletRequest)
    • org.springframework.mock.web.MockHttpServletResponse (implements javax.servlet.http.HttpServletResponse)
    • org.springframework.mock.web.MockHttpSession (implements javax.servlet.http.HttpSession)
    • org.springframework.mock.web.MockMultipartFile (implements org.springframework.web.multipart.MultipartFile)
    • org.springframework.mock.web.MockRequestDispatcher (implements javax.servlet.RequestDispatcher)
    • org.springframework.mock.web.MockServletConfig (implements javax.servlet.ServletConfig)
    • org.springframework.mock.web.MockServletContext (implements javax.servlet.ServletContext)
    • java.io.OutputStream (implements java.io.Closeable, java.io.Flushable)
      • javax.servlet.ServletOutputStream
        • org.springframework.mock.web.DelegatingServletOutputStream
    • org.springframework.mock.web.PassThroughFilterChain (implements javax.servlet.FilterChain)
    • java.io.Writer (implements java.lang.Appendable, java.io.Closeable, java.io.Flushable)
      • javax.servlet.jsp.JspWriter
        • javax.servlet.jsp.tagext.BodyContent
          • org.springframework.mock.web.MockBodyContent
        • org.springframework.mock.web.MockJspWriter


DelegatingServletInputStream

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.mock.web
Class DelegatingServletInputStream

java.lang.Object
    extended by  java.io.InputStream
        extended by  javax.servlet.ServletInputStream
            extended by  org.springframework.mock.web.DelegatingServletInputStream
All Implemented Interfaces:
Closeable
public class DelegatingServletInputStream
extends ServletInputStream

Delegating implementation of ServletInputStream.

Used by MockHttpServletRequest; typically not directly used for testing application controllers.

Since:
1.0.2
Author:
Juergen Hoeller
See Also:
MockHttpServletRequest

Constructor Summary
DelegatingServletInputStream(InputStream sourceStream)
Create a DelegatingServletInputStream for the given source stream.
Method Summary
void | close()
InputStream | getSourceStream() Return the underlying source stream (never null).
int | read()
Methods inherited from class javax.servlet.ServletInputStream
readLine
Methods inherited from class java.io.InputStream
available, mark, markSupported, read, read, reset, skip
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DelegatingServletInputStream

public DelegatingServletInputStream(InputStream sourceStream)
Create a DelegatingServletInputStream for the given source stream.

Parameters:
sourceStream - the source stream (never null)
Method Detail

getSourceStream

public final InputStream getSourceStream()
Return the underlying source stream (never null).

read

public int read()
         throws IOException
Specified by:
read in class InputStream
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class InputStream
Throws:
IOException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


DelegatingServletOutputStream

org.springframework.mock.web
Class DelegatingServletOutputStream

java.lang.Object
    extended by  java.io.OutputStream
        extended by  javax.servlet.ServletOutputStream
            extended by  org.springframework.mock.web.DelegatingServletOutputStream
All Implemented Interfaces:
Closeable, Flushable
public class DelegatingServletOutputStream
extends ServletOutputStream

Delegating implementation of ServletOutputStream.

Used by MockHttpServletResponse; typically not directly used for testing application controllers.

Since:
1.0.2
Author:
Juergen Hoeller
See Also:
MockHttpServletResponse

Constructor Summary
DelegatingServletOutputStream(OutputStream targetStream)
Create a DelegatingServletOutputStream for the given target stream.
Method Summary
void | close()
void | flush()
OutputStream | getTargetStream() Return the underlying target stream (never null).
void | write(int b)
Methods inherited from class javax.servlet.ServletOutputStream
print, print, print, print, print, print, print, println, println, println, println, println, println, println, println
Methods inherited from class java.io.OutputStream
write, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DelegatingServletOutputStream

public DelegatingServletOutputStream(OutputStream targetStream)
Create a DelegatingServletOutputStream for the given target stream.

Parameters:
targetStream - the target stream (never null)
Method Detail

getTargetStream

public final OutputStream getTargetStream()
Return the underlying target stream (never null).

write

public void write(int b)
           throws IOException
Specified by:
write in class OutputStream
Throws:
IOException

flush

public void flush()
           throws IOException
Specified by:
flush in interface Flushable
Overrides:
flush in class OutputStream
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class OutputStream
Throws:
IOException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockBodyContent

org.springframework.mock.web
Class MockBodyContent

java.lang.Object
    extended by  java.io.Writer
        extended by  javax.servlet.jsp.JspWriter
            extended by  javax.servlet.jsp.tagext.BodyContent
                extended by  org.springframework.mock.web.MockBodyContent
All Implemented Interfaces:
Closeable, Flushable, Appendable
public class MockBodyContent
extends BodyContent

Mock implementation of the BodyContent class.

Used for testing the web framework; only necessary for testing applications when testing custom JSP tags.

Since:
2.5
Author:
Juergen Hoeller

Field Summary
Fields inherited from class javax.servlet.jsp.JspWriter
autoFlush, bufferSize, DEFAULT_BUFFER, NO_BUFFER, UNBOUNDED_BUFFER
Fields inherited from class java.io.Writer
lock
Constructor Summary
MockBodyContent(String content, HttpServletResponse response)
Create a MockBodyContent for the given response.
MockBodyContent(String content, HttpServletResponse response, Writer targetWriter)
Create a MockBodyContent for the given response.
MockBodyContent(String content, Writer targetWriter)
Create a MockBodyContent for the given response.
Method Summary
void | clear()
void | clearBuffer()
void | close()
Reader | getReader()
int | getRemaining()
String | getString()
void | newLine()
void | print(boolean value)
void | print(char value)
void | print(char[] value)
void | print(double value)
void | print(float value)
void | print(int value)
void | print(long value)
void | print(Object value)
void | print(String value)
void | println()
void | println(boolean value)
void | println(char value)
void | println(char[] value)
void | println(double value)
void | println(float value)
void | println(int value)
void | println(long value)
void | println(Object value)
void | println(String value)
void | write(char[] value, int offset, int length)
void | writeOut(Writer writer)
Methods inherited from class javax.servlet.jsp.tagext.BodyContent
clearBody, flush, getEnclosingWriter
Methods inherited from class javax.servlet.jsp.JspWriter
getBufferSize, isAutoFlush
Methods inherited from class java.io.Writer
append, append, append, write, write, write, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MockBodyContent

public MockBodyContent(String content,
                       HttpServletResponse response)
Create a MockBodyContent for the given response.

Parameters:
content - the body content to expose
response - the servlet response to wrap

MockBodyContent

public MockBodyContent(String content,
                       Writer targetWriter)
Create a MockBodyContent for the given response.

Parameters:
content - the body content to expose
targetWriter - the target Writer to wrap

MockBodyContent

public MockBodyContent(String content,
                       HttpServletResponse response,
                       Writer targetWriter)
Create a MockBodyContent for the given response.

Parameters:
content - the body content to expose
response - the servlet response to wrap
targetWriter - the target Writer to wrap
Method Detail

getReader

public Reader getReader()
Specified by:
getReader in class BodyContent

getString

public String getString()
Specified by:
getString in class BodyContent

writeOut

public void writeOut(Writer writer)
              throws IOException
Specified by:
writeOut in class BodyContent
Throws:
IOException

clear

public void clear()
           throws IOException
Specified by:
clear in class JspWriter
Throws:
IOException

clearBuffer

public void clearBuffer()
                 throws IOException
Specified by:
clearBuffer in class JspWriter
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Specified by:
close in class JspWriter
Throws:
IOException

getRemaining

public int getRemaining()
Specified by:
getRemaining in class JspWriter

newLine

public void newLine()
             throws IOException
Specified by:
newLine in class JspWriter
Throws:
IOException

write

public void write(char[] value,
                  int offset,
                  int length)
           throws IOException
Specified by:
write in class Writer
Throws:
IOException

print

public void print(boolean value)
           throws IOException
Specified by:
print in class JspWriter
Throws:
IOException

print

public void print(char value)
           throws IOException
Specified by:
print in class JspWriter
Throws:
IOException

print

public void print(char[] value)
           throws IOException
Specified by:
print in class JspWriter
Throws:
IOException

print

public void print(double value)
           throws IOException
Specified by:
print in class JspWriter
Throws:
IOException

print

public void print(float value)
           throws IOException
Specified by:
print in class JspWriter
Throws:
IOException

print

public void print(int value)
           throws IOException
Specified by:
print in class JspWriter
Throws:
IOException

print

public void print(long value)
           throws IOException
Specified by:
print in class JspWriter
Throws:
IOException

print

public void print(Object value)
           throws IOException
Specified by:
print in class JspWriter
Throws:
IOException

print

public void print(String value)
           throws IOException
Specified by:
print in class JspWriter
Throws:
IOException

println

public void println()
             throws IOException
Specified by:
println in class JspWriter
Throws:
IOException

println

public void println(boolean value)
             throws IOException
Specified by:
println in class JspWriter
Throws:
IOException

println

public void println(char value)
             throws IOException
Specified by:
println in class JspWriter
Throws:
IOException

println

public void println(char[] value)
             throws IOException
Specified by:
println in class JspWriter
Throws:
IOException

println

public void println(double value)
             throws IOException
Specified by:
println in class JspWriter
Throws:
IOException

println

public void println(float value)
             throws IOException
Specified by:
println in class JspWriter
Throws:
IOException

println

public void println(int value)
             throws IOException
Specified by:
println in class JspWriter
Throws:
IOException

println

public void println(long value)
             throws IOException
Specified by:
println in class JspWriter
Throws:
IOException

println

public void println(Object value)
             throws IOException
Specified by:
println in class JspWriter
Throws:
IOException

println

public void println(String value)
             throws IOException
Specified by:
println in class JspWriter
Throws:
IOException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockExpressionEvaluator

org.springframework.mock.web
Class MockExpressionEvaluator

java.lang.Object
    extended by  javax.servlet.jsp.el.ExpressionEvaluator
        extended by  org.springframework.mock.web.MockExpressionEvaluator

public class MockExpressionEvaluator
extends ExpressionEvaluator

Mock implementation of the JSP 2.0 ExpressionEvaluator interface, delegating to the Jakarta JSTL ExpressionEvaluatorManager.

Used for testing the web framework; only necessary for testing applications when testing custom JSP tags.

Note that the Jakarta JSTL implementation (jstl.jar, standard.jar) has to be available on the class path to use this expression evaluator.

Since:
1.1.5
Author:
Juergen Hoeller
See Also:
ExpressionEvaluatorManager

Constructor Summary
MockExpressionEvaluator(PageContext pageContext)
Create a new MockExpressionEvaluator for the given PageContext.
Method Summary
protected Object | doEvaluate(String expression, Class expectedType, FunctionMapper functionMapper)
Object | evaluate(String expression, Class expectedType, VariableResolver variableResolver, FunctionMapper functionMapper)
Expression | parseExpression(String expression, Class expectedType, FunctionMapper functionMapper)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MockExpressionEvaluator

public MockExpressionEvaluator(PageContext pageContext)
Create a new MockExpressionEvaluator for the given PageContext.

Parameters:
pageContext - the JSP PageContext to run in
Method Detail

parseExpression

public Expression parseExpression(String expression,
                                  Class expectedType,
                                  FunctionMapper functionMapper)
                           throws ELException
Specified by:
parseExpression in class ExpressionEvaluator
Throws:
ELException

evaluate

public Object evaluate(String expression,
                       Class expectedType,
                       VariableResolver variableResolver,
                       FunctionMapper functionMapper)
                throws ELException
Specified by:
evaluate in class ExpressionEvaluator
Throws:
ELException

doEvaluate

protected Object doEvaluate(String expression,
                            Class expectedType,
                            FunctionMapper functionMapper)
                     throws ELException
Throws:
ELException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockFilterChain

org.springframework.mock.web
Class MockFilterChain

java.lang.Object
    extended by  org.springframework.mock.web.MockFilterChain
All Implemented Interfaces:
FilterChain
public class MockFilterChain
extends Object
implements FilterChain

Mock implementation of the FilterConfig interface.

Used for testing the web framework; also useful for testing custom Filter implementations.

Since:
2.0.3
Author:
Juergen Hoeller
See Also:
MockFilterConfig, PassThroughFilterChain

Constructor Summary
MockFilterChain()
Method Summary
 void doFilter(ServletRequest request, ServletResponse response)
Records the request and response.
 ServletRequest getRequest()
Return the request that doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) has been called with.
 ServletResponse getResponse()
Return the response that doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) has been called with.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MockFilterChain

public MockFilterChain()
Method Detail

doFilter

public void doFilter(ServletRequest request,
                     ServletResponse response)
Records the request and response.

Specified by:
doFilter in interface FilterChain

getRequest

public ServletRequest getRequest()
Return the request that doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) has been called with.

getResponse

public ServletResponse getResponse()
Return the response that doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) has been called with.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockFilterConfig

org.springframework.mock.web
Class MockFilterConfig

java.lang.Object
    extended by  org.springframework.mock.web.MockFilterConfig
All Implemented Interfaces:
FilterConfig
public class MockFilterConfig
extends Object
implements FilterConfig

Mock implementation of the FilterConfig interface.

Used for testing the web framework; also useful for testing custom Filter implementations.

Since:
1.0.2
Author:
Juergen Hoeller
See Also:
MockFilterChain, PassThroughFilterChain

Constructor Summary
MockFilterConfig()
Create a new MockFilterConfig with a default MockServletContext.
MockFilterConfig(ServletContext servletContext)
Create a new MockFilterConfig.
MockFilterConfig(ServletContext servletContext, String filterName)
Create a new MockFilterConfig.
MockFilterConfig(String filterName)
Create a new MockFilterConfig with a default MockServletContext.
Method Summary
void | addInitParameter(String name, String value)
String | getFilterName()
String | getInitParameter(String name)
Enumeration<String> | getInitParameterNames()
ServletContext | getServletContext()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MockFilterConfig

public MockFilterConfig()
Create a new MockFilterConfig with a default MockServletContext.

MockFilterConfig

public MockFilterConfig(String filterName)
Create a new MockFilterConfig with a default MockServletContext.

Parameters:
filterName - the name of the filter

MockFilterConfig

public MockFilterConfig(ServletContext servletContext)
Create a new MockFilterConfig.

Parameters:
servletContext - the ServletContext that the servlet runs in

MockFilterConfig

public MockFilterConfig(ServletContext servletContext,
                        String filterName)
Create a new MockFilterConfig.

Parameters:
servletContext - the ServletContext that the servlet runs in
filterName - the name of the filter
Method Detail

getFilterName

public String getFilterName()
Specified by:
getFilterName in interface FilterConfig

getServletContext

public ServletContext getServletContext()
Specified by:
getServletContext in interface FilterConfig

addInitParameter

public void addInitParameter(String name,
                             String value)

getInitParameter

public String getInitParameter(String name)
Specified by:
getInitParameter in interface FilterConfig

getInitParameterNames

public Enumeration<String> getInitParameterNames()
Specified by:
getInitParameterNames in interface FilterConfig
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockHttpServletRequest

org.springframework.mock.web
Class MockHttpServletRequest

java.lang.Object
    extended by  org.springframework.mock.web.MockHttpServletRequest
All Implemented Interfaces:
HttpServletRequest, ServletRequest
Direct Known Subclasses:
MockMultipartHttpServletRequest
public class MockHttpServletRequest
extends Object
implements HttpServletRequest

Mock implementation of the HttpServletRequest interface. Supports the Servlet 2.5 API level.

Used for testing the web framework; also useful for testing application controllers.

Since:
1.0.2
Author:
Juergen Hoeller, Rod Johnson, Rick Evans, Mark Fisher

Field Summary
static String | DEFAULT_PROTOCOL The default protocol: 'http'.
static String | DEFAULT_REMOTE_ADDR The default remote address: '127.0.0.1'.
static String | DEFAULT_REMOTE_HOST The default remote host: 'localhost'.
static String | DEFAULT_SERVER_ADDR The default server address: '127.0.0.1'.
static String | DEFAULT_SERVER_NAME The default server name: 'localhost'.
static int | DEFAULT_SERVER_PORT The default server port: '80'.
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
Constructor Summary
MockHttpServletRequest()
Create a new MockHttpServletRequest with a default MockServletContext.
MockHttpServletRequest(ServletContext servletContext)
Create a new MockHttpServletRequest.
MockHttpServletRequest(ServletContext servletContext, String method, String requestURI)
Create a new MockHttpServletRequest.
MockHttpServletRequest(String method, String requestURI)
Create a new MockHttpServletRequest with a default MockServletContext.
Method Summary
void | addHeader(String name, Object value) Add a header entry for the given name.
void | addParameter(String name, String value) Add a single value for the specified HTTP parameter.
void | addParameter(String name, String[] values) Add an array of values for the specified HTTP parameter.
void | addParameters(Map params) Adds all provided parameters without replacing any existing values.
void | addPreferredLocale(Locale locale) Add a new preferred locale, before any existing locales.
void | addUserRole(String role)
protected void | checkActive() Check whether this request is still active (that is, not completed yet), throwing an IllegalStateException if not active anymore.
void | clearAttributes() Clear all of this request's attributes.
void | close() Mark this request as completed, keeping its state.
Object | getAttribute(String name)
Enumeration<String> | getAttributeNames()
String | getAuthType()
String | getCharacterEncoding()
int | getContentLength()
String | getContentType()
String | getContextPath()
Cookie[] | getCookies()
long | getDateHeader(String name)
String | getHeader(String name)
Enumeration<String> | getHeaderNames()
Enumeration<String> | getHeaders(String name)
ServletInputStream | getInputStream()
int | getIntHeader(String name)
String | getLocalAddr()
Locale | getLocale()
Enumeration<Locale> | getLocales()
String | getLocalName()
int | getLocalPort()
String | getMethod()
String | getParameter(String name)
Map<String,String[]> | getParameterMap()
Enumeration<String> | getParameterNames()
String[] | getParameterValues(String name)
String | getPathInfo()
String | getPathTranslated()
String | getProtocol()
String | getQueryString()
BufferedReader | getReader()
String | getRealPath(String path)
String | getRemoteAddr()
String | getRemoteHost()
int | getRemotePort()
String | getRemoteUser()
RequestDispatcher | getRequestDispatcher(String path)
String | getRequestedSessionId()
String | getRequestURI()
StringBuffer | getRequestURL()
String | getScheme()
String | getServerName()
int | getServerPort()
ServletContext | getServletContext() Return the ServletContext that this request is associated with.
String | getServletPath()
HttpSession | getSession()
HttpSession | getSession(boolean create)
Principal | getUserPrincipal()
void | invalidate() Invalidate this request, clearing its state.
boolean | isActive() Return whether this request is still active (that is, not completed yet).
boolean | isRequestedSessionIdFromCookie()
boolean | isRequestedSessionIdFromUrl()
boolean | isRequestedSessionIdFromURL()
boolean | isRequestedSessionIdValid()
boolean | isSecure()
boolean | isUserInRole(String role)
void | removeAllParameters() Removes all existing parameters.
void | removeAttribute(String name)
void | removeParameter(String name) Remove already registered values for the specified HTTP parameter, if any.
void | setAttribute(String name, Object value)
void | setAuthType(String authType)
void | setCharacterEncoding(String characterEncoding)
void | setContent(byte[] content)
void | setContentType(String contentType)
void | setContextPath(String contextPath)
void | setCookies(Cookie... cookies)
void | setLocalAddr(String localAddr)
void | setLocalName(String localName)
void | setLocalPort(int localPort)
void | setMethod(String method)
void | setParameter(String name, String value) Set a single value for the specified HTTP parameter.
void | setParameter(String name, String[] values) Set an array of values for the specified HTTP parameter.
void | setParameters(Map params) Sets all provided parameters replacing any existing values for the provided parameter names.
void | setPathInfo(String pathInfo)
void | setProtocol(String protocol)
void | setQueryString(String queryString)
void | setRemoteAddr(String remoteAddr)
void | setRemoteHost(String remoteHost)
void | setRemotePort(int remotePort)
void | setRemoteUser(String remoteUser)
void | setRequestedSessionId(String requestedSessionId)
void | setRequestedSessionIdFromCookie(boolean requestedSessionIdFromCookie)
void | setRequestedSessionIdFromURL(boolean requestedSessionIdFromURL)
void | setRequestedSessionIdValid(boolean requestedSessionIdValid)
void | setRequestURI(String requestURI)
void | setScheme(String scheme)
void | setSecure(boolean secure)
void | setServerName(String serverName)
void | setServerPort(int serverPort)
void | setServletPath(String servletPath)
void | setSession(HttpSession session)
void | setUserPrincipal(Principal userPrincipal)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_PROTOCOL

public static final String DEFAULT_PROTOCOL
The default protocol: 'http'.

See Also:
Constant Field Values

DEFAULT_SERVER_ADDR

public static final String DEFAULT_SERVER_ADDR
The default server address: '127.0.0.1'.

See Also:
Constant Field Values

DEFAULT_SERVER_NAME

public static final String DEFAULT_SERVER_NAME
The default server name: 'localhost'.

See Also:
Constant Field Values

DEFAULT_SERVER_PORT

public static final int DEFAULT_SERVER_PORT
The default server port: '80'.

See Also:
Constant Field Values

DEFAULT_REMOTE_ADDR

public static final String DEFAULT_REMOTE_ADDR
The default remote address: '127.0.0.1'.

See Also:
Constant Field Values

DEFAULT_REMOTE_HOST

public static final String DEFAULT_REMOTE_HOST
The default remote host: 'localhost'.

See Also:
Constant Field Values
Constructor Detail

MockHttpServletRequest

public MockHttpServletRequest()
Create a new MockHttpServletRequest with a default MockServletContext.

See Also:
MockServletContext

MockHttpServletRequest

public MockHttpServletRequest(String method,
                              String requestURI)
Create a new MockHttpServletRequest with a default MockServletContext.

Parameters:
method - the request method (may be null)
requestURI - the request URI (may be null)
See Also:
setMethod(java.lang.String), setRequestURI(java.lang.String), MockServletContext

MockHttpServletRequest

public MockHttpServletRequest(ServletContext servletContext)
Create a new MockHttpServletRequest.

Parameters:
servletContext - the ServletContext that the request runs in (may be null to use a default MockServletContext)
See Also:
MockServletContext

MockHttpServletRequest

public MockHttpServletRequest(ServletContext servletContext,
                              String method,
                              String requestURI)
Create a new MockHttpServletRequest.

Parameters:
servletContext - the ServletContext that the request runs in (may be null to use a default MockServletContext)
method - the request method (may be null)
requestURI - the request URI (may be null)
See Also:
setMethod(java.lang.String), setRequestURI(java.lang.String), MockServletContext
Method Detail

getServletContext

public ServletContext getServletContext()
Return the ServletContext that this request is associated with. (Not available in the standard HttpServletRequest interface for some reason.)

isActive

public boolean isActive()
Return whether this request is still active (that is, not completed yet).

close

public void close()
Mark this request as completed, keeping its state.

invalidate

public void invalidate()
Invalidate this request, clearing its state.

checkActive

protected void checkActive()
                    throws IllegalStateException
Check whether this request is still active (that is, not completed yet), throwing an IllegalStateException if not active anymore.

Throws:
IllegalStateException

getAttribute

public Object getAttribute(String name)
Specified by:
getAttribute in interface ServletRequest

getAttributeNames

public Enumeration<String> getAttributeNames()
Specified by:
getAttributeNames in interface ServletRequest

getCharacterEncoding

public String getCharacterEncoding()
Specified by:
getCharacterEncoding in interface ServletRequest

setCharacterEncoding

public void setCharacterEncoding(String characterEncoding)
Specified by:
setCharacterEncoding in interface ServletRequest

setContent

public void setContent(byte[] content)

getContentLength

public int getContentLength()
Specified by:
getContentLength in interface ServletRequest

setContentType

public void setContentType(String contentType)

getContentType

public String getContentType()
Specified by:
getContentType in interface ServletRequest

getInputStream

public ServletInputStream getInputStream()
Specified by:
getInputStream in interface ServletRequest

setParameter

public void setParameter(String name,
                         String value)
Set a single value for the specified HTTP parameter.

If there are already one or more values registered for the given parameter name, they will be replaced.

setParameter

public void setParameter(String name,
                         String[] values)
Set an array of values for the specified HTTP parameter.

If there are already one or more values registered for the given parameter name, they will be replaced.

setParameters

public void setParameters(Map params)
Sets all provided parameters replacing any existing values for the provided parameter names. To add without replacing existing values, use addParameters(java.util.Map).

addParameter

public void addParameter(String name,
                         String value)
Add a single value for the specified HTTP parameter.

If there are already one or more values registered for the given parameter name, the given value will be added to the end of the list.

addParameter

public void addParameter(String name,
                         String[] values)
Add an array of values for the specified HTTP parameter.

If there are already one or more values registered for the given parameter name, the given values will be added to the end of the list.

addParameters

public void addParameters(Map params)
Adds all provided parameters without replacing any existing values. To replace existing values, use setParameters(java.util.Map).

removeParameter

public void removeParameter(String name)
Remove already registered values for the specified HTTP parameter, if any.

removeAllParameters

public void removeAllParameters()
Removes all existing parameters.

getParameter

public String getParameter(String name)
Specified by:
getParameter in interface ServletRequest

getParameterNames

public Enumeration<String> getParameterNames()
Specified by:
getParameterNames in interface ServletRequest

getParameterValues

public String[] getParameterValues(String name)
Specified by:
getParameterValues in interface ServletRequest

getParameterMap

public Map<String,String[]> getParameterMap()
Specified by:
getParameterMap in interface ServletRequest

setProtocol

public void setProtocol(String protocol)

getProtocol

public String getProtocol()
Specified by:
getProtocol in interface ServletRequest

setScheme

public void setScheme(String scheme)

getScheme

public String getScheme()
Specified by:
getScheme in interface ServletRequest

setServerName

public void setServerName(String serverName)

getServerName

public String getServerName()
Specified by:
getServerName in interface ServletRequest

setServerPort

public void setServerPort(int serverPort)

getServerPort

public int getServerPort()
Specified by:
getServerPort in interface ServletRequest

getReader

public BufferedReader getReader()
                         throws UnsupportedEncodingException
Specified by:
getReader in interface ServletRequest
Throws:
UnsupportedEncodingException

setRemoteAddr

public void setRemoteAddr(String remoteAddr)

getRemoteAddr

public String getRemoteAddr()
Specified by:
getRemoteAddr in interface ServletRequest

setRemoteHost

public void setRemoteHost(String remoteHost)

getRemoteHost

public String getRemoteHost()
Specified by:
getRemoteHost in interface ServletRequest

setAttribute

public void setAttribute(String name,
                         Object value)
Specified by:
setAttribute in interface ServletRequest

removeAttribute

public void removeAttribute(String name)
Specified by:
removeAttribute in interface ServletRequest

clearAttributes

public void clearAttributes()
Clear all of this request's attributes.

addPreferredLocale

public void addPreferredLocale(Locale locale)
Add a new preferred locale, before any existing locales.

getLocale

public Locale getLocale()
Specified by:
getLocale in interface ServletRequest

getLocales

public Enumeration<Locale> getLocales()
Specified by:
getLocales in interface ServletRequest

setSecure

public void setSecure(boolean secure)

isSecure

public boolean isSecure()
Specified by:
isSecure in interface ServletRequest

getRequestDispatcher

public RequestDispatcher getRequestDispatcher(String path)
Specified by:
getRequestDispatcher in interface ServletRequest

getRealPath

public String getRealPath(String path)
Specified by:
getRealPath in interface ServletRequest

setRemotePort

public void setRemotePort(int remotePort)

getRemotePort

public int getRemotePort()
Specified by:
getRemotePort in interface ServletRequest

setLocalName

public void setLocalName(String localName)

getLocalName

public String getLocalName()
Specified by:
getLocalName in interface ServletRequest

setLocalAddr

public void setLocalAddr(String localAddr)

getLocalAddr

public String getLocalAddr()
Specified by:
getLocalAddr in interface ServletRequest

setLocalPort

public void setLocalPort(int localPort)

getLocalPort

public int getLocalPort()
Specified by:
getLocalPort in interface ServletRequest

setAuthType

public void setAuthType(String authType)

getAuthType

public String getAuthType()
Specified by:
getAuthType in interface HttpServletRequest

setCookies

public void setCookies(Cookie... cookies)

getCookies

public Cookie[] getCookies()
Specified by:
getCookies in interface HttpServletRequest

addHeader

public void addHeader(String name,
                      Object value)
Add a header entry for the given name.

If there was no entry for that header name before, the value will be used as-is. In case of an existing entry, a String array will be created, adding the given value (more specifically, its toString representation) as further element.

Multiple values can only be stored as list of Strings, following the Servlet spec (see getHeaders accessor). As alternative to repeated addHeader calls for individual elements, you can use a single call with an entire array or Collection of values as parameter.

See Also:
getHeaderNames(),
getHeader(java.lang.String),
getHeaders(java.lang.String),
getDateHeader(java.lang.String),
getIntHeader(java.lang.String)

getDateHeader

public long getDateHeader(String name)
Specified by:
getDateHeader in interface HttpServletRequest

getHeader

public String getHeader(String name)
Specified by:
getHeader in interface HttpServletRequest

getHeaders

public Enumeration<String> getHeaders(String name)
Specified by:
getHeaders in interface HttpServletRequest

getHeaderNames

public Enumeration<String> getHeaderNames()
Specified by:
getHeaderNames in interface HttpServletRequest

getIntHeader

public int getIntHeader(String name)
Specified by:
getIntHeader in interface HttpServletRequest

setMethod

public void setMethod(String method)

getMethod

public String getMethod()
Specified by:
getMethod in interface HttpServletRequest

setPathInfo

public void setPathInfo(String pathInfo)

getPathInfo

public String getPathInfo()
Specified by:
getPathInfo in interface HttpServletRequest

getPathTranslated

public String getPathTranslated()
Specified by:
getPathTranslated in interface HttpServletRequest

setContextPath

public void setContextPath(String contextPath)

getContextPath

public String getContextPath()
Specified by:
getContextPath in interface HttpServletRequest

setQueryString

public void setQueryString(String queryString)

getQueryString

public String getQueryString()
Specified by:
getQueryString in interface HttpServletRequest

setRemoteUser

public void setRemoteUser(String remoteUser)

getRemoteUser

public String getRemoteUser()
Specified by:
getRemoteUser in interface HttpServletRequest

addUserRole

public void addUserRole(String role)

isUserInRole

public boolean isUserInRole(String role)
Specified by:
isUserInRole in interface HttpServletRequest

setUserPrincipal

public void setUserPrincipal(Principal userPrincipal)

getUserPrincipal

public Principal getUserPrincipal()
Specified by:
getUserPrincipal in interface HttpServletRequest

setRequestedSessionId

public void setRequestedSessionId(String requestedSessionId)

getRequestedSessionId

public String getRequestedSessionId()
Specified by:
getRequestedSessionId in interface HttpServletRequest

setRequestURI

public void setRequestURI(String requestURI)

getRequestURI

public String getRequestURI()
Specified by:
getRequestURI in interface HttpServletRequest

getRequestURL

public StringBuffer getRequestURL()
Specified by:
getRequestURL in interface HttpServletRequest

setServletPath

public void setServletPath(String servletPath)

getServletPath

public String getServletPath()
Specified by:
getServletPath in interface HttpServletRequest

setSession

public void setSession(HttpSession session)

getSession

public HttpSession getSession(boolean create)
Specified by:
getSession in interface HttpServletRequest

getSession

public HttpSession getSession()
Specified by:
getSession in interface HttpServletRequest

setRequestedSessionIdValid

public void setRequestedSessionIdValid(boolean requestedSessionIdValid)

isRequestedSessionIdValid

public boolean isRequestedSessionIdValid()
Specified by:
isRequestedSessionIdValid in interface HttpServletRequest

setRequestedSessionIdFromCookie

public void setRequestedSessionIdFromCookie(boolean requestedSessionIdFromCookie)

isRequestedSessionIdFromCookie

public boolean isRequestedSessionIdFromCookie()
Specified by:
isRequestedSessionIdFromCookie in interface HttpServletRequest

setRequestedSessionIdFromURL

public void setRequestedSessionIdFromURL(boolean requestedSessionIdFromURL)

isRequestedSessionIdFromURL

public boolean isRequestedSessionIdFromURL()
Specified by:
isRequestedSessionIdFromURL in interface HttpServletRequest

isRequestedSessionIdFromUrl

public boolean isRequestedSessionIdFromUrl()
Specified by:
isRequestedSessionIdFromUrl in interface HttpServletRequest
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockHttpServletResponse

org.springframework.mock.web
Class MockHttpServletResponse

java.lang.Object
    extended by  org.springframework.mock.web.MockHttpServletResponse
All Implemented Interfaces:
HttpServletResponse, ServletResponse
public class MockHttpServletResponse
extends Object
implements HttpServletResponse

Mock implementation of the HttpServletResponse interface. Supports the Servlet 2.5 API level.

Used for testing the web framework; also useful for testing application controllers.

Since:
1.0.2
Author:
Juergen Hoeller, Rod Johnson

Field Summary
static int DEFAULT_SERVER_PORT
Fields inherited from interface javax.servlet.http.HttpServletResponse
SC_ACCEPTED, SC_BAD_GATEWAY, SC_BAD_REQUEST, SC_CONFLICT, SC_CONTINUE, SC_CREATED, SC_EXPECTATION_FAILED, SC_FORBIDDEN, SC_FOUND, SC_GATEWAY_TIMEOUT, SC_GONE, SC_HTTP_VERSION_NOT_SUPPORTED, SC_INTERNAL_SERVER_ERROR, SC_LENGTH_REQUIRED, SC_METHOD_NOT_ALLOWED, SC_MOVED_PERMANENTLY, SC_MOVED_TEMPORARILY, SC_MULTIPLE_CHOICES, SC_NO_CONTENT, SC_NON_AUTHORITATIVE_INFORMATION, SC_NOT_ACCEPTABLE, SC_NOT_FOUND, SC_NOT_IMPLEMENTED, SC_NOT_MODIFIED, SC_OK, SC_PARTIAL_CONTENT, SC_PAYMENT_REQUIRED, SC_PRECONDITION_FAILED, SC_PROXY_AUTHENTICATION_REQUIRED, SC_REQUEST_ENTITY_TOO_LARGE, SC_REQUEST_TIMEOUT, SC_REQUEST_URI_TOO_LONG, SC_REQUESTED_RANGE_NOT_SATISFIABLE, SC_RESET_CONTENT, SC_SEE_OTHER, SC_SERVICE_UNAVAILABLE, SC_SWITCHING_PROTOCOLS, SC_TEMPORARY_REDIRECT, SC_UNAUTHORIZED, SC_UNSUPPORTED_MEDIA_TYPE, SC_USE_PROXY
Constructor Summary
MockHttpServletResponse()
Method Summary
 void addCookie(Cookie cookie)
 void addDateHeader(String name, long value)
 void addHeader(String name, String value)
 void addIntHeader(String name, int value)
 boolean containsHeader(String name)
 String encodeRedirectUrl(String url)
 String encodeRedirectURL(String url)
The default implementation delegates to encodeURL(java.lang.String), returning the given URL String as-is.
 String encodeUrl(String url)
 String encodeURL(String url)
The default implementation returns the given URL String as-is.
 void flushBuffer()
 int getBufferSize()
 String getCharacterEncoding()
 byte[] getContentAsByteArray()
 String getContentAsString()
 int getContentLength()
 String getContentType()
 Cookie getCookie(String name)
 Cookie[] getCookies()
 String getErrorMessage()
 String getForwardedUrl()
 Object getHeader(String name)
Return the primary value for the given header, if any.
 Set<String> getHeaderNames()
Return the names of all specified headers as a Set of Strings.
 List<Object> getHeaders(String name)
Return all values for the given header as a List of value objects.
 String getIncludedUrl()
 Locale getLocale()
 ServletOutputStream getOutputStream()
 String getRedirectedUrl()
 int getStatus()
 PrintWriter getWriter()
 boolean isCommitted()
 boolean isOutputStreamAccessAllowed()
Return whether getOutputStream() access is allowed.
 boolean isWriterAccessAllowed()
Return whether getOutputStream() access is allowed.
 void reset()
 void resetBuffer()
 void sendError(int status)
 void sendError(int status, String errorMessage)
 void sendRedirect(String url)
 void setBufferSize(int bufferSize)
 void setCharacterEncoding(String characterEncoding)
 void setCommitted(boolean committed)
 void setContentLength(int contentLength)
 void setContentType(String contentType)
 void setDateHeader(String name, long value)
 void setForwardedUrl(String forwardedUrl)
 void setHeader(String name, String value)
 void setIncludedUrl(String includedUrl)
 void setIntHeader(String name, int value)
 void setLocale(Locale locale)
 void setOutputStreamAccessAllowed(boolean outputStreamAccessAllowed)
Set whether getOutputStream() access is allowed.
 void setStatus(int status)
 void setStatus(int status, String errorMessage)
 void setWriterAccessAllowed(boolean writerAccessAllowed)
Set whether getWriter() access is allowed.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_SERVER_PORT

public static final int DEFAULT_SERVER_PORT
See Also:
Constant Field Values
Constructor Detail

MockHttpServletResponse

public MockHttpServletResponse()
Method Detail

setOutputStreamAccessAllowed

public void setOutputStreamAccessAllowed(boolean outputStreamAccessAllowed)
Set whether getOutputStream() access is allowed.

Default is true.

isOutputStreamAccessAllowed

public boolean isOutputStreamAccessAllowed()
Return whether getOutputStream() access is allowed.

setWriterAccessAllowed

public void setWriterAccessAllowed(boolean writerAccessAllowed)
Set whether getWriter() access is allowed.

Default is true.

isWriterAccessAllowed

public boolean isWriterAccessAllowed()
Return whether getOutputStream() access is allowed.

setCharacterEncoding

public void setCharacterEncoding(String characterEncoding)
Specified by:
setCharacterEncoding in interface ServletResponse

getCharacterEncoding

public String getCharacterEncoding()
Specified by:
getCharacterEncoding in interface ServletResponse

getOutputStream

public ServletOutputStream getOutputStream()
Specified by:
getOutputStream in interface ServletResponse

getWriter

public PrintWriter getWriter()
                      throws UnsupportedEncodingException
Specified by:
getWriter in interface ServletResponse
Throws:
UnsupportedEncodingException

getContentAsByteArray

public byte[] getContentAsByteArray()

getContentAsString

public String getContentAsString()
                          throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException

setContentLength

public void setContentLength(int contentLength)
Specified by:
setContentLength in interface ServletResponse

getContentLength

public int getContentLength()

setContentType

public void setContentType(String contentType)
Specified by:
setContentType in interface ServletResponse

getContentType

public String getContentType()
Specified by:
getContentType in interface ServletResponse

setBufferSize

public void setBufferSize(int bufferSize)
Specified by:
setBufferSize in interface ServletResponse

getBufferSize

public int getBufferSize()
Specified by:
getBufferSize in interface ServletResponse

flushBuffer

public void flushBuffer()
Specified by:
flushBuffer in interface ServletResponse

resetBuffer

public void resetBuffer()
Specified by:
resetBuffer in interface ServletResponse

setCommitted

public void setCommitted(boolean committed)

isCommitted

public boolean isCommitted()
Specified by:
isCommitted in interface ServletResponse

reset

public void reset()
Specified by:
reset in interface ServletResponse

setLocale

public void setLocale(Locale locale)
Specified by:
setLocale in interface ServletResponse

getLocale

public Locale getLocale()
Specified by:
getLocale in interface ServletResponse

addCookie

public void addCookie(Cookie cookie)
Specified by:
addCookie in interface HttpServletResponse

getCookies

public Cookie[] getCookies()

getCookie

public Cookie getCookie(String name)

containsHeader

public boolean containsHeader(String name)
Specified by:
containsHeader in interface HttpServletResponse

getHeaderNames

public Set<String> getHeaderNames()
Return the names of all specified headers as a Set of Strings.

Returns:
the Set of header name Strings, or an empty Set if none

getHeader

public Object getHeader(String name)
Return the primary value for the given header, if any.

Will return the first value in case of multiple values.

Parameters:
name - the name of the header
Returns:
the associated header value, or null if none

getHeaders

public List<Object> getHeaders(String name)
Return all values for the given header as a List of value objects.

Parameters:
name - the name of the header
Returns:
the associated header values, or an empty List if none

encodeURL

public String encodeURL(String url)
The default implementation returns the given URL String as-is.

Can be overridden in subclasses, appending a session id or the like.

Specified by:
encodeURL in interface HttpServletResponse

encodeRedirectURL

public String encodeRedirectURL(String url)
The default implementation delegates to encodeURL(java.lang.String), returning the given URL String as-is.

Can be overridden in subclasses, appending a session id or the like in a redirect-specific fashion. For general URL encoding rules, override the common encodeURL(java.lang.String) method instead, appyling to redirect URLs as well as to general URLs.

Specified by:
encodeRedirectURL in interface HttpServletResponse

encodeUrl

public String encodeUrl(String url)
Specified by:
encodeUrl in interface HttpServletResponse

encodeRedirectUrl

public String encodeRedirectUrl(String url)
Specified by:
encodeRedirectUrl in interface HttpServletResponse

sendError

public void sendError(int status,
                      String errorMessage)
               throws IOException
Specified by:
sendError in interface HttpServletResponse
Throws:
IOException

sendError

public void sendError(int status)
               throws IOException
Specified by:
sendError in interface HttpServletResponse
Throws:
IOException

sendRedirect

public void sendRedirect(String url)
                  throws IOException
Specified by:
sendRedirect in interface HttpServletResponse
Throws:
IOException

getRedirectedUrl

public String getRedirectedUrl()

setDateHeader

public void setDateHeader(String name,
                          long value)
Specified by:
setDateHeader in interface HttpServletResponse

addDateHeader

public void addDateHeader(String name,
                          long value)
Specified by:
addDateHeader in interface HttpServletResponse

setHeader

public void setHeader(String name,
                      String value)
Specified by:
setHeader in interface HttpServletResponse

addHeader

public void addHeader(String name,
                      String value)
Specified by:
addHeader in interface HttpServletResponse

setIntHeader

public void setIntHeader(String name,
                         int value)
Specified by:
setIntHeader in interface HttpServletResponse

addIntHeader

public void addIntHeader(String name,
                         int value)
Specified by:
addIntHeader in interface HttpServletResponse

setStatus

public void setStatus(int status)
Specified by:
setStatus in interface HttpServletResponse

setStatus

public void setStatus(int status,
                      String errorMessage)
Specified by:
setStatus in interface HttpServletResponse

getStatus

public int getStatus()

getErrorMessage

public String getErrorMessage()

setForwardedUrl

public void setForwardedUrl(String forwardedUrl)

getForwardedUrl

public String getForwardedUrl()

setIncludedUrl

public void setIncludedUrl(String includedUrl)

getIncludedUrl

public String getIncludedUrl()
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


MockHttpSession

org.springframework.mock.web
Class MockHttpSession

java.lang.Object
    extended by  org.springframework.mock.web.MockHttpSession
All Implemented Interfaces:
HttpSession
public class MockHttpSession
extends Object
implements HttpSession

Mock implementation of the HttpSession interface. Supports the Servlet 2.4 API level.

Used for testing the web framework; also useful for testing application controllers.

Since:
1.0.2
Author:
Juergen Hoeller, Rod Johnson, Mark Fisher

Field Summary
static String SESSION_COOKIE_NAME
Constructor Summary
MockHttpSession()
Create a new MockHttpSession with a default MockServletContext.
MockHttpSession(ServletContext servletContext)
Create a new MockHttpSession.
MockHttpSession(ServletContext servletContext, String id)
Create a new MockHttpSession.
Method Summary
void | access()
void | clearAttributes() Clear all of this session's attributes.
void | deserializeState(Serializable state) Deserialize the attributes of this session from a state object created by serializeState().
Object | getAttribute(String name)
Enumeration<String> | getAttributeNames()
long | getCreationTime()
String | getId()
long | getLastAccessedTime()
int | getMaxInactiveInterval()
ServletContext | getServletContext()
HttpSessionContext | getSessionContext()
Object | getValue(String name)
String[] | getValueNames()
void | invalidate()
boolean | isInvalid()
boolean | isNew()
void | putValue(String name, Object value)
void | removeAttribute(String name)
void | removeValue(String name)
Serializable | serializeState() Serialize the attributes of this session into an object that can be turned into a byte array with standard Java serialization.
void | setAttribute(String name, Object value)
void | setMaxInactiveInterval(int interval)
void | setNew(boolean value)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

SESSION_COOKIE_NAME

public static final String SESSION_COOKIE_NAME
See Also:
Constant Field Values
Constructor Detail

MockHttpSession

public MockHttpSession()
Create a new MockHttpSession with a default MockServletContext.

See Also:
MockServletContext

MockHttpSession

public MockHttpSession(ServletContext servletContext)
Create a new MockHttpSession.

Parameters:
servletContext - the ServletContext that the session runs in

MockHttpSession

public MockHttpSession(ServletContext servletContext,
                       String id)
Create a new MockHttpSession.

Parameters:
servletContext - the ServletContext that the session runs in
id - a unique identifier for this session
Method Detail

getCreationTime

public long getCreationTime()
Specified by:
getCreationTime in interface HttpSession

getId

public String getId()
Specified by:
getId in interface HttpSession

access

public void access()

getLastAccessedTime

public long getLastAccessedTime()
Specified by:
getLastAccessedTime in interface HttpSession

getServletContext

public ServletContext getServletContext()
Specified by:
getServletContext in interface HttpSession

setMaxInactiveInterval

public void setMaxInactiveInterval(int interval)
Specified by:
setMaxInactiveInterval in interface HttpSession

getMaxInactiveInterval

public int getMaxInactiveInterval()
Specified by:
getMaxInactiveInterval in interface HttpSession

getSessionContext

public HttpSessionContext getSessionContext()
Specified by:
getSessionContext in interface HttpSession

getAttribute

public Object getAttribute(String name)
Specified by:
getAttribute in interface HttpSession

getValue

public Object getValue(String name)
Specified by:
getValue in interface HttpSession

getAttributeNames

public Enumeration<String> getAttributeNames()
Specified by:
getAttributeNames in interface HttpSession

getValueNames

public String[] getValueNames()
Specified by:
getValueNames in interface HttpSession

setAttribute

public void setAttribute(String name,
                         Object value)
Specified by:
setAttribute in interface HttpSession

putValue

public void putValue(String name,
                     Object value)
Specified by:
putValue in interface HttpSession

removeAttribute

public void removeAttribute(String name)
Specified by:
removeAttribute in interface HttpSession

removeValue

public void removeValue(String name)
Specified by:
removeValue in interface HttpSession

clearAttributes

public void clearAttributes()
Clear all of this session's attributes.

invalidate

public void invalidate()
Specified by:
invalidate in interface HttpSession

isInvalid

public boolean isInvalid()

setNew

public void setNew(boolean value)

isNew

public boolean isNew()
Specified by:
isNew in interface HttpSession

serializeState

public Serializable serializeState()
Serialize the attributes of this session into an object that can be turned into a byte array with standard Java serialization.

Returns:
a representation of this session's serialized state

deserializeState

public void deserializeState(Serializable state)
Deserialize the attributes of this session from a state object created by serializeState().

Parameters:
state - a representation of this session's serialized state
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockJspWriter

org.springframework.mock.web
Class MockJspWriter

java.lang.Object
    extended by  java.io.Writer
        extended by  javax.servlet.jsp.JspWriter
            extended by  org.springframework.mock.web.MockJspWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable
public class MockJspWriter
extends JspWriter

Mock implementation of the JspWriter class.

Used for testing the web framework; only necessary for testing applications when testing custom JSP tags.

Since:
2.5
Author:
Juergen Hoeller

Field Summary
Fields inherited from class javax.servlet.jsp.JspWriter
autoFlush, bufferSize, DEFAULT_BUFFER, NO_BUFFER, UNBOUNDED_BUFFER
Fields inherited from class java.io.Writer
lock
Constructor Summary
MockJspWriter(HttpServletResponse response)
Create a MockJspWriter for the given response, using the response's default Writer.
MockJspWriter(HttpServletResponse response, Writer targetWriter)
Create a MockJspWriter for the given response.
MockJspWriter(Writer targetWriter)
Create a MockJspWriter for the given plain Writer.
Method Summary
void | clear()
void | clearBuffer()
void | close()
void | flush()
int | getRemaining()
protected PrintWriter | getTargetWriter() Lazily initialize the target Writer.
void | newLine()
void | print(boolean value)
void | print(char value)
void | print(char[] value)
void | print(double value)
void | print(float value)
void | print(int value)
void | print(long value)
void | print(Object value)
void | print(String value)
void | println()
void | println(boolean value)
void | println(char value)
void | println(char[] value)
void | println(double value)
void | println(float value)
void | println(int value)
void | println(long value)
void | println(Object value)
void | println(String value)
void | write(char[] value, int offset, int length)
Methods inherited from class javax.servlet.jsp.JspWriter
getBufferSize, isAutoFlush
Methods inherited from class java.io.Writer
append, append, append, write, write, write, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MockJspWriter

public MockJspWriter(HttpServletResponse response)
Create a MockJspWriter for the given response, using the response's default Writer.

Parameters:
response - the servlet response to wrap

MockJspWriter

public MockJspWriter(Writer targetWriter)
Create a MockJspWriter for the given plain Writer.

Parameters:
targetWriter - the target Writer to wrap

MockJspWriter

public MockJspWriter(HttpServletResponse response,
                     Writer targetWriter)
Create a MockJspWriter for the given response.

Parameters:
response - the servlet response to wrap
targetWriter - the target Writer to wrap
Method Detail

getTargetWriter

protected PrintWriter getTargetWriter()
                               throws IOException
Lazily initialize the target Writer.

Throws:
IOException

clear

public void clear()
           throws IOException
Specified by:
clear in class JspWriter
Throws:
IOException

clearBuffer

public void clearBuffer()
                 throws IOException
Specified by:
clearBuffer in class JspWriter
Throws:
IOException

flush

public void flush()
           throws IOException
Specified by:
flush in interface Flushable
Specified by:
flush in class JspWriter
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Specified by:
close in class JspWriter
Throws:
IOException

getRemaining

public int getRemaining()
Specified by:
getRemaining in class JspWriter

newLine

public void newLine()
             throws IOException
Specified by:
newLine in class JspWriter
Throws:
IOException

write

public void write(char[] value,
                  int offset,
                  int length)
           throws IOException
Specified by:
write in class Writer
Throws:
IOException

print

public void print(boolean value)
           throws IOException
Specified by:
print in class JspWriter
Throws:
IOException

print

public void print(char value)
           throws IOException
Specified by:
print in class JspWriter
Throws:
IOException

print

public void print(char[] value)
           throws IOException
Specified by:
print in class JspWriter
Throws:
IOException

print

public void print(double value)
           throws IOException
Specified by:
print in class JspWriter
Throws:
IOException

print

public void print(float value)
           throws IOException
Specified by:
print in class JspWriter
Throws:
IOException

print

public void print(int value)
           throws IOException
Specified by:
print in class JspWriter
Throws:
IOException

print

public void print(long value)
           throws IOException
Specified by:
print in class JspWriter
Throws:
IOException

print

public void print(Object value)
           throws IOException
Specified by:
print in class JspWriter
Throws:
IOException

print

public void print(String value)
           throws IOException
Specified by:
print in class JspWriter
Throws:
IOException

println

public void println()
             throws IOException
Specified by:
println in class JspWriter
Throws:
IOException

println

public void println(boolean value)
             throws IOException
Specified by:
println in class JspWriter
Throws:
IOException

println

public void println(char value)
             throws IOException
Specified by:
println in class JspWriter
Throws:
IOException

println

public void println(char[] value)
             throws IOException
Specified by:
println in class JspWriter
Throws:
IOException

println

public void println(double value)
             throws IOException
Specified by:
println in class JspWriter
Throws:
IOException

println

public void println(float value)
             throws IOException
Specified by:
println in class JspWriter
Throws:
IOException

println

public void println(int value)
             throws IOException
Specified by:
println in class JspWriter
Throws:
IOException

println

public void println(long value)
             throws IOException
Specified by:
println in class JspWriter
Throws:
IOException

println

public void println(Object value)
             throws IOException
Specified by:
println in class JspWriter
Throws:
IOException

println

public void println(String value)
             throws IOException
Specified by:
println in class JspWriter
Throws:
IOException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockMultipartFile

org.springframework.mock.web
Class MockMultipartFile

java.lang.Object
    extended by  org.springframework.mock.web.MockMultipartFile
All Implemented Interfaces:
MultipartFile
public class MockMultipartFile
extends Object
implements MultipartFile

Mock implementation of the MultipartFile interface.

Useful in conjunction with a MockMultipartHttpServletRequest for testing application controllers that access multipart uploads.

Since:
2.0
Author:
Juergen Hoeller, Eric Crampton
See Also:
MockMultipartHttpServletRequest

Constructor Summary
MockMultipartFile(String name, byte[] content)
Create a new MockMultipartFile with the given content.
MockMultipartFile(String name, InputStream contentStream)
Create a new MockMultipartFile with the given content.
MockMultipartFile(String name, String originalFilename, String contentType, byte[] content)
Create a new MockMultipartFile with the given content.
MockMultipartFile(String name, String originalFilename, String contentType, InputStream contentStream)
Create a new MockMultipartFile with the given content.
Method Summary
byte[] | getBytes() Return the contents of the file as an array of bytes.
String | getContentType() Return the content type of the file.
InputStream | getInputStream() Return an InputStream to read the contents of the file from.
String | getName() Return the name of the parameter in the multipart form.
String | getOriginalFilename() Return the original filename in the client's filesystem.
long | getSize() Return the size of the file in bytes.
boolean | isEmpty() Return whether the uploaded file is empty, that is, either no file has been chosen in the multipart form or the chosen file has no content.
void | transferTo(File dest) Transfer the received file to the given destination file.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MockMultipartFile

public MockMultipartFile(String name,
                         byte[] content)
Create a new MockMultipartFile with the given content.

Parameters:
name - the name of the file
content - the content of the file

MockMultipartFile

public MockMultipartFile(String name,
                         InputStream contentStream)
                  throws IOException
Create a new MockMultipartFile with the given content.

Parameters:
name - the name of the file
contentStream - the content of the file as stream
Throws:
IOException - if reading from the stream failed

MockMultipartFile

public MockMultipartFile(String name,
                         String originalFilename,
                         String contentType,
                         byte[] content)
Create a new MockMultipartFile with the given content.

Parameters:
name - the name of the file
originalFilename - the original filename (as on the client's machine)
contentType - the content type (if known)
content - the content of the file

MockMultipartFile

public MockMultipartFile(String name,
                         String originalFilename,
                         String contentType,
                         InputStream contentStream)
                  throws IOException
Create a new MockMultipartFile with the given content.

Parameters:
name - the name of the file
originalFilename - the original filename (as on the client's machine)
contentType - the content type (if known)
contentStream - the content of the file as stream
Throws:
IOException - if reading from the stream failed
Method Detail

getName

public String getName()
Description copied from interface: MultipartFile
Return the name of the parameter in the multipart form.

Specified by:
getName in interface MultipartFile
Returns:
the name of the parameter (never null or empty)

getOriginalFilename

public String getOriginalFilename()
Description copied from interface: MultipartFile
Return the original filename in the client's filesystem.

This may contain path information depending on the browser used, but it typically will not with any other than Opera.

Specified by:
getOriginalFilename in interface MultipartFile
Returns:
the original filename, or the empty String if no file has been chosen in the multipart form

getContentType

public String getContentType()
Description copied from interface: MultipartFile
Return the content type of the file.

Specified by:
getContentType in interface MultipartFile
Returns:
the content type, or null if not defined (or no file has been chosen in the multipart form)

isEmpty

public boolean isEmpty()
Description copied from interface: MultipartFile
Return whether the uploaded file is empty, that is, either no file has been chosen in the multipart form or the chosen file has no content.

Specified by:
isEmpty in interface MultipartFile

getSize

public long getSize()
Description copied from interface: MultipartFile
Return the size of the file in bytes.

Specified by:
getSize in interface MultipartFile
Returns:
the size of the file, or 0 if empty

getBytes

public byte[] getBytes()
                throws IOException
Description copied from interface: MultipartFile
Return the contents of the file as an array of bytes.

Specified by:
getBytes in interface MultipartFile
Returns:
the contents of the file as bytes, or an empty byte array if empty
Throws:
IOException - in case of access errors (if the temporary store fails)

getInputStream

public InputStream getInputStream()
                           throws IOException
Description copied from interface: MultipartFile
Return an InputStream to read the contents of the file from. The user is responsible for closing the stream.

Specified by:
getInputStream in interface MultipartFile
Returns:
the contents of the file as stream, or an empty stream if empty
Throws:
IOException - in case of access errors (if the temporary store fails)

transferTo

public void transferTo(File dest)
                throws IOException,
                       IllegalStateException
Description copied from interface: MultipartFile
Transfer the received file to the given destination file.

This may either move the file in the filesystem, copy the file in the filesystem, or save memory-held contents to the destination file. If the destination file already exists, it will be deleted first.

If the file has been moved in the filesystem, this operation cannot be invoked again. Therefore, call this method just once to be able to work with any storage mechanism.

Specified by:
transferTo in interface MultipartFile
Parameters:
dest - the destination file
Throws:
IOException - in case of reading or writing errors
IllegalStateException - if the file has already been moved in the filesystem and is not available anymore for another transfer
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockMultipartHttpServletRequest

org.springframework.mock.web
Class MockMultipartHttpServletRequest

java.lang.Object
    extended by  org.springframework.mock.web.MockHttpServletRequest
        extended by  org.springframework.mock.web.MockMultipartHttpServletRequest
All Implemented Interfaces:
HttpServletRequest, ServletRequest, MultipartHttpServletRequest, MultipartRequest
public class MockMultipartHttpServletRequest
extends MockHttpServletRequest
implements MultipartHttpServletRequest

Mock implementation of the MultipartHttpServletRequest interface.

Useful for testing application controllers that access multipart uploads. The MockMultipartFile can be used to populate these mock requests with files.

Since:
2.0
Author:
Juergen Hoeller, Eric Crampton, Arjen Poutsma
See Also:
MockMultipartFile

Field Summary
Fields inherited from class org.springframework.mock.web.MockHttpServletRequest
DEFAULT_PROTOCOL, DEFAULT_REMOTE_ADDR, DEFAULT_REMOTE_HOST, DEFAULT_SERVER_ADDR, DEFAULT_SERVER_NAME, DEFAULT_SERVER_PORT
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
Constructor Summary
MockMultipartHttpServletRequest()
Method Summary
void | addFile(MultipartFile file) Add a file to this request.
MultipartFile | getFile(String name) Return the contents plus description of an uploaded file in this request, or null if it does not exist.
Map<String,MultipartFile> | getFileMap() Return a Map of the multipart files contained in this request.
Iterator<String> | getFileNames() Return an Iterator of String objects containing the parameter names of the multipart files contained in this request.
List<MultipartFile> | getFiles(String name) Return the contents plus description of uploaded files in this request, or an empty list if it does not exist.
MultiValueMap<String,MultipartFile> | getMultiFileMap() Return a MultiValueMap of the multipart files contained in this request.
Methods inherited from class org.springframework.mock.web.MockHttpServletRequest
addHeader, addParameter, addParameter, addParameters, addPreferredLocale, addUserRole, checkActive, clearAttributes, close, getAttribute, getAttributeNames, getAuthType, getCharacterEncoding, getContentLength, getContentType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getInputStream, getIntHeader, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getMethod, getParameter, getParameterMap, getParameterNames, getParameterValues, getPathInfo, getPathTranslated, getProtocol, getQueryString, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRemoteUser, getRequestDispatcher, getRequestedSessionId, getRequestURI, getRequestURL, getScheme, getServerName, getServerPort, getServletContext, getServletPath, getSession, getSession, getUserPrincipal, invalidate, isActive, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isSecure, isUserInRole, removeAllParameters, removeAttribute, removeParameter, setAttribute, setAuthType, setCharacterEncoding, setContent, setContentType, setContextPath, setCookies, setLocalAddr, setLocalName, setLocalPort, setMethod, setParameter, setParameter, setParameters, setPathInfo, setProtocol, setQueryString, setRemoteAddr, setRemoteHost, setRemotePort, setRemoteUser, setRequestedSessionId, setRequestedSessionIdFromCookie, setRequestedSessionIdFromURL, setRequestedSessionIdValid, setRequestURI, setScheme, setSecure, setServerName, setServerPort, setServletPath, setSession, setUserPrincipal
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.servlet.http.HttpServletRequest
getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole
Methods inherited from interface javax.servlet.ServletRequest
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding

Constructor Detail

MockMultipartHttpServletRequest

public MockMultipartHttpServletRequest()
Method Detail

addFile

public void addFile(MultipartFile file)
Add a file to this request. The parameter name from the multipart form is taken from the MultipartFile.getName().

Parameters:
file - multipart file to be added

getFileNames

public Iterator<String> getFileNames()
Description copied from interface: MultipartRequest
Return an Iterator of String objects containing the parameter names of the multipart files contained in this request. These are the field names of the form (like with normal parameters), not the original file names.

Specified by:
getFileNames in interface MultipartRequest
Returns:
the names of the files

getFile

public MultipartFile getFile(String name)
Description copied from interface: MultipartRequest
Return the contents plus description of an uploaded file in this request, or null if it does not exist.

Specified by:
getFile in interface MultipartRequest
Parameters:
name - a String specifying the parameter name of the multipart file
Returns:
the uploaded content in the form of a MultipartFile object

getFiles

public List<MultipartFile> getFiles(String name)
Description copied from interface: MultipartRequest
Return the contents plus description of uploaded files in this request, or an empty list if it does not exist.

Specified by:
getFiles in interface MultipartRequest
Parameters:
name - a String specifying the parameter name of the multipart file
Returns:
the uploaded content in the form of a MultipartFile list

getFileMap

public Map<String,MultipartFile> getFileMap()
Description copied from interface: MultipartRequest
Return a Map of the multipart files contained in this request.

Specified by:
getFileMap in interface MultipartRequest
Returns:
a map containing the parameter names as keys, and the MultipartFile objects as values
See Also:
MultipartFile

getMultiFileMap

public MultiValueMap<String,MultipartFile> getMultiFileMap()
Description copied from interface: MultipartRequest
Return a MultiValueMap of the multipart files contained in this request.

Specified by:
getMultiFileMap in interface MultipartRequest
Returns:
a map containing the parameter names as keys, and a list of MultipartFile objects as values
See Also:
MultipartFile
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockPageContext

org.springframework.mock.web
Class MockPageContext

java.lang.Object
    extended by  javax.servlet.jsp.JspContext
        extended by  javax.servlet.jsp.PageContext
            extended by  org.springframework.mock.web.MockPageContext

public class MockPageContext
extends PageContext

Mock implementation of the PageContext interface.

Used for testing the web framework; only necessary for testing applications when testing custom JSP tags.

Note: Expects initialization via the constructor rather than via the PageContext.initialize method. Does not support writing to a JspWriter, request dispatching, and handlePageException calls.

Since:
1.0.2
Author:
Juergen Hoeller

Field Summary
Fields inherited from class javax.servlet.jsp.PageContext
APPLICATION, APPLICATION_SCOPE, CONFIG, EXCEPTION, OUT, PAGE, PAGE_SCOPE, PAGECONTEXT, REQUEST, REQUEST_SCOPE, RESPONSE, SESSION, SESSION_SCOPE
Constructor Summary
MockPageContext()
Create new MockPageContext with a default MockServletContext, MockHttpServletRequest, MockHttpServletResponse, MockServletConfig.
MockPageContext(ServletContext servletContext)
Create new MockPageContext with a default MockHttpServletRequest, MockHttpServletResponse, MockServletConfig.
MockPageContext(ServletContext servletContext, HttpServletRequest request)
Create new MockPageContext with a MockHttpServletResponse, MockServletConfig.
MockPageContext(ServletContext servletContext, HttpServletRequest request, HttpServletResponse response)
Create new MockPageContext with a MockServletConfig.
MockPageContext(ServletContext servletContext, HttpServletRequest request, HttpServletResponse response, ServletConfig servletConfig)
Create new MockServletConfig.
Method Summary
Object | findAttribute(String name)
void | forward(String url)
Object | getAttribute(String name)
Object | getAttribute(String name, int scope)
Enumeration<String> | getAttributeNames()
Enumeration<String> | getAttributeNamesInScope(int scope)
int | getAttributesScope(String name)
javax.el.ELContext | getELContext()
Exception | getException()
ExpressionEvaluator | getExpressionEvaluator()
JspWriter | getOut()
Object | getPage()
ServletRequest | getRequest()
ServletResponse | getResponse()
ServletConfig | getServletConfig()
ServletContext | getServletContext()
HttpSession | getSession()
VariableResolver | getVariableResolver()
void | handlePageException(Exception ex)
void | handlePageException(Throwable ex)
void | include(String url)
void | include(String url, boolean flush)
void | initialize(Servlet servlet, ServletRequest request, ServletResponse response, String errorPageURL, boolean needsSession, int bufferSize, boolean autoFlush)
void | release()
void | removeAttribute(String name)
void | removeAttribute(String name, int scope)
void | setAttribute(String name, Object value)
void | setAttribute(String name, Object value, int scope)
Methods inherited from class javax.servlet.jsp.PageContext
getErrorData, pushBody
Methods inherited from class javax.servlet.jsp.JspContext
popBody, pushBody
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MockPageContext

public MockPageContext()
Create new MockPageContext with a default MockServletContext, MockHttpServletRequest, MockHttpServletResponse, MockServletConfig.

MockPageContext

public MockPageContext(ServletContext servletContext)
Create new MockPageContext with a default MockHttpServletRequest, MockHttpServletResponse, MockServletConfig.

Parameters:
servletContext - the ServletContext that the JSP page runs in (only necessary when actually accessing the ServletContext)

MockPageContext

public MockPageContext(ServletContext servletContext,
                       HttpServletRequest request)
Create new MockPageContext with a MockHttpServletResponse, MockServletConfig.

Parameters:
servletContext - the ServletContext that the JSP page runs in
request - the current HttpServletRequest (only necessary when actually accessing the request)

MockPageContext

public MockPageContext(ServletContext servletContext,
                       HttpServletRequest request,
                       HttpServletResponse response)
Create new MockPageContext with a MockServletConfig.

Parameters:
servletContext - the ServletContext that the JSP page runs in
request - the current HttpServletRequest
response - the current HttpServletResponse (only necessary when actually writing to the response)

MockPageContext

public MockPageContext(ServletContext servletContext,
                       HttpServletRequest request,
                       HttpServletResponse response,
                       ServletConfig servletConfig)
Create new MockServletConfig.

Parameters:
servletContext - the ServletContext that the JSP page runs in
request - the current HttpServletRequest
response - the current HttpServletResponse
servletConfig - the ServletConfig (hardly ever accessed from within a tag)
Method Detail

initialize

public void initialize(Servlet servlet,
                       ServletRequest request,
                       ServletResponse response,
                       String errorPageURL,
                       boolean needsSession,
                       int bufferSize,
                       boolean autoFlush)
Specified by:
initialize in class PageContext

release

public void release()
Specified by:
release in class PageContext

setAttribute

public void setAttribute(String name,
                         Object value)
Specified by:
setAttribute in class JspContext

setAttribute

public void setAttribute(String name,
                         Object value,
                         int scope)
Specified by:
setAttribute in class JspContext

getAttribute

public Object getAttribute(String name)
Specified by:
getAttribute in class JspContext

getAttribute

public Object getAttribute(String name,
                           int scope)
Specified by:
getAttribute in class JspContext

findAttribute

public Object findAttribute(String name)
Specified by:
findAttribute in class JspContext

removeAttribute

public void removeAttribute(String name)
Specified by:
removeAttribute in class JspContext

removeAttribute

public void removeAttribute(String name,
                            int scope)
Specified by:
removeAttribute in class JspContext

getAttributesScope

public int getAttributesScope(String name)
Specified by:
getAttributesScope in class JspContext

getAttributeNames

public Enumeration<String> getAttributeNames()

getAttributeNamesInScope

public Enumeration<String> getAttributeNamesInScope(int scope)
Specified by:
getAttributeNamesInScope in class JspContext

getOut

public JspWriter getOut()
Specified by:
getOut in class JspContext

getExpressionEvaluator

public ExpressionEvaluator getExpressionEvaluator()
Specified by:
getExpressionEvaluator in class JspContext

getELContext

public javax.el.ELContext getELContext()
Specified by:
getELContext in class JspContext

getVariableResolver

public VariableResolver getVariableResolver()
Specified by:
getVariableResolver in class JspContext

getSession

public HttpSession getSession()
Specified by:
getSession in class PageContext

getPage

public Object getPage()
Specified by:
getPage in class PageContext

getRequest

public ServletRequest getRequest()
Specified by:
getRequest in class PageContext

getResponse

public ServletResponse getResponse()
Specified by:
getResponse in class PageContext

getException

public Exception getException()
Specified by:
getException in class PageContext

getServletConfig

public ServletConfig getServletConfig()
Specified by:
getServletConfig in class PageContext

getServletContext

public ServletContext getServletContext()
Specified by:
getServletContext in class PageContext

forward

public void forward(String url)
             throws ServletException,
                    IOException
Specified by:
forward in class PageContext
Throws:
ServletException
IOException

include

public void include(String url)
             throws ServletException,
                    IOException
Specified by:
include in class PageContext
Throws:
ServletException
IOException

include

public void include(String url,
                    boolean flush)
             throws ServletException,
                    IOException
Specified by:
include in class PageContext
Throws:
ServletException
IOException

handlePageException

public void handlePageException(Exception ex)
                         throws ServletException,
                                IOException
Specified by:
handlePageException in class PageContext
Throws:
ServletException
IOException

handlePageException

public void handlePageException(Throwable ex)
                         throws ServletException,
                                IOException
Specified by:
handlePageException in class PageContext
Throws:
ServletException
IOException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockRequestDispatcher

org.springframework.mock.web
Class MockRequestDispatcher

java.lang.Object
    extended by  org.springframework.mock.web.MockRequestDispatcher
All Implemented Interfaces:
RequestDispatcher
public class MockRequestDispatcher
extends Object
implements RequestDispatcher

Mock implementation of the RequestDispatcher interface.

Used for testing the web framework; typically not necessary for testing application controllers.

Since:
1.0.2
Author:
Rod Johnson, Juergen Hoeller

Constructor Summary
MockRequestDispatcher(String url)
Create a new MockRequestDispatcher for the given URL.
Method Summary
void | forward(ServletRequest request, ServletResponse response)
protected MockHttpServletResponse | getMockHttpServletResponse(ServletResponse response) Obtain the underlying MockHttpServletResponse, unwrapping HttpServletResponseWrapper decorators if necessary.
void | include(ServletRequest request, ServletResponse response)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MockRequestDispatcher

public MockRequestDispatcher(String url)
Create a new MockRequestDispatcher for the given URL.

Parameters:
url - the URL to dispatch to.
Method Detail

forward

public void forward(ServletRequest request,
                    ServletResponse response)
Specified by:
forward in interface RequestDispatcher

include

public void include(ServletRequest request,
                    ServletResponse response)
Specified by:
include in interface RequestDispatcher

getMockHttpServletResponse

protected MockHttpServletResponse getMockHttpServletResponse(ServletResponse response)
Obtain the underlying MockHttpServletResponse, unwrapping HttpServletResponseWrapper decorators if necessary.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockServletConfig

org.springframework.mock.web
Class MockServletConfig

java.lang.Object
    extended by  org.springframework.mock.web.MockServletConfig
All Implemented Interfaces:
ServletConfig
public class MockServletConfig
extends Object
implements ServletConfig

Mock implementation of the ServletConfig interface.

Used for testing the web framework; typically not necessary for testing application controllers.

Since:
1.0.2
Author:
Rod Johnson, Juergen Hoeller

Constructor Summary
MockServletConfig()
Create a new MockServletConfig with a default MockServletContext.
MockServletConfig(ServletContext servletContext)
Create a new MockServletConfig.
MockServletConfig(ServletContext servletContext, String servletName)
Create a new MockServletConfig.
MockServletConfig(String servletName)
Create a new MockServletConfig with a default MockServletContext.
Method Summary
void | addInitParameter(String name, String value)
String | getInitParameter(String name)
Enumeration<String> | getInitParameterNames()
ServletContext | getServletContext()
String | getServletName()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MockServletConfig

public MockServletConfig()
Create a new MockServletConfig with a default MockServletContext.

MockServletConfig

public MockServletConfig(String servletName)
Create a new MockServletConfig with a default MockServletContext.

Parameters:
servletName - the name of the servlet

MockServletConfig

public MockServletConfig(ServletContext servletContext)
Create a new MockServletConfig.

Parameters:
servletContext - the ServletContext that the servlet runs in

MockServletConfig

public MockServletConfig(ServletContext servletContext,
                         String servletName)
Create a new MockServletConfig.

Parameters:
servletContext - the ServletContext that the servlet runs in
servletName - the name of the servlet
Method Detail

getServletName

public String getServletName()
Specified by:
getServletName in interface ServletConfig

getServletContext

public ServletContext getServletContext()
Specified by:
getServletContext in interface ServletConfig

addInitParameter

public void addInitParameter(String name,
                             String value)

getInitParameter

public String getInitParameter(String name)
Specified by:
getInitParameter in interface ServletConfig

getInitParameterNames

public Enumeration<String> getInitParameterNames()
Specified by:
getInitParameterNames in interface ServletConfig
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockServletContext

org.springframework.mock.web
Class MockServletContext

java.lang.Object
    extended by  org.springframework.mock.web.MockServletContext
All Implemented Interfaces:
ServletContext
public class MockServletContext
extends Object
implements ServletContext

Mock implementation of the ServletContext interface.

Used for testing the Spring web framework; only rarely necessary for testing application controllers. As long as application components don't explicitly access the ServletContext, ClassPathXmlApplicationContext or FileSystemXmlApplicationContext can be used to load the context files for testing, even for DispatcherServlet context definitions.

For setting up a full WebApplicationContext in a test environment, you can use XmlWebApplicationContext (or GenericWebApplicationContext), passing in an appropriate MockServletContext instance. You might want to configure your MockServletContext with a FileSystemResourceLoader in that case, to make your resource paths interpreted as relative file system locations.

A common setup is to point your JVM working directory to the root of your web application directory, in combination with filesystem-based resource loading. This allows to load the context files as used in the web application, with relative paths getting interpreted correctly. Such a setup will work with both FileSystemXmlApplicationContext (which will load straight from the file system) and XmlWebApplicationContext with an underlying MockServletContext (as long as the MockServletContext has been configured with a FileSystemResourceLoader).

Since:
1.0.2
Author:
Rod Johnson, Juergen Hoeller
See Also:
MockServletContext(org.springframework.core.io.ResourceLoader), XmlWebApplicationContext, GenericWebApplicationContext, ClassPathXmlApplicationContext, FileSystemXmlApplicationContext

Constructor Summary
MockServletContext()
Create a new MockServletContext, using no base path and a DefaultResourceLoader (i.e.
MockServletContext(ResourceLoader resourceLoader)
Create a new MockServletContext, using the specified ResourceLoader and no base path.
MockServletContext(String resourceBasePath)
Create a new MockServletContext, using a DefaultResourceLoader.
MockServletContext(String resourceBasePath, ResourceLoader resourceLoader)
Create a new MockServletContext.
Method Summary
void | addInitParameter(String name, String value)
Object | getAttribute(String name)
Enumeration<String> | getAttributeNames()
ServletContext | getContext(String contextPath)
String | getContextPath()
String | getInitParameter(String name)
Enumeration<String> | getInitParameterNames()
int | getMajorVersion()
String | getMimeType(String filePath)
int | getMinorVersion()
RequestDispatcher | getNamedDispatcher(String path)
String | getRealPath(String path)
RequestDispatcher | getRequestDispatcher(String path)
URL | getResource(String path)
InputStream | getResourceAsStream(String path)
protected String | getResourceLocation(String path) Build a full resource location for the given path, prepending the resource base path of this MockServletContext.
Set<String> | getResourcePaths(String path)
String | getServerInfo()
Servlet | getServlet(String name)
String | getServletContextName()
Enumeration<String> | getServletNames()
Enumeration<Servlet> | getServlets()
void | log(Exception ex, String message)
void | log(String message)
void | log(String message, Throwable ex)
void | registerContext(String contextPath, ServletContext context)
void | removeAttribute(String name)
void | setAttribute(String name, Object value)
void | setContextPath(String contextPath)
void | setMinorVersion(int minorVersion)
void | setServletContextName(String servletContextName)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MockServletContext

public MockServletContext()
Create a new MockServletContext, using no base path and a DefaultResourceLoader (i.e. the classpath root as WAR root).

See Also:
DefaultResourceLoader

MockServletContext

public MockServletContext(String resourceBasePath)
Create a new MockServletContext, using a DefaultResourceLoader.

Parameters:
resourceBasePath - the WAR root directory (should not end with a slash)
See Also:
DefaultResourceLoader

MockServletContext

public MockServletContext(ResourceLoader resourceLoader)
Create a new MockServletContext, using the specified ResourceLoader and no base path.

Parameters:
resourceLoader - the ResourceLoader to use (or null for the default)

MockServletContext

public MockServletContext(String resourceBasePath,
                          ResourceLoader resourceLoader)
Create a new MockServletContext.

Parameters:
resourceBasePath - the WAR root directory (should not end with a slash)
resourceLoader - the ResourceLoader to use (or null for the default)
Method Detail

getResourceLocation

protected String getResourceLocation(String path)
Build a full resource location for the given path, prepending the resource base path of this MockServletContext.

Parameters:
path - the path as specified
Returns:
the full resource path

setContextPath

public void setContextPath(String contextPath)

getContextPath

public String getContextPath()
Specified by:
getContextPath in interface ServletContext

registerContext

public void registerContext(String contextPath,
                            ServletContext context)

getContext

public ServletContext getContext(String contextPath)
Specified by:
getContext in interface ServletContext

getMajorVersion

public int getMajorVersion()
Specified by:
getMajorVersion in interface ServletContext

getMinorVersion

public int getMinorVersion()
Specified by:
getMinorVersion in interface ServletContext

getMimeType

public String getMimeType(String filePath)
Specified by:
getMimeType in interface ServletContext

getResourcePaths

public Set<String> getResourcePaths(String path)
Specified by:
getResourcePaths in interface ServletContext

getResource

public URL getResource(String path)
                throws MalformedURLException
Specified by:
getResource in interface ServletContext
Throws:
MalformedURLException

getResourceAsStream

public InputStream getResourceAsStream(String path)
Specified by:
getResourceAsStream in interface ServletContext

getRequestDispatcher

public RequestDispatcher getRequestDispatcher(String path)
Specified by:
getRequestDispatcher in interface ServletContext

getNamedDispatcher

public RequestDispatcher getNamedDispatcher(String path)
Specified by:
getNamedDispatcher in interface ServletContext

getServlet

public Servlet getServlet(String name)
Specified by:
getServlet in interface ServletContext

getServlets

public Enumeration<Servlet> getServlets()
Specified by:
getServlets in interface ServletContext

getServletNames

public Enumeration<String> getServletNames()
Specified by:
getServletNames in interface ServletContext

log

public void log(String message)
Specified by:
log in interface ServletContext

log

public void log(Exception ex,
                String message)
Specified by:
log in interface ServletContext

log

public void log(String message,
                Throwable ex)
Specified by:
log in interface ServletContext

getRealPath

public String getRealPath(String path)
Specified by:
getRealPath in interface ServletContext

getServerInfo

public String getServerInfo()
Specified by:
getServerInfo in interface ServletContext

getInitParameter

public String getInitParameter(String name)
Specified by:
getInitParameter in interface ServletContext

addInitParameter

public void addInitParameter(String name,
                             String value)

getInitParameterNames

public Enumeration<String> getInitParameterNames()
Specified by:
getInitParameterNames in interface ServletContext

getAttribute

public Object getAttribute(String name)
Specified by:
getAttribute in interface ServletContext

getAttributeNames

public Enumeration<String> getAttributeNames()
Specified by:
getAttributeNames in interface ServletContext

setAttribute

public void setAttribute(String name,
                         Object value)
Specified by:
setAttribute in interface ServletContext

removeAttribute

public void removeAttribute(String name)
Specified by:
removeAttribute in interface ServletContext

setServletContextName

public void setServletContextName(String servletContextName)

getServletContextName

public String getServletContextName()
Specified by:
getServletContextName in interface ServletContext

setMinorVersion

public void setMinorVersion(int minorVersion)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PassThroughFilterChain

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.mock.web
Class PassThroughFilterChain

java.lang.Object
    extended by  org.springframework.mock.web.PassThroughFilterChain
All Implemented Interfaces:
FilterChain
public class PassThroughFilterChain
extends Object
implements FilterChain

Implementation of the FilterConfig interface which simply passes the call through to a given Filter/FilterChain combination (indicating the next Filter in the chain along with the FilterChain that it is supposed to work on) or to a given Servlet (indicating the end of the chain).

Since:
2.0.3
Author:
Juergen Hoeller
See Also:
Filter, Servlet, MockFilterChain

Constructor Summary
PassThroughFilterChain(Filter filter, FilterChain nextFilterChain)
Create a new PassThroughFilterChain that delegates to the given Filter, calling it with the given FilterChain.
PassThroughFilterChain(Servlet servlet)
Create a new PassThroughFilterChain that delegates to the given Servlet.
Method Summary
 void doFilter(ServletRequest request, ServletResponse response)
Pass the call on to the Filter/Servlet.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PassThroughFilterChain

public PassThroughFilterChain(Filter filter,
                              FilterChain nextFilterChain)
Create a new PassThroughFilterChain that delegates to the given Filter, calling it with the given FilterChain.

Parameters:
filter - the Filter to delegate to
nextFilterChain - the FilterChain to use for that next Filter

PassThroughFilterChain

public PassThroughFilterChain(Servlet servlet)
Create a new PassThroughFilterChain that delegates to the given Servlet.

Parameters:
servlet - the Servlet to delegate to
Method Detail

doFilter

public void doFilter(ServletRequest request,
                     ServletResponse response)
              throws ServletException,
                     IOException
Pass the call on to the Filter/Servlet.

Specified by:
doFilter in interface FilterChain
Throws:
ServletException
IOException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.mock.web.portlet

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.mock.web.portlet

A comprehensive set of Portlet API 2.0 mock objects, targeted at usage with Spring's web MVC framework.

See:
Description

Class Summary
MockActionRequest | Mock implementation of the ActionRequest interface.
MockActionResponse | Mock implementation of the ActionResponse interface.
MockBaseURL | Mock implementation of the BaseURL interface.
MockCacheControl | Mock implementation of the CacheControl interface.
MockClientDataRequest | Mock implementation of the ClientDataRequest interface.
MockEvent | Mock implementation of the Event interface.
MockEventRequest | Mock implementation of the EventRequest interface.
MockEventResponse | Mock implementation of the EventResponse interface.
MockMimeResponse | Mock implementation of the MimeResponse interface.
MockMultipartActionRequest | Mock implementation of the MultipartActionRequest interface.
MockPortalContext | Mock implementation of the PortalContext interface.
MockPortletConfig | Mock implementation of the PortletConfig interface.
MockPortletContext | Mock implementation of the PortletContext interface.
MockPortletPreferences | Mock implementation of the PortletPreferences interface.
MockPortletRequest | Mock implementation of the PortletRequest interface.
MockPortletRequestDispatcher | Mock implementation of the PortletRequestDispatcher interface.
MockPortletResponse | Mock implementation of the PortletResponse interface.
MockPortletSession | Mock implementation of the PortletSession interface.
MockPortletURL | Mock implementation of the PortletURL interface.
MockRenderRequest | Mock implementation of the RenderRequest interface.
MockRenderResponse | Mock implementation of the RenderResponse interface.
MockResourceRequest | Mock implementation of the ResourceRequest interface.
MockResourceResponse | Mock implementation of the ResourceResponse interface.
MockResourceURL | Mock implementation of the ResourceURL interface.
MockStateAwareResponse | Mock implementation of the StateAwareResponse interface.
ServletWrappingPortletContext | Mock implementation of the PortletContext interface, wrapping an underlying ServletContext.

Package org.springframework.mock.web.portlet Description

A comprehensive set of Portlet API 2.0 mock objects, targeted at usage with Spring's web MVC framework. Useful for testing web contexts and controllers.

More convenient to use than dynamic mock objects (EasyMock) or existing Portlet API mock objects.


org.springframework.mock.web.portlet Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.mock.web.portlet

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.mock.web.portlet.MockBaseURL (implements javax.portlet.BaseURL)
      • org.springframework.mock.web.portlet.MockPortletURL (implements javax.portlet.PortletURL)
      • org.springframework.mock.web.portlet.MockResourceURL (implements javax.portlet.ResourceURL)
    • org.springframework.mock.web.portlet.MockCacheControl (implements javax.portlet.CacheControl)
    • org.springframework.mock.web.portlet.MockEvent (implements javax.portlet.Event)
    • org.springframework.mock.web.portlet.MockPortalContext (implements javax.portlet.PortalContext)
    • org.springframework.mock.web.portlet.MockPortletConfig (implements javax.portlet.PortletConfig)
    • org.springframework.mock.web.portlet.MockPortletContext (implements javax.portlet.PortletContext)
    • org.springframework.mock.web.portlet.MockPortletPreferences (implements javax.portlet.PortletPreferences)
    • org.springframework.mock.web.portlet.MockPortletRequest (implements javax.portlet.PortletRequest)
      • org.springframework.mock.web.portlet.MockClientDataRequest (implements javax.portlet.ClientDataRequest)
        • org.springframework.mock.web.portlet.MockActionRequest (implements javax.portlet.ActionRequest)
          • org.springframework.mock.web.portlet.MockMultipartActionRequest (implements org.springframework.web.portlet.multipart.MultipartActionRequest)
        • org.springframework.mock.web.portlet.MockResourceRequest (implements javax.portlet.ResourceRequest)
      • org.springframework.mock.web.portlet.MockEventRequest (implements javax.portlet.EventRequest)
      • org.springframework.mock.web.portlet.MockRenderRequest (implements javax.portlet.RenderRequest)
    • org.springframework.mock.web.portlet.MockPortletRequestDispatcher (implements javax.portlet.PortletRequestDispatcher)
    • org.springframework.mock.web.portlet.MockPortletResponse (implements javax.portlet.PortletResponse)
      • org.springframework.mock.web.portlet.MockMimeResponse (implements javax.portlet.MimeResponse)
        • org.springframework.mock.web.portlet.MockRenderResponse (implements javax.portlet.RenderResponse)
        • org.springframework.mock.web.portlet.MockResourceResponse (implements javax.portlet.ResourceResponse)
      • org.springframework.mock.web.portlet.MockStateAwareResponse (implements javax.portlet.StateAwareResponse)
        • org.springframework.mock.web.portlet.MockActionResponse (implements javax.portlet.ActionResponse)
        • org.springframework.mock.web.portlet.MockEventResponse (implements javax.portlet.EventResponse)
    • org.springframework.mock.web.portlet.MockPortletSession (implements javax.portlet.PortletSession)
    • org.springframework.mock.web.portlet.ServletWrappingPortletContext (implements javax.portlet.PortletContext)


MockActionRequest

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.mock.web.portlet
Class MockActionRequest

java.lang.Object
    extended by  org.springframework.mock.web.portlet.MockPortletRequest
        extended by  org.springframework.mock.web.portlet.MockClientDataRequest
            extended by  org.springframework.mock.web.portlet.MockActionRequest
All Implemented Interfaces:
javax.portlet.ActionRequest, javax.portlet.ClientDataRequest, javax.portlet.PortletRequest
Direct Known Subclasses:
MockMultipartActionRequest
public class MockActionRequest
extends MockClientDataRequest
implements javax.portlet.ActionRequest

Mock implementation of the ActionRequest interface.

Since:
2.0
Author:
John A. Lewis, Juergen Hoeller

Nested Class Summary
Nested classes/interfaces inherited from interface javax.portlet.PortletRequest
javax.portlet.PortletRequest.P3PUserInfos
Field Summary
Fields inherited from interface javax.portlet.ActionRequest
ACTION_NAME
Fields inherited from interface javax.portlet.PortletRequest
ACTION_PHASE, ACTION_SCOPE_ID, BASIC_AUTH, CCPP_PROFILE, CLIENT_CERT_AUTH, DIGEST_AUTH, EVENT_PHASE, FORM_AUTH, LIFECYCLE_PHASE, RENDER_HEADERS, RENDER_MARKUP, RENDER_PART, RENDER_PHASE, RESOURCE_PHASE, USER_INFO
Constructor Summary
MockActionRequest()
Create a new MockActionRequest with a default MockPortalContext and a default MockPortletContext.
MockActionRequest(javax.portlet.PortalContext portalContext, javax.portlet.PortletContext portletContext)
Create a new MockActionRequest.
MockActionRequest(javax.portlet.PortletContext portletContext)
Create a new MockActionRequest with a default MockPortalContext.
MockActionRequest(javax.portlet.PortletMode portletMode)
Create a new MockActionRequest with a default MockPortalContext and a default MockPortletContext.
MockActionRequest(String actionName)
Create a new MockActionRequest with a default MockPortalContext and a default MockPortletContext.
Method Summary
protected  String getLifecyclePhase()
Return the Portlet 2.0 lifecycle id for the current phase.
Methods inherited from class org.springframework.mock.web.portlet.MockClientDataRequest
getCharacterEncoding, getContentLength, getContentType, getMethod, getPortletInputStream, getReader, setCharacterEncoding, setContent, setContentType, setMethod
Methods inherited from class org.springframework.mock.web.portlet.MockPortletRequest
addLocale, addParameter, addParameter, addPreferredLocale, addPreferredResponseContentType, addProperty, addResponseContentType, addUserRole, checkActive, close, getAttribute, getAttributeNames, getAuthType, getContextPath, getCookies, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getPortalContext, getPortletMode, getPortletSession, getPortletSession, getPreferences, getPrivateParameterMap, getProperties, getProperty, getPropertyNames, getPublicParameterMap, getRemoteUser, getRequestedSessionId, getResponseContentType, getResponseContentTypes, getScheme, getServerName, getServerPort, getUserPrincipal, getWindowID, getWindowState, isActive, isPortletModeAllowed, isRequestedSessionIdValid, isSecure, isUserInRole, isWindowStateAllowed, registerPublicParameter, removeAttribute, setAttribute, setAuthType, setContextPath, setCookies, setParameter, setParameter, setParameters, setPortletMode, setPreferences, setProperty, setRemoteUser, setRequestedSessionIdValid, setScheme, setSecure, setServerName, setServerPort, setSession, setUserPrincipal, setWindowID, setWindowState
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.portlet.ClientDataRequest
getCharacterEncoding, getContentLength, getContentType, getMethod, getPortletInputStream, getReader, setCharacterEncoding
Methods inherited from interface javax.portlet.PortletRequest
getAttribute, getAttributeNames, getAuthType, getContextPath, getCookies, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getPortalContext, getPortletMode, getPortletSession, getPortletSession, getPreferences, getPrivateParameterMap, getProperties, getProperty, getPropertyNames, getPublicParameterMap, getRemoteUser, getRequestedSessionId, getResponseContentType, getResponseContentTypes, getScheme, getServerName, getServerPort, getUserPrincipal, getWindowID, getWindowState, isPortletModeAllowed, isRequestedSessionIdValid, isSecure, isUserInRole, isWindowStateAllowed, removeAttribute, setAttribute

Constructor Detail

MockActionRequest

public MockActionRequest()
Create a new MockActionRequest with a default MockPortalContext and a default MockPortletContext.

See Also:
MockPortalContext, MockPortletContext

MockActionRequest

public MockActionRequest(String actionName)
Create a new MockActionRequest with a default MockPortalContext and a default MockPortletContext.

Parameters:
actionName - the name of the action to trigger

MockActionRequest

public MockActionRequest(javax.portlet.PortletMode portletMode)
Create a new MockActionRequest with a default MockPortalContext and a default MockPortletContext.

Parameters:
portletMode - the mode that the portlet runs in

MockActionRequest

public MockActionRequest(javax.portlet.PortletContext portletContext)
Create a new MockActionRequest with a default MockPortalContext.

Parameters:
portletContext - the PortletContext that the request runs in

MockActionRequest

public MockActionRequest(javax.portlet.PortalContext portalContext,
                         javax.portlet.PortletContext portletContext)
Create a new MockActionRequest.

Parameters:
portalContext - the PortalContext that the request runs in
portletContext - the PortletContext that the request runs in
Method Detail

getLifecyclePhase

protected String getLifecyclePhase()
Description copied from class: MockPortletRequest
Return the Portlet 2.0 lifecycle id for the current phase.

Overrides:
getLifecyclePhase in class MockPortletRequest
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


MockActionResponse

org.springframework.mock.web.portlet
Class MockActionResponse

java.lang.Object
    extended by  org.springframework.mock.web.portlet.MockPortletResponse
        extended by  org.springframework.mock.web.portlet.MockStateAwareResponse
            extended by  org.springframework.mock.web.portlet.MockActionResponse
All Implemented Interfaces:
javax.portlet.ActionResponse, javax.portlet.PortletResponse, javax.portlet.StateAwareResponse
public class MockActionResponse
extends MockStateAwareResponse
implements javax.portlet.ActionResponse

Mock implementation of the ActionResponse interface.

Since:
2.0
Author:
John A. Lewis, Juergen Hoeller

Constructor Summary
MockActionResponse()
Create a new MockActionResponse with a default MockPortalContext.
MockActionResponse(javax.portlet.PortalContext portalContext)
Create a new MockActionResponse.
Method Summary
String | getRedirectedUrl()
void | sendRedirect(String location)
void | sendRedirect(String location, String renderUrlParamName)
void | setPortletMode(javax.portlet.PortletMode portletMode)
void | setRenderParameter(String key, String value)
void | setRenderParameter(String key, String[] values)
void | setRenderParameters(Map<String,String[]> parameters)
void | setWindowState(javax.portlet.WindowState windowState)
Methods inherited from class org.springframework.mock.web.portlet.MockStateAwareResponse
getEvent, getEvent, getEventNames, getPortletMode, getRenderParameter, getRenderParameterMap, getRenderParameterNames, getRenderParameterValues, getWindowState, removePublicRenderParameter, setEvent, setEvent
Methods inherited from class org.springframework.mock.web.portlet.MockPortletResponse
addProperty, addProperty, addProperty, createElement, encodeURL, getCookie, getCookies, getNamespace, getPortalContext, getProperties, getProperty, getPropertyNames, getXmlProperties, getXmlProperty, getXmlPropertyNames, setNamespace, setProperty
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.portlet.StateAwareResponse
getPortletMode, getRenderParameterMap, getWindowState, removePublicRenderParameter, setEvent, setEvent
Methods inherited from interface javax.portlet.PortletResponse
addProperty, addProperty, addProperty, createElement, encodeURL, getNamespace, setProperty

Constructor Detail

MockActionResponse

public MockActionResponse()
Create a new MockActionResponse with a default MockPortalContext.

See Also:
MockPortalContext

MockActionResponse

public MockActionResponse(javax.portlet.PortalContext portalContext)
Create a new MockActionResponse.

Parameters:
portalContext - the PortalContext defining the supported PortletModes and WindowStates
Method Detail

setWindowState

public void setWindowState(javax.portlet.WindowState windowState)
                    throws javax.portlet.WindowStateException
Specified by:
setWindowState in interface javax.portlet.StateAwareResponse
Overrides:
setWindowState in class MockStateAwareResponse
Throws:
javax.portlet.WindowStateException

setPortletMode

public void setPortletMode(javax.portlet.PortletMode portletMode)
                    throws javax.portlet.PortletModeException
Specified by:
setPortletMode in interface javax.portlet.StateAwareResponse
Overrides:
setPortletMode in class MockStateAwareResponse
Throws:
javax.portlet.PortletModeException

setRenderParameters

public void setRenderParameters(Map<String,String[]> parameters)
Specified by:
setRenderParameters in interface javax.portlet.StateAwareResponse
Overrides:
setRenderParameters in class MockStateAwareResponse

setRenderParameter

public void setRenderParameter(String key,
                               String value)
Specified by:
setRenderParameter in interface javax.portlet.StateAwareResponse
Overrides:
setRenderParameter in class MockStateAwareResponse

setRenderParameter

public void setRenderParameter(String key,
                               String[] values)
Specified by:
setRenderParameter in interface javax.portlet.StateAwareResponse
Overrides:
setRenderParameter in class MockStateAwareResponse

sendRedirect

public void sendRedirect(String location)
                  throws IOException
Specified by:
sendRedirect in interface javax.portlet.ActionResponse
Throws:
IOException

sendRedirect

public void sendRedirect(String location,
                         String renderUrlParamName)
                  throws IOException
Specified by:
sendRedirect in interface javax.portlet.ActionResponse
Throws:
IOException

getRedirectedUrl

public String getRedirectedUrl()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockBaseURL

org.springframework.mock.web.portlet
Class MockBaseURL

java.lang.Object
    extended by  org.springframework.mock.web.portlet.MockBaseURL
All Implemented Interfaces:
javax.portlet.BaseURL
Direct Known Subclasses:
MockPortletURL, MockResourceURL
public abstract class MockBaseURL
extends Object
implements javax.portlet.BaseURL

Mock implementation of the BaseURL interface.

Since:
3.0
Author:
Juergen Hoeller

Field Summary
protected Map<String,String[]> | parameters
static String | URL_TYPE_ACTION
static String | URL_TYPE_RENDER
Constructor Summary
MockBaseURL()
Method Summary
void | addProperty(String key, String value)
protected String | encodeParameter(String name, String value)
protected String | encodeParameter(String name, String[] values)
String | getParameter(String name)
Map<String,String[]> | getParameterMap()
Set<String> | getParameterNames()
String[] | getParameterValues(String name)
Map<String,String[]> | getProperties()
boolean | isSecure()
void | setParameter(String key, String value)
void | setParameter(String key, String[] values)
void | setParameters(Map<String,String[]> parameters)
void | setProperty(String key, String value)
void | setSecure(boolean secure)
void | write(Writer out)
void | write(Writer out, boolean escapeXML)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.portlet.BaseURL
toString

Field Detail

URL_TYPE_RENDER

public static final String URL_TYPE_RENDER
See Also:
Constant Field Values

URL_TYPE_ACTION

public static final String URL_TYPE_ACTION
See Also:
Constant Field Values

parameters

protected final Map<String,String[]> parameters
Constructor Detail

MockBaseURL

public MockBaseURL()
Method Detail

setParameter

public void setParameter(String key,
                         String value)
Specified by:
setParameter in interface javax.portlet.BaseURL

setParameter

public void setParameter(String key,
                         String[] values)
Specified by:
setParameter in interface javax.portlet.BaseURL

setParameters

public void setParameters(Map<String,String[]> parameters)
Specified by:
setParameters in interface javax.portlet.BaseURL

getParameterNames

public Set<String> getParameterNames()

getParameter

public String getParameter(String name)

getParameterValues

public String[] getParameterValues(String name)

getParameterMap

public Map<String,String[]> getParameterMap()
Specified by:
getParameterMap in interface javax.portlet.BaseURL

setSecure

public void setSecure(boolean secure)
               throws javax.portlet.PortletSecurityException
Specified by:
setSecure in interface javax.portlet.BaseURL
Throws:
javax.portlet.PortletSecurityException

isSecure

public boolean isSecure()

write

public void write(Writer out)
           throws IOException
Specified by:
write in interface javax.portlet.BaseURL
Throws:
IOException

write

public void write(Writer out,
                  boolean escapeXML)
           throws IOException
Specified by:
write in interface javax.portlet.BaseURL
Throws:
IOException

addProperty

public void addProperty(String key,
                        String value)
Specified by:
addProperty in interface javax.portlet.BaseURL

setProperty

public void setProperty(String key,
                        String value)
Specified by:
setProperty in interface javax.portlet.BaseURL

getProperties

public Map<String,String[]> getProperties()

encodeParameter

protected String encodeParameter(String name,
                                 String value)

encodeParameter

protected String encodeParameter(String name,
                                 String[] values)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockCacheControl

org.springframework.mock.web.portlet
Class MockCacheControl

java.lang.Object
    extended by  org.springframework.mock.web.portlet.MockCacheControl
All Implemented Interfaces:
javax.portlet.CacheControl
public class MockCacheControl
extends Object
implements javax.portlet.CacheControl

Mock implementation of the CacheControl interface.

Since:
3.0
Author:
Juergen Hoeller

Constructor Summary
MockCacheControl()
Method Summary
String | getETag()
int | getExpirationTime()
boolean | isPublicScope()
void | setETag(String token)
void | setExpirationTime(int time)
void | setPublicScope(boolean publicScope)
void | setUseCachedContent(boolean useCachedContent)
boolean | useCachedContent()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MockCacheControl

public MockCacheControl()
Method Detail

getExpirationTime

public int getExpirationTime()
Specified by:
getExpirationTime in interface javax.portlet.CacheControl

setExpirationTime

public void setExpirationTime(int time)
Specified by:
setExpirationTime in interface javax.portlet.CacheControl

isPublicScope

public boolean isPublicScope()
Specified by:
isPublicScope in interface javax.portlet.CacheControl

setPublicScope

public void setPublicScope(boolean publicScope)
Specified by:
setPublicScope in interface javax.portlet.CacheControl

getETag

public String getETag()
Specified by:
getETag in interface javax.portlet.CacheControl

setETag

public void setETag(String token)
Specified by:
setETag in interface javax.portlet.CacheControl

useCachedContent

public boolean useCachedContent()
Specified by:
useCachedContent in interface javax.portlet.CacheControl

setUseCachedContent

public void setUseCachedContent(boolean useCachedContent)
Specified by:
setUseCachedContent in interface javax.portlet.CacheControl
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockClientDataRequest

org.springframework.mock.web.portlet
Class MockClientDataRequest

java.lang.Object
    extended by  org.springframework.mock.web.portlet.MockPortletRequest
        extended by  org.springframework.mock.web.portlet.MockClientDataRequest
All Implemented Interfaces:
javax.portlet.ClientDataRequest, javax.portlet.PortletRequest
Direct Known Subclasses:
MockActionRequest, MockResourceRequest
public class MockClientDataRequest
extends MockPortletRequest
implements javax.portlet.ClientDataRequest

Mock implementation of the ClientDataRequest interface.

Since:
3.0
Author:
Juergen Hoeller

Nested Class Summary
Nested classes/interfaces inherited from interface javax.portlet.PortletRequest
javax.portlet.PortletRequest.P3PUserInfos
Field Summary
Fields inherited from interface javax.portlet.PortletRequest
ACTION_PHASE, ACTION_SCOPE_ID, BASIC_AUTH, CCPP_PROFILE, CLIENT_CERT_AUTH, DIGEST_AUTH, EVENT_PHASE, FORM_AUTH, LIFECYCLE_PHASE, RENDER_HEADERS, RENDER_MARKUP, RENDER_PART, RENDER_PHASE, RESOURCE_PHASE, USER_INFO
Constructor Summary
MockClientDataRequest()
Create a new MockClientDataRequest with a default MockPortalContext and a default MockPortletContext.
MockClientDataRequest(javax.portlet.PortalContext portalContext, javax.portlet.PortletContext portletContext)
Create a new MockClientDataRequest.
MockClientDataRequest(javax.portlet.PortletContext portletContext)
Create a new MockClientDataRequest with a default MockPortalContext.
Method Summary
String | getCharacterEncoding()
int | getContentLength()
String | getContentType()
String | getMethod()
InputStream | getPortletInputStream()
BufferedReader | getReader()
void | setCharacterEncoding(String characterEncoding)
void | setContent(byte[] content)
void | setContentType(String contentType)
void | setMethod(String method)
Methods inherited from class org.springframework.mock.web.portlet.MockPortletRequest
addLocale, addParameter, addParameter, addPreferredLocale, addPreferredResponseContentType, addProperty, addResponseContentType, addUserRole, checkActive, close, getAttribute, getAttributeNames, getAuthType, getContextPath, getCookies, getLifecyclePhase, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getPortalContext, getPortletMode, getPortletSession, getPortletSession, getPreferences, getPrivateParameterMap, getProperties, getProperty, getPropertyNames, getPublicParameterMap, getRemoteUser, getRequestedSessionId, getResponseContentType, getResponseContentTypes, getScheme, getServerName, getServerPort, getUserPrincipal, getWindowID, getWindowState, isActive, isPortletModeAllowed, isRequestedSessionIdValid, isSecure, isUserInRole, isWindowStateAllowed, registerPublicParameter, removeAttribute, setAttribute, setAuthType, setContextPath, setCookies, setParameter, setParameter, setParameters, setPortletMode, setPreferences, setProperty, setRemoteUser, setRequestedSessionIdValid, setScheme, setSecure, setServerName, setServerPort, setSession, setUserPrincipal, setWindowID, setWindowState
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.portlet.PortletRequest
getAttribute, getAttributeNames, getAuthType, getContextPath, getCookies, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getPortalContext, getPortletMode, getPortletSession, getPortletSession, getPreferences, getPrivateParameterMap, getProperties, getProperty, getPropertyNames, getPublicParameterMap, getRemoteUser, getRequestedSessionId, getResponseContentType, getResponseContentTypes, getScheme, getServerName, getServerPort, getUserPrincipal, getWindowID, getWindowState, isPortletModeAllowed, isRequestedSessionIdValid, isSecure, isUserInRole, isWindowStateAllowed, removeAttribute, setAttribute

Constructor Detail

MockClientDataRequest

public MockClientDataRequest()
Create a new MockClientDataRequest with a default MockPortalContext and a default MockPortletContext.

See Also:
MockPortalContext, MockPortletContext

MockClientDataRequest

public MockClientDataRequest(javax.portlet.PortletContext portletContext)
Create a new MockClientDataRequest with a default MockPortalContext.

Parameters:
portletContext - the PortletContext that the request runs in

MockClientDataRequest

public MockClientDataRequest(javax.portlet.PortalContext portalContext,
                             javax.portlet.PortletContext portletContext)
Create a new MockClientDataRequest.

Parameters:
portalContext - the PortalContext that the request runs in
portletContext - the PortletContext that the request runs in
Method Detail

setContent

public void setContent(byte[] content)

getPortletInputStream

public InputStream getPortletInputStream()
                                  throws IOException
Specified by:
getPortletInputStream in interface javax.portlet.ClientDataRequest
Throws:
IOException

setCharacterEncoding

public void setCharacterEncoding(String characterEncoding)
Specified by:
setCharacterEncoding in interface javax.portlet.ClientDataRequest

getReader

public BufferedReader getReader()
                         throws UnsupportedEncodingException
Specified by:
getReader in interface javax.portlet.ClientDataRequest
Throws:
UnsupportedEncodingException

getCharacterEncoding

public String getCharacterEncoding()
Specified by:
getCharacterEncoding in interface javax.portlet.ClientDataRequest

setContentType

public void setContentType(String contentType)

getContentType

public String getContentType()
Specified by:
getContentType in interface javax.portlet.ClientDataRequest

getContentLength

public int getContentLength()
Specified by:
getContentLength in interface javax.portlet.ClientDataRequest

setMethod

public void setMethod(String method)

getMethod

public String getMethod()
Specified by:
getMethod in interface javax.portlet.ClientDataRequest
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockEvent

org.springframework.mock.web.portlet
Class MockEvent

java.lang.Object
    extended by  org.springframework.mock.web.portlet.MockEvent
All Implemented Interfaces:
javax.portlet.Event
public class MockEvent
extends Object
implements javax.portlet.Event

Mock implementation of the Event interface.

Since:
3.0
Author:
Juergen Hoeller
See Also:
MockEventRequest

Constructor Summary
MockEvent(QName name)
Create a new MockEvent with the given name.
MockEvent(QName name, Serializable value)
Create a new MockEvent with the given name and value.
MockEvent(String name)
Create a new MockEvent with the given name.
MockEvent(String name, Serializable value)
Create a new MockEvent with the given name and value.
Method Summary
String | getName()
QName | getQName()
Serializable | getValue()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MockEvent

public MockEvent(QName name)
Create a new MockEvent with the given name.

Parameters:
name - the name of the event

MockEvent

public MockEvent(QName name,
                 Serializable value)
Create a new MockEvent with the given name and value.

Parameters:
name - the name of the event
value - the associated payload of the event

MockEvent

public MockEvent(String name)
Create a new MockEvent with the given name.

Parameters:
name - the name of the event

MockEvent

public MockEvent(String name,
                 Serializable value)
Create a new MockEvent with the given name and value.

Parameters:
name - the name of the event
value - the associated payload of the event
Method Detail

getQName

public QName getQName()
Specified by:
getQName in interface javax.portlet.Event

getName

public String getName()
Specified by:
getName in interface javax.portlet.Event

getValue

public Serializable getValue()
Specified by:
getValue in interface javax.portlet.Event
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockEventRequest

org.springframework.mock.web.portlet
Class MockEventRequest

java.lang.Object
    extended by  org.springframework.mock.web.portlet.MockPortletRequest
        extended by  org.springframework.mock.web.portlet.MockEventRequest
All Implemented Interfaces:
javax.portlet.EventRequest, javax.portlet.PortletRequest
public class MockEventRequest
extends MockPortletRequest
implements javax.portlet.EventRequest

Mock implementation of the EventRequest interface.

Since:
3.0
Author:
Juergen Hoeller

Nested Class Summary
Nested classes/interfaces inherited from interface javax.portlet.PortletRequest
javax.portlet.PortletRequest.P3PUserInfos
Field Summary
Fields inherited from interface javax.portlet.PortletRequest
ACTION_PHASE, ACTION_SCOPE_ID, BASIC_AUTH, CCPP_PROFILE, CLIENT_CERT_AUTH, DIGEST_AUTH, EVENT_PHASE, FORM_AUTH, LIFECYCLE_PHASE, RENDER_HEADERS, RENDER_MARKUP, RENDER_PART, RENDER_PHASE, RESOURCE_PHASE, USER_INFO
Constructor Summary
MockEventRequest(javax.portlet.Event event)
Create a new MockEventRequest with a default MockPortalContext and a default MockPortletContext.
MockEventRequest(javax.portlet.Event event, javax.portlet.PortalContext portalContext, javax.portlet.PortletContext portletContext)
Create a new MockEventRequest.
MockEventRequest(javax.portlet.Event event, javax.portlet.PortletContext portletContext)
Create a new MockEventRequest with a default MockPortalContext.
Method Summary
javax.portlet.Event | getEvent()
protected String | getLifecyclePhase() Return the Portlet 2.0 lifecycle id for the current phase.
String | getMethod()
void | setMethod(String method)
Methods inherited from class org.springframework.mock.web.portlet.MockPortletRequest
addLocale, addParameter, addParameter, addPreferredLocale, addPreferredResponseContentType, addProperty, addResponseContentType, addUserRole, checkActive, close, getAttribute, getAttributeNames, getAuthType, getContextPath, getCookies, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getPortalContext, getPortletMode, getPortletSession, getPortletSession, getPreferences, getPrivateParameterMap, getProperties, getProperty, getPropertyNames, getPublicParameterMap, getRemoteUser, getRequestedSessionId, getResponseContentType, getResponseContentTypes, getScheme, getServerName, getServerPort, getUserPrincipal, getWindowID, getWindowState, isActive, isPortletModeAllowed, isRequestedSessionIdValid, isSecure, isUserInRole, isWindowStateAllowed, registerPublicParameter, removeAttribute, setAttribute, setAuthType, setContextPath, setCookies, setParameter, setParameter, setParameters, setPortletMode, setPreferences, setProperty, setRemoteUser, setRequestedSessionIdValid, setScheme, setSecure, setServerName, setServerPort, setSession, setUserPrincipal, setWindowID, setWindowState
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.portlet.PortletRequest
getAttribute, getAttributeNames, getAuthType, getContextPath, getCookies, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getPortalContext, getPortletMode, getPortletSession, getPortletSession, getPreferences, getPrivateParameterMap, getProperties, getProperty, getPropertyNames, getPublicParameterMap, getRemoteUser, getRequestedSessionId, getResponseContentType, getResponseContentTypes, getScheme, getServerName, getServerPort, getUserPrincipal, getWindowID, getWindowState, isPortletModeAllowed, isRequestedSessionIdValid, isSecure, isUserInRole, isWindowStateAllowed, removeAttribute, setAttribute

Constructor Detail

MockEventRequest

public MockEventRequest(javax.portlet.Event event)
Create a new MockEventRequest with a default MockPortalContext and a default MockPortletContext.

Parameters:
event - the event that this request wraps
See Also:
MockEvent

MockEventRequest

public MockEventRequest(javax.portlet.Event event,
                        javax.portlet.PortletContext portletContext)
Create a new MockEventRequest with a default MockPortalContext.

Parameters:
event - the event that this request wraps
portletContext - the PortletContext that the request runs in
See Also:
MockEvent

MockEventRequest

public MockEventRequest(javax.portlet.Event event,
                        javax.portlet.PortalContext portalContext,
                        javax.portlet.PortletContext portletContext)
Create a new MockEventRequest.

Parameters:
event - the event that this request wraps
portalContext - the PortletContext that the request runs in
portletContext - the PortletContext that the request runs in
Method Detail

getLifecyclePhase

protected String getLifecyclePhase()
Description copied from class: MockPortletRequest
Return the Portlet 2.0 lifecycle id for the current phase.

Overrides:
getLifecyclePhase in class MockPortletRequest

getEvent

public javax.portlet.Event getEvent()
Specified by:
getEvent in interface javax.portlet.EventRequest

setMethod

public void setMethod(String method)

getMethod

public String getMethod()
Specified by:
getMethod in interface javax.portlet.EventRequest
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockEventResponse

org.springframework.mock.web.portlet
Class MockEventResponse

java.lang.Object
    extended by  org.springframework.mock.web.portlet.MockPortletResponse
        extended by  org.springframework.mock.web.portlet.MockStateAwareResponse
            extended by  org.springframework.mock.web.portlet.MockEventResponse
All Implemented Interfaces:
javax.portlet.EventResponse, javax.portlet.PortletResponse, javax.portlet.StateAwareResponse
public class MockEventResponse
extends MockStateAwareResponse
implements javax.portlet.EventResponse

Mock implementation of the EventResponse interface.

Since:
3.0
Author:
Juergen Hoeller

Constructor Summary
MockEventResponse()
Method Summary
 void setRenderParameters(javax.portlet.EventRequest request)
Methods inherited from class org.springframework.mock.web.portlet.MockStateAwareResponse
getEvent, getEvent, getEventNames, getPortletMode, getRenderParameter, getRenderParameterMap, getRenderParameterNames, getRenderParameterValues, getWindowState, removePublicRenderParameter, setEvent, setEvent, setPortletMode, setRenderParameter, setRenderParameter, setRenderParameters, setWindowState
Methods inherited from class org.springframework.mock.web.portlet.MockPortletResponse
addProperty, addProperty, addProperty, createElement, encodeURL, getCookie, getCookies, getNamespace, getPortalContext, getProperties, getProperty, getPropertyNames, getXmlProperties, getXmlProperty, getXmlPropertyNames, setNamespace, setProperty
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.portlet.StateAwareResponse
getPortletMode, getRenderParameterMap, getWindowState, removePublicRenderParameter, setEvent, setEvent, setPortletMode, setRenderParameter, setRenderParameter, setRenderParameters, setWindowState
Methods inherited from interface javax.portlet.PortletResponse
addProperty, addProperty, addProperty, createElement, encodeURL, getNamespace, setProperty

Constructor Detail

MockEventResponse

public MockEventResponse()
Method Detail

setRenderParameters

public void setRenderParameters(javax.portlet.EventRequest request)
Specified by:
setRenderParameters in interface javax.portlet.EventResponse
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockMimeResponse

org.springframework.mock.web.portlet
Class MockMimeResponse

java.lang.Object
    extended by  org.springframework.mock.web.portlet.MockPortletResponse
        extended by  org.springframework.mock.web.portlet.MockMimeResponse
All Implemented Interfaces:
javax.portlet.MimeResponse, javax.portlet.PortletResponse
Direct Known Subclasses:
MockRenderResponse, MockResourceResponse
public class MockMimeResponse
extends MockPortletResponse
implements javax.portlet.MimeResponse

Mock implementation of the MimeResponse interface.

Since:
3.0
Author:
Juergen Hoeller

Field Summary
Fields inherited from interface javax.portlet.MimeResponse
CACHE_SCOPE, ETAG, EXPIRATION_CACHE, MARKUP_HEAD_ELEMENT, NAMESPACED_RESPONSE, PRIVATE_SCOPE, PUBLIC_SCOPE, USE_CACHED_CONTENT
Constructor Summary
MockMimeResponse()
Create a new MockMimeResponse with a default MockPortalContext.
MockMimeResponse(javax.portlet.PortalContext portalContext)
Create a new MockMimeResponse.
MockMimeResponse(javax.portlet.PortalContext portalContext, javax.portlet.PortletRequest request)
Create a new MockMimeResponse.
Method Summary
javax.portlet.PortletURL | createActionURL()
javax.portlet.PortletURL | createRenderURL()
javax.portlet.ResourceURL | createResourceURL()
void | flushBuffer()
int | getBufferSize()
javax.portlet.CacheControl | getCacheControl()
String | getCharacterEncoding()
byte[] | getContentAsByteArray()
String | getContentAsString()
String | getContentType()
String | getForwardedUrl()
String | getIncludedUrl()
Locale | getLocale()
OutputStream | getPortletOutputStream()
PrintWriter | getWriter()
boolean | isCommitted()
void | reset()
void | resetBuffer()
void | setBufferSize(int bufferSize)
void | setCharacterEncoding(String characterEncoding)
void | setCommitted(boolean committed)
void | setContentType(String contentType)
void | setForwardedUrl(String forwardedUrl)
void | setIncludedUrl(String includedUrl)
void | setLocale(Locale locale)
Methods inherited from class org.springframework.mock.web.portlet.MockPortletResponse
addProperty, addProperty, addProperty, createElement, encodeURL, getCookie, getCookies, getNamespace, getPortalContext, getProperties, getProperty, getPropertyNames, getXmlProperties, getXmlProperty, getXmlPropertyNames, setNamespace, setProperty
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.portlet.PortletResponse
addProperty, addProperty, addProperty, createElement, encodeURL, getNamespace, setProperty

Constructor Detail

MockMimeResponse

public MockMimeResponse()
Create a new MockMimeResponse with a default MockPortalContext.

See Also:
MockPortalContext

MockMimeResponse

public MockMimeResponse(javax.portlet.PortalContext portalContext)
Create a new MockMimeResponse.

Parameters:
portalContext - the PortalContext defining the supported PortletModes and WindowStates

MockMimeResponse

public MockMimeResponse(javax.portlet.PortalContext portalContext,
                        javax.portlet.PortletRequest request)
Create a new MockMimeResponse.

Parameters:
portalContext - the PortalContext defining the supported PortletModes and WindowStates
request - the corresponding render/resource request that this response is being generated for
Method Detail

setContentType

public void setContentType(String contentType)
Specified by:
setContentType in interface javax.portlet.MimeResponse

getContentType

public String getContentType()
Specified by:
getContentType in interface javax.portlet.MimeResponse

setCharacterEncoding

public void setCharacterEncoding(String characterEncoding)

getCharacterEncoding

public String getCharacterEncoding()
Specified by:
getCharacterEncoding in interface javax.portlet.MimeResponse

getWriter

public PrintWriter getWriter()
                      throws UnsupportedEncodingException
Specified by:
getWriter in interface javax.portlet.MimeResponse
Throws:
UnsupportedEncodingException

getContentAsByteArray

public byte[] getContentAsByteArray()

getContentAsString

public String getContentAsString()
                          throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException

setLocale

public void setLocale(Locale locale)

getLocale

public Locale getLocale()
Specified by:
getLocale in interface javax.portlet.MimeResponse

setBufferSize

public void setBufferSize(int bufferSize)
Specified by:
setBufferSize in interface javax.portlet.MimeResponse

getBufferSize

public int getBufferSize()
Specified by:
getBufferSize in interface javax.portlet.MimeResponse

flushBuffer

public void flushBuffer()
Specified by:
flushBuffer in interface javax.portlet.MimeResponse

resetBuffer

public void resetBuffer()
Specified by:
resetBuffer in interface javax.portlet.MimeResponse

setCommitted

public void setCommitted(boolean committed)

isCommitted

public boolean isCommitted()
Specified by:
isCommitted in interface javax.portlet.MimeResponse

reset

public void reset()
Specified by:
reset in interface javax.portlet.MimeResponse

getPortletOutputStream

public OutputStream getPortletOutputStream()
                                    throws IOException
Specified by:
getPortletOutputStream in interface javax.portlet.MimeResponse
Throws:
IOException

createRenderURL

public javax.portlet.PortletURL createRenderURL()
Specified by:
createRenderURL in interface javax.portlet.MimeResponse

createActionURL

public javax.portlet.PortletURL createActionURL()
Specified by:
createActionURL in interface javax.portlet.MimeResponse

createResourceURL

public javax.portlet.ResourceURL createResourceURL()
Specified by:
createResourceURL in interface javax.portlet.MimeResponse

getCacheControl

public javax.portlet.CacheControl getCacheControl()
Specified by:
getCacheControl in interface javax.portlet.MimeResponse

setIncludedUrl

public void setIncludedUrl(String includedUrl)

getIncludedUrl

public String getIncludedUrl()

setForwardedUrl

public void setForwardedUrl(String forwardedUrl)

getForwardedUrl

public String getForwardedUrl()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockMultipartActionRequest

org.springframework.mock.web.portlet
Class MockMultipartActionRequest

java.lang.Object
    extended by  org.springframework.mock.web.portlet.MockPortletRequest
        extended by  org.springframework.mock.web.portlet.MockClientDataRequest
            extended by  org.springframework.mock.web.portlet.MockActionRequest
                extended by  org.springframework.mock.web.portlet.MockMultipartActionRequest
All Implemented Interfaces:
javax.portlet.ActionRequest, javax.portlet.ClientDataRequest, javax.portlet.PortletRequest, MultipartRequest, MultipartActionRequest
public class MockMultipartActionRequest
extends MockActionRequest
implements MultipartActionRequest

Mock implementation of the MultipartActionRequest interface.

Useful for testing application controllers that access multipart uploads. The MockMultipartFile can be used to populate these mock requests with files.

Since:
2.0
Author:
Juergen Hoeller, Arjen Poutsma
See Also:
MockMultipartFile

Nested Class Summary
Nested classes/interfaces inherited from interface javax.portlet.PortletRequest
javax.portlet.PortletRequest.P3PUserInfos
Field Summary
Fields inherited from interface javax.portlet.ActionRequest
ACTION_NAME
Fields inherited from interface javax.portlet.PortletRequest
ACTION_PHASE, ACTION_SCOPE_ID, BASIC_AUTH, CCPP_PROFILE, CLIENT_CERT_AUTH, DIGEST_AUTH, EVENT_PHASE, FORM_AUTH, LIFECYCLE_PHASE, RENDER_HEADERS, RENDER_MARKUP, RENDER_PART, RENDER_PHASE, RESOURCE_PHASE, USER_INFO
Constructor Summary
MockMultipartActionRequest()
Method Summary
void | addFile(MultipartFile file) Add a file to this request.
MultipartFile | getFile(String name) Return the contents plus description of an uploaded file in this request, or null if it does not exist.
Map<String,MultipartFile> | getFileMap() Return a Map of the multipart files contained in this request.
Iterator<String> | getFileNames() Return an Iterator of String objects containing the parameter names of the multipart files contained in this request.
List<MultipartFile> | getFiles(String name) Return the contents plus description of uploaded files in this request, or an empty list if it does not exist.
MultiValueMap<String,MultipartFile> | getMultiFileMap() Return a MultiValueMap of the multipart files contained in this request.
Methods inherited from class org.springframework.mock.web.portlet.MockActionRequest
getLifecyclePhase
Methods inherited from class org.springframework.mock.web.portlet.MockClientDataRequest
getCharacterEncoding, getContentLength, getContentType, getMethod, getPortletInputStream, getReader, setCharacterEncoding, setContent, setContentType, setMethod
Methods inherited from class org.springframework.mock.web.portlet.MockPortletRequest
addLocale, addParameter, addParameter, addPreferredLocale, addPreferredResponseContentType, addProperty, addResponseContentType, addUserRole, checkActive, close, getAttribute, getAttributeNames, getAuthType, getContextPath, getCookies, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getPortalContext, getPortletMode, getPortletSession, getPortletSession, getPreferences, getPrivateParameterMap, getProperties, getProperty, getPropertyNames, getPublicParameterMap, getRemoteUser, getRequestedSessionId, getResponseContentType, getResponseContentTypes, getScheme, getServerName, getServerPort, getUserPrincipal, getWindowID, getWindowState, isActive, isPortletModeAllowed, isRequestedSessionIdValid, isSecure, isUserInRole, isWindowStateAllowed, registerPublicParameter, removeAttribute, setAttribute, setAuthType, setContextPath, setCookies, setParameter, setParameter, setParameters, setPortletMode, setPreferences, setProperty, setRemoteUser, setRequestedSessionIdValid, setScheme, setSecure, setServerName, setServerPort, setSession, setUserPrincipal, setWindowID, setWindowState
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.portlet.ClientDataRequest
getCharacterEncoding, getContentLength, getContentType, getMethod, getPortletInputStream, getReader, setCharacterEncoding
Methods inherited from interface javax.portlet.PortletRequest
getAttribute, getAttributeNames, getAuthType, getContextPath, getCookies, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getPortalContext, getPortletMode, getPortletSession, getPortletSession, getPreferences, getPrivateParameterMap, getProperties, getProperty, getPropertyNames, getPublicParameterMap, getRemoteUser, getRequestedSessionId, getResponseContentType, getResponseContentTypes, getScheme, getServerName, getServerPort, getUserPrincipal, getWindowID, getWindowState, isPortletModeAllowed, isRequestedSessionIdValid, isSecure, isUserInRole, isWindowStateAllowed, removeAttribute, setAttribute

Constructor Detail

MockMultipartActionRequest

public MockMultipartActionRequest()
Method Detail

addFile

public void addFile(MultipartFile file)
Add a file to this request. The parameter name from the multipart form is taken from the MultipartFile.getName().

Parameters:
file - multipart file to be added

getFileNames

public Iterator<String> getFileNames()
Description copied from interface: MultipartRequest
Return an Iterator of String objects containing the parameter names of the multipart files contained in this request. These are the field names of the form (like with normal parameters), not the original file names.

Specified by:
getFileNames in interface MultipartRequest
Returns:
the names of the files

getFile

public MultipartFile getFile(String name)
Description copied from interface: MultipartRequest
Return the contents plus description of an uploaded file in this request, or null if it does not exist.

Specified by:
getFile in interface MultipartRequest
Parameters:
name - a String specifying the parameter name of the multipart file
Returns:
the uploaded content in the form of a MultipartFile object

getFiles

public List<MultipartFile> getFiles(String name)
Description copied from interface: MultipartRequest
Return the contents plus description of uploaded files in this request, or an empty list if it does not exist.

Specified by:
getFiles in interface MultipartRequest
Parameters:
name - a String specifying the parameter name of the multipart file
Returns:
the uploaded content in the form of a MultipartFile list

getFileMap

public Map<String,MultipartFile> getFileMap()
Description copied from interface: MultipartRequest
Return a Map of the multipart files contained in this request.

Specified by:
getFileMap in interface MultipartRequest
Returns:
a map containing the parameter names as keys, and the MultipartFile objects as values
See Also:
MultipartFile

getMultiFileMap

public MultiValueMap<String,MultipartFile> getMultiFileMap()
Description copied from interface: MultipartRequest
Return a MultiValueMap of the multipart files contained in this request.

Specified by:
getMultiFileMap in interface MultipartRequest
Returns:
a map containing the parameter names as keys, and a list of MultipartFile objects as values
See Also:
MultipartFile
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockPortalContext

org.springframework.mock.web.portlet
Class MockPortalContext

java.lang.Object
    extended by  org.springframework.mock.web.portlet.MockPortalContext
All Implemented Interfaces:
javax.portlet.PortalContext
public class MockPortalContext
extends Object
implements javax.portlet.PortalContext

Mock implementation of the PortalContext interface.

Since:
2.0
Author:
John A. Lewis, Juergen Hoeller

Field Summary
Fields inherited from interface javax.portlet.PortalContext
MARKUP_HEAD_ELEMENT_SUPPORT
Constructor Summary
MockPortalContext()
Create a new MockPortalContext with default PortletModes (VIEW, EDIT, HELP) and default WindowStates (NORMAL, MAXIMIZED, MINIMIZED).
MockPortalContext(List<javax.portlet.PortletMode> supportedPortletModes, List<javax.portlet.WindowState> supportedWindowStates)
Create a new MockPortalContext with the given PortletModes and WindowStates.
Method Summary
String | getPortalInfo()
String | getProperty(String name)
Enumeration<String> | getPropertyNames()
Enumeration<javax.portlet.PortletMode> | getSupportedPortletModes()
Enumeration<javax.portlet.WindowState> | getSupportedWindowStates()
void | setProperty(String name, String value)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MockPortalContext

public MockPortalContext()
Create a new MockPortalContext with default PortletModes (VIEW, EDIT, HELP) and default WindowStates (NORMAL, MAXIMIZED, MINIMIZED).

See Also:
PortletMode, WindowState

MockPortalContext

public MockPortalContext(List<javax.portlet.PortletMode> supportedPortletModes,
                         List<javax.portlet.WindowState> supportedWindowStates)
Create a new MockPortalContext with the given PortletModes and WindowStates.

Parameters:
supportedPortletModes - the List of supported PortletMode instances
supportedWindowStates - the List of supported WindowState instances
See Also:
PortletMode, WindowState
Method Detail

getPortalInfo

public String getPortalInfo()
Specified by:
getPortalInfo in interface javax.portlet.PortalContext

setProperty

public void setProperty(String name,
                        String value)

getProperty

public String getProperty(String name)
Specified by:
getProperty in interface javax.portlet.PortalContext

getPropertyNames

public Enumeration<String> getPropertyNames()
Specified by:
getPropertyNames in interface javax.portlet.PortalContext

getSupportedPortletModes

public Enumeration<javax.portlet.PortletMode> getSupportedPortletModes()
Specified by:
getSupportedPortletModes in interface javax.portlet.PortalContext

getSupportedWindowStates

public Enumeration<javax.portlet.WindowState> getSupportedWindowStates()
Specified by:
getSupportedWindowStates in interface javax.portlet.PortalContext
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockPortletConfig

org.springframework.mock.web.portlet
Class MockPortletConfig

java.lang.Object
    extended by  org.springframework.mock.web.portlet.MockPortletConfig
All Implemented Interfaces:
javax.portlet.PortletConfig
public class MockPortletConfig
extends Object
implements javax.portlet.PortletConfig

Mock implementation of the PortletConfig interface.

Since:
2.0
Author:
John A. Lewis, Juergen Hoeller

Constructor Summary
MockPortletConfig()
Create a new MockPortletConfig with a default MockPortletContext.
MockPortletConfig(javax.portlet.PortletContext portletContext)
Create a new MockPortletConfig.
MockPortletConfig(javax.portlet.PortletContext portletContext, String portletName)
Create a new MockPortletConfig.
MockPortletConfig(String portletName)
Create a new MockPortletConfig with a default MockPortletContext.
Method Summary
void | addContainerRuntimeOption(String key, String value)
void | addContainerRuntimeOption(String key, String[] values)
void | addInitParameter(String name, String value)
void | addProcessingEventQName(QName name)
void | addPublicRenderParameterName(String name)
void | addPublishingEventQName(QName name)
void | addSupportedLocale(Locale locale)
Map<String,String[]> | getContainerRuntimeOptions()
String | getDefaultNamespace()
String | getInitParameter(String name)
Enumeration<String> | getInitParameterNames()
javax.portlet.PortletContext | getPortletContext()
String | getPortletName()
Enumeration<QName> | getProcessingEventQNames()
Enumeration<String> | getPublicRenderParameterNames()
Enumeration<QName> | getPublishingEventQNames()
ResourceBundle | getResourceBundle(Locale locale)
Enumeration<Locale> | getSupportedLocales()
void | setDefaultNamespace(String defaultNamespace)
void | setResourceBundle(Locale locale, ResourceBundle resourceBundle)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MockPortletConfig

public MockPortletConfig()
Create a new MockPortletConfig with a default MockPortletContext.

MockPortletConfig

public MockPortletConfig(String portletName)
Create a new MockPortletConfig with a default MockPortletContext.

Parameters:
portletName - the name of the portlet

MockPortletConfig

public MockPortletConfig(javax.portlet.PortletContext portletContext)
Create a new MockPortletConfig.

Parameters:
portletContext - the PortletContext that the portlet runs in

MockPortletConfig

public MockPortletConfig(javax.portlet.PortletContext portletContext,
                         String portletName)
Create a new MockPortletConfig.

Parameters:
portletContext - the PortletContext that the portlet runs in
portletName - the name of the portlet
Method Detail

getPortletName

public String getPortletName()
Specified by:
getPortletName in interface javax.portlet.PortletConfig

getPortletContext

public javax.portlet.PortletContext getPortletContext()
Specified by:
getPortletContext in interface javax.portlet.PortletConfig

setResourceBundle

public void setResourceBundle(Locale locale,
                              ResourceBundle resourceBundle)

getResourceBundle

public ResourceBundle getResourceBundle(Locale locale)
Specified by:
getResourceBundle in interface javax.portlet.PortletConfig

addInitParameter

public void addInitParameter(String name,
                             String value)

getInitParameter

public String getInitParameter(String name)
Specified by:
getInitParameter in interface javax.portlet.PortletConfig

getInitParameterNames

public Enumeration<String> getInitParameterNames()
Specified by:
getInitParameterNames in interface javax.portlet.PortletConfig

addPublicRenderParameterName

public void addPublicRenderParameterName(String name)

getPublicRenderParameterNames

public Enumeration<String> getPublicRenderParameterNames()
Specified by:
getPublicRenderParameterNames in interface javax.portlet.PortletConfig

setDefaultNamespace

public void setDefaultNamespace(String defaultNamespace)

getDefaultNamespace

public String getDefaultNamespace()
Specified by:
getDefaultNamespace in interface javax.portlet.PortletConfig

addPublishingEventQName

public void addPublishingEventQName(QName name)

getPublishingEventQNames

public Enumeration<QName> getPublishingEventQNames()
Specified by:
getPublishingEventQNames in interface javax.portlet.PortletConfig

addProcessingEventQName

public void addProcessingEventQName(QName name)

getProcessingEventQNames

public Enumeration<QName> getProcessingEventQNames()
Specified by:
getProcessingEventQNames in interface javax.portlet.PortletConfig

addSupportedLocale

public void addSupportedLocale(Locale locale)

getSupportedLocales

public Enumeration<Locale> getSupportedLocales()
Specified by:
getSupportedLocales in interface javax.portlet.PortletConfig

addContainerRuntimeOption

public void addContainerRuntimeOption(String key,
                                      String value)

addContainerRuntimeOption

public void addContainerRuntimeOption(String key,
                                      String[] values)

getContainerRuntimeOptions

public Map<String,String[]> getContainerRuntimeOptions()
Specified by:
getContainerRuntimeOptions in interface javax.portlet.PortletConfig
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockPortletContext

org.springframework.mock.web.portlet
Class MockPortletContext

java.lang.Object
    extended by  org.springframework.mock.web.portlet.MockPortletContext
All Implemented Interfaces:
javax.portlet.PortletContext
public class MockPortletContext
extends Object
implements javax.portlet.PortletContext

Mock implementation of the PortletContext interface.

Since:
2.0
Author:
John A. Lewis, Juergen Hoeller

Constructor Summary
MockPortletContext()
Create a new MockPortletContext with no base path and a DefaultResourceLoader (i.e.
MockPortletContext(ResourceLoader resourceLoader)
Create a new MockPortletContext, using the specified ResourceLoader and no base path.
MockPortletContext(String resourceBasePath)
Create a new MockPortletContext using a DefaultResourceLoader.
MockPortletContext(String resourceBasePath, ResourceLoader resourceLoader)
Create a new MockPortletContext.
Method Summary
void | addContainerRuntimeOption(String key)
void | addInitParameter(String name, String value)
Object | getAttribute(String name)
Enumeration<String> | getAttributeNames()
Enumeration<String> | getContainerRuntimeOptions()
String | getInitParameter(String name)
Enumeration<String> | getInitParameterNames()
int | getMajorVersion()
String | getMimeType(String filePath)
int | getMinorVersion()
javax.portlet.PortletRequestDispatcher | getNamedDispatcher(String path)
String | getPortletContextName()
String | getRealPath(String path)
javax.portlet.PortletRequestDispatcher | getRequestDispatcher(String path)
URL | getResource(String path)
InputStream | getResourceAsStream(String path)
protected String | getResourceLocation(String path) Build a full resource location for the given path, prepending the resource base path of this MockPortletContext.
Set<String> | getResourcePaths(String path)
String | getServerInfo()
void | log(String message)
void | log(String message, Throwable t)
void | removeAttribute(String name)
void | setAttribute(String name, Object value)
void | setPortletContextName(String portletContextName)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MockPortletContext

public MockPortletContext()
Create a new MockPortletContext with no base path and a DefaultResourceLoader (i.e. the classpath root as WAR root).

See Also:
DefaultResourceLoader

MockPortletContext

public MockPortletContext(String resourceBasePath)
Create a new MockPortletContext using a DefaultResourceLoader.

Parameters:
resourceBasePath - the WAR root directory (should not end with a slash)
See Also:
DefaultResourceLoader

MockPortletContext

public MockPortletContext(ResourceLoader resourceLoader)
Create a new MockPortletContext, using the specified ResourceLoader and no base path.

Parameters:
resourceLoader - the ResourceLoader to use (or null for the default)

MockPortletContext

public MockPortletContext(String resourceBasePath,
                          ResourceLoader resourceLoader)
Create a new MockPortletContext.

Parameters:
resourceBasePath - the WAR root directory (should not end with a slash)
resourceLoader - the ResourceLoader to use (or null for the default)
Method Detail

getResourceLocation

protected String getResourceLocation(String path)
Build a full resource location for the given path, prepending the resource base path of this MockPortletContext.

Parameters:
path - the path as specified
Returns:
the full resource path

getServerInfo

public String getServerInfo()
Specified by:
getServerInfo in interface javax.portlet.PortletContext

getRequestDispatcher

public javax.portlet.PortletRequestDispatcher getRequestDispatcher(String path)
Specified by:
getRequestDispatcher in interface javax.portlet.PortletContext

getNamedDispatcher

public javax.portlet.PortletRequestDispatcher getNamedDispatcher(String path)
Specified by:
getNamedDispatcher in interface javax.portlet.PortletContext

getResourceAsStream

public InputStream getResourceAsStream(String path)
Specified by:
getResourceAsStream in interface javax.portlet.PortletContext

getMajorVersion

public int getMajorVersion()
Specified by:
getMajorVersion in interface javax.portlet.PortletContext

getMinorVersion

public int getMinorVersion()
Specified by:
getMinorVersion in interface javax.portlet.PortletContext

getMimeType

public String getMimeType(String filePath)
Specified by:
getMimeType in interface javax.portlet.PortletContext

getRealPath

public String getRealPath(String path)
Specified by:
getRealPath in interface javax.portlet.PortletContext

getResourcePaths

public Set<String> getResourcePaths(String path)
Specified by:
getResourcePaths in interface javax.portlet.PortletContext

getResource

public URL getResource(String path)
                throws MalformedURLException
Specified by:
getResource in interface javax.portlet.PortletContext
Throws:
MalformedURLException

getAttribute

public Object getAttribute(String name)
Specified by:
getAttribute in interface javax.portlet.PortletContext

getAttributeNames

public Enumeration<String> getAttributeNames()
Specified by:
getAttributeNames in interface javax.portlet.PortletContext

setAttribute

public void setAttribute(String name,
                         Object value)
Specified by:
setAttribute in interface javax.portlet.PortletContext

removeAttribute

public void removeAttribute(String name)
Specified by:
removeAttribute in interface javax.portlet.PortletContext

addInitParameter

public void addInitParameter(String name,
                             String value)

getInitParameter

public String getInitParameter(String name)
Specified by:
getInitParameter in interface javax.portlet.PortletContext

getInitParameterNames

public Enumeration<String> getInitParameterNames()
Specified by:
getInitParameterNames in interface javax.portlet.PortletContext

log

public void log(String message)
Specified by:
log in interface javax.portlet.PortletContext

log

public void log(String message,
                Throwable t)
Specified by:
log in interface javax.portlet.PortletContext

setPortletContextName

public void setPortletContextName(String portletContextName)

getPortletContextName

public String getPortletContextName()
Specified by:
getPortletContextName in interface javax.portlet.PortletContext

addContainerRuntimeOption

public void addContainerRuntimeOption(String key)

getContainerRuntimeOptions

public Enumeration<String> getContainerRuntimeOptions()
Specified by:
getContainerRuntimeOptions in interface javax.portlet.PortletContext
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockPortletPreferences

org.springframework.mock.web.portlet
Class MockPortletPreferences

java.lang.Object
    extended by  org.springframework.mock.web.portlet.MockPortletPreferences
All Implemented Interfaces:
javax.portlet.PortletPreferences
public class MockPortletPreferences
extends Object
implements javax.portlet.PortletPreferences

Mock implementation of the PortletPreferences interface.

Since:
2.0
Author:
John A. Lewis, Juergen Hoeller

Constructor Summary
MockPortletPreferences()
Method Summary
Map<String,String[]> | getMap()
Enumeration<String> | getNames()
String | getValue(String key, String def)
String[] | getValues(String key, String[] def)
boolean | isReadOnly(String key)
void | reset(String key)
void | setPreferencesValidator(javax.portlet.PreferencesValidator preferencesValidator)
void | setReadOnly(String key, boolean readOnly)
void | setValue(String key, String value)
void | setValues(String key, String[] values)
void | store()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MockPortletPreferences

public MockPortletPreferences()
Method Detail

setReadOnly

public void setReadOnly(String key,
                        boolean readOnly)

isReadOnly

public boolean isReadOnly(String key)
Specified by:
isReadOnly in interface javax.portlet.PortletPreferences

getValue

public String getValue(String key,
                       String def)
Specified by:
getValue in interface javax.portlet.PortletPreferences

getValues

public String[] getValues(String key,
                          String[] def)
Specified by:
getValues in interface javax.portlet.PortletPreferences

setValue

public void setValue(String key,
                     String value)
              throws javax.portlet.ReadOnlyException
Specified by:
setValue in interface javax.portlet.PortletPreferences
Throws:
javax.portlet.ReadOnlyException

setValues

public void setValues(String key,
                      String[] values)
               throws javax.portlet.ReadOnlyException
Specified by:
setValues in interface javax.portlet.PortletPreferences
Throws:
javax.portlet.ReadOnlyException

getNames

public Enumeration<String> getNames()
Specified by:
getNames in interface javax.portlet.PortletPreferences

getMap

public Map<String,String[]> getMap()
Specified by:
getMap in interface javax.portlet.PortletPreferences

reset

public void reset(String key)
           throws javax.portlet.ReadOnlyException
Specified by:
reset in interface javax.portlet.PortletPreferences
Throws:
javax.portlet.ReadOnlyException

setPreferencesValidator

public void setPreferencesValidator(javax.portlet.PreferencesValidator preferencesValidator)

store

public void store()
           throws IOException,
                  javax.portlet.ValidatorException
Specified by:
store in interface javax.portlet.PortletPreferences
Throws:
IOException
javax.portlet.ValidatorException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockPortletRequest

org.springframework.mock.web.portlet
Class MockPortletRequest

java.lang.Object
    extended by  org.springframework.mock.web.portlet.MockPortletRequest
All Implemented Interfaces:
javax.portlet.PortletRequest
Direct Known Subclasses:
MockClientDataRequest, MockEventRequest, MockRenderRequest
public class MockPortletRequest
extends Object
implements javax.portlet.PortletRequest

Mock implementation of the PortletRequest interface.

Since:
2.0
Author:
John A. Lewis, Juergen Hoeller

Nested Class Summary
Nested classes/interfaces inherited from interface javax.portlet.PortletRequest
javax.portlet.PortletRequest.P3PUserInfos
Field Summary
Fields inherited from interface javax.portlet.PortletRequest
ACTION_PHASE, ACTION_SCOPE_ID, BASIC_AUTH, CCPP_PROFILE, CLIENT_CERT_AUTH, DIGEST_AUTH, EVENT_PHASE, FORM_AUTH, LIFECYCLE_PHASE, RENDER_HEADERS, RENDER_MARKUP, RENDER_PART, RENDER_PHASE, RESOURCE_PHASE, USER_INFO
Constructor Summary
MockPortletRequest()
Create a new MockPortletRequest with a default MockPortalContext and a default MockPortletContext.
MockPortletRequest(javax.portlet.PortalContext portalContext, javax.portlet.PortletContext portletContext)
Create a new MockPortletRequest.
MockPortletRequest(javax.portlet.PortletContext portletContext)
Create a new MockPortletRequest with a default MockPortalContext.
Method Summary
void | addLocale(Locale locale)
void | addParameter(String name, String value)
void | addParameter(String name, String[] values)
void | addPreferredLocale(Locale locale)
void | addPreferredResponseContentType(String responseContentType)
void | addProperty(String key, String value) Add a single value for the specified property.
void | addResponseContentType(String responseContentType)
void | addUserRole(String role)
protected void | checkActive() Check whether this request is still active (that is, not completed yet), throwing an IllegalStateException if not active anymore.
void | close() Mark this request as completed.
Object | getAttribute(String name)
Enumeration<String> | getAttributeNames()
String | getAuthType()
String | getContextPath()
Cookie[] | getCookies()
protected String | getLifecyclePhase() Return the Portlet 2.0 lifecycle id for the current phase.
Locale | getLocale()
Enumeration<Locale> | getLocales()
String | getParameter(String name)
Map<String,String[]> | getParameterMap()
Enumeration<String> | getParameterNames()
String[] | getParameterValues(String name)
javax.portlet.PortalContext | getPortalContext()
javax.portlet.PortletMode | getPortletMode()
javax.portlet.PortletSession | getPortletSession()
javax.portlet.PortletSession | getPortletSession(boolean create)
javax.portlet.PortletPreferences | getPreferences()
Map<String,String[]> | getPrivateParameterMap()
Enumeration<String> | getProperties(String key)
String | getProperty(String key)
Enumeration<String> | getPropertyNames()
Map<String,String[]> | getPublicParameterMap()
String | getRemoteUser()
String | getRequestedSessionId()
String | getResponseContentType()
Enumeration<String> | getResponseContentTypes()
String | getScheme()
String | getServerName()
int | getServerPort()
Principal | getUserPrincipal()
String | getWindowID()
javax.portlet.WindowState | getWindowState()
boolean | isActive() Return whether this request is still active (that is, not completed yet).
boolean | isPortletModeAllowed(javax.portlet.PortletMode portletMode)
boolean | isRequestedSessionIdValid()
boolean | isSecure()
boolean | isUserInRole(String role)
boolean | isWindowStateAllowed(javax.portlet.WindowState windowState)
void | registerPublicParameter(String name)
void | removeAttribute(String name)
void | setAttribute(String name, Object value)
void | setAuthType(String authType)
void | setContextPath(String contextPath)
void | setCookies(Cookie... cookies)
void | setParameter(String key, String value)
void | setParameter(String key, String[] values)
void | setParameters(Map<String,String[]> parameters)
void | setPortletMode(javax.portlet.PortletMode portletMode)
void | setPreferences(javax.portlet.PortletPreferences preferences)
void | setProperty(String key, String value) Set a single value for the specified property.
void | setRemoteUser(String remoteUser)
void | setRequestedSessionIdValid(boolean requestedSessionIdValid)
void | setScheme(String scheme)
void | setSecure(boolean secure)
void | setServerName(String serverName)
void | setServerPort(int serverPort)
void | setSession(javax.portlet.PortletSession session)
void | setUserPrincipal(Principal userPrincipal)
void | setWindowID(String windowID)
void | setWindowState(javax.portlet.WindowState windowState)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MockPortletRequest

public MockPortletRequest()
Create a new MockPortletRequest with a default MockPortalContext and a default MockPortletContext.

See Also:
MockPortalContext, MockPortletContext

MockPortletRequest

public MockPortletRequest(javax.portlet.PortletContext portletContext)
Create a new MockPortletRequest with a default MockPortalContext.

Parameters:
portletContext - the PortletContext that the request runs in
See Also:
MockPortalContext

MockPortletRequest

public MockPortletRequest(javax.portlet.PortalContext portalContext,
                          javax.portlet.PortletContext portletContext)
Create a new MockPortletRequest.

Parameters:
portalContext - the PortalContext that the request runs in
portletContext - the PortletContext that the request runs in
Method Detail

getLifecyclePhase

protected String getLifecyclePhase()
Return the Portlet 2.0 lifecycle id for the current phase.

isActive

public boolean isActive()
Return whether this request is still active (that is, not completed yet).

close

public void close()
Mark this request as completed.

checkActive

protected void checkActive()
                    throws IllegalStateException
Check whether this request is still active (that is, not completed yet), throwing an IllegalStateException if not active anymore.

Throws:
IllegalStateException

isWindowStateAllowed

public boolean isWindowStateAllowed(javax.portlet.WindowState windowState)
Specified by:
isWindowStateAllowed in interface javax.portlet.PortletRequest

isPortletModeAllowed

public boolean isPortletModeAllowed(javax.portlet.PortletMode portletMode)
Specified by:
isPortletModeAllowed in interface javax.portlet.PortletRequest

setPortletMode

public void setPortletMode(javax.portlet.PortletMode portletMode)

getPortletMode

public javax.portlet.PortletMode getPortletMode()
Specified by:
getPortletMode in interface javax.portlet.PortletRequest

setWindowState

public void setWindowState(javax.portlet.WindowState windowState)

getWindowState

public javax.portlet.WindowState getWindowState()
Specified by:
getWindowState in interface javax.portlet.PortletRequest

setPreferences

public void setPreferences(javax.portlet.PortletPreferences preferences)

getPreferences

public javax.portlet.PortletPreferences getPreferences()
Specified by:
getPreferences in interface javax.portlet.PortletRequest

setSession

public void setSession(javax.portlet.PortletSession session)

getPortletSession

public javax.portlet.PortletSession getPortletSession()
Specified by:
getPortletSession in interface javax.portlet.PortletRequest

getPortletSession

public javax.portlet.PortletSession getPortletSession(boolean create)
Specified by:
getPortletSession in interface javax.portlet.PortletRequest

setProperty

public void setProperty(String key,
                        String value)
Set a single value for the specified property.

If there are already one or more values registered for the given property key, they will be replaced.

addProperty

public void addProperty(String key,
                        String value)
Add a single value for the specified property.

If there are already one or more values registered for the given property key, the given value will be added to the end of the list.

getProperty

public String getProperty(String key)
Specified by:
getProperty in interface javax.portlet.PortletRequest

getProperties

public Enumeration<String> getProperties(String key)
Specified by:
getProperties in interface javax.portlet.PortletRequest

getPropertyNames

public Enumeration<String> getPropertyNames()
Specified by:
getPropertyNames in interface javax.portlet.PortletRequest

getPortalContext

public javax.portlet.PortalContext getPortalContext()
Specified by:
getPortalContext in interface javax.portlet.PortletRequest

setAuthType

public void setAuthType(String authType)

getAuthType

public String getAuthType()
Specified by:
getAuthType in interface javax.portlet.PortletRequest

setContextPath

public void setContextPath(String contextPath)

getContextPath

public String getContextPath()
Specified by:
getContextPath in interface javax.portlet.PortletRequest

setRemoteUser

public void setRemoteUser(String remoteUser)

getRemoteUser

public String getRemoteUser()
Specified by:
getRemoteUser in interface javax.portlet.PortletRequest

setUserPrincipal

public void setUserPrincipal(Principal userPrincipal)

getUserPrincipal

public Principal getUserPrincipal()
Specified by:
getUserPrincipal in interface javax.portlet.PortletRequest

addUserRole

public void addUserRole(String role)

isUserInRole

public boolean isUserInRole(String role)
Specified by:
isUserInRole in interface javax.portlet.PortletRequest

getAttribute

public Object getAttribute(String name)
Specified by:
getAttribute in interface javax.portlet.PortletRequest

getAttributeNames

public Enumeration<String> getAttributeNames()
Specified by:
getAttributeNames in interface javax.portlet.PortletRequest

setParameters

public void setParameters(Map<String,String[]> parameters)

setParameter

public void setParameter(String key,
                         String value)

setParameter

public void setParameter(String key,
                         String[] values)

addParameter

public void addParameter(String name,
                         String value)

addParameter

public void addParameter(String name,
                         String[] values)

getParameter

public String getParameter(String name)
Specified by:
getParameter in interface javax.portlet.PortletRequest

getParameterNames

public Enumeration<String> getParameterNames()
Specified by:
getParameterNames in interface javax.portlet.PortletRequest

getParameterValues

public String[] getParameterValues(String name)
Specified by:
getParameterValues in interface javax.portlet.PortletRequest

getParameterMap

public Map<String,String[]> getParameterMap()
Specified by:
getParameterMap in interface javax.portlet.PortletRequest

setSecure

public void setSecure(boolean secure)

isSecure

public boolean isSecure()
Specified by:
isSecure in interface javax.portlet.PortletRequest

setAttribute

public void setAttribute(String name,
                         Object value)
Specified by:
setAttribute in interface javax.portlet.PortletRequest

removeAttribute

public void removeAttribute(String name)
Specified by:
removeAttribute in interface javax.portlet.PortletRequest

getRequestedSessionId

public String getRequestedSessionId()
Specified by:
getRequestedSessionId in interface javax.portlet.PortletRequest

setRequestedSessionIdValid

public void setRequestedSessionIdValid(boolean requestedSessionIdValid)

isRequestedSessionIdValid

public boolean isRequestedSessionIdValid()
Specified by:
isRequestedSessionIdValid in interface javax.portlet.PortletRequest

addResponseContentType

public void addResponseContentType(String responseContentType)

addPreferredResponseContentType

public void addPreferredResponseContentType(String responseContentType)

getResponseContentType

public String getResponseContentType()
Specified by:
getResponseContentType in interface javax.portlet.PortletRequest

getResponseContentTypes

public Enumeration<String> getResponseContentTypes()
Specified by:
getResponseContentTypes in interface javax.portlet.PortletRequest

addLocale

public void addLocale(Locale locale)

addPreferredLocale

public void addPreferredLocale(Locale locale)

getLocale

public Locale getLocale()
Specified by:
getLocale in interface javax.portlet.PortletRequest

getLocales

public Enumeration<Locale> getLocales()
Specified by:
getLocales in interface javax.portlet.PortletRequest

setScheme

public void setScheme(String scheme)

getScheme

public String getScheme()
Specified by:
getScheme in interface javax.portlet.PortletRequest

setServerName

public void setServerName(String serverName)

getServerName

public String getServerName()
Specified by:
getServerName in interface javax.portlet.PortletRequest

setServerPort

public void setServerPort(int serverPort)

getServerPort

public int getServerPort()
Specified by:
getServerPort in interface javax.portlet.PortletRequest

setWindowID

public void setWindowID(String windowID)

getWindowID

public String getWindowID()
Specified by:
getWindowID in interface javax.portlet.PortletRequest

setCookies

public void setCookies(Cookie... cookies)

getCookies

public Cookie[] getCookies()
Specified by:
getCookies in interface javax.portlet.PortletRequest

getPrivateParameterMap

public Map<String,String[]> getPrivateParameterMap()
Specified by:
getPrivateParameterMap in interface javax.portlet.PortletRequest

getPublicParameterMap

public Map<String,String[]> getPublicParameterMap()
Specified by:
getPublicParameterMap in interface javax.portlet.PortletRequest

registerPublicParameter

public void registerPublicParameter(String name)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockPortletRequestDispatcher

org.springframework.mock.web.portlet
Class MockPortletRequestDispatcher

java.lang.Object
    extended by  org.springframework.mock.web.portlet.MockPortletRequestDispatcher
All Implemented Interfaces:
javax.portlet.PortletRequestDispatcher
public class MockPortletRequestDispatcher
extends Object
implements javax.portlet.PortletRequestDispatcher

Mock implementation of the PortletRequestDispatcher interface.

Since:
2.0
Author:
John A. Lewis, Juergen Hoeller

Constructor Summary
MockPortletRequestDispatcher(String url)
Create a new MockPortletRequestDispatcher for the given URL.
Method Summary
void | forward(javax.portlet.PortletRequest request, javax.portlet.PortletResponse response)
void | include(javax.portlet.PortletRequest request, javax.portlet.PortletResponse response)
void | include(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MockPortletRequestDispatcher

public MockPortletRequestDispatcher(String url)
Create a new MockPortletRequestDispatcher for the given URL.

Parameters:
url - the URL to dispatch to.
Method Detail

include

public void include(javax.portlet.RenderRequest request,
                    javax.portlet.RenderResponse response)
             throws javax.portlet.PortletException,
                    IOException
Specified by:
include in interface javax.portlet.PortletRequestDispatcher
Throws:
javax.portlet.PortletException
IOException

include

public void include(javax.portlet.PortletRequest request,
                    javax.portlet.PortletResponse response)
             throws javax.portlet.PortletException,
                    IOException
Specified by:
include in interface javax.portlet.PortletRequestDispatcher
Throws:
javax.portlet.PortletException
IOException

forward

public void forward(javax.portlet.PortletRequest request,
                    javax.portlet.PortletResponse response)
             throws javax.portlet.PortletException,
                    IOException
Specified by:
forward in interface javax.portlet.PortletRequestDispatcher
Throws:
javax.portlet.PortletException
IOException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockPortletResponse

org.springframework.mock.web.portlet
Class MockPortletResponse

java.lang.Object
    extended by  org.springframework.mock.web.portlet.MockPortletResponse
All Implemented Interfaces:
javax.portlet.PortletResponse
Direct Known Subclasses:
MockMimeResponse, MockStateAwareResponse
public class MockPortletResponse
extends Object
implements javax.portlet.PortletResponse

Mock implementation of the PortletResponse interface.

Since:
2.0
Author:
John A. Lewis, Juergen Hoeller

Constructor Summary
MockPortletResponse()
Create a new MockPortletResponse with a default MockPortalContext.
MockPortletResponse(javax.portlet.PortalContext portalContext)
Create a new MockPortletResponse.
Method Summary
void | addProperty(Cookie cookie)
void | addProperty(String key, Element value)
void | addProperty(String key, String value)
Element | createElement(String tagName)
String | encodeURL(String path)
Cookie | getCookie(String name)
Cookie[] | getCookies()
String | getNamespace()
javax.portlet.PortalContext | getPortalContext() Return the PortalContext that this MockPortletResponse runs in, defining the supported PortletModes and WindowStates.
String[] | getProperties(String key)
String | getProperty(String key)
Set<String> | getPropertyNames()
Element[] | getXmlProperties(String key)
Element | getXmlProperty(String key)
Set<String> | getXmlPropertyNames()
void | setNamespace(String namespace)
void | setProperty(String key, String value)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MockPortletResponse

public MockPortletResponse()
Create a new MockPortletResponse with a default MockPortalContext.

See Also:
MockPortalContext

MockPortletResponse

public MockPortletResponse(javax.portlet.PortalContext portalContext)
Create a new MockPortletResponse.

Parameters:
portalContext - the PortalContext defining the supported PortletModes and WindowStates
Method Detail

getPortalContext

public javax.portlet.PortalContext getPortalContext()
Return the PortalContext that this MockPortletResponse runs in, defining the supported PortletModes and WindowStates.

addProperty

public void addProperty(String key,
                        String value)
Specified by:
addProperty in interface javax.portlet.PortletResponse

setProperty

public void setProperty(String key,
                        String value)
Specified by:
setProperty in interface javax.portlet.PortletResponse

getPropertyNames

public Set<String> getPropertyNames()

getProperty

public String getProperty(String key)

getProperties

public String[] getProperties(String key)

encodeURL

public String encodeURL(String path)
Specified by:
encodeURL in interface javax.portlet.PortletResponse

setNamespace

public void setNamespace(String namespace)

getNamespace

public String getNamespace()
Specified by:
getNamespace in interface javax.portlet.PortletResponse

addProperty

public void addProperty(Cookie cookie)
Specified by:
addProperty in interface javax.portlet.PortletResponse

getCookies

public Cookie[] getCookies()

getCookie

public Cookie getCookie(String name)

addProperty

public void addProperty(String key,
                        Element value)
Specified by:
addProperty in interface javax.portlet.PortletResponse

getXmlPropertyNames

public Set<String> getXmlPropertyNames()

getXmlProperty

public Element getXmlProperty(String key)

getXmlProperties

public Element[] getXmlProperties(String key)

createElement

public Element createElement(String tagName)
                      throws DOMException
Specified by:
createElement in interface javax.portlet.PortletResponse
Throws:
DOMException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockPortletSession

org.springframework.mock.web.portlet
Class MockPortletSession

java.lang.Object
    extended by  org.springframework.mock.web.portlet.MockPortletSession
All Implemented Interfaces:
javax.portlet.PortletSession
public class MockPortletSession
extends Object
implements javax.portlet.PortletSession

Mock implementation of the PortletSession interface.

Since:
2.0
Author:
John A. Lewis, Juergen Hoeller

Field Summary
Fields inherited from interface javax.portlet.PortletSession
APPLICATION_SCOPE, PORTLET_SCOPE
Constructor Summary
MockPortletSession()
Create a new MockPortletSession with a default MockPortletContext.
MockPortletSession(javax.portlet.PortletContext portletContext)
Create a new MockPortletSession.
Method Summary
void | access()
void | clearAttributes() Clear all of this session's attributes.
protected void | doClearAttributes(Map<String,Object> attributes)
Object | getAttribute(String name)
Object | getAttribute(String name, int scope)
Map<String,Object> | getAttributeMap()
Map<String,Object> | getAttributeMap(int scope)
Enumeration<String> | getAttributeNames()
Enumeration<String> | getAttributeNames(int scope)
long | getCreationTime()
String | getId()
long | getLastAccessedTime()
int | getMaxInactiveInterval()
javax.portlet.PortletContext | getPortletContext()
void | invalidate()
boolean | isInvalid()
boolean | isNew()
void | removeAttribute(String name)
void | removeAttribute(String name, int scope)
void | setAttribute(String name, Object value)
void | setAttribute(String name, Object value, int scope)
void | setMaxInactiveInterval(int interval)
void | setNew(boolean value)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MockPortletSession

public MockPortletSession()
Create a new MockPortletSession with a default MockPortletContext.

See Also:
MockPortletContext

MockPortletSession

public MockPortletSession(javax.portlet.PortletContext portletContext)
Create a new MockPortletSession.

Parameters:
portletContext - the PortletContext that the session runs in
Method Detail

getAttribute

public Object getAttribute(String name)
Specified by:
getAttribute in interface javax.portlet.PortletSession

getAttribute

public Object getAttribute(String name,
                           int scope)
Specified by:
getAttribute in interface javax.portlet.PortletSession

getAttributeNames

public Enumeration<String> getAttributeNames()
Specified by:
getAttributeNames in interface javax.portlet.PortletSession

getAttributeNames

public Enumeration<String> getAttributeNames(int scope)
Specified by:
getAttributeNames in interface javax.portlet.PortletSession

getCreationTime

public long getCreationTime()
Specified by:
getCreationTime in interface javax.portlet.PortletSession

getId

public String getId()
Specified by:
getId in interface javax.portlet.PortletSession

access

public void access()

getLastAccessedTime

public long getLastAccessedTime()
Specified by:
getLastAccessedTime in interface javax.portlet.PortletSession

getMaxInactiveInterval

public int getMaxInactiveInterval()
Specified by:
getMaxInactiveInterval in interface javax.portlet.PortletSession

clearAttributes

public void clearAttributes()
Clear all of this session's attributes.

doClearAttributes

protected void doClearAttributes(Map<String,Object> attributes)

invalidate

public void invalidate()
Specified by:
invalidate in interface javax.portlet.PortletSession

isInvalid

public boolean isInvalid()

setNew

public void setNew(boolean value)

isNew

public boolean isNew()
Specified by:
isNew in interface javax.portlet.PortletSession

removeAttribute

public void removeAttribute(String name)
Specified by:
removeAttribute in interface javax.portlet.PortletSession

removeAttribute

public void removeAttribute(String name,
                            int scope)
Specified by:
removeAttribute in interface javax.portlet.PortletSession

setAttribute

public void setAttribute(String name,
                         Object value)
Specified by:
setAttribute in interface javax.portlet.PortletSession

setAttribute

public void setAttribute(String name,
                         Object value,
                         int scope)
Specified by:
setAttribute in interface javax.portlet.PortletSession

setMaxInactiveInterval

public void setMaxInactiveInterval(int interval)
Specified by:
setMaxInactiveInterval in interface javax.portlet.PortletSession

getPortletContext

public javax.portlet.PortletContext getPortletContext()
Specified by:
getPortletContext in interface javax.portlet.PortletSession

getAttributeMap

public Map<String,Object> getAttributeMap()
Specified by:
getAttributeMap in interface javax.portlet.PortletSession

getAttributeMap

public Map<String,Object> getAttributeMap(int scope)
Specified by:
getAttributeMap in interface javax.portlet.PortletSession
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockPortletURL

org.springframework.mock.web.portlet
Class MockPortletURL

java.lang.Object
    extended by  org.springframework.mock.web.portlet.MockBaseURL
        extended by  org.springframework.mock.web.portlet.MockPortletURL
All Implemented Interfaces:
javax.portlet.BaseURL, javax.portlet.PortletURL
public class MockPortletURL
extends MockBaseURL
implements javax.portlet.PortletURL

Mock implementation of the PortletURL interface.

Since:
2.0
Author:
John A. Lewis, Juergen Hoeller

Field Summary
static String | URL_TYPE_ACTION
static String | URL_TYPE_RENDER
Fields inherited from class org.springframework.mock.web.portlet.MockBaseURL
parameters
Constructor Summary
MockPortletURL(javax.portlet.PortalContext portalContext, String urlType)
Create a new MockPortletURL for the given URL type.
Method Summary
javax.portlet.PortletMode | getPortletMode()
javax.portlet.WindowState | getWindowState()
void | removePublicRenderParameter(String name)
void | setPortletMode(javax.portlet.PortletMode portletMode)
void | setWindowState(javax.portlet.WindowState windowState)
String | toString()
Methods inherited from class org.springframework.mock.web.portlet.MockBaseURL
addProperty, encodeParameter, encodeParameter, getParameter, getParameterMap, getParameterNames, getParameterValues, getProperties, isSecure, setParameter, setParameter, setParameters, setProperty, setSecure, write, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface javax.portlet.BaseURL
addProperty, getParameterMap, setParameter, setParameter, setParameters, setProperty, setSecure, write, write

Field Detail

URL_TYPE_RENDER

public static final String URL_TYPE_RENDER
See Also:
Constant Field Values

URL_TYPE_ACTION

public static final String URL_TYPE_ACTION
See Also:
Constant Field Values
Constructor Detail

MockPortletURL

public MockPortletURL(javax.portlet.PortalContext portalContext,
                      String urlType)
Create a new MockPortletURL for the given URL type.

Parameters:
portalContext - the PortalContext defining the supported PortletModes and WindowStates
urlType - the URL type, for example "render" or "action"
See Also:
URL_TYPE_RENDER, URL_TYPE_ACTION
Method Detail

setWindowState

public void setWindowState(javax.portlet.WindowState windowState)
                    throws javax.portlet.WindowStateException
Specified by:
setWindowState in interface javax.portlet.PortletURL
Throws:
javax.portlet.WindowStateException

getWindowState

public javax.portlet.WindowState getWindowState()
Specified by:
getWindowState in interface javax.portlet.PortletURL

setPortletMode

public void setPortletMode(javax.portlet.PortletMode portletMode)
                    throws javax.portlet.PortletModeException
Specified by:
setPortletMode in interface javax.portlet.PortletURL
Throws:
javax.portlet.PortletModeException

getPortletMode

public javax.portlet.PortletMode getPortletMode()
Specified by:
getPortletMode in interface javax.portlet.PortletURL

removePublicRenderParameter

public void removePublicRenderParameter(String name)
Specified by:
removePublicRenderParameter in interface javax.portlet.PortletURL

toString

public String toString()
Specified by:
toString in interface javax.portlet.BaseURL
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockRenderRequest

org.springframework.mock.web.portlet
Class MockRenderRequest

java.lang.Object
    extended by  org.springframework.mock.web.portlet.MockPortletRequest
        extended by  org.springframework.mock.web.portlet.MockRenderRequest
All Implemented Interfaces:
javax.portlet.PortletRequest, javax.portlet.RenderRequest
public class MockRenderRequest
extends MockPortletRequest
implements javax.portlet.RenderRequest

Mock implementation of the RenderRequest interface.

Since:
2.0
Author:
John A. Lewis, Juergen Hoeller

Nested Class Summary
Nested classes/interfaces inherited from interface javax.portlet.PortletRequest
javax.portlet.PortletRequest.P3PUserInfos
Field Summary
Fields inherited from interface javax.portlet.RenderRequest
ETAG
Fields inherited from interface javax.portlet.PortletRequest
ACTION_PHASE, ACTION_SCOPE_ID, BASIC_AUTH, CCPP_PROFILE, CLIENT_CERT_AUTH, DIGEST_AUTH, EVENT_PHASE, FORM_AUTH, LIFECYCLE_PHASE, RENDER_HEADERS, RENDER_MARKUP, RENDER_PART, RENDER_PHASE, RESOURCE_PHASE, USER_INFO
Constructor Summary
MockRenderRequest()
Create a new MockRenderRequest with a default MockPortalContext and a default MockPortletContext.
MockRenderRequest(javax.portlet.PortalContext portalContext, javax.portlet.PortletContext portletContext)
Create a new MockRenderRequest.
MockRenderRequest(javax.portlet.PortletContext portletContext)
Create a new MockRenderRequest with a default MockPortalContext.
MockRenderRequest(javax.portlet.PortletMode portletMode)
Create a new MockRenderRequest with a default MockPortalContext and a default MockPortletContext.
MockRenderRequest(javax.portlet.PortletMode portletMode, javax.portlet.WindowState windowState)
Create a new MockRenderRequest with a default MockPortalContext and a default MockPortletContext.
Method Summary
String | getETag()
protected String | getLifecyclePhase() Return the Portlet 2.0 lifecycle id for the current phase.
Methods inherited from class org.springframework.mock.web.portlet.MockPortletRequest
addLocale, addParameter, addParameter, addPreferredLocale, addPreferredResponseContentType, addProperty, addResponseContentType, addUserRole, checkActive, close, getAttribute, getAttributeNames, getAuthType, getContextPath, getCookies, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getPortalContext, getPortletMode, getPortletSession, getPortletSession, getPreferences, getPrivateParameterMap, getProperties, getProperty, getPropertyNames, getPublicParameterMap, getRemoteUser, getRequestedSessionId, getResponseContentType, getResponseContentTypes, getScheme, getServerName, getServerPort, getUserPrincipal, getWindowID, getWindowState, isActive, isPortletModeAllowed, isRequestedSessionIdValid, isSecure, isUserInRole, isWindowStateAllowed, registerPublicParameter, removeAttribute, setAttribute, setAuthType, setContextPath, setCookies, setParameter, setParameter, setParameters, setPortletMode, setPreferences, setProperty, setRemoteUser, setRequestedSessionIdValid, setScheme, setSecure, setServerName, setServerPort, setSession, setUserPrincipal, setWindowID, setWindowState
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.portlet.PortletRequest
getAttribute, getAttributeNames, getAuthType, getContextPath, getCookies, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getPortalContext, getPortletMode, getPortletSession, getPortletSession, getPreferences, getPrivateParameterMap, getProperties, getProperty, getPropertyNames, getPublicParameterMap, getRemoteUser, getRequestedSessionId, getResponseContentType, getResponseContentTypes, getScheme, getServerName, getServerPort, getUserPrincipal, getWindowID, getWindowState, isPortletModeAllowed, isRequestedSessionIdValid, isSecure, isUserInRole, isWindowStateAllowed, removeAttribute, setAttribute

Constructor Detail

MockRenderRequest

public MockRenderRequest()
Create a new MockRenderRequest with a default MockPortalContext and a default MockPortletContext.

See Also:
MockPortalContext, MockPortletContext

MockRenderRequest

public MockRenderRequest(javax.portlet.PortletMode portletMode)
Create a new MockRenderRequest with a default MockPortalContext and a default MockPortletContext.

Parameters:
portletMode - the mode that the portlet runs in

MockRenderRequest

public MockRenderRequest(javax.portlet.PortletMode portletMode,
                         javax.portlet.WindowState windowState)
Create a new MockRenderRequest with a default MockPortalContext and a default MockPortletContext.

Parameters:
portletMode - the mode that the portlet runs in
windowState - the window state to run the portlet in

MockRenderRequest

public MockRenderRequest(javax.portlet.PortletContext portletContext)
Create a new MockRenderRequest with a default MockPortalContext.

Parameters:
portletContext - the PortletContext that the request runs in

MockRenderRequest

public MockRenderRequest(javax.portlet.PortalContext portalContext,
                         javax.portlet.PortletContext portletContext)
Create a new MockRenderRequest.

Parameters:
portalContext - the PortletContext that the request runs in
portletContext - the PortletContext that the request runs in
Method Detail

getLifecyclePhase

protected String getLifecyclePhase()
Description copied from class: MockPortletRequest
Return the Portlet 2.0 lifecycle id for the current phase.

Overrides:
getLifecyclePhase in class MockPortletRequest

getETag

public String getETag()
Specified by:
getETag in interface javax.portlet.RenderRequest
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockRenderResponse

org.springframework.mock.web.portlet
Class MockRenderResponse

java.lang.Object
    extended by  org.springframework.mock.web.portlet.MockPortletResponse
        extended by  org.springframework.mock.web.portlet.MockMimeResponse
            extended by  org.springframework.mock.web.portlet.MockRenderResponse
All Implemented Interfaces:
javax.portlet.MimeResponse, javax.portlet.PortletResponse, javax.portlet.RenderResponse
public class MockRenderResponse
extends MockMimeResponse
implements javax.portlet.RenderResponse

Mock implementation of the RenderResponse interface.

Since:
2.0
Author:
John A. Lewis, Juergen Hoeller

Field Summary
Fields inherited from interface javax.portlet.MimeResponse
CACHE_SCOPE, ETAG, EXPIRATION_CACHE, MARKUP_HEAD_ELEMENT, NAMESPACED_RESPONSE, PRIVATE_SCOPE, PUBLIC_SCOPE, USE_CACHED_CONTENT
Constructor Summary
MockRenderResponse()
Create a new MockRenderResponse with a default MockPortalContext.
MockRenderResponse(javax.portlet.PortalContext portalContext)
Create a new MockRenderResponse.
MockRenderResponse(javax.portlet.PortalContext portalContext, javax.portlet.RenderRequest request)
Create a new MockRenderResponse.
Method Summary
Collection<javax.portlet.PortletMode> | getNextPossiblePortletModes()
String | getTitle()
void | setNextPossiblePortletModes(Collection<javax.portlet.PortletMode> portletModes)
void | setTitle(String title)
Methods inherited from class org.springframework.mock.web.portlet.MockMimeResponse
createActionURL, createRenderURL, createResourceURL, flushBuffer, getBufferSize, getCacheControl, getCharacterEncoding, getContentAsByteArray, getContentAsString, getContentType, getForwardedUrl, getIncludedUrl, getLocale, getPortletOutputStream, getWriter, isCommitted, reset, resetBuffer, setBufferSize, setCharacterEncoding, setCommitted, setContentType, setForwardedUrl, setIncludedUrl, setLocale
Methods inherited from class org.springframework.mock.web.portlet.MockPortletResponse
addProperty, addProperty, addProperty, createElement, encodeURL, getCookie, getCookies, getNamespace, getPortalContext, getProperties, getProperty, getPropertyNames, getXmlProperties, getXmlProperty, getXmlPropertyNames, setNamespace, setProperty
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.portlet.RenderResponse
setContentType
Methods inherited from interface javax.portlet.MimeResponse
createActionURL, createRenderURL, createResourceURL, flushBuffer, getBufferSize, getCacheControl, getCharacterEncoding, getContentType, getLocale, getPortletOutputStream, getWriter, isCommitted, reset, resetBuffer, setBufferSize
Methods inherited from interface javax.portlet.PortletResponse
addProperty, addProperty, addProperty, createElement, encodeURL, getNamespace, setProperty

Constructor Detail

MockRenderResponse

public MockRenderResponse()
Create a new MockRenderResponse with a default MockPortalContext.

See Also:
MockPortalContext

MockRenderResponse

public MockRenderResponse(javax.portlet.PortalContext portalContext)
Create a new MockRenderResponse.

Parameters:
portalContext - the PortalContext defining the supported PortletModes and WindowStates

MockRenderResponse

public MockRenderResponse(javax.portlet.PortalContext portalContext,
                          javax.portlet.RenderRequest request)
Create a new MockRenderResponse.

Parameters:
portalContext - the PortalContext defining the supported PortletModes and WindowStates
request - the corresponding render request that this response is generated for
Method Detail

setTitle

public void setTitle(String title)
Specified by:
setTitle in interface javax.portlet.RenderResponse

getTitle

public String getTitle()

setNextPossiblePortletModes

public void setNextPossiblePortletModes(Collection<javax.portlet.PortletMode> portletModes)
Specified by:
setNextPossiblePortletModes in interface javax.portlet.RenderResponse

getNextPossiblePortletModes

public Collection<javax.portlet.PortletMode> getNextPossiblePortletModes()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockResourceRequest

org.springframework.mock.web.portlet
Class MockResourceRequest

java.lang.Object
    extended by  org.springframework.mock.web.portlet.MockPortletRequest
        extended by  org.springframework.mock.web.portlet.MockClientDataRequest
            extended by  org.springframework.mock.web.portlet.MockResourceRequest
All Implemented Interfaces:
javax.portlet.ClientDataRequest, javax.portlet.PortletRequest, javax.portlet.ResourceRequest
public class MockResourceRequest
extends MockClientDataRequest
implements javax.portlet.ResourceRequest

Mock implementation of the ResourceRequest interface.

Since:
3.0
Author:
Juergen Hoeller

Nested Class Summary
Nested classes/interfaces inherited from interface javax.portlet.PortletRequest
javax.portlet.PortletRequest.P3PUserInfos
Field Summary
Fields inherited from interface javax.portlet.ResourceRequest
ETAG
Fields inherited from interface javax.portlet.PortletRequest
ACTION_PHASE, ACTION_SCOPE_ID, BASIC_AUTH, CCPP_PROFILE, CLIENT_CERT_AUTH, DIGEST_AUTH, EVENT_PHASE, FORM_AUTH, LIFECYCLE_PHASE, RENDER_HEADERS, RENDER_MARKUP, RENDER_PART, RENDER_PHASE, RESOURCE_PHASE, USER_INFO
Constructor Summary
MockResourceRequest()
Create a new MockResourceRequest with a default MockPortalContext and a default MockPortletContext.
MockResourceRequest(MockResourceURL url)
Create a new MockResourceRequest with a default MockPortalContext and a default MockPortletContext.
MockResourceRequest(javax.portlet.PortalContext portalContext, javax.portlet.PortletContext portletContext)
Create a new MockResourceRequest.
MockResourceRequest(javax.portlet.PortletContext portletContext)
Create a new MockResourceRequest with a default MockPortalContext.
MockResourceRequest(String resourceID)
Create a new MockResourceRequest with a default MockPortalContext and a default MockPortletContext.
Method Summary
void | addPrivateRenderParameter(String key, String value)
void | addPrivateRenderParameter(String key, String[] values)
String | getCacheability()
String | getETag()
protected String | getLifecyclePhase() Return the Portlet 2.0 lifecycle id for the current phase.
Map<String,String[]> | getPrivateRenderParameterMap()
String | getResourceID()
void | setCacheability(String cacheLevel)
void | setResourceID(String resourceID)
Methods inherited from class org.springframework.mock.web.portlet.MockClientDataRequest
getCharacterEncoding, getContentLength, getContentType, getMethod, getPortletInputStream, getReader, setCharacterEncoding, setContent, setContentType, setMethod
Methods inherited from class org.springframework.mock.web.portlet.MockPortletRequest
addLocale, addParameter, addParameter, addPreferredLocale, addPreferredResponseContentType, addProperty, addResponseContentType, addUserRole, checkActive, close, getAttribute, getAttributeNames, getAuthType, getContextPath, getCookies, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getPortalContext, getPortletMode, getPortletSession, getPortletSession, getPreferences, getPrivateParameterMap, getProperties, getProperty, getPropertyNames, getPublicParameterMap, getRemoteUser, getRequestedSessionId, getResponseContentType, getResponseContentTypes, getScheme, getServerName, getServerPort, getUserPrincipal, getWindowID, getWindowState, isActive, isPortletModeAllowed, isRequestedSessionIdValid, isSecure, isUserInRole, isWindowStateAllowed, registerPublicParameter, removeAttribute, setAttribute, setAuthType, setContextPath, setCookies, setParameter, setParameter, setParameters, setPortletMode, setPreferences, setProperty, setRemoteUser, setRequestedSessionIdValid, setScheme, setSecure, setServerName, setServerPort, setSession, setUserPrincipal, setWindowID, setWindowState
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.portlet.ResourceRequest
getResponseContentType, getResponseContentTypes
Methods inherited from interface javax.portlet.ClientDataRequest
getCharacterEncoding, getContentLength, getContentType, getMethod, getPortletInputStream, getReader, setCharacterEncoding
Methods inherited from interface javax.portlet.PortletRequest
getAttribute, getAttributeNames, getAuthType, getContextPath, getCookies, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getPortalContext, getPortletMode, getPortletSession, getPortletSession, getPreferences, getPrivateParameterMap, getProperties, getProperty, getPropertyNames, getPublicParameterMap, getRemoteUser, getRequestedSessionId, getScheme, getServerName, getServerPort, getUserPrincipal, getWindowID, getWindowState, isPortletModeAllowed, isRequestedSessionIdValid, isSecure, isUserInRole, isWindowStateAllowed, removeAttribute, setAttribute

Constructor Detail

MockResourceRequest

public MockResourceRequest()
Create a new MockResourceRequest with a default MockPortalContext and a default MockPortletContext.

See Also:
MockPortalContext, MockPortletContext

MockResourceRequest

public MockResourceRequest(String resourceID)
Create a new MockResourceRequest with a default MockPortalContext and a default MockPortletContext.

Parameters:
resourceID - the resource id for this request

MockResourceRequest

public MockResourceRequest(MockResourceURL url)
Create a new MockResourceRequest with a default MockPortalContext and a default MockPortletContext.

Parameters:
url - the resource URL for this request

MockResourceRequest

public MockResourceRequest(javax.portlet.PortletContext portletContext)
Create a new MockResourceRequest with a default MockPortalContext.

Parameters:
portletContext - the PortletContext that the request runs in

MockResourceRequest

public MockResourceRequest(javax.portlet.PortalContext portalContext,
                           javax.portlet.PortletContext portletContext)
Create a new MockResourceRequest.

Parameters:
portalContext - the PortalContext that the request runs in
portletContext - the PortletContext that the request runs in
Method Detail

getLifecyclePhase

protected String getLifecyclePhase()
Description copied from class: MockPortletRequest
Return the Portlet 2.0 lifecycle id for the current phase.

Overrides:
getLifecyclePhase in class MockPortletRequest

setResourceID

public void setResourceID(String resourceID)

getResourceID

public String getResourceID()
Specified by:
getResourceID in interface javax.portlet.ResourceRequest

setCacheability

public void setCacheability(String cacheLevel)

getCacheability

public String getCacheability()
Specified by:
getCacheability in interface javax.portlet.ResourceRequest

getETag

public String getETag()
Specified by:
getETag in interface javax.portlet.ResourceRequest

addPrivateRenderParameter

public void addPrivateRenderParameter(String key,
                                      String value)

addPrivateRenderParameter

public void addPrivateRenderParameter(String key,
                                      String[] values)

getPrivateRenderParameterMap

public Map<String,String[]> getPrivateRenderParameterMap()
Specified by:
getPrivateRenderParameterMap in interface javax.portlet.ResourceRequest
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockResourceResponse

org.springframework.mock.web.portlet
Class MockResourceResponse

java.lang.Object
    extended by  org.springframework.mock.web.portlet.MockPortletResponse
        extended by  org.springframework.mock.web.portlet.MockMimeResponse
            extended by  org.springframework.mock.web.portlet.MockResourceResponse
All Implemented Interfaces:
javax.portlet.MimeResponse, javax.portlet.PortletResponse, javax.portlet.ResourceResponse
public class MockResourceResponse
extends MockMimeResponse
implements javax.portlet.ResourceResponse

Mock implementation of the ResourceResponse interface.

Since:
3.0
Author:
Juergen Hoeller

Field Summary
Fields inherited from interface javax.portlet.ResourceResponse
HTTP_STATUS_CODE
Fields inherited from interface javax.portlet.MimeResponse
CACHE_SCOPE, ETAG, EXPIRATION_CACHE, MARKUP_HEAD_ELEMENT, NAMESPACED_RESPONSE, PRIVATE_SCOPE, PUBLIC_SCOPE, USE_CACHED_CONTENT
Constructor Summary
MockResourceResponse()
Method Summary
int | getContentLength()
void | setContentLength(int len)
Methods inherited from class org.springframework.mock.web.portlet.MockMimeResponse
createActionURL, createRenderURL, createResourceURL, flushBuffer, getBufferSize, getCacheControl, getCharacterEncoding, getContentAsByteArray, getContentAsString, getContentType, getForwardedUrl, getIncludedUrl, getLocale, getPortletOutputStream, getWriter, isCommitted, reset, resetBuffer, setBufferSize, setCharacterEncoding, setCommitted, setContentType, setForwardedUrl, setIncludedUrl, setLocale
Methods inherited from class org.springframework.mock.web.portlet.MockPortletResponse
addProperty, addProperty, addProperty, createElement, encodeURL, getCookie, getCookies, getNamespace, getPortalContext, getProperties, getProperty, getPropertyNames, getXmlProperties, getXmlProperty, getXmlPropertyNames, setNamespace, setProperty
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.portlet.ResourceResponse
createActionURL, createRenderURL, createResourceURL, setCharacterEncoding, setLocale
Methods inherited from interface javax.portlet.MimeResponse
flushBuffer, getBufferSize, getCacheControl, getCharacterEncoding, getContentType, getLocale, getPortletOutputStream, getWriter, isCommitted, reset, resetBuffer, setBufferSize, setContentType
Methods inherited from interface javax.portlet.PortletResponse
addProperty, addProperty, addProperty, createElement, encodeURL, getNamespace, setProperty

Constructor Detail

MockResourceResponse

public MockResourceResponse()
Method Detail

setContentLength

public void setContentLength(int len)
Specified by:
setContentLength in interface javax.portlet.ResourceResponse

getContentLength

public int getContentLength()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockResourceURL

org.springframework.mock.web.portlet
Class MockResourceURL

java.lang.Object
    extended by  org.springframework.mock.web.portlet.MockBaseURL
        extended by  org.springframework.mock.web.portlet.MockResourceURL
All Implemented Interfaces:
javax.portlet.BaseURL, javax.portlet.ResourceURL
public class MockResourceURL
extends MockBaseURL
implements javax.portlet.ResourceURL

Mock implementation of the ResourceURL interface.

Since:
3.0
Author:
Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.mock.web.portlet.MockBaseURL
parameters, URL_TYPE_ACTION, URL_TYPE_RENDER
Fields inherited from interface javax.portlet.ResourceURL
FULL, PAGE, PORTLET, SHARED
Constructor Summary
MockResourceURL()
Method Summary
String | getCacheability()
String | getResourceID()
void | setCacheability(String cacheLevel)
void | setResourceID(String resourceID)
String | toString()
Methods inherited from class org.springframework.mock.web.portlet.MockBaseURL
addProperty, encodeParameter, encodeParameter, getParameter, getParameterMap, getParameterNames, getParameterValues, getProperties, isSecure, setParameter, setParameter, setParameters, setProperty, setSecure, write, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface javax.portlet.BaseURL
addProperty, getParameterMap, setParameter, setParameter, setParameters, setProperty, setSecure, write, write

Constructor Detail

MockResourceURL

public MockResourceURL()
Method Detail

setResourceID

public void setResourceID(String resourceID)
Specified by:
setResourceID in interface javax.portlet.ResourceURL

getResourceID

public String getResourceID()

setCacheability

public void setCacheability(String cacheLevel)
Specified by:
setCacheability in interface javax.portlet.ResourceURL

getCacheability

public String getCacheability()
Specified by:
getCacheability in interface javax.portlet.ResourceURL

toString

public String toString()
Specified by:
toString in interface javax.portlet.BaseURL
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MockStateAwareResponse

org.springframework.mock.web.portlet
Class MockStateAwareResponse

java.lang.Object
    extended by  org.springframework.mock.web.portlet.MockPortletResponse
        extended by  org.springframework.mock.web.portlet.MockStateAwareResponse
All Implemented Interfaces:
javax.portlet.PortletResponse, javax.portlet.StateAwareResponse
Direct Known Subclasses:
MockActionResponse, MockEventResponse
public class MockStateAwareResponse
extends MockPortletResponse
implements javax.portlet.StateAwareResponse

Mock implementation of the StateAwareResponse interface.

Since:
3.0
Author:
Juergen Hoeller

Constructor Summary
MockStateAwareResponse()
Create a new MockActionResponse with a default MockPortalContext.
MockStateAwareResponse(javax.portlet.PortalContext portalContext)
Create a new MockActionResponse.
Method Summary
Serializable | getEvent(QName name)
Serializable | getEvent(String name)
Iterator<QName> | getEventNames()
javax.portlet.PortletMode | getPortletMode()
String | getRenderParameter(String key)
Map<String,String[]> | getRenderParameterMap()
Iterator<String> | getRenderParameterNames()
String[] | getRenderParameterValues(String key)
javax.portlet.WindowState | getWindowState()
void | removePublicRenderParameter(String name)
void | setEvent(QName name, Serializable value)
void | setEvent(String name, Serializable value)
void | setPortletMode(javax.portlet.PortletMode portletMode)
void | setRenderParameter(String key, String value)
void | setRenderParameter(String key, String[] values)
void | setRenderParameters(Map<String,String[]> parameters)
void | setWindowState(javax.portlet.WindowState windowState)
Methods inherited from class org.springframework.mock.web.portlet.MockPortletResponse
addProperty, addProperty, addProperty, createElement, encodeURL, getCookie, getCookies, getNamespace, getPortalContext, getProperties, getProperty, getPropertyNames, getXmlProperties, getXmlProperty, getXmlPropertyNames, setNamespace, setProperty
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.portlet.PortletResponse
addProperty, addProperty, addProperty, createElement, encodeURL, getNamespace, setProperty

Constructor Detail

MockStateAwareResponse

public MockStateAwareResponse()
Create a new MockActionResponse with a default MockPortalContext.

See Also:
MockPortalContext

MockStateAwareResponse

public MockStateAwareResponse(javax.portlet.PortalContext portalContext)
Create a new MockActionResponse.

Parameters:
portalContext - the PortalContext defining the supported PortletModes and WindowStates
Method Detail

setWindowState

public void setWindowState(javax.portlet.WindowState windowState)
                    throws javax.portlet.WindowStateException
Specified by:
setWindowState in interface javax.portlet.StateAwareResponse
Throws:
javax.portlet.WindowStateException

getWindowState

public javax.portlet.WindowState getWindowState()
Specified by:
getWindowState in interface javax.portlet.StateAwareResponse

setPortletMode

public void setPortletMode(javax.portlet.PortletMode portletMode)
                    throws javax.portlet.PortletModeException
Specified by:
setPortletMode in interface javax.portlet.StateAwareResponse
Throws:
javax.portlet.PortletModeException

getPortletMode

public javax.portlet.PortletMode getPortletMode()
Specified by:
getPortletMode in interface javax.portlet.StateAwareResponse

setRenderParameters

public void setRenderParameters(Map<String,String[]> parameters)
Specified by:
setRenderParameters in interface javax.portlet.StateAwareResponse

setRenderParameter

public void setRenderParameter(String key,
                               String value)
Specified by:
setRenderParameter in interface javax.portlet.StateAwareResponse

setRenderParameter

public void setRenderParameter(String key,
                               String[] values)
Specified by:
setRenderParameter in interface javax.portlet.StateAwareResponse

getRenderParameter

public String getRenderParameter(String key)

getRenderParameterValues

public String[] getRenderParameterValues(String key)

getRenderParameterNames

public Iterator<String> getRenderParameterNames()

getRenderParameterMap

public Map<String,String[]> getRenderParameterMap()
Specified by:
getRenderParameterMap in interface javax.portlet.StateAwareResponse

removePublicRenderParameter

public void removePublicRenderParameter(String name)
Specified by:
removePublicRenderParameter in interface javax.portlet.StateAwareResponse

setEvent

public void setEvent(QName name,
                     Serializable value)
Specified by:
setEvent in interface javax.portlet.StateAwareResponse

setEvent

public void setEvent(String name,
                     Serializable value)
Specified by:
setEvent in interface javax.portlet.StateAwareResponse

getEventNames

public Iterator<QName> getEventNames()

getEvent

public Serializable getEvent(QName name)

getEvent

public Serializable getEvent(String name)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletWrappingPortletContext

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.mock.web.portlet
Class ServletWrappingPortletContext

java.lang.Object
    extended by  org.springframework.mock.web.portlet.ServletWrappingPortletContext
All Implemented Interfaces:
javax.portlet.PortletContext
public class ServletWrappingPortletContext
extends Object
implements javax.portlet.PortletContext

Mock implementation of the PortletContext interface, wrapping an underlying ServletContext.

Since:
3.0
Author:
Juergen Hoeller
See Also:
MockPortletContext

Constructor Summary
ServletWrappingPortletContext(ServletContext servletContext)
Create a new PortletContext wrapping the given ServletContext.
Method Summary
Object | getAttribute(String name)
Enumeration<String> | getAttributeNames()
Enumeration<String> | getContainerRuntimeOptions()
String | getInitParameter(String name)
Enumeration<String> | getInitParameterNames()
int | getMajorVersion()
String | getMimeType(String file)
int | getMinorVersion()
javax.portlet.PortletRequestDispatcher | getNamedDispatcher(String name)
String | getPortletContextName()
String | getRealPath(String path)
javax.portlet.PortletRequestDispatcher | getRequestDispatcher(String path)
URL | getResource(String path)
InputStream | getResourceAsStream(String path)
Set<String> | getResourcePaths(String path)
String | getServerInfo()
ServletContext | getServletContext() Return the underlying ServletContext that this PortletContext wraps.
void | log(String msg)
void | log(String message, Throwable throwable)
void | removeAttribute(String name)
void | setAttribute(String name, Object object)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ServletWrappingPortletContext

public ServletWrappingPortletContext(ServletContext servletContext)
Create a new PortletContext wrapping the given ServletContext.

Parameters:
servletContext - the ServletContext to wrap
Method Detail

getServletContext

public final ServletContext getServletContext()
Return the underlying ServletContext that this PortletContext wraps.

getServerInfo

public String getServerInfo()
Specified by:
getServerInfo in interface javax.portlet.PortletContext

getRequestDispatcher

public javax.portlet.PortletRequestDispatcher getRequestDispatcher(String path)
Specified by:
getRequestDispatcher in interface javax.portlet.PortletContext

getNamedDispatcher

public javax.portlet.PortletRequestDispatcher getNamedDispatcher(String name)
Specified by:
getNamedDispatcher in interface javax.portlet.PortletContext

getResourceAsStream

public InputStream getResourceAsStream(String path)
Specified by:
getResourceAsStream in interface javax.portlet.PortletContext

getMajorVersion

public int getMajorVersion()
Specified by:
getMajorVersion in interface javax.portlet.PortletContext

getMinorVersion

public int getMinorVersion()
Specified by:
getMinorVersion in interface javax.portlet.PortletContext

getMimeType

public String getMimeType(String file)
Specified by:
getMimeType in interface javax.portlet.PortletContext

getRealPath

public String getRealPath(String path)
Specified by:
getRealPath in interface javax.portlet.PortletContext

getResourcePaths

public Set<String> getResourcePaths(String path)
Specified by:
getResourcePaths in interface javax.portlet.PortletContext

getResource

public URL getResource(String path)
                throws MalformedURLException
Specified by:
getResource in interface javax.portlet.PortletContext
Throws:
MalformedURLException

getAttribute

public Object getAttribute(String name)
Specified by:
getAttribute in interface javax.portlet.PortletContext

getAttributeNames

public Enumeration<String> getAttributeNames()
Specified by:
getAttributeNames in interface javax.portlet.PortletContext

getInitParameter

public String getInitParameter(String name)
Specified by:
getInitParameter in interface javax.portlet.PortletContext

getInitParameterNames

public Enumeration<String> getInitParameterNames()
Specified by:
getInitParameterNames in interface javax.portlet.PortletContext

log

public void log(String msg)
Specified by:
log in interface javax.portlet.PortletContext

log

public void log(String message,
                Throwable throwable)
Specified by:
log in interface javax.portlet.PortletContext

removeAttribute

public void removeAttribute(String name)
Specified by:
removeAttribute in interface javax.portlet.PortletContext

setAttribute

public void setAttribute(String name,
                         Object object)
Specified by:
setAttribute in interface javax.portlet.PortletContext

getPortletContextName

public String getPortletContextName()
Specified by:
getPortletContextName in interface javax.portlet.PortletContext

getContainerRuntimeOptions

public Enumeration<String> getContainerRuntimeOptions()
Specified by:
getContainerRuntimeOptions in interface javax.portlet.PortletContext
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.orm

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.orm

Root package for Spring's O/R Mapping integration classes.

See:
Description

Exception Summary
ObjectOptimisticLockingFailureException | Exception thrown on an optimistic locking violation for a mapped object.
ObjectRetrievalFailureException | Exception thrown if a mapped object could not be retrieved via its identifier.

Package org.springframework.orm Description

Root package for Spring's O/R Mapping integration classes. Contains generic DataAccessExceptions related to O/R Mapping.


org.springframework.orm Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.orm

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.dao.DataAccessException
              • org.springframework.dao.NonTransientDataAccessException
                • org.springframework.dao.DataRetrievalFailureException
                  • org.springframework.orm.ObjectRetrievalFailureException
              • org.springframework.dao.TransientDataAccessException
                • org.springframework.dao.ConcurrencyFailureException
                  • org.springframework.dao.OptimisticLockingFailureException
                    • org.springframework.orm.ObjectOptimisticLockingFailureException


ObjectOptimisticLockingFailureException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.orm
Class ObjectOptimisticLockingFailureException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.TransientDataAccessException
                            extended by  org.springframework.dao.ConcurrencyFailureException
                                extended by  org.springframework.dao.OptimisticLockingFailureException
                                    extended by  org.springframework.orm.ObjectOptimisticLockingFailureException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
HibernateOptimisticLockingFailureException, JdoOptimisticLockingFailureException, JpaOptimisticLockingFailureException
public class ObjectOptimisticLockingFailureException
extends OptimisticLockingFailureException

Exception thrown on an optimistic locking violation for a mapped object. Provides information about the persistent class and the identifier.

Since:
13.10.2003
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
ObjectOptimisticLockingFailureException(Class persistentClass, Object identifier)
Create a new ObjectOptimisticLockingFailureException for the given object, with the default "optimistic locking failed" message.
ObjectOptimisticLockingFailureException(Class persistentClass, Object identifier, String msg, Throwable cause)
Create a new ObjectOptimisticLockingFailureException for the given object, with the given explicit message.
ObjectOptimisticLockingFailureException(Class persistentClass, Object identifier, Throwable cause)
Create a new ObjectOptimisticLockingFailureException for the given object, with the default "optimistic locking failed" message.
ObjectOptimisticLockingFailureException(String persistentClassName, Object identifier)
Create a new ObjectOptimisticLockingFailureException for the given object, with the default "optimistic locking failed" message.
ObjectOptimisticLockingFailureException(String persistentClassName, Object identifier, String msg, Throwable cause)
Create a new ObjectOptimisticLockingFailureException for the given object, with the given explicit message.
ObjectOptimisticLockingFailureException(String persistentClassName, Object identifier, Throwable cause)
Create a new ObjectOptimisticLockingFailureException for the given object, with the default "optimistic locking failed" message.
ObjectOptimisticLockingFailureException(String msg, Throwable cause)
Create a general ObjectOptimisticLockingFailureException with the given message, without any information on the affected object.
Method Summary
Object | getIdentifier() Return the identifier of the object for which the locking failed.
Class | getPersistentClass() Return the persistent class of the object for which the locking failed.
String | getPersistentClassName() Return the name of the persistent class of the object for which the locking failed.
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ObjectOptimisticLockingFailureException

public ObjectOptimisticLockingFailureException(String msg,
                                               Throwable cause)
Create a general ObjectOptimisticLockingFailureException with the given message, without any information on the affected object.

Parameters:
msg - the detail message
cause - the source exception

ObjectOptimisticLockingFailureException

public ObjectOptimisticLockingFailureException(Class persistentClass,
                                               Object identifier)
Create a new ObjectOptimisticLockingFailureException for the given object, with the default "optimistic locking failed" message.

Parameters:
persistentClass - the persistent class
identifier - the ID of the object for which the locking failed

ObjectOptimisticLockingFailureException

public ObjectOptimisticLockingFailureException(Class persistentClass,
                                               Object identifier,
                                               Throwable cause)
Create a new ObjectOptimisticLockingFailureException for the given object, with the default "optimistic locking failed" message.

Parameters:
persistentClass - the persistent class
identifier - the ID of the object for which the locking failed
cause - the source exception

ObjectOptimisticLockingFailureException

public ObjectOptimisticLockingFailureException(Class persistentClass,
                                               Object identifier,
                                               String msg,
                                               Throwable cause)
Create a new ObjectOptimisticLockingFailureException for the given object, with the given explicit message.

Parameters:
persistentClass - the persistent class
identifier - the ID of the object for which the locking failed
msg - the detail message
cause - the source exception

ObjectOptimisticLockingFailureException

public ObjectOptimisticLockingFailureException(String persistentClassName,
                                               Object identifier)
Create a new ObjectOptimisticLockingFailureException for the given object, with the default "optimistic locking failed" message.

Parameters:
persistentClassName - the name of the persistent class
identifier - the ID of the object for which the locking failed

ObjectOptimisticLockingFailureException

public ObjectOptimisticLockingFailureException(String persistentClassName,
                                               Object identifier,
                                               Throwable cause)
Create a new ObjectOptimisticLockingFailureException for the given object, with the default "optimistic locking failed" message.

Parameters:
persistentClassName - the name of the persistent class
identifier - the ID of the object for which the locking failed
cause - the source exception

ObjectOptimisticLockingFailureException

public ObjectOptimisticLockingFailureException(String persistentClassName,
                                               Object identifier,
                                               String msg,
                                               Throwable cause)
Create a new ObjectOptimisticLockingFailureException for the given object, with the given explicit message.

Parameters:
persistentClassName - the name of the persistent class
identifier - the ID of the object for which the locking failed
msg - the detail message
cause - the source exception
Method Detail

getPersistentClass

public Class getPersistentClass()
Return the persistent class of the object for which the locking failed. If no Class was specified, this method returns null.

getPersistentClassName

public String getPersistentClassName()
Return the name of the persistent class of the object for which the locking failed. Will work for both Class objects and String names.

getIdentifier

public Object getIdentifier()
Return the identifier of the object for which the locking failed.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ObjectRetrievalFailureException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.orm
Class ObjectRetrievalFailureException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.DataRetrievalFailureException
                                extended by  org.springframework.orm.ObjectRetrievalFailureException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
HibernateObjectRetrievalFailureException, JdoObjectRetrievalFailureException, JpaObjectRetrievalFailureException
public class ObjectRetrievalFailureException
extends DataRetrievalFailureException

Exception thrown if a mapped object could not be retrieved via its identifier. Provides information about the persistent class and the identifier.

Since:
13.10.2003
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
ObjectRetrievalFailureException(Class persistentClass, Object identifier)
Create a new ObjectRetrievalFailureException for the given object, with the default "not found" message.
ObjectRetrievalFailureException(Class persistentClass, Object identifier, String msg, Throwable cause)
Create a new ObjectRetrievalFailureException for the given object, with the given explicit message and exception.
ObjectRetrievalFailureException(String persistentClassName, Object identifier)
Create a new ObjectRetrievalFailureException for the given object, with the default "not found" message.
ObjectRetrievalFailureException(String persistentClassName, Object identifier, String msg, Throwable cause)
Create a new ObjectRetrievalFailureException for the given object, with the given explicit message and exception.
ObjectRetrievalFailureException(String msg, Throwable cause)
Create a general ObjectRetrievalFailureException with the given message, without any information on the affected object.
Method Summary
Object | getIdentifier() Return the identifier of the object that was not found.
Class | getPersistentClass() Return the persistent class of the object that was not found.
String | getPersistentClassName() Return the name of the persistent class of the object that was not found.
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ObjectRetrievalFailureException

public ObjectRetrievalFailureException(String msg,
                                       Throwable cause)
Create a general ObjectRetrievalFailureException with the given message, without any information on the affected object.

Parameters:
msg - the detail message
cause - the source exception

ObjectRetrievalFailureException

public ObjectRetrievalFailureException(Class persistentClass,
                                       Object identifier)
Create a new ObjectRetrievalFailureException for the given object, with the default "not found" message.

Parameters:
persistentClass - the persistent class
identifier - the ID of the object that should have been retrieved

ObjectRetrievalFailureException

public ObjectRetrievalFailureException(Class persistentClass,
                                       Object identifier,
                                       String msg,
                                       Throwable cause)
Create a new ObjectRetrievalFailureException for the given object, with the given explicit message and exception.

Parameters:
persistentClass - the persistent class
identifier - the ID of the object that should have been retrieved
msg - the detail message
cause - the source exception

ObjectRetrievalFailureException

public ObjectRetrievalFailureException(String persistentClassName,
                                       Object identifier)
Create a new ObjectRetrievalFailureException for the given object, with the default "not found" message.

Parameters:
persistentClassName - the name of the persistent class
identifier - the ID of the object that should have been retrieved

ObjectRetrievalFailureException

public ObjectRetrievalFailureException(String persistentClassName,
                                       Object identifier,
                                       String msg,
                                       Throwable cause)
Create a new ObjectRetrievalFailureException for the given object, with the given explicit message and exception.

Parameters:
persistentClassName - the name of the persistent class
identifier - the ID of the object that should have been retrieved
msg - the detail message
cause - the source exception
Method Detail

getPersistentClass

public Class getPersistentClass()
Return the persistent class of the object that was not found. If no Class was specified, this method returns null.

getPersistentClassName

public String getPersistentClassName()
Return the name of the persistent class of the object that was not found. Will work for both Class objects and String names.

getIdentifier

public Object getIdentifier()
Return the identifier of the object that was not found.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.orm.hibernate3

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.orm.hibernate3

Package providing integration of Hibernate3 with Spring concepts.

See:
Description

Interface Summary
HibernateCallback<T> | Callback interface for Hibernate code.
HibernateOperations | Interface that specifies a basic set of Hibernate operations, implemented by HibernateTemplate.

Class Summary
AbstractSessionFactoryBean | Abstract FactoryBean that creates a Hibernate SessionFactory within a Spring application context, providing general infrastructure not related to Hibernate's specific configuration API.
FilterDefinitionFactoryBean | Convenient FactoryBean for defining Hibernate FilterDefinitions.
HibernateAccessor | Base class for HibernateTemplate and HibernateInterceptor, defining common properties such as SessionFactory and flushing behavior.
HibernateInterceptor | This interceptor binds a new Hibernate Session to the thread before a method call, closing and removing it afterwards in case of any method outcome.
HibernateTemplate | Helper class that simplifies Hibernate data access code.
HibernateTransactionManager | PlatformTransactionManager implementation for a single Hibernate SessionFactory.
LocalCacheProviderProxy | Proxy for a Hibernate CacheProvider, delegating to a Spring-managed CacheProvider instance, determined by LocalSessionFactoryBean's "cacheProvider" property.
LocalDataSourceConnectionProvider | Hibernate connection provider for local DataSource instances in an application context.
LocalJtaDataSourceConnectionProvider | Subclass of LocalDataSourceConnectionProvider that will be used if LocalSessionFactoryBean's "dataSource" property is set in combination with a Hibernate TransactionManagerLookup.
LocalRegionFactoryProxy | Proxy for a Hibernate RegionFactory, delegating to a Spring-managed RegionFactory instance, determined by LocalSessionFactoryBean's "cacheRegionFactory" property.
LocalSessionFactoryBean | FactoryBean that creates a Hibernate SessionFactory.
LocalTransactionManagerLookup | Implementation of Hibernate's TransactionManagerLookup interface that returns a Spring-managed JTA TransactionManager, determined by LocalSessionFactoryBean's "jtaTransactionManager" property.
SessionFactoryUtils | Helper class featuring methods for Hibernate Session handling, allowing for reuse of Hibernate Session instances within transactions.
SessionHolder | Session holder, wrapping a Hibernate Session and a Hibernate Transaction.
SpringSessionContext | Implementation of Hibernate 3.1's CurrentSessionContext interface that delegates to Spring's SessionFactoryUtils for providing a Spring-managed current Session.
SpringTransactionFactory | Spring-aware implementation of the Hibernate TransactionFactory interface, aware of Spring-synchronized transactions (in particular Spring-managed JTA transactions) and asking for default release mode ON_CLOSE.
TransactionAwareDataSourceConnectionProvider | Subclass of LocalDataSourceConnectionProvider that returns a transaction-aware proxy for the exposed DataSource.
TypeDefinitionBean | Bean that encapsulates a Hibernate type definition.

Exception Summary
HibernateJdbcException | Hibernate-specific subclass of UncategorizedDataAccessException, for JDBC exceptions that Hibernate wrapped.
HibernateObjectRetrievalFailureException | Hibernate-specific subclass of ObjectRetrievalFailureException.
HibernateOptimisticLockingFailureException | Hibernate-specific subclass of ObjectOptimisticLockingFailureException.
HibernateQueryException | Hibernate-specific subclass of InvalidDataAccessResourceUsageException, thrown on invalid HQL query syntax.
HibernateSystemException | Hibernate-specific subclass of UncategorizedDataAccessException, for Hibernate system errors that do not match any concrete org.springframework.dao exceptions.

Package org.springframework.orm.hibernate3 Description

Package providing integration of Hibernate3 with Spring concepts.

Contains SessionFactory helper classes, a template plus callback for Hibernate access, and an implementation of Spring's transaction SPI for local Hibernate transactions.

This package supports Hibernate 3.x only. See the org.springframework.orm.hibernate package for Hibernate 2.1 support.


org.springframework.orm.hibernate3 Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.orm.hibernate3

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.transaction.support.AbstractPlatformTransactionManager (implements org.springframework.transaction.PlatformTransactionManager, java.io.Serializable)
      • org.springframework.orm.hibernate3.HibernateTransactionManager (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean, org.springframework.transaction.support.ResourceTransactionManager)
    • org.springframework.orm.hibernate3.AbstractSessionFactoryBean (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean, org.springframework.dao.support.PersistenceExceptionTranslator)
      • org.springframework.orm.hibernate3.LocalSessionFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware)
    • org.springframework.orm.hibernate3.FilterDefinitionFactoryBean (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.orm.hibernate3.HibernateAccessor (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean)
      • org.springframework.orm.hibernate3.HibernateInterceptor (implements org.aopalliance.intercept.MethodInterceptor)
      • org.springframework.orm.hibernate3.HibernateTemplate (implements org.springframework.orm.hibernate3.HibernateOperations)
    • org.springframework.orm.hibernate3.LocalCacheProviderProxy (implements org.hibernate.cache.CacheProvider)
    • org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider (implements org.hibernate.connection.ConnectionProvider)
      • org.springframework.orm.hibernate3.LocalJtaDataSourceConnectionProvider
      • org.springframework.orm.hibernate3.TransactionAwareDataSourceConnectionProvider
    • org.springframework.orm.hibernate3.LocalRegionFactoryProxy (implements org.hibernate.cache.RegionFactory)
    • org.springframework.orm.hibernate3.LocalTransactionManagerLookup (implements org.hibernate.transaction.TransactionManagerLookup)
    • org.springframework.transaction.support.ResourceHolderSupport (implements org.springframework.transaction.support.ResourceHolder)
      • org.springframework.orm.hibernate3.SessionHolder
    • org.springframework.orm.hibernate3.SessionFactoryUtils
    • org.springframework.orm.hibernate3.SpringSessionContext (implements org.hibernate.context.CurrentSessionContext)
    • org.springframework.orm.hibernate3.SpringTransactionFactory (implements org.hibernate.transaction.TransactionFactory)
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.dao.DataAccessException
              • org.springframework.dao.NonTransientDataAccessException
                • org.springframework.dao.DataRetrievalFailureException
                  • org.springframework.orm.ObjectRetrievalFailureException
                    • org.springframework.orm.hibernate3.HibernateObjectRetrievalFailureException
                • org.springframework.dao.InvalidDataAccessResourceUsageException
                  • org.springframework.orm.hibernate3.HibernateQueryException
                • org.springframework.dao.UncategorizedDataAccessException
                  • org.springframework.orm.hibernate3.HibernateJdbcException
                  • org.springframework.orm.hibernate3.HibernateSystemException
              • org.springframework.dao.TransientDataAccessException
                • org.springframework.dao.ConcurrencyFailureException
                  • org.springframework.dao.OptimisticLockingFailureException
                    • org.springframework.orm.ObjectOptimisticLockingFailureException
                      • org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException
    • org.springframework.orm.hibernate3.TypeDefinitionBean (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean)

Interface Hierarchy

  • org.springframework.orm.hibernate3.HibernateCallback<T>
  • org.springframework.orm.hibernate3.HibernateOperations


HibernateCallback

org.springframework.orm.hibernate3
Interface HibernateCallback<T>

public interface HibernateCallback<T>

Callback interface for Hibernate code. To be used with HibernateTemplate's execution methods, often as anonymous classes within a method implementation. A typical implementation will call Session.load/find/update to perform some operations on persistent objects. It can also perform direct JDBC operations via Hibernate's Session.connection(), operating on a JDBC Connection.

Note that Hibernate works on unmodified plain Java objects, performing dirty detection via copies made at load time. Returned objects can thus be used outside of an active Hibernate Session without any hassle, e.g. for display in a web GUI. Reassociating such instances with a new Session, e.g. for updates when coming back from the GUI, is straightforward, as the instance has kept its identity. You should care to reassociate them as early as possible though, to avoid having already loaded a version from the database in the same Session.

Since:
1.2
Author:
Juergen Hoeller
See Also:
HibernateTemplate, HibernateTransactionManager

Method Summary
 T doInHibernate(org.hibernate.Session session)
Gets called by HibernateTemplate.execute with an active Hibernate Session.

Method Detail

doInHibernate

T doInHibernate(org.hibernate.Session session)
                throws org.hibernate.HibernateException,
                       SQLException
Gets called by HibernateTemplate.execute with an active Hibernate Session. Does not need to care about activating or closing the Session, or handling transactions.

If called without a thread-bound Hibernate transaction (initiated by HibernateTransactionManager), the code will simply get executed on the underlying JDBC connection with its transactional semantics. If Hibernate is configured to use a JTA-aware DataSource, the JDBC connection and thus the callback code will be transactional if a JTA transaction is active.

Allows for returning a result object created within the callback, i.e. a domain object or a collection of domain objects. A thrown custom RuntimeException is treated as an application exception: It gets propagated to the caller of the template.

Parameters:
session - active Hibernate session
Returns:
a result object, or null if none
Throws:
org.hibernate.HibernateException - if thrown by the Hibernate API
SQLException - if thrown by Hibernate-exposed JDBC API
See Also:
HibernateTemplate.execute(org.springframework.orm.hibernate3.HibernateCallback), HibernateTemplate.executeFind(org.springframework.orm.hibernate3.HibernateCallback)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HibernateOperations

org.springframework.orm.hibernate3
Interface HibernateOperations

All Known Implementing Classes:
HibernateTemplate
public interface HibernateOperations

Interface that specifies a basic set of Hibernate operations, implemented by HibernateTemplate. Not often used, but a useful option to enhance testability, as it can easily be mocked or stubbed.

Defines HibernateTemplate's data access methods that mirror various Session methods. Users are strongly encouraged to read the Hibernate Session javadocs for details on the semantics of those methods.

Note that operations that return an Iterator (i.e. iterate(..)) are supposed to be used within Spring-driven or JTA-driven transactions (with HibernateTransactionManager, JtaTransactionManager, or EJB CMT). Else, the Iterator won't be able to read results from its ResultSet anymore, as the underlying Hibernate Session will already have been closed.

Note that lazy loading will just work with an open Hibernate Session, either within a transaction or within OpenSessionInViewFilter/ OpenSessionInViewInterceptor. Furthermore, some operations just make sense within transactions, for example: contains, evict, lock, flush, clear.

Since:
1.2
Author:
Juergen Hoeller
See Also:
HibernateTemplate, Session, HibernateTransactionManager, JtaTransactionManager, OpenSessionInViewFilter, OpenSessionInViewInterceptor

Method Summary
 int bulkUpdate(String queryString)
Update/delete all objects according to the given query.
 int bulkUpdate(String queryString, Object... values)
Update/delete all objects according to the given query, binding a number of values to "?" parameters in the query string.
 int bulkUpdate(String queryString, Object value)
Update/delete all objects according to the given query, binding one value to a "?" parameter in the query string.
 void clear()
Remove all objects from the Session cache, and cancel all pending saves, updates and deletes.
 void closeIterator(Iterator it)
Immediately close an Iterator created by any of the various iterate(..) operations, instead of waiting until the session is closed or disconnected.
 boolean contains(Object entity)
Check whether the given object is in the Session cache.
 void delete(Object entity)
Delete the given persistent instance.
 void delete(Object entity, org.hibernate.LockMode lockMode)
Delete the given persistent instance.
 void delete(String entityName, Object entity)
Delete the given persistent instance.
 void delete(String entityName, Object entity, org.hibernate.LockMode lockMode)
Delete the given persistent instance.
 void deleteAll(Collection entities)
Delete all given persistent instances.
 org.hibernate.Filter enableFilter(String filterName)
Return an enabled Hibernate Filter for the given filter name.
 void evict(Object entity)
Remove the given object from the Session cache.
<T> T
execute(HibernateCallback<T> action)
Execute the action specified by the given action object within a Session.
 List executeFind(HibernateCallback<?> action)
Execute the specified action assuming that the result object is a List.
 List find(String queryString)
Execute an HQL query.
 List find(String queryString, Object... values)
Execute an HQL query, binding a number of values to "?" parameters in the query string.
 List find(String queryString, Object value)
Execute an HQL query, binding one value to a "?" parameter in the query string.
 List findByCriteria(org.hibernate.criterion.DetachedCriteria criteria)
Execute a query based on a given Hibernate criteria object.
 List findByCriteria(org.hibernate.criterion.DetachedCriteria criteria, int firstResult, int maxResults)
Execute a query based on the given Hibernate criteria object.
 List findByExample(Object exampleEntity)
Execute a query based on the given example entity object.
 List findByExample(Object exampleEntity, int firstResult, int maxResults)
Execute a query based on a given example entity object.
 List findByExample(String entityName, Object exampleEntity)
Execute a query based on the given example entity object.
 List findByExample(String entityName, Object exampleEntity, int firstResult, int maxResults)
Execute a query based on a given example entity object.
 List findByNamedParam(String queryString, String[] paramNames, Object[] values)
Execute an HQL query, binding a number of values to ":" named parameters in the query string.
 List findByNamedParam(String queryString, String paramName, Object value)
Execute an HQL query, binding one value to a ":" named parameter in the query string.
 List findByNamedQuery(String queryName)
Execute a named query.
 List findByNamedQuery(String queryName, Object... values)
Execute a named query binding a number of values to "?" parameters in the query string.
 List findByNamedQuery(String queryName, Object value)
Execute a named query, binding one value to a "?" parameter in the query string.
 List findByNamedQueryAndNamedParam(String queryName, String[] paramNames, Object[] values)
Execute a named query, binding a number of values to ":" named parameters in the query string.
 List findByNamedQueryAndNamedParam(String queryName, String paramName, Object value)
Execute a named query, binding one value to a ":" named parameter in the query string.
 List findByNamedQueryAndValueBean(String queryName, Object valueBean)
Execute a named query, binding the properties of the given bean to ":" named parameters in the query string.
 List findByValueBean(String queryString, Object valueBean)
Execute an HQL query, binding the properties of the given bean to named parameters in the query string.
 void flush()
Flush all pending saves, updates and deletes to the database.
<T> T
get(Class<T> entityClass, Serializable id)
Return the persistent instance of the given entity class with the given identifier, or null if not found.
<T> T
get(Class<T> entityClass, Serializable id, org.hibernate.LockMode lockMode)
Return the persistent instance of the given entity class with the given identifier, or null if not found.
 Object get(String entityName, Serializable id)
Return the persistent instance of the given entity class with the given identifier, or null if not found.
 Object get(String entityName, Serializable id, org.hibernate.LockMode lockMode)
Return the persistent instance of the given entity class with the given identifier, or null if not found.
 void initialize(Object proxy)
Force initialization of a Hibernate proxy or persistent collection.
 Iterator iterate(String queryString)
Execute a query for persistent instances.
 Iterator iterate(String queryString, Object... values)
Execute a query for persistent instances, binding a number of values to "?" parameters in the query string.
 Iterator iterate(String queryString, Object value)
Execute a query for persistent instances, binding one value to a "?" parameter in the query string.
<T> T
load(Class<T> entityClass, Serializable id)
Return the persistent instance of the given entity class with the given identifier, throwing an exception if not found.
<T> T
load(Class<T> entityClass, Serializable id, org.hibernate.LockMode lockMode)
Return the persistent instance of the given entity class with the given identifier, throwing an exception if not found.
 void load(Object entity, Serializable id)
Load the persistent instance with the given identifier into the given object, throwing an exception if not found.
 Object load(String entityName, Serializable id)
Return the persistent instance of the given entity class with the given identifier, throwing an exception if not found.
 Object load(String entityName, Serializable id, org.hibernate.LockMode lockMode)
Return the persistent instance of the given entity class with the given identifier, throwing an exception if not found.
<T> List<T>
loadAll(Class<T> entityClass)
Return all persistent instances of the given entity class.
 void lock(Object entity, org.hibernate.LockMode lockMode)
Obtain the specified lock level upon the given object, implicitly checking whether the corresponding database entry still exists.
 void lock(String entityName, Object entity, org.hibernate.LockMode lockMode)
Obtain the specified lock level upon the given object, implicitly checking whether the corresponding database entry still exists.
<T> T
merge(String entityName, T entity)
Copy the state of the given object onto the persistent object with the same identifier.
<T> T
merge(T entity)
Copy the state of the given object onto the persistent object with the same identifier.
 void persist(Object entity)
Persist the given transient instance.
 void persist(String entityName, Object entity)
Persist the given transient instance.
 void refresh(Object entity)
Re-read the state of the given persistent instance.
 void refresh(Object entity, org.hibernate.LockMode lockMode)
Re-read the state of the given persistent instance.
 void replicate(Object entity, org.hibernate.ReplicationMode replicationMode)
Persist the state of the given detached instance according to the given replication mode, reusing the current identifier value.
 void replicate(String entityName, Object entity, org.hibernate.ReplicationMode replicationMode)
Persist the state of the given detached instance according to the given replication mode, reusing the current identifier value.
 Serializable save(Object entity)
Persist the given transient instance.
 Serializable save(String entityName, Object entity)
Persist the given transient instance.
 void saveOrUpdate(Object entity)
Save or update the given persistent instance, according to its id (matching the configured "unsaved-value"?).
 void saveOrUpdate(String entityName, Object entity)
Save or update the given persistent instance, according to its id (matching the configured "unsaved-value"?).
 void saveOrUpdateAll(Collection entities)
Deprecated. as of Spring 2.5, in favor of individual saveOrUpdate or merge usage
 void update(Object entity)
Update the given persistent instance, associating it with the current Hibernate Session.
 void update(Object entity, org.hibernate.LockMode lockMode)
Update the given persistent instance, associating it with the current Hibernate Session.
 void update(String entityName, Object entity)
Update the given persistent instance, associating it with the current Hibernate Session.
 void update(String entityName, Object entity, org.hibernate.LockMode lockMode)
Update the given persistent instance, associating it with the current Hibernate Session.

Method Detail

execute

<T> T execute(HibernateCallback<T> action)
          throws DataAccessException
Execute the action specified by the given action object within a Session.

Application exceptions thrown by the action object get propagated to the caller (can only be unchecked). Hibernate exceptions are transformed into appropriate DAO ones. Allows for returning a result object, that is a domain object or a collection of domain objects.

Note: Callback code is not supposed to handle transactions itself! Use an appropriate transaction manager like HibernateTransactionManager. Generally, callback code must not touch any Session lifecycle methods, like close, disconnect, or reconnect, to let the template do its work.

Parameters:
action - callback object that specifies the Hibernate action
Returns:
a result object returned by the action, or null
Throws:
DataAccessException - in case of Hibernate errors
See Also:
HibernateTransactionManager, org.springframework.dao, org.springframework.transaction, Session

executeFind

List executeFind(HibernateCallback<?> action)
                 throws DataAccessException
Execute the specified action assuming that the result object is a List.

This is a convenience method for executing Hibernate find calls or queries within an action.

Parameters:
action - calback object that specifies the Hibernate action
Returns:
a List result returned by the action, or null
Throws:
DataAccessException - in case of Hibernate errors

get

<T> T get(Class<T> entityClass,
          Serializable id)
      throws DataAccessException
Return the persistent instance of the given entity class with the given identifier, or null if not found.

This method is a thin wrapper around Session.get(Class, java.io.Serializable) for convenience. For an explanation of the exact semantics of this method, please do refer to the Hibernate API documentation in the first instance.

Parameters:
entityClass - a persistent class
id - the identifier of the persistent instance
Returns:
the persistent instance, or null if not found
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.get(Class, java.io.Serializable)

get

<T> T get(Class<T> entityClass,
          Serializable id,
          org.hibernate.LockMode lockMode)
      throws DataAccessException
Return the persistent instance of the given entity class with the given identifier, or null if not found.

Obtains the specified lock mode if the instance exists.

This method is a thin wrapper around Session.get(Class, java.io.Serializable, LockMode) for convenience. For an explanation of the exact semantics of this method, please do refer to the Hibernate API documentation in the first instance.

Parameters:
entityClass - a persistent class
id - the identifier of the persistent instance
lockMode - the lock mode to obtain
Returns:
the persistent instance, or null if not found
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.get(Class, java.io.Serializable, org.hibernate.LockMode)

get

Object get(String entityName,
           Serializable id)
           throws DataAccessException
Return the persistent instance of the given entity class with the given identifier, or null if not found.

This method is a thin wrapper around Session.get(String, java.io.Serializable) for convenience. For an explanation of the exact semantics of this method, please do refer to the Hibernate API documentation in the first instance.

Parameters:
entityName - the name of the persistent entity
id - the identifier of the persistent instance
Returns:
the persistent instance, or null if not found
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.get(Class, java.io.Serializable)

get

Object get(String entityName,
           Serializable id,
           org.hibernate.LockMode lockMode)
           throws DataAccessException
Return the persistent instance of the given entity class with the given identifier, or null if not found. Obtains the specified lock mode if the instance exists.

This method is a thin wrapper around Session.get(String, java.io.Serializable, LockMode) for convenience. For an explanation of the exact semantics of this method, please do refer to the Hibernate API documentation in the first instance.

Parameters:
entityName - the name of the persistent entity
id - the identifier of the persistent instance
lockMode - the lock mode to obtain
Returns:
the persistent instance, or null if not found
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.get(Class, java.io.Serializable, org.hibernate.LockMode)

load

<T> T load(Class<T> entityClass,
           Serializable id)
       throws DataAccessException
Return the persistent instance of the given entity class with the given identifier, throwing an exception if not found.

This method is a thin wrapper around Session.load(Class, java.io.Serializable) for convenience. For an explanation of the exact semantics of this method, please do refer to the Hibernate API documentation in the first instance.

Parameters:
entityClass - a persistent class
id - the identifier of the persistent instance
Returns:
the persistent instance
Throws:
ObjectRetrievalFailureException - if not found
DataAccessException - in case of Hibernate errors
See Also:
Session.load(Class, java.io.Serializable)

load

<T> T load(Class<T> entityClass,
           Serializable id,
           org.hibernate.LockMode lockMode)
       throws DataAccessException
Return the persistent instance of the given entity class with the given identifier, throwing an exception if not found. Obtains the specified lock mode if the instance exists.

This method is a thin wrapper around Session.load(Class, java.io.Serializable, LockMode) for convenience. For an explanation of the exact semantics of this method, please do refer to the Hibernate API documentation in the first instance.

Parameters:
entityClass - a persistent class
id - the identifier of the persistent instance
lockMode - the lock mode to obtain
Returns:
the persistent instance
Throws:
ObjectRetrievalFailureException - if not found
DataAccessException - in case of Hibernate errors
See Also:
Session.load(Class, java.io.Serializable)

load

Object load(String entityName,
            Serializable id)
            throws DataAccessException
Return the persistent instance of the given entity class with the given identifier, throwing an exception if not found.

This method is a thin wrapper around Session.load(String, java.io.Serializable) for convenience. For an explanation of the exact semantics of this method, please do refer to the Hibernate API documentation in the first instance.

Parameters:
entityName - the name of the persistent entity
id - the identifier of the persistent instance
Returns:
the persistent instance
Throws:
ObjectRetrievalFailureException - if not found
DataAccessException - in case of Hibernate errors
See Also:
Session.load(Class, java.io.Serializable)

load

Object load(String entityName,
            Serializable id,
            org.hibernate.LockMode lockMode)
            throws DataAccessException
Return the persistent instance of the given entity class with the given identifier, throwing an exception if not found.

Obtains the specified lock mode if the instance exists.

This method is a thin wrapper around Session.load(String, java.io.Serializable, LockMode) for convenience. For an explanation of the exact semantics of this method, please do refer to the Hibernate API documentation in the first instance.

Parameters:
entityName - the name of the persistent entity
id - the identifier of the persistent instance
lockMode - the lock mode to obtain
Returns:
the persistent instance
Throws:
ObjectRetrievalFailureException - if not found
DataAccessException - in case of Hibernate errors
See Also:
Session.load(Class, java.io.Serializable)

loadAll

<T> List<T> loadAll(Class<T> entityClass)
                throws DataAccessException
Return all persistent instances of the given entity class. Note: Use queries or criteria for retrieving a specific subset.

Parameters:
entityClass - a persistent class
Returns:
a List containing 0 or more persistent instances
Throws:
DataAccessException - if there is a Hibernate error
See Also:
Session.createCriteria(java.lang.Class)

load

void load(Object entity,
          Serializable id)
          throws DataAccessException
Load the persistent instance with the given identifier into the given object, throwing an exception if not found.

This method is a thin wrapper around Session.load(Object, java.io.Serializable) for convenience. For an explanation of the exact semantics of this method, please do refer to the Hibernate API documentation in the first instance.

Parameters:
entity - the object (of the target class) to load into
id - the identifier of the persistent instance
Throws:
ObjectRetrievalFailureException - if not found
DataAccessException - in case of Hibernate errors
See Also:
Session.load(Object, java.io.Serializable)

refresh

void refresh(Object entity)
             throws DataAccessException
Re-read the state of the given persistent instance.

Parameters:
entity - the persistent instance to re-read
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.refresh(Object)

refresh

void refresh(Object entity,
             org.hibernate.LockMode lockMode)
             throws DataAccessException
Re-read the state of the given persistent instance. Obtains the specified lock mode for the instance.

Parameters:
entity - the persistent instance to re-read
lockMode - the lock mode to obtain
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.refresh(Object, org.hibernate.LockMode)

contains

boolean contains(Object entity)
                 throws DataAccessException
Check whether the given object is in the Session cache.

Parameters:
entity - the persistence instance to check
Returns:
whether the given object is in the Session cache
Throws:
DataAccessException - if there is a Hibernate error
See Also:
Session.contains(java.lang.Object)

evict

void evict(Object entity)
           throws DataAccessException
Remove the given object from the Session cache.

Parameters:
entity - the persistent instance to evict
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.evict(java.lang.Object)

initialize

void initialize(Object proxy)
                throws DataAccessException
Force initialization of a Hibernate proxy or persistent collection.

Parameters:
proxy - a proxy for a persistent object or a persistent collection
Throws:
DataAccessException - if we can't initialize the proxy, for example because it is not associated with an active Session
See Also:
Hibernate.initialize(java.lang.Object)

enableFilter

org.hibernate.Filter enableFilter(String filterName)
                                  throws IllegalStateException
Return an enabled Hibernate Filter for the given filter name. The returned Filter instance can be used to set filter parameters.

Parameters:
filterName - the name of the filter
Returns:
the enabled Hibernate Filter (either already enabled or enabled on the fly by this operation)
Throws:
IllegalStateException - if we are not running within a transactional Session (in which case this operation does not make sense)

lock

void lock(Object entity,
          org.hibernate.LockMode lockMode)
          throws DataAccessException
Obtain the specified lock level upon the given object, implicitly checking whether the corresponding database entry still exists.

Parameters:
entity - the persistent instance to lock
lockMode - the lock mode to obtain
Throws:
ObjectOptimisticLockingFailureException - if not found
DataAccessException - in case of Hibernate errors
See Also:
Session.lock(Object, org.hibernate.LockMode)

lock

void lock(String entityName,
          Object entity,
          org.hibernate.LockMode lockMode)
          throws DataAccessException
Obtain the specified lock level upon the given object, implicitly checking whether the corresponding database entry still exists.

Parameters:
entityName - the name of the persistent entity
entity - the persistent instance to lock
lockMode - the lock mode to obtain
Throws:
ObjectOptimisticLockingFailureException - if not found
DataAccessException - in case of Hibernate errors
See Also:
Session.lock(String, Object, org.hibernate.LockMode)

save

Serializable save(Object entity)
                  throws DataAccessException
Persist the given transient instance.

Parameters:
entity - the transient instance to persist
Returns:
the generated identifier
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.save(Object)

save

Serializable save(String entityName,
                  Object entity)
                  throws DataAccessException
Persist the given transient instance.

Parameters:
entityName - the name of the persistent entity
entity - the transient instance to persist
Returns:
the generated identifier
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.save(String, Object)

update

void update(Object entity)
            throws DataAccessException
Update the given persistent instance, associating it with the current Hibernate Session.

Parameters:
entity - the persistent instance to update
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.update(Object)

update

void update(Object entity,
            org.hibernate.LockMode lockMode)
            throws DataAccessException
Update the given persistent instance, associating it with the current Hibernate Session.

Obtains the specified lock mode if the instance exists, implicitly checking whether the corresponding database entry still exists.

Parameters:
entity - the persistent instance to update
lockMode - the lock mode to obtain
Throws:
ObjectOptimisticLockingFailureException - if not found
DataAccessException - in case of Hibernate errors
See Also:
Session.update(Object)

update

void update(String entityName,
            Object entity)
            throws DataAccessException
Update the given persistent instance, associating it with the current Hibernate Session.

Parameters:
entityName - the name of the persistent entity
entity - the persistent instance to update
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.update(String, Object)

update

void update(String entityName,
            Object entity,
            org.hibernate.LockMode lockMode)
            throws DataAccessException
Update the given persistent instance, associating it with the current Hibernate Session.

Obtains the specified lock mode if the instance exists, implicitly checking whether the corresponding database entry still exists.

Parameters:
entityName - the name of the persistent entity
entity - the persistent instance to update
lockMode - the lock mode to obtain
Throws:
ObjectOptimisticLockingFailureException - if not found
DataAccessException - in case of Hibernate errors
See Also:
Session.update(String, Object)

saveOrUpdate

void saveOrUpdate(Object entity)
                  throws DataAccessException
Save or update the given persistent instance, according to its id (matching the configured "unsaved-value"?). Associates the instance with the current Hibernate Session.

Parameters:
entity - the persistent instance to save or update (to be associated with the Hibernate Session)
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.saveOrUpdate(Object)

saveOrUpdate

void saveOrUpdate(String entityName,
                  Object entity)
                  throws DataAccessException
Save or update the given persistent instance, according to its id (matching the configured "unsaved-value"?). Associates the instance with the current Hibernate Session.

Parameters:
entityName - the name of the persistent entity
entity - the persistent instance to save or update (to be associated with the Hibernate Session)
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.saveOrUpdate(String, Object)

saveOrUpdateAll

@Deprecated
void saveOrUpdateAll(Collection entities)
                     throws DataAccessException
Deprecated. as of Spring 2.5, in favor of individual saveOrUpdate or merge usage

Save or update all given persistent instances, according to its id (matching the configured "unsaved-value"?). Associates the instances with the current Hibernate Session.

Parameters:
entities - the persistent instances to save or update (to be associated with the Hibernate Session)
Throws:
DataAccessException - in case of Hibernate errors

replicate

void replicate(Object entity,
               org.hibernate.ReplicationMode replicationMode)
               throws DataAccessException
Persist the state of the given detached instance according to the given replication mode, reusing the current identifier value.

Parameters:
entity - the persistent object to replicate
replicationMode - the Hibernate ReplicationMode
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.replicate(Object, org.hibernate.ReplicationMode)

replicate

void replicate(String entityName,
               Object entity,
               org.hibernate.ReplicationMode replicationMode)
               throws DataAccessException
Persist the state of the given detached instance according to the given replication mode, reusing the current identifier value.

Parameters:
entityName - the name of the persistent entity
entity - the persistent object to replicate
replicationMode - the Hibernate ReplicationMode
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.replicate(String, Object, org.hibernate.ReplicationMode)

persist

void persist(Object entity)
             throws DataAccessException
Persist the given transient instance. Follows JSR-220 semantics.

Similar to save, associating the given object with the current Hibernate Session.

Parameters:
entity - the persistent instance to persist
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.persist(Object), save(java.lang.Object)

persist

void persist(String entityName,
             Object entity)
             throws DataAccessException
Persist the given transient instance. Follows JSR-220 semantics.

Similar to save, associating the given object with the current Hibernate Session.

Parameters:
entityName - the name of the persistent entity
entity - the persistent instance to persist
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.persist(String, Object), save(java.lang.Object)

merge

<T> T merge(T entity)
        throws DataAccessException
Copy the state of the given object onto the persistent object with the same identifier. Follows JSR-220 semantics.

Similar to saveOrUpdate, but never associates the given object with the current Hibernate Session. In case of a new entity, the state will be copied over as well.

Note that merge will not update the identifiers in the passed-in object graph (in contrast to TopLink)! Consider registering Spring's IdTransferringMergeEventListener if you would like to have newly assigned ids transferred to the original object graph too.

Parameters:
entity - the object to merge with the corresponding persistence instance
Returns:
the updated, registered persistent instance
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.merge(Object), saveOrUpdate(java.lang.Object), IdTransferringMergeEventListener

merge

<T> T merge(String entityName,
            T entity)
        throws DataAccessException
Copy the state of the given object onto the persistent object with the same identifier. Follows JSR-220 semantics.

Similar to saveOrUpdate, but never associates the given object with the current Hibernate Session. In the case of a new entity, the state will be copied over as well.

Note that merge will not update the identifiers in the passed-in object graph (in contrast to TopLink)! Consider registering Spring's IdTransferringMergeEventListener if you would like to have newly assigned ids transferred to the original object graph too.

Parameters:
entityName - the name of the persistent entity
entity - the object to merge with the corresponding persistence instance
Returns:
the updated, registered persistent instance
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.merge(String, Object), saveOrUpdate(java.lang.Object)

delete

void delete(Object entity)
            throws DataAccessException
Delete the given persistent instance.

Parameters:
entity - the persistent instance to delete
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.delete(Object)

delete

void delete(Object entity,
            org.hibernate.LockMode lockMode)
            throws DataAccessException
Delete the given persistent instance.

Obtains the specified lock mode if the instance exists, implicitly checking whether the corresponding database entry still exists.

Parameters:
entity - the persistent instance to delete
lockMode - the lock mode to obtain
Throws:
ObjectOptimisticLockingFailureException - if not found
DataAccessException - in case of Hibernate errors
See Also:
Session.delete(Object)

delete

void delete(String entityName,
            Object entity)
            throws DataAccessException
Delete the given persistent instance.

Parameters:
entityName - the name of the persistent entity
entity - the persistent instance to delete
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.delete(Object)

delete

void delete(String entityName,
            Object entity,
            org.hibernate.LockMode lockMode)
            throws DataAccessException
Delete the given persistent instance.

Obtains the specified lock mode if the instance exists, implicitly checking whether the corresponding database entry still exists.

Parameters:
entityName - the name of the persistent entity
entity - the persistent instance to delete
lockMode - the lock mode to obtain
Throws:
ObjectOptimisticLockingFailureException - if not found
DataAccessException - in case of Hibernate errors
See Also:
Session.delete(Object)

deleteAll

void deleteAll(Collection entities)
               throws DataAccessException
Delete all given persistent instances.

This can be combined with any of the find methods to delete by query in two lines of code.

Parameters:
entities - the persistent instances to delete
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.delete(Object)

flush

void flush()
           throws DataAccessException
Flush all pending saves, updates and deletes to the database.

Only invoke this for selective eager flushing, for example when JDBC code needs to see certain changes within the same transaction. Else, it is preferable to rely on auto-flushing at transaction completion.

Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.flush()

clear

void clear()
           throws DataAccessException
Remove all objects from the Session cache, and cancel all pending saves, updates and deletes.

Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.clear()

find

List find(String queryString)
          throws DataAccessException
Execute an HQL query.

Parameters:
queryString - a query expressed in Hibernate's query language
Returns:
a List containing the results of the query execution
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.createQuery(java.lang.String)

find

List find(String queryString,
          Object value)
          throws DataAccessException
Execute an HQL query, binding one value to a "?" parameter in the query string.

Parameters:
queryString - a query expressed in Hibernate's query language
value - the value of the parameter
Returns:
a List containing the results of the query execution
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.createQuery(java.lang.String)

find

List find(String queryString,
          Object... values)
          throws DataAccessException
Execute an HQL query, binding a number of values to "?" parameters in the query string.

Parameters:
queryString - a query expressed in Hibernate's query language
values - the values of the parameters
Returns:
a List containing the results of the query execution
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.createQuery(java.lang.String)

findByNamedParam

List findByNamedParam(String queryString,
                      String paramName,
                      Object value)
                      throws DataAccessException
Execute an HQL query, binding one value to a ":" named parameter in the query string.

Parameters:
queryString - a query expressed in Hibernate's query language
paramName - the name of the parameter
value - the value of the parameter
Returns:
a List containing the results of the query execution
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.getNamedQuery(String)

findByNamedParam

List findByNamedParam(String queryString,
                      String[] paramNames,
                      Object[] values)
                      throws DataAccessException
Execute an HQL query, binding a number of values to ":" named parameters in the query string.

Parameters:
queryString - a query expressed in Hibernate's query language
paramNames - the names of the parameters
values - the values of the parameters
Returns:
a List containing the results of the query execution
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.getNamedQuery(String)

findByValueBean

List findByValueBean(String queryString,
                     Object valueBean)
                     throws DataAccessException
Execute an HQL query, binding the properties of the given bean to named parameters in the query string.

Parameters:
queryString - a query expressed in Hibernate's query language
valueBean - the values of the parameters
Returns:
a List containing the results of the query execution
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Query.setProperties(java.lang.Object), Session.createQuery(java.lang.String)

findByNamedQuery

List findByNamedQuery(String queryName)
                      throws DataAccessException
Execute a named query.

A named query is defined in a Hibernate mapping file.

Parameters:
queryName - the name of a Hibernate query in a mapping file
Returns:
a List containing the results of the query execution
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.getNamedQuery(String)

findByNamedQuery

List findByNamedQuery(String queryName,
                      Object value)
                      throws DataAccessException
Execute a named query, binding one value to a "?" parameter in the query string.

A named query is defined in a Hibernate mapping file.

Parameters:
queryName - the name of a Hibernate query in a mapping file
value - the value of the parameter
Returns:
a List containing the results of the query execution
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.getNamedQuery(String)

findByNamedQuery

List findByNamedQuery(String queryName,
                      Object... values)
                      throws DataAccessException
Execute a named query binding a number of values to "?" parameters in the query string.

A named query is defined in a Hibernate mapping file.

Parameters:
queryName - the name of a Hibernate query in a mapping file
values - the values of the parameters
Returns:
a List containing the results of the query execution
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.getNamedQuery(String)

findByNamedQueryAndNamedParam

List findByNamedQueryAndNamedParam(String queryName,
                                   String paramName,
                                   Object value)
                                   throws DataAccessException
Execute a named query, binding one value to a ":" named parameter in the query string.

A named query is defined in a Hibernate mapping file.

Parameters:
queryName - the name of a Hibernate query in a mapping file
paramName - the name of parameter
value - the value of the parameter
Returns:
a List containing the results of the query execution
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.getNamedQuery(String)

findByNamedQueryAndNamedParam

List findByNamedQueryAndNamedParam(String queryName,
                                   String[] paramNames,
                                   Object[] values)
                                   throws DataAccessException
Execute a named query, binding a number of values to ":" named parameters in the query string.

A named query is defined in a Hibernate mapping file.

Parameters:
queryName - the name of a Hibernate query in a mapping file
paramNames - the names of the parameters
values - the values of the parameters
Returns:
a List containing the results of the query execution
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.getNamedQuery(String)

findByNamedQueryAndValueBean

List findByNamedQueryAndValueBean(String queryName,
                                  Object valueBean)
                                  throws DataAccessException
Execute a named query, binding the properties of the given bean to ":" named parameters in the query string.

A named query is defined in a Hibernate mapping file.

Parameters:
queryName - the name of a Hibernate query in a mapping file
valueBean - the values of the parameters
Returns:
a List containing the results of the query execution
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Query.setProperties(java.lang.Object), Session.getNamedQuery(String)

findByCriteria

List findByCriteria(org.hibernate.criterion.DetachedCriteria criteria)
                    throws DataAccessException
Execute a query based on a given Hibernate criteria object.

Parameters:
criteria - the detached Hibernate criteria object. Note: Do not reuse criteria objects! They need to recreated per execution, due to the suboptimal design of Hibernate's criteria facility.
Returns:
a List containing 0 or more persistent instances
Throws:
DataAccessException - in case of Hibernate errors
See Also:
DetachedCriteria.getExecutableCriteria(org.hibernate.Session)

findByCriteria

List findByCriteria(org.hibernate.criterion.DetachedCriteria criteria,
                    int firstResult,
                    int maxResults)
                    throws DataAccessException
Execute a query based on the given Hibernate criteria object.

Parameters:
criteria - the detached Hibernate criteria object. Note: Do not reuse criteria objects! They need to recreated per execution, due to the suboptimal design of Hibernate's criteria facility.
firstResult - the index of the first result object to be retrieved (numbered from 0)
maxResults - the maximum number of result objects to retrieve (or <=0 for no limit)
Returns:
a List containing 0 or more persistent instances
Throws:
DataAccessException - in case of Hibernate errors
See Also:
DetachedCriteria.getExecutableCriteria(org.hibernate.Session),
Criteria.setFirstResult(int),
Criteria.setMaxResults(int)

findByExample

List findByExample(Object exampleEntity)
                   throws DataAccessException
Execute a query based on the given example entity object.

Parameters:
exampleEntity - an instance of the desired entity, serving as example for "query-by-example"
Returns:
a List containing 0 or more persistent instances
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Example.create(Object)

findByExample

List findByExample(String entityName,
                   Object exampleEntity)
                   throws DataAccessException
Execute a query based on the given example entity object.

Parameters:
entityName - the name of the persistent entity
exampleEntity - an instance of the desired entity, serving as example for "query-by-example"
Returns:
a List containing 0 or more persistent instances
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Example.create(Object)

findByExample

List findByExample(Object exampleEntity,
                   int firstResult,
                   int maxResults)
                   throws DataAccessException
Execute a query based on a given example entity object.

Parameters:
exampleEntity - an instance of the desired entity, serving as example for "query-by-example"
firstResult - the index of the first result object to be retrieved (numbered from 0)
maxResults - the maximum number of result objects to retrieve (or <=0 for no limit)
Returns:
a List containing 0 or more persistent instances
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Example.create(Object),
Criteria.setFirstResult(int),
Criteria.setMaxResults(int)

findByExample

List findByExample(String entityName,
                   Object exampleEntity,
                   int firstResult,
                   int maxResults)
                   throws DataAccessException
Execute a query based on a given example entity object.

Parameters:
entityName - the name of the persistent entity
exampleEntity - an instance of the desired entity, serving as example for "query-by-example"
firstResult - the index of the first result object to be retrieved (numbered from 0)
maxResults - the maximum number of result objects to retrieve (or <=0 for no limit)
Returns:
a List containing 0 or more persistent instances
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Example.create(Object),
Criteria.setFirstResult(int),
Criteria.setMaxResults(int)

iterate

Iterator iterate(String queryString)
                 throws DataAccessException
Execute a query for persistent instances.

Returns the results as an Iterator. Entities returned are initialized on demand. See the Hibernate API documentation for details.

Parameters:
queryString - a query expressed in Hibernate's query language
Returns:
an Iterator containing 0 or more persistent instances
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.createQuery(java.lang.String), Query.iterate()

iterate

Iterator iterate(String queryString,
                 Object value)
                 throws DataAccessException
Execute a query for persistent instances, binding one value to a "?" parameter in the query string.

Returns the results as an Iterator. Entities returned are initialized on demand. See the Hibernate API documentation for details.

Parameters:
queryString - a query expressed in Hibernate's query language
value - the value of the parameter
Returns:
an Iterator containing 0 or more persistent instances
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.createQuery(java.lang.String), Query.iterate()

iterate

Iterator iterate(String queryString,
                 Object... values)
                 throws DataAccessException
Execute a query for persistent instances, binding a number of values to "?" parameters in the query string.

Returns the results as an Iterator. Entities returned are initialized on demand. See the Hibernate API documentation for details.

Parameters:
queryString - a query expressed in Hibernate's query language
values - the values of the parameters
Returns:
an Iterator containing 0 or more persistent instances
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.createQuery(java.lang.String), Query.iterate()

closeIterator

void closeIterator(Iterator it)
                   throws DataAccessException
Immediately close an Iterator created by any of the various iterate(..) operations, instead of waiting until the session is closed or disconnected.

Parameters:
it - the Iterator to close
Throws:
DataAccessException - if the Iterator could not be closed
See Also:
Hibernate.close(java.util.Iterator)

bulkUpdate

int bulkUpdate(String queryString)
               throws DataAccessException
Update/delete all objects according to the given query.

Parameters:
queryString - an update/delete query expressed in Hibernate's query language
Returns:
the number of instances updated/deleted
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.createQuery(java.lang.String), Query.executeUpdate()

bulkUpdate

int bulkUpdate(String queryString,
               Object value)
               throws DataAccessException
Update/delete all objects according to the given query, binding one value to a "?" parameter in the query string.

Parameters:
queryString - an update/delete query expressed in Hibernate's query language
value - the value of the parameter
Returns:
the number of instances updated/deleted
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.createQuery(java.lang.String), Query.executeUpdate()

bulkUpdate

int bulkUpdate(String queryString,
               Object... values)
               throws DataAccessException
Update/delete all objects according to the given query, binding a number of values to "?" parameters in the query string.

Parameters:
queryString - an update/delete query expressed in Hibernate's query language
values - the values of the parameters
Returns:
the number of instances updated/deleted
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.createQuery(java.lang.String), Query.executeUpdate()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractSessionFactoryBean

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.orm.hibernate3
Class AbstractSessionFactoryBean

java.lang.Object
    extended by  org.springframework.orm.hibernate3.AbstractSessionFactoryBean
All Implemented Interfaces:
DisposableBean, FactoryBean<org.hibernate.SessionFactory>, InitializingBean, PersistenceExceptionTranslator
Direct Known Subclasses:
LocalSessionFactoryBean
public abstract class AbstractSessionFactoryBean
extends Object
implements FactoryBean<org.hibernate.SessionFactory>, InitializingBean, DisposableBean, PersistenceExceptionTranslator

Abstract FactoryBean that creates a Hibernate SessionFactory within a Spring application context, providing general infrastructure not related to Hibernate's specific configuration API.

This class implements the PersistenceExceptionTranslator interface, as autodetected by Spring's PersistenceExceptionTranslationPostProcessor, for AOP-based translation of native exceptions to Spring DataAccessExceptions. Hence, the presence of e.g. LocalSessionFactoryBean automatically enables a PersistenceExceptionTranslationPostProcessor to translate Hibernate exceptions.

This class mainly serves as common base class for LocalSessionFactoryBean. For details on typical SessionFactory setup, see the LocalSessionFactoryBean javadoc.

Since:
2.0
Author:
Juergen Hoeller
See Also:
setExposeTransactionAwareSessionFactory(boolean), SessionFactory.getCurrentSession(), PersistenceExceptionTranslationPostProcessor

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
AbstractSessionFactoryBean()
Method Summary
 void afterPropertiesSet()
Build and expose the SessionFactory.
protected  void afterSessionFactoryCreation()
Hook that allows post-processing after the SessionFactory has been successfully created.
protected  void beforeSessionFactoryDestruction()
Hook that allows shutdown processing before the SessionFactory will be closed.
protected abstract  org.hibernate.SessionFactory buildSessionFactory()
Build the underlying Hibernate SessionFactory.
protected  DataAccessException convertHibernateAccessException(org.hibernate.HibernateException ex)
Convert the given HibernateException to an appropriate exception from the org.springframework.dao hierarchy.
 void destroy()
Close the SessionFactory on bean factory shutdown.
 DataSource getDataSource()
Return the DataSource to be used by the SessionFactory.
 org.hibernate.SessionFactory getObject()
Return the singleton SessionFactory.
 Class<? extends org.hibernate.SessionFactory> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
protected  org.hibernate.SessionFactory getSessionFactory()
Return the exposed SessionFactory.
protected  boolean isExposeTransactionAwareSessionFactory()
Return whether to expose a transaction-aware proxy for the SessionFactory.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
protected  boolean isUseTransactionAwareDataSource()
Return whether to use a transaction-aware DataSource for the SessionFactory.
 void setDataSource(DataSource dataSource)
Set the DataSource to be used by the SessionFactory.
 void setExposeTransactionAwareSessionFactory(boolean exposeTransactionAwareSessionFactory)
Set whether to expose a transaction-aware current Session from the SessionFactory's getCurrentSession() method, returning the Session that's associated with the current Spring-managed transaction, if any.
 void setJdbcExceptionTranslator(SQLExceptionTranslator jdbcExceptionTranslator)
Set the JDBC exception translator for the SessionFactory, exposed via the PersistenceExceptionTranslator interface.
 void setUseTransactionAwareDataSource(boolean useTransactionAwareDataSource)
Set whether to use a transaction-aware DataSource for the SessionFactory, i.e.
 DataAccessException translateExceptionIfPossible(RuntimeException ex)
Implementation of the PersistenceExceptionTranslator interface, as autodetected by Spring's PersistenceExceptionTranslationPostProcessor.
protected  org.hibernate.SessionFactory wrapSessionFactoryIfNecessary(org.hibernate.SessionFactory rawSf)
Wrap the given SessionFactory with a proxy, if demanded.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

AbstractSessionFactoryBean

public AbstractSessionFactoryBean()
Method Detail

setDataSource

public void setDataSource(DataSource dataSource)
Set the DataSource to be used by the SessionFactory. If set, this will override corresponding settings in Hibernate properties.

If this is set, the Hibernate settings should not define a connection provider to avoid meaningless double configuration.

If using HibernateTransactionManager as transaction strategy, consider proxying your target DataSource with a LazyConnectionDataSourceProxy. This defers fetching of an actual JDBC Connection until the first JDBC Statement gets executed, even within JDBC transactions (as performed by HibernateTransactionManager). Such lazy fetching is particularly beneficial for read-only operations, in particular if the chances of resolving the result in the second-level cache are high.

As JTA and transactional JNDI DataSources already provide lazy enlistment of JDBC Connections, LazyConnectionDataSourceProxy does not add value with JTA (i.e. Spring's JtaTransactionManager) as transaction strategy.

See Also:
setUseTransactionAwareDataSource(boolean), HibernateTransactionManager, JtaTransactionManager, LazyConnectionDataSourceProxy

getDataSource

public DataSource getDataSource()
Return the DataSource to be used by the SessionFactory.

setUseTransactionAwareDataSource

public void setUseTransactionAwareDataSource(boolean useTransactionAwareDataSource)
Set whether to use a transaction-aware DataSource for the SessionFactory, i.e. whether to automatically wrap the passed-in DataSource with Spring's TransactionAwareDataSourceProxy.

Default is "false": LocalSessionFactoryBean is usually used with Spring's HibernateTransactionManager or JtaTransactionManager, both of which work nicely on a plain JDBC DataSource. Hibernate Sessions and their JDBC Connections are fully managed by the Hibernate/JTA transaction infrastructure in such a scenario.

If you switch this flag to "true", Spring's Hibernate access will be able to participate in JDBC-based transactions managed outside of Hibernate (for example, by Spring's DataSourceTransactionManager). This can be convenient if you need a different local transaction strategy for another O/R mapping tool, for example, but still want Hibernate access to join into those transactions.

A further benefit of this option is that plain Sessions opened directly via the SessionFactory, outside of Spring's Hibernate support, will still participate in active Spring-managed transactions. However, consider using Hibernate's getCurrentSession() method instead (see javadoc of "exposeTransactionAwareSessionFactory" property).

WARNING: When using a transaction-aware JDBC DataSource in combination with OpenSessionInViewFilter/Interceptor, whether participating in JTA or external JDBC-based transactions, it is strongly recommended to set Hibernate's Connection release mode to "after_transaction" or "after_statement", which guarantees proper Connection handling in such a scenario. In contrast to that, HibernateTransactionManager generally requires release mode "on_close".

Note: If you want to use Hibernate's Connection release mode "after_statement" with a DataSource specified on this LocalSessionFactoryBean (for example, a JTA-aware DataSource fetched from JNDI), switch this setting to "true". Otherwise, the ConnectionProvider used underneath will vote against aggressive release and thus silently switch to release mode "after_transaction".

See Also:
setDataSource(javax.sql.DataSource), setExposeTransactionAwareSessionFactory(boolean), TransactionAwareDataSourceProxy, DataSourceTransactionManager, OpenSessionInViewFilter, OpenSessionInViewInterceptor, HibernateTransactionManager, JtaTransactionManager

isUseTransactionAwareDataSource

protected boolean isUseTransactionAwareDataSource()
Return whether to use a transaction-aware DataSource for the SessionFactory.

setExposeTransactionAwareSessionFactory

public void setExposeTransactionAwareSessionFactory(boolean exposeTransactionAwareSessionFactory)
Set whether to expose a transaction-aware current Session from the SessionFactory's getCurrentSession() method, returning the Session that's associated with the current Spring-managed transaction, if any.

Default is "true", letting data access code work with the plain Hibernate SessionFactory and its getCurrentSession() method, while still being able to participate in current Spring-managed transactions: with any transaction management strategy, either local or JTA / EJB CMT, and any transaction synchronization mechanism, either Spring or JTA. Furthermore, getCurrentSession() will also seamlessly work with a request-scoped Session managed by OpenSessionInViewFilter/Interceptor.

Turn this flag off to expose the plain Hibernate SessionFactory with Hibernate's default getCurrentSession() behavior, supporting plain JTA synchronization only. Alternatively, simply override the corresponding Hibernate property "hibernate.current_session_context_class".

See Also:
SpringSessionContext, SessionFactory.getCurrentSession(), JtaTransactionManager, HibernateTransactionManager, OpenSessionInViewFilter, OpenSessionInViewInterceptor

isExposeTransactionAwareSessionFactory

protected boolean isExposeTransactionAwareSessionFactory()
Return whether to expose a transaction-aware proxy for the SessionFactory.

setJdbcExceptionTranslator

public void setJdbcExceptionTranslator(SQLExceptionTranslator jdbcExceptionTranslator)
Set the JDBC exception translator for the SessionFactory, exposed via the PersistenceExceptionTranslator interface.

Applied to any SQLException root cause of a Hibernate JDBCException, overriding Hibernate's default SQLException translation (which is based on Hibernate's Dialect for a specific target database).

Parameters:
jdbcExceptionTranslator - the exception translator
See Also:
SQLException, JDBCException, SQLErrorCodeSQLExceptionTranslator, SQLStateSQLExceptionTranslator, PersistenceExceptionTranslator

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Build and expose the SessionFactory.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception - in the event of misconfiguration (such as failure to set an essential property) or if initialization fails.
See Also:
buildSessionFactory(), wrapSessionFactoryIfNecessary(org.hibernate.SessionFactory)

wrapSessionFactoryIfNecessary

protected org.hibernate.SessionFactory wrapSessionFactoryIfNecessary(org.hibernate.SessionFactory rawSf)
Wrap the given SessionFactory with a proxy, if demanded.

The default implementation simply returns the given SessionFactory as-is. Subclasses may override this to implement transaction awareness through a SessionFactory proxy, for example.

Parameters:
rawSf - the raw SessionFactory as built by buildSessionFactory()
Returns:
the SessionFactory reference to expose
See Also:
buildSessionFactory()

getSessionFactory

protected final org.hibernate.SessionFactory getSessionFactory()
Return the exposed SessionFactory. Will throw an exception if not initialized yet.

Returns:
the SessionFactory (never null)
Throws:
IllegalStateException - if the SessionFactory has not been initialized yet

destroy

public void destroy()
             throws org.hibernate.HibernateException
Close the SessionFactory on bean factory shutdown.

Specified by:
destroy in interface DisposableBean
Throws:
org.hibernate.HibernateException

getObject

public org.hibernate.SessionFactory getObject()
Return the singleton SessionFactory.

Specified by:
getObject in interface FactoryBean<org.hibernate.SessionFactory>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends org.hibernate.SessionFactory> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<org.hibernate.SessionFactory>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<org.hibernate.SessionFactory>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()

translateExceptionIfPossible

public DataAccessException translateExceptionIfPossible(RuntimeException ex)
Implementation of the PersistenceExceptionTranslator interface, as autodetected by Spring's PersistenceExceptionTranslationPostProcessor.

Converts the exception if it is a HibernateException; else returns null to indicate an unknown exception.

Specified by:
translateExceptionIfPossible in interface PersistenceExceptionTranslator
Parameters:
ex - a RuntimeException thrown
Returns:
the corresponding DataAccessException (or null if the exception could not be translated, as in this case it may result from user code rather than an actual persistence problem)
See Also:
PersistenceExceptionTranslationPostProcessor, convertHibernateAccessException(org.hibernate.HibernateException)

convertHibernateAccessException

protected DataAccessException convertHibernateAccessException(org.hibernate.HibernateException ex)
Convert the given HibernateException to an appropriate exception from the org.springframework.dao hierarchy.

Will automatically apply a specified SQLExceptionTranslator to a Hibernate JDBCException, else rely on Hibernate's default translation.

Parameters:
ex - HibernateException that occured
Returns:
a corresponding DataAccessException
See Also:
SessionFactoryUtils.convertHibernateAccessException(org.hibernate.HibernateException), setJdbcExceptionTranslator(org.springframework.jdbc.support.SQLExceptionTranslator)

buildSessionFactory

protected abstract org.hibernate.SessionFactory buildSessionFactory()
                                                             throws Exception
Build the underlying Hibernate SessionFactory.

Returns:
the raw SessionFactory (potentially to be wrapped with a transaction-aware proxy before it is exposed to the application)
Throws:
Exception - in case of initialization failure

afterSessionFactoryCreation

protected void afterSessionFactoryCreation()
                                    throws Exception
Hook that allows post-processing after the SessionFactory has been successfully created. The SessionFactory is already available through getSessionFactory() at this point.

This implementation is empty.

Throws:
Exception - in case of initialization failure
See Also:
getSessionFactory()

beforeSessionFactoryDestruction

protected void beforeSessionFactoryDestruction()
Hook that allows shutdown processing before the SessionFactory will be closed. The SessionFactory is still available through getSessionFactory() at this point.

This implementation is empty.

See Also:
getSessionFactory()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


FilterDefinitionFactoryBean

org.springframework.orm.hibernate3
Class FilterDefinitionFactoryBean

java.lang.Object
    extended by  org.springframework.orm.hibernate3.FilterDefinitionFactoryBean
All Implemented Interfaces:
BeanNameAware, FactoryBean<org.hibernate.engine.FilterDefinition>, InitializingBean
public class FilterDefinitionFactoryBean
extends Object
implements FactoryBean<org.hibernate.engine.FilterDefinition>, BeanNameAware, InitializingBean

Convenient FactoryBean for defining Hibernate FilterDefinitions. Exposes a corresponding Hibernate FilterDefinition object.

Typically defined as an inner bean within a LocalSessionFactoryBean definition, as the list element for the "filterDefinitions" bean property. For example:

 <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
   ...
   <property name="filterDefinitions">
     <list>
       <bean class="org.springframework.orm.hibernate3.FilterDefinitionFactoryBean">
         <property name="filterName" value="myFilter"/>
         <property name="parameterTypes">
           <map>
             <entry key="myParam" value="string"/>
             <entry key="myOtherParam" value="long"/>
           </map>
         </property>
       </bean>
     </list>
   </property>
   ...
 </bean>
Alternatively, specify a bean id (or name) attribute for the inner bean, instead of the "filterName" property.

Since:
1.2
Author:
Juergen Hoeller
See Also:
FilterDefinition, LocalSessionFactoryBean.setFilterDefinitions(org.hibernate.engine.FilterDefinition[])

Constructor Summary
FilterDefinitionFactoryBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 org.hibernate.engine.FilterDefinition getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<org.hibernate.engine.FilterDefinition> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setBeanName(String name)
If no explicit filter name has been specified, the bean name of the FilterDefinitionFactoryBean will be used.
 void setDefaultFilterCondition(String defaultFilterCondition)
Specify a default filter condition for the filter, if any.
 void setFilterName(String filterName)
Set the name of the filter.
 void setParameterTypes(Map<String,String> parameterTypes)
Set the parameter types for the filter, with parameter names as keys and type names as values.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

FilterDefinitionFactoryBean

public FilterDefinitionFactoryBean()
Method Detail

setFilterName

public void setFilterName(String filterName)
Set the name of the filter.

setParameterTypes

public void setParameterTypes(Map<String,String> parameterTypes)
Set the parameter types for the filter, with parameter names as keys and type names as values.

See Also:
TypeFactory.heuristicType(String)

setDefaultFilterCondition

public void setDefaultFilterCondition(String defaultFilterCondition)
Specify a default filter condition for the filter, if any.

setBeanName

public void setBeanName(String name)
If no explicit filter name has been specified, the bean name of the FilterDefinitionFactoryBean will be used.

Specified by:
setBeanName in interface BeanNameAware
Parameters:
name - the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use the BeanFactoryUtils.originalBeanName(String) method to extract the original bean name (without suffix), if desired.
See Also:
setFilterName(java.lang.String)

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

getObject

public org.hibernate.engine.FilterDefinition getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<org.hibernate.engine.FilterDefinition>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<org.hibernate.engine.FilterDefinition> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<org.hibernate.engine.FilterDefinition>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<org.hibernate.engine.FilterDefinition>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HibernateAccessor

org.springframework.orm.hibernate3
Class HibernateAccessor

java.lang.Object
    extended by  org.springframework.orm.hibernate3.HibernateAccessor
All Implemented Interfaces:
BeanFactoryAware, InitializingBean
Direct Known Subclasses:
HibernateInterceptor, HibernateTemplate, OpenSessionInViewInterceptor
public abstract class HibernateAccessor
extends Object
implements InitializingBean, BeanFactoryAware

Base class for HibernateTemplate and HibernateInterceptor, defining common properties such as SessionFactory and flushing behavior.

Not intended to be used directly. See HibernateTemplate and HibernateInterceptor.

Since:
1.2
Author:
Juergen Hoeller
See Also:
HibernateTemplate, HibernateInterceptor, setFlushMode(int)

Field Summary
static int | FLUSH_ALWAYS Flushing before every query statement is rarely necessary.
static int | FLUSH_AUTO Automatic flushing is the default mode for a Hibernate Session.
static int | FLUSH_COMMIT Flushing at commit only is intended for units of work where no intermediate flushing is desired, not even for find operations that might involve already modified instances.
static int | FLUSH_EAGER Eager flushing leads to immediate synchronization with the database, even if in a transaction.
static int | FLUSH_NEVER Never flush is a good strategy for read-only units of work.
protected Log | logger Logger available to subclasses
Constructor Summary
HibernateAccessor()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected org.hibernate.FlushMode | applyFlushMode(org.hibernate.Session session, boolean existingTransaction) Apply the flush mode that's been specified for this accessor to the given Session.
DataAccessException | convertHibernateAccessException(org.hibernate.HibernateException ex) Convert the given HibernateException to an appropriate exception from the org.springframework.dao hierarchy.
protected DataAccessException | convertJdbcAccessException(org.hibernate.JDBCException ex, SQLExceptionTranslator translator) Convert the given Hibernate JDBCException to an appropriate exception from the org.springframework.dao hierarchy, using the given SQLExceptionTranslator.
protected DataAccessException | convertJdbcAccessException(SQLException ex) Convert the given SQLException to an appropriate exception from the org.springframework.dao hierarchy.
protected void | disableFilters(org.hibernate.Session session) Disable the specified filters on the given Session.
protected void | enableFilters(org.hibernate.Session session) Enable the specified filters on the given Session.
protected void | flushIfNecessary(org.hibernate.Session session, boolean existingTransaction) Flush the given Hibernate Session if necessary.
protected SQLExceptionTranslator | getDefaultJdbcExceptionTranslator() Obtain a default SQLExceptionTranslator, lazily creating it if necessary.
org.hibernate.Interceptor | getEntityInterceptor() Return the current Hibernate entity interceptor, or null if none.
String[] | getFilterNames() Return the names of Hibernate filters to be activated, if any.
int | getFlushMode() Return if a flush should be forced after executing the callback code.
SQLExceptionTranslator | getJdbcExceptionTranslator() Return the JDBC exception translator for this instance, if any.
org.hibernate.SessionFactory | getSessionFactory() Return the Hibernate SessionFactory that should be used to create Hibernate Sessions.
void | setBeanFactory(BeanFactory beanFactory) The bean factory just needs to be known for resolving entity interceptor bean names.
void | setEntityInterceptor(org.hibernate.Interceptor entityInterceptor) Set a Hibernate entity interceptor that allows to inspect and change property values before writing to and reading from the database.
void | setEntityInterceptorBeanName(String entityInterceptorBeanName) Set the bean name of a Hibernate entity interceptor that allows to inspect and change property values before writing to and reading from the database.
void | setFilterName(String filter) Set the name of a Hibernate filter to be activated for all Sessions that this accessor works with.
void | setFilterNames(String[] filterNames) Set one or more names of Hibernate filters to be activated for all Sessions that this accessor works with.
void | setFlushMode(int flushMode) Set the flush behavior to one of the constants in this class.
void | setFlushModeName(String constantName) Set the flush behavior by the name of the respective constant in this class, e.g.
void | setJdbcExceptionTranslator(SQLExceptionTranslator jdbcExceptionTranslator) Set the JDBC exception translator for this instance.
void | setSessionFactory(org.hibernate.SessionFactory sessionFactory) Set the Hibernate SessionFactory that should be used to create Hibernate Sessions.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

FLUSH_NEVER

public static final int FLUSH_NEVER
Never flush is a good strategy for read-only units of work. Hibernate will not track and look for changes in this case, avoiding any overhead of modification detection.

In case of an existing Session, FLUSH_NEVER will turn the flush mode to NEVER for the scope of the current operation, resetting the previous flush mode afterwards.

See Also:
setFlushMode(int), Constant Field Values

FLUSH_AUTO

public static final int FLUSH_AUTO
Automatic flushing is the default mode for a Hibernate Session. A session will get flushed on transaction commit, and on certain find operations that might involve already modified instances, but not after each unit of work like with eager flushing.

In case of an existing Session, FLUSH_AUTO will participate in the existing flush mode, not modifying it for the current operation. This in particular means that this setting will not modify an existing flush mode NEVER, in contrast to FLUSH_EAGER.

See Also:
setFlushMode(int), Constant Field Values

FLUSH_EAGER

public static final int FLUSH_EAGER
Eager flushing leads to immediate synchronization with the database, even if in a transaction. This causes inconsistencies to show up and throw a respective exception immediately, and JDBC access code that participates in the same transaction will see the changes as the database is already aware of them then. But the drawbacks are:
  • additional communication roundtrips with the database, instead of a single batch at transaction commit;
  • the fact that an actual database rollback is needed if the Hibernate transaction rolls back (due to already submitted SQL statements).

In case of an existing Session, FLUSH_EAGER will turn the flush mode to AUTO for the scope of the current operation and issue a flush at the end, resetting the previous flush mode afterwards.

See Also:
setFlushMode(int), Constant Field Values

FLUSH_COMMIT

public static final int FLUSH_COMMIT
Flushing at commit only is intended for units of work where no intermediate flushing is desired, not even for find operations that might involve already modified instances.

In case of an existing Session, FLUSH_COMMIT will turn the flush mode to COMMIT for the scope of the current operation, resetting the previous flush mode afterwards. The only exception is an existing flush mode NEVER, which will not be modified through this setting.

See Also:
setFlushMode(int), Constant Field Values

FLUSH_ALWAYS

public static final int FLUSH_ALWAYS
Flushing before every query statement is rarely necessary. It is only available for special needs.

In case of an existing Session, FLUSH_ALWAYS will turn the flush mode to ALWAYS for the scope of the current operation, resetting the previous flush mode afterwards.

See Also:
setFlushMode(int), Constant Field Values

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

HibernateAccessor

public HibernateAccessor()
Method Detail

setSessionFactory

public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
Set the Hibernate SessionFactory that should be used to create Hibernate Sessions.

getSessionFactory

public org.hibernate.SessionFactory getSessionFactory()
Return the Hibernate SessionFactory that should be used to create Hibernate Sessions.

setEntityInterceptorBeanName

public void setEntityInterceptorBeanName(String entityInterceptorBeanName)
Set the bean name of a Hibernate entity interceptor that allows to inspect and change property values before writing to and reading from the database. Will get applied to any new Session created by this transaction manager.

Requires the bean factory to be known, to be able to resolve the bean name to an interceptor instance on session creation. Typically used for prototype interceptors, i.e. a new interceptor instance per session.

Can also be used for shared interceptor instances, but it is recommended to set the interceptor reference directly in such a scenario.

Parameters:
entityInterceptorBeanName - the name of the entity interceptor in the bean factory
See Also:
setBeanFactory(org.springframework.beans.factory.BeanFactory), setEntityInterceptor(org.hibernate.Interceptor)

setEntityInterceptor

public void setEntityInterceptor(org.hibernate.Interceptor entityInterceptor)
Set a Hibernate entity interceptor that allows to inspect and change property values before writing to and reading from the database. Will get applied to any new Session created by this object.

Such an interceptor can either be set at the SessionFactory level, i.e. on LocalSessionFactoryBean, or at the Session level, i.e. on HibernateTemplate, HibernateInterceptor, and HibernateTransactionManager. It's preferable to set it on LocalSessionFactoryBean or HibernateTransactionManager to avoid repeated configuration and guarantee consistent behavior in transactions.

See Also:
setEntityInterceptorBeanName(java.lang.String),
LocalSessionFactoryBean.setEntityInterceptor(org.hibernate.Interceptor),
HibernateTransactionManager.setEntityInterceptor(org.hibernate.Interceptor)

getEntityInterceptor

public org.hibernate.Interceptor getEntityInterceptor()
                                               throws IllegalStateException,
                                                      BeansException
Return the current Hibernate entity interceptor, or null if none. Resolves an entity interceptor bean name via the bean factory, if necessary.

Throws:
IllegalStateException - if bean name specified but no bean factory set
BeansException - if bean name resolution via the bean factory failed
See Also:
setEntityInterceptor(org.hibernate.Interceptor),
setEntityInterceptorBeanName(java.lang.String),
setBeanFactory(org.springframework.beans.factory.BeanFactory)

setJdbcExceptionTranslator

public void setJdbcExceptionTranslator(SQLExceptionTranslator jdbcExceptionTranslator)
Set the JDBC exception translator for this instance.

Applied to any SQLException root cause of a Hibernate JDBCException, overriding Hibernate's default SQLException translation (which is based on Hibernate's Dialect for a specific target database).

Parameters:
jdbcExceptionTranslator - the exception translator
See Also:
SQLException, JDBCException, SQLErrorCodeSQLExceptionTranslator, SQLStateSQLExceptionTranslator

getJdbcExceptionTranslator

public SQLExceptionTranslator getJdbcExceptionTranslator()
Return the JDBC exception translator for this instance, if any.

setFlushModeName

public void setFlushModeName(String constantName)
Set the flush behavior by the name of the respective constant in this class, e.g. "FLUSH_AUTO". Default is "FLUSH_AUTO".

Parameters:
constantName - name of the constant
See Also:
setFlushMode(int), FLUSH_AUTO

setFlushMode

public void setFlushMode(int flushMode)
Set the flush behavior to one of the constants in this class. Default is FLUSH_AUTO.

See Also:
setFlushModeName(java.lang.String), FLUSH_AUTO

getFlushMode

public int getFlushMode()
Return if a flush should be forced after executing the callback code.

setFilterName

public void setFilterName(String filter)
Set the name of a Hibernate filter to be activated for all Sessions that this accessor works with.

This filter will be enabled at the beginning of each operation and correspondingly disabled at the end of the operation. This will work for newly opened Sessions as well as for existing Sessions (for example, within a transaction).

See Also:
enableFilters(org.hibernate.Session),
Session.enableFilter(String),
LocalSessionFactoryBean.setFilterDefinitions(org.hibernate.engine.FilterDefinition[])

setFilterNames

public void setFilterNames(String[] filterNames)
Set one or more names of Hibernate filters to be activated for all Sessions that this accessor works with.

Each of those filters will be enabled at the beginning of each operation and correspondingly disabled at the end of the operation. This will work for newly opened Sessions as well as for existing Sessions (for example, within a transaction).

See Also:
enableFilters(org.hibernate.Session),
Session.enableFilter(String),
LocalSessionFactoryBean.setFilterDefinitions(org.hibernate.engine.FilterDefinition[])

getFilterNames

public String[] getFilterNames()
Return the names of Hibernate filters to be activated, if any.

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
The bean factory just needs to be known for resolving entity interceptor bean names. It does not need to be set for any other mode of operation.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
setEntityInterceptorBeanName(java.lang.String)

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

applyFlushMode

protected org.hibernate.FlushMode applyFlushMode(org.hibernate.Session session,
                                                 boolean existingTransaction)
Apply the flush mode that's been specified for this accessor to the given Session.

Parameters:
session - the current Hibernate Session
existingTransaction - if executing within an existing transaction
Returns:
the previous flush mode to restore after the operation, or null if none
See Also:
setFlushMode(int), Session.setFlushMode(org.hibernate.FlushMode)

flushIfNecessary

protected void flushIfNecessary(org.hibernate.Session session,
                                boolean existingTransaction)
                         throws org.hibernate.HibernateException
Flush the given Hibernate Session if necessary.

Parameters:
session - the current Hibernate Session
existingTransaction - if executing within an existing transaction
Throws:
org.hibernate.HibernateException - in case of Hibernate flushing errors

convertHibernateAccessException

public DataAccessException convertHibernateAccessException(org.hibernate.HibernateException ex)
Convert the given HibernateException to an appropriate exception from the org.springframework.dao hierarchy.

Will automatically apply a specified SQLExceptionTranslator to a Hibernate JDBCException, else rely on Hibernate's default translation.

Parameters:
ex - HibernateException that occured
Returns:
a corresponding DataAccessException
See Also:
SessionFactoryUtils.convertHibernateAccessException(org.hibernate.HibernateException), setJdbcExceptionTranslator(org.springframework.jdbc.support.SQLExceptionTranslator)

convertJdbcAccessException

protected DataAccessException convertJdbcAccessException(org.hibernate.JDBCException ex,
                                                         SQLExceptionTranslator translator)
Convert the given Hibernate JDBCException to an appropriate exception from the org.springframework.dao hierarchy, using the given SQLExceptionTranslator.

Parameters:
ex - Hibernate JDBCException that occured
translator - the SQLExceptionTranslator to use
Returns:
a corresponding DataAccessException

convertJdbcAccessException

protected DataAccessException convertJdbcAccessException(SQLException ex)
Convert the given SQLException to an appropriate exception from the org.springframework.dao hierarchy. Can be overridden in subclasses.

Note that a direct SQLException can just occur when callback code performs direct JDBC access via Session.connection().

Parameters:
ex - the SQLException
Returns:
the corresponding DataAccessException instance
See Also:
setJdbcExceptionTranslator(org.springframework.jdbc.support.SQLExceptionTranslator), Session.connection()

getDefaultJdbcExceptionTranslator

protected SQLExceptionTranslator getDefaultJdbcExceptionTranslator()
Obtain a default SQLExceptionTranslator, lazily creating it if necessary.

Creates a default SQLErrorCodeSQLExceptionTranslator for the SessionFactory's underlying DataSource.

enableFilters

protected void enableFilters(org.hibernate.Session session)
Enable the specified filters on the given Session.

Parameters:
session - the current Hibernate Session
See Also:
setFilterNames(java.lang.String[]), Session.enableFilter(String)

disableFilters

protected void disableFilters(org.hibernate.Session session)
Disable the specified filters on the given Session.

Parameters:
session - the current Hibernate Session
See Also:
setFilterNames(java.lang.String[]), Session.disableFilter(String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HibernateInterceptor

org.springframework.orm.hibernate3
Class HibernateInterceptor

java.lang.Object
    extended by  org.springframework.orm.hibernate3.HibernateAccessor
        extended by  org.springframework.orm.hibernate3.HibernateInterceptor
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, BeanFactoryAware, InitializingBean
public class HibernateInterceptor
extends HibernateAccessor
implements MethodInterceptor

This interceptor binds a new Hibernate Session to the thread before a method call, closing and removing it afterwards in case of any method outcome. If there already is a pre-bound Session (e.g. from HibernateTransactionManager, or from a surrounding Hibernate-intercepted method), the interceptor simply participates in it.

Application code must retrieve a Hibernate Session via the SessionFactoryUtils.getSession method or - preferably - Hibernate's own SessionFactory.getCurrentSession() method, to be able to detect a thread-bound Session. Typically, the code will look like as follows:

 public void doSomeDataAccessAction() {
   Session session = this.sessionFactory.getCurrentSession();
   ...
   // No need to close the Session or translate exceptions!
 }
Note that this interceptor automatically translates HibernateExceptions, via delegating to the SessionFactoryUtils.convertHibernateAccessException method that converts them to exceptions that are compatible with the org.springframework.dao exception hierarchy (like HibernateTemplate does). This can be turned off if the raw exceptions are preferred.

This class can be considered a declarative alternative to HibernateTemplate's callback approach. The advantages are:

  • no anonymous classes necessary for callback implementations;
  • the possibility to throw any application exceptions from within data access code.

The drawback is the dependency on interceptor configuration. However, note that this interceptor is usually not necessary in scenarios where the data access code always executes within transactions. A transaction will always have a thread-bound Session in the first place, so adding this interceptor to the configuration just adds value when fine-tuning Session settings like the flush mode - or when relying on exception translation.

Since:
1.2
Author:
Juergen Hoeller
See Also:
SessionFactory.getCurrentSession(), HibernateTransactionManager, HibernateTemplate

Field Summary
Fields inherited from class org.springframework.orm.hibernate3.HibernateAccessor
FLUSH_ALWAYS, FLUSH_AUTO, FLUSH_COMMIT, FLUSH_EAGER, FLUSH_NEVER, logger
Constructor Summary
HibernateInterceptor()
Method Summary
protected org.hibernate.Session | getSession() Return a Session for use by this interceptor.
Object | invoke(MethodInvocation methodInvocation)
void | setExceptionConversionEnabled(boolean exceptionConversionEnabled) Set whether to convert any HibernateException raised to a Spring DataAccessException, compatible with the org.springframework.dao exception hierarchy.
Methods inherited from class org.springframework.orm.hibernate3.HibernateAccessor
afterPropertiesSet, applyFlushMode, convertHibernateAccessException, convertJdbcAccessException, convertJdbcAccessException, disableFilters, enableFilters, flushIfNecessary, getDefaultJdbcExceptionTranslator, getEntityInterceptor, getFilterNames, getFlushMode, getJdbcExceptionTranslator, getSessionFactory, setBeanFactory, setEntityInterceptor, setEntityInterceptorBeanName, setFilterName, setFilterNames, setFlushMode, setFlushModeName, setJdbcExceptionTranslator, setSessionFactory
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

HibernateInterceptor

public HibernateInterceptor()
Method Detail

setExceptionConversionEnabled

public void setExceptionConversionEnabled(boolean exceptionConversionEnabled)
Set whether to convert any HibernateException raised to a Spring DataAccessException, compatible with the org.springframework.dao exception hierarchy.

Default is "true". Turn this flag off to let the caller receive raw exceptions as-is, without any wrapping.

See Also:
DataAccessException

invoke

public Object invoke(MethodInvocation methodInvocation)
              throws Throwable
Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable

getSession

protected org.hibernate.Session getSession()
Return a Session for use by this interceptor.

See Also:
SessionFactoryUtils.getSession(org.hibernate.SessionFactory, boolean)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HibernateTemplate

org.springframework.orm.hibernate3
Class HibernateTemplate

java.lang.Object
    extended by  org.springframework.orm.hibernate3.HibernateAccessor
        extended by  org.springframework.orm.hibernate3.HibernateTemplate
All Implemented Interfaces:
BeanFactoryAware, InitializingBean, HibernateOperations
public class HibernateTemplate
extends HibernateAccessor
implements HibernateOperations

Helper class that simplifies Hibernate data access code. Automatically converts HibernateExceptions into DataAccessExceptions, following the org.springframework.dao exception hierarchy.

The central method is execute, supporting Hibernate access code implementing the HibernateCallback interface. It provides Hibernate Session handling such that neither the HibernateCallback implementation nor the calling code needs to explicitly care about retrieving/closing Hibernate Sessions, or handling Session lifecycle exceptions. For typical single step actions, there are various convenience methods (find, load, saveOrUpdate, delete).

Can be used within a service implementation via direct instantiation with a SessionFactory reference, or get prepared in an application context and given to services as bean reference. Note: The SessionFactory should always be configured as bean in the application context, in the first case given to the service directly, in the second case to the prepared template.

NOTE: As of Hibernate 3.0.1, transactional Hibernate access code can also be coded in plain Hibernate style. Hence, for newly started projects, consider adopting the standard Hibernate3 style of coding data access objects instead, based on SessionFactory.getCurrentSession().

This class can be considered as direct alternative to working with the raw Hibernate3 Session API (through SessionFactory.getCurrentSession()). The major advantage is its automatic conversion to DataAccessExceptions as well as its capability to fall back to 'auto-commit' style behavior when used outside of transactions. Note that HibernateTemplate will perform its own Session management, not participating in a custom Hibernate CurrentSessionContext unless you explicitly switch "allowCreate" to "false".

LocalSessionFactoryBean is the preferred way of obtaining a reference to a specific Hibernate SessionFactory, at least in a non-EJB environment. The Spring application context will manage its lifecycle, initializing and shutting down the factory as part of the application.

Note that operations that return an Iterator (i.e. iterate) are supposed to be used within Spring-driven or JTA-driven transactions (with HibernateTransactionManager, JtaTransactionManager, or EJB CMT). Else, the Iterator won't be able to read results from its ResultSet anymore, as the underlying Hibernate Session will already have been closed.

Lazy loading will also just work with an open Hibernate Session, either within a transaction or within OpenSessionInViewFilter/Interceptor. Furthermore, some operations just make sense within transactions, for example: contains, evict, lock, flush, clear.

Since:
1.2
Author:
Juergen Hoeller
See Also:
HibernateAccessor.setSessionFactory(org.hibernate.SessionFactory), HibernateCallback, Session, LocalSessionFactoryBean, HibernateTransactionManager, JtaTransactionManager, OpenSessionInViewFilter, OpenSessionInViewInterceptor

Field Summary
Fields inherited from class org.springframework.orm.hibernate3.HibernateAccessor
FLUSH_ALWAYS, FLUSH_AUTO, FLUSH_COMMIT, FLUSH_EAGER, FLUSH_NEVER, logger
Constructor Summary
HibernateTemplate()
Create a new HibernateTemplate instance.
HibernateTemplate(org.hibernate.SessionFactory sessionFactory)
Create a new HibernateTemplate instance.
HibernateTemplate(org.hibernate.SessionFactory sessionFactory, boolean allowCreate)
Create a new HibernateTemplate instance.
Method Summary
protected  void applyNamedParameterToQuery(org.hibernate.Query queryObject, String paramName, Object value)
Apply the given name parameter to the given Query object.
 int bulkUpdate(String queryString)
Update/delete all objects according to the given query.
 int bulkUpdate(String queryString, Object... values)
Update/delete all objects according to the given query, binding a number of values to "?" parameters in the query string.
 int bulkUpdate(String queryString, Object value)
Update/delete all objects according to the given query, binding one value to a "?" parameter in the query string.
protected  void checkWriteOperationAllowed(org.hibernate.Session session)
Check whether write operations are allowed on the given Session.
 void clear()
Remove all objects from the Session cache, and cancel all pending saves, updates and deletes.
 void closeIterator(Iterator it)
Immediately close an Iterator created by any of the various iterate(..) operations, instead of waiting until the session is closed or disconnected.
 boolean contains(Object entity)
Check whether the given object is in the Session cache.
protected  org.hibernate.Session createSessionProxy(org.hibernate.Session session)
Create a close-suppressing proxy for the given Hibernate Session.
 void delete(Object entity)
Delete the given persistent instance.
 void delete(Object entity, org.hibernate.LockMode lockMode)
Delete the given persistent instance.
 void delete(String entityName, Object entity)
Delete the given persistent instance.
 void delete(String entityName, Object entity, org.hibernate.LockMode lockMode)
Delete the given persistent instance.
 void deleteAll(Collection entities)
Delete all given persistent instances.
protected
<T> T
doExecute(HibernateCallback<T> action, boolean enforceNewSession, boolean enforceNativeSession)
Execute the action specified by the given action object within a Session.
 org.hibernate.Filter enableFilter(String filterName)
Return an enabled Hibernate Filter for the given filter name.
 void evict(Object entity)
Remove the given object from the Session cache.
<T> T
execute(HibernateCallback<T> action)
Execute the action specified by the given action object within a Session.
 List executeFind(HibernateCallback<?> action)
Execute the specified action assuming that the result object is a List.
<T> T
executeWithNativeSession(HibernateCallback<T> action)
Execute the action specified by the given action object within a native Session.
<T> T
executeWithNewSession(HibernateCallback<T> action)
Execute the action specified by the given action object within a new Session.
 List find(String queryString)
Execute an HQL query.
 List find(String queryString, Object... values)
Execute an HQL query, binding a number of values to "?" parameters in the query string.
 List find(String queryString, Object value)
Execute an HQL query, binding one value to a "?" parameter in the query string.
 List findByCriteria(org.hibernate.criterion.DetachedCriteria criteria)
Execute a query based on a given Hibernate criteria object.
 List findByCriteria(org.hibernate.criterion.DetachedCriteria criteria, int firstResult, int maxResults)
Execute a query based on the given Hibernate criteria object.
 List findByExample(Object exampleEntity)
Execute a query based on the given example entity object.
 List findByExample(Object exampleEntity, int firstResult, int maxResults)
Execute a query based on a given example entity object.
 List findByExample(String entityName, Object exampleEntity)
Execute a query based on the given example entity object.
 List findByExample(String entityName, Object exampleEntity, int firstResult, int maxResults)
Execute a query based on a given example entity object.
 List findByNamedParam(String queryString, String[] paramNames, Object[] values)
Execute an HQL query, binding a number of values to ":" named parameters in the query string.
 List findByNamedParam(String queryString, String paramName, Object value)
Execute an HQL query, binding one value to a ":" named parameter in the query string.
 List findByNamedQuery(String queryName)
Execute a named query.
 List findByNamedQuery(String queryName, Object... values)
Execute a named query binding a number of values to "?" parameters in the query string.
 List findByNamedQuery(String queryName, Object value)
Execute a named query, binding one value to a "?" parameter in the query string.
 List findByNamedQueryAndNamedParam(String queryName, String[] paramNames, Object[] values)
Execute a named query, binding a number of values to ":" named parameters in the query string.
 List findByNamedQueryAndNamedParam(String queryName, String paramName, Object value)
Execute a named query, binding one value to a ":" named parameter in the query string.
 List findByNamedQueryAndValueBean(String queryName, Object valueBean)
Execute a named query, binding the properties of the given bean to ":" named parameters in the query string.
 List findByValueBean(String queryString, Object valueBean)
Execute an HQL query, binding the properties of the given bean to named parameters in the query string.
 void flush()
Flush all pending saves, updates and deletes to the database.
<T> T
get(Class<T> entityClass, Serializable id)
Return the persistent instance of the given entity class with the given identifier, or null if not found.
<T> T
get(Class<T> entityClass, Serializable id, org.hibernate.LockMode lockMode)
Return the persistent instance of the given entity class with the given identifier, or null if not found.
 Object get(String entityName, Serializable id)
Return the persistent instance of the given entity class with the given identifier, or null if not found.
 Object get(String entityName, Serializable id, org.hibernate.LockMode lockMode)
Return the persistent instance of the given entity class with the given identifier, or null if not found.
 int getFetchSize()
Return the fetch size specified for this HibernateTemplate.
 int getMaxResults()
Return the maximum number of rows specified for this HibernateTemplate.
 String getQueryCacheRegion()
Return the name of the cache region for queries executed by this template.
protected  org.hibernate.Session getSession()
Return a Session for use by this template.
 void initialize(Object proxy)
Force initialization of a Hibernate proxy or persistent collection.
 boolean isAllowCreate()
Return if a new Session should be created if no thread-bound found.
 boolean isAlwaysUseNewSession()
Return whether to always use a new Hibernate Session for this template.
 boolean isCacheQueries()
Return whether to cache all queries executed by this template.
 boolean isCheckWriteOperations()
Return whether to check that the Hibernate Session is not in read-only mode in case of write operations (save/update/delete).
 boolean isExposeNativeSession()
Return whether to expose the native Hibernate Session to HibernateCallback code, or rather a Session proxy.
 Iterator iterate(String queryString)
Execute a query for persistent instances.
 Iterator iterate(String queryString, Object... values)
Execute a query for persistent instances, binding a number of values to "?" parameters in the query string.
 Iterator iterate(String queryString, Object value)
Execute a query for persistent instances, binding one value to a "?" parameter in the query string.
<T> T
load(Class<T> entityClass, Serializable id)
Return the persistent instance of the given entity class with the given identifier, throwing an exception if not found.
<T> T
load(Class<T> entityClass, Serializable id, org.hibernate.LockMode lockMode)
Return the persistent instance of the given entity class with the given identifier, throwing an exception if not found.
 void load(Object entity, Serializable id)
Load the persistent instance with the given identifier into the given object, throwing an exception if not found.
 Object load(String entityName, Serializable id)
Return the persistent instance of the given entity class with the given identifier, throwing an exception if not found.
 Object load(String entityName, Serializable id, org.hibernate.LockMode lockMode)
Return the persistent instance of the given entity class with the given identifier, throwing an exception if not found.
<T> List<T>
loadAll(Class<T> entityClass)
Return all persistent instances of the given entity class.
 void lock(Object entity, org.hibernate.LockMode lockMode)
Obtain the specified lock level upon the given object, implicitly checking whether the corresponding database entry still exists.
 void lock(String entityName, Object entity, org.hibernate.LockMode lockMode)
Obtain the specified lock level upon the given object, implicitly checking whether the corresponding database entry still exists.
<T> T
merge(String entityName, T entity)
Copy the state of the given object onto the persistent object with the same identifier.
<T> T
merge(T entity)
Copy the state of the given object onto the persistent object with the same identifier.
 void persist(Object entity)
Persist the given transient instance.
 void persist(String entityName, Object entity)
Persist the given transient instance.
protected  void prepareCriteria(org.hibernate.Criteria criteria)
Prepare the given Criteria object, applying cache settings and/or a transaction timeout.
protected  void prepareQuery(org.hibernate.Query queryObject)
Prepare the given Query object, applying cache settings and/or a transaction timeout.
 void refresh(Object entity)
Re-read the state of the given persistent instance.
 void refresh(Object entity, org.hibernate.LockMode lockMode)
Re-read the state of the given persistent instance.
 void replicate(Object entity, org.hibernate.ReplicationMode replicationMode)
Persist the state of the given detached instance according to the given replication mode, reusing the current identifier value.
 void replicate(String entityName, Object entity, org.hibernate.ReplicationMode replicationMode)
Persist the state of the given detached instance according to the given replication mode, reusing the current identifier value.
 Serializable save(Object entity)
Persist the given transient instance.
 Serializable save(String entityName, Object entity)
Persist the given transient instance.
 void saveOrUpdate(Object entity)
Save or update the given persistent instance, according to its id (matching the configured "unsaved-value"?).
 void saveOrUpdate(String entityName, Object entity)
Save or update the given persistent instance, according to its id (matching the configured "unsaved-value"?).
 void saveOrUpdateAll(Collection entities)
Save or update all given persistent instances, according to its id (matching the configured "unsaved-value"?).
 void setAllowCreate(boolean allowCreate)
Set if a new Session should be created when no transactional Session can be found for the current thread.
 void setAlwaysUseNewSession(boolean alwaysUseNewSession)
Set whether to always use a new Hibernate Session for this template.
 void setCacheQueries(boolean cacheQueries)
Set whether to cache all queries executed by this template.
 void setCheckWriteOperations(boolean checkWriteOperations)
Set whether to check that the Hibernate Session is not in read-only mode in case of write operations (save/update/delete).
 void setExposeNativeSession(boolean exposeNativeSession)
Set whether to expose the native Hibernate Session to HibernateCallback code.
 void setFetchSize(int fetchSize)
Set the fetch size for this HibernateTemplate.
 void setMaxResults(int maxResults)
Set the maximum number of rows for this HibernateTemplate.
 void setQueryCacheRegion(String queryCacheRegion)
Set the name of the cache region for queries executed by this template.
 void update(Object entity)
Update the given persistent instance, associating it with the current Hibernate Session.
 void update(Object entity, org.hibernate.LockMode lockMode)
Update the given persistent instance, associating it with the current Hibernate Session.
 void update(String entityName, Object entity)
Update the given persistent instance, associating it with the current Hibernate Session.
 void update(String entityName, Object entity, org.hibernate.LockMode lockMode)
Update the given persistent instance, associating it with the current Hibernate Session.
Methods inherited from class org.springframework.orm.hibernate3.HibernateAccessor
afterPropertiesSet, applyFlushMode, convertHibernateAccessException, convertJdbcAccessException, convertJdbcAccessException, disableFilters, enableFilters, flushIfNecessary, getDefaultJdbcExceptionTranslator, getEntityInterceptor, getFilterNames, getFlushMode, getJdbcExceptionTranslator, getSessionFactory, setBeanFactory, setEntityInterceptor, setEntityInterceptorBeanName, setFilterName, setFilterNames, setFlushMode, setFlushModeName, setJdbcExceptionTranslator, setSessionFactory
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

HibernateTemplate

public HibernateTemplate()
Create a new HibernateTemplate instance.

HibernateTemplate

public HibernateTemplate(org.hibernate.SessionFactory sessionFactory)
Create a new HibernateTemplate instance.

Parameters:
sessionFactory - SessionFactory to create Sessions

HibernateTemplate

public HibernateTemplate(org.hibernate.SessionFactory sessionFactory,
                         boolean allowCreate)
Create a new HibernateTemplate instance.

Parameters:
sessionFactory - SessionFactory to create Sessions
allowCreate - if a non-transactional Session should be created when no transactional Session can be found for the current thread
Method Detail

setAllowCreate

public void setAllowCreate(boolean allowCreate)
Set if a new Session should be created when no transactional Session can be found for the current thread. The default value is true.

HibernateTemplate is aware of a corresponding Session bound to the current thread, for example when using HibernateTransactionManager. If allowCreate is true, a new non-transactional Session will be created if none is found, which needs to be closed at the end of the operation. If false, an IllegalStateException will get thrown in this case.

NOTE: As of Spring 2.5, switching allowCreate to false will delegate to Hibernate's SessionFactory.getCurrentSession() method, which - with Spring-based setup - will by default delegate to Spring's SessionFactoryUtils.getSession(sessionFactory, false). This mode also allows for custom Hibernate CurrentSessionContext strategies to be plugged in, whereas allowCreate set to true will always use a Spring-managed Hibernate Session.

See Also:
SessionFactoryUtils.getSession(SessionFactory, boolean)

isAllowCreate

public boolean isAllowCreate()
Return if a new Session should be created if no thread-bound found.

setAlwaysUseNewSession

public void setAlwaysUseNewSession(boolean alwaysUseNewSession)
Set whether to always use a new Hibernate Session for this template. Default is "false"; if activated, all operations on this template will work on a new Hibernate Session even in case of a pre-bound Session (for example, within a transaction or OpenSessionInViewFilter).

Within a transaction, a new Hibernate Session used by this template will participate in the transaction through using the same JDBC Connection. In such a scenario, multiple Sessions will participate in the same database transaction.

Turn this on for operations that are supposed to always execute independently, without side effects caused by a shared Hibernate Session.

isAlwaysUseNewSession

public boolean isAlwaysUseNewSession()
Return whether to always use a new Hibernate Session for this template.

setExposeNativeSession

public void setExposeNativeSession(boolean exposeNativeSession)
Set whether to expose the native Hibernate Session to HibernateCallback code.

Default is "false": a Session proxy will be returned, suppressing close calls and automatically applying query cache settings and transaction timeouts.

See Also:
HibernateCallback, Session, setCacheQueries(boolean), setQueryCacheRegion(java.lang.String), prepareQuery(org.hibernate.Query), prepareCriteria(org.hibernate.Criteria)

isExposeNativeSession

public boolean isExposeNativeSession()
Return whether to expose the native Hibernate Session to HibernateCallback code, or rather a Session proxy.

setCheckWriteOperations

public void setCheckWriteOperations(boolean checkWriteOperations)
Set whether to check that the Hibernate Session is not in read-only mode in case of write operations (save/update/delete).

Default is "true", for fail-fast behavior when attempting write operations within a read-only transaction. Turn this off to allow save/update/delete on a Session with flush mode NEVER.

See Also:
HibernateAccessor.setFlushMode(int),
checkWriteOperationAllowed(org.hibernate.Session),
TransactionDefinition.isReadOnly()

isCheckWriteOperations

public boolean isCheckWriteOperations()
Return whether to check that the Hibernate Session is not in read-only mode in case of write operations (save/update/delete).

setCacheQueries

public void setCacheQueries(boolean cacheQueries)
Set whether to cache all queries executed by this template.

If this is "true", all Query and Criteria objects created by this template will be marked as cacheable (including all queries through find methods).

To specify the query region to be used for queries cached by this template, set the "queryCacheRegion" property.

See Also:
setQueryCacheRegion(java.lang.String),
Query.setCacheable(boolean),
Criteria.setCacheable(boolean)

isCacheQueries

public boolean isCacheQueries()
Return whether to cache all queries executed by this template.

setQueryCacheRegion

public void setQueryCacheRegion(String queryCacheRegion)
Set the name of the cache region for queries executed by this template.

If this is specified, it will be applied to all Query and Criteria objects created by this template (including all queries through find methods).

The cache region will not take effect unless queries created by this template are configured to be cached via the "cacheQueries" property.

See Also:
setCacheQueries(boolean), Query.setCacheRegion(java.lang.String), Criteria.setCacheRegion(java.lang.String)

getQueryCacheRegion

public String getQueryCacheRegion()
Return the name of the cache region for queries executed by this template.

setFetchSize

public void setFetchSize(int fetchSize)
Set the fetch size for this HibernateTemplate. This is important for processing large result sets: Setting this higher than the default value will increase processing speed at the cost of memory consumption; setting this lower can avoid transferring row data that will never be read by the application.

Default is 0, indicating to use the JDBC driver's default.

getFetchSize

public int getFetchSize()
Return the fetch size specified for this HibernateTemplate.

setMaxResults

public void setMaxResults(int maxResults)
Set the maximum number of rows for this HibernateTemplate. This is important for processing subsets of large result sets, avoiding to read and hold the entire result set in the database or in the JDBC driver if we're never interested in the entire result in the first place (for example, when performing searches that might return a large number of matches).

Default is 0, indicating to use the JDBC driver's default.

getMaxResults

public int getMaxResults()
Return the maximum number of rows specified for this HibernateTemplate.

execute

public <T> T execute(HibernateCallback<T> action)
          throws DataAccessException
Description copied from interface: HibernateOperations
Execute the action specified by the given action object within a Session.

Application exceptions thrown by the action object get propagated to the caller (can only be unchecked). Hibernate exceptions are transformed into appropriate DAO ones. Allows for returning a result object, that is a domain object or a collection of domain objects.

Note: Callback code is not supposed to handle transactions itself! Use an appropriate transaction manager like HibernateTransactionManager. Generally, callback code must not touch any Session lifecycle methods, like close, disconnect, or reconnect, to let the template do its work.

Specified by:
execute in interface HibernateOperations
Parameters:
action - callback object that specifies the Hibernate action
Returns:
a result object returned by the action, or null
Throws:
DataAccessException - in case of Hibernate errors
See Also:
HibernateTransactionManager, org.springframework.dao, org.springframework.transaction, Session

executeFind

public List executeFind(HibernateCallback<?> action)
                 throws DataAccessException
Description copied from interface: HibernateOperations
Execute the specified action assuming that the result object is a List.

This is a convenience method for executing Hibernate find calls or queries within an action.

Specified by:
executeFind in interface HibernateOperations
Parameters:
action - calback object that specifies the Hibernate action
Returns:
a List result returned by the action, or null
Throws:
DataAccessException - in case of Hibernate errors

executeWithNewSession

public <T> T executeWithNewSession(HibernateCallback<T> action)
Execute the action specified by the given action object within a new Session.

This execute variant overrides the template-wide "alwaysUseNewSession" setting.

Parameters:
action - callback object that specifies the Hibernate action
Returns:
a result object returned by the action, or null
Throws:
DataAccessException - in case of Hibernate errors

executeWithNativeSession

public <T> T executeWithNativeSession(HibernateCallback<T> action)
Execute the action specified by the given action object within a native Session.

This execute variant overrides the template-wide "exposeNativeSession" setting.

Parameters:
action - callback object that specifies the Hibernate action
Returns:
a result object returned by the action, or null
Throws:
DataAccessException - in case of Hibernate errors

doExecute

protected <T> T doExecute(HibernateCallback<T> action,
                          boolean enforceNewSession,
                          boolean enforceNativeSession)
               throws DataAccessException
Execute the action specified by the given action object within a Session.

Parameters:
action - callback object that specifies the Hibernate action
enforceNewSession - whether to enforce a new Session for this template even if there is a pre-bound transactional Session
enforceNativeSession - whether to enforce exposure of the native Hibernate Session to callback code
Returns:
a result object returned by the action, or null
Throws:
DataAccessException - in case of Hibernate errors

getSession

protected org.hibernate.Session getSession()
Return a Session for use by this template.

Returns a new Session in case of "alwaysUseNewSession" (using the same JDBC Connection as a transactional Session, if applicable), a pre-bound Session in case of "allowCreate" turned off, and a pre-bound or new Session otherwise (new only if no transactional or otherwise pre-bound Session exists).

Returns:
the Session to use (never null)
See Also:
SessionFactoryUtils.getSession(org.hibernate.SessionFactory, boolean), SessionFactoryUtils.getNewSession(org.hibernate.SessionFactory), setAlwaysUseNewSession(boolean), setAllowCreate(boolean)

createSessionProxy

protected org.hibernate.Session createSessionProxy(org.hibernate.Session session)
Create a close-suppressing proxy for the given Hibernate Session. The proxy also prepares returned Query and Criteria objects.

Parameters:
session - the Hibernate Session to create a proxy for
Returns:
the Session proxy
See Also:
Session.close(),
prepareQuery(org.hibernate.Query),
prepareCriteria(org.hibernate.Criteria)

get

public <T> T get(Class<T> entityClass,
                 Serializable id)
      throws DataAccessException
Description copied from interface: HibernateOperations
Return the persistent instance of the given entity class with the given identifier, or null if not found.

This method is a thin wrapper around Session.get(Class, java.io.Serializable) for convenience. For an explanation of the exact semantics of this method, please do refer to the Hibernate API documentation in the first instance.

Specified by:
get in interface HibernateOperations
Parameters:
entityClass - a persistent class
id - the identifier of the persistent instance
Returns:
the persistent instance, or null if not found
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.get(Class, java.io.Serializable)

get

public <T> T get(Class<T> entityClass,
                 Serializable id,
                 org.hibernate.LockMode lockMode)
      throws DataAccessException
Description copied from interface: HibernateOperations
Return the persistent instance of the given entity class with the given identifier, or null if not found.

Obtains the specified lock mode if the instance exists.

This method is a thin wrapper around Session.get(Class, java.io.Serializable, LockMode) for convenience. For an explanation of the exact semantics of this method, please do refer to the Hibernate API documentation in the first instance.

Specified by:
get in interface HibernateOperations
Parameters:
entityClass - a persistent class
id - the identifier of the persistent instance
lockMode - the lock mode to obtain
Returns:
the persistent instance, or null if not found
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.get(Class, java.io.Serializable, org.hibernate.LockMode)

get

public Object get(String entityName,
                  Serializable id)
           throws DataAccessException
Description copied from interface: HibernateOperations
Return the persistent instance of the given entity class with the given identifier, or null if not found.

This method is a thin wrapper around Session.get(String, java.io.Serializable) for convenience. For an explanation of the exact semantics of this method, please do refer to the Hibernate API documentation in the first instance.

Specified by:
get in interface HibernateOperations
Parameters:
entityName - the name of the persistent entity
id - the identifier of the persistent instance
Returns:
the persistent instance, or null if not found
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.get(Class, java.io.Serializable)

get

public Object get(String entityName,
                  Serializable id,
                  org.hibernate.LockMode lockMode)
           throws DataAccessException
Description copied from interface: HibernateOperations
Return the persistent instance of the given entity class with the given identifier, or null if not found. Obtains the specified lock mode if the instance exists.

This method is a thin wrapper around Session.get(String, java.io.Serializable, LockMode) for convenience. For an explanation of the exact semantics of this method, please do refer to the Hibernate API documentation in the first instance.

Specified by:
get in interface HibernateOperations
Parameters:
entityName - the name of the persistent entity
id - the identifier of the persistent instance
lockMode - the lock mode to obtain
Returns:
the persistent instance, or null if not found
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.get(Class, java.io.Serializable, org.hibernate.LockMode)

load

public <T> T load(Class<T> entityClass,
                  Serializable id)
       throws DataAccessException
Description copied from interface: HibernateOperations
Return the persistent instance of the given entity class with the given identifier, throwing an exception if not found.

This method is a thin wrapper around Session.load(Class, java.io.Serializable) for convenience. For an explanation of the exact semantics of this method, please do refer to the Hibernate API documentation in the first instance.

Specified by:
load in interface HibernateOperations
Parameters:
entityClass - a persistent class
id - the identifier of the persistent instance
Returns:
the persistent instance
Throws:
ObjectRetrievalFailureException - if not found
DataAccessException - in case of Hibernate errors
See Also:
Session.load(Class, java.io.Serializable)

load

public <T> T load(Class<T> entityClass,
                  Serializable id,
                  org.hibernate.LockMode lockMode)
       throws DataAccessException
Description copied from interface: HibernateOperations
Return the persistent instance of the given entity class with the given identifier, throwing an exception if not found. Obtains the specified lock mode if the instance exists.

This method is a thin wrapper around Session.load(Class, java.io.Serializable, LockMode) for convenience. For an explanation of the exact semantics of this method, please do refer to the Hibernate API documentation in the first instance.

Specified by:
load in interface HibernateOperations
Parameters:
entityClass - a persistent class
id - the identifier of the persistent instance
lockMode - the lock mode to obtain
Returns:
the persistent instance
Throws:
ObjectRetrievalFailureException - if not found
DataAccessException - in case of Hibernate errors
See Also:
Session.load(Class, java.io.Serializable)

load

public Object load(String entityName,
                   Serializable id)
            throws DataAccessException
Description copied from interface: HibernateOperations
Return the persistent instance of the given entity class with the given identifier, throwing an exception if not found.

This method is a thin wrapper around Session.load(String, java.io.Serializable) for convenience. For an explanation of the exact semantics of this method, please do refer to the Hibernate API documentation in the first instance.

Specified by:
load in interface HibernateOperations
Parameters:
entityName - the name of the persistent entity
id - the identifier of the persistent instance
Returns:
the persistent instance
Throws:
ObjectRetrievalFailureException - if not found
DataAccessException - in case of Hibernate errors
See Also:
Session.load(Class, java.io.Serializable)

load

public Object load(String entityName,
                   Serializable id,
                   org.hibernate.LockMode lockMode)
            throws DataAccessException
Description copied from interface: HibernateOperations
Return the persistent instance of the given entity class with the given identifier, throwing an exception if not found.

Obtains the specified lock mode if the instance exists.

This method is a thin wrapper around Session.load(String, java.io.Serializable, LockMode) for convenience. For an explanation of the exact semantics of this method, please do refer to the Hibernate API documentation in the first instance.

Specified by:
load in interface HibernateOperations
Parameters:
entityName - the name of the persistent entity
id - the identifier of the persistent instance
lockMode - the lock mode to obtain
Returns:
the persistent instance
Throws:
ObjectRetrievalFailureException - if not found
DataAccessException - in case of Hibernate errors
See Also:
Session.load(Class, java.io.Serializable)

loadAll

public <T> List<T> loadAll(Class<T> entityClass)
                throws DataAccessException
Description copied from interface: HibernateOperations
Return all persistent instances of the given entity class. Note: Use queries or criteria for retrieving a specific subset.

Specified by:
loadAll in interface HibernateOperations
Parameters:
entityClass - a persistent class
Returns:
a List containing 0 or more persistent instances
Throws:
DataAccessException - if there is a Hibernate error
See Also:
Session.createCriteria(java.lang.Class)

load

public void load(Object entity,
                 Serializable id)
          throws DataAccessException
Description copied from interface: HibernateOperations
Load the persistent instance with the given identifier into the given object, throwing an exception if not found.

This method is a thin wrapper around Session.load(Object, java.io.Serializable) for convenience. For an explanation of the exact semantics of this method, please do refer to the Hibernate API documentation in the first instance.

Specified by:
load in interface HibernateOperations
Parameters:
entity - the object (of the target class) to load into
id - the identifier of the persistent instance
Throws:
ObjectRetrievalFailureException - if not found
DataAccessException - in case of Hibernate errors
See Also:
Session.load(Object, java.io.Serializable)

refresh

public void refresh(Object entity)
             throws DataAccessException
Description copied from interface: HibernateOperations
Re-read the state of the given persistent instance.

Specified by:
refresh in interface HibernateOperations
Parameters:
entity - the persistent instance to re-read
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.refresh(Object)

refresh

public void refresh(Object entity,
                    org.hibernate.LockMode lockMode)
             throws DataAccessException
Description copied from interface: HibernateOperations
Re-read the state of the given persistent instance. Obtains the specified lock mode for the instance.

Specified by:
refresh in interface HibernateOperations
Parameters:
entity - the persistent instance to re-read
lockMode - the lock mode to obtain
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.refresh(Object, org.hibernate.LockMode)

contains

public boolean contains(Object entity)
                 throws DataAccessException
Description copied from interface: HibernateOperations
Check whether the given object is in the Session cache.

Specified by:
contains in interface HibernateOperations
Parameters:
entity - the persistence instance to check
Returns:
whether the given object is in the Session cache
Throws:
DataAccessException - if there is a Hibernate error
See Also:
Session.contains(java.lang.Object)

evict

public void evict(Object entity)
           throws DataAccessException
Description copied from interface: HibernateOperations
Remove the given object from the Session cache.

Specified by:
evict in interface HibernateOperations
Parameters:
entity - the persistent instance to evict
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.evict(java.lang.Object)

initialize

public void initialize(Object proxy)
                throws DataAccessException
Description copied from interface: HibernateOperations
Force initialization of a Hibernate proxy or persistent collection.

Specified by:
initialize in interface HibernateOperations
Parameters:
proxy - a proxy for a persistent object or a persistent collection
Throws:
DataAccessException - if we can't initialize the proxy, for example because it is not associated with an active Session
See Also:
Hibernate.initialize(java.lang.Object)

enableFilter

public org.hibernate.Filter enableFilter(String filterName)
                                  throws IllegalStateException
Description copied from interface: HibernateOperations
Return an enabled Hibernate Filter for the given filter name. The returned Filter instance can be used to set filter parameters.

Specified by:
enableFilter in interface HibernateOperations
Parameters:
filterName - the name of the filter
Returns:
the enabled Hibernate Filter (either already enabled or enabled on the fly by this operation)
Throws:
IllegalStateException - if we are not running within a transactional Session (in which case this operation does not make sense)

lock

public void lock(Object entity,
                 org.hibernate.LockMode lockMode)
          throws DataAccessException
Description copied from interface: HibernateOperations
Obtain the specified lock level upon the given object, implicitly checking whether the corresponding database entry still exists.

Specified by:
lock in interface HibernateOperations
Parameters:
entity - the persistent instance to lock
lockMode - the lock mode to obtain
Throws:
ObjectOptimisticLockingFailureException - if not found
DataAccessException - in case of Hibernate errors
See Also:
Session.lock(Object, org.hibernate.LockMode)

lock

public void lock(String entityName,
                 Object entity,
                 org.hibernate.LockMode lockMode)
          throws DataAccessException
Description copied from interface: HibernateOperations
Obtain the specified lock level upon the given object, implicitly checking whether the corresponding database entry still exists.

Specified by:
lock in interface HibernateOperations
Parameters:
entityName - the name of the persistent entity
entity - the persistent instance to lock
lockMode - the lock mode to obtain
Throws:
ObjectOptimisticLockingFailureException - if not found
DataAccessException - in case of Hibernate errors
See Also:
Session.lock(String, Object, org.hibernate.LockMode)

save

public Serializable save(Object entity)
                  throws DataAccessException
Description copied from interface: HibernateOperations
Persist the given transient instance.

Specified by:
save in interface HibernateOperations
Parameters:
entity - the transient instance to persist
Returns:
the generated identifier
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.save(Object)

save

public Serializable save(String entityName,
                         Object entity)
                  throws DataAccessException
Description copied from interface: HibernateOperations
Persist the given transient instance.

Specified by:
save in interface HibernateOperations
Parameters:
entityName - the name of the persistent entity
entity - the transient instance to persist
Returns:
the generated identifier
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.save(String, Object)

update

public void update(Object entity)
            throws DataAccessException
Description copied from interface: HibernateOperations
Update the given persistent instance, associating it with the current Hibernate Session.

Specified by:
update in interface HibernateOperations
Parameters:
entity - the persistent instance to update
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.update(Object)

update

public void update(Object entity,
                   org.hibernate.LockMode lockMode)
            throws DataAccessException
Description copied from interface: HibernateOperations
Update the given persistent instance, associating it with the current Hibernate Session.

Obtains the specified lock mode if the instance exists, implicitly checking whether the corresponding database entry still exists.

Specified by:
update in interface HibernateOperations
Parameters:
entity - the persistent instance to update
lockMode - the lock mode to obtain
Throws:
ObjectOptimisticLockingFailureException - if not found
DataAccessException - in case of Hibernate errors
See Also:
Session.update(Object)

update

public void update(String entityName,
                   Object entity)
            throws DataAccessException
Description copied from interface: HibernateOperations
Update the given persistent instance, associating it with the current Hibernate Session.

Specified by:
update in interface HibernateOperations
Parameters:
entityName - the name of the persistent entity
entity - the persistent instance to update
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.update(String, Object)

update

public void update(String entityName,
                   Object entity,
                   org.hibernate.LockMode lockMode)
            throws DataAccessException
Description copied from interface: HibernateOperations
Update the given persistent instance, associating it with the current Hibernate Session.

Obtains the specified lock mode if the instance exists, implicitly checking whether the corresponding database entry still exists.

Specified by:
update in interface HibernateOperations
Parameters:
entityName - the name of the persistent entity
entity - the persistent instance to update
lockMode - the lock mode to obtain
Throws:
ObjectOptimisticLockingFailureException - if not found
DataAccessException - in case of Hibernate errors
See Also:
Session.update(String, Object)

saveOrUpdate

public void saveOrUpdate(Object entity)
                  throws DataAccessException
Description copied from interface: HibernateOperations
Save or update the given persistent instance, according to its id (matching the configured "unsaved-value"?). Associates the instance with the current Hibernate Session.

Specified by:
saveOrUpdate in interface HibernateOperations
Parameters:
entity - the persistent instance to save or update (to be associated with the Hibernate Session)
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.saveOrUpdate(Object)

saveOrUpdate

public void saveOrUpdate(String entityName,
                         Object entity)
                  throws DataAccessException
Description copied from interface: HibernateOperations
Save or update the given persistent instance, according to its id (matching the configured "unsaved-value"?). Associates the instance with the current Hibernate Session.

Specified by:
saveOrUpdate in interface HibernateOperations
Parameters:
entityName - the name of the persistent entity
entity - the persistent instance to save or update (to be associated with the Hibernate Session)
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.saveOrUpdate(String, Object)

saveOrUpdateAll

public void saveOrUpdateAll(Collection entities)
                     throws DataAccessException
Description copied from interface: HibernateOperations
Save or update all given persistent instances, according to its id (matching the configured "unsaved-value"?). Associates the instances with the current Hibernate Session.

Specified by:
saveOrUpdateAll in interface HibernateOperations
Parameters:
entities - the persistent instances to save or update (to be associated with the Hibernate Session)
Throws:
DataAccessException - in case of Hibernate errors

replicate

public void replicate(Object entity,
                      org.hibernate.ReplicationMode replicationMode)
               throws DataAccessException
Description copied from interface: HibernateOperations
Persist the state of the given detached instance according to the given replication mode, reusing the current identifier value.

Specified by:
replicate in interface HibernateOperations
Parameters:
entity - the persistent object to replicate
replicationMode - the Hibernate ReplicationMode
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.replicate(Object, org.hibernate.ReplicationMode)

replicate

public void replicate(String entityName,
                      Object entity,
                      org.hibernate.ReplicationMode replicationMode)
               throws DataAccessException
Description copied from interface: HibernateOperations
Persist the state of the given detached instance according to the given replication mode, reusing the current identifier value.

Specified by:
replicate in interface HibernateOperations
Parameters:
entityName - the name of the persistent entity
entity - the persistent object to replicate
replicationMode - the Hibernate ReplicationMode
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.replicate(String, Object, org.hibernate.ReplicationMode)

persist

public void persist(Object entity)
             throws DataAccessException
Description copied from interface: HibernateOperations
Persist the given transient instance. Follows JSR-220 semantics.

Similar to save, associating the given object with the current Hibernate Session.

Specified by:
persist in interface HibernateOperations
Parameters:
entity - the persistent instance to persist
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.persist(Object), HibernateOperations.save(java.lang.Object)

persist

public void persist(String entityName,
                    Object entity)
             throws DataAccessException
Description copied from interface: HibernateOperations
Persist the given transient instance. Follows JSR-220 semantics.

Similar to save, associating the given object with the current Hibernate Session.

Specified by:
persist in interface HibernateOperations
Parameters:
entityName - the name of the persistent entity
entity - the persistent instance to persist
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.persist(String, Object), HibernateOperations.save(java.lang.Object)

merge

public <T> T merge(T entity)
        throws DataAccessException
Description copied from interface: HibernateOperations
Copy the state of the given object onto the persistent object with the same identifier. Follows JSR-220 semantics.

Similar to saveOrUpdate, but never associates the given object with the current Hibernate Session. In case of a new entity, the state will be copied over as well.

Note that merge will not update the identifiers in the passed-in object graph (in contrast to TopLink)! Consider registering Spring's IdTransferringMergeEventListener if you would like to have newly assigned ids transferred to the original object graph too.

Specified by:
merge in interface HibernateOperations
Parameters:
entity - the object to merge with the corresponding persistence instance
Returns:
the updated, registered persistent instance
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.merge(Object), HibernateOperations.saveOrUpdate(java.lang.Object), IdTransferringMergeEventListener

merge

public <T> T merge(String entityName,
                   T entity)
        throws DataAccessException
Description copied from interface: HibernateOperations
Copy the state of the given object onto the persistent object with the same identifier. Follows JSR-220 semantics.

Similar to saveOrUpdate, but never associates the given object with the current Hibernate Session. In the case of a new entity, the state will be copied over as well.

Note that merge will not update the identifiers in the passed-in object graph (in contrast to TopLink)! Consider registering Spring's IdTransferringMergeEventListener if you would like to have newly assigned ids transferred to the original object graph too.

Specified by:
merge in interface HibernateOperations
Parameters:
entityName - the name of the persistent entity
entity - the object to merge with the corresponding persistence instance
Returns:
the updated, registered persistent instance
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.merge(String, Object), HibernateOperations.saveOrUpdate(java.lang.Object)

delete

public void delete(Object entity)
            throws DataAccessException
Description copied from interface: HibernateOperations
Delete the given persistent instance.

Specified by:
delete in interface HibernateOperations
Parameters:
entity - the persistent instance to delete
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.delete(Object)

delete

public void delete(Object entity,
                   org.hibernate.LockMode lockMode)
            throws DataAccessException
Description copied from interface: HibernateOperations
Delete the given persistent instance.

Obtains the specified lock mode if the instance exists, implicitly checking whether the corresponding database entry still exists.

Specified by:
delete in interface HibernateOperations
Parameters:
entity - the persistent instance to delete
lockMode - the lock mode to obtain
Throws:
ObjectOptimisticLockingFailureException - if not found
DataAccessException - in case of Hibernate errors
See Also:
Session.delete(Object)

delete

public void delete(String entityName,
                   Object entity)
            throws DataAccessException
Description copied from interface: HibernateOperations
Delete the given persistent instance.

Specified by:
delete in interface HibernateOperations
Parameters:
entityName - the name of the persistent entity
entity - the persistent instance to delete
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.delete(Object)

delete

public void delete(String entityName,
                   Object entity,
                   org.hibernate.LockMode lockMode)
            throws DataAccessException
Description copied from interface: HibernateOperations
Delete the given persistent instance.

Obtains the specified lock mode if the instance exists, implicitly checking whether the corresponding database entry still exists.

Specified by:
delete in interface HibernateOperations
Parameters:
entityName - the name of the persistent entity
entity - the persistent instance to delete
lockMode - the lock mode to obtain
Throws:
ObjectOptimisticLockingFailureException - if not found
DataAccessException - in case of Hibernate errors
See Also:
Session.delete(Object)

deleteAll

public void deleteAll(Collection entities)
               throws DataAccessException
Description copied from interface: HibernateOperations
Delete all given persistent instances.

This can be combined with any of the find methods to delete by query in two lines of code.

Specified by:
deleteAll in interface HibernateOperations
Parameters:
entities - the persistent instances to delete
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.delete(Object)

flush

public void flush()
           throws DataAccessException
Description copied from interface: HibernateOperations
Flush all pending saves, updates and deletes to the database.

Only invoke this for selective eager flushing, for example when JDBC code needs to see certain changes within the same transaction. Else, it is preferable to rely on auto-flushing at transaction completion.

Specified by:
flush in interface HibernateOperations
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.flush()

clear

public void clear()
           throws DataAccessException
Description copied from interface: HibernateOperations
Remove all objects from the Session cache, and cancel all pending saves, updates and deletes.

Specified by:
clear in interface HibernateOperations
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.clear()

find

public List find(String queryString)
          throws DataAccessException
Description copied from interface: HibernateOperations
Execute an HQL query.

Specified by:
find in interface HibernateOperations
Parameters:
queryString - a query expressed in Hibernate's query language
Returns:
a List containing the results of the query execution
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.createQuery(java.lang.String)

find

public List find(String queryString,
                 Object value)
          throws DataAccessException
Description copied from interface: HibernateOperations
Execute an HQL query, binding one value to a "?" parameter in the query string.

Specified by:
find in interface HibernateOperations
Parameters:
queryString - a query expressed in Hibernate's query language
value - the value of the parameter
Returns:
a List containing the results of the query execution
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.createQuery(java.lang.String)

find

public List find(String queryString,
                 Object... values)
          throws DataAccessException
Description copied from interface: HibernateOperations
Execute an HQL query, binding a number of values to "?" parameters in the query string.

Specified by:
find in interface HibernateOperations
Parameters:
queryString - a query expressed in Hibernate's query language
values - the values of the parameters
Returns:
a List containing the results of the query execution
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.createQuery(java.lang.String)

findByNamedParam

public List findByNamedParam(String queryString,
                             String paramName,
                             Object value)
                      throws DataAccessException
Description copied from interface: HibernateOperations
Execute an HQL query, binding one value to a ":" named parameter in the query string.

Specified by:
findByNamedParam in interface HibernateOperations
Parameters:
queryString - a query expressed in Hibernate's query language
paramName - the name of the parameter
value - the value of the parameter
Returns:
a List containing the results of the query execution
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.getNamedQuery(String)

findByNamedParam

public List findByNamedParam(String queryString,
                             String[] paramNames,
                             Object[] values)
                      throws DataAccessException
Description copied from interface: HibernateOperations
Execute an HQL query, binding a number of values to ":" named parameters in the query string.

Specified by:
findByNamedParam in interface HibernateOperations
Parameters:
queryString - a query expressed in Hibernate's query language
paramNames - the names of the parameters
values - the values of the parameters
Returns:
a List containing the results of the query execution
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.getNamedQuery(String)

findByValueBean

public List findByValueBean(String queryString,
                            Object valueBean)
                     throws DataAccessException
Description copied from interface: HibernateOperations
Execute an HQL query, binding the properties of the given bean to named parameters in the query string.

Specified by:
findByValueBean in interface HibernateOperations
Parameters:
queryString - a query expressed in Hibernate's query language
valueBean - the values of the parameters
Returns:
a List containing the results of the query execution
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Query.setProperties(java.lang.Object), Session.createQuery(java.lang.String)

findByNamedQuery

public List findByNamedQuery(String queryName)
                      throws DataAccessException
Description copied from interface: HibernateOperations
Execute a named query.

A named query is defined in a Hibernate mapping file.

Specified by:
findByNamedQuery in interface HibernateOperations
Parameters:
queryName - the name of a Hibernate query in a mapping file
Returns:
a List containing the results of the query execution
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.getNamedQuery(String)

findByNamedQuery

public List findByNamedQuery(String queryName,
                             Object value)
                      throws DataAccessException
Description copied from interface: HibernateOperations
Execute a named query, binding one value to a "?" parameter in the query string.

A named query is defined in a Hibernate mapping file.

Specified by:
findByNamedQuery in interface HibernateOperations
Parameters:
queryName - the name of a Hibernate query in a mapping file
value - the value of the parameter
Returns:
a List containing the results of the query execution
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.getNamedQuery(String)

findByNamedQuery

public List findByNamedQuery(String queryName,
                             Object... values)
                      throws DataAccessException
Description copied from interface: HibernateOperations
Execute a named query binding a number of values to "?" parameters in the query string.

A named query is defined in a Hibernate mapping file.

Specified by:
findByNamedQuery in interface HibernateOperations
Parameters:
queryName - the name of a Hibernate query in a mapping file
values - the values of the parameters
Returns:
a List containing the results of the query execution
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.getNamedQuery(String)

findByNamedQueryAndNamedParam

public List findByNamedQueryAndNamedParam(String queryName,
                                          String paramName,
                                          Object value)
                                   throws DataAccessException
Description copied from interface: HibernateOperations
Execute a named query, binding one value to a ":" named parameter in the query string.

A named query is defined in a Hibernate mapping file.

Specified by:
findByNamedQueryAndNamedParam in interface HibernateOperations
Parameters:
queryName - the name of a Hibernate query in a mapping file
paramName - the name of parameter
value - the value of the parameter
Returns:
a List containing the results of the query execution
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.getNamedQuery(String)

findByNamedQueryAndNamedParam

public List findByNamedQueryAndNamedParam(String queryName,
                                          String[] paramNames,
                                          Object[] values)
                                   throws DataAccessException
Description copied from interface: HibernateOperations
Execute a named query, binding a number of values to ":" named parameters in the query string.

A named query is defined in a Hibernate mapping file.

Specified by:
findByNamedQueryAndNamedParam in interface HibernateOperations
Parameters:
queryName - the name of a Hibernate query in a mapping file
paramNames - the names of the parameters
values - the values of the parameters
Returns:
a List containing the results of the query execution
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.getNamedQuery(String)

findByNamedQueryAndValueBean

public List findByNamedQueryAndValueBean(String queryName,
                                         Object valueBean)
                                  throws DataAccessException
Description copied from interface: HibernateOperations
Execute a named query, binding the properties of the given bean to ":" named parameters in the query string.

A named query is defined in a Hibernate mapping file.

Specified by:
findByNamedQueryAndValueBean in interface HibernateOperations
Parameters:
queryName - the name of a Hibernate query in a mapping file
valueBean - the values of the parameters
Returns:
a List containing the results of the query execution
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Query.setProperties(java.lang.Object), Session.getNamedQuery(String)

findByCriteria

public List findByCriteria(org.hibernate.criterion.DetachedCriteria criteria)
                    throws DataAccessException
Description copied from interface: HibernateOperations
Execute a query based on a given Hibernate criteria object.

Specified by:
findByCriteria in interface HibernateOperations
Parameters:
criteria - the detached Hibernate criteria object. Note: Do not reuse criteria objects! They need to recreated per execution, due to the suboptimal design of Hibernate's criteria facility.
Returns:
a List containing 0 or more persistent instances
Throws:
DataAccessException - in case of Hibernate errors
See Also:
DetachedCriteria.getExecutableCriteria(org.hibernate.Session)

findByCriteria

public List findByCriteria(org.hibernate.criterion.DetachedCriteria criteria,
                           int firstResult,
                           int maxResults)
                    throws DataAccessException
Description copied from interface: HibernateOperations
Execute a query based on the given Hibernate criteria object.

Specified by:
findByCriteria in interface HibernateOperations
Parameters:
criteria - the detached Hibernate criteria object. Note: Do not reuse criteria objects! They need to recreated per execution, due to the suboptimal design of Hibernate's criteria facility.
firstResult - the index of the first result object to be retrieved (numbered from 0)
maxResults - the maximum number of result objects to retrieve (or <=0 for no limit)
Returns:
a List containing 0 or more persistent instances
Throws:
DataAccessException - in case of Hibernate errors
See Also:
DetachedCriteria.getExecutableCriteria(org.hibernate.Session),
Criteria.setFirstResult(int),
Criteria.setMaxResults(int)

findByExample

public List findByExample(Object exampleEntity)
                   throws DataAccessException
Description copied from interface: HibernateOperations
Execute a query based on the given example entity object.

Specified by:
findByExample in interface HibernateOperations
Parameters:
exampleEntity - an instance of the desired entity, serving as example for "query-by-example"
Returns:
a List containing 0 or more persistent instances
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Example.create(Object)

findByExample

public List findByExample(String entityName,
                          Object exampleEntity)
                   throws DataAccessException
Description copied from interface: HibernateOperations
Execute a query based on the given example entity object.

Specified by:
findByExample in interface HibernateOperations
Parameters:
entityName - the name of the persistent entity
exampleEntity - an instance of the desired entity, serving as example for "query-by-example"
Returns:
a List containing 0 or more persistent instances
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Example.create(Object)

findByExample

public List findByExample(Object exampleEntity,
                          int firstResult,
                          int maxResults)
                   throws DataAccessException
Description copied from interface: HibernateOperations
Execute a query based on a given example entity object.

Specified by:
findByExample in interface HibernateOperations
Parameters:
exampleEntity - an instance of the desired entity, serving as example for "query-by-example"
firstResult - the index of the first result object to be retrieved (numbered from 0)
maxResults - the maximum number of result objects to retrieve (or <=0 for no limit)
Returns:
a List containing 0 or more persistent instances
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Example.create(Object),
Criteria.setFirstResult(int),
Criteria.setMaxResults(int)

findByExample

public List findByExample(String entityName,
                          Object exampleEntity,
                          int firstResult,
                          int maxResults)
                   throws DataAccessException
Description copied from interface: HibernateOperations
Execute a query based on a given example entity object.

Specified by:
findByExample in interface HibernateOperations
Parameters:
entityName - the name of the persistent entity
exampleEntity - an instance of the desired entity, serving as example for "query-by-example"
firstResult - the index of the first result object to be retrieved (numbered from 0)
maxResults - the maximum number of result objects to retrieve (or <=0 for no limit)
Returns:
a List containing 0 or more persistent instances
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Example.create(Object),
Criteria.setFirstResult(int),
Criteria.setMaxResults(int)

iterate

public Iterator iterate(String queryString)
                 throws DataAccessException
Description copied from interface: HibernateOperations
Execute a query for persistent instances.

Returns the results as an Iterator. Entities returned are initialized on demand. See the Hibernate API documentation for details.

Specified by:
iterate in interface HibernateOperations
Parameters:
queryString - a query expressed in Hibernate's query language
Returns:
an Iterator containing 0 or more persistent instances
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.createQuery(java.lang.String), Query.iterate()

iterate

public Iterator iterate(String queryString,
                        Object value)
                 throws DataAccessException
Description copied from interface: HibernateOperations
Execute a query for persistent instances, binding one value to a "?" parameter in the query string.

Returns the results as an Iterator. Entities returned are initialized on demand. See the Hibernate API documentation for details.

Specified by:
iterate in interface HibernateOperations
Parameters:
queryString - a query expressed in Hibernate's query language
value - the value of the parameter
Returns:
an Iterator containing 0 or more persistent instances
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.createQuery(java.lang.String), Query.iterate()

iterate

public Iterator iterate(String queryString,
                        Object... values)
                 throws DataAccessException
Description copied from interface: HibernateOperations
Execute a query for persistent instances, binding a number of values to "?" parameters in the query string.

Returns the results as an Iterator. Entities returned are initialized on demand. See the Hibernate API documentation for details.

Specified by:
iterate in interface HibernateOperations
Parameters:
queryString - a query expressed in Hibernate's query language
values - the values of the parameters
Returns:
an Iterator containing 0 or more persistent instances
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.createQuery(java.lang.String), Query.iterate()

closeIterator

public void closeIterator(Iterator it)
                   throws DataAccessException
Description copied from interface: HibernateOperations
Immediately close an Iterator created by any of the various iterate(..) operations, instead of waiting until the session is closed or disconnected.

Specified by:
closeIterator in interface HibernateOperations
Parameters:
it - the Iterator to close
Throws:
DataAccessException - if the Iterator could not be closed
See Also:
Hibernate.close(java.util.Iterator)

bulkUpdate

public int bulkUpdate(String queryString)
               throws DataAccessException
Description copied from interface: HibernateOperations
Update/delete all objects according to the given query.

Specified by:
bulkUpdate in interface HibernateOperations
Parameters:
queryString - an update/delete query expressed in Hibernate's query language
Returns:
the number of instances updated/deleted
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.createQuery(java.lang.String), Query.executeUpdate()

bulkUpdate

public int bulkUpdate(String queryString,
                      Object value)
               throws DataAccessException
Description copied from interface: HibernateOperations
Update/delete all objects according to the given query, binding one value to a "?" parameter in the query string.

Specified by:
bulkUpdate in interface HibernateOperations
Parameters:
queryString - an update/delete query expressed in Hibernate's query language
value - the value of the parameter
Returns:
the number of instances updated/deleted
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.createQuery(java.lang.String), Query.executeUpdate()

bulkUpdate

public int bulkUpdate(String queryString,
                      Object... values)
               throws DataAccessException
Description copied from interface: HibernateOperations
Update/delete all objects according to the given query, binding a number of values to "?" parameters in the query string.

Specified by:
bulkUpdate in interface HibernateOperations
Parameters:
queryString - an update/delete query expressed in Hibernate's query language
values - the values of the parameters
Returns:
the number of instances updated/deleted
Throws:
DataAccessException - in case of Hibernate errors
See Also:
Session.createQuery(java.lang.String), Query.executeUpdate()

checkWriteOperationAllowed

protected void checkWriteOperationAllowed(org.hibernate.Session session)
                                   throws InvalidDataAccessApiUsageException
Check whether write operations are allowed on the given Session.

Default implementation throws an InvalidDataAccessApiUsageException in case of FlushMode.MANUAL. Can be overridden in subclasses.

Parameters:
session - current Hibernate Session
Throws:
InvalidDataAccessApiUsageException - if write operations are not allowed
See Also:
setCheckWriteOperations(boolean), HibernateAccessor.getFlushMode(), HibernateAccessor.FLUSH_EAGER, Session.getFlushMode(), FlushMode.MANUAL

prepareQuery

protected void prepareQuery(org.hibernate.Query queryObject)
Prepare the given Query object, applying cache settings and/or a transaction timeout.

Parameters:
queryObject - the Query object to prepare
See Also:
setCacheQueries(boolean), setQueryCacheRegion(java.lang.String), SessionFactoryUtils.applyTransactionTimeout(org.hibernate.Query, org.hibernate.SessionFactory)

prepareCriteria

protected void prepareCriteria(org.hibernate.Criteria criteria)
Prepare the given Criteria object, applying cache settings and/or a transaction timeout.

Parameters:
criteria - the Criteria object to prepare
See Also:
setCacheQueries(boolean), setQueryCacheRegion(java.lang.String), SessionFactoryUtils.applyTransactionTimeout(org.hibernate.Query, org.hibernate.SessionFactory)

applyNamedParameterToQuery

protected void applyNamedParameterToQuery(org.hibernate.Query queryObject,
                                          String paramName,
                                          Object value)
                                   throws org.hibernate.HibernateException
Apply the given name parameter to the given Query object.

Parameters:
queryObject - the Query object
paramName - the name of the parameter
value - the value of the parameter
Throws:
org.hibernate.HibernateException - if thrown by the Query object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HibernateTransactionManager

org.springframework.orm.hibernate3
Class HibernateTransactionManager

java.lang.Object
    extended by  org.springframework.transaction.support.AbstractPlatformTransactionManager
        extended by  org.springframework.orm.hibernate3.HibernateTransactionManager
All Implemented Interfaces:
Serializable, BeanFactoryAware, InitializingBean, PlatformTransactionManager, ResourceTransactionManager
public class HibernateTransactionManager
extends AbstractPlatformTransactionManager
implements ResourceTransactionManager, BeanFactoryAware, InitializingBean

PlatformTransactionManager implementation for a single Hibernate SessionFactory. Binds a Hibernate Session from the specified factory to the thread, potentially allowing for one thread-bound Session per factory. SessionFactoryUtils and HibernateTemplate are aware of thread-bound Sessions and participate in such transactions automatically. Using either of those or going through SessionFactory.getCurrentSession() is required for Hibernate access code that needs to support this transaction handling mechanism.

Supports custom isolation levels, and timeouts that get applied as Hibernate transaction timeouts.

This transaction manager is appropriate for applications that use a single Hibernate SessionFactory for transactional data access, but it also supports direct DataSource access within a transaction (i.e. plain JDBC code working with the same DataSource). This allows for mixing services which access Hibernate and services which use plain JDBC (without being aware of Hibernate)! Application code needs to stick to the same simple Connection lookup pattern as with DataSourceTransactionManager (i.e. DataSourceUtils.getConnection(javax.sql.DataSource) or going through a TransactionAwareDataSourceProxy).

Note: To be able to register a DataSource's Connection for plain JDBC code, this instance needs to be aware of the DataSource (setDataSource(javax.sql.DataSource)). The given DataSource should obviously match the one used by the given SessionFactory. To achieve this, configure both to the same JNDI DataSource, or preferably create the SessionFactory with LocalSessionFactoryBean and a local DataSource (which will be autodetected by this transaction manager).

JTA (usually through JtaTransactionManager) is necessary for accessing multiple transactional resources within the same transaction. The DataSource that Hibernate uses needs to be JTA-enabled in such a scenario (see container setup). Normally, JTA setup for Hibernate is somewhat container-specific due to the JTA TransactionManager lookup, required for proper transactional handling of the SessionFactory-level read-write cache.

Fortunately, there is an easier way with Spring: SessionFactoryUtils (and thus HibernateTemplate) registers synchronizations with Spring's TransactionSynchronizationManager (as used by JtaTransactionManager), for proper after-completion callbacks. Therefore, as long as Spring's JtaTransactionManager drives the JTA transactions, Hibernate does not require any special configuration for proper JTA participation. Note that there are special restrictions with EJB CMT and restrictive JTA subsystems: See JtaTransactionManager's javadoc for details.

On JDBC 3.0, this transaction manager supports nested transactions via JDBC 3.0 Savepoints. The AbstractPlatformTransactionManager.setNestedTransactionAllowed(boolean) "nestedTransactionAllowed"} flag defaults to "false", though, as nested transactions will just apply to the JDBC Connection, not to the Hibernate Session and its cached objects. You can manually set the flag to "true" if you want to use nested transactions for JDBC access code which participates in Hibernate transactions (provided that your JDBC driver supports Savepoints). Note that Hibernate itself does not support nested transactions! Hence, do not expect Hibernate access code to semantically participate in a nested transaction.

Requires Hibernate 3.2 or later, as of Spring 3.0.

Since:
1.2
Author:
Juergen Hoeller
See Also:
setSessionFactory(org.hibernate.SessionFactory),
setDataSource(javax.sql.DataSource),
LocalSessionFactoryBean,
SessionFactoryUtils.getSession(org.hibernate.SessionFactory, boolean),
SessionFactoryUtils.applyTransactionTimeout(org.hibernate.Query, org.hibernate.SessionFactory),
SessionFactoryUtils.releaseSession(org.hibernate.Session, org.hibernate.SessionFactory),
HibernateTemplate,
SessionFactory.getCurrentSession(),
DataSourceUtils.getConnection(javax.sql.DataSource),
DataSourceUtils.applyTransactionTimeout(java.sql.Statement, javax.sql.DataSource),
DataSourceUtils.releaseConnection(java.sql.Connection, javax.sql.DataSource),
JdbcTemplate,
DataSourceTransactionManager,
JtaTransactionManager,
Serialized Form

Field Summary
Fields inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
logger, SYNCHRONIZATION_ALWAYS, SYNCHRONIZATION_NEVER, SYNCHRONIZATION_ON_ACTUAL_TRANSACTION
Constructor Summary
HibernateTransactionManager()
Create a new HibernateTransactionManager instance.
HibernateTransactionManager(org.hibernate.SessionFactory sessionFactory)
Create a new HibernateTransactionManager instance.
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected DataAccessException | convertHibernateAccessException(org.hibernate.HibernateException ex) Convert the given HibernateException to an appropriate exception from the org.springframework.dao hierarchy.
protected DataAccessException | convertJdbcAccessException(org.hibernate.JDBCException ex, SQLExceptionTranslator translator) Convert the given Hibernate JDBCException to an appropriate exception from the org.springframework.dao hierarchy, using the given SQLExceptionTranslator.
protected void | doBegin(Object transaction, TransactionDefinition definition) Begin a new transaction with semantics according to the given transaction definition.
protected void | doCleanupAfterCompletion(Object transaction) Cleanup resources after transaction completion.
protected void | doCommit(DefaultTransactionStatus status) Perform an actual commit of the given transaction.
protected Object | doGetTransaction() Return a transaction object for the current transaction state.
protected void | doResume(Object transaction, Object suspendedResources) Resume the resources of the current transaction.
protected void | doRollback(DefaultTransactionStatus status) Perform an actual rollback of the given transaction.
protected void | doSetRollbackOnly(DefaultTransactionStatus status) Set the given transaction rollback-only.
protected Object | doSuspend(Object transaction) Suspend the resources of the current transaction.
DataSource | getDataSource() Return the JDBC DataSource that this instance manages transactions for.
protected SQLExceptionTranslator | getDefaultJdbcExceptionTranslator() Obtain a default SQLExceptionTranslator, lazily creating it if necessary.
org.hibernate.Interceptor | getEntityInterceptor() Return the current Hibernate entity interceptor, or null if none.
SQLExceptionTranslator | getJdbcExceptionTranslator() Return the JDBC exception translator for this transaction manager, if any.
Object | getResourceFactory() Return the resource factory that this transaction manager operates on, e.g.
org.hibernate.SessionFactory | getSessionFactory() Return the SessionFactory that this instance should manage transactions for.
protected boolean | isExistingTransaction(Object transaction) Check if the given transaction object indicates an existing transaction (that is, a transaction which has already started).
protected boolean | isSameConnectionForEntireSession(org.hibernate.Session session) Return whether the given Hibernate Session will always hold the same JDBC Connection.
protected void | prepareForCommit(DefaultTransactionStatus status) Make preparations for commit, to be performed before the beforeCommit synchronization callbacks occur.
void | setAutodetectDataSource(boolean autodetectDataSource) Set whether to autodetect a JDBC DataSource used by the Hibernate SessionFactory, if set via LocalSessionFactoryBean's setDataSource.
void | setBeanFactory(BeanFactory beanFactory) The bean factory just needs to be known for resolving entity interceptor bean names.
void | setDataSource(DataSource dataSource) Set the JDBC DataSource that this instance should manage transactions for.
void | setEarlyFlushBeforeCommit(boolean earlyFlushBeforeCommit) Set whether to perform an early flush before proceeding with a commit.
void | setEntityInterceptor(org.hibernate.Interceptor entityInterceptor) Set a Hibernate entity interceptor that allows to inspect and change property values before writing to and reading from the database.
void | setEntityInterceptorBeanName(String entityInterceptorBeanName) Set the bean name of a Hibernate entity interceptor that allows to inspect and change property values before writing to and reading from the database.
void | setHibernateManagedSession(boolean hibernateManagedSession) Set whether to operate on a Hibernate-managed Session instead of a Spring-managed Session, that is, whether to obtain the Session through Hibernate's SessionFactory.getCurrentSession() instead of SessionFactory.openSession() (with a Spring TransactionSynchronizationManager check preceding it).
void | setJdbcExceptionTranslator(SQLExceptionTranslator jdbcExceptionTranslator) Set the JDBC exception translator for this transaction manager.
void | setPrepareConnection(boolean prepareConnection) Set whether to prepare the underlying JDBC Connection of a transactional Hibernate Session, that is, whether to apply a transaction-specific isolation level and/or the transaction's read-only flag to the underlying JDBC Connection.
void | setSessionFactory(org.hibernate.SessionFactory sessionFactory) Set the SessionFactory that this instance should manage transactions for.
Methods inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
commit, determineTimeout, getDefaultTimeout, getTransaction, getTransactionSynchronization, invokeAfterCompletion, isFailEarlyOnGlobalRollbackOnly, isGlobalRollbackOnParticipationFailure, isNestedTransactionAllowed, isRollbackOnCommitFailure, isValidateExistingTransaction, newTransactionStatus, prepareSynchronization, prepareTransactionStatus, registerAfterCompletionWithExistingTransaction, resume, rollback, setDefaultTimeout, setFailEarlyOnGlobalRollbackOnly, setGlobalRollbackOnParticipationFailure, setNestedTransactionAllowed, setRollbackOnCommitFailure, setTransactionSynchronization, setTransactionSynchronizationName, setValidateExistingTransaction, shouldCommitOnGlobalRollbackOnly, suspend, triggerBeforeCommit, triggerBeforeCompletion, useSavepointForNestedTransaction
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.transaction.PlatformTransactionManager
commit, getTransaction, rollback

Constructor Detail

HibernateTransactionManager

public HibernateTransactionManager()
Create a new HibernateTransactionManager instance. A SessionFactory has to be set to be able to use it.

See Also:
setSessionFactory(org.hibernate.SessionFactory)

HibernateTransactionManager

public HibernateTransactionManager(org.hibernate.SessionFactory sessionFactory)
Create a new HibernateTransactionManager instance.

Parameters:
sessionFactory - SessionFactory to manage transactions for
Method Detail

setSessionFactory

public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
Set the SessionFactory that this instance should manage transactions for.

getSessionFactory

public org.hibernate.SessionFactory getSessionFactory()
Return the SessionFactory that this instance should manage transactions for.

setDataSource

public void setDataSource(DataSource dataSource)
Set the JDBC DataSource that this instance should manage transactions for. The DataSource should match the one used by the Hibernate SessionFactory: for example, you could specify the same JNDI DataSource for both.

If the SessionFactory was configured with LocalDataSourceConnectionProvider, i.e. by Spring's LocalSessionFactoryBean with a specified "dataSource", the DataSource will be auto-detected: You can still explictly specify the DataSource, but you don't need to in this case.

A transactional JDBC Connection for this DataSource will be provided to application code accessing this DataSource directly via DataSourceUtils or JdbcTemplate. The Connection will be taken from the Hibernate Session.

The DataSource specified here should be the target DataSource to manage transactions for, not a TransactionAwareDataSourceProxy. Only data access code may work with TransactionAwareDataSourceProxy, while the transaction manager needs to work on the underlying target DataSource. If there's nevertheless a TransactionAwareDataSourceProxy passed in, it will be unwrapped to extract its target DataSource.

See Also:
setAutodetectDataSource(boolean), LocalDataSourceConnectionProvider, AbstractSessionFactoryBean.setDataSource(javax.sql.DataSource), TransactionAwareDataSourceProxy, DataSourceUtils, JdbcTemplate

getDataSource

public DataSource getDataSource()
Return the JDBC DataSource that this instance manages transactions for.

setAutodetectDataSource

public void setAutodetectDataSource(boolean autodetectDataSource)
Set whether to autodetect a JDBC DataSource used by the Hibernate SessionFactory, if set via LocalSessionFactoryBean's setDataSource. Default is "true".

Can be turned off to deliberately ignore an available DataSource, in order to not expose Hibernate transactions as JDBC transactions for that DataSource.

See Also:
setDataSource(javax.sql.DataSource), AbstractSessionFactoryBean.setDataSource(javax.sql.DataSource)

setPrepareConnection

public void setPrepareConnection(boolean prepareConnection)
Set whether to prepare the underlying JDBC Connection of a transactional Hibernate Session, that is, whether to apply a transaction-specific isolation level and/or the transaction's read-only flag to the underlying JDBC Connection.

Default is "true". If you turn this flag off, the transaction manager will not support per-transaction isolation levels anymore. It will not call Connection.setReadOnly(true) for read-only transactions anymore either. If this flag is turned off, no cleanup of a JDBC Connection is required after a transaction, since no Connection settings will get modified.

See Also:
Connection.setTransactionIsolation(int), Connection.setReadOnly(boolean)

setHibernateManagedSession

public void setHibernateManagedSession(boolean hibernateManagedSession)
Set whether to operate on a Hibernate-managed Session instead of a Spring-managed Session, that is, whether to obtain the Session through Hibernate's SessionFactory.getCurrentSession() instead of SessionFactory.openSession() (with a Spring TransactionSynchronizationManager check preceding it).

Default is "false", i.e. using a Spring-managed Session: taking the current thread-bound Session if available (e.g. in an Open-Session-in-View scenario), creating a new Session for the current transaction otherwise.

Switch this flag to "true" in order to enforce use of a Hibernate-managed Session. Note that this requires SessionFactory.getCurrentSession() to always return a proper Session when called for a Spring-managed transaction; transaction begin will fail if the getCurrentSession() call fails.

This mode will typically be used in combination with a custom Hibernate CurrentSessionContext implementation that stores Sessions in a place other than Spring's TransactionSynchronizationManager. It may also be used in combination with Spring's Open-Session-in-View support (using Spring's default SpringSessionContext), in which case it subtly differs from the Spring-managed Session mode: The pre-bound Session will not receive a clear() call (on rollback) or a disconnect() call (on transaction completion) in such a scenario; this is rather left up to a custom CurrentSessionContext implementation (if desired).

setEarlyFlushBeforeCommit

public void setEarlyFlushBeforeCommit(boolean earlyFlushBeforeCommit)
Set whether to perform an early flush before proceeding with a commit.

Default is "false", performing an implicit flush as part of the actual commit step. Switch this to "true" in order to enforce an explicit early flush right before the actual commit step.

An early flush happens before the before-commit synchronization phase, making flushed state visible to beforeCommit callbacks of registered TransactionSynchronization objects. Such explicit flush behavior is consistent with Spring-driven flushing in a JTA transaction environment, so may also get enforced for consistency with JTA transaction behavior.

See Also:
prepareForCommit(org.springframework.transaction.support.DefaultTransactionStatus)

setEntityInterceptorBeanName

public void setEntityInterceptorBeanName(String entityInterceptorBeanName)
Set the bean name of a Hibernate entity interceptor that allows to inspect and change property values before writing to and reading from the database. Will get applied to any new Session created by this transaction manager.

Requires the bean factory to be known, to be able to resolve the bean name to an interceptor instance on session creation. Typically used for prototype interceptors, i.e. a new interceptor instance per session.

Can also be used for shared interceptor instances, but it is recommended to set the interceptor reference directly in such a scenario.

Parameters:
entityInterceptorBeanName - the name of the entity interceptor in the bean factory
See Also:
setBeanFactory(org.springframework.beans.factory.BeanFactory), setEntityInterceptor(org.hibernate.Interceptor)

setEntityInterceptor

public void setEntityInterceptor(org.hibernate.Interceptor entityInterceptor)
Set a Hibernate entity interceptor that allows to inspect and change property values before writing to and reading from the database. Will get applied to any new Session created by this transaction manager.

Such an interceptor can either be set at the SessionFactory level, i.e. on LocalSessionFactoryBean, or at the Session level, i.e. on HibernateTemplate, HibernateInterceptor, and HibernateTransactionManager. It's preferable to set it on LocalSessionFactoryBean or HibernateTransactionManager to avoid repeated configuration and guarantee consistent behavior in transactions.

See Also:
LocalSessionFactoryBean.setEntityInterceptor(org.hibernate.Interceptor),
HibernateAccessor.setEntityInterceptor(org.hibernate.Interceptor),
HibernateAccessor.setEntityInterceptor(org.hibernate.Interceptor)

getEntityInterceptor

public org.hibernate.Interceptor getEntityInterceptor()
                                               throws IllegalStateException,
                                                      BeansException
Return the current Hibernate entity interceptor, or null if none. Resolves an entity interceptor bean name via the bean factory, if necessary.

Throws:
IllegalStateException - if bean name specified but no bean factory set
BeansException - if bean name resolution via the bean factory failed
See Also:
setEntityInterceptor(org.hibernate.Interceptor),
setEntityInterceptorBeanName(java.lang.String),
setBeanFactory(org.springframework.beans.factory.BeanFactory)

setJdbcExceptionTranslator

public void setJdbcExceptionTranslator(SQLExceptionTranslator jdbcExceptionTranslator)
Set the JDBC exception translator for this transaction manager.

Applied to any SQLException root cause of a Hibernate JDBCException that is thrown on flush, overriding Hibernate's default SQLException translation (which is based on Hibernate's Dialect for a specific target database).

Parameters:
jdbcExceptionTranslator - the exception translator
See Also:
SQLException, JDBCException, SQLErrorCodeSQLExceptionTranslator, SQLStateSQLExceptionTranslator

getJdbcExceptionTranslator

public SQLExceptionTranslator getJdbcExceptionTranslator()
Return the JDBC exception translator for this transaction manager, if any.

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
The bean factory just needs to be known for resolving entity interceptor bean names. It does not need to be set for any other mode of operation.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
setEntityInterceptorBeanName(java.lang.String)

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

getResourceFactory

public Object getResourceFactory()
Description copied from interface: ResourceTransactionManager
Return the resource factory that this transaction manager operates on, e.g. a JDBC DataSource or a JMS ConnectionFactory.

This target resource factory is usually used as resource key for TransactionSynchronizationManager's resource bindings per thread.

Specified by:
getResourceFactory in interface ResourceTransactionManager
Returns:
the target resource factory (never null)
See Also:
TransactionSynchronizationManager.bindResource(java.lang.Object, java.lang.Object), TransactionSynchronizationManager.getResource(java.lang.Object)

doGetTransaction

protected Object doGetTransaction()
Description copied from class: AbstractPlatformTransactionManager
Return a transaction object for the current transaction state.

The returned object will usually be specific to the concrete transaction manager implementation, carrying corresponding transaction state in a modifiable fashion. This object will be passed into the other template methods (e.g. doBegin and doCommit), either directly or as part of a DefaultTransactionStatus instance.

The returned object should contain information about any existing transaction, that is, a transaction that has already started before the current getTransaction call on the transaction manager. Consequently, a doGetTransaction implementation will usually look for an existing transaction and store corresponding state in the returned transaction object.

Specified by:
doGetTransaction in class AbstractPlatformTransactionManager
Returns:
the current transaction object
See Also:
AbstractPlatformTransactionManager.doBegin(java.lang.Object, org.springframework.transaction.TransactionDefinition),
AbstractPlatformTransactionManager.doCommit(org.springframework.transaction.support.DefaultTransactionStatus),
AbstractPlatformTransactionManager.doRollback(org.springframework.transaction.support.DefaultTransactionStatus),
DefaultTransactionStatus.getTransaction()

isExistingTransaction

protected boolean isExistingTransaction(Object transaction)
Description copied from class: AbstractPlatformTransactionManager
Check if the given transaction object indicates an existing transaction (that is, a transaction which has already started).

The result will be evaluated according to the specified propagation behavior for the new transaction. An existing transaction might get suspended (in case of PROPAGATION_REQUIRES_NEW), or the new transaction might participate in the existing one (in case of PROPAGATION_REQUIRED).

The default implementation returns false, assuming that participating in existing transactions is generally not supported. Subclasses are of course encouraged to provide such support.

Overrides:
isExistingTransaction in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
Returns:
if there is an existing transaction
See Also:
AbstractPlatformTransactionManager.doGetTransaction()

doBegin

protected void doBegin(Object transaction,
                       TransactionDefinition definition)
Description copied from class: AbstractPlatformTransactionManager
Begin a new transaction with semantics according to the given transaction definition. Does not have to care about applying the propagation behavior, as this has already been handled by this abstract manager.

This method gets called when the transaction manager has decided to actually start a new transaction. Either there wasn't any transaction before, or the previous transaction has been suspended.

A special scenario is a nested transaction without savepoint: If useSavepointForNestedTransaction() returns "false", this method will be called to start a nested transaction when necessary. In such a context, there will be an active transaction: The implementation of this method has to detect this and start an appropriate nested transaction.

Specified by:
doBegin in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
definition - TransactionDefinition instance, describing propagation behavior, isolation level, read-only flag, timeout, and transaction name

doSuspend

protected Object doSuspend(Object transaction)
Description copied from class: AbstractPlatformTransactionManager
Suspend the resources of the current transaction. Transaction synchronization will already have been suspended.

The default implementation throws a TransactionSuspensionNotSupportedException, assuming that transaction suspension is generally not supported.

Overrides:
doSuspend in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
Returns:
an object that holds suspended resources (will be kept unexamined for passing it into doResume)
See Also:
AbstractPlatformTransactionManager.doResume(java.lang.Object, java.lang.Object)

doResume

protected void doResume(Object transaction,
                        Object suspendedResources)
Description copied from class: AbstractPlatformTransactionManager
Resume the resources of the current transaction. Transaction synchronization will be resumed afterwards.

The default implementation throws a TransactionSuspensionNotSupportedException, assuming that transaction suspension is generally not supported.

Overrides:
doResume in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
suspendedResources - the object that holds suspended resources, as returned by doSuspend
See Also:
AbstractPlatformTransactionManager.doSuspend(java.lang.Object)

prepareForCommit

protected void prepareForCommit(DefaultTransactionStatus status)
Description copied from class: AbstractPlatformTransactionManager
Make preparations for commit, to be performed before the beforeCommit synchronization callbacks occur.

Note that exceptions will get propagated to the commit caller and cause a rollback of the transaction.

Overrides:
prepareForCommit in class AbstractPlatformTransactionManager
Parameters:
status - the status representation of the transaction

doCommit

protected void doCommit(DefaultTransactionStatus status)
Description copied from class: AbstractPlatformTransactionManager
Perform an actual commit of the given transaction.

An implementation does not need to check the "new transaction" flag or the rollback-only flag; this will already have been handled before. Usually, a straight commit will be performed on the transaction object contained in the passed-in status.

Specified by:
doCommit in class AbstractPlatformTransactionManager
Parameters:
status - the status representation of the transaction
See Also:
DefaultTransactionStatus.getTransaction()

doRollback

protected void doRollback(DefaultTransactionStatus status)
Description copied from class: AbstractPlatformTransactionManager
Perform an actual rollback of the given transaction.

An implementation does not need to check the "new transaction" flag; this will already have been handled before. Usually, a straight rollback will be performed on the transaction object contained in the passed-in status.

Specified by:
doRollback in class AbstractPlatformTransactionManager
Parameters:
status - the status representation of the transaction
See Also:
DefaultTransactionStatus.getTransaction()

doSetRollbackOnly

protected void doSetRollbackOnly(DefaultTransactionStatus status)
Description copied from class: AbstractPlatformTransactionManager
Set the given transaction rollback-only. Only called on rollback if the current transaction participates in an existing one.

The default implementation throws an IllegalTransactionStateException, assuming that participating in existing transactions is generally not supported. Subclasses are of course encouraged to provide such support.

Overrides:
doSetRollbackOnly in class AbstractPlatformTransactionManager
Parameters:
status - the status representation of the transaction

doCleanupAfterCompletion

protected void doCleanupAfterCompletion(Object transaction)
Description copied from class: AbstractPlatformTransactionManager
Cleanup resources after transaction completion.

Called after doCommit and doRollback execution, on any outcome. The default implementation does nothing.

Should not throw any exceptions but just issue warnings on errors.

Overrides:
doCleanupAfterCompletion in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction

isSameConnectionForEntireSession

protected boolean isSameConnectionForEntireSession(org.hibernate.Session session)
Return whether the given Hibernate Session will always hold the same JDBC Connection. This is used to check whether the transaction manager can safely prepare and clean up the JDBC Connection used for a transaction.

Default implementation checks the Session's connection release mode to be "on_close". Unfortunately, this requires casting to SessionImpl, as of Hibernate 3.1. If that cast doesn't work, we'll simply assume we're safe and return true.

Parameters:
session - the Hibernate Session to check
See Also:
SessionImpl.getConnectionReleaseMode(), ConnectionReleaseMode.ON_CLOSE

convertHibernateAccessException

protected DataAccessException convertHibernateAccessException(org.hibernate.HibernateException ex)
Convert the given HibernateException to an appropriate exception from the org.springframework.dao hierarchy.

Will automatically apply a specified SQLExceptionTranslator to a Hibernate JDBCException, else rely on Hibernate's default translation.

Parameters:
ex - HibernateException that occured
Returns:
a corresponding DataAccessException
See Also:
SessionFactoryUtils.convertHibernateAccessException(org.hibernate.HibernateException), setJdbcExceptionTranslator(org.springframework.jdbc.support.SQLExceptionTranslator)

convertJdbcAccessException

protected DataAccessException convertJdbcAccessException(org.hibernate.JDBCException ex,
                                                         SQLExceptionTranslator translator)
Convert the given Hibernate JDBCException to an appropriate exception from the org.springframework.dao hierarchy, using the given SQLExceptionTranslator.

Parameters:
ex - Hibernate JDBCException that occured
translator - the SQLExceptionTranslator to use
Returns:
a corresponding DataAccessException

getDefaultJdbcExceptionTranslator

protected SQLExceptionTranslator getDefaultJdbcExceptionTranslator()
Obtain a default SQLExceptionTranslator, lazily creating it if necessary.

Creates a default SQLErrorCodeSQLExceptionTranslator for the SessionFactory's underlying DataSource.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LocalCacheProviderProxy

org.springframework.orm.hibernate3
Class LocalCacheProviderProxy

java.lang.Object
    extended by  org.springframework.orm.hibernate3.LocalCacheProviderProxy
All Implemented Interfaces:
org.hibernate.cache.CacheProvider
public class LocalCacheProviderProxy
extends Object
implements org.hibernate.cache.CacheProvider

Proxy for a Hibernate CacheProvider, delegating to a Spring-managed CacheProvider instance, determined by LocalSessionFactoryBean's "cacheProvider" property.

Since:
2.5.1
Author:
Juergen Hoeller
See Also:
LocalSessionFactoryBean.setCacheProvider(org.hibernate.cache.CacheProvider)

Constructor Summary
LocalCacheProviderProxy()
Method Summary
org.hibernate.cache.Cache | buildCache(String regionName, Properties properties)
boolean | isMinimalPutsEnabledByDefault()
long | nextTimestamp()
void | start(Properties properties)
void | stop()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

LocalCacheProviderProxy

public LocalCacheProviderProxy()
Method Detail

buildCache

public org.hibernate.cache.Cache buildCache(String regionName,
                                            Properties properties)
                                     throws org.hibernate.cache.CacheException
Specified by:
buildCache in interface org.hibernate.cache.CacheProvider
Throws:
org.hibernate.cache.CacheException

nextTimestamp

public long nextTimestamp()
Specified by:
nextTimestamp in interface org.hibernate.cache.CacheProvider

start

public void start(Properties properties)
           throws org.hibernate.cache.CacheException
Specified by:
start in interface org.hibernate.cache.CacheProvider
Throws:
org.hibernate.cache.CacheException

stop

public void stop()
Specified by:
stop in interface org.hibernate.cache.CacheProvider

isMinimalPutsEnabledByDefault

public boolean isMinimalPutsEnabledByDefault()
Specified by:
isMinimalPutsEnabledByDefault in interface org.hibernate.cache.CacheProvider
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LocalDataSourceConnectionProvider

org.springframework.orm.hibernate3
Class LocalDataSourceConnectionProvider

java.lang.Object
    extended by  org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
All Implemented Interfaces:
org.hibernate.connection.ConnectionProvider
Direct Known Subclasses:
LocalJtaDataSourceConnectionProvider, TransactionAwareDataSourceConnectionProvider
public class LocalDataSourceConnectionProvider
extends Object
implements org.hibernate.connection.ConnectionProvider

Hibernate connection provider for local DataSource instances in an application context. This provider will be used if LocalSessionFactoryBean's "dataSource" property is set without a Hibernate TransactionManagerLookup.

Since:
1.2
Author:
Juergen Hoeller
See Also:
AbstractSessionFactoryBean.setDataSource(javax.sql.DataSource)

Constructor Summary
LocalDataSourceConnectionProvider()
Method Summary
void | close() This implementation does nothing: We're dealing with an externally managed DataSource.
void | closeConnection(Connection con) This implementation simply calls Connection.close.
void | configure(Properties props)
Connection | getConnection() This implementation delegates to the underlying DataSource.
DataSource | getDataSource() Return the DataSource that this ConnectionProvider wraps.
protected DataSource | getDataSourceToUse(DataSource originalDataSource) Return the DataSource to use for retrieving Connections.
boolean | supportsAggressiveRelease() This implementation returns false: We cannot guarantee to receive the same Connection within a transaction, not even when dealing with a JNDI DataSource.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

LocalDataSourceConnectionProvider

public LocalDataSourceConnectionProvider()
Method Detail

configure

public void configure(Properties props)
               throws org.hibernate.HibernateException
Specified by:
configure in interface org.hibernate.connection.ConnectionProvider
Throws:
org.hibernate.HibernateException

getDataSourceToUse

protected DataSource getDataSourceToUse(DataSource originalDataSource)
Return the DataSource to use for retrieving Connections.

This implementation returns the passed-in DataSource as-is.

Parameters:
originalDataSource - the DataSource as configured by the user on LocalSessionFactoryBean
Returns:
the DataSource to actually retrieve Connections from (potentially wrapped)
See Also:
AbstractSessionFactoryBean.setDataSource(javax.sql.DataSource)

getDataSource

public DataSource getDataSource()
Return the DataSource that this ConnectionProvider wraps.

getConnection

public Connection getConnection()
                         throws SQLException
This implementation delegates to the underlying DataSource.

Specified by:
getConnection in interface org.hibernate.connection.ConnectionProvider
Throws:
SQLException
See Also:
DataSource.getConnection()

closeConnection

public void closeConnection(Connection con)
                     throws SQLException
This implementation simply calls Connection.close.

Specified by:
closeConnection in interface org.hibernate.connection.ConnectionProvider
Throws:
SQLException
See Also:
Connection.close()

close

public void close()
This implementation does nothing: We're dealing with an externally managed DataSource.

Specified by:
close in interface org.hibernate.connection.ConnectionProvider

supportsAggressiveRelease

public boolean supportsAggressiveRelease()
This implementation returns false: We cannot guarantee to receive the same Connection within a transaction, not even when dealing with a JNDI DataSource.

Specified by:
supportsAggressiveRelease in interface org.hibernate.connection.ConnectionProvider
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LocalJtaDataSourceConnectionProvider

org.springframework.orm.hibernate3
Class LocalJtaDataSourceConnectionProvider

java.lang.Object
    extended by  org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
        extended by  org.springframework.orm.hibernate3.LocalJtaDataSourceConnectionProvider
All Implemented Interfaces:
org.hibernate.connection.ConnectionProvider
public class LocalJtaDataSourceConnectionProvider
extends LocalDataSourceConnectionProvider

Subclass of LocalDataSourceConnectionProvider that will be used if LocalSessionFactoryBean's "dataSource" property is set in combination with a Hibernate TransactionManagerLookup.

Since:
2.5.1
Author:
Juergen Hoeller

Constructor Summary
LocalJtaDataSourceConnectionProvider()
Method Summary
 boolean supportsAggressiveRelease()
This implementation returns true, since we're assuming a JTA DataSource.
Methods inherited from class org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
close, closeConnection, configure, getConnection, getDataSource, getDataSourceToUse
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

LocalJtaDataSourceConnectionProvider

public LocalJtaDataSourceConnectionProvider()
Method Detail

supportsAggressiveRelease

public boolean supportsAggressiveRelease()
This implementation returns true, since we're assuming a JTA DataSource.

Specified by:
supportsAggressiveRelease in interface org.hibernate.connection.ConnectionProvider
Overrides:
supportsAggressiveRelease in class LocalDataSourceConnectionProvider
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LocalRegionFactoryProxy

org.springframework.orm.hibernate3
Class LocalRegionFactoryProxy

java.lang.Object
    extended by  org.springframework.orm.hibernate3.LocalRegionFactoryProxy
All Implemented Interfaces:
org.hibernate.cache.RegionFactory
public class LocalRegionFactoryProxy
extends Object
implements org.hibernate.cache.RegionFactory

Proxy for a Hibernate RegionFactory, delegating to a Spring-managed RegionFactory instance, determined by LocalSessionFactoryBean's "cacheRegionFactory" property.

Compatible with Hibernate 3.3 as well as Hibernate 3.5's version of the RegionFactory SPI.

Since:
3.0
Author:
Juergen Hoeller
See Also:
LocalSessionFactoryBean.setCacheRegionFactory(java.lang.Object)

Constructor Summary
LocalRegionFactoryProxy()
Standard constructor.
LocalRegionFactoryProxy(Properties properties)
Properties constructor: not used by this class or formally required, but enforced by Hibernate when reflectively instantiating a RegionFactory.
Method Summary
org.hibernate.cache.CollectionRegion | buildCollectionRegion(String regionName, Properties properties, org.hibernate.cache.CacheDataDescription metadata)
org.hibernate.cache.EntityRegion | buildEntityRegion(String regionName, Properties properties, org.hibernate.cache.CacheDataDescription metadata)
org.hibernate.cache.QueryResultsRegion | buildQueryResultsRegion(String regionName, Properties properties)
org.hibernate.cache.TimestampsRegion | buildTimestampsRegion(String regionName, Properties properties)
org.hibernate.cache.access.AccessType | getDefaultAccessType()
boolean | isMinimalPutsEnabledByDefault()
long | nextTimestamp()
void | start(org.hibernate.cfg.Settings settings, Properties properties)
void | stop()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

LocalRegionFactoryProxy

public LocalRegionFactoryProxy()
Standard constructor.

LocalRegionFactoryProxy

public LocalRegionFactoryProxy(Properties properties)
Properties constructor: not used by this class or formally required, but enforced by Hibernate when reflectively instantiating a RegionFactory.

Method Detail

start

public void start(org.hibernate.cfg.Settings settings,
                  Properties properties)
           throws org.hibernate.cache.CacheException
Specified by:
start in interface org.hibernate.cache.RegionFactory
Throws:
org.hibernate.cache.CacheException

stop

public void stop()
Specified by:
stop in interface org.hibernate.cache.RegionFactory

isMinimalPutsEnabledByDefault

public boolean isMinimalPutsEnabledByDefault()
Specified by:
isMinimalPutsEnabledByDefault in interface org.hibernate.cache.RegionFactory

getDefaultAccessType

public org.hibernate.cache.access.AccessType getDefaultAccessType()

nextTimestamp

public long nextTimestamp()
Specified by:
nextTimestamp in interface org.hibernate.cache.RegionFactory

buildEntityRegion

public org.hibernate.cache.EntityRegion buildEntityRegion(String regionName,
                                                          Properties properties,
                                                          org.hibernate.cache.CacheDataDescription metadata)
                                                   throws org.hibernate.cache.CacheException
Specified by:
buildEntityRegion in interface org.hibernate.cache.RegionFactory
Throws:
org.hibernate.cache.CacheException

buildCollectionRegion

public org.hibernate.cache.CollectionRegion buildCollectionRegion(String regionName,
                                                                  Properties properties,
                                                                  org.hibernate.cache.CacheDataDescription metadata)
                                                           throws org.hibernate.cache.CacheException
Specified by:
buildCollectionRegion in interface org.hibernate.cache.RegionFactory
Throws:
org.hibernate.cache.CacheException

buildQueryResultsRegion

public org.hibernate.cache.QueryResultsRegion buildQueryResultsRegion(String regionName,
                                                                      Properties properties)
                                                               throws org.hibernate.cache.CacheException
Specified by:
buildQueryResultsRegion in interface org.hibernate.cache.RegionFactory
Throws:
org.hibernate.cache.CacheException

buildTimestampsRegion

public org.hibernate.cache.TimestampsRegion buildTimestampsRegion(String regionName,
                                                                  Properties properties)
                                                           throws org.hibernate.cache.CacheException
Specified by:
buildTimestampsRegion in interface org.hibernate.cache.RegionFactory
Throws:
org.hibernate.cache.CacheException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LocalSessionFactoryBean

org.springframework.orm.hibernate3
Class LocalSessionFactoryBean

java.lang.Object
    extended by  org.springframework.orm.hibernate3.AbstractSessionFactoryBean
        extended by  org.springframework.orm.hibernate3.LocalSessionFactoryBean
All Implemented Interfaces:
BeanClassLoaderAware, DisposableBean, FactoryBean<org.hibernate.SessionFactory>, InitializingBean, PersistenceExceptionTranslator
Direct Known Subclasses:
AnnotationSessionFactoryBean
public class LocalSessionFactoryBean
extends AbstractSessionFactoryBean
implements BeanClassLoaderAware

FactoryBean that creates a Hibernate SessionFactory. This is the usual way to set up a shared Hibernate SessionFactory in a Spring application context; the SessionFactory can then be passed to Hibernate-based DAOs via dependency injection.

Configuration settings can either be read from a Hibernate XML file, specified as "configLocation", or completely via this class. A typical local configuration consists of one or more "mappingResources", various "hibernateProperties" (not strictly necessary), and a "dataSource" that the SessionFactory should use. The latter can also be specified via Hibernate properties, but "dataSource" supports any Spring-configured DataSource, instead of relying on Hibernate's own connection providers.

This SessionFactory handling strategy is appropriate for most types of applications, from Hibernate-only single database apps to ones that need distributed transactions. Either HibernateTransactionManager or JtaTransactionManager can be used for transaction demarcation, with the latter only necessary for transactions which span multiple databases.

This factory bean will by default expose a transaction-aware SessionFactory proxy, letting data access code work with the plain Hibernate SessionFactory and its getCurrentSession() method, while still being able to participate in current Spring-managed transactions: with any transaction management strategy, either local or JTA / EJB CMT, and any transaction synchronization mechanism, either Spring or JTA. Furthermore, getCurrentSession() will also seamlessly work with a request-scoped Session managed by OpenSessionInViewFilter / OpenSessionInViewInterceptor.

Requires Hibernate 3.2 or later, with Hibernate 3.3 being recommended. Note that this factory will use "on_close" as default Hibernate connection release mode, unless in the case of a "jtaTransactionManager" specified, for the reason that this is appropriate for most Spring-based applications (in particular when using Spring's HibernateTransactionManager).

Since:
1.2
Author:
Juergen Hoeller
See Also:
HibernateAccessor.setSessionFactory(org.hibernate.SessionFactory),
HibernateTransactionManager.setSessionFactory(org.hibernate.SessionFactory),
AbstractSessionFactoryBean.setExposeTransactionAwareSessionFactory(boolean),
setJtaTransactionManager(javax.transaction.TransactionManager),
SessionFactory.getCurrentSession(),
HibernateTransactionManager

Field Summary
Fields inherited from class org.springframework.orm.hibernate3.AbstractSessionFactoryBean
logger
Constructor Summary
LocalSessionFactoryBean()
Method Summary
protected void | afterSessionFactoryCreation() Executes schema update if requested.
protected org.hibernate.SessionFactory | buildSessionFactory() Build the underlying Hibernate SessionFactory.
void | createDatabaseSchema() Execute schema creation script, determined by the Configuration object used for creating the SessionFactory.
void | destroy() Allows for schema export on shutdown.
void | dropDatabaseSchema() Execute schema drop script, determined by the Configuration object used for creating the SessionFactory.
protected void | executeSchemaScript(Connection con, String[] sql) Execute the given schema script on the given JDBC Connection.
protected void | executeSchemaStatement(Statement stmt, String sql) Execute the given schema SQL on the given JDBC Statement.
static org.hibernate.cache.CacheProvider | getConfigTimeCacheProvider() Return the CacheProvider for the currently configured Hibernate SessionFactory, to be used by LocalCacheProviderProxy.
static DataSource | getConfigTimeDataSource() Return the DataSource for the currently configured Hibernate SessionFactory, to be used by LocalDataSourceConnectionProvoder.
static LobHandler | getConfigTimeLobHandler() Return the LobHandler for the currently configured Hibernate SessionFactory, to be used by UserType implementations like ClobStringType.
static TransactionManager | getConfigTimeTransactionManager() Return the JTA TransactionManager for the currently configured Hibernate SessionFactory, to be used by LocalTransactionManagerLookup.
org.hibernate.cfg.Configuration | getConfiguration() Return the Configuration object used to build the SessionFactory.
Properties | getHibernateProperties() Return the Hibernate properties, if any.
protected org.hibernate.cfg.Configuration | newConfiguration() Subclasses can override this method to perform custom initialization of the Configuration instance used for SessionFactory creation.
protected org.hibernate.SessionFactory | newSessionFactory(org.hibernate.cfg.Configuration config) Subclasses can override this method to perform custom initialization of the SessionFactory instance, creating it via the given Configuration object that got prepared by this LocalSessionFactoryBean.
protected void | postProcessConfiguration(org.hibernate.cfg.Configuration config) To be implemented by subclasses that want to to perform custom post-processing of the Configuration object after this FactoryBean performed its default initialization.
protected void | postProcessMappings(org.hibernate.cfg.Configuration config) To be implemented by subclasses that want to to register further mappings on the Configuration object after this FactoryBean registered its specified mappings.
void | setBeanClassLoader(ClassLoader beanClassLoader) Callback that supplies the bean class loader to a bean instance.
void | setCacheableMappingLocations(Resource[] cacheableMappingLocations) Set locations of cacheable Hibernate mapping files, for example as web app resource "/WEB-INF/mapping/example.hbm.xml".
void | setCacheProvider(org.hibernate.cache.CacheProvider cacheProvider) Deprecated. as of Spring 3.0, following Hibernate 3.3's deprecation of the CacheProvider SPI
void | setCacheRegionFactory(Object cacheRegionFactory) Set the Hibernate RegionFactory to use for the SessionFactory.
void | setCollectionCacheStrategies(Properties collectionCacheStrategies) Specify the cache strategies for persistent collections (with specific roles).
void | setConfigLocation(Resource configLocation) Set the location of a single Hibernate XML config file, for example as classpath resource "classpath:hibernate.cfg.xml".
void | setConfigLocations(Resource[] configLocations) Set the locations of multiple Hibernate XML config files, for example as classpath resources "classpath:hibernate.cfg.xml,classpath:extension.cfg.xml".
void | setConfigurationClass(Class<?> configurationClass) Specify the Hibernate Configuration class to use.
void | setEntityCacheStrategies(Properties entityCacheStrategies) Specify the cache strategies for entities (persistent classes or named entities).
void | setEntityInterceptor(org.hibernate.Interceptor entityInterceptor) Set a Hibernate entity interceptor that allows to inspect and change property values before writing to and reading from the database.
void | setEventListeners(Map<String,Object> eventListeners) Specify the Hibernate event listeners to register, with listener types as keys and listener objects as values.
void | setFilterDefinitions(org.hibernate.engine.FilterDefinition[] filterDefinitions) Specify the Hibernate FilterDefinitions to register with the SessionFactory.
void | setHibernateProperties(Properties hibernateProperties) Set Hibernate properties, such as "hibernate.dialect".
void | setJtaTransactionManager(TransactionManager jtaTransactionManager) Set the JTA TransactionManager to be used for Hibernate's TransactionManagerLookup.
void | setLobHandler(LobHandler lobHandler) Set the LobHandler to be used by the SessionFactory.
void | setMappingDirectoryLocations(Resource[] mappingDirectoryLocations) Set locations of directories that contain Hibernate mapping resources, like "WEB-INF/mappings".
void | setMappingJarLocations(Resource[] mappingJarLocations) Set locations of jar files that contain Hibernate mapping resources, like "WEB-INF/lib/example.hbm.jar".
void | setMappingLocations(Resource[] mappingLocations) Set locations of Hibernate mapping files, for example as classpath resource "classpath:example.hbm.xml".
void | setMappingResources(String[] mappingResources) Set Hibernate mapping resources to be found in the class path, like "example.hbm.xml" or "mypackage/example.hbm.xml".
void | setNamingStrategy(org.hibernate.cfg.NamingStrategy namingStrategy) Set a Hibernate NamingStrategy for the SessionFactory, determining the physical column and table names given the info in the mapping document.
void | setSchemaUpdate(boolean schemaUpdate) Set whether to execute a schema update after SessionFactory initialization.
void | setTypeDefinitions(TypeDefinitionBean[] typeDefinitions) Specify the Hibernate type definitions to register with the SessionFactory, as Spring TypeDefinitionBean instances.
void | updateDatabaseSchema() Execute schema update script, determined by the Configuration object used for creating the SessionFactory.
void | validateDatabaseSchema() Execute schema creation script, determined by the Configuration object used for creating the SessionFactory.
Methods inherited from class org.springframework.orm.hibernate3.AbstractSessionFactoryBean
afterPropertiesSet, beforeSessionFactoryDestruction, convertHibernateAccessException, getDataSource, getObject, getObjectType, getSessionFactory, isExposeTransactionAwareSessionFactory, isSingleton, isUseTransactionAwareDataSource, setDataSource, setExposeTransactionAwareSessionFactory, setJdbcExceptionTranslator, setUseTransactionAwareDataSource, translateExceptionIfPossible, wrapSessionFactoryIfNecessary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

LocalSessionFactoryBean

public LocalSessionFactoryBean()
Method Detail

getConfigTimeDataSource

public static DataSource getConfigTimeDataSource()
Return the DataSource for the currently configured Hibernate SessionFactory, to be used by LocalDataSourceConnectionProvoder.

This instance will be set before initialization of the corresponding SessionFactory, and reset immediately afterwards. It is thus only available during configuration.

See Also:
AbstractSessionFactoryBean.setDataSource(javax.sql.DataSource), LocalDataSourceConnectionProvider

getConfigTimeTransactionManager

public static TransactionManager getConfigTimeTransactionManager()
Return the JTA TransactionManager for the currently configured Hibernate SessionFactory, to be used by LocalTransactionManagerLookup.

This instance will be set before initialization of the corresponding SessionFactory, and reset immediately afterwards. It is thus only available during configuration.

See Also:
setJtaTransactionManager(javax.transaction.TransactionManager), LocalTransactionManagerLookup

getConfigTimeCacheProvider

public static org.hibernate.cache.CacheProvider getConfigTimeCacheProvider()
Return the CacheProvider for the currently configured Hibernate SessionFactory, to be used by LocalCacheProviderProxy.

This instance will be set before initialization of the corresponding SessionFactory, and reset immediately afterwards. It is thus only available during configuration.

See Also:
setCacheProvider(org.hibernate.cache.CacheProvider)

getConfigTimeLobHandler

public static LobHandler getConfigTimeLobHandler()
Return the LobHandler for the currently configured Hibernate SessionFactory, to be used by UserType implementations like ClobStringType.

This instance will be set before initialization of the corresponding SessionFactory, and reset immediately afterwards. It is thus only available during configuration.

See Also:
setLobHandler(org.springframework.jdbc.support.lob.LobHandler), ClobStringType, BlobByteArrayType, BlobSerializableType

setConfigurationClass

public void setConfigurationClass(Class<?> configurationClass)
Specify the Hibernate Configuration class to use. Default is "org.hibernate.cfg.Configuration"; any subclass of this default Hibernate Configuration class can be specified.

Can be set to "org.hibernate.cfg.AnnotationConfiguration" for using Hibernate3 annotation support (initially only available as alpha download separate from the main Hibernate3 distribution).

Annotated packages and annotated classes can be specified via the corresponding tags in "hibernate.cfg.xml" then, so this will usually be combined with a "configLocation" property that points at such a standard Hibernate configuration file.

See Also:
setConfigLocation(org.springframework.core.io.Resource), Configuration, AnnotationConfiguration

setConfigLocation

public void setConfigLocation(Resource configLocation)
Set the location of a single Hibernate XML config file, for example as classpath resource "classpath:hibernate.cfg.xml".

Note: Can be omitted when all necessary properties and mapping resources are specified locally via this bean.

See Also:
Configuration.configure(java.net.URL)

setConfigLocations

public void setConfigLocations(Resource[] configLocations)
Set the locations of multiple Hibernate XML config files, for example as classpath resources "classpath:hibernate.cfg.xml,classpath:extension.cfg.xml".

Note: Can be omitted when all necessary properties and mapping resources are specified locally via this bean.

See Also:
Configuration.configure(java.net.URL)

setMappingResources

public void setMappingResources(String[] mappingResources)
Set Hibernate mapping resources to be found in the class path, like "example.hbm.xml" or "mypackage/example.hbm.xml". Analogous to mapping entries in a Hibernate XML config file. Alternative to the more generic setMappingLocations method.

Can be used to add to mappings from a Hibernate XML config file, or to specify all mappings locally.

See Also:
setMappingLocations(org.springframework.core.io.Resource[]), Configuration.addResource(java.lang.String, java.lang.ClassLoader)

setMappingLocations

public void setMappingLocations(Resource[] mappingLocations)
Set locations of Hibernate mapping files, for example as classpath resource "classpath:example.hbm.xml". Supports any resource location via Spring's resource abstraction, for example relative paths like "WEB-INF/mappings/example.hbm.xml" when running in an application context.

Can be used to add to mappings from a Hibernate XML config file, or to specify all mappings locally.

See Also:
Configuration.addInputStream(java.io.InputStream)

setCacheableMappingLocations

public void setCacheableMappingLocations(Resource[] cacheableMappingLocations)
Set locations of cacheable Hibernate mapping files, for example as web app resource "/WEB-INF/mapping/example.hbm.xml". Supports any resource location via Spring's resource abstraction, as long as the resource can be resolved in the file system.

Can be used to add to mappings from a Hibernate XML config file, or to specify all mappings locally.

See Also:
Configuration.addCacheableFile(java.io.File)

setMappingJarLocations

public void setMappingJarLocations(Resource[] mappingJarLocations)
Set locations of jar files that contain Hibernate mapping resources, like "WEB-INF/lib/example.hbm.jar".

Can be used to add to mappings from a Hibernate XML config file, or to specify all mappings locally.

See Also:
Configuration.addJar(java.io.File)

setMappingDirectoryLocations

public void setMappingDirectoryLocations(Resource[] mappingDirectoryLocations)
Set locations of directories that contain Hibernate mapping resources, like "WEB-INF/mappings".

Can be used to add to mappings from a Hibernate XML config file, or to specify all mappings locally.

See Also:
Configuration.addDirectory(java.io.File)

setHibernateProperties

public void setHibernateProperties(Properties hibernateProperties)
Set Hibernate properties, such as "hibernate.dialect".

Can be used to override values in a Hibernate XML config file, or to specify all necessary properties locally.

Note: Do not specify a transaction provider here when using Spring-driven transactions. It is also advisable to omit connection provider settings and use a Spring-set DataSource instead.

See Also:
AbstractSessionFactoryBean.setDataSource(javax.sql.DataSource)

getHibernateProperties

public Properties getHibernateProperties()
Return the Hibernate properties, if any. Mainly available for configuration through property paths that specify individual keys.

setJtaTransactionManager

public void setJtaTransactionManager(TransactionManager jtaTransactionManager)
Set the JTA TransactionManager to be used for Hibernate's TransactionManagerLookup. Allows for using a Spring-managed JTA TransactionManager for Hibernate's cache synchronization.

Note: If this is set, the Hibernate settings should not define a transaction manager lookup to avoid meaningless double configuration.

See Also:
LocalTransactionManagerLookup

setCacheRegionFactory

public void setCacheRegionFactory(Object cacheRegionFactory)
Set the Hibernate RegionFactory to use for the SessionFactory. Allows for using a Spring-managed RegionFactory instance.

As of Hibernate 3.3, this is the preferred mechanism for configuring caches, superseding the CacheProvider SPI. For Hibernate 3.2 compatibility purposes, the accepted reference is of type Object: the actual type is org.hibernate.cache.RegionFactory.

Note: If this is set, the Hibernate settings should not define a cache provider to avoid meaningless double configuration.

See Also:
RegionFactory

setCacheProvider

@Deprecated
public void setCacheProvider(org.hibernate.cache.CacheProvider cacheProvider)
Deprecated. as of Spring 3.0, following Hibernate 3.3's deprecation of the CacheProvider SPI

Set the Hibernate CacheProvider to use for the SessionFactory. Allows for using a Spring-managed CacheProvider instance.

Note: If this is set, the Hibernate settings should not define a cache provider to avoid meaningless double configuration.

See Also:
setCacheRegionFactory(java.lang.Object)

setLobHandler

public void setLobHandler(LobHandler lobHandler)
Set the LobHandler to be used by the SessionFactory. Will be exposed at config time for UserType implementations.

See Also:
getConfigTimeLobHandler(), UserType, ClobStringType, BlobByteArrayType, BlobSerializableType

setEntityInterceptor

public void setEntityInterceptor(org.hibernate.Interceptor entityInterceptor)
Set a Hibernate entity interceptor that allows to inspect and change property values before writing to and reading from the database. Will get applied to any new Session created by this factory.

Such an interceptor can either be set at the SessionFactory level, i.e. on LocalSessionFactoryBean, or at the Session level, i.e. on HibernateTemplate, HibernateInterceptor, and HibernateTransactionManager. It's preferable to set it on LocalSessionFactoryBean or HibernateTransactionManager to avoid repeated configuration and guarantee consistent behavior in transactions.

See Also:
HibernateAccessor.setEntityInterceptor(org.hibernate.Interceptor),
HibernateAccessor.setEntityInterceptor(org.hibernate.Interceptor),
HibernateTransactionManager.setEntityInterceptor(org.hibernate.Interceptor),
Configuration.setInterceptor(org.hibernate.Interceptor)

setNamingStrategy

public void setNamingStrategy(org.hibernate.cfg.NamingStrategy namingStrategy)
Set a Hibernate NamingStrategy for the SessionFactory, determining the physical column and table names given the info in the mapping document.

See Also:
Configuration.setNamingStrategy(org.hibernate.cfg.NamingStrategy)

setTypeDefinitions

public void setTypeDefinitions(TypeDefinitionBean[] typeDefinitions)
Specify the Hibernate type definitions to register with the SessionFactory, as Spring TypeDefinitionBean instances. This is an alternative to specifying <<typedef> elements in Hibernate mapping files.

Unfortunately, Hibernate itself does not define a complete object that represents a type definition, hence the need for Spring's TypeDefinitionBean.

See Also:
TypeDefinitionBean, Mappings.addTypeDef(String, String, java.util.Properties)

setFilterDefinitions

public void setFilterDefinitions(org.hibernate.engine.FilterDefinition[] filterDefinitions)
Specify the Hibernate FilterDefinitions to register with the SessionFactory. This is an alternative to specifying <<filter-def> elements in Hibernate mapping files.

Typically, the passed-in FilterDefinition objects will have been defined as Spring FilterDefinitionFactoryBeans, probably as inner beans within the LocalSessionFactoryBean definition.

See Also:
FilterDefinitionFactoryBean, Configuration.addFilterDefinition(org.hibernate.engine.FilterDefinition)

setEntityCacheStrategies

public void setEntityCacheStrategies(Properties entityCacheStrategies)
Specify the cache strategies for entities (persistent classes or named entities). This configuration setting corresponds to the <class-cache> entry in the "hibernate.cfg.xml" configuration format.

For example:

 <property name="entityCacheStrategies">
   <props>
     <prop key="com.mycompany.Customer">read-write</prop>
     <prop key="com.mycompany.Product">read-only,myRegion</prop>
   </props>
 </property>

Parameters:
entityCacheStrategies - properties that define entity cache strategies, with class names as keys and cache concurrency strategies as values
See Also:
Configuration.setCacheConcurrencyStrategy(String, String)

setCollectionCacheStrategies

public void setCollectionCacheStrategies(Properties collectionCacheStrategies)
Specify the cache strategies for persistent collections (with specific roles). This configuration setting corresponds to the <collection-cache> entry in the "hibernate.cfg.xml" configuration format.

For example:

 <property name="collectionCacheStrategies">
   <props>
     <prop key="com.mycompany.Order.items">read-write</prop>
     <prop key="com.mycompany.Product.categories">read-only,myRegion</prop>
   </props>
 </property>

Parameters:
collectionCacheStrategies - properties that define collection cache strategies, with collection roles as keys and cache concurrency strategies as values
See Also:
Configuration.setCollectionCacheConcurrencyStrategy(String, String)

setEventListeners

public void setEventListeners(Map<String,Object> eventListeners)
Specify the Hibernate event listeners to register, with listener types as keys and listener objects as values. Instead of a single listener object, you can also pass in a list or set of listeners objects as value.

See the Hibernate documentation for further details on listener types and associated listener interfaces.

Parameters:
eventListeners - Map with listener type Strings as keys and listener objects as values
See Also:
Configuration.setListener(String, Object)

setSchemaUpdate

public void setSchemaUpdate(boolean schemaUpdate)
Set whether to execute a schema update after SessionFactory initialization.

For details on how to make schema update scripts work, see the Hibernate documentation, as this class leverages the same schema update script support in org.hibernate.cfg.Configuration as Hibernate's own SchemaUpdate tool.

See Also:
Configuration.generateSchemaUpdateScript(org.hibernate.dialect.Dialect, org.hibernate.tool.hbm2ddl.DatabaseMetadata), SchemaUpdate

setBeanClassLoader

public void setBeanClassLoader(ClassLoader beanClassLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
beanClassLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

buildSessionFactory

protected org.hibernate.SessionFactory buildSessionFactory()
                                                    throws Exception
Description copied from class: AbstractSessionFactoryBean
Build the underlying Hibernate SessionFactory.

Specified by:
buildSessionFactory in class AbstractSessionFactoryBean
Returns:
the raw SessionFactory (potentially to be wrapped with a transaction-aware proxy before it is exposed to the application)
Throws:
Exception - in case of initialization failure

newConfiguration

protected org.hibernate.cfg.Configuration newConfiguration()
                                                    throws org.hibernate.HibernateException
Subclasses can override this method to perform custom initialization of the Configuration instance used for SessionFactory creation. The properties of this LocalSessionFactoryBean will be applied to the Configuration object that gets returned here.

The default implementation creates a new Configuration instance. A custom implementation could prepare the instance in a specific way, or use a custom Configuration subclass.

Returns:
the Configuration instance
Throws:
org.hibernate.HibernateException - in case of Hibernate initialization errors
See Also:
Configuration.Configuration()

postProcessMappings

protected void postProcessMappings(org.hibernate.cfg.Configuration config)
                            throws org.hibernate.HibernateException
To be implemented by subclasses that want to to register further mappings on the Configuration object after this FactoryBean registered its specified mappings.

Invoked before the Configuration.buildMappings() call, so that it can still extend and modify the mapping information.

Parameters:
config - the current Configuration object
Throws:
org.hibernate.HibernateException - in case of Hibernate initialization errors
See Also:
Configuration.buildMappings()

postProcessConfiguration

protected void postProcessConfiguration(org.hibernate.cfg.Configuration config)
                                 throws org.hibernate.HibernateException
To be implemented by subclasses that want to to perform custom post-processing of the Configuration object after this FactoryBean performed its default initialization.

Invoked after the Configuration.buildMappings() call, so that it can operate on the completed and fully parsed mapping information.

Parameters:
config - the current Configuration object
Throws:
org.hibernate.HibernateException - in case of Hibernate initialization errors
See Also:
Configuration.buildMappings()

newSessionFactory

protected org.hibernate.SessionFactory newSessionFactory(org.hibernate.cfg.Configuration config)
                                                  throws org.hibernate.HibernateException
Subclasses can override this method to perform custom initialization of the SessionFactory instance, creating it via the given Configuration object that got prepared by this LocalSessionFactoryBean.

The default implementation invokes Configuration's buildSessionFactory. A custom implementation could prepare the instance in a specific way, or use a custom SessionFactoryImpl subclass.

Parameters:
config - Configuration prepared by this LocalSessionFactoryBean
Returns:
the SessionFactory instance
Throws:
org.hibernate.HibernateException - in case of Hibernate initialization errors
See Also:
Configuration.buildSessionFactory()

getConfiguration

public final org.hibernate.cfg.Configuration getConfiguration()
Return the Configuration object used to build the SessionFactory. Allows access to configuration metadata stored there (rarely needed).

Throws:
IllegalStateException - if the Configuration object has not been initialized yet

afterSessionFactoryCreation

protected void afterSessionFactoryCreation()
                                    throws Exception
Executes schema update if requested.

Overrides:
afterSessionFactoryCreation in class AbstractSessionFactoryBean
Throws:
Exception - in case of initialization failure
See Also:
setSchemaUpdate(boolean), updateDatabaseSchema()

destroy

public void destroy()
             throws org.hibernate.HibernateException
Allows for schema export on shutdown.

Specified by:
destroy in interface DisposableBean
Overrides:
destroy in class AbstractSessionFactoryBean
Throws:
org.hibernate.HibernateException

updateDatabaseSchema

public void updateDatabaseSchema()
                          throws DataAccessException
Execute schema update script, determined by the Configuration object used for creating the SessionFactory. A replacement for Hibernate's SchemaUpdate class, for automatically executing schema update scripts on application startup. Can also be invoked manually.

Fetch the LocalSessionFactoryBean itself rather than the exposed SessionFactory to be able to invoke this method, e.g. via LocalSessionFactoryBean lsfb = (LocalSessionFactoryBean) ctx.getBean("&mySessionFactory");.

Uses the SessionFactory that this bean generates for accessing a JDBC connection to perform the script.

Throws:
DataAccessException - in case of script execution errors
See Also:
setSchemaUpdate(boolean), Configuration.generateSchemaUpdateScript(org.hibernate.dialect.Dialect, org.hibernate.tool.hbm2ddl.DatabaseMetadata), SchemaUpdate

validateDatabaseSchema

public void validateDatabaseSchema()
                            throws DataAccessException
Execute schema creation script, determined by the Configuration object used for creating the SessionFactory. A replacement for Hibernate's SchemaValidator class, to be invoked after application startup.

Fetch the LocalSessionFactoryBean itself rather than the exposed SessionFactory to be able to invoke this method, e.g. via LocalSessionFactoryBean lsfb = (LocalSessionFactoryBean) ctx.getBean("&mySessionFactory");.

Uses the SessionFactory that this bean generates for accessing a JDBC connection to perform the script.

Throws:
DataAccessException - in case of script execution errors
See Also:
Configuration.validateSchema(org.hibernate.dialect.Dialect, org.hibernate.tool.hbm2ddl.DatabaseMetadata), SchemaValidator

dropDatabaseSchema

public void dropDatabaseSchema()
                        throws DataAccessException
Execute schema drop script, determined by the Configuration object used for creating the SessionFactory. A replacement for Hibernate's SchemaExport class, to be invoked on application setup.

Fetch the LocalSessionFactoryBean itself rather than the exposed SessionFactory to be able to invoke this method, e.g. via LocalSessionFactoryBean lsfb = (LocalSessionFactoryBean) ctx.getBean("&mySessionFactory");.

Uses the SessionFactory that this bean generates for accessing a JDBC connection to perform the script.

Throws:
DataAccessException - in case of script execution errors
See Also:
Configuration.generateDropSchemaScript(org.hibernate.dialect.Dialect), SchemaExport.drop(boolean, boolean)

createDatabaseSchema

public void createDatabaseSchema()
                          throws DataAccessException
Execute schema creation script, determined by the Configuration object used for creating the SessionFactory. A replacement for Hibernate's SchemaExport class, to be invoked on application setup.

Fetch the LocalSessionFactoryBean itself rather than the exposed SessionFactory to be able to invoke this method, e.g. via LocalSessionFactoryBean lsfb = (LocalSessionFactoryBean) ctx.getBean("&mySessionFactory");.

Uses the SessionFactory that this bean generates for accessing a JDBC connection to perform the script.

Throws:
DataAccessException - in case of script execution errors
See Also:
Configuration.generateSchemaCreationScript(org.hibernate.dialect.Dialect), SchemaExport.create(boolean, boolean)

executeSchemaScript

protected void executeSchemaScript(Connection con,
                                   String[] sql)
                            throws SQLException
Execute the given schema script on the given JDBC Connection.

Note that the default implementation will log unsuccessful statements and continue to execute. Override the executeSchemaStatement method to treat failures differently.

Parameters:
con - the JDBC Connection to execute the script on
sql - the SQL statements to execute
Throws:
SQLException - if thrown by JDBC methods
See Also:
executeSchemaStatement(java.sql.Statement, java.lang.String)

executeSchemaStatement

protected void executeSchemaStatement(Statement stmt,
                                      String sql)
                               throws SQLException
Execute the given schema SQL on the given JDBC Statement.

Note that the default implementation will log unsuccessful statements and continue to execute. Override this method to treat failures differently.

Parameters:
stmt - the JDBC Statement to execute the SQL on
sql - the SQL statement to execute
Throws:
SQLException - if thrown by JDBC methods (and considered fatal)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LocalTransactionManagerLookup

org.springframework.orm.hibernate3
Class LocalTransactionManagerLookup

java.lang.Object
    extended by  org.springframework.orm.hibernate3.LocalTransactionManagerLookup
All Implemented Interfaces:
org.hibernate.transaction.TransactionManagerLookup
public class LocalTransactionManagerLookup
extends Object
implements org.hibernate.transaction.TransactionManagerLookup

Implementation of Hibernate's TransactionManagerLookup interface that returns a Spring-managed JTA TransactionManager, determined by LocalSessionFactoryBean's "jtaTransactionManager" property.

The main advantage of this TransactionManagerLookup is that it avoids double configuration of JTA specifics. A single TransactionManager bean can be used for both JtaTransactionManager and LocalSessionFactoryBean, with no JTA setup in Hibernate configuration.

Alternatively, use Hibernate's own TransactionManagerLookup implementations: Spring's JtaTransactionManager only requires a TransactionManager for suspending and resuming transactions, so you might not need to apply such special Spring configuration at all.

Since:
1.2
Author:
Juergen Hoeller
See Also:
LocalSessionFactoryBean.setJtaTransactionManager(javax.transaction.TransactionManager), JtaTransactionManager.setTransactionManager(javax.transaction.TransactionManager)

Constructor Summary
LocalTransactionManagerLookup()
Method Summary
Object | getTransactionIdentifier(Transaction transaction)
TransactionManager | getTransactionManager(Properties props)
String | getUserTransactionName()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

LocalTransactionManagerLookup

public LocalTransactionManagerLookup()
Method Detail

getTransactionManager

public TransactionManager getTransactionManager(Properties props)
Specified by:
getTransactionManager in interface org.hibernate.transaction.TransactionManagerLookup

getUserTransactionName

public String getUserTransactionName()
Specified by:
getUserTransactionName in interface org.hibernate.transaction.TransactionManagerLookup

getTransactionIdentifier

public Object getTransactionIdentifier(Transaction transaction)
Specified by:
getTransactionIdentifier in interface org.hibernate.transaction.TransactionManagerLookup
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SessionFactoryUtils

org.springframework.orm.hibernate3
Class SessionFactoryUtils

java.lang.Object
    extended by  org.springframework.orm.hibernate3.SessionFactoryUtils

public abstract class SessionFactoryUtils
extends Object

Helper class featuring methods for Hibernate Session handling, allowing for reuse of Hibernate Session instances within transactions. Also provides support for exception translation.

Supports synchronization with both Spring-managed JTA transactions (see JtaTransactionManager) and non-Spring JTA transactions (i.e. plain JTA or EJB CMT), transparently providing transaction-scoped Hibernate Sessions. Note that for non-Spring JTA transactions, a JTA TransactionManagerLookup has to be specified in the Hibernate configuration.

Used internally by HibernateTemplate, HibernateInterceptor and HibernateTransactionManager. Can also be used directly in application code.

Since:
1.2
Author:
Juergen Hoeller
See Also:
getSession(org.hibernate.SessionFactory, boolean), releaseSession(org.hibernate.Session, org.hibernate.SessionFactory), HibernateTransactionManager, JtaTransactionManager, TransactionSynchronizationManager

Field Summary
static int SESSION_SYNCHRONIZATION_ORDER
Order value for TransactionSynchronization objects that clean up Hibernate Sessions.
Constructor Summary
SessionFactoryUtils()
Method Summary
static void | applyTransactionTimeout(org.hibernate.Criteria criteria, org.hibernate.SessionFactory sessionFactory) Apply the current transaction timeout, if any, to the given Hibernate Criteria object.
static void | applyTransactionTimeout(org.hibernate.Query query, org.hibernate.SessionFactory sessionFactory) Apply the current transaction timeout, if any, to the given Hibernate Query object.
static void | closeSession(org.hibernate.Session session) Perform actual closing of the Hibernate Session, catching and logging any cleanup exceptions thrown.
static DataAccessException | convertHibernateAccessException(org.hibernate.HibernateException ex) Convert the given HibernateException to an appropriate exception from the org.springframework.dao hierarchy.
static org.hibernate.Session | doGetSession(org.hibernate.SessionFactory sessionFactory, boolean allowCreate) Get a Hibernate Session for the given SessionFactory.
static DataSource | getDataSource(org.hibernate.SessionFactory sessionFactory) Determine the DataSource of the given SessionFactory.
static TransactionManager | getJtaTransactionManager(org.hibernate.SessionFactory sessionFactory, org.hibernate.Session session) Try to retrieve the JTA TransactionManager from the given SessionFactory and/or Session.
static org.hibernate.Session | getNewSession(org.hibernate.SessionFactory sessionFactory) Get a new Hibernate Session from the given SessionFactory.
static org.hibernate.Session | getNewSession(org.hibernate.SessionFactory sessionFactory, org.hibernate.Interceptor entityInterceptor) Get a new Hibernate Session from the given SessionFactory.
static org.hibernate.Session | getSession(org.hibernate.SessionFactory sessionFactory, boolean allowCreate) Get a Hibernate Session for the given SessionFactory.
static org.hibernate.Session | getSession(org.hibernate.SessionFactory sessionFactory, org.hibernate.Interceptor entityInterceptor, SQLExceptionTranslator jdbcExceptionTranslator) Get a Hibernate Session for the given SessionFactory.
static boolean | hasTransactionalSession(org.hibernate.SessionFactory sessionFactory) Return whether there is a transactional Hibernate Session for the current thread, that is, a Session bound to the current thread by Spring's transaction facilities.
static void | initDeferredClose(org.hibernate.SessionFactory sessionFactory) Initialize deferred close for the current thread and the given SessionFactory.
static boolean | isDeferredCloseActive(org.hibernate.SessionFactory sessionFactory) Determine whether deferred close is active for the current thread and the given SessionFactory.
static boolean | isSessionTransactional(org.hibernate.Session session, org.hibernate.SessionFactory sessionFactory) Return whether the given Hibernate Session is transactional, that is, bound to the current thread by Spring's transaction facilities.
static SQLExceptionTranslator | newJdbcExceptionTranslator(org.hibernate.SessionFactory sessionFactory) Create an appropriate SQLExceptionTranslator for the given SessionFactory.
static void | processDeferredClose(org.hibernate.SessionFactory sessionFactory) Process all Hibernate Sessions that have been registered for deferred close for the given SessionFactory.
static void | releaseSession(org.hibernate.Session session, org.hibernate.SessionFactory sessionFactory) Close the given Session, created via the given factory, if it is not managed externally (i.e.
static String | toString(org.hibernate.Session session) Stringify the given Session for debug logging.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

SESSION_SYNCHRONIZATION_ORDER

public static final int SESSION_SYNCHRONIZATION_ORDER
Order value for TransactionSynchronization objects that clean up Hibernate Sessions. Returns DataSourceUtils.CONNECTION_SYNCHRONIZATION_ORDER - 100 to execute Session cleanup before JDBC Connection cleanup, if any.

See Also:
DataSourceUtils.CONNECTION_SYNCHRONIZATION_ORDER, Constant Field Values
Constructor Detail

SessionFactoryUtils

public SessionFactoryUtils()
Method Detail

getDataSource

public static DataSource getDataSource(org.hibernate.SessionFactory sessionFactory)
Determine the DataSource of the given SessionFactory.

Parameters:
sessionFactory - the SessionFactory to check
Returns:
the DataSource, or null if none found
See Also:
SessionFactoryImplementor.getConnectionProvider(), LocalDataSourceConnectionProvider

newJdbcExceptionTranslator

public static SQLExceptionTranslator newJdbcExceptionTranslator(org.hibernate.SessionFactory sessionFactory)
Create an appropriate SQLExceptionTranslator for the given SessionFactory. If a DataSource is found, a SQLErrorCodeSQLExceptionTranslator for the DataSource is created; else, a SQLStateSQLExceptionTranslator as fallback.

Parameters:
sessionFactory - the SessionFactory to create the translator for
Returns:
the SQLExceptionTranslator
See Also:
getDataSource(org.hibernate.SessionFactory), SQLErrorCodeSQLExceptionTranslator, SQLStateSQLExceptionTranslator

getJtaTransactionManager

public static TransactionManager getJtaTransactionManager(org.hibernate.SessionFactory sessionFactory,
                                                          org.hibernate.Session session)
Try to retrieve the JTA TransactionManager from the given SessionFactory and/or Session. Check the passed-in SessionFactory for implementing SessionFactoryImplementor (the usual case), falling back to the SessionFactory reference that the Session itself carries.

Parameters:
sessionFactory - Hibernate SessionFactory
session - Hibernate Session (can also be null)
Returns:
the JTA TransactionManager, if any
See Also:
TransactionManager, SessionFactoryImplementor.getTransactionManager(), Session.getSessionFactory(), SessionFactoryImpl

getSession

public static org.hibernate.Session getSession(org.hibernate.SessionFactory sessionFactory,
                                               boolean allowCreate)
                                        throws DataAccessResourceFailureException,
                                               IllegalStateException
Get a Hibernate Session for the given SessionFactory. Is aware of and will return any existing corresponding Session bound to the current thread, for example when using HibernateTransactionManager. Will create a new Session otherwise, if "allowCreate" is true.

This is the getSession method used by typical data access code, in combination with releaseSession called when done with the Session. Note that HibernateTemplate allows to write data access code without caring about such resource handling.

Parameters:
sessionFactory - Hibernate SessionFactory to create the session with
allowCreate - whether a non-transactional Session should be created when no transactional Session can be found for the current thread
Returns:
the Hibernate Session
Throws:
DataAccessResourceFailureException - if the Session couldn't be created
IllegalStateException - if no thread-bound Session found and "allowCreate" is false
See Also:
getSession(SessionFactory, Interceptor, SQLExceptionTranslator), releaseSession(org.hibernate.Session, org.hibernate.SessionFactory), HibernateTemplate

getSession

public static org.hibernate.Session getSession(org.hibernate.SessionFactory sessionFactory,
                                               org.hibernate.Interceptor entityInterceptor,
                                               SQLExceptionTranslator jdbcExceptionTranslator)
                                        throws DataAccessResourceFailureException
Get a Hibernate Session for the given SessionFactory. Is aware of and will return any existing corresponding Session bound to the current thread, for example when using HibernateTransactionManager. Will always create a new Session otherwise.

Supports setting a Session-level Hibernate entity interceptor that allows to inspect and change property values before writing to and reading from the database. Such an interceptor can also be set at the SessionFactory level (i.e. on LocalSessionFactoryBean), on HibernateTransactionManager, or on HibernateInterceptor/HibernateTemplate.

Parameters:
sessionFactory - Hibernate SessionFactory to create the session with
entityInterceptor - Hibernate entity interceptor, or null if none
jdbcExceptionTranslator - SQLExcepionTranslator to use for flushing the Session on transaction synchronization (may be null; only used when actually registering a transaction synchronization)
Returns:
the Hibernate Session
Throws:
DataAccessResourceFailureException - if the Session couldn't be created
See Also:
LocalSessionFactoryBean.setEntityInterceptor(org.hibernate.Interceptor),
HibernateAccessor.setEntityInterceptor(org.hibernate.Interceptor),
HibernateAccessor.setEntityInterceptor(org.hibernate.Interceptor)

doGetSession

public static org.hibernate.Session doGetSession(org.hibernate.SessionFactory sessionFactory,
                                                 boolean allowCreate)
                                          throws org.hibernate.HibernateException,
                                                 IllegalStateException
Get a Hibernate Session for the given SessionFactory. Is aware of and will return any existing corresponding Session bound to the current thread, for example when using HibernateTransactionManager. Will create a new Session otherwise, if "allowCreate" is true.

Throws the original HibernateException, in contrast to getSession(org.hibernate.SessionFactory, boolean).

Parameters:
sessionFactory - Hibernate SessionFactory to create the session with
allowCreate - whether a non-transactional Session should be created when no transactional Session can be found for the current thread
Returns:
the Hibernate Session
Throws:
org.hibernate.HibernateException - if the Session couldn't be created
IllegalStateException - if no thread-bound Session found and allowCreate false

getNewSession

public static org.hibernate.Session getNewSession(org.hibernate.SessionFactory sessionFactory)
Get a new Hibernate Session from the given SessionFactory. Will return a new Session even if there already is a pre-bound Session for the given SessionFactory.

Within a transaction, this method will create a new Session that shares the transaction's JDBC Connection. More specifically, it will use the same JDBC Connection as the pre-bound Hibernate Session.

Parameters:
sessionFactory - Hibernate SessionFactory to create the session with
Returns:
the new Session

getNewSession

public static org.hibernate.Session getNewSession(org.hibernate.SessionFactory sessionFactory,
                                                  org.hibernate.Interceptor entityInterceptor)
Get a new Hibernate Session from the given SessionFactory. Will return a new Session even if there already is a pre-bound Session for the given SessionFactory.

Within a transaction, this method will create a new Session that shares the transaction's JDBC Connection. More specifically, it will use the same JDBC Connection as the pre-bound Hibernate Session.

Parameters:
sessionFactory - Hibernate SessionFactory to create the session with
entityInterceptor - Hibernate entity interceptor, or null if none
Returns:
the new Session

toString

public static String toString(org.hibernate.Session session)
Stringify the given Session for debug logging. Returns output equivalent to Object.toString(): the fully qualified class name + "@" + the identity hash code.

The sole reason why this is necessary is because Hibernate3's Session.toString() implementation is broken (and won't be fixed): it logs the toString representation of all persistent objects in the Session, which might lead to ConcurrentModificationExceptions if the persistent objects in turn refer to the Session (for example, for lazy loading).

Parameters:
session - the Hibernate Session to stringify
Returns:
the String representation of the given Session

hasTransactionalSession

public static boolean hasTransactionalSession(org.hibernate.SessionFactory sessionFactory)
Return whether there is a transactional Hibernate Session for the current thread, that is, a Session bound to the current thread by Spring's transaction facilities.

Parameters:
sessionFactory - Hibernate SessionFactory to check (may be null)
Returns:
whether there is a transactional Session for current thread

isSessionTransactional

public static boolean isSessionTransactional(org.hibernate.Session session,
                                             org.hibernate.SessionFactory sessionFactory)
Return whether the given Hibernate Session is transactional, that is, bound to the current thread by Spring's transaction facilities.

Parameters:
session - the Hibernate Session to check
sessionFactory - Hibernate SessionFactory that the Session was created with (may be null)
Returns:
whether the Session is transactional

applyTransactionTimeout

public static void applyTransactionTimeout(org.hibernate.Query query,
                                           org.hibernate.SessionFactory sessionFactory)
Apply the current transaction timeout, if any, to the given Hibernate Query object.

Parameters:
query - the Hibernate Query object
sessionFactory - Hibernate SessionFactory that the Query was created for (may be null)
See Also:
Query.setTimeout(int)

applyTransactionTimeout

public static void applyTransactionTimeout(org.hibernate.Criteria criteria,
                                           org.hibernate.SessionFactory sessionFactory)
Apply the current transaction timeout, if any, to the given Hibernate Criteria object.

Parameters:
criteria - the Hibernate Criteria object
sessionFactory - Hibernate SessionFactory that the Criteria was created for
See Also:
Criteria.setTimeout(int)

convertHibernateAccessException

public static DataAccessException convertHibernateAccessException(org.hibernate.HibernateException ex)
Convert the given HibernateException to an appropriate exception from the org.springframework.dao hierarchy.

Parameters:
ex - HibernateException that occured
Returns:
the corresponding DataAccessException instance
See Also:
HibernateAccessor.convertHibernateAccessException(org.hibernate.HibernateException), HibernateTransactionManager.convertHibernateAccessException(org.hibernate.HibernateException)

isDeferredCloseActive

public static boolean isDeferredCloseActive(org.hibernate.SessionFactory sessionFactory)
Determine whether deferred close is active for the current thread and the given SessionFactory.

Parameters:
sessionFactory - the Hibernate SessionFactory to check
Returns:
whether deferred close is active

initDeferredClose

public static void initDeferredClose(org.hibernate.SessionFactory sessionFactory)
Initialize deferred close for the current thread and the given SessionFactory. Sessions will not be actually closed on close calls then, but rather at a processDeferredClose(org.hibernate.SessionFactory) call at a finishing point (like request completion).

Used by OpenSessionInViewFilter and OpenSessionInViewInterceptor when not configured for a single session.

Parameters:
sessionFactory - the Hibernate SessionFactory to initialize deferred close for
See Also:
processDeferredClose(org.hibernate.SessionFactory),
releaseSession(org.hibernate.Session, org.hibernate.SessionFactory),
OpenSessionInViewFilter.setSingleSession(boolean),
OpenSessionInViewInterceptor.setSingleSession(boolean)

processDeferredClose

public static void processDeferredClose(org.hibernate.SessionFactory sessionFactory)
Process all Hibernate Sessions that have been registered for deferred close for the given SessionFactory.

Parameters:
sessionFactory - the Hibernate SessionFactory to process deferred close for
See Also:
initDeferredClose(org.hibernate.SessionFactory), releaseSession(org.hibernate.Session, org.hibernate.SessionFactory)

releaseSession

public static void releaseSession(org.hibernate.Session session,
                                  org.hibernate.SessionFactory sessionFactory)
Close the given Session, created via the given factory, if it is not managed externally (i.e. not bound to the thread).

Parameters:
session - the Hibernate Session to close (may be null)
sessionFactory - Hibernate SessionFactory that the Session was created with (may be null)

closeSession

public static void closeSession(org.hibernate.Session session)
Perform actual closing of the Hibernate Session, catching and logging any cleanup exceptions thrown.

Parameters:
session - the Hibernate Session to close (may be null)
See Also:
Session.close()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SessionHolder

org.springframework.orm.hibernate3
Class SessionHolder

java.lang.Object
    extended by  org.springframework.transaction.support.ResourceHolderSupport
        extended by  org.springframework.orm.hibernate3.SessionHolder
All Implemented Interfaces:
ResourceHolder
public class SessionHolder
extends ResourceHolderSupport

Session holder, wrapping a Hibernate Session and a Hibernate Transaction. HibernateTransactionManager binds instances of this class to the thread, for a given SessionFactory.

Note: This is an SPI class, not intended to be used by applications.

Since:
1.2
Author:
Juergen Hoeller
See Also:
HibernateTransactionManager, SessionFactoryUtils

Constructor Summary
SessionHolder(Object key, org.hibernate.Session session)
SessionHolder(org.hibernate.Session session)
Method Summary
void | addSession(Object key, org.hibernate.Session session)
void | addSession(org.hibernate.Session session)
void | clear() Clear the transactional state of this resource holder.
boolean | containsSession(org.hibernate.Session session)
boolean | doesNotHoldNonDefaultSession()
org.hibernate.Session | getAnySession()
org.hibernate.FlushMode | getPreviousFlushMode()
org.hibernate.Session | getSession()
org.hibernate.Session | getSession(Object key)
org.hibernate.Transaction | getTransaction()
org.hibernate.Session | getValidatedSession()
org.hibernate.Session | getValidatedSession(Object key)
boolean | isEmpty()
org.hibernate.Session | removeSession(Object key)
void | setPreviousFlushMode(org.hibernate.FlushMode previousFlushMode)
void | setTransaction(org.hibernate.Transaction transaction)
Methods inherited from class org.springframework.transaction.support.ResourceHolderSupport
getDeadline, getTimeToLiveInMillis, getTimeToLiveInSeconds, hasTimeout, isOpen, isRollbackOnly, isSynchronizedWithTransaction, isVoid, released, requested, reset, setRollbackOnly, setSynchronizedWithTransaction, setTimeoutInMillis, setTimeoutInSeconds, unbound
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SessionHolder

public SessionHolder(org.hibernate.Session session)

SessionHolder

public SessionHolder(Object key,
                     org.hibernate.Session session)
Method Detail

getSession

public org.hibernate.Session getSession()

getSession

public org.hibernate.Session getSession(Object key)

getValidatedSession

public org.hibernate.Session getValidatedSession()

getValidatedSession

public org.hibernate.Session getValidatedSession(Object key)

getAnySession

public org.hibernate.Session getAnySession()

addSession

public void addSession(org.hibernate.Session session)

addSession

public void addSession(Object key,
                       org.hibernate.Session session)

removeSession

public org.hibernate.Session removeSession(Object key)

containsSession

public boolean containsSession(org.hibernate.Session session)

isEmpty

public boolean isEmpty()

doesNotHoldNonDefaultSession

public boolean doesNotHoldNonDefaultSession()

setTransaction

public void setTransaction(org.hibernate.Transaction transaction)

getTransaction

public org.hibernate.Transaction getTransaction()

setPreviousFlushMode

public void setPreviousFlushMode(org.hibernate.FlushMode previousFlushMode)

getPreviousFlushMode

public org.hibernate.FlushMode getPreviousFlushMode()

clear

public void clear()
Description copied from class: ResourceHolderSupport
Clear the transactional state of this resource holder.

Overrides:
clear in class ResourceHolderSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SpringSessionContext

org.springframework.orm.hibernate3
Class SpringSessionContext

java.lang.Object
    extended by  org.springframework.orm.hibernate3.SpringSessionContext
All Implemented Interfaces:
Serializable, org.hibernate.context.CurrentSessionContext
public class SpringSessionContext
extends Object
implements org.hibernate.context.CurrentSessionContext

Implementation of Hibernate 3.1's CurrentSessionContext interface that delegates to Spring's SessionFactoryUtils for providing a Spring-managed current Session.

Used by Spring's LocalSessionFactoryBean when told to expose a transaction-aware SessionFactory. This is the default as of Spring 2.5.

This CurrentSessionContext implementation can also be specified in custom SessionFactory setup through the "hibernate.current_session_context_class" property, with the fully qualified name of this class as value.

Since:
2.0
Author:
Juergen Hoeller
See Also:
SessionFactoryUtils.doGetSession(org.hibernate.SessionFactory, boolean), AbstractSessionFactoryBean.setExposeTransactionAwareSessionFactory(boolean), Serialized Form

Constructor Summary
SpringSessionContext(org.hibernate.engine.SessionFactoryImplementor sessionFactory)
Create a new SpringSessionContext for the given Hibernate SessionFactory.
Method Summary
 org.hibernate.classic.Session currentSession()
Retrieve the Spring-managed Session for the current thread, if any.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SpringSessionContext

public SpringSessionContext(org.hibernate.engine.SessionFactoryImplementor sessionFactory)
Create a new SpringSessionContext for the given Hibernate SessionFactory.

Parameters:
sessionFactory - the SessionFactory to provide current Sessions for
Method Detail

currentSession

public org.hibernate.classic.Session currentSession()
                                             throws org.hibernate.HibernateException
Retrieve the Spring-managed Session for the current thread, if any.

Specified by:
currentSession in interface org.hibernate.context.CurrentSessionContext
Throws:
org.hibernate.HibernateException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SpringTransactionFactory

org.springframework.orm.hibernate3
Class SpringTransactionFactory

java.lang.Object
    extended by  org.springframework.orm.hibernate3.SpringTransactionFactory
All Implemented Interfaces:
org.hibernate.transaction.TransactionFactory
public class SpringTransactionFactory
extends Object
implements org.hibernate.transaction.TransactionFactory

Spring-aware implementation of the Hibernate TransactionFactory interface, aware of Spring-synchronized transactions (in particular Spring-managed JTA transactions) and asking for default release mode ON_CLOSE. Otherwise identical to Hibernate's default JDBCTransactionFactory implementation.

Since:
2.5.4
Author:
Juergen Hoeller
See Also:
TransactionSynchronizationManager, JDBCTransactionFactory

Nested Class Summary
Nested classes/interfaces inherited from interface org.hibernate.transaction.TransactionFactory
org.hibernate.transaction.TransactionFactory.Context
Constructor Summary
SpringTransactionFactory()
Method Summary
boolean | areCallbacksLocalToHibernateTransactions()
void | configure(Properties props)
org.hibernate.Transaction | createTransaction(org.hibernate.jdbc.JDBCContext jdbcContext, org.hibernate.transaction.TransactionFactory.Context transactionContext)
org.hibernate.ConnectionReleaseMode | getDefaultReleaseMode() Sets connection release mode "on_close" as default.
boolean | isTransactionInProgress(org.hibernate.jdbc.JDBCContext jdbcContext, org.hibernate.transaction.TransactionFactory.Context transactionContext, org.hibernate.Transaction transaction)
boolean | isTransactionManagerRequired()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SpringTransactionFactory

public SpringTransactionFactory()
Method Detail

getDefaultReleaseMode

public org.hibernate.ConnectionReleaseMode getDefaultReleaseMode()
Sets connection release mode "on_close" as default.

This was the case for Hibernate 3.0; Hibernate 3.1 changed it to "auto" (i.e. "after_statement" or "after_transaction"). However, for Spring's resource management (in particular for HibernateTransactionManager), "on_close" is the better default.

Specified by:
getDefaultReleaseMode in interface org.hibernate.transaction.TransactionFactory

createTransaction

public org.hibernate.Transaction createTransaction(org.hibernate.jdbc.JDBCContext jdbcContext,
                                                   org.hibernate.transaction.TransactionFactory.Context transactionContext)
Specified by:
createTransaction in interface org.hibernate.transaction.TransactionFactory

configure

public void configure(Properties props)
Specified by:
configure in interface org.hibernate.transaction.TransactionFactory

isTransactionManagerRequired

public boolean isTransactionManagerRequired()
Specified by:
isTransactionManagerRequired in interface org.hibernate.transaction.TransactionFactory

areCallbacksLocalToHibernateTransactions

public boolean areCallbacksLocalToHibernateTransactions()
Specified by:
areCallbacksLocalToHibernateTransactions in interface org.hibernate.transaction.TransactionFactory

isTransactionInProgress

public boolean isTransactionInProgress(org.hibernate.jdbc.JDBCContext jdbcContext,
                                       org.hibernate.transaction.TransactionFactory.Context transactionContext,
                                       org.hibernate.Transaction transaction)
Specified by:
isTransactionInProgress in interface org.hibernate.transaction.TransactionFactory
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionAwareDataSourceConnectionProvider

org.springframework.orm.hibernate3
Class TransactionAwareDataSourceConnectionProvider

java.lang.Object
    extended by  org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
        extended by  org.springframework.orm.hibernate3.TransactionAwareDataSourceConnectionProvider
All Implemented Interfaces:
org.hibernate.connection.ConnectionProvider
public class TransactionAwareDataSourceConnectionProvider
extends LocalDataSourceConnectionProvider

Subclass of LocalDataSourceConnectionProvider that returns a transaction-aware proxy for the exposed DataSource. Used if LocalSessionFactoryBean's "useTransactionAwareDataSource" flag is on.

Since:
1.2
Author:
Juergen Hoeller
See Also:
AbstractSessionFactoryBean.setUseTransactionAwareDataSource(boolean)

Constructor Summary
TransactionAwareDataSourceConnectionProvider()
Method Summary
protected DataSource | getDataSourceToUse(DataSource originalDataSource) Return a TransactionAwareDataSourceProxy for the given DataSource, provided that it isn't a TransactionAwareDataSourceProxy already.
boolean | supportsAggressiveRelease() This implementation returns true: We can guarantee to receive the same Connection within a transaction, as we are exposing a TransactionAwareDataSourceProxy.
Methods inherited from class org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
close, closeConnection, configure, getConnection, getDataSource
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TransactionAwareDataSourceConnectionProvider

public TransactionAwareDataSourceConnectionProvider()
Method Detail

getDataSourceToUse

protected DataSource getDataSourceToUse(DataSource originalDataSource)
Return a TransactionAwareDataSourceProxy for the given DataSource, provided that it isn't a TransactionAwareDataSourceProxy already.

Overrides:
getDataSourceToUse in class LocalDataSourceConnectionProvider
Parameters:
originalDataSource - the DataSource as configured by the user on LocalSessionFactoryBean
Returns:
the DataSource to actually retrieve Connections from (potentially wrapped)
See Also:
AbstractSessionFactoryBean.setDataSource(javax.sql.DataSource)

supportsAggressiveRelease

public boolean supportsAggressiveRelease()
This implementation returns true: We can guarantee to receive the same Connection within a transaction, as we are exposing a TransactionAwareDataSourceProxy.

Specified by:
supportsAggressiveRelease in interface org.hibernate.connection.ConnectionProvider
Overrides:
supportsAggressiveRelease in class LocalDataSourceConnectionProvider
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TypeDefinitionBean

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.orm.hibernate3
Class TypeDefinitionBean

java.lang.Object
    extended by  org.springframework.orm.hibernate3.TypeDefinitionBean
All Implemented Interfaces:
BeanNameAware, InitializingBean
public class TypeDefinitionBean
extends Object
implements BeanNameAware, InitializingBean

Bean that encapsulates a Hibernate type definition.

Typically defined as inner bean within a LocalSessionFactoryBean definition, as list element for the "typeDefinitions" bean property. For example:

 <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
   ...
   <property name="typeDefinitions">
     <list>
       <bean class="org.springframework.orm.hibernate3.TypeDefinitionBean">
         <property name="typeName" value="myType"/>
         <property name="typeClass" value="mypackage.MyTypeClass"/>
       </bean>
     </list>
   </property>
   ...
 </bean>
Alternatively, specify a bean id (or name) attribute for the inner bean, instead of the "typeName" property.

Since:
1.2
Author:
Juergen Hoeller
See Also:
LocalSessionFactoryBean.setTypeDefinitions(TypeDefinitionBean[])

Constructor Summary
TypeDefinitionBean()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
Properties | getParameters() Return the default parameters for the type.
String | getTypeClass() Return the type implementation class.
String | getTypeName() Return the name of the type.
void | setBeanName(String name) If no explicit type name has been specified, the bean name of the TypeDefinitionBean will be used.
void | setParameters(Properties parameters) Specify default parameters for the type.
void | setTypeClass(String typeClass) Set the type implementation class.
void | setTypeName(String typeName) Set the name of the type.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TypeDefinitionBean

public TypeDefinitionBean()
Method Detail

setTypeName

public void setTypeName(String typeName)
Set the name of the type.

See Also:
Mappings.addTypeDef(String, String, java.util.Properties)

getTypeName

public String getTypeName()
Return the name of the type.

setTypeClass

public void setTypeClass(String typeClass)
Set the type implementation class.

See Also:
Mappings.addTypeDef(String, String, java.util.Properties)

getTypeClass

public String getTypeClass()
Return the type implementation class.

setParameters

public void setParameters(Properties parameters)
Specify default parameters for the type. This only applies to parameterized types.

See Also:
Mappings.addTypeDef(String, String, java.util.Properties), ParameterizedType

getParameters

public Properties getParameters()
Return the default parameters for the type.

setBeanName

public void setBeanName(String name)
If no explicit type name has been specified, the bean name of the TypeDefinitionBean will be used.

Specified by:
setBeanName in interface BeanNameAware
Parameters:
name - the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use the BeanFactoryUtils.originalBeanName(String) method to extract the original bean name (without suffix), if desired.
See Also:
setTypeName(java.lang.String)

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


HibernateJdbcException

org.springframework.orm.hibernate3
Class HibernateJdbcException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.UncategorizedDataAccessException
                                extended by  org.springframework.orm.hibernate3.HibernateJdbcException
All Implemented Interfaces:
Serializable
public class HibernateJdbcException
extends UncategorizedDataAccessException

Hibernate-specific subclass of UncategorizedDataAccessException, for JDBC exceptions that Hibernate wrapped.

Since:
1.2
Author:
Juergen Hoeller
See Also:
SessionFactoryUtils.convertHibernateAccessException(org.hibernate.HibernateException), Serialized Form

Constructor Summary
HibernateJdbcException(org.hibernate.JDBCException ex)
Method Summary
String | getSql() Return the SQL that led to the problem.
SQLException | getSQLException() Return the underlying SQLException.
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

HibernateJdbcException

public HibernateJdbcException(org.hibernate.JDBCException ex)
Method Detail

getSQLException

public SQLException getSQLException()
Return the underlying SQLException.

getSql

public String getSql()
Return the SQL that led to the problem.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HibernateObjectRetrievalFailureException

org.springframework.orm.hibernate3
Class HibernateObjectRetrievalFailureException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.DataRetrievalFailureException
                                extended by  org.springframework.orm.ObjectRetrievalFailureException
                                    extended by  org.springframework.orm.hibernate3.HibernateObjectRetrievalFailureException
All Implemented Interfaces:
Serializable
public class HibernateObjectRetrievalFailureException
extends ObjectRetrievalFailureException

Hibernate-specific subclass of ObjectRetrievalFailureException. Converts Hibernate's UnresolvableObjectException and WrongClassException.

Since:
1.2
Author:
Juergen Hoeller
See Also:
SessionFactoryUtils.convertHibernateAccessException(org.hibernate.HibernateException), Serialized Form

Constructor Summary
HibernateObjectRetrievalFailureException(org.hibernate.UnresolvableObjectException ex)
HibernateObjectRetrievalFailureException(org.hibernate.WrongClassException ex)
Method Summary
Methods inherited from class org.springframework.orm.ObjectRetrievalFailureException
getIdentifier, getPersistentClass, getPersistentClassName
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

HibernateObjectRetrievalFailureException

public HibernateObjectRetrievalFailureException(org.hibernate.UnresolvableObjectException ex)

HibernateObjectRetrievalFailureException

public HibernateObjectRetrievalFailureException(org.hibernate.WrongClassException ex)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HibernateOptimisticLockingFailureException

org.springframework.orm.hibernate3
Class HibernateOptimisticLockingFailureException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.TransientDataAccessException
                            extended by  org.springframework.dao.ConcurrencyFailureException
                                extended by  org.springframework.dao.OptimisticLockingFailureException
                                    extended by  org.springframework.orm.ObjectOptimisticLockingFailureException
                                        extended by  org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException
All Implemented Interfaces:
Serializable
public class HibernateOptimisticLockingFailureException
extends ObjectOptimisticLockingFailureException

Hibernate-specific subclass of ObjectOptimisticLockingFailureException. Converts Hibernate's StaleObjectStateException and StaleStateException.

Since:
1.2
Author:
Juergen Hoeller
See Also:
SessionFactoryUtils.convertHibernateAccessException(org.hibernate.HibernateException), Serialized Form

Constructor Summary
HibernateOptimisticLockingFailureException(org.hibernate.StaleObjectStateException ex)
HibernateOptimisticLockingFailureException(org.hibernate.StaleStateException ex)
Method Summary
Methods inherited from class org.springframework.orm.ObjectOptimisticLockingFailureException
getIdentifier, getPersistentClass, getPersistentClassName
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

HibernateOptimisticLockingFailureException

public HibernateOptimisticLockingFailureException(org.hibernate.StaleObjectStateException ex)

HibernateOptimisticLockingFailureException

public HibernateOptimisticLockingFailureException(org.hibernate.StaleStateException ex)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HibernateQueryException

org.springframework.orm.hibernate3
Class HibernateQueryException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.InvalidDataAccessResourceUsageException
                                extended by  org.springframework.orm.hibernate3.HibernateQueryException
All Implemented Interfaces:
Serializable
public class HibernateQueryException
extends InvalidDataAccessResourceUsageException

Hibernate-specific subclass of InvalidDataAccessResourceUsageException, thrown on invalid HQL query syntax.

Since:
1.2
Author:
Juergen Hoeller
See Also:
SessionFactoryUtils.convertHibernateAccessException(org.hibernate.HibernateException), Serialized Form

Constructor Summary
HibernateQueryException(org.hibernate.QueryException ex)
Method Summary
 String getQueryString()
Return the HQL query string that was invalid.
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

HibernateQueryException

public HibernateQueryException(org.hibernate.QueryException ex)
Method Detail

getQueryString

public String getQueryString()
Return the HQL query string that was invalid.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HibernateSystemException

org.springframework.orm.hibernate3
Class HibernateSystemException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.UncategorizedDataAccessException
                                extended by  org.springframework.orm.hibernate3.HibernateSystemException
All Implemented Interfaces:
Serializable
public class HibernateSystemException
extends UncategorizedDataAccessException

Hibernate-specific subclass of UncategorizedDataAccessException, for Hibernate system errors that do not match any concrete org.springframework.dao exceptions.

Since:
1.2
Author:
Juergen Hoeller
See Also:
SessionFactoryUtils.convertHibernateAccessException(org.hibernate.HibernateException), Serialized Form

Constructor Summary
HibernateSystemException(org.hibernate.HibernateException cause)
Create a new HibernateSystemException, wrapping an arbitrary HibernateException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

HibernateSystemException

public HibernateSystemException(org.hibernate.HibernateException cause)
Create a new HibernateSystemException, wrapping an arbitrary HibernateException.

Parameters:
cause - the HibernateException thrown
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.orm.hibernate3.annotation

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.orm.hibernate3.annotation

Support package for the Hibernate3 Annotation add-on, which supports EJB3-compliant JDK 1.5+ annotations for mappings.

See:
Description

Class Summary
AnnotationSessionFactoryBean Subclass of Spring's standard LocalSessionFactoryBean for Hibernate, supporting JDK 1.5+ annotation metadata for mappings.

Package org.springframework.orm.hibernate3.annotation Description

Support package for the Hibernate3 Annotation add-on, which supports EJB3-compliant JDK 1.5+ annotations for mappings.


org.springframework.orm.hibernate3.annotation Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.orm.hibernate3.annotation

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.orm.hibernate3.AbstractSessionFactoryBean (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean, org.springframework.dao.support.PersistenceExceptionTranslator)
      • org.springframework.orm.hibernate3.LocalSessionFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware)
        • org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean (implements org.springframework.context.ResourceLoaderAware)


AnnotationSessionFactoryBean

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.orm.hibernate3.annotation
Class AnnotationSessionFactoryBean

java.lang.Object
    extended by  org.springframework.orm.hibernate3.AbstractSessionFactoryBean
        extended by  org.springframework.orm.hibernate3.LocalSessionFactoryBean
            extended by  org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean
All Implemented Interfaces:
BeanClassLoaderAware, DisposableBean, FactoryBean<org.hibernate.SessionFactory>, InitializingBean, ResourceLoaderAware, PersistenceExceptionTranslator
public class AnnotationSessionFactoryBean
extends LocalSessionFactoryBean
implements ResourceLoaderAware

Subclass of Spring's standard LocalSessionFactoryBean for Hibernate, supporting JDK 1.5+ annotation metadata for mappings.

Note: This class requires Hibernate 3.2 or later, with the Java Persistence API and the Hibernate Annotations add-on present.

Example for an AnnotationSessionFactoryBean bean definition:

 <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
   <property name="dataSource" ref="dataSource"/>
   <property name="annotatedClasses">
     <list>
       <value>test.package.Foo</value>
       <value>test.package.Bar</value>
     </list>
   </property>
 </bean>
Or when using classpath scanning for autodetection of entity classes:
 <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
   <property name="dataSource" ref="dataSource"/>
   <property name="packagesToScan" value="test.package"/>
 </bean>

Since:
1.2.2
Author:
Juergen Hoeller
See Also:
AbstractSessionFactoryBean.setDataSource(javax.sql.DataSource),
LocalSessionFactoryBean.setHibernateProperties(java.util.Properties),
setAnnotatedClasses(java.lang.Class[]),
setAnnotatedPackages(java.lang.String[])

Field Summary
Fields inherited from class org.springframework.orm.hibernate3.AbstractSessionFactoryBean
logger
Constructor Summary
AnnotationSessionFactoryBean()
Method Summary
protected  void postProcessAnnotationConfiguration(org.hibernate.cfg.AnnotationConfiguration config)
To be implemented by subclasses that want to to perform custom post-processing of the AnnotationConfiguration object after this FactoryBean performed its default initialization.
protected  void postProcessConfiguration(org.hibernate.cfg.Configuration config)
Delegates to postProcessAnnotationConfiguration(org.hibernate.cfg.AnnotationConfiguration).
protected  void postProcessMappings(org.hibernate.cfg.Configuration config)
Reads metadata from annotated classes and packages into the AnnotationConfiguration instance.
protected  void scanPackages(org.hibernate.cfg.AnnotationConfiguration config)
Perform Spring-based scanning for entity classes.
 void setAnnotatedClasses(Class[] annotatedClasses)
Specify annotated classes, for which mappings will be read from class-level JDK 1.5+ annotation metadata.
 void setAnnotatedPackages(String[] annotatedPackages)
Specify the names of annotated packages, for which package-level JDK 1.5+ annotation metadata will be read.
 void setConfigurationClass(Class configurationClass)
Specify the Hibernate Configuration class to use.
 void setEntityTypeFilters(TypeFilter[] entityTypeFilters)
Specify custom type filters for Spring-based scanning for entity classes.
 void setPackagesToScan(String[] packagesToScan)
Set whether to use Spring-based scanning for entity classes in the classpath instead of listing annotated classes explicitly.
 void setResourceLoader(ResourceLoader resourceLoader)
Set the ResourceLoader that this object runs in.
Methods inherited from class org.springframework.orm.hibernate3.LocalSessionFactoryBean
afterSessionFactoryCreation, buildSessionFactory, createDatabaseSchema, destroy, dropDatabaseSchema, executeSchemaScript, executeSchemaStatement, getConfigTimeCacheProvider, getConfigTimeDataSource, getConfigTimeLobHandler, getConfigTimeTransactionManager, getConfiguration, getHibernateProperties, newConfiguration, newSessionFactory, setBeanClassLoader, setCacheableMappingLocations, setCacheProvider, setCacheRegionFactory, setCollectionCacheStrategies, setConfigLocation, setConfigLocations, setEntityCacheStrategies, setEntityInterceptor, setEventListeners, setFilterDefinitions, setHibernateProperties, setJtaTransactionManager, setLobHandler, setMappingDirectoryLocations, setMappingJarLocations, setMappingLocations, setMappingResources, setNamingStrategy, setSchemaUpdate, setTypeDefinitions, updateDatabaseSchema, validateDatabaseSchema
Methods inherited from class org.springframework.orm.hibernate3.AbstractSessionFactoryBean
afterPropertiesSet, beforeSessionFactoryDestruction, convertHibernateAccessException, getDataSource, getObject, getObjectType, getSessionFactory, isExposeTransactionAwareSessionFactory, isSingleton, isUseTransactionAwareDataSource, setDataSource, setExposeTransactionAwareSessionFactory, setJdbcExceptionTranslator, setUseTransactionAwareDataSource, translateExceptionIfPossible, wrapSessionFactoryIfNecessary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AnnotationSessionFactoryBean

public AnnotationSessionFactoryBean()
Method Detail

setConfigurationClass

public void setConfigurationClass(Class configurationClass)
Description copied from class: LocalSessionFactoryBean
Specify the Hibernate Configuration class to use. Default is "org.hibernate.cfg.Configuration"; any subclass of this default Hibernate Configuration class can be specified.

Can be set to "org.hibernate.cfg.AnnotationConfiguration" for using Hibernate3 annotation support (initially only available as alpha download separate from the main Hibernate3 distribution).

Annotated packages and annotated classes can be specified via the corresponding tags in "hibernate.cfg.xml" then, so this will usually be combined with a "configLocation" property that points at such a standard Hibernate configuration file.

Overrides:
setConfigurationClass in class LocalSessionFactoryBean
See Also:
LocalSessionFactoryBean.setConfigLocation(org.springframework.core.io.Resource), Configuration, AnnotationConfiguration

setAnnotatedClasses

public void setAnnotatedClasses(Class[] annotatedClasses)
Specify annotated classes, for which mappings will be read from class-level JDK 1.5+ annotation metadata.

See Also:
AnnotationConfiguration.addAnnotatedClass(Class)

setAnnotatedPackages

public void setAnnotatedPackages(String[] annotatedPackages)
Specify the names of annotated packages, for which package-level JDK 1.5+ annotation metadata will be read.

See Also:
AnnotationConfiguration.addPackage(String)

setPackagesToScan

public void setPackagesToScan(String[] packagesToScan)
Set whether to use Spring-based scanning for entity classes in the classpath instead of listing annotated classes explicitly.

Default is none. Specify packages to search for autodetection of your entity classes in the classpath. This is analogous to Spring's component-scan feature (ClassPathBeanDefinitionScanner).

setEntityTypeFilters

public void setEntityTypeFilters(TypeFilter[] entityTypeFilters)
Specify custom type filters for Spring-based scanning for entity classes.

Default is to search all specified packages for classes annotated with @javax.persistence.Entity, @javax.persistence.Embeddable or @javax.persistence.MappedSuperclass, as well as for Hibernate's special @org.hibernate.annotations.Entity.

See Also:
setPackagesToScan(java.lang.String[])

setResourceLoader

public void setResourceLoader(ResourceLoader resourceLoader)
Description copied from interface: ResourceLoaderAware
Set the ResourceLoader that this object runs in.

This might be a ResourcePatternResolver, which can be checked through instanceof ResourcePatternResolver. See also the ResourcePatternUtils.getResourcePatternResolver method.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked before ApplicationContextAware's setApplicationContext.

Specified by:
setResourceLoader in interface ResourceLoaderAware
Parameters:
resourceLoader - ResourceLoader object to be used by this object
See Also:
ResourcePatternResolver, ResourcePatternUtils.getResourcePatternResolver(org.springframework.core.io.ResourceLoader)

postProcessMappings

protected void postProcessMappings(org.hibernate.cfg.Configuration config)
                            throws org.hibernate.HibernateException
Reads metadata from annotated classes and packages into the AnnotationConfiguration instance.

Overrides:
postProcessMappings in class LocalSessionFactoryBean
Parameters:
config - the current Configuration object
Throws:
org.hibernate.HibernateException - in case of Hibernate initialization errors
See Also:
Configuration.buildMappings()

scanPackages

protected void scanPackages(org.hibernate.cfg.AnnotationConfiguration config)
Perform Spring-based scanning for entity classes.

See Also:
setPackagesToScan(java.lang.String[])

postProcessConfiguration

protected final void postProcessConfiguration(org.hibernate.cfg.Configuration config)
                                       throws org.hibernate.HibernateException
Delegates to postProcessAnnotationConfiguration(org.hibernate.cfg.AnnotationConfiguration).

Overrides:
postProcessConfiguration in class LocalSessionFactoryBean
Parameters:
config - the current Configuration object
Throws:
org.hibernate.HibernateException - in case of Hibernate initialization errors
See Also:
Configuration.buildMappings()

postProcessAnnotationConfiguration

protected void postProcessAnnotationConfiguration(org.hibernate.cfg.AnnotationConfiguration config)
                                           throws org.hibernate.HibernateException
To be implemented by subclasses that want to to perform custom post-processing of the AnnotationConfiguration object after this FactoryBean performed its default initialization.

Parameters:
config - the current AnnotationConfiguration object
Throws:
org.hibernate.HibernateException - in case of Hibernate initialization errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.orm.hibernate3.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.orm.hibernate3.support

Classes supporting the org.springframework.orm.hibernate3 package.

See:
Description

Class Summary
AbstractLobType | Abstract base class for Hibernate UserType implementations that map to LOBs.
BlobByteArrayType | Hibernate UserType implementation for byte arrays that get mapped to BLOBs.
BlobSerializableType | Hibernate UserType implementation for arbitrary objects that get serialized to BLOBs.
BlobStringType | Hibernate UserType implementation for Strings that get mapped to BLOBs.
ClobStringType | Hibernate UserType implementation for Strings that get mapped to CLOBs.
HibernateDaoSupport | Convenient super class for Hibernate-based data access objects.
IdTransferringMergeEventListener | Extension of Hibernate's DefaultMergeEventListener, transferring the ids of newly saved objects to the corresponding original objects (that are part of the detached object graph passed into the merge method).
OpenSessionInViewFilter | Servlet 2.3 Filter that binds a Hibernate Session to the thread for the entire processing of the request.
OpenSessionInViewInterceptor | Spring web request interceptor that binds a Hibernate Session to the thread for the entire processing of the request.
ScopedBeanInterceptor | Hibernate3 interceptor used for getting the proper entity name for scoped beans.

Package org.springframework.orm.hibernate3.support Description

Classes supporting the org.springframework.orm.hibernate3 package. Contains a DAO base class for HibernateTemplate usage.


org.springframework.orm.hibernate3.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.orm.hibernate3.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.orm.hibernate3.support.AbstractLobType (implements org.hibernate.usertype.UserType)
      • org.springframework.orm.hibernate3.support.BlobByteArrayType
      • org.springframework.orm.hibernate3.support.BlobSerializableType
      • org.springframework.orm.hibernate3.support.BlobStringType
      • org.springframework.orm.hibernate3.support.ClobStringType
    • org.hibernate.event.def.AbstractReassociateEventListener (implements java.io.Serializable)
      • org.hibernate.event.def.AbstractSaveEventListener
        • org.hibernate.event.def.DefaultMergeEventListener (implements org.hibernate.event.MergeEventListener)
          • org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener
    • org.springframework.dao.support.DaoSupport (implements org.springframework.beans.factory.InitializingBean)
      • org.springframework.orm.hibernate3.support.HibernateDaoSupport
    • org.hibernate.EmptyInterceptor (implements org.hibernate.Interceptor, java.io.Serializable)
      • org.springframework.orm.hibernate3.support.ScopedBeanInterceptor
    • org.springframework.web.filter.GenericFilterBean (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, javax.servlet.Filter, org.springframework.beans.factory.InitializingBean, org.springframework.web.context.ServletContextAware)
      • org.springframework.web.filter.OncePerRequestFilter
        • org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
    • org.springframework.orm.hibernate3.HibernateAccessor (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean)
      • org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor (implements org.springframework.web.context.request.WebRequestInterceptor)


AbstractLobType

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.orm.hibernate3.support
Class AbstractLobType

java.lang.Object
    extended by  org.springframework.orm.hibernate3.support.AbstractLobType
All Implemented Interfaces:
org.hibernate.usertype.UserType
Direct Known Subclasses:
BlobByteArrayType, BlobSerializableType, BlobStringType, ClobStringType
public abstract class AbstractLobType
extends Object
implements org.hibernate.usertype.UserType

Abstract base class for Hibernate UserType implementations that map to LOBs. Retrieves the LobHandler to use from LocalSessionFactoryBean at config time.

For writing LOBs, either an active Spring transaction synchronization or an active JTA transaction (with "jtaTransactionManager" specified on LocalSessionFactoryBean or a Hibernate TransactionManagerLookup configured through the corresponding Hibernate property) is required.

Offers template methods for setting parameters and getting result values, passing in the LobHandler or LobCreator to use.

Since:
1.2
Author:
Juergen Hoeller
See Also:
LobHandler, LobCreator, LocalSessionFactoryBean.setLobHandler(org.springframework.jdbc.support.lob.LobHandler), LocalSessionFactoryBean.setJtaTransactionManager(javax.transaction.TransactionManager)

Field Summary
protected  Log logger
Constructor Summary
protected | AbstractLobType() Constructor used by Hibernate: fetches config-time LobHandler and config-time JTA TransactionManager from LocalSessionFactoryBean.
protected | AbstractLobType(LobHandler lobHandler, TransactionManager jtaTransactionManager) Constructor used for testing: takes an explicit LobHandler and an explicit JTA TransactionManager (can be null).
Method Summary
Object | assemble(Serializable cached, Object owner) This implementation returns the passed-in value as-is.
Object | deepCopy(Object value) This implementation returns the passed-in value as-is.
Serializable | disassemble(Object value) This implementation returns the passed-in value as-is.
boolean | equals(Object x, Object y) This implementation delegates to the Hibernate EqualsHelper.
int | hashCode(Object x) This implementation returns the hashCode of the given objectz.
boolean | isMutable() This implementation returns false.
Object | nullSafeGet(ResultSet rs, String[] names, Object owner) This implementation delegates to nullSafeGetInternal, passing in the LobHandler of this type.
protected abstract Object | nullSafeGetInternal(ResultSet rs, String[] names, Object owner, LobHandler lobHandler) Template method to extract a value from the given result set.
void | nullSafeSet(PreparedStatement st, Object value, int index) This implementation delegates to nullSafeSetInternal, passing in a transaction-synchronized LobCreator for the LobHandler of this type.
protected abstract void | nullSafeSetInternal(PreparedStatement ps, int index, Object value, LobCreator lobCreator) Template method to set the given parameter value on the given statement.
Object | replace(Object original, Object target, Object owner) This implementation returns the passed-in original as-is.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.hibernate.usertype.UserType
returnedClass, sqlTypes

Field Detail

logger

protected final Log logger
Constructor Detail

AbstractLobType

protected AbstractLobType()
Constructor used by Hibernate: fetches config-time LobHandler and config-time JTA TransactionManager from LocalSessionFactoryBean.

See Also:
LocalSessionFactoryBean.getConfigTimeLobHandler(), LocalSessionFactoryBean.getConfigTimeTransactionManager()

AbstractLobType

protected AbstractLobType(LobHandler lobHandler,
                          TransactionManager jtaTransactionManager)
Constructor used for testing: takes an explicit LobHandler and an explicit JTA TransactionManager (can be null).

Method Detail

isMutable

public boolean isMutable()
This implementation returns false.

Specified by:
isMutable in interface org.hibernate.usertype.UserType

equals

public boolean equals(Object x,
                      Object y)
               throws org.hibernate.HibernateException
This implementation delegates to the Hibernate EqualsHelper.

Specified by:
equals in interface org.hibernate.usertype.UserType
Throws:
org.hibernate.HibernateException
See Also:
EqualsHelper.equals(java.lang.Object, java.lang.Object)

hashCode

public int hashCode(Object x)
             throws org.hibernate.HibernateException
This implementation returns the hashCode of the given objectz.

Specified by:
hashCode in interface org.hibernate.usertype.UserType
Throws:
org.hibernate.HibernateException

deepCopy

public Object deepCopy(Object value)
                throws org.hibernate.HibernateException
This implementation returns the passed-in value as-is.

Specified by:
deepCopy in interface org.hibernate.usertype.UserType
Throws:
org.hibernate.HibernateException

disassemble

public Serializable disassemble(Object value)
                         throws org.hibernate.HibernateException
This implementation returns the passed-in value as-is.

Specified by:
disassemble in interface org.hibernate.usertype.UserType
Throws:
org.hibernate.HibernateException

assemble

public Object assemble(Serializable cached,
                       Object owner)
                throws org.hibernate.HibernateException
This implementation returns the passed-in value as-is.

Specified by:
assemble in interface org.hibernate.usertype.UserType
Throws:
org.hibernate.HibernateException

replace

public Object replace(Object original,
                      Object target,
                      Object owner)
               throws org.hibernate.HibernateException
This implementation returns the passed-in original as-is.

Specified by:
replace in interface org.hibernate.usertype.UserType
Throws:
org.hibernate.HibernateException

nullSafeGet

public final Object nullSafeGet(ResultSet rs,
                                String[] names,
                                Object owner)
                         throws org.hibernate.HibernateException,
                                SQLException
This implementation delegates to nullSafeGetInternal, passing in the LobHandler of this type.

Specified by:
nullSafeGet in interface org.hibernate.usertype.UserType
Throws:
org.hibernate.HibernateException
SQLException
See Also:
nullSafeGetInternal(java.sql.ResultSet, java.lang.String[], java.lang.Object, org.springframework.jdbc.support.lob.LobHandler)

nullSafeSet

public final void nullSafeSet(PreparedStatement st,
                              Object value,
                              int index)
                       throws org.hibernate.HibernateException,
                              SQLException
This implementation delegates to nullSafeSetInternal, passing in a transaction-synchronized LobCreator for the LobHandler of this type.

Specified by:
nullSafeSet in interface org.hibernate.usertype.UserType
Throws:
org.hibernate.HibernateException
SQLException
See Also:
nullSafeSetInternal(java.sql.PreparedStatement, int, java.lang.Object, org.springframework.jdbc.support.lob.LobCreator)

nullSafeGetInternal

protected abstract Object nullSafeGetInternal(ResultSet rs,
                                              String[] names,
                                              Object owner,
                                              LobHandler lobHandler)
                                       throws SQLException,
                                              IOException,
                                              org.hibernate.HibernateException
Template method to extract a value from the given result set.

Parameters:
rs - the ResultSet to extract from
names - the column names
owner - the containing entity
lobHandler - the LobHandler to use
Returns:
the extracted value
Throws:
SQLException - if thrown by JDBC methods
IOException - if thrown by streaming methods
org.hibernate.HibernateException - in case of any other exceptions

nullSafeSetInternal

protected abstract void nullSafeSetInternal(PreparedStatement ps,
                                            int index,
                                            Object value,
                                            LobCreator lobCreator)
                                     throws SQLException,
                                            IOException,
                                            org.hibernate.HibernateException
Template method to set the given parameter value on the given statement.

Parameters:
ps - the PreparedStatement to set on
index - the statement parameter index
value - the value to set
lobCreator - the LobCreator to use
Throws:
SQLException - if thrown by JDBC methods
IOException - if thrown by streaming methods
org.hibernate.HibernateException - in case of any other exceptions
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


BlobByteArrayType

org.springframework.orm.hibernate3.support
Class BlobByteArrayType

java.lang.Object
    extended by  org.springframework.orm.hibernate3.support.AbstractLobType
        extended by  org.springframework.orm.hibernate3.support.BlobByteArrayType
All Implemented Interfaces:
org.hibernate.usertype.UserType
public class BlobByteArrayType
extends AbstractLobType

Hibernate UserType implementation for byte arrays that get mapped to BLOBs. Retrieves the LobHandler to use from LocalSessionFactoryBean at config time.

Can also be defined in generic Hibernate mappings, as DefaultLobCreator will work with most JDBC-compliant database drivers. In this case, the field type does not have to be BLOB: For databases like MySQL and MS SQL Server, any large enough binary type will work.

Since:
1.2
Author:
Juergen Hoeller
See Also:
LocalSessionFactoryBean.setLobHandler(org.springframework.jdbc.support.lob.LobHandler)

Field Summary
Fields inherited from class org.springframework.orm.hibernate3.support.AbstractLobType
logger
Constructor Summary
 | BlobByteArrayType() Constructor used by Hibernate: fetches config-time LobHandler and config-time JTA TransactionManager from LocalSessionFactoryBean.
protected | BlobByteArrayType(LobHandler lobHandler, TransactionManager jtaTransactionManager) Constructor used for testing: takes an explicit LobHandler and an explicit JTA TransactionManager (can be null).
Method Summary
Object | deepCopy(Object value) This implementation returns the passed-in value as-is.
boolean | equals(Object x, Object y) This implementation delegates to the Hibernate EqualsHelper.
boolean | isMutable() This implementation returns false.
protected Object | nullSafeGetInternal(ResultSet rs, String[] names, Object owner, LobHandler lobHandler) Template method to extract a value from the given result set.
protected void | nullSafeSetInternal(PreparedStatement ps, int index, Object value, LobCreator lobCreator) Template method to set the given parameter value on the given statement.
Class | returnedClass()
int[] | sqlTypes()
Methods inherited from class org.springframework.orm.hibernate3.support.AbstractLobType
assemble, disassemble, hashCode, nullSafeGet, nullSafeSet, replace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BlobByteArrayType

public BlobByteArrayType()
Constructor used by Hibernate: fetches config-time LobHandler and config-time JTA TransactionManager from LocalSessionFactoryBean.

See Also:
LocalSessionFactoryBean.getConfigTimeLobHandler(), LocalSessionFactoryBean.getConfigTimeTransactionManager()

BlobByteArrayType

protected BlobByteArrayType(LobHandler lobHandler,
                            TransactionManager jtaTransactionManager)
Constructor used for testing: takes an explicit LobHandler and an explicit JTA TransactionManager (can be null).

Method Detail

sqlTypes

public int[] sqlTypes()

returnedClass

public Class returnedClass()

isMutable

public boolean isMutable()
Description copied from class: AbstractLobType
This implementation returns false.

Specified by:
isMutable in interface org.hibernate.usertype.UserType
Overrides:
isMutable in class AbstractLobType

equals

public boolean equals(Object x,
                      Object y)
Description copied from class: AbstractLobType
This implementation delegates to the Hibernate EqualsHelper.

Specified by:
equals in interface org.hibernate.usertype.UserType
Overrides:
equals in class AbstractLobType
See Also:
EqualsHelper.equals(java.lang.Object, java.lang.Object)

deepCopy

public Object deepCopy(Object value)
Description copied from class: AbstractLobType
This implementation returns the passed-in value as-is.

Specified by:
deepCopy in interface org.hibernate.usertype.UserType
Overrides:
deepCopy in class AbstractLobType

nullSafeGetInternal

protected Object nullSafeGetInternal(ResultSet rs,
                                     String[] names,
                                     Object owner,
                                     LobHandler lobHandler)
                              throws SQLException
Description copied from class: AbstractLobType
Template method to extract a value from the given result set.

Specified by:
nullSafeGetInternal in class AbstractLobType
Parameters:
rs - the ResultSet to extract from
names - the column names
owner - the containing entity
lobHandler - the LobHandler to use
Returns:
the extracted value
Throws:
SQLException - if thrown by JDBC methods

nullSafeSetInternal

protected void nullSafeSetInternal(PreparedStatement ps,
                                   int index,
                                   Object value,
                                   LobCreator lobCreator)
                            throws SQLException
Description copied from class: AbstractLobType
Template method to set the given parameter value on the given statement.

Specified by:
nullSafeSetInternal in class AbstractLobType
Parameters:
ps - the PreparedStatement to set on
index - the statement parameter index
value - the value to set
lobCreator - the LobCreator to use
Throws:
SQLException - if thrown by JDBC methods
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BlobSerializableType

org.springframework.orm.hibernate3.support
Class BlobSerializableType

java.lang.Object
    extended by  org.springframework.orm.hibernate3.support.AbstractLobType
        extended by  org.springframework.orm.hibernate3.support.BlobSerializableType
All Implemented Interfaces:
org.hibernate.usertype.UserType
public class BlobSerializableType
extends AbstractLobType

Hibernate UserType implementation for arbitrary objects that get serialized to BLOBs. Retrieves the LobHandler to use from LocalSessionFactoryBean at config time.

Can also be defined in generic Hibernate mappings, as DefaultLobCreator will work with most JDBC-compliant database drivers. In this case, the field type does not have to be BLOB: For databases like MySQL and MS SQL Server, any large enough binary type will work.

Since:
1.2
Author:
Juergen Hoeller
See Also:
LocalSessionFactoryBean.setLobHandler(org.springframework.jdbc.support.lob.LobHandler)

Field Summary
Fields inherited from class org.springframework.orm.hibernate3.support.AbstractLobType
logger
Constructor Summary
 | BlobSerializableType() Constructor used by Hibernate: fetches config-time LobHandler and config-time JTA TransactionManager from LocalSessionFactoryBean.
protected | BlobSerializableType(LobHandler lobHandler, TransactionManager jtaTransactionManager) Constructor used for testing: takes an explicit LobHandler and an explicit JTA TransactionManager (can be null).
Method Summary
Object | deepCopy(Object value) This implementation returns the passed-in value as-is.
boolean | isMutable() This implementation returns false.
protected Object | nullSafeGetInternal(ResultSet rs, String[] names, Object owner, LobHandler lobHandler) Template method to extract a value from the given result set.
protected void | nullSafeSetInternal(PreparedStatement ps, int index, Object value, LobCreator lobCreator) Template method to set the given parameter value on the given statement.
Class | returnedClass()
int[] | sqlTypes()
Methods inherited from class org.springframework.orm.hibernate3.support.AbstractLobType
assemble, disassemble, equals, hashCode, nullSafeGet, nullSafeSet, replace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BlobSerializableType

public BlobSerializableType()
Constructor used by Hibernate: fetches config-time LobHandler and config-time JTA TransactionManager from LocalSessionFactoryBean.

See Also:
LocalSessionFactoryBean.getConfigTimeLobHandler(), LocalSessionFactoryBean.getConfigTimeTransactionManager()

BlobSerializableType

protected BlobSerializableType(LobHandler lobHandler,
                               TransactionManager jtaTransactionManager)
Constructor used for testing: takes an explicit LobHandler and an explicit JTA TransactionManager (can be null).

Method Detail

sqlTypes

public int[] sqlTypes()

returnedClass

public Class returnedClass()

isMutable

public boolean isMutable()
Description copied from class: AbstractLobType
This implementation returns false.

Specified by:
isMutable in interface org.hibernate.usertype.UserType
Overrides:
isMutable in class AbstractLobType

deepCopy

public Object deepCopy(Object value)
                throws org.hibernate.HibernateException
Description copied from class: AbstractLobType
This implementation returns the passed-in value as-is.

Specified by:
deepCopy in interface org.hibernate.usertype.UserType
Overrides:
deepCopy in class AbstractLobType
Throws:
org.hibernate.HibernateException

nullSafeGetInternal

protected Object nullSafeGetInternal(ResultSet rs,
                                     String[] names,
                                     Object owner,
                                     LobHandler lobHandler)
                              throws SQLException,
                                     IOException,
                                     org.hibernate.HibernateException
Description copied from class: AbstractLobType
Template method to extract a value from the given result set.

Specified by:
nullSafeGetInternal in class AbstractLobType
Parameters:
rs - the ResultSet to extract from
names - the column names
owner - the containing entity
lobHandler - the LobHandler to use
Returns:
the extracted value
Throws:
SQLException - if thrown by JDBC methods
IOException - if thrown by streaming methods
org.hibernate.HibernateException - in case of any other exceptions

nullSafeSetInternal

protected void nullSafeSetInternal(PreparedStatement ps,
                                   int index,
                                   Object value,
                                   LobCreator lobCreator)
                            throws SQLException,
                                   IOException
Description copied from class: AbstractLobType
Template method to set the given parameter value on the given statement.

Specified by:
nullSafeSetInternal in class AbstractLobType
Parameters:
ps - the PreparedStatement to set on
index - the statement parameter index
value - the value to set
lobCreator - the LobCreator to use
Throws:
SQLException - if thrown by JDBC methods
IOException - if thrown by streaming methods
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BlobStringType

org.springframework.orm.hibernate3.support
Class BlobStringType

java.lang.Object
    extended by  org.springframework.orm.hibernate3.support.AbstractLobType
        extended by  org.springframework.orm.hibernate3.support.BlobStringType
All Implemented Interfaces:
org.hibernate.usertype.UserType
public class BlobStringType
extends AbstractLobType

Hibernate UserType implementation for Strings that get mapped to BLOBs. Retrieves the LobHandler to use from LocalSessionFactoryBean at config time.

This is intended for the (arguably unnatural, but still common) case where character data is stored in a binary LOB. This requires encoding and decoding the characters within this UserType; see the javadoc of the getCharacterEncoding() method.

Can also be defined in generic Hibernate mappings, as DefaultLobCreator will work with most JDBC-compliant database drivers. In this case, the field type does not have to be BLOB: For databases like MySQL and MS SQL Server, any large enough binary type will work.

Since:
1.2.7
Author:
Juergen Hoeller
See Also:
getCharacterEncoding(), LocalSessionFactoryBean.setLobHandler(org.springframework.jdbc.support.lob.LobHandler)

Field Summary
Fields inherited from class org.springframework.orm.hibernate3.support.AbstractLobType
logger
Constructor Summary
 | BlobStringType() Constructor used by Hibernate: fetches config-time LobHandler and config-time JTA TransactionManager from LocalSessionFactoryBean.
protected | BlobStringType(LobHandler lobHandler, TransactionManager jtaTransactionManager) Constructor used for testing: takes an explicit LobHandler and an explicit JTA TransactionManager (can be null).
Method Summary
protected String | getCharacterEncoding() Determine the character encoding to apply to the BLOB's bytes to turn them into a String.
protected Object | nullSafeGetInternal(ResultSet rs, String[] names, Object owner, LobHandler lobHandler) Template method to extract a value from the given result set.
protected void | nullSafeSetInternal(PreparedStatement ps, int index, Object value, LobCreator lobCreator) Template method to set the given parameter value on the given statement.
Class | returnedClass()
int[] | sqlTypes()
Methods inherited from class org.springframework.orm.hibernate3.support.AbstractLobType
assemble, deepCopy, disassemble, equals, hashCode, isMutable, nullSafeGet, nullSafeSet, replace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BlobStringType

public BlobStringType()
Constructor used by Hibernate: fetches config-time LobHandler and config-time JTA TransactionManager from LocalSessionFactoryBean.

See Also:
LocalSessionFactoryBean.getConfigTimeLobHandler(), LocalSessionFactoryBean.getConfigTimeTransactionManager()

BlobStringType

protected BlobStringType(LobHandler lobHandler,
                         TransactionManager jtaTransactionManager)
Constructor used for testing: takes an explicit LobHandler and an explicit JTA TransactionManager (can be null).

Method Detail

sqlTypes

public int[] sqlTypes()

returnedClass

public Class returnedClass()

nullSafeGetInternal

protected Object nullSafeGetInternal(ResultSet rs,
                                     String[] names,
                                     Object owner,
                                     LobHandler lobHandler)
                              throws SQLException,
                                     UnsupportedEncodingException
Description copied from class: AbstractLobType
Template method to extract a value from the given result set.

Specified by:
nullSafeGetInternal in class AbstractLobType
Parameters:
rs - the ResultSet to extract from
names - the column names
owner - the containing entity
lobHandler - the LobHandler to use
Returns:
the extracted value
Throws:
SQLException - if thrown by JDBC methods
UnsupportedEncodingException

nullSafeSetInternal

protected void nullSafeSetInternal(PreparedStatement ps,
                                   int index,
                                   Object value,
                                   LobCreator lobCreator)
                            throws SQLException,
                                   UnsupportedEncodingException
Description copied from class: AbstractLobType
Template method to set the given parameter value on the given statement.

Specified by:
nullSafeSetInternal in class AbstractLobType
Parameters:
ps - the PreparedStatement to set on
index - the statement parameter index
value - the value to set
lobCreator - the LobCreator to use
Throws:
SQLException - if thrown by JDBC methods
UnsupportedEncodingException

getCharacterEncoding

protected String getCharacterEncoding()
Determine the character encoding to apply to the BLOB's bytes to turn them into a String.

Default is null, indicating to use the platform default encoding. To be overridden in subclasses for a specific encoding such as "ISO-8859-1" or "UTF-8".

Returns:
the character encoding to use, or null to use the platform default encoding
See Also:
String.String(byte[], String), String.getBytes(String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ClobStringType

org.springframework.orm.hibernate3.support
Class ClobStringType

java.lang.Object
    extended by  org.springframework.orm.hibernate3.support.AbstractLobType
        extended by  org.springframework.orm.hibernate3.support.ClobStringType
All Implemented Interfaces:
org.hibernate.usertype.UserType
public class ClobStringType
extends AbstractLobType

Hibernate UserType implementation for Strings that get mapped to CLOBs. Retrieves the LobHandler to use from LocalSessionFactoryBean at config time.

Particularly useful for storing Strings with more than 4000 characters in an Oracle database (only possible via CLOBs), in combination with OracleLobHandler.

Can also be defined in generic Hibernate mappings, as DefaultLobCreator will work with most JDBC-compliant database drivers. In this case, the field type does not have to be CLOB: For databases like MySQL and MS SQL Server, any large enough character type will work.

Since:
1.2
Author:
Juergen Hoeller
See Also:
LocalSessionFactoryBean.setLobHandler(org.springframework.jdbc.support.lob.LobHandler)

Field Summary
Fields inherited from class org.springframework.orm.hibernate3.support.AbstractLobType
logger
Constructor Summary
 | ClobStringType() Constructor used by Hibernate: fetches config-time LobHandler and config-time JTA TransactionManager from LocalSessionFactoryBean.
protected | ClobStringType(LobHandler lobHandler, TransactionManager jtaTransactionManager) Constructor used for testing: takes an explicit LobHandler and an explicit JTA TransactionManager (can be null).
Method Summary
protected Object | nullSafeGetInternal(ResultSet rs, String[] names, Object owner, LobHandler lobHandler) Template method to extract a value from the given result set.
protected void | nullSafeSetInternal(PreparedStatement ps, int index, Object value, LobCreator lobCreator) Template method to set the given parameter value on the given statement.
Class | returnedClass()
int[] | sqlTypes()
Methods inherited from class org.springframework.orm.hibernate3.support.AbstractLobType
assemble, deepCopy, disassemble, equals, hashCode, isMutable, nullSafeGet, nullSafeSet, replace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ClobStringType

public ClobStringType()
Constructor used by Hibernate: fetches config-time LobHandler and config-time JTA TransactionManager from LocalSessionFactoryBean.

See Also:
LocalSessionFactoryBean.getConfigTimeLobHandler(), LocalSessionFactoryBean.getConfigTimeTransactionManager()

ClobStringType

protected ClobStringType(LobHandler lobHandler,
                         TransactionManager jtaTransactionManager)
Constructor used for testing: takes an explicit LobHandler and an explicit JTA TransactionManager (can be null).

Method Detail

sqlTypes

public int[] sqlTypes()

returnedClass

public Class returnedClass()

nullSafeGetInternal

protected Object nullSafeGetInternal(ResultSet rs,
                                     String[] names,
                                     Object owner,
                                     LobHandler lobHandler)
                              throws SQLException
Description copied from class: AbstractLobType
Template method to extract a value from the given result set.

Specified by:
nullSafeGetInternal in class AbstractLobType
Parameters:
rs - the ResultSet to extract from
names - the column names
owner - the containing entity
lobHandler - the LobHandler to use
Returns:
the extracted value
Throws:
SQLException - if thrown by JDBC methods

nullSafeSetInternal

protected void nullSafeSetInternal(PreparedStatement ps,
                                   int index,
                                   Object value,
                                   LobCreator lobCreator)
                            throws SQLException
Description copied from class: AbstractLobType
Template method to set the given parameter value on the given statement.

Specified by:
nullSafeSetInternal in class AbstractLobType
Parameters:
ps - the PreparedStatement to set on
index - the statement parameter index
value - the value to set
lobCreator - the LobCreator to use
Throws:
SQLException - if thrown by JDBC methods
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HibernateDaoSupport

org.springframework.orm.hibernate3.support
Class HibernateDaoSupport

java.lang.Object
    extended by  org.springframework.dao.support.DaoSupport
        extended by  org.springframework.orm.hibernate3.support.HibernateDaoSupport
All Implemented Interfaces:
InitializingBean
public abstract class HibernateDaoSupport
extends DaoSupport

Convenient super class for Hibernate-based data access objects.

Requires a SessionFactory to be set, providing a HibernateTemplate based on it to subclasses through the getHibernateTemplate() method. Can alternatively be initialized directly with a HibernateTemplate, in order to reuse the latter's settings such as the SessionFactory, exception translator, flush mode, etc.

This base class is mainly intended for HibernateTemplate usage but can also be used when working with a Hibernate Session directly, for example when relying on transactional Sessions. Convenience getSession() and releaseSession(org.hibernate.Session) methods are provided for that usage style.

This class will create its own HibernateTemplate instance if a SessionFactory is passed in. The "allowCreate" flag on that HibernateTemplate will be "true" by default. A custom HibernateTemplate instance can be used through overriding createHibernateTemplate(org.hibernate.SessionFactory).

Since:
1.2
Author:
Juergen Hoeller
See Also:
setSessionFactory(org.hibernate.SessionFactory), getHibernateTemplate(), HibernateTemplate

Field Summary
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
Constructor Summary
HibernateDaoSupport()
Method Summary
protected void | checkDaoConfig() Abstract subclasses must override this to check their configuration.
protected DataAccessException | convertHibernateAccessException(org.hibernate.HibernateException ex) Convert the given HibernateException to an appropriate exception from the org.springframework.dao hierarchy.
protected HibernateTemplate | createHibernateTemplate(org.hibernate.SessionFactory sessionFactory) Create a HibernateTemplate for the given SessionFactory.
HibernateTemplate | getHibernateTemplate() Return the HibernateTemplate for this DAO, pre-initialized with the SessionFactory or set explicitly.
protected org.hibernate.Session | getSession() Obtain a Hibernate Session, either from the current transaction or a new one.
protected org.hibernate.Session | getSession(boolean allowCreate) Obtain a Hibernate Session, either from the current transaction or a new one.
org.hibernate.SessionFactory | getSessionFactory() Return the Hibernate SessionFactory used by this DAO.
protected void | releaseSession(org.hibernate.Session session) Close the given Hibernate Session, created via this DAO's SessionFactory, if it isn't bound to the thread (i.e.
void | setHibernateTemplate(HibernateTemplate hibernateTemplate) Set the HibernateTemplate for this DAO explicitly, as an alternative to specifying a SessionFactory.
void | setSessionFactory(org.hibernate.SessionFactory sessionFactory) Set the Hibernate SessionFactory to be used by this DAO.
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

HibernateDaoSupport

public HibernateDaoSupport()
Method Detail

setSessionFactory

public final void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
Set the Hibernate SessionFactory to be used by this DAO. Will automatically create a HibernateTemplate for the given SessionFactory.

See Also:
createHibernateTemplate(org.hibernate.SessionFactory), setHibernateTemplate(org.springframework.orm.hibernate3.HibernateTemplate)

createHibernateTemplate

protected HibernateTemplate createHibernateTemplate(org.hibernate.SessionFactory sessionFactory)
Create a HibernateTemplate for the given SessionFactory. Only invoked if populating the DAO with a SessionFactory reference!

Can be overridden in subclasses to provide a HibernateTemplate instance with different configuration, or a custom HibernateTemplate subclass.

Parameters:
sessionFactory - the Hibernate SessionFactory to create a HibernateTemplate for
Returns:
the new HibernateTemplate instance
See Also:
setSessionFactory(org.hibernate.SessionFactory)

getSessionFactory

public final org.hibernate.SessionFactory getSessionFactory()
Return the Hibernate SessionFactory used by this DAO.

setHibernateTemplate

public final void setHibernateTemplate(HibernateTemplate hibernateTemplate)
Set the HibernateTemplate for this DAO explicitly, as an alternative to specifying a SessionFactory.

See Also:
setSessionFactory(org.hibernate.SessionFactory)

getHibernateTemplate

public final HibernateTemplate getHibernateTemplate()
Return the HibernateTemplate for this DAO, pre-initialized with the SessionFactory or set explicitly.

Note: The returned HibernateTemplate is a shared instance. You may introspect its configuration, but not modify the configuration (other than from within an DaoSupport.initDao() implementation). Consider creating a custom HibernateTemplate instance via new HibernateTemplate(getSessionFactory()), in which case you're allowed to customize the settings on the resulting instance.

checkDaoConfig

protected final void checkDaoConfig()
Description copied from class: DaoSupport
Abstract subclasses must override this to check their configuration.

Implementors should be marked as final

Specified by:
checkDaoConfig in class DaoSupport

getSession

protected final org.hibernate.Session getSession()
                                          throws DataAccessResourceFailureException,
                                                 IllegalStateException
Obtain a Hibernate Session, either from the current transaction or a new one. The latter is only allowed if the "allowCreate" setting of this bean's HibernateTemplate is "true".

Note that this is not meant to be invoked from HibernateTemplate code but rather just in plain Hibernate code. Either rely on a thread-bound Session or use it in combination with releaseSession(org.hibernate.Session).

In general, it is recommended to use HibernateTemplate, either with the provided convenience operations or with a custom HibernateCallback that provides you with a Session to work on. HibernateTemplate will care for all resource management and for proper exception conversion.

Returns:
the Hibernate Session
Throws:
DataAccessResourceFailureException - if the Session couldn't be created
IllegalStateException - if no thread-bound Session found and allowCreate=false
See Also:
SessionFactoryUtils.getSession(SessionFactory, boolean)

getSession

protected final org.hibernate.Session getSession(boolean allowCreate)
                                          throws DataAccessResourceFailureException,
                                                 IllegalStateException
Obtain a Hibernate Session, either from the current transaction or a new one. The latter is only allowed if "allowCreate" is true.

Note that this is not meant to be invoked from HibernateTemplate code but rather just in plain Hibernate code. Either rely on a thread-bound Session or use it in combination with releaseSession(org.hibernate.Session).

In general, it is recommended to use HibernateTemplate, either with the provided convenience operations or with a custom HibernateCallback that provides you with a Session to work on. HibernateTemplate will care for all resource management and for proper exception conversion.

Parameters:
allowCreate - if a non-transactional Session should be created when no transactional Session can be found for the current thread
Returns:
the Hibernate Session
Throws:
DataAccessResourceFailureException - if the Session couldn't be created
IllegalStateException - if no thread-bound Session found and allowCreate=false
See Also:
SessionFactoryUtils.getSession(SessionFactory, boolean)

convertHibernateAccessException

protected final DataAccessException convertHibernateAccessException(org.hibernate.HibernateException ex)
Convert the given HibernateException to an appropriate exception from the org.springframework.dao hierarchy. Will automatically detect wrapped SQLExceptions and convert them accordingly.

Delegates to the HibernateAccessor.convertHibernateAccessException(org.hibernate.HibernateException) method of this DAO's HibernateTemplate.

Typically used in plain Hibernate code, in combination with getSession() and releaseSession(org.hibernate.Session).

Parameters:
ex - HibernateException that occurred
Returns:
the corresponding DataAccessException instance
See Also:
SessionFactoryUtils.convertHibernateAccessException(org.hibernate.HibernateException)

releaseSession

protected final void releaseSession(org.hibernate.Session session)
Close the given Hibernate Session, created via this DAO's SessionFactory, if it isn't bound to the thread (i.e. isn't a transactional Session).

Typically used in plain Hibernate code, in combination with getSession() and convertHibernateAccessException(org.hibernate.HibernateException).

Parameters:
session - the Session to close
See Also:
SessionFactoryUtils.releaseSession(org.hibernate.Session, org.hibernate.SessionFactory)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


IdTransferringMergeEventListener

org.springframework.orm.hibernate3.support
Class IdTransferringMergeEventListener

java.lang.Object
    extended by  org.hibernate.event.def.AbstractReassociateEventListener
        extended by  org.hibernate.event.def.AbstractSaveEventListener
            extended by  org.hibernate.event.def.DefaultMergeEventListener
                extended by  org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener
All Implemented Interfaces:
Serializable, org.hibernate.event.MergeEventListener
public class IdTransferringMergeEventListener
extends org.hibernate.event.def.DefaultMergeEventListener

Extension of Hibernate's DefaultMergeEventListener, transferring the ids of newly saved objects to the corresponding original objects (that are part of the detached object graph passed into the merge method).

Transferring newly assigned ids to the original graph allows for continuing to use the original object graph, despite merged copies being registered with the current Hibernate Session. This is particularly useful for web applications that might want to store an object graph and then render it in a web view, with links that include the id of certain (potentially newly saved) objects.

The merge behavior given by this MergeEventListener is nearly identical to TopLink's merge behavior. See PetClinic for an example, which relies on ids being available for newly saved objects: the HibernateClinic and TopLinkClinic DAO implementations both use straight merge calls, with the Hibernate SessionFactory configuration specifying an IdTransferringMergeEventListener.

Typically specified as entry for LocalSessionFactoryBean's "eventListeners" map, with key "merge".

Since:
1.2
Author:
Juergen Hoeller
See Also:
LocalSessionFactoryBean.setEventListeners(java.util.Map), Serialized Form

Field Summary
Fields inherited from class org.hibernate.event.def.AbstractSaveEventListener
DELETED, DETACHED, PERSISTENT, TRANSIENT
Constructor Summary
IdTransferringMergeEventListener()
Method Summary
protected  void entityIsTransient(org.hibernate.event.MergeEvent event, Map copyCache)
Hibernate 3.1 implementation of ID transferral.
Methods inherited from class org.hibernate.event.def.DefaultMergeEventListener
cascadeAfterSave, cascadeBeforeSave, cascadeOnMerge, copyValues, copyValues, entityIsDetached, entityIsPersistent, getAssumedUnsaved, getCascadeAction, getMergeMap, onMerge, onMerge
Methods inherited from class org.hibernate.event.def.AbstractSaveEventListener
getEntityState, getLoggableName, invokeSaveLifecycle, isVersionIncrementDisabled, performSave, performSaveOrReplicate, saveWithGeneratedId, saveWithRequestedId, substituteValuesIfNecessary, validate, visitCollectionsBeforeSave
Methods inherited from class org.hibernate.event.def.AbstractReassociateEventListener
reassociate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

IdTransferringMergeEventListener

public IdTransferringMergeEventListener()
Method Detail

entityIsTransient

protected void entityIsTransient(org.hibernate.event.MergeEvent event,
                                 Map copyCache)
Hibernate 3.1 implementation of ID transferral.

Overrides:
entityIsTransient in class org.hibernate.event.def.DefaultMergeEventListener
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OpenSessionInViewFilter

org.springframework.orm.hibernate3.support
Class OpenSessionInViewFilter

java.lang.Object
    extended by  org.springframework.web.filter.GenericFilterBean
        extended by  org.springframework.web.filter.OncePerRequestFilter
            extended by  org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
All Implemented Interfaces:
Filter, BeanNameAware, DisposableBean, InitializingBean, ServletContextAware
public class OpenSessionInViewFilter
extends OncePerRequestFilter

Servlet 2.3 Filter that binds a Hibernate Session to the thread for the entire processing of the request. Intended for the "Open Session in View" pattern, i.e. to allow for lazy loading in web views despite the original transactions already being completed.

This filter makes Hibernate Sessions available via the current thread, which will be autodetected by transaction managers. It is suitable for service layer transactions via HibernateTransactionManager or JtaTransactionManager as well as for non-transactional execution (if configured appropriately).

NOTE: This filter will by default not flush the Hibernate Session, with the flush mode set to FlushMode.NEVER. It assumes to be used in combination with service layer transactions that care for the flushing: The active transaction manager will temporarily change the flush mode to FlushMode.AUTO during a read-write transaction, with the flush mode reset to FlushMode.NEVER at the end of each transaction. If you intend to use this filter without transactions, consider changing the default flush mode (through the "flushMode" property).

WARNING: Applying this filter to existing logic can cause issues that have not appeared before, through the use of a single Hibernate Session for the processing of an entire request. In particular, the reassociation of persistent objects with a Hibernate Session has to occur at the very beginning of request processing, to avoid clashes with already loaded instances of the same objects.

Alternatively, turn this filter into deferred close mode, by specifying "singleSession"="false": It will not use a single session per request then, but rather let each data access operation or transaction use its own session (like without Open Session in View). Each of those sessions will be registered for deferred close, though, actually processed at request completion.

A single session per request allows for most efficient first-level caching, but can cause side effects, for example on saveOrUpdate or when continuing after a rolled-back transaction. The deferred close strategy is as safe as no Open Session in View in that respect, while still allowing for lazy loading in views (but not providing a first-level cache for the entire request).

Looks up the SessionFactory in Spring's root web application context. Supports a "sessionFactoryBeanName" filter init-param in web.xml; the default bean name is "sessionFactory". Looks up the SessionFactory on each request, to avoid initialization order issues (when using ContextLoaderServlet, the root application context will get initialized after this filter).

Since:
1.2
Author:
Juergen Hoeller
See Also:
setSingleSession(boolean), setFlushMode(org.hibernate.FlushMode), lookupSessionFactory(javax.servlet.http.HttpServletRequest), OpenSessionInViewInterceptor, HibernateInterceptor, HibernateTransactionManager, SessionFactoryUtils.getSession(org.hibernate.SessionFactory, boolean), TransactionSynchronizationManager

Field Summary
static String DEFAULT_SESSION_FACTORY_BEAN_NAME
Fields inherited from class org.springframework.web.filter.OncePerRequestFilter
ALREADY_FILTERED_SUFFIX
Fields inherited from class org.springframework.web.filter.GenericFilterBean
logger
Constructor Summary
OpenSessionInViewFilter()
Method Summary
protected void | closeSession(org.hibernate.Session session, org.hibernate.SessionFactory sessionFactory) Close the given Session.
protected void | doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) Same contract as for doFilter, but guaranteed to be just invoked once per request.
protected org.hibernate.FlushMode | getFlushMode() Return the Hibernate FlushMode that this filter applies to its Session (in single session mode).
protected org.hibernate.Session | getSession(org.hibernate.SessionFactory sessionFactory) Get a Session for the SessionFactory that this filter uses.
protected String | getSessionFactoryBeanName() Return the bean name of the SessionFactory to fetch from Spring's root application context.
protected boolean | isSingleSession() Return whether to use a single session for each request.
protected org.hibernate.SessionFactory | lookupSessionFactory() Look up the SessionFactory that this filter should use.
protected org.hibernate.SessionFactory | lookupSessionFactory(HttpServletRequest request) Look up the SessionFactory that this filter should use, taking the current HTTP request as argument.
void | setFlushMode(org.hibernate.FlushMode flushMode) Specify the Hibernate FlushMode to apply to this filter's Session.
void | setSessionFactoryBeanName(String sessionFactoryBeanName) Set the bean name of the SessionFactory to fetch from Spring's root application context.
void | setSingleSession(boolean singleSession) Set whether to use a single session for each request.
Methods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, getAlreadyFilteredAttributeName, shouldNotFilter
Methods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setServletContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_SESSION_FACTORY_BEAN_NAME

public static final String DEFAULT_SESSION_FACTORY_BEAN_NAME
See Also:
Constant Field Values
Constructor Detail

OpenSessionInViewFilter

public OpenSessionInViewFilter()
Method Detail

setSessionFactoryBeanName

public void setSessionFactoryBeanName(String sessionFactoryBeanName)
Set the bean name of the SessionFactory to fetch from Spring's root application context. Default is "sessionFactory".

See Also:
DEFAULT_SESSION_FACTORY_BEAN_NAME

getSessionFactoryBeanName

protected String getSessionFactoryBeanName()
Return the bean name of the SessionFactory to fetch from Spring's root application context.

setSingleSession

public void setSingleSession(boolean singleSession)
Set whether to use a single session for each request. Default is "true".

If set to "false", each data access operation or transaction will use its own session (like without Open Session in View). Each of those sessions will be registered for deferred close, though, actually processed at request completion.

See Also:
SessionFactoryUtils.initDeferredClose(org.hibernate.SessionFactory), SessionFactoryUtils.processDeferredClose(org.hibernate.SessionFactory)

isSingleSession

protected boolean isSingleSession()
Return whether to use a single session for each request.

setFlushMode

public void setFlushMode(org.hibernate.FlushMode flushMode)
Specify the Hibernate FlushMode to apply to this filter's Session. Only applied in single session mode.

Can be populated with the corresponding constant name in XML bean definitions: e.g. "AUTO".

The default is "MANUAL". Specify "AUTO" if you intend to use this filter without service layer transactions.

See Also:
Session.setFlushMode(org.hibernate.FlushMode), FlushMode.MANUAL, FlushMode.AUTO

getFlushMode

protected org.hibernate.FlushMode getFlushMode()
Return the Hibernate FlushMode that this filter applies to its Session (in single session mode).

doFilterInternal

protected void doFilterInternal(HttpServletRequest request,
                                HttpServletResponse response,
                                FilterChain filterChain)
                         throws ServletException,
                                IOException
Description copied from class: OncePerRequestFilter
Same contract as for doFilter, but guaranteed to be just invoked once per request. Provides HttpServletRequest and HttpServletResponse arguments instead of the default ServletRequest and ServletResponse ones.

Specified by:
doFilterInternal in class OncePerRequestFilter
Throws:
ServletException
IOException

lookupSessionFactory

protected org.hibernate.SessionFactory lookupSessionFactory(HttpServletRequest request)
Look up the SessionFactory that this filter should use, taking the current HTTP request as argument.

The default implementation delegates to the lookupSessionFactory() variant without arguments.

Parameters:
request - the current request
Returns:
the SessionFactory to use

lookupSessionFactory

protected org.hibernate.SessionFactory lookupSessionFactory()
Look up the SessionFactory that this filter should use.

The default implementation looks for a bean with the specified name in Spring's root application context.

Returns:
the SessionFactory to use
See Also:
getSessionFactoryBeanName()

getSession

protected org.hibernate.Session getSession(org.hibernate.SessionFactory sessionFactory)
                                    throws DataAccessResourceFailureException
Get a Session for the SessionFactory that this filter uses. Note that this just applies in single session mode!

The default implementation delegates to the SessionFactoryUtils.getSession method and sets the Session's flush mode to "MANUAL".

Can be overridden in subclasses for creating a Session with a custom entity interceptor or JDBC exception translator.

Parameters:
sessionFactory - the SessionFactory that this filter uses
Returns:
the Session to use
Throws:
DataAccessResourceFailureException - if the Session could not be created
See Also:
SessionFactoryUtils.getSession(SessionFactory, boolean), FlushMode.MANUAL

closeSession

protected void closeSession(org.hibernate.Session session,
                            org.hibernate.SessionFactory sessionFactory)
Close the given Session. Note that this just applies in single session mode!

Can be overridden in subclasses, e.g. for flushing the Session before closing it. See class-level javadoc for a discussion of flush handling. Note that you should also override getSession accordingly, to set the flush mode to something else than NEVER.

Parameters:
session - the Session used for filtering
sessionFactory - the SessionFactory that this filter uses
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OpenSessionInViewInterceptor

org.springframework.orm.hibernate3.support
Class OpenSessionInViewInterceptor

java.lang.Object
    extended by  org.springframework.orm.hibernate3.HibernateAccessor
        extended by  org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor
All Implemented Interfaces:
BeanFactoryAware, InitializingBean, WebRequestInterceptor
public class OpenSessionInViewInterceptor
extends HibernateAccessor
implements WebRequestInterceptor

Spring web request interceptor that binds a Hibernate Session to the thread for the entire processing of the request.

This class is a concrete expression of the "Open Session in View" pattern, which is a pattern that allows for the lazy loading of associations in web views despite the original transactions already being completed.

This interceptor makes Hibernate Sessions available via the current thread, which will be autodetected by transaction managers. It is suitable for service layer transactions via HibernateTransactionManager or JtaTransactionManager as well as for non-transactional execution (if configured appropriately).

NOTE: This interceptor will by default not flush the Hibernate Session, with the flush mode being set to FlushMode.NEVER. It assumes that it will be used in combination with service layer transactions that handle the flushing: the active transaction manager will temporarily change the flush mode to FlushMode.AUTO during a read-write transaction, with the flush mode reset to FlushMode.NEVER at the end of each transaction. If you intend to use this interceptor without transactions, consider changing the default flush mode (through the "flushMode" property).

In contrast to OpenSessionInViewFilter, this interceptor is configured in a Spring application context and can thus take advantage of bean wiring. It inherits common Hibernate configuration properties from HibernateAccessor, to be configured in a bean definition.

WARNING: Applying this interceptor to existing logic can cause issues that have not appeared before, through the use of a single Hibernate Session for the processing of an entire request. In particular, the reassociation of persistent objects with a Hibernate Session has to occur at the very beginning of request processing, to avoid clashes with already loaded instances of the same objects.

Alternatively, turn this interceptor into deferred close mode, by specifying "singleSession"="false": It will not use a single session per request then, but rather let each data access operation or transaction use its own session (as would be the case without Open Session in View). Each of those sessions will be registered for deferred close though, which will actually be processed at request completion.

A single session per request allows for the most efficient first-level caching, but can cause side effects, for example on saveOrUpdate or when continuing after a rolled-back transaction. The deferred close strategy is as safe as no Open Session in View in that respect, while still allowing for lazy loading in views (but not providing a first-level cache for the entire request).

Since:
1.2
Author:
Juergen Hoeller
See Also:
setSingleSession(boolean), HibernateAccessor.setFlushMode(int), OpenSessionInViewFilter, HibernateInterceptor, HibernateTransactionManager, SessionFactoryUtils.getSession(org.hibernate.SessionFactory, boolean), TransactionSynchronizationManager

Field Summary
static String PARTICIPATE_SUFFIX
Suffix that gets appended to the SessionFactory toString() representation for the "participate in existing session handling" request attribute.
Fields inherited from class org.springframework.orm.hibernate3.HibernateAccessor
FLUSH_ALWAYS, FLUSH_AUTO, FLUSH_COMMIT, FLUSH_EAGER, FLUSH_NEVER, logger
Constructor Summary
OpenSessionInViewInterceptor()
Create a new OpenSessionInViewInterceptor, turning the default flushMode to FLUSH_NEVER.
Method Summary
void | afterCompletion(WebRequest request, Exception ex) Unbind the Hibernate Session from the thread and close it (in single session mode), or process deferred close for all sessions that have been opened during the current request (in deferred close mode).
protected String | getParticipateAttributeName() Return the name of the request attribute that identifies that a request is already intercepted.
protected boolean | isSingleSession() Return whether to use a single session for each request.
void | postHandle(WebRequest request, ModelMap model) Flush the Hibernate Session before view rendering, if necessary.
void | preHandle(WebRequest request) Open a new Hibernate Session according to the settings of this HibernateAccessor and bind it to the thread via the TransactionSynchronizationManager.
void | setSingleSession(boolean singleSession) Set whether to use a single session for each request.
Methods inherited from class org.springframework.orm.hibernate3.HibernateAccessor
afterPropertiesSet, applyFlushMode, convertHibernateAccessException, convertJdbcAccessException, convertJdbcAccessException, disableFilters, enableFilters, flushIfNecessary, getDefaultJdbcExceptionTranslator, getEntityInterceptor, getFilterNames, getFlushMode, getJdbcExceptionTranslator, getSessionFactory, setBeanFactory, setEntityInterceptor, setEntityInterceptorBeanName, setFilterName, setFilterNames, setFlushMode, setFlushModeName, setJdbcExceptionTranslator, setSessionFactory
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

PARTICIPATE_SUFFIX

public static final String PARTICIPATE_SUFFIX
Suffix that gets appended to the SessionFactory toString() representation for the "participate in existing session handling" request attribute.

See Also:
getParticipateAttributeName(), Constant Field Values
Constructor Detail

OpenSessionInViewInterceptor

public OpenSessionInViewInterceptor()
Create a new OpenSessionInViewInterceptor, turning the default flushMode to FLUSH_NEVER.

See Also:
HibernateAccessor.setFlushMode(int)
Method Detail

setSingleSession

public void setSingleSession(boolean singleSession)
Set whether to use a single session for each request. Default is "true".

If set to false, each data access operation or transaction will use its own session (like without Open Session in View). Each of those sessions will be registered for deferred close, though, actually processed at request completion.

See Also:
SessionFactoryUtils.initDeferredClose(org.hibernate.SessionFactory), SessionFactoryUtils.processDeferredClose(org.hibernate.SessionFactory)

isSingleSession

protected boolean isSingleSession()
Return whether to use a single session for each request.

preHandle

public void preHandle(WebRequest request)
               throws DataAccessException
Open a new Hibernate Session according to the settings of this HibernateAccessor and bind it to the thread via the TransactionSynchronizationManager.

Specified by:
preHandle in interface WebRequestInterceptor
Parameters:
request - the current web request
Throws:
DataAccessException
See Also:
SessionFactoryUtils.getSession(org.hibernate.SessionFactory, boolean)

postHandle

public void postHandle(WebRequest request,
                       ModelMap model)
                throws DataAccessException
Flush the Hibernate Session before view rendering, if necessary.

Note that this just applies in single session mode!

The default is FLUSH_NEVER to avoid this extra flushing, assuming that service layer transactions have flushed their changes on commit.

Specified by:
postHandle in interface WebRequestInterceptor
Parameters:
request - the current web request
model - the map of model objects that will be exposed to the view (may be null). Can be used to analyze the exposed model and/or to add further model attributes, if desired.
Throws:
DataAccessException
See Also:
HibernateAccessor.setFlushMode(int)

afterCompletion

public void afterCompletion(WebRequest request,
                            Exception ex)
                     throws DataAccessException
Unbind the Hibernate Session from the thread and close it (in single session mode), or process deferred close for all sessions that have been opened during the current request (in deferred close mode).

Specified by:
afterCompletion in interface WebRequestInterceptor
Parameters:
request - the current web request
ex - exception thrown on handler execution, if any
Throws:
DataAccessException
See Also:
TransactionSynchronizationManager

getParticipateAttributeName

protected String getParticipateAttributeName()
Return the name of the request attribute that identifies that a request is already intercepted.

The default implementation takes the toString() representation of the SessionFactory instance and appends PARTICIPATE_SUFFIX.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ScopedBeanInterceptor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.orm.hibernate3.support
Class ScopedBeanInterceptor

java.lang.Object
    extended by  org.hibernate.EmptyInterceptor
        extended by  org.springframework.orm.hibernate3.support.ScopedBeanInterceptor
All Implemented Interfaces:
Serializable, org.hibernate.Interceptor
public class ScopedBeanInterceptor
extends org.hibernate.EmptyInterceptor

Hibernate3 interceptor used for getting the proper entity name for scoped beans. As scoped bean classes are proxies generated at runtime, they are unrecognized by the persisting framework. Using this interceptor, the original scoped bean class is retrieved end exposed to Hibernate for persisting.

Usage example:

 <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
   ...
   <property name="entityInterceptor">
     <bean class="org.springframework.orm.hibernate3.support.ScopedBeanInterceptor"/>
   </property>
 </bean>

Since:
2.0
Author:
Costin Leau, Juergen Hoeller
See Also:
Serialized Form

Field Summary
Fields inherited from class org.hibernate.EmptyInterceptor
INSTANCE
Constructor Summary
ScopedBeanInterceptor()
Method Summary
 String getEntityName(Object entity)
Methods inherited from class org.hibernate.EmptyInterceptor
afterTransactionBegin, afterTransactionCompletion, beforeTransactionCompletion, findDirty, getEntity, instantiate, isTransient, onCollectionRecreate, onCollectionRemove, onCollectionUpdate, onDelete, onFlushDirty, onLoad, onPrepareStatement, onSave, postFlush, preFlush
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ScopedBeanInterceptor

public ScopedBeanInterceptor()
Method Detail

getEntityName

public String getEntityName(Object entity)
Specified by:
getEntityName in interface org.hibernate.Interceptor
Overrides:
getEntityName in class org.hibernate.EmptyInterceptor
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.orm.ibatis

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.orm.ibatis

Package providing integration of iBATIS Database Layer with Spring concepts.

See:
Description

Interface Summary
SqlMapClientCallback<T> | Callback interface for data access code that works with the iBATIS SqlMapExecutor interface.
SqlMapClientOperations | Interface that specifies a basic set of iBATIS SqlMapClient operations, implemented by SqlMapClientTemplate.

Class Summary
SqlMapClientFactoryBean | FactoryBean that creates an iBATIS SqlMapClient.
SqlMapClientTemplate | Helper class that simplifies data access via the iBATIS SqlMapClient API, converting checked SQLExceptions into unchecked DataAccessExceptions, following the org.springframework.dao exception hierarchy.

Package org.springframework.orm.ibatis Description

Package providing integration of iBATIS Database Layer with Spring concepts.

Contains resource helper classes and template classes for data access with the iBATIS SqlMapClient API.


org.springframework.orm.ibatis Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.orm.ibatis

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.jdbc.support.JdbcAccessor (implements org.springframework.beans.factory.InitializingBean)
      • org.springframework.orm.ibatis.SqlMapClientTemplate (implements org.springframework.orm.ibatis.SqlMapClientOperations)
    • org.springframework.orm.ibatis.SqlMapClientFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)

Interface Hierarchy

  • org.springframework.orm.ibatis.SqlMapClientCallback<T>
  • org.springframework.orm.ibatis.SqlMapClientOperations


SqlMapClientCallback

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.orm.ibatis
Interface SqlMapClientCallback<T>

public interface SqlMapClientCallback<T>

Callback interface for data access code that works with the iBATIS SqlMapExecutor interface. To be used with SqlMapClientTemplate's execute method, assumably often as anonymous classes within a method implementation.

Since:
24.02.2004
Author:
Juergen Hoeller
See Also:
SqlMapClientTemplate, DataSourceTransactionManager

Method Summary
 T doInSqlMapClient(com.ibatis.sqlmap.client.SqlMapExecutor executor)
Gets called by SqlMapClientTemplate.execute with an active SqlMapExecutor.

Method Detail

doInSqlMapClient

T doInSqlMapClient(com.ibatis.sqlmap.client.SqlMapExecutor executor)
                   throws SQLException
Gets called by SqlMapClientTemplate.execute with an active SqlMapExecutor. Does not need to care about activating or closing the SqlMapExecutor, or handling transactions.

If called without a thread-bound JDBC transaction (initiated by DataSourceTransactionManager), the code will simply get executed on the underlying JDBC connection with its transactional semantics. If using a JTA-aware DataSource, the JDBC connection and thus the callback code will be transactional if a JTA transaction is active.

Allows for returning a result object created within the callback, i.e. a domain object or a collection of domain objects. A thrown custom RuntimeException is treated as an application exception: It gets propagated to the caller of the template.

Parameters:
executor - an active iBATIS SqlMapSession, passed-in as SqlMapExecutor interface here to avoid manual lifecycle handling
Returns:
a result object, or null if none
Throws:
SQLException - if thrown by the iBATIS SQL Maps API
See Also:
SqlMapClientTemplate.execute(org.springframework.orm.ibatis.SqlMapClientCallback),
SqlMapClientTemplate.executeWithListResult(org.springframework.orm.ibatis.SqlMapClientCallback),
SqlMapClientTemplate.executeWithMapResult(org.springframework.orm.ibatis.SqlMapClientCallback)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


SqlMapClientOperations

org.springframework.orm.ibatis
Interface SqlMapClientOperations

All Known Implementing Classes:
SqlMapClientTemplate
public interface SqlMapClientOperations

Interface that specifies a basic set of iBATIS SqlMapClient operations, implemented by SqlMapClientTemplate. Not often used, but a useful option to enhance testability, as it can easily be mocked or stubbed.

Defines SqlMapClientTemplate's convenience methods that mirror the iBATIS SqlMapExecutor's execution methods. Users are strongly encouraged to read the iBATIS javadocs for details on the semantics of those methods.

Since:
24.02.2004
Author:
Juergen Hoeller
See Also:
SqlMapClientTemplate, SqlMapClient, SqlMapExecutor

Method Summary
int | delete(String statementName)
int | delete(String statementName, Object parameterObject)
void | delete(String statementName, Object parameterObject, int requiredRowsAffected) Convenience method provided by Spring: execute a delete operation with an automatic check that the delete affected the given required number of rows.
Object | insert(String statementName)
Object | insert(String statementName, Object parameterObject)
List | queryForList(String statementName)
List | queryForList(String statementName, int skipResults, int maxResults)
List | queryForList(String statementName, Object parameterObject)
List | queryForList(String statementName, Object parameterObject, int skipResults, int maxResults)
Map | queryForMap(String statementName, Object parameterObject, String keyProperty)
Map | queryForMap(String statementName, Object parameterObject, String keyProperty, String valueProperty)
Object | queryForObject(String statementName)
Object | queryForObject(String statementName, Object parameterObject)
Object | queryForObject(String statementName, Object parameterObject, Object resultObject)
void | queryWithRowHandler(String statementName, Object parameterObject, com.ibatis.sqlmap.client.event.RowHandler rowHandler)
void | queryWithRowHandler(String statementName, com.ibatis.sqlmap.client.event.RowHandler rowHandler)
int | update(String statementName)
int | update(String statementName, Object parameterObject)
void | update(String statementName, Object parameterObject, int requiredRowsAffected) Convenience method provided by Spring: execute an update operation with an automatic check that the update affected the given required number of rows.

Method Detail

queryForObject

Object queryForObject(String statementName)
                      throws DataAccessException
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.queryForObject(String)

queryForObject

Object queryForObject(String statementName,
                      Object parameterObject)
                      throws DataAccessException
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.queryForObject(String, Object)

queryForObject

Object queryForObject(String statementName,
                      Object parameterObject,
                      Object resultObject)
                      throws DataAccessException
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.queryForObject(String, Object, Object)

queryForList

List queryForList(String statementName)
                  throws DataAccessException
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.queryForList(String)

queryForList

List queryForList(String statementName,
                  Object parameterObject)
                  throws DataAccessException
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.queryForList(String, Object)

queryForList

List queryForList(String statementName,
                  int skipResults,
                  int maxResults)
                  throws DataAccessException
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.queryForList(String, int, int)

queryForList

List queryForList(String statementName,
                  Object parameterObject,
                  int skipResults,
                  int maxResults)
                  throws DataAccessException
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.queryForList(String, Object, int, int)

queryWithRowHandler

void queryWithRowHandler(String statementName,
                         com.ibatis.sqlmap.client.event.RowHandler rowHandler)
                         throws DataAccessException
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.queryWithRowHandler(String, RowHandler)

queryWithRowHandler

void queryWithRowHandler(String statementName,
                         Object parameterObject,
                         com.ibatis.sqlmap.client.event.RowHandler rowHandler)
                         throws DataAccessException
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.queryWithRowHandler(String, Object, RowHandler)

queryForMap

Map queryForMap(String statementName,
                Object parameterObject,
                String keyProperty)
                throws DataAccessException
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.queryForMap(String, Object, String)

queryForMap

Map queryForMap(String statementName,
                Object parameterObject,
                String keyProperty,
                String valueProperty)
                throws DataAccessException
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.queryForMap(String, Object, String, String)

insert

Object insert(String statementName)
              throws DataAccessException
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.insert(String)

insert

Object insert(String statementName,
              Object parameterObject)
              throws DataAccessException
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.insert(String, Object)

update

int update(String statementName)
           throws DataAccessException
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.update(String)

update

int update(String statementName,
           Object parameterObject)
           throws DataAccessException
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.update(String, Object)

update

void update(String statementName,
            Object parameterObject,
            int requiredRowsAffected)
            throws DataAccessException
Convenience method provided by Spring: execute an update operation with an automatic check that the update affected the given required number of rows.

Parameters:
statementName - the name of the mapped statement
parameterObject - the parameter object
requiredRowsAffected - the number of rows that the update is required to affect
Throws:
DataAccessException - in case of errors

delete

int delete(String statementName)
           throws DataAccessException
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.delete(String)

delete

int delete(String statementName,
           Object parameterObject)
           throws DataAccessException
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.delete(String, Object)

delete

void delete(String statementName,
            Object parameterObject,
            int requiredRowsAffected)
            throws DataAccessException
Convenience method provided by Spring: execute a delete operation with an automatic check that the delete affected the given required number of rows.

Parameters:
statementName - the name of the mapped statement
parameterObject - the parameter object
requiredRowsAffected - the number of rows that the delete is required to affect
Throws:
DataAccessException - in case of errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SqlMapClientFactoryBean

org.springframework.orm.ibatis
Class SqlMapClientFactoryBean

java.lang.Object
    extended by  org.springframework.orm.ibatis.SqlMapClientFactoryBean
All Implemented Interfaces:
FactoryBean<com.ibatis.sqlmap.client.SqlMapClient>, InitializingBean
public class SqlMapClientFactoryBean
extends Object
implements FactoryBean<com.ibatis.sqlmap.client.SqlMapClient>, InitializingBean

FactoryBean that creates an iBATIS SqlMapClient. This is the usual way to set up a shared iBATIS SqlMapClient in a Spring application context; the SqlMapClient can then be passed to iBATIS-based DAOs via dependency injection.

Either DataSourceTransactionManager or JtaTransactionManager can be used for transaction demarcation in combination with a SqlMapClient, with JTA only necessary for transactions which span multiple databases.

Allows for specifying a DataSource at the SqlMapClient level. This is preferable to per-DAO DataSource references, as it allows for lazy loading and avoids repeated DataSource references in every DAO.

Note: As of Spring 2.5.5, this class (finally) requires iBATIS 2.3 or higher. The new "mappingLocations" feature requires iBATIS 2.3.2.

Since:
24.02.2004
Author:
Juergen Hoeller
See Also:
setConfigLocation(org.springframework.core.io.Resource),
setDataSource(javax.sql.DataSource),
SqlMapClientTemplate.setSqlMapClient(com.ibatis.sqlmap.client.SqlMapClient),
JdbcAccessor.setDataSource(javax.sql.DataSource)

Constructor Summary
SqlMapClientFactoryBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected  void applyTransactionConfig(com.ibatis.sqlmap.client.SqlMapClient sqlMapClient, com.ibatis.sqlmap.engine.transaction.TransactionConfig transactionConfig)
Apply the given iBATIS TransactionConfig to the SqlMapClient.
protected  com.ibatis.sqlmap.client.SqlMapClient buildSqlMapClient(Resource[] configLocations, Resource[] mappingLocations, Properties properties)
Build a SqlMapClient instance based on the given standard configuration.
static LobHandler getConfigTimeLobHandler()
Return the LobHandler for the currently configured iBATIS SqlMapClient, to be used by TypeHandler implementations like ClobStringTypeHandler.
 com.ibatis.sqlmap.client.SqlMapClient getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<? extends com.ibatis.sqlmap.client.SqlMapClient> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setConfigLocation(Resource configLocation)
Set the location of the iBATIS SqlMapClient config file.
 void setConfigLocations(Resource[] configLocations)
Set multiple locations of iBATIS SqlMapClient config files that are going to be merged into one unified configuration at runtime.
 void setDataSource(DataSource dataSource)
Set the DataSource to be used by iBATIS SQL Maps.
 void setLobHandler(LobHandler lobHandler)
Set the LobHandler to be used by the SqlMapClient.
 void setMappingLocations(Resource[] mappingLocations)
Set locations of iBATIS sql-map mapping files that are going to be merged into the SqlMapClient configuration at runtime.
 void setSqlMapClientProperties(Properties sqlMapClientProperties)
Set optional properties to be passed into the SqlMapClientBuilder, as alternative to a <properties> tag in the sql-map-config.xml file.
 void setTransactionConfigClass(Class transactionConfigClass)
Set the iBATIS TransactionConfig class to use.
 void setTransactionConfigProperties(Properties transactionConfigProperties)
Set properties to be passed to the TransactionConfig instance used by this SqlMapClient.
 void setUseTransactionAwareDataSource(boolean useTransactionAwareDataSource)
Set whether to use a transaction-aware DataSource for the SqlMapClient, i.e.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SqlMapClientFactoryBean

public SqlMapClientFactoryBean()
Method Detail

getConfigTimeLobHandler

public static LobHandler getConfigTimeLobHandler()
Return the LobHandler for the currently configured iBATIS SqlMapClient, to be used by TypeHandler implementations like ClobStringTypeHandler.

This instance will be set before initialization of the corresponding SqlMapClient, and reset immediately afterwards. It is thus only available during configuration.

See Also:
setLobHandler(org.springframework.jdbc.support.lob.LobHandler), ClobStringTypeHandler, BlobByteArrayTypeHandler, BlobSerializableTypeHandler

setConfigLocation

public void setConfigLocation(Resource configLocation)
Set the location of the iBATIS SqlMapClient config file. A typical value is "WEB-INF/sql-map-config.xml".

See Also:
setConfigLocations(org.springframework.core.io.Resource[])

setConfigLocations

public void setConfigLocations(Resource[] configLocations)
Set multiple locations of iBATIS SqlMapClient config files that are going to be merged into one unified configuration at runtime.

setMappingLocations

public void setMappingLocations(Resource[] mappingLocations)
Set locations of iBATIS sql-map mapping files that are going to be merged into the SqlMapClient configuration at runtime.

This is an alternative to specifying "<sqlMap>" entries in a sql-map-client config file. This property being based on Spring's resource abstraction also allows for specifying resource patterns here: e.g. "/myApp/*-map.xml".

Note that this feature requires iBATIS 2.3.2; it will not work with any previous iBATIS version.

setSqlMapClientProperties

public void setSqlMapClientProperties(Properties sqlMapClientProperties)
Set optional properties to be passed into the SqlMapClientBuilder, as alternative to a <properties> tag in the sql-map-config.xml file. Will be used to resolve placeholders in the config file.

See Also:
setConfigLocation(org.springframework.core.io.Resource), SqlMapClientBuilder.buildSqlMapClient(java.io.InputStream, java.util.Properties)

setDataSource

public void setDataSource(DataSource dataSource)
Set the DataSource to be used by iBATIS SQL Maps. This will be passed to the SqlMapClient as part of a TransactionConfig instance.

If specified, this will override corresponding settings in the SqlMapClient properties. Usually, you will specify DataSource and transaction configuration either here or in SqlMapClient properties.

Specifying a DataSource for the SqlMapClient rather than for each individual DAO allows for lazy loading, for example when using PaginatedList results.

With a DataSource passed in here, you don't need to specify one for each DAO. Passing the SqlMapClient to the DAOs is enough, as it already carries a DataSource. Thus, it's recommended to specify the DataSource at this central location only.

Thanks to Brandon Goodin from the iBATIS team for the hint on how to make this work with Spring's integration strategy!

See Also:
setTransactionConfigClass(java.lang.Class),
setTransactionConfigProperties(java.util.Properties),
SqlMapTransactionManager.getDataSource(),
JdbcAccessor.setDataSource(javax.sql.DataSource),
SqlMapClientTemplate#queryForPaginatedList

setUseTransactionAwareDataSource

public void setUseTransactionAwareDataSource(boolean useTransactionAwareDataSource)
Set whether to use a transaction-aware DataSource for the SqlMapClient, i.e. whether to automatically wrap the passed-in DataSource with Spring's TransactionAwareDataSourceProxy.

Default is "true": When the SqlMapClient performs direct database operations outside of Spring's SqlMapClientTemplate (for example, lazy loading or direct SqlMapClient access), it will still participate in active Spring-managed transactions.

As a further effect, using a transaction-aware DataSource will apply remaining transaction timeouts to all created JDBC Statements. This means that all operations performed by the SqlMapClient will automatically participate in Spring-managed transaction timeouts.

Turn this flag off to get raw DataSource handling, without Spring transaction checks. Operations on Spring's SqlMapClientTemplate will still detect Spring-managed transactions, but lazy loading or direct SqlMapClient access won't.

See Also:
setDataSource(javax.sql.DataSource), TransactionAwareDataSourceProxy, DataSourceTransactionManager, SqlMapClientTemplate, SqlMapClient

setTransactionConfigClass

public void setTransactionConfigClass(Class transactionConfigClass)
Set the iBATIS TransactionConfig class to use. Default is com.ibatis.sqlmap.engine.transaction.external.ExternalTransactionConfig.

Will only get applied when using a Spring-managed DataSource. An instance of this class will get populated with the given DataSource and initialized with the given properties.

The default ExternalTransactionConfig is appropriate if there is external transaction management that the SqlMapClient should participate in: be it Spring transaction management, EJB CMT or plain JTA. This should be the typical scenario. If there is no active transaction, SqlMapClient operations will execute SQL statements non-transactionally.

JdbcTransactionConfig or JtaTransactionConfig is only necessary when using the iBATIS SqlMapTransactionManager API instead of external transactions. If there is no explicit transaction, SqlMapClient operations will automatically start a transaction for their own scope (in contrast to the external transaction mode, see above).

It is strongly recommended to use iBATIS SQL Maps with Spring transaction management (or EJB CMT). In this case, the default ExternalTransactionConfig is fine. Lazy loading and SQL Maps operations without explicit transaction demarcation will execute non-transactionally.

Even with Spring transaction management, it might be desirable to specify JdbcTransactionConfig: This will still participate in existing Spring-managed transactions, but lazy loading and operations without explicit transaction demaration will execute in their own auto-started transactions. However, this is usually not necessary.

See Also:
setDataSource(javax.sql.DataSource), setTransactionConfigProperties(java.util.Properties), TransactionConfig, ExternalTransactionConfig, com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransactionConfig, com.ibatis.sqlmap.engine.transaction.jta.JtaTransactionConfig, SqlMapTransactionManager

setTransactionConfigProperties

public void setTransactionConfigProperties(Properties transactionConfigProperties)
Set properties to be passed to the TransactionConfig instance used by this SqlMapClient. Supported properties depend on the concrete TransactionConfig implementation used:

  • ExternalTransactionConfig supports "DefaultAutoCommit" (default: false) and "SetAutoCommitAllowed" (default: true). Note that Spring uses SetAutoCommitAllowed = false as default, in contrast to the iBATIS default, to always keep the original autoCommit value as provided by the connection pool.
  • JdbcTransactionConfig does not supported any properties.
  • JtaTransactionConfig supports "UserTransaction" (no default), specifying the JNDI location of the JTA UserTransaction (usually "java:comp/UserTransaction").

See Also:
TransactionConfig.initialize(java.util.Properties), ExternalTransactionConfig, com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransactionConfig, com.ibatis.sqlmap.engine.transaction.jta.JtaTransactionConfig

setLobHandler

public void setLobHandler(LobHandler lobHandler)
Set the LobHandler to be used by the SqlMapClient. Will be exposed at config time for TypeHandler implementations.

See Also:
getConfigTimeLobHandler(), TypeHandler, ClobStringTypeHandler, BlobByteArrayTypeHandler, BlobSerializableTypeHandler

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception - in the event of misconfiguration (such as failure to set an essential property) or if initialization fails.

buildSqlMapClient

protected com.ibatis.sqlmap.client.SqlMapClient buildSqlMapClient(Resource[] configLocations,
                                                                  Resource[] mappingLocations,
                                                                  Properties properties)
                                                           throws IOException
Build a SqlMapClient instance based on the given standard configuration.

The default implementation uses the standard iBATIS SqlMapClientBuilder API to build a SqlMapClient instance based on an InputStream (if possible, on iBATIS 2.3 and higher) or on a Reader (on iBATIS up to version 2.2).

Parameters:
configLocations - the config files to load from
properties - the SqlMapClient properties (if any)
Returns:
the SqlMapClient instance (never null)
Throws:
IOException - if loading the config file failed
See Also:
SqlMapClientBuilder.buildSqlMapClient(java.io.Reader)

applyTransactionConfig

protected void applyTransactionConfig(com.ibatis.sqlmap.client.SqlMapClient sqlMapClient,
                                      com.ibatis.sqlmap.engine.transaction.TransactionConfig transactionConfig)
Apply the given iBATIS TransactionConfig to the SqlMapClient.

The default implementation casts to ExtendedSqlMapClient, retrieves the maximum number of concurrent transactions from the SqlMapExecutorDelegate, and sets an iBATIS TransactionManager with the given TransactionConfig.

Parameters:
sqlMapClient - the SqlMapClient to apply the TransactionConfig to
transactionConfig - the iBATIS TransactionConfig to apply
See Also:
ExtendedSqlMapClient, SqlMapExecutorDelegate.getMaxTransactions(), SqlMapExecutorDelegate.setTxManager(com.ibatis.sqlmap.engine.transaction.TransactionManager)

getObject

public com.ibatis.sqlmap.client.SqlMapClient getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<com.ibatis.sqlmap.client.SqlMapClient>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends com.ibatis.sqlmap.client.SqlMapClient> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<com.ibatis.sqlmap.client.SqlMapClient>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<com.ibatis.sqlmap.client.SqlMapClient>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SqlMapClientTemplate

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.orm.ibatis
Class SqlMapClientTemplate

java.lang.Object
    extended by  org.springframework.jdbc.support.JdbcAccessor
        extended by  org.springframework.orm.ibatis.SqlMapClientTemplate
All Implemented Interfaces:
InitializingBean, SqlMapClientOperations
public class SqlMapClientTemplate
extends JdbcAccessor
implements SqlMapClientOperations

Helper class that simplifies data access via the iBATIS SqlMapClient API, converting checked SQLExceptions into unchecked DataAccessExceptions, following the org.springframework.dao exception hierarchy. Uses the same SQLExceptionTranslator mechanism as JdbcTemplate.

The main method of this class executes a callback that implements a data access action. Furthermore, this class provides numerous convenience methods that mirror SqlMapExecutor's execution methods.

It is generally recommended to use the convenience methods on this template for plain query/insert/update/delete operations. However, for more complex operations like batch updates, a custom SqlMapClientCallback must be implemented, usually as anonymous inner class. For example:

 getSqlMapClientTemplate().execute(new SqlMapClientCallback() {
         public Object doInSqlMapClient(SqlMapExecutor executor) throws SQLException {
                 executor.startBatch();
                 executor.update("insertSomething", "myParamValue");
                 executor.update("insertSomethingElse", "myOtherParamValue");
                 executor.executeBatch();
                 return null;
         }
 });
The template needs a SqlMapClient to work on, passed in via the "sqlMapClient" property. A Spring context typically uses a SqlMapClientFactoryBean to build the SqlMapClient. The template an additionally be configured with a DataSource for fetching Connections, although this is not necessary if a DataSource is specified for the SqlMapClient itself (typically through SqlMapClientFactoryBean's "dataSource" property).

Since:
24.02.2004
Author:
Juergen Hoeller
See Also:
execute(org.springframework.orm.ibatis.SqlMapClientCallback),
setSqlMapClient(com.ibatis.sqlmap.client.SqlMapClient),
JdbcAccessor.setDataSource(javax.sql.DataSource),
JdbcAccessor.setExceptionTranslator(org.springframework.jdbc.support.SQLExceptionTranslator),
SqlMapClientFactoryBean.setDataSource(javax.sql.DataSource),
SqlMapTransactionManager.getDataSource(),
SqlMapExecutor

Field Summary
Fields inherited from class org.springframework.jdbc.support.JdbcAccessor
logger
Constructor Summary
SqlMapClientTemplate()
Create a new SqlMapClientTemplate.
SqlMapClientTemplate(DataSource dataSource, com.ibatis.sqlmap.client.SqlMapClient sqlMapClient)
Create a new SqlMapTemplate.
SqlMapClientTemplate(com.ibatis.sqlmap.client.SqlMapClient sqlMapClient)
Create a new SqlMapTemplate.
Method Summary
 void afterPropertiesSet()
Eagerly initialize the exception translator, if demanded, creating a default one for the specified DataSource if none set.
 int delete(String statementName)
 int delete(String statementName, Object parameterObject)
 void delete(String statementName, Object parameterObject, int requiredRowsAffected)
Convenience method provided by Spring: execute a delete operation with an automatic check that the delete affected the given required number of rows.
<T> T
execute(SqlMapClientCallback<T> action)
Execute the given data access action on a SqlMapExecutor.
 List executeWithListResult(SqlMapClientCallback<List> action)
Deprecated. as of Spring 3.0 - not really needed anymore with generic execute(org.springframework.orm.ibatis.SqlMapClientCallback) method
 Map executeWithMapResult(SqlMapClientCallback<Map> action)
Deprecated. as of Spring 3.0 - not really needed anymore with generic execute(org.springframework.orm.ibatis.SqlMapClientCallback) method
 DataSource getDataSource()
If no DataSource specified, use SqlMapClient's DataSource.
 com.ibatis.sqlmap.client.SqlMapClient getSqlMapClient()
Return the iBATIS Database Layer SqlMapClient that this template works with.
 Object insert(String statementName)
 Object insert(String statementName, Object parameterObject)
 List queryForList(String statementName)
 List queryForList(String statementName, int skipResults, int maxResults)
 List queryForList(String statementName, Object parameterObject)
 List queryForList(String statementName, Object parameterObject, int skipResults, int maxResults)
 Map queryForMap(String statementName, Object parameterObject, String keyProperty)
 Map queryForMap(String statementName, Object parameterObject, String keyProperty, String valueProperty)
 Object queryForObject(String statementName)
 Object queryForObject(String statementName, Object parameterObject)
 Object queryForObject(String statementName, Object parameterObject, Object resultObject)
 void queryWithRowHandler(String statementName, Object parameterObject, com.ibatis.sqlmap.client.event.RowHandler rowHandler)
 void queryWithRowHandler(String statementName, com.ibatis.sqlmap.client.event.RowHandler rowHandler)
 void setSqlMapClient(com.ibatis.sqlmap.client.SqlMapClient sqlMapClient)
Set the iBATIS Database Layer SqlMapClient that defines the mapped statements.
 int update(String statementName)
 int update(String statementName, Object parameterObject)
 void update(String statementName, Object parameterObject, int requiredRowsAffected)
Convenience method provided by Spring: execute an update operation with an automatic check that the update affected the given required number of rows.
Methods inherited from class org.springframework.jdbc.support.JdbcAccessor
getExceptionTranslator, isLazyInit, setDatabaseProductName, setDataSource, setExceptionTranslator, setLazyInit
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SqlMapClientTemplate

public SqlMapClientTemplate()
Create a new SqlMapClientTemplate.

SqlMapClientTemplate

public SqlMapClientTemplate(com.ibatis.sqlmap.client.SqlMapClient sqlMapClient)
Create a new SqlMapTemplate.

Parameters:
sqlMapClient - iBATIS SqlMapClient that defines the mapped statements

SqlMapClientTemplate

public SqlMapClientTemplate(DataSource dataSource,
                            com.ibatis.sqlmap.client.SqlMapClient sqlMapClient)
Create a new SqlMapTemplate.

Parameters:
dataSource - JDBC DataSource to obtain connections from
sqlMapClient - iBATIS SqlMapClient that defines the mapped statements
Method Detail

setSqlMapClient

public void setSqlMapClient(com.ibatis.sqlmap.client.SqlMapClient sqlMapClient)
Set the iBATIS Database Layer SqlMapClient that defines the mapped statements.

getSqlMapClient

public com.ibatis.sqlmap.client.SqlMapClient getSqlMapClient()
Return the iBATIS Database Layer SqlMapClient that this template works with.

getDataSource

public DataSource getDataSource()
If no DataSource specified, use SqlMapClient's DataSource.

Overrides:
getDataSource in class JdbcAccessor
See Also:
SqlMapTransactionManager.getDataSource()

afterPropertiesSet

public void afterPropertiesSet()
Description copied from class: JdbcAccessor
Eagerly initialize the exception translator, if demanded, creating a default one for the specified DataSource if none set.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class JdbcAccessor

execute

public <T> T execute(SqlMapClientCallback<T> action)
          throws DataAccessException
Execute the given data access action on a SqlMapExecutor.

Parameters:
action - callback object that specifies the data access action
Returns:
a result object returned by the action, or null
Throws:
DataAccessException - in case of SQL Maps errors

executeWithListResult

@Deprecated
public List executeWithListResult(SqlMapClientCallback<List> action)
                           throws DataAccessException
Deprecated. as of Spring 3.0 - not really needed anymore with generic execute(org.springframework.orm.ibatis.SqlMapClientCallback) method

Execute the given data access action on a SqlMapExecutor, expecting a List result.

Parameters:
action - callback object that specifies the data access action
Returns:
the List result
Throws:
DataAccessException - in case of SQL Maps errors

executeWithMapResult

@Deprecated
public Map executeWithMapResult(SqlMapClientCallback<Map> action)
                         throws DataAccessException
Deprecated. as of Spring 3.0 - not really needed anymore with generic execute(org.springframework.orm.ibatis.SqlMapClientCallback) method

Execute the given data access action on a SqlMapExecutor, expecting a Map result.

Parameters:
action - callback object that specifies the data access action
Returns:
the Map result
Throws:
DataAccessException - in case of SQL Maps errors

queryForObject

public Object queryForObject(String statementName)
                      throws DataAccessException
Specified by:
queryForObject in interface SqlMapClientOperations
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.queryForObject(String)

queryForObject

public Object queryForObject(String statementName,
                             Object parameterObject)
                      throws DataAccessException
Specified by:
queryForObject in interface SqlMapClientOperations
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.queryForObject(String, Object)

queryForObject

public Object queryForObject(String statementName,
                             Object parameterObject,
                             Object resultObject)
                      throws DataAccessException
Specified by:
queryForObject in interface SqlMapClientOperations
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.queryForObject(String, Object, Object)

queryForList

public List queryForList(String statementName)
                  throws DataAccessException
Specified by:
queryForList in interface SqlMapClientOperations
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.queryForList(String)

queryForList

public List queryForList(String statementName,
                         Object parameterObject)
                  throws DataAccessException
Specified by:
queryForList in interface SqlMapClientOperations
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.queryForList(String, Object)

queryForList

public List queryForList(String statementName,
                         int skipResults,
                         int maxResults)
                  throws DataAccessException
Specified by:
queryForList in interface SqlMapClientOperations
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.queryForList(String, int, int)

queryForList

public List queryForList(String statementName,
                         Object parameterObject,
                         int skipResults,
                         int maxResults)
                  throws DataAccessException
Specified by:
queryForList in interface SqlMapClientOperations
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.queryForList(String, Object, int, int)

queryWithRowHandler

public void queryWithRowHandler(String statementName,
                                com.ibatis.sqlmap.client.event.RowHandler rowHandler)
                         throws DataAccessException
Specified by:
queryWithRowHandler in interface SqlMapClientOperations
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.queryWithRowHandler(String, RowHandler)

queryWithRowHandler

public void queryWithRowHandler(String statementName,
                                Object parameterObject,
                                com.ibatis.sqlmap.client.event.RowHandler rowHandler)
                         throws DataAccessException
Specified by:
queryWithRowHandler in interface SqlMapClientOperations
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.queryWithRowHandler(String, Object, RowHandler)

queryForMap

public Map queryForMap(String statementName,
                       Object parameterObject,
                       String keyProperty)
                throws DataAccessException
Specified by:
queryForMap in interface SqlMapClientOperations
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.queryForMap(String, Object, String)

queryForMap

public Map queryForMap(String statementName,
                       Object parameterObject,
                       String keyProperty,
                       String valueProperty)
                throws DataAccessException
Specified by:
queryForMap in interface SqlMapClientOperations
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.queryForMap(String, Object, String, String)

insert

public Object insert(String statementName)
              throws DataAccessException
Specified by:
insert in interface SqlMapClientOperations
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.insert(String)

insert

public Object insert(String statementName,
                     Object parameterObject)
              throws DataAccessException
Specified by:
insert in interface SqlMapClientOperations
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.insert(String, Object)

update

public int update(String statementName)
           throws DataAccessException
Specified by:
update in interface SqlMapClientOperations
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.update(String)

update

public int update(String statementName,
                  Object parameterObject)
           throws DataAccessException
Specified by:
update in interface SqlMapClientOperations
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.update(String, Object)

update

public void update(String statementName,
                   Object parameterObject,
                   int requiredRowsAffected)
            throws DataAccessException
Description copied from interface: SqlMapClientOperations
Convenience method provided by Spring: execute an update operation with an automatic check that the update affected the given required number of rows.

Specified by:
update in interface SqlMapClientOperations
Parameters:
statementName - the name of the mapped statement
parameterObject - the parameter object
requiredRowsAffected - the number of rows that the update is required to affect
Throws:
DataAccessException - in case of errors

delete

public int delete(String statementName)
           throws DataAccessException
Specified by:
delete in interface SqlMapClientOperations
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.delete(String)

delete

public int delete(String statementName,
                  Object parameterObject)
           throws DataAccessException
Specified by:
delete in interface SqlMapClientOperations
Throws:
DataAccessException - in case of errors
See Also:
SqlMapExecutor.delete(String, Object)

delete

public void delete(String statementName,
                   Object parameterObject,
                   int requiredRowsAffected)
            throws DataAccessException
Description copied from interface: SqlMapClientOperations
Convenience method provided by Spring: execute a delete operation with an automatic check that the delete affected the given required number of rows.

Specified by:
delete in interface SqlMapClientOperations
Parameters:
statementName - the name of the mapped statement
parameterObject - the parameter object
requiredRowsAffected - the number of rows that the delete is required to affect
Throws:
DataAccessException - in case of errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.orm.ibatis.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.orm.ibatis.support

Classes supporting the org.springframework.orm.ibatis package.

See:
Description

Class Summary
AbstractLobTypeHandler | Abstract base class for iBATIS TypeHandler implementations that map to LOBs.
BlobByteArrayTypeHandler | iBATIS TypeHandler implementation for byte arrays that get mapped to BLOBs.
BlobSerializableTypeHandler | iBATIS TypeHandler implementation for arbitrary objects that get serialized to BLOBs.
ClobStringTypeHandler | iBATIS TypeHandler implementation for Strings that get mapped to CLOBs.
SqlMapClientDaoSupport | Convenient super class for iBATIS SqlMapClient data access objects.

Package org.springframework.orm.ibatis.support Description

Classes supporting the org.springframework.orm.ibatis package. Contains a DAO base class for SqlMapClientTemplate usage.


org.springframework.orm.ibatis.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.orm.ibatis.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • com.ibatis.sqlmap.engine.type.BaseTypeHandler (implements com.ibatis.sqlmap.engine.type.TypeHandler)
      • org.springframework.orm.ibatis.support.AbstractLobTypeHandler
        • org.springframework.orm.ibatis.support.BlobByteArrayTypeHandler
        • org.springframework.orm.ibatis.support.BlobSerializableTypeHandler
        • org.springframework.orm.ibatis.support.ClobStringTypeHandler
    • org.springframework.dao.support.DaoSupport (implements org.springframework.beans.factory.InitializingBean)
      • org.springframework.orm.ibatis.support.SqlMapClientDaoSupport


AbstractLobTypeHandler

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.orm.ibatis.support
Class AbstractLobTypeHandler

java.lang.Object
    extended by  com.ibatis.sqlmap.engine.type.BaseTypeHandler
        extended by  org.springframework.orm.ibatis.support.AbstractLobTypeHandler
All Implemented Interfaces:
com.ibatis.sqlmap.engine.type.TypeHandler
Direct Known Subclasses:
BlobByteArrayTypeHandler, BlobSerializableTypeHandler, ClobStringTypeHandler
public abstract class AbstractLobTypeHandler
extends com.ibatis.sqlmap.engine.type.BaseTypeHandler

Abstract base class for iBATIS TypeHandler implementations that map to LOBs. Retrieves the LobHandler to use from SqlMapClientFactoryBean at config time.

For writing LOBs, an active Spring transaction synchronization is required, to be able to register a synchronization that closes the LobCreator.

Offers template methods for setting parameters and getting result values, passing in the LobHandler or LobCreator to use.

Since:
1.1.5
Author:
Juergen Hoeller
See Also:
LobHandler, LobCreator, SqlMapClientFactoryBean.setLobHandler(org.springframework.jdbc.support.lob.LobHandler)

Field Summary
static int LOB_CREATOR_SYNCHRONIZATION_ORDER
Order value for TransactionSynchronization objects that clean up LobCreators.
Constructor Summary
 | AbstractLobTypeHandler() Constructor used by iBATIS: fetches config-time LobHandler from SqlMapClientFactoryBean.
protected | AbstractLobTypeHandler(LobHandler lobHandler) Constructor used for testing: takes an explicit LobHandler.
Method Summary
Object | getResult(CallableStatement cs, int columnIndex) This implementation always throws a SQLException: retrieving LOBs from a CallableStatement is not supported.
Object | getResult(ResultSet rs, int columnIndex) This implementation delegates to getResultInternal, passing in the LobHandler of this type.
Object | getResult(ResultSet rs, String columnName) This implementation delegates to the getResult version that takes a column index.
protected abstract Object | getResultInternal(ResultSet rs, int index, LobHandler lobHandler) Template method to extract a value from the given result set.
void | setParameter(PreparedStatement ps, int i, Object parameter, String jdbcType) This implementation delegates to setParameterInternal, passing in a transaction-synchronized LobCreator for the LobHandler of this type.
protected abstract void | setParameterInternal(PreparedStatement ps, int index, Object value, String jdbcType, LobCreator lobCreator) Template method to set the given value on the given statement.
Methods inherited from class com.ibatis.sqlmap.engine.type.BaseTypeHandler
equals
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.ibatis.sqlmap.engine.type.TypeHandler
valueOf

Field Detail

LOB_CREATOR_SYNCHRONIZATION_ORDER

public static final int LOB_CREATOR_SYNCHRONIZATION_ORDER
Order value for TransactionSynchronization objects that clean up LobCreators. Return DataSourceUtils.#CONNECTION_SYNCHRONIZATION_ORDER - 100 to execute LobCreator cleanup before JDBC Connection cleanup, if any.

See Also:
DataSourceUtils.CONNECTION_SYNCHRONIZATION_ORDER, Constant Field Values
Constructor Detail

AbstractLobTypeHandler

public AbstractLobTypeHandler()
Constructor used by iBATIS: fetches config-time LobHandler from SqlMapClientFactoryBean.

See Also:
SqlMapClientFactoryBean.getConfigTimeLobHandler()

AbstractLobTypeHandler

protected AbstractLobTypeHandler(LobHandler lobHandler)
Constructor used for testing: takes an explicit LobHandler.

Method Detail

setParameter

public final void setParameter(PreparedStatement ps,
                               int i,
                               Object parameter,
                               String jdbcType)
                        throws SQLException
This implementation delegates to setParameterInternal, passing in a transaction-synchronized LobCreator for the LobHandler of this type.

Throws:
SQLException
See Also:
setParameterInternal(java.sql.PreparedStatement, int, java.lang.Object, java.lang.String, org.springframework.jdbc.support.lob.LobCreator)

getResult

public final Object getResult(ResultSet rs,
                              String columnName)
                       throws SQLException
This implementation delegates to the getResult version that takes a column index.

Throws:
SQLException
See Also:
getResult(java.sql.ResultSet, String), ResultSet.findColumn(java.lang.String)

getResult

public final Object getResult(ResultSet rs,
                              int columnIndex)
                       throws SQLException
This implementation delegates to getResultInternal, passing in the LobHandler of this type.

Throws:
SQLException
See Also:
getResultInternal(java.sql.ResultSet, int, org.springframework.jdbc.support.lob.LobHandler)

getResult

public Object getResult(CallableStatement cs,
                        int columnIndex)
                 throws SQLException
This implementation always throws a SQLException: retrieving LOBs from a CallableStatement is not supported.

Throws:
SQLException

setParameterInternal

protected abstract void setParameterInternal(PreparedStatement ps,
                                             int index,
                                             Object value,
                                             String jdbcType,
                                             LobCreator lobCreator)
                                      throws SQLException,
                                             IOException
Template method to set the given value on the given statement.

Parameters:
ps - the PreparedStatement to set on
index - the statement parameter index
value - the parameter value to set
jdbcType - the JDBC type of the parameter
lobCreator - the LobCreator to use
Throws:
SQLException - if thrown by JDBC methods
IOException - if thrown by streaming methods

getResultInternal

protected abstract Object getResultInternal(ResultSet rs,
                                            int index,
                                            LobHandler lobHandler)
                                     throws SQLException,
                                            IOException
Template method to extract a value from the given result set.

Parameters:
rs - the ResultSet to extract from
index - the index in the ResultSet
lobHandler - the LobHandler to use
Returns:
the extracted value
Throws:
SQLException - if thrown by JDBC methods
IOException - if thrown by streaming methods
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


BlobByteArrayTypeHandler

org.springframework.orm.ibatis.support
Class BlobByteArrayTypeHandler

java.lang.Object
    extended by  com.ibatis.sqlmap.engine.type.BaseTypeHandler
        extended by  org.springframework.orm.ibatis.support.AbstractLobTypeHandler
            extended by  org.springframework.orm.ibatis.support.BlobByteArrayTypeHandler
All Implemented Interfaces:
com.ibatis.sqlmap.engine.type.TypeHandler
public class BlobByteArrayTypeHandler
extends AbstractLobTypeHandler

iBATIS TypeHandler implementation for byte arrays that get mapped to BLOBs. Retrieves the LobHandler to use from SqlMapClientFactoryBean at config time.

Can also be defined in generic iBATIS mappings, as DefaultLobCreator will work with most JDBC-compliant database drivers. In this case, the field type does not have to be BLOB: For databases like MySQL and MS SQL Server, any large enough binary type will work.

Since:
1.1.5
Author:
Juergen Hoeller
See Also:
SqlMapClientFactoryBean.setLobHandler(org.springframework.jdbc.support.lob.LobHandler)

Field Summary
Fields inherited from class org.springframework.orm.ibatis.support.AbstractLobTypeHandler
LOB_CREATOR_SYNCHRONIZATION_ORDER
Constructor Summary
 | BlobByteArrayTypeHandler() Constructor used by iBATIS: fetches config-time LobHandler from SqlMapClientFactoryBean.
protected | BlobByteArrayTypeHandler(LobHandler lobHandler) Constructor used for testing: takes an explicit LobHandler.
Method Summary
protected Object | getResultInternal(ResultSet rs, int index, LobHandler lobHandler) Template method to extract a value from the given result set.
protected void | setParameterInternal(PreparedStatement ps, int index, Object value, String jdbcType, LobCreator lobCreator) Template method to set the given value on the given statement.
Object | valueOf(String s)
Methods inherited from class org.springframework.orm.ibatis.support.AbstractLobTypeHandler
getResult, getResult, getResult, setParameter
Methods inherited from class com.ibatis.sqlmap.engine.type.BaseTypeHandler
equals
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BlobByteArrayTypeHandler

public BlobByteArrayTypeHandler()
Constructor used by iBATIS: fetches config-time LobHandler from SqlMapClientFactoryBean.

See Also:
SqlMapClientFactoryBean.getConfigTimeLobHandler()

BlobByteArrayTypeHandler

protected BlobByteArrayTypeHandler(LobHandler lobHandler)
Constructor used for testing: takes an explicit LobHandler.

Method Detail

setParameterInternal

protected void setParameterInternal(PreparedStatement ps,
                                    int index,
                                    Object value,
                                    String jdbcType,
                                    LobCreator lobCreator)
                             throws SQLException
Description copied from class: AbstractLobTypeHandler
Template method to set the given value on the given statement.

Specified by:
setParameterInternal in class AbstractLobTypeHandler
Parameters:
ps - the PreparedStatement to set on
index - the statement parameter index
value - the parameter value to set
jdbcType - the JDBC type of the parameter
lobCreator - the LobCreator to use
Throws:
SQLException - if thrown by JDBC methods

getResultInternal

protected Object getResultInternal(ResultSet rs,
                                   int index,
                                   LobHandler lobHandler)
                            throws SQLException
Description copied from class: AbstractLobTypeHandler
Template method to extract a value from the given result set.

Specified by:
getResultInternal in class AbstractLobTypeHandler
Parameters:
rs - the ResultSet to extract from
index - the index in the ResultSet
lobHandler - the LobHandler to use
Returns:
the extracted value
Throws:
SQLException - if thrown by JDBC methods

valueOf

public Object valueOf(String s)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BlobSerializableTypeHandler

org.springframework.orm.ibatis.support
Class BlobSerializableTypeHandler

java.lang.Object
    extended by  com.ibatis.sqlmap.engine.type.BaseTypeHandler
        extended by  org.springframework.orm.ibatis.support.AbstractLobTypeHandler
            extended by  org.springframework.orm.ibatis.support.BlobSerializableTypeHandler
All Implemented Interfaces:
com.ibatis.sqlmap.engine.type.TypeHandler
public class BlobSerializableTypeHandler
extends AbstractLobTypeHandler

iBATIS TypeHandler implementation for arbitrary objects that get serialized to BLOBs. Retrieves the LobHandler to use from SqlMapClientFactoryBean at config time.

Can also be defined in generic iBATIS mappings, as DefaultLobCreator will work with most JDBC-compliant database drivers. In this case, the field type does not have to be BLOB: For databases like MySQL and MS SQL Server, any large enough binary type will work.

Since:
1.1.5
Author:
Juergen Hoeller
See Also:
SqlMapClientFactoryBean.setLobHandler(org.springframework.jdbc.support.lob.LobHandler)

Field Summary
Fields inherited from class org.springframework.orm.ibatis.support.AbstractLobTypeHandler
LOB_CREATOR_SYNCHRONIZATION_ORDER
Constructor Summary
 | BlobSerializableTypeHandler() Constructor used by iBATIS: fetches config-time LobHandler from SqlMapClientFactoryBean.
protected | BlobSerializableTypeHandler(LobHandler lobHandler) Constructor used for testing: takes an explicit LobHandler.
Method Summary
protected Object | getResultInternal(ResultSet rs, int index, LobHandler lobHandler) Template method to extract a value from the given result set.
protected void | setParameterInternal(PreparedStatement ps, int index, Object value, String jdbcType, LobCreator lobCreator) Template method to set the given value on the given statement.
Object | valueOf(String s)
Methods inherited from class org.springframework.orm.ibatis.support.AbstractLobTypeHandler
getResult, getResult, getResult, setParameter
Methods inherited from class com.ibatis.sqlmap.engine.type.BaseTypeHandler
equals
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BlobSerializableTypeHandler

public BlobSerializableTypeHandler()
Constructor used by iBATIS: fetches config-time LobHandler from SqlMapClientFactoryBean.

See Also:
SqlMapClientFactoryBean.getConfigTimeLobHandler()

BlobSerializableTypeHandler

protected BlobSerializableTypeHandler(LobHandler lobHandler)
Constructor used for testing: takes an explicit LobHandler.

Method Detail

setParameterInternal

protected void setParameterInternal(PreparedStatement ps,
                                    int index,
                                    Object value,
                                    String jdbcType,
                                    LobCreator lobCreator)
                             throws SQLException,
                                    IOException
Description copied from class: AbstractLobTypeHandler
Template method to set the given value on the given statement.

Specified by:
setParameterInternal in class AbstractLobTypeHandler
Parameters:
ps - the PreparedStatement to set on
index - the statement parameter index
value - the parameter value to set
jdbcType - the JDBC type of the parameter
lobCreator - the LobCreator to use
Throws:
SQLException - if thrown by JDBC methods
IOException - if thrown by streaming methods

getResultInternal

protected Object getResultInternal(ResultSet rs,
                                   int index,
                                   LobHandler lobHandler)
                            throws SQLException,
                                   IOException
Description copied from class: AbstractLobTypeHandler
Template method to extract a value from the given result set.

Specified by:
getResultInternal in class AbstractLobTypeHandler
Parameters:
rs - the ResultSet to extract from
index - the index in the ResultSet
lobHandler - the LobHandler to use
Returns:
the extracted value
Throws:
SQLException - if thrown by JDBC methods
IOException - if thrown by streaming methods

valueOf

public Object valueOf(String s)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ClobStringTypeHandler

org.springframework.orm.ibatis.support
Class ClobStringTypeHandler

java.lang.Object
    extended by  com.ibatis.sqlmap.engine.type.BaseTypeHandler
        extended by  org.springframework.orm.ibatis.support.AbstractLobTypeHandler
            extended by  org.springframework.orm.ibatis.support.ClobStringTypeHandler
All Implemented Interfaces:
com.ibatis.sqlmap.engine.type.TypeHandler
public class ClobStringTypeHandler
extends AbstractLobTypeHandler

iBATIS TypeHandler implementation for Strings that get mapped to CLOBs. Retrieves the LobHandler to use from SqlMapClientFactoryBean at config time.

Particularly useful for storing Strings with more than 4000 characters in an Oracle database (only possible via CLOBs), in combination with OracleLobHandler.

Can also be defined in generic iBATIS mappings, as DefaultLobCreator will work with most JDBC-compliant database drivers. In this case, the field type does not have to be BLOB: For databases like MySQL and MS SQL Server, any large enough binary type will work.

Since:
1.1.5
Author:
Juergen Hoeller
See Also:
SqlMapClientFactoryBean.setLobHandler(org.springframework.jdbc.support.lob.LobHandler)

Field Summary
Fields inherited from class org.springframework.orm.ibatis.support.AbstractLobTypeHandler
LOB_CREATOR_SYNCHRONIZATION_ORDER
Constructor Summary
 | ClobStringTypeHandler() Constructor used by iBATIS: fetches config-time LobHandler from SqlMapClientFactoryBean.
protected | ClobStringTypeHandler(LobHandler lobHandler) Constructor used for testing: takes an explicit LobHandler.
Method Summary
protected Object | getResultInternal(ResultSet rs, int index, LobHandler lobHandler) Template method to extract a value from the given result set.
protected void | setParameterInternal(PreparedStatement ps, int index, Object value, String jdbcType, LobCreator lobCreator) Template method to set the given value on the given statement.
Object | valueOf(String s)
Methods inherited from class org.springframework.orm.ibatis.support.AbstractLobTypeHandler
getResult, getResult, getResult, setParameter
Methods inherited from class com.ibatis.sqlmap.engine.type.BaseTypeHandler
equals
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ClobStringTypeHandler

public ClobStringTypeHandler()
Constructor used by iBATIS: fetches config-time LobHandler from SqlMapClientFactoryBean.

See Also:
SqlMapClientFactoryBean.getConfigTimeLobHandler()

ClobStringTypeHandler

protected ClobStringTypeHandler(LobHandler lobHandler)
Constructor used for testing: takes an explicit LobHandler.

Method Detail

setParameterInternal

protected void setParameterInternal(PreparedStatement ps,
                                    int index,
                                    Object value,
                                    String jdbcType,
                                    LobCreator lobCreator)
                             throws SQLException
Description copied from class: AbstractLobTypeHandler
Template method to set the given value on the given statement.

Specified by:
setParameterInternal in class AbstractLobTypeHandler
Parameters:
ps - the PreparedStatement to set on
index - the statement parameter index
value - the parameter value to set
jdbcType - the JDBC type of the parameter
lobCreator - the LobCreator to use
Throws:
SQLException - if thrown by JDBC methods

getResultInternal

protected Object getResultInternal(ResultSet rs,
                                   int index,
                                   LobHandler lobHandler)
                            throws SQLException
Description copied from class: AbstractLobTypeHandler
Template method to extract a value from the given result set.

Specified by:
getResultInternal in class AbstractLobTypeHandler
Parameters:
rs - the ResultSet to extract from
index - the index in the ResultSet
lobHandler - the LobHandler to use
Returns:
the extracted value
Throws:
SQLException - if thrown by JDBC methods

valueOf

public Object valueOf(String s)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SqlMapClientDaoSupport

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.orm.ibatis.support
Class SqlMapClientDaoSupport

java.lang.Object
    extended by  org.springframework.dao.support.DaoSupport
        extended by  org.springframework.orm.ibatis.support.SqlMapClientDaoSupport
All Implemented Interfaces:
InitializingBean
public abstract class SqlMapClientDaoSupport
extends DaoSupport

Convenient super class for iBATIS SqlMapClient data access objects. Requires a SqlMapClient to be set, providing a SqlMapClientTemplate based on it to subclasses.

Instead of a plain SqlMapClient, you can also pass a preconfigured SqlMapClientTemplate instance in. This allows you to share your SqlMapClientTemplate configuration for all your DAOs, for example a custom SQLExceptionTranslator to use.

Since:
24.02.2004
Author:
Juergen Hoeller
See Also:
setSqlMapClient(com.ibatis.sqlmap.client.SqlMapClient), setSqlMapClientTemplate(org.springframework.orm.ibatis.SqlMapClientTemplate), SqlMapClientTemplate, JdbcAccessor.setExceptionTranslator(org.springframework.jdbc.support.SQLExceptionTranslator)

Field Summary
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
Constructor Summary
SqlMapClientDaoSupport()
Method Summary
protected void | checkDaoConfig() Abstract subclasses must override this to check their configuration.
DataSource | getDataSource() Return the JDBC DataSource used by this DAO.
com.ibatis.sqlmap.client.SqlMapClient | getSqlMapClient() Return the iBATIS Database Layer SqlMapClient that this template works with.
SqlMapClientTemplate | getSqlMapClientTemplate() Return the SqlMapClientTemplate for this DAO, pre-initialized with the SqlMapClient or set explicitly.
void | setDataSource(DataSource dataSource) Set the JDBC DataSource to be used by this DAO.
void | setSqlMapClient(com.ibatis.sqlmap.client.SqlMapClient sqlMapClient) Set the iBATIS Database Layer SqlMapClient to work with.
void | setSqlMapClientTemplate(SqlMapClientTemplate sqlMapClientTemplate) Set the SqlMapClientTemplate for this DAO explicitly, as an alternative to specifying a SqlMapClient.
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SqlMapClientDaoSupport

public SqlMapClientDaoSupport()
Method Detail

setDataSource

public final void setDataSource(DataSource dataSource)
Set the JDBC DataSource to be used by this DAO. Not required: The SqlMapClient might carry a shared DataSource.

See Also:
setSqlMapClient(com.ibatis.sqlmap.client.SqlMapClient)

getDataSource

public final DataSource getDataSource()
Return the JDBC DataSource used by this DAO.

setSqlMapClient

public final void setSqlMapClient(com.ibatis.sqlmap.client.SqlMapClient sqlMapClient)
Set the iBATIS Database Layer SqlMapClient to work with. Either this or a "sqlMapClientTemplate" is required.

See Also:
setSqlMapClientTemplate(org.springframework.orm.ibatis.SqlMapClientTemplate)

getSqlMapClient

public final com.ibatis.sqlmap.client.SqlMapClient getSqlMapClient()
Return the iBATIS Database Layer SqlMapClient that this template works with.

setSqlMapClientTemplate

public final void setSqlMapClientTemplate(SqlMapClientTemplate sqlMapClientTemplate)
Set the SqlMapClientTemplate for this DAO explicitly, as an alternative to specifying a SqlMapClient.

See Also:
setSqlMapClient(com.ibatis.sqlmap.client.SqlMapClient)

getSqlMapClientTemplate

public final SqlMapClientTemplate getSqlMapClientTemplate()
Return the SqlMapClientTemplate for this DAO, pre-initialized with the SqlMapClient or set explicitly.

checkDaoConfig

protected final void checkDaoConfig()
Description copied from class: DaoSupport
Abstract subclasses must override this to check their configuration.

Implementors should be marked as final

Specified by:
checkDaoConfig in class DaoSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.orm.jdo

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.orm.jdo

Package providing integration of JDO (Java Date Objects) with Spring concepts.

See:
Description

Interface Summary
JdoCallback<T> | Callback interface for JDO code.
JdoDialect | SPI strategy that allows for customizing integration with a specific JDO provider, in particular regarding transaction management and exception translation.
JdoOperations | Interface that specifies a basic set of JDO operations, implemented by JdoTemplate.

Class Summary
DefaultJdoDialect | Default implementation of the JdoDialect interface.
JdoAccessor | Base class for JdoTemplate and JdoInterceptor, defining common properties such as PersistenceManagerFactory and flushing behavior.
JdoInterceptor | This interceptor binds a new JDO PersistenceManager to the thread before a method call, closing and removing it afterwards in case of any method outcome.
JdoTemplate | Helper class that simplifies JDO data access code, and converts JDOExceptions into Spring DataAccessExceptions, following the org.springframework.dao exception hierarchy.
JdoTransactionManager | PlatformTransactionManager implementation for a single JDO PersistenceManagerFactory.
LocalPersistenceManagerFactoryBean | FactoryBean that creates a JDO PersistenceManagerFactory.
PersistenceManagerFactoryUtils | Helper class featuring methods for JDO PersistenceManager handling, allowing for reuse of PersistenceManager instances within transactions.
PersistenceManagerHolder | Holder wrapping a JDO PersistenceManager.
TransactionAwarePersistenceManagerFactoryProxy | Proxy for a target JDO PersistenceManagerFactory, returning the current thread-bound PersistenceManager (the Spring-managed transactional PersistenceManager or the single OpenPersistenceManagerInView PersistenceManager) on getPersistenceManager(), if any.

Exception Summary
JdoObjectRetrievalFailureException | JDO-specific subclass of ObjectRetrievalFailureException.
JdoOptimisticLockingFailureException | JDO-specific subclass of ObjectOptimisticLockingFailureException.
JdoResourceFailureException | JDO-specific subclass of DataAccessResourceFailureException.
JdoSystemException | JDO-specific subclass of UncategorizedDataAccessException, for JDO system errors that do not match any concrete org.springframework.dao exceptions.
JdoUsageException | JDO-specific subclass of InvalidDataAccessApiUsageException.

Package org.springframework.orm.jdo Description

Package providing integration of JDO (Java Date Objects) with Spring concepts. Contains PersistenceManagerFactory helper classes, a template plus callback for JDO access, and an implementation of Spring's transaction SPI for local JDO transactions.


org.springframework.orm.jdo Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.orm.jdo

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.transaction.support.AbstractPlatformTransactionManager (implements org.springframework.transaction.PlatformTransactionManager, java.io.Serializable)
      • org.springframework.orm.jdo.JdoTransactionManager (implements org.springframework.beans.factory.InitializingBean, org.springframework.transaction.support.ResourceTransactionManager)
    • org.springframework.orm.jdo.DefaultJdoDialect (implements org.springframework.orm.jdo.JdoDialect, org.springframework.dao.support.PersistenceExceptionTranslator)
    • org.springframework.orm.jdo.JdoAccessor (implements org.springframework.beans.factory.InitializingBean)
      • org.springframework.orm.jdo.JdoInterceptor (implements org.aopalliance.intercept.MethodInterceptor)
      • org.springframework.orm.jdo.JdoTemplate (implements org.springframework.orm.jdo.JdoOperations)
    • org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean, org.springframework.dao.support.PersistenceExceptionTranslator)
    • org.springframework.orm.jdo.PersistenceManagerFactoryUtils
    • org.springframework.transaction.support.ResourceHolderSupport (implements org.springframework.transaction.support.ResourceHolder)
      • org.springframework.orm.jdo.PersistenceManagerHolder
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.dao.DataAccessException
              • org.springframework.dao.NonTransientDataAccessException
                • org.springframework.dao.DataRetrievalFailureException
                  • org.springframework.orm.ObjectRetrievalFailureException
                    • org.springframework.orm.jdo.JdoObjectRetrievalFailureException
                • org.springframework.dao.InvalidDataAccessApiUsageException
                  • org.springframework.orm.jdo.JdoUsageException
                • org.springframework.dao.NonTransientDataAccessResourceException
                  • org.springframework.dao.DataAccessResourceFailureException
                    • org.springframework.orm.jdo.JdoResourceFailureException
                • org.springframework.dao.UncategorizedDataAccessException
                  • org.springframework.orm.jdo.JdoSystemException
              • org.springframework.dao.TransientDataAccessException
                • org.springframework.dao.ConcurrencyFailureException
                  • org.springframework.dao.OptimisticLockingFailureException
                    • org.springframework.orm.ObjectOptimisticLockingFailureException
                      • org.springframework.orm.jdo.JdoOptimisticLockingFailureException
    • org.springframework.orm.jdo.TransactionAwarePersistenceManagerFactoryProxy (implements org.springframework.beans.factory.FactoryBean<T>)

Interface Hierarchy

  • org.springframework.orm.jdo.JdoCallback<T>
  • org.springframework.orm.jdo.JdoDialect
  • org.springframework.orm.jdo.JdoOperations


JdoCallback

org.springframework.orm.jdo
Interface JdoCallback<T>

public interface JdoCallback<T>

Callback interface for JDO code. To be used with JdoTemplate's execution methods, often as anonymous classes within a method implementation. A typical implementation will call PersistenceManager CRUD to perform some operations on persistent objects.

Note that JDO works on bytecode-modified Java objects, to be able to perform dirty detection on each modification of a persistent instance field. In contrast to Hibernate, using returned objects outside of an active PersistenceManager poses a problem: To be able to read and modify fields e.g. in a web GUI, one has to explicitly make the instances "transient". Reassociation with a new PersistenceManager, e.g. for updates when coming back from the GUI, isn't possible, as the JDO instances have lost their identity when turned transient. This means that either value objects have to be used as parameters, or the contents of the outside-modified instance have to be copied to a freshly loaded active instance on reassociation.

Since:
03.06.2003
Author:
Juergen Hoeller
See Also:
JdoTemplate, JdoTransactionManager

Method Summary
 T doInJdo(javax.jdo.PersistenceManager pm)
Gets called by JdoTemplate.execute with an active JDO PersistenceManager.

Method Detail

doInJdo

T doInJdo(javax.jdo.PersistenceManager pm)
          throws javax.jdo.JDOException
Gets called by JdoTemplate.execute with an active JDO PersistenceManager. Does not need to care about activating or closing the PersistenceManager, or handling transactions.

Note that JDO callback code will not flush any modifications to the database if not executed within a transaction. Thus, you need to make sure that JdoTransactionManager has initiated a JDO transaction when the callback gets called, at least if you want to write to the database.

Allows for returning a result object created within the callback, i.e. a domain object or a collection of domain objects. A thrown custom RuntimeException is treated as an application exception: It gets propagated to the caller of the template.

Parameters:
pm - active PersistenceManager
Returns:
a result object, or null if none
Throws:
javax.jdo.JDOException - if thrown by the JDO API
See Also:
JdoTemplate.execute(org.springframework.orm.jdo.JdoCallback), JdoTemplate.executeFind(org.springframework.orm.jdo.JdoCallback)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JdoDialect

org.springframework.orm.jdo
Interface JdoDialect

All Known Implementing Classes:
DefaultJdoDialect
public interface JdoDialect

SPI strategy that allows for customizing integration with a specific JDO provider, in particular regarding transaction management and exception translation. To be implemented for specific JDO providers such as JPOX, Kodo, Lido, Versant Open Access.

JDO 2.0 defines standard ways for most of the functionality covered here. Hence, Spring's DefaultJdoDialect uses the corresponding JDO 2.0 methods by default, to be overridden in a vendor-specific fashion if necessary. Vendor-specific subclasses of DefaultJdoDialect are still required for special transaction semantics and more sophisticated exception translation (if needed).

In general, it is recommended to derive from DefaultJdoDialect instead of implementing this interface directly. This allows for inheriting common behavior (present and future) from DefaultJdoDialect, only overriding specific hooks to plug in concrete vendor-specific behavior.

Since:
02.11.2003
Author:
Juergen Hoeller
See Also:
JdoTransactionManager.setJdoDialect(org.springframework.orm.jdo.JdoDialect), JdoAccessor.setJdoDialect(org.springframework.orm.jdo.JdoDialect), DefaultJdoDialect

Method Summary
void | applyQueryTimeout(javax.jdo.Query query, int timeout) Apply the given timeout to the given JDO query object.
Object | beginTransaction(javax.jdo.Transaction transaction, TransactionDefinition definition) Begin the given JDO transaction, applying the semantics specified by the given Spring transaction definition (in particular, an isolation level and a timeout).
void | cleanupTransaction(Object transactionData) Clean up the transaction via the given transaction data.
ConnectionHandle | getJdbcConnection(javax.jdo.PersistenceManager pm, boolean readOnly) Retrieve the JDBC Connection that the given JDO PersistenceManager uses underneath, if accessing a relational database.
void | releaseJdbcConnection(ConnectionHandle conHandle, javax.jdo.PersistenceManager pm) Release the given JDBC Connection, which has originally been retrieved via getJdbcConnection.
DataAccessException | translateException(javax.jdo.JDOException ex) Translate the given JDOException to a corresponding exception from Spring's generic DataAccessException hierarchy.

Method Detail

beginTransaction

Object beginTransaction(javax.jdo.Transaction transaction,
                        TransactionDefinition definition)
                        throws javax.jdo.JDOException,
                               SQLException,
                               TransactionException
Begin the given JDO transaction, applying the semantics specified by the given Spring transaction definition (in particular, an isolation level and a timeout). Invoked by JdoTransactionManager on transaction begin.

An implementation can configure the JDO Transaction object and then invoke begin, or invoke a special begin method that takes, for example, an isolation level.

An implementation can also apply read-only flag and isolation level to the underlying JDBC Connection before beginning the transaction. In that case, a transaction data object can be returned that holds the previous isolation level (and possibly other data), to be reset in cleanupTransaction.

Implementations can also use the Spring transaction name, as exposed by the passed-in TransactionDefinition, to optimize for specific data access use cases (effectively using the current transaction name as use case identifier).

Parameters:
transaction - the JDO transaction to begin
definition - the Spring transaction definition that defines semantics
Returns:
an arbitrary object that holds transaction data, if any (to be passed into cleanupTransaction)
Throws:
javax.jdo.JDOException - if thrown by JDO methods
SQLException - if thrown by JDBC methods
TransactionException - in case of invalid arguments
See Also:
cleanupTransaction(java.lang.Object),
Transaction.begin(),
DataSourceUtils.prepareConnectionForTransaction(java.sql.Connection, org.springframework.transaction.TransactionDefinition)

cleanupTransaction

void cleanupTransaction(Object transactionData)
Clean up the transaction via the given transaction data. Invoked by JdoTransactionManager on transaction cleanup.

An implementation can, for example, reset read-only flag and isolation level of the underlying JDBC Connection. Furthermore, an exposed data access use case can be reset here.

Parameters:
transactionData - arbitrary object that holds transaction data, if any (as returned by beginTransaction)
See Also:
beginTransaction(javax.jdo.Transaction, org.springframework.transaction.TransactionDefinition), DataSourceUtils.resetConnectionAfterTransaction(java.sql.Connection, java.lang.Integer)

getJdbcConnection

ConnectionHandle getJdbcConnection(javax.jdo.PersistenceManager pm,
                                   boolean readOnly)
                                   throws javax.jdo.JDOException,
                                          SQLException
Retrieve the JDBC Connection that the given JDO PersistenceManager uses underneath, if accessing a relational database. This method will just get invoked if actually needing access to the underlying JDBC Connection, usually within an active JDO transaction (for example, by JdoTransactionManager). The returned handle will be passed into the releaseJdbcConnection method when not needed anymore.

Implementations are encouraged to return an unwrapped Connection object, i.e. the Connection as they got it from the connection pool. This makes it easier for application code to get at the underlying native JDBC Connection, like an OracleConnection, which is sometimes necessary for LOB handling etc. We assume that calling code knows how to properly handle the returned Connection object.

In a simple case where the returned Connection will be auto-closed with the PersistenceManager or can be released via the Connection object itself, an implementation can return a SimpleConnectionHandle that just contains the Connection. If some other object is needed in releaseJdbcConnection, an implementation should use a special handle that references that other object.

Parameters:
pm - the current JDO PersistenceManager
readOnly - whether the Connection is only needed for read-only purposes
Returns:
a handle for the JDBC Connection, to be passed into releaseJdbcConnection, or null if no JDBC Connection can be retrieved
Throws:
javax.jdo.JDOException - if thrown by JDO methods
SQLException - if thrown by JDBC methods
See Also:
releaseJdbcConnection(org.springframework.jdbc.datasource.ConnectionHandle, javax.jdo.PersistenceManager), ConnectionHandle.getConnection(), SimpleConnectionHandle, JdoTransactionManager.setDataSource(javax.sql.DataSource), NativeJdbcExtractor

releaseJdbcConnection

void releaseJdbcConnection(ConnectionHandle conHandle,
                           javax.jdo.PersistenceManager pm)
                           throws javax.jdo.JDOException,
                                  SQLException
Release the given JDBC Connection, which has originally been retrieved via getJdbcConnection. This should be invoked in any case, to allow for proper release of the retrieved Connection handle.

An implementation might simply do nothing, if the Connection returned by getJdbcConnection will be implicitly closed when the JDO transaction completes or when the PersistenceManager is closed.

Parameters:
conHandle - the JDBC Connection handle to release
pm - the current JDO PersistenceManager
Throws:
javax.jdo.JDOException - if thrown by JDO methods
SQLException - if thrown by JDBC methods
See Also:
getJdbcConnection(javax.jdo.PersistenceManager, boolean)

applyQueryTimeout

void applyQueryTimeout(javax.jdo.Query query,
                       int timeout)
                       throws javax.jdo.JDOException
Apply the given timeout to the given JDO query object.

Invoked with the remaining time of a specified transaction timeout, if any.

Parameters:
query - the JDO query object to apply the timeout to
timeout - the timeout value (seconds) to apply
Throws:
javax.jdo.JDOException - if thrown by JDO methods
See Also:
JdoTemplate.prepareQuery(javax.jdo.Query)

translateException

DataAccessException translateException(javax.jdo.JDOException ex)
Translate the given JDOException to a corresponding exception from Spring's generic DataAccessException hierarchy. An implementation should apply PersistenceManagerFactoryUtils' standard exception translation if can't do anything more specific.

Of particular importance is the correct translation to DataIntegrityViolationException, for example on constraint violation. Unfortunately, standard JDO does not allow for portable detection of this.

Can use a SQLExceptionTranslator for translating underlying SQLExceptions in a database-specific fashion.

Parameters:
ex - the JDOException thrown
Returns:
the corresponding DataAccessException (must not be null)
See Also:
JdoAccessor.convertJdoAccessException(javax.jdo.JDOException),
JdoTransactionManager.convertJdoAccessException(javax.jdo.JDOException),
PersistenceManagerFactoryUtils.convertJdoAccessException(javax.jdo.JDOException),
DataIntegrityViolationException,
SQLExceptionTranslator
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JdoOperations

org.springframework.orm.jdo
Interface JdoOperations

All Known Implementing Classes:
JdoTemplate
public interface JdoOperations

Interface that specifies a basic set of JDO operations, implemented by JdoTemplate. Not often used, but a useful option to enhance testability, as it can easily be mocked or stubbed.

Defines JdoTemplate's data access methods that mirror various JDO PersistenceManager methods. Users are strongly encouraged to read the JDO PersistenceManager javadocs for details on the semantics of those methods.

Note that lazy loading will just work with an open JDO PersistenceManager, either within a managed transaction or within OpenPersistenceManagerInViewFilter/ OpenPersistenceManagerInViewInterceptor. Furthermore, some operations just make sense within transactions, for example: evict, evictAll, flush.

Updated to build on JDO 2.0 or higher, as of Spring 2.5.

Since:
1.1
Author:
Juergen Hoeller
See Also:
JdoTemplate, PersistenceManager, JdoTransactionManager, JdoDialect, OpenPersistenceManagerInViewFilter, OpenPersistenceManagerInViewInterceptor

Method Summary
 void deletePersistent(Object entity)
Delete the given persistent instance.
 void deletePersistentAll(Collection entities)
Delete all given persistent instances.
<T> T
detachCopy(T entity)
Detach a copy of the given persistent instance from the current JDO transaction, for use outside a JDO transaction (for example, as web form object).
<T> Collection<T>
detachCopyAll(Collection<T> entities)
Detach copies of the given persistent instances from the current JDO transaction, for use outside a JDO transaction (for example, as web form objects).
 void evict(Object entity)
Remove the given object from the PersistenceManager cache.
 void evictAll()
Remove all objects from the PersistenceManager cache.
 void evictAll(Collection entities)
Remove all given objects from the PersistenceManager cache.
<T> T
execute(JdoCallback<T> action)
Execute the action specified by the given action object within a PersistenceManager.
 Collection executeFind(JdoCallback<?> action)
Execute the specified action assuming that the result object is a Collection.
<T> Collection<T>
find(Class<T> entityClass)
Find all persistent instances of the given class.
<T> Collection<T>
find(Class<T> entityClass, String filter)
Find all persistent instances of the given class that match the given JDOQL filter.
<T> Collection<T>
find(Class<T> entityClass, String filter, String ordering)
Find all persistent instances of the given class that match the given JDOQL filter, with the given result ordering.
<T> Collection<T>
find(Class<T> entityClass, String filter, String parameters, Map<String,?> values)
Find all persistent instances of the given class that match the given JDOQL filter, using the given parameter declarations and parameter values.
<T> Collection<T>
find(Class<T> entityClass, String filter, String parameters, Map<String,?> values, String ordering)
Find all persistent instances of the given class that match the given JDOQL filter, using the given parameter declarations and parameter values, with the given result ordering.
<T> Collection<T>
find(Class<T> entityClass, String filter, String parameters, Object... values)
Find all persistent instances of the given class that match the given JDOQL filter, using the given parameter declarations and parameter values.
<T> Collection<T>
find(Class<T> entityClass, String filter, String parameters, Object[] values, String ordering)
Find all persistent instances of the given class that match the given JDOQL filter, using the given parameter declarations and parameter values, with the given result ordering.
 Collection find(String queryString)
Find persistent instances through the given single-string JDOQL query.
 Collection find(String queryString, Map<String,?> values)
Find persistent instances through the given single-string JDOQL query.
 Collection find(String queryString, Object... values)
Find persistent instances through the given single-string JDOQL query.
 Collection find(String language, Object queryObject)
Find persistent instances through the given query object in the specified query language.
<T> Collection<T>
findByNamedQuery(Class<T> entityClass, String queryName)
Find persistent instances through the given named query.
<T> Collection<T>
findByNamedQuery(Class<T> entityClass, String queryName, Map<String,?> values)
Find persistent instances through the given named query.
<T> Collection<T>
findByNamedQuery(Class<T> entityClass, String queryName, Object... values)
Find persistent instances through the given named query.
 void flush()
Flush all transactional modifications to the database.
<T> T
getObjectById(Class<T> entityClass, Object idValue)
Return the persistent instance of the given entity class with the given id value, throwing an exception if not found.
 Object getObjectById(Object objectId)
Return the persistent instance with the given JDO object id, throwing an exception if not found.
<T> T
makePersistent(T entity)
Make the given transient instance persistent.
<T> Collection<T>
makePersistentAll(Collection<T> entities)
Make the given transient instances persistent.
 void refresh(Object entity)
Re-read the state of the given persistent instance.
 void refreshAll()
Re-read the state of all persistent instances.
 void refreshAll(Collection entities)
Re-read the state of all given persistent instances.

Method Detail

execute

<T> T execute(JdoCallback<T> action)
          throws DataAccessException
Execute the action specified by the given action object within a PersistenceManager. Application exceptions thrown by the action object get propagated to the caller (can only be unchecked). JDO exceptions are transformed into appropriate DAO ones. Allows for returning a result object, i.e. a domain object or a collection of domain objects.

Note: Callback code is not supposed to handle transactions itself! Use an appropriate transaction manager like JdoTransactionManager.

Parameters:
action - callback object that specifies the JDO action
Returns:
a result object returned by the action, or null
Throws:
DataAccessException - in case of JDO errors
See Also:
JdoTransactionManager, org.springframework.dao, org.springframework.transaction, PersistenceManager

executeFind

Collection executeFind(JdoCallback<?> action)
                       throws DataAccessException
Execute the specified action assuming that the result object is a Collection. This is a convenience method for executing JDO queries within an action.

Parameters:
action - callback object that specifies the JDO action
Returns:
a Collection result returned by the action, or null
Throws:
DataAccessException - in case of JDO errors

getObjectById

Object getObjectById(Object objectId)
                     throws DataAccessException
Return the persistent instance with the given JDO object id, throwing an exception if not found.

A JDO object id identifies both the persistent class and the id within the namespace of that class.

Parameters:
objectId - a JDO object id of the persistent instance
Returns:
the persistent instance
Throws:
ObjectRetrievalFailureException - if not found
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.getObjectById(Object, boolean)

getObjectById

<T> T getObjectById(Class<T> entityClass,
                    Object idValue)
                throws DataAccessException
Return the persistent instance of the given entity class with the given id value, throwing an exception if not found.

The given id value is typically just unique within the namespace of the persistent class. Its toString value must correspond to the toString value of the corresponding JDO object id.

Usually, the passed-in value will have originated from the primary key field of a persistent object that uses JDO's application identity.

Parameters:
entityClass - a persistent class
idValue - an id value of the persistent instance
Returns:
the persistent instance
Throws:
ObjectRetrievalFailureException - if not found
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.getObjectById(Object, boolean), PersistenceManager.getObjectById(Class, Object)

evict

void evict(Object entity)
           throws DataAccessException
Remove the given object from the PersistenceManager cache.

Parameters:
entity - the persistent instance to evict
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.evict(Object)

evictAll

void evictAll(Collection entities)
              throws DataAccessException
Remove all given objects from the PersistenceManager cache.

Parameters:
entities - the persistent instances to evict
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.evictAll(java.util.Collection)

evictAll

void evictAll()
              throws DataAccessException
Remove all objects from the PersistenceManager cache.

Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.evictAll()

refresh

void refresh(Object entity)
             throws DataAccessException
Re-read the state of the given persistent instance.

Parameters:
entity - the persistent instance to re-read
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.refresh(Object)

refreshAll

void refreshAll(Collection entities)
                throws DataAccessException
Re-read the state of all given persistent instances.

Parameters:
entities - the persistent instances to re-read
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.refreshAll(java.util.Collection)

refreshAll

void refreshAll()
                throws DataAccessException
Re-read the state of all persistent instances.

Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.refreshAll()

makePersistent

<T> T makePersistent(T entity)
                 throws DataAccessException
Make the given transient instance persistent. Attach the given entity if the instance is detached.

Parameters:
entity - the transient instance to make persistent
Returns:
the persistent instance
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.makePersistent(Object)

makePersistentAll

<T> Collection<T> makePersistentAll(Collection<T> entities)
                                throws DataAccessException
Make the given transient instances persistent. Attach the given entities if the instances are detached.

Parameters:
entities - the transient instances to make persistent
Returns:
the persistent instances
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.makePersistentAll(java.util.Collection)

deletePersistent

void deletePersistent(Object entity)
                      throws DataAccessException
Delete the given persistent instance.

Parameters:
entity - the persistent instance to delete
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.deletePersistent(Object)

deletePersistentAll

void deletePersistentAll(Collection entities)
                         throws DataAccessException
Delete all given persistent instances.

This can be combined with any of the find methods to delete by query in two lines of code.

Parameters:
entities - the persistent instances to delete
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.deletePersistentAll(java.util.Collection)

detachCopy

<T> T detachCopy(T entity)
Detach a copy of the given persistent instance from the current JDO transaction, for use outside a JDO transaction (for example, as web form object).

Parameters:
entity - the persistent instance to detach
Returns:
the corresponding detached instance
See Also:
PersistenceManager.detachCopy(Object)

detachCopyAll

<T> Collection<T> detachCopyAll(Collection<T> entities)
Detach copies of the given persistent instances from the current JDO transaction, for use outside a JDO transaction (for example, as web form objects).

Parameters:
entities - the persistent instances to detach
Returns:
the corresponding detached instances
See Also:
PersistenceManager.detachCopyAll(Collection)

flush

void flush()
           throws DataAccessException
Flush all transactional modifications to the database.

Only invoke this for selective eager flushing, for example when JDBC code needs to see certain changes within the same transaction. Else, it's preferable to rely on auto-flushing at transaction completion.

Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.flush(), JdoDialect#flush(javax.jdo.PersistenceManager)

find

<T> Collection<T> find(Class<T> entityClass)
                   throws DataAccessException
Find all persistent instances of the given class.

Parameters:
entityClass - a persistent class
Returns:
the persistent instances
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.newQuery(Class)

find

<T> Collection<T> find(Class<T> entityClass,
                       String filter)
                   throws DataAccessException
Find all persistent instances of the given class that match the given JDOQL filter.

Parameters:
entityClass - a persistent class
filter - the JDOQL filter to match (or null if none)
Returns:
the persistent instances
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.newQuery(Class, String)

find

<T> Collection<T> find(Class<T> entityClass,
                       String filter,
                       String ordering)
                   throws DataAccessException
Find all persistent instances of the given class that match the given JDOQL filter, with the given result ordering.

Parameters:
entityClass - a persistent class
filter - the JDOQL filter to match (or null if none)
ordering - the ordering of the result (or null if none)
Returns:
the persistent instances
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.newQuery(Class, String), Query.setOrdering(java.lang.String)

find

<T> Collection<T> find(Class<T> entityClass,
                       String filter,
                       String parameters,
                       Object... values)
                   throws DataAccessException
Find all persistent instances of the given class that match the given JDOQL filter, using the given parameter declarations and parameter values.

Parameters:
entityClass - a persistent class
filter - the JDOQL filter to match
parameters - the JDOQL parameter declarations
values - the corresponding parameter values
Returns:
the persistent instances
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.newQuery(Class, String),
Query.declareParameters(java.lang.String),
Query.executeWithArray(java.lang.Object...)

find

<T> Collection<T> find(Class<T> entityClass,
                       String filter,
                       String parameters,
                       Object[] values,
                       String ordering)
                   throws DataAccessException
Find all persistent instances of the given class that match the given JDOQL filter, using the given parameter declarations and parameter values, with the given result ordering.

Parameters:
entityClass - a persistent class
filter - the JDOQL filter to match
parameters - the JDOQL parameter declarations
values - the corresponding parameter values
ordering - the ordering of the result (or null if none)
Returns:
the persistent instances
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.newQuery(Class, String),
Query.declareParameters(java.lang.String),
Query.executeWithArray(java.lang.Object...),
Query.setOrdering(java.lang.String)

find

<T> Collection<T> find(Class<T> entityClass,
                       String filter,
                       String parameters,
                       Map<String,?> values)
                   throws DataAccessException
Find all persistent instances of the given class that match the given JDOQL filter, using the given parameter declarations and parameter values.

Parameters:
entityClass - a persistent class
filter - the JDOQL filter to match
parameters - the JDOQL parameter declarations
values - a Map with parameter names as keys and parameter values
Returns:
the persistent instances
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.newQuery(Class, String),
Query.declareParameters(java.lang.String),
Query.executeWithMap(java.util.Map)

find

<T> Collection<T> find(Class<T> entityClass,
                       String filter,
                       String parameters,
                       Map<String,?> values,
                       String ordering)
                   throws DataAccessException
Find all persistent instances of the given class that match the given JDOQL filter, using the given parameter declarations and parameter values, with the given result ordering.

Parameters:
entityClass - a persistent class
filter - the JDOQL filter to match
parameters - the JDOQL parameter declarations
values - a Map with parameter names as keys and parameter values
ordering - the ordering of the result (or null if none)
Returns:
the persistent instances
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.newQuery(Class, String),
Query.declareParameters(java.lang.String),
Query.executeWithMap(java.util.Map),
Query.setOrdering(java.lang.String)

find

Collection find(String language,
                Object queryObject)
                throws DataAccessException
Find persistent instances through the given query object in the specified query language.

Parameters:
language - the query language (javax.jdo.Query#JDOQL or javax.jdo.Query#SQL, for example)
queryObject - the query object for the specified language
Returns:
the persistent instances
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.newQuery(String, Object), Query.JDOQL, Query.SQL

find

Collection find(String queryString)
                throws DataAccessException
Find persistent instances through the given single-string JDOQL query.

Parameters:
queryString - the single-string JDOQL query
Returns:
the persistent instances
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.newQuery(String)

find

Collection find(String queryString,
                Object... values)
                throws DataAccessException
Find persistent instances through the given single-string JDOQL query.

Parameters:
queryString - the single-string JDOQL query
values - the corresponding parameter values
Returns:
the persistent instances
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.newQuery(String)

find

Collection find(String queryString,
                Map<String,?> values)
                throws DataAccessException
Find persistent instances through the given single-string JDOQL query.

Parameters:
queryString - the single-string JDOQL query
values - a Map with parameter names as keys and parameter values
Returns:
the persistent instances
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.newQuery(String)

findByNamedQuery

<T> Collection<T> findByNamedQuery(Class<T> entityClass,
                                   String queryName)
                               throws DataAccessException
Find persistent instances through the given named query.

Parameters:
entityClass - a persistent class
queryName - the name of the query
Returns:
the persistent instances
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.newNamedQuery(Class, String)

findByNamedQuery

<T> Collection<T> findByNamedQuery(Class<T> entityClass,
                                   String queryName,
                                   Object... values)
                               throws DataAccessException
Find persistent instances through the given named query.

Parameters:
entityClass - a persistent class
queryName - the name of the query
values - the corresponding parameter values
Returns:
the persistent instances
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.newNamedQuery(Class, String)

findByNamedQuery

<T> Collection<T> findByNamedQuery(Class<T> entityClass,
                                   String queryName,
                                   Map<String,?> values)
                               throws DataAccessException
Find persistent instances through the given named query.

Parameters:
entityClass - a persistent class
queryName - the name of the query
values - a Map with parameter names as keys and parameter values
Returns:
the persistent instances
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.newNamedQuery(Class, String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultJdoDialect

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.orm.jdo
Class DefaultJdoDialect

java.lang.Object
    extended by  org.springframework.orm.jdo.DefaultJdoDialect
All Implemented Interfaces:
PersistenceExceptionTranslator, JdoDialect
public class DefaultJdoDialect
extends Object
implements JdoDialect, PersistenceExceptionTranslator

Default implementation of the JdoDialect interface. Updated to build on JDO 2.0 or higher, as of Spring 2.5. Used as default dialect by JdoAccessor and JdoTransactionManager.

Simply begins a standard JDO transaction in beginTransaction. Returns a handle for a JDO2 DataStoreConnection on getJdbcConnection. Calls the corresponding JDO2 PersistenceManager operation on flush Ignores a given query timeout in applyQueryTimeout. Uses a Spring SQLExceptionTranslator for exception translation, if applicable.

Note that, even with JDO2, vendor-specific subclasses are still necessary for special transaction semantics and more sophisticated exception translation. Furthermore, vendor-specific subclasses are encouraged to expose the native JDBC Connection on getJdbcConnection, rather than JDO2's wrapper handle.

This class also implements the PersistenceExceptionTranslator interface, as autodetected by Spring's PersistenceExceptionTranslationPostProcessor, for AOP-based translation of native exceptions to Spring DataAccessExceptions. Hence, the presence of a standard DefaultJdoDialect bean automatically enables a PersistenceExceptionTranslationPostProcessor to translate JDO exceptions.

Since:
1.1
Author:
Juergen Hoeller
See Also:
setJdbcExceptionTranslator(org.springframework.jdbc.support.SQLExceptionTranslator),
JdoAccessor.setJdoDialect(org.springframework.orm.jdo.JdoDialect),
JdoTransactionManager.setJdoDialect(org.springframework.orm.jdo.JdoDialect),
PersistenceExceptionTranslationPostProcessor

Field Summary
protected  Log logger
Constructor Summary
DefaultJdoDialect()
Create a new DefaultJdoDialect.
Method Summary
void | applyQueryTimeout(javax.jdo.Query query, int remainingTimeInSeconds) This implementation sets the JPA 2.0 query hints "javax.persistence.lock.timeout" and "javax.persistence.query.timeout", assuming that JDO 2.1 providers are often JPA providers as well.
Object | beginTransaction(javax.jdo.Transaction transaction, TransactionDefinition definition) This implementation invokes the standard JDO Transaction.begin method.
void | cleanupTransaction(Object transactionData) This implementation does nothing, as the default beginTransaction implementation does not require any cleanup.
protected String | extractSqlStringFromException(javax.jdo.JDOException ex) Template method for extracting a SQL String from the given exception.
ConnectionHandle | getJdbcConnection(javax.jdo.PersistenceManager pm, boolean readOnly) This implementation returns a DataStoreConnectionHandle for JDO2, which will also work on JDO1 until actually accessing the JDBC Connection.
SQLExceptionTranslator | getJdbcExceptionTranslator() Return the JDBC exception translator for this dialect, if any.
void | releaseJdbcConnection(ConnectionHandle conHandle, javax.jdo.PersistenceManager pm) This implementation does nothing, assuming that the Connection will implicitly be closed with the PersistenceManager.
void | setJdbcExceptionTranslator(SQLExceptionTranslator jdbcExceptionTranslator) Set the JDBC exception translator for this dialect.
DataAccessException | translateException(javax.jdo.JDOException ex) This implementation delegates to PersistenceManagerFactoryUtils.
DataAccessException | translateExceptionIfPossible(RuntimeException ex) Implementation of the PersistenceExceptionTranslator interface, as autodetected by Spring's PersistenceExceptionTranslationPostProcessor.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Constructor Detail

DefaultJdoDialect

public DefaultJdoDialect()
Create a new DefaultJdoDialect.

Method Detail

setJdbcExceptionTranslator

public void setJdbcExceptionTranslator(SQLExceptionTranslator jdbcExceptionTranslator)
Set the JDBC exception translator for this dialect.

Applied to any SQLException root cause of a JDOException, if specified. The default is to rely on the JDO provider's native exception translation.

Parameters:
jdbcExceptionTranslator - exception translator
See Also:
SQLException, JDOException.getCause(), SQLErrorCodeSQLExceptionTranslator, SQLStateSQLExceptionTranslator

getJdbcExceptionTranslator

public SQLExceptionTranslator getJdbcExceptionTranslator()
Return the JDBC exception translator for this dialect, if any.

beginTransaction

public Object beginTransaction(javax.jdo.Transaction transaction,
                               TransactionDefinition definition)
                        throws javax.jdo.JDOException,
                               SQLException,
                               TransactionException
This implementation invokes the standard JDO Transaction.begin method. Throws an InvalidIsolationLevelException if a non-default isolation level is set.

Specified by:
beginTransaction in interface JdoDialect
Parameters:
transaction - the JDO transaction to begin
definition - the Spring transaction definition that defines semantics
Returns:
an arbitrary object that holds transaction data, if any (to be passed into cleanupTransaction)
Throws:
javax.jdo.JDOException - if thrown by JDO methods
SQLException - if thrown by JDBC methods
TransactionException - in case of invalid arguments
See Also:
Transaction.begin(), InvalidIsolationLevelException

cleanupTransaction

public void cleanupTransaction(Object transactionData)
This implementation does nothing, as the default beginTransaction implementation does not require any cleanup.

Specified by:
cleanupTransaction in interface JdoDialect
Parameters:
transactionData - arbitrary object that holds transaction data, if any (as returned by beginTransaction)
See Also:
beginTransaction(javax.jdo.Transaction, org.springframework.transaction.TransactionDefinition)

getJdbcConnection

public ConnectionHandle getJdbcConnection(javax.jdo.PersistenceManager pm,
                                          boolean readOnly)
                                   throws javax.jdo.JDOException,
                                          SQLException
This implementation returns a DataStoreConnectionHandle for JDO2, which will also work on JDO1 until actually accessing the JDBC Connection.

For pre-JDO2 implementations, override this method to return the Connection through the corresponding vendor-specific mechanism, or null if the Connection is not retrievable.

NOTE: A JDO2 DataStoreConnection is always a wrapper, never the native JDBC Connection. If you need access to the native JDBC Connection (or the connection pool handle, to be unwrapped via a Spring NativeJdbcExtractor), override this method to return the native Connection through the corresponding vendor-specific mechanism.

A JDO2 DataStoreConnection is only "borrowed" from the PersistenceManager: it needs to be returned as early as possible. Effectively, JDO2 requires the fetched Connection to be closed before continuing PersistenceManager work. For this reason, the exposed ConnectionHandle eagerly releases its JDBC Connection at the end of each JDBC data access operation (that is, on DataSourceUtils.releaseConnection).

Specified by:
getJdbcConnection in interface JdoDialect
Parameters:
pm - the current JDO PersistenceManager
readOnly - whether the Connection is only needed for read-only purposes
Returns:
a handle for the JDBC Connection, to be passed into releaseJdbcConnection, or null if no JDBC Connection can be retrieved
Throws:
javax.jdo.JDOException - if thrown by JDO methods
SQLException - if thrown by JDBC methods
See Also:
PersistenceManager.getDataStoreConnection(), NativeJdbcExtractor, DataSourceUtils.releaseConnection(java.sql.Connection, javax.sql.DataSource)

releaseJdbcConnection

public void releaseJdbcConnection(ConnectionHandle conHandle,
                                  javax.jdo.PersistenceManager pm)
                           throws javax.jdo.JDOException,
                                  SQLException
This implementation does nothing, assuming that the Connection will implicitly be closed with the PersistenceManager.

If the JDO provider returns a Connection handle that it expects the application to close, the dialect needs to invoke Connection.close here.

Specified by:
releaseJdbcConnection in interface JdoDialect
Parameters:
conHandle - the JDBC Connection handle to release
pm - the current JDO PersistenceManager
Throws:
javax.jdo.JDOException - if thrown by JDO methods
SQLException - if thrown by JDBC methods
See Also:
Connection.close()

applyQueryTimeout

public void applyQueryTimeout(javax.jdo.Query query,
                              int remainingTimeInSeconds)
                       throws javax.jdo.JDOException
This implementation sets the JPA 2.0 query hints "javax.persistence.lock.timeout" and "javax.persistence.query.timeout", assuming that JDO 2.1 providers are often JPA providers as well.

Specified by:
applyQueryTimeout in interface JdoDialect
Parameters:
query - the JDO query object to apply the timeout to
remainingTimeInSeconds - the timeout value (seconds) to apply
Throws:
javax.jdo.JDOException - if thrown by JDO methods
See Also:
JdoTemplate.prepareQuery(javax.jdo.Query)

translateExceptionIfPossible

public DataAccessException translateExceptionIfPossible(RuntimeException ex)
Implementation of the PersistenceExceptionTranslator interface, as autodetected by Spring's PersistenceExceptionTranslationPostProcessor.

Converts the exception if it is a JDOException, using this JdoDialect. Else returns null to indicate an unknown exception.

Specified by:
translateExceptionIfPossible in interface PersistenceExceptionTranslator
Parameters:
ex - a RuntimeException thrown
Returns:
the corresponding DataAccessException (or null if the exception could not be translated, as in this case it may result from user code rather than an actual persistence problem)
See Also:
PersistenceExceptionTranslationPostProcessor, translateException(javax.jdo.JDOException)

translateException

public DataAccessException translateException(javax.jdo.JDOException ex)
This implementation delegates to PersistenceManagerFactoryUtils.

Specified by:
translateException in interface JdoDialect
Parameters:
ex - the JDOException thrown
Returns:
the corresponding DataAccessException (must not be null)
See Also:
PersistenceManagerFactoryUtils.convertJdoAccessException(javax.jdo.JDOException)

extractSqlStringFromException

protected String extractSqlStringFromException(javax.jdo.JDOException ex)
Template method for extracting a SQL String from the given exception.

Default implementation always returns null. Can be overridden in subclasses to extract SQL Strings for vendor-specific exception classes.

Parameters:
ex - the JDOException, containing a SQLException
Returns:
the SQL String, or null if none found
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


JdoAccessor

org.springframework.orm.jdo
Class JdoAccessor

java.lang.Object
    extended by  org.springframework.orm.jdo.JdoAccessor
All Implemented Interfaces:
InitializingBean
Direct Known Subclasses:
JdoInterceptor, JdoTemplate, SpringPersistenceManagerProxyBean
public abstract class JdoAccessor
extends Object
implements InitializingBean

Base class for JdoTemplate and JdoInterceptor, defining common properties such as PersistenceManagerFactory and flushing behavior.

Note: With JDO, modifications to persistent objects are just possible within a transaction (in contrast to Hibernate). Therefore, eager flushing will just get applied when in a transaction. Furthermore, there is no explicit notion of flushing never, as this would not imply a performance gain due to JDO's field interception mechanism (which doesn't involve the overhead of snapshot comparisons).

Eager flushing is just available for specific JDO providers. You need to a corresponding JdoDialect to make eager flushing work.

Not intended to be used directly. See JdoTemplate and JdoInterceptor.

Since:
02.11.2003
Author:
Juergen Hoeller
See Also:
JdoTemplate, JdoInterceptor, setFlushEager(boolean)

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
JdoAccessor()
Method Summary
void | afterPropertiesSet() Eagerly initialize the JDO dialect, creating a default one for the specified PersistenceManagerFactory if none set.
DataAccessException | convertJdoAccessException(javax.jdo.JDOException ex) Convert the given JDOException to an appropriate exception from the org.springframework.dao hierarchy.
protected void | flushIfNecessary(javax.jdo.PersistenceManager pm, boolean existingTransaction) Flush the given JDO persistence manager if necessary.
JdoDialect | getJdoDialect() Return the JDO dialect to use for this accessor.
javax.jdo.PersistenceManagerFactory | getPersistenceManagerFactory() Return the JDO PersistenceManagerFactory that should be used to create PersistenceManagers.
boolean | isFlushEager() Return if this accessor should flush changes to the database eagerly.
void | setFlushEager(boolean flushEager) Set if this accessor should flush changes to the database eagerly.
void | setJdoDialect(JdoDialect jdoDialect) Set the JDO dialect to use for this accessor.
void | setPersistenceManagerFactory(javax.jdo.PersistenceManagerFactory pmf) Set the JDO PersistenceManagerFactory that should be used to create PersistenceManagers.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

JdoAccessor

public JdoAccessor()
Method Detail

setPersistenceManagerFactory

public void setPersistenceManagerFactory(javax.jdo.PersistenceManagerFactory pmf)
Set the JDO PersistenceManagerFactory that should be used to create PersistenceManagers.

getPersistenceManagerFactory

public javax.jdo.PersistenceManagerFactory getPersistenceManagerFactory()
Return the JDO PersistenceManagerFactory that should be used to create PersistenceManagers.

setJdoDialect

public void setJdoDialect(JdoDialect jdoDialect)
Set the JDO dialect to use for this accessor.

The dialect object can be used to retrieve the underlying JDBC connection and to eagerly flush changes to the database.

Default is a DefaultJdoDialect based on the PersistenceManagerFactory's underlying DataSource, if any.

getJdoDialect

public JdoDialect getJdoDialect()
Return the JDO dialect to use for this accessor.

Creates a default one for the specified PersistenceManagerFactory if none set.

setFlushEager

public void setFlushEager(boolean flushEager)
Set if this accessor should flush changes to the database eagerly.

Eager flushing leads to immediate synchronization with the database, even if in a transaction. This causes inconsistencies to show up and throw a respective exception immediately, and JDBC access code that participates in the same transaction will see the changes as the database is already aware of them then. But the drawbacks are:

  • additional communication roundtrips with the database, instead of a single batch at transaction commit;
  • the fact that an actual database rollback is needed if the JDO transaction rolls back (due to already submitted SQL statements).

isFlushEager

public boolean isFlushEager()
Return if this accessor should flush changes to the database eagerly.

afterPropertiesSet

public void afterPropertiesSet()
Eagerly initialize the JDO dialect, creating a default one for the specified PersistenceManagerFactory if none set.

Specified by:
afterPropertiesSet in interface InitializingBean

flushIfNecessary

protected void flushIfNecessary(javax.jdo.PersistenceManager pm,
                                boolean existingTransaction)
                         throws javax.jdo.JDOException
Flush the given JDO persistence manager if necessary.

Parameters:
pm - the current JDO PersistenceManager
existingTransaction - if executing within an existing transaction (within an existing JDO PersistenceManager that won't be closed immediately)
Throws:
javax.jdo.JDOException - in case of JDO flushing errors

convertJdoAccessException

public DataAccessException convertJdoAccessException(javax.jdo.JDOException ex)
Convert the given JDOException to an appropriate exception from the org.springframework.dao hierarchy.

Default implementation delegates to the JdoDialect. May be overridden in subclasses.

Parameters:
ex - JDOException that occured
Returns:
the corresponding DataAccessException instance
See Also:
JdoDialect.translateException(javax.jdo.JDOException)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JdoInterceptor

org.springframework.orm.jdo
Class JdoInterceptor

java.lang.Object
    extended by  org.springframework.orm.jdo.JdoAccessor
        extended by  org.springframework.orm.jdo.JdoInterceptor
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, InitializingBean
public class JdoInterceptor
extends JdoAccessor
implements MethodInterceptor

This interceptor binds a new JDO PersistenceManager to the thread before a method call, closing and removing it afterwards in case of any method outcome. If there already is a pre-bound PersistenceManager (e.g. from JdoTransactionManager, or from a surrounding JDO-intercepted method), the interceptor simply participates in it.

Application code must retrieve a JDO PersistenceManager via the PersistenceManagerFactoryUtils.getPersistenceManager method, to be able to detect a thread-bound PersistenceManager. It is preferable to use getPersistenceManager with allowCreate=false, if the code relies on the interceptor to provide proper PersistenceManager handling. Typically, the code will look like as follows:

 public void doSomeDataAccessAction() {
   PersistenceManager pm = PersistenceManagerFactoryUtils.getPersistenceManager(this.pmf, false);
   ...
 }

Note that this interceptor automatically translates JDOExceptions, via delegating to the PersistenceManagerFactoryUtils.convertJdoAccessException method that converts them to exceptions that are compatible with the org.springframework.dao exception hierarchy (like JdoTemplate does). This can be turned off if the raw exceptions are preferred.

This class can be considered a declarative alternative to JdoTemplate's callback approach. The advantages are:

  • no anonymous classes necessary for callback implementations;
  • the possibility to throw any application exceptions from within data access code.

The drawback is the dependency on interceptor configuration. However, note that this interceptor is usually not necessary in scenarios where the data access code always executes within transactions. A transaction will always have a thread-bound PersistenceManager in the first place, so adding this interceptor to the configuration just adds value when fine-tuning PersistenceManager settings like the flush mode - or when relying on exception translation.

Since:
13.06.2003
Author:
Juergen Hoeller
See Also:
PersistenceManagerFactoryUtils.getPersistenceManager(javax.jdo.PersistenceManagerFactory, boolean), JdoTransactionManager, JdoTemplate

Field Summary
Fields inherited from class org.springframework.orm.jdo.JdoAccessor
logger
Constructor Summary
JdoInterceptor()
Method Summary
Object | invoke(MethodInvocation methodInvocation)
void | setExceptionConversionEnabled(boolean exceptionConversionEnabled) Set whether to convert any JDOException raised to a Spring DataAccessException, compatible with the org.springframework.dao exception hierarchy.
Methods inherited from class org.springframework.orm.jdo.JdoAccessor
afterPropertiesSet, convertJdoAccessException, flushIfNecessary, getJdoDialect, getPersistenceManagerFactory, isFlushEager, setFlushEager, setJdoDialect, setPersistenceManagerFactory
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JdoInterceptor

public JdoInterceptor()
Method Detail

setExceptionConversionEnabled

public void setExceptionConversionEnabled(boolean exceptionConversionEnabled)
Set whether to convert any JDOException raised to a Spring DataAccessException, compatible with the org.springframework.dao exception hierarchy.

Default is "true". Turn this flag off to let the caller receive raw exceptions as-is, without any wrapping.

See Also:
DataAccessException

invoke

public Object invoke(MethodInvocation methodInvocation)
              throws Throwable
Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JdoTemplate

org.springframework.orm.jdo
Class JdoTemplate

java.lang.Object
    extended by  org.springframework.orm.jdo.JdoAccessor
        extended by  org.springframework.orm.jdo.JdoTemplate
All Implemented Interfaces:
InitializingBean, JdoOperations
public class JdoTemplate
extends JdoAccessor
implements JdoOperations

Helper class that simplifies JDO data access code, and converts JDOExceptions into Spring DataAccessExceptions, following the org.springframework.dao exception hierarchy.

The central method is execute, supporting JDO access code implementing the JdoCallback interface. It provides JDO PersistenceManager handling such that neither the JdoCallback implementation nor the calling code needs to explicitly care about retrieving/closing PersistenceManagers, or handling JDO lifecycle exceptions.

Typically used to implement data access or business logic services that use JDO within their implementation but are JDO-agnostic in their interface. The latter or code calling the latter only have to deal with business objects, query objects, and org.springframework.dao exceptions.

Can be used within a service implementation via direct instantiation with a PersistenceManagerFactory reference, or get prepared in an application context and given to services as bean reference. Note: The PersistenceManagerFactory should always be configured as bean in the application context, in the first case given to the service directly, in the second case to the prepared template.

This class can be considered as direct alternative to working with the raw JDO PersistenceManager API (through PersistenceManagerFactoryUtils.getPersistenceManager()). The major advantage is its automatic conversion to DataAccessExceptions, the major disadvantage that no checked application exceptions can get thrown from within data access code. Corresponding checks and the actual throwing of such exceptions can often be deferred to after callback execution, though.

LocalPersistenceManagerFactoryBean is the preferred way of obtaining a reference to a specific PersistenceManagerFactory, at least in a non-EJB environment. The Spring application context will manage its lifecycle, initializing and shutting down the factory as part of the application.

Note that lazy loading will just work with an open JDO PersistenceManager, either within a Spring-driven transaction (with JdoTransactionManager or JtaTransactionManager) or within OpenPersistenceManagerInViewFilter/Interceptor. Furthermore, some operations just make sense within transactions, for example: evict, evictAll, flush.

NOTE: This class requires JDO 2.0 or higher, as of Spring 2.5. As of Spring 3.0, it follows JDO 2.1 conventions in terms of generic parameter and return types, which still remaining compatible with JDO 2.0.

Since:
03.06.2003
Author:
Juergen Hoeller
See Also:
JdoAccessor.setPersistenceManagerFactory(javax.jdo.PersistenceManagerFactory), JdoCallback, PersistenceManager, LocalPersistenceManagerFactoryBean, JdoTransactionManager, JtaTransactionManager, OpenPersistenceManagerInViewFilter, OpenPersistenceManagerInViewInterceptor

Field Summary
Fields inherited from class org.springframework.orm.jdo.JdoAccessor
logger
Constructor Summary
JdoTemplate()
Create a new JdoTemplate instance.
JdoTemplate(javax.jdo.PersistenceManagerFactory pmf)
Create a new JdoTemplate instance.
JdoTemplate(javax.jdo.PersistenceManagerFactory pmf, boolean allowCreate)
Create a new JdoTemplate instance.
Method Summary
protected  javax.jdo.PersistenceManager createPersistenceManagerProxy(javax.jdo.PersistenceManager pm)
Create a close-suppressing proxy for the given JDO PersistenceManager.
 void deletePersistent(Object entity)
Delete the given persistent instance.
 void deletePersistentAll(Collection entities)
Delete all given persistent instances.
<T> T
detachCopy(T entity)
Detach a copy of the given persistent instance from the current JDO transaction, for use outside a JDO transaction (for example, as web form object).
<T> Collection<T>
detachCopyAll(Collection<T> entities)
Detach copies of the given persistent instances from the current JDO transaction, for use outside a JDO transaction (for example, as web form objects).
 void evict(Object entity)
Remove the given object from the PersistenceManager cache.
 void evictAll()
Remove all objects from the PersistenceManager cache.
 void evictAll(Collection entities)
Remove all given objects from the PersistenceManager cache.
<T> T
execute(JdoCallback<T> action)
Execute the action specified by the given action object within a PersistenceManager.
<T> T
execute(JdoCallback<T> action, boolean exposeNativePersistenceManager)
Execute the action specified by the given action object within a PersistenceManager.
 Collection executeFind(JdoCallback<?> action)
Execute the specified action assuming that the result object is a Collection.
<T> Collection<T>
find(Class<T> entityClass)
Find all persistent instances of the given class.
<T> Collection<T>
find(Class<T> entityClass, String filter)
Find all persistent instances of the given class that match the given JDOQL filter.
<T> Collection<T>
find(Class<T> entityClass, String filter, String ordering)
Find all persistent instances of the given class that match the given JDOQL filter, with the given result ordering.
<T> Collection<T>
find(Class<T> entityClass, String filter, String parameters, Map<String,?> values)
Find all persistent instances of the given class that match the given JDOQL filter, using the given parameter declarations and parameter values.
<T> Collection<T>
find(Class<T> entityClass, String filter, String parameters, Map<String,?> values, String ordering)
Find all persistent instances of the given class that match the given JDOQL filter, using the given parameter declarations and parameter values, with the given result ordering.
<T> Collection<T>
find(Class<T> entityClass, String filter, String parameters, Object... values)
Find all persistent instances of the given class that match the given JDOQL filter, using the given parameter declarations and parameter values.
<T> Collection<T>
find(Class<T> entityClass, String filter, String parameters, Object[] values, String ordering)
Find all persistent instances of the given class that match the given JDOQL filter, using the given parameter declarations and parameter values, with the given result ordering.
 Collection find(String queryString)
Find persistent instances through the given single-string JDOQL query.
 Collection find(String queryString, Map<String,?> values)
Find persistent instances through the given single-string JDOQL query.
 Collection find(String queryString, Object... values)
Find persistent instances through the given single-string JDOQL query.
 Collection find(String language, Object queryObject)
Find persistent instances through the given query object in the specified query language.
<T> Collection<T>
findByNamedQuery(Class<T> entityClass, String queryName)
Find persistent instances through the given named query.
<T> Collection<T>
findByNamedQuery(Class<T> entityClass, String queryName, Map<String,?> values)
Find persistent instances through the given named query.
<T> Collection<T>
findByNamedQuery(Class<T> entityClass, String queryName, Object... values)
Find persistent instances through the given named query.
 void flush()
Flush all transactional modifications to the database.
<T> T
getObjectById(Class<T> entityClass, Object idValue)
Return the persistent instance of the given entity class with the given id value, throwing an exception if not found.
 Object getObjectById(Object objectId)
Return the persistent instance with the given JDO object id, throwing an exception if not found.
 boolean isAllowCreate()
Return if a new PersistenceManager should be created if no thread-bound found.
 boolean isExposeNativePersistenceManager()
Return whether to expose the native JDO PersistenceManager to JdoCallback code, or rather a PersistenceManager proxy.
<T> T
makePersistent(T entity)
Make the given transient instance persistent.
<T> Collection<T>
makePersistentAll(Collection<T> entities)
Make the given transient instances persistent.
protected
<T> T
postProcessResult(T result, javax.jdo.PersistenceManager pm, boolean existingTransaction)
Post-process the given result object, which might be a Collection.
 void prepareQuery(javax.jdo.Query query)
Prepare the given JDO query object.
 void refresh(Object entity)
Re-read the state of the given persistent instance.
 void refreshAll()
Re-read the state of all persistent instances.
 void refreshAll(Collection entities)
Re-read the state of all given persistent instances.
 void setAllowCreate(boolean allowCreate)
Set if a new PersistenceManager should be created when no transactional PersistenceManager can be found for the current thread.
 void setExposeNativePersistenceManager(boolean exposeNativePersistenceManager)
Set whether to expose the native JDO PersistenceManager to JdoCallback code.
Methods inherited from class org.springframework.orm.jdo.JdoAccessor
afterPropertiesSet, convertJdoAccessException, flushIfNecessary, getJdoDialect, getPersistenceManagerFactory, isFlushEager, setFlushEager, setJdoDialect, setPersistenceManagerFactory
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JdoTemplate

public JdoTemplate()
Create a new JdoTemplate instance.

JdoTemplate

public JdoTemplate(javax.jdo.PersistenceManagerFactory pmf)
Create a new JdoTemplate instance.

Parameters:
pmf - PersistenceManagerFactory to create PersistenceManagers

JdoTemplate

public JdoTemplate(javax.jdo.PersistenceManagerFactory pmf,
                   boolean allowCreate)
Create a new JdoTemplate instance.

Parameters:
pmf - PersistenceManagerFactory to create PersistenceManagers
allowCreate - if a non-transactional PersistenceManager should be created when no transactional PersistenceManager can be found for the current thread
Method Detail

setAllowCreate

public void setAllowCreate(boolean allowCreate)
Set if a new PersistenceManager should be created when no transactional PersistenceManager can be found for the current thread.

JdoTemplate is aware of a corresponding PersistenceManager bound to the current thread, for example when using JdoTransactionManager. If allowCreate is true, a new non-transactional PersistenceManager will be created if none found, which needs to be closed at the end of the operation. If false, an IllegalStateException will get thrown in this case.

See Also:
PersistenceManagerFactoryUtils.getPersistenceManager(javax.jdo.PersistenceManagerFactory, boolean)

isAllowCreate

public boolean isAllowCreate()
Return if a new PersistenceManager should be created if no thread-bound found.

setExposeNativePersistenceManager

public void setExposeNativePersistenceManager(boolean exposeNativePersistenceManager)
Set whether to expose the native JDO PersistenceManager to JdoCallback code. Default is "false": a PersistenceManager proxy will be returned, suppressing close calls and automatically applying transaction timeouts (if any).

As there is often a need to cast to a provider-specific PersistenceManager class in DAOs that use provider-specific functionality, the exposed proxy implements all interfaces implemented by the original PersistenceManager. If this is not sufficient, turn this flag to "true".

See Also:
JdoCallback, PersistenceManager, prepareQuery(javax.jdo.Query)

isExposeNativePersistenceManager

public boolean isExposeNativePersistenceManager()
Return whether to expose the native JDO PersistenceManager to JdoCallback code, or rather a PersistenceManager proxy.

execute

public <T> T execute(JdoCallback<T> action)
          throws DataAccessException
Description copied from interface: JdoOperations
Execute the action specified by the given action object within a PersistenceManager. Application exceptions thrown by the action object get propagated to the caller (can only be unchecked). JDO exceptions are transformed into appropriate DAO ones. Allows for returning a result object, i.e. a domain object or a collection of domain objects.

Note: Callback code is not supposed to handle transactions itself! Use an appropriate transaction manager like JdoTransactionManager.

Specified by:
execute in interface JdoOperations
Parameters:
action - callback object that specifies the JDO action
Returns:
a result object returned by the action, or null
Throws:
DataAccessException - in case of JDO errors
See Also:
JdoTransactionManager, org.springframework.dao, org.springframework.transaction, PersistenceManager

executeFind

public Collection executeFind(JdoCallback<?> action)
                       throws DataAccessException
Description copied from interface: JdoOperations
Execute the specified action assuming that the result object is a Collection. This is a convenience method for executing JDO queries within an action.

Specified by:
executeFind in interface JdoOperations
Parameters:
action - callback object that specifies the JDO action
Returns:
a Collection result returned by the action, or null
Throws:
DataAccessException - in case of JDO errors

execute

public <T> T execute(JdoCallback<T> action,
                     boolean exposeNativePersistenceManager)
          throws DataAccessException
Execute the action specified by the given action object within a PersistenceManager.

Parameters:
action - callback object that specifies the JDO action
exposeNativePersistenceManager - whether to expose the native JDO persistence manager to callback code
Returns:
a result object returned by the action, or null
Throws:
DataAccessException - in case of JDO errors

createPersistenceManagerProxy

protected javax.jdo.PersistenceManager createPersistenceManagerProxy(javax.jdo.PersistenceManager pm)
Create a close-suppressing proxy for the given JDO PersistenceManager. Called by the execute method.

The proxy also prepares returned JDO Query objects.

Parameters:
pm - the JDO PersistenceManager to create a proxy for
Returns:
the PersistenceManager proxy, implementing all interfaces implemented by the passed-in PersistenceManager object (that is, also implementing all provider-specific extension interfaces)
See Also:
PersistenceManager.close(),
execute(JdoCallback, boolean),
prepareQuery(javax.jdo.Query)

postProcessResult

protected <T> T postProcessResult(T result,
                                  javax.jdo.PersistenceManager pm,
                                  boolean existingTransaction)
Post-process the given result object, which might be a Collection. Called by the execute method.

Default implementation always returns the passed-in Object as-is. Subclasses might override this to automatically detach result collections or even single result objects.

Parameters:
pm - the current JDO PersistenceManager
result - the result object (might be a Collection)
existingTransaction - if executing within an existing transaction (within an existing JDO PersistenceManager that won't be closed immediately)
Returns:
the post-processed result object (can be simply be the passed-in object)
See Also:
execute(JdoCallback, boolean)

getObjectById

public Object getObjectById(Object objectId)
                     throws DataAccessException
Description copied from interface: JdoOperations
Return the persistent instance with the given JDO object id, throwing an exception if not found.

A JDO object id identifies both the persistent class and the id within the namespace of that class.

Specified by:
getObjectById in interface JdoOperations
Parameters:
objectId - a JDO object id of the persistent instance
Returns:
the persistent instance
Throws:
ObjectRetrievalFailureException - if not found
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.getObjectById(Object, boolean)

getObjectById

public <T> T getObjectById(Class<T> entityClass,
                           Object idValue)
                throws DataAccessException
Description copied from interface: JdoOperations
Return the persistent instance of the given entity class with the given id value, throwing an exception if not found.

The given id value is typically just unique within the namespace of the persistent class. Its toString value must correspond to the toString value of the corresponding JDO object id.

Usually, the passed-in value will have originated from the primary key field of a persistent object that uses JDO's application identity.

Specified by:
getObjectById in interface JdoOperations
Parameters:
entityClass - a persistent class
idValue - an id value of the persistent instance
Returns:
the persistent instance
Throws:
ObjectRetrievalFailureException - if not found
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.getObjectById(Object, boolean), PersistenceManager.getObjectById(Class, Object)

evict

public void evict(Object entity)
           throws DataAccessException
Description copied from interface: JdoOperations
Remove the given object from the PersistenceManager cache.

Specified by:
evict in interface JdoOperations
Parameters:
entity - the persistent instance to evict
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.evict(Object)

evictAll

public void evictAll(Collection entities)
              throws DataAccessException
Description copied from interface: JdoOperations
Remove all given objects from the PersistenceManager cache.

Specified by:
evictAll in interface JdoOperations
Parameters:
entities - the persistent instances to evict
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.evictAll(java.util.Collection)

evictAll

public void evictAll()
              throws DataAccessException
Description copied from interface: JdoOperations
Remove all objects from the PersistenceManager cache.

Specified by:
evictAll in interface JdoOperations
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.evictAll()

refresh

public void refresh(Object entity)
             throws DataAccessException
Description copied from interface: JdoOperations
Re-read the state of the given persistent instance.

Specified by:
refresh in interface JdoOperations
Parameters:
entity - the persistent instance to re-read
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.refresh(Object)

refreshAll

public void refreshAll(Collection entities)
                throws DataAccessException
Description copied from interface: JdoOperations
Re-read the state of all given persistent instances.

Specified by:
refreshAll in interface JdoOperations
Parameters:
entities - the persistent instances to re-read
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.refreshAll(java.util.Collection)

refreshAll

public void refreshAll()
                throws DataAccessException
Description copied from interface: JdoOperations
Re-read the state of all persistent instances.

Specified by:
refreshAll in interface JdoOperations
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.refreshAll()

makePersistent

public <T> T makePersistent(T entity)
                 throws DataAccessException
Description copied from interface: JdoOperations
Make the given transient instance persistent. Attach the given entity if the instance is detached.

Specified by:
makePersistent in interface JdoOperations
Parameters:
entity - the transient instance to make persistent
Returns:
the persistent instance
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.makePersistent(Object)

makePersistentAll

public <T> Collection<T> makePersistentAll(Collection<T> entities)
                                throws DataAccessException
Description copied from interface: JdoOperations
Make the given transient instances persistent. Attach the given entities if the instances are detached.

Specified by:
makePersistentAll in interface JdoOperations
Parameters:
entities - the transient instances to make persistent
Returns:
the persistent instances
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.makePersistentAll(java.util.Collection)

deletePersistent

public void deletePersistent(Object entity)
                      throws DataAccessException
Description copied from interface: JdoOperations
Delete the given persistent instance.

Specified by:
deletePersistent in interface JdoOperations
Parameters:
entity - the persistent instance to delete
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.deletePersistent(Object)

deletePersistentAll

public void deletePersistentAll(Collection entities)
                         throws DataAccessException
Description copied from interface: JdoOperations
Delete all given persistent instances.

This can be combined with any of the find methods to delete by query in two lines of code.

Specified by:
deletePersistentAll in interface JdoOperations
Parameters:
entities - the persistent instances to delete
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.deletePersistentAll(java.util.Collection)

detachCopy

public <T> T detachCopy(T entity)
Description copied from interface: JdoOperations
Detach a copy of the given persistent instance from the current JDO transaction, for use outside a JDO transaction (for example, as web form object).

Specified by:
detachCopy in interface JdoOperations
Parameters:
entity - the persistent instance to detach
Returns:
the corresponding detached instance
See Also:
PersistenceManager.detachCopy(Object)

detachCopyAll

public <T> Collection<T> detachCopyAll(Collection<T> entities)
Description copied from interface: JdoOperations
Detach copies of the given persistent instances from the current JDO transaction, for use outside a JDO transaction (for example, as web form objects).

Specified by:
detachCopyAll in interface JdoOperations
Parameters:
entities - the persistent instances to detach
Returns:
the corresponding detached instances
See Also:
PersistenceManager.detachCopyAll(Collection)

flush

public void flush()
           throws DataAccessException
Description copied from interface: JdoOperations
Flush all transactional modifications to the database.

Only invoke this for selective eager flushing, for example when JDBC code needs to see certain changes within the same transaction. Else, it's preferable to rely on auto-flushing at transaction completion.

Specified by:
flush in interface JdoOperations
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.flush(), JdoDialect#flush(javax.jdo.PersistenceManager)

find

public <T> Collection<T> find(Class<T> entityClass)
                   throws DataAccessException
Description copied from interface: JdoOperations
Find all persistent instances of the given class.

Specified by:
find in interface JdoOperations
Parameters:
entityClass - a persistent class
Returns:
the persistent instances
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.newQuery(Class)

find

public <T> Collection<T> find(Class<T> entityClass,
                              String filter)
                   throws DataAccessException
Description copied from interface: JdoOperations
Find all persistent instances of the given class that match the given JDOQL filter.

Specified by:
find in interface JdoOperations
Parameters:
entityClass - a persistent class
filter - the JDOQL filter to match (or null if none)
Returns:
the persistent instances
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.newQuery(Class, String)

find

public <T> Collection<T> find(Class<T> entityClass,
                              String filter,
                              String ordering)
                   throws DataAccessException
Description copied from interface: JdoOperations
Find all persistent instances of the given class that match the given JDOQL filter, with the given result ordering.

Specified by:
find in interface JdoOperations
Parameters:
entityClass - a persistent class
filter - the JDOQL filter to match (or null if none)
ordering - the ordering of the result (or null if none)
Returns:
the persistent instances
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.newQuery(Class, String), Query.setOrdering(java.lang.String)

find

public <T> Collection<T> find(Class<T> entityClass,
                              String filter,
                              String parameters,
                              Object... values)
                   throws DataAccessException
Description copied from interface: JdoOperations
Find all persistent instances of the given class that match the given JDOQL filter, using the given parameter declarations and parameter values.

Specified by:
find in interface JdoOperations
Parameters:
entityClass - a persistent class
filter - the JDOQL filter to match
parameters - the JDOQL parameter declarations
values - the corresponding parameter values
Returns:
the persistent instances
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.newQuery(Class, String),
Query.declareParameters(java.lang.String),
Query.executeWithArray(java.lang.Object...)

find

public <T> Collection<T> find(Class<T> entityClass,
                              String filter,
                              String parameters,
                              Object[] values,
                              String ordering)
                   throws DataAccessException
Description copied from interface: JdoOperations
Find all persistent instances of the given class that match the given JDOQL filter, using the given parameter declarations and parameter values, with the given result ordering.

Specified by:
find in interface JdoOperations
Parameters:
entityClass - a persistent class
filter - the JDOQL filter to match
parameters - the JDOQL parameter declarations
values - the corresponding parameter values
ordering - the ordering of the result (or null if none)
Returns:
the persistent instances
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.newQuery(Class, String),
Query.declareParameters(java.lang.String),
Query.executeWithArray(java.lang.Object...),
Query.setOrdering(java.lang.String)

find

public <T> Collection<T> find(Class<T> entityClass,
                              String filter,
                              String parameters,
                              Map<String,?> values)
                   throws DataAccessException
Description copied from interface: JdoOperations
Find all persistent instances of the given class that match the given JDOQL filter, using the given parameter declarations and parameter values.

Specified by:
find in interface JdoOperations
Parameters:
entityClass - a persistent class
filter - the JDOQL filter to match
parameters - the JDOQL parameter declarations
values - a Map with parameter names as keys and parameter values
Returns:
the persistent instances
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.newQuery(Class, String),
Query.declareParameters(java.lang.String),
Query.executeWithMap(java.util.Map)

find

public <T> Collection<T> find(Class<T> entityClass,
                              String filter,
                              String parameters,
                              Map<String,?> values,
                              String ordering)
                   throws DataAccessException
Description copied from interface: JdoOperations
Find all persistent instances of the given class that match the given JDOQL filter, using the given parameter declarations and parameter values, with the given result ordering.

Specified by:
find in interface JdoOperations
Parameters:
entityClass - a persistent class
filter - the JDOQL filter to match
parameters - the JDOQL parameter declarations
values - a Map with parameter names as keys and parameter values
ordering - the ordering of the result (or null if none)
Returns:
the persistent instances
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.newQuery(Class, String),
Query.declareParameters(java.lang.String),
Query.executeWithMap(java.util.Map),
Query.setOrdering(java.lang.String)

find

public Collection find(String language,
                       Object queryObject)
                throws DataAccessException
Description copied from interface: JdoOperations
Find persistent instances through the given query object in the specified query language.

Specified by:
find in interface JdoOperations
Parameters:
language - the query language (javax.jdo.Query#JDOQL or javax.jdo.Query#SQL, for example)
queryObject - the query object for the specified language
Returns:
the persistent instances
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.newQuery(String, Object), Query.JDOQL, Query.SQL

find

public Collection find(String queryString)
                throws DataAccessException
Description copied from interface: JdoOperations
Find persistent instances through the given single-string JDOQL query.

Specified by:
find in interface JdoOperations
Parameters:
queryString - the single-string JDOQL query
Returns:
the persistent instances
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.newQuery(String)

find

public Collection find(String queryString,
                       Object... values)
                throws DataAccessException
Description copied from interface: JdoOperations
Find persistent instances through the given single-string JDOQL query.

Specified by:
find in interface JdoOperations
Parameters:
queryString - the single-string JDOQL query
values - the corresponding parameter values
Returns:
the persistent instances
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.newQuery(String)

find

public Collection find(String queryString,
                       Map<String,?> values)
                throws DataAccessException
Description copied from interface: JdoOperations
Find persistent instances through the given single-string JDOQL query.

Specified by:
find in interface JdoOperations
Parameters:
queryString - the single-string JDOQL query
values - a Map with parameter names as keys and parameter values
Returns:
the persistent instances
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.newQuery(String)

findByNamedQuery

public <T> Collection<T> findByNamedQuery(Class<T> entityClass,
                                          String queryName)
                               throws DataAccessException
Description copied from interface: JdoOperations
Find persistent instances through the given named query.

Specified by:
findByNamedQuery in interface JdoOperations
Parameters:
entityClass - a persistent class
queryName - the name of the query
Returns:
the persistent instances
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.newNamedQuery(Class, String)

findByNamedQuery

public <T> Collection<T> findByNamedQuery(Class<T> entityClass,
                                          String queryName,
                                          Object... values)
                               throws DataAccessException
Description copied from interface: JdoOperations
Find persistent instances through the given named query.

Specified by:
findByNamedQuery in interface JdoOperations
Parameters:
entityClass - a persistent class
queryName - the name of the query
values - the corresponding parameter values
Returns:
the persistent instances
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.newNamedQuery(Class, String)

findByNamedQuery

public <T> Collection<T> findByNamedQuery(Class<T> entityClass,
                                          String queryName,
                                          Map<String,?> values)
                               throws DataAccessException
Description copied from interface: JdoOperations
Find persistent instances through the given named query.

Specified by:
findByNamedQuery in interface JdoOperations
Parameters:
entityClass - a persistent class
queryName - the name of the query
values - a Map with parameter names as keys and parameter values
Returns:
the persistent instances
Throws:
DataAccessException - in case of JDO errors
See Also:
PersistenceManager.newNamedQuery(Class, String)

prepareQuery

public void prepareQuery(javax.jdo.Query query)
                  throws javax.jdo.JDOException
Prepare the given JDO query object. To be used within a JdoCallback.

Applies a transaction timeout, if any. If you don't use such timeouts, the call is a no-op.

In general, prefer a proxied PersistenceManager instead, which will automatically apply the transaction timeout (through the use of a special PersistenceManager proxy). You need to set the "exposeNativePersistenceManager" property to "false" to activate this. Note that you won't be able to cast to a provider-specific JDO PersistenceManager class anymore then.

Parameters:
query - the JDO query object
Throws:
javax.jdo.JDOException - if the query could not be properly prepared
See Also:
JdoCallback.doInJdo(javax.jdo.PersistenceManager),
PersistenceManagerFactoryUtils.applyTransactionTimeout(javax.jdo.Query, javax.jdo.PersistenceManagerFactory, org.springframework.orm.jdo.JdoDialect),
setExposeNativePersistenceManager(boolean)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JdoTransactionManager

org.springframework.orm.jdo
Class JdoTransactionManager

java.lang.Object
    extended by  org.springframework.transaction.support.AbstractPlatformTransactionManager
        extended by  org.springframework.orm.jdo.JdoTransactionManager
All Implemented Interfaces:
Serializable, InitializingBean, PlatformTransactionManager, ResourceTransactionManager
public class JdoTransactionManager
extends AbstractPlatformTransactionManager
implements ResourceTransactionManager, InitializingBean

PlatformTransactionManager implementation for a single JDO PersistenceManagerFactory. Binds a JDO PersistenceManager from the specified factory to the thread, potentially allowing for one thread-bound PersistenceManager per factory. PersistenceManagerFactoryUtils and JdoTemplate are aware of thread-bound persistence managers and participate in such transactions automatically. Using either of those (or going through a TransactionAwarePersistenceManagerFactoryProxy is required for JDO access code supporting this transaction management mechanism.

This transaction manager is appropriate for applications that use a single JDO PersistenceManagerFactory for transactional data access. JTA (usually through JtaTransactionManager) is necessary for accessing multiple transactional resources within the same transaction. Note that you need to configure your JDO provider accordingly in order to make it participate in JTA transactions.

This transaction manager also supports direct DataSource access within a transaction (i.e. plain JDBC code working with the same DataSource). This allows for mixing services which access JDO and services which use plain JDBC (without being aware of JDO)! Application code needs to stick to the same simple Connection lookup pattern as with DataSourceTransactionManager (i.e. DataSourceUtils.getConnection(javax.sql.DataSource) or going through a TransactionAwareDataSourceProxy).

Note: To be able to register a DataSource's Connection for plain JDBC code, this instance needs to be aware of the DataSource (setDataSource(javax.sql.DataSource)). The given DataSource should obviously match the one used by the given PersistenceManagerFactory. This transaction manager will autodetect the DataSource that acts as "connectionFactory" of the PersistenceManagerFactory, so you usually don't need to explicitly specify the "dataSource" property.

On JDBC 3.0, this transaction manager supports nested transactions via JDBC 3.0 Savepoints. The AbstractPlatformTransactionManager.setNestedTransactionAllowed(boolean) "nestedTransactionAllowed"} flag defaults to "false", though, as nested transactions will just apply to the JDBC Connection, not to the JDO PersistenceManager and its cached objects. You can manually set the flag to "true" if you want to use nested transactions for JDBC access code which participates in JDO transactions (provided that your JDBC driver supports Savepoints). Note that JDO itself does not support nested transactions! Hence, do not expect JDO access code to semantically participate in a nested transaction.

Since:
03.06.2003
Author:
Juergen Hoeller
See Also:
setPersistenceManagerFactory(javax.jdo.PersistenceManagerFactory), setDataSource(javax.sql.DataSource), PersistenceManagerFactory.getConnectionFactory(), LocalPersistenceManagerFactoryBean, PersistenceManagerFactoryUtils.getPersistenceManager(javax.jdo.PersistenceManagerFactory, boolean), PersistenceManagerFactoryUtils.releasePersistenceManager(javax.jdo.PersistenceManager, javax.jdo.PersistenceManagerFactory), JdoTemplate, TransactionAwarePersistenceManagerFactoryProxy, DataSourceUtils.getConnection(javax.sql.DataSource), DataSourceUtils.releaseConnection(java.sql.Connection, javax.sql.DataSource), JdbcTemplate, DataSourceTransactionManager, JtaTransactionManager, Serialized Form

Field Summary
Fields inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
logger, SYNCHRONIZATION_ALWAYS, SYNCHRONIZATION_NEVER, SYNCHRONIZATION_ON_ACTUAL_TRANSACTION
Constructor Summary
JdoTransactionManager()
Create a new JdoTransactionManager instance.
JdoTransactionManager(javax.jdo.PersistenceManagerFactory pmf)
Create a new JdoTransactionManager instance.
Method Summary
void | afterPropertiesSet() Eagerly initialize the JDO dialect, creating a default one for the specified PersistenceManagerFactory if none set.
protected void | closePersistenceManagerAfterFailedBegin(org.springframework.orm.jdo.JdoTransactionManager.JdoTransactionObject txObject) Close the current transaction's EntityManager.
protected DataAccessException | convertJdoAccessException(javax.jdo.JDOException ex) Convert the given JDOException to an appropriate exception from the org.springframework.dao hierarchy.
protected void | doBegin(Object transaction, TransactionDefinition definition) Begin a new transaction with semantics according to the given transaction definition.
protected void | doCleanupAfterCompletion(Object transaction) Cleanup resources after transaction completion.
protected void | doCommit(DefaultTransactionStatus status) Perform an actual commit of the given transaction.
protected Object | doGetTransaction() Return a transaction object for the current transaction state.
protected void | doResume(Object transaction, Object suspendedResources) Resume the resources of the current transaction.
protected void | doRollback(DefaultTransactionStatus status) Perform an actual rollback of the given transaction.
protected void | doSetRollbackOnly(DefaultTransactionStatus status) Set the given transaction rollback-only.
protected Object | doSuspend(Object transaction) Suspend the resources of the current transaction.
DataSource | getDataSource() Return the JDBC DataSource that this instance manages transactions for.
JdoDialect | getJdoDialect() Return the JDO dialect to use for this transaction manager.
javax.jdo.PersistenceManagerFactory | getPersistenceManagerFactory() Return the PersistenceManagerFactory that this instance should manage transactions for.
Object | getResourceFactory() Return the resource factory that this transaction manager operates on, e.g.
protected boolean | isExistingTransaction(Object transaction) Check if the given transaction object indicates an existing transaction (that is, a transaction which has already started).
void | setAutodetectDataSource(boolean autodetectDataSource) Set whether to autodetect a JDBC DataSource used by the JDO PersistenceManagerFactory, as returned by the getConnectionFactory() method.
void | setDataSource(DataSource dataSource) Set the JDBC DataSource that this instance should manage transactions for.
void | setJdoDialect(JdoDialect jdoDialect) Set the JDO dialect to use for this transaction manager.
void | setPersistenceManagerFactory(javax.jdo.PersistenceManagerFactory pmf) Set the PersistenceManagerFactory that this instance should manage transactions for.
protected boolean | shouldCommitOnGlobalRollbackOnly() This implementation returns "true": a JDO2 commit will properly handle transactions that have been marked rollback-only at a global level.
Methods inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
commit, determineTimeout, getDefaultTimeout, getTransaction, getTransactionSynchronization, invokeAfterCompletion, isFailEarlyOnGlobalRollbackOnly, isGlobalRollbackOnParticipationFailure, isNestedTransactionAllowed, isRollbackOnCommitFailure, isValidateExistingTransaction, newTransactionStatus, prepareForCommit, prepareSynchronization, prepareTransactionStatus, registerAfterCompletionWithExistingTransaction, resume, rollback, setDefaultTimeout, setFailEarlyOnGlobalRollbackOnly, setGlobalRollbackOnParticipationFailure, setNestedTransactionAllowed, setRollbackOnCommitFailure, setTransactionSynchronization, setTransactionSynchronizationName, setValidateExistingTransaction, suspend, triggerBeforeCommit, triggerBeforeCompletion, useSavepointForNestedTransaction
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.transaction.PlatformTransactionManager
commit, getTransaction, rollback

Constructor Detail

JdoTransactionManager

public JdoTransactionManager()
Create a new JdoTransactionManager instance. A PersistenceManagerFactory has to be set to be able to use it.

See Also:
setPersistenceManagerFactory(javax.jdo.PersistenceManagerFactory)

JdoTransactionManager

public JdoTransactionManager(javax.jdo.PersistenceManagerFactory pmf)
Create a new JdoTransactionManager instance.

Parameters:
pmf - PersistenceManagerFactory to manage transactions for
Method Detail

setPersistenceManagerFactory

public void setPersistenceManagerFactory(javax.jdo.PersistenceManagerFactory pmf)
Set the PersistenceManagerFactory that this instance should manage transactions for.

The PersistenceManagerFactory specified here should be the target PersistenceManagerFactory to manage transactions for, not a TransactionAwarePersistenceManagerFactoryProxy. Only data access code may work with TransactionAwarePersistenceManagerFactoryProxy, while the transaction manager needs to work on the underlying target PersistenceManagerFactory.

See Also:
TransactionAwarePersistenceManagerFactoryProxy

getPersistenceManagerFactory

public javax.jdo.PersistenceManagerFactory getPersistenceManagerFactory()
Return the PersistenceManagerFactory that this instance should manage transactions for.

setDataSource

public void setDataSource(DataSource dataSource)
Set the JDBC DataSource that this instance should manage transactions for. The DataSource should match the one used by the JDO PersistenceManagerFactory: for example, you could specify the same JNDI DataSource for both.

If the PersistenceManagerFactory uses a DataSource as connection factory, the DataSource will be autodetected: You can still explictly specify the DataSource, but you don't need to in this case.

A transactional JDBC Connection for this DataSource will be provided to application code accessing this DataSource directly via DataSourceUtils or JdbcTemplate. The Connection will be taken from the JDO PersistenceManager.

Note that you need to use a JDO dialect for a specific JDO provider to allow for exposing JDO transactions as JDBC transactions.

The DataSource specified here should be the target DataSource to manage transactions for, not a TransactionAwareDataSourceProxy. Only data access code may work with TransactionAwareDataSourceProxy, while the transaction manager needs to work on the underlying target DataSource. If there's nevertheless a TransactionAwareDataSourceProxy passed in, it will be unwrapped to extract its target DataSource.

See Also:
setAutodetectDataSource(boolean), setJdoDialect(org.springframework.orm.jdo.JdoDialect), PersistenceManagerFactory.getConnectionFactory(), TransactionAwareDataSourceProxy, DataSourceUtils, JdbcTemplate

getDataSource

public DataSource getDataSource()
Return the JDBC DataSource that this instance manages transactions for.

setAutodetectDataSource

public void setAutodetectDataSource(boolean autodetectDataSource)
Set whether to autodetect a JDBC DataSource used by the JDO PersistenceManagerFactory, as returned by the getConnectionFactory() method. Default is "true".

Can be turned off to deliberately ignore an available DataSource, to not expose JDO transactions as JDBC transactions for that DataSource.

See Also:
setDataSource(javax.sql.DataSource), PersistenceManagerFactory.getConnectionFactory()

setJdoDialect

public void setJdoDialect(JdoDialect jdoDialect)
Set the JDO dialect to use for this transaction manager.

The dialect object can be used to retrieve the underlying JDBC connection and thus allows for exposing JDO transactions as JDBC transactions.

See Also:
JdoDialect.getJdbcConnection(javax.jdo.PersistenceManager, boolean)

getJdoDialect

public JdoDialect getJdoDialect()
Return the JDO dialect to use for this transaction manager.

Creates a default one for the specified PersistenceManagerFactory if none set.

afterPropertiesSet

public void afterPropertiesSet()
Eagerly initialize the JDO dialect, creating a default one for the specified PersistenceManagerFactory if none set. Auto-detect the PersistenceManagerFactory's DataSource, if any.

Specified by:
afterPropertiesSet in interface InitializingBean

getResourceFactory

public Object getResourceFactory()
Description copied from interface: ResourceTransactionManager
Return the resource factory that this transaction manager operates on, e.g. a JDBC DataSource or a JMS ConnectionFactory.

This target resource factory is usually used as resource key for TransactionSynchronizationManager's resource bindings per thread.

Specified by:
getResourceFactory in interface ResourceTransactionManager
Returns:
the target resource factory (never null)
See Also:
TransactionSynchronizationManager.bindResource(java.lang.Object, java.lang.Object), TransactionSynchronizationManager.getResource(java.lang.Object)

doGetTransaction

protected Object doGetTransaction()
Description copied from class: AbstractPlatformTransactionManager
Return a transaction object for the current transaction state.

The returned object will usually be specific to the concrete transaction manager implementation, carrying corresponding transaction state in a modifiable fashion. This object will be passed into the other template methods (e.g. doBegin and doCommit), either directly or as part of a DefaultTransactionStatus instance.

The returned object should contain information about any existing transaction, that is, a transaction that has already started before the current getTransaction call on the transaction manager. Consequently, a doGetTransaction implementation will usually look for an existing transaction and store corresponding state in the returned transaction object.

Specified by:
doGetTransaction in class AbstractPlatformTransactionManager
Returns:
the current transaction object
See Also:
AbstractPlatformTransactionManager.doBegin(java.lang.Object, org.springframework.transaction.TransactionDefinition),
AbstractPlatformTransactionManager.doCommit(org.springframework.transaction.support.DefaultTransactionStatus),
AbstractPlatformTransactionManager.doRollback(org.springframework.transaction.support.DefaultTransactionStatus),
DefaultTransactionStatus.getTransaction()

isExistingTransaction

protected boolean isExistingTransaction(Object transaction)
Description copied from class: AbstractPlatformTransactionManager
Check if the given transaction object indicates an existing transaction (that is, a transaction which has already started).

The result will be evaluated according to the specified propagation behavior for the new transaction. An existing transaction might get suspended (in case of PROPAGATION_REQUIRES_NEW), or the new transaction might participate in the existing one (in case of PROPAGATION_REQUIRED).

The default implementation returns false, assuming that participating in existing transactions is generally not supported. Subclasses are of course encouraged to provide such support.

Overrides:
isExistingTransaction in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
Returns:
if there is an existing transaction
See Also:
AbstractPlatformTransactionManager.doGetTransaction()

doBegin

protected void doBegin(Object transaction,
                       TransactionDefinition definition)
Description copied from class: AbstractPlatformTransactionManager
Begin a new transaction with semantics according to the given transaction definition. Does not have to care about applying the propagation behavior, as this has already been handled by this abstract manager.

This method gets called when the transaction manager has decided to actually start a new transaction. Either there wasn't any transaction before, or the previous transaction has been suspended.

A special scenario is a nested transaction without savepoint: If useSavepointForNestedTransaction() returns "false", this method will be called to start a nested transaction when necessary. In such a context, there will be an active transaction: The implementation of this method has to detect this and start an appropriate nested transaction.

Specified by:
doBegin in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
definition - TransactionDefinition instance, describing propagation behavior, isolation level, read-only flag, timeout, and transaction name

closePersistenceManagerAfterFailedBegin

protected void closePersistenceManagerAfterFailedBegin(org.springframework.orm.jdo.JdoTransactionManager.JdoTransactionObject txObject)
Close the current transaction's EntityManager. Called after a transaction begin attempt failed.

Parameters:
txObject - the current transaction

doSuspend

protected Object doSuspend(Object transaction)
Description copied from class: AbstractPlatformTransactionManager
Suspend the resources of the current transaction. Transaction synchronization will already have been suspended.

The default implementation throws a TransactionSuspensionNotSupportedException, assuming that transaction suspension is generally not supported.

Overrides:
doSuspend in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
Returns:
an object that holds suspended resources (will be kept unexamined for passing it into doResume)
See Also:
AbstractPlatformTransactionManager.doResume(java.lang.Object, java.lang.Object)

doResume

protected void doResume(Object transaction,
                        Object suspendedResources)
Description copied from class: AbstractPlatformTransactionManager
Resume the resources of the current transaction. Transaction synchronization will be resumed afterwards.

The default implementation throws a TransactionSuspensionNotSupportedException, assuming that transaction suspension is generally not supported.

Overrides:
doResume in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
suspendedResources - the object that holds suspended resources, as returned by doSuspend
See Also:
AbstractPlatformTransactionManager.doSuspend(java.lang.Object)

shouldCommitOnGlobalRollbackOnly

protected boolean shouldCommitOnGlobalRollbackOnly()
This implementation returns "true": a JDO2 commit will properly handle transactions that have been marked rollback-only at a global level.

Overrides:
shouldCommitOnGlobalRollbackOnly in class AbstractPlatformTransactionManager
See Also:
AbstractPlatformTransactionManager.doCommit(org.springframework.transaction.support.DefaultTransactionStatus),
DefaultTransactionStatus.isGlobalRollbackOnly(),
AbstractTransactionStatus.isLocalRollbackOnly(),
TransactionStatus.setRollbackOnly(),
UnexpectedRollbackException,
UserTransaction.commit(),
RollbackException

doCommit

protected void doCommit(DefaultTransactionStatus status)
Description copied from class: AbstractPlatformTransactionManager
Perform an actual commit of the given transaction.

An implementation does not need to check the "new transaction" flag or the rollback-only flag; this will already have been handled before. Usually, a straight commit will be performed on the transaction object contained in the passed-in status.

Specified by:
doCommit in class AbstractPlatformTransactionManager
Parameters:
status - the status representation of the transaction
See Also:
DefaultTransactionStatus.getTransaction()

doRollback

protected void doRollback(DefaultTransactionStatus status)
Description copied from class: AbstractPlatformTransactionManager
Perform an actual rollback of the given transaction.

An implementation does not need to check the "new transaction" flag; this will already have been handled before. Usually, a straight rollback will be performed on the transaction object contained in the passed-in status.

Specified by:
doRollback in class AbstractPlatformTransactionManager
Parameters:
status - the status representation of the transaction
See Also:
DefaultTransactionStatus.getTransaction()

doSetRollbackOnly

protected void doSetRollbackOnly(DefaultTransactionStatus status)
Description copied from class: AbstractPlatformTransactionManager
Set the given transaction rollback-only. Only called on rollback if the current transaction participates in an existing one.

The default implementation throws an IllegalTransactionStateException, assuming that participating in existing transactions is generally not supported. Subclasses are of course encouraged to provide such support.

Overrides:
doSetRollbackOnly in class AbstractPlatformTransactionManager
Parameters:
status - the status representation of the transaction

doCleanupAfterCompletion

protected void doCleanupAfterCompletion(Object transaction)
Description copied from class: AbstractPlatformTransactionManager
Cleanup resources after transaction completion.

Called after doCommit and doRollback execution, on any outcome. The default implementation does nothing.

Should not throw any exceptions but just issue warnings on errors.

Overrides:
doCleanupAfterCompletion in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction

convertJdoAccessException

protected DataAccessException convertJdoAccessException(javax.jdo.JDOException ex)
Convert the given JDOException to an appropriate exception from the org.springframework.dao hierarchy.

The default implementation delegates to the JdoDialect. May be overridden in subclasses.

Parameters:
ex - JDOException that occured
Returns:
the corresponding DataAccessException instance
See Also:
JdoDialect.translateException(javax.jdo.JDOException)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LocalPersistenceManagerFactoryBean

org.springframework.orm.jdo
Class LocalPersistenceManagerFactoryBean

java.lang.Object
    extended by  org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean
All Implemented Interfaces:
BeanClassLoaderAware, DisposableBean, FactoryBean<javax.jdo.PersistenceManagerFactory>, InitializingBean, PersistenceExceptionTranslator
public class LocalPersistenceManagerFactoryBean
extends Object
implements FactoryBean<javax.jdo.PersistenceManagerFactory>, BeanClassLoaderAware, InitializingBean, DisposableBean, PersistenceExceptionTranslator

FactoryBean that creates a JDO PersistenceManagerFactory. This is the usual way to set up a shared JDO PersistenceManagerFactory in a Spring application context; the PersistenceManagerFactory can then be passed to JDO-based DAOs via dependency injection. Note that switching to a JNDI lookup or to a bean-style PersistenceManagerFactory instance is just a matter of configuration!

NOTE: This class requires JDO 2.0 or higher, as of Spring 2.5. Since JDO 2.1, it will also expose the JPA EntityManagerFactory as long as the JDO provider creates a JDOEntityManagerFactory reference underneath, which means that this class can be used as a replacement for LocalEntityManagerFactoryBean in such a scenario.

Configuration settings can either be read from a properties file, specified as "configLocation", or locally specified. Properties specified as "jdoProperties" here will override any settings in a file. On JDO 2.1, you may alternatively specify a "persistenceManagerFactoryName", referring to a PMF definition in "META-INF/jdoconfig.xml" (see setPersistenceManagerFactoryName(java.lang.String)).

This class also implements the PersistenceExceptionTranslator interface, as autodetected by Spring's PersistenceExceptionTranslationPostProcessor, for AOP-based translation of native exceptions to Spring DataAccessExceptions. Hence, the presence of a LocalPersistenceManagerFactoryBean automatically enables a PersistenceExceptionTranslationPostProcessor to translate JDO exceptions.

Alternative: Configuration of a PersistenceManagerFactory provider bean

As alternative to the properties-driven approach that this FactoryBean offers (which is analogous to using the standard JDOHelper class with a Properties object that is populated with standard JDO properties), you can set up an instance of your PersistenceManagerFactory implementation class directly.

Like a DataSource, a PersistenceManagerFactory is encouraged to support bean-style configuration, which makes it very easy to set up as Spring-managed bean. The implementation class becomes the bean class; the remaining properties are applied as bean properties (starting with lower-case characters, in contrast to the corresponding JDO properties).

For example, in case of JPOX:

 <bean id="persistenceManagerFactory" class="org.jpox.PersistenceManagerFactoryImpl" destroy-method="close">
   <property name="connectionFactory" ref="dataSource"/>
   <property name="nontransactionalRead" value="true"/>
 </bean>

Note that such direct setup of a PersistenceManagerFactory implementation is the only way to pass an external connection factory (i.e. a JDBC DataSource) into a JDO PersistenceManagerFactory. With the standard properties-driven approach, you can only use an internal connection pool or a JNDI DataSource.

The close() method is standardized in JDO; don't forget to specify it as "destroy-method" for any PersistenceManagerFactory instance. Note that this FactoryBean will automatically invoke close() for the PersistenceManagerFactory that it creates, without any special configuration.

Since:
03.06.2003
Author:
Juergen Hoeller
See Also:
JdoAccessor.setPersistenceManagerFactory(javax.jdo.PersistenceManagerFactory),
JdoTransactionManager.setPersistenceManagerFactory(javax.jdo.PersistenceManagerFactory),
JndiObjectFactoryBean,
JDOHelper.getPersistenceManagerFactory(),
PersistenceManagerFactory.setConnectionFactory(java.lang.Object),
PersistenceManagerFactory.close(),
PersistenceExceptionTranslationPostProcessor

Field Summary
protected  Log logger
Constructor Summary
LocalPersistenceManagerFactoryBean()
Method Summary
 void afterPropertiesSet()
Initialize the PersistenceManagerFactory for the given location.
 void destroy()
Close the PersistenceManagerFactory on bean factory shutdown.
 Map<String,Object> getJdoPropertyMap()
Allow Map access to the JDO properties to be passed to the JDOHelper, with the option to add or override specific entries.
 javax.jdo.PersistenceManagerFactory getObject()
Return the singleton PersistenceManagerFactory.
 Class<? extends javax.jdo.PersistenceManagerFactory> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
protected  javax.jdo.PersistenceManagerFactory newPersistenceManagerFactory(Map props)
Subclasses can override this to perform custom initialization of the PersistenceManagerFactory instance, creating it via the given Properties that got prepared by this LocalPersistenceManagerFactoryBean.
protected  javax.jdo.PersistenceManagerFactory newPersistenceManagerFactory(String name)
Subclasses can override this to perform custom initialization of the PersistenceManagerFactory instance, creating it for the specified name.
 void setBeanClassLoader(ClassLoader beanClassLoader)
Callback that supplies the bean class loader to a bean instance.
 void setConfigLocation(Resource configLocation)
Set the location of the JDO properties config file, for example as classpath resource "classpath:kodo.properties".
 void setJdoDialect(JdoDialect jdoDialect)
Set the JDO dialect to use for the PersistenceExceptionTranslator functionality of this factory.
 void setJdoProperties(Properties jdoProperties)
Set JDO properties, such as"javax.jdo.PersistenceManagerFactoryClass".
 void setJdoPropertyMap(Map<String,Object> jdoProperties)
Specify JDO properties as a Map, to be passed into JDOHelper.getPersistenceManagerFactory (if any).
 void setPersistenceManagerFactoryName(String persistenceManagerFactoryName)
Specify the name of the desired PersistenceManagerFactory.
 DataAccessException translateExceptionIfPossible(RuntimeException ex)
Implementation of the PersistenceExceptionTranslator interface, as autodetected by Spring's PersistenceExceptionTranslationPostProcessor.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Constructor Detail

LocalPersistenceManagerFactoryBean

public LocalPersistenceManagerFactoryBean()
Method Detail

setPersistenceManagerFactoryName

public void setPersistenceManagerFactoryName(String persistenceManagerFactoryName)
Specify the name of the desired PersistenceManagerFactory.

This may either be a properties resource in the classpath if such a resource exists (JDO 2.0), or a PMF definition with that name from "META-INF/jdoconfig.xml" (JDO 2.1), or a JPA EntityManagerFactory cast to a PersistenceManagerFactory based on the persistence-unit name from "META-INF/persistence.xml" (JDO 2.1 / JPA 1.0).

Default is none: Either 'persistenceManagerFactoryName' or 'configLocation' or 'jdoProperties' needs to be specified.

See Also:
setConfigLocation(org.springframework.core.io.Resource), setJdoProperties(java.util.Properties)

setConfigLocation

public void setConfigLocation(Resource configLocation)
Set the location of the JDO properties config file, for example as classpath resource "classpath:kodo.properties".

Note: Can be omitted when all necessary properties are specified locally via this bean.

setJdoProperties

public void setJdoProperties(Properties jdoProperties)
Set JDO properties, such as"javax.jdo.PersistenceManagerFactoryClass".

Can be used to override values in a JDO properties config file, or to specify all necessary properties locally.

Can be populated with a String "value" (parsed via PropertiesEditor) or a "props" element in XML bean definitions.

setJdoPropertyMap

public void setJdoPropertyMap(Map<String,Object> jdoProperties)
Specify JDO properties as a Map, to be passed into JDOHelper.getPersistenceManagerFactory (if any).

Can be populated with a "map" or "props" element in XML bean definitions.

See Also:
JDOHelper.getPersistenceManagerFactory(java.util.Map)

getJdoPropertyMap

public Map<String,Object> getJdoPropertyMap()
Allow Map access to the JDO properties to be passed to the JDOHelper, with the option to add or override specific entries.

Useful for specifying entries directly, for example via "jdoPropertyMap[myKey]".

setJdoDialect

public void setJdoDialect(JdoDialect jdoDialect)
Set the JDO dialect to use for the PersistenceExceptionTranslator functionality of this factory.

Default is a DefaultJdoDialect based on the PersistenceManagerFactory's underlying DataSource, if any.

See Also:
JdoDialect.translateException(javax.jdo.JDOException), translateExceptionIfPossible(java.lang.RuntimeException), PersistenceExceptionTranslator

setBeanClassLoader

public void setBeanClassLoader(ClassLoader beanClassLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
beanClassLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

afterPropertiesSet

public void afterPropertiesSet()
                        throws IllegalArgumentException,
                               IOException,
                               javax.jdo.JDOException
Initialize the PersistenceManagerFactory for the given location.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
IllegalArgumentException - in case of illegal property values
IOException - if the properties could not be loaded from the given location
javax.jdo.JDOException - in case of JDO initialization errors

newPersistenceManagerFactory

protected javax.jdo.PersistenceManagerFactory newPersistenceManagerFactory(String name)
Subclasses can override this to perform custom initialization of the PersistenceManagerFactory instance, creating it for the specified name.

The default implementation invokes JDOHelper's getPersistenceManagerFactory(String) method. A custom implementation could prepare the instance in a specific way, or use a custom PersistenceManagerFactory implementation.

Parameters:
name - the name of the desired PersistenceManagerFactory
Returns:
the PersistenceManagerFactory instance
See Also:
JDOHelper.getPersistenceManagerFactory(String)

newPersistenceManagerFactory

protected javax.jdo.PersistenceManagerFactory newPersistenceManagerFactory(Map props)
Subclasses can override this to perform custom initialization of the PersistenceManagerFactory instance, creating it via the given Properties that got prepared by this LocalPersistenceManagerFactoryBean.

The default implementation invokes JDOHelper's getPersistenceManagerFactory(Map) method. A custom implementation could prepare the instance in a specific way, or use a custom PersistenceManagerFactory implementation.

Parameters:
props - the merged properties prepared by this LocalPersistenceManagerFactoryBean
Returns:
the PersistenceManagerFactory instance
See Also:
JDOHelper.getPersistenceManagerFactory(java.util.Map)

getObject

public javax.jdo.PersistenceManagerFactory getObject()
Return the singleton PersistenceManagerFactory.

Specified by:
getObject in interface FactoryBean<javax.jdo.PersistenceManagerFactory>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends javax.jdo.PersistenceManagerFactory> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<javax.jdo.PersistenceManagerFactory>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<javax.jdo.PersistenceManagerFactory>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()

translateExceptionIfPossible

public DataAccessException translateExceptionIfPossible(RuntimeException ex)
Implementation of the PersistenceExceptionTranslator interface, as autodetected by Spring's PersistenceExceptionTranslationPostProcessor.

Converts the exception if it is a JDOException, preferably using a specified JdoDialect. Else returns null to indicate an unknown exception.

Specified by:
translateExceptionIfPossible in interface PersistenceExceptionTranslator
Parameters:
ex - a RuntimeException thrown
Returns:
the corresponding DataAccessException (or null if the exception could not be translated, as in this case it may result from user code rather than an actual persistence problem)
See Also:
PersistenceExceptionTranslationPostProcessor, JdoDialect.translateException(javax.jdo.JDOException), PersistenceManagerFactoryUtils.convertJdoAccessException(javax.jdo.JDOException)

destroy

public void destroy()
Close the PersistenceManagerFactory on bean factory shutdown.

Specified by:
destroy in interface DisposableBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PersistenceManagerFactoryUtils

org.springframework.orm.jdo
Class PersistenceManagerFactoryUtils

java.lang.Object
    extended by  org.springframework.orm.jdo.PersistenceManagerFactoryUtils

public abstract class PersistenceManagerFactoryUtils
extends Object

Helper class featuring methods for JDO PersistenceManager handling, allowing for reuse of PersistenceManager instances within transactions. Also provides support for exception translation.

Used internally by JdoTemplate, JdoInterceptor and JdoTransactionManager. Can also be used directly in application code.

Since:
03.06.2003
Author:
Juergen Hoeller
See Also:
JdoTransactionManager, JtaTransactionManager, TransactionSynchronizationManager

Field Summary
static int PERSISTENCE_MANAGER_SYNCHRONIZATION_ORDER
Order value for TransactionSynchronization objects that clean up JDO PersistenceManagers.
Constructor Summary
PersistenceManagerFactoryUtils()
Method Summary
static void | applyTransactionTimeout(javax.jdo.Query query, javax.jdo.PersistenceManagerFactory pmf, JdoDialect jdoDialect) Apply the current transaction timeout, if any, to the given JDO Query object.
static DataAccessException | convertJdoAccessException(javax.jdo.JDOException ex) Convert the given JDOException to an appropriate exception from the org.springframework.dao hierarchy.
static javax.jdo.PersistenceManager | doGetPersistenceManager(javax.jdo.PersistenceManagerFactory pmf, boolean allowCreate) Obtain a JDO PersistenceManager via the given factory.
static void | doReleasePersistenceManager(javax.jdo.PersistenceManager pm, javax.jdo.PersistenceManagerFactory pmf) Actually release a PersistenceManager for the given factory.
static javax.jdo.PersistenceManager | getPersistenceManager(javax.jdo.PersistenceManagerFactory pmf, boolean allowCreate) Obtain a JDO PersistenceManager via the given factory.
static boolean | isPersistenceManagerTransactional(javax.jdo.PersistenceManager pm, javax.jdo.PersistenceManagerFactory pmf) Return whether the given JDO PersistenceManager is transactional, that is, bound to the current thread by Spring's transaction facilities.
static void | releasePersistenceManager(javax.jdo.PersistenceManager pm, javax.jdo.PersistenceManagerFactory pmf) Close the given PersistenceManager, created via the given factory, if it is not managed externally (i.e.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

PERSISTENCE_MANAGER_SYNCHRONIZATION_ORDER

public static final int PERSISTENCE_MANAGER_SYNCHRONIZATION_ORDER
Order value for TransactionSynchronization objects that clean up JDO PersistenceManagers. Return DataSourceUtils.CONNECTION_SYNCHRONIZATION_ORDER - 100 to execute PersistenceManager cleanup before JDBC Connection cleanup, if any.

See Also:
DataSourceUtils.CONNECTION_SYNCHRONIZATION_ORDER, Constant Field Values
Constructor Detail

PersistenceManagerFactoryUtils

public PersistenceManagerFactoryUtils()
Method Detail

getPersistenceManager

public static javax.jdo.PersistenceManager getPersistenceManager(javax.jdo.PersistenceManagerFactory pmf,
                                                                 boolean allowCreate)
                                                          throws DataAccessResourceFailureException,
                                                                 IllegalStateException
Obtain a JDO PersistenceManager via the given factory. Is aware of a corresponding PersistenceManager bound to the current thread, for example when using JdoTransactionManager. Will create a new PersistenceManager else, if "allowCreate" is true.

Parameters:
pmf - PersistenceManagerFactory to create the PersistenceManager with
allowCreate - if a non-transactional PersistenceManager should be created when no transactional PersistenceManager can be found for the current thread
Returns:
the PersistenceManager
Throws:
DataAccessResourceFailureException - if the PersistenceManager couldn't be obtained
IllegalStateException - if no thread-bound PersistenceManager found and "allowCreate" is false
See Also:
JdoTransactionManager

doGetPersistenceManager

public static javax.jdo.PersistenceManager doGetPersistenceManager(javax.jdo.PersistenceManagerFactory pmf,
                                                                   boolean allowCreate)
                                                            throws javax.jdo.JDOException,
                                                                   IllegalStateException
Obtain a JDO PersistenceManager via the given factory. Is aware of a corresponding PersistenceManager bound to the current thread, for example when using JdoTransactionManager. Will create a new PersistenceManager else, if "allowCreate" is true.

Same as getPersistenceManager, but throwing the original JDOException.

Parameters:
pmf - PersistenceManagerFactory to create the PersistenceManager with
allowCreate - if a non-transactional PersistenceManager should be created when no transactional PersistenceManager can be found for the current thread
Returns:
the PersistenceManager
Throws:
javax.jdo.JDOException - if the PersistenceManager couldn't be created
IllegalStateException - if no thread-bound PersistenceManager found and "allowCreate" is false
See Also:
getPersistenceManager(javax.jdo.PersistenceManagerFactory, boolean), JdoTransactionManager

isPersistenceManagerTransactional

public static boolean isPersistenceManagerTransactional(javax.jdo.PersistenceManager pm,
                                                        javax.jdo.PersistenceManagerFactory pmf)
Return whether the given JDO PersistenceManager is transactional, that is, bound to the current thread by Spring's transaction facilities.

Parameters:
pm - the JDO PersistenceManager to check
pmf - JDO PersistenceManagerFactory that the PersistenceManager was created with (can be null)
Returns:
whether the PersistenceManager is transactional

applyTransactionTimeout

public static void applyTransactionTimeout(javax.jdo.Query query,
                                           javax.jdo.PersistenceManagerFactory pmf,
                                           JdoDialect jdoDialect)
                                    throws javax.jdo.JDOException
Apply the current transaction timeout, if any, to the given JDO Query object.

Parameters:
query - the JDO Query object
pmf - JDO PersistenceManagerFactory that the Query was created for
jdoDialect - the JdoDialect to use for applying a query timeout (must not be null)
Throws:
javax.jdo.JDOException - if thrown by JDO methods
See Also:
JdoDialect.applyQueryTimeout(javax.jdo.Query, int)

convertJdoAccessException

public static DataAccessException convertJdoAccessException(javax.jdo.JDOException ex)
Convert the given JDOException to an appropriate exception from the org.springframework.dao hierarchy.

The most important cases like object not found or optimistic locking failure are covered here. For more fine-granular conversion, JdoAccessor and JdoTransactionManager support sophisticated translation of exceptions via a JdoDialect.

Parameters:
ex - JDOException that occured
Returns:
the corresponding DataAccessException instance
See Also:
JdoAccessor.convertJdoAccessException(javax.jdo.JDOException),
JdoTransactionManager.convertJdoAccessException(javax.jdo.JDOException),
JdoDialect.translateException(javax.jdo.JDOException)

releasePersistenceManager

public static void releasePersistenceManager(javax.jdo.PersistenceManager pm,
                                             javax.jdo.PersistenceManagerFactory pmf)
Close the given PersistenceManager, created via the given factory, if it is not managed externally (i.e. not bound to the thread).

Parameters:
pm - PersistenceManager to close
pmf - PersistenceManagerFactory that the PersistenceManager was created with (can be null)

doReleasePersistenceManager

public static void doReleasePersistenceManager(javax.jdo.PersistenceManager pm,
                                               javax.jdo.PersistenceManagerFactory pmf)
                                        throws javax.jdo.JDOException
Actually release a PersistenceManager for the given factory. Same as releasePersistenceManager, but throwing the original JDOException.

Parameters:
pm - PersistenceManager to close
pmf - PersistenceManagerFactory that the PersistenceManager was created with (can be null)
Throws:
javax.jdo.JDOException - if thrown by JDO methods
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PersistenceManagerHolder

org.springframework.orm.jdo
Class PersistenceManagerHolder

java.lang.Object
    extended by  org.springframework.transaction.support.ResourceHolderSupport
        extended by  org.springframework.orm.jdo.PersistenceManagerHolder
All Implemented Interfaces:
ResourceHolder
public class PersistenceManagerHolder
extends ResourceHolderSupport

Holder wrapping a JDO PersistenceManager. JdoTransactionManager binds instances of this class to the thread, for a given PersistenceManagerFactory.

Note: This is an SPI class, not intended to be used by applications.

Since:
03.06.2003
Author:
Juergen Hoeller
See Also:
JdoTransactionManager, PersistenceManagerFactoryUtils

Constructor Summary
PersistenceManagerHolder(javax.jdo.PersistenceManager persistenceManager)
Method Summary
void | clear() Clear the transactional state of this resource holder.
javax.jdo.PersistenceManager | getPersistenceManager()
protected boolean | isTransactionActive()
protected void | setTransactionActive(boolean transactionActive)
Methods inherited from class org.springframework.transaction.support.ResourceHolderSupport
getDeadline, getTimeToLiveInMillis, getTimeToLiveInSeconds, hasTimeout, isOpen, isRollbackOnly, isSynchronizedWithTransaction, isVoid, released, requested, reset, setRollbackOnly, setSynchronizedWithTransaction, setTimeoutInMillis, setTimeoutInSeconds, unbound
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PersistenceManagerHolder

public PersistenceManagerHolder(javax.jdo.PersistenceManager persistenceManager)
Method Detail

getPersistenceManager

public javax.jdo.PersistenceManager getPersistenceManager()

setTransactionActive

protected void setTransactionActive(boolean transactionActive)

isTransactionActive

protected boolean isTransactionActive()

clear

public void clear()
Description copied from class: ResourceHolderSupport
Clear the transactional state of this resource holder.

Overrides:
clear in class ResourceHolderSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionAwarePersistenceManagerFactoryProxy

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.orm.jdo
Class TransactionAwarePersistenceManagerFactoryProxy

java.lang.Object
    extended by  org.springframework.orm.jdo.TransactionAwarePersistenceManagerFactoryProxy
All Implemented Interfaces:
FactoryBean<javax.jdo.PersistenceManagerFactory>
public class TransactionAwarePersistenceManagerFactoryProxy
extends Object
implements FactoryBean<javax.jdo.PersistenceManagerFactory>

Proxy for a target JDO PersistenceManagerFactory, returning the current thread-bound PersistenceManager (the Spring-managed transactional PersistenceManager or the single OpenPersistenceManagerInView PersistenceManager) on getPersistenceManager(), if any.

Essentially, getPersistenceManager() calls get seamlessly forwarded to PersistenceManagerFactoryUtils.getPersistenceManager(javax.jdo.PersistenceManagerFactory, boolean). Furthermore, PersistenceManager.close calls get forwarded to PersistenceManagerFactoryUtils.releasePersistenceManager(javax.jdo.PersistenceManager, javax.jdo.PersistenceManagerFactory).

The main advantage of this proxy is that it allows DAOs to work with a plain JDO PersistenceManagerFactory reference, while still participating in Spring's (or a J2EE server's) resource and transaction management. DAOs will only rely on the JDO API in such a scenario, without any Spring dependencies.

Note that the behavior of this proxy matches the behavior that the JDO spec defines for a PersistenceManagerFactory as exposed by a JCA connector, when deployed in a J2EE server. Hence, DAOs could seamlessly switch between a JNDI PersistenceManagerFactory and this proxy for a local PersistenceManagerFactory, receiving the reference through Dependency Injection. This will work without any Spring API dependencies in the DAO code!

It is usually preferable to write your JDO-based DAOs with Spring's JdoTemplate, offering benefits such as consistent data access exceptions instead of JDOExceptions at the DAO layer. However, Spring's resource and transaction management (and Dependency Injection) will work for DAOs written against the plain JDO API as well.

Of course, you can still access the target PersistenceManagerFactory even when your DAOs go through this proxy, by defining a bean reference that points directly at your target PersistenceManagerFactory bean.

Since:
1.2
Author:
Juergen Hoeller
See Also:
PersistenceManagerFactory.getPersistenceManager(),
PersistenceManager.close(),
PersistenceManagerFactoryUtils.getPersistenceManager(javax.jdo.PersistenceManagerFactory, boolean),
PersistenceManagerFactoryUtils.releasePersistenceManager(javax.jdo.PersistenceManager, javax.jdo.PersistenceManagerFactory)

Constructor Summary
TransactionAwarePersistenceManagerFactoryProxy()
Method Summary
 javax.jdo.PersistenceManagerFactory getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<? extends javax.jdo.PersistenceManagerFactory> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 javax.jdo.PersistenceManagerFactory getTargetPersistenceManagerFactory()
Return the target JDO PersistenceManagerFactory that this proxy delegates to.
protected  boolean isAllowCreate()
Return whether the PersistenceManagerFactory proxy is allowed to create a non-transactional PersistenceManager when no transactional PersistenceManager can be found for the current thread.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setAllowCreate(boolean allowCreate)
Set whether the PersistenceManagerFactory proxy is allowed to create a non-transactional PersistenceManager when no transactional PersistenceManager can be found for the current thread.
 void setTargetPersistenceManagerFactory(javax.jdo.PersistenceManagerFactory target)
Set the target JDO PersistenceManagerFactory that this proxy should delegate to.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TransactionAwarePersistenceManagerFactoryProxy

public TransactionAwarePersistenceManagerFactoryProxy()
Method Detail

setTargetPersistenceManagerFactory

public void setTargetPersistenceManagerFactory(javax.jdo.PersistenceManagerFactory target)
Set the target JDO PersistenceManagerFactory that this proxy should delegate to. This should be the raw PersistenceManagerFactory, as accessed by JdoTransactionManager.

See Also:
JdoTransactionManager

getTargetPersistenceManagerFactory

public javax.jdo.PersistenceManagerFactory getTargetPersistenceManagerFactory()
Return the target JDO PersistenceManagerFactory that this proxy delegates to.

setAllowCreate

public void setAllowCreate(boolean allowCreate)
Set whether the PersistenceManagerFactory proxy is allowed to create a non-transactional PersistenceManager when no transactional PersistenceManager can be found for the current thread.

Default is "true". Can be turned off to enforce access to transactional PersistenceManagers, which safely allows for DAOs written to get a PersistenceManager without explicit closing (i.e. a PersistenceManagerFactory.getPersistenceManager() call without corresponding PersistenceManager.close() call).

See Also:
PersistenceManagerFactoryUtils.getPersistenceManager(javax.jdo.PersistenceManagerFactory, boolean)

isAllowCreate

protected boolean isAllowCreate()
Return whether the PersistenceManagerFactory proxy is allowed to create a non-transactional PersistenceManager when no transactional PersistenceManager can be found for the current thread.

getObject

public javax.jdo.PersistenceManagerFactory getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<javax.jdo.PersistenceManagerFactory>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends javax.jdo.PersistenceManagerFactory> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<javax.jdo.PersistenceManagerFactory>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<javax.jdo.PersistenceManagerFactory>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


JdoObjectRetrievalFailureException

org.springframework.orm.jdo
Class JdoObjectRetrievalFailureException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.DataRetrievalFailureException
                                extended by  org.springframework.orm.ObjectRetrievalFailureException
                                    extended by  org.springframework.orm.jdo.JdoObjectRetrievalFailureException
All Implemented Interfaces:
Serializable
public class JdoObjectRetrievalFailureException
extends ObjectRetrievalFailureException

JDO-specific subclass of ObjectRetrievalFailureException. Converts JDO's JDOObjectNotFoundException.

Since:
1.1
Author:
Juergen Hoeller
See Also:
PersistenceManagerFactoryUtils.convertJdoAccessException(javax.jdo.JDOException), Serialized Form

Constructor Summary
JdoObjectRetrievalFailureException(javax.jdo.JDOObjectNotFoundException ex)
Method Summary
Methods inherited from class org.springframework.orm.ObjectRetrievalFailureException
getIdentifier, getPersistentClass, getPersistentClassName
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

JdoObjectRetrievalFailureException

public JdoObjectRetrievalFailureException(javax.jdo.JDOObjectNotFoundException ex)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JdoOptimisticLockingFailureException

org.springframework.orm.jdo
Class JdoOptimisticLockingFailureException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.TransientDataAccessException
                            extended by  org.springframework.dao.ConcurrencyFailureException
                                extended by  org.springframework.dao.OptimisticLockingFailureException
                                    extended by  org.springframework.orm.ObjectOptimisticLockingFailureException
                                        extended by  org.springframework.orm.jdo.JdoOptimisticLockingFailureException
All Implemented Interfaces:
Serializable
public class JdoOptimisticLockingFailureException
extends ObjectOptimisticLockingFailureException

JDO-specific subclass of ObjectOptimisticLockingFailureException. Converts JDO's JDOOptimisticVerificationException.

Since:
1.1
Author:
Juergen Hoeller
See Also:
PersistenceManagerFactoryUtils.convertJdoAccessException(javax.jdo.JDOException), Serialized Form

Constructor Summary
JdoOptimisticLockingFailureException(javax.jdo.JDOOptimisticVerificationException ex)
Method Summary
Methods inherited from class org.springframework.orm.ObjectOptimisticLockingFailureException
getIdentifier, getPersistentClass, getPersistentClassName
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

JdoOptimisticLockingFailureException

public JdoOptimisticLockingFailureException(javax.jdo.JDOOptimisticVerificationException ex)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JdoResourceFailureException

org.springframework.orm.jdo
Class JdoResourceFailureException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.NonTransientDataAccessResourceException
                                extended by  org.springframework.dao.DataAccessResourceFailureException
                                    extended by  org.springframework.orm.jdo.JdoResourceFailureException
All Implemented Interfaces:
Serializable
public class JdoResourceFailureException
extends DataAccessResourceFailureException

JDO-specific subclass of DataAccessResourceFailureException. Converts JDO's JDODataStoreException and JDOFatalDataStoreException.

Since:
1.1
Author:
Juergen Hoeller
See Also:
PersistenceManagerFactoryUtils.convertJdoAccessException(javax.jdo.JDOException), Serialized Form

Constructor Summary
JdoResourceFailureException(javax.jdo.JDODataStoreException ex)
JdoResourceFailureException(javax.jdo.JDOFatalDataStoreException ex)
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

JdoResourceFailureException

public JdoResourceFailureException(javax.jdo.JDODataStoreException ex)

JdoResourceFailureException

public JdoResourceFailureException(javax.jdo.JDOFatalDataStoreException ex)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JdoSystemException

org.springframework.orm.jdo
Class JdoSystemException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.UncategorizedDataAccessException
                                extended by  org.springframework.orm.jdo.JdoSystemException
All Implemented Interfaces:
Serializable
public class JdoSystemException
extends UncategorizedDataAccessException

JDO-specific subclass of UncategorizedDataAccessException, for JDO system errors that do not match any concrete org.springframework.dao exceptions.

Since:
03.06.2003
Author:
Juergen Hoeller
See Also:
PersistenceManagerFactoryUtils.convertJdoAccessException(javax.jdo.JDOException), Serialized Form

Constructor Summary
JdoSystemException(javax.jdo.JDOException ex)
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

JdoSystemException

public JdoSystemException(javax.jdo.JDOException ex)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JdoUsageException

org.springframework.orm.jdo
Class JdoUsageException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.InvalidDataAccessApiUsageException
                                extended by  org.springframework.orm.jdo.JdoUsageException
All Implemented Interfaces:
Serializable
public class JdoUsageException
extends InvalidDataAccessApiUsageException

JDO-specific subclass of InvalidDataAccessApiUsageException. Converts JDO's JDOUserException and JDOFatalUserException.

Since:
03.06.2003
Author:
Juergen Hoeller
See Also:
PersistenceManagerFactoryUtils.convertJdoAccessException(javax.jdo.JDOException), Serialized Form

Constructor Summary
JdoUsageException(javax.jdo.JDOFatalUserException ex)
JdoUsageException(javax.jdo.JDOUserException ex)
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

JdoUsageException

public JdoUsageException(javax.jdo.JDOUserException ex)

JdoUsageException

public JdoUsageException(javax.jdo.JDOFatalUserException ex)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.orm.jdo.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.orm.jdo.support

Classes supporting the org.springframework.orm.jdo package.

See:
Description

Class Summary
JdoDaoSupport | Convenient super class for JDO data access objects.
OpenPersistenceManagerInViewFilter | Servlet 2.3 Filter that binds a JDO PersistenceManager to the thread for the entire processing of the request.
OpenPersistenceManagerInViewInterceptor | Spring web request interceptor that binds a JDO PersistenceManager to the thread for the entire processing of the request.
SpringPersistenceManagerProxyBean | Proxy that implements the PersistenceManager interface, delegating to the current thread-bound PersistenceManager (the Spring-managed transactional PersistenceManager or the single OpenPersistenceManagerInView PersistenceManager, if any) on each invocation.
StandardPersistenceManagerProxyBean | Proxy that implements the PersistenceManager interface, delegating to a thread-bound PersistenceManager on each invocation - as defined by the JDO 2.1 specification.

Package org.springframework.orm.jdo.support Description

Classes supporting the org.springframework.orm.jdo package. Contains a DAO base class for JdoTemplate usage.


org.springframework.orm.jdo.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.orm.jdo.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.dao.support.DaoSupport (implements org.springframework.beans.factory.InitializingBean)
      • org.springframework.orm.jdo.support.JdoDaoSupport
    • org.springframework.web.filter.GenericFilterBean (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, javax.servlet.Filter, org.springframework.beans.factory.InitializingBean, org.springframework.web.context.ServletContextAware)
      • org.springframework.web.filter.OncePerRequestFilter
        • org.springframework.orm.jdo.support.OpenPersistenceManagerInViewFilter
    • org.springframework.orm.jdo.JdoAccessor (implements org.springframework.beans.factory.InitializingBean)
      • org.springframework.orm.jdo.support.SpringPersistenceManagerProxyBean (implements org.springframework.beans.factory.FactoryBean<T>)
    • org.springframework.orm.jdo.support.OpenPersistenceManagerInViewInterceptor (implements org.springframework.web.context.request.WebRequestInterceptor)
    • org.springframework.orm.jdo.support.StandardPersistenceManagerProxyBean (implements org.springframework.beans.factory.FactoryBean<T>)


JdoDaoSupport

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.orm.jdo.support
Class JdoDaoSupport

java.lang.Object
    extended by  org.springframework.dao.support.DaoSupport
        extended by  org.springframework.orm.jdo.support.JdoDaoSupport
All Implemented Interfaces:
InitializingBean
public abstract class JdoDaoSupport
extends DaoSupport

Convenient super class for JDO data access objects.

Requires a PersistenceManagerFactory to be set, providing a JdoTemplate based on it to subclasses. Can alternatively be initialized directly with a JdoTemplate, to reuse the latter's settings such as the PersistenceManagerFactory, JdoDialect, flush mode, etc.

This base class is mainly intended for JdoTemplate usage but can also be used when working with PersistenceManagerFactoryUtils directly, for example in combination with JdoInterceptor-managed PersistenceManagers. Convenience getPersistenceManager and releasePersistenceManager methods are provided for that usage style.

This class will create its own JdoTemplate if only a PersistenceManagerFactory is passed in. The "allowCreate" flag on that JdoTemplate will be "true" by default. A custom JdoTemplate instance can be used through overriding createJdoTemplate.

Since:
28.07.2003
Author:
Juergen Hoeller
See Also:
setPersistenceManagerFactory(javax.jdo.PersistenceManagerFactory),
setJdoTemplate(org.springframework.orm.jdo.JdoTemplate),
createJdoTemplate(javax.jdo.PersistenceManagerFactory),
getPersistenceManager(),
releasePersistenceManager(javax.jdo.PersistenceManager),
JdoTemplate,
JdoInterceptor

Field Summary
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
Constructor Summary
JdoDaoSupport()
Method Summary
protected void | checkDaoConfig() Abstract subclasses must override this to check their configuration.
protected DataAccessException | convertJdoAccessException(javax.jdo.JDOException ex) Convert the given JDOException to an appropriate exception from the org.springframework.dao hierarchy.
protected JdoTemplate | createJdoTemplate(javax.jdo.PersistenceManagerFactory persistenceManagerFactory) Create a JdoTemplate for the given PersistenceManagerFactory.
JdoTemplate | getJdoTemplate() Return the JdoTemplate for this DAO, pre-initialized with the PersistenceManagerFactory or set explicitly.
protected javax.jdo.PersistenceManager | getPersistenceManager() Get a JDO PersistenceManager, either from the current transaction or a new one.
protected javax.jdo.PersistenceManager | getPersistenceManager(boolean allowCreate) Get a JDO PersistenceManager, either from the current transaction or a new one.
javax.jdo.PersistenceManagerFactory | getPersistenceManagerFactory() Return the JDO PersistenceManagerFactory used by this DAO.
protected void | releasePersistenceManager(javax.jdo.PersistenceManager pm) Close the given JDO PersistenceManager, created via this DAO's PersistenceManagerFactory, if it isn't bound to the thread.
void | setJdoTemplate(JdoTemplate jdoTemplate) Set the JdoTemplate for this DAO explicitly, as an alternative to specifying a PersistenceManagerFactory.
void | setPersistenceManagerFactory(javax.jdo.PersistenceManagerFactory persistenceManagerFactory) Set the JDO PersistenceManagerFactory to be used by this DAO.
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JdoDaoSupport

public JdoDaoSupport()
Method Detail

setPersistenceManagerFactory

public final void setPersistenceManagerFactory(javax.jdo.PersistenceManagerFactory persistenceManagerFactory)
Set the JDO PersistenceManagerFactory to be used by this DAO. Will automatically create a JdoTemplate for the given PersistenceManagerFactory.

See Also:
createJdoTemplate(javax.jdo.PersistenceManagerFactory), setJdoTemplate(org.springframework.orm.jdo.JdoTemplate)

createJdoTemplate

protected JdoTemplate createJdoTemplate(javax.jdo.PersistenceManagerFactory persistenceManagerFactory)
Create a JdoTemplate for the given PersistenceManagerFactory. Only invoked if populating the DAO with a PersistenceManagerFactory reference!

Can be overridden in subclasses to provide a JdoTemplate instance with different configuration, or a custom JdoTemplate subclass.

Parameters:
persistenceManagerFactory - the JDO PersistenceManagerFactoryto create a JdoTemplate for
Returns:
the new JdoTemplate instance
See Also:
setPersistenceManagerFactory(javax.jdo.PersistenceManagerFactory)

getPersistenceManagerFactory

public final javax.jdo.PersistenceManagerFactory getPersistenceManagerFactory()
Return the JDO PersistenceManagerFactory used by this DAO.

setJdoTemplate

public final void setJdoTemplate(JdoTemplate jdoTemplate)
Set the JdoTemplate for this DAO explicitly, as an alternative to specifying a PersistenceManagerFactory.

See Also:
setPersistenceManagerFactory(javax.jdo.PersistenceManagerFactory)

getJdoTemplate

public final JdoTemplate getJdoTemplate()
Return the JdoTemplate for this DAO, pre-initialized with the PersistenceManagerFactory or set explicitly.

checkDaoConfig

protected final void checkDaoConfig()
Description copied from class: DaoSupport
Abstract subclasses must override this to check their configuration.

Implementors should be marked as final

Specified by:
checkDaoConfig in class DaoSupport

getPersistenceManager

protected final javax.jdo.PersistenceManager getPersistenceManager()
Get a JDO PersistenceManager, either from the current transaction or a new one. The latter is only allowed if the "allowCreate" setting of this bean's JdoTemplate is true.

Returns:
the JDO PersistenceManager
Throws:
DataAccessResourceFailureException - if the PersistenceManager couldn't be created
IllegalStateException - if no thread-bound PersistenceManager found and allowCreate false
See Also:
PersistenceManagerFactoryUtils.getPersistenceManager(javax.jdo.PersistenceManagerFactory, boolean)

getPersistenceManager

protected final javax.jdo.PersistenceManager getPersistenceManager(boolean allowCreate)
                                                            throws DataAccessResourceFailureException,
                                                                   IllegalStateException
Get a JDO PersistenceManager, either from the current transaction or a new one. The latter is only allowed if "allowCreate" is true.

Parameters:
allowCreate - if a non-transactional PersistenceManager should be created when no transactional PersistenceManager can be found for the current thread
Returns:
the JDO PersistenceManager
Throws:
DataAccessResourceFailureException - if the PersistenceManager couldn't be created
IllegalStateException - if no thread-bound PersistenceManager found and allowCreate false
See Also:
PersistenceManagerFactoryUtils.getPersistenceManager(javax.jdo.PersistenceManagerFactory, boolean)

convertJdoAccessException

protected final DataAccessException convertJdoAccessException(javax.jdo.JDOException ex)
Convert the given JDOException to an appropriate exception from the org.springframework.dao hierarchy.

Delegates to the convertJdoAccessException method of this DAO's JdoTemplate.

Parameters:
ex - JDOException that occured
Returns:
the corresponding DataAccessException instance
See Also:
setJdoTemplate(org.springframework.orm.jdo.JdoTemplate), JdoAccessor.convertJdoAccessException(javax.jdo.JDOException)

releasePersistenceManager

protected final void releasePersistenceManager(javax.jdo.PersistenceManager pm)
Close the given JDO PersistenceManager, created via this DAO's PersistenceManagerFactory, if it isn't bound to the thread.

Parameters:
pm - PersistenceManager to close
See Also:
PersistenceManagerFactoryUtils.releasePersistenceManager(javax.jdo.PersistenceManager, javax.jdo.PersistenceManagerFactory)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


OpenPersistenceManagerInViewFilter

org.springframework.orm.jdo.support
Class OpenPersistenceManagerInViewFilter

java.lang.Object
    extended by  org.springframework.web.filter.GenericFilterBean
        extended by  org.springframework.web.filter.OncePerRequestFilter
            extended by  org.springframework.orm.jdo.support.OpenPersistenceManagerInViewFilter
All Implemented Interfaces:
Filter, BeanNameAware, DisposableBean, InitializingBean, ServletContextAware
public class OpenPersistenceManagerInViewFilter
extends OncePerRequestFilter

Servlet 2.3 Filter that binds a JDO PersistenceManager to the thread for the entire processing of the request. Intended for the "Open PersistenceManager in View" pattern, i.e. to allow for lazy loading in web views despite the original transactions already being completed.

This filter makes JDO PersistenceManagers available via the current thread, which will be autodetected by transaction managers. It is suitable for service layer transactions via JdoTransactionManager or JtaTransactionManager as well as for non-transactional read-only execution.

Looks up the PersistenceManagerFactory in Spring's root web application context. Supports a "persistenceManagerFactoryBeanName" filter init-param in web.xml; the default bean name is "persistenceManagerFactory". Looks up the PersistenceManagerFactory on each request, to avoid initialization order issues (when using ContextLoaderServlet, the root application context will get initialized after this filter).

Since:
1.1
Author:
Juergen Hoeller
See Also:
OpenPersistenceManagerInViewInterceptor, JdoInterceptor, JdoTransactionManager, PersistenceManagerFactoryUtils.getPersistenceManager(javax.jdo.PersistenceManagerFactory, boolean), TransactionSynchronizationManager

Field Summary
static String DEFAULT_PERSISTENCE_MANAGER_FACTORY_BEAN_NAME
Fields inherited from class org.springframework.web.filter.OncePerRequestFilter
ALREADY_FILTERED_SUFFIX
Fields inherited from class org.springframework.web.filter.GenericFilterBean
logger
Constructor Summary
OpenPersistenceManagerInViewFilter()
Method Summary
protected void | doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) Same contract as for doFilter, but guaranteed to be just invoked once per request.
protected String | getPersistenceManagerFactoryBeanName() Return the bean name of the PersistenceManagerFactory to fetch from Spring's root application context.
protected javax.jdo.PersistenceManagerFactory | lookupPersistenceManagerFactory() Look up the PersistenceManagerFactory that this filter should use.
protected javax.jdo.PersistenceManagerFactory | lookupPersistenceManagerFactory(HttpServletRequest request) Look up the PersistenceManagerFactory that this filter should use, taking the current HTTP request as argument.
void | setPersistenceManagerFactoryBeanName(String persistenceManagerFactoryBeanName) Set the bean name of the PersistenceManagerFactory to fetch from Spring's root application context.
Methods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, getAlreadyFilteredAttributeName, shouldNotFilter
Methods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setServletContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_PERSISTENCE_MANAGER_FACTORY_BEAN_NAME

public static final String DEFAULT_PERSISTENCE_MANAGER_FACTORY_BEAN_NAME
See Also:
Constant Field Values
Constructor Detail

OpenPersistenceManagerInViewFilter

public OpenPersistenceManagerInViewFilter()
Method Detail

setPersistenceManagerFactoryBeanName

public void setPersistenceManagerFactoryBeanName(String persistenceManagerFactoryBeanName)
Set the bean name of the PersistenceManagerFactory to fetch from Spring's root application context. Default is "persistenceManagerFactory".

See Also:
DEFAULT_PERSISTENCE_MANAGER_FACTORY_BEAN_NAME

getPersistenceManagerFactoryBeanName

protected String getPersistenceManagerFactoryBeanName()
Return the bean name of the PersistenceManagerFactory to fetch from Spring's root application context.

doFilterInternal

protected void doFilterInternal(HttpServletRequest request,
                                HttpServletResponse response,
                                FilterChain filterChain)
                         throws ServletException,
                                IOException
Description copied from class: OncePerRequestFilter
Same contract as for doFilter, but guaranteed to be just invoked once per request. Provides HttpServletRequest and HttpServletResponse arguments instead of the default ServletRequest and ServletResponse ones.

Specified by:
doFilterInternal in class OncePerRequestFilter
Throws:
ServletException
IOException

lookupPersistenceManagerFactory

protected javax.jdo.PersistenceManagerFactory lookupPersistenceManagerFactory(HttpServletRequest request)
Look up the PersistenceManagerFactory that this filter should use, taking the current HTTP request as argument.

Default implementation delegates to the lookupPersistenceManagerFactory without arguments.

Returns:
the PersistenceManagerFactory to use
See Also:
lookupPersistenceManagerFactory()

lookupPersistenceManagerFactory

protected javax.jdo.PersistenceManagerFactory lookupPersistenceManagerFactory()
Look up the PersistenceManagerFactory that this filter should use. The default implementation looks for a bean with the specified name in Spring's root application context.

Returns:
the PersistenceManagerFactory to use
See Also:
getPersistenceManagerFactoryBeanName()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OpenPersistenceManagerInViewInterceptor

org.springframework.orm.jdo.support
Class OpenPersistenceManagerInViewInterceptor

java.lang.Object
    extended by  org.springframework.orm.jdo.support.OpenPersistenceManagerInViewInterceptor
All Implemented Interfaces:
WebRequestInterceptor
public class OpenPersistenceManagerInViewInterceptor
extends Object
implements WebRequestInterceptor

Spring web request interceptor that binds a JDO PersistenceManager to the thread for the entire processing of the request. Intended for the "Open PersistenceManager in View" pattern, i.e. to allow for lazy loading in web views despite the original transactions already being completed.

This interceptor makes JDO PersistenceManagers available via the current thread, which will be autodetected by transaction managers. It is suitable for service layer transactions via JdoTransactionManager or JtaTransactionManager as well as for non-transactional read-only execution.

In contrast to OpenPersistenceManagerInViewFilter, this interceptor is set up in a Spring application context and can thus take advantage of bean wiring. It inherits common JDO configuration properties from JdoAccessor, to be configured in a bean definition.

Since:
1.1
Author:
Juergen Hoeller
See Also:
OpenPersistenceManagerInViewFilter, JdoInterceptor, JdoTransactionManager, PersistenceManagerFactoryUtils.getPersistenceManager(javax.jdo.PersistenceManagerFactory, boolean), TransactionSynchronizationManager

Field Summary
protected Log | logger
static String | PARTICIPATE_SUFFIX Suffix that gets appended to the PersistenceManagerFactory toString representation for the "participate in existing persistence manager handling" request attribute.
Constructor Summary
OpenPersistenceManagerInViewInterceptor()
Method Summary
void | afterCompletion(WebRequest request, Exception ex) Callback after completion of request processing, that is, after rendering the view.
protected String | getParticipateAttributeName() Return the name of the request attribute that identifies that a request is already filtered.
javax.jdo.PersistenceManagerFactory | getPersistenceManagerFactory() Return the JDO PersistenceManagerFactory that should be used to create PersistenceManagers.
void | postHandle(WebRequest request, ModelMap model) Intercept the execution of a request handler after its successful invocation, right before view rendering (if any).
void | preHandle(WebRequest request) Intercept the execution of a request handler before its invocation.
void | setPersistenceManagerFactory(javax.jdo.PersistenceManagerFactory pmf) Set the JDO PersistenceManagerFactory that should be used to create PersistenceManagers.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

PARTICIPATE_SUFFIX

public static final String PARTICIPATE_SUFFIX
Suffix that gets appended to the PersistenceManagerFactory toString representation for the "participate in existing persistence manager handling" request attribute.

See Also:
getParticipateAttributeName(), Constant Field Values

logger

protected final Log logger
Constructor Detail

OpenPersistenceManagerInViewInterceptor

public OpenPersistenceManagerInViewInterceptor()
Method Detail

setPersistenceManagerFactory

public void setPersistenceManagerFactory(javax.jdo.PersistenceManagerFactory pmf)
Set the JDO PersistenceManagerFactory that should be used to create PersistenceManagers.

getPersistenceManagerFactory

public javax.jdo.PersistenceManagerFactory getPersistenceManagerFactory()
Return the JDO PersistenceManagerFactory that should be used to create PersistenceManagers.

preHandle

public void preHandle(WebRequest request)
               throws DataAccessException
Description copied from interface: WebRequestInterceptor
Intercept the execution of a request handler before its invocation.

Allows for preparing context resources (such as a Hibernate Session) and expose them as request attributes or as thread-local objects.

Specified by:
preHandle in interface WebRequestInterceptor
Parameters:
request - the current web request
Throws:
DataAccessException

postHandle

public void postHandle(WebRequest request,
                       ModelMap model)
Description copied from interface: WebRequestInterceptor
Intercept the execution of a request handler after its successful invocation, right before view rendering (if any).

Allows for modifying context resources after successful handler execution (for example, flushing a Hibernate Session).

Specified by:
postHandle in interface WebRequestInterceptor
Parameters:
request - the current web request
model - the map of model objects that will be exposed to the view (may be null). Can be used to analyze the exposed model and/or to add further model attributes, if desired.

afterCompletion

public void afterCompletion(WebRequest request,
                            Exception ex)
                     throws DataAccessException
Description copied from interface: WebRequestInterceptor
Callback after completion of request processing, that is, after rendering the view. Will be called on any outcome of handler execution, thus allows for proper resource cleanup.

Note: Will only be called if this interceptor's preHandle method has successfully completed!

Specified by:
afterCompletion in interface WebRequestInterceptor
Parameters:
request - the current web request
ex - exception thrown on handler execution, if any
Throws:
DataAccessException

getParticipateAttributeName

protected String getParticipateAttributeName()
Return the name of the request attribute that identifies that a request is already filtered. Default implementation takes the toString representation of the PersistenceManagerFactory instance and appends ".FILTERED".

See Also:
PARTICIPATE_SUFFIX
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SpringPersistenceManagerProxyBean

org.springframework.orm.jdo.support
Class SpringPersistenceManagerProxyBean

java.lang.Object
    extended by  org.springframework.orm.jdo.JdoAccessor
        extended by  org.springframework.orm.jdo.support.SpringPersistenceManagerProxyBean
All Implemented Interfaces:
FactoryBean<javax.jdo.PersistenceManager>, InitializingBean
public class SpringPersistenceManagerProxyBean
extends JdoAccessor
implements FactoryBean<javax.jdo.PersistenceManager>

Proxy that implements the PersistenceManager interface, delegating to the current thread-bound PersistenceManager (the Spring-managed transactional PersistenceManager or the single OpenPersistenceManagerInView PersistenceManager, if any) on each invocation. This class makes such a Spring-style PersistenceManager proxy available for bean references.

The main advantage of this proxy is that it allows DAOs to work with a plain JDO PersistenceManager reference in JDO 2.1 style (see PersistenceManagerFactory.getPersistenceManagerProxy()), while still participating in Spring's resource and transaction management.

The behavior of this proxy matches the behavior that the JDO 2.1 spec defines for a PersistenceManager proxy. Hence, DAOs could seamlessly switch between StandardPersistenceManagerProxyBean and this Spring-style proxy, receiving the reference through Dependency Injection. This will work without any Spring API dependencies in the DAO code!

Note: In contrast to StandardPersistenceManagerProxyBean, this proxy works with JDO 2.0 and higher. It does not require JDO 2.1.

Since:
3.0
Author:
Juergen Hoeller
See Also:
StandardPersistenceManagerProxyBean,
PersistenceManagerFactory.getPersistenceManagerProxy(),
PersistenceManagerFactoryUtils.getPersistenceManager(javax.jdo.PersistenceManagerFactory, boolean),
PersistenceManagerFactoryUtils.releasePersistenceManager(javax.jdo.PersistenceManager, javax.jdo.PersistenceManagerFactory)

Field Summary
Fields inherited from class org.springframework.orm.jdo.JdoAccessor
logger
Constructor Summary
SpringPersistenceManagerProxyBean()
Method Summary
 void afterPropertiesSet()
Eagerly initialize the JDO dialect, creating a default one for the specified PersistenceManagerFactory if none set.
 javax.jdo.PersistenceManager getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<? extends javax.jdo.PersistenceManager> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
protected  Class<? extends javax.jdo.PersistenceManager> getPersistenceManagerInterface()
Return the PersistenceManager interface to expose.
protected  boolean isAllowCreate()
Return whether the PersistenceManagerFactory proxy is allowed to create a non-transactional PersistenceManager when no transactional PersistenceManager can be found for the current thread.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setAllowCreate(boolean allowCreate)
Set whether the PersistenceManagerFactory proxy is allowed to create a non-transactional PersistenceManager when no transactional PersistenceManager can be found for the current thread.
 void setPersistenceManagerInterface(Class<? extends javax.jdo.PersistenceManager> persistenceManagerInterface)
Specify the PersistenceManager interface to expose, possibly including vendor extensions.
Methods inherited from class org.springframework.orm.jdo.JdoAccessor
convertJdoAccessException, flushIfNecessary, getJdoDialect, getPersistenceManagerFactory, isFlushEager, setFlushEager, setJdoDialect, setPersistenceManagerFactory
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SpringPersistenceManagerProxyBean

public SpringPersistenceManagerProxyBean()
Method Detail

setPersistenceManagerInterface

public void setPersistenceManagerInterface(Class<? extends javax.jdo.PersistenceManager> persistenceManagerInterface)
Specify the PersistenceManager interface to expose, possibly including vendor extensions.

Default is the standard javax.jdo.PersistenceManager interface.

getPersistenceManagerInterface

protected Class<? extends javax.jdo.PersistenceManager> getPersistenceManagerInterface()
Return the PersistenceManager interface to expose.

setAllowCreate

public void setAllowCreate(boolean allowCreate)
Set whether the PersistenceManagerFactory proxy is allowed to create a non-transactional PersistenceManager when no transactional PersistenceManager can be found for the current thread.

Default is "true". Can be turned off to enforce access to transactional PersistenceManagers, which safely allows for DAOs written to get a PersistenceManager without explicit closing (i.e. a PersistenceManagerFactory.getPersistenceManager() call without corresponding PersistenceManager.close() call).

See Also:
PersistenceManagerFactoryUtils.getPersistenceManager(javax.jdo.PersistenceManagerFactory, boolean)

isAllowCreate

protected boolean isAllowCreate()
Return whether the PersistenceManagerFactory proxy is allowed to create a non-transactional PersistenceManager when no transactional PersistenceManager can be found for the current thread.

afterPropertiesSet

public void afterPropertiesSet()
Description copied from class: JdoAccessor
Eagerly initialize the JDO dialect, creating a default one for the specified PersistenceManagerFactory if none set.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class JdoAccessor

getObject

public javax.jdo.PersistenceManager getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<javax.jdo.PersistenceManager>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends javax.jdo.PersistenceManager> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<javax.jdo.PersistenceManager>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<javax.jdo.PersistenceManager>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StandardPersistenceManagerProxyBean

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.orm.jdo.support
Class StandardPersistenceManagerProxyBean

java.lang.Object
    extended by  org.springframework.orm.jdo.support.StandardPersistenceManagerProxyBean
All Implemented Interfaces:
FactoryBean<javax.jdo.PersistenceManager>
public class StandardPersistenceManagerProxyBean
extends Object
implements FactoryBean<javax.jdo.PersistenceManager>

Proxy that implements the PersistenceManager interface, delegating to a thread-bound PersistenceManager on each invocation - as defined by the JDO 2.1 specification. This class makes such a standard JDO PersistenceManager proxy available for bean references.

The main advantage of this proxy is that it allows DAOs to work with a plain JDO PersistenceManager reference in JDO 2.1 style (see PersistenceManagerFactory.getPersistenceManagerProxy()), exposing the exact behavior that the target JDO provider implements.

Note: This proxy requires JDO 2.1 or higher.

Since:
3.0
Author:
Juergen Hoeller
See Also:
SpringPersistenceManagerProxyBean, PersistenceManagerFactory.getPersistenceManagerProxy()

Constructor Summary
StandardPersistenceManagerProxyBean()
Method Summary
 javax.jdo.PersistenceManager getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<? extends javax.jdo.PersistenceManager> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setPersistenceManagerFactory(javax.jdo.PersistenceManagerFactory pmf)
Set the target JDO PersistenceManagerFactory that this proxy should delegate to.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

StandardPersistenceManagerProxyBean

public StandardPersistenceManagerProxyBean()
Method Detail

setPersistenceManagerFactory

public void setPersistenceManagerFactory(javax.jdo.PersistenceManagerFactory pmf)
Set the target JDO PersistenceManagerFactory that this proxy should delegate to. This should be the raw PersistenceManagerFactory, as accessed by JdoTransactionManager.

See Also:
JdoTransactionManager

getObject

public javax.jdo.PersistenceManager getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<javax.jdo.PersistenceManager>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends javax.jdo.PersistenceManager> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<javax.jdo.PersistenceManager>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<javax.jdo.PersistenceManager>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.orm.jpa

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.orm.jpa

Package providing integration of JPA (Java Persistence API) with Spring concepts.

See:
Description

Interface Summary
EntityManagerFactoryInfo | Metadata interface for a Spring-managed JPA EntityManagerFactory.
EntityManagerFactoryPlus | Extension of the standard JPA EntityManagerFactory interface, linking in Spring's EntityManagerFactoryPlusOperations interface which defines additional operations (beyond JPA 1.0) in a vendor-independent fashion.
EntityManagerFactoryPlusOperations | Interface that defines common operations beyond the standard JPA EntityManagerFactory interface, in a vendor-independent fashion.
EntityManagerPlus | Extension of the standard JPA EntityManager interface, linking in Spring's EntityManagerPlusOperations interface which defines additional operations (beyond JPA 1.0) in a vendor-independent fashion.
EntityManagerPlusOperations | Interface that defines common operations beyond the standard JPA EntityManager interface, in a vendor-independent fashion.
EntityManagerProxy | Subinterface of EntityManager to be implemented by EntityManager proxies.
JpaCallback<T> | Callback interface for JPA code.
JpaDialect | SPI strategy that encapsulates certain functionality that standard JPA 1.0 does not offer, such as access to the underlying JDBC Connection.
JpaOperations | Interface that specifies a basic set of JPA operations, implemented by JpaTemplate.
JpaVendorAdapter | SPI interface that allows to plug in vendor-specific behavior into Spring's EntityManagerFactory creators.

Class Summary
AbstractEntityManagerFactoryBean | Abstract FactoryBean that creates a local JPA EntityManagerFactory instance within a Spring application context.
DefaultJpaDialect | Default implementation of the JpaDialect interface.
EntityManagerFactoryAccessor | Base class for any class that needs to access an EntityManagerFactory, usually in order to obtain an EntityManager.
EntityManagerFactoryUtils | Helper class featuring methods for JPA EntityManager handling, allowing for reuse of EntityManager instances within transactions.
EntityManagerHolder | Holder wrapping a JPA EntityManager.
ExtendedEntityManagerCreator | Factory for dynamic EntityManager proxies that follow the JPA spec's semantics for "extended" EntityManagers.
JpaAccessor | Base class for JpaTemplate and JpaInterceptor, defining common properties such as EntityManagerFactory and flushing behavior.
JpaInterceptor | This interceptor binds a new JPA EntityManager to the thread before a method call, closing and removing it afterwards in case of any method outcome.
JpaTemplate | Helper class that allows for writing JPA data access code in the same style as with Spring's well-known JdoTemplate and HibernateTemplate classes.
JpaTransactionManager | PlatformTransactionManager implementation for a single JPA EntityManagerFactory.
LocalContainerEntityManagerFactoryBean | FactoryBean that creates a JPA EntityManagerFactory according to JPA's standard container bootstrap contract.
LocalEntityManagerFactoryBean | FactoryBean that creates a JPA EntityManagerFactory according to JPA's standard standalone bootstrap contract.
SharedEntityManagerCreator | Factory for a shareable JPA EntityManager for a given EntityManagerFactory.

Exception Summary
JpaObjectRetrievalFailureException | JPA-specific subclass of ObjectRetrievalFailureException.
JpaOptimisticLockingFailureException | JPA-specific subclass of ObjectOptimisticLockingFailureException.
JpaSystemException | JPA-specific subclass of UncategorizedDataAccessException, for JPA system errors that do not match any concrete org.springframework.dao exceptions.

Package org.springframework.orm.jpa Description

Package providing integration of JPA (Java Persistence API) with Spring concepts. Contains EntityManagerFactory helper classes, a template plus callback for JPA access, and an implementation of Spring's transaction SPI for local JPA transactions.


org.springframework.orm.jpa Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.orm.jpa

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.orm.jpa.AbstractEntityManagerFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.orm.jpa.EntityManagerFactoryInfo, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean, org.springframework.dao.support.PersistenceExceptionTranslator, java.io.Serializable)
      • org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean (implements org.springframework.context.weaving.LoadTimeWeaverAware, org.springframework.context.ResourceLoaderAware)
      • org.springframework.orm.jpa.LocalEntityManagerFactoryBean
    • org.springframework.transaction.support.AbstractPlatformTransactionManager (implements org.springframework.transaction.PlatformTransactionManager, java.io.Serializable)
      • org.springframework.orm.jpa.JpaTransactionManager (implements org.springframework.beans.factory.InitializingBean, org.springframework.transaction.support.ResourceTransactionManager)
    • org.springframework.orm.jpa.DefaultJpaDialect (implements org.springframework.orm.jpa.JpaDialect, java.io.Serializable)
    • org.springframework.orm.jpa.EntityManagerFactoryAccessor
      • org.springframework.orm.jpa.JpaAccessor (implements org.springframework.beans.factory.InitializingBean)
        • org.springframework.orm.jpa.JpaInterceptor (implements org.aopalliance.intercept.MethodInterceptor)
        • org.springframework.orm.jpa.JpaTemplate (implements org.springframework.orm.jpa.JpaOperations)
    • org.springframework.orm.jpa.EntityManagerFactoryUtils
    • org.springframework.orm.jpa.ExtendedEntityManagerCreator
    • org.springframework.transaction.support.ResourceHolderSupport (implements org.springframework.transaction.support.ResourceHolder)
      • org.springframework.orm.jpa.EntityManagerHolder
    • org.springframework.orm.jpa.SharedEntityManagerCreator
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.dao.DataAccessException
              • org.springframework.dao.NonTransientDataAccessException
                • org.springframework.dao.DataRetrievalFailureException
                  • org.springframework.orm.ObjectRetrievalFailureException
                    • org.springframework.orm.jpa.JpaObjectRetrievalFailureException
                • org.springframework.dao.UncategorizedDataAccessException
                  • org.springframework.orm.jpa.JpaSystemException
              • org.springframework.dao.TransientDataAccessException
                • org.springframework.dao.ConcurrencyFailureException
                  • org.springframework.dao.OptimisticLockingFailureException
                    • org.springframework.orm.ObjectOptimisticLockingFailureException
                      • org.springframework.orm.jpa.JpaOptimisticLockingFailureException

Interface Hierarchy

  • javax.persistence.EntityManager
    • org.springframework.orm.jpa.EntityManagerPlus (also extends org.springframework.orm.jpa.EntityManagerPlusOperations)
    • org.springframework.orm.jpa.EntityManagerProxy
  • javax.persistence.EntityManagerFactory
    • org.springframework.orm.jpa.EntityManagerFactoryPlus (also extends org.springframework.orm.jpa.EntityManagerFactoryPlusOperations)
  • org.springframework.orm.jpa.EntityManagerFactoryInfo
  • org.springframework.orm.jpa.EntityManagerFactoryPlusOperations
    • org.springframework.orm.jpa.EntityManagerFactoryPlus (also extends javax.persistence.EntityManagerFactory)
  • org.springframework.orm.jpa.EntityManagerPlusOperations
    • org.springframework.orm.jpa.EntityManagerPlus (also extends javax.persistence.EntityManager)
  • org.springframework.orm.jpa.JpaCallback<T>
  • org.springframework.orm.jpa.JpaOperations
  • org.springframework.orm.jpa.JpaVendorAdapter
  • org.springframework.dao.support.PersistenceExceptionTranslator
    • org.springframework.orm.jpa.JpaDialect


EntityManagerFactoryInfo

org.springframework.orm.jpa
Interface EntityManagerFactoryInfo

All Known Implementing Classes:
AbstractEntityManagerFactoryBean, LocalContainerEntityManagerFactoryBean, LocalEntityManagerFactoryBean
public interface EntityManagerFactoryInfo

Metadata interface for a Spring-managed JPA EntityManagerFactory.

This facility can be obtained from Spring-managed EntityManagerFactory proxies through casting the EntityManagerFactory handle to this interface.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller

Method Summary
ClassLoader | getBeanClassLoader() Return the ClassLoader that the application's beans are loaded with.
DataSource | getDataSource() Return the JDBC DataSource that this EntityManagerFactory obtains its JDBC Connections from.
Class<? extends javax.persistence.EntityManager> | getEntityManagerInterface() Return the (potentially vendor-specific) EntityManager interface that this factory's EntityManagers will implement.
JpaDialect | getJpaDialect() Return the vendor-specific JpaDialect implementation for this EntityManagerFactory, or null if not known.
javax.persistence.EntityManagerFactory | getNativeEntityManagerFactory() Return the raw underlying EntityManagerFactory.
javax.persistence.spi.PersistenceProvider | getPersistenceProvider() Return the underlying PersistenceProvider that the underlying EntityManagerFactory was created with.
javax.persistence.spi.PersistenceUnitInfo | getPersistenceUnitInfo() Return the PersistenceUnitInfo used to create this EntityManagerFactory, if the in-container API was used.
String | getPersistenceUnitName() Return the name of the persistence unit used to create this EntityManagerFactory, or null if it is an unnamed default.

Method Detail

getNativeEntityManagerFactory

javax.persistence.EntityManagerFactory getNativeEntityManagerFactory()
Return the raw underlying EntityManagerFactory.

Returns:
the unadorned EntityManagerFactory (never null)

getPersistenceProvider

javax.persistence.spi.PersistenceProvider getPersistenceProvider()
Return the underlying PersistenceProvider that the underlying EntityManagerFactory was created with.

Returns:
the PersistenceProvider used to create this EntityManagerFactory, or null if the standard JPA provider autodetection process was used to configure the EntityManagerFactory

getPersistenceUnitInfo

javax.persistence.spi.PersistenceUnitInfo getPersistenceUnitInfo()
Return the PersistenceUnitInfo used to create this EntityManagerFactory, if the in-container API was used.

Returns:
the PersistenceUnitInfo used to create this EntityManagerFactory, or null if the in-container contract was not used to configure the EntityManagerFactory

getPersistenceUnitName

String getPersistenceUnitName()
Return the name of the persistence unit used to create this EntityManagerFactory, or null if it is an unnamed default.

If getPersistenceUnitInfo() returns non-null, the result of getPersistenceUnitName() must be equal to the value returned by PersistenceUnitInfo.getPersistenceUnitName().

See Also:
getPersistenceUnitInfo(), PersistenceUnitInfo.getPersistenceUnitName()

getDataSource

DataSource getDataSource()
Return the JDBC DataSource that this EntityManagerFactory obtains its JDBC Connections from.

Returns:
the JDBC DataSource, or null if not known

getEntityManagerInterface

Class<? extends javax.persistence.EntityManager> getEntityManagerInterface()
Return the (potentially vendor-specific) EntityManager interface that this factory's EntityManagers will implement.

A null return value suggests that autodetection is supposed to happen: either based on a target EntityManager instance or simply defaulting to javax.persistence.EntityManager.

getJpaDialect

JpaDialect getJpaDialect()
Return the vendor-specific JpaDialect implementation for this EntityManagerFactory, or null if not known.

getBeanClassLoader

ClassLoader getBeanClassLoader()
Return the ClassLoader that the application's beans are loaded with.

Proxies will be generated in this ClassLoader.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EntityManagerFactoryPlus

org.springframework.orm.jpa
Interface EntityManagerFactoryPlus

All Superinterfaces:
javax.persistence.EntityManagerFactory, EntityManagerFactoryPlusOperations
public interface EntityManagerFactoryPlus
extends javax.persistence.EntityManagerFactory, EntityManagerFactoryPlusOperations

Extension of the standard JPA EntityManagerFactory interface, linking in Spring's EntityManagerFactoryPlusOperations interface which defines additional operations (beyond JPA 1.0) in a vendor-independent fashion.

Since:
2.0
Author:
Rod Johnson
See Also:
EntityManager

Method Summary
Methods inherited from interface javax.persistence.EntityManagerFactory
close, createEntityManager, createEntityManager, isOpen

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EntityManagerFactoryPlusOperations

org.springframework.orm.jpa
Interface EntityManagerFactoryPlusOperations

All Known Subinterfaces:
EntityManagerFactoryPlus
public interface EntityManagerFactoryPlusOperations

Interface that defines common operations beyond the standard JPA EntityManagerFactory interface, in a vendor-independent fashion. To be adapted to specific JPA providers through a JpaDialect.

As of Spring 2.0, this interface does not define any operations yet. The pass-through mechanism to the underlying JpaDialect is already in place. Concrete operations may be added in future releases.

Since:
2.0
Author:
Rod Johnson
See Also:
JpaDialect.getEntityManagerPlusOperations(javax.persistence.EntityManager), EntityManagerFactory

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EntityManagerPlus

org.springframework.orm.jpa
Interface EntityManagerPlus

All Superinterfaces:
javax.persistence.EntityManager, EntityManagerPlusOperations
public interface EntityManagerPlus
extends javax.persistence.EntityManager, EntityManagerPlusOperations

Extension of the standard JPA EntityManager interface, linking in Spring's EntityManagerPlusOperations interface which defines additional operations (beyond JPA 1.0) in a vendor-independent fashion.

Since:
2.0
Author:
Rod Johnson
See Also:
EntityManager

Method Summary
Methods inherited from interface javax.persistence.EntityManager
clear, close, contains, createNamedQuery, createNativeQuery, createNativeQuery, createNativeQuery, createQuery, find, flush, getDelegate, getFlushMode, getReference, getTransaction, isOpen, joinTransaction, lock, merge, persist, refresh, remove, setFlushMode

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EntityManagerPlusOperations

org.springframework.orm.jpa
Interface EntityManagerPlusOperations

All Known Subinterfaces:
EntityManagerPlus
public interface EntityManagerPlusOperations

Interface that defines common operations beyond the standard JPA EntityManager interface, in a vendor-independent fashion. To be adapted to specific JPA providers through a JpaDialect.

As of Spring 2.0, this interface does not define any operations yet. The pass-through mechanism to the underlying JpaDialect is already in place. Concrete operations may be added in future releases.

Since:
2.0
Author:
Rod Johnson
See Also:
JpaDialect.getEntityManagerPlusOperations(javax.persistence.EntityManager), EntityManager

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EntityManagerProxy

org.springframework.orm.jpa
Interface EntityManagerProxy

All Superinterfaces:
javax.persistence.EntityManager
public interface EntityManagerProxy
extends javax.persistence.EntityManager

Subinterface of EntityManager to be implemented by EntityManager proxies. Allows access to the underlying target EntityManager.

This interface is mainly intended for framework usage. Application code should prefer the use of the EntityManager.getDelegate() method to access native functionality of the underlying resource.

Since:
2.5
Author:
Juergen Hoeller

Method Summary
 javax.persistence.EntityManager getTargetEntityManager()
Return the underlying EntityManager that this proxy will delegate to.
Methods inherited from interface javax.persistence.EntityManager
clear, close, contains, createNamedQuery, createNativeQuery, createNativeQuery, createNativeQuery, createQuery, find, flush, getDelegate, getFlushMode, getReference, getTransaction, isOpen, joinTransaction, lock, merge, persist, refresh, remove, setFlushMode

Method Detail

getTargetEntityManager

javax.persistence.EntityManager getTargetEntityManager()
                                                       throws IllegalStateException
Return the underlying EntityManager that this proxy will delegate to.

In case of an extended EntityManager, this will be the associated raw EntityManager.

In case of a shared ("transactional") EntityManager, this will be the raw EntityManager that is currently associated with the transaction. Outside of a transaction, an IllegalStateException will be thrown.

Returns:
the underlying raw EntityManager (never null)
Throws:
IllegalStateException - if no underlying EntityManager is available
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JpaCallback

org.springframework.orm.jpa
Interface JpaCallback<T>

public interface JpaCallback<T>

Callback interface for JPA code. To be used with JpaTemplate's execution method, often as anonymous classes within a method implementation. A typical implementation will call EntityManager.find/merge to perform some operations on persistent objects.

Since:
2.0
Author:
Juergen Hoeller
See Also:
JpaTemplate, JpaTransactionManager

Method Summary
 T doInJpa(javax.persistence.EntityManager em)
Gets called by JpaTemplate.execute with an active JPA EntityManager.

Method Detail

doInJpa

T doInJpa(javax.persistence.EntityManager em)
          throws javax.persistence.PersistenceException
Gets called by JpaTemplate.execute with an active JPA EntityManager. Does not need to care about activating or closing the EntityManager, or handling transactions.

Note that JPA callback code will not flush any modifications to the database if not executed within a transaction. Thus, you need to make sure that JpaTransactionManager has initiated a JPA transaction when the callback gets called, at least if you want to write to the database.

Allows for returning a result object created within the callback, i.e. a domain object or a collection of domain objects. A thrown custom RuntimeException is treated as an application exception: It gets propagated to the caller of the template.

Parameters:
em - active EntityManager
Returns:
a result object, or null if none
Throws:
javax.persistence.PersistenceException - if thrown by the JPA API
See Also:
JpaTemplate.execute(org.springframework.orm.jpa.JpaCallback), JpaTemplate.executeFind(org.springframework.orm.jpa.JpaCallback)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JpaDialect

org.springframework.orm.jpa
Interface JpaDialect

All Superinterfaces:
PersistenceExceptionTranslator
All Known Implementing Classes:
DefaultJpaDialect, EclipseLinkJpaDialect, HibernateJpaDialect, OpenJpaDialect, TopLinkJpaDialect
public interface JpaDialect
extends PersistenceExceptionTranslator

SPI strategy that encapsulates certain functionality that standard JPA 1.0 does not offer, such as access to the underlying JDBC Connection. This strategy is mainly intended for standalone usage of a JPA provider; most of its functionality is not relevant when running with JTA transactions.

Also allows for the provision of value-added methods for portable yet more capable EntityManager and EntityManagerFactory subinterfaces offered by Spring.

In general, it is recommended to derive from DefaultJpaDialect instead of implementing this interface directly. This allows for inheriting common behavior (present and future) from DefaultJpaDialect, only overriding specific hooks to plug in concrete vendor-specific behavior.

Since:
2.0
Author:
Juergen Hoeller, Rod Johnson
See Also:
DefaultJpaDialect,
JpaAccessor.setJpaDialect(org.springframework.orm.jpa.JpaDialect),
JpaTransactionManager.setJpaDialect(org.springframework.orm.jpa.JpaDialect),
JpaVendorAdapter.getJpaDialect(),
AbstractEntityManagerFactoryBean.setJpaDialect(org.springframework.orm.jpa.JpaDialect),
AbstractEntityManagerFactoryBean.setJpaVendorAdapter(org.springframework.orm.jpa.JpaVendorAdapter)

Method Summary
Object | beginTransaction(javax.persistence.EntityManager entityManager, TransactionDefinition definition) Begin the given JPA transaction, applying the semantics specified by the given Spring transaction definition (in particular, an isolation level and a timeout).
void | cleanupTransaction(Object transactionData) Clean up the transaction via the given transaction data.
EntityManagerFactoryPlusOperations | getEntityManagerFactoryPlusOperations(javax.persistence.EntityManagerFactory rawEntityManager) Return an EntityManagerFactoryPlusOperations implementation for the given raw EntityManagerFactory.
EntityManagerPlusOperations | getEntityManagerPlusOperations(javax.persistence.EntityManager rawEntityManager) Return an EntityManagerPlusOperations implementation for the given raw EntityManager.
ConnectionHandle | getJdbcConnection(javax.persistence.EntityManager entityManager, boolean readOnly) Retrieve the JDBC Connection that the given JPA EntityManager uses underneath, if accessing a relational database.
Object | prepareTransaction(javax.persistence.EntityManager entityManager, boolean readOnly, String name) Prepare a JPA transaction, applying the specified semantics.
void | releaseJdbcConnection(ConnectionHandle conHandle, javax.persistence.EntityManager entityManager) Release the given JDBC Connection, which has originally been retrieved via getJdbcConnection.
boolean | supportsEntityManagerFactoryPlusOperations() Return whether the EntityManagerFactoryPlus(Operations) interface is supported by this provider.
boolean | supportsEntityManagerPlusOperations() Return whether the EntityManagerPlus(Operations) interface is supported by this provider.
Methods inherited from interface org.springframework.dao.support.PersistenceExceptionTranslator
translateExceptionIfPossible

Method Detail

supportsEntityManagerFactoryPlusOperations

boolean supportsEntityManagerFactoryPlusOperations()
Return whether the EntityManagerFactoryPlus(Operations) interface is supported by this provider.

See Also:
EntityManagerFactoryPlusOperations, EntityManagerFactoryPlus

supportsEntityManagerPlusOperations

boolean supportsEntityManagerPlusOperations()
Return whether the EntityManagerPlus(Operations) interface is supported by this provider.

See Also:
EntityManagerPlusOperations, EntityManagerPlus

getEntityManagerFactoryPlusOperations

EntityManagerFactoryPlusOperations getEntityManagerFactoryPlusOperations(javax.persistence.EntityManagerFactory rawEntityManager)
Return an EntityManagerFactoryPlusOperations implementation for the given raw EntityManagerFactory. This operations object can be used to serve the additional operations behind a proxy that implements the EntityManagerFactoryPlus interface.

Parameters:
rawEntityManager - the raw provider-specific EntityManagerFactory
Returns:
the EntityManagerFactoryPlusOperations implementation

getEntityManagerPlusOperations

EntityManagerPlusOperations getEntityManagerPlusOperations(javax.persistence.EntityManager rawEntityManager)
Return an EntityManagerPlusOperations implementation for the given raw EntityManager. This operations object can be used to serve the additional operations behind a proxy that implements the EntityManagerPlus interface.

Parameters:
rawEntityManager - the raw provider-specific EntityManagerFactory
Returns:
the EntityManagerFactoryPlusOperations implementation

beginTransaction

Object beginTransaction(javax.persistence.EntityManager entityManager,
                        TransactionDefinition definition)
                        throws javax.persistence.PersistenceException,
                               SQLException,
                               TransactionException
Begin the given JPA transaction, applying the semantics specified by the given Spring transaction definition (in particular, an isolation level and a timeout). Called by JpaTransactionManager on transaction begin.

An implementation can configure the JPA Transaction object and then invoke begin, or invoke a special begin method that takes, for example, an isolation level.

An implementation can apply the read-only flag as flush mode. In that case, a transaction data object can be returned that holds the previous flush mode (and possibly other data), to be reset in cleanupTransaction. It may also apply the read-only flag and isolation level to the underlying JDBC Connection before beginning the transaction.

Implementations can also use the Spring transaction name, as exposed by the passed-in TransactionDefinition, to optimize for specific data access use cases (effectively using the current transaction name as use case identifier).

This method also allows for exposing savepoint capabilities if supported by the persistence provider, through returning an Object that implements Spring's SavepointManager interface. JpaTransactionManager will use this capability if needed.

Parameters:
entityManager - the EntityManager to begin a JPA transaction on
definition - the Spring transaction definition that defines semantics
Returns:
an arbitrary object that holds transaction data, if any (to be passed into cleanupTransaction(java.lang.Object)). May implement the SavepointManager interface.
Throws:
javax.persistence.PersistenceException - if thrown by JPA methods
SQLException - if thrown by JDBC methods
TransactionException - in case of invalid arguments
See Also:
cleanupTransaction(java.lang.Object),
EntityTransaction.begin(),
DataSourceUtils.prepareConnectionForTransaction(java.sql.Connection, org.springframework.transaction.TransactionDefinition)

prepareTransaction

Object prepareTransaction(javax.persistence.EntityManager entityManager,
                          boolean readOnly,
                          String name)
                          throws javax.persistence.PersistenceException
Prepare a JPA transaction, applying the specified semantics. Called by EntityManagerFactoryUtils when enlisting an EntityManager in a JTA transaction.

An implementation can apply the read-only flag as flush mode. In that case, a transaction data object can be returned that holds the previous flush mode (and possibly other data), to be reset in cleanupTransaction.

Implementations can also use the Spring transaction name, as exposed by the passed-in TransactionDefinition, to optimize for specific data access use cases (effectively using the current transaction name as use case identifier).

Parameters:
entityManager - the EntityManager to begin a JPA transaction on
readOnly - whether the transaction is supposed to be read-only
name - the name of the transaction (if any)
Returns:
an arbitrary object that holds transaction data, if any (to be passed into cleanupTransaction)
Throws:
javax.persistence.PersistenceException - if thrown by JPA methods
See Also:
cleanupTransaction(java.lang.Object)

cleanupTransaction

void cleanupTransaction(Object transactionData)
Clean up the transaction via the given transaction data. Called by JpaTransactionManager and EntityManagerFactoryUtils on transaction cleanup.

An implementation can, for example, reset read-only flag and isolation level of the underlying JDBC Connection. Furthermore, an exposed data access use case can be reset here.

Parameters:
transactionData - arbitrary object that holds transaction data, if any (as returned by beginTransaction or prepareTransaction)
See Also:
beginTransaction(javax.persistence.EntityManager, org.springframework.transaction.TransactionDefinition), DataSourceUtils.resetConnectionAfterTransaction(java.sql.Connection, java.lang.Integer)

getJdbcConnection

ConnectionHandle getJdbcConnection(javax.persistence.EntityManager entityManager,
                                   boolean readOnly)
                                   throws javax.persistence.PersistenceException,
                                          SQLException
Retrieve the JDBC Connection that the given JPA EntityManager uses underneath, if accessing a relational database. This method will just get invoked if actually needing access to the underlying JDBC Connection, usually within an active JPA transaction (for example, by JpaTransactionManager). The returned handle will be passed into the releaseJdbcConnection method when not needed anymore.

This strategy is necessary as JPA 1.0 does not provide a standard way to retrieve the underlying JDBC Connection (due to the fact that a JPA implementation might not work with a relational database at all).

Implementations are encouraged to return an unwrapped Connection object, i.e. the Connection as they got it from the connection pool. This makes it easier for application code to get at the underlying native JDBC Connection, like an OracleConnection, which is sometimes necessary for LOB handling etc. We assume that calling code knows how to properly handle the returned Connection object.

In a simple case where the returned Connection will be auto-closed with the EntityManager or can be released via the Connection object itself, an implementation can return a SimpleConnectionHandle that just contains the Connection. If some other object is needed in releaseJdbcConnection, an implementation should use a special handle that references that other object.

Parameters:
entityManager - the current JPA EntityManager
readOnly - whether the Connection is only needed for read-only purposes
Returns:
a handle for the JDBC Connection, to be passed into releaseJdbcConnection, or null if no JDBC Connection can be retrieved
Throws:
javax.persistence.PersistenceException - if thrown by JPA methods
SQLException - if thrown by JDBC methods
See Also:
releaseJdbcConnection(org.springframework.jdbc.datasource.ConnectionHandle, javax.persistence.EntityManager), ConnectionHandle.getConnection(), SimpleConnectionHandle, JpaTransactionManager.setDataSource(javax.sql.DataSource), NativeJdbcExtractor

releaseJdbcConnection

void releaseJdbcConnection(ConnectionHandle conHandle,
                           javax.persistence.EntityManager entityManager)
                           throws javax.persistence.PersistenceException,
                                  SQLException
Release the given JDBC Connection, which has originally been retrieved via getJdbcConnection. This should be invoked in any case, to allow for proper release of the retrieved Connection handle.

An implementation might simply do nothing, if the Connection returned by getJdbcConnection will be implicitly closed when the JPA transaction completes or when the EntityManager is closed.

Parameters:
conHandle - the JDBC Connection handle to release
entityManager - the current JPA EntityManager
Throws:
javax.persistence.PersistenceException - if thrown by JPA methods
SQLException - if thrown by JDBC methods
See Also:
getJdbcConnection(javax.persistence.EntityManager, boolean)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JpaOperations

org.springframework.orm.jpa
Interface JpaOperations

All Known Implementing Classes:
JpaTemplate
public interface JpaOperations

Interface that specifies a basic set of JPA operations, implemented by JpaTemplate. Not often used, but a useful option to enhance testability, as it can easily be mocked or stubbed.

Defines JpaTemplate's data access methods that mirror various EntityManager methods. Users are strongly encouraged to read the JPA EntityManager javadocs for details on the semantics of those methods.

Note that lazy loading will just work with an open JPA EntityManager, either within a managed transaction or within OpenEntityManagerInViewFilter/ OpenEntityManagerInViewInterceptor. Furthermore, some operations just make sense within transactions, for example: flush, clear.

Since:
2.0
Author:
Juergen Hoeller
See Also:
JpaTemplate, EntityManager, JpaTransactionManager, JpaDialect, OpenEntityManagerInViewFilter, OpenEntityManagerInViewInterceptor

Method Summary
 boolean contains(Object entity)
<T> T
execute(JpaCallback<T> action)
 List executeFind(JpaCallback<?> action)
<T> T
find(Class<T> entityClass, Object id)
 List find(String queryString)
 List find(String queryString, Object... values)
 List findByNamedParams(String queryString, Map<String,?> params)
 List findByNamedQuery(String queryName)
 List findByNamedQuery(String queryName, Object... values)
 List findByNamedQueryAndNamedParams(String queryName, Map<String,?> params)
 void flush()
<T> T
getReference(Class<T> entityClass, Object id)
<T> T
merge(T entity)
 void persist(Object entity)
 void refresh(Object entity)
 void remove(Object entity)

Method Detail

execute

<T> T execute(JpaCallback<T> action)
          throws DataAccessException
Throws:
DataAccessException

executeFind

List executeFind(JpaCallback<?> action)
                 throws DataAccessException
Throws:
DataAccessException

find

<T> T find(Class<T> entityClass,
           Object id)
       throws DataAccessException
Throws:
DataAccessException

getReference

<T> T getReference(Class<T> entityClass,
                   Object id)
               throws DataAccessException
Throws:
DataAccessException

contains

boolean contains(Object entity)
                 throws DataAccessException
Throws:
DataAccessException

refresh

void refresh(Object entity)
             throws DataAccessException
Throws:
DataAccessException

persist

void persist(Object entity)
             throws DataAccessException
Throws:
DataAccessException

merge

<T> T merge(T entity)
        throws DataAccessException
Throws:
DataAccessException

remove

void remove(Object entity)
            throws DataAccessException
Throws:
DataAccessException

flush

void flush()
           throws DataAccessException
Throws:
DataAccessException

find

List find(String queryString)
          throws DataAccessException
Throws:
DataAccessException

find

List find(String queryString,
          Object... values)
          throws DataAccessException
Throws:
DataAccessException

findByNamedParams

List findByNamedParams(String queryString,
                       Map<String,?> params)
                       throws DataAccessException
Throws:
DataAccessException

findByNamedQuery

List findByNamedQuery(String queryName)
                      throws DataAccessException
Throws:
DataAccessException

findByNamedQuery

List findByNamedQuery(String queryName,
                      Object... values)
                      throws DataAccessException
Throws:
DataAccessException

findByNamedQueryAndNamedParams

List findByNamedQueryAndNamedParams(String queryName,
                                    Map<String,?> params)
                                    throws DataAccessException
Throws:
DataAccessException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JpaVendorAdapter

org.springframework.orm.jpa
Interface JpaVendorAdapter

All Known Implementing Classes:
AbstractJpaVendorAdapter, EclipseLinkJpaVendorAdapter, HibernateJpaVendorAdapter, OpenJpaVendorAdapter, TopLinkJpaVendorAdapter
public interface JpaVendorAdapter

SPI interface that allows to plug in vendor-specific behavior into Spring's EntityManagerFactory creators. Serves as single configuration point for all vendor-specific properties.

Since:
2.0
Author:
Juergen Hoeller, Rod Johnson
See Also:
AbstractEntityManagerFactoryBean.setJpaVendorAdapter(org.springframework.orm.jpa.JpaVendorAdapter)

Method Summary
Class<? extends javax.persistence.EntityManagerFactory> | getEntityManagerFactoryInterface() Return the vendor-specific EntityManagerFactory interface that the EntityManagerFactory proxy is supposed to implement.
Class<? extends javax.persistence.EntityManager> | getEntityManagerInterface() Return the vendor-specific EntityManager interface that this provider's EntityManagers will implement.
JpaDialect | getJpaDialect() Return the vendor-specific JpaDialect implementation for this provider, or null if there is none.
Map<String,?> | getJpaPropertyMap() Return a Map of vendor-specific JPA properties, typically based on settings in this JpaVendorAdapter instance.
javax.persistence.spi.PersistenceProvider | getPersistenceProvider() Return the vendor-specific persistence provider.
String | getPersistenceProviderRootPackage() Return the name of the persistence provider's root package (e.g.
void | postProcessEntityManagerFactory(javax.persistence.EntityManagerFactory emf) Optional callback for post-processing the native EntityManagerFactory before active use.

Method Detail

getPersistenceProvider

javax.persistence.spi.PersistenceProvider getPersistenceProvider()
Return the vendor-specific persistence provider.

getPersistenceProviderRootPackage

String getPersistenceProviderRootPackage()
Return the name of the persistence provider's root package (e.g. "oracle.toplink.essentials"). Will be used for excluding provider classes from temporary class overriding.

Since:
2.5.2

getJpaPropertyMap

Map<String,?> getJpaPropertyMap()
Return a Map of vendor-specific JPA properties, typically based on settings in this JpaVendorAdapter instance.

Note that there might be further JPA properties defined on the EntityManagerFactory bean, which might potentially override individual JPA property values specified here.

Returns:
a Map of JPA properties, as as accepted by the standard JPA bootstrap facilities, or null or an empty Map if there are no such properties to expose
See Also:
Persistence.createEntityManagerFactory(String, java.util.Map), PersistenceProvider.createContainerEntityManagerFactory(javax.persistence.spi.PersistenceUnitInfo, java.util.Map)

getJpaDialect

JpaDialect getJpaDialect()
Return the vendor-specific JpaDialect implementation for this provider, or null if there is none.

getEntityManagerFactoryInterface

Class<? extends javax.persistence.EntityManagerFactory> getEntityManagerFactoryInterface()
Return the vendor-specific EntityManagerFactory interface that the EntityManagerFactory proxy is supposed to implement.

If the provider does not offer any EntityManagerFactory extensions, the adapter should simply return the standard EntityManagerFactory class here.

Since:
2.5.2

getEntityManagerInterface

Class<? extends javax.persistence.EntityManager> getEntityManagerInterface()
Return the vendor-specific EntityManager interface that this provider's EntityManagers will implement.

If the provider does not offer any EntityManager extensions, the adapter should simply return the standard EntityManager class here.

postProcessEntityManagerFactory

void postProcessEntityManagerFactory(javax.persistence.EntityManagerFactory emf)
Optional callback for post-processing the native EntityManagerFactory before active use.

This can be used for triggering vendor-specific initialization processes. While this is not expected to be used for most providers, it is included here as a general extension hook.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractEntityManagerFactoryBean

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.orm.jpa
Class AbstractEntityManagerFactoryBean

java.lang.Object
    extended by  org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
All Implemented Interfaces:
Serializable, BeanClassLoaderAware, BeanFactoryAware, BeanNameAware, DisposableBean, FactoryBean<javax.persistence.EntityManagerFactory>, InitializingBean, PersistenceExceptionTranslator, EntityManagerFactoryInfo
Direct Known Subclasses:
LocalContainerEntityManagerFactoryBean, LocalEntityManagerFactoryBean
public abstract class AbstractEntityManagerFactoryBean
extends Object
implements FactoryBean<javax.persistence.EntityManagerFactory>, BeanClassLoaderAware, BeanFactoryAware, BeanNameAware, InitializingBean, DisposableBean, EntityManagerFactoryInfo, PersistenceExceptionTranslator, Serializable

Abstract FactoryBean that creates a local JPA EntityManagerFactory instance within a Spring application context.

Encapsulates the common functionality between the different JPA bootstrap contracts (standalone as well as container).

Implements support for standard JPA configuration as well as Spring's JpaVendorAdapter abstraction, and controls the EntityManagerFactory's lifecycle.

This class also implements the PersistenceExceptionTranslator interface, as autodetected by Spring's PersistenceExceptionTranslationPostProcessor, for AOP-based translation of native exceptions to Spring DataAccessExceptions. Hence, the presence of e.g. LocalEntityManagerFactoryBean automatically enables a PersistenceExceptionTranslationPostProcessor to translate JPA exceptions.

Since:
2.0
Author:
Juergen Hoeller, Rod Johnson
See Also:
LocalEntityManagerFactoryBean, LocalContainerEntityManagerFactoryBean, Serialized Form

Field Summary
protected Log | logger Logger available to subclasses
javax.persistence.EntityManagerFactory | nativeEntityManagerFactory Raw EntityManagerFactory as returned by the PersistenceProvider
Constructor Summary
AbstractEntityManagerFactoryBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected  javax.persistence.EntityManagerFactory createEntityManagerFactoryProxy(javax.persistence.EntityManagerFactory emf)
Create a proxy of the given EntityManagerFactory.
protected abstract  javax.persistence.EntityManagerFactory createNativeEntityManagerFactory()
Subclasses must implement this method to create the EntityManagerFactory that will be returned by the getObject() method.
 void destroy()
Close the EntityManagerFactory on bean factory shutdown.
 ClassLoader getBeanClassLoader()
Return the ClassLoader that the application's beans are loaded with.
 DataSource getDataSource()
Return the JDBC DataSource that this EntityManagerFactory obtains its JDBC Connections from.
 Class<? extends javax.persistence.EntityManager> getEntityManagerInterface()
Return the (potentially vendor-specific) EntityManager interface that this factory's EntityManagers will implement.
 JpaDialect getJpaDialect()
Return the vendor-specific JpaDialect implementation for this EntityManagerFactory, or null if not known.
 Map<String,Object> getJpaPropertyMap()
Allow Map access to the JPA properties to be passed to the persistence provider, with the option to add or override specific entries.
 JpaVendorAdapter getJpaVendorAdapter()
Return the JpaVendorAdapter implementation for this EntityManagerFactory, or null if not known.
 javax.persistence.EntityManagerFactory getNativeEntityManagerFactory()
Return the raw underlying EntityManagerFactory.
 javax.persistence.EntityManagerFactory getObject()
Return the singleton EntityManagerFactory.
 Class<? extends javax.persistence.EntityManagerFactory> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 javax.persistence.spi.PersistenceProvider getPersistenceProvider()
Return the underlying PersistenceProvider that the underlying EntityManagerFactory was created with.
 javax.persistence.spi.PersistenceUnitInfo getPersistenceUnitInfo()
Return the PersistenceUnitInfo used to create this EntityManagerFactory, if the in-container API was used.
 String getPersistenceUnitName()
Return the name of the persistence unit used to create this EntityManagerFactory, or null if it is an unnamed default.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setBeanClassLoader(ClassLoader classLoader)
Callback that supplies the bean class loader to a bean instance.
 void setBeanFactory(BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance.
 void setBeanName(String name)
Set the name of the bean in the bean factory that created this bean.
 void setEntityManagerFactoryInterface(Class<? extends javax.persistence.EntityManagerFactory> emfInterface)
Specify the (potentially vendor-specific) EntityManagerFactory interface that this EntityManagerFactory proxy is supposed to implement.
 void setEntityManagerInterface(Class<? extends javax.persistence.EntityManager> emInterface)
Specify the (potentially vendor-specific) EntityManager interface that this factory's EntityManagers are supposed to implement.
 void setJpaDialect(JpaDialect jpaDialect)
Specify the vendor-specific JpaDialect implementation to associate with this EntityManagerFactory.
 void setJpaProperties(Properties jpaProperties)
Specify JPA properties, to be passed into Persistence.createEntityManagerFactory (if any).
 void setJpaPropertyMap(Map<String,?> jpaProperties)
Specify JPA properties as a Map, to be passed into Persistence.createEntityManagerFactory (if any).
 void setJpaVendorAdapter(JpaVendorAdapter jpaVendorAdapter)
Specify the JpaVendorAdapter implementation for the desired JPA provider, if any.
 void setPersistenceProvider(javax.persistence.spi.PersistenceProvider persistenceProvider)
Set the PersistenceProvider instance to use for creating the EntityManagerFactory.
 void setPersistenceProviderClass(Class<? extends javax.persistence.spi.PersistenceProvider> persistenceProviderClass)
Set the PersistenceProvider implementation class to use for creating the EntityManagerFactory.
 void setPersistenceUnitName(String persistenceUnitName)
Specify the name of the EntityManagerFactory configuration.
 DataAccessException translateExceptionIfPossible(RuntimeException ex)
Implementation of the PersistenceExceptionTranslator interface, as autodetected by Spring's PersistenceExceptionTranslationPostProcessor.
protected  Object writeReplace()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

nativeEntityManagerFactory

public javax.persistence.EntityManagerFactory nativeEntityManagerFactory
Raw EntityManagerFactory as returned by the PersistenceProvider

Constructor Detail

AbstractEntityManagerFactoryBean

public AbstractEntityManagerFactoryBean()
Method Detail

setPersistenceProviderClass

public void setPersistenceProviderClass(Class<? extends javax.persistence.spi.PersistenceProvider> persistenceProviderClass)
Set the PersistenceProvider implementation class to use for creating the EntityManagerFactory. If not specified, the persistence provider will be taken from the JpaVendorAdapter (if any) or retrieved through scanning (as far as possible).

See Also:
JpaVendorAdapter.getPersistenceProvider(), PersistenceProvider, Persistence

setPersistenceProvider

public void setPersistenceProvider(javax.persistence.spi.PersistenceProvider persistenceProvider)
Set the PersistenceProvider instance to use for creating the EntityManagerFactory. If not specified, the persistence provider will be taken from the JpaVendorAdapter (if any) or determined by the persistence unit deployment descriptor (as far as possible).

See Also:
JpaVendorAdapter.getPersistenceProvider(), PersistenceProvider, Persistence

getPersistenceProvider

public javax.persistence.spi.PersistenceProvider getPersistenceProvider()
Description copied from interface: EntityManagerFactoryInfo
Return the underlying PersistenceProvider that the underlying EntityManagerFactory was created with.

Specified by:
getPersistenceProvider in interface EntityManagerFactoryInfo
Returns:
the PersistenceProvider used to create this EntityManagerFactory, or null if the standard JPA provider autodetection process was used to configure the EntityManagerFactory

setPersistenceUnitName

public void setPersistenceUnitName(String persistenceUnitName)
Specify the name of the EntityManagerFactory configuration.

Default is none, indicating the default EntityManagerFactory configuration. The persistence provider will throw an exception if ambiguous EntityManager configurations are found.

See Also:
Persistence.createEntityManagerFactory(String)

getPersistenceUnitName

public String getPersistenceUnitName()
Description copied from interface: EntityManagerFactoryInfo
Return the name of the persistence unit used to create this EntityManagerFactory, or null if it is an unnamed default.

If getPersistenceUnitInfo() returns non-null, the result of getPersistenceUnitName() must be equal to the value returned by PersistenceUnitInfo.getPersistenceUnitName().

Specified by:
getPersistenceUnitName in interface EntityManagerFactoryInfo
See Also:
EntityManagerFactoryInfo.getPersistenceUnitInfo(), PersistenceUnitInfo.getPersistenceUnitName()

setJpaProperties

public void setJpaProperties(Properties jpaProperties)
Specify JPA properties, to be passed into Persistence.createEntityManagerFactory (if any).

Can be populated with a String "value" (parsed via PropertiesEditor) or a "props" element in XML bean definitions.

See Also:
Persistence.createEntityManagerFactory(String, java.util.Map), PersistenceProvider.createContainerEntityManagerFactory(javax.persistence.spi.PersistenceUnitInfo, java.util.Map)

setJpaPropertyMap

public void setJpaPropertyMap(Map<String,?> jpaProperties)
Specify JPA properties as a Map, to be passed into Persistence.createEntityManagerFactory (if any).

Can be populated with a "map" or "props" element in XML bean definitions.

See Also:
Persistence.createEntityManagerFactory(String, java.util.Map), PersistenceProvider.createContainerEntityManagerFactory(javax.persistence.spi.PersistenceUnitInfo, java.util.Map)

getJpaPropertyMap

public Map<String,Object> getJpaPropertyMap()
Allow Map access to the JPA properties to be passed to the persistence provider, with the option to add or override specific entries.

Useful for specifying entries directly, for example via "jpaPropertyMap[myKey]".

setEntityManagerFactoryInterface

public void setEntityManagerFactoryInterface(Class<? extends javax.persistence.EntityManagerFactory> emfInterface)
Specify the (potentially vendor-specific) EntityManagerFactory interface that this EntityManagerFactory proxy is supposed to implement.

The default will be taken from the specific JpaVendorAdapter, if any, or set to the standard javax.persistence.EntityManagerFactory interface else.

See Also:
JpaVendorAdapter.getEntityManagerFactoryInterface()

setEntityManagerInterface

public void setEntityManagerInterface(Class<? extends javax.persistence.EntityManager> emInterface)
Specify the (potentially vendor-specific) EntityManager interface that this factory's EntityManagers are supposed to implement.

The default will be taken from the specific JpaVendorAdapter, if any, or set to the standard javax.persistence.EntityManager interface else.

See Also:
JpaVendorAdapter.getEntityManagerInterface(), EntityManagerFactoryInfo.getEntityManagerInterface()

getEntityManagerInterface

public Class<? extends javax.persistence.EntityManager> getEntityManagerInterface()
Description copied from interface: EntityManagerFactoryInfo
Return the (potentially vendor-specific) EntityManager interface that this factory's EntityManagers will implement.

A null return value suggests that autodetection is supposed to happen: either based on a target EntityManager instance or simply defaulting to javax.persistence.EntityManager.

Specified by:
getEntityManagerInterface in interface EntityManagerFactoryInfo

setJpaDialect

public void setJpaDialect(JpaDialect jpaDialect)
Specify the vendor-specific JpaDialect implementation to associate with this EntityManagerFactory. This will be exposed through the EntityManagerFactoryInfo interface, to be picked up as default dialect by accessors that intend to use JpaDialect functionality.

See Also:
EntityManagerFactoryInfo.getJpaDialect()

getJpaDialect

public JpaDialect getJpaDialect()
Description copied from interface: EntityManagerFactoryInfo
Return the vendor-specific JpaDialect implementation for this EntityManagerFactory, or null if not known.

Specified by:
getJpaDialect in interface EntityManagerFactoryInfo

setJpaVendorAdapter

public void setJpaVendorAdapter(JpaVendorAdapter jpaVendorAdapter)
Specify the JpaVendorAdapter implementation for the desired JPA provider, if any. This will initialize appropriate defaults for the given provider, such as persistence provider class and JpaDialect, unless locally overridden in this FactoryBean.

getJpaVendorAdapter

public JpaVendorAdapter getJpaVendorAdapter()
Return the JpaVendorAdapter implementation for this EntityManagerFactory, or null if not known.

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

getBeanClassLoader

public ClassLoader getBeanClassLoader()
Description copied from interface: EntityManagerFactoryInfo
Return the ClassLoader that the application's beans are loaded with.

Proxies will be generated in this ClassLoader.

Specified by:
getBeanClassLoader in interface EntityManagerFactoryInfo

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
BeanInitializationException

setBeanName

public void setBeanName(String name)
Description copied from interface: BeanNameAware
Set the name of the bean in the bean factory that created this bean.

Invoked after population of normal bean properties but before an init callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanName in interface BeanNameAware
Parameters:
name - the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use the BeanFactoryUtils.originalBeanName(String) method to extract the original bean name (without suffix), if desired.

afterPropertiesSet

public final void afterPropertiesSet()
                              throws javax.persistence.PersistenceException
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
javax.persistence.PersistenceException

createEntityManagerFactoryProxy

protected javax.persistence.EntityManagerFactory createEntityManagerFactoryProxy(javax.persistence.EntityManagerFactory emf)
Create a proxy of the given EntityManagerFactory. We do this to be able to return transaction-aware proxies for application-managed EntityManagers, and to introduce the NamedEntityManagerFactory interface

Parameters:
emf - EntityManagerFactory as returned by the persistence provider
Returns:
proxy entity manager

createNativeEntityManagerFactory

protected abstract javax.persistence.EntityManagerFactory createNativeEntityManagerFactory()
                                                                                throws javax.persistence.PersistenceException
Subclasses must implement this method to create the EntityManagerFactory that will be returned by the getObject() method.

Returns:
EntityManagerFactory instance returned by this FactoryBean
Throws:
javax.persistence.PersistenceException - if the EntityManager cannot be created

translateExceptionIfPossible

public DataAccessException translateExceptionIfPossible(RuntimeException ex)
Implementation of the PersistenceExceptionTranslator interface, as autodetected by Spring's PersistenceExceptionTranslationPostProcessor.

Uses the dialect's conversion if possible; otherwise falls back to standard JPA exception conversion.

Specified by:
translateExceptionIfPossible in interface PersistenceExceptionTranslator
Parameters:
ex - a RuntimeException thrown
Returns:
the corresponding DataAccessException (or null if the exception could not be translated, as in this case it may result from user code rather than an actual persistence problem)
See Also:
PersistenceExceptionTranslationPostProcessor, PersistenceExceptionTranslator.translateExceptionIfPossible(java.lang.RuntimeException), EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(java.lang.RuntimeException)

getNativeEntityManagerFactory

public javax.persistence.EntityManagerFactory getNativeEntityManagerFactory()
Description copied from interface: EntityManagerFactoryInfo
Return the raw underlying EntityManagerFactory.

Specified by:
getNativeEntityManagerFactory in interface EntityManagerFactoryInfo
Returns:
the unadorned EntityManagerFactory (never null)

getPersistenceUnitInfo

public javax.persistence.spi.PersistenceUnitInfo getPersistenceUnitInfo()
Description copied from interface: EntityManagerFactoryInfo
Return the PersistenceUnitInfo used to create this EntityManagerFactory, if the in-container API was used.

Specified by:
getPersistenceUnitInfo in interface EntityManagerFactoryInfo
Returns:
the PersistenceUnitInfo used to create this EntityManagerFactory, or null if the in-container contract was not used to configure the EntityManagerFactory

getDataSource

public DataSource getDataSource()
Description copied from interface: EntityManagerFactoryInfo
Return the JDBC DataSource that this EntityManagerFactory obtains its JDBC Connections from.

Specified by:
getDataSource in interface EntityManagerFactoryInfo
Returns:
the JDBC DataSource, or null if not known

getObject

public javax.persistence.EntityManagerFactory getObject()
Return the singleton EntityManagerFactory.

Specified by:
getObject in interface FactoryBean<javax.persistence.EntityManagerFactory>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends javax.persistence.EntityManagerFactory> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<javax.persistence.EntityManagerFactory>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<javax.persistence.EntityManagerFactory>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()

destroy

public void destroy()
Close the EntityManagerFactory on bean factory shutdown.

Specified by:
destroy in interface DisposableBean

writeReplace

protected Object writeReplace()
                       throws ObjectStreamException
Throws:
ObjectStreamException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


DefaultJpaDialect

org.springframework.orm.jpa
Class DefaultJpaDialect

java.lang.Object
    extended by  org.springframework.orm.jpa.DefaultJpaDialect
All Implemented Interfaces:
Serializable, PersistenceExceptionTranslator, JpaDialect
Direct Known Subclasses:
EclipseLinkJpaDialect, HibernateJpaDialect, OpenJpaDialect, TopLinkJpaDialect
public class DefaultJpaDialect
extends Object
implements JpaDialect, Serializable

Default implementation of the JpaDialect interface. Used as default dialect by JpaAccessor and JpaTransactionManager.

Simply begins a standard JPA transaction in beginTransaction(javax.persistence.EntityManager, org.springframework.transaction.TransactionDefinition) and performs standard exception translation through EntityManagerFactoryUtils.

Since:
2.0
Author:
Juergen Hoeller
See Also:
JpaAccessor.setJpaDialect(org.springframework.orm.jpa.JpaDialect), JpaTransactionManager.setJpaDialect(org.springframework.orm.jpa.JpaDialect), Serialized Form

Constructor Summary
DefaultJpaDialect()
Method Summary
Object | beginTransaction(javax.persistence.EntityManager entityManager, TransactionDefinition definition) This implementation invokes the standard JPA Transaction.begin method.
void | cleanupTransaction(Object transactionData) This implementation does nothing, since the default beginTransaction implementation does not require any cleanup.
EntityManagerFactoryPlusOperations | getEntityManagerFactoryPlusOperations(javax.persistence.EntityManagerFactory rawEntityManager) Return an EntityManagerFactoryPlusOperations implementation for the given raw EntityManagerFactory.
EntityManagerPlusOperations | getEntityManagerPlusOperations(javax.persistence.EntityManager rawEntityManager) Return an EntityManagerPlusOperations implementation for the given raw EntityManager.
ConnectionHandle | getJdbcConnection(javax.persistence.EntityManager entityManager, boolean readOnly) This implementation always returns null, indicating that no JDBC Connection can be provided.
Object | prepareTransaction(javax.persistence.EntityManager entityManager, boolean readOnly, String name) Prepare a JPA transaction, applying the specified semantics.
void | releaseJdbcConnection(ConnectionHandle conHandle, javax.persistence.EntityManager em) This implementation does nothing, assuming that the Connection will implicitly be closed with the EntityManager.
boolean | supportsEntityManagerFactoryPlusOperations() Return whether the EntityManagerFactoryPlus(Operations) interface is supported by this provider.
boolean | supportsEntityManagerPlusOperations() Return whether the EntityManagerPlus(Operations) interface is supported by this provider.
DataAccessException | translateExceptionIfPossible(RuntimeException ex) This implementation delegates to EntityManagerFactoryUtils.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DefaultJpaDialect

public DefaultJpaDialect()
Method Detail

beginTransaction

public Object beginTransaction(javax.persistence.EntityManager entityManager,
                               TransactionDefinition definition)
                        throws javax.persistence.PersistenceException,
                               SQLException,
                               TransactionException
This implementation invokes the standard JPA Transaction.begin method. Throws an InvalidIsolationLevelException if a non-default isolation level is set.

This implementation does not return any transaction data Object, since there is no state to be kept for a standard JPA transaction. Hence, subclasses do not have to care about the return value (null) of this implementation and are free to return their own transaction data Object.

Specified by:
beginTransaction in interface JpaDialect
Parameters:
entityManager - the EntityManager to begin a JPA transaction on
definition - the Spring transaction definition that defines semantics
Returns:
an arbitrary object that holds transaction data, if any (to be passed into JpaDialect.cleanupTransaction(java.lang.Object)). May implement the SavepointManager interface.
Throws:
javax.persistence.PersistenceException - if thrown by JPA methods
SQLException - if thrown by JDBC methods
TransactionException - in case of invalid arguments
See Also:
EntityTransaction.begin(), InvalidIsolationLevelException, cleanupTransaction(java.lang.Object)

prepareTransaction

public Object prepareTransaction(javax.persistence.EntityManager entityManager,
                                 boolean readOnly,
                                 String name)
                          throws javax.persistence.PersistenceException
Description copied from interface: JpaDialect
Prepare a JPA transaction, applying the specified semantics. Called by EntityManagerFactoryUtils when enlisting an EntityManager in a JTA transaction.

An implementation can apply the read-only flag as flush mode. In that case, a transaction data object can be returned that holds the previous flush mode (and possibly other data), to be reset in cleanupTransaction.

Implementations can also use the Spring transaction name, as exposed by the passed-in TransactionDefinition, to optimize for specific data access use cases (effectively using the current transaction name as use case identifier).

Specified by:
prepareTransaction in interface JpaDialect
Parameters:
entityManager - the EntityManager to begin a JPA transaction on
readOnly - whether the transaction is supposed to be read-only
name - the name of the transaction (if any)
Returns:
an arbitrary object that holds transaction data, if any (to be passed into cleanupTransaction)
Throws:
javax.persistence.PersistenceException - if thrown by JPA methods
See Also:
JpaDialect.cleanupTransaction(java.lang.Object)

cleanupTransaction

public void cleanupTransaction(Object transactionData)
This implementation does nothing, since the default beginTransaction implementation does not require any cleanup.

Specified by:
cleanupTransaction in interface JpaDialect
Parameters:
transactionData - arbitrary object that holds transaction data, if any (as returned by beginTransaction or prepareTransaction)
See Also:
beginTransaction(javax.persistence.EntityManager, org.springframework.transaction.TransactionDefinition)

getJdbcConnection

public ConnectionHandle getJdbcConnection(javax.persistence.EntityManager entityManager,
                                          boolean readOnly)
                                   throws javax.persistence.PersistenceException,
                                          SQLException
This implementation always returns null, indicating that no JDBC Connection can be provided.

Specified by:
getJdbcConnection in interface JpaDialect
Parameters:
entityManager - the current JPA EntityManager
readOnly - whether the Connection is only needed for read-only purposes
Returns:
a handle for the JDBC Connection, to be passed into releaseJdbcConnection, or null if no JDBC Connection can be retrieved
Throws:
javax.persistence.PersistenceException - if thrown by JPA methods
SQLException - if thrown by JDBC methods
See Also:
JpaDialect.releaseJdbcConnection(org.springframework.jdbc.datasource.ConnectionHandle, javax.persistence.EntityManager), ConnectionHandle.getConnection(), SimpleConnectionHandle, JpaTransactionManager.setDataSource(javax.sql.DataSource), NativeJdbcExtractor

releaseJdbcConnection

public void releaseJdbcConnection(ConnectionHandle conHandle,
                                  javax.persistence.EntityManager em)
                           throws javax.persistence.PersistenceException,
                                  SQLException
This implementation does nothing, assuming that the Connection will implicitly be closed with the EntityManager.

If the JPA implementation returns a Connection handle that it expects the application to close after use, the dialect implementation needs to invoke Connection.close() (or some other method with similar effect) here.

Specified by:
releaseJdbcConnection in interface JpaDialect
Parameters:
conHandle - the JDBC Connection handle to release
em - the current JPA EntityManager
Throws:
javax.persistence.PersistenceException - if thrown by JPA methods
SQLException - if thrown by JDBC methods
See Also:
Connection.close()

translateExceptionIfPossible

public DataAccessException translateExceptionIfPossible(RuntimeException ex)
This implementation delegates to EntityManagerFactoryUtils.

Specified by:
translateExceptionIfPossible in interface PersistenceExceptionTranslator
Parameters:
ex - a RuntimeException thrown
Returns:
the corresponding DataAccessException (or null if the exception could not be translated, as in this case it may result from user code rather than an actual persistence problem)
See Also:
EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(java.lang.RuntimeException)

supportsEntityManagerFactoryPlusOperations

public boolean supportsEntityManagerFactoryPlusOperations()
Description copied from interface: JpaDialect
Return whether the EntityManagerFactoryPlus(Operations) interface is supported by this provider.

Specified by:
supportsEntityManagerFactoryPlusOperations in interface JpaDialect
See Also:
EntityManagerFactoryPlusOperations, EntityManagerFactoryPlus

supportsEntityManagerPlusOperations

public boolean supportsEntityManagerPlusOperations()
Description copied from interface: JpaDialect
Return whether the EntityManagerPlus(Operations) interface is supported by this provider.

Specified by:
supportsEntityManagerPlusOperations in interface JpaDialect
See Also:
EntityManagerPlusOperations, EntityManagerPlus

getEntityManagerFactoryPlusOperations

public EntityManagerFactoryPlusOperations getEntityManagerFactoryPlusOperations(javax.persistence.EntityManagerFactory rawEntityManager)
Description copied from interface: JpaDialect
Return an EntityManagerFactoryPlusOperations implementation for the given raw EntityManagerFactory. This operations object can be used to serve the additional operations behind a proxy that implements the EntityManagerFactoryPlus interface.

Specified by:
getEntityManagerFactoryPlusOperations in interface JpaDialect
Parameters:
rawEntityManager - the raw provider-specific EntityManagerFactory
Returns:
the EntityManagerFactoryPlusOperations implementation

getEntityManagerPlusOperations

public EntityManagerPlusOperations getEntityManagerPlusOperations(javax.persistence.EntityManager rawEntityManager)
Description copied from interface: JpaDialect
Return an EntityManagerPlusOperations implementation for the given raw EntityManager. This operations object can be used to serve the additional operations behind a proxy that implements the EntityManagerPlus interface.

Specified by:
getEntityManagerPlusOperations in interface JpaDialect
Parameters:
rawEntityManager - the raw provider-specific EntityManagerFactory
Returns:
the EntityManagerFactoryPlusOperations implementation
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EntityManagerFactoryAccessor

org.springframework.orm.jpa
Class EntityManagerFactoryAccessor

java.lang.Object
    extended by  org.springframework.orm.jpa.EntityManagerFactoryAccessor
Direct Known Subclasses:
JpaAccessor, OpenEntityManagerInViewInterceptor, SharedEntityManagerBean
public abstract class EntityManagerFactoryAccessor
extends Object

Base class for any class that needs to access an EntityManagerFactory, usually in order to obtain an EntityManager. Defines common properties.

Not intended to be used directly. See JpaAccessor.

Since:
2.0
Author:
Juergen Hoeller
See Also:
JpaAccessor, EntityManagerFactoryUtils

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
EntityManagerFactoryAccessor()
Method Summary
protected  javax.persistence.EntityManager createEntityManager()
Obtain a new EntityManager from this accessor's EntityManagerFactory.
 javax.persistence.EntityManagerFactory getEntityManagerFactory()
Return the JPA EntityManagerFactory that should be used to create EntityManagers.
 Map<String,Object> getJpaPropertyMap()
Allow Map access to the JPA properties to be passed to the persistence provider, with the option to add or override specific entries.
protected  javax.persistence.EntityManager getTransactionalEntityManager()
Obtain the transactional EntityManager for this accessor's EntityManagerFactory, if any.
 void setEntityManagerFactory(javax.persistence.EntityManagerFactory emf)
Set the JPA EntityManagerFactory that should be used to create EntityManagers.
 void setJpaProperties(Properties jpaProperties)
Specify JPA properties, to be passed into EntityManagerFactory.createEntityManager(Map) (if any).
 void setJpaPropertyMap(Map<String,Object> jpaProperties)
Specify JPA properties as a Map, to be passed into EntityManagerFactory.createEntityManager(Map) (if any).
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

EntityManagerFactoryAccessor

public EntityManagerFactoryAccessor()
Method Detail

setEntityManagerFactory

public void setEntityManagerFactory(javax.persistence.EntityManagerFactory emf)
Set the JPA EntityManagerFactory that should be used to create EntityManagers.

See Also:
EntityManagerFactory.createEntityManager(), EntityManagerFactory.createEntityManager(java.util.Map)

getEntityManagerFactory

public javax.persistence.EntityManagerFactory getEntityManagerFactory()
Return the JPA EntityManagerFactory that should be used to create EntityManagers.

setJpaProperties

public void setJpaProperties(Properties jpaProperties)
Specify JPA properties, to be passed into EntityManagerFactory.createEntityManager(Map) (if any).

Can be populated with a String "value" (parsed via PropertiesEditor) or a "props" element in XML bean definitions.

See Also:
EntityManagerFactory.createEntityManager(java.util.Map)

setJpaPropertyMap

public void setJpaPropertyMap(Map<String,Object> jpaProperties)
Specify JPA properties as a Map, to be passed into EntityManagerFactory.createEntityManager(Map) (if any).

Can be populated with a "map" or "props" element in XML bean definitions.

See Also:
EntityManagerFactory.createEntityManager(java.util.Map)

getJpaPropertyMap

public Map<String,Object> getJpaPropertyMap()
Allow Map access to the JPA properties to be passed to the persistence provider, with the option to add or override specific entries.

Useful for specifying entries directly, for example via "jpaPropertyMap[myKey]".

createEntityManager

protected javax.persistence.EntityManager createEntityManager()
                                                       throws IllegalStateException
Obtain a new EntityManager from this accessor's EntityManagerFactory.

Can be overridden in subclasses to create specific EntityManager variants.

Returns:
a new EntityManager
Throws:
IllegalStateException - if this accessor is not configured with an EntityManagerFactory
See Also:
EntityManagerFactory.createEntityManager(), EntityManagerFactory.createEntityManager(java.util.Map)

getTransactionalEntityManager

protected javax.persistence.EntityManager getTransactionalEntityManager()
                                                                 throws IllegalStateException
Obtain the transactional EntityManager for this accessor's EntityManagerFactory, if any.

Returns:
the transactional EntityManager, or null if none
Throws:
IllegalStateException - if this accessor is not configured with an EntityManagerFactory
See Also:
EntityManagerFactoryUtils.getTransactionalEntityManager(javax.persistence.EntityManagerFactory), EntityManagerFactoryUtils.getTransactionalEntityManager(javax.persistence.EntityManagerFactory, java.util.Map)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EntityManagerFactoryUtils

org.springframework.orm.jpa
Class EntityManagerFactoryUtils

java.lang.Object
    extended by  org.springframework.orm.jpa.EntityManagerFactoryUtils

public abstract class EntityManagerFactoryUtils
extends Object

Helper class featuring methods for JPA EntityManager handling, allowing for reuse of EntityManager instances within transactions. Also provides support for exception translation.

Mainly intended for internal use within the framework.

Since:
2.0
Author:
Juergen Hoeller

Field Summary
static int ENTITY_MANAGER_SYNCHRONIZATION_ORDER
Order value for TransactionSynchronization objects that clean up JPA EntityManagers.
Constructor Summary
EntityManagerFactoryUtils()
Method Summary
static void | applyTransactionTimeout(javax.persistence.Query query, javax.persistence.EntityManagerFactory emf) Apply the current transaction timeout, if any, to the given JPA Query object.
static void | closeEntityManager(javax.persistence.EntityManager em) Close the given JPA EntityManager, catching and logging any cleanup exceptions thrown.
static DataAccessException | convertJpaAccessExceptionIfPossible(RuntimeException ex) Convert the given runtime exception to an appropriate exception from the org.springframework.dao hierarchy.
static javax.persistence.EntityManager | doGetTransactionalEntityManager(javax.persistence.EntityManagerFactory emf, Map properties) Obtain a JPA EntityManager from the given factory.
static javax.persistence.EntityManagerFactory | findEntityManagerFactory(ListableBeanFactory beanFactory, String unitName) Find an EntityManagerFactory with the given name in the given Spring application context (represented as ListableBeanFactory).
static javax.persistence.EntityManager | getTransactionalEntityManager(javax.persistence.EntityManagerFactory emf) Obtain a JPA EntityManager from the given factory.
static javax.persistence.EntityManager | getTransactionalEntityManager(javax.persistence.EntityManagerFactory emf, Map properties) Obtain a JPA EntityManager from the given factory.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

ENTITY_MANAGER_SYNCHRONIZATION_ORDER

public static final int ENTITY_MANAGER_SYNCHRONIZATION_ORDER
Order value for TransactionSynchronization objects that clean up JPA EntityManagers. Return DataSourceUtils.CONNECTION_SYNCHRONIZATION_ORDER - 100 to execute EntityManager cleanup before JDBC Connection cleanup, if any.

See Also:
DataSourceUtils.CONNECTION_SYNCHRONIZATION_ORDER, Constant Field Values
Constructor Detail

EntityManagerFactoryUtils

public EntityManagerFactoryUtils()
Method Detail

findEntityManagerFactory

public static javax.persistence.EntityManagerFactory findEntityManagerFactory(ListableBeanFactory beanFactory,
                                                                              String unitName)
                                                                       throws NoSuchBeanDefinitionException
Find an EntityManagerFactory with the given name in the given Spring application context (represented as ListableBeanFactory).

The specified unit name will be matched against the configured peristence unit, provided that a discovered EntityManagerFactory implements the EntityManagerFactoryInfo interface. If not, the persistence unit name will be matched against the Spring bean name, assuming that the EntityManagerFactory bean names follow that convention.

Parameters:
beanFactory - the ListableBeanFactory to search
unitName - the name of the persistence unit (never empty)
Returns:
the EntityManagerFactory
Throws:
NoSuchBeanDefinitionException - if there is no such EntityManagerFactory in the context
See Also:
EntityManagerFactoryInfo.getPersistenceUnitName()

getTransactionalEntityManager

public static javax.persistence.EntityManager getTransactionalEntityManager(javax.persistence.EntityManagerFactory emf)
                                                                     throws DataAccessResourceFailureException
Obtain a JPA EntityManager from the given factory. Is aware of a corresponding EntityManager bound to the current thread, for example when using JpaTransactionManager.

Note: Will return null if no thread-bound EntityManager found!

Parameters:
emf - EntityManagerFactory to create the EntityManager with
Returns:
the EntityManager, or null if none found
Throws:
DataAccessResourceFailureException - if the EntityManager couldn't be obtained
See Also:
JpaTransactionManager

getTransactionalEntityManager

public static javax.persistence.EntityManager getTransactionalEntityManager(javax.persistence.EntityManagerFactory emf,
                                                                            Map properties)
                                                                     throws DataAccessResourceFailureException
Obtain a JPA EntityManager from the given factory. Is aware of a corresponding EntityManager bound to the current thread, for example when using JpaTransactionManager.

Note: Will return null if no thread-bound EntityManager found!

Parameters:
emf - EntityManagerFactory to create the EntityManager with
properties - the properties to be passed into the createEntityManager call (may be null)
Returns:
the EntityManager, or null if none found
Throws:
DataAccessResourceFailureException - if the EntityManager couldn't be obtained
See Also:
JpaTransactionManager

doGetTransactionalEntityManager

public static javax.persistence.EntityManager doGetTransactionalEntityManager(javax.persistence.EntityManagerFactory emf,
                                                                              Map properties)
                                                                       throws javax.persistence.PersistenceException
Obtain a JPA EntityManager from the given factory. Is aware of a corresponding EntityManager bound to the current thread, for example when using JpaTransactionManager.

Same as getEntityManager, but throwing the original PersistenceException.

Parameters:
emf - EntityManagerFactory to create the EntityManager with
properties - the properties to be passed into the createEntityManager call (may be null)
Returns:
the EntityManager, or null if none found
Throws:
javax.persistence.PersistenceException - if the EntityManager couldn't be created
See Also:
getTransactionalEntityManager(javax.persistence.EntityManagerFactory), JpaTransactionManager

applyTransactionTimeout

public static void applyTransactionTimeout(javax.persistence.Query query,
                                           javax.persistence.EntityManagerFactory emf)
Apply the current transaction timeout, if any, to the given JPA Query object.

This method sets the JPA 2.0 query hints "javax.persistence.lock.timeout" and "javax.persistence.query.timeout" accordingly.

Parameters:
query - the JPA Query object
emf - JPA EntityManagerFactory that the Query was created for

convertJpaAccessExceptionIfPossible

public static DataAccessException convertJpaAccessExceptionIfPossible(RuntimeException ex)
Convert the given runtime exception to an appropriate exception from the org.springframework.dao hierarchy. Return null if no translation is appropriate: any other exception may have resulted from user code, and should not be translated.

The most important cases like object not found or optimistic locking failure are covered here. For more fine-granular conversion, JpaAccessor and JpaTransactionManager support sophisticated translation of exceptions via a JpaDialect.

Parameters:
ex - runtime exception that occured
Returns:
the corresponding DataAccessException instance, or null if the exception should not be translated

closeEntityManager

public static void closeEntityManager(javax.persistence.EntityManager em)
Close the given JPA EntityManager, catching and logging any cleanup exceptions thrown.

Parameters:
em - the JPA EntityManager to close (may be null)
See Also:
EntityManager.close()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EntityManagerHolder

org.springframework.orm.jpa
Class EntityManagerHolder

java.lang.Object
    extended by  org.springframework.transaction.support.ResourceHolderSupport
        extended by  org.springframework.orm.jpa.EntityManagerHolder
All Implemented Interfaces:
ResourceHolder
public class EntityManagerHolder
extends ResourceHolderSupport

Holder wrapping a JPA EntityManager. JpaTransactionManager binds instances of this class to the thread, for a given EntityManagerFactory.

Note: This is an SPI class, not intended to be used by applications.

Since:
2.0
Author:
Juergen Hoeller
See Also:
JpaTransactionManager, EntityManagerFactoryUtils

Constructor Summary
EntityManagerHolder(javax.persistence.EntityManager entityManager)
Method Summary
void | clear() Clear the transactional state of this resource holder.
javax.persistence.EntityManager | getEntityManager()
protected SavepointManager | getSavepointManager()
protected boolean | isTransactionActive()
protected void | setSavepointManager(SavepointManager savepointManager)
protected void | setTransactionActive(boolean transactionActive)
Methods inherited from class org.springframework.transaction.support.ResourceHolderSupport
getDeadline, getTimeToLiveInMillis, getTimeToLiveInSeconds, hasTimeout, isOpen, isRollbackOnly, isSynchronizedWithTransaction, isVoid, released, requested, reset, setRollbackOnly, setSynchronizedWithTransaction, setTimeoutInMillis, setTimeoutInSeconds, unbound
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

EntityManagerHolder

public EntityManagerHolder(javax.persistence.EntityManager entityManager)
Method Detail

getEntityManager

public javax.persistence.EntityManager getEntityManager()

setTransactionActive

protected void setTransactionActive(boolean transactionActive)

isTransactionActive

protected boolean isTransactionActive()

setSavepointManager

protected void setSavepointManager(SavepointManager savepointManager)

getSavepointManager

protected SavepointManager getSavepointManager()

clear

public void clear()
Description copied from class: ResourceHolderSupport
Clear the transactional state of this resource holder.

Overrides:
clear in class ResourceHolderSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ExtendedEntityManagerCreator

org.springframework.orm.jpa
Class ExtendedEntityManagerCreator

java.lang.Object
    extended by  org.springframework.orm.jpa.ExtendedEntityManagerCreator

public abstract class ExtendedEntityManagerCreator
extends Object

Factory for dynamic EntityManager proxies that follow the JPA spec's semantics for "extended" EntityManagers.

Supports explicit joining of a transaction through the joinTransaction() method ("application-managed extended EntityManager") as well as automatic joining on each operation ("container-managed extended EntityManager").

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller

Constructor Summary
ExtendedEntityManagerCreator()
Method Summary
static javax.persistence.EntityManager createApplicationManagedEntityManager(javax.persistence.EntityManager rawEntityManager, EntityManagerFactoryInfo emfInfo)
Create an EntityManager that can join transactions with the joinTransaction() method, but is not automatically managed by the container.
static javax.persistence.EntityManager createApplicationManagedEntityManager(javax.persistence.EntityManager rawEntityManager, EntityManagerPlusOperations plusOperations)
Create an EntityManager that can join transactions with the joinTransaction() method, but is not automatically managed by the container.
static javax.persistence.EntityManager createApplicationManagedEntityManager(javax.persistence.EntityManager rawEntityManager, EntityManagerPlusOperations plusOperations, PersistenceExceptionTranslator exceptionTranslator)
Create an EntityManager that can join transactions with the joinTransaction() method, but is not automatically managed by the container.
static javax.persistence.EntityManager createContainerManagedEntityManager(javax.persistence.EntityManager rawEntityManager, EntityManagerFactoryInfo emfInfo)
Create an EntityManager that automatically joins transactions on each operation in a transaction.
static javax.persistence.EntityManager createContainerManagedEntityManager(javax.persistence.EntityManager rawEntityManager, EntityManagerPlusOperations plusOperations)
Create an EntityManager that automatically joins transactions on each operation in a transaction.
static javax.persistence.EntityManager createContainerManagedEntityManager(javax.persistence.EntityManager rawEntityManager, EntityManagerPlusOperations plusOperations, PersistenceExceptionTranslator exceptionTranslator)
Create an EntityManager that automatically joins transactions on each operation in a transaction.
static javax.persistence.EntityManager createContainerManagedEntityManager(javax.persistence.EntityManagerFactory emf)
Create an EntityManager that automatically joins transactions on each operation in a transaction.
static javax.persistence.EntityManager createContainerManagedEntityManager(javax.persistence.EntityManagerFactory emf, Map properties)
Create an EntityManager that automatically joins transactions on each operation in a transaction.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ExtendedEntityManagerCreator

public ExtendedEntityManagerCreator()
Method Detail

createApplicationManagedEntityManager

public static javax.persistence.EntityManager createApplicationManagedEntityManager(javax.persistence.EntityManager rawEntityManager,
                                                                                EntityManagerPlusOperations plusOperations)
Create an EntityManager that can join transactions with the joinTransaction() method, but is not automatically managed by the container.

Parameters:
rawEntityManager - raw EntityManager
plusOperations - an implementation of the EntityManagerPlusOperations interface, if those operations should be exposed (may be null)
Returns:
an application-managed EntityManager that can join transactions but does not participate in them automatically

createApplicationManagedEntityManager

public static javax.persistence.EntityManager createApplicationManagedEntityManager(javax.persistence.EntityManager rawEntityManager,
                                                                                EntityManagerPlusOperations plusOperations,
                                                                                PersistenceExceptionTranslator exceptionTranslator)
Create an EntityManager that can join transactions with the joinTransaction() method, but is not automatically managed by the container.

Parameters:
rawEntityManager - raw EntityManager
plusOperations - an implementation of the EntityManagerPlusOperations interface, if those operations should be exposed (may be null)
exceptionTranslator - the exception translator to use for translating JPA commit/rollback exceptions during transaction synchronization (may be null)
Returns:
an application-managed EntityManager that can join transactions but does not participate in them automatically

createApplicationManagedEntityManager

public static javax.persistence.EntityManager createApplicationManagedEntityManager(javax.persistence.EntityManager rawEntityManager,
                                                                                EntityManagerFactoryInfo emfInfo)
Create an EntityManager that can join transactions with the joinTransaction() method, but is not automatically managed by the container.

Parameters:
rawEntityManager - raw EntityManager
emfInfo - the EntityManagerFactoryInfo to obtain the EntityManagerPlusOperations and PersistenceUnitInfo from
Returns:
an application-managed EntityManager that can join transactions but does not participate in them automatically

createContainerManagedEntityManager

public static javax.persistence.EntityManager createContainerManagedEntityManager(javax.persistence.EntityManager rawEntityManager,
                                                                                EntityManagerPlusOperations plusOperations)
Create an EntityManager that automatically joins transactions on each operation in a transaction.

Parameters:
rawEntityManager - raw EntityManager
plusOperations - an implementation of the EntityManagerPlusOperations interface, if those operations should be exposed (may be null)
Returns:
a container-managed EntityManager that will automatically participate in any managed transaction

createContainerManagedEntityManager

public static javax.persistence.EntityManager createContainerManagedEntityManager(javax.persistence.EntityManager rawEntityManager,
                                                                                EntityManagerPlusOperations plusOperations,
                                                                                PersistenceExceptionTranslator exceptionTranslator)
Create an EntityManager that automatically joins transactions on each operation in a transaction.

Parameters:
rawEntityManager - raw EntityManager
plusOperations - an implementation of the EntityManagerPlusOperations interface, if those operations should be exposed (may be null)
exceptionTranslator - the exception translator to use for translating JPA commit/rollback exceptions during transaction synchronization (may be null)
Returns:
a container-managed EntityManager that will automatically participate in any managed transaction

createContainerManagedEntityManager

public static javax.persistence.EntityManager createContainerManagedEntityManager(javax.persistence.EntityManager rawEntityManager,
                                                                                EntityManagerFactoryInfo emfInfo)
Create an EntityManager that automatically joins transactions on each operation in a transaction.

Parameters:
rawEntityManager - raw EntityManager
emfInfo - the EntityManagerFactoryInfo to obtain the EntityManagerPlusOperations and PersistenceUnitInfo from
Returns:
a container-managed EntityManager that will automatically participate in any managed transaction

createContainerManagedEntityManager

public static javax.persistence.EntityManager createContainerManagedEntityManager(javax.persistence.EntityManagerFactory emf)
Create an EntityManager that automatically joins transactions on each operation in a transaction.

Parameters:
emf - the EntityManagerFactory to create the EntityManager with. If this implements the EntityManagerFactoryInfo interface, appropriate handling of the native EntityManagerFactory and available EntityManagerPlusOperations will automatically apply.
Returns:
a container-managed EntityManager that will automatically participate in any managed transaction
See Also:
EntityManagerFactory.createEntityManager()

createContainerManagedEntityManager

public static javax.persistence.EntityManager createContainerManagedEntityManager(javax.persistence.EntityManagerFactory emf,
                                                                                Map properties)
Create an EntityManager that automatically joins transactions on each operation in a transaction.

Parameters:
emf - the EntityManagerFactory to create the EntityManager with. If this implements the EntityManagerFactoryInfo interface, appropriate handling of the native EntityManagerFactory and available EntityManagerPlusOperations will automatically apply.
properties - the properties to be passed into the createEntityManager call (may be null)
Returns:
a container-managed EntityManager that will automatically participate in any managed transaction
See Also:
EntityManagerFactory.createEntityManager(java.util.Map)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JpaAccessor

org.springframework.orm.jpa
Class JpaAccessor

java.lang.Object
    extended by  org.springframework.orm.jpa.EntityManagerFactoryAccessor
        extended by  org.springframework.orm.jpa.JpaAccessor
All Implemented Interfaces:
InitializingBean
Direct Known Subclasses:
JpaInterceptor, JpaTemplate
public abstract class JpaAccessor
extends EntityManagerFactoryAccessor
implements InitializingBean

Base class for JpaTemplate and JpaInterceptor, defining common properties such as EntityManagerFactory and flushing behavior.

Not intended to be used directly. See JpaTemplate and JpaInterceptor.

Since:
2.0
Author:
Juergen Hoeller
See Also:
EntityManagerFactoryAccessor.setEntityManagerFactory(javax.persistence.EntityManagerFactory), setEntityManager(javax.persistence.EntityManager), setJpaDialect(org.springframework.orm.jpa.JpaDialect), setFlushEager(boolean), JpaTemplate, JpaInterceptor, JpaDialect

Field Summary
Fields inherited from class org.springframework.orm.jpa.EntityManagerFactoryAccessor
logger
Constructor Summary
JpaAccessor()
Method Summary
void | afterPropertiesSet() Eagerly initialize the JPA dialect, creating a default one for the specified EntityManagerFactory if none set.
protected void | flushIfNecessary(javax.persistence.EntityManager em, boolean existingTransaction) Flush the given JPA entity manager if necessary.
javax.persistence.EntityManager | getEntityManager() Return the JPA EntityManager to use.
JpaDialect | getJpaDialect() Return the JPA dialect to use for this accessor.
boolean | isFlushEager() Return if this accessor should flush changes to the database eagerly.
void | setEntityManager(javax.persistence.EntityManager entityManager) Set the JPA EntityManager to use.
void | setFlushEager(boolean flushEager) Set if this accessor should flush changes to the database eagerly.
void | setJpaDialect(JpaDialect jpaDialect) Set the JPA dialect to use for this accessor.
RuntimeException | translateIfNecessary(RuntimeException ex) Convert the given runtime exception to an appropriate exception from the org.springframework.dao hierarchy if necessary, or return the exception itself if it is not persistence related
Methods inherited from class org.springframework.orm.jpa.EntityManagerFactoryAccessor
createEntityManager, getEntityManagerFactory, getJpaPropertyMap, getTransactionalEntityManager, setEntityManagerFactory, setJpaProperties, setJpaPropertyMap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JpaAccessor

public JpaAccessor()
Method Detail

setEntityManager

public void setEntityManager(javax.persistence.EntityManager entityManager)
Set the JPA EntityManager to use.

getEntityManager

public javax.persistence.EntityManager getEntityManager()
Return the JPA EntityManager to use.

setJpaDialect

public void setJpaDialect(JpaDialect jpaDialect)
Set the JPA dialect to use for this accessor.

The dialect object can be used to retrieve the underlying JDBC connection, for example.

getJpaDialect

public JpaDialect getJpaDialect()
Return the JPA dialect to use for this accessor.

Creates a default one for the specified EntityManagerFactory if none set.

setFlushEager

public void setFlushEager(boolean flushEager)
Set if this accessor should flush changes to the database eagerly.

Eager flushing leads to immediate synchronization with the database, even if in a transaction. This causes inconsistencies to show up and throw a respective exception immediately, and JDBC access code that participates in the same transaction will see the changes as the database is already aware of them then. But the drawbacks are:

  • additional communication roundtrips with the database, instead of a single batch at transaction commit;
  • the fact that an actual database rollback is needed if the JPA transaction rolls back (due to already submitted SQL statements).

isFlushEager

public boolean isFlushEager()
Return if this accessor should flush changes to the database eagerly.

afterPropertiesSet

public void afterPropertiesSet()
Eagerly initialize the JPA dialect, creating a default one for the specified EntityManagerFactory if none set.

Specified by:
afterPropertiesSet in interface InitializingBean

flushIfNecessary

protected void flushIfNecessary(javax.persistence.EntityManager em,
                                boolean existingTransaction)
                         throws javax.persistence.PersistenceException
Flush the given JPA entity manager if necessary.

Parameters:
em - the current JPA PersistenceManage
existingTransaction - if executing within an existing transaction
Throws:
javax.persistence.PersistenceException - in case of JPA flushing errors

translateIfNecessary

public RuntimeException translateIfNecessary(RuntimeException ex)
Convert the given runtime exception to an appropriate exception from the org.springframework.dao hierarchy if necessary, or return the exception itself if it is not persistence related

Default implementation delegates to the JpaDialect. May be overridden in subclasses.

Parameters:
ex - runtime exception that occured, which may or may not be JPA-related
Returns:
the corresponding DataAccessException instance if wrapping should occur, otherwise the raw exception
See Also:
DataAccessUtils.translateIfNecessary(java.lang.RuntimeException, org.springframework.dao.support.PersistenceExceptionTranslator)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JpaInterceptor

org.springframework.orm.jpa
Class JpaInterceptor

java.lang.Object
    extended by  org.springframework.orm.jpa.EntityManagerFactoryAccessor
        extended by  org.springframework.orm.jpa.JpaAccessor
            extended by  org.springframework.orm.jpa.JpaInterceptor
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, InitializingBean
public class JpaInterceptor
extends JpaAccessor
implements MethodInterceptor

This interceptor binds a new JPA EntityManager to the thread before a method call, closing and removing it afterwards in case of any method outcome. If there already is a pre-bound EntityManager (e.g. from JpaTransactionManager, or from a surrounding JPA-intercepted method), the interceptor simply participates in it.

Application code must retrieve a JPA EntityManager via the EntityManagerFactoryUtils.getEntityManager method or - preferably - via a shared EntityManager reference, to be able to detect a thread-bound EntityManager. Typically, the code will look like as follows:

 public void doSomeDataAccessAction() {
   this.entityManager...
 }

Note that this interceptor automatically translates PersistenceExceptions, via delegating to the EntityManagerFactoryUtils.convertJpaAccessException method that converts them to exceptions that are compatible with the org.springframework.dao exception hierarchy (like JpaTemplate does).

This class can be considered a declarative alternative to JpaTemplate's callback approach. The advantages are:

  • no anonymous classes necessary for callback implementations;
  • the possibility to throw any application exceptions from within data access code.

The drawback is the dependency on interceptor configuration. However, note that this interceptor is usually not necessary in scenarios where the data access code always executes within transactions. A transaction will always have a thread-bound EntityManager in the first place, so adding this interceptor to the configuration just adds value when fine-tuning EntityManager settings like the flush mode - or when relying on exception translation.

Since:
2.0
Author:
Juergen Hoeller
See Also:
JpaTransactionManager, JpaTemplate

Field Summary
Fields inherited from class org.springframework.orm.jpa.EntityManagerFactoryAccessor
logger
Constructor Summary
JpaInterceptor()
Method Summary
Object | invoke(MethodInvocation methodInvocation)
void | setExceptionConversionEnabled(boolean exceptionConversionEnabled) Set whether to convert any PersistenceException raised to a Spring DataAccessException, compatible with the org.springframework.dao exception hierarchy.
Methods inherited from class org.springframework.orm.jpa.JpaAccessor
afterPropertiesSet, flushIfNecessary, getEntityManager, getJpaDialect, isFlushEager, setEntityManager, setFlushEager, setJpaDialect, translateIfNecessary
Methods inherited from class org.springframework.orm.jpa.EntityManagerFactoryAccessor
createEntityManager, getEntityManagerFactory, getJpaPropertyMap, getTransactionalEntityManager, setEntityManagerFactory, setJpaProperties, setJpaPropertyMap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JpaInterceptor

public JpaInterceptor()
Method Detail

setExceptionConversionEnabled

public void setExceptionConversionEnabled(boolean exceptionConversionEnabled)
Set whether to convert any PersistenceException raised to a Spring DataAccessException, compatible with the org.springframework.dao exception hierarchy.

Default is "true". Turn this flag off to let the caller receive raw exceptions as-is, without any wrapping.

See Also:
DataAccessException

invoke

public Object invoke(MethodInvocation methodInvocation)
              throws Throwable
Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JpaTemplate

org.springframework.orm.jpa
Class JpaTemplate

java.lang.Object
    extended by  org.springframework.orm.jpa.EntityManagerFactoryAccessor
        extended by  org.springframework.orm.jpa.JpaAccessor
            extended by  org.springframework.orm.jpa.JpaTemplate
All Implemented Interfaces:
InitializingBean, JpaOperations
public class JpaTemplate
extends JpaAccessor
implements JpaOperations

Helper class that allows for writing JPA data access code in the same style as with Spring's well-known JdoTemplate and HibernateTemplate classes. Automatically converts PersistenceExceptions into Spring DataAccessExceptions, following the org.springframework.dao exception hierarchy.

The central method is of this template is "execute", supporting JPA access code implementing the JpaCallback interface. It provides JPA EntityManager handling such that neither the JpaCallback implementation nor the calling code needs to explicitly care about retrieving/closing EntityManagers, or handling JPA lifecycle exceptions.

Can be used within a service implementation via direct instantiation with a EntityManagerFactory reference, or get prepared in an application context and given to services as bean reference. Note: The EntityManagerFactory should always be configured as bean in the application context, in the first case given to the service directly, in the second case to the prepared template.

NOTE: JpaTemplate mainly exists as a sibling of JdoTemplate and HibernateTemplate, offering the same style for people used to it. For newly started projects, consider adopting the standard JPA style of coding data access objects instead, based on a "shared EntityManager" reference injected via a Spring bean definition or the JPA PersistenceContext annotation. (Using Spring's SharedEntityManagerBean / PersistenceAnnotationBeanPostProcessor, or using a direct JNDI lookup for an EntityManager on a Java EE 5 server.)

JpaTemplate can be considered as direct alternative to working with the native JPA EntityManager API (through a shared EntityManager reference, as outlined above). The major advantage is its automatic conversion to DataAccessExceptions; the major disadvantage is that it introduces another thin layer on top of the native JPA API. Note that exception translation can also be achieved through AOP advice; check out PersistenceExceptionTranslationPostProcessor.

LocalContainerEntityManagerFactoryBean is the preferred way of obtaining a reference to an EntityManagerFactory, at least outside of a full Java EE 5 environment. The Spring application context will manage its lifecycle, initializing and shutting down the factory as part of the application. Within a Java EE 5 environment, you will typically work with a server-managed EntityManagerFactory that is exposed via JNDI, obtained through Spring's JndiObjectFactoryBean.

Since:
2.0
Author:
Juergen Hoeller
See Also:
EntityManagerFactoryAccessor.setEntityManagerFactory(javax.persistence.EntityManagerFactory), JpaCallback, EntityManager, LocalEntityManagerFactoryBean, LocalContainerEntityManagerFactoryBean, JpaTransactionManager, JtaTransactionManager, OpenEntityManagerInViewFilter, OpenEntityManagerInViewInterceptor

Field Summary
Fields inherited from class org.springframework.orm.jpa.EntityManagerFactoryAccessor
logger
Constructor Summary
JpaTemplate()
Create a new JpaTemplate instance.
JpaTemplate(javax.persistence.EntityManager em)
Create a new JpaTemplate instance.
JpaTemplate(javax.persistence.EntityManagerFactory emf)
Create a new JpaTemplate instance.
Method Summary
 boolean contains(Object entity)
protected  javax.persistence.EntityManager createEntityManagerProxy(javax.persistence.EntityManager em)
Create a close-suppressing proxy for the given JPA EntityManager.
<T> T
execute(JpaCallback<T> action)
<T> T
execute(JpaCallback<T> action, boolean exposeNativeEntityManager)
Execute the action specified by the given action object within a EntityManager.
 List executeFind(JpaCallback<?> action)
<T> T
find(Class<T> entityClass, Object id)
 List find(String queryString)
 List find(String queryString, Object... values)
 List findByNamedParams(String queryString, Map<String,?> params)
 List findByNamedQuery(String queryName)
 List findByNamedQuery(String queryName, Object... values)
 List findByNamedQueryAndNamedParams(String queryName, Map<String,?> params)
 void flush()
<T> T
getReference(Class<T> entityClass, Object id)
 boolean isExposeNativeEntityManager()
Return whether to expose the native JPA EntityManager to JpaCallback code, or rather an EntityManager proxy.
<T> T
merge(T entity)
 void persist(Object entity)
 void prepareQuery(javax.persistence.Query query)
Prepare the given JPA query object.
 void refresh(Object entity)
 void remove(Object entity)
 void setExposeNativeEntityManager(boolean exposeNativeEntityManager)
Set whether to expose the native JPA EntityManager to JpaCallback code.
Methods inherited from class org.springframework.orm.jpa.JpaAccessor
afterPropertiesSet, flushIfNecessary, getEntityManager, getJpaDialect, isFlushEager, setEntityManager, setFlushEager, setJpaDialect, translateIfNecessary
Methods inherited from class org.springframework.orm.jpa.EntityManagerFactoryAccessor
createEntityManager, getEntityManagerFactory, getJpaPropertyMap, getTransactionalEntityManager, setEntityManagerFactory, setJpaProperties, setJpaPropertyMap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JpaTemplate

public JpaTemplate()
Create a new JpaTemplate instance.

JpaTemplate

public JpaTemplate(javax.persistence.EntityManagerFactory emf)
Create a new JpaTemplate instance.

Parameters:
emf - EntityManagerFactory to create EntityManagers

JpaTemplate

public JpaTemplate(javax.persistence.EntityManager em)
Create a new JpaTemplate instance.

Parameters:
em - EntityManager to use
Method Detail

setExposeNativeEntityManager

public void setExposeNativeEntityManager(boolean exposeNativeEntityManager)
Set whether to expose the native JPA EntityManager to JpaCallback code. Default is "false": a EntityManager proxy will be returned, suppressing close calls and automatically applying transaction timeouts (if any).

As there is often a need to cast to a provider-specific EntityManager class in DAOs that use the JPA 1.0 API, for JPA 2.0 previews and other provider-specific functionality, the exposed proxy implements all interfaces implemented by the original EntityManager. If this is not sufficient, turn this flag to "true".

See Also:
JpaCallback, EntityManager

isExposeNativeEntityManager

public boolean isExposeNativeEntityManager()
Return whether to expose the native JPA EntityManager to JpaCallback code, or rather an EntityManager proxy.

execute

public <T> T execute(JpaCallback<T> action)
          throws DataAccessException
Specified by:
execute in interface JpaOperations
Throws:
DataAccessException

executeFind

public List executeFind(JpaCallback<?> action)
                 throws DataAccessException
Specified by:
executeFind in interface JpaOperations
Throws:
DataAccessException

execute

public <T> T execute(JpaCallback<T> action,
                     boolean exposeNativeEntityManager)
          throws DataAccessException
Execute the action specified by the given action object within a EntityManager.

Parameters:
action - callback object that specifies the JPA action
exposeNativeEntityManager - whether to expose the native JPA entity manager to callback code
Returns:
a result object returned by the action, or null
Throws:
DataAccessException - in case of JPA errors

createEntityManagerProxy

protected javax.persistence.EntityManager createEntityManagerProxy(javax.persistence.EntityManager em)
Create a close-suppressing proxy for the given JPA EntityManager. The proxy also prepares returned JPA Query objects.

Parameters:
em - the JPA EntityManager to create a proxy for
Returns:
the EntityManager proxy, implementing all interfaces implemented by the passed-in EntityManager object (that is, also implementing all provider-specific extension interfaces)
See Also:
EntityManager.close()

find

public <T> T find(Class<T> entityClass,
                  Object id)
       throws DataAccessException
Specified by:
find in interface JpaOperations
Throws:
DataAccessException

getReference

public <T> T getReference(Class<T> entityClass,
                          Object id)
               throws DataAccessException
Specified by:
getReference in interface JpaOperations
Throws:
DataAccessException

contains

public boolean contains(Object entity)
                 throws DataAccessException
Specified by:
contains in interface JpaOperations
Throws:
DataAccessException

refresh

public void refresh(Object entity)
             throws DataAccessException
Specified by:
refresh in interface JpaOperations
Throws:
DataAccessException

persist

public void persist(Object entity)
             throws DataAccessException
Specified by:
persist in interface JpaOperations
Throws:
DataAccessException

merge

public <T> T merge(T entity)
        throws DataAccessException
Specified by:
merge in interface JpaOperations
Throws:
DataAccessException

remove

public void remove(Object entity)
            throws DataAccessException
Specified by:
remove in interface JpaOperations
Throws:
DataAccessException

flush

public void flush()
           throws DataAccessException
Specified by:
flush in interface JpaOperations
Throws:
DataAccessException

find

public List find(String queryString)
          throws DataAccessException
Specified by:
find in interface JpaOperations
Throws:
DataAccessException

find

public List find(String queryString,
                 Object... values)
          throws DataAccessException
Specified by:
find in interface JpaOperations
Throws:
DataAccessException

findByNamedParams

public List findByNamedParams(String queryString,
                              Map<String,?> params)
                       throws DataAccessException
Specified by:
findByNamedParams in interface JpaOperations
Throws:
DataAccessException

findByNamedQuery

public List findByNamedQuery(String queryName)
                      throws DataAccessException
Specified by:
findByNamedQuery in interface JpaOperations
Throws:
DataAccessException

findByNamedQuery

public List findByNamedQuery(String queryName,
                             Object... values)
                      throws DataAccessException
Specified by:
findByNamedQuery in interface JpaOperations
Throws:
DataAccessException

findByNamedQueryAndNamedParams

public List findByNamedQueryAndNamedParams(String queryName,
                                           Map<String,?> params)
                                    throws DataAccessException
Specified by:
findByNamedQueryAndNamedParams in interface JpaOperations
Throws:
DataAccessException

prepareQuery

public void prepareQuery(javax.persistence.Query query)
Prepare the given JPA query object. To be used within a JpaCallback.

Applies a transaction timeout, if any. If you don't use such timeouts, the call is a no-op.

In general, prefer a proxied EntityManager instead, which will automatically apply the transaction timeout (through the use of a special EntityManager proxy). You need to set the "exposeNativeEntityManager" property to "false" to activate this. Note that you won't be able to cast to a provider-specific JPA EntityManager class anymore then.

Parameters:
query - the JPA query object
See Also:
JpaCallback.doInJpa(javax.persistence.EntityManager),
EntityManagerFactoryUtils.applyTransactionTimeout(javax.persistence.Query, javax.persistence.EntityManagerFactory),
setExposeNativeEntityManager(boolean)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JpaTransactionManager

org.springframework.orm.jpa
Class JpaTransactionManager

java.lang.Object
    extended by  org.springframework.transaction.support.AbstractPlatformTransactionManager
        extended by  org.springframework.orm.jpa.JpaTransactionManager
All Implemented Interfaces:
Serializable, InitializingBean, PlatformTransactionManager, ResourceTransactionManager
public class JpaTransactionManager
extends AbstractPlatformTransactionManager
implements ResourceTransactionManager, InitializingBean

PlatformTransactionManager implementation for a single JPA EntityManagerFactory. Binds a JPA EntityManager from the specified factory to the thread, potentially allowing for one thread-bound EntityManager per factory. SharedEntityManagerCreator and JpaTemplate are aware of thread-bound entity managers and participate in such transactions automatically. Using either is required for JPA access code supporting this transaction management mechanism.

This transaction manager is appropriate for applications that use a single JPA EntityManagerFactory for transactional data access. JTA (usually through JtaTransactionManager) is necessary for accessing multiple transactional resources within the same transaction. Note that you need to configure your JPA provider accordingly in order to make it participate in JTA transactions.

This transaction manager also supports direct DataSource access within a transaction (i.e. plain JDBC code working with the same DataSource). This allows for mixing services which access JPA and services which use plain JDBC (without being aware of JPA)! Application code needs to stick to the same simple Connection lookup pattern as with DataSourceTransactionManager (i.e. DataSourceUtils.getConnection(javax.sql.DataSource) or going through a TransactionAwareDataSourceProxy). Note that this requires a vendor-specific JpaDialect to be configured.

Note: To be able to register a DataSource's Connection for plain JDBC code, this instance needs to be aware of the DataSource (setDataSource(javax.sql.DataSource)). The given DataSource should obviously match the one used by the given EntityManagerFactory. This transaction manager will autodetect the DataSource used as known connection factory of the EntityManagerFactory, so you usually don't need to explicitly specify the "dataSource" property.

On JDBC 3.0, this transaction manager supports nested transactions via JDBC 3.0 Savepoints. The AbstractPlatformTransactionManager.setNestedTransactionAllowed(boolean) "nestedTransactionAllowed"} flag defaults to "false", though, as nested transactions will just apply to the JDBC Connection, not to the JPA EntityManager and its cached objects. You can manually set the flag to "true" if you want to use nested transactions for JDBC access code which participates in JPA transactions (provided that your JDBC driver supports Savepoints). Note that JPA itself does not support nested transactions! Hence, do not expect JPA access code to semantically participate in a nested transaction.

Since:
2.0
Author:
Juergen Hoeller
See Also:
setEntityManagerFactory(javax.persistence.EntityManagerFactory), setDataSource(javax.sql.DataSource), LocalEntityManagerFactoryBean, JpaTemplate.execute(org.springframework.orm.jpa.JpaCallback), SharedEntityManagerBean, DataSourceUtils.getConnection(javax.sql.DataSource), DataSourceUtils.releaseConnection(java.sql.Connection, javax.sql.DataSource), JdbcTemplate, DataSourceTransactionManager, JtaTransactionManager, Serialized Form

Field Summary
Fields inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
logger, SYNCHRONIZATION_ALWAYS, SYNCHRONIZATION_NEVER, SYNCHRONIZATION_ON_ACTUAL_TRANSACTION
Constructor Summary
JpaTransactionManager()
Create a new JpaTransactionManager instance.
JpaTransactionManager(javax.persistence.EntityManagerFactory emf)
Create a new JpaTransactionManager instance.
Method Summary
 void afterPropertiesSet()
Eagerly initialize the JPA dialect, creating a default one for the specified EntityManagerFactory if none set.
protected  void closeEntityManagerAfterFailedBegin(org.springframework.orm.jpa.JpaTransactionManager.JpaTransactionObject txObject)
Close the current transaction's EntityManager.
protected  javax.persistence.EntityManager createEntityManagerForTransaction()
Create a JPA EntityManager to be used for a transaction.
protected  void doBegin(Object transaction, TransactionDefinition definition)
Begin a new transaction with semantics according to the given transaction definition.
protected  void doCleanupAfterCompletion(Object transaction)
Cleanup resources after transaction completion.
protected  void doCommit(DefaultTransactionStatus status)
Perform an actual commit of the given transaction.
protected  Object doGetTransaction()
Return a transaction object for the current transaction state.
protected  void doResume(Object transaction, Object suspendedResources)
Resume the resources of the current transaction.
protected  void doRollback(DefaultTransactionStatus status)
Perform an actual rollback of the given transaction.
protected  void doSetRollbackOnly(DefaultTransactionStatus status)
Set the given transaction rollback-only.
protected  Object doSuspend(Object transaction)
Suspend the resources of the current transaction.
 DataSource getDataSource()
Return the JDBC DataSource that this instance manages transactions for.
 javax.persistence.EntityManagerFactory getEntityManagerFactory()
Return the EntityManagerFactory that this instance should manage transactions for.
 JpaDialect getJpaDialect()
Return the JPA dialect to use for this transaction manager.
 Map<String,Object> getJpaPropertyMap()
Allow Map access to the JPA properties to be passed to the persistence provider, with the option to add or override specific entries.
 Object getResourceFactory()
Return the resource factory that this transaction manager operates on, e.g.
protected  boolean isExistingTransaction(Object transaction)
Check if the given transaction object indicates an existing transaction (that is, a transaction which has already started).
 void setDataSource(DataSource dataSource)
Set the JDBC DataSource that this instance should manage transactions for.
 void setEntityManagerFactory(javax.persistence.EntityManagerFactory emf)
Set the EntityManagerFactory that this instance should manage transactions for.
 void setJpaDialect(JpaDialect jpaDialect)
Set the JPA dialect to use for this transaction manager.
 void setJpaProperties(Properties jpaProperties)
Specify JPA properties, to be passed into EntityManagerFactory.createEntityManager(Map) (if any).
 void setJpaPropertyMap(Map<String,?> jpaProperties)
Specify JPA properties as a Map, to be passed into EntityManagerFactory.createEntityManager(Map) (if any).
protected  boolean shouldCommitOnGlobalRollbackOnly()
This implementation returns "true": a JPA commit will properly handle transactions that have been marked rollback-only at a global level.
Methods inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
commit, determineTimeout, getDefaultTimeout, getTransaction, getTransactionSynchronization, invokeAfterCompletion, isFailEarlyOnGlobalRollbackOnly, isGlobalRollbackOnParticipationFailure, isNestedTransactionAllowed, isRollbackOnCommitFailure, isValidateExistingTransaction, newTransactionStatus, prepareForCommit, prepareSynchronization, prepareTransactionStatus, registerAfterCompletionWithExistingTransaction, resume, rollback, setDefaultTimeout, setFailEarlyOnGlobalRollbackOnly, setGlobalRollbackOnParticipationFailure, setNestedTransactionAllowed, setRollbackOnCommitFailure, setTransactionSynchronization, setTransactionSynchronizationName, setValidateExistingTransaction, suspend, triggerBeforeCommit, triggerBeforeCompletion, useSavepointForNestedTransaction
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.transaction.PlatformTransactionManager
commit, getTransaction, rollback

Constructor Detail

JpaTransactionManager

public JpaTransactionManager()
Create a new JpaTransactionManager instance. A EntityManagerFactory has to be set to be able to use it.

See Also:
setEntityManagerFactory(javax.persistence.EntityManagerFactory)

JpaTransactionManager

public JpaTransactionManager(javax.persistence.EntityManagerFactory emf)
Create a new JpaTransactionManager instance.

Parameters:
emf - EntityManagerFactory to manage transactions for
Method Detail

setEntityManagerFactory

public void setEntityManagerFactory(javax.persistence.EntityManagerFactory emf)
Set the EntityManagerFactory that this instance should manage transactions for.

getEntityManagerFactory

public javax.persistence.EntityManagerFactory getEntityManagerFactory()
Return the EntityManagerFactory that this instance should manage transactions for.

setJpaProperties

public void setJpaProperties(Properties jpaProperties)
Specify JPA properties, to be passed into EntityManagerFactory.createEntityManager(Map) (if any).

Can be populated with a String "value" (parsed via PropertiesEditor) or a "props" element in XML bean definitions.

See Also:
EntityManagerFactory.createEntityManager(java.util.Map)

setJpaPropertyMap

public void setJpaPropertyMap(Map<String,?> jpaProperties)
Specify JPA properties as a Map, to be passed into EntityManagerFactory.createEntityManager(Map) (if any).

Can be populated with a "map" or "props" element in XML bean definitions.

See Also:
EntityManagerFactory.createEntityManager(java.util.Map)

getJpaPropertyMap

public Map<String,Object> getJpaPropertyMap()
Allow Map access to the JPA properties to be passed to the persistence provider, with the option to add or override specific entries.

Useful for specifying entries directly, for example via "jpaPropertyMap[myKey]".

setDataSource

public void setDataSource(DataSource dataSource)
Set the JDBC DataSource that this instance should manage transactions for. The DataSource should match the one used by the JPA EntityManagerFactory: for example, you could specify the same JNDI DataSource for both.

If the EntityManagerFactory uses a known DataSource as connection factory, the DataSource will be autodetected: You can still explictly specify the DataSource, but you don't need to in this case.

A transactional JDBC Connection for this DataSource will be provided to application code accessing this DataSource directly via DataSourceUtils or JdbcTemplate. The Connection will be taken from the JPA EntityManager.

Note that you need to use a JPA dialect for a specific JPA implementation to allow for exposing JPA transactions as JDBC transactions.

The DataSource specified here should be the target DataSource to manage transactions for, not a TransactionAwareDataSourceProxy. Only data access code may work with TransactionAwareDataSourceProxy, while the transaction manager needs to work on the underlying target DataSource. If there's nevertheless a TransactionAwareDataSourceProxy passed in, it will be unwrapped to extract its target DataSource.

See Also:
EntityManagerFactoryInfo.getDataSource(), setJpaDialect(org.springframework.orm.jpa.JpaDialect), TransactionAwareDataSourceProxy, DataSourceUtils, JdbcTemplate

getDataSource

public DataSource getDataSource()
Return the JDBC DataSource that this instance manages transactions for.

setJpaDialect

public void setJpaDialect(JpaDialect jpaDialect)
Set the JPA dialect to use for this transaction manager. Used for vendor-specific transaction management and JDBC connection exposure.

If the EntityManagerFactory uses a known JpaDialect, it will be autodetected: You can still explictly specify the DataSource, but you don't need to in this case.

The dialect object can be used to retrieve the underlying JDBC connection and thus allows for exposing JPA transactions as JDBC transactions.

See Also:
EntityManagerFactoryInfo.getJpaDialect(),
JpaDialect.beginTransaction(javax.persistence.EntityManager, org.springframework.transaction.TransactionDefinition),
JpaDialect.getJdbcConnection(javax.persistence.EntityManager, boolean)

getJpaDialect

public JpaDialect getJpaDialect()
Return the JPA dialect to use for this transaction manager.

afterPropertiesSet

public void afterPropertiesSet()
Eagerly initialize the JPA dialect, creating a default one for the specified EntityManagerFactory if none set. Auto-detect the EntityManagerFactory's DataSource, if any.

Specified by:
afterPropertiesSet in interface InitializingBean

getResourceFactory

public Object getResourceFactory()
Description copied from interface: ResourceTransactionManager
Return the resource factory that this transaction manager operates on, e.g. a JDBC DataSource or a JMS ConnectionFactory.

This target resource factory is usually used as resource key for TransactionSynchronizationManager's resource bindings per thread.

Specified by:
getResourceFactory in interface ResourceTransactionManager
Returns:
the target resource factory (never null)
See Also:
TransactionSynchronizationManager.bindResource(java.lang.Object, java.lang.Object), TransactionSynchronizationManager.getResource(java.lang.Object)

doGetTransaction

protected Object doGetTransaction()
Description copied from class: AbstractPlatformTransactionManager
Return a transaction object for the current transaction state.

The returned object will usually be specific to the concrete transaction manager implementation, carrying corresponding transaction state in a modifiable fashion. This object will be passed into the other template methods (e.g. doBegin and doCommit), either directly or as part of a DefaultTransactionStatus instance.

The returned object should contain information about any existing transaction, that is, a transaction that has already started before the current getTransaction call on the transaction manager. Consequently, a doGetTransaction implementation will usually look for an existing transaction and store corresponding state in the returned transaction object.

Specified by:
doGetTransaction in class AbstractPlatformTransactionManager
Returns:
the current transaction object
See Also:
AbstractPlatformTransactionManager.doBegin(java.lang.Object, org.springframework.transaction.TransactionDefinition),
AbstractPlatformTransactionManager.doCommit(org.springframework.transaction.support.DefaultTransactionStatus),
AbstractPlatformTransactionManager.doRollback(org.springframework.transaction.support.DefaultTransactionStatus),
DefaultTransactionStatus.getTransaction()

isExistingTransaction

protected boolean isExistingTransaction(Object transaction)
Description copied from class: AbstractPlatformTransactionManager
Check if the given transaction object indicates an existing transaction (that is, a transaction which has already started).

The result will be evaluated according to the specified propagation behavior for the new transaction. An existing transaction might get suspended (in case of PROPAGATION_REQUIRES_NEW), or the new transaction might participate in the existing one (in case of PROPAGATION_REQUIRED).

The default implementation returns false, assuming that participating in existing transactions is generally not supported. Subclasses are of course encouraged to provide such support.

Overrides:
isExistingTransaction in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
Returns:
if there is an existing transaction
See Also:
AbstractPlatformTransactionManager.doGetTransaction()

doBegin

protected void doBegin(Object transaction,
                       TransactionDefinition definition)
Description copied from class: AbstractPlatformTransactionManager
Begin a new transaction with semantics according to the given transaction definition. Does not have to care about applying the propagation behavior, as this has already been handled by this abstract manager.

This method gets called when the transaction manager has decided to actually start a new transaction. Either there wasn't any transaction before, or the previous transaction has been suspended.

A special scenario is a nested transaction without savepoint: If useSavepointForNestedTransaction() returns "false", this method will be called to start a nested transaction when necessary. In such a context, there will be an active transaction: The implementation of this method has to detect this and start an appropriate nested transaction.

Specified by:
doBegin in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
definition - TransactionDefinition instance, describing propagation behavior, isolation level, read-only flag, timeout, and transaction name

createEntityManagerForTransaction

protected javax.persistence.EntityManager createEntityManagerForTransaction()
Create a JPA EntityManager to be used for a transaction.

The default implementation checks whether the EntityManagerFactory is a Spring proxy and unwraps it first.

See Also:
EntityManagerFactory.createEntityManager(), EntityManagerFactoryInfo.getNativeEntityManagerFactory()

closeEntityManagerAfterFailedBegin

protected void closeEntityManagerAfterFailedBegin(org.springframework.orm.jpa.JpaTransactionManager.JpaTransactionObject txObject)
Close the current transaction's EntityManager. Called after a transaction begin attempt failed.

Parameters:
txObject - the current transaction

doSuspend

protected Object doSuspend(Object transaction)
Description copied from class: AbstractPlatformTransactionManager
Suspend the resources of the current transaction. Transaction synchronization will already have been suspended.

The default implementation throws a TransactionSuspensionNotSupportedException, assuming that transaction suspension is generally not supported.

Overrides:
doSuspend in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
Returns:
an object that holds suspended resources (will be kept unexamined for passing it into doResume)
See Also:
AbstractPlatformTransactionManager.doResume(java.lang.Object, java.lang.Object)

doResume

protected void doResume(Object transaction,
                        Object suspendedResources)
Description copied from class: AbstractPlatformTransactionManager
Resume the resources of the current transaction. Transaction synchronization will be resumed afterwards.

The default implementation throws a TransactionSuspensionNotSupportedException, assuming that transaction suspension is generally not supported.

Overrides:
doResume in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
suspendedResources - the object that holds suspended resources, as returned by doSuspend
See Also:
AbstractPlatformTransactionManager.doSuspend(java.lang.Object)

shouldCommitOnGlobalRollbackOnly

protected boolean shouldCommitOnGlobalRollbackOnly()
This implementation returns "true": a JPA commit will properly handle transactions that have been marked rollback-only at a global level.

Overrides:
shouldCommitOnGlobalRollbackOnly in class AbstractPlatformTransactionManager
See Also:
AbstractPlatformTransactionManager.doCommit(org.springframework.transaction.support.DefaultTransactionStatus),
DefaultTransactionStatus.isGlobalRollbackOnly(),
AbstractTransactionStatus.isLocalRollbackOnly(),
TransactionStatus.setRollbackOnly(),
UnexpectedRollbackException,
UserTransaction.commit(),
RollbackException

doCommit

protected void doCommit(DefaultTransactionStatus status)
Description copied from class: AbstractPlatformTransactionManager
Perform an actual commit of the given transaction.

An implementation does not need to check the "new transaction" flag or the rollback-only flag; this will already have been handled before. Usually, a straight commit will be performed on the transaction object contained in the passed-in status.

Specified by:
doCommit in class AbstractPlatformTransactionManager
Parameters:
status - the status representation of the transaction
See Also:
DefaultTransactionStatus.getTransaction()

doRollback

protected void doRollback(DefaultTransactionStatus status)
Description copied from class: AbstractPlatformTransactionManager
Perform an actual rollback of the given transaction.

An implementation does not need to check the "new transaction" flag; this will already have been handled before. Usually, a straight rollback will be performed on the transaction object contained in the passed-in status.

Specified by:
doRollback in class AbstractPlatformTransactionManager
Parameters:
status - the status representation of the transaction
See Also:
DefaultTransactionStatus.getTransaction()

doSetRollbackOnly

protected void doSetRollbackOnly(DefaultTransactionStatus status)
Description copied from class: AbstractPlatformTransactionManager
Set the given transaction rollback-only. Only called on rollback if the current transaction participates in an existing one.

The default implementation throws an IllegalTransactionStateException, assuming that participating in existing transactions is generally not supported. Subclasses are of course encouraged to provide such support.

Overrides:
doSetRollbackOnly in class AbstractPlatformTransactionManager
Parameters:
status - the status representation of the transaction

doCleanupAfterCompletion

protected void doCleanupAfterCompletion(Object transaction)
Description copied from class: AbstractPlatformTransactionManager
Cleanup resources after transaction completion.

Called after doCommit and doRollback execution, on any outcome. The default implementation does nothing.

Should not throw any exceptions but just issue warnings on errors.

Overrides:
doCleanupAfterCompletion in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LocalContainerEntityManagerFactoryBean

org.springframework.orm.jpa
Class LocalContainerEntityManagerFactoryBean

java.lang.Object
    extended by  org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
        extended by  org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean
All Implemented Interfaces:
Serializable, BeanClassLoaderAware, BeanFactoryAware, BeanNameAware, DisposableBean, FactoryBean<javax.persistence.EntityManagerFactory>, InitializingBean, ResourceLoaderAware, LoadTimeWeaverAware, PersistenceExceptionTranslator, EntityManagerFactoryInfo
public class LocalContainerEntityManagerFactoryBean
extends AbstractEntityManagerFactoryBean
implements ResourceLoaderAware, LoadTimeWeaverAware

FactoryBean that creates a JPA EntityManagerFactory according to JPA's standard container bootstrap contract. This is the most powerful way to set up a shared JPA EntityManagerFactory in a Spring application context; the EntityManagerFactory can then be passed to JPA-based DAOs via dependency injection. Note that switching to a JNDI lookup or to a LocalEntityManagerFactoryBean definition is just a matter of configuration!

As with LocalEntityManagerFactoryBean, configuration settings are usually read in from a META-INF/persistence.xml config file, residing in the class path, according to the general JPA configuration contract. However, this FactoryBean is more flexible in that you can override the location of the persistence.xml file, specify the JDBC DataSources to link to, etc. Furthermore, it allows for pluggable class instrumentation through Spring's LoadTimeWeaver abstraction, instead of being tied to a special VM agent specified on JVM startup.

Internally, this FactoryBean parses the persistence.xml file itself and creates a corresponding PersistenceUnitInfo object (with further configuration merged in, such as JDBC DataSources and the Spring LoadTimeWeaver), to be passed to the chosen JPA PersistenceProvider. This corresponds to a local JPA container with full support for the standard JPA container contract.

The exposed EntityManagerFactory object will implement all the interfaces of the underlying native EntityManagerFactory returned by the PersistenceProvider, plus the EntityManagerFactoryInfo interface which exposes additional metadata as assembled by this FactoryBean.

Since:
2.0
Author:
Juergen Hoeller, Rod Johnson
See Also:
setPersistenceXmlLocation(java.lang.String),
AbstractEntityManagerFactoryBean.setJpaProperties(java.util.Properties),
AbstractEntityManagerFactoryBean.setJpaVendorAdapter(org.springframework.orm.jpa.JpaVendorAdapter),
setLoadTimeWeaver(org.springframework.instrument.classloading.LoadTimeWeaver),
setDataSource(javax.sql.DataSource),
EntityManagerFactoryInfo,
LocalEntityManagerFactoryBean,
SharedEntityManagerBean,
PersistenceProvider.createContainerEntityManagerFactory(javax.persistence.spi.PersistenceUnitInfo, java.util.Map),
Serialized Form

Field Summary
Fields inherited from class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
logger, nativeEntityManagerFactory
Constructor Summary
LocalContainerEntityManagerFactoryBean()
Method Summary
protected  javax.persistence.EntityManagerFactory createNativeEntityManagerFactory()
Subclasses must implement this method to create the EntityManagerFactory that will be returned by the getObject() method.
protected  javax.persistence.spi.PersistenceUnitInfo determinePersistenceUnitInfo(PersistenceUnitManager persistenceUnitManager)
Determine the PersistenceUnitInfo to use for the EntityManagerFactory created by this bean.
 DataSource getDataSource()
Return the JDBC DataSource that this EntityManagerFactory obtains its JDBC Connections from.
 javax.persistence.spi.PersistenceUnitInfo getPersistenceUnitInfo()
Return the PersistenceUnitInfo used to create this EntityManagerFactory, if the in-container API was used.
 String getPersistenceUnitName()
Return the name of the persistence unit used to create this EntityManagerFactory, or null if it is an unnamed default.
protected  void postProcessEntityManagerFactory(javax.persistence.EntityManagerFactory emf, javax.persistence.spi.PersistenceUnitInfo pui)
Hook method allowing subclasses to customize the EntityManagerFactory after its creation via the PersistenceProvider.
 void setDataSource(DataSource dataSource)
Specify the JDBC DataSource that the JPA persistence provider is supposed to use for accessing the database.
 void setLoadTimeWeaver(LoadTimeWeaver loadTimeWeaver)
Specify the Spring LoadTimeWeaver to use for class instrumentation according to the JPA class transformer contract.
 void setPersistenceUnitManager(PersistenceUnitManager persistenceUnitManager)
Set the PersistenceUnitManager to use for obtaining the JPA persistence unit that this FactoryBean is supposed to build an EntityManagerFactory for.
 void setPersistenceUnitPostProcessors(PersistenceUnitPostProcessor[] postProcessors)
Set the PersistenceUnitPostProcessors to be applied to the PersistenceUnitInfo used for creating this EntityManagerFactory.
 void setPersistenceXmlLocation(String persistenceXmlLocation)
Set the location of the persistence.xml file we want to use.
 void setResourceLoader(ResourceLoader resourceLoader)
Set the ResourceLoader that this object runs in.
Methods inherited from class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
afterPropertiesSet, createEntityManagerFactoryProxy, destroy, getBeanClassLoader, getEntityManagerInterface, getJpaDialect, getJpaPropertyMap, getJpaVendorAdapter, getNativeEntityManagerFactory, getObject, getObjectType, getPersistenceProvider, isSingleton, setBeanClassLoader, setBeanFactory, setBeanName, setEntityManagerFactoryInterface, setEntityManagerInterface, setJpaDialect, setJpaProperties, setJpaPropertyMap, setJpaVendorAdapter, setPersistenceProvider, setPersistenceProviderClass, setPersistenceUnitName, translateExceptionIfPossible, writeReplace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

LocalContainerEntityManagerFactoryBean

public LocalContainerEntityManagerFactoryBean()
Method Detail

setPersistenceUnitManager

public void setPersistenceUnitManager(PersistenceUnitManager persistenceUnitManager)
Set the PersistenceUnitManager to use for obtaining the JPA persistence unit that this FactoryBean is supposed to build an EntityManagerFactory for.

The default is to rely on the local settings specified on this FactoryBean, such as "persistenceXmlLocation", "dataSource" and "loadTimeWeaver".

For reuse of existing persistence unit configuration or more advanced forms of custom persistence unit handling, consider defining a separate PersistenceUnitManager bean (typically a DefaultPersistenceUnitManager instance) and linking it in here. persistence.xml location, DataSource configuration and LoadTimeWeaver will be defined on that separate DefaultPersistenceUnitManager bean in such a scenario.

See Also:
setPersistenceXmlLocation(java.lang.String),
setDataSource(javax.sql.DataSource),
setLoadTimeWeaver(org.springframework.instrument.classloading.LoadTimeWeaver),
DefaultPersistenceUnitManager

setPersistenceXmlLocation

public void setPersistenceXmlLocation(String persistenceXmlLocation)
Set the location of the persistence.xml file we want to use. This is a Spring resource location.

Default is "classpath:META-INF/persistence.xml".

NOTE: Only applied if no external PersistenceUnitManager specified.

Parameters:
persistenceXmlLocation - a Spring resource String identifying the location of the persistence.xml file that this LocalContainerEntityManagerFactoryBean should parse
See Also:
setPersistenceUnitManager(org.springframework.orm.jpa.persistenceunit.PersistenceUnitManager)

setDataSource

public void setDataSource(DataSource dataSource)
Specify the JDBC DataSource that the JPA persistence provider is supposed to use for accessing the database. This is an alternative to keeping the JDBC configuration in persistence.xml, passing in a Spring-managed DataSource instead.

In JPA speak, a DataSource passed in here will be used as "nonJtaDataSource" on the PersistenceUnitInfo passed to the PersistenceProvider, overriding data source configuration in persistence.xml (if any).

NOTE: Only applied if no external PersistenceUnitManager specified.

See Also:
PersistenceUnitInfo.getNonJtaDataSource(), setPersistenceUnitManager(org.springframework.orm.jpa.persistenceunit.PersistenceUnitManager)

setPersistenceUnitPostProcessors

public void setPersistenceUnitPostProcessors(PersistenceUnitPostProcessor[] postProcessors)
Set the PersistenceUnitPostProcessors to be applied to the PersistenceUnitInfo used for creating this EntityManagerFactory.

Such post-processors can, for example, register further entity classes and jar files, in addition to the metadata read in from persistence.xml.

NOTE: Only applied if no external PersistenceUnitManager specified.

See Also:
setPersistenceUnitManager(org.springframework.orm.jpa.persistenceunit.PersistenceUnitManager)

setLoadTimeWeaver

public void setLoadTimeWeaver(LoadTimeWeaver loadTimeWeaver)
Specify the Spring LoadTimeWeaver to use for class instrumentation according to the JPA class transformer contract.

It is a not required to specify a LoadTimeWeaver: Most providers will be able to provide a subset of their functionality without class instrumentation as well, or operate with their VM agent specified on JVM startup.

In terms of Spring-provided weaving options, the most important ones are InstrumentationLoadTimeWeaver, which requires a Spring-specific (but very general) VM agent specified on JVM startup, and ReflectiveLoadTimeWeaver, which interacts with an underlying ClassLoader based on specific extended methods being available on it (for example, interacting with Spring's TomcatInstrumentableClassLoader).

NOTE: As of Spring 2.5, the context's default LoadTimeWeaver (defined as bean with name "loadTimeWeaver") will be picked up automatically, if available, removing the need for LoadTimeWeaver configuration on each affected target bean. Consider using the context:load-time-weaver XML tag for creating such a shared LoadTimeWeaver (autodetecting the environment by default).

NOTE: Only applied if no external PersistenceUnitManager specified. Otherwise, the external PersistenceUnitManager is responsible for the weaving configuration.

Specified by:
setLoadTimeWeaver in interface LoadTimeWeaverAware
Parameters:
loadTimeWeaver - the LoadTimeWeaver instance (never null)
See Also:
InstrumentationLoadTimeWeaver, ReflectiveLoadTimeWeaver, TomcatInstrumentableClassLoader

setResourceLoader

public void setResourceLoader(ResourceLoader resourceLoader)
Description copied from interface: ResourceLoaderAware
Set the ResourceLoader that this object runs in.

This might be a ResourcePatternResolver, which can be checked through instanceof ResourcePatternResolver. See also the ResourcePatternUtils.getResourcePatternResolver method.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked before ApplicationContextAware's setApplicationContext.

Specified by:
setResourceLoader in interface ResourceLoaderAware
Parameters:
resourceLoader - ResourceLoader object to be used by this object
See Also:
ResourcePatternResolver, ResourcePatternUtils.getResourcePatternResolver(org.springframework.core.io.ResourceLoader)

createNativeEntityManagerFactory

protected javax.persistence.EntityManagerFactory createNativeEntityManagerFactory()
                                                                           throws javax.persistence.PersistenceException
Description copied from class: AbstractEntityManagerFactoryBean
Subclasses must implement this method to create the EntityManagerFactory that will be returned by the getObject() method.

Specified by:
createNativeEntityManagerFactory in class AbstractEntityManagerFactoryBean
Returns:
EntityManagerFactory instance returned by this FactoryBean
Throws:
javax.persistence.PersistenceException - if the EntityManager cannot be created

determinePersistenceUnitInfo

protected javax.persistence.spi.PersistenceUnitInfo determinePersistenceUnitInfo(PersistenceUnitManager persistenceUnitManager)
Determine the PersistenceUnitInfo to use for the EntityManagerFactory created by this bean.

The default implementation reads in all persistence unit infos from persistence.xml, as defined in the JPA specification. If no entity manager name was specified, it takes the first info in the array as returned by the reader. Otherwise, it checks for a matching name.

Parameters:
persistenceUnitManager - the PersistenceUnitManager to obtain from
Returns:
the chosen PersistenceUnitInfo

postProcessEntityManagerFactory

protected void postProcessEntityManagerFactory(javax.persistence.EntityManagerFactory emf,
                                               javax.persistence.spi.PersistenceUnitInfo pui)
Hook method allowing subclasses to customize the EntityManagerFactory after its creation via the PersistenceProvider.

The default implementation is empty.

Parameters:
emf - the newly created EntityManagerFactory we are working with
pui - the PersistenceUnitInfo used to configure the EntityManagerFactory
See Also:
PersistenceProvider.createContainerEntityManagerFactory(javax.persistence.spi.PersistenceUnitInfo, java.util.Map)

getPersistenceUnitInfo

public javax.persistence.spi.PersistenceUnitInfo getPersistenceUnitInfo()
Description copied from interface: EntityManagerFactoryInfo
Return the PersistenceUnitInfo used to create this EntityManagerFactory, if the in-container API was used.

Specified by:
getPersistenceUnitInfo in interface EntityManagerFactoryInfo
Overrides:
getPersistenceUnitInfo in class AbstractEntityManagerFactoryBean
Returns:
the PersistenceUnitInfo used to create this EntityManagerFactory, or null if the in-container contract was not used to configure the EntityManagerFactory

getPersistenceUnitName

public String getPersistenceUnitName()
Description copied from interface: EntityManagerFactoryInfo
Return the name of the persistence unit used to create this EntityManagerFactory, or null if it is an unnamed default.

If getPersistenceUnitInfo() returns non-null, the result of getPersistenceUnitName() must be equal to the value returned by PersistenceUnitInfo.getPersistenceUnitName().

Specified by:
getPersistenceUnitName in interface EntityManagerFactoryInfo
Overrides:
getPersistenceUnitName in class AbstractEntityManagerFactoryBean
See Also:
EntityManagerFactoryInfo.getPersistenceUnitInfo(), PersistenceUnitInfo.getPersistenceUnitName()

getDataSource

public DataSource getDataSource()
Description copied from interface: EntityManagerFactoryInfo
Return the JDBC DataSource that this EntityManagerFactory obtains its JDBC Connections from.

Specified by:
getDataSource in interface EntityManagerFactoryInfo
Overrides:
getDataSource in class AbstractEntityManagerFactoryBean
Returns:
the JDBC DataSource, or null if not known
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LocalEntityManagerFactoryBean

org.springframework.orm.jpa
Class LocalEntityManagerFactoryBean

java.lang.Object
    extended by  org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
        extended by  org.springframework.orm.jpa.LocalEntityManagerFactoryBean
All Implemented Interfaces:
Serializable, BeanClassLoaderAware, BeanFactoryAware, BeanNameAware, DisposableBean, FactoryBean<javax.persistence.EntityManagerFactory>, InitializingBean, PersistenceExceptionTranslator, EntityManagerFactoryInfo
public class LocalEntityManagerFactoryBean
extends AbstractEntityManagerFactoryBean

FactoryBean that creates a JPA EntityManagerFactory according to JPA's standard standalone bootstrap contract. This is the simplest way to set up a shared JPA EntityManagerFactory in a Spring application context; the EntityManagerFactory can then be passed to JPA-based DAOs via dependency injection. Note that switching to a JNDI lookup or to a LocalContainerEntityManagerFactoryBean definition is just a matter of configuration!

Configuration settings are usually read from a META-INF/persistence.xml config file, residing in the class path, according to the JPA standalone bootstrap contract. Additionally, most JPA providers will require a special VM agent (specified on JVM startup) that allows them to instrument application classes. See the Java Persistence API specification and your provider documentation for setup details.

This EntityManagerFactory bootstrap is appropriate for standalone applications which solely use JPA for data access. If you want to set up your persistence provider for an external DataSource and/or for global transactions which span multiple resources, you will need to either deploy it into a full Java EE 5 application server and access the deployed EntityManagerFactory via JNDI, or use Spring's LocalContainerEntityManagerFactoryBean with appropriate configuration for local setup according to JPA's container contract.

Note: This FactoryBean has limited configuration power in terms of what configuration it is able to pass to the JPA provider. If you need more flexible configuration, for example passing a Spring-managed JDBC DataSource to the JPA provider, consider using Spring's more powerful LocalContainerEntityManagerFactoryBean instead.

Since:
2.0
Author:
Juergen Hoeller, Rod Johnson
See Also:
AbstractEntityManagerFactoryBean.setJpaProperties(java.util.Properties),
AbstractEntityManagerFactoryBean.setJpaVendorAdapter(org.springframework.orm.jpa.JpaVendorAdapter),
EntityManagerFactoryAccessor.setEntityManagerFactory(javax.persistence.EntityManagerFactory),
JpaTransactionManager.setEntityManagerFactory(javax.persistence.EntityManagerFactory),
LocalContainerEntityManagerFactoryBean,
JndiObjectFactoryBean,
SharedEntityManagerBean,
Persistence.createEntityManagerFactory(java.lang.String),
PersistenceProvider.createEntityManagerFactory(java.lang.String, java.util.Map),
Serialized Form

Field Summary
Fields inherited from class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
logger, nativeEntityManagerFactory
Constructor Summary
LocalEntityManagerFactoryBean()
Method Summary
protected  javax.persistence.EntityManagerFactory createNativeEntityManagerFactory()
Initialize the EntityManagerFactory for the given configuration.
Methods inherited from class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
afterPropertiesSet, createEntityManagerFactoryProxy, destroy, getBeanClassLoader, getDataSource, getEntityManagerInterface, getJpaDialect, getJpaPropertyMap, getJpaVendorAdapter, getNativeEntityManagerFactory, getObject, getObjectType, getPersistenceProvider, getPersistenceUnitInfo, getPersistenceUnitName, isSingleton, setBeanClassLoader, setBeanFactory, setBeanName, setEntityManagerFactoryInterface, setEntityManagerInterface, setJpaDialect, setJpaProperties, setJpaPropertyMap, setJpaVendorAdapter, setPersistenceProvider, setPersistenceProviderClass, setPersistenceUnitName, translateExceptionIfPossible, writeReplace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

LocalEntityManagerFactoryBean

public LocalEntityManagerFactoryBean()
Method Detail

createNativeEntityManagerFactory

protected javax.persistence.EntityManagerFactory createNativeEntityManagerFactory()
                                                                           throws javax.persistence.PersistenceException
Initialize the EntityManagerFactory for the given configuration.

Specified by:
createNativeEntityManagerFactory in class AbstractEntityManagerFactoryBean
Returns:
EntityManagerFactory instance returned by this FactoryBean
Throws:
javax.persistence.PersistenceException - in case of JPA initialization errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SharedEntityManagerCreator

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.orm.jpa
Class SharedEntityManagerCreator

java.lang.Object
    extended by  org.springframework.orm.jpa.SharedEntityManagerCreator

public abstract class SharedEntityManagerCreator
extends Object

Factory for a shareable JPA EntityManager for a given EntityManagerFactory.

The shareable EntityManager will behave just like an EntityManager fetched from an application server's JNDI environment, as defined by the JPA specification. It will delegate all calls to the current transactional EntityManager, if any; otherwise it will fall back to a newly created EntityManager per operation.

Since:
2.0
Author:
Juergen Hoeller, Rod Johnson
See Also:
LocalEntityManagerFactoryBean, JpaTransactionManager

Constructor Summary
SharedEntityManagerCreator()
Method Summary
static javax.persistence.EntityManager | createSharedEntityManager(javax.persistence.EntityManagerFactory emf) Create a transactional EntityManager proxy for the given EntityManagerFactory.
static javax.persistence.EntityManager | createSharedEntityManager(javax.persistence.EntityManagerFactory emf, Map properties) Create a transactional EntityManager proxy for the given EntityManagerFactory.
static javax.persistence.EntityManager | createSharedEntityManager(javax.persistence.EntityManagerFactory emf, Map properties, Class... entityManagerInterfaces) Create a transactional EntityManager proxy for the given EntityManagerFactory.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SharedEntityManagerCreator

public SharedEntityManagerCreator()
Method Detail

createSharedEntityManager

public static javax.persistence.EntityManager createSharedEntityManager(javax.persistence.EntityManagerFactory emf)
Create a transactional EntityManager proxy for the given EntityManagerFactory.

Parameters:
emf - the EntityManagerFactory to delegate to. If this implements the EntityManagerFactoryInfo interface, appropriate handling of the native EntityManagerFactory and available EntityManagerPlusOperations will automatically apply.
Returns:
a shareable transaction EntityManager proxy

createSharedEntityManager

public static javax.persistence.EntityManager createSharedEntityManager(javax.persistence.EntityManagerFactory emf,
                                                                        Map properties)
Create a transactional EntityManager proxy for the given EntityManagerFactory.

Parameters:
emf - the EntityManagerFactory to delegate to. If this implements the EntityManagerFactoryInfo interface, appropriate handling of the native EntityManagerFactory and available EntityManagerPlusOperations will automatically apply.
properties - the properties to be passed into the createEntityManager call (may be null)
Returns:
a shareable transaction EntityManager proxy

createSharedEntityManager

public static javax.persistence.EntityManager createSharedEntityManager(javax.persistence.EntityManagerFactory emf,
                                                                        Map properties,
                                                                        Class... entityManagerInterfaces)
Create a transactional EntityManager proxy for the given EntityManagerFactory.

Parameters:
emf - EntityManagerFactory to obtain EntityManagers from as needed
properties - the properties to be passed into the createEntityManager call (may be null)
entityManagerInterfaces - the interfaces to be implemented by the EntityManager. Allows the addition or specification of proprietary interfaces.
Returns:
a shareable transactional EntityManager proxy
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


JpaObjectRetrievalFailureException

org.springframework.orm.jpa
Class JpaObjectRetrievalFailureException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.DataRetrievalFailureException
                                extended by  org.springframework.orm.ObjectRetrievalFailureException
                                    extended by  org.springframework.orm.jpa.JpaObjectRetrievalFailureException
All Implemented Interfaces:
Serializable
public class JpaObjectRetrievalFailureException
extends ObjectRetrievalFailureException

JPA-specific subclass of ObjectRetrievalFailureException. Converts JPA's EntityNotFoundException.

Since:
2.0
Author:
Juergen Hoeller
See Also:
EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(java.lang.RuntimeException), Serialized Form

Constructor Summary
JpaObjectRetrievalFailureException(javax.persistence.EntityNotFoundException ex)
Method Summary
Methods inherited from class org.springframework.orm.ObjectRetrievalFailureException
getIdentifier, getPersistentClass, getPersistentClassName
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

JpaObjectRetrievalFailureException

public JpaObjectRetrievalFailureException(javax.persistence.EntityNotFoundException ex)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JpaOptimisticLockingFailureException

org.springframework.orm.jpa
Class JpaOptimisticLockingFailureException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.TransientDataAccessException
                            extended by  org.springframework.dao.ConcurrencyFailureException
                                extended by  org.springframework.dao.OptimisticLockingFailureException
                                    extended by  org.springframework.orm.ObjectOptimisticLockingFailureException
                                        extended by  org.springframework.orm.jpa.JpaOptimisticLockingFailureException
All Implemented Interfaces:
Serializable
public class JpaOptimisticLockingFailureException
extends ObjectOptimisticLockingFailureException

JPA-specific subclass of ObjectOptimisticLockingFailureException. Converts JPA's OptimisticLockException.

Since:
2.0
Author:
Juergen Hoeller
See Also:
EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(java.lang.RuntimeException), Serialized Form

Constructor Summary
JpaOptimisticLockingFailureException(javax.persistence.OptimisticLockException ex)
Method Summary
Methods inherited from class org.springframework.orm.ObjectOptimisticLockingFailureException
getIdentifier, getPersistentClass, getPersistentClassName
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

JpaOptimisticLockingFailureException

public JpaOptimisticLockingFailureException(javax.persistence.OptimisticLockException ex)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JpaSystemException

org.springframework.orm.jpa
Class JpaSystemException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.dao.DataAccessException
                        extended by  org.springframework.dao.NonTransientDataAccessException
                            extended by  org.springframework.dao.UncategorizedDataAccessException
                                extended by  org.springframework.orm.jpa.JpaSystemException
All Implemented Interfaces:
Serializable
public class JpaSystemException
extends UncategorizedDataAccessException

JPA-specific subclass of UncategorizedDataAccessException, for JPA system errors that do not match any concrete org.springframework.dao exceptions.

Since:
2.0
Author:
Juergen Hoeller
See Also:
EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(java.lang.RuntimeException), Serialized Form

Constructor Summary
JpaSystemException(javax.persistence.PersistenceException ex)
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

JpaSystemException

public JpaSystemException(javax.persistence.PersistenceException ex)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.orm.jpa.persistenceunit

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.orm.jpa.persistenceunit

Internal support for managing JPA persistence units.

See:
Description

Interface Summary
PersistenceUnitManager | Interface that defines an abstraction for finding and managing JPA PersistenceUnitInfos.
PersistenceUnitPostProcessor | Callback interface for post-processing a JPA PersistenceUnitInfo.
SmartPersistenceUnitInfo | Extension of the standard JPA PersistenceUnitInfo interface, for advanced collaboration between Spring's LocalEntityManagerFactoryBean and PersistenceUnitManager implementations.

Class Summary
DefaultPersistenceUnitManager | Default implementation of the PersistenceUnitManager interface.
MutablePersistenceUnitInfo | Spring's base implementation of the JPA PersistenceUnitInfo interface, used to bootstrap an EntityManagerFactory in a container.

Package org.springframework.orm.jpa.persistenceunit Description

Internal support for managing JPA persistence units.


org.springframework.orm.jpa.persistenceunit Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.orm.jpa.persistenceunit

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager (implements org.springframework.beans.factory.InitializingBean, org.springframework.context.weaving.LoadTimeWeaverAware, org.springframework.orm.jpa.persistenceunit.PersistenceUnitManager, org.springframework.context.ResourceLoaderAware)
    • org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo (implements org.springframework.orm.jpa.persistenceunit.SmartPersistenceUnitInfo)

Interface Hierarchy

  • javax.persistence.spi.PersistenceUnitInfo
    • org.springframework.orm.jpa.persistenceunit.SmartPersistenceUnitInfo
  • org.springframework.orm.jpa.persistenceunit.PersistenceUnitManager
  • org.springframework.orm.jpa.persistenceunit.PersistenceUnitPostProcessor


PersistenceUnitManager

org.springframework.orm.jpa.persistenceunit
Interface PersistenceUnitManager

All Known Implementing Classes:
DefaultPersistenceUnitManager
public interface PersistenceUnitManager

Interface that defines an abstraction for finding and managing JPA PersistenceUnitInfos. Used by LocalContainerEntityManagerFactoryBean in order to obtain a PersistenceUnitInfo for building a concrete EntityManagerFactory.

Obtaining a PersistenceUnitInfo instance is an exclusive process. A PersistenceUnitInfo instance is not available for further calls anymore once it has been obtained.

Since:
2.0
Author:
Juergen Hoeller
See Also:
DefaultPersistenceUnitManager, LocalContainerEntityManagerFactoryBean.setPersistenceUnitManager(org.springframework.orm.jpa.persistenceunit.PersistenceUnitManager)

Method Summary
javax.persistence.spi.PersistenceUnitInfo | obtainDefaultPersistenceUnitInfo() Obtain the default PersistenceUnitInfo from this manager.
javax.persistence.spi.PersistenceUnitInfo | obtainPersistenceUnitInfo(String persistenceUnitName) Obtain the specified PersistenceUnitInfo from this manager.

Method Detail

obtainDefaultPersistenceUnitInfo

javax.persistence.spi.PersistenceUnitInfo obtainDefaultPersistenceUnitInfo()
                                                                           throws IllegalStateException
Obtain the default PersistenceUnitInfo from this manager.

Returns:
the PersistenceUnitInfo (never null)
Throws:
IllegalStateException - if there is no default PersistenceUnitInfo defined or it has already been obtained

obtainPersistenceUnitInfo

javax.persistence.spi.PersistenceUnitInfo obtainPersistenceUnitInfo(String persistenceUnitName)
                                                                    throws IllegalArgumentException,
                                                                           IllegalStateException
Obtain the specified PersistenceUnitInfo from this manager.

Parameters:
persistenceUnitName - the name of the desired persistence unit
Returns:
the PersistenceUnitInfo (never null)
Throws:
IllegalArgumentException - if no PersistenceUnitInfo with the given name is defined
IllegalStateException - if the PersistenceUnitInfo with the given name has already been obtained
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PersistenceUnitPostProcessor

org.springframework.orm.jpa.persistenceunit
Interface PersistenceUnitPostProcessor

public interface PersistenceUnitPostProcessor

Callback interface for post-processing a JPA PersistenceUnitInfo. Implementations can be registered with a DefaultPersistenceUnitManager or via a LocalContainerEntityManagerFactoryBean.

Since:
2.0
Author:
Juergen Hoeller
See Also:
DefaultPersistenceUnitManager.setPersistenceUnitPostProcessors(org.springframework.orm.jpa.persistenceunit.PersistenceUnitPostProcessor[]), LocalContainerEntityManagerFactoryBean.setPersistenceUnitPostProcessors(org.springframework.orm.jpa.persistenceunit.PersistenceUnitPostProcessor[])

Method Summary
 void postProcessPersistenceUnitInfo(MutablePersistenceUnitInfo pui)
Post-process the given PersistenceUnitInfo, for example registering further entity classes and jar files.

Method Detail

postProcessPersistenceUnitInfo

void postProcessPersistenceUnitInfo(MutablePersistenceUnitInfo pui)
Post-process the given PersistenceUnitInfo, for example registering further entity classes and jar files.

Parameters:
pui - the chosen PersistenceUnitInfo, as read from persistence.xml. Passed in as MutablePersistenceUnitInfo.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SmartPersistenceUnitInfo

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.orm.jpa.persistenceunit
Interface SmartPersistenceUnitInfo

All Superinterfaces:
javax.persistence.spi.PersistenceUnitInfo
All Known Implementing Classes:
MutablePersistenceUnitInfo
public interface SmartPersistenceUnitInfo
extends javax.persistence.spi.PersistenceUnitInfo

Extension of the standard JPA PersistenceUnitInfo interface, for advanced collaboration between Spring's LocalEntityManagerFactoryBean and PersistenceUnitManager implementations.

Since:
3.0.1
Author:
Juergen Hoeller
See Also:
PersistenceUnitManager, LocalEntityManagerFactoryBean

Method Summary
 void setPersistenceProviderPackageName(String persistenceProviderPackageName)
Set the persistence provider's own package name, for exclusion from class transformation.
Methods inherited from interface javax.persistence.spi.PersistenceUnitInfo
addTransformer, excludeUnlistedClasses, getClassLoader, getJarFileUrls, getJtaDataSource, getManagedClassNames, getMappingFileNames, getNewTempClassLoader, getNonJtaDataSource, getPersistenceProviderClassName, getPersistenceUnitName, getPersistenceUnitRootUrl, getProperties, getTransactionType

Method Detail

setPersistenceProviderPackageName

void setPersistenceProviderPackageName(String persistenceProviderPackageName)
Set the persistence provider's own package name, for exclusion from class transformation.

See Also:
PersistenceUnitInfo.addTransformer(javax.persistence.spi.ClassTransformer), PersistenceUnitInfo.getNewTempClassLoader()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


DefaultPersistenceUnitManager

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.orm.jpa.persistenceunit
Class DefaultPersistenceUnitManager

java.lang.Object
    extended by  org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager
All Implemented Interfaces:
InitializingBean, ResourceLoaderAware, LoadTimeWeaverAware, PersistenceUnitManager
public class DefaultPersistenceUnitManager
extends Object
implements PersistenceUnitManager, ResourceLoaderAware, LoadTimeWeaverAware, InitializingBean

Default implementation of the PersistenceUnitManager interface. Used as internal default by LocalContainerEntityManagerFactoryBean.

Supports standard JPA scanning for persistence.xml files, with configurable file locations, JDBC DataSource lookup and load-time weaving.

The default XML file location is classpath*:META-INF/persistence.xml, scanning for all matching files in the class path (as defined in the JPA specification). DataSource names are by default interpreted as JNDI names, and no load time weaving is available (which requires weaving to be turned off in the persistence provider).

Since:
2.0
Author:
Juergen Hoeller
See Also:
setPersistenceXmlLocations(java.lang.String[]),
setDataSourceLookup(org.springframework.jdbc.datasource.lookup.DataSourceLookup),
setLoadTimeWeaver(org.springframework.instrument.classloading.LoadTimeWeaver),
LocalContainerEntityManagerFactoryBean.setPersistenceUnitManager(org.springframework.orm.jpa.persistenceunit.PersistenceUnitManager)

Field Summary
static String | DEFAULT_PERSISTENCE_XML_LOCATION Default location of the persistence.xml file: "classpath*:META-INF/persistence.xml".
static String | ORIGINAL_DEFAULT_PERSISTENCE_UNIT_ROOT_LOCATION Default location for the persistence unit root URL: "classpath:", indicating the root of the class path.
Constructor Summary
DefaultPersistenceUnitManager()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
DataSourceLookup | getDataSourceLookup() Return the JDBC DataSourceLookup that provides DataSources for the persistence provider, resolving data source names in persistence.xml against Spring-managed DataSource instances.
DataSource | getDefaultDataSource() Return the JDBC DataSource that the JPA persistence provider is supposed to use for accessing the database if none has been specified in persistence.xml.
LoadTimeWeaver | getLoadTimeWeaver() Return the Spring LoadTimeWeaver to use for class instrumentation according to the JPA class transformer contract.
protected javax.persistence.spi.PersistenceUnitInfo | getPersistenceUnitInfo(String persistenceUnitName) Return the specified PersistenceUnitInfo from this manager's cache of processed persistence units, keeping it in the cache (i.e.
PersistenceUnitPostProcessor[] | getPersistenceUnitPostProcessors() Return the PersistenceUnitPostProcessors to be applied to each PersistenceUnitInfo that has been parsed by this manager.
javax.persistence.spi.PersistenceUnitInfo | obtainDefaultPersistenceUnitInfo() Obtain the default PersistenceUnitInfo from this manager.
javax.persistence.spi.PersistenceUnitInfo | obtainPersistenceUnitInfo(String persistenceUnitName) Obtain the specified PersistenceUnitInfo from this manager.
protected void | postProcessPersistenceUnitInfo(MutablePersistenceUnitInfo pui) Hook method allowing subclasses to customize each PersistenceUnitInfo.
void | preparePersistenceUnitInfos() Prepare the PersistenceUnitInfos according to the configuration of this manager: scanning for persistence.xml files, parsing all matching files, configurating and post-processing them.
void | setDataSourceLookup(DataSourceLookup dataSourceLookup) Specify the JDBC DataSourceLookup that provides DataSources for the persistence provider, resolving data source names in persistence.xml against Spring-managed DataSource instances.
void | setDataSources(Map<String,DataSource> dataSources) Specify the JDBC DataSources that the JPA persistence provider is supposed to use for accessing the database, resolving data source names in persistence.xml against Spring-managed DataSources.
void | setDefaultDataSource(DataSource defaultDataSource) Specify the JDBC DataSource that the JPA persistence provider is supposed to use for accessing the database if none has been specified in persistence.xml.
void | setDefaultPersistenceUnitRootLocation(String defaultPersistenceUnitRootLocation) Set the default persistence unit root location, to be applied if no unit-specific persistence unit root could be determined.
void | setLoadTimeWeaver(LoadTimeWeaver loadTimeWeaver) Specify the Spring LoadTimeWeaver to use for class instrumentation according to the JPA class transformer contract.
void | setPersistenceUnitPostProcessors(PersistenceUnitPostProcessor[] postProcessors) Set the PersistenceUnitPostProcessors to be applied to each PersistenceUnitInfo that has been parsed by this manager.
void | setPersistenceXmlLocation(String persistenceXmlLocation) Specify the location of the persistence.xml files to load.
void | setPersistenceXmlLocations(String[] persistenceXmlLocations) Specify multiple locations of persistence.xml files to load.
void | setResourceLoader(ResourceLoader resourceLoader) Set the ResourceLoader that this object runs in.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_PERSISTENCE_XML_LOCATION

public static final String DEFAULT_PERSISTENCE_XML_LOCATION
Default location of the persistence.xml file: "classpath*:META-INF/persistence.xml".

See Also:
Constant Field Values

ORIGINAL_DEFAULT_PERSISTENCE_UNIT_ROOT_LOCATION

public static final String ORIGINAL_DEFAULT_PERSISTENCE_UNIT_ROOT_LOCATION
Default location for the persistence unit root URL: "classpath:", indicating the root of the class path.

See Also:
Constant Field Values
Constructor Detail

DefaultPersistenceUnitManager

public DefaultPersistenceUnitManager()
Method Detail

setPersistenceXmlLocation

public void setPersistenceXmlLocation(String persistenceXmlLocation)
Specify the location of the persistence.xml files to load. These can be specified as Spring resource locations and/or location patterns.

Default is "classpath*:META-INF/persistence.xml".

setPersistenceXmlLocations

public void setPersistenceXmlLocations(String[] persistenceXmlLocations)
Specify multiple locations of persistence.xml files to load. These can be specified as Spring resource locations and/or location patterns.

Default is "classpath*:META-INF/persistence.xml".

Parameters:
persistenceXmlLocations - an array of Spring resource Strings identifying the location of the persistence.xml files to read

setDefaultPersistenceUnitRootLocation

public void setDefaultPersistenceUnitRootLocation(String defaultPersistenceUnitRootLocation)
Set the default persistence unit root location, to be applied if no unit-specific persistence unit root could be determined.

Default is "classpath:", that is, the root of the current class path (nearest root directory). To be overridden if unit-specific resolution does not work and the class path root is not appropriate either.

setDataSources

public void setDataSources(Map<String,DataSource> dataSources)
Specify the JDBC DataSources that the JPA persistence provider is supposed to use for accessing the database, resolving data source names in persistence.xml against Spring-managed DataSources.

The specified Map needs to define data source names for specific DataSource objects, matching the data source names used in persistence.xml. If not specified, data source names will be resolved as JNDI names instead (as defined by standard JPA).

See Also:
MapDataSourceLookup

setDataSourceLookup

public void setDataSourceLookup(DataSourceLookup dataSourceLookup)
Specify the JDBC DataSourceLookup that provides DataSources for the persistence provider, resolving data source names in persistence.xml against Spring-managed DataSource instances.

Default is JndiDataSourceLookup, which resolves DataSource names as JNDI names (as defined by standard JPA). Specify a BeanFactoryDataSourceLookup instance if you want DataSource names to be resolved against Spring bean names.

Alternatively, consider passing in a map from names to DataSource instances via the "dataSources" property. If the persistence.xml file does not define DataSource names at all, specify a default DataSource via the "defaultDataSource" property.

See Also:
JndiDataSourceLookup, BeanFactoryDataSourceLookup, setDataSources(java.util.Map), setDefaultDataSource(javax.sql.DataSource)

getDataSourceLookup

public DataSourceLookup getDataSourceLookup()
Return the JDBC DataSourceLookup that provides DataSources for the persistence provider, resolving data source names in persistence.xml against Spring-managed DataSource instances.

setDefaultDataSource

public void setDefaultDataSource(DataSource defaultDataSource)
Specify the JDBC DataSource that the JPA persistence provider is supposed to use for accessing the database if none has been specified in persistence.xml.

In JPA speak, a DataSource passed in here will be uses as "nonJtaDataSource" on the PersistenceUnitInfo passed to the PersistenceProvider, provided that none has been registered before.

See Also:
PersistenceUnitInfo.getNonJtaDataSource()

getDefaultDataSource

public DataSource getDefaultDataSource()
Return the JDBC DataSource that the JPA persistence provider is supposed to use for accessing the database if none has been specified in persistence.xml.

setPersistenceUnitPostProcessors

public void setPersistenceUnitPostProcessors(PersistenceUnitPostProcessor[] postProcessors)
Set the PersistenceUnitPostProcessors to be applied to each PersistenceUnitInfo that has been parsed by this manager.

Such post-processors can, for example, register further entity classes and jar files, in addition to the metadata read in from persistence.xml.

getPersistenceUnitPostProcessors

public PersistenceUnitPostProcessor[] getPersistenceUnitPostProcessors()
Return the PersistenceUnitPostProcessors to be applied to each PersistenceUnitInfo that has been parsed by this manager.

setLoadTimeWeaver

public void setLoadTimeWeaver(LoadTimeWeaver loadTimeWeaver)
Specify the Spring LoadTimeWeaver to use for class instrumentation according to the JPA class transformer contract.

It is not required to specify a LoadTimeWeaver: Most providers will be able to provide a subset of their functionality without class instrumentation as well, or operate with their VM agent specified on JVM startup.

In terms of Spring-provided weaving options, the most important ones are InstrumentationLoadTimeWeaver, which requires a Spring-specific (but very general) VM agent specified on JVM startup, and ReflectiveLoadTimeWeaver, which interacts with an underlying ClassLoader based on specific extended methods being available on it (for example, interacting with Spring's TomcatInstrumentableClassLoader).

NOTE: As of Spring 2.5, the context's default LoadTimeWeaver (defined as bean with name "loadTimeWeaver") will be picked up automatically, if available, removing the need for LoadTimeWeaver configuration on each affected target bean. Consider using the context:load-time-weaver XML tag for creating such a shared LoadTimeWeaver (autodetecting the environment by default).

Specified by:
setLoadTimeWeaver in interface LoadTimeWeaverAware
Parameters:
loadTimeWeaver - the LoadTimeWeaver instance (never null)
See Also:
InstrumentationLoadTimeWeaver, ReflectiveLoadTimeWeaver, TomcatInstrumentableClassLoader

getLoadTimeWeaver

public LoadTimeWeaver getLoadTimeWeaver()
Return the Spring LoadTimeWeaver to use for class instrumentation according to the JPA class transformer contract.

setResourceLoader

public void setResourceLoader(ResourceLoader resourceLoader)
Description copied from interface: ResourceLoaderAware
Set the ResourceLoader that this object runs in.

This might be a ResourcePatternResolver, which can be checked through instanceof ResourcePatternResolver. See also the ResourcePatternUtils.getResourcePatternResolver method.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked before ApplicationContextAware's setApplicationContext.

Specified by:
setResourceLoader in interface ResourceLoaderAware
Parameters:
resourceLoader - ResourceLoader object to be used by this object
See Also:
ResourcePatternResolver, ResourcePatternUtils.getResourcePatternResolver(org.springframework.core.io.ResourceLoader)

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

preparePersistenceUnitInfos

public void preparePersistenceUnitInfos()
Prepare the PersistenceUnitInfos according to the configuration of this manager: scanning for persistence.xml files, parsing all matching files, configurating and post-processing them.

PersistenceUnitInfos cannot be obtained before this preparation method has been invoked.

See Also:
obtainDefaultPersistenceUnitInfo(), obtainPersistenceUnitInfo(String)

getPersistenceUnitInfo

protected final javax.persistence.spi.PersistenceUnitInfo getPersistenceUnitInfo(String persistenceUnitName)
Return the specified PersistenceUnitInfo from this manager's cache of processed persistence units, keeping it in the cache (i.e. not 'obtaining' it for use but rather just accessing it for post-processing).

This can be used in postProcessPersistenceUnitInfo(org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo) implementations, detecting existing persistence units of the same name and potentially merging them.

Parameters:
persistenceUnitName - the name of the desired persistence unit
Returns:
the PersistenceUnitInfo in mutable form, or null if not available

postProcessPersistenceUnitInfo

protected void postProcessPersistenceUnitInfo(MutablePersistenceUnitInfo pui)
Hook method allowing subclasses to customize each PersistenceUnitInfo.

Default implementation delegates to all registered PersistenceUnitPostProcessors. It is usually preferable to register further entity classes, jar files etc there rather than in a subclass of this manager, to be able to reuse the post-processors.

Parameters:
pui - the chosen PersistenceUnitInfo, as read from persistence.xml. Passed in as MutablePersistenceUnitInfo.
See Also:
setPersistenceUnitPostProcessors(org.springframework.orm.jpa.persistenceunit.PersistenceUnitPostProcessor[])

obtainDefaultPersistenceUnitInfo

public javax.persistence.spi.PersistenceUnitInfo obtainDefaultPersistenceUnitInfo()
Description copied from interface: PersistenceUnitManager
Obtain the default PersistenceUnitInfo from this manager.

Specified by:
obtainDefaultPersistenceUnitInfo in interface PersistenceUnitManager
Returns:
the PersistenceUnitInfo (never null)

obtainPersistenceUnitInfo

public javax.persistence.spi.PersistenceUnitInfo obtainPersistenceUnitInfo(String persistenceUnitName)
Description copied from interface: PersistenceUnitManager
Obtain the specified PersistenceUnitInfo from this manager.

Specified by:
obtainPersistenceUnitInfo in interface PersistenceUnitManager
Parameters:
persistenceUnitName - the name of the desired persistence unit
Returns:
the PersistenceUnitInfo (never null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


MutablePersistenceUnitInfo

org.springframework.orm.jpa.persistenceunit
Class MutablePersistenceUnitInfo

java.lang.Object
    extended by  org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo
All Implemented Interfaces:
javax.persistence.spi.PersistenceUnitInfo, SmartPersistenceUnitInfo
public class MutablePersistenceUnitInfo
extends Object
implements SmartPersistenceUnitInfo

Spring's base implementation of the JPA PersistenceUnitInfo interface, used to bootstrap an EntityManagerFactory in a container.

This implementation is largely a JavaBean, offering mutators for all standard PersistenceUnitInfo properties.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller, Costin Leau

Constructor Summary
MutablePersistenceUnitInfo()
Method Summary
void | addJarFileUrl(URL jarFileUrl)
void | addManagedClassName(String managedClassName)
void | addMappingFileName(String mappingFileName)
void | addProperty(String name, String value)
void | addTransformer(javax.persistence.spi.ClassTransformer classTransformer) This implementation throws an UnsupportedOperationException.
boolean | excludeUnlistedClasses()
ClassLoader | getClassLoader() This implementation returns the default ClassLoader.
List<URL> | getJarFileUrls()
DataSource | getJtaDataSource()
List<String> | getManagedClassNames()
List<String> | getMappingFileNames()
ClassLoader | getNewTempClassLoader() This implementation throws an UnsupportedOperationException.
DataSource | getNonJtaDataSource()
String | getPersistenceProviderClassName()
String | getPersistenceProviderPackageName()
String | getPersistenceUnitName()
URL | getPersistenceUnitRootUrl()
String | getPersistenceXMLSchemaVersion()
Properties | getProperties()
javax.persistence.spi.PersistenceUnitTransactionType | getTransactionType()
void | setExcludeUnlistedClasses(boolean excludeUnlistedClasses)
void | setJtaDataSource(DataSource jtaDataSource)
void | setNonJtaDataSource(DataSource nonJtaDataSource)
void | setPersistenceProviderClassName(String persistenceProviderClassName)
void | setPersistenceProviderPackageName(String persistenceProviderPackageName) Set the persistence provider's own package name, for exclusion from class transformation.
void | setPersistenceUnitName(String persistenceUnitName)
void | setPersistenceUnitRootUrl(URL persistenceUnitRootUrl)
void | setPersistenceXMLSchemaVersion(String persistenceXMLSchemaVersion)
void | setProperties(Properties properties)
void | setTransactionType(javax.persistence.spi.PersistenceUnitTransactionType transactionType)
String | toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

MutablePersistenceUnitInfo

public MutablePersistenceUnitInfo()
Method Detail

setPersistenceUnitName

public void setPersistenceUnitName(String persistenceUnitName)

getPersistenceUnitName

public String getPersistenceUnitName()
Specified by:
getPersistenceUnitName in interface javax.persistence.spi.PersistenceUnitInfo

setPersistenceProviderClassName

public void setPersistenceProviderClassName(String persistenceProviderClassName)

getPersistenceProviderClassName

public String getPersistenceProviderClassName()
Specified by:
getPersistenceProviderClassName in interface javax.persistence.spi.PersistenceUnitInfo

setTransactionType

public void setTransactionType(javax.persistence.spi.PersistenceUnitTransactionType transactionType)

getTransactionType

public javax.persistence.spi.PersistenceUnitTransactionType getTransactionType()
Specified by:
getTransactionType in interface javax.persistence.spi.PersistenceUnitInfo

setJtaDataSource

public void setJtaDataSource(DataSource jtaDataSource)

getJtaDataSource

public DataSource getJtaDataSource()
Specified by:
getJtaDataSource in interface javax.persistence.spi.PersistenceUnitInfo

setNonJtaDataSource

public void setNonJtaDataSource(DataSource nonJtaDataSource)

getNonJtaDataSource

public DataSource getNonJtaDataSource()
Specified by:
getNonJtaDataSource in interface javax.persistence.spi.PersistenceUnitInfo

addMappingFileName

public void addMappingFileName(String mappingFileName)

getMappingFileNames

public List<String> getMappingFileNames()
Specified by:
getMappingFileNames in interface javax.persistence.spi.PersistenceUnitInfo

addJarFileUrl

public void addJarFileUrl(URL jarFileUrl)

getJarFileUrls

public List<URL> getJarFileUrls()
Specified by:
getJarFileUrls in interface javax.persistence.spi.PersistenceUnitInfo

setPersistenceUnitRootUrl

public void setPersistenceUnitRootUrl(URL persistenceUnitRootUrl)

getPersistenceUnitRootUrl

public URL getPersistenceUnitRootUrl()
Specified by:
getPersistenceUnitRootUrl in interface javax.persistence.spi.PersistenceUnitInfo

addManagedClassName

public void addManagedClassName(String managedClassName)

getManagedClassNames

public List<String> getManagedClassNames()
Specified by:
getManagedClassNames in interface javax.persistence.spi.PersistenceUnitInfo

setExcludeUnlistedClasses

public void setExcludeUnlistedClasses(boolean excludeUnlistedClasses)

excludeUnlistedClasses

public boolean excludeUnlistedClasses()
Specified by:
excludeUnlistedClasses in interface javax.persistence.spi.PersistenceUnitInfo

addProperty

public void addProperty(String name,
                        String value)

setProperties

public void setProperties(Properties properties)

getProperties

public Properties getProperties()
Specified by:
getProperties in interface javax.persistence.spi.PersistenceUnitInfo

setPersistenceXMLSchemaVersion

public void setPersistenceXMLSchemaVersion(String persistenceXMLSchemaVersion)

getPersistenceXMLSchemaVersion

public String getPersistenceXMLSchemaVersion()

setPersistenceProviderPackageName

public void setPersistenceProviderPackageName(String persistenceProviderPackageName)
Description copied from interface: SmartPersistenceUnitInfo
Set the persistence provider's own package name, for exclusion from class transformation.

Specified by:
setPersistenceProviderPackageName in interface SmartPersistenceUnitInfo
See Also:
PersistenceUnitInfo.addTransformer(javax.persistence.spi.ClassTransformer), PersistenceUnitInfo.getNewTempClassLoader()

getPersistenceProviderPackageName

public String getPersistenceProviderPackageName()

getClassLoader

public ClassLoader getClassLoader()
This implementation returns the default ClassLoader.

Specified by:
getClassLoader in interface javax.persistence.spi.PersistenceUnitInfo
See Also:
ClassUtils.getDefaultClassLoader()

addTransformer

public void addTransformer(javax.persistence.spi.ClassTransformer classTransformer)
This implementation throws an UnsupportedOperationException.

Specified by:
addTransformer in interface javax.persistence.spi.PersistenceUnitInfo

getNewTempClassLoader

public ClassLoader getNewTempClassLoader()
This implementation throws an UnsupportedOperationException.

Specified by:
getNewTempClassLoader in interface javax.persistence.spi.PersistenceUnitInfo

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.orm.jpa.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.orm.jpa.support

Classes supporting the org.springframework.orm.jpa package.

See:
Description

Class Summary
JpaDaoSupport | Convenient super class for JPA data access objects.
OpenEntityManagerInViewFilter | Servlet 2.3 Filter that binds a JPA EntityManager to the thread for the entire processing of the request.
OpenEntityManagerInViewInterceptor | Spring web request interceptor that binds a JPA EntityManager to the thread for the entire processing of the request.
PersistenceAnnotationBeanPostProcessor | BeanPostProcessor that processes PersistenceUnit and PersistenceContext annotations, for injection of the corresponding JPA resources EntityManagerFactory and EntityManager.
SharedEntityManagerBean | FactoryBean that exposes a shared JPA EntityManager reference for a given EntityManagerFactory.

Package org.springframework.orm.jpa.support Description

Classes supporting the org.springframework.orm.jpa package. Contains a DAO base class for JpaTemplate usage.


org.springframework.orm.jpa.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.orm.jpa.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.dao.support.DaoSupport (implements org.springframework.beans.factory.InitializingBean)
      • org.springframework.orm.jpa.support.JpaDaoSupport
    • org.springframework.orm.jpa.EntityManagerFactoryAccessor
      • org.springframework.orm.jpa.support.OpenEntityManagerInViewInterceptor (implements org.springframework.web.context.request.WebRequestInterceptor)
      • org.springframework.orm.jpa.support.SharedEntityManagerBean (implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.web.filter.GenericFilterBean (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, javax.servlet.Filter, org.springframework.beans.factory.InitializingBean, org.springframework.web.context.ServletContextAware)
      • org.springframework.web.filter.OncePerRequestFilter
        • org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter
    • org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor, org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor, org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor, org.springframework.core.PriorityOrdered, java.io.Serializable)


JpaDaoSupport

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.orm.jpa.support
Class JpaDaoSupport

java.lang.Object
    extended by  org.springframework.dao.support.DaoSupport
        extended by  org.springframework.orm.jpa.support.JpaDaoSupport
All Implemented Interfaces:
InitializingBean
public abstract class JpaDaoSupport
extends DaoSupport

Convenient super class for JPA data access objects. Intended for JpaTemplate usage. Alternatively, JPA-based DAOs can be coded against the plain JPA EntityManagerFactory/EntityManager API.

Requires an EntityManagerFactory or EntityManager to be set, providing a JpaTemplate based on it to subclasses. Can alternatively be initialized directly via a JpaTemplate, to reuse the latter's settings such as the EntityManagerFactory, JpaDialect, flush mode, etc.

This class will create its own JpaTemplate if an EntityManagerFactory or EntityManager reference is passed in. A custom JpaTemplate instance can be used through overriding createJpaTemplate.

Since:
2.0
Author:
Juergen Hoeller
See Also:
setEntityManagerFactory(javax.persistence.EntityManagerFactory),
setEntityManager(javax.persistence.EntityManager),
createJpaTemplate(javax.persistence.EntityManagerFactory),
setJpaTemplate(org.springframework.orm.jpa.JpaTemplate),
JpaTemplate

Field Summary
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
Constructor Summary
JpaDaoSupport()
Method Summary
protected void | checkDaoConfig() Abstract subclasses must override this to check their configuration.
protected JpaTemplate | createJpaTemplate(javax.persistence.EntityManager entityManager) Create a JpaTemplate for the given EntityManager.
protected JpaTemplate | createJpaTemplate(javax.persistence.EntityManagerFactory entityManagerFactory) Create a JpaTemplate for the given EntityManagerFactory.
JpaTemplate | getJpaTemplate() Return the JpaTemplate for this DAO, pre-initialized with the EntityManagerFactory or set explicitly.
void | setEntityManager(javax.persistence.EntityManager entityManager) Set the JPA EntityManager to be used by this DAO.
void | setEntityManagerFactory(javax.persistence.EntityManagerFactory entityManagerFactory) Set the JPA EntityManagerFactory to be used by this DAO.
void | setJpaTemplate(JpaTemplate jpaTemplate) Set the JpaTemplate for this DAO explicitly, as an alternative to specifying a EntityManagerFactory.
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JpaDaoSupport

public JpaDaoSupport()
Method Detail

setEntityManagerFactory

public final void setEntityManagerFactory(javax.persistence.EntityManagerFactory entityManagerFactory)
Set the JPA EntityManagerFactory to be used by this DAO. Will automatically create a JpaTemplate for the given EntityManagerFactory.

See Also:
createJpaTemplate(javax.persistence.EntityManagerFactory), setJpaTemplate(org.springframework.orm.jpa.JpaTemplate)

createJpaTemplate

protected JpaTemplate createJpaTemplate(javax.persistence.EntityManagerFactory entityManagerFactory)
Create a JpaTemplate for the given EntityManagerFactory. Only invoked if populating the DAO with a EntityManagerFactory reference!

Can be overridden in subclasses to provide a JpaTemplate instance with different configuration, or a custom JpaTemplate subclass.

Parameters:
entityManagerFactory - the JPA EntityManagerFactory to create a JpaTemplate for
Returns:
the new JpaTemplate instance
See Also:
setEntityManagerFactory(javax.persistence.EntityManagerFactory)

setEntityManager

public final void setEntityManager(javax.persistence.EntityManager entityManager)
Set the JPA EntityManager to be used by this DAO. Will automatically create a JpaTemplate for the given EntityManager.

See Also:
createJpaTemplate(javax.persistence.EntityManagerFactory), setJpaTemplate(org.springframework.orm.jpa.JpaTemplate)

createJpaTemplate

protected JpaTemplate createJpaTemplate(javax.persistence.EntityManager entityManager)
Create a JpaTemplate for the given EntityManager. Only invoked if populating the DAO with a EntityManager reference!

Can be overridden in subclasses to provide a JpaTemplate instance with different configuration, or a custom JpaTemplate subclass.

Parameters:
entityManager - the JPA EntityManager to create a JpaTemplate for
Returns:
the new JpaTemplate instance
See Also:
setEntityManagerFactory(javax.persistence.EntityManagerFactory)

setJpaTemplate

public final void setJpaTemplate(JpaTemplate jpaTemplate)
Set the JpaTemplate for this DAO explicitly, as an alternative to specifying a EntityManagerFactory.

See Also:
setEntityManagerFactory(javax.persistence.EntityManagerFactory)

getJpaTemplate

public final JpaTemplate getJpaTemplate()
Return the JpaTemplate for this DAO, pre-initialized with the EntityManagerFactory or set explicitly.

checkDaoConfig

protected final void checkDaoConfig()
Description copied from class: DaoSupport
Abstract subclasses must override this to check their configuration.

Implementors should be marked as final

Specified by:
checkDaoConfig in class DaoSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


OpenEntityManagerInViewFilter

org.springframework.orm.jpa.support
Class OpenEntityManagerInViewFilter

java.lang.Object
    extended by  org.springframework.web.filter.GenericFilterBean
        extended by  org.springframework.web.filter.OncePerRequestFilter
            extended by  org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter
All Implemented Interfaces:
Filter, BeanNameAware, DisposableBean, InitializingBean, ServletContextAware
public class OpenEntityManagerInViewFilter
extends OncePerRequestFilter

Servlet 2.3 Filter that binds a JPA EntityManager to the thread for the entire processing of the request. Intended for the "Open EntityManager in View" pattern, i.e. to allow for lazy loading in web views despite the original transactions already being completed.

This filter makes JPA EntityManagers available via the current thread, which will be autodetected by transaction managers. It is suitable for service layer transactions via JpaTransactionManager or JtaTransactionManager as well as for non-transactional read-only execution.

Looks up the EntityManagerFactory in Spring's root web application context. Supports a "entityManagerFactoryBeanName" filter init-param in web.xml; the default bean name is "entityManagerFactory". Looks up the EntityManagerFactory on each request, to avoid initialization order issues (when using ContextLoaderServlet, the root application context will get initialized after this filter).

Since:
2.0
Author:
Juergen Hoeller
See Also:
OpenEntityManagerInViewInterceptor, JpaInterceptor, JpaTransactionManager, JpaTemplate.execute(org.springframework.orm.jpa.JpaCallback), SharedEntityManagerCreator, TransactionSynchronizationManager

Field Summary
static String DEFAULT_PERSISTENCE_MANAGER_FACTORY_BEAN_NAME
Fields inherited from class org.springframework.web.filter.OncePerRequestFilter
ALREADY_FILTERED_SUFFIX
Fields inherited from class org.springframework.web.filter.GenericFilterBean
logger
Constructor Summary
OpenEntityManagerInViewFilter()
Method Summary
protected javax.persistence.EntityManager | createEntityManager(javax.persistence.EntityManagerFactory emf) Create a JPA EntityManager to be bound to a request.
protected void | doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) Same contract as for doFilter, but guaranteed to be just invoked once per request.
protected String | getEntityManagerFactoryBeanName() Return the bean name of the EntityManagerFactory to fetch from Spring's root application context.
protected javax.persistence.EntityManagerFactory | lookupEntityManagerFactory() Look up the EntityManagerFactory that this filter should use.
protected javax.persistence.EntityManagerFactory | lookupEntityManagerFactory(HttpServletRequest request) Look up the EntityManagerFactory that this filter should use, taking the current HTTP request as argument.
void | setEntityManagerFactoryBeanName(String entityManagerFactoryBeanName) Set the bean name of the EntityManagerFactory to fetch from Spring's root application context.
Methods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, getAlreadyFilteredAttributeName, shouldNotFilter
Methods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setServletContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_PERSISTENCE_MANAGER_FACTORY_BEAN_NAME

public static final String DEFAULT_PERSISTENCE_MANAGER_FACTORY_BEAN_NAME
See Also:
Constant Field Values
Constructor Detail

OpenEntityManagerInViewFilter

public OpenEntityManagerInViewFilter()
Method Detail

setEntityManagerFactoryBeanName

public void setEntityManagerFactoryBeanName(String entityManagerFactoryBeanName)
Set the bean name of the EntityManagerFactory to fetch from Spring's root application context. Default is "entityManagerFactory".

See Also:
DEFAULT_PERSISTENCE_MANAGER_FACTORY_BEAN_NAME

getEntityManagerFactoryBeanName

protected String getEntityManagerFactoryBeanName()
Return the bean name of the EntityManagerFactory to fetch from Spring's root application context.

doFilterInternal

protected void doFilterInternal(HttpServletRequest request,
                                HttpServletResponse response,
                                FilterChain filterChain)
                         throws ServletException,
                                IOException
Description copied from class: OncePerRequestFilter
Same contract as for doFilter, but guaranteed to be just invoked once per request. Provides HttpServletRequest and HttpServletResponse arguments instead of the default ServletRequest and ServletResponse ones.

Specified by:
doFilterInternal in class OncePerRequestFilter
Throws:
ServletException
IOException

lookupEntityManagerFactory

protected javax.persistence.EntityManagerFactory lookupEntityManagerFactory(HttpServletRequest request)
Look up the EntityManagerFactory that this filter should use, taking the current HTTP request as argument.

Default implementation delegates to the lookupEntityManagerFactory without arguments.

Returns:
the EntityManagerFactory to use
See Also:
lookupEntityManagerFactory()

lookupEntityManagerFactory

protected javax.persistence.EntityManagerFactory lookupEntityManagerFactory()
Look up the EntityManagerFactory that this filter should use. The default implementation looks for a bean with the specified name in Spring's root application context.

Returns:
the EntityManagerFactory to use
See Also:
getEntityManagerFactoryBeanName()

createEntityManager

protected javax.persistence.EntityManager createEntityManager(javax.persistence.EntityManagerFactory emf)
Create a JPA EntityManager to be bound to a request.

Can be overridden in subclasses.

Parameters:
emf - the EntityManagerFactory to use
See Also:
EntityManagerFactory.createEntityManager()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OpenEntityManagerInViewInterceptor

org.springframework.orm.jpa.support
Class OpenEntityManagerInViewInterceptor

java.lang.Object
    extended by  org.springframework.orm.jpa.EntityManagerFactoryAccessor
        extended by  org.springframework.orm.jpa.support.OpenEntityManagerInViewInterceptor
All Implemented Interfaces:
WebRequestInterceptor
public class OpenEntityManagerInViewInterceptor
extends EntityManagerFactoryAccessor
implements WebRequestInterceptor

Spring web request interceptor that binds a JPA EntityManager to the thread for the entire processing of the request. Intended for the "Open EntityManager in View" pattern, i.e. to allow for lazy loading in web views despite the original transactions already being completed.

This interceptor makes JPA EntityManagers available via the current thread, which will be autodetected by transaction managers. It is suitable for service layer transactions via JpaTransactionManager or JtaTransactionManager as well as for non-transactional read-only execution.

In contrast to OpenEntityManagerInViewFilter, this interceptor is set up in a Spring application context and can thus take advantage of bean wiring. It inherits common JPA configuration properties from JpaAccessor, to be configured in a bean definition.

Since:
2.0
Author:
Juergen Hoeller
See Also:
OpenEntityManagerInViewFilter, JpaInterceptor, JpaTransactionManager, JpaTemplate.execute(org.springframework.orm.jpa.JpaCallback), SharedEntityManagerCreator, TransactionSynchronizationManager

Field Summary
static String PARTICIPATE_SUFFIX
Suffix that gets appended to the EntityManagerFactory toString representation for the "participate in existing entity manager handling" request attribute.
Fields inherited from class org.springframework.orm.jpa.EntityManagerFactoryAccessor
logger
Constructor Summary
OpenEntityManagerInViewInterceptor()
Method Summary
void | afterCompletion(WebRequest request, Exception ex) Callback after completion of request processing, that is, after rendering the view.
protected String | getParticipateAttributeName() Return the name of the request attribute that identifies that a request is already filtered.
void | postHandle(WebRequest request, ModelMap model) Intercept the execution of a request handler after its successful invocation, right before view rendering (if any).
void | preHandle(WebRequest request) Intercept the execution of a request handler before its invocation.
Methods inherited from class org.springframework.orm.jpa.EntityManagerFactoryAccessor
createEntityManager, getEntityManagerFactory, getJpaPropertyMap, getTransactionalEntityManager, setEntityManagerFactory, setJpaProperties, setJpaPropertyMap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

PARTICIPATE_SUFFIX

public static final String PARTICIPATE_SUFFIX
Suffix that gets appended to the EntityManagerFactory toString representation for the "participate in existing entity manager handling" request attribute.

See Also:
getParticipateAttributeName(), Constant Field Values
Constructor Detail

OpenEntityManagerInViewInterceptor

public OpenEntityManagerInViewInterceptor()
Method Detail

preHandle

public void preHandle(WebRequest request)
               throws DataAccessException
Description copied from interface: WebRequestInterceptor
Intercept the execution of a request handler before its invocation.

Allows for preparing context resources (such as a Hibernate Session) and expose them as request attributes or as thread-local objects.

Specified by:
preHandle in interface WebRequestInterceptor
Parameters:
request - the current web request
Throws:
DataAccessException

postHandle

public void postHandle(WebRequest request,
                       ModelMap model)
Description copied from interface: WebRequestInterceptor
Intercept the execution of a request handler after its successful invocation, right before view rendering (if any).

Allows for modifying context resources after successful handler execution (for example, flushing a Hibernate Session).

Specified by:
postHandle in interface WebRequestInterceptor
Parameters:
request - the current web request
model - the map of model objects that will be exposed to the view (may be null). Can be used to analyze the exposed model and/or to add further model attributes, if desired.

afterCompletion

public void afterCompletion(WebRequest request,
                            Exception ex)
                     throws DataAccessException
Description copied from interface: WebRequestInterceptor
Callback after completion of request processing, that is, after rendering the view. Will be called on any outcome of handler execution, thus allows for proper resource cleanup.

Note: Will only be called if this interceptor's preHandle method has successfully completed!

Specified by:
afterCompletion in interface WebRequestInterceptor
Parameters:
request - the current web request
ex - exception thrown on handler execution, if any
Throws:
DataAccessException

getParticipateAttributeName

protected String getParticipateAttributeName()
Return the name of the request attribute that identifies that a request is already filtered. Default implementation takes the toString representation of the EntityManagerFactory instance and appends ".FILTERED".

See Also:
PARTICIPATE_SUFFIX
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PersistenceAnnotationBeanPostProcessor

org.springframework.orm.jpa.support
Class PersistenceAnnotationBeanPostProcessor

java.lang.Object
    extended by  org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
All Implemented Interfaces:
Serializable, BeanFactoryAware, BeanPostProcessor, DestructionAwareBeanPostProcessor, InstantiationAwareBeanPostProcessor, MergedBeanDefinitionPostProcessor, Ordered, PriorityOrdered
public class PersistenceAnnotationBeanPostProcessor
extends Object
implements InstantiationAwareBeanPostProcessor, DestructionAwareBeanPostProcessor, MergedBeanDefinitionPostProcessor, PriorityOrdered, BeanFactoryAware, Serializable

BeanPostProcessor that processes PersistenceUnit and PersistenceContext annotations, for injection of the corresponding JPA resources EntityManagerFactory and EntityManager. Any such annotated fields or methods in any Spring-managed object will automatically be injected.

This post-processor will inject sub-interfaces of EntityManagerFactory and EntityManager if the annotated fields or methods are declared as such. The actual type will be verified early, with the exception of a shared ("transactional") EntityManager reference, where type mismatches might be detected as late as on the first actual invocation.

Note: In the present implementation, PersistenceAnnotationBeanPostProcessor only supports @PersistenceUnit and @PersistenceContext with the "unitName" attribute, or no attribute at all (for the default unit). If those annotations are present with the "name" attribute at the class level, they will simply be ignored, since those only serve as deployment hint (as per the Java EE 5 specification).

This post-processor can either obtain EntityManagerFactory beans defined in the Spring application context (the default), or obtain EntityManagerFactory references from JNDI ("persistence unit references"). In the bean case, the persistence unit name will be matched against the actual deployed unit, with the bean name used as fallback unit name if no deployed name found. Typically, Spring's LocalContainerEntityManagerFactoryBean will be used for setting up such EntityManagerFactory beans. Alternatively, such beans may also be obtained from JNDI, e.g. using the jee:jndi-lookup XML configuration element (with the bean name matching the requested unit name). In both cases, the post-processor definition will look as simple as this:

 <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>
In the JNDI case, specify the corresponding JNDI names in this post-processor's "persistenceUnits" map, typically with matching persistence-unit-ref entries in the Java EE deployment descriptor. By default, those names are considered as resource references (according to the Java EE resource-ref convention), located underneath the "java:comp/env/" namespace. For example:
 <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor">
   <property name="persistenceUnits">
     <map/gt;
       <entry key="unit1" value="persistence/unit1"/>
       <entry key="unit2" value="persistence/unit2"/>
     </map/gt;
   </property>
 </bean>
In this case, the specified persistence units will always be resolved in JNDI rather than as Spring-defined beans. The entire persistence unit deployment, including the weaving of persistent classes, is then up to the Java EE server. Persistence contexts (i.e. EntityManager references) will be built based on those server-provided EntityManagerFactory references, using Spring's own transaction synchronization facilities for transactional EntityManager handling (typically with Spring's @Transactional annotation for demarcation and JtaTransactionManager as backend).

If you prefer the Java EE server's own EntityManager handling, specify entries in this post-processor's "persistenceContexts" map (or "extendedPersistenceContexts" map, typically with matching persistence-context-ref entries in the Java EE deployment descriptor. For example:

 <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor">
   <property name="persistenceContexts">
     <map/gt;
       <entry key="unit1" value="persistence/context1"/>
       <entry key="unit2" value="persistence/context2"/>
     </map/gt;
   </property>
 </bean>
If the application only obtains EntityManager references in the first place, this is all you need to specify. If you need EntityManagerFactory references as well, specify entries for both "persistenceUnits" and "persistenceContexts", pointing to matching JNDI locations.

NOTE: In general, do not inject EXTENDED EntityManagers into STATELESS beans, i.e. do not use @PersistenceContext with type EXTENDED in Spring beans defined with scope 'singleton' (Spring's default scope). Extended EntityManagers are not thread-safe, hence they must not be used in concurrently accessed beans (which Spring-managed singletons usually are).

Note: A default PersistenceAnnotationBeanPostProcessor will be registered by the "context:annotation-config" and "context:component-scan" XML tags. Remove or turn off the default annotation configuration there if you intend to specify a custom PersistenceAnnotationBeanPostProcessor bean definition.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller
See Also:
PersistenceUnit, PersistenceContext, Serialized Form

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
PersistenceAnnotationBeanPostProcessor()
Method Summary
protected  javax.persistence.EntityManagerFactory findDefaultEntityManagerFactory(String requestingBeanName)
Find a single default EntityManagerFactory in the Spring application context.
protected  javax.persistence.EntityManagerFactory findEntityManagerFactory(String unitName, String requestingBeanName)
Find an EntityManagerFactory with the given name in the current Spring application context, falling back to a single default EntityManagerFactory (if any) in case of no unit name specified.
protected  javax.persistence.EntityManagerFactory findNamedEntityManagerFactory(String unitName, String requestingBeanName)
Find an EntityManagerFactory with the given name in the current Spring application context.
 int getOrder()
Return the order value of this object, with a higher value meaning greater in terms of sorting.
protected  javax.persistence.EntityManager getPersistenceContext(String unitName, boolean extended)
Return a specified persistence context for the given unit name, as defined through the "persistenceContexts" (or "extendedPersistenceContexts") map.
protected  javax.persistence.EntityManagerFactory getPersistenceUnit(String unitName)
Return a specified persistence unit for the given unit name, as defined through the "persistenceUnits" map.
protected
<T> T
lookup(String jndiName, Class<T> requiredType)
Perform a JNDI lookup for the given resource by name.
 Object postProcessAfterInitialization(Object bean, String beanName)
Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).
 boolean postProcessAfterInstantiation(Object bean, String beanName)
Perform operations after the bean has been instantiated, via a constructor or factory method, but before Spring property population (from explicit properties or autowiring) occurs.
 void postProcessBeforeDestruction(Object bean, String beanName)
Apply this BeanPostProcessor to the given bean instance before its destruction.
 Object postProcessBeforeInitialization(Object bean, String beanName)
Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).
 Object postProcessBeforeInstantiation(Class beanClass, String beanName)
Apply this BeanPostProcessor before the target bean gets instantiated.
 void postProcessMergedBeanDefinition(RootBeanDefinition beanDefinition, Class beanType, String beanName)
Post-process the given merged bean definition for the specified bean.
 PropertyValues postProcessPropertyValues(PropertyValues pvs, PropertyDescriptor[] pds, Object bean, String beanName)
Post-process the given property values before the factory applies them to the given bean.
 void setBeanFactory(BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance.
 void setDefaultPersistenceUnitName(String unitName)
Specify the default persistence unit name, to be used in case of no unit name specified in an @PersistenceUnit / @PersistenceContext annotation.
 void setExtendedPersistenceContexts(Map<String,String> extendedPersistenceContexts)
Specify the extended persistence contexts for EntityManager lookups, as a Map from persistence unit name to persistence context JNDI name (which needs to resolve to an EntityManager instance).
 void setJndiEnvironment(Properties jndiEnvironment)
Set the JNDI environment to use for JNDI lookups.
 void setJndiTemplate(Object jndiTemplate)
Set the JNDI template to use for JNDI lookups.
 void setOrder(int order)
 void setPersistenceContexts(Map<String,String> persistenceContexts)
Specify the transactional persistence contexts for EntityManager lookups, as a Map from persistence unit name to persistence context JNDI name (which needs to resolve to an EntityManager instance).
 void setPersistenceUnits(Map<String,String> persistenceUnits)
Specify the persistence units for EntityManagerFactory lookups, as a Map from persistence unit name to persistence unit JNDI name (which needs to resolve to an EntityManagerFactory instance).
 void setResourceRef(boolean resourceRef)
Set whether the lookup occurs in a J2EE container, i.e.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PersistenceAnnotationBeanPostProcessor

public PersistenceAnnotationBeanPostProcessor()
Method Detail

setJndiTemplate

public void setJndiTemplate(Object jndiTemplate)
Set the JNDI template to use for JNDI lookups.

See Also:
JndiAccessor.setJndiTemplate(org.springframework.jndi.JndiTemplate)

setJndiEnvironment

public void setJndiEnvironment(Properties jndiEnvironment)
Set the JNDI environment to use for JNDI lookups.

See Also:
JndiAccessor.setJndiEnvironment(java.util.Properties)

setResourceRef

public void setResourceRef(boolean resourceRef)
Set whether the lookup occurs in a J2EE container, i.e. if the prefix "java:comp/env/" needs to be added if the JNDI name doesn't already contain it. PersistenceAnnotationBeanPostProcessor's default is "true".

See Also:
JndiLocatorSupport.setResourceRef(boolean)

setPersistenceUnits

public void setPersistenceUnits(Map<String,String> persistenceUnits)
Specify the persistence units for EntityManagerFactory lookups, as a Map from persistence unit name to persistence unit JNDI name (which needs to resolve to an EntityManagerFactory instance).

JNDI names specified here should refer to persistence-unit-ref entries in the Java EE deployment descriptor, matching the target persistence unit.

In case of no unit name specified in the annotation, the specified value for the default persistence unit will be taken (by default, the value mapped to the empty String), or simply the single persistence unit if there is only one.

This is mainly intended for use in a Java EE 5 environment, with all lookup driven by the standard JPA annotations, and all EntityManagerFactory references obtained from JNDI. No separate EntityManagerFactory bean definitions are necessary in such a scenario.

If no corresponding "persistenceContexts"/"extendedPersistenceContexts" are specified, @PersistenceContext will be resolved to EntityManagers built on top of the EntityManagerFactory defined here. Note that those will be Spring-managed EntityManagers, which implement transaction synchronization based on Spring's facilities. If you prefer the Java EE 5 server's own EntityManager handling, specify corresponding "persistenceContexts"/"extendedPersistenceContexts".

setPersistenceContexts

public void setPersistenceContexts(Map<String,String> persistenceContexts)
Specify the transactional persistence contexts for EntityManager lookups, as a Map from persistence unit name to persistence context JNDI name (which needs to resolve to an EntityManager instance).

JNDI names specified here should refer to persistence-context-ref entries in the Java EE deployment descriptors, matching the target persistence unit and being set up with persistence context type Transaction.

In case of no unit name specified in the annotation, the specified value for the default persistence unit will be taken (by default, the value mapped to the empty String), or simply the single persistence unit if there is only one.

This is mainly intended for use in a Java EE 5 environment, with all lookup driven by the standard JPA annotations, and all EntityManager references obtained from JNDI. No separate EntityManagerFactory bean definitions are necessary in such a scenario, and all EntityManager handling is done by the Java EE 5 server itself.

setExtendedPersistenceContexts

public void setExtendedPersistenceContexts(Map<String,String> extendedPersistenceContexts)
Specify the extended persistence contexts for EntityManager lookups, as a Map from persistence unit name to persistence context JNDI name (which needs to resolve to an EntityManager instance).

JNDI names specified here should refer to persistence-context-ref entries in the Java EE deployment descriptors, matching the target persistence unit and being set up with persistence context type Extended.

In case of no unit name specified in the annotation, the specified value for the default persistence unit will be taken (by default, the value mapped to the empty String), or simply the single persistence unit if there is only one.

This is mainly intended for use in a Java EE 5 environment, with all lookup driven by the standard JPA annotations, and all EntityManager references obtained from JNDI. No separate EntityManagerFactory bean definitions are necessary in such a scenario, and all EntityManager handling is done by the Java EE 5 server itself.

setDefaultPersistenceUnitName

public void setDefaultPersistenceUnitName(String unitName)
Specify the default persistence unit name, to be used in case of no unit name specified in an @PersistenceUnit / @PersistenceContext annotation.

This is mainly intended for lookups in the application context, indicating the target persistence unit name (typically matching the bean name), but also applies to lookups in the "persistenceUnits" / "persistenceContexts" / "extendedPersistenceContexts" map, avoiding the need for duplicated mappings for the empty String there.

Default is to check for a single EntityManagerFactory bean in the Spring application context, if any. If there are multiple such factories, either specify this default persistence unit name or explicitly refer to named persistence units in your annotations.

setOrder

public void setOrder(int order)

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
BeanInitializationException

postProcessMergedBeanDefinition

public void postProcessMergedBeanDefinition(RootBeanDefinition beanDefinition,
                                            Class beanType,
                                            String beanName)
Description copied from interface: MergedBeanDefinitionPostProcessor
Post-process the given merged bean definition for the specified bean.

Specified by:
postProcessMergedBeanDefinition in interface MergedBeanDefinitionPostProcessor
Parameters:
beanDefinition - the merged bean definition for the bean
beanType - the actual type of the managed bean instance
beanName - the name of the bean

postProcessBeforeInstantiation

public Object postProcessBeforeInstantiation(Class beanClass,
                                             String beanName)
                                      throws BeansException
Description copied from interface: InstantiationAwareBeanPostProcessor
Apply this BeanPostProcessor before the target bean gets instantiated. The returned bean object may be a proxy to use instead of the target bean, effectively suppressing default instantiation of the target bean.

If a non-null object is returned by this method, the bean creation process will be short-circuited. The only further processing applied is the BeanPostProcessor.postProcessAfterInitialization(java.lang.Object, java.lang.String) callback from the configured BeanPostProcessors.

This callback will only be applied to bean definitions with a bean class. In particular, it will not be applied to beans with a "factory-method".

Post-processors may implement the extended SmartInstantiationAwareBeanPostProcessor interface in order to predict the type of the bean object that they are going to return here.

Specified by:
postProcessBeforeInstantiation in interface InstantiationAwareBeanPostProcessor
Parameters:
beanClass - the class of the bean to be instantiated
beanName - the name of the bean
Returns:
the bean object to expose instead of a default instance of the target bean, or null to proceed with default instantiation
Throws:
BeansException - in case of errors
See Also:
AbstractBeanDefinition.hasBeanClass(), AbstractBeanDefinition.getFactoryMethodName()

postProcessAfterInstantiation

public boolean postProcessAfterInstantiation(Object bean,
                                             String beanName)
                                      throws BeansException
Description copied from interface: InstantiationAwareBeanPostProcessor
Perform operations after the bean has been instantiated, via a constructor or factory method, but before Spring property population (from explicit properties or autowiring) occurs.

This is the ideal callback for performing field injection on the given bean instance. See Spring's own AutowiredAnnotationBeanPostProcessor for a typical example.

Specified by:
postProcessAfterInstantiation in interface InstantiationAwareBeanPostProcessor
Parameters:
bean - the bean instance created, with properties not having been set yet
beanName - the name of the bean
Returns:
true if properties should be set on the bean; false if property population should be skipped. Normal implementations should return true. Returning false will also prevent any subsequent InstantiationAwareBeanPostProcessor instances being invoked on this bean instance.
Throws:
BeansException - in case of errors

postProcessPropertyValues

public PropertyValues postProcessPropertyValues(PropertyValues pvs,
                                                PropertyDescriptor[] pds,
                                                Object bean,
                                                String beanName)
                                         throws BeansException
Description copied from interface: InstantiationAwareBeanPostProcessor
Post-process the given property values before the factory applies them to the given bean. Allows for checking whether all dependencies have been satisfied, for example based on a "Required" annotation on bean property setters.

Also allows for replacing the property values to apply, typically through creating a new MutablePropertyValues instance based on the original PropertyValues, adding or removing specific values.

Specified by:
postProcessPropertyValues in interface InstantiationAwareBeanPostProcessor
Parameters:
pvs - the property values that the factory is about to apply (never null)
pds - the relevant property descriptors for the target bean (with ignored dependency types - which the factory handles specifically - already filtered out)
bean - the bean instance created, but whose properties have not yet been set
beanName - the name of the bean
Returns:
the actual property values to apply to to the given bean (can be the passed-in PropertyValues instance), or null to skip property population
Throws:
BeansException - in case of errors
See Also:
MutablePropertyValues

postProcessBeforeInitialization

public Object postProcessBeforeInitialization(Object bean,
                                              String beanName)
                                       throws BeansException
Description copied from interface: BeanPostProcessor
Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

Specified by:
postProcessBeforeInitialization in interface BeanPostProcessor
Parameters:
bean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
Throws:
BeansException - in case of errors
See Also:
InitializingBean.afterPropertiesSet()

postProcessAfterInitialization

public Object postProcessAfterInitialization(Object bean,
                                             String beanName)
                                      throws BeansException
Description copied from interface: BeanPostProcessor
Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

In case of a FactoryBean, this callback will be invoked for both the FactoryBean instance and the objects created by the FactoryBean (as of Spring 2.0). The post-processor can decide whether to apply to either the FactoryBean or created objects or both through corresponding bean instanceof FactoryBean checks.

This callback will also be invoked after a short-circuiting triggered by a InstantiationAwareBeanPostProcessor.postProcessBeforeInstantiation(java.lang.Class, java.lang.String) method, in contrast to all other BeanPostProcessor callbacks.

Specified by:
postProcessAfterInitialization in interface BeanPostProcessor
Parameters:
bean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
Throws:
BeansException - in case of errors
See Also:
InitializingBean.afterPropertiesSet(), FactoryBean

postProcessBeforeDestruction

public void postProcessBeforeDestruction(Object bean,
                                         String beanName)
                                  throws BeansException
Description copied from interface: DestructionAwareBeanPostProcessor
Apply this BeanPostProcessor to the given bean instance before its destruction. Can invoke custom destruction callbacks.

Like DisposableBean's destroy and a custom destroy method, this callback just applies to singleton beans in the factory (including inner beans).

Specified by:
postProcessBeforeDestruction in interface DestructionAwareBeanPostProcessor
Parameters:
bean - the bean instance to be destroyed
beanName - the name of the bean
Throws:
BeansException - in case of errors
See Also:
DisposableBean, AbstractBeanDefinition.setDestroyMethodName(java.lang.String)

getPersistenceUnit

protected javax.persistence.EntityManagerFactory getPersistenceUnit(String unitName)
Return a specified persistence unit for the given unit name, as defined through the "persistenceUnits" map.

Parameters:
unitName - the name of the persistence unit
Returns:
the corresponding EntityManagerFactory, or null if none found
See Also:
setPersistenceUnits(java.util.Map)

getPersistenceContext

protected javax.persistence.EntityManager getPersistenceContext(String unitName,
                                                                boolean extended)
Return a specified persistence context for the given unit name, as defined through the "persistenceContexts" (or "extendedPersistenceContexts") map.

Parameters:
unitName - the name of the persistence unit
extended - whether to obtain an extended persistence context
Returns:
the corresponding EntityManager, or null if none found
See Also:
setPersistenceContexts(java.util.Map), setExtendedPersistenceContexts(java.util.Map)

findEntityManagerFactory

protected javax.persistence.EntityManagerFactory findEntityManagerFactory(String unitName,
                                                                          String requestingBeanName)
                                                                   throws NoSuchBeanDefinitionException
Find an EntityManagerFactory with the given name in the current Spring application context, falling back to a single default EntityManagerFactory (if any) in case of no unit name specified.

Parameters:
unitName - the name of the persistence unit (may be null or empty)
requestingBeanName - the name of the requesting bean
Returns:
the EntityManagerFactory
Throws:
NoSuchBeanDefinitionException - if there is no such EntityManagerFactory in the context

findNamedEntityManagerFactory

protected javax.persistence.EntityManagerFactory findNamedEntityManagerFactory(String unitName,
                                                                               String requestingBeanName)
                                                                        throws NoSuchBeanDefinitionException
Find an EntityManagerFactory with the given name in the current Spring application context.

Parameters:
unitName - the name of the persistence unit (never empty)
requestingBeanName - the name of the requesting bean
Returns:
the EntityManagerFactory
Throws:
NoSuchBeanDefinitionException - if there is no such EntityManagerFactory in the context

findDefaultEntityManagerFactory

protected javax.persistence.EntityManagerFactory findDefaultEntityManagerFactory(String requestingBeanName)
                                                                          throws NoSuchBeanDefinitionException
Find a single default EntityManagerFactory in the Spring application context.

Returns:
the default EntityManagerFactory
Throws:
NoSuchBeanDefinitionException - if there is no single EntityManagerFactory in the context

lookup

protected <T> T lookup(String jndiName,
                       Class<T> requiredType)
            throws Exception
Perform a JNDI lookup for the given resource by name.

Called for EntityManagerFactory and EntityManager lookup when JNDI names are mapped for specific persistence units.

Parameters:
jndiName - the JNDI name to look up
requiredType - the required type of the object
Returns:
the obtained object
Throws:
Exception - if the JNDI lookup failed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SharedEntityManagerBean

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.orm.jpa.support
Class SharedEntityManagerBean

java.lang.Object
    extended by  org.springframework.orm.jpa.EntityManagerFactoryAccessor
        extended by  org.springframework.orm.jpa.support.SharedEntityManagerBean
All Implemented Interfaces:
FactoryBean<javax.persistence.EntityManager>, InitializingBean
public class SharedEntityManagerBean
extends EntityManagerFactoryAccessor
implements FactoryBean<javax.persistence.EntityManager>, InitializingBean

FactoryBean that exposes a shared JPA EntityManager reference for a given EntityManagerFactory. Typically used for an EntityManagerFactory created by LocalContainerEntityManagerFactoryBean, as direct alternative to a JNDI lookup for a Java EE 5 server's EntityManager reference.

The shared EntityManager will behave just like an EntityManager fetched from an application server's JNDI environment, as defined by the JPA specification. It will delegate all calls to the current transactional EntityManager, if any; otherwise, it will fall back to a newly created EntityManager per operation.

Can be passed to DAOs that expect a shared EntityManager reference rather than an EntityManagerFactory. Note that Spring's JpaTransactionManager always needs an EntityManagerFactory in order to create new transactional EntityManager instances.

Since:
2.0
Author:
Juergen Hoeller
See Also:
EntityManagerFactoryAccessor.setEntityManagerFactory(javax.persistence.EntityManagerFactory), setEntityManagerInterface(java.lang.Class), LocalEntityManagerFactoryBean, JpaTransactionManager

Field Summary
Fields inherited from class org.springframework.orm.jpa.EntityManagerFactoryAccessor
logger
Constructor Summary
SharedEntityManagerBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 javax.persistence.EntityManager getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<? extends javax.persistence.EntityManager> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setEntityManagerInterface(Class<? extends javax.persistence.EntityManager> entityManagerInterface)
Specify the EntityManager interface to expose.
Methods inherited from class org.springframework.orm.jpa.EntityManagerFactoryAccessor
createEntityManager, getEntityManagerFactory, getJpaPropertyMap, getTransactionalEntityManager, setEntityManagerFactory, setJpaProperties, setJpaPropertyMap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SharedEntityManagerBean

public SharedEntityManagerBean()
Method Detail

setEntityManagerInterface

public void setEntityManagerInterface(Class<? extends javax.persistence.EntityManager> entityManagerInterface)
Specify the EntityManager interface to expose.

Default is the EntityManager interface as defined by the EntityManagerFactoryInfo, if available. Else, the standard javax.persistence.EntityManager interface will be used.

See Also:
EntityManagerFactoryInfo.getEntityManagerInterface(), EntityManager

afterPropertiesSet

public final void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

getObject

public javax.persistence.EntityManager getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<javax.persistence.EntityManager>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends javax.persistence.EntityManager> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<javax.persistence.EntityManager>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<javax.persistence.EntityManager>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.orm.jpa.vendor

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.orm.jpa.vendor

Support classes for adapting to specific JPA vendors.

See:
Description

Class Summary
AbstractJpaVendorAdapter | Abstract JpaVendorAdapter implementation that defines common properties, to be translated into vendor-specific JPA properties by concrete subclasses.
EclipseLinkJpaDialect | JpaDialect implementation for Eclipse Persistence Services (EclipseLink).
EclipseLinkJpaVendorAdapter | JpaVendorAdapter implementation for Eclipse Persistence Services (EclipseLink).
HibernateJpaDialect | JpaDialect implementation for Hibernate EntityManager.
HibernateJpaVendorAdapter | JpaVendorAdapter implementation for Hibernate EntityManager.
OpenJpaDialect | JpaDialect implementation for Apache OpenJPA.
OpenJpaVendorAdapter | JpaVendorAdapter implementation for Apache OpenJPA.
TopLinkJpaDialect | JpaDialect implementation for Oracle TopLink Essentials.
TopLinkJpaVendorAdapter | JpaVendorAdapter implementation for Oracle TopLink Essentials.

Enum Summary
Database Enumeration for common database platforms.

Package org.springframework.orm.jpa.vendor Description

Support classes for adapting to specific JPA vendors.


org.springframework.orm.jpa.vendor Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.orm.jpa.vendor

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter (implements org.springframework.orm.jpa.JpaVendorAdapter)
      • org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter
      • org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter
      • org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter
      • org.springframework.orm.jpa.vendor.TopLinkJpaVendorAdapter
    • org.springframework.orm.jpa.DefaultJpaDialect (implements org.springframework.orm.jpa.JpaDialect, java.io.Serializable)
      • org.springframework.orm.jpa.vendor.EclipseLinkJpaDialect
      • org.springframework.orm.jpa.vendor.HibernateJpaDialect
      • org.springframework.orm.jpa.vendor.OpenJpaDialect
      • org.springframework.orm.jpa.vendor.TopLinkJpaDialect

Enum Hierarchy

  • java.lang.Object
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)
      • org.springframework.orm.jpa.vendor.Database


AbstractJpaVendorAdapter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.orm.jpa.vendor
Class AbstractJpaVendorAdapter

java.lang.Object
    extended by  org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter
All Implemented Interfaces:
JpaVendorAdapter
Direct Known Subclasses:
EclipseLinkJpaVendorAdapter, HibernateJpaVendorAdapter, OpenJpaVendorAdapter, TopLinkJpaVendorAdapter
public abstract class AbstractJpaVendorAdapter
extends Object
implements JpaVendorAdapter

Abstract JpaVendorAdapter implementation that defines common properties, to be translated into vendor-specific JPA properties by concrete subclasses.

Since:
2.0
Author:
Juergen Hoeller, Rod Johnson

Constructor Summary
AbstractJpaVendorAdapter()
Method Summary
protected Database | getDatabase() Return the target database to operate on.
protected String | getDatabasePlatform() Return the name of the target database to operate on.
Class<? extends javax.persistence.EntityManagerFactory> | getEntityManagerFactoryInterface() Return the vendor-specific EntityManagerFactory interface that the EntityManagerFactory proxy is supposed to implement.
Class<? extends javax.persistence.EntityManager> | getEntityManagerInterface() Return the vendor-specific EntityManager interface that this provider's EntityManagers will implement.
JpaDialect | getJpaDialect() Return the vendor-specific JpaDialect implementation for this provider, or null if there is none.
Map<String,?> | getJpaPropertyMap() Return a Map of vendor-specific JPA properties, typically based on settings in this JpaVendorAdapter instance.
String | getPersistenceProviderRootPackage() Return the name of the persistence provider's root package (e.g.
protected boolean | isGenerateDdl() Return whether to generate DDL after the EntityManagerFactory has been initialized creating/updating all relevant tables.
protected boolean | isShowSql() Return whether to show SQL in the log (or in the console).
void | postProcessEntityManagerFactory(javax.persistence.EntityManagerFactory emf) Post-process the EntityManagerFactory after it has been initialized.
void | setDatabase(Database database) Specify the target database to operate on, as a value of the Database enum: DB2, DERBY, H2, HSQL, INFORMIX, MYSQL, ORACLE, POSTGRESQL, SQL_SERVER, SYBASE
void | setDatabasePlatform(String databasePlatform) Specify the name of the target database to operate on.
void | setGenerateDdl(boolean generateDdl) Set whether to generate DDL after the EntityManagerFactory has been initialized, creating/updating all relevant tables.
void | setShowSql(boolean showSql) Set whether to show SQL in the log (or in the console).
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.orm.jpa.JpaVendorAdapter
getPersistenceProvider

Constructor Detail

AbstractJpaVendorAdapter

public AbstractJpaVendorAdapter()
Method Detail

setDatabase

public void setDatabase(Database database)
Specify the target database to operate on, as a value of the Database enum: DB2, DERBY, H2, HSQL, INFORMIX, MYSQL, ORACLE, POSTGRESQL, SQL_SERVER, SYBASE

getDatabase

protected Database getDatabase()
Return the target database to operate on.

setDatabasePlatform

public void setDatabasePlatform(String databasePlatform)
Specify the name of the target database to operate on. The supported values are vendor-dependent platform identifiers.

getDatabasePlatform

protected String getDatabasePlatform()
Return the name of the target database to operate on.

setGenerateDdl

public void setGenerateDdl(boolean generateDdl)
Set whether to generate DDL after the EntityManagerFactory has been initialized, creating/updating all relevant tables.

Note that the exact semantics of this flag depend on the underlying persistence provider. For any more advanced needs, specify the appropriate vendor-specific settings as "jpaProperties".

See Also:
AbstractEntityManagerFactoryBean.setJpaProperties(java.util.Properties)

isGenerateDdl

protected boolean isGenerateDdl()
Return whether to generate DDL after the EntityManagerFactory has been initialized creating/updating all relevant tables.

setShowSql

public void setShowSql(boolean showSql)
Set whether to show SQL in the log (or in the console).

For more specific logging configuration, specify the appropriate vendor-specific settings as "jpaProperties".

See Also:
AbstractEntityManagerFactoryBean.setJpaProperties(java.util.Properties)

isShowSql

protected boolean isShowSql()
Return whether to show SQL in the log (or in the console).

getPersistenceProviderRootPackage

public String getPersistenceProviderRootPackage()
Description copied from interface: JpaVendorAdapter
Return the name of the persistence provider's root package (e.g. "oracle.toplink.essentials"). Will be used for excluding provider classes from temporary class overriding.

Specified by:
getPersistenceProviderRootPackage in interface JpaVendorAdapter

getJpaPropertyMap

public Map<String,?> getJpaPropertyMap()
Description copied from interface: JpaVendorAdapter
Return a Map of vendor-specific JPA properties, typically based on settings in this JpaVendorAdapter instance.

Note that there might be further JPA properties defined on the EntityManagerFactory bean, which might potentially override individual JPA property values specified here.

Specified by:
getJpaPropertyMap in interface JpaVendorAdapter
Returns:
a Map of JPA properties, as as accepted by the standard JPA bootstrap facilities, or null or an empty Map if there are no such properties to expose
See Also:
Persistence.createEntityManagerFactory(String, java.util.Map), PersistenceProvider.createContainerEntityManagerFactory(javax.persistence.spi.PersistenceUnitInfo, java.util.Map)

getJpaDialect

public JpaDialect getJpaDialect()
Description copied from interface: JpaVendorAdapter
Return the vendor-specific JpaDialect implementation for this provider, or null if there is none.

Specified by:
getJpaDialect in interface JpaVendorAdapter

getEntityManagerFactoryInterface

public Class<? extends javax.persistence.EntityManagerFactory> getEntityManagerFactoryInterface()
Description copied from interface: JpaVendorAdapter
Return the vendor-specific EntityManagerFactory interface that the EntityManagerFactory proxy is supposed to implement.

If the provider does not offer any EntityManagerFactory extensions, the adapter should simply return the standard EntityManagerFactory class here.

Specified by:
getEntityManagerFactoryInterface in interface JpaVendorAdapter

getEntityManagerInterface

public Class<? extends javax.persistence.EntityManager> getEntityManagerInterface()
Description copied from interface: JpaVendorAdapter
Return the vendor-specific EntityManager interface that this provider's EntityManagers will implement.

If the provider does not offer any EntityManager extensions, the adapter should simply return the standard EntityManager class here.

Specified by:
getEntityManagerInterface in interface JpaVendorAdapter

postProcessEntityManagerFactory

public void postProcessEntityManagerFactory(javax.persistence.EntityManagerFactory emf)
Post-process the EntityManagerFactory after it has been initialized.

Specified by:
postProcessEntityManagerFactory in interface JpaVendorAdapter
Parameters:
emf - the EntityManagerFactory to process
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


EclipseLinkJpaDialect

org.springframework.orm.jpa.vendor
Class EclipseLinkJpaDialect

java.lang.Object
    extended by  org.springframework.orm.jpa.DefaultJpaDialect
        extended by  org.springframework.orm.jpa.vendor.EclipseLinkJpaDialect
All Implemented Interfaces:
Serializable, PersistenceExceptionTranslator, JpaDialect
public class EclipseLinkJpaDialect
extends DefaultJpaDialect

JpaDialect implementation for Eclipse Persistence Services (EclipseLink). Developed and tested against EclipseLink 1.0.

By default, this class acquires a EclipseLink transaction to get the JDBC Connection early. This allows mixing JDBC and JPA/EclipseLink operations in the same transaction. In some cases, this eager acquisition of a transaction/connection may impact scalability. In that case, set the "lazyDatabaseTransaction" flag to true if you do not require mixing JDBC and JPA operations in the same transaction. Otherwise, use a LazyConnectionDataSourceProxy to ensure that the cost of connection acquisition is near zero until code actually needs a JDBC Connection.

This class is very analogous to TopLinkJpaDialect, since EclipseLink is effectively the next generation of the TopLink product. Thanks to Mike Keith for the original EclipseLink support prototype!

Since:
2.5.2
Author:
Juergen Hoeller
See Also:
setLazyDatabaseTransaction(boolean), LazyConnectionDataSourceProxy, Serialized Form

Constructor Summary
EclipseLinkJpaDialect()
Method Summary
Object | beginTransaction(javax.persistence.EntityManager entityManager, TransactionDefinition definition) This implementation invokes the standard JPA Transaction.begin method.
ConnectionHandle | getJdbcConnection(javax.persistence.EntityManager em, boolean readOnly) This implementation always returns null, indicating that no JDBC Connection can be provided.
protected org.eclipse.persistence.sessions.Session | getSession(javax.persistence.EntityManager em) Get a traditional EclipseLink Session from the given EntityManager.
void | setLazyDatabaseTransaction(boolean lazyDatabaseTransaction) Set whether to lazily start a database transaction within an EclipseLink transaction.
Methods inherited from class org.springframework.orm.jpa.DefaultJpaDialect
cleanupTransaction, getEntityManagerFactoryPlusOperations, getEntityManagerPlusOperations, prepareTransaction, releaseJdbcConnection, supportsEntityManagerFactoryPlusOperations, supportsEntityManagerPlusOperations, translateExceptionIfPossible
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

EclipseLinkJpaDialect

public EclipseLinkJpaDialect()
Method Detail

setLazyDatabaseTransaction

public void setLazyDatabaseTransaction(boolean lazyDatabaseTransaction)
Set whether to lazily start a database transaction within an EclipseLink transaction.

By default, database transactions are started early. This allows for reusing the same JDBC Connection throughout an entire transaction, including read operations, and also for exposing EclipseLink transactions to JDBC access code (working on the same DataSource).

It is only recommended to switch this flag to "true" when no JDBC access code is involved in any of the transactions, and when it is acceptable to perform read operations outside of the transactional JDBC Connection.

See Also:
oracle.toplink.sessions.UnitOfWork#beginEarlyTransaction()

beginTransaction

public Object beginTransaction(javax.persistence.EntityManager entityManager,
                               TransactionDefinition definition)
                        throws javax.persistence.PersistenceException,
                               SQLException,
                               TransactionException
Description copied from class: DefaultJpaDialect
This implementation invokes the standard JPA Transaction.begin method. Throws an InvalidIsolationLevelException if a non-default isolation level is set.

This implementation does not return any transaction data Object, since there is no state to be kept for a standard JPA transaction. Hence, subclasses do not have to care about the return value (null) of this implementation and are free to return their own transaction data Object.

Specified by:
beginTransaction in interface JpaDialect
Overrides:
beginTransaction in class DefaultJpaDialect
Parameters:
entityManager - the EntityManager to begin a JPA transaction on
definition - the Spring transaction definition that defines semantics
Returns:
an arbitrary object that holds transaction data, if any (to be passed into JpaDialect.cleanupTransaction(java.lang.Object)). May implement the SavepointManager interface.
Throws:
javax.persistence.PersistenceException - if thrown by JPA methods
SQLException - if thrown by JDBC methods
TransactionException - in case of invalid arguments
See Also:
EntityTransaction.begin(), InvalidIsolationLevelException, DefaultJpaDialect.cleanupTransaction(java.lang.Object)

getJdbcConnection

public ConnectionHandle getJdbcConnection(javax.persistence.EntityManager em,
                                          boolean readOnly)
                                   throws javax.persistence.PersistenceException,
                                          SQLException
Description copied from class: DefaultJpaDialect
This implementation always returns null, indicating that no JDBC Connection can be provided.

Specified by:
getJdbcConnection in interface JpaDialect
Overrides:
getJdbcConnection in class DefaultJpaDialect
Parameters:
em - the current JPA EntityManager
readOnly - whether the Connection is only needed for read-only purposes
Returns:
a handle for the JDBC Connection, to be passed into releaseJdbcConnection, or null if no JDBC Connection can be retrieved
Throws:
javax.persistence.PersistenceException - if thrown by JPA methods
SQLException - if thrown by JDBC methods
See Also:
JpaDialect.releaseJdbcConnection(org.springframework.jdbc.datasource.ConnectionHandle, javax.persistence.EntityManager), ConnectionHandle.getConnection(), SimpleConnectionHandle, JpaTransactionManager.setDataSource(javax.sql.DataSource), NativeJdbcExtractor

getSession

protected org.eclipse.persistence.sessions.Session getSession(javax.persistence.EntityManager em)
Get a traditional EclipseLink Session from the given EntityManager.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EclipseLinkJpaVendorAdapter

org.springframework.orm.jpa.vendor
Class EclipseLinkJpaVendorAdapter

java.lang.Object
    extended by  org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter
        extended by  org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter
All Implemented Interfaces:
JpaVendorAdapter
public class EclipseLinkJpaVendorAdapter
extends AbstractJpaVendorAdapter

JpaVendorAdapter implementation for Eclipse Persistence Services (EclipseLink). Developed and tested against EclipseLink 1.0.

Exposes EclipseLink's persistence provider and EntityManager extension interface, and supports AbstractJpaVendorAdapter's common configuration settings.

This class is very analogous to TopLinkJpaVendorAdapter, since EclipseLink is effectively the next generation of the TopLink product. Thanks to Mike Keith for the original EclipseLink support prototype!

NOTE: No need to filter out classes from the JPA providers package for EclipseLink (see SPR-6040)

Since:
2.5.2
Author:
Juergen Hoeller, Thomas Risberg
See Also:
PersistenceProvider, JpaEntityManager

Constructor Summary
EclipseLinkJpaVendorAdapter()
Method Summary
protected String | determineTargetDatabaseName(Database database) Determine the EclipseLink target database name for the given database.
Class<? extends javax.persistence.EntityManager> | getEntityManagerInterface() Return the vendor-specific EntityManager interface that this provider's EntityManagers will implement.
JpaDialect | getJpaDialect() Return the vendor-specific JpaDialect implementation for this provider, or null if there is none.
Map<String,Object> | getJpaPropertyMap() Return a Map of vendor-specific JPA properties, typically based on settings in this JpaVendorAdapter instance.
javax.persistence.spi.PersistenceProvider | getPersistenceProvider() Return the vendor-specific persistence provider.
Methods inherited from class org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter
getDatabase, getDatabasePlatform, getEntityManagerFactoryInterface, getPersistenceProviderRootPackage, isGenerateDdl, isShowSql, postProcessEntityManagerFactory, setDatabase, setDatabasePlatform, setGenerateDdl, setShowSql
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

EclipseLinkJpaVendorAdapter

public EclipseLinkJpaVendorAdapter()
Method Detail

getPersistenceProvider

public javax.persistence.spi.PersistenceProvider getPersistenceProvider()
Description copied from interface: JpaVendorAdapter
Return the vendor-specific persistence provider.

getJpaPropertyMap

public Map<String,Object> getJpaPropertyMap()
Description copied from interface: JpaVendorAdapter
Return a Map of vendor-specific JPA properties, typically based on settings in this JpaVendorAdapter instance.

Note that there might be further JPA properties defined on the EntityManagerFactory bean, which might potentially override individual JPA property values specified here.

Specified by:
getJpaPropertyMap in interface JpaVendorAdapter
Overrides:
getJpaPropertyMap in class AbstractJpaVendorAdapter
Returns:
a Map of JPA properties, as as accepted by the standard JPA bootstrap facilities, or null or an empty Map if there are no such properties to expose
See Also:
Persistence.createEntityManagerFactory(String, java.util.Map), PersistenceProvider.createContainerEntityManagerFactory(javax.persistence.spi.PersistenceUnitInfo, java.util.Map)

determineTargetDatabaseName

protected String determineTargetDatabaseName(Database database)
Determine the EclipseLink target database name for the given database.

Parameters:
database - the specified database
Returns:
the EclipseLink target database name, or null if none found

getJpaDialect

public JpaDialect getJpaDialect()
Description copied from interface: JpaVendorAdapter
Return the vendor-specific JpaDialect implementation for this provider, or null if there is none.

Specified by:
getJpaDialect in interface JpaVendorAdapter
Overrides:
getJpaDialect in class AbstractJpaVendorAdapter

getEntityManagerInterface

public Class<? extends javax.persistence.EntityManager> getEntityManagerInterface()
Description copied from interface: JpaVendorAdapter
Return the vendor-specific EntityManager interface that this provider's EntityManagers will implement.

If the provider does not offer any EntityManager extensions, the adapter should simply return the standard EntityManager class here.

Specified by:
getEntityManagerInterface in interface JpaVendorAdapter
Overrides:
getEntityManagerInterface in class AbstractJpaVendorAdapter
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


HibernateJpaDialect

org.springframework.orm.jpa.vendor
Class HibernateJpaDialect

java.lang.Object
    extended by  org.springframework.orm.jpa.DefaultJpaDialect
        extended by  org.springframework.orm.jpa.vendor.HibernateJpaDialect
All Implemented Interfaces:
Serializable, PersistenceExceptionTranslator, JpaDialect
public class HibernateJpaDialect
extends DefaultJpaDialect

JpaDialect implementation for Hibernate EntityManager. Developed and tested against Hibernate 3.3.

Since:
2.0
Author:
Costin Leau, Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
HibernateJpaDialect()
Method Summary
Object | beginTransaction(javax.persistence.EntityManager entityManager, TransactionDefinition definition) This implementation invokes the standard JPA Transaction.begin method.
void | cleanupTransaction(Object transactionData) This implementation does nothing, since the default beginTransaction implementation does not require any cleanup.
ConnectionHandle | getJdbcConnection(javax.persistence.EntityManager entityManager, boolean readOnly) This implementation always returns null, indicating that no JDBC Connection can be provided.
protected org.hibernate.Session | getSession(javax.persistence.EntityManager em)
Object | prepareTransaction(javax.persistence.EntityManager entityManager, boolean readOnly, String name) Prepare a JPA transaction, applying the specified semantics.
DataAccessException | translateExceptionIfPossible(RuntimeException ex) This implementation delegates to EntityManagerFactoryUtils.
Methods inherited from class org.springframework.orm.jpa.DefaultJpaDialect
getEntityManagerFactoryPlusOperations, getEntityManagerPlusOperations, releaseJdbcConnection, supportsEntityManagerFactoryPlusOperations, supportsEntityManagerPlusOperations
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

HibernateJpaDialect

public HibernateJpaDialect()
Method Detail

beginTransaction

public Object beginTransaction(javax.persistence.EntityManager entityManager,
                               TransactionDefinition definition)
                        throws javax.persistence.PersistenceException,
                               SQLException,
                               TransactionException
Description copied from class: DefaultJpaDialect
This implementation invokes the standard JPA Transaction.begin method. Throws an InvalidIsolationLevelException if a non-default isolation level is set.

This implementation does not return any transaction data Object, since there is no state to be kept for a standard JPA transaction. Hence, subclasses do not have to care about the return value (null) of this implementation and are free to return their own transaction data Object.

Specified by:
beginTransaction in interface JpaDialect
Overrides:
beginTransaction in class DefaultJpaDialect
Parameters:
entityManager - the EntityManager to begin a JPA transaction on
definition - the Spring transaction definition that defines semantics
Returns:
an arbitrary object that holds transaction data, if any (to be passed into JpaDialect.cleanupTransaction(java.lang.Object)). May implement the SavepointManager interface.
Throws:
javax.persistence.PersistenceException - if thrown by JPA methods
SQLException - if thrown by JDBC methods
TransactionException - in case of invalid arguments
See Also:
EntityTransaction.begin(), InvalidIsolationLevelException, DefaultJpaDialect.cleanupTransaction(java.lang.Object)

prepareTransaction

public Object prepareTransaction(javax.persistence.EntityManager entityManager,
                                 boolean readOnly,
                                 String name)
                          throws javax.persistence.PersistenceException
Description copied from interface: JpaDialect
Prepare a JPA transaction, applying the specified semantics. Called by EntityManagerFactoryUtils when enlisting an EntityManager in a JTA transaction.

An implementation can apply the read-only flag as flush mode. In that case, a transaction data object can be returned that holds the previous flush mode (and possibly other data), to be reset in cleanupTransaction.

Implementations can also use the Spring transaction name, as exposed by the passed-in TransactionDefinition, to optimize for specific data access use cases (effectively using the current transaction name as use case identifier).

Specified by:
prepareTransaction in interface JpaDialect
Overrides:
prepareTransaction in class DefaultJpaDialect
Parameters:
entityManager - the EntityManager to begin a JPA transaction on
readOnly - whether the transaction is supposed to be read-only
name - the name of the transaction (if any)
Returns:
an arbitrary object that holds transaction data, if any (to be passed into cleanupTransaction)
Throws:
javax.persistence.PersistenceException - if thrown by JPA methods
See Also:
JpaDialect.cleanupTransaction(java.lang.Object)

cleanupTransaction

public void cleanupTransaction(Object transactionData)
Description copied from class: DefaultJpaDialect
This implementation does nothing, since the default beginTransaction implementation does not require any cleanup.

Specified by:
cleanupTransaction in interface JpaDialect
Overrides:
cleanupTransaction in class DefaultJpaDialect
Parameters:
transactionData - arbitrary object that holds transaction data, if any (as returned by beginTransaction or prepareTransaction)
See Also:
DefaultJpaDialect.beginTransaction(javax.persistence.EntityManager, org.springframework.transaction.TransactionDefinition)

getJdbcConnection

public ConnectionHandle getJdbcConnection(javax.persistence.EntityManager entityManager,
                                          boolean readOnly)
                                   throws javax.persistence.PersistenceException,
                                          SQLException
Description copied from class: DefaultJpaDialect
This implementation always returns null, indicating that no JDBC Connection can be provided.

Specified by:
getJdbcConnection in interface JpaDialect
Overrides:
getJdbcConnection in class DefaultJpaDialect
Parameters:
entityManager - the current JPA EntityManager
readOnly - whether the Connection is only needed for read-only purposes
Returns:
a handle for the JDBC Connection, to be passed into releaseJdbcConnection, or null if no JDBC Connection can be retrieved
Throws:
javax.persistence.PersistenceException - if thrown by JPA methods
SQLException - if thrown by JDBC methods
See Also:
JpaDialect.releaseJdbcConnection(org.springframework.jdbc.datasource.ConnectionHandle, javax.persistence.EntityManager), ConnectionHandle.getConnection(), SimpleConnectionHandle, JpaTransactionManager.setDataSource(javax.sql.DataSource), NativeJdbcExtractor

translateExceptionIfPossible

public DataAccessException translateExceptionIfPossible(RuntimeException ex)
Description copied from class: DefaultJpaDialect
This implementation delegates to EntityManagerFactoryUtils.

Specified by:
translateExceptionIfPossible in interface PersistenceExceptionTranslator
Overrides:
translateExceptionIfPossible in class DefaultJpaDialect
Parameters:
ex - a RuntimeException thrown
Returns:
the corresponding DataAccessException (or null if the exception could not be translated, as in this case it may result from user code rather than an actual persistence problem)
See Also:
EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(java.lang.RuntimeException)

getSession

protected org.hibernate.Session getSession(javax.persistence.EntityManager em)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HibernateJpaVendorAdapter

org.springframework.orm.jpa.vendor
Class HibernateJpaVendorAdapter

java.lang.Object
    extended by  org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter
        extended by  org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter
All Implemented Interfaces:
JpaVendorAdapter
public class HibernateJpaVendorAdapter
extends AbstractJpaVendorAdapter

JpaVendorAdapter implementation for Hibernate EntityManager. Developed and tested against Hibernate 3.3.

Exposes Hibernate's persistence provider and EntityManager extension interface, and supports AbstractJpaVendorAdapter's common configuration settings.

Since:
2.0
Author:
Juergen Hoeller, Rod Johnson
See Also:
HibernatePersistence, HibernateEntityManager

Constructor Summary
HibernateJpaVendorAdapter()
Method Summary
protected Class | determineDatabaseDialectClass(Database database) Determine the Hibernate database dialect class for the given target database.
Class<? extends javax.persistence.EntityManagerFactory> | getEntityManagerFactoryInterface() Return the vendor-specific EntityManagerFactory interface that the EntityManagerFactory proxy is supposed to implement.
Class<? extends javax.persistence.EntityManager> | getEntityManagerInterface() Return the vendor-specific EntityManager interface that this provider's EntityManagers will implement.
JpaDialect | getJpaDialect() Return the vendor-specific JpaDialect implementation for this provider, or null if there is none.
Map<String,Object> | getJpaPropertyMap() Return a Map of vendor-specific JPA properties, typically based on settings in this JpaVendorAdapter instance.
javax.persistence.spi.PersistenceProvider | getPersistenceProvider() Return the vendor-specific persistence provider.
String | getPersistenceProviderRootPackage() Return the name of the persistence provider's root package (e.g.
Methods inherited from class org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter
getDatabase, getDatabasePlatform, isGenerateDdl, isShowSql, postProcessEntityManagerFactory, setDatabase, setDatabasePlatform, setGenerateDdl, setShowSql
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

HibernateJpaVendorAdapter

public HibernateJpaVendorAdapter()
Method Detail

getPersistenceProvider

public javax.persistence.spi.PersistenceProvider getPersistenceProvider()
Description copied from interface: JpaVendorAdapter
Return the vendor-specific persistence provider.

getPersistenceProviderRootPackage

public String getPersistenceProviderRootPackage()
Description copied from interface: JpaVendorAdapter
Return the name of the persistence provider's root package (e.g. "oracle.toplink.essentials"). Will be used for excluding provider classes from temporary class overriding.

Specified by:
getPersistenceProviderRootPackage in interface JpaVendorAdapter
Overrides:
getPersistenceProviderRootPackage in class AbstractJpaVendorAdapter

getJpaPropertyMap

public Map<String,Object> getJpaPropertyMap()
Description copied from interface: JpaVendorAdapter
Return a Map of vendor-specific JPA properties, typically based on settings in this JpaVendorAdapter instance.

Note that there might be further JPA properties defined on the EntityManagerFactory bean, which might potentially override individual JPA property values specified here.

Specified by:
getJpaPropertyMap in interface JpaVendorAdapter
Overrides:
getJpaPropertyMap in class AbstractJpaVendorAdapter
Returns:
a Map of JPA properties, as as accepted by the standard JPA bootstrap facilities, or null or an empty Map if there are no such properties to expose
See Also:
Persistence.createEntityManagerFactory(String, java.util.Map), PersistenceProvider.createContainerEntityManagerFactory(javax.persistence.spi.PersistenceUnitInfo, java.util.Map)

determineDatabaseDialectClass

protected Class determineDatabaseDialectClass(Database database)
Determine the Hibernate database dialect class for the given target database.

Parameters:
database - the target database
Returns:
the Hibernate database dialect class, or null if none found

getJpaDialect

public JpaDialect getJpaDialect()
Description copied from interface: JpaVendorAdapter
Return the vendor-specific JpaDialect implementation for this provider, or null if there is none.

Specified by:
getJpaDialect in interface JpaVendorAdapter
Overrides:
getJpaDialect in class AbstractJpaVendorAdapter

getEntityManagerFactoryInterface

public Class<? extends javax.persistence.EntityManagerFactory> getEntityManagerFactoryInterface()
Description copied from interface: JpaVendorAdapter
Return the vendor-specific EntityManagerFactory interface that the EntityManagerFactory proxy is supposed to implement.

If the provider does not offer any EntityManagerFactory extensions, the adapter should simply return the standard EntityManagerFactory class here.

Specified by:
getEntityManagerFactoryInterface in interface JpaVendorAdapter
Overrides:
getEntityManagerFactoryInterface in class AbstractJpaVendorAdapter

getEntityManagerInterface

public Class<? extends javax.persistence.EntityManager> getEntityManagerInterface()
Description copied from interface: JpaVendorAdapter
Return the vendor-specific EntityManager interface that this provider's EntityManagers will implement.

If the provider does not offer any EntityManager extensions, the adapter should simply return the standard EntityManager class here.

Specified by:
getEntityManagerInterface in interface JpaVendorAdapter
Overrides:
getEntityManagerInterface in class AbstractJpaVendorAdapter
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


OpenJpaDialect

org.springframework.orm.jpa.vendor
Class OpenJpaDialect

java.lang.Object
    extended by  org.springframework.orm.jpa.DefaultJpaDialect
        extended by  org.springframework.orm.jpa.vendor.OpenJpaDialect
All Implemented Interfaces:
Serializable, PersistenceExceptionTranslator, JpaDialect
public class OpenJpaDialect
extends DefaultJpaDialect

JpaDialect implementation for Apache OpenJPA. Developed and tested against OpenJPA 0.9.7.

Since:
2.0
Author:
Costin Leau, Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
OpenJpaDialect()
Method Summary
Object | beginTransaction(javax.persistence.EntityManager entityManager, TransactionDefinition definition) This implementation invokes the standard JPA Transaction.begin method.
ConnectionHandle | getJdbcConnection(javax.persistence.EntityManager entityManager, boolean readOnly) This implementation always returns null, indicating that no JDBC Connection can be provided.
protected org.apache.openjpa.persistence.OpenJPAEntityManager | getOpenJPAEntityManager(javax.persistence.EntityManager em) Return the OpenJPA-specific interface of EntityManager.
Methods inherited from class org.springframework.orm.jpa.DefaultJpaDialect
cleanupTransaction, getEntityManagerFactoryPlusOperations, getEntityManagerPlusOperations, prepareTransaction, releaseJdbcConnection, supportsEntityManagerFactoryPlusOperations, supportsEntityManagerPlusOperations, translateExceptionIfPossible
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OpenJpaDialect

public OpenJpaDialect()
Method Detail

beginTransaction

public Object beginTransaction(javax.persistence.EntityManager entityManager,
                               TransactionDefinition definition)
                        throws javax.persistence.PersistenceException,
                               SQLException,
                               TransactionException
Description copied from class: DefaultJpaDialect
This implementation invokes the standard JPA Transaction.begin method. Throws an InvalidIsolationLevelException if a non-default isolation level is set.

This implementation does not return any transaction data Object, since there is no state to be kept for a standard JPA transaction. Hence, subclasses do not have to care about the return value (null) of this implementation and are free to return their own transaction data Object.

Specified by:
beginTransaction in interface JpaDialect
Overrides:
beginTransaction in class DefaultJpaDialect
Parameters:
entityManager - the EntityManager to begin a JPA transaction on
definition - the Spring transaction definition that defines semantics
Returns:
an arbitrary object that holds transaction data, if any (to be passed into JpaDialect.cleanupTransaction(java.lang.Object)). May implement the SavepointManager interface.
Throws:
javax.persistence.PersistenceException - if thrown by JPA methods
SQLException - if thrown by JDBC methods
TransactionException - in case of invalid arguments
See Also:
EntityTransaction.begin(), InvalidIsolationLevelException, DefaultJpaDialect.cleanupTransaction(java.lang.Object)

getJdbcConnection

public ConnectionHandle getJdbcConnection(javax.persistence.EntityManager entityManager,
                                          boolean readOnly)
                                   throws javax.persistence.PersistenceException,
                                          SQLException
Description copied from class: DefaultJpaDialect
This implementation always returns null, indicating that no JDBC Connection can be provided.

Specified by:
getJdbcConnection in interface JpaDialect
Overrides:
getJdbcConnection in class DefaultJpaDialect
Parameters:
entityManager - the current JPA EntityManager
readOnly - whether the Connection is only needed for read-only purposes
Returns:
a handle for the JDBC Connection, to be passed into releaseJdbcConnection, or null if no JDBC Connection can be retrieved
Throws:
javax.persistence.PersistenceException - if thrown by JPA methods
SQLException - if thrown by JDBC methods
See Also:
JpaDialect.releaseJdbcConnection(org.springframework.jdbc.datasource.ConnectionHandle, javax.persistence.EntityManager), ConnectionHandle.getConnection(), SimpleConnectionHandle, JpaTransactionManager.setDataSource(javax.sql.DataSource), NativeJdbcExtractor

getOpenJPAEntityManager

protected org.apache.openjpa.persistence.OpenJPAEntityManager getOpenJPAEntityManager(javax.persistence.EntityManager em)
Return the OpenJPA-specific interface of EntityManager.

Parameters:
em - the generic EntityManager instance
Returns:
the OpenJPA-specific interface of EntityManager
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OpenJpaVendorAdapter

org.springframework.orm.jpa.vendor
Class OpenJpaVendorAdapter

java.lang.Object
    extended by  org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter
        extended by  org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter
All Implemented Interfaces:
JpaVendorAdapter
public class OpenJpaVendorAdapter
extends AbstractJpaVendorAdapter

JpaVendorAdapter implementation for Apache OpenJPA. Developed and tested against OpenJPA 1.0.0.

Exposes OpenJPA's persistence provider and EntityManager extension interface, and supports AbstractJpaVendorAdapter's common configuration settings.

Since:
2.0
Author:
Costin Leau, Juergen Hoeller
See Also:
PersistenceProviderImpl, OpenJPAEntityManager

Constructor Summary
OpenJpaVendorAdapter()
Method Summary
protected String | determineDatabaseDictionary(Database database) Determine the OpenJPA database dictionary name for the given database.
Class<? extends javax.persistence.EntityManagerFactory> | getEntityManagerFactoryInterface() Return the vendor-specific EntityManagerFactory interface that the EntityManagerFactory proxy is supposed to implement.
Class<? extends javax.persistence.EntityManager> | getEntityManagerInterface() Return the vendor-specific EntityManager interface that this provider's EntityManagers will implement.
JpaDialect | getJpaDialect() Return the vendor-specific JpaDialect implementation for this provider, or null if there is none.
Map<String,Object> | getJpaPropertyMap() Return a Map of vendor-specific JPA properties, typically based on settings in this JpaVendorAdapter instance.
javax.persistence.spi.PersistenceProvider | getPersistenceProvider() Return the vendor-specific persistence provider.
String | getPersistenceProviderRootPackage() Return the name of the persistence provider's root package (e.g.
Methods inherited from class org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter
getDatabase, getDatabasePlatform, isGenerateDdl, isShowSql, postProcessEntityManagerFactory, setDatabase, setDatabasePlatform, setGenerateDdl, setShowSql
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OpenJpaVendorAdapter

public OpenJpaVendorAdapter()
Method Detail

getPersistenceProvider

public javax.persistence.spi.PersistenceProvider getPersistenceProvider()
Description copied from interface: JpaVendorAdapter
Return the vendor-specific persistence provider.

getPersistenceProviderRootPackage

public String getPersistenceProviderRootPackage()
Description copied from interface: JpaVendorAdapter
Return the name of the persistence provider's root package (e.g. "oracle.toplink.essentials"). Will be used for excluding provider classes from temporary class overriding.

Specified by:
getPersistenceProviderRootPackage in interface JpaVendorAdapter
Overrides:
getPersistenceProviderRootPackage in class AbstractJpaVendorAdapter

getJpaPropertyMap

public Map<String,Object> getJpaPropertyMap()
Description copied from interface: JpaVendorAdapter
Return a Map of vendor-specific JPA properties, typically based on settings in this JpaVendorAdapter instance.

Note that there might be further JPA properties defined on the EntityManagerFactory bean, which might potentially override individual JPA property values specified here.

Specified by:
getJpaPropertyMap in interface JpaVendorAdapter
Overrides:
getJpaPropertyMap in class AbstractJpaVendorAdapter
Returns:
a Map of JPA properties, as as accepted by the standard JPA bootstrap facilities, or null or an empty Map if there are no such properties to expose
See Also:
Persistence.createEntityManagerFactory(String, java.util.Map), PersistenceProvider.createContainerEntityManagerFactory(javax.persistence.spi.PersistenceUnitInfo, java.util.Map)

determineDatabaseDictionary

protected String determineDatabaseDictionary(Database database)
Determine the OpenJPA database dictionary name for the given database.

Parameters:
database - the specified database
Returns:
the OpenJPA database dictionary name, or null if none found

getJpaDialect

public JpaDialect getJpaDialect()
Description copied from interface: JpaVendorAdapter
Return the vendor-specific JpaDialect implementation for this provider, or null if there is none.

Specified by:
getJpaDialect in interface JpaVendorAdapter
Overrides:
getJpaDialect in class AbstractJpaVendorAdapter

getEntityManagerFactoryInterface

public Class<? extends javax.persistence.EntityManagerFactory> getEntityManagerFactoryInterface()
Description copied from interface: JpaVendorAdapter
Return the vendor-specific EntityManagerFactory interface that the EntityManagerFactory proxy is supposed to implement.

If the provider does not offer any EntityManagerFactory extensions, the adapter should simply return the standard EntityManagerFactory class here.

Specified by:
getEntityManagerFactoryInterface in interface JpaVendorAdapter
Overrides:
getEntityManagerFactoryInterface in class AbstractJpaVendorAdapter

getEntityManagerInterface

public Class<? extends javax.persistence.EntityManager> getEntityManagerInterface()
Description copied from interface: JpaVendorAdapter
Return the vendor-specific EntityManager interface that this provider's EntityManagers will implement.

If the provider does not offer any EntityManager extensions, the adapter should simply return the standard EntityManager class here.

Specified by:
getEntityManagerInterface in interface JpaVendorAdapter
Overrides:
getEntityManagerInterface in class AbstractJpaVendorAdapter
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


TopLinkJpaDialect

org.springframework.orm.jpa.vendor
Class TopLinkJpaDialect

java.lang.Object
    extended by  org.springframework.orm.jpa.DefaultJpaDialect
        extended by  org.springframework.orm.jpa.vendor.TopLinkJpaDialect
All Implemented Interfaces:
Serializable, PersistenceExceptionTranslator, JpaDialect
public class TopLinkJpaDialect
extends DefaultJpaDialect

JpaDialect implementation for Oracle TopLink Essentials. Developed and tested against TopLink Essentials v2.

By default, this class acquires a TopLink transaction to get the JDBC Connection early. This allows mixing JDBC and JPA/TopLink operations in the same transaction. In some cases, this eager acquisition of a transaction/connection may impact scalability. In that case, set the "lazyDatabaseTransaction" flag to true if you do not require mixing JDBC and JPA operations in the same transaction. Otherwise, use a LazyConnectionDataSourceProxy to ensure that the cost of connection acquisition is near zero until code actually needs a JDBC Connection.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller
See Also:
setLazyDatabaseTransaction(boolean), LazyConnectionDataSourceProxy, Serialized Form

Constructor Summary
TopLinkJpaDialect()
Method Summary
Object | beginTransaction(javax.persistence.EntityManager entityManager, TransactionDefinition definition) This implementation invokes the standard JPA Transaction.begin method.
ConnectionHandle | getJdbcConnection(javax.persistence.EntityManager em, boolean readOnly) This implementation always returns null, indicating that no JDBC Connection can be provided.
protected oracle.toplink.essentials.sessions.Session | getSession(javax.persistence.EntityManager em) Get a traditional TopLink Session from the given EntityManager.
void | setLazyDatabaseTransaction(boolean lazyDatabaseTransaction) Set whether to lazily start a database transaction within a TopLink transaction.
Methods inherited from class org.springframework.orm.jpa.DefaultJpaDialect
cleanupTransaction, getEntityManagerFactoryPlusOperations, getEntityManagerPlusOperations, prepareTransaction, releaseJdbcConnection, supportsEntityManagerFactoryPlusOperations, supportsEntityManagerPlusOperations, translateExceptionIfPossible
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TopLinkJpaDialect

public TopLinkJpaDialect()
Method Detail

setLazyDatabaseTransaction

public void setLazyDatabaseTransaction(boolean lazyDatabaseTransaction)
Set whether to lazily start a database transaction within a TopLink transaction.

By default, database transactions are started early. This allows for reusing the same JDBC Connection throughout an entire transaction, including read operations, and also for exposing TopLink transactions to JDBC access code (working on the same DataSource).

It is only recommended to switch this flag to "true" when no JDBC access code is involved in any of the transactions, and when it is acceptable to perform read operations outside of the transactional JDBC Connection.

See Also:
oracle.toplink.sessions.UnitOfWork#beginEarlyTransaction()

beginTransaction

public Object beginTransaction(javax.persistence.EntityManager entityManager,
                               TransactionDefinition definition)
                        throws javax.persistence.PersistenceException,
                               SQLException,
                               TransactionException
Description copied from class: DefaultJpaDialect
This implementation invokes the standard JPA Transaction.begin method. Throws an InvalidIsolationLevelException if a non-default isolation level is set.

This implementation does not return any transaction data Object, since there is no state to be kept for a standard JPA transaction. Hence, subclasses do not have to care about the return value (null) of this implementation and are free to return their own transaction data Object.

Specified by:
beginTransaction in interface JpaDialect
Overrides:
beginTransaction in class DefaultJpaDialect
Parameters:
entityManager - the EntityManager to begin a JPA transaction on
definition - the Spring transaction definition that defines semantics
Returns:
an arbitrary object that holds transaction data, if any (to be passed into JpaDialect.cleanupTransaction(java.lang.Object)). May implement the SavepointManager interface.
Throws:
javax.persistence.PersistenceException - if thrown by JPA methods
SQLException - if thrown by JDBC methods
TransactionException - in case of invalid arguments
See Also:
EntityTransaction.begin(), InvalidIsolationLevelException, DefaultJpaDialect.cleanupTransaction(java.lang.Object)

getJdbcConnection

public ConnectionHandle getJdbcConnection(javax.persistence.EntityManager em,
                                          boolean readOnly)
                                   throws javax.persistence.PersistenceException,
                                          SQLException
Description copied from class: DefaultJpaDialect
This implementation always returns null, indicating that no JDBC Connection can be provided.

Specified by:
getJdbcConnection in interface JpaDialect
Overrides:
getJdbcConnection in class DefaultJpaDialect
Parameters:
em - the current JPA EntityManager
readOnly - whether the Connection is only needed for read-only purposes
Returns:
a handle for the JDBC Connection, to be passed into releaseJdbcConnection, or null if no JDBC Connection can be retrieved
Throws:
javax.persistence.PersistenceException - if thrown by JPA methods
SQLException - if thrown by JDBC methods
See Also:
JpaDialect.releaseJdbcConnection(org.springframework.jdbc.datasource.ConnectionHandle, javax.persistence.EntityManager), ConnectionHandle.getConnection(), SimpleConnectionHandle, JpaTransactionManager.setDataSource(javax.sql.DataSource), NativeJdbcExtractor

getSession

protected oracle.toplink.essentials.sessions.Session getSession(javax.persistence.EntityManager em)
Get a traditional TopLink Session from the given EntityManager.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TopLinkJpaVendorAdapter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.orm.jpa.vendor
Class TopLinkJpaVendorAdapter

java.lang.Object
    extended by  org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter
        extended by  org.springframework.orm.jpa.vendor.TopLinkJpaVendorAdapter
All Implemented Interfaces:
JpaVendorAdapter
public class TopLinkJpaVendorAdapter
extends AbstractJpaVendorAdapter

JpaVendorAdapter implementation for Oracle TopLink Essentials. Developed and tested against TopLink Essentials v2.

Exposes TopLink's persistence provider and EntityManager extension interface, and supports AbstractJpaVendorAdapter's common configuration settings.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller
See Also:
EntityManagerFactoryProvider, EntityManager

Constructor Summary
TopLinkJpaVendorAdapter()
Method Summary
protected String | determineTargetDatabaseName(Database database) Determine the TopLink target database name for the given database.
Class<? extends javax.persistence.EntityManager> | getEntityManagerInterface() Return the vendor-specific EntityManager interface that this provider's EntityManagers will implement.
JpaDialect | getJpaDialect() Return the vendor-specific JpaDialect implementation for this provider, or null if there is none.
Map<String,Object> | getJpaPropertyMap() Return a Map of vendor-specific JPA properties, typically based on settings in this JpaVendorAdapter instance.
javax.persistence.spi.PersistenceProvider | getPersistenceProvider() Return the vendor-specific persistence provider.
String | getPersistenceProviderRootPackage() Return the name of the persistence provider's root package (e.g.
Methods inherited from class org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter
getDatabase, getDatabasePlatform, getEntityManagerFactoryInterface, isGenerateDdl, isShowSql, postProcessEntityManagerFactory, setDatabase, setDatabasePlatform, setGenerateDdl, setShowSql
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TopLinkJpaVendorAdapter

public TopLinkJpaVendorAdapter()
Method Detail

getPersistenceProvider

public javax.persistence.spi.PersistenceProvider getPersistenceProvider()
Description copied from interface: JpaVendorAdapter
Return the vendor-specific persistence provider.

getPersistenceProviderRootPackage

public String getPersistenceProviderRootPackage()
Description copied from interface: JpaVendorAdapter
Return the name of the persistence provider's root package (e.g. "oracle.toplink.essentials"). Will be used for excluding provider classes from temporary class overriding.

Specified by:
getPersistenceProviderRootPackage in interface JpaVendorAdapter
Overrides:
getPersistenceProviderRootPackage in class AbstractJpaVendorAdapter

getJpaPropertyMap

public Map<String,Object> getJpaPropertyMap()
Description copied from interface: JpaVendorAdapter
Return a Map of vendor-specific JPA properties, typically based on settings in this JpaVendorAdapter instance.

Note that there might be further JPA properties defined on the EntityManagerFactory bean, which might potentially override individual JPA property values specified here.

Specified by:
getJpaPropertyMap in interface JpaVendorAdapter
Overrides:
getJpaPropertyMap in class AbstractJpaVendorAdapter
Returns:
a Map of JPA properties, as as accepted by the standard JPA bootstrap facilities, or null or an empty Map if there are no such properties to expose
See Also:
Persistence.createEntityManagerFactory(String, java.util.Map), PersistenceProvider.createContainerEntityManagerFactory(javax.persistence.spi.PersistenceUnitInfo, java.util.Map)

determineTargetDatabaseName

protected String determineTargetDatabaseName(Database database)
Determine the TopLink target database name for the given database.

Parameters:
database - the specified database
Returns:
the TopLink target database name, or null if none found

getJpaDialect

public JpaDialect getJpaDialect()
Description copied from interface: JpaVendorAdapter
Return the vendor-specific JpaDialect implementation for this provider, or null if there is none.

Specified by:
getJpaDialect in interface JpaVendorAdapter
Overrides:
getJpaDialect in class AbstractJpaVendorAdapter

getEntityManagerInterface

public Class<? extends javax.persistence.EntityManager> getEntityManagerInterface()
Description copied from interface: JpaVendorAdapter
Return the vendor-specific EntityManager interface that this provider's EntityManagers will implement.

If the provider does not offer any EntityManager extensions, the adapter should simply return the standard EntityManager class here.

Specified by:
getEntityManagerInterface in interface JpaVendorAdapter
Overrides:
getEntityManagerInterface in class AbstractJpaVendorAdapter
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS | FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


Database

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

org.springframework.orm.jpa.vendor
Enum Database

java.lang.Object
    extended by  java.lang.Enum<Database>
        extended by  org.springframework.orm.jpa.vendor.Database
All Implemented Interfaces:
Serializable, Comparable<Database>
public enum Database
extends Enum<Database>

Enumeration for common database platforms. Allows strong typing of database type and portable configuration between JpaVendorDialect implementations.

If a given PersistenceProvider supports a database not listed here, the strategy class can still be specified using the fully-qualified class name. This enumeration is merely a convenience. The database products listed here are the same as those explicitly supported for Spring JDBC exception translation in sql-error-codes.xml.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller
See Also:
AbstractJpaVendorAdapter.setDatabase(org.springframework.orm.jpa.vendor.Database)

Enum Constant Summary
DB2
DEFAULT
DERBY
H2
HSQL
INFORMIX
MYSQL
ORACLE
POSTGRESQL
SQL_SERVER
SYBASE
Method Summary
static Database | valueOf(String name) Returns the enum constant of this type with the specified name.
static Database[] | values() Returns an array containing the constants of this enum type, in the order they are declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

DEFAULT

public static final Database DEFAULT

DB2

public static final Database DB2

DERBY

public static final Database DERBY

H2

public static final Database H2

HSQL

public static final Database HSQL

INFORMIX

public static final Database INFORMIX

MYSQL

public static final Database MYSQL

ORACLE

public static final Database ORACLE

POSTGRESQL

public static final Database POSTGRESQL

SQL_SERVER

public static final Database SQL_SERVER

SYBASE

public static final Database SYBASE
Method Detail

values

public static Database[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Database c : Database.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Database valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


org.springframework.oxm

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.oxm

Root package for Spring's O/X Mapping integration classes.

See:
Description

Interface Summary
GenericMarshaller | Subinterface of Marshaller that has support for Java 5 generics.
GenericUnmarshaller | Subinterface of Unmarshaller that has support for Java 5 generics.
Marshaller | Defines the contract for Object XML Mapping Marshallers.
Unmarshaller | Defines the contract for Object XML Mapping unmarshallers.

Exception Summary
MarshallingException | Base class for exception thrown when a marshalling or unmarshalling error occurs.
MarshallingFailureException | Exception thrown on marshalling failure.
UncategorizedMappingException | Exception that indicates that the cause cannot be distinguished further.
UnmarshallingFailureException | Exception thrown on unmarshalling failure.
ValidationFailureException | Exception thrown on marshalling validation failure.
XmlMappingException | Root of the hierarchy of Object XML Mapping exceptions.

Package org.springframework.oxm Description

Root package for Spring's O/X Mapping integration classes. Contains generic Marshaller and Unmarshaller interfaces, and XmlMappingExceptions related to O/X Mapping


org.springframework.oxm Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.oxm

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.oxm.XmlMappingException
              • org.springframework.oxm.MarshallingException
                • org.springframework.oxm.MarshallingFailureException
                • org.springframework.oxm.UnmarshallingFailureException
              • org.springframework.oxm.UncategorizedMappingException
              • org.springframework.oxm.ValidationFailureException

Interface Hierarchy

  • org.springframework.oxm.Marshaller
    • org.springframework.oxm.GenericMarshaller
  • org.springframework.oxm.Unmarshaller
    • org.springframework.oxm.GenericUnmarshaller


GenericMarshaller

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.oxm
Interface GenericMarshaller

All Superinterfaces:
Marshaller
All Known Implementing Classes:
Jaxb2Marshaller
public interface GenericMarshaller
extends Marshaller

Subinterface of Marshaller that has support for Java 5 generics.

Author:
Arjen Poutsma

Method Summary
 boolean supports(Type genericType)
Indicates whether this marshaller can marshal instances of the supplied generic type.
Methods inherited from interface org.springframework.oxm.Marshaller
marshal, supports

Method Detail

supports

boolean supports(Type genericType)
Indicates whether this marshaller can marshal instances of the supplied generic type.

Parameters:
genericType - the type that this marshaller is being asked if it can marshal
Returns:
true if this marshaller can indeed marshal instances of the supplied type; false otherwise
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


GenericUnmarshaller

org.springframework.oxm
Interface GenericUnmarshaller

All Superinterfaces:
Unmarshaller
All Known Implementing Classes:
Jaxb2Marshaller
public interface GenericUnmarshaller
extends Unmarshaller

Subinterface of Unmarshaller that has support for Java 5 generics.

Author:
Arjen Poutsma

Method Summary
 boolean supports(Type genericType)
Indicates whether this marshaller can marshal instances of the supplied generic type.
Methods inherited from interface org.springframework.oxm.Unmarshaller
supports, unmarshal

Method Detail

supports

boolean supports(Type genericType)
Indicates whether this marshaller can marshal instances of the supplied generic type.

Parameters:
genericType - the type that this marshaller is being asked if it can marshal
Returns:
true if this marshaller can indeed marshal instances of the supplied type; false otherwise
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Marshaller

org.springframework.oxm
Interface Marshaller

All Known Subinterfaces:
GenericMarshaller, MimeMarshaller
All Known Implementing Classes:
AbstractMarshaller, CastorMarshaller, Jaxb2Marshaller, JibxMarshaller, XmlBeansMarshaller, XStreamMarshaller
public interface Marshaller

Defines the contract for Object XML Mapping Marshallers. Implementations of this interface can serialize a given Object to an XML Stream.

Although the marshal method accepts a java.lang.Object as its first parameter, most Marshaller implementations cannot handle arbitrary Objects. Instead, a object class must be registered with the marshaller, or have a common base class.

Since:
3.0
Author:
Arjen Poutsma
See Also:
Unmarshaller

Method Summary
void | marshal(Object graph, Result result) Marshals the object graph with the given root into the provided Result.
boolean | supports(Class<?> clazz) Indicates whether this marshaller can marshal instances of the supplied type.

Method Detail

supports

boolean supports(Class<?> clazz)
Indicates whether this marshaller can marshal instances of the supplied type.

Parameters:
clazz - the class that this marshaller is being asked if it can marshal
Returns:
true if this marshaller can indeed marshal instances of the supplied class; false otherwise

marshal

void marshal(Object graph,
             Result result)
             throws IOException,
                    XmlMappingException
Marshals the object graph with the given root into the provided Result.

Parameters:
graph - the root of the object graph to marshal
result - the result to marshal to
Throws:
IOException - if an I/O error occurs
XmlMappingException - if the given object cannot be marshalled to the result
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Unmarshaller

org.springframework.oxm
Interface Unmarshaller

All Known Subinterfaces:
GenericUnmarshaller, MimeUnmarshaller
All Known Implementing Classes:
AbstractMarshaller, CastorMarshaller, Jaxb2Marshaller, JibxMarshaller, XmlBeansMarshaller, XStreamMarshaller
public interface Unmarshaller

Defines the contract for Object XML Mapping unmarshallers. Implementations of this interface can deserialize a given XML Stream to an Object graph.

Since:
3.0
Author:
Arjen Poutsma
See Also:
Marshaller

Method Summary
boolean | supports(Class<?> clazz) Indicates whether this unmarshaller can unmarshal instances of the supplied type.
Object | unmarshal(Source source) Unmarshals the given Source into an object graph.

Method Detail

supports

boolean supports(Class<?> clazz)
Indicates whether this unmarshaller can unmarshal instances of the supplied type.

Parameters:
clazz - the class that this unmarshaller is being asked if it can marshal
Returns:
true if this unmarshaller can indeed unmarshal to the supplied class; false otherwise

unmarshal

Object unmarshal(Source source)
                 throws IOException,
                        XmlMappingException
Unmarshals the given Source into an object graph.

Parameters:
source - the source to marshal from
Returns:
the object graph
Throws:
IOException - if an I/O error occurs
XmlMappingException - if the given source cannot be mapped to an object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MarshallingException

org.springframework.oxm
Class MarshallingException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.oxm.XmlMappingException
                        extended by  org.springframework.oxm.MarshallingException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
MarshallingFailureException, UnmarshallingFailureException
public abstract class MarshallingException
extends XmlMappingException

Base class for exception thrown when a marshalling or unmarshalling error occurs.

Since:
3.0
Author:
Arjen Poutsma, Juergen Hoeller
See Also:
MarshallingFailureException, UnmarshallingFailureException, Serialized Form

Constructor Summary
protected | MarshallingException(String msg) Construct a MarshallingException with the specified detail message.
protected | MarshallingException(String msg, Throwable cause) Construct a MarshallingException with the specified detail message and nested exception.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

MarshallingException

protected MarshallingException(String msg)
Construct a MarshallingException with the specified detail message.

Parameters:
msg - the detail message

MarshallingException

protected MarshallingException(String msg,
                               Throwable cause)
Construct a MarshallingException with the specified detail message and nested exception.

Parameters:
msg - the detail message
cause - the nested exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MarshallingFailureException

org.springframework.oxm
Class MarshallingFailureException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.oxm.XmlMappingException
                        extended by  org.springframework.oxm.MarshallingException
                            extended by  org.springframework.oxm.MarshallingFailureException
All Implemented Interfaces:
Serializable
public class MarshallingFailureException
extends MarshallingException

Exception thrown on marshalling failure.

Since:
3.0
Author:
Arjen Poutsma
See Also:
Serialized Form

Constructor Summary
MarshallingFailureException(String msg)
Construct a MarshallingFailureException with the specified detail message.
MarshallingFailureException(String msg, Throwable cause)
Construct a MarshallingFailureException with the specified detail message and nested exception.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

MarshallingFailureException

public MarshallingFailureException(String msg)
Construct a MarshallingFailureException with the specified detail message.

Parameters:
msg - the detail message

MarshallingFailureException

public MarshallingFailureException(String msg,
                                   Throwable cause)
Construct a MarshallingFailureException with the specified detail message and nested exception.

Parameters:
msg - the detail message
cause - the nested exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UncategorizedMappingException

org.springframework.oxm
Class UncategorizedMappingException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.oxm.XmlMappingException
                        extended by  org.springframework.oxm.UncategorizedMappingException
All Implemented Interfaces:
Serializable
public class UncategorizedMappingException
extends XmlMappingException

Exception that indicates that the cause cannot be distinguished further.

Since:
3.0
Author:
Arjen Poutsma
See Also:
Serialized Form

Constructor Summary
UncategorizedMappingException(String msg, Throwable cause)
Construct an UncategorizedMappingException with the specified detail message and nested exception.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

UncategorizedMappingException

public UncategorizedMappingException(String msg,
                                     Throwable cause)
Construct an UncategorizedMappingException with the specified detail message and nested exception.

Parameters:
msg - the detail message
cause - the nested exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UnmarshallingFailureException

org.springframework.oxm
Class UnmarshallingFailureException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.oxm.XmlMappingException
                        extended by  org.springframework.oxm.MarshallingException
                            extended by  org.springframework.oxm.UnmarshallingFailureException
All Implemented Interfaces:
Serializable
public class UnmarshallingFailureException
extends MarshallingException

Exception thrown on unmarshalling failure.

Since:
3.0
Author:
Arjen Poutsma
See Also:
Serialized Form

Constructor Summary
UnmarshallingFailureException(String msg)
Construct a MarshallingFailureException with the specified detail message.
UnmarshallingFailureException(String msg, Throwable cause)
Construct a MarshallingFailureException with the specified detail message and nested exception.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

UnmarshallingFailureException

public UnmarshallingFailureException(String msg)
Construct a MarshallingFailureException with the specified detail message.

Parameters:
msg - the detail message

UnmarshallingFailureException

public UnmarshallingFailureException(String msg,
                                     Throwable cause)
Construct a MarshallingFailureException with the specified detail message and nested exception.

Parameters:
msg - the detail message
cause - the nested exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ValidationFailureException

org.springframework.oxm
Class ValidationFailureException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.oxm.XmlMappingException
                        extended by  org.springframework.oxm.ValidationFailureException
All Implemented Interfaces:
Serializable
public class ValidationFailureException
extends XmlMappingException

Exception thrown on marshalling validation failure.

Since:
3.0
Author:
Arjen Poutsma
See Also:
Serialized Form

Constructor Summary
ValidationFailureException(String msg)
Construct a ValidationFailureException with the specified detail message.
ValidationFailureException(String msg, Throwable cause)
Construct a ValidationFailureException with the specified detail message and nested exception.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ValidationFailureException

public ValidationFailureException(String msg)
Construct a ValidationFailureException with the specified detail message.

Parameters:
msg - the detail message

ValidationFailureException

public ValidationFailureException(String msg,
                                  Throwable cause)
Construct a ValidationFailureException with the specified detail message and nested exception.

Parameters:
msg - the detail message
cause - the nested exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XmlMappingException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.oxm
Class XmlMappingException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.oxm.XmlMappingException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CastorMappingException, MarshallingException, UncategorizedMappingException, ValidationFailureException
public abstract class XmlMappingException
extends NestedRuntimeException

Root of the hierarchy of Object XML Mapping exceptions.

Since:
3.0
Author:
Arjen Poutsma
See Also:
Serialized Form

Constructor Summary
XmlMappingException(String msg)
Construct an XmlMappingException with the specified detail message.
XmlMappingException(String msg, Throwable cause)
Construct an XmlMappingException with the specified detail message and nested exception.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

XmlMappingException

public XmlMappingException(String msg)
Construct an XmlMappingException with the specified detail message.

Parameters:
msg - the detail message

XmlMappingException

public XmlMappingException(String msg,
                           Throwable cause)
Construct an XmlMappingException with the specified detail message and nested exception.

Parameters:
msg - the detail message
cause - the nested exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.oxm.castor

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.oxm.castor

Package providing integration of Castor within Springs O/X Mapping support

See:
Description

Class Summary
CastorMarshaller Implementation of the Marshaller interface for Castor.

Exception Summary
CastorMappingException Exception thrown by CastorMarshaller whenever it encounters a mapping problem.

Package org.springframework.oxm.castor Description

Package providing integration of Castor within Springs O/X Mapping support


org.springframework.oxm.castor Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.oxm.castor

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.oxm.support.AbstractMarshaller (implements org.springframework.oxm.Marshaller, org.springframework.oxm.Unmarshaller)
      • org.springframework.oxm.castor.CastorMarshaller (implements org.springframework.beans.factory.InitializingBean)
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.oxm.XmlMappingException
              • org.springframework.oxm.castor.CastorMappingException


CastorMarshaller

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.oxm.castor
Class CastorMarshaller

java.lang.Object
    extended by  org.springframework.oxm.support.AbstractMarshaller
        extended by  org.springframework.oxm.castor.CastorMarshaller
All Implemented Interfaces:
InitializingBean, Marshaller, Unmarshaller
public class CastorMarshaller
extends AbstractMarshaller
implements InitializingBean

Implementation of the Marshaller interface for Castor. By default, Castor does not require any further configuration, though setting target classes, target packages or providing a mapping file can be used to have more control over the behavior of Castor.

If a target class is specified using setTargetClass, the CastorMarshaller can only be used to unmarshall XML that represents that specific class. If you want to unmarshall multiple classes, you have to provide a mapping file using setMappingLocations.

Due to limitations of Castor's API, it is required to set the encoding used for writing to output streams. It defaults to UTF-8.

Since:
3.0
Author:
Arjen Poutsma
See Also:
setEncoding(String), setTargetClass(Class), setTargetPackages(String[]), setMappingLocation(Resource), setMappingLocations(Resource[])

Field Summary
static String DEFAULT_ENCODING
The default encoding used for stream access: UTF-8.
Fields inherited from class org.springframework.oxm.support.AbstractMarshaller
logger
Constructor Summary
CastorMarshaller()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected XmlMappingException | convertCastorException(org.exolab.castor.xml.XMLException ex, boolean marshalling) Convert the given XMLException to an appropriate exception from the org.springframework.oxm hierarchy.
protected org.exolab.castor.xml.XMLContext | createXMLContext(Resource[] mappingLocations, Class[] targetClasses, String[] targetPackages) Create the Castor XMLContext.
protected void | customizeMarshaller(org.exolab.castor.xml.Marshaller marshaller) Template method that allows for customizing of the given Castor Marshaller.
protected void | customizeUnmarshaller(org.exolab.castor.xml.Unmarshaller unmarshaller) Template method that allows for customizing of the given Castor Unmarshaller.
boolean | isSuppressNamespaces() Returns whether this marshaller should output namespaces.
boolean | isSuppressXsiType() Sets whether this marshaller should output the xsi:type attribute.
protected void | marshalDomNode(Object graph, Node node) Abstract template method for marshalling the given object graph to a DOM Node.
protected void | marshalOutputStream(Object graph, OutputStream outputStream) Abstract template method for marshalling the given object graph to a OutputStream.
protected void | marshalSaxHandlers(Object graph, ContentHandler contentHandler, LexicalHandler lexicalHandler) Abstract template method for marshalling the given object graph to a SAX ContentHandler.
protected void | marshalWriter(Object graph, Writer writer) Abstract template method for marshalling the given object graph to a Writer.
protected void | marshalXmlEventWriter(Object graph, XMLEventWriter eventWriter) Abstract template method for marshalling the given object to a StAX XMLEventWriter.
protected void | marshalXmlStreamWriter(Object graph, XMLStreamWriter streamWriter) Abstract template method for marshalling the given object to a StAX XMLStreamWriter.
void | setEncoding(String encoding) Set the encoding to be used for stream access.
void | setIgnoreExtraAttributes(boolean ignoreExtraAttributes) Set whether the Castor Unmarshaller should ignore attributes that do not match a specific field.
void | setIgnoreExtraElements(boolean ignoreExtraElements) Set whether the Castor Unmarshaller should ignore elements that do not match a specific field.
void | setMappingLocation(Resource mappingLocation) Set the locations of the Castor XML Mapping files.
void | setMappingLocations(Resource[] mappingLocations) Set the locations of the Castor XML Mapping files.
void | setNamespaceMappings(Map<String,String> namespaceMappings) Set the namespace mappings.
void | setSuppressNamespaces(boolean suppressNamespaces) Sets whether this marshaller should output namespaces.
void | setSuppressXsiType(boolean suppressXsiType) Sets whether this marshaller should output the xsi:type attribute.
void | setTargetClass(Class targetClass) Set the Castor target class.
void | setTargetClasses(Class[] targetClasses) Set the Castor target classes.
void | setTargetPackages(String[] targetPackages) Set the package names of packages with the Castor descriptor classes.
void | setValidating(boolean validating) Set whether this marshaller should validate in- and outgoing documents.
void | setWhitespacePreserve(boolean whitespacePreserve) Set whether the Castor Unmarshaller should preserve "ignorable" whitespace.
boolean | supports(Class<?> clazz) Returns true for all classes, i.e.
protected Object | unmarshalDomNode(Node node) Abstract template method for unmarshalling from a given DOM Node.
protected Object | unmarshalInputStream(InputStream inputStream) Abstract template method for unmarshalling from a given InputStream.
protected Object | unmarshalReader(Reader reader) Abstract template method for unmarshalling from a given Reader.
protected Object | unmarshalSaxReader(XMLReader xmlReader, InputSource inputSource) Abstract template method for unmarshalling using a given SAX XMLReader and InputSource.
protected Object | unmarshalXmlEventReader(XMLEventReader eventReader) Abstract template method for unmarshalling from a given Stax XMLEventReader.
protected Object | unmarshalXmlStreamReader(XMLStreamReader streamReader) Abstract template method for unmarshalling from a given Stax XMLStreamReader.
Methods inherited from class org.springframework.oxm.support.AbstractMarshaller
createDocumentBuilder, createDocumentBuilderFactory, createXmlReader, marshal, marshalDomResult, marshalSaxResult, marshalStaxResult, marshalStreamResult, unmarshal, unmarshalDomSource, unmarshalSaxSource, unmarshalStaxSource, unmarshalStreamSource
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_ENCODING

public static final String DEFAULT_ENCODING
The default encoding used for stream access: UTF-8.

See Also:
Constant Field Values
Constructor Detail

CastorMarshaller

public CastorMarshaller()
Method Detail

setEncoding

public void setEncoding(String encoding)
Set the encoding to be used for stream access.

See Also:
DEFAULT_ENCODING

setMappingLocation

public void setMappingLocation(Resource mappingLocation)
Set the locations of the Castor XML Mapping files.

setMappingLocations

public void setMappingLocations(Resource[] mappingLocations)
Set the locations of the Castor XML Mapping files.

setTargetClass

public void setTargetClass(Class targetClass)
Set the Castor target class. Alternative means of configuring CastorMarshaller for unmarshalling multiple classes include use of mapping files, and specifying packages with Castor descriptor classes.

setTargetClasses

public void setTargetClasses(Class[] targetClasses)
Set the Castor target classes. Alternative means of configuring CastorMarshaller for unmarshalling multiple classes include use of mapping files, and specifying packages with Castor descriptor classes.

setTargetPackages

public void setTargetPackages(String[] targetPackages)
Set the package names of packages with the Castor descriptor classes.

setValidating

public void setValidating(boolean validating)
Set whether this marshaller should validate in- and outgoing documents.

Default is false.

See Also:
Marshaller.setValidation(boolean)

setWhitespacePreserve

public void setWhitespacePreserve(boolean whitespacePreserve)
Set whether the Castor Unmarshaller should preserve "ignorable" whitespace.

Default is false.

See Also:
Unmarshaller.setWhitespacePreserve(boolean)

setIgnoreExtraAttributes

public void setIgnoreExtraAttributes(boolean ignoreExtraAttributes)
Set whether the Castor Unmarshaller should ignore attributes that do not match a specific field.

Default is true: extra attributes are ignored.

See Also:
Unmarshaller.setIgnoreExtraAttributes(boolean)

setIgnoreExtraElements

public void setIgnoreExtraElements(boolean ignoreExtraElements)
Set whether the Castor Unmarshaller should ignore elements that do not match a specific field.

Default is false, extra attributes are flagged as an error.

See Also:
Unmarshaller.setIgnoreExtraElements(boolean)

setNamespaceMappings

public void setNamespaceMappings(Map<String,String> namespaceMappings)
Set the namespace mappings. Property names are interpreted as namespace prefixes; values are namespace URIs.

See Also:
Marshaller.setNamespaceMapping(String, String)

isSuppressNamespaces

public boolean isSuppressNamespaces()
Returns whether this marshaller should output namespaces.

setSuppressNamespaces

public void setSuppressNamespaces(boolean suppressNamespaces)
Sets whether this marshaller should output namespaces. The default is false, i.e. namespaces are written.

See Also:
Marshaller.setSuppressNamespaces(boolean)

isSuppressXsiType

public boolean isSuppressXsiType()
Sets whether this marshaller should output the xsi:type attribute.

setSuppressXsiType

public void setSuppressXsiType(boolean suppressXsiType)
Sets whether this marshaller should output the xsi:type attribute. The default is false, i.e. the xsi:type is written.

See Also:
Marshaller.setSuppressXSIType(boolean)

afterPropertiesSet

public final void afterPropertiesSet()
                              throws CastorMappingException,
                                     IOException
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
CastorMappingException
IOException

createXMLContext

protected org.exolab.castor.xml.XMLContext createXMLContext(Resource[] mappingLocations,
                                                            Class[] targetClasses,
                                                            String[] targetPackages)
                                                     throws org.exolab.castor.mapping.MappingException,
                                                            org.exolab.castor.xml.ResolverException,
                                                            IOException
Create the Castor XMLContext. Subclasses can override this to create a custom context.

The default implementation loads mapping files if defined, or the target class or packages if defined.

Returns:
the created resolver
Throws:
org.exolab.castor.mapping.MappingException - when the mapping file cannot be loaded
IOException - in case of I/O errors
org.exolab.castor.xml.ResolverException
See Also:
XMLContext.addMapping(org.exolab.castor.mapping.Mapping), XMLContext.addClass(Class)

supports

public boolean supports(Class<?> clazz)
Returns true for all classes, i.e. Castor supports arbitrary classes.

Specified by:
supports in interface Marshaller
Specified by:
supports in interface Unmarshaller
Parameters:
clazz - the class that this marshaller is being asked if it can marshal
Returns:
true if this marshaller can indeed marshal instances of the supplied class; false otherwise

marshalDomNode

protected final void marshalDomNode(Object graph,
                                    Node node)
                             throws XmlMappingException
Description copied from class: AbstractMarshaller
Abstract template method for marshalling the given object graph to a DOM Node.

In practice, node is be a Document node, a DocumentFragment node, or a Element node. In other words, a node that accepts children.

Specified by:
marshalDomNode in class AbstractMarshaller
Parameters:
graph - the root of the object graph to marshal
node - the DOM node that will contain the result tree
Throws:
XmlMappingException - if the given object cannot be marshalled to the DOM node
See Also:
Document, DocumentFragment, Element

marshalSaxHandlers

protected final void marshalSaxHandlers(Object graph,
                                        ContentHandler contentHandler,
                                        LexicalHandler lexicalHandler)
                                 throws XmlMappingException
Description copied from class: AbstractMarshaller
Abstract template method for marshalling the given object graph to a SAX ContentHandler.

Specified by:
marshalSaxHandlers in class AbstractMarshaller
Parameters:
graph - the root of the object graph to marshal
contentHandler - the SAX ContentHandler
lexicalHandler - the SAX2 LexicalHandler. Can be null.
Throws:
XmlMappingException - if the given object cannot be marshalled to the handlers

marshalOutputStream

protected final void marshalOutputStream(Object graph,
                                         OutputStream outputStream)
                                  throws XmlMappingException,
                                         IOException
Description copied from class: AbstractMarshaller
Abstract template method for marshalling the given object graph to a OutputStream.

Specified by:
marshalOutputStream in class AbstractMarshaller
Parameters:
graph - the root of the object graph to marshal
outputStream - the OutputStream to write to
Throws:
XmlMappingException - if the given object cannot be marshalled to the writer
IOException - if an I/O exception occurs

marshalWriter

protected final void marshalWriter(Object graph,
                                   Writer writer)
                            throws XmlMappingException,
                                   IOException
Description copied from class: AbstractMarshaller
Abstract template method for marshalling the given object graph to a Writer.

Specified by:
marshalWriter in class AbstractMarshaller
Parameters:
graph - the root of the object graph to marshal
writer - the Writer to write to
Throws:
XmlMappingException - if the given object cannot be marshalled to the writer
IOException - if an I/O exception occurs

marshalXmlEventWriter

protected final void marshalXmlEventWriter(Object graph,
                                           XMLEventWriter eventWriter)
                                    throws XmlMappingException
Description copied from class: AbstractMarshaller
Abstract template method for marshalling the given object to a StAX XMLEventWriter.

Specified by:
marshalXmlEventWriter in class AbstractMarshaller
Parameters:
graph - the root of the object graph to marshal
eventWriter - the XMLEventWriter to write to
Throws:
XmlMappingException - if the given object cannot be marshalled to the DOM node

marshalXmlStreamWriter

protected final void marshalXmlStreamWriter(Object graph,
                                            XMLStreamWriter streamWriter)
                                     throws XmlMappingException
Description copied from class: AbstractMarshaller
Abstract template method for marshalling the given object to a StAX XMLStreamWriter.

Specified by:
marshalXmlStreamWriter in class AbstractMarshaller
Parameters:
graph - the root of the object graph to marshal
streamWriter - the XMLStreamWriter to write to
Throws:
XmlMappingException - if the given object cannot be marshalled to the DOM node

customizeMarshaller

protected void customizeMarshaller(org.exolab.castor.xml.Marshaller marshaller)
Template method that allows for customizing of the given Castor Marshaller.

The default implementation invokes Marshaller.setValidation(boolean) with the property set on this marshaller, and calls Marshaller.setNamespaceMapping(String, String) with the namespace mappings.

unmarshalDomNode

protected final Object unmarshalDomNode(Node node)
                                 throws XmlMappingException
Description copied from class: AbstractMarshaller
Abstract template method for unmarshalling from a given DOM Node.

Specified by:
unmarshalDomNode in class AbstractMarshaller
Parameters:
node - the DOM node that contains the objects to be unmarshalled
Returns:
the object graph
Throws:
XmlMappingException - if the given DOM node cannot be mapped to an object

unmarshalInputStream

protected final Object unmarshalInputStream(InputStream inputStream)
                                     throws XmlMappingException,
                                            IOException
Description copied from class: AbstractMarshaller
Abstract template method for unmarshalling from a given InputStream.

Specified by:
unmarshalInputStream in class AbstractMarshaller
Parameters:
inputStream - the InputStreamStream to read from
Returns:
the object graph
Throws:
XmlMappingException - if the given stream cannot be converted to an object
IOException - if an I/O exception occurs

unmarshalReader

protected final Object unmarshalReader(Reader reader)
                                throws XmlMappingException,
                                       IOException
Description copied from class: AbstractMarshaller
Abstract template method for unmarshalling from a given Reader.

Specified by:
unmarshalReader in class AbstractMarshaller
Parameters:
reader - the Reader to read from
Returns:
the object graph
Throws:
XmlMappingException - if the given reader cannot be converted to an object
IOException - if an I/O exception occurs

unmarshalXmlEventReader

protected final Object unmarshalXmlEventReader(XMLEventReader eventReader)
Description copied from class: AbstractMarshaller
Abstract template method for unmarshalling from a given Stax XMLEventReader.

Specified by:
unmarshalXmlEventReader in class AbstractMarshaller
Parameters:
eventReader - the XMLEventReader to read from
Returns:
the object graph

unmarshalSaxReader

protected final Object unmarshalSaxReader(XMLReader xmlReader,
                                          InputSource inputSource)
                                   throws XmlMappingException,
                                          IOException
Description copied from class: AbstractMarshaller
Abstract template method for unmarshalling using a given SAX XMLReader and InputSource.

Specified by:
unmarshalSaxReader in class AbstractMarshaller
Parameters:
xmlReader - the SAX XMLReader to parse with
inputSource - the input source to parse from
Returns:
the object graph
Throws:
XmlMappingException - if the given reader and input source cannot be converted to an object
IOException - if an I/O exception occurs

unmarshalXmlStreamReader

protected final Object unmarshalXmlStreamReader(XMLStreamReader streamReader)
Description copied from class: AbstractMarshaller
Abstract template method for unmarshalling from a given Stax XMLStreamReader.

Specified by:
unmarshalXmlStreamReader in class AbstractMarshaller
Parameters:
streamReader - the XMLStreamReader to read from
Returns:
the object graph

customizeUnmarshaller

protected void customizeUnmarshaller(org.exolab.castor.xml.Unmarshaller unmarshaller)
Template method that allows for customizing of the given Castor Unmarshaller.

The default implementation invokes
Unmarshaller.setValidation(boolean),
Unmarshaller.setWhitespacePreserve(boolean),
Unmarshaller.setIgnoreExtraAttributes(boolean), and
Unmarshaller.setIgnoreExtraElements(boolean) with the properties
set on this marshaller.

convertCastorException

protected XmlMappingException convertCastorException(org.exolab.castor.xml.XMLException ex,
                                                     boolean marshalling)
Convert the given XMLException to an appropriate exception from the org.springframework.oxm hierarchy.

A boolean flag is used to indicate whether this exception occurs during marshalling or unmarshalling, since Castor itself does not make this distinction in its exception hierarchy.

Parameters:
ex - Castor XMLException that occured
marshalling - indicates whether the exception occurs during marshalling (true), or unmarshalling (false)
Returns:
the corresponding XmlMappingException
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS | FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


CastorMappingException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.oxm.castor
Class CastorMappingException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.oxm.XmlMappingException
                        extended by  org.springframework.oxm.castor.CastorMappingException
All Implemented Interfaces:
Serializable
public class CastorMappingException
extends XmlMappingException

Exception thrown by CastorMarshaller whenever it encounters a mapping problem.

Since:
3.0
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
CastorMappingException(String msg, Throwable cause)
Construct a CastorMappingException with the specified detail message and nested exception.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

CastorMappingException

public CastorMappingException(String msg,
                              Throwable cause)
Construct a CastorMappingException with the specified detail message and nested exception.

Parameters:
msg - the detail message
cause - the nested exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.oxm.config

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.oxm.config

Provides an namespace handler for the Spring Object/XML namespace

See:
Description

Class Summary
OxmNamespaceHandler NamespaceHandler for the 'oxm' namespace.

Package org.springframework.oxm.config Description

Provides an namespace handler for the Spring Object/XML namespace


org.springframework.oxm.config Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.oxm.config

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.beans.factory.xml.NamespaceHandlerSupport (implements org.springframework.beans.factory.xml.NamespaceHandler)
      • org.springframework.oxm.config.OxmNamespaceHandler


OxmNamespaceHandler

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.oxm.config
Class OxmNamespaceHandler

java.lang.Object
    extended by  org.springframework.beans.factory.xml.NamespaceHandlerSupport
        extended by  org.springframework.oxm.config.OxmNamespaceHandler
All Implemented Interfaces:
NamespaceHandler
public class OxmNamespaceHandler
extends NamespaceHandlerSupport

NamespaceHandler for the 'oxm' namespace.

Since:
3.0
Author:
Arjen Poutsma

Constructor Summary
OxmNamespaceHandler()
Method Summary
 void init()
Invoked by the DefaultBeanDefinitionDocumentReader after construction but before any custom elements are parsed.
Methods inherited from class org.springframework.beans.factory.xml.NamespaceHandlerSupport
decorate, parse, registerBeanDefinitionDecorator, registerBeanDefinitionDecoratorForAttribute, registerBeanDefinitionParser
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OxmNamespaceHandler

public OxmNamespaceHandler()
Method Detail

init

public void init()
Description copied from interface: NamespaceHandler
Invoked by the DefaultBeanDefinitionDocumentReader after construction but before any custom elements are parsed.

See Also:
NamespaceHandlerSupport.registerBeanDefinitionParser(String, BeanDefinitionParser)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.oxm.jaxb

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.oxm.jaxb

Package providing integration of JAXB with Springs O/X Mapping support

See:
Description

Class Summary
Jaxb2Marshaller Implementation of the Marshaller interface for JAXB 2.0.

Package org.springframework.oxm.jaxb Description

Package providing integration of JAXB with Springs O/X Mapping support


org.springframework.oxm.jaxb Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.oxm.jaxb

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.oxm.jaxb.Jaxb2Marshaller (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.oxm.GenericMarshaller, org.springframework.oxm.GenericUnmarshaller, org.springframework.beans.factory.InitializingBean, org.springframework.oxm.mime.MimeMarshaller, org.springframework.oxm.mime.MimeUnmarshaller)


Jaxb2Marshaller

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.oxm.jaxb
Class Jaxb2Marshaller

java.lang.Object
    extended by  org.springframework.oxm.jaxb.Jaxb2Marshaller
All Implemented Interfaces:
BeanClassLoaderAware, InitializingBean, GenericMarshaller, GenericUnmarshaller, Marshaller, MimeMarshaller, MimeUnmarshaller, Unmarshaller
public class Jaxb2Marshaller
extends Object
implements MimeMarshaller, MimeUnmarshaller, GenericMarshaller, GenericUnmarshaller, BeanClassLoaderAware, InitializingBean

Implementation of the Marshaller interface for JAXB 2.0.

The typical usage will be to set either the contextPath or the classesToBeBound property on this bean, possibly customize the marshaller and unmarshaller by setting properties, schemas, adapters, and listeners, and to refer to it.

Since:
3.0
Author:
Arjen Poutsma
See Also:
setContextPath(String), setClassesToBeBound(Class[]), setJaxbContextProperties(Map), setMarshallerProperties(Map), setUnmarshallerProperties(Map), setSchema(Resource), setSchemas(Resource[]), setMarshallerListener(javax.xml.bind.Marshaller.Listener), setUnmarshallerListener(javax.xml.bind.Unmarshaller.Listener), setAdapters(XmlAdapter[])

Field Summary
protected  Log logger
Logger available to subclasses.
Constructor Summary
Jaxb2Marshaller()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected XmlMappingException | convertJaxbException(JAXBException ex) Convert the given JAXBException to an appropriate exception from the org.springframework.oxm hierarchy.
protected Marshaller | createMarshaller() Return a newly created JAXB marshaller.
protected Unmarshaller | createUnmarshaller() Return a newly created JAXB unmarshaller.
Class<?>[] | getClassesToBeBound() Returns the list of Java classes to be recognized by a newly created JAXBContext.
String | getContextPath() Returns the JAXB context path.
protected JAXBContext | getJaxbContext()
protected void | initJaxbMarshaller(Marshaller marshaller) Template method that can be overridden by concrete JAXB marshallers for custom initialization behavior.
protected void | initJaxbUnmarshaller(Unmarshaller unmarshaller) Template method that can be overridden by concrete JAXB marshallers for custom initialization behavior.
void | marshal(Object graph, Result result) Marshals the object graph with the given root into the provided Result.
void | marshal(Object graph, Result result, MimeContainer mimeContainer) Marshals the object graph with the given root into the provided Result, writing binary data to a MimeContainer.
void | setAdapters(XmlAdapter<?,?>[] adapters) Specify the XmlAdapters to be registered with the JAXB Marshaller and Unmarshaller
void | setBeanClassLoader(ClassLoader classLoader) Callback that supplies the bean class loader to a bean instance.
void | setClassesToBeBound(Class<?>[] classesToBeBound) Set the list of Java classes to be recognized by a newly created JAXBContext.
void | setContextPath(String contextPath) Set a JAXB context path.
void | setContextPaths(String[] contextPaths) Set multiple JAXB context paths.
void | setJaxbContextProperties(Map<String,?> jaxbContextProperties) Set the JAXBContext properties.
void | setLazyInit(boolean lazyInit) Set whether to lazily initialize the JAXBContext for this marshaller.
void | setMarshallerListener(Marshaller.Listener marshallerListener) Specify the Marshaller.Listener to be registered with the JAXB Marshaller.
void | setMarshallerProperties(Map<String,Object> properties) Set the JAXB Marshaller properties.
void | setMtomEnabled(boolean mtomEnabled) Specify whether MTOM support should be enabled or not.
void | setSchema(Resource schemaResource) Set the schema resource to use for validation.
void | setSchemaLanguage(String schemaLanguage) Set the schema language.
void | setSchemas(Resource[] schemaResources) Set the schema resources to use for validation.
void | setUnmarshallerListener(Unmarshaller.Listener unmarshallerListener) Set the Unmarshaller.Listener to be registered with the JAXB Unmarshaller.
void | setUnmarshallerProperties(Map<String,Object> properties) Set the JAXB Unmarshaller properties.
void | setValidationEventHandler(ValidationEventHandler validationEventHandler) Set the JAXB validation event handler.
boolean | supports(Class<?> clazz) Indicates whether this marshaller can marshal instances of the supplied type.
boolean | supports(Type genericType) Indicates whether this marshaller can marshal instances of the supplied generic type.
Object | unmarshal(Source source) Unmarshals the given Source into an object graph.
Object | unmarshal(Source source, MimeContainer mimeContainer) Unmarshals the given provided Source into an object graph, reading binary attachments from a MimeContainer.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses.

Constructor Detail

Jaxb2Marshaller

public Jaxb2Marshaller()
Method Detail

getContextPath

public String getContextPath()
Returns the JAXB context path.

setContextPath

public void setContextPath(String contextPath)
Set a JAXB context path.

setContextPaths

public void setContextPaths(String[] contextPaths)
Set multiple JAXB context paths. The given array of context paths is converted to a colon-delimited string, as supported by JAXB.

getClassesToBeBound

public Class<?>[] getClassesToBeBound()
Returns the list of Java classes to be recognized by a newly created JAXBContext.

setClassesToBeBound

public void setClassesToBeBound(Class<?>[] classesToBeBound)
Set the list of Java classes to be recognized by a newly created JAXBContext. Setting this property or "contextPath" is required.

setJaxbContextProperties

public void setJaxbContextProperties(Map<String,?> jaxbContextProperties)
Set the JAXBContext properties. These implementation-specific properties will be set on the underlying JAXBContext.

setMarshallerProperties

public void setMarshallerProperties(Map<String,Object> properties)
Set the JAXB Marshaller properties. These properties will be set on the underlying JAXB Marshaller, and allow for features such as indentation.

Parameters:
properties - the properties
See Also:
Marshaller.setProperty(String,Object), Marshaller.JAXB_ENCODING, Marshaller.JAXB_FORMATTED_OUTPUT, Marshaller.JAXB_NO_NAMESPACE_SCHEMA_LOCATION, Marshaller.JAXB_SCHEMA_LOCATION

setUnmarshallerProperties

public void setUnmarshallerProperties(Map<String,Object> properties)
Set the JAXB Unmarshaller properties. These properties will be set on the underlying JAXB Unmarshaller.

Parameters:
properties - the properties
See Also:
Unmarshaller.setProperty(String,Object)

setMarshallerListener

public void setMarshallerListener(Marshaller.Listener marshallerListener)
Specify the Marshaller.Listener to be registered with the JAXB Marshaller.

setUnmarshallerListener

public void setUnmarshallerListener(Unmarshaller.Listener unmarshallerListener)
Set the Unmarshaller.Listener to be registered with the JAXB Unmarshaller.

setValidationEventHandler

public void setValidationEventHandler(ValidationEventHandler validationEventHandler)
Set the JAXB validation event handler. This event handler will be called by JAXB if any validation errors are encountered during calls to any of the marshal APIs.

setAdapters

public void setAdapters(XmlAdapter<?,?>[] adapters)
Specify the XmlAdapters to be registered with the JAXB Marshaller and Unmarshaller

setSchema

public void setSchema(Resource schemaResource)
Set the schema resource to use for validation.

setSchemas

public void setSchemas(Resource[] schemaResources)
Set the schema resources to use for validation.

setSchemaLanguage

public void setSchemaLanguage(String schemaLanguage)
Set the schema language. Default is the W3C XML Schema: http://www.w3.org/2001/XMLSchema".

See Also:
XMLConstants.W3C_XML_SCHEMA_NS_URI, XMLConstants.RELAXNG_NS_URI

setMtomEnabled

public void setMtomEnabled(boolean mtomEnabled)
Specify whether MTOM support should be enabled or not. Default is false: marshalling using XOP/MTOM not being enabled.

setLazyInit

public void setLazyInit(boolean lazyInit)
Set whether to lazily initialize the JAXBContext for this marshaller. Default is false to initialize on startup; can be switched to true.

Early initialization just applies if afterPropertiesSet() is called.

See Also:
afterPropertiesSet()

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

afterPropertiesSet

public final void afterPropertiesSet()
                              throws Exception
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception - in the event of misconfiguration (such as failure to set an essential property) or if initialization fails.

getJaxbContext

protected JAXBContext getJaxbContext()

supports

public boolean supports(Class<?> clazz)
Description copied from interface: Marshaller
Indicates whether this marshaller can marshal instances of the supplied type.

Specified by:
supports in interface Marshaller
Specified by:
supports in interface Unmarshaller
Parameters:
clazz - the class that this marshaller is being asked if it can marshal
Returns:
true if this marshaller can indeed marshal instances of the supplied class; false otherwise

supports

public boolean supports(Type genericType)
Description copied from interface: GenericMarshaller
Indicates whether this marshaller can marshal instances of the supplied generic type.

Specified by:
supports in interface GenericMarshaller
Specified by:
supports in interface GenericUnmarshaller
Parameters:
genericType - the type that this marshaller is being asked if it can marshal
Returns:
true if this marshaller can indeed marshal instances of the supplied type; false otherwise

marshal

public void marshal(Object graph,
                    Result result)
             throws XmlMappingException
Description copied from interface: Marshaller
Marshals the object graph with the given root into the provided Result.

Specified by:
marshal in interface Marshaller
Parameters:
graph - the root of the object graph to marshal
result - the result to marshal to
Throws:
XmlMappingException - if the given object cannot be marshalled to the result

marshal

public void marshal(Object graph,
                    Result result,
                    MimeContainer mimeContainer)
             throws XmlMappingException
Description copied from interface: MimeMarshaller
Marshals the object graph with the given root into the provided Result, writing binary data to a MimeContainer.

Specified by:
marshal in interface MimeMarshaller
Parameters:
graph - the root of the object graph to marshal
result - the result to marshal to
mimeContainer - the MIME container to write extracted binary content to
Throws:
XmlMappingException - if the given object cannot be marshalled to the result

createMarshaller

protected Marshaller createMarshaller()
Return a newly created JAXB marshaller. JAXB marshallers are not necessarily thread safe.

initJaxbMarshaller

protected void initJaxbMarshaller(Marshaller marshaller)
                           throws JAXBException
Template method that can be overridden by concrete JAXB marshallers for custom initialization behavior. Gets called after creation of JAXB Marshaller, and after the respective properties have been set.

The default implementation sets the defined properties, the validation event handler, the schemas, listener, and adapters.

Throws:
JAXBException

unmarshal

public Object unmarshal(Source source)
                 throws XmlMappingException
Description copied from interface: Unmarshaller
Unmarshals the given Source into an object graph.

Specified by:
unmarshal in interface Unmarshaller
Parameters:
source - the source to marshal from
Returns:
the object graph
Throws:
XmlMappingException - if the given source cannot be mapped to an object

unmarshal

public Object unmarshal(Source source,
                        MimeContainer mimeContainer)
                 throws XmlMappingException
Description copied from interface: MimeUnmarshaller
Unmarshals the given provided Source into an object graph, reading binary attachments from a MimeContainer.

Specified by:
unmarshal in interface MimeUnmarshaller
Parameters:
source - the source to marshal from
mimeContainer - the MIME container to read extracted binary content from
Returns:
the object graph
Throws:
XmlMappingException - if the given source cannot be mapped to an object

createUnmarshaller

protected Unmarshaller createUnmarshaller()
Return a newly created JAXB unmarshaller. JAXB unmarshallers are not necessarily thread safe.

initJaxbUnmarshaller

protected void initJaxbUnmarshaller(Unmarshaller unmarshaller)
                             throws JAXBException
Template method that can be overridden by concrete JAXB marshallers for custom initialization behavior. Gets called after creation of JAXB Marshaller, and after the respective properties have been set.

The default implementation sets the defined properties, the validation event handler, the schemas, listener, and adapters.

Throws:
JAXBException

convertJaxbException

protected XmlMappingException convertJaxbException(JAXBException ex)
Convert the given JAXBException to an appropriate exception from the org.springframework.oxm hierarchy.

Parameters:
ex - JAXBException that occured
Returns:
the corresponding XmlMappingException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.oxm.jibx

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.oxm.jibx

Package providing integration of JiBX with Springs O/X Mapping support

See:
Description

Class Summary
JibxMarshaller Implementation of the Marshaller and Unmarshaller interfaces for JiBX.

Package org.springframework.oxm.jibx Description

Package providing integration of JiBX with Springs O/X Mapping support


org.springframework.oxm.jibx Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.oxm.jibx

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.oxm.support.AbstractMarshaller (implements org.springframework.oxm.Marshaller, org.springframework.oxm.Unmarshaller)
      • org.springframework.oxm.jibx.JibxMarshaller (implements org.springframework.beans.factory.InitializingBean)


JibxMarshaller

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.oxm.jibx
Class JibxMarshaller

java.lang.Object
    extended by  org.springframework.oxm.support.AbstractMarshaller
        extended by  org.springframework.oxm.jibx.JibxMarshaller
All Implemented Interfaces:
InitializingBean, Marshaller, Unmarshaller
public class JibxMarshaller
extends AbstractMarshaller
implements InitializingBean

Implementation of the Marshaller and Unmarshaller interfaces for JiBX.

The typical usage will be to set the targetClass and optionally the bindingName property on this bean.

Since:
3.0
Author:
Arjen Poutsma
See Also:
IMarshallingContext, IUnmarshallingContext

Field Summary
Fields inherited from class org.springframework.oxm.support.AbstractMarshaller
logger
Constructor Summary
JibxMarshaller()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
XmlMappingException | convertJibxException(org.jibx.runtime.JiBXException ex, boolean marshalling) Convert the given JiBXException to an appropriate exception from the org.springframework.oxm hierarchy.
protected org.jibx.runtime.IMarshallingContext | createMarshallingContext() Create a new IMarshallingContext, configured with the correct indentation.
protected org.jibx.runtime.IUnmarshallingContext | createUnmarshallingContext() Create a new IUnmarshallingContext.
protected void | marshalDomNode(Object graph, Node node) Abstract template method for marshalling the given object graph to a DOM Node.
protected void | marshalOutputStream(Object graph, OutputStream outputStream) Abstract template method for marshalling the given object graph to a OutputStream.
protected void | marshalSaxHandlers(Object graph, ContentHandler contentHandler, LexicalHandler lexicalHandler) Abstract template method for marshalling the given object graph to a SAX ContentHandler.
protected void | marshalWriter(Object graph, Writer writer) Abstract template method for marshalling the given object graph to a Writer.
protected void | marshalXmlEventWriter(Object graph, XMLEventWriter eventWriter) Abstract template method for marshalling the given object to a StAX XMLEventWriter.
protected void | marshalXmlStreamWriter(Object graph, XMLStreamWriter streamWriter) Abstract template method for marshalling the given object to a StAX XMLStreamWriter.
void | setBindingName(String bindingName) Set the optional binding name for this instance.
void | setDocTypeInternalSubset(String docTypeInternalSubset) Sets the internal subset Id for the DTD declaration written when marshalling.
void | setDocTypePublicId(String docTypePublicId) Sets the public Id for the DTD declaration written when marshalling.
void | setDocTypeRootElementName(String docTypeRootElementName) Sets the root element name for the DTD declaration written when marshalling.
void | setDocTypeSystemId(String docTypeSystemId) Sets the system Id for the DTD declaration written when marshalling.
void | setEncoding(String encoding) Set the document encoding using for marshalling.
void | setIndent(int indent) Set the number of nesting indent spaces.
void | setStandalone(Boolean standalone) Set the document standalone flag for marshalling.
void | setTargetClass(Class<?> targetClass) Set the target class for this instance.
boolean | supports(Class<?> clazz) Indicates whether this marshaller can marshal instances of the supplied type.
protected Object | unmarshalDomNode(Node node) Abstract template method for unmarshalling from a given DOM Node.
protected Object | unmarshalInputStream(InputStream inputStream) Abstract template method for unmarshalling from a given InputStream.
protected Object | unmarshalReader(Reader reader) Abstract template method for unmarshalling from a given Reader.
protected Object | unmarshalSaxReader(XMLReader xmlReader, InputSource inputSource) Abstract template method for unmarshalling using a given SAX XMLReader and InputSource.
protected Object | unmarshalXmlEventReader(XMLEventReader eventReader) Abstract template method for unmarshalling from a given Stax XMLEventReader.
protected Object | unmarshalXmlStreamReader(XMLStreamReader streamReader) Abstract template method for unmarshalling from a given Stax XMLStreamReader.
Methods inherited from class org.springframework.oxm.support.AbstractMarshaller
createDocumentBuilder, createDocumentBuilderFactory, createXmlReader, marshal, marshalDomResult, marshalSaxResult, marshalStaxResult, marshalStreamResult, unmarshal, unmarshalDomSource, unmarshalSaxSource, unmarshalStaxSource, unmarshalStreamSource
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JibxMarshaller

public JibxMarshaller()
Method Detail

setTargetClass

public void setTargetClass(Class<?> targetClass)
Set the target class for this instance. This property is required.

setBindingName

public void setBindingName(String bindingName)
Set the optional binding name for this instance.

setIndent

public void setIndent(int indent)
Set the number of nesting indent spaces. Default is -1, i.e. no indentation.

setEncoding

public void setEncoding(String encoding)
Set the document encoding using for marshalling. Default is UTF-8.

setStandalone

public void setStandalone(Boolean standalone)
Set the document standalone flag for marshalling. By default, this flag is not present.

setDocTypeRootElementName

public void setDocTypeRootElementName(String docTypeRootElementName)
Sets the root element name for the DTD declaration written when marshalling. By default, this is null (i.e. no DTD declaration is written). If set to a value, the system ID or public ID also need to be set.

See Also:
setDocTypeSystemId(String), setDocTypePublicId(String)

setDocTypeSystemId

public void setDocTypeSystemId(String docTypeSystemId)
Sets the system Id for the DTD declaration written when marshalling. By default, this is null. Only used when the root element also has been set. Set either this property or docTypePublicId, not both.

See Also:
setDocTypeRootElementName(String)

setDocTypePublicId

public void setDocTypePublicId(String docTypePublicId)
Sets the public Id for the DTD declaration written when marshalling. By default, this is null. Only used when the root element also has been set. Set either this property or docTypeSystemId, not both.

See Also:
setDocTypeRootElementName(String)

setDocTypeInternalSubset

public void setDocTypeInternalSubset(String docTypeInternalSubset)
Sets the internal subset Id for the DTD declaration written when marshalling. By default, this is null. Only used when the root element also has been set.

See Also:
setDocTypeRootElementName(String)

afterPropertiesSet

public void afterPropertiesSet()
                        throws org.jibx.runtime.JiBXException
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
org.jibx.runtime.JiBXException

supports

public boolean supports(Class<?> clazz)
Description copied from interface: Marshaller
Indicates whether this marshaller can marshal instances of the supplied type.

Specified by:
supports in interface Marshaller
Specified by:
supports in interface Unmarshaller
Parameters:
clazz - the class that this marshaller is being asked if it can marshal
Returns:
true if this marshaller can indeed marshal instances of the supplied class; false otherwise

marshalOutputStream

protected void marshalOutputStream(Object graph,
                                   OutputStream outputStream)
                            throws XmlMappingException,
                                   IOException
Description copied from class: AbstractMarshaller
Abstract template method for marshalling the given object graph to a OutputStream.

Specified by:
marshalOutputStream in class AbstractMarshaller
Parameters:
graph - the root of the object graph to marshal
outputStream - the OutputStream to write to
Throws:
XmlMappingException - if the given object cannot be marshalled to the writer
IOException - if an I/O exception occurs

marshalWriter

protected void marshalWriter(Object graph,
                             Writer writer)
                      throws XmlMappingException,
                             IOException
Description copied from class: AbstractMarshaller
Abstract template method for marshalling the given object graph to a Writer.

Specified by:
marshalWriter in class AbstractMarshaller
Parameters:
graph - the root of the object graph to marshal
writer - the Writer to write to
Throws:
XmlMappingException - if the given object cannot be marshalled to the writer
IOException - if an I/O exception occurs

marshalXmlStreamWriter

protected void marshalXmlStreamWriter(Object graph,
                                      XMLStreamWriter streamWriter)
                               throws XmlMappingException
Description copied from class: AbstractMarshaller
Abstract template method for marshalling the given object to a StAX XMLStreamWriter.

Specified by:
marshalXmlStreamWriter in class AbstractMarshaller
Parameters:
graph - the root of the object graph to marshal
streamWriter - the XMLStreamWriter to write to
Throws:
XmlMappingException - if the given object cannot be marshalled to the DOM node

marshalDomNode

protected void marshalDomNode(Object graph,
                              Node node)
                       throws XmlMappingException
Description copied from class: AbstractMarshaller
Abstract template method for marshalling the given object graph to a DOM Node.

In practice, node is be a Document node, a DocumentFragment node, or a Element node. In other words, a node that accepts children.

Specified by:
marshalDomNode in class AbstractMarshaller
Parameters:
graph - the root of the object graph to marshal
node - the DOM node that will contain the result tree
Throws:
XmlMappingException - if the given object cannot be marshalled to the DOM node
See Also:
Document, DocumentFragment, Element

marshalSaxHandlers

protected void marshalSaxHandlers(Object graph,
                                  ContentHandler contentHandler,
                                  LexicalHandler lexicalHandler)
                           throws XmlMappingException
Description copied from class: AbstractMarshaller
Abstract template method for marshalling the given object graph to a SAX ContentHandler.

Specified by:
marshalSaxHandlers in class AbstractMarshaller
Parameters:
graph - the root of the object graph to marshal
contentHandler - the SAX ContentHandler
lexicalHandler - the SAX2 LexicalHandler. Can be null.
Throws:
XmlMappingException - if the given object cannot be marshalled to the handlers

marshalXmlEventWriter

protected void marshalXmlEventWriter(Object graph,
                                     XMLEventWriter eventWriter)
Description copied from class: AbstractMarshaller
Abstract template method for marshalling the given object to a StAX XMLEventWriter.

Specified by:
marshalXmlEventWriter in class AbstractMarshaller
Parameters:
graph - the root of the object graph to marshal
eventWriter - the XMLEventWriter to write to

unmarshalInputStream

protected Object unmarshalInputStream(InputStream inputStream)
                               throws XmlMappingException,
                                      IOException
Description copied from class: AbstractMarshaller
Abstract template method for unmarshalling from a given InputStream.

Specified by:
unmarshalInputStream in class AbstractMarshaller
Parameters:
inputStream - the InputStreamStream to read from
Returns:
the object graph
Throws:
XmlMappingException - if the given stream cannot be converted to an object
IOException - if an I/O exception occurs

unmarshalReader

protected Object unmarshalReader(Reader reader)
                          throws XmlMappingException,
                                 IOException
Description copied from class: AbstractMarshaller
Abstract template method for unmarshalling from a given Reader.

Specified by:
unmarshalReader in class AbstractMarshaller
Parameters:
reader - the Reader to read from
Returns:
the object graph
Throws:
XmlMappingException - if the given reader cannot be converted to an object
IOException - if an I/O exception occurs

unmarshalXmlStreamReader

protected Object unmarshalXmlStreamReader(XMLStreamReader streamReader)
Description copied from class: AbstractMarshaller
Abstract template method for unmarshalling from a given Stax XMLStreamReader.

Specified by:
unmarshalXmlStreamReader in class AbstractMarshaller
Parameters:
streamReader - the XMLStreamReader to read from
Returns:
the object graph

unmarshalXmlEventReader

protected Object unmarshalXmlEventReader(XMLEventReader eventReader)
Description copied from class: AbstractMarshaller
Abstract template method for unmarshalling from a given Stax XMLEventReader.

Specified by:
unmarshalXmlEventReader in class AbstractMarshaller
Parameters:
eventReader - the XMLEventReader to read from
Returns:
the object graph

unmarshalDomNode

protected Object unmarshalDomNode(Node node)
                           throws XmlMappingException
Description copied from class: AbstractMarshaller
Abstract template method for unmarshalling from a given DOM Node.

Specified by:
unmarshalDomNode in class AbstractMarshaller
Parameters:
node - the DOM node that contains the objects to be unmarshalled
Returns:
the object graph
Throws:
XmlMappingException - if the given DOM node cannot be mapped to an object

unmarshalSaxReader

protected Object unmarshalSaxReader(XMLReader xmlReader,
                                    InputSource inputSource)
                             throws XmlMappingException,
                                    IOException
Description copied from class: AbstractMarshaller
Abstract template method for unmarshalling using a given SAX XMLReader and InputSource.

Specified by:
unmarshalSaxReader in class AbstractMarshaller
Parameters:
xmlReader - the SAX XMLReader to parse with
inputSource - the input source to parse from
Returns:
the object graph
Throws:
XmlMappingException - if the given reader and input source cannot be converted to an object
IOException - if an I/O exception occurs

createMarshallingContext

protected org.jibx.runtime.IMarshallingContext createMarshallingContext()
                                                                 throws org.jibx.runtime.JiBXException
Create a new IMarshallingContext, configured with the correct indentation.

Returns:
the created marshalling context
Throws:
org.jibx.runtime.JiBXException - in case of errors

createUnmarshallingContext

protected org.jibx.runtime.IUnmarshallingContext createUnmarshallingContext()
                                                                     throws org.jibx.runtime.JiBXException
Create a new IUnmarshallingContext.

Returns:
the created unmarshalling context
Throws:
org.jibx.runtime.JiBXException - in case of errors

convertJibxException

public XmlMappingException convertJibxException(org.jibx.runtime.JiBXException ex,
                                                boolean marshalling)
Convert the given JiBXException to an appropriate exception from the org.springframework.oxm hierarchy.

A boolean flag is used to indicate whether this exception occurs during marshalling or unmarshalling, since JiBX itself does not make this distinction in its exception hierarchy.

Parameters:
ex - JiBXException that occured
marshalling - indicates whether the exception occurs during marshalling (true), or unmarshalling (false)
Returns:
the corresponding XmlMappingException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.oxm.mime

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.oxm.mime

Contains (un)marshallers optimized to store binary data in MIME attachments.

See:
Description

Interface Summary
MimeContainer | Represents a container for MIME attachments Concrete implementations might adapt a SOAPMessage or an email message.
MimeMarshaller | Subinterface of Marshaller that can use MIME attachments to optimize storage of binary data.
MimeUnmarshaller | Subinterface of Unmarshaller that can use MIME attachments to optimize storage of binary data.

Package org.springframework.oxm.mime Description

Contains (un)marshallers optimized to store binary data in MIME attachments.


org.springframework.oxm.mime Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.oxm.mime

Package Hierarchies:
All Packages

Interface Hierarchy

  • org.springframework.oxm.Marshaller
    • org.springframework.oxm.mime.MimeMarshaller
  • org.springframework.oxm.mime.MimeContainer
  • org.springframework.oxm.Unmarshaller
    • org.springframework.oxm.mime.MimeUnmarshaller


MimeContainer

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.oxm.mime
Interface MimeContainer

public interface MimeContainer

Represents a container for MIME attachments Concrete implementations might adapt a SOAPMessage or an email message.

Since:
3.0
Author:
Arjen Poutsma
See Also:
XML-binary Optimized Packaging

Method Summary
void | addAttachment(String contentId, DataHandler dataHandler) Add the given data handler as an attachment to this container.
boolean | convertToXopPackage() Turn this message into a XOP package.
DataHandler | getAttachment(String contentId) Return the attachment with the given content id, or null if not found.
boolean | isXopPackage() Indicate whether this container is a XOP package.

Method Detail

isXopPackage

boolean isXopPackage()
Indicate whether this container is a XOP package.

Returns:
true when the constraints specified in Identifying XOP Documents are met
See Also:
XOP Packages

convertToXopPackage

boolean convertToXopPackage()
Turn this message into a XOP package.

Returns:
true when the message actually is a XOP package
See Also:
XOP Packages

addAttachment

void addAttachment(String contentId,
                   DataHandler dataHandler)
Add the given data handler as an attachment to this container.

Parameters:
contentId - the content id of the attachment
dataHandler - the data handler containing the data of the attachment

getAttachment

DataHandler getAttachment(String contentId)
Return the attachment with the given content id, or null if not found.

Parameters:
contentId - the content id
Returns:
the attachment, as a data handler
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


MimeMarshaller

org.springframework.oxm.mime
Interface MimeMarshaller

All Superinterfaces:
Marshaller
All Known Implementing Classes:
Jaxb2Marshaller
public interface MimeMarshaller
extends Marshaller

Subinterface of Marshaller that can use MIME attachments to optimize storage of binary data. Attachments can be added as MTOM, XOP, or SwA.

Since:
3.0
Author:
Arjen Poutsma
See Also:
SOAP Message Transmission Optimization Mechanism, XML-binary Optimized Packaging

Method Summary
 void marshal(Object graph, Result result, MimeContainer mimeContainer)
Marshals the object graph with the given root into the provided Result, writing binary data to a MimeContainer.
Methods inherited from interface org.springframework.oxm.Marshaller
marshal, supports

Method Detail

marshal

void marshal(Object graph,
             Result result,
             MimeContainer mimeContainer)
             throws XmlMappingException,
                    IOException
Marshals the object graph with the given root into the provided Result, writing binary data to a MimeContainer.

Parameters:
graph - the root of the object graph to marshal
result - the result to marshal to
mimeContainer - the MIME container to write extracted binary content to
Throws:
XmlMappingException - if the given object cannot be marshalled to the result
IOException - if an I/O exception occurs
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MimeUnmarshaller

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.oxm.mime
Interface MimeUnmarshaller

All Superinterfaces:
Unmarshaller
All Known Implementing Classes:
Jaxb2Marshaller
public interface MimeUnmarshaller
extends Unmarshaller

Subinterface of Unmarshaller that can use MIME attachments to optimize storage of binary data. Attachments can be added as MTOM, XOP, or SwA.

Since:
3.0
Author:
Arjen Poutsma
See Also:
SOAP Message Transmission Optimization Mechanism, XML-binary Optimized Packaging

Method Summary
 Object unmarshal(Source source, MimeContainer mimeContainer)
Unmarshals the given provided Source into an object graph, reading binary attachments from a MimeContainer.
Methods inherited from interface org.springframework.oxm.Unmarshaller
supports, unmarshal

Method Detail

unmarshal

Object unmarshal(Source source,
                 MimeContainer mimeContainer)
                 throws XmlMappingException,
                        IOException
Unmarshals the given provided Source into an object graph, reading binary attachments from a MimeContainer.

Parameters:
source - the source to marshal from
mimeContainer - the MIME container to read extracted binary content from
Returns:
the object graph
Throws:
XmlMappingException - if the given source cannot be mapped to an object
IOException - if an I/O Exception occurs
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.oxm.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.oxm.support

Provides generic support classes for using Spring's O/X Mapping integration within various scenario's.

See:
Description

Class Summary
AbstractMarshaller | Abstract implementation of the Marshaller and Unmarshaller interface.
MarshallingSource | Source implementation that uses a Marshaller.Can be constructed with a Marshaller and an object to be marshalled.
SaxResourceUtils | Convenient utility methods for dealing with SAX.

Package org.springframework.oxm.support Description

Provides generic support classes for using Spring's O/X Mapping integration within various scenario's. Includes the MarshallingSource for compatibility with TrAX, MarshallingView for use withing Spring Web MVC, and the MarshallingMessageConverter for use within Spring's JMS support.


org.springframework.oxm.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.oxm.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.oxm.support.AbstractMarshaller (implements org.springframework.oxm.Marshaller, org.springframework.oxm.Unmarshaller)
    • org.springframework.oxm.support.SaxResourceUtils
    • javax.xml.transform.sax.SAXSource (implements javax.xml.transform.Source)
      • org.springframework.oxm.support.MarshallingSource


AbstractMarshaller

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.oxm.support
Class AbstractMarshaller

java.lang.Object
    extended by  org.springframework.oxm.support.AbstractMarshaller
All Implemented Interfaces:
Marshaller, Unmarshaller
Direct Known Subclasses:
CastorMarshaller, JibxMarshaller, XmlBeansMarshaller, XStreamMarshaller
public abstract class AbstractMarshaller
extends Object
implements Marshaller, Unmarshaller

Abstract implementation of the Marshaller and Unmarshaller interface. This implementation inspects the given Source or Result, and defers further handling to overridable template methods.

Since:
3.0
Author:
Arjen Poutsma, Juergen Hoeller

Field Summary
protected  Log logger
Logger available to subclasses.
Constructor Summary
AbstractMarshaller()
Method Summary
protected DocumentBuilder | createDocumentBuilder(DocumentBuilderFactory factory) Create a DocumentBuilder that this marshaller will use for creating DOM documents when passed an empty DOMSource.
protected DocumentBuilderFactory | createDocumentBuilderFactory() Create a DocumentBuilder that this marshaller will use for creating DOM documents when passed an empty DOMSource.
protected XMLReader | createXmlReader() Create a XMLReader that this marshaller will when passed an empty SAXSource.
void | marshal(Object graph, Result result) Marshals the object graph with the given root into the provided javax.xml.transform.Result.
protected abstract void | marshalDomNode(Object graph, Node node) Abstract template method for marshalling the given object graph to a DOM Node.
protected void | marshalDomResult(Object graph, DOMResult domResult) Template method for handling DOMResults.
protected abstract void | marshalOutputStream(Object graph, OutputStream outputStream) Abstract template method for marshalling the given object graph to a OutputStream.
protected abstract void | marshalSaxHandlers(Object graph, ContentHandler contentHandler, LexicalHandler lexicalHandler) Abstract template method for marshalling the given object graph to a SAX ContentHandler.
protected void | marshalSaxResult(Object graph, SAXResult saxResult) Template method for handling SAXResults.
protected void | marshalStaxResult(Object graph, Result staxResult) Template method for handling StaxResults.
protected void | marshalStreamResult(Object graph, StreamResult streamResult) Template method for handling StreamResults.
protected abstract void | marshalWriter(Object graph, Writer writer) Abstract template method for marshalling the given object graph to a Writer.
protected abstract void | marshalXmlEventWriter(Object graph, XMLEventWriter eventWriter) Abstract template method for marshalling the given object to a StAX XMLEventWriter.
protected abstract void | marshalXmlStreamWriter(Object graph, XMLStreamWriter streamWriter) Abstract template method for marshalling the given object to a StAX XMLStreamWriter.
Object | unmarshal(Source source) Unmarshals the given provided javax.xml.transform.Source into an object graph.
protected abstract Object | unmarshalDomNode(Node node) Abstract template method for unmarshalling from a given DOM Node.
protected Object | unmarshalDomSource(DOMSource domSource) Template method for handling DOMSources.
protected abstract Object | unmarshalInputStream(InputStream inputStream) Abstract template method for unmarshalling from a given InputStream.
protected abstract Object | unmarshalReader(Reader reader) Abstract template method for unmarshalling from a given Reader.
protected abstract Object | unmarshalSaxReader(XMLReader xmlReader, InputSource inputSource) Abstract template method for unmarshalling using a given SAX XMLReader and InputSource.
protected Object | unmarshalSaxSource(SAXSource saxSource) Template method for handling SAXSources.
protected Object | unmarshalStaxSource(Source staxSource) Template method for handling StaxSources.
protected Object | unmarshalStreamSource(StreamSource streamSource) Template method for handling StreamSources.
protected abstract Object | unmarshalXmlEventReader(XMLEventReader eventReader) Abstract template method for unmarshalling from a given Stax XMLEventReader.
protected abstract Object | unmarshalXmlStreamReader(XMLStreamReader streamReader) Abstract template method for unmarshalling from a given Stax XMLStreamReader.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.oxm.Marshaller
supports
Methods inherited from interface org.springframework.oxm.Unmarshaller
supports

Field Detail

logger

protected final Log logger
Logger available to subclasses.

Constructor Detail

AbstractMarshaller

public AbstractMarshaller()
Method Detail

marshal

public final void marshal(Object graph,
                          Result result)
                   throws IOException,
                          XmlMappingException
Marshals the object graph with the given root into the provided javax.xml.transform.Result.

This implementation inspects the given result, and calls marshalDomResult, marshalSaxResult, or marshalStreamResult.

Specified by:
marshal in interface Marshaller
Parameters:
graph - the root of the object graph to marshal
result - the result to marshal to
Throws:
IOException - if an I/O exception occurs
XmlMappingException - if the given object cannot be marshalled to the result
IllegalArgumentException - if result if neither a DOMResult, a SAXResult, nor a StreamResult
See Also:
marshalDomResult(Object, javax.xml.transform.dom.DOMResult),
marshalSaxResult(Object, javax.xml.transform.sax.SAXResult),
marshalStreamResult(Object, javax.xml.transform.stream.StreamResult)

unmarshal

public final Object unmarshal(Source source)
                       throws IOException,
                              XmlMappingException
Unmarshals the given provided javax.xml.transform.Source into an object graph.

This implementation inspects the given result, and calls unmarshalDomSource, unmarshalSaxSource, or unmarshalStreamSource.

Specified by:
unmarshal in interface Unmarshaller
Parameters:
source - the source to marshal from
Returns:
the object graph
Throws:
IOException - if an I/O Exception occurs
XmlMappingException - if the given source cannot be mapped to an object
IllegalArgumentException - if source is neither a DOMSource, a SAXSource, nor a StreamSource
See Also:
unmarshalDomSource(javax.xml.transform.dom.DOMSource),
unmarshalSaxSource(javax.xml.transform.sax.SAXSource),
unmarshalStreamSource(javax.xml.transform.stream.StreamSource)

createDocumentBuilder

protected DocumentBuilder createDocumentBuilder(DocumentBuilderFactory factory)
                                         throws ParserConfigurationException
Create a DocumentBuilder that this marshaller will use for creating DOM documents when passed an empty DOMSource.

Can be overridden in subclasses, adding further initialization of the builder.

Parameters:
factory - the DocumentBuilderFactory that the DocumentBuilder should be created with
Returns:
the DocumentBuilder
Throws:
ParserConfigurationException - if thrown by JAXP methods

createDocumentBuilderFactory

protected DocumentBuilderFactory createDocumentBuilderFactory()
                                                       throws ParserConfigurationException
Create a DocumentBuilder that this marshaller will use for creating DOM documents when passed an empty DOMSource.

The resulting DocumentBuilderFactory is cached, so this method will only be called once.

Returns:
the DocumentBuilderFactory
Throws:
ParserConfigurationException - if thrown by JAXP methods

createXmlReader

protected XMLReader createXmlReader()
                             throws SAXException
Create a XMLReader that this marshaller will when passed an empty SAXSource.

Returns:
the XMLReader
Throws:
SAXException - if thrown by JAXP methods

marshalDomResult

protected void marshalDomResult(Object graph,
                                DOMResult domResult)
                         throws XmlMappingException
Template method for handling DOMResults.

This implementation delegates to marshalDomNode.

Parameters:
graph - the root of the object graph to marshal
domResult - the DOMResult
Throws:
XmlMappingException - if the given object cannot be marshalled to the result
IllegalArgumentException - if the domResult is empty
See Also:
marshalDomNode(Object, org.w3c.dom.Node)

marshalStaxResult

protected void marshalStaxResult(Object graph,
                                 Result staxResult)
                          throws XmlMappingException
Template method for handling StaxResults.

This implementation delegates to marshalXMLSteamWriter or marshalXMLEventConsumer, depending on what is contained in the StaxResult.

Parameters:
graph - the root of the object graph to marshal
staxResult - a Spring StaxSource or JAXP 1.4 StAXSource
Throws:
XmlMappingException - if the given object cannot be marshalled to the result
IllegalArgumentException - if the domResult is empty
See Also:
marshalDomNode(Object,org.w3c.dom.Node)

marshalSaxResult

protected void marshalSaxResult(Object graph,
                                SAXResult saxResult)
                         throws XmlMappingException
Template method for handling SAXResults.

This implementation delegates to marshalSaxHandlers.

Parameters:
graph - the root of the object graph to marshal
saxResult - the SAXResult
Throws:
XmlMappingException - if the given object cannot be marshalled to the result
See Also:
marshalSaxHandlers(Object, org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler)

marshalStreamResult

protected void marshalStreamResult(Object graph,
                                   StreamResult streamResult)
                            throws XmlMappingException,
                                   IOException
Template method for handling StreamResults.

This implementation delegates to marshalOutputStream or marshalWriter, depending on what is contained in the StreamResult

Parameters:
graph - the root of the object graph to marshal
streamResult - the StreamResult
Throws:
IOException - if an I/O Exception occurs
XmlMappingException - if the given object cannot be marshalled to the result
IllegalArgumentException - if streamResult does neither contain an OutputStream nor a Writer

unmarshalDomSource

protected Object unmarshalDomSource(DOMSource domSource)
                             throws XmlMappingException
Template method for handling DOMSources.

This implementation delegates to unmarshalDomNode. If the given source is empty, an empty source Document will be created as a placeholder.

Parameters:
domSource - the DOMSource
Returns:
the object graph
Throws:
XmlMappingException - if the given source cannot be mapped to an object
IllegalArgumentException - if the domSource is empty
See Also:
unmarshalDomNode(org.w3c.dom.Node)

unmarshalStaxSource

protected Object unmarshalStaxSource(Source staxSource)
                              throws XmlMappingException
Template method for handling StaxSources.

This implementation delegates to unmarshalXmlStreamReader or unmarshalXmlEventReader.

Parameters:
staxSource - the StaxSource
Returns:
the object graph
Throws:
XmlMappingException - if the given source cannot be mapped to an object

unmarshalSaxSource

protected Object unmarshalSaxSource(SAXSource saxSource)
                             throws XmlMappingException,
                                    IOException
Template method for handling SAXSources.

This implementation delegates to unmarshalSaxReader.

Parameters:
saxSource - the SAXSource
Returns:
the object graph
Throws:
XmlMappingException - if the given source cannot be mapped to an object
IOException - if an I/O Exception occurs
See Also:
unmarshalSaxReader(org.xml.sax.XMLReader, org.xml.sax.InputSource)

unmarshalStreamSource

protected Object unmarshalStreamSource(StreamSource streamSource)
                                throws XmlMappingException,
                                       IOException
Template method for handling StreamSources.

This implementation defers to unmarshalInputStream or unmarshalReader.

Parameters:
streamSource - the StreamSource
Returns:
the object graph
Throws:
IOException - if an I/O exception occurs
XmlMappingException - if the given source cannot be mapped to an object

marshalDomNode

protected abstract void marshalDomNode(Object graph,
                                       Node node)
                                throws XmlMappingException
Abstract template method for marshalling the given object graph to a DOM Node.

In practice, node is be a Document node, a DocumentFragment node, or a Element node. In other words, a node that accepts children.

Parameters:
graph - the root of the object graph to marshal
node - the DOM node that will contain the result tree
Throws:
XmlMappingException - if the given object cannot be marshalled to the DOM node
See Also:
Document, DocumentFragment, Element

marshalXmlEventWriter

protected abstract void marshalXmlEventWriter(Object graph,
                                              XMLEventWriter eventWriter)
                                       throws XmlMappingException
Abstract template method for marshalling the given object to a StAX XMLEventWriter.

Parameters:
graph - the root of the object graph to marshal
eventWriter - the XMLEventWriter to write to
Throws:
XmlMappingException - if the given object cannot be marshalled to the DOM node

marshalXmlStreamWriter

protected abstract void marshalXmlStreamWriter(Object graph,
                                               XMLStreamWriter streamWriter)
                                        throws XmlMappingException
Abstract template method for marshalling the given object to a StAX XMLStreamWriter.

Parameters:
graph - the root of the object graph to marshal
streamWriter - the XMLStreamWriter to write to
Throws:
XmlMappingException - if the given object cannot be marshalled to the DOM node

marshalOutputStream

protected abstract void marshalOutputStream(Object graph,
                                            OutputStream outputStream)
                                     throws XmlMappingException,
                                            IOException
Abstract template method for marshalling the given object graph to a OutputStream.

Parameters:
graph - the root of the object graph to marshal
outputStream - the OutputStream to write to
Throws:
XmlMappingException - if the given object cannot be marshalled to the writer
IOException - if an I/O exception occurs

marshalSaxHandlers

protected abstract void marshalSaxHandlers(Object graph,
                                           ContentHandler contentHandler,
                                           LexicalHandler lexicalHandler)
                                    throws XmlMappingException
Abstract template method for marshalling the given object graph to a SAX ContentHandler.

Parameters:
graph - the root of the object graph to marshal
contentHandler - the SAX ContentHandler
lexicalHandler - the SAX2 LexicalHandler. Can be null.
Throws:
XmlMappingException - if the given object cannot be marshalled to the handlers

marshalWriter

protected abstract void marshalWriter(Object graph,
                                      Writer writer)
                               throws XmlMappingException,
                                      IOException
Abstract template method for marshalling the given object graph to a Writer.

Parameters:
graph - the root of the object graph to marshal
writer - the Writer to write to
Throws:
XmlMappingException - if the given object cannot be marshalled to the writer
IOException - if an I/O exception occurs

unmarshalDomNode

protected abstract Object unmarshalDomNode(Node node)
                                    throws XmlMappingException
Abstract template method for unmarshalling from a given DOM Node.

Parameters:
node - the DOM node that contains the objects to be unmarshalled
Returns:
the object graph
Throws:
XmlMappingException - if the given DOM node cannot be mapped to an object

unmarshalXmlEventReader

protected abstract Object unmarshalXmlEventReader(XMLEventReader eventReader)
                                           throws XmlMappingException
Abstract template method for unmarshalling from a given Stax XMLEventReader.

Parameters:
eventReader - the XMLEventReader to read from
Returns:
the object graph
Throws:
XmlMappingException - if the given event reader cannot be converted to an object

unmarshalXmlStreamReader

protected abstract Object unmarshalXmlStreamReader(XMLStreamReader streamReader)
                                            throws XmlMappingException
Abstract template method for unmarshalling from a given Stax XMLStreamReader.

Parameters:
streamReader - the XMLStreamReader to read from
Returns:
the object graph
Throws:
XmlMappingException - if the given stream reader cannot be converted to an object

unmarshalInputStream

protected abstract Object unmarshalInputStream(InputStream inputStream)
                                        throws XmlMappingException,
                                               IOException
Abstract template method for unmarshalling from a given InputStream.

Parameters:
inputStream - the InputStreamStream to read from
Returns:
the object graph
Throws:
XmlMappingException - if the given stream cannot be converted to an object
IOException - if an I/O exception occurs

unmarshalReader

protected abstract Object unmarshalReader(Reader reader)
                                   throws XmlMappingException,
                                          IOException
Abstract template method for unmarshalling from a given Reader.

Parameters:
reader - the Reader to read from
Returns:
the object graph
Throws:
XmlMappingException - if the given reader cannot be converted to an object
IOException - if an I/O exception occurs

unmarshalSaxReader

protected abstract Object unmarshalSaxReader(XMLReader xmlReader,
                                             InputSource inputSource)
                                      throws XmlMappingException,
                                             IOException
Abstract template method for unmarshalling using a given SAX XMLReader and InputSource.

Parameters:
xmlReader - the SAX XMLReader to parse with
inputSource - the input source to parse from
Returns:
the object graph
Throws:
XmlMappingException - if the given reader and input source cannot be converted to an object
IOException - if an I/O exception occurs
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


MarshallingSource

org.springframework.oxm.support
Class MarshallingSource

java.lang.Object
    extended by  javax.xml.transform.sax.SAXSource
        extended by  org.springframework.oxm.support.MarshallingSource
All Implemented Interfaces:
Source
public class MarshallingSource
extends SAXSource

Source implementation that uses a Marshaller.Can be constructed with a Marshaller and an object to be marshalled.

Even though MarshallingSource extends from SAXSource, calling the methods of SAXSource is not supported. In general, the only supported operation on this class is to use the XMLReader obtained via SAXSource.getXMLReader() to parse the input source obtained via SAXSource.getInputSource(). Calling setXMLReader(XMLReader) or setInputSource(InputSource) will result in UnsupportedOperationExceptions.

Since:
3.0
Author:
Arjen Poutsma
See Also:
Transformer

Field Summary
Fields inherited from class javax.xml.transform.sax.SAXSource
FEATURE
Constructor Summary
MarshallingSource(Marshaller marshaller, Object content)
Create a new MarshallingSource with the given marshaller and content.
Method Summary
Object | getContent() Return the object to be marshalled.
Marshaller | getMarshaller() Return the Marshaller used by this MarshallingSource.
void | setInputSource(InputSource inputSource) Throws a UnsupportedOperationException.
void | setXMLReader(XMLReader reader) Throws a UnsupportedOperationException.
Methods inherited from class javax.xml.transform.sax.SAXSource
getInputSource, getSystemId, getXMLReader, setSystemId, sourceToInputSource
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MarshallingSource

public MarshallingSource(Marshaller marshaller,
                         Object content)
Create a new MarshallingSource with the given marshaller and content.

Parameters:
marshaller - the marshaller to use
content - the object to be marshalled
Method Detail

getMarshaller

public Marshaller getMarshaller()
Return the Marshaller used by this MarshallingSource.

getContent

public Object getContent()
Return the object to be marshalled.

setInputSource

public void setInputSource(InputSource inputSource)
Throws a UnsupportedOperationException.

Overrides:
setInputSource in class SAXSource

setXMLReader

public void setXMLReader(XMLReader reader)
Throws a UnsupportedOperationException.

Overrides:
setXMLReader in class SAXSource
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SaxResourceUtils

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.oxm.support
Class SaxResourceUtils

java.lang.Object
    extended by  org.springframework.oxm.support.SaxResourceUtils

public abstract class SaxResourceUtils
extends Object

Convenient utility methods for dealing with SAX.

Since:
3.0
Author:
Arjen Poutsma, Juergen Hoeller

Constructor Summary
SaxResourceUtils()
Method Summary
static InputSource createInputSource(Resource resource)
Create a SAX InputSource from the given resource.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SaxResourceUtils

public SaxResourceUtils()
Method Detail

createInputSource

public static InputSource createInputSource(Resource resource)
                                     throws IOException
Create a SAX InputSource from the given resource.

Sets the system identifier to the resource's URL, if available.

Parameters:
resource - the resource
Returns:
the input source created from the resource
Throws:
IOException - if an I/O exception occurs
See Also:
InputSource.setSystemId(String), getSystemId(org.springframework.core.io.Resource)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.oxm.xmlbeans

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.oxm.xmlbeans

Package providing integration of XMLBeans with Springs O/X Mapping support

See:
Description

Class Summary
XmlBeansMarshaller | Implementation of the Marshaller interface for Apache XMLBeans.
XmlOptionsFactoryBean | FactoryBean that configures an XMLBeans XmlOptions object and provides it as a bean reference.

Package org.springframework.oxm.xmlbeans Description

Package providing integration of XMLBeans with Springs O/X Mapping support


org.springframework.oxm.xmlbeans Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.oxm.xmlbeans

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.oxm.support.AbstractMarshaller (implements org.springframework.oxm.Marshaller, org.springframework.oxm.Unmarshaller)
      • org.springframework.oxm.xmlbeans.XmlBeansMarshaller
    • org.springframework.oxm.xmlbeans.XmlOptionsFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>)


XmlBeansMarshaller

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.oxm.xmlbeans
Class XmlBeansMarshaller

java.lang.Object
    extended by  org.springframework.oxm.support.AbstractMarshaller
        extended by  org.springframework.oxm.xmlbeans.XmlBeansMarshaller
All Implemented Interfaces:
Marshaller, Unmarshaller
public class XmlBeansMarshaller
extends AbstractMarshaller

Implementation of the Marshaller interface for Apache XMLBeans.

Options can be set by setting the xmlOptions property. The XmlOptionsFactoryBean is provided to easily set up an XmlOptions instance.

Unmarshalled objects can be validated by setting the validating property, or by calling the validate(XmlObject) method directly. Invalid objects will result in an ValidationFailureException.

NOTE: Due to the nature of XMLBeans, this marshaller requires all passed objects to be of type XmlObject.

Since:
3.0
Author:
Arjen Poutsma
See Also:
setValidating(boolean), setXmlOptions(org.apache.xmlbeans.XmlOptions), XmlOptionsFactoryBean

Field Summary
Fields inherited from class org.springframework.oxm.support.AbstractMarshaller
logger
Constructor Summary
XmlBeansMarshaller()
Method Summary
protected XmlMappingException | convertXmlBeansException(Exception ex, boolean marshalling) Convert the given XMLBeans exception to an appropriate exception from the org.springframework.oxm hierarchy.
org.apache.xmlbeans.XmlOptions | getXmlOptions() Return the XmlOptions.
boolean | isValidating() Return whether this marshaller should validate in- and outgoing documents.
protected void | marshalDomNode(Object graph, Node node) Abstract template method for marshalling the given object graph to a DOM Node.
protected void | marshalOutputStream(Object graph, OutputStream outputStream) Abstract template method for marshalling the given object graph to a OutputStream.
protected void | marshalSaxHandlers(Object graph, ContentHandler contentHandler, LexicalHandler lexicalHandler) Abstract template method for marshalling the given object graph to a SAX ContentHandler.
protected void | marshalWriter(Object graph, Writer writer) Abstract template method for marshalling the given object graph to a Writer.
protected void | marshalXmlEventWriter(Object graph, XMLEventWriter eventWriter) Abstract template method for marshalling the given object to a StAX XMLEventWriter.
protected void | marshalXmlStreamWriter(Object graph, XMLStreamWriter streamWriter) Abstract template method for marshalling the given object to a StAX XMLStreamWriter.
void | setValidating(boolean validating) Set whether this marshaller should validate in- and outgoing documents.
void | setXmlOptions(org.apache.xmlbeans.XmlOptions xmlOptions) Set the XmlOptions.
boolean | supports(Class<?> clazz) This implementation returns true if the given class is an implementation of XmlObject.
protected Object | unmarshalDomNode(Node node) Abstract template method for unmarshalling from a given DOM Node.
protected Object | unmarshalInputStream(InputStream inputStream) Abstract template method for unmarshalling from a given InputStream.
protected Object | unmarshalReader(Reader reader) Abstract template method for unmarshalling from a given Reader.
protected Object | unmarshalSaxReader(XMLReader xmlReader, InputSource inputSource) Abstract template method for unmarshalling using a given SAX XMLReader and InputSource.
protected Object | unmarshalXmlEventReader(XMLEventReader eventReader) Abstract template method for unmarshalling from a given Stax XMLEventReader.
protected Object | unmarshalXmlStreamReader(XMLStreamReader streamReader) Abstract template method for unmarshalling from a given Stax XMLStreamReader.
protected void | validate(org.apache.xmlbeans.XmlObject object) Validate the given XmlObject.
Methods inherited from class org.springframework.oxm.support.AbstractMarshaller
createDocumentBuilder, createDocumentBuilderFactory, createXmlReader, marshal, marshalDomResult, marshalSaxResult, marshalStaxResult, marshalStreamResult, unmarshal, unmarshalDomSource, unmarshalSaxSource, unmarshalStaxSource, unmarshalStreamSource
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

XmlBeansMarshaller

public XmlBeansMarshaller()
Method Detail

setXmlOptions

public void setXmlOptions(org.apache.xmlbeans.XmlOptions xmlOptions)
Set the XmlOptions.

See Also:
XmlOptionsFactoryBean

getXmlOptions

public org.apache.xmlbeans.XmlOptions getXmlOptions()
Return the XmlOptions.

setValidating

public void setValidating(boolean validating)
Set whether this marshaller should validate in- and outgoing documents. Default is false.

isValidating

public boolean isValidating()
Return whether this marshaller should validate in- and outgoing documents.

supports

public boolean supports(Class<?> clazz)
This implementation returns true if the given class is an implementation of XmlObject.

Parameters:
clazz - the class that this marshaller is being asked if it can marshal
Returns:
true if this marshaller can indeed marshal instances of the supplied class; false otherwise

marshalDomNode

protected final void marshalDomNode(Object graph,
                                    Node node)
                             throws XmlMappingException
Description copied from class: AbstractMarshaller
Abstract template method for marshalling the given object graph to a DOM Node.

In practice, node is be a Document node, a DocumentFragment node, or a Element node. In other words, a node that accepts children.

Specified by:
marshalDomNode in class AbstractMarshaller
Parameters:
graph - the root of the object graph to marshal
node - the DOM node that will contain the result tree
Throws:
XmlMappingException - if the given object cannot be marshalled to the DOM node
See Also:
Document, DocumentFragment, Element

marshalOutputStream

protected final void marshalOutputStream(Object graph,
                                         OutputStream outputStream)
                                  throws XmlMappingException,
                                         IOException
Description copied from class: AbstractMarshaller
Abstract template method for marshalling the given object graph to a OutputStream.

Specified by:
marshalOutputStream in class AbstractMarshaller
Parameters:
graph - the root of the object graph to marshal
outputStream - the OutputStream to write to
Throws:
XmlMappingException - if the given object cannot be marshalled to the writer
IOException - if an I/O exception occurs

marshalSaxHandlers

protected final void marshalSaxHandlers(Object graph,
                                        ContentHandler contentHandler,
                                        LexicalHandler lexicalHandler)
                                 throws XmlMappingException
Description copied from class: AbstractMarshaller
Abstract template method for marshalling the given object graph to a SAX ContentHandler.

Specified by:
marshalSaxHandlers in class AbstractMarshaller
Parameters:
graph - the root of the object graph to marshal
contentHandler - the SAX ContentHandler
lexicalHandler - the SAX2 LexicalHandler. Can be null.
Throws:
XmlMappingException - if the given object cannot be marshalled to the handlers

marshalWriter

protected final void marshalWriter(Object graph,
                                   Writer writer)
                            throws XmlMappingException,
                                   IOException
Description copied from class: AbstractMarshaller
Abstract template method for marshalling the given object graph to a Writer.

Specified by:
marshalWriter in class AbstractMarshaller
Parameters:
graph - the root of the object graph to marshal
writer - the Writer to write to
Throws:
XmlMappingException - if the given object cannot be marshalled to the writer
IOException - if an I/O exception occurs

marshalXmlEventWriter

protected final void marshalXmlEventWriter(Object graph,
                                           XMLEventWriter eventWriter)
Description copied from class: AbstractMarshaller
Abstract template method for marshalling the given object to a StAX XMLEventWriter.

Specified by:
marshalXmlEventWriter in class AbstractMarshaller
Parameters:
graph - the root of the object graph to marshal
eventWriter - the XMLEventWriter to write to

marshalXmlStreamWriter

protected final void marshalXmlStreamWriter(Object graph,
                                            XMLStreamWriter streamWriter)
                                     throws XmlMappingException
Description copied from class: AbstractMarshaller
Abstract template method for marshalling the given object to a StAX XMLStreamWriter.

Specified by:
marshalXmlStreamWriter in class AbstractMarshaller
Parameters:
graph - the root of the object graph to marshal
streamWriter - the XMLStreamWriter to write to
Throws:
XmlMappingException - if the given object cannot be marshalled to the DOM node

unmarshalDomNode

protected final Object unmarshalDomNode(Node node)
                                 throws XmlMappingException
Description copied from class: AbstractMarshaller
Abstract template method for unmarshalling from a given DOM Node.

Specified by:
unmarshalDomNode in class AbstractMarshaller
Parameters:
node - the DOM node that contains the objects to be unmarshalled
Returns:
the object graph
Throws:
XmlMappingException - if the given DOM node cannot be mapped to an object

unmarshalInputStream

protected final Object unmarshalInputStream(InputStream inputStream)
                                     throws XmlMappingException,
                                            IOException
Description copied from class: AbstractMarshaller
Abstract template method for unmarshalling from a given InputStream.

Specified by:
unmarshalInputStream in class AbstractMarshaller
Parameters:
inputStream - the InputStreamStream to read from
Returns:
the object graph
Throws:
XmlMappingException - if the given stream cannot be converted to an object
IOException - if an I/O exception occurs

unmarshalReader

protected final Object unmarshalReader(Reader reader)
                                throws XmlMappingException,
                                       IOException
Description copied from class: AbstractMarshaller
Abstract template method for unmarshalling from a given Reader.

Specified by:
unmarshalReader in class AbstractMarshaller
Parameters:
reader - the Reader to read from
Returns:
the object graph
Throws:
XmlMappingException - if the given reader cannot be converted to an object
IOException - if an I/O exception occurs

unmarshalSaxReader

protected final Object unmarshalSaxReader(XMLReader xmlReader,
                                          InputSource inputSource)
                                   throws XmlMappingException,
                                          IOException
Description copied from class: AbstractMarshaller
Abstract template method for unmarshalling using a given SAX XMLReader and InputSource.

Specified by:
unmarshalSaxReader in class AbstractMarshaller
Parameters:
xmlReader - the SAX XMLReader to parse with
inputSource - the input source to parse from
Returns:
the object graph
Throws:
XmlMappingException - if the given reader and input source cannot be converted to an object
IOException - if an I/O exception occurs

unmarshalXmlEventReader

protected final Object unmarshalXmlEventReader(XMLEventReader eventReader)
                                        throws XmlMappingException
Description copied from class: AbstractMarshaller
Abstract template method for unmarshalling from a given Stax XMLEventReader.

Specified by:
unmarshalXmlEventReader in class AbstractMarshaller
Parameters:
eventReader - the XMLEventReader to read from
Returns:
the object graph
Throws:
XmlMappingException - if the given event reader cannot be converted to an object

unmarshalXmlStreamReader

protected final Object unmarshalXmlStreamReader(XMLStreamReader streamReader)
                                         throws XmlMappingException
Description copied from class: AbstractMarshaller
Abstract template method for unmarshalling from a given Stax XMLStreamReader.

Specified by:
unmarshalXmlStreamReader in class AbstractMarshaller
Parameters:
streamReader - the XMLStreamReader to read from
Returns:
the object graph
Throws:
XmlMappingException - if the given stream reader cannot be converted to an object

validate

protected void validate(org.apache.xmlbeans.XmlObject object)
                 throws ValidationFailureException
Validate the given XmlObject.

Parameters:
object - the xml object to validate
Throws:
ValidationFailureException - if the given object is not valid

convertXmlBeansException

protected XmlMappingException convertXmlBeansException(Exception ex,
                                                       boolean marshalling)
Convert the given XMLBeans exception to an appropriate exception from the org.springframework.oxm hierarchy.

A boolean flag is used to indicate whether this exception occurs during marshalling or unmarshalling, since XMLBeans itself does not make this distinction in its exception hierarchy.

Parameters:
ex - XMLBeans Exception that occured
marshalling - indicates whether the exception occurs during marshalling (true), or unmarshalling (false)
Returns:
the corresponding XmlMappingException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


XmlOptionsFactoryBean

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.oxm.xmlbeans
Class XmlOptionsFactoryBean

java.lang.Object
    extended by  org.springframework.oxm.xmlbeans.XmlOptionsFactoryBean
All Implemented Interfaces:
FactoryBean<org.apache.xmlbeans.XmlOptions>
public class XmlOptionsFactoryBean
extends Object
implements FactoryBean<org.apache.xmlbeans.XmlOptions>

FactoryBean that configures an XMLBeans XmlOptions object and provides it as a bean reference.

Typical usage will be to set XMLBeans options on this bean, and refer to it in the XmlBeansMarshaller.

Since:
3.0
Author:
Arjen Poutsma
See Also:
XmlOptions, setOptions(java.util.Map), XmlBeansMarshaller.setXmlOptions(XmlOptions)

Constructor Summary
XmlOptionsFactoryBean()
Method Summary
 org.apache.xmlbeans.XmlOptions getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<? extends org.apache.xmlbeans.XmlOptions> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setOptions(Map<String,?> optionsMap)
Set options on the underlying XmlOptions object.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

XmlOptionsFactoryBean

public XmlOptionsFactoryBean()
Method Detail

setOptions

public void setOptions(Map<String,?> optionsMap)
Set options on the underlying XmlOptions object.

The keys of the supplied map should be one of the String constants defined in XmlOptions, the values vary per option.

See Also:
XmlOptions.put(Object,Object), XmlOptions.SAVE_PRETTY_PRINT, XmlOptions.LOAD_STRIP_COMMENTS

getObject

public org.apache.xmlbeans.XmlOptions getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<org.apache.xmlbeans.XmlOptions>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends org.apache.xmlbeans.XmlOptions> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<org.apache.xmlbeans.XmlOptions>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<org.apache.xmlbeans.XmlOptions>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.oxm.xstream

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.oxm.xstream

Package providing integration of XStream with Springs O/X Mapping support

See:
Description

Class Summary
XStreamMarshaller Implementation of the Marshaller interface for XStream.

Package org.springframework.oxm.xstream Description

Package providing integration of XStream with Springs O/X Mapping support


org.springframework.oxm.xstream Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.oxm.xstream

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.oxm.support.AbstractMarshaller (implements org.springframework.oxm.Marshaller, org.springframework.oxm.Unmarshaller)
      • org.springframework.oxm.xstream.XStreamMarshaller (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.InitializingBean)


XStreamMarshaller

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.oxm.xstream
Class XStreamMarshaller

java.lang.Object
    extended by  org.springframework.oxm.support.AbstractMarshaller
        extended by  org.springframework.oxm.xstream.XStreamMarshaller
All Implemented Interfaces:
BeanClassLoaderAware, InitializingBean, Marshaller, Unmarshaller
public class XStreamMarshaller
extends AbstractMarshaller
implements InitializingBean, BeanClassLoaderAware

Implementation of the Marshaller interface for XStream.

By default, XStream does not require any further configuration, though class aliases can be used to have more control over the behavior of XStream.

Due to XStream's API, it is required to set the encoding used for writing to OutputStreams. It defaults to UTF-8.

NOTE: XStream is an XML serialization library, not a data binding library. Therefore, it has limited namespace support. As such, it is rather unsuitable for usage within Web services.

Since:
3.0
Author:
Peter Meijer, Arjen Poutsma
See Also:
setAliases(java.util.Map),
setConverters(com.thoughtworks.xstream.converters.ConverterMatcher[]),
setEncoding(java.lang.String)

Field Summary
static String DEFAULT_ENCODING
The default encoding used for stream access: UTF-8.
Fields inherited from class org.springframework.oxm.support.AbstractMarshaller
logger
Constructor Summary
XStreamMarshaller()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected XmlMappingException | convertXStreamException(Exception ex, boolean marshalling) Convert the given XStream exception to an appropriate exception from the org.springframework.oxm hierarchy.
protected void | customizeXStream(com.thoughtworks.xstream.XStream xstream) Template to allow for customizing of the given XStream.
com.thoughtworks.xstream.XStream | getXStream() Returns the XStream instance used by this marshaller.
protected void | marshalDomNode(Object graph, Node node) Abstract template method for marshalling the given object graph to a DOM Node.
protected void | marshalOutputStream(Object graph, OutputStream outputStream) Abstract template method for marshalling the given object graph to a OutputStream.
protected void | marshalSaxHandlers(Object graph, ContentHandler contentHandler, LexicalHandler lexicalHandler) Abstract template method for marshalling the given object graph to a SAX ContentHandler.
protected void | marshalWriter(Object graph, Writer writer) Abstract template method for marshalling the given object graph to a Writer.
protected void | marshalXmlEventWriter(Object graph, XMLEventWriter eventWriter) Abstract template method for marshalling the given object to a StAX XMLEventWriter.
protected void | marshalXmlStreamWriter(Object graph, XMLStreamWriter streamWriter) Abstract template method for marshalling the given object to a StAX XMLStreamWriter.
void | setAliases(Map<String,?> aliases) Sets an alias/type map, consisting of string aliases mapped to classes.
void | setAnnotatedClass(Class<?> annotatedClass) Set the classes for which mappings will be read from class-level JDK 1.5+ annotation metadata.
void | setAnnotatedClasses(Class<?>[] annotatedClasses) Set annotated classes for which aliases will be read from class-level JDK 1.5+ annotation metadata.
void | setAutodetectAnnotations(boolean autodetectAnnotations) Set the auto-detection mode of XStream.
void | setBeanClassLoader(ClassLoader classLoader) Callback that supplies the bean class loader to a bean instance.
void | setConverters(com.thoughtworks.xstream.converters.ConverterMatcher[] converters) Set the Converters or SingleValueConverters to be registered with the XStream instance.
void | setEncoding(String encoding) Set the encoding to be used for stream access.
void | setFieldAliases(Map<String,String> aliases) Sets a field alias/type map, consiting of field names
void | setImplicitCollections(Map<Class<?>,String> implicitCollections) Specify implicit collection fields, as a Map consisting of Class instances mapped to comma separated collection field names.
void | setMode(int mode) Set the XStream mode.
void | setOmittedFields(Map<Class<?>,String> omittedFields) Specify omitted fields, as a Map consisting of Class instances mapped to comma separated field names.
void | setStreamDriver(com.thoughtworks.xstream.io.HierarchicalStreamDriver streamDriver) Set the XStream hierarchical stream driver to be used with stream readers and writers.
void | setSupportedClasses(Class[] supportedClasses) Set the classes supported by this marshaller.
void | setUseAttributeFor(Map<?,?> attributes) Set the types to use XML attributes for.
void | setUseAttributeForTypes(Class[] types) Set types to use XML attributes for.
boolean | supports(Class clazz) Indicates whether this marshaller can marshal instances of the supplied type.
protected Object | unmarshalDomNode(Node node) Abstract template method for unmarshalling from a given DOM Node.
protected Object | unmarshalInputStream(InputStream inputStream) Abstract template method for unmarshalling from a given InputStream.
protected Object | unmarshalReader(Reader reader) Abstract template method for unmarshalling from a given Reader.
protected Object | unmarshalSaxReader(XMLReader xmlReader, InputSource inputSource) Abstract template method for unmarshalling using a given SAX XMLReader and InputSource.
protected Object | unmarshalXmlEventReader(XMLEventReader eventReader) Abstract template method for unmarshalling from a given Stax XMLEventReader.
protected Object | unmarshalXmlStreamReader(XMLStreamReader streamReader) Abstract template method for unmarshalling from a given Stax XMLStreamReader.
Methods inherited from class org.springframework.oxm.support.AbstractMarshaller
createDocumentBuilder, createDocumentBuilderFactory, createXmlReader, marshal, marshalDomResult, marshalSaxResult, marshalStaxResult, marshalStreamResult, unmarshal, unmarshalDomSource, unmarshalSaxSource, unmarshalStaxSource, unmarshalStreamSource
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_ENCODING

public static final String DEFAULT_ENCODING
The default encoding used for stream access: UTF-8.

See Also:
Constant Field Values
Constructor Detail

XStreamMarshaller

public XStreamMarshaller()
Method Detail

getXStream

public com.thoughtworks.xstream.XStream getXStream()
Returns the XStream instance used by this marshaller.

setMode

public void setMode(int mode)
Set the XStream mode.

See Also:
XStream.XPATH_REFERENCES, XStream.ID_REFERENCES, XStream.NO_REFERENCES

setConverters

public void setConverters(com.thoughtworks.xstream.converters.ConverterMatcher[] converters)
Set the Converters or SingleValueConverters to be registered with the XStream instance.

See Also:
Converter, SingleValueConverter

setAliases

public void setAliases(Map<String,?> aliases)
                throws ClassNotFoundException
Sets an alias/type map, consisting of string aliases mapped to classes. Keys are aliases; values are either Class instances, or String class names.

Throws:
ClassNotFoundException
See Also:
XStream.alias(String, Class)

setFieldAliases

public void setFieldAliases(Map<String,String> aliases)
                     throws ClassNotFoundException,
                            NoSuchFieldException
Sets a field alias/type map, consiting of field names

Parameters:
aliases -
Throws:
ClassNotFoundException
NoSuchFieldException
See Also:
XStream.aliasField(String, Class, String)

setUseAttributeForTypes

public void setUseAttributeForTypes(Class[] types)
Set types to use XML attributes for.

See Also:
XStream.useAttributeFor(Class)

setUseAttributeFor

public void setUseAttributeFor(Map<?,?> attributes)
Set the types to use XML attributes for. The given map can contain either <String, Class> pairs, in which case XStream.useAttributeFor(String, Class) is called, or <Class, String> pairs, which results in XStream.useAttributeFor(Class, String) calls.

setImplicitCollections

public void setImplicitCollections(Map<Class<?>,String> implicitCollections)
Specify implicit collection fields, as a Map consisting of Class instances mapped to comma separated collection field names.

See Also:
XStream.addImplicitCollection(Class, String)

setOmittedFields

public void setOmittedFields(Map<Class<?>,String> omittedFields)
Specify omitted fields, as a Map consisting of Class instances mapped to comma separated field names.

See Also:
XStream.omitField(Class, String)

setAnnotatedClass

public void setAnnotatedClass(Class<?> annotatedClass)
Set the classes for which mappings will be read from class-level JDK 1.5+ annotation metadata.

See Also:
XStream.processAnnotations(Class)

setAnnotatedClasses

public void setAnnotatedClasses(Class<?>[] annotatedClasses)
Set annotated classes for which aliases will be read from class-level JDK 1.5+ annotation metadata.

See Also:
XStream.processAnnotations(Class[])

setAutodetectAnnotations

public void setAutodetectAnnotations(boolean autodetectAnnotations)
Set the auto-detection mode of XStream.

Note that auto-detection implies that the XStream is configured while it is processing the XML steams, and thus introduces a potential concurrency problem.

See Also:
XStream.autodetectAnnotations(boolean)

setStreamDriver

public void setStreamDriver(com.thoughtworks.xstream.io.HierarchicalStreamDriver streamDriver)
Set the XStream hierarchical stream driver to be used with stream readers and writers.

setEncoding

public void setEncoding(String encoding)
Set the encoding to be used for stream access.

See Also:
DEFAULT_ENCODING

setSupportedClasses

public void setSupportedClasses(Class[] supportedClasses)
Set the classes supported by this marshaller.

If this property is empty (the default), all classes are supported.

See Also:
supports(Class)

afterPropertiesSet

public final void afterPropertiesSet()
                              throws Exception
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception - in the event of misconfiguration (such as failure to set an essential property) or if initialization fails.

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

customizeXStream

protected void customizeXStream(com.thoughtworks.xstream.XStream xstream)
Template to allow for customizing of the given XStream.

Default implementation is empty.

Parameters:
xstream - the XStream instance

supports

public boolean supports(Class clazz)
Description copied from interface: Marshaller
Indicates whether this marshaller can marshal instances of the supplied type.

Specified by:
supports in interface Marshaller
Specified by:
supports in interface Unmarshaller
Parameters:
clazz - the class that this marshaller is being asked if it can marshal
Returns:
true if this marshaller can indeed marshal instances of the supplied class; false otherwise

marshalDomNode

protected void marshalDomNode(Object graph,
                              Node node)
                       throws XmlMappingException
Description copied from class: AbstractMarshaller
Abstract template method for marshalling the given object graph to a DOM Node.

In practice, node is be a Document node, a DocumentFragment node, or a Element node. In other words, a node that accepts children.

Specified by:
marshalDomNode in class AbstractMarshaller
Parameters:
graph - the root of the object graph to marshal
node - the DOM node that will contain the result tree
Throws:
XmlMappingException - if the given object cannot be marshalled to the DOM node
See Also:
Document, DocumentFragment, Element

marshalXmlEventWriter

protected void marshalXmlEventWriter(Object graph,
                                     XMLEventWriter eventWriter)
                              throws XmlMappingException
Description copied from class: AbstractMarshaller
Abstract template method for marshalling the given object to a StAX XMLEventWriter.

Specified by:
marshalXmlEventWriter in class AbstractMarshaller
Parameters:
graph - the root of the object graph to marshal
eventWriter - the XMLEventWriter to write to
Throws:
XmlMappingException - if the given object cannot be marshalled to the DOM node

marshalXmlStreamWriter

protected void marshalXmlStreamWriter(Object graph,
                                      XMLStreamWriter streamWriter)
                               throws XmlMappingException
Description copied from class: AbstractMarshaller
Abstract template method for marshalling the given object to a StAX XMLStreamWriter.

Specified by:
marshalXmlStreamWriter in class AbstractMarshaller
Parameters:
graph - the root of the object graph to marshal
streamWriter - the XMLStreamWriter to write to
Throws:
XmlMappingException - if the given object cannot be marshalled to the DOM node

marshalOutputStream

protected void marshalOutputStream(Object graph,
                                   OutputStream outputStream)
                            throws XmlMappingException,
                                   IOException
Description copied from class: AbstractMarshaller
Abstract template method for marshalling the given object graph to a OutputStream.

Specified by:
marshalOutputStream in class AbstractMarshaller
Parameters:
graph - the root of the object graph to marshal
outputStream - the OutputStream to write to
Throws:
XmlMappingException - if the given object cannot be marshalled to the writer
IOException - if an I/O exception occurs

marshalSaxHandlers

protected void marshalSaxHandlers(Object graph,
                                  ContentHandler contentHandler,
                                  LexicalHandler lexicalHandler)
                           throws XmlMappingException
Description copied from class: AbstractMarshaller
Abstract template method for marshalling the given object graph to a SAX ContentHandler.

Specified by:
marshalSaxHandlers in class AbstractMarshaller
Parameters:
graph - the root of the object graph to marshal
contentHandler - the SAX ContentHandler
lexicalHandler - the SAX2 LexicalHandler. Can be null.
Throws:
XmlMappingException - if the given object cannot be marshalled to the handlers

marshalWriter

protected void marshalWriter(Object graph,
                             Writer writer)
                      throws XmlMappingException,
                             IOException
Description copied from class: AbstractMarshaller
Abstract template method for marshalling the given object graph to a Writer.

Specified by:
marshalWriter in class AbstractMarshaller
Parameters:
graph - the root of the object graph to marshal
writer - the Writer to write to
Throws:
XmlMappingException - if the given object cannot be marshalled to the writer
IOException - if an I/O exception occurs

unmarshalDomNode

protected Object unmarshalDomNode(Node node)
                           throws XmlMappingException
Description copied from class: AbstractMarshaller
Abstract template method for unmarshalling from a given DOM Node.

Specified by:
unmarshalDomNode in class AbstractMarshaller
Parameters:
node - the DOM node that contains the objects to be unmarshalled
Returns:
the object graph
Throws:
XmlMappingException - if the given DOM node cannot be mapped to an object

unmarshalXmlEventReader

protected Object unmarshalXmlEventReader(XMLEventReader eventReader)
                                  throws XmlMappingException
Description copied from class: AbstractMarshaller
Abstract template method for unmarshalling from a given Stax XMLEventReader.

Specified by:
unmarshalXmlEventReader in class AbstractMarshaller
Parameters:
eventReader - the XMLEventReader to read from
Returns:
the object graph
Throws:
XmlMappingException - if the given event reader cannot be converted to an object

unmarshalXmlStreamReader

protected Object unmarshalXmlStreamReader(XMLStreamReader streamReader)
                                   throws XmlMappingException
Description copied from class: AbstractMarshaller
Abstract template method for unmarshalling from a given Stax XMLStreamReader.

Specified by:
unmarshalXmlStreamReader in class AbstractMarshaller
Parameters:
streamReader - the XMLStreamReader to read from
Returns:
the object graph
Throws:
XmlMappingException - if the given stream reader cannot be converted to an object

unmarshalInputStream

protected Object unmarshalInputStream(InputStream inputStream)
                               throws XmlMappingException,
                                      IOException
Description copied from class: AbstractMarshaller
Abstract template method for unmarshalling from a given InputStream.

Specified by:
unmarshalInputStream in class AbstractMarshaller
Parameters:
inputStream - the InputStreamStream to read from
Returns:
the object graph
Throws:
XmlMappingException - if the given stream cannot be converted to an object
IOException - if an I/O exception occurs

unmarshalReader

protected Object unmarshalReader(Reader reader)
                          throws XmlMappingException,
                                 IOException
Description copied from class: AbstractMarshaller
Abstract template method for unmarshalling from a given Reader.

Specified by:
unmarshalReader in class AbstractMarshaller
Parameters:
reader - the Reader to read from
Returns:
the object graph
Throws:
XmlMappingException - if the given reader cannot be converted to an object
IOException - if an I/O exception occurs

unmarshalSaxReader

protected Object unmarshalSaxReader(XMLReader xmlReader,
                                    InputSource inputSource)
                             throws XmlMappingException,
                                    IOException
Description copied from class: AbstractMarshaller
Abstract template method for unmarshalling using a given SAX XMLReader and InputSource.

Specified by:
unmarshalSaxReader in class AbstractMarshaller
Parameters:
xmlReader - the SAX XMLReader to parse with
inputSource - the input source to parse from
Returns:
the object graph
Throws:
XmlMappingException - if the given reader and input source cannot be converted to an object
IOException - if an I/O exception occurs

convertXStreamException

protected XmlMappingException convertXStreamException(Exception ex,
                                                      boolean marshalling)
Convert the given XStream exception to an appropriate exception from the org.springframework.oxm hierarchy.

A boolean flag is used to indicate whether this exception occurs during marshalling or unmarshalling, since XStream itself does not make this distinction in its exception hierarchy.

Parameters:
ex - XStream exception that occured
marshalling - indicates whether the exception occurs during marshalling (true), or unmarshalling (false)
Returns:
the corresponding XmlMappingException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.remoting

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.remoting

Exception hierarchy for Spring's remoting infrastructure, independent of any specific remote method invocation system.

See:
Description

Exception Summary
RemoteAccessException | Generic remote access exception.
RemoteConnectFailureException | RemoteAccessException subclass to be thrown when no connection could be established with a remote service.
RemoteInvocationFailureException | RemoteAccessException subclass to be thrown when the execution of the target method failed on the server side, for example when a method was not found on the target object.
RemoteLookupFailureException | RemoteAccessException subclass to be thrown in case of a lookup failure, typically if the lookup happens on demand for each method invocation.
RemoteProxyFailureException | RemoteAccessException subclass to be thrown in case of a failure within the client-side proxy for a remote service, for example when a method was not found on the underlying RMI stub.

Package org.springframework.remoting Description

Exception hierarchy for Spring's remoting infrastructure, independent of any specific remote method invocation system.


org.springframework.remoting Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.remoting

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.remoting.RemoteAccessException
              • org.springframework.remoting.RemoteConnectFailureException
              • org.springframework.remoting.RemoteInvocationFailureException
              • org.springframework.remoting.RemoteLookupFailureException
              • org.springframework.remoting.RemoteProxyFailureException


RemoteAccessException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.remoting
Class RemoteAccessException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.remoting.RemoteAccessException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
RemoteConnectFailureException, RemoteInvocationFailureException, RemoteLookupFailureException, RemoteProxyFailureException
public class RemoteAccessException
extends NestedRuntimeException

Generic remote access exception. A service proxy for any remoting protocol should throw this exception or subclasses of it, in order to transparently expose a plain Java business interface.

When using conforming proxies, switching the actual remoting protocol e.g. from Hessian to Burlap does not affect client code. Clients work with a plain natural Java business interface that the service exposes. A client object simply receives an implementation for the interface that it needs via a bean reference, like it does for a local bean as well.

A client may catch RemoteAccessException if it wants to, but as remote access errors are typically unrecoverable, it will probably let such exceptions propagate to a higher level that handles them generically. In this case, the client code doesn't show any signs of being involved in remote access, as there aren't any remoting-specific dependencies.

Even when switching from a remote service proxy to a local implementation of the same interface, this amounts to just a matter of configuration. Obviously, the client code should be somewhat aware that it might be working against a remote service, for example in terms of repeated method calls that cause unnecessary roundtrips etc. However, it doesn't have to be aware whether it is actually working against a remote service or a local implementation, or with which remoting protocol it is working under the hood.

Since:
14.05.2003
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
RemoteAccessException(String msg)
Constructor for RemoteAccessException.
RemoteAccessException(String msg, Throwable cause)
Constructor for RemoteAccessException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

RemoteAccessException

public RemoteAccessException(String msg)
Constructor for RemoteAccessException.

Parameters:
msg - the detail message

RemoteAccessException

public RemoteAccessException(String msg,
                             Throwable cause)
Constructor for RemoteAccessException.

Parameters:
msg - the detail message
cause - the root cause (usually from using an underlying remoting API such as RMI)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


RemoteConnectFailureException

org.springframework.remoting
Class RemoteConnectFailureException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.remoting.RemoteAccessException
                        extended by  org.springframework.remoting.RemoteConnectFailureException
All Implemented Interfaces:
Serializable
public class RemoteConnectFailureException
extends RemoteAccessException

RemoteAccessException subclass to be thrown when no connection could be established with a remote service.

Since:
1.1
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
RemoteConnectFailureException(String msg, Throwable cause)
Constructor for RemoteConnectFailureException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

RemoteConnectFailureException

public RemoteConnectFailureException(String msg,
                                     Throwable cause)
Constructor for RemoteConnectFailureException.

Parameters:
msg - the detail message
cause - the root cause from the remoting API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RemoteInvocationFailureException

org.springframework.remoting
Class RemoteInvocationFailureException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.remoting.RemoteAccessException
                        extended by  org.springframework.remoting.RemoteInvocationFailureException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
SoapFaultException
public class RemoteInvocationFailureException
extends RemoteAccessException

RemoteAccessException subclass to be thrown when the execution of the target method failed on the server side, for example when a method was not found on the target object.

Since:
2.5
Author:
Juergen Hoeller
See Also:
RemoteProxyFailureException, Serialized Form

Constructor Summary
RemoteInvocationFailureException(String msg, Throwable cause)
Constructor for RemoteInvocationFailureException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

RemoteInvocationFailureException

public RemoteInvocationFailureException(String msg,
                                        Throwable cause)
Constructor for RemoteInvocationFailureException.

Parameters:
msg - the detail message
cause - the root cause from the remoting API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RemoteLookupFailureException

org.springframework.remoting
Class RemoteLookupFailureException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.remoting.RemoteAccessException
                        extended by  org.springframework.remoting.RemoteLookupFailureException
All Implemented Interfaces:
Serializable
public class RemoteLookupFailureException
extends RemoteAccessException

RemoteAccessException subclass to be thrown in case of a lookup failure, typically if the lookup happens on demand for each method invocation.

Since:
1.1
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
RemoteLookupFailureException(String msg)
Constructor for RemoteLookupFailureException.
RemoteLookupFailureException(String msg, Throwable cause)
Constructor for RemoteLookupFailureException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

RemoteLookupFailureException

public RemoteLookupFailureException(String msg)
Constructor for RemoteLookupFailureException.

Parameters:
msg - the detail message

RemoteLookupFailureException

public RemoteLookupFailureException(String msg,
                                    Throwable cause)
Constructor for RemoteLookupFailureException.

Parameters:
msg - message
cause - the root cause from the remoting API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RemoteProxyFailureException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.remoting
Class RemoteProxyFailureException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.remoting.RemoteAccessException
                        extended by  org.springframework.remoting.RemoteProxyFailureException
All Implemented Interfaces:
Serializable
public class RemoteProxyFailureException
extends RemoteAccessException

RemoteAccessException subclass to be thrown in case of a failure within the client-side proxy for a remote service, for example when a method was not found on the underlying RMI stub.

Since:
1.2.8
Author:
Juergen Hoeller
See Also:
RemoteInvocationFailureException, Serialized Form

Constructor Summary
RemoteProxyFailureException(String msg, Throwable cause)
Constructor for RemoteProxyFailureException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

RemoteProxyFailureException

public RemoteProxyFailureException(String msg,
                                   Throwable cause)
Constructor for RemoteProxyFailureException.

Parameters:
msg - the detail message
cause - the root cause from the remoting API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.remoting.caucho

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.remoting.caucho

This package provides remoting classes for Caucho's Hessian and Burlap protocols: a proxy factory for accessing Hessian/Burlap services, and an exporter for making beans available to Hessian/Burlap clients.

See:
Description

Class Summary
BurlapClientInterceptor | MethodInterceptor for accessing a Burlap service.
BurlapExporter | General stream-based protocol exporter for a Burlap endpoint.
BurlapProxyFactoryBean | FactoryBean for Burlap proxies.
BurlapServiceExporter | Servlet-API-based HTTP request handler that exports the specified service bean as Burlap service endpoint, accessible via a Burlap proxy.
HessianClientInterceptor | MethodInterceptor for accessing a Hessian service.
HessianExporter | General stream-based protocol exporter for a Hessian endpoint.
HessianProxyFactoryBean | FactoryBean for Hessian proxies.
HessianServiceExporter | Servlet-API-based HTTP request handler that exports the specified service bean as Hessian service endpoint, accessible via a Hessian proxy.
SimpleBurlapServiceExporter | HTTP request handler that exports the specified service bean as Burlap service endpoint, accessible via a Burlap proxy.
SimpleHessianServiceExporter | HTTP request handler that exports the specified service bean as Hessian service endpoint, accessible via a Hessian proxy.

Package org.springframework.remoting.caucho Description

This package provides remoting classes for Caucho's Hessian and Burlap protocols: a proxy factory for accessing Hessian/Burlap services, and an exporter for making beans available to Hessian/Burlap clients.

Hessian is a slim, binary RPC protocol over HTTP. For information on Hessian, see the Hessian website

Burlap is a slim, XML-based RPC protocol over HTTP. For information on Burlap, see the Burlap website


org.springframework.remoting.caucho Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.remoting.caucho

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.remoting.support.RemotingSupport (implements org.springframework.beans.factory.BeanClassLoaderAware)
      • org.springframework.remoting.support.RemoteAccessor
        • org.springframework.remoting.support.UrlBasedRemoteAccessor (implements org.springframework.beans.factory.InitializingBean)
          • org.springframework.remoting.caucho.BurlapClientInterceptor (implements org.aopalliance.intercept.MethodInterceptor)
            • org.springframework.remoting.caucho.BurlapProxyFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>)
          • org.springframework.remoting.caucho.HessianClientInterceptor (implements org.aopalliance.intercept.MethodInterceptor)
            • org.springframework.remoting.caucho.HessianProxyFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>)
      • org.springframework.remoting.support.RemoteExporter
        • org.springframework.remoting.caucho.BurlapExporter (implements org.springframework.beans.factory.InitializingBean)
          • org.springframework.remoting.caucho.BurlapServiceExporter (implements org.springframework.web.HttpRequestHandler)
          • org.springframework.remoting.caucho.SimpleBurlapServiceExporter (implements com.sun.net.httpserver.HttpHandler)
        • org.springframework.remoting.caucho.HessianExporter (implements org.springframework.beans.factory.InitializingBean)
          • org.springframework.remoting.caucho.HessianServiceExporter (implements org.springframework.web.HttpRequestHandler)
          • org.springframework.remoting.caucho.SimpleHessianServiceExporter (implements com.sun.net.httpserver.HttpHandler)


BurlapClientInterceptor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.remoting.caucho
Class BurlapClientInterceptor

java.lang.Object
    extended by  org.springframework.remoting.support.RemotingSupport
        extended by  org.springframework.remoting.support.RemoteAccessor
            extended by  org.springframework.remoting.support.UrlBasedRemoteAccessor
                extended by  org.springframework.remoting.caucho.BurlapClientInterceptor
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, BeanClassLoaderAware, InitializingBean
Direct Known Subclasses:
BurlapProxyFactoryBean
public class BurlapClientInterceptor
extends UrlBasedRemoteAccessor
implements MethodInterceptor

MethodInterceptor for accessing a Burlap service. Supports authentication via username and password. The service URL must be an HTTP URL exposing a Burlap service.

Burlap is a slim, XML-based RPC protocol. For information on Burlap, see the Burlap website

Note: There is no requirement for services accessed with this proxy factory to have been exported using Spring's BurlapServiceExporter, as there is no special handling involved. As a consequence, you can also access services that have been exported using Caucho's BurlapServlet.

Since:
29.09.2003
Author:
Juergen Hoeller
See Also:
RemoteAccessor.setServiceInterface(java.lang.Class), UrlBasedRemoteAccessor.setServiceUrl(java.lang.String), setUsername(java.lang.String), setPassword(java.lang.String), BurlapServiceExporter, BurlapProxyFactoryBean, BurlapProxyFactory, BurlapServlet

Field Summary
Fields inherited from class org.springframework.remoting.support.RemotingSupport
logger
Constructor Summary
BurlapClientInterceptor()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected RemoteAccessException | convertBurlapAccessException(Throwable ex) Convert the given Burlap access exception to an appropriate Spring RemoteAccessException.
protected Object | createBurlapProxy(com.caucho.burlap.client.BurlapProxyFactory proxyFactory) Create the Burlap proxy that is wrapped by this interceptor.
Object | invoke(MethodInvocation invocation)
void | prepare() Initialize the Burlap proxy for this interceptor.
void | setOverloadEnabled(boolean overloadEnabled) Set whether overloaded methods should be enabled for remote invocations.
void | setPassword(String password) Set the password that this factory should use to access the remote service.
void | setProxyFactory(com.caucho.burlap.client.BurlapProxyFactory proxyFactory) Set the BurlapProxyFactory instance to use.
void | setUsername(String username) Set the username that this factory should use to access the remote service.
Methods inherited from class org.springframework.remoting.support.UrlBasedRemoteAccessor
getServiceUrl, setServiceUrl
Methods inherited from class org.springframework.remoting.support.RemoteAccessor
getServiceInterface, setServiceInterface
Methods inherited from class org.springframework.remoting.support.RemotingSupport
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BurlapClientInterceptor

public BurlapClientInterceptor()
Method Detail

setProxyFactory

public void setProxyFactory(com.caucho.burlap.client.BurlapProxyFactory proxyFactory)
Set the BurlapProxyFactory instance to use. If not specified, a default BurlapProxyFactory will be created.

Allows to use an externally configured factory instance, in particular a custom BurlapProxyFactory subclass.

setUsername

public void setUsername(String username)
Set the username that this factory should use to access the remote service. Default is none.

The username will be sent by Burlap via HTTP Basic Authentication.

See Also:
BurlapProxyFactory.setUser(java.lang.String)

setPassword

public void setPassword(String password)
Set the password that this factory should use to access the remote service. Default is none.

The password will be sent by Burlap via HTTP Basic Authentication.

See Also:
BurlapProxyFactory.setPassword(java.lang.String)

setOverloadEnabled

public void setOverloadEnabled(boolean overloadEnabled)
Set whether overloaded methods should be enabled for remote invocations. Default is "false".

See Also:
BurlapProxyFactory.setOverloadEnabled(boolean)

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class UrlBasedRemoteAccessor

prepare

public void prepare()
             throws RemoteLookupFailureException
Initialize the Burlap proxy for this interceptor.

Throws:
RemoteLookupFailureException - if the service URL is invalid

createBurlapProxy

protected Object createBurlapProxy(com.caucho.burlap.client.BurlapProxyFactory proxyFactory)
                            throws MalformedURLException
Create the Burlap proxy that is wrapped by this interceptor.

Parameters:
proxyFactory - the proxy factory to use
Returns:
the Burlap proxy
Throws:
MalformedURLException - if thrown by the proxy factory
See Also:
BurlapProxyFactory.create(java.lang.String)

invoke

public Object invoke(MethodInvocation invocation)
              throws Throwable
Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable

convertBurlapAccessException

protected RemoteAccessException convertBurlapAccessException(Throwable ex)
Convert the given Burlap access exception to an appropriate Spring RemoteAccessException.

Parameters:
ex - the exception to convert
Returns:
the RemoteAccessException to throw
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


BurlapExporter

org.springframework.remoting.caucho
Class BurlapExporter

java.lang.Object
    extended by  org.springframework.remoting.support.RemotingSupport
        extended by  org.springframework.remoting.support.RemoteExporter
            extended by  org.springframework.remoting.caucho.BurlapExporter
All Implemented Interfaces:
BeanClassLoaderAware, InitializingBean
Direct Known Subclasses:
BurlapServiceExporter, SimpleBurlapServiceExporter
public class BurlapExporter
extends RemoteExporter
implements InitializingBean

General stream-based protocol exporter for a Burlap endpoint.

Burlap is a slim, XML-based RPC protocol. For information on Burlap, see the Burlap website. This exporter requires Burlap 3.x.

Since:
2.5.1
Author:
Juergen Hoeller
See Also:
invoke(java.io.InputStream, java.io.OutputStream), BurlapServiceExporter, SimpleBurlapServiceExporter

Field Summary
Fields inherited from class org.springframework.remoting.support.RemotingSupport
logger
Constructor Summary
BurlapExporter()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
void | invoke(InputStream inputStream, OutputStream outputStream) Perform an invocation on the exported object.
void | prepare() Initialize this service exporter.
Methods inherited from class org.springframework.remoting.support.RemoteExporter
checkService, checkServiceInterface, getExporterName, getProxyForService, getService, getServiceInterface, setInterceptors, setRegisterTraceInterceptor, setService, setServiceInterface
Methods inherited from class org.springframework.remoting.support.RemotingSupport
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BurlapExporter

public BurlapExporter()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

prepare

public void prepare()
Initialize this service exporter.

invoke

public void invoke(InputStream inputStream,
                   OutputStream outputStream)
            throws Throwable
Perform an invocation on the exported object.

Parameters:
inputStream - the request stream
outputStream - the response stream
Throws:
Throwable - if invocation failed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BurlapProxyFactoryBean

org.springframework.remoting.caucho
Class BurlapProxyFactoryBean

java.lang.Object
    extended by  org.springframework.remoting.support.RemotingSupport
        extended by  org.springframework.remoting.support.RemoteAccessor
            extended by  org.springframework.remoting.support.UrlBasedRemoteAccessor
                extended by  org.springframework.remoting.caucho.BurlapClientInterceptor
                    extended by  org.springframework.remoting.caucho.BurlapProxyFactoryBean
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, BeanClassLoaderAware, FactoryBean<Object>, InitializingBean
public class BurlapProxyFactoryBean
extends BurlapClientInterceptor
implements FactoryBean<Object>

FactoryBean for Burlap proxies. Exposes the proxied service for use as a bean reference, using the specified service interface.

Burlap is a slim, XML-based RPC protocol. For information on Burlap, see the Burlap website

The service URL must be an HTTP URL exposing a Burlap service. For details, see the BurlapClientInterceptor javadoc.

Since:
13.05.2003
Author:
Juergen Hoeller
See Also:
RemoteAccessor.setServiceInterface(java.lang.Class), UrlBasedRemoteAccessor.setServiceUrl(java.lang.String), BurlapClientInterceptor, BurlapServiceExporter, HessianProxyFactoryBean, HttpInvokerProxyFactoryBean, RmiProxyFactoryBean

Field Summary
Fields inherited from class org.springframework.remoting.support.RemotingSupport
logger
Constructor Summary
BurlapProxyFactoryBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 Object getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<?> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
Methods inherited from class org.springframework.remoting.caucho.BurlapClientInterceptor
convertBurlapAccessException, createBurlapProxy, invoke, prepare, setOverloadEnabled, setPassword, setProxyFactory, setUsername
Methods inherited from class org.springframework.remoting.support.UrlBasedRemoteAccessor
getServiceUrl, setServiceUrl
Methods inherited from class org.springframework.remoting.support.RemoteAccessor
getServiceInterface, setServiceInterface
Methods inherited from class org.springframework.remoting.support.RemotingSupport
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BurlapProxyFactoryBean

public BurlapProxyFactoryBean()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class BurlapClientInterceptor

getObject

public Object getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<Object>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<?> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<Object>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<Object>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BurlapServiceExporter

org.springframework.remoting.caucho
Class BurlapServiceExporter

java.lang.Object
    extended by  org.springframework.remoting.support.RemotingSupport
        extended by  org.springframework.remoting.support.RemoteExporter
            extended by  org.springframework.remoting.caucho.BurlapExporter
                extended by  org.springframework.remoting.caucho.BurlapServiceExporter
All Implemented Interfaces:
BeanClassLoaderAware, InitializingBean, HttpRequestHandler
public class BurlapServiceExporter
extends BurlapExporter
implements HttpRequestHandler

Servlet-API-based HTTP request handler that exports the specified service bean as Burlap service endpoint, accessible via a Burlap proxy.

Note: Spring also provides an alternative version of this exporter, for Sun's JRE 1.6 HTTP server: SimpleBurlapServiceExporter.

Burlap is a slim, XML-based RPC protocol. For information on Burlap, see the Burlap website. This exporter requires Burlap 3.x.

Note: Burlap services exported with this class can be accessed by any Burlap client, as there isn't any special handling involved.

Since:
13.05.2003
Author:
Juergen Hoeller
See Also:
BurlapClientInterceptor, BurlapProxyFactoryBean, HessianServiceExporter, HttpInvokerServiceExporter, RmiServiceExporter

Field Summary
Fields inherited from class org.springframework.remoting.support.RemotingSupport
logger
Constructor Summary
BurlapServiceExporter()
Method Summary
 void handleRequest(HttpServletRequest request, HttpServletResponse response)
Processes the incoming Burlap request and creates a Burlap response.
Methods inherited from class org.springframework.remoting.caucho.BurlapExporter
afterPropertiesSet, invoke, prepare
Methods inherited from class org.springframework.remoting.support.RemoteExporter
checkService, checkServiceInterface, getExporterName, getProxyForService, getService, getServiceInterface, setInterceptors, setRegisterTraceInterceptor, setService, setServiceInterface
Methods inherited from class org.springframework.remoting.support.RemotingSupport
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BurlapServiceExporter

public BurlapServiceExporter()
Method Detail

handleRequest

public void handleRequest(HttpServletRequest request,
                          HttpServletResponse response)
                   throws ServletException,
                          IOException
Processes the incoming Burlap request and creates a Burlap response.

Specified by:
handleRequest in interface HttpRequestHandler
Parameters:
request - current HTTP request
response - current HTTP response
Throws:
ServletException - in case of general errors
IOException - in case of I/O errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HessianClientInterceptor

org.springframework.remoting.caucho
Class HessianClientInterceptor

java.lang.Object
    extended by  org.springframework.remoting.support.RemotingSupport
        extended by  org.springframework.remoting.support.RemoteAccessor
            extended by  org.springframework.remoting.support.UrlBasedRemoteAccessor
                extended by  org.springframework.remoting.caucho.HessianClientInterceptor
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, BeanClassLoaderAware, InitializingBean
Direct Known Subclasses:
HessianProxyFactoryBean
public class HessianClientInterceptor
extends UrlBasedRemoteAccessor
implements MethodInterceptor

MethodInterceptor for accessing a Hessian service. Supports authentication via username and password. The service URL must be an HTTP URL exposing a Hessian service.

Hessian is a slim, binary RPC protocol. For information on Hessian, see the Hessian website

Note: There is no requirement for services accessed with this proxy factory to have been exported using Spring's HessianServiceExporter, as there is no special handling involved. As a consequence, you can also access services that have been exported using Caucho's HessianServlet.

Since:
29.09.2003
Author:
Juergen Hoeller
See Also:
RemoteAccessor.setServiceInterface(java.lang.Class), UrlBasedRemoteAccessor.setServiceUrl(java.lang.String), setUsername(java.lang.String), setPassword(java.lang.String), HessianServiceExporter, HessianProxyFactoryBean, HessianProxyFactory, HessianServlet

Field Summary
Fields inherited from class org.springframework.remoting.support.RemotingSupport
logger
Constructor Summary
HessianClientInterceptor()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected RemoteAccessException | convertHessianAccessException(Throwable ex) Convert the given Hessian access exception to an appropriate Spring RemoteAccessException.
protected Object | createHessianProxy(com.caucho.hessian.client.HessianProxyFactory proxyFactory) Create the Hessian proxy that is wrapped by this interceptor.
Object | invoke(MethodInvocation invocation)
void | prepare() Initialize the Hessian proxy for this interceptor.
void | setChunkedPost(boolean chunkedPost) Set whether to use a chunked post for sending a Hessian request.
void | setDebug(boolean debug) Set whether Hessian's debug mode should be enabled.
void | setHessian2(boolean hessian2) Set whether version 2 of the Hessian protocol should be used for parsing requests and replies.
void | setHessian2Reply(boolean hessian2) Set whether version 2 of the Hessian protocol should be used for parsing replies.
void | setHessian2Request(boolean hessian2) Set whether version 2 of the Hessian protocol should be used for parsing requests.
void | setOverloadEnabled(boolean overloadEnabled) Set whether overloaded methods should be enabled for remote invocations.
void | setPassword(String password) Set the password that this factory should use to access the remote service.
void | setProxyFactory(com.caucho.hessian.client.HessianProxyFactory proxyFactory) Set the HessianProxyFactory instance to use.
void | setReadTimeout(long timeout) Set the timeout to use when waiting for a reply from the Hessian service.
void | setSendCollectionType(boolean sendCollectionType) Set whether to send the Java collection type for each serialized collection.
void | setSerializerFactory(com.caucho.hessian.io.SerializerFactory serializerFactory) Specify the Hessian SerializerFactory to use.
void | setUsername(String username) Set the username that this factory should use to access the remote service.
Methods inherited from class org.springframework.remoting.support.UrlBasedRemoteAccessor
getServiceUrl, setServiceUrl
Methods inherited from class org.springframework.remoting.support.RemoteAccessor
getServiceInterface, setServiceInterface
Methods inherited from class org.springframework.remoting.support.RemotingSupport
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

HessianClientInterceptor

public HessianClientInterceptor()
Method Detail

setProxyFactory

public void setProxyFactory(com.caucho.hessian.client.HessianProxyFactory proxyFactory)
Set the HessianProxyFactory instance to use. If not specified, a default HessianProxyFactory will be created.

Allows to use an externally configured factory instance, in particular a custom HessianProxyFactory subclass.

setSerializerFactory

public void setSerializerFactory(com.caucho.hessian.io.SerializerFactory serializerFactory)
Specify the Hessian SerializerFactory to use.

This will typically be passed in as an inner bean definition of type com.caucho.hessian.io.SerializerFactory, with custom bean property values applied.

setSendCollectionType

public void setSendCollectionType(boolean sendCollectionType)
Set whether to send the Java collection type for each serialized collection. Default is "true".

setOverloadEnabled

public void setOverloadEnabled(boolean overloadEnabled)
Set whether overloaded methods should be enabled for remote invocations. Default is "false".

See Also:
HessianProxyFactory.setOverloadEnabled(boolean)

setUsername

public void setUsername(String username)
Set the username that this factory should use to access the remote service. Default is none.

The username will be sent by Hessian via HTTP Basic Authentication.

See Also:
HessianProxyFactory.setUser(java.lang.String)

setPassword

public void setPassword(String password)
Set the password that this factory should use to access the remote service. Default is none.

The password will be sent by Hessian via HTTP Basic Authentication.

See Also:
HessianProxyFactory.setPassword(java.lang.String)

setDebug

public void setDebug(boolean debug)
Set whether Hessian's debug mode should be enabled. Default is "false".

See Also:
HessianProxyFactory.setDebug(boolean)

setChunkedPost

public void setChunkedPost(boolean chunkedPost)
Set whether to use a chunked post for sending a Hessian request.

See Also:
HessianProxyFactory.setChunkedPost(boolean)

setReadTimeout

public void setReadTimeout(long timeout)
Set the timeout to use when waiting for a reply from the Hessian service.

See Also:
HessianProxyFactory.setReadTimeout(long)

setHessian2

public void setHessian2(boolean hessian2)
Set whether version 2 of the Hessian protocol should be used for parsing requests and replies. Default is "false".

See Also:
HessianProxyFactory.setHessian2Request(boolean)

setHessian2Request

public void setHessian2Request(boolean hessian2)
Set whether version 2 of the Hessian protocol should be used for parsing requests. Default is "false".

See Also:
HessianProxyFactory.setHessian2Request(boolean)

setHessian2Reply

public void setHessian2Reply(boolean hessian2)
Set whether version 2 of the Hessian protocol should be used for parsing replies. Default is "false".

See Also:
HessianProxyFactory.setHessian2Reply(boolean)

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class UrlBasedRemoteAccessor

prepare

public void prepare()
             throws RemoteLookupFailureException
Initialize the Hessian proxy for this interceptor.

Throws:
RemoteLookupFailureException - if the service URL is invalid

createHessianProxy

protected Object createHessianProxy(com.caucho.hessian.client.HessianProxyFactory proxyFactory)
                             throws MalformedURLException
Create the Hessian proxy that is wrapped by this interceptor.

Parameters:
proxyFactory - the proxy factory to use
Returns:
the Hessian proxy
Throws:
MalformedURLException - if thrown by the proxy factory
See Also:
HessianProxyFactory.create(java.lang.String)

invoke

public Object invoke(MethodInvocation invocation)
              throws Throwable
Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable

convertHessianAccessException

protected RemoteAccessException convertHessianAccessException(Throwable ex)
Convert the given Hessian access exception to an appropriate Spring RemoteAccessException.

Parameters:
ex - the exception to convert
Returns:
the RemoteAccessException to throw
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HessianExporter

org.springframework.remoting.caucho
Class HessianExporter

java.lang.Object
    extended by  org.springframework.remoting.support.RemotingSupport
        extended by  org.springframework.remoting.support.RemoteExporter
            extended by  org.springframework.remoting.caucho.HessianExporter
All Implemented Interfaces:
BeanClassLoaderAware, InitializingBean
Direct Known Subclasses:
HessianServiceExporter, SimpleHessianServiceExporter
public class HessianExporter
extends RemoteExporter
implements InitializingBean

General stream-based protocol exporter for a Hessian endpoint.

Hessian is a slim, binary RPC protocol. For information on Hessian, see the Hessian website. Note: As of Spring 3.0, this exporter requires Hessian 3.2 or above.

Since:
2.5.1
Author:
Juergen Hoeller
See Also:
invoke(java.io.InputStream, java.io.OutputStream), HessianServiceExporter, SimpleHessianServiceExporter

Field Summary
static String CONTENT_TYPE_HESSIAN
Fields inherited from class org.springframework.remoting.support.RemotingSupport
logger
Constructor Summary
HessianExporter()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected void | doInvoke(com.caucho.hessian.server.HessianSkeleton skeleton, InputStream inputStream, OutputStream outputStream) Actually invoke the skeleton with the given streams.
void | invoke(InputStream inputStream, OutputStream outputStream) Perform an invocation on the exported object.
void | prepare() Initialize this exporter.
void | setDebug(boolean debug) Set whether Hessian's debug mode should be enabled, logging to this exporter's Commons Logging log.
void | setSendCollectionType(boolean sendCollectionType) Set whether to send the Java collection type for each serialized collection.
void | setSerializerFactory(com.caucho.hessian.io.SerializerFactory serializerFactory) Specify the Hessian SerializerFactory to use.
Methods inherited from class org.springframework.remoting.support.RemoteExporter
checkService, checkServiceInterface, getExporterName, getProxyForService, getService, getServiceInterface, setInterceptors, setRegisterTraceInterceptor, setService, setServiceInterface
Methods inherited from class org.springframework.remoting.support.RemotingSupport
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

CONTENT_TYPE_HESSIAN

public static final String CONTENT_TYPE_HESSIAN
See Also:
Constant Field Values
Constructor Detail

HessianExporter

public HessianExporter()
Method Detail

setSerializerFactory

public void setSerializerFactory(com.caucho.hessian.io.SerializerFactory serializerFactory)
Specify the Hessian SerializerFactory to use.

This will typically be passed in as an inner bean definition of type com.caucho.hessian.io.SerializerFactory, with custom bean property values applied.

setSendCollectionType

public void setSendCollectionType(boolean sendCollectionType)
Set whether to send the Java collection type for each serialized collection. Default is "true".

setDebug

public void setDebug(boolean debug)
Set whether Hessian's debug mode should be enabled, logging to this exporter's Commons Logging log. Default is "false".

See Also:
HessianProxyFactory.setDebug(boolean)

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

prepare

public void prepare()
Initialize this exporter.

invoke

public void invoke(InputStream inputStream,
                   OutputStream outputStream)
            throws Throwable
Perform an invocation on the exported object.

Parameters:
inputStream - the request stream
outputStream - the response stream
Throws:
Throwable - if invocation failed

doInvoke

protected void doInvoke(com.caucho.hessian.server.HessianSkeleton skeleton,
                        InputStream inputStream,
                        OutputStream outputStream)
                 throws Throwable
Actually invoke the skeleton with the given streams.

Parameters:
skeleton - the skeleton to invoke
inputStream - the request stream
outputStream - the response stream
Throws:
Throwable - if invocation failed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HessianProxyFactoryBean

org.springframework.remoting.caucho
Class HessianProxyFactoryBean

java.lang.Object
    extended by  org.springframework.remoting.support.RemotingSupport
        extended by  org.springframework.remoting.support.RemoteAccessor
            extended by  org.springframework.remoting.support.UrlBasedRemoteAccessor
                extended by  org.springframework.remoting.caucho.HessianClientInterceptor
                    extended by  org.springframework.remoting.caucho.HessianProxyFactoryBean
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, BeanClassLoaderAware, FactoryBean<Object>, InitializingBean
public class HessianProxyFactoryBean
extends HessianClientInterceptor
implements FactoryBean<Object>

FactoryBean for Hessian proxies. Exposes the proxied service for use as a bean reference, using the specified service interface.

Hessian is a slim, binary RPC protocol. For information on Hessian, see the Hessian website

The service URL must be an HTTP URL exposing a Hessian service. For details, see the HessianClientInterceptor javadoc.

Since:
13.05.2003
Author:
Juergen Hoeller
See Also:
RemoteAccessor.setServiceInterface(java.lang.Class), UrlBasedRemoteAccessor.setServiceUrl(java.lang.String), HessianClientInterceptor, HessianServiceExporter, BurlapProxyFactoryBean, HttpInvokerProxyFactoryBean, RmiProxyFactoryBean

Field Summary
Fields inherited from class org.springframework.remoting.support.RemotingSupport
logger
Constructor Summary
HessianProxyFactoryBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 Object getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<?> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
Methods inherited from class org.springframework.remoting.caucho.HessianClientInterceptor
convertHessianAccessException, createHessianProxy, invoke, prepare, setChunkedPost, setDebug, setHessian2, setHessian2Reply, setHessian2Request, setOverloadEnabled, setPassword, setProxyFactory, setReadTimeout, setSendCollectionType, setSerializerFactory, setUsername
Methods inherited from class org.springframework.remoting.support.UrlBasedRemoteAccessor
getServiceUrl, setServiceUrl
Methods inherited from class org.springframework.remoting.support.RemoteAccessor
getServiceInterface, setServiceInterface
Methods inherited from class org.springframework.remoting.support.RemotingSupport
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

HessianProxyFactoryBean

public HessianProxyFactoryBean()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class HessianClientInterceptor

getObject

public Object getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<Object>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<?> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<Object>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<Object>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HessianServiceExporter

org.springframework.remoting.caucho
Class HessianServiceExporter

java.lang.Object
    extended by  org.springframework.remoting.support.RemotingSupport
        extended by  org.springframework.remoting.support.RemoteExporter
            extended by  org.springframework.remoting.caucho.HessianExporter
                extended by  org.springframework.remoting.caucho.HessianServiceExporter
All Implemented Interfaces:
BeanClassLoaderAware, InitializingBean, HttpRequestHandler
public class HessianServiceExporter
extends HessianExporter
implements HttpRequestHandler

Servlet-API-based HTTP request handler that exports the specified service bean as Hessian service endpoint, accessible via a Hessian proxy.

Note: Spring also provides an alternative version of this exporter, for Sun's JRE 1.6 HTTP server: SimpleHessianServiceExporter.

Hessian is a slim, binary RPC protocol. For information on Hessian, see the Hessian website. Note: As of Spring 3.0, this exporter requires Hessian 3.2 or above.

Hessian services exported with this class can be accessed by any Hessian client, as there isn't any special handling involved.

Since:
13.05.2003
Author:
Juergen Hoeller
See Also:
HessianClientInterceptor, HessianProxyFactoryBean, BurlapServiceExporter, HttpInvokerServiceExporter, RmiServiceExporter

Field Summary
Fields inherited from class org.springframework.remoting.caucho.HessianExporter
CONTENT_TYPE_HESSIAN
Fields inherited from class org.springframework.remoting.support.RemotingSupport
logger
Constructor Summary
HessianServiceExporter()
Method Summary
 void handleRequest(HttpServletRequest request, HttpServletResponse response)
Processes the incoming Hessian request and creates a Hessian response.
Methods inherited from class org.springframework.remoting.caucho.HessianExporter
afterPropertiesSet, doInvoke, invoke, prepare, setDebug, setSendCollectionType, setSerializerFactory
Methods inherited from class org.springframework.remoting.support.RemoteExporter
checkService, checkServiceInterface, getExporterName, getProxyForService, getService, getServiceInterface, setInterceptors, setRegisterTraceInterceptor, setService, setServiceInterface
Methods inherited from class org.springframework.remoting.support.RemotingSupport
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

HessianServiceExporter

public HessianServiceExporter()
Method Detail

handleRequest

public void handleRequest(HttpServletRequest request,
                          HttpServletResponse response)
                   throws ServletException,
                          IOException
Processes the incoming Hessian request and creates a Hessian response.

Specified by:
handleRequest in interface HttpRequestHandler
Parameters:
request - current HTTP request
response - current HTTP response
Throws:
ServletException - in case of general errors
IOException - in case of I/O errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleBurlapServiceExporter

org.springframework.remoting.caucho
Class SimpleBurlapServiceExporter

java.lang.Object
    extended by  org.springframework.remoting.support.RemotingSupport
        extended by  org.springframework.remoting.support.RemoteExporter
            extended by  org.springframework.remoting.caucho.BurlapExporter
                extended by  org.springframework.remoting.caucho.SimpleBurlapServiceExporter
All Implemented Interfaces:
HttpHandler, BeanClassLoaderAware, InitializingBean
public class SimpleBurlapServiceExporter
extends BurlapExporter
implements HttpHandler

HTTP request handler that exports the specified service bean as Burlap service endpoint, accessible via a Burlap proxy. Designed for Sun's JRE 1.6 HTTP server, implementing the HttpHandler interface.

Burlap is a slim, XML-based RPC protocol. For information on Burlap, see the Burlap website. This exporter requires Burlap 3.x.

Note: Burlap services exported with this class can be accessed by any Burlap client, as there isn't any special handling involved.

Since:
2.5.1
Author:
Juergen Hoeller
See Also:
BurlapClientInterceptor, BurlapProxyFactoryBean, SimpleHessianServiceExporter, SimpleHttpInvokerServiceExporter

Field Summary
Fields inherited from class org.springframework.remoting.support.RemotingSupport
logger
Constructor Summary
SimpleBurlapServiceExporter()
Method Summary
 void handle(HttpExchange exchange)
Processes the incoming Burlap request and creates a Burlap response.
Methods inherited from class org.springframework.remoting.caucho.BurlapExporter
afterPropertiesSet, invoke, prepare
Methods inherited from class org.springframework.remoting.support.RemoteExporter
checkService, checkServiceInterface, getExporterName, getProxyForService, getService, getServiceInterface, setInterceptors, setRegisterTraceInterceptor, setService, setServiceInterface
Methods inherited from class org.springframework.remoting.support.RemotingSupport
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleBurlapServiceExporter

public SimpleBurlapServiceExporter()
Method Detail

handle

public void handle(HttpExchange exchange)
            throws IOException
Processes the incoming Burlap request and creates a Burlap response.

Specified by:
handle in interface HttpHandler
Throws:
IOException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleHessianServiceExporter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.remoting.caucho
Class SimpleHessianServiceExporter

java.lang.Object
    extended by  org.springframework.remoting.support.RemotingSupport
        extended by  org.springframework.remoting.support.RemoteExporter
            extended by  org.springframework.remoting.caucho.HessianExporter
                extended by  org.springframework.remoting.caucho.SimpleHessianServiceExporter
All Implemented Interfaces:
HttpHandler, BeanClassLoaderAware, InitializingBean
public class SimpleHessianServiceExporter
extends HessianExporter
implements HttpHandler

HTTP request handler that exports the specified service bean as Hessian service endpoint, accessible via a Hessian proxy. Designed for Sun's JRE 1.6 HTTP server, implementing the HttpHandler interface.

Hessian is a slim, binary RPC protocol. For information on Hessian, see the Hessian website. Note: As of Spring 3.0, this exporter requires Hessian 3.2 or above.

Hessian services exported with this class can be accessed by any Hessian client, as there isn't any special handling involved.

Since:
2.5.1
Author:
Juergen Hoeller
See Also:
HessianClientInterceptor, HessianProxyFactoryBean, SimpleBurlapServiceExporter, SimpleHttpInvokerServiceExporter

Field Summary
Fields inherited from class org.springframework.remoting.caucho.HessianExporter
CONTENT_TYPE_HESSIAN
Fields inherited from class org.springframework.remoting.support.RemotingSupport
logger
Constructor Summary
SimpleHessianServiceExporter()
Method Summary
 void handle(HttpExchange exchange)
Processes the incoming Hessian request and creates a Hessian response.
Methods inherited from class org.springframework.remoting.caucho.HessianExporter
afterPropertiesSet, doInvoke, invoke, prepare, setDebug, setSendCollectionType, setSerializerFactory
Methods inherited from class org.springframework.remoting.support.RemoteExporter
checkService, checkServiceInterface, getExporterName, getProxyForService, getService, getServiceInterface, setInterceptors, setRegisterTraceInterceptor, setService, setServiceInterface
Methods inherited from class org.springframework.remoting.support.RemotingSupport
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleHessianServiceExporter

public SimpleHessianServiceExporter()
Method Detail

handle

public void handle(HttpExchange exchange)
            throws IOException
Processes the incoming Hessian request and creates a Hessian response.

Specified by:
handle in interface HttpHandler
Throws:
IOException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.remoting.httpinvoker

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.remoting.httpinvoker

Remoting classes for transparent Java-to-Java remoting via HTTP invokers.

See:
Description

Interface Summary
HttpInvokerClientConfiguration | Configuration interface for executing HTTP invoker requests.
HttpInvokerRequestExecutor | Strategy interface for actual execution of an HTTP invoker request.

Class Summary
AbstractHttpInvokerRequestExecutor | Abstract base implementation of the HttpInvokerRequestExecutor interface.
CommonsHttpInvokerRequestExecutor | HttpInvokerRequestExecutor implementation that uses Jakarta Commons HttpClient to execute POST requests.
HttpInvokerClientInterceptor | MethodInterceptor for accessing an HTTP invoker service.
HttpInvokerProxyFactoryBean | FactoryBean for HTTP invoker proxies.
HttpInvokerServiceExporter | Servlet-API-based HTTP request handler that exports the specified service bean as HTTP invoker service endpoint, accessible via an HTTP invoker proxy.
SimpleHttpInvokerRequestExecutor | HttpInvokerRequestExecutor implementation that uses standard J2SE facilities to execute POST requests, without support for HTTP authentication or advanced configuration options.
SimpleHttpInvokerServiceExporter | HTTP request handler that exports the specified service bean as HTTP invoker service endpoint, accessible via an HTTP invoker proxy.

Package org.springframework.remoting.httpinvoker Description

Remoting classes for transparent Java-to-Java remoting via HTTP invokers. Uses Java serialization just like RMI, but provides the same ease of setup as Caucho's HTTP-based Hessian and Burlap protocols.

HTTP invoker is the recommended protocol for Java-to-Java remoting. It is more powerful and more extensible than Hessian and Burlap, at the expense of being tied to Java. Neverthelesss, it is as easy to set up as Hessian and Burlap, which is its main advantage compared to RMI.


org.springframework.remoting.httpinvoker Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.remoting.httpinvoker

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.remoting.httpinvoker.HttpInvokerRequestExecutor)
      • org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor
      • org.springframework.remoting.httpinvoker.SimpleHttpInvokerRequestExecutor
    • org.springframework.remoting.support.RemotingSupport (implements org.springframework.beans.factory.BeanClassLoaderAware)
      • org.springframework.remoting.support.RemoteAccessor
        • org.springframework.remoting.support.UrlBasedRemoteAccessor (implements org.springframework.beans.factory.InitializingBean)
          • org.springframework.remoting.support.RemoteInvocationBasedAccessor
            • org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor (implements org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration, org.aopalliance.intercept.MethodInterceptor)
              • org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>)
      • org.springframework.remoting.support.RemoteExporter
        • org.springframework.remoting.support.RemoteInvocationBasedExporter
          • org.springframework.remoting.rmi.RemoteInvocationSerializingExporter (implements org.springframework.beans.factory.InitializingBean)
            • org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter (implements org.springframework.web.HttpRequestHandler)
            • org.springframework.remoting.httpinvoker.SimpleHttpInvokerServiceExporter (implements com.sun.net.httpserver.HttpHandler)

Interface Hierarchy

  • org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration
  • org.springframework.remoting.httpinvoker.HttpInvokerRequestExecutor


HttpInvokerClientConfiguration

org.springframework.remoting.httpinvoker
Interface HttpInvokerClientConfiguration

All Known Implementing Classes:
HttpInvokerClientInterceptor, HttpInvokerProxyFactoryBean
public interface HttpInvokerClientConfiguration

Configuration interface for executing HTTP invoker requests.

Since:
1.1
Author:
Juergen Hoeller
See Also:
HttpInvokerRequestExecutor, HttpInvokerClientInterceptor

Method Summary
String | getCodebaseUrl() Return the codebase URL to download classes from if not found locally.
String | getServiceUrl() Return the HTTP URL of the target service.

Method Detail

getServiceUrl

String getServiceUrl()
Return the HTTP URL of the target service.

getCodebaseUrl

String getCodebaseUrl()
Return the codebase URL to download classes from if not found locally. Can consist of multiple URLs, separated by spaces.

Returns:
the codebase URL, or null if none
See Also:
RMIClassLoader
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HttpInvokerRequestExecutor

org.springframework.remoting.httpinvoker
Interface HttpInvokerRequestExecutor

All Known Implementing Classes:
AbstractHttpInvokerRequestExecutor, CommonsHttpInvokerRequestExecutor, SimpleHttpInvokerRequestExecutor
public interface HttpInvokerRequestExecutor

Strategy interface for actual execution of an HTTP invoker request. Used by HttpInvokerClientInterceptor and its subclass HttpInvokerProxyFactoryBean.

Two implementations are provided out of the box:

  • SimpleHttpInvokerRequestExecutor: Uses J2SE facilities to execute POST requests, without support for HTTP authentication or advanced configuration options.
  • CommonsHttpInvokerRequestExecutor: Uses Jakarta's Commons HttpClient to execute POST requests, allowing to use a preconfigured HttpClient instance (potentially with authentication, HTTP connection pooling, etc).

Since:
1.1
Author:
Juergen Hoeller
See Also:
HttpInvokerClientInterceptor.setHttpInvokerRequestExecutor(org.springframework.remoting.httpinvoker.HttpInvokerRequestExecutor)

Method Summary
 RemoteInvocationResult executeRequest(HttpInvokerClientConfiguration config, RemoteInvocation invocation)
Execute a request to send the given remote invocation.

Method Detail

executeRequest

RemoteInvocationResult executeRequest(HttpInvokerClientConfiguration config,
                                      RemoteInvocation invocation)
                                      throws Exception
Execute a request to send the given remote invocation.

Parameters:
config - the HTTP invoker configuration that specifies the target service
invocation - the RemoteInvocation to execute
Returns:
the RemoteInvocationResult object
Throws:
IOException - if thrown by I/O operations
ClassNotFoundException - if thrown during deserialization
Exception - in case of general errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractHttpInvokerRequestExecutor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.remoting.httpinvoker
Class AbstractHttpInvokerRequestExecutor

java.lang.Object
    extended by  org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
All Implemented Interfaces:
BeanClassLoaderAware, HttpInvokerRequestExecutor
Direct Known Subclasses:
CommonsHttpInvokerRequestExecutor, SimpleHttpInvokerRequestExecutor
public abstract class AbstractHttpInvokerRequestExecutor
extends Object
implements HttpInvokerRequestExecutor, BeanClassLoaderAware

Abstract base implementation of the HttpInvokerRequestExecutor interface.

Pre-implements serialization of RemoteInvocation objects and deserialization of RemoteInvocationResults objects.

Since:
1.1
Author:
Juergen Hoeller
See Also:
doExecuteRequest(org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration, java.io.ByteArrayOutputStream)

Field Summary
static String | CONTENT_TYPE_SERIALIZED_OBJECT Default content type: "application/x-java-serialized-object"
protected static String | ENCODING_GZIP
protected static String | HTTP_HEADER_ACCEPT_ENCODING
protected static String | HTTP_HEADER_ACCEPT_LANGUAGE
protected static String | HTTP_HEADER_CONTENT_ENCODING
protected static String | HTTP_HEADER_CONTENT_LENGTH
protected static String | HTTP_HEADER_CONTENT_TYPE
protected static String | HTTP_METHOD_POST
protected Log | logger
Constructor Summary
AbstractHttpInvokerRequestExecutor()
Method Summary
protected ObjectInputStream | createObjectInputStream(InputStream is, String codebaseUrl) Create an ObjectInputStream for the given InputStream and codebase.
protected InputStream | decorateInputStream(InputStream is) Return the InputStream to use for reading remote invocation results, potentially decorating the given original InputStream.
protected OutputStream | decorateOutputStream(OutputStream os) Return the OutputStream to use for writing remote invocations, potentially decorating the given original OutputStream.
protected abstract RemoteInvocationResult | doExecuteRequest(HttpInvokerClientConfiguration config, ByteArrayOutputStream baos) Execute a request to send the given serialized remote invocation.
protected RemoteInvocationResult | doReadRemoteInvocationResult(ObjectInputStream ois) Perform the actual reading of an invocation object from the given ObjectInputStream.
protected void | doWriteRemoteInvocation(RemoteInvocation invocation, ObjectOutputStream oos) Perform the actual writing of the given invocation object to the given ObjectOutputStream.
RemoteInvocationResult | executeRequest(HttpInvokerClientConfiguration config, RemoteInvocation invocation) Execute a request to send the given remote invocation.
protected ClassLoader | getBeanClassLoader() Return the bean ClassLoader that this executor is supposed to use.
protected ByteArrayOutputStream | getByteArrayOutputStream(RemoteInvocation invocation) Serialize the given RemoteInvocation into a ByteArrayOutputStream.
String | getContentType() Return the content type to use for sending HTTP invoker requests.
boolean | isAcceptGzipEncoding() Return whether to accept GZIP encoding, that is, whether to send the HTTP "Accept-Encoding" header with "gzip" as value.
protected RemoteInvocationResult | readRemoteInvocationResult(InputStream is, String codebaseUrl) Deserialize a RemoteInvocationResult object from the given InputStream.
void | setAcceptGzipEncoding(boolean acceptGzipEncoding) Set whether to accept GZIP encoding, that is, whether to send the HTTP "Accept-Encoding" header with "gzip" as value.
void | setBeanClassLoader(ClassLoader classLoader) Callback that supplies the bean class loader to a bean instance.
void | setContentType(String contentType) Specify the content type to use for sending HTTP invoker requests.
protected void | writeRemoteInvocation(RemoteInvocation invocation, OutputStream os) Serialize the given RemoteInvocation to the given OutputStream.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

CONTENT_TYPE_SERIALIZED_OBJECT

public static final String CONTENT_TYPE_SERIALIZED_OBJECT
Default content type: "application/x-java-serialized-object"

See Also:
Constant Field Values

HTTP_METHOD_POST

protected static final String HTTP_METHOD_POST
See Also:
Constant Field Values

HTTP_HEADER_ACCEPT_LANGUAGE

protected static final String HTTP_HEADER_ACCEPT_LANGUAGE
See Also:
Constant Field Values

HTTP_HEADER_ACCEPT_ENCODING

protected static final String HTTP_HEADER_ACCEPT_ENCODING
See Also:
Constant Field Values

HTTP_HEADER_CONTENT_ENCODING

protected static final String HTTP_HEADER_CONTENT_ENCODING
See Also:
Constant Field Values

HTTP_HEADER_CONTENT_TYPE

protected static final String HTTP_HEADER_CONTENT_TYPE
See Also:
Constant Field Values

HTTP_HEADER_CONTENT_LENGTH

protected static final String HTTP_HEADER_CONTENT_LENGTH
See Also:
Constant Field Values

ENCODING_GZIP

protected static final String ENCODING_GZIP
See Also:
Constant Field Values

logger

protected final Log logger
Constructor Detail

AbstractHttpInvokerRequestExecutor

public AbstractHttpInvokerRequestExecutor()
Method Detail

setContentType

public void setContentType(String contentType)
Specify the content type to use for sending HTTP invoker requests.

Default is "application/x-java-serialized-object".

getContentType

public String getContentType()
Return the content type to use for sending HTTP invoker requests.

setAcceptGzipEncoding

public void setAcceptGzipEncoding(boolean acceptGzipEncoding)
Set whether to accept GZIP encoding, that is, whether to send the HTTP "Accept-Encoding" header with "gzip" as value.

Default is "true". Turn this flag off if you do not want GZIP response compression even if enabled on the HTTP server.

isAcceptGzipEncoding

public boolean isAcceptGzipEncoding()
Return whether to accept GZIP encoding, that is, whether to send the HTTP "Accept-Encoding" header with "gzip" as value.

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

getBeanClassLoader

protected ClassLoader getBeanClassLoader()
Return the bean ClassLoader that this executor is supposed to use.

executeRequest

public final RemoteInvocationResult executeRequest(HttpInvokerClientConfiguration config,
                                                   RemoteInvocation invocation)
                                            throws Exception
Description copied from interface: HttpInvokerRequestExecutor
Execute a request to send the given remote invocation.

Specified by:
executeRequest in interface HttpInvokerRequestExecutor
Parameters:
config - the HTTP invoker configuration that specifies the target service
invocation - the RemoteInvocation to execute
Returns:
the RemoteInvocationResult object
Throws:
IOException - if thrown by I/O operations
ClassNotFoundException - if thrown during deserialization
Exception - in case of general errors

getByteArrayOutputStream

protected ByteArrayOutputStream getByteArrayOutputStream(RemoteInvocation invocation)
                                                  throws IOException
Serialize the given RemoteInvocation into a ByteArrayOutputStream.

Parameters:
invocation - the RemoteInvocation object
Returns:
a ByteArrayOutputStream with the serialized RemoteInvocation
Throws:
IOException - if thrown by I/O methods

writeRemoteInvocation

protected void writeRemoteInvocation(RemoteInvocation invocation,
                                     OutputStream os)
                              throws IOException
Serialize the given RemoteInvocation to the given OutputStream.

The default implementation gives decorateOutputStream a chance to decorate the stream first (for example, for custom encryption or compression). Creates an ObjectOutputStream for the final stream and calls doWriteRemoteInvocation to actually write the object.

Can be overridden for custom serialization of the invocation.

Parameters:
invocation - the RemoteInvocation object
os - the OutputStream to write to
Throws:
IOException - if thrown by I/O methods
See Also:
decorateOutputStream(java.io.OutputStream), doWriteRemoteInvocation(org.springframework.remoting.support.RemoteInvocation, java.io.ObjectOutputStream)

decorateOutputStream

protected OutputStream decorateOutputStream(OutputStream os)
                                     throws IOException
Return the OutputStream to use for writing remote invocations, potentially decorating the given original OutputStream.

The default implementation returns the given stream as-is. Can be overridden, for example, for custom encryption or compression.

Parameters:
os - the original OutputStream
Returns:
the potentially decorated OutputStream
Throws:
IOException

doWriteRemoteInvocation

protected void doWriteRemoteInvocation(RemoteInvocation invocation,
                                       ObjectOutputStream oos)
                                throws IOException
Perform the actual writing of the given invocation object to the given ObjectOutputStream.

The default implementation simply calls writeObject. Can be overridden for serialization of a custom wrapper object rather than the plain invocation, for example an encryption-aware holder.

Parameters:
invocation - the RemoteInvocation object
oos - the ObjectOutputStream to write to
Throws:
IOException - if thrown by I/O methods
See Also:
ObjectOutputStream.writeObject(java.lang.Object)

doExecuteRequest

protected abstract RemoteInvocationResult doExecuteRequest(HttpInvokerClientConfiguration config,
                                                           ByteArrayOutputStream baos)
                                                    throws Exception
Execute a request to send the given serialized remote invocation.

Implementations will usually call readRemoteInvocationResult to deserialize a returned RemoteInvocationResult object.

Parameters:
config - the HTTP invoker configuration that specifies the target service
baos - the ByteArrayOutputStream that contains the serialized RemoteInvocation object
Returns:
the RemoteInvocationResult object
Throws:
IOException - if thrown by I/O operations
ClassNotFoundException - if thrown during deserialization
Exception - in case of general errors
See Also:
readRemoteInvocationResult(java.io.InputStream, String)

readRemoteInvocationResult

protected RemoteInvocationResult readRemoteInvocationResult(InputStream is,
                                                            String codebaseUrl)
                                                     throws IOException,
                                                            ClassNotFoundException
Deserialize a RemoteInvocationResult object from the given InputStream.

Gives decorateInputStream a chance to decorate the stream first (for example, for custom encryption or compression). Creates an ObjectInputStream via createObjectInputStream and calls doReadRemoteInvocationResult to actually read the object.

Can be overridden for custom serialization of the invocation.

Parameters:
is - the InputStream to read from
codebaseUrl - the codebase URL to load classes from if not found locally
Returns:
the RemoteInvocationResult object
Throws:
IOException - if thrown by I/O methods
ClassNotFoundException - if thrown during deserialization
See Also:
decorateInputStream(java.io.InputStream),
createObjectInputStream(java.io.InputStream, java.lang.String),
doReadRemoteInvocationResult(java.io.ObjectInputStream)

decorateInputStream

protected InputStream decorateInputStream(InputStream is)
                                   throws IOException
Return the InputStream to use for reading remote invocation results, potentially decorating the given original InputStream.

The default implementation returns the given stream as-is. Can be overridden, for example, for custom encryption or compression.

Parameters:
is - the original InputStream
Returns:
the potentially decorated InputStream
Throws:
IOException

createObjectInputStream

protected ObjectInputStream createObjectInputStream(InputStream is,
                                                    String codebaseUrl)
                                             throws IOException
Create an ObjectInputStream for the given InputStream and codebase. The default implementation creates a CodebaseAwareObjectInputStream.

Parameters:
is - the InputStream to read from
codebaseUrl - the codebase URL to load classes from if not found locally (can be null)
Returns:
the new ObjectInputStream instance to use
Throws:
IOException - if creation of the ObjectInputStream failed
See Also:
CodebaseAwareObjectInputStream

doReadRemoteInvocationResult

protected RemoteInvocationResult doReadRemoteInvocationResult(ObjectInputStream ois)
                                                       throws IOException,
                                                              ClassNotFoundException
Perform the actual reading of an invocation object from the given ObjectInputStream.

The default implementation simply calls readObject. Can be overridden for deserialization of a custom wrapper object rather than the plain invocation, for example an encryption-aware holder.

Parameters:
ois - the ObjectInputStream to read from
Returns:
the RemoteInvocationResult object
Throws:
IOException - if thrown by I/O methods
ClassNotFoundException - if the class name of a serialized object couldn't get resolved
See Also:
ObjectOutputStream.writeObject(java.lang.Object)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


CommonsHttpInvokerRequestExecutor

org.springframework.remoting.httpinvoker
Class CommonsHttpInvokerRequestExecutor

java.lang.Object
    extended by  org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
        extended by  org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor
All Implemented Interfaces:
BeanClassLoaderAware, HttpInvokerRequestExecutor
public class CommonsHttpInvokerRequestExecutor
extends AbstractHttpInvokerRequestExecutor

HttpInvokerRequestExecutor implementation that uses Jakarta Commons HttpClient to execute POST requests. Requires Commons HttpClient 3.0 or higher.

Allows to use a pre-configured HttpClient instance, potentially with authentication, HTTP connection pooling, etc. Also designed for easy subclassing, providing specific template methods.

Since:
1.1
Author:
Juergen Hoeller, Mark Fisher
See Also:
SimpleHttpInvokerRequestExecutor

Field Summary
Fields inherited from class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
CONTENT_TYPE_SERIALIZED_OBJECT, ENCODING_GZIP, HTTP_HEADER_ACCEPT_ENCODING, HTTP_HEADER_ACCEPT_LANGUAGE, HTTP_HEADER_CONTENT_ENCODING, HTTP_HEADER_CONTENT_LENGTH, HTTP_HEADER_CONTENT_TYPE, HTTP_METHOD_POST, logger
Constructor Summary
CommonsHttpInvokerRequestExecutor()
Create a new CommonsHttpInvokerRequestExecutor with a default HttpClient that uses a default MultiThreadedHttpConnectionManager.
CommonsHttpInvokerRequestExecutor(HttpClient httpClient)
Create a new CommonsHttpInvokerRequestExecutor with the given HttpClient instance.
Method Summary
protected PostMethod | createPostMethod(HttpInvokerClientConfiguration config) Create a PostMethod for the given configuration.
protected RemoteInvocationResult | doExecuteRequest(HttpInvokerClientConfiguration config, ByteArrayOutputStream baos) Execute the given request through Commons HttpClient.
protected void | executePostMethod(HttpInvokerClientConfiguration config, HttpClient httpClient, PostMethod postMethod) Execute the given PostMethod instance.
HttpClient | getHttpClient() Return the HttpClient instance that this request executor uses.
protected InputStream | getResponseBody(HttpInvokerClientConfiguration config, PostMethod postMethod) Extract the response body from the given executed remote invocation request.
protected boolean | isGzipResponse(PostMethod postMethod) Determine whether the given response indicates a GZIP response.
void | setHttpClient(HttpClient httpClient) Set the HttpClient instance to use for this request executor.
void | setReadTimeout(int timeout) Set the socket read timeout for the underlying HttpClient.
protected void | setRequestBody(HttpInvokerClientConfiguration config, PostMethod postMethod, ByteArrayOutputStream baos) Set the given serialized remote invocation as request body.
protected void | validateResponse(HttpInvokerClientConfiguration config, PostMethod postMethod) Validate the given response as contained in the PostMethod object, throwing an exception if it does not correspond to a successful HTTP response.
Methods inherited from class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
createObjectInputStream, decorateInputStream, decorateOutputStream, doReadRemoteInvocationResult, doWriteRemoteInvocation, executeRequest, getBeanClassLoader, getByteArrayOutputStream, getContentType, isAcceptGzipEncoding, readRemoteInvocationResult, setAcceptGzipEncoding, setBeanClassLoader, setContentType, writeRemoteInvocation
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CommonsHttpInvokerRequestExecutor

public CommonsHttpInvokerRequestExecutor()
Create a new CommonsHttpInvokerRequestExecutor with a default HttpClient that uses a default MultiThreadedHttpConnectionManager. Sets the socket read timeout to DEFAULT_READ_TIMEOUT_MILLISECONDS.

See Also:
HttpClient, MultiThreadedHttpConnectionManager

CommonsHttpInvokerRequestExecutor

public CommonsHttpInvokerRequestExecutor(HttpClient httpClient)
Create a new CommonsHttpInvokerRequestExecutor with the given HttpClient instance. The socket read timeout of the provided HttpClient will not be changed.

Parameters:
httpClient - the HttpClient instance to use for this request executor
Method Detail

setHttpClient

public void setHttpClient(HttpClient httpClient)
Set the HttpClient instance to use for this request executor.

getHttpClient

public HttpClient getHttpClient()
Return the HttpClient instance that this request executor uses.

setReadTimeout

public void setReadTimeout(int timeout)
Set the socket read timeout for the underlying HttpClient. A value of 0 means never timeout.

Parameters:
timeout - the timeout value in milliseconds
See Also:
HttpConnectionParams.setSoTimeout(int), DEFAULT_READ_TIMEOUT_MILLISECONDS

doExecuteRequest

protected RemoteInvocationResult doExecuteRequest(HttpInvokerClientConfiguration config,
                                                  ByteArrayOutputStream baos)
                                           throws IOException,
                                                  ClassNotFoundException
Execute the given request through Commons HttpClient.

This method implements the basic processing workflow: The actual work happens in this class's template methods.

Specified by:
doExecuteRequest in class AbstractHttpInvokerRequestExecutor
Parameters:
config - the HTTP invoker configuration that specifies the target service
baos - the ByteArrayOutputStream that contains the serialized RemoteInvocation object
Returns:
the RemoteInvocationResult object
Throws:
IOException - if thrown by I/O operations
ClassNotFoundException - if thrown during deserialization
See Also:
createPostMethod(org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration),
setRequestBody(org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration, org.apache.commons.httpclient.methods.PostMethod, java.io.ByteArrayOutputStream),
executePostMethod(org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration, org.apache.commons.httpclient.HttpClient, org.apache.commons.httpclient.methods.PostMethod),
validateResponse(org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration, org.apache.commons.httpclient.methods.PostMethod),
getResponseBody(org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration, org.apache.commons.httpclient.methods.PostMethod)

createPostMethod

protected PostMethod createPostMethod(HttpInvokerClientConfiguration config)
                               throws IOException
Create a PostMethod for the given configuration.

The default implementation creates a standard PostMethod with "application/x-java-serialized-object" as "Content-Type" header.

Parameters:
config - the HTTP invoker configuration that specifies the target service
Returns:
the PostMethod instance
Throws:
IOException - if thrown by I/O methods

setRequestBody

protected void setRequestBody(HttpInvokerClientConfiguration config,
                              PostMethod postMethod,
                              ByteArrayOutputStream baos)
                       throws IOException
Set the given serialized remote invocation as request body.

The default implementation simply sets the serialized invocation as the PostMethod's request body. This can be overridden, for example, to write a specific encoding and potentially set appropriate HTTP request headers.

Parameters:
config - the HTTP invoker configuration that specifies the target service
postMethod - the PostMethod to set the request body on
baos - the ByteArrayOutputStream that contains the serialized RemoteInvocation object
Throws:
IOException - if thrown by I/O methods
See Also:
EntityEnclosingMethod.setRequestBody(java.io.InputStream), EntityEnclosingMethod.setRequestEntity(org.apache.commons.httpclient.methods.RequestEntity), InputStreamRequestEntity

executePostMethod

protected void executePostMethod(HttpInvokerClientConfiguration config,
                                 HttpClient httpClient,
                                 PostMethod postMethod)
                          throws IOException
Execute the given PostMethod instance.

Parameters:
config - the HTTP invoker configuration that specifies the target service
httpClient - the HttpClient to execute on
postMethod - the PostMethod to execute
Throws:
IOException - if thrown by I/O methods
See Also:
HttpClient.executeMethod(org.apache.commons.httpclient.HttpMethod)

validateResponse

protected void validateResponse(HttpInvokerClientConfiguration config,
                                PostMethod postMethod)
                         throws IOException
Validate the given response as contained in the PostMethod object, throwing an exception if it does not correspond to a successful HTTP response.

Default implementation rejects any HTTP status code beyond 2xx, to avoid parsing the response body and trying to deserialize from a corrupted stream.

Parameters:
config - the HTTP invoker configuration that specifies the target service
postMethod - the executed PostMethod to validate
Throws:
IOException - if validation failed
See Also:
HttpMethodBase.getStatusCode(), HttpException

getResponseBody

protected InputStream getResponseBody(HttpInvokerClientConfiguration config,
                                      PostMethod postMethod)
                               throws IOException
Extract the response body from the given executed remote invocation request.

The default implementation simply fetches the PostMethod's response body stream. If the response is recognized as GZIP response, the InputStream will get wrapped in a GZIPInputStream.

Parameters:
config - the HTTP invoker configuration that specifies the target service
postMethod - the PostMethod to read the response body from
Returns:
an InputStream for the response body
Throws:
IOException - if thrown by I/O methods
See Also:
isGzipResponse(org.apache.commons.httpclient.methods.PostMethod), GZIPInputStream, HttpMethodBase.getResponseBodyAsStream(), HttpMethodBase.getResponseHeader(String)

isGzipResponse

protected boolean isGzipResponse(PostMethod postMethod)
Determine whether the given response indicates a GZIP response.

Default implementation checks whether the HTTP "Content-Encoding" header contains "gzip" (in any casing).

Parameters:
postMethod - the PostMethod to check
Returns:
whether the given response indicates a GZIP response
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HttpInvokerClientInterceptor

org.springframework.remoting.httpinvoker
Class HttpInvokerClientInterceptor

java.lang.Object
    extended by  org.springframework.remoting.support.RemotingSupport
        extended by  org.springframework.remoting.support.RemoteAccessor
            extended by  org.springframework.remoting.support.UrlBasedRemoteAccessor
                extended by  org.springframework.remoting.support.RemoteInvocationBasedAccessor
                    extended by  org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, BeanClassLoaderAware, InitializingBean, HttpInvokerClientConfiguration
Direct Known Subclasses:
HttpInvokerProxyFactoryBean
public class HttpInvokerClientInterceptor
extends RemoteInvocationBasedAccessor
implements MethodInterceptor, HttpInvokerClientConfiguration

MethodInterceptor for accessing an HTTP invoker service. The service URL must be an HTTP URL exposing an HTTP invoker service.

Serializes remote invocation objects and deserializes remote invocation result objects. Uses Java serialization just like RMI, but provides the same ease of setup as Caucho's HTTP-based Hessian and Burlap protocols.

HTTP invoker is a very extensible and customizable protocol. It supports the RemoteInvocationFactory mechanism, like RMI invoker, allowing to include additional invocation attributes (for example, a security context). Furthermore, it allows to customize request execution via the HttpInvokerRequestExecutor strategy.

Can use the JDK's RMIClassLoader to load classes from a given codebase, performing on-demand dynamic code download from a remote location. The codebase can consist of multiple URLs, separated by spaces. Note that RMIClassLoader requires a SecurityManager to be set, analogous to when using dynamic class download with standard RMI! (See the RMI documentation for details.)

Since:
1.1
Author:
Juergen Hoeller
See Also:
UrlBasedRemoteAccessor.setServiceUrl(java.lang.String), setCodebaseUrl(java.lang.String), RemoteInvocationBasedAccessor.setRemoteInvocationFactory(org.springframework.remoting.support.RemoteInvocationFactory), setHttpInvokerRequestExecutor(org.springframework.remoting.httpinvoker.HttpInvokerRequestExecutor), HttpInvokerServiceExporter, HttpInvokerProxyFactoryBean, RMIClassLoader

Field Summary
Fields inherited from class org.springframework.remoting.support.RemotingSupport
logger
Constructor Summary
HttpInvokerClientInterceptor()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected RemoteAccessException | convertHttpInvokerAccessException(Throwable ex) Convert the given HTTP invoker access exception to an appropriate Spring RemoteAccessException.
protected RemoteInvocationResult | executeRequest(RemoteInvocation invocation) Execute the given remote invocation via the HttpInvokerRequestExecutor.
protected RemoteInvocationResult | executeRequest(RemoteInvocation invocation, MethodInvocation originalInvocation) Execute the given remote invocation via the HttpInvokerRequestExecutor.
String | getCodebaseUrl() Return the codebase URL to download classes from if not found locally.
HttpInvokerRequestExecutor | getHttpInvokerRequestExecutor() Return the HttpInvokerRequestExecutor used by this remote accessor.
Object | invoke(MethodInvocation methodInvocation)
void | setCodebaseUrl(String codebaseUrl) Set the codebase URL to download classes from if not found locally.
void | setHttpInvokerRequestExecutor(HttpInvokerRequestExecutor httpInvokerRequestExecutor) Set the HttpInvokerRequestExecutor implementation to use for executing remote invocations.
Methods inherited from class org.springframework.remoting.support.RemoteInvocationBasedAccessor
createRemoteInvocation, getRemoteInvocationFactory, recreateRemoteInvocationResult, setRemoteInvocationFactory
Methods inherited from class org.springframework.remoting.support.UrlBasedRemoteAccessor
getServiceUrl, setServiceUrl
Methods inherited from class org.springframework.remoting.support.RemoteAccessor
getServiceInterface, setServiceInterface
Methods inherited from class org.springframework.remoting.support.RemotingSupport
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration
getServiceUrl

Constructor Detail

HttpInvokerClientInterceptor

public HttpInvokerClientInterceptor()
Method Detail

setCodebaseUrl

public void setCodebaseUrl(String codebaseUrl)
Set the codebase URL to download classes from if not found locally. Can consists of multiple URLs, separated by spaces.

Follows RMI's codebase conventions for dynamic class download. In contrast to RMI, where the server determines the URL for class download (via the "java.rmi.server.codebase" system property), it's the client that determines the codebase URL here. The server will usually be the same as for the service URL, just pointing to a different path there.

See Also:
UrlBasedRemoteAccessor.setServiceUrl(java.lang.String), CodebaseAwareObjectInputStream, RMIClassLoader

getCodebaseUrl

public String getCodebaseUrl()
Return the codebase URL to download classes from if not found locally.

Specified by:
getCodebaseUrl in interface HttpInvokerClientConfiguration
Returns:
the codebase URL, or null if none
See Also:
RMIClassLoader

setHttpInvokerRequestExecutor

public void setHttpInvokerRequestExecutor(HttpInvokerRequestExecutor httpInvokerRequestExecutor)
Set the HttpInvokerRequestExecutor implementation to use for executing remote invocations.

Default is SimpleHttpInvokerRequestExecutor. Alternatively, consider using CommonsHttpInvokerRequestExecutor for more sophisticated needs.

See Also:
SimpleHttpInvokerRequestExecutor, CommonsHttpInvokerRequestExecutor

getHttpInvokerRequestExecutor

public HttpInvokerRequestExecutor getHttpInvokerRequestExecutor()
Return the HttpInvokerRequestExecutor used by this remote accessor.

Creates a default SimpleHttpInvokerRequestExecutor if no executor has been initialized already.

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class UrlBasedRemoteAccessor

invoke

public Object invoke(MethodInvocation methodInvocation)
              throws Throwable
Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable

executeRequest

protected RemoteInvocationResult executeRequest(RemoteInvocation invocation,
                                                MethodInvocation originalInvocation)
                                         throws Exception
Execute the given remote invocation via the HttpInvokerRequestExecutor.

This implementation delegates to executeRequest(RemoteInvocation). Can be overridden to react to the specific original MethodInvocation.

Parameters:
invocation - the RemoteInvocation to execute
originalInvocation - the original MethodInvocation (can e.g. be cast to the ProxyMethodInvocation interface for accessing user attributes)
Returns:
the RemoteInvocationResult object
Throws:
Exception - in case of errors

executeRequest

protected RemoteInvocationResult executeRequest(RemoteInvocation invocation)
                                         throws Exception
Execute the given remote invocation via the HttpInvokerRequestExecutor.

Can be overridden in subclasses to pass a different configuration object to the executor. Alternatively, add further configuration properties in a subclass of this accessor: By default, the accessor passed itself as configuration object to the executor.

Parameters:
invocation - the RemoteInvocation to execute
Returns:
the RemoteInvocationResult object
Throws:
IOException - if thrown by I/O operations
ClassNotFoundException - if thrown during deserialization
Exception - in case of general errors
See Also:
getHttpInvokerRequestExecutor(), HttpInvokerClientConfiguration

convertHttpInvokerAccessException

protected RemoteAccessException convertHttpInvokerAccessException(Throwable ex)
Convert the given HTTP invoker access exception to an appropriate Spring RemoteAccessException.

Parameters:
ex - the exception to convert
Returns:
the RemoteAccessException to throw
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HttpInvokerProxyFactoryBean

org.springframework.remoting.httpinvoker
Class HttpInvokerProxyFactoryBean

java.lang.Object
    extended by  org.springframework.remoting.support.RemotingSupport
        extended by  org.springframework.remoting.support.RemoteAccessor
            extended by  org.springframework.remoting.support.UrlBasedRemoteAccessor
                extended by  org.springframework.remoting.support.RemoteInvocationBasedAccessor
                    extended by  org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor
                        extended by  org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, BeanClassLoaderAware, FactoryBean<Object>, InitializingBean, HttpInvokerClientConfiguration
public class HttpInvokerProxyFactoryBean
extends HttpInvokerClientInterceptor
implements FactoryBean<Object>

FactoryBean for HTTP invoker proxies. Exposes the proxied service for use as a bean reference, using the specified service interface.

The service URL must be an HTTP URL exposing an HTTP invoker service. Optionally, a codebase URL can be specified for on-demand dynamic code download from a remote location. For details, see HttpInvokerClientInterceptor docs.

Serializes remote invocation objects and deserializes remote invocation result objects. Uses Java serialization just like RMI, but provides the same ease of setup as Caucho's HTTP-based Hessian and Burlap protocols.

HTTP invoker is the recommended protocol for Java-to-Java remoting. It is more powerful and more extensible than Hessian and Burlap, at the expense of being tied to Java. Nevertheless, it is as easy to set up as Hessian and Burlap, which is its main advantage compared to RMI.

Since:
1.1
Author:
Juergen Hoeller
See Also:
RemoteAccessor.setServiceInterface(java.lang.Class), UrlBasedRemoteAccessor.setServiceUrl(java.lang.String), HttpInvokerClientInterceptor.setCodebaseUrl(java.lang.String), HttpInvokerClientInterceptor, HttpInvokerServiceExporter, RmiProxyFactoryBean, HessianProxyFactoryBean, BurlapProxyFactoryBean

Field Summary
Fields inherited from class org.springframework.remoting.support.RemotingSupport
logger
Constructor Summary
HttpInvokerProxyFactoryBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 Object getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<?> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
Methods inherited from class org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor
convertHttpInvokerAccessException, executeRequest, executeRequest, getCodebaseUrl, getHttpInvokerRequestExecutor, invoke, setCodebaseUrl, setHttpInvokerRequestExecutor
Methods inherited from class org.springframework.remoting.support.RemoteInvocationBasedAccessor
createRemoteInvocation, getRemoteInvocationFactory, recreateRemoteInvocationResult, setRemoteInvocationFactory
Methods inherited from class org.springframework.remoting.support.UrlBasedRemoteAccessor
getServiceUrl, setServiceUrl
Methods inherited from class org.springframework.remoting.support.RemoteAccessor
getServiceInterface, setServiceInterface
Methods inherited from class org.springframework.remoting.support.RemotingSupport
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration
getServiceUrl

Constructor Detail

HttpInvokerProxyFactoryBean

public HttpInvokerProxyFactoryBean()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class HttpInvokerClientInterceptor

getObject

public Object getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<Object>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<?> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<Object>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<Object>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HttpInvokerServiceExporter

org.springframework.remoting.httpinvoker
Class HttpInvokerServiceExporter

java.lang.Object
    extended by  org.springframework.remoting.support.RemotingSupport
        extended by  org.springframework.remoting.support.RemoteExporter
            extended by  org.springframework.remoting.support.RemoteInvocationBasedExporter
                extended by  org.springframework.remoting.rmi.RemoteInvocationSerializingExporter
                    extended by  org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter
All Implemented Interfaces:
BeanClassLoaderAware, InitializingBean, HttpRequestHandler
public class HttpInvokerServiceExporter
extends RemoteInvocationSerializingExporter
implements HttpRequestHandler

Servlet-API-based HTTP request handler that exports the specified service bean as HTTP invoker service endpoint, accessible via an HTTP invoker proxy.

Note: Spring also provides an alternative version of this exporter, for Sun's JRE 1.6 HTTP server: SimpleHttpInvokerServiceExporter.

Deserializes remote invocation objects and serializes remote invocation result objects. Uses Java serialization just like RMI, but provides the same ease of setup as Caucho's HTTP-based Hessian and Burlap protocols.

HTTP invoker is the recommended protocol for Java-to-Java remoting. It is more powerful and more extensible than Hessian and Burlap, at the expense of being tied to Java. Nevertheless, it is as easy to set up as Hessian and Burlap, which is its main advantage compared to RMI.

Since:
1.1
Author:
Juergen Hoeller
See Also:
HttpInvokerClientInterceptor, HttpInvokerProxyFactoryBean, RmiServiceExporter, HessianServiceExporter, BurlapServiceExporter

Field Summary
Fields inherited from class org.springframework.remoting.rmi.RemoteInvocationSerializingExporter
CONTENT_TYPE_SERIALIZED_OBJECT
Fields inherited from class org.springframework.remoting.support.RemotingSupport
logger
Constructor Summary
HttpInvokerServiceExporter()
Method Summary
protected InputStream | decorateInputStream(HttpServletRequest request, InputStream is) Return the InputStream to use for reading remote invocations, potentially decorating the given original InputStream.
protected OutputStream | decorateOutputStream(HttpServletRequest request, HttpServletResponse response, OutputStream os) Return the OutputStream to use for writing remote invocation results, potentially decorating the given original OutputStream.
void | handleRequest(HttpServletRequest request, HttpServletResponse response) Reads a remote invocation from the request, executes it, and writes the remote invocation result to the response.
protected RemoteInvocation | readRemoteInvocation(HttpServletRequest request) Read a RemoteInvocation from the given HTTP request.
protected RemoteInvocation | readRemoteInvocation(HttpServletRequest request, InputStream is) Deserialize a RemoteInvocation object from the given InputStream.
protected void | writeRemoteInvocationResult(HttpServletRequest request, HttpServletResponse response, RemoteInvocationResult result) Write the given RemoteInvocationResult to the given HTTP response.
protected void | writeRemoteInvocationResult(HttpServletRequest request, HttpServletResponse response, RemoteInvocationResult result, OutputStream os) Serialize the given RemoteInvocation to the given OutputStream.
Methods inherited from class org.springframework.remoting.rmi.RemoteInvocationSerializingExporter
afterPropertiesSet, createObjectInputStream, createObjectOutputStream, doReadRemoteInvocation, doWriteRemoteInvocationResult, getContentType, getProxy, prepare, setContentType
Methods inherited from class org.springframework.remoting.support.RemoteInvocationBasedExporter
getRemoteInvocationExecutor, invoke, invokeAndCreateResult, setRemoteInvocationExecutor
Methods inherited from class org.springframework.remoting.support.RemoteExporter
checkService, checkServiceInterface, getExporterName, getProxyForService, getService, getServiceInterface, setInterceptors, setRegisterTraceInterceptor, setService, setServiceInterface
Methods inherited from class org.springframework.remoting.support.RemotingSupport
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

HttpInvokerServiceExporter

public HttpInvokerServiceExporter()
Method Detail

handleRequest

public void handleRequest(HttpServletRequest request,
                          HttpServletResponse response)
                   throws ServletException,
                          IOException
Reads a remote invocation from the request, executes it, and writes the remote invocation result to the response.

Specified by:
handleRequest in interface HttpRequestHandler
Parameters:
request - current HTTP request
response - current HTTP response
Throws:
ServletException - in case of general errors
IOException - in case of I/O errors
See Also:
readRemoteInvocation(HttpServletRequest), RemoteInvocationBasedExporter.invokeAndCreateResult(org.springframework.remoting.support.RemoteInvocation, Object), writeRemoteInvocationResult(HttpServletRequest, HttpServletResponse, RemoteInvocationResult)

readRemoteInvocation

protected RemoteInvocation readRemoteInvocation(HttpServletRequest request)
                                         throws IOException,
                                                ClassNotFoundException
Read a RemoteInvocation from the given HTTP request.

Delegates to readRemoteInvocation(javax.servlet.http.HttpServletRequest, java.io.InputStream) with the servlet request's input stream.

Parameters:
request - current HTTP request
Returns:
the RemoteInvocation object
Throws:
IOException - in case of I/O failure
ClassNotFoundException - if thrown by deserialization

readRemoteInvocation

protected RemoteInvocation readRemoteInvocation(HttpServletRequest request,
                                                InputStream is)
                                         throws IOException,
                                                ClassNotFoundException
Deserialize a RemoteInvocation object from the given InputStream.

Gives decorateInputStream(javax.servlet.http.HttpServletRequest, java.io.InputStream) a chance to decorate the stream first (for example, for custom encryption or compression). Creates a CodebaseAwareObjectInputStream and calls RemoteInvocationSerializingExporter.doReadRemoteInvocation(java.io.ObjectInputStream) to actually read the object.

Can be overridden for custom serialization of the invocation.

Parameters:
request - current HTTP request
is - the InputStream to read from
Returns:
the RemoteInvocation object
Throws:
IOException - in case of I/O failure
ClassNotFoundException - if thrown during deserialization

decorateInputStream

protected InputStream decorateInputStream(HttpServletRequest request,
                                          InputStream is)
                                   throws IOException
Return the InputStream to use for reading remote invocations, potentially decorating the given original InputStream.

The default implementation returns the given stream as-is. Can be overridden, for example, for custom encryption or compression.

Parameters:
request - current HTTP request
is - the original InputStream
Returns:
the potentially decorated InputStream
Throws:
IOException - in case of I/O failure

writeRemoteInvocationResult

protected void writeRemoteInvocationResult(HttpServletRequest request,
                                           HttpServletResponse response,
                                           RemoteInvocationResult result)
                                    throws IOException
Write the given RemoteInvocationResult to the given HTTP response.

Parameters:
request - current HTTP request
response - current HTTP response
result - the RemoteInvocationResult object
Throws:
IOException - in case of I/O failure

writeRemoteInvocationResult

protected void writeRemoteInvocationResult(HttpServletRequest request,
                                           HttpServletResponse response,
                                           RemoteInvocationResult result,
                                           OutputStream os)
                                    throws IOException
Serialize the given RemoteInvocation to the given OutputStream.

The default implementation gives decorateOutputStream(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.io.OutputStream) a chance to decorate the stream first (for example, for custom encryption or compression). Creates an ObjectOutputStream for the final stream and calls RemoteInvocationSerializingExporter.doWriteRemoteInvocationResult(org.springframework.remoting.support.RemoteInvocationResult, java.io.ObjectOutputStream) to actually write the object.

Can be overridden for custom serialization of the invocation.

Parameters:
request - current HTTP request
response - current HTTP response
result - the RemoteInvocationResult object
os - the OutputStream to write to
Throws:
IOException - in case of I/O failure
See Also:
decorateOutputStream(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.io.OutputStream), RemoteInvocationSerializingExporter.doWriteRemoteInvocationResult(org.springframework.remoting.support.RemoteInvocationResult, java.io.ObjectOutputStream)

decorateOutputStream

protected OutputStream decorateOutputStream(HttpServletRequest request,
                                            HttpServletResponse response,
                                            OutputStream os)
                                     throws IOException
Return the OutputStream to use for writing remote invocation results, potentially decorating the given original OutputStream.

The default implementation returns the given stream as-is. Can be overridden, for example, for custom encryption or compression.

Parameters:
request - current HTTP request
response - current HTTP response
os - the original OutputStream
Returns:
the potentially decorated OutputStream
Throws:
IOException - in case of I/O failure
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleHttpInvokerRequestExecutor

org.springframework.remoting.httpinvoker
Class SimpleHttpInvokerRequestExecutor

java.lang.Object
    extended by  org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
        extended by  org.springframework.remoting.httpinvoker.SimpleHttpInvokerRequestExecutor
All Implemented Interfaces:
BeanClassLoaderAware, HttpInvokerRequestExecutor
public class SimpleHttpInvokerRequestExecutor
extends AbstractHttpInvokerRequestExecutor

HttpInvokerRequestExecutor implementation that uses standard J2SE facilities to execute POST requests, without support for HTTP authentication or advanced configuration options.

Designed for easy subclassing, customizing specific template methods. However, consider CommonsHttpInvokerRequestExecutor for more sophisticated needs: The J2SE HttpURLConnection is rather limited in its capabilities.

Since:
1.1
Author:
Juergen Hoeller
See Also:
CommonsHttpInvokerRequestExecutor, HttpURLConnection

Field Summary
Fields inherited from class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
CONTENT_TYPE_SERIALIZED_OBJECT, ENCODING_GZIP, HTTP_HEADER_ACCEPT_ENCODING, HTTP_HEADER_ACCEPT_LANGUAGE, HTTP_HEADER_CONTENT_ENCODING, HTTP_HEADER_CONTENT_LENGTH, HTTP_HEADER_CONTENT_TYPE, HTTP_METHOD_POST, logger
Constructor Summary
SimpleHttpInvokerRequestExecutor()
Method Summary
protected RemoteInvocationResult | doExecuteRequest(HttpInvokerClientConfiguration config, ByteArrayOutputStream baos) Execute the given request through a standard J2SE HttpURLConnection.
protected boolean | isGzipResponse(HttpURLConnection con) Determine whether the given response is a GZIP response.
protected HttpURLConnection | openConnection(HttpInvokerClientConfiguration config) Open an HttpURLConnection for the given remote invocation request.
protected void | prepareConnection(HttpURLConnection con, int contentLength) Prepare the given HTTP connection.
protected InputStream | readResponseBody(HttpInvokerClientConfiguration config, HttpURLConnection con) Extract the response body from the given executed remote invocation request.
protected void | validateResponse(HttpInvokerClientConfiguration config, HttpURLConnection con) Validate the given response as contained in the HttpURLConnection object, throwing an exception if it does not correspond to a successful HTTP response.
protected void | writeRequestBody(HttpInvokerClientConfiguration config, HttpURLConnection con, ByteArrayOutputStream baos) Set the given serialized remote invocation as request body.
Methods inherited from class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
createObjectInputStream, decorateInputStream, decorateOutputStream, doReadRemoteInvocationResult, doWriteRemoteInvocation, executeRequest, getBeanClassLoader, getByteArrayOutputStream, getContentType, isAcceptGzipEncoding, readRemoteInvocationResult, setAcceptGzipEncoding, setBeanClassLoader, setContentType, writeRemoteInvocation
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleHttpInvokerRequestExecutor

public SimpleHttpInvokerRequestExecutor()
Method Detail

doExecuteRequest

protected RemoteInvocationResult doExecuteRequest(HttpInvokerClientConfiguration config,
                                                  ByteArrayOutputStream baos)
                                           throws IOException,
                                                  ClassNotFoundException
Execute the given request through a standard J2SE HttpURLConnection.

This method implements the basic processing workflow: The actual work happens in this class's template methods.

Specified by:
doExecuteRequest in class AbstractHttpInvokerRequestExecutor
Parameters:
config - the HTTP invoker configuration that specifies the target service
baos - the ByteArrayOutputStream that contains the serialized RemoteInvocation object
Returns:
the RemoteInvocationResult object
Throws:
IOException - if thrown by I/O operations
ClassNotFoundException - if thrown during deserialization
See Also:
openConnection(org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration),
prepareConnection(java.net.HttpURLConnection, int),
writeRequestBody(org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration, java.net.HttpURLConnection, java.io.ByteArrayOutputStream),
validateResponse(org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration, java.net.HttpURLConnection),
readResponseBody(org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration, java.net.HttpURLConnection)

openConnection

protected HttpURLConnection openConnection(HttpInvokerClientConfiguration config)
                                    throws IOException
Open an HttpURLConnection for the given remote invocation request.

Parameters:
config - the HTTP invoker configuration that specifies the target service
Returns:
the HttpURLConnection for the given request
Throws:
IOException - if thrown by I/O methods
See Also:
URL.openConnection()

prepareConnection

protected void prepareConnection(HttpURLConnection con,
                                 int contentLength)
                          throws IOException
Prepare the given HTTP connection.

The default implementation specifies POST as method, "application/x-java-serialized-object" as "Content-Type" header, and the given content length as "Content-Length" header.

Parameters:
con - the HTTP connection to prepare
contentLength - the length of the content to send
Throws:
IOException - if thrown by HttpURLConnection methods
See Also:
HttpURLConnection.setRequestMethod(java.lang.String), URLConnection.setRequestProperty(java.lang.String, java.lang.String)

writeRequestBody

protected void writeRequestBody(HttpInvokerClientConfiguration config,
                                HttpURLConnection con,
                                ByteArrayOutputStream baos)
                         throws IOException
Set the given serialized remote invocation as request body.

The default implementation simply write the serialized invocation to the HttpURLConnection's OutputStream. This can be overridden, for example, to write a specific encoding and potentially set appropriate HTTP request headers.

Parameters:
config - the HTTP invoker configuration that specifies the target service
con - the HttpURLConnection to write the request body to
baos - the ByteArrayOutputStream that contains the serialized RemoteInvocation object
Throws:
IOException - if thrown by I/O methods
See Also:
URLConnection.getOutputStream(), URLConnection.setRequestProperty(java.lang.String, java.lang.String)

validateResponse

protected void validateResponse(HttpInvokerClientConfiguration config,
                                HttpURLConnection con)
                         throws IOException
Validate the given response as contained in the HttpURLConnection object, throwing an exception if it does not correspond to a successful HTTP response.

Default implementation rejects any HTTP status code beyond 2xx, to avoid parsing the response body and trying to deserialize from a corrupted stream.

Parameters:
config - the HTTP invoker configuration that specifies the target service
con - the HttpURLConnection to validate
Throws:
IOException - if validation failed
See Also:
HttpURLConnection.getResponseCode()

readResponseBody

protected InputStream readResponseBody(HttpInvokerClientConfiguration config,
                                       HttpURLConnection con)
                                throws IOException
Extract the response body from the given executed remote invocation request.

The default implementation simply reads the serialized invocation from the HttpURLConnection's InputStream. If the response is recognized as GZIP response, the InputStream will get wrapped in a GZIPInputStream.

Parameters:
config - the HTTP invoker configuration that specifies the target service
con - the HttpURLConnection to read the response body from
Returns:
an InputStream for the response body
Throws:
IOException - if thrown by I/O methods
See Also:
isGzipResponse(java.net.HttpURLConnection),
GZIPInputStream,
URLConnection.getInputStream(),
HttpURLConnection.getHeaderField(int),
HttpURLConnection.getHeaderFieldKey(int)

isGzipResponse

protected boolean isGzipResponse(HttpURLConnection con)
Determine whether the given response is a GZIP response.

Default implementation checks whether the HTTP "Content-Encoding" header contains "gzip" (in any casing).

Parameters:
con - the HttpURLConnection to check
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleHttpInvokerServiceExporter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.remoting.httpinvoker
Class SimpleHttpInvokerServiceExporter

java.lang.Object
    extended by  org.springframework.remoting.support.RemotingSupport
        extended by  org.springframework.remoting.support.RemoteExporter
            extended by  org.springframework.remoting.support.RemoteInvocationBasedExporter
                extended by  org.springframework.remoting.rmi.RemoteInvocationSerializingExporter
                    extended by  org.springframework.remoting.httpinvoker.SimpleHttpInvokerServiceExporter
All Implemented Interfaces:
HttpHandler, BeanClassLoaderAware, InitializingBean
public class SimpleHttpInvokerServiceExporter
extends RemoteInvocationSerializingExporter
implements HttpHandler

HTTP request handler that exports the specified service bean as HTTP invoker service endpoint, accessible via an HTTP invoker proxy. Designed for Sun's JRE 1.6 HTTP server, implementing the HttpHandler interface.

Deserializes remote invocation objects and serializes remote invocation result objects. Uses Java serialization just like RMI, but provides the same ease of setup as Caucho's HTTP-based Hessian and Burlap protocols.

HTTP invoker is the recommended protocol for Java-to-Java remoting. It is more powerful and more extensible than Hessian and Burlap, at the expense of being tied to Java. Nevertheless, it is as easy to set up as Hessian and Burlap, which is its main advantage compared to RMI.

Since:
2.5.1
Author:
Juergen Hoeller
See Also:
HttpInvokerClientInterceptor, HttpInvokerProxyFactoryBean, SimpleHessianServiceExporter, SimpleBurlapServiceExporter

Field Summary
Fields inherited from class org.springframework.remoting.rmi.RemoteInvocationSerializingExporter
CONTENT_TYPE_SERIALIZED_OBJECT
Fields inherited from class org.springframework.remoting.support.RemotingSupport
logger
Constructor Summary
SimpleHttpInvokerServiceExporter()
Method Summary
protected InputStream | decorateInputStream(HttpExchange exchange, InputStream is) Return the InputStream to use for reading remote invocations, potentially decorating the given original InputStream.
protected OutputStream | decorateOutputStream(HttpExchange exchange, OutputStream os) Return the OutputStream to use for writing remote invocation results, potentially decorating the given original OutputStream.
void | handle(HttpExchange exchange) Reads a remote invocation from the request, executes it, and writes the remote invocation result to the response.
protected RemoteInvocation | readRemoteInvocation(HttpExchange exchange) Read a RemoteInvocation from the given HTTP request.
protected RemoteInvocation | readRemoteInvocation(HttpExchange exchange, InputStream is) Deserialize a RemoteInvocation object from the given InputStream.
protected void | writeRemoteInvocationResult(HttpExchange exchange, RemoteInvocationResult result) Write the given RemoteInvocationResult to the given HTTP response.
protected void | writeRemoteInvocationResult(HttpExchange exchange, RemoteInvocationResult result, OutputStream os) Serialize the given RemoteInvocation to the given OutputStream.
Methods inherited from class org.springframework.remoting.rmi.RemoteInvocationSerializingExporter
afterPropertiesSet, createObjectInputStream, createObjectOutputStream, doReadRemoteInvocation, doWriteRemoteInvocationResult, getContentType, getProxy, prepare, setContentType
Methods inherited from class org.springframework.remoting.support.RemoteInvocationBasedExporter
getRemoteInvocationExecutor, invoke, invokeAndCreateResult, setRemoteInvocationExecutor
Methods inherited from class org.springframework.remoting.support.RemoteExporter
checkService, checkServiceInterface, getExporterName, getProxyForService, getService, getServiceInterface, setInterceptors, setRegisterTraceInterceptor, setService, setServiceInterface
Methods inherited from class org.springframework.remoting.support.RemotingSupport
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleHttpInvokerServiceExporter

public SimpleHttpInvokerServiceExporter()
Method Detail

handle

public void handle(HttpExchange exchange)
            throws IOException
Reads a remote invocation from the request, executes it, and writes the remote invocation result to the response.

Specified by:
handle in interface HttpHandler
Throws:
IOException
See Also:
readRemoteInvocation(com.sun.net.httpserver.HttpExchange),
RemoteInvocationBasedExporter.invokeAndCreateResult(org.springframework.remoting.support.RemoteInvocation, Object),
writeRemoteInvocationResult(com.sun.net.httpserver.HttpExchange, org.springframework.remoting.support.RemoteInvocationResult)

readRemoteInvocation

protected RemoteInvocation readRemoteInvocation(HttpExchange exchange)
                                         throws IOException,
                                                ClassNotFoundException
Read a RemoteInvocation from the given HTTP request.

Delegates to readRemoteInvocation(com.sun.net.httpserver.HttpExchange, java.io.InputStream) with the HttpExchange.getRequestBody() request's input stream}.

Parameters:
exchange - current HTTP request/response
Returns:
the RemoteInvocation object
Throws:
IOException - in case of I/O failure
ClassNotFoundException - if thrown by deserialization

readRemoteInvocation

protected RemoteInvocation readRemoteInvocation(HttpExchange exchange,
                                                InputStream is)
                                         throws IOException,
                                                ClassNotFoundException
Deserialize a RemoteInvocation object from the given InputStream.

Gives decorateInputStream(com.sun.net.httpserver.HttpExchange, java.io.InputStream) a chance to decorate the stream first (for example, for custom encryption or compression). Creates a CodebaseAwareObjectInputStream and calls RemoteInvocationSerializingExporter.doReadRemoteInvocation(java.io.ObjectInputStream) to actually read the object.

Can be overridden for custom serialization of the invocation.

Parameters:
exchange - current HTTP request/response
is - the InputStream to read from
Returns:
the RemoteInvocation object
Throws:
IOException - in case of I/O failure
ClassNotFoundException - if thrown during deserialization

decorateInputStream

protected InputStream decorateInputStream(HttpExchange exchange,
                                          InputStream is)
                                   throws IOException
Return the InputStream to use for reading remote invocations, potentially decorating the given original InputStream.

The default implementation returns the given stream as-is. Can be overridden, for example, for custom encryption or compression.

Parameters:
exchange - current HTTP request/response
is - the original InputStream
Returns:
the potentially decorated InputStream
Throws:
IOException - in case of I/O failure

writeRemoteInvocationResult

protected void writeRemoteInvocationResult(HttpExchange exchange,
                                           RemoteInvocationResult result)
                                    throws IOException
Write the given RemoteInvocationResult to the given HTTP response.

Parameters:
exchange - current HTTP request/response
result - the RemoteInvocationResult object
Throws:
IOException - in case of I/O failure

writeRemoteInvocationResult

protected void writeRemoteInvocationResult(HttpExchange exchange,
                                           RemoteInvocationResult result,
                                           OutputStream os)
                                    throws IOException
Serialize the given RemoteInvocation to the given OutputStream.

The default implementation gives decorateOutputStream(com.sun.net.httpserver.HttpExchange, java.io.OutputStream) a chance to decorate the stream first (for example, for custom encryption or compression). Creates an ObjectOutputStream for the final stream and calls RemoteInvocationSerializingExporter.doWriteRemoteInvocationResult(org.springframework.remoting.support.RemoteInvocationResult, java.io.ObjectOutputStream) to actually write the object.

Can be overridden for custom serialization of the invocation.

Parameters:
exchange - current HTTP request/response
result - the RemoteInvocationResult object
os - the OutputStream to write to
Throws:
IOException - in case of I/O failure
See Also:
decorateOutputStream(com.sun.net.httpserver.HttpExchange, java.io.OutputStream), RemoteInvocationSerializingExporter.doWriteRemoteInvocationResult(org.springframework.remoting.support.RemoteInvocationResult, java.io.ObjectOutputStream)

decorateOutputStream

protected OutputStream decorateOutputStream(HttpExchange exchange,
                                            OutputStream os)
                                     throws IOException
Return the OutputStream to use for writing remote invocation results, potentially decorating the given original OutputStream.

The default implementation returns the given stream as-is. Can be overridden, for example, for custom encryption or compression.

Parameters:
exchange - current HTTP request/response
os - the original OutputStream
Returns:
the potentially decorated OutputStream
Throws:
IOException - in case of I/O failure
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.remoting.jaxrpc

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.remoting.jaxrpc

Remoting classes for Web Services via JAX-RPC.

See:
Description

Interface Summary
JaxRpcServicePostProcessor Deprecated. in favor of JAX-WS support in org.springframework.remoting.jaxws

Class Summary
JaxRpcPortClientInterceptor | Deprecated. in favor of JAX-WS support in org.springframework.remoting.jaxws
JaxRpcPortProxyFactoryBean | Deprecated. in favor of JAX-WS support in org.springframework.remoting.jaxws
LocalJaxRpcServiceFactory | Deprecated. in favor of JAX-WS support in org.springframework.remoting.jaxws
LocalJaxRpcServiceFactoryBean | Deprecated. in favor of JAX-WS support in org.springframework.remoting.jaxws
ServletEndpointSupport | Deprecated. in favor of JAX-WS support in org.springframework.remoting.jaxws

Exception Summary
JaxRpcSoapFaultException Deprecated. in favor of JAX-WS support in org.springframework.remoting.jaxws

Package org.springframework.remoting.jaxrpc Description

Remoting classes for Web Services via JAX-RPC. This package provides proxy factories for accessing JAX-RPC services and ports, and a support class for implementing JAX-RPC Servlet endpoints.


org.springframework.remoting.jaxrpc Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.remoting.jaxrpc

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
      • org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor (implements org.springframework.beans.factory.InitializingBean, org.aopalliance.intercept.MethodInterceptor)
        • org.springframework.remoting.jaxrpc.JaxRpcPortProxyFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.FactoryBean<T>)
      • org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.remoting.jaxrpc.ServletEndpointSupport (implements javax.xml.rpc.server.ServiceLifecycle)
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.remoting.RemoteAccessException
              • org.springframework.remoting.RemoteInvocationFailureException
                • org.springframework.remoting.soap.SoapFaultException
                  • org.springframework.remoting.jaxrpc.JaxRpcSoapFaultException

Interface Hierarchy

  • org.springframework.remoting.jaxrpc.JaxRpcServicePostProcessor


JaxRpcServicePostProcessor

org.springframework.remoting.jaxrpc
Interface JaxRpcServicePostProcessor

Deprecated. in favor of JAX-WS support in org.springframework.remoting.jaxws

@Deprecated
public interface JaxRpcServicePostProcessor

Callback interface for post-processing a JAX-RPC Service.

Implementations can be registered with LocalJaxRpcServiceFactory or one of its subclasses: LocalJaxRpcServiceFactoryBean, JaxRpcPortClientInterceptor, or JaxRpcPortProxyFactoryBean.

Useful, for example, to register custom type mappings. See the org.springframework.remoting.jaxrpc.support.AxisBeanMappingServicePostProcessor class that registers Axis-specific bean mappings for specified bean classes. This is defined for the domain objects in the JPetStore same application, for example.

Since:
1.1.4
Author:
Juergen Hoeller
See Also:
LocalJaxRpcServiceFactory.setServicePostProcessors(org.springframework.remoting.jaxrpc.JaxRpcServicePostProcessor[]),
LocalJaxRpcServiceFactory.setServicePostProcessors(org.springframework.remoting.jaxrpc.JaxRpcServicePostProcessor[]),
LocalJaxRpcServiceFactory.setServicePostProcessors(org.springframework.remoting.jaxrpc.JaxRpcServicePostProcessor[]),
LocalJaxRpcServiceFactory.setServicePostProcessors(org.springframework.remoting.jaxrpc.JaxRpcServicePostProcessor[]),
Service.getTypeMappingRegistry()

Method Summary
 void postProcessJaxRpcService(Service service)
Deprecated. Post-process the given JAX-RPC Service.

Method Detail

postProcessJaxRpcService

void postProcessJaxRpcService(Service service)
Deprecated.
Post-process the given JAX-RPC Service.

Parameters:
service - the current JAX-RPC Service (can be cast to an implementation-specific class if necessary)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JaxRpcPortClientInterceptor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.remoting.jaxrpc
Class JaxRpcPortClientInterceptor

java.lang.Object
    extended by  org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
        extended by  org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, InitializingBean
Direct Known Subclasses:
JaxRpcPortProxyFactoryBean
Deprecated. in favor of JAX-WS support in org.springframework.remoting.jaxws

@Deprecated
public class JaxRpcPortClientInterceptor
extends LocalJaxRpcServiceFactory
implements MethodInterceptor, InitializingBean

MethodInterceptor for accessing a specific port of a JAX-RPC service. Uses either LocalJaxRpcServiceFactory's facilities underneath or takes an explicit reference to an existing JAX-RPC Service instance (e.g. obtained via a JndiObjectFactoryBean).

Allows to set JAX-RPC's standard stub properties directly, via the "username", "password", "endpointAddress" and "maintainSession" properties. For typical usage, it is not necessary to specify those.

In standard JAX-RPC style, this invoker is used with an RMI service interface. Alternatively, this invoker can also proxy a JAX-RPC service with a matching non-RMI business interface, that is, an interface that declares the service methods without RemoteExceptions. In the latter case, RemoteExceptions thrown by JAX-RPC will automatically get converted to Spring's unchecked RemoteAccessException.

Setting "serviceInterface" is usually sufficient: The invoker will automatically use JAX-RPC "dynamic invocations" via the Call API in this case, no matter whether the specified interface is an RMI or non-RMI interface. Alternatively, a corresponding JAX-RPC port interface can be specified as "portInterface", which will turn this invoker into "static invocation" mode (operating on a standard JAX-RPC port stub).

Since:
15.12.2003
Author:
Juergen Hoeller
See Also:
setPortName(java.lang.String),
setServiceInterface(java.lang.Class),
setPortInterface(java.lang.Class),
Service.createCall(javax.xml.namespace.QName),
Service.getPort(javax.xml.namespace.QName, java.lang.Class),
RemoteAccessException,
JndiObjectFactoryBean

Field Summary
Fields inherited from class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
logger
Constructor Summary
JaxRpcPortClientInterceptor()
Deprecated.
Method Summary
void | addCustomProperty(String name, Object value) Deprecated. Add a custom property to this JAX-RPC Stub/Call.
void | afterPropertiesSet() Deprecated. Prepares the JAX-RPC service and port if the "lookupServiceOnStartup" is turned on (which it is by default).
protected boolean | alwaysUseJaxRpcCall() Deprecated. Return whether to always use JAX-RPC dynamic calls.
protected Object | doInvoke(MethodInvocation invocation) Deprecated. Perform a JAX-RPC service invocation based on the given method invocation.
protected Object | doInvoke(MethodInvocation invocation, Remote portStub) Deprecated. Perform a JAX-RPC service invocation on the given port stub.
Map<String,Object> | getCustomPropertyMap() Deprecated. Allow Map access to the custom properties to be set on the stub or call, with the option to add or override specific entries.
String | getEndpointAddress() Deprecated. Return the endpoint address to specify on the stub or call.
Service | getJaxRpcService() Deprecated. Return a reference to an existing JAX-RPC Service instance, if any.
String | getPassword() Deprecated. Return the password to specify on the stub or call.
Class | getPortInterface() Deprecated. Return the JAX-RPC port interface to use.
String | getPortName() Deprecated. Return the name of the port.
protected QName | getPortQName() Deprecated. Return the prepared QName for the port.
protected Remote | getPortStub() Deprecated. Return the underlying JAX-RPC port stub that this interceptor delegates to for each method invocation on the proxy.
Class | getServiceInterface() Deprecated. Return the interface of the service that this factory should create a proxy for.
String | getUsername() Deprecated. Return the username to specify on the stub or call.
protected Throwable | handleRemoteException(Method method, RemoteException ex) Deprecated. Handle the given RemoteException that was thrown from a JAX-RPC port stub or JAX-RPC call invocation.
Object | invoke(MethodInvocation invocation) Deprecated. Translates the method invocation into a JAX-RPC service invocation.
protected boolean | isConnectFailure(RemoteException ex) Deprecated. Determine whether the given RMI exception indicates a connect failure.
boolean | isMaintainSession() Deprecated. Return the maintain session flag to specify on the stub or call.
protected boolean | isPrepared() Deprecated. Return whether this client interceptor has already been prepared, i.e.
protected Object | performJaxRpcCall(MethodInvocation invocation, Service service) Deprecated. Perform a JAX-RPC dynamic call for the given AOP method invocation.
protected void | postProcessJaxRpcCall(Call call, MethodInvocation invocation) Deprecated. Post-process the given JAX-RPC call.
protected void | postProcessPortStub(Stub stub) Deprecated. Post-process the given JAX-RPC port stub.
void | prepare() Deprecated. Create and initialize the JAX-RPC service for the specified port.
protected void | prepareJaxRpcCall(Call call) Deprecated. Prepare the given JAX-RPC call, applying properties to it.
protected void | preparePortStub(Stub stub) Deprecated. Prepare the given JAX-RPC port stub, applying properties to it.
protected void | reset() Deprecated. Reset the prepared service of this interceptor, allowing for reinitialization on next access.
void | setCustomProperties(Properties customProperties) Deprecated. Set custom properties to be set on the stub or call.
void | setCustomPropertyMap(Map<String,Object> customProperties) Deprecated. Set custom properties to be set on the stub or call.
void | setEndpointAddress(String endpointAddress) Deprecated. Set the endpoint address to specify on the stub or call.
void | setJaxRpcService(Service jaxRpcService) Deprecated. Set a reference to an existing JAX-RPC Service instance, for example obtained via JndiObjectFactoryBean.
void | setLookupServiceOnStartup(boolean lookupServiceOnStartup) Deprecated. Set whether to look up the JAX-RPC service on startup.
void | setMaintainSession(boolean maintainSession) Deprecated. Set the maintain session flag to specify on the stub or call.
void | setPassword(String password) Deprecated. Set the password to specify on the stub or call.
void | setPortInterface(Class portInterface) Deprecated. Set the JAX-RPC port interface to use.
void | setPortName(String portName) Deprecated. Set the name of the port.
void | setRefreshServiceAfterConnectFailure(boolean refreshServiceAfterConnectFailure) Deprecated. Set whether to refresh the JAX-RPC service on connect failure, that is, whenever a JAX-RPC invocation throws a RemoteException.
void | setServiceInterface(Class serviceInterface) Deprecated. Set the interface of the service that this factory should create a proxy for.
void | setUsername(String username) Deprecated. Set the username to specify on the stub or call.
Methods inherited from class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
createJaxRpcService, createService, createServiceFactory, getJaxRpcServiceInterface, getJaxRpcServiceProperties, getNamespaceUri, getQName, getServiceFactory, getServiceFactoryClass, getServiceName, getServicePostProcessors, getWsdlDocumentUrl, postProcessJaxRpcService, setJaxRpcServiceInterface, setJaxRpcServiceProperties, setNamespaceUri, setServiceFactory, setServiceFactoryClass, setServiceName, setServicePostProcessors, setWsdlDocumentUrl
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JaxRpcPortClientInterceptor

public JaxRpcPortClientInterceptor()
Deprecated.
Method Detail

setJaxRpcService

public void setJaxRpcService(Service jaxRpcService)
Deprecated.
Set a reference to an existing JAX-RPC Service instance, for example obtained via JndiObjectFactoryBean. If not set, LocalJaxRpcServiceFactory's properties have to be specified.

See Also:
LocalJaxRpcServiceFactory.setServiceFactoryClass(java.lang.Class),
LocalJaxRpcServiceFactory.setWsdlDocumentUrl(java.net.URL),
LocalJaxRpcServiceFactory.setNamespaceUri(java.lang.String),
LocalJaxRpcServiceFactory.setServiceName(java.lang.String),
JndiObjectFactoryBean

getJaxRpcService

public Service getJaxRpcService()
Deprecated.
Return a reference to an existing JAX-RPC Service instance, if any.

setPortName

public void setPortName(String portName)
Deprecated.
Set the name of the port. Corresponds to the "wsdl:port" name.

getPortName

public String getPortName()
Deprecated.
Return the name of the port.

setUsername

public void setUsername(String username)
Deprecated.
Set the username to specify on the stub or call.

See Also:
Stub.USERNAME_PROPERTY, Call.USERNAME_PROPERTY

getUsername

public String getUsername()
Deprecated.
Return the username to specify on the stub or call.

setPassword

public void setPassword(String password)
Deprecated.
Set the password to specify on the stub or call.

See Also:
Stub.PASSWORD_PROPERTY, Call.PASSWORD_PROPERTY

getPassword

public String getPassword()
Deprecated.
Return the password to specify on the stub or call.

setEndpointAddress

public void setEndpointAddress(String endpointAddress)
Deprecated.
Set the endpoint address to specify on the stub or call.

See Also:
Stub.ENDPOINT_ADDRESS_PROPERTY, Call.setTargetEndpointAddress(java.lang.String)

getEndpointAddress

public String getEndpointAddress()
Deprecated.
Return the endpoint address to specify on the stub or call.

setMaintainSession

public void setMaintainSession(boolean maintainSession)
Deprecated.
Set the maintain session flag to specify on the stub or call.

See Also:
Stub.SESSION_MAINTAIN_PROPERTY, Call.SESSION_MAINTAIN_PROPERTY

isMaintainSession

public boolean isMaintainSession()
Deprecated.
Return the maintain session flag to specify on the stub or call.

setCustomProperties

public void setCustomProperties(Properties customProperties)
Deprecated.
Set custom properties to be set on the stub or call.

Can be populated with a String "value" (parsed via PropertiesEditor) or a "props" element in XML bean definitions.

See Also:
Stub._setProperty(java.lang.String, java.lang.Object), Call.setProperty(java.lang.String, java.lang.Object)

setCustomPropertyMap

public void setCustomPropertyMap(Map<String,Object> customProperties)
Deprecated.
Set custom properties to be set on the stub or call.

Can be populated with a "map" or "props" element in XML bean definitions.

See Also:
Stub._setProperty(java.lang.String, java.lang.Object), Call.setProperty(java.lang.String, java.lang.Object)

getCustomPropertyMap

public Map<String,Object> getCustomPropertyMap()
Deprecated.
Allow Map access to the custom properties to be set on the stub or call, with the option to add or override specific entries.

Useful for specifying entries directly, for example via "customPropertyMap[myKey]". This is particularly useful for adding or overriding entries in child bean definitions.

addCustomProperty

public void addCustomProperty(String name,
                              Object value)
Deprecated.
Add a custom property to this JAX-RPC Stub/Call.

Parameters:
name - the name of the attribute to expose
value - the attribute value to expose
See Also:
Stub._setProperty(java.lang.String, java.lang.Object), Call.setProperty(java.lang.String, java.lang.Object)

setServiceInterface

public void setServiceInterface(Class serviceInterface)
Deprecated.
Set the interface of the service that this factory should create a proxy for. This will typically be a non-RMI business interface, although you can also use an RMI port interface as recommended by JAX-RPC here.

Calls on the specified service interface will either be translated to the underlying RMI port interface (in case of a "portInterface" being specified) or to dynamic calls (using the JAX-RPC Dynamic Invocation Interface).

The dynamic call mechanism has the advantage that you don't need to maintain an RMI port interface in addition to an existing non-RMI business interface. In terms of configuration, specifying the business interface as "serviceInterface" will be enough; this interceptor will automatically use dynamic calls in such a scenario.

See Also:
Service.createCall(javax.xml.namespace.QName), setPortInterface(java.lang.Class)

getServiceInterface

public Class getServiceInterface()
Deprecated.
Return the interface of the service that this factory should create a proxy for.

setPortInterface

public void setPortInterface(Class portInterface)
Deprecated.
Set the JAX-RPC port interface to use. Only needs to be set if a JAX-RPC port stub should be used instead of the dynamic call mechanism. See the javadoc of the "serviceInterface" property for more details.

The interface must be suitable for a JAX-RPC port, that is, it must be an RMI service interface (that extends java.rmi.Remote).

NOTE: Check whether your JAX-RPC provider returns thread-safe port stubs. If not, use the dynamic call mechanism instead, which will always be thread-safe. In particular, do not use JAX-RPC port stubs with Apache Axis, whose port stubs are known to be non-thread-safe.

See Also:
Service.getPort(javax.xml.namespace.QName, java.lang.Class), Remote, setServiceInterface(java.lang.Class)

getPortInterface

public Class getPortInterface()
Deprecated.
Return the JAX-RPC port interface to use.

setLookupServiceOnStartup

public void setLookupServiceOnStartup(boolean lookupServiceOnStartup)
Deprecated.
Set whether to look up the JAX-RPC service on startup.

Default is "true". Turn this flag off to allow for late start of the target server. In this case, the JAX-RPC service will be lazily fetched on first access.

setRefreshServiceAfterConnectFailure

public void setRefreshServiceAfterConnectFailure(boolean refreshServiceAfterConnectFailure)
Deprecated.
Set whether to refresh the JAX-RPC service on connect failure, that is, whenever a JAX-RPC invocation throws a RemoteException.

Default is "false", keeping a reference to the JAX-RPC service in any case, retrying the next invocation on the same service even in case of failure. Turn this flag on to reinitialize the entire service in case of connect failures.

afterPropertiesSet

public void afterPropertiesSet()
Deprecated.
Prepares the JAX-RPC service and port if the "lookupServiceOnStartup" is turned on (which it is by default).

Specified by:
afterPropertiesSet in interface InitializingBean

prepare

public void prepare()
             throws RemoteLookupFailureException
Deprecated.
Create and initialize the JAX-RPC service for the specified port.

Prepares a JAX-RPC stub if possible (if an RMI interface is available); falls back to JAX-RPC dynamic calls else. Using dynamic calls can be enforced through overriding alwaysUseJaxRpcCall() to return true.

LocalJaxRpcServiceFactory.postProcessJaxRpcService(javax.xml.rpc.Service) and postProcessPortStub(javax.xml.rpc.Stub) hooks are available for customization in subclasses. When using dynamic calls, each can be post-processed via postProcessJaxRpcCall(javax.xml.rpc.Call, org.aopalliance.intercept.MethodInvocation).

Throws:
RemoteLookupFailureException - if service initialization or port stub creation failed

alwaysUseJaxRpcCall

protected boolean alwaysUseJaxRpcCall()
Deprecated.
Return whether to always use JAX-RPC dynamic calls. Called by afterPropertiesSet.

Default is "false"; if an RMI interface is specified as "portInterface" or "serviceInterface", it will be used to create a JAX-RPC port stub.

Can be overridden to enforce the use of the JAX-RPC Call API, for example if there is a need to customize at the Call level. This just necessary if you you want to use an RMI interface as "serviceInterface", though; in case of only a non-RMI interface being available, this interceptor will fall back to the Call API anyway.

See Also:
postProcessJaxRpcCall(javax.xml.rpc.Call, org.aopalliance.intercept.MethodInvocation)

reset

protected void reset()
Deprecated.
Reset the prepared service of this interceptor, allowing for reinitialization on next access.

isPrepared

protected boolean isPrepared()
Deprecated.
Return whether this client interceptor has already been prepared, i.e. has already looked up the JAX-RPC service and port.

getPortQName

protected final QName getPortQName()
Deprecated.
Return the prepared QName for the port.

See Also:
setPortName(java.lang.String), LocalJaxRpcServiceFactory.getQName(java.lang.String)

preparePortStub

protected void preparePortStub(Stub stub)
Deprecated.
Prepare the given JAX-RPC port stub, applying properties to it. Called by prepare().

Just applied when actually creating a JAX-RPC port stub, in case of a compliant port interface. Else, JAX-RPC dynamic calls will be used.

Parameters:
stub - the current JAX-RPC port stub
See Also:
setUsername(java.lang.String),
setPassword(java.lang.String),
setEndpointAddress(java.lang.String),
setMaintainSession(boolean),
setCustomProperties(java.util.Properties),
setPortInterface(java.lang.Class),
prepareJaxRpcCall(javax.xml.rpc.Call)

postProcessPortStub

protected void postProcessPortStub(Stub stub)
Deprecated.
Post-process the given JAX-RPC port stub. Called by prepare().

The default implementation is empty.

Just applied when actually creating a JAX-RPC port stub, in case of a compliant port interface. Else, JAX-RPC dynamic calls will be used.

Parameters:
stub - the current JAX-RPC port stub (can be cast to an implementation-specific class if necessary)
See Also:
setPortInterface(java.lang.Class), postProcessJaxRpcCall(javax.xml.rpc.Call, org.aopalliance.intercept.MethodInvocation)

getPortStub

protected Remote getPortStub()
Deprecated.
Return the underlying JAX-RPC port stub that this interceptor delegates to for each method invocation on the proxy.

invoke

public Object invoke(MethodInvocation invocation)
              throws Throwable
Deprecated.
Translates the method invocation into a JAX-RPC service invocation.

Prepares the service on the fly, if necessary, in case of lazy lookup or a connect failure having happened.

Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable
See Also:
prepare(), doInvoke(org.aopalliance.intercept.MethodInvocation)

doInvoke

protected Object doInvoke(MethodInvocation invocation)
                   throws Throwable
Deprecated.
Perform a JAX-RPC service invocation based on the given method invocation.

Uses traditional RMI stub invocation if a JAX-RPC port stub is available; falls back to JAX-RPC dynamic calls else.

Parameters:
invocation - the AOP method invocation
Returns:
the invocation result, if any
Throws:
Throwable - in case of invocation failure
See Also:
getPortStub(),
doInvoke(org.aopalliance.intercept.MethodInvocation, java.rmi.Remote),
performJaxRpcCall(org.aopalliance.intercept.MethodInvocation, javax.xml.rpc.Service)

doInvoke

protected Object doInvoke(MethodInvocation invocation,
                          Remote portStub)
                   throws Throwable
Deprecated.
Perform a JAX-RPC service invocation on the given port stub.

Parameters:
invocation - the AOP method invocation
portStub - the RMI port stub to invoke
Returns:
the invocation result, if any
Throws:
Throwable - in case of invocation failure
See Also:
getPortStub(),
doInvoke(org.aopalliance.intercept.MethodInvocation, java.rmi.Remote),
performJaxRpcCall(org.aopalliance.intercept.MethodInvocation, javax.xml.rpc.Service)

performJaxRpcCall

protected Object performJaxRpcCall(MethodInvocation invocation,
                                   Service service)
                            throws Throwable
Deprecated.
Perform a JAX-RPC dynamic call for the given AOP method invocation. Delegates to prepareJaxRpcCall(javax.xml.rpc.Call) and postProcessJaxRpcCall(javax.xml.rpc.Call, org.aopalliance.intercept.MethodInvocation) for setting up the call object.

The default implementation uses method name as JAX-RPC operation name and method arguments as arguments for the JAX-RPC call. Can be overridden in subclasses for custom operation names and/or arguments.

Parameters:
invocation - the current AOP MethodInvocation that should be converted to a JAX-RPC call
service - the JAX-RPC Service to use for the call
Returns:
the return value of the invocation, if any
Throws:
Throwable - the exception thrown by the invocation, if any
See Also:
prepareJaxRpcCall(javax.xml.rpc.Call), postProcessJaxRpcCall(javax.xml.rpc.Call, org.aopalliance.intercept.MethodInvocation)

prepareJaxRpcCall

protected void prepareJaxRpcCall(Call call)
Deprecated.
Prepare the given JAX-RPC call, applying properties to it. Called by invoke(org.aopalliance.intercept.MethodInvocation).

Just applied when actually using JAX-RPC dynamic calls, i.e. if no compliant port interface was specified. Else, a JAX-RPC port stub will be used.

Parameters:
call - the current JAX-RPC call object
See Also:
setUsername(java.lang.String),
setPassword(java.lang.String),
setEndpointAddress(java.lang.String),
setMaintainSession(boolean),
setCustomProperties(java.util.Properties),
setPortInterface(java.lang.Class),
preparePortStub(javax.xml.rpc.Stub)

postProcessJaxRpcCall

protected void postProcessJaxRpcCall(Call call,
                                     MethodInvocation invocation)
Deprecated.
Post-process the given JAX-RPC call. Called by invoke(org.aopalliance.intercept.MethodInvocation).

The default implementation is empty.

Just applied when actually using JAX-RPC dynamic calls, i.e. if no compliant port interface was specified. Else, a JAX-RPC port stub will be used.

Parameters:
call - the current JAX-RPC call object (can be cast to an implementation-specific class if necessary)
invocation - the current AOP MethodInvocation that the call was created for (can be used to check method name, method parameters and/or passed-in arguments)
See Also:
setPortInterface(java.lang.Class), postProcessPortStub(javax.xml.rpc.Stub)

handleRemoteException

protected Throwable handleRemoteException(Method method,
                                          RemoteException ex)
Deprecated.
Handle the given RemoteException that was thrown from a JAX-RPC port stub or JAX-RPC call invocation.

Parameters:
method - the service interface method that we invoked
ex - the original RemoteException
Returns:
the exception to rethrow (may be the original RemoteException or an extracted/wrapped exception, but never null)

isConnectFailure

protected boolean isConnectFailure(RemoteException ex)
Deprecated.
Determine whether the given RMI exception indicates a connect failure.

The default implementation returns true unless the exception class name (or exception superclass name) contains the term "Fault" (e.g. "AxisFault"), assuming that the JAX-RPC provider only throws RemoteException in case of WSDL faults and connect failures.

Parameters:
ex - the RMI exception to check
Returns:
whether the exception should be treated as connect failure
See Also:
RmiClientInterceptorUtils.isConnectFailure(java.rmi.RemoteException)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


JaxRpcPortProxyFactoryBean

org.springframework.remoting.jaxrpc
Class JaxRpcPortProxyFactoryBean

java.lang.Object
    extended by  org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
        extended by  org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
            extended by  org.springframework.remoting.jaxrpc.JaxRpcPortProxyFactoryBean
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, BeanClassLoaderAware, FactoryBean<Object>, InitializingBean
Deprecated. in favor of JAX-WS support in org.springframework.remoting.jaxws

@Deprecated
public class JaxRpcPortProxyFactoryBean
extends JaxRpcPortClientInterceptor
implements FactoryBean<Object>, BeanClassLoaderAware

FactoryBean for a specific port of a JAX-RPC service. Exposes a proxy for the port, to be used for bean references. Inherits configuration properties from JaxRpcPortClientInterceptor.

This factory is typically used with an RMI service interface. Alternatively, this factory can also proxy a JAX-RPC service with a matching non-RMI business interface, i.e. an interface that mirrors the RMI service methods but does not declare RemoteExceptions. In the latter case, RemoteExceptions thrown by the JAX-RPC stub will automatically get converted to Spring's unchecked RemoteAccessException.

If exposing the JAX-RPC port interface (i.e. an RMI interface) directly, setting "serviceInterface" is sufficient. If exposing a non-RMI business interface, the business interface needs to be set as "serviceInterface", and the JAX-RPC port interface as "portInterface".

Since:
15.12.2003
Author:
Juergen Hoeller
See Also:
JaxRpcPortClientInterceptor.setServiceInterface(java.lang.Class), JaxRpcPortClientInterceptor.setPortInterface(java.lang.Class), LocalJaxRpcServiceFactoryBean

Field Summary
Fields inherited from class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
logger
Constructor Summary
JaxRpcPortProxyFactoryBean()
Deprecated.
Method Summary
 void afterPropertiesSet()
Deprecated. Prepares the JAX-RPC service and port if the "lookupServiceOnStartup" is turned on (which it is by default).
 Object getObject()
Deprecated. Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<?> getObjectType()
Deprecated. Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Deprecated. Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setBeanClassLoader(ClassLoader classLoader)
Deprecated. Callback that supplies the bean class loader to a bean instance.
Methods inherited from class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
addCustomProperty, alwaysUseJaxRpcCall, doInvoke, doInvoke, getCustomPropertyMap, getEndpointAddress, getJaxRpcService, getPassword, getPortInterface, getPortName, getPortQName, getPortStub, getServiceInterface, getUsername, handleRemoteException, invoke, isConnectFailure, isMaintainSession, isPrepared, performJaxRpcCall, postProcessJaxRpcCall, postProcessPortStub, prepare, prepareJaxRpcCall, preparePortStub, reset, setCustomProperties, setCustomPropertyMap, setEndpointAddress, setJaxRpcService, setLookupServiceOnStartup, setMaintainSession, setPassword, setPortInterface, setPortName, setRefreshServiceAfterConnectFailure, setServiceInterface, setUsername
Methods inherited from class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
createJaxRpcService, createService, createServiceFactory, getJaxRpcServiceInterface, getJaxRpcServiceProperties, getNamespaceUri, getQName, getServiceFactory, getServiceFactoryClass, getServiceName, getServicePostProcessors, getWsdlDocumentUrl, postProcessJaxRpcService, setJaxRpcServiceInterface, setJaxRpcServiceProperties, setNamespaceUri, setServiceFactory, setServiceFactoryClass, setServiceName, setServicePostProcessors, setWsdlDocumentUrl
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JaxRpcPortProxyFactoryBean

public JaxRpcPortProxyFactoryBean()
Deprecated.
Method Detail

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Deprecated.
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

afterPropertiesSet

public void afterPropertiesSet()
Deprecated.
Description copied from class: JaxRpcPortClientInterceptor
Prepares the JAX-RPC service and port if the "lookupServiceOnStartup" is turned on (which it is by default).

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class JaxRpcPortClientInterceptor

getObject

public Object getObject()
Deprecated.
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<Object>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<?> getObjectType()
Deprecated.
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<Object>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Deprecated.
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<Object>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LocalJaxRpcServiceFactory

org.springframework.remoting.jaxrpc
Class LocalJaxRpcServiceFactory

java.lang.Object
    extended by  org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
Direct Known Subclasses:
JaxRpcPortClientInterceptor, LocalJaxRpcServiceFactoryBean
Deprecated. in favor of JAX-WS support in org.springframework.remoting.jaxws

@Deprecated
public class LocalJaxRpcServiceFactory
extends Object

Factory for locally defined JAX-RPC Service references. Uses a JAX-RPC ServiceFactory underneath.

Serves as base class for LocalJaxRpcServiceFactoryBean as well as JaxRpcPortClientInterceptor and JaxRpcPortProxyFactoryBean.

Since:
15.12.2003
Author:
Juergen Hoeller
See Also:
ServiceFactory, Service, LocalJaxRpcServiceFactoryBean, JaxRpcPortClientInterceptor, JaxRpcPortProxyFactoryBean

Field Summary
protected  Log logger
Deprecated. Logger available to subclasses
Constructor Summary
LocalJaxRpcServiceFactory()
Deprecated.
Method Summary
Service | createJaxRpcService() Deprecated. Create a JAX-RPC Service according to the parameters of this factory.
protected Service | createService(ServiceFactory serviceFactory) Deprecated. Actually create the JAX-RPC Service instance, based on this factory's settings.
protected ServiceFactory | createServiceFactory() Deprecated. Create a JAX-RPC ServiceFactory, either of the specified class or the default.
Class | getJaxRpcServiceInterface() Deprecated. Return the JAX-RPC service interface to use for looking up the service.
Properties | getJaxRpcServiceProperties() Deprecated. Return JAX-RPC service properties to be passed to the ServiceFactory, if any.
String | getNamespaceUri() Deprecated. Return the namespace URI of the service.
protected QName | getQName(String name) Deprecated. Return a QName for the given name, relative to the namespace URI of this factory, if given.
ServiceFactory | getServiceFactory() Deprecated. Return the specified ServiceFactory instance, if any.
Class | getServiceFactoryClass() Deprecated. Return the ServiceFactory class to use, or null if default.
String | getServiceName() Deprecated. Return the name of the service.
JaxRpcServicePostProcessor[] | getServicePostProcessors() Deprecated. Return the JaxRpcServicePostProcessors to be applied to JAX-RPC Service instances created by this factory.
URL | getWsdlDocumentUrl() Deprecated. Return the URL of the WSDL document that describes the service.
protected void | postProcessJaxRpcService(Service service) Deprecated. Post-process the given JAX-RPC Service.
void | setJaxRpcServiceInterface(Class jaxRpcServiceInterface) Deprecated. Set the JAX-RPC service interface to use for looking up the service.
void | setJaxRpcServiceProperties(Properties jaxRpcServiceProperties) Deprecated. Set JAX-RPC service properties to be passed to the ServiceFactory, if any.
void | setNamespaceUri(String namespaceUri) Deprecated. Set the namespace URI of the service.
void | setServiceFactory(ServiceFactory serviceFactory) Deprecated. Set the ServiceFactory instance to use.
void | setServiceFactoryClass(Class serviceFactoryClass) Deprecated. Set the ServiceFactory class to use, for example "org.apache.axis.client.ServiceFactory".
void | setServiceName(String serviceName) Deprecated. Set the name of the service to look up.
void | setServicePostProcessors(JaxRpcServicePostProcessor[] servicePostProcessors) Deprecated. Set the JaxRpcServicePostProcessors to be applied to JAX-RPC Service instances created by this factory.
void | setWsdlDocumentUrl(URL wsdlDocumentUrl) Deprecated. Set the URL of the WSDL document that describes the service.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Deprecated.
Logger available to subclasses

Constructor Detail

LocalJaxRpcServiceFactory

public LocalJaxRpcServiceFactory()
Deprecated.
Method Detail

setServiceFactory

public void setServiceFactory(ServiceFactory serviceFactory)
Deprecated.
Set the ServiceFactory instance to use.

This is an alternative to the common "serviceFactoryClass" property, allowing for a pre-initialized ServiceFactory instance to be specified.

See Also:
setServiceFactoryClass(java.lang.Class)

getServiceFactory

public ServiceFactory getServiceFactory()
Deprecated.
Return the specified ServiceFactory instance, if any.

setServiceFactoryClass

public void setServiceFactoryClass(Class serviceFactoryClass)
Deprecated.
Set the ServiceFactory class to use, for example "org.apache.axis.client.ServiceFactory".

Does not need to be set if the JAX-RPC implementation has registered itself with the JAX-RPC system property "SERVICEFACTORY_PROPERTY".

See Also:
ServiceFactory

getServiceFactoryClass

public Class getServiceFactoryClass()
Deprecated.
Return the ServiceFactory class to use, or null if default.

setWsdlDocumentUrl

public void setWsdlDocumentUrl(URL wsdlDocumentUrl)
Deprecated.
Set the URL of the WSDL document that describes the service.

getWsdlDocumentUrl

public URL getWsdlDocumentUrl()
Deprecated.
Return the URL of the WSDL document that describes the service.

setNamespaceUri

public void setNamespaceUri(String namespaceUri)
Deprecated.
Set the namespace URI of the service. Corresponds to the WSDL "targetNamespace".

getNamespaceUri

public String getNamespaceUri()
Deprecated.
Return the namespace URI of the service.

setServiceName

public void setServiceName(String serviceName)
Deprecated.
Set the name of the service to look up. Corresponds to the "wsdl:service" name.

See Also:
ServiceFactory.createService(javax.xml.namespace.QName),
ServiceFactory.createService(java.net.URL, javax.xml.namespace.QName),
ServiceFactory.loadService(java.net.URL, javax.xml.namespace.QName, java.util.Properties)

getServiceName

public String getServiceName()
Deprecated.
Return the name of the service.

setJaxRpcServiceInterface

public void setJaxRpcServiceInterface(Class jaxRpcServiceInterface)
Deprecated.
Set the JAX-RPC service interface to use for looking up the service. If specified, this will override a "serviceName" setting.

The specified interface will usually be a generated JAX-RPC service interface that directly corresponds to the WSDL service declaration. Note that this is not a port interface or the application-level service interface to be exposed by a port proxy!

Only supported by JAX-RPC 1.1 providers.

See Also:
setServiceName(java.lang.String),
ServiceFactory.loadService(Class),
ServiceFactory.loadService(java.net.URL, Class, java.util.Properties)

getJaxRpcServiceInterface

public Class getJaxRpcServiceInterface()
Deprecated.
Return the JAX-RPC service interface to use for looking up the service.

setJaxRpcServiceProperties

public void setJaxRpcServiceProperties(Properties jaxRpcServiceProperties)
Deprecated.
Set JAX-RPC service properties to be passed to the ServiceFactory, if any.

Only supported by JAX-RPC 1.1 providers.

See Also:
ServiceFactory.loadService(java.net.URL, javax.xml.namespace.QName, java.util.Properties), ServiceFactory.loadService(java.net.URL, Class, java.util.Properties)

getJaxRpcServiceProperties

public Properties getJaxRpcServiceProperties()
Deprecated.
Return JAX-RPC service properties to be passed to the ServiceFactory, if any.

setServicePostProcessors

public void setServicePostProcessors(JaxRpcServicePostProcessor[] servicePostProcessors)
Deprecated.
Set the JaxRpcServicePostProcessors to be applied to JAX-RPC Service instances created by this factory.

Such post-processors can, for example, register custom type mappings. They are reusable across all pre-built subclasses of this factory: LocalJaxRpcServiceFactoryBean, JaxRpcPortClientInterceptor, JaxRpcPortProxyFactoryBean.

See Also:
LocalJaxRpcServiceFactoryBean, JaxRpcPortClientInterceptor, JaxRpcPortProxyFactoryBean

getServicePostProcessors

public JaxRpcServicePostProcessor[] getServicePostProcessors()
Deprecated.
Return the JaxRpcServicePostProcessors to be applied to JAX-RPC Service instances created by this factory.

createJaxRpcService

public Service createJaxRpcService()
                            throws ServiceException
Deprecated.
Create a JAX-RPC Service according to the parameters of this factory.

Throws:
ServiceException
See Also:
setServiceName(java.lang.String),
setWsdlDocumentUrl(java.net.URL),
postProcessJaxRpcService(javax.xml.rpc.Service)

getQName

protected QName getQName(String name)
Deprecated.
Return a QName for the given name, relative to the namespace URI of this factory, if given.

See Also:
setNamespaceUri(java.lang.String)

createServiceFactory

protected ServiceFactory createServiceFactory()
                                       throws ServiceException
Deprecated.
Create a JAX-RPC ServiceFactory, either of the specified class or the default.

Throws:
ServiceException - if thrown by JAX-RPC methods
See Also:
setServiceFactoryClass(java.lang.Class), ServiceFactory.newInstance()

createService

protected Service createService(ServiceFactory serviceFactory)
                         throws ServiceException
Deprecated.
Actually create the JAX-RPC Service instance, based on this factory's settings.

Parameters:
serviceFactory - the JAX-RPC ServiceFactory to use
Returns:
the newly created JAX-RPC Service
Throws:
ServiceException - if thrown by JAX-RPC methods
See Also:
ServiceFactory.createService(java.net.URL, javax.xml.namespace.QName), ServiceFactory.loadService(java.lang.Class)

postProcessJaxRpcService

protected void postProcessJaxRpcService(Service service)
Deprecated.
Post-process the given JAX-RPC Service. Called by createJaxRpcService(). Useful, for example, to register custom type mappings.

The default implementation delegates to all registered JaxRpcServicePostProcessors. It is usually preferable to implement custom type mappings etc there rather than in a subclass of this factory, to allow for reuse of the post-processors.

Parameters:
service - the current JAX-RPC Service (can be cast to an implementation-specific class if necessary)
See Also:
setServicePostProcessors(org.springframework.remoting.jaxrpc.JaxRpcServicePostProcessor[]), Service.getTypeMappingRegistry()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LocalJaxRpcServiceFactoryBean

org.springframework.remoting.jaxrpc
Class LocalJaxRpcServiceFactoryBean

java.lang.Object
    extended by  org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
        extended by  org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactoryBean
All Implemented Interfaces:
FactoryBean<Service>, InitializingBean
Deprecated. in favor of JAX-WS support in org.springframework.remoting.jaxws

@Deprecated
public class LocalJaxRpcServiceFactoryBean
extends LocalJaxRpcServiceFactory
implements FactoryBean<Service>, InitializingBean

FactoryBean for locally defined JAX-RPC Service references. Uses LocalJaxRpcServiceFactory's facilities underneath.

Alternatively, JAX-RPC Service references can be looked up in the JNDI environment of the J2EE container.

Since:
15.12.2003
Author:
Juergen Hoeller
See Also:
Service, JndiObjectFactoryBean, JaxRpcPortProxyFactoryBean

Field Summary
Fields inherited from class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
logger
Constructor Summary
LocalJaxRpcServiceFactoryBean()
Deprecated.
Method Summary
 void afterPropertiesSet()
Deprecated. Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 Service getObject()
Deprecated. Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<? extends Service> getObjectType()
Deprecated. Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Deprecated. Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
Methods inherited from class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
createJaxRpcService, createService, createServiceFactory, getJaxRpcServiceInterface, getJaxRpcServiceProperties, getNamespaceUri, getQName, getServiceFactory, getServiceFactoryClass, getServiceName, getServicePostProcessors, getWsdlDocumentUrl, postProcessJaxRpcService, setJaxRpcServiceInterface, setJaxRpcServiceProperties, setNamespaceUri, setServiceFactory, setServiceFactoryClass, setServiceName, setServicePostProcessors, setWsdlDocumentUrl
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

LocalJaxRpcServiceFactoryBean

public LocalJaxRpcServiceFactoryBean()
Deprecated.
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws ServiceException
Deprecated.
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
ServiceException

getObject

public Service getObject()
                  throws Exception
Deprecated.
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<Service>
Returns:
an instance of the bean (can be null)
Throws:
Exception - in case of creation errors
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends Service> getObjectType()
Deprecated.
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<Service>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Deprecated.
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<Service>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletEndpointSupport

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.remoting.jaxrpc
Class ServletEndpointSupport

java.lang.Object
    extended by  org.springframework.remoting.jaxrpc.ServletEndpointSupport
All Implemented Interfaces:
ServiceLifecycle
Deprecated. in favor of JAX-WS support in org.springframework.remoting.jaxws

@Deprecated
public abstract class ServletEndpointSupport
extends Object
implements ServiceLifecycle

Convenience base class for JAX-RPC servlet endpoint implementations. Provides a reference to the current Spring application context, e.g. for bean lookup or resource loading.

The Web Service servlet needs to run in the same web application as the Spring context to allow for access to Spring's facilities. In case of Axis, copy the AxisServlet definition into your web.xml, and set up the endpoint in "server-config.wsdd" (or use the deploy tool).

This class does not extend WebApplicationObjectSupport to not expose any public setters. For some reason, Axis tries to resolve public setters in a special way...

JAX-RPC service endpoints are usually required to implement an RMI port interface. However, many JAX-RPC implementations accept plain service endpoint classes too, avoiding the need to maintain an RMI port interface in addition to an existing non-RMI business interface. Therefore, implementing the business interface will usually be sufficient.

Since:
16.12.2003
Author:
Juergen Hoeller
See Also:
init(java.lang.Object), getWebApplicationContext()

Field Summary
protected  Log logger
Deprecated.
Constructor Summary
ServletEndpointSupport()
Deprecated.
Method Summary
void | destroy() Deprecated. This implementation of destroy is empty.
protected ApplicationContext | getApplicationContext() Deprecated. Return the current Spring ApplicationContext.
protected MessageSourceAccessor | getMessageSourceAccessor() Deprecated. Return a MessageSourceAccessor for the application context used by this object, for easy message access.
protected ServletContext | getServletContext() Deprecated. Return the current ServletContext.
protected ServletEndpointContext | getServletEndpointContext() Deprecated. Return the current JAX-RPC ServletEndpointContext.
protected File | getTempDir() Deprecated. Return the temporary directory for the current web application, as provided by the servlet container.
protected WebApplicationContext | getWebApplicationContext() Deprecated. Return the current Spring WebApplicationContext.
void | init(Object context) Deprecated. Initialize this JAX-RPC servlet endpoint.
protected void | onInit() Deprecated. Callback for custom initialization after the context has been set up.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Deprecated.
Constructor Detail

ServletEndpointSupport

public ServletEndpointSupport()
Deprecated.
Method Detail

init

public final void init(Object context)
                throws ServiceException
Deprecated.
Initialize this JAX-RPC servlet endpoint. Calls onInit after successful context initialization.

Specified by:
init in interface ServiceLifecycle
Parameters:
context - ServletEndpointContext
Throws:
ServiceException - if the context is not a ServletEndpointContext
See Also:
onInit()

getServletEndpointContext

protected final ServletEndpointContext getServletEndpointContext()
Deprecated.
Return the current JAX-RPC ServletEndpointContext.

getApplicationContext

protected final ApplicationContext getApplicationContext()
Deprecated.
Return the current Spring ApplicationContext.

getWebApplicationContext

protected final WebApplicationContext getWebApplicationContext()
Deprecated.
Return the current Spring WebApplicationContext.

getMessageSourceAccessor

protected final MessageSourceAccessor getMessageSourceAccessor()
Deprecated.
Return a MessageSourceAccessor for the application context used by this object, for easy message access.

getServletContext

protected final ServletContext getServletContext()
Deprecated.
Return the current ServletContext.

getTempDir

protected final File getTempDir()
Deprecated.
Return the temporary directory for the current web application, as provided by the servlet container.

Returns:
the File representing the temporary directory

onInit

protected void onInit()
               throws ServiceException
Deprecated.
Callback for custom initialization after the context has been set up.

Throws:
ServiceException - if initialization failed

destroy

public void destroy()
Deprecated.
This implementation of destroy is empty. Can be overridden in subclasses.

Specified by:
destroy in interface ServiceLifecycle
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


JaxRpcSoapFaultException

org.springframework.remoting.jaxrpc
Class JaxRpcSoapFaultException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.remoting.RemoteAccessException
                        extended by  org.springframework.remoting.RemoteInvocationFailureException
                            extended by  org.springframework.remoting.soap.SoapFaultException
                                extended by  org.springframework.remoting.jaxrpc.JaxRpcSoapFaultException
All Implemented Interfaces:
Serializable
Deprecated. in favor of JAX-WS support in org.springframework.remoting.jaxws

@Deprecated
public class JaxRpcSoapFaultException
extends SoapFaultException

Spring SoapFaultException adapter for the JAX-RPC SOAPFaultException class.

Since:
2.5
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
JaxRpcSoapFaultException(SOAPFaultException original)
Deprecated. Constructor for JaxRpcSoapFaultException.
Method Summary
String | getFaultActor() Deprecated. Return the actor that caused this fault.
String | getFaultCode() Deprecated. Return the SOAP fault code.
QName | getFaultCodeAsQName() Deprecated. Return the SOAP fault code as a QName object.
String | getFaultString() Deprecated. Return the descriptive SOAP fault string.
SOAPFaultException | getOriginalException() Deprecated. Return the wrapped JAX-RPC SOAPFaultException.
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

JaxRpcSoapFaultException

public JaxRpcSoapFaultException(SOAPFaultException original)
Deprecated.
Constructor for JaxRpcSoapFaultException.

Parameters:
original - the original JAX-RPC SOAPFaultException to wrap
Method Detail

getOriginalException

public final SOAPFaultException getOriginalException()
Deprecated.
Return the wrapped JAX-RPC SOAPFaultException.

getFaultCode

public String getFaultCode()
Deprecated.
Description copied from class: SoapFaultException
Return the SOAP fault code.

Specified by:
getFaultCode in class SoapFaultException

getFaultCodeAsQName

public QName getFaultCodeAsQName()
Deprecated.
Description copied from class: SoapFaultException
Return the SOAP fault code as a QName object.

Specified by:
getFaultCodeAsQName in class SoapFaultException

getFaultString

public String getFaultString()
Deprecated.
Description copied from class: SoapFaultException
Return the descriptive SOAP fault string.

Specified by:
getFaultString in class SoapFaultException

getFaultActor

public String getFaultActor()
Deprecated.
Description copied from class: SoapFaultException
Return the actor that caused this fault.

Specified by:
getFaultActor in class SoapFaultException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.remoting.jaxws

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.remoting.jaxws

Remoting classes for Web Services via JAX-WS (the successor of JAX-RPC), as included in Java 6 and Java EE 5.

See:
Description

Class Summary
AbstractJaxWsServiceExporter | Abstract exporter for JAX-WS services, autodetecting annotated service beans (through the JAX-WS WebService annotation).
JaxWsPortClientInterceptor | MethodInterceptor for accessing a specific port of a JAX-WS service.
JaxWsPortProxyFactoryBean | FactoryBean for a specific port of a JAX-WS service.
LocalJaxWsServiceFactory | Factory for locally defined JAX-WS Service references.
LocalJaxWsServiceFactoryBean | FactoryBean for locally defined JAX-WS Service references.
SimpleHttpServerJaxWsServiceExporter | Simple exporter for JAX-WS services, autodetecting annotated service beans (through the JAX-WS WebService annotation) and exporting them through the HTTP server included in Sun's JDK 1.6.
SimpleJaxWsServiceExporter | Simple exporter for JAX-WS services, autodetecting annotated service beans (through the JAX-WS WebService annotation) and exporting them with a configured base address (by default "http://localhost:8080/") using the JAX-WS provider's built-in publication support.

Exception Summary
JaxWsSoapFaultException Spring SoapFaultException adapter for the JAX-WS SOAPFaultException class.

Package org.springframework.remoting.jaxws Description

Remoting classes for Web Services via JAX-WS (the successor of JAX-RPC), as included in Java 6 and Java EE 5. This package provides proxy factories for accessing JAX-WS services and ports.


org.springframework.remoting.jaxws Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.remoting.jaxws

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.remoting.jaxws.AbstractJaxWsServiceExporter (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean)
      • org.springframework.remoting.jaxws.SimpleHttpServerJaxWsServiceExporter
      • org.springframework.remoting.jaxws.SimpleJaxWsServiceExporter
    • org.springframework.remoting.jaxws.LocalJaxWsServiceFactory
      • org.springframework.remoting.jaxws.JaxWsPortClientInterceptor (implements org.springframework.beans.factory.InitializingBean, org.aopalliance.intercept.MethodInterceptor)
        • org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.FactoryBean<T>)
      • org.springframework.remoting.jaxws.LocalJaxWsServiceFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.remoting.RemoteAccessException
              • org.springframework.remoting.RemoteInvocationFailureException
                • org.springframework.remoting.soap.SoapFaultException
                  • org.springframework.remoting.jaxws.JaxWsSoapFaultException


AbstractJaxWsServiceExporter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.remoting.jaxws
Class AbstractJaxWsServiceExporter

java.lang.Object
    extended by  org.springframework.remoting.jaxws.AbstractJaxWsServiceExporter
All Implemented Interfaces:
BeanFactoryAware, DisposableBean, InitializingBean
Direct Known Subclasses:
SimpleHttpServerJaxWsServiceExporter, SimpleJaxWsServiceExporter
public abstract class AbstractJaxWsServiceExporter
extends Object
implements BeanFactoryAware, InitializingBean, DisposableBean

Abstract exporter for JAX-WS services, autodetecting annotated service beans (through the JAX-WS WebService annotation). Subclasses need to implement the publishEndpoint(javax.xml.ws.Endpoint, javax.jws.WebService) template method for actual endpoint exposure.

Since:
2.5.5
Author:
Juergen Hoeller
See Also:
WebService, Endpoint, SimpleJaxWsServiceExporter, SimpleHttpServerJaxWsServiceExporter

Constructor Summary
AbstractJaxWsServiceExporter()
Method Summary
void | afterPropertiesSet() Immediately publish all endpoints when fully configured.
void | destroy() Stops all published endpoints, taking the web services offline.
protected abstract void | publishEndpoint(Endpoint endpoint, WebService annotation) Actually publish the given endpoint.
protected abstract void | publishEndpoint(Endpoint endpoint, WebServiceProvider annotation) Actually publish the given provider endpoint.
void | publishEndpoints() Publish all WebService annotated beans in the containing BeanFactory.
void | setBeanFactory(BeanFactory beanFactory) Obtains all web service beans and publishes them as JAX-WS endpoints.
void | setEndpointProperties(Map<String,Object> endpointProperties) Set the property bag for the endpoint, including properties such as "javax.xml.ws.wsdl.service" or "javax.xml.ws.wsdl.port".
void | setExecutor(Executor executor) Set the JDK concurrent executor to use for dispatching incoming requests to exported service instances.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractJaxWsServiceExporter

public AbstractJaxWsServiceExporter()
Method Detail

setEndpointProperties

public void setEndpointProperties(Map<String,Object> endpointProperties)
Set the property bag for the endpoint, including properties such as "javax.xml.ws.wsdl.service" or "javax.xml.ws.wsdl.port".

See Also:
Endpoint.setProperties(java.util.Map), Endpoint.WSDL_SERVICE, Endpoint.WSDL_PORT

setExecutor

public void setExecutor(Executor executor)
Set the JDK concurrent executor to use for dispatching incoming requests to exported service instances.

See Also:
Endpoint.setExecutor(java.util.concurrent.Executor)

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Obtains all web service beans and publishes them as JAX-WS endpoints.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
BeanInitializationException

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Immediately publish all endpoints when fully configured.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception - in the event of misconfiguration (such as failure to set an essential property) or if initialization fails.
See Also:
publishEndpoints()

publishEndpoints

public void publishEndpoints()
Publish all WebService annotated beans in the containing BeanFactory.

See Also:
publishEndpoint(javax.xml.ws.Endpoint, javax.jws.WebService)

publishEndpoint

protected abstract void publishEndpoint(Endpoint endpoint,
                                        WebService annotation)
Actually publish the given endpoint. To be implemented by subclasses.

Parameters:
endpoint - the JAX-WS Endpoint object
annotation - the service bean's WebService annotation

publishEndpoint

protected abstract void publishEndpoint(Endpoint endpoint,
                                        WebServiceProvider annotation)
Actually publish the given provider endpoint. To be implemented by subclasses.

Parameters:
endpoint - the JAX-WS Provider Endpoint object
annotation - the service bean's WebServiceProvider annotation

destroy

public void destroy()
Stops all published endpoints, taking the web services offline.

Specified by:
destroy in interface DisposableBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


JaxWsPortClientInterceptor

org.springframework.remoting.jaxws
Class JaxWsPortClientInterceptor

java.lang.Object
    extended by  org.springframework.remoting.jaxws.LocalJaxWsServiceFactory
        extended by  org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, InitializingBean
Direct Known Subclasses:
JaxWsPortProxyFactoryBean
public class JaxWsPortClientInterceptor
extends LocalJaxWsServiceFactory
implements MethodInterceptor, InitializingBean

MethodInterceptor for accessing a specific port of a JAX-WS service.

Uses either LocalJaxWsServiceFactory's facilities underneath, or takes an explicit reference to an existing JAX-WS Service instance (e.g. obtained via JndiObjectFactoryBean).

Since:
2.5
Author:
Juergen Hoeller
See Also:
setPortName(java.lang.String),
setServiceInterface(java.lang.Class),
Service.getPort(javax.xml.namespace.QName, java.lang.Class),
RemoteAccessException,
JndiObjectFactoryBean

Constructor Summary
JaxWsPortClientInterceptor()
Method Summary
void | addCustomProperty(String name, Object value) Add a custom property to this JAX-WS BindingProvider.
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected Object | doInvoke(MethodInvocation invocation) Perform a JAX-WS service invocation based on the given method invocation.
protected Object | doInvoke(MethodInvocation invocation, Object portStub) Perform a JAX-WS service invocation on the given port stub.
Map<String,Object> | getCustomProperties() Allow Map access to the custom properties to be set on the stub, with the option to add or override specific entries.
String | getEndpointAddress() Return the endpoint address to specify on the stub.
Service | getJaxWsService() Return a reference to an existing JAX-WS Service instance, if any.
String | getPassword() Return the password to specify on the stub.
String | getPortName() Return the name of the port.
protected QName | getPortQName() Return the prepared QName for the port.
protected Object | getPortStub() Return the underlying JAX-WS port stub that this interceptor delegates to for each method invocation on the proxy.
Class<?> | getServiceInterface() Return the interface of the service that this factory should create a proxy for.
String | getSoapActionUri() Return the SOAP action URI to specify on the stub.
String | getUsername() Return the username to specify on the stub.
Object | invoke(MethodInvocation invocation)
boolean | isMaintainSession() Return the "session.maintain" flag to specify on the stub.
protected boolean | isPrepared() Return whether this client interceptor has already been prepared, i.e.
boolean | isUseSoapAction() Return the "soapaction.use" flag to specify on the stub.
void | prepare()
protected void | preparePortStub(Object stub) Prepare the given JAX-WS port stub, applying properties to it.
void | setCustomProperties(Map<String,Object> customProperties) Set custom properties to be set on the stub.
void | setEndpointAddress(String endpointAddress) Set the endpoint address to specify on the stub.
void | setJaxWsService(Service jaxWsService) Set a reference to an existing JAX-WS Service instance, for example obtained via JndiObjectFactoryBean.
void | setLookupServiceOnStartup(boolean lookupServiceOnStartup) Set whether to look up the JAX-WS service on startup.
void | setMaintainSession(boolean maintainSession) Set the "session.maintain" flag to specify on the stub.
void | setPassword(String password) Set the password to specify on the stub.
void | setPortName(String portName) Set the name of the port.
void | setServiceInterface(Class<?> serviceInterface) Set the interface of the service that this factory should create a proxy for.
void | setSoapActionUri(String soapActionUri) Set the SOAP action URI to specify on the stub.
void | setUsername(String username) Set the username to specify on the stub.
void | setUseSoapAction(boolean useSoapAction) Set the "soapaction.use" flag to specify on the stub.
Methods inherited from class org.springframework.remoting.jaxws.LocalJaxWsServiceFactory
createJaxWsService, getNamespaceUri, getQName, getServiceName, getWsdlDocumentUrl, setExecutor, setHandlerResolver, setNamespaceUri, setServiceName, setWsdlDocumentUrl
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JaxWsPortClientInterceptor

public JaxWsPortClientInterceptor()
Method Detail

setJaxWsService

public void setJaxWsService(Service jaxWsService)
Set a reference to an existing JAX-WS Service instance, for example obtained via JndiObjectFactoryBean. If not set, LocalJaxWsServiceFactory's properties have to be specified.

See Also:
LocalJaxWsServiceFactory.setWsdlDocumentUrl(java.net.URL),
LocalJaxWsServiceFactory.setNamespaceUri(java.lang.String),
LocalJaxWsServiceFactory.setServiceName(java.lang.String),
JndiObjectFactoryBean

getJaxWsService

public Service getJaxWsService()
Return a reference to an existing JAX-WS Service instance, if any.

setPortName

public void setPortName(String portName)
Set the name of the port. Corresponds to the "wsdl:port" name.

getPortName

public String getPortName()
Return the name of the port.

setUsername

public void setUsername(String username)
Set the username to specify on the stub.

See Also:
BindingProvider.USERNAME_PROPERTY

getUsername

public String getUsername()
Return the username to specify on the stub.

setPassword

public void setPassword(String password)
Set the password to specify on the stub.

See Also:
BindingProvider.PASSWORD_PROPERTY

getPassword

public String getPassword()
Return the password to specify on the stub.

setEndpointAddress

public void setEndpointAddress(String endpointAddress)
Set the endpoint address to specify on the stub.

See Also:
BindingProvider.ENDPOINT_ADDRESS_PROPERTY

getEndpointAddress

public String getEndpointAddress()
Return the endpoint address to specify on the stub.

setMaintainSession

public void setMaintainSession(boolean maintainSession)
Set the "session.maintain" flag to specify on the stub.

See Also:
BindingProvider.SESSION_MAINTAIN_PROPERTY

isMaintainSession

public boolean isMaintainSession()
Return the "session.maintain" flag to specify on the stub.

setUseSoapAction

public void setUseSoapAction(boolean useSoapAction)
Set the "soapaction.use" flag to specify on the stub.

See Also:
BindingProvider.SOAPACTION_USE_PROPERTY

isUseSoapAction

public boolean isUseSoapAction()
Return the "soapaction.use" flag to specify on the stub.

setSoapActionUri

public void setSoapActionUri(String soapActionUri)
Set the SOAP action URI to specify on the stub.

See Also:
BindingProvider.SOAPACTION_URI_PROPERTY

getSoapActionUri

public String getSoapActionUri()
Return the SOAP action URI to specify on the stub.

setCustomProperties

public void setCustomProperties(Map<String,Object> customProperties)
Set custom properties to be set on the stub.

Can be populated with a String "value" (parsed via PropertiesEditor) or a "props" element in XML bean definitions.

See Also:
BindingProvider.getRequestContext()

getCustomProperties

public Map<String,Object> getCustomProperties()
Allow Map access to the custom properties to be set on the stub, with the option to add or override specific entries.

Useful for specifying entries directly, for example via "customProperties[myKey]". This is particularly useful for adding or overriding entries in child bean definitions.

addCustomProperty

public void addCustomProperty(String name,
                              Object value)
Add a custom property to this JAX-WS BindingProvider.

Parameters:
name - the name of the attribute to expose
value - the attribute value to expose
See Also:
BindingProvider.getRequestContext()

setServiceInterface

public void setServiceInterface(Class<?> serviceInterface)
Set the interface of the service that this factory should create a proxy for.

getServiceInterface

public Class<?> getServiceInterface()
Return the interface of the service that this factory should create a proxy for.

setLookupServiceOnStartup

public void setLookupServiceOnStartup(boolean lookupServiceOnStartup)
Set whether to look up the JAX-WS service on startup.

Default is "true". Turn this flag off to allow for late start of the target server. In this case, the JAX-WS service will be lazily fetched on first access.

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

prepare

public void prepare()

isPrepared

protected boolean isPrepared()
Return whether this client interceptor has already been prepared, i.e. has already looked up the JAX-WS service and port.

getPortQName

protected final QName getPortQName()
Return the prepared QName for the port.

See Also:
setPortName(java.lang.String), LocalJaxWsServiceFactory.getQName(java.lang.String)

preparePortStub

protected void preparePortStub(Object stub)
Prepare the given JAX-WS port stub, applying properties to it. Called by prepare().

Parameters:
stub - the current JAX-WS port stub
See Also:
setUsername(java.lang.String),
setPassword(java.lang.String),
setEndpointAddress(java.lang.String),
setMaintainSession(boolean),
setCustomProperties(java.util.Map)

getPortStub

protected Object getPortStub()
Return the underlying JAX-WS port stub that this interceptor delegates to for each method invocation on the proxy.

invoke

public Object invoke(MethodInvocation invocation)
              throws Throwable
Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable

doInvoke

protected Object doInvoke(MethodInvocation invocation)
                   throws Throwable
Perform a JAX-WS service invocation based on the given method invocation.

Parameters:
invocation - the AOP method invocation
Returns:
the invocation result, if any
Throws:
Throwable - in case of invocation failure
See Also:
getPortStub(), doInvoke(org.aopalliance.intercept.MethodInvocation, Object)

doInvoke

protected Object doInvoke(MethodInvocation invocation,
                          Object portStub)
                   throws Throwable
Perform a JAX-WS service invocation on the given port stub.

Parameters:
invocation - the AOP method invocation
portStub - the RMI port stub to invoke
Returns:
the invocation result, if any
Throws:
Throwable - in case of invocation failure
See Also:
getPortStub()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JaxWsPortProxyFactoryBean

org.springframework.remoting.jaxws
Class JaxWsPortProxyFactoryBean

java.lang.Object
    extended by  org.springframework.remoting.jaxws.LocalJaxWsServiceFactory
        extended by  org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
            extended by  org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, BeanClassLoaderAware, FactoryBean<Object>, InitializingBean
public class JaxWsPortProxyFactoryBean
extends JaxWsPortClientInterceptor
implements FactoryBean<Object>, BeanClassLoaderAware

FactoryBean for a specific port of a JAX-WS service. Exposes a proxy for the port, to be used for bean references. Inherits configuration properties from JaxWsPortClientInterceptor.

Since:
2.5
Author:
Juergen Hoeller
See Also:
JaxWsPortClientInterceptor.setServiceInterface(java.lang.Class), LocalJaxWsServiceFactoryBean

Constructor Summary
JaxWsPortProxyFactoryBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 Object getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<?> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setBeanClassLoader(ClassLoader classLoader)
Callback that supplies the bean class loader to a bean instance.
Methods inherited from class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
addCustomProperty, doInvoke, doInvoke, getCustomProperties, getEndpointAddress, getJaxWsService, getPassword, getPortName, getPortQName, getPortStub, getServiceInterface, getSoapActionUri, getUsername, invoke, isMaintainSession, isPrepared, isUseSoapAction, prepare, preparePortStub, setCustomProperties, setEndpointAddress, setJaxWsService, setLookupServiceOnStartup, setMaintainSession, setPassword, setPortName, setServiceInterface, setSoapActionUri, setUsername, setUseSoapAction
Methods inherited from class org.springframework.remoting.jaxws.LocalJaxWsServiceFactory
createJaxWsService, getNamespaceUri, getQName, getServiceName, getWsdlDocumentUrl, setExecutor, setHandlerResolver, setNamespaceUri, setServiceName, setWsdlDocumentUrl
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JaxWsPortProxyFactoryBean

public JaxWsPortProxyFactoryBean()
Method Detail

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class JaxWsPortClientInterceptor

getObject

public Object getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<Object>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<?> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<Object>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<Object>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LocalJaxWsServiceFactory

org.springframework.remoting.jaxws
Class LocalJaxWsServiceFactory

java.lang.Object
    extended by  org.springframework.remoting.jaxws.LocalJaxWsServiceFactory
Direct Known Subclasses:
JaxWsPortClientInterceptor, LocalJaxWsServiceFactoryBean
public class LocalJaxWsServiceFactory
extends Object

Factory for locally defined JAX-WS Service references. Uses the JAX-WS Service.create(java.net.URL, javax.xml.namespace.QName) factory API underneath.

Serves as base class for LocalJaxWsServiceFactoryBean as well as JaxWsPortClientInterceptor and JaxWsPortProxyFactoryBean.

Since:
2.5
Author:
Juergen Hoeller
See Also:
Service, LocalJaxWsServiceFactoryBean, JaxWsPortClientInterceptor, JaxWsPortProxyFactoryBean

Constructor Summary
LocalJaxWsServiceFactory()
Method Summary
Service | createJaxWsService() Create a JAX-WS Service according to the parameters of this factory.
String | getNamespaceUri() Return the namespace URI of the service.
protected QName | getQName(String name) Return a QName for the given name, relative to the namespace URI of this factory, if given.
String | getServiceName() Return the name of the service.
URL | getWsdlDocumentUrl() Return the URL of the WSDL document that describes the service.
void | setExecutor(Executor executor) Set the JDK concurrent executor to use for asynchronous executions that require callbacks.
void | setHandlerResolver(HandlerResolver handlerResolver) Set the JAX-WS HandlerResolver to use for all proxies and dispatchers created through this factory.
void | setNamespaceUri(String namespaceUri) Set the namespace URI of the service.
void | setServiceName(String serviceName) Set the name of the service to look up.
void | setWsdlDocumentUrl(URL wsdlDocumentUrl) Set the URL of the WSDL document that describes the service.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

LocalJaxWsServiceFactory

public LocalJaxWsServiceFactory()
Method Detail

setWsdlDocumentUrl

public void setWsdlDocumentUrl(URL wsdlDocumentUrl)
Set the URL of the WSDL document that describes the service.

getWsdlDocumentUrl

public URL getWsdlDocumentUrl()
Return the URL of the WSDL document that describes the service.

setNamespaceUri

public void setNamespaceUri(String namespaceUri)
Set the namespace URI of the service. Corresponds to the WSDL "targetNamespace".

getNamespaceUri

public String getNamespaceUri()
Return the namespace URI of the service.

setServiceName

public void setServiceName(String serviceName)
Set the name of the service to look up. Corresponds to the "wsdl:service" name.

getServiceName

public String getServiceName()
Return the name of the service.

setExecutor

public void setExecutor(Executor executor)
Set the JDK concurrent executor to use for asynchronous executions that require callbacks.

See Also:
Service.setExecutor(java.util.concurrent.Executor)

setHandlerResolver

public void setHandlerResolver(HandlerResolver handlerResolver)
Set the JAX-WS HandlerResolver to use for all proxies and dispatchers created through this factory.

See Also:
Service.setHandlerResolver(javax.xml.ws.handler.HandlerResolver)

createJaxWsService

public Service createJaxWsService()
Create a JAX-WS Service according to the parameters of this factory.

See Also:
setServiceName(java.lang.String), setWsdlDocumentUrl(java.net.URL)

getQName

protected QName getQName(String name)
Return a QName for the given name, relative to the namespace URI of this factory, if given.

See Also:
setNamespaceUri(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LocalJaxWsServiceFactoryBean

org.springframework.remoting.jaxws
Class LocalJaxWsServiceFactoryBean

java.lang.Object
    extended by  org.springframework.remoting.jaxws.LocalJaxWsServiceFactory
        extended by  org.springframework.remoting.jaxws.LocalJaxWsServiceFactoryBean
All Implemented Interfaces:
FactoryBean<Service>, InitializingBean
public class LocalJaxWsServiceFactoryBean
extends LocalJaxWsServiceFactory
implements FactoryBean<Service>, InitializingBean

FactoryBean for locally defined JAX-WS Service references. Uses LocalJaxWsServiceFactory's facilities underneath.

Alternatively, JAX-WS Service references can be looked up in the JNDI environment of the J2EE container.

Since:
2.5
Author:
Juergen Hoeller
See Also:
Service, JndiObjectFactoryBean, JaxWsPortProxyFactoryBean

Constructor Summary
LocalJaxWsServiceFactoryBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 Service getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<? extends Service> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
Methods inherited from class org.springframework.remoting.jaxws.LocalJaxWsServiceFactory
createJaxWsService, getNamespaceUri, getQName, getServiceName, getWsdlDocumentUrl, setExecutor, setHandlerResolver, setNamespaceUri, setServiceName, setWsdlDocumentUrl
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

LocalJaxWsServiceFactoryBean

public LocalJaxWsServiceFactoryBean()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

getObject

public Service getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<Service>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends Service> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<Service>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<Service>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleHttpServerJaxWsServiceExporter

org.springframework.remoting.jaxws
Class SimpleHttpServerJaxWsServiceExporter

java.lang.Object
    extended by  org.springframework.remoting.jaxws.AbstractJaxWsServiceExporter
        extended by  org.springframework.remoting.jaxws.SimpleHttpServerJaxWsServiceExporter
All Implemented Interfaces:
BeanFactoryAware, DisposableBean, InitializingBean
public class SimpleHttpServerJaxWsServiceExporter
extends AbstractJaxWsServiceExporter

Simple exporter for JAX-WS services, autodetecting annotated service beans (through the JAX-WS WebService annotation) and exporting them through the HTTP server included in Sun's JDK 1.6. The full address for each service will consist of the server's base address with the service name appended (e.g. "http://localhost:8080/OrderService").

Note that this exporter will only work on Sun's JDK 1.6 or higher, as well as on JDKs that ship Sun's entire class library as included in the Sun JDK. For a portable JAX-WS exporter, have a look at SimpleJaxWsServiceExporter.

Since:
2.5.5
Author:
Juergen Hoeller
See Also:
WebService, Endpoint.publish(Object), SimpleJaxWsServiceExporter

Field Summary
protected  Log logger
Constructor Summary
SimpleHttpServerJaxWsServiceExporter()
Method Summary
void | afterPropertiesSet() Immediately publish all endpoints when fully configured.
protected HttpContext | buildHttpContext(Endpoint endpoint, String serviceName) Build the HttpContext for the given endpoint.
protected String | calculateEndpointPath(Endpoint endpoint, String serviceName) Calculate the full endpoint path for the given endpoint.
void | destroy() Stops all published endpoints, taking the web services offline.
protected void | publishEndpoint(Endpoint endpoint, WebService annotation) Actually publish the given endpoint.
protected void | publishEndpoint(Endpoint endpoint, WebServiceProvider annotation) Actually publish the given provider endpoint.
void | setAuthenticator(Authenticator authenticator) Register a common Authenticator to be applied to all detected WebService annotated beans.
void | setBacklog(int backlog) Specify the HTTP server's TCP backlog.
void | setBasePath(String basePath) Set the base path for context publication.
void | setFilters(List<Filter> filters) Register common Filters to be applied to all detected WebService annotated beans.
void | setHostname(String hostname) Specify the HTTP server's hostname to bind to.
void | setPort(int port) Specify the HTTP server's port.
void | setServer(HttpServer server) Specify an existing HTTP server to register the web service contexts with.
void | setShutdownDelay(int shutdownDelay) Specify the number of seconds to wait until HTTP exchanges have completed when shutting down the HTTP server.
Methods inherited from class org.springframework.remoting.jaxws.AbstractJaxWsServiceExporter
publishEndpoints, setBeanFactory, setEndpointProperties, setExecutor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Constructor Detail

SimpleHttpServerJaxWsServiceExporter

public SimpleHttpServerJaxWsServiceExporter()
Method Detail

setServer

public void setServer(HttpServer server)
Specify an existing HTTP server to register the web service contexts with. This will typically be a server managed by the general Spring SimpleHttpServerFactoryBean.

Alternatively, configure a local HTTP server through the "port", "hostname" and "backlog" properties (or rely on the defaults there).

setPort

public void setPort(int port)
Specify the HTTP server's port. Default is 8080.

Only applicable for a locally configured HTTP server. Ignored when the "server" property has been specified.

setHostname

public void setHostname(String hostname)
Specify the HTTP server's hostname to bind to. Default is localhost; can be overridden with a specific network address to bind to.

Only applicable for a locally configured HTTP server. Ignored when the "server" property has been specified.

setBacklog

public void setBacklog(int backlog)
Specify the HTTP server's TCP backlog. Default is -1, indicating the system's default value.

Only applicable for a locally configured HTTP server. Ignored when the "server" property has been specified.

setShutdownDelay

public void setShutdownDelay(int shutdownDelay)
Specify the number of seconds to wait until HTTP exchanges have completed when shutting down the HTTP server. Default is 0.

Only applicable for a locally configured HTTP server. Ignored when the "server" property has been specified.

setBasePath

public void setBasePath(String basePath)
Set the base path for context publication. Default is "/".

For each context publication path, the service name will be appended to this base address. E.g. service name "OrderService" -> "/OrderService".

See Also:
Endpoint.publish(Object), WebService.serviceName()

setFilters

public void setFilters(List<Filter> filters)
Register common Filters to be applied to all detected WebService annotated beans.

setAuthenticator

public void setAuthenticator(Authenticator authenticator)
Register a common Authenticator to be applied to all detected WebService annotated beans.

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Description copied from class: AbstractJaxWsServiceExporter
Immediately publish all endpoints when fully configured.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class AbstractJaxWsServiceExporter
Throws:
Exception - in the event of misconfiguration (such as failure to set an essential property) or if initialization fails.
See Also:
AbstractJaxWsServiceExporter.publishEndpoints()

publishEndpoint

protected void publishEndpoint(Endpoint endpoint,
                               WebService annotation)
Description copied from class: AbstractJaxWsServiceExporter
Actually publish the given endpoint. To be implemented by subclasses.

Specified by:
publishEndpoint in class AbstractJaxWsServiceExporter
Parameters:
endpoint - the JAX-WS Endpoint object
annotation - the service bean's WebService annotation

publishEndpoint

protected void publishEndpoint(Endpoint endpoint,
                               WebServiceProvider annotation)
Description copied from class: AbstractJaxWsServiceExporter
Actually publish the given provider endpoint. To be implemented by subclasses.

Specified by:
publishEndpoint in class AbstractJaxWsServiceExporter
Parameters:
endpoint - the JAX-WS Provider Endpoint object
annotation - the service bean's WebServiceProvider annotation

buildHttpContext

protected HttpContext buildHttpContext(Endpoint endpoint,
                                       String serviceName)
Build the HttpContext for the given endpoint.

Parameters:
endpoint - the JAX-WS Provider Endpoint object
serviceName - the given service name
Returns:
the fully populated HttpContext

calculateEndpointPath

protected String calculateEndpointPath(Endpoint endpoint,
                                       String serviceName)
Calculate the full endpoint path for the given endpoint.

Parameters:
endpoint - the JAX-WS Provider Endpoint object
serviceName - the given service name
Returns:
the full endpoint path

destroy

public void destroy()
Description copied from class: AbstractJaxWsServiceExporter
Stops all published endpoints, taking the web services offline.

Specified by:
destroy in interface DisposableBean
Overrides:
destroy in class AbstractJaxWsServiceExporter
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleJaxWsServiceExporter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.remoting.jaxws
Class SimpleJaxWsServiceExporter

java.lang.Object
    extended by  org.springframework.remoting.jaxws.AbstractJaxWsServiceExporter
        extended by  org.springframework.remoting.jaxws.SimpleJaxWsServiceExporter
All Implemented Interfaces:
BeanFactoryAware, DisposableBean, InitializingBean
public class SimpleJaxWsServiceExporter
extends AbstractJaxWsServiceExporter

Simple exporter for JAX-WS services, autodetecting annotated service beans (through the JAX-WS WebService annotation) and exporting them with a configured base address (by default "http://localhost:8080/") using the JAX-WS provider's built-in publication support. The full address for each service will consist of the base address with the service name appended (e.g. "http://localhost:8080/OrderService").

Note that this exporter will only work if the JAX-WS runtime actually supports publishing with an address argument, i.e. if the JAX-WS runtime ships an internal HTTP server. This is the case with the JAX-WS runtime that's inclued in Sun's JDK 1.6 but not with the standalone JAX-WS 2.1 RI.

For explicit configuration of JAX-WS endpoints with Sun's JDK 1.6 HTTP server, consider using SimpleHttpServerJaxWsServiceExporter!

Since:
2.5
Author:
Juergen Hoeller
See Also:
WebService, Endpoint.publish(String), SimpleHttpServerJaxWsServiceExporter

Field Summary
static String DEFAULT_BASE_ADDRESS
Constructor Summary
SimpleJaxWsServiceExporter()
Method Summary
protected String | calculateEndpointAddress(Endpoint endpoint, String serviceName) Calculate the full endpoint address for the given endpoint.
protected void | publishEndpoint(Endpoint endpoint, WebService annotation) Actually publish the given endpoint.
protected void | publishEndpoint(Endpoint endpoint, WebServiceProvider annotation) Actually publish the given provider endpoint.
void | setBaseAddress(String baseAddress) Set the base address for exported services.
Methods inherited from class org.springframework.remoting.jaxws.AbstractJaxWsServiceExporter
afterPropertiesSet, destroy, publishEndpoints, setBeanFactory, setEndpointProperties, setExecutor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_BASE_ADDRESS

public static final String DEFAULT_BASE_ADDRESS
See Also:
Constant Field Values
Constructor Detail

SimpleJaxWsServiceExporter

public SimpleJaxWsServiceExporter()
Method Detail

setBaseAddress

public void setBaseAddress(String baseAddress)
Set the base address for exported services. Default is "http://localhost:8080/".

For each actual publication address, the service name will be appended to this base address. E.g. service name "OrderService" -> "http://localhost:8080/OrderService".

See Also:
Endpoint.publish(String), WebService.serviceName()

publishEndpoint

protected void publishEndpoint(Endpoint endpoint,
                               WebService annotation)
Description copied from class: AbstractJaxWsServiceExporter
Actually publish the given endpoint. To be implemented by subclasses.

Specified by:
publishEndpoint in class AbstractJaxWsServiceExporter
Parameters:
endpoint - the JAX-WS Endpoint object
annotation - the service bean's WebService annotation

publishEndpoint

protected void publishEndpoint(Endpoint endpoint,
                               WebServiceProvider annotation)
Description copied from class: AbstractJaxWsServiceExporter
Actually publish the given provider endpoint. To be implemented by subclasses.

Specified by:
publishEndpoint in class AbstractJaxWsServiceExporter
Parameters:
endpoint - the JAX-WS Provider Endpoint object
annotation - the service bean's WebServiceProvider annotation

calculateEndpointAddress

protected String calculateEndpointAddress(Endpoint endpoint,
                                          String serviceName)
Calculate the full endpoint address for the given endpoint.

Parameters:
endpoint - the JAX-WS Provider Endpoint object
serviceName - the given service name
Returns:
the full endpoint address
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


JaxWsSoapFaultException

org.springframework.remoting.jaxws
Class JaxWsSoapFaultException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.remoting.RemoteAccessException
                        extended by  org.springframework.remoting.RemoteInvocationFailureException
                            extended by  org.springframework.remoting.soap.SoapFaultException
                                extended by  org.springframework.remoting.jaxws.JaxWsSoapFaultException
All Implemented Interfaces:
Serializable
public class JaxWsSoapFaultException
extends SoapFaultException

Spring SoapFaultException adapter for the JAX-WS SOAPFaultException class.

Since:
2.5
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
JaxWsSoapFaultException(SOAPFaultException original)
Constructor for JaxWsSoapFaultException.
Method Summary
SOAPFault | getFault() Return the wrapped JAX-WS SOAPFault.
String | getFaultActor() Return the actor that caused this fault.
String | getFaultCode() Return the SOAP fault code.
QName | getFaultCodeAsQName() Return the SOAP fault code as a QName object.
String | getFaultString() Return the descriptive SOAP fault string.
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

JaxWsSoapFaultException

public JaxWsSoapFaultException(SOAPFaultException original)
Constructor for JaxWsSoapFaultException.

Parameters:
original - the original JAX-WS SOAPFaultException to wrap
Method Detail

getFault

public final SOAPFault getFault()
Return the wrapped JAX-WS SOAPFault.

getFaultCode

public String getFaultCode()
Description copied from class: SoapFaultException
Return the SOAP fault code.

Specified by:
getFaultCode in class SoapFaultException

getFaultCodeAsQName

public QName getFaultCodeAsQName()
Description copied from class: SoapFaultException
Return the SOAP fault code as a QName object.

Specified by:
getFaultCodeAsQName in class SoapFaultException

getFaultString

public String getFaultString()
Description copied from class: SoapFaultException
Return the descriptive SOAP fault string.

Specified by:
getFaultString in class SoapFaultException

getFaultActor

public String getFaultActor()
Description copied from class: SoapFaultException
Return the actor that caused this fault.

Specified by:
getFaultActor in class SoapFaultException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.remoting.rmi

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.remoting.rmi

Remoting classes for conventional RMI and transparent remoting via RMI invokers.

See:
Description

Interface Summary
RmiInvocationHandler Interface for RMI invocation handlers instances on the server, wrapping exported services.

Class Summary
CodebaseAwareObjectInputStream | Special ObjectInputStream subclass that falls back to a specified codebase to load classes from if not found locally.
JndiRmiClientInterceptor | MethodInterceptor for accessing RMI services from JNDI.
JndiRmiProxyFactoryBean | FactoryBean for RMI proxies from JNDI.
JndiRmiServiceExporter | Service exporter which binds RMI services to JNDI.
RemoteInvocationSerializingExporter | Abstract base class for remote service exporters that explicitly deserialize RemoteInvocation objects and serialize RemoteInvocationResult objects, for example Spring's HTTP invoker.
RmiBasedExporter | Convenient superclass for RMI-based remote exporters.
RmiClientInterceptor | MethodInterceptor for accessing conventional RMI services or RMI invokers.
RmiClientInterceptorUtils | Factored-out methods for performing invocations within an RMI client.
RmiProxyFactoryBean | FactoryBean for RMI proxies, supporting both conventional RMI services and RMI invokers.
RmiRegistryFactoryBean | FactoryBean that locates a Registry and exposes it for bean references.
RmiServiceExporter | RMI exporter that exposes the specified service as RMI object with the specified name.

Package org.springframework.remoting.rmi Description

Remoting classes for conventional RMI and transparent remoting via RMI invokers. Provides a proxy factory for accessing RMI services, and an exporter for making beans available to RMI clients.


org.springframework.remoting.rmi Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.remoting.rmi

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.io.InputStream (implements java.io.Closeable)
      • java.io.ObjectInputStream (implements java.io.ObjectInput, java.io.ObjectStreamConstants)
        • org.springframework.core.ConfigurableObjectInputStream
          • org.springframework.remoting.rmi.CodebaseAwareObjectInputStream
    • org.springframework.jndi.JndiAccessor
      • org.springframework.jndi.JndiLocatorSupport
        • org.springframework.jndi.JndiObjectLocator (implements org.springframework.beans.factory.InitializingBean)
          • org.springframework.remoting.rmi.JndiRmiClientInterceptor (implements org.springframework.beans.factory.InitializingBean, org.aopalliance.intercept.MethodInterceptor)
            • org.springframework.remoting.rmi.JndiRmiProxyFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.FactoryBean<T>)
    • org.springframework.remoting.support.RemotingSupport (implements org.springframework.beans.factory.BeanClassLoaderAware)
      • org.springframework.remoting.support.RemoteAccessor
        • org.springframework.remoting.support.UrlBasedRemoteAccessor (implements org.springframework.beans.factory.InitializingBean)
          • org.springframework.remoting.support.RemoteInvocationBasedAccessor
            • org.springframework.remoting.rmi.RmiClientInterceptor (implements org.aopalliance.intercept.MethodInterceptor)
              • org.springframework.remoting.rmi.RmiProxyFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.FactoryBean<T>)
      • org.springframework.remoting.support.RemoteExporter
        • org.springframework.remoting.support.RemoteInvocationBasedExporter
          • org.springframework.remoting.rmi.RemoteInvocationSerializingExporter (implements org.springframework.beans.factory.InitializingBean)
          • org.springframework.remoting.rmi.RmiBasedExporter
            • org.springframework.remoting.rmi.JndiRmiServiceExporter (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean)
            • org.springframework.remoting.rmi.RmiServiceExporter (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean)
    • org.springframework.remoting.rmi.RmiClientInterceptorUtils
    • org.springframework.remoting.rmi.RmiRegistryFactoryBean (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)

Interface Hierarchy

  • java.rmi.Remote
    • org.springframework.remoting.rmi.RmiInvocationHandler


RmiInvocationHandler

org.springframework.remoting.rmi
Interface RmiInvocationHandler

All Superinterfaces:
Remote
public interface RmiInvocationHandler
extends Remote

Interface for RMI invocation handlers instances on the server, wrapping exported services. A client uses a stub implementing this interface to access such a service.

This is an SPI interface, not to be used directly by applications.

Since:
14.05.2003
Author:
Juergen Hoeller

Method Summary
String | getTargetInterfaceName() Return the name of the target interface that this invoker operates on.
Object | invoke(RemoteInvocation invocation) Apply the given invocation to the target object.

Method Detail

getTargetInterfaceName

String getTargetInterfaceName()
                              throws RemoteException
Return the name of the target interface that this invoker operates on.

Returns:
the name of the target interface, or null if none
Throws:
RemoteException - in case of communication errors
See Also:
RemoteExporter.getServiceInterface()

invoke

Object invoke(RemoteInvocation invocation)
              throws RemoteException,
                     NoSuchMethodException,
                     IllegalAccessException,
                     InvocationTargetException
Apply the given invocation to the target object.

Called by RmiClientInterceptor.doInvoke(org.aopalliance.intercept.MethodInvocation, RmiInvocationHandler).

Parameters:
invocation - object that encapsulates invocation parameters
Returns:
the object returned from the invoked method, if any
Throws:
RemoteException - in case of communication errors
NoSuchMethodException - if the method name could not be resolved
IllegalAccessException - if the method could not be accessed
InvocationTargetException - if the method invocation resulted in an exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CodebaseAwareObjectInputStream

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.remoting.rmi
Class CodebaseAwareObjectInputStream

java.lang.Object
    extended by  java.io.InputStream
        extended by  java.io.ObjectInputStream
            extended by  org.springframework.core.ConfigurableObjectInputStream
                extended by  org.springframework.remoting.rmi.CodebaseAwareObjectInputStream
All Implemented Interfaces:
Closeable, DataInput, ObjectInput, ObjectStreamConstants
public class CodebaseAwareObjectInputStream
extends ConfigurableObjectInputStream

Special ObjectInputStream subclass that falls back to a specified codebase to load classes from if not found locally. In contrast to standard RMI conventions for dynamic class download, it is the client that determines the codebase URL here, rather than the "java.rmi.server.codebase" system property on the server.

Uses the JDK's RMIClassLoader to load classes from the specified codebase. The codebase can consist of multiple URLs, separated by spaces. Note that RMIClassLoader requires a SecurityManager to be set, like when using dynamic class download with standard RMI! (See the RMI documentation for details.)

Despite residing in the RMI package, this class is not used for RmiClientInterceptor, which uses the standard RMI infrastructure instead and thus is only able to rely on RMI's standard dynamic class download via "java.rmi.server.codebase". CodebaseAwareObjectInputStream is used by HttpInvokerClientInterceptor (see the "codebaseUrl" property there).

Thanks to Lionel Mestre for suggesting the option and providing a prototype!

Since:
1.1.3
Author:
Juergen Hoeller
See Also:
RMIClassLoader, RemoteInvocationSerializingExporter.createObjectInputStream(java.io.InputStream), HttpInvokerClientInterceptor.setCodebaseUrl(java.lang.String)

Nested Class Summary
Nested classes/interfaces inherited from class java.io.ObjectInputStream
ObjectInputStream.GetField
Field Summary
Fields inherited from interface java.io.ObjectStreamConstants
baseWireHandle, PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, SC_BLOCK_DATA, SC_ENUM, SC_EXTERNALIZABLE, SC_SERIALIZABLE, SC_WRITE_METHOD, STREAM_MAGIC, STREAM_VERSION, SUBCLASS_IMPLEMENTATION_PERMISSION, SUBSTITUTION_PERMISSION, TC_ARRAY, TC_BASE, TC_BLOCKDATA, TC_BLOCKDATALONG, TC_CLASS, TC_CLASSDESC, TC_ENDBLOCKDATA, TC_ENUM, TC_EXCEPTION, TC_LONGSTRING, TC_MAX, TC_NULL, TC_OBJECT, TC_PROXYCLASSDESC, TC_REFERENCE, TC_RESET, TC_STRING
Constructor Summary
CodebaseAwareObjectInputStream(InputStream in, ClassLoader classLoader, String codebaseUrl)
Create a new CodebaseAwareObjectInputStream for the given InputStream and codebase.
CodebaseAwareObjectInputStream(InputStream in, String codebaseUrl)
Create a new CodebaseAwareObjectInputStream for the given InputStream and codebase.
Method Summary
protected ClassLoader | getFallbackClassLoader() Return the fallback ClassLoader to use when no ClassLoader was specified and ObjectInputStream's own default ClassLoader failed.
protected Class | resolveFallbackIfPossible(String className, ClassNotFoundException ex) Resolve the given class name against a fallback class loader.
Methods inherited from class org.springframework.core.ConfigurableObjectInputStream
resolveClass, resolveProxyClass
Methods inherited from class java.io.ObjectInputStream
available, close, defaultReadObject, enableResolveObject, read, read, readBoolean, readByte, readChar, readClassDescriptor, readDouble, readFields, readFloat, readFully, readFully, readInt, readLine, readLong, readObject, readObjectOverride, readShort, readStreamHeader, readUnshared, readUnsignedByte, readUnsignedShort, readUTF, registerValidation, resolveObject, skipBytes
Methods inherited from class java.io.InputStream
mark, markSupported, read, reset, skip
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.io.ObjectInput
read, skip

Constructor Detail

CodebaseAwareObjectInputStream

public CodebaseAwareObjectInputStream(InputStream in,
                                      String codebaseUrl)
                               throws IOException
Create a new CodebaseAwareObjectInputStream for the given InputStream and codebase.

Parameters:
in - the InputStream to read from
codebaseUrl - the codebase URL to load classes from if not found locally (can consist of multiple URLs, separated by spaces)
Throws:
IOException
See Also:
ObjectInputStream.ObjectInputStream(java.io.InputStream)

CodebaseAwareObjectInputStream

public CodebaseAwareObjectInputStream(InputStream in,
                                      ClassLoader classLoader,
                                      String codebaseUrl)
                               throws IOException
Create a new CodebaseAwareObjectInputStream for the given InputStream and codebase.

Parameters:
in - the InputStream to read from
classLoader - the ClassLoader to use for loading local classes (may be null to indicate RMI's default ClassLoader)
codebaseUrl - the codebase URL to load classes from if not found locally (can consist of multiple URLs, separated by spaces)
Throws:
IOException
See Also:
ObjectInputStream.ObjectInputStream(java.io.InputStream)
Method Detail

resolveFallbackIfPossible

protected Class resolveFallbackIfPossible(String className,
                                          ClassNotFoundException ex)
                                   throws IOException,
                                          ClassNotFoundException
Description copied from class: ConfigurableObjectInputStream
Resolve the given class name against a fallback class loader.

The default implementation simply rethrows the original exception, since there is no fallback available.

Overrides:
resolveFallbackIfPossible in class ConfigurableObjectInputStream
Parameters:
className - the class name to resolve
ex - the original exception thrown when attempting to load the class
Returns:
the newly resolved class (never null)
Throws:
IOException
ClassNotFoundException

getFallbackClassLoader

protected ClassLoader getFallbackClassLoader()
                                      throws IOException
Description copied from class: ConfigurableObjectInputStream
Return the fallback ClassLoader to use when no ClassLoader was specified and ObjectInputStream's own default ClassLoader failed.

The default implementation simply returns null.

Overrides:
getFallbackClassLoader in class ConfigurableObjectInputStream
Throws:
IOException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


JndiRmiClientInterceptor

org.springframework.remoting.rmi
Class JndiRmiClientInterceptor

java.lang.Object
    extended by  org.springframework.jndi.JndiAccessor
        extended by  org.springframework.jndi.JndiLocatorSupport
            extended by  org.springframework.jndi.JndiObjectLocator
                extended by  org.springframework.remoting.rmi.JndiRmiClientInterceptor
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, InitializingBean
Direct Known Subclasses:
JndiRmiProxyFactoryBean
public class JndiRmiClientInterceptor
extends JndiObjectLocator
implements MethodInterceptor, InitializingBean

MethodInterceptor for accessing RMI services from JNDI. Typically used for RMI-IIOP (CORBA), but can also be used for EJB home objects (for example, a Stateful Session Bean home). In contrast to a plain JNDI lookup, this accessor also performs narrowing through PortableRemoteObject.

With conventional RMI services, this invoker is typically used with the RMI service interface. Alternatively, this invoker can also proxy a remote RMI service with a matching non-RMI business interface, i.e. an interface that mirrors the RMI service methods but does not declare RemoteExceptions. In the latter case, RemoteExceptions thrown by the RMI stub will automatically get converted to Spring's unchecked RemoteAccessException.

The JNDI environment can be specified as "jndiEnvironment" property, or be configured in a jndi.properties file or as system properties. For example:

<property name="jndiEnvironment">
         <props>
                 <prop key="java.naming.factory.initial">com.sun.jndi.cosnaming.CNCtxFactory</prop>
                 <prop key="java.naming.provider.url">iiop://localhost:1050</prop>
         </props>
 </property>

Since:
1.1
Author:
Juergen Hoeller
See Also:
JndiAccessor.setJndiTemplate(org.springframework.jndi.JndiTemplate), JndiAccessor.setJndiEnvironment(java.util.Properties), JndiObjectLocator.setJndiName(java.lang.String), JndiRmiServiceExporter, JndiRmiProxyFactoryBean, RemoteAccessException, RemoteException, Remote, PortableRemoteObject.narrow(java.lang.Object, java.lang.Class)

Field Summary
Fields inherited from class org.springframework.jndi.JndiLocatorSupport
CONTAINER_PREFIX
Fields inherited from class org.springframework.jndi.JndiAccessor
logger
Constructor Summary
JndiRmiClientInterceptor()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected RemoteInvocation | createRemoteInvocation(MethodInvocation methodInvocation) Create a new RemoteInvocation object for the given AOP method invocation.
protected Object | doInvoke(MethodInvocation invocation, Object stub) Perform the given invocation on the given RMI stub.
protected Object | doInvoke(MethodInvocation methodInvocation, RmiInvocationHandler invocationHandler) Apply the given AOP method invocation to the given RmiInvocationHandler.
RemoteInvocationFactory | getRemoteInvocationFactory() Return the RemoteInvocationFactory used by this accessor.
Class | getServiceInterface() Return the interface of the service to access.
protected Object | getStub() Return the RMI stub to use.
Object | invoke(MethodInvocation invocation) Fetches an RMI stub and delegates to doInvoke(org.aopalliance.intercept.MethodInvocation, java.lang.Object).
protected boolean | isConnectFailure(RemoteException ex) Determine whether the given RMI exception indicates a connect failure.
protected boolean | isConnectFailure(SystemException ex) Determine whether the given CORBA exception indicates a connect failure.
protected Object | lookupStub() Create the RMI stub, typically by looking it up.
void | prepare() Fetches the RMI stub on startup, if necessary.
protected Object | refreshAndRetry(MethodInvocation invocation) Refresh the RMI stub and retry the given invocation.
void | setCacheStub(boolean cacheStub) Set whether to cache the RMI stub once it has been located.
void | setLookupStubOnStartup(boolean lookupStubOnStartup) Set whether to look up the RMI stub on startup.
void | setRefreshStubOnConnectFailure(boolean refreshStubOnConnectFailure) Set whether to refresh the RMI stub on connect failure.
void | setRemoteInvocationFactory(RemoteInvocationFactory remoteInvocationFactory) Set the RemoteInvocationFactory to use for this accessor.
void | setServiceInterface(Class serviceInterface) Set the interface of the service to access.
Methods inherited from class org.springframework.jndi.JndiObjectLocator
getExpectedType, getJndiName, lookup, setExpectedType, setJndiName
Methods inherited from class org.springframework.jndi.JndiLocatorSupport
convertJndiName, isResourceRef, lookup, lookup, setResourceRef
Methods inherited from class org.springframework.jndi.JndiAccessor
getJndiEnvironment, getJndiTemplate, setJndiEnvironment, setJndiTemplate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JndiRmiClientInterceptor

public JndiRmiClientInterceptor()
Method Detail

setServiceInterface

public void setServiceInterface(Class serviceInterface)
Set the interface of the service to access. The interface must be suitable for the particular service and remoting tool.

Typically required to be able to create a suitable service proxy, but can also be optional if the lookup returns a typed stub.

getServiceInterface

public Class getServiceInterface()
Return the interface of the service to access.

setRemoteInvocationFactory

public void setRemoteInvocationFactory(RemoteInvocationFactory remoteInvocationFactory)
Set the RemoteInvocationFactory to use for this accessor. Default is a DefaultRemoteInvocationFactory.

A custom invocation factory can add further context information to the invocation, for example user credentials.

getRemoteInvocationFactory

public RemoteInvocationFactory getRemoteInvocationFactory()
Return the RemoteInvocationFactory used by this accessor.

setLookupStubOnStartup

public void setLookupStubOnStartup(boolean lookupStubOnStartup)
Set whether to look up the RMI stub on startup. Default is "true".

Can be turned off to allow for late start of the RMI server. In this case, the RMI stub will be fetched on first access.

See Also:
setCacheStub(boolean)

setCacheStub

public void setCacheStub(boolean cacheStub)
Set whether to cache the RMI stub once it has been located. Default is "true".

Can be turned off to allow for hot restart of the RMI server. In this case, the RMI stub will be fetched for each invocation.

See Also:
setLookupStubOnStartup(boolean)

setRefreshStubOnConnectFailure

public void setRefreshStubOnConnectFailure(boolean refreshStubOnConnectFailure)
Set whether to refresh the RMI stub on connect failure. Default is "false".

Can be turned on to allow for hot restart of the RMI server. If a cached RMI stub throws an RMI exception that indicates a remote connect failure, a fresh proxy will be fetched and the invocation will be retried.

See Also:
ConnectException, ConnectIOException, NoSuchObjectException

afterPropertiesSet

public void afterPropertiesSet()
                        throws NamingException
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class JndiObjectLocator
Throws:
NamingException

prepare

public void prepare()
             throws RemoteLookupFailureException
Fetches the RMI stub on startup, if necessary.

Throws:
RemoteLookupFailureException - if RMI stub creation failed
See Also:
setLookupStubOnStartup(boolean), lookupStub()

lookupStub

protected Object lookupStub()
                     throws RemoteLookupFailureException
Create the RMI stub, typically by looking it up.

Called on interceptor initialization if "cacheStub" is "true"; else called for each invocation by getStub().

The default implementation retrieves the service from the JNDI environment. This can be overridden in subclasses.

Returns:
the RMI stub to store in this interceptor
Throws:
RemoteLookupFailureException - if RMI stub creation failed
See Also:
setCacheStub(boolean), JndiObjectLocator.lookup()

getStub

protected Object getStub()
                  throws NamingException,
                         RemoteLookupFailureException
Return the RMI stub to use. Called for each invocation.

The default implementation returns the stub created on initialization, if any. Else, it invokes lookupStub() to get a new stub for each invocation. This can be overridden in subclasses, for example in order to cache a stub for a given amount of time before recreating it, or to test the stub whether it is still alive.

Returns:
the RMI stub to use for an invocation
Throws:
NamingException - if stub creation failed
RemoteLookupFailureException - if RMI stub creation failed

invoke

public Object invoke(MethodInvocation invocation)
              throws Throwable
Fetches an RMI stub and delegates to doInvoke(org.aopalliance.intercept.MethodInvocation, java.lang.Object). If configured to refresh on connect failure, it will call refreshAndRetry(org.aopalliance.intercept.MethodInvocation) on corresponding RMI exceptions.

Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable
See Also:
getStub(), doInvoke(org.aopalliance.intercept.MethodInvocation, java.lang.Object), refreshAndRetry(org.aopalliance.intercept.MethodInvocation), ConnectException, ConnectIOException, NoSuchObjectException

isConnectFailure

protected boolean isConnectFailure(RemoteException ex)
Determine whether the given RMI exception indicates a connect failure.

The default implementation delegates to RmiClientInterceptorUtils.isConnectFailure(java.rmi.RemoteException).

Parameters:
ex - the RMI exception to check
Returns:
whether the exception should be treated as connect failure

isConnectFailure

protected boolean isConnectFailure(SystemException ex)
Determine whether the given CORBA exception indicates a connect failure.

The default implementation checks for CORBA's OBJECT_NOT_EXIST exception.

Parameters:
ex - the RMI exception to check
Returns:
whether the exception should be treated as connect failure

refreshAndRetry

protected Object refreshAndRetry(MethodInvocation invocation)
                          throws Throwable
Refresh the RMI stub and retry the given invocation. Called by invoke on connect failure.

Parameters:
invocation - the AOP method invocation
Returns:
the invocation result, if any
Throws:
Throwable - in case of invocation failure
See Also:
invoke(org.aopalliance.intercept.MethodInvocation)

doInvoke

protected Object doInvoke(MethodInvocation invocation,
                          Object stub)
                   throws Throwable
Perform the given invocation on the given RMI stub.

Parameters:
invocation - the AOP method invocation
stub - the RMI stub to invoke
Returns:
the invocation result, if any
Throws:
Throwable - in case of invocation failure

doInvoke

protected Object doInvoke(MethodInvocation methodInvocation,
                          RmiInvocationHandler invocationHandler)
                   throws RemoteException,
                          NoSuchMethodException,
                          IllegalAccessException,
                          InvocationTargetException
Apply the given AOP method invocation to the given RmiInvocationHandler.

The default implementation delegates to createRemoteInvocation(org.aopalliance.intercept.MethodInvocation).

Parameters:
methodInvocation - the current AOP method invocation
invocationHandler - the RmiInvocationHandler to apply the invocation to
Returns:
the invocation result
Throws:
RemoteException - in case of communication errors
NoSuchMethodException - if the method name could not be resolved
IllegalAccessException - if the method could not be accessed
InvocationTargetException - if the method invocation resulted in an exception
See Also:
RemoteInvocation

createRemoteInvocation

protected RemoteInvocation createRemoteInvocation(MethodInvocation methodInvocation)
Create a new RemoteInvocation object for the given AOP method invocation.

The default implementation delegates to the configured RemoteInvocationFactory. This can be overridden in subclasses in order to provide custom RemoteInvocation subclasses, containing additional invocation parameters (e.g. user credentials).

Note that it is preferable to build a custom RemoteInvocationFactory as a reusable strategy, instead of overriding this method.

Parameters:
methodInvocation - the current AOP method invocation
Returns:
the RemoteInvocation object
See Also:
RemoteInvocationFactory.createRemoteInvocation(org.aopalliance.intercept.MethodInvocation)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JndiRmiProxyFactoryBean

org.springframework.remoting.rmi
Class JndiRmiProxyFactoryBean

java.lang.Object
    extended by  org.springframework.jndi.JndiAccessor
        extended by  org.springframework.jndi.JndiLocatorSupport
            extended by  org.springframework.jndi.JndiObjectLocator
                extended by  org.springframework.remoting.rmi.JndiRmiClientInterceptor
                    extended by  org.springframework.remoting.rmi.JndiRmiProxyFactoryBean
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, BeanClassLoaderAware, FactoryBean<Object>, InitializingBean
public class JndiRmiProxyFactoryBean
extends JndiRmiClientInterceptor
implements FactoryBean<Object>, BeanClassLoaderAware

FactoryBean for RMI proxies from JNDI.

Typically used for RMI-IIOP (CORBA), but can also be used for EJB home objects (for example, a Stateful Session Bean home). In contrast to a plain JNDI lookup, this accessor also performs narrowing through PortableRemoteObject.

With conventional RMI services, this invoker is typically used with the RMI service interface. Alternatively, this invoker can also proxy a remote RMI service with a matching non-RMI business interface, i.e. an interface that mirrors the RMI service methods but does not declare RemoteExceptions. In the latter case, RemoteExceptions thrown by the RMI stub will automatically get converted to Spring's unchecked RemoteAccessException.

The JNDI environment can be specified as "jndiEnvironment" property, or be configured in a jndi.properties file or as system properties. For example:

<property name="jndiEnvironment">
         <props>
                 <prop key="java.naming.factory.initial">com.sun.jndi.cosnaming.CNCtxFactory</prop>
                 <prop key="java.naming.provider.url">iiop://localhost:1050</prop>
         </props>
 </property>

Since:
1.1
Author:
Juergen Hoeller
See Also:
JndiRmiClientInterceptor.setServiceInterface(java.lang.Class),
JndiObjectLocator.setJndiName(java.lang.String),
JndiAccessor.setJndiTemplate(org.springframework.jndi.JndiTemplate),
JndiAccessor.setJndiEnvironment(java.util.Properties),
JndiObjectLocator.setJndiName(java.lang.String),
JndiRmiServiceExporter,
RemoteAccessException,
RemoteException,
Remote,
PortableRemoteObject.narrow(java.lang.Object, java.lang.Class)

Field Summary
Fields inherited from class org.springframework.jndi.JndiLocatorSupport
CONTAINER_PREFIX
Fields inherited from class org.springframework.jndi.JndiAccessor
logger
Constructor Summary
JndiRmiProxyFactoryBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 Object getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<?> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setBeanClassLoader(ClassLoader classLoader)
Callback that supplies the bean class loader to a bean instance.
Methods inherited from class org.springframework.remoting.rmi.JndiRmiClientInterceptor
createRemoteInvocation, doInvoke, doInvoke, getRemoteInvocationFactory, getServiceInterface, getStub, invoke, isConnectFailure, isConnectFailure, lookupStub, prepare, refreshAndRetry, setCacheStub, setLookupStubOnStartup, setRefreshStubOnConnectFailure, setRemoteInvocationFactory, setServiceInterface
Methods inherited from class org.springframework.jndi.JndiObjectLocator
getExpectedType, getJndiName, lookup, setExpectedType, setJndiName
Methods inherited from class org.springframework.jndi.JndiLocatorSupport
convertJndiName, isResourceRef, lookup, lookup, setResourceRef
Methods inherited from class org.springframework.jndi.JndiAccessor
getJndiEnvironment, getJndiTemplate, setJndiEnvironment, setJndiTemplate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JndiRmiProxyFactoryBean

public JndiRmiProxyFactoryBean()
Method Detail

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

afterPropertiesSet

public void afterPropertiesSet()
                        throws NamingException
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class JndiRmiClientInterceptor
Throws:
NamingException

getObject

public Object getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<Object>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<?> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<Object>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<Object>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JndiRmiServiceExporter

org.springframework.remoting.rmi
Class JndiRmiServiceExporter

java.lang.Object
    extended by  org.springframework.remoting.support.RemotingSupport
        extended by  org.springframework.remoting.support.RemoteExporter
            extended by  org.springframework.remoting.support.RemoteInvocationBasedExporter
                extended by  org.springframework.remoting.rmi.RmiBasedExporter
                    extended by  org.springframework.remoting.rmi.JndiRmiServiceExporter
All Implemented Interfaces:
BeanClassLoaderAware, DisposableBean, InitializingBean
public class JndiRmiServiceExporter
extends RmiBasedExporter
implements InitializingBean, DisposableBean

Service exporter which binds RMI services to JNDI. Typically used for RMI-IIOP (CORBA).

Exports services via the PortableRemoteObject class. You need to run "rmic" with the "-iiop" option to generate corresponding stubs and skeletons for each exported service.

Also supports exposing any non-RMI service via RMI invokers, to be accessed via JndiRmiClientInterceptor / JndiRmiProxyFactoryBean's automatic detection of such invokers.

With an RMI invoker, RMI communication works on the RmiInvocationHandler level, needing only one stub for any service. Service interfaces do not have to extend java.rmi.Remote or throw java.rmi.RemoteException on all methods, but in and out parameters have to be serializable.

The JNDI environment can be specified as "jndiEnvironment" bean property, or be configured in a jndi.properties file or as system properties. For example:

<property name="jndiEnvironment">
         <props>
                 <prop key="java.naming.factory.initial">com.sun.jndi.cosnaming.CNCtxFactory</prop>
                 <prop key="java.naming.provider.url">iiop://localhost:1050</prop>
         </props>
 </property>

Since:
1.1
Author:
Juergen Hoeller
See Also:
RemoteExporter.setService(java.lang.Object),
setJndiTemplate(org.springframework.jndi.JndiTemplate),
setJndiEnvironment(java.util.Properties),
setJndiName(java.lang.String),
JndiRmiClientInterceptor,
JndiRmiProxyFactoryBean,
PortableRemoteObject.exportObject(java.rmi.Remote)

Field Summary
Fields inherited from class org.springframework.remoting.support.RemotingSupport
logger
Constructor Summary
JndiRmiServiceExporter()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
void | destroy() Unbind the RMI service from JNDI on bean factory shutdown.
void | prepare() Initialize this service exporter, binding the specified service to JNDI.
void | rebind() Rebind the specified service to JNDI, for recovering in case of the target registry having been restarted.
void | setJndiEnvironment(Properties jndiEnvironment) Set the JNDI environment to use for JNDI lookups.
void | setJndiName(String jndiName) Set the JNDI name of the exported RMI service.
void | setJndiTemplate(JndiTemplate jndiTemplate) Set the JNDI template to use for JNDI lookups.
Methods inherited from class org.springframework.remoting.rmi.RmiBasedExporter
getObjectToExport, invoke
Methods inherited from class org.springframework.remoting.support.RemoteInvocationBasedExporter
getRemoteInvocationExecutor, invokeAndCreateResult, setRemoteInvocationExecutor
Methods inherited from class org.springframework.remoting.support.RemoteExporter
checkService, checkServiceInterface, getExporterName, getProxyForService, getService, getServiceInterface, setInterceptors, setRegisterTraceInterceptor, setService, setServiceInterface
Methods inherited from class org.springframework.remoting.support.RemotingSupport
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JndiRmiServiceExporter

public JndiRmiServiceExporter()
Method Detail

setJndiTemplate

public void setJndiTemplate(JndiTemplate jndiTemplate)
Set the JNDI template to use for JNDI lookups. You can also specify JNDI environment settings via "jndiEnvironment".

See Also:
setJndiEnvironment(java.util.Properties)

setJndiEnvironment

public void setJndiEnvironment(Properties jndiEnvironment)
Set the JNDI environment to use for JNDI lookups. Creates a JndiTemplate with the given environment settings.

See Also:
setJndiTemplate(org.springframework.jndi.JndiTemplate)

setJndiName

public void setJndiName(String jndiName)
Set the JNDI name of the exported RMI service.

afterPropertiesSet

public void afterPropertiesSet()
                        throws NamingException,
                               RemoteException
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
NamingException
RemoteException

prepare

public void prepare()
             throws NamingException,
                    RemoteException
Initialize this service exporter, binding the specified service to JNDI.

Throws:
NamingException - if service binding failed
RemoteException - if service export failed

rebind

public void rebind()
            throws NamingException
Rebind the specified service to JNDI, for recovering in case of the target registry having been restarted.

Throws:
NamingException - if service binding failed

destroy

public void destroy()
             throws NamingException,
                    NoSuchObjectException
Unbind the RMI service from JNDI on bean factory shutdown.

Specified by:
destroy in interface DisposableBean
Throws:
NamingException
NoSuchObjectException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RemoteInvocationSerializingExporter

org.springframework.remoting.rmi
Class RemoteInvocationSerializingExporter

java.lang.Object
    extended by  org.springframework.remoting.support.RemotingSupport
        extended by  org.springframework.remoting.support.RemoteExporter
            extended by  org.springframework.remoting.support.RemoteInvocationBasedExporter
                extended by  org.springframework.remoting.rmi.RemoteInvocationSerializingExporter
All Implemented Interfaces:
BeanClassLoaderAware, InitializingBean
Direct Known Subclasses:
HttpInvokerServiceExporter, SimpleHttpInvokerServiceExporter
public abstract class RemoteInvocationSerializingExporter
extends RemoteInvocationBasedExporter
implements InitializingBean

Abstract base class for remote service exporters that explicitly deserialize RemoteInvocation objects and serialize RemoteInvocationResult objects, for example Spring's HTTP invoker.

Provides template methods for ObjectInputStream and ObjectOutputStream handling.

Since:
2.5.1
Author:
Juergen Hoeller
See Also:
ObjectInputStream, ObjectOutputStream, doReadRemoteInvocation(java.io.ObjectInputStream), doWriteRemoteInvocationResult(org.springframework.remoting.support.RemoteInvocationResult, java.io.ObjectOutputStream)

Field Summary
static String CONTENT_TYPE_SERIALIZED_OBJECT
Default content type: "application/x-java-serialized-object"
Fields inherited from class org.springframework.remoting.support.RemotingSupport
logger
Constructor Summary
RemoteInvocationSerializingExporter()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected ObjectInputStream | createObjectInputStream(InputStream is) Create an ObjectInputStream for the given InputStream.
protected ObjectOutputStream | createObjectOutputStream(OutputStream os) Create an ObjectOutputStream for the given OutputStream.
protected RemoteInvocation | doReadRemoteInvocation(ObjectInputStream ois) Perform the actual reading of an invocation result object from the given ObjectInputStream.
protected void | doWriteRemoteInvocationResult(RemoteInvocationResult result, ObjectOutputStream oos) Perform the actual writing of the given invocation result object to the given ObjectOutputStream.
String | getContentType() Return the content type to use for sending remote invocation responses.
protected Object | getProxy()
void | prepare() Initialize this service exporter.
void | setContentType(String contentType) Specify the content type to use for sending remote invocation responses.
Methods inherited from class org.springframework.remoting.support.RemoteInvocationBasedExporter
getRemoteInvocationExecutor, invoke, invokeAndCreateResult, setRemoteInvocationExecutor
Methods inherited from class org.springframework.remoting.support.RemoteExporter
checkService, checkServiceInterface, getExporterName, getProxyForService, getService, getServiceInterface, setInterceptors, setRegisterTraceInterceptor, setService, setServiceInterface
Methods inherited from class org.springframework.remoting.support.RemotingSupport
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

CONTENT_TYPE_SERIALIZED_OBJECT

public static final String CONTENT_TYPE_SERIALIZED_OBJECT
Default content type: "application/x-java-serialized-object"

See Also:
Constant Field Values
Constructor Detail

RemoteInvocationSerializingExporter

public RemoteInvocationSerializingExporter()
Method Detail

setContentType

public void setContentType(String contentType)
Specify the content type to use for sending remote invocation responses.

Default is "application/x-java-serialized-object".

getContentType

public String getContentType()
Return the content type to use for sending remote invocation responses.

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

prepare

public void prepare()
Initialize this service exporter.

getProxy

protected final Object getProxy()

createObjectInputStream

protected ObjectInputStream createObjectInputStream(InputStream is)
                                             throws IOException
Create an ObjectInputStream for the given InputStream.

The default implementation creates a Spring CodebaseAwareObjectInputStream.

Parameters:
is - the InputStream to read from
Returns:
the new ObjectInputStream instance to use
Throws:
IOException - if creation of the ObjectInputStream failed

doReadRemoteInvocation

protected RemoteInvocation doReadRemoteInvocation(ObjectInputStream ois)
                                           throws IOException,
                                                  ClassNotFoundException
Perform the actual reading of an invocation result object from the given ObjectInputStream.

The default implementation simply calls ObjectInputStream.readObject(). Can be overridden for deserialization of a custom wrapper object rather than the plain invocation, for example an encryption-aware holder.

Parameters:
ois - the ObjectInputStream to read from
Returns:
the RemoteInvocationResult object
Throws:
IOException - in case of I/O failure
ClassNotFoundException - if case of a transferred class not being found in the local ClassLoader

createObjectOutputStream

protected ObjectOutputStream createObjectOutputStream(OutputStream os)
                                               throws IOException
Create an ObjectOutputStream for the given OutputStream.

The default implementation creates a plain ObjectOutputStream.

Parameters:
os - the OutputStream to write to
Returns:
the new ObjectOutputStream instance to use
Throws:
IOException - if creation of the ObjectOutputStream failed

doWriteRemoteInvocationResult

protected void doWriteRemoteInvocationResult(RemoteInvocationResult result,
                                             ObjectOutputStream oos)
                                      throws IOException
Perform the actual writing of the given invocation result object to the given ObjectOutputStream.

The default implementation simply calls ObjectOutputStream.writeObject(java.lang.Object). Can be overridden for serialization of a custom wrapper object rather than the plain invocation, for example an encryption-aware holder.

Parameters:
result - the RemoteInvocationResult object
oos - the ObjectOutputStream to write to
Throws:
IOException - if thrown by I/O methods
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RmiBasedExporter

org.springframework.remoting.rmi
Class RmiBasedExporter

java.lang.Object
    extended by  org.springframework.remoting.support.RemotingSupport
        extended by  org.springframework.remoting.support.RemoteExporter
            extended by  org.springframework.remoting.support.RemoteInvocationBasedExporter
                extended by  org.springframework.remoting.rmi.RmiBasedExporter
All Implemented Interfaces:
BeanClassLoaderAware
Direct Known Subclasses:
JndiRmiServiceExporter, RmiServiceExporter
public abstract class RmiBasedExporter
extends RemoteInvocationBasedExporter

Convenient superclass for RMI-based remote exporters. Provides a facility to automatically wrap a given plain Java service object with an RmiInvocationWrapper, exposing the RmiInvocationHandler remote interface.

Using the RMI invoker mechanism, RMI communication operates at the RmiInvocationHandler level, sharing a common invoker stub for any number of services. Service interfaces are not required to extend java.rmi.Remote or declare java.rmi.RemoteException on all service methods. However, in and out parameters still have to be serializable.

Since:
1.2.5
Author:
Juergen Hoeller
See Also:
RmiServiceExporter, JndiRmiServiceExporter

Field Summary
Fields inherited from class org.springframework.remoting.support.RemotingSupport
logger
Constructor Summary
RmiBasedExporter()
Method Summary
protected Remote | getObjectToExport() Determine the object to export: either the service object itself or a RmiInvocationWrapper in case of a non-RMI service object.
protected Object | invoke(RemoteInvocation invocation, Object targetObject) Redefined here to be visible to RmiInvocationWrapper.
Methods inherited from class org.springframework.remoting.support.RemoteInvocationBasedExporter
getRemoteInvocationExecutor, invokeAndCreateResult, setRemoteInvocationExecutor
Methods inherited from class org.springframework.remoting.support.RemoteExporter
checkService, checkServiceInterface, getExporterName, getProxyForService, getService, getServiceInterface, setInterceptors, setRegisterTraceInterceptor, setService, setServiceInterface
Methods inherited from class org.springframework.remoting.support.RemotingSupport
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

RmiBasedExporter

public RmiBasedExporter()
Method Detail

getObjectToExport

protected Remote getObjectToExport()
Determine the object to export: either the service object itself or a RmiInvocationWrapper in case of a non-RMI service object.

Returns:
the RMI object to export
See Also:
RemoteExporter.setService(java.lang.Object), RemoteExporter.setServiceInterface(java.lang.Class)

invoke

protected Object invoke(RemoteInvocation invocation,
                        Object targetObject)
                 throws NoSuchMethodException,
                        IllegalAccessException,
                        InvocationTargetException
Redefined here to be visible to RmiInvocationWrapper. Simply delegates to the corresponding superclass method.

Overrides:
invoke in class RemoteInvocationBasedExporter
Parameters:
invocation - the remote invocation
targetObject - the target object to apply the invocation to
Returns:
the invocation result
Throws:
NoSuchMethodException - if the method name could not be resolved
IllegalAccessException - if the method could not be accessed
InvocationTargetException - if the method invocation resulted in an exception
See Also:
RemoteInvocationExecutor.invoke(org.springframework.remoting.support.RemoteInvocation, java.lang.Object)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RmiClientInterceptor

org.springframework.remoting.rmi
Class RmiClientInterceptor

java.lang.Object
    extended by  org.springframework.remoting.support.RemotingSupport
        extended by  org.springframework.remoting.support.RemoteAccessor
            extended by  org.springframework.remoting.support.UrlBasedRemoteAccessor
                extended by  org.springframework.remoting.support.RemoteInvocationBasedAccessor
                    extended by  org.springframework.remoting.rmi.RmiClientInterceptor
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, BeanClassLoaderAware, InitializingBean
Direct Known Subclasses:
RmiProxyFactoryBean
public class RmiClientInterceptor
extends RemoteInvocationBasedAccessor
implements MethodInterceptor

MethodInterceptor for accessing conventional RMI services or RMI invokers. The service URL must be a valid RMI URL (e.g. "rmi://localhost:1099/myservice").

RMI invokers work at the RmiInvocationHandler level, needing only one stub for any service. Service interfaces do not have to extend java.rmi.Remote or throw java.rmi.RemoteException. Spring's unchecked RemoteAccessException will be thrown on remote invocation failure. Of course, in and out parameters have to be serializable.

With conventional RMI services, this invoker is typically used with the RMI service interface. Alternatively, this invoker can also proxy a remote RMI service with a matching non-RMI business interface, i.e. an interface that mirrors the RMI service methods but does not declare RemoteExceptions. In the latter case, RemoteExceptions thrown by the RMI stub will automatically get converted to Spring's unchecked RemoteAccessException.

Since:
29.09.2003
Author:
Juergen Hoeller
See Also:
RmiServiceExporter, RmiProxyFactoryBean, RmiInvocationHandler, RemoteAccessException, RemoteException, Remote

Field Summary
Fields inherited from class org.springframework.remoting.support.RemotingSupport
logger
Constructor Summary
RmiClientInterceptor()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected Object | doInvoke(MethodInvocation invocation, Remote stub) Perform the given invocation on the given RMI stub.
protected Object | doInvoke(MethodInvocation methodInvocation, RmiInvocationHandler invocationHandler) Apply the given AOP method invocation to the given RmiInvocationHandler.
protected Remote | getStub() Return the RMI stub to use.
Object | invoke(MethodInvocation invocation) Fetches an RMI stub and delegates to doInvoke.
protected boolean | isConnectFailure(RemoteException ex) Determine whether the given RMI exception indicates a connect failure.
protected Remote | lookupStub() Create the RMI stub, typically by looking it up.
void | prepare() Fetches RMI stub on startup, if necessary.
protected Object | refreshAndRetry(MethodInvocation invocation) Refresh the RMI stub and retry the given invocation.
void | setCacheStub(boolean cacheStub) Set whether to cache the RMI stub once it has been located.
void | setLookupStubOnStartup(boolean lookupStubOnStartup) Set whether to look up the RMI stub on startup.
void | setRefreshStubOnConnectFailure(boolean refreshStubOnConnectFailure) Set whether to refresh the RMI stub on connect failure.
void | setRegistryClientSocketFactory(RMIClientSocketFactory registryClientSocketFactory) Set a custom RMI client socket factory to use for accessing the RMI registry.
Methods inherited from class org.springframework.remoting.support.RemoteInvocationBasedAccessor
createRemoteInvocation, getRemoteInvocationFactory, recreateRemoteInvocationResult, setRemoteInvocationFactory
Methods inherited from class org.springframework.remoting.support.UrlBasedRemoteAccessor
getServiceUrl, setServiceUrl
Methods inherited from class org.springframework.remoting.support.RemoteAccessor
getServiceInterface, setServiceInterface
Methods inherited from class org.springframework.remoting.support.RemotingSupport
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

RmiClientInterceptor

public RmiClientInterceptor()
Method Detail

setLookupStubOnStartup

public void setLookupStubOnStartup(boolean lookupStubOnStartup)
Set whether to look up the RMI stub on startup. Default is "true".

Can be turned off to allow for late start of the RMI server. In this case, the RMI stub will be fetched on first access.

See Also:
setCacheStub(boolean)

setCacheStub

public void setCacheStub(boolean cacheStub)
Set whether to cache the RMI stub once it has been located. Default is "true".

Can be turned off to allow for hot restart of the RMI server. In this case, the RMI stub will be fetched for each invocation.

See Also:
setLookupStubOnStartup(boolean)

setRefreshStubOnConnectFailure

public void setRefreshStubOnConnectFailure(boolean refreshStubOnConnectFailure)
Set whether to refresh the RMI stub on connect failure. Default is "false".

Can be turned on to allow for hot restart of the RMI server. If a cached RMI stub throws an RMI exception that indicates a remote connect failure, a fresh proxy will be fetched and the invocation will be retried.

See Also:
ConnectException, ConnectIOException, NoSuchObjectException

setRegistryClientSocketFactory

public void setRegistryClientSocketFactory(RMIClientSocketFactory registryClientSocketFactory)
Set a custom RMI client socket factory to use for accessing the RMI registry.

See Also:
RMIClientSocketFactory, LocateRegistry.getRegistry(String, int, RMIClientSocketFactory)

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class UrlBasedRemoteAccessor

prepare

public void prepare()
             throws RemoteLookupFailureException
Fetches RMI stub on startup, if necessary.

Throws:
RemoteLookupFailureException - if RMI stub creation failed
See Also:
setLookupStubOnStartup(boolean), lookupStub()

lookupStub

protected Remote lookupStub()
                     throws RemoteLookupFailureException
Create the RMI stub, typically by looking it up.

Called on interceptor initialization if "cacheStub" is "true"; else called for each invocation by getStub().

The default implementation looks up the service URL via java.rmi.Naming. This can be overridden in subclasses.

Returns:
the RMI stub to store in this interceptor
Throws:
RemoteLookupFailureException - if RMI stub creation failed
See Also:
setCacheStub(boolean), Naming.lookup(java.lang.String)

getStub

protected Remote getStub()
                  throws RemoteLookupFailureException
Return the RMI stub to use. Called for each invocation.

The default implementation returns the stub created on initialization, if any. Else, it invokes lookupStub() to get a new stub for each invocation. This can be overridden in subclasses, for example in order to cache a stub for a given amount of time before recreating it, or to test the stub whether it is still alive.

Returns:
the RMI stub to use for an invocation
Throws:
RemoteLookupFailureException - if RMI stub creation failed
See Also:
lookupStub()

invoke

public Object invoke(MethodInvocation invocation)
              throws Throwable
Fetches an RMI stub and delegates to doInvoke. If configured to refresh on connect failure, it will call refreshAndRetry(org.aopalliance.intercept.MethodInvocation) on corresponding RMI exceptions.

Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable
See Also:
getStub(), doInvoke(MethodInvocation, Remote), refreshAndRetry(org.aopalliance.intercept.MethodInvocation), ConnectException, ConnectIOException, NoSuchObjectException

isConnectFailure

protected boolean isConnectFailure(RemoteException ex)
Determine whether the given RMI exception indicates a connect failure.

The default implementation delegates to RmiClientInterceptorUtils.isConnectFailure(java.rmi.RemoteException).

Parameters:
ex - the RMI exception to check
Returns:
whether the exception should be treated as connect failure

refreshAndRetry

protected Object refreshAndRetry(MethodInvocation invocation)
                          throws Throwable
Refresh the RMI stub and retry the given invocation. Called by invoke on connect failure.

Parameters:
invocation - the AOP method invocation
Returns:
the invocation result, if any
Throws:
Throwable - in case of invocation failure
See Also:
invoke(org.aopalliance.intercept.MethodInvocation)

doInvoke

protected Object doInvoke(MethodInvocation invocation,
                          Remote stub)
                   throws Throwable
Perform the given invocation on the given RMI stub.

Parameters:
invocation - the AOP method invocation
stub - the RMI stub to invoke
Returns:
the invocation result, if any
Throws:
Throwable - in case of invocation failure

doInvoke

protected Object doInvoke(MethodInvocation methodInvocation,
                          RmiInvocationHandler invocationHandler)
                   throws RemoteException,
                          NoSuchMethodException,
                          IllegalAccessException,
                          InvocationTargetException
Apply the given AOP method invocation to the given RmiInvocationHandler.

The default implementation delegates to RemoteInvocationBasedAccessor.createRemoteInvocation(org.aopalliance.intercept.MethodInvocation).

Parameters:
methodInvocation - the current AOP method invocation
invocationHandler - the RmiInvocationHandler to apply the invocation to
Returns:
the invocation result
Throws:
RemoteException - in case of communication errors
NoSuchMethodException - if the method name could not be resolved
IllegalAccessException - if the method could not be accessed
InvocationTargetException - if the method invocation resulted in an exception
See Also:
RemoteInvocation
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RmiClientInterceptorUtils

org.springframework.remoting.rmi
Class RmiClientInterceptorUtils

java.lang.Object
    extended by  org.springframework.remoting.rmi.RmiClientInterceptorUtils

public abstract class RmiClientInterceptorUtils
extends Object

Factored-out methods for performing invocations within an RMI client. Can handle both RMI and non-RMI service interfaces working on an RMI stub.

Note: This is an SPI class, not intended to be used by applications.

Since:
1.1
Author:
Juergen Hoeller

Constructor Summary
RmiClientInterceptorUtils()
Method Summary
static Exception convertRmiAccessException(Method method, RemoteException ex, boolean isConnectFailure, String serviceName)
Convert the given RemoteException that happened during remote access to Spring's RemoteAccessException if the method signature does not support RemoteException.
static Exception convertRmiAccessException(Method method, RemoteException ex, String serviceName)
Convert the given RemoteException that happened during remote access to Spring's RemoteAccessException if the method signature does not support RemoteException.
static Exception convertRmiAccessException(Method method, Throwable ex, String message)
Wrap the given arbitrary exception that happened during remote access in either a RemoteException or a Spring RemoteAccessException (if the method signature does not support RemoteException).
static Object doInvoke(MethodInvocation invocation, Remote stub)
Deprecated. as of Spring 2.5, in favor of invokeRemoteMethod(org.aopalliance.intercept.MethodInvocation, java.lang.Object)
static Object invoke(MethodInvocation invocation, Remote stub, String serviceName)
Deprecated. as of Spring 2.5, in favor of invokeRemoteMethod(org.aopalliance.intercept.MethodInvocation, java.lang.Object)
static Object invokeRemoteMethod(MethodInvocation invocation, Object stub)
Perform a raw method invocation on the given RMI stub, letting reflection exceptions through as-is.
static boolean isConnectFailure(RemoteException ex)
Determine whether the given RMI exception indicates a connect failure.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

RmiClientInterceptorUtils

public RmiClientInterceptorUtils()
Method Detail

invoke

@Deprecated
public static Object invoke(MethodInvocation invocation,
                                       Remote stub,
                                       String serviceName)
                     throws Throwable
Deprecated. as of Spring 2.5, in favor of invokeRemoteMethod(org.aopalliance.intercept.MethodInvocation, java.lang.Object)

Apply the given method invocation to the given RMI stub.

Delegates to the corresponding method if the RMI stub does not directly implement the invoked method. This typically happens when a non-RMI service interface is used for an RMI service. The methods of such a service interface have to match the RMI stub methods, but they typically don't declare java.rmi.RemoteException: A RemoteException thrown by the RMI stub will be automatically converted to Spring's RemoteAccessException.

Throws:
Throwable

doInvoke

@Deprecated
public static Object doInvoke(MethodInvocation invocation,
                                         Remote stub)
                       throws InvocationTargetException
Deprecated. as of Spring 2.5, in favor of invokeRemoteMethod(org.aopalliance.intercept.MethodInvocation, java.lang.Object)

Perform a raw method invocation on the given RMI stub, letting reflection exceptions through as-is.

Throws:
InvocationTargetException

invokeRemoteMethod

public static Object invokeRemoteMethod(MethodInvocation invocation,
                                        Object stub)
                                 throws InvocationTargetException
Perform a raw method invocation on the given RMI stub, letting reflection exceptions through as-is.

Parameters:
invocation - the AOP MethodInvocation
stub - the RMI stub
Returns:
the invocation result, if any
Throws:
InvocationTargetException - if thrown by reflection

convertRmiAccessException

public static Exception convertRmiAccessException(Method method,
                                                  Throwable ex,
                                                  String message)
Wrap the given arbitrary exception that happened during remote access in either a RemoteException or a Spring RemoteAccessException (if the method signature does not support RemoteException).

Only call this for remote access exceptions, not for exceptions thrown by the target service itself!

Parameters:
method - the invoked method
ex - the exception that happened, to be used as cause for the RemoteAccessException or RemoteException
message - the message for the RemoteAccessException respectively RemoteException
Returns:
the exception to be thrown to the caller

convertRmiAccessException

public static Exception convertRmiAccessException(Method method,
                                                  RemoteException ex,
                                                  String serviceName)
Convert the given RemoteException that happened during remote access to Spring's RemoteAccessException if the method signature does not support RemoteException. Else, return the original RemoteException.

Parameters:
method - the invoked method
ex - the RemoteException that happened
serviceName - the name of the service (for debugging purposes)
Returns:
the exception to be thrown to the caller

convertRmiAccessException

public static Exception convertRmiAccessException(Method method,
                                                  RemoteException ex,
                                                  boolean isConnectFailure,
                                                  String serviceName)
Convert the given RemoteException that happened during remote access to Spring's RemoteAccessException if the method signature does not support RemoteException. Else, return the original RemoteException.

Parameters:
method - the invoked method
ex - the RemoteException that happened
isConnectFailure - whether the given exception should be considered a connect failure
serviceName - the name of the service (for debugging purposes)
Returns:
the exception to be thrown to the caller

isConnectFailure

public static boolean isConnectFailure(RemoteException ex)
Determine whether the given RMI exception indicates a connect failure.

Treats RMI's ConnectException, ConnectIOException, UnknownHostException, NoSuchObjectException and StubNotFoundException as connect failure, as well as Oracle's OC4J com.evermind.server.rmi.RMIConnectionException (which doesn't derive from from any well-known RMI connect exception).

Parameters:
ex - the RMI exception to check
Returns:
whether the exception should be treated as connect failure
See Also:
ConnectException, ConnectIOException, UnknownHostException, NoSuchObjectException, StubNotFoundException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RmiProxyFactoryBean

org.springframework.remoting.rmi
Class RmiProxyFactoryBean

java.lang.Object
    extended by  org.springframework.remoting.support.RemotingSupport
        extended by  org.springframework.remoting.support.RemoteAccessor
            extended by  org.springframework.remoting.support.UrlBasedRemoteAccessor
                extended by  org.springframework.remoting.support.RemoteInvocationBasedAccessor
                    extended by  org.springframework.remoting.rmi.RmiClientInterceptor
                        extended by  org.springframework.remoting.rmi.RmiProxyFactoryBean
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, BeanClassLoaderAware, FactoryBean<Object>, InitializingBean
public class RmiProxyFactoryBean
extends RmiClientInterceptor
implements FactoryBean<Object>, BeanClassLoaderAware

FactoryBean for RMI proxies, supporting both conventional RMI services and RMI invokers. Exposes the proxied service for use as a bean reference, using the specified service interface. Proxies will throw Spring's unchecked RemoteAccessException on remote invocation failure instead of RMI's RemoteException.

The service URL must be a valid RMI URL like "rmi://localhost:1099/myservice". RMI invokers work at the RmiInvocationHandler level, using the same invoker stub for any service. Service interfaces do not have to extend java.rmi.Remote or throw java.rmi.RemoteException. Of course, in and out parameters have to be serializable.

With conventional RMI services, this proxy factory is typically used with the RMI service interface. Alternatively, this factory can also proxy a remote RMI service with a matching non-RMI business interface, i.e. an interface that mirrors the RMI service methods but does not declare RemoteExceptions. In the latter case, RemoteExceptions thrown by the RMI stub will automatically get converted to Spring's unchecked RemoteAccessException.

The major advantage of RMI, compared to Hessian and Burlap, is serialization. Effectively, any serializable Java object can be transported without hassle. Hessian and Burlap have their own (de-)serialization mechanisms, but are HTTP-based and thus much easier to setup than RMI. Alternatively, consider Spring's HTTP invoker to combine Java serialization with HTTP-based transport.

Since:
13.05.2003
Author:
Juergen Hoeller
See Also:
RemoteAccessor.setServiceInterface(java.lang.Class), UrlBasedRemoteAccessor.setServiceUrl(java.lang.String), RmiClientInterceptor, RmiServiceExporter, Remote, RemoteException, RemoteAccessException, HessianProxyFactoryBean, BurlapProxyFactoryBean, HttpInvokerProxyFactoryBean

Field Summary
Fields inherited from class org.springframework.remoting.support.RemotingSupport
logger
Constructor Summary
RmiProxyFactoryBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 Object getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<?> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
Methods inherited from class org.springframework.remoting.rmi.RmiClientInterceptor
doInvoke, doInvoke, getStub, invoke, isConnectFailure, lookupStub, prepare, refreshAndRetry, setCacheStub, setLookupStubOnStartup, setRefreshStubOnConnectFailure, setRegistryClientSocketFactory
Methods inherited from class org.springframework.remoting.support.RemoteInvocationBasedAccessor
createRemoteInvocation, getRemoteInvocationFactory, recreateRemoteInvocationResult, setRemoteInvocationFactory
Methods inherited from class org.springframework.remoting.support.UrlBasedRemoteAccessor
getServiceUrl, setServiceUrl
Methods inherited from class org.springframework.remoting.support.RemoteAccessor
getServiceInterface, setServiceInterface
Methods inherited from class org.springframework.remoting.support.RemotingSupport
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.BeanClassLoaderAware
setBeanClassLoader

Constructor Detail

RmiProxyFactoryBean

public RmiProxyFactoryBean()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class RmiClientInterceptor

getObject

public Object getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<Object>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<?> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<Object>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<Object>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RmiRegistryFactoryBean

org.springframework.remoting.rmi
Class RmiRegistryFactoryBean

java.lang.Object
    extended by  org.springframework.remoting.rmi.RmiRegistryFactoryBean
All Implemented Interfaces:
DisposableBean, FactoryBean<Registry>, InitializingBean
public class RmiRegistryFactoryBean
extends Object
implements FactoryBean<Registry>, InitializingBean, DisposableBean

FactoryBean that locates a Registry and exposes it for bean references. Can also create a local RMI registry on the fly if none exists already.

Can be used to set up and pass around the actual Registry object to applications objects that need to work with RMI. One example for such an object that needs to work with RMI is Spring's RmiServiceExporter, which either works with a passed-in Registry reference or falls back to the registry as specified by its local properties and defaults.

Also useful to enforce creation of a local RMI registry at a given port, for example for a JMX connector. If used in conjunction with ConnectorServerFactoryBean, it is recommended to mark the connector definition (ConnectorServerFactoryBean) as "depends-on" the registry definition (RmiRegistryFactoryBean), to guarantee starting up the registry first.

Note: The implementation of this class mirrors the corresponding logic in RmiServiceExporter, and also offers the same customization hooks. RmiServiceExporter implements its own registry lookup as a convenience: It is very common to simply rely on the registry defaults.

Since:
1.2.3
Author:
Juergen Hoeller
See Also:
RmiServiceExporter.setRegistry(java.rmi.registry.Registry), ConnectorServerFactoryBean, Registry, LocateRegistry

Field Summary
protected  Log logger
Constructor Summary
RmiRegistryFactoryBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 void destroy()
Unexport the RMI registry on bean factory shutdown, provided that this bean actually created a registry.
 String getHost()
Return the host of the registry for the exported RMI service.
 Registry getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<? extends Registry> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 int getPort()
Return the port of the registry for the exported RMI service.
protected  Registry getRegistry(int registryPort)
Locate or create the RMI registry.
protected  Registry getRegistry(int registryPort, RMIClientSocketFactory clientSocketFactory, RMIServerSocketFactory serverSocketFactory)
Locate or create the RMI registry.
protected  Registry getRegistry(String registryHost, int registryPort, RMIClientSocketFactory clientSocketFactory, RMIServerSocketFactory serverSocketFactory)
Locate or create the RMI registry.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setAlwaysCreate(boolean alwaysCreate)
Set whether to always create the registry in-process, not attempting to locate an existing registry at the specified port.
 void setClientSocketFactory(RMIClientSocketFactory clientSocketFactory)
Set a custom RMI client socket factory to use for the RMI registry.
 void setHost(String host)
Set the host of the registry for the exported RMI service, i.e.
 void setPort(int port)
Set the port of the registry for the exported RMI service, i.e.
 void setServerSocketFactory(RMIServerSocketFactory serverSocketFactory)
Set a custom RMI server socket factory to use for the RMI registry.
protected  void testRegistry(Registry registry)
Test the given RMI registry, calling some operation on it to check whether it is still active.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Constructor Detail

RmiRegistryFactoryBean

public RmiRegistryFactoryBean()
Method Detail

setHost

public void setHost(String host)
Set the host of the registry for the exported RMI service, i.e. rmi://HOST:port/name

Default is localhost.

getHost

public String getHost()
Return the host of the registry for the exported RMI service.

setPort

public void setPort(int port)
Set the port of the registry for the exported RMI service, i.e. rmi://host:PORT/name

Default is Registry.REGISTRY_PORT (1099).

getPort

public int getPort()
Return the port of the registry for the exported RMI service.

setClientSocketFactory

public void setClientSocketFactory(RMIClientSocketFactory clientSocketFactory)
Set a custom RMI client socket factory to use for the RMI registry.

If the given object also implements java.rmi.server.RMIServerSocketFactory, it will automatically be registered as server socket factory too.

See Also:
setServerSocketFactory(java.rmi.server.RMIServerSocketFactory), RMIClientSocketFactory, RMIServerSocketFactory, LocateRegistry.getRegistry(String, int, java.rmi.server.RMIClientSocketFactory)

setServerSocketFactory

public void setServerSocketFactory(RMIServerSocketFactory serverSocketFactory)
Set a custom RMI server socket factory to use for the RMI registry.

Only needs to be specified when the client socket factory does not implement java.rmi.server.RMIServerSocketFactory already.

See Also:
setClientSocketFactory(java.rmi.server.RMIClientSocketFactory), RMIClientSocketFactory, RMIServerSocketFactory, LocateRegistry.createRegistry(int, RMIClientSocketFactory, java.rmi.server.RMIServerSocketFactory)

setAlwaysCreate

public void setAlwaysCreate(boolean alwaysCreate)
Set whether to always create the registry in-process, not attempting to locate an existing registry at the specified port.

Default is "false". Switch this flag to "true" in order to avoid the overhead of locating an existing registry when you always intend to create a new registry in any case.

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception - in the event of misconfiguration (such as failure to set an essential property) or if initialization fails.

getRegistry

protected Registry getRegistry(String registryHost,
                               int registryPort,
                               RMIClientSocketFactory clientSocketFactory,
                               RMIServerSocketFactory serverSocketFactory)
                        throws RemoteException
Locate or create the RMI registry.

Parameters:
registryHost - the registry host to use (if this is specified, no implicit creation of a RMI registry will happen)
registryPort - the registry port to use
clientSocketFactory - the RMI client socket factory for the registry (if any)
serverSocketFactory - the RMI server socket factory for the registry (if any)
Returns:
the RMI registry
Throws:
RemoteException - if the registry couldn't be located or created

getRegistry

protected Registry getRegistry(int registryPort,
                               RMIClientSocketFactory clientSocketFactory,
                               RMIServerSocketFactory serverSocketFactory)
                        throws RemoteException
Locate or create the RMI registry.

Parameters:
registryPort - the registry port to use
clientSocketFactory - the RMI client socket factory for the registry (if any)
serverSocketFactory - the RMI server socket factory for the registry (if any)
Returns:
the RMI registry
Throws:
RemoteException - if the registry couldn't be located or created

getRegistry

protected Registry getRegistry(int registryPort)
                        throws RemoteException
Locate or create the RMI registry.

Parameters:
registryPort - the registry port to use
Returns:
the RMI registry
Throws:
RemoteException - if the registry couldn't be located or created

testRegistry

protected void testRegistry(Registry registry)
                     throws RemoteException
Test the given RMI registry, calling some operation on it to check whether it is still active.

Default implementation calls Registry.list().

Parameters:
registry - the RMI registry to test
Throws:
RemoteException - if thrown by registry methods
See Also:
Registry.list()

getObject

public Registry getObject()
                   throws Exception
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<Registry>
Returns:
an instance of the bean (can be null)
Throws:
Exception - in case of creation errors
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends Registry> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<Registry>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<Registry>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()

destroy

public void destroy()
             throws RemoteException
Unexport the RMI registry on bean factory shutdown, provided that this bean actually created a registry.

Specified by:
destroy in interface DisposableBean
Throws:
RemoteException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RmiServiceExporter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.remoting.rmi
Class RmiServiceExporter

java.lang.Object
    extended by  org.springframework.remoting.support.RemotingSupport
        extended by  org.springframework.remoting.support.RemoteExporter
            extended by  org.springframework.remoting.support.RemoteInvocationBasedExporter
                extended by  org.springframework.remoting.rmi.RmiBasedExporter
                    extended by  org.springframework.remoting.rmi.RmiServiceExporter
All Implemented Interfaces:
BeanClassLoaderAware, DisposableBean, InitializingBean
public class RmiServiceExporter
extends RmiBasedExporter
implements InitializingBean, DisposableBean

RMI exporter that exposes the specified service as RMI object with the specified name. Such services can be accessed via plain RMI or via RmiProxyFactoryBean. Also supports exposing any non-RMI service via RMI invokers, to be accessed via RmiClientInterceptor / RmiProxyFactoryBean's automatic detection of such invokers.

With an RMI invoker, RMI communication works on the RmiInvocationHandler level, needing only one stub for any service. Service interfaces do not have to extend java.rmi.Remote or throw java.rmi.RemoteException on all methods, but in and out parameters have to be serializable.

The major advantage of RMI, compared to Hessian and Burlap, is serialization. Effectively, any serializable Java object can be transported without hassle. Hessian and Burlap have their own (de-)serialization mechanisms, but are HTTP-based and thus much easier to setup than RMI. Alternatively, consider Spring's HTTP invoker to combine Java serialization with HTTP-based transport.

Note: RMI makes a best-effort attempt to obtain the fully qualified host name. If one cannot be determined, it will fall back and use the IP address. Depending on your network configuration, in some cases it will resolve the IP to the loopback address. To ensure that RMI will use the host name bound to the correct network interface, you should pass the java.rmi.server.hostname property to the JVM that will export the registry and/or the service using the "-D" JVM argument. For example: -Djava.rmi.server.hostname=myserver.com

Since:
13.05.2003
Author:
Juergen Hoeller
See Also:
RmiClientInterceptor, RmiProxyFactoryBean, Remote, RemoteException, HessianServiceExporter, BurlapServiceExporter, HttpInvokerServiceExporter

Field Summary
Fields inherited from class org.springframework.remoting.support.RemotingSupport
logger
Constructor Summary
RmiServiceExporter()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
void | destroy() Unbind the RMI service from the registry on bean factory shutdown.
protected Registry | getRegistry(int registryPort) Locate or create the RMI registry for this exporter.
protected Registry | getRegistry(int registryPort, RMIClientSocketFactory clientSocketFactory, RMIServerSocketFactory serverSocketFactory) Locate or create the RMI registry for this exporter.
protected Registry | getRegistry(String registryHost, int registryPort, RMIClientSocketFactory clientSocketFactory, RMIServerSocketFactory serverSocketFactory) Locate or create the RMI registry for this exporter.
void | prepare() Initialize this service exporter, registering the service as RMI object.
void | setAlwaysCreateRegistry(boolean alwaysCreateRegistry) Set whether to always create the registry in-process, not attempting to locate an existing registry at the specified port.
void | setClientSocketFactory(RMIClientSocketFactory clientSocketFactory) Set a custom RMI client socket factory to use for exporting the service.
void | setRegistry(Registry registry) Specify the RMI registry to register the exported service with.
void | setRegistryClientSocketFactory(RMIClientSocketFactory registryClientSocketFactory) Set a custom RMI client socket factory to use for the RMI registry.
void | setRegistryHost(String registryHost) Set the host of the registry for the exported RMI service, i.e.
void | setRegistryPort(int registryPort) Set the port of the registry for the exported RMI service, i.e.
void | setRegistryServerSocketFactory(RMIServerSocketFactory registryServerSocketFactory) Set a custom RMI server socket factory to use for the RMI registry.
void | setReplaceExistingBinding(boolean replaceExistingBinding) Set whether to replace an existing binding in the RMI registry, that is, whether to simply override an existing binding with the specified service in case of a naming conflict in the registry.
void | setServerSocketFactory(RMIServerSocketFactory serverSocketFactory) Set a custom RMI server socket factory to use for exporting the service.
void | setServiceName(String serviceName) Set the name of the exported RMI service, i.e.
void | setServicePort(int servicePort) Set the port that the exported RMI service will use.
protected void | testRegistry(Registry registry) Test the given RMI registry, calling some operation on it to check whether it is still active.
Methods inherited from class org.springframework.remoting.rmi.RmiBasedExporter
getObjectToExport, invoke
Methods inherited from class org.springframework.remoting.support.RemoteInvocationBasedExporter
getRemoteInvocationExecutor, invokeAndCreateResult, setRemoteInvocationExecutor
Methods inherited from class org.springframework.remoting.support.RemoteExporter
checkService, checkServiceInterface, getExporterName, getProxyForService, getService, getServiceInterface, setInterceptors, setRegisterTraceInterceptor, setService, setServiceInterface
Methods inherited from class org.springframework.remoting.support.RemotingSupport
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

RmiServiceExporter

public RmiServiceExporter()
Method Detail

setServiceName

public void setServiceName(String serviceName)
Set the name of the exported RMI service, i.e. rmi://host:port/NAME

setServicePort

public void setServicePort(int servicePort)
Set the port that the exported RMI service will use.

Default is 0 (anonymous port).

setClientSocketFactory

public void setClientSocketFactory(RMIClientSocketFactory clientSocketFactory)
Set a custom RMI client socket factory to use for exporting the service.

If the given object also implements java.rmi.server.RMIServerSocketFactory, it will automatically be registered as server socket factory too.

See Also:
setServerSocketFactory(java.rmi.server.RMIServerSocketFactory), RMIClientSocketFactory, RMIServerSocketFactory, UnicastRemoteObject.exportObject(Remote, int, RMIClientSocketFactory, RMIServerSocketFactory)

setServerSocketFactory

public void setServerSocketFactory(RMIServerSocketFactory serverSocketFactory)
Set a custom RMI server socket factory to use for exporting the service.

Only needs to be specified when the client socket factory does not implement java.rmi.server.RMIServerSocketFactory already.

See Also:
setClientSocketFactory(java.rmi.server.RMIClientSocketFactory), RMIClientSocketFactory, RMIServerSocketFactory, UnicastRemoteObject.exportObject(Remote, int, RMIClientSocketFactory, RMIServerSocketFactory)

setRegistry

public void setRegistry(Registry registry)
Specify the RMI registry to register the exported service with. Typically used in combination with RmiRegistryFactoryBean.

Alternatively, you can specify all registry properties locally. This exporter will then try to locate the specified registry, automatically creating a new local one if appropriate.

Default is a local registry at the default port (1099), created on the fly if necessary.

See Also:
RmiRegistryFactoryBean, setRegistryHost(java.lang.String), setRegistryPort(int), setRegistryClientSocketFactory(java.rmi.server.RMIClientSocketFactory), setRegistryServerSocketFactory(java.rmi.server.RMIServerSocketFactory)

setRegistryHost

public void setRegistryHost(String registryHost)
Set the host of the registry for the exported RMI service, i.e. rmi://HOST:port/name

Default is localhost.

setRegistryPort

public void setRegistryPort(int registryPort)
Set the port of the registry for the exported RMI service, i.e. rmi://host:PORT/name

Default is Registry.REGISTRY_PORT (1099).

See Also:
Registry.REGISTRY_PORT

setRegistryClientSocketFactory

public void setRegistryClientSocketFactory(RMIClientSocketFactory registryClientSocketFactory)
Set a custom RMI client socket factory to use for the RMI registry.

If the given object also implements java.rmi.server.RMIServerSocketFactory, it will automatically be registered as server socket factory too.

See Also:
setRegistryServerSocketFactory(java.rmi.server.RMIServerSocketFactory), RMIClientSocketFactory, RMIServerSocketFactory, LocateRegistry.getRegistry(String, int, RMIClientSocketFactory)

setRegistryServerSocketFactory

public void setRegistryServerSocketFactory(RMIServerSocketFactory registryServerSocketFactory)
Set a custom RMI server socket factory to use for the RMI registry.

Only needs to be specified when the client socket factory does not implement java.rmi.server.RMIServerSocketFactory already.

See Also:
setRegistryClientSocketFactory(java.rmi.server.RMIClientSocketFactory), RMIClientSocketFactory, RMIServerSocketFactory, LocateRegistry.createRegistry(int, RMIClientSocketFactory, RMIServerSocketFactory)

setAlwaysCreateRegistry

public void setAlwaysCreateRegistry(boolean alwaysCreateRegistry)
Set whether to always create the registry in-process, not attempting to locate an existing registry at the specified port.

Default is "false". Switch this flag to "true" in order to avoid the overhead of locating an existing registry when you always intend to create a new registry in any case.

setReplaceExistingBinding

public void setReplaceExistingBinding(boolean replaceExistingBinding)
Set whether to replace an existing binding in the RMI registry, that is, whether to simply override an existing binding with the specified service in case of a naming conflict in the registry.

Default is "true", assuming that an existing binding for this exporter's service name is an accidental leftover from a previous execution. Switch this to "false" to make the exporter fail in such a scenario, indicating that there was already an RMI object bound.

afterPropertiesSet

public void afterPropertiesSet()
                        throws RemoteException
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
RemoteException

prepare

public void prepare()
             throws RemoteException
Initialize this service exporter, registering the service as RMI object.

Creates an RMI registry on the specified port if none exists.

Throws:
RemoteException - if service registration failed

getRegistry

protected Registry getRegistry(String registryHost,
                               int registryPort,
                               RMIClientSocketFactory clientSocketFactory,
                               RMIServerSocketFactory serverSocketFactory)
                        throws RemoteException
Locate or create the RMI registry for this exporter.

Parameters:
registryHost - the registry host to use (if this is specified, no implicit creation of a RMI registry will happen)
registryPort - the registry port to use
clientSocketFactory - the RMI client socket factory for the registry (if any)
serverSocketFactory - the RMI server socket factory for the registry (if any)
Returns:
the RMI registry
Throws:
RemoteException - if the registry couldn't be located or created

getRegistry

protected Registry getRegistry(int registryPort,
                               RMIClientSocketFactory clientSocketFactory,
                               RMIServerSocketFactory serverSocketFactory)
                        throws RemoteException
Locate or create the RMI registry for this exporter.

Parameters:
registryPort - the registry port to use
clientSocketFactory - the RMI client socket factory for the registry (if any)
serverSocketFactory - the RMI server socket factory for the registry (if any)
Returns:
the RMI registry
Throws:
RemoteException - if the registry couldn't be located or created

getRegistry

protected Registry getRegistry(int registryPort)
                        throws RemoteException
Locate or create the RMI registry for this exporter.

Parameters:
registryPort - the registry port to use
Returns:
the RMI registry
Throws:
RemoteException - if the registry couldn't be located or created

testRegistry

protected void testRegistry(Registry registry)
                     throws RemoteException
Test the given RMI registry, calling some operation on it to check whether it is still active.

Default implementation calls Registry.list().

Parameters:
registry - the RMI registry to test
Throws:
RemoteException - if thrown by registry methods
See Also:
Registry.list()

destroy

public void destroy()
             throws RemoteException
Unbind the RMI service from the registry on bean factory shutdown.

Specified by:
destroy in interface DisposableBean
Throws:
RemoteException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.remoting.soap

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.remoting.soap

SOAP-specific exceptions and support classes for Spring's remoting subsystem.

See:
Description

Exception Summary
SoapFaultException RemoteInvocationFailureException subclass that provides the details of a SOAP fault.

Package org.springframework.remoting.soap Description

SOAP-specific exceptions and support classes for Spring's remoting subsystem.


org.springframework.remoting.soap Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.remoting.soap

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.remoting.RemoteAccessException
              • org.springframework.remoting.RemoteInvocationFailureException
                • org.springframework.remoting.soap.SoapFaultException


SoapFaultException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.remoting.soap
Class SoapFaultException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.remoting.RemoteAccessException
                        extended by  org.springframework.remoting.RemoteInvocationFailureException
                            extended by  org.springframework.remoting.soap.SoapFaultException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
JaxRpcSoapFaultException, JaxWsSoapFaultException
public abstract class SoapFaultException
extends RemoteInvocationFailureException

RemoteInvocationFailureException subclass that provides the details of a SOAP fault.

Since:
2.5
Author:
Juergen Hoeller
See Also:
SOAPFaultException, SOAPFaultException, Serialized Form

Constructor Summary
protected SoapFaultException(String msg, Throwable cause)
Constructor for SoapFaultException.
Method Summary
abstract String | getFaultActor() Return the actor that caused this fault.
abstract String | getFaultCode() Return the SOAP fault code.
abstract QName | getFaultCodeAsQName() Return the SOAP fault code as a QName object.
abstract String | getFaultString() Return the descriptive SOAP fault string.
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

SoapFaultException

protected SoapFaultException(String msg,
                             Throwable cause)
Constructor for SoapFaultException.

Parameters:
msg - the detail message
cause - the root cause from the SOAP API in use
Method Detail

getFaultCode

public abstract String getFaultCode()
Return the SOAP fault code.

getFaultCodeAsQName

public abstract QName getFaultCodeAsQName()
Return the SOAP fault code as a QName object.

getFaultString

public abstract String getFaultString()
Return the descriptive SOAP fault string.

getFaultActor

public abstract String getFaultActor()
Return the actor that caused this fault.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.remoting.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.remoting.support

Generic support classes for remoting implementations.

See:
Description

Interface Summary
RemoteInvocationExecutor | Strategy interface for executing a RemoteInvocation on a target object.
RemoteInvocationFactory | Strategy interface for creating a RemoteInvocation from an AOP Alliance MethodInvocation.

Class Summary
DefaultRemoteInvocationExecutor | Default implementation of the RemoteInvocationExecutor interface.
DefaultRemoteInvocationFactory | Default implementation of the RemoteInvocationFactory interface.
RemoteAccessor | Abstract base class for classes that access a remote service.
RemoteExporter | Abstract base class for classes that export a remote service.
RemoteInvocation | Encapsulates a remote invocation, providing core method invocation properties in a serializable fashion.
RemoteInvocationBasedAccessor | Abstract base class for remote service accessors that are based on serialization of RemoteInvocation objects.
RemoteInvocationBasedExporter | Abstract base class for remote service exporters that are based on deserialization of RemoteInvocation objects.
RemoteInvocationResult | Encapsulates a remote invocation result, holding a result value or an exception.
RemoteInvocationTraceInterceptor | AOP Alliance MethodInterceptor for tracing remote invocations.
RemoteInvocationUtils | General utilities for handling remote invocations.
RemotingSupport | Generic support base class for remote accessor and exporters, providing common bean ClassLoader handling.
SimpleHttpServerFactoryBean | FactoryBean that creates a simple HTTP server, based on the HTTP server that is included in Sun's JRE 1.6.
UrlBasedRemoteAccessor | Abstract base class for classes that access remote services via URLs.

Package org.springframework.remoting.support Description

Generic support classes for remoting implementations. Provides abstract base classes for remote proxy factories.


org.springframework.remoting.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.remoting.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.remoting.support.DefaultRemoteInvocationExecutor (implements org.springframework.remoting.support.RemoteInvocationExecutor)
    • org.springframework.remoting.support.DefaultRemoteInvocationFactory (implements org.springframework.remoting.support.RemoteInvocationFactory)
    • org.springframework.remoting.support.RemoteInvocation (implements java.io.Serializable)
    • org.springframework.remoting.support.RemoteInvocationResult (implements java.io.Serializable)
    • org.springframework.remoting.support.RemoteInvocationTraceInterceptor (implements org.aopalliance.intercept.MethodInterceptor)
    • org.springframework.remoting.support.RemoteInvocationUtils
    • org.springframework.remoting.support.RemotingSupport (implements org.springframework.beans.factory.BeanClassLoaderAware)
      • org.springframework.remoting.support.RemoteAccessor
        • org.springframework.remoting.support.UrlBasedRemoteAccessor (implements org.springframework.beans.factory.InitializingBean)
          • org.springframework.remoting.support.RemoteInvocationBasedAccessor
      • org.springframework.remoting.support.RemoteExporter
        • org.springframework.remoting.support.RemoteInvocationBasedExporter
    • org.springframework.remoting.support.SimpleHttpServerFactoryBean (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)

Interface Hierarchy

  • org.springframework.remoting.support.RemoteInvocationExecutor
  • org.springframework.remoting.support.RemoteInvocationFactory


RemoteInvocationExecutor

org.springframework.remoting.support
Interface RemoteInvocationExecutor

All Known Implementing Classes:
DefaultRemoteInvocationExecutor
public interface RemoteInvocationExecutor

Strategy interface for executing a RemoteInvocation on a target object.

Used by RmiServiceExporter (for RMI invokers) and by HttpInvokerServiceExporter.

Since:
1.1
Author:
Juergen Hoeller
See Also:
DefaultRemoteInvocationFactory, RemoteInvocationBasedExporter.setRemoteInvocationExecutor(org.springframework.remoting.support.RemoteInvocationExecutor), RemoteInvocationBasedExporter.setRemoteInvocationExecutor(org.springframework.remoting.support.RemoteInvocationExecutor)

Method Summary
 Object invoke(RemoteInvocation invocation, Object targetObject)
Perform this invocation on the given target object.

Method Detail

invoke

Object invoke(RemoteInvocation invocation,
              Object targetObject)
              throws NoSuchMethodException,
                     IllegalAccessException,
                     InvocationTargetException
Perform this invocation on the given target object. Typically called when a RemoteInvocation is received on the server.

Parameters:
invocation - the RemoteInvocation
targetObject - the target object to apply the invocation to
Returns:
the invocation result
Throws:
NoSuchMethodException - if the method name could not be resolved
IllegalAccessException - if the method could not be accessed
InvocationTargetException - if the method invocation resulted in an exception
See Also:
Method.invoke(java.lang.Object, java.lang.Object...)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RemoteInvocationFactory

org.springframework.remoting.support
Interface RemoteInvocationFactory

All Known Implementing Classes:
DefaultRemoteInvocationFactory
public interface RemoteInvocationFactory

Strategy interface for creating a RemoteInvocation from an AOP Alliance MethodInvocation.

Used by RmiClientInterceptor (for RMI invokers) and by HttpInvokerClientInterceptor.

Since:
1.1
Author:
Juergen Hoeller
See Also:
DefaultRemoteInvocationFactory, RemoteInvocationBasedAccessor.setRemoteInvocationFactory(org.springframework.remoting.support.RemoteInvocationFactory), RemoteInvocationBasedAccessor.setRemoteInvocationFactory(org.springframework.remoting.support.RemoteInvocationFactory)

Method Summary
 RemoteInvocation createRemoteInvocation(MethodInvocation methodInvocation)
Create a serializable RemoteInvocation object from the given AOP MethodInvocation.

Method Detail

createRemoteInvocation

RemoteInvocation createRemoteInvocation(MethodInvocation methodInvocation)
Create a serializable RemoteInvocation object from the given AOP MethodInvocation.

Can be implemented to add custom context information to the remote invocation, for example user credentials.

Parameters:
methodInvocation - the original AOP MethodInvocation object
Returns:
the RemoteInvocation object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultRemoteInvocationExecutor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.remoting.support
Class DefaultRemoteInvocationExecutor

java.lang.Object
    extended by  org.springframework.remoting.support.DefaultRemoteInvocationExecutor
All Implemented Interfaces:
RemoteInvocationExecutor
public class DefaultRemoteInvocationExecutor
extends Object
implements RemoteInvocationExecutor

Default implementation of the RemoteInvocationExecutor interface. Simply delegates to RemoteInvocation's invoke method.

Since:
1.1
Author:
Juergen Hoeller
See Also:
RemoteInvocation.invoke(java.lang.Object)

Constructor Summary
DefaultRemoteInvocationExecutor()
Method Summary
 Object invoke(RemoteInvocation invocation, Object targetObject)
Perform this invocation on the given target object.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DefaultRemoteInvocationExecutor

public DefaultRemoteInvocationExecutor()
Method Detail

invoke

public Object invoke(RemoteInvocation invocation,
                     Object targetObject)
              throws NoSuchMethodException,
                     IllegalAccessException,
                     InvocationTargetException
Description copied from interface: RemoteInvocationExecutor
Perform this invocation on the given target object. Typically called when a RemoteInvocation is received on the server.

Specified by:
invoke in interface RemoteInvocationExecutor
Parameters:
invocation - the RemoteInvocation
targetObject - the target object to apply the invocation to
Returns:
the invocation result
Throws:
NoSuchMethodException - if the method name could not be resolved
IllegalAccessException - if the method could not be accessed
InvocationTargetException - if the method invocation resulted in an exception
See Also:
Method.invoke(java.lang.Object, java.lang.Object...)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


DefaultRemoteInvocationFactory

org.springframework.remoting.support
Class DefaultRemoteInvocationFactory

java.lang.Object
    extended by  org.springframework.remoting.support.DefaultRemoteInvocationFactory
All Implemented Interfaces:
RemoteInvocationFactory
public class DefaultRemoteInvocationFactory
extends Object
implements RemoteInvocationFactory

Default implementation of the RemoteInvocationFactory interface. Simply creates a new standard RemoteInvocation object.

Since:
1.1
Author:
Juergen Hoeller

Constructor Summary
DefaultRemoteInvocationFactory()
Method Summary
 RemoteInvocation createRemoteInvocation(MethodInvocation methodInvocation)
Create a serializable RemoteInvocation object from the given AOP MethodInvocation.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DefaultRemoteInvocationFactory

public DefaultRemoteInvocationFactory()
Method Detail

createRemoteInvocation

public RemoteInvocation createRemoteInvocation(MethodInvocation methodInvocation)
Description copied from interface: RemoteInvocationFactory
Create a serializable RemoteInvocation object from the given AOP MethodInvocation.

Can be implemented to add custom context information to the remote invocation, for example user credentials.

Specified by:
createRemoteInvocation in interface RemoteInvocationFactory
Parameters:
methodInvocation - the original AOP MethodInvocation object
Returns:
the RemoteInvocation object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RemoteAccessor

org.springframework.remoting.support
Class RemoteAccessor

java.lang.Object
    extended by  org.springframework.remoting.support.RemotingSupport
        extended by  org.springframework.remoting.support.RemoteAccessor
All Implemented Interfaces:
BeanClassLoaderAware
Direct Known Subclasses:
UrlBasedRemoteAccessor
public abstract class RemoteAccessor
extends RemotingSupport

Abstract base class for classes that access a remote service. Provides a "serviceInterface" bean property.

Note that the service interface being used will show some signs of remotability, like the granularity of method calls that it offers. Furthermore, it has to have serializable arguments etc.

Accessors are supposed to throw Spring's generic RemoteAccessException in case of remote invocation failure, provided that the service interface does not declare java.rmi.RemoteException.

Since:
13.05.2003
Author:
Juergen Hoeller
See Also:
RemoteAccessException, RemoteException

Field Summary
Fields inherited from class org.springframework.remoting.support.RemotingSupport
logger
Constructor Summary
RemoteAccessor()
Method Summary
Class | getServiceInterface() Return the interface of the service to access.
void | setServiceInterface(Class serviceInterface) Set the interface of the service to access.
Methods inherited from class org.springframework.remoting.support.RemotingSupport
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

RemoteAccessor

public RemoteAccessor()
Method Detail

setServiceInterface

public void setServiceInterface(Class serviceInterface)
Set the interface of the service to access. The interface must be suitable for the particular service and remoting strategy.

Typically required to be able to create a suitable service proxy, but can also be optional if the lookup returns a typed proxy.

getServiceInterface

public Class getServiceInterface()
Return the interface of the service to access.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RemoteExporter

org.springframework.remoting.support
Class RemoteExporter

java.lang.Object
    extended by  org.springframework.remoting.support.RemotingSupport
        extended by  org.springframework.remoting.support.RemoteExporter
All Implemented Interfaces:
BeanClassLoaderAware
Direct Known Subclasses:
BurlapExporter, HessianExporter, RemoteInvocationBasedExporter
public abstract class RemoteExporter
extends RemotingSupport

Abstract base class for classes that export a remote service. Provides "service" and "serviceInterface" bean properties.

Note that the service interface being used will show some signs of remotability, like the granularity of method calls that it offers. Furthermore, it has to have serializable arguments etc.

Since:
26.12.2003
Author:
Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.remoting.support.RemotingSupport
logger
Constructor Summary
RemoteExporter()
Method Summary
protected void | checkService() Check whether the service reference has been set.
protected void | checkServiceInterface() Check whether a service reference has been set, and whether it matches the specified service.
protected String | getExporterName() Return a short name for this exporter.
protected Object | getProxyForService() Get a proxy for the given service object, implementing the specified service interface.
Object | getService() Return the service to export.
Class | getServiceInterface() Return the interface of the service to export.
void | setInterceptors(Object[] interceptors) Set additional interceptors (or advisors) to be applied before the remote endpoint, e.g.
void | setRegisterTraceInterceptor(boolean registerTraceInterceptor) Set whether to register a RemoteInvocationTraceInterceptor for exported services.
void | setService(Object service) Set the service to export.
void | setServiceInterface(Class serviceInterface) Set the interface of the service to export.
Methods inherited from class org.springframework.remoting.support.RemotingSupport
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

RemoteExporter

public RemoteExporter()
Method Detail

setService

public void setService(Object service)
Set the service to export. Typically populated via a bean reference.

getService

public Object getService()
Return the service to export.

setServiceInterface

public void setServiceInterface(Class serviceInterface)
Set the interface of the service to export. The interface must be suitable for the particular service and remoting strategy.

getServiceInterface

public Class getServiceInterface()
Return the interface of the service to export.

setRegisterTraceInterceptor

public void setRegisterTraceInterceptor(boolean registerTraceInterceptor)
Set whether to register a RemoteInvocationTraceInterceptor for exported services. Only applied when a subclass uses getProxyForService for creating the proxy to expose.

Default is "true". RemoteInvocationTraceInterceptor's most important value is that it logs exception stacktraces on the server, before propagating an exception to the client. Note that RemoteInvocationTraceInterceptor will not be registered by default if the "interceptors" property has been specified.

See Also:
setInterceptors(java.lang.Object[]), getProxyForService(), RemoteInvocationTraceInterceptor

setInterceptors

public void setInterceptors(Object[] interceptors)
Set additional interceptors (or advisors) to be applied before the remote endpoint, e.g. a PerformanceMonitorInterceptor.

You may specify any AOP Alliance MethodInterceptors or other Spring AOP Advices, as well as Spring AOP Advisors.

See Also:
getProxyForService(), PerformanceMonitorInterceptor

checkService

protected void checkService()
                     throws IllegalArgumentException
Check whether the service reference has been set.

Throws:
IllegalArgumentException
See Also:
setService(java.lang.Object)

checkServiceInterface

protected void checkServiceInterface()
                              throws IllegalArgumentException
Check whether a service reference has been set, and whether it matches the specified service.

Throws:
IllegalArgumentException
See Also:
setServiceInterface(java.lang.Class), setService(java.lang.Object)

getProxyForService

protected Object getProxyForService()
Get a proxy for the given service object, implementing the specified service interface.

Used to export a proxy that does not expose any internals but just a specific interface intended for remote access. Furthermore, a RemoteInvocationTraceInterceptor will be registered (by default).

Returns:
the proxy
See Also:
setServiceInterface(java.lang.Class), setRegisterTraceInterceptor(boolean), RemoteInvocationTraceInterceptor

getExporterName

protected String getExporterName()
Return a short name for this exporter. Used for tracing of remote invocations.

Default is the unqualified class name (without package). Can be overridden in subclasses.

See Also:
getProxyForService(), RemoteInvocationTraceInterceptor, ClassUtils.getShortName(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RemoteInvocation

org.springframework.remoting.support
Class RemoteInvocation

java.lang.Object
    extended by  org.springframework.remoting.support.RemoteInvocation
All Implemented Interfaces:
Serializable
public class RemoteInvocation
extends Object
implements Serializable

Encapsulates a remote invocation, providing core method invocation properties in a serializable fashion. Used for RMI and HTTP-based serialization invokers.

This is an SPI class, typically not used directly by applications. Can be subclassed for additional invocation parameters.

Since:
25.02.2004
Author:
Juergen Hoeller
See Also:
RemoteInvocationResult, RemoteInvocationFactory, RemoteInvocationExecutor, RmiProxyFactoryBean, RmiServiceExporter, HttpInvokerProxyFactoryBean, HttpInvokerServiceExporter, Serialized Form

Constructor Summary
RemoteInvocation()
Create a new RemoteInvocation for use as JavaBean.
RemoteInvocation(MethodInvocation methodInvocation)
Create a new RemoteInvocation for the given AOP method invocation.
RemoteInvocation(String methodName, Class[] parameterTypes, Object[] arguments)
Create a new RemoteInvocation for the given parameters.
Method Summary
void | addAttribute(String key, Serializable value) Add an additional invocation attribute.
Object[] | getArguments() Return the arguments for the target method call.
Serializable | getAttribute(String key) Retrieve the attribute for the given key, if any.
Map<String,Serializable> | getAttributes() Return the attributes Map.
String | getMethodName() Return the name of the target method.
Class[] | getParameterTypes() Return the parameter types of the target method.
Object | invoke(Object targetObject) Perform this invocation on the given target object.
void | setArguments(Object[] arguments) Set the arguments for the target method call.
void | setAttributes(Map<String,Serializable> attributes) Set the attributes Map.
void | setMethodName(String methodName) Set the name of the target method.
void | setParameterTypes(Class[] parameterTypes) Set the parameter types of the target method.
String | toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

RemoteInvocation

public RemoteInvocation()
Create a new RemoteInvocation for use as JavaBean.

RemoteInvocation

public RemoteInvocation(String methodName,
                        Class[] parameterTypes,
                        Object[] arguments)
Create a new RemoteInvocation for the given parameters.

Parameters:
methodName - the name of the method to invoke
parameterTypes - the parameter types of the method
arguments - the arguments for the invocation

RemoteInvocation

public RemoteInvocation(MethodInvocation methodInvocation)
Create a new RemoteInvocation for the given AOP method invocation.

Parameters:
methodInvocation - the AOP invocation to convert
Method Detail

setMethodName

public void setMethodName(String methodName)
Set the name of the target method.

getMethodName

public String getMethodName()
Return the name of the target method.

setParameterTypes

public void setParameterTypes(Class[] parameterTypes)
Set the parameter types of the target method.

getParameterTypes

public Class[] getParameterTypes()
Return the parameter types of the target method.

setArguments

public void setArguments(Object[] arguments)
Set the arguments for the target method call.

getArguments

public Object[] getArguments()
Return the arguments for the target method call.

addAttribute

public void addAttribute(String key,
                         Serializable value)
                  throws IllegalStateException
Add an additional invocation attribute. Useful to add additional invocation context without having to subclass RemoteInvocation.

Attribute keys have to be unique, and no overriding of existing attributes is allowed.

The implementation avoids to unnecessarily create the attributes Map, to minimize serialization size.

Parameters:
key - the attribute key
value - the attribute value
Throws:
IllegalStateException - if the key is already bound

getAttribute

public Serializable getAttribute(String key)
Retrieve the attribute for the given key, if any.

The implementation avoids to unnecessarily create the attributes Map, to minimize serialization size.

Parameters:
key - the attribute key
Returns:
the attribute value, or null if not defined

setAttributes

public void setAttributes(Map<String,Serializable> attributes)
Set the attributes Map. Only here for special purposes: Preferably, use addAttribute(java.lang.String, java.io.Serializable) and getAttribute(java.lang.String).

Parameters:
attributes - the attributes Map
See Also:
addAttribute(java.lang.String, java.io.Serializable), getAttribute(java.lang.String)

getAttributes

public Map<String,Serializable> getAttributes()
Return the attributes Map. Mainly here for debugging purposes: Preferably, use addAttribute(java.lang.String, java.io.Serializable) and getAttribute(java.lang.String).

Returns:
the attributes Map, or null if none created
See Also:
addAttribute(java.lang.String, java.io.Serializable), getAttribute(java.lang.String)

invoke

public Object invoke(Object targetObject)
              throws NoSuchMethodException,
                     IllegalAccessException,
                     InvocationTargetException
Perform this invocation on the given target object. Typically called when a RemoteInvocation is received on the server.

Parameters:
targetObject - the target object to apply the invocation to
Returns:
the invocation result
Throws:
NoSuchMethodException - if the method name could not be resolved
IllegalAccessException - if the method could not be accessed
InvocationTargetException - if the method invocation resulted in an exception
See Also:
Method.invoke(java.lang.Object, java.lang.Object...)

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RemoteInvocationBasedAccessor

org.springframework.remoting.support
Class RemoteInvocationBasedAccessor

java.lang.Object
    extended by  org.springframework.remoting.support.RemotingSupport
        extended by  org.springframework.remoting.support.RemoteAccessor
            extended by  org.springframework.remoting.support.UrlBasedRemoteAccessor
                extended by  org.springframework.remoting.support.RemoteInvocationBasedAccessor
All Implemented Interfaces:
BeanClassLoaderAware, InitializingBean
Direct Known Subclasses:
HttpInvokerClientInterceptor, RmiClientInterceptor
public abstract class RemoteInvocationBasedAccessor
extends UrlBasedRemoteAccessor

Abstract base class for remote service accessors that are based on serialization of RemoteInvocation objects. Provides a "remoteInvocationFactory" property, with a DefaultRemoteInvocationFactory as default strategy.

Since:
1.1
Author:
Juergen Hoeller
See Also:
setRemoteInvocationFactory(org.springframework.remoting.support.RemoteInvocationFactory), RemoteInvocation, RemoteInvocationFactory, DefaultRemoteInvocationFactory

Field Summary
Fields inherited from class org.springframework.remoting.support.RemotingSupport
logger
Constructor Summary
RemoteInvocationBasedAccessor()
Method Summary
protected RemoteInvocation | createRemoteInvocation(MethodInvocation methodInvocation) Create a new RemoteInvocation object for the given AOP method invocation.
RemoteInvocationFactory | getRemoteInvocationFactory() Return the RemoteInvocationFactory used by this accessor.
protected Object | recreateRemoteInvocationResult(RemoteInvocationResult result) Recreate the invocation result contained in the given RemoteInvocationResult object.
void | setRemoteInvocationFactory(RemoteInvocationFactory remoteInvocationFactory) Set the RemoteInvocationFactory to use for this accessor.
Methods inherited from class org.springframework.remoting.support.UrlBasedRemoteAccessor
afterPropertiesSet, getServiceUrl, setServiceUrl
Methods inherited from class org.springframework.remoting.support.RemoteAccessor
getServiceInterface, setServiceInterface
Methods inherited from class org.springframework.remoting.support.RemotingSupport
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

RemoteInvocationBasedAccessor

public RemoteInvocationBasedAccessor()
Method Detail

setRemoteInvocationFactory

public void setRemoteInvocationFactory(RemoteInvocationFactory remoteInvocationFactory)
Set the RemoteInvocationFactory to use for this accessor. Default is a DefaultRemoteInvocationFactory.

A custom invocation factory can add further context information to the invocation, for example user credentials.

getRemoteInvocationFactory

public RemoteInvocationFactory getRemoteInvocationFactory()
Return the RemoteInvocationFactory used by this accessor.

createRemoteInvocation

protected RemoteInvocation createRemoteInvocation(MethodInvocation methodInvocation)
Create a new RemoteInvocation object for the given AOP method invocation.

The default implementation delegates to the configured RemoteInvocationFactory. This can be overridden in subclasses in order to provide custom RemoteInvocation subclasses, containing additional invocation parameters (e.g. user credentials).

Note that it is preferable to build a custom RemoteInvocationFactory as a reusable strategy, instead of overriding this method.

Parameters:
methodInvocation - the current AOP method invocation
Returns:
the RemoteInvocation object
See Also:
RemoteInvocationFactory.createRemoteInvocation(org.aopalliance.intercept.MethodInvocation)

recreateRemoteInvocationResult

protected Object recreateRemoteInvocationResult(RemoteInvocationResult result)
                                         throws Throwable
Recreate the invocation result contained in the given RemoteInvocationResult object.

The default implementation calls the default recreate() method. This can be overridden in subclass to provide custom recreation, potentially processing the returned result object.

Parameters:
result - the RemoteInvocationResult to recreate
Returns:
a return value if the invocation result is a successful return
Throws:
Throwable - if the invocation result is an exception
See Also:
RemoteInvocationResult.recreate()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RemoteInvocationBasedExporter

org.springframework.remoting.support
Class RemoteInvocationBasedExporter

java.lang.Object
    extended by  org.springframework.remoting.support.RemotingSupport
        extended by  org.springframework.remoting.support.RemoteExporter
            extended by  org.springframework.remoting.support.RemoteInvocationBasedExporter
All Implemented Interfaces:
BeanClassLoaderAware
Direct Known Subclasses:
JmsInvokerServiceExporter, RemoteInvocationSerializingExporter, RmiBasedExporter
public abstract class RemoteInvocationBasedExporter
extends RemoteExporter

Abstract base class for remote service exporters that are based on deserialization of RemoteInvocation objects.

Provides a "remoteInvocationExecutor" property, with a DefaultRemoteInvocationExecutor as default strategy.

Since:
1.1
Author:
Juergen Hoeller
See Also:
RemoteInvocationExecutor, DefaultRemoteInvocationExecutor

Field Summary
Fields inherited from class org.springframework.remoting.support.RemotingSupport
logger
Constructor Summary
RemoteInvocationBasedExporter()
Method Summary
RemoteInvocationExecutor | getRemoteInvocationExecutor() Return the RemoteInvocationExecutor used by this exporter.
protected Object | invoke(RemoteInvocation invocation, Object targetObject) Apply the given remote invocation to the given target object.
protected RemoteInvocationResult | invokeAndCreateResult(RemoteInvocation invocation, Object targetObject) Apply the given remote invocation to the given target object, wrapping the invocation result in a serializable RemoteInvocationResult object.
void | setRemoteInvocationExecutor(RemoteInvocationExecutor remoteInvocationExecutor) Set the RemoteInvocationExecutor to use for this exporter.
Methods inherited from class org.springframework.remoting.support.RemoteExporter
checkService, checkServiceInterface, getExporterName, getProxyForService, getService, getServiceInterface, setInterceptors, setRegisterTraceInterceptor, setService, setServiceInterface
Methods inherited from class org.springframework.remoting.support.RemotingSupport
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

RemoteInvocationBasedExporter

public RemoteInvocationBasedExporter()
Method Detail

setRemoteInvocationExecutor

public void setRemoteInvocationExecutor(RemoteInvocationExecutor remoteInvocationExecutor)
Set the RemoteInvocationExecutor to use for this exporter. Default is a DefaultRemoteInvocationExecutor.

A custom invocation executor can extract further context information from the invocation, for example user credentials.

getRemoteInvocationExecutor

public RemoteInvocationExecutor getRemoteInvocationExecutor()
Return the RemoteInvocationExecutor used by this exporter.

invoke

protected Object invoke(RemoteInvocation invocation,
                        Object targetObject)
                 throws NoSuchMethodException,
                        IllegalAccessException,
                        InvocationTargetException
Apply the given remote invocation to the given target object. The default implementation delegates to the RemoteInvocationExecutor.

Can be overridden in subclasses for custom invocation behavior, possibly for applying additional invocation parameters from a custom RemoteInvocation subclass. Note that it is preferable to use a custom RemoteInvocationExecutor which is a reusable strategy.

Parameters:
invocation - the remote invocation
targetObject - the target object to apply the invocation to
Returns:
the invocation result
Throws:
NoSuchMethodException - if the method name could not be resolved
IllegalAccessException - if the method could not be accessed
InvocationTargetException - if the method invocation resulted in an exception
See Also:
RemoteInvocationExecutor.invoke(org.springframework.remoting.support.RemoteInvocation, java.lang.Object)

invokeAndCreateResult

protected RemoteInvocationResult invokeAndCreateResult(RemoteInvocation invocation,
                                                       Object targetObject)
Apply the given remote invocation to the given target object, wrapping the invocation result in a serializable RemoteInvocationResult object. The default implementation creates a plain RemoteInvocationResult.

Can be overridden in subclasses for custom invocation behavior, for example to return additional context information. Note that this is not covered by the RemoteInvocationExecutor strategy!

Parameters:
invocation - the remote invocation
targetObject - the target object to apply the invocation to
Returns:
the invocation result
See Also:
invoke(org.springframework.remoting.support.RemoteInvocation, java.lang.Object)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RemoteInvocationResult

org.springframework.remoting.support
Class RemoteInvocationResult

java.lang.Object
    extended by  org.springframework.remoting.support.RemoteInvocationResult
All Implemented Interfaces:
Serializable
public class RemoteInvocationResult
extends Object
implements Serializable

Encapsulates a remote invocation result, holding a result value or an exception. Used for HTTP-based serialization invokers.

This is an SPI class, typically not used directly by applications. Can be subclassed for additional invocation parameters.

Since:
1.1
Author:
Juergen Hoeller
See Also:
RemoteInvocation, Serialized Form

Constructor Summary
RemoteInvocationResult(Object value)
Create a new RemoteInvocationResult for the given result value.
RemoteInvocationResult(Throwable exception)
Create a new RemoteInvocationResult for the given exception.
Method Summary
Throwable | getException() Return the exception thrown by an unsuccessful invocation of the target method, if any.
Object | getValue() Return the result value returned by a successful invocation of the target method, if any.
boolean | hasException() Return whether this invocation result holds an exception.
boolean | hasInvocationTargetException() Return whether this invocation result holds an InvocationTargetException, thrown by an invocation of the target method itself.
Object | recreate() Recreate the invocation result, either returning the result value in case of a successful invocation of the target method, or rethrowing the exception thrown by the target method.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

RemoteInvocationResult

public RemoteInvocationResult(Object value)
Create a new RemoteInvocationResult for the given result value.

Parameters:
value - the result value returned by a successful invocation of the target method

RemoteInvocationResult

public RemoteInvocationResult(Throwable exception)
Create a new RemoteInvocationResult for the given exception.

Parameters:
exception - the exception thrown by an unsuccessful invocation of the target method
Method Detail

getValue

public Object getValue()
Return the result value returned by a successful invocation of the target method, if any.

See Also:
hasException()

getException

public Throwable getException()
Return the exception thrown by an unsuccessful invocation of the target method, if any.

See Also:
hasException()

hasException

public boolean hasException()
Return whether this invocation result holds an exception. If this returns false, the result value applies (even if null).

See Also:
getValue(), getException()

hasInvocationTargetException

public boolean hasInvocationTargetException()
Return whether this invocation result holds an InvocationTargetException, thrown by an invocation of the target method itself.

See Also:
hasException()

recreate

public Object recreate()
                throws Throwable
Recreate the invocation result, either returning the result value in case of a successful invocation of the target method, or rethrowing the exception thrown by the target method.

Returns:
the result value, if any
Throws:
Throwable - the exception, if any
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RemoteInvocationTraceInterceptor

org.springframework.remoting.support
Class RemoteInvocationTraceInterceptor

java.lang.Object
    extended by  org.springframework.remoting.support.RemoteInvocationTraceInterceptor
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor
public class RemoteInvocationTraceInterceptor
extends Object
implements MethodInterceptor

AOP Alliance MethodInterceptor for tracing remote invocations. Automatically applied by RemoteExporter and its subclasses.

Logs an incoming remote call as well as the finished processing of a remote call at DEBUG level. If the processing of a remote call results in a checked exception, the exception will get logged at INFO level; if it results in an unchecked exception (or error), the exception will get logged at WARN level.

The logging of exceptions is particularly useful to save the stacktrace information on the server-side rather than just propagating the exception to the client (who might or might not log it properly).

Since:
1.2
Author:
Juergen Hoeller
See Also:
RemoteExporter.setRegisterTraceInterceptor(boolean), RemoteExporter.getProxyForService()

Field Summary
protected static Log logger
Constructor Summary
RemoteInvocationTraceInterceptor()
Create a new RemoteInvocationTraceInterceptor.
RemoteInvocationTraceInterceptor(String exporterName)
Create a new RemoteInvocationTraceInterceptor.
Method Summary
 Object invoke(MethodInvocation invocation)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected static final Log logger
Constructor Detail

RemoteInvocationTraceInterceptor

public RemoteInvocationTraceInterceptor()
Create a new RemoteInvocationTraceInterceptor.

RemoteInvocationTraceInterceptor

public RemoteInvocationTraceInterceptor(String exporterName)
Create a new RemoteInvocationTraceInterceptor.

Parameters:
exporterName - the name of the remote exporter (to be used as context information in log messages)
Method Detail

invoke

public Object invoke(MethodInvocation invocation)
              throws Throwable
Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RemoteInvocationUtils

org.springframework.remoting.support
Class RemoteInvocationUtils

java.lang.Object
    extended by  org.springframework.remoting.support.RemoteInvocationUtils

public abstract class RemoteInvocationUtils
extends Object

General utilities for handling remote invocations.

Mainly intended for use within the remoting framework.

Since:
2.0
Author:
Juergen Hoeller

Constructor Summary
RemoteInvocationUtils()
Method Summary
static void fillInClientStackTraceIfPossible(Throwable ex)
Fill the current client-side stack trace into the given exception.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

RemoteInvocationUtils

public RemoteInvocationUtils()
Method Detail

fillInClientStackTraceIfPossible

public static void fillInClientStackTraceIfPossible(Throwable ex)
Fill the current client-side stack trace into the given exception.

The given exception is typically thrown on the server and serialized as-is, with the client wanting it to contain the client-side portion of the stack trace as well. What we can do here is to update the StackTraceElement array with the current client-side stack trace, provided that we run on JDK 1.4+.

Parameters:
ex - the exception to update
See Also:
Throwable.getStackTrace(), Throwable.setStackTrace(StackTraceElement[])
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RemotingSupport

org.springframework.remoting.support
Class RemotingSupport

java.lang.Object
    extended by  org.springframework.remoting.support.RemotingSupport
All Implemented Interfaces:
BeanClassLoaderAware
Direct Known Subclasses:
RemoteAccessor, RemoteExporter
public abstract class RemotingSupport
extends Object
implements BeanClassLoaderAware

Generic support base class for remote accessor and exporters, providing common bean ClassLoader handling.

Since:
2.5.2
Author:
Juergen Hoeller

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
RemotingSupport()
Method Summary
protected ClassLoader | getBeanClassLoader() Return the ClassLoader that this accessor operates in, to be used for deserializing and for generating proxies.
protected ClassLoader | overrideThreadContextClassLoader() Override the thread context ClassLoader with the environment's bean ClassLoader if necessary, i.e.
protected void | resetThreadContextClassLoader(ClassLoader original) Reset the original thread context ClassLoader if necessary.
void | setBeanClassLoader(ClassLoader classLoader) Callback that supplies the bean class loader to a bean instance.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

RemotingSupport

public RemotingSupport()
Method Detail

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

getBeanClassLoader

protected ClassLoader getBeanClassLoader()
Return the ClassLoader that this accessor operates in, to be used for deserializing and for generating proxies.

overrideThreadContextClassLoader

protected ClassLoader overrideThreadContextClassLoader()
Override the thread context ClassLoader with the environment's bean ClassLoader if necessary, i.e. if the bean ClassLoader is not equivalent to the thread context ClassLoader already.

Returns:
the original thread context ClassLoader, or null if not overridden

resetThreadContextClassLoader

protected void resetThreadContextClassLoader(ClassLoader original)
Reset the original thread context ClassLoader if necessary.

Parameters:
original - the original thread context ClassLoader, or null if not overridden (and hence nothing to reset)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleHttpServerFactoryBean

org.springframework.remoting.support
Class SimpleHttpServerFactoryBean

java.lang.Object
    extended by  org.springframework.remoting.support.SimpleHttpServerFactoryBean
All Implemented Interfaces:
DisposableBean, FactoryBean<HttpServer>, InitializingBean
public class SimpleHttpServerFactoryBean
extends Object
implements FactoryBean<HttpServer>, InitializingBean, DisposableBean

FactoryBean that creates a simple HTTP server, based on the HTTP server that is included in Sun's JRE 1.6. Starts the HTTP server on initialization and stops it on destruction. Exposes the resulting HttpServer object.

Allows for registering HttpHandlers for specific context paths. Alternatively, register such context-specific handlers programmatically on the HttpServer itself.

Since:
2.5.1
Author:
Juergen Hoeller, Arjen Poutsma
See Also:
setPort(int), setContexts(java.util.Map)

Field Summary
protected  Log logger
Constructor Summary
SimpleHttpServerFactoryBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 void destroy()
Invoked by a BeanFactory on destruction of a singleton.
 HttpServer getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<? extends HttpServer> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setAuthenticator(Authenticator authenticator)
Register a common Authenticator to be applied to all locally registered contexts.
 void setBacklog(int backlog)
Specify the HTTP server's TCP backlog.
 void setContexts(Map<String,HttpHandler> contexts)
Register HttpHandlers for specific context paths.
 void setExecutor(Executor executor)
Set the JDK concurrent executor to use for dispatching incoming requests.
 void setFilters(List<Filter> filters)
Register common Filters to be applied to all locally registered contexts.
 void setHostname(String hostname)
Specify the HTTP server's hostname to bind to.
 void setPort(int port)
Specify the HTTP server's port.
 void setShutdownDelay(int shutdownDelay)
Specify the number of seconds to wait until HTTP exchanges have completed when shutting down the HTTP server.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Constructor Detail

SimpleHttpServerFactoryBean

public SimpleHttpServerFactoryBean()
Method Detail

setPort

public void setPort(int port)
Specify the HTTP server's port. Default is 8080.

setHostname

public void setHostname(String hostname)
Specify the HTTP server's hostname to bind to. Default is localhost; can be overridden with a specific network address to bind to.

setBacklog

public void setBacklog(int backlog)
Specify the HTTP server's TCP backlog. Default is -1, indicating the system's default value.

setShutdownDelay

public void setShutdownDelay(int shutdownDelay)
Specify the number of seconds to wait until HTTP exchanges have completed when shutting down the HTTP server. Default is 0.

setExecutor

public void setExecutor(Executor executor)
Set the JDK concurrent executor to use for dispatching incoming requests.

See Also:
HttpServer.setExecutor(java.util.concurrent.Executor)

setContexts

public void setContexts(Map<String,HttpHandler> contexts)
Register HttpHandlers for specific context paths.

Parameters:
contexts - a Map with context paths as keys and HttpHandler objects as values
See Also:
SimpleHttpInvokerServiceExporter, SimpleHessianServiceExporter, SimpleBurlapServiceExporter

setFilters

public void setFilters(List<Filter> filters)
Register common Filters to be applied to all locally registered contexts.

setAuthenticator

public void setAuthenticator(Authenticator authenticator)
Register a common Authenticator to be applied to all locally registered contexts.

afterPropertiesSet

public void afterPropertiesSet()
                        throws IOException
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
IOException

getObject

public HttpServer getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<HttpServer>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends HttpServer> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<HttpServer>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<HttpServer>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()

destroy

public void destroy()
Description copied from interface: DisposableBean
Invoked by a BeanFactory on destruction of a singleton.

Specified by:
destroy in interface DisposableBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UrlBasedRemoteAccessor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.remoting.support
Class UrlBasedRemoteAccessor

java.lang.Object
    extended by  org.springframework.remoting.support.RemotingSupport
        extended by  org.springframework.remoting.support.RemoteAccessor
            extended by  org.springframework.remoting.support.UrlBasedRemoteAccessor
All Implemented Interfaces:
BeanClassLoaderAware, InitializingBean
Direct Known Subclasses:
BurlapClientInterceptor, HessianClientInterceptor, RemoteInvocationBasedAccessor
public abstract class UrlBasedRemoteAccessor
extends RemoteAccessor
implements InitializingBean

Abstract base class for classes that access remote services via URLs. Provides a "serviceUrl" bean property, which is considered as required.

Since:
15.12.2003
Author:
Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.remoting.support.RemotingSupport
logger
Constructor Summary
UrlBasedRemoteAccessor()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
String | getServiceUrl() Return the URL of this remote accessor's target service.
void | setServiceUrl(String serviceUrl) Set the URL of this remote accessor's target service.
Methods inherited from class org.springframework.remoting.support.RemoteAccessor
getServiceInterface, setServiceInterface
Methods inherited from class org.springframework.remoting.support.RemotingSupport
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

UrlBasedRemoteAccessor

public UrlBasedRemoteAccessor()
Method Detail

setServiceUrl

public void setServiceUrl(String serviceUrl)
Set the URL of this remote accessor's target service. The URL must be compatible with the rules of the particular remoting provider.

getServiceUrl

public String getServiceUrl()
Return the URL of this remote accessor's target service.

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.scheduling

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.scheduling

General exceptions for Spring's scheduling support, independent of any specific scheduling system.

See:
Description

Interface Summary
SchedulingAwareRunnable | Extension of the Runnable interface, adding special callbacks for long-running operations.
SchedulingTaskExecutor | A TaskExecutor extension exposing scheduling characteristics that are relevant to potential task submitters.
TaskScheduler | Task scheduler interface that abstracts the scheduling of Runnables based on different kinds of triggers.
Trigger | Common interface for trigger objects that determine the next execution time of a task that they get associated with.
TriggerContext | Context object encapsulating last execution times and last completion time of a given task.

Exception Summary
SchedulingException General exception to be thrown on scheduling failures, such as the scheduler already having shut down.

Package org.springframework.scheduling Description

General exceptions for Spring's scheduling support, independent of any specific scheduling system.


org.springframework.scheduling Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.scheduling

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.scheduling.SchedulingException

Interface Hierarchy

  • java.util.concurrent.Executor
    • org.springframework.core.task.TaskExecutor
      • org.springframework.core.task.AsyncTaskExecutor
        • org.springframework.scheduling.SchedulingTaskExecutor
  • java.lang.Runnable
    • org.springframework.scheduling.SchedulingAwareRunnable
  • org.springframework.scheduling.TaskScheduler
  • org.springframework.scheduling.Trigger
  • org.springframework.scheduling.TriggerContext


SchedulingAwareRunnable

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.scheduling
Interface SchedulingAwareRunnable

All Superinterfaces:
Runnable
public interface SchedulingAwareRunnable
extends Runnable

Extension of the Runnable interface, adding special callbacks for long-running operations.

This interface closely corresponds to the CommonJ Work interface, but is kept separate to avoid a required CommonJ dependency.

Scheduling-capable TaskExecutors are encouraged to check a submitted Runnable, detecting whether this interface is implemented and reacting as appropriately as they are able to.

Since:
2.0
Author:
Juergen Hoeller
See Also:
Work, TaskExecutor, SchedulingTaskExecutor, WorkManagerTaskExecutor

Method Summary
 boolean isLongLived()
Return whether the Runnable's operation is long-lived (true) versus short-lived (false).
Methods inherited from interface java.lang.Runnable
run

Method Detail

isLongLived

boolean isLongLived()
Return whether the Runnable's operation is long-lived (true) versus short-lived (false).

In the former case, the task will not allocate a thread from the thread pool (if any) but rather be considered as long-running background thread.

This should be considered a hint. Of course TaskExecutor implementations are free to ignore this flag and the SchedulingAwareRunnable interface overall.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


SchedulingTaskExecutor

org.springframework.scheduling
Interface SchedulingTaskExecutor

All Superinterfaces:
AsyncTaskExecutor, Executor, TaskExecutor
All Known Implementing Classes:
ConcurrentTaskExecutor, ConcurrentTaskExecutor, ConcurrentTaskScheduler, GlassFishWorkManagerTaskExecutor, JBossWorkManagerTaskExecutor, SimpleThreadPoolTaskExecutor, ThreadPoolTaskExecutor, ThreadPoolTaskExecutor, ThreadPoolTaskScheduler, TimerTaskExecutor, WorkManagerTaskExecutor, WorkManagerTaskExecutor
public interface SchedulingTaskExecutor
extends AsyncTaskExecutor

A TaskExecutor extension exposing scheduling characteristics that are relevant to potential task submitters.

Scheduling clients are encouraged to submit Runnables that match the exposed preferences of the TaskExecutor implementation in use.

Since:
2.0
Author:
Juergen Hoeller
See Also:
SchedulingAwareRunnable, TaskExecutor, WorkManagerTaskExecutor

Field Summary
Fields inherited from interface org.springframework.core.task.AsyncTaskExecutor
TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE
Method Summary
 boolean prefersShortLivedTasks()
Does this TaskExecutor prefer short-lived tasks over long-lived tasks?
Methods inherited from interface org.springframework.core.task.AsyncTaskExecutor
execute, submit, submit
Methods inherited from interface org.springframework.core.task.TaskExecutor
execute

Method Detail

prefersShortLivedTasks

boolean prefersShortLivedTasks()
Does this TaskExecutor prefer short-lived tasks over long-lived tasks?

A SchedulingTaskExecutor implementation can indicate whether it prefers submitted tasks to perform as little work as they can within a single task execution. For example, submitted tasks might break a repeated loop into individual subtasks which submit a follow-up task afterwards (if feasible).

This should be considered a hint. Of course TaskExecutor clients are free to ignore this flag and hence the SchedulingTaskExecutor interface overall. However, thread pools will usually indicated a preference for short-lived tasks, to be able to perform more fine-grained scheduling.

Returns:
true if this TaskExecutor prefers short-lived tasks
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TaskScheduler

org.springframework.scheduling
Interface TaskScheduler

All Known Implementing Classes:
ConcurrentTaskScheduler, ThreadPoolTaskScheduler, TimerManagerTaskScheduler
public interface TaskScheduler

Task scheduler interface that abstracts the scheduling of Runnables based on different kinds of triggers.

This interface is separate from SchedulingTaskExecutor since it usually represents for a different kind of backend, i.e. a thread pool with different characteristics and capabilities. Implementations may implement both interfaces if they can handle both kinds of execution characteristics.

The 'default' implementation is ThreadPoolTaskScheduler, wrapping a native ScheduledExecutorService and adding extended trigger capabilities.

This interface is roughly equivalent to a JSR-236 ManagedScheduledExecutorService as supported in Java EE 6 environments. However, at the time of the Spring 3.0 release, the JSR-236 interfaces have not been released in official form yet.

Since:
3.0
Author:
Juergen Hoeller
See Also:
TaskExecutor, ScheduledExecutorService, ThreadPoolTaskScheduler

Method Summary
ScheduledFuture | schedule(Runnable task, Date startTime) Schedule the given Runnable, invoking it at the specified execution time.
ScheduledFuture | schedule(Runnable task, Trigger trigger) Schedule the given Runnable, invoking it whenever the trigger indicates a next execution time.
ScheduledFuture | scheduleAtFixedRate(Runnable task, Date startTime, long period) Schedule the given Runnable, invoking it at the specified execution time and subsequently with the given period.
ScheduledFuture | scheduleAtFixedRate(Runnable task, long period) Schedule the given Runnable, starting as soon as possible and invoking it with the given period.
ScheduledFuture | scheduleWithFixedDelay(Runnable task, Date startTime, long delay) Schedule the given Runnable, invoking it at the specified execution time and subsequently with the given delay between the completion of one execution and the start of the next.
ScheduledFuture | scheduleWithFixedDelay(Runnable task, long delay) Schedule the given Runnable, starting as soon as possible and invoking it with the given delay between the completion of one execution and the start of the next.

Method Detail

schedule

ScheduledFuture schedule(Runnable task,
                         Trigger trigger)
Schedule the given Runnable, invoking it whenever the trigger indicates a next execution time.

Execution will end once the scheduler shuts down or the returned ScheduledFuture gets cancelled.

Parameters:
task - the Runnable to execute whenever the trigger fires
trigger - an implementation of the Trigger interface, e.g. a CronTrigger object wrapping a cron expression
Returns:
a ScheduledFuture representing pending completion of the task, or null if the given Trigger object never fires (i.e. returns null from Trigger.nextExecutionTime(org.springframework.scheduling.TriggerContext))
Throws:
TaskRejectedException - if the given task was not accepted
See Also:
CronTrigger

schedule

ScheduledFuture schedule(Runnable task,
                         Date startTime)
Schedule the given Runnable, invoking it at the specified execution time.

Execution will end once the scheduler shuts down or the returned ScheduledFuture gets cancelled.

Parameters:
task - the Runnable to execute whenever the trigger fires
startTime - the desired execution time for the task
Returns:
a ScheduledFuture representing pending completion of the task
Throws:
TaskRejectedException - if the given task was not accepted

scheduleAtFixedRate

ScheduledFuture scheduleAtFixedRate(Runnable task,
                                    Date startTime,
                                    long period)
Schedule the given Runnable, invoking it at the specified execution time and subsequently with the given period.

Execution will end once the scheduler shuts down or the returned ScheduledFuture gets cancelled.

Parameters:
task - the Runnable to execute whenever the trigger fires
startTime - the desired first execution time for the task
period - the interval between successive executions of the task
Returns:
a ScheduledFuture representing pending completion of the task
Throws:
TaskRejectedException - if the given task was not accepted

scheduleAtFixedRate

ScheduledFuture scheduleAtFixedRate(Runnable task,
                                    long period)
Schedule the given Runnable, starting as soon as possible and invoking it with the given period.

Execution will end once the scheduler shuts down or the returned ScheduledFuture gets cancelled.

Parameters:
task - the Runnable to execute whenever the trigger fires
period - the interval between successive executions of the task
Returns:
a ScheduledFuture representing pending completion of the task
Throws:
TaskRejectedException - if the given task was not accepted

scheduleWithFixedDelay

ScheduledFuture scheduleWithFixedDelay(Runnable task,
                                       Date startTime,
                                       long delay)
Schedule the given Runnable, invoking it at the specified execution time and subsequently with the given delay between the completion of one execution and the start of the next.

Execution will end once the scheduler shuts down or the returned ScheduledFuture gets cancelled.

Parameters:
task - the Runnable to execute whenever the trigger fires
startTime - the desired first execution time for the task
delay - the delay between the completion of one execution and the start of the next
Returns:
a ScheduledFuture representing pending completion of the task
Throws:
TaskRejectedException - if the given task was not accepted

scheduleWithFixedDelay

ScheduledFuture scheduleWithFixedDelay(Runnable task,
                                       long delay)
Schedule the given Runnable, starting as soon as possible and invoking it with the given delay between the completion of one execution and the start of the next.

Execution will end once the scheduler shuts down or the returned ScheduledFuture gets cancelled.

Parameters:
task - the Runnable to execute whenever the trigger fires
delay - the interval between successive executions of the task
Returns:
a ScheduledFuture representing pending completion of the task
Throws:
TaskRejectedException - if the given task was not accepted
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Trigger

org.springframework.scheduling
Interface Trigger

All Known Implementing Classes:
CronTrigger, PeriodicTrigger
public interface Trigger

Common interface for trigger objects that determine the next execution time of a task that they get associated with.

Since:
3.0
Author:
Juergen Hoeller
See Also:
TaskScheduler.schedule(Runnable, Trigger), CronTrigger

Method Summary
 Date nextExecutionTime(TriggerContext triggerContext)
Determine the next execution time according to the given trigger context.

Method Detail

nextExecutionTime

Date nextExecutionTime(TriggerContext triggerContext)
Determine the next execution time according to the given trigger context.

Parameters:
triggerContext - context object encapsulating last execution times and last completion time
Returns:
the next execution time as defined by the trigger, or null if the trigger won't fire anymore
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TriggerContext

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.scheduling
Interface TriggerContext

All Known Implementing Classes:
SimpleTriggerContext
public interface TriggerContext

Context object encapsulating last execution times and last completion time of a given task.

Since:
3.0
Author:
Juergen Hoeller

Method Summary
Date | lastActualExecutionTime() Return the last actual execution time of the task, or null if not scheduled before.
Date | lastCompletionTime() Return the last completion time of the task, or null if not scheduled before.
Date | lastScheduledExecutionTime() Return the last scheduled execution time of the task, or null if not scheduled before.

Method Detail

lastScheduledExecutionTime

Date lastScheduledExecutionTime()
Return the last scheduled execution time of the task, or null if not scheduled before.

lastActualExecutionTime

Date lastActualExecutionTime()
Return the last actual execution time of the task, or null if not scheduled before.

lastCompletionTime

Date lastCompletionTime()
Return the last completion time of the task, or null if not scheduled before.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


SchedulingException

org.springframework.scheduling
Class SchedulingException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.scheduling.SchedulingException
All Implemented Interfaces:
Serializable
public class SchedulingException
extends NestedRuntimeException

General exception to be thrown on scheduling failures, such as the scheduler already having shut down. Unchecked since scheduling failures are usually fatal.

Since:
2.0
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
SchedulingException(String msg)
Constructor for SchedulingException.
SchedulingException(String msg, Throwable cause)
Constructor for SchedulingException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

SchedulingException

public SchedulingException(String msg)
Constructor for SchedulingException.

Parameters:
msg - the detail message

SchedulingException

public SchedulingException(String msg,
                           Throwable cause)
Constructor for SchedulingException.

Parameters:
msg - the detail message
cause - the root cause (usually from using a underlying scheduling API such as Quartz)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.scheduling.annotation

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.scheduling.annotation

JDK 1.5+ annotation for asynchronous method execution.

See:
Description

Class Summary
AsyncAnnotationAdvisor | Advisor that activates asynchronous method execution through the Async annotation.
AsyncAnnotationBeanPostProcessor | Bean post-processor that automatically applies asynchronous invocation behavior to any bean that carries the Async annotation at class or method-level by adding a corresponding AsyncAnnotationAdvisor to the exposed proxy (either an existing AOP proxy or a newly generated proxy that implements all of the target's interfaces).
AsyncResult<V> | A pass-through Future handle that can be used for method signatures which are declared with a Future return type for asynchronous execution.
ScheduledAnnotationBeanPostProcessor | Bean post-processor that registers methods annotated with @Scheduled to be invoked by a TaskScheduler according to the "fixedRate", "fixedDelay", or "cron" expression provided via the annotation.

Annotation Types Summary
Async | Annotation that marks a method as a candidate for asynchronous execution.
Scheduled | Annotation that marks a method to be scheduled.

Package org.springframework.scheduling.annotation Description

JDK 1.5+ annotation for asynchronous method execution.


org.springframework.scheduling.annotation Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.scheduling.annotation

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.aop.support.AbstractPointcutAdvisor (implements org.springframework.core.Ordered, org.springframework.aop.PointcutAdvisor, java.io.Serializable)
      • org.springframework.scheduling.annotation.AsyncAnnotationAdvisor
    • org.springframework.scheduling.annotation.AsyncResult<V> (implements java.util.concurrent.Future<V>)
    • org.springframework.aop.framework.ProxyConfig (implements java.io.Serializable)
      • org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcessor (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.beans.factory.InitializingBean, org.springframework.core.Ordered)
    • org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor (implements org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener<E>, org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.beans.factory.DisposableBean, org.springframework.core.Ordered)

Annotation Type Hierarchy

  • org.springframework.scheduling.annotation.Scheduled (implements java.lang.annotation.Annotation)
  • org.springframework.scheduling.annotation.Async (implements java.lang.annotation.Annotation)


AsyncAnnotationAdvisor

org.springframework.scheduling.annotation
Class AsyncAnnotationAdvisor

java.lang.Object
    extended by  org.springframework.aop.support.AbstractPointcutAdvisor
        extended by  org.springframework.scheduling.annotation.AsyncAnnotationAdvisor
All Implemented Interfaces:
Serializable, Advisor, PointcutAdvisor, Ordered
public class AsyncAnnotationAdvisor
extends AbstractPointcutAdvisor

Advisor that activates asynchronous method execution through the Async annotation. This annotation can be used at the method and type level in implementation classes as well as in service interfaces.

This advisor detects the EJB 3.1 javax.ejb.Asynchronous annotation as well, treating it exactly like Spring's own Async. Furthermore, a custom async annotation type may get specified through the "asyncAnnotationType" property.

Since:
3.0
Author:
Juergen Hoeller
See Also:
PersistenceExceptionTranslationAdvisor, Repository, DataAccessException, PersistenceExceptionTranslator, Serialized Form

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AsyncAnnotationAdvisor()
Create a new ConcurrencyAnnotationBeanPostProcessor for bean-style configuration.
AsyncAnnotationAdvisor(Executor executor)
Create a new ConcurrencyAnnotationBeanPostProcessor for the given task executor.
Method Summary
protected Advice | buildAdvice(Executor executor)
protected Pointcut | buildPointcut(Set<Class<? extends Annotation>> asyncAnnotationTypes) Calculate a pointcut for the given target class, if any.
Advice | getAdvice() Return the advice part of this aspect.
Pointcut | getPointcut() Get the Pointcut that drives this advisor.
void | setAsyncAnnotationType(Class<? extends Annotation> asyncAnnotationType) Set the 'async' annotation type.
void | setTaskExecutor(Executor executor) Specify the task executor to use for asynchronous methods.
Methods inherited from class org.springframework.aop.support.AbstractPointcutAdvisor
equals, getOrder, hashCode, isPerInstance, setOrder
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AsyncAnnotationAdvisor

public AsyncAnnotationAdvisor()
Create a new ConcurrencyAnnotationBeanPostProcessor for bean-style configuration.

AsyncAnnotationAdvisor

public AsyncAnnotationAdvisor(Executor executor)
Create a new ConcurrencyAnnotationBeanPostProcessor for the given task executor.

Parameters:
executor - the task executor to use for asynchronous methods
Method Detail

setTaskExecutor

public void setTaskExecutor(Executor executor)
Specify the task executor to use for asynchronous methods.

setAsyncAnnotationType

public void setAsyncAnnotationType(Class<? extends Annotation> asyncAnnotationType)
Set the 'async' annotation type.

The default async annotation type is the Async annotation, as well as the EJB 3.1 javax.ejb.Asynchronous annotation (if present).

This setter property exists so that developers can provide their own (non-Spring-specific) annotation type to indicate that a method is to be executed asynchronously.

Parameters:
asyncAnnotationType - the desired annotation type

getAdvice

public Advice getAdvice()
Description copied from interface: Advisor
Return the advice part of this aspect. An advice may be an interceptor, a before advice, a throws advice, etc.

Returns:
the advice that should apply if the pointcut matches
See Also:
MethodInterceptor, BeforeAdvice, ThrowsAdvice, AfterReturningAdvice

getPointcut

public Pointcut getPointcut()
Description copied from interface: PointcutAdvisor
Get the Pointcut that drives this advisor.

buildAdvice

protected Advice buildAdvice(Executor executor)

buildPointcut

protected Pointcut buildPointcut(Set<Class<? extends Annotation>> asyncAnnotationTypes)
Calculate a pointcut for the given target class, if any.

Parameters:
targetClass - the class to introspect
Returns:
the applicable Pointcut object, or null if none
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AsyncAnnotationBeanPostProcessor

org.springframework.scheduling.annotation
Class AsyncAnnotationBeanPostProcessor

java.lang.Object
    extended by  org.springframework.aop.framework.ProxyConfig
        extended by  org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcessor
All Implemented Interfaces:
Serializable, BeanClassLoaderAware, BeanPostProcessor, InitializingBean, Ordered
public class AsyncAnnotationBeanPostProcessor
extends ProxyConfig
implements BeanPostProcessor, BeanClassLoaderAware, InitializingBean, Ordered

Bean post-processor that automatically applies asynchronous invocation behavior to any bean that carries the Async annotation at class or method-level by adding a corresponding AsyncAnnotationAdvisor to the exposed proxy (either an existing AOP proxy or a newly generated proxy that implements all of the target's interfaces).

The TaskExecutor responsible for the asynchronous execution may be provided as well as the annotation type that indicates a method should be invoked asynchronously. If no annotation type is specified, this post- processor will detect both Spring's @Async annotation as well as the EJB 3.1 javax.ejb.Asynchronous annotation.

Since:
3.0
Author:
Mark Fisher, Juergen Hoeller
See Also:
Async, AsyncAnnotationAdvisor, Serialized Form

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AsyncAnnotationBeanPostProcessor()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
Object | postProcessAfterInitialization(Object bean, String beanName) Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).
Object | postProcessBeforeInitialization(Object bean, String beanName) Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).
void | setAsyncAnnotationType(Class<? extends Annotation> asyncAnnotationType) Set the 'async' annotation type to be detected at either class or method level.
void | setBeanClassLoader(ClassLoader classLoader) Callback that supplies the bean class loader to a bean instance.
void | setExecutor(Executor executor) Set the Executor to use when invoking methods asynchronously.
Methods inherited from class org.springframework.aop.framework.ProxyConfig
copyFrom, isExposeProxy, isFrozen, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setFrozen, setOpaque, setOptimize, setProxyTargetClass, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AsyncAnnotationBeanPostProcessor

public AsyncAnnotationBeanPostProcessor()
Method Detail

setAsyncAnnotationType

public void setAsyncAnnotationType(Class<? extends Annotation> asyncAnnotationType)
Set the 'async' annotation type to be detected at either class or method level. By default, both the Async annotation and the EJB 3.1 javax.ejb.Asynchronous annotation will be detected.

This setter property exists so that developers can provide their own (non-Spring-specific) annotation type to indicate that a method (or all methods of a given class) should be invoked asynchronously.

Parameters:
asyncAnnotationType - the desired annotation type

setExecutor

public void setExecutor(Executor executor)
Set the Executor to use when invoking methods asynchronously.

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

postProcessBeforeInitialization

public Object postProcessBeforeInitialization(Object bean,
                                              String beanName)
Description copied from interface: BeanPostProcessor
Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

Specified by:
postProcessBeforeInitialization in interface BeanPostProcessor
Parameters:
bean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
See Also:
InitializingBean.afterPropertiesSet()

postProcessAfterInitialization

public Object postProcessAfterInitialization(Object bean,
                                             String beanName)
Description copied from interface: BeanPostProcessor
Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

In case of a FactoryBean, this callback will be invoked for both the FactoryBean instance and the objects created by the FactoryBean (as of Spring 2.0). The post-processor can decide whether to apply to either the FactoryBean or created objects or both through corresponding bean instanceof FactoryBean checks.

This callback will also be invoked after a short-circuiting triggered by a InstantiationAwareBeanPostProcessor.postProcessBeforeInstantiation(java.lang.Class, java.lang.String) method, in contrast to all other BeanPostProcessor callbacks.

Specified by:
postProcessAfterInitialization in interface BeanPostProcessor
Parameters:
bean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
See Also:
InitializingBean.afterPropertiesSet(), FactoryBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AsyncResult

org.springframework.scheduling.annotation
Class AsyncResult<V>

java.lang.Object
    extended by  org.springframework.scheduling.annotation.AsyncResult<V>
All Implemented Interfaces:
Future<V>
public class AsyncResult<V>
extends Object
implements Future<V>

A pass-through Future handle that can be used for method signatures which are declared with a Future return type for asynchronous execution.

Since:
3.0
Author:
Juergen Hoeller
See Also:
Async

Constructor Summary
AsyncResult(V value)
Create a new AsyncResult holder.
Method Summary
boolean | cancel(boolean mayInterruptIfRunning)
V | get()
V | get(long timeout, TimeUnit unit)
boolean | isCancelled()
boolean | isDone()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AsyncResult

public AsyncResult(V value)
Create a new AsyncResult holder.

Parameters:
value - the value to pass through
Method Detail

cancel

public boolean cancel(boolean mayInterruptIfRunning)
Specified by:
cancel in interface Future<V>

isCancelled

public boolean isCancelled()
Specified by:
isCancelled in interface Future<V>

isDone

public boolean isDone()
Specified by:
isDone in interface Future<V>

get

public V get()
Specified by:
get in interface Future<V>

get

public V get(long timeout,
             TimeUnit unit)
Specified by:
get in interface Future<V>
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ScheduledAnnotationBeanPostProcessor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.scheduling.annotation
Class ScheduledAnnotationBeanPostProcessor

java.lang.Object
    extended by  org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor
All Implemented Interfaces:
EventListener, BeanPostProcessor, DisposableBean, ApplicationContextAware, ApplicationListener<ContextRefreshedEvent>, Ordered
public class ScheduledAnnotationBeanPostProcessor
extends Object
implements BeanPostProcessor, Ordered, ApplicationContextAware, ApplicationListener<ContextRefreshedEvent>, DisposableBean

Bean post-processor that registers methods annotated with @Scheduled to be invoked by a TaskScheduler according to the "fixedRate", "fixedDelay", or "cron" expression provided via the annotation.

Since:
3.0
Author:
Mark Fisher, Juergen Hoeller
See Also:
Scheduled, TaskScheduler

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
ScheduledAnnotationBeanPostProcessor()
Method Summary
void | destroy() Invoked by a BeanFactory on destruction of a singleton.
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
void | onApplicationEvent(ContextRefreshedEvent event) Handle an application event.
Object | postProcessAfterInitialization(Object bean, String beanName) Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).
Object | postProcessBeforeInitialization(Object bean, String beanName) Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).
void | setApplicationContext(ApplicationContext applicationContext) Set the ApplicationContext that this object runs in.
void | setScheduler(Object scheduler) Set the TaskScheduler that will invoke the scheduled methods, or a ScheduledExecutorService to be wrapped as a TaskScheduler.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ScheduledAnnotationBeanPostProcessor

public ScheduledAnnotationBeanPostProcessor()
Method Detail

setScheduler

public void setScheduler(Object scheduler)
Set the TaskScheduler that will invoke the scheduled methods, or a ScheduledExecutorService to be wrapped as a TaskScheduler.

setApplicationContext

public void setApplicationContext(ApplicationContext applicationContext)
Description copied from interface: ApplicationContextAware
Set the ApplicationContext that this object runs in. Normally this call will be used to initialize the object.

Invoked after population of normal bean properties but before an init callback such as InitializingBean.afterPropertiesSet() or a custom init-method. Invoked after ResourceLoaderAware.setResourceLoader(org.springframework.core.io.ResourceLoader), ApplicationEventPublisherAware.setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher) and MessageSourceAware, if applicable.

Specified by:
setApplicationContext in interface ApplicationContextAware
Parameters:
applicationContext - the ApplicationContext object to be used by this object
See Also:
BeanInitializationException

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

postProcessBeforeInitialization

public Object postProcessBeforeInitialization(Object bean,
                                              String beanName)
Description copied from interface: BeanPostProcessor
Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

Specified by:
postProcessBeforeInitialization in interface BeanPostProcessor
Parameters:
bean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
See Also:
InitializingBean.afterPropertiesSet()

postProcessAfterInitialization

public Object postProcessAfterInitialization(Object bean,
                                             String beanName)
Description copied from interface: BeanPostProcessor
Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

In case of a FactoryBean, this callback will be invoked for both the FactoryBean instance and the objects created by the FactoryBean (as of Spring 2.0). The post-processor can decide whether to apply to either the FactoryBean or created objects or both through corresponding bean instanceof FactoryBean checks.

This callback will also be invoked after a short-circuiting triggered by a InstantiationAwareBeanPostProcessor.postProcessBeforeInstantiation(java.lang.Class, java.lang.String) method, in contrast to all other BeanPostProcessor callbacks.

Specified by:
postProcessAfterInitialization in interface BeanPostProcessor
Parameters:
bean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
See Also:
InitializingBean.afterPropertiesSet(), FactoryBean

onApplicationEvent

public void onApplicationEvent(ContextRefreshedEvent event)
Description copied from interface: ApplicationListener
Handle an application event.

Specified by:
onApplicationEvent in interface ApplicationListener<ContextRefreshedEvent>
Parameters:
event - the event to respond to

destroy

public void destroy()
             throws Exception
Description copied from interface: DisposableBean
Invoked by a BeanFactory on destruction of a singleton.

Specified by:
destroy in interface DisposableBean
Throws:
Exception - in case of shutdown errors. Exceptions will get logged but not rethrown to allow other beans to release their resources too.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


Async

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

org.springframework.scheduling.annotation
Annotation Type Async

@Target(value={TYPE,METHOD})
@Retention(value=RUNTIME)
@Documented
public @interface Async

Annotation that marks a method as a candidate for asynchronous execution. Can also be used at the type level, in which case all of the type's methods are considered as asynchronous.

In terms of target method signatures, any parameter types are supported. However, the return type is constrained to either void or java.util.concurrent.Future. In the latter case, the Future handle returned from the proxy will be an actual asynchronous Future that can be used to track the result of the asynchronous method execution. However, since the target method needs to implement the same signature, it will have to return a temporary Future handle that just passes the return value through: e.g. Spring's AsyncResult or EJB 3.1's javax.ejb.AsyncResult.

Since:
3.0
Author:
Juergen Hoeller
See Also:
AsyncExecutionInterceptor, AsyncAnnotationAdvisor

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT


Scheduled

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.scheduling.annotation
Annotation Type Scheduled

@Target(value={METHOD,ANNOTATION_TYPE})
@Retention(value=RUNTIME)
@Documented
public @interface Scheduled

Annotation that marks a method to be scheduled. Exactly one of the cron, fixedDelay, or fixedRate attributes must be provided.

The annotated method must expect no arguments and have a void return type.

Since:
3.0
Author:
Mark Fisher, Dave Syer
See Also:
ScheduledAnnotationBeanPostProcessor

Optional Element Summary
String | cron A cron-like expression, extending the usual UN*X definition to include triggers on the second as well as minute, hour, day of month, month and day of week.
long | fixedDelay Execute the annotated method with a fixed period between the end of the last invocation and the start of the next.
long | fixedRate Execute the annotated method with a fixed period between invocations.

cron

public abstract String cron
A cron-like expression, extending the usual UN*X definition to include triggers on the second as well as minute, hour, day of month, month and day of week. e.g. "0 * * * * MON-FRI" means once per minute on weekdays (at the top of the minute - the 0th second).

Returns:
an expression that can be parsed to a cron schedule
Default:
""

fixedDelay

public abstract long fixedDelay
Execute the annotated method with a fixed period between the end of the last invocation and the start of the next.

Returns:
the delay in milliseconds
Default:
-1L

fixedRate

public abstract long fixedRate
Execute the annotated method with a fixed period between invocations.

Returns:
the period in milliseconds
Default:
-1L
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


org.springframework.scheduling.backportconcurrent

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.scheduling.backportconcurrent

Scheduling convenience classes for the JSR-166 backport Executor mechanism, allowing to set up a ThreadPoolExecutor as a TaskExecutor-compliant bean in a Spring context.

See:
Description

Class Summary
ConcurrentTaskExecutor | Adapter that takes a JSR-166 backport edu.emory.mathcs.backport.java.util.concurrent.Executor and exposes a Spring TaskExecutor for it.
CustomizableThreadFactory | Implementation of the JSR-166 backport ThreadFactory interface, allowing for customizing the created threads (name, priority, etc).
ThreadPoolTaskExecutor | JavaBean that allows for configuring a JSR-166 backport ThreadPoolExecutor in bean style (through its "corePoolSize", "maxPoolSize", "keepAliveSeconds", "queueCapacity" properties), exposing it as a Spring TaskExecutor.

Package org.springframework.scheduling.backportconcurrent Description

Scheduling convenience classes for the JSR-166 backport Executor mechanism, allowing to set up a ThreadPoolExecutor as a TaskExecutor-compliant bean in a Spring context.


org.springframework.scheduling.backportconcurrent Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.scheduling.backportconcurrent

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.scheduling.backportconcurrent.ConcurrentTaskExecutor (implements edu.emory.mathcs.backport.java.util.concurrent.Executor, org.springframework.scheduling.SchedulingTaskExecutor)
    • org.springframework.util.CustomizableThreadCreator (implements java.io.Serializable)
      • org.springframework.scheduling.backportconcurrent.CustomizableThreadFactory (implements edu.emory.mathcs.backport.java.util.concurrent.ThreadFactory)
        • org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, edu.emory.mathcs.backport.java.util.concurrent.Executor, org.springframework.beans.factory.InitializingBean, org.springframework.scheduling.SchedulingTaskExecutor)


ConcurrentTaskExecutor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.scheduling.backportconcurrent
Class ConcurrentTaskExecutor

java.lang.Object
    extended by  org.springframework.scheduling.backportconcurrent.ConcurrentTaskExecutor
All Implemented Interfaces:
edu.emory.mathcs.backport.java.util.concurrent.Executor, AsyncTaskExecutor, TaskExecutor, SchedulingTaskExecutor
public class ConcurrentTaskExecutor
extends Object
implements SchedulingTaskExecutor, edu.emory.mathcs.backport.java.util.concurrent.Executor

Adapter that takes a JSR-166 backport edu.emory.mathcs.backport.java.util.concurrent.Executor and exposes a Spring TaskExecutor for it.

NOTE: This class implements Spring's TaskExecutor interface (and hence implicitly the standard Java 5 Executor interface) as well as the JSR-166 Executor interface, with the former being the primary interface, the other just serving as secondary convenience. For this reason, the exception handling follows the TaskExecutor contract rather than the backport Executor contract, in particular regarding the TaskRejectedException.

Note that there is a pre-built ThreadPoolTaskExecutor that allows for defining a JSR-166 backport ThreadPoolExecutor in bean style, exposing it as a Spring TaskExecutor directly. This is a convenient alternative to a raw ThreadPoolExecutor definition with a separate definition of the present adapter class.

Since:
2.0.3
Author:
Juergen Hoeller
See Also:
Executor, ThreadPoolExecutor, Executors, ThreadPoolTaskExecutor

Field Summary
Fields inherited from interface org.springframework.core.task.AsyncTaskExecutor
TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE
Constructor Summary
ConcurrentTaskExecutor()
Create a new ConcurrentTaskExecutor, using a single thread executor as default.
ConcurrentTaskExecutor(edu.emory.mathcs.backport.java.util.concurrent.Executor concurrentExecutor)
Create a new ConcurrentTaskExecutor, using the given JSR-166 backport concurrent executor.
Method Summary
 void execute(Runnable task)
Delegates to the specified JSR-166 backport concurrent executor.
 void execute(Runnable task, long startTimeout)
Execute the given task.
 edu.emory.mathcs.backport.java.util.concurrent.Executor getConcurrentExecutor()
Return the JSR-166 backport concurrent executor that this adapter delegates to.
 boolean prefersShortLivedTasks()
This task executor prefers short-lived work units.
 void setConcurrentExecutor(edu.emory.mathcs.backport.java.util.concurrent.Executor concurrentExecutor)
Specify the JSR-166 backport concurrent executor to delegate to.
<T> Future<T>
submit(Callable<T> task)
Submit a Callable task for execution, receiving a Future representing that task.
 Future<?> submit(Runnable task)
Submit a Runnable task for execution, receiving a Future representing that task.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ConcurrentTaskExecutor

public ConcurrentTaskExecutor()
Create a new ConcurrentTaskExecutor, using a single thread executor as default.

See Also:
Executors.newSingleThreadExecutor()

ConcurrentTaskExecutor

public ConcurrentTaskExecutor(edu.emory.mathcs.backport.java.util.concurrent.Executor concurrentExecutor)
Create a new ConcurrentTaskExecutor, using the given JSR-166 backport concurrent executor.

Parameters:
concurrentExecutor - the JSR-166 backport concurrent executor to delegate to
Method Detail

setConcurrentExecutor

public final void setConcurrentExecutor(edu.emory.mathcs.backport.java.util.concurrent.Executor concurrentExecutor)
Specify the JSR-166 backport concurrent executor to delegate to.

getConcurrentExecutor

public final edu.emory.mathcs.backport.java.util.concurrent.Executor getConcurrentExecutor()
Return the JSR-166 backport concurrent executor that this adapter delegates to.

execute

public void execute(Runnable task)
Delegates to the specified JSR-166 backport concurrent executor.

Specified by:
execute in interface edu.emory.mathcs.backport.java.util.concurrent.Executor
Specified by:
execute in interface TaskExecutor
Parameters:
task - the Runnable to execute (never null)
See Also:
Executor.execute(Runnable)

execute

public void execute(Runnable task,
                    long startTimeout)
Description copied from interface: AsyncTaskExecutor
Execute the given task.

Specified by:
execute in interface AsyncTaskExecutor
Parameters:
task - the Runnable to execute (never null)
startTimeout - the time duration (milliseconds) within which the task is supposed to start. This is intended as a hint to the executor, allowing for preferred handling of immediate tasks. Typical values are AsyncTaskExecutor.TIMEOUT_IMMEDIATE or AsyncTaskExecutor.TIMEOUT_INDEFINITE (the default as used by TaskExecutor.execute(Runnable)).

submit

public Future<?> submit(Runnable task)
Description copied from interface: AsyncTaskExecutor
Submit a Runnable task for execution, receiving a Future representing that task. The Future will return a null result upon completion.

Specified by:
submit in interface AsyncTaskExecutor
Parameters:
task - the Runnable to execute (never null)
Returns:
a Future representing pending completion of the task

submit

public <T> Future<T> submit(Callable<T> task)
Description copied from interface: AsyncTaskExecutor
Submit a Callable task for execution, receiving a Future representing that task. The Future will return the Callable's result upon completion.

Specified by:
submit in interface AsyncTaskExecutor
Parameters:
task - the Callable to execute (never null)
Returns:
a Future representing pending completion of the task

prefersShortLivedTasks

public boolean prefersShortLivedTasks()
This task executor prefers short-lived work units.

Specified by:
prefersShortLivedTasks in interface SchedulingTaskExecutor
Returns:
true if this TaskExecutor prefers short-lived tasks
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


CustomizableThreadFactory

org.springframework.scheduling.backportconcurrent
Class CustomizableThreadFactory

java.lang.Object
    extended by  org.springframework.util.CustomizableThreadCreator
        extended by  org.springframework.scheduling.backportconcurrent.CustomizableThreadFactory
All Implemented Interfaces:
edu.emory.mathcs.backport.java.util.concurrent.ThreadFactory, Serializable
Direct Known Subclasses:
ThreadPoolTaskExecutor
public class CustomizableThreadFactory
extends CustomizableThreadCreator
implements edu.emory.mathcs.backport.java.util.concurrent.ThreadFactory

Implementation of the JSR-166 backport ThreadFactory interface, allowing for customizing the created threads (name, priority, etc).

See the base class CustomizableThreadCreator for details on the available configuration options.

Since:
2.0.3
Author:
Juergen Hoeller
See Also:
CustomizableThreadCreator.setThreadNamePrefix(java.lang.String), CustomizableThreadCreator.setThreadPriority(int), Serialized Form

Constructor Summary
CustomizableThreadFactory()
Create a new CustomizableThreadFactory with default thread name prefix.
CustomizableThreadFactory(String threadNamePrefix)
Create a new CustomizableThreadFactory with the given thread name prefix.
Method Summary
 Thread newThread(Runnable runnable)
Methods inherited from class org.springframework.util.CustomizableThreadCreator
createThread, getDefaultThreadNamePrefix, getThreadGroup, getThreadNamePrefix, getThreadPriority, isDaemon, nextThreadName, setDaemon, setThreadGroup, setThreadGroupName, setThreadNamePrefix, setThreadPriority
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CustomizableThreadFactory

public CustomizableThreadFactory()
Create a new CustomizableThreadFactory with default thread name prefix.

CustomizableThreadFactory

public CustomizableThreadFactory(String threadNamePrefix)
Create a new CustomizableThreadFactory with the given thread name prefix.

Parameters:
threadNamePrefix - the prefix to use for the names of newly created threads
Method Detail

newThread

public Thread newThread(Runnable runnable)
Specified by:
newThread in interface edu.emory.mathcs.backport.java.util.concurrent.ThreadFactory
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ThreadPoolTaskExecutor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.scheduling.backportconcurrent
Class ThreadPoolTaskExecutor

java.lang.Object
    extended by  org.springframework.util.CustomizableThreadCreator
        extended by  org.springframework.scheduling.backportconcurrent.CustomizableThreadFactory
            extended by  org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor
All Implemented Interfaces:
edu.emory.mathcs.backport.java.util.concurrent.Executor, edu.emory.mathcs.backport.java.util.concurrent.ThreadFactory, Serializable, BeanNameAware, DisposableBean, InitializingBean, AsyncTaskExecutor, TaskExecutor, SchedulingTaskExecutor
public class ThreadPoolTaskExecutor
extends CustomizableThreadFactory
implements SchedulingTaskExecutor, edu.emory.mathcs.backport.java.util.concurrent.Executor, BeanNameAware, InitializingBean, DisposableBean

JavaBean that allows for configuring a JSR-166 backport ThreadPoolExecutor in bean style (through its "corePoolSize", "maxPoolSize", "keepAliveSeconds", "queueCapacity" properties), exposing it as a Spring TaskExecutor. This is an alternative to configuring a ThreadPoolExecutor instance directly using constructor injection, with a separate ConcurrentTaskExecutor adapter wrapping it.

For any custom needs, in particular for defining a ScheduledThreadPoolExecutor, it is recommended to use a straight definition of the Executor instance or a factory method definition that points to the JSR-166 backport Executors class. To expose such a raw Executor as a Spring TaskExecutor, simply wrap it with a ConcurrentTaskExecutor adapter.

NOTE: This class implements Spring's TaskExecutor interface (and hence implicitly the standard Java 5 Executor interface) as well as the JSR-166 Executor interface, with the former being the primary interface, the other just serving as secondary convenience. For this reason, the exception handling follows the TaskExecutor contract rather than the backport Executor contract, in particular regarding the TaskRejectedException.

Since:
2.0.3
Author:
Juergen Hoeller
See Also:
TaskExecutor, Executor, ThreadPoolExecutor, ScheduledThreadPoolExecutor, Executors, ConcurrentTaskExecutor, Serialized Form

Field Summary
protected  Log logger
Fields inherited from interface org.springframework.core.task.AsyncTaskExecutor
TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE
Constructor Summary
ThreadPoolTaskExecutor()
Method Summary
 void afterPropertiesSet()
Calls initialize() after the container applied all property values.
protected  edu.emory.mathcs.backport.java.util.concurrent.BlockingQueue createQueue(int queueCapacity)
Create the BlockingQueue to use for the ThreadPoolExecutor.
 void destroy()
Calls shutdown when the BeanFactory destroys the task executor instance.
 void execute(Runnable task)
Implementation of both the JSR-166 backport Executor interface and the Spring TaskExecutor interface, delegating to the ThreadPoolExecutor instance.
 void execute(Runnable task, long startTimeout)
Execute the given task.
 int getActiveCount()
Return the number of currently active threads.
 int getCorePoolSize()
Return the ThreadPoolExecutor's core pool size.
 int getKeepAliveSeconds()
Return the ThreadPoolExecutor's keep-alive seconds.
 int getMaxPoolSize()
Return the ThreadPoolExecutor's maximum pool size.
 int getPoolSize()
Return the current pool size.
 edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor getThreadPoolExecutor()
Return the underlying ThreadPoolExecutor for native access.
 void initialize()
Creates the BlockingQueue and the ThreadPoolExecutor.
 boolean prefersShortLivedTasks()
This task executor prefers short-lived work units.
 void setAllowCoreThreadTimeOut(boolean allowCoreThreadTimeOut)
Specify whether to allow core threads to time out.
 void setBeanName(String name)
Set the name of the bean in the bean factory that created this bean.
 void setCorePoolSize(int corePoolSize)
Set the ThreadPoolExecutor's core pool size.
 void setKeepAliveSeconds(int keepAliveSeconds)
Set the ThreadPoolExecutor's keep-alive seconds.
 void setMaxPoolSize(int maxPoolSize)
Set the ThreadPoolExecutor's maximum pool size.
 void setQueueCapacity(int queueCapacity)
Set the capacity for the ThreadPoolExecutor's BlockingQueue.
 void setRejectedExecutionHandler(edu.emory.mathcs.backport.java.util.concurrent.RejectedExecutionHandler rejectedExecutionHandler)
Set the RejectedExecutionHandler to use for the ThreadPoolExecutor.
 void setThreadFactory(edu.emory.mathcs.backport.java.util.concurrent.ThreadFactory threadFactory)
Set the ThreadFactory to use for the ThreadPoolExecutor's thread pool.
 void setThreadNamePrefix(String threadNamePrefix)
Specify the prefix to use for the names of newly created threads.
 void setWaitForTasksToCompleteOnShutdown(boolean waitForJobsToCompleteOnShutdown)
Set whether to wait for scheduled tasks to complete on shutdown.
 void shutdown()
Perform a shutdown on the ThreadPoolExecutor.
<T> Future<T>
submit(Callable<T> task)
Submit a Callable task for execution, receiving a Future representing that task.
 Future<?> submit(Runnable task)
Submit a Runnable task for execution, receiving a Future representing that task.
Methods inherited from class org.springframework.scheduling.backportconcurrent.CustomizableThreadFactory
newThread
Methods inherited from class org.springframework.util.CustomizableThreadCreator
createThread, getDefaultThreadNamePrefix, getThreadGroup, getThreadNamePrefix, getThreadPriority, isDaemon, nextThreadName, setDaemon, setThreadGroup, setThreadGroupName, setThreadPriority
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Constructor Detail

ThreadPoolTaskExecutor

public ThreadPoolTaskExecutor()
Method Detail

setCorePoolSize

public void setCorePoolSize(int corePoolSize)
Set the ThreadPoolExecutor's core pool size. Default is 1.

This setting can be modified at runtime, for example through JMX.

getCorePoolSize

public int getCorePoolSize()
Return the ThreadPoolExecutor's core pool size.

setMaxPoolSize

public void setMaxPoolSize(int maxPoolSize)
Set the ThreadPoolExecutor's maximum pool size. Default is Integer.MAX_VALUE.

This setting can be modified at runtime, for example through JMX.

getMaxPoolSize

public int getMaxPoolSize()
Return the ThreadPoolExecutor's maximum pool size.

setKeepAliveSeconds

public void setKeepAliveSeconds(int keepAliveSeconds)
Set the ThreadPoolExecutor's keep-alive seconds. Default is 60.

This setting can be modified at runtime, for example through JMX.

getKeepAliveSeconds

public int getKeepAliveSeconds()
Return the ThreadPoolExecutor's keep-alive seconds.

setAllowCoreThreadTimeOut

public void setAllowCoreThreadTimeOut(boolean allowCoreThreadTimeOut)
Specify whether to allow core threads to time out. This enables dynamic growing and shrinking even in combination with a non-zero queue (since the max pool size will only grow once the queue is full).

Default is "false". Note that this feature is only available on backport-concurrent 3.0 or above (based on the code in Java 6).

See Also:
ThreadPoolExecutor.allowCoreThreadTimeOut(boolean)

setQueueCapacity

public void setQueueCapacity(int queueCapacity)
Set the capacity for the ThreadPoolExecutor's BlockingQueue. Default is Integer.MAX_VALUE.

Any positive value will lead to a LinkedBlockingQueue instance; any other value will lead to a SynchronousQueue instance.

See Also:
LinkedBlockingQueue, SynchronousQueue

setThreadFactory

public void setThreadFactory(edu.emory.mathcs.backport.java.util.concurrent.ThreadFactory threadFactory)
Set the ThreadFactory to use for the ThreadPoolExecutor's thread pool.

Default is this executor itself (i.e. the factory that this executor inherits from). See CustomizableThreadCreator's javadoc for available bean properties.

See Also:
CustomizableThreadCreator.setThreadPriority(int), CustomizableThreadCreator.setDaemon(boolean)

setRejectedExecutionHandler

public void setRejectedExecutionHandler(edu.emory.mathcs.backport.java.util.concurrent.RejectedExecutionHandler rejectedExecutionHandler)
Set the RejectedExecutionHandler to use for the ThreadPoolExecutor. Default is the ThreadPoolExecutor's default abort policy.

See Also:
ThreadPoolExecutor.AbortPolicy

setWaitForTasksToCompleteOnShutdown

public void setWaitForTasksToCompleteOnShutdown(boolean waitForJobsToCompleteOnShutdown)
Set whether to wait for scheduled tasks to complete on shutdown.

Default is "false". Switch this to "true" if you prefer fully completed tasks at the expense of a longer shutdown phase.

See Also:
ThreadPoolExecutor.shutdown(), ThreadPoolExecutor.shutdownNow()

setThreadNamePrefix

public void setThreadNamePrefix(String threadNamePrefix)
Description copied from class: CustomizableThreadCreator
Specify the prefix to use for the names of newly created threads. Default is "SimpleAsyncTaskExecutor-".

Overrides:
setThreadNamePrefix in class CustomizableThreadCreator

setBeanName

public void setBeanName(String name)
Description copied from interface: BeanNameAware
Set the name of the bean in the bean factory that created this bean.

Invoked after population of normal bean properties but before an init callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanName in interface BeanNameAware
Parameters:
name - the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use the BeanFactoryUtils.originalBeanName(String) method to extract the original bean name (without suffix), if desired.

afterPropertiesSet

public void afterPropertiesSet()
Calls initialize() after the container applied all property values.

Specified by:
afterPropertiesSet in interface InitializingBean
See Also:
initialize()

initialize

public void initialize()
Creates the BlockingQueue and the ThreadPoolExecutor.

See Also:
createQueue(int)

createQueue

protected edu.emory.mathcs.backport.java.util.concurrent.BlockingQueue createQueue(int queueCapacity)
Create the BlockingQueue to use for the ThreadPoolExecutor.

A LinkedBlockingQueue instance will be created for a positive capacity value; a SynchronousQueue else.

Parameters:
queueCapacity - the specified queue capacity
Returns:
the BlockingQueue instance
See Also:
LinkedBlockingQueue, SynchronousQueue

getThreadPoolExecutor

public edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor getThreadPoolExecutor()
                                                                                throws IllegalStateException
Return the underlying ThreadPoolExecutor for native access.

Returns:
the underlying ThreadPoolExecutor (never null)
Throws:
IllegalStateException - if the ThreadPoolTaskExecutor hasn't been initialized yet

execute

public void execute(Runnable task)
Implementation of both the JSR-166 backport Executor interface and the Spring TaskExecutor interface, delegating to the ThreadPoolExecutor instance.

Specified by:
execute in interface edu.emory.mathcs.backport.java.util.concurrent.Executor
Specified by:
execute in interface TaskExecutor
Parameters:
task - the Runnable to execute (never null)
See Also:
Executor.execute(Runnable), TaskExecutor.execute(Runnable)

execute

public void execute(Runnable task,
                    long startTimeout)
Description copied from interface: AsyncTaskExecutor
Execute the given task.

Specified by:
execute in interface AsyncTaskExecutor
Parameters:
task - the Runnable to execute (never null)
startTimeout - the time duration (milliseconds) within which the task is supposed to start. This is intended as a hint to the executor, allowing for preferred handling of immediate tasks. Typical values are AsyncTaskExecutor.TIMEOUT_IMMEDIATE or AsyncTaskExecutor.TIMEOUT_INDEFINITE (the default as used by TaskExecutor.execute(Runnable)).

submit

public Future<?> submit(Runnable task)
Description copied from interface: AsyncTaskExecutor
Submit a Runnable task for execution, receiving a Future representing that task. The Future will return a null result upon completion.

Specified by:
submit in interface AsyncTaskExecutor
Parameters:
task - the Runnable to execute (never null)
Returns:
a Future representing pending completion of the task

submit

public <T> Future<T> submit(Callable<T> task)
Description copied from interface: AsyncTaskExecutor
Submit a Callable task for execution, receiving a Future representing that task. The Future will return the Callable's result upon completion.

Specified by:
submit in interface AsyncTaskExecutor
Parameters:
task - the Callable to execute (never null)
Returns:
a Future representing pending completion of the task

prefersShortLivedTasks

public boolean prefersShortLivedTasks()
This task executor prefers short-lived work units.

Specified by:
prefersShortLivedTasks in interface SchedulingTaskExecutor
Returns:
true if this TaskExecutor prefers short-lived tasks

getPoolSize

public int getPoolSize()
Return the current pool size.

See Also:
ThreadPoolExecutor.getPoolSize()

getActiveCount

public int getActiveCount()
Return the number of currently active threads.

See Also:
ThreadPoolExecutor.getActiveCount()

destroy

public void destroy()
Calls shutdown when the BeanFactory destroys the task executor instance.

Specified by:
destroy in interface DisposableBean
See Also:
shutdown()

shutdown

public void shutdown()
Perform a shutdown on the ThreadPoolExecutor.

See Also:
ThreadPoolExecutor.shutdown()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.scheduling.commonj

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.scheduling.commonj

Convenience classes for scheduling based on the CommonJ WorkManager/TimerManager facility, as supported by IBM WebSphere 6.0+ and BEA WebLogic 9.0+.

See:
Description

Class Summary
DelegatingTimerListener | Simple TimerListener adapter that delegates to a given Runnable.
DelegatingWork | Simple Work adapter that delegates to a given Runnable.
ScheduledTimerListener | JavaBean that describes a scheduled TimerListener, consisting of the TimerListener itself (or a Runnable to create a TimerListener for) and a delay plus period.
TimerManagerAccessor | Base class for classes that are accessing a CommonJ TimerManager Defines common configuration settings and common lifecycle handling.
TimerManagerFactoryBean | FactoryBean that retrieves a CommonJ TimerManager and exposes it for bean references.
TimerManagerTaskScheduler | Implementation of Spring's TaskScheduler interface, wrapping a CommonJ TimerManager.
WorkManagerTaskExecutor | TaskExecutor implementation that delegates to a CommonJ WorkManager, implementing the WorkManager interface, which either needs to be specified as reference or through the JNDI name.

Package org.springframework.scheduling.commonj Description

Convenience classes for scheduling based on the CommonJ WorkManager/TimerManager facility, as supported by IBM WebSphere 6.0+ and BEA WebLogic 9.0+.


org.springframework.scheduling.commonj Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.scheduling.commonj

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.scheduling.commonj.DelegatingTimerListener (implements commonj.timers.TimerListener)
    • org.springframework.scheduling.commonj.DelegatingWork (implements commonj.work.Work)
    • org.springframework.jndi.JndiAccessor
      • org.springframework.jndi.JndiLocatorSupport
        • org.springframework.scheduling.commonj.TimerManagerAccessor (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle)
          • org.springframework.scheduling.commonj.TimerManagerFactoryBean (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle)
          • org.springframework.scheduling.commonj.TimerManagerTaskScheduler (implements org.springframework.scheduling.TaskScheduler)
        • org.springframework.scheduling.commonj.WorkManagerTaskExecutor (implements org.springframework.beans.factory.InitializingBean, org.springframework.scheduling.SchedulingTaskExecutor, commonj.work.WorkManager)
    • org.springframework.scheduling.commonj.ScheduledTimerListener


DelegatingTimerListener

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.scheduling.commonj
Class DelegatingTimerListener

java.lang.Object
    extended by  org.springframework.scheduling.commonj.DelegatingTimerListener
All Implemented Interfaces:
commonj.timers.TimerListener
public class DelegatingTimerListener
extends Object
implements commonj.timers.TimerListener

Simple TimerListener adapter that delegates to a given Runnable.

Since:
2.0
Author:
Juergen Hoeller
See Also:
TimerListener, Runnable

Constructor Summary
DelegatingTimerListener(Runnable runnable)
Create a new DelegatingTimerListener.
Method Summary
 void timerExpired(commonj.timers.Timer timer)
Delegates execution to the underlying Runnable.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DelegatingTimerListener

public DelegatingTimerListener(Runnable runnable)
Create a new DelegatingTimerListener.

Parameters:
runnable - the Runnable implementation to delegate to
Method Detail

timerExpired

public void timerExpired(commonj.timers.Timer timer)
Delegates execution to the underlying Runnable.

Specified by:
timerExpired in interface commonj.timers.TimerListener
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


DelegatingWork

org.springframework.scheduling.commonj
Class DelegatingWork

java.lang.Object
    extended by  org.springframework.scheduling.commonj.DelegatingWork
All Implemented Interfaces:
commonj.work.Work, Runnable
public class DelegatingWork
extends Object
implements commonj.work.Work

Simple Work adapter that delegates to a given Runnable.

Since:
2.0
Author:
Juergen Hoeller
See Also:
Work, Runnable

Constructor Summary
DelegatingWork(Runnable delegate)
Create a new DelegatingWork.
Method Summary
 Runnable getDelegate()
Return the wrapped Runnable implementation.
 boolean isDaemon()
This implementation delegates to SchedulingAwareRunnable.isLongLived(), if available.
 void release()
This implementation is empty, since we expect the Runnable to terminate based on some specific shutdown signal.
 void run()
Delegates execution to the underlying Runnable.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DelegatingWork

public DelegatingWork(Runnable delegate)
Create a new DelegatingWork.

Parameters:
delegate - the Runnable implementation to delegate to (may be a SchedulingAwareRunnable for extended support)
See Also:
SchedulingAwareRunnable, isDaemon()
Method Detail

getDelegate

public final Runnable getDelegate()
Return the wrapped Runnable implementation.

run

public void run()
Delegates execution to the underlying Runnable.

Specified by:
run in interface Runnable

isDaemon

public boolean isDaemon()
This implementation delegates to SchedulingAwareRunnable.isLongLived(), if available.

Specified by:
isDaemon in interface commonj.work.Work

release

public void release()
This implementation is empty, since we expect the Runnable to terminate based on some specific shutdown signal.

Specified by:
release in interface commonj.work.Work
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ScheduledTimerListener

org.springframework.scheduling.commonj
Class ScheduledTimerListener

java.lang.Object
    extended by  org.springframework.scheduling.commonj.ScheduledTimerListener

public class ScheduledTimerListener
extends Object

JavaBean that describes a scheduled TimerListener, consisting of the TimerListener itself (or a Runnable to create a TimerListener for) and a delay plus period. Period needs to be specified; there is no point in a default for it.

The CommonJ TimerManager does not offer more sophisticated scheduling options such as cron expressions. Consider using Quartz for such advanced needs.

Note that the TimerManager uses a TimerListener instance that is shared between repeated executions, in contrast to Quartz which instantiates a new Job for each execution.

Since:
2.0
Author:
Juergen Hoeller
See Also:
TimerListener, TimerManager.schedule(commonj.timers.TimerListener, long, long), TimerManager.scheduleAtFixedRate(commonj.timers.TimerListener, long, long)

Constructor Summary
ScheduledTimerListener()
Create a new ScheduledTimerListener, to be populated via bean properties.
ScheduledTimerListener(Runnable timerTask)
Create a new ScheduledTimerListener, with default one-time execution without delay.
ScheduledTimerListener(Runnable timerTask, long delay)
Create a new ScheduledTimerListener, with default one-time execution with the given delay.
ScheduledTimerListener(Runnable timerTask, long delay, long period, boolean fixedRate)
Create a new ScheduledTimerListener.
ScheduledTimerListener(commonj.timers.TimerListener timerListener)
Create a new ScheduledTimerListener, with default one-time execution without delay.
ScheduledTimerListener(commonj.timers.TimerListener timerListener, long delay)
Create a new ScheduledTimerListener, with default one-time execution with the given delay.
ScheduledTimerListener(commonj.timers.TimerListener timerListener, long delay, long period, boolean fixedRate)
Create a new ScheduledTimerListener.
Method Summary
long | getDelay() Return the delay before starting the job for the first time.
long | getPeriod() Return the period between repeated task executions.
commonj.timers.TimerListener | getTimerListener() Return the TimerListener to schedule.
boolean | isFixedRate() Return whether to schedule as fixed-rate execution.
boolean | isOneTimeTask() Is this task only ever going to execute once?
void | setDelay(long delay) Set the delay before starting the task for the first time, in milliseconds.
void | setFixedRate(boolean fixedRate) Set whether to schedule as fixed-rate execution, rather than fixed-delay execution.
void | setPeriod(long period) Set the period between repeated task executions, in milliseconds.
void | setRunnable(Runnable timerTask) Set the Runnable to schedule as TimerListener.
void | setTimerListener(commonj.timers.TimerListener timerListener) Set the TimerListener to schedule.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ScheduledTimerListener

public ScheduledTimerListener()
Create a new ScheduledTimerListener, to be populated via bean properties.

See Also:
setTimerListener(commonj.timers.TimerListener), setDelay(long), setPeriod(long), setFixedRate(boolean)

ScheduledTimerListener

public ScheduledTimerListener(commonj.timers.TimerListener timerListener)
Create a new ScheduledTimerListener, with default one-time execution without delay.

Parameters:
timerListener - the TimerListener to schedule

ScheduledTimerListener

public ScheduledTimerListener(commonj.timers.TimerListener timerListener,
                              long delay)
Create a new ScheduledTimerListener, with default one-time execution with the given delay.

Parameters:
timerListener - the TimerListener to schedule
delay - the delay before starting the task for the first time (ms)

ScheduledTimerListener

public ScheduledTimerListener(commonj.timers.TimerListener timerListener,
                              long delay,
                              long period,
                              boolean fixedRate)
Create a new ScheduledTimerListener.

Parameters:
timerListener - the TimerListener to schedule
delay - the delay before starting the task for the first time (ms)
period - the period between repeated task executions (ms)
fixedRate - whether to schedule as fixed-rate execution

ScheduledTimerListener

public ScheduledTimerListener(Runnable timerTask)
Create a new ScheduledTimerListener, with default one-time execution without delay.

Parameters:
timerTask - the Runnable to schedule as TimerListener

ScheduledTimerListener

public ScheduledTimerListener(Runnable timerTask,
                              long delay)
Create a new ScheduledTimerListener, with default one-time execution with the given delay.

Parameters:
timerTask - the Runnable to schedule as TimerListener
delay - the delay before starting the task for the first time (ms)

ScheduledTimerListener

public ScheduledTimerListener(Runnable timerTask,
                              long delay,
                              long period,
                              boolean fixedRate)
Create a new ScheduledTimerListener.

Parameters:
timerTask - the Runnable to schedule as TimerListener
delay - the delay before starting the task for the first time (ms)
period - the period between repeated task executions (ms)
fixedRate - whether to schedule as fixed-rate execution
Method Detail

setRunnable

public void setRunnable(Runnable timerTask)
Set the Runnable to schedule as TimerListener.

See Also:
DelegatingTimerListener

setTimerListener

public void setTimerListener(commonj.timers.TimerListener timerListener)
Set the TimerListener to schedule.

getTimerListener

public commonj.timers.TimerListener getTimerListener()
Return the TimerListener to schedule.

setDelay

public void setDelay(long delay)
Set the delay before starting the task for the first time, in milliseconds. Default is 0, immediately starting the task after successful scheduling.

If the "firstTime" property is specified, this property will be ignored. Specify one or the other, not both.

getDelay

public long getDelay()
Return the delay before starting the job for the first time.

setPeriod

public void setPeriod(long period)
Set the period between repeated task executions, in milliseconds.

Default is -1, leading to one-time execution. In case of zero or a positive value, the task will be executed repeatedly, with the given interval inbetween executions.

Note that the semantics of the period value vary between fixed-rate and fixed-delay execution.

Note: A period of 0 (for example as fixed delay) is supported, because the CommonJ specification defines this as a legal value. Hence a value of 0 will result in immediate re-execution after a job has finished (not in one-time execution like with java.util.Timer).

See Also:
setFixedRate(boolean), isOneTimeTask(), TimerManager.schedule(commonj.timers.TimerListener, long, long)

getPeriod

public long getPeriod()
Return the period between repeated task executions.

isOneTimeTask

public boolean isOneTimeTask()
Is this task only ever going to execute once?

Returns:
true if this task is only ever going to execute once
See Also:
getPeriod()

setFixedRate

public void setFixedRate(boolean fixedRate)
Set whether to schedule as fixed-rate execution, rather than fixed-delay execution. Default is "false", i.e. fixed delay.

See TimerManager javadoc for details on those execution modes.

See Also:
TimerManager.schedule(commonj.timers.TimerListener, long, long), TimerManager.scheduleAtFixedRate(commonj.timers.TimerListener, long, long)

isFixedRate

public boolean isFixedRate()
Return whether to schedule as fixed-rate execution.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TimerManagerAccessor

org.springframework.scheduling.commonj
Class TimerManagerAccessor

java.lang.Object
    extended by  org.springframework.jndi.JndiAccessor
        extended by  org.springframework.jndi.JndiLocatorSupport
            extended by  org.springframework.scheduling.commonj.TimerManagerAccessor
All Implemented Interfaces:
DisposableBean, InitializingBean, Lifecycle
Direct Known Subclasses:
TimerManagerFactoryBean, TimerManagerTaskScheduler
public abstract class TimerManagerAccessor
extends JndiLocatorSupport
implements InitializingBean, DisposableBean, Lifecycle

Base class for classes that are accessing a CommonJ TimerManager Defines common configuration settings and common lifecycle handling.

Since:
3.0
Author:
Juergen Hoeller
See Also:
TimerManager

Field Summary
Fields inherited from class org.springframework.jndi.JndiLocatorSupport
CONTAINER_PREFIX
Fields inherited from class org.springframework.jndi.JndiAccessor
logger
Constructor Summary
TimerManagerAccessor()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
void | destroy() Stops the underlying TimerManager (if not shared).
protected commonj.timers.TimerManager | getTimerManager()
boolean | isRunning() Considers the underlying TimerManager as running if it is neither suspending nor stopping.
void | setShared(boolean shared) Specify whether the TimerManager obtained by this FactoryBean is a shared instance ("true") or an independent instance ("false").
void | setTimerManager(commonj.timers.TimerManager timerManager) Specify the CommonJ TimerManager to delegate to.
void | setTimerManagerName(String timerManagerName) Set the JNDI name of the CommonJ TimerManager.
void | start() Resumes the underlying TimerManager (if not shared).
void | stop() Suspends the underlying TimerManager (if not shared).
Methods inherited from class org.springframework.jndi.JndiLocatorSupport
convertJndiName, isResourceRef, lookup, lookup, setResourceRef
Methods inherited from class org.springframework.jndi.JndiAccessor
getJndiEnvironment, getJndiTemplate, setJndiEnvironment, setJndiTemplate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TimerManagerAccessor

public TimerManagerAccessor()
Method Detail

setTimerManager

public void setTimerManager(commonj.timers.TimerManager timerManager)
Specify the CommonJ TimerManager to delegate to.

Note that the given TimerManager's lifecycle will be managed by this FactoryBean.

Alternatively (and typically), you can specify the JNDI name of the target TimerManager.

See Also:
setTimerManagerName(java.lang.String)

setTimerManagerName

public void setTimerManagerName(String timerManagerName)
Set the JNDI name of the CommonJ TimerManager.

This can either be a fully qualified JNDI name, or the JNDI name relative to the current environment naming context if "resourceRef" is set to "true".

See Also:
setTimerManager(commonj.timers.TimerManager), JndiLocatorSupport.setResourceRef(boolean)

setShared

public void setShared(boolean shared)
Specify whether the TimerManager obtained by this FactoryBean is a shared instance ("true") or an independent instance ("false"). The lifecycle of the former is supposed to be managed by the application server, while the lifecycle of the latter is up to the application.

Default is "false", i.e. managing an independent TimerManager instance. This is what the CommonJ specification suggests that application servers are supposed to offer via JNDI lookups, typically declared as a resource-ref of type commonj.timers.TimerManager in web.xml, with res-sharing-scope set to 'Unshareable'.

Switch this flag to "true" if you are obtaining a shared TimerManager, typically through specifying the JNDI location of a TimerManager that has been explicitly declared as 'Shareable'. Note that WebLogic's cluster-aware Job Scheduler is a shared TimerManager too.

The sole difference between this FactoryBean being in shared or non-shared mode is that it will only attempt to suspend / resume / stop the underlying TimerManager in case of an independent (non-shared) instance. This only affects the Lifecycle support as well as application context shutdown.

See Also:
stop(),
start(),
destroy(),
TimerManager

afterPropertiesSet

public void afterPropertiesSet()
                        throws NamingException
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
NamingException

getTimerManager

protected final commonj.timers.TimerManager getTimerManager()

start

public void start()
Resumes the underlying TimerManager (if not shared).

Specified by:
start in interface Lifecycle
See Also:
TimerManager.resume()

stop

public void stop()
Suspends the underlying TimerManager (if not shared).

Specified by:
stop in interface Lifecycle
See Also:
TimerManager.suspend()

isRunning

public boolean isRunning()
Considers the underlying TimerManager as running if it is neither suspending nor stopping.

Specified by:
isRunning in interface Lifecycle
Returns:
whether the component is currently running
See Also:
TimerManager.isSuspending(), TimerManager.isStopping()

destroy

public void destroy()
Stops the underlying TimerManager (if not shared).

Specified by:
destroy in interface DisposableBean
See Also:
TimerManager.stop()
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


TimerManagerFactoryBean

org.springframework.scheduling.commonj
Class TimerManagerFactoryBean

java.lang.Object
    extended by  org.springframework.jndi.JndiAccessor
        extended by  org.springframework.jndi.JndiLocatorSupport
            extended by  org.springframework.scheduling.commonj.TimerManagerAccessor
                extended by  org.springframework.scheduling.commonj.TimerManagerFactoryBean
All Implemented Interfaces:
DisposableBean, FactoryBean<commonj.timers.TimerManager>, InitializingBean, Lifecycle
public class TimerManagerFactoryBean
extends TimerManagerAccessor
implements FactoryBean<commonj.timers.TimerManager>, InitializingBean, DisposableBean, Lifecycle

FactoryBean that retrieves a CommonJ TimerManager and exposes it for bean references.

This is the central convenience class for setting up a CommonJ TimerManager in a Spring context.

Allows for registration of ScheduledTimerListeners. This is the main purpose of this class; the TimerManager itself could also be fetched from JNDI via JndiObjectFactoryBean. In scenarios that just require static registration of tasks at startup, there is no need to access the TimerManager itself in application code.

Note that the TimerManager uses a TimerListener instance that is shared between repeated executions, in contrast to Quartz which instantiates a new Job for each execution.

Since:
2.0
Author:
Juergen Hoeller
See Also:
ScheduledTimerListener, TimerManager, TimerListener

Field Summary
Fields inherited from class org.springframework.jndi.JndiLocatorSupport
CONTAINER_PREFIX
Fields inherited from class org.springframework.jndi.JndiAccessor
logger
Constructor Summary
TimerManagerFactoryBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 void destroy()
Cancels all statically registered Timers on shutdown, and stops the underlying TimerManager (if not shared).
 commonj.timers.TimerManager getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<? extends commonj.timers.TimerManager> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setScheduledTimerListeners(ScheduledTimerListener[] scheduledTimerListeners)
Register a list of ScheduledTimerListener objects with the TimerManager that this FactoryBean creates.
Methods inherited from class org.springframework.scheduling.commonj.TimerManagerAccessor
getTimerManager, isRunning, setShared, setTimerManager, setTimerManagerName, start, stop
Methods inherited from class org.springframework.jndi.JndiLocatorSupport
convertJndiName, isResourceRef, lookup, lookup, setResourceRef
Methods inherited from class org.springframework.jndi.JndiAccessor
getJndiEnvironment, getJndiTemplate, setJndiEnvironment, setJndiTemplate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.context.Lifecycle
isRunning, start, stop

Constructor Detail

TimerManagerFactoryBean

public TimerManagerFactoryBean()
Method Detail

setScheduledTimerListeners

public void setScheduledTimerListeners(ScheduledTimerListener[] scheduledTimerListeners)
Register a list of ScheduledTimerListener objects with the TimerManager that this FactoryBean creates. Depending on each ScheduledTimerListener's settings, it will be registered via one of TimerManager's schedule methods.

See Also:
TimerManager.schedule(commonj.timers.TimerListener, long),
TimerManager.schedule(commonj.timers.TimerListener, long, long),
TimerManager.scheduleAtFixedRate(commonj.timers.TimerListener, long, long)

afterPropertiesSet

public void afterPropertiesSet()
                        throws NamingException
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class TimerManagerAccessor
Throws:
NamingException

getObject

public commonj.timers.TimerManager getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<commonj.timers.TimerManager>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends commonj.timers.TimerManager> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<commonj.timers.TimerManager>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<commonj.timers.TimerManager>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()

destroy

public void destroy()
Cancels all statically registered Timers on shutdown, and stops the underlying TimerManager (if not shared).

Specified by:
destroy in interface DisposableBean
Overrides:
destroy in class TimerManagerAccessor
See Also:
Timer.cancel(), TimerManager.stop()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TimerManagerTaskScheduler

org.springframework.scheduling.commonj
Class TimerManagerTaskScheduler

java.lang.Object
    extended by  org.springframework.jndi.JndiAccessor
        extended by  org.springframework.jndi.JndiLocatorSupport
            extended by  org.springframework.scheduling.commonj.TimerManagerAccessor
                extended by  org.springframework.scheduling.commonj.TimerManagerTaskScheduler
All Implemented Interfaces:
DisposableBean, InitializingBean, Lifecycle, TaskScheduler
public class TimerManagerTaskScheduler
extends TimerManagerAccessor
implements TaskScheduler

Implementation of Spring's TaskScheduler interface, wrapping a CommonJ TimerManager.

Since:
3.0
Author:
Juergen Hoeller, Mark Fisher

Field Summary
Fields inherited from class org.springframework.jndi.JndiLocatorSupport
CONTAINER_PREFIX
Fields inherited from class org.springframework.jndi.JndiAccessor
logger
Constructor Summary
TimerManagerTaskScheduler()
Method Summary
ScheduledFuture | schedule(Runnable task, Date startTime) Schedule the given Runnable, invoking it at the specified execution time.
ScheduledFuture | schedule(Runnable task, Trigger trigger) Schedule the given Runnable, invoking it whenever the trigger indicates a next execution time.
ScheduledFuture | scheduleAtFixedRate(Runnable task, Date startTime, long period) Schedule the given Runnable, invoking it at the specified execution time and subsequently with the given period.
ScheduledFuture | scheduleAtFixedRate(Runnable task, long period) Schedule the given Runnable, starting as soon as possible and invoking it with the given period.
ScheduledFuture | scheduleWithFixedDelay(Runnable task, Date startTime, long delay) Schedule the given Runnable, invoking it at the specified execution time and subsequently with the given delay between the completion of one execution and the start of the next.
ScheduledFuture | scheduleWithFixedDelay(Runnable task, long delay) Schedule the given Runnable, starting as soon as possible and invoking it with the given delay between the completion of one execution and the start of the next.
void | setErrorHandler(ErrorHandler errorHandler)
Methods inherited from class org.springframework.scheduling.commonj.TimerManagerAccessor
afterPropertiesSet, destroy, getTimerManager, isRunning, setShared, setTimerManager, setTimerManagerName, start, stop
Methods inherited from class org.springframework.jndi.JndiLocatorSupport
convertJndiName, isResourceRef, lookup, lookup, setResourceRef
Methods inherited from class org.springframework.jndi.JndiAccessor
getJndiEnvironment, getJndiTemplate, setJndiEnvironment, setJndiTemplate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TimerManagerTaskScheduler

public TimerManagerTaskScheduler()
Method Detail

setErrorHandler

public void setErrorHandler(ErrorHandler errorHandler)

schedule

public ScheduledFuture schedule(Runnable task,
                                Trigger trigger)
Description copied from interface: TaskScheduler
Schedule the given Runnable, invoking it whenever the trigger indicates a next execution time.

Execution will end once the scheduler shuts down or the returned ScheduledFuture gets cancelled.

Specified by:
schedule in interface TaskScheduler
Parameters:
task - the Runnable to execute whenever the trigger fires
trigger - an implementation of the Trigger interface, e.g. a CronTrigger object wrapping a cron expression
Returns:
a ScheduledFuture representing pending completion of the task, or null if the given Trigger object never fires (i.e. returns null from Trigger.nextExecutionTime(org.springframework.scheduling.TriggerContext))
See Also:
CronTrigger

schedule

public ScheduledFuture schedule(Runnable task,
                                Date startTime)
Description copied from interface: TaskScheduler
Schedule the given Runnable, invoking it at the specified execution time.

Execution will end once the scheduler shuts down or the returned ScheduledFuture gets cancelled.

Specified by:
schedule in interface TaskScheduler
Parameters:
task - the Runnable to execute whenever the trigger fires
startTime - the desired execution time for the task
Returns:
a ScheduledFuture representing pending completion of the task

scheduleAtFixedRate

public ScheduledFuture scheduleAtFixedRate(Runnable task,
                                           Date startTime,
                                           long period)
Description copied from interface: TaskScheduler
Schedule the given Runnable, invoking it at the specified execution time and subsequently with the given period.

Execution will end once the scheduler shuts down or the returned ScheduledFuture gets cancelled.

Specified by:
scheduleAtFixedRate in interface TaskScheduler
Parameters:
task - the Runnable to execute whenever the trigger fires
startTime - the desired first execution time for the task
period - the interval between successive executions of the task
Returns:
a ScheduledFuture representing pending completion of the task

scheduleAtFixedRate

public ScheduledFuture scheduleAtFixedRate(Runnable task,
                                           long period)
Description copied from interface: TaskScheduler
Schedule the given Runnable, starting as soon as possible and invoking it with the given period.

Execution will end once the scheduler shuts down or the returned ScheduledFuture gets cancelled.

Specified by:
scheduleAtFixedRate in interface TaskScheduler
Parameters:
task - the Runnable to execute whenever the trigger fires
period - the interval between successive executions of the task
Returns:
a ScheduledFuture representing pending completion of the task

scheduleWithFixedDelay

public ScheduledFuture scheduleWithFixedDelay(Runnable task,
                                              Date startTime,
                                              long delay)
Description copied from interface: TaskScheduler
Schedule the given Runnable, invoking it at the specified execution time and subsequently with the given delay between the completion of one execution and the start of the next.

Execution will end once the scheduler shuts down or the returned ScheduledFuture gets cancelled.

Specified by:
scheduleWithFixedDelay in interface TaskScheduler
Parameters:
task - the Runnable to execute whenever the trigger fires
startTime - the desired first execution time for the task
delay - the delay between the completion of one execution and the start of the next
Returns:
a ScheduledFuture representing pending completion of the task

scheduleWithFixedDelay

public ScheduledFuture scheduleWithFixedDelay(Runnable task,
                                              long delay)
Description copied from interface: TaskScheduler
Schedule the given Runnable, starting as soon as possible and invoking it with the given delay between the completion of one execution and the start of the next.

Execution will end once the scheduler shuts down or the returned ScheduledFuture gets cancelled.

Specified by:
scheduleWithFixedDelay in interface TaskScheduler
Parameters:
task - the Runnable to execute whenever the trigger fires
delay - the interval between successive executions of the task
Returns:
a ScheduledFuture representing pending completion of the task
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WorkManagerTaskExecutor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.scheduling.commonj
Class WorkManagerTaskExecutor

java.lang.Object
    extended by  org.springframework.jndi.JndiAccessor
        extended by  org.springframework.jndi.JndiLocatorSupport
            extended by  org.springframework.scheduling.commonj.WorkManagerTaskExecutor
All Implemented Interfaces:
commonj.work.WorkManager, Executor, InitializingBean, AsyncTaskExecutor, TaskExecutor, SchedulingTaskExecutor
public class WorkManagerTaskExecutor
extends JndiLocatorSupport
implements SchedulingTaskExecutor, commonj.work.WorkManager, InitializingBean

TaskExecutor implementation that delegates to a CommonJ WorkManager, implementing the WorkManager interface, which either needs to be specified as reference or through the JNDI name.

This is the central convenience class for setting up a CommonJ WorkManager in a Spring context.

Also implements the CommonJ WorkManager interface itself, delegating all calls to the target WorkManager. Hence, a caller can choose whether it wants to talk to this executor through the Spring TaskExecutor interface or the CommonJ WorkManager interface.

The CommonJ WorkManager will usually be retrieved from the application server's JNDI environment, as defined in the server's management console.

Note: At the time of this writing, the CommonJ WorkManager facility is only supported on IBM WebSphere 6.0+ and BEA WebLogic 9.0+, despite being such a crucial API for an application server. (There is a similar facility available on WebSphere 5.1 Enterprise, though, which we will discuss below.)

On JBoss and GlassFish, a similar facility is available through the JCA WorkManager. See the JBossWorkManagerTaskExecutor GlassFishWorkManagerTaskExecutor classes which are the direct equivalent of this CommonJ adapter class.

A similar facility is available on WebSphere 5.1, under the name "Asynch Beans". Its central interface is called WorkManager too and is also obtained from JNDI, just like a standard CommonJ WorkManager. However, this WorkManager variant is notably different: The central execution method is called "startWork" instead of "schedule", and takes a slightly different Work interface as parameter.

Support for this WebSphere 5.1 variant can be built with this class and its helper DelegatingWork as template: Call the WorkManager's startWork(Work) instead of schedule(Work) in the execute(Runnable) implementation. Furthermore, for simplicity's sake, drop the entire "Implementation of the CommonJ WorkManager interface" section (and the corresponding implements WorkManager clause at the class level). Of course, you also need to change all commonj.work imports in your WorkManagerTaskExecutor and DelegatingWork variants to the corresponding WebSphere API imports (com.ibm.websphere.asynchbeans.WorkManager and com.ibm.websphere.asynchbeans.Work, respectively). This should be sufficient to get a TaskExecutor adapter for WebSphere 5.

Since:
2.0
Author:
Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.jndi.JndiLocatorSupport
CONTAINER_PREFIX
Fields inherited from class org.springframework.jndi.JndiAccessor
logger
Fields inherited from interface org.springframework.core.task.AsyncTaskExecutor
TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE
Fields inherited from interface commonj.work.WorkManager
IMMEDIATE, INDEFINITE
Constructor Summary
WorkManagerTaskExecutor()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 void execute(Runnable task)
Execute the given task.
 void execute(Runnable task, long startTimeout)
Execute the given task.
 boolean prefersShortLivedTasks()
This task executor prefers short-lived work units.
 commonj.work.WorkItem schedule(commonj.work.Work work)
 commonj.work.WorkItem schedule(commonj.work.Work work, commonj.work.WorkListener workListener)
 void setWorkListener(commonj.work.WorkListener workListener)
Specify a CommonJ WorkListener to apply, if any.
 void setWorkManager(commonj.work.WorkManager workManager)
Specify the CommonJ WorkManager to delegate to.
 void setWorkManagerName(String workManagerName)
Set the JNDI name of the CommonJ WorkManager.
<T> Future<T>
submit(Callable<T> task)
Submit a Callable task for execution, receiving a Future representing that task.
 Future<?> submit(Runnable task)
Submit a Runnable task for execution, receiving a Future representing that task.
 boolean waitForAll(Collection workItems, long timeout)
 Collection waitForAny(Collection workItems, long timeout)
Methods inherited from class org.springframework.jndi.JndiLocatorSupport
convertJndiName, isResourceRef, lookup, lookup, setResourceRef
Methods inherited from class org.springframework.jndi.JndiAccessor
getJndiEnvironment, getJndiTemplate, setJndiEnvironment, setJndiTemplate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

WorkManagerTaskExecutor

public WorkManagerTaskExecutor()
Method Detail

setWorkManager

public void setWorkManager(commonj.work.WorkManager workManager)
Specify the CommonJ WorkManager to delegate to.

Alternatively, you can also specify the JNDI name of the target WorkManager.

See Also:
setWorkManagerName(java.lang.String)

setWorkManagerName

public void setWorkManagerName(String workManagerName)
Set the JNDI name of the CommonJ WorkManager.

This can either be a fully qualified JNDI name, or the JNDI name relative to the current environment naming context if "resourceRef" is set to "true".

See Also:
setWorkManager(commonj.work.WorkManager), JndiLocatorSupport.setResourceRef(boolean)

setWorkListener

public void setWorkListener(commonj.work.WorkListener workListener)
Specify a CommonJ WorkListener to apply, if any.

This shared WorkListener instance will be passed on to the WorkManager by all execute(java.lang.Runnable) calls on this TaskExecutor.

afterPropertiesSet

public void afterPropertiesSet()
                        throws NamingException
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
NamingException

execute

public void execute(Runnable task)
Description copied from interface: TaskExecutor
Execute the given task.

The call might return immediately if the implementation uses an asynchronous execution strategy, or might block in the case of synchronous execution.

Specified by:
execute in interface Executor
Specified by:
execute in interface TaskExecutor
Parameters:
task - the Runnable to execute (never null)

execute

public void execute(Runnable task,
                    long startTimeout)
Description copied from interface: AsyncTaskExecutor
Execute the given task.

Specified by:
execute in interface AsyncTaskExecutor
Parameters:
task - the Runnable to execute (never null)
startTimeout - the time duration (milliseconds) within which the task is supposed to start. This is intended as a hint to the executor, allowing for preferred handling of immediate tasks. Typical values are AsyncTaskExecutor.TIMEOUT_IMMEDIATE or AsyncTaskExecutor.TIMEOUT_INDEFINITE (the default as used by TaskExecutor.execute(Runnable)).

submit

public Future<?> submit(Runnable task)
Description copied from interface: AsyncTaskExecutor
Submit a Runnable task for execution, receiving a Future representing that task. The Future will return a null result upon completion.

Specified by:
submit in interface AsyncTaskExecutor
Parameters:
task - the Runnable to execute (never null)
Returns:
a Future representing pending completion of the task

submit

public <T> Future<T> submit(Callable<T> task)
Description copied from interface: AsyncTaskExecutor
Submit a Callable task for execution, receiving a Future representing that task. The Future will return the Callable's result upon completion.

Specified by:
submit in interface AsyncTaskExecutor
Parameters:
task - the Callable to execute (never null)
Returns:
a Future representing pending completion of the task

prefersShortLivedTasks

public boolean prefersShortLivedTasks()
This task executor prefers short-lived work units.

Specified by:
prefersShortLivedTasks in interface SchedulingTaskExecutor
Returns:
true if this TaskExecutor prefers short-lived tasks

schedule

public commonj.work.WorkItem schedule(commonj.work.Work work)
                               throws commonj.work.WorkException,
                                      IllegalArgumentException
Specified by:
schedule in interface commonj.work.WorkManager
Throws:
commonj.work.WorkException
IllegalArgumentException

schedule

public commonj.work.WorkItem schedule(commonj.work.Work work,
                                      commonj.work.WorkListener workListener)
                               throws commonj.work.WorkException,
                                      IllegalArgumentException
Specified by:
schedule in interface commonj.work.WorkManager
Throws:
commonj.work.WorkException
IllegalArgumentException

waitForAll

public boolean waitForAll(Collection workItems,
                          long timeout)
                   throws InterruptedException,
                          IllegalArgumentException
Specified by:
waitForAll in interface commonj.work.WorkManager
Throws:
InterruptedException
IllegalArgumentException

waitForAny

public Collection waitForAny(Collection workItems,
                             long timeout)
                      throws InterruptedException,
                             IllegalArgumentException
Specified by:
waitForAny in interface commonj.work.WorkManager
Throws:
InterruptedException
IllegalArgumentException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.scheduling.concurrent

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.scheduling.concurrent

Scheduling convenience classes for the JDK 1.5+ Executor mechanism in the java.util.concurrent package, allowing to set up a ThreadPoolExecutor or ScheduledThreadPoolExecutor as a bean in a Spring context.

See:
Description

Class Summary
ConcurrentTaskExecutor | Adapter that takes a JDK 1.5 java.util.concurrent.Executor and exposes a Spring TaskExecutor for it.
ConcurrentTaskScheduler | Adapter that takes a JDK 1.5 java.util.concurrent.ScheduledExecutorService and exposes a Spring TaskScheduler for it.
CustomizableThreadFactory | Implementation of the JDK 1.5 ThreadFactory interface, allowing for customizing the created threads (name, priority, etc).
ExecutorConfigurationSupport | Base class for classes that are setting up a java.util.concurrent.ExecutorService (typically a ThreadPoolExecutor).
ScheduledExecutorFactoryBean | FactoryBean that sets up a JDK 1.5 ScheduledExecutorService (by default: a ScheduledThreadPoolExecutor) and exposes it for bean references.
ScheduledExecutorTask | JavaBean that describes a scheduled executor task, consisting of the Runnable and a delay plus period.
ThreadPoolExecutorFactoryBean | JavaBean that allows for configuring a JDK 1.5 ThreadPoolExecutor in bean style (through its "corePoolSize", "maxPoolSize", "keepAliveSeconds", "queueCapacity" properties) and exposing it as a bean reference of its native ExecutorService type.
ThreadPoolTaskExecutor | JavaBean that allows for configuring a JDK 1.5 ThreadPoolExecutor in bean style (through its "corePoolSize", "maxPoolSize", "keepAliveSeconds", "queueCapacity" properties) and exposing it as a Spring TaskExecutor.
ThreadPoolTaskScheduler | Implementation of Spring's TaskScheduler interface, wrapping a native ScheduledThreadPoolExecutor.

Package org.springframework.scheduling.concurrent Description

Scheduling convenience classes for the JDK 1.5+ Executor mechanism in the java.util.concurrent package, allowing to set up a ThreadPoolExecutor or ScheduledThreadPoolExecutor as a bean in a Spring context. Provides support for the native java.util.concurrent interfaces as well as the Spring TaskExecutor mechanism.


org.springframework.scheduling.concurrent Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.scheduling.concurrent

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.scheduling.concurrent.ConcurrentTaskExecutor (implements org.springframework.scheduling.SchedulingTaskExecutor)
      • org.springframework.scheduling.concurrent.ConcurrentTaskScheduler (implements org.springframework.scheduling.TaskScheduler)
    • org.springframework.util.CustomizableThreadCreator (implements java.io.Serializable)
      • org.springframework.scheduling.concurrent.CustomizableThreadFactory (implements java.util.concurrent.ThreadFactory)
        • org.springframework.scheduling.concurrent.ExecutorConfigurationSupport (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean)
          • org.springframework.scheduling.concurrent.ScheduledExecutorFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>)
          • org.springframework.scheduling.concurrent.ThreadPoolExecutorFactoryBean (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
          • org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor (implements org.springframework.scheduling.SchedulingTaskExecutor)
          • org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler (implements org.springframework.scheduling.SchedulingTaskExecutor, org.springframework.scheduling.TaskScheduler)
    • org.springframework.scheduling.concurrent.ScheduledExecutorTask


ConcurrentTaskExecutor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.scheduling.concurrent
Class ConcurrentTaskExecutor

java.lang.Object
    extended by  org.springframework.scheduling.concurrent.ConcurrentTaskExecutor
All Implemented Interfaces:
Executor, AsyncTaskExecutor, TaskExecutor, SchedulingTaskExecutor
Direct Known Subclasses:
ConcurrentTaskScheduler
public class ConcurrentTaskExecutor
extends Object
implements SchedulingTaskExecutor

Adapter that takes a JDK 1.5 java.util.concurrent.Executor and exposes a Spring TaskExecutor for it. Also detects an extended java.util.concurrent.ExecutorService, adapting the AsyncTaskExecutor interface accordingly.

Note that there is a pre-built ThreadPoolTaskExecutor that allows for defining a JDK 1.5 ThreadPoolExecutor in bean style, exposing it as a Spring TaskExecutor directly. This is a convenient alternative to a raw ThreadPoolExecutor definition with a separate definition of the present adapter class.

Since:
2.0
Author:
Juergen Hoeller
See Also:
Executor, ExecutorService, ThreadPoolExecutor, Executors, ThreadPoolTaskExecutor

Field Summary
Fields inherited from interface org.springframework.core.task.AsyncTaskExecutor
TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE
Constructor Summary
ConcurrentTaskExecutor()
Create a new ConcurrentTaskExecutor, using a single thread executor as default.
ConcurrentTaskExecutor(Executor concurrentExecutor)
Create a new ConcurrentTaskExecutor, using the given JDK 1.5 concurrent executor.
Method Summary
 void execute(Runnable task)
Execute the given task.
 void execute(Runnable task, long startTimeout)
Execute the given task.
 Executor getConcurrentExecutor()
Return the JDK 1.5 concurrent executor that this adapter delegates to.
 boolean prefersShortLivedTasks()
This task executor prefers short-lived work units.
 void setConcurrentExecutor(Executor concurrentExecutor)
Specify the JDK 1.5 concurrent executor to delegate to.
<T> Future<T>
submit(Callable<T> task)
Submit a Callable task for execution, receiving a Future representing that task.
 Future<?> submit(Runnable task)
Submit a Runnable task for execution, receiving a Future representing that task.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ConcurrentTaskExecutor

public ConcurrentTaskExecutor()
Create a new ConcurrentTaskExecutor, using a single thread executor as default.

See Also:
Executors.newSingleThreadExecutor()

ConcurrentTaskExecutor

public ConcurrentTaskExecutor(Executor concurrentExecutor)
Create a new ConcurrentTaskExecutor, using the given JDK 1.5 concurrent executor.

Parameters:
concurrentExecutor - the JDK 1.5 concurrent executor to delegate to
Method Detail

setConcurrentExecutor

public final void setConcurrentExecutor(Executor concurrentExecutor)
Specify the JDK 1.5 concurrent executor to delegate to.

getConcurrentExecutor

public final Executor getConcurrentExecutor()
Return the JDK 1.5 concurrent executor that this adapter delegates to.

execute

public void execute(Runnable task)
Description copied from interface: TaskExecutor
Execute the given task.

The call might return immediately if the implementation uses an asynchronous execution strategy, or might block in the case of synchronous execution.

Specified by:
execute in interface Executor
Specified by:
execute in interface TaskExecutor
Parameters:
task - the Runnable to execute (never null)

execute

public void execute(Runnable task,
                    long startTimeout)
Description copied from interface: AsyncTaskExecutor
Execute the given task.

Specified by:
execute in interface AsyncTaskExecutor
Parameters:
task - the Runnable to execute (never null)
startTimeout - the time duration (milliseconds) within which the task is supposed to start. This is intended as a hint to the executor, allowing for preferred handling of immediate tasks. Typical values are AsyncTaskExecutor.TIMEOUT_IMMEDIATE or AsyncTaskExecutor.TIMEOUT_INDEFINITE (the default as used by TaskExecutor.execute(Runnable)).

submit

public Future<?> submit(Runnable task)
Description copied from interface: AsyncTaskExecutor
Submit a Runnable task for execution, receiving a Future representing that task. The Future will return a null result upon completion.

Specified by:
submit in interface AsyncTaskExecutor
Parameters:
task - the Runnable to execute (never null)
Returns:
a Future representing pending completion of the task

submit

public <T> Future<T> submit(Callable<T> task)
Description copied from interface: AsyncTaskExecutor
Submit a Callable task for execution, receiving a Future representing that task. The Future will return the Callable's result upon completion.

Specified by:
submit in interface AsyncTaskExecutor
Parameters:
task - the Callable to execute (never null)
Returns:
a Future representing pending completion of the task

prefersShortLivedTasks

public boolean prefersShortLivedTasks()
This task executor prefers short-lived work units.

Specified by:
prefersShortLivedTasks in interface SchedulingTaskExecutor
Returns:
true if this TaskExecutor prefers short-lived tasks
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ConcurrentTaskScheduler

org.springframework.scheduling.concurrent
Class ConcurrentTaskScheduler

java.lang.Object
    extended by  org.springframework.scheduling.concurrent.ConcurrentTaskExecutor
        extended by  org.springframework.scheduling.concurrent.ConcurrentTaskScheduler
All Implemented Interfaces:
Executor, AsyncTaskExecutor, TaskExecutor, SchedulingTaskExecutor, TaskScheduler
public class ConcurrentTaskScheduler
extends ConcurrentTaskExecutor
implements TaskScheduler

Adapter that takes a JDK 1.5 java.util.concurrent.ScheduledExecutorService and exposes a Spring TaskScheduler for it. Extends ConcurrentTaskExecutor in order to implement the SchedulingTaskExecutor interface as well.

Note that there is a pre-built ThreadPoolTaskScheduler that allows for defining a JDK 1.5 ScheduledThreadPoolExecutor in bean style, exposing it as a Spring TaskScheduler directly. This is a convenient alternative to a raw ScheduledThreadPoolExecutor definition with a separate definition of the present adapter class.

Since:
3.0
Author:
Juergen Hoeller, Mark Fisher
See Also:
ScheduledExecutorService, ScheduledThreadPoolExecutor, Executors, ThreadPoolTaskScheduler

Field Summary
Fields inherited from interface org.springframework.core.task.AsyncTaskExecutor
TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE
Constructor Summary
ConcurrentTaskScheduler()
Create a new ConcurrentTaskScheduler, using a single thread executor as default.
ConcurrentTaskScheduler(Executor concurrentExecutor, ScheduledExecutorService scheduledExecutor)
Create a new ConcurrentTaskScheduler, using the given JDK 1.5 executors as delegates.
ConcurrentTaskScheduler(ScheduledExecutorService scheduledExecutor)
Create a new ConcurrentTaskScheduler, using the given JDK 1.5 executor as shared delegate.
Method Summary
ScheduledFuture | schedule(Runnable task, Date startTime) Schedule the given Runnable, invoking it at the specified execution time.
ScheduledFuture | schedule(Runnable task, Trigger trigger) Schedule the given Runnable, invoking it whenever the trigger indicates a next execution time.
ScheduledFuture | scheduleAtFixedRate(Runnable task, Date startTime, long period) Schedule the given Runnable, invoking it at the specified execution time and subsequently with the given period.
ScheduledFuture | scheduleAtFixedRate(Runnable task, long period) Schedule the given Runnable, starting as soon as possible and invoking it with the given period.
ScheduledFuture | scheduleWithFixedDelay(Runnable task, Date startTime, long delay) Schedule the given Runnable, invoking it at the specified execution time and subsequently with the given delay between the completion of one execution and the start of the next.
ScheduledFuture | scheduleWithFixedDelay(Runnable task, long delay) Schedule the given Runnable, starting as soon as possible and invoking it with the given delay between the completion of one execution and the start of the next.
void | setErrorHandler(ErrorHandler errorHandler) Provide an ErrorHandler strategy.
void | setScheduledExecutor(ScheduledExecutorService scheduledExecutor) Specify the JDK 1.5 scheduled executor to delegate to.
Methods inherited from class org.springframework.scheduling.concurrent.ConcurrentTaskExecutor
execute, execute, getConcurrentExecutor, prefersShortLivedTasks, setConcurrentExecutor, submit, submit
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ConcurrentTaskScheduler

public ConcurrentTaskScheduler()
Create a new ConcurrentTaskScheduler, using a single thread executor as default.

See Also:
Executors.newSingleThreadScheduledExecutor()

ConcurrentTaskScheduler

public ConcurrentTaskScheduler(ScheduledExecutorService scheduledExecutor)
Create a new ConcurrentTaskScheduler, using the given JDK 1.5 executor as shared delegate.

Parameters:
scheduledExecutor - the JDK 1.5 scheduled executor to delegate to for SchedulingTaskExecutor as well as TaskScheduler invocations

ConcurrentTaskScheduler

public ConcurrentTaskScheduler(Executor concurrentExecutor,
                               ScheduledExecutorService scheduledExecutor)
Create a new ConcurrentTaskScheduler, using the given JDK 1.5 executors as delegates.

Parameters:
concurrentExecutor - the JDK 1.5 concurrent executor to delegate to for SchedulingTaskExecutor invocations
scheduledExecutor - the JDK 1.5 scheduled executor to delegate to for TaskScheduler invocations
Method Detail

setScheduledExecutor

public final void setScheduledExecutor(ScheduledExecutorService scheduledExecutor)
Specify the JDK 1.5 scheduled executor to delegate to.

Note: This will only apply to TaskScheduler invocations. If you want the given executor to apply to SchedulingTaskExecutor invocations as well, pass the same executor reference to ConcurrentTaskExecutor.setConcurrentExecutor(java.util.concurrent.Executor).

See Also:
ConcurrentTaskExecutor.setConcurrentExecutor(java.util.concurrent.Executor)

setErrorHandler

public void setErrorHandler(ErrorHandler errorHandler)
Provide an ErrorHandler strategy.

schedule

public ScheduledFuture schedule(Runnable task,
                                Trigger trigger)
Description copied from interface: TaskScheduler
Schedule the given Runnable, invoking it whenever the trigger indicates a next execution time.

Execution will end once the scheduler shuts down or the returned ScheduledFuture gets cancelled.

Specified by:
schedule in interface TaskScheduler
Parameters:
task - the Runnable to execute whenever the trigger fires
trigger - an implementation of the Trigger interface, e.g. a CronTrigger object wrapping a cron expression
Returns:
a ScheduledFuture representing pending completion of the task, or null if the given Trigger object never fires (i.e. returns null from Trigger.nextExecutionTime(org.springframework.scheduling.TriggerContext))
See Also:
CronTrigger

schedule

public ScheduledFuture schedule(Runnable task,
                                Date startTime)
Description copied from interface: TaskScheduler
Schedule the given Runnable, invoking it at the specified execution time.

Execution will end once the scheduler shuts down or the returned ScheduledFuture gets cancelled.

Specified by:
schedule in interface TaskScheduler
Parameters:
task - the Runnable to execute whenever the trigger fires
startTime - the desired execution time for the task
Returns:
a ScheduledFuture representing pending completion of the task

scheduleAtFixedRate

public ScheduledFuture scheduleAtFixedRate(Runnable task,
                                           Date startTime,
                                           long period)
Description copied from interface: TaskScheduler
Schedule the given Runnable, invoking it at the specified execution time and subsequently with the given period.

Execution will end once the scheduler shuts down or the returned ScheduledFuture gets cancelled.

Specified by:
scheduleAtFixedRate in interface TaskScheduler
Parameters:
task - the Runnable to execute whenever the trigger fires
startTime - the desired first execution time for the task
period - the interval between successive executions of the task
Returns:
a ScheduledFuture representing pending completion of the task

scheduleAtFixedRate

public ScheduledFuture scheduleAtFixedRate(Runnable task,
                                           long period)
Description copied from interface: TaskScheduler
Schedule the given Runnable, starting as soon as possible and invoking it with the given period.

Execution will end once the scheduler shuts down or the returned ScheduledFuture gets cancelled.

Specified by:
scheduleAtFixedRate in interface TaskScheduler
Parameters:
task - the Runnable to execute whenever the trigger fires
period - the interval between successive executions of the task
Returns:
a ScheduledFuture representing pending completion of the task

scheduleWithFixedDelay

public ScheduledFuture scheduleWithFixedDelay(Runnable task,
                                              Date startTime,
                                              long delay)
Description copied from interface: TaskScheduler
Schedule the given Runnable, invoking it at the specified execution time and subsequently with the given delay between the completion of one execution and the start of the next.

Execution will end once the scheduler shuts down or the returned ScheduledFuture gets cancelled.

Specified by:
scheduleWithFixedDelay in interface TaskScheduler
Parameters:
task - the Runnable to execute whenever the trigger fires
startTime - the desired first execution time for the task
delay - the delay between the completion of one execution and the start of the next
Returns:
a ScheduledFuture representing pending completion of the task

scheduleWithFixedDelay

public ScheduledFuture scheduleWithFixedDelay(Runnable task,
                                              long delay)
Description copied from interface: TaskScheduler
Schedule the given Runnable, starting as soon as possible and invoking it with the given delay between the completion of one execution and the start of the next.

Execution will end once the scheduler shuts down or the returned ScheduledFuture gets cancelled.

Specified by:
scheduleWithFixedDelay in interface TaskScheduler
Parameters:
task - the Runnable to execute whenever the trigger fires
delay - the interval between successive executions of the task
Returns:
a ScheduledFuture representing pending completion of the task
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CustomizableThreadFactory

org.springframework.scheduling.concurrent
Class CustomizableThreadFactory

java.lang.Object
    extended by  org.springframework.util.CustomizableThreadCreator
        extended by  org.springframework.scheduling.concurrent.CustomizableThreadFactory
All Implemented Interfaces:
Serializable, ThreadFactory
Direct Known Subclasses:
ExecutorConfigurationSupport
public class CustomizableThreadFactory
extends CustomizableThreadCreator
implements ThreadFactory

Implementation of the JDK 1.5 ThreadFactory interface, allowing for customizing the created threads (name, priority, etc).

See the base class CustomizableThreadCreator for details on the available configuration options.

Since:
2.0.3
Author:
Juergen Hoeller
See Also:
CustomizableThreadCreator.setThreadNamePrefix(java.lang.String), CustomizableThreadCreator.setThreadPriority(int), Serialized Form

Constructor Summary
CustomizableThreadFactory()
Create a new CustomizableThreadFactory with default thread name prefix.
CustomizableThreadFactory(String threadNamePrefix)
Create a new CustomizableThreadFactory with the given thread name prefix.
Method Summary
 Thread newThread(Runnable runnable)
Methods inherited from class org.springframework.util.CustomizableThreadCreator
createThread, getDefaultThreadNamePrefix, getThreadGroup, getThreadNamePrefix, getThreadPriority, isDaemon, nextThreadName, setDaemon, setThreadGroup, setThreadGroupName, setThreadNamePrefix, setThreadPriority
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CustomizableThreadFactory

public CustomizableThreadFactory()
Create a new CustomizableThreadFactory with default thread name prefix.

CustomizableThreadFactory

public CustomizableThreadFactory(String threadNamePrefix)
Create a new CustomizableThreadFactory with the given thread name prefix.

Parameters:
threadNamePrefix - the prefix to use for the names of newly created threads
Method Detail

newThread

public Thread newThread(Runnable runnable)
Specified by:
newThread in interface ThreadFactory
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ExecutorConfigurationSupport

org.springframework.scheduling.concurrent
Class ExecutorConfigurationSupport

java.lang.Object
    extended by  org.springframework.util.CustomizableThreadCreator
        extended by  org.springframework.scheduling.concurrent.CustomizableThreadFactory
            extended by  org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
All Implemented Interfaces:
Serializable, ThreadFactory, BeanNameAware, DisposableBean, InitializingBean
Direct Known Subclasses:
ScheduledExecutorFactoryBean, ThreadPoolExecutorFactoryBean, ThreadPoolTaskExecutor, ThreadPoolTaskScheduler
public abstract class ExecutorConfigurationSupport
extends CustomizableThreadFactory
implements BeanNameAware, InitializingBean, DisposableBean

Base class for classes that are setting up a java.util.concurrent.ExecutorService (typically a ThreadPoolExecutor). Defines common configuration settings and common lifecycle handling.

Since:
3.0
Author:
Juergen Hoeller
See Also:
ExecutorService, Executors, ThreadPoolExecutor, Serialized Form

Field Summary
protected  Log logger
Constructor Summary
ExecutorConfigurationSupport()
Method Summary
 void afterPropertiesSet()
Calls initialize() after the container applied all property values.
 void destroy()
Calls shutdown when the BeanFactory destroys the task executor instance.
 void initialize()
Set up the ExecutorService.
protected abstract  ExecutorService initializeExecutor(ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler)
Create the target ExecutorService instance.
 void setBeanName(String name)
Set the name of the bean in the bean factory that created this bean.
 void setRejectedExecutionHandler(RejectedExecutionHandler rejectedExecutionHandler)
Set the RejectedExecutionHandler to use for the ThreadPoolExecutor.
 void setThreadFactory(ThreadFactory threadFactory)
Set the ThreadFactory to use for the ThreadPoolExecutor's thread pool.
 void setThreadNamePrefix(String threadNamePrefix)
Specify the prefix to use for the names of newly created threads.
 void setWaitForTasksToCompleteOnShutdown(boolean waitForJobsToCompleteOnShutdown)
Set whether to wait for scheduled tasks to complete on shutdown.
 void shutdown()
Perform a shutdown on the ThreadPoolExecutor.
Methods inherited from class org.springframework.scheduling.concurrent.CustomizableThreadFactory
newThread
Methods inherited from class org.springframework.util.CustomizableThreadCreator
createThread, getDefaultThreadNamePrefix, getThreadGroup, getThreadNamePrefix, getThreadPriority, isDaemon, nextThreadName, setDaemon, setThreadGroup, setThreadGroupName, setThreadPriority
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Constructor Detail

ExecutorConfigurationSupport

public ExecutorConfigurationSupport()
Method Detail

setThreadFactory

public void setThreadFactory(ThreadFactory threadFactory)
Set the ThreadFactory to use for the ThreadPoolExecutor's thread pool. Default is the ThreadPoolExecutor's default thread factory.

See Also:
Executors.defaultThreadFactory()

setThreadNamePrefix

public void setThreadNamePrefix(String threadNamePrefix)
Description copied from class: CustomizableThreadCreator
Specify the prefix to use for the names of newly created threads. Default is "SimpleAsyncTaskExecutor-".

Overrides:
setThreadNamePrefix in class CustomizableThreadCreator

setRejectedExecutionHandler

public void setRejectedExecutionHandler(RejectedExecutionHandler rejectedExecutionHandler)
Set the RejectedExecutionHandler to use for the ThreadPoolExecutor. Default is the ThreadPoolExecutor's default abort policy.

See Also:
ThreadPoolExecutor.AbortPolicy

setWaitForTasksToCompleteOnShutdown

public void setWaitForTasksToCompleteOnShutdown(boolean waitForJobsToCompleteOnShutdown)
Set whether to wait for scheduled tasks to complete on shutdown.

Default is "false". Switch this to "true" if you prefer fully completed tasks at the expense of a longer shutdown phase.

See Also:
ExecutorService.shutdown(), ExecutorService.shutdownNow()

setBeanName

public void setBeanName(String name)
Description copied from interface: BeanNameAware
Set the name of the bean in the bean factory that created this bean.

Invoked after population of normal bean properties but before an init callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanName in interface BeanNameAware
Parameters:
name - the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use the BeanFactoryUtils.originalBeanName(String) method to extract the original bean name (without suffix), if desired.

afterPropertiesSet

public void afterPropertiesSet()
Calls initialize() after the container applied all property values.

Specified by:
afterPropertiesSet in interface InitializingBean
See Also:
initialize()

initialize

public void initialize()
Set up the ExecutorService.

initializeExecutor

protected abstract ExecutorService initializeExecutor(ThreadFactory threadFactory,
                                                      RejectedExecutionHandler rejectedExecutionHandler)
Create the target ExecutorService instance. Called by afterPropertiesSet.

Parameters:
threadFactory - the ThreadFactory to use
rejectedExecutionHandler - the RejectedExecutionHandler to use
Returns:
a new ExecutorService instance
See Also:
afterPropertiesSet()

destroy

public void destroy()
Calls shutdown when the BeanFactory destroys the task executor instance.

Specified by:
destroy in interface DisposableBean
See Also:
shutdown()

shutdown

public void shutdown()
Perform a shutdown on the ThreadPoolExecutor.

See Also:
ExecutorService.shutdown()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ScheduledExecutorFactoryBean

org.springframework.scheduling.concurrent
Class ScheduledExecutorFactoryBean

java.lang.Object
    extended by  org.springframework.util.CustomizableThreadCreator
        extended by  org.springframework.scheduling.concurrent.CustomizableThreadFactory
            extended by  org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
                extended by  org.springframework.scheduling.concurrent.ScheduledExecutorFactoryBean
All Implemented Interfaces:
Serializable, ThreadFactory, BeanNameAware, DisposableBean, FactoryBean<ScheduledExecutorService>, InitializingBean
public class ScheduledExecutorFactoryBean
extends ExecutorConfigurationSupport
implements FactoryBean<ScheduledExecutorService>

FactoryBean that sets up a JDK 1.5 ScheduledExecutorService (by default: a ScheduledThreadPoolExecutor) and exposes it for bean references.

Allows for registration of ScheduledExecutorTasks, automatically starting the ScheduledExecutorService on initialization and cancelling it on destruction of the context. In scenarios that just require static registration of tasks at startup, there is no need to access the ScheduledExecutorService instance itself in application code.

Note that ScheduledExecutorService uses a Runnable instance that is shared between repeated executions, in contrast to Quartz which instantiates a new Job for each execution.

WARNING: Runnables submitted via a native ScheduledExecutorService are removed from the execution schedule once they throw an exception. If you would prefer to continue execution after such an exception, switch this FactoryBean's "continueScheduledExecutionAfterException" property to "true".

Since:
2.0
Author:
Juergen Hoeller
See Also:
setPoolSize(int), ExecutorConfigurationSupport.setThreadFactory(java.util.concurrent.ThreadFactory), ScheduledExecutorTask, ScheduledExecutorService, ScheduledThreadPoolExecutor, Serialized Form

Field Summary
Fields inherited from class org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
logger
Constructor Summary
ScheduledExecutorFactoryBean()
Method Summary
protected  ScheduledExecutorService createExecutor(int poolSize, ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler)
Create a new ScheduledExecutorService instance.
 ScheduledExecutorService getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<? extends ScheduledExecutorService> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
protected  Runnable getRunnableToSchedule(ScheduledExecutorTask task)
Determine the actual Runnable to schedule for the given task.
protected  ExecutorService initializeExecutor(ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler)
Create the target ExecutorService instance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
protected  void registerTasks(ScheduledExecutorTask[] tasks, ScheduledExecutorService executor)
Register the specified ScheduledExecutorTasks on the given ScheduledExecutorService.
 void setContinueScheduledExecutionAfterException(boolean continueScheduledExecutionAfterException)
Specify whether to continue the execution of a scheduled task after it threw an exception.
 void setExposeUnconfigurableExecutor(boolean exposeUnconfigurableExecutor)
Specify whether this FactoryBean should expose an unconfigurable decorator for the created executor.
 void setPoolSize(int poolSize)
Set the ScheduledExecutorService's pool size.
 void setScheduledExecutorTasks(ScheduledExecutorTask[] scheduledExecutorTasks)
Register a list of ScheduledExecutorTask objects with the ScheduledExecutorService that this FactoryBean creates.
Methods inherited from class org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
afterPropertiesSet, destroy, initialize, setBeanName, setRejectedExecutionHandler, setThreadFactory, setThreadNamePrefix, setWaitForTasksToCompleteOnShutdown, shutdown
Methods inherited from class org.springframework.scheduling.concurrent.CustomizableThreadFactory
newThread
Methods inherited from class org.springframework.util.CustomizableThreadCreator
createThread, getDefaultThreadNamePrefix, getThreadGroup, getThreadNamePrefix, getThreadPriority, isDaemon, nextThreadName, setDaemon, setThreadGroup, setThreadGroupName, setThreadPriority
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ScheduledExecutorFactoryBean

public ScheduledExecutorFactoryBean()
Method Detail

setPoolSize

public void setPoolSize(int poolSize)
Set the ScheduledExecutorService's pool size. Default is 1.

setScheduledExecutorTasks

public void setScheduledExecutorTasks(ScheduledExecutorTask[] scheduledExecutorTasks)
Register a list of ScheduledExecutorTask objects with the ScheduledExecutorService that this FactoryBean creates. Depending on each ScheduledExecutorTask's settings, it will be registered via one of ScheduledExecutorService's schedule methods.

See Also:
ScheduledExecutorService.schedule(java.lang.Runnable, long, java.util.concurrent.TimeUnit),
ScheduledExecutorService.scheduleWithFixedDelay(java.lang.Runnable, long, long, java.util.concurrent.TimeUnit),
ScheduledExecutorService.scheduleAtFixedRate(java.lang.Runnable, long, long, java.util.concurrent.TimeUnit)

setContinueScheduledExecutionAfterException

public void setContinueScheduledExecutionAfterException(boolean continueScheduledExecutionAfterException)
Specify whether to continue the execution of a scheduled task after it threw an exception.

Default is "false", matching the native behavior of a ScheduledExecutorService. Switch this flag to "true" for exception-proof execution of each task, continuing scheduled execution as in the case of successful execution.

See Also:
ScheduledExecutorService.scheduleAtFixedRate(java.lang.Runnable, long, long, java.util.concurrent.TimeUnit)

setExposeUnconfigurableExecutor

public void setExposeUnconfigurableExecutor(boolean exposeUnconfigurableExecutor)
Specify whether this FactoryBean should expose an unconfigurable decorator for the created executor.

Default is "false", exposing the raw executor as bean reference. Switch this flag to "true" to strictly prevent clients from modifying the executor's configuration.

See Also:
Executors.unconfigurableScheduledExecutorService(java.util.concurrent.ScheduledExecutorService)

initializeExecutor

protected ExecutorService initializeExecutor(ThreadFactory threadFactory,
                                             RejectedExecutionHandler rejectedExecutionHandler)
Description copied from class: ExecutorConfigurationSupport
Create the target ExecutorService instance. Called by afterPropertiesSet.

Specified by:
initializeExecutor in class ExecutorConfigurationSupport
Parameters:
threadFactory - the ThreadFactory to use
rejectedExecutionHandler - the RejectedExecutionHandler to use
Returns:
a new ExecutorService instance
See Also:
ExecutorConfigurationSupport.afterPropertiesSet()

createExecutor

protected ScheduledExecutorService createExecutor(int poolSize,
                                                  ThreadFactory threadFactory,
                                                  RejectedExecutionHandler rejectedExecutionHandler)
Create a new ScheduledExecutorService instance.

The default implementation creates a ScheduledThreadPoolExecutor. Can be overridden in subclasses to provide custom ScheduledExecutorService instances.

Parameters:
poolSize - the specified pool size
threadFactory - the ThreadFactory to use
rejectedExecutionHandler - the RejectedExecutionHandler to use
Returns:
a new ScheduledExecutorService instance
See Also:
ExecutorConfigurationSupport.afterPropertiesSet(), ScheduledThreadPoolExecutor

registerTasks

protected void registerTasks(ScheduledExecutorTask[] tasks,
                             ScheduledExecutorService executor)
Register the specified ScheduledExecutorTasks on the given ScheduledExecutorService.

Parameters:
tasks - the specified ScheduledExecutorTasks (never empty)
executor - the ScheduledExecutorService to register the tasks on.

getRunnableToSchedule

protected Runnable getRunnableToSchedule(ScheduledExecutorTask task)
Determine the actual Runnable to schedule for the given task.

Wraps the task's Runnable in a DelegatingErrorHandlingRunnable that will catch and log the Exception. If necessary, it will suppress the Exception according to the "continueScheduledExecutionAfterException" flag.

Parameters:
task - the ScheduledExecutorTask to schedule
Returns:
the actual Runnable to schedule (may be a decorator)

getObject

public ScheduledExecutorService getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<ScheduledExecutorService>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends ScheduledExecutorService> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<ScheduledExecutorService>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<ScheduledExecutorService>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ScheduledExecutorTask

org.springframework.scheduling.concurrent
Class ScheduledExecutorTask

java.lang.Object
    extended by  org.springframework.scheduling.concurrent.ScheduledExecutorTask

public class ScheduledExecutorTask
extends Object

JavaBean that describes a scheduled executor task, consisting of the Runnable and a delay plus period. The period needs to be specified; there is no point in a default for it.

The JDK 1.5 ScheduledExecutorService does not offer more sophisticated scheduling options such as cron expressions. Consider using Quartz for such advanced needs.

Note that the ScheduledExecutorService mechanism uses a Runnable instance that is shared between repeated executions, in contrast to Quartz which creates a new Job instance for each execution.

Since:
2.0
Author:
Juergen Hoeller
See Also:
ScheduledExecutorService.scheduleWithFixedDelay(java.lang.Runnable, long, long, java.util.concurrent.TimeUnit), ScheduledExecutorService.scheduleAtFixedRate(java.lang.Runnable, long, long, java.util.concurrent.TimeUnit)

Constructor Summary
ScheduledExecutorTask()
Create a new ScheduledExecutorTask, to be populated via bean properties.
ScheduledExecutorTask(Runnable executorTask)
Create a new ScheduledExecutorTask, with default one-time execution without delay.
ScheduledExecutorTask(Runnable executorTask, long delay)
Create a new ScheduledExecutorTask, with default one-time execution with the given delay.
ScheduledExecutorTask(Runnable executorTask, long delay, long period, boolean fixedRate)
Create a new ScheduledExecutorTask.
Method Summary
long | getDelay() Return the delay before starting the job for the first time.
long | getPeriod() Return the period between repeated task executions.
Runnable | getRunnable() Return the Runnable to schedule as executor task.
TimeUnit | getTimeUnit() Return the time unit for the delay and period values.
boolean | isFixedRate() Return whether to schedule as fixed-rate execution.
boolean | isOneTimeTask() Is this task only ever going to execute once?
void | setDelay(long delay) Set the delay before starting the task for the first time, in milliseconds.
void | setFixedRate(boolean fixedRate) Set whether to schedule as fixed-rate execution, rather than fixed-delay execution.
void | setPeriod(long period) Set the period between repeated task executions, in milliseconds.
void | setRunnable(Runnable executorTask) Set the Runnable to schedule as executor task.
void | setTimeUnit(TimeUnit timeUnit) Specify the time unit for the delay and period values.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ScheduledExecutorTask

public ScheduledExecutorTask()
Create a new ScheduledExecutorTask, to be populated via bean properties.

See Also:
setDelay(long), setPeriod(long), setFixedRate(boolean)

ScheduledExecutorTask

public ScheduledExecutorTask(Runnable executorTask)
Create a new ScheduledExecutorTask, with default one-time execution without delay.

Parameters:
executorTask - the Runnable to schedule

ScheduledExecutorTask

public ScheduledExecutorTask(Runnable executorTask,
                             long delay)
Create a new ScheduledExecutorTask, with default one-time execution with the given delay.

Parameters:
executorTask - the Runnable to schedule
delay - the delay before starting the task for the first time (ms)

ScheduledExecutorTask

public ScheduledExecutorTask(Runnable executorTask,
                             long delay,
                             long period,
                             boolean fixedRate)
Create a new ScheduledExecutorTask.

Parameters:
executorTask - the Runnable to schedule
delay - the delay before starting the task for the first time (ms)
period - the period between repeated task executions (ms)
fixedRate - whether to schedule as fixed-rate execution
Method Detail

setRunnable

public void setRunnable(Runnable executorTask)
Set the Runnable to schedule as executor task.

getRunnable

public Runnable getRunnable()
Return the Runnable to schedule as executor task.

setDelay

public void setDelay(long delay)
Set the delay before starting the task for the first time, in milliseconds. Default is 0, immediately starting the task after successful scheduling.

getDelay

public long getDelay()
Return the delay before starting the job for the first time.

setPeriod

public void setPeriod(long period)
Set the period between repeated task executions, in milliseconds.

Default is -1, leading to one-time execution. In case of a positive value, the task will be executed repeatedly, with the given interval inbetween executions.

Note that the semantics of the period value vary between fixed-rate and fixed-delay execution.

Note: A period of 0 (for example as fixed delay) is not supported, simply because java.util.concurrent.ScheduledExecutorService itself does not support it. Hence a value of 0 will be treated as one-time execution; however, that value should never be specified explicitly in the first place!

See Also:
setFixedRate(boolean), isOneTimeTask(), ScheduledExecutorService.scheduleWithFixedDelay(java.lang.Runnable, long, long, java.util.concurrent.TimeUnit)

getPeriod

public long getPeriod()
Return the period between repeated task executions.

isOneTimeTask

public boolean isOneTimeTask()
Is this task only ever going to execute once?

Returns:
true if this task is only ever going to execute once
See Also:
getPeriod()

setTimeUnit

public void setTimeUnit(TimeUnit timeUnit)
Specify the time unit for the delay and period values. Default is milliseconds (TimeUnit.MILLISECONDS).

See Also:
TimeUnit.MILLISECONDS, TimeUnit.SECONDS

getTimeUnit

public TimeUnit getTimeUnit()
Return the time unit for the delay and period values.

setFixedRate

public void setFixedRate(boolean fixedRate)
Set whether to schedule as fixed-rate execution, rather than fixed-delay execution. Default is "false", that is, fixed delay.

See ScheduledExecutorService javadoc for details on those execution modes.

See Also:
ScheduledExecutorService.scheduleWithFixedDelay(java.lang.Runnable, long, long, java.util.concurrent.TimeUnit), ScheduledExecutorService.scheduleAtFixedRate(java.lang.Runnable, long, long, java.util.concurrent.TimeUnit)

isFixedRate

public boolean isFixedRate()
Return whether to schedule as fixed-rate execution.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ThreadPoolExecutorFactoryBean

org.springframework.scheduling.concurrent
Class ThreadPoolExecutorFactoryBean

java.lang.Object
    extended by  org.springframework.util.CustomizableThreadCreator
        extended by  org.springframework.scheduling.concurrent.CustomizableThreadFactory
            extended by  org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
                extended by  org.springframework.scheduling.concurrent.ThreadPoolExecutorFactoryBean
All Implemented Interfaces:
Serializable, ThreadFactory, BeanNameAware, DisposableBean, FactoryBean<ExecutorService>, InitializingBean
public class ThreadPoolExecutorFactoryBean
extends ExecutorConfigurationSupport
implements FactoryBean<ExecutorService>, InitializingBean, DisposableBean

JavaBean that allows for configuring a JDK 1.5 ThreadPoolExecutor in bean style (through its "corePoolSize", "maxPoolSize", "keepAliveSeconds", "queueCapacity" properties) and exposing it as a bean reference of its native ExecutorService type.

For an alternative, you may set up a ThreadPoolExecutor instance directly using constructor injection, or use a factory method definition that points to the JDK 1.5 Executors class.

If you need a timing-based ScheduledExecutorService instead, consider ScheduledExecutorFactoryBean.

Since:
3.0
Author:
Juergen Hoeller
See Also:
ExecutorService, Executors, ThreadPoolExecutor, Serialized Form

Field Summary
Fields inherited from class org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
logger
Constructor Summary
ThreadPoolExecutorFactoryBean()
Method Summary
protected  BlockingQueue<Runnable> createQueue(int queueCapacity)
Create the BlockingQueue to use for the ThreadPoolExecutor.
 ExecutorService getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<? extends ExecutorService> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
protected  ExecutorService initializeExecutor(ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler)
Create the target ExecutorService instance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setAllowCoreThreadTimeOut(boolean allowCoreThreadTimeOut)
Specify whether to allow core threads to time out.
 void setCorePoolSize(int corePoolSize)
Set the ThreadPoolExecutor's core pool size.
 void setExposeUnconfigurableExecutor(boolean exposeUnconfigurableExecutor)
Specify whether this FactoryBean should expose an unconfigurable decorator for the created executor.
 void setKeepAliveSeconds(int keepAliveSeconds)
Set the ThreadPoolExecutor's keep-alive seconds.
 void setMaxPoolSize(int maxPoolSize)
Set the ThreadPoolExecutor's maximum pool size.
 void setQueueCapacity(int queueCapacity)
Set the capacity for the ThreadPoolExecutor's BlockingQueue.
Methods inherited from class org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
afterPropertiesSet, destroy, initialize, setBeanName, setRejectedExecutionHandler, setThreadFactory, setThreadNamePrefix, setWaitForTasksToCompleteOnShutdown, shutdown
Methods inherited from class org.springframework.scheduling.concurrent.CustomizableThreadFactory
newThread
Methods inherited from class org.springframework.util.CustomizableThreadCreator
createThread, getDefaultThreadNamePrefix, getThreadGroup, getThreadNamePrefix, getThreadPriority, isDaemon, nextThreadName, setDaemon, setThreadGroup, setThreadGroupName, setThreadPriority
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
Methods inherited from interface org.springframework.beans.factory.DisposableBean
destroy

Constructor Detail

ThreadPoolExecutorFactoryBean

public ThreadPoolExecutorFactoryBean()
Method Detail

setCorePoolSize

public void setCorePoolSize(int corePoolSize)
Set the ThreadPoolExecutor's core pool size. Default is 1.

This setting can be modified at runtime, for example through JMX.

setMaxPoolSize

public void setMaxPoolSize(int maxPoolSize)
Set the ThreadPoolExecutor's maximum pool size. Default is Integer.MAX_VALUE.

This setting can be modified at runtime, for example through JMX.

setKeepAliveSeconds

public void setKeepAliveSeconds(int keepAliveSeconds)
Set the ThreadPoolExecutor's keep-alive seconds. Default is 60.

This setting can be modified at runtime, for example through JMX.

setAllowCoreThreadTimeOut

public void setAllowCoreThreadTimeOut(boolean allowCoreThreadTimeOut)
Specify whether to allow core threads to time out. This enables dynamic growing and shrinking even in combination with a non-zero queue (since the max pool size will only grow once the queue is full).

Default is "false". Note that this feature is only available on Java 6 or above. On Java 5, consider switching to the backport-concurrent version of ThreadPoolTaskExecutor which also supports this feature.

See Also:
ThreadPoolExecutor.allowCoreThreadTimeOut(boolean)

setQueueCapacity

public void setQueueCapacity(int queueCapacity)
Set the capacity for the ThreadPoolExecutor's BlockingQueue. Default is Integer.MAX_VALUE.

Any positive value will lead to a LinkedBlockingQueue instance; any other value will lead to a SynchronousQueue instance.

See Also:
LinkedBlockingQueue, SynchronousQueue

setExposeUnconfigurableExecutor

public void setExposeUnconfigurableExecutor(boolean exposeUnconfigurableExecutor)
Specify whether this FactoryBean should expose an unconfigurable decorator for the created executor.

Default is "false", exposing the raw executor as bean reference. Switch this flag to "true" to strictly prevent clients from modifying the executor's configuration.

See Also:
Executors.unconfigurableScheduledExecutorService(java.util.concurrent.ScheduledExecutorService)

initializeExecutor

protected ExecutorService initializeExecutor(ThreadFactory threadFactory,
                                             RejectedExecutionHandler rejectedExecutionHandler)
Description copied from class: ExecutorConfigurationSupport
Create the target ExecutorService instance. Called by afterPropertiesSet.

Specified by:
initializeExecutor in class ExecutorConfigurationSupport
Parameters:
threadFactory - the ThreadFactory to use
rejectedExecutionHandler - the RejectedExecutionHandler to use
Returns:
a new ExecutorService instance
See Also:
ExecutorConfigurationSupport.afterPropertiesSet()

createQueue

protected BlockingQueue<Runnable> createQueue(int queueCapacity)
Create the BlockingQueue to use for the ThreadPoolExecutor.

A LinkedBlockingQueue instance will be created for a positive capacity value; a SynchronousQueue else.

Parameters:
queueCapacity - the specified queue capacity
Returns:
the BlockingQueue instance
See Also:
LinkedBlockingQueue, SynchronousQueue

getObject

public ExecutorService getObject()
                          throws Exception
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<ExecutorService>
Returns:
an instance of the bean (can be null)
Throws:
Exception - in case of creation errors
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends ExecutorService> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<ExecutorService>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<ExecutorService>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ThreadPoolTaskExecutor

org.springframework.scheduling.concurrent
Class ThreadPoolTaskExecutor

java.lang.Object
    extended by  org.springframework.util.CustomizableThreadCreator
        extended by  org.springframework.scheduling.concurrent.CustomizableThreadFactory
            extended by  org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
                extended by  org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
All Implemented Interfaces:
Serializable, Executor, ThreadFactory, BeanNameAware, DisposableBean, InitializingBean, AsyncTaskExecutor, TaskExecutor, SchedulingTaskExecutor
public class ThreadPoolTaskExecutor
extends ExecutorConfigurationSupport
implements SchedulingTaskExecutor

JavaBean that allows for configuring a JDK 1.5 ThreadPoolExecutor in bean style (through its "corePoolSize", "maxPoolSize", "keepAliveSeconds", "queueCapacity" properties) and exposing it as a Spring TaskExecutor. This class is also well suited for management and monitoring (e.g. through JMX), providing several useful attributes: "corePoolSize", "maxPoolSize", "keepAliveSeconds" (all supporting updates at runtime); "poolSize", "activeCount" (for introspection only).

For an alternative, you may set up a ThreadPoolExecutor instance directly using constructor injection, or use a factory method definition that points to the JDK 1.5 Executors class. To expose such a raw Executor as a Spring TaskExecutor, simply wrap it with a ConcurrentTaskExecutor adapter.

NOTE: This class implements Spring's TaskExecutor interface as well as the JDK 1.5 Executor interface, with the former being the primary interface, the other just serving as secondary convenience. For this reason, the exception handling follows the TaskExecutor contract rather than the Executor contract, in particular regarding the TaskRejectedException.

If you prefer native ExecutorService exposure instead, consider ThreadPoolExecutorFactoryBean as an alternative to this class.

Since:
2.0
Author:
Juergen Hoeller
See Also:
TaskExecutor, ThreadPoolExecutor, ConcurrentTaskExecutor, Serialized Form

Field Summary
Fields inherited from class org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
logger
Fields inherited from interface org.springframework.core.task.AsyncTaskExecutor
TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE
Constructor Summary
ThreadPoolTaskExecutor()
Method Summary
protected  BlockingQueue<Runnable> createQueue(int queueCapacity)
Create the BlockingQueue to use for the ThreadPoolExecutor.
 void execute(Runnable task)
Execute the given task.
 void execute(Runnable task, long startTimeout)
Execute the given task.
 int getActiveCount()
Return the number of currently active threads.
 int getCorePoolSize()
Return the ThreadPoolExecutor's core pool size.
 int getKeepAliveSeconds()
Return the ThreadPoolExecutor's keep-alive seconds.
 int getMaxPoolSize()
Return the ThreadPoolExecutor's maximum pool size.
 int getPoolSize()
Return the current pool size.
 ThreadPoolExecutor getThreadPoolExecutor()
Return the underlying ThreadPoolExecutor for native access.
protected  ExecutorService initializeExecutor(ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler)
Create the target ExecutorService instance.
 boolean prefersShortLivedTasks()
This task executor prefers short-lived work units.
 void setAllowCoreThreadTimeOut(boolean allowCoreThreadTimeOut)
Specify whether to allow core threads to time out.
 void setCorePoolSize(int corePoolSize)
Set the ThreadPoolExecutor's core pool size.
 void setKeepAliveSeconds(int keepAliveSeconds)
Set the ThreadPoolExecutor's keep-alive seconds.
 void setMaxPoolSize(int maxPoolSize)
Set the ThreadPoolExecutor's maximum pool size.
 void setQueueCapacity(int queueCapacity)
Set the capacity for the ThreadPoolExecutor's BlockingQueue.
<T> Future<T>
submit(Callable<T> task)
Submit a Callable task for execution, receiving a Future representing that task.
 Future<?> submit(Runnable task)
Submit a Runnable task for execution, receiving a Future representing that task.
Methods inherited from class org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
afterPropertiesSet, destroy, initialize, setBeanName, setRejectedExecutionHandler, setThreadFactory, setThreadNamePrefix, setWaitForTasksToCompleteOnShutdown, shutdown
Methods inherited from class org.springframework.scheduling.concurrent.CustomizableThreadFactory
newThread
Methods inherited from class org.springframework.util.CustomizableThreadCreator
createThread, getDefaultThreadNamePrefix, getThreadGroup, getThreadNamePrefix, getThreadPriority, isDaemon, nextThreadName, setDaemon, setThreadGroup, setThreadGroupName, setThreadPriority
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ThreadPoolTaskExecutor

public ThreadPoolTaskExecutor()
Method Detail

setCorePoolSize

public void setCorePoolSize(int corePoolSize)
Set the ThreadPoolExecutor's core pool size. Default is 1.

This setting can be modified at runtime, for example through JMX.

getCorePoolSize

public int getCorePoolSize()
Return the ThreadPoolExecutor's core pool size.

setMaxPoolSize

public void setMaxPoolSize(int maxPoolSize)
Set the ThreadPoolExecutor's maximum pool size. Default is Integer.MAX_VALUE.

This setting can be modified at runtime, for example through JMX.

getMaxPoolSize

public int getMaxPoolSize()
Return the ThreadPoolExecutor's maximum pool size.

setKeepAliveSeconds

public void setKeepAliveSeconds(int keepAliveSeconds)
Set the ThreadPoolExecutor's keep-alive seconds. Default is 60.

This setting can be modified at runtime, for example through JMX.

getKeepAliveSeconds

public int getKeepAliveSeconds()
Return the ThreadPoolExecutor's keep-alive seconds.

setAllowCoreThreadTimeOut

public void setAllowCoreThreadTimeOut(boolean allowCoreThreadTimeOut)
Specify whether to allow core threads to time out. This enables dynamic growing and shrinking even in combination with a non-zero queue (since the max pool size will only grow once the queue is full).

Default is "false". Note that this feature is only available on Java 6 or above. On Java 5, consider switching to the backport-concurrent version of ThreadPoolTaskExecutor which also supports this feature.

See Also:
ThreadPoolExecutor.allowCoreThreadTimeOut(boolean)

setQueueCapacity

public void setQueueCapacity(int queueCapacity)
Set the capacity for the ThreadPoolExecutor's BlockingQueue. Default is Integer.MAX_VALUE.

Any positive value will lead to a LinkedBlockingQueue instance; any other value will lead to a SynchronousQueue instance.

See Also:
LinkedBlockingQueue, SynchronousQueue

initializeExecutor

protected ExecutorService initializeExecutor(ThreadFactory threadFactory,
                                             RejectedExecutionHandler rejectedExecutionHandler)
Description copied from class: ExecutorConfigurationSupport
Create the target ExecutorService instance. Called by afterPropertiesSet.

Specified by:
initializeExecutor in class ExecutorConfigurationSupport
Parameters:
threadFactory - the ThreadFactory to use
rejectedExecutionHandler - the RejectedExecutionHandler to use
Returns:
a new ExecutorService instance
See Also:
ExecutorConfigurationSupport.afterPropertiesSet()

createQueue

protected BlockingQueue<Runnable> createQueue(int queueCapacity)
Create the BlockingQueue to use for the ThreadPoolExecutor.

A LinkedBlockingQueue instance will be created for a positive capacity value; a SynchronousQueue else.

Parameters:
queueCapacity - the specified queue capacity
Returns:
the BlockingQueue instance
See Also:
LinkedBlockingQueue, SynchronousQueue

getThreadPoolExecutor

public ThreadPoolExecutor getThreadPoolExecutor()
                                         throws IllegalStateException
Return the underlying ThreadPoolExecutor for native access.

Returns:
the underlying ThreadPoolExecutor (never null)
Throws:
IllegalStateException - if the ThreadPoolTaskExecutor hasn't been initialized yet

getPoolSize

public int getPoolSize()
Return the current pool size.

See Also:
ThreadPoolExecutor.getPoolSize()

getActiveCount

public int getActiveCount()
Return the number of currently active threads.

See Also:
ThreadPoolExecutor.getActiveCount()

execute

public void execute(Runnable task)
Description copied from interface: TaskExecutor
Execute the given task.

The call might return immediately if the implementation uses an asynchronous execution strategy, or might block in the case of synchronous execution.

Specified by:
execute in interface Executor
Specified by:
execute in interface TaskExecutor
Parameters:
task - the Runnable to execute (never null)

execute

public void execute(Runnable task,
                    long startTimeout)
Description copied from interface: AsyncTaskExecutor
Execute the given task.

Specified by:
execute in interface AsyncTaskExecutor
Parameters:
task - the Runnable to execute (never null)
startTimeout - the time duration (milliseconds) within which the task is supposed to start. This is intended as a hint to the executor, allowing for preferred handling of immediate tasks. Typical values are AsyncTaskExecutor.TIMEOUT_IMMEDIATE or AsyncTaskExecutor.TIMEOUT_INDEFINITE (the default as used by TaskExecutor.execute(Runnable)).

submit

public Future<?> submit(Runnable task)
Description copied from interface: AsyncTaskExecutor
Submit a Runnable task for execution, receiving a Future representing that task. The Future will return a null result upon completion.

Specified by:
submit in interface AsyncTaskExecutor
Parameters:
task - the Runnable to execute (never null)
Returns:
a Future representing pending completion of the task

submit

public <T> Future<T> submit(Callable<T> task)
Description copied from interface: AsyncTaskExecutor
Submit a Callable task for execution, receiving a Future representing that task. The Future will return the Callable's result upon completion.

Specified by:
submit in interface AsyncTaskExecutor
Parameters:
task - the Callable to execute (never null)
Returns:
a Future representing pending completion of the task

prefersShortLivedTasks

public boolean prefersShortLivedTasks()
This task executor prefers short-lived work units.

Specified by:
prefersShortLivedTasks in interface SchedulingTaskExecutor
Returns:
true if this TaskExecutor prefers short-lived tasks
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ThreadPoolTaskScheduler

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.scheduling.concurrent
Class ThreadPoolTaskScheduler

java.lang.Object
    extended by  org.springframework.util.CustomizableThreadCreator
        extended by  org.springframework.scheduling.concurrent.CustomizableThreadFactory
            extended by  org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
                extended by  org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
All Implemented Interfaces:
Serializable, Executor, ThreadFactory, BeanNameAware, DisposableBean, InitializingBean, AsyncTaskExecutor, TaskExecutor, SchedulingTaskExecutor, TaskScheduler
public class ThreadPoolTaskScheduler
extends ExecutorConfigurationSupport
implements TaskScheduler, SchedulingTaskExecutor

Implementation of Spring's TaskScheduler interface, wrapping a native ScheduledThreadPoolExecutor.

Since:
3.0
Author:
Juergen Hoeller, Mark Fisher
See Also:
setPoolSize(int), ExecutorConfigurationSupport.setThreadFactory(java.util.concurrent.ThreadFactory), setErrorHandler(org.springframework.util.ErrorHandler), Serialized Form

Field Summary
Fields inherited from class org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
logger
Fields inherited from interface org.springframework.core.task.AsyncTaskExecutor
TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE
Constructor Summary
ThreadPoolTaskScheduler()
Method Summary
protected  ScheduledExecutorService createExecutor(int poolSize, ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler)
Create a new ScheduledExecutorService instance.
 void execute(Runnable task)
Execute the given task.
 void execute(Runnable task, long startTimeout)
Execute the given task.
 ScheduledExecutorService getScheduledExecutor()
Return the underlying ScheduledExecutorService for native access.
protected  ExecutorService initializeExecutor(ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler)
Create the target ExecutorService instance.
 boolean prefersShortLivedTasks()
Does this TaskExecutor prefer short-lived tasks over long-lived tasks?
 ScheduledFuture schedule(Runnable task, Date startTime)
Schedule the given Runnable, invoking it at the specified execution time.
 ScheduledFuture schedule(Runnable task, Trigger trigger)
Schedule the given Runnable, invoking it whenever the trigger indicates a next execution time.
 ScheduledFuture scheduleAtFixedRate(Runnable task, Date startTime, long period)
Schedule the given Runnable, invoking it at the specified execution time and subsequently with the given period.
 ScheduledFuture scheduleAtFixedRate(Runnable task, long period)
Schedule the given Runnable, starting as soon as possible and invoking it with the given period.
 ScheduledFuture scheduleWithFixedDelay(Runnable task, Date startTime, long delay)
Schedule the given Runnable, invoking it at the specified execution time and subsequently with the given delay between the completion of one execution and the start of the next.
 ScheduledFuture scheduleWithFixedDelay(Runnable task, long delay)
Schedule the given Runnable, starting as soon as possible and invoking it with the given delay between the completion of one execution and the start of the next.
 void setErrorHandler(ErrorHandler errorHandler)
Provide an ErrorHandler strategy.
 void setPoolSize(int poolSize)
Set the ScheduledExecutorService's pool size.
<T> Future<T>
submit(Callable<T> task)
Submit a Callable task for execution, receiving a Future representing that task.
 Future<?> submit(Runnable task)
Submit a Runnable task for execution, receiving a Future representing that task.
Methods inherited from class org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
afterPropertiesSet, destroy, initialize, setBeanName, setRejectedExecutionHandler, setThreadFactory, setThreadNamePrefix, setWaitForTasksToCompleteOnShutdown, shutdown
Methods inherited from class org.springframework.scheduling.concurrent.CustomizableThreadFactory
newThread
Methods inherited from class org.springframework.util.CustomizableThreadCreator
createThread, getDefaultThreadNamePrefix, getThreadGroup, getThreadNamePrefix, getThreadPriority, isDaemon, nextThreadName, setDaemon, setThreadGroup, setThreadGroupName, setThreadPriority
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ThreadPoolTaskScheduler

public ThreadPoolTaskScheduler()
Method Detail

setPoolSize

public void setPoolSize(int poolSize)
Set the ScheduledExecutorService's pool size. Default is 1.

setErrorHandler

public void setErrorHandler(ErrorHandler errorHandler)
Provide an ErrorHandler strategy.

initializeExecutor

protected ExecutorService initializeExecutor(ThreadFactory threadFactory,
                                             RejectedExecutionHandler rejectedExecutionHandler)
Description copied from class: ExecutorConfigurationSupport
Create the target ExecutorService instance. Called by afterPropertiesSet.

Specified by:
initializeExecutor in class ExecutorConfigurationSupport
Parameters:
threadFactory - the ThreadFactory to use
rejectedExecutionHandler - the RejectedExecutionHandler to use
Returns:
a new ExecutorService instance
See Also:
ExecutorConfigurationSupport.afterPropertiesSet()

createExecutor

protected ScheduledExecutorService createExecutor(int poolSize,
                                                  ThreadFactory threadFactory,
                                                  RejectedExecutionHandler rejectedExecutionHandler)
Create a new ScheduledExecutorService instance.

The default implementation creates a ScheduledThreadPoolExecutor. Can be overridden in subclasses to provide custom ScheduledExecutorService instances.

Parameters:
poolSize - the specified pool size
threadFactory - the ThreadFactory to use
rejectedExecutionHandler - the RejectedExecutionHandler to use
Returns:
a new ScheduledExecutorService instance
See Also:
ExecutorConfigurationSupport.afterPropertiesSet(), ScheduledThreadPoolExecutor

getScheduledExecutor

public ScheduledExecutorService getScheduledExecutor()
                                              throws IllegalStateException
Return the underlying ScheduledExecutorService for native access.

Returns:
the underlying ScheduledExecutorService (never null)
Throws:
IllegalStateException - if the ThreadPoolTaskScheduler hasn't been initialized yet

execute

public void execute(Runnable task)
Description copied from interface: TaskExecutor
Execute the given task.

The call might return immediately if the implementation uses an asynchronous execution strategy, or might block in the case of synchronous execution.

Specified by:
execute in interface Executor
Specified by:
execute in interface TaskExecutor
Parameters:
task - the Runnable to execute (never null)

execute

public void execute(Runnable task,
                    long startTimeout)
Description copied from interface: AsyncTaskExecutor
Execute the given task.

Specified by:
execute in interface AsyncTaskExecutor
Parameters:
task - the Runnable to execute (never null)
startTimeout - the time duration (milliseconds) within which the task is supposed to start. This is intended as a hint to the executor, allowing for preferred handling of immediate tasks. Typical values are AsyncTaskExecutor.TIMEOUT_IMMEDIATE or AsyncTaskExecutor.TIMEOUT_INDEFINITE (the default as used by TaskExecutor.execute(Runnable)).

submit

public Future<?> submit(Runnable task)
Description copied from interface: AsyncTaskExecutor
Submit a Runnable task for execution, receiving a Future representing that task. The Future will return a null result upon completion.

Specified by:
submit in interface AsyncTaskExecutor
Parameters:
task - the Runnable to execute (never null)
Returns:
a Future representing pending completion of the task

submit

public <T> Future<T> submit(Callable<T> task)
Description copied from interface: AsyncTaskExecutor
Submit a Callable task for execution, receiving a Future representing that task. The Future will return the Callable's result upon completion.

Specified by:
submit in interface AsyncTaskExecutor
Parameters:
task - the Callable to execute (never null)
Returns:
a Future representing pending completion of the task

prefersShortLivedTasks

public boolean prefersShortLivedTasks()
Description copied from interface: SchedulingTaskExecutor
Does this TaskExecutor prefer short-lived tasks over long-lived tasks?

A SchedulingTaskExecutor implementation can indicate whether it prefers submitted tasks to perform as little work as they can within a single task execution. For example, submitted tasks might break a repeated loop into individual subtasks which submit a follow-up task afterwards (if feasible).

This should be considered a hint. Of course TaskExecutor clients are free to ignore this flag and hence the SchedulingTaskExecutor interface overall. However, thread pools will usually indicated a preference for short-lived tasks, to be able to perform more fine-grained scheduling.

Specified by:
prefersShortLivedTasks in interface SchedulingTaskExecutor
Returns:
true if this TaskExecutor prefers short-lived tasks

schedule

public ScheduledFuture schedule(Runnable task,
                                Trigger trigger)
Description copied from interface: TaskScheduler
Schedule the given Runnable, invoking it whenever the trigger indicates a next execution time.

Execution will end once the scheduler shuts down or the returned ScheduledFuture gets cancelled.

Specified by:
schedule in interface TaskScheduler
Parameters:
task - the Runnable to execute whenever the trigger fires
trigger - an implementation of the Trigger interface, e.g. a CronTrigger object wrapping a cron expression
Returns:
a ScheduledFuture representing pending completion of the task, or null if the given Trigger object never fires (i.e. returns null from Trigger.nextExecutionTime(org.springframework.scheduling.TriggerContext))
See Also:
CronTrigger

schedule

public ScheduledFuture schedule(Runnable task,
                                Date startTime)
Description copied from interface: TaskScheduler
Schedule the given Runnable, invoking it at the specified execution time.

Execution will end once the scheduler shuts down or the returned ScheduledFuture gets cancelled.

Specified by:
schedule in interface TaskScheduler
Parameters:
task - the Runnable to execute whenever the trigger fires
startTime - the desired execution time for the task
Returns:
a ScheduledFuture representing pending completion of the task

scheduleAtFixedRate

public ScheduledFuture scheduleAtFixedRate(Runnable task,
                                           Date startTime,
                                           long period)
Description copied from interface: TaskScheduler
Schedule the given Runnable, invoking it at the specified execution time and subsequently with the given period.

Execution will end once the scheduler shuts down or the returned ScheduledFuture gets cancelled.

Specified by:
scheduleAtFixedRate in interface TaskScheduler
Parameters:
task - the Runnable to execute whenever the trigger fires
startTime - the desired first execution time for the task
period - the interval between successive executions of the task
Returns:
a ScheduledFuture representing pending completion of the task

scheduleAtFixedRate

public ScheduledFuture scheduleAtFixedRate(Runnable task,
                                           long period)
Description copied from interface: TaskScheduler
Schedule the given Runnable, starting as soon as possible and invoking it with the given period.

Execution will end once the scheduler shuts down or the returned ScheduledFuture gets cancelled.

Specified by:
scheduleAtFixedRate in interface TaskScheduler
Parameters:
task - the Runnable to execute whenever the trigger fires
period - the interval between successive executions of the task
Returns:
a ScheduledFuture representing pending completion of the task

scheduleWithFixedDelay

public ScheduledFuture scheduleWithFixedDelay(Runnable task,
                                              Date startTime,
                                              long delay)
Description copied from interface: TaskScheduler
Schedule the given Runnable, invoking it at the specified execution time and subsequently with the given delay between the completion of one execution and the start of the next.

Execution will end once the scheduler shuts down or the returned ScheduledFuture gets cancelled.

Specified by:
scheduleWithFixedDelay in interface TaskScheduler
Parameters:
task - the Runnable to execute whenever the trigger fires
startTime - the desired first execution time for the task
delay - the delay between the completion of one execution and the start of the next
Returns:
a ScheduledFuture representing pending completion of the task

scheduleWithFixedDelay

public ScheduledFuture scheduleWithFixedDelay(Runnable task,
                                              long delay)
Description copied from interface: TaskScheduler
Schedule the given Runnable, starting as soon as possible and invoking it with the given delay between the completion of one execution and the start of the next.

Execution will end once the scheduler shuts down or the returned ScheduledFuture gets cancelled.

Specified by:
scheduleWithFixedDelay in interface TaskScheduler
Parameters:
task - the Runnable to execute whenever the trigger fires
delay - the interval between successive executions of the task
Returns:
a ScheduledFuture representing pending completion of the task
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.scheduling.config

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.scheduling.config

Class Summary
AnnotationDrivenBeanDefinitionParser | Parser for the 'annotation-driven' element of the 'task' namespace.
ExecutorBeanDefinitionParser | Parser for the 'executor' element of the 'task' namespace.
ScheduledTaskRegistrar | Helper bean for registering tasks with a TaskScheduler, typically using cron expressions.
ScheduledTasksBeanDefinitionParser | Parser for the 'scheduled-tasks' element of the scheduling namespace.
SchedulerBeanDefinitionParser | Parser for the 'scheduler' element of the 'task' namespace.
TaskExecutorFactoryBean | FactoryBean for creating TaskExecutor instances.
TaskNamespaceHandler | NamespaceHandler for the 'task' namespace.


org.springframework.scheduling.config Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.scheduling.config

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.beans.factory.xml.AbstractBeanDefinitionParser (implements org.springframework.beans.factory.xml.BeanDefinitionParser)
      • org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
        • org.springframework.scheduling.config.ExecutorBeanDefinitionParser
        • org.springframework.scheduling.config.ScheduledTasksBeanDefinitionParser
        • org.springframework.scheduling.config.SchedulerBeanDefinitionParser
    • org.springframework.scheduling.config.AnnotationDrivenBeanDefinitionParser (implements org.springframework.beans.factory.xml.BeanDefinitionParser)
    • org.springframework.beans.factory.xml.NamespaceHandlerSupport (implements org.springframework.beans.factory.xml.NamespaceHandler)
      • org.springframework.scheduling.config.TaskNamespaceHandler
    • org.springframework.scheduling.config.ScheduledTaskRegistrar (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean)
    • org.springframework.scheduling.config.TaskExecutorFactoryBean (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>)


AnnotationDrivenBeanDefinitionParser

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.scheduling.config
Class AnnotationDrivenBeanDefinitionParser

java.lang.Object
    extended by  org.springframework.scheduling.config.AnnotationDrivenBeanDefinitionParser
All Implemented Interfaces:
BeanDefinitionParser
public class AnnotationDrivenBeanDefinitionParser
extends Object
implements BeanDefinitionParser

Parser for the 'annotation-driven' element of the 'task' namespace.

Since:
3.0
Author:
Mark Fisher

Field Summary
static String | ASYNC_ANNOTATION_PROCESSOR_BEAN_NAME The bean name of the internally managed async annotation processor.
static String | SCHEDULED_ANNOTATION_PROCESSOR_BEAN_NAME The bean name of the internally managed scheduled annotation processor.
Constructor Summary
AnnotationDrivenBeanDefinitionParser()
Method Summary
 BeanDefinition parse(Element element, ParserContext parserContext)
Parse the specified Element and register the resulting BeanDefinition(s) with the ParserContext.getRegistry() BeanDefinitionRegistry} embedded in the supplied ParserContext.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

ASYNC_ANNOTATION_PROCESSOR_BEAN_NAME

public static final String ASYNC_ANNOTATION_PROCESSOR_BEAN_NAME
The bean name of the internally managed async annotation processor.

See Also:
Constant Field Values

SCHEDULED_ANNOTATION_PROCESSOR_BEAN_NAME

public static final String SCHEDULED_ANNOTATION_PROCESSOR_BEAN_NAME
The bean name of the internally managed scheduled annotation processor.

See Also:
Constant Field Values
Constructor Detail

AnnotationDrivenBeanDefinitionParser

public AnnotationDrivenBeanDefinitionParser()
Method Detail

parse

public BeanDefinition parse(Element element,
                            ParserContext parserContext)
Description copied from interface: BeanDefinitionParser
Parse the specified Element and register the resulting BeanDefinition(s) with the ParserContext.getRegistry() BeanDefinitionRegistry} embedded in the supplied ParserContext.

Implementations must return the primary BeanDefinition that results from the parse if they will ever be used in a nested fashion (for example as an inner tag in a <property/> tag). Implementations may return null if they will not be used in a nested fashion.

Specified by:
parse in interface BeanDefinitionParser
Parameters:
element - the element that is to be parsed into one or more BeanDefinitions
parserContext - the object encapsulating the current state of the parsing process; provides access to a BeanDefinitionRegistry
Returns:
the primary BeanDefinition
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ExecutorBeanDefinitionParser

org.springframework.scheduling.config
Class ExecutorBeanDefinitionParser

java.lang.Object
    extended by  org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
        extended by  org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
            extended by  org.springframework.scheduling.config.ExecutorBeanDefinitionParser
All Implemented Interfaces:
BeanDefinitionParser
public class ExecutorBeanDefinitionParser
extends AbstractSingleBeanDefinitionParser

Parser for the 'executor' element of the 'task' namespace.

Since:
3.0
Author:
Mark Fisher, Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
ID_ATTRIBUTE, NAME_ATTRIBUTE
Constructor Summary
ExecutorBeanDefinitionParser()
Method Summary
protected void | doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) Parse the supplied Element and populate the supplied BeanDefinitionBuilder as required.
protected String | getBeanClassName(Element element) Determine the bean class name corresponding to the supplied Element.
Methods inherited from class org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
doParse, getBeanClass, getParentName, parseInternal
Methods inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
parse, postProcessComponentDefinition, registerBeanDefinition, resolveId, shouldFireEvents, shouldGenerateId, shouldGenerateIdAsFallback
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ExecutorBeanDefinitionParser

public ExecutorBeanDefinitionParser()
Method Detail

getBeanClassName

protected String getBeanClassName(Element element)
Description copied from class: AbstractSingleBeanDefinitionParser
Determine the bean class name corresponding to the supplied Element.

Overrides:
getBeanClassName in class AbstractSingleBeanDefinitionParser
Parameters:
element - the Element that is being parsed
Returns:
the class name of the bean that is being defined via parsing the supplied Element, or null if none
See Also:
AbstractSingleBeanDefinitionParser.getBeanClass(org.w3c.dom.Element)

doParse

protected void doParse(Element element,
                       ParserContext parserContext,
                       BeanDefinitionBuilder builder)
Description copied from class: AbstractSingleBeanDefinitionParser
Parse the supplied Element and populate the supplied BeanDefinitionBuilder as required.

The default implementation delegates to the doParse version without ParserContext argument.

Overrides:
doParse in class AbstractSingleBeanDefinitionParser
Parameters:
element - the XML element being parsed
parserContext - the object encapsulating the current state of the parsing process
builder - used to define the BeanDefinition
See Also:
AbstractSingleBeanDefinitionParser.doParse(Element, BeanDefinitionBuilder)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ScheduledTaskRegistrar

org.springframework.scheduling.config
Class ScheduledTaskRegistrar

java.lang.Object
    extended by  org.springframework.scheduling.config.ScheduledTaskRegistrar
All Implemented Interfaces:
DisposableBean, InitializingBean
public class ScheduledTaskRegistrar
extends Object
implements InitializingBean, DisposableBean

Helper bean for registering tasks with a TaskScheduler, typically using cron expressions.

Since:
3.0
Author:
Juergen Hoeller

Constructor Summary
ScheduledTaskRegistrar()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
void | destroy() Invoked by a BeanFactory on destruction of a singleton.
void | setCronTasks(Map<Runnable,String> cronTasks)
void | setFixedDelayTasks(Map<Runnable,Long> fixedDelayTasks)
void | setFixedRateTasks(Map<Runnable,Long> fixedRateTasks)
void | setScheduler(Object scheduler)
void | setTaskScheduler(TaskScheduler taskScheduler)
void | setTriggerTasks(Map<Runnable,Trigger> triggerTasks)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ScheduledTaskRegistrar

public ScheduledTaskRegistrar()
Method Detail

setTaskScheduler

public void setTaskScheduler(TaskScheduler taskScheduler)

setScheduler

public void setScheduler(Object scheduler)

setTriggerTasks

public void setTriggerTasks(Map<Runnable,Trigger> triggerTasks)

setCronTasks

public void setCronTasks(Map<Runnable,String> cronTasks)

setFixedRateTasks

public void setFixedRateTasks(Map<Runnable,Long> fixedRateTasks)

setFixedDelayTasks

public void setFixedDelayTasks(Map<Runnable,Long> fixedDelayTasks)

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

destroy

public void destroy()
Description copied from interface: DisposableBean
Invoked by a BeanFactory on destruction of a singleton.

Specified by:
destroy in interface DisposableBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ScheduledTasksBeanDefinitionParser

org.springframework.scheduling.config
Class ScheduledTasksBeanDefinitionParser

java.lang.Object
    extended by  org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
        extended by  org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
            extended by  org.springframework.scheduling.config.ScheduledTasksBeanDefinitionParser
All Implemented Interfaces:
BeanDefinitionParser
public class ScheduledTasksBeanDefinitionParser
extends AbstractSingleBeanDefinitionParser

Parser for the 'scheduled-tasks' element of the scheduling namespace.

Since:
3.0
Author:
Mark Fisher

Field Summary
Fields inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
ID_ATTRIBUTE, NAME_ATTRIBUTE
Constructor Summary
ScheduledTasksBeanDefinitionParser()
Method Summary
protected void | doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) Parse the supplied Element and populate the supplied BeanDefinitionBuilder as required.
protected String | getBeanClassName(Element element) Determine the bean class name corresponding to the supplied Element.
protected boolean | shouldGenerateId() Should an ID be generated instead of read from the passed in Element?
Methods inherited from class org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
doParse, getBeanClass, getParentName, parseInternal
Methods inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
parse, postProcessComponentDefinition, registerBeanDefinition, resolveId, shouldFireEvents, shouldGenerateIdAsFallback
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ScheduledTasksBeanDefinitionParser

public ScheduledTasksBeanDefinitionParser()
Method Detail

shouldGenerateId

protected boolean shouldGenerateId()
Description copied from class: AbstractBeanDefinitionParser
Should an ID be generated instead of read from the passed in Element?

Disabled by default; subclasses can override this to enable ID generation. Note that this flag is about always generating an ID; the parser won't even check for an "id" attribute in this case.

Overrides:
shouldGenerateId in class AbstractBeanDefinitionParser
Returns:
whether the parser should always generate an id

getBeanClassName

protected String getBeanClassName(Element element)
Description copied from class: AbstractSingleBeanDefinitionParser
Determine the bean class name corresponding to the supplied Element.

Overrides:
getBeanClassName in class AbstractSingleBeanDefinitionParser
Parameters:
element - the Element that is being parsed
Returns:
the class name of the bean that is being defined via parsing the supplied Element, or null if none
See Also:
AbstractSingleBeanDefinitionParser.getBeanClass(org.w3c.dom.Element)

doParse

protected void doParse(Element element,
                       ParserContext parserContext,
                       BeanDefinitionBuilder builder)
Description copied from class: AbstractSingleBeanDefinitionParser
Parse the supplied Element and populate the supplied BeanDefinitionBuilder as required.

The default implementation delegates to the doParse version without ParserContext argument.

Overrides:
doParse in class AbstractSingleBeanDefinitionParser
Parameters:
element - the XML element being parsed
parserContext - the object encapsulating the current state of the parsing process
builder - used to define the BeanDefinition
See Also:
AbstractSingleBeanDefinitionParser.doParse(Element, BeanDefinitionBuilder)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SchedulerBeanDefinitionParser

org.springframework.scheduling.config
Class SchedulerBeanDefinitionParser

java.lang.Object
    extended by  org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
        extended by  org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
            extended by  org.springframework.scheduling.config.SchedulerBeanDefinitionParser
All Implemented Interfaces:
BeanDefinitionParser
public class SchedulerBeanDefinitionParser
extends AbstractSingleBeanDefinitionParser

Parser for the 'scheduler' element of the 'task' namespace.

Since:
3.0
Author:
Mark Fisher

Field Summary
Fields inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
ID_ATTRIBUTE, NAME_ATTRIBUTE
Constructor Summary
SchedulerBeanDefinitionParser()
Method Summary
protected void | doParse(Element element, BeanDefinitionBuilder builder) Parse the supplied Element and populate the supplied BeanDefinitionBuilder as required.
protected String | getBeanClassName(Element element) Determine the bean class name corresponding to the supplied Element.
Methods inherited from class org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
doParse, getBeanClass, getParentName, parseInternal
Methods inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
parse, postProcessComponentDefinition, registerBeanDefinition, resolveId, shouldFireEvents, shouldGenerateId, shouldGenerateIdAsFallback
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SchedulerBeanDefinitionParser

public SchedulerBeanDefinitionParser()
Method Detail

getBeanClassName

protected String getBeanClassName(Element element)
Description copied from class: AbstractSingleBeanDefinitionParser
Determine the bean class name corresponding to the supplied Element.

Overrides:
getBeanClassName in class AbstractSingleBeanDefinitionParser
Parameters:
element - the Element that is being parsed
Returns:
the class name of the bean that is being defined via parsing the supplied Element, or null if none
See Also:
AbstractSingleBeanDefinitionParser.getBeanClass(org.w3c.dom.Element)

doParse

protected void doParse(Element element,
                       BeanDefinitionBuilder builder)
Description copied from class: AbstractSingleBeanDefinitionParser
Parse the supplied Element and populate the supplied BeanDefinitionBuilder as required.

The default implementation does nothing.

Overrides:
doParse in class AbstractSingleBeanDefinitionParser
Parameters:
element - the XML element being parsed
builder - used to define the BeanDefinition
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TaskExecutorFactoryBean

org.springframework.scheduling.config
Class TaskExecutorFactoryBean

java.lang.Object
    extended by  org.springframework.scheduling.config.TaskExecutorFactoryBean
All Implemented Interfaces:
BeanNameAware, DisposableBean, FactoryBean<TaskExecutor>
public class TaskExecutorFactoryBean
extends Object
implements FactoryBean<TaskExecutor>, BeanNameAware, DisposableBean

FactoryBean for creating TaskExecutor instances.

Since:
3.0
Author:
Mark Fisher

Constructor Summary
TaskExecutorFactoryBean()
Method Summary
 void destroy()
Invoked by a BeanFactory on destruction of a singleton.
 TaskExecutor getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<? extends TaskExecutor> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setBeanName(String beanName)
Set the name of the bean in the bean factory that created this bean.
 void setKeepAliveSeconds(int keepAliveSeconds)
 void setPoolSize(String poolSize)
 void setQueueCapacity(int queueCapacity)
 void setRejectedExecutionHandler(Object rejectedExecutionHandler)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TaskExecutorFactoryBean

public TaskExecutorFactoryBean()
Method Detail

setPoolSize

public void setPoolSize(String poolSize)

setQueueCapacity

public void setQueueCapacity(int queueCapacity)

setRejectedExecutionHandler

public void setRejectedExecutionHandler(Object rejectedExecutionHandler)

setKeepAliveSeconds

public void setKeepAliveSeconds(int keepAliveSeconds)

setBeanName

public void setBeanName(String beanName)
Description copied from interface: BeanNameAware
Set the name of the bean in the bean factory that created this bean.

Invoked after population of normal bean properties but before an init callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanName in interface BeanNameAware
Parameters:
beanName - the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use the BeanFactoryUtils.originalBeanName(String) method to extract the original bean name (without suffix), if desired.

getObjectType

public Class<? extends TaskExecutor> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<TaskExecutor>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

getObject

public TaskExecutor getObject()
                       throws Exception
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<TaskExecutor>
Returns:
an instance of the bean (can be null)
Throws:
Exception - in case of creation errors
See Also:
FactoryBeanNotInitializedException

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<TaskExecutor>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()

destroy

public void destroy()
             throws Exception
Description copied from interface: DisposableBean
Invoked by a BeanFactory on destruction of a singleton.

Specified by:
destroy in interface DisposableBean
Throws:
Exception - in case of shutdown errors. Exceptions will get logged but not rethrown to allow other beans to release their resources too.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TaskNamespaceHandler

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.scheduling.config
Class TaskNamespaceHandler

java.lang.Object
    extended by  org.springframework.beans.factory.xml.NamespaceHandlerSupport
        extended by  org.springframework.scheduling.config.TaskNamespaceHandler
All Implemented Interfaces:
NamespaceHandler
public class TaskNamespaceHandler
extends NamespaceHandlerSupport

NamespaceHandler for the 'task' namespace.

Since:
3.0
Author:
Mark Fisher

Constructor Summary
TaskNamespaceHandler()
Method Summary
 void init()
Invoked by the DefaultBeanDefinitionDocumentReader after construction but before any custom elements are parsed.
Methods inherited from class org.springframework.beans.factory.xml.NamespaceHandlerSupport
decorate, parse, registerBeanDefinitionDecorator, registerBeanDefinitionDecoratorForAttribute, registerBeanDefinitionParser
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TaskNamespaceHandler

public TaskNamespaceHandler()
Method Detail

init

public void init()
Description copied from interface: NamespaceHandler
Invoked by the DefaultBeanDefinitionDocumentReader after construction but before any custom elements are parsed.

See Also:
NamespaceHandlerSupport.registerBeanDefinitionParser(String, BeanDefinitionParser)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.scheduling.quartz

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.scheduling.quartz

Support classes for the open source scheduler Quartz, allowing to set up Quartz Schedulers, JobDetails and Triggers as beans in a Spring context.

See:
Description

Interface Summary
JobDetailAwareTrigger | Interface to be implemented by Quartz Triggers that are aware of the JobDetail object that they are associated with.
SchedulerContextAware | Callback interface to be implemented by Spring-managed Quartz artifacts that need access to the SchedulerContext (without having natural access to it).

Class Summary
AdaptableJobFactory | JobFactory implementation that supports Runnable objects as well as standard Quartz Job instances.
CronTriggerBean | Convenience subclass of Quartz's CronTrigger class, making bean-style usage easier.
DelegatingJob | Simple Quartz Job adapter that delegates to a given Runnable instance.
JobDetailBean | Convenience subclass of Quartz's JobDetail class, making bean-style usage easier.
LocalDataSourceJobStore | Subclass of Quartz's JobStoreCMT class that delegates to a Spring-managed DataSource instead of using a Quartz-managed connection pool.
LocalTaskExecutorThreadPool | Quartz ThreadPool adapter that delegates to a Spring-managed TaskExecutor instance, specified on SchedulerFactoryBean.
MethodInvokingJobDetailFactoryBean | FactoryBean that exposes a JobDetail object which delegates job execution to a specified (static or non-static) method.
MethodInvokingJobDetailFactoryBean.MethodInvokingJob | Quartz Job implementation that invokes a specified method.
MethodInvokingJobDetailFactoryBean.StatefulMethodInvokingJob | Extension of the MethodInvokingJob, implementing the StatefulJob interface.
QuartzJobBean | Simple implementation of the Quartz Job interface, applying the passed-in JobDataMap and also the SchedulerContext as bean property values.
ResourceLoaderClassLoadHelper | Wrapper that adapts from the Quartz ClassLoadHelper interface onto Spring's ResourceLoader interface.
SchedulerAccessor | Common base class for accessing a Quartz Scheduler, i.e.
SchedulerAccessorBean | Spring bean-style class for accessing a Quartz Scheduler, i.e.
SchedulerFactoryBean | FactoryBean that creates and configures a Quartz Scheduler, manages its lifecycle as part of the Spring application context, and exposes the Scheduler as bean reference for dependency injection.
SimpleThreadPoolTaskExecutor | Subclass of Quartz's SimpleThreadPool that implements Spring's TaskExecutor interface and listens to Spring lifecycle callbacks.
SimpleTriggerBean | Convenience subclass of Quartz's SimpleTrigger class, making bean-style usage easier.
SpringBeanJobFactory | Subclass of AdaptableJobFactory that also supports Spring-style dependency injection on bean properties.

Exception Summary
JobMethodInvocationFailedException Unchecked exception that wraps an exception thrown from a target method.

Package org.springframework.scheduling.quartz Description

Support classes for the open source scheduler Quartz, allowing to set up Quartz Schedulers, JobDetails and Triggers as beans in a Spring context. Also provides convenience classes for implementing Quartz Jobs.


org.springframework.scheduling.quartz Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.scheduling.quartz

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.scheduling.quartz.AdaptableJobFactory (implements org.quartz.spi.JobFactory)
      • org.springframework.scheduling.quartz.SpringBeanJobFactory (implements org.springframework.scheduling.quartz.SchedulerContextAware)
    • org.springframework.scheduling.quartz.DelegatingJob (implements org.quartz.Job)
    • org.quartz.JobDetail (implements java.lang.Cloneable, java.io.Serializable)
      • org.springframework.scheduling.quartz.JobDetailBean (implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean)
    • org.quartz.impl.jdbcjobstore.JobStoreSupport (implements org.quartz.impl.jdbcjobstore.Constants, org.quartz.spi.JobStore)
      • org.quartz.impl.jdbcjobstore.JobStoreCMT
        • org.springframework.scheduling.quartz.LocalDataSourceJobStore
    • org.springframework.scheduling.quartz.LocalTaskExecutorThreadPool (implements org.quartz.spi.ThreadPool)
    • org.springframework.util.MethodInvoker
      • org.springframework.beans.support.ArgumentConvertingMethodInvoker
        • org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • org.springframework.scheduling.quartz.QuartzJobBean (implements org.quartz.Job)
      • org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean.MethodInvokingJob
        • org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean.StatefulMethodInvokingJob (implements org.quartz.StatefulJob)
    • org.springframework.scheduling.quartz.ResourceLoaderClassLoadHelper (implements org.quartz.spi.ClassLoadHelper)
    • org.springframework.scheduling.quartz.SchedulerAccessor (implements org.springframework.context.ResourceLoaderAware)
      • org.springframework.scheduling.quartz.SchedulerAccessorBean (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean)
      • org.springframework.scheduling.quartz.SchedulerFactoryBean (implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean, org.springframework.context.SmartLifecycle)
    • org.quartz.simpl.SimpleThreadPool (implements org.quartz.spi.ThreadPool)
      • org.springframework.scheduling.quartz.SimpleThreadPoolTaskExecutor (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.scheduling.SchedulingTaskExecutor)
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.scheduling.quartz.JobMethodInvocationFailedException
    • org.quartz.Trigger (implements java.lang.Cloneable, java.lang.Comparable<T>, java.io.Serializable)
      • org.quartz.CronTrigger
        • org.springframework.scheduling.quartz.CronTriggerBean (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.scheduling.quartz.JobDetailAwareTrigger)
      • org.quartz.SimpleTrigger
        • org.springframework.scheduling.quartz.SimpleTriggerBean (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.scheduling.quartz.JobDetailAwareTrigger)

Interface Hierarchy

  • org.springframework.scheduling.quartz.JobDetailAwareTrigger
  • org.springframework.scheduling.quartz.SchedulerContextAware


JobDetailAwareTrigger

org.springframework.scheduling.quartz
Interface JobDetailAwareTrigger

All Known Implementing Classes:
CronTriggerBean, SimpleTriggerBean
public interface JobDetailAwareTrigger

Interface to be implemented by Quartz Triggers that are aware of the JobDetail object that they are associated with.

SchedulerFactoryBean will auto-detect Triggers that implement this interface and register them for the respective JobDetail accordingly.

The alternative is to configure a Trigger for a Job name and group: This involves the need to register the JobDetail object separately with SchedulerFactoryBean.

Since:
18.02.2004
Author:
Juergen Hoeller
See Also:
SchedulerAccessor.setTriggers(org.quartz.Trigger[]),
SchedulerAccessor.setJobDetails(org.quartz.JobDetail[]),
Trigger.setJobName(java.lang.String),
Trigger.setJobGroup(java.lang.String)

Method Summary
 org.quartz.JobDetail getJobDetail()
Return the JobDetail that this Trigger is associated with.

Method Detail

getJobDetail

org.quartz.JobDetail getJobDetail()
Return the JobDetail that this Trigger is associated with.

Returns:
the associated JobDetail, or null if none
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SchedulerContextAware

org.springframework.scheduling.quartz
Interface SchedulerContextAware

All Known Implementing Classes:
SpringBeanJobFactory
public interface SchedulerContextAware

Callback interface to be implemented by Spring-managed Quartz artifacts that need access to the SchedulerContext (without having natural access to it).

Currently only supported for custom JobFactory implementations that are passed in via Spring's SchedulerFactoryBean.

Since:
2.0
Author:
Juergen Hoeller
See Also:
JobFactory, SchedulerFactoryBean.setJobFactory(org.quartz.spi.JobFactory)

Method Summary
 void setSchedulerContext(org.quartz.SchedulerContext schedulerContext)
Set the SchedulerContext of the current Quartz Scheduler.

Method Detail

setSchedulerContext

void setSchedulerContext(org.quartz.SchedulerContext schedulerContext)
Set the SchedulerContext of the current Quartz Scheduler.

See Also:
Scheduler.getContext()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AdaptableJobFactory

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.scheduling.quartz
Class AdaptableJobFactory

java.lang.Object
    extended by  org.springframework.scheduling.quartz.AdaptableJobFactory
All Implemented Interfaces:
org.quartz.spi.JobFactory
Direct Known Subclasses:
SpringBeanJobFactory
public class AdaptableJobFactory
extends Object
implements org.quartz.spi.JobFactory

JobFactory implementation that supports Runnable objects as well as standard Quartz Job instances.

Since:
2.0
Author:
Juergen Hoeller
See Also:
DelegatingJob, adaptJob(Object)

Constructor Summary
AdaptableJobFactory()
Method Summary
protected org.quartz.Job | adaptJob(Object jobObject) Adapt the given job object to the Quartz Job interface.
protected Object | createJobInstance(org.quartz.spi.TriggerFiredBundle bundle) Create an instance of the specified job class.
org.quartz.Job | newJob(org.quartz.spi.TriggerFiredBundle bundle)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AdaptableJobFactory

public AdaptableJobFactory()
Method Detail

newJob

public org.quartz.Job newJob(org.quartz.spi.TriggerFiredBundle bundle)
                      throws org.quartz.SchedulerException
Specified by:
newJob in interface org.quartz.spi.JobFactory
Throws:
org.quartz.SchedulerException

createJobInstance

protected Object createJobInstance(org.quartz.spi.TriggerFiredBundle bundle)
                            throws Exception
Create an instance of the specified job class.

Can be overridden to post-process the job instance.

Parameters:
bundle - the TriggerFiredBundle from which the JobDetail and other info relating to the trigger firing can be obtained
Returns:
the job instance
Throws:
Exception - if job instantiation failed

adaptJob

protected org.quartz.Job adaptJob(Object jobObject)
                           throws Exception
Adapt the given job object to the Quartz Job interface.

The default implementation supports straight Quartz Jobs as well as Runnables, which get wrapped in a DelegatingJob.

Parameters:
jobObject - the original instance of the specified job class
Returns:
the adapted Quartz Job instance
Throws:
Exception - if the given job could not be adapted
See Also:
DelegatingJob
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


CronTriggerBean

org.springframework.scheduling.quartz
Class CronTriggerBean

java.lang.Object
    extended by  org.quartz.Trigger
        extended by  org.quartz.CronTrigger
            extended by  org.springframework.scheduling.quartz.CronTriggerBean
All Implemented Interfaces:
Serializable, Cloneable, Comparable, BeanNameAware, InitializingBean, JobDetailAwareTrigger
public class CronTriggerBean
extends org.quartz.CronTrigger
implements JobDetailAwareTrigger, BeanNameAware, InitializingBean

Convenience subclass of Quartz's CronTrigger class, making bean-style usage easier.

CronTrigger itself is already a JavaBean but lacks sensible defaults. This class uses the Spring bean name as job name, the Quartz default group ("DEFAULT") as job group, the current time as start time, and indefinite repetition, if not specified.

This class will also register the trigger with the job name and group of a given JobDetail. This allows SchedulerFactoryBean to automatically register a trigger for the corresponding JobDetail, instead of registering the JobDetail separately.

NOTE: This convenience subclass does not work with trigger persistence in Quartz 1.6, due to a change in Quartz's trigger handling. Use Quartz 1.5 if you rely on trigger persistence based on this class, or the standard Quartz CronTrigger class instead.

Since:
18.02.2004
Author:
Juergen Hoeller
See Also:
Trigger.setName(java.lang.String),
Trigger.setGroup(java.lang.String),
CronTrigger.setStartTime(java.util.Date),
Trigger.setJobName(java.lang.String),
Trigger.setJobGroup(java.lang.String),
setJobDetail(org.quartz.JobDetail),
SchedulerAccessor.setTriggers(org.quartz.Trigger[]),
SchedulerAccessor.setJobDetails(org.quartz.JobDetail[]),
SimpleTriggerBean,
Serialized Form

Field Summary
Fields inherited from class org.quartz.CronTrigger
MISFIRE_INSTRUCTION_DO_NOTHING, MISFIRE_INSTRUCTION_FIRE_ONCE_NOW
Fields inherited from class org.quartz.Trigger
DEFAULT_PRIORITY, INSTRUCTION_DELETE_TRIGGER, INSTRUCTION_NOOP, INSTRUCTION_RE_EXECUTE_JOB, INSTRUCTION_SET_ALL_JOB_TRIGGERS_COMPLETE, INSTRUCTION_SET_ALL_JOB_TRIGGERS_ERROR, INSTRUCTION_SET_TRIGGER_COMPLETE, INSTRUCTION_SET_TRIGGER_ERROR, MISFIRE_INSTRUCTION_SMART_POLICY, STATE_BLOCKED, STATE_COMPLETE, STATE_ERROR, STATE_NONE, STATE_NORMAL, STATE_PAUSED
Constructor Summary
CronTriggerBean()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
org.quartz.JobDetail | getJobDetail() Return the JobDetail that this Trigger is associated with.
void | setBeanName(String beanName) Set the name of the bean in the bean factory that created this bean.
void | setJobDataAsMap(Map jobDataAsMap) Register objects in the JobDataMap via a given Map.
void | setJobDetail(org.quartz.JobDetail jobDetail) Set the JobDetail that this trigger should be associated with.
void | setMisfireInstructionName(String constantName) Set the misfire instruction via the name of the corresponding constant in the CronTrigger class.
void | setStartDelay(long startDelay) Set the start delay in milliseconds.
void | setTriggerListenerNames(String[] names) Set a list of TriggerListener names for this job, referring to non-global TriggerListeners registered with the Scheduler.
Methods inherited from class org.quartz.CronTrigger
clone, computeFirstFireTime, executionComplete, getCronExpression, getEndTime, getExpressionSummary, getFinalFireTime, getFireTimeAfter, getNextFireTime, getPreviousFireTime, getStartTime, getTimeAfter, getTimeBefore, getTimeZone, hasAdditionalProperties, main, mayFireAgain, setCronExpression, setCronExpression, setEndTime, setNextFireTime, setPreviousFireTime, setStartTime, setTimeZone, triggered, updateAfterMisfire, updateWithNewCalendar, validateMisfireInstruction, willFireOn, willFireOn
Methods inherited from class org.quartz.Trigger
addTriggerListener, clearAllTriggerListeners, compareTo, equals, getCalendarName, getDescription, getFireInstanceId, getFullJobName, getFullName, getGroup, getJobDataMap, getJobGroup, getJobName, getKey, getMisfireInstruction, getName, getPriority, getTriggerListenerNames, hashCode, isVolatile, removeTriggerListener, setCalendarName, setDescription, setFireInstanceId, setGroup, setJobDataMap, setJobGroup, setJobName, setMisfireInstruction, setName, setPriority, setVolatility, toString, validate
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

CronTriggerBean

public CronTriggerBean()
Method Detail

setJobDataAsMap

public void setJobDataAsMap(Map jobDataAsMap)
Register objects in the JobDataMap via a given Map.

These objects will be available to this Trigger only, in contrast to objects in the JobDetail's data map.

Parameters:
jobDataAsMap - Map with String keys and any objects as values (for example Spring-managed beans)
See Also:
JobDetailBean.setJobDataAsMap(java.util.Map)

setMisfireInstructionName

public void setMisfireInstructionName(String constantName)
Set the misfire instruction via the name of the corresponding constant in the CronTrigger class. Default is MISFIRE_INSTRUCTION_SMART_POLICY.

See Also:
CronTrigger.MISFIRE_INSTRUCTION_FIRE_ONCE_NOW, CronTrigger.MISFIRE_INSTRUCTION_DO_NOTHING, Trigger.MISFIRE_INSTRUCTION_SMART_POLICY

setTriggerListenerNames

public void setTriggerListenerNames(String[] names)
Set a list of TriggerListener names for this job, referring to non-global TriggerListeners registered with the Scheduler.

A TriggerListener name always refers to the name returned by the TriggerListener implementation.

See Also:
SchedulerAccessor.setTriggerListeners(org.quartz.TriggerListener[]), TriggerListener.getName()

setJobDetail

public void setJobDetail(org.quartz.JobDetail jobDetail)
Set the JobDetail that this trigger should be associated with.

This is typically used with a bean reference if the JobDetail is a Spring-managed bean. Alternatively, the trigger can also be associated with a job by name and group.

See Also:
Trigger.setJobName(java.lang.String), Trigger.setJobGroup(java.lang.String)

setStartDelay

public void setStartDelay(long startDelay)
Set the start delay in milliseconds.

The start delay is added to the current system time (when the bean starts) to control the start time of the trigger.

If the start delay is non-zero it will always take precedence over start time.

Parameters:
startDelay - the start delay, in milliseconds.

getJobDetail

public org.quartz.JobDetail getJobDetail()
Description copied from interface: JobDetailAwareTrigger
Return the JobDetail that this Trigger is associated with.

Specified by:
getJobDetail in interface JobDetailAwareTrigger
Returns:
the associated JobDetail, or null if none

setBeanName

public void setBeanName(String beanName)
Description copied from interface: BeanNameAware
Set the name of the bean in the bean factory that created this bean.

Invoked after population of normal bean properties but before an init callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanName in interface BeanNameAware
Parameters:
beanName - the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use the BeanFactoryUtils.originalBeanName(String) method to extract the original bean name (without suffix), if desired.

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception - in the event of misconfiguration (such as failure to set an essential property) or if initialization fails.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DelegatingJob

org.springframework.scheduling.quartz
Class DelegatingJob

java.lang.Object
    extended by  org.springframework.scheduling.quartz.DelegatingJob
All Implemented Interfaces:
org.quartz.Job
public class DelegatingJob
extends Object
implements org.quartz.Job

Simple Quartz Job adapter that delegates to a given Runnable instance.

Typically used in combination with property injection on the Runnable instance, receiving parameters from the Quartz JobDataMap that way instead of via the JobExecutionContext.

Since:
2.0
Author:
Juergen Hoeller
See Also:
SpringBeanJobFactory, Job.execute(org.quartz.JobExecutionContext)

Constructor Summary
DelegatingJob(Runnable delegate)
Create a new DelegatingJob.
Method Summary
void | execute(org.quartz.JobExecutionContext context) Delegates execution to the underlying Runnable.
Runnable | getDelegate() Return the wrapped Runnable implementation.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DelegatingJob

public DelegatingJob(Runnable delegate)
Create a new DelegatingJob.

Parameters:
delegate - the Runnable implementation to delegate to
Method Detail

getDelegate

public final Runnable getDelegate()
Return the wrapped Runnable implementation.

execute

public void execute(org.quartz.JobExecutionContext context)
             throws org.quartz.JobExecutionException
Delegates execution to the underlying Runnable.

Specified by:
execute in interface org.quartz.Job
Throws:
org.quartz.JobExecutionException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JobDetailBean

org.springframework.scheduling.quartz
Class JobDetailBean

java.lang.Object
    extended by  org.quartz.JobDetail
        extended by  org.springframework.scheduling.quartz.JobDetailBean
All Implemented Interfaces:
Serializable, Cloneable, BeanNameAware, InitializingBean, ApplicationContextAware
public class JobDetailBean
extends org.quartz.JobDetail
implements BeanNameAware, ApplicationContextAware, InitializingBean

Convenience subclass of Quartz's JobDetail class, making bean-style usage easier.

JobDetail itself is already a JavaBean but lacks sensible defaults. This class uses the Spring bean name as job name, and the Quartz default group ("DEFAULT") as job group if not specified.

Since:
18.02.2004
Author:
Juergen Hoeller
See Also:
JobDetail.setName(java.lang.String), JobDetail.setGroup(java.lang.String), BeanNameAware, Scheduler.DEFAULT_GROUP, Serialized Form

Constructor Summary
JobDetailBean()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
Class | getJobClass() Overridden to support any job class, to allow a custom JobFactory to adapt the given job class to the Quartz Job interface.
void | setApplicationContext(ApplicationContext applicationContext) Set the ApplicationContext that this object runs in.
void | setApplicationContextJobDataKey(String applicationContextJobDataKey) Set the key of an ApplicationContext reference to expose in the JobDataMap, for example "applicationContext".
void | setBeanName(String beanName) Set the name of the bean in the bean factory that created this bean.
void | setJobClass(Class jobClass) Overridden to support any job class, to allow a custom JobFactory to adapt the given job class to the Quartz Job interface.
void | setJobDataAsMap(Map jobDataAsMap) Register objects in the JobDataMap via a given Map.
void | setJobListenerNames(String[] names) Set a list of JobListener names for this job, referring to non-global JobListeners registered with the Scheduler.
Methods inherited from class org.quartz.JobDetail
addJobListener, clone, equals, getDescription, getFullName, getGroup, getJobDataMap, getJobListenerNames, getKey, getName, hashCode, isDurable, isStateful, isVolatile, removeJobListener, requestsRecovery, setDescription, setDurability, setGroup, setJobDataMap, setName, setRequestsRecovery, setVolatility, toString, validate
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

JobDetailBean

public JobDetailBean()
Method Detail

setJobClass

public void setJobClass(Class jobClass)
Overridden to support any job class, to allow a custom JobFactory to adapt the given job class to the Quartz Job interface.

Overrides:
setJobClass in class org.quartz.JobDetail
See Also:
SchedulerFactoryBean.setJobFactory(org.quartz.spi.JobFactory)

getJobClass

public Class getJobClass()
Overridden to support any job class, to allow a custom JobFactory to adapt the given job class to the Quartz Job interface.

Overrides:
getJobClass in class org.quartz.JobDetail

setJobDataAsMap

public void setJobDataAsMap(Map jobDataAsMap)
Register objects in the JobDataMap via a given Map.

These objects will be available to this Job only, in contrast to objects in the SchedulerContext.

Note: When using persistent Jobs whose JobDetail will be kept in the database, do not put Spring-managed beans or an ApplicationContext reference into the JobDataMap but rather into the SchedulerContext.

Parameters:
jobDataAsMap - Map with String keys and any objects as values (for example Spring-managed beans)
See Also:
SchedulerFactoryBean.setSchedulerContextAsMap(java.util.Map)

setJobListenerNames

public void setJobListenerNames(String[] names)
Set a list of JobListener names for this job, referring to non-global JobListeners registered with the Scheduler.

A JobListener name always refers to the name returned by the JobListener implementation.

See Also:
SchedulerAccessor.setJobListeners(org.quartz.JobListener[]), JobListener.getName()

setBeanName

public void setBeanName(String beanName)
Description copied from interface: BeanNameAware
Set the name of the bean in the bean factory that created this bean.

Invoked after population of normal bean properties but before an init callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanName in interface BeanNameAware
Parameters:
beanName - the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use the BeanFactoryUtils.originalBeanName(String) method to extract the original bean name (without suffix), if desired.

setApplicationContext

public void setApplicationContext(ApplicationContext applicationContext)
Description copied from interface: ApplicationContextAware
Set the ApplicationContext that this object runs in. Normally this call will be used to initialize the object.

Invoked after population of normal bean properties but before an init callback such as InitializingBean.afterPropertiesSet() or a custom init-method. Invoked after ResourceLoaderAware.setResourceLoader(org.springframework.core.io.ResourceLoader), ApplicationEventPublisherAware.setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher) and MessageSourceAware, if applicable.

Specified by:
setApplicationContext in interface ApplicationContextAware
Parameters:
applicationContext - the ApplicationContext object to be used by this object
See Also:
BeanInitializationException

setApplicationContextJobDataKey

public void setApplicationContextJobDataKey(String applicationContextJobDataKey)
Set the key of an ApplicationContext reference to expose in the JobDataMap, for example "applicationContext". Default is none. Only applicable when running in a Spring ApplicationContext.

In case of a QuartzJobBean, the reference will be applied to the Job instance as bean property. An "applicationContext" attribute will correspond to a "setApplicationContext" method in that scenario.

Note that BeanFactory callback interfaces like ApplicationContextAware are not automatically applied to Quartz Job instances, because Quartz itself is responsible for the lifecycle of its Jobs.

Note: When using persistent job stores where JobDetail contents will be kept in the database, do not put an ApplicationContext reference into the JobDataMap but rather into the SchedulerContext.

See Also:
SchedulerFactoryBean.setApplicationContextSchedulerContextKey(java.lang.String), ApplicationContext

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LocalDataSourceJobStore

org.springframework.scheduling.quartz
Class LocalDataSourceJobStore

java.lang.Object
    extended by  org.quartz.impl.jdbcjobstore.JobStoreSupport
        extended by  org.quartz.impl.jdbcjobstore.JobStoreCMT
            extended by  org.springframework.scheduling.quartz.LocalDataSourceJobStore
All Implemented Interfaces:
org.quartz.impl.jdbcjobstore.Constants, org.quartz.spi.JobStore
public class LocalDataSourceJobStore
extends org.quartz.impl.jdbcjobstore.JobStoreCMT

Subclass of Quartz's JobStoreCMT class that delegates to a Spring-managed DataSource instead of using a Quartz-managed connection pool. This JobStore will be used if SchedulerFactoryBean's "dataSource" property is set.

Supports both transactional and non-transactional DataSource access. With a non-XA DataSource and local Spring transactions, a single DataSource argument is sufficient. In case of an XA DataSource and global JTA transactions, SchedulerFactoryBean's "nonTransactionalDataSource" property should be set, passing in a non-XA DataSource that will not participate in global transactions.

Operations performed by this JobStore will properly participate in any kind of Spring-managed transaction, as it uses Spring's DataSourceUtils connection handling methods that are aware of a current transaction.

Note that all Quartz Scheduler operations that affect the persistent job store should usually be performed within active transactions, as they assume to get proper locks etc.

Since:
1.1
Author:
Juergen Hoeller
See Also:
SchedulerFactoryBean.setDataSource(javax.sql.DataSource),
SchedulerFactoryBean.setNonTransactionalDataSource(javax.sql.DataSource),
DataSourceUtils.doGetConnection(javax.sql.DataSource),
DataSourceUtils.releaseConnection(java.sql.Connection, javax.sql.DataSource)

Nested Class Summary
Nested classes/interfaces inherited from class org.quartz.impl.jdbcjobstore.JobStoreSupport
org.quartz.impl.jdbcjobstore.JobStoreSupport.RecoverMisfiredJobsResult, org.quartz.impl.jdbcjobstore.JobStoreSupport.TransactionCallback, org.quartz.impl.jdbcjobstore.JobStoreSupport.VoidTransactionCallback
Field Summary
static String | NON_TX_DATA_SOURCE_PREFIX Name used for the non-transactional ConnectionProvider for Quartz.
static String | TX_DATA_SOURCE_PREFIX Name used for the transactional ConnectionProvider for Quartz.
Fields inherited from class org.quartz.impl.jdbcjobstore.JobStoreCMT
dontSetNonManagedTXConnectionAutoCommitFalse, nonManagedTxDsName, setTxIsolationLevelReadCommitted
Fields inherited from class org.quartz.impl.jdbcjobstore.JobStoreSupport
calendarCache, delegateClass, delegateClassName, dsName, firstCheckIn, instanceId, instanceName, lastCheckin, LOCK_CALENDAR_ACCESS, LOCK_JOB_ACCESS, LOCK_MISFIRE_ACCESS, LOCK_STATE_ACCESS, LOCK_TRIGGER_ACCESS, maxToRecoverAtATime, tablePrefix, useProperties
Fields inherited from interface org.quartz.impl.jdbcjobstore.Constants
ALIAS_COL_NEXT_FIRE_TIME, ALL_GROUPS_PAUSED, COL_BLOB, COL_CALENDAR, COL_CALENDAR_NAME, COL_CHECKIN_INTERVAL, COL_CRON_EXPRESSION, COL_DESCRIPTION, COL_END_TIME, COL_ENTRY_ID, COL_ENTRY_STATE, COL_FIRED_TIME, COL_INSTANCE_NAME, COL_IS_DURABLE, COL_IS_STATEFUL, COL_IS_VOLATILE, COL_JOB_CLASS, COL_JOB_DATAMAP, COL_JOB_GROUP, COL_JOB_LISTENER, COL_JOB_NAME, COL_LAST_CHECKIN_TIME, COL_LOCK_NAME, COL_MISFIRE_INSTRUCTION, COL_NEXT_FIRE_TIME, COL_PREV_FIRE_TIME, COL_PRIORITY, COL_REPEAT_COUNT, COL_REPEAT_INTERVAL, COL_REQUESTS_RECOVERY, COL_START_TIME, COL_TIME_ZONE_ID, COL_TIMES_TRIGGERED, COL_TRIGGER_GROUP, COL_TRIGGER_LISTENER, COL_TRIGGER_NAME, COL_TRIGGER_STATE, COL_TRIGGER_TYPE, DEFAULT_TABLE_PREFIX, STATE_ACQUIRED, STATE_BLOCKED, STATE_COMPLETE, STATE_DELETED, STATE_ERROR, STATE_EXECUTING, STATE_MISFIRED, STATE_PAUSED, STATE_PAUSED_BLOCKED, STATE_WAITING, TABLE_BLOB_TRIGGERS, TABLE_CALENDARS, TABLE_CRON_TRIGGERS, TABLE_FIRED_TRIGGERS, TABLE_JOB_DETAILS, TABLE_JOB_LISTENERS, TABLE_LOCKS, TABLE_PAUSED_TRIGGERS, TABLE_SCHEDULER_STATE, TABLE_SIMPLE_TRIGGERS, TABLE_TRIGGER_LISTENERS, TABLE_TRIGGERS, TTYPE_BLOB, TTYPE_CRON, TTYPE_SIMPLE
Constructor Summary
LocalDataSourceJobStore()
Method Summary
protected void | closeConnection(Connection con)
void | initialize(org.quartz.spi.ClassLoadHelper loadHelper, org.quartz.spi.SchedulerSignaler signaler)
Methods inherited from class org.quartz.impl.jdbcjobstore.JobStoreCMT
executeInLock, getNonManagedTXConnection, getNonManagedTXDataSource, isDontSetNonManagedTXConnectionAutoCommitFalse, isTxIsolationLevelReadCommitted, setDontSetNonManagedTXConnectionAutoCommitFalse, setNonManagedTXDataSource, setTxIsolationLevelReadCommitted, shutdown
Methods inherited from class org.quartz.impl.jdbcjobstore.JobStoreSupport
acquireNextTrigger, acquireNextTrigger, calcFailedIfAfter, calendarExists, canUseProperties, checkBlockedState, cleanupConnection, cleanVolatileTriggerAndJobs, cleanVolatileTriggerAndJobs, clusterCheckIn, clusterRecover, commitConnection, doCheckin, doRecoverMisfires, executeInLock, executeInNonManagedTXLock, executeInNonManagedTXLock, executeWithoutLock, findFailedInstances, getAttributeRestoringConnection, getCalendarNames, getCalendarNames, getClassLoadHelper, getClusterCheckinInterval, getConnection, getDataSource, getDbRetryInterval, getDelegate, getDoubleCheckLockMisfireHandler, getDriverDelegateClass, getFiredTriggerRecordId, getInstanceId, getInstanceName, getJobGroupNames, getJobGroupNames, getJobNames, getJobNames, getLockHandler, getLog, getMakeThreadsDaemons, getMaxMisfiresToHandleAtATime, getMisfireThreshold, getMisfireTime, getNumberOfCalendars, getNumberOfCalendars, getNumberOfJobs, getNumberOfJobs, getNumberOfTriggers, getNumberOfTriggers, getPausedTriggerGroups, getPausedTriggerGroups, getSelectWithLockSQL, getTablePrefix, getTriggerGroupNames, getTriggerGroupNames, getTriggerNames, getTriggerNames, getTriggersForJob, getTriggersForJob, getTriggerState, getTriggerState, getUseDBLocks, isClustered, isDontSetAutoCommitFalse, isLockOnInsert, isThreadsInheritInitializersClassLoadContext, isTxIsolationLevelSerializable, jobExists, logWarnIfNonZero, pauseAll, pauseAll, pauseJob, pauseJobGroup, pauseTrigger, pauseTrigger, pauseTriggerGroup, pauseTriggerGroup, recoverJobs, recoverJobs, recoverMisfiredJobs, releaseAcquiredTrigger, releaseAcquiredTrigger, releaseLock, removeCalendar, removeCalendar, removeJob, removeJob, removeTrigger, removeTrigger, replaceTrigger, replaceTrigger, resumeAll, resumeAll, resumeJob, resumeJobGroup, resumeTrigger, resumeTrigger, resumeTriggerGroup, resumeTriggerGroup, retrieveCalendar, retrieveCalendar, retrieveJob, retrieveJob, retrieveTrigger, retrieveTrigger, retrieveTrigger, rollbackConnection, schedulerStarted, setClusterCheckinInterval, setDataSource, setDbRetryInterval, setDontSetAutoCommitFalse, setDoubleCheckLockMisfireHandler, setDriverDelegateClass, setInstanceId, setInstanceName, setIsClustered, setLockHandler, setLockOnInsert, setMakeThreadsDaemons, setMaxMisfiresToHandleAtATime, setMisfireThreshold, setSelectWithLockSQL, setTablePrefix, setThreadsInheritInitializersClassLoadContext, setTxIsolationLevelSerializable, setUseDBLocks, setUseProperties, signalSchedulingChange, storeCalendar, storeCalendar, storeJob, storeJob, storeJobAndTrigger, storeTrigger, storeTrigger, supportsPersistence, triggeredJobComplete, triggeredJobComplete, triggerExists, triggerFired, triggerFired, updateMisfiredTrigger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

TX_DATA_SOURCE_PREFIX

public static final String TX_DATA_SOURCE_PREFIX
Name used for the transactional ConnectionProvider for Quartz. This provider will delegate to the local Spring-managed DataSource.

See Also:
DBConnectionManager.addConnectionProvider(java.lang.String, org.quartz.utils.ConnectionProvider), SchedulerFactoryBean.setDataSource(javax.sql.DataSource), Constant Field Values

NON_TX_DATA_SOURCE_PREFIX

public static final String NON_TX_DATA_SOURCE_PREFIX
Name used for the non-transactional ConnectionProvider for Quartz. This provider will delegate to the local Spring-managed DataSource.

See Also:
DBConnectionManager.addConnectionProvider(java.lang.String, org.quartz.utils.ConnectionProvider), SchedulerFactoryBean.setDataSource(javax.sql.DataSource), Constant Field Values
Constructor Detail

LocalDataSourceJobStore

public LocalDataSourceJobStore()
Method Detail

initialize

public void initialize(org.quartz.spi.ClassLoadHelper loadHelper,
                       org.quartz.spi.SchedulerSignaler signaler)
                throws org.quartz.SchedulerConfigException
Specified by:
initialize in interface org.quartz.spi.JobStore
Overrides:
initialize in class org.quartz.impl.jdbcjobstore.JobStoreCMT
Throws:
org.quartz.SchedulerConfigException

closeConnection

protected void closeConnection(Connection con)
Overrides:
closeConnection in class org.quartz.impl.jdbcjobstore.JobStoreSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LocalTaskExecutorThreadPool

org.springframework.scheduling.quartz
Class LocalTaskExecutorThreadPool

java.lang.Object
    extended by  org.springframework.scheduling.quartz.LocalTaskExecutorThreadPool
All Implemented Interfaces:
org.quartz.spi.ThreadPool
public class LocalTaskExecutorThreadPool
extends Object
implements org.quartz.spi.ThreadPool

Quartz ThreadPool adapter that delegates to a Spring-managed TaskExecutor instance, specified on SchedulerFactoryBean.

Since:
2.0
Author:
Juergen Hoeller
See Also:
SchedulerFactoryBean.setTaskExecutor(java.util.concurrent.Executor)

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
LocalTaskExecutorThreadPool()
Method Summary
int | blockForAvailableThreads()
int | getPoolSize()
void | initialize()
boolean | runInThread(Runnable runnable)
void | shutdown(boolean waitForJobsToComplete)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

LocalTaskExecutorThreadPool

public LocalTaskExecutorThreadPool()
Method Detail

initialize

public void initialize()
                throws org.quartz.SchedulerConfigException
Specified by:
initialize in interface org.quartz.spi.ThreadPool
Throws:
org.quartz.SchedulerConfigException

shutdown

public void shutdown(boolean waitForJobsToComplete)
Specified by:
shutdown in interface org.quartz.spi.ThreadPool

getPoolSize

public int getPoolSize()
Specified by:
getPoolSize in interface org.quartz.spi.ThreadPool

runInThread

public boolean runInThread(Runnable runnable)
Specified by:
runInThread in interface org.quartz.spi.ThreadPool

blockForAvailableThreads

public int blockForAvailableThreads()
Specified by:
blockForAvailableThreads in interface org.quartz.spi.ThreadPool
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MethodInvokingJobDetailFactoryBean

org.springframework.scheduling.quartz
Class MethodInvokingJobDetailFactoryBean

java.lang.Object
    extended by  org.springframework.util.MethodInvoker
        extended by  org.springframework.beans.support.ArgumentConvertingMethodInvoker
            extended by  org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean
All Implemented Interfaces:
BeanClassLoaderAware, BeanFactoryAware, BeanNameAware, FactoryBean<Object>, InitializingBean
public class MethodInvokingJobDetailFactoryBean
extends ArgumentConvertingMethodInvoker
implements FactoryBean<Object>, BeanNameAware, BeanClassLoaderAware, BeanFactoryAware, InitializingBean

FactoryBean that exposes a JobDetail object which delegates job execution to a specified (static or non-static) method. Avoids the need for implementing a one-line Quartz Job that just invokes an existing service method on a Spring-managed target bean.

Inherits common configuration properties from the MethodInvoker base class, such as "targetObject" and "targetMethod", adding support for lookup of the target bean by name through the "targetBeanName" property (as alternative to specifying a "targetObject" directly, allowing for non-singleton target objects).

Supports both concurrently running jobs and non-currently running jobs through the "concurrent" property. Jobs created by this MethodInvokingJobDetailFactoryBean are by default volatile and durable (according to Quartz terminology).

NOTE: JobDetails created via this FactoryBean are not serializable and thus not suitable for persistent job stores. You need to implement your own Quartz Job as a thin wrapper for each case where you want a persistent job to delegate to a specific service method.

Since:
18.02.2004
Author:
Juergen Hoeller, Alef Arendsen
See Also:
setTargetBeanName(java.lang.String),
MethodInvoker.setTargetObject(java.lang.Object),
MethodInvoker.setTargetMethod(java.lang.String),
setConcurrent(boolean)

Nested Class Summary
static class | MethodInvokingJobDetailFactoryBean.MethodInvokingJob Quartz Job implementation that invokes a specified method.
static class | MethodInvokingJobDetailFactoryBean.StatefulMethodInvokingJob Extension of the MethodInvokingJob, implementing the StatefulJob interface.
Constructor Summary
MethodInvokingJobDetailFactoryBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 Object getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<?> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 Class getTargetClass()
Overridden to support the "targetBeanName" feature.
 Object getTargetObject()
Overridden to support the "targetBeanName" feature.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
protected  void postProcessJobDetail(org.quartz.JobDetail jobDetail)
Callback for post-processing the JobDetail to be exposed by this FactoryBean.
protected  Class resolveClassName(String className)
Resolve the given class name into a Class.
 void setBeanClassLoader(ClassLoader classLoader)
Callback that supplies the bean class loader to a bean instance.
 void setBeanFactory(BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance.
 void setBeanName(String beanName)
Set the name of the bean in the bean factory that created this bean.
 void setConcurrent(boolean concurrent)
Specify whether or not multiple jobs should be run in a concurrent fashion.
 void setGroup(String group)
Set the group of the job.
 void setJobListenerNames(String[] names)
Set a list of JobListener names for this job, referring to non-global JobListeners registered with the Scheduler.
 void setName(String name)
Set the name of the job.
 void setTargetBeanName(String targetBeanName)
Set the name of the target bean in the Spring BeanFactory.
Methods inherited from class org.springframework.beans.support.ArgumentConvertingMethodInvoker
doFindMatchingMethod, findMatchingMethod, getDefaultTypeConverter, getTypeConverter, registerCustomEditor, setTypeConverter
Methods inherited from class org.springframework.util.MethodInvoker
getArguments, getPreparedMethod, getTargetMethod, getTypeDifferenceWeight, invoke, isPrepared, prepare, setArguments, setStaticMethod, setTargetClass, setTargetMethod, setTargetObject
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MethodInvokingJobDetailFactoryBean

public MethodInvokingJobDetailFactoryBean()
Method Detail

setName

public void setName(String name)
Set the name of the job.

Default is the bean name of this FactoryBean.

See Also:
JobDetail.setName(java.lang.String)

setGroup

public void setGroup(String group)
Set the group of the job.

Default is the default group of the Scheduler.

See Also:
JobDetail.setGroup(java.lang.String), Scheduler.DEFAULT_GROUP

setConcurrent

public void setConcurrent(boolean concurrent)
Specify whether or not multiple jobs should be run in a concurrent fashion. The behavior when one does not want concurrent jobs to be executed is realized through adding the StatefulJob interface. More information on stateful versus stateless jobs can be found here.

The default setting is to run jobs concurrently.

setTargetBeanName

public void setTargetBeanName(String targetBeanName)
Set the name of the target bean in the Spring BeanFactory.

This is an alternative to specifying "targetObject", allowing for non-singleton beans to be invoked. Note that specified "targetObject" and "targetClass" values will override the corresponding effect of this "targetBeanName" setting (i.e. statically pre-define the bean type or even the bean object).

setJobListenerNames

public void setJobListenerNames(String[] names)
Set a list of JobListener names for this job, referring to non-global JobListeners registered with the Scheduler.

A JobListener name always refers to the name returned by the JobListener implementation.

See Also:
SchedulerAccessor.setJobListeners(org.quartz.JobListener[]), JobListener.getName()

setBeanName

public void setBeanName(String beanName)
Description copied from interface: BeanNameAware
Set the name of the bean in the bean factory that created this bean.

Invoked after population of normal bean properties but before an init callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanName in interface BeanNameAware
Parameters:
beanName - the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use the BeanFactoryUtils.originalBeanName(String) method to extract the original bean name (without suffix), if desired.

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
BeanInitializationException

resolveClassName

protected Class resolveClassName(String className)
                          throws ClassNotFoundException
Description copied from class: MethodInvoker
Resolve the given class name into a Class.

The default implementations uses ClassUtils.forName, using the thread context class loader.

Overrides:
resolveClassName in class MethodInvoker
Parameters:
className - the class name to resolve
Returns:
the resolved Class
Throws:
ClassNotFoundException - if the class name was invalid

afterPropertiesSet

public void afterPropertiesSet()
                        throws ClassNotFoundException,
                               NoSuchMethodException
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
ClassNotFoundException
NoSuchMethodException

postProcessJobDetail

protected void postProcessJobDetail(org.quartz.JobDetail jobDetail)
Callback for post-processing the JobDetail to be exposed by this FactoryBean.

The default implementation is empty. Can be overridden in subclasses.

Parameters:
jobDetail - the JobDetail prepared by this FactoryBean

getTargetClass

public Class getTargetClass()
Overridden to support the "targetBeanName" feature.

Overrides:
getTargetClass in class MethodInvoker

getTargetObject

public Object getTargetObject()
Overridden to support the "targetBeanName" feature.

Overrides:
getTargetObject in class MethodInvoker

getObject

public Object getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<Object>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<?> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<Object>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<Object>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MethodInvokingJobDetailFactoryBean.MethodInvokingJob

org.springframework.scheduling.quartz
Class MethodInvokingJobDetailFactoryBean.MethodInvokingJob

java.lang.Object
    extended by  org.springframework.scheduling.quartz.QuartzJobBean
        extended by  org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean.MethodInvokingJob
All Implemented Interfaces:
org.quartz.Job
Direct Known Subclasses:
MethodInvokingJobDetailFactoryBean.StatefulMethodInvokingJob
Enclosing class:
MethodInvokingJobDetailFactoryBean
public static class MethodInvokingJobDetailFactoryBean.MethodInvokingJob
extends QuartzJobBean

Quartz Job implementation that invokes a specified method. Automatically applied by MethodInvokingJobDetailFactoryBean.

Field Summary
protected static Log logger
Constructor Summary
MethodInvokingJobDetailFactoryBean.MethodInvokingJob()
Method Summary
protected void | executeInternal(org.quartz.JobExecutionContext context) Invoke the method via the MethodInvoker.
void | setMethodInvoker(MethodInvoker methodInvoker) Set the MethodInvoker to use.
Methods inherited from class org.springframework.scheduling.quartz.QuartzJobBean
execute
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected static final Log logger
Constructor Detail

MethodInvokingJobDetailFactoryBean.MethodInvokingJob

public MethodInvokingJobDetailFactoryBean.MethodInvokingJob()
Method Detail

setMethodInvoker

public void setMethodInvoker(MethodInvoker methodInvoker)
Set the MethodInvoker to use.

executeInternal

protected void executeInternal(org.quartz.JobExecutionContext context)
                        throws org.quartz.JobExecutionException
Invoke the method via the MethodInvoker.

Specified by:
executeInternal in class QuartzJobBean
Throws:
org.quartz.JobExecutionException
See Also:
QuartzJobBean.execute(org.quartz.JobExecutionContext)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MethodInvokingJobDetailFactoryBean.StatefulMethodInvokingJob

org.springframework.scheduling.quartz
Class MethodInvokingJobDetailFactoryBean.StatefulMethodInvokingJob

java.lang.Object
    extended by  org.springframework.scheduling.quartz.QuartzJobBean
        extended by  org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean.MethodInvokingJob
            extended by  org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean.StatefulMethodInvokingJob
All Implemented Interfaces:
org.quartz.Job, org.quartz.StatefulJob
Enclosing class:
MethodInvokingJobDetailFactoryBean
public static class MethodInvokingJobDetailFactoryBean.StatefulMethodInvokingJob
extends MethodInvokingJobDetailFactoryBean.MethodInvokingJob
implements org.quartz.StatefulJob

Extension of the MethodInvokingJob, implementing the StatefulJob interface. Quartz checks whether or not jobs are stateful and if so, won't let jobs interfere with each other.

Field Summary
Fields inherited from class org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean.MethodInvokingJob
logger
Constructor Summary
MethodInvokingJobDetailFactoryBean.StatefulMethodInvokingJob()
Method Summary
Methods inherited from class org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean.MethodInvokingJob
executeInternal, setMethodInvoker
Methods inherited from class org.springframework.scheduling.quartz.QuartzJobBean
execute
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.quartz.Job
execute

Constructor Detail

MethodInvokingJobDetailFactoryBean.StatefulMethodInvokingJob

public MethodInvokingJobDetailFactoryBean.StatefulMethodInvokingJob()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


QuartzJobBean

org.springframework.scheduling.quartz
Class QuartzJobBean

java.lang.Object
    extended by  org.springframework.scheduling.quartz.QuartzJobBean
All Implemented Interfaces:
org.quartz.Job
Direct Known Subclasses:
MethodInvokingJobDetailFactoryBean.MethodInvokingJob
public abstract class QuartzJobBean
extends Object
implements org.quartz.Job

Simple implementation of the Quartz Job interface, applying the passed-in JobDataMap and also the SchedulerContext as bean property values. This is appropriate because a new Job instance will be created for each execution. JobDataMap entries will override SchedulerContext entries with the same keys.

For example, let's assume that the JobDataMap contains a key "myParam" with value "5": The Job implementation can then expose a bean property "myParam" of type int to receive such a value, i.e. a method "setMyParam(int)". This will also work for complex types like business objects etc.

Note: The QuartzJobBean class itself only implements the standard Quartz Job interface. Let your subclass explicitly implement the Quartz StatefulJob interface to mark your concrete job bean as stateful.

This version of QuartzJobBean requires Quartz 1.5 or higher, due to the support for trigger-specific job data.

Note that as of Spring 2.0 and Quartz 1.5, the preferred way to apply dependency injection to Job instances is via a JobFactory: that is, to specify SpringBeanJobFactory as Quartz JobFactory (typically via SchedulerFactoryBean.setJobFactory(org.quartz.spi.JobFactory) SchedulerFactoryBean's "jobFactory" property}). This allows to implement dependency-injected Quartz Jobs without a dependency on Spring base classes.

Since:
18.02.2004
Author:
Juergen Hoeller
See Also:
JobExecutionContext.getMergedJobDataMap(),
Scheduler.getContext(),
JobDetailBean.setJobDataAsMap(java.util.Map),
SimpleTriggerBean.setJobDataAsMap(java.util.Map),
CronTriggerBean.setJobDataAsMap(java.util.Map),
SchedulerFactoryBean.setSchedulerContextAsMap(java.util.Map),
SpringBeanJobFactory,
SchedulerFactoryBean.setJobFactory(org.quartz.spi.JobFactory)

Constructor Summary
QuartzJobBean()
Method Summary
void | execute(org.quartz.JobExecutionContext context) This implementation applies the passed-in job data map as bean property values, and delegates to executeInternal afterwards.
protected abstract void | executeInternal(org.quartz.JobExecutionContext context) Execute the actual job.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

QuartzJobBean

public QuartzJobBean()
Method Detail

execute

public final void execute(org.quartz.JobExecutionContext context)
                   throws org.quartz.JobExecutionException
This implementation applies the passed-in job data map as bean property values, and delegates to executeInternal afterwards.

Specified by:
execute in interface org.quartz.Job
Throws:
org.quartz.JobExecutionException
See Also:
executeInternal(org.quartz.JobExecutionContext)

executeInternal

protected abstract void executeInternal(org.quartz.JobExecutionContext context)
                                 throws org.quartz.JobExecutionException
Execute the actual job. The job data map will already have been applied as bean property values by execute. The contract is exactly the same as for the standard Quartz execute method.

Throws:
org.quartz.JobExecutionException
See Also:
execute(org.quartz.JobExecutionContext)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResourceLoaderClassLoadHelper

org.springframework.scheduling.quartz
Class ResourceLoaderClassLoadHelper

java.lang.Object
    extended by  org.springframework.scheduling.quartz.ResourceLoaderClassLoadHelper
All Implemented Interfaces:
org.quartz.spi.ClassLoadHelper
public class ResourceLoaderClassLoadHelper
extends Object
implements org.quartz.spi.ClassLoadHelper

Wrapper that adapts from the Quartz ClassLoadHelper interface onto Spring's ResourceLoader interface. Used by default when the SchedulerFactoryBean runs in a Spring ApplicationContext.

Since:
2.5.5
Author:
Juergen Hoeller
See Also:
SchedulerFactoryBean.setApplicationContext(org.springframework.context.ApplicationContext)

Field Summary
protected static Log logger
Constructor Summary
ResourceLoaderClassLoadHelper()
Create a new ResourceLoaderClassLoadHelper for the default ResourceLoader.
ResourceLoaderClassLoadHelper(ResourceLoader resourceLoader)
Create a new ResourceLoaderClassLoadHelper for the given ResourceLoader.
Method Summary
ClassLoader | getClassLoader()
URL | getResource(String name)
InputStream | getResourceAsStream(String name)
void | initialize()
Class | loadClass(String name)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected static final Log logger
Constructor Detail

ResourceLoaderClassLoadHelper

public ResourceLoaderClassLoadHelper()
Create a new ResourceLoaderClassLoadHelper for the default ResourceLoader.

See Also:
SchedulerFactoryBean.getConfigTimeResourceLoader()

ResourceLoaderClassLoadHelper

public ResourceLoaderClassLoadHelper(ResourceLoader resourceLoader)
Create a new ResourceLoaderClassLoadHelper for the given ResourceLoader.

Parameters:
resourceLoader - the ResourceLoader to delegate to
Method Detail

initialize

public void initialize()
Specified by:
initialize in interface org.quartz.spi.ClassLoadHelper

loadClass

public Class loadClass(String name)
                throws ClassNotFoundException
Specified by:
loadClass in interface org.quartz.spi.ClassLoadHelper
Throws:
ClassNotFoundException

getResource

public URL getResource(String name)
Specified by:
getResource in interface org.quartz.spi.ClassLoadHelper

getResourceAsStream

public InputStream getResourceAsStream(String name)
Specified by:
getResourceAsStream in interface org.quartz.spi.ClassLoadHelper

getClassLoader

public ClassLoader getClassLoader()
Specified by:
getClassLoader in interface org.quartz.spi.ClassLoadHelper
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SchedulerAccessor

org.springframework.scheduling.quartz
Class SchedulerAccessor

java.lang.Object
    extended by  org.springframework.scheduling.quartz.SchedulerAccessor
All Implemented Interfaces:
ResourceLoaderAware
Direct Known Subclasses:
SchedulerAccessorBean, SchedulerFactoryBean
public abstract class SchedulerAccessor
extends Object
implements ResourceLoaderAware

Common base class for accessing a Quartz Scheduler, i.e. for registering jobs, triggers and listeners on a Scheduler instance.

For concrete usage, check out the SchedulerFactoryBean and SchedulerAccessorBean classes.

Since:
2.5.6
Author:
Juergen Hoeller

Field Summary
protected Log | logger
protected ResourceLoader | resourceLoader
Constructor Summary
SchedulerAccessor()
Method Summary
protected abstract org.quartz.Scheduler | getScheduler() Template method that determines the Scheduler to operate on.
protected void | registerJobsAndTriggers() Register jobs and triggers (within a transaction, if possible).
protected void | registerListeners() Register all specified listeners with the Scheduler.
void | setCalendars(Map<String,org.quartz.Calendar> calendars) Register a list of Quartz Calendar objects with the Scheduler that this FactoryBean creates, to be referenced by Triggers.
void | setGlobalJobListeners(org.quartz.JobListener[] globalJobListeners) Specify global Quartz JobListeners to be registered with the Scheduler.
void | setGlobalTriggerListeners(org.quartz.TriggerListener[] globalTriggerListeners) Specify global Quartz TriggerListeners to be registered with the Scheduler.
void | setJobDetails(org.quartz.JobDetail[] jobDetails) Register a list of JobDetail objects with the Scheduler that this FactoryBean creates, to be referenced by Triggers.
void | setJobListeners(org.quartz.JobListener[] jobListeners) Specify named Quartz JobListeners to be registered with the Scheduler.
void | setJobSchedulingDataLocation(String jobSchedulingDataLocation) Set the location of a Quartz job definition XML file that follows the "job_scheduling_data_1_5" XSD.
void | setJobSchedulingDataLocations(String[] jobSchedulingDataLocations) Set the locations of Quartz job definition XML files that follow the "job_scheduling_data_1_5" XSD.
void | setOverwriteExistingJobs(boolean overwriteExistingJobs) Set whether any jobs defined on this SchedulerFactoryBean should overwrite existing job definitions.
void | setResourceLoader(ResourceLoader resourceLoader) Set the ResourceLoader that this object runs in.
void | setSchedulerListeners(org.quartz.SchedulerListener[] schedulerListeners) Specify Quartz SchedulerListeners to be registered with the Scheduler.
void | setTransactionManager(PlatformTransactionManager transactionManager) Set the transaction manager to be used for registering jobs and triggers that are defined by this SchedulerFactoryBean.
void | setTriggerListeners(org.quartz.TriggerListener[] triggerListeners) Specify named Quartz TriggerListeners to be registered with the Scheduler.
void | setTriggers(org.quartz.Trigger[] triggers) Register a list of Trigger objects with the Scheduler that this FactoryBean creates.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger

resourceLoader

protected ResourceLoader resourceLoader
Constructor Detail

SchedulerAccessor

public SchedulerAccessor()
Method Detail

setOverwriteExistingJobs

public void setOverwriteExistingJobs(boolean overwriteExistingJobs)
Set whether any jobs defined on this SchedulerFactoryBean should overwrite existing job definitions. Default is "false", to not overwrite already registered jobs that have been read in from a persistent job store.

setJobSchedulingDataLocation

public void setJobSchedulingDataLocation(String jobSchedulingDataLocation)
Set the location of a Quartz job definition XML file that follows the "job_scheduling_data_1_5" XSD. Can be specified to automatically register jobs that are defined in such a file, possibly in addition to jobs defined directly on this SchedulerFactoryBean.

See Also:
JobSchedulingDataProcessor

setJobSchedulingDataLocations

public void setJobSchedulingDataLocations(String[] jobSchedulingDataLocations)
Set the locations of Quartz job definition XML files that follow the "job_scheduling_data_1_5" XSD. Can be specified to automatically register jobs that are defined in such files, possibly in addition to jobs defined directly on this SchedulerFactoryBean.

See Also:
JobSchedulingDataProcessor

setJobDetails

public void setJobDetails(org.quartz.JobDetail[] jobDetails)
Register a list of JobDetail objects with the Scheduler that this FactoryBean creates, to be referenced by Triggers.

This is not necessary when a Trigger determines the JobDetail itself: In this case, the JobDetail will be implicitly registered in combination with the Trigger.

See Also:
setTriggers(org.quartz.Trigger[]), JobDetail, JobDetailBean, JobDetailAwareTrigger, Trigger.setJobName(java.lang.String)

setCalendars

public void setCalendars(Map<String,org.quartz.Calendar> calendars)
Register a list of Quartz Calendar objects with the Scheduler that this FactoryBean creates, to be referenced by Triggers.

Parameters:
calendars - Map with calendar names as keys as Calendar objects as values
See Also:
Calendar, Trigger.setCalendarName(java.lang.String)

setTriggers

public void setTriggers(org.quartz.Trigger[] triggers)
Register a list of Trigger objects with the Scheduler that this FactoryBean creates.

If the Trigger determines the corresponding JobDetail itself, the job will be automatically registered with the Scheduler. Else, the respective JobDetail needs to be registered via the "jobDetails" property of this FactoryBean.

See Also:
setJobDetails(org.quartz.JobDetail[]), JobDetail, JobDetailAwareTrigger, CronTriggerBean, SimpleTriggerBean

setSchedulerListeners

public void setSchedulerListeners(org.quartz.SchedulerListener[] schedulerListeners)
Specify Quartz SchedulerListeners to be registered with the Scheduler.

setGlobalJobListeners

public void setGlobalJobListeners(org.quartz.JobListener[] globalJobListeners)
Specify global Quartz JobListeners to be registered with the Scheduler. Such JobListeners will apply to all Jobs in the Scheduler.

setJobListeners

public void setJobListeners(org.quartz.JobListener[] jobListeners)
Specify named Quartz JobListeners to be registered with the Scheduler. Such JobListeners will only apply to Jobs that explicitly activate them via their name.

See Also:
JobListener.getName(),
JobDetail.addJobListener(java.lang.String),
JobDetailBean.setJobListenerNames(java.lang.String[])

setGlobalTriggerListeners

public void setGlobalTriggerListeners(org.quartz.TriggerListener[] globalTriggerListeners)
Specify global Quartz TriggerListeners to be registered with the Scheduler. Such TriggerListeners will apply to all Triggers in the Scheduler.

setTriggerListeners

public void setTriggerListeners(org.quartz.TriggerListener[] triggerListeners)
Specify named Quartz TriggerListeners to be registered with the Scheduler. Such TriggerListeners will only apply to Triggers that explicitly activate them via their name.

See Also:
TriggerListener.getName(),
Trigger.addTriggerListener(java.lang.String),
CronTriggerBean.setTriggerListenerNames(java.lang.String[]),
SimpleTriggerBean.setTriggerListenerNames(java.lang.String[])

setTransactionManager

public void setTransactionManager(PlatformTransactionManager transactionManager)
Set the transaction manager to be used for registering jobs and triggers that are defined by this SchedulerFactoryBean. Default is none; setting this only makes sense when specifying a DataSource for the Scheduler.

setResourceLoader

public void setResourceLoader(ResourceLoader resourceLoader)
Description copied from interface: ResourceLoaderAware
Set the ResourceLoader that this object runs in.

This might be a ResourcePatternResolver, which can be checked through instanceof ResourcePatternResolver. See also the ResourcePatternUtils.getResourcePatternResolver method.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked before ApplicationContextAware's setApplicationContext.

Specified by:
setResourceLoader in interface ResourceLoaderAware
Parameters:
resourceLoader - ResourceLoader object to be used by this object
See Also:
ResourcePatternResolver, ResourcePatternUtils.getResourcePatternResolver(org.springframework.core.io.ResourceLoader)

registerJobsAndTriggers

protected void registerJobsAndTriggers()
                                throws org.quartz.SchedulerException
Register jobs and triggers (within a transaction, if possible).

Throws:
org.quartz.SchedulerException

registerListeners

protected void registerListeners()
                          throws org.quartz.SchedulerException
Register all specified listeners with the Scheduler.

Throws:
org.quartz.SchedulerException

getScheduler

protected abstract org.quartz.Scheduler getScheduler()
Template method that determines the Scheduler to operate on. To be implemented by subclasses.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SchedulerAccessorBean

org.springframework.scheduling.quartz
Class SchedulerAccessorBean

java.lang.Object
    extended by  org.springframework.scheduling.quartz.SchedulerAccessor
        extended by  org.springframework.scheduling.quartz.SchedulerAccessorBean
All Implemented Interfaces:
BeanFactoryAware, InitializingBean, ResourceLoaderAware
public class SchedulerAccessorBean
extends SchedulerAccessor
implements BeanFactoryAware, InitializingBean

Spring bean-style class for accessing a Quartz Scheduler, i.e. for registering jobs, triggers and listeners on a given Scheduler instance.

Since:
2.5.6
Author:
Juergen Hoeller
See Also:
setScheduler(org.quartz.Scheduler), setSchedulerName(java.lang.String)

Field Summary
Fields inherited from class org.springframework.scheduling.quartz.SchedulerAccessor
logger, resourceLoader
Constructor Summary
SchedulerAccessorBean()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected org.quartz.Scheduler | findScheduler(String schedulerName)
org.quartz.Scheduler | getScheduler() Return the Quartz Scheduler instance that this accessor operates on.
void | setBeanFactory(BeanFactory beanFactory) Callback that supplies the owning factory to a bean instance.
void | setScheduler(org.quartz.Scheduler scheduler) Specify the Quartz Scheduler instance to operate on.
void | setSchedulerName(String schedulerName) Specify the Quartz Scheduler to operate on via its scheduler name in the Spring application context or also in the Quartz SchedulerRepository.
Methods inherited from class org.springframework.scheduling.quartz.SchedulerAccessor
registerJobsAndTriggers, registerListeners, setCalendars, setGlobalJobListeners, setGlobalTriggerListeners, setJobDetails, setJobListeners, setJobSchedulingDataLocation, setJobSchedulingDataLocations, setOverwriteExistingJobs, setResourceLoader, setSchedulerListeners, setTransactionManager, setTriggerListeners, setTriggers
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SchedulerAccessorBean

public SchedulerAccessorBean()
Method Detail

setSchedulerName

public void setSchedulerName(String schedulerName)
Specify the Quartz Scheduler to operate on via its scheduler name in the Spring application context or also in the Quartz SchedulerRepository.

Schedulers can be registered in the repository through custom bootstrapping, e.g. via the StdSchedulerFactory or DirectSchedulerFactory factory classes. However, in general, it's preferable to use Spring's SchedulerFactoryBean which includes the job/trigger/listener capabilities of this accessor as well.

setScheduler

public void setScheduler(org.quartz.Scheduler scheduler)
Specify the Quartz Scheduler instance to operate on.

getScheduler

public org.quartz.Scheduler getScheduler()
Return the Quartz Scheduler instance that this accessor operates on.

Specified by:
getScheduler in class SchedulerAccessor

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
BeanInitializationException

afterPropertiesSet

public void afterPropertiesSet()
                        throws org.quartz.SchedulerException
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
org.quartz.SchedulerException

findScheduler

protected org.quartz.Scheduler findScheduler(String schedulerName)
                                      throws org.quartz.SchedulerException
Throws:
org.quartz.SchedulerException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SchedulerFactoryBean

org.springframework.scheduling.quartz
Class SchedulerFactoryBean

java.lang.Object
    extended by  org.springframework.scheduling.quartz.SchedulerAccessor
        extended by  org.springframework.scheduling.quartz.SchedulerFactoryBean
All Implemented Interfaces:
BeanNameAware, DisposableBean, FactoryBean<org.quartz.Scheduler>, InitializingBean, ApplicationContextAware, Lifecycle, Phased, ResourceLoaderAware, SmartLifecycle
public class SchedulerFactoryBean
extends SchedulerAccessor
implements FactoryBean<org.quartz.Scheduler>, BeanNameAware, ApplicationContextAware, InitializingBean, DisposableBean, SmartLifecycle

FactoryBean that creates and configures a Quartz Scheduler, manages its lifecycle as part of the Spring application context, and exposes the Scheduler as bean reference for dependency injection.

Allows registration of JobDetails, Calendars and Triggers, automatically starting the scheduler on initialization and shutting it down on destruction. In scenarios that just require static registration of jobs at startup, there is no need to access the Scheduler instance itself in application code.

For dynamic registration of jobs at runtime, use a bean reference to this SchedulerFactoryBean to get direct access to the Quartz Scheduler (org.quartz.Scheduler). This allows you to create new jobs and triggers, and also to control and monitor the entire Scheduler.

Note that Quartz instantiates a new Job for each execution, in contrast to Timer which uses a TimerTask instance that is shared between repeated executions. Just JobDetail descriptors are shared.

When using persistent jobs, it is strongly recommended to perform all operations on the Scheduler within Spring-managed (or plain JTA) transactions. Else, database locking will not properly work and might even break. (See setDataSource javadoc for details.)

The preferred way to achieve transactional execution is to demarcate declarative transactions at the business facade level, which will automatically apply to Scheduler operations performed within those scopes. Alternatively, you may add transactional advice for the Scheduler itself.

Note: This version of Spring's SchedulerFactoryBean requires Quartz 1.5.x or 1.6.x. The "jobSchedulingDataLocation" feature requires Quartz 1.6.1 or higher (as of Spring 2.5.5).

Since:
18.02.2004
Author:
Juergen Hoeller
See Also:
setDataSource(javax.sql.DataSource), Scheduler, SchedulerFactory, StdSchedulerFactory, TransactionProxyFactoryBean

Field Summary
static int | DEFAULT_THREAD_COUNT
static String | PROP_THREAD_COUNT
Fields inherited from class org.springframework.scheduling.quartz.SchedulerAccessor
logger, resourceLoader
Constructor Summary
SchedulerFactoryBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected  org.quartz.Scheduler createScheduler(org.quartz.SchedulerFactory schedulerFactory, String schedulerName)
Create the Scheduler instance for the given factory and scheduler name.
 void destroy()
Shut down the Quartz scheduler on bean factory shutdown, stopping all scheduled jobs.
static DataSource getConfigTimeDataSource()
Return the DataSource for the currently configured Quartz Scheduler, to be used by LocalDataSourceJobStore.
static DataSource getConfigTimeNonTransactionalDataSource()
Return the non-transactional DataSource for the currently configured Quartz Scheduler, to be used by LocalDataSourceJobStore.
static ResourceLoader getConfigTimeResourceLoader()
Return the ResourceLoader for the currently configured Quartz Scheduler, to be used by ResourceLoaderClassLoadHelper.
static Executor getConfigTimeTaskExecutor()
Return the TaskExecutor for the currently configured Quartz Scheduler, to be used by LocalTaskExecutorThreadPool.
 org.quartz.Scheduler getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<? extends org.quartz.Scheduler> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 int getPhase()
Return the phase in which this scheduler will be started and stopped.
 org.quartz.Scheduler getScheduler()
Template method that determines the Scheduler to operate on.
 boolean isAutoStartup()
Return whether this scheduler is configured for auto-startup.
 boolean isRunning()
Check whether this component is currently running.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setApplicationContext(ApplicationContext applicationContext)
Set the ApplicationContext that this object runs in.
 void setApplicationContextSchedulerContextKey(String applicationContextSchedulerContextKey)
Set the key of an ApplicationContext reference to expose in the SchedulerContext, for example "applicationContext".
 void setAutoStartup(boolean autoStartup)
Set whether to automatically start the scheduler after initialization.
 void setBeanName(String name)
Set the name of the bean in the bean factory that created this bean.
 void setConfigLocation(Resource configLocation)
Set the location of the Quartz properties config file, for example as classpath resource "classpath:quartz.properties".
 void setDataSource(DataSource dataSource)
Set the default DataSource to be used by the Scheduler.
 void setExposeSchedulerInRepository(boolean exposeSchedulerInRepository)
Set whether to expose the Spring-managed Scheduler instance in the Quartz SchedulerRepository.
 void setJobFactory(org.quartz.spi.JobFactory jobFactory)
Set the Quartz JobFactory to use for this Scheduler.
 void setNonTransactionalDataSource(DataSource nonTransactionalDataSource)
Set the DataSource to be used by the Scheduler for non-transactional access.
 void setPhase(int phase)
Specify the phase in which this scheduler should be started and stopped.
 void setQuartzProperties(Properties quartzProperties)
Set Quartz properties, like "org.quartz.threadPool.class".
 void setSchedulerContextAsMap(Map schedulerContextAsMap)
Register objects in the Scheduler context via a given Map.
 void setSchedulerFactoryClass(Class schedulerFactoryClass)
Set the Quartz SchedulerFactory implementation to use.
 void setSchedulerName(String schedulerName)
Set the name of the Scheduler to create via the SchedulerFactory.
 void setStartupDelay(int startupDelay)
Set the number of seconds to wait after initialization before starting the scheduler asynchronously.
 void setTaskExecutor(Executor taskExecutor)
Set the Spring TaskExecutor to use as Quartz backend.
 void setWaitForJobsToCompleteOnShutdown(boolean waitForJobsToCompleteOnShutdown)
Set whether to wait for running jobs to complete on shutdown.
 void start()
Start this component.
protected  void startScheduler(org.quartz.Scheduler scheduler, int startupDelay)
Start the Quartz Scheduler, respecting the "startupDelay" setting.
 void stop()
Stop this component.
 void stop(Runnable callback)
Indicates that a Lifecycle component must stop if it is currently running.
Methods inherited from class org.springframework.scheduling.quartz.SchedulerAccessor
registerJobsAndTriggers, registerListeners, setCalendars, setGlobalJobListeners, setGlobalTriggerListeners, setJobDetails, setJobListeners, setJobSchedulingDataLocation, setJobSchedulingDataLocations, setOverwriteExistingJobs, setResourceLoader, setSchedulerListeners, setTransactionManager, setTriggerListeners, setTriggers
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

PROP_THREAD_COUNT

public static final String PROP_THREAD_COUNT
See Also:
Constant Field Values

DEFAULT_THREAD_COUNT

public static final int DEFAULT_THREAD_COUNT
See Also:
Constant Field Values
Constructor Detail

SchedulerFactoryBean

public SchedulerFactoryBean()
Method Detail

getConfigTimeResourceLoader

public static ResourceLoader getConfigTimeResourceLoader()
Return the ResourceLoader for the currently configured Quartz Scheduler, to be used by ResourceLoaderClassLoadHelper.

This instance will be set before initialization of the corresponding Scheduler, and reset immediately afterwards. It is thus only available during configuration.

See Also:
setApplicationContext(org.springframework.context.ApplicationContext), ResourceLoaderClassLoadHelper

getConfigTimeTaskExecutor

public static Executor getConfigTimeTaskExecutor()
Return the TaskExecutor for the currently configured Quartz Scheduler, to be used by LocalTaskExecutorThreadPool.

This instance will be set before initialization of the corresponding Scheduler, and reset immediately afterwards. It is thus only available during configuration.

See Also:
setTaskExecutor(java.util.concurrent.Executor), LocalTaskExecutorThreadPool

getConfigTimeDataSource

public static DataSource getConfigTimeDataSource()
Return the DataSource for the currently configured Quartz Scheduler, to be used by LocalDataSourceJobStore.

This instance will be set before initialization of the corresponding Scheduler, and reset immediately afterwards. It is thus only available during configuration.

See Also:
setDataSource(javax.sql.DataSource), LocalDataSourceJobStore

getConfigTimeNonTransactionalDataSource

public static DataSource getConfigTimeNonTransactionalDataSource()
Return the non-transactional DataSource for the currently configured Quartz Scheduler, to be used by LocalDataSourceJobStore.

This instance will be set before initialization of the corresponding Scheduler, and reset immediately afterwards. It is thus only available during configuration.

See Also:
setNonTransactionalDataSource(javax.sql.DataSource), LocalDataSourceJobStore

setSchedulerFactoryClass

public void setSchedulerFactoryClass(Class schedulerFactoryClass)
Set the Quartz SchedulerFactory implementation to use.

Default is StdSchedulerFactory, reading in the standard quartz.properties from quartz.jar. To use custom Quartz properties, specify the "configLocation" or "quartzProperties" bean property on this FactoryBean.

See Also:
StdSchedulerFactory, setConfigLocation(org.springframework.core.io.Resource), setQuartzProperties(java.util.Properties)

setSchedulerName

public void setSchedulerName(String schedulerName)
Set the name of the Scheduler to create via the SchedulerFactory.

If not specified, the bean name will be used as default scheduler name.

See Also:
setBeanName(java.lang.String),
SchedulerFactory.getScheduler(),
SchedulerFactory.getScheduler(String)

setConfigLocation

public void setConfigLocation(Resource configLocation)
Set the location of the Quartz properties config file, for example as classpath resource "classpath:quartz.properties".

Note: Can be omitted when all necessary properties are specified locally via this bean, or when relying on Quartz' default configuration.

See Also:
setQuartzProperties(java.util.Properties)

setQuartzProperties

public void setQuartzProperties(Properties quartzProperties)
Set Quartz properties, like "org.quartz.threadPool.class".

Can be used to override values in a Quartz properties config file, or to specify all necessary properties locally.

See Also:
setConfigLocation(org.springframework.core.io.Resource)

setTaskExecutor

public void setTaskExecutor(Executor taskExecutor)
Set the Spring TaskExecutor to use as Quartz backend. Exposed as thread pool through the Quartz SPI.

Can be used to assign a JDK 1.5 ThreadPoolExecutor or a CommonJ WorkManager as Quartz backend, to avoid Quartz's manual thread creation.

By default, a Quartz SimpleThreadPool will be used, configured through the corresponding Quartz properties.

See Also:
setQuartzProperties(java.util.Properties), LocalTaskExecutorThreadPool, ThreadPoolTaskExecutor, WorkManagerTaskExecutor

setDataSource

public void setDataSource(DataSource dataSource)
Set the default DataSource to be used by the Scheduler. If set, this will override corresponding settings in Quartz properties.

Note: If this is set, the Quartz settings should not define a job store "dataSource" to avoid meaningless double configuration.

A Spring-specific subclass of Quartz' JobStoreCMT will be used. It is therefore strongly recommended to perform all operations on the Scheduler within Spring-managed (or plain JTA) transactions. Else, database locking will not properly work and might even break (e.g. if trying to obtain a lock on Oracle without a transaction).

Supports both transactional and non-transactional DataSource access. With a non-XA DataSource and local Spring transactions, a single DataSource argument is sufficient. In case of an XA DataSource and global JTA transactions, SchedulerFactoryBean's "nonTransactionalDataSource" property should be set, passing in a non-XA DataSource that will not participate in global transactions.

See Also:
setNonTransactionalDataSource(javax.sql.DataSource),
setQuartzProperties(java.util.Properties),
SchedulerAccessor.setTransactionManager(org.springframework.transaction.PlatformTransactionManager),
LocalDataSourceJobStore

setNonTransactionalDataSource

public void setNonTransactionalDataSource(DataSource nonTransactionalDataSource)
Set the DataSource to be used by the Scheduler for non-transactional access.

This is only necessary if the default DataSource is an XA DataSource that will always participate in transactions: A non-XA version of that DataSource should be specified as "nonTransactionalDataSource" in such a scenario.

This is not relevant with a local DataSource instance and Spring transactions. Specifying a single default DataSource as "dataSource" is sufficient there.

See Also:
setDataSource(javax.sql.DataSource), LocalDataSourceJobStore

setSchedulerContextAsMap

public void setSchedulerContextAsMap(Map schedulerContextAsMap)
Register objects in the Scheduler context via a given Map. These objects will be available to any Job that runs in this Scheduler.

Note: When using persistent Jobs whose JobDetail will be kept in the database, do not put Spring-managed beans or an ApplicationContext reference into the JobDataMap but rather into the SchedulerContext.

Parameters:
schedulerContextAsMap - Map with String keys and any objects as values (for example Spring-managed beans)
See Also:
JobDetailBean.setJobDataAsMap(java.util.Map)

setApplicationContextSchedulerContextKey

public void setApplicationContextSchedulerContextKey(String applicationContextSchedulerContextKey)
Set the key of an ApplicationContext reference to expose in the SchedulerContext, for example "applicationContext". Default is none. Only applicable when running in a Spring ApplicationContext.

Note: When using persistent Jobs whose JobDetail will be kept in the database, do not put an ApplicationContext reference into the JobDataMap but rather into the SchedulerContext.

In case of a QuartzJobBean, the reference will be applied to the Job instance as bean property. An "applicationContext" attribute will correspond to a "setApplicationContext" method in that scenario.

Note that BeanFactory callback interfaces like ApplicationContextAware are not automatically applied to Quartz Job instances, because Quartz itself is reponsible for the lifecycle of its Jobs.

See Also:
JobDetailBean.setApplicationContextJobDataKey(java.lang.String), ApplicationContext

setJobFactory

public void setJobFactory(org.quartz.spi.JobFactory jobFactory)
Set the Quartz JobFactory to use for this Scheduler.

Default is Spring's AdaptableJobFactory, which supports Runnable objects as well as standard Quartz Job instances. Note that this default only applies to a local Scheduler, not to a RemoteScheduler (where setting a custom JobFactory is not supported by Quartz).

Specify an instance of Spring's SpringBeanJobFactory here (typically as an inner bean definition) to automatically populate a job's bean properties from the specified job data map and scheduler context.

See Also:
AdaptableJobFactory, SpringBeanJobFactory

setAutoStartup

public void setAutoStartup(boolean autoStartup)
Set whether to automatically start the scheduler after initialization.

Default is "true"; set this to "false" to allow for manual startup.

isAutoStartup

public boolean isAutoStartup()
Return whether this scheduler is configured for auto-startup. If "true", the scheduler will start after the context is refreshed and after the start delay, if any.

Specified by:
isAutoStartup in interface SmartLifecycle

setPhase

public void setPhase(int phase)
Specify the phase in which this scheduler should be started and stopped. The startup order proceeds from lowest to highest, and the shutdown order is the reverse of that. By default this value is Integer.MAX_VALUE meaning that this scheduler starts as late as possible and stops as soon as possible.

getPhase

public int getPhase()
Return the phase in which this scheduler will be started and stopped.

Specified by:
getPhase in interface Phased

setStartupDelay

public void setStartupDelay(int startupDelay)
Set the number of seconds to wait after initialization before starting the scheduler asynchronously. Default is 0, meaning immediate synchronous startup on initialization of this bean.

Setting this to 10 or 20 seconds makes sense if no jobs should be run before the entire application has started up.

setExposeSchedulerInRepository

public void setExposeSchedulerInRepository(boolean exposeSchedulerInRepository)
Set whether to expose the Spring-managed Scheduler instance in the Quartz SchedulerRepository. Default is "false", since the Spring-managed Scheduler is usually exclusively intended for access within the Spring context.

Switch this flag to "true" in order to expose the Scheduler globally. This is not recommended unless you have an existing Spring application that relies on this behavior. Note that such global exposure was the accidental default in earlier Spring versions; this has been fixed as of Spring 2.5.6.

setWaitForJobsToCompleteOnShutdown

public void setWaitForJobsToCompleteOnShutdown(boolean waitForJobsToCompleteOnShutdown)
Set whether to wait for running jobs to complete on shutdown.

Default is "false". Switch this to "true" if you prefer fully completed jobs at the expense of a longer shutdown phase.

See Also:
Scheduler.shutdown(boolean)

setBeanName

public void setBeanName(String name)
Description copied from interface: BeanNameAware
Set the name of the bean in the bean factory that created this bean.

Invoked after population of normal bean properties but before an init callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanName in interface BeanNameAware
Parameters:
name - the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use the BeanFactoryUtils.originalBeanName(String) method to extract the original bean name (without suffix), if desired.

setApplicationContext

public void setApplicationContext(ApplicationContext applicationContext)
Description copied from interface: ApplicationContextAware
Set the ApplicationContext that this object runs in. Normally this call will be used to initialize the object.

Invoked after population of normal bean properties but before an init callback such as InitializingBean.afterPropertiesSet() or a custom init-method. Invoked after ResourceLoaderAware.setResourceLoader(org.springframework.core.io.ResourceLoader), ApplicationEventPublisherAware.setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher) and MessageSourceAware, if applicable.

Specified by:
setApplicationContext in interface ApplicationContextAware
Parameters:
applicationContext - the ApplicationContext object to be used by this object
See Also:
BeanInitializationException

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception - in the event of misconfiguration (such as failure to set an essential property) or if initialization fails.

createScheduler

protected org.quartz.Scheduler createScheduler(org.quartz.SchedulerFactory schedulerFactory,
                                               String schedulerName)
                                        throws org.quartz.SchedulerException
Create the Scheduler instance for the given factory and scheduler name. Called by afterPropertiesSet().

The default implementation invokes SchedulerFactory's getScheduler method. Can be overridden for custom Scheduler creation.

Parameters:
schedulerFactory - the factory to create the Scheduler with
schedulerName - the name of the scheduler to create
Returns:
the Scheduler instance
Throws:
org.quartz.SchedulerException - if thrown by Quartz methods
See Also:
afterPropertiesSet(), SchedulerFactory.getScheduler()

startScheduler

protected void startScheduler(org.quartz.Scheduler scheduler,
                              int startupDelay)
                       throws org.quartz.SchedulerException
Start the Quartz Scheduler, respecting the "startupDelay" setting.

Parameters:
scheduler - the Scheduler to start
startupDelay - the number of seconds to wait before starting the Scheduler asynchronously
Throws:
org.quartz.SchedulerException

getScheduler

public org.quartz.Scheduler getScheduler()
Description copied from class: SchedulerAccessor
Template method that determines the Scheduler to operate on. To be implemented by subclasses.

Specified by:
getScheduler in class SchedulerAccessor

getObject

public org.quartz.Scheduler getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<org.quartz.Scheduler>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends org.quartz.Scheduler> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<org.quartz.Scheduler>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<org.quartz.Scheduler>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()

start

public void start()
           throws SchedulingException
Description copied from interface: Lifecycle
Start this component. Should not throw an exception if the component is already running.

In the case of a container, this will propagate the start signal to all components that apply.

Specified by:
start in interface Lifecycle
Throws:
SchedulingException

stop

public void stop()
          throws SchedulingException
Description copied from interface: Lifecycle
Stop this component. Should not throw an exception if the component isn't started yet.

In the case of a container, this will propagate the stop signal to all components that apply.

Specified by:
stop in interface Lifecycle
Throws:
SchedulingException

stop

public void stop(Runnable callback)
          throws SchedulingException
Description copied from interface: SmartLifecycle
Indicates that a Lifecycle component must stop if it is currently running.

The provided callback is used by the LifecycleProcessor to support an ordered, and potentially concurrent, shutdown of all components having a common shutdown order value. The callback must be executed after the SmartLifecycle component does indeed stop.

Specified by:
stop in interface SmartLifecycle
Throws:
SchedulingException

isRunning

public boolean isRunning()
                  throws SchedulingException
Description copied from interface: Lifecycle
Check whether this component is currently running.

In the case of a container, this will return true only if all components that apply are currently running.

Specified by:
isRunning in interface Lifecycle
Returns:
whether the component is currently running
Throws:
SchedulingException

destroy

public void destroy()
             throws org.quartz.SchedulerException
Shut down the Quartz scheduler on bean factory shutdown, stopping all scheduled jobs.

Specified by:
destroy in interface DisposableBean
Throws:
org.quartz.SchedulerException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleThreadPoolTaskExecutor

org.springframework.scheduling.quartz
Class SimpleThreadPoolTaskExecutor

java.lang.Object
    extended by  org.quartz.simpl.SimpleThreadPool
        extended by  org.springframework.scheduling.quartz.SimpleThreadPoolTaskExecutor
All Implemented Interfaces:
Executor, org.quartz.spi.ThreadPool, DisposableBean, InitializingBean, AsyncTaskExecutor, TaskExecutor, SchedulingTaskExecutor
public class SimpleThreadPoolTaskExecutor
extends org.quartz.simpl.SimpleThreadPool
implements SchedulingTaskExecutor, InitializingBean, DisposableBean

Subclass of Quartz's SimpleThreadPool that implements Spring's TaskExecutor interface and listens to Spring lifecycle callbacks.

Can be shared between a Quartz Scheduler (specified as "taskExecutor") and other TaskExecutor users, or even used completely independent of a Quartz Scheduler (as plain TaskExecutor backend).

Since:
2.0
Author:
Juergen Hoeller
See Also:
SimpleThreadPool, TaskExecutor, SchedulerFactoryBean.setTaskExecutor(java.util.concurrent.Executor)

Field Summary
Fields inherited from interface org.springframework.core.task.AsyncTaskExecutor
TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE
Constructor Summary
SimpleThreadPoolTaskExecutor()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 void destroy()
Invoked by a BeanFactory on destruction of a singleton.
 void execute(Runnable task)
Execute the given task.
 void execute(Runnable task, long startTimeout)
Execute the given task.
 boolean prefersShortLivedTasks()
This task executor prefers short-lived work units.
 void setWaitForJobsToCompleteOnShutdown(boolean waitForJobsToCompleteOnShutdown)
Set whether to wait for running jobs to complete on shutdown.
<T> Future<T>
submit(Callable<T> task)
Submit a Callable task for execution, receiving a Future representing that task.
 Future<?> submit(Runnable task)
Submit a Runnable task for execution, receiving a Future representing that task.
Methods inherited from class org.quartz.simpl.SimpleThreadPool
blockForAvailableThreads, createWorkerThreads, getLog, getPoolSize, getThreadCount, getThreadNamePrefix, getThreadPriority, initialize, isMakeThreadsDaemons, isThreadsInheritContextClassLoaderOfInitializingThread, isThreadsInheritGroupOfInitializingThread, makeAvailable, runInThread, setMakeThreadsDaemons, setThreadCount, setThreadNamePrefix, setThreadPriority, setThreadsInheritContextClassLoaderOfInitializingThread, setThreadsInheritGroupOfInitializingThread, shutdown, shutdown
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleThreadPoolTaskExecutor

public SimpleThreadPoolTaskExecutor()
Method Detail

setWaitForJobsToCompleteOnShutdown

public void setWaitForJobsToCompleteOnShutdown(boolean waitForJobsToCompleteOnShutdown)
Set whether to wait for running jobs to complete on shutdown. Default is "false".

See Also:
SimpleThreadPool.shutdown(boolean)

afterPropertiesSet

public void afterPropertiesSet()
                        throws org.quartz.SchedulerConfigException
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
org.quartz.SchedulerConfigException

execute

public void execute(Runnable task)
Description copied from interface: TaskExecutor
Execute the given task.

The call might return immediately if the implementation uses an asynchronous execution strategy, or might block in the case of synchronous execution.

Specified by:
execute in interface Executor
Specified by:
execute in interface TaskExecutor
Parameters:
task - the Runnable to execute (never null)

execute

public void execute(Runnable task,
                    long startTimeout)
Description copied from interface: AsyncTaskExecutor
Execute the given task.

Specified by:
execute in interface AsyncTaskExecutor
Parameters:
task - the Runnable to execute (never null)
startTimeout - the time duration (milliseconds) within which the task is supposed to start. This is intended as a hint to the executor, allowing for preferred handling of immediate tasks. Typical values are AsyncTaskExecutor.TIMEOUT_IMMEDIATE or AsyncTaskExecutor.TIMEOUT_INDEFINITE (the default as used by TaskExecutor.execute(Runnable)).

submit

public Future<?> submit(Runnable task)
Description copied from interface: AsyncTaskExecutor
Submit a Runnable task for execution, receiving a Future representing that task. The Future will return a null result upon completion.

Specified by:
submit in interface AsyncTaskExecutor
Parameters:
task - the Runnable to execute (never null)
Returns:
a Future representing pending completion of the task

submit

public <T> Future<T> submit(Callable<T> task)
Description copied from interface: AsyncTaskExecutor
Submit a Callable task for execution, receiving a Future representing that task. The Future will return the Callable's result upon completion.

Specified by:
submit in interface AsyncTaskExecutor
Parameters:
task - the Callable to execute (never null)
Returns:
a Future representing pending completion of the task

prefersShortLivedTasks

public boolean prefersShortLivedTasks()
This task executor prefers short-lived work units.

Specified by:
prefersShortLivedTasks in interface SchedulingTaskExecutor
Returns:
true if this TaskExecutor prefers short-lived tasks

destroy

public void destroy()
Description copied from interface: DisposableBean
Invoked by a BeanFactory on destruction of a singleton.

Specified by:
destroy in interface DisposableBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleTriggerBean

org.springframework.scheduling.quartz
Class SimpleTriggerBean

java.lang.Object
    extended by  org.quartz.Trigger
        extended by  org.quartz.SimpleTrigger
            extended by  org.springframework.scheduling.quartz.SimpleTriggerBean
All Implemented Interfaces:
Serializable, Cloneable, Comparable, BeanNameAware, InitializingBean, JobDetailAwareTrigger
public class SimpleTriggerBean
extends org.quartz.SimpleTrigger
implements JobDetailAwareTrigger, BeanNameAware, InitializingBean

Convenience subclass of Quartz's SimpleTrigger class, making bean-style usage easier.

SimpleTrigger itself is already a JavaBean but lacks sensible defaults. This class uses the Spring bean name as job name, the Quartz default group ("DEFAULT") as job group, the current time as start time, and indefinite repetition, if not specified.

This class will also register the trigger with the job name and group of a given JobDetail. This allows SchedulerFactoryBean to automatically register a trigger for the corresponding JobDetail, instead of registering the JobDetail separately.

NOTE: This convenience subclass does not work with trigger persistence in Quartz 1.6, due to a change in Quartz's trigger handling. Use Quartz 1.5 if you rely on trigger persistence based on this class, or the standard Quartz SimpleTrigger class instead.

Since:
18.02.2004
Author:
Juergen Hoeller
See Also:
Trigger.setName(java.lang.String),
Trigger.setGroup(java.lang.String),
SimpleTrigger.setStartTime(java.util.Date),
Trigger.setJobName(java.lang.String),
Trigger.setJobGroup(java.lang.String),
setJobDetail(org.quartz.JobDetail),
SchedulerAccessor.setTriggers(org.quartz.Trigger[]),
SchedulerAccessor.setJobDetails(org.quartz.JobDetail[]),
CronTriggerBean,
Serialized Form

Field Summary
Fields inherited from class org.quartz.SimpleTrigger
MISFIRE_INSTRUCTION_FIRE_NOW, MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_EXISTING_COUNT, MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT, MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT, MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_REMAINING_REPEAT_COUNT, REPEAT_INDEFINITELY
Fields inherited from class org.quartz.Trigger
DEFAULT_PRIORITY, INSTRUCTION_DELETE_TRIGGER, INSTRUCTION_NOOP, INSTRUCTION_RE_EXECUTE_JOB, INSTRUCTION_SET_ALL_JOB_TRIGGERS_COMPLETE, INSTRUCTION_SET_ALL_JOB_TRIGGERS_ERROR, INSTRUCTION_SET_TRIGGER_COMPLETE, INSTRUCTION_SET_TRIGGER_ERROR, MISFIRE_INSTRUCTION_SMART_POLICY, STATE_BLOCKED, STATE_COMPLETE, STATE_ERROR, STATE_NONE, STATE_NORMAL, STATE_PAUSED
Constructor Summary
SimpleTriggerBean()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
org.quartz.JobDetail | getJobDetail() Return the JobDetail that this Trigger is associated with.
void | setBeanName(String beanName) Set the name of the bean in the bean factory that created this bean.
void | setJobDataAsMap(Map jobDataAsMap) Register objects in the JobDataMap via a given Map.
void | setJobDetail(org.quartz.JobDetail jobDetail) Set the JobDetail that this trigger should be associated with.
void | setMisfireInstructionName(String constantName) Set the misfire instruction via the name of the corresponding constant in the SimpleTrigger class.
void | setStartDelay(long startDelay) Set the delay before starting the job for the first time.
void | setTriggerListenerNames(String[] names) Set a list of TriggerListener names for this job, referring to non-global TriggerListeners registered with the Scheduler.
Methods inherited from class org.quartz.SimpleTrigger
computeFirstFireTime, computeNumTimesFiredBetween, executionComplete, getEndTime, getFinalFireTime, getFireTimeAfter, getFireTimeBefore, getNextFireTime, getPreviousFireTime, getRepeatCount, getRepeatInterval, getStartTime, getTimesTriggered, hasAdditionalProperties, main, mayFireAgain, setEndTime, setNextFireTime, setPreviousFireTime, setRepeatCount, setRepeatInterval, setStartTime, setTimesTriggered, triggered, updateAfterMisfire, updateWithNewCalendar, validate, validateMisfireInstruction
Methods inherited from class org.quartz.Trigger
addTriggerListener, clearAllTriggerListeners, clone, compareTo, equals, getCalendarName, getDescription, getFireInstanceId, getFullJobName, getFullName, getGroup, getJobDataMap, getJobGroup, getJobName, getKey, getMisfireInstruction, getName, getPriority, getTriggerListenerNames, hashCode, isVolatile, removeTriggerListener, setCalendarName, setDescription, setFireInstanceId, setGroup, setJobDataMap, setJobGroup, setJobName, setMisfireInstruction, setName, setPriority, setVolatility, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

SimpleTriggerBean

public SimpleTriggerBean()
Method Detail

setJobDataAsMap

public void setJobDataAsMap(Map jobDataAsMap)
Register objects in the JobDataMap via a given Map.

These objects will be available to this Trigger only, in contrast to objects in the JobDetail's data map.

Parameters:
jobDataAsMap - Map with String keys and any objects as values (for example Spring-managed beans)
See Also:
JobDetailBean.setJobDataAsMap(java.util.Map)

setMisfireInstructionName

public void setMisfireInstructionName(String constantName)
Set the misfire instruction via the name of the corresponding constant in the SimpleTrigger class. Default is MISFIRE_INSTRUCTION_SMART_POLICY.

See Also:
SimpleTrigger.MISFIRE_INSTRUCTION_FIRE_NOW, SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_EXISTING_COUNT, SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT, SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT, SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_REMAINING_REPEAT_COUNT, Trigger.MISFIRE_INSTRUCTION_SMART_POLICY

setTriggerListenerNames

public void setTriggerListenerNames(String[] names)
Set a list of TriggerListener names for this job, referring to non-global TriggerListeners registered with the Scheduler.

A TriggerListener name always refers to the name returned by the TriggerListener implementation.

See Also:
SchedulerAccessor.setTriggerListeners(org.quartz.TriggerListener[]), TriggerListener.getName()

setStartDelay

public void setStartDelay(long startDelay)
Set the delay before starting the job for the first time. The given number of milliseconds will be added to the current time to calculate the start time. Default is 0.

This delay will just be applied if no custom start time was specified. However, in typical usage within a Spring context, the start time will be the container startup time anyway. Specifying a relative delay is appropriate in that case.

See Also:
SimpleTrigger.setStartTime(java.util.Date)

setJobDetail

public void setJobDetail(org.quartz.JobDetail jobDetail)
Set the JobDetail that this trigger should be associated with.

This is typically used with a bean reference if the JobDetail is a Spring-managed bean. Alternatively, the trigger can also be associated with a job by name and group.

See Also:
Trigger.setJobName(java.lang.String), Trigger.setJobGroup(java.lang.String)

getJobDetail

public org.quartz.JobDetail getJobDetail()
Description copied from interface: JobDetailAwareTrigger
Return the JobDetail that this Trigger is associated with.

Specified by:
getJobDetail in interface JobDetailAwareTrigger
Returns:
the associated JobDetail, or null if none

setBeanName

public void setBeanName(String beanName)
Description copied from interface: BeanNameAware
Set the name of the bean in the bean factory that created this bean.

Invoked after population of normal bean properties but before an init callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanName in interface BeanNameAware
Parameters:
beanName - the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use the BeanFactoryUtils.originalBeanName(String) method to extract the original bean name (without suffix), if desired.

afterPropertiesSet

public void afterPropertiesSet()
                        throws ParseException
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
ParseException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SpringBeanJobFactory

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.scheduling.quartz
Class SpringBeanJobFactory

java.lang.Object
    extended by  org.springframework.scheduling.quartz.AdaptableJobFactory
        extended by  org.springframework.scheduling.quartz.SpringBeanJobFactory
All Implemented Interfaces:
org.quartz.spi.JobFactory, SchedulerContextAware
public class SpringBeanJobFactory
extends AdaptableJobFactory
implements SchedulerContextAware

Subclass of AdaptableJobFactory that also supports Spring-style dependency injection on bean properties. This is essentially the direct equivalent of Spring's QuartzJobBean in the shape of a Quartz 1.5 JobFactory.

Applies scheduler context, job data map and trigger data map entries as bean property values. If no matching bean property is found, the entry is by default simply ignored. This is analogous to QuartzJobBean's behavior.

Since:
2.0
Author:
Juergen Hoeller
See Also:
SchedulerFactoryBean.setJobFactory(org.quartz.spi.JobFactory), QuartzJobBean

Constructor Summary
SpringBeanJobFactory()
Method Summary
protected Object | createJobInstance(org.quartz.spi.TriggerFiredBundle bundle) Create the job instance, populating it with property values taken from the scheduler context, job data map and trigger data map.
protected boolean | isEligibleForPropertyPopulation(Object jobObject) Return whether the given job object is eligible for having its bean properties populated.
void | setIgnoredUnknownProperties(String[] ignoredUnknownProperties) Specify the unknown properties (not found in the bean) that should be ignored.
void | setSchedulerContext(org.quartz.SchedulerContext schedulerContext) Set the SchedulerContext of the current Quartz Scheduler.
Methods inherited from class org.springframework.scheduling.quartz.AdaptableJobFactory
adaptJob, newJob
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SpringBeanJobFactory

public SpringBeanJobFactory()
Method Detail

setIgnoredUnknownProperties

public void setIgnoredUnknownProperties(String[] ignoredUnknownProperties)
Specify the unknown properties (not found in the bean) that should be ignored.

Default is null, indicating that all unknown properties should be ignored. Specify an empty array to throw an exception in case of any unknown properties, or a list of property names that should be ignored if there is no corresponding property found on the particular job class (all other unknown properties will still trigger an exception).

setSchedulerContext

public void setSchedulerContext(org.quartz.SchedulerContext schedulerContext)
Description copied from interface: SchedulerContextAware
Set the SchedulerContext of the current Quartz Scheduler.

Specified by:
setSchedulerContext in interface SchedulerContextAware
See Also:
Scheduler.getContext()

createJobInstance

protected Object createJobInstance(org.quartz.spi.TriggerFiredBundle bundle)
                            throws Exception
Create the job instance, populating it with property values taken from the scheduler context, job data map and trigger data map.

Overrides:
createJobInstance in class AdaptableJobFactory
Parameters:
bundle - the TriggerFiredBundle from which the JobDetail and other info relating to the trigger firing can be obtained
Returns:
the job instance
Throws:
Exception - if job instantiation failed

isEligibleForPropertyPopulation

protected boolean isEligibleForPropertyPopulation(Object jobObject)
Return whether the given job object is eligible for having its bean properties populated.

The default implementation ignores QuartzJobBean instances, which will inject bean properties themselves.

Parameters:
jobObject - the job object to introspect
See Also:
QuartzJobBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


JobMethodInvocationFailedException

org.springframework.scheduling.quartz
Class JobMethodInvocationFailedException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.scheduling.quartz.JobMethodInvocationFailedException
All Implemented Interfaces:
Serializable
public class JobMethodInvocationFailedException
extends NestedRuntimeException

Unchecked exception that wraps an exception thrown from a target method. Propagated to the Quartz scheduler from a Job that reflectively invokes an arbitrary target method.

Since:
2.5.3
Author:
Juergen Hoeller
See Also:
MethodInvokingJobDetailFactoryBean, Serialized Form

Constructor Summary
JobMethodInvocationFailedException(MethodInvoker methodInvoker, Throwable cause)
Constructor for JobMethodInvocationFailedException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

JobMethodInvocationFailedException

public JobMethodInvocationFailedException(MethodInvoker methodInvoker,
                                          Throwable cause)
Constructor for JobMethodInvocationFailedException.

Parameters:
methodInvoker - the MethodInvoker used for reflective invocation
cause - the root cause (as thrown from the target method)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.scheduling.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.scheduling.support

Generic support classes for scheduling.

See:
Description

Class Summary
CronSequenceGenerator | Date sequence generator for a Crontab pattern, allowing clients to specify a pattern that the sequence matches.
CronTrigger | Trigger implementation for cron expressions.
DelegatingErrorHandlingRunnable | Runnable wrapper that catches any exception or error thrown from its delegate Runnable and allows an ErrorHandler to handle it.
MethodInvokingRunnable | Adapter that implements the Runnable interface as a configurable method invocation based on Spring's MethodInvoker.
PeriodicTrigger | A trigger for periodic task execution.
SimpleTriggerContext | Simple data holder implementation of the TriggerContext interface.
TaskUtils | Utility methods for decorating tasks with error handling.

Package org.springframework.scheduling.support Description

Generic support classes for scheduling. Provides a Runnable adapter for Spring's MethodInvoker.


org.springframework.scheduling.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.scheduling.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.scheduling.support.CronSequenceGenerator
    • org.springframework.scheduling.support.CronTrigger (implements org.springframework.scheduling.Trigger)
    • org.springframework.scheduling.support.DelegatingErrorHandlingRunnable (implements java.lang.Runnable)
    • org.springframework.util.MethodInvoker
      • org.springframework.beans.support.ArgumentConvertingMethodInvoker
        • org.springframework.scheduling.support.MethodInvokingRunnable (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.InitializingBean, java.lang.Runnable)
    • org.springframework.scheduling.support.PeriodicTrigger (implements org.springframework.scheduling.Trigger)
    • org.springframework.scheduling.support.SimpleTriggerContext (implements org.springframework.scheduling.TriggerContext)
    • org.springframework.scheduling.support.TaskUtils


CronSequenceGenerator

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.scheduling.support
Class CronSequenceGenerator

java.lang.Object
    extended by  org.springframework.scheduling.support.CronSequenceGenerator

public class CronSequenceGenerator
extends Object

Date sequence generator for a Crontab pattern, allowing clients to specify a pattern that the sequence matches.

The pattern is a list of six single space-separated fields: representing second, minute, hour, day, month, weekday. Month and weekday names can be given as the first three letters of the English names.

Example patterns:

  • "0 0 * * * *" = the top of every hour of every day.
  • "*/10 * * * * *" = every ten seconds.
  • "0 0 8-10 * * *" = 8, 9 and 10 o'clock of every day.
  • "0 0/30 8-10 * * *" = 8:00, 8:30, 9:00, 9:30 and 10 o'clock every day.
  • "0 0 9-17 * * MON-FRI" = on the hour nine-to-five weekdays
  • "0 0 0 25 12 ?" = every Christmas Day at midnight

Since:
3.0
Author:
Dave Syer, Juergen Hoeller
See Also:
CronTrigger

Constructor Summary
CronSequenceGenerator(String expression, TimeZone timeZone)
Construct a CronSequenceGenerator from the pattern provided.
Method Summary
boolean | equals(Object obj)
int | hashCode()
Date | next(Date date) Get the next Date in the sequence matching the Cron pattern and after the value provided.
String | toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

CronSequenceGenerator

public CronSequenceGenerator(String expression,
                             TimeZone timeZone)
Construct a CronSequenceGenerator from the pattern provided.

Parameters:
expression - a space-separated list of time fields
timeZone - the TimeZone to use for generated trigger times
Throws:
IllegalArgumentException - if the pattern cannot be parsed
Method Detail

next

public Date next(Date date)
Get the next Date in the sequence matching the Cron pattern and after the value provided. The return value will have a whole number of seconds, and will be after the input value.

Parameters:
date - a seed value
Returns:
the next value matching the pattern

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


CronTrigger

org.springframework.scheduling.support
Class CronTrigger

java.lang.Object
    extended by  org.springframework.scheduling.support.CronTrigger
All Implemented Interfaces:
Trigger
public class CronTrigger
extends Object
implements Trigger

Trigger implementation for cron expressions. Wraps a CronSequenceGenerator.

Since:
3.0
Author:
Juergen Hoeller
See Also:
CronSequenceGenerator

Constructor Summary
CronTrigger(String cronExpression)
Build a CronTrigger from the pattern provided in the default time zone.
CronTrigger(String cronExpression, TimeZone timeZone)
Build a CronTrigger from the pattern provided.
Method Summary
boolean | equals(Object obj)
int | hashCode()
Date | nextExecutionTime(TriggerContext triggerContext) Determine the next execution time according to the given trigger context.
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CronTrigger

public CronTrigger(String cronExpression,
                   TimeZone timeZone)
Build a CronTrigger from the pattern provided.

Parameters:
cronExpression - a space-separated list of time fields, following cron expression conventions
timeZone - a time zone in which the trigger times will be generated

CronTrigger

public CronTrigger(String cronExpression)
Build a CronTrigger from the pattern provided in the default time zone.

Parameters:
cronExpression - a space-separated list of time fields, following cron expression conventions
Method Detail

nextExecutionTime

public Date nextExecutionTime(TriggerContext triggerContext)
Description copied from interface: Trigger
Determine the next execution time according to the given trigger context.

Specified by:
nextExecutionTime in interface Trigger
Parameters:
triggerContext - context object encapsulating last execution times and last completion time
Returns:
the next execution time as defined by the trigger, or null if the trigger won't fire anymore

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DelegatingErrorHandlingRunnable

org.springframework.scheduling.support
Class DelegatingErrorHandlingRunnable

java.lang.Object
    extended by  org.springframework.scheduling.support.DelegatingErrorHandlingRunnable
All Implemented Interfaces:
Runnable
public class DelegatingErrorHandlingRunnable
extends Object
implements Runnable

Runnable wrapper that catches any exception or error thrown from its delegate Runnable and allows an ErrorHandler to handle it.

Since:
3.0
Author:
Juergen Hoeller, Mark Fisher

Constructor Summary
DelegatingErrorHandlingRunnable(Runnable delegate, ErrorHandler errorHandler)
Create a new DelegatingErrorHandlingRunnable.
Method Summary
void | run()
String | toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

DelegatingErrorHandlingRunnable

public DelegatingErrorHandlingRunnable(Runnable delegate,
                                       ErrorHandler errorHandler)
Create a new DelegatingErrorHandlingRunnable.

Parameters:
delegate - the Runnable implementation to delegate to
errorHandler - the ErrorHandler for handling any exceptions
Method Detail

run

public void run()
Specified by:
run in interface Runnable

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MethodInvokingRunnable

org.springframework.scheduling.support
Class MethodInvokingRunnable

java.lang.Object
    extended by  org.springframework.util.MethodInvoker
        extended by  org.springframework.beans.support.ArgumentConvertingMethodInvoker
            extended by  org.springframework.scheduling.support.MethodInvokingRunnable
All Implemented Interfaces:
Runnable, BeanClassLoaderAware, InitializingBean
Direct Known Subclasses:
MethodInvokingTimerTaskFactoryBean
public class MethodInvokingRunnable
extends ArgumentConvertingMethodInvoker
implements Runnable, BeanClassLoaderAware, InitializingBean

Adapter that implements the Runnable interface as a configurable method invocation based on Spring's MethodInvoker.

Inherits common configuration properties from MethodInvoker.

Since:
1.2.4
Author:
Juergen Hoeller
See Also:
ScheduledTimerTask.setRunnable(Runnable), Executor.execute(Runnable)

Field Summary
protected  Log logger
Constructor Summary
MethodInvokingRunnable()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected String | getInvocationFailureMessage() Build a message for an invocation failure exception.
protected Class | resolveClassName(String className) Resolve the given class name into a Class.
void | run()
void | setBeanClassLoader(ClassLoader classLoader) Callback that supplies the bean class loader to a bean instance.
Methods inherited from class org.springframework.beans.support.ArgumentConvertingMethodInvoker
doFindMatchingMethod, findMatchingMethod, getDefaultTypeConverter, getTypeConverter, registerCustomEditor, setTypeConverter
Methods inherited from class org.springframework.util.MethodInvoker
getArguments, getPreparedMethod, getTargetClass, getTargetMethod, getTargetObject, getTypeDifferenceWeight, invoke, isPrepared, prepare, setArguments, setStaticMethod, setTargetClass, setTargetMethod, setTargetObject
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Constructor Detail

MethodInvokingRunnable

public MethodInvokingRunnable()
Method Detail

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

resolveClassName

protected Class resolveClassName(String className)
                          throws ClassNotFoundException
Description copied from class: MethodInvoker
Resolve the given class name into a Class.

The default implementations uses ClassUtils.forName, using the thread context class loader.

Overrides:
resolveClassName in class MethodInvoker
Parameters:
className - the class name to resolve
Returns:
the resolved Class
Throws:
ClassNotFoundException - if the class name was invalid

afterPropertiesSet

public void afterPropertiesSet()
                        throws ClassNotFoundException,
                               NoSuchMethodException
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
ClassNotFoundException
NoSuchMethodException

run

public void run()
Specified by:
run in interface Runnable

getInvocationFailureMessage

protected String getInvocationFailureMessage()
Build a message for an invocation failure exception.

Returns:
the error message, including the target method name etc
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PeriodicTrigger

org.springframework.scheduling.support
Class PeriodicTrigger

java.lang.Object
    extended by  org.springframework.scheduling.support.PeriodicTrigger
All Implemented Interfaces:
Trigger
public class PeriodicTrigger
extends Object
implements Trigger

A trigger for periodic task execution. The period may be applied as either fixed-rate or fixed-delay, and an initial delay value may also be configured. The default initial delay is 0, and the default behavior is fixed-delay (i.e. the interval between successive executions is measured from each completion time). To measure the interval between the scheduled start time of each execution instead, set the 'fixedRate' property to true.

Note that the TaskScheduler interface already defines methods for scheduling tasks at fixed-rate or with fixed-delay. Both also support an optional value for the initial delay. Those methods should be used directly whenever possible. The value of this Trigger implementation is that it can be used within components that rely on the Trigger abstraction. For example, it may be convenient to allow periodic triggers, cron-based triggers, and even custom Trigger implementations to be used interchangeably.

Since:
3.0
Author:
Mark Fisher

Constructor Summary
PeriodicTrigger(long period)
Create a trigger with the given period in milliseconds.
PeriodicTrigger(long period, TimeUnit timeUnit)
Create a trigger with the given period and time unit.
Method Summary
boolean | equals(Object obj)
int | hashCode()
Date | nextExecutionTime(TriggerContext triggerContext) Returns the time after which a task should run again.
void | setFixedRate(boolean fixedRate) Specify whether the periodic interval should be measured between the scheduled start times rather than between actual completion times.
void | setInitialDelay(long initialDelay) Specify the delay for the initial execution.
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PeriodicTrigger

public PeriodicTrigger(long period)
Create a trigger with the given period in milliseconds.

PeriodicTrigger

public PeriodicTrigger(long period,
                       TimeUnit timeUnit)
Create a trigger with the given period and time unit. The time unit will apply not only to the period but also to any 'initialDelay' value, if configured on this Trigger later via setInitialDelay(long).

Method Detail

setInitialDelay

public void setInitialDelay(long initialDelay)
Specify the delay for the initial execution. It will be evaluated in terms of this trigger's TimeUnit. If no time unit was explicitly provided upon instantiation, the default is milliseconds.

setFixedRate

public void setFixedRate(boolean fixedRate)
Specify whether the periodic interval should be measured between the scheduled start times rather than between actual completion times. The latter, "fixed delay" behavior, is the default.

nextExecutionTime

public Date nextExecutionTime(TriggerContext triggerContext)
Returns the time after which a task should run again.

Specified by:
nextExecutionTime in interface Trigger
Parameters:
triggerContext - context object encapsulating last execution times and last completion time
Returns:
the next execution time as defined by the trigger, or null if the trigger won't fire anymore

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleTriggerContext

org.springframework.scheduling.support
Class SimpleTriggerContext

java.lang.Object
    extended by  org.springframework.scheduling.support.SimpleTriggerContext
All Implemented Interfaces:
TriggerContext
public class SimpleTriggerContext
extends Object
implements TriggerContext

Simple data holder implementation of the TriggerContext interface.

Since:
3.0
Author:
Juergen Hoeller

Constructor Summary
SimpleTriggerContext()
Method Summary
Date | lastActualExecutionTime() Return the last actual execution time of the task, or null if not scheduled before.
Date | lastCompletionTime() Return the last completion time of the task, or null if not scheduled before.
Date | lastScheduledExecutionTime() Return the last scheduled execution time of the task, or null if not scheduled before.
void | update(Date lastScheduledExecutionTime, Date lastActualExecutionTime, Date lastCompletionTime) Update this holder's state with the latest time values.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleTriggerContext

public SimpleTriggerContext()
Method Detail

update

public void update(Date lastScheduledExecutionTime,
                   Date lastActualExecutionTime,
                   Date lastCompletionTime)
Update this holder's state with the latest time values.

Parameters:
lastScheduledExecutionTime - last scheduled execution time
lastActualExecutionTime - last actual execution time
lastCompletionTime - last completion time

lastScheduledExecutionTime

public Date lastScheduledExecutionTime()
Description copied from interface: TriggerContext
Return the last scheduled execution time of the task, or null if not scheduled before.

Specified by:
lastScheduledExecutionTime in interface TriggerContext

lastActualExecutionTime

public Date lastActualExecutionTime()
Description copied from interface: TriggerContext
Return the last actual execution time of the task, or null if not scheduled before.

Specified by:
lastActualExecutionTime in interface TriggerContext

lastCompletionTime

public Date lastCompletionTime()
Description copied from interface: TriggerContext
Return the last completion time of the task, or null if not scheduled before.

Specified by:
lastCompletionTime in interface TriggerContext
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TaskUtils

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.scheduling.support
Class TaskUtils

java.lang.Object
    extended by  org.springframework.scheduling.support.TaskUtils

public abstract class TaskUtils
extends Object

Utility methods for decorating tasks with error handling.

NOTE: This class is intended for internal use by Spring's scheduler implementations. It is only public so that it may be accessed from implementations within other packages. It is not intended for general use and may change in the future.

Since:
3.0
Author:
Mark Fisher

Field Summary
static ErrorHandler | LOG_AND_PROPAGATE_ERROR_HANDLER An ErrorHandler strategy that will log at error level and then re-throw the Exception.
static ErrorHandler | LOG_AND_SUPPRESS_ERROR_HANDLER An ErrorHandler strategy that will log the Exception but perform no further handling.
Constructor Summary
TaskUtils()
Method Summary
static DelegatingErrorHandlingRunnable | decorateTaskWithErrorHandler(Runnable task, ErrorHandler errorHandler, boolean isRepeatingTask) Decorates the task for error handling.
static ErrorHandler | getDefaultErrorHandler(boolean isRepeatingTask) Return the default ErrorHandler implementation based on the boolean value indicating whether the task will be repeating or not.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

LOG_AND_SUPPRESS_ERROR_HANDLER

public static final ErrorHandler LOG_AND_SUPPRESS_ERROR_HANDLER
An ErrorHandler strategy that will log the Exception but perform no further handling. This will suppress the error so that subsequent executions of the task will not be prevented.

LOG_AND_PROPAGATE_ERROR_HANDLER

public static final ErrorHandler LOG_AND_PROPAGATE_ERROR_HANDLER
An ErrorHandler strategy that will log at error level and then re-throw the Exception. Note: this will typically prevent subsequent execution of a scheduled task.

Constructor Detail

TaskUtils

public TaskUtils()
Method Detail

decorateTaskWithErrorHandler

public static DelegatingErrorHandlingRunnable decorateTaskWithErrorHandler(Runnable task,
                                                                           ErrorHandler errorHandler,
                                                                           boolean isRepeatingTask)
Decorates the task for error handling. If the provided ErrorHandler is not null, it will be used. Otherwise, repeating tasks will have errors suppressed by default whereas one-shot tasks will have errors propagated by default since those errors may be expected through the returned Future. In both cases, the errors will be logged.

getDefaultErrorHandler

public static ErrorHandler getDefaultErrorHandler(boolean isRepeatingTask)
Return the default ErrorHandler implementation based on the boolean value indicating whether the task will be repeating or not. For repeating tasks it will suppress errors, but for one-time tasks it will propagate. In both cases, the error will be logged.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.scheduling.timer

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.scheduling.timer

Scheduling convenience classes for the JDK Timer, allowing to set up Timers and ScheduledTimerTasks as beans in a Spring context.

See:
Description

Class Summary
DelegatingTimerTask | Deprecated. as of Spring 3.0, in favor of the scheduling.concurrent package which is based on Java 5's java.util.concurrent.ExecutorService
MethodInvokingTimerTaskFactoryBean | Deprecated. as of Spring 3.0, in favor of the scheduling.concurrent package which is based on Java 5's java.util.concurrent.ExecutorService
ScheduledTimerTask | Deprecated. as of Spring 3.0, in favor of the scheduling.concurrent package which is based on Java 5's java.util.concurrent.ExecutorService
TimerFactoryBean | Deprecated. as of Spring 3.0, in favor of the scheduling.concurrent package which is based on Java 5's java.util.concurrent.ExecutorService
TimerTaskExecutor | Deprecated. as of Spring 3.0, in favor of the scheduling.concurrent package which is based on Java 5's java.util.concurrent.ExecutorService

Package org.springframework.scheduling.timer Description

Scheduling convenience classes for the JDK Timer, allowing to set up Timers and ScheduledTimerTasks as beans in a Spring context.


org.springframework.scheduling.timer Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.scheduling.timer

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.util.MethodInvoker
      • org.springframework.beans.support.ArgumentConvertingMethodInvoker
        • org.springframework.scheduling.support.MethodInvokingRunnable (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.InitializingBean, java.lang.Runnable)
          • org.springframework.scheduling.timer.MethodInvokingTimerTaskFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>)
    • org.springframework.scheduling.timer.ScheduledTimerTask
    • org.springframework.scheduling.timer.TimerFactoryBean (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
    • java.util.TimerTask (implements java.lang.Runnable)
      • org.springframework.scheduling.timer.DelegatingTimerTask
    • org.springframework.scheduling.timer.TimerTaskExecutor (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.scheduling.SchedulingTaskExecutor)


DelegatingTimerTask

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.scheduling.timer
Class DelegatingTimerTask

java.lang.Object
    extended by  java.util.TimerTask
        extended by  org.springframework.scheduling.timer.DelegatingTimerTask
All Implemented Interfaces:
Runnable
Deprecated. as of Spring 3.0, in favor of the scheduling.concurrent package which is based on Java 5's java.util.concurrent.ExecutorService

@Deprecated
public class DelegatingTimerTask
extends TimerTask

Simple TimerTask adapter that delegates to a given Runnable.

This is often preferable to deriving from TimerTask, to be able to implement an interface rather than extend an abstract base class.

Since:
1.2.4
Author:
Juergen Hoeller

Constructor Summary
DelegatingTimerTask(Runnable delegate)
Deprecated. Create a new DelegatingTimerTask.
Method Summary
Runnable | getDelegate() Deprecated. Return the wrapped Runnable implementation.
void | run() Deprecated. Delegates execution to the underlying Runnable, catching any exception or error thrown in order to continue scheduled execution.
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DelegatingTimerTask

public DelegatingTimerTask(Runnable delegate)
Deprecated.
Create a new DelegatingTimerTask.

Parameters:
delegate - the Runnable implementation to delegate to
Method Detail

getDelegate

public final Runnable getDelegate()
Deprecated.
Return the wrapped Runnable implementation.

run

public void run()
Deprecated.
Delegates execution to the underlying Runnable, catching any exception or error thrown in order to continue scheduled execution.

Specified by:
run in interface Runnable
Specified by:
run in class TimerTask
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


MethodInvokingTimerTaskFactoryBean

org.springframework.scheduling.timer
Class MethodInvokingTimerTaskFactoryBean

java.lang.Object
    extended by  org.springframework.util.MethodInvoker
        extended by  org.springframework.beans.support.ArgumentConvertingMethodInvoker
            extended by  org.springframework.scheduling.support.MethodInvokingRunnable
                extended by  org.springframework.scheduling.timer.MethodInvokingTimerTaskFactoryBean
All Implemented Interfaces:
Runnable, BeanClassLoaderAware, FactoryBean<TimerTask>, InitializingBean
Deprecated. as of Spring 3.0, in favor of the scheduling.concurrent package which is based on Java 5's java.util.concurrent.ExecutorService

@Deprecated
public class MethodInvokingTimerTaskFactoryBean
extends MethodInvokingRunnable
implements FactoryBean<TimerTask>

FactoryBean that exposes a TimerTask object which delegates job execution to a specified (static or non-static) method. Avoids the need to implement a one-line TimerTask that just invokes an existing business method.

Derives from MethodInvokingRunnable to share common properties and behavior, effectively providing a TimerTask adapter for it.

Since:
19.02.2004
Author:
Juergen Hoeller
See Also:
DelegatingTimerTask, ScheduledTimerTask.setTimerTask(java.util.TimerTask), ScheduledTimerTask.setRunnable(java.lang.Runnable), MethodInvokingRunnable, MethodInvokingFactoryBean

Field Summary
Fields inherited from class org.springframework.scheduling.support.MethodInvokingRunnable
logger
Constructor Summary
MethodInvokingTimerTaskFactoryBean()
Deprecated.
Method Summary
 void afterPropertiesSet()
Deprecated. Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 TimerTask getObject()
Deprecated. Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<TimerTask> getObjectType()
Deprecated. Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Deprecated. Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
Methods inherited from class org.springframework.scheduling.support.MethodInvokingRunnable
getInvocationFailureMessage, resolveClassName, run, setBeanClassLoader
Methods inherited from class org.springframework.beans.support.ArgumentConvertingMethodInvoker
doFindMatchingMethod, findMatchingMethod, getDefaultTypeConverter, getTypeConverter, registerCustomEditor, setTypeConverter
Methods inherited from class org.springframework.util.MethodInvoker
getArguments, getPreparedMethod, getTargetClass, getTargetMethod, getTargetObject, getTypeDifferenceWeight, invoke, isPrepared, prepare, setArguments, setStaticMethod, setTargetClass, setTargetMethod, setTargetObject
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MethodInvokingTimerTaskFactoryBean

public MethodInvokingTimerTaskFactoryBean()
Deprecated.
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws ClassNotFoundException,
                               NoSuchMethodException
Deprecated.
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class MethodInvokingRunnable
Throws:
ClassNotFoundException
NoSuchMethodException

getObject

public TimerTask getObject()
Deprecated.
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<TimerTask>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<TimerTask> getObjectType()
Deprecated.
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<TimerTask>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Deprecated.
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<TimerTask>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ScheduledTimerTask

org.springframework.scheduling.timer
Class ScheduledTimerTask

java.lang.Object
    extended by  org.springframework.scheduling.timer.ScheduledTimerTask
Deprecated. as of Spring 3.0, in favor of the scheduling.concurrent package which is based on Java 5's java.util.concurrent.ExecutorService

@Deprecated
public class ScheduledTimerTask
extends Object

JavaBean that describes a scheduled TimerTask, consisting of the TimerTask itself or a Runnable to create a TimerTask for and a delay plus period. The period needs to be specified; there is no point in a default for it.

The JDK's Timer facility does not offer sophisticated scheduling options such as cron expressions. Consider using Quartz for such advanced needs.

Note that the Timer mechanism uses a TimerTask instance that is shared between repeated executions, in contrast to Quartz which creates a new Job instance for each execution.

Since:
19.02.2004
Author:
Juergen Hoeller
See Also:
TimerTask, Timer.schedule(TimerTask, long, long), Timer.scheduleAtFixedRate(TimerTask, long, long)

Constructor Summary
ScheduledTimerTask()
Deprecated. Create a new ScheduledTimerTask, to be populated via bean properties.
ScheduledTimerTask(Runnable timerTask)
Deprecated. Create a new ScheduledTimerTask, with default one-time execution without delay.
ScheduledTimerTask(Runnable timerTask, long delay)
Deprecated. Create a new ScheduledTimerTask, with default one-time execution with the given delay.
ScheduledTimerTask(Runnable timerTask, long delay, long period, boolean fixedRate)
Deprecated. Create a new ScheduledTimerTask.
ScheduledTimerTask(TimerTask timerTask)
Deprecated. Create a new ScheduledTimerTask, with default one-time execution without delay.
ScheduledTimerTask(TimerTask timerTask, long delay)
Deprecated. Create a new ScheduledTimerTask, with default one-time execution with the given delay.
ScheduledTimerTask(TimerTask timerTask, long delay, long period, boolean fixedRate)
Deprecated. Create a new ScheduledTimerTask.
Method Summary
long | getDelay() Deprecated. Return the delay before starting the job for the first time.
long | getPeriod() Deprecated. Return the period between repeated task executions.
TimerTask | getTimerTask() Deprecated. Return the TimerTask to schedule.
boolean | isFixedRate() Deprecated. Return whether to schedule as fixed-rate execution.
boolean | isOneTimeTask() Deprecated. Is this task only ever going to execute once?
void | setDelay(long delay) Deprecated. Set the delay before starting the task for the first time, in milliseconds.
void | setFixedRate(boolean fixedRate) Deprecated. Set whether to schedule as fixed-rate execution, rather than fixed-delay execution.
void | setPeriod(long period) Deprecated. Set the period between repeated task executions, in milliseconds.
void | setRunnable(Runnable timerTask) Deprecated. Set the Runnable to schedule as TimerTask.
void | setTimerTask(TimerTask timerTask) Deprecated. Set the TimerTask to schedule.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ScheduledTimerTask

public ScheduledTimerTask()
Deprecated.
Create a new ScheduledTimerTask, to be populated via bean properties.

See Also:
setTimerTask(java.util.TimerTask), setDelay(long), setPeriod(long), setFixedRate(boolean)

ScheduledTimerTask

public ScheduledTimerTask(TimerTask timerTask)
Deprecated.
Create a new ScheduledTimerTask, with default one-time execution without delay.

Parameters:
timerTask - the TimerTask to schedule

ScheduledTimerTask

public ScheduledTimerTask(TimerTask timerTask,
                          long delay)
Deprecated.
Create a new ScheduledTimerTask, with default one-time execution with the given delay.

Parameters:
timerTask - the TimerTask to schedule
delay - the delay before starting the task for the first time (ms)

ScheduledTimerTask

public ScheduledTimerTask(TimerTask timerTask,
                          long delay,
                          long period,
                          boolean fixedRate)
Deprecated.
Create a new ScheduledTimerTask.

Parameters:
timerTask - the TimerTask to schedule
delay - the delay before starting the task for the first time (ms)
period - the period between repeated task executions (ms)
fixedRate - whether to schedule as fixed-rate execution

ScheduledTimerTask

public ScheduledTimerTask(Runnable timerTask)
Deprecated.
Create a new ScheduledTimerTask, with default one-time execution without delay.

Parameters:
timerTask - the Runnable to schedule as TimerTask

ScheduledTimerTask

public ScheduledTimerTask(Runnable timerTask,
                          long delay)
Deprecated.
Create a new ScheduledTimerTask, with default one-time execution with the given delay.

Parameters:
timerTask - the Runnable to schedule as TimerTask
delay - the delay before starting the task for the first time (ms)

ScheduledTimerTask

public ScheduledTimerTask(Runnable timerTask,
                          long delay,
                          long period,
                          boolean fixedRate)
Deprecated.
Create a new ScheduledTimerTask.

Parameters:
timerTask - the Runnable to schedule as TimerTask
delay - the delay before starting the task for the first time (ms)
period - the period between repeated task executions (ms)
fixedRate - whether to schedule as fixed-rate execution
Method Detail

setRunnable

public void setRunnable(Runnable timerTask)
Deprecated.
Set the Runnable to schedule as TimerTask.

See Also:
DelegatingTimerTask

setTimerTask

public void setTimerTask(TimerTask timerTask)
Deprecated.
Set the TimerTask to schedule.

getTimerTask

public TimerTask getTimerTask()
Deprecated.
Return the TimerTask to schedule.

setDelay

public void setDelay(long delay)
Deprecated.
Set the delay before starting the task for the first time, in milliseconds. Default is 0, immediately starting the task after successful scheduling.

getDelay

public long getDelay()
Deprecated.
Return the delay before starting the job for the first time.

setPeriod

public void setPeriod(long period)
Deprecated.
Set the period between repeated task executions, in milliseconds.

Default is -1, leading to one-time execution. In case of a positive value, the task will be executed repeatedly, with the given interval inbetween executions.

Note that the semantics of the period value vary between fixed-rate and fixed-delay execution.

Note: A period of 0 (for example as fixed delay) is not supported, simply because java.util.Timer itself does not support it. Hence a value of 0 will be treated as one-time execution; however, that value should never be specified explicitly in the first place!

See Also:
setFixedRate(boolean), isOneTimeTask(), Timer.schedule(TimerTask, long, long)

getPeriod

public long getPeriod()
Deprecated.
Return the period between repeated task executions.

isOneTimeTask

public boolean isOneTimeTask()
Deprecated.
Is this task only ever going to execute once?

Returns:
true if this task is only ever going to execute once
See Also:
getPeriod()

setFixedRate

public void setFixedRate(boolean fixedRate)
Deprecated.
Set whether to schedule as fixed-rate execution, rather than fixed-delay execution. Default is "false", that is, fixed delay.

See Timer javadoc for details on those execution modes.

See Also:
Timer.schedule(TimerTask, long, long), Timer.scheduleAtFixedRate(TimerTask, long, long)

isFixedRate

public boolean isFixedRate()
Deprecated.
Return whether to schedule as fixed-rate execution.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TimerFactoryBean

org.springframework.scheduling.timer
Class TimerFactoryBean

java.lang.Object
    extended by  org.springframework.scheduling.timer.TimerFactoryBean
All Implemented Interfaces:
BeanNameAware, DisposableBean, FactoryBean<Timer>, InitializingBean
Deprecated. as of Spring 3.0, in favor of the scheduling.concurrent package which is based on Java 5's java.util.concurrent.ExecutorService

@Deprecated
public class TimerFactoryBean
extends Object
implements FactoryBean<Timer>, BeanNameAware, InitializingBean, DisposableBean

FactoryBean that sets up a Timer and exposes it for bean references.

Allows for registration of ScheduledTimerTasks, automatically starting the Timer on initialization and cancelling it on destruction of the context. In scenarios that just require static registration of tasks at startup, there is no need to access the Timer instance itself in application code at all.

Note that the Timer mechanism uses a TimerTask instance that is shared between repeated executions, in contrast to Quartz which creates a new Job instance for each execution.

Since:
19.02.2004
Author:
Juergen Hoeller
See Also:
ScheduledTimerTask, Timer, TimerTask

Field Summary
protected  Log logger
Deprecated.
Constructor Summary
TimerFactoryBean()
Deprecated.
Method Summary
 void afterPropertiesSet()
Deprecated. Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected  Timer createTimer(String name, boolean daemon)
Deprecated. Create a new Timer instance.
 void destroy()
Deprecated. Cancel the Timer on bean factory shutdown, stopping all scheduled tasks.
 Timer getObject()
Deprecated. Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<? extends Timer> getObjectType()
Deprecated. Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Deprecated. Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
protected  void registerTasks(ScheduledTimerTask[] tasks, Timer timer)
Deprecated. Register the specified ScheduledTimerTasks on the given Timer.
 void setBeanName(String beanName)
Deprecated. Set the name of the bean in the bean factory that created this bean.
 void setDaemon(boolean daemon)
Deprecated. Set whether the timer should use a daemon thread, just executing as long as the application itself is running.
 void setScheduledTimerTasks(ScheduledTimerTask[] scheduledTimerTasks)
Deprecated. Register a list of ScheduledTimerTask objects with the Timer that this FactoryBean creates.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Deprecated.
Constructor Detail

TimerFactoryBean

public TimerFactoryBean()
Deprecated.
Method Detail

setScheduledTimerTasks

public void setScheduledTimerTasks(ScheduledTimerTask[] scheduledTimerTasks)
Deprecated.
Register a list of ScheduledTimerTask objects with the Timer that this FactoryBean creates. Depending on each SchedulerTimerTask's settings, it will be registered via one of Timer's schedule methods.

See Also:
Timer.schedule(java.util.TimerTask, long),
Timer.schedule(java.util.TimerTask, long, long),
Timer.scheduleAtFixedRate(java.util.TimerTask, long, long)

setDaemon

public void setDaemon(boolean daemon)
Deprecated.
Set whether the timer should use a daemon thread, just executing as long as the application itself is running.

Default is "false": The timer will automatically get cancelled on destruction of this FactoryBean. Hence, if the application shuts down, tasks will by default finish their execution. Specify "true" for eager shutdown of threads that execute tasks.

See Also:
Timer.Timer(boolean)

setBeanName

public void setBeanName(String beanName)
Deprecated.
Description copied from interface: BeanNameAware
Set the name of the bean in the bean factory that created this bean.

Invoked after population of normal bean properties but before an init callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanName in interface BeanNameAware
Parameters:
beanName - the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use the BeanFactoryUtils.originalBeanName(String) method to extract the original bean name (without suffix), if desired.

afterPropertiesSet

public void afterPropertiesSet()
Deprecated.
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

createTimer

protected Timer createTimer(String name,
                            boolean daemon)
Deprecated.
Create a new Timer instance. Called by afterPropertiesSet. Can be overridden in subclasses to provide custom Timer subclasses.

Parameters:
name - the desired name of the Timer's associated thread
daemon - whether to create a Timer that runs as daemon thread
Returns:
a new Timer instance
See Also:
afterPropertiesSet(), Timer.Timer(boolean)

registerTasks

protected void registerTasks(ScheduledTimerTask[] tasks,
                             Timer timer)
Deprecated.
Register the specified ScheduledTimerTasks on the given Timer.

Parameters:
tasks - the specified ScheduledTimerTasks (never empty)
timer - the Timer to register the tasks on.

getObject

public Timer getObject()
Deprecated.
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<Timer>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends Timer> getObjectType()
Deprecated.
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<Timer>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Deprecated.
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<Timer>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()

destroy

public void destroy()
Deprecated.
Cancel the Timer on bean factory shutdown, stopping all scheduled tasks.

Specified by:
destroy in interface DisposableBean
See Also:
Timer.cancel()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TimerTaskExecutor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.scheduling.timer
Class TimerTaskExecutor

java.lang.Object
    extended by  org.springframework.scheduling.timer.TimerTaskExecutor
All Implemented Interfaces:
Executor, BeanNameAware, DisposableBean, InitializingBean, AsyncTaskExecutor, TaskExecutor, SchedulingTaskExecutor
Deprecated. as of Spring 3.0, in favor of the scheduling.concurrent package which is based on Java 5's java.util.concurrent.ExecutorService

@Deprecated
public class TimerTaskExecutor
extends Object
implements SchedulingTaskExecutor, BeanNameAware, InitializingBean, DisposableBean

TaskExecutor implementation that uses a single Timer for executing all tasks, effectively resulting in serialized asynchronous execution on a single thread.

Since:
2.0
Author:
Juergen Hoeller
See Also:
Timer

Field Summary
protected  Log logger
Deprecated.
Fields inherited from interface org.springframework.core.task.AsyncTaskExecutor
TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE
Constructor Summary
TimerTaskExecutor()
Deprecated. Create a new TimerTaskExecutor that needs to be further configured and initialized.
TimerTaskExecutor(Timer timer)
Deprecated. Create a new TimerTaskExecutor for the given Timer.
Method Summary
 void afterPropertiesSet()
Deprecated. Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected  Timer createTimer()
Deprecated. Create a new Timer instance.
 void destroy()
Deprecated. Cancel the Timer on bean factory shutdown, stopping all scheduled tasks.
 void execute(Runnable task)
Deprecated. Schedules the given Runnable on this executor's Timer instance, wrapping it in a DelegatingTimerTask.
 void execute(Runnable task, long startTimeout)
Deprecated. Execute the given task.
protected  Timer getTimer()
Deprecated. Return the underlying Timer behind this TimerTaskExecutor.
 boolean prefersShortLivedTasks()
Deprecated. This task executor prefers short-lived work units.
 void setBeanName(String beanName)
Deprecated. Set the name of the bean in the bean factory that created this bean.
 void setDelay(long delay)
Deprecated. Set the delay to use for scheduling tasks passed into the plain execute(Runnable) method.
 void setTimer(Timer timer)
Deprecated. Set the Timer to use for this TimerTaskExecutor, for example a shared Timer instance defined by a TimerFactoryBean.
<T> Future<T>
submit(Callable<T> task)
Deprecated. Submit a Callable task for execution, receiving a Future representing that task.
 Future<?> submit(Runnable task)
Deprecated. Submit a Runnable task for execution, receiving a Future representing that task.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Deprecated.
Constructor Detail

TimerTaskExecutor

public TimerTaskExecutor()
Deprecated.
Create a new TimerTaskExecutor that needs to be further configured and initialized.

See Also:
setTimer(java.util.Timer), afterPropertiesSet()

TimerTaskExecutor

public TimerTaskExecutor(Timer timer)
Deprecated.
Create a new TimerTaskExecutor for the given Timer.

Parameters:
timer - the Timer to wrap
Method Detail

setTimer

public void setTimer(Timer timer)
Deprecated.
Set the Timer to use for this TimerTaskExecutor, for example a shared Timer instance defined by a TimerFactoryBean.

If not specified, a default internal Timer instance will be used.

Parameters:
timer - the Timer to use for this TimerTaskExecutor
See Also:
TimerFactoryBean

setDelay

public void setDelay(long delay)
Deprecated.
Set the delay to use for scheduling tasks passed into the plain execute(Runnable) method. Default is 0.

Note that calls to execute(Runnable, long) will use the given timeout as delay if it is lower than the general delay.

Parameters:
delay - the delay in milliseconds before the task is to be executed

setBeanName

public void setBeanName(String beanName)
Deprecated.
Description copied from interface: BeanNameAware
Set the name of the bean in the bean factory that created this bean.

Invoked after population of normal bean properties but before an init callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanName in interface BeanNameAware
Parameters:
beanName - the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use the BeanFactoryUtils.originalBeanName(String) method to extract the original bean name (without suffix), if desired.

afterPropertiesSet

public void afterPropertiesSet()
Deprecated.
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

createTimer

protected Timer createTimer()
Deprecated.
Create a new Timer instance. Called by afterPropertiesSet if no Timer has been specified explicitly.

The default implementation creates a plain non-daemon Timer. If overridden, subclasses must take care to ensure that a non-null Timer is returned from the execution of this method.

See Also:
afterPropertiesSet(), Timer.Timer(String, boolean)

getTimer

protected final Timer getTimer()
Deprecated.
Return the underlying Timer behind this TimerTaskExecutor.

execute

public void execute(Runnable task)
Deprecated.
Schedules the given Runnable on this executor's Timer instance, wrapping it in a DelegatingTimerTask.

Specified by:
execute in interface Executor
Specified by:
execute in interface TaskExecutor
Parameters:
task - the task to be executed

execute

public void execute(Runnable task,
                    long startTimeout)
Deprecated.
Description copied from interface: AsyncTaskExecutor
Execute the given task.

Specified by:
execute in interface AsyncTaskExecutor
Parameters:
task - the Runnable to execute (never null)
startTimeout - the time duration (milliseconds) within which the task is supposed to start. This is intended as a hint to the executor, allowing for preferred handling of immediate tasks. Typical values are AsyncTaskExecutor.TIMEOUT_IMMEDIATE or AsyncTaskExecutor.TIMEOUT_INDEFINITE (the default as used by TaskExecutor.execute(Runnable)).

submit

public Future<?> submit(Runnable task)
Deprecated.
Description copied from interface: AsyncTaskExecutor
Submit a Runnable task for execution, receiving a Future representing that task. The Future will return a null result upon completion.

Specified by:
submit in interface AsyncTaskExecutor
Parameters:
task - the Runnable to execute (never null)
Returns:
a Future representing pending completion of the task

submit

public <T> Future<T> submit(Callable<T> task)
Deprecated.
Description copied from interface: AsyncTaskExecutor
Submit a Callable task for execution, receiving a Future representing that task. The Future will return the Callable's result upon completion.

Specified by:
submit in interface AsyncTaskExecutor
Parameters:
task - the Callable to execute (never null)
Returns:
a Future representing pending completion of the task

prefersShortLivedTasks

public boolean prefersShortLivedTasks()
Deprecated.
This task executor prefers short-lived work units.

Specified by:
prefersShortLivedTasks in interface SchedulingTaskExecutor
Returns:
true if this TaskExecutor prefers short-lived tasks

destroy

public void destroy()
Deprecated.
Cancel the Timer on bean factory shutdown, stopping all scheduled tasks.

Specified by:
destroy in interface DisposableBean
See Also:
Timer.cancel()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.scripting

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.scripting

Core interfaces for Spring's scripting support.

See:
Description

Interface Summary
ScriptFactory | Script definition interface, encapsulating the configuration of a specific script as well as a factory method for creating the actual scripted Java Object.
ScriptSource | Interface that defines the source of a script.

Exception Summary
ScriptCompilationException Exception to be thrown on script compilation failure.

Package org.springframework.scripting Description

Core interfaces for Spring's scripting support.


org.springframework.scripting Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.scripting

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.scripting.ScriptCompilationException

Interface Hierarchy

  • org.springframework.scripting.ScriptFactory
  • org.springframework.scripting.ScriptSource


ScriptFactory

org.springframework.scripting
Interface ScriptFactory

All Known Implementing Classes:
BshScriptFactory, GroovyScriptFactory, JRubyScriptFactory
public interface ScriptFactory

Script definition interface, encapsulating the configuration of a specific script as well as a factory method for creating the actual scripted Java Object.

Since:
2.0
Author:
Juergen Hoeller, Rob Harrop
See Also:
getScriptSourceLocator(), getScriptedObject(org.springframework.scripting.ScriptSource, java.lang.Class[])

Method Summary
Object | getScriptedObject(ScriptSource scriptSource, Class[] actualInterfaces) Factory method for creating the scripted Java object.
Class | getScriptedObjectType(ScriptSource scriptSource) Determine the type of the scripted Java object.
Class[] | getScriptInterfaces() Return the business interfaces that the script is supposed to implement.
String | getScriptSourceLocator() Return a locator that points to the source of the script.
boolean | requiresConfigInterface() Return whether the script requires a config interface to be generated for it.
boolean | requiresScriptedObjectRefresh(ScriptSource scriptSource) Determine whether a refresh is required (e.g.

Method Detail

getScriptSourceLocator

String getScriptSourceLocator()
Return a locator that points to the source of the script. Interpreted by the post-processor that actually creates the script.

Typical supported locators are Spring resource locations (such as "file:C:/myScript.bsh" or "classpath:myPackage/myScript.bsh") and inline scripts ("inline:myScriptText...").

Returns:
the script source locator
See Also:
ScriptFactoryPostProcessor.convertToScriptSource(java.lang.String, java.lang.String, org.springframework.core.io.ResourceLoader), ResourceLoader

getScriptInterfaces

Class[] getScriptInterfaces()
Return the business interfaces that the script is supposed to implement.

Can return null if the script itself determines its Java interfaces (such as in the case of Groovy).

Returns:
the interfaces for the script

requiresConfigInterface

boolean requiresConfigInterface()
Return whether the script requires a config interface to be generated for it. This is typically the case for scripts that do not determine Java signatures themselves, with no appropriate config interface specified in getScriptInterfaces().

Returns:
whether the script requires a generated config interface
See Also:
getScriptInterfaces()

getScriptedObject

Object getScriptedObject(ScriptSource scriptSource,
                         Class[] actualInterfaces)
                         throws IOException,
                                ScriptCompilationException
Factory method for creating the scripted Java object.

Implementations are encouraged to cache script metadata such as a generated script class. Note that this method may be invoked concurrently and must be implemented in a thread-safe fashion.

Parameters:
scriptSource - the actual ScriptSource to retrieve the script source text from (never null)
actualInterfaces - the actual interfaces to expose, including script interfaces as well as a generated config interface (if applicable; may be null)
Returns:
the scripted Java object
Throws:
IOException - if script retrieval failed
ScriptCompilationException - if script compilation failed

getScriptedObjectType

Class getScriptedObjectType(ScriptSource scriptSource)
                            throws IOException,
                                   ScriptCompilationException
Determine the type of the scripted Java object.

Implementations are encouraged to cache script metadata such as a generated script class. Note that this method may be invoked concurrently and must be implemented in a thread-safe fashion.

Parameters:
scriptSource - the actual ScriptSource to retrieve the script source text from (never null)
Returns:
the type of the scripted Java object, or null if none could be determined
Throws:
IOException - if script retrieval failed
ScriptCompilationException - if script compilation failed
Since:
2.0.3

requiresScriptedObjectRefresh

boolean requiresScriptedObjectRefresh(ScriptSource scriptSource)
Determine whether a refresh is required (e.g. through ScriptSource's isModified() method).

Parameters:
scriptSource - the actual ScriptSource to retrieve the script source text from (never null)
Returns:
whether a fresh getScriptedObject(org.springframework.scripting.ScriptSource, java.lang.Class[]) call is required
Since:
2.5.2
See Also:
ScriptSource.isModified()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ScriptSource

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.scripting
Interface ScriptSource

All Known Implementing Classes:
ResourceScriptSource, StaticScriptSource
public interface ScriptSource

Interface that defines the source of a script. Tracks whether the underlying script has been modified.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller

Method Summary
 String getScriptAsString()
Retrieve the current script source text as String.
 boolean isModified()
Indicate whether the underlying script data has been modified since the last time getScriptAsString() was called.
 String suggestedClassName()
Determine a class name for the underlying script.

Method Detail

getScriptAsString

String getScriptAsString()
                         throws IOException
Retrieve the current script source text as String.

Returns:
the script text
Throws:
IOException - if script retrieval failed

isModified

boolean isModified()
Indicate whether the underlying script data has been modified since the last time getScriptAsString() was called. Returns true if the script has not been read yet.

Returns:
whether the script data has been modified

suggestedClassName

String suggestedClassName()
Determine a class name for the underlying script.

Returns:
the suggested class name, or null if none available
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ScriptCompilationException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.scripting
Class ScriptCompilationException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.scripting.ScriptCompilationException
All Implemented Interfaces:
Serializable
public class ScriptCompilationException
extends NestedRuntimeException

Exception to be thrown on script compilation failure.

Since:
2.0
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
ScriptCompilationException(ScriptSource scriptSource, String msg, Throwable cause)
Constructor for ScriptCompilationException.
ScriptCompilationException(ScriptSource scriptSource, Throwable cause)
Constructor for ScriptCompilationException.
ScriptCompilationException(String msg)
Constructor for ScriptCompilationException.
ScriptCompilationException(String msg, Throwable cause)
Constructor for ScriptCompilationException.
Method Summary
 ScriptSource getScriptSource()
Return the source for the offending script.
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ScriptCompilationException

public ScriptCompilationException(String msg)
Constructor for ScriptCompilationException.

Parameters:
msg - the detail message

ScriptCompilationException

public ScriptCompilationException(String msg,
                                  Throwable cause)
Constructor for ScriptCompilationException.

Parameters:
msg - the detail message
cause - the root cause (usually from using an underlying script compiler API)

ScriptCompilationException

public ScriptCompilationException(ScriptSource scriptSource,
                                  Throwable cause)
Constructor for ScriptCompilationException.

Parameters:
scriptSource - the source for the offending script
cause - the root cause (usually from using an underlying script compiler API)

ScriptCompilationException

public ScriptCompilationException(ScriptSource scriptSource,
                                  String msg,
                                  Throwable cause)
Constructor for ScriptCompilationException.

Parameters:
msg - the detail message
scriptSource - the source for the offending script
cause - the root cause (usually from using an underlying script compiler API)
Method Detail

getScriptSource

public ScriptSource getScriptSource()
Return the source for the offending script.

Returns:
the source, or null if not available
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.scripting.bsh

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.scripting.bsh

Package providing integration of BeanShell into Spring's scripting infrastructure.

See:
Description

Class Summary
BshScriptFactory | ScriptFactory implementation for a BeanShell script.
BshScriptUtils | Utility methods for handling BeanShell-scripted objects.

Exception Summary
BshScriptUtils.BshExecutionException Exception to be thrown on script execution failure.

Package org.springframework.scripting.bsh Description

Package providing integration of BeanShell into Spring's scripting infrastructure.


org.springframework.scripting.bsh Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.scripting.bsh

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.scripting.bsh.BshScriptFactory (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.scripting.ScriptFactory)
    • org.springframework.scripting.bsh.BshScriptUtils
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.scripting.bsh.BshScriptUtils.BshExecutionException


BshScriptFactory

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.scripting.bsh
Class BshScriptFactory

java.lang.Object
    extended by  org.springframework.scripting.bsh.BshScriptFactory
All Implemented Interfaces:
BeanClassLoaderAware, ScriptFactory
public class BshScriptFactory
extends Object
implements ScriptFactory, BeanClassLoaderAware

ScriptFactory implementation for a BeanShell script.

Typically used in combination with a ScriptFactoryPostProcessor; see the latter's javadoc for a configuration example.

Since:
2.0
Author:
Juergen Hoeller, Rob Harrop
See Also:
BshScriptUtils, ScriptFactoryPostProcessor

Constructor Summary
BshScriptFactory(String scriptSourceLocator)
Create a new BshScriptFactory for the given script source.
BshScriptFactory(String scriptSourceLocator, Class[] scriptInterfaces)
Create a new BshScriptFactory for the given script source.
Method Summary
Object | getScriptedObject(ScriptSource scriptSource, Class[] actualInterfaces) Load and parse the BeanShell script via BshScriptUtils.
Class | getScriptedObjectType(ScriptSource scriptSource) Determine the type of the scripted Java object.
Class[] | getScriptInterfaces() Return the business interfaces that the script is supposed to implement.
String | getScriptSourceLocator() Return a locator that points to the source of the script.
boolean | requiresConfigInterface() BeanShell scripts do require a config interface.
boolean | requiresScriptedObjectRefresh(ScriptSource scriptSource) Determine whether a refresh is required (e.g.
void | setBeanClassLoader(ClassLoader classLoader) Callback that supplies the bean class loader to a bean instance.
String | toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

BshScriptFactory

public BshScriptFactory(String scriptSourceLocator)
Create a new BshScriptFactory for the given script source.

With this BshScriptFactory variant, the script needs to declare a full class or return an actual instance of the scripted object.

Parameters:
scriptSourceLocator - a locator that points to the source of the script. Interpreted by the post-processor that actually creates the script.

BshScriptFactory

public BshScriptFactory(String scriptSourceLocator,
                        Class[] scriptInterfaces)
Create a new BshScriptFactory for the given script source.

The script may either be a simple script that needs a corresponding proxy generated (implementing the specified interfaces), or declare a full class or return an actual instance of the scripted object (in which case the specified interfaces, if any, need to be implemented by that class/instance).

Parameters:
scriptSourceLocator - a locator that points to the source of the script. Interpreted by the post-processor that actually creates the script.
scriptInterfaces - the Java interfaces that the scripted object is supposed to implement (may be null)
Method Detail

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

getScriptSourceLocator

public String getScriptSourceLocator()
Description copied from interface: ScriptFactory
Return a locator that points to the source of the script. Interpreted by the post-processor that actually creates the script.

Typical supported locators are Spring resource locations (such as "file:C:/myScript.bsh" or "classpath:myPackage/myScript.bsh") and inline scripts ("inline:myScriptText...").

Specified by:
getScriptSourceLocator in interface ScriptFactory
Returns:
the script source locator
See Also:
ScriptFactoryPostProcessor.convertToScriptSource(java.lang.String, java.lang.String, org.springframework.core.io.ResourceLoader), ResourceLoader

getScriptInterfaces

public Class[] getScriptInterfaces()
Description copied from interface: ScriptFactory
Return the business interfaces that the script is supposed to implement.

Can return null if the script itself determines its Java interfaces (such as in the case of Groovy).

Specified by:
getScriptInterfaces in interface ScriptFactory
Returns:
the interfaces for the script

requiresConfigInterface

public boolean requiresConfigInterface()
BeanShell scripts do require a config interface.

Specified by:
requiresConfigInterface in interface ScriptFactory
Returns:
whether the script requires a generated config interface
See Also:
ScriptFactory.getScriptInterfaces()

getScriptedObject

public Object getScriptedObject(ScriptSource scriptSource,
                                Class[] actualInterfaces)
                         throws IOException,
                                ScriptCompilationException
Load and parse the BeanShell script via BshScriptUtils.

Specified by:
getScriptedObject in interface ScriptFactory
Parameters:
scriptSource - the actual ScriptSource to retrieve the script source text from (never null)
actualInterfaces - the actual interfaces to expose, including script interfaces as well as a generated config interface (if applicable; may be null)
Returns:
the scripted Java object
Throws:
IOException - if script retrieval failed
ScriptCompilationException - if script compilation failed
See Also:
BshScriptUtils.createBshObject(String, Class[], ClassLoader)

getScriptedObjectType

public Class getScriptedObjectType(ScriptSource scriptSource)
                            throws IOException,
                                   ScriptCompilationException
Description copied from interface: ScriptFactory
Determine the type of the scripted Java object.

Implementations are encouraged to cache script metadata such as a generated script class. Note that this method may be invoked concurrently and must be implemented in a thread-safe fashion.

Specified by:
getScriptedObjectType in interface ScriptFactory
Parameters:
scriptSource - the actual ScriptSource to retrieve the script source text from (never null)
Returns:
the type of the scripted Java object, or null if none could be determined
Throws:
IOException - if script retrieval failed
ScriptCompilationException - if script compilation failed

requiresScriptedObjectRefresh

public boolean requiresScriptedObjectRefresh(ScriptSource scriptSource)
Description copied from interface: ScriptFactory
Determine whether a refresh is required (e.g. through ScriptSource's isModified() method).

Specified by:
requiresScriptedObjectRefresh in interface ScriptFactory
Parameters:
scriptSource - the actual ScriptSource to retrieve the script source text from (never null)
Returns:
whether a fresh ScriptFactory.getScriptedObject(org.springframework.scripting.ScriptSource, java.lang.Class[]) call is required
See Also:
ScriptSource.isModified()

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


BshScriptUtils

org.springframework.scripting.bsh
Class BshScriptUtils

java.lang.Object
    extended by  org.springframework.scripting.bsh.BshScriptUtils

public abstract class BshScriptUtils
extends Object

Utility methods for handling BeanShell-scripted objects.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller

Nested Class Summary
static class BshScriptUtils.BshExecutionException
Exception to be thrown on script execution failure.
Constructor Summary
BshScriptUtils()
Method Summary
static Object | createBshObject(String scriptSource) Create a new BeanShell-scripted object from the given script source.
static Object | createBshObject(String scriptSource, Class[] scriptInterfaces) Create a new BeanShell-scripted object from the given script source, using the default ClassLoader.
static Object | createBshObject(String scriptSource, Class[] scriptInterfaces, ClassLoader classLoader) Create a new BeanShell-scripted object from the given script source.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BshScriptUtils

public BshScriptUtils()
Method Detail

createBshObject

public static Object createBshObject(String scriptSource)
                              throws bsh.EvalError
Create a new BeanShell-scripted object from the given script source.

With this createBshObject variant, the script needs to declare a full class or return an actual instance of the scripted object.

Parameters:
scriptSource - the script source text
Returns:
the scripted Java object
Throws:
bsh.EvalError - in case of BeanShell parsing failure

createBshObject

public static Object createBshObject(String scriptSource,
                                     Class[] scriptInterfaces)
                              throws bsh.EvalError
Create a new BeanShell-scripted object from the given script source, using the default ClassLoader.

The script may either be a simple script that needs a corresponding proxy generated (implementing the specified interfaces), or declare a full class or return an actual instance of the scripted object (in which case the specified interfaces, if any, need to be implemented by that class/instance).

Parameters:
scriptSource - the script source text
scriptInterfaces - the interfaces that the scripted Java object is supposed to implement (may be null or empty if the script itself declares a full class or returns an actual instance of the scripted object)
Returns:
the scripted Java object
Throws:
bsh.EvalError - in case of BeanShell parsing failure
See Also:
createBshObject(String, Class[], ClassLoader)

createBshObject

public static Object createBshObject(String scriptSource,
                                     Class[] scriptInterfaces,
                                     ClassLoader classLoader)
                              throws bsh.EvalError
Create a new BeanShell-scripted object from the given script source.

The script may either be a simple script that needs a corresponding proxy generated (implementing the specified interfaces), or declare a full class or return an actual instance of the scripted object (in which case the specified interfaces, if any, need to be implemented by that class/instance).

Parameters:
scriptSource - the script source text
scriptInterfaces - the interfaces that the scripted Java object is supposed to implement (may be null or empty if the script itself declares a full class or returns an actual instance of the scripted object)
classLoader - the ClassLoader to create the script proxy with
Returns:
the scripted Java object
Throws:
bsh.EvalError - in case of BeanShell parsing failure
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BshScriptUtils.BshExecutionException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.scripting.bsh
Class BshScriptUtils.BshExecutionException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.scripting.bsh.BshScriptUtils.BshExecutionException
All Implemented Interfaces:
Serializable
Enclosing class:
BshScriptUtils
public static class BshScriptUtils.BshExecutionException
extends NestedRuntimeException

Exception to be thrown on script execution failure.

See Also:
Serialized Form

Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.scripting.config

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.scripting.config

Support package for Spring's dynamic language machinery, with XML schema being the primary configuration format.

See:
Description

Class Summary
LangNamespaceHandler | NamespaceHandler that supports the wiring of objects backed by dynamic languages such as Groovy, JRuby and BeanShell.
LangNamespaceUtils |
ScriptingDefaultsParser |

Package org.springframework.scripting.config Description

Support package for Spring's dynamic language machinery, with XML schema being the primary configuration format.


org.springframework.scripting.config Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.scripting.config

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.scripting.config.LangNamespaceUtils
    • org.springframework.beans.factory.xml.NamespaceHandlerSupport (implements org.springframework.beans.factory.xml.NamespaceHandler)
      • org.springframework.scripting.config.LangNamespaceHandler
    • org.springframework.scripting.config.ScriptingDefaultsParser (implements org.springframework.beans.factory.xml.BeanDefinitionParser)


LangNamespaceHandler

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.scripting.config
Class LangNamespaceHandler

java.lang.Object
    extended by  org.springframework.beans.factory.xml.NamespaceHandlerSupport
        extended by  org.springframework.scripting.config.LangNamespaceHandler
All Implemented Interfaces:
NamespaceHandler
public class LangNamespaceHandler
extends NamespaceHandlerSupport

NamespaceHandler that supports the wiring of objects backed by dynamic languages such as Groovy, JRuby and BeanShell. The following is an example (from the reference documentation) that details the wiring of a Groovy backed bean:

 <lang:groovy id="messenger"
     refresh-check-delay="5000"
     script-source="classpath:Messenger.groovy">
 <lang:property name="message" value="I Can Do The Frug"/>
 </lang:groovy>

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller, Mark Fisher

Constructor Summary
LangNamespaceHandler()
Method Summary
 void init()
Invoked by the DefaultBeanDefinitionDocumentReader after construction but before any custom elements are parsed.
Methods inherited from class org.springframework.beans.factory.xml.NamespaceHandlerSupport
decorate, parse, registerBeanDefinitionDecorator, registerBeanDefinitionDecoratorForAttribute, registerBeanDefinitionParser
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

LangNamespaceHandler

public LangNamespaceHandler()
Method Detail

init

public void init()
Description copied from interface: NamespaceHandler
Invoked by the DefaultBeanDefinitionDocumentReader after construction but before any custom elements are parsed.

See Also:
NamespaceHandlerSupport.registerBeanDefinitionParser(String, BeanDefinitionParser)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


LangNamespaceUtils

org.springframework.scripting.config
Class LangNamespaceUtils

java.lang.Object
    extended by  org.springframework.scripting.config.LangNamespaceUtils

public abstract class LangNamespaceUtils
extends Object

Since:
2.5
Author:
Rob Harrop, Mark Fisher

Constructor Summary
LangNamespaceUtils()
Method Summary
static BeanDefinition registerScriptFactoryPostProcessorIfNecessary(BeanDefinitionRegistry registry)
Register a ScriptFactoryPostProcessor bean definition in the supplied BeanDefinitionRegistry if the ScriptFactoryPostProcessor hasn't already been registered.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

LangNamespaceUtils

public LangNamespaceUtils()
Method Detail

registerScriptFactoryPostProcessorIfNecessary

public static BeanDefinition registerScriptFactoryPostProcessorIfNecessary(BeanDefinitionRegistry registry)
Register a ScriptFactoryPostProcessor bean definition in the supplied BeanDefinitionRegistry if the ScriptFactoryPostProcessor hasn't already been registered.

Parameters:
registry - the BeanDefinitionRegistry to register the script processor with
Returns:
the ScriptFactoryPostProcessor bean definition (new or already registered)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ScriptingDefaultsParser

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.scripting.config
Class ScriptingDefaultsParser

java.lang.Object
    extended by  org.springframework.scripting.config.ScriptingDefaultsParser
All Implemented Interfaces:
BeanDefinitionParser
public class ScriptingDefaultsParser
extends Object
implements BeanDefinitionParser

Since:
2.5
Author:
Mark Fisher

Constructor Summary
ScriptingDefaultsParser()
Method Summary
 BeanDefinition parse(Element element, ParserContext parserContext)
Parse the specified Element and register the resulting BeanDefinition(s) with the ParserContext.getRegistry() BeanDefinitionRegistry} embedded in the supplied ParserContext.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ScriptingDefaultsParser

public ScriptingDefaultsParser()
Method Detail

parse

public BeanDefinition parse(Element element,
                            ParserContext parserContext)
Description copied from interface: BeanDefinitionParser
Parse the specified Element and register the resulting BeanDefinition(s) with the ParserContext.getRegistry() BeanDefinitionRegistry} embedded in the supplied ParserContext.

Implementations must return the primary BeanDefinition that results from the parse if they will ever be used in a nested fashion (for example as an inner tag in a <property/> tag). Implementations may return null if they will not be used in a nested fashion.

Specified by:
parse in interface BeanDefinitionParser
Parameters:
element - the element that is to be parsed into one or more BeanDefinitions
parserContext - the object encapsulating the current state of the parsing process; provides access to a BeanDefinitionRegistry
Returns:
the primary BeanDefinition
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.scripting.groovy

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.scripting.groovy

Package providing integration of Groovy into Spring's scripting infrastructure.

See:
Description

Interface Summary
GroovyObjectCustomizer Strategy used by GroovyScriptFactory to allow the customization of a created GroovyObject.

Class Summary
GroovyScriptFactory ScriptFactory implementation for a Groovy script.

Package org.springframework.scripting.groovy Description

Package providing integration of Groovy into Spring's scripting infrastructure.


org.springframework.scripting.groovy Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.scripting.groovy

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.scripting.groovy.GroovyScriptFactory (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.scripting.ScriptFactory)

Interface Hierarchy

  • org.springframework.scripting.groovy.GroovyObjectCustomizer


GroovyObjectCustomizer

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.scripting.groovy
Interface GroovyObjectCustomizer

public interface GroovyObjectCustomizer

Strategy used by GroovyScriptFactory to allow the customization of a created GroovyObject.

This is useful to allow the authoring of DSLs, the replacement of missing methods, and so forth. For example, a custom MetaClass could be specified.

Since:
2.0.2
Author:
Rod Johnson
See Also:
GroovyScriptFactory

Method Summary
 void customize(groovy.lang.GroovyObject goo)
Customize the supplied GroovyObject.

Method Detail

customize

void customize(groovy.lang.GroovyObject goo)
Customize the supplied GroovyObject.

For example, this can be used to set a custom metaclass to handle missing methods.

Parameters:
goo - the GroovyObject to customize
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


GroovyScriptFactory

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.scripting.groovy
Class GroovyScriptFactory

java.lang.Object
    extended by  org.springframework.scripting.groovy.GroovyScriptFactory
All Implemented Interfaces:
BeanClassLoaderAware, BeanFactoryAware, ScriptFactory
public class GroovyScriptFactory
extends Object
implements ScriptFactory, BeanFactoryAware, BeanClassLoaderAware

ScriptFactory implementation for a Groovy script.

Typically used in combination with a ScriptFactoryPostProcessor; see the latter's javadoc} for a configuration example.

Since:
2.0
Author:
Juergen Hoeller, Rob Harrop, Rod Johnson
See Also:
GroovyClassLoader, ScriptFactoryPostProcessor

Constructor Summary
GroovyScriptFactory(String scriptSourceLocator)
Create a new GroovyScriptFactory for the given script source.
GroovyScriptFactory(String scriptSourceLocator, GroovyObjectCustomizer groovyObjectCustomizer)
Create a new GroovyScriptFactory for the given script source, specifying a strategy interface that can create a custom MetaClass to supply missing methods and otherwise change the behavior of the object.
Method Summary
protected Object | executeScript(ScriptSource scriptSource, Class scriptClass) Instantiate the given Groovy script class and run it if necessary.
groovy.lang.GroovyClassLoader | getGroovyClassLoader() Return the GroovyClassLoader used by this script factory.
Object | getScriptedObject(ScriptSource scriptSource, Class[] actualInterfaces) Loads and parses the Groovy script via the GroovyClassLoader.
Class | getScriptedObjectType(ScriptSource scriptSource) Determine the type of the scripted Java object.
Class[] | getScriptInterfaces() Groovy scripts determine their interfaces themselves, hence we don't need to explicitly expose interfaces here.
String | getScriptSourceLocator() Return a locator that points to the source of the script.
boolean | requiresConfigInterface() Groovy scripts do not need a config interface, since they expose their setters as public methods.
boolean | requiresScriptedObjectRefresh(ScriptSource scriptSource) Determine whether a refresh is required (e.g.
void | setBeanClassLoader(ClassLoader classLoader) Callback that supplies the bean class loader to a bean instance.
void | setBeanFactory(BeanFactory beanFactory) Callback that supplies the owning factory to a bean instance.
String | toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

GroovyScriptFactory

public GroovyScriptFactory(String scriptSourceLocator)
Create a new GroovyScriptFactory for the given script source.

We don't need to specify script interfaces here, since a Groovy script defines its Java interfaces itself.

Parameters:
scriptSourceLocator - a locator that points to the source of the script. Interpreted by the post-processor that actually creates the script.

GroovyScriptFactory

public GroovyScriptFactory(String scriptSourceLocator,
                           GroovyObjectCustomizer groovyObjectCustomizer)
Create a new GroovyScriptFactory for the given script source, specifying a strategy interface that can create a custom MetaClass to supply missing methods and otherwise change the behavior of the object.

We don't need to specify script interfaces here, since a Groovy script defines its Java interfaces itself.

Parameters:
scriptSourceLocator - a locator that points to the source of the script. Interpreted by the post-processor that actually creates the script.
groovyObjectCustomizer - a customizer that can set a custom metaclass or make other changes to the GroovyObject created by this factory (may be null)
Method Detail

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
                    throws BeansException
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
Throws:
BeansException - in case of initialization errors
See Also:
BeanInitializationException

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

getGroovyClassLoader

public groovy.lang.GroovyClassLoader getGroovyClassLoader()
Return the GroovyClassLoader used by this script factory.

getScriptSourceLocator

public String getScriptSourceLocator()
Description copied from interface: ScriptFactory
Return a locator that points to the source of the script. Interpreted by the post-processor that actually creates the script.

Typical supported locators are Spring resource locations (such as "file:C:/myScript.bsh" or "classpath:myPackage/myScript.bsh") and inline scripts ("inline:myScriptText...").

Specified by:
getScriptSourceLocator in interface ScriptFactory
Returns:
the script source locator
See Also:
ScriptFactoryPostProcessor.convertToScriptSource(java.lang.String, java.lang.String, org.springframework.core.io.ResourceLoader), ResourceLoader

getScriptInterfaces

public Class[] getScriptInterfaces()
Groovy scripts determine their interfaces themselves, hence we don't need to explicitly expose interfaces here.

Specified by:
getScriptInterfaces in interface ScriptFactory
Returns:
null always

requiresConfigInterface

public boolean requiresConfigInterface()
Groovy scripts do not need a config interface, since they expose their setters as public methods.

Specified by:
requiresConfigInterface in interface ScriptFactory
Returns:
whether the script requires a generated config interface
See Also:
ScriptFactory.getScriptInterfaces()

getScriptedObject

public Object getScriptedObject(ScriptSource scriptSource,
                                Class[] actualInterfaces)
                         throws IOException,
                                ScriptCompilationException
Loads and parses the Groovy script via the GroovyClassLoader.

Specified by:
getScriptedObject in interface ScriptFactory
Parameters:
scriptSource - the actual ScriptSource to retrieve the script source text from (never null)
actualInterfaces - the actual interfaces to expose, including script interfaces as well as a generated config interface (if applicable; may be null)
Returns:
the scripted Java object
Throws:
IOException - if script retrieval failed
ScriptCompilationException - if script compilation failed
See Also:
GroovyClassLoader

getScriptedObjectType

public Class getScriptedObjectType(ScriptSource scriptSource)
                            throws IOException,
                                   ScriptCompilationException
Description copied from interface: ScriptFactory
Determine the type of the scripted Java object.

Implementations are encouraged to cache script metadata such as a generated script class. Note that this method may be invoked concurrently and must be implemented in a thread-safe fashion.

Specified by:
getScriptedObjectType in interface ScriptFactory
Parameters:
scriptSource - the actual ScriptSource to retrieve the script source text from (never null)
Returns:
the type of the scripted Java object, or null if none could be determined
Throws:
IOException - if script retrieval failed
ScriptCompilationException - if script compilation failed

requiresScriptedObjectRefresh

public boolean requiresScriptedObjectRefresh(ScriptSource scriptSource)
Description copied from interface: ScriptFactory
Determine whether a refresh is required (e.g. through ScriptSource's isModified() method).

Specified by:
requiresScriptedObjectRefresh in interface ScriptFactory
Parameters:
scriptSource - the actual ScriptSource to retrieve the script source text from (never null)
Returns:
whether a fresh ScriptFactory.getScriptedObject(org.springframework.scripting.ScriptSource, java.lang.Class[]) call is required
See Also:
ScriptSource.isModified()

executeScript

protected Object executeScript(ScriptSource scriptSource,
                               Class scriptClass)
                        throws ScriptCompilationException
Instantiate the given Groovy script class and run it if necessary.

Parameters:
scriptSource - the source for the underlying script
scriptClass - the Groovy script class
Returns:
the result object (either an instance of the script class or the result of running the script instance)
Throws:
ScriptCompilationException - in case of instantiation failure

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.scripting.jruby

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.scripting.jruby

Package providing integration of JRuby into Spring's scripting infrastructure.

See:
Description

Class Summary
JRubyScriptFactory | ScriptFactory implementation for a JRuby script.
JRubyScriptUtils | Utility methods for handling JRuby-scripted objects.

Exception Summary
JRubyScriptUtils.JRubyExecutionException Exception thrown in response to a JRuby RaiseException being thrown from a JRuby method invocation.

Package org.springframework.scripting.jruby Description

Package providing integration of JRuby into Spring's scripting infrastructure.


org.springframework.scripting.jruby Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.scripting.jruby

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.scripting.jruby.JRubyScriptFactory (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.scripting.ScriptFactory)
    • org.springframework.scripting.jruby.JRubyScriptUtils
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.scripting.jruby.JRubyScriptUtils.JRubyExecutionException


JRubyScriptFactory

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.scripting.jruby
Class JRubyScriptFactory

java.lang.Object
    extended by  org.springframework.scripting.jruby.JRubyScriptFactory
All Implemented Interfaces:
BeanClassLoaderAware, ScriptFactory
public class JRubyScriptFactory
extends Object
implements ScriptFactory, BeanClassLoaderAware

ScriptFactory implementation for a JRuby script.

Typically used in combination with a ScriptFactoryPostProcessor; see the latter's javadoc for a configuration example.

Since:
2.0
Author:
Juergen Hoeller, Rob Harrop
See Also:
JRubyScriptUtils, ScriptFactoryPostProcessor

Constructor Summary
JRubyScriptFactory(String scriptSourceLocator, Class[] scriptInterfaces)
Create a new JRubyScriptFactory for the given script source.
Method Summary
Object | getScriptedObject(ScriptSource scriptSource, Class[] actualInterfaces) Load and parse the JRuby script via JRubyScriptUtils.
Class | getScriptedObjectType(ScriptSource scriptSource) Determine the type of the scripted Java object.
Class[] | getScriptInterfaces() Return the business interfaces that the script is supposed to implement.
String | getScriptSourceLocator() Return a locator that points to the source of the script.
boolean | requiresConfigInterface() JRuby scripts do require a config interface.
boolean | requiresScriptedObjectRefresh(ScriptSource scriptSource) Determine whether a refresh is required (e.g.
void | setBeanClassLoader(ClassLoader classLoader) Callback that supplies the bean class loader to a bean instance.
String | toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

JRubyScriptFactory

public JRubyScriptFactory(String scriptSourceLocator,
                          Class[] scriptInterfaces)
Create a new JRubyScriptFactory for the given script source.

Parameters:
scriptSourceLocator - a locator that points to the source of the script. Interpreted by the post-processor that actually creates the script.
scriptInterfaces - the Java interfaces that the scripted object is supposed to implement
Method Detail

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

getScriptSourceLocator

public String getScriptSourceLocator()
Description copied from interface: ScriptFactory
Return a locator that points to the source of the script. Interpreted by the post-processor that actually creates the script.

Typical supported locators are Spring resource locations (such as "file:C:/myScript.bsh" or "classpath:myPackage/myScript.bsh") and inline scripts ("inline:myScriptText...").

Specified by:
getScriptSourceLocator in interface ScriptFactory
Returns:
the script source locator
See Also:
ScriptFactoryPostProcessor.convertToScriptSource(java.lang.String, java.lang.String, org.springframework.core.io.ResourceLoader), ResourceLoader

getScriptInterfaces

public Class[] getScriptInterfaces()
Description copied from interface: ScriptFactory
Return the business interfaces that the script is supposed to implement.

Can return null if the script itself determines its Java interfaces (such as in the case of Groovy).

Specified by:
getScriptInterfaces in interface ScriptFactory
Returns:
the interfaces for the script

requiresConfigInterface

public boolean requiresConfigInterface()
JRuby scripts do require a config interface.

Specified by:
requiresConfigInterface in interface ScriptFactory
Returns:
whether the script requires a generated config interface
See Also:
ScriptFactory.getScriptInterfaces()

getScriptedObject

public Object getScriptedObject(ScriptSource scriptSource,
                                Class[] actualInterfaces)
                         throws IOException,
                                ScriptCompilationException
Load and parse the JRuby script via JRubyScriptUtils.

Specified by:
getScriptedObject in interface ScriptFactory
Parameters:
scriptSource - the actual ScriptSource to retrieve the script source text from (never null)
actualInterfaces - the actual interfaces to expose, including script interfaces as well as a generated config interface (if applicable; may be null)
Returns:
the scripted Java object
Throws:
IOException - if script retrieval failed
ScriptCompilationException - if script compilation failed
See Also:
JRubyScriptUtils.createJRubyObject(String, Class[], ClassLoader)

getScriptedObjectType

public Class getScriptedObjectType(ScriptSource scriptSource)
                            throws IOException,
                                   ScriptCompilationException
Description copied from interface: ScriptFactory
Determine the type of the scripted Java object.

Implementations are encouraged to cache script metadata such as a generated script class. Note that this method may be invoked concurrently and must be implemented in a thread-safe fashion.

Specified by:
getScriptedObjectType in interface ScriptFactory
Parameters:
scriptSource - the actual ScriptSource to retrieve the script source text from (never null)
Returns:
the type of the scripted Java object, or null if none could be determined
Throws:
IOException - if script retrieval failed
ScriptCompilationException - if script compilation failed

requiresScriptedObjectRefresh

public boolean requiresScriptedObjectRefresh(ScriptSource scriptSource)
Description copied from interface: ScriptFactory
Determine whether a refresh is required (e.g. through ScriptSource's isModified() method).

Specified by:
requiresScriptedObjectRefresh in interface ScriptFactory
Parameters:
scriptSource - the actual ScriptSource to retrieve the script source text from (never null)
Returns:
whether a fresh ScriptFactory.getScriptedObject(org.springframework.scripting.ScriptSource, java.lang.Class[]) call is required
See Also:
ScriptSource.isModified()

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


JRubyScriptUtils

org.springframework.scripting.jruby
Class JRubyScriptUtils

java.lang.Object
    extended by  org.springframework.scripting.jruby.JRubyScriptUtils

public abstract class JRubyScriptUtils
extends Object

Utility methods for handling JRuby-scripted objects.

As of Spring 3.0, this class requires JRuby 1.1 or higher.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller, Rick Evans

Nested Class Summary
static class JRubyScriptUtils.JRubyExecutionException
Exception thrown in response to a JRuby RaiseException being thrown from a JRuby method invocation.
Constructor Summary
JRubyScriptUtils()
Method Summary
static Object | createJRubyObject(String scriptSource, Class[] interfaces) Create a new JRuby-scripted object from the given script source, using the default ClassLoader.
static Object | createJRubyObject(String scriptSource, Class[] interfaces, ClassLoader classLoader) Create a new JRuby-scripted object from the given script source.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JRubyScriptUtils

public JRubyScriptUtils()
Method Detail

createJRubyObject

public static Object createJRubyObject(String scriptSource,
                                       Class[] interfaces)
                                throws org.jruby.exceptions.JumpException
Create a new JRuby-scripted object from the given script source, using the default ClassLoader.

Parameters:
scriptSource - the script source text
interfaces - the interfaces that the scripted Java object is to implement
Returns:
the scripted Java object
Throws:
org.jruby.exceptions.JumpException - in case of JRuby parsing failure
See Also:
ClassUtils.getDefaultClassLoader()

createJRubyObject

public static Object createJRubyObject(String scriptSource,
                                       Class[] interfaces,
                                       ClassLoader classLoader)
Create a new JRuby-scripted object from the given script source.

Parameters:
scriptSource - the script source text
interfaces - the interfaces that the scripted Java object is to implement
classLoader - the ClassLoader to create the script proxy with
Returns:
the scripted Java object
Throws:
org.jruby.exceptions.JumpException - in case of JRuby parsing failure
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JRubyScriptUtils.JRubyExecutionException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.scripting.jruby
Class JRubyScriptUtils.JRubyExecutionException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.scripting.jruby.JRubyScriptUtils.JRubyExecutionException
All Implemented Interfaces:
Serializable
Enclosing class:
JRubyScriptUtils
public static class JRubyScriptUtils.JRubyExecutionException
extends NestedRuntimeException

Exception thrown in response to a JRuby RaiseException being thrown from a JRuby method invocation.

Introduced because the RaiseException class does not have useful Object.toString(), Throwable.getMessage(), and Throwable.printStackTrace() implementations.

See Also:
Serialized Form

Constructor Summary
JRubyScriptUtils.JRubyExecutionException(org.jruby.exceptions.RaiseException ex)
Create a new JRubyException, wrapping the given JRuby RaiseException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

JRubyScriptUtils.JRubyExecutionException

public JRubyScriptUtils.JRubyExecutionException(org.jruby.exceptions.RaiseException ex)
Create a new JRubyException, wrapping the given JRuby RaiseException.

Parameters:
ex - the cause (must not be null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.scripting.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.scripting.support

Support classes for Spring's scripting package.

See:
Description

Class Summary
RefreshableScriptTargetSource | Subclass of BeanFactoryRefreshableTargetSource that determines whether a refresh is required through the given ScriptFactory.
ResourceScriptSource | ScriptSource implementation based on Spring's Resource abstraction.
ScriptFactoryPostProcessor | BeanPostProcessor that handles ScriptFactory definitions, replacing each factory with the actual scripted Java object generated by it.
StaticScriptSource | Static implementation of the ScriptSource interface, encapsulating a given String that contains the script source text.

Package org.springframework.scripting.support Description

Support classes for Spring's scripting package. Provides a ScriptFactoryPostProcessor for turning ScriptFactory definitions into scripted objects.


org.springframework.scripting.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.scripting.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource (implements org.springframework.aop.target.dynamic.Refreshable, org.springframework.aop.TargetSource)
      • org.springframework.aop.target.dynamic.BeanFactoryRefreshableTargetSource
        • org.springframework.scripting.support.RefreshableScriptTargetSource
    • org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter (implements org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor)
      • org.springframework.scripting.support.ScriptFactoryPostProcessor (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.core.Ordered, org.springframework.context.ResourceLoaderAware)
    • org.springframework.scripting.support.ResourceScriptSource (implements org.springframework.scripting.ScriptSource)
    • org.springframework.scripting.support.StaticScriptSource (implements org.springframework.scripting.ScriptSource)


RefreshableScriptTargetSource

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.scripting.support
Class RefreshableScriptTargetSource

java.lang.Object
    extended by  org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource
        extended by  org.springframework.aop.target.dynamic.BeanFactoryRefreshableTargetSource
            extended by  org.springframework.scripting.support.RefreshableScriptTargetSource
All Implemented Interfaces:
Refreshable, TargetClassAware, TargetSource
public class RefreshableScriptTargetSource
extends BeanFactoryRefreshableTargetSource

Subclass of BeanFactoryRefreshableTargetSource that determines whether a refresh is required through the given ScriptFactory.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller, Mark Fisher

Field Summary
Fields inherited from class org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource
logger, targetObject
Constructor Summary
RefreshableScriptTargetSource(BeanFactory beanFactory, String beanName, ScriptFactory scriptFactory, ScriptSource scriptSource, boolean isFactoryBean)
Create a new RefreshableScriptTargetSource.
Method Summary
protected Object | obtainFreshBean(BeanFactory beanFactory, String beanName) Obtain a fresh target object, retrieving a FactoryBean if necessary.
protected boolean | requiresRefresh() Determine whether a refresh is required through calling ScriptFactory's requiresScriptedObjectRefresh method.
Methods inherited from class org.springframework.aop.target.dynamic.BeanFactoryRefreshableTargetSource
freshTarget
Methods inherited from class org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource
getLastRefreshTime, getRefreshCount, getTarget, getTargetClass, isStatic, refresh, releaseTarget, setRefreshCheckDelay
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

RefreshableScriptTargetSource

public RefreshableScriptTargetSource(BeanFactory beanFactory,
                                     String beanName,
                                     ScriptFactory scriptFactory,
                                     ScriptSource scriptSource,
                                     boolean isFactoryBean)
Create a new RefreshableScriptTargetSource.

Parameters:
beanFactory - the BeanFactory to fetch the scripted bean from
beanName - the name of the target bean
scriptFactory - the ScriptFactory to delegate to for determining whether a refresh is required
scriptSource - the ScriptSource for the script definition
isFactoryBean - whether the target script defines a FactoryBean
Method Detail

requiresRefresh

protected boolean requiresRefresh()
Determine whether a refresh is required through calling ScriptFactory's requiresScriptedObjectRefresh method.

Overrides:
requiresRefresh in class AbstractRefreshableTargetSource
Returns:
whether a refresh is required
See Also:
ScriptFactory.requiresScriptedObjectRefresh(ScriptSource)

obtainFreshBean

protected Object obtainFreshBean(BeanFactory beanFactory,
                                 String beanName)
Obtain a fresh target object, retrieving a FactoryBean if necessary.

Overrides:
obtainFreshBean in class BeanFactoryRefreshableTargetSource
See Also:
BeanFactory.getBean(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ResourceScriptSource

org.springframework.scripting.support
Class ResourceScriptSource

java.lang.Object
    extended by  org.springframework.scripting.support.ResourceScriptSource
All Implemented Interfaces:
ScriptSource
public class ResourceScriptSource
extends Object
implements ScriptSource

ScriptSource implementation based on Spring's Resource abstraction. Loads the script text from the underlying Resource's File or InputStream, and tracks the last-modified timestamp of the file (if possible).

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
See Also:
InputStreamSource.getInputStream(), Resource.getFile(), ResourceLoader

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
ResourceScriptSource(Resource resource)
Create a new ResourceScriptSource for the given resource.
Method Summary
 Resource getResource()
Return the Resource to load the script from.
 String getScriptAsString()
Retrieve the current script source text as String.
 boolean isModified()
Indicate whether the underlying script data has been modified since the last time ScriptSource.getScriptAsString() was called.
protected  long retrieveLastModifiedTime()
Retrieve the current last-modified timestamp of the underlying resource.
 void setEncoding(String encoding)
Sets the encoding used for reading the script resource.
 String suggestedClassName()
Determine a class name for the underlying script.
 String toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

ResourceScriptSource

public ResourceScriptSource(Resource resource)
Create a new ResourceScriptSource for the given resource.

Parameters:
resource - the Resource to load the script from
Method Detail

getResource

public final Resource getResource()
Return the Resource to load the script from.

getScriptAsString

public String getScriptAsString()
                         throws IOException
Description copied from interface: ScriptSource
Retrieve the current script source text as String.

Specified by:
getScriptAsString in interface ScriptSource
Returns:
the script text
Throws:
IOException - if script retrieval failed

isModified

public boolean isModified()
Description copied from interface: ScriptSource
Indicate whether the underlying script data has been modified since the last time ScriptSource.getScriptAsString() was called. Returns true if the script has not been read yet.

Specified by:
isModified in interface ScriptSource
Returns:
whether the script data has been modified

retrieveLastModifiedTime

protected long retrieveLastModifiedTime()
Retrieve the current last-modified timestamp of the underlying resource.

Returns:
the current timestamp, or 0 if not determinable

suggestedClassName

public String suggestedClassName()
Description copied from interface: ScriptSource
Determine a class name for the underlying script.

Specified by:
suggestedClassName in interface ScriptSource
Returns:
the suggested class name, or null if none available

setEncoding

public void setEncoding(String encoding)
Sets the encoding used for reading the script resource. The default value is "UTF-8". A null value, implies the platform default.

Parameters:
encoding - charset encoding used for reading the script.

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ScriptFactoryPostProcessor

org.springframework.scripting.support
Class ScriptFactoryPostProcessor

java.lang.Object
    extended by  org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter
        extended by  org.springframework.scripting.support.ScriptFactoryPostProcessor
All Implemented Interfaces:
BeanClassLoaderAware, BeanFactoryAware, BeanPostProcessor, InstantiationAwareBeanPostProcessor, SmartInstantiationAwareBeanPostProcessor, DisposableBean, ResourceLoaderAware, Ordered
public class ScriptFactoryPostProcessor
extends InstantiationAwareBeanPostProcessorAdapter
implements BeanClassLoaderAware, BeanFactoryAware, ResourceLoaderAware, DisposableBean, Ordered

BeanPostProcessor that handles ScriptFactory definitions, replacing each factory with the actual scripted Java object generated by it.

This is similar to the FactoryBean mechanism, but is specifically tailored for scripts and not built into Spring's core container itself but rather implemented as an extension.

NOTE: The most important characteristic of this post-processor is that constructor arguments are applied to the ScriptFactory instance while bean property values are applied to the generated scripted object. Typically, constructor arguments include a script source locator and potentially script interfaces, while bean property values include references and config values to inject into the scripted object itself.

The following ScriptFactoryPostProcessor will automatically be applied to the two ScriptFactory definitions below. At runtime, the actual scripted objects will be exposed for "bshMessenger" and "groovyMessenger", rather than the ScriptFactory instances. Both of those are supposed to be castable to the example's Messenger interfaces here.

<bean class="org.springframework.scripting.support.ScriptFactoryPostProcessor"/>

 <bean id="bshMessenger" class="org.springframework.scripting.bsh.BshScriptFactory">
   <constructor-arg value="classpath:mypackage/Messenger.bsh"/>
   <constructor-arg value="mypackage.Messenger"/>
   <property name="message" value="Hello World!"/>
 </bean>

 <bean id="groovyMessenger" class="org.springframework.scripting.bsh.GroovyScriptFactory">
   <constructor-arg value="classpath:mypackage/Messenger.groovy"/>
   <property name="message" value="Hello World!"/>
 </bean>

NOTE: Please note that the above excerpt from a Spring XML bean definition file uses just the <bean/>-style syntax (in an effort to illustrate using the ScriptFactoryPostProcessor itself). In reality, you would never create a <bean/> definition for a ScriptFactoryPostProcessor explicitly; rather you would import the tags from the 'lang' namespace and simply create scripted beans using the tags in that namespace... as part of doing so, a ScriptFactoryPostProcessor will implicitly be created for you.

The Spring reference documentation contains numerous examples of using tags in the 'lang' namespace; by way of an example, find below a Groovy-backed bean defined using the 'lang:groovy' tag.

 <?xml version="1.0" encoding="UTF-8"?>
 <beans xmlns="http://www.springframework.org/schema/beans"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:lang="http://www.springframework.org/schema/lang">

   <!-- this is the bean definition for the Groovy-backed Messenger implementation -->
   <lang:groovy id="messenger" script-source="classpath:Messenger.groovy">
     <lang:property name="message" value="I Can Do The Frug" />
   </lang:groovy>

   <!-- an otherwise normal bean that will be injected by the Groovy-backed Messenger -->
   <bean id="bookingService" class="x.y.DefaultBookingService">
     <property name="messenger" ref="messenger" />
   </bean>

 </beans>

Since:
2.0
Author:
Juergen Hoeller, Rob Harrop, Rick Evans, Mark Fisher

Field Summary
static String | INLINE_SCRIPT_PREFIX The Resource-style prefix that denotes an inline script.
protected Log | logger Logger available to subclasses
static String | REFRESH_CHECK_DELAY_ATTRIBUTE
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
ScriptFactoryPostProcessor()
Method Summary
protected  ScriptSource convertToScriptSource(String beanName, String scriptSourceLocator, ResourceLoader resourceLoader)
Convert the given script source locator to a ScriptSource instance.
protected  Class createCompositeInterface(Class[] interfaces)
Create a composite interface Class for the given interfaces, implementing the given interfaces in one single Class.
protected  Class createConfigInterface(BeanDefinition bd, Class[] interfaces)
Create a config interface for the given bean definition, defining setter methods for the defined property values as well as an init method and a destroy method (if defined).
protected  Object createRefreshableProxy(TargetSource ts, Class[] interfaces)
Create a refreshable proxy for the given AOP TargetSource.
protected  BeanDefinition createScriptedObjectBeanDefinition(BeanDefinition bd, String scriptFactoryBeanName, ScriptSource scriptSource, Class[] interfaces)
Create a bean definition for the scripted object, based on the given script definition, extracting the definition data that is relevant for the scripted object (that is, everything but bean class and constructor arguments).
protected  BeanDefinition createScriptFactoryBeanDefinition(BeanDefinition bd)
Create a ScriptFactory bean definition based on the given script definition, extracting only the definition data that is relevant for the ScriptFactory (that is, only bean class and constructor arguments).
 void destroy()
Destroy the inner bean factory (used for scripts) on shutdown.
 int getOrder()
Return the order value of this object, with a higher value meaning greater in terms of sorting.
protected  ScriptSource getScriptSource(String beanName, String scriptSourceLocator)
Obtain a ScriptSource for the given bean, lazily creating it if not cached already.
 Object postProcessBeforeInstantiation(Class beanClass, String beanName)
Apply this BeanPostProcessor before the target bean gets instantiated.
 Class predictBeanType(Class beanClass, String beanName)
Predict the type of the bean to be eventually returned from this processor's InstantiationAwareBeanPostProcessor.postProcessBeforeInstantiation(java.lang.Class, java.lang.String) callback.
protected  void prepareScriptBeans(BeanDefinition bd, String scriptFactoryBeanName, String scriptedObjectBeanName)
Prepare the script beans in the internal BeanFactory that this post-processor uses.
protected  long resolveRefreshCheckDelay(BeanDefinition beanDefinition)
Get the refresh check delay for the given ScriptFactory BeanDefinition.
 void setBeanClassLoader(ClassLoader classLoader)
Callback that supplies the bean class loader to a bean instance.
 void setBeanFactory(BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance.
 void setDefaultRefreshCheckDelay(long defaultRefreshCheckDelay)
Set the delay between refresh checks, in milliseconds.
 void setResourceLoader(ResourceLoader resourceLoader)
Set the ResourceLoader that this object runs in.
Methods inherited from class org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter
determineCandidateConstructors, getEarlyBeanReference, postProcessAfterInitialization, postProcessAfterInstantiation, postProcessBeforeInitialization, postProcessPropertyValues
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

INLINE_SCRIPT_PREFIX

public static final String INLINE_SCRIPT_PREFIX
The Resource-style prefix that denotes an inline script.

An inline script is a script that is defined right there in the (typically XML) configuration, as opposed to being defined in an external file.

See Also:
Constant Field Values

REFRESH_CHECK_DELAY_ATTRIBUTE

public static final String REFRESH_CHECK_DELAY_ATTRIBUTE

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

ScriptFactoryPostProcessor

public ScriptFactoryPostProcessor()
Method Detail

setDefaultRefreshCheckDelay

public void setDefaultRefreshCheckDelay(long defaultRefreshCheckDelay)
Set the delay between refresh checks, in milliseconds. Default is -1, indicating no refresh checks at all.

Note that an actual refresh will only happen when the ScriptSource indicates that it has been modified.

See Also:
ScriptSource.isModified()

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
classLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
BeanInitializationException

setResourceLoader

public void setResourceLoader(ResourceLoader resourceLoader)
Description copied from interface: ResourceLoaderAware
Set the ResourceLoader that this object runs in.

This might be a ResourcePatternResolver, which can be checked through instanceof ResourcePatternResolver. See also the ResourcePatternUtils.getResourcePatternResolver method.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked before ApplicationContextAware's setApplicationContext.

Specified by:
setResourceLoader in interface ResourceLoaderAware
Parameters:
resourceLoader - ResourceLoader object to be used by this object
See Also:
ResourcePatternResolver, ResourcePatternUtils.getResourcePatternResolver(org.springframework.core.io.ResourceLoader)

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

predictBeanType

public Class predictBeanType(Class beanClass,
                             String beanName)
Description copied from interface: SmartInstantiationAwareBeanPostProcessor
Predict the type of the bean to be eventually returned from this processor's InstantiationAwareBeanPostProcessor.postProcessBeforeInstantiation(java.lang.Class, java.lang.String) callback.

Specified by:
predictBeanType in interface SmartInstantiationAwareBeanPostProcessor
Overrides:
predictBeanType in class InstantiationAwareBeanPostProcessorAdapter
Parameters:
beanClass - the raw class of the bean
beanName - the name of the bean
Returns:
the type of the bean, or null if not predictable

postProcessBeforeInstantiation

public Object postProcessBeforeInstantiation(Class beanClass,
                                             String beanName)
Description copied from interface: InstantiationAwareBeanPostProcessor
Apply this BeanPostProcessor before the target bean gets instantiated. The returned bean object may be a proxy to use instead of the target bean, effectively suppressing default instantiation of the target bean.

If a non-null object is returned by this method, the bean creation process will be short-circuited. The only further processing applied is the BeanPostProcessor.postProcessAfterInitialization(java.lang.Object, java.lang.String) callback from the configured BeanPostProcessors.

This callback will only be applied to bean definitions with a bean class. In particular, it will not be applied to beans with a "factory-method".

Post-processors may implement the extended SmartInstantiationAwareBeanPostProcessor interface in order to predict the type of the bean object that they are going to return here.

Specified by:
postProcessBeforeInstantiation in interface InstantiationAwareBeanPostProcessor
Overrides:
postProcessBeforeInstantiation in class InstantiationAwareBeanPostProcessorAdapter
Parameters:
beanClass - the class of the bean to be instantiated
beanName - the name of the bean
Returns:
the bean object to expose instead of a default instance of the target bean, or null to proceed with default instantiation
See Also:
AbstractBeanDefinition.hasBeanClass(), AbstractBeanDefinition.getFactoryMethodName()

prepareScriptBeans

protected void prepareScriptBeans(BeanDefinition bd,
                                  String scriptFactoryBeanName,
                                  String scriptedObjectBeanName)
Prepare the script beans in the internal BeanFactory that this post-processor uses. Each original bean definition will be split into a ScriptFactory definition and a scripted object definition.

Parameters:
bd - the original bean definition in the main BeanFactory
scriptFactoryBeanName - the name of the internal ScriptFactory bean
scriptedObjectBeanName - the name of the internal scripted object bean

resolveRefreshCheckDelay

protected long resolveRefreshCheckDelay(BeanDefinition beanDefinition)
Get the refresh check delay for the given ScriptFactory BeanDefinition. If the BeanDefinition has a metadata attribute under the key REFRESH_CHECK_DELAY_ATTRIBUTE which is a valid Number type, then this value is used. Otherwise, the the defaultRefreshCheckDelay value is used.

Parameters:
beanDefinition - the BeanDefinition to check
Returns:
the refresh check delay

createScriptFactoryBeanDefinition

protected BeanDefinition createScriptFactoryBeanDefinition(BeanDefinition bd)
Create a ScriptFactory bean definition based on the given script definition, extracting only the definition data that is relevant for the ScriptFactory (that is, only bean class and constructor arguments).

Parameters:
bd - the full script bean definition
Returns:
the extracted ScriptFactory bean definition
See Also:
ScriptFactory

getScriptSource

protected ScriptSource getScriptSource(String beanName,
                                       String scriptSourceLocator)
Obtain a ScriptSource for the given bean, lazily creating it if not cached already.

Parameters:
beanName - the name of the scripted bean
scriptSourceLocator - the script source locator associated with the bean
Returns:
the corresponding ScriptSource instance
See Also:
convertToScriptSource(java.lang.String, java.lang.String, org.springframework.core.io.ResourceLoader)

convertToScriptSource

protected ScriptSource convertToScriptSource(String beanName,
                                             String scriptSourceLocator,
                                             ResourceLoader resourceLoader)
Convert the given script source locator to a ScriptSource instance.

By default, supported locators are Spring resource locations (such as "file:C:/myScript.bsh" or "classpath:myPackage/myScript.bsh") and inline scripts ("inline:myScriptText...").

Parameters:
beanName - the name of the scripted bean
scriptSourceLocator - the script source locator
resourceLoader - the ResourceLoader to use (if necessary)
Returns:
the ScriptSource instance

createConfigInterface

protected Class createConfigInterface(BeanDefinition bd,
                                      Class[] interfaces)
Create a config interface for the given bean definition, defining setter methods for the defined property values as well as an init method and a destroy method (if defined).

This implementation creates the interface via CGLIB's InterfaceMaker, determining the property types from the given interfaces (as far as possible).

Parameters:
bd - the bean definition (property values etc) to create a config interface for
interfaces - the interfaces to check against (might define getters corresponding to the setters we're supposed to generate)
Returns:
the config interface
See Also:
InterfaceMaker, BeanUtils.findPropertyType(java.lang.String, java.lang.Class[])

createCompositeInterface

protected Class createCompositeInterface(Class[] interfaces)
Create a composite interface Class for the given interfaces, implementing the given interfaces in one single Class.

The default implementation builds a JDK proxy class for the given interfaces.

Parameters:
interfaces - the interfaces to merge
Returns:
the merged interface as Class
See Also:
Proxy.getProxyClass(java.lang.ClassLoader, java.lang.Class...)

createScriptedObjectBeanDefinition

protected BeanDefinition createScriptedObjectBeanDefinition(BeanDefinition bd,
                                                            String scriptFactoryBeanName,
                                                            ScriptSource scriptSource,
                                                            Class[] interfaces)
Create a bean definition for the scripted object, based on the given script definition, extracting the definition data that is relevant for the scripted object (that is, everything but bean class and constructor arguments).

Parameters:
bd - the full script bean definition
scriptFactoryBeanName - the name of the internal ScriptFactory bean
scriptSource - the ScriptSource for the scripted bean
interfaces - the interfaces that the scripted bean is supposed to implement
Returns:
the extracted ScriptFactory bean definition
See Also:
ScriptFactory.getScriptedObject(org.springframework.scripting.ScriptSource, java.lang.Class[])

createRefreshableProxy

protected Object createRefreshableProxy(TargetSource ts,
                                        Class[] interfaces)
Create a refreshable proxy for the given AOP TargetSource.

Parameters:
ts - the refreshable TargetSource
interfaces - the proxy interfaces (may be null to indicate proxying of all interfaces implemented by the target class)
Returns:
the generated proxy
See Also:
RefreshableScriptTargetSource

destroy

public void destroy()
Destroy the inner bean factory (used for scripts) on shutdown.

Specified by:
destroy in interface DisposableBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StaticScriptSource

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.scripting.support
Class StaticScriptSource

java.lang.Object
    extended by  org.springframework.scripting.support.StaticScriptSource
All Implemented Interfaces:
ScriptSource
public class StaticScriptSource
extends Object
implements ScriptSource

Static implementation of the ScriptSource interface, encapsulating a given String that contains the script source text. Supports programmatic updates of the script String.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller

Constructor Summary
StaticScriptSource(String script)
Create a new StaticScriptSource for the given script.
StaticScriptSource(String script, String className)
Create a new StaticScriptSource for the given script.
Method Summary
 String getScriptAsString()
Retrieve the current script source text as String.
 boolean isModified()
Indicate whether the underlying script data has been modified since the last time ScriptSource.getScriptAsString() was called.
 void setScript(String script)
Set a fresh script String, overriding the previous script.
 String suggestedClassName()
Determine a class name for the underlying script.
 String toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

StaticScriptSource

public StaticScriptSource(String script)
Create a new StaticScriptSource for the given script.

Parameters:
script - the script String

StaticScriptSource

public StaticScriptSource(String script,
                          String className)
Create a new StaticScriptSource for the given script.

Parameters:
script - the script String
className - the suggested class name for the script (may be null)
Method Detail

setScript

public void setScript(String script)
Set a fresh script String, overriding the previous script.

Parameters:
script - the script String

getScriptAsString

public String getScriptAsString()
Description copied from interface: ScriptSource
Retrieve the current script source text as String.

Specified by:
getScriptAsString in interface ScriptSource
Returns:
the script text

isModified

public boolean isModified()
Description copied from interface: ScriptSource
Indicate whether the underlying script data has been modified since the last time ScriptSource.getScriptAsString() was called. Returns true if the script has not been read yet.

Specified by:
isModified in interface ScriptSource
Returns:
whether the script data has been modified

suggestedClassName

public String suggestedClassName()
Description copied from interface: ScriptSource
Determine a class name for the underlying script.

Specified by:
suggestedClassName in interface ScriptSource
Returns:
the suggested class name, or null if none available

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.stereotype

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.stereotype

Annotations denoting the roles of types or methods in the overall architecture (at a conceptual, rather than implementation, level).

See:
Description

Annotation Types Summary
Component | Indicates that an annotated class is a "component".
Controller | Indicates that an annotated class is a "Controller" (e.g.
Repository | Indicates that an annotated class is a "Repository" (or "DAO").
Service | Indicates that an annotated class is a "Service" (e.g.

Package org.springframework.stereotype Description

Annotations denoting the roles of types or methods in the overall architecture (at a conceptual, rather than implementation, level).

Intended for use by tools and aspects (making an ideal target for pointcuts).


org.springframework.stereotype Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.stereotype

Package Hierarchies:
All Packages

Annotation Type Hierarchy

  • org.springframework.stereotype.Service (implements java.lang.annotation.Annotation)
  • org.springframework.stereotype.Repository (implements java.lang.annotation.Annotation)
  • org.springframework.stereotype.Controller (implements java.lang.annotation.Annotation)
  • org.springframework.stereotype.Component (implements java.lang.annotation.Annotation)


Component

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

org.springframework.stereotype
Annotation Type Component

@Target(value=TYPE)
@Retention(value=RUNTIME)
@Documented
public @interface Component

Indicates that an annotated class is a "component". Such classes are considered as candidates for auto-detection when using annotation-based configuration and classpath scanning.

Other class-level annotations may be considered as identifying a component as well, typically a special kind of component: e.g. the @Repository annotation or AspectJ's @Aspect annotation.

Since:
2.5
Author:
Mark Fisher
See Also:
Repository, Service, Controller, ClassPathBeanDefinitionScanner

Optional Element Summary
 String value
The value may indicate a suggestion for a logical component name, to be turned into a Spring bean in case of an autodetected component.

value

public abstract String value
The value may indicate a suggestion for a logical component name, to be turned into a Spring bean in case of an autodetected component.

Returns:
the suggested component name, if any
Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT


Controller

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.stereotype
Annotation Type Controller

@Target(value=TYPE)
@Retention(value=RUNTIME)
@Documented
@Component
public @interface Controller

Indicates that an annotated class is a "Controller" (e.g. a web controller).

This annotation serves as a specialization of @Component, allowing for implementation classes to be autodetected through classpath scanning. It is typically used in combination with annotated handler methods based on the RequestMapping annotation.

Since:
2.5
Author:
Arjen Poutsma, Juergen Hoeller
See Also:
Component, RequestMapping, ClassPathBeanDefinitionScanner

Optional Element Summary
 String value
The value may indicate a suggestion for a logical component name, to be turned into a Spring bean in case of an autodetected component.

value

public abstract String value
The value may indicate a suggestion for a logical component name, to be turned into a Spring bean in case of an autodetected component.

Returns:
the suggested component name, if any
Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Repository

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.stereotype
Annotation Type Repository

@Target(value=TYPE)
@Retention(value=RUNTIME)
@Documented
@Component
public @interface Repository

Indicates that an annotated class is a "Repository" (or "DAO").

A class thus annotated is eligible for Spring DataAccessException translation. The annotated class is also clarified as to its role in the overall application architecture for the purpose of tools, aspects, etc.

As of Spring 2.5, this annotation also serves as a specialization of @Component, allowing for implementation classes to be autodetected through classpath scanning.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller
See Also:
Component, ClassPathBeanDefinitionScanner

Optional Element Summary
 String value
The value may indicate a suggestion for a logical component name, to be turned into a Spring bean in case of an autodetected component.

value

public abstract String value
The value may indicate a suggestion for a logical component name, to be turned into a Spring bean in case of an autodetected component.

Returns:
the suggested component name, if any
Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Service

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

org.springframework.stereotype
Annotation Type Service

@Target(value=TYPE)
@Retention(value=RUNTIME)
@Documented
@Component
public @interface Service

Indicates that an annotated class is a "Service" (e.g. a business service facade).

This annotation serves as a specialization of @Component, allowing for implementation classes to be autodetected through classpath scanning.

Since:
2.5
Author:
Juergen Hoeller
See Also:
Component, ClassPathBeanDefinitionScanner

Optional Element Summary
 String value
The value may indicate a suggestion for a logical component name, to be turned into a Spring bean in case of an autodetected component.

value

public abstract String value
The value may indicate a suggestion for a logical component name, to be turned into a Spring bean in case of an autodetected component.

Returns:
the suggested component name, if any
Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT


org.springframework.test

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.test

This package contains the legacy JUnit 3.8 class hierarchy, which as of Spring 3.0 has been deprecated in favor of using the listener-based Spring TestContext Framework.

See:
Description

Class Summary
AbstractDependencyInjectionSpringContextTests | Deprecated. as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)
AbstractSingleSpringContextTests | Deprecated. as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)
AbstractSpringContextTests | Deprecated. as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)
AbstractTransactionalDataSourceSpringContextTests | Deprecated. as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)
AbstractTransactionalSpringContextTests | Deprecated. as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)
AssertThrows | Deprecated. favor use of JUnit 4's @Test(expected=...) support
ConditionalTestCase | Deprecated. as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)

Package org.springframework.test Description

This package contains the legacy JUnit 3.8 class hierarchy, which as of Spring 3.0 has been deprecated in favor of using the listener-based Spring TestContext Framework.


org.springframework.test Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.test

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • junit.framework.Assert
      • junit.framework.TestCase (implements junit.framework.Test)
        • org.springframework.test.ConditionalTestCase
          • org.springframework.test.AbstractSpringContextTests
            • org.springframework.test.AbstractSingleSpringContextTests
              • org.springframework.test.AbstractDependencyInjectionSpringContextTests
                • org.springframework.test.AbstractTransactionalSpringContextTests
                  • org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
    • org.springframework.test.AssertThrows


AbstractDependencyInjectionSpringContextTests

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.test
Class AbstractDependencyInjectionSpringContextTests

java.lang.Object
    extended by  junit.framework.Assert
        extended by  junit.framework.TestCase
            extended by  org.springframework.test.ConditionalTestCase
                extended by  org.springframework.test.AbstractSpringContextTests
                    extended by  org.springframework.test.AbstractSingleSpringContextTests
                        extended by  org.springframework.test.AbstractDependencyInjectionSpringContextTests
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
AbstractTransactionalSpringContextTests
Deprecated. as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)

@Deprecated
public abstract class AbstractDependencyInjectionSpringContextTests
extends AbstractSingleSpringContextTests

Convenient superclass for JUnit 3.8 based tests depending on a Spring context. The test instance itself is populated by Dependency Injection.

Really for integration testing, not unit testing. You should not normally use the Spring container for unit tests: simply populate your POJOs in plain JUnit tests!

This supports two modes of populating the test:

  • Via Setter Dependency Injection. Simply express dependencies on objects in the test fixture, and they will be satisfied by autowiring by type.
  • Via Field Injection. Declare protected variables of the required type which match named beans in the context. This is autowire by name, rather than type. This approach is based on an approach originated by Ara Abrahmian. Setter Dependency Injection is the default: set the populateProtectedVariables property to true in the constructor to switch on Field Injection.

Since:
1.1.1
Author:
Rod Johnson, Rob Harrop, Rick Evans, Sam Brannen
See Also:
AbstractSingleSpringContextTests.setDirty(),
AbstractSingleSpringContextTests.contextKey(),
AbstractSpringContextTests.getContext(java.lang.Object),
AbstractSingleSpringContextTests.getConfigLocations()

Field Summary
static int | AUTOWIRE_BY_NAME Deprecated. Constant that indicates autowiring bean properties by name.
static int | AUTOWIRE_BY_TYPE Deprecated. Constant that indicates autowiring bean properties by type.
static int | AUTOWIRE_NO Deprecated. Constant that indicates no autowiring at all.
Fields inherited from class org.springframework.test.AbstractSingleSpringContextTests
applicationContext
Fields inherited from class org.springframework.test.ConditionalTestCase
logger
Constructor Summary
AbstractDependencyInjectionSpringContextTests()
Deprecated. Default constructor for AbstractDependencyInjectionSpringContextTests.
AbstractDependencyInjectionSpringContextTests(String name)
Deprecated. Constructor for AbstractDependencyInjectionSpringContextTests with a JUnit name.
Method Summary
int | getAutowireMode() Deprecated. Return the autowire mode for test properties set by Dependency Injection.
protected void | injectDependencies() Deprecated. Inject dependencies into 'this' instance (that is, this test instance).
boolean | isDependencyCheck() Deprecated. Return whether or not dependency checking should be performed for test properties set by Dependency Injection.
boolean | isPopulateProtectedVariables() Deprecated. Return whether to populate protected variables of this test case.
protected void | prepareTestInstance() Deprecated. Prepare this test instance, injecting dependencies into its protected fields and its bean properties.
void | setAutowireMode(int autowireMode) Deprecated. Set the autowire mode for test properties set by Dependency Injection.
void | setDependencyCheck(boolean dependencyCheck) Deprecated. Set whether or not dependency checking should be performed for test properties set by Dependency Injection.
void | setPopulateProtectedVariables(boolean populateFields) Deprecated. Set whether to populate protected variables of this test case.
Methods inherited from class org.springframework.test.AbstractSingleSpringContextTests
contextKey, createApplicationContext, createBeanDefinitionReader, customizeBeanFactory, getApplicationContext, getConfigLocations, getConfigPath, getConfigPaths, getLoadCount, loadContext, loadContextLocations, onSetUp, onTearDown, prepareApplicationContext, setDirty, setUp, tearDown
Methods inherited from class org.springframework.test.AbstractSpringContextTests
addContext, contextKeyString, getContext, hasCachedContext, isContextKeyEmpty, setDirty
Methods inherited from class org.springframework.test.ConditionalTestCase
getDisabledTestCount, isDisabledInThisEnvironment, recordDisabled, runBare
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runTest, setName, toString
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

AUTOWIRE_NO

public static final int AUTOWIRE_NO
Deprecated.
Constant that indicates no autowiring at all.

See Also:
setAutowireMode(int), Constant Field Values

AUTOWIRE_BY_NAME

public static final int AUTOWIRE_BY_NAME
Deprecated.
Constant that indicates autowiring bean properties by name.

See Also:
setAutowireMode(int), Constant Field Values

AUTOWIRE_BY_TYPE

public static final int AUTOWIRE_BY_TYPE
Deprecated.
Constant that indicates autowiring bean properties by type.

See Also:
setAutowireMode(int), Constant Field Values
Constructor Detail

AbstractDependencyInjectionSpringContextTests

public AbstractDependencyInjectionSpringContextTests()
Deprecated.
Default constructor for AbstractDependencyInjectionSpringContextTests.

AbstractDependencyInjectionSpringContextTests

public AbstractDependencyInjectionSpringContextTests(String name)
Deprecated.
Constructor for AbstractDependencyInjectionSpringContextTests with a JUnit name.

Parameters:
name - the name of this text fixture
Method Detail

setPopulateProtectedVariables

public final void setPopulateProtectedVariables(boolean populateFields)
Deprecated.
Set whether to populate protected variables of this test case. Default is false.

isPopulateProtectedVariables

public final boolean isPopulateProtectedVariables()
Deprecated.
Return whether to populate protected variables of this test case.

setAutowireMode

public final void setAutowireMode(int autowireMode)
Deprecated.
Set the autowire mode for test properties set by Dependency Injection.

The default is AUTOWIRE_BY_TYPE. Can be set to AUTOWIRE_BY_NAME or AUTOWIRE_NO instead.

See Also:
AUTOWIRE_BY_TYPE, AUTOWIRE_BY_NAME, AUTOWIRE_NO

getAutowireMode

public final int getAutowireMode()
Deprecated.
Return the autowire mode for test properties set by Dependency Injection.

setDependencyCheck

public final void setDependencyCheck(boolean dependencyCheck)
Deprecated.
Set whether or not dependency checking should be performed for test properties set by Dependency Injection.

The default is true, meaning that tests cannot be run unless all properties are populated.

isDependencyCheck

public final boolean isDependencyCheck()
Deprecated.
Return whether or not dependency checking should be performed for test properties set by Dependency Injection.

prepareTestInstance

protected void prepareTestInstance()
                            throws Exception
Deprecated.
Prepare this test instance, injecting dependencies into its protected fields and its bean properties.

Note: if the ApplicationContext for this test instance has not been configured (e.g., is null), dependency injection will naturally not be performed, but an informational message will be written to the log.

Overrides:
prepareTestInstance in class AbstractSingleSpringContextTests
Throws:
Exception - in case of preparation failure
See Also:
injectDependencies()

injectDependencies

protected void injectDependencies()
                           throws Exception
Deprecated.
Inject dependencies into 'this' instance (that is, this test instance).

The default implementation populates protected variables if the appropriate flag is set, else uses autowiring if autowiring is switched on (which it is by default).

Override this method if you need full control over how dependencies are injected into the test instance.

Throws:
Exception - in case of dependency injection failure
IllegalStateException - if the ApplicationContext for this test instance has not been configured
See Also:
populateProtectedVariables()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractSingleSpringContextTests

org.springframework.test
Class AbstractSingleSpringContextTests

java.lang.Object
    extended by  junit.framework.Assert
        extended by  junit.framework.TestCase
            extended by  org.springframework.test.ConditionalTestCase
                extended by  org.springframework.test.AbstractSpringContextTests
                    extended by  org.springframework.test.AbstractSingleSpringContextTests
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
AbstractDependencyInjectionSpringContextTests
Deprecated. as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)

@Deprecated
public abstract class AbstractSingleSpringContextTests
extends AbstractSpringContextTests

Abstract JUnit 3.8 test class that holds and exposes a single Spring ApplicationContext.

This class will cache contexts based on a context key: normally the config locations String array describing the Spring resource descriptors making up the context. Unless the setDirty() method is called by a test, the context will not be reloaded, even across different subclasses of this test. This is particularly beneficial if your context is slow to construct, for example if you are using Hibernate and the time taken to load the mappings is an issue.

For such standard usage, simply override the getConfigLocations() method and provide the desired config files. For alternative configuration options, see getConfigPath() and getConfigPaths().

If you don't want to load a standard context from an array of config locations, you can override the contextKey() method. In conjunction with this you typically need to override the loadContext(Object) method, which by default loads the locations specified in the getConfigLocations() method.

WARNING: When doing integration tests from within Eclipse, only use classpath resource URLs. Else, you may see misleading failures when changing context locations.

Since:
2.0
Author:
Juergen Hoeller, Rod Johnson, Sam Brannen
See Also:
getConfigLocations(), contextKey(), loadContext(Object), getApplicationContext()

Field Summary
protected  ConfigurableApplicationContext applicationContext
Deprecated. Application context this test will run against
Fields inherited from class org.springframework.test.ConditionalTestCase
logger
Constructor Summary
AbstractSingleSpringContextTests()
Deprecated. Default constructor for AbstractSingleSpringContextTests.
AbstractSingleSpringContextTests(String name)
Deprecated. Constructor for AbstractSingleSpringContextTests with a JUnit name.
Method Summary
protected  Object contextKey()
Deprecated. Return a key for this context.
protected  ConfigurableApplicationContext createApplicationContext(String[] locations)
Deprecated. Create a Spring ConfigurableApplicationContext for use by this test.
protected  BeanDefinitionReader createBeanDefinitionReader(GenericApplicationContext context)
Deprecated. Factory method for creating new BeanDefinitionReaders for loading bean definitions into the supplied context.
protected  void customizeBeanFactory(DefaultListableBeanFactory beanFactory)
Deprecated. Customize the internal bean factory of the ApplicationContext used by this test.
 ConfigurableApplicationContext getApplicationContext()
Deprecated. Return the ApplicationContext that this base class manages; may be null.
protected  String[] getConfigLocations()
Deprecated. Subclasses can override this method to return the locations of their config files, unless they override contextKey() and loadContext(Object) instead.
protected  String getConfigPath()
Deprecated. Subclasses can override this method to return a single path to a config file, relative to the concrete test class.
protected  String[] getConfigPaths()
Deprecated. Subclasses can override this method to return paths to their config files, relative to the concrete test class.
 int getLoadCount()
Deprecated. Return the current number of context load attempts.
protected  ConfigurableApplicationContext loadContext(Object key)
Deprecated. This implementation assumes a key of type String array and loads a context from the given locations.
protected  ConfigurableApplicationContext loadContextLocations(String[] locations)
Deprecated. Load a Spring ApplicationContext from the given config locations.
protected  void onSetUp()
Deprecated. Subclasses can override this method in place of the setUp() method, which is final in this class.
protected  void onTearDown()
Deprecated. Subclasses can override this to add custom behavior on teardown.
protected  void prepareApplicationContext(GenericApplicationContext context)
Deprecated. Prepare the GenericApplicationContext used by this test.
protected  void prepareTestInstance()
Deprecated. Prepare this test instance, for example populating its fields.
protected  void setDirty()
Deprecated. Called to say that the "applicationContext" instance variable is dirty and should be reloaded.
protected  void setUp()
Deprecated. This implementation is final.
protected  void tearDown()
Deprecated. This implementation is final.
Methods inherited from class org.springframework.test.AbstractSpringContextTests
addContext, contextKeyString, getContext, hasCachedContext, isContextKeyEmpty, setDirty
Methods inherited from class org.springframework.test.ConditionalTestCase
getDisabledTestCount, isDisabledInThisEnvironment, recordDisabled, runBare
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runTest, setName, toString
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

applicationContext

protected ConfigurableApplicationContext applicationContext
Deprecated.
Application context this test will run against

Constructor Detail

AbstractSingleSpringContextTests

public AbstractSingleSpringContextTests()
Deprecated.
Default constructor for AbstractSingleSpringContextTests.

AbstractSingleSpringContextTests

public AbstractSingleSpringContextTests(String name)
Deprecated.
Constructor for AbstractSingleSpringContextTests with a JUnit name.

Parameters:
name - the name of this text fixture
Method Detail

setUp

protected final void setUp()
                    throws Exception
Deprecated.
This implementation is final. Override onSetUp for custom behavior.

Overrides:
setUp in class junit.framework.TestCase
Throws:
Exception
See Also:
onSetUp()

prepareTestInstance

protected void prepareTestInstance()
                            throws Exception
Deprecated.
Prepare this test instance, for example populating its fields. The context has already been loaded at the time of this callback.

The default implementation does nothing.

Throws:
Exception - in case of preparation failure

onSetUp

protected void onSetUp()
                throws Exception
Deprecated.
Subclasses can override this method in place of the setUp() method, which is final in this class.

The default implementation does nothing.

Throws:
Exception - simply let any exception propagate

setDirty

protected void setDirty()
Deprecated.
Called to say that the "applicationContext" instance variable is dirty and should be reloaded. We need to do this if a test has modified the context (for example, by replacing a bean definition).

tearDown

protected final void tearDown()
                       throws Exception
Deprecated.
This implementation is final. Override onTearDown for custom behavior.

Overrides:
tearDown in class junit.framework.TestCase
Throws:
Exception
See Also:
onTearDown()

onTearDown

protected void onTearDown()
                   throws Exception
Deprecated.
Subclasses can override this to add custom behavior on teardown.

Throws:
Exception - simply let any exception propagate

contextKey

protected Object contextKey()
Deprecated.
Return a key for this context. Default is the config location array as determined by getConfigLocations().

If you override this method, you will typically have to override loadContext(Object) as well, being able to handle the key type that this method returns.

Returns:
the context key
See Also:
getConfigLocations()

loadContext

protected ConfigurableApplicationContext loadContext(Object key)
                                              throws Exception
Deprecated.
This implementation assumes a key of type String array and loads a context from the given locations.

If you override contextKey(), you will typically have to override this method as well, being able to handle the key type that contextKey() returns.

Specified by:
loadContext in class AbstractSpringContextTests
Parameters:
key - the context key
Returns:
the corresponding ApplicationContext instance (new)
Throws:
Exception
See Also:
getConfigLocations()

loadContextLocations

protected ConfigurableApplicationContext loadContextLocations(String[] locations)
                                                       throws Exception
Deprecated.
Load a Spring ApplicationContext from the given config locations.

The default implementation creates a standard GenericApplicationContext, allowing for customizing the internal bean factory through customizeBeanFactory(org.springframework.beans.factory.support.DefaultListableBeanFactory).

Parameters:
locations - the config locations (as Spring resource locations, e.g. full classpath locations or any kind of URL)
Returns:
the corresponding ApplicationContext instance (potentially cached)
Throws:
Exception - if context loading failed
See Also:
createApplicationContext(String[])

createApplicationContext

protected ConfigurableApplicationContext createApplicationContext(String[] locations)
Deprecated.
Create a Spring ConfigurableApplicationContext for use by this test.

The default implementation creates a standard GenericApplicationContext instance, calls the prepareApplicationContext(org.springframework.context.support.GenericApplicationContext) prepareApplicationContext} method and the customizeBeanFactory method to allow for customizing the context and its DefaultListableBeanFactory, populates the context from the specified config locations through the configured BeanDefinitionReader, and finally refreshes the context.

Parameters:
locations - the config locations (as Spring resource locations, e.g. full classpath locations or any kind of URL)
Returns:
the GenericApplicationContext instance
See Also:
loadContextLocations(String[]), customizeBeanFactory(DefaultListableBeanFactory), createBeanDefinitionReader(GenericApplicationContext)

prepareApplicationContext

protected void prepareApplicationContext(GenericApplicationContext context)
Deprecated.
Prepare the GenericApplicationContext used by this test. Called before bean definitions are read.

The default implementation is empty. Can be overridden in subclasses to customize GenericApplicationContext's standard settings.

Parameters:
context - the context for which the BeanDefinitionReader should be created
See Also:
createApplicationContext(java.lang.String[]),
GenericApplicationContext.setResourceLoader(org.springframework.core.io.ResourceLoader),
GenericApplicationContext.setId(java.lang.String)

customizeBeanFactory

protected void customizeBeanFactory(DefaultListableBeanFactory beanFactory)
Deprecated.
Customize the internal bean factory of the ApplicationContext used by this test. Called before bean definitions are read.

The default implementation is empty. Can be overridden in subclasses to customize DefaultListableBeanFactory's standard settings.

Parameters:
beanFactory - the newly created bean factory for this context
See Also:
loadContextLocations(java.lang.String[]),
createApplicationContext(java.lang.String[]),
DefaultListableBeanFactory.setAllowBeanDefinitionOverriding(boolean),
DefaultListableBeanFactory.setAllowEagerClassLoading(boolean),
AbstractAutowireCapableBeanFactory.setAllowCircularReferences(boolean),
AbstractAutowireCapableBeanFactory.setAllowRawInjectionDespiteWrapping(boolean)

createBeanDefinitionReader

protected BeanDefinitionReader createBeanDefinitionReader(GenericApplicationContext context)
Deprecated.
Factory method for creating new BeanDefinitionReaders for loading bean definitions into the supplied context.

The default implementation creates a new XmlBeanDefinitionReader. Can be overridden in subclasses to provide a different BeanDefinitionReader implementation.

Parameters:
context - the context for which the BeanDefinitionReader should be created
Returns:
a BeanDefinitionReader for the supplied context
See Also:
createApplicationContext(String[]), BeanDefinitionReader, XmlBeanDefinitionReader

getConfigLocations

protected String[] getConfigLocations()
Deprecated.
Subclasses can override this method to return the locations of their config files, unless they override contextKey() and loadContext(Object) instead.

A plain path will be treated as class path location, e.g.: "org/springframework/whatever/foo.xml". Note however that you may prefix path locations with standard Spring resource prefixes. Therefore, a config location path prefixed with "classpath:" with behave the same as a plain path, but a config location such as "file:/some/path/path/location/appContext.xml" will be treated as a filesystem location.

The default implementation builds config locations for the config paths specified through getConfigPaths().

Returns:
an array of config locations
See Also:
getConfigPaths(), ResourceLoader.getResource(String)

getConfigPaths

protected String[] getConfigPaths()
Deprecated.
Subclasses can override this method to return paths to their config files, relative to the concrete test class.

A plain path, e.g. "context.xml", will be loaded as classpath resource from the same package that the concrete test class is defined in. A path starting with a slash is treated as fully qualified class path location, e.g.: "/org/springframework/whatever/foo.xml".

The default implementation builds an array for the config path specified through getConfigPath().

Returns:
an array of config locations
See Also:
getConfigPath(), Class.getResource(String)

getConfigPath

protected String getConfigPath()
Deprecated.
Subclasses can override this method to return a single path to a config file, relative to the concrete test class.

A plain path, e.g. "context.xml", will be loaded as classpath resource from the same package that the concrete test class is defined in. A path starting with a slash is treated as fully qualified class path location, e.g.: "/org/springframework/whatever/foo.xml".

The default implementation simply returns null.

Returns:
an array of config locations
See Also:
getConfigPath(), Class.getResource(String)

getApplicationContext

public final ConfigurableApplicationContext getApplicationContext()
Deprecated.
Return the ApplicationContext that this base class manages; may be null.

getLoadCount

public final int getLoadCount()
Deprecated.
Return the current number of context load attempts.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractSpringContextTests

org.springframework.test
Class AbstractSpringContextTests

java.lang.Object
    extended by  junit.framework.Assert
        extended by  junit.framework.TestCase
            extended by  org.springframework.test.ConditionalTestCase
                extended by  org.springframework.test.AbstractSpringContextTests
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
AbstractSingleSpringContextTests
Deprecated. as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)

@Deprecated
public abstract class AbstractSpringContextTests
extends ConditionalTestCase

Superclass for JUnit 3.8 test cases using Spring ApplicationContexts.

Maintains a static cache of contexts by key. This has significant performance benefit if initializing the context would take time. While initializing a Spring context itself is very quick, some beans in a context, such as a LocalSessionFactoryBean for working with Hibernate, may take some time to initialize. Hence it often makes sense to do that initializing once.

Any ApplicationContext created by this class will be asked to register a JVM shutdown hook for itself. Unless the context gets closed early, all context instances will be automatically closed on JVM shutdown. This allows for freeing external resources held by beans within the context, e.g. temporary files.

Normally you won't extend this class directly but rather one of its subclasses.

Since:
1.1.1
Author:
Rod Johnson, Juergen Hoeller, Sam Brannen
See Also:
AbstractSingleSpringContextTests, AbstractDependencyInjectionSpringContextTests, AbstractTransactionalSpringContextTests, AbstractTransactionalDataSourceSpringContextTests

Field Summary
Fields inherited from class org.springframework.test.ConditionalTestCase
logger
Constructor Summary
AbstractSpringContextTests()
Deprecated. Default constructor for AbstractSpringContextTests.
AbstractSpringContextTests(String name)
Deprecated. Constructor for AbstractSpringContextTests with a JUnit name.
Method Summary
void | addContext(Object key, ConfigurableApplicationContext context) Deprecated. Explicitly add an ApplicationContext instance under a given key.
protected String | contextKeyString(Object contextKey) Deprecated. Subclasses can override this to return a String representation of their context key for use in caching and logging.
protected ConfigurableApplicationContext | getContext(Object key) Deprecated. Obtain an ApplicationContext for the given key, potentially cached.
protected boolean | hasCachedContext(Object key) Deprecated. Return whether there is a cached context for the given key.
protected boolean | isContextKeyEmpty(Object key) Deprecated. Determine if the supplied context key is empty.
protected abstract ConfigurableApplicationContext | loadContext(Object key) Deprecated. Load a new ApplicationContext for the given key.
protected void | setDirty(Object contextKey) Deprecated. Mark the context with the given key as dirty.
Methods inherited from class org.springframework.test.ConditionalTestCase
getDisabledTestCount, isDisabledInThisEnvironment, recordDisabled, runBare
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runTest, setName, setUp, tearDown, toString
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AbstractSpringContextTests

public AbstractSpringContextTests()
Deprecated.
Default constructor for AbstractSpringContextTests.

AbstractSpringContextTests

public AbstractSpringContextTests(String name)
Deprecated.
Constructor for AbstractSpringContextTests with a JUnit name.

Method Detail

addContext

public final void addContext(Object key,
                             ConfigurableApplicationContext context)
Deprecated.
Explicitly add an ApplicationContext instance under a given key.

This is not meant to be used by subclasses. It is rather exposed for special test suite environments.

Parameters:
key - the context key
context - the ApplicationContext instance

hasCachedContext

protected final boolean hasCachedContext(Object key)
Deprecated.
Return whether there is a cached context for the given key.

Parameters:
key - the context key

isContextKeyEmpty

protected boolean isContextKeyEmpty(Object key)
Deprecated.
Determine if the supplied context key is empty.

By default, null values, empty strings, and zero-length arrays are considered empty.

Parameters:
key - the context key to check
Returns:
true if the supplied context key is empty

getContext

protected final ConfigurableApplicationContext getContext(Object key)
                                                   throws Exception
Deprecated.
Obtain an ApplicationContext for the given key, potentially cached.

Parameters:
key - the context key; may be null.
Returns:
the corresponding ApplicationContext instance (potentially cached), or null if the provided key is empty
Throws:
Exception

setDirty

protected final void setDirty(Object contextKey)
Deprecated.
Mark the context with the given key as dirty. This will cause the cached context to be reloaded before the next test case is executed.

Call this method only if you change the state of a singleton bean, potentially affecting future tests.

contextKeyString

protected String contextKeyString(Object contextKey)
Deprecated.
Subclasses can override this to return a String representation of their context key for use in caching and logging.

Parameters:
contextKey - the context key

loadContext

protected abstract ConfigurableApplicationContext loadContext(Object key)
                                                       throws Exception
Deprecated.
Load a new ApplicationContext for the given key.

To be implemented by subclasses.

Parameters:
key - the context key
Returns:
the corresponding ApplicationContext instance (new)
Throws:
Exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractTransactionalDataSourceSpringContextTests

org.springframework.test
Class AbstractTransactionalDataSourceSpringContextTests

java.lang.Object
    extended by  junit.framework.Assert
        extended by  junit.framework.TestCase
            extended by  org.springframework.test.ConditionalTestCase
                extended by  org.springframework.test.AbstractSpringContextTests
                    extended by  org.springframework.test.AbstractSingleSpringContextTests
                        extended by  org.springframework.test.AbstractDependencyInjectionSpringContextTests
                            extended by  org.springframework.test.AbstractTransactionalSpringContextTests
                                extended by  org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
AbstractAnnotationAwareTransactionalTests
Deprecated. as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)

@Deprecated
public abstract class AbstractTransactionalDataSourceSpringContextTests
extends AbstractTransactionalSpringContextTests

Subclass of AbstractTransactionalSpringContextTests that adds some convenience functionality for JDBC access. Expects a DataSource bean to be defined in the Spring application context.

This class exposes a JdbcTemplate and provides an easy way to delete from the database in a new transaction.

Since:
1.1.1
Author:
Rod Johnson, Juergen Hoeller, Thomas Risberg
See Also:
setDataSource(javax.sql.DataSource), getJdbcTemplate()

Field Summary
protected  JdbcTemplate jdbcTemplate
Deprecated.
Fields inherited from class org.springframework.test.AbstractTransactionalSpringContextTests
transactionDefinition, transactionManager, transactionStatus
Fields inherited from class org.springframework.test.AbstractDependencyInjectionSpringContextTests
AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_NO
Fields inherited from class org.springframework.test.AbstractSingleSpringContextTests
applicationContext
Fields inherited from class org.springframework.test.ConditionalTestCase
logger
Constructor Summary
AbstractTransactionalDataSourceSpringContextTests()
Deprecated. Default constructor for AbstractTransactionalDataSourceSpringContextTests.
AbstractTransactionalDataSourceSpringContextTests(String name)
Deprecated. Constructor for AbstractTransactionalDataSourceSpringContextTests with a JUnit name.
Method Summary
protected int | countRowsInTable(String tableName) Deprecated. Count the rows in the given table
protected void | deleteFromTables(String[] names) Deprecated. Convenient method to delete all rows from these tables.
protected void | executeSqlScript(String sqlResourcePath, boolean continueOnError) Deprecated. Execute the given SQL script.
JdbcTemplate | getJdbcTemplate() Deprecated. Return the JdbcTemplate that this base class manages.
protected void | setComplete() Deprecated. Overridden to prevent the transaction committing if a number of tables have been cleared, as a defensive measure against accidental permanent wiping of a database.
void | setDataSource(DataSource dataSource) Deprecated. Setter: DataSource is provided by Dependency Injection.
void | setSqlScriptEncoding(String sqlScriptEncoding) Deprecated. Specify the encoding for SQL scripts, if different from the platform encoding.
Methods inherited from class org.springframework.test.AbstractTransactionalSpringContextTests
endTransaction, isDefaultRollback, isRollback, onSetUp, onSetUpBeforeTransaction, onSetUpInTransaction, onTearDown, onTearDownAfterTransaction, onTearDownInTransaction, preventTransaction, setDefaultRollback, setTransactionDefinition, setTransactionManager, startNewTransaction
Methods inherited from class org.springframework.test.AbstractDependencyInjectionSpringContextTests
getAutowireMode, injectDependencies, isDependencyCheck, isPopulateProtectedVariables, prepareTestInstance, setAutowireMode, setDependencyCheck, setPopulateProtectedVariables
Methods inherited from class org.springframework.test.AbstractSingleSpringContextTests
contextKey, createApplicationContext, createBeanDefinitionReader, customizeBeanFactory, getApplicationContext, getConfigLocations, getConfigPath, getConfigPaths, getLoadCount, loadContext, loadContextLocations, prepareApplicationContext, setDirty, setUp, tearDown
Methods inherited from class org.springframework.test.AbstractSpringContextTests
addContext, contextKeyString, getContext, hasCachedContext, isContextKeyEmpty, setDirty
Methods inherited from class org.springframework.test.ConditionalTestCase
getDisabledTestCount, isDisabledInThisEnvironment, recordDisabled, runBare
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runTest, setName, toString
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

jdbcTemplate

protected JdbcTemplate jdbcTemplate
Deprecated.
Constructor Detail

AbstractTransactionalDataSourceSpringContextTests

public AbstractTransactionalDataSourceSpringContextTests()
Deprecated.
Default constructor for AbstractTransactionalDataSourceSpringContextTests.

AbstractTransactionalDataSourceSpringContextTests

public AbstractTransactionalDataSourceSpringContextTests(String name)
Deprecated.
Constructor for AbstractTransactionalDataSourceSpringContextTests with a JUnit name.

Method Detail

setDataSource

public void setDataSource(DataSource dataSource)
Deprecated.
Setter: DataSource is provided by Dependency Injection.

getJdbcTemplate

public final JdbcTemplate getJdbcTemplate()
Deprecated.
Return the JdbcTemplate that this base class manages.

setSqlScriptEncoding

public void setSqlScriptEncoding(String sqlScriptEncoding)
Deprecated.
Specify the encoding for SQL scripts, if different from the platform encoding.

See Also:
executeSqlScript(java.lang.String, boolean)

deleteFromTables

protected void deleteFromTables(String[] names)
Deprecated.
Convenient method to delete all rows from these tables. Calling this method will make avoidance of rollback by calling setComplete() impossible.

See Also:
setComplete()

setComplete

protected final void setComplete()
Deprecated.
Overridden to prevent the transaction committing if a number of tables have been cleared, as a defensive measure against accidental permanent wiping of a database.

Overrides:
setComplete in class AbstractTransactionalSpringContextTests
See Also:
AbstractTransactionalSpringContextTests.setComplete()

countRowsInTable

protected int countRowsInTable(String tableName)
Deprecated.
Count the rows in the given table

Parameters:
tableName - table name to count rows in
Returns:
the number of rows in the table

executeSqlScript

protected void executeSqlScript(String sqlResourcePath,
                                boolean continueOnError)
                         throws DataAccessException
Deprecated.
Execute the given SQL script. Will be rolled back by default, according to the fate of the current transaction.

Parameters:
sqlResourcePath - Spring resource path for the SQL script. Should normally be loaded by classpath.

Statements should be delimited with a semicolon. If statements are not delimited with a semicolon then there should be one statement per line. Statements are allowed to span lines only if they are delimited with a semicolon.

Do not use this method to execute DDL if you expect rollback.

continueOnError - whether or not to continue without throwing an exception in the event of an error
Throws:
DataAccessException - if there is an error executing a statement and continueOnError was false
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractTransactionalSpringContextTests

org.springframework.test
Class AbstractTransactionalSpringContextTests

java.lang.Object
    extended by  junit.framework.Assert
        extended by  junit.framework.TestCase
            extended by  org.springframework.test.ConditionalTestCase
                extended by  org.springframework.test.AbstractSpringContextTests
                    extended by  org.springframework.test.AbstractSingleSpringContextTests
                        extended by  org.springframework.test.AbstractDependencyInjectionSpringContextTests
                            extended by  org.springframework.test.AbstractTransactionalSpringContextTests
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
AbstractTransactionalDataSourceSpringContextTests
Deprecated. as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)

@Deprecated
public abstract class AbstractTransactionalSpringContextTests
extends AbstractDependencyInjectionSpringContextTests

Convenient base class for JUnit 3.8 based tests that should occur in a transaction, but normally will roll the transaction back on the completion of each test.

This is useful in a range of circumstances, allowing the following benefits:

  • Ability to delete or insert any data in the database, without affecting other tests
  • Providing a transactional context for any code requiring a transaction
  • Ability to write anything to the database without any need to clean up.

This class is typically very fast, compared to traditional setup/teardown scripts.

If data should be left in the database, call the setComplete() method in each test. The "defaultRollback" property, which defaults to "true", determines whether transactions will complete by default.

It is even possible to end the transaction early; for example, to verify lazy loading behavior of an O/R mapping tool. (This is a valuable away to avoid unexpected errors when testing a web UI, for example.) Simply call the endTransaction() method. Execution will then occur without a transactional context.

The startNewTransaction() method may be called after a call to endTransaction() if you wish to create a new transaction, quite independent of the old transaction. The new transaction's default fate will be to roll back, unless setComplete() is called again during the scope of the new transaction. Any number of transactions may be created and ended in this way. The final transaction will automatically be rolled back when the test case is torn down.

Transactional behavior requires a single bean in the context implementing the PlatformTransactionManager interface. This will be set by the superclass's Dependency Injection mechanism. If using the superclass's Field Injection mechanism, the implementation should be named "transactionManager". This mechanism allows the use of the AbstractDependencyInjectionSpringContextTests superclass even when there is more than one transaction manager in the context.

This base class can also be used without transaction management, if no PlatformTransactionManager bean is found in the context provided. Be careful about using this mode, as it allows the potential to permanently modify data. This mode is available only if dependency checking is turned off in the AbstractDependencyInjectionSpringContextTests superclass. The non-transactional capability is provided to enable use of the same subclass in different environments.

Since:
1.1.1
Author:
Rod Johnson, Juergen Hoeller, Sam Brannen

Field Summary
protected TransactionDefinition | transactionDefinition Deprecated. Transaction definition used by this test class: by default, a plain DefaultTransactionDefinition.
protected PlatformTransactionManager | transactionManager Deprecated. The transaction manager to use
protected TransactionStatus | transactionStatus Deprecated. TransactionStatus for this test.
Fields inherited from class org.springframework.test.AbstractDependencyInjectionSpringContextTests
AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_NO
Fields inherited from class org.springframework.test.AbstractSingleSpringContextTests
applicationContext
Fields inherited from class org.springframework.test.ConditionalTestCase
logger
Constructor Summary
AbstractTransactionalSpringContextTests()
Deprecated. Default constructor for AbstractTransactionalSpringContextTests.
AbstractTransactionalSpringContextTests(String name)
Deprecated. Constructor for AbstractTransactionalSpringContextTests with a JUnit name.
Method Summary
protected  void endTransaction()
Deprecated. Immediately force a commit or rollback of the transaction, according to the complete and rollback flags.
protected  boolean isDefaultRollback()
Deprecated. Get the default rollback flag for this test.
protected  boolean isRollback()
Deprecated. Determines whether or not to rollback transactions for the current test.
protected  void onSetUp()
Deprecated. This implementation creates a transaction before test execution.
protected  void onSetUpBeforeTransaction()
Deprecated. Subclasses can override this method to perform any setup operations, such as populating a database table, before the transaction created by this class.
protected  void onSetUpInTransaction()
Deprecated. Subclasses can override this method to perform any setup operations, such as populating a database table, within the transaction created by this class.
protected  void onTearDown()
Deprecated. This implementation ends the transaction after test execution.
protected  void onTearDownAfterTransaction()
Deprecated. Subclasses can override this method to perform cleanup after a transaction here.
protected  void onTearDownInTransaction()
Deprecated. Subclasses can override this method to run invariant tests here.
protected  void preventTransaction()
Deprecated. Call this method in an overridden ConditionalTestCase.runBare() method to prevent transactional execution.
protected  void setComplete()
Deprecated. Cause the transaction to commit for this test method, even if the test method is configured to rollback.
 void setDefaultRollback(boolean defaultRollback)
Deprecated. Subclasses can set this value in their constructor to change the default, which is always to roll the transaction back.
protected  void setTransactionDefinition(TransactionDefinition customDefinition)
Deprecated. Call this method in an overridden ConditionalTestCase.runBare() method to override the transaction attributes that will be used, so that AbstractSingleSpringContextTests.setUp() and AbstractSingleSpringContextTests.tearDown() behavior is modified.
 void setTransactionManager(PlatformTransactionManager transactionManager)
Deprecated. Specify the transaction manager to use.
protected  void startNewTransaction()
Deprecated. Start a new transaction.
Methods inherited from class org.springframework.test.AbstractDependencyInjectionSpringContextTests
getAutowireMode, injectDependencies, isDependencyCheck, isPopulateProtectedVariables, prepareTestInstance, setAutowireMode, setDependencyCheck, setPopulateProtectedVariables
Methods inherited from class org.springframework.test.AbstractSingleSpringContextTests
contextKey, createApplicationContext, createBeanDefinitionReader, customizeBeanFactory, getApplicationContext, getConfigLocations, getConfigPath, getConfigPaths, getLoadCount, loadContext, loadContextLocations, prepareApplicationContext, setDirty, setUp, tearDown
Methods inherited from class org.springframework.test.AbstractSpringContextTests
addContext, contextKeyString, getContext, hasCachedContext, isContextKeyEmpty, setDirty
Methods inherited from class org.springframework.test.ConditionalTestCase
getDisabledTestCount, isDisabledInThisEnvironment, recordDisabled, runBare
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runTest, setName, toString
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

transactionManager

protected PlatformTransactionManager transactionManager
Deprecated.
The transaction manager to use

transactionDefinition

protected TransactionDefinition transactionDefinition
Deprecated.
Transaction definition used by this test class: by default, a plain DefaultTransactionDefinition. Subclasses can change this to cause different behavior.

transactionStatus

protected TransactionStatus transactionStatus
Deprecated.
TransactionStatus for this test. Typical subclasses won't need to use it.

Constructor Detail

AbstractTransactionalSpringContextTests

public AbstractTransactionalSpringContextTests()
Deprecated.
Default constructor for AbstractTransactionalSpringContextTests.

AbstractTransactionalSpringContextTests

public AbstractTransactionalSpringContextTests(String name)
Deprecated.
Constructor for AbstractTransactionalSpringContextTests with a JUnit name.

Method Detail

setTransactionManager

public void setTransactionManager(PlatformTransactionManager transactionManager)
Deprecated.
Specify the transaction manager to use. No transaction management will be available if this is not set. Populated through dependency injection by the superclass.

This mode works only if dependency checking is turned off in the AbstractDependencyInjectionSpringContextTests superclass.

setDefaultRollback

public void setDefaultRollback(boolean defaultRollback)
Deprecated.
Subclasses can set this value in their constructor to change the default, which is always to roll the transaction back.

isDefaultRollback

protected boolean isDefaultRollback()
Deprecated.
Get the default rollback flag for this test.

Returns:
The default rollback flag.
See Also:
setDefaultRollback(boolean)

isRollback

protected boolean isRollback()
Deprecated.
Determines whether or not to rollback transactions for the current test.

The default implementation delegates to isDefaultRollback(). Subclasses can override as necessary.

preventTransaction

protected void preventTransaction()
Deprecated.
Call this method in an overridden ConditionalTestCase.runBare() method to prevent transactional execution.

setTransactionDefinition

protected void setTransactionDefinition(TransactionDefinition customDefinition)
Deprecated.
Call this method in an overridden ConditionalTestCase.runBare() method to override the transaction attributes that will be used, so that AbstractSingleSpringContextTests.setUp() and AbstractSingleSpringContextTests.tearDown() behavior is modified.

Parameters:
customDefinition - the custom transaction definition

onSetUp

protected void onSetUp()
                throws Exception
Deprecated.
This implementation creates a transaction before test execution.

Override onSetUpBeforeTransaction() and/or onSetUpInTransaction() to add custom set-up behavior for transactional execution. Alternatively, override this method for general set-up behavior, calling super.onSetUp() as part of your method implementation.

Overrides:
onSetUp in class AbstractSingleSpringContextTests
Throws:
Exception - simply let any exception propagate
See Also:
onTearDown()

onSetUpBeforeTransaction

protected void onSetUpBeforeTransaction()
                                 throws Exception
Deprecated.
Subclasses can override this method to perform any setup operations, such as populating a database table, before the transaction created by this class. Only invoked if there is a transaction: that is, if preventTransaction() has not been invoked in an overridden TestCase.runTest() method.

Throws:
Exception - simply let any exception propagate

onSetUpInTransaction

protected void onSetUpInTransaction()
                             throws Exception
Deprecated.
Subclasses can override this method to perform any setup operations, such as populating a database table, within the transaction created by this class.

NB: Not called if there is no transaction management, due to no transaction manager being provided in the context.

If any Throwable is thrown, the transaction that has been started prior to the execution of this method will be ended (or rather an attempt will be made to end it gracefully); The offending Throwable will then be rethrown.

Throws:
Exception - simply let any exception propagate

onTearDown

protected void onTearDown()
                   throws Exception
Deprecated.
This implementation ends the transaction after test execution.

Override onTearDownInTransaction() and/or onTearDownAfterTransaction() to add custom tear-down behavior for transactional execution. Alternatively, override this method for general tear-down behavior, calling super.onTearDown() as part of your method implementation.

Note that onTearDownInTransaction() will only be called if a transaction is still active at the time of the test shutdown. In particular, it will not be called if the transaction has been completed with an explicit endTransaction() call before.

Overrides:
onTearDown in class AbstractSingleSpringContextTests
Throws:
Exception - simply let any exception propagate
See Also:
onSetUp()

onTearDownInTransaction

protected void onTearDownInTransaction()
                                throws Exception
Deprecated.
Subclasses can override this method to run invariant tests here. The transaction is still active at this point, so any changes made in the transaction will still be visible. However, there is no need to clean up the database, as a rollback will follow automatically.

NB: Not called if there is no actual transaction, for example due to no transaction manager being provided in the application context.

Throws:
Exception - simply let any exception propagate

onTearDownAfterTransaction

protected void onTearDownAfterTransaction()
                                   throws Exception
Deprecated.
Subclasses can override this method to perform cleanup after a transaction here. At this point, the transaction is not active anymore.

Throws:
Exception - simply let any exception propagate

setComplete

protected void setComplete()
Deprecated.
Cause the transaction to commit for this test method, even if the test method is configured to rollback.

Throws:
IllegalStateException - if the operation cannot be set to complete as no transaction manager was provided

endTransaction

protected void endTransaction()
Deprecated.
Immediately force a commit or rollback of the transaction, according to the complete and rollback flags.

Can be used to explicitly let the transaction end early, for example to check whether lazy associations of persistent objects work outside of a transaction (that is, have been initialized properly).

See Also:
setComplete()

startNewTransaction

protected void startNewTransaction()
                            throws TransactionException
Deprecated.
Start a new transaction. Only call this method if endTransaction() has been called. setComplete() can be used again in the new transaction. The fate of the new transaction, by default, will be the usual rollback.

Throws:
TransactionException - if starting the transaction failed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AssertThrows

org.springframework.test
Class AssertThrows

java.lang.Object
    extended by  org.springframework.test.AssertThrows
Deprecated. favor use of JUnit 4's @Test(expected=...) support

@Deprecated
public abstract class AssertThrows
extends Object

Simple method object encapsulation of the 'test-for-Exception' scenario (for JUnit).

Used like so:

 // the class under test
 public class Foo {
    public void someBusinessLogic(String name) {
        if (name == null) {
            throw new IllegalArgumentException("The 'name' argument is required");
        }
        // rest of business logic here...
    }
 }
The test for the above bad argument path can be expressed using the AssertThrows class like so:
 public class FooTest {
    public void testSomeBusinessLogicBadArgumentPath() {
        new AssertThrows(IllegalArgumentException.class) {
            public void test() {
                new Foo().someBusinessLogic(null);
            }
        }.runTest();
    }
 }
This will result in the test passing if the Foo.someBusinessLogic(..) method threw an IllegalArgumentException; if it did not, the test would fail with the following message:
 "Must have thrown a [class java.lang.IllegalArgumentException]"
If the wrong type of Exception was thrown, the test will also fail, this time with a message similar to the following:
 "junit.framework.AssertionFailedError: Was expecting a [class java.lang.UnsupportedOperationException] to be thrown, but instead a [class java.lang.IllegalArgumentException] was thrown"
The test for the correct Exception respects polymorphism, so you can test that any old Exception is thrown like so:
 public class FooTest {
    public void testSomeBusinessLogicBadArgumentPath() {
        // any Exception will do...
        new AssertThrows(Exception.class) {
            public void test() {
                new Foo().someBusinessLogic(null);
            }
        }.runTest();
    }
 }
Intended for use with JUnit 4 and TestNG (as of Spring 3.0). You might want to compare this class with the junit.extensions.ExceptionTestCase class.

Since:
2.0
Author:
Rick Evans, Juergen Hoeller

Constructor Summary
AssertThrows(Class expectedException)
Deprecated. Create a new instance of the AssertThrows class.
AssertThrows(Class expectedException, String failureMessage)
Deprecated. Create a new instance of the AssertThrows class.
Method Summary
protected  void checkExceptionExpectations(Exception actualException)
Deprecated. Does the donkey work of checking (verifying) that the Exception that was thrown in the body of a test is an instance of the getExpectedException() class (or an instance of a subclass).
protected  String createMessageForNoExceptionThrown()
Deprecated. Creates the failure message used if the test fails (i.e.
protected  String createMessageForWrongThrownExceptionType(Exception actualException)
Deprecated. Creates the failure message used if the wrong type of Exception is thrown in the body of the test.
protected  void doFail()
Deprecated. Template method called when the test fails; i.e.
 Exception getActualException()
Deprecated. Expose the actual exception thrown from test(), if any.
protected  Class getExpectedException()
Deprecated. Return the Exception expected to be thrown during the execution of the surrounding test.
protected  String getFailureMessage()
Deprecated. Return the extra, contextual failure message that will be included in the failure text if the text fails.
 void runTest()
Deprecated. The main template method that drives the running of the test logic and the checking of the resulting (expected) Exception.
 void setFailureMessage(String failureMessage)
Deprecated. Set the extra, contextual failure message that will be included in the failure text if the text fails.
abstract  void test()
Deprecated. Subclass must override this abstract method and provide the test logic.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AssertThrows

public AssertThrows(Class expectedException)
Deprecated.
Create a new instance of the AssertThrows class.

Parameters:
expectedException - the Exception expected to be thrown during the execution of the surrounding test
Throws:
IllegalArgumentException - if the supplied expectedException is null; or if said argument is not an Exception-derived class

AssertThrows

public AssertThrows(Class expectedException,
                    String failureMessage)
Deprecated.
Create a new instance of the AssertThrows class.

Parameters:
expectedException - the Exception expected to be thrown during the execution of the surrounding test
failureMessage - the extra, contextual failure message that will be included in the failure text if the text fails (can be null)
Throws:
IllegalArgumentException - if the supplied expectedException is null; or if said argument is not an Exception-derived class
Method Detail

getExpectedException

protected Class getExpectedException()
Deprecated.
Return the Exception expected to be thrown during the execution of the surrounding test.

setFailureMessage

public void setFailureMessage(String failureMessage)
Deprecated.
Set the extra, contextual failure message that will be included in the failure text if the text fails.

getFailureMessage

protected String getFailureMessage()
Deprecated.
Return the extra, contextual failure message that will be included in the failure text if the text fails.

test

public abstract void test()
                   throws Exception
Deprecated.
Subclass must override this abstract method and provide the test logic.

Throws:
Exception - if an error occurs during the execution of the aformentioned test logic

runTest

public void runTest()
Deprecated.
The main template method that drives the running of the test logic and the checking of the resulting (expected) Exception.

See Also:
test(),
doFail(),
checkExceptionExpectations(Exception)

doFail

protected void doFail()
Deprecated.
Template method called when the test fails; i.e. the expected Exception is not thrown.

The default implementation simply fails the test via a call to Assert.fail(String).

If you want to customise the failure message, consider overriding createMessageForNoExceptionThrown(), and / or supplying an extra, contextual failure message via the appropriate constructor overload.

See Also:
getFailureMessage()

createMessageForNoExceptionThrown

protected String createMessageForNoExceptionThrown()
Deprecated.
Creates the failure message used if the test fails (i.e. the expected exception is not thrown in the body of the test).

Returns:
the failure message used if the test fails
See Also:
getFailureMessage()

checkExceptionExpectations

protected void checkExceptionExpectations(Exception actualException)
Deprecated.
Does the donkey work of checking (verifying) that the Exception that was thrown in the body of a test is an instance of the getExpectedException() class (or an instance of a subclass).

If you want to customise the failure message, consider overriding createMessageForWrongThrownExceptionType(Exception).

Parameters:
actualException - the Exception that has been thrown in the body of a test method (will never be null)

createMessageForWrongThrownExceptionType

protected String createMessageForWrongThrownExceptionType(Exception actualException)
Deprecated.
Creates the failure message used if the wrong type of Exception is thrown in the body of the test.

Parameters:
actualException - the actual exception thrown
Returns:
the message for the given exception

getActualException

public final Exception getActualException()
Deprecated.
Expose the actual exception thrown from test(), if any.

Returns:
the actual exception, or null if none
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConditionalTestCase

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.test
Class ConditionalTestCase

java.lang.Object
    extended by  junit.framework.Assert
        extended by  junit.framework.TestCase
            extended by  org.springframework.test.ConditionalTestCase
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
AbstractSpringContextTests
Deprecated. as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)

@Deprecated
public abstract class ConditionalTestCase
extends junit.framework.TestCase

Superclass for JUnit 3.8 based tests that allows conditional test execution at the individual test method level. The isDisabledInThisEnvironment() method is invoked before the execution of each test method. Subclasses can override that method to return whether or not the given test should be executed. Note that the tests will still appear to have executed and passed; however, log output will show that the test was not executed.

Since:
2.0
Author:
Rod Johnson
See Also:
isDisabledInThisEnvironment(java.lang.String)

Field Summary
protected  Log logger
Deprecated. Logger available to subclasses
Constructor Summary
ConditionalTestCase()
Deprecated. Default constructor for ConditionalTestCase.
ConditionalTestCase(String name)
Deprecated. Constructor for ConditionalTestCase with a JUnit name.
Method Summary
static int | getDisabledTestCount() Deprecated. Return the number of tests disabled in this environment.
protected boolean | isDisabledInThisEnvironment(String testMethodName) Deprecated. Should this test run?
protected int | recordDisabled() Deprecated. Record a disabled test.
void | runBare() Deprecated.
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runTest, setName, setUp, tearDown, toString
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

logger

protected final Log logger
Deprecated.
Logger available to subclasses

Constructor Detail

ConditionalTestCase

public ConditionalTestCase()
Deprecated.
Default constructor for ConditionalTestCase.

ConditionalTestCase

public ConditionalTestCase(String name)
Deprecated.
Constructor for ConditionalTestCase with a JUnit name.

Method Detail

getDisabledTestCount

public static int getDisabledTestCount()
Deprecated.
Return the number of tests disabled in this environment.

runBare

public void runBare()
             throws Throwable
Deprecated.
Overrides:
runBare in class junit.framework.TestCase
Throws:
Throwable

isDisabledInThisEnvironment

protected boolean isDisabledInThisEnvironment(String testMethodName)
Deprecated.
Should this test run?

Parameters:
testMethodName - name of the test method
Returns:
whether the test should execute in the current environment

recordDisabled

protected int recordDisabled()
Deprecated.
Record a disabled test.

Returns:
the current disabled test count
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.test.annotation

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.test.annotation

Support classes for annotation-driven tests.

See:
Description

Interface Summary
ProfileValueSource Strategy interface for retrieving profile values for a given testing environment.

Class Summary
AbstractAnnotationAwareTransactionalTests | Deprecated. as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)
ProfileValueUtils | General utility methods for working with profile values.
SystemProfileValueSource | Implementation of ProfileValueSource which uses system properties as the underlying source.

Enum Summary
DirtiesContext.ClassMode Defines modes which determine how @DirtiesContext is interpreted when used to annotate a test class.

Annotation Types Summary
DirtiesContext | Test annotation which indicates that the ApplicationContext associated with a test is dirty and should be closed: after the current test, when declared at the method level after each test method in the current test class, when declared at the class level with class mode set to AFTER_EACH_TEST_METHOD after the current test class, when declared at the class level with class mode set to AFTER_CLASS
ExpectedException | Test annotation to indicate that a test method is required to throw the specified exception.
IfProfileValue | Test annotation to indicate that a test is enabled for a specific testing profile or environment.
NotTransactional | Deprecated. as of Spring 3.0, in favor of moving the non-transactional test method to a separate (non-transactional) test class or to a @BeforeTransaction or @AfterTransaction method.
ProfileValueSourceConfiguration | ProfileValueSourceConfiguration is a class-level annotation which is used to specify what type of ProfileValueSource to use when retrieving profile values configured via the @IfProfileValue annotation.
Repeat | Test annotation to indicate that a test method should be invoked repeatedly.
Rollback | Test annotation to indicate whether or not the transaction for the annotated test method should be rolled back after the test method has completed.
Timed | Test-specific annotation to indicate that a test method has to finish execution in a specified time period.

Package org.springframework.test.annotation Description

Support classes for annotation-driven tests.


org.springframework.test.annotation Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.test.annotation

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • junit.framework.Assert
      • junit.framework.TestCase (implements junit.framework.Test)
        • org.springframework.test.ConditionalTestCase
          • org.springframework.test.AbstractSpringContextTests
            • org.springframework.test.AbstractSingleSpringContextTests
              • org.springframework.test.AbstractDependencyInjectionSpringContextTests
                • org.springframework.test.AbstractTransactionalSpringContextTests
                  • org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
                    • org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests
    • org.springframework.test.annotation.ProfileValueUtils
    • org.springframework.test.annotation.SystemProfileValueSource (implements org.springframework.test.annotation.ProfileValueSource)

Interface Hierarchy

  • org.springframework.test.annotation.ProfileValueSource

Annotation Type Hierarchy

  • org.springframework.test.annotation.Timed (implements java.lang.annotation.Annotation)
  • org.springframework.test.annotation.Rollback (implements java.lang.annotation.Annotation)
  • org.springframework.test.annotation.Repeat (implements java.lang.annotation.Annotation)
  • org.springframework.test.annotation.ProfileValueSourceConfiguration (implements java.lang.annotation.Annotation)
  • org.springframework.test.annotation.NotTransactional (implements java.lang.annotation.Annotation)
  • org.springframework.test.annotation.IfProfileValue (implements java.lang.annotation.Annotation)
  • org.springframework.test.annotation.ExpectedException (implements java.lang.annotation.Annotation)
  • org.springframework.test.annotation.DirtiesContext (implements java.lang.annotation.Annotation)

Enum Hierarchy

  • java.lang.Object
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)
      • org.springframework.test.annotation.DirtiesContext.ClassMode


ProfileValueSource

org.springframework.test.annotation
Interface ProfileValueSource

All Known Implementing Classes:
SystemProfileValueSource
public interface ProfileValueSource

Strategy interface for retrieving profile values for a given testing environment.

Concrete implementations must provide a public no-args constructor.

Spring provides the following out-of-the-box implementations:

  • SystemProfileValueSource

Since:
2.0
Author:
Rod Johnson, Sam Brannen
See Also:
ProfileValueSourceConfiguration, IfProfileValue, ProfileValueUtils

Method Summary
 String get(String key)
Get the profile value indicated by the specified key.

Method Detail

get

String get(String key)
Get the profile value indicated by the specified key.

Parameters:
key - the name of the profile value
Returns:
the String value of the profile value, or null if there is no profile value with that key
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractAnnotationAwareTransactionalTests

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.test.annotation
Class AbstractAnnotationAwareTransactionalTests

java.lang.Object
    extended by  junit.framework.Assert
        extended by  junit.framework.TestCase
            extended by  org.springframework.test.ConditionalTestCase
                extended by  org.springframework.test.AbstractSpringContextTests
                    extended by  org.springframework.test.AbstractSingleSpringContextTests
                        extended by  org.springframework.test.AbstractDependencyInjectionSpringContextTests
                            extended by  org.springframework.test.AbstractTransactionalSpringContextTests
                                extended by  org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
                                    extended by  org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
AbstractJpaTests
Deprecated. as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)

@Deprecated
public abstract class AbstractAnnotationAwareTransactionalTests
extends AbstractTransactionalDataSourceSpringContextTests

Java 5 specific subclass of AbstractTransactionalDataSourceSpringContextTests, exposing a SimpleJdbcTemplate and obeying annotations for transaction control.

For example, test methods can be annotated with the regular Spring @Transactional annotation (e.g., to force execution in a read-only transaction) or with the @NotTransactional annotation to prevent any transaction being created at all. In addition, individual test methods can be annotated with @Rollback to override the default rollback settings.

The following list constitutes all annotations currently supported by AbstractAnnotationAwareTransactionalTests:

  • @DirtiesContext
  • @ProfileValueSourceConfiguration
  • @IfProfileValue
  • @ExpectedException
  • @Timed
  • @Repeat
  • @Transactional
  • @NotTransactional
  • @Rollback

Since:
2.0
Author:
Rod Johnson, Sam Brannen, Juergen Hoeller

Field Summary
protected ProfileValueSource | profileValueSource Deprecated. ProfileValueSource available to subclasses but primarily intended for use in isDisabledInThisEnvironment(Method).
protected SimpleJdbcTemplate | simpleJdbcTemplate Deprecated.
Fields inherited from class org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
jdbcTemplate
Fields inherited from class org.springframework.test.AbstractTransactionalSpringContextTests
transactionDefinition, transactionManager, transactionStatus
Fields inherited from class org.springframework.test.AbstractDependencyInjectionSpringContextTests
AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_NO
Fields inherited from class org.springframework.test.AbstractSingleSpringContextTests
applicationContext
Fields inherited from class org.springframework.test.ConditionalTestCase
logger
Constructor Summary
AbstractAnnotationAwareTransactionalTests()
Deprecated. Default constructor for AbstractAnnotationAwareTransactionalTests, which delegates to AbstractAnnotationAwareTransactionalTests(String).
AbstractAnnotationAwareTransactionalTests(String name)
Deprecated. Constructs a new AbstractAnnotationAwareTransactionalTests instance with the specified JUnit name and retrieves the configured (or default) ProfileValueSource.
Method Summary
protected void | findUniqueProfileValueSourceFromContext(ApplicationContext applicationContext) Deprecated. Use @ProfileValueSourceConfiguration instead.
protected Method | getTestMethod() Deprecated. Get the current test method.
protected boolean | isDisabledInThisEnvironment(Method testMethod) Deprecated. Determine if the test for the supplied testMethod should run in the current environment.
protected boolean | isRollback() Deprecated. Determine whether or not to rollback transactions for the current test by taking into consideration the default rollback flag and a possible method-level override via the @Rollback annotation.
void | runBare() Deprecated. Overridden to populate transaction definition from annotations.
void | setDataSource(DataSource dataSource) Deprecated. Setter: DataSource is provided by Dependency Injection.
Methods inherited from class org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
countRowsInTable, deleteFromTables, executeSqlScript, getJdbcTemplate, setComplete, setSqlScriptEncoding
Methods inherited from class org.springframework.test.AbstractTransactionalSpringContextTests
endTransaction, isDefaultRollback, onSetUp, onSetUpBeforeTransaction, onSetUpInTransaction, onTearDown, onTearDownAfterTransaction, onTearDownInTransaction, preventTransaction, setDefaultRollback, setTransactionDefinition, setTransactionManager, startNewTransaction
Methods inherited from class org.springframework.test.AbstractDependencyInjectionSpringContextTests
getAutowireMode, injectDependencies, isDependencyCheck, isPopulateProtectedVariables, prepareTestInstance, setAutowireMode, setDependencyCheck, setPopulateProtectedVariables
Methods inherited from class org.springframework.test.AbstractSingleSpringContextTests
contextKey, createApplicationContext, createBeanDefinitionReader, customizeBeanFactory, getApplicationContext, getConfigLocations, getConfigPath, getConfigPaths, getLoadCount, loadContext, loadContextLocations, prepareApplicationContext, setDirty, setUp, tearDown
Methods inherited from class org.springframework.test.AbstractSpringContextTests
addContext, contextKeyString, getContext, hasCachedContext, isContextKeyEmpty, setDirty
Methods inherited from class org.springframework.test.ConditionalTestCase
getDisabledTestCount, isDisabledInThisEnvironment, recordDisabled
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runTest, setName, toString
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

simpleJdbcTemplate

protected SimpleJdbcTemplate simpleJdbcTemplate
Deprecated.

profileValueSource

protected ProfileValueSource profileValueSource
Deprecated.
ProfileValueSource available to subclasses but primarily intended for use in isDisabledInThisEnvironment(Method).

Set to SystemProfileValueSource by default for backwards compatibility; however, the value may be changed in the AbstractAnnotationAwareTransactionalTests(String) constructor.

Constructor Detail

AbstractAnnotationAwareTransactionalTests

public AbstractAnnotationAwareTransactionalTests()
Deprecated.
Default constructor for AbstractAnnotationAwareTransactionalTests, which delegates to AbstractAnnotationAwareTransactionalTests(String).

AbstractAnnotationAwareTransactionalTests

public AbstractAnnotationAwareTransactionalTests(String name)
Deprecated.
Constructs a new AbstractAnnotationAwareTransactionalTests instance with the specified JUnit name and retrieves the configured (or default) ProfileValueSource.

Parameters:
name - the name of the current test
See Also:
ProfileValueUtils.retrieveProfileValueSource(Class)
Method Detail

setDataSource

public void setDataSource(DataSource dataSource)
Deprecated.
Description copied from class: AbstractTransactionalDataSourceSpringContextTests
Setter: DataSource is provided by Dependency Injection.

Overrides:
setDataSource in class AbstractTransactionalDataSourceSpringContextTests

findUniqueProfileValueSourceFromContext

@Deprecated
protected void findUniqueProfileValueSourceFromContext(ApplicationContext applicationContext)
Deprecated. Use @ProfileValueSourceConfiguration instead.

Search for a unique ProfileValueSource in the supplied ApplicationContext. If found, the profileValueSource for this test will be set to the unique ProfileValueSource.

Parameters:
applicationContext - the ApplicationContext in which to search for the ProfileValueSource; may not be null

runBare

public void runBare()
             throws Throwable
Deprecated.
Overridden to populate transaction definition from annotations.

Overrides:
runBare in class ConditionalTestCase
Throws:
Throwable

isDisabledInThisEnvironment

protected boolean isDisabledInThisEnvironment(Method testMethod)
Deprecated.
Determine if the test for the supplied testMethod should run in the current environment.

The default implementation is based on @IfProfileValue semantics.

Parameters:
testMethod - the test method
Returns:
true if the test is disabled in the current environment
See Also:
ProfileValueUtils.isTestEnabledInThisEnvironment(java.lang.Class)

getTestMethod

protected Method getTestMethod()
Deprecated.
Get the current test method.

isRollback

protected boolean isRollback()
Deprecated.
Determine whether or not to rollback transactions for the current test by taking into consideration the default rollback flag and a possible method-level override via the @Rollback annotation.

Overrides:
isRollback in class AbstractTransactionalSpringContextTests
Returns:
the rollback flag for the current test
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ProfileValueUtils

org.springframework.test.annotation
Class ProfileValueUtils

java.lang.Object
    extended by  org.springframework.test.annotation.ProfileValueUtils

public abstract class ProfileValueUtils
extends Object

General utility methods for working with profile values.

Since:
2.5
Author:
Sam Brannen, Juergen Hoeller
See Also:
ProfileValueSource, ProfileValueSourceConfiguration, IfProfileValue

Constructor Summary
ProfileValueUtils()
Method Summary
static boolean | isTestEnabledInThisEnvironment(Class<?> testClass) Determine if the supplied testClass is enabled in the current environment, as specified by the @IfProfileValue annotation at the class level.
static boolean | isTestEnabledInThisEnvironment(Method testMethod, Class<?> testClass) Determine if the supplied testMethod is enabled in the current environment, as specified by the @IfProfileValue annotation, which may be declared on the test method itself or at the class level.
static boolean | isTestEnabledInThisEnvironment(ProfileValueSource profileValueSource, Method testMethod, Class<?> testClass) Determine if the supplied testMethod is enabled in the current environment, as specified by the @IfProfileValue annotation, which may be declared on the test method itself or at the class level.
static ProfileValueSource | retrieveProfileValueSource(Class<?> testClass) Retrieves the ProfileValueSource type for the specified test class as configured via the @ProfileValueSourceConfiguration annotation and instantiates a new instance of that type.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ProfileValueUtils

public ProfileValueUtils()
Method Detail

retrieveProfileValueSource

public static ProfileValueSource retrieveProfileValueSource(Class<?> testClass)
Retrieves the ProfileValueSource type for the specified test class as configured via the @ProfileValueSourceConfiguration annotation and instantiates a new instance of that type.

If @ProfileValueSourceConfiguration is not present on the specified class or if a custom ProfileValueSource is not declared, the default SystemProfileValueSource will be returned instead.

Parameters:
testClass - The test class for which the ProfileValueSource should be retrieved
Returns:
the configured (or default) ProfileValueSource for the specified class
See Also:
SystemProfileValueSource

isTestEnabledInThisEnvironment

public static boolean isTestEnabledInThisEnvironment(Class<?> testClass)
Determine if the supplied testClass is enabled in the current environment, as specified by the @IfProfileValue annotation at the class level.

Defaults to true if no @IfProfileValue annotation is declared.

Parameters:
testClass - the test class
Returns:
true if the test is enabled in the current environment

isTestEnabledInThisEnvironment

public static boolean isTestEnabledInThisEnvironment(Method testMethod,
                                                     Class<?> testClass)
Determine if the supplied testMethod is enabled in the current environment, as specified by the @IfProfileValue annotation, which may be declared on the test method itself or at the class level. Class-level usage overrides method-level usage.

Defaults to true if no @IfProfileValue annotation is declared.

Parameters:
testMethod - the test method
testClass - the test class
Returns:
true if the test is enabled in the current environment

isTestEnabledInThisEnvironment

public static boolean isTestEnabledInThisEnvironment(ProfileValueSource profileValueSource,
                                                     Method testMethod,
                                                     Class<?> testClass)
Determine if the supplied testMethod is enabled in the current environment, as specified by the @IfProfileValue annotation, which may be declared on the test method itself or at the class level. Class-level usage overrides method-level usage.

Defaults to true if no @IfProfileValue annotation is declared.

Parameters:
profileValueSource - the ProfileValueSource to use to determine if the test is enabled
testMethod - the test method
testClass - the test class
Returns:
true if the test is enabled in the current environment
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SystemProfileValueSource

org.springframework.test.annotation
Class SystemProfileValueSource

java.lang.Object
    extended by  org.springframework.test.annotation.SystemProfileValueSource
All Implemented Interfaces:
ProfileValueSource
public class SystemProfileValueSource
extends Object
implements ProfileValueSource

Implementation of ProfileValueSource which uses system properties as the underlying source.

Since:
2.0
Author:
Rod Johnson, Sam Brannen

Method Summary
String | get(String key) Get the profile value indicated by the specified key from the system properties.
static SystemProfileValueSource | getInstance() Obtain the canonical instance of this ProfileValueSource.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail

getInstance

public static final SystemProfileValueSource getInstance()
Obtain the canonical instance of this ProfileValueSource.

get

public String get(String key)
Get the profile value indicated by the specified key from the system properties.

Specified by:
get in interface ProfileValueSource
Parameters:
key - the name of the profile value
Returns:
the String value of the profile value, or null if there is no profile value with that key
See Also:
System.getProperty(String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DirtiesContext

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.test.annotation
Annotation Type DirtiesContext

@Documented
@Inherited
@Retention(value=RUNTIME)
@Target(value={TYPE,METHOD})
public @interface DirtiesContext

Test annotation which indicates that the ApplicationContext associated with a test is dirty and should be closed:

  • after the current test, when declared at the method level
  • after each test method in the current test class, when declared at the class level with class mode set to AFTER_EACH_TEST_METHOD
  • after the current test class, when declared at the class level with class mode set to AFTER_CLASS

Use this annotation if a test has modified the context (for example, by replacing a bean definition). Subsequent tests will be supplied a new context.

@DirtiesContext may be used as a class-level and method-level annotation within the same class. In such scenarios, the ApplicationContext will be marked as dirty after any such annotated method as well as after the entire class. If the DirtiesContext.ClassMode is set to AFTER_EACH_TEST_METHOD, the context will be marked dirty after each test method in the class.

Since:
2.0
Author:
Sam Brannen, Rod Johnson

Optional Element Summary
 DirtiesContext.ClassMode classMode
The mode to use when a test class is annotated with @DirtiesContext.

classMode

public abstract DirtiesContext.ClassMode classMode
The mode to use when a test class is annotated with @DirtiesContext.

Defaults to AFTER_CLASS.

Note: Setting the class mode on an annotated test method has no meaning, since the mere presence of the @DirtiesContext annotation on a test method is sufficient.

Default:
org.springframework.test.annotation.DirtiesContext.ClassMode.AFTER_CLASS
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


ExpectedException

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.test.annotation
Annotation Type ExpectedException

@Documented
@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface ExpectedException

Test annotation to indicate that a test method is required to throw the specified exception.

Since:
2.0
Author:
Rod Johnson, Sam Brannen

Required Element Summary
 Class<? extends Throwable> value

Element Detail

value

public abstract Class<? extends Throwable> value
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


IfProfileValue

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.test.annotation
Annotation Type IfProfileValue

@Documented
@Inherited
@Retention(value=RUNTIME)
@Target(value={TYPE,METHOD})
public @interface IfProfileValue

Test annotation to indicate that a test is enabled for a specific testing profile or environment. If the configured ProfileValueSource returns a matching value for the provided name, the test will be enabled.

Note: @IfProfileValue can be applied at the class level, the method level, or both. @IfProfileValue at the class level overrides method-level usage of @IfProfileValue for any methods within that class.

Examples: when using SystemProfileValueSource as the ProfileValueSource implementation, you can configure a test method to run only on Java VMs from Sun Microsystems as follows:

 @IfProfileValue(name = "java.vendor", value = "Sun Microsystems Inc.")
 public void testSomething() {
        // ...
 }

You can alternatively configure @IfProfileValue with OR semantics for multiple values as follows (assuming a ProfileValueSource has been appropriately configured for the "test-groups" name):

 @IfProfileValue(name = "test-groups", values = { "unit-tests", "integration-tests" })
 public void testWhichRunsForUnitOrIntegrationTestGroups() {
        // ...
 }

Since:
2.0
Author:
Rod Johnson, Sam Brannen
See Also:
ProfileValueSource, ProfileValueSourceConfiguration, ProfileValueUtils, AbstractJUnit38SpringContextTests, AbstractJUnit4SpringContextTests, SpringJUnit4ClassRunner

Required Element Summary
 String name
The name of the profile value against which to test.
Optional Element Summary
String | value A single, permissible value of the profile value for the given name.
String[] | values A list of all permissible values of the profile value for the given name.

Element Detail

name

public abstract String name
The name of the profile value against which to test.

value

public abstract String value
A single, permissible value of the profile value for the given name.

Note: Assigning values to both value() and values() will lead to a configuration conflict.

Default:
""

values

public abstract String[] values
A list of all permissible values of the profile value for the given name.

Note: Assigning values to both value() and values() will lead to a configuration conflict.

Default:
{}
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


NotTransactional

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.test.annotation
Annotation Type NotTransactional

Deprecated. as of Spring 3.0, in favor of moving the non-transactional test method to a separate (non-transactional) test class or to a @BeforeTransaction or @AfterTransaction method.

@Documented
@Retention(value=RUNTIME)
@Target(value=METHOD)
@Deprecated
public @interface NotTransactional

Test annotation to indicate that a method is not transactional.

Since:
2.0
Author:
Rod Johnson, Sam Brannen

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


ProfileValueSourceConfiguration

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.test.annotation
Annotation Type ProfileValueSourceConfiguration

@Documented
@Inherited
@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface ProfileValueSourceConfiguration

ProfileValueSourceConfiguration is a class-level annotation which is used to specify what type of ProfileValueSource to use when retrieving profile values configured via the @IfProfileValue annotation.

Since:
2.5
Author:
Sam Brannen
See Also:
ProfileValueSource, IfProfileValue, ProfileValueUtils

Optional Element Summary
 Class<? extends ProfileValueSource> value
The type of ProfileValueSource to use when retrieving profile values.

value

public abstract Class<? extends ProfileValueSource> value

The type of ProfileValueSource to use when retrieving profile values.

See Also:
SystemProfileValueSource
Default:
org.springframework.test.annotation.SystemProfileValueSource.class
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Repeat

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.test.annotation
Annotation Type Repeat

@Documented
@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface Repeat

Test annotation to indicate that a test method should be invoked repeatedly.

Note that the scope of execution to be repeated includes execution of the test method itself as well as any set up or tear down of the test fixture.

Since:
2.0
Author:
Rod Johnson, Sam Brannen

Optional Element Summary
 int value

value

public abstract int value
Default:
1
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Rollback

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.test.annotation
Annotation Type Rollback

@Documented
@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface Rollback

Test annotation to indicate whether or not the transaction for the annotated test method should be rolled back after the test method has completed. If true, the transaction will be rolled back; otherwise, the transaction will be committed.

Since:
2.5
Author:
Sam Brannen

Optional Element Summary
 boolean value
Whether or not the transaction for the annotated method should be rolled back after the method has completed.

value

public abstract boolean value
Whether or not the transaction for the annotated method should be rolled back after the method has completed.

Default:
true
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Timed

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

org.springframework.test.annotation
Annotation Type Timed

@Documented
@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface Timed

Test-specific annotation to indicate that a test method has to finish execution in a specified time period.

If the text execution takes longer than the specified time period, then the test is to be considered failed.

Note that the time period includes execution of the test method itself, any repetitions of the test, and any set up or tear down of the test fixture.

Since:
2.0
Author:
Rod Johnson, Sam Brannen
See Also:
Repeat, AbstractAnnotationAwareTransactionalTests

Required Element Summary
 long millis
The maximum amount of time (in milliseconds) that a test execution can take without being marked as failed due to taking too long.

Element Detail

millis

public abstract long millis
The maximum amount of time (in milliseconds) that a test execution can take without being marked as failed due to taking too long.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT


org.springframework.test.context

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.test.context

This package contains the Spring TestContext Framework which provides annotation-driven unit and integration testing support that is agnostic of the actual testing framework in use.

See:
Description

Interface Summary
ContextLoader | Strategy interface for loading an application context.
TestExecutionListener | TestExecutionListener defines a listener API for reacting to test execution events published by the TestContextManager with which the listener is registered.

Class Summary
TestContext | TestContext encapsulates the context in which a test is executed, agnostic of the actual testing framework in use.
TestContextManager | TestContextManager is the main entry point into the Spring TestContext Framework, which provides support for loading and accessing application contexts, dependency injection of test instances, transactional execution of test methods, etc.

Annotation Types Summary
ContextConfiguration | ContextConfiguration defines class-level metadata which can be used to instruct client code with regard to how to load and configure an ApplicationContext.
TestExecutionListeners | TestExecutionListeners defines class-level metadata for configuring which TestExecutionListeners should be registered with a TestContextManager.

Package org.springframework.test.context Description

This package contains the Spring TestContext Framework which provides annotation-driven unit and integration testing support that is agnostic of the actual testing framework in use. The same techniques and annotation-based configuration used in, for example, a JUnit 3.8 environment can also be applied to tests written with JUnit 4.5+, TestNG, etc.

In addition to providing generic and extensible testing infrastructure, the Spring TestContext Framework provides out-of-the-box support for Spring-specific integration testing functionality such as context management and caching, dependency injection of test fixtures, and transactional test management with default rollback semantics.


org.springframework.test.context Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.test.context

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.core.AttributeAccessorSupport (implements org.springframework.core.AttributeAccessor, java.io.Serializable)
      • org.springframework.test.context.TestContext
    • org.springframework.test.context.TestContextManager

Interface Hierarchy

  • org.springframework.test.context.ContextLoader
  • org.springframework.test.context.TestExecutionListener

Annotation Type Hierarchy

  • org.springframework.test.context.TestExecutionListeners (implements java.lang.annotation.Annotation)
  • org.springframework.test.context.ContextConfiguration (implements java.lang.annotation.Annotation)


ContextLoader

org.springframework.test.context
Interface ContextLoader

All Known Implementing Classes:
AbstractContextLoader, AbstractGenericContextLoader, GenericPropertiesContextLoader, GenericXmlContextLoader
public interface ContextLoader

Strategy interface for loading an application context.

Clients of a ContextLoader should call processLocations() prior to calling loadContext() in case the ContextLoader provides custom support for modifying or generating locations. The results of processLocations() should then be supplied to loadContext().

Concrete implementations must provide a public no-args constructor.

Spring provides the following out-of-the-box implementations:

  • GenericXmlContextLoader
  • GenericPropertiesContextLoader

Since:
2.5
Author:
Sam Brannen, Juergen Hoeller

Method Summary
ApplicationContext | loadContext(String... locations) Loads a new context based on the supplied locations, configures the context, and finally returns the context in fully refreshed state.
String[] | processLocations(Class<?> clazz, String... locations) Processes application context resource locations for a specified class.

Method Detail

processLocations

String[] processLocations(Class<?> clazz,
                          String... locations)
Processes application context resource locations for a specified class.

Concrete implementations may choose to modify the supplied locations, generate new locations, or simply return the supplied locations unchanged.

Parameters:
clazz - the class with which the locations are associated: used to determine how to process the supplied locations
locations - the unmodified locations to use for loading the application context (can be null or empty)
Returns:
an array of application context resource locations

loadContext

ApplicationContext loadContext(String... locations)
                               throws Exception
Loads a new context based on the supplied locations, configures the context, and finally returns the context in fully refreshed state.

Configuration locations are generally considered to be classpath resources by default.

Concrete implementations should register annotation configuration processors with bean factories of application contexts loaded by this ContextLoader. Beans will therefore automatically be candidates for annotation-based dependency injection using @Autowired and @Resource.

Any ApplicationContext loaded by a ContextLoader must register a JVM shutdown hook for itself. Unless the context gets closed early, all context instances will be automatically closed on JVM shutdown. This allows for freeing external resources held by beans within the context, e.g. temporary files.

Parameters:
locations - the resource locations to use to load the application context
Returns:
a new application context
Throws:
Exception - if context loading failed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TestExecutionListener

org.springframework.test.context
Interface TestExecutionListener

All Known Implementing Classes:
AbstractTestExecutionListener, DependencyInjectionTestExecutionListener, DirtiesContextTestExecutionListener, TransactionalTestExecutionListener
public interface TestExecutionListener

TestExecutionListener defines a listener API for reacting to test execution events published by the TestContextManager with which the listener is registered.

Concrete implementations must provide a public no-args constructor, so that listeners can be instantiated transparently by tools and configuration mechanisms.

Spring provides the following out-of-the-box implementations:

  • DependencyInjectionTestExecutionListener
  • DirtiesContextTestExecutionListener
  • TransactionalTestExecutionListener

Since:
2.5
Author:
Sam Brannen, Juergen Hoeller

Method Summary
void | afterTestClass(TestContext testContext) Post-processes a test class after execution of all tests within the class.
void | afterTestMethod(TestContext testContext) Post-processes a test after execution of the test method in the supplied test context, for example by tearing down test fixtures.
void | beforeTestClass(TestContext testContext) Pre-processes a test class before execution of all tests within the class.
void | beforeTestMethod(TestContext testContext) Pre-processes a test before execution of the test method in the supplied test context, for example by setting up test fixtures.
void | prepareTestInstance(TestContext testContext) Prepares the test instance of the supplied test context, for example by injecting dependencies.

Method Detail

beforeTestClass

void beforeTestClass(TestContext testContext)
                     throws Exception
Pre-processes a test class before execution of all tests within the class.

This method should be called immediately before framework-specific before class lifecycle callbacks.

If a given testing framework (e.g., JUnit 3.8) does not support before class lifecycle callbacks, this method will not be called for that framework.

Parameters:
testContext - the test context for the test; never null
Throws:
Exception - allows any exception to propagate

prepareTestInstance

void prepareTestInstance(TestContext testContext)
                         throws Exception
Prepares the test instance of the supplied test context, for example by injecting dependencies.

This method should be called immediately after instantiation of the test instance but prior to any framework-specific lifecycle callbacks.

Parameters:
testContext - the test context for the test; never null
Throws:
Exception - allows any exception to propagate

beforeTestMethod

void beforeTestMethod(TestContext testContext)
                      throws Exception
Pre-processes a test before execution of the test method in the supplied test context, for example by setting up test fixtures.

This method should be called immediately prior to framework-specific before lifecycle callbacks.

Parameters:
testContext - the test context in which the test method will be executed; never null
Throws:
Exception - allows any exception to propagate

afterTestMethod

void afterTestMethod(TestContext testContext)
                     throws Exception
Post-processes a test after execution of the test method in the supplied test context, for example by tearing down test fixtures.

This method should be called immediately after framework-specific after lifecycle callbacks.

Parameters:
testContext - the test context in which the test method was executed; never null
Throws:
Exception - allows any exception to propagate

afterTestClass

void afterTestClass(TestContext testContext)
                    throws Exception
Post-processes a test class after execution of all tests within the class.

This method should be called immediately after framework-specific after class lifecycle callbacks.

If a given testing framework (e.g., JUnit 3.8) does not support after class lifecycle callbacks, this method will not be called for that framework.

Parameters:
testContext - the test context for the test; never null
Throws:
Exception - allows any exception to propagate
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TestContext

org.springframework.test.context
Class TestContext

java.lang.Object
    extended by  org.springframework.core.AttributeAccessorSupport
        extended by  org.springframework.test.context.TestContext
All Implemented Interfaces:
Serializable, AttributeAccessor
public class TestContext
extends AttributeAccessorSupport

TestContext encapsulates the context in which a test is executed, agnostic of the actual testing framework in use.

Since:
2.5
Author:
Sam Brannen, Juergen Hoeller
See Also:
Serialized Form

Method Summary
ApplicationContext | getApplicationContext() Get the application context for this test context, possibly cached.
Class<?> | getTestClass() Get the test class for this test context.
Throwable | getTestException() Get the exception that was thrown during execution of the test method.
Object | getTestInstance() Get the current test instance for this test context.
Method | getTestMethod() Get the current test method for this test context.
void | markApplicationContextDirty() Call this method to signal that the application context associated with this test context is dirty and should be reloaded.
String | toString() Provide a String representation of this test context's state.
Methods inherited from class org.springframework.core.AttributeAccessorSupport
attributeNames, copyAttributesFrom, equals, getAttribute, hasAttribute, hashCode, removeAttribute, setAttribute
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Method Detail

getApplicationContext

public ApplicationContext getApplicationContext()
Get the application context for this test context, possibly cached.

Returns:
the application context
Throws:
IllegalStateException - if an error occurs while retrieving the application context

getTestClass

public final Class<?> getTestClass()
Get the test class for this test context.

Returns:
the test class (never null)

getTestInstance

public final Object getTestInstance()
Get the current test instance for this test context.

Note: this is a mutable property.

Returns:
the current test instance (may be null)
See Also:
updateState(Object,Method,Throwable)

getTestMethod

public final Method getTestMethod()
Get the current test method for this test context.

Note: this is a mutable property.

Returns:
the current test method (may be null)
See Also:
updateState(Object, Method, Throwable)

getTestException

public final Throwable getTestException()
Get the exception that was thrown during execution of the test method.

Note: this is a mutable property.

Returns:
the exception that was thrown, or null if no exception was thrown
See Also:
updateState(Object, Method, Throwable)

markApplicationContextDirty

public void markApplicationContextDirty()
Call this method to signal that the application context associated with this test context is dirty and should be reloaded. Do this if a test has modified the context (for example, by replacing a bean definition).

toString

public String toString()
Provide a String representation of this test context's state.

Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TestContextManager

org.springframework.test.context
Class TestContextManager

java.lang.Object
    extended by  org.springframework.test.context.TestContextManager

public class TestContextManager
extends Object

TestContextManager is the main entry point into the Spring TestContext Framework, which provides support for loading and accessing application contexts, dependency injection of test instances, transactional execution of test methods, etc.

Specifically, a TestContextManager is responsible for managing a single TestContext and signaling events to all registered TestExecutionListeners at well defined test execution points:

  • before test class execution: prior to any before class methods of a particular testing framework (e.g., JUnit 4's @BeforeClass)
  • test instance preparation: immediately following instantiation of the test instance
  • before test method execution: prior to any before methods of a particular testing framework (e.g., JUnit 4's @Before)
  • after test method execution: after any after methods of a particular testing framework (e.g., JUnit 4's @After)
  • after test class execution: after any after class methods of a particular testing framework (e.g., JUnit 4's @AfterClass)

Since:
2.5
Author:
Sam Brannen, Juergen Hoeller
See Also:
TestContext, TestExecutionListeners, ContextConfiguration, TransactionConfiguration

Constructor Summary
TestContextManager(Class<?> testClass)
Delegates to TestContextManager(Class, String) with a value of null for the default ContextLoader class name.
TestContextManager(Class<?> testClass, String defaultContextLoaderClassName)
Constructs a new TestContextManager for the specified test class and automatically registers the TestExecutionListeners configured for the test class via the @TestExecutionListeners annotation.
Method Summary
void | afterTestClass() Hook for post-processing a test class after execution of all tests within the class.
void | afterTestMethod(Object testInstance, Method testMethod, Throwable exception) Hook for post-processing a test after execution of the supplied test method, for example for tearing down test fixtures, ending a transaction, etc.
void | beforeTestClass() Hook for pre-processing a test class before execution of any tests within the class.
void | beforeTestMethod(Object testInstance, Method testMethod) Hook for pre-processing a test before execution of the supplied test method, for example for setting up test fixtures, starting a transaction, etc.
protected Set<Class<? extends TestExecutionListener>> | getDefaultTestExecutionListenerClasses() Determine the default TestExecutionListener classes.
protected TestContext | getTestContext() Returns the TestContext managed by this TestContextManager.
List<TestExecutionListener> | getTestExecutionListeners() Gets an unmodifiable copy of the TestExecutionListeners registered for this TestContextManager.
void | prepareTestInstance(Object testInstance) Hook for preparing a test instance prior to execution of any individual test methods, for example for injecting dependencies, etc.
void | registerTestExecutionListeners(TestExecutionListener... testExecutionListeners) Register the supplied TestExecutionListeners by appending them to the set of listeners used by this TestContextManager.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TestContextManager

public TestContextManager(Class<?> testClass)
Delegates to TestContextManager(Class, String) with a value of null for the default ContextLoader class name.

TestContextManager

public TestContextManager(Class<?> testClass,
                          String defaultContextLoaderClassName)
Constructs a new TestContextManager for the specified test class and automatically registers the TestExecutionListeners configured for the test class via the @TestExecutionListeners annotation.

Parameters:
testClass - the test class to be managed
defaultContextLoaderClassName - the name of the default ContextLoader class to use (may be null)
See Also:
registerTestExecutionListeners(TestExecutionListener...), retrieveTestExecutionListeners(Class)
Method Detail

getTestContext

protected final TestContext getTestContext()
Returns the TestContext managed by this TestContextManager.

registerTestExecutionListeners

public void registerTestExecutionListeners(TestExecutionListener... testExecutionListeners)
Register the supplied TestExecutionListeners by appending them to the set of listeners used by this TestContextManager.

getTestExecutionListeners

public final List<TestExecutionListener> getTestExecutionListeners()
Gets an unmodifiable copy of the TestExecutionListeners registered for this TestContextManager.

getDefaultTestExecutionListenerClasses

protected Set<Class<? extends TestExecutionListener>> getDefaultTestExecutionListenerClasses()
Determine the default TestExecutionListener classes.

beforeTestClass

public void beforeTestClass()
                     throws Exception
Hook for pre-processing a test class before execution of any tests within the class. Should be called prior to any framework-specific before class methods (e.g., methods annotated with JUnit's @BeforeClass).

An attempt will be made to give each registered TestExecutionListener a chance to pre-process the test class execution. If a listener throws an exception, however, the remaining registered listeners will not be called.

Throws:
Exception - if a registered TestExecutionListener throws an exception
See Also:
getTestExecutionListeners()

prepareTestInstance

public void prepareTestInstance(Object testInstance)
                         throws Exception
Hook for preparing a test instance prior to execution of any individual test methods, for example for injecting dependencies, etc. Should be called immediately after instantiation of the test instance.

The managed TestContext will be updated with the supplied testInstance.

An attempt will be made to give each registered TestExecutionListener a chance to prepare the test instance. If a listener throws an exception, however, the remaining registered listeners will not be called.

Parameters:
testInstance - the test instance to prepare (never null )
Throws:
Exception - if a registered TestExecutionListener throws an exception
See Also:
getTestExecutionListeners()

beforeTestMethod

public void beforeTestMethod(Object testInstance,
                             Method testMethod)
                      throws Exception
Hook for pre-processing a test before execution of the supplied test method, for example for setting up test fixtures, starting a transaction, etc. Should be called prior to any framework-specific before methods (e.g., methods annotated with JUnit's @Before).

The managed TestContext will be updated with the supplied testInstance and testMethod.

An attempt will be made to give each registered TestExecutionListener a chance to pre-process the test method execution. If a listener throws an exception, however, the remaining registered listeners will not be called.

Parameters:
testInstance - the current test instance (never null)
testMethod - the test method which is about to be executed on the test instance
Throws:
Exception - if a registered TestExecutionListener throws an exception
See Also:
getTestExecutionListeners()

afterTestMethod

public void afterTestMethod(Object testInstance,
                            Method testMethod,
                            Throwable exception)
                     throws Exception
Hook for post-processing a test after execution of the supplied test method, for example for tearing down test fixtures, ending a transaction, etc. Should be called after any framework-specific after methods (e.g., methods annotated with JUnit's @After).

The managed TestContext will be updated with the supplied testInstance, testMethod, and exception.

Each registered TestExecutionListener will be given a chance to post-process the test method execution. If a listener throws an exception, the remaining registered listeners will still be called, but the first exception thrown will be tracked and rethrown after all listeners have executed. Note that registered listeners will be executed in the opposite order in which they were registered.

Parameters:
testInstance - the current test instance (never null)
testMethod - the test method which has just been executed on the test instance
exception - the exception that was thrown during execution of the test method or by a TestExecutionListener, or null if none was thrown
Throws:
Exception - if a registered TestExecutionListener throws an exception
See Also:
getTestExecutionListeners()

afterTestClass

public void afterTestClass()
                    throws Exception
Hook for post-processing a test class after execution of all tests within the class. Should be called after any framework-specific after class methods (e.g., methods annotated with JUnit's @AfterClass).

Each registered TestExecutionListener will be given a chance to post-process the test class. If a listener throws an exception, the remaining registered listeners will still be called, but the first exception thrown will be tracked and rethrown after all listeners have executed. Note that registered listeners will be executed in the opposite order in which they were registered.

Throws:
Exception - if a registered TestExecutionListener throws an exception
See Also:
getTestExecutionListeners()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ContextConfiguration

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

org.springframework.test.context
Annotation Type ContextConfiguration

@Documented
@Inherited
@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface ContextConfiguration

ContextConfiguration defines class-level metadata which can be used to instruct client code with regard to how to load and configure an ApplicationContext.

Since:
2.5
Author:
Sam Brannen
See Also:
ContextLoader, ApplicationContext

Optional Element Summary
boolean | inheritLocations Whether or not resource locations from superclasses should be inherited.
Class<? extends ContextLoader> | loader The type of ContextLoader to use for loading an ApplicationContext.
String[] | locations The resource locations to use for loading an ApplicationContext.
String[] | value Alias for locations.

value

public abstract String[] value
Alias for locations.

Since:
3.0
Default:
{}

locations

public abstract String[] locations
The resource locations to use for loading an ApplicationContext.

Check out org.springframework.test.context.support.AbstractContextLoader#modifyLocations)'s javadoc for details on how a location String will be interpreted at runtime, in particular in case of a relative path. Also, check out the documentation on AbstractContextLoader.generateDefaultLocations(java.lang.Class) for details on the default locations that are going to be used if none are specified.

Note that the above-mentioned default rules only apply for a standard AbstractContextLoader subclass such as GenericXmlContextLoader which is the effective default implementation used at runtime.

Default:
{}

inheritLocations

public abstract boolean inheritLocations
Whether or not resource locations from superclasses should be inherited.

The default value is true, which means that an annotated class will inherit the resource locations defined by an annotated superclass. Specifically, the resource locations for an annotated class will be appended to the list of resource locations defined by an annotated superclass. Thus, subclasses have the option of extending the list of resource locations. In the following example, the ApplicationContext for ExtendedTest will be loaded from "base-context.xml" and "extended-context.xml", in that order. Beans defined in "extended-context.xml" may therefore override those defined in "base-context.xml".

 @ContextConfiguration("base-context.xml")
 public class BaseTest {
        // ...
 }

 @ContextConfiguration("extended-context.xml")
 public class ExtendedTest extends BaseTest {
        // ...
 }
If inheritLocations is set to false, the resource locations for the annotated class will shadow and effectively replace any resource locations defined by a superclass.

Default:
true

loader

public abstract Class<? extends ContextLoader> loader
The type of ContextLoader to use for loading an ApplicationContext.

If not specified, the loader will be inherited from the first superclass which is annotated with @ContextConfiguration and specifies an explicit loader. If no class in the hierarchy specifies an explicit loader, a default loader will be used instead.

The default concrete implementation chosen at runtime will be GenericXmlContextLoader. Also check out AbstractContextLoader's javadoc for details on the default behavior there.

Default:
org.springframework.test.context.ContextLoader.class
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT


TestExecutionListeners

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

org.springframework.test.context
Annotation Type TestExecutionListeners

@Documented
@Inherited
@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface TestExecutionListeners

TestExecutionListeners defines class-level metadata for configuring which TestExecutionListeners should be registered with a TestContextManager. Typically, @TestExecutionListeners will be used in conjunction with @ContextConfiguration.

Since:
2.5
Author:
Sam Brannen
See Also:
TestExecutionListener, TestContextManager, ContextConfiguration

Optional Element Summary
boolean | inheritListeners Whether or not TestExecutionListeners from superclasses should be inherited.
Class<? extends TestExecutionListener>[] | listeners The TestExecutionListeners to register with a TestContextManager.
Class<? extends TestExecutionListener>[] | value Alias for listeners.

listeners

public abstract Class<? extends TestExecutionListener>[] listeners

The TestExecutionListeners to register with a TestContextManager.

See Also:
DependencyInjectionTestExecutionListener, DirtiesContextTestExecutionListener, TransactionalTestExecutionListener
Default:
{}

value

public abstract Class<? extends TestExecutionListener>[] value
Alias for listeners.

Default:
{}

inheritListeners

public abstract boolean inheritListeners

Whether or not TestExecutionListeners from superclasses should be inherited.

The default value is true, which means that an annotated class will inherit the listeners defined by an annotated superclass. Specifically, the listeners for an annotated class will be appended to the list of listeners defined by an annotated superclass. Thus, subclasses have the option of extending the list of listeners. In the following example, AbstractBaseTest will be configured with DependencyInjectionTestExecutionListener and DirtiesContextTestExecutionListener; whereas, TransactionalTest will be configured with DependencyInjectionTestExecutionListener, DirtiesContextTestExecutionListener, and TransactionalTestExecutionListener, in that order.

 @TestExecutionListeners({ DependencyInjectionTestExecutionListener.class,
    DirtiesContextTestExecutionListener.class })
 public abstract class AbstractBaseTest {
        // ...
 }

 @TestExecutionListeners(TransactionalTestExecutionListener.class)
 public class TransactionalTest extends AbstractBaseTest {
        // ...
 }

If inheritListeners is set to false, the listeners for the annotated class will shadow and effectively replace any listeners defined by a superclass.

Default:
true
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT


org.springframework.test.context.junit38

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.test.context.junit38

Support classes for ApplicationContext-based and transactional tests run with JUnit 3.8 and the Spring TestContext Framework.

See:
Description

Class Summary
AbstractJUnit38SpringContextTests | Abstract base TestCase which integrates the Spring TestContext Framework and explicit ApplicationContext testing support in a JUnit 3.8 environment.
AbstractTransactionalJUnit38SpringContextTests | Abstract transactional extension of AbstractJUnit38SpringContextTests which adds convenience functionality for JDBC access.

Package org.springframework.test.context.junit38 Description

Support classes for ApplicationContext-based and transactional tests run with JUnit 3.8 and the Spring TestContext Framework.


org.springframework.test.context.junit38 Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.test.context.junit38

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • junit.framework.Assert
      • junit.framework.TestCase (implements junit.framework.Test)
        • org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests (implements org.springframework.context.ApplicationContextAware)
          • org.springframework.test.context.junit38.AbstractTransactionalJUnit38SpringContextTests


AbstractJUnit38SpringContextTests

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.test.context.junit38
Class AbstractJUnit38SpringContextTests

java.lang.Object
    extended by  junit.framework.Assert
        extended by  junit.framework.TestCase
            extended by  org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests
All Implemented Interfaces:
junit.framework.Test, ApplicationContextAware
Direct Known Subclasses:
AbstractTransactionalJUnit38SpringContextTests
@TestExecutionListeners(value={DependencyInjectionTestExecutionListener.class,DirtiesContextTestExecutionListener.class})
public abstract class AbstractJUnit38SpringContextTests
extends junit.framework.TestCase
implements ApplicationContextAware

Abstract base TestCase which integrates the Spring TestContext Framework and explicit ApplicationContext testing support in a JUnit 3.8 environment.

Concrete subclasses:

  • Typically declare a class-level @ContextConfiguration annotation to configure the application context resource locations. If your test does not need to load an application context, you may choose to omit the @ContextConfiguration declaration and configure the appropriate TestExecutionListeners manually.
  • Must declare public constructors which match the signatures of AbstractJUnit38SpringContextTests() and AbstractJUnit38SpringContextTests(String) and delegate to super(); and super(name); respectively.

The following list constitutes all annotations currently supported directly by AbstractJUnit38SpringContextTests. (Note that additional annotations may be supported by various TestExecutionListeners)

  • @DirtiesContext (via the configured DirtiesContextTestExecutionListener; only supported on methods for JUnit 3.8)
  • @ProfileValueSourceConfiguration
  • @IfProfileValue
  • @ExpectedException
  • @Timed
  • @Repeat

JUnit 3.8 does not support before class or after class lifecycle callbacks. The following TestExecutionListener methods are therefore unsupported in a JUnit 3.8 environment:

  • beforeTestClass()
  • afterTestClass()

Since:
2.5
Author:
Sam Brannen, Juergen Hoeller
See Also:
TestContext, TestContextManager, TestExecutionListeners, AbstractTransactionalJUnit38SpringContextTests, AbstractJUnit4SpringContextTests, AbstractTestNGSpringContextTests

Field Summary
protected ApplicationContext | applicationContext The ApplicationContext that was injected into this test instance via setApplicationContext(ApplicationContext).
protected Log | logger Logger available to subclasses.
protected ProfileValueSource | profileValueSource ProfileValueSource available to subclasses but primarily intended for internal use to provide support for @IfProfileValue.
Constructor Summary
AbstractJUnit38SpringContextTests()
Constructs a new AbstractJUnit38SpringContextTests instance; initializes the internal TestContextManager for the current test; and retrieves the configured (or default) ProfileValueSource.
AbstractJUnit38SpringContextTests(String name)
Constructs a new AbstractJUnit38SpringContextTests instance with the supplied name; initializes the internal TestContextManager for the current test; and retrieves the configured (or default) ProfileValueSource.
Method Summary
static int | getDisabledTestCount() Return the number of tests disabled in this environment.
protected void | recordDisabled(Method testMethod) Records the supplied test method as disabled in the current environment by incrementing the total number of disabled tests and logging a debug message.
void | runBare() Runs the Spring TestContext Framework test sequence.
void | setApplicationContext(ApplicationContext applicationContext) Sets the ApplicationContext to be used by this test instance, provided via ApplicationContextAware semantics.
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runTest, setName, setUp, tearDown, toString
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses.

applicationContext

protected ApplicationContext applicationContext
The ApplicationContext that was injected into this test instance via setApplicationContext(ApplicationContext).

profileValueSource

protected final ProfileValueSource profileValueSource
ProfileValueSource available to subclasses but primarily intended for internal use to provide support for @IfProfileValue.

Constructor Detail

AbstractJUnit38SpringContextTests

public AbstractJUnit38SpringContextTests()
Constructs a new AbstractJUnit38SpringContextTests instance; initializes the internal TestContextManager for the current test; and retrieves the configured (or default) ProfileValueSource.

AbstractJUnit38SpringContextTests

public AbstractJUnit38SpringContextTests(String name)
Constructs a new AbstractJUnit38SpringContextTests instance with the supplied name; initializes the internal TestContextManager for the current test; and retrieves the configured (or default) ProfileValueSource.

Parameters:
name - the name of the current test to execute
Method Detail

getDisabledTestCount

public static int getDisabledTestCount()
Return the number of tests disabled in this environment.

setApplicationContext

public final void setApplicationContext(ApplicationContext applicationContext)
Sets the ApplicationContext to be used by this test instance, provided via ApplicationContextAware semantics.

Specified by:
setApplicationContext in interface ApplicationContextAware
Parameters:
applicationContext - the ApplicationContext object to be used by this object
See Also:
BeanInitializationException

runBare

public void runBare()
             throws Throwable
Runs the Spring TestContext Framework test sequence.

In addition to standard TestCase.runBare() semantics, this implementation performs the following:

  • Calls prepareTestInstance(), beforeTestMethod(), and afterTestMethod() on this test's TestContextManager at the appropriate test execution points.
  • Provides support for @IfProfileValue.
  • Provides support for @Repeat.
  • Provides support for @Timed.
  • Provides support for @ExpectedException.

Overrides:
runBare in class junit.framework.TestCase
Throws:
Throwable
See Also:
ProfileValueUtils.isTestEnabledInThisEnvironment(java.lang.Class)

recordDisabled

protected void recordDisabled(Method testMethod)
Records the supplied test method as disabled in the current environment by incrementing the total number of disabled tests and logging a debug message.

Parameters:
testMethod - the test method that is disabled.
See Also:
getDisabledTestCount()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractTransactionalJUnit38SpringContextTests

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.test.context.junit38
Class AbstractTransactionalJUnit38SpringContextTests

java.lang.Object
    extended by  junit.framework.Assert
        extended by  junit.framework.TestCase
            extended by  org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests
                extended by  org.springframework.test.context.junit38.AbstractTransactionalJUnit38SpringContextTests
All Implemented Interfaces:
junit.framework.Test, ApplicationContextAware
@TestExecutionListeners(value=TransactionalTestExecutionListener.class)
@Transactional
public abstract class AbstractTransactionalJUnit38SpringContextTests
extends AbstractJUnit38SpringContextTests

Abstract transactional extension of AbstractJUnit38SpringContextTests which adds convenience functionality for JDBC access. Expects a DataSource bean and a PlatformTransactionManager bean to be defined in the Spring application context.

This class exposes a SimpleJdbcTemplate and provides an easy way to count the number of rows in a table , delete from the database , and execute SQL scripts within a transaction.

Concrete subclasses must fulfill the same requirements outlined in AbstractJUnit38SpringContextTests.

Since:
2.5
Author:
Sam Brannen, Juergen Hoeller
See Also:
AbstractJUnit38SpringContextTests, ContextConfiguration, TestExecutionListeners, TransactionalTestExecutionListener, TransactionConfiguration, Transactional, NotTransactional, Rollback, BeforeTransaction, AfterTransaction, SimpleJdbcTestUtils, AbstractTransactionalJUnit4SpringContextTests, AbstractTransactionalTestNGSpringContextTests

Field Summary
protected  SimpleJdbcTemplate simpleJdbcTemplate
The SimpleJdbcTemplate that this base class manages, available to subclasses.
Fields inherited from class org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests
applicationContext, logger, profileValueSource
Constructor Summary
AbstractTransactionalJUnit38SpringContextTests()
Constructs a new AbstractTransactionalJUnit38SpringContextTests instance.
AbstractTransactionalJUnit38SpringContextTests(String name)
Constructs a new AbstractTransactionalJUnit38SpringContextTests instance with the supplied name.
Method Summary
protected int | countRowsInTable(String tableName) Count the rows in the given table.
protected int | deleteFromTables(String... names) Convenience method for deleting all rows from the specified tables.
protected void | executeSqlScript(String sqlResourcePath, boolean continueOnError) Execute the given SQL script.
void | setDataSource(DataSource dataSource) Set the DataSource, typically provided via Dependency Injection.
void | setSqlScriptEncoding(String sqlScriptEncoding) Specify the encoding for SQL scripts, if different from the platform encoding.
Methods inherited from class org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests
getDisabledTestCount, recordDisabled, runBare, setApplicationContext
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runTest, setName, setUp, tearDown, toString
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

simpleJdbcTemplate

protected SimpleJdbcTemplate simpleJdbcTemplate
The SimpleJdbcTemplate that this base class manages, available to subclasses.

Constructor Detail

AbstractTransactionalJUnit38SpringContextTests

public AbstractTransactionalJUnit38SpringContextTests()
Constructs a new AbstractTransactionalJUnit38SpringContextTests instance.

AbstractTransactionalJUnit38SpringContextTests

public AbstractTransactionalJUnit38SpringContextTests(String name)
Constructs a new AbstractTransactionalJUnit38SpringContextTests instance with the supplied name.

Parameters:
name - the name of the current test to execute
Method Detail

setDataSource

public void setDataSource(DataSource dataSource)
Set the DataSource, typically provided via Dependency Injection.

Parameters:
dataSource - The DataSource to inject

setSqlScriptEncoding

public void setSqlScriptEncoding(String sqlScriptEncoding)
Specify the encoding for SQL scripts, if different from the platform encoding.

See Also:
executeSqlScript(java.lang.String, boolean)

countRowsInTable

protected int countRowsInTable(String tableName)
Count the rows in the given table.

Parameters:
tableName - table name to count rows in
Returns:
the number of rows in the table

deleteFromTables

protected int deleteFromTables(String... names)
Convenience method for deleting all rows from the specified tables. Use with caution outside of a transaction!

Parameters:
names - the names of the tables from which to delete
Returns:
the total number of rows deleted from all specified tables

executeSqlScript

protected void executeSqlScript(String sqlResourcePath,
                                boolean continueOnError)
                         throws DataAccessException
Execute the given SQL script. Use with caution outside of a transaction!

The script will normally be loaded by classpath. There should be one statement per line. Any semicolons will be removed. Do not use this method to execute DDL if you expect rollback.

Parameters:
sqlResourcePath - the Spring resource path for the SQL script
continueOnError - whether or not to continue without throwing an exception in the event of an error
Throws:
DataAccessException - if there is an error executing a statement and continueOnError was false
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.test.context.junit4

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.test.context.junit4

Support classes for ApplicationContext-based and transactional tests run with JUnit 4.5+ and the Spring TestContext Framework.

See:
Description

Class Summary
AbstractJUnit4SpringContextTests | Abstract base test class which integrates the Spring TestContext Framework with explicit ApplicationContext testing support in a JUnit 4.5+ environment.
AbstractTransactionalJUnit4SpringContextTests | Abstract transactional extension of AbstractJUnit4SpringContextTests which adds convenience functionality for JDBC access.
SpringJUnit4ClassRunner | SpringJUnit4ClassRunner is a custom extension of BlockJUnit4ClassRunner which provides functionality of the Spring TestContext Framework to standard JUnit 4.5+ tests by means of the TestContextManager and associated support classes and annotations.

Package org.springframework.test.context.junit4 Description

Support classes for ApplicationContext-based and transactional tests run with JUnit 4.5+ and the Spring TestContext Framework.


org.springframework.test.context.junit4 Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.test.context.junit4

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests (implements org.springframework.context.ApplicationContextAware)
      • org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests
    • org.junit.runner.Runner (implements org.junit.runner.Describable)
      • org.junit.runners.ParentRunner<T> (implements org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Sortable)
        • org.junit.runners.BlockJUnit4ClassRunner
          • org.springframework.test.context.junit4.SpringJUnit4ClassRunner


AbstractJUnit4SpringContextTests

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.test.context.junit4
Class AbstractJUnit4SpringContextTests

java.lang.Object
    extended by  org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests
All Implemented Interfaces:
ApplicationContextAware
Direct Known Subclasses:
AbstractTransactionalJUnit4SpringContextTests
@TestExecutionListeners(value={DependencyInjectionTestExecutionListener.class,DirtiesContextTestExecutionListener.class})
public abstract class AbstractJUnit4SpringContextTests
extends Object
implements ApplicationContextAware

Abstract base test class which integrates the Spring TestContext Framework with explicit ApplicationContext testing support in a JUnit 4.5+ environment.

Concrete subclasses should typically declare a class-level @ContextConfiguration annotation to configure the application context resource locations. If your test does not need to load an application context, you may choose to omit the @ContextConfiguration declaration and to configure the appropriate TestExecutionListeners manually.

Note: this class serves only as a convenience for extension. If you do not wish for your test classes to be tied to a Spring-specific class hierarchy, you may configure your own custom test classes by using SpringJUnit4ClassRunner, @ContextConfiguration, @TestExecutionListeners, etc.

Since:
2.5
Author:
Sam Brannen
See Also:
ContextConfiguration, TestContext, TestContextManager, AbstractTransactionalJUnit4SpringContextTests, AbstractJUnit38SpringContextTests, AbstractTestNGSpringContextTests

Field Summary
protected ApplicationContext | applicationContext The ApplicationContext that was injected into this test instance via setApplicationContext(ApplicationContext).
protected Log | logger Logger available to subclasses.
Constructor Summary
AbstractJUnit4SpringContextTests()
Method Summary
 void setApplicationContext(ApplicationContext applicationContext)
Set the ApplicationContext to be used by this test instance, provided via ApplicationContextAware semantics.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses.

applicationContext

protected ApplicationContext applicationContext
The ApplicationContext that was injected into this test instance via setApplicationContext(ApplicationContext).

Constructor Detail

AbstractJUnit4SpringContextTests

public AbstractJUnit4SpringContextTests()
Method Detail

setApplicationContext

public final void setApplicationContext(ApplicationContext applicationContext)
Set the ApplicationContext to be used by this test instance, provided via ApplicationContextAware semantics.

Specified by:
setApplicationContext in interface ApplicationContextAware
Parameters:
applicationContext - the ApplicationContext object to be used by this object
See Also:
BeanInitializationException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractTransactionalJUnit4SpringContextTests

org.springframework.test.context.junit4
Class AbstractTransactionalJUnit4SpringContextTests

java.lang.Object
    extended by  org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests
        extended by  org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests
All Implemented Interfaces:
ApplicationContextAware
@TestExecutionListeners(value=TransactionalTestExecutionListener.class)
@Transactional
public abstract class AbstractTransactionalJUnit4SpringContextTests
extends AbstractJUnit4SpringContextTests

Abstract transactional extension of AbstractJUnit4SpringContextTests which adds convenience functionality for JDBC access. Expects a DataSource bean and a PlatformTransactionManager bean to be defined in the Spring application context.

This class exposes a SimpleJdbcTemplate and provides an easy way to count the number of rows in a table , delete from the database , and execute SQL scripts within a transaction.

Concrete subclasses must fulfill the same requirements outlined in AbstractJUnit4SpringContextTests.

Note: this class serves only as a convenience for extension. If you do not wish for your test classes to be tied to a Spring-specific class hierarchy, you may configure your own custom test classes by using SpringJUnit4ClassRunner, @ContextConfiguration, @TestExecutionListeners, @Transactional, etc.

Since:
2.5
Author:
Sam Brannen, Juergen Hoeller
See Also:
AbstractJUnit4SpringContextTests, ContextConfiguration, TestExecutionListeners, TransactionalTestExecutionListener, TransactionConfiguration, Transactional, NotTransactional, Rollback, BeforeTransaction, AfterTransaction, SimpleJdbcTestUtils, AbstractTransactionalJUnit38SpringContextTests, AbstractTransactionalTestNGSpringContextTests

Field Summary
protected  SimpleJdbcTemplate simpleJdbcTemplate
The SimpleJdbcTemplate that this base class manages, available to subclasses.
Fields inherited from class org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests
applicationContext, logger
Constructor Summary
AbstractTransactionalJUnit4SpringContextTests()
Method Summary
protected int | countRowsInTable(String tableName) Count the rows in the given table.
protected int | deleteFromTables(String... names) Convenience method for deleting all rows from the specified tables.
protected void | executeSqlScript(String sqlResourcePath, boolean continueOnError) Execute the given SQL script.
void | setDataSource(DataSource dataSource) Set the DataSource, typically provided via Dependency Injection.
void | setSqlScriptEncoding(String sqlScriptEncoding) Specify the encoding for SQL scripts, if different from the platform encoding.
Methods inherited from class org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests
setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

simpleJdbcTemplate

protected SimpleJdbcTemplate simpleJdbcTemplate
The SimpleJdbcTemplate that this base class manages, available to subclasses.

Constructor Detail

AbstractTransactionalJUnit4SpringContextTests

public AbstractTransactionalJUnit4SpringContextTests()
Method Detail

setDataSource

public void setDataSource(DataSource dataSource)
Set the DataSource, typically provided via Dependency Injection.

setSqlScriptEncoding

public void setSqlScriptEncoding(String sqlScriptEncoding)
Specify the encoding for SQL scripts, if different from the platform encoding.

See Also:
executeSqlScript(java.lang.String, boolean)

countRowsInTable

protected int countRowsInTable(String tableName)
Count the rows in the given table.

Parameters:
tableName - table name to count rows in
Returns:
the number of rows in the table

deleteFromTables

protected int deleteFromTables(String... names)
Convenience method for deleting all rows from the specified tables. Use with caution outside of a transaction!

Parameters:
names - the names of the tables from which to delete
Returns:
the total number of rows deleted from all specified tables

executeSqlScript

protected void executeSqlScript(String sqlResourcePath,
                                boolean continueOnError)
                         throws DataAccessException
Execute the given SQL script. Use with caution outside of a transaction!

The script will normally be loaded by classpath. There should be one statement per line. Any semicolons will be removed. Do not use this method to execute DDL if you expect rollback.

Parameters:
sqlResourcePath - the Spring resource path for the SQL script
continueOnError - whether or not to continue without throwing an exception in the event of an error
Throws:
DataAccessException - if there is an error executing a statement and continueOnError was false
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SpringJUnit4ClassRunner

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.test.context.junit4
Class SpringJUnit4ClassRunner

java.lang.Object
    extended by  org.junit.runner.Runner
        extended by  org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
            extended by  org.junit.runners.BlockJUnit4ClassRunner
                extended by  org.springframework.test.context.junit4.SpringJUnit4ClassRunner
All Implemented Interfaces:
Describable, Filterable, Sortable
public class SpringJUnit4ClassRunner
extends BlockJUnit4ClassRunner

SpringJUnit4ClassRunner is a custom extension of BlockJUnit4ClassRunner which provides functionality of the Spring TestContext Framework to standard JUnit 4.5+ tests by means of the TestContextManager and associated support classes and annotations.

The following list constitutes all annotations currently supported directly by SpringJUnit4ClassRunner. (Note that additional annotations may be supported by various TestExecutionListeners)

  • @Test(expected=...)
  • @ExpectedException
  • @Test(timeout=...)
  • @Timed
  • @Repeat
  • @Ignore
  • @ProfileValueSourceConfiguration
  • @IfProfileValue

NOTE: As of Spring 3.0, SpringJUnit4ClassRunner requires JUnit 4.5+.

Since:
2.5
Author:
Sam Brannen, Juergen Hoeller
See Also:
TestContextManager

Constructor Summary
SpringJUnit4ClassRunner(Class<?> clazz)
Constructs a new SpringJUnit4ClassRunner and initializes a TestContextManager to provide Spring testing functionality to standard JUnit tests.
Method Summary
protected  Object createTest()
Delegates to the parent implementation for creating the test instance and then allows the TestContextManager to prepare the test instance before returning it.
protected  TestContextManager createTestContextManager(Class<?> clazz)
Creates a new TestContextManager for the supplied test class and the configured default ContextLoader class name.
protected  String getDefaultContextLoaderClassName(Class<?> clazz)
Get the name of the default ContextLoader class to use for the supplied test class.
 Description getDescription()
Returns a description suitable for an ignored test class if the test is disabled via @IfProfileValue at the class-level, and otherwise delegates to the parent implementation.
protected  Class<? extends Throwable> getExpectedException(org.junit.runners.model.FrameworkMethod frameworkMethod)
Get the exception that the supplied test method is expected to throw.
protected  long getJUnitTimeout(org.junit.runners.model.FrameworkMethod frameworkMethod)
Retrieves the configured JUnit timeout from the @Test annotation on the supplied test method.
protected  long getSpringTimeout(org.junit.runners.model.FrameworkMethod frameworkMethod)
Retrieves the configured Spring-specific timeout from the @Timed annotation on the supplied test method.
protected  TestContextManager getTestContextManager()
Get the TestContextManager associated with this runner.
protected  boolean isTestMethodIgnored(org.junit.runners.model.FrameworkMethod frameworkMethod)
Returns true if @Ignore is present for the supplied test method or if the test method is disabled via @IfProfileValue.
protected  org.junit.runners.model.Statement methodBlock(org.junit.runners.model.FrameworkMethod frameworkMethod)
Augments the default JUnit behavior with potential repeats of the entire execution chain.
protected  org.junit.runners.model.Statement possiblyExpectingExceptions(org.junit.runners.model.FrameworkMethod frameworkMethod, Object testInstance, org.junit.runners.model.Statement next)
Performs the same logic as BlockJUnit4ClassRunner.possiblyExpectingExceptions(FrameworkMethod, Object, Statement) except that the expected exception is retrieved using getExpectedException(FrameworkMethod).
 void run(RunNotifier notifier)
Check whether the test is enabled in the first place.
protected  void runChild(org.junit.runners.model.FrameworkMethod frameworkMethod, RunNotifier notifier)
Performs the same logic as BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier), except that tests are determined to be ignored by isTestMethodIgnored(FrameworkMethod).
protected  org.junit.runners.model.Statement withAfterClasses(org.junit.runners.model.Statement statement)
Wraps the Statement returned by the parent implementation with a RunAfterTestClassCallbacks statement, thus preserving the default functionality but adding support for the Spring TestContext Framework.
protected  org.junit.runners.model.Statement withAfters(org.junit.runners.model.FrameworkMethod frameworkMethod, Object testInstance, org.junit.runners.model.Statement statement)
Wraps the Statement returned by the parent implementation with a RunAfterTestMethodCallbacks statement, thus preserving the default functionality but adding support for the Spring TestContext Framework.
protected  org.junit.runners.model.Statement withBeforeClasses(org.junit.runners.model.Statement statement)
Wraps the Statement returned by the parent implementation with a RunBeforeTestClassCallbacks statement, thus preserving the default functionality but adding support for the Spring TestContext Framework.
protected  org.junit.runners.model.Statement withBefores(org.junit.runners.model.FrameworkMethod frameworkMethod, Object testInstance, org.junit.runners.model.Statement statement)
Wraps the Statement returned by the parent implementation with a RunBeforeTestMethodCallbacks statement, thus preserving the default functionality but adding support for the Spring TestContext Framework.
protected  org.junit.runners.model.Statement withPotentialRepeat(org.junit.runners.model.FrameworkMethod frameworkMethod, Object testInstance, org.junit.runners.model.Statement next)
Supports Spring's @Repeat annotation by returning a SpringRepeat statement initialized with the configured repeat count or 1 if no repeat count is configured.
protected  org.junit.runners.model.Statement withPotentialTimeout(org.junit.runners.model.FrameworkMethod frameworkMethod, Object testInstance, org.junit.runners.model.Statement next)
Supports both Spring's @Timed and JUnit's @Test(timeout=...) annotations, but not both simultaneously.
Methods inherited from class org.junit.runners.BlockJUnit4ClassRunner
collectInitializationErrors, computeTestMethods, describeChild, getChildren, methodInvoker, rules, testName, validateConstructor, validateInstanceMethods, validateOnlyOneConstructor, validateTestMethods, validateZeroArgConstructor
Methods inherited from class org.junit.runners.ParentRunner
childrenInvoker, classBlock, filter, getName, getTestClass, setScheduler, sort, validatePublicVoidNoArgMethods
Methods inherited from class org.junit.runner.Runner
testCount
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SpringJUnit4ClassRunner

public SpringJUnit4ClassRunner(Class<?> clazz)
                        throws org.junit.runners.model.InitializationError
Constructs a new SpringJUnit4ClassRunner and initializes a TestContextManager to provide Spring testing functionality to standard JUnit tests.

Parameters:
clazz - the test class to be run
Throws:
org.junit.runners.model.InitializationError
See Also:
createTestContextManager(Class)
Method Detail

createTestContextManager

protected TestContextManager createTestContextManager(Class<?> clazz)
Creates a new TestContextManager for the supplied test class and the configured default ContextLoader class name. Can be overridden by subclasses.

Parameters:
clazz - the test class to be managed
See Also:
getDefaultContextLoaderClassName(Class)

getTestContextManager

protected final TestContextManager getTestContextManager()
Get the TestContextManager associated with this runner.

getDefaultContextLoaderClassName

protected String getDefaultContextLoaderClassName(Class<?> clazz)
Get the name of the default ContextLoader class to use for the supplied test class. The named class will be used if the test class does not explicitly declare a ContextLoader class via the @ContextConfiguration annotation.

The default implementation returns null, thus implying use of the standard default ContextLoader class name. Can be overridden by subclasses.

Parameters:
clazz - the test class
Returns:
null

getDescription

public Description getDescription()
Returns a description suitable for an ignored test class if the test is disabled via @IfProfileValue at the class-level, and otherwise delegates to the parent implementation.

Specified by:
getDescription in interface Describable
Overrides:
getDescription in class ParentRunner<org.junit.runners.model.FrameworkMethod>
See Also:
ProfileValueUtils.isTestEnabledInThisEnvironment(Class)

run

public void run(RunNotifier notifier)
Check whether the test is enabled in the first place. This prevents classes with a non-matching @IfProfileValue annotation from running altogether, even skipping the execution of prepareTestInstance() TestExecutionListener methods.

Overrides:
run in class ParentRunner<org.junit.runners.model.FrameworkMethod>
See Also:
ProfileValueUtils.isTestEnabledInThisEnvironment(Class), IfProfileValue, TestExecutionListener

withBeforeClasses

protected org.junit.runners.model.Statement withBeforeClasses(org.junit.runners.model.Statement statement)
Wraps the Statement returned by the parent implementation with a RunBeforeTestClassCallbacks statement, thus preserving the default functionality but adding support for the Spring TestContext Framework.

Overrides:
withBeforeClasses in class ParentRunner<org.junit.runners.model.FrameworkMethod>
See Also:
RunBeforeTestClassCallbacks

withAfterClasses

protected org.junit.runners.model.Statement withAfterClasses(org.junit.runners.model.Statement statement)
Wraps the Statement returned by the parent implementation with a RunAfterTestClassCallbacks statement, thus preserving the default functionality but adding support for the Spring TestContext Framework.

Overrides:
withAfterClasses in class ParentRunner<org.junit.runners.model.FrameworkMethod>
See Also:
RunAfterTestClassCallbacks

createTest

protected Object createTest()
                     throws Exception
Delegates to the parent implementation for creating the test instance and then allows the TestContextManager to prepare the test instance before returning it.

Overrides:
createTest in class BlockJUnit4ClassRunner
Throws:
Exception
See Also:
TestContextManager.prepareTestInstance(Object)

runChild

protected void runChild(org.junit.runners.model.FrameworkMethod frameworkMethod,
                        RunNotifier notifier)
Performs the same logic as BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier), except that tests are determined to be ignored by isTestMethodIgnored(FrameworkMethod).

Overrides:
runChild in class BlockJUnit4ClassRunner

methodBlock

protected org.junit.runners.model.Statement methodBlock(org.junit.runners.model.FrameworkMethod frameworkMethod)
Augments the default JUnit behavior with potential repeats of the entire execution chain.

Furthermore, support for timeouts has been moved down the execution chain in order to include execution of @Before and @After methods within the timed execution. Note that this differs from the default JUnit behavior of executing @Before and @After methods in the main thread while executing the actual test method in a separate thread. Thus, the end effect is that @Before and @After methods will be executed in the same thread as the test method. As a consequence, JUnit-specified timeouts will work fine in combination with Spring transactions. Note that JUnit-specific timeouts still differ from Spring-specific timeouts in that the former execute in a separate thread while the latter simply execute in the main thread (like regular tests).

Overrides:
methodBlock in class BlockJUnit4ClassRunner
See Also:
possiblyExpectingExceptions(FrameworkMethod, Object, Statement),
withBefores(FrameworkMethod, Object, Statement),
withAfters(FrameworkMethod, Object, Statement),
withPotentialTimeout(FrameworkMethod, Object, Statement),
withPotentialRepeat(FrameworkMethod, Object, Statement)

isTestMethodIgnored

protected boolean isTestMethodIgnored(org.junit.runners.model.FrameworkMethod frameworkMethod)
Returns true if @Ignore is present for the supplied test method or if the test method is disabled via @IfProfileValue.

See Also:
ProfileValueUtils.isTestEnabledInThisEnvironment(Method, Class)

possiblyExpectingExceptions

protected org.junit.runners.model.Statement possiblyExpectingExceptions(org.junit.runners.model.FrameworkMethod frameworkMethod,
                                                                        Object testInstance,
                                                                        org.junit.runners.model.Statement next)
Performs the same logic as BlockJUnit4ClassRunner.possiblyExpectingExceptions(FrameworkMethod, Object, Statement) except that the expected exception is retrieved using getExpectedException(FrameworkMethod).

Overrides:
possiblyExpectingExceptions in class BlockJUnit4ClassRunner

getExpectedException

protected Class<? extends Throwable> getExpectedException(org.junit.runners.model.FrameworkMethod frameworkMethod)
Get the exception that the supplied test method is expected to throw.

Supports both Spring's @ExpectedException(...) and JUnit's @Test(expected=...) annotations, but not both simultaneously.

Returns:
the expected exception, or null if none was specified

withPotentialTimeout

protected org.junit.runners.model.Statement withPotentialTimeout(org.junit.runners.model.FrameworkMethod frameworkMethod,
                                                                 Object testInstance,
                                                                 org.junit.runners.model.Statement next)
Supports both Spring's @Timed and JUnit's @Test(timeout=...) annotations, but not both simultaneously. Returns either a SpringFailOnTimeout, a FailOnTimeout, or the unmodified, supplied Statement as appropriate.

Overrides:
withPotentialTimeout in class BlockJUnit4ClassRunner
See Also:
getSpringTimeout(FrameworkMethod), getJUnitTimeout(FrameworkMethod)

getJUnitTimeout

protected long getJUnitTimeout(org.junit.runners.model.FrameworkMethod frameworkMethod)
Retrieves the configured JUnit timeout from the @Test annotation on the supplied test method.

Returns:
the timeout, or 0 if none was specified.

getSpringTimeout

protected long getSpringTimeout(org.junit.runners.model.FrameworkMethod frameworkMethod)
Retrieves the configured Spring-specific timeout from the @Timed annotation on the supplied test method.

Returns:
the timeout, or 0 if none was specified.

withBefores

protected org.junit.runners.model.Statement withBefores(org.junit.runners.model.FrameworkMethod frameworkMethod,
                                                        Object testInstance,
                                                        org.junit.runners.model.Statement statement)
Wraps the Statement returned by the parent implementation with a RunBeforeTestMethodCallbacks statement, thus preserving the default functionality but adding support for the Spring TestContext Framework.

Overrides:
withBefores in class BlockJUnit4ClassRunner
See Also:
RunBeforeTestMethodCallbacks

withAfters

protected org.junit.runners.model.Statement withAfters(org.junit.runners.model.FrameworkMethod frameworkMethod,
                                                       Object testInstance,
                                                       org.junit.runners.model.Statement statement)
Wraps the Statement returned by the parent implementation with a RunAfterTestMethodCallbacks statement, thus preserving the default functionality but adding support for the Spring TestContext Framework.

Overrides:
withAfters in class BlockJUnit4ClassRunner
See Also:
RunAfterTestMethodCallbacks

withPotentialRepeat

protected org.junit.runners.model.Statement withPotentialRepeat(org.junit.runners.model.FrameworkMethod frameworkMethod,
                                                                Object testInstance,
                                                                org.junit.runners.model.Statement next)
Supports Spring's @Repeat annotation by returning a SpringRepeat statement initialized with the configured repeat count or 1 if no repeat count is configured.

See Also:
SpringRepeat
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.test.context.junit4.statements

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.test.context.junit4.statements

JUnit 4.5 based statements used in the Spring TestContext Framework.

See:
Description

Class Summary
RunAfterTestClassCallbacks | RunAfterTestClassCallbacks is a custom JUnit 4.5+ Statement which allows the Spring TestContext Framework to be plugged into the JUnit execution chain by calling afterTestClass() on the supplied TestContextManager.
RunAfterTestMethodCallbacks | RunAfterTestMethodCallbacks is a custom JUnit 4.5+ Statement which allows the Spring TestContext Framework to be plugged into the JUnit execution chain by calling afterTestMethod() on the supplied TestContextManager.
RunBeforeTestClassCallbacks | RunBeforeTestClassCallbacks is a custom JUnit 4.5+ Statement which allows the Spring TestContext Framework to be plugged into the JUnit execution chain by calling beforeTestClass() on the supplied TestContextManager.
RunBeforeTestMethodCallbacks | RunBeforeTestMethodCallbacks is a custom JUnit 4.5+ Statement which allows the Spring TestContext Framework to be plugged into the JUnit execution chain by calling beforeTestMethod() on the supplied TestContextManager.
SpringFailOnTimeout | SpringFailOnTimeout is a custom JUnit 4.5+ Statement which adds support for Spring's @Timed annotation by throwing an exception if the next statement in the execution chain takes more than the specified number of milliseconds.
SpringRepeat | SpringRepeat is a custom JUnit 4.5+ Statement which adds support for Spring's @Repeat annotation by repeating the test for the specified number of times.

Package org.springframework.test.context.junit4.statements Description

JUnit 4.5 based statements used in the Spring TestContext Framework.


org.springframework.test.context.junit4.statements Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.test.context.junit4.statements

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.junit.runners.model.Statement
      • org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks
      • org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks
      • org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks
      • org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks
      • org.springframework.test.context.junit4.statements.SpringFailOnTimeout
      • org.springframework.test.context.junit4.statements.SpringRepeat


RunAfterTestClassCallbacks

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.test.context.junit4.statements
Class RunAfterTestClassCallbacks

java.lang.Object
    extended by  org.junit.runners.model.Statement
        extended by  org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks

public class RunAfterTestClassCallbacks
extends org.junit.runners.model.Statement

RunAfterTestClassCallbacks is a custom JUnit 4.5+ Statement which allows the Spring TestContext Framework to be plugged into the JUnit execution chain by calling afterTestClass() on the supplied TestContextManager.

Since:
3.0
Author:
Sam Brannen
See Also:
evaluate(), RunBeforeTestMethodCallbacks

Constructor Summary
RunAfterTestClassCallbacks(org.junit.runners.model.Statement next, TestContextManager testContextManager)
Constructs a new RunAfterTestClassCallbacks statement.
Method Summary
 void evaluate()
Invokes the next Statement in the execution chain (typically an instance of RunAfters), catching any exceptions thrown, and then calls TestContextManager.afterTestClass().
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

RunAfterTestClassCallbacks

public RunAfterTestClassCallbacks(org.junit.runners.model.Statement next,
                                  TestContextManager testContextManager)
Constructs a new RunAfterTestClassCallbacks statement.

Parameters:
next - the next Statement in the execution chain
testContextManager - the TestContextManager upon which to call afterTestClass()
Method Detail

evaluate

public void evaluate()
              throws Throwable
Invokes the next Statement in the execution chain (typically an instance of RunAfters), catching any exceptions thrown, and then calls TestContextManager.afterTestClass(). If the call to afterTestClass() throws an exception, it will also be tracked. Multiple exceptions will be combined into a MultipleFailureException.

Specified by:
evaluate in class org.junit.runners.model.Statement
Throws:
Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


RunAfterTestMethodCallbacks

org.springframework.test.context.junit4.statements
Class RunAfterTestMethodCallbacks

java.lang.Object
    extended by  org.junit.runners.model.Statement
        extended by  org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks

public class RunAfterTestMethodCallbacks
extends org.junit.runners.model.Statement

RunAfterTestMethodCallbacks is a custom JUnit 4.5+ Statement which allows the Spring TestContext Framework to be plugged into the JUnit execution chain by calling afterTestMethod() on the supplied TestContextManager.

Since:
3.0
Author:
Sam Brannen
See Also:
evaluate(), RunBeforeTestMethodCallbacks

Constructor Summary
RunAfterTestMethodCallbacks(org.junit.runners.model.Statement next, Object testInstance, Method testMethod, TestContextManager testContextManager)
Constructs a new RunAfterTestMethodCallbacks statement.
Method Summary
 void evaluate()
Invokes the next Statement in the execution chain (typically an instance of RunAfters), catching any exceptions thrown, and then calls TestContextManager#afterTestMethod(Object, Method) with the first caught exception (if any).
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

RunAfterTestMethodCallbacks

public RunAfterTestMethodCallbacks(org.junit.runners.model.Statement next,
                                   Object testInstance,
                                   Method testMethod,
                                   TestContextManager testContextManager)
Constructs a new RunAfterTestMethodCallbacks statement.

Parameters:
next - the next Statement in the execution chain
testInstance - the current test instance (never null)
testMethod - the test method which has just been executed on the test instance
testContextManager - the TestContextManager upon which to call afterTestMethod()
Method Detail

evaluate

public void evaluate()
              throws Throwable
Invokes the next Statement in the execution chain (typically an instance of RunAfters), catching any exceptions thrown, and then calls TestContextManager#afterTestMethod(Object, Method) with the first caught exception (if any). If the call to afterTestMethod() throws an exception, it will also be tracked. Multiple exceptions will be combined into a MultipleFailureException.

Specified by:
evaluate in class org.junit.runners.model.Statement
Throws:
Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RunBeforeTestClassCallbacks

org.springframework.test.context.junit4.statements
Class RunBeforeTestClassCallbacks

java.lang.Object
    extended by  org.junit.runners.model.Statement
        extended by  org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks

public class RunBeforeTestClassCallbacks
extends org.junit.runners.model.Statement

RunBeforeTestClassCallbacks is a custom JUnit 4.5+ Statement which allows the Spring TestContext Framework to be plugged into the JUnit execution chain by calling beforeTestClass() on the supplied TestContextManager.

Since:
3.0
Author:
Sam Brannen
See Also:
evaluate(), RunAfterTestMethodCallbacks

Constructor Summary
RunBeforeTestClassCallbacks(org.junit.runners.model.Statement next, TestContextManager testContextManager)
Constructs a new RunBeforeTestClassCallbacks statement.
Method Summary
 void evaluate()
Calls TestContextManager.beforeTestClass() and then invokes the next Statement in the execution chain (typically an instance of RunBefores).
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

RunBeforeTestClassCallbacks

public RunBeforeTestClassCallbacks(org.junit.runners.model.Statement next,
                                   TestContextManager testContextManager)
Constructs a new RunBeforeTestClassCallbacks statement.

Parameters:
next - the next Statement in the execution chain
testContextManager - the TestContextManager upon which to call beforeTestClass()
Method Detail

evaluate

public void evaluate()
              throws Throwable
Calls TestContextManager.beforeTestClass() and then invokes the next Statement in the execution chain (typically an instance of RunBefores).

Specified by:
evaluate in class org.junit.runners.model.Statement
Throws:
Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RunBeforeTestMethodCallbacks

org.springframework.test.context.junit4.statements
Class RunBeforeTestMethodCallbacks

java.lang.Object
    extended by  org.junit.runners.model.Statement
        extended by  org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks

public class RunBeforeTestMethodCallbacks
extends org.junit.runners.model.Statement

RunBeforeTestMethodCallbacks is a custom JUnit 4.5+ Statement which allows the Spring TestContext Framework to be plugged into the JUnit execution chain by calling beforeTestMethod() on the supplied TestContextManager.

Since:
3.0
Author:
Sam Brannen
See Also:
evaluate(), RunAfterTestMethodCallbacks

Constructor Summary
RunBeforeTestMethodCallbacks(org.junit.runners.model.Statement next, Object testInstance, Method testMethod, TestContextManager testContextManager)
Constructs a new RunBeforeTestMethodCallbacks statement.
Method Summary
 void evaluate()
Calls TestContextManager.beforeTestMethod(Object, Method) and then invokes the next Statement in the execution chain (typically an instance of RunBefores).
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

RunBeforeTestMethodCallbacks

public RunBeforeTestMethodCallbacks(org.junit.runners.model.Statement next,
                                    Object testInstance,
                                    Method testMethod,
                                    TestContextManager testContextManager)
Constructs a new RunBeforeTestMethodCallbacks statement.

Parameters:
next - the next Statement in the execution chain
testInstance - the current test instance (never null)
testMethod - the test method which is about to be executed on the test instance
testContextManager - the TestContextManager upon which to call beforeTestMethod()
Method Detail

evaluate

public void evaluate()
              throws Throwable
Calls TestContextManager.beforeTestMethod(Object, Method) and then invokes the next Statement in the execution chain (typically an instance of RunBefores).

Specified by:
evaluate in class org.junit.runners.model.Statement
Throws:
Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SpringFailOnTimeout

org.springframework.test.context.junit4.statements
Class SpringFailOnTimeout

java.lang.Object
    extended by  org.junit.runners.model.Statement
        extended by  org.springframework.test.context.junit4.statements.SpringFailOnTimeout

public class SpringFailOnTimeout
extends org.junit.runners.model.Statement

SpringFailOnTimeout is a custom JUnit 4.5+ Statement which adds support for Spring's @Timed annotation by throwing an exception if the next statement in the execution chain takes more than the specified number of milliseconds.

Since:
3.0
Author:
Sam Brannen
See Also:
evaluate()

Constructor Summary
SpringFailOnTimeout(org.junit.runners.model.Statement next, long timeout)
Constructs a new SpringFailOnTimeout statement.
Method Summary
 void evaluate()
Invokes the next statement in the execution chain (typically an instance of InvokeMethod or ExpectException) and throws an exception if the next statement takes more than the specified timeout .
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SpringFailOnTimeout

public SpringFailOnTimeout(org.junit.runners.model.Statement next,
                           long timeout)
Constructs a new SpringFailOnTimeout statement.

Parameters:
next - the next Statement in the execution chain
timeout - the configured timeout for the current test
See Also:
Timed.millis()
Method Detail

evaluate

public void evaluate()
              throws Throwable
Invokes the next statement in the execution chain (typically an instance of InvokeMethod or ExpectException) and throws an exception if the next statement takes more than the specified timeout .

Specified by:
evaluate in class org.junit.runners.model.Statement
Throws:
Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SpringRepeat

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.test.context.junit4.statements
Class SpringRepeat

java.lang.Object
    extended by  org.junit.runners.model.Statement
        extended by  org.springframework.test.context.junit4.statements.SpringRepeat

public class SpringRepeat
extends org.junit.runners.model.Statement

SpringRepeat is a custom JUnit 4.5+ Statement which adds support for Spring's @Repeat annotation by repeating the test for the specified number of times.

Since:
3.0
Author:
Sam Brannen
See Also:
evaluate()

Field Summary
protected static Log logger
Constructor Summary
SpringRepeat(org.junit.runners.model.Statement next, Method testMethod, int repeat)
Constructs a new SpringRepeat statement.
Method Summary
 void evaluate()
Invokes the next statement in the execution chain for the specified repeat count.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected static final Log logger
Constructor Detail

SpringRepeat

public SpringRepeat(org.junit.runners.model.Statement next,
                    Method testMethod,
                    int repeat)
Constructs a new SpringRepeat statement.

Parameters:
next - the next Statement in the execution chain
testMethod - the current test method
repeat - the configured repeat count for the current test method
See Also:
Repeat.value()
Method Detail

evaluate

public void evaluate()
              throws Throwable
Invokes the next statement in the execution chain for the specified repeat count.

Specified by:
evaluate in class org.junit.runners.model.Statement
Throws:
Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.test.context.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.test.context.support

Support classes for the Spring TestContext Framework.

See:
Description

Class Summary
AbstractContextLoader | Abstract application context loader, which provides a basis for all concrete implementations of the ContextLoader strategy.
AbstractGenericContextLoader | Abstract, generic extension of AbstractContextLoader which loads a GenericApplicationContext from the locations provided to AbstractGenericContextLoader.loadContext(String...).
AbstractTestExecutionListener | Abstract implementation of the TestExecutionListener interface which provides empty method stubs.
DependencyInjectionTestExecutionListener | TestExecutionListener which provides support for dependency injection and initialization of test instances.
DirtiesContextTestExecutionListener | TestExecutionListener which provides support for marking the ApplicationContext associated with a test as dirty for both test classes and test methods configured with the @DirtiesContext annotation.
GenericPropertiesContextLoader | Concrete implementation of AbstractGenericContextLoader which reads bean definitions from Java Properties resources.
GenericXmlContextLoader | Concrete implementation of AbstractGenericContextLoader which reads bean definitions from XML resources.

Package org.springframework.test.context.support Description

Support classes for the Spring TestContext Framework.


org.springframework.test.context.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.test.context.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.test.context.support.AbstractContextLoader (implements org.springframework.test.context.ContextLoader)
      • org.springframework.test.context.support.AbstractGenericContextLoader
        • org.springframework.test.context.support.GenericPropertiesContextLoader
        • org.springframework.test.context.support.GenericXmlContextLoader
    • org.springframework.test.context.support.AbstractTestExecutionListener (implements org.springframework.test.context.TestExecutionListener)
      • org.springframework.test.context.support.DependencyInjectionTestExecutionListener
      • org.springframework.test.context.support.DirtiesContextTestExecutionListener


AbstractContextLoader

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.test.context.support
Class AbstractContextLoader

java.lang.Object
    extended by  org.springframework.test.context.support.AbstractContextLoader
All Implemented Interfaces:
ContextLoader
Direct Known Subclasses:
AbstractGenericContextLoader
public abstract class AbstractContextLoader
extends Object
implements ContextLoader

Abstract application context loader, which provides a basis for all concrete implementations of the ContextLoader strategy. Provides a Template Method based approach for processing locations.

Since:
2.5
Author:
Sam Brannen, Juergen Hoeller
See Also:
generateDefaultLocations(java.lang.Class), modifyLocations(java.lang.Class, java.lang.String...)

Constructor Summary
AbstractContextLoader()
Method Summary
protected  String[] generateDefaultLocations(Class<?> clazz)
Generates the default classpath resource locations array based on the supplied class.
protected abstract  String getResourceSuffix()
Get the suffix to append to ApplicationContext resource locations when generating default locations.
protected  boolean isGenerateDefaultLocations()
Determine whether or not default resource locations should be generated if the locations provided to processLocations() are null or empty.
protected  String[] modifyLocations(Class<?> clazz, String... locations)
Generate a modified version of the supplied locations array and returns it.
 String[] processLocations(Class<?> clazz, String... locations)
If the supplied locations are null or empty and isGenerateDefaultLocations() is true, default locations will be generated for the specified class and the configured resource suffix; otherwise, the supplied locations will be modified if necessary and returned.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.test.context.ContextLoader
loadContext

Constructor Detail

AbstractContextLoader

public AbstractContextLoader()
Method Detail

processLocations

public final String[] processLocations(Class<?> clazz,
                                       String... locations)
If the supplied locations are null or empty and isGenerateDefaultLocations() is true, default locations will be generated for the specified class and the configured resource suffix; otherwise, the supplied locations will be modified if necessary and returned.

Specified by:
processLocations in interface ContextLoader
Parameters:
clazz - the class with which the locations are associated: to be used when generating default locations
locations - the unmodified locations to use for loading the application context (can be null or empty)
Returns:
an array of application context resource locations
See Also:
generateDefaultLocations(java.lang.Class),
modifyLocations(java.lang.Class, java.lang.String...),
ContextLoader.processLocations(java.lang.Class, java.lang.String...)

generateDefaultLocations

protected String[] generateDefaultLocations(Class<?> clazz)
Generates the default classpath resource locations array based on the supplied class.

For example, if the supplied class is com.example.MyTest, the generated locations will contain a single string with a value of "classpath:/com/example/MyTest<suffix>", where <suffix> is the value of the resource suffix string.

Subclasses can override this method to implement a different default location generation strategy.

Parameters:
clazz - the class for which the default locations are to be generated
Returns:
an array of default application context resource locations
See Also:
getResourceSuffix()

modifyLocations

protected String[] modifyLocations(Class<?> clazz,
                                   String... locations)
Generate a modified version of the supplied locations array and returns it.

A plain path, e.g. "context.xml", will be treated as a classpath resource from the same package in which the specified class is defined. A path starting with a slash is treated as a fully qualified class path location, e.g.: "/org/springframework/whatever/foo.xml". A path which references a URL (e.g., a path prefixed with classpath:, file:, http:, etc.) will be added to the results unchanged.

Subclasses can override this method to implement a different location modification strategy.

Parameters:
clazz - the class with which the locations are associated
locations - the resource locations to be modified
Returns:
an array of modified application context resource locations

isGenerateDefaultLocations

protected boolean isGenerateDefaultLocations()
Determine whether or not default resource locations should be generated if the locations provided to processLocations() are null or empty.

Can be overridden by subclasses to change the default behavior.

Returns:
always true by default

getResourceSuffix

protected abstract String getResourceSuffix()
Get the suffix to append to ApplicationContext resource locations when generating default locations.

Must be implemented by subclasses.

Returns:
the resource suffix; should not be null or empty
See Also:
generateDefaultLocations(Class)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractGenericContextLoader

org.springframework.test.context.support
Class AbstractGenericContextLoader

java.lang.Object
    extended by  org.springframework.test.context.support.AbstractContextLoader
        extended by  org.springframework.test.context.support.AbstractGenericContextLoader
All Implemented Interfaces:
ContextLoader
Direct Known Subclasses:
GenericPropertiesContextLoader, GenericXmlContextLoader
public abstract class AbstractGenericContextLoader
extends AbstractContextLoader

Abstract, generic extension of AbstractContextLoader which loads a GenericApplicationContext from the locations provided to loadContext(String...).

Concrete subclasses must provide an appropriate BeanDefinitionReader.

Since:
2.5
Author:
Sam Brannen, Juergen Hoeller
See Also:
loadContext(String...)

Field Summary
protected static Log logger
Constructor Summary
AbstractGenericContextLoader()
Method Summary
protected abstract BeanDefinitionReader | createBeanDefinitionReader(GenericApplicationContext context) Factory method for creating new BeanDefinitionReaders for loading bean definitions into the supplied context.
protected void | customizeBeanFactory(DefaultListableBeanFactory beanFactory) Customize the internal bean factory of the ApplicationContext created by this ContextLoader.
protected void | customizeContext(GenericApplicationContext context) Customize the GenericApplicationContext created by this ContextLoader after bean definitions have been loaded into the context but before the context is refreshed.
ConfigurableApplicationContext | loadContext(String... locations) Loads a Spring ApplicationContext from the supplied locations.
protected void | prepareContext(GenericApplicationContext context) Prepare the GenericApplicationContext created by this ContextLoader.
Methods inherited from class org.springframework.test.context.support.AbstractContextLoader
generateDefaultLocations, getResourceSuffix, isGenerateDefaultLocations, modifyLocations, processLocations
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected static final Log logger
Constructor Detail

AbstractGenericContextLoader

public AbstractGenericContextLoader()
Method Detail

loadContext

public final ConfigurableApplicationContext loadContext(String... locations)
                                                 throws Exception
Loads a Spring ApplicationContext from the supplied locations.

Implementation details:

  • Creates a standard GenericApplicationContext instance.
  • Populates it from the specified config locations through a BeanDefinitionReader.
  • Calls customizeBeanFactory(DefaultListableBeanFactory) to allow for customizing the context's DefaultListableBeanFactory.
  • Delegates to AnnotationConfigUtils for registering annotation configuration processors.
  • Calls customizeContext(GenericApplicationContext) to allow for customizing the context before it is refreshed.
  • Refreshes the context and registers a JVM shutdown hook for it.

Subclasses must provide an appropriate implementation of createBeanDefinitionReader(GenericApplicationContext).

Parameters:
locations - the resource locations to use to load the application context
Returns:
a new application context
Throws:
Exception - if context loading failed
See Also:
ContextLoader.loadContext(java.lang.String...), GenericApplicationContext, customizeBeanFactory(DefaultListableBeanFactory), createBeanDefinitionReader(GenericApplicationContext), BeanDefinitionReader

prepareContext

protected void prepareContext(GenericApplicationContext context)
Prepare the GenericApplicationContext created by this ContextLoader. Called before bean definitions are read.

The default implementation is empty. Can be overridden in subclasses to customize GenericApplicationContext's standard settings.

Parameters:
context - the context for which the BeanDefinitionReader should be created
See Also:
loadContext(java.lang.String...),
GenericApplicationContext.setResourceLoader(org.springframework.core.io.ResourceLoader),
GenericApplicationContext.setId(java.lang.String)

customizeBeanFactory

protected void customizeBeanFactory(DefaultListableBeanFactory beanFactory)
Customize the internal bean factory of the ApplicationContext created by this ContextLoader.

The default implementation is empty but can be overridden in subclasses to customize DefaultListableBeanFactory's standard settings.

Parameters:
beanFactory - the bean factory created by this ContextLoader
See Also:
loadContext(java.lang.String...),
DefaultListableBeanFactory.setAllowBeanDefinitionOverriding(boolean),
DefaultListableBeanFactory.setAllowEagerClassLoading(boolean),
AbstractAutowireCapableBeanFactory.setAllowCircularReferences(boolean),
AbstractAutowireCapableBeanFactory.setAllowRawInjectionDespiteWrapping(boolean)

createBeanDefinitionReader

protected abstract BeanDefinitionReader createBeanDefinitionReader(GenericApplicationContext context)
Factory method for creating new BeanDefinitionReaders for loading bean definitions into the supplied context.

Parameters:
context - the context for which the BeanDefinitionReader should be created
Returns:
a BeanDefinitionReader for the supplied context
See Also:
loadContext(java.lang.String...), BeanDefinitionReader

customizeContext

protected void customizeContext(GenericApplicationContext context)
Customize the GenericApplicationContext created by this ContextLoader after bean definitions have been loaded into the context but before the context is refreshed.

The default implementation is empty but can be overridden in subclasses to customize the application context.

Parameters:
context - the newly created application context
See Also:
loadContext(String...)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractTestExecutionListener

org.springframework.test.context.support
Class AbstractTestExecutionListener

java.lang.Object
    extended by  org.springframework.test.context.support.AbstractTestExecutionListener
All Implemented Interfaces:
TestExecutionListener
Direct Known Subclasses:
DependencyInjectionTestExecutionListener, DirtiesContextTestExecutionListener, TransactionalTestExecutionListener
public abstract class AbstractTestExecutionListener
extends Object
implements TestExecutionListener

Abstract implementation of the TestExecutionListener interface which provides empty method stubs. Subclasses can extend this class and override only those methods suitable for the task at hand.

Since:
2.5
Author:
Sam Brannen, Juergen Hoeller

Constructor Summary
AbstractTestExecutionListener()
Method Summary
void | afterTestClass(TestContext testContext) The default implementation is empty.
void | afterTestMethod(TestContext testContext) The default implementation is empty.
void | beforeTestClass(TestContext testContext) The default implementation is empty.
void | beforeTestMethod(TestContext testContext) The default implementation is empty.
void | prepareTestInstance(TestContext testContext) The default implementation is empty.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractTestExecutionListener

public AbstractTestExecutionListener()
Method Detail

beforeTestClass

public void beforeTestClass(TestContext testContext)
                     throws Exception
The default implementation is empty. Can be overridden by subclasses as necessary.

Specified by:
beforeTestClass in interface TestExecutionListener
Parameters:
testContext - the test context for the test; never null
Throws:
Exception - allows any exception to propagate

prepareTestInstance

public void prepareTestInstance(TestContext testContext)
                         throws Exception
The default implementation is empty. Can be overridden by subclasses as necessary.

Specified by:
prepareTestInstance in interface TestExecutionListener
Parameters:
testContext - the test context for the test; never null
Throws:
Exception - allows any exception to propagate

beforeTestMethod

public void beforeTestMethod(TestContext testContext)
                      throws Exception
The default implementation is empty. Can be overridden by subclasses as necessary.

Specified by:
beforeTestMethod in interface TestExecutionListener
Parameters:
testContext - the test context in which the test method will be executed; never null
Throws:
Exception - allows any exception to propagate

afterTestMethod

public void afterTestMethod(TestContext testContext)
                     throws Exception
The default implementation is empty. Can be overridden by subclasses as necessary.

Specified by:
afterTestMethod in interface TestExecutionListener
Parameters:
testContext - the test context in which the test method was executed; never null
Throws:
Exception - allows any exception to propagate

afterTestClass

public void afterTestClass(TestContext testContext)
                    throws Exception
The default implementation is empty. Can be overridden by subclasses as necessary.

Specified by:
afterTestClass in interface TestExecutionListener
Parameters:
testContext - the test context for the test; never null
Throws:
Exception - allows any exception to propagate
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DependencyInjectionTestExecutionListener

org.springframework.test.context.support
Class DependencyInjectionTestExecutionListener

java.lang.Object
    extended by  org.springframework.test.context.support.AbstractTestExecutionListener
        extended by  org.springframework.test.context.support.DependencyInjectionTestExecutionListener
All Implemented Interfaces:
TestExecutionListener
public class DependencyInjectionTestExecutionListener
extends AbstractTestExecutionListener

TestExecutionListener which provides support for dependency injection and initialization of test instances.

Since:
2.5
Author:
Sam Brannen, Juergen Hoeller

Field Summary
static String REINJECT_DEPENDENCIES_ATTRIBUTE
Attribute name for a TestContext attribute which indicates whether or not the dependencies of a test instance should be reinjected in beforeTestMethod().
Constructor Summary
DependencyInjectionTestExecutionListener()
Method Summary
void | beforeTestMethod(TestContext testContext) If the REINJECT_DEPENDENCIES_ATTRIBUTE in the supplied test context has a value of Boolean.TRUE, this method will have the same effect as prepareTestInstance(); otherwise, this method will have no effect.
protected void | injectDependencies(TestContext testContext) Performs dependency injection and bean initialization for the supplied TestContext as described in prepareTestInstance().
void | prepareTestInstance(TestContext testContext) Performs dependency injection on the test instance of the supplied test context by autowiring and initializing the test instance via its own application context (without checking dependencies).
Methods inherited from class org.springframework.test.context.support.AbstractTestExecutionListener
afterTestClass, afterTestMethod, beforeTestClass
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

REINJECT_DEPENDENCIES_ATTRIBUTE

public static final String REINJECT_DEPENDENCIES_ATTRIBUTE
Attribute name for a TestContext attribute which indicates whether or not the dependencies of a test instance should be reinjected in beforeTestMethod(). Note that dependencies will be injected in prepareTestInstance() in any case.

Clients of a TestContext (e.g., other TestExecutionListeners) may therefore choose to set this attribute to signal that dependencies should be reinjected between execution of individual test methods.

Permissible values include Boolean.TRUE and Boolean.FALSE.

Constructor Detail

DependencyInjectionTestExecutionListener

public DependencyInjectionTestExecutionListener()
Method Detail

prepareTestInstance

public void prepareTestInstance(TestContext testContext)
                         throws Exception
Performs dependency injection on the test instance of the supplied test context by autowiring and initializing the test instance via its own application context (without checking dependencies).

The REINJECT_DEPENDENCIES_ATTRIBUTE will be subsequently removed from the test context, regardless of its value.

Specified by:
prepareTestInstance in interface TestExecutionListener
Overrides:
prepareTestInstance in class AbstractTestExecutionListener
Parameters:
testContext - the test context for the test; never null
Throws:
Exception - allows any exception to propagate

beforeTestMethod

public void beforeTestMethod(TestContext testContext)
                      throws Exception
If the REINJECT_DEPENDENCIES_ATTRIBUTE in the supplied test context has a value of Boolean.TRUE, this method will have the same effect as prepareTestInstance(); otherwise, this method will have no effect.

Specified by:
beforeTestMethod in interface TestExecutionListener
Overrides:
beforeTestMethod in class AbstractTestExecutionListener
Parameters:
testContext - the test context in which the test method will be executed; never null
Throws:
Exception - allows any exception to propagate

injectDependencies

protected void injectDependencies(TestContext testContext)
                           throws Exception
Performs dependency injection and bean initialization for the supplied TestContext as described in prepareTestInstance().

The REINJECT_DEPENDENCIES_ATTRIBUTE will be subsequently removed from the test context, regardless of its value.

Parameters:
testContext - the test context for which dependency injection should be performed (never null)
Throws:
Exception - allows any exception to propagate
See Also:
prepareTestInstance(TestContext), beforeTestMethod(TestContext)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DirtiesContextTestExecutionListener

org.springframework.test.context.support
Class DirtiesContextTestExecutionListener

java.lang.Object
    extended by  org.springframework.test.context.support.AbstractTestExecutionListener
        extended by  org.springframework.test.context.support.DirtiesContextTestExecutionListener
All Implemented Interfaces:
TestExecutionListener
public class DirtiesContextTestExecutionListener
extends AbstractTestExecutionListener

TestExecutionListener which provides support for marking the ApplicationContext associated with a test as dirty for both test classes and test methods configured with the @DirtiesContext annotation.

Since:
2.5
Author:
Sam Brannen, Juergen Hoeller
See Also:
DirtiesContext

Constructor Summary
DirtiesContextTestExecutionListener()
Method Summary
void | afterTestClass(TestContext testContext) If the test class of the supplied test context is annotated with @DirtiesContext, the application context of the test context will be marked as dirty , and the REINJECT_DEPENDENCIES_ATTRIBUTE in the test context will be set to true.
void | afterTestMethod(TestContext testContext) If the current test method of the supplied test context is annotated with @DirtiesContext, or if the test class is annotated with @DirtiesContext and the class mode is set to AFTER_EACH_TEST_METHOD, the application context of the test context will be marked as dirty and the REINJECT_DEPENDENCIES_ATTRIBUTE in the test context will be set to true.
protected void | dirtyContext(TestContext testContext) Marks the application context of the supplied test context as dirty, and sets the REINJECT_DEPENDENCIES_ATTRIBUTE in the test context to true .
Methods inherited from class org.springframework.test.context.support.AbstractTestExecutionListener
beforeTestClass, beforeTestMethod, prepareTestInstance
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DirtiesContextTestExecutionListener

public DirtiesContextTestExecutionListener()
Method Detail

dirtyContext

protected void dirtyContext(TestContext testContext)
Marks the application context of the supplied test context as dirty, and sets the REINJECT_DEPENDENCIES_ATTRIBUTE in the test context to true .

afterTestMethod

public void afterTestMethod(TestContext testContext)
                     throws Exception
If the current test method of the supplied test context is annotated with @DirtiesContext, or if the test class is annotated with @DirtiesContext and the class mode is set to AFTER_EACH_TEST_METHOD, the application context of the test context will be marked as dirty and the REINJECT_DEPENDENCIES_ATTRIBUTE in the test context will be set to true.

Specified by:
afterTestMethod in interface TestExecutionListener
Overrides:
afterTestMethod in class AbstractTestExecutionListener
Parameters:
testContext - the test context in which the test method was executed; never null
Throws:
Exception - allows any exception to propagate

afterTestClass

public void afterTestClass(TestContext testContext)
                    throws Exception
If the test class of the supplied test context is annotated with @DirtiesContext, the application context of the test context will be marked as dirty , and the REINJECT_DEPENDENCIES_ATTRIBUTE in the test context will be set to true.

Specified by:
afterTestClass in interface TestExecutionListener
Overrides:
afterTestClass in class AbstractTestExecutionListener
Parameters:
testContext - the test context for the test; never null
Throws:
Exception - allows any exception to propagate
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


GenericPropertiesContextLoader

org.springframework.test.context.support
Class GenericPropertiesContextLoader

java.lang.Object
    extended by  org.springframework.test.context.support.AbstractContextLoader
        extended by  org.springframework.test.context.support.AbstractGenericContextLoader
            extended by  org.springframework.test.context.support.GenericPropertiesContextLoader
All Implemented Interfaces:
ContextLoader
public class GenericPropertiesContextLoader
extends AbstractGenericContextLoader

Concrete implementation of AbstractGenericContextLoader which reads bean definitions from Java Properties resources.

Since:
2.5
Author:
Sam Brannen

Field Summary
Fields inherited from class org.springframework.test.context.support.AbstractGenericContextLoader
logger
Constructor Summary
GenericPropertiesContextLoader()
Method Summary
protected BeanDefinitionReader | createBeanDefinitionReader(GenericApplicationContext context) Creates a new PropertiesBeanDefinitionReader.
String | getResourceSuffix() Returns "-context.properties".
Methods inherited from class org.springframework.test.context.support.AbstractGenericContextLoader
customizeBeanFactory, customizeContext, loadContext, prepareContext
Methods inherited from class org.springframework.test.context.support.AbstractContextLoader
generateDefaultLocations, isGenerateDefaultLocations, modifyLocations, processLocations
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

GenericPropertiesContextLoader

public GenericPropertiesContextLoader()
Method Detail

createBeanDefinitionReader

protected BeanDefinitionReader createBeanDefinitionReader(GenericApplicationContext context)

Creates a new PropertiesBeanDefinitionReader.

Specified by:
createBeanDefinitionReader in class AbstractGenericContextLoader
Parameters:
context - the context for which the BeanDefinitionReader should be created
Returns:
a new PropertiesBeanDefinitionReader.
See Also:
AbstractGenericContextLoader.createBeanDefinitionReader(GenericApplicationContext), PropertiesBeanDefinitionReader

getResourceSuffix

public String getResourceSuffix()
Returns "-context.properties".

Specified by:
getResourceSuffix in class AbstractContextLoader
Returns:
the resource suffix; should not be null or empty
See Also:
AbstractContextLoader.getResourceSuffix()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


GenericXmlContextLoader

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.test.context.support
Class GenericXmlContextLoader

java.lang.Object
    extended by  org.springframework.test.context.support.AbstractContextLoader
        extended by  org.springframework.test.context.support.AbstractGenericContextLoader
            extended by  org.springframework.test.context.support.GenericXmlContextLoader
All Implemented Interfaces:
ContextLoader
public class GenericXmlContextLoader
extends AbstractGenericContextLoader

Concrete implementation of AbstractGenericContextLoader which reads bean definitions from XML resources.

Since:
2.5
Author:
Sam Brannen

Field Summary
Fields inherited from class org.springframework.test.context.support.AbstractGenericContextLoader
logger
Constructor Summary
GenericXmlContextLoader()
Method Summary
protected BeanDefinitionReader | createBeanDefinitionReader(GenericApplicationContext context) Create a new XmlBeanDefinitionReader.
String | getResourceSuffix() Returns "-context.xml".
Methods inherited from class org.springframework.test.context.support.AbstractGenericContextLoader
customizeBeanFactory, customizeContext, loadContext, prepareContext
Methods inherited from class org.springframework.test.context.support.AbstractContextLoader
generateDefaultLocations, isGenerateDefaultLocations, modifyLocations, processLocations
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

GenericXmlContextLoader

public GenericXmlContextLoader()
Method Detail

createBeanDefinitionReader

protected BeanDefinitionReader createBeanDefinitionReader(GenericApplicationContext context)
Create a new XmlBeanDefinitionReader.

Specified by:
createBeanDefinitionReader in class AbstractGenericContextLoader
Parameters:
context - the context for which the BeanDefinitionReader should be created
Returns:
a new XmlBeanDefinitionReader.
See Also:
XmlBeanDefinitionReader

getResourceSuffix

public String getResourceSuffix()
Returns "-context.xml".

Specified by:
getResourceSuffix in class AbstractContextLoader
Returns:
the resource suffix; should not be null or empty
See Also:
AbstractContextLoader.generateDefaultLocations(Class)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.test.context.testng

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.test.context.testng

Support classes for ApplicationContext-based and transactional tests run with TestNG and the Spring TestContext Framework.

See:
Description

Class Summary
AbstractTestNGSpringContextTests | Abstract base test class which integrates the Spring TestContext Framework with explicit ApplicationContext testing support in a TestNG environment.
AbstractTransactionalTestNGSpringContextTests | Abstract transactional extension of AbstractTestNGSpringContextTests which adds convenience functionality for JDBC access.

Package org.springframework.test.context.testng Description

Support classes for ApplicationContext-based and transactional tests run with TestNG and the Spring TestContext Framework.


org.springframework.test.context.testng Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.test.context.testng

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.test.context.testng.AbstractTestNGSpringContextTests (implements org.springframework.context.ApplicationContextAware, org.testng.IHookable)
      • org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests


AbstractTestNGSpringContextTests

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.test.context.testng
Class AbstractTestNGSpringContextTests

java.lang.Object
    extended by  org.springframework.test.context.testng.AbstractTestNGSpringContextTests
All Implemented Interfaces:
ApplicationContextAware, org.testng.IHookable
Direct Known Subclasses:
AbstractTransactionalTestNGSpringContextTests
@TestExecutionListeners(value={DependencyInjectionTestExecutionListener.class,DirtiesContextTestExecutionListener.class})
public abstract class AbstractTestNGSpringContextTests
extends Object
implements org.testng.IHookable, ApplicationContextAware

Abstract base test class which integrates the Spring TestContext Framework with explicit ApplicationContext testing support in a TestNG environment.

Concrete subclasses:

  • Typically declare a class-level @ContextConfiguration annotation to configure the application context resource locations. If your test does not need to load an application context, you may choose to omit the @ContextConfiguration declaration and to configure the appropriate TestExecutionListeners manually.
  • Must have constructors which either implicitly or explicitly delegate to super();.

Since:
2.5
Author:
Sam Brannen, Juergen Hoeller
See Also:
TestContext, TestContextManager, TestExecutionListeners, AbstractTransactionalTestNGSpringContextTests, AbstractJUnit38SpringContextTests, AbstractJUnit4SpringContextTests

Field Summary
protected ApplicationContext | applicationContext The ApplicationContext that was injected into this test instance via setApplicationContext(ApplicationContext).
protected Log | logger Logger available to subclasses
Constructor Summary
AbstractTestNGSpringContextTests()
Construct a new AbstractTestNGSpringContextTests instance and initialize the internal TestContextManager for the current test.
Method Summary
void | run(org.testng.IHookCallBack callBack, org.testng.ITestResult testResult) Delegates to the test method in the supplied callback to execute the actual test and then tracks the exception thrown during test execution, if any.
void | setApplicationContext(ApplicationContext applicationContext) Set the ApplicationContext to be used by this test instance, provided via ApplicationContextAware semantics.
protected void | springTestContextAfterTestClass() Delegates to the configured TestContextManager to call 'after test class' callbacks.
protected void | springTestContextAfterTestMethod(Method testMethod) Delegates to the configured TestContextManager to post-process the test method after the actual test has executed.
protected void | springTestContextBeforeTestClass() Delegates to the configured TestContextManager to call 'before test class' callbacks.
protected void | springTestContextBeforeTestMethod(Method testMethod) Delegates to the configured TestContextManager to pre-process the test method before the actual test is executed.
protected void | springTestContextPrepareTestInstance() Delegates to the configured TestContextManager to prepare this test instance prior to execution of any individual tests, for example for injecting dependencies, etc.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

applicationContext

protected ApplicationContext applicationContext
The ApplicationContext that was injected into this test instance via setApplicationContext(ApplicationContext).

Constructor Detail

AbstractTestNGSpringContextTests

public AbstractTestNGSpringContextTests()
Construct a new AbstractTestNGSpringContextTests instance and initialize the internal TestContextManager for the current test.

Method Detail

setApplicationContext

public final void setApplicationContext(ApplicationContext applicationContext)
Set the ApplicationContext to be used by this test instance, provided via ApplicationContextAware semantics.

Specified by:
setApplicationContext in interface ApplicationContextAware
Parameters:
applicationContext - the applicationContext to set
See Also:
BeanInitializationException

springTestContextBeforeTestClass

protected void springTestContextBeforeTestClass()
                                         throws Exception
Delegates to the configured TestContextManager to call 'before test class' callbacks.

Throws:
Exception - if a registered TestExecutionListener throws an exception

springTestContextPrepareTestInstance

protected void springTestContextPrepareTestInstance()
                                             throws Exception
Delegates to the configured TestContextManager to prepare this test instance prior to execution of any individual tests, for example for injecting dependencies, etc.

Throws:
Exception - if a registered TestExecutionListener throws an exception

springTestContextBeforeTestMethod

protected void springTestContextBeforeTestMethod(Method testMethod)
                                          throws Exception
Delegates to the configured TestContextManager to pre-process the test method before the actual test is executed.

Parameters:
testMethod - the test method which is about to be executed.
Throws:
Exception - allows all exceptions to propagate.

run

public void run(org.testng.IHookCallBack callBack,
                org.testng.ITestResult testResult)
Delegates to the test method in the supplied callback to execute the actual test and then tracks the exception thrown during test execution, if any.

Specified by:
run in interface org.testng.IHookable
See Also:
IHookable.run(org.testng.IHookCallBack, org.testng.ITestResult)

springTestContextAfterTestMethod

protected void springTestContextAfterTestMethod(Method testMethod)
                                         throws Exception
Delegates to the configured TestContextManager to post-process the test method after the actual test has executed.

Parameters:
testMethod - the test method which has just been executed on the test instance
Throws:
Exception - allows all exceptions to propagate

springTestContextAfterTestClass

protected void springTestContextAfterTestClass()
                                        throws Exception
Delegates to the configured TestContextManager to call 'after test class' callbacks.

Throws:
Exception - if a registered TestExecutionListener throws an exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractTransactionalTestNGSpringContextTests

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.test.context.testng
Class AbstractTransactionalTestNGSpringContextTests

java.lang.Object
    extended by  org.springframework.test.context.testng.AbstractTestNGSpringContextTests
        extended by  org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests
All Implemented Interfaces:
ApplicationContextAware, org.testng.IHookable
@TestExecutionListeners(value=TransactionalTestExecutionListener.class)
@Transactional
public abstract class AbstractTransactionalTestNGSpringContextTests
extends AbstractTestNGSpringContextTests

Abstract transactional extension of AbstractTestNGSpringContextTests which adds convenience functionality for JDBC access. Expects a DataSource bean and a PlatformTransactionManager bean to be defined in the Spring application context.

This class exposes a SimpleJdbcTemplate and provides an easy way to count the number of rows in a table , delete from the database , and execute SQL scripts within a transaction.

Concrete subclasses must fulfill the same requirements outlined in AbstractTestNGSpringContextTests.

Since:
2.5
Author:
Sam Brannen, Juergen Hoeller
See Also:
AbstractTestNGSpringContextTests, ContextConfiguration, TestExecutionListeners, TransactionalTestExecutionListener, TransactionConfiguration, Transactional, NotTransactional, Rollback, SimpleJdbcTestUtils, AbstractTransactionalJUnit38SpringContextTests, AbstractTransactionalJUnit4SpringContextTests

Field Summary
protected  SimpleJdbcTemplate simpleJdbcTemplate
The SimpleJdbcTemplate that this base class manages, available to subclasses.
Fields inherited from class org.springframework.test.context.testng.AbstractTestNGSpringContextTests
applicationContext, logger
Constructor Summary
AbstractTransactionalTestNGSpringContextTests()
Method Summary
protected int | countRowsInTable(String tableName) Count the rows in the given table.
protected int | deleteFromTables(String... names) Convenience method for deleting all rows from the specified tables.
protected void | executeSqlScript(String sqlResourcePath, boolean continueOnError) Execute the given SQL script.
void | setDataSource(DataSource dataSource) Set the DataSource, typically provided via Dependency Injection.
void | setSqlScriptEncoding(String sqlScriptEncoding) Specify the encoding for SQL scripts, if different from the platform encoding.
Methods inherited from class org.springframework.test.context.testng.AbstractTestNGSpringContextTests
run, setApplicationContext, springTestContextAfterTestClass, springTestContextAfterTestMethod, springTestContextBeforeTestClass, springTestContextBeforeTestMethod, springTestContextPrepareTestInstance
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

simpleJdbcTemplate

protected SimpleJdbcTemplate simpleJdbcTemplate
The SimpleJdbcTemplate that this base class manages, available to subclasses.

Constructor Detail

AbstractTransactionalTestNGSpringContextTests

public AbstractTransactionalTestNGSpringContextTests()
Method Detail

setDataSource

public void setDataSource(DataSource dataSource)
Set the DataSource, typically provided via Dependency Injection.

Parameters:
dataSource - the DataSource to inject

setSqlScriptEncoding

public void setSqlScriptEncoding(String sqlScriptEncoding)
Specify the encoding for SQL scripts, if different from the platform encoding.

See Also:
executeSqlScript(java.lang.String, boolean)

countRowsInTable

protected int countRowsInTable(String tableName)
Count the rows in the given table.

Parameters:
tableName - table name to count rows in
Returns:
the number of rows in the table

deleteFromTables

protected int deleteFromTables(String... names)
Convenience method for deleting all rows from the specified tables. Use with caution outside of a transaction!

Parameters:
names - the names of the tables from which to delete
Returns:
the total number of rows deleted from all specified tables

executeSqlScript

protected void executeSqlScript(String sqlResourcePath,
                                boolean continueOnError)
                         throws DataAccessException
Execute the given SQL script. Use with caution outside of a transaction!

The script will normally be loaded by classpath. There should be one statement per line. Any semicolons will be removed. Do not use this method to execute DDL if you expect rollback.

Parameters:
sqlResourcePath - the Spring resource path for the SQL script
continueOnError - whether or not to continue without throwing an exception in the event of an error
Throws:
DataAccessException - if there is an error executing a statement and continueOnError was false
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.test.context.transaction

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.test.context.transaction

Transactional support classes for the Spring TestContext Framework.

See:
Description

Class Summary
TransactionalTestExecutionListener | TestExecutionListener which provides support for executing tests within transactions by using @Transactional and @NotTransactional annotations.
TransactionConfigurationAttributes | Configuration attributes for configuring transactional tests.

Annotation Types Summary
AfterTransaction | Test annotation to indicate that the annotated public void method should be executed after a transaction is ended for test methods configured to run within a transaction via the @Transactional annotation.
BeforeTransaction | Test annotation to indicate that the annotated public void method should be executed before a transaction is started for test methods configured to run within a transaction via the @Transactional annotation.
TransactionConfiguration | TransactionConfiguration defines class-level metadata for configuring transactional tests.

Package org.springframework.test.context.transaction Description

Transactional support classes for the Spring TestContext Framework.


org.springframework.test.context.transaction Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.test.context.transaction

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.test.context.support.AbstractTestExecutionListener (implements org.springframework.test.context.TestExecutionListener)
      • org.springframework.test.context.transaction.TransactionalTestExecutionListener
    • org.springframework.test.context.transaction.TransactionConfigurationAttributes

Annotation Type Hierarchy

  • org.springframework.test.context.transaction.TransactionConfiguration (implements java.lang.annotation.Annotation)
  • org.springframework.test.context.transaction.BeforeTransaction (implements java.lang.annotation.Annotation)
  • org.springframework.test.context.transaction.AfterTransaction (implements java.lang.annotation.Annotation)


TransactionalTestExecutionListener

org.springframework.test.context.transaction
Class TransactionalTestExecutionListener

java.lang.Object
    extended by  org.springframework.test.context.support.AbstractTestExecutionListener
        extended by  org.springframework.test.context.transaction.TransactionalTestExecutionListener
All Implemented Interfaces:
TestExecutionListener
public class TransactionalTestExecutionListener
extends AbstractTestExecutionListener

TestExecutionListener which provides support for executing tests within transactions by using @Transactional and @NotTransactional annotations.

Changes to the database during a test run with @Transactional will be run within a transaction that will, by default, be automatically rolled back after completion of the test; whereas, changes to the database during a test run with @NotTransactional will not be run within a transaction. Similarly, test methods that are not annotated with either @Transactional (at the class or method level) or @NotTransactional will not be run within a transaction.

Transactional commit and rollback behavior can be configured via the class-level @TransactionConfiguration and method-level @Rollback annotations. @TransactionConfiguration also provides configuration of the bean name of the PlatformTransactionManager that is to be used to drive transactions.

When executing transactional tests, it is sometimes useful to be able execute certain set up or tear down code outside of a transaction. TransactionalTestExecutionListener provides such support for methods annotated with @BeforeTransaction and @AfterTransaction.

Since:
2.5
Author:
Sam Brannen, Juergen Hoeller
See Also:
TransactionConfiguration, Transactional, NotTransactional, Rollback, BeforeTransaction, AfterTransaction

Field Summary
protected  TransactionAttributeSource attributeSource
Constructor Summary
TransactionalTestExecutionListener()
Method Summary
void | afterTestMethod(TestContext testContext) If a transaction is currently active for the test method of the supplied test context, this method will end the transaction and run @AfterTransaction methods.
void | beforeTestMethod(TestContext testContext) If the test method of the supplied test context is configured to run within a transaction, this method will run @BeforeTransaction methods and start a new transaction.
protected PlatformTransactionManager | getTransactionManager(TestContext testContext) Get the transaction manager to use for the supplied test context.
protected boolean | isDefaultRollback(TestContext testContext) Determine whether or not to rollback transactions by default for the supplied test context.
protected boolean | isRollback(TestContext testContext) Determine whether or not to rollback transactions for the supplied test context by taking into consideration the default rollback flag and a possible method-level override via the Rollback annotation.
protected void | runAfterTransactionMethods(TestContext testContext) Run all @AfterTransaction methods for the specified test context.
protected void | runBeforeTransactionMethods(TestContext testContext) Run all @BeforeTransaction methods for the specified test context.
Methods inherited from class org.springframework.test.context.support.AbstractTestExecutionListener
afterTestClass, beforeTestClass, prepareTestInstance
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

attributeSource

protected final TransactionAttributeSource attributeSource
Constructor Detail

TransactionalTestExecutionListener

public TransactionalTestExecutionListener()
Method Detail

beforeTestMethod

public void beforeTestMethod(TestContext testContext)
                      throws Exception
If the test method of the supplied test context is configured to run within a transaction, this method will run @BeforeTransaction methods and start a new transaction.

Note that if a @BeforeTransaction method fails, remaining @BeforeTransaction methods will not be invoked, and a transaction will not be started.

Specified by:
beforeTestMethod in interface TestExecutionListener
Overrides:
beforeTestMethod in class AbstractTestExecutionListener
Parameters:
testContext - the test context in which the test method will be executed; never null
Throws:
Exception - allows any exception to propagate
See Also:
Transactional, NotTransactional

afterTestMethod

public void afterTestMethod(TestContext testContext)
                     throws Exception
If a transaction is currently active for the test method of the supplied test context, this method will end the transaction and run @AfterTransaction methods.

@AfterTransaction methods are guaranteed to be invoked even if an error occurs while ending the transaction.

Specified by:
afterTestMethod in interface TestExecutionListener
Overrides:
afterTestMethod in class AbstractTestExecutionListener
Parameters:
testContext - the test context in which the test method was executed; never null
Throws:
Exception - allows any exception to propagate

runBeforeTransactionMethods

protected void runBeforeTransactionMethods(TestContext testContext)
                                    throws Exception
Run all @BeforeTransaction methods for the specified test context. If one of the methods fails, however, the caught exception will be rethrown in a wrapped RuntimeException, and the remaining methods will not be given a chance to execute.

Parameters:
testContext - the current test context
Throws:
Exception

runAfterTransactionMethods

protected void runAfterTransactionMethods(TestContext testContext)
                                   throws Exception
Run all @AfterTransaction methods for the specified test context. If one of the methods fails, the caught exception will be logged as an error, and the remaining methods will be given a chance to execute. After all methods have executed, the first caught exception, if any, will be rethrown.

Parameters:
testContext - the current test context
Throws:
Exception

getTransactionManager

protected final PlatformTransactionManager getTransactionManager(TestContext testContext)
Get the transaction manager to use for the supplied test context.

Parameters:
testContext - the test context for which the transaction manager should be retrieved
Returns:
the transaction manager to use, or null if not found
Throws:
BeansException - if an error occurs while retrieving the transaction manager

isDefaultRollback

protected final boolean isDefaultRollback(TestContext testContext)
                                   throws Exception
Determine whether or not to rollback transactions by default for the supplied test context.

Parameters:
testContext - the test context for which the default rollback flag should be retrieved
Returns:
the default rollback flag for the supplied test context
Throws:
Exception - if an error occurs while determining the default rollback flag

isRollback

protected final boolean isRollback(TestContext testContext)
                            throws Exception
Determine whether or not to rollback transactions for the supplied test context by taking into consideration the default rollback flag and a possible method-level override via the Rollback annotation.

Parameters:
testContext - the test context for which the rollback flag should be retrieved
Returns:
the rollback flag for the supplied test context
Throws:
Exception - if an error occurs while determining the rollback flag
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionConfigurationAttributes

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.test.context.transaction
Class TransactionConfigurationAttributes

java.lang.Object
    extended by  org.springframework.test.context.transaction.TransactionConfigurationAttributes

public class TransactionConfigurationAttributes
extends Object

Configuration attributes for configuring transactional tests.

Since:
2.5
Author:
Sam Brannen, Juergen Hoeller
See Also:
TransactionConfiguration

Constructor Summary
TransactionConfigurationAttributes(String transactionManagerName, boolean defaultRollback)
Construct a new TransactionConfigurationAttributes instance from the supplied arguments.
Method Summary
String | getTransactionManagerName() Get the bean name of the PlatformTransactionManager that is to be used to drive transactions.
boolean | isDefaultRollback() Whether or not transactions should be rolled back by default.
String | toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

TransactionConfigurationAttributes

public TransactionConfigurationAttributes(String transactionManagerName,
                                          boolean defaultRollback)
Construct a new TransactionConfigurationAttributes instance from the supplied arguments.

Parameters:
transactionManagerName - the bean name of the PlatformTransactionManager that is to be used to drive transactions
defaultRollback - whether or not transactions should be rolled back by default
Method Detail

getTransactionManagerName

public final String getTransactionManagerName()
Get the bean name of the PlatformTransactionManager that is to be used to drive transactions.

isDefaultRollback

public final boolean isDefaultRollback()
Whether or not transactions should be rolled back by default.

Returns:
the default rollback flag

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AfterTransaction

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

org.springframework.test.context.transaction
Annotation Type AfterTransaction

@Documented
@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface AfterTransaction

Test annotation to indicate that the annotated public void method should be executed after a transaction is ended for test methods configured to run within a transaction via the @Transactional annotation.

The @AfterTransaction methods of superclasses will be executed after those of the current class.

Since:
2.5
Author:
Sam Brannen
See Also:
Transactional

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT


BeforeTransaction

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.test.context.transaction
Annotation Type BeforeTransaction

@Documented
@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface BeforeTransaction

Test annotation to indicate that the annotated public void method should be executed before a transaction is started for test methods configured to run within a transaction via the @Transactional annotation.

The @BeforeTransaction methods of superclasses will be executed before those of the current class.

Since:
2.5
Author:
Sam Brannen
See Also:
Transactional

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


TransactionConfiguration

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.test.context.transaction
Annotation Type TransactionConfiguration

@Documented
@Inherited
@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface TransactionConfiguration

TransactionConfiguration defines class-level metadata for configuring transactional tests.

Since:
2.5
Author:
Sam Brannen
See Also:
ContextConfiguration, TransactionalTestExecutionListener

Optional Element Summary
boolean | defaultRollback Should transactions be rolled back by default?
String | transactionManager The bean name of the PlatformTransactionManager that is to be used to drive transactions.

transactionManager

public abstract String transactionManager
The bean name of the PlatformTransactionManager that is to be used to drive transactions. This attribute is not required and only needs to be specified explicitly if the bean name of the desired PlatformTransactionManager is not "transactionManager".

NOTE: The XML <tx:annotation-driven> element also refers to a bean named "transactionManager" by default. If you are using both features in combination, make sure to point to the same transaction manager bean - here in @TransactionConfiguration and also in <tx:annotation-driven transaction-manager="...">.

Default:
"transactionManager"

defaultRollback

public abstract boolean defaultRollback
Should transactions be rolled back by default?

Default:
true
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


org.springframework.test.jdbc

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.test.jdbc

Support classes for tests based on JDBC.

See:
Description

Class Summary
JdbcTestUtils | JdbcTestUtils is a collection of JDBC related utility methods for use in unit and integration testing scenarios.
SimpleJdbcTestUtils | A Java-5-based collection of JDBC related utility functions intended to simplify standard database testing scenarios.

Package org.springframework.test.jdbc Description

Support classes for tests based on JDBC.


org.springframework.test.jdbc Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.test.jdbc

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.test.jdbc.JdbcTestUtils
    • org.springframework.test.jdbc.SimpleJdbcTestUtils


JdbcTestUtils

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.test.jdbc
Class JdbcTestUtils

java.lang.Object
    extended by  org.springframework.test.jdbc.JdbcTestUtils

public class JdbcTestUtils
extends Object

JdbcTestUtils is a collection of JDBC related utility methods for use in unit and integration testing scenarios.

Since:
2.5.4
Author:
Thomas Risberg

Constructor Summary
JdbcTestUtils()
Method Summary
static boolean | containsSqlScriptDelimiters(String script, char delim) Does the provided SQL script contain the specified delimiter?
static String | readScript(LineNumberReader lineNumberReader) Read a script from the LineNumberReader and build a String containing the lines.
static void | splitSqlScript(String script, char delim, List<String> statements) Split an SQL script into separate statements delimited with the provided delimiter character.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JdbcTestUtils

public JdbcTestUtils()
Method Detail

readScript

public static String readScript(LineNumberReader lineNumberReader)
                         throws IOException
Read a script from the LineNumberReader and build a String containing the lines.

Parameters:
lineNumberReader - the LineNumberReader containing the script to be processed
Returns:
String containing the script lines
Throws:
IOException

containsSqlScriptDelimiters

public static boolean containsSqlScriptDelimiters(String script,
                                                  char delim)
Does the provided SQL script contain the specified delimiter?

Parameters:
script - the SQL script
delim - character delimiting each statement - typically a ';' character

splitSqlScript

public static void splitSqlScript(String script,
                                  char delim,
                                  List<String> statements)
Split an SQL script into separate statements delimited with the provided delimiter character. Each individual statement will be added to the provided List.

Parameters:
script - the SQL script
delim - character delimiting each statement - typically a ';' character
statements - the List that will contain the individual statements
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


SimpleJdbcTestUtils

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.test.jdbc
Class SimpleJdbcTestUtils

java.lang.Object
    extended by  org.springframework.test.jdbc.SimpleJdbcTestUtils

public abstract class SimpleJdbcTestUtils
extends Object

A Java-5-based collection of JDBC related utility functions intended to simplify standard database testing scenarios.

Since:
2.5
Author:
Sam Brannen, Juergen Hoeller, Thomas Risberg

Constructor Summary
SimpleJdbcTestUtils()
Method Summary
static int | countRowsInTable(SimpleJdbcTemplate simpleJdbcTemplate, String tableName) Count the rows in the given table.
static int | deleteFromTables(SimpleJdbcTemplate simpleJdbcTemplate, String... tableNames) Delete all rows from the specified tables.
static void | executeSqlScript(SimpleJdbcTemplate simpleJdbcTemplate, EncodedResource resource, boolean continueOnError) Execute the given SQL script.
static void | executeSqlScript(SimpleJdbcTemplate simpleJdbcTemplate, Resource resource, boolean continueOnError) Execute the given SQL script.
static void | executeSqlScript(SimpleJdbcTemplate simpleJdbcTemplate, ResourceLoader resourceLoader, String sqlResourcePath, boolean continueOnError) Execute the given SQL script.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleJdbcTestUtils

public SimpleJdbcTestUtils()
Method Detail

countRowsInTable

public static int countRowsInTable(SimpleJdbcTemplate simpleJdbcTemplate,
                                   String tableName)
Count the rows in the given table.

Parameters:
simpleJdbcTemplate - the SimpleJdbcTemplate with which to perform JDBC operations
tableName - table name to count rows in
Returns:
the number of rows in the table

deleteFromTables

public static int deleteFromTables(SimpleJdbcTemplate simpleJdbcTemplate,
                                   String... tableNames)
Delete all rows from the specified tables.

Parameters:
simpleJdbcTemplate - the SimpleJdbcTemplate with which to perform JDBC operations
tableNames - the names of the tables from which to delete
Returns:
the total number of rows deleted from all specified tables

executeSqlScript

public static void executeSqlScript(SimpleJdbcTemplate simpleJdbcTemplate,
                                    ResourceLoader resourceLoader,
                                    String sqlResourcePath,
                                    boolean continueOnError)
                             throws DataAccessException
Execute the given SQL script.

The script will normally be loaded by classpath. There should be one statement per line. Any semicolons will be removed. Do not use this method to execute DDL if you expect rollback.

Parameters:
simpleJdbcTemplate - the SimpleJdbcTemplate with which to perform JDBC operations
resourceLoader - the resource loader (with which to load the SQL script
sqlResourcePath - the Spring resource path for the SQL script
continueOnError - whether or not to continue without throwing an exception in the event of an error
Throws:
DataAccessException - if there is an error executing a statement and continueOnError was false

executeSqlScript

public static void executeSqlScript(SimpleJdbcTemplate simpleJdbcTemplate,
                                    Resource resource,
                                    boolean continueOnError)
                             throws DataAccessException
Execute the given SQL script. The script will normally be loaded by classpath.

Statements should be delimited with a semicolon. If statements are not delimited with a semicolon then there should be one statement per line. Statements are allowed to span lines only if they are delimited with a semicolon.

Do not use this method to execute DDL if you expect rollback.

Parameters:
simpleJdbcTemplate - the SimpleJdbcTemplate with which to perform JDBC operations
resource - the resource to load the SQL script from.
continueOnError - whether or not to continue without throwing an exception in the event of an error.
Throws:
DataAccessException - if there is an error executing a statement and continueOnError was false

executeSqlScript

public static void executeSqlScript(SimpleJdbcTemplate simpleJdbcTemplate,
                                    EncodedResource resource,
                                    boolean continueOnError)
                             throws DataAccessException
Execute the given SQL script.

The script will normally be loaded by classpath. There should be one statement per line. Any semicolons will be removed. Do not use this method to execute DDL if you expect rollback.

Parameters:
simpleJdbcTemplate - the SimpleJdbcTemplate with which to perform JDBC operations
resource - the resource (potentially associated with a specific encoding) to load the SQL script from.
continueOnError - whether or not to continue without throwing an exception in the event of an error.
Throws:
DataAccessException - if there is an error executing a statement and continueOnError was false
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.test.jpa

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.test.jpa

As of Spring 3.0, this package has been deprecated in favor of using the listener-based Spring TestContext Framework.

See:
Description

Class Summary
AbstractAspectjJpaTests | Deprecated. as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)
AbstractJpaTests | Deprecated. as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)

Package org.springframework.test.jpa Description

As of Spring 3.0, this package has been deprecated in favor of using the listener-based Spring TestContext Framework.


org.springframework.test.jpa Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.test.jpa

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • junit.framework.Assert
      • junit.framework.TestCase (implements junit.framework.Test)
        • org.springframework.test.ConditionalTestCase
          • org.springframework.test.AbstractSpringContextTests
            • org.springframework.test.AbstractSingleSpringContextTests
              • org.springframework.test.AbstractDependencyInjectionSpringContextTests
                • org.springframework.test.AbstractTransactionalSpringContextTests
                  • org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
                    • org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests
                      • org.springframework.test.jpa.AbstractJpaTests
                        • org.springframework.test.jpa.AbstractAspectjJpaTests


AbstractAspectjJpaTests

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.test.jpa
Class AbstractAspectjJpaTests

java.lang.Object
    extended by  junit.framework.Assert
        extended by  junit.framework.TestCase
            extended by  org.springframework.test.ConditionalTestCase
                extended by  org.springframework.test.AbstractSpringContextTests
                    extended by  org.springframework.test.AbstractSingleSpringContextTests
                        extended by  org.springframework.test.AbstractDependencyInjectionSpringContextTests
                            extended by  org.springframework.test.AbstractTransactionalSpringContextTests
                                extended by  org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
                                    extended by  org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests
                                        extended by  org.springframework.test.jpa.AbstractJpaTests
                                            extended by  org.springframework.test.jpa.AbstractAspectjJpaTests
All Implemented Interfaces:
junit.framework.Test
Deprecated. as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)

@Deprecated
public abstract class AbstractAspectjJpaTests
extends AbstractJpaTests

Subclass of AbstractJpaTests that activates AspectJ load-time weaving and allows for specifying a custom location for AspectJ's aop.xml file.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller

Field Summary
static String DEFAULT_AOP_XML_LOCATION
Deprecated. Default location of the aop.xml file in the class path: "META-INF/aop.xml"
Fields inherited from class org.springframework.test.jpa.AbstractJpaTests
entityManagerFactory, sharedEntityManager
Fields inherited from class org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests
profileValueSource, simpleJdbcTemplate
Fields inherited from class org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
jdbcTemplate
Fields inherited from class org.springframework.test.AbstractTransactionalSpringContextTests
transactionDefinition, transactionManager, transactionStatus
Fields inherited from class org.springframework.test.AbstractDependencyInjectionSpringContextTests
AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_NO
Fields inherited from class org.springframework.test.AbstractSingleSpringContextTests
applicationContext
Fields inherited from class org.springframework.test.ConditionalTestCase
logger
Constructor Summary
AbstractAspectjJpaTests()
Deprecated.
Method Summary
protected void | customizeResourceOverridingShadowingClassLoader(ClassLoader shadowingClassLoader) Deprecated. Customize the shadowing class loader.
protected String | getActualAopXmlLocation() Deprecated. Return the actual location of the aop.xml file in the class path.
Methods inherited from class org.springframework.test.jpa.AbstractJpaTests
cacheKeys, createContainerManagedEntityManager, createShadowingClassLoader, getActualOrmXmlLocation, runBare, setDirty, setEntityManagerFactory, shouldUseShadowLoader
Methods inherited from class org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests
findUniqueProfileValueSourceFromContext, getTestMethod, isDisabledInThisEnvironment, isRollback, setDataSource
Methods inherited from class org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
countRowsInTable, deleteFromTables, executeSqlScript, getJdbcTemplate, setComplete, setSqlScriptEncoding
Methods inherited from class org.springframework.test.AbstractTransactionalSpringContextTests
endTransaction, isDefaultRollback, onSetUp, onSetUpBeforeTransaction, onSetUpInTransaction, onTearDown, onTearDownAfterTransaction, onTearDownInTransaction, preventTransaction, setDefaultRollback, setTransactionDefinition, setTransactionManager, startNewTransaction
Methods inherited from class org.springframework.test.AbstractDependencyInjectionSpringContextTests
getAutowireMode, injectDependencies, isDependencyCheck, isPopulateProtectedVariables, prepareTestInstance, setAutowireMode, setDependencyCheck, setPopulateProtectedVariables
Methods inherited from class org.springframework.test.AbstractSingleSpringContextTests
contextKey, createApplicationContext, createBeanDefinitionReader, customizeBeanFactory, getApplicationContext, getConfigLocations, getConfigPath, getConfigPaths, getLoadCount, loadContext, loadContextLocations, prepareApplicationContext, setUp, tearDown
Methods inherited from class org.springframework.test.AbstractSpringContextTests
addContext, contextKeyString, getContext, hasCachedContext, isContextKeyEmpty, setDirty
Methods inherited from class org.springframework.test.ConditionalTestCase
getDisabledTestCount, isDisabledInThisEnvironment, recordDisabled
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runTest, setName, toString
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

DEFAULT_AOP_XML_LOCATION

public static final String DEFAULT_AOP_XML_LOCATION
Deprecated.
Default location of the aop.xml file in the class path: "META-INF/aop.xml"

See Also:
Constant Field Values
Constructor Detail

AbstractAspectjJpaTests

public AbstractAspectjJpaTests()
Deprecated.
Method Detail

customizeResourceOverridingShadowingClassLoader

protected void customizeResourceOverridingShadowingClassLoader(ClassLoader shadowingClassLoader)
Deprecated.
Description copied from class: AbstractJpaTests
Customize the shadowing class loader.

Overrides:
customizeResourceOverridingShadowingClassLoader in class AbstractJpaTests
Parameters:
shadowingClassLoader - this parameter is actually of type ResourceOverridingShadowingClassLoader, and can safely to be cast to that type. However, the signature must not be of that type as that would cause the present class loader to load that type.

getActualAopXmlLocation

protected String getActualAopXmlLocation()
Deprecated.
Return the actual location of the aop.xml file in the class path. The default is "META-INF/aop.xml".

Override this method to point to a specific aop.xml file within your test suite, allowing for different config files to co-exist within the same class path.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractJpaTests

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.test.jpa
Class AbstractJpaTests

java.lang.Object
    extended by  junit.framework.Assert
        extended by  junit.framework.TestCase
            extended by  org.springframework.test.ConditionalTestCase
                extended by  org.springframework.test.AbstractSpringContextTests
                    extended by  org.springframework.test.AbstractSingleSpringContextTests
                        extended by  org.springframework.test.AbstractDependencyInjectionSpringContextTests
                            extended by  org.springframework.test.AbstractTransactionalSpringContextTests
                                extended by  org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
                                    extended by  org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests
                                        extended by  org.springframework.test.jpa.AbstractJpaTests
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
AbstractAspectjJpaTests
Deprecated. as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)

@Deprecated
public abstract class AbstractJpaTests
extends AbstractAnnotationAwareTransactionalTests

Convenient support class for JPA-related tests. Offers the same contract as AbstractTransactionalDataSourceSpringContextTests and equally good performance, even when performing the instrumentation required by the JPA specification.

Exposes an EntityManagerFactory and a shared EntityManager. Requires an EntityManagerFactory to be injected, plus the DataSource and JpaTransactionManager through the superclass.

When using Xerces, make sure a post 2.0.2 version is available on the classpath to avoid a critical bug that leads to StackOverflow. Maven users are likely to encounter this problem since 2.0.2 is used by default.

A workaround is to explicitly specify the Xerces version inside the Maven POM:

 <dependency>
   <groupId>xerces</groupId>
     <artifactId>xercesImpl</artifactId>
   <version>2.8.1</version>
 </dependency>

Since:
2.0
Author:
Rod Johnson, Rob Harrop, Juergen Hoeller

Field Summary
protected javax.persistence.EntityManagerFactory | entityManagerFactory Deprecated.
protected javax.persistence.EntityManager | sharedEntityManager Deprecated. Subclasses can use this in test cases.
Fields inherited from class org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests
profileValueSource, simpleJdbcTemplate
Fields inherited from class org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
jdbcTemplate
Fields inherited from class org.springframework.test.AbstractTransactionalSpringContextTests
transactionDefinition, transactionManager, transactionStatus
Fields inherited from class org.springframework.test.AbstractDependencyInjectionSpringContextTests
AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_NO
Fields inherited from class org.springframework.test.AbstractSingleSpringContextTests
applicationContext
Fields inherited from class org.springframework.test.ConditionalTestCase
logger
Constructor Summary
AbstractJpaTests()
Deprecated.
Method Summary
protected  String cacheKeys()
Deprecated.
protected  javax.persistence.EntityManager createContainerManagedEntityManager()
Deprecated. Create an EntityManager that will always automatically enlist itself in current transactions, in contrast to an EntityManager returned by EntityManagerFactory.createEntityManager() (which requires an explicit joinTransaction() call).
protected  ClassLoader createShadowingClassLoader(ClassLoader classLoader)
Deprecated. NB: This method must not have a return type of ShadowingClassLoader as that would cause that class to be loaded eagerly when this test case loads, creating verify errors at runtime.
protected  void customizeResourceOverridingShadowingClassLoader(ClassLoader shadowingClassLoader)
Deprecated. Customize the shadowing class loader.
protected  String getActualOrmXmlLocation()
Deprecated. Subclasses can override this to return the real location path for orm.xml or null if they do not wish to find any orm.xml
 void runBare()
Deprecated. Overridden to populate transaction definition from annotations.
 void setDirty()
Deprecated. Called to say that the "applicationContext" instance variable is dirty and should be reloaded.
 void setEntityManagerFactory(javax.persistence.EntityManagerFactory entityManagerFactory)
Deprecated.
protected  boolean shouldUseShadowLoader()
Deprecated. Subclasses should override this method if they wish to disable shadow class loading.
Methods inherited from class org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests
findUniqueProfileValueSourceFromContext, getTestMethod, isDisabledInThisEnvironment, isRollback, setDataSource
Methods inherited from class org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
countRowsInTable, deleteFromTables, executeSqlScript, getJdbcTemplate, setComplete, setSqlScriptEncoding
Methods inherited from class org.springframework.test.AbstractTransactionalSpringContextTests
endTransaction, isDefaultRollback, onSetUp, onSetUpBeforeTransaction, onSetUpInTransaction, onTearDown, onTearDownAfterTransaction, onTearDownInTransaction, preventTransaction, setDefaultRollback, setTransactionDefinition, setTransactionManager, startNewTransaction
Methods inherited from class org.springframework.test.AbstractDependencyInjectionSpringContextTests
getAutowireMode, injectDependencies, isDependencyCheck, isPopulateProtectedVariables, prepareTestInstance, setAutowireMode, setDependencyCheck, setPopulateProtectedVariables
Methods inherited from class org.springframework.test.AbstractSingleSpringContextTests
contextKey, createApplicationContext, createBeanDefinitionReader, customizeBeanFactory, getApplicationContext, getConfigLocations, getConfigPath, getConfigPaths, getLoadCount, loadContext, loadContextLocations, prepareApplicationContext, setUp, tearDown
Methods inherited from class org.springframework.test.AbstractSpringContextTests
addContext, contextKeyString, getContext, hasCachedContext, isContextKeyEmpty, setDirty
Methods inherited from class org.springframework.test.ConditionalTestCase
getDisabledTestCount, isDisabledInThisEnvironment, recordDisabled
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runTest, setName, toString
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

entityManagerFactory

protected javax.persistence.EntityManagerFactory entityManagerFactory
Deprecated.

sharedEntityManager

protected javax.persistence.EntityManager sharedEntityManager
Deprecated.
Subclasses can use this in test cases. It will participate in any current transaction.

Constructor Detail

AbstractJpaTests

public AbstractJpaTests()
Deprecated.
Method Detail

setEntityManagerFactory

public void setEntityManagerFactory(javax.persistence.EntityManagerFactory entityManagerFactory)
Deprecated.

createContainerManagedEntityManager

protected javax.persistence.EntityManager createContainerManagedEntityManager()
Deprecated.
Create an EntityManager that will always automatically enlist itself in current transactions, in contrast to an EntityManager returned by EntityManagerFactory.createEntityManager() (which requires an explicit joinTransaction() call).

shouldUseShadowLoader

protected boolean shouldUseShadowLoader()
Deprecated.
Subclasses should override this method if they wish to disable shadow class loading.

The default implementation deactivates shadow class loading if Spring's InstrumentationSavingAgent has been configured on VM startup.

setDirty

public void setDirty()
Deprecated.
Description copied from class: AbstractSingleSpringContextTests
Called to say that the "applicationContext" instance variable is dirty and should be reloaded. We need to do this if a test has modified the context (for example, by replacing a bean definition).

Overrides:
setDirty in class AbstractSingleSpringContextTests

runBare

public void runBare()
             throws Throwable
Deprecated.
Description copied from class: AbstractAnnotationAwareTransactionalTests
Overridden to populate transaction definition from annotations.

Overrides:
runBare in class AbstractAnnotationAwareTransactionalTests
Throws:
Throwable

cacheKeys

protected String cacheKeys()
Deprecated.

createShadowingClassLoader

protected ClassLoader createShadowingClassLoader(ClassLoader classLoader)
Deprecated.
NB: This method must not have a return type of ShadowingClassLoader as that would cause that class to be loaded eagerly when this test case loads, creating verify errors at runtime.

customizeResourceOverridingShadowingClassLoader

protected void customizeResourceOverridingShadowingClassLoader(ClassLoader shadowingClassLoader)
Deprecated.
Customize the shadowing class loader.

Parameters:
shadowingClassLoader - this parameter is actually of type ResourceOverridingShadowingClassLoader, and can safely to be cast to that type. However, the signature must not be of that type as that would cause the present class loader to load that type.

getActualOrmXmlLocation

protected String getActualOrmXmlLocation()
Deprecated.
Subclasses can override this to return the real location path for orm.xml or null if they do not wish to find any orm.xml

Returns:
orm.xml path or null to hide any such file
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.test.util

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.test.util

Helper classes for unit tests with reflective needs.

See:
Description

Class Summary
ReflectionTestUtils ReflectionTestUtils is a collection of reflection-based utility methods for use in unit and integration testing scenarios.

Package org.springframework.test.util Description

Helper classes for unit tests with reflective needs.


org.springframework.test.util Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.test.util

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.test.util.ReflectionTestUtils


ReflectionTestUtils

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.test.util
Class ReflectionTestUtils

java.lang.Object
    extended by  org.springframework.test.util.ReflectionTestUtils

public class ReflectionTestUtils
extends Object

ReflectionTestUtils is a collection of reflection-based utility methods for use in unit and integration testing scenarios.

There are often situations in which it would be beneficial to be able to set a non-public field or invoke a non-public setter method when testing code involving, for example:

  • ORM frameworks such as JPA and Hibernate which condone the usage of private or protected field access as opposed to public setter methods for properties in a domain entity.
  • Spring's support for annotations such as @Autowired and @Resource which provides dependency injection for private or protected fields, setter methods, and configuration methods.

Since:
2.5
Author:
Sam Brannen, Juergen Hoeller
See Also:
ReflectionUtils

Constructor Summary
ReflectionTestUtils()
Method Summary
static Object | getField(Object target, String name) Get the field with the given name from the provided target object.
static Object | invokeGetterMethod(Object target, String name) Invoke the getter method with the given name on the supplied target object with the supplied value.
static void | invokeSetterMethod(Object target, String name, Object value) Invoke the setter method with the given name on the supplied target object with the supplied value.
static void | invokeSetterMethod(Object target, String name, Object value, Class<?> type) Invoke the setter method with the given name on the supplied target object with the supplied value.
static void | setField(Object target, String name, Object value) Set the field with the given name on the provided target object to the supplied value.
static void | setField(Object target, String name, Object value, Class<?> type) Set the field with the given name on the provided target object to the supplied value.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ReflectionTestUtils

public ReflectionTestUtils()
Method Detail

setField

public static void setField(Object target,
                            String name,
                            Object value)
Set the field with the given name on the provided target object to the supplied value.

This method traverses the class hierarchy in search of the desired field. In addition, an attempt will be made to make non-public fields accessible, thus allowing one to set protected, private, and package-private fields.

Parameters:
target - the target object on which to set the field
name - the name of the field to set
value - the value to set
See Also:
ReflectionUtils.findField(Class, String, Class),
ReflectionUtils.makeAccessible(Field),
ReflectionUtils.setField(Field, Object, Object)

setField

public static void setField(Object target,
                            String name,
                            Object value,
                            Class<?> type)
Set the field with the given name on the provided target object to the supplied value.

This method traverses the class hierarchy in search of the desired field. In addition, an attempt will be made to make non-public fields accessible, thus allowing one to set protected, private, and package-private fields.

Parameters:
target - the target object on which to set the field
name - the name of the field to set
value - the value to set
type - the type of the field (may be null)
See Also:
ReflectionUtils.findField(Class, String, Class),
ReflectionUtils.makeAccessible(Field),
ReflectionUtils.setField(Field, Object, Object)

getField

public static Object getField(Object target,
                              String name)
Get the field with the given name from the provided target object.

This method traverses the class hierarchy in search of the desired field. In addition, an attempt will be made to make non-public fields accessible, thus allowing one to get protected, private, and package-private fields.

Parameters:
target - the target object on which to set the field
name - the name of the field to get
Returns:
the field's current value
See Also:
ReflectionUtils.findField(Class, String, Class),
ReflectionUtils.makeAccessible(Field),
ReflectionUtils.setField(Field, Object, Object)

invokeSetterMethod

public static void invokeSetterMethod(Object target,
                                      String name,
                                      Object value)
Invoke the setter method with the given name on the supplied target object with the supplied value.

This method traverses the class hierarchy in search of the desired method. In addition, an attempt will be made to make non- public methods accessible, thus allowing one to invoke protected, private, and package-private setter methods.

In addition, this method supports JavaBean-style property names. For example, if you wish to set the name property on the target object, you may pass either "name" or "setName" as the method name.

Parameters:
target - the target object on which to invoke the specified setter method
name - the name of the setter method to invoke or the corresponding property name
value - the value to provide to the setter method
See Also:
ReflectionUtils.findMethod(Class, String, Class[]),
ReflectionUtils.makeAccessible(Method),
ReflectionUtils.invokeMethod(Method, Object, Object[])

invokeSetterMethod

public static void invokeSetterMethod(Object target,
                                      String name,
                                      Object value,
                                      Class<?> type)
Invoke the setter method with the given name on the supplied target object with the supplied value.

This method traverses the class hierarchy in search of the desired method. In addition, an attempt will be made to make non- public methods accessible, thus allowing one to invoke protected, private, and package-private setter methods.

In addition, this method supports JavaBean-style property names. For example, if you wish to set the name property on the target object, you may pass either "name" or "setName" as the method name.

Parameters:
target - the target object on which to invoke the specified setter method
name - the name of the setter method to invoke or the corresponding property name
value - the value to provide to the setter method
type - the formal parameter type declared by the setter method
See Also:
ReflectionUtils.findMethod(Class, String, Class[]),
ReflectionUtils.makeAccessible(Method),
ReflectionUtils.invokeMethod(Method, Object, Object[])

invokeGetterMethod

public static Object invokeGetterMethod(Object target,
                                        String name)
Invoke the getter method with the given name on the supplied target object with the supplied value.

This method traverses the class hierarchy in search of the desired method. In addition, an attempt will be made to make non- public methods accessible, thus allowing one to invoke protected, private, and package-private getter methods.

In addition, this method supports JavaBean-style property names. For example, if you wish to get the name property on the target object, you may pass either "name" or "getName" as the method name.

Parameters:
target - the target object on which to invoke the specified getter method
name - the name of the getter method to invoke or the corresponding property name
Returns:
the value returned from the invocation
See Also:
ReflectionUtils.findMethod(Class, String, Class[]),
ReflectionUtils.makeAccessible(Method),
ReflectionUtils.invokeMethod(Method, Object, Object[])
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.test.web

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.test.web

Helper classes for unit tests based on Spring's web support.

See:
Description

Class Summary
AbstractModelAndViewTests | Deprecated. as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests) or ModelAndViewAssert with JUnit 4 and TestNG.
ModelAndViewAssert | A collection of assertions intended to simplify testing scenarios dealing with Spring Web MVC ModelAndView objects.

Package org.springframework.test.web Description

Helper classes for unit tests based on Spring's web support.


org.springframework.test.web Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.test.web

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • junit.framework.Assert
      • junit.framework.TestCase (implements junit.framework.Test)
        • org.springframework.test.web.AbstractModelAndViewTests
    • org.springframework.test.web.ModelAndViewAssert


AbstractModelAndViewTests

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.test.web
Class AbstractModelAndViewTests

java.lang.Object
    extended by  junit.framework.Assert
        extended by  junit.framework.TestCase
            extended by  org.springframework.test.web.AbstractModelAndViewTests
All Implemented Interfaces:
junit.framework.Test
Deprecated. as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests) or ModelAndViewAssert with JUnit 4 and TestNG.

@Deprecated
public abstract class AbstractModelAndViewTests
extends junit.framework.TestCase

Convenient JUnit 3.8 base class for tests dealing with Spring Web MVC ModelAndView objects.

All assert*() methods throw AssertionFailedErrors.

Consider the use of ModelAndViewAssert with JUnit 4 and TestNG.

Since:
2.0
Author:
Alef Arendsen, Bram Smeets, Sam Brannen
See Also:
ModelAndView, ModelAndViewAssert

Constructor Summary
AbstractModelAndViewTests()
Deprecated.
Method Summary
protected
<T> T
assertAndReturnModelAttributeOfType(ModelAndView mav, String modelName, Class<T> expectedType)
Deprecated. Checks whether the model value under the given modelName exists and checks it type, based on the expectedType.
protected  void assertCompareListModelAttribute(ModelAndView mav, String modelName, List expectedList)
Deprecated. Compare each individual entry in a list, without first sorting the lists.
protected  void assertModelAttributeAvailable(ModelAndView mav, String modelName)
Deprecated. Assert whether or not a model attribute is available.
protected  void assertModelAttributeValue(ModelAndView mav, String modelName, Object expectedValue)
Deprecated. Compare a given expectedValue to the value from the model bound under the given modelName.
protected  void assertModelAttributeValues(ModelAndView mav, Map<String,Object> expectedModel)
Deprecated. Inspect the expectedModel to see if all elements in the model appear and are equal.
protected  void assertSortAndCompareListModelAttribute(ModelAndView mav, String modelName, List expectedList, Comparator comparator)
Deprecated. Compare each individual entry in a list after having sorted both lists (optionally using a comparator).
protected  void assertViewName(ModelAndView mav, String expectedName)
Deprecated. Check to see if the view name in the ModelAndView matches the given expectedName.
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AbstractModelAndViewTests

public AbstractModelAndViewTests()
Deprecated.
Method Detail

assertAndReturnModelAttributeOfType

protected <T> T assertAndReturnModelAttributeOfType(ModelAndView mav,
                                                    String modelName,
                                                    Class<T> expectedType)
Deprecated.
Checks whether the model value under the given modelName exists and checks it type, based on the expectedType. If the model entry exists and the type matches, the model value is returned.

Parameters:
mav - ModelAndView to test against (never null)
modelName - name of the object to add to the model (never null)
expectedType - expected type of the model value
Returns:
the model value

assertCompareListModelAttribute

protected void assertCompareListModelAttribute(ModelAndView mav,
                                               String modelName,
                                               List expectedList)
Deprecated.
Compare each individual entry in a list, without first sorting the lists.

Parameters:
mav - ModelAndView to test against (never null)
modelName - name of the object to add to the model (never null)
expectedList - the expected list

assertModelAttributeAvailable

protected void assertModelAttributeAvailable(ModelAndView mav,
                                             String modelName)
Deprecated.
Assert whether or not a model attribute is available.

Parameters:
mav - ModelAndView to test against (never null)
modelName - name of the object to add to the model (never null)

assertModelAttributeValue

protected void assertModelAttributeValue(ModelAndView mav,
                                         String modelName,
                                         Object expectedValue)
Deprecated.
Compare a given expectedValue to the value from the model bound under the given modelName.

Parameters:
mav - ModelAndView to test against (never null)
modelName - name of the object to add to the model (never null)
expectedValue - the model value

assertModelAttributeValues

protected void assertModelAttributeValues(ModelAndView mav,
                                          Map<String,Object> expectedModel)
Deprecated.
Inspect the expectedModel to see if all elements in the model appear and are equal.

Parameters:
mav - ModelAndView to test against (never null)
expectedModel - the expected model

assertSortAndCompareListModelAttribute

protected void assertSortAndCompareListModelAttribute(ModelAndView mav,
                                                      String modelName,
                                                      List expectedList,
                                                      Comparator comparator)
Deprecated.
Compare each individual entry in a list after having sorted both lists (optionally using a comparator).

Parameters:
mav - ModelAndView to test against (never null)
modelName - name of the object to add to the model (never null)
expectedList - the expected list
comparator - the comparator to use (may be null). If not specifying the comparator, both lists will be sorted not using any comparator.

assertViewName

protected void assertViewName(ModelAndView mav,
                              String expectedName)
Deprecated.
Check to see if the view name in the ModelAndView matches the given expectedName.

Parameters:
mav - ModelAndView to test against (never null)
expectedName - the name of the model value
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ModelAndViewAssert

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.test.web
Class ModelAndViewAssert

java.lang.Object
    extended by  org.springframework.test.web.ModelAndViewAssert

public abstract class ModelAndViewAssert
extends Object

A collection of assertions intended to simplify testing scenarios dealing with Spring Web MVC ModelAndView objects.

Intended for use with JUnit 4 and TestNG. All assert*() methods throw AssertionErrors.

Since:
2.5
Author:
Sam Brannen, Alef Arendsen, Bram Smeets
See Also:
ModelAndView

Constructor Summary
ModelAndViewAssert()
Method Summary
static
<T> T
assertAndReturnModelAttributeOfType(ModelAndView mav, String modelName, Class<T> expectedType)
Checks whether the model value under the given modelName exists and checks it type, based on the expectedType.
static void assertCompareListModelAttribute(ModelAndView mav, String modelName, List expectedList)
Compare each individual entry in a list, without first sorting the lists.
static void assertModelAttributeAvailable(ModelAndView mav, String modelName)
Assert whether or not a model attribute is available.
static void assertModelAttributeValue(ModelAndView mav, String modelName, Object expectedValue)
Compare a given expectedValue to the value from the model bound under the given modelName.
static void assertModelAttributeValues(ModelAndView mav, Map<String,Object> expectedModel)
Inspect the expectedModel to see if all elements in the model appear and are equal.
static void assertSortAndCompareListModelAttribute(ModelAndView mav, String modelName, List expectedList, Comparator comparator)
Compare each individual entry in a list after having sorted both lists (optionally using a comparator).
static void assertViewName(ModelAndView mav, String expectedName)
Check to see if the view name in the ModelAndView matches the given expectedName.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ModelAndViewAssert

public ModelAndViewAssert()
Method Detail

assertAndReturnModelAttributeOfType

public static <T> T assertAndReturnModelAttributeOfType(ModelAndView mav,
                                                        String modelName,
                                                        Class<T> expectedType)
Checks whether the model value under the given modelName exists and checks it type, based on the expectedType. If the model entry exists and the type matches, the model value is returned.

Parameters:
mav - ModelAndView to test against (never null)
modelName - name of the object to add to the model (never null)
expectedType - expected type of the model value
Returns:
the model value

assertCompareListModelAttribute

public static void assertCompareListModelAttribute(ModelAndView mav,
                                                   String modelName,
                                                   List expectedList)
Compare each individual entry in a list, without first sorting the lists.

Parameters:
mav - ModelAndView to test against (never null)
modelName - name of the object to add to the model (never null)
expectedList - the expected list

assertModelAttributeAvailable

public static void assertModelAttributeAvailable(ModelAndView mav,
                                                 String modelName)
Assert whether or not a model attribute is available.

Parameters:
mav - ModelAndView to test against (never null)
modelName - name of the object to add to the model (never null)

assertModelAttributeValue

public static void assertModelAttributeValue(ModelAndView mav,
                                             String modelName,
                                             Object expectedValue)
Compare a given expectedValue to the value from the model bound under the given modelName.

Parameters:
mav - ModelAndView to test against (never null)
modelName - name of the object to add to the model (never null)
expectedValue - the model value

assertModelAttributeValues

public static void assertModelAttributeValues(ModelAndView mav,
                                              Map<String,Object> expectedModel)
Inspect the expectedModel to see if all elements in the model appear and are equal.

Parameters:
mav - ModelAndView to test against (never null)
expectedModel - the expected model

assertSortAndCompareListModelAttribute

public static void assertSortAndCompareListModelAttribute(ModelAndView mav,
                                                          String modelName,
                                                          List expectedList,
                                                          Comparator comparator)
Compare each individual entry in a list after having sorted both lists (optionally using a comparator).

Parameters:
mav - ModelAndView to test against (never null)
modelName - name of the object to add to the model (never null)
expectedList - the expected list
comparator - the comparator to use (may be null). If not specifying the comparator, both lists will be sorted not using any comparator.

assertViewName

public static void assertViewName(ModelAndView mav,
                                  String expectedName)
Check to see if the view name in the ModelAndView matches the given expectedName.

Parameters:
mav - ModelAndView to test against (never null)
expectedName - the name of the model value
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.transaction

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.transaction

Exception hierarchy for Spring's transaction infrastructure, independent of any specific transaction management system.

See:
Description

Interface Summary
PlatformTransactionManager | This is the central interface in Spring's transaction infrastructure.
SavepointManager | Interface that specifies an API to programmatically manage transaction savepoints in a generic fashion.
TransactionDefinition | Interface that defines Spring-compliant transaction properties.
TransactionStatus | Representation of the status of a transaction.

Exception Summary
CannotCreateTransactionException | Exception thrown when a transaction can't be created using an underlying transaction API such as JTA.
HeuristicCompletionException | Exception that represents a transaction failure caused by a heuristic decision on the side of the transaction coordinator.
IllegalTransactionStateException | Exception thrown when the existence or non-existence of a transaction amounts to an illegal state according to the transaction propagation behavior that applies.
InvalidIsolationLevelException | Exception that gets thrown when an invalid isolation level is specified, i.e.
InvalidTimeoutException | Exception that gets thrown when an invalid timeout is specified, that is, the specified timeout valid is out of range or the transaction manager implementation doesn't support timeouts.
NestedTransactionNotSupportedException | Exception thrown when attempting to work with a nested transaction but nested transactions are not supported by the underlying backend.
NoTransactionException | Exception thrown when an operation is attempted that relies on an existing transaction (such as setting rollback status) and there is no existing transaction.
TransactionException | Superclass for all transaction exceptions.
TransactionSuspensionNotSupportedException | Exception thrown when attempting to suspend an existing transaction but transaction suspension is not supported by the underlying backend.
TransactionSystemException | Exception thrown when a general transaction system error is encountered, like on commit or rollback.
TransactionTimedOutException | Exception to be thrown when a transaction has timed out.
TransactionUsageException | Superclass for exceptions caused by inappropriate usage of a Spring transaction API.
UnexpectedRollbackException | Thrown when an attempt to commit a transaction resulted in an unexpected rollback.

Package org.springframework.transaction Description

Exception hierarchy for Spring's transaction infrastructure, independent of any specific transaction management system. Contains transaction manager, definition, and status interfaces.


org.springframework.transaction Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.transaction

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.transaction.TransactionException
              • org.springframework.transaction.CannotCreateTransactionException
                • org.springframework.transaction.NestedTransactionNotSupportedException
                • org.springframework.transaction.TransactionSuspensionNotSupportedException
              • org.springframework.transaction.HeuristicCompletionException
              • org.springframework.transaction.TransactionSystemException
              • org.springframework.transaction.TransactionTimedOutException
              • org.springframework.transaction.TransactionUsageException
                • org.springframework.transaction.IllegalTransactionStateException
                • org.springframework.transaction.InvalidIsolationLevelException
                • org.springframework.transaction.InvalidTimeoutException
                • org.springframework.transaction.NoTransactionException
              • org.springframework.transaction.UnexpectedRollbackException

Interface Hierarchy

  • org.springframework.transaction.PlatformTransactionManager
  • org.springframework.transaction.SavepointManager
    • org.springframework.transaction.TransactionStatus
  • org.springframework.transaction.TransactionDefinition


PlatformTransactionManager

org.springframework.transaction
Interface PlatformTransactionManager

All Known Subinterfaces:
CallbackPreferringPlatformTransactionManager, ResourceTransactionManager
All Known Implementing Classes:
AbstractPlatformTransactionManager, CciLocalTransactionManager, DataSourceTransactionManager, HibernateTransactionManager, JdoTransactionManager, JmsTransactionManager, JmsTransactionManager102, JpaTransactionManager, JtaTransactionManager, OC4JJtaTransactionManager, WebLogicJtaTransactionManager, WebSphereUowTransactionManager
public interface PlatformTransactionManager

This is the central interface in Spring's transaction infrastructure. Applications can use this directly, but it is not primarily meant as API: Typically, applications will work with either TransactionTemplate or declarative transaction demarcation through AOP.

For implementors, it is recommended to derive from the provided AbstractPlatformTransactionManager class, which pre-implements the defined propagation behavior and takes care of transaction synchronization handling. Subclasses have to implement template methods for specific states of the underlying transaction, for example: begin, suspend, resume, commit.

The default implementations of this strategy interface are JtaTransactionManager and DataSourceTransactionManager, which can serve as an implementation guide for other transaction strategies.

Since:
16.05.2003
Author:
Rod Johnson, Juergen Hoeller
See Also:
TransactionTemplate, TransactionInterceptor, TransactionProxyFactoryBean

Method Summary
void | commit(TransactionStatus status) Commit the given transaction, with regard to its status.
TransactionStatus | getTransaction(TransactionDefinition definition) Return a currently active transaction or create a new one, according to the specified propagation behavior.
void | rollback(TransactionStatus status) Perform a rollback of the given transaction.

Method Detail

getTransaction

TransactionStatus getTransaction(TransactionDefinition definition)
                                 throws TransactionException
Return a currently active transaction or create a new one, according to the specified propagation behavior.

Note that parameters like isolation level or timeout will only be applied to new transactions, and thus be ignored when participating in active ones.

Furthermore, not all transaction definition settings will be supported by every transaction manager: A proper transaction manager implementation should throw an exception when unsupported settings are encountered.

An exception to the above rule is the read-only flag, which should be ignored if no explicit read-only mode is supported. Essentially, the read-only flag is just a hint for potential optimization.

Parameters:
definition - TransactionDefinition instance (can be null for defaults), describing propagation behavior, isolation level, timeout etc.
Returns:
transaction status object representing the new or current transaction
Throws:
TransactionException - in case of lookup, creation, or system errors
IllegalTransactionStateException - if the given transaction definition cannot be executed (for example, if a currently active transaction is in conflict with the specified propagation behavior)
See Also:
TransactionDefinition.getPropagationBehavior(),
TransactionDefinition.getIsolationLevel(),
TransactionDefinition.getTimeout(),
TransactionDefinition.isReadOnly()

commit

void commit(TransactionStatus status)
            throws TransactionException
Commit the given transaction, with regard to its status. If the transaction has been marked rollback-only programmatically, perform a rollback.

If the transaction wasn't a new one, omit the commit for proper participation in the surrounding transaction. If a previous transaction has been suspended to be able to create a new one, resume the previous transaction after committing the new one.

Note that when the commit call completes, no matter if normally or throwing an exception, the transaction must be fully completed and cleaned up. No rollback call should be expected in such a case.

If this method throws an exception other than a TransactionException, then some before-commit error caused the commit attempt to fail. For example, an O/R Mapping tool might have tried to flush changes to the database right before commit, with the resulting DataAccessException causing the transaction to fail. The original exception will be propagated to the caller of this commit method in such a case.

Parameters:
status - object returned by the getTransaction method
Throws:
UnexpectedRollbackException - in case of an unexpected rollback that the transaction coordinator initiated
HeuristicCompletionException - in case of a transaction failure caused by a heuristic decision on the side of the transaction coordinator
TransactionSystemException - in case of commit or system errors (typically caused by fundamental resource failures)
IllegalTransactionStateException - if the given transaction is already completed (that is, committed or rolled back)
TransactionException
See Also:
TransactionStatus.setRollbackOnly()

rollback

void rollback(TransactionStatus status)
              throws TransactionException
Perform a rollback of the given transaction.

If the transaction wasn't a new one, just set it rollback-only for proper participation in the surrounding transaction. If a previous transaction has been suspended to be able to create a new one, resume the previous transaction after rolling back the new one.

Do not call rollback on a transaction if commit threw an exception. The transaction will already have been completed and cleaned up when commit returns, even in case of a commit exception. Consequently, a rollback call after commit failure will lead to an IllegalTransactionStateException.

Parameters:
status - object returned by the getTransaction method
Throws:
TransactionSystemException - in case of rollback or system errors (typically caused by fundamental resource failures)
IllegalTransactionStateException - if the given transaction is already completed (that is, committed or rolled back)
TransactionException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SavepointManager

org.springframework.transaction
Interface SavepointManager

All Known Subinterfaces:
TransactionStatus
All Known Implementing Classes:
AbstractTransactionStatus, DefaultTransactionStatus, JdbcTransactionObjectSupport, SimpleTransactionStatus
public interface SavepointManager

Interface that specifies an API to programmatically manage transaction savepoints in a generic fashion. Extended by TransactionStatus to expose savepoint management functionality for a specific transaction.

Note that savepoints can only work within an active transaction. Just use this programmatic savepoint handling for advanced needs; else, a subtransaction with PROPAGATION_NESTED is preferable.

This interface is inspired by JDBC 3.0's Savepoint mechanism but is independent from any specific persistence technology.

Since:
1.1
Author:
Juergen Hoeller
See Also:
TransactionStatus, TransactionDefinition.PROPAGATION_NESTED, Savepoint

Method Summary
Object | createSavepoint() Create a new savepoint.
void | releaseSavepoint(Object savepoint) Explicitly release the given savepoint.
void | rollbackToSavepoint(Object savepoint) Roll back to the given savepoint.

Method Detail

createSavepoint

Object createSavepoint()
                       throws TransactionException
Create a new savepoint. You can roll back to a specific savepoint via rollbackToSavepoint, and explicitly release a savepoint that you don't need anymore via releaseSavepoint.

Note that most transaction managers will automatically release savepoints at transaction completion.

Returns:
a savepoint object, to be passed into rollbackToSavepoint or releaseSavepoint
Throws:
NestedTransactionNotSupportedException - if the underlying transaction does not support savepoints
TransactionException - if the savepoint could not be created, for example because the transaction is not in an appropriate state
See Also:
Connection.setSavepoint()

rollbackToSavepoint

void rollbackToSavepoint(Object savepoint)
                         throws TransactionException
Roll back to the given savepoint. The savepoint will be automatically released afterwards.

Parameters:
savepoint - the savepoint to roll back to
Throws:
NestedTransactionNotSupportedException - if the underlying transaction does not support savepoints
TransactionException - if the rollback failed
See Also:
Connection.rollback(java.sql.Savepoint)

releaseSavepoint

void releaseSavepoint(Object savepoint)
                      throws TransactionException
Explicitly release the given savepoint.

Note that most transaction managers will automatically release savepoints at transaction completion.

Implementations should fail as silently as possible if proper resource cleanup will still happen at transaction completion.

Parameters:
savepoint - the savepoint to release
Throws:
NestedTransactionNotSupportedException - if the underlying transaction does not support savepoints
TransactionException - if the release failed
See Also:
Connection.releaseSavepoint(java.sql.Savepoint)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionDefinition

org.springframework.transaction
Interface TransactionDefinition

All Known Subinterfaces:
TransactionAttribute
All Known Implementing Classes:
DefaultTransactionAttribute, DefaultTransactionDefinition, DelegatingTransactionAttribute, DelegatingTransactionDefinition, RuleBasedTransactionAttribute, TransactionTemplate
public interface TransactionDefinition

Interface that defines Spring-compliant transaction properties. Based on the propagation behavior definitions analogous to EJB CMT attributes.

Note that isolation level and timeout settings will not get applied unless an actual new transaction gets started. As only PROPAGATION_REQUIRED, PROPAGATION_REQUIRES_NEW and PROPAGATION_NESTED can cause that, it usually doesn't make sense to specify those settings in other cases. Furthermore, be aware that not all transaction managers will support those advanced features and thus might throw corresponding exceptions when given non-default values.

The read-only flag applies to any transaction context, whether backed by an actual resource transaction or operating non-transactionally at the resource level. In the latter case, the flag will only apply to managed resources within the application, such as a Hibernate Session.

Since:
08.05.2003
Author:
Juergen Hoeller
See Also:
PlatformTransactionManager.getTransaction(TransactionDefinition), DefaultTransactionDefinition, TransactionAttribute

Field Summary
static int | ISOLATION_DEFAULT Use the default isolation level of the underlying datastore.
static int | ISOLATION_READ_COMMITTED Indicates that dirty reads are prevented; non-repeatable reads and phantom reads can occur.
static int | ISOLATION_READ_UNCOMMITTED Indicates that dirty reads, non-repeatable reads and phantom reads can occur.
static int | ISOLATION_REPEATABLE_READ Indicates that dirty reads and non-repeatable reads are prevented; phantom reads can occur.
static int | ISOLATION_SERIALIZABLE Indicates that dirty reads, non-repeatable reads and phantom reads are prevented.
static int | PROPAGATION_MANDATORY Support a current transaction; throw an exception if no current transaction exists.
static int | PROPAGATION_NESTED Execute within a nested transaction if a current transaction exists, behave like PROPAGATION_REQUIRED else.
static int | PROPAGATION_NEVER Do not support a current transaction; throw an exception if a current transaction exists.
static int | PROPAGATION_NOT_SUPPORTED Do not support a current transaction; rather always execute non-transactionally.
static int | PROPAGATION_REQUIRED Support a current transaction; create a new one if none exists.
static int | PROPAGATION_REQUIRES_NEW Create a new transaction, suspending the current transaction if one exists.
static int | PROPAGATION_SUPPORTS Support a current transaction; execute non-transactionally if none exists.
static int | TIMEOUT_DEFAULT Use the default timeout of the underlying transaction system, or none if timeouts are not supported.
Method Summary
int | getIsolationLevel() Return the isolation level.
String | getName() Return the name of this transaction.
int | getPropagationBehavior() Return the propagation behavior.
int | getTimeout() Return the transaction timeout.
boolean | isReadOnly() Return whether to optimize as a read-only transaction.

Field Detail

PROPAGATION_REQUIRED

static final int PROPAGATION_REQUIRED
Support a current transaction; create a new one if none exists. Analogous to the EJB transaction attribute of the same name.

This is typically the default setting of a transaction definition, and typically defines a transaction synchronization scope.

See Also:
Constant Field Values

PROPAGATION_SUPPORTS

static final int PROPAGATION_SUPPORTS
Support a current transaction; execute non-transactionally if none exists. Analogous to the EJB transaction attribute of the same name.

NOTE: For transaction managers with transaction synchronization, PROPAGATION_SUPPORTS is slightly different from no transaction at all, as it defines a transaction scope that synchronization might apply to. As a consequence, the same resources (a JDBC Connection, a Hibernate Session, etc) will be shared for the entire specified scope. Note that the exact behavior depends on the actual synchronization configuration of the transaction manager!

In general, use PROPAGATION_SUPPORTS with care! In particular, do not rely on PROPAGATION_REQUIRED or PROPAGATION_REQUIRES_NEW within a PROPAGATION_SUPPORTS scope (which may lead to synchronization conflicts at runtime). If such nesting is unavoidable, make sure to configure your transaction manager appropriately (typically switching to "synchronization on actual transaction").

See Also:
AbstractPlatformTransactionManager.setTransactionSynchronization(int), AbstractPlatformTransactionManager.SYNCHRONIZATION_ON_ACTUAL_TRANSACTION, Constant Field Values

PROPAGATION_MANDATORY

static final int PROPAGATION_MANDATORY
Support a current transaction; throw an exception if no current transaction exists. Analogous to the EJB transaction attribute of the same name.

Note that transaction synchronization within a PROPAGATION_MANDATORY scope will always be driven by the surrounding transaction.

See Also:
Constant Field Values

PROPAGATION_REQUIRES_NEW

static final int PROPAGATION_REQUIRES_NEW
Create a new transaction, suspending the current transaction if one exists. Analogous to the EJB transaction attribute of the same name.

NOTE: Actual transaction suspension will not work out-of-the-box on all transaction managers. This in particular applies to JtaTransactionManager, which requires the javax.transaction.TransactionManager to be made available it to it (which is server-specific in standard J2EE).

A PROPAGATION_REQUIRES_NEW scope always defines its own transaction synchronizations. Existing synchronizations will be suspended and resumed appropriately.

See Also:
JtaTransactionManager.setTransactionManager(javax.transaction.TransactionManager), Constant Field Values

PROPAGATION_NOT_SUPPORTED

static final int PROPAGATION_NOT_SUPPORTED
Do not support a current transaction; rather always execute non-transactionally. Analogous to the EJB transaction attribute of the same name.

NOTE: Actual transaction suspension will not work out-of-the-box on all transaction managers. This in particular applies to JtaTransactionManager, which requires the javax.transaction.TransactionManager to be made available it to it (which is server-specific in standard J2EE).

Note that transaction synchronization is not available within a PROPAGATION_NOT_SUPPORTED scope. Existing synchronizations will be suspended and resumed appropriately.

See Also:
JtaTransactionManager.setTransactionManager(javax.transaction.TransactionManager), Constant Field Values

PROPAGATION_NEVER

static final int PROPAGATION_NEVER
Do not support a current transaction; throw an exception if a current transaction exists. Analogous to the EJB transaction attribute of the same name.

Note that transaction synchronization is not available within a PROPAGATION_NEVER scope.

See Also:
Constant Field Values

PROPAGATION_NESTED

static final int PROPAGATION_NESTED
Execute within a nested transaction if a current transaction exists, behave like PROPAGATION_REQUIRED else. There is no analogous feature in EJB.

NOTE: Actual creation of a nested transaction will only work on specific transaction managers. Out of the box, this only applies to the JDBC DataSourceTransactionManager when working on a JDBC 3.0 driver. Some JTA providers might support nested transactions as well.

See Also:
DataSourceTransactionManager, Constant Field Values

ISOLATION_DEFAULT

static final int ISOLATION_DEFAULT
Use the default isolation level of the underlying datastore. All other levels correspond to the JDBC isolation levels.

See Also:
Connection, Constant Field Values

ISOLATION_READ_UNCOMMITTED

static final int ISOLATION_READ_UNCOMMITTED
Indicates that dirty reads, non-repeatable reads and phantom reads can occur.

This level allows a row changed by one transaction to be read by another transaction before any changes in that row have been committed (a "dirty read"). If any of the changes are rolled back, the second transaction will have retrieved an invalid row.

See Also:
Connection.TRANSACTION_READ_UNCOMMITTED, Constant Field Values

ISOLATION_READ_COMMITTED

static final int ISOLATION_READ_COMMITTED
Indicates that dirty reads are prevented; non-repeatable reads and phantom reads can occur.

This level only prohibits a transaction from reading a row with uncommitted changes in it.

See Also:
Connection.TRANSACTION_READ_COMMITTED, Constant Field Values

ISOLATION_REPEATABLE_READ

static final int ISOLATION_REPEATABLE_READ
Indicates that dirty reads and non-repeatable reads are prevented; phantom reads can occur.

This level prohibits a transaction from reading a row with uncommitted changes in it, and it also prohibits the situation where one transaction reads a row, a second transaction alters the row, and the first transaction re-reads the row, getting different values the second time (a "non-repeatable read").

See Also:
Connection.TRANSACTION_REPEATABLE_READ, Constant Field Values

ISOLATION_SERIALIZABLE

static final int ISOLATION_SERIALIZABLE
Indicates that dirty reads, non-repeatable reads and phantom reads are prevented.

This level includes the prohibitions in ISOLATION_REPEATABLE_READ and further prohibits the situation where one transaction reads all rows that satisfy a WHERE condition, a second transaction inserts a row that satisfies that WHERE condition, and the first transaction re-reads for the same condition, retrieving the additional "phantom" row in the second read.

See Also:
Connection.TRANSACTION_SERIALIZABLE, Constant Field Values

TIMEOUT_DEFAULT

static final int TIMEOUT_DEFAULT
Use the default timeout of the underlying transaction system, or none if timeouts are not supported.

See Also:
Constant Field Values
Method Detail

getPropagationBehavior

int getPropagationBehavior()
Return the propagation behavior.

Must return one of the PROPAGATION_XXX constants defined on this interface.

Returns:
the propagation behavior
See Also:
PROPAGATION_REQUIRED, TransactionSynchronizationManager.isActualTransactionActive()

getIsolationLevel

int getIsolationLevel()
Return the isolation level.

Must return one of the ISOLATION_XXX constants defined on this interface.

Only makes sense in combination with PROPAGATION_REQUIRED or PROPAGATION_REQUIRES_NEW.

Note that a transaction manager that does not support custom isolation levels will throw an exception when given any other level than ISOLATION_DEFAULT.

Returns:
the isolation level

getTimeout

int getTimeout()
Return the transaction timeout.

Must return a number of seconds, or TIMEOUT_DEFAULT.

Only makes sense in combination with PROPAGATION_REQUIRED or PROPAGATION_REQUIRES_NEW.

Note that a transaction manager that does not support timeouts will throw an exception when given any other timeout than TIMEOUT_DEFAULT.

Returns:
the transaction timeout

isReadOnly

boolean isReadOnly()
Return whether to optimize as a read-only transaction.

The read-only flag applies to any transaction context, whether backed by an actual resource transaction (PROPAGATION_REQUIRED/PROPAGATION_REQUIRES_NEW) or operating non-transactionally at the resource level (PROPAGATION_SUPPORTS). In the latter case, the flag will only apply to managed resources within the application, such as a Hibernate Session. << *

This just serves as a hint for the actual transaction subsystem; it will not necessarily cause failure of write access attempts. A transaction manager which cannot interpret the read-only hint will not throw an exception when asked for a read-only transaction.

Returns:
true if the transaction is to be optimized as read-only
See Also:
TransactionSynchronization.beforeCommit(boolean), TransactionSynchronizationManager.isCurrentTransactionReadOnly()

getName

String getName()
Return the name of this transaction. Can be null.

This will be used as the transaction name to be shown in a transaction monitor, if applicable (for example, WebLogic's).

In case of Spring's declarative transactions, the exposed name will be the fully-qualified class name + "." + method name (by default).

Returns:
the name of this transaction
See Also:
TransactionAspectSupport, TransactionSynchronizationManager.getCurrentTransactionName()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionStatus

org.springframework.transaction
Interface TransactionStatus

All Superinterfaces:
SavepointManager
All Known Implementing Classes:
AbstractTransactionStatus, DefaultTransactionStatus, SimpleTransactionStatus
public interface TransactionStatus
extends SavepointManager

Representation of the status of a transaction.

Transactional code can use this to retrieve status information, and to programmatically request a rollback (instead of throwing an exception that causes an implicit rollback).

Derives from the SavepointManager interface to provide access to savepoint management facilities. Note that savepoint management is only available if supported by the underlying transaction manager.

Since:
27.03.2003
Author:
Juergen Hoeller
See Also:
setRollbackOnly(),
PlatformTransactionManager.getTransaction(org.springframework.transaction.TransactionDefinition),
TransactionCallback.doInTransaction(org.springframework.transaction.TransactionStatus),
TransactionAspectSupport.currentTransactionStatus()

Method Summary
void | flush() Flush the underlying session to the datastore, if applicable: for example, all affected Hibernate/JPA sessions.
boolean | hasSavepoint() Return whether this transaction internally carries a savepoint, that is, has been created as nested transaction based on a savepoint.
boolean | isCompleted() Return whether this transaction is completed, that is, whether it has already been committed or rolled back.
boolean | isNewTransaction() Return whether the present transaction is new (else participating in an existing transaction, or potentially not running in an actual transaction in the first place).
boolean | isRollbackOnly() Return whether the transaction has been marked as rollback-only (either by the application or by the transaction infrastructure).
void | setRollbackOnly() Set the transaction rollback-only.
Methods inherited from interface org.springframework.transaction.SavepointManager
createSavepoint, releaseSavepoint, rollbackToSavepoint

Method Detail

isNewTransaction

boolean isNewTransaction()
Return whether the present transaction is new (else participating in an existing transaction, or potentially not running in an actual transaction in the first place).

hasSavepoint

boolean hasSavepoint()
Return whether this transaction internally carries a savepoint, that is, has been created as nested transaction based on a savepoint.

This method is mainly here for diagnostic purposes, alongside isNewTransaction(). For programmatic handling of custom savepoints, use SavepointManager's operations.

See Also:
isNewTransaction(),
SavepointManager.createSavepoint(),
SavepointManager.rollbackToSavepoint(Object),
SavepointManager.releaseSavepoint(Object)

setRollbackOnly

void setRollbackOnly()
Set the transaction rollback-only. This instructs the transaction manager that the only possible outcome of the transaction may be a rollback, as alternative to throwing an exception which would in turn trigger a rollback.

This is mainly intended for transactions managed by TransactionTemplate or TransactionInterceptor, where the actual commit/rollback decision is made by the container.

See Also:
TransactionCallback.doInTransaction(org.springframework.transaction.TransactionStatus), TransactionAttribute.rollbackOn(java.lang.Throwable)

isRollbackOnly

boolean isRollbackOnly()
Return whether the transaction has been marked as rollback-only (either by the application or by the transaction infrastructure).

flush

void flush()
Flush the underlying session to the datastore, if applicable: for example, all affected Hibernate/JPA sessions.

isCompleted

boolean isCompleted()
Return whether this transaction is completed, that is, whether it has already been committed or rolled back.

See Also:
PlatformTransactionManager.commit(org.springframework.transaction.TransactionStatus), PlatformTransactionManager.rollback(org.springframework.transaction.TransactionStatus)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CannotCreateTransactionException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.transaction
Class CannotCreateTransactionException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.transaction.TransactionException
                        extended by  org.springframework.transaction.CannotCreateTransactionException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
NestedTransactionNotSupportedException, TransactionSuspensionNotSupportedException
public class CannotCreateTransactionException
extends TransactionException

Exception thrown when a transaction can't be created using an underlying transaction API such as JTA.

Since:
17.03.2003
Author:
Rod Johnson
See Also:
Serialized Form

Constructor Summary
CannotCreateTransactionException(String msg)
Constructor for CannotCreateTransactionException.
CannotCreateTransactionException(String msg, Throwable cause)
Constructor for CannotCreateTransactionException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

CannotCreateTransactionException

public CannotCreateTransactionException(String msg)
Constructor for CannotCreateTransactionException.

Parameters:
msg - the detail message

CannotCreateTransactionException

public CannotCreateTransactionException(String msg,
                                        Throwable cause)
Constructor for CannotCreateTransactionException.

Parameters:
msg - the detail message
cause - the root cause from the transaction API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


HeuristicCompletionException

org.springframework.transaction
Class HeuristicCompletionException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.transaction.TransactionException
                        extended by  org.springframework.transaction.HeuristicCompletionException
All Implemented Interfaces:
Serializable
public class HeuristicCompletionException
extends TransactionException

Exception that represents a transaction failure caused by a heuristic decision on the side of the transaction coordinator.

Since:
17.03.2003
Author:
Rod Johnson, Juergen Hoeller
See Also:
Serialized Form

Field Summary
static int | STATE_COMMITTED
static int | STATE_MIXED
static int | STATE_ROLLED_BACK
static int | STATE_UNKNOWN Values for the outcome state of a heuristically completed transaction.
Constructor Summary
HeuristicCompletionException(int outcomeState, Throwable cause)
Constructor for HeuristicCompletionException.
Method Summary
int | getOutcomeState() Return the outcome state of the transaction state, as one of the constants in this class.
static String | getStateString(int state)
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

STATE_UNKNOWN

public static final int STATE_UNKNOWN
Values for the outcome state of a heuristically completed transaction.

See Also:
Constant Field Values

STATE_COMMITTED

public static final int STATE_COMMITTED
See Also:
Constant Field Values

STATE_ROLLED_BACK

public static final int STATE_ROLLED_BACK
See Also:
Constant Field Values

STATE_MIXED

public static final int STATE_MIXED
See Also:
Constant Field Values
Constructor Detail

HeuristicCompletionException

public HeuristicCompletionException(int outcomeState,
                                    Throwable cause)
Constructor for HeuristicCompletionException.

Parameters:
outcomeState - the outcome state of the transaction
cause - the root cause from the transaction API in use
Method Detail

getStateString

public static String getStateString(int state)

getOutcomeState

public int getOutcomeState()
Return the outcome state of the transaction state, as one of the constants in this class.

See Also:
STATE_UNKNOWN, STATE_COMMITTED, STATE_ROLLED_BACK, STATE_MIXED
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


IllegalTransactionStateException

org.springframework.transaction
Class IllegalTransactionStateException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.transaction.TransactionException
                        extended by  org.springframework.transaction.TransactionUsageException
                            extended by  org.springframework.transaction.IllegalTransactionStateException
All Implemented Interfaces:
Serializable
public class IllegalTransactionStateException
extends TransactionUsageException

Exception thrown when the existence or non-existence of a transaction amounts to an illegal state according to the transaction propagation behavior that applies.

Since:
21.01.2004
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
IllegalTransactionStateException(String msg)
Constructor for IllegalTransactionStateException.
IllegalTransactionStateException(String msg, Throwable cause)
Constructor for IllegalTransactionStateException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

IllegalTransactionStateException

public IllegalTransactionStateException(String msg)
Constructor for IllegalTransactionStateException.

Parameters:
msg - the detail message

IllegalTransactionStateException

public IllegalTransactionStateException(String msg,
                                        Throwable cause)
Constructor for IllegalTransactionStateException.

Parameters:
msg - the detail message
cause - the root cause from the transaction API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InvalidIsolationLevelException

org.springframework.transaction
Class InvalidIsolationLevelException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.transaction.TransactionException
                        extended by  org.springframework.transaction.TransactionUsageException
                            extended by  org.springframework.transaction.InvalidIsolationLevelException
All Implemented Interfaces:
Serializable
public class InvalidIsolationLevelException
extends TransactionUsageException

Exception that gets thrown when an invalid isolation level is specified, i.e. an isolation level that the transaction manager implementation doesn't support.

Since:
12.05.2003
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
InvalidIsolationLevelException(String msg)
Constructor for InvalidIsolationLevelException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

InvalidIsolationLevelException

public InvalidIsolationLevelException(String msg)
Constructor for InvalidIsolationLevelException.

Parameters:
msg - the detail message
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InvalidTimeoutException

org.springframework.transaction
Class InvalidTimeoutException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.transaction.TransactionException
                        extended by  org.springframework.transaction.TransactionUsageException
                            extended by  org.springframework.transaction.InvalidTimeoutException
All Implemented Interfaces:
Serializable
public class InvalidTimeoutException
extends TransactionUsageException

Exception that gets thrown when an invalid timeout is specified, that is, the specified timeout valid is out of range or the transaction manager implementation doesn't support timeouts.

Since:
12.05.2003
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
InvalidTimeoutException(String msg, int timeout)
Constructor for InvalidTimeoutException.
Method Summary
 int getTimeout()
Return the invalid timeout value.
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

InvalidTimeoutException

public InvalidTimeoutException(String msg,
                               int timeout)
Constructor for InvalidTimeoutException.

Parameters:
msg - the detail message
timeout - the invalid timeout value
Method Detail

getTimeout

public int getTimeout()
Return the invalid timeout value.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NestedTransactionNotSupportedException

org.springframework.transaction
Class NestedTransactionNotSupportedException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.transaction.TransactionException
                        extended by  org.springframework.transaction.CannotCreateTransactionException
                            extended by  org.springframework.transaction.NestedTransactionNotSupportedException
All Implemented Interfaces:
Serializable
public class NestedTransactionNotSupportedException
extends CannotCreateTransactionException

Exception thrown when attempting to work with a nested transaction but nested transactions are not supported by the underlying backend.

Since:
1.1
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
NestedTransactionNotSupportedException(String msg)
Constructor for NestedTransactionNotSupportedException.
NestedTransactionNotSupportedException(String msg, Throwable cause)
Constructor for NestedTransactionNotSupportedException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

NestedTransactionNotSupportedException

public NestedTransactionNotSupportedException(String msg)
Constructor for NestedTransactionNotSupportedException.

Parameters:
msg - the detail message

NestedTransactionNotSupportedException

public NestedTransactionNotSupportedException(String msg,
                                              Throwable cause)
Constructor for NestedTransactionNotSupportedException.

Parameters:
msg - the detail message
cause - the root cause from the transaction API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NoTransactionException

org.springframework.transaction
Class NoTransactionException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.transaction.TransactionException
                        extended by  org.springframework.transaction.TransactionUsageException
                            extended by  org.springframework.transaction.NoTransactionException
All Implemented Interfaces:
Serializable
public class NoTransactionException
extends TransactionUsageException

Exception thrown when an operation is attempted that relies on an existing transaction (such as setting rollback status) and there is no existing transaction. This represents an illegal usage of the transaction API.

Since:
17.03.2003
Author:
Rod Johnson
See Also:
Serialized Form

Constructor Summary
NoTransactionException(String msg)
Constructor for NoTransactionException.
NoTransactionException(String msg, Throwable cause)
Constructor for NoTransactionException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

NoTransactionException

public NoTransactionException(String msg)
Constructor for NoTransactionException.

Parameters:
msg - the detail message

NoTransactionException

public NoTransactionException(String msg,
                              Throwable cause)
Constructor for NoTransactionException.

Parameters:
msg - the detail message
cause - the root cause from the transaction API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionException

org.springframework.transaction
Class TransactionException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.transaction.TransactionException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CannotCreateTransactionException, HeuristicCompletionException, TransactionSystemException, TransactionTimedOutException, TransactionUsageException, UnexpectedRollbackException
public abstract class TransactionException
extends NestedRuntimeException

Superclass for all transaction exceptions.

Since:
17.03.2003
Author:
Rod Johnson
See Also:
Serialized Form

Constructor Summary
TransactionException(String msg)
Constructor for TransactionException.
TransactionException(String msg, Throwable cause)
Constructor for TransactionException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

TransactionException

public TransactionException(String msg)
Constructor for TransactionException.

Parameters:
msg - the detail message

TransactionException

public TransactionException(String msg,
                            Throwable cause)
Constructor for TransactionException.

Parameters:
msg - the detail message
cause - the root cause from the transaction API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionSuspensionNotSupportedException

org.springframework.transaction
Class TransactionSuspensionNotSupportedException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.transaction.TransactionException
                        extended by  org.springframework.transaction.CannotCreateTransactionException
                            extended by  org.springframework.transaction.TransactionSuspensionNotSupportedException
All Implemented Interfaces:
Serializable
public class TransactionSuspensionNotSupportedException
extends CannotCreateTransactionException

Exception thrown when attempting to suspend an existing transaction but transaction suspension is not supported by the underlying backend.

Since:
1.1
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
TransactionSuspensionNotSupportedException(String msg)
Constructor for TransactionSuspensionNotSupportedException.
TransactionSuspensionNotSupportedException(String msg, Throwable cause)
Constructor for TransactionSuspensionNotSupportedException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

TransactionSuspensionNotSupportedException

public TransactionSuspensionNotSupportedException(String msg)
Constructor for TransactionSuspensionNotSupportedException.

Parameters:
msg - the detail message

TransactionSuspensionNotSupportedException

public TransactionSuspensionNotSupportedException(String msg,
                                                  Throwable cause)
Constructor for TransactionSuspensionNotSupportedException.

Parameters:
msg - the detail message
cause - the root cause from the transaction API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionSystemException

org.springframework.transaction
Class TransactionSystemException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.transaction.TransactionException
                        extended by  org.springframework.transaction.TransactionSystemException
All Implemented Interfaces:
Serializable
public class TransactionSystemException
extends TransactionException

Exception thrown when a general transaction system error is encountered, like on commit or rollback.

Since:
24.03.2003
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
TransactionSystemException(String msg)
Constructor for TransactionSystemException.
TransactionSystemException(String msg, Throwable cause)
Constructor for TransactionSystemException.
Method Summary
boolean | contains(Class exType) Check whether this exception contains an exception of the given type: either it is of the given class itself or it contains a nested cause of the given type.
Throwable | getApplicationException() Return the application exception that was thrown before this transaction exception, if any.
Throwable | getOriginalException() Return the exception that was the first to be thrown within the failed transaction: i.e.
void | initApplicationException(Throwable ex) Set an application exception that was thrown before this transaction exception, preserving the original exception despite the overriding TransactionSystemException.
Methods inherited from class org.springframework.core.NestedRuntimeException
getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

TransactionSystemException

public TransactionSystemException(String msg)
Constructor for TransactionSystemException.

Parameters:
msg - the detail message

TransactionSystemException

public TransactionSystemException(String msg,
                                  Throwable cause)
Constructor for TransactionSystemException.

Parameters:
msg - the detail message
cause - the root cause from the transaction API in use
Method Detail

initApplicationException

public void initApplicationException(Throwable ex)
Set an application exception that was thrown before this transaction exception, preserving the original exception despite the overriding TransactionSystemException.

Parameters:
ex - the application exception
Throws:
IllegalStateException - if this TransactionSystemException already holds an application exception

getApplicationException

public final Throwable getApplicationException()
Return the application exception that was thrown before this transaction exception, if any.

Returns:
the application exception, or null if none set

getOriginalException

public Throwable getOriginalException()
Return the exception that was the first to be thrown within the failed transaction: i.e. the application exception, if any, or the TransactionSystemException's own cause.

Returns:
the original exception, or null if there was none

contains

public boolean contains(Class exType)
Description copied from class: NestedRuntimeException
Check whether this exception contains an exception of the given type: either it is of the given class itself or it contains a nested cause of the given type.

Overrides:
contains in class NestedRuntimeException
Parameters:
exType - the exception type to look for
Returns:
whether there is a nested exception of the specified type
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionTimedOutException

org.springframework.transaction
Class TransactionTimedOutException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.transaction.TransactionException
                        extended by  org.springframework.transaction.TransactionTimedOutException
All Implemented Interfaces:
Serializable
public class TransactionTimedOutException
extends TransactionException

Exception to be thrown when a transaction has timed out.

Thrown by Spring's local transaction strategies if the deadline for a transaction has been reached when an operation is attempted, according to the timeout specified for the given transaction.

Beyond such checks before each transactional operation, Spring's local transaction strategies will also pass appropriate timeout values to resource operations (for example to JDBC Statements, letting the JDBC driver respect the timeout). Such operations will usually throw native resource exceptions (for example, JDBC SQLExceptions) if their operation timeout has been exceeded, to be converted to Spring's DataAccessException in the respective DAO (which might use Spring's JdbcTemplate, for example).

In a JTA environment, it is up to the JTA transaction coordinator to apply transaction timeouts. Usually, the corresponding JTA-aware connection pool will perform timeout checks and throw corresponding native resource exceptions (for example, JDBC SQLExceptions).

Since:
1.1.5
Author:
Juergen Hoeller
See Also:
ResourceHolderSupport.getTimeToLiveInMillis(), Statement.setQueryTimeout(int), SQLException, Serialized Form

Constructor Summary
TransactionTimedOutException(String msg)
Constructor for TransactionTimedOutException.
TransactionTimedOutException(String msg, Throwable cause)
Constructor for TransactionTimedOutException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

TransactionTimedOutException

public TransactionTimedOutException(String msg)
Constructor for TransactionTimedOutException.

Parameters:
msg - the detail message

TransactionTimedOutException

public TransactionTimedOutException(String msg,
                                    Throwable cause)
Constructor for TransactionTimedOutException.

Parameters:
msg - the detail message
cause - the root cause from the transaction API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionUsageException

org.springframework.transaction
Class TransactionUsageException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.transaction.TransactionException
                        extended by  org.springframework.transaction.TransactionUsageException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
IllegalTransactionStateException, InvalidIsolationLevelException, InvalidTimeoutException, NoTransactionException
public class TransactionUsageException
extends TransactionException

Superclass for exceptions caused by inappropriate usage of a Spring transaction API.

Since:
22.03.2003
Author:
Rod Johnson
See Also:
Serialized Form

Constructor Summary
TransactionUsageException(String msg)
Constructor for TransactionUsageException.
TransactionUsageException(String msg, Throwable cause)
Constructor for TransactionUsageException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

TransactionUsageException

public TransactionUsageException(String msg)
Constructor for TransactionUsageException.

Parameters:
msg - the detail message

TransactionUsageException

public TransactionUsageException(String msg,
                                 Throwable cause)
Constructor for TransactionUsageException.

Parameters:
msg - the detail message
cause - the root cause from the transaction API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UnexpectedRollbackException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.transaction
Class UnexpectedRollbackException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.transaction.TransactionException
                        extended by  org.springframework.transaction.UnexpectedRollbackException
All Implemented Interfaces:
Serializable
public class UnexpectedRollbackException
extends TransactionException

Thrown when an attempt to commit a transaction resulted in an unexpected rollback.

Since:
17.03.2003
Author:
Rod Johnson
See Also:
Serialized Form

Constructor Summary
UnexpectedRollbackException(String msg)
Constructor for UnexpectedRollbackException.
UnexpectedRollbackException(String msg, Throwable cause)
Constructor for UnexpectedRollbackException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

UnexpectedRollbackException

public UnexpectedRollbackException(String msg)
Constructor for UnexpectedRollbackException.

Parameters:
msg - the detail message

UnexpectedRollbackException

public UnexpectedRollbackException(String msg,
                                   Throwable cause)
Constructor for UnexpectedRollbackException.

Parameters:
msg - the detail message
cause - the root cause from the transaction API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.transaction.annotation

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.transaction.annotation

JDK 1.5+ annotation for transaction demarcation.

See:
Description

Interface Summary
TransactionAnnotationParser Strategy interface for parsing known transaction annotation types.

Class Summary
AnnotationTransactionAttributeSource | Implementation of the TransactionAttributeSource interface for working with transaction metadata in JDK 1.5+ annotation format.
Ejb3TransactionAnnotationParser | Strategy implementation for parsing EJB3's TransactionAttribute annotation.
SpringTransactionAnnotationParser | Strategy implementation for parsing Spring's Transactional annotation.

Enum Summary
Isolation | Enumeration that represents transaction isolation levels for use with the Transactional annotation, corresponding to the TransactionDefinition interface.
Propagation | Enumeration that represents transaction propagation behaviors for use with the Transactional annotation, corresponding to the TransactionDefinition interface.

Annotation Types Summary
Transactional Describes transaction attributes on a method or class.

Package org.springframework.transaction.annotation Description

JDK 1.5+ annotation for transaction demarcation. Hooked into Spring's transaction interception infrastructure via a special TransactionAttributeSource implementation.


org.springframework.transaction.annotation Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.transaction.annotation

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.transaction.interceptor.AbstractFallbackTransactionAttributeSource (implements org.springframework.transaction.interceptor.TransactionAttributeSource)
      • org.springframework.transaction.annotation.AnnotationTransactionAttributeSource (implements java.io.Serializable)
    • org.springframework.transaction.annotation.Ejb3TransactionAnnotationParser (implements java.io.Serializable, org.springframework.transaction.annotation.TransactionAnnotationParser)
    • org.springframework.transaction.annotation.SpringTransactionAnnotationParser (implements java.io.Serializable, org.springframework.transaction.annotation.TransactionAnnotationParser)

Interface Hierarchy

  • org.springframework.transaction.annotation.TransactionAnnotationParser

Annotation Type Hierarchy

  • org.springframework.transaction.annotation.Transactional (implements java.lang.annotation.Annotation)

Enum Hierarchy

  • java.lang.Object
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)
      • org.springframework.transaction.annotation.Propagation
      • org.springframework.transaction.annotation.Isolation


TransactionAnnotationParser

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.transaction.annotation
Interface TransactionAnnotationParser

All Known Implementing Classes:
Ejb3TransactionAnnotationParser, SpringTransactionAnnotationParser
public interface TransactionAnnotationParser

Strategy interface for parsing known transaction annotation types. AnnotationTransactionAttributeSource delegates to such parsers for supporting specific annotation types such as Spring's own Transactional or EJB3's TransactionAttribute.

Since:
2.5
Author:
Juergen Hoeller
See Also:
AnnotationTransactionAttributeSource, SpringTransactionAnnotationParser, Ejb3TransactionAnnotationParser

Method Summary
 TransactionAttribute parseTransactionAnnotation(AnnotatedElement ae)
Parse the transaction attribute for the given method or class, based on a known annotation type.

Method Detail

parseTransactionAnnotation

TransactionAttribute parseTransactionAnnotation(AnnotatedElement ae)
Parse the transaction attribute for the given method or class, based on a known annotation type.

This essentially parses a known transaction annotation into Spring's metadata attribute class. Returns null if the method/class is not transactional.

Parameters:
ae - the annotated method or class
Returns:
TransactionAttribute the configured transaction attribute, or null if none was found
See Also:
AnnotationTransactionAttributeSource.determineTransactionAttribute(java.lang.reflect.AnnotatedElement)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AnnotationTransactionAttributeSource

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.transaction.annotation
Class AnnotationTransactionAttributeSource

java.lang.Object
    extended by  org.springframework.transaction.interceptor.AbstractFallbackTransactionAttributeSource
        extended by  org.springframework.transaction.annotation.AnnotationTransactionAttributeSource
All Implemented Interfaces:
Serializable, TransactionAttributeSource
public class AnnotationTransactionAttributeSource
extends AbstractFallbackTransactionAttributeSource
implements Serializable

Implementation of the TransactionAttributeSource interface for working with transaction metadata in JDK 1.5+ annotation format.

This class reads Spring's JDK 1.5+ Transactional annotation and exposes corresponding transaction attributes to Spring's transaction infrastructure. Also supports EJB3's TransactionAttribute annotation (if present). This class may also serve as base class for a custom TransactionAttributeSource, or get customized through TransactionAnnotationParser strategies.

Since:
1.2
Author:
Colin Sampaleanu, Juergen Hoeller
See Also:
Transactional, TransactionAnnotationParser, SpringTransactionAnnotationParser, Ejb3TransactionAnnotationParser, TransactionAspectSupport.setTransactionAttributeSource(org.springframework.transaction.interceptor.TransactionAttributeSource), TransactionProxyFactoryBean.setTransactionAttributeSource(org.springframework.transaction.interceptor.TransactionAttributeSource), Serialized Form

Field Summary
Fields inherited from class org.springframework.transaction.interceptor.AbstractFallbackTransactionAttributeSource
logger
Constructor Summary
AnnotationTransactionAttributeSource()
Create a default AnnotationTransactionAttributeSource, supporting public methods that carry the Transactional annotation or the EJB3 TransactionAttribute annotation.
AnnotationTransactionAttributeSource(boolean publicMethodsOnly)
Create a custom AnnotationTransactionAttributeSource, supporting public methods that carry the Transactional annotation or the EJB3 TransactionAttribute annotation.
AnnotationTransactionAttributeSource(Set<TransactionAnnotationParser> annotationParsers)
Create a custom AnnotationTransactionAttributeSource.
AnnotationTransactionAttributeSource(TransactionAnnotationParser annotationParser)
Create a custom AnnotationTransactionAttributeSource.
Method Summary
protected boolean | allowPublicMethodsOnly() By default, only public methods can be made transactional.
protected TransactionAttribute | determineTransactionAttribute(AnnotatedElement ae) Determine the transaction attribute for the given method or class.
protected TransactionAttribute | findTransactionAttribute(Class clazz) Subclasses need to implement this to return the transaction attribute for the given class, if any.
protected TransactionAttribute | findTransactionAttribute(Method method) Subclasses need to implement this to return the transaction attribute for the given method, if any.
Methods inherited from class org.springframework.transaction.interceptor.AbstractFallbackTransactionAttributeSource
getCacheKey, getTransactionAttribute
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AnnotationTransactionAttributeSource

public AnnotationTransactionAttributeSource()
Create a default AnnotationTransactionAttributeSource, supporting public methods that carry the Transactional annotation or the EJB3 TransactionAttribute annotation.

AnnotationTransactionAttributeSource

public AnnotationTransactionAttributeSource(boolean publicMethodsOnly)
Create a custom AnnotationTransactionAttributeSource, supporting public methods that carry the Transactional annotation or the EJB3 TransactionAttribute annotation.

Parameters:
publicMethodsOnly - whether to support public methods that carry the Transactional annotation only (typically for use with proxy-based AOP), or protected/private methods as well (typically used with AspectJ class weaving)

AnnotationTransactionAttributeSource

public AnnotationTransactionAttributeSource(TransactionAnnotationParser annotationParser)
Create a custom AnnotationTransactionAttributeSource.

Parameters:
annotationParser - the TransactionAnnotationParser to use

AnnotationTransactionAttributeSource

public AnnotationTransactionAttributeSource(Set<TransactionAnnotationParser> annotationParsers)
Create a custom AnnotationTransactionAttributeSource.

Parameters:
annotationParsers - the TransactionAnnotationParsers to use
Method Detail

findTransactionAttribute

protected TransactionAttribute findTransactionAttribute(Method method)
Description copied from class: AbstractFallbackTransactionAttributeSource
Subclasses need to implement this to return the transaction attribute for the given method, if any.

Specified by:
findTransactionAttribute in class AbstractFallbackTransactionAttributeSource
Parameters:
method - the method to retrieve the attribute for
Returns:
all transaction attribute associated with this method (or null if none)

findTransactionAttribute

protected TransactionAttribute findTransactionAttribute(Class clazz)
Description copied from class: AbstractFallbackTransactionAttributeSource
Subclasses need to implement this to return the transaction attribute for the given class, if any.

Specified by:
findTransactionAttribute in class AbstractFallbackTransactionAttributeSource
Parameters:
clazz - the class to retrieve the attribute for
Returns:
all transaction attribute associated with this class (or null if none)

determineTransactionAttribute

protected TransactionAttribute determineTransactionAttribute(AnnotatedElement ae)
Determine the transaction attribute for the given method or class.

This implementation delegates to configured TransactionAnnotationParsers for parsing known annotations into Spring's metadata attribute class. Returns null if it's not transactional.

Can be overridden to support custom annotations that carry transaction metadata.

Parameters:
ae - the annotated method or class
Returns:
TransactionAttribute the configured transaction attribute, or null if none was found

allowPublicMethodsOnly

protected boolean allowPublicMethodsOnly()
By default, only public methods can be made transactional.

Overrides:
allowPublicMethodsOnly in class AbstractFallbackTransactionAttributeSource
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


Ejb3TransactionAnnotationParser

org.springframework.transaction.annotation
Class Ejb3TransactionAnnotationParser

java.lang.Object
    extended by  org.springframework.transaction.annotation.Ejb3TransactionAnnotationParser
All Implemented Interfaces:
Serializable, TransactionAnnotationParser
public class Ejb3TransactionAnnotationParser
extends Object
implements TransactionAnnotationParser, Serializable

Strategy implementation for parsing EJB3's TransactionAttribute annotation.

Since:
2.5
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
Ejb3TransactionAnnotationParser()
Method Summary
TransactionAttribute | parseTransactionAnnotation(AnnotatedElement ae) Parse the transaction attribute for the given method or class, based on a known annotation type.
TransactionAttribute | parseTransactionAnnotation(TransactionAttribute ann)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Ejb3TransactionAnnotationParser

public Ejb3TransactionAnnotationParser()
Method Detail

parseTransactionAnnotation

public TransactionAttribute parseTransactionAnnotation(AnnotatedElement ae)
Description copied from interface: TransactionAnnotationParser
Parse the transaction attribute for the given method or class, based on a known annotation type.

This essentially parses a known transaction annotation into Spring's metadata attribute class. Returns null if the method/class is not transactional.

Specified by:
parseTransactionAnnotation in interface TransactionAnnotationParser
Parameters:
ae - the annotated method or class
Returns:
TransactionAttribute the configured transaction attribute, or null if none was found
See Also:
AnnotationTransactionAttributeSource.determineTransactionAttribute(java.lang.reflect.AnnotatedElement)

parseTransactionAnnotation

public TransactionAttribute parseTransactionAnnotation(TransactionAttribute ann)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SpringTransactionAnnotationParser

org.springframework.transaction.annotation
Class SpringTransactionAnnotationParser

java.lang.Object
    extended by  org.springframework.transaction.annotation.SpringTransactionAnnotationParser
All Implemented Interfaces:
Serializable, TransactionAnnotationParser
public class SpringTransactionAnnotationParser
extends Object
implements TransactionAnnotationParser, Serializable

Strategy implementation for parsing Spring's Transactional annotation.

Since:
2.5
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
SpringTransactionAnnotationParser()
Method Summary
TransactionAttribute | parseTransactionAnnotation(AnnotatedElement ae) Parse the transaction attribute for the given method or class, based on a known annotation type.
TransactionAttribute | parseTransactionAnnotation(Transactional ann)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SpringTransactionAnnotationParser

public SpringTransactionAnnotationParser()
Method Detail

parseTransactionAnnotation

public TransactionAttribute parseTransactionAnnotation(AnnotatedElement ae)
Description copied from interface: TransactionAnnotationParser
Parse the transaction attribute for the given method or class, based on a known annotation type.

This essentially parses a known transaction annotation into Spring's metadata attribute class. Returns null if the method/class is not transactional.

Specified by:
parseTransactionAnnotation in interface TransactionAnnotationParser
Parameters:
ae - the annotated method or class
Returns:
TransactionAttribute the configured transaction attribute, or null if none was found
See Also:
AnnotationTransactionAttributeSource.determineTransactionAttribute(java.lang.reflect.AnnotatedElement)

parseTransactionAnnotation

public TransactionAttribute parseTransactionAnnotation(Transactional ann)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Isolation

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

org.springframework.transaction.annotation
Enum Isolation

java.lang.Object
    extended by  java.lang.Enum<Isolation>
        extended by  org.springframework.transaction.annotation.Isolation
All Implemented Interfaces:
Serializable, Comparable<Isolation>
public enum Isolation
extends Enum<Isolation>

Enumeration that represents transaction isolation levels for use with the Transactional annotation, corresponding to the TransactionDefinition interface.

Since:
1.2
Author:
Colin Sampaleanu, Juergen Hoeller

Enum Constant Summary
DEFAULT
Use the default isolation level of the underlying datastore.
READ_COMMITTED
A constant indicating that dirty reads are prevented; non-repeatable reads and phantom reads can occur.
READ_UNCOMMITTED
A constant indicating that dirty reads, non-repeatable reads and phantom reads can occur.
REPEATABLE_READ
A constant indicating that dirty reads and non-repeatable reads are prevented; phantom reads can occur.
SERIALIZABLE
A constant indicating that dirty reads, non-repeatable reads and phantom reads are prevented.
Method Summary
int | value()
static Isolation | valueOf(String name) Returns the enum constant of this type with the specified name.
static Isolation[] | values() Returns an array containing the constants of this enum type, in the order they are declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

DEFAULT

public static final Isolation DEFAULT
Use the default isolation level of the underlying datastore. All other levels correspond to the JDBC isolation levels.

See Also:
Connection

READ_UNCOMMITTED

public static final Isolation READ_UNCOMMITTED
A constant indicating that dirty reads, non-repeatable reads and phantom reads can occur. This level allows a row changed by one transaction to be read by another transaction before any changes in that row have been committed (a "dirty read"). If any of the changes are rolled back, the second transaction will have retrieved an invalid row.

See Also:
Connection.TRANSACTION_READ_UNCOMMITTED

READ_COMMITTED

public static final Isolation READ_COMMITTED
A constant indicating that dirty reads are prevented; non-repeatable reads and phantom reads can occur. This level only prohibits a transaction from reading a row with uncommitted changes in it.

See Also:
Connection.TRANSACTION_READ_COMMITTED

REPEATABLE_READ

public static final Isolation REPEATABLE_READ
A constant indicating that dirty reads and non-repeatable reads are prevented; phantom reads can occur. This level prohibits a transaction from reading a row with uncommitted changes in it, and it also prohibits the situation where one transaction reads a row, a second transaction alters the row, and the first transaction rereads the row, getting different values the second time (a "non-repeatable read").

See Also:
Connection.TRANSACTION_REPEATABLE_READ

SERIALIZABLE

public static final Isolation SERIALIZABLE
A constant indicating that dirty reads, non-repeatable reads and phantom reads are prevented. This level includes the prohibitions in ISOLATION_REPEATABLE_READ and further prohibits the situation where one transaction reads all rows that satisfy a WHERE condition, a second transaction inserts a row that satisfies that WHERE condition, and the first transaction rereads for the same condition, retrieving the additional "phantom" row in the second read.

See Also:
Connection.TRANSACTION_SERIALIZABLE
Method Detail

values

public static Isolation[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Isolation c : Isolation.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Isolation valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

value

public int value()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


Propagation

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

org.springframework.transaction.annotation
Enum Propagation

java.lang.Object
    extended by  java.lang.Enum<Propagation>
        extended by  org.springframework.transaction.annotation.Propagation
All Implemented Interfaces:
Serializable, Comparable<Propagation>
public enum Propagation
extends Enum<Propagation>

Enumeration that represents transaction propagation behaviors for use with the Transactional annotation, corresponding to the TransactionDefinition interface.

Since:
1.2
Author:
Colin Sampaleanu, Juergen Hoeller

Enum Constant Summary
MANDATORY
Support a current transaction, throw an exception if none exists.
NESTED
Execute within a nested transaction if a current transaction exists, behave like PROPAGATION_REQUIRED else.
NEVER
Execute non-transactionally, throw an exception if a transaction exists.
NOT_SUPPORTED
Execute non-transactionally, suspend the current transaction if one exists.
REQUIRED
Support a current transaction, create a new one if none exists.
REQUIRES_NEW
Create a new transaction, suspend the current transaction if one exists.
SUPPORTS
Support a current transaction, execute non-transactionally if none exists.
Method Summary
int | value()
static Propagation | valueOf(String name) Returns the enum constant of this type with the specified name.
static Propagation[] | values() Returns an array containing the constants of this enum type, in the order they are declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

REQUIRED

public static final Propagation REQUIRED
Support a current transaction, create a new one if none exists. Analogous to EJB transaction attribute of the same name.

This is the default setting of a transaction annotation.

SUPPORTS

public static final Propagation SUPPORTS
Support a current transaction, execute non-transactionally if none exists. Analogous to EJB transaction attribute of the same name.

Note: For transaction managers with transaction synchronization, PROPAGATION_SUPPORTS is slightly different from no transaction at all, as it defines a transaction scope that synchronization will apply for. As a consequence, the same resources (JDBC Connection, Hibernate Session, etc) will be shared for the entire specified scope. Note that this depends on the actual synchronization configuration of the transaction manager.

See Also:
AbstractPlatformTransactionManager.setTransactionSynchronization(int)

MANDATORY

public static final Propagation MANDATORY
Support a current transaction, throw an exception if none exists. Analogous to EJB transaction attribute of the same name.

REQUIRES_NEW

public static final Propagation REQUIRES_NEW
Create a new transaction, suspend the current transaction if one exists. Analogous to EJB transaction attribute of the same name.

Note: Actual transaction suspension will not work on out-of-the-box on all transaction managers. This in particular applies to JtaTransactionManager, which requires the javax.transaction.TransactionManager to be made available it to it (which is server-specific in standard J2EE).

See Also:
JtaTransactionManager.setTransactionManager(javax.transaction.TransactionManager)

NOT_SUPPORTED

public static final Propagation NOT_SUPPORTED
Execute non-transactionally, suspend the current transaction if one exists. Analogous to EJB transaction attribute of the same name.

Note: Actual transaction suspension will not work on out-of-the-box on all transaction managers. This in particular applies to JtaTransactionManager, which requires the javax.transaction.TransactionManager to be made available it to it (which is server-specific in standard J2EE).

See Also:
JtaTransactionManager.setTransactionManager(javax.transaction.TransactionManager)

NEVER

public static final Propagation NEVER
Execute non-transactionally, throw an exception if a transaction exists. Analogous to EJB transaction attribute of the same name.

NESTED

public static final Propagation NESTED
Execute within a nested transaction if a current transaction exists, behave like PROPAGATION_REQUIRED else. There is no analogous feature in EJB.

Note: Actual creation of a nested transaction will only work on specific transaction managers. Out of the box, this only applies to the JDBC DataSourceTransactionManager when working on a JDBC 3.0 driver. Some JTA providers might support nested transactions as well.

See Also:
DataSourceTransactionManager
Method Detail

values

public static Propagation[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Propagation c : Propagation.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Propagation valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

value

public int value()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


Transactional

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.transaction.annotation
Annotation Type Transactional

@Target(value={METHOD,TYPE})
@Retention(value=RUNTIME)
@Inherited
@Documented
public @interface Transactional

Describes transaction attributes on a method or class.

This annotation type is generally directly comparable to Spring's RuleBasedTransactionAttribute class, and in fact AnnotationTransactionAttributeSource will directly convert the data to the latter class, so that Spring's transaction support code does not have to know about annotations. If no rules are relevant to the exception, it will be treated like DefaultTransactionAttribute (rolling back on runtime exceptions).

For specific information about the semantics of this annotation's attributes, consider the TransactionDefinition and TransactionAttribute javadocs.

Since:
1.2
Author:
Colin Sampaleanu, Juergen Hoeller
See Also:
TransactionAttribute, DefaultTransactionAttribute, RuleBasedTransactionAttribute

Optional Element Summary
Isolation | isolation The transaction isolation level.
Class<? extends Throwable>[] | noRollbackFor Defines zero (0) or more exception Classes, which must be a subclass of Throwable, indicating which exception types must not cause a transaction rollback.
String[] | noRollbackForClassName Defines zero (0) or more exception names (for exceptions which must be a subclass of Throwable) indicating which exception types must not cause a transaction rollback.
Propagation | propagation The transaction propagation type.
boolean | readOnly true if the transaction is read-only.
Class<? extends Throwable>[] | rollbackFor Defines zero (0) or more exception classes, which must be a subclass of Throwable, indicating which exception types must cause a transaction rollback.
String[] | rollbackForClassName Defines zero (0) or more exception names (for exceptions which must be a subclass of Throwable), indicating which exception types must cause a transaction rollback.
int | timeout The timeout for this transaction.
String | value A qualifier value for the specified transaction.

value

public abstract String value
A qualifier value for the specified transaction.

May be used to determine the target transaction manager, matching the qualifier value (or the bean name) of a specific PlatformTransactionManager bean definition.

Default:
""

propagation

public abstract Propagation propagation
The transaction propagation type. Defaults to Propagation.REQUIRED.

See Also:
TransactionDefinition.getPropagationBehavior()
Default:
org.springframework.transaction.annotation.Propagation.REQUIRED

isolation

public abstract Isolation isolation
The transaction isolation level. Defaults to Isolation.DEFAULT.

See Also:
TransactionDefinition.getIsolationLevel()
Default:
org.springframework.transaction.annotation.Isolation.DEFAULT

timeout

public abstract int timeout
The timeout for this transaction. Defaults to the default timeout of the underlying transaction system.

See Also:
TransactionDefinition.getTimeout()
Default:
-1

readOnly

public abstract boolean readOnly
true if the transaction is read-only. Defaults to false.

This just serves as a hint for the actual transaction subsystem; it will not necessarily cause failure of write access attempts. A transaction manager which cannot interpret the read-only hint will not throw an exception when asked for a read-only transaction.

See Also:
TransactionDefinition.isReadOnly()
Default:
false

rollbackFor

public abstract Class<? extends Throwable>[] rollbackFor
Defines zero (0) or more exception classes, which must be a subclass of Throwable, indicating which exception types must cause a transaction rollback.

This is the preferred way to construct a rollback rule, matching the exception class and subclasses.

Similar to RollbackRuleAttribute.RollbackRuleAttribute(Class clazz)

Default:
{}

rollbackForClassName

public abstract String[] rollbackForClassName
Defines zero (0) or more exception names (for exceptions which must be a subclass of Throwable), indicating which exception types must cause a transaction rollback.

This can be a substring, with no wildcard support at present. A value of "ServletException" would match ServletException and subclasses, for example.

NB: Consider carefully how specific the pattern is, and whether to include package information (which isn't mandatory). For example, "Exception" will match nearly anything, and will probably hide other rules. "java.lang.Exception" would be correct if "Exception" was meant to define a rule for all checked exceptions. With more unusual Exception names such as "BaseBusinessException" there is no need to use a FQN.

Similar to RollbackRuleAttribute.RollbackRuleAttribute(String exceptionName)

Default:
{}

noRollbackFor

public abstract Class<? extends Throwable>[] noRollbackFor
Defines zero (0) or more exception Classes, which must be a subclass of Throwable, indicating which exception types must not cause a transaction rollback.

This is the preferred way to construct a rollback rule, matching the exception class and subclasses.

Similar to NoRollbackRuleAttribute.NoRollbackRuleAttribute(Class clazz)

Default:
{}

noRollbackForClassName

public abstract String[] noRollbackForClassName
Defines zero (0) or more exception names (for exceptions which must be a subclass of Throwable) indicating which exception types must not cause a transaction rollback.

See the description of rollbackForClassName() for more info on how the specified names are treated.

Similar to NoRollbackRuleAttribute.NoRollbackRuleAttribute(String exceptionName)

Default:
{}
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


org.springframework.transaction.config

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.transaction.config

Support package for declarative transaction configuration, with XML schema being the primary configuration format.

See:
Description

Class Summary
JtaTransactionManagerBeanDefinitionParser | Parser for the <tx:jta-transaction-manager/> element, autodetecting BEA WebLogic, IBM WebSphere and Oracle OC4J.
TxNamespaceHandler | NamespaceHandler allowing for the configuration of declarative transaction management using either XML or using annotations.

Package org.springframework.transaction.config Description

Support package for declarative transaction configuration, with XML schema being the primary configuration format.


org.springframework.transaction.config Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.transaction.config

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.beans.factory.xml.AbstractBeanDefinitionParser (implements org.springframework.beans.factory.xml.BeanDefinitionParser)
      • org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
        • org.springframework.transaction.config.JtaTransactionManagerBeanDefinitionParser
    • org.springframework.beans.factory.xml.NamespaceHandlerSupport (implements org.springframework.beans.factory.xml.NamespaceHandler)
      • org.springframework.transaction.config.TxNamespaceHandler


JtaTransactionManagerBeanDefinitionParser

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.transaction.config
Class JtaTransactionManagerBeanDefinitionParser

java.lang.Object
    extended by  org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
        extended by  org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
            extended by  org.springframework.transaction.config.JtaTransactionManagerBeanDefinitionParser
All Implemented Interfaces:
BeanDefinitionParser
public class JtaTransactionManagerBeanDefinitionParser
extends AbstractSingleBeanDefinitionParser

Parser for the <tx:jta-transaction-manager/> element, autodetecting BEA WebLogic, IBM WebSphere and Oracle OC4J.

Since:
2.5
Author:
Juergen Hoeller, Christian Dupuis

Field Summary
Fields inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
ID_ATTRIBUTE, NAME_ATTRIBUTE
Constructor Summary
JtaTransactionManagerBeanDefinitionParser()
Method Summary
protected String | getBeanClassName(Element element) Determine the bean class name corresponding to the supplied Element.
protected String | resolveId(Element element, AbstractBeanDefinition definition, ParserContext parserContext) Resolve the ID for the supplied BeanDefinition.
Methods inherited from class org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
doParse, doParse, getBeanClass, getParentName, parseInternal
Methods inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
parse, postProcessComponentDefinition, registerBeanDefinition, shouldFireEvents, shouldGenerateId, shouldGenerateIdAsFallback
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JtaTransactionManagerBeanDefinitionParser

public JtaTransactionManagerBeanDefinitionParser()
Method Detail

getBeanClassName

protected String getBeanClassName(Element element)
Description copied from class: AbstractSingleBeanDefinitionParser
Determine the bean class name corresponding to the supplied Element.

Overrides:
getBeanClassName in class AbstractSingleBeanDefinitionParser
Parameters:
element - the Element that is being parsed
Returns:
the class name of the bean that is being defined via parsing the supplied Element, or null if none
See Also:
AbstractSingleBeanDefinitionParser.getBeanClass(org.w3c.dom.Element)

resolveId

protected String resolveId(Element element,
                           AbstractBeanDefinition definition,
                           ParserContext parserContext)
Description copied from class: AbstractBeanDefinitionParser
Resolve the ID for the supplied BeanDefinition.

When using generation, a name is generated automatically. Otherwise, the ID is extracted from the "id" attribute, potentially with a fallback to a generated id.

Overrides:
resolveId in class AbstractBeanDefinitionParser
Parameters:
element - the element that the bean definition has been built from
definition - the bean definition to be registered
parserContext - the object encapsulating the current state of the parsing process; provides access to a BeanDefinitionRegistry
Returns:
the resolved id
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


TxNamespaceHandler

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.transaction.config
Class TxNamespaceHandler

java.lang.Object
    extended by  org.springframework.beans.factory.xml.NamespaceHandlerSupport
        extended by  org.springframework.transaction.config.TxNamespaceHandler
All Implemented Interfaces:
NamespaceHandler
public class TxNamespaceHandler
extends NamespaceHandlerSupport

NamespaceHandler allowing for the configuration of declarative transaction management using either XML or using annotations.

This namespace handler is the central piece of functionality in the Spring transaction management facilities and offers two approaches to declaratively manage transactions.

One approach uses transaction semantics defined in XML using the <tx:advice> elements, the other uses annotations in combination with the <tx:annotation-driven> element. Both approached are detailed to great extent in the Spring reference manual.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller

Constructor Summary
TxNamespaceHandler()
Method Summary
 void init()
Invoked by the DefaultBeanDefinitionDocumentReader after construction but before any custom elements are parsed.
Methods inherited from class org.springframework.beans.factory.xml.NamespaceHandlerSupport
decorate, parse, registerBeanDefinitionDecorator, registerBeanDefinitionDecoratorForAttribute, registerBeanDefinitionParser
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TxNamespaceHandler

public TxNamespaceHandler()
Method Detail

init

public void init()
Description copied from interface: NamespaceHandler
Invoked by the DefaultBeanDefinitionDocumentReader after construction but before any custom elements are parsed.

See Also:
NamespaceHandlerSupport.registerBeanDefinitionParser(String, BeanDefinitionParser)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.transaction.interceptor

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.transaction.interceptor

AOP-based solution for declarative transaction demarcation.

See:
Description

Interface Summary
TransactionAttribute | This interface adds a rollbackOn specification to TransactionDefinition.
TransactionAttributeSource | Interface used by TransactionInterceptor.

Class Summary
AbstractFallbackTransactionAttributeSource | Abstract implementation of TransactionAttributeSource that caches attributes for methods and implements a fallback policy: 1.
BeanFactoryTransactionAttributeSourceAdvisor | Advisor driven by a TransactionAttributeSource, used to include a transaction advice bean for methods that are transactional.
CompositeTransactionAttributeSource | Composite TransactionAttributeSource implementation that iterates over a given array of TransactionAttributeSource instances.
DefaultTransactionAttribute | Transaction attribute that takes the EJB approach to rolling back on runtime, but not checked, exceptions.
DelegatingTransactionAttribute | TransactionAttribute implementation that delegates all calls to a given target TransactionAttribute instance.
MatchAlwaysTransactionAttributeSource | Very simple implementation of TransactionAttributeSource which will always return the same TransactionAttribute for all methods fed to it.
MethodMapTransactionAttributeSource | Simple TransactionAttributeSource implementation that allows attributes to be stored per method in a Map.
NameMatchTransactionAttributeSource | Simple TransactionAttributeSource implementation that allows attributes to be matched by registered name.
NoRollbackRuleAttribute | Tag subclass of RollbackRuleAttribute that has the opposite behavior to the RollbackRuleAttribute superclass.
RollbackRuleAttribute | Rule determining whether or not a given exception (and any subclasses) should cause a rollback.
RuleBasedTransactionAttribute | TransactionAttribute implementation that works out whether a given exception should cause transaction rollback by applying a number of rollback rules, both positive and negative.
TransactionAspectSupport | Base class for transactional aspects, such as the TransactionInterceptor or an AspectJ aspect.
TransactionAspectUtils | Utility methods for obtaining a PlatformTransactionManager by qualifier value.
TransactionAttributeEditor | PropertyEditor for TransactionAttribute objects.
TransactionAttributeSourceAdvisor | Advisor driven by a TransactionAttributeSource, used to include a TransactionInterceptor only for methods that are transactional.
TransactionAttributeSourceEditor | Property editor that converts a String into a TransactionAttributeSource.
TransactionInterceptor | AOP Alliance MethodInterceptor for declarative transaction management using the common Spring transaction infrastructure (PlatformTransactionManager).
TransactionProxyFactoryBean | Proxy factory bean for simplified declarative transaction handling.

Package org.springframework.transaction.interceptor Description

AOP-based solution for declarative transaction demarcation. Builds on the AOP infrastructure in org.springframework.aop.framework. Any POJO can be transactionally advised with Spring.

The TransactionFactoryProxyBean can be used to create transactional AOP proxies transparently to code that uses them.

The TransactionInterceptor is the AOP Alliance MethodInterceptor that delivers transactional advice, based on the Spring transaction abstraction. This allows declarative transaction management in any environment, even without JTA if an application uses only a single database.


org.springframework.transaction.interceptor Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.transaction.interceptor

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.transaction.interceptor.AbstractFallbackTransactionAttributeSource (implements org.springframework.transaction.interceptor.TransactionAttributeSource)
    • org.springframework.aop.support.AbstractPointcutAdvisor (implements org.springframework.core.Ordered, org.springframework.aop.PointcutAdvisor, java.io.Serializable)
      • org.springframework.aop.support.AbstractBeanFactoryPointcutAdvisor (implements org.springframework.beans.factory.BeanFactoryAware)
        • org.springframework.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor
      • org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor
    • org.springframework.transaction.interceptor.CompositeTransactionAttributeSource (implements java.io.Serializable, org.springframework.transaction.interceptor.TransactionAttributeSource)
    • org.springframework.transaction.support.DefaultTransactionDefinition (implements java.io.Serializable, org.springframework.transaction.TransactionDefinition)
      • org.springframework.transaction.interceptor.DefaultTransactionAttribute (implements org.springframework.transaction.interceptor.TransactionAttribute)
        • org.springframework.transaction.interceptor.RuleBasedTransactionAttribute (implements java.io.Serializable)
    • org.springframework.transaction.support.DelegatingTransactionDefinition (implements java.io.Serializable, org.springframework.transaction.TransactionDefinition)
      • org.springframework.transaction.interceptor.DelegatingTransactionAttribute (implements java.io.Serializable, org.springframework.transaction.interceptor.TransactionAttribute)
    • org.springframework.transaction.interceptor.MatchAlwaysTransactionAttributeSource (implements java.io.Serializable, org.springframework.transaction.interceptor.TransactionAttributeSource)
    • org.springframework.transaction.interceptor.MethodMapTransactionAttributeSource (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.InitializingBean, org.springframework.transaction.interceptor.TransactionAttributeSource)
    • org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource (implements java.io.Serializable, org.springframework.transaction.interceptor.TransactionAttributeSource)
    • java.beans.PropertyEditorSupport (implements java.beans.PropertyEditor)
      • org.springframework.transaction.interceptor.TransactionAttributeEditor
      • org.springframework.transaction.interceptor.TransactionAttributeSourceEditor
    • org.springframework.aop.framework.ProxyConfig (implements java.io.Serializable)
      • org.springframework.aop.framework.AbstractSingletonProxyFactoryBean (implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean)
        • org.springframework.transaction.interceptor.TransactionProxyFactoryBean (implements org.springframework.beans.factory.BeanFactoryAware)
    • org.springframework.transaction.interceptor.RollbackRuleAttribute (implements java.io.Serializable)
      • org.springframework.transaction.interceptor.NoRollbackRuleAttribute
    • org.springframework.transaction.interceptor.TransactionAspectSupport (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean)
      • org.springframework.transaction.interceptor.TransactionInterceptor (implements org.aopalliance.intercept.MethodInterceptor, java.io.Serializable)
    • org.springframework.transaction.interceptor.TransactionAspectSupport.TransactionInfo
    • org.springframework.transaction.interceptor.TransactionAspectUtils

Interface Hierarchy

  • org.springframework.transaction.interceptor.TransactionAttributeSource
  • org.springframework.transaction.TransactionDefinition
    • org.springframework.transaction.interceptor.TransactionAttribute


TransactionAttribute

org.springframework.transaction.interceptor
Interface TransactionAttribute

All Superinterfaces:
TransactionDefinition
All Known Implementing Classes:
DefaultTransactionAttribute, DelegatingTransactionAttribute, RuleBasedTransactionAttribute
public interface TransactionAttribute
extends TransactionDefinition

This interface adds a rollbackOn specification to TransactionDefinition. As custom rollbackOn is only possible with AOP, this class resides in the AOP transaction package.

Since:
16.03.2003
Author:
Rod Johnson, Juergen Hoeller
See Also:
DefaultTransactionAttribute, RuleBasedTransactionAttribute

Field Summary
Fields inherited from interface org.springframework.transaction.TransactionDefinition
ISOLATION_DEFAULT, ISOLATION_READ_COMMITTED, ISOLATION_READ_UNCOMMITTED, ISOLATION_REPEATABLE_READ, ISOLATION_SERIALIZABLE, PROPAGATION_MANDATORY, PROPAGATION_NESTED, PROPAGATION_NEVER, PROPAGATION_NOT_SUPPORTED, PROPAGATION_REQUIRED, PROPAGATION_REQUIRES_NEW, PROPAGATION_SUPPORTS, TIMEOUT_DEFAULT
Method Summary
String | getQualifier() Return a qualifier value associated with this transaction attribute.
boolean | rollbackOn(Throwable ex) Should we roll back on the given exception?
Methods inherited from interface org.springframework.transaction.TransactionDefinition
getIsolationLevel, getName, getPropagationBehavior, getTimeout, isReadOnly

Method Detail

getQualifier

String getQualifier()
Return a qualifier value associated with this transaction attribute.

This may be used for choosing a corresponding transaction manager to process this specific transaction.

rollbackOn

boolean rollbackOn(Throwable ex)
Should we roll back on the given exception?

Parameters:
ex - the exception to evaluate
Returns:
whether to perform a rollback or not
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionAttributeSource

org.springframework.transaction.interceptor
Interface TransactionAttributeSource

All Known Implementing Classes:
AbstractFallbackTransactionAttributeSource, AnnotationTransactionAttributeSource, CompositeTransactionAttributeSource, MatchAlwaysTransactionAttributeSource, MethodMapTransactionAttributeSource, NameMatchTransactionAttributeSource
public interface TransactionAttributeSource

Interface used by TransactionInterceptor. Implementations know how to source transaction attributes, whether from configuration, metadata attributes at source level, or anywhere else.

Since:
15.04.2003
Author:
Rod Johnson
See Also:
TransactionAspectSupport.setTransactionAttributeSource(org.springframework.transaction.interceptor.TransactionAttributeSource), TransactionProxyFactoryBean.setTransactionAttributeSource(org.springframework.transaction.interceptor.TransactionAttributeSource)

Method Summary
 TransactionAttribute getTransactionAttribute(Method method, Class targetClass)
Return the transaction attribute for this method.

Method Detail

getTransactionAttribute

TransactionAttribute getTransactionAttribute(Method method,
                                             Class targetClass)
Return the transaction attribute for this method. Return null if the method is non-transactional.

Parameters:
method - method
targetClass - target class. May be null, in which case the declaring class of the method must be used.
Returns:
TransactionAttribute the matching transaction attribute, or null if none found
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractFallbackTransactionAttributeSource

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.transaction.interceptor
Class AbstractFallbackTransactionAttributeSource

java.lang.Object
    extended by  org.springframework.transaction.interceptor.AbstractFallbackTransactionAttributeSource
All Implemented Interfaces:
TransactionAttributeSource
Direct Known Subclasses:
AnnotationTransactionAttributeSource
public abstract class AbstractFallbackTransactionAttributeSource
extends Object
implements TransactionAttributeSource

Abstract implementation of TransactionAttributeSource that caches attributes for methods and implements a fallback policy: 1. specific target method; 2. target class; 3. declaring method; 4. declaring class/interface.

Defaults to using the target class's transaction attribute if none is associated with the target method. Any transaction attribute associated with the target method completely overrides a class transaction attribute. If none found on the target class, the interface that the invoked method has been called through (in case of a JDK proxy) will be checked.

This implementation caches attributes by method after they are first used. If it is ever desirable to allow dynamic changing of transaction attributes (which is very unlikely), caching could be made configurable. Caching is desirable because of the cost of evaluating rollback rules.

Since:
1.1
Author:
Rod Johnson, Juergen Hoeller

Field Summary
protected  Log logger
Logger available to subclasses.
Constructor Summary
AbstractFallbackTransactionAttributeSource()
Method Summary
protected boolean | allowPublicMethodsOnly() Should only public methods be allowed to have transactional semantics?
protected abstract TransactionAttribute | findTransactionAttribute(Class clazz) Subclasses need to implement this to return the transaction attribute for the given class, if any.
protected abstract TransactionAttribute | findTransactionAttribute(Method method) Subclasses need to implement this to return the transaction attribute for the given method, if any.
protected Object | getCacheKey(Method method, Class targetClass) Determine a cache key for the given method and target class.
TransactionAttribute | getTransactionAttribute(Method method, Class targetClass) Determine the transaction attribute for this method invocation.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses.

As this base class is not marked Serializable, the logger will be recreated after serialization - provided that the concrete subclass is Serializable.

Constructor Detail

AbstractFallbackTransactionAttributeSource

public AbstractFallbackTransactionAttributeSource()
Method Detail

getTransactionAttribute

public TransactionAttribute getTransactionAttribute(Method method,
                                                    Class targetClass)
Determine the transaction attribute for this method invocation.

Defaults to the class's transaction attribute if no method attribute is found.

Specified by:
getTransactionAttribute in interface TransactionAttributeSource
Parameters:
method - the method for the current invocation (never null)
targetClass - the target class for this invocation (may be null)
Returns:
TransactionAttribute for this method, or null if the method is not transactional

getCacheKey

protected Object getCacheKey(Method method,
                             Class targetClass)
Determine a cache key for the given method and target class.

Must not produce same key for overloaded methods. Must produce same key for different instances of the same method.

Parameters:
method - the method (never null)
targetClass - the target class (may be null)
Returns:
the cache key (never null)

findTransactionAttribute

protected abstract TransactionAttribute findTransactionAttribute(Method method)
Subclasses need to implement this to return the transaction attribute for the given method, if any.

Parameters:
method - the method to retrieve the attribute for
Returns:
all transaction attribute associated with this method (or null if none)

findTransactionAttribute

protected abstract TransactionAttribute findTransactionAttribute(Class clazz)
Subclasses need to implement this to return the transaction attribute for the given class, if any.

Parameters:
clazz - the class to retrieve the attribute for
Returns:
all transaction attribute associated with this class (or null if none)

allowPublicMethodsOnly

protected boolean allowPublicMethodsOnly()
Should only public methods be allowed to have transactional semantics?

The default implementation returns false.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


BeanFactoryTransactionAttributeSourceAdvisor

org.springframework.transaction.interceptor
Class BeanFactoryTransactionAttributeSourceAdvisor

java.lang.Object
    extended by  org.springframework.aop.support.AbstractPointcutAdvisor
        extended by  org.springframework.aop.support.AbstractBeanFactoryPointcutAdvisor
            extended by  org.springframework.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor
All Implemented Interfaces:
Serializable, Advisor, PointcutAdvisor, BeanFactoryAware, Ordered
public class BeanFactoryTransactionAttributeSourceAdvisor
extends AbstractBeanFactoryPointcutAdvisor

Advisor driven by a TransactionAttributeSource, used to include a transaction advice bean for methods that are transactional.

Since:
2.5.5
Author:
Juergen Hoeller
See Also:
AbstractBeanFactoryPointcutAdvisor.setAdviceBeanName(java.lang.String), TransactionInterceptor, TransactionAttributeSourceAdvisor, Serialized Form

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
BeanFactoryTransactionAttributeSourceAdvisor()
Method Summary
Pointcut | getPointcut() Get the Pointcut that drives this advisor.
void | setClassFilter(ClassFilter classFilter) Set the ClassFilter to use for this pointcut.
void | setTransactionAttributeSource(TransactionAttributeSource transactionAttributeSource) Set the transaction attribute source which is used to find transaction attributes.
Methods inherited from class org.springframework.aop.support.AbstractBeanFactoryPointcutAdvisor
getAdvice, getAdviceBeanName, setAdviceBeanName, setBeanFactory, toString
Methods inherited from class org.springframework.aop.support.AbstractPointcutAdvisor
equals, getOrder, hashCode, isPerInstance, setOrder
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

BeanFactoryTransactionAttributeSourceAdvisor

public BeanFactoryTransactionAttributeSourceAdvisor()
Method Detail

setTransactionAttributeSource

public void setTransactionAttributeSource(TransactionAttributeSource transactionAttributeSource)
Set the transaction attribute source which is used to find transaction attributes. This should usually be identical to the source reference set on the transaction interceptor itself.

See Also:
TransactionAspectSupport.setTransactionAttributeSource(org.springframework.transaction.interceptor.TransactionAttributeSource)

setClassFilter

public void setClassFilter(ClassFilter classFilter)
Set the ClassFilter to use for this pointcut. Default is ClassFilter.TRUE.

getPointcut

public Pointcut getPointcut()
Description copied from interface: PointcutAdvisor
Get the Pointcut that drives this advisor.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CompositeTransactionAttributeSource

org.springframework.transaction.interceptor
Class CompositeTransactionAttributeSource

java.lang.Object
    extended by  org.springframework.transaction.interceptor.CompositeTransactionAttributeSource
All Implemented Interfaces:
Serializable, TransactionAttributeSource
public class CompositeTransactionAttributeSource
extends Object
implements TransactionAttributeSource, Serializable

Composite TransactionAttributeSource implementation that iterates over a given array of TransactionAttributeSource instances.

Since:
2.0
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
CompositeTransactionAttributeSource(TransactionAttributeSource[] transactionAttributeSources)
Create a new CompositeTransactionAttributeSource for the given sources.
Method Summary
TransactionAttribute | getTransactionAttribute(Method method, Class targetClass) Return the transaction attribute for this method.
TransactionAttributeSource[] | getTransactionAttributeSources() Return the TransactionAttributeSource instances that this CompositeTransactionAttributeSource combines.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CompositeTransactionAttributeSource

public CompositeTransactionAttributeSource(TransactionAttributeSource[] transactionAttributeSources)
Create a new CompositeTransactionAttributeSource for the given sources.

Parameters:
transactionAttributeSources - the TransactionAttributeSource instances to combine
Method Detail

getTransactionAttributeSources

public final TransactionAttributeSource[] getTransactionAttributeSources()
Return the TransactionAttributeSource instances that this CompositeTransactionAttributeSource combines.

getTransactionAttribute

public TransactionAttribute getTransactionAttribute(Method method,
                                                    Class targetClass)
Description copied from interface: TransactionAttributeSource
Return the transaction attribute for this method. Return null if the method is non-transactional.

Specified by:
getTransactionAttribute in interface TransactionAttributeSource
Parameters:
method - method
targetClass - target class. May be null, in which case the declaring class of the method must be used.
Returns:
TransactionAttribute the matching transaction attribute, or null if none found
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultTransactionAttribute

org.springframework.transaction.interceptor
Class DefaultTransactionAttribute

java.lang.Object
    extended by  org.springframework.transaction.support.DefaultTransactionDefinition
        extended by  org.springframework.transaction.interceptor.DefaultTransactionAttribute
All Implemented Interfaces:
Serializable, TransactionAttribute, TransactionDefinition
Direct Known Subclasses:
RuleBasedTransactionAttribute
public class DefaultTransactionAttribute
extends DefaultTransactionDefinition
implements TransactionAttribute

Transaction attribute that takes the EJB approach to rolling back on runtime, but not checked, exceptions.

Since:
16.03.2003
Author:
Rod Johnson
See Also:
Serialized Form

Field Summary
Fields inherited from class org.springframework.transaction.support.DefaultTransactionDefinition
PREFIX_ISOLATION, PREFIX_PROPAGATION, PREFIX_TIMEOUT, READ_ONLY_MARKER
Fields inherited from interface org.springframework.transaction.TransactionDefinition
ISOLATION_DEFAULT, ISOLATION_READ_COMMITTED, ISOLATION_READ_UNCOMMITTED, ISOLATION_REPEATABLE_READ, ISOLATION_SERIALIZABLE, PROPAGATION_MANDATORY, PROPAGATION_NESTED, PROPAGATION_NEVER, PROPAGATION_NOT_SUPPORTED, PROPAGATION_REQUIRED, PROPAGATION_REQUIRES_NEW, PROPAGATION_SUPPORTS, TIMEOUT_DEFAULT
Constructor Summary
DefaultTransactionAttribute()
Create a new DefaultTransactionAttribute, with default settings.
DefaultTransactionAttribute(int propagationBehavior)
Create a new DefaultTransactionAttribute with the the given propagation behavior.
DefaultTransactionAttribute(TransactionAttribute other)
Copy constructor.
Method Summary
protected StringBuilder | getAttributeDescription() Return an identifying description for this transaction attribute.
String | getQualifier() Return a qualifier value associated with this transaction attribute.
boolean | rollbackOn(Throwable ex) The default behavior is as with EJB: rollback on unchecked exception.
void | setQualifier(String qualifier) Associate a qualifier value with this transaction attribute.
Methods inherited from class org.springframework.transaction.support.DefaultTransactionDefinition
equals, getDefinitionDescription, getIsolationLevel, getName, getPropagationBehavior, getTimeout, hashCode, isReadOnly, setIsolationLevel, setIsolationLevelName, setName, setPropagationBehavior, setPropagationBehaviorName, setReadOnly, setTimeout, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.transaction.TransactionDefinition
getIsolationLevel, getName, getPropagationBehavior, getTimeout, isReadOnly

Constructor Detail

DefaultTransactionAttribute

public DefaultTransactionAttribute()
Create a new DefaultTransactionAttribute, with default settings. Can be modified through bean property setters.

See Also:
DefaultTransactionDefinition.setPropagationBehavior(int),
DefaultTransactionDefinition.setIsolationLevel(int),
DefaultTransactionDefinition.setTimeout(int),
DefaultTransactionDefinition.setReadOnly(boolean),
DefaultTransactionDefinition.setName(java.lang.String)

DefaultTransactionAttribute

public DefaultTransactionAttribute(TransactionAttribute other)
Copy constructor. Definition can be modified through bean property setters.

See Also:
DefaultTransactionDefinition.setPropagationBehavior(int),
DefaultTransactionDefinition.setIsolationLevel(int),
DefaultTransactionDefinition.setTimeout(int),
DefaultTransactionDefinition.setReadOnly(boolean),
DefaultTransactionDefinition.setName(java.lang.String)

DefaultTransactionAttribute

public DefaultTransactionAttribute(int propagationBehavior)
Create a new DefaultTransactionAttribute with the the given propagation behavior. Can be modified through bean property setters.

Parameters:
propagationBehavior - one of the propagation constants in the TransactionDefinition interface
See Also:
DefaultTransactionDefinition.setIsolationLevel(int),
DefaultTransactionDefinition.setTimeout(int),
DefaultTransactionDefinition.setReadOnly(boolean)
Method Detail

setQualifier

public void setQualifier(String qualifier)
Associate a qualifier value with this transaction attribute.

This may be used for choosing a corresponding transaction manager to process this specific transaction.

getQualifier

public String getQualifier()
Return a qualifier value associated with this transaction attribute.

Specified by:
getQualifier in interface TransactionAttribute

rollbackOn

public boolean rollbackOn(Throwable ex)
The default behavior is as with EJB: rollback on unchecked exception. Additionally attempt to rollback on Error.

This is consistent with TransactionTemplate's default behavior.

Specified by:
rollbackOn in interface TransactionAttribute
Parameters:
ex - the exception to evaluate
Returns:
whether to perform a rollback or not

getAttributeDescription

protected final StringBuilder getAttributeDescription()
Return an identifying description for this transaction attribute.

Available to subclasses, for inclusion in their toString() result.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DelegatingTransactionAttribute

org.springframework.transaction.interceptor
Class DelegatingTransactionAttribute

java.lang.Object
    extended by  org.springframework.transaction.support.DelegatingTransactionDefinition
        extended by  org.springframework.transaction.interceptor.DelegatingTransactionAttribute
All Implemented Interfaces:
Serializable, TransactionAttribute, TransactionDefinition
public abstract class DelegatingTransactionAttribute
extends DelegatingTransactionDefinition
implements TransactionAttribute, Serializable

TransactionAttribute implementation that delegates all calls to a given target TransactionAttribute instance. Abstract because it is meant to be subclassed, with subclasses overriding specific methods that are not supposed to simply delegate to the target instance.

Since:
1.2
Author:
Juergen Hoeller
See Also:
Serialized Form

Field Summary
Fields inherited from interface org.springframework.transaction.TransactionDefinition
ISOLATION_DEFAULT, ISOLATION_READ_COMMITTED, ISOLATION_READ_UNCOMMITTED, ISOLATION_REPEATABLE_READ, ISOLATION_SERIALIZABLE, PROPAGATION_MANDATORY, PROPAGATION_NESTED, PROPAGATION_NEVER, PROPAGATION_NOT_SUPPORTED, PROPAGATION_REQUIRED, PROPAGATION_REQUIRES_NEW, PROPAGATION_SUPPORTS, TIMEOUT_DEFAULT
Constructor Summary
DelegatingTransactionAttribute(TransactionAttribute targetAttribute)
Create a DelegatingTransactionAttribute for the given target attribute.
Method Summary
String | getQualifier() Return a qualifier value associated with this transaction attribute.
boolean | rollbackOn(Throwable ex) Should we roll back on the given exception?
Methods inherited from class org.springframework.transaction.support.DelegatingTransactionDefinition
equals, getIsolationLevel, getName, getPropagationBehavior, getTimeout, hashCode, isReadOnly, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.transaction.TransactionDefinition
getIsolationLevel, getName, getPropagationBehavior, getTimeout, isReadOnly

Constructor Detail

DelegatingTransactionAttribute

public DelegatingTransactionAttribute(TransactionAttribute targetAttribute)
Create a DelegatingTransactionAttribute for the given target attribute.

Parameters:
targetAttribute - the target TransactionAttribute to delegate to
Method Detail

getQualifier

public String getQualifier()
Description copied from interface: TransactionAttribute
Return a qualifier value associated with this transaction attribute.

This may be used for choosing a corresponding transaction manager to process this specific transaction.

Specified by:
getQualifier in interface TransactionAttribute

rollbackOn

public boolean rollbackOn(Throwable ex)
Description copied from interface: TransactionAttribute
Should we roll back on the given exception?

Specified by:
rollbackOn in interface TransactionAttribute
Parameters:
ex - the exception to evaluate
Returns:
whether to perform a rollback or not
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MatchAlwaysTransactionAttributeSource

org.springframework.transaction.interceptor
Class MatchAlwaysTransactionAttributeSource

java.lang.Object
    extended by  org.springframework.transaction.interceptor.MatchAlwaysTransactionAttributeSource
All Implemented Interfaces:
Serializable, TransactionAttributeSource
public class MatchAlwaysTransactionAttributeSource
extends Object
implements TransactionAttributeSource, Serializable

Very simple implementation of TransactionAttributeSource which will always return the same TransactionAttribute for all methods fed to it. The TransactionAttribute may be specified, but will otherwise default to PROPAGATION_REQUIRED. This may be used in the cases where you want to use the same transaction attribute with all methods being handled by a transaction interceptor.

Since:
15.10.2003
Author:
Colin Sampaleanu
See Also:
TransactionProxyFactoryBean, BeanNameAutoProxyCreator, Serialized Form

Constructor Summary
MatchAlwaysTransactionAttributeSource()
Method Summary
boolean | equals(Object other)
TransactionAttribute | getTransactionAttribute(Method method, Class targetClass) Return the transaction attribute for this method.
int | hashCode()
void | setTransactionAttribute(TransactionAttribute transactionAttribute) Allows a transaction attribute to be specified, using the String form, for example, "PROPAGATION_REQUIRED".
String | toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

MatchAlwaysTransactionAttributeSource

public MatchAlwaysTransactionAttributeSource()
Method Detail

setTransactionAttribute

public void setTransactionAttribute(TransactionAttribute transactionAttribute)
Allows a transaction attribute to be specified, using the String form, for example, "PROPAGATION_REQUIRED".

Parameters:
transactionAttribute - The String form of the transactionAttribute to use.
See Also:
TransactionAttributeEditor

getTransactionAttribute

public TransactionAttribute getTransactionAttribute(Method method,
                                                    Class targetClass)
Description copied from interface: TransactionAttributeSource
Return the transaction attribute for this method. Return null if the method is non-transactional.

Specified by:
getTransactionAttribute in interface TransactionAttributeSource
Parameters:
method - method
targetClass - target class. May be null, in which case the declaring class of the method must be used.
Returns:
TransactionAttribute the matching transaction attribute, or null if none found

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MethodMapTransactionAttributeSource

org.springframework.transaction.interceptor
Class MethodMapTransactionAttributeSource

java.lang.Object
    extended by  org.springframework.transaction.interceptor.MethodMapTransactionAttributeSource
All Implemented Interfaces:
BeanClassLoaderAware, InitializingBean, TransactionAttributeSource
public class MethodMapTransactionAttributeSource
extends Object
implements TransactionAttributeSource, BeanClassLoaderAware, InitializingBean

Simple TransactionAttributeSource implementation that allows attributes to be stored per method in a Map.

Since:
24.04.2003
Author:
Rod Johnson, Juergen Hoeller
See Also:
isMatch(java.lang.String, java.lang.String), NameMatchTransactionAttributeSource

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
MethodMapTransactionAttributeSource()
Method Summary
void | addTransactionalMethod(Class clazz, String mappedName, TransactionAttribute attr) Add an attribute for a transactional method.
void | addTransactionalMethod(Method method, TransactionAttribute attr) Add an attribute for a transactional method.
void | addTransactionalMethod(String name, TransactionAttribute attr) Add an attribute for a transactional method.
void | afterPropertiesSet() Eagerly initializes the specified "methodMap", if any.
boolean | equals(Object other)
TransactionAttribute | getTransactionAttribute(Method method, Class targetClass) Return the transaction attribute for this method.
int | hashCode()
protected void | initMethodMap(Map<String,TransactionAttribute> methodMap) Initialize the specified "methodMap", if any.
protected boolean | isMatch(String methodName, String mappedName) Return if the given method name matches the mapped name.
void | setBeanClassLoader(ClassLoader beanClassLoader) Callback that supplies the bean class loader to a bean instance.
void | setMethodMap(Map<String,TransactionAttribute> methodMap) Set a name/attribute map, consisting of "FQCN.method" method names (e.g.
String | toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

MethodMapTransactionAttributeSource

public MethodMapTransactionAttributeSource()
Method Detail

setMethodMap

public void setMethodMap(Map<String,TransactionAttribute> methodMap)
Set a name/attribute map, consisting of "FQCN.method" method names (e.g. "com.mycompany.mycode.MyClass.myMethod") and TransactionAttribute instances (or Strings to be converted to TransactionAttribute instances).

Intended for configuration via setter injection, typically within a Spring bean factory. Relies on afterPropertiesSet() being called afterwards.

Parameters:
methodMap - said Map from method name to attribute value
See Also:
TransactionAttribute, TransactionAttributeEditor

setBeanClassLoader

public void setBeanClassLoader(ClassLoader beanClassLoader)
Description copied from interface: BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean.afterPropertiesSet() method or a custom init-method.

Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Parameters:
beanClassLoader - the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via ClassUtils.getDefaultClassLoader()

afterPropertiesSet

public void afterPropertiesSet()
Eagerly initializes the specified "methodMap", if any.

Specified by:
afterPropertiesSet in interface InitializingBean
See Also:
initMethodMap(java.util.Map)

initMethodMap

protected void initMethodMap(Map<String,TransactionAttribute> methodMap)
Initialize the specified "methodMap", if any.

Parameters:
methodMap - Map from method names to TransactionAttribute instances
See Also:
setMethodMap(java.util.Map)

addTransactionalMethod

public void addTransactionalMethod(String name,
                                   TransactionAttribute attr)
Add an attribute for a transactional method.

Method names can end or start with "*" for matching multiple methods.

Parameters:
name - class and method name, separated by a dot
attr - attribute associated with the method
Throws:
IllegalArgumentException - in case of an invalid name

addTransactionalMethod

public void addTransactionalMethod(Class clazz,
                                   String mappedName,
                                   TransactionAttribute attr)
Add an attribute for a transactional method. Method names can end or start with "*" for matching multiple methods.

Parameters:
clazz - target interface or class
mappedName - mapped method name
attr - attribute associated with the method

addTransactionalMethod

public void addTransactionalMethod(Method method,
                                   TransactionAttribute attr)
Add an attribute for a transactional method.

Parameters:
method - the method
attr - attribute associated with the method

isMatch

protected boolean isMatch(String methodName,
                          String mappedName)
Return if the given method name matches the mapped name.

The default implementation checks for "xxx*", "*xxx" and "*xxx*" matches, as well as direct equality.

Parameters:
methodName - the method name of the class
mappedName - the name in the descriptor
Returns:
if the names match
See Also:
PatternMatchUtils.simpleMatch(String, String)

getTransactionAttribute

public TransactionAttribute getTransactionAttribute(Method method,
                                                    Class targetClass)
Description copied from interface: TransactionAttributeSource
Return the transaction attribute for this method. Return null if the method is non-transactional.

Specified by:
getTransactionAttribute in interface TransactionAttributeSource
Parameters:
method - method
targetClass - target class. May be null, in which case the declaring class of the method must be used.
Returns:
TransactionAttribute the matching transaction attribute, or null if none found

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NameMatchTransactionAttributeSource

org.springframework.transaction.interceptor
Class NameMatchTransactionAttributeSource

java.lang.Object
    extended by  org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource
All Implemented Interfaces:
Serializable, TransactionAttributeSource
public class NameMatchTransactionAttributeSource
extends Object
implements TransactionAttributeSource, Serializable

Simple TransactionAttributeSource implementation that allows attributes to be matched by registered name.

Since:
21.08.2003
Author:
Juergen Hoeller
See Also:
isMatch(java.lang.String, java.lang.String), MethodMapTransactionAttributeSource, Serialized Form

Field Summary
protected static Log logger
Logger available to subclasses.
Constructor Summary
NameMatchTransactionAttributeSource()
Method Summary
void | addTransactionalMethod(String methodName, TransactionAttribute attr) Add an attribute for a transactional method.
boolean | equals(Object other)
TransactionAttribute | getTransactionAttribute(Method method, Class targetClass) Return the transaction attribute for this method.
int | hashCode()
protected boolean | isMatch(String methodName, String mappedName) Return if the given method name matches the mapped name.
void | setNameMap(Map<String,TransactionAttribute> nameMap) Set a name/attribute map, consisting of method names (e.g.
void | setProperties(Properties transactionAttributes) Parses the given properties into a name/attribute map.
String | toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail

logger

protected static final Log logger
Logger available to subclasses.

Static for optimal serialization.

Constructor Detail

NameMatchTransactionAttributeSource

public NameMatchTransactionAttributeSource()
Method Detail

setNameMap

public void setNameMap(Map<String,TransactionAttribute> nameMap)
Set a name/attribute map, consisting of method names (e.g. "myMethod") and TransactionAttribute instances (or Strings to be converted to TransactionAttribute instances).

See Also:
TransactionAttribute, TransactionAttributeEditor

setProperties

public void setProperties(Properties transactionAttributes)
Parses the given properties into a name/attribute map. Expects method names as keys and String attributes definitions as values, parsable into TransactionAttribute instances via TransactionAttributeEditor.

See Also:
setNameMap(java.util.Map), TransactionAttributeEditor

addTransactionalMethod

public void addTransactionalMethod(String methodName,
                                   TransactionAttribute attr)
Add an attribute for a transactional method.

Method names can be exact matches, or of the pattern "xxx*", "*xxx" or "*xxx*" for matching multiple methods.

Parameters:
methodName - the name of the method
attr - attribute associated with the method

getTransactionAttribute

public TransactionAttribute getTransactionAttribute(Method method,
                                                    Class targetClass)
Description copied from interface: TransactionAttributeSource
Return the transaction attribute for this method. Return null if the method is non-transactional.

Specified by:
getTransactionAttribute in interface TransactionAttributeSource
Parameters:
method - method
targetClass - target class. May be null, in which case the declaring class of the method must be used.
Returns:
TransactionAttribute the matching transaction attribute, or null if none found

isMatch

protected boolean isMatch(String methodName,
                          String mappedName)
Return if the given method name matches the mapped name.

The default implementation checks for "xxx*", "*xxx" and "*xxx*" matches, as well as direct equality. Can be overridden in subclasses.

Parameters:
methodName - the method name of the class
mappedName - the name in the descriptor
Returns:
if the names match
See Also:
PatternMatchUtils.simpleMatch(String, String)

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NoRollbackRuleAttribute

org.springframework.transaction.interceptor
Class NoRollbackRuleAttribute

java.lang.Object
    extended by  org.springframework.transaction.interceptor.RollbackRuleAttribute
        extended by  org.springframework.transaction.interceptor.NoRollbackRuleAttribute
All Implemented Interfaces:
Serializable
public class NoRollbackRuleAttribute
extends RollbackRuleAttribute

Tag subclass of RollbackRuleAttribute that has the opposite behavior to the RollbackRuleAttribute superclass.

Since:
09.04.2003
Author:
Rod Johnson
See Also:
Serialized Form

Field Summary
Fields inherited from class org.springframework.transaction.interceptor.RollbackRuleAttribute
ROLLBACK_ON_RUNTIME_EXCEPTIONS
Constructor Summary
NoRollbackRuleAttribute(Class clazz)
Create a new instance of the NoRollbackRuleAttribute class for the supplied Throwable class.
NoRollbackRuleAttribute(String exceptionName)
Create a new instance of the NoRollbackRuleAttribute class for the supplied exceptionName.
Method Summary
 String toString()
Methods inherited from class org.springframework.transaction.interceptor.RollbackRuleAttribute
equals, getDepth, getExceptionName, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

NoRollbackRuleAttribute

public NoRollbackRuleAttribute(Class clazz)
Create a new instance of the NoRollbackRuleAttribute class for the supplied Throwable class.

Parameters:
clazz - the Throwable class
See Also:
RollbackRuleAttribute.RollbackRuleAttribute(Class)

NoRollbackRuleAttribute

public NoRollbackRuleAttribute(String exceptionName)
Create a new instance of the NoRollbackRuleAttribute class for the supplied exceptionName.

Parameters:
exceptionName - the exception name pattern
See Also:
RollbackRuleAttribute.RollbackRuleAttribute(String)
Method Detail

toString

public String toString()
Overrides:
toString in class RollbackRuleAttribute
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RollbackRuleAttribute

org.springframework.transaction.interceptor
Class RollbackRuleAttribute

java.lang.Object
    extended by  org.springframework.transaction.interceptor.RollbackRuleAttribute
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
NoRollbackRuleAttribute
public class RollbackRuleAttribute
extends Object
implements Serializable

Rule determining whether or not a given exception (and any subclasses) should cause a rollback.

Multiple such rules can be applied to determine whether a transaction should commit or rollback after an exception has been thrown.

Since:
09.04.2003
Author:
Rod Johnson
See Also:
NoRollbackRuleAttribute, Serialized Form

Field Summary
static RollbackRuleAttribute ROLLBACK_ON_RUNTIME_EXCEPTIONS
The rollback rule for RuntimeExceptions.
Constructor Summary
RollbackRuleAttribute(Class clazz)
Create a new instance of the RollbackRuleAttribute class.
RollbackRuleAttribute(String exceptionName)
Create a new instance of the RollbackRuleAttribute class for the given exceptionName.
Method Summary
boolean | equals(Object other)
int | getDepth(Throwable ex) Return the depth of the superclass matching.
String | getExceptionName() Return the pattern for the exception name.
int | hashCode()
String | toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail

ROLLBACK_ON_RUNTIME_EXCEPTIONS

public static final RollbackRuleAttribute ROLLBACK_ON_RUNTIME_EXCEPTIONS
The rollback rule for RuntimeExceptions.

Constructor Detail

RollbackRuleAttribute

public RollbackRuleAttribute(Class clazz)
Create a new instance of the RollbackRuleAttribute class.

This is the preferred way to construct a rollback rule that matches the supplied Exception class (and subclasses).

Parameters:
clazz - throwable class; must be Throwable or a subclass of Throwable
Throws:
IllegalArgumentException - if the supplied clazz is not a Throwable type or is null

RollbackRuleAttribute

public RollbackRuleAttribute(String exceptionName)
Create a new instance of the RollbackRuleAttribute class for the given exceptionName.

This can be a substring, with no wildcard support at present. A value of "ServletException" would match javax.servlet.ServletException and subclasses, for example.

NB: Consider carefully how specific the pattern is, and whether to include package information (which is not mandatory). For example, "Exception" will match nearly anything, and will probably hide other rules. "java.lang.Exception" would be correct if "Exception" was meant to define a rule for all checked exceptions. With more unusual exception names such as "BaseBusinessException" there's no need to use a fully package-qualified name.

Parameters:
exceptionName - the exception name pattern; can also be a fully package-qualified class name
Throws:
IllegalArgumentException - if the supplied exceptionName is null or empty
Method Detail

getExceptionName

public String getExceptionName()
Return the pattern for the exception name.

getDepth

public int getDepth(Throwable ex)
Return the depth of the superclass matching.

0 means ex matches exactly. Returns -1 if there is no match. Otherwise, returns depth with the lowest depth winning.

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RuleBasedTransactionAttribute

org.springframework.transaction.interceptor
Class RuleBasedTransactionAttribute

java.lang.Object
    extended by  org.springframework.transaction.support.DefaultTransactionDefinition
        extended by  org.springframework.transaction.interceptor.DefaultTransactionAttribute
            extended by  org.springframework.transaction.interceptor.RuleBasedTransactionAttribute
All Implemented Interfaces:
Serializable, TransactionAttribute, TransactionDefinition
public class RuleBasedTransactionAttribute
extends DefaultTransactionAttribute
implements Serializable

TransactionAttribute implementation that works out whether a given exception should cause transaction rollback by applying a number of rollback rules, both positive and negative. If no rules are relevant to the exception, it behaves like DefaultTransactionAttribute (rolling back on runtime exceptions).

TransactionAttributeEditor creates objects of this class.

Since:
09.04.2003
Author:
Rod Johnson, Juergen Hoeller
See Also:
TransactionAttributeEditor, Serialized Form

Field Summary
static String | PREFIX_COMMIT_RULE Prefix for commit-on-exception rules in description strings
static String | PREFIX_ROLLBACK_RULE Prefix for rollback-on-exception rules in description strings
Fields inherited from class org.springframework.transaction.support.DefaultTransactionDefinition
PREFIX_ISOLATION, PREFIX_PROPAGATION, PREFIX_TIMEOUT, READ_ONLY_MARKER
Fields inherited from interface org.springframework.transaction.TransactionDefinition
ISOLATION_DEFAULT, ISOLATION_READ_COMMITTED, ISOLATION_READ_UNCOMMITTED, ISOLATION_REPEATABLE_READ, ISOLATION_SERIALIZABLE, PROPAGATION_MANDATORY, PROPAGATION_NESTED, PROPAGATION_NEVER, PROPAGATION_NOT_SUPPORTED, PROPAGATION_REQUIRED, PROPAGATION_REQUIRES_NEW, PROPAGATION_SUPPORTS, TIMEOUT_DEFAULT
Constructor Summary
RuleBasedTransactionAttribute()
Create a new RuleBasedTransactionAttribute, with default settings.
RuleBasedTransactionAttribute(int propagationBehavior, List<RollbackRuleAttribute> rollbackRules)
Create a new DefaultTransactionAttribute with the the given propagation behavior.
RuleBasedTransactionAttribute(RuleBasedTransactionAttribute other)
Copy constructor.
Method Summary
List<RollbackRuleAttribute> | getRollbackRules() Return the list of RollbackRuleAttribute objects (never null).
boolean | rollbackOn(Throwable ex) Winning rule is the shallowest rule (that is, the closest in the inheritance hierarchy to the exception).
void | setRollbackRules(List<RollbackRuleAttribute> rollbackRules) Set the list of RollbackRuleAttribute objects (and/or NoRollbackRuleAttribute objects) to apply.
String | toString() Return an identifying description for this transaction definition.
Methods inherited from class org.springframework.transaction.interceptor.DefaultTransactionAttribute
getAttributeDescription, getQualifier, setQualifier
Methods inherited from class org.springframework.transaction.support.DefaultTransactionDefinition
equals, getDefinitionDescription, getIsolationLevel, getName, getPropagationBehavior, getTimeout, hashCode, isReadOnly, setIsolationLevel, setIsolationLevelName, setName, setPropagationBehavior, setPropagationBehaviorName, setReadOnly, setTimeout
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.transaction.TransactionDefinition
getIsolationLevel, getName, getPropagationBehavior, getTimeout, isReadOnly

Field Detail

PREFIX_ROLLBACK_RULE

public static final String PREFIX_ROLLBACK_RULE
Prefix for rollback-on-exception rules in description strings

See Also:
Constant Field Values

PREFIX_COMMIT_RULE

public static final String PREFIX_COMMIT_RULE
Prefix for commit-on-exception rules in description strings

See Also:
Constant Field Values
Constructor Detail

RuleBasedTransactionAttribute

public RuleBasedTransactionAttribute()
Create a new RuleBasedTransactionAttribute, with default settings. Can be modified through bean property setters.

See Also:
DefaultTransactionDefinition.setPropagationBehavior(int),
DefaultTransactionDefinition.setIsolationLevel(int),
DefaultTransactionDefinition.setTimeout(int),
DefaultTransactionDefinition.setReadOnly(boolean),
DefaultTransactionDefinition.setName(java.lang.String),
setRollbackRules(java.util.List)

RuleBasedTransactionAttribute

public RuleBasedTransactionAttribute(RuleBasedTransactionAttribute other)
Copy constructor. Definition can be modified through bean property setters.

See Also:
DefaultTransactionDefinition.setPropagationBehavior(int),
DefaultTransactionDefinition.setIsolationLevel(int),
DefaultTransactionDefinition.setTimeout(int),
DefaultTransactionDefinition.setReadOnly(boolean),
DefaultTransactionDefinition.setName(java.lang.String),
setRollbackRules(java.util.List)

RuleBasedTransactionAttribute

public RuleBasedTransactionAttribute(int propagationBehavior,
                                     List<RollbackRuleAttribute> rollbackRules)
Create a new DefaultTransactionAttribute with the the given propagation behavior. Can be modified through bean property setters.

Parameters:
propagationBehavior - one of the propagation constants in the TransactionDefinition interface
rollbackRules - the list of RollbackRuleAttributes to apply
See Also:
DefaultTransactionDefinition.setIsolationLevel(int),
DefaultTransactionDefinition.setTimeout(int),
DefaultTransactionDefinition.setReadOnly(boolean)
Method Detail

setRollbackRules

public void setRollbackRules(List<RollbackRuleAttribute> rollbackRules)
Set the list of RollbackRuleAttribute objects (and/or NoRollbackRuleAttribute objects) to apply.

See Also:
RollbackRuleAttribute, NoRollbackRuleAttribute

getRollbackRules

public List<RollbackRuleAttribute> getRollbackRules()
Return the list of RollbackRuleAttribute objects (never null).

rollbackOn

public boolean rollbackOn(Throwable ex)
Winning rule is the shallowest rule (that is, the closest in the inheritance hierarchy to the exception). If no rule applies (-1), return false.

Specified by:
rollbackOn in interface TransactionAttribute
Overrides:
rollbackOn in class DefaultTransactionAttribute
Parameters:
ex - the exception to evaluate
Returns:
whether to perform a rollback or not
See Also:
TransactionAttribute.rollbackOn(java.lang.Throwable)

toString

public String toString()
Description copied from class: DefaultTransactionDefinition
Return an identifying description for this transaction definition.

The format matches the one used by TransactionAttributeEditor, to be able to feed toString results into bean properties of type TransactionAttribute.

Has to be overridden in subclasses for correct equals and hashCode behavior. Alternatively, DefaultTransactionDefinition.equals(java.lang.Object) and DefaultTransactionDefinition.hashCode() can be overridden themselves.

Overrides:
toString in class DefaultTransactionDefinition
See Also:
DefaultTransactionDefinition.getDefinitionDescription(), TransactionAttributeEditor
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionAspectSupport

org.springframework.transaction.interceptor
Class TransactionAspectSupport

java.lang.Object
    extended by  org.springframework.transaction.interceptor.TransactionAspectSupport
All Implemented Interfaces:
BeanFactoryAware, InitializingBean
Direct Known Subclasses:
TransactionInterceptor
public abstract class TransactionAspectSupport
extends Object
implements BeanFactoryAware, InitializingBean

Base class for transactional aspects, such as the TransactionInterceptor or an AspectJ aspect.

This enables the underlying Spring transaction infrastructure to be used easily to implement an aspect for any aspect system.

Subclasses are responsible for calling methods in this class in the correct order.

If no transaction name has been specified in the TransactionAttribute, the exposed name will be the fully-qualified class name + "." + method name (by default).

Uses the Strategy design pattern. A PlatformTransactionManager implementation will perform the actual transaction management, and a TransactionAttributeSource is used for determining transaction definitions.

A transaction aspect is serializable if its PlatformTransactionManager and TransactionAttributeSource are serializable.

Since:
1.1
Author:
Rod Johnson, Juergen Hoeller
See Also:
setTransactionManager(org.springframework.transaction.PlatformTransactionManager),
setTransactionAttributes(java.util.Properties),
setTransactionAttributeSource(org.springframework.transaction.interceptor.TransactionAttributeSource)

Nested Class Summary
protected  class TransactionAspectSupport.TransactionInfo
Opaque object used to hold Transaction information.
Field Summary
protected  Log logger
Constructor Summary
TransactionAspectSupport()
Method Summary
void | afterPropertiesSet() Check that required properties were set.
protected void | cleanupTransactionInfo(TransactionAspectSupport.TransactionInfo txInfo) Reset the TransactionInfo ThreadLocal.
protected void | commitTransactionAfterReturning(TransactionAspectSupport.TransactionInfo txInfo) Execute after successful completion of call, but not after an exception was handled.
protected void | completeTransactionAfterThrowing(TransactionAspectSupport.TransactionInfo txInfo, Throwable ex) Handle a throwable, completing the transaction.
protected TransactionAspectSupport.TransactionInfo | createTransactionIfNecessary(Method method, Class targetClass) Create a transaction if necessary, based on the given method and class.
protected TransactionAspectSupport.TransactionInfo | createTransactionIfNecessary(PlatformTransactionManager tm, TransactionAttribute txAttr, String joinpointIdentification) Create a transaction if necessary based on the given TransactionAttribute.
protected static TransactionAspectSupport.TransactionInfo | currentTransactionInfo() Subclasses can use this to return the current TransactionInfo.
static TransactionStatus | currentTransactionStatus() Return the transaction status of the current method invocation.
protected PlatformTransactionManager | determineTransactionManager(TransactionAttribute txAttr) Determine the specific transaction manager to use for the given transaction.
protected BeanFactory | getBeanFactory() Return the BeanFactory to use for retrieving PlatformTransactionManager beans.
TransactionAttributeSource | getTransactionAttributeSource() Return the transaction attribute source.
PlatformTransactionManager | getTransactionManager() Return the transaction manager, if specified.
protected String | getTransactionManagerBeanName() Return the name of the default transaction manager bean.
protected String | methodIdentification(Method method) Convenience method to return a String representation of this Method for use in logging.
protected TransactionAspectSupport.TransactionInfo | prepareTransactionInfo(PlatformTransactionManager tm, TransactionAttribute txAttr, String joinpointIdentification, TransactionStatus status) Prepare a TransactionInfo for the given attribute and status object.
void | setBeanFactory(BeanFactory beanFactory) Set the BeanFactory to use for retrieving PlatformTransactionManager beans.
void | setTransactionAttributes(Properties transactionAttributes) Set properties with method names as keys and transaction attribute descriptors (parsed via TransactionAttributeEditor) as values: e.g.
void | setTransactionAttributeSource(TransactionAttributeSource transactionAttributeSource) Set the transaction attribute source which is used to find transaction attributes.
void | setTransactionAttributeSources(TransactionAttributeSource[] transactionAttributeSources) Set multiple transaction attribute sources which are used to find transaction attributes.
void | setTransactionManager(PlatformTransactionManager transactionManager) Specify the target transaction manager.
void | setTransactionManagerBeanName(String transactionManagerBeanName) Specify the name of the default transaction manager bean.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Constructor Detail

TransactionAspectSupport

public TransactionAspectSupport()
Method Detail

currentTransactionInfo

protected static TransactionAspectSupport.TransactionInfo currentTransactionInfo()
                                                                          throws NoTransactionException
Subclasses can use this to return the current TransactionInfo. Only subclasses that cannot handle all operations in one method, such as an AspectJ aspect involving distinct before and after advice, need to use this mechanism to get at the current TransactionInfo. An around advice such as an AOP Alliance MethodInterceptor can hold a reference to the TransactionInfo throughout the aspect method.

A TransactionInfo will be returned even if no transaction was created. The TransactionInfo.hasTransaction() method can be used to query this.

To find out about specific transaction characteristics, consider using TransactionSynchronizationManager's isSynchronizationActive() and/or isActualTransactionActive() methods.

Returns:
TransactionInfo bound to this thread, or null if none
Throws:
NoTransactionException
See Also:
TransactionAspectSupport.TransactionInfo.hasTransaction(),
TransactionSynchronizationManager.isSynchronizationActive(),
TransactionSynchronizationManager.isActualTransactionActive()

currentTransactionStatus

public static TransactionStatus currentTransactionStatus()
                                                  throws NoTransactionException
Return the transaction status of the current method invocation. Mainly intended for code that wants to set the current transaction rollback-only but not throw an application exception.

Throws:
NoTransactionException - if the transaction info cannot be found, because the method was invoked outside an AOP invocation context

setTransactionManagerBeanName

public void setTransactionManagerBeanName(String transactionManagerBeanName)
Specify the name of the default transaction manager bean.

getTransactionManagerBeanName

protected final String getTransactionManagerBeanName()
Return the name of the default transaction manager bean.

setTransactionManager

public void setTransactionManager(PlatformTransactionManager transactionManager)
Specify the target transaction manager.

getTransactionManager

public PlatformTransactionManager getTransactionManager()
Return the transaction manager, if specified.

setTransactionAttributes

public void setTransactionAttributes(Properties transactionAttributes)
Set properties with method names as keys and transaction attribute descriptors (parsed via TransactionAttributeEditor) as values: e.g. key = "myMethod", value = "PROPAGATION_REQUIRED,readOnly".

Note: Method names are always applied to the target class, no matter if defined in an interface or the class itself.

Internally, a NameMatchTransactionAttributeSource will be created from the given properties.

See Also:
setTransactionAttributeSource(org.springframework.transaction.interceptor.TransactionAttributeSource), TransactionAttributeEditor, NameMatchTransactionAttributeSource

setTransactionAttributeSources

public void setTransactionAttributeSources(TransactionAttributeSource[] transactionAttributeSources)
Set multiple transaction attribute sources which are used to find transaction attributes. Will build a CompositeTransactionAttributeSource for the given sources.

See Also:
CompositeTransactionAttributeSource, MethodMapTransactionAttributeSource, NameMatchTransactionAttributeSource, AnnotationTransactionAttributeSource

setTransactionAttributeSource

public void setTransactionAttributeSource(TransactionAttributeSource transactionAttributeSource)
Set the transaction attribute source which is used to find transaction attributes. If specifying a String property value, a PropertyEditor will create a MethodMapTransactionAttributeSource from the value.

See Also:
TransactionAttributeSourceEditor, MethodMapTransactionAttributeSource, NameMatchTransactionAttributeSource, AnnotationTransactionAttributeSource

getTransactionAttributeSource

public TransactionAttributeSource getTransactionAttributeSource()
Return the transaction attribute source.

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Set the BeanFactory to use for retrieving PlatformTransactionManager beans.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
BeanInitializationException

getBeanFactory

protected final BeanFactory getBeanFactory()
Return the BeanFactory to use for retrieving PlatformTransactionManager beans.

afterPropertiesSet

public void afterPropertiesSet()
Check that required properties were set.

Specified by:
afterPropertiesSet in interface InitializingBean

determineTransactionManager

protected PlatformTransactionManager determineTransactionManager(TransactionAttribute txAttr)
Determine the specific transaction manager to use for the given transaction.

createTransactionIfNecessary

protected TransactionAspectSupport.TransactionInfo createTransactionIfNecessary(Method method,
                                                                                Class targetClass)
Create a transaction if necessary, based on the given method and class.

Performs a default TransactionAttribute lookup for the given method.

Parameters:
method - method about to execute
targetClass - class the method is on
Returns:
a TransactionInfo object, whether or not a transaction was created. The hasTransaction() method on TransactionInfo can be used to tell if there was a transaction created.
See Also:
getTransactionAttributeSource()

methodIdentification

protected String methodIdentification(Method method)
Convenience method to return a String representation of this Method for use in logging. Can be overridden in subclasses to provide a different identifier for the given method.

Parameters:
method - the method we're interested in
Returns:
log message identifying this method
See Also:
ClassUtils.getQualifiedMethodName(java.lang.reflect.Method)

createTransactionIfNecessary

protected TransactionAspectSupport.TransactionInfo createTransactionIfNecessary(PlatformTransactionManager tm,
                                                                                TransactionAttribute txAttr,
                                                                                String joinpointIdentification)
Create a transaction if necessary based on the given TransactionAttribute.

Allows callers to perform custom TransactionAttribute lookups through the TransactionAttributeSource.

Parameters:
txAttr - the TransactionAttribute (may be null)
joinpointIdentification - the fully qualified method name (used for monitoring and logging purposes)
Returns:
a TransactionInfo object, whether or not a transaction was created. The hasTransaction() method on TransactionInfo can be used to tell if there was a transaction created.
See Also:
getTransactionAttributeSource()

prepareTransactionInfo

protected TransactionAspectSupport.TransactionInfo prepareTransactionInfo(PlatformTransactionManager tm,
                                                                          TransactionAttribute txAttr,
                                                                          String joinpointIdentification,
                                                                          TransactionStatus status)
Prepare a TransactionInfo for the given attribute and status object.

Parameters:
txAttr - the TransactionAttribute (may be null)
joinpointIdentification - the fully qualified method name (used for monitoring and logging purposes)
status - the TransactionStatus for the current transaction
Returns:
the prepared TransactionInfo object

commitTransactionAfterReturning

protected void commitTransactionAfterReturning(TransactionAspectSupport.TransactionInfo txInfo)
Execute after successful completion of call, but not after an exception was handled. Do nothing if we didn't create a transaction.

Parameters:
txInfo - information about the current transaction

completeTransactionAfterThrowing

protected void completeTransactionAfterThrowing(TransactionAspectSupport.TransactionInfo txInfo,
                                                Throwable ex)
Handle a throwable, completing the transaction. We may commit or roll back, depending on the configuration.

Parameters:
txInfo - information about the current transaction
ex - throwable encountered

cleanupTransactionInfo

protected void cleanupTransactionInfo(TransactionAspectSupport.TransactionInfo txInfo)
Reset the TransactionInfo ThreadLocal.

Call this in all cases: exception or normal return!

Parameters:
txInfo - information about the current transaction (may be null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionAspectSupport.TransactionInfo

org.springframework.transaction.interceptor
Class TransactionAspectSupport.TransactionInfo

java.lang.Object
    extended by  org.springframework.transaction.interceptor.TransactionAspectSupport.TransactionInfo
Enclosing class:
TransactionAspectSupport
protected final class TransactionAspectSupport.TransactionInfo
extends Object

Opaque object used to hold Transaction information. Subclasses must pass it back to methods on this class, but not see its internals.

Constructor Summary
TransactionAspectSupport.TransactionInfo(PlatformTransactionManager transactionManager, TransactionAttribute transactionAttribute, String joinpointIdentification)
Method Summary
String | getJoinpointIdentification() Return a String representation of this joinpoint (usually a Method call) for use in logging.
TransactionAttribute | getTransactionAttribute()
PlatformTransactionManager | getTransactionManager()
TransactionStatus | getTransactionStatus()
boolean | hasTransaction() Return whether a transaction was created by this aspect, or whether we just have a placeholder to keep ThreadLocal stack integrity.
void | newTransactionStatus(TransactionStatus status)
String | toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

TransactionAspectSupport.TransactionInfo

public TransactionAspectSupport.TransactionInfo(PlatformTransactionManager transactionManager,
                                                TransactionAttribute transactionAttribute,
                                                String joinpointIdentification)
Method Detail

getTransactionManager

public PlatformTransactionManager getTransactionManager()

getTransactionAttribute

public TransactionAttribute getTransactionAttribute()

getJoinpointIdentification

public String getJoinpointIdentification()
Return a String representation of this joinpoint (usually a Method call) for use in logging.

newTransactionStatus

public void newTransactionStatus(TransactionStatus status)

getTransactionStatus

public TransactionStatus getTransactionStatus()

hasTransaction

public boolean hasTransaction()
Return whether a transaction was created by this aspect, or whether we just have a placeholder to keep ThreadLocal stack integrity.

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionAspectUtils

org.springframework.transaction.interceptor
Class TransactionAspectUtils

java.lang.Object
    extended by  org.springframework.transaction.interceptor.TransactionAspectUtils

public abstract class TransactionAspectUtils
extends Object

Utility methods for obtaining a PlatformTransactionManager by qualifier value.

Since:
3.0.2
Author:
Juergen Hoeller

Constructor Summary
TransactionAspectUtils()
Method Summary
static PlatformTransactionManager | getTransactionManager(BeanFactory beanFactory, String qualifier) Obtain a PlatformTransactionManager from the given BeanFactory, matching the given qualifier.
static PlatformTransactionManager | getTransactionManager(ConfigurableListableBeanFactory bf, String qualifier) Obtain a PlatformTransactionManager from the given BeanFactory, matching the given qualifier.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TransactionAspectUtils

public TransactionAspectUtils()
Method Detail

getTransactionManager

public static PlatformTransactionManager getTransactionManager(BeanFactory beanFactory,
                                                               String qualifier)
Obtain a PlatformTransactionManager from the given BeanFactory, matching the given qualifier.

Parameters:
beanFactory - the BeanFactory to get the PlatformTransactionManager bean from
qualifier - the qualifier for selecting between multiple PlatformTransactionManager matches
Returns:
the chosen PlatformTransactionManager (never null)
Throws:
IllegalStateException - if no matching PlatformTransactionManager bean found

getTransactionManager

public static PlatformTransactionManager getTransactionManager(ConfigurableListableBeanFactory bf,
                                                               String qualifier)
Obtain a PlatformTransactionManager from the given BeanFactory, matching the given qualifier.

Parameters:
beanFactory - the BeanFactory to get the PlatformTransactionManager bean from
qualifier - the qualifier for selecting between multiple PlatformTransactionManager matches
Returns:
the chosen PlatformTransactionManager (never null)
Throws:
IllegalStateException - if no matching PlatformTransactionManager bean found
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionAttributeEditor

org.springframework.transaction.interceptor
Class TransactionAttributeEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.transaction.interceptor.TransactionAttributeEditor
All Implemented Interfaces:
PropertyEditor
public class TransactionAttributeEditor
extends PropertyEditorSupport

PropertyEditor for TransactionAttribute objects. Accepts a String of form

PROPAGATION_NAME,ISOLATION_NAME,readOnly,timeout_NNNN,+Exception1,-Exception2

where only propagation code is required. For example:

PROPAGATION_MANDATORY,ISOLATION_DEFAULT

The tokens can be in any order. Propagation and isolation codes must use the names of the constants in the TransactionDefinition class. Timeout values are in seconds. If no timeout is specified, the transaction manager will apply a default timeout specific to the particular transaction manager.

A "+" before an exception name substring indicates that transactions should commit even if this exception is thrown; a "-" that they should roll back.

Since:
24.04.2003
Author:
Rod Johnson, Juergen Hoeller
See Also:
TransactionDefinition, Constants

Constructor Summary
TransactionAttributeEditor()
Method Summary
 void setAsText(String text)
Format is PROPAGATION_NAME,ISOLATION_NAME,readOnly,timeout_NNNN,+Exception1,-Exception2.
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getAsText, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TransactionAttributeEditor

public TransactionAttributeEditor()
Method Detail

setAsText

public void setAsText(String text)
               throws IllegalArgumentException
Format is PROPAGATION_NAME,ISOLATION_NAME,readOnly,timeout_NNNN,+Exception1,-Exception2. Null or the empty string means that the method is non transactional.

Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport
Throws:
IllegalArgumentException
See Also:
PropertyEditor.setAsText(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionAttributeSourceAdvisor

org.springframework.transaction.interceptor
Class TransactionAttributeSourceAdvisor

java.lang.Object
    extended by  org.springframework.aop.support.AbstractPointcutAdvisor
        extended by  org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor
All Implemented Interfaces:
Serializable, Advisor, PointcutAdvisor, Ordered
public class TransactionAttributeSourceAdvisor
extends AbstractPointcutAdvisor

Advisor driven by a TransactionAttributeSource, used to include a TransactionInterceptor only for methods that are transactional.

Because the AOP framework caches advice calculations, this is normally faster than just letting the TransactionInterceptor run and find out itself that it has no work to do.

Author:
Rod Johnson, Juergen Hoeller
See Also:
setTransactionInterceptor(org.springframework.transaction.interceptor.TransactionInterceptor), TransactionProxyFactoryBean, Serialized Form

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
TransactionAttributeSourceAdvisor()
Create a new TransactionAttributeSourceAdvisor.
TransactionAttributeSourceAdvisor(TransactionInterceptor interceptor)
Create a new TransactionAttributeSourceAdvisor.
Method Summary
Advice | getAdvice() Return the advice part of this aspect.
Pointcut | getPointcut() Get the Pointcut that drives this advisor.
void | setClassFilter(ClassFilter classFilter) Set the ClassFilter to use for this pointcut.
void | setTransactionInterceptor(TransactionInterceptor interceptor) Set the transaction interceptor to use for this advisor.
Methods inherited from class org.springframework.aop.support.AbstractPointcutAdvisor
equals, getOrder, hashCode, isPerInstance, setOrder
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TransactionAttributeSourceAdvisor

public TransactionAttributeSourceAdvisor()
Create a new TransactionAttributeSourceAdvisor.

TransactionAttributeSourceAdvisor

public TransactionAttributeSourceAdvisor(TransactionInterceptor interceptor)
Create a new TransactionAttributeSourceAdvisor.

Parameters:
interceptor - the transaction interceptor to use for this advisor
Method Detail

setTransactionInterceptor

public void setTransactionInterceptor(TransactionInterceptor interceptor)
Set the transaction interceptor to use for this advisor.

setClassFilter

public void setClassFilter(ClassFilter classFilter)
Set the ClassFilter to use for this pointcut. Default is ClassFilter.TRUE.

getAdvice

public Advice getAdvice()
Description copied from interface: Advisor
Return the advice part of this aspect. An advice may be an interceptor, a before advice, a throws advice, etc.

Returns:
the advice that should apply if the pointcut matches
See Also:
MethodInterceptor, BeforeAdvice, ThrowsAdvice, AfterReturningAdvice

getPointcut

public Pointcut getPointcut()
Description copied from interface: PointcutAdvisor
Get the Pointcut that drives this advisor.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionAttributeSourceEditor

org.springframework.transaction.interceptor
Class TransactionAttributeSourceEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.transaction.interceptor.TransactionAttributeSourceEditor
All Implemented Interfaces:
PropertyEditor
public class TransactionAttributeSourceEditor
extends PropertyEditorSupport

Property editor that converts a String into a TransactionAttributeSource. The transaction attribute string must be parseable by the TransactionAttributeEditor in this package.

Strings are in property syntax, with the form:
FQCN.methodName=<transaction attribute string>

For example:
com.mycompany.mycode.MyClass.myMethod=PROPAGATION_MANDATORY,ISOLATION_DEFAULT

NOTE: The specified class must be the one where the methods are defined; in case of implementing an interface, the interface class name.

Note: Will register all overloaded methods for a given name. Does not support explicit registration of certain overloaded methods. Supports "xxx*" mappings, e.g. "notify*" for "notify" and "notifyAll".

Since:
26.04.2003
Author:
Rod Johnson, Juergen Hoeller
See Also:
TransactionAttributeEditor

Constructor Summary
TransactionAttributeSourceEditor()
Method Summary
 void setAsText(String text)
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getAsText, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TransactionAttributeSourceEditor

public TransactionAttributeSourceEditor()
Method Detail

setAsText

public void setAsText(String text)
               throws IllegalArgumentException
Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport
Throws:
IllegalArgumentException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionInterceptor

org.springframework.transaction.interceptor
Class TransactionInterceptor

java.lang.Object
    extended by  org.springframework.transaction.interceptor.TransactionAspectSupport
        extended by  org.springframework.transaction.interceptor.TransactionInterceptor
All Implemented Interfaces:
Serializable, Advice, Interceptor, MethodInterceptor, BeanFactoryAware, InitializingBean
public class TransactionInterceptor
extends TransactionAspectSupport
implements MethodInterceptor, Serializable

AOP Alliance MethodInterceptor for declarative transaction management using the common Spring transaction infrastructure (PlatformTransactionManager).

Derives from the TransactionAspectSupport class which contains the integration with Spring's underlying transaction API. TransactionInterceptor simply calls the relevant superclass methods such as TransactionAspectSupport.createTransactionIfNecessary(java.lang.reflect.Method, java.lang.Class) in the correct order.

TransactionInterceptors are thread-safe.

Author:
Rod Johnson, Juergen Hoeller
See Also:
TransactionProxyFactoryBean, ProxyFactoryBean, ProxyFactory, Serialized Form

Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.transaction.interceptor.TransactionAspectSupport
TransactionAspectSupport.TransactionInfo
Field Summary
Fields inherited from class org.springframework.transaction.interceptor.TransactionAspectSupport
logger
Constructor Summary
TransactionInterceptor()
Create a new TransactionInterceptor.
TransactionInterceptor(PlatformTransactionManager ptm, Properties attributes)
Create a new TransactionInterceptor.
TransactionInterceptor(PlatformTransactionManager ptm, TransactionAttributeSource tas)
Create a new TransactionInterceptor.
Method Summary
 Object invoke(MethodInvocation invocation)
Methods inherited from class org.springframework.transaction.interceptor.TransactionAspectSupport
afterPropertiesSet, cleanupTransactionInfo, commitTransactionAfterReturning, completeTransactionAfterThrowing, createTransactionIfNecessary, createTransactionIfNecessary, currentTransactionInfo, currentTransactionStatus, determineTransactionManager, getBeanFactory, getTransactionAttributeSource, getTransactionManager, getTransactionManagerBeanName, methodIdentification, prepareTransactionInfo, setBeanFactory, setTransactionAttributes, setTransactionAttributeSource, setTransactionAttributeSources, setTransactionManager, setTransactionManagerBeanName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TransactionInterceptor

public TransactionInterceptor()
Create a new TransactionInterceptor.

Transaction manager and transaction attributes still need to be set.

See Also:
TransactionAspectSupport.setTransactionManager(org.springframework.transaction.PlatformTransactionManager),
TransactionAspectSupport.setTransactionAttributes(java.util.Properties),
TransactionAspectSupport.setTransactionAttributeSource(TransactionAttributeSource)

TransactionInterceptor

public TransactionInterceptor(PlatformTransactionManager ptm,
                              Properties attributes)
Create a new TransactionInterceptor.

Parameters:
ptm - the transaction manager to perform the actual transaction management
attributes - the transaction attributes in properties format
See Also:
TransactionAspectSupport.setTransactionManager(org.springframework.transaction.PlatformTransactionManager), TransactionAspectSupport.setTransactionAttributes(java.util.Properties)

TransactionInterceptor

public TransactionInterceptor(PlatformTransactionManager ptm,
                              TransactionAttributeSource tas)
Create a new TransactionInterceptor.

Parameters:
ptm - the transaction manager to perform the actual transaction management
tas - the attribute source to be used to find transaction attributes
See Also:
TransactionAspectSupport.setTransactionManager(org.springframework.transaction.PlatformTransactionManager), TransactionAspectSupport.setTransactionAttributeSource(TransactionAttributeSource)
Method Detail

invoke

public Object invoke(MethodInvocation invocation)
              throws Throwable
Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionProxyFactoryBean

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.transaction.interceptor
Class TransactionProxyFactoryBean

java.lang.Object
    extended by  org.springframework.aop.framework.ProxyConfig
        extended by  org.springframework.aop.framework.AbstractSingletonProxyFactoryBean
            extended by  org.springframework.transaction.interceptor.TransactionProxyFactoryBean
All Implemented Interfaces:
Serializable, BeanClassLoaderAware, BeanFactoryAware, FactoryBean<Object>, InitializingBean
public class TransactionProxyFactoryBean
extends AbstractSingletonProxyFactoryBean
implements BeanFactoryAware

Proxy factory bean for simplified declarative transaction handling. This is a convenient alternative to a standard AOP ProxyFactoryBean with a separate TransactionInterceptor definition.

This class is intended to cover the typical case of declarative transaction demarcation: namely, wrapping a singleton target object with a transactional proxy, proxying all the interfaces that the target implements.

There are three main properties that need to be specified:

  • "transactionManager": the PlatformTransactionManager implementation to use (for example, a JtaTransactionManager instance)
  • "target": the target object that a transactional proxy should be created for
  • "transactionAttributes": the transaction attributes (for example, propagation behavior and "readOnly" flag) per target method name (or method name pattern)

If the "transactionManager" property is not set explicitly and this FactoryBean is running in a ListableBeanFactory, a single matching bean of type PlatformTransactionManager will be fetched from the BeanFactory.

In contrast to TransactionInterceptor, the transaction attributes are specified as properties, with method names as keys and transaction attribute descriptors as values. Method names are always applied to the target class.

Internally, a TransactionInterceptor instance is used, but the user of this class does not have to care. Optionally, a method pointcut can be specified to cause conditional invocation of the underlying TransactionInterceptor.

The "preInterceptors" and "postInterceptors" properties can be set to add additional interceptors to the mix, like PerformanceMonitorInterceptor or HibernateInterceptor / JdoInterceptor.

HINT: This class is often used with parent / child bean definitions. Typically, you will define the transaction manager and default transaction attributes (for method name patterns) in an abstract parent bean definition, deriving concrete child bean definitions for specific target objects. This reduces the per-bean definition effort to a minimum.

 <bean id="baseTransactionProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"
     abstract="true">
   <property name="transactionManager" ref="transactionManager"/>
   <property name="transactionAttributes">
     <props>
       <prop key="insert*">PROPAGATION_REQUIRED</prop>
       <prop key="update*">PROPAGATION_REQUIRED</prop>
       <prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
     </props>
   </property>
 </bean>

 <bean id="myProxy" parent="baseTransactionProxy">
   <property name="target" ref="myTarget"/>
 </bean>

 <bean id="yourProxy" parent="baseTransactionProxy">
   <property name="target" ref="yourTarget"/>
 </bean>

Since:
21.08.2003
Author:
Juergen Hoeller, Dmitriy Kopylenko, Rod Johnson
See Also:
setTransactionManager(org.springframework.transaction.PlatformTransactionManager), AbstractSingletonProxyFactoryBean.setTarget(java.lang.Object), setTransactionAttributes(java.util.Properties), TransactionInterceptor, ProxyFactoryBean, Serialized Form

Constructor Summary
TransactionProxyFactoryBean()
Method Summary
protected Object | createMainInterceptor() Creates an advisor for this FactoryBean's TransactionInterceptor.
void | setBeanFactory(BeanFactory beanFactory) This callback is optional: If running in a BeanFactory and no transaction manager has been set explicitly, a single matching bean of type PlatformTransactionManager will be fetched from the BeanFactory.
void | setPointcut(Pointcut pointcut) Set a pointcut, i.e a bean that can cause conditional invocation of the TransactionInterceptor depending on method and attributes passed.
void | setTransactionAttributes(Properties transactionAttributes) Set properties with method names as keys and transaction attribute descriptors (parsed via TransactionAttributeEditor) as values: e.g.
void | setTransactionAttributeSource(TransactionAttributeSource transactionAttributeSource) Set the transaction attribute source which is used to find transaction attributes.
void | setTransactionManager(PlatformTransactionManager transactionManager) Set the transaction manager.
Methods inherited from class org.springframework.aop.framework.AbstractSingletonProxyFactoryBean
afterPropertiesSet, createTargetSource, getObject, getObjectType, isSingleton, setAdvisorAdapterRegistry, setBeanClassLoader, setPostInterceptors, setPreInterceptors, setProxyClassLoader, setProxyInterfaces, setTarget
Methods inherited from class org.springframework.aop.framework.ProxyConfig
copyFrom, isExposeProxy, isFrozen, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setFrozen, setOpaque, setOptimize, setProxyTargetClass, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

TransactionProxyFactoryBean

public TransactionProxyFactoryBean()
Method Detail

setTransactionManager

public void setTransactionManager(PlatformTransactionManager transactionManager)
Set the transaction manager. This will perform actual transaction management: This class is just a way of invoking it.

See Also:
TransactionAspectSupport.setTransactionManager(org.springframework.transaction.PlatformTransactionManager)

setTransactionAttributes

public void setTransactionAttributes(Properties transactionAttributes)
Set properties with method names as keys and transaction attribute descriptors (parsed via TransactionAttributeEditor) as values: e.g. key = "myMethod", value = "PROPAGATION_REQUIRED,readOnly".

Note: Method names are always applied to the target class, no matter if defined in an interface or the class itself.

Internally, a NameMatchTransactionAttributeSource will be created from the given properties.

See Also:
setTransactionAttributeSource(org.springframework.transaction.interceptor.TransactionAttributeSource), TransactionAspectSupport.setTransactionAttributes(java.util.Properties), TransactionAttributeEditor, NameMatchTransactionAttributeSource

setTransactionAttributeSource

public void setTransactionAttributeSource(TransactionAttributeSource transactionAttributeSource)
Set the transaction attribute source which is used to find transaction attributes. If specifying a String property value, a PropertyEditor will create a MethodMapTransactionAttributeSource from the value.

See Also:
setTransactionAttributes(java.util.Properties), TransactionAspectSupport.setTransactionAttributeSource(org.springframework.transaction.interceptor.TransactionAttributeSource), TransactionAttributeSourceEditor, MethodMapTransactionAttributeSource, NameMatchTransactionAttributeSource, AttributesTransactionAttributeSource, AnnotationTransactionAttributeSource

setPointcut

public void setPointcut(Pointcut pointcut)
Set a pointcut, i.e a bean that can cause conditional invocation of the TransactionInterceptor depending on method and attributes passed. Note: Additional interceptors are always invoked.

See Also:
AbstractSingletonProxyFactoryBean.setPreInterceptors(java.lang.Object[]), AbstractSingletonProxyFactoryBean.setPostInterceptors(java.lang.Object[])

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
This callback is optional: If running in a BeanFactory and no transaction manager has been set explicitly, a single matching bean of type PlatformTransactionManager will be fetched from the BeanFactory.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
BeanFactoryUtils.beanOfTypeIncludingAncestors(org.springframework.beans.factory.ListableBeanFactory, java.lang.Class), PlatformTransactionManager

createMainInterceptor

protected Object createMainInterceptor()
Creates an advisor for this FactoryBean's TransactionInterceptor.

Specified by:
createMainInterceptor in class AbstractSingletonProxyFactoryBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.transaction.jta

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.transaction.jta

Transaction SPI implementation for JTA.

See:
Description

Interface Summary
TransactionFactory Strategy interface for creating JTA Transaction objects based on specified transactional characteristics.

Class Summary
JtaAfterCompletionSynchronization | Adapter for a JTA Synchronization, invoking the afterCommit / afterCompletion callbacks of Spring TransactionSynchronization objects callbacks after the outer JTA transaction has completed.
JtaTransactionManager | PlatformTransactionManager implementation for JTA, delegating to a backend JTA provider.
JtaTransactionObject | JTA transaction object, representing a UserTransaction.
ManagedTransactionAdapter | Adapter for a managed JTA Transaction handle, taking a JTA TransactionManager reference and creating a JTA Transaction handle for it.
OC4JJtaTransactionManager | Special JtaTransactionManager variant for Oracle OC4J (10.1.3 and higher).
SimpleTransactionFactory | Default implementation of the TransactionFactory strategy interface, simply wrapping a standard JTA TransactionManager.
SpringJtaSynchronizationAdapter | Adapter that implements the JTA Synchronization interface delegating to an underlying Spring TransactionSynchronization.
UserTransactionAdapter | Adapter for a JTA UserTransaction handle, taking a JTA TransactionManager reference and creating a JTA UserTransaction handle for it.
WebLogicJtaTransactionManager | Special JtaTransactionManager variant for BEA WebLogic (9.0 and higher).
WebSphereUowTransactionManager | WebSphere-specific PlatformTransactionManager implementation that delegates to a UOWManager instance, obtained from WebSphere's JNDI environment.

Package org.springframework.transaction.jta Description

Transaction SPI implementation for JTA.


org.springframework.transaction.jta Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.transaction.jta

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.transaction.support.AbstractPlatformTransactionManager (implements org.springframework.transaction.PlatformTransactionManager, java.io.Serializable)
      • org.springframework.transaction.jta.JtaTransactionManager (implements org.springframework.beans.factory.InitializingBean, java.io.Serializable, org.springframework.transaction.jta.TransactionFactory)
        • org.springframework.transaction.jta.OC4JJtaTransactionManager
        • org.springframework.transaction.jta.WebLogicJtaTransactionManager
        • org.springframework.transaction.jta.WebSphereUowTransactionManager (implements org.springframework.transaction.support.CallbackPreferringPlatformTransactionManager)
    • org.springframework.transaction.jta.JtaAfterCompletionSynchronization (implements javax.transaction.Synchronization)
    • org.springframework.transaction.jta.JtaTransactionObject (implements org.springframework.transaction.support.SmartTransactionObject)
    • org.springframework.transaction.jta.ManagedTransactionAdapter (implements javax.transaction.Transaction)
    • org.springframework.transaction.jta.SimpleTransactionFactory (implements org.springframework.transaction.jta.TransactionFactory)
    • org.springframework.transaction.jta.SpringJtaSynchronizationAdapter (implements javax.transaction.Synchronization)
    • org.springframework.transaction.jta.UserTransactionAdapter (implements javax.transaction.UserTransaction)

Interface Hierarchy

  • org.springframework.transaction.jta.TransactionFactory


TransactionFactory

org.springframework.transaction.jta
Interface TransactionFactory

All Known Implementing Classes:
JtaTransactionManager, OC4JJtaTransactionManager, SimpleTransactionFactory, WebLogicJtaTransactionManager, WebSphereUowTransactionManager
public interface TransactionFactory

Strategy interface for creating JTA Transaction objects based on specified transactional characteristics.

The default implementation, SimpleTransactionFactory, simply wraps a standard JTA TransactionManager. This strategy interface allows for more sophisticated implementations that adapt to vendor-specific JTA extensions.

Since:
2.5
Author:
Juergen Hoeller
See Also:
TransactionManager.getTransaction(), SimpleTransactionFactory, JtaTransactionManager

Method Summary
Transaction | createTransaction(String name, int timeout) Create an active Transaction object based on the given name and timeout.
boolean | supportsResourceAdapterManagedTransactions() Determine whether the underlying transaction manager supports XA transactions managed by a resource adapter (i.e.

Method Detail

createTransaction

Transaction createTransaction(String name,
                              int timeout)
                              throws NotSupportedException,
                                     SystemException
Create an active Transaction object based on the given name and timeout.

Parameters:
name - the transaction name (may be null)
timeout - the transaction timeout (may be -1 for the default timeout)
Returns:
the active Transaction object (never null)
Throws:
NotSupportedException - if the transaction manager does not support a transaction of the specified type
SystemException - if the transaction manager failed to create the transaction

supportsResourceAdapterManagedTransactions

boolean supportsResourceAdapterManagedTransactions()
Determine whether the underlying transaction manager supports XA transactions managed by a resource adapter (i.e. without explicit XA resource enlistment).

Typically false. Checked by AbstractMessageEndpointFactory in order to differentiate between invalid configuration and valid ResourceAdapter-managed transactions.

See Also:
ResourceAdapter.endpointActivation(javax.resource.spi.endpoint.MessageEndpointFactory, javax.resource.spi.ActivationSpec), MessageEndpointFactory.isDeliveryTransacted(java.lang.reflect.Method)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JtaAfterCompletionSynchronization

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.transaction.jta
Class JtaAfterCompletionSynchronization

java.lang.Object
    extended by  org.springframework.transaction.jta.JtaAfterCompletionSynchronization
All Implemented Interfaces:
Synchronization
public class JtaAfterCompletionSynchronization
extends Object
implements Synchronization

Adapter for a JTA Synchronization, invoking the afterCommit / afterCompletion callbacks of Spring TransactionSynchronization objects callbacks after the outer JTA transaction has completed. Applied when participating in an existing (non-Spring) JTA transaction.

Since:
2.0
Author:
Juergen Hoeller
See Also:
TransactionSynchronization.afterCommit(), TransactionSynchronization.afterCompletion(int)

Constructor Summary
JtaAfterCompletionSynchronization(List<TransactionSynchronization> synchronizations)
Create a new JtaAfterCompletionSynchronization for the given synchronization objects.
Method Summary
void | afterCompletion(int status)
void | beforeCompletion()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JtaAfterCompletionSynchronization

public JtaAfterCompletionSynchronization(List<TransactionSynchronization> synchronizations)
Create a new JtaAfterCompletionSynchronization for the given synchronization objects.

Parameters:
synchronizations - the List of TransactionSynchronization objects
See Also:
TransactionSynchronization
Method Detail

beforeCompletion

public void beforeCompletion()
Specified by:
beforeCompletion in interface Synchronization

afterCompletion

public void afterCompletion(int status)
Specified by:
afterCompletion in interface Synchronization
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


JtaTransactionManager

org.springframework.transaction.jta
Class JtaTransactionManager

java.lang.Object
    extended by  org.springframework.transaction.support.AbstractPlatformTransactionManager
        extended by  org.springframework.transaction.jta.JtaTransactionManager
All Implemented Interfaces:
Serializable, InitializingBean, TransactionFactory, PlatformTransactionManager
Direct Known Subclasses:
OC4JJtaTransactionManager, WebLogicJtaTransactionManager, WebSphereUowTransactionManager
public class JtaTransactionManager
extends AbstractPlatformTransactionManager
implements TransactionFactory, InitializingBean, Serializable

PlatformTransactionManager implementation for JTA, delegating to a backend JTA provider. This is typically used to delegate to a Java EE server's transaction coordinator, but may also be configured with a local JTA provider which is embedded within the application.

This transaction manager is appropriate for handling distributed transactions, i.e. transactions that span multiple resources, and for controlling transactions on application server resources (e.g. JDBC DataSources available in JNDI) in general. For a single JDBC DataSource, DataSourceTransactionManager is perfectly sufficient, and for accessing a single resource with Hibernate (including transactional cache), HibernateTransactionManager is appropriate, for example.

For typical JTA transactions (REQUIRED, SUPPORTS, MANDATORY, NEVER), a plain JtaTransactionManager definition is all you need, portable across all Java EE servers. This corresponds to the functionality of the JTA UserTransaction, for which Java EE specifies a standard JNDI name ("java:comp/UserTransaction"). There is no need to configure a server-specific TransactionManager lookup for this kind of JTA usage.

Transaction suspension (REQUIRES_NEW, NOT_SUPPORTED) is just available with a JTA TransactionManager being registered. Common TransactionManager locations are autodetected by JtaTransactionManager, provided that the "autodetectTransactionManager" flag is set to "true" (which it is by default).

Note: Support for the JTA TransactionManager interface is not required by Java EE. Almost all Java EE servers expose it, but do so as extension to EE. There might be some issues with compatibility, despite the TransactionManager interface being part of JTA. As a consequence, Spring provides various vendor-specific PlatformTransactionManagers, which are recommended to be used if appropriate: WebLogicJtaTransactionManager, WebSphereUowTransactionManager and OC4JJtaTransactionManager. For all other Java EE servers, the standard JtaTransactionManager is sufficient.

This pure JtaTransactionManager class supports timeouts but not per-transaction isolation levels. Custom subclasses may override the doJtaBegin(org.springframework.transaction.jta.JtaTransactionObject, org.springframework.transaction.TransactionDefinition) method for specific JTA extensions in order to provide this functionality; Spring includes corresponding WebLogicJtaTransactionManager and OC4JJtaTransactionManager classes, for BEA's WebLogic Server and Oracle's OC4J, respectively. Such adapters for specific Java EE transaction coordinators may also expose transaction names for monitoring; with standard JTA, transaction names will simply be ignored.

Consider using Spring's tx:jta-transaction-manager configuration element for automatically picking the appropriate JTA platform transaction manager (automatically detecting WebLogic, WebSphere and OC4J).

JTA 1.1 adds the TransactionSynchronizationRegistry facility, as public Java EE 5 API in addition to the standard JTA UserTransaction handle. As of Spring 2.5, this JtaTransactionManager autodetects the TransactionSynchronizationRegistry and uses it for registering Spring-managed synchronizations when participating in an existing JTA transaction (e.g. controlled by EJB CMT). If no TransactionSynchronizationRegistry is available (or the JTA 1.1 API isn't available), then such synchronizations will be registered via the (non-EE) JTA TransactionManager handle.

This class is serializable. However, active synchronizations do not survive serialization.

Since:
24.03.2003
Author:
Juergen Hoeller
See Also:
UserTransaction, TransactionManager, TransactionSynchronizationRegistry, setUserTransactionName(java.lang.String), setUserTransaction(javax.transaction.UserTransaction), setTransactionManagerName(java.lang.String), setTransactionManager(javax.transaction.TransactionManager), WebLogicJtaTransactionManager, Serialized Form

Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
AbstractPlatformTransactionManager.SuspendedResourcesHolder
Field Summary
static String | DEFAULT_TRANSACTION_SYNCHRONIZATION_REGISTRY_NAME Standard Java EE 5 JNDI location for the JTA TransactionSynchronizationRegistry.
static String | DEFAULT_USER_TRANSACTION_NAME Default JNDI location for the JTA UserTransaction.
static String[] | FALLBACK_TRANSACTION_MANAGER_NAMES Fallback JNDI locations for the JTA TransactionManager.
Fields inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
logger, SYNCHRONIZATION_ALWAYS, SYNCHRONIZATION_NEVER, SYNCHRONIZATION_ON_ACTUAL_TRANSACTION
Constructor Summary
JtaTransactionManager()
Create a new JtaTransactionManager instance, to be configured as bean.
JtaTransactionManager(TransactionManager transactionManager)
Create a new JtaTransactionManager instance.
JtaTransactionManager(UserTransaction userTransaction)
Create a new JtaTransactionManager instance.
JtaTransactionManager(UserTransaction userTransaction, TransactionManager transactionManager)
Create a new JtaTransactionManager instance.
Method Summary
void | afterPropertiesSet() Initialize the UserTransaction as well as the TransactionManager handle.
protected void | applyIsolationLevel(JtaTransactionObject txObject, int isolationLevel) Apply the given transaction isolation level.
protected void | applyTimeout(JtaTransactionObject txObject, int timeout) Apply the given transaction timeout.
protected UserTransaction | buildUserTransaction(TransactionManager transactionManager) Build a UserTransaction handle based on the given TransactionManager.
protected void | checkUserTransactionAndTransactionManager() Check the UserTransaction as well as the TransactionManager handle, assuming standard JTA requirements.
Transaction | createTransaction(String name, int timeout) Create an active Transaction object based on the given name and timeout.
protected void | doBegin(Object transaction, TransactionDefinition definition) Begin a new transaction with semantics according to the given transaction definition.
protected void | doCommit(DefaultTransactionStatus status) Perform an actual commit of the given transaction.
protected JtaTransactionObject | doGetJtaTransaction(UserTransaction ut) Get a JTA transaction object for the given current UserTransaction.
protected Object | doGetTransaction() This implementation returns a JtaTransactionObject instance for the JTA UserTransaction.
protected void | doJtaBegin(JtaTransactionObject txObject, TransactionDefinition definition) Perform a JTA begin on the JTA UserTransaction or TransactionManager.
protected void | doJtaResume(JtaTransactionObject txObject, Object suspendedTransaction) Perform a JTA resume on the JTA TransactionManager.
protected Object | doJtaSuspend(JtaTransactionObject txObject) Perform a JTA suspend on the JTA TransactionManager.
protected void | doRegisterAfterCompletionWithJtaTransaction(JtaTransactionObject txObject, List<TransactionSynchronization> synchronizations) Register a JTA synchronization on the JTA TransactionManager, for calling afterCompletion on the given Spring TransactionSynchronizations.
protected void | doResume(Object transaction, Object suspendedResources) Resume the resources of the current transaction.
protected void | doRollback(DefaultTransactionStatus status) Perform an actual rollback of the given transaction.
protected void | doSetRollbackOnly(DefaultTransactionStatus status) Set the given transaction rollback-only.
protected Object | doSuspend(Object transaction) Suspend the resources of the current transaction.
protected TransactionManager | findTransactionManager(UserTransaction ut) Find the JTA TransactionManager through autodetection: checking whether the UserTransaction object implements the TransactionManager, and checking the fallback JNDI locations.
protected Object | findTransactionSynchronizationRegistry(UserTransaction ut, TransactionManager tm) Find the JTA 1.1 TransactionSynchronizationRegistry through autodetection: checking whether the UserTransaction object or TransactionManager object implements it, and checking Java EE 5's standard JNDI location.
protected UserTransaction | findUserTransaction() Find the JTA UserTransaction through a default JNDI lookup: "java:comp/UserTransaction".
Properties | getJndiEnvironment() Return the JNDI environment to use for JNDI lookups.
JndiTemplate | getJndiTemplate() Return the JndiTemplate used for JNDI lookups.
TransactionManager | getTransactionManager() Return the JTA TransactionManager that this transaction manager uses.
UserTransaction | getUserTransaction() Return the JTA UserTransaction that this transaction manager uses.
protected void | initTransactionSynchronizationRegistry() Initialize the JTA 1.1 TransactionSynchronizationRegistry, if available.
protected void | initUserTransactionAndTransactionManager() Initialize the UserTransaction as well as the TransactionManager handle.
protected boolean | isExistingTransaction(Object transaction) Check if the given transaction object indicates an existing transaction (that is, a transaction which has already started).
protected TransactionManager | lookupTransactionManager(String transactionManagerName) Look up the JTA TransactionManager in JNDI via the configured name.
protected Object | lookupTransactionSynchronizationRegistry(String registryName) Look up the JTA 1.1 TransactionSynchronizationRegistry in JNDI via the configured name.
protected UserTransaction | lookupUserTransaction(String userTransactionName) Look up the JTA UserTransaction in JNDI via the configured name.
protected void | registerAfterCompletionWithExistingTransaction(Object transaction, List<TransactionSynchronization> synchronizations) Register the given list of transaction synchronizations with the existing transaction.
protected TransactionManager | retrieveTransactionManager() Allows subclasses to retrieve the JTA TransactionManager in a vendor-specific manner.
protected Object | retrieveTransactionSynchronizationRegistry() Allows subclasses to retrieve the JTA 1.1 TransactionSynchronizationRegistry in a vendor-specific manner.
protected UserTransaction | retrieveUserTransaction() Allows subclasses to retrieve the JTA UserTransaction in a vendor-specific manner.
void | setAllowCustomIsolationLevels(boolean allowCustomIsolationLevels) Set whether to allow custom isolation levels to be specified.
void | setAutodetectTransactionManager(boolean autodetectTransactionManager) Set whether to autodetect a JTA UserTransaction object that implements the JTA TransactionManager interface too (i.e.
void | setAutodetectUserTransaction(boolean autodetectUserTransaction) Set whether to autodetect the JTA UserTransaction at its default JNDI location "java:comp/UserTransaction", as specified by Java EE.
void | setCacheUserTransaction(boolean cacheUserTransaction) Set whether to cache the JTA UserTransaction object fetched from JNDI.
void | setJndiEnvironment(Properties jndiEnvironment) Set the JNDI environment to use for JNDI lookups.
void | setJndiTemplate(JndiTemplate jndiTemplate) Set the JndiTemplate to use for JNDI lookups.
void | setTransactionManager(TransactionManager transactionManager) Set the JTA TransactionManager to use as direct reference.
void | setTransactionManagerName(String transactionManagerName) Set the JNDI name of the JTA TransactionManager.
void | setTransactionSynchronizationRegistryName(String transactionSynchronizationRegistryName) Set the JNDI name of the JTA 1.1 TransactionSynchronizationRegistry.
void | setUserTransaction(UserTransaction userTransaction) Set the JTA UserTransaction to use as direct reference.
void | setUserTransactionName(String userTransactionName) Set the JNDI name of the JTA UserTransaction.
protected boolean | shouldCommitOnGlobalRollbackOnly() This implementation returns "true": a JTA commit will properly handle transactions that have been marked rollback-only at a global level.
boolean | supportsResourceAdapterManagedTransactions() Determine whether the underlying transaction manager supports XA transactions managed by a resource adapter (i.e.
protected boolean | useSavepointForNestedTransaction() This implementation returns false to cause a further invocation of doBegin despite an already existing transaction.
Methods inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
commit, determineTimeout, doCleanupAfterCompletion, getDefaultTimeout, getTransaction, getTransactionSynchronization, invokeAfterCompletion, isFailEarlyOnGlobalRollbackOnly, isGlobalRollbackOnParticipationFailure, isNestedTransactionAllowed, isRollbackOnCommitFailure, isValidateExistingTransaction, newTransactionStatus, prepareForCommit, prepareSynchronization, prepareTransactionStatus, resume, rollback, setDefaultTimeout, setFailEarlyOnGlobalRollbackOnly, setGlobalRollbackOnParticipationFailure, setNestedTransactionAllowed, setRollbackOnCommitFailure, setTransactionSynchronization, setTransactionSynchronizationName, setValidateExistingTransaction, suspend, triggerBeforeCommit, triggerBeforeCompletion
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_USER_TRANSACTION_NAME

public static final String DEFAULT_USER_TRANSACTION_NAME
Default JNDI location for the JTA UserTransaction. Many Java EE servers also provide support for the JTA TransactionManager interface there.

See Also:
setUserTransactionName(java.lang.String), setAutodetectTransactionManager(boolean), Constant Field Values

FALLBACK_TRANSACTION_MANAGER_NAMES

public static final String[] FALLBACK_TRANSACTION_MANAGER_NAMES
Fallback JNDI locations for the JTA TransactionManager. Applied if the JTA UserTransaction does not implement the JTA TransactionManager interface, provided that the "autodetectTransactionManager" flag is "true".

See Also:
setTransactionManagerName(java.lang.String), setAutodetectTransactionManager(boolean)

DEFAULT_TRANSACTION_SYNCHRONIZATION_REGISTRY_NAME

public static final String DEFAULT_TRANSACTION_SYNCHRONIZATION_REGISTRY_NAME
Standard Java EE 5 JNDI location for the JTA TransactionSynchronizationRegistry. Autodetected when available.

See Also:
Constant Field Values
Constructor Detail

JtaTransactionManager

public JtaTransactionManager()
Create a new JtaTransactionManager instance, to be configured as bean. Invoke afterPropertiesSet to activate the configuration.

See Also:
setUserTransactionName(java.lang.String),
setUserTransaction(javax.transaction.UserTransaction),
setTransactionManagerName(java.lang.String),
setTransactionManager(javax.transaction.TransactionManager),
afterPropertiesSet()

JtaTransactionManager

public JtaTransactionManager(UserTransaction userTransaction)
Create a new JtaTransactionManager instance.

Parameters:
userTransaction - the JTA UserTransaction to use as direct reference

JtaTransactionManager

public JtaTransactionManager(UserTransaction userTransaction,
                             TransactionManager transactionManager)
Create a new JtaTransactionManager instance.

Parameters:
userTransaction - the JTA UserTransaction to use as direct reference
transactionManager - the JTA TransactionManager to use as direct reference

JtaTransactionManager

public JtaTransactionManager(TransactionManager transactionManager)
Create a new JtaTransactionManager instance.

Parameters:
transactionManager - the JTA TransactionManager to use as direct reference
Method Detail

setJndiTemplate

public void setJndiTemplate(JndiTemplate jndiTemplate)
Set the JndiTemplate to use for JNDI lookups. A default one is used if not set.

getJndiTemplate

public JndiTemplate getJndiTemplate()
Return the JndiTemplate used for JNDI lookups.

setJndiEnvironment

public void setJndiEnvironment(Properties jndiEnvironment)
Set the JNDI environment to use for JNDI lookups. Creates a JndiTemplate with the given environment settings.

See Also:
setJndiTemplate(org.springframework.jndi.JndiTemplate)

getJndiEnvironment

public Properties getJndiEnvironment()
Return the JNDI environment to use for JNDI lookups.

setUserTransaction

public void setUserTransaction(UserTransaction userTransaction)
Set the JTA UserTransaction to use as direct reference.

Typically just used for local JTA setups; in a Java EE environment, the UserTransaction will always be fetched from JNDI.

See Also:
setUserTransactionName(java.lang.String), setAutodetectUserTransaction(boolean)

getUserTransaction

public UserTransaction getUserTransaction()
Return the JTA UserTransaction that this transaction manager uses.

setUserTransactionName

public void setUserTransactionName(String userTransactionName)
Set the JNDI name of the JTA UserTransaction.

Note that the UserTransaction will be autodetected at the Java EE default location "java:comp/UserTransaction" if not specified explicitly.

See Also:
DEFAULT_USER_TRANSACTION_NAME, setUserTransaction(javax.transaction.UserTransaction), setAutodetectUserTransaction(boolean)

setAutodetectUserTransaction

public void setAutodetectUserTransaction(boolean autodetectUserTransaction)
Set whether to autodetect the JTA UserTransaction at its default JNDI location "java:comp/UserTransaction", as specified by Java EE. Will proceed without UserTransaction if none found.

Default is "true", autodetecting the UserTransaction unless it has been specified explicitly. Turn this flag off to allow for JtaTransactionManager operating against the TransactionManager only, despite a default UserTransaction being available.

See Also:
DEFAULT_USER_TRANSACTION_NAME

setCacheUserTransaction

public void setCacheUserTransaction(boolean cacheUserTransaction)
Set whether to cache the JTA UserTransaction object fetched from JNDI.

Default is "true": UserTransaction lookup will only happen at startup, reusing the same UserTransaction handle for all transactions of all threads. This is the most efficient choice for all application servers that provide a shared UserTransaction object (the typical case).

Turn this flag off to enforce a fresh lookup of the UserTransaction for every transaction. This is only necessary for application servers that return a new UserTransaction for every transaction, keeping state tied to the UserTransaction object itself rather than the current thread.

See Also:
setUserTransactionName(java.lang.String)

setTransactionManager

public void setTransactionManager(TransactionManager transactionManager)
Set the JTA TransactionManager to use as direct reference.

A TransactionManager is necessary for suspending and resuming transactions, as this not supported by the UserTransaction interface.

Note that the TransactionManager will be autodetected if the JTA UserTransaction object implements the JTA TransactionManager interface too, as well as autodetected at various well-known fallback JNDI locations.

See Also:
setTransactionManagerName(java.lang.String), setAutodetectTransactionManager(boolean)

getTransactionManager

public TransactionManager getTransactionManager()
Return the JTA TransactionManager that this transaction manager uses.

setTransactionManagerName

public void setTransactionManagerName(String transactionManagerName)
Set the JNDI name of the JTA TransactionManager.

A TransactionManager is necessary for suspending and resuming transactions, as this not supported by the UserTransaction interface.

Note that the TransactionManager will be autodetected if the JTA UserTransaction object implements the JTA TransactionManager interface too, as well as autodetected at various well-known fallback JNDI locations.

See Also:
setTransactionManager(javax.transaction.TransactionManager), setAutodetectTransactionManager(boolean)

setAutodetectTransactionManager

public void setAutodetectTransactionManager(boolean autodetectTransactionManager)
Set whether to autodetect a JTA UserTransaction object that implements the JTA TransactionManager interface too (i.e. the JNDI location for the TransactionManager is "java:comp/UserTransaction", same as for the UserTransaction). Also checks the fallback JNDI locations "java:comp/TransactionManager" and "java:/TransactionManager". Will proceed without TransactionManager if none found.

Default is "true", autodetecting the TransactionManager unless it has been specified explicitly. Can be turned off to deliberately ignore an available TransactionManager, for example when there are known issues with suspend/resume and any attempt to use REQUIRES_NEW or NOT_SUPPORTED should fail fast.

See Also:
FALLBACK_TRANSACTION_MANAGER_NAMES

setTransactionSynchronizationRegistryName

public void setTransactionSynchronizationRegistryName(String transactionSynchronizationRegistryName)
Set the JNDI name of the JTA 1.1 TransactionSynchronizationRegistry.

Note that the TransactionSynchronizationRegistry will be autodetected at the Java EE 5 default location "java:comp/TransactionSynchronizationRegistry" if not specified explicitly.

See Also:
DEFAULT_TRANSACTION_SYNCHRONIZATION_REGISTRY_NAME

setAllowCustomIsolationLevels

public void setAllowCustomIsolationLevels(boolean allowCustomIsolationLevels)
Set whether to allow custom isolation levels to be specified.

Default is "false", throwing an exception if a non-default isolation level is specified for a transaction. Turn this flag on if affected resource adapters check the thread-bound transaction context and apply the specified isolation levels individually (e.g. through a IsolationLevelDataSourceRouter).

See Also:
IsolationLevelDataSourceRouter

afterPropertiesSet

public void afterPropertiesSet()
                        throws TransactionSystemException
Initialize the UserTransaction as well as the TransactionManager handle.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
TransactionSystemException
See Also:
initUserTransactionAndTransactionManager()

initUserTransactionAndTransactionManager

protected void initUserTransactionAndTransactionManager()
                                                 throws TransactionSystemException
Initialize the UserTransaction as well as the TransactionManager handle.

Throws:
TransactionSystemException - if initialization failed

checkUserTransactionAndTransactionManager

protected void checkUserTransactionAndTransactionManager()
                                                  throws IllegalStateException
Check the UserTransaction as well as the TransactionManager handle, assuming standard JTA requirements.

Throws:
IllegalStateException - if no sufficient handles are available

initTransactionSynchronizationRegistry

protected void initTransactionSynchronizationRegistry()
Initialize the JTA 1.1 TransactionSynchronizationRegistry, if available.

To be called after initUserTransactionAndTransactionManager(), since it may check the UserTransaction and TransactionManager handles.

Throws:
TransactionSystemException - if initialization failed

buildUserTransaction

protected UserTransaction buildUserTransaction(TransactionManager transactionManager)
Build a UserTransaction handle based on the given TransactionManager.

Parameters:
transactionManager - the TransactionManager
Returns:
a corresponding UserTransaction handle

lookupUserTransaction

protected UserTransaction lookupUserTransaction(String userTransactionName)
                                         throws TransactionSystemException
Look up the JTA UserTransaction in JNDI via the configured name.

Called by afterPropertiesSet if no direct UserTransaction reference was set. Can be overridden in subclasses to provide a different UserTransaction object.

Parameters:
userTransactionName - the JNDI name of the UserTransaction
Returns:
the UserTransaction object
Throws:
TransactionSystemException - if the JNDI lookup failed
See Also:
setJndiTemplate(org.springframework.jndi.JndiTemplate), setUserTransactionName(java.lang.String)

lookupTransactionManager

protected TransactionManager lookupTransactionManager(String transactionManagerName)
                                               throws TransactionSystemException
Look up the JTA TransactionManager in JNDI via the configured name.

Called by afterPropertiesSet if no direct TransactionManager reference was set. Can be overridden in subclasses to provide a different TransactionManager object.

Parameters:
transactionManagerName - the JNDI name of the TransactionManager
Returns:
the UserTransaction object
Throws:
TransactionSystemException - if the JNDI lookup failed
See Also:
setJndiTemplate(org.springframework.jndi.JndiTemplate), setTransactionManagerName(java.lang.String)

lookupTransactionSynchronizationRegistry

protected Object lookupTransactionSynchronizationRegistry(String registryName)
                                                   throws TransactionSystemException
Look up the JTA 1.1 TransactionSynchronizationRegistry in JNDI via the configured name.

Can be overridden in subclasses to provide a different TransactionManager object.

Parameters:
registryName - the JNDI name of the TransactionSynchronizationRegistry
Returns:
the TransactionSynchronizationRegistry object
Throws:
TransactionSystemException - if the JNDI lookup failed
See Also:
setJndiTemplate(org.springframework.jndi.JndiTemplate), setTransactionSynchronizationRegistryName(java.lang.String)

retrieveUserTransaction

protected UserTransaction retrieveUserTransaction()
                                           throws TransactionSystemException
Allows subclasses to retrieve the JTA UserTransaction in a vendor-specific manner. Only called if no "userTransaction" or "userTransactionName" specified.

The default implementation simply returns null.

Returns:
the JTA UserTransaction handle to use, or null if none found
Throws:
TransactionSystemException - in case of errors
See Also:
setUserTransaction(javax.transaction.UserTransaction), setUserTransactionName(java.lang.String)

retrieveTransactionManager

protected TransactionManager retrieveTransactionManager()
                                                 throws TransactionSystemException
Allows subclasses to retrieve the JTA TransactionManager in a vendor-specific manner. Only called if no "transactionManager" or "transactionManagerName" specified.

The default implementation simply returns null.

Returns:
the JTA TransactionManager handle to use, or null if none found
Throws:
TransactionSystemException - in case of errors
See Also:
setTransactionManager(javax.transaction.TransactionManager), setTransactionManagerName(java.lang.String)

retrieveTransactionSynchronizationRegistry

protected Object retrieveTransactionSynchronizationRegistry()
                                                     throws TransactionSystemException
Allows subclasses to retrieve the JTA 1.1 TransactionSynchronizationRegistry in a vendor-specific manner.

The default implementation simply returns null.

Returns:
the JTA TransactionSynchronizationRegistry handle to use, or null if none found
Throws:
TransactionSystemException - in case of errors

findUserTransaction

protected UserTransaction findUserTransaction()
Find the JTA UserTransaction through a default JNDI lookup: "java:comp/UserTransaction".

Returns:
the JTA UserTransaction reference, or null if not found
See Also:
DEFAULT_USER_TRANSACTION_NAME

findTransactionManager

protected TransactionManager findTransactionManager(UserTransaction ut)
Find the JTA TransactionManager through autodetection: checking whether the UserTransaction object implements the TransactionManager, and checking the fallback JNDI locations.

Parameters:
ut - the JTA UserTransaction object
Returns:
the JTA TransactionManager reference, or null if not found
See Also:
FALLBACK_TRANSACTION_MANAGER_NAMES

findTransactionSynchronizationRegistry

protected Object findTransactionSynchronizationRegistry(UserTransaction ut,
                                                        TransactionManager tm)
                                                 throws TransactionSystemException
Find the JTA 1.1 TransactionSynchronizationRegistry through autodetection: checking whether the UserTransaction object or TransactionManager object implements it, and checking Java EE 5's standard JNDI location.

The default implementation simply returns null.

Parameters:
ut - the JTA UserTransaction object
tm - the JTA TransactionManager object
Returns:
the JTA TransactionSynchronizationRegistry handle to use, or null if none found
Throws:
TransactionSystemException - in case of errors

doGetTransaction

protected Object doGetTransaction()
This implementation returns a JtaTransactionObject instance for the JTA UserTransaction.

The UserTransaction object will either be looked up freshly for the current transaction, or the cached one looked up at startup will be used. The latter is the default: Most application servers use a shared singleton UserTransaction that can be cached. Turn off the "cacheUserTransaction" flag to enforce a fresh lookup for every transaction.

Specified by:
doGetTransaction in class AbstractPlatformTransactionManager
Returns:
the current transaction object
See Also:
setCacheUserTransaction(boolean)

doGetJtaTransaction

protected JtaTransactionObject doGetJtaTransaction(UserTransaction ut)
Get a JTA transaction object for the given current UserTransaction.

Subclasses can override this to provide a JtaTransactionObject subclass, for example holding some additional JTA handle needed.

Parameters:
ut - the UserTransaction handle to use for the current transaction
Returns:
the JtaTransactionObject holding the UserTransaction

isExistingTransaction

protected boolean isExistingTransaction(Object transaction)
Description copied from class: AbstractPlatformTransactionManager
Check if the given transaction object indicates an existing transaction (that is, a transaction which has already started).

The result will be evaluated according to the specified propagation behavior for the new transaction. An existing transaction might get suspended (in case of PROPAGATION_REQUIRES_NEW), or the new transaction might participate in the existing one (in case of PROPAGATION_REQUIRED).

The default implementation returns false, assuming that participating in existing transactions is generally not supported. Subclasses are of course encouraged to provide such support.

Overrides:
isExistingTransaction in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
Returns:
if there is an existing transaction
See Also:
AbstractPlatformTransactionManager.doGetTransaction()

useSavepointForNestedTransaction

protected boolean useSavepointForNestedTransaction()
This implementation returns false to cause a further invocation of doBegin despite an already existing transaction.

JTA implementations might support nested transactions via further UserTransaction.begin() invocations, but never support savepoints.

Overrides:
useSavepointForNestedTransaction in class AbstractPlatformTransactionManager
See Also:
doBegin(java.lang.Object, org.springframework.transaction.TransactionDefinition), UserTransaction.begin()

doBegin

protected void doBegin(Object transaction,
                       TransactionDefinition definition)
Description copied from class: AbstractPlatformTransactionManager
Begin a new transaction with semantics according to the given transaction definition. Does not have to care about applying the propagation behavior, as this has already been handled by this abstract manager.

This method gets called when the transaction manager has decided to actually start a new transaction. Either there wasn't any transaction before, or the previous transaction has been suspended.

A special scenario is a nested transaction without savepoint: If useSavepointForNestedTransaction() returns "false", this method will be called to start a nested transaction when necessary. In such a context, there will be an active transaction: The implementation of this method has to detect this and start an appropriate nested transaction.

Specified by:
doBegin in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
definition - TransactionDefinition instance, describing propagation behavior, isolation level, read-only flag, timeout, and transaction name

doJtaBegin

protected void doJtaBegin(JtaTransactionObject txObject,
                          TransactionDefinition definition)
                   throws NotSupportedException,
                          SystemException
Perform a JTA begin on the JTA UserTransaction or TransactionManager.

This implementation only supports standard JTA functionality: that is, no per-transaction isolation levels and no transaction names. Can be overridden in subclasses, for specific JTA implementations.

Calls applyIsolationLevel and applyTimeout before invoking the UserTransaction's begin method.

Parameters:
txObject - the JtaTransactionObject containing the UserTransaction
definition - TransactionDefinition instance, describing propagation behavior, isolation level, read-only flag, timeout, and transaction name
Throws:
NotSupportedException - if thrown by JTA methods
SystemException - if thrown by JTA methods
See Also:
getUserTransaction(),
getTransactionManager(),
applyIsolationLevel(org.springframework.transaction.jta.JtaTransactionObject, int),
applyTimeout(org.springframework.transaction.jta.JtaTransactionObject, int),
JtaTransactionObject.getUserTransaction(),
UserTransaction.setTransactionTimeout(int),
UserTransaction.begin()

applyIsolationLevel

protected void applyIsolationLevel(JtaTransactionObject txObject,
                                   int isolationLevel)
                            throws InvalidIsolationLevelException,
                                   SystemException
Apply the given transaction isolation level. The default implementation will throw an exception for any level other than ISOLATION_DEFAULT.

To be overridden in subclasses for specific JTA implementations, as alternative to overriding the full doJtaBegin(org.springframework.transaction.jta.JtaTransactionObject, org.springframework.transaction.TransactionDefinition) method.

Parameters:
txObject - the JtaTransactionObject containing the UserTransaction
isolationLevel - isolation level taken from transaction definition
Throws:
InvalidIsolationLevelException - if the given isolation level cannot be applied
SystemException - if thrown by the JTA implementation
See Also:
doJtaBegin(org.springframework.transaction.jta.JtaTransactionObject, org.springframework.transaction.TransactionDefinition),
JtaTransactionObject.getUserTransaction(),
getTransactionManager()

applyTimeout

protected void applyTimeout(JtaTransactionObject txObject,
                            int timeout)
                     throws SystemException
Apply the given transaction timeout. The default implementation will call UserTransaction.setTransactionTimeout for a non-default timeout value.

Parameters:
txObject - the JtaTransactionObject containing the UserTransaction
timeout - timeout value taken from transaction definition
Throws:
SystemException - if thrown by the JTA implementation
See Also:
doJtaBegin(org.springframework.transaction.jta.JtaTransactionObject, org.springframework.transaction.TransactionDefinition),
JtaTransactionObject.getUserTransaction(),
UserTransaction.setTransactionTimeout(int)

doSuspend

protected Object doSuspend(Object transaction)
Description copied from class: AbstractPlatformTransactionManager
Suspend the resources of the current transaction. Transaction synchronization will already have been suspended.

The default implementation throws a TransactionSuspensionNotSupportedException, assuming that transaction suspension is generally not supported.

Overrides:
doSuspend in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
Returns:
an object that holds suspended resources (will be kept unexamined for passing it into doResume)
See Also:
AbstractPlatformTransactionManager.doResume(java.lang.Object, java.lang.Object)

doJtaSuspend

protected Object doJtaSuspend(JtaTransactionObject txObject)
                       throws SystemException
Perform a JTA suspend on the JTA TransactionManager.

Can be overridden in subclasses, for specific JTA implementations.

Parameters:
txObject - the JtaTransactionObject containing the UserTransaction
Returns:
the suspended JTA Transaction object
Throws:
SystemException - if thrown by JTA methods
See Also:
getTransactionManager(), TransactionManager.suspend()

doResume

protected void doResume(Object transaction,
                        Object suspendedResources)
Description copied from class: AbstractPlatformTransactionManager
Resume the resources of the current transaction. Transaction synchronization will be resumed afterwards.

The default implementation throws a TransactionSuspensionNotSupportedException, assuming that transaction suspension is generally not supported.

Overrides:
doResume in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
suspendedResources - the object that holds suspended resources, as returned by doSuspend
See Also:
AbstractPlatformTransactionManager.doSuspend(java.lang.Object)

doJtaResume

protected void doJtaResume(JtaTransactionObject txObject,
                           Object suspendedTransaction)
                    throws InvalidTransactionException,
                           SystemException
Perform a JTA resume on the JTA TransactionManager.

Can be overridden in subclasses, for specific JTA implementations.

Parameters:
txObject - the JtaTransactionObject containing the UserTransaction
suspendedTransaction - the suspended JTA Transaction object
Throws:
InvalidTransactionException - if thrown by JTA methods
SystemException - if thrown by JTA methods
See Also:
getTransactionManager(), TransactionManager.resume(javax.transaction.Transaction)

shouldCommitOnGlobalRollbackOnly

protected boolean shouldCommitOnGlobalRollbackOnly()
This implementation returns "true": a JTA commit will properly handle transactions that have been marked rollback-only at a global level.

Overrides:
shouldCommitOnGlobalRollbackOnly in class AbstractPlatformTransactionManager
See Also:
AbstractPlatformTransactionManager.doCommit(org.springframework.transaction.support.DefaultTransactionStatus),
DefaultTransactionStatus.isGlobalRollbackOnly(),
AbstractTransactionStatus.isLocalRollbackOnly(),
TransactionStatus.setRollbackOnly(),
UnexpectedRollbackException,
UserTransaction.commit(),
RollbackException

doCommit

protected void doCommit(DefaultTransactionStatus status)
Description copied from class: AbstractPlatformTransactionManager
Perform an actual commit of the given transaction.

An implementation does not need to check the "new transaction" flag or the rollback-only flag; this will already have been handled before. Usually, a straight commit will be performed on the transaction object contained in the passed-in status.

Specified by:
doCommit in class AbstractPlatformTransactionManager
Parameters:
status - the status representation of the transaction
See Also:
DefaultTransactionStatus.getTransaction()

doRollback

protected void doRollback(DefaultTransactionStatus status)
Description copied from class: AbstractPlatformTransactionManager
Perform an actual rollback of the given transaction.

An implementation does not need to check the "new transaction" flag; this will already have been handled before. Usually, a straight rollback will be performed on the transaction object contained in the passed-in status.

Specified by:
doRollback in class AbstractPlatformTransactionManager
Parameters:
status - the status representation of the transaction
See Also:
DefaultTransactionStatus.getTransaction()

doSetRollbackOnly

protected void doSetRollbackOnly(DefaultTransactionStatus status)
Description copied from class: AbstractPlatformTransactionManager
Set the given transaction rollback-only. Only called on rollback if the current transaction participates in an existing one.

The default implementation throws an IllegalTransactionStateException, assuming that participating in existing transactions is generally not supported. Subclasses are of course encouraged to provide such support.

Overrides:
doSetRollbackOnly in class AbstractPlatformTransactionManager
Parameters:
status - the status representation of the transaction

registerAfterCompletionWithExistingTransaction

protected void registerAfterCompletionWithExistingTransaction(Object transaction,
                                                              List<TransactionSynchronization> synchronizations)
Description copied from class: AbstractPlatformTransactionManager
Register the given list of transaction synchronizations with the existing transaction.

Invoked when the control of the Spring transaction manager and thus all Spring transaction synchronizations end, without the transaction being completed yet. This is for example the case when participating in an existing JTA or EJB CMT transaction.

The default implementation simply invokes the afterCompletion methods immediately, passing in "STATUS_UNKNOWN". This is the best we can do if there's no chance to determine the actual outcome of the outer transaction.

Overrides:
registerAfterCompletionWithExistingTransaction in class AbstractPlatformTransactionManager
Parameters:
transaction - transaction object returned by doGetTransaction
synchronizations - List of TransactionSynchronization objects
See Also:
AbstractPlatformTransactionManager.invokeAfterCompletion(java.util.List, int), TransactionSynchronization.afterCompletion(int), TransactionSynchronization.STATUS_UNKNOWN

doRegisterAfterCompletionWithJtaTransaction

protected void doRegisterAfterCompletionWithJtaTransaction(JtaTransactionObject txObject,
                                                           List<TransactionSynchronization> synchronizations)
                                                    throws RollbackException,
                                                           SystemException
Register a JTA synchronization on the JTA TransactionManager, for calling afterCompletion on the given Spring TransactionSynchronizations.

The default implementation registers the synchronizations on the JTA 1.1 TransactionSynchronizationRegistry, if available, or on the JTA TransactionManager's current Transaction - again, if available. If none of the two is available, a warning will be logged.

Can be overridden in subclasses, for specific JTA implementations.

Parameters:
txObject - the current transaction object
synchronizations - List of TransactionSynchronization objects
Throws:
RollbackException - if thrown by JTA methods
SystemException - if thrown by JTA methods
See Also:
getTransactionManager(),
Transaction.registerSynchronization(javax.transaction.Synchronization),
TransactionSynchronizationRegistry.registerInterposedSynchronization(javax.transaction.Synchronization)

createTransaction

public Transaction createTransaction(String name,
                                     int timeout)
                              throws NotSupportedException,
                                     SystemException
Description copied from interface: TransactionFactory
Create an active Transaction object based on the given name and timeout.

Specified by:
createTransaction in interface TransactionFactory
Parameters:
name - the transaction name (may be null)
timeout - the transaction timeout (may be -1 for the default timeout)
Returns:
the active Transaction object (never null)
Throws:
NotSupportedException - if the transaction manager does not support a transaction of the specified type
SystemException - if the transaction manager failed to create the transaction

supportsResourceAdapterManagedTransactions

public boolean supportsResourceAdapterManagedTransactions()
Description copied from interface: TransactionFactory
Determine whether the underlying transaction manager supports XA transactions managed by a resource adapter (i.e. without explicit XA resource enlistment).

Typically false. Checked by AbstractMessageEndpointFactory in order to differentiate between invalid configuration and valid ResourceAdapter-managed transactions.

Specified by:
supportsResourceAdapterManagedTransactions in interface TransactionFactory
See Also:
ResourceAdapter.endpointActivation(javax.resource.spi.endpoint.MessageEndpointFactory, javax.resource.spi.ActivationSpec), MessageEndpointFactory.isDeliveryTransacted(java.lang.reflect.Method)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JtaTransactionObject

org.springframework.transaction.jta
Class JtaTransactionObject

java.lang.Object
    extended by  org.springframework.transaction.jta.JtaTransactionObject
All Implemented Interfaces:
SmartTransactionObject
public class JtaTransactionObject
extends Object
implements SmartTransactionObject

JTA transaction object, representing a UserTransaction. Used as transaction object by Spring's JtaTransactionManager.

Note: This is an SPI class, not intended to be used by applications.

Since:
1.1
Author:
Juergen Hoeller
See Also:
JtaTransactionManager, UserTransaction

Constructor Summary
JtaTransactionObject(UserTransaction userTransaction)
Create a new JtaTransactionObject for the given JTA UserTransaction.
Method Summary
void | flush() This implementation triggers flush callbacks, assuming that they will flush all affected ORM sessions.
UserTransaction | getUserTransaction() Return the JTA UserTransaction object for the current transaction.
boolean | isRollbackOnly() This implementation checks the UserTransaction's rollback-only flag.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JtaTransactionObject

public JtaTransactionObject(UserTransaction userTransaction)
Create a new JtaTransactionObject for the given JTA UserTransaction.

Parameters:
userTransaction - the JTA UserTransaction for the current transaction (either a shared object or retrieved through a fresh per-transaction lookuip)
Method Detail

getUserTransaction

public final UserTransaction getUserTransaction()
Return the JTA UserTransaction object for the current transaction.

isRollbackOnly

public boolean isRollbackOnly()
This implementation checks the UserTransaction's rollback-only flag.

Specified by:
isRollbackOnly in interface SmartTransactionObject
See Also:
UserTransaction.getStatus(), Status.STATUS_MARKED_ROLLBACK

flush

public void flush()
This implementation triggers flush callbacks, assuming that they will flush all affected ORM sessions.

Specified by:
flush in interface SmartTransactionObject
See Also:
TransactionSynchronization.flush()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ManagedTransactionAdapter

org.springframework.transaction.jta
Class ManagedTransactionAdapter

java.lang.Object
    extended by  org.springframework.transaction.jta.ManagedTransactionAdapter
All Implemented Interfaces:
Transaction
public class ManagedTransactionAdapter
extends Object
implements Transaction

Adapter for a managed JTA Transaction handle, taking a JTA TransactionManager reference and creating a JTA Transaction handle for it.

Since:
3.0.2
Author:
Juergen Hoeller

Constructor Summary
ManagedTransactionAdapter(TransactionManager transactionManager)
Create a new ManagedTransactionAdapter for the given TransactionManager.
Method Summary
void | commit()
boolean | delistResource(XAResource xaRes, int flag)
boolean | enlistResource(XAResource xaRes)
int | getStatus()
TransactionManager | getTransactionManager() Return the JTA TransactionManager that this adapter delegates to.
void | registerSynchronization(Synchronization sync)
void | rollback()
void | setRollbackOnly()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ManagedTransactionAdapter

public ManagedTransactionAdapter(TransactionManager transactionManager)
                          throws SystemException
Create a new ManagedTransactionAdapter for the given TransactionManager.

Parameters:
transactionManager - the JTA TransactionManager to wrap
Throws:
SystemException
Method Detail

getTransactionManager

public final TransactionManager getTransactionManager()
Return the JTA TransactionManager that this adapter delegates to.

commit

public void commit()
            throws RollbackException,
                   HeuristicMixedException,
                   HeuristicRollbackException,
                   SecurityException,
                   SystemException
Specified by:
commit in interface Transaction
Throws:
RollbackException
HeuristicMixedException
HeuristicRollbackException
SecurityException
SystemException

rollback

public void rollback()
              throws SystemException
Specified by:
rollback in interface Transaction
Throws:
SystemException

setRollbackOnly

public void setRollbackOnly()
                     throws SystemException
Specified by:
setRollbackOnly in interface Transaction
Throws:
SystemException

getStatus

public int getStatus()
              throws SystemException
Specified by:
getStatus in interface Transaction
Throws:
SystemException

enlistResource

public boolean enlistResource(XAResource xaRes)
                       throws RollbackException,
                              SystemException
Specified by:
enlistResource in interface Transaction
Throws:
RollbackException
SystemException

delistResource

public boolean delistResource(XAResource xaRes,
                              int flag)
                       throws SystemException
Specified by:
delistResource in interface Transaction
Throws:
SystemException

registerSynchronization

public void registerSynchronization(Synchronization sync)
                             throws RollbackException,
                                    SystemException
Specified by:
registerSynchronization in interface Transaction
Throws:
RollbackException
SystemException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OC4JJtaTransactionManager

org.springframework.transaction.jta
Class OC4JJtaTransactionManager

java.lang.Object
    extended by  org.springframework.transaction.support.AbstractPlatformTransactionManager
        extended by  org.springframework.transaction.jta.JtaTransactionManager
            extended by  org.springframework.transaction.jta.OC4JJtaTransactionManager
All Implemented Interfaces:
Serializable, InitializingBean, TransactionFactory, PlatformTransactionManager
public class OC4JJtaTransactionManager
extends JtaTransactionManager

Special JtaTransactionManager variant for Oracle OC4J (10.1.3 and higher). Supports the full power of Spring's transaction definitions on OC4J's transaction coordinator, beyond standard JTA: transaction names and per-transaction isolation levels.

Uses OC4J's special begin(name) method to start a JTA transaction, in orderto make Spring-driven transactions visible in OC4J's transaction monitor. In case of Spring's declarative transactions, the exposed name will (by default) be the fully-qualified class name + "." + method name.

Supports a per-transaction isolation level through OC4J's corresponding OC4JTransaction.setTransactionIsolation(int) method. This will apply the specified isolation level (e.g. ISOLATION_SERIALIZABLE) to all JDBC Connections that participate in the given transaction.

Automatically detects the available OC4J server version and adapts accordingly. Supports the "com.evermind.server" package in OC4J 10.1.3.2 as well as the "oracle.j2ee.transaction" package in later OC4J versions.

By default, the JTA UserTransaction and TransactionManager handles are fetched directly from OC4J's TransactionUtility in 10.1.3.2+. This can be overridden by specifying "userTransaction"/"userTransactionName" and "transactionManager"/"transactionManagerName", passing in existing handles or specifying corresponding JNDI locations to look up.

Thanks to Oracle for donating the original version of this extended OC4J integration code to the Spring project!

Since:
2.0.3
Author:
Paul Parkinson, Juergen Hoeller
See Also:
TransactionDefinition.getName(), TransactionDefinition.getIsolationLevel(), oracle.j2ee.transaction.OC4JTransactionManager#begin(String), oracle.j2ee.transaction.OC4JTransaction#setTransactionIsolation, oracle.j2ee.transaction.TransactionUtility, Serialized Form

Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
AbstractPlatformTransactionManager.SuspendedResourcesHolder
Field Summary
Fields inherited from class org.springframework.transaction.jta.JtaTransactionManager
DEFAULT_TRANSACTION_SYNCHRONIZATION_REGISTRY_NAME, DEFAULT_USER_TRANSACTION_NAME, FALLBACK_TRANSACTION_MANAGER_NAMES
Fields inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
logger, SYNCHRONIZATION_ALWAYS, SYNCHRONIZATION_NEVER, SYNCHRONIZATION_ON_ACTUAL_TRANSACTION
Constructor Summary
OC4JJtaTransactionManager()
Method Summary
void | afterPropertiesSet() Initialize the UserTransaction as well as the TransactionManager handle.
Transaction | createTransaction(String name, int timeout) Create an active Transaction object based on the given name and timeout.
protected void | doJtaBegin(JtaTransactionObject txObject, TransactionDefinition definition) Perform a JTA begin on the JTA UserTransaction or TransactionManager.
protected UserTransaction | retrieveUserTransaction() Allows subclasses to retrieve the JTA UserTransaction in a vendor-specific manner.
Methods inherited from class org.springframework.transaction.jta.JtaTransactionManager
applyIsolationLevel, applyTimeout, buildUserTransaction, checkUserTransactionAndTransactionManager, doBegin, doCommit, doGetJtaTransaction, doGetTransaction, doJtaResume, doJtaSuspend, doRegisterAfterCompletionWithJtaTransaction, doResume, doRollback, doSetRollbackOnly, doSuspend, findTransactionManager, findTransactionSynchronizationRegistry, findUserTransaction, getJndiEnvironment, getJndiTemplate, getTransactionManager, getUserTransaction, initTransactionSynchronizationRegistry, initUserTransactionAndTransactionManager, isExistingTransaction, lookupTransactionManager, lookupTransactionSynchronizationRegistry, lookupUserTransaction, registerAfterCompletionWithExistingTransaction, retrieveTransactionManager, retrieveTransactionSynchronizationRegistry, setAllowCustomIsolationLevels, setAutodetectTransactionManager, setAutodetectUserTransaction, setCacheUserTransaction, setJndiEnvironment, setJndiTemplate, setTransactionManager, setTransactionManagerName, setTransactionSynchronizationRegistryName, setUserTransaction, setUserTransactionName, shouldCommitOnGlobalRollbackOnly, supportsResourceAdapterManagedTransactions, useSavepointForNestedTransaction
Methods inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
commit, determineTimeout, doCleanupAfterCompletion, getDefaultTimeout, getTransaction, getTransactionSynchronization, invokeAfterCompletion, isFailEarlyOnGlobalRollbackOnly, isGlobalRollbackOnParticipationFailure, isNestedTransactionAllowed, isRollbackOnCommitFailure, isValidateExistingTransaction, newTransactionStatus, prepareForCommit, prepareSynchronization, prepareTransactionStatus, resume, rollback, setDefaultTimeout, setFailEarlyOnGlobalRollbackOnly, setGlobalRollbackOnParticipationFailure, setNestedTransactionAllowed, setRollbackOnCommitFailure, setTransactionSynchronization, setTransactionSynchronizationName, setValidateExistingTransaction, suspend, triggerBeforeCommit, triggerBeforeCompletion
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OC4JJtaTransactionManager

public OC4JJtaTransactionManager()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws TransactionSystemException
Description copied from class: JtaTransactionManager
Initialize the UserTransaction as well as the TransactionManager handle.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class JtaTransactionManager
Throws:
TransactionSystemException
See Also:
JtaTransactionManager.initUserTransactionAndTransactionManager()

retrieveUserTransaction

protected UserTransaction retrieveUserTransaction()
                                           throws TransactionSystemException
Description copied from class: JtaTransactionManager
Allows subclasses to retrieve the JTA UserTransaction in a vendor-specific manner. Only called if no "userTransaction" or "userTransactionName" specified.

The default implementation simply returns null.

Overrides:
retrieveUserTransaction in class JtaTransactionManager
Returns:
the JTA UserTransaction handle to use, or null if none found
Throws:
TransactionSystemException - in case of errors
See Also:
JtaTransactionManager.setUserTransaction(javax.transaction.UserTransaction), JtaTransactionManager.setUserTransactionName(java.lang.String)

doJtaBegin

protected void doJtaBegin(JtaTransactionObject txObject,
                          TransactionDefinition definition)
                   throws NotSupportedException,
                          SystemException
Description copied from class: JtaTransactionManager
Perform a JTA begin on the JTA UserTransaction or TransactionManager.

This implementation only supports standard JTA functionality: that is, no per-transaction isolation levels and no transaction names. Can be overridden in subclasses, for specific JTA implementations.

Calls applyIsolationLevel and applyTimeout before invoking the UserTransaction's begin method.

Overrides:
doJtaBegin in class JtaTransactionManager
Parameters:
txObject - the JtaTransactionObject containing the UserTransaction
definition - TransactionDefinition instance, describing propagation behavior, isolation level, read-only flag, timeout, and transaction name
Throws:
NotSupportedException - if thrown by JTA methods
SystemException - if thrown by JTA methods
See Also:
JtaTransactionManager.getUserTransaction(),
JtaTransactionManager.getTransactionManager(),
JtaTransactionManager.applyIsolationLevel(org.springframework.transaction.jta.JtaTransactionObject, int),
JtaTransactionManager.applyTimeout(org.springframework.transaction.jta.JtaTransactionObject, int),
JtaTransactionObject.getUserTransaction(),
UserTransaction.setTransactionTimeout(int),
UserTransaction.begin()

createTransaction

public Transaction createTransaction(String name,
                                     int timeout)
                              throws NotSupportedException,
                                     SystemException
Description copied from interface: TransactionFactory
Create an active Transaction object based on the given name and timeout.

Specified by:
createTransaction in interface TransactionFactory
Overrides:
createTransaction in class JtaTransactionManager
Parameters:
name - the transaction name (may be null)
timeout - the transaction timeout (may be -1 for the default timeout)
Returns:
the active Transaction object (never null)
Throws:
NotSupportedException - if the transaction manager does not support a transaction of the specified type
SystemException - if the transaction manager failed to create the transaction
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleTransactionFactory

org.springframework.transaction.jta
Class SimpleTransactionFactory

java.lang.Object
    extended by  org.springframework.transaction.jta.SimpleTransactionFactory
All Implemented Interfaces:
TransactionFactory
public class SimpleTransactionFactory
extends Object
implements TransactionFactory

Default implementation of the TransactionFactory strategy interface, simply wrapping a standard JTA TransactionManager.

Does not support transaction names; simply ignores any specified name.

Since:
2.5
Author:
Juergen Hoeller
See Also:
TransactionManager.setTransactionTimeout(int),
TransactionManager.begin(),
TransactionManager.getTransaction()

Constructor Summary
SimpleTransactionFactory(TransactionManager transactionManager)
Create a new SimpleTransactionFactory for the given TransactionManager
Method Summary
Transaction | createTransaction(String name, int timeout) Create an active Transaction object based on the given name and timeout.
boolean | supportsResourceAdapterManagedTransactions() Determine whether the underlying transaction manager supports XA transactions managed by a resource adapter (i.e.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleTransactionFactory

public SimpleTransactionFactory(TransactionManager transactionManager)
Create a new SimpleTransactionFactory for the given TransactionManager

Parameters:
transactionManager - the JTA TransactionManager to wrap
Method Detail

createTransaction

public Transaction createTransaction(String name,
                                     int timeout)
                              throws NotSupportedException,
                                     SystemException
Description copied from interface: TransactionFactory
Create an active Transaction object based on the given name and timeout.

Specified by:
createTransaction in interface TransactionFactory
Parameters:
name - the transaction name (may be null)
timeout - the transaction timeout (may be -1 for the default timeout)
Returns:
the active Transaction object (never null)
Throws:
NotSupportedException - if the transaction manager does not support a transaction of the specified type
SystemException - if the transaction manager failed to create the transaction

supportsResourceAdapterManagedTransactions

public boolean supportsResourceAdapterManagedTransactions()
Description copied from interface: TransactionFactory
Determine whether the underlying transaction manager supports XA transactions managed by a resource adapter (i.e. without explicit XA resource enlistment).

Typically false. Checked by AbstractMessageEndpointFactory in order to differentiate between invalid configuration and valid ResourceAdapter-managed transactions.

Specified by:
supportsResourceAdapterManagedTransactions in interface TransactionFactory
See Also:
ResourceAdapter.endpointActivation(javax.resource.spi.endpoint.MessageEndpointFactory, javax.resource.spi.ActivationSpec), MessageEndpointFactory.isDeliveryTransacted(java.lang.reflect.Method)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SpringJtaSynchronizationAdapter

org.springframework.transaction.jta
Class SpringJtaSynchronizationAdapter

java.lang.Object
    extended by  org.springframework.transaction.jta.SpringJtaSynchronizationAdapter
All Implemented Interfaces:
Synchronization
public class SpringJtaSynchronizationAdapter
extends Object
implements Synchronization

Adapter that implements the JTA Synchronization interface delegating to an underlying Spring TransactionSynchronization.

Useful for synchronizing Spring resource management code with plain JTA / EJB CMT transactions, despite the original code being built for Spring transaction synchronization.

Since:
2.0
Author:
Juergen Hoeller
See Also:
Transaction.registerSynchronization(javax.transaction.Synchronization), TransactionSynchronization

Field Summary
protected static Log logger
Constructor Summary
SpringJtaSynchronizationAdapter(TransactionSynchronization springSynchronization)
Create a new SpringJtaSynchronizationAdapter for the given Spring TransactionSynchronization and JTA TransactionManager.
SpringJtaSynchronizationAdapter(TransactionSynchronization springSynchronization, TransactionManager jtaTransactionManager)
Create a new SpringJtaSynchronizationAdapter for the given Spring TransactionSynchronization and JTA TransactionManager.
SpringJtaSynchronizationAdapter(TransactionSynchronization springSynchronization, UserTransaction jtaUserTransaction)
Create a new SpringJtaSynchronizationAdapter for the given Spring TransactionSynchronization and JTA TransactionManager.
Method Summary
void | afterCompletion(int status) JTA afterCompletion callback: invoked after commit/rollback.
void | beforeCompletion() JTA beforeCompletion callback: just invoked before commit.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected static final Log logger
Constructor Detail

SpringJtaSynchronizationAdapter

public SpringJtaSynchronizationAdapter(TransactionSynchronization springSynchronization)
Create a new SpringJtaSynchronizationAdapter for the given Spring TransactionSynchronization and JTA TransactionManager.

Parameters:
springSynchronization - the Spring TransactionSynchronization to delegate to

SpringJtaSynchronizationAdapter

public SpringJtaSynchronizationAdapter(TransactionSynchronization springSynchronization,
                                       UserTransaction jtaUserTransaction)
Create a new SpringJtaSynchronizationAdapter for the given Spring TransactionSynchronization and JTA TransactionManager.

Note that this adapter will never perform a rollback-only call on WebLogic, since WebLogic Server is known to automatically mark the transaction as rollback-only in case of a beforeCompletion exception. Hence, on WLS, this constructor is equivalent to the single-arg constructor.

Parameters:
springSynchronization - the Spring TransactionSynchronization to delegate to
jtaUserTransaction - the JTA UserTransaction to use for rollback-only setting in case of an exception thrown in beforeCompletion (can be omitted if the JTA provider itself marks the transaction rollback-only in such a scenario, which is required by the JTA specification as of JTA 1.1).

SpringJtaSynchronizationAdapter

public SpringJtaSynchronizationAdapter(TransactionSynchronization springSynchronization,
                                       TransactionManager jtaTransactionManager)
Create a new SpringJtaSynchronizationAdapter for the given Spring TransactionSynchronization and JTA TransactionManager.

Note that this adapter will never perform a rollback-only call on WebLogic, since WebLogic Server is known to automatically mark the transaction as rollback-only in case of a beforeCompletion exception. Hence, on WLS, this constructor is equivalent to the single-arg constructor.

Parameters:
springSynchronization - the Spring TransactionSynchronization to delegate to
jtaTransactionManager - the JTA TransactionManager to use for rollback-only setting in case of an exception thrown in beforeCompletion (can be omitted if the JTA provider itself marks the transaction rollback-only in such a scenario, which is required by the JTA specification as of JTA 1.1)
Method Detail

beforeCompletion

public void beforeCompletion()
JTA beforeCompletion callback: just invoked before commit.

In case of an exception, the JTA transaction will be marked as rollback-only.

Specified by:
beforeCompletion in interface Synchronization
See Also:
TransactionSynchronization.beforeCommit(boolean)

afterCompletion

public void afterCompletion(int status)
JTA afterCompletion callback: invoked after commit/rollback.

Needs to invoke the Spring synchronization's beforeCompletion at this late stage in case of a rollback, since there is no corresponding callback with JTA.

Specified by:
afterCompletion in interface Synchronization
See Also:
TransactionSynchronization.beforeCompletion(), TransactionSynchronization.afterCompletion(int)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UserTransactionAdapter

org.springframework.transaction.jta
Class UserTransactionAdapter

java.lang.Object
    extended by  org.springframework.transaction.jta.UserTransactionAdapter
All Implemented Interfaces:
UserTransaction
public class UserTransactionAdapter
extends Object
implements UserTransaction

Adapter for a JTA UserTransaction handle, taking a JTA TransactionManager reference and creating a JTA UserTransaction handle for it.

The JTA UserTransaction interface is an exact subset of the JTA TransactionManager interface. Unfortunately, it does not serve as super-interface of TransactionManager, though, which requires an adapter such as this class to be used when intending to talk to a TransactionManager handle through the UserTransaction interface.

Used internally by Spring's JtaTransactionManager for certain scenarios. Not intended for direct use in application code.

Since:
1.1.5
Author:
Juergen Hoeller

Constructor Summary
UserTransactionAdapter(TransactionManager transactionManager)
Create a new UserTransactionAdapter for the given TransactionManager.
Method Summary
void | begin()
void | commit()
int | getStatus()
TransactionManager | getTransactionManager() Return the JTA TransactionManager that this adapter delegates to.
void | rollback()
void | setRollbackOnly()
void | setTransactionTimeout(int timeout)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

UserTransactionAdapter

public UserTransactionAdapter(TransactionManager transactionManager)
Create a new UserTransactionAdapter for the given TransactionManager.

Parameters:
transactionManager - the JTA TransactionManager to wrap
Method Detail

getTransactionManager

public final TransactionManager getTransactionManager()
Return the JTA TransactionManager that this adapter delegates to.

setTransactionTimeout

public void setTransactionTimeout(int timeout)
                           throws SystemException
Specified by:
setTransactionTimeout in interface UserTransaction
Throws:
SystemException

begin

public void begin()
           throws NotSupportedException,
                  SystemException
Specified by:
begin in interface UserTransaction
Throws:
NotSupportedException
SystemException

commit

public void commit()
            throws RollbackException,
                   HeuristicMixedException,
                   HeuristicRollbackException,
                   SecurityException,
                   SystemException
Specified by:
commit in interface UserTransaction
Throws:
RollbackException
HeuristicMixedException
HeuristicRollbackException
SecurityException
SystemException

rollback

public void rollback()
              throws SecurityException,
                     SystemException
Specified by:
rollback in interface UserTransaction
Throws:
SecurityException
SystemException

setRollbackOnly

public void setRollbackOnly()
                     throws SystemException
Specified by:
setRollbackOnly in interface UserTransaction
Throws:
SystemException

getStatus

public int getStatus()
              throws SystemException
Specified by:
getStatus in interface UserTransaction
Throws:
SystemException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WebLogicJtaTransactionManager

org.springframework.transaction.jta
Class WebLogicJtaTransactionManager

java.lang.Object
    extended by  org.springframework.transaction.support.AbstractPlatformTransactionManager
        extended by  org.springframework.transaction.jta.JtaTransactionManager
            extended by  org.springframework.transaction.jta.WebLogicJtaTransactionManager
All Implemented Interfaces:
Serializable, InitializingBean, TransactionFactory, PlatformTransactionManager
public class WebLogicJtaTransactionManager
extends JtaTransactionManager

Special JtaTransactionManager variant for BEA WebLogic (9.0 and higher). Supports the full power of Spring's transaction definitions on WebLogic's transaction coordinator, beyond standard JTA: transaction names, per-transaction isolation levels, and proper resuming of transactions in all cases.

Uses WebLogic's special begin(name) method to start a JTA transaction, in order to make Spring-driven transactions visible in WebLogic's transaction monitor. In case of Spring's declarative transactions, the exposed name will (by default) be the fully-qualified class name + "." + method name.

Supports a per-transaction isolation level through WebLogic's corresponding JTA transaction property "ISOLATION LEVEL". This will apply the specified isolation level (e.g. ISOLATION_SERIALIZABLE) to all JDBC Connections that participate in the given transaction.

Invokes WebLogic's special forceResume method if standard JTA resume failed, to also resume if the target transaction was marked rollback-only. If you're not relying on this feature of transaction suspension in the first place, Spring's standard JtaTransactionManager will behave properly too.

By default, the JTA UserTransaction and TransactionManager handles are fetched directly from WebLogic's TransactionHelper. This can be overridden by specifying "userTransaction"/"userTransactionName" and "transactionManager"/"transactionManagerName", passing in existing handles or specifying corresponding JNDI locations to look up.

Since:
1.1
Author:
Juergen Hoeller
See Also:
TransactionDefinition.getName(), TransactionDefinition.getIsolationLevel(), weblogic.transaction.UserTransaction#begin(String), weblogic.transaction.Transaction#setProperty, weblogic.transaction.TransactionManager#forceResume, weblogic.transaction.TransactionHelper, Serialized Form

Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
AbstractPlatformTransactionManager.SuspendedResourcesHolder
Field Summary
Fields inherited from class org.springframework.transaction.jta.JtaTransactionManager
DEFAULT_TRANSACTION_SYNCHRONIZATION_REGISTRY_NAME, DEFAULT_USER_TRANSACTION_NAME, FALLBACK_TRANSACTION_MANAGER_NAMES
Fields inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
logger, SYNCHRONIZATION_ALWAYS, SYNCHRONIZATION_NEVER, SYNCHRONIZATION_ON_ACTUAL_TRANSACTION
Constructor Summary
WebLogicJtaTransactionManager()
Method Summary
void | afterPropertiesSet() Initialize the UserTransaction as well as the TransactionManager handle.
Transaction | createTransaction(String name, int timeout) Create an active Transaction object based on the given name and timeout.
protected void | doJtaBegin(JtaTransactionObject txObject, TransactionDefinition definition) Perform a JTA begin on the JTA UserTransaction or TransactionManager.
protected void | doJtaResume(JtaTransactionObject txObject, Object suspendedTransaction) Perform a JTA resume on the JTA TransactionManager.
protected TransactionManager | retrieveTransactionManager() Allows subclasses to retrieve the JTA TransactionManager in a vendor-specific manner.
protected UserTransaction | retrieveUserTransaction() Allows subclasses to retrieve the JTA UserTransaction in a vendor-specific manner.
Methods inherited from class org.springframework.transaction.jta.JtaTransactionManager
applyIsolationLevel, applyTimeout, buildUserTransaction, checkUserTransactionAndTransactionManager, doBegin, doCommit, doGetJtaTransaction, doGetTransaction, doJtaSuspend, doRegisterAfterCompletionWithJtaTransaction, doResume, doRollback, doSetRollbackOnly, doSuspend, findTransactionManager, findTransactionSynchronizationRegistry, findUserTransaction, getJndiEnvironment, getJndiTemplate, getTransactionManager, getUserTransaction, initTransactionSynchronizationRegistry, initUserTransactionAndTransactionManager, isExistingTransaction, lookupTransactionManager, lookupTransactionSynchronizationRegistry, lookupUserTransaction, registerAfterCompletionWithExistingTransaction, retrieveTransactionSynchronizationRegistry, setAllowCustomIsolationLevels, setAutodetectTransactionManager, setAutodetectUserTransaction, setCacheUserTransaction, setJndiEnvironment, setJndiTemplate, setTransactionManager, setTransactionManagerName, setTransactionSynchronizationRegistryName, setUserTransaction, setUserTransactionName, shouldCommitOnGlobalRollbackOnly, supportsResourceAdapterManagedTransactions, useSavepointForNestedTransaction
Methods inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
commit, determineTimeout, doCleanupAfterCompletion, getDefaultTimeout, getTransaction, getTransactionSynchronization, invokeAfterCompletion, isFailEarlyOnGlobalRollbackOnly, isGlobalRollbackOnParticipationFailure, isNestedTransactionAllowed, isRollbackOnCommitFailure, isValidateExistingTransaction, newTransactionStatus, prepareForCommit, prepareSynchronization, prepareTransactionStatus, resume, rollback, setDefaultTimeout, setFailEarlyOnGlobalRollbackOnly, setGlobalRollbackOnParticipationFailure, setNestedTransactionAllowed, setRollbackOnCommitFailure, setTransactionSynchronization, setTransactionSynchronizationName, setValidateExistingTransaction, suspend, triggerBeforeCommit, triggerBeforeCompletion
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

WebLogicJtaTransactionManager

public WebLogicJtaTransactionManager()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws TransactionSystemException
Description copied from class: JtaTransactionManager
Initialize the UserTransaction as well as the TransactionManager handle.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class JtaTransactionManager
Throws:
TransactionSystemException
See Also:
JtaTransactionManager.initUserTransactionAndTransactionManager()

retrieveUserTransaction

protected UserTransaction retrieveUserTransaction()
                                           throws TransactionSystemException
Description copied from class: JtaTransactionManager
Allows subclasses to retrieve the JTA UserTransaction in a vendor-specific manner. Only called if no "userTransaction" or "userTransactionName" specified.

The default implementation simply returns null.

Overrides:
retrieveUserTransaction in class JtaTransactionManager
Returns:
the JTA UserTransaction handle to use, or null if none found
Throws:
TransactionSystemException - in case of errors
See Also:
JtaTransactionManager.setUserTransaction(javax.transaction.UserTransaction), JtaTransactionManager.setUserTransactionName(java.lang.String)

retrieveTransactionManager

protected TransactionManager retrieveTransactionManager()
                                                 throws TransactionSystemException
Description copied from class: JtaTransactionManager
Allows subclasses to retrieve the JTA TransactionManager in a vendor-specific manner. Only called if no "transactionManager" or "transactionManagerName" specified.

The default implementation simply returns null.

Overrides:
retrieveTransactionManager in class JtaTransactionManager
Returns:
the JTA TransactionManager handle to use, or null if none found
Throws:
TransactionSystemException - in case of errors
See Also:
JtaTransactionManager.setTransactionManager(javax.transaction.TransactionManager), JtaTransactionManager.setTransactionManagerName(java.lang.String)

doJtaBegin

protected void doJtaBegin(JtaTransactionObject txObject,
                          TransactionDefinition definition)
                   throws NotSupportedException,
                          SystemException
Description copied from class: JtaTransactionManager
Perform a JTA begin on the JTA UserTransaction or TransactionManager.

This implementation only supports standard JTA functionality: that is, no per-transaction isolation levels and no transaction names. Can be overridden in subclasses, for specific JTA implementations.

Calls applyIsolationLevel and applyTimeout before invoking the UserTransaction's begin method.

Overrides:
doJtaBegin in class JtaTransactionManager
Parameters:
txObject - the JtaTransactionObject containing the UserTransaction
definition - TransactionDefinition instance, describing propagation behavior, isolation level, read-only flag, timeout, and transaction name
Throws:
NotSupportedException - if thrown by JTA methods
SystemException - if thrown by JTA methods
See Also:
JtaTransactionManager.getUserTransaction(),
JtaTransactionManager.getTransactionManager(),
JtaTransactionManager.applyIsolationLevel(org.springframework.transaction.jta.JtaTransactionObject, int),
JtaTransactionManager.applyTimeout(org.springframework.transaction.jta.JtaTransactionObject, int),
JtaTransactionObject.getUserTransaction(),
UserTransaction.setTransactionTimeout(int),
UserTransaction.begin()

doJtaResume

protected void doJtaResume(JtaTransactionObject txObject,
                           Object suspendedTransaction)
                    throws InvalidTransactionException,
                           SystemException
Description copied from class: JtaTransactionManager
Perform a JTA resume on the JTA TransactionManager.

Can be overridden in subclasses, for specific JTA implementations.

Overrides:
doJtaResume in class JtaTransactionManager
Parameters:
txObject - the JtaTransactionObject containing the UserTransaction
suspendedTransaction - the suspended JTA Transaction object
Throws:
InvalidTransactionException - if thrown by JTA methods
SystemException - if thrown by JTA methods
See Also:
JtaTransactionManager.getTransactionManager(), TransactionManager.resume(javax.transaction.Transaction)

createTransaction

public Transaction createTransaction(String name,
                                     int timeout)
                              throws NotSupportedException,
                                     SystemException
Description copied from interface: TransactionFactory
Create an active Transaction object based on the given name and timeout.

Specified by:
createTransaction in interface TransactionFactory
Overrides:
createTransaction in class JtaTransactionManager
Parameters:
name - the transaction name (may be null)
timeout - the transaction timeout (may be -1 for the default timeout)
Returns:
the active Transaction object (never null)
Throws:
NotSupportedException - if the transaction manager does not support a transaction of the specified type
SystemException - if the transaction manager failed to create the transaction
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WebSphereUowTransactionManager

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.transaction.jta
Class WebSphereUowTransactionManager

java.lang.Object
    extended by  org.springframework.transaction.support.AbstractPlatformTransactionManager
        extended by  org.springframework.transaction.jta.JtaTransactionManager
            extended by  org.springframework.transaction.jta.WebSphereUowTransactionManager
All Implemented Interfaces:
Serializable, InitializingBean, TransactionFactory, PlatformTransactionManager, CallbackPreferringPlatformTransactionManager
public class WebSphereUowTransactionManager
extends JtaTransactionManager
implements CallbackPreferringPlatformTransactionManager

WebSphere-specific PlatformTransactionManager implementation that delegates to a UOWManager instance, obtained from WebSphere's JNDI environment. This allows Spring to leverage the full power of the WebSphere transaction coordinator, including transaction suspension, in a manner that is perfectly compliant with officially supported WebSphere API.

The CallbackPreferringPlatformTransactionManager interface implemented by this class indicates that callers should preferably pass in a TransactionCallback through the execute(org.springframework.transaction.TransactionDefinition, org.springframework.transaction.support.TransactionCallback) method, which will be handled through the callback-based WebSphere UOWManager API instead of through standard JTA API (UserTransaction / TransactionManager). This avoids the use of the non-public javax.transaction.TransactionManager API on WebSphere, staying within supported WebSphere API boundaries.

This transaction manager implementation derives from Spring's standard JtaTransactionManager, inheriting the capability to support programmatic transaction demarcation via getTransaction / commit / rollback calls through a JTA UserTransaction handle, for callers that do not use the TransactionCallback-based execute(org.springframework.transaction.TransactionDefinition, org.springframework.transaction.support.TransactionCallback) method. However, transaction suspension is not supported in this getTransaction style (unless you explicitly specify a JtaTransactionManager.setTransactionManager(javax.transaction.TransactionManager) reference, despite the official WebSphere recommendations). Use the execute(org.springframework.transaction.TransactionDefinition, org.springframework.transaction.support.TransactionCallback) style for any code that might require transaction suspension.

This transaction manager is compatible with WebSphere 6.1.0.9 and above. The default JNDI location for the UOWManager is "java:comp/websphere/UOWManager". If the location happens to differ according to your WebSphere documentation, simply specify the actual location through this transaction manager's "uowManagerName" bean property.

Since:
2.5
Author:
Juergen Hoeller
See Also:
setUowManager(com.ibm.wsspi.uow.UOWManager), setUowManagerName(java.lang.String), UOWManager, Serialized Form

Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
AbstractPlatformTransactionManager.SuspendedResourcesHolder
Field Summary
static String DEFAULT_UOW_MANAGER_NAME
Default JNDI location for the WebSphere UOWManager.
Fields inherited from class org.springframework.transaction.jta.JtaTransactionManager
DEFAULT_TRANSACTION_SYNCHRONIZATION_REGISTRY_NAME, DEFAULT_USER_TRANSACTION_NAME, FALLBACK_TRANSACTION_MANAGER_NAMES
Fields inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
logger, SYNCHRONIZATION_ALWAYS, SYNCHRONIZATION_NEVER, SYNCHRONIZATION_ON_ACTUAL_TRANSACTION
Constructor Summary
WebSphereUowTransactionManager()
Create a new WebSphereUowTransactionManager.
WebSphereUowTransactionManager(com.ibm.wsspi.uow.UOWManager uowManager)
Create a new WebSphereUowTransactionManager for the given UOWManager.
Method Summary
 void afterPropertiesSet()
Initialize the UserTransaction as well as the TransactionManager handle.
protected  void doRegisterAfterCompletionWithJtaTransaction(JtaTransactionObject txObject, List<TransactionSynchronization> synchronizations)
Registers the synchronizations as interposed JTA Synchronization on the UOWManager.
<T> T
execute(TransactionDefinition definition, TransactionCallback<T> callback)
Execute the action specified by the given callback object within a transaction.
protected  com.ibm.wsspi.uow.UOWManager lookupDefaultUowManager()
Obtain the WebSphere UOWManager from the default JNDI location "java:comp/websphere/UOWManager".
protected  com.ibm.wsspi.uow.UOWManager lookupUowManager(String uowManagerName)
Look up the WebSphere UOWManager in JNDI via the configured name.
 void setUowManager(com.ibm.wsspi.uow.UOWManager uowManager)
Set the WebSphere UOWManager to use as direct reference.
 void setUowManagerName(String uowManagerName)
Set the JNDI name of the WebSphere UOWManager.
 boolean supportsResourceAdapterManagedTransactions()
Returns true since WebSphere ResourceAdapters (as exposed in JNDI) implicitly perform transaction enlistment if the MessageEndpointFactory's isDeliveryTransacted method returns true.
Methods inherited from class org.springframework.transaction.jta.JtaTransactionManager
applyIsolationLevel, applyTimeout, buildUserTransaction, checkUserTransactionAndTransactionManager, createTransaction, doBegin, doCommit, doGetJtaTransaction, doGetTransaction, doJtaBegin, doJtaResume, doJtaSuspend, doResume, doRollback, doSetRollbackOnly, doSuspend, findTransactionManager, findTransactionSynchronizationRegistry, findUserTransaction, getJndiEnvironment, getJndiTemplate, getTransactionManager, getUserTransaction, initTransactionSynchronizationRegistry, initUserTransactionAndTransactionManager, isExistingTransaction, lookupTransactionManager, lookupTransactionSynchronizationRegistry, lookupUserTransaction, registerAfterCompletionWithExistingTransaction, retrieveTransactionManager, retrieveTransactionSynchronizationRegistry, retrieveUserTransaction, setAllowCustomIsolationLevels, setAutodetectTransactionManager, setAutodetectUserTransaction, setCacheUserTransaction, setJndiEnvironment, setJndiTemplate, setTransactionManager, setTransactionManagerName, setTransactionSynchronizationRegistryName, setUserTransaction, setUserTransactionName, shouldCommitOnGlobalRollbackOnly, useSavepointForNestedTransaction
Methods inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
commit, determineTimeout, doCleanupAfterCompletion, getDefaultTimeout, getTransaction, getTransactionSynchronization, invokeAfterCompletion, isFailEarlyOnGlobalRollbackOnly, isGlobalRollbackOnParticipationFailure, isNestedTransactionAllowed, isRollbackOnCommitFailure, isValidateExistingTransaction, newTransactionStatus, prepareForCommit, prepareSynchronization, prepareTransactionStatus, resume, rollback, setDefaultTimeout, setFailEarlyOnGlobalRollbackOnly, setGlobalRollbackOnParticipationFailure, setNestedTransactionAllowed, setRollbackOnCommitFailure, setTransactionSynchronization, setTransactionSynchronizationName, setValidateExistingTransaction, suspend, triggerBeforeCommit, triggerBeforeCompletion
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.transaction.PlatformTransactionManager
commit, getTransaction, rollback

Field Detail

DEFAULT_UOW_MANAGER_NAME

public static final String DEFAULT_UOW_MANAGER_NAME
Default JNDI location for the WebSphere UOWManager.

See Also:
setUowManagerName(java.lang.String), Constant Field Values
Constructor Detail

WebSphereUowTransactionManager

public WebSphereUowTransactionManager()
Create a new WebSphereUowTransactionManager.

WebSphereUowTransactionManager

public WebSphereUowTransactionManager(com.ibm.wsspi.uow.UOWManager uowManager)
Create a new WebSphereUowTransactionManager for the given UOWManager.

Parameters:
uowManager - the WebSphere UOWManager to use as direct reference
Method Detail

setUowManager

public void setUowManager(com.ibm.wsspi.uow.UOWManager uowManager)
Set the WebSphere UOWManager to use as direct reference.

Typically just used for test setups; in a J2EE environment, the UOWManager will always be fetched from JNDI.

See Also:
JtaTransactionManager.setUserTransactionName(java.lang.String)

setUowManagerName

public void setUowManagerName(String uowManagerName)
Set the JNDI name of the WebSphere UOWManager. The default "java:comp/websphere/UOWManager" is used if not set.

See Also:
JtaTransactionManager.DEFAULT_USER_TRANSACTION_NAME, setUowManager(com.ibm.wsspi.uow.UOWManager)

afterPropertiesSet

public void afterPropertiesSet()
                        throws TransactionSystemException
Description copied from class: JtaTransactionManager
Initialize the UserTransaction as well as the TransactionManager handle.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class JtaTransactionManager
Throws:
TransactionSystemException
See Also:
JtaTransactionManager.initUserTransactionAndTransactionManager()

lookupUowManager

protected com.ibm.wsspi.uow.UOWManager lookupUowManager(String uowManagerName)
                                                 throws TransactionSystemException
Look up the WebSphere UOWManager in JNDI via the configured name.

Parameters:
uowManagerName - the JNDI name of the UOWManager
Returns:
the UOWManager object
Throws:
TransactionSystemException - if the JNDI lookup failed
See Also:
JtaTransactionManager.setJndiTemplate(org.springframework.jndi.JndiTemplate), setUowManagerName(java.lang.String)

lookupDefaultUowManager

protected com.ibm.wsspi.uow.UOWManager lookupDefaultUowManager()
                                                        throws TransactionSystemException
Obtain the WebSphere UOWManager from the default JNDI location "java:comp/websphere/UOWManager".

Returns:
the UOWManager object
Throws:
TransactionSystemException - if the JNDI lookup failed
See Also:
JtaTransactionManager.setJndiTemplate(org.springframework.jndi.JndiTemplate)

doRegisterAfterCompletionWithJtaTransaction

protected void doRegisterAfterCompletionWithJtaTransaction(JtaTransactionObject txObject,
                                                           List<TransactionSynchronization> synchronizations)
Registers the synchronizations as interposed JTA Synchronization on the UOWManager.

Overrides:
doRegisterAfterCompletionWithJtaTransaction in class JtaTransactionManager
Parameters:
txObject - the current transaction object
synchronizations - List of TransactionSynchronization objects
See Also:
JtaTransactionManager.getTransactionManager(),
Transaction.registerSynchronization(javax.transaction.Synchronization),
TransactionSynchronizationRegistry.registerInterposedSynchronization(javax.transaction.Synchronization)

supportsResourceAdapterManagedTransactions

public boolean supportsResourceAdapterManagedTransactions()
Returns true since WebSphere ResourceAdapters (as exposed in JNDI) implicitly perform transaction enlistment if the MessageEndpointFactory's isDeliveryTransacted method returns true. In that case we'll simply skip the JtaTransactionManager.createTransaction(java.lang.String, int) call.

Specified by:
supportsResourceAdapterManagedTransactions in interface TransactionFactory
Overrides:
supportsResourceAdapterManagedTransactions in class JtaTransactionManager
See Also:
MessageEndpointFactory.isDeliveryTransacted(java.lang.reflect.Method), AbstractMessageEndpointFactory, TransactionFactory.createTransaction(java.lang.String, int)

execute

public <T> T execute(TransactionDefinition definition,
                     TransactionCallback<T> callback)
          throws TransactionException
Description copied from interface: CallbackPreferringPlatformTransactionManager
Execute the action specified by the given callback object within a transaction.

Allows for returning a result object created within the transaction, that is, a domain object or a collection of domain objects. A RuntimeException thrown by the callback is treated as a fatal exception that enforces a rollback. Such an exception gets propagated to the caller of the template.

Specified by:
execute in interface CallbackPreferringPlatformTransactionManager
Parameters:
definition - the definition for the transaction to wrap the callback in
callback - the callback object that specifies the transactional action
Returns:
a result object returned by the callback, or null if none
Throws:
TransactionException - in case of initialization, rollback, or system errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.transaction.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.transaction.support

Support classes for the org.springframework.transaction package.

See:
Description

Interface Summary
CallbackPreferringPlatformTransactionManager | Extension of the PlatformTransactionManager interface, exposing a method for executing a given callback within a transaction.
ResourceHolder | Generic interface to be implemented by resource holders.
ResourceTransactionManager | Extension of the PlatformTransactionManager interface, indicating a native resource transaction manager, operating on a single target resource.
SmartTransactionObject | Interface to be implemented by transaction objects that are able to return an internal rollback-only marker, typically from a another transaction that has participated and marked it as rollback-only.
TransactionCallback<T> | Callback interface for transactional code.
TransactionOperations | Interface specifying basic transaction execution operations.
TransactionSynchronization | Interface for transaction synchronization callbacks.

Class Summary
AbstractPlatformTransactionManager | Abstract base class that implements Spring's standard transaction workflow, serving as basis for concrete platform transaction managers like JtaTransactionManager.
AbstractPlatformTransactionManager.SuspendedResourcesHolder | Holder for suspended resources.
AbstractTransactionStatus | Abstract base implementation of the TransactionStatus interface.
DefaultTransactionDefinition | Default implementation of the TransactionDefinition interface, offering bean-style configuration and sensible default values (PROPAGATION_REQUIRED, ISOLATION_DEFAULT, TIMEOUT_DEFAULT, readOnly=false).
DefaultTransactionStatus | Default implementation of the TransactionStatus interface, used by AbstractPlatformTransactionManager.
DelegatingTransactionDefinition | TransactionDefinition implementation that delegates all calls to a given target TransactionDefinition instance.
ResourceHolderSupport | Convenient base class for resource holders.
ResourceHolderSynchronization<H extends ResourceHolder,K> | TransactionSynchronization implementation that manages a ResourceHolder bound through TransactionSynchronizationManager.
SimpleTransactionStatus | A simple TransactionStatus implementation.
TransactionCallbackWithoutResult | Simple convenience class for TransactionCallback implementation.
TransactionSynchronizationAdapter | Simple TransactionSynchronization adapter containing empty method implementations, for easier overriding of single methods.
TransactionSynchronizationManager | Central helper that manages resources and transaction synchronizations per thread.
TransactionSynchronizationUtils | Utility methods for triggering specific TransactionSynchronization callback methods on all currently registered synchronizations.
TransactionTemplate | Template class that simplifies programmatic transaction demarcation and transaction exception handling.

Package org.springframework.transaction.support Description

Support classes for the org.springframework.transaction package. Provides an abstract base class for transaction manager implementations, and a template plus callback for transaction demarcation.


org.springframework.transaction.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.transaction.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.transaction.support.AbstractPlatformTransactionManager (implements org.springframework.transaction.PlatformTransactionManager, java.io.Serializable)
    • org.springframework.transaction.support.AbstractPlatformTransactionManager.SuspendedResourcesHolder
    • org.springframework.transaction.support.AbstractTransactionStatus (implements org.springframework.transaction.TransactionStatus)
      • org.springframework.transaction.support.DefaultTransactionStatus
      • org.springframework.transaction.support.SimpleTransactionStatus
    • org.springframework.transaction.support.DefaultTransactionDefinition (implements java.io.Serializable, org.springframework.transaction.TransactionDefinition)
      • org.springframework.transaction.support.TransactionTemplate (implements org.springframework.beans.factory.InitializingBean, org.springframework.transaction.support.TransactionOperations)
    • org.springframework.transaction.support.DelegatingTransactionDefinition (implements java.io.Serializable, org.springframework.transaction.TransactionDefinition)
    • org.springframework.transaction.support.ResourceHolderSupport (implements org.springframework.transaction.support.ResourceHolder)
    • org.springframework.transaction.support.ResourceHolderSynchronization<H,K> (implements org.springframework.transaction.support.TransactionSynchronization)
    • org.springframework.transaction.support.TransactionCallbackWithoutResult (implements org.springframework.transaction.support.TransactionCallback<T>)
    • org.springframework.transaction.support.TransactionSynchronizationAdapter (implements org.springframework.core.Ordered, org.springframework.transaction.support.TransactionSynchronization)
    • org.springframework.transaction.support.TransactionSynchronizationManager
    • org.springframework.transaction.support.TransactionSynchronizationUtils

Interface Hierarchy

  • org.springframework.transaction.PlatformTransactionManager
    • org.springframework.transaction.support.CallbackPreferringPlatformTransactionManager
    • org.springframework.transaction.support.ResourceTransactionManager
  • org.springframework.transaction.support.ResourceHolder
  • org.springframework.transaction.support.SmartTransactionObject
  • org.springframework.transaction.support.TransactionCallback<T>
  • org.springframework.transaction.support.TransactionOperations
  • org.springframework.transaction.support.TransactionSynchronization


CallbackPreferringPlatformTransactionManager

org.springframework.transaction.support
Interface CallbackPreferringPlatformTransactionManager

All Superinterfaces:
PlatformTransactionManager
All Known Implementing Classes:
WebSphereUowTransactionManager
public interface CallbackPreferringPlatformTransactionManager
extends PlatformTransactionManager

Extension of the PlatformTransactionManager interface, exposing a method for executing a given callback within a transaction.

Implementors of this interface automatically express a preference for callbacks over programmatic getTransaction, commit and rollback calls. Calling code may check whether a given transaction manager implements this interface to choose to prepare a callback instead of explicit transaction demarcation control.

Spring's TransactionTemplate and TransactionInterceptor detect and use this PlatformTransactionManager variant automatically.

Since:
2.0
Author:
Juergen Hoeller
See Also:
TransactionTemplate, TransactionInterceptor

Method Summary
<T> T
execute(TransactionDefinition definition, TransactionCallback<T> callback)
Execute the action specified by the given callback object within a transaction.
Methods inherited from interface org.springframework.transaction.PlatformTransactionManager
commit, getTransaction, rollback

Method Detail

execute

<T> T execute(TransactionDefinition definition,
              TransactionCallback<T> callback)
          throws TransactionException
Execute the action specified by the given callback object within a transaction.

Allows for returning a result object created within the transaction, that is, a domain object or a collection of domain objects. A RuntimeException thrown by the callback is treated as a fatal exception that enforces a rollback. Such an exception gets propagated to the caller of the template.

Parameters:
definition - the definition for the transaction to wrap the callback in
callback - the callback object that specifies the transactional action
Returns:
a result object returned by the callback, or null if none
Throws:
TransactionException - in case of initialization, rollback, or system errors
RuntimeException - if thrown by the TransactionCallback
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResourceHolder

org.springframework.transaction.support
Interface ResourceHolder

All Known Implementing Classes:
ConnectionHolder, ConnectionHolder, EntityManagerHolder, JmsResourceHolder, PersistenceManagerHolder, ResourceHolderSupport, SessionHolder
public interface ResourceHolder

Generic interface to be implemented by resource holders. Allows Spring's transaction infrastructure to introspect and reset the holder when necessary.

Since:
2.5.5
Author:
Juergen Hoeller
See Also:
ResourceHolderSupport, ResourceHolderSynchronization

Method Summary
boolean | isVoid() Determine whether this holder is considere as 'void', i.e.
void | reset() Reset the transactional state of this holder.
void | unbound() Notify this holder that it has been unbound from transaction synchronization.

Method Detail

reset

void reset()
Reset the transactional state of this holder.

unbound

void unbound()
Notify this holder that it has been unbound from transaction synchronization.

isVoid

boolean isVoid()
Determine whether this holder is considere as 'void', i.e. as a leftover from a previous thread.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResourceTransactionManager

org.springframework.transaction.support
Interface ResourceTransactionManager

All Superinterfaces:
PlatformTransactionManager
All Known Implementing Classes:
CciLocalTransactionManager, DataSourceTransactionManager, HibernateTransactionManager, JdoTransactionManager, JmsTransactionManager, JmsTransactionManager102, JpaTransactionManager
public interface ResourceTransactionManager
extends PlatformTransactionManager

Extension of the PlatformTransactionManager interface, indicating a native resource transaction manager, operating on a single target resource. Such transaction managers differ from JTA transaction managers in that they do not use XA transaction enlistment for an open number of resources but rather focus on leveraging the native power and simplicity of a single target resource.

This interface is mainly used for abstract introspection of a transaction manager, giving clients a hint on what kind of transaction manager they have been given and on what concrete resource the transaction manager is operating on.

Since:
2.0.4
Author:
Juergen Hoeller
See Also:
TransactionSynchronizationManager

Method Summary
 Object getResourceFactory()
Return the resource factory that this transaction manager operates on, e.g.
Methods inherited from interface org.springframework.transaction.PlatformTransactionManager
commit, getTransaction, rollback

Method Detail

getResourceFactory

Object getResourceFactory()
Return the resource factory that this transaction manager operates on, e.g. a JDBC DataSource or a JMS ConnectionFactory.

This target resource factory is usually used as resource key for TransactionSynchronizationManager's resource bindings per thread.

Returns:
the target resource factory (never null)
See Also:
TransactionSynchronizationManager.bindResource(java.lang.Object, java.lang.Object), TransactionSynchronizationManager.getResource(java.lang.Object)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SmartTransactionObject

org.springframework.transaction.support
Interface SmartTransactionObject

All Known Implementing Classes:
JdbcTransactionObjectSupport, JtaTransactionObject
public interface SmartTransactionObject

Interface to be implemented by transaction objects that are able to return an internal rollback-only marker, typically from a another transaction that has participated and marked it as rollback-only.

Autodetected by DefaultTransactionStatus, to always return a current rollbackOnly flag even if not resulting from the current TransactionStatus.

Since:
1.1
Author:
Juergen Hoeller
See Also:
AbstractTransactionStatus.isRollbackOnly()

Method Summary
void | flush() Flush the underlying sessions to the datastore, if applicable: for example, all affected Hibernate/JPA sessions.
boolean | isRollbackOnly() Return whether the transaction is internally marked as rollback-only.

Method Detail

isRollbackOnly

boolean isRollbackOnly()
Return whether the transaction is internally marked as rollback-only. Can, for example, check the JTA UserTransaction.

See Also:
UserTransaction.getStatus(), Status.STATUS_MARKED_ROLLBACK

flush

void flush()
Flush the underlying sessions to the datastore, if applicable: for example, all affected Hibernate/JPA sessions.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionCallback

org.springframework.transaction.support
Interface TransactionCallback<T>

All Known Implementing Classes:
TransactionCallbackWithoutResult
public interface TransactionCallback<T>

Callback interface for transactional code. Used with TransactionTemplate's execute method, often as anonymous class within a method implementation.

Typically used to assemble various calls to transaction-unaware data access services into a higher-level service method with transaction demarcation. As an alternative, consider the use of declarative transaction demarcation (e.g. through Spring's Transactional annotation).

Since:
17.03.2003
Author:
Juergen Hoeller
See Also:
TransactionTemplate, CallbackPreferringPlatformTransactionManager

Method Summary
 T doInTransaction(TransactionStatus status)
Gets called by TransactionTemplate.execute(org.springframework.transaction.support.TransactionCallback) within a transactional context.

Method Detail

doInTransaction

T doInTransaction(TransactionStatus status)
Gets called by TransactionTemplate.execute(org.springframework.transaction.support.TransactionCallback) within a transactional context. Does not need to care about transactions itself, although it can retrieve and influence the status of the current transaction via the given status object, e.g. setting rollback-only.

Allows for returning a result object created within the transaction, i.e. a domain object or a collection of domain objects. A RuntimeException thrown by the callback is treated as application exception that enforces a rollback. An exception gets propagated to the caller of the template.

Parameters:
status - associated transaction status
Returns:
a result object, or null
See Also:
TransactionTemplate.execute(org.springframework.transaction.support.TransactionCallback), CallbackPreferringPlatformTransactionManager.execute(org.springframework.transaction.TransactionDefinition, org.springframework.transaction.support.TransactionCallback)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionOperations

org.springframework.transaction.support
Interface TransactionOperations

All Known Implementing Classes:
TransactionTemplate
public interface TransactionOperations

Interface specifying basic transaction execution operations. Implemented by TransactionTemplate. Not often used directly, but a useful option to enhance testability, as it can easily be mocked or stubbed.

Since:
2.0.4
Author:
Juergen Hoeller

Method Summary
<T> T
execute(TransactionCallback<T> action)
Execute the action specified by the given callback object within a transaction.

Method Detail

execute

<T> T execute(TransactionCallback<T> action)
          throws TransactionException
Execute the action specified by the given callback object within a transaction.

Allows for returning a result object created within the transaction, that is, a domain object or a collection of domain objects. A RuntimeException thrown by the callback is treated as a fatal exception that enforces a rollback. Such an exception gets propagated to the caller of the template.

Parameters:
action - the callback object that specifies the transactional action
Returns:
a result object returned by the callback, or null if none
Throws:
TransactionException - in case of initialization, rollback, or system errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionSynchronization

org.springframework.transaction.support
Interface TransactionSynchronization

All Known Implementing Classes:
ResourceHolderSynchronization, SpringLobCreatorSynchronization, TransactionSynchronizationAdapter
public interface TransactionSynchronization

Interface for transaction synchronization callbacks. Supported by AbstractPlatformTransactionManager.

TransactionSynchronization implementations can implement the Ordered interface to influence their execution order. A synchronization that does not implement the Ordered interface is appended to the end of the synchronization chain.

System synchronizations performed by Spring itself use specific order values, allowing for fine-grained interaction with their execution order (if necessary).

Since:
02.06.2003
Author:
Juergen Hoeller
See Also:
TransactionSynchronizationManager, AbstractPlatformTransactionManager, DataSourceUtils.CONNECTION_SYNCHRONIZATION_ORDER, SessionFactoryUtils.SESSION_SYNCHRONIZATION_ORDER

Field Summary
static int | STATUS_COMMITTED Completion status in case of proper commit
static int | STATUS_ROLLED_BACK Completion status in case of proper rollback
static int | STATUS_UNKNOWN Completion status in case of heuristic mixed completion or system errors
Method Summary
void | afterCommit() Invoked after transaction commit.
void | afterCompletion(int status) Invoked after transaction commit/rollback.
void | beforeCommit(boolean readOnly) Invoked before transaction commit (before "beforeCompletion").
void | beforeCompletion() Invoked before transaction commit/rollback.
void | flush() Flush the underlying session to the datastore, if applicable: for example, a Hibernate/JPA session.
void | resume() Resume this synchronization.
void | suspend() Suspend this synchronization.

Field Detail

STATUS_COMMITTED

static final int STATUS_COMMITTED
Completion status in case of proper commit

See Also:
Constant Field Values

STATUS_ROLLED_BACK

static final int STATUS_ROLLED_BACK
Completion status in case of proper rollback

See Also:
Constant Field Values

STATUS_UNKNOWN

static final int STATUS_UNKNOWN
Completion status in case of heuristic mixed completion or system errors

See Also:
Constant Field Values
Method Detail

suspend

void suspend()
Suspend this synchronization. Supposed to unbind resources from TransactionSynchronizationManager if managing any.

See Also:
TransactionSynchronizationManager.unbindResource(java.lang.Object)

resume

void resume()
Resume this synchronization. Supposed to rebind resources to TransactionSynchronizationManager if managing any.

See Also:
TransactionSynchronizationManager.bindResource(java.lang.Object, java.lang.Object)

flush

void flush()
Flush the underlying session to the datastore, if applicable: for example, a Hibernate/JPA session.

See Also:
TransactionStatus.flush()

beforeCommit

void beforeCommit(boolean readOnly)
Invoked before transaction commit (before "beforeCompletion"). Can e.g. flush transactional O/R Mapping sessions to the database.

This callback does not mean that the transaction will actually be committed. A rollback decision can still occur after this method has been called. This callback is rather meant to perform work that's only relevant if a commit still has a chance to happen, such as flushing SQL statements to the database.

Note that exceptions will get propagated to the commit caller and cause a rollback of the transaction.

Parameters:
readOnly - whether the transaction is defined as read-only transaction
Throws:
RuntimeException - in case of errors; will be propagated to the caller (note: do not throw TransactionException subclasses here!)
See Also:
beforeCompletion()

beforeCompletion

void beforeCompletion()
Invoked before transaction commit/rollback. Can perform resource cleanup before transaction completion.

This method will be invoked after beforeCommit, even when beforeCommit threw an exception. This callback allows for closing resources before transaction completion, for any outcome.

Throws:
RuntimeException - in case of errors; will be logged but not propagated (note: do not throw TransactionException subclasses here!)
See Also:
beforeCommit(boolean), afterCompletion(int)

afterCommit

void afterCommit()
Invoked after transaction commit. Can perform further operations right after the main transaction has successfully committed.

Can e.g. commit further operations that are supposed to follow on a successful commit of the main transaction, like confirmation messages or emails.

NOTE: The transaction will have been committed already, but the transactional resources might still be active and accessible. As a consequence, any data access code triggered at this point will still "participate" in the original transaction, allowing to perform some cleanup (with no commit following anymore!), unless it explicitly declares that it needs to run in a separate transaction. Hence: Use PROPAGATION_REQUIRES_NEW for any transactional operation that is called from here.

Throws:
RuntimeException - in case of errors; will be propagated to the caller (note: do not throw TransactionException subclasses here!)

afterCompletion

void afterCompletion(int status)
Invoked after transaction commit/rollback. Can perform resource cleanup after transaction completion.

NOTE: The transaction will have been committed or rolled back already, but the transactional resources might still be active and accessible. As a consequence, any data access code triggered at this point will still "participate" in the original transaction, allowing to perform some cleanup (with no commit following anymore!), unless it explicitly declares that it needs to run in a separate transaction. Hence: Use PROPAGATION_REQUIRES_NEW for any transactional operation that is called from here.

Parameters:
status - completion status according to the STATUS_* constants
Throws:
RuntimeException - in case of errors; will be logged but not propagated (note: do not throw TransactionException subclasses here!)
See Also:
STATUS_COMMITTED, STATUS_ROLLED_BACK, STATUS_UNKNOWN, beforeCompletion()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractPlatformTransactionManager

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.transaction.support
Class AbstractPlatformTransactionManager

java.lang.Object
    extended by  org.springframework.transaction.support.AbstractPlatformTransactionManager
All Implemented Interfaces:
Serializable, PlatformTransactionManager
Direct Known Subclasses:
CciLocalTransactionManager, DataSourceTransactionManager, HibernateTransactionManager, JdoTransactionManager, JmsTransactionManager, JpaTransactionManager, JtaTransactionManager
public abstract class AbstractPlatformTransactionManager
extends Object
implements PlatformTransactionManager, Serializable

Abstract base class that implements Spring's standard transaction workflow, serving as basis for concrete platform transaction managers like JtaTransactionManager.

This base class provides the following workflow handling:

  • determines if there is an existing transaction;
  • applies the appropriate propagation behavior;
  • suspends and resumes transactions if necessary;
  • checks the rollback-only flag on commit;
  • applies the appropriate modification on rollback (actual rollback or setting rollback-only);
  • triggers registered synchronization callbacks (if transaction synchronization is active).

Subclasses have to implement specific template methods for specific states of a transaction, e.g.: begin, suspend, resume, commit, rollback. The most important of them are abstract and must be provided by a concrete implementation; for the rest, defaults are provided, so overriding is optional.

Transaction synchronization is a generic mechanism for registering callbacks that get invoked at transaction completion time. This is mainly used internally by the data access support classes for JDBC, Hibernate, JPA, etc when running within a JTA transaction: They register resources that are opened within the transaction for closing at transaction completion time, allowing e.g. for reuse of the same Hibernate Session within the transaction. The same mechanism can also be leveraged for custom synchronization needs in an application.

The state of this class is serializable, to allow for serializing the transaction strategy along with proxies that carry a transaction interceptor. It is up to subclasses if they wish to make their state to be serializable too. They should implement the java.io.Serializable marker interface in that case, and potentially a private readObject() method (according to Java serialization rules) if they need to restore any transient state.

Since:
28.03.2003
Author:
Juergen Hoeller
See Also:
setTransactionSynchronization(int), TransactionSynchronizationManager, JtaTransactionManager, Serialized Form

Nested Class Summary
protected static class AbstractPlatformTransactionManager.SuspendedResourcesHolder
Holder for suspended resources.
Field Summary
protected Log | logger
static int | SYNCHRONIZATION_ALWAYS Always activate transaction synchronization, even for "empty" transactions that result from PROPAGATION_SUPPORTS with no existing backend transaction.
static int | SYNCHRONIZATION_NEVER Never active transaction synchronization, not even for actual transactions.
static int | SYNCHRONIZATION_ON_ACTUAL_TRANSACTION Activate transaction synchronization only for actual transactions, that is, not for empty ones that result from PROPAGATION_SUPPORTS with no existing backend transaction.
Constructor Summary
AbstractPlatformTransactionManager()
Method Summary
void | commit(TransactionStatus status) This implementation of commit handles participating in existing transactions and programmatic rollback requests.
protected int | determineTimeout(TransactionDefinition definition) Determine the actual timeout to use for the given definition.
protected abstract void | doBegin(Object transaction, TransactionDefinition definition) Begin a new transaction with semantics according to the given transaction definition.
protected void | doCleanupAfterCompletion(Object transaction) Cleanup resources after transaction completion.
protected abstract void | doCommit(DefaultTransactionStatus status) Perform an actual commit of the given transaction.
protected abstract Object | doGetTransaction() Return a transaction object for the current transaction state.
protected void | doResume(Object transaction, Object suspendedResources) Resume the resources of the current transaction.
protected abstract void | doRollback(DefaultTransactionStatus status) Perform an actual rollback of the given transaction.
protected void | doSetRollbackOnly(DefaultTransactionStatus status) Set the given transaction rollback-only.
protected Object | doSuspend(Object transaction) Suspend the resources of the current transaction.
int | getDefaultTimeout() Return the default timeout that this transaction manager should apply if there is no timeout specified at the transaction level, in seconds.
TransactionStatus | getTransaction(TransactionDefinition definition) This implementation handles propagation behavior.
int | getTransactionSynchronization() Return if this transaction manager should activate the thread-bound transaction synchronization support.
protected void | invokeAfterCompletion(List<TransactionSynchronization> synchronizations, int completionStatus) Actually invoke the afterCompletion methods of the given Spring TransactionSynchronization objects.
protected boolean | isExistingTransaction(Object transaction) Check if the given transaction object indicates an existing transaction (that is, a transaction which has already started).
boolean | isFailEarlyOnGlobalRollbackOnly() Return whether to fail early in case of the transaction being globally marked as rollback-only.
boolean | isGlobalRollbackOnParticipationFailure() Return whether to globally mark an existing transaction as rollback-only after a participating transaction failed.
boolean | isNestedTransactionAllowed() Return whether nested transactions are allowed.
boolean | isRollbackOnCommitFailure() Return whether doRollback should be performed on failure of the doCommit call.
boolean | isValidateExistingTransaction() Return whether existing transactions should be validated before participating in them.
protected DefaultTransactionStatus | newTransactionStatus(TransactionDefinition definition, Object transaction, boolean newTransaction, boolean newSynchronization, boolean debug, Object suspendedResources) Create a rae TransactionStatus instance for the given arguments.
protected void | prepareForCommit(DefaultTransactionStatus status) Make preparations for commit, to be performed before the beforeCommit synchronization callbacks occur.
protected void | prepareSynchronization(DefaultTransactionStatus status, TransactionDefinition definition) Initialize transaction synchronization as appropriate.
protected DefaultTransactionStatus | prepareTransactionStatus(TransactionDefinition definition, Object transaction, boolean newTransaction, boolean newSynchronization, boolean debug, Object suspendedResources) Create a new TransactionStatus for the given arguments, also initializing transaction synchronization as appropriate.
protected void | registerAfterCompletionWithExistingTransaction(Object transaction, List<TransactionSynchronization> synchronizations) Register the given list of transaction synchronizations with the existing transaction.
protected void | resume(Object transaction, AbstractPlatformTransactionManager.SuspendedResourcesHolder resourcesHolder) Resume the given transaction.
void | rollback(TransactionStatus status) This implementation of rollback handles participating in existing transactions.
void | setDefaultTimeout(int defaultTimeout) Specify the default timeout that this transaction manager should apply if there is no timeout specified at the transaction level, in seconds.
void | setFailEarlyOnGlobalRollbackOnly(boolean failEarlyOnGlobalRollbackOnly) Set whether to fail early in case of the transaction being globally marked as rollback-only.
void | setGlobalRollbackOnParticipationFailure(boolean globalRollbackOnParticipationFailure) Set whether to globally mark an existing transaction as rollback-only after a participating transaction failed.
void | setNestedTransactionAllowed(boolean nestedTransactionAllowed) Set whether nested transactions are allowed.
void | setRollbackOnCommitFailure(boolean rollbackOnCommitFailure) Set whether doRollback should be performed on failure of the doCommit call.
void | setTransactionSynchronization(int transactionSynchronization) Set when this transaction manager should activate the thread-bound transaction synchronization support.
void | setTransactionSynchronizationName(String constantName) Set the transaction synchronization by the name of the corresponding constant in this class, e.g.
void | setValidateExistingTransaction(boolean validateExistingTransaction) Set whether existing transactions should be validated before participating in them.
protected boolean | shouldCommitOnGlobalRollbackOnly() Return whether to call doCommit on a transaction that has been marked as rollback-only in a global fashion.
protected AbstractPlatformTransactionManager.SuspendedResourcesHolder | suspend(Object transaction) Suspend the given transaction.
protected void | triggerBeforeCommit(DefaultTransactionStatus status) Trigger beforeCommit callbacks.
protected void | triggerBeforeCompletion(DefaultTransactionStatus status) Trigger beforeCompletion callbacks.
protected boolean | useSavepointForNestedTransaction() Return whether to use a savepoint for a nested transaction.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

SYNCHRONIZATION_ALWAYS

public static final int SYNCHRONIZATION_ALWAYS
Always activate transaction synchronization, even for "empty" transactions that result from PROPAGATION_SUPPORTS with no existing backend transaction.

See Also:
TransactionDefinition.PROPAGATION_SUPPORTS, TransactionDefinition.PROPAGATION_NOT_SUPPORTED, TransactionDefinition.PROPAGATION_NEVER, Constant Field Values

SYNCHRONIZATION_ON_ACTUAL_TRANSACTION

public static final int SYNCHRONIZATION_ON_ACTUAL_TRANSACTION
Activate transaction synchronization only for actual transactions, that is, not for empty ones that result from PROPAGATION_SUPPORTS with no existing backend transaction.

See Also:
TransactionDefinition.PROPAGATION_REQUIRED, TransactionDefinition.PROPAGATION_MANDATORY, TransactionDefinition.PROPAGATION_REQUIRES_NEW, Constant Field Values

SYNCHRONIZATION_NEVER

public static final int SYNCHRONIZATION_NEVER
Never active transaction synchronization, not even for actual transactions.

See Also:
Constant Field Values

logger

protected transient Log logger
Constructor Detail

AbstractPlatformTransactionManager

public AbstractPlatformTransactionManager()
Method Detail

setTransactionSynchronizationName

public final void setTransactionSynchronizationName(String constantName)
Set the transaction synchronization by the name of the corresponding constant in this class, e.g. "SYNCHRONIZATION_ALWAYS".

Parameters:
constantName - name of the constant
See Also:
SYNCHRONIZATION_ALWAYS

setTransactionSynchronization

public final void setTransactionSynchronization(int transactionSynchronization)
Set when this transaction manager should activate the thread-bound transaction synchronization support. Default is "always".

Note that transaction synchronization isn't supported for multiple concurrent transactions by different transaction managers. Only one transaction manager is allowed to activate it at any time.

See Also:
SYNCHRONIZATION_ALWAYS, SYNCHRONIZATION_ON_ACTUAL_TRANSACTION, SYNCHRONIZATION_NEVER, TransactionSynchronizationManager, TransactionSynchronization

getTransactionSynchronization

public final int getTransactionSynchronization()
Return if this transaction manager should activate the thread-bound transaction synchronization support.

setDefaultTimeout

public final void setDefaultTimeout(int defaultTimeout)
Specify the default timeout that this transaction manager should apply if there is no timeout specified at the transaction level, in seconds.

Default is the underlying transaction infrastructure's default timeout, e.g. typically 30 seconds in case of a JTA provider, indicated by the TransactionDefinition.TIMEOUT_DEFAULT value.

See Also:
TransactionDefinition.TIMEOUT_DEFAULT

getDefaultTimeout

public final int getDefaultTimeout()
Return the default timeout that this transaction manager should apply if there is no timeout specified at the transaction level, in seconds.

Returns TransactionDefinition.TIMEOUT_DEFAULT to indicate the underlying transaction infrastructure's default timeout.

setNestedTransactionAllowed

public final void setNestedTransactionAllowed(boolean nestedTransactionAllowed)
Set whether nested transactions are allowed. Default is "false".

Typically initialized with an appropriate default by the concrete transaction manager subclass.

isNestedTransactionAllowed

public final boolean isNestedTransactionAllowed()
Return whether nested transactions are allowed.

setValidateExistingTransaction

public final void setValidateExistingTransaction(boolean validateExistingTransaction)
Set whether existing transactions should be validated before participating in them.

When participating in an existing transaction (e.g. with PROPAGATION_REQUIRES or PROPAGATION_SUPPORTS encountering an existing transaction), this outer transaction's characteristics will apply even to the inner transaction scope. Validation will detect incompatible isolation level and read-only settings on the inner transaction definition and reject participation accordingly through throwing a corresponding exception.

Default is "false", leniently ignoring inner transaction settings, simply overriding them with the outer transaction's characteristics. Switch this flag to "true" in order to enforce strict validation.

isValidateExistingTransaction

public final boolean isValidateExistingTransaction()
Return whether existing transactions should be validated before participating in them.

setGlobalRollbackOnParticipationFailure

public final void setGlobalRollbackOnParticipationFailure(boolean globalRollbackOnParticipationFailure)
Set whether to globally mark an existing transaction as rollback-only after a participating transaction failed.

Default is "true": If a participating transaction (e.g. with PROPAGATION_REQUIRES or PROPAGATION_SUPPORTS encountering an existing transaction) fails, the transaction will be globally marked as rollback-only. The only possible outcome of such a transaction is a rollback: The transaction originator cannot make the transaction commit anymore.

Switch this to "false" to let the transaction originator make the rollback decision. If a participating transaction fails with an exception, the caller can still decide to continue with a different path within the transaction. However, note that this will only work as long as all participating resources are capable of continuing towards a transaction commit even after a data access failure: This is generally not the case for a Hibernate Session, for example; neither is it for a sequence of JDBC insert/update/delete operations.

Note:This flag only applies to an explicit rollback attempt for a subtransaction, typically caused by an exception thrown by a data access operation (where TransactionInterceptor will trigger a PlatformTransactionManager.rollback() call according to a rollback rule). If the flag is off, the caller can handle the exception and decide on a rollback, independent of the rollback rules of the subtransaction. This flag does, however, not apply to explicit setRollbackOnly calls on a TransactionStatus, which will always cause an eventual global rollback (as it might not throw an exception after the rollback-only call).

The recommended solution for handling failure of a subtransaction is a "nested transaction", where the global transaction can be rolled back to a savepoint taken at the beginning of the subtransaction. PROPAGATION_NESTED provides exactly those semantics; however, it will only work when nested transaction support is available. This is the case with DataSourceTransactionManager, but not with JtaTransactionManager.

See Also:
setNestedTransactionAllowed(boolean), JtaTransactionManager

isGlobalRollbackOnParticipationFailure

public final boolean isGlobalRollbackOnParticipationFailure()
Return whether to globally mark an existing transaction as rollback-only after a participating transaction failed.

setFailEarlyOnGlobalRollbackOnly

public final void setFailEarlyOnGlobalRollbackOnly(boolean failEarlyOnGlobalRollbackOnly)
Set whether to fail early in case of the transaction being globally marked as rollback-only.

Default is "false", only causing an UnexpectedRollbackException at the outermost transaction boundary. Switch this flag on to cause an UnexpectedRollbackException as early as the global rollback-only marker has been first detected, even from within an inner transaction boundary.

Note that, as of Spring 2.0, the fail-early behavior for global rollback-only markers has been unified: All transaction managers will by default only cause UnexpectedRollbackException at the outermost transaction boundary. This allows, for example, to continue unit tests even after an operation failed and the transaction will never be completed. All transaction managers will only fail earlier if this flag has explicitly been set to "true".

See Also:
UnexpectedRollbackException

isFailEarlyOnGlobalRollbackOnly

public final boolean isFailEarlyOnGlobalRollbackOnly()
Return whether to fail early in case of the transaction being globally marked as rollback-only.

setRollbackOnCommitFailure

public final void setRollbackOnCommitFailure(boolean rollbackOnCommitFailure)
Set whether doRollback should be performed on failure of the doCommit call. Typically not necessary and thus to be avoided, as it can potentially override the commit exception with a subsequent rollback exception.

Default is "false".

See Also:
doCommit(org.springframework.transaction.support.DefaultTransactionStatus), doRollback(org.springframework.transaction.support.DefaultTransactionStatus)

isRollbackOnCommitFailure

public final boolean isRollbackOnCommitFailure()
Return whether doRollback should be performed on failure of the doCommit call.

getTransaction

public final TransactionStatus getTransaction(TransactionDefinition definition)
                                       throws TransactionException
This implementation handles propagation behavior. Delegates to doGetTransaction, isExistingTransaction and doBegin.

Specified by:
getTransaction in interface PlatformTransactionManager
Parameters:
definition - TransactionDefinition instance (can be null for defaults), describing propagation behavior, isolation level, timeout etc.
Returns:
transaction status object representing the new or current transaction
Throws:
TransactionException - in case of lookup, creation, or system errors
IllegalTransactionStateException - if the given transaction definition cannot be executed (for example, if a currently active transaction is in conflict with the specified propagation behavior)
See Also:
doGetTransaction(),
isExistingTransaction(java.lang.Object),
doBegin(java.lang.Object, org.springframework.transaction.TransactionDefinition)

prepareTransactionStatus

protected final DefaultTransactionStatus prepareTransactionStatus(TransactionDefinition definition,
                                                                  Object transaction,
                                                                  boolean newTransaction,
                                                                  boolean newSynchronization,
                                                                  boolean debug,
                                                                  Object suspendedResources)
Create a new TransactionStatus for the given arguments, also initializing transaction synchronization as appropriate.

See Also:
newTransactionStatus(org.springframework.transaction.TransactionDefinition, java.lang.Object, boolean, boolean, boolean, java.lang.Object), prepareTransactionStatus(org.springframework.transaction.TransactionDefinition, java.lang.Object, boolean, boolean, boolean, java.lang.Object)

newTransactionStatus

protected DefaultTransactionStatus newTransactionStatus(TransactionDefinition definition,
                                                        Object transaction,
                                                        boolean newTransaction,
                                                        boolean newSynchronization,
                                                        boolean debug,
                                                        Object suspendedResources)
Create a rae TransactionStatus instance for the given arguments.

prepareSynchronization

protected void prepareSynchronization(DefaultTransactionStatus status,
                                      TransactionDefinition definition)
Initialize transaction synchronization as appropriate.

determineTimeout

protected int determineTimeout(TransactionDefinition definition)
Determine the actual timeout to use for the given definition. Will fall back to this manager's default timeout if the transaction definition doesn't specify a non-default value.

Parameters:
definition - the transaction definition
Returns:
the actual timeout to use
See Also:
TransactionDefinition.getTimeout(), setDefaultTimeout(int)

suspend

protected final AbstractPlatformTransactionManager.SuspendedResourcesHolder suspend(Object transaction)
                                                                             throws TransactionException
Suspend the given transaction. Suspends transaction synchronization first, then delegates to the doSuspend template method.

Parameters:
transaction - the current transaction object (or null to just suspend active synchronizations, if any)
Returns:
an object that holds suspended resources (or null if neither transaction nor synchronization active)
Throws:
TransactionException
See Also:
doSuspend(java.lang.Object), resume(java.lang.Object, org.springframework.transaction.support.AbstractPlatformTransactionManager.SuspendedResourcesHolder)

resume

protected final void resume(Object transaction,
                            AbstractPlatformTransactionManager.SuspendedResourcesHolder resourcesHolder)
                     throws TransactionException
Resume the given transaction. Delegates to the doResume template method first, then resuming transaction synchronization.

Parameters:
transaction - the current transaction object
resourcesHolder - the object that holds suspended resources, as returned by suspend (or null to just resume synchronizations, if any)
Throws:
TransactionException
See Also:
doResume(java.lang.Object, java.lang.Object), suspend(java.lang.Object)

commit

public final void commit(TransactionStatus status)
                  throws TransactionException
This implementation of commit handles participating in existing transactions and programmatic rollback requests. Delegates to isRollbackOnly, doCommit and rollback.

Specified by:
commit in interface PlatformTransactionManager
Parameters:
status - object returned by the getTransaction method
Throws:
UnexpectedRollbackException - in case of an unexpected rollback that the transaction coordinator initiated
HeuristicCompletionException - in case of a transaction failure caused by a heuristic decision on the side of the transaction coordinator
TransactionSystemException - in case of commit or system errors (typically caused by fundamental resource failures)
IllegalTransactionStateException - if the given transaction is already completed (that is, committed or rolled back)
TransactionException
See Also:
TransactionStatus.isRollbackOnly(),
doCommit(org.springframework.transaction.support.DefaultTransactionStatus),
rollback(org.springframework.transaction.TransactionStatus)

rollback

public final void rollback(TransactionStatus status)
                    throws TransactionException
This implementation of rollback handles participating in existing transactions. Delegates to doRollback and doSetRollbackOnly.

Specified by:
rollback in interface PlatformTransactionManager
Parameters:
status - object returned by the getTransaction method
Throws:
TransactionSystemException - in case of rollback or system errors (typically caused by fundamental resource failures)
IllegalTransactionStateException - if the given transaction is already completed (that is, committed or rolled back)
TransactionException
See Also:
doRollback(org.springframework.transaction.support.DefaultTransactionStatus), doSetRollbackOnly(org.springframework.transaction.support.DefaultTransactionStatus)

triggerBeforeCommit

protected final void triggerBeforeCommit(DefaultTransactionStatus status)
Trigger beforeCommit callbacks.

Parameters:
status - object representing the transaction

triggerBeforeCompletion

protected final void triggerBeforeCompletion(DefaultTransactionStatus status)
Trigger beforeCompletion callbacks.

Parameters:
status - object representing the transaction

invokeAfterCompletion

protected final void invokeAfterCompletion(List<TransactionSynchronization> synchronizations,
                                           int completionStatus)
Actually invoke the afterCompletion methods of the given Spring TransactionSynchronization objects.

To be called by this abstract manager itself, or by special implementations of the registerAfterCompletionWithExistingTransaction callback.

Parameters:
synchronizations - List of TransactionSynchronization objects
completionStatus - the completion status according to the constants in the TransactionSynchronization interface
See Also:
registerAfterCompletionWithExistingTransaction(Object, java.util.List), TransactionSynchronization.STATUS_COMMITTED, TransactionSynchronization.STATUS_ROLLED_BACK, TransactionSynchronization.STATUS_UNKNOWN

doGetTransaction

protected abstract Object doGetTransaction()
                                    throws TransactionException
Return a transaction object for the current transaction state.

The returned object will usually be specific to the concrete transaction manager implementation, carrying corresponding transaction state in a modifiable fashion. This object will be passed into the other template methods (e.g. doBegin and doCommit), either directly or as part of a DefaultTransactionStatus instance.

The returned object should contain information about any existing transaction, that is, a transaction that has already started before the current getTransaction call on the transaction manager. Consequently, a doGetTransaction implementation will usually look for an existing transaction and store corresponding state in the returned transaction object.

Returns:
the current transaction object
Throws:
CannotCreateTransactionException - if transaction support is not available
TransactionException - in case of lookup or system errors
See Also:
doBegin(java.lang.Object, org.springframework.transaction.TransactionDefinition),
doCommit(org.springframework.transaction.support.DefaultTransactionStatus),
doRollback(org.springframework.transaction.support.DefaultTransactionStatus),
DefaultTransactionStatus.getTransaction()

isExistingTransaction

protected boolean isExistingTransaction(Object transaction)
                                 throws TransactionException
Check if the given transaction object indicates an existing transaction (that is, a transaction which has already started).

The result will be evaluated according to the specified propagation behavior for the new transaction. An existing transaction might get suspended (in case of PROPAGATION_REQUIRES_NEW), or the new transaction might participate in the existing one (in case of PROPAGATION_REQUIRED).

The default implementation returns false, assuming that participating in existing transactions is generally not supported. Subclasses are of course encouraged to provide such support.

Parameters:
transaction - transaction object returned by doGetTransaction
Returns:
if there is an existing transaction
Throws:
TransactionException - in case of system errors
See Also:
doGetTransaction()

useSavepointForNestedTransaction

protected boolean useSavepointForNestedTransaction()
Return whether to use a savepoint for a nested transaction.

Default is true, which causes delegation to DefaultTransactionStatus for creating and holding a savepoint. If the transaction object does not implement the SavepointManager interface, a NestedTransactionNotSupportedException will be thrown. Else, the SavepointManager will be asked to create a new savepoint to demarcate the start of the nested transaction.

Subclasses can override this to return false, causing a further call to doBegin - within the context of an already existing transaction. The doBegin implementation needs to handle this accordingly in such a scenario. This is appropriate for JTA, for example.

See Also:
AbstractTransactionStatus.createAndHoldSavepoint(),
AbstractTransactionStatus.rollbackToHeldSavepoint(),
AbstractTransactionStatus.releaseHeldSavepoint(),
doBegin(java.lang.Object, org.springframework.transaction.TransactionDefinition)

doBegin

protected abstract void doBegin(Object transaction,
                                TransactionDefinition definition)
                         throws TransactionException
Begin a new transaction with semantics according to the given transaction definition. Does not have to care about applying the propagation behavior, as this has already been handled by this abstract manager.

This method gets called when the transaction manager has decided to actually start a new transaction. Either there wasn't any transaction before, or the previous transaction has been suspended.

A special scenario is a nested transaction without savepoint: If useSavepointForNestedTransaction() returns "false", this method will be called to start a nested transaction when necessary. In such a context, there will be an active transaction: The implementation of this method has to detect this and start an appropriate nested transaction.

Parameters:
transaction - transaction object returned by doGetTransaction
definition - TransactionDefinition instance, describing propagation behavior, isolation level, read-only flag, timeout, and transaction name
Throws:
TransactionException - in case of creation or system errors

doSuspend

protected Object doSuspend(Object transaction)
                    throws TransactionException
Suspend the resources of the current transaction. Transaction synchronization will already have been suspended.

The default implementation throws a TransactionSuspensionNotSupportedException, assuming that transaction suspension is generally not supported.

Parameters:
transaction - transaction object returned by doGetTransaction
Returns:
an object that holds suspended resources (will be kept unexamined for passing it into doResume)
Throws:
TransactionSuspensionNotSupportedException - if suspending is not supported by the transaction manager implementation
TransactionException - in case of system errors
See Also:
doResume(java.lang.Object, java.lang.Object)

doResume

protected void doResume(Object transaction,
                        Object suspendedResources)
                 throws TransactionException
Resume the resources of the current transaction. Transaction synchronization will be resumed afterwards.

The default implementation throws a TransactionSuspensionNotSupportedException, assuming that transaction suspension is generally not supported.

Parameters:
transaction - transaction object returned by doGetTransaction
suspendedResources - the object that holds suspended resources, as returned by doSuspend
Throws:
TransactionSuspensionNotSupportedException - if resuming is not supported by the transaction manager implementation
TransactionException - in case of system errors
See Also:
doSuspend(java.lang.Object)

shouldCommitOnGlobalRollbackOnly

protected boolean shouldCommitOnGlobalRollbackOnly()
Return whether to call doCommit on a transaction that has been marked as rollback-only in a global fashion.

Does not apply if an application locally sets the transaction to rollback-only via the TransactionStatus, but only to the transaction itself being marked as rollback-only by the transaction coordinator.

Default is "false": Local transaction strategies usually don't hold the rollback-only marker in the transaction itself, therefore they can't handle rollback-only transactions as part of transaction commit. Hence, AbstractPlatformTransactionManager will trigger a rollback in that case, throwing an UnexpectedRollbackException afterwards.

Override this to return "true" if the concrete transaction manager expects a doCommit call even for a rollback-only transaction, allowing for special handling there. This will, for example, be the case for JTA, where UserTransaction.commit will check the read-only flag itself and throw a corresponding RollbackException, which might include the specific reason (such as a transaction timeout).

If this method returns "true" but the doCommit implementation does not throw an exception, this transaction manager will throw an UnexpectedRollbackException itself. This should not be the typical case; it is mainly checked to cover misbehaving JTA providers that silently roll back even when the rollback has not been requested by the calling code.

See Also:
doCommit(org.springframework.transaction.support.DefaultTransactionStatus),
DefaultTransactionStatus.isGlobalRollbackOnly(),
AbstractTransactionStatus.isLocalRollbackOnly(),
TransactionStatus.setRollbackOnly(),
UnexpectedRollbackException,
UserTransaction.commit(),
RollbackException

prepareForCommit

protected void prepareForCommit(DefaultTransactionStatus status)
Make preparations for commit, to be performed before the beforeCommit synchronization callbacks occur.

Note that exceptions will get propagated to the commit caller and cause a rollback of the transaction.

Parameters:
status - the status representation of the transaction
Throws:
RuntimeException - in case of errors; will be propagated to the caller (note: do not throw TransactionException subclasses here!)

doCommit

protected abstract void doCommit(DefaultTransactionStatus status)
                          throws TransactionException
Perform an actual commit of the given transaction.

An implementation does not need to check the "new transaction" flag or the rollback-only flag; this will already have been handled before. Usually, a straight commit will be performed on the transaction object contained in the passed-in status.

Parameters:
status - the status representation of the transaction
Throws:
TransactionException - in case of commit or system errors
See Also:
DefaultTransactionStatus.getTransaction()

doRollback

protected abstract void doRollback(DefaultTransactionStatus status)
                            throws TransactionException
Perform an actual rollback of the given transaction.

An implementation does not need to check the "new transaction" flag; this will already have been handled before. Usually, a straight rollback will be performed on the transaction object contained in the passed-in status.

Parameters:
status - the status representation of the transaction
Throws:
TransactionException - in case of system errors
See Also:
DefaultTransactionStatus.getTransaction()

doSetRollbackOnly

protected void doSetRollbackOnly(DefaultTransactionStatus status)
                          throws TransactionException
Set the given transaction rollback-only. Only called on rollback if the current transaction participates in an existing one.

The default implementation throws an IllegalTransactionStateException, assuming that participating in existing transactions is generally not supported. Subclasses are of course encouraged to provide such support.

Parameters:
status - the status representation of the transaction
Throws:
TransactionException - in case of system errors

registerAfterCompletionWithExistingTransaction

protected void registerAfterCompletionWithExistingTransaction(Object transaction,
                                                              List<TransactionSynchronization> synchronizations)
                                                       throws TransactionException
Register the given list of transaction synchronizations with the existing transaction.

Invoked when the control of the Spring transaction manager and thus all Spring transaction synchronizations end, without the transaction being completed yet. This is for example the case when participating in an existing JTA or EJB CMT transaction.

The default implementation simply invokes the afterCompletion methods immediately, passing in "STATUS_UNKNOWN". This is the best we can do if there's no chance to determine the actual outcome of the outer transaction.

Parameters:
transaction - transaction object returned by doGetTransaction
synchronizations - List of TransactionSynchronization objects
Throws:
TransactionException - in case of system errors
See Also:
invokeAfterCompletion(java.util.List, int), TransactionSynchronization.afterCompletion(int), TransactionSynchronization.STATUS_UNKNOWN

doCleanupAfterCompletion

protected void doCleanupAfterCompletion(Object transaction)
Cleanup resources after transaction completion.

Called after doCommit and doRollback execution, on any outcome. The default implementation does nothing.

Should not throw any exceptions but just issue warnings on errors.

Parameters:
transaction - transaction object returned by doGetTransaction
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractPlatformTransactionManager.SuspendedResourcesHolder

org.springframework.transaction.support
Class AbstractPlatformTransactionManager.SuspendedResourcesHolder

java.lang.Object
    extended by  org.springframework.transaction.support.AbstractPlatformTransactionManager.SuspendedResourcesHolder
Enclosing class:
AbstractPlatformTransactionManager
protected static class AbstractPlatformTransactionManager.SuspendedResourcesHolder
extends Object

Holder for suspended resources. Used internally by suspend and resume.

Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractTransactionStatus

org.springframework.transaction.support
Class AbstractTransactionStatus

java.lang.Object
    extended by  org.springframework.transaction.support.AbstractTransactionStatus
All Implemented Interfaces:
SavepointManager, TransactionStatus
Direct Known Subclasses:
DefaultTransactionStatus, SimpleTransactionStatus
public abstract class AbstractTransactionStatus
extends Object
implements TransactionStatus

Abstract base implementation of the TransactionStatus interface.

Pre-implements the handling of local rollback-only and completed flags, and delegation to an underlying SavepointManager. Also offers the option of a holding a savepoint within the transaction.

Does not assume any specific internal transaction handling, such as an underlying transaction object, and no transaction synchronization mechanism.

Since:
1.2.3
Author:
Juergen Hoeller
See Also:
setRollbackOnly(),
isRollbackOnly(),
setCompleted(),
isCompleted(),
getSavepointManager(),
SimpleTransactionStatus,
DefaultTransactionStatus

Constructor Summary
AbstractTransactionStatus()
Method Summary
void | createAndHoldSavepoint() Create a savepoint and hold it for the transaction.
Object | createSavepoint() This implementation delegates to a SavepointManager for the underlying transaction, if possible.
void | flush() This implementations is empty, considering flush as a no-op.
protected Object | getSavepoint() Get the savepoint for this transaction, if any.
protected SavepointManager | getSavepointManager() Return a SavepointManager for the underlying transaction, if possible.
boolean | hasSavepoint() Return whether this transaction internally carries a savepoint, that is, has been created as nested transaction based on a savepoint.
boolean | isCompleted() Return whether this transaction is completed, that is, whether it has already been committed or rolled back.
boolean | isGlobalRollbackOnly() Template method for determining the global rollback-only flag of the underlying transaction, if any.
boolean | isLocalRollbackOnly() Determine the rollback-only flag via checking this TransactionStatus.
boolean | isRollbackOnly() Determine the rollback-only flag via checking both the local rollback-only flag of this TransactionStatus and the global rollback-only flag of the underlying transaction, if any.
void | releaseHeldSavepoint() Release the savepoint that is held for the transaction.
void | releaseSavepoint(Object savepoint) This implementation delegates to a SavepointManager for the underlying transaction, if possible.
void | rollbackToHeldSavepoint() Roll back to the savepoint that is held for the transaction.
void | rollbackToSavepoint(Object savepoint) This implementation delegates to a SavepointManager for the underlying transaction, if possible.
void | setCompleted() Mark this transaction as completed, that is, committed or rolled back.
void | setRollbackOnly() Set the transaction rollback-only.
protected void | setSavepoint(Object savepoint) Set a savepoint for this transaction.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.transaction.TransactionStatus
isNewTransaction

Constructor Detail

AbstractTransactionStatus

public AbstractTransactionStatus()
Method Detail

setRollbackOnly

public void setRollbackOnly()
Description copied from interface: TransactionStatus
Set the transaction rollback-only. This instructs the transaction manager that the only possible outcome of the transaction may be a rollback, as alternative to throwing an exception which would in turn trigger a rollback.

This is mainly intended for transactions managed by TransactionTemplate or TransactionInterceptor, where the actual commit/rollback decision is made by the container.

Specified by:
setRollbackOnly in interface TransactionStatus
See Also:
TransactionCallback.doInTransaction(org.springframework.transaction.TransactionStatus), TransactionAttribute.rollbackOn(java.lang.Throwable)

isRollbackOnly

public boolean isRollbackOnly()
Determine the rollback-only flag via checking both the local rollback-only flag of this TransactionStatus and the global rollback-only flag of the underlying transaction, if any.

Specified by:
isRollbackOnly in interface TransactionStatus
See Also:
isLocalRollbackOnly(), isGlobalRollbackOnly()

isLocalRollbackOnly

public boolean isLocalRollbackOnly()
Determine the rollback-only flag via checking this TransactionStatus.

Will only return "true" if the application called setRollbackOnly on this TransactionStatus object.

isGlobalRollbackOnly

public boolean isGlobalRollbackOnly()
Template method for determining the global rollback-only flag of the underlying transaction, if any.

This implementation always returns false.

flush

public void flush()
This implementations is empty, considering flush as a no-op.

Specified by:
flush in interface TransactionStatus

setCompleted

public void setCompleted()
Mark this transaction as completed, that is, committed or rolled back.

isCompleted

public boolean isCompleted()
Description copied from interface: TransactionStatus
Return whether this transaction is completed, that is, whether it has already been committed or rolled back.

Specified by:
isCompleted in interface TransactionStatus
See Also:
PlatformTransactionManager.commit(org.springframework.transaction.TransactionStatus), PlatformTransactionManager.rollback(org.springframework.transaction.TransactionStatus)

setSavepoint

protected void setSavepoint(Object savepoint)
Set a savepoint for this transaction. Useful for PROPAGATION_NESTED.

See Also:
TransactionDefinition.PROPAGATION_NESTED

getSavepoint

protected Object getSavepoint()
Get the savepoint for this transaction, if any.

hasSavepoint

public boolean hasSavepoint()
Description copied from interface: TransactionStatus
Return whether this transaction internally carries a savepoint, that is, has been created as nested transaction based on a savepoint.

This method is mainly here for diagnostic purposes, alongside TransactionStatus.isNewTransaction(). For programmatic handling of custom savepoints, use SavepointManager's operations.

Specified by:
hasSavepoint in interface TransactionStatus
See Also:
TransactionStatus.isNewTransaction(),
SavepointManager.createSavepoint(),
SavepointManager.rollbackToSavepoint(Object),
SavepointManager.releaseSavepoint(Object)

createAndHoldSavepoint

public void createAndHoldSavepoint()
                            throws TransactionException
Create a savepoint and hold it for the transaction.

Throws:
NestedTransactionNotSupportedException - if the underlying transaction does not support savepoints
TransactionException

rollbackToHeldSavepoint

public void rollbackToHeldSavepoint()
                             throws TransactionException
Roll back to the savepoint that is held for the transaction.

Throws:
TransactionException

releaseHeldSavepoint

public void releaseHeldSavepoint()
                          throws TransactionException
Release the savepoint that is held for the transaction.

Throws:
TransactionException

createSavepoint

public Object createSavepoint()
                       throws TransactionException
This implementation delegates to a SavepointManager for the underlying transaction, if possible.

Specified by:
createSavepoint in interface SavepointManager
Returns:
a savepoint object, to be passed into rollbackToSavepoint or releaseSavepoint
Throws:
NestedTransactionNotSupportedException - if the underlying transaction does not support savepoints
TransactionException - if the savepoint could not be created, for example because the transaction is not in an appropriate state
See Also:
getSavepointManager(), SavepointManager

rollbackToSavepoint

public void rollbackToSavepoint(Object savepoint)
                         throws TransactionException
This implementation delegates to a SavepointManager for the underlying transaction, if possible.

Specified by:
rollbackToSavepoint in interface SavepointManager
Parameters:
savepoint - the savepoint to roll back to
Throws:
NestedTransactionNotSupportedException
TransactionException - if the rollback failed
See Also:
getSavepointManager(), SavepointManager

releaseSavepoint

public void releaseSavepoint(Object savepoint)
                      throws TransactionException
This implementation delegates to a SavepointManager for the underlying transaction, if possible.

Specified by:
releaseSavepoint in interface SavepointManager
Parameters:
savepoint - the savepoint to release
Throws:
NestedTransactionNotSupportedException - if the underlying transaction does not support savepoints
TransactionException - if the release failed
See Also:
getSavepointManager(), SavepointManager

getSavepointManager

protected SavepointManager getSavepointManager()
Return a SavepointManager for the underlying transaction, if possible.

Default implementation always throws a NestedTransactionNotSupportedException.

Throws:
NestedTransactionNotSupportedException - if the underlying transaction does not support savepoints
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultTransactionDefinition

org.springframework.transaction.support
Class DefaultTransactionDefinition

java.lang.Object
    extended by  org.springframework.transaction.support.DefaultTransactionDefinition
All Implemented Interfaces:
Serializable, TransactionDefinition
Direct Known Subclasses:
DefaultTransactionAttribute, TransactionTemplate
public class DefaultTransactionDefinition
extends Object
implements TransactionDefinition, Serializable

Default implementation of the TransactionDefinition interface, offering bean-style configuration and sensible default values (PROPAGATION_REQUIRED, ISOLATION_DEFAULT, TIMEOUT_DEFAULT, readOnly=false).

Base class for both TransactionTemplate and DefaultTransactionAttribute.

Since:
08.05.2003
Author:
Juergen Hoeller
See Also:
Serialized Form

Field Summary
static String | PREFIX_ISOLATION Prefix for the isolation constants defined in TransactionDefinition
static String | PREFIX_PROPAGATION Prefix for the propagation constants defined in TransactionDefinition
static String | PREFIX_TIMEOUT Prefix for transaction timeout values in description strings
static String | READ_ONLY_MARKER Marker for read-only transactions in description strings
Fields inherited from interface org.springframework.transaction.TransactionDefinition
ISOLATION_DEFAULT, ISOLATION_READ_COMMITTED, ISOLATION_READ_UNCOMMITTED, ISOLATION_REPEATABLE_READ, ISOLATION_SERIALIZABLE, PROPAGATION_MANDATORY, PROPAGATION_NESTED, PROPAGATION_NEVER, PROPAGATION_NOT_SUPPORTED, PROPAGATION_REQUIRED, PROPAGATION_REQUIRES_NEW, PROPAGATION_SUPPORTS, TIMEOUT_DEFAULT
Constructor Summary
DefaultTransactionDefinition()
Create a new DefaultTransactionDefinition, with default settings.
DefaultTransactionDefinition(int propagationBehavior)
Create a new DefaultTransactionDefinition with the the given propagation behavior.
DefaultTransactionDefinition(TransactionDefinition other)
Copy constructor.
Method Summary
 boolean equals(Object other)
This implementation compares the toString() results.
protected  StringBuilder getDefinitionDescription()
Return an identifying description for this transaction definition.
 int getIsolationLevel()
Return the isolation level.
 String getName()
Return the name of this transaction.
 int getPropagationBehavior()
Return the propagation behavior.
 int getTimeout()
Return the transaction timeout.
 int hashCode()
This implementation returns toString()'s hash code.
 boolean isReadOnly()
Return whether to optimize as a read-only transaction.
 void setIsolationLevel(int isolationLevel)
Set the isolation level.
 void setIsolationLevelName(String constantName)
Set the isolation level by the name of the corresponding constant in TransactionDefinition, e.g.
 void setName(String name)
Set the name of this transaction.
 void setPropagationBehavior(int propagationBehavior)
Set the propagation behavior.
 void setPropagationBehaviorName(String constantName)
Set the propagation behavior by the name of the corresponding constant in TransactionDefinition, e.g.
 void setReadOnly(boolean readOnly)
Set whether to optimize as read-only transaction.
 void setTimeout(int timeout)
Set the timeout to apply, as number of seconds.
 String toString()
Return an identifying description for this transaction definition.
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail

PREFIX_PROPAGATION

public static final String PREFIX_PROPAGATION
Prefix for the propagation constants defined in TransactionDefinition

See Also:
Constant Field Values

PREFIX_ISOLATION

public static final String PREFIX_ISOLATION
Prefix for the isolation constants defined in TransactionDefinition

See Also:
Constant Field Values

PREFIX_TIMEOUT

public static final String PREFIX_TIMEOUT
Prefix for transaction timeout values in description strings

See Also:
Constant Field Values

READ_ONLY_MARKER

public static final String READ_ONLY_MARKER
Marker for read-only transactions in description strings

See Also:
Constant Field Values
Constructor Detail

DefaultTransactionDefinition

public DefaultTransactionDefinition()
Create a new DefaultTransactionDefinition, with default settings. Can be modified through bean property setters.

See Also:
setPropagationBehavior(int), setIsolationLevel(int), setTimeout(int), setReadOnly(boolean), setName(java.lang.String)

DefaultTransactionDefinition

public DefaultTransactionDefinition(TransactionDefinition other)
Copy constructor. Definition can be modified through bean property setters.

See Also:
setPropagationBehavior(int), setIsolationLevel(int), setTimeout(int), setReadOnly(boolean), setName(java.lang.String)

DefaultTransactionDefinition

public DefaultTransactionDefinition(int propagationBehavior)
Create a new DefaultTransactionDefinition with the the given propagation behavior. Can be modified through bean property setters.

Parameters:
propagationBehavior - one of the propagation constants in the TransactionDefinition interface
See Also:
setIsolationLevel(int), setTimeout(int), setReadOnly(boolean)
Method Detail

setPropagationBehaviorName

public final void setPropagationBehaviorName(String constantName)
                                      throws IllegalArgumentException
Set the propagation behavior by the name of the corresponding constant in TransactionDefinition, e.g. "PROPAGATION_REQUIRED".

Parameters:
constantName - name of the constant
Throws:
IllegalArgumentException - if the supplied value is not resolvable to one of the PROPAGATION_ constants or is null
See Also:
setPropagationBehavior(int), TransactionDefinition.PROPAGATION_REQUIRED

setPropagationBehavior

public final void setPropagationBehavior(int propagationBehavior)
Set the propagation behavior. Must be one of the propagation constants in the TransactionDefinition interface. Default is PROPAGATION_REQUIRED.

Throws:
IllegalArgumentException - if the supplied value is not one of the PROPAGATION_ constants
See Also:
TransactionDefinition.PROPAGATION_REQUIRED

getPropagationBehavior

public final int getPropagationBehavior()
Description copied from interface: TransactionDefinition
Return the propagation behavior.

Must return one of the PROPAGATION_XXX constants defined on this interface.

Specified by:
getPropagationBehavior in interface TransactionDefinition
Returns:
the propagation behavior
See Also:
TransactionDefinition.PROPAGATION_REQUIRED, TransactionSynchronizationManager.isActualTransactionActive()

setIsolationLevelName

public final void setIsolationLevelName(String constantName)
                                 throws IllegalArgumentException
Set the isolation level by the name of the corresponding constant in TransactionDefinition, e.g. "ISOLATION_DEFAULT".

Parameters:
constantName - name of the constant
Throws:
IllegalArgumentException - if the supplied value is not resolvable to one of the ISOLATION_ constants or is null
See Also:
setIsolationLevel(int), TransactionDefinition.ISOLATION_DEFAULT

setIsolationLevel

public final void setIsolationLevel(int isolationLevel)
Set the isolation level. Must be one of the isolation constants in the TransactionDefinition interface. Default is ISOLATION_DEFAULT.

Throws:
IllegalArgumentException - if the supplied value is not one of the ISOLATION_ constants
See Also:
TransactionDefinition.ISOLATION_DEFAULT

getIsolationLevel

public final int getIsolationLevel()
Description copied from interface: TransactionDefinition
Return the isolation level.

Must return one of the ISOLATION_XXX constants defined on this interface.

Only makes sense in combination with TransactionDefinition.PROPAGATION_REQUIRED or TransactionDefinition.PROPAGATION_REQUIRES_NEW.

Note that a transaction manager that does not support custom isolation levels will throw an exception when given any other level than TransactionDefinition.ISOLATION_DEFAULT.

Specified by:
getIsolationLevel in interface TransactionDefinition
Returns:
the isolation level

setTimeout

public final void setTimeout(int timeout)
Set the timeout to apply, as number of seconds. Default is TIMEOUT_DEFAULT (-1).

See Also:
TransactionDefinition.TIMEOUT_DEFAULT

getTimeout

public final int getTimeout()
Description copied from interface: TransactionDefinition
Return the transaction timeout.

Must return a number of seconds, or TransactionDefinition.TIMEOUT_DEFAULT.

Only makes sense in combination with TransactionDefinition.PROPAGATION_REQUIRED or TransactionDefinition.PROPAGATION_REQUIRES_NEW.

Note that a transaction manager that does not support timeouts will throw an exception when given any other timeout than TransactionDefinition.TIMEOUT_DEFAULT.

Specified by:
getTimeout in interface TransactionDefinition
Returns:
the transaction timeout

setReadOnly

public final void setReadOnly(boolean readOnly)
Set whether to optimize as read-only transaction. Default is "false".

isReadOnly

public final boolean isReadOnly()
Description copied from interface: TransactionDefinition
Return whether to optimize as a read-only transaction.

The read-only flag applies to any transaction context, whether backed by an actual resource transaction (TransactionDefinition.PROPAGATION_REQUIRED/TransactionDefinition.PROPAGATION_REQUIRES_NEW) or operating non-transactionally at the resource level (TransactionDefinition.PROPAGATION_SUPPORTS). In the latter case, the flag will only apply to managed resources within the application, such as a Hibernate Session. << *

This just serves as a hint for the actual transaction subsystem; it will not necessarily cause failure of write access attempts. A transaction manager which cannot interpret the read-only hint will not throw an exception when asked for a read-only transaction.

Specified by:
isReadOnly in interface TransactionDefinition
Returns:
true if the transaction is to be optimized as read-only
See Also:
TransactionSynchronization.beforeCommit(boolean), TransactionSynchronizationManager.isCurrentTransactionReadOnly()

setName

public final void setName(String name)
Set the name of this transaction. Default is none.

This will be used as transaction name to be shown in a transaction monitor, if applicable (for example, WebLogic's).

getName

public final String getName()
Description copied from interface: TransactionDefinition
Return the name of this transaction. Can be null.

This will be used as the transaction name to be shown in a transaction monitor, if applicable (for example, WebLogic's).

In case of Spring's declarative transactions, the exposed name will be the fully-qualified class name + "." + method name (by default).

Specified by:
getName in interface TransactionDefinition
Returns:
the name of this transaction
See Also:
TransactionAspectSupport, TransactionSynchronizationManager.getCurrentTransactionName()

equals

public boolean equals(Object other)
This implementation compares the toString() results.

Overrides:
equals in class Object
See Also:
toString()

hashCode

public int hashCode()
This implementation returns toString()'s hash code.

Overrides:
hashCode in class Object
See Also:
toString()

toString

public String toString()
Return an identifying description for this transaction definition.

The format matches the one used by TransactionAttributeEditor, to be able to feed toString results into bean properties of type TransactionAttribute.

Has to be overridden in subclasses for correct equals and hashCode behavior. Alternatively, equals(java.lang.Object) and hashCode() can be overridden themselves.

Overrides:
toString in class Object
See Also:
getDefinitionDescription(), TransactionAttributeEditor

getDefinitionDescription

protected final StringBuilder getDefinitionDescription()
Return an identifying description for this transaction definition.

Available to subclasses, for inclusion in their toString() result.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultTransactionStatus

org.springframework.transaction.support
Class DefaultTransactionStatus

java.lang.Object
    extended by  org.springframework.transaction.support.AbstractTransactionStatus
        extended by  org.springframework.transaction.support.DefaultTransactionStatus
All Implemented Interfaces:
SavepointManager, TransactionStatus
public class DefaultTransactionStatus
extends AbstractTransactionStatus

Default implementation of the TransactionStatus interface, used by AbstractPlatformTransactionManager. Based on the concept of an underlying "transaction object".

Holds all status information that AbstractPlatformTransactionManager needs internally, including a generic transaction object determined by the concrete transaction manager implementation.

Supports delegating savepoint-related methods to a transaction object that implements the SavepointManager interface.

NOTE: This is not intended for use with other PlatformTransactionManager implementations, in particular not for mock transaction managers in testing environments. Use the alternative SimpleTransactionStatus class or a mock for the plain TransactionStatus interface instead.

Since:
19.01.2004
Author:
Juergen Hoeller
See Also:
AbstractPlatformTransactionManager, SavepointManager, getTransaction(), AbstractTransactionStatus.createSavepoint(), AbstractTransactionStatus.rollbackToSavepoint(java.lang.Object), AbstractTransactionStatus.releaseSavepoint(java.lang.Object), SimpleTransactionStatus

Constructor Summary
DefaultTransactionStatus(Object transaction, boolean newTransaction, boolean newSynchronization, boolean readOnly, boolean debug, Object suspendedResources)
Create a new DefaultTransactionStatus instance.
Method Summary
void | flush() Delegate the flushing to the transaction object, provided that the latter implements the SmartTransactionObject interface.
protected SavepointManager | getSavepointManager() This implementation exposes the SavepointManager interface of the underlying transaction object, if any.
Object | getSuspendedResources() Return the holder for resources that have been suspended for this transaction, if any.
Object | getTransaction() Return the underlying transaction object.
boolean | hasTransaction() Return whether there is an actual transaction active.
boolean | isDebug() Return whether the progress of this transaction is debugged.
boolean | isGlobalRollbackOnly() Determine the rollback-only flag via checking both the transaction object, provided that the latter implements the SmartTransactionObject interface.
boolean | isNewSynchronization() Return if a new transaction synchronization has been opened for this transaction.
boolean | isNewTransaction() Return whether the present transaction is new (else participating in an existing transaction, or potentially not running in an actual transaction in the first place).
boolean | isReadOnly() Return if this transaction is defined as read-only transaction.
boolean | isTransactionSavepointManager() Return whether the underlying transaction implements the SavepointManager interface.
Methods inherited from class org.springframework.transaction.support.AbstractTransactionStatus
createAndHoldSavepoint, createSavepoint, getSavepoint, hasSavepoint, isCompleted, isLocalRollbackOnly, isRollbackOnly, releaseHeldSavepoint, releaseSavepoint, rollbackToHeldSavepoint, rollbackToSavepoint, setCompleted, setRollbackOnly, setSavepoint
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DefaultTransactionStatus

public DefaultTransactionStatus(Object transaction,
                                boolean newTransaction,
                                boolean newSynchronization,
                                boolean readOnly,
                                boolean debug,
                                Object suspendedResources)
Create a new DefaultTransactionStatus instance.

Parameters:
transaction - underlying transaction object that can hold state for the internal transaction implementation
newTransaction - if the transaction is new, else participating in an existing transaction
newSynchronization - if a new transaction synchronization has been opened for the given transaction
readOnly - whether the transaction is read-only
debug - should debug logging be enabled for the handling of this transaction? Caching it in here can prevent repeated calls to ask the logging system whether debug logging should be enabled.
suspendedResources - a holder for resources that have been suspended for this transaction, if any
Method Detail

getTransaction

public Object getTransaction()
Return the underlying transaction object.

hasTransaction

public boolean hasTransaction()
Return whether there is an actual transaction active.

isNewTransaction

public boolean isNewTransaction()
Description copied from interface: TransactionStatus
Return whether the present transaction is new (else participating in an existing transaction, or potentially not running in an actual transaction in the first place).

isNewSynchronization

public boolean isNewSynchronization()
Return if a new transaction synchronization has been opened for this transaction.

isReadOnly

public boolean isReadOnly()
Return if this transaction is defined as read-only transaction.

isDebug

public boolean isDebug()
Return whether the progress of this transaction is debugged. This is used by AbstractPlatformTransactionManager as an optimization, to prevent repeated calls to logger.isDebug(). Not really intended for client code.

getSuspendedResources

public Object getSuspendedResources()
Return the holder for resources that have been suspended for this transaction, if any.

isGlobalRollbackOnly

public boolean isGlobalRollbackOnly()
Determine the rollback-only flag via checking both the transaction object, provided that the latter implements the SmartTransactionObject interface.

Will return "true" if the transaction itself has been marked rollback-only by the transaction coordinator, for example in case of a timeout.

Overrides:
isGlobalRollbackOnly in class AbstractTransactionStatus
See Also:
SmartTransactionObject.isRollbackOnly()

flush

public void flush()
Delegate the flushing to the transaction object, provided that the latter implements the SmartTransactionObject interface.

Specified by:
flush in interface TransactionStatus
Overrides:
flush in class AbstractTransactionStatus

getSavepointManager

protected SavepointManager getSavepointManager()
This implementation exposes the SavepointManager interface of the underlying transaction object, if any.

Overrides:
getSavepointManager in class AbstractTransactionStatus

isTransactionSavepointManager

public boolean isTransactionSavepointManager()
Return whether the underlying transaction implements the SavepointManager interface.

See Also:
getTransaction(), SavepointManager
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DelegatingTransactionDefinition

org.springframework.transaction.support
Class DelegatingTransactionDefinition

java.lang.Object
    extended by  org.springframework.transaction.support.DelegatingTransactionDefinition
All Implemented Interfaces:
Serializable, TransactionDefinition
Direct Known Subclasses:
DelegatingTransactionAttribute
public abstract class DelegatingTransactionDefinition
extends Object
implements TransactionDefinition, Serializable

TransactionDefinition implementation that delegates all calls to a given target TransactionDefinition instance. Abstract because it is meant to be subclassed, with subclasses overriding specific methods that are not supposed to simply delegate to the target instance.

Since:
3.0
Author:
Juergen Hoeller
See Also:
Serialized Form

Field Summary
Fields inherited from interface org.springframework.transaction.TransactionDefinition
ISOLATION_DEFAULT, ISOLATION_READ_COMMITTED, ISOLATION_READ_UNCOMMITTED, ISOLATION_REPEATABLE_READ, ISOLATION_SERIALIZABLE, PROPAGATION_MANDATORY, PROPAGATION_NESTED, PROPAGATION_NEVER, PROPAGATION_NOT_SUPPORTED, PROPAGATION_REQUIRED, PROPAGATION_REQUIRES_NEW, PROPAGATION_SUPPORTS, TIMEOUT_DEFAULT
Constructor Summary
DelegatingTransactionDefinition(TransactionDefinition targetDefinition)
Create a DelegatingTransactionAttribute for the given target attribute.
Method Summary
boolean | equals(Object obj)
int | getIsolationLevel() Return the isolation level.
String | getName() Return the name of this transaction.
int | getPropagationBehavior() Return the propagation behavior.
int | getTimeout() Return the transaction timeout.
int | hashCode()
boolean | isReadOnly() Return whether to optimize as a read-only transaction.
String | toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

DelegatingTransactionDefinition

public DelegatingTransactionDefinition(TransactionDefinition targetDefinition)
Create a DelegatingTransactionAttribute for the given target attribute.

Parameters:
targetAttribute - the target TransactionAttribute to delegate to
Method Detail

getPropagationBehavior

public int getPropagationBehavior()
Description copied from interface: TransactionDefinition
Return the propagation behavior.

Must return one of the PROPAGATION_XXX constants defined on this interface.

Specified by:
getPropagationBehavior in interface TransactionDefinition
Returns:
the propagation behavior
See Also:
TransactionDefinition.PROPAGATION_REQUIRED, TransactionSynchronizationManager.isActualTransactionActive()

getIsolationLevel

public int getIsolationLevel()
Description copied from interface: TransactionDefinition
Return the isolation level.

Must return one of the ISOLATION_XXX constants defined on this interface.

Only makes sense in combination with TransactionDefinition.PROPAGATION_REQUIRED or TransactionDefinition.PROPAGATION_REQUIRES_NEW.

Note that a transaction manager that does not support custom isolation levels will throw an exception when given any other level than TransactionDefinition.ISOLATION_DEFAULT.

Specified by:
getIsolationLevel in interface TransactionDefinition
Returns:
the isolation level

getTimeout

public int getTimeout()
Description copied from interface: TransactionDefinition
Return the transaction timeout.

Must return a number of seconds, or TransactionDefinition.TIMEOUT_DEFAULT.

Only makes sense in combination with TransactionDefinition.PROPAGATION_REQUIRED or TransactionDefinition.PROPAGATION_REQUIRES_NEW.

Note that a transaction manager that does not support timeouts will throw an exception when given any other timeout than TransactionDefinition.TIMEOUT_DEFAULT.

Specified by:
getTimeout in interface TransactionDefinition
Returns:
the transaction timeout

isReadOnly

public boolean isReadOnly()
Description copied from interface: TransactionDefinition
Return whether to optimize as a read-only transaction.

The read-only flag applies to any transaction context, whether backed by an actual resource transaction (TransactionDefinition.PROPAGATION_REQUIRED/TransactionDefinition.PROPAGATION_REQUIRES_NEW) or operating non-transactionally at the resource level (TransactionDefinition.PROPAGATION_SUPPORTS). In the latter case, the flag will only apply to managed resources within the application, such as a Hibernate Session. << *

This just serves as a hint for the actual transaction subsystem; it will not necessarily cause failure of write access attempts. A transaction manager which cannot interpret the read-only hint will not throw an exception when asked for a read-only transaction.

Specified by:
isReadOnly in interface TransactionDefinition
Returns:
true if the transaction is to be optimized as read-only
See Also:
TransactionSynchronization.beforeCommit(boolean), TransactionSynchronizationManager.isCurrentTransactionReadOnly()

getName

public String getName()
Description copied from interface: TransactionDefinition
Return the name of this transaction. Can be null.

This will be used as the transaction name to be shown in a transaction monitor, if applicable (for example, WebLogic's).

In case of Spring's declarative transactions, the exposed name will be the fully-qualified class name + "." + method name (by default).

Specified by:
getName in interface TransactionDefinition
Returns:
the name of this transaction
See Also:
TransactionAspectSupport, TransactionSynchronizationManager.getCurrentTransactionName()

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResourceHolderSupport

org.springframework.transaction.support
Class ResourceHolderSupport

java.lang.Object
    extended by  org.springframework.transaction.support.ResourceHolderSupport
All Implemented Interfaces:
ResourceHolder
Direct Known Subclasses:
ConnectionHolder, ConnectionHolder, EntityManagerHolder, JmsResourceHolder, PersistenceManagerHolder, SessionHolder
public abstract class ResourceHolderSupport
extends Object
implements ResourceHolder

Convenient base class for resource holders.

Features rollback-only support for nested transactions. Can expire after a certain number of seconds or milliseconds, to determine transactional timeouts.

Since:
02.02.2004
Author:
Juergen Hoeller
See Also:
DataSourceTransactionManager.doBegin(java.lang.Object, org.springframework.transaction.TransactionDefinition), DataSourceUtils.applyTransactionTimeout(java.sql.Statement, javax.sql.DataSource)

Constructor Summary
ResourceHolderSupport()
Method Summary
void | clear() Clear the transactional state of this resource holder.
Date | getDeadline() Return the expiration deadline of this object.
long | getTimeToLiveInMillis() Return the time to live for this object in milliseconds.
int | getTimeToLiveInSeconds() Return the time to live for this object in seconds.
boolean | hasTimeout() Return whether this object has an associated timeout.
boolean | isOpen() Return whether there are still open references to this holder.
boolean | isRollbackOnly() Return whether the resource transaction is marked as rollback-only.
boolean | isSynchronizedWithTransaction() Return whether the resource is synchronized with a transaction.
boolean | isVoid() Determine whether this holder is considere as 'void', i.e.
void | released() Decrease the reference count by one because the holder has been released (i.e.
void | requested() Increase the reference count by one because the holder has been requested (i.e.
void | reset() Reset this resource holder - transactional state as well as reference count.
void | setRollbackOnly() Mark the resource transaction as rollback-only.
void | setSynchronizedWithTransaction(boolean synchronizedWithTransaction) Mark the resource as synchronized with a transaction.
void | setTimeoutInMillis(long millis) Set the timeout for this object in milliseconds.
void | setTimeoutInSeconds(int seconds) Set the timeout for this object in seconds.
void | unbound() Notify this holder that it has been unbound from transaction synchronization.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ResourceHolderSupport

public ResourceHolderSupport()
Method Detail

setSynchronizedWithTransaction

public void setSynchronizedWithTransaction(boolean synchronizedWithTransaction)
Mark the resource as synchronized with a transaction.

isSynchronizedWithTransaction

public boolean isSynchronizedWithTransaction()
Return whether the resource is synchronized with a transaction.

setRollbackOnly

public void setRollbackOnly()
Mark the resource transaction as rollback-only.

isRollbackOnly

public boolean isRollbackOnly()
Return whether the resource transaction is marked as rollback-only.

setTimeoutInSeconds

public void setTimeoutInSeconds(int seconds)
Set the timeout for this object in seconds.

Parameters:
seconds - number of seconds until expiration

setTimeoutInMillis

public void setTimeoutInMillis(long millis)
Set the timeout for this object in milliseconds.

Parameters:
millis - number of milliseconds until expiration

hasTimeout

public boolean hasTimeout()
Return whether this object has an associated timeout.

getDeadline

public Date getDeadline()
Return the expiration deadline of this object.

Returns:
the deadline as Date object

getTimeToLiveInSeconds

public int getTimeToLiveInSeconds()
Return the time to live for this object in seconds. Rounds up eagerly, e.g. 9.00001 still to 10.

Returns:
number of seconds until expiration
Throws:
TransactionTimedOutException - if the deadline has already been reached

getTimeToLiveInMillis

public long getTimeToLiveInMillis()
                           throws TransactionTimedOutException
Return the time to live for this object in milliseconds.

Returns:
number of millseconds until expiration
Throws:
TransactionTimedOutException - if the deadline has already been reached

requested

public void requested()
Increase the reference count by one because the holder has been requested (i.e. someone requested the resource held by it).

released

public void released()
Decrease the reference count by one because the holder has been released (i.e. someone released the resource held by it).

isOpen

public boolean isOpen()
Return whether there are still open references to this holder.

clear

public void clear()
Clear the transactional state of this resource holder.

reset

public void reset()
Reset this resource holder - transactional state as well as reference count.

Specified by:
reset in interface ResourceHolder

unbound

public void unbound()
Description copied from interface: ResourceHolder
Notify this holder that it has been unbound from transaction synchronization.

Specified by:
unbound in interface ResourceHolder

isVoid

public boolean isVoid()
Description copied from interface: ResourceHolder
Determine whether this holder is considere as 'void', i.e. as a leftover from a previous thread.

Specified by:
isVoid in interface ResourceHolder
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResourceHolderSynchronization

org.springframework.transaction.support
Class ResourceHolderSynchronization<H extends ResourceHolder,K>

java.lang.Object
    extended by  org.springframework.transaction.support.ResourceHolderSynchronization<H,K>
All Implemented Interfaces:
TransactionSynchronization
public abstract class ResourceHolderSynchronization<H extends ResourceHolder,K>
extends Object
implements TransactionSynchronization

TransactionSynchronization implementation that manages a ResourceHolder bound through TransactionSynchronizationManager.

Since:
2.5.5
Author:
Juergen Hoeller

Field Summary
Fields inherited from interface org.springframework.transaction.support.TransactionSynchronization
STATUS_COMMITTED, STATUS_ROLLED_BACK, STATUS_UNKNOWN
Constructor Summary
ResourceHolderSynchronization(H resourceHolder, K resourceKey)
Create a new ResourceHolderSynchronization for the given holder.
Method Summary
void | afterCommit() Invoked after transaction commit.
void | afterCompletion(int status) Invoked after transaction commit/rollback.
void | beforeCommit(boolean readOnly) Invoked before transaction commit (before "beforeCompletion").
void | beforeCompletion() Invoked before transaction commit/rollback.
protected void | cleanupResource(H resourceHolder, K resourceKey, boolean committed) Perform a cleanup on the given resource (which is left bound to the thread).
void | flush() Flush the underlying session to the datastore, if applicable: for example, a Hibernate/JPA session.
protected void | flushResource(H resourceHolder) Flush callback for the given resource holder.
protected void | processResourceAfterCommit(H resourceHolder) After-commit callback for the given resource holder.
protected void | releaseResource(H resourceHolder, K resourceKey) Release the given resource (after it has been unbound from the thread).
void | resume() Resume this synchronization.
protected boolean | shouldReleaseBeforeCompletion() Return whether this holder's resource should be released before transaction completion (true) or rather after transaction completion (false).
protected boolean | shouldUnbindAtCompletion() Return whether this holder should be unbound at completion (or should rather be left bound to the thread after the transaction).
void | suspend() Suspend this synchronization.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ResourceHolderSynchronization

public ResourceHolderSynchronization(H resourceHolder,
                                     K resourceKey)
Create a new ResourceHolderSynchronization for the given holder.

Parameters:
resourceHolder - the ResourceHolder to manage
resourceKey - the key to bind the ResourceHolder for
See Also:
TransactionSynchronizationManager.bindResource(java.lang.Object, java.lang.Object)
Method Detail

suspend

public void suspend()
Description copied from interface: TransactionSynchronization
Suspend this synchronization. Supposed to unbind resources from TransactionSynchronizationManager if managing any.

Specified by:
suspend in interface TransactionSynchronization
See Also:
TransactionSynchronizationManager.unbindResource(java.lang.Object)

resume

public void resume()
Description copied from interface: TransactionSynchronization
Resume this synchronization. Supposed to rebind resources to TransactionSynchronizationManager if managing any.

Specified by:
resume in interface TransactionSynchronization
See Also:
TransactionSynchronizationManager.bindResource(java.lang.Object, java.lang.Object)

flush

public void flush()
Description copied from interface: TransactionSynchronization
Flush the underlying session to the datastore, if applicable: for example, a Hibernate/JPA session.

Specified by:
flush in interface TransactionSynchronization
See Also:
TransactionStatus.flush()

beforeCommit

public void beforeCommit(boolean readOnly)
Description copied from interface: TransactionSynchronization
Invoked before transaction commit (before "beforeCompletion"). Can e.g. flush transactional O/R Mapping sessions to the database.

This callback does not mean that the transaction will actually be committed. A rollback decision can still occur after this method has been called. This callback is rather meant to perform work that's only relevant if a commit still has a chance to happen, such as flushing SQL statements to the database.

Note that exceptions will get propagated to the commit caller and cause a rollback of the transaction.

Specified by:
beforeCommit in interface TransactionSynchronization
Parameters:
readOnly - whether the transaction is defined as read-only transaction
See Also:
TransactionSynchronization.beforeCompletion()

beforeCompletion

public void beforeCompletion()
Description copied from interface: TransactionSynchronization
Invoked before transaction commit/rollback. Can perform resource cleanup before transaction completion.

This method will be invoked after beforeCommit, even when beforeCommit threw an exception. This callback allows for closing resources before transaction completion, for any outcome.

Specified by:
beforeCompletion in interface TransactionSynchronization
See Also:
TransactionSynchronization.beforeCommit(boolean), TransactionSynchronization.afterCompletion(int)

afterCommit

public void afterCommit()
Description copied from interface: TransactionSynchronization
Invoked after transaction commit. Can perform further operations right after the main transaction has successfully committed.

Can e.g. commit further operations that are supposed to follow on a successful commit of the main transaction, like confirmation messages or emails.

NOTE: The transaction will have been committed already, but the transactional resources might still be active and accessible. As a consequence, any data access code triggered at this point will still "participate" in the original transaction, allowing to perform some cleanup (with no commit following anymore!), unless it explicitly declares that it needs to run in a separate transaction. Hence: Use PROPAGATION_REQUIRES_NEW for any transactional operation that is called from here.

Specified by:
afterCommit in interface TransactionSynchronization

afterCompletion

public void afterCompletion(int status)
Description copied from interface: TransactionSynchronization
Invoked after transaction commit/rollback. Can perform resource cleanup after transaction completion.

NOTE: The transaction will have been committed or rolled back already, but the transactional resources might still be active and accessible. As a consequence, any data access code triggered at this point will still "participate" in the original transaction, allowing to perform some cleanup (with no commit following anymore!), unless it explicitly declares that it needs to run in a separate transaction. Hence: Use PROPAGATION_REQUIRES_NEW for any transactional operation that is called from here.

Specified by:
afterCompletion in interface TransactionSynchronization
Parameters:
status - completion status according to the STATUS_* constants
See Also:
TransactionSynchronization.STATUS_COMMITTED, TransactionSynchronization.STATUS_ROLLED_BACK, TransactionSynchronization.STATUS_UNKNOWN, TransactionSynchronization.beforeCompletion()

shouldUnbindAtCompletion

protected boolean shouldUnbindAtCompletion()
Return whether this holder should be unbound at completion (or should rather be left bound to the thread after the transaction).

The default implementation returns true.

shouldReleaseBeforeCompletion

protected boolean shouldReleaseBeforeCompletion()
Return whether this holder's resource should be released before transaction completion (true) or rather after transaction completion (false).

Note that resources will only be released when they are unbound from the thread (shouldUnbindAtCompletion()).

The default implementation returns true.

See Also:
releaseResource(H, K)

flushResource

protected void flushResource(H resourceHolder)
Flush callback for the given resource holder.

Parameters:
resourceHolder - the resource holder to flush

processResourceAfterCommit

protected void processResourceAfterCommit(H resourceHolder)
After-commit callback for the given resource holder. Only called when the resource hasn't been released yet (shouldReleaseBeforeCompletion()).

Parameters:
resourceHolder - the resource holder to process

releaseResource

protected void releaseResource(H resourceHolder,
                               K resourceKey)
Release the given resource (after it has been unbound from the thread).

Parameters:
resourceHolder - the resource holder to process
resourceKey - the key that the ResourceHolder was bound for

cleanupResource

protected void cleanupResource(H resourceHolder,
                               K resourceKey,
                               boolean committed)
Perform a cleanup on the given resource (which is left bound to the thread).

Parameters:
resourceHolder - the resource holder to process
resourceKey - the key that the ResourceHolder was bound for
committed - whether the transaction has committed (true) or rolled back (false)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleTransactionStatus

org.springframework.transaction.support
Class SimpleTransactionStatus

java.lang.Object
    extended by  org.springframework.transaction.support.AbstractTransactionStatus
        extended by  org.springframework.transaction.support.SimpleTransactionStatus
All Implemented Interfaces:
SavepointManager, TransactionStatus
public class SimpleTransactionStatus
extends AbstractTransactionStatus

A simple TransactionStatus implementation.

Derives from AbstractTransactionStatus and adds an explicit "newTransaction" flag.

This class is not used by any of Spring's pre-built PlatformTransactionManager implementations. It is mainly provided as a start for custom transaction manager implementations and as a static mock for testing transactional code (either as part of a mock PlatformTransactionManager or as argument passed into a TransactionCallback to be tested).

Since:
1.2.3
Author:
Juergen Hoeller
See Also:
SimpleTransactionStatus(boolean), TransactionCallback

Constructor Summary
SimpleTransactionStatus()
Create a new instance of the SimpleTransactionStatus class, indicating a new transaction.
SimpleTransactionStatus(boolean newTransaction)
Create a new instance of the SimpleTransactionStatus class.
Method Summary
 boolean isNewTransaction()
Return whether the present transaction is new (else participating in an existing transaction, or potentially not running in an actual transaction in the first place).
Methods inherited from class org.springframework.transaction.support.AbstractTransactionStatus
createAndHoldSavepoint, createSavepoint, flush, getSavepoint, getSavepointManager, hasSavepoint, isCompleted, isGlobalRollbackOnly, isLocalRollbackOnly, isRollbackOnly, releaseHeldSavepoint, releaseSavepoint, rollbackToHeldSavepoint, rollbackToSavepoint, setCompleted, setRollbackOnly, setSavepoint
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleTransactionStatus

public SimpleTransactionStatus()
Create a new instance of the SimpleTransactionStatus class, indicating a new transaction.

SimpleTransactionStatus

public SimpleTransactionStatus(boolean newTransaction)
Create a new instance of the SimpleTransactionStatus class.

Parameters:
newTransaction - whether to indicate a new transaction
Method Detail

isNewTransaction

public boolean isNewTransaction()
Description copied from interface: TransactionStatus
Return whether the present transaction is new (else participating in an existing transaction, or potentially not running in an actual transaction in the first place).

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionCallbackWithoutResult

org.springframework.transaction.support
Class TransactionCallbackWithoutResult

java.lang.Object
    extended by  org.springframework.transaction.support.TransactionCallbackWithoutResult
All Implemented Interfaces:
TransactionCallback<Object>
public abstract class TransactionCallbackWithoutResult
extends Object
implements TransactionCallback<Object>

Simple convenience class for TransactionCallback implementation. Allows for implementing a doInTransaction version without result, i.e. without the need for a return statement.

Since:
28.03.2003
Author:
Juergen Hoeller
See Also:
TransactionTemplate

Constructor Summary
TransactionCallbackWithoutResult()
Method Summary
Object | doInTransaction(TransactionStatus status) Gets called by TransactionTemplate.execute(org.springframework.transaction.support.TransactionCallback) within a transactional context.
protected abstract void | doInTransactionWithoutResult(TransactionStatus status) Gets called by TransactionTemplate.execute within a transactional context.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TransactionCallbackWithoutResult

public TransactionCallbackWithoutResult()
Method Detail

doInTransaction

public final Object doInTransaction(TransactionStatus status)
Description copied from interface: TransactionCallback
Gets called by TransactionTemplate.execute(org.springframework.transaction.support.TransactionCallback) within a transactional context. Does not need to care about transactions itself, although it can retrieve and influence the status of the current transaction via the given status object, e.g. setting rollback-only.

Allows for returning a result object created within the transaction, i.e. a domain object or a collection of domain objects. A RuntimeException thrown by the callback is treated as application exception that enforces a rollback. An exception gets propagated to the caller of the template.

Specified by:
doInTransaction in interface TransactionCallback<Object>
Parameters:
status - associated transaction status
Returns:
a result object, or null
See Also:
TransactionTemplate.execute(org.springframework.transaction.support.TransactionCallback), CallbackPreferringPlatformTransactionManager.execute(org.springframework.transaction.TransactionDefinition, org.springframework.transaction.support.TransactionCallback)

doInTransactionWithoutResult

protected abstract void doInTransactionWithoutResult(TransactionStatus status)
Gets called by TransactionTemplate.execute within a transactional context. Does not need to care about transactions itself, although it can retrieve and influence the status of the current transaction via the given status object, e.g. setting rollback-only.

A RuntimeException thrown by the callback is treated as application exception that enforces a rollback. An exception gets propagated to the caller of the template.

Note when using JTA: JTA transactions only work with transactional JNDI resources, so implementations need to use such resources if they want transaction support.

Parameters:
status - associated transaction status
See Also:
TransactionTemplate.execute(org.springframework.transaction.support.TransactionCallback)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionSynchronizationAdapter

org.springframework.transaction.support
Class TransactionSynchronizationAdapter

java.lang.Object
    extended by  org.springframework.transaction.support.TransactionSynchronizationAdapter
All Implemented Interfaces:
Ordered, TransactionSynchronization
Direct Known Subclasses:
SpringLobCreatorSynchronization
public abstract class TransactionSynchronizationAdapter
extends Object
implements TransactionSynchronization, Ordered

Simple TransactionSynchronization adapter containing empty method implementations, for easier overriding of single methods.

Also implements the Ordered interface to enable the execution order of synchronizations to be controlled declaratively. The default order is Ordered.LOWEST_PRECEDENCE, indicating late execution; return a lower value for earlier execution.

Since:
22.01.2004
Author:
Juergen Hoeller

Field Summary
Fields inherited from interface org.springframework.transaction.support.TransactionSynchronization
STATUS_COMMITTED, STATUS_ROLLED_BACK, STATUS_UNKNOWN
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
TransactionSynchronizationAdapter()
Method Summary
void | afterCommit() Invoked after transaction commit.
void | afterCompletion(int status) Invoked after transaction commit/rollback.
void | beforeCommit(boolean readOnly) Invoked before transaction commit (before "beforeCompletion").
void | beforeCompletion() Invoked before transaction commit/rollback.
void | flush() Flush the underlying session to the datastore, if applicable: for example, a Hibernate/JPA session.
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
void | resume() Resume this synchronization.
void | suspend() Suspend this synchronization.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TransactionSynchronizationAdapter

public TransactionSynchronizationAdapter()
Method Detail

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

suspend

public void suspend()
Description copied from interface: TransactionSynchronization
Suspend this synchronization. Supposed to unbind resources from TransactionSynchronizationManager if managing any.

Specified by:
suspend in interface TransactionSynchronization
See Also:
TransactionSynchronizationManager.unbindResource(java.lang.Object)

resume

public void resume()
Description copied from interface: TransactionSynchronization
Resume this synchronization. Supposed to rebind resources to TransactionSynchronizationManager if managing any.

Specified by:
resume in interface TransactionSynchronization
See Also:
TransactionSynchronizationManager.bindResource(java.lang.Object, java.lang.Object)

flush

public void flush()
Description copied from interface: TransactionSynchronization
Flush the underlying session to the datastore, if applicable: for example, a Hibernate/JPA session.

Specified by:
flush in interface TransactionSynchronization
See Also:
TransactionStatus.flush()

beforeCommit

public void beforeCommit(boolean readOnly)
Description copied from interface: TransactionSynchronization
Invoked before transaction commit (before "beforeCompletion"). Can e.g. flush transactional O/R Mapping sessions to the database.

This callback does not mean that the transaction will actually be committed. A rollback decision can still occur after this method has been called. This callback is rather meant to perform work that's only relevant if a commit still has a chance to happen, such as flushing SQL statements to the database.

Note that exceptions will get propagated to the commit caller and cause a rollback of the transaction.

Specified by:
beforeCommit in interface TransactionSynchronization
Parameters:
readOnly - whether the transaction is defined as read-only transaction
See Also:
TransactionSynchronization.beforeCompletion()

beforeCompletion

public void beforeCompletion()
Description copied from interface: TransactionSynchronization
Invoked before transaction commit/rollback. Can perform resource cleanup before transaction completion.

This method will be invoked after beforeCommit, even when beforeCommit threw an exception. This callback allows for closing resources before transaction completion, for any outcome.

Specified by:
beforeCompletion in interface TransactionSynchronization
See Also:
TransactionSynchronization.beforeCommit(boolean), TransactionSynchronization.afterCompletion(int)

afterCommit

public void afterCommit()
Description copied from interface: TransactionSynchronization
Invoked after transaction commit. Can perform further operations right after the main transaction has successfully committed.

Can e.g. commit further operations that are supposed to follow on a successful commit of the main transaction, like confirmation messages or emails.

NOTE: The transaction will have been committed already, but the transactional resources might still be active and accessible. As a consequence, any data access code triggered at this point will still "participate" in the original transaction, allowing to perform some cleanup (with no commit following anymore!), unless it explicitly declares that it needs to run in a separate transaction. Hence: Use PROPAGATION_REQUIRES_NEW for any transactional operation that is called from here.

Specified by:
afterCommit in interface TransactionSynchronization

afterCompletion

public void afterCompletion(int status)
Description copied from interface: TransactionSynchronization
Invoked after transaction commit/rollback. Can perform resource cleanup after transaction completion.

NOTE: The transaction will have been committed or rolled back already, but the transactional resources might still be active and accessible. As a consequence, any data access code triggered at this point will still "participate" in the original transaction, allowing to perform some cleanup (with no commit following anymore!), unless it explicitly declares that it needs to run in a separate transaction. Hence: Use PROPAGATION_REQUIRES_NEW for any transactional operation that is called from here.

Specified by:
afterCompletion in interface TransactionSynchronization
Parameters:
status - completion status according to the STATUS_* constants
See Also:
TransactionSynchronization.STATUS_COMMITTED, TransactionSynchronization.STATUS_ROLLED_BACK, TransactionSynchronization.STATUS_UNKNOWN, TransactionSynchronization.beforeCompletion()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionSynchronizationManager

org.springframework.transaction.support
Class TransactionSynchronizationManager

java.lang.Object
    extended by  org.springframework.transaction.support.TransactionSynchronizationManager

public abstract class TransactionSynchronizationManager
extends Object

Central helper that manages resources and transaction synchronizations per thread. To be used by resource management code but not by typical application code.

Supports one resource per key without overwriting, that is, a resource needs to be removed before a new one can be set for the same key. Supports a list of transaction synchronizations if synchronization is active.

Resource management code should check for thread-bound resources, e.g. JDBC Connections or Hibernate Sessions, via getResource. Such code is normally not supposed to bind resources to threads, as this is the responsibility of transaction managers. A further option is to lazily bind on first use if transaction synchronization is active, for performing transactions that span an arbitrary number of resources.

Transaction synchronization must be activated and deactivated by a transaction manager via initSynchronization() and clearSynchronization(). This is automatically supported by AbstractPlatformTransactionManager, and thus by all standard Spring transaction managers, such as JtaTransactionManager and DataSourceTransactionManager.

Resource management code should only register synchronizations when this manager is active, which can be checked via isSynchronizationActive(); it should perform immediate resource cleanup else. If transaction synchronization isn't active, there is either no current transaction, or the transaction manager doesn't support transaction synchronization.

Synchronization is for example used to always return the same resources within a JTA transaction, e.g. a JDBC Connection or a Hibernate Session for any given DataSource or SessionFactory, respectively.

Since:
02.06.2003
Author:
Juergen Hoeller
See Also:
isSynchronizationActive(), registerSynchronization(org.springframework.transaction.support.TransactionSynchronization), TransactionSynchronization, AbstractPlatformTransactionManager.setTransactionSynchronization(int), JtaTransactionManager, DataSourceTransactionManager, DataSourceUtils.getConnection(javax.sql.DataSource)

Constructor Summary
TransactionSynchronizationManager()
Method Summary
static void | bindResource(Object key, Object value) Bind the given resource for the given key to the current thread.
static void | clear() Clear the entire transaction synchronization state for the current thread: registered synchronizations as well as the various transaction characteristics.
static void | clearSynchronization() Deactivate transaction synchronization for the current thread.
static Integer | getCurrentTransactionIsolationLevel() Return the isolation level for the current transaction, if any.
static String | getCurrentTransactionName() Return the name of the current transaction, or null if none set.
static Object | getResource(Object key) Retrieve a resource for the given key that is bound to the current thread.
static Map<Object,Object> | getResourceMap() Return all resources that are bound to the current thread.
static List<TransactionSynchronization> | getSynchronizations() Return an unmodifiable snapshot list of all registered synchronizations for the current thread.
static boolean | hasResource(Object key) Check if there is a resource for the given key bound to the current thread.
static void | initSynchronization() Activate transaction synchronization for the current thread.
static boolean | isActualTransactionActive() Return whether there currently is an actual transaction active.
static boolean | isCurrentTransactionReadOnly() Return whether the current transaction is marked as read-only.
static boolean | isSynchronizationActive() Return if transaction synchronization is active for the current thread.
static void | registerSynchronization(TransactionSynchronization synchronization) Register a new transaction synchronization for the current thread.
static void | setActualTransactionActive(boolean active) Expose whether there currently is an actual transaction active.
static void | setCurrentTransactionIsolationLevel(Integer isolationLevel) Expose an isolation level for the current transaction.
static void | setCurrentTransactionName(String name) Expose the name of the current transaction, if any.
static void | setCurrentTransactionReadOnly(boolean readOnly) Expose a read-only flag for the current transaction.
static Object | unbindResource(Object key) Unbind a resource for the given key from the current thread.
static Object | unbindResourceIfPossible(Object key) Unbind a resource for the given key from the current thread.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TransactionSynchronizationManager

public TransactionSynchronizationManager()
Method Detail

getResourceMap

public static Map<Object,Object> getResourceMap()
Return all resources that are bound to the current thread.

Mainly for debugging purposes. Resource managers should always invoke hasResource for a specific resource key that they are interested in.

Returns:
a Map with resource keys (usually the resource factory) and resource values (usually the active resource object), or an empty Map if there are currently no resources bound
See Also:
hasResource(java.lang.Object)

hasResource

public static boolean hasResource(Object key)
Check if there is a resource for the given key bound to the current thread.

Parameters:
key - the key to check (usually the resource factory)
Returns:
if there is a value bound to the current thread
See Also:
ResourceTransactionManager.getResourceFactory()

getResource

public static Object getResource(Object key)
Retrieve a resource for the given key that is bound to the current thread.

Parameters:
key - the key to check (usually the resource factory)
Returns:
a value bound to the current thread (usually the active resource object), or null if none
See Also:
ResourceTransactionManager.getResourceFactory()

bindResource

public static void bindResource(Object key,
                                Object value)
                         throws IllegalStateException
Bind the given resource for the given key to the current thread.

Parameters:
key - the key to bind the value to (usually the resource factory)
value - the value to bind (usually the active resource object)
Throws:
IllegalStateException - if there is already a value bound to the thread
See Also:
ResourceTransactionManager.getResourceFactory()

unbindResource

public static Object unbindResource(Object key)
                             throws IllegalStateException
Unbind a resource for the given key from the current thread.

Parameters:
key - the key to unbind (usually the resource factory)
Returns:
the previously bound value (usually the active resource object)
Throws:
IllegalStateException - if there is no value bound to the thread
See Also:
ResourceTransactionManager.getResourceFactory()

unbindResourceIfPossible

public static Object unbindResourceIfPossible(Object key)
Unbind a resource for the given key from the current thread.

Parameters:
key - the key to unbind (usually the resource factory)
Returns:
the previously bound value, or null if none bound

isSynchronizationActive

public static boolean isSynchronizationActive()
Return if transaction synchronization is active for the current thread. Can be called before register to avoid unnecessary instance creation.

See Also:
registerSynchronization(org.springframework.transaction.support.TransactionSynchronization)

initSynchronization

public static void initSynchronization()
                                throws IllegalStateException
Activate transaction synchronization for the current thread. Called by a transaction manager on transaction begin.

Throws:
IllegalStateException - if synchronization is already active

registerSynchronization

public static void registerSynchronization(TransactionSynchronization synchronization)
                                    throws IllegalStateException
Register a new transaction synchronization for the current thread. Typically called by resource management code.

Note that synchronizations can implement the Ordered interface. They will be executed in an order according to their order value (if any).

Parameters:
synchronization - the synchronization object to register
Throws:
IllegalStateException - if transaction synchronization is not active
See Also:
Ordered

getSynchronizations

public static List<TransactionSynchronization> getSynchronizations()
                                                            throws IllegalStateException
Return an unmodifiable snapshot list of all registered synchronizations for the current thread.

Returns:
unmodifiable List of TransactionSynchronization instances
Throws:
IllegalStateException - if synchronization is not active
See Also:
TransactionSynchronization

clearSynchronization

public static void clearSynchronization()
                                 throws IllegalStateException
Deactivate transaction synchronization for the current thread. Called by the transaction manager on transaction cleanup.

Throws:
IllegalStateException - if synchronization is not active

setCurrentTransactionName

public static void setCurrentTransactionName(String name)
Expose the name of the current transaction, if any. Called by the transaction manager on transaction begin and on cleanup.

Parameters:
name - the name of the transaction, or null to reset it
See Also:
TransactionDefinition.getName()

getCurrentTransactionName

public static String getCurrentTransactionName()
Return the name of the current transaction, or null if none set. To be called by resource management code for optimizations per use case, for example to optimize fetch strategies for specific named transactions.

See Also:
TransactionDefinition.getName()

setCurrentTransactionReadOnly

public static void setCurrentTransactionReadOnly(boolean readOnly)
Expose a read-only flag for the current transaction. Called by the transaction manager on transaction begin and on cleanup.

Parameters:
readOnly - true to mark the current transaction as read-only; false to reset such a read-only marker
See Also:
TransactionDefinition.isReadOnly()

isCurrentTransactionReadOnly

public static boolean isCurrentTransactionReadOnly()
Return whether the current transaction is marked as read-only. To be called by resource management code when preparing a newly created resource (for example, a Hibernate Session).

Note that transaction synchronizations receive the read-only flag as argument for the beforeCommit callback, to be able to suppress change detection on commit. The present method is meant to be used for earlier read-only checks, for example to set the flush mode of a Hibernate Session to "FlushMode.NEVER" upfront.

See Also:
TransactionDefinition.isReadOnly(), TransactionSynchronization.beforeCommit(boolean)

setCurrentTransactionIsolationLevel

public static void setCurrentTransactionIsolationLevel(Integer isolationLevel)
Expose an isolation level for the current transaction. Called by the transaction manager on transaction begin and on cleanup.

Parameters:
isolationLevel - the isolation level to expose, according to the JDBC Connection constants (equivalent to the corresponding Spring TransactionDefinition constants), or null to reset it
See Also:
Connection.TRANSACTION_READ_UNCOMMITTED, Connection.TRANSACTION_READ_COMMITTED, Connection.TRANSACTION_REPEATABLE_READ, Connection.TRANSACTION_SERIALIZABLE, TransactionDefinition.ISOLATION_READ_UNCOMMITTED, TransactionDefinition.ISOLATION_READ_COMMITTED, TransactionDefinition.ISOLATION_REPEATABLE_READ, TransactionDefinition.ISOLATION_SERIALIZABLE, TransactionDefinition.getIsolationLevel()

getCurrentTransactionIsolationLevel

public static Integer getCurrentTransactionIsolationLevel()
Return the isolation level for the current transaction, if any. To be called by resource management code when preparing a newly created resource (for example, a JDBC Connection).

Returns:
the currently exposed isolation level, according to the JDBC Connection constants (equivalent to the corresponding Spring TransactionDefinition constants), or null if none
See Also:
Connection.TRANSACTION_READ_UNCOMMITTED, Connection.TRANSACTION_READ_COMMITTED, Connection.TRANSACTION_REPEATABLE_READ, Connection.TRANSACTION_SERIALIZABLE, TransactionDefinition.ISOLATION_READ_UNCOMMITTED, TransactionDefinition.ISOLATION_READ_COMMITTED, TransactionDefinition.ISOLATION_REPEATABLE_READ, TransactionDefinition.ISOLATION_SERIALIZABLE, TransactionDefinition.getIsolationLevel()

setActualTransactionActive

public static void setActualTransactionActive(boolean active)
Expose whether there currently is an actual transaction active. Called by the transaction manager on transaction begin and on cleanup.

Parameters:
active - true to mark the current thread as being associated with an actual transaction; false to reset that marker

isActualTransactionActive

public static boolean isActualTransactionActive()
Return whether there currently is an actual transaction active. This indicates whether the current thread is associated with an actual transaction rather than just with active transaction synchronization.

To be called by resource management code that wants to discriminate between active transaction synchronization (with or without backing resource transaction; also on PROPAGATION_SUPPORTS) and an actual transaction being active (with backing resource transaction; on PROPAGATION_REQUIRES, PROPAGATION_REQUIRES_NEW, etc).

See Also:
isSynchronizationActive()

clear

public static void clear()
Clear the entire transaction synchronization state for the current thread: registered synchronizations as well as the various transaction characteristics.

See Also:
clearSynchronization(), setCurrentTransactionName(java.lang.String), setCurrentTransactionReadOnly(boolean), setCurrentTransactionIsolationLevel(java.lang.Integer), setActualTransactionActive(boolean)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionSynchronizationUtils

org.springframework.transaction.support
Class TransactionSynchronizationUtils

java.lang.Object
    extended by  org.springframework.transaction.support.TransactionSynchronizationUtils

public abstract class TransactionSynchronizationUtils
extends Object

Utility methods for triggering specific TransactionSynchronization callback methods on all currently registered synchronizations.

Since:
2.0
Author:
Juergen Hoeller
See Also:
TransactionSynchronization, TransactionSynchronizationManager.getSynchronizations()

Constructor Summary
TransactionSynchronizationUtils()
Method Summary
static void | invokeAfterCommit(List<TransactionSynchronization> synchronizations) Actually invoke the afterCommit methods of the given Spring TransactionSynchronization objects.
static void | invokeAfterCompletion(List<TransactionSynchronization> synchronizations, int completionStatus) Actually invoke the afterCompletion methods of the given Spring TransactionSynchronization objects.
static boolean | sameResourceFactory(ResourceTransactionManager tm, Object resourceFactory) Check whether the given resource transaction managers refers to the given (underlying) resource factory.
static void | triggerAfterCommit() Trigger afterCommit callbacks on all currently registered synchronizations.
static void | triggerAfterCompletion(int completionStatus) Trigger afterCompletion callbacks on all currently registered synchronizations.
static void | triggerBeforeCommit(boolean readOnly) Trigger beforeCommit callbacks on all currently registered synchronizations.
static void | triggerBeforeCompletion() Trigger beforeCompletion callbacks on all currently registered synchronizations.
static void | triggerFlush() Trigger flush callbacks on all currently registered synchronizations.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TransactionSynchronizationUtils

public TransactionSynchronizationUtils()
Method Detail

sameResourceFactory

public static boolean sameResourceFactory(ResourceTransactionManager tm,
                                          Object resourceFactory)
Check whether the given resource transaction managers refers to the given (underlying) resource factory.

See Also:
ResourceTransactionManager.getResourceFactory(), InfrastructureProxy.getWrappedObject()

triggerFlush

public static void triggerFlush()
Trigger flush callbacks on all currently registered synchronizations.

Throws:
RuntimeException - if thrown by a flush callback
See Also:
TransactionSynchronization.flush()

triggerBeforeCommit

public static void triggerBeforeCommit(boolean readOnly)
Trigger beforeCommit callbacks on all currently registered synchronizations.

Parameters:
readOnly - whether the transaction is defined as read-only transaction
Throws:
RuntimeException - if thrown by a beforeCommit callback
See Also:
TransactionSynchronization.beforeCommit(boolean)

triggerBeforeCompletion

public static void triggerBeforeCompletion()
Trigger beforeCompletion callbacks on all currently registered synchronizations.

See Also:
TransactionSynchronization.beforeCompletion()

triggerAfterCommit

public static void triggerAfterCommit()
Trigger afterCommit callbacks on all currently registered synchronizations.

Throws:
RuntimeException - if thrown by a afterCommit callback
See Also:
TransactionSynchronizationManager.getSynchronizations(), TransactionSynchronization.afterCommit()

invokeAfterCommit

public static void invokeAfterCommit(List<TransactionSynchronization> synchronizations)
Actually invoke the afterCommit methods of the given Spring TransactionSynchronization objects.

Parameters:
synchronizations - List of TransactionSynchronization objects
See Also:
TransactionSynchronization.afterCommit()

triggerAfterCompletion

public static void triggerAfterCompletion(int completionStatus)
Trigger afterCompletion callbacks on all currently registered synchronizations.

Parameters:
completionStatus - the completion status according to the constants in the TransactionSynchronization interface
See Also:
TransactionSynchronizationManager.getSynchronizations(), TransactionSynchronization.afterCompletion(int), TransactionSynchronization.STATUS_COMMITTED, TransactionSynchronization.STATUS_ROLLED_BACK, TransactionSynchronization.STATUS_UNKNOWN

invokeAfterCompletion

public static void invokeAfterCompletion(List<TransactionSynchronization> synchronizations,
                                         int completionStatus)
Actually invoke the afterCompletion methods of the given Spring TransactionSynchronization objects.

Parameters:
synchronizations - List of TransactionSynchronization objects
completionStatus - the completion status according to the constants in the TransactionSynchronization interface
See Also:
TransactionSynchronization.afterCompletion(int), TransactionSynchronization.STATUS_COMMITTED, TransactionSynchronization.STATUS_ROLLED_BACK, TransactionSynchronization.STATUS_UNKNOWN
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionTemplate

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.transaction.support
Class TransactionTemplate

java.lang.Object
    extended by  org.springframework.transaction.support.DefaultTransactionDefinition
        extended by  org.springframework.transaction.support.TransactionTemplate
All Implemented Interfaces:
Serializable, InitializingBean, TransactionOperations, TransactionDefinition
public class TransactionTemplate
extends DefaultTransactionDefinition
implements TransactionOperations, InitializingBean

Template class that simplifies programmatic transaction demarcation and transaction exception handling.

The central method is execute(org.springframework.transaction.support.TransactionCallback), supporting transactional code that implements the TransactionCallback interface. This template handles the transaction lifecycle and possible exceptions such that neither the TransactionCallback implementation nor the calling code needs to explicitly handle transactions.

Typical usage: Allows for writing low-level data access objects that use resources such as JDBC DataSources but are not transaction-aware themselves. Instead, they can implicitly participate in transactions handled by higher-level application services utilizing this class, making calls to the low-level services via an inner-class callback object.

Can be used within a service implementation via direct instantiation with a transaction manager reference, or get prepared in an application context and passed to services as bean reference. Note: The transaction manager should always be configured as bean in the application context: in the first case given to the service directly, in the second case given to the prepared template.

Supports setting the propagation behavior and the isolation level by name, for convenient configuration in context definitions.

Since:
17.03.2003
Author:
Juergen Hoeller
See Also:
execute(org.springframework.transaction.support.TransactionCallback), setTransactionManager(org.springframework.transaction.PlatformTransactionManager), PlatformTransactionManager, Serialized Form

Field Summary
protected  Log logger
Logger available to subclasses
Fields inherited from class org.springframework.transaction.support.DefaultTransactionDefinition
PREFIX_ISOLATION, PREFIX_PROPAGATION, PREFIX_TIMEOUT, READ_ONLY_MARKER
Fields inherited from interface org.springframework.transaction.TransactionDefinition
ISOLATION_DEFAULT, ISOLATION_READ_COMMITTED, ISOLATION_READ_UNCOMMITTED, ISOLATION_REPEATABLE_READ, ISOLATION_SERIALIZABLE, PROPAGATION_MANDATORY, PROPAGATION_NESTED, PROPAGATION_NEVER, PROPAGATION_NOT_SUPPORTED, PROPAGATION_REQUIRED, PROPAGATION_REQUIRES_NEW, PROPAGATION_SUPPORTS, TIMEOUT_DEFAULT
Constructor Summary
TransactionTemplate()
Construct a new TransactionTemplate for bean usage.
TransactionTemplate(PlatformTransactionManager transactionManager)
Construct a new TransactionTemplate using the given transaction manager.
TransactionTemplate(PlatformTransactionManager transactionManager, TransactionDefinition transactionDefinition)
Construct a new TransactionTemplate using the given transaction manager, taking its default settings from the given transaction definition.
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
<T> T
execute(TransactionCallback<T> action)
Execute the action specified by the given callback object within a transaction.
 PlatformTransactionManager getTransactionManager()
Return the transaction management strategy to be used.
 void setTransactionManager(PlatformTransactionManager transactionManager)
Set the transaction management strategy to be used.
Methods inherited from class org.springframework.transaction.support.DefaultTransactionDefinition
equals, getDefinitionDescription, getIsolationLevel, getName, getPropagationBehavior, getTimeout, hashCode, isReadOnly, setIsolationLevel, setIsolationLevelName, setName, setPropagationBehavior, setPropagationBehaviorName, setReadOnly, setTimeout, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

TransactionTemplate

public TransactionTemplate()
Construct a new TransactionTemplate for bean usage.

Note: The PlatformTransactionManager needs to be set before any execute calls.

See Also:
setTransactionManager(org.springframework.transaction.PlatformTransactionManager)

TransactionTemplate

public TransactionTemplate(PlatformTransactionManager transactionManager)
Construct a new TransactionTemplate using the given transaction manager.

Parameters:
transactionManager - the transaction management strategy to be used

TransactionTemplate

public TransactionTemplate(PlatformTransactionManager transactionManager,
                           TransactionDefinition transactionDefinition)
Construct a new TransactionTemplate using the given transaction manager, taking its default settings from the given transaction definition.

Parameters:
transactionManager - the transaction management strategy to be used
transactionDefinition - the transaction definition to copy the default settings from. Local properties can still be set to change values.
Method Detail

setTransactionManager

public void setTransactionManager(PlatformTransactionManager transactionManager)
Set the transaction management strategy to be used.

getTransactionManager

public PlatformTransactionManager getTransactionManager()
Return the transaction management strategy to be used.

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

execute

public <T> T execute(TransactionCallback<T> action)
          throws TransactionException
Description copied from interface: TransactionOperations
Execute the action specified by the given callback object within a transaction.

Allows for returning a result object created within the transaction, that is, a domain object or a collection of domain objects. A RuntimeException thrown by the callback is treated as a fatal exception that enforces a rollback. Such an exception gets propagated to the caller of the template.

Specified by:
execute in interface TransactionOperations
Parameters:
action - the callback object that specifies the transactional action
Returns:
a result object returned by the callback, or null if none
Throws:
TransactionException - in case of initialization, rollback, or system errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.ui

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.ui

Generic support for UI layer concepts.

See:
Description

Interface Summary
Model Java-5-specific interface that defines a holder for model attributes.

Class Summary
ExtendedModelMap | Subclass of ModelMap that implements the Model interface.
ModelMap | Implementation of Map for use when building model data for use with UI tools.

Package org.springframework.ui Description

Generic support for UI layer concepts. Provides a generic ModelMap for model holding.


org.springframework.ui Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.ui

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.util.AbstractMap<K,V> (implements java.util.Map<K,V>)
      • java.util.HashMap<K,V> (implements java.lang.Cloneable, java.util.Map<K,V>, java.io.Serializable)
        • java.util.LinkedHashMap<K,V> (implements java.util.Map<K,V>)
          • org.springframework.ui.ModelMap
            • org.springframework.ui.ExtendedModelMap (implements org.springframework.ui.Model)

Interface Hierarchy

  • org.springframework.ui.Model


Model

org.springframework.ui
Interface Model

All Known Implementing Classes:
BindingAwareModelMap, ExtendedModelMap
public interface Model

Java-5-specific interface that defines a holder for model attributes. Primarily designed for adding attributes to the model. Allows for accessing the overall model as a java.util.Map.

Since:
2.5.1
Author:
Juergen Hoeller

Method Summary
Model | addAllAttributes(Collection<?> attributeValues) Copy all attributes in the supplied Collection into this Map, using attribute name generation for each element.
Model | addAllAttributes(Map<String,?> attributes) Copy all attributes in the supplied Map into this Map.
Model | addAttribute(Object attributeValue) Add the supplied attribute to this Map using a generated name.
Model | addAttribute(String attributeName, Object attributeValue) Add the supplied attribute under the supplied name.
Map<String,Object> | asMap() Return the current set of model attributes as a Map.
boolean | containsAttribute(String attributeName) Does this model contain an attribute of the given name?
Model | mergeAttributes(Map<String,?> attributes) Copy all attributes in the supplied Map into this Map, with existing objects of the same name taking precedence (i.e.

Method Detail

addAttribute

Model addAttribute(String attributeName,
                   Object attributeValue)
Add the supplied attribute under the supplied name.

Parameters:
attributeName - the name of the model attribute (never null)
attributeValue - the model attribute value (can be null)

addAttribute

Model addAttribute(Object attributeValue)
Add the supplied attribute to this Map using a generated name.

Note: Empty Collections are not added to the model when using this method because we cannot correctly determine the true convention name. View code should check for null rather than for empty collections as is already done by JSTL tags.

Parameters:
attributeValue - the model attribute value (never null)

addAllAttributes

Model addAllAttributes(Collection<?> attributeValues)
Copy all attributes in the supplied Collection into this Map, using attribute name generation for each element.

See Also:
addAttribute(Object)

addAllAttributes

Model addAllAttributes(Map<String,?> attributes)
Copy all attributes in the supplied Map into this Map.

See Also:
addAttribute(String, Object)

mergeAttributes

Model mergeAttributes(Map<String,?> attributes)
Copy all attributes in the supplied Map into this Map, with existing objects of the same name taking precedence (i.e. not getting replaced).

containsAttribute

boolean containsAttribute(String attributeName)
Does this model contain an attribute of the given name?

Parameters:
attributeName - the name of the model attribute (never null)
Returns:
whether this model contains a corresponding attribute

asMap

Map<String,Object> asMap()
Return the current set of model attributes as a Map.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ExtendedModelMap

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.ui
Class ExtendedModelMap

java.lang.Object
    extended by  java.util.AbstractMap<K,V>
        extended by  java.util.HashMap<K,V>
            extended by  java.util.LinkedHashMap<String,Object>
                extended by  org.springframework.ui.ModelMap
                    extended by  org.springframework.ui.ExtendedModelMap
All Implemented Interfaces:
Serializable, Cloneable, Map<String,Object>, Model
Direct Known Subclasses:
BindingAwareModelMap
public class ExtendedModelMap
extends ModelMap
implements Model

Subclass of ModelMap that implements the Model interface. Java 5 specific like the Model interface itself.

Since:
2.5.1
Author:
Juergen Hoeller
See Also:
Serialized Form

Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor Summary
ExtendedModelMap()
Method Summary
ExtendedModelMap | addAllAttributes(Collection<?> attributeValues) Copy all attributes in the supplied Collection into this Map, using attribute name generation for each element.
ExtendedModelMap | addAllAttributes(Map<String,?> attributes) Copy all attributes in the supplied Map into this Map.
ExtendedModelMap | addAttribute(Object attributeValue) Add the supplied attribute to this Map using a generated name.
ExtendedModelMap | addAttribute(String attributeName, Object attributeValue) Add the supplied attribute under the supplied name.
Map<String,Object> | asMap() Return the current set of model attributes as a Map.
ExtendedModelMap | mergeAttributes(Map<String,?> attributes) Copy all attributes in the supplied Map into this Map, with existing objects of the same name taking precedence (i.e.
Methods inherited from class org.springframework.ui.ModelMap
addAllObjects, addAllObjects, addObject, addObject, containsAttribute
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, get, removeEldestEntry
Methods inherited from class java.util.HashMap
clone, containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.ui.Model
containsAttribute
Methods inherited from interface java.util.Map
containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values

Constructor Detail

ExtendedModelMap

public ExtendedModelMap()
Method Detail

addAttribute

public ExtendedModelMap addAttribute(String attributeName,
                                     Object attributeValue)
Description copied from class: ModelMap
Add the supplied attribute under the supplied name.

Specified by:
addAttribute in interface Model
Overrides:
addAttribute in class ModelMap
Parameters:
attributeName - the name of the model attribute (never null)
attributeValue - the model attribute value (can be null)

addAttribute

public ExtendedModelMap addAttribute(Object attributeValue)
Description copied from class: ModelMap
Add the supplied attribute to this Map using a generated name.

Note: Empty Collections are not added to the model when using this method because we cannot correctly determine the true convention name. View code should check for null rather than for empty collections as is already done by JSTL tags.

Specified by:
addAttribute in interface Model
Overrides:
addAttribute in class ModelMap
Parameters:
attributeValue - the model attribute value (never null)

addAllAttributes

public ExtendedModelMap addAllAttributes(Collection<?> attributeValues)
Description copied from class: ModelMap
Copy all attributes in the supplied Collection into this Map, using attribute name generation for each element.

Specified by:
addAllAttributes in interface Model
Overrides:
addAllAttributes in class ModelMap
See Also:
ModelMap.addAttribute(Object)

addAllAttributes

public ExtendedModelMap addAllAttributes(Map<String,?> attributes)
Description copied from class: ModelMap
Copy all attributes in the supplied Map into this Map.

Specified by:
addAllAttributes in interface Model
Overrides:
addAllAttributes in class ModelMap
See Also:
ModelMap.addAttribute(String, Object)

mergeAttributes

public ExtendedModelMap mergeAttributes(Map<String,?> attributes)
Description copied from class: ModelMap
Copy all attributes in the supplied Map into this Map, with existing objects of the same name taking precedence (i.e. not getting replaced).

Specified by:
mergeAttributes in interface Model
Overrides:
mergeAttributes in class ModelMap

asMap

public Map<String,Object> asMap()
Description copied from interface: Model
Return the current set of model attributes as a Map.

Specified by:
asMap in interface Model
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ModelMap

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.ui
Class ModelMap

java.lang.Object
    extended by  java.util.AbstractMap<K,V>
        extended by  java.util.HashMap<K,V>
            extended by  java.util.LinkedHashMap<String,Object>
                extended by  org.springframework.ui.ModelMap
All Implemented Interfaces:
Serializable, Cloneable, Map<String,Object>
Direct Known Subclasses:
ExtendedModelMap
public class ModelMap
extends LinkedHashMap<String,Object>

Implementation of Map for use when building model data for use with UI tools. Supports chained calls and generation of model attribute names.

This class serves as generic model holder for both Servlet and Portlet MVC, but is not tied to either of those. Check out the Model interface for a Java-5-based interface variant that serves the same purpose.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
See Also:
Conventions.getVariableName(java.lang.Object), ModelAndView, ModelAndView, Serialized Form

Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor Summary
ModelMap()
Construct a new, empty ModelMap.
ModelMap(Object attributeValue)
Construct a new ModelMap containing the supplied attribute.
ModelMap(String attributeName, Object attributeValue)
Construct a new ModelMap containing the supplied attribute under the supplied name.
Method Summary
 ModelMap addAllAttributes(Collection<?> attributeValues)
Copy all attributes in the supplied Collection into this Map, using attribute name generation for each element.
 ModelMap addAllAttributes(Map<String,?> attributes)
Copy all attributes in the supplied Map into this Map.
 ModelMap addAllObjects(Collection objects)
Deprecated. as of Spring 2.5, in favor of addAllAttributes(Collection)
 ModelMap addAllObjects(Map objects)
Deprecated. as of Spring 2.5, in favor of addAllAttributes(Map)
 ModelMap addAttribute(Object attributeValue)
Add the supplied attribute to this Map using a generated name.
 ModelMap addAttribute(String attributeName, Object attributeValue)
Add the supplied attribute under the supplied name.
 ModelMap addObject(Object modelObject)
Deprecated. as of Spring 2.5, in favor of addAttribute(Object)
 ModelMap addObject(String modelName, Object modelObject)
Deprecated. as of Spring 2.5, in favor of addAttribute(String, Object)
 boolean containsAttribute(String attributeName)
Does this model contain an attribute of the given name?
 ModelMap mergeAttributes(Map<String,?> attributes)
Copy all attributes in the supplied Map into this Map, with existing objects of the same name taking precedence (i.e.
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, get, removeEldestEntry
Methods inherited from class java.util.HashMap
clone, containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values

Constructor Detail

ModelMap

public ModelMap()
Construct a new, empty ModelMap.

ModelMap

public ModelMap(String attributeName,
                Object attributeValue)
Construct a new ModelMap containing the supplied attribute under the supplied name.

See Also:
addAttribute(String, Object)

ModelMap

public ModelMap(Object attributeValue)
Construct a new ModelMap containing the supplied attribute. Uses attribute name generation to generate the key for the supplied model object.

See Also:
addAttribute(Object)
Method Detail

addAttribute

public ModelMap addAttribute(String attributeName,
                             Object attributeValue)
Add the supplied attribute under the supplied name.

Parameters:
attributeName - the name of the model attribute (never null)
attributeValue - the model attribute value (can be null)

addAttribute

public ModelMap addAttribute(Object attributeValue)
Add the supplied attribute to this Map using a generated name.

Note: Empty Collections are not added to the model when using this method because we cannot correctly determine the true convention name. View code should check for null rather than for empty collections as is already done by JSTL tags.

Parameters:
attributeValue - the model attribute value (never null)

addAllAttributes

public ModelMap addAllAttributes(Collection<?> attributeValues)
Copy all attributes in the supplied Collection into this Map, using attribute name generation for each element.

See Also:
addAttribute(Object)

addAllAttributes

public ModelMap addAllAttributes(Map<String,?> attributes)
Copy all attributes in the supplied Map into this Map.

See Also:
addAttribute(String, Object)

mergeAttributes

public ModelMap mergeAttributes(Map<String,?> attributes)
Copy all attributes in the supplied Map into this Map, with existing objects of the same name taking precedence (i.e. not getting replaced).

containsAttribute

public boolean containsAttribute(String attributeName)
Does this model contain an attribute of the given name?

Parameters:
attributeName - the name of the model attribute (never null)
Returns:
whether this model contains a corresponding attribute

addObject

@Deprecated
public ModelMap addObject(String modelName,
                                     Object modelObject)
Deprecated. as of Spring 2.5, in favor of addAttribute(String, Object)

addObject

@Deprecated
public ModelMap addObject(Object modelObject)
Deprecated. as of Spring 2.5, in favor of addAttribute(Object)

addAllObjects

@Deprecated
public ModelMap addAllObjects(Collection objects)
Deprecated. as of Spring 2.5, in favor of addAllAttributes(Collection)

addAllObjects

@Deprecated
public ModelMap addAllObjects(Map objects)
Deprecated. as of Spring 2.5, in favor of addAllAttributes(Map)

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.ui.context

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.ui.context

Contains classes defining the application context subinterface for UI applications.

See:
Description

Interface Summary
HierarchicalThemeSource | Sub-interface of ThemeSource to be implemented by objects that can resolve theme messages hierarchically.
Theme | A Theme can resolve theme-specific messages, codes, file paths, etcetera (e.g. CSS and image files in a web environment).
ThemeSource | Interface to be implemented by objects that can resolve Themes.

Package org.springframework.ui.context Description

Contains classes defining the application context subinterface for UI applications. The theme feature is added here.

  • If no UiApplicationContextUtils.THEME_SOURCE_BEAN_NAME bean is available in the context or parent context, a default ResourceBundleThemeSource will be created for requested themes. In this case, the base name of the property file will match with the theme name.
  • If the bean is available in the context or parent context, a basenamePrefix can be set before the theme name for locating the property files like this:
    <bean id="themeSource" class="org.springframework.ui.context.support.ResourceBundleThemeSource">
    <property name="basenamePrefix"><value>theme.</value></property>
    </bean>
    in this case, the themes resource bundles will be named theme.<theme_name>XXX.properties.
  • This can be defined at application level and/or at servlet level for web applications.
  • Normal i18n features of Resource Bundles are available. So a theme message can be dependant of both theme and locale.
  • If messages in the resource bundles are in fact paths to resources(css, images, ...), make sure these resources are directly available for the user and not, for example, under the WEB-INF directory.

Web packages add the resolution and the setting of the user current theme.


org.springframework.ui.context Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.ui.context

Package Hierarchies:
All Packages

Interface Hierarchy

  • org.springframework.ui.context.Theme
  • org.springframework.ui.context.ThemeSource
    • org.springframework.ui.context.HierarchicalThemeSource


HierarchicalThemeSource

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.ui.context
Interface HierarchicalThemeSource

All Superinterfaces:
ThemeSource
All Known Implementing Classes:
DelegatingThemeSource, ResourceBundleThemeSource
public interface HierarchicalThemeSource
extends ThemeSource

Sub-interface of ThemeSource to be implemented by objects that can resolve theme messages hierarchically.

Author:
Jean-Pierre Pawlak, Juergen Hoeller

Method Summary
ThemeSource | getParentThemeSource() Return the parent of this ThemeSource, or null if none.
void | setParentThemeSource(ThemeSource parent) Set the parent that will be used to try to resolve theme messages that this object can't resolve.
Methods inherited from interface org.springframework.ui.context.ThemeSource
getTheme

Method Detail

setParentThemeSource

void setParentThemeSource(ThemeSource parent)
Set the parent that will be used to try to resolve theme messages that this object can't resolve.

Parameters:
parent - the parent ThemeSource that will be used to resolve messages that this object can't resolve. May be null, in which case no further resolution is possible.

getParentThemeSource

ThemeSource getParentThemeSource()
Return the parent of this ThemeSource, or null if none.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


Theme

org.springframework.ui.context
Interface Theme

All Known Implementing Classes:
SimpleTheme
public interface Theme

A Theme can resolve theme-specific messages, codes, file paths, etcetera (e.g. CSS and image files in a web environment). The exposed MessageSource supports theme-specific parameterization and internationalization.

Since:
17.06.2003
Author:
Juergen Hoeller
See Also:
ThemeSource, ThemeResolver

Method Summary
MessageSource | getMessageSource() Return the specific MessageSource that resolves messages with respect to this theme.
String | getName() Return the name of the theme.

Method Detail

getName

String getName()
Return the name of the theme.

Returns:
the name of the theme (never null)

getMessageSource

MessageSource getMessageSource()
Return the specific MessageSource that resolves messages with respect to this theme.

Returns:
the theme-specific MessageSource (never null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ThemeSource

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.ui.context
Interface ThemeSource

All Known Subinterfaces:
HierarchicalThemeSource
All Known Implementing Classes:
AbstractRefreshableWebApplicationContext, AnnotationConfigWebApplicationContext, DelegatingThemeSource, GenericWebApplicationContext, ResourceBundleThemeSource, StaticWebApplicationContext, XmlWebApplicationContext
public interface ThemeSource

Interface to be implemented by objects that can resolve Themes. This enables parameterization and internationalization of messages for a given 'theme'.

Author:
Jean-Pierre Pawlak, Juergen Hoeller
See Also:
Theme

Method Summary
 Theme getTheme(String themeName)
Return the Theme instance for the given theme name.

Method Detail

getTheme

Theme getTheme(String themeName)
Return the Theme instance for the given theme name.

The returned Theme will resolve theme-specific messages, codes, file paths, etc (e.g. CSS and image files in a web environment).

Parameters:
themeName - the name of the theme
Returns:
the corresponding Theme, or null if none defined. Note that, by convention, a ThemeSource should at least be able to return a default Theme for the default theme name "theme" but may also return default Themes for other theme names.
See Also:
AbstractThemeResolver.ORIGINAL_DEFAULT_THEME_NAME
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.ui.context.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.ui.context.support

Classes supporting the org.springframework.ui.context package.

See:
Description

Class Summary
DelegatingThemeSource | Empty ThemeSource that delegates all calls to the parent ThemeSource.
ResourceBundleThemeSource | ThemeSource implementation that looks up an individual ResourceBundle per theme.
SimpleTheme | Default Theme implementation, wrapping a name and an underlying MessageSource.
UiApplicationContextUtils | Utility class for UI application context implementations.

Package org.springframework.ui.context.support Description

Classes supporting the org.springframework.ui.context package. Provides support classes for specialized UI contexts, e.g. for web UIs.


org.springframework.ui.context.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.ui.context.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.ui.context.support.DelegatingThemeSource (implements org.springframework.ui.context.HierarchicalThemeSource)
    • org.springframework.ui.context.support.ResourceBundleThemeSource (implements org.springframework.ui.context.HierarchicalThemeSource)
    • org.springframework.ui.context.support.SimpleTheme (implements org.springframework.ui.context.Theme)
    • org.springframework.ui.context.support.UiApplicationContextUtils


DelegatingThemeSource

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.ui.context.support
Class DelegatingThemeSource

java.lang.Object
    extended by  org.springframework.ui.context.support.DelegatingThemeSource
All Implemented Interfaces:
HierarchicalThemeSource, ThemeSource
public class DelegatingThemeSource
extends Object
implements HierarchicalThemeSource

Empty ThemeSource that delegates all calls to the parent ThemeSource. If no parent is available, it simply won't resolve any theme.

Used as placeholder by UiApplicationContextUtils, if a context doesn't define its own ThemeSource. Not intended for direct use in applications.

Since:
1.2.4
Author:
Juergen Hoeller
See Also:
UiApplicationContextUtils

Constructor Summary
DelegatingThemeSource()
Method Summary
ThemeSource | getParentThemeSource() Return the parent of this ThemeSource, or null if none.
Theme | getTheme(String themeName) Return the Theme instance for the given theme name.
void | setParentThemeSource(ThemeSource parentThemeSource) Set the parent that will be used to try to resolve theme messages that this object can't resolve.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DelegatingThemeSource

public DelegatingThemeSource()
Method Detail

setParentThemeSource

public void setParentThemeSource(ThemeSource parentThemeSource)
Description copied from interface: HierarchicalThemeSource
Set the parent that will be used to try to resolve theme messages that this object can't resolve.

Specified by:
setParentThemeSource in interface HierarchicalThemeSource
Parameters:
parentThemeSource - the parent ThemeSource that will be used to resolve messages that this object can't resolve. May be null, in which case no further resolution is possible.

getParentThemeSource

public ThemeSource getParentThemeSource()
Description copied from interface: HierarchicalThemeSource
Return the parent of this ThemeSource, or null if none.

Specified by:
getParentThemeSource in interface HierarchicalThemeSource

getTheme

public Theme getTheme(String themeName)
Description copied from interface: ThemeSource
Return the Theme instance for the given theme name.

The returned Theme will resolve theme-specific messages, codes, file paths, etc (e.g. CSS and image files in a web environment).

Specified by:
getTheme in interface ThemeSource
Parameters:
themeName - the name of the theme
Returns:
the corresponding Theme, or null if none defined. Note that, by convention, a ThemeSource should at least be able to return a default Theme for the default theme name "theme" but may also return default Themes for other theme names.
See Also:
AbstractThemeResolver.ORIGINAL_DEFAULT_THEME_NAME
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ResourceBundleThemeSource

org.springframework.ui.context.support
Class ResourceBundleThemeSource

java.lang.Object
    extended by  org.springframework.ui.context.support.ResourceBundleThemeSource
All Implemented Interfaces:
HierarchicalThemeSource, ThemeSource
public class ResourceBundleThemeSource
extends Object
implements HierarchicalThemeSource

ThemeSource implementation that looks up an individual ResourceBundle per theme. The theme name gets interpreted as ResourceBundle basename, supporting a common basename prefix for all themes.

Author:
Jean-Pierre Pawlak, Juergen Hoeller
See Also:
setBasenamePrefix(java.lang.String), ResourceBundle, ResourceBundleMessageSource

Field Summary
protected  Log logger
Constructor Summary
ResourceBundleThemeSource()
Method Summary
protected MessageSource | createMessageSource(String basename) Create a MessageSource for the given basename, to be used as MessageSource for the corresponding theme.
ThemeSource | getParentThemeSource() Return the parent of this ThemeSource, or null if none.
Theme | getTheme(String themeName) This implementation returns a SimpleTheme instance, holding a ResourceBundle-based MessageSource whose basename corresponds to the given theme name (prefixed by the configured "basenamePrefix").
protected void | initParent(Theme theme) Initialize the MessageSource of the given theme with the one from the corresponding parent of this ThemeSource.
void | setBasenamePrefix(String basenamePrefix) Set the prefix that gets applied to the ResourceBundle basenames, i.e.
void | setParentThemeSource(ThemeSource parent) Set the parent that will be used to try to resolve theme messages that this object can't resolve.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Constructor Detail

ResourceBundleThemeSource

public ResourceBundleThemeSource()
Method Detail

setParentThemeSource

public void setParentThemeSource(ThemeSource parent)
Description copied from interface: HierarchicalThemeSource
Set the parent that will be used to try to resolve theme messages that this object can't resolve.

Specified by:
setParentThemeSource in interface HierarchicalThemeSource
Parameters:
parent - the parent ThemeSource that will be used to resolve messages that this object can't resolve. May be null, in which case no further resolution is possible.

getParentThemeSource

public ThemeSource getParentThemeSource()
Description copied from interface: HierarchicalThemeSource
Return the parent of this ThemeSource, or null if none.

Specified by:
getParentThemeSource in interface HierarchicalThemeSource

setBasenamePrefix

public void setBasenamePrefix(String basenamePrefix)
Set the prefix that gets applied to the ResourceBundle basenames, i.e. the theme names. E.g.: basenamePrefix="test.", themeName="theme" -> basename="test.theme".

Note that ResourceBundle names are effectively classpath locations: As a consequence, the JDK's standard ResourceBundle treats dots as package separators. This means that "test.theme" is effectively equivalent to "test/theme", just like it is for programmatic java.util.ResourceBundle usage.

See Also:
ResourceBundle.getBundle(String)

getTheme

public Theme getTheme(String themeName)
This implementation returns a SimpleTheme instance, holding a ResourceBundle-based MessageSource whose basename corresponds to the given theme name (prefixed by the configured "basenamePrefix").

SimpleTheme instances are cached per theme name. Use a reloadable MessageSource if themes should reflect changes to the underlying files.

Specified by:
getTheme in interface ThemeSource
Parameters:
themeName - the name of the theme
Returns:
the corresponding Theme, or null if none defined. Note that, by convention, a ThemeSource should at least be able to return a default Theme for the default theme name "theme" but may also return default Themes for other theme names.
See Also:
setBasenamePrefix(java.lang.String), createMessageSource(java.lang.String)

createMessageSource

protected MessageSource createMessageSource(String basename)
Create a MessageSource for the given basename, to be used as MessageSource for the corresponding theme.

Default implementation creates a ResourceBundleMessageSource. for the given basename. A subclass could create a specifically configured ReloadableResourceBundleMessageSource, for example.

Parameters:
basename - the basename to create a MessageSource for
Returns:
the MessageSource
See Also:
ResourceBundleMessageSource, ReloadableResourceBundleMessageSource

initParent

protected void initParent(Theme theme)
Initialize the MessageSource of the given theme with the one from the corresponding parent of this ThemeSource.

Parameters:
theme - the Theme to (re-)initialize
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleTheme

org.springframework.ui.context.support
Class SimpleTheme

java.lang.Object
    extended by  org.springframework.ui.context.support.SimpleTheme
All Implemented Interfaces:
Theme
public class SimpleTheme
extends Object
implements Theme

Default Theme implementation, wrapping a name and an underlying MessageSource.

Since:
17.06.2003
Author:
Juergen Hoeller

Constructor Summary
SimpleTheme(String name, MessageSource messageSource)
Create a SimpleTheme.
Method Summary
MessageSource | getMessageSource() Return the specific MessageSource that resolves messages with respect to this theme.
String | getName() Return the name of the theme.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleTheme

public SimpleTheme(String name,
                   MessageSource messageSource)
Create a SimpleTheme.

Parameters:
name - the name of the theme
messageSource - the MessageSource that resolves theme messages
Method Detail

getName

public final String getName()
Description copied from interface: Theme
Return the name of the theme.

Specified by:
getName in interface Theme
Returns:
the name of the theme (never null)

getMessageSource

public final MessageSource getMessageSource()
Description copied from interface: Theme
Return the specific MessageSource that resolves messages with respect to this theme.

Specified by:
getMessageSource in interface Theme
Returns:
the theme-specific MessageSource (never null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UiApplicationContextUtils

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.ui.context.support
Class UiApplicationContextUtils

java.lang.Object
    extended by  org.springframework.ui.context.support.UiApplicationContextUtils

public abstract class UiApplicationContextUtils
extends Object

Utility class for UI application context implementations. Provides support for a special bean named "themeSource", of type ThemeSource.

Since:
17.06.2003
Author:
Jean-Pierre Pawlak, Juergen Hoeller

Field Summary
static String THEME_SOURCE_BEAN_NAME
Name of the ThemeSource bean in the factory.
Constructor Summary
UiApplicationContextUtils()
Method Summary
static ThemeSource initThemeSource(ApplicationContext context)
Initialize the ThemeSource for the given application context, autodetecting a bean with the name "themeSource".
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

THEME_SOURCE_BEAN_NAME

public static final String THEME_SOURCE_BEAN_NAME
Name of the ThemeSource bean in the factory. If none is supplied, theme resolution is delegated to the parent.

See Also:
ThemeSource, Constant Field Values
Constructor Detail

UiApplicationContextUtils

public UiApplicationContextUtils()
Method Detail

initThemeSource

public static ThemeSource initThemeSource(ApplicationContext context)
Initialize the ThemeSource for the given application context, autodetecting a bean with the name "themeSource". If no such bean is found, a default (empty) ThemeSource will be used.

Parameters:
context - current application context
Returns:
the initialized theme source (will never be null)
See Also:
THEME_SOURCE_BEAN_NAME
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.ui.freemarker

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.ui.freemarker

Support classes for setting up FreeMarker within a Spring application context.

See:
Description

Class Summary
FreeMarkerConfigurationFactory | Factory that configures a FreeMarker Configuration.
FreeMarkerConfigurationFactoryBean | Factory bean that creates a FreeMarker Configuration and provides it as bean reference.
FreeMarkerTemplateUtils | Utility class for working with FreeMarker.
SpringTemplateLoader | FreeMarker TemplateLoader adapter that loads via a Spring ResourceLoader.

Package org.springframework.ui.freemarker Description

Support classes for setting up FreeMarker within a Spring application context.


org.springframework.ui.freemarker Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.ui.freemarker

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
      • org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean, org.springframework.context.ResourceLoaderAware)
    • org.springframework.ui.freemarker.FreeMarkerTemplateUtils
    • org.springframework.ui.freemarker.SpringTemplateLoader (implements freemarker.cache.TemplateLoader)


FreeMarkerConfigurationFactory

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.ui.freemarker
Class FreeMarkerConfigurationFactory

java.lang.Object
    extended by  org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
Direct Known Subclasses:
FreeMarkerConfigurationFactoryBean, FreeMarkerConfigurer
public class FreeMarkerConfigurationFactory
extends Object

Factory that configures a FreeMarker Configuration. Can be used standalone, but typically you will either use FreeMarkerConfigurationFactoryBean for preparing a Configuration as bean reference, or FreeMarkerConfigurer for web views.

The optional "configLocation" property sets the location of a FreeMarker properties file, within the current application. FreeMarker properties can be overridden via "freemarkerSettings". All of these properties will be set by calling FreeMarker's Configuration.setSettings() method and are subject to constraints set by FreeMarker.

The "freemarkerVariables" property can be used to specify a Map of shared variables that will be applied to the Configuration via the setAllSharedVariables() method. Like setSettings(), these entries are subject to FreeMarker constraints.

The simplest way to use this class is to specify a "templateLoaderPath"; FreeMarker does not need any further configuration then.

Note: Spring's FreeMarker support requires FreeMarker 2.3 or higher.

Since:
03.03.2004
Author:
Darren Davison, Juergen Hoeller
See Also:
setConfigLocation(org.springframework.core.io.Resource),
setFreemarkerSettings(java.util.Properties),
setFreemarkerVariables(java.util.Map),
setTemplateLoaderPath(java.lang.String),
createConfiguration(),
FreeMarkerConfigurationFactoryBean,
FreeMarkerConfigurer,
Configuration

Field Summary
protected  Log logger
Constructor Summary
FreeMarkerConfigurationFactory()
Method Summary
 Configuration createConfiguration()
Prepare the FreeMarker Configuration and return it.
protected  TemplateLoader getAggregateTemplateLoader(List<TemplateLoader> templateLoaders)
Return a TemplateLoader based on the given TemplateLoader list.
protected  ResourceLoader getResourceLoader()
Return the Spring ResourceLoader to use for loading FreeMarker template files.
protected  TemplateLoader getTemplateLoaderForPath(String templateLoaderPath)
Determine a FreeMarker TemplateLoader for the given path.
protected  boolean isPreferFileSystemAccess()
Return whether to prefer file system access for template loading.
protected  Configuration newConfiguration()
Return a new Configuration object.
protected  void postProcessConfiguration(Configuration config)
To be overridden by subclasses that want to to perform custom post-processing of the Configuration object after this factory performed its default initialization.
protected  void postProcessTemplateLoaders(List<TemplateLoader> templateLoaders)
To be overridden by subclasses that want to to register custom TemplateLoader instances after this factory created its default template loaders.
 void setConfigLocation(Resource resource)
Set the location of the FreeMarker config file.
 void setDefaultEncoding(String defaultEncoding)
Set the default encoding for the FreeMarker configuration.
 void setFreemarkerSettings(Properties settings)
Set properties that contain well-known FreeMarker keys which will be passed to FreeMarker's Configuration.setSettings method.
 void setFreemarkerVariables(Map<String,Object> variables)
Set a Map that contains well-known FreeMarker objects which will be passed to FreeMarker's Configuration.setAllSharedVariables() method.
 void setPostTemplateLoaders(TemplateLoader[] postTemplateLoaders)
Set a List of TemplateLoaders that will be used to search for templates.
 void setPreferFileSystemAccess(boolean preferFileSystemAccess)
Set whether to prefer file system access for template loading.
 void setPreTemplateLoaders(TemplateLoader[] preTemplateLoaders)
Set a List of TemplateLoaders that will be used to search for templates.
 void setResourceLoader(ResourceLoader resourceLoader)
Set the Spring ResourceLoader to use for loading FreeMarker template files.
 void setTemplateLoaderPath(String templateLoaderPath)
Set the Freemarker template loader path via a Spring resource location.
 void setTemplateLoaderPaths(String[] templateLoaderPaths)
Set multiple Freemarker template loader paths via Spring resource locations.
 void setTemplateLoaders(TemplateLoader[] templateLoaders)
Deprecated. as of Spring 2.0.1, in favor of the "preTemplateLoaders" and "postTemplateLoaders" properties
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Constructor Detail

FreeMarkerConfigurationFactory

public FreeMarkerConfigurationFactory()
Method Detail

setConfigLocation

public void setConfigLocation(Resource resource)
Set the location of the FreeMarker config file. Alternatively, you can specify all setting locally.

See Also:
setFreemarkerSettings(java.util.Properties), setTemplateLoaderPath(java.lang.String)

setFreemarkerSettings

public void setFreemarkerSettings(Properties settings)
Set properties that contain well-known FreeMarker keys which will be passed to FreeMarker's Configuration.setSettings method.

See Also:
Configurable.setSettings(java.util.Properties)

setFreemarkerVariables

public void setFreemarkerVariables(Map<String,Object> variables)
Set a Map that contains well-known FreeMarker objects which will be passed to FreeMarker's Configuration.setAllSharedVariables() method.

See Also:
Configuration.setAllSharedVariables(freemarker.template.TemplateHashModelEx)

setDefaultEncoding

public void setDefaultEncoding(String defaultEncoding)
Set the default encoding for the FreeMarker configuration. If not specified, FreeMarker will use the platform file encoding.

Used for template rendering unless there is an explicit encoding specified for the rendering process (for example, on Spring's FreeMarkerView).

See Also:
Configuration.setDefaultEncoding(java.lang.String), FreeMarkerView.setEncoding(java.lang.String)

setTemplateLoaders

@Deprecated
public void setTemplateLoaders(TemplateLoader[] templateLoaders)
Deprecated. as of Spring 2.0.1, in favor of the "preTemplateLoaders" and "postTemplateLoaders" properties

Set a List of TemplateLoaders that will be used to search for templates. For example, one or more custom loaders such as database loaders could be configured and injected here.

See Also:
setPreTemplateLoaders(freemarker.cache.TemplateLoader[]), setPostTemplateLoaders(freemarker.cache.TemplateLoader[])

setPreTemplateLoaders

public void setPreTemplateLoaders(TemplateLoader[] preTemplateLoaders)
Set a List of TemplateLoaders that will be used to search for templates. For example, one or more custom loaders such as database loaders could be configured and injected here.

The TemplateLoaders specified here will be registered before the default template loaders that this factory registers (such as loaders for specified "templateLoaderPaths" or any loaders registered in postProcessTemplateLoaders(java.util.List)).

See Also:
setTemplateLoaderPaths(java.lang.String[]), postProcessTemplateLoaders(java.util.List)

setPostTemplateLoaders

public void setPostTemplateLoaders(TemplateLoader[] postTemplateLoaders)
Set a List of TemplateLoaders that will be used to search for templates. For example, one or more custom loaders such as database loaders can be configured.

The TemplateLoaders specified here will be registered after the default template loaders that this factory registers (such as loaders for specified "templateLoaderPaths" or any loaders registered in postProcessTemplateLoaders(java.util.List)).

See Also:
setTemplateLoaderPaths(java.lang.String[]), postProcessTemplateLoaders(java.util.List)

setTemplateLoaderPath

public void setTemplateLoaderPath(String templateLoaderPath)
Set the Freemarker template loader path via a Spring resource location. See the "templateLoaderPaths" property for details on path handling.

See Also:
setTemplateLoaderPaths(java.lang.String[])

setTemplateLoaderPaths

public void setTemplateLoaderPaths(String[] templateLoaderPaths)
Set multiple Freemarker template loader paths via Spring resource locations.

When populated via a String, standard URLs like "file:" and "classpath:" pseudo URLs are supported, as understood by ResourceEditor. Allows for relative paths when running in an ApplicationContext.

Will define a path for the default FreeMarker template loader. If a specified resource cannot be resolved to a java.io.File, a generic SpringTemplateLoader will be used, without modification detection.

To enforce the use of SpringTemplateLoader, i.e. to not resolve a path as file system resource in any case, turn off the "preferFileSystemAccess" flag. See the latter's javadoc for details.

If you wish to specify your own list of TemplateLoaders, do not set this property and instead use setTemplateLoaders(List templateLoaders)

See Also:
ResourceEditor, ResourceLoader.getResource(java.lang.String), Configuration.setDirectoryForTemplateLoading(java.io.File), SpringTemplateLoader, setTemplateLoaders(freemarker.cache.TemplateLoader[])

setResourceLoader

public void setResourceLoader(ResourceLoader resourceLoader)
Set the Spring ResourceLoader to use for loading FreeMarker template files. The default is DefaultResourceLoader. Will get overridden by the ApplicationContext if running in a context.

See Also:
DefaultResourceLoader

getResourceLoader

protected ResourceLoader getResourceLoader()
Return the Spring ResourceLoader to use for loading FreeMarker template files.

setPreferFileSystemAccess

public void setPreferFileSystemAccess(boolean preferFileSystemAccess)
Set whether to prefer file system access for template loading. File system access enables hot detection of template changes.

If this is enabled, FreeMarkerConfigurationFactory will try to resolve the specified "templateLoaderPath" as file system resource (which will work for expanded class path resources and ServletContext resources too).

Default is "true". Turn this off to always load via SpringTemplateLoader (i.e. as stream, without hot detection of template changes), which might be necessary if some of your templates reside in an expanded classes directory while others reside in jar files.

See Also:
setTemplateLoaderPath(java.lang.String)

isPreferFileSystemAccess

protected boolean isPreferFileSystemAccess()
Return whether to prefer file system access for template loading.

createConfiguration

public Configuration createConfiguration()
                                  throws IOException,
                                         TemplateException
Prepare the FreeMarker Configuration and return it.

Returns:
the FreeMarker Configuration object
Throws:
IOException - if the config file wasn't found
TemplateException - on FreeMarker initialization failure

newConfiguration

protected Configuration newConfiguration()
                                  throws IOException,
                                         TemplateException
Return a new Configuration object. Subclasses can override this for custom initialization, or for using a mock object for testing.

Called by createConfiguration().

Returns:
the Configuration object
Throws:
IOException - if a config file wasn't found
TemplateException - on FreeMarker initialization failure
See Also:
createConfiguration()

getTemplateLoaderForPath

protected TemplateLoader getTemplateLoaderForPath(String templateLoaderPath)
Determine a FreeMarker TemplateLoader for the given path.

Default implementation creates either a FileTemplateLoader or a SpringTemplateLoader.

Parameters:
templateLoaderPath - the path to load templates from
Returns:
an appropriate TemplateLoader
See Also:
FileTemplateLoader, SpringTemplateLoader

postProcessTemplateLoaders

protected void postProcessTemplateLoaders(List<TemplateLoader> templateLoaders)
To be overridden by subclasses that want to to register custom TemplateLoader instances after this factory created its default template loaders.

Called by createConfiguration(). Note that specified "postTemplateLoaders" will be registered after any loaders registered by this callback; as a consequence, they are are not included in the given List.

Parameters:
templateLoaders - the current List of TemplateLoader instances, to be modified by a subclass
See Also:
createConfiguration(), setPostTemplateLoaders(freemarker.cache.TemplateLoader[])

getAggregateTemplateLoader

protected TemplateLoader getAggregateTemplateLoader(List<TemplateLoader> templateLoaders)
Return a TemplateLoader based on the given TemplateLoader list. If more than one TemplateLoader has been registered, a FreeMarker MultiTemplateLoader needs to be created.

Parameters:
templateLoaders - the final List of TemplateLoader instances
Returns:
the aggregate TemplateLoader

postProcessConfiguration

protected void postProcessConfiguration(Configuration config)
                                 throws IOException,
                                        TemplateException
To be overridden by subclasses that want to to perform custom post-processing of the Configuration object after this factory performed its default initialization.

Called by createConfiguration().

Parameters:
config - the current Configuration object
Throws:
IOException - if a config file wasn't found
TemplateException - on FreeMarker initialization failure
See Also:
createConfiguration()
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS | FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


FreeMarkerConfigurationFactoryBean

org.springframework.ui.freemarker
Class FreeMarkerConfigurationFactoryBean

java.lang.Object
    extended by  org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
        extended by  org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean
All Implemented Interfaces:
FactoryBean<Configuration>, InitializingBean, ResourceLoaderAware
public class FreeMarkerConfigurationFactoryBean
extends FreeMarkerConfigurationFactory
implements FactoryBean<Configuration>, InitializingBean, ResourceLoaderAware

Factory bean that creates a FreeMarker Configuration and provides it as bean reference. This bean is intended for any kind of usage of FreeMarker in application code, e.g. for generating email content. For web views, FreeMarkerConfigurer is used to set up a FreeMarkerConfigurationFactory. The simplest way to use this class is to specify just a "templateLoaderPath"; you do not need any further configuration then. For example, in a web application context:

 <bean id="freemarkerConfiguration" class="org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean">
   <property name="templateLoaderPath" value="/WEB-INF/freemarker/"/>
 </bean>
See the base class FreeMarkerConfigurationFactory for configuration details.

Note: Spring's FreeMarker support requires FreeMarker 2.3 or higher.

Since:
03.03.2004
Author:
Darren Davison
See Also:
FreeMarkerConfigurationFactory.setConfigLocation(org.springframework.core.io.Resource),
FreeMarkerConfigurationFactory.setFreemarkerSettings(java.util.Properties),
FreeMarkerConfigurationFactory.setTemplateLoaderPath(java.lang.String),
FreeMarkerConfigurer

Field Summary
Fields inherited from class org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
logger
Constructor Summary
FreeMarkerConfigurationFactoryBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 Configuration getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<? extends Configuration> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
Methods inherited from class org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
createConfiguration, getAggregateTemplateLoader, getResourceLoader, getTemplateLoaderForPath, isPreferFileSystemAccess, newConfiguration, postProcessConfiguration, postProcessTemplateLoaders, setConfigLocation, setDefaultEncoding, setFreemarkerSettings, setFreemarkerVariables, setPostTemplateLoaders, setPreferFileSystemAccess, setPreTemplateLoaders, setResourceLoader, setTemplateLoaderPath, setTemplateLoaderPaths, setTemplateLoaders
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.context.ResourceLoaderAware
setResourceLoader

Constructor Detail

FreeMarkerConfigurationFactoryBean

public FreeMarkerConfigurationFactoryBean()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws IOException,
                               TemplateException
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
IOException
TemplateException

getObject

public Configuration getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<Configuration>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends Configuration> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<Configuration>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<Configuration>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FreeMarkerTemplateUtils

org.springframework.ui.freemarker
Class FreeMarkerTemplateUtils

java.lang.Object
    extended by  org.springframework.ui.freemarker.FreeMarkerTemplateUtils

public abstract class FreeMarkerTemplateUtils
extends Object

Utility class for working with FreeMarker. Provides convenience methods to process a FreeMarker template with a model.

Since:
14.03.2004
Author:
Juergen Hoeller

Constructor Summary
FreeMarkerTemplateUtils()
Method Summary
static String processTemplateIntoString(Template template, Object model)
Process the specified FreeMarker template with the given model and write the result to the given Writer.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

FreeMarkerTemplateUtils

public FreeMarkerTemplateUtils()
Method Detail

processTemplateIntoString

public static String processTemplateIntoString(Template template,
                                               Object model)
                                        throws IOException,
                                               TemplateException
Process the specified FreeMarker template with the given model and write the result to the given Writer.

When using this method to prepare a text for a mail to be sent with Spring's mail support, consider wrapping IO/TemplateException in MailPreparationException.

Parameters:
model - the model object, typically a Map that contains model names as keys and model objects as values
Returns:
the result as String
Throws:
IOException - if the template wasn't found or couldn't be read
TemplateException - if rendering failed
See Also:
MailPreparationException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SpringTemplateLoader

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.ui.freemarker
Class SpringTemplateLoader

java.lang.Object
    extended by  org.springframework.ui.freemarker.SpringTemplateLoader
All Implemented Interfaces:
TemplateLoader
public class SpringTemplateLoader
extends Object
implements TemplateLoader

FreeMarker TemplateLoader adapter that loads via a Spring ResourceLoader. Used by FreeMarkerConfigurationFactory for any resource loader path that cannot be resolved to a java.io.File.

Note that this loader does not allow for modification detection: Use FreeMarker's default TemplateLoader for java.io.File resources.

Since:
14.03.2004
Author:
Juergen Hoeller
See Also:
FreeMarkerConfigurationFactory.setTemplateLoaderPath(java.lang.String), Configuration.setDirectoryForTemplateLoading(java.io.File)

Field Summary
protected  Log logger
Constructor Summary
SpringTemplateLoader(ResourceLoader resourceLoader, String templateLoaderPath)
Create a new SpringTemplateLoader.
Method Summary
void | closeTemplateSource(Object templateSource)
Object | findTemplateSource(String name)
long | getLastModified(Object templateSource)
Reader | getReader(Object templateSource, String encoding)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Constructor Detail

SpringTemplateLoader

public SpringTemplateLoader(ResourceLoader resourceLoader,
                            String templateLoaderPath)
Create a new SpringTemplateLoader.

Parameters:
resourceLoader - the Spring ResourceLoader to use
templateLoaderPath - the template loader path to use
Method Detail

findTemplateSource

public Object findTemplateSource(String name)
                          throws IOException
Specified by:
findTemplateSource in interface TemplateLoader
Throws:
IOException

getReader

public Reader getReader(Object templateSource,
                        String encoding)
                 throws IOException
Specified by:
getReader in interface TemplateLoader
Throws:
IOException

getLastModified

public long getLastModified(Object templateSource)
Specified by:
getLastModified in interface TemplateLoader

closeTemplateSource

public void closeTemplateSource(Object templateSource)
                         throws IOException
Specified by:
closeTemplateSource in interface TemplateLoader
Throws:
IOException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.ui.jasperreports

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.ui.jasperreports

Support classes for JasperReports.

See:
Description

Class Summary
JasperReportsUtils Utility methods for working with JasperReports.

Package org.springframework.ui.jasperreports Description

Support classes for JasperReports.


org.springframework.ui.jasperreports Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.ui.jasperreports

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.ui.jasperreports.JasperReportsUtils


JasperReportsUtils

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.ui.jasperreports
Class JasperReportsUtils

java.lang.Object
    extended by  org.springframework.ui.jasperreports.JasperReportsUtils

public abstract class JasperReportsUtils
extends Object

Utility methods for working with JasperReports. Provides a set of convenience methods for generating reports in a CSV, HTML, PDF and XLS formats.

Since:
1.1.3
Author:
Rob Harrop, Juergen Hoeller

Constructor Summary
JasperReportsUtils()
Method Summary
static net.sf.jasperreports.engine.JRDataSource | convertReportData(Object value) Convert the given report data value to a JRDataSource.
static void | render(net.sf.jasperreports.engine.JRExporter exporter, net.sf.jasperreports.engine.JasperPrint print, OutputStream outputStream) Render the supplied JasperPrint instance using the supplied JRAbstractExporter instance and write the results to the supplied OutputStream.
static void | render(net.sf.jasperreports.engine.JRExporter exporter, net.sf.jasperreports.engine.JasperPrint print, Writer writer) Render the supplied JasperPrint instance using the supplied JRAbstractExporter instance and write the results to the supplied Writer.
static void | renderAsCsv(net.sf.jasperreports.engine.JasperReport report, Map parameters, Object reportData, Writer writer) Render a report in CSV format using the supplied report data.
static void | renderAsCsv(net.sf.jasperreports.engine.JasperReport report, Map parameters, Object reportData, Writer writer, Map exporterParameters) Render a report in CSV format using the supplied report data.
static void | renderAsHtml(net.sf.jasperreports.engine.JasperReport report, Map parameters, Object reportData, Writer writer) Render a report in HTML format using the supplied report data.
static void | renderAsHtml(net.sf.jasperreports.engine.JasperReport report, Map parameters, Object reportData, Writer writer, Map exporterParameters) Render a report in HTML format using the supplied report data.
static void | renderAsPdf(net.sf.jasperreports.engine.JasperReport report, Map parameters, Object reportData, OutputStream stream) Render a report in PDF format using the supplied report data.
static void | renderAsPdf(net.sf.jasperreports.engine.JasperReport report, Map parameters, Object reportData, OutputStream stream, Map exporterParameters) Render a report in PDF format using the supplied report data.
static void | renderAsXls(net.sf.jasperreports.engine.JasperReport report, Map parameters, Object reportData, OutputStream stream) Render a report in XLS format using the supplied report data.
static void | renderAsXls(net.sf.jasperreports.engine.JasperReport report, Map parameters, Object reportData, OutputStream stream, Map exporterParameters) Render a report in XLS format using the supplied report data.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JasperReportsUtils

public JasperReportsUtils()
Method Detail

convertReportData

public static net.sf.jasperreports.engine.JRDataSource convertReportData(Object value)
                                                                  throws IllegalArgumentException
Convert the given report data value to a JRDataSource.

In the default implementation, a JRDataSource, java.util.Collection or object array is detected. The latter are converted to JRBeanCollectionDataSource or JRBeanArrayDataSource, respectively.

Parameters:
value - the report data value to convert
Returns:
the JRDataSource (never null)
Throws:
IllegalArgumentException - if the value could not be converted
See Also:
JRDataSource, JRBeanCollectionDataSource, JRBeanArrayDataSource

render

public static void render(net.sf.jasperreports.engine.JRExporter exporter,
                          net.sf.jasperreports.engine.JasperPrint print,
                          Writer writer)
                   throws net.sf.jasperreports.engine.JRException
Render the supplied JasperPrint instance using the supplied JRAbstractExporter instance and write the results to the supplied Writer.

Make sure that the JRAbstractExporter implementation you supply is capable of writing to a Writer.

Parameters:
exporter - the JRAbstractExporter to use to render the report
print - the JasperPrint instance to render
writer - the Writer to write the result to
Throws:
net.sf.jasperreports.engine.JRException - if rendering failed

render

public static void render(net.sf.jasperreports.engine.JRExporter exporter,
                          net.sf.jasperreports.engine.JasperPrint print,
                          OutputStream outputStream)
                   throws net.sf.jasperreports.engine.JRException
Render the supplied JasperPrint instance using the supplied JRAbstractExporter instance and write the results to the supplied OutputStream.

Make sure that the JRAbstractExporter implementation you supply is capable of writing to a OutputStream.

Parameters:
exporter - the JRAbstractExporter to use to render the report
print - the JasperPrint instance to render
outputStream - the OutputStream to write the result to
Throws:
net.sf.jasperreports.engine.JRException - if rendering failed

renderAsCsv

public static void renderAsCsv(net.sf.jasperreports.engine.JasperReport report,
                               Map parameters,
                               Object reportData,
                               Writer writer)
                        throws net.sf.jasperreports.engine.JRException
Render a report in CSV format using the supplied report data. Writes the results to the supplied Writer.

Parameters:
report - the JasperReport instance to render
parameters - the parameters to use for rendering
writer - the Writer to write the rendered report to
reportData - a JRDataSource, java.util.Collection or object array (converted accordingly), representing the report data to read fields from
Throws:
net.sf.jasperreports.engine.JRException - if rendering failed
See Also:
convertReportData(java.lang.Object)

renderAsCsv

public static void renderAsCsv(net.sf.jasperreports.engine.JasperReport report,
                               Map parameters,
                               Object reportData,
                               Writer writer,
                               Map exporterParameters)
                        throws net.sf.jasperreports.engine.JRException
Render a report in CSV format using the supplied report data. Writes the results to the supplied Writer.

Parameters:
report - the JasperReport instance to render
parameters - the parameters to use for rendering
writer - the Writer to write the rendered report to
reportData - a JRDataSource, java.util.Collection or object array (converted accordingly), representing the report data to read fields from
exporterParameters - a Map of exporter parameters
Throws:
net.sf.jasperreports.engine.JRException - if rendering failed
See Also:
convertReportData(java.lang.Object)

renderAsHtml

public static void renderAsHtml(net.sf.jasperreports.engine.JasperReport report,
                                Map parameters,
                                Object reportData,
                                Writer writer)
                         throws net.sf.jasperreports.engine.JRException
Render a report in HTML format using the supplied report data. Writes the results to the supplied Writer.

Parameters:
report - the JasperReport instance to render
parameters - the parameters to use for rendering
writer - the Writer to write the rendered report to
reportData - a JRDataSource, java.util.Collection or object array (converted accordingly), representing the report data to read fields from
Throws:
net.sf.jasperreports.engine.JRException - if rendering failed
See Also:
convertReportData(java.lang.Object)

renderAsHtml

public static void renderAsHtml(net.sf.jasperreports.engine.JasperReport report,
                                Map parameters,
                                Object reportData,
                                Writer writer,
                                Map exporterParameters)
                         throws net.sf.jasperreports.engine.JRException
Render a report in HTML format using the supplied report data. Writes the results to the supplied Writer.

Parameters:
report - the JasperReport instance to render
parameters - the parameters to use for rendering
writer - the Writer to write the rendered report to
reportData - a JRDataSource, java.util.Collection or object array (converted accordingly), representing the report data to read fields from
exporterParameters - a Map of exporter parameters
Throws:
net.sf.jasperreports.engine.JRException - if rendering failed
See Also:
convertReportData(java.lang.Object)

renderAsPdf

public static void renderAsPdf(net.sf.jasperreports.engine.JasperReport report,
                               Map parameters,
                               Object reportData,
                               OutputStream stream)
                        throws net.sf.jasperreports.engine.JRException
Render a report in PDF format using the supplied report data. Writes the results to the supplied OutputStream.

Parameters:
report - the JasperReport instance to render
parameters - the parameters to use for rendering
stream - the OutputStream to write the rendered report to
reportData - a JRDataSource, java.util.Collection or object array (converted accordingly), representing the report data to read fields from
Throws:
net.sf.jasperreports.engine.JRException - if rendering failed
See Also:
convertReportData(java.lang.Object)

renderAsPdf

public static void renderAsPdf(net.sf.jasperreports.engine.JasperReport report,
                               Map parameters,
                               Object reportData,
                               OutputStream stream,
                               Map exporterParameters)
                        throws net.sf.jasperreports.engine.JRException
Render a report in PDF format using the supplied report data. Writes the results to the supplied OutputStream.

Parameters:
report - the JasperReport instance to render
parameters - the parameters to use for rendering
stream - the OutputStream to write the rendered report to
reportData - a JRDataSource, java.util.Collection or object array (converted accordingly), representing the report data to read fields from
exporterParameters - a Map of exporter parameters
Throws:
net.sf.jasperreports.engine.JRException - if rendering failed
See Also:
convertReportData(java.lang.Object)

renderAsXls

public static void renderAsXls(net.sf.jasperreports.engine.JasperReport report,
                               Map parameters,
                               Object reportData,
                               OutputStream stream)
                        throws net.sf.jasperreports.engine.JRException
Render a report in XLS format using the supplied report data. Writes the results to the supplied OutputStream.

Parameters:
report - the JasperReport instance to render
parameters - the parameters to use for rendering
stream - the OutputStream to write the rendered report to
reportData - a JRDataSource, java.util.Collection or object array (converted accordingly), representing the report data to read fields from
Throws:
net.sf.jasperreports.engine.JRException - if rendering failed
See Also:
convertReportData(java.lang.Object)

renderAsXls

public static void renderAsXls(net.sf.jasperreports.engine.JasperReport report,
                               Map parameters,
                               Object reportData,
                               OutputStream stream,
                               Map exporterParameters)
                        throws net.sf.jasperreports.engine.JRException
Render a report in XLS format using the supplied report data. Writes the results to the supplied OutputStream.

Parameters:
report - the JasperReport instance to render
parameters - the parameters to use for rendering
stream - the OutputStream to write the rendered report to
reportData - a JRDataSource, java.util.Collection or object array (converted accordingly), representing the report data to read fields from
exporterParameters - a Map of exporter parameters
Throws:
net.sf.jasperreports.engine.JRException - if rendering failed
See Also:
convertReportData(java.lang.Object)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.ui.velocity

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.ui.velocity

Support classes for setting up Velocity within a Spring application context.

See:
Description

Class Summary
CommonsLoggingLogSystem | Velocity LogSystem implementation for Jakarta Commons Logging.
SpringResourceLoader | Velocity ResourceLoader adapter that loads via a Spring ResourceLoader.
VelocityEngineFactory | Factory that configures a VelocityEngine.
VelocityEngineFactoryBean | Factory bean that configures a VelocityEngine and provides it as bean reference.
VelocityEngineUtils | Utility class for working with a VelocityEngine.

Package org.springframework.ui.velocity Description

Support classes for setting up Velocity within a Spring application context.


org.springframework.ui.velocity Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.ui.velocity

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.ui.velocity.CommonsLoggingLogSystem (implements org.apache.velocity.runtime.log.LogSystem)
    • org.apache.velocity.runtime.resource.loader.ResourceLoader
      • org.springframework.ui.velocity.SpringResourceLoader
    • org.springframework.ui.velocity.VelocityEngineFactory
      • org.springframework.ui.velocity.VelocityEngineFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean, org.springframework.context.ResourceLoaderAware)
    • org.springframework.ui.velocity.VelocityEngineUtils


CommonsLoggingLogSystem

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.ui.velocity
Class CommonsLoggingLogSystem

java.lang.Object
    extended by  org.springframework.ui.velocity.CommonsLoggingLogSystem
All Implemented Interfaces:
LogSystem
public class CommonsLoggingLogSystem
extends Object
implements LogSystem

Velocity LogSystem implementation for Jakarta Commons Logging. Used by VelocityConfigurer to redirect log output.

Since:
07.08.2003
Author:
Juergen Hoeller
See Also:
VelocityEngineFactoryBean

Field Summary
Fields inherited from interface org.apache.velocity.runtime.log.LogSystem
DEBUG_ID, DEBUG_ON, ERROR_ID, INFO_ID, WARN_ID
Constructor Summary
CommonsLoggingLogSystem()
Method Summary
void | init(RuntimeServices runtimeServices)
void | logVelocityMessage(int type, String msg)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CommonsLoggingLogSystem

public CommonsLoggingLogSystem()
Method Detail

init

public void init(RuntimeServices runtimeServices)
Specified by:
init in interface LogSystem

logVelocityMessage

public void logVelocityMessage(int type,
                               String msg)
Specified by:
logVelocityMessage in interface LogSystem
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


SpringResourceLoader

org.springframework.ui.velocity
Class SpringResourceLoader

java.lang.Object
    extended by  org.apache.velocity.runtime.resource.loader.ResourceLoader
        extended by  org.springframework.ui.velocity.SpringResourceLoader

public class SpringResourceLoader
extends ResourceLoader

Velocity ResourceLoader adapter that loads via a Spring ResourceLoader. Used by VelocityEngineFactory for any resource loader path that cannot be resolved to a java.io.File.

Note that this loader does not allow for modification detection: Use Velocity's default FileResourceLoader for java.io.File resources.

Expects "spring.resource.loader" and "spring.resource.loader.path" application attributes in the Velocity runtime: the former of type org.springframework.core.io.ResourceLoader, the latter a String.

Since:
14.03.2004
Author:
Juergen Hoeller
See Also:
VelocityEngineFactory.setResourceLoaderPath(java.lang.String), ResourceLoader, FileResourceLoader

Field Summary
protected Log | logger
static String | NAME
static String | SPRING_RESOURCE_LOADER
static String | SPRING_RESOURCE_LOADER_CACHE
static String | SPRING_RESOURCE_LOADER_CLASS
static String | SPRING_RESOURCE_LOADER_PATH
Fields inherited from class org.apache.velocity.runtime.resource.loader.ResourceLoader
className, isCachingOn, log, modificationCheckInterval, rsvc
Constructor Summary
SpringResourceLoader()
Method Summary
long | getLastModified(Resource resource)
InputStream | getResourceStream(String source)
void | init(ExtendedProperties configuration)
boolean | isSourceModified(Resource resource)
Methods inherited from class org.apache.velocity.runtime.resource.loader.ResourceLoader
commonInit, getClassName, getModificationCheckInterval, isCachingOn, setCachingOn, setModificationCheckInterval
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

NAME

public static final String NAME
See Also:
Constant Field Values

SPRING_RESOURCE_LOADER_CLASS

public static final String SPRING_RESOURCE_LOADER_CLASS
See Also:
Constant Field Values

SPRING_RESOURCE_LOADER_CACHE

public static final String SPRING_RESOURCE_LOADER_CACHE
See Also:
Constant Field Values

SPRING_RESOURCE_LOADER

public static final String SPRING_RESOURCE_LOADER
See Also:
Constant Field Values

SPRING_RESOURCE_LOADER_PATH

public static final String SPRING_RESOURCE_LOADER_PATH
See Also:
Constant Field Values

logger

protected final Log logger
Constructor Detail

SpringResourceLoader

public SpringResourceLoader()
Method Detail

init

public void init(ExtendedProperties configuration)
Specified by:
init in class ResourceLoader

getResourceStream

public InputStream getResourceStream(String source)
                              throws ResourceNotFoundException
Specified by:
getResourceStream in class ResourceLoader
Throws:
ResourceNotFoundException

isSourceModified

public boolean isSourceModified(Resource resource)
Specified by:
isSourceModified in class ResourceLoader

getLastModified

public long getLastModified(Resource resource)
Specified by:
getLastModified in class ResourceLoader
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


VelocityEngineFactory

org.springframework.ui.velocity
Class VelocityEngineFactory

java.lang.Object
    extended by  org.springframework.ui.velocity.VelocityEngineFactory
Direct Known Subclasses:
VelocityConfigurer, VelocityEngineFactoryBean
public class VelocityEngineFactory
extends Object

Factory that configures a VelocityEngine. Can be used standalone, but typically you will either use VelocityEngineFactoryBean for preparing a VelocityEngine as bean reference, or VelocityConfigurer for web views.

The optional "configLocation" property sets the location of the Velocity properties file, within the current application. Velocity properties can be overridden via "velocityProperties", or even completely specified locally, avoiding the need for an external properties file.

The "resourceLoaderPath" property can be used to specify the Velocity resource loader path via Spring's Resource abstraction, possibly relative to the Spring application context.

If "overrideLogging" is true (the default), the VelocityEngine will be configured to log via Commons Logging, that is, using the Spring-provided CommonsLoggingLogSystem as log system.

The simplest way to use this class is to specify a "resourceLoaderPath"; the VelocityEngine typically then does not need any further configuration.

Author:
Juergen Hoeller
See Also:
setConfigLocation(org.springframework.core.io.Resource), setVelocityProperties(java.util.Properties), setResourceLoaderPath(java.lang.String), setOverrideLogging(boolean), createVelocityEngine(), CommonsLoggingLogSystem, VelocityEngineFactoryBean, VelocityConfigurer, VelocityEngine

Field Summary
protected  Log logger
Constructor Summary
VelocityEngineFactory()
Method Summary
VelocityEngine | createVelocityEngine() Prepare the VelocityEngine instance and return it.
protected ResourceLoader | getResourceLoader() Return the Spring ResourceLoader to use for loading Velocity template files.
protected void | initSpringResourceLoader(VelocityEngine velocityEngine, String resourceLoaderPath) Initialize a SpringResourceLoader for the given VelocityEngine.
protected void | initVelocityResourceLoader(VelocityEngine velocityEngine, String resourceLoaderPath) Initialize a Velocity resource loader for the given VelocityEngine: either a standard Velocity FileResourceLoader or a SpringResourceLoader.
protected boolean | isPreferFileSystemAccess() Return whether to prefer file system access for template loading.
protected VelocityEngine | newVelocityEngine() Return a new VelocityEngine.
protected void | postProcessVelocityEngine(VelocityEngine velocityEngine) To be implemented by subclasses that want to to perform custom post-processing of the VelocityEngine after this FactoryBean performed its default configuration (but before VelocityEngine.init).
void | setConfigLocation(Resource configLocation) Set the location of the Velocity config file.
void | setOverrideLogging(boolean overrideLogging) Set whether Velocity should log via Commons Logging, i.e.
void | setPreferFileSystemAccess(boolean preferFileSystemAccess) Set whether to prefer file system access for template loading.
void | setResourceLoader(ResourceLoader resourceLoader) Set the Spring ResourceLoader to use for loading Velocity template files.
void | setResourceLoaderPath(String resourceLoaderPath) Set the Velocity resource loader path via a Spring resource location.
void | setVelocityProperties(Properties velocityProperties) Set Velocity properties, like "file.resource.loader.path".
void | setVelocityPropertiesMap(Map<String,Object> velocityPropertiesMap) Set Velocity properties as Map, to allow for non-String values like "ds.resource.loader.instance".
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Constructor Detail

VelocityEngineFactory

public VelocityEngineFactory()
Method Detail

setConfigLocation

public void setConfigLocation(Resource configLocation)
Set the location of the Velocity config file. Alternatively, you can specify all properties locally.

See Also:
setVelocityProperties(java.util.Properties), setResourceLoaderPath(java.lang.String)

setVelocityProperties

public void setVelocityProperties(Properties velocityProperties)
Set Velocity properties, like "file.resource.loader.path". Can be used to override values in a Velocity config file, or to specify all necessary properties locally.

Note that the Velocity resource loader path also be set to any Spring resource location via the "resourceLoaderPath" property. Setting it here is just necessary when using a non-file-based resource loader.

See Also:
setVelocityPropertiesMap(java.util.Map),
setConfigLocation(org.springframework.core.io.Resource),
setResourceLoaderPath(java.lang.String)

setVelocityPropertiesMap

public void setVelocityPropertiesMap(Map<String,Object> velocityPropertiesMap)
Set Velocity properties as Map, to allow for non-String values like "ds.resource.loader.instance".

See Also:
setVelocityProperties(java.util.Properties)

setResourceLoaderPath

public void setResourceLoaderPath(String resourceLoaderPath)
Set the Velocity resource loader path via a Spring resource location. Accepts multiple locations in Velocity's comma-separated path style.

When populated via a String, standard URLs like "file:" and "classpath:" pseudo URLs are supported, as understood by ResourceLoader. Allows for relative paths when running in an ApplicationContext.

Will define a path for the default Velocity resource loader with the name "file". If the specified resource cannot be resolved to a java.io.File, a generic SpringResourceLoader will be used under the name "spring", without modification detection.

Note that resource caching will be enabled in any case. With the file resource loader, the last-modified timestamp will be checked on access to detect changes. With SpringResourceLoader, the resource will be cached forever (for example for class path resources).

To specify a modification check interval for files, use Velocity's standard "file.resource.loader.modificationCheckInterval" property. By default, the file timestamp is checked on every access (which is surprisingly fast). Of course, this just applies when loading resources from the file system.

To enforce the use of SpringResourceLoader, i.e. to not resolve a path as file system resource in any case, turn off the "preferFileSystemAccess" flag. See the latter's javadoc for details.

See Also:
setResourceLoader(org.springframework.core.io.ResourceLoader), setVelocityProperties(java.util.Properties), setPreferFileSystemAccess(boolean), SpringResourceLoader, FileResourceLoader

setResourceLoader

public void setResourceLoader(ResourceLoader resourceLoader)
Set the Spring ResourceLoader to use for loading Velocity template files. The default is DefaultResourceLoader. Will get overridden by the ApplicationContext if running in a context.

See Also:
DefaultResourceLoader, ApplicationContext

getResourceLoader

protected ResourceLoader getResourceLoader()
Return the Spring ResourceLoader to use for loading Velocity template files.

setPreferFileSystemAccess

public void setPreferFileSystemAccess(boolean preferFileSystemAccess)
Set whether to prefer file system access for template loading. File system access enables hot detection of template changes.

If this is enabled, VelocityEngineFactory will try to resolve the specified "resourceLoaderPath" as file system resource (which will work for expanded class path resources and ServletContext resources too).

Default is "true". Turn this off to always load via SpringResourceLoader (i.e. as stream, without hot detection of template changes), which might be necessary if some of your templates reside in an expanded classes directory while others reside in jar files.

See Also:
setResourceLoaderPath(java.lang.String)

isPreferFileSystemAccess

protected boolean isPreferFileSystemAccess()
Return whether to prefer file system access for template loading.

setOverrideLogging

public void setOverrideLogging(boolean overrideLogging)
Set whether Velocity should log via Commons Logging, i.e. whether Velocity's log system should be set to CommonsLoggingLogSystem. Default value is true.

See Also:
CommonsLoggingLogSystem

createVelocityEngine

public VelocityEngine createVelocityEngine()
                                    throws IOException,
                                           VelocityException
Prepare the VelocityEngine instance and return it.

Returns:
the VelocityEngine instance
Throws:
IOException - if the config file wasn't found
VelocityException - on Velocity initialization failure

newVelocityEngine

protected VelocityEngine newVelocityEngine()
                                    throws IOException,
                                           VelocityException
Return a new VelocityEngine. Subclasses can override this for custom initialization, or for using a mock object for testing.

Called by createVelocityEngine().

Returns:
the VelocityEngine instance
Throws:
IOException - if a config file wasn't found
VelocityException - on Velocity initialization failure
See Also:
createVelocityEngine()

initVelocityResourceLoader

protected void initVelocityResourceLoader(VelocityEngine velocityEngine,
                                          String resourceLoaderPath)
Initialize a Velocity resource loader for the given VelocityEngine: either a standard Velocity FileResourceLoader or a SpringResourceLoader.

Called by createVelocityEngine().

Parameters:
velocityEngine - the VelocityEngine to configure
resourceLoaderPath - the path to load Velocity resources from
See Also:
FileResourceLoader, SpringResourceLoader, initSpringResourceLoader(org.apache.velocity.app.VelocityEngine, java.lang.String), createVelocityEngine()

initSpringResourceLoader

protected void initSpringResourceLoader(VelocityEngine velocityEngine,
                                        String resourceLoaderPath)
Initialize a SpringResourceLoader for the given VelocityEngine.

Called by initVelocityResourceLoader.

Parameters:
velocityEngine - the VelocityEngine to configure
resourceLoaderPath - the path to load Velocity resources from
See Also:
SpringResourceLoader, initVelocityResourceLoader(org.apache.velocity.app.VelocityEngine, java.lang.String)

postProcessVelocityEngine

protected void postProcessVelocityEngine(VelocityEngine velocityEngine)
                                  throws IOException,
                                         VelocityException
To be implemented by subclasses that want to to perform custom post-processing of the VelocityEngine after this FactoryBean performed its default configuration (but before VelocityEngine.init).

Called by createVelocityEngine().

Parameters:
velocityEngine - the current VelocityEngine
Throws:
IOException - if a config file wasn't found
VelocityException - on Velocity initialization failure
See Also:
createVelocityEngine(), VelocityEngine.init()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


VelocityEngineFactoryBean

org.springframework.ui.velocity
Class VelocityEngineFactoryBean

java.lang.Object
    extended by  org.springframework.ui.velocity.VelocityEngineFactory
        extended by  org.springframework.ui.velocity.VelocityEngineFactoryBean
All Implemented Interfaces:
FactoryBean<VelocityEngine>, InitializingBean, ResourceLoaderAware
public class VelocityEngineFactoryBean
extends VelocityEngineFactory
implements FactoryBean<VelocityEngine>, InitializingBean, ResourceLoaderAware

Factory bean that configures a VelocityEngine and provides it as bean reference. This bean is intended for any kind of usage of Velocity in application code, e.g. for generating email content. For web views, VelocityConfigurer is used to set up a VelocityEngine for views.

The simplest way to use this class is to specify a "resourceLoaderPath"; you do not need any further configuration then. For example, in a web application context:

 <bean id="velocityEngine" class="org.springframework.ui.velocity.VelocityEngineFactoryBean">
   <property name="resourceLoaderPath" value="/WEB-INF/velocity/"/>
 </bean>
See the base class VelocityEngineFactory for configuration details.

Author:
Juergen Hoeller
See Also:
VelocityEngineFactory.setConfigLocation(org.springframework.core.io.Resource),
VelocityEngineFactory.setVelocityProperties(java.util.Properties),
VelocityEngineFactory.setResourceLoaderPath(java.lang.String),
VelocityConfigurer

Field Summary
Fields inherited from class org.springframework.ui.velocity.VelocityEngineFactory
logger
Constructor Summary
VelocityEngineFactoryBean()
Method Summary
 void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 VelocityEngine getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<? extends VelocityEngine> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
Methods inherited from class org.springframework.ui.velocity.VelocityEngineFactory
createVelocityEngine, getResourceLoader, initSpringResourceLoader, initVelocityResourceLoader, isPreferFileSystemAccess, newVelocityEngine, postProcessVelocityEngine, setConfigLocation, setOverrideLogging, setPreferFileSystemAccess, setResourceLoader, setResourceLoaderPath, setVelocityProperties, setVelocityPropertiesMap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.context.ResourceLoaderAware
setResourceLoader

Constructor Detail

VelocityEngineFactoryBean

public VelocityEngineFactoryBean()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws IOException,
                               VelocityException
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
IOException
VelocityException

getObject

public VelocityEngine getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<VelocityEngine>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends VelocityEngine> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<VelocityEngine>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<VelocityEngine>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


VelocityEngineUtils

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.ui.velocity
Class VelocityEngineUtils

java.lang.Object
    extended by  org.springframework.ui.velocity.VelocityEngineUtils

public abstract class VelocityEngineUtils
extends Object

Utility class for working with a VelocityEngine. Provides convenience methods to merge a Velocity template with a model.

Since:
22.01.2004
Author:
Juergen Hoeller

Constructor Summary
VelocityEngineUtils()
Method Summary
static void | mergeTemplate(VelocityEngine velocityEngine, String templateLocation, Map model, Writer writer) Merge the specified Velocity template with the given model and write the result to the given Writer.
static void | mergeTemplate(VelocityEngine velocityEngine, String templateLocation, String encoding, Map model, Writer writer) Merge the specified Velocity template with the given model and write the result to the given Writer.
static String | mergeTemplateIntoString(VelocityEngine velocityEngine, String templateLocation, Map model) Merge the specified Velocity template with the given model into a String.
static String | mergeTemplateIntoString(VelocityEngine velocityEngine, String templateLocation, String encoding, Map model) Merge the specified Velocity template with the given model into a String.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

VelocityEngineUtils

public VelocityEngineUtils()
Method Detail

mergeTemplate

public static void mergeTemplate(VelocityEngine velocityEngine,
                                 String templateLocation,
                                 Map model,
                                 Writer writer)
                          throws VelocityException
Merge the specified Velocity template with the given model and write the result to the given Writer.

Parameters:
velocityEngine - VelocityEngine to work with
templateLocation - the location of template, relative to Velocity's resource loader path
model - the Map that contains model names as keys and model objects as values
writer - the Writer to write the result to
Throws:
VelocityException - if the template wasn't found or rendering failed

mergeTemplate

public static void mergeTemplate(VelocityEngine velocityEngine,
                                 String templateLocation,
                                 String encoding,
                                 Map model,
                                 Writer writer)
                          throws VelocityException
Merge the specified Velocity template with the given model and write the result to the given Writer.

Parameters:
velocityEngine - VelocityEngine to work with
templateLocation - the location of template, relative to Velocity's resource loader path
encoding - the encoding of the template file
model - the Map that contains model names as keys and model objects as values
writer - the Writer to write the result to
Throws:
VelocityException - if the template wasn't found or rendering failed

mergeTemplateIntoString

public static String mergeTemplateIntoString(VelocityEngine velocityEngine,
                                             String templateLocation,
                                             Map model)
                                      throws VelocityException
Merge the specified Velocity template with the given model into a String.

When using this method to prepare a text for a mail to be sent with Spring's mail support, consider wrapping VelocityException in MailPreparationException.

Parameters:
velocityEngine - VelocityEngine to work with
templateLocation - the location of template, relative to Velocity's resource loader path
model - the Map that contains model names as keys and model objects as values
Returns:
the result as String
Throws:
VelocityException - if the template wasn't found or rendering failed
See Also:
MailPreparationException

mergeTemplateIntoString

public static String mergeTemplateIntoString(VelocityEngine velocityEngine,
                                             String templateLocation,
                                             String encoding,
                                             Map model)
                                      throws VelocityException
Merge the specified Velocity template with the given model into a String.

When using this method to prepare a text for a mail to be sent with Spring's mail support, consider wrapping VelocityException in MailPreparationException.

Parameters:
velocityEngine - VelocityEngine to work with
templateLocation - the location of template, relative to Velocity's resource loader path
encoding - the encoding of the template file
model - the Map that contains model names as keys and model objects as values
Returns:
the result as String
Throws:
VelocityException - if the template wasn't found or rendering failed
See Also:
MailPreparationException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.util

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.util

Miscellaneous utility classes, such as String manipulation utilities, a Log4J configurer, and a state holder for paged lists of objects.

See:
Description

Interface Summary
AutoPopulatingList.ElementFactory<E> | Factory interface for creating elements for an index-based access data structure such as a List.
ErrorHandler | A strategy for handling errors.
MultiValueMap<K,V> | Extension of the Map interface that stores multiple values.
PathMatcher | Strategy interface for String-based path matching.
PropertiesPersister | Strategy interface for persisting java.util.Properties, allowing for pluggable parsing strategies.
PropertyPlaceholderHelper.PlaceholderResolver | Strategy interface used to resolve replacement values for placeholders contained in Strings.
ReflectionUtils.FieldCallback | Callback interface invoked on each field in the hierarchy.
ReflectionUtils.FieldFilter | Callback optionally used to filter fields to be operated on by a field callback.
ReflectionUtils.MethodCallback | Action to take on each method.
ReflectionUtils.MethodFilter | Callback optionally used to method fields to be operated on by a method callback.
StringValueResolver | Simple strategy interface for resolving a String value.
WeakReferenceMonitor.ReleaseListener | Listener that is notified when the handle is being released.

Class Summary
AntPathMatcher | PathMatcher implementation for Ant-style path patterns.
Assert | Assertion utility class that assists in validating arguments.
AutoPopulatingList<E> | Simple List wrapper class that allows for elements to be automatically populated as they are requested.
CachingMapDecorator<K,V> | A simple decorator for a Map, encapsulating the workflow for caching expensive values in a target Map.
ClassUtils | Miscellaneous class utility methods.
CollectionUtils | Miscellaneous collection utility methods.
CommonsLogWriter | java.io.Writer adapter for a Commons Logging Log.
CompositeIterator<E> | Iterator that combines multiple other iterators.
ConcurrencyThrottleSupport | Support class for throttling concurrent access to a specific resource.
CustomizableThreadCreator | Simple customizable helper class for creating threads.
DefaultPropertiesPersister | Default implementation of the PropertiesPersister interface.
DigestUtils | Miscellaneous methods for calculating digests.
FileCopyUtils | Simple utility methods for file and stream copying.
FileSystemUtils | Utility methods for working with the file system.
LinkedCaseInsensitiveMap<V> | LinkedHashMap variant that stores String keys in a case-insensitive manner, for example for key-based access in a results table.
LinkedMultiValueMap<K,V> | Simple implementation of MultiValueMap that wraps a LinkedHashMap, storing multiple values in a LinkedList.
Log4jConfigurer | Convenience class that features simple methods for custom log4j configuration.
MethodInvoker | Helper class that allows for specifying a method to invoke in a declarative fashion, be it static or non-static.
NumberUtils | Miscellaneous utility methods for number conversion and parsing.
ObjectUtils | Miscellaneous object utility methods.
PatternMatchUtils | Utility methods for simple pattern matching, in particular for Spring's typical "xxx*", "*xxx" and "*xxx*" pattern styles.
PropertyPlaceholderHelper | Utility class for working with Strings that have placeholder values in them.
ReflectionUtils | Simple utility class for working with the reflection API and handling reflection exceptions.
ResourceUtils | Utility methods for resolving resource locations to files in the file system.
StopWatch | Simple stop watch, allowing for timing of a number of tasks, exposing total running time and running time for each named task.
StopWatch.TaskInfo | Inner class to hold data about one task executed within the stop watch.
StringUtils | Miscellaneous String utility methods.
SystemPropertyUtils | Helper class for resolving placeholders in texts.
TypeUtils | Utility to work with Java 5 generic type parameters.
WeakReferenceMonitor | Track references to arbitrary objects using proxy and weak references.

Exception Summary
AutoPopulatingList.ElementInstantiationException Exception to be thrown from ElementFactory.

Package org.springframework.util Description

Miscellaneous utility classes, such as String manipulation utilities, a Log4J configurer, and a state holder for paged lists of objects.


org.springframework.util Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.util

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.util.AbstractMap<K,V> (implements java.util.Map<K,V>)
      • java.util.HashMap<K,V> (implements java.lang.Cloneable, java.util.Map<K,V>, java.io.Serializable)
        • java.util.LinkedHashMap<K,V> (implements java.util.Map<K,V>)
          • org.springframework.util.LinkedCaseInsensitiveMap<V>
    • org.springframework.util.AntPathMatcher (implements org.springframework.util.PathMatcher)
    • org.springframework.util.Assert
    • org.springframework.util.AutoPopulatingList<E> (implements java.util.List<E>, java.io.Serializable)
    • org.springframework.util.CachingMapDecorator<K,V> (implements java.util.Map<K,V>, java.io.Serializable)
    • org.springframework.util.ClassUtils
    • org.springframework.util.CollectionUtils
    • org.springframework.util.CompositeIterator<E> (implements java.util.Iterator<E>)
    • org.springframework.util.ConcurrencyThrottleSupport (implements java.io.Serializable)
    • org.springframework.util.CustomizableThreadCreator (implements java.io.Serializable)
    • org.springframework.util.DefaultPropertiesPersister (implements org.springframework.util.PropertiesPersister)
    • org.springframework.util.DigestUtils
    • org.springframework.util.FileCopyUtils
    • org.springframework.util.FileSystemUtils
    • org.springframework.util.LinkedMultiValueMap<K,V> (implements org.springframework.util.MultiValueMap<K,V>, java.io.Serializable)
    • org.springframework.util.Log4jConfigurer
    • org.springframework.util.MethodInvoker
    • org.springframework.util.NumberUtils
    • org.springframework.util.ObjectUtils
    • org.springframework.util.PatternMatchUtils
    • org.springframework.util.PropertyPlaceholderHelper
    • org.springframework.util.ReflectionUtils
    • org.springframework.util.ResourceUtils
    • org.springframework.util.StopWatch
    • org.springframework.util.StopWatch.TaskInfo
    • org.springframework.util.StringUtils
    • org.springframework.util.SystemPropertyUtils
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.util.AutoPopulatingList.ElementInstantiationException
    • org.springframework.util.TypeUtils
    • org.springframework.util.WeakReferenceMonitor
    • java.io.Writer (implements java.lang.Appendable, java.io.Closeable, java.io.Flushable)
      • org.springframework.util.CommonsLogWriter

Interface Hierarchy

  • org.springframework.util.AutoPopulatingList.ElementFactory<E>
  • org.springframework.util.ErrorHandler
  • java.util.Map<K,V>
    • org.springframework.util.MultiValueMap<K,V>
  • org.springframework.util.PathMatcher
  • org.springframework.util.PropertiesPersister
  • org.springframework.util.PropertyPlaceholderHelper.PlaceholderResolver
  • org.springframework.util.ReflectionUtils.FieldCallback
  • org.springframework.util.ReflectionUtils.FieldFilter
  • org.springframework.util.ReflectionUtils.MethodCallback
  • org.springframework.util.ReflectionUtils.MethodFilter
  • org.springframework.util.StringValueResolver
  • org.springframework.util.WeakReferenceMonitor.ReleaseListener


ErrorHandler

org.springframework.util
Interface ErrorHandler

public interface ErrorHandler

A strategy for handling errors. This is especially useful for handling errors that occur during asynchronous execution of tasks that have been submitted to a TaskScheduler. In such cases, it may not be possible to throw the error to the original caller.

Since:
3.0.
Author:
Mark Fisher

Method Summary
 void handleError(Throwable t)

Method Detail

handleError

void handleError(Throwable t)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MultiValueMap

org.springframework.util
Interface MultiValueMap<K,V>

All Superinterfaces:
Map<K,List<V>>
All Known Implementing Classes:
HttpHeaders, LinkedMultiValueMap
public interface MultiValueMap<K,V>
extends Map<K,List<V>>

Extension of the Map interface that stores multiple values.

Since:
3.0
Author:
Arjen Poutsma

Nested Class Summary
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
Method Summary
void | add(K key, V value) Add the given single value to the current list of values for the given key.
V | getFirst(K key) Return the first value for the given key.
void | set(K key, V value) Set the given single value under the given key.
void | setAll(Map<K,V> values) Set the given values under.
Map<K,V> | toSingleValueMap() Returns the first values contained in this MultiValueMap.
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values

Method Detail

getFirst

V getFirst(K key)
Return the first value for the given key.

Parameters:
key - the key
Returns:
the first value for the specified key, or null

add

void add(K key,
         V value)
Add the given single value to the current list of values for the given key.

Parameters:
key - the key
value - the value to be added

set

void set(K key,
         V value)
Set the given single value under the given key.

Parameters:
key - the key
value - the value to set

setAll

void setAll(Map<K,V> values)
Set the given values under.

Parameters:
values - the values.

toSingleValueMap

Map<K,V> toSingleValueMap()
Returns the first values contained in this MultiValueMap.

Returns:
a single value representation of this map
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PathMatcher

org.springframework.util
Interface PathMatcher

All Known Implementing Classes:
AntPathMatcher
public interface PathMatcher

Strategy interface for String-based path matching.

Used by PathMatchingResourcePatternResolver, AbstractUrlHandlerMapping, PropertiesMethodNameResolver, and WebContentInterceptor.

The default implementation is AntPathMatcher, supporting the Ant-style pattern syntax.

Since:
1.2
Author:
Juergen Hoeller
See Also:
AntPathMatcher

Method Summary
String | combine(String pattern1, String pattern2) Combines two patterns into a new pattern that is returned.
String | extractPathWithinPattern(String pattern, String path) Given a pattern and a full path, determine the pattern-mapped part.
Map<String,String> | extractUriTemplateVariables(String pattern, String path) Given a pattern and a full path, extract the URI template variables.
Comparator<String> | getPatternComparator(String path) Given a full path, returns a Comparator suitable for sorting patterns in order of explicitness for that path.
boolean | isPattern(String path) Does the given path represent a pattern that can be matched by an implementation of this interface?
boolean | match(String pattern, String path) Match the given path against the given pattern, according to this PathMatcher's matching strategy.
boolean | matchStart(String pattern, String path) Match the given path against the corresponding part of the given pattern, according to this PathMatcher's matching strategy.

Method Detail

isPattern

boolean isPattern(String path)
Does the given path represent a pattern that can be matched by an implementation of this interface?

If the return value is false, then the match(java.lang.String, java.lang.String) method does not have to be used because direct equality comparisons on the static path Strings will lead to the same result.

Parameters:
path - the path String to check
Returns:
true if the given path represents a pattern

match

boolean match(String pattern,
              String path)
Match the given path against the given pattern, according to this PathMatcher's matching strategy.

Parameters:
pattern - the pattern to match against
path - the path String to test
Returns:
true if the supplied path matched, false if it didn't

matchStart

boolean matchStart(String pattern,
                   String path)
Match the given path against the corresponding part of the given pattern, according to this PathMatcher's matching strategy.

Determines whether the pattern at least matches as far as the given base path goes, assuming that a full path may then match as well.

Parameters:
pattern - the pattern to match against
path - the path String to test
Returns:
true if the supplied path matched, false if it didn't

extractPathWithinPattern

String extractPathWithinPattern(String pattern,
                                String path)
Given a pattern and a full path, determine the pattern-mapped part.

This method is supposed to find out which part of the path is matched dynamically through an actual pattern, that is, it strips off a statically defined leading path from the given full path, returning only the actually pattern-matched part of the path.

For example: For "myroot/*.html" as pattern and "myroot/myfile.html" as full path, this method should return "myfile.html". The detailed determination rules are specified to this PathMatcher's matching strategy.

A simple implementation may return the given full path as-is in case of an actual pattern, and the empty String in case of the pattern not containing any dynamic parts (i.e. the pattern parameter being a static path that wouldn't qualify as an actual pattern). A sophisticated implementation will differentiate between the static parts and the dynamic parts of the given path pattern.

Parameters:
pattern - the path pattern
path - the full path to introspect
Returns:
the pattern-mapped part of the given path (never null)

extractUriTemplateVariables

Map<String,String> extractUriTemplateVariables(String pattern,
                                               String path)
Given a pattern and a full path, extract the URI template variables. URI template variables are expressed through curly brackets ('{' and '}').

For example: For pattern "/hotels/{hotel}" and path "/hotels/1", this method will return a map containing "hotel"->"1".

Parameters:
pattern - the path pattern, possibly containing URI templates
path - the full path to extract template variables from
Returns:
a map, containing variable names as keys; variables values as values

getPatternComparator

Comparator<String> getPatternComparator(String path)
Given a full path, returns a Comparator suitable for sorting patterns in order of explicitness for that path.

The full algorithm used depends on the underlying implementation, but generally, the returned Comparator will sort a list so that more specific patterns (for that come before generic patterns.

Parameters:
path - the full path to use for comparison
Returns:
a comparator capable of sorting patterns in order of explicitness

combine

String combine(String pattern1,
               String pattern2)
Combines two patterns into a new pattern that is returned.

The full algorithm used for combining the two pattern depends on the underlying implementation.

Parameters:
pattern1 - the first pattern
pattern2 - the second pattern
Returns:
the combination of the two patterns
Throws:
IllegalArgumentException - when the two patterns cannot be combined
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertiesPersister

org.springframework.util
Interface PropertiesPersister

All Known Implementing Classes:
DefaultPropertiesPersister
public interface PropertiesPersister

Strategy interface for persisting java.util.Properties, allowing for pluggable parsing strategies.

The default implementation is DefaultPropertiesPersister, providing the native parsing of java.util.Properties, but allowing for reading from any Reader and writing to any Writer (which allows to specify an encoding for a properties file).

As of Spring 1.2.2, this interface also supports properties XML files, through the loadFromXml and storeToXml methods. The default implementations delegate to JDK 1.5's corresponding methods.

Since:
10.03.2004
Author:
Juergen Hoeller
See Also:
DefaultPropertiesPersister, Properties

Method Summary
void | load(Properties props, InputStream is) Load properties from the given InputStream into the given Properties object.
void | load(Properties props, Reader reader) Load properties from the given Reader into the given Properties object.
void | loadFromXml(Properties props, InputStream is) Load properties from the given XML InputStream into the given Properties object.
void | store(Properties props, OutputStream os, String header) Write the contents of the given Properties object to the given OutputStream.
void | store(Properties props, Writer writer, String header) Write the contents of the given Properties object to the given Writer.
void | storeToXml(Properties props, OutputStream os, String header) Write the contents of the given Properties object to the given XML OutputStream.
void | storeToXml(Properties props, OutputStream os, String header, String encoding) Write the contents of the given Properties object to the given XML OutputStream.

Method Detail

load

void load(Properties props,
          InputStream is)
          throws IOException
Load properties from the given InputStream into the given Properties object.

Parameters:
props - the Properties object to load into
is - the InputStream to load from
Throws:
IOException - in case of I/O errors
See Also:
Properties.load(java.io.Reader)

load

void load(Properties props,
          Reader reader)
          throws IOException
Load properties from the given Reader into the given Properties object.

Parameters:
props - the Properties object to load into
reader - the Reader to load from
Throws:
IOException - in case of I/O errors

store

void store(Properties props,
           OutputStream os,
           String header)
           throws IOException
Write the contents of the given Properties object to the given OutputStream.

Parameters:
props - the Properties object to store
os - the OutputStream to write to
header - the description of the property list
Throws:
IOException - in case of I/O errors
See Also:
Properties.store(java.io.Writer, java.lang.String)

store

void store(Properties props,
           Writer writer,
           String header)
           throws IOException
Write the contents of the given Properties object to the given Writer.

Parameters:
props - the Properties object to store
writer - the Writer to write to
header - the description of the property list
Throws:
IOException - in case of I/O errors

loadFromXml

void loadFromXml(Properties props,
                 InputStream is)
                 throws IOException
Load properties from the given XML InputStream into the given Properties object.

Parameters:
props - the Properties object to load into
is - the InputStream to load from
Throws:
IOException - in case of I/O errors
See Also:
Properties.loadFromXML(java.io.InputStream)

storeToXml

void storeToXml(Properties props,
                OutputStream os,
                String header)
                throws IOException
Write the contents of the given Properties object to the given XML OutputStream.

Parameters:
props - the Properties object to store
os - the OutputStream to write to
header - the description of the property list
Throws:
IOException - in case of I/O errors
See Also:
Properties.storeToXML(java.io.OutputStream, String)

storeToXml

void storeToXml(Properties props,
                OutputStream os,
                String header,
                String encoding)
                throws IOException
Write the contents of the given Properties object to the given XML OutputStream.

Parameters:
props - the Properties object to store
os - the OutputStream to write to
encoding - the encoding to use
header - the description of the property list
Throws:
IOException - in case of I/O errors
See Also:
Properties.storeToXML(java.io.OutputStream, String, String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StringValueResolver

org.springframework.util
Interface StringValueResolver

public interface StringValueResolver

Simple strategy interface for resolving a String value. Used by ConfigurableBeanFactory.

Since:
2.5
Author:
Juergen Hoeller
See Also:
ConfigurableBeanFactory.resolveAliases(org.springframework.util.StringValueResolver), BeanDefinitionVisitor.BeanDefinitionVisitor(StringValueResolver), PropertyPlaceholderConfigurer

Method Summary
 String resolveStringValue(String strVal)
Resolve the given String value, for example parsing placeholders.

Method Detail

resolveStringValue

String resolveStringValue(String strVal)
Resolve the given String value, for example parsing placeholders.

Parameters:
strVal - the original String value
Returns:
the resolved String value
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AntPathMatcher

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.util
Class AntPathMatcher

java.lang.Object
    extended by  org.springframework.util.AntPathMatcher
All Implemented Interfaces:
PathMatcher
public class AntPathMatcher
extends Object
implements PathMatcher

PathMatcher implementation for Ant-style path patterns. Examples are provided below.

Part of this mapping code has been kindly borrowed from Apache Ant.

The mapping matches URLs using the following rules:

  • ? matches one character
  • * matches zero or more characters
  • ** matches zero or more 'directories' in a path

Some examples:

  • com/t?st.jsp - matches com/test.jsp but also com/tast.jsp or com/txst.jsp
  • com/*.jsp - matches all .jsp files in the com directory
  • com/**/test.jsp - matches all test.jsp files underneath the com path
  • org/springframework/**/*.jsp - matches all .jsp files underneath the org/springframework path
  • org/**/servlet/bla.jsp - matches org/springframework/servlet/bla.jsp but also org/springframework/testing/servlet/bla.jsp and org/servlet/bla.jsp

Since:
16.07.2003
Author:
Alef Arendsen, Juergen Hoeller, Rob Harrop, Arjen Poutsma

Field Summary
static String DEFAULT_PATH_SEPARATOR
Default path separator: "/"
Constructor Summary
AntPathMatcher()
Method Summary
String | combine(String pattern1, String pattern2) Combines two patterns into a new pattern that is returned.
protected boolean | doMatch(String pattern, String path, boolean fullMatch, Map<String,String> uriTemplateVariables) Actually match the given path against the given pattern.
String | extractPathWithinPattern(String pattern, String path) Given a pattern and a full path, determine the pattern-mapped part.
Map<String,String> | extractUriTemplateVariables(String pattern, String path) Given a pattern and a full path, extract the URI template variables.
Comparator<String> | getPatternComparator(String path) Given a full path, returns a Comparator suitable for sorting patterns in order of explicitness.
boolean | isPattern(String path) Does the given path represent a pattern that can be matched by an implementation of this interface?
boolean | match(String pattern, String path) Match the given path against the given pattern, according to this PathMatcher's matching strategy.
boolean | matchStart(String pattern, String path) Match the given path against the corresponding part of the given pattern, according to this PathMatcher's matching strategy.
void | setPathSeparator(String pathSeparator) Set the path separator to use for pattern parsing.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_PATH_SEPARATOR

public static final String DEFAULT_PATH_SEPARATOR
Default path separator: "/"

See Also:
Constant Field Values
Constructor Detail

AntPathMatcher

public AntPathMatcher()
Method Detail

setPathSeparator

public void setPathSeparator(String pathSeparator)
Set the path separator to use for pattern parsing. Default is "/", as in Ant.

isPattern

public boolean isPattern(String path)
Description copied from interface: PathMatcher
Does the given path represent a pattern that can be matched by an implementation of this interface?

If the return value is false, then the PathMatcher.match(java.lang.String, java.lang.String) method does not have to be used because direct equality comparisons on the static path Strings will lead to the same result.

Specified by:
isPattern in interface PathMatcher
Parameters:
path - the path String to check
Returns:
true if the given path represents a pattern

match

public boolean match(String pattern,
                     String path)
Description copied from interface: PathMatcher
Match the given path against the given pattern, according to this PathMatcher's matching strategy.

Specified by:
match in interface PathMatcher
Parameters:
pattern - the pattern to match against
path - the path String to test
Returns:
true if the supplied path matched, false if it didn't

matchStart

public boolean matchStart(String pattern,
                          String path)
Description copied from interface: PathMatcher
Match the given path against the corresponding part of the given pattern, according to this PathMatcher's matching strategy.

Determines whether the pattern at least matches as far as the given base path goes, assuming that a full path may then match as well.

Specified by:
matchStart in interface PathMatcher
Parameters:
pattern - the pattern to match against
path - the path String to test
Returns:
true if the supplied path matched, false if it didn't

doMatch

protected boolean doMatch(String pattern,
                          String path,
                          boolean fullMatch,
                          Map<String,String> uriTemplateVariables)
Actually match the given path against the given pattern.

Parameters:
pattern - the pattern to match against
path - the path String to test
fullMatch - whether a full pattern match is required (else a pattern match as far as the given base path goes is sufficient)
Returns:
true if the supplied path matched, false if it didn't

extractPathWithinPattern

public String extractPathWithinPattern(String pattern,
                                       String path)
Given a pattern and a full path, determine the pattern-mapped part.

For example:

  • '/docs/cvs/commit.html' and '/docs/cvs/commit.html -> ''
  • '/docs/*' and '/docs/cvs/commit -> 'cvs/commit'
  • '/docs/cvs/*.html' and '/docs/cvs/commit.html -> 'commit.html'
  • '/docs/**' and '/docs/cvs/commit -> 'cvs/commit'
  • '/docs/**\/*.html' and '/docs/cvs/commit.html -> 'cvs/commit.html'
  • '/*.html' and '/docs/cvs/commit.html -> 'docs/cvs/commit.html'
  • '*.html' and '/docs/cvs/commit.html -> '/docs/cvs/commit.html'
  • '*' and '/docs/cvs/commit.html -> '/docs/cvs/commit.html'

Assumes that match(java.lang.String, java.lang.String) returns true for 'pattern' and 'path', but does not enforce this.

Specified by:
extractPathWithinPattern in interface PathMatcher
Parameters:
pattern - the path pattern
path - the full path to introspect
Returns:
the pattern-mapped part of the given path (never null)

extractUriTemplateVariables

public Map<String,String> extractUriTemplateVariables(String pattern,
                                                      String path)
Description copied from interface: PathMatcher
Given a pattern and a full path, extract the URI template variables. URI template variables are expressed through curly brackets ('{' and '}').

For example: For pattern "/hotels/{hotel}" and path "/hotels/1", this method will return a map containing "hotel"->"1".

Specified by:
extractUriTemplateVariables in interface PathMatcher
Parameters:
pattern - the path pattern, possibly containing URI templates
path - the full path to extract template variables from
Returns:
a map, containing variable names as keys; variables values as values

combine

public String combine(String pattern1,
                      String pattern2)
Combines two patterns into a new pattern that is returned.

This implementation simply concatenates the two patterns, unless the first pattern contains a file extension match (such as *.html. In that case, the second pattern should be included in the first, or an IllegalArgumentException is thrown.

For example:

Pattern 1 | Pattern 2 | Result
/hotels | null | /hotels
null | /hotels | /hotels
/hotels | /bookings | /hotels/bookings
/hotels | bookings | /hotels/bookings
/hotels/* | /bookings | /hotels/bookings
/hotels/** | /bookings | /hotels/**/bookings
/hotels | {hotel} | /hotels/{hotel}
/hotels/* | {hotel} | /hotels/{hotel}
/hotels/** | {hotel} | /hotels/**/{hotel}
/*.html | /hotels.html | /hotels.html
/*.html | /hotels | /hotels.html
/*.html | /*.txt | IllegalArgumentException

Specified by:
combine in interface PathMatcher
Parameters:
pattern1 - the first pattern
pattern2 - the second pattern
Returns:
the combination of the two patterns
Throws:
IllegalArgumentException - when the two patterns cannot be combined

getPatternComparator

public Comparator<String> getPatternComparator(String path)
Given a full path, returns a Comparator suitable for sorting patterns in order of explicitness.

The returned Comparator will sort a list so that more specific patterns (without uri templates or wild cards) come before generic patterns. So given a list with the following patterns:

  1. /hotels/new
  2. /hotels/{hotel}
  3. /hotels/*
the returned comparator will sort this list so that the order will be as indicated.

The full path given as parameter is used to test for exact matches. So when the given path is /hotels/2, the pattern /hotels/2 will be sorted before /hotels/1.

Specified by:
getPatternComparator in interface PathMatcher
Parameters:
path - the full path to use for comparison
Returns:
a comparator capable of sorting patterns in order of explicitness
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


Assert

org.springframework.util
Class Assert

java.lang.Object
    extended by  org.springframework.util.Assert

public abstract class Assert
extends Object

Assertion utility class that assists in validating arguments. Useful for identifying programmer errors early and clearly at runtime.

For example, if the contract of a public method states it does not allow null arguments, Assert can be used to validate that contract. Doing this clearly indicates a contract violation when it occurs and protects the class's invariants.

Typically used to validate method arguments rather than configuration properties, to check for cases that are usually programmer errors rather than configuration errors. In contrast to config initialization code, there is usally no point in falling back to defaults in such methods.

This class is similar to JUnit's assertion library. If an argument value is deemed invalid, an IllegalArgumentException is thrown (typically). For example:

 Assert.notNull(clazz, "The class must not be null");
 Assert.isTrue(i > 0, "The value must be greater than zero");
Mainly for internal use within the framework; consider Jakarta's Commons Lang >= 2.0 for a more comprehensive suite of assertion utilities.

Since:
1.1.2
Author:
Keith Donald, Juergen Hoeller, Colin Sampaleanu, Rob Harrop

Constructor Summary
Assert()
Method Summary
static void doesNotContain(String textToSearch, String substring)
Assert that the given text does not contain the given substring.
static void doesNotContain(String textToSearch, String substring, String message)
Assert that the given text does not contain the given substring.
static void hasLength(String text)
Assert that the given String is not empty; that is, it must not be null and not the empty String.
static void hasLength(String text, String message)
Assert that the given String is not empty; that is, it must not be null and not the empty String.
static void hasText(String text)
Assert that the given String has valid text content; that is, it must not be null and must contain at least one non-whitespace character.
static void hasText(String text, String message)
Assert that the given String has valid text content; that is, it must not be null and must contain at least one non-whitespace character.
static void isAssignable(Class superType, Class subType)
Assert that superType.isAssignableFrom(subType) is true.
static void isAssignable(Class superType, Class subType, String message)
Assert that superType.isAssignableFrom(subType) is true.
static void isInstanceOf(Class clazz, Object obj)
Assert that the provided object is an instance of the provided class.
static void isInstanceOf(Class type, Object obj, String message)
Assert that the provided object is an instance of the provided class.
static void isNull(Object object)
Assert that an object is null .
static void isNull(Object object, String message)
Assert that an object is null .
static void isTrue(boolean expression)
Assert a boolean expression, throwing IllegalArgumentException if the test result is false.
static void isTrue(boolean expression, String message)
Assert a boolean expression, throwing IllegalArgumentException if the test result is false.
static void noNullElements(Object[] array)
Assert that an array has no null elements.
static void noNullElements(Object[] array, String message)
Assert that an array has no null elements.
static void notEmpty(Collection collection)
Assert that a collection has elements; that is, it must not be null and must have at least one element.
static void notEmpty(Collection collection, String message)
Assert that a collection has elements; that is, it must not be null and must have at least one element.
static void notEmpty(Map map)
Assert that a Map has entries; that is, it must not be null and must have at least one entry.
static void notEmpty(Map map, String message)
Assert that a Map has entries; that is, it must not be null and must have at least one entry.
static void notEmpty(Object[] array)
Assert that an array has elements; that is, it must not be null and must have at least one element.
static void notEmpty(Object[] array, String message)
Assert that an array has elements; that is, it must not be null and must have at least one element.
static void notNull(Object object)
Assert that an object is not null .
static void notNull(Object object, String message)
Assert that an object is not null .
static void state(boolean expression)
Assert a boolean expression, throwing IllegalStateException if the test result is false.
static void state(boolean expression, String message)
Assert a boolean expression, throwing IllegalStateException if the test result is false.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Assert

public Assert()
Method Detail

isTrue

public static void isTrue(boolean expression,
                          String message)
Assert a boolean expression, throwing IllegalArgumentException if the test result is false.
Assert.isTrue(i > 0, "The value must be greater than zero");

Parameters:
expression - a boolean expression
message - the exception message to use if the assertion fails
Throws:
IllegalArgumentException - if expression is false

isTrue

public static void isTrue(boolean expression)
Assert a boolean expression, throwing IllegalArgumentException if the test result is false.
Assert.isTrue(i > 0);

Parameters:
expression - a boolean expression
Throws:
IllegalArgumentException - if expression is false

isNull

public static void isNull(Object object,
                          String message)
Assert that an object is null .
Assert.isNull(value, "The value must be null");

Parameters:
object - the object to check
message - the exception message to use if the assertion fails
Throws:
IllegalArgumentException - if the object is not null

isNull

public static void isNull(Object object)
Assert that an object is null .
Assert.isNull(value);

Parameters:
object - the object to check
Throws:
IllegalArgumentException - if the object is not null

notNull

public static void notNull(Object object,
                           String message)
Assert that an object is not null .
Assert.notNull(clazz, "The class must not be null");

Parameters:
object - the object to check
message - the exception message to use if the assertion fails
Throws:
IllegalArgumentException - if the object is null

notNull

public static void notNull(Object object)
Assert that an object is not null .
Assert.notNull(clazz);

Parameters:
object - the object to check
Throws:
IllegalArgumentException - if the object is null

hasLength

public static void hasLength(String text,
                             String message)
Assert that the given String is not empty; that is, it must not be null and not the empty String.
Assert.hasLength(name, "Name must not be empty");

Parameters:
text - the String to check
message - the exception message to use if the assertion fails
See Also:
StringUtils.hasLength(java.lang.CharSequence)

hasLength

public static void hasLength(String text)
Assert that the given String is not empty; that is, it must not be null and not the empty String.
Assert.hasLength(name);

Parameters:
text - the String to check
See Also:
StringUtils.hasLength(java.lang.CharSequence)

hasText

public static void hasText(String text,
                           String message)
Assert that the given String has valid text content; that is, it must not be null and must contain at least one non-whitespace character.
Assert.hasText(name, "'name' must not be empty");

Parameters:
text - the String to check
message - the exception message to use if the assertion fails
See Also:
StringUtils.hasText(java.lang.CharSequence)

hasText

public static void hasText(String text)
Assert that the given String has valid text content; that is, it must not be null and must contain at least one non-whitespace character.
Assert.hasText(name, "'name' must not be empty");

Parameters:
text - the String to check
See Also:
StringUtils.hasText(java.lang.CharSequence)

doesNotContain

public static void doesNotContain(String textToSearch,
                                  String substring,
                                  String message)
Assert that the given text does not contain the given substring.
Assert.doesNotContain(name, "rod", "Name must not contain 'rod'");

Parameters:
textToSearch - the text to search
substring - the substring to find within the text
message - the exception message to use if the assertion fails

doesNotContain

public static void doesNotContain(String textToSearch,
                                  String substring)
Assert that the given text does not contain the given substring.
Assert.doesNotContain(name, "rod");

Parameters:
textToSearch - the text to search
substring - the substring to find within the text

notEmpty

public static void notEmpty(Object[] array,
                            String message)
Assert that an array has elements; that is, it must not be null and must have at least one element.
Assert.notEmpty(array, "The array must have elements");

Parameters:
array - the array to check
message - the exception message to use if the assertion fails
Throws:
IllegalArgumentException - if the object array is null or has no elements

notEmpty

public static void notEmpty(Object[] array)
Assert that an array has elements; that is, it must not be null and must have at least one element.
Assert.notEmpty(array);

Parameters:
array - the array to check
Throws:
IllegalArgumentException - if the object array is null or has no elements

noNullElements

public static void noNullElements(Object[] array,
                                  String message)
Assert that an array has no null elements. Note: Does not complain if the array is empty!
Assert.noNullElements(array, "The array must have non-null elements");

Parameters:
array - the array to check
message - the exception message to use if the assertion fails
Throws:
IllegalArgumentException - if the object array contains a null element

noNullElements

public static void noNullElements(Object[] array)
Assert that an array has no null elements. Note: Does not complain if the array is empty!
Assert.noNullElements(array);

Parameters:
array - the array to check
Throws:
IllegalArgumentException - if the object array contains a null element

notEmpty

public static void notEmpty(Collection collection,
                            String message)
Assert that a collection has elements; that is, it must not be null and must have at least one element.
Assert.notEmpty(collection, "Collection must have elements");

Parameters:
collection - the collection to check
message - the exception message to use if the assertion fails
Throws:
IllegalArgumentException - if the collection is null or has no elements

notEmpty

public static void notEmpty(Collection collection)
Assert that a collection has elements; that is, it must not be null and must have at least one element.
Assert.notEmpty(collection, "Collection must have elements");

Parameters:
collection - the collection to check
Throws:
IllegalArgumentException - if the collection is null or has no elements

notEmpty

public static void notEmpty(Map map,
                            String message)
Assert that a Map has entries; that is, it must not be null and must have at least one entry.
Assert.notEmpty(map, "Map must have entries");

Parameters:
map - the map to check
message - the exception message to use if the assertion fails
Throws:
IllegalArgumentException - if the map is null or has no entries

notEmpty

public static void notEmpty(Map map)
Assert that a Map has entries; that is, it must not be null and must have at least one entry.
Assert.notEmpty(map);

Parameters:
map - the map to check
Throws:
IllegalArgumentException - if the map is null or has no entries

isInstanceOf

public static void isInstanceOf(Class clazz,
                                Object obj)
Assert that the provided object is an instance of the provided class.
Assert.instanceOf(Foo.class, foo);

Parameters:
clazz - the required class
obj - the object to check
Throws:
IllegalArgumentException - if the object is not an instance of clazz
See Also:
Class.isInstance(java.lang.Object)

isInstanceOf

public static void isInstanceOf(Class type,
                                Object obj,
                                String message)
Assert that the provided object is an instance of the provided class.
Assert.instanceOf(Foo.class, foo);

Parameters:
type - the type to check against
obj - the object to check
message - a message which will be prepended to the message produced by the function itself, and which may be used to provide context. It should normally end in a ": " or ". " so that the function generate message looks ok when prepended to it.
Throws:
IllegalArgumentException - if the object is not an instance of clazz
See Also:
Class.isInstance(java.lang.Object)

isAssignable

public static void isAssignable(Class superType,
                                Class subType)
Assert that superType.isAssignableFrom(subType) is true.
Assert.isAssignable(Number.class, myClass);

Parameters:
superType - the super type to check
subType - the sub type to check
Throws:
IllegalArgumentException - if the classes are not assignable

isAssignable

public static void isAssignable(Class superType,
                                Class subType,
                                String message)
Assert that superType.isAssignableFrom(subType) is true.
Assert.isAssignable(Number.class, myClass);

Parameters:
superType - the super type to check against
subType - the sub type to check
message - a message which will be prepended to the message produced by the function itself, and which may be used to provide context. It should normally end in a ": " or ". " so that the function generate message looks ok when prepended to it.
Throws:
IllegalArgumentException - if the classes are not assignable

state

public static void state(boolean expression,
                         String message)
Assert a boolean expression, throwing IllegalStateException if the test result is false. Call isTrue if you wish to throw IllegalArgumentException on an assertion failure.
Assert.state(id == null, "The id property must not already be initialized");

Parameters:
expression - a boolean expression
message - the exception message to use if the assertion fails
Throws:
IllegalStateException - if expression is false

state

public static void state(boolean expression)
Assert a boolean expression, throwing IllegalStateException if the test result is false.

Call isTrue(boolean) if you wish to throw IllegalArgumentException on an assertion failure.

Assert.state(id == null);

Parameters:
expression - a boolean expression
Throws:
IllegalStateException - if the supplied expression is false
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AutoPopulatingList

org.springframework.util
Class AutoPopulatingList<E>

java.lang.Object
    extended by  org.springframework.util.AutoPopulatingList<E>
All Implemented Interfaces:
Serializable, Iterable<E>, Collection<E>, List<E>
public class AutoPopulatingList<E>
extends Object
implements List<E>, Serializable

Simple List wrapper class that allows for elements to be automatically populated as they are requested. This is particularly useful for data binding to Lists, allowing for elements to be created and added to the List in a "just in time" fashion.

Note: This class is not thread-safe. To create a thread-safe version, use the Collections.synchronizedList(java.util.List) utility methods.

Inspired by LazyList from Commons Collections.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
See Also:
Serialized Form

Nested Class Summary
static interface | AutoPopulatingList.ElementFactory<E> Factory interface for creating elements for an index-based access data structure such as a List.
static class | AutoPopulatingList.ElementInstantiationException Exception to be thrown from ElementFactory.
Constructor Summary
AutoPopulatingList(AutoPopulatingList.ElementFactory<E> elementFactory)
Creates a new AutoPopulatingList that is backed by a standard ArrayList and creates new elements on demand using the supplied AutoPopulatingList.ElementFactory.
AutoPopulatingList(Class<? extends E> elementClass)
Creates a new AutoPopulatingList that is backed by a standard ArrayList and adds new instances of the supplied element Class to the backing List on demand.
AutoPopulatingList(List<E> backingList, AutoPopulatingList.ElementFactory<E> elementFactory)
Creates a new AutoPopulatingList that is backed by the supplied List and creates new elements on demand using the supplied AutoPopulatingList.ElementFactory.
AutoPopulatingList(List<E> backingList, Class<? extends E> elementClass)
Creates a new AutoPopulatingList that is backed by the supplied List and adds new instances of the supplied element Class to the backing List on demand.
Method Summary
 boolean add(E o)
 void add(int index, E element)
 boolean addAll(Collection<? extends E> c)
 boolean addAll(int index, Collection<? extends E> c)
 void clear()
 boolean contains(Object o)
 boolean containsAll(Collection c)
 boolean equals(Object other)
 E get(int index)
Get the element at the supplied index, creating it if there is no element at that index.
 int hashCode()
 int indexOf(Object o)
 boolean isEmpty()
 Iterator<E> iterator()
 int lastIndexOf(Object o)
 ListIterator<E> listIterator()
 ListIterator<E> listIterator(int index)
 E remove(int index)
 boolean remove(Object o)
 boolean removeAll(Collection<?> c)
 boolean retainAll(Collection<?> c)
 E set(int index, E element)
 int size()
 List<E> subList(int fromIndex, int toIndex)
 Object[] toArray()
<T> T[]
toArray(T[] a)
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AutoPopulatingList

public AutoPopulatingList(Class<? extends E> elementClass)
Creates a new AutoPopulatingList that is backed by a standard ArrayList and adds new instances of the supplied element Class to the backing List on demand.

AutoPopulatingList

public AutoPopulatingList(List<E> backingList,
                          Class<? extends E> elementClass)
Creates a new AutoPopulatingList that is backed by the supplied List and adds new instances of the supplied element Class to the backing List on demand.

AutoPopulatingList

public AutoPopulatingList(AutoPopulatingList.ElementFactory<E> elementFactory)
Creates a new AutoPopulatingList that is backed by a standard ArrayList and creates new elements on demand using the supplied AutoPopulatingList.ElementFactory.

AutoPopulatingList

public AutoPopulatingList(List<E> backingList,
                          AutoPopulatingList.ElementFactory<E> elementFactory)
Creates a new AutoPopulatingList that is backed by the supplied List and creates new elements on demand using the supplied AutoPopulatingList.ElementFactory.

Method Detail

add

public void add(int index,
                E element)
Specified by:
add in interface List<E>

add

public boolean add(E o)
Specified by:
add in interface Collection<E>
Specified by:
add in interface List<E>

addAll

public boolean addAll(Collection<? extends E> c)
Specified by:
addAll in interface Collection<E>
Specified by:
addAll in interface List<E>

addAll

public boolean addAll(int index,
                      Collection<? extends E> c)
Specified by:
addAll in interface List<E>

clear

public void clear()
Specified by:
clear in interface Collection<E>
Specified by:
clear in interface List<E>

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection<E>
Specified by:
contains in interface List<E>

containsAll

public boolean containsAll(Collection c)
Specified by:
containsAll in interface Collection<E>
Specified by:
containsAll in interface List<E>

get

public E get(int index)
Get the element at the supplied index, creating it if there is no element at that index.

Specified by:
get in interface List<E>

indexOf

public int indexOf(Object o)
Specified by:
indexOf in interface List<E>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<E>
Specified by:
isEmpty in interface List<E>

iterator

public Iterator<E> iterator()
Specified by:
iterator in interface Iterable<E>
Specified by:
iterator in interface Collection<E>
Specified by:
iterator in interface List<E>

lastIndexOf

public int lastIndexOf(Object o)
Specified by:
lastIndexOf in interface List<E>

listIterator

public ListIterator<E> listIterator()
Specified by:
listIterator in interface List<E>

listIterator

public ListIterator<E> listIterator(int index)
Specified by:
listIterator in interface List<E>

remove

public E remove(int index)
Specified by:
remove in interface List<E>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<E>
Specified by:
remove in interface List<E>

removeAll

public boolean removeAll(Collection<?> c)
Specified by:
removeAll in interface Collection<E>
Specified by:
removeAll in interface List<E>

retainAll

public boolean retainAll(Collection<?> c)
Specified by:
retainAll in interface Collection<E>
Specified by:
retainAll in interface List<E>

set

public E set(int index,
             E element)
Specified by:
set in interface List<E>

size

public int size()
Specified by:
size in interface Collection<E>
Specified by:
size in interface List<E>

subList

public List<E> subList(int fromIndex,
                       int toIndex)
Specified by:
subList in interface List<E>

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection<E>
Specified by:
toArray in interface List<E>

toArray

public <T> T[] toArray(T[] a)
Specified by:
toArray in interface Collection<E>
Specified by:
toArray in interface List<E>

equals

public boolean equals(Object other)
Specified by:
equals in interface Collection<E>
Specified by:
equals in interface List<E>
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface Collection<E>
Specified by:
hashCode in interface List<E>
Overrides:
hashCode in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AutoPopulatingList.ElementInstantiationException

org.springframework.util
Class AutoPopulatingList.ElementInstantiationException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.util.AutoPopulatingList.ElementInstantiationException
All Implemented Interfaces:
Serializable
Enclosing class:
AutoPopulatingList<E>
public static class AutoPopulatingList.ElementInstantiationException
extends RuntimeException

Exception to be thrown from ElementFactory.

See Also:
Serialized Form

Constructor Summary
AutoPopulatingList.ElementInstantiationException(String msg)
Method Summary
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AutoPopulatingList.ElementInstantiationException

public AutoPopulatingList.ElementInstantiationException(String msg)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CachingMapDecorator

org.springframework.util
Class CachingMapDecorator<K,V>

java.lang.Object
    extended by  org.springframework.util.CachingMapDecorator<K,V>
All Implemented Interfaces:
Serializable, Map<K,V>
public abstract class CachingMapDecorator<K,V>
extends Object
implements Map<K,V>, Serializable

A simple decorator for a Map, encapsulating the workflow for caching expensive values in a target Map. Supports caching weak or strong keys.

This class is an abstract template. Caching Map implementations should subclass and override the create(key) method which encapsulates expensive creation of a new object.

Since:
1.2.2
Author:
Keith Donald, Juergen Hoeller
See Also:
Serialized Form

Nested Class Summary
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
Constructor Summary
CachingMapDecorator()
Create a CachingMapDecorator with strong keys, using an underlying synchronized Map.
CachingMapDecorator(boolean weak)
Create a CachingMapDecorator, using an underlying synchronized Map.
CachingMapDecorator(boolean weak, int size)
Create a CachingMapDecorator with initial size, using an underlying synchronized Map.
CachingMapDecorator(Map<K,V> targetMap)
Create a CachingMapDecorator for the given Map.
CachingMapDecorator(Map<K,V> targetMap, boolean synchronize, boolean weak)
Create a CachingMapDecorator for the given Map.
Method Summary
void | clear()
boolean | containsKey(Object key)
boolean | containsValue(Object value)
protected abstract V | create(K key) Create a value to cache for the given key.
Set<Map.Entry<K,V>> | entrySet()
V | get(Object key) Get value for key.
boolean | isEmpty()
Set<K> | keySet()
V | put(K key, V value) Put an object into the cache, possibly wrapping it with a weak reference.
void | putAll(Map<? extends K,? extends V> map)
V | remove(Object key)
int | size()
String | toString()
protected boolean | useWeakValue(K key, V value) Decide whether to use a weak reference for the value of the given key-value pair.
Collection<V> | values()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
equals, hashCode

Constructor Detail

CachingMapDecorator

public CachingMapDecorator()
Create a CachingMapDecorator with strong keys, using an underlying synchronized Map.

CachingMapDecorator

public CachingMapDecorator(boolean weak)
Create a CachingMapDecorator, using an underlying synchronized Map.

Parameters:
weak - whether to use weak references for keys and values

CachingMapDecorator

public CachingMapDecorator(boolean weak,
                           int size)
Create a CachingMapDecorator with initial size, using an underlying synchronized Map.

Parameters:
weak - whether to use weak references for keys and values
size - the initial cache size

CachingMapDecorator

public CachingMapDecorator(Map<K,V> targetMap)
Create a CachingMapDecorator for the given Map.

The passed-in Map won't get synchronized explicitly, so make sure to pass in a properly synchronized Map, if desired.

Parameters:
targetMap - the Map to decorate

CachingMapDecorator

public CachingMapDecorator(Map<K,V> targetMap,
                           boolean synchronize,
                           boolean weak)
Create a CachingMapDecorator for the given Map.

The passed-in Map won't get synchronized explicitly unless you specify "synchronize" as "true".

Parameters:
targetMap - the Map to decorate
synchronize - whether to synchronize on the given Map
weak - whether to use weak references for values
Method Detail

size

public int size()
Specified by:
size in interface Map<K,V>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Map<K,V>

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map<K,V>

containsValue

public boolean containsValue(Object value)
Specified by:
containsValue in interface Map<K,V>

remove

public V remove(Object key)
Specified by:
remove in interface Map<K,V>

putAll

public void putAll(Map<? extends K,? extends V> map)
Specified by:
putAll in interface Map<K,V>

clear

public void clear()
Specified by:
clear in interface Map<K,V>

keySet

public Set<K> keySet()
Specified by:
keySet in interface Map<K,V>

values

public Collection<V> values()
Specified by:
values in interface Map<K,V>

entrySet

public Set<Map.Entry<K,V>> entrySet()
Specified by:
entrySet in interface Map<K,V>

put

public V put(K key,
             V value)
Put an object into the cache, possibly wrapping it with a weak reference.

Specified by:
put in interface Map<K,V>
See Also:
useWeakValue(Object, Object)

useWeakValue

protected boolean useWeakValue(K key,
                               V value)
Decide whether to use a weak reference for the value of the given key-value pair.

Parameters:
key - the candidate key
value - the candidate value
Returns:
true in order to use a weak reference; false otherwise.

get

public V get(Object key)
Get value for key. Creates and caches value if it doesn't already exist in the cache.

This implementation is not synchronized: This is highly concurrent but does not guarantee unique instances in the cache, as multiple values for the same key could get created in parallel. Consider overriding this method to synchronize it, if desired.

Specified by:
get in interface Map<K,V>
See Also:
create(Object)

create

protected abstract V create(K key)
Create a value to cache for the given key. Called by get if there is no value cached already.

Parameters:
key - the cache key
See Also:
get(Object)

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ClassUtils

org.springframework.util
Class ClassUtils

java.lang.Object
    extended by  org.springframework.util.ClassUtils

public abstract class ClassUtils
extends Object

Miscellaneous class utility methods. Mainly for internal use within the framework; consider Apache Commons Lang for a more comprehensive suite of class utilities.

Since:
1.1
Author:
Juergen Hoeller, Keith Donald, Rob Harrop, Sam Brannen
See Also:
TypeUtils, ReflectionUtils

Field Summary
static String | ARRAY_SUFFIX Suffix for array class names: "[]"
static String | CGLIB_CLASS_SEPARATOR The CGLIB class separator character "$$"
static String | CLASS_FILE_SUFFIX The ".class" file suffix
Constructor Summary
ClassUtils()
Method Summary
static String addResourcePathToPackagePath(Class<?> clazz, String resourceName)
Return a path suitable for use with ClassLoader.getResource (also suitable for use with Class.getResource by prepending a slash ('/') to the return value).
static String classNamesToString(Class... classes)
Build a String that consists of the names of the classes/interfaces in the given array.
static String classNamesToString(Collection<Class> classes)
Build a String that consists of the names of the classes/interfaces in the given collection.
static String classPackageAsResourcePath(Class<?> clazz)
Given an input class object, return a string which consists of the class's package name as a pathname, i.e., all dots ('.') are replaced by slashes ('/').
static String convertClassNameToResourcePath(String className)
Convert a "."-based fully qualified class name to a "/"-based resource path.
static String convertResourcePathToClassName(String resourcePath)
Convert a "/"-based resource path to a "."-based fully qualified class name.
static Class<?> createCompositeInterface(Class<?>[] interfaces, ClassLoader classLoader)
Create a composite interface Class for the given interfaces, implementing the given interfaces in one single Class.
static Class<?> forName(String name)
Deprecated. as of Spring 3.0, in favor of specifying a ClassLoader explicitly: see forName(String, ClassLoader)
static Class<?> forName(String name, ClassLoader classLoader)
Replacement for Class.forName() that also returns Class instances for primitives (e.g."int") and array class names (e.g.
static Class[] getAllInterfaces(Object instance)
Return all interfaces that the given instance implements as array, including ones implemented by superclasses.
static Set<Class> getAllInterfacesAsSet(Object instance)
Return all interfaces that the given instance implements as Set, including ones implemented by superclasses.
static Class<?>[] getAllInterfacesForClass(Class<?> clazz)
Return all interfaces that the given class implements as array, including ones implemented by superclasses.
static Class<?>[] getAllInterfacesForClass(Class<?> clazz, ClassLoader classLoader)
Return all interfaces that the given class implements as array, including ones implemented by superclasses.
static Set<Class> getAllInterfacesForClassAsSet(Class clazz)
Return all interfaces that the given class implements as Set, including ones implemented by superclasses.
static Set<Class> getAllInterfacesForClassAsSet(Class clazz, ClassLoader classLoader)
Return all interfaces that the given class implements as Set, including ones implemented by superclasses.
static String getClassFileName(Class<?> clazz)
Determine the name of the class file, relative to the containing package: e.g.
static
<T> Constructor<T>
getConstructorIfAvailable(Class<T> clazz, Class<?>... paramTypes)
Determine whether the given class has a public constructor with the given signature, and return it if available (else return null).
static ClassLoader getDefaultClassLoader()
Return the default ClassLoader to use: typically the thread context ClassLoader, if available; the ClassLoader that loaded the ClassUtils class will be used as fallback.
static String getDescriptiveType(Object value)
Return a descriptive name for the given object's type: usually simply the class name, but component type class name + "[]" for arrays, and an appended list of implemented interfaces for JDK proxies.
static int getMethodCountForName(Class<?> clazz, String methodName)
Return the number of methods with a given name (with any argument types), for the given class and/or its superclasses.
static Method getMethodIfAvailable(Class<?> clazz, String methodName, Class<?>... paramTypes)
Determine whether the given class has a method with the given signature, and return it if available (else return null).
static Method getMostSpecificMethod(Method method, Class<?> targetClass)
Given a method, which may come from an interface, and a target class used in the current reflective invocation, find the corresponding target method if there is one.
static String getPackageName(Class<?> clazz)
Determine the name of the package of the given class: e.g.
static String getQualifiedMethodName(Method method)
Return the qualified name of the given method, consisting of fully qualified interface/class name + "." + method name.
static String getQualifiedName(Class<?> clazz)
Return the qualified name of the given class: usually simply the class name, but component type class name + "[]" for arrays.
static String getShortName(Class<?> clazz)
Get the class name without the qualified package name.
static String getShortName(String className)
Get the class name without the qualified package name.
static String getShortNameAsProperty(Class<?> clazz)
Return the short string name of a Java class in uncapitalized JavaBeans property format.
static Method getStaticMethod(Class<?> clazz, String methodName, Class<?>... args)
Return a public static method of a class.
static Class<?> getUserClass(Class<?> clazz)
Return the user-defined class for the given class: usually simply the given class, but the original class in case of a CGLIB-generated subclass.
static Class<?> getUserClass(Object instance)
Return the user-defined class for the given instance: usually simply the class of the given instance, but the original class in case of a CGLIB-generated subclass.
static boolean hasAtLeastOneMethodWithName(Class<?> clazz, String methodName)
Does the given class or one of its superclasses at least have one or more methods with the supplied name (with any argument types)? Includes non-public methods.
static boolean hasConstructor(Class<?> clazz, Class<?>... paramTypes)
Determine whether the given class has a public constructor with the given signature.
static boolean hasMethod(Class<?> clazz, String methodName, Class<?>... paramTypes)
Determine whether the given class has a method with the given signature.
static boolean isAssignable(Class<?> lhsType, Class<?> rhsType)
Check if the right-hand side type may be assigned to the left-hand side type, assuming setting by reflection.
static boolean isAssignableValue(Class<?> type, Object value)
Determine if the given type is assignable from the given value, assuming setting by reflection.
static boolean isCacheSafe(Class<?> clazz, ClassLoader classLoader)
Check whether the given class is cache-safe in the given context, i.e.
static boolean isPresent(String className)
Deprecated. as of Spring 2.5, in favor of isPresent(String, ClassLoader)
static boolean isPresent(String className, ClassLoader classLoader)
Determine whether the Class identified by the supplied name is present and can be loaded.
static boolean isPrimitiveArray(Class<?> clazz)
Check if the given class represents an array of primitives, i.e.
static boolean isPrimitiveOrWrapper(Class<?> clazz)
Check if the given class represents a primitive (i.e.
static boolean isPrimitiveWrapper(Class<?> clazz)
Check if the given class represents a primitive wrapper, i.e.
static boolean isPrimitiveWrapperArray(Class<?> clazz)
Check if the given class represents an array of primitive wrappers, i.e.
static boolean isVisible(Class<?> clazz, ClassLoader classLoader)
Check whether the given class is visible in the given ClassLoader.
static boolean matchesTypeName(Class<?> clazz, String typeName)
Check whether the given class matches the user-specified type name.
static ClassLoader overrideThreadContextClassLoader(ClassLoader classLoaderToUse)
Override the thread context ClassLoader with the environment's bean ClassLoader if necessary, i.e.
static Class<?> resolveClassName(String className, ClassLoader classLoader)
Resolve the given class name into a Class instance.
static Class<?> resolvePrimitiveClassName(String name)
Resolve the given class name as primitive class, if appropriate, according to the JVM's naming rules for primitive classes.
static Class<?> resolvePrimitiveIfNecessary(Class<?> clazz)
Resolve the given class if it is a primitive class, returning the corresponding primitive wrapper type instead.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

ARRAY_SUFFIX

public static final String ARRAY_SUFFIX
Suffix for array class names: "[]"

See Also:
Constant Field Values

CGLIB_CLASS_SEPARATOR

public static final String CGLIB_CLASS_SEPARATOR
The CGLIB class separator character "$$"

See Also:
Constant Field Values

CLASS_FILE_SUFFIX

public static final String CLASS_FILE_SUFFIX
The ".class" file suffix

See Also:
Constant Field Values
Constructor Detail

ClassUtils

public ClassUtils()
Method Detail

getDefaultClassLoader

public static ClassLoader getDefaultClassLoader()
Return the default ClassLoader to use: typically the thread context ClassLoader, if available; the ClassLoader that loaded the ClassUtils class will be used as fallback.

Call this method if you intend to use the thread context ClassLoader in a scenario where you absolutely need a non-null ClassLoader reference: for example, for class path resource loading (but not necessarily for Class.forName, which accepts a null ClassLoader reference as well).

Returns:
the default ClassLoader (never null)
See Also:
Thread.getContextClassLoader()

overrideThreadContextClassLoader

public static ClassLoader overrideThreadContextClassLoader(ClassLoader classLoaderToUse)
Override the thread context ClassLoader with the environment's bean ClassLoader if necessary, i.e. if the bean ClassLoader is not equivalent to the thread context ClassLoader already.

Parameters:
classLoaderToUse - the actual ClassLoader to use for the thread context
Returns:
the original thread context ClassLoader, or null if not overridden

forName

@Deprecated
public static Class<?> forName(String name)
                        throws ClassNotFoundException,
                               LinkageError
Deprecated. as of Spring 3.0, in favor of specifying a ClassLoader explicitly: see forName(String, ClassLoader)

Replacement for Class.forName() that also returns Class instances for primitives (like "int") and array class names (like "String[]").

Always uses the default class loader: that is, preferably the thread context class loader, or the ClassLoader that loaded the ClassUtils class as fallback.

Parameters:
name - the name of the Class
Returns:
Class instance for the supplied name
Throws:
ClassNotFoundException - if the class was not found
LinkageError - if the class file could not be loaded
See Also:
Class.forName(String, boolean, ClassLoader), getDefaultClassLoader()

forName

public static Class<?> forName(String name,
                               ClassLoader classLoader)
                        throws ClassNotFoundException,
                               LinkageError
Replacement for Class.forName() that also returns Class instances for primitives (e.g."int") and array class names (e.g. "String[]"). Furthermore, it is also capable of resolving inner class names in Java source style (e.g. "java.lang.Thread.State" instead of "java.lang.Thread$State").

Parameters:
name - the name of the Class
classLoader - the class loader to use (may be null, which indicates the default class loader)
Returns:
Class instance for the supplied name
Throws:
ClassNotFoundException - if the class was not found
LinkageError - if the class file could not be loaded
See Also:
Class.forName(String, boolean, ClassLoader)

resolveClassName

public static Class<?> resolveClassName(String className,
                                        ClassLoader classLoader)
                                 throws IllegalArgumentException
Resolve the given class name into a Class instance. Supports primitives (like "int") and array class names (like "String[]").

This is effectively equivalent to the forName method with the same arguments, with the only difference being the exceptions thrown in case of class loading failure.

Parameters:
className - the name of the Class
classLoader - the class loader to use (may be null, which indicates the default class loader)
Returns:
Class instance for the supplied name
Throws:
IllegalArgumentException - if the class name was not resolvable (that is, the class could not be found or the class file could not be loaded)
See Also:
forName(String, ClassLoader)

resolvePrimitiveClassName

public static Class<?> resolvePrimitiveClassName(String name)
Resolve the given class name as primitive class, if appropriate, according to the JVM's naming rules for primitive classes.

Also supports the JVM's internal class names for primitive arrays. Does not support the "[]" suffix notation for primitive arrays; this is only supported by forName(String, ClassLoader).

Parameters:
name - the name of the potentially primitive class
Returns:
the primitive class, or null if the name does not denote a primitive class or primitive array class

isPresent

@Deprecated
public static boolean isPresent(String className)
Deprecated. as of Spring 2.5, in favor of isPresent(String, ClassLoader)

Determine whether the Class identified by the supplied name is present and can be loaded. Will return false if either the class or one of its dependencies is not present or cannot be loaded.

Parameters:
className - the name of the class to check
Returns:
whether the specified class is present

isPresent

public static boolean isPresent(String className,
                                ClassLoader classLoader)
Determine whether the Class identified by the supplied name is present and can be loaded. Will return false if either the class or one of its dependencies is not present or cannot be loaded.

Parameters:
className - the name of the class to check
classLoader - the class loader to use (may be null, which indicates the default class loader)
Returns:
whether the specified class is present

getUserClass

public static Class<?> getUserClass(Object instance)
Return the user-defined class for the given instance: usually simply the class of the given instance, but the original class in case of a CGLIB-generated subclass.

Parameters:
instance - the instance to check
Returns:
the user-defined class

getUserClass

public static Class<?> getUserClass(Class<?> clazz)
Return the user-defined class for the given class: usually simply the given class, but the original class in case of a CGLIB-generated subclass.

Parameters:
clazz - the class to check
Returns:
the user-defined class

isCacheSafe

public static boolean isCacheSafe(Class<?> clazz,
                                  ClassLoader classLoader)
Check whether the given class is cache-safe in the given context, i.e. whether it is loaded by the given ClassLoader or a parent of it.

Parameters:
clazz - the class to analyze
classLoader - the ClassLoader to potentially cache metadata in

getShortName

public static String getShortName(String className)
Get the class name without the qualified package name.

Parameters:
className - the className to get the short name for
Returns:
the class name of the class without the package name
Throws:
IllegalArgumentException - if the className is empty

getShortName

public static String getShortName(Class<?> clazz)
Get the class name without the qualified package name.

Parameters:
clazz - the class to get the short name for
Returns:
the class name of the class without the package name

getShortNameAsProperty

public static String getShortNameAsProperty(Class<?> clazz)
Return the short string name of a Java class in uncapitalized JavaBeans property format. Strips the outer class name in case of an inner class.

Parameters:
clazz - the class
Returns:
the short name rendered in a standard JavaBeans property format
See Also:
Introspector.decapitalize(String)

getClassFileName

public static String getClassFileName(Class<?> clazz)
Determine the name of the class file, relative to the containing package: e.g. "String.class"

Parameters:
clazz - the class
Returns:
the file name of the ".class" file

getPackageName

public static String getPackageName(Class<?> clazz)
Determine the name of the package of the given class: e.g. "java.lang" for the java.lang.String class.

Parameters:
clazz - the class
Returns:
the package name, or the empty String if the class is defined in the default package

getQualifiedName

public static String getQualifiedName(Class<?> clazz)
Return the qualified name of the given class: usually simply the class name, but component type class name + "[]" for arrays.

Parameters:
clazz - the class
Returns:
the qualified name of the class

getQualifiedMethodName

public static String getQualifiedMethodName(Method method)
Return the qualified name of the given method, consisting of fully qualified interface/class name + "." + method name.

Parameters:
method - the method
Returns:
the qualified name of the method

getDescriptiveType

public static String getDescriptiveType(Object value)
Return a descriptive name for the given object's type: usually simply the class name, but component type class name + "[]" for arrays, and an appended list of implemented interfaces for JDK proxies.

Parameters:
value - the value to introspect
Returns:
the qualified name of the class

matchesTypeName

public static boolean matchesTypeName(Class<?> clazz,
                                      String typeName)
Check whether the given class matches the user-specified type name.

Parameters:
clazz - the class to check
typeName - the type name to match

hasConstructor

public static boolean hasConstructor(Class<?> clazz,
                                     Class<?>... paramTypes)
Determine whether the given class has a public constructor with the given signature.

Essentially translates NoSuchMethodException to "false".

Parameters:
clazz - the clazz to analyze
paramTypes - the parameter types of the method
Returns:
whether the class has a corresponding constructor
See Also:
Class.getMethod(java.lang.String, java.lang.Class...)

getConstructorIfAvailable

public static <T> Constructor<T> getConstructorIfAvailable(Class<T> clazz,
                                                           Class<?>... paramTypes)
Determine whether the given class has a public constructor with the given signature, and return it if available (else return null).

Essentially translates NoSuchMethodException to null.

Parameters:
clazz - the clazz to analyze
paramTypes - the parameter types of the method
Returns:
the constructor, or null if not found
See Also:
Class.getConstructor(java.lang.Class...)

hasMethod

public static boolean hasMethod(Class<?> clazz,
                                String methodName,
                                Class<?>... paramTypes)
Determine whether the given class has a method with the given signature.

Essentially translates NoSuchMethodException to "false".

Parameters:
clazz - the clazz to analyze
methodName - the name of the method
paramTypes - the parameter types of the method
Returns:
whether the class has a corresponding method
See Also:
Class.getMethod(java.lang.String, java.lang.Class...)

getMethodIfAvailable

public static Method getMethodIfAvailable(Class<?> clazz,
                                          String methodName,
                                          Class<?>... paramTypes)
Determine whether the given class has a method with the given signature, and return it if available (else return null).

Essentially translates NoSuchMethodException to null.

Parameters:
clazz - the clazz to analyze
methodName - the name of the method
paramTypes - the parameter types of the method
Returns:
the method, or null if not found
See Also:
Class.getMethod(java.lang.String, java.lang.Class...)

getMethodCountForName

public static int getMethodCountForName(Class<?> clazz,
                                        String methodName)
Return the number of methods with a given name (with any argument types), for the given class and/or its superclasses. Includes non-public methods.

Parameters:
clazz - the clazz to check
methodName - the name of the method
Returns:
the number of methods with the given name

hasAtLeastOneMethodWithName

public static boolean hasAtLeastOneMethodWithName(Class<?> clazz,
                                                  String methodName)
Does the given class or one of its superclasses at least have one or more methods with the supplied name (with any argument types)? Includes non-public methods.

Parameters:
clazz - the clazz to check
methodName - the name of the method
Returns:
whether there is at least one method with the given name

getMostSpecificMethod

public static Method getMostSpecificMethod(Method method,
                                           Class<?> targetClass)
Given a method, which may come from an interface, and a target class used in the current reflective invocation, find the corresponding target method if there is one. E.g. the method may be IFoo.bar() and the target class may be DefaultFoo. In this case, the method may be DefaultFoo.bar(). This enables attributes on that method to be found.

NOTE: In contrast to AopUtils.getMostSpecificMethod(java.lang.reflect.Method, java.lang.Class), this method does not resolve Java 5 bridge methods automatically. Call BridgeMethodResolver.findBridgedMethod(java.lang.reflect.Method) if bridge method resolution is desirable (e.g. for obtaining metadata from the original method definition).

Parameters:
method - the method to be invoked, which may come from an interface
targetClass - the target class for the current invocation. May be null or may not even implement the method.
Returns:
the specific target method, or the original method if the targetClass doesn't implement it or is null

getStaticMethod

public static Method getStaticMethod(Class<?> clazz,
                                     String methodName,
                                     Class<?>... args)
Return a public static method of a class.

Parameters:
methodName - the static method name
clazz - the class which defines the method
args - the parameter types to the method
Returns:
the static method, or null if no static method was found
Throws:
IllegalArgumentException - if the method name is blank or the clazz is null

isPrimitiveWrapper

public static boolean isPrimitiveWrapper(Class<?> clazz)
Check if the given class represents a primitive wrapper, i.e. Boolean, Byte, Character, Short, Integer, Long, Float, or Double.

Parameters:
clazz - the class to check
Returns:
whether the given class is a primitive wrapper class

isPrimitiveOrWrapper

public static boolean isPrimitiveOrWrapper(Class<?> clazz)
Check if the given class represents a primitive (i.e. boolean, byte, char, short, int, long, float, or double) or a primitive wrapper (i.e. Boolean, Byte, Character, Short, Integer, Long, Float, or Double).

Parameters:
clazz - the class to check
Returns:
whether the given class is a primitive or primitive wrapper class

isPrimitiveArray

public static boolean isPrimitiveArray(Class<?> clazz)
Check if the given class represents an array of primitives, i.e. boolean, byte, char, short, int, long, float, or double.

Parameters:
clazz - the class to check
Returns:
whether the given class is a primitive array class

isPrimitiveWrapperArray

public static boolean isPrimitiveWrapperArray(Class<?> clazz)
Check if the given class represents an array of primitive wrappers, i.e. Boolean, Byte, Character, Short, Integer, Long, Float, or Double.

Parameters:
clazz - the class to check
Returns:
whether the given class is a primitive wrapper array class

resolvePrimitiveIfNecessary

public static Class<?> resolvePrimitiveIfNecessary(Class<?> clazz)
Resolve the given class if it is a primitive class, returning the corresponding primitive wrapper type instead.

Parameters:
clazz - the class to check
Returns:
the original class, or a primitive wrapper for the original primitive type

isAssignable

public static boolean isAssignable(Class<?> lhsType,
                                   Class<?> rhsType)
Check if the right-hand side type may be assigned to the left-hand side type, assuming setting by reflection. Considers primitive wrapper classes as assignable to the corresponding primitive types.

Parameters:
lhsType - the target type
rhsType - the value type that should be assigned to the target type
Returns:
if the target type is assignable from the value type
See Also:
TypeUtils.isAssignable(java.lang.reflect.Type, java.lang.reflect.Type)

isAssignableValue

public static boolean isAssignableValue(Class<?> type,
                                        Object value)
Determine if the given type is assignable from the given value, assuming setting by reflection. Considers primitive wrapper classes as assignable to the corresponding primitive types.

Parameters:
type - the target type
value - the value that should be assigned to the type
Returns:
if the type is assignable from the value

convertResourcePathToClassName

public static String convertResourcePathToClassName(String resourcePath)
Convert a "/"-based resource path to a "."-based fully qualified class name.

Parameters:
resourcePath - the resource path pointing to a class
Returns:
the corresponding fully qualified class name

convertClassNameToResourcePath

public static String convertClassNameToResourcePath(String className)
Convert a "."-based fully qualified class name to a "/"-based resource path.

Parameters:
className - the fully qualified class name
Returns:
the corresponding resource path, pointing to the class

addResourcePathToPackagePath

public static String addResourcePathToPackagePath(Class<?> clazz,
                                                  String resourceName)
Return a path suitable for use with ClassLoader.getResource (also suitable for use with Class.getResource by prepending a slash ('/') to the return value). Built by taking the package of the specified class file, converting all dots ('.') to slashes ('/'), adding a trailing slash if necessary, and concatenating the specified resource name to this.
As such, this function may be used to build a path suitable for loading a resource file that is in the same package as a class file, although ClassPathResource is usually even more convenient.

Parameters:
clazz - the Class whose package will be used as the base
resourceName - the resource name to append. A leading slash is optional.
Returns:
the built-up resource path
See Also:
ClassLoader.getResource(java.lang.String), Class.getResource(java.lang.String)

classPackageAsResourcePath

public static String classPackageAsResourcePath(Class<?> clazz)
Given an input class object, return a string which consists of the class's package name as a pathname, i.e., all dots ('.') are replaced by slashes ('/'). Neither a leading nor trailing slash is added. The result could be concatenated with a slash and the name of a resource and fed directly to ClassLoader.getResource(). For it to be fed to Class.getResource instead, a leading slash would also have to be prepended to the returned value.

Parameters:
clazz - the input class. A null value or the default (empty) package will result in an empty string ("") being returned.
Returns:
a path which represents the package name
See Also:
ClassLoader.getResource(java.lang.String), Class.getResource(java.lang.String)

classNamesToString

public static String classNamesToString(Class... classes)
Build a String that consists of the names of the classes/interfaces in the given array.

Basically like AbstractCollection.toString(), but stripping the "class "/"interface " prefix before every class name.

Parameters:
classes - a Collection of Class objects (may be null)
Returns:
a String of form "[com.foo.Bar, com.foo.Baz]"
See Also:
AbstractCollection.toString()

classNamesToString

public static String classNamesToString(Collection<Class> classes)
Build a String that consists of the names of the classes/interfaces in the given collection.

Basically like AbstractCollection.toString(), but stripping the "class "/"interface " prefix before every class name.

Parameters:
classes - a Collection of Class objects (may be null)
Returns:
a String of form "[com.foo.Bar, com.foo.Baz]"
See Also:
AbstractCollection.toString()

getAllInterfaces

public static Class[] getAllInterfaces(Object instance)
Return all interfaces that the given instance implements as array, including ones implemented by superclasses.

Parameters:
instance - the instance to analyze for interfaces
Returns:
all interfaces that the given instance implements as array

getAllInterfacesForClass

public static Class<?>[] getAllInterfacesForClass(Class<?> clazz)
Return all interfaces that the given class implements as array, including ones implemented by superclasses.

If the class itself is an interface, it gets returned as sole interface.

Parameters:
clazz - the class to analyze for interfaces
Returns:
all interfaces that the given object implements as array

getAllInterfacesForClass

public static Class<?>[] getAllInterfacesForClass(Class<?> clazz,
                                                  ClassLoader classLoader)
Return all interfaces that the given class implements as array, including ones implemented by superclasses.

If the class itself is an interface, it gets returned as sole interface.

Parameters:
clazz - the class to analyze for interfaces
classLoader - the ClassLoader that the interfaces need to be visible in (may be null when accepting all declared interfaces)
Returns:
all interfaces that the given object implements as array

getAllInterfacesAsSet

public static Set<Class> getAllInterfacesAsSet(Object instance)
Return all interfaces that the given instance implements as Set, including ones implemented by superclasses.

Parameters:
instance - the instance to analyze for interfaces
Returns:
all interfaces that the given instance implements as Set

getAllInterfacesForClassAsSet

public static Set<Class> getAllInterfacesForClassAsSet(Class clazz)
Return all interfaces that the given class implements as Set, including ones implemented by superclasses.

If the class itself is an interface, it gets returned as sole interface.

Parameters:
clazz - the class to analyze for interfaces
Returns:
all interfaces that the given object implements as Set

getAllInterfacesForClassAsSet

public static Set<Class> getAllInterfacesForClassAsSet(Class clazz,
                                                       ClassLoader classLoader)
Return all interfaces that the given class implements as Set, including ones implemented by superclasses.

If the class itself is an interface, it gets returned as sole interface.

Parameters:
clazz - the class to analyze for interfaces
classLoader - the ClassLoader that the interfaces need to be visible in (may be null when accepting all declared interfaces)
Returns:
all interfaces that the given object implements as Set

createCompositeInterface

public static Class<?> createCompositeInterface(Class<?>[] interfaces,
                                                ClassLoader classLoader)
Create a composite interface Class for the given interfaces, implementing the given interfaces in one single Class.

This implementation builds a JDK proxy class for the given interfaces.

Parameters:
interfaces - the interfaces to merge
classLoader - the ClassLoader to create the composite Class in
Returns:
the merged interface as Class
See Also:
Proxy.getProxyClass(java.lang.ClassLoader, java.lang.Class...)

isVisible

public static boolean isVisible(Class<?> clazz,
                                ClassLoader classLoader)
Check whether the given class is visible in the given ClassLoader.

Parameters:
clazz - the class to check (typically an interface)
classLoader - the ClassLoader to check against (may be null, in which case this method will always return true)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CollectionUtils

org.springframework.util
Class CollectionUtils

java.lang.Object
    extended by  org.springframework.util.CollectionUtils

public abstract class CollectionUtils
extends Object

Miscellaneous collection utility methods. Mainly for internal use within the framework.

Since:
1.1.3
Author:
Juergen Hoeller, Rob Harrop

Constructor Summary
CollectionUtils()
Method Summary
static List arrayToList(Object source)
Convert the supplied array into a List.
static boolean contains(Enumeration enumeration, Object element)
Check whether the given Enumeration contains the given element.
static boolean contains(Iterator iterator, Object element)
Check whether the given Iterator contains the given element.
static boolean containsAny(Collection source, Collection candidates)
Return true if any element in 'candidates' is contained in 'source'; otherwise returns false.
static boolean containsInstance(Collection collection, Object element)
Check whether the given Collection contains the given element instance.
static Object findFirstMatch(Collection source, Collection candidates)
Return the first element in 'candidates' that is contained in 'source'.
static Object findValueOfType(Collection<?> collection, Class<?>[] types)
Find a single value of one of the given types in the given Collection: searching the Collection for a value of the first type, then searching for a value of the second type, etc.
static
<T> T
findValueOfType(Collection<?> collection, Class<T> type)
Find a single value of the given type in the given Collection.
static boolean hasUniqueObject(Collection collection)
Determine whether the given Collection only contains a single unique object.
static boolean isEmpty(Collection collection)
Return true if the supplied Collection is null or empty.
static boolean isEmpty(Map map)
Return true if the supplied Map is null or empty.
static void mergeArrayIntoCollection(Object array, Collection collection)
Merge the given array into the given Collection.
static void mergePropertiesIntoMap(Properties props, Map map)
Merge the given Properties instance into the given Map, copying all properties (key-value pairs) over.
static
<E> Iterator<E>
toIterator(Enumeration<E> enumeration)
Adapts an enumeration to an iterator.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CollectionUtils

public CollectionUtils()
Method Detail

isEmpty

public static boolean isEmpty(Collection collection)
Return true if the supplied Collection is null or empty. Otherwise, return false.

Parameters:
collection - the Collection to check
Returns:
whether the given Collection is empty

isEmpty

public static boolean isEmpty(Map map)
Return true if the supplied Map is null or empty. Otherwise, return false.

Parameters:
map - the Map to check
Returns:
whether the given Map is empty

arrayToList

public static List arrayToList(Object source)
Convert the supplied array into a List. A primitive array gets converted into a List of the appropriate wrapper type.

A null source value will be converted to an empty List.

Parameters:
source - the (potentially primitive) array
Returns:
the converted List result
See Also:
ObjectUtils.toObjectArray(Object)

mergeArrayIntoCollection

public static void mergeArrayIntoCollection(Object array,
                                            Collection collection)
Merge the given array into the given Collection.

Parameters:
array - the array to merge (may be null)
collection - the target Collection to merge the array into

mergePropertiesIntoMap

public static void mergePropertiesIntoMap(Properties props,
                                          Map map)
Merge the given Properties instance into the given Map, copying all properties (key-value pairs) over.

Uses Properties.propertyNames() to even catch default properties linked into the original Properties instance.

Parameters:
props - the Properties instance to merge (may be null)
map - the target Map to merge the properties into

contains

public static boolean contains(Iterator iterator,
                               Object element)
Check whether the given Iterator contains the given element.

Parameters:
iterator - the Iterator to check
element - the element to look for
Returns:
true if found, false else

contains

public static boolean contains(Enumeration enumeration,
                               Object element)
Check whether the given Enumeration contains the given element.

Parameters:
enumeration - the Enumeration to check
element - the element to look for
Returns:
true if found, false else

containsInstance

public static boolean containsInstance(Collection collection,
                                       Object element)
Check whether the given Collection contains the given element instance.

Enforces the given instance to be present, rather than returning true for an equal element as well.

Parameters:
collection - the Collection to check
element - the element to look for
Returns:
true if found, false else

containsAny

public static boolean containsAny(Collection source,
                                  Collection candidates)
Return true if any element in 'candidates' is contained in 'source'; otherwise returns false.

Parameters:
source - the source Collection
candidates - the candidates to search for
Returns:
whether any of the candidates has been found

findFirstMatch

public static Object findFirstMatch(Collection source,
                                    Collection candidates)
Return the first element in 'candidates' that is contained in 'source'. If no element in 'candidates' is present in 'source' returns null. Iteration order is Collection implementation specific.

Parameters:
source - the source Collection
candidates - the candidates to search for
Returns:
the first present object, or null if not found

findValueOfType

public static <T> T findValueOfType(Collection<?> collection,
                                    Class<T> type)
Find a single value of the given type in the given Collection.

Parameters:
collection - the Collection to search
type - the type to look for
Returns:
a value of the given type found if there is a clear match, or null if none or more than one such value found

findValueOfType

public static Object findValueOfType(Collection<?> collection,
                                     Class<?>[] types)
Find a single value of one of the given types in the given Collection: searching the Collection for a value of the first type, then searching for a value of the second type, etc.

Parameters:
collection - the collection to search
types - the types to look for, in prioritized order
Returns:
a value of one of the given types found if there is a clear match, or null if none or more than one such value found

hasUniqueObject

public static boolean hasUniqueObject(Collection collection)
Determine whether the given Collection only contains a single unique object.

Parameters:
collection - the Collection to check
Returns:
true if the collection contains a single reference or multiple references to the same instance, false else

toIterator

public static <E> Iterator<E> toIterator(Enumeration<E> enumeration)
Adapts an enumeration to an iterator.

Parameters:
enumeration - the enumeration
Returns:
the iterator
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CommonsLogWriter

org.springframework.util
Class CommonsLogWriter

java.lang.Object
    extended by  java.io.Writer
        extended by  org.springframework.util.CommonsLogWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable
public class CommonsLogWriter
extends Writer

java.io.Writer adapter for a Commons Logging Log.

Since:
2.5.1
Author:
Juergen Hoeller

Field Summary
Fields inherited from class java.io.Writer
lock
Constructor Summary
CommonsLogWriter(Log logger)
Create a new CommonsLogWriter for the given Commons Logging logger.
Method Summary
void | close()
void | flush()
void | write(char ch)
void | write(char[] buffer, int offset, int length)
Methods inherited from class java.io.Writer
append, append, append, write, write, write, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CommonsLogWriter

public CommonsLogWriter(Log logger)
Create a new CommonsLogWriter for the given Commons Logging logger.

Parameters:
logger - the Commons Logging logger to write to
Method Detail

write

public void write(char ch)

write

public void write(char[] buffer,
                  int offset,
                  int length)
Specified by:
write in class Writer

flush

public void flush()
Specified by:
flush in interface Flushable
Specified by:
flush in class Writer

close

public void close()
Specified by:
close in interface Closeable
Specified by:
close in class Writer
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CompositeIterator

org.springframework.util
Class CompositeIterator<E>

java.lang.Object
    extended by  org.springframework.util.CompositeIterator<E>
All Implemented Interfaces:
Iterator<E>
public class CompositeIterator<E>
extends Object
implements Iterator<E>

Iterator that combines multiple other iterators. This implementation maintains a list of iterators which are invoked in sequence until all iterators are exhausted.

Author:
Erwin Vervaet

Constructor Summary
CompositeIterator()
Create a new composite iterator.
Method Summary
void | add(Iterator<E> iterator) Add given iterator to this composite.
boolean | hasNext()
E | next()
void | remove()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CompositeIterator

public CompositeIterator()
Create a new composite iterator. Add iterators using the add(Iterator) method.

Method Detail

add

public void add(Iterator<E> iterator)
Add given iterator to this composite.

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<E>

next

public E next()
Specified by:
next in interface Iterator<E>

remove

public void remove()
Specified by:
remove in interface Iterator<E>
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConcurrencyThrottleSupport

org.springframework.util
Class ConcurrencyThrottleSupport

java.lang.Object
    extended by  org.springframework.util.ConcurrencyThrottleSupport
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ConcurrencyThrottleInterceptor
public abstract class ConcurrencyThrottleSupport
extends Object
implements Serializable

Support class for throttling concurrent access to a specific resource.

Designed for use as a base class, with the subclass invoking the beforeAccess() and afterAccess() methods at appropriate points of its workflow. Note that afterAccess should usually be called in a finally block!

The default concurrency limit of this support class is -1 ("unbounded concurrency"). Subclasses may override this default; check the javadoc of the concrete class that you're using.

Since:
1.2.5
Author:
Juergen Hoeller
See Also:
setConcurrencyLimit(int), beforeAccess(), afterAccess(), ConcurrencyThrottleInterceptor, Serializable, Serialized Form

Field Summary
protected Log | logger Transient to optimize serialization
static int | NO_CONCURRENCY Switch concurrency 'off': that is, don't allow any concurrent invocations.
static int | UNBOUNDED_CONCURRENCY Permit any number of concurrent invocations: that is, don't throttle concurrency.
Constructor Summary
ConcurrencyThrottleSupport()
Method Summary
protected void | afterAccess() To be invoked after the main execution logic of concrete subclasses.
protected void | beforeAccess() To be invoked before the main execution logic of concrete subclasses.
int | getConcurrencyLimit() Return the maximum number of concurrent access attempts allowed.
boolean | isThrottleActive() Return whether this throttle is currently active.
void | setConcurrencyLimit(int concurrencyLimit) Set the maximum number of concurrent access attempts allowed.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

UNBOUNDED_CONCURRENCY

public static final int UNBOUNDED_CONCURRENCY
Permit any number of concurrent invocations: that is, don't throttle concurrency.

See Also:
Constant Field Values

NO_CONCURRENCY

public static final int NO_CONCURRENCY
Switch concurrency 'off': that is, don't allow any concurrent invocations.

See Also:
Constant Field Values

logger

protected transient Log logger
Transient to optimize serialization

Constructor Detail

ConcurrencyThrottleSupport

public ConcurrencyThrottleSupport()
Method Detail

setConcurrencyLimit

public void setConcurrencyLimit(int concurrencyLimit)
Set the maximum number of concurrent access attempts allowed. -1 indicates unbounded concurrency.

In principle, this limit can be changed at runtime, although it is generally designed as a config time setting.

NOTE: Do not switch between -1 and any concrete limit at runtime, as this will lead to inconsistent concurrency counts: A limit of -1 effectively turns off concurrency counting completely.

getConcurrencyLimit

public int getConcurrencyLimit()
Return the maximum number of concurrent access attempts allowed.

isThrottleActive

public boolean isThrottleActive()
Return whether this throttle is currently active.

Returns:
true if the concurrency limit for this instance is active
See Also:
getConcurrencyLimit()

beforeAccess

protected void beforeAccess()
To be invoked before the main execution logic of concrete subclasses.

This implementation applies the concurrency throttle.

See Also:
afterAccess()

afterAccess

protected void afterAccess()
To be invoked after the main execution logic of concrete subclasses.

See Also:
beforeAccess()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CustomizableThreadCreator

org.springframework.util
Class CustomizableThreadCreator

java.lang.Object
    extended by  org.springframework.util.CustomizableThreadCreator
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CustomizableThreadFactory, CustomizableThreadFactory, SimpleAsyncTaskExecutor
public class CustomizableThreadCreator
extends Object
implements Serializable

Simple customizable helper class for creating threads. Provides various bean properties, such as thread name prefix, thread priority, etc.

Serves as base class for thread factories such as CustomizableThreadFactory.

Since:
2.0.3
Author:
Juergen Hoeller
See Also:
CustomizableThreadFactory, Serialized Form

Constructor Summary
CustomizableThreadCreator()
Create a new CustomizableThreadCreator with default thread name prefix.
CustomizableThreadCreator(String threadNamePrefix)
Create a new CustomizableThreadCreator with the given thread name prefix.
Method Summary
Thread | createThread(Runnable runnable) Template method for the creation of a Thread.
protected String | getDefaultThreadNamePrefix() Build the default thread name prefix for this factory.
ThreadGroup | getThreadGroup() Return the thread group that threads should be created in (or null) for the default group.
String | getThreadNamePrefix() Return the thread name prefix to use for the names of newly created threads.
int | getThreadPriority() Return the priority of the threads that this factory creates.
boolean | isDaemon() Return whether this factory should create daemon threads.
protected String | nextThreadName() Return the thread name to use for a newly created thread.
void | setDaemon(boolean daemon) Set whether this factory is supposed to create daemon threads, just executing as long as the application itself is running.
void | setThreadGroup(ThreadGroup threadGroup) Specify the thread group that threads should be created in.
void | setThreadGroupName(String name) Specify the name of the thread group that threads should be created in.
void | setThreadNamePrefix(String threadNamePrefix) Specify the prefix to use for the names of newly created threads.
void | setThreadPriority(int threadPriority) Set the priority of the threads that this factory creates.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CustomizableThreadCreator

public CustomizableThreadCreator()
Create a new CustomizableThreadCreator with default thread name prefix.

CustomizableThreadCreator

public CustomizableThreadCreator(String threadNamePrefix)
Create a new CustomizableThreadCreator with the given thread name prefix.

Parameters:
threadNamePrefix - the prefix to use for the names of newly created threads
Method Detail

setThreadNamePrefix

public void setThreadNamePrefix(String threadNamePrefix)
Specify the prefix to use for the names of newly created threads. Default is "SimpleAsyncTaskExecutor-".

getThreadNamePrefix

public String getThreadNamePrefix()
Return the thread name prefix to use for the names of newly created threads.

setThreadPriority

public void setThreadPriority(int threadPriority)
Set the priority of the threads that this factory creates. Default is 5.

See Also:
Thread.NORM_PRIORITY

getThreadPriority

public int getThreadPriority()
Return the priority of the threads that this factory creates.

setDaemon

public void setDaemon(boolean daemon)
Set whether this factory is supposed to create daemon threads, just executing as long as the application itself is running.

Default is "false": Concrete factories usually support explicit cancelling. Hence, if the application shuts down, Runnables will by default finish their execution.

Specify "true" for eager shutdown of threads which still actively execute a Runnable.

See Also:
Thread.setDaemon(boolean)

isDaemon

public boolean isDaemon()
Return whether this factory should create daemon threads.

setThreadGroupName

public void setThreadGroupName(String name)
Specify the name of the thread group that threads should be created in.

See Also:
setThreadGroup(java.lang.ThreadGroup)

setThreadGroup

public void setThreadGroup(ThreadGroup threadGroup)
Specify the thread group that threads should be created in.

See Also:
setThreadGroupName(java.lang.String)

getThreadGroup

public ThreadGroup getThreadGroup()
Return the thread group that threads should be created in (or null) for the default group.

createThread

public Thread createThread(Runnable runnable)
Template method for the creation of a Thread.

Default implementation creates a new Thread for the given Runnable, applying an appropriate thread name.

Parameters:
runnable - the Runnable to execute
See Also:
nextThreadName()

nextThreadName

protected String nextThreadName()
Return the thread name to use for a newly created thread.

Default implementation returns the specified thread name prefix with an increasing thread count appended: for example, "SimpleAsyncTaskExecutor-0".

See Also:
getThreadNamePrefix()

getDefaultThreadNamePrefix

protected String getDefaultThreadNamePrefix()
Build the default thread name prefix for this factory.

Returns:
the default thread name prefix (never null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultPropertiesPersister

org.springframework.util
Class DefaultPropertiesPersister

java.lang.Object
    extended by  org.springframework.util.DefaultPropertiesPersister
All Implemented Interfaces:
PropertiesPersister
public class DefaultPropertiesPersister
extends Object
implements PropertiesPersister

Default implementation of the PropertiesPersister interface. Follows the native parsing of java.util.Properties.

Allows for reading from any Reader and writing to any Writer, for example to specify a charset for a properties file. This is a capability that standard java.util.Properties unfortunately lacks up until JDK 1.5: You can only load files using the ISO-8859-1 charset there.

Loading from and storing to a stream delegates to Properties.load and Properties.store, respectively, to be fully compatible with the Unicode conversion as implemented by the JDK Properties class. On JDK 1.6, Properties.load/store will also be used for readers/writers, effectively turning this class into a plain backwards compatibility adapter.

The persistence code that works with Reader/Writer follows the JDK's parsing strategy but does not implement Unicode conversion, because the Reader/Writer should already apply proper decoding/encoding of characters. If you use prefer to escape unicode characters in your properties files, do not specify an encoding for a Reader/Writer (like ReloadableResourceBundleMessageSource's "defaultEncoding" and "fileEncodings" properties).

As of Spring 1.2.2, this implementation also supports properties XML files, through the loadFromXml and storeToXml methods. The default implementations delegate to JDK 1.5's corresponding methods, throwing an exception if running on an older JDK. Those implementations could be subclassed to apply custom XML handling on JDK 1.4, for example.

Since:
10.03.2004
Author:
Juergen Hoeller
See Also:
Properties,
Properties.load(java.io.Reader),
Properties.store(java.io.Writer, java.lang.String),
ReloadableResourceBundleMessageSource.setPropertiesPersister(org.springframework.util.PropertiesPersister),
ReloadableResourceBundleMessageSource.setDefaultEncoding(java.lang.String),
ReloadableResourceBundleMessageSource.setFileEncodings(java.util.Properties)

Constructor Summary
DefaultPropertiesPersister()
Method Summary
protected void | doLoad(Properties props, Reader reader)
protected void | doStore(Properties props, Writer writer, String header)
protected boolean | endsWithContinuationMarker(String line)
protected String | escape(String str, boolean isKey)
void | load(Properties props, InputStream is) Load properties from the given InputStream into the given Properties object.
void | load(Properties props, Reader reader) Load properties from the given Reader into the given Properties object.
void | loadFromXml(Properties props, InputStream is) Load properties from the given XML InputStream into the given Properties object.
void | store(Properties props, OutputStream os, String header) Write the contents of the given Properties object to the given OutputStream.
void | store(Properties props, Writer writer, String header) Write the contents of the given Properties object to the given Writer.
void | storeToXml(Properties props, OutputStream os, String header) Write the contents of the given Properties object to the given XML OutputStream.
void | storeToXml(Properties props, OutputStream os, String header, String encoding) Write the contents of the given Properties object to the given XML OutputStream.
protected String | unescape(String str)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DefaultPropertiesPersister

public DefaultPropertiesPersister()
Method Detail

load

public void load(Properties props,
                 InputStream is)
          throws IOException
Description copied from interface: PropertiesPersister
Load properties from the given InputStream into the given Properties object.

Specified by:
load in interface PropertiesPersister
Parameters:
props - the Properties object to load into
is - the InputStream to load from
Throws:
IOException - in case of I/O errors
See Also:
Properties.load(java.io.Reader)

load

public void load(Properties props,
                 Reader reader)
          throws IOException
Description copied from interface: PropertiesPersister
Load properties from the given Reader into the given Properties object.

Specified by:
load in interface PropertiesPersister
Parameters:
props - the Properties object to load into
reader - the Reader to load from
Throws:
IOException - in case of I/O errors

doLoad

protected void doLoad(Properties props,
                      Reader reader)
               throws IOException
Throws:
IOException

endsWithContinuationMarker

protected boolean endsWithContinuationMarker(String line)

unescape

protected String unescape(String str)

store

public void store(Properties props,
                  OutputStream os,
                  String header)
           throws IOException
Description copied from interface: PropertiesPersister
Write the contents of the given Properties object to the given OutputStream.

Specified by:
store in interface PropertiesPersister
Parameters:
props - the Properties object to store
os - the OutputStream to write to
header - the description of the property list
Throws:
IOException - in case of I/O errors
See Also:
Properties.store(java.io.Writer, java.lang.String)

store

public void store(Properties props,
                  Writer writer,
                  String header)
           throws IOException
Description copied from interface: PropertiesPersister
Write the contents of the given Properties object to the given Writer.

Specified by:
store in interface PropertiesPersister
Parameters:
props - the Properties object to store
writer - the Writer to write to
header - the description of the property list
Throws:
IOException - in case of I/O errors

doStore

protected void doStore(Properties props,
                       Writer writer,
                       String header)
                throws IOException
Throws:
IOException

escape

protected String escape(String str,
                        boolean isKey)

loadFromXml

public void loadFromXml(Properties props,
                        InputStream is)
                 throws IOException
Description copied from interface: PropertiesPersister
Load properties from the given XML InputStream into the given Properties object.

Specified by:
loadFromXml in interface PropertiesPersister
Parameters:
props - the Properties object to load into
is - the InputStream to load from
Throws:
IOException - in case of I/O errors
See Also:
Properties.loadFromXML(java.io.InputStream)

storeToXml

public void storeToXml(Properties props,
                       OutputStream os,
                       String header)
                throws IOException
Description copied from interface: PropertiesPersister
Write the contents of the given Properties object to the given XML OutputStream.

Specified by:
storeToXml in interface PropertiesPersister
Parameters:
props - the Properties object to store
os - the OutputStream to write to
header - the description of the property list
Throws:
IOException - in case of I/O errors
See Also:
Properties.storeToXML(java.io.OutputStream, String)

storeToXml

public void storeToXml(Properties props,
                       OutputStream os,
                       String header,
                       String encoding)
                throws IOException
Description copied from interface: PropertiesPersister
Write the contents of the given Properties object to the given XML OutputStream.

Specified by:
storeToXml in interface PropertiesPersister
Parameters:
props - the Properties object to store
os - the OutputStream to write to
header - the description of the property list
encoding - the encoding to use
Throws:
IOException - in case of I/O errors
See Also:
Properties.storeToXML(java.io.OutputStream, String, String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DigestUtils

org.springframework.util
Class DigestUtils

java.lang.Object
    extended by  org.springframework.util.DigestUtils

public abstract class DigestUtils
extends Object

Miscellaneous methods for calculating digests.

Mainly for internal use within the framework; consider Apache Commons Codec for a more comprehensive suite of digest utilities.

Since:
3.0
Author:
Arjen Poutsma
See Also:
org.apache.commons.codec.digest.DigestUtils

Constructor Summary
DigestUtils()
Method Summary
static StringBuilder | appendMd5DigestAsHex(byte[] bytes, StringBuilder builder) Append a hexadecimal string representation of the MD5 digest of the given bytes to the given StringBuilder.
static byte[] | md5Digest(byte[] bytes) Calculate the MD5 digest of the given bytes.
static String | md5DigestAsHex(byte[] bytes) Return a hexadecimal string representation of the MD5 digest of the given bytes.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DigestUtils

public DigestUtils()
Method Detail

md5Digest

public static byte[] md5Digest(byte[] bytes)
Calculate the MD5 digest of the given bytes.

Parameters:
bytes - the bytes to calculate the digest over
Returns:
the digest

md5DigestAsHex

public static String md5DigestAsHex(byte[] bytes)
Return a hexadecimal string representation of the MD5 digest of the given bytes.

Parameters:
bytes - the bytes to calculate the digest over
Returns:
a hexadecimal digest string

appendMd5DigestAsHex

public static StringBuilder appendMd5DigestAsHex(byte[] bytes,
                                                 StringBuilder builder)
Append a hexadecimal string representation of the MD5 digest of the given bytes to the given StringBuilder.

Parameters:
bytes - the bytes to calculate the digest over
builder - the string builder to append the digest to
Returns:
the given string builder
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FileCopyUtils

org.springframework.util
Class FileCopyUtils

java.lang.Object
    extended by  org.springframework.util.FileCopyUtils

public abstract class FileCopyUtils
extends Object

Simple utility methods for file and stream copying. All copy methods use a block size of 4096 bytes, and close all affected streams when done.

Mainly for use within the framework, but also useful for application code.

Since:
06.10.2003
Author:
Juergen Hoeller

Field Summary
static int BUFFER_SIZE
Constructor Summary
FileCopyUtils()
Method Summary
static void | copy(byte[] in, File out) Copy the contents of the given byte array to the given output File.
static void | copy(byte[] in, OutputStream out) Copy the contents of the given byte array to the given OutputStream.
static int | copy(File in, File out) Copy the contents of the given input File to the given output File.
static int | copy(InputStream in, OutputStream out) Copy the contents of the given InputStream to the given OutputStream.
static int | copy(Reader in, Writer out) Copy the contents of the given Reader to the given Writer.
static void | copy(String in, Writer out) Copy the contents of the given String to the given output Writer.
static byte[] | copyToByteArray(File in) Copy the contents of the given input File into a new byte array.
static byte[] | copyToByteArray(InputStream in) Copy the contents of the given InputStream into a new byte array.
static String | copyToString(Reader in) Copy the contents of the given Reader into a String.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

BUFFER_SIZE

public static final int BUFFER_SIZE
See Also:
Constant Field Values
Constructor Detail

FileCopyUtils

public FileCopyUtils()
Method Detail

copy

public static int copy(File in,
                       File out)
                throws IOException
Copy the contents of the given input File to the given output File.

Parameters:
in - the file to copy from
out - the file to copy to
Returns:
the number of bytes copied
Throws:
IOException - in case of I/O errors

copy

public static void copy(byte[] in,
                        File out)
                 throws IOException
Copy the contents of the given byte array to the given output File.

Parameters:
in - the byte array to copy from
out - the file to copy to
Throws:
IOException - in case of I/O errors

copyToByteArray

public static byte[] copyToByteArray(File in)
                              throws IOException
Copy the contents of the given input File into a new byte array.

Parameters:
in - the file to copy from
Returns:
the new byte array that has been copied to
Throws:
IOException - in case of I/O errors

copy

public static int copy(InputStream in,
                       OutputStream out)
                throws IOException
Copy the contents of the given InputStream to the given OutputStream. Closes both streams when done.

Parameters:
in - the stream to copy from
out - the stream to copy to
Returns:
the number of bytes copied
Throws:
IOException - in case of I/O errors

copy

public static void copy(byte[] in,
                        OutputStream out)
                 throws IOException
Copy the contents of the given byte array to the given OutputStream. Closes the stream when done.

Parameters:
in - the byte array to copy from
out - the OutputStream to copy to
Throws:
IOException - in case of I/O errors

copyToByteArray

public static byte[] copyToByteArray(InputStream in)
                              throws IOException
Copy the contents of the given InputStream into a new byte array. Closes the stream when done.

Parameters:
in - the stream to copy from
Returns:
the new byte array that has been copied to
Throws:
IOException - in case of I/O errors

copy

public static int copy(Reader in,
                       Writer out)
                throws IOException
Copy the contents of the given Reader to the given Writer. Closes both when done.

Parameters:
in - the Reader to copy from
out - the Writer to copy to
Returns:
the number of characters copied
Throws:
IOException - in case of I/O errors

copy

public static void copy(String in,
                        Writer out)
                 throws IOException
Copy the contents of the given String to the given output Writer. Closes the write when done.

Parameters:
in - the String to copy from
out - the Writer to copy to
Throws:
IOException - in case of I/O errors

copyToString

public static String copyToString(Reader in)
                           throws IOException
Copy the contents of the given Reader into a String. Closes the reader when done.

Parameters:
in - the reader to copy from
Returns:
the String that has been copied to
Throws:
IOException - in case of I/O errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FileSystemUtils

org.springframework.util
Class FileSystemUtils

java.lang.Object
    extended by  org.springframework.util.FileSystemUtils

public abstract class FileSystemUtils
extends Object

Utility methods for working with the file system.

Since:
2.5.3
Author:
Rob Harrop, Juergen Hoeller

Constructor Summary
FileSystemUtils()
Method Summary
static void | copyRecursively(File src, File dest) Recursively copy the contents of the src file/directory to the dest file/directory.
static boolean | deleteRecursively(File root) Delete the supplied File - for directories, recursively delete any nested directories or files as well.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

FileSystemUtils

public FileSystemUtils()
Method Detail

deleteRecursively

public static boolean deleteRecursively(File root)
Delete the supplied File - for directories, recursively delete any nested directories or files as well.

Parameters:
root - the root File to delete
Returns:
true if the File was deleted, otherwise false

copyRecursively

public static void copyRecursively(File src,
                                   File dest)
                            throws IOException
Recursively copy the contents of the src file/directory to the dest file/directory.

Parameters:
src - the source directory
dest - the destination directory
Throws:
IOException - in the case of I/O errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LinkedCaseInsensitiveMap

org.springframework.util
Class LinkedCaseInsensitiveMap<V>

java.lang.Object
    extended by  java.util.AbstractMap<K,V>
        extended by  java.util.HashMap<K,V>
            extended by  java.util.LinkedHashMap<String,V>
                extended by  org.springframework.util.LinkedCaseInsensitiveMap<V>
All Implemented Interfaces:
Serializable, Cloneable, Map<String,V>
public class LinkedCaseInsensitiveMap<V>
extends LinkedHashMap<String,V>

LinkedHashMap variant that stores String keys in a case-insensitive manner, for example for key-based access in a results table.

Preserves the original order as well as the original casing of keys, while allowing for contains, get and remove calls with any case of key.

Does not support null keys.

Since:
3.0
Author:
Juergen Hoeller
See Also:
Serialized Form

Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor Summary
LinkedCaseInsensitiveMap()
Create a new LinkedCaseInsensitiveMap for the default Locale.
LinkedCaseInsensitiveMap(int initialCapacity)
Create a new LinkedCaseInsensitiveMap that wraps a LinkedHashMap with the given initial capacity and stores lower-case keys according to the default Locale.
LinkedCaseInsensitiveMap(int initialCapacity, Locale locale)
Create a new LinkedCaseInsensitiveMap that wraps a LinkedHashMap with the given initial capacity and stores lower-case keys according to the given Locale.
LinkedCaseInsensitiveMap(Locale locale)
Create a new LinkedCaseInsensitiveMap that stores lower-case keys according to the given Locale.
Method Summary
void | clear()
boolean | containsKey(Object key)
protected String | convertKey(String key) Convert the given key to a case-insensitive key.
V | get(Object key)
V | put(String key, V value)
V | remove(Object key)
Methods inherited from class java.util.LinkedHashMap
containsValue, removeEldestEntry
Methods inherited from class java.util.HashMap
clone, entrySet, isEmpty, keySet, putAll, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
entrySet, equals, hashCode, isEmpty, keySet, putAll, size, values

Constructor Detail

LinkedCaseInsensitiveMap

public LinkedCaseInsensitiveMap()
Create a new LinkedCaseInsensitiveMap for the default Locale.

See Also:
String.toLowerCase()

LinkedCaseInsensitiveMap

public LinkedCaseInsensitiveMap(Locale locale)
Create a new LinkedCaseInsensitiveMap that stores lower-case keys according to the given Locale.

Parameters:
locale - the Locale to use for lower-case conversion
See Also:
String.toLowerCase(java.util.Locale)

LinkedCaseInsensitiveMap

public LinkedCaseInsensitiveMap(int initialCapacity)
Create a new LinkedCaseInsensitiveMap that wraps a LinkedHashMap with the given initial capacity and stores lower-case keys according to the default Locale.

Parameters:
initialCapacity - the initial capacity
See Also:
String.toLowerCase()

LinkedCaseInsensitiveMap

public LinkedCaseInsensitiveMap(int initialCapacity,
                                Locale locale)
Create a new LinkedCaseInsensitiveMap that wraps a LinkedHashMap with the given initial capacity and stores lower-case keys according to the given Locale.

Parameters:
initialCapacity - the initial capacity
locale - the Locale to use for lower-case conversion
See Also:
String.toLowerCase(java.util.Locale)
Method Detail

put

public V put(String key,
             V value)
Specified by:
put in interface Map<String,V>
Overrides:
put in class HashMap<String,V>

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map<String,V>
Overrides:
containsKey in class HashMap<String,V>

get

public V get(Object key)
Specified by:
get in interface Map<String,V>
Overrides:
get in class LinkedHashMap<String,V>

remove

public V remove(Object key)
Specified by:
remove in interface Map<String,V>
Overrides:
remove in class HashMap<String,V>

clear

public void clear()
Specified by:
clear in interface Map<String,V>
Overrides:
clear in class LinkedHashMap<String,V>

convertKey

protected String convertKey(String key)
Convert the given key to a case-insensitive key.

The default implementation converts the key to lower-case according to this Map's Locale.

Parameters:
key - the user-specified key
Returns:
the key to use for storing
See Also:
String.toLowerCase(java.util.Locale)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LinkedMultiValueMap

org.springframework.util
Class LinkedMultiValueMap<K,V>

java.lang.Object
    extended by  org.springframework.util.LinkedMultiValueMap<K,V>
All Implemented Interfaces:
Serializable, Map<K,List<V>>, MultiValueMap<K,V>
public class LinkedMultiValueMap<K,V>
extends Object
implements MultiValueMap<K,V>, Serializable

Simple implementation of MultiValueMap that wraps a LinkedHashMap, storing multiple values in a LinkedList.

This Map implementation is generally not thread-safe. It is primarily designed for data structures exposed from request objects, for use in a single thread only.

Since:
3.0
Author:
Arjen Poutsma, Juergen Hoeller
See Also:
Serialized Form

Nested Class Summary
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
Constructor Summary
LinkedMultiValueMap()
Create a new LinkedMultiValueMap that wraps a LinkedHashMap.
LinkedMultiValueMap(int initialCapacity)
Create a new LinkedMultiValueMap that wraps a LinkedHashMap with the given initial capacity.
LinkedMultiValueMap(Map<K,List<V>> otherMap)
Copy constructor: Create a new LinkedMultiValueMap with the same mappings as the specified Map.
Method Summary
void | add(K key, V value) Add the given single value to the current list of values for the given key.
void | clear()
boolean | containsKey(Object key)
boolean | containsValue(Object value)
Set<Map.Entry<K,List<V>>> | entrySet()
boolean | equals(Object obj)
List<V> | get(Object key)
V | getFirst(K key) Return the first value for the given key.
int | hashCode()
boolean | isEmpty()
Set<K> | keySet()
List<V> | put(K key, List<V> value)
void | putAll(Map<? extends K,? extends List<V>> m)
List<V> | remove(Object key)
void | set(K key, V value) Set the given single value under the given key.
void | setAll(Map<K,V> values) Set the given values under.
int | size()
Map<K,V> | toSingleValueMap() Returns the first values contained in this MultiValueMap.
String | toString()
Collection<List<V>> | values()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

LinkedMultiValueMap

public LinkedMultiValueMap()
Create a new LinkedMultiValueMap that wraps a LinkedHashMap.

LinkedMultiValueMap

public LinkedMultiValueMap(int initialCapacity)
Create a new LinkedMultiValueMap that wraps a LinkedHashMap with the given initial capacity.

Parameters:
initialCapacity - the initial capacity

LinkedMultiValueMap

public LinkedMultiValueMap(Map<K,List<V>> otherMap)
Copy constructor: Create a new LinkedMultiValueMap with the same mappings as the specified Map.

Parameters:
otherMap - the Map whose mappings are to be placed in this Map
Method Detail

add

public void add(K key,
                V value)
Description copied from interface: MultiValueMap
Add the given single value to the current list of values for the given key.

Specified by:
add in interface MultiValueMap<K,V>
Parameters:
key - the key
value - the value to be added

getFirst

public V getFirst(K key)
Description copied from interface: MultiValueMap
Return the first value for the given key.

Specified by:
getFirst in interface MultiValueMap<K,V>
Parameters:
key - the key
Returns:
the first value for the specified key, or null

set

public void set(K key,
                V value)
Description copied from interface: MultiValueMap
Set the given single value under the given key.

Specified by:
set in interface MultiValueMap<K,V>
Parameters:
key - the key
value - the value to set

setAll

public void setAll(Map<K,V> values)
Description copied from interface: MultiValueMap
Set the given values under.

Specified by:
setAll in interface MultiValueMap<K,V>
Parameters:
values - the values.

toSingleValueMap

public Map<K,V> toSingleValueMap()
Description copied from interface: MultiValueMap
Returns the first values contained in this MultiValueMap.

Specified by:
toSingleValueMap in interface MultiValueMap<K,V>
Returns:
a single value representation of this map

size

public int size()
Specified by:
size in interface Map<K,List<V>>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Map<K,List<V>>

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map<K,List<V>>

containsValue

public boolean containsValue(Object value)
Specified by:
containsValue in interface Map<K,List<V>>

get

public List<V> get(Object key)
Specified by:
get in interface Map<K,List<V>>

put

public List<V> put(K key,
                   List<V> value)
Specified by:
put in interface Map<K,List<V>>

remove

public List<V> remove(Object key)
Specified by:
remove in interface Map<K,List<V>>

putAll

public void putAll(Map<? extends K,? extends List<V>> m)
Specified by:
putAll in interface Map<K,List<V>>

clear

public void clear()
Specified by:
clear in interface Map<K,List<V>>

keySet

public Set<K> keySet()
Specified by:
keySet in interface Map<K,List<V>>

values

public Collection<List<V>> values()
Specified by:
values in interface Map<K,List<V>>

entrySet

public Set<Map.Entry<K,List<V>>> entrySet()
Specified by:
entrySet in interface Map<K,List<V>>

equals

public boolean equals(Object obj)
Specified by:
equals in interface Map<K,List<V>>
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface Map<K,List<V>>
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Log4jConfigurer

org.springframework.util
Class Log4jConfigurer

java.lang.Object
    extended by  org.springframework.util.Log4jConfigurer

public abstract class Log4jConfigurer
extends Object

Convenience class that features simple methods for custom log4j configuration.

Only needed for non-default log4j initialization, for example with a custom config location or a refresh interval. By default, log4j will simply read its configuration from a "log4j.properties" or "log4j.xml" file in the root of the classpath.

For web environments, the analogous Log4jWebConfigurer class can be found in the web package, reading in its configuration from context-params in web.xml. In a J2EE web application, log4j is usually set up via Log4jConfigListener or Log4jConfigServlet, delegating to Log4jWebConfigurer underneath.

Since:
13.03.2003
Author:
Juergen Hoeller
See Also:
Log4jWebConfigurer, Log4jConfigListener

Field Summary
static String | CLASSPATH_URL_PREFIX Pseudo URL prefix for loading from the class path: "classpath:"
static String | XML_FILE_EXTENSION Extension that indicates a log4j XML config file: ".xml"
Constructor Summary
Log4jConfigurer()
Method Summary
static void | initLogging(String location) Initialize log4j from the given file location, with no config file refreshing.
static void | initLogging(String location, long refreshInterval) Initialize log4j from the given location, with the given refresh interval for the config file.
static void | setWorkingDirSystemProperty(String key) Set the specified system property to the current working directory.
static void | shutdownLogging() Shut down log4j, properly releasing all file locks.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

CLASSPATH_URL_PREFIX

public static final String CLASSPATH_URL_PREFIX
Pseudo URL prefix for loading from the class path: "classpath:"

See Also:
Constant Field Values

XML_FILE_EXTENSION

public static final String XML_FILE_EXTENSION
Extension that indicates a log4j XML config file: ".xml"

See Also:
Constant Field Values
Constructor Detail

Log4jConfigurer

public Log4jConfigurer()
Method Detail

initLogging

public static void initLogging(String location)
                        throws FileNotFoundException
Initialize log4j from the given file location, with no config file refreshing. Assumes an XML file in case of a ".xml" file extension, and a properties file otherwise.

Parameters:
location - the location of the config file: either a "classpath:" location (e.g. "classpath:myLog4j.properties"), an absolute file URL (e.g. "file:C:/log4j.properties), or a plain absolute path in the file system (e.g. "C:/log4j.properties")
Throws:
FileNotFoundException - if the location specifies an invalid file path

initLogging

public static void initLogging(String location,
                               long refreshInterval)
                        throws FileNotFoundException
Initialize log4j from the given location, with the given refresh interval for the config file. Assumes an XML file in case of a ".xml" file extension, and a properties file otherwise.

Log4j's watchdog thread will asynchronously check whether the timestamp of the config file has changed, using the given interval between checks. A refresh interval of 1000 milliseconds (one second), which allows to do on-demand log level changes with immediate effect, is not unfeasible.

WARNING: Log4j's watchdog thread does not terminate until VM shutdown; in particular, it does not terminate on LogManager shutdown. Therefore, it is recommended to not use config file refreshing in a production J2EE environment; the watchdog thread would not stop on application shutdown there.

Parameters:
location - the location of the config file: either a "classpath:" location (e.g. "classpath:myLog4j.properties"), an absolute file URL (e.g. "file:C:/log4j.properties), or a plain absolute path in the file system (e.g. "C:/log4j.properties")
refreshInterval - interval between config file refresh checks, in milliseconds
Throws:
FileNotFoundException - if the location specifies an invalid file path

shutdownLogging

public static void shutdownLogging()
Shut down log4j, properly releasing all file locks.

This isn't strictly necessary, but recommended for shutting down log4j in a scenario where the host VM stays alive (for example, when shutting down an application in a J2EE environment).

setWorkingDirSystemProperty

public static void setWorkingDirSystemProperty(String key)
Set the specified system property to the current working directory.

This can be used e.g. for test environments, for applications that leverage Log4jWebConfigurer's "webAppRootKey" support in a web environment.

Parameters:
key - system property key to use, as expected in Log4j configuration (for example: "demo.root", used as "${demo.root}/WEB-INF/demo.log")
See Also:
Log4jWebConfigurer
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MethodInvoker

org.springframework.util
Class MethodInvoker

java.lang.Object
    extended by  org.springframework.util.MethodInvoker
Direct Known Subclasses:
ArgumentConvertingMethodInvoker
public class MethodInvoker
extends Object

Helper class that allows for specifying a method to invoke in a declarative fashion, be it static or non-static.

Usage: Specify "targetClass"/"targetMethod" or "targetObject"/"targetMethod", optionally specify arguments, prepare the invoker. Afterwards, you may invoke the method any number of times, obtaining the invocation result.

Typically not used directly but via its subclasses MethodInvokingFactoryBean and MethodInvokingJobDetailFactoryBean.

Since:
19.02.2004
Author:
Colin Sampaleanu, Juergen Hoeller
See Also:
prepare(), invoke()

Constructor Summary
MethodInvoker()
Method Summary
protected Method | findMatchingMethod() Find a matching method with the specified name for the specified arguments.
Object[] | getArguments() Return the arguments for the method invocation.
Method | getPreparedMethod() Return the prepared Method object that will be invoked.
Class | getTargetClass() Return the target class on which to call the target method.
String | getTargetMethod() Return the name of the method to be invoked.
Object | getTargetObject() Return the target object on which to call the target method.
static int | getTypeDifferenceWeight(Class[] paramTypes, Object[] args) Algorithm that judges the match between the declared parameter types of a candidate method and a specific list of arguments that this method is supposed to be invoked with.
Object | invoke() Invoke the specified method.
boolean | isPrepared() Return whether this invoker has been prepared already, i.e.
void | prepare() Prepare the specified method.
protected Class | resolveClassName(String className) Resolve the given class name into a Class.
void | setArguments(Object[] arguments) Set arguments for the method invocation.
void | setStaticMethod(String staticMethod) Set a fully qualified static method name to invoke, e.g.
void | setTargetClass(Class targetClass) Set the target class on which to call the target method.
void | setTargetMethod(String targetMethod) Set the name of the method to be invoked.
void | setTargetObject(Object targetObject) Set the target object on which to call the target method.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MethodInvoker

public MethodInvoker()
Method Detail

setTargetClass

public void setTargetClass(Class targetClass)
Set the target class on which to call the target method. Only necessary when the target method is static; else, a target object needs to be specified anyway.

See Also:
setTargetObject(java.lang.Object), setTargetMethod(java.lang.String)

getTargetClass

public Class getTargetClass()
Return the target class on which to call the target method.

setTargetObject

public void setTargetObject(Object targetObject)
Set the target object on which to call the target method. Only necessary when the target method is not static; else, a target class is sufficient.

See Also:
setTargetClass(java.lang.Class), setTargetMethod(java.lang.String)

getTargetObject

public Object getTargetObject()
Return the target object on which to call the target method.

setTargetMethod

public void setTargetMethod(String targetMethod)
Set the name of the method to be invoked. Refers to either a static method or a non-static method, depending on a target object being set.

See Also:
setTargetClass(java.lang.Class), setTargetObject(java.lang.Object)

getTargetMethod

public String getTargetMethod()
Return the name of the method to be invoked.

setStaticMethod

public void setStaticMethod(String staticMethod)
Set a fully qualified static method name to invoke, e.g. "example.MyExampleClass.myExampleMethod". Convenient alternative to specifying targetClass and targetMethod.

See Also:
setTargetClass(java.lang.Class), setTargetMethod(java.lang.String)

setArguments

public void setArguments(Object[] arguments)
Set arguments for the method invocation. If this property is not set, or the Object array is of length 0, a method with no arguments is assumed.

getArguments

public Object[] getArguments()
Return the arguments for the method invocation.

prepare

public void prepare()
             throws ClassNotFoundException,
                    NoSuchMethodException
Prepare the specified method. The method can be invoked any number of times afterwards.

Throws:
ClassNotFoundException
NoSuchMethodException
See Also:
getPreparedMethod(), invoke()

resolveClassName

protected Class resolveClassName(String className)
                          throws ClassNotFoundException
Resolve the given class name into a Class.

The default implementations uses ClassUtils.forName, using the thread context class loader.

Parameters:
className - the class name to resolve
Returns:
the resolved Class
Throws:
ClassNotFoundException - if the class name was invalid

findMatchingMethod

protected Method findMatchingMethod()
Find a matching method with the specified name for the specified arguments.

Returns:
a matching method, or null if none
See Also:
getTargetClass(),
getTargetMethod(),
getArguments()

getPreparedMethod

public Method getPreparedMethod()
                         throws IllegalStateException
Return the prepared Method object that will be invoked.

Can for example be used to determine the return type.

Returns:
the prepared Method object (never null)
Throws:
IllegalStateException - if the invoker hasn't been prepared yet
See Also:
prepare(), invoke()

isPrepared

public boolean isPrepared()
Return whether this invoker has been prepared already, i.e. whether it allows access to getPreparedMethod() already.

invoke

public Object invoke()
              throws InvocationTargetException,
                     IllegalAccessException
Invoke the specified method.

The invoker needs to have been prepared before.

Returns:
the object (possibly null) returned by the method invocation, or null if the method has a void return type
Throws:
InvocationTargetException - if the target method threw an exception
IllegalAccessException - if the target method couldn't be accessed
See Also:
prepare()

getTypeDifferenceWeight

public static int getTypeDifferenceWeight(Class[] paramTypes,
                                          Object[] args)
Algorithm that judges the match between the declared parameter types of a candidate method and a specific list of arguments that this method is supposed to be invoked with.

Determines a weight that represents the class hierarchy difference between types and arguments. A direct match, i.e. type Integer -> arg of class Integer, does not increase the result - all direct matches means weight 0. A match between type Object and arg of class Integer would increase the weight by 2, due to the superclass 2 steps up in the hierarchy (i.e. Object) being the last one that still matches the required type Object. Type Number and class Integer would increase the weight by 1 accordingly, due to the superclass 1 step up the hierarchy (i.e. Number) still matching the required type Number. Therefore, with an arg of type Integer, a constructor (Integer) would be preferred to a constructor (Number) which would in turn be preferred to a constructor (Object). All argument weights get accumulated.

Parameters:
paramTypes - the parameter types to match
args - the arguments to match
Returns:
the accumulated weight for all arguments
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NumberUtils

org.springframework.util
Class NumberUtils

java.lang.Object
    extended by  org.springframework.util.NumberUtils

public abstract class NumberUtils
extends Object

Miscellaneous utility methods for number conversion and parsing. Mainly for internal use within the framework; consider Jakarta's Commons Lang for a more comprehensive suite of string utilities.

Since:
1.1.2
Author:
Juergen Hoeller, Rob Harrop

Constructor Summary
NumberUtils()
Method Summary
static
<T extends Number>
T
convertNumberToTargetClass(Number number, Class<T> targetClass)
Convert the given number into an instance of the given target class.
static
<T extends Number>
T
parseNumber(String text, Class<T> targetClass)
Parse the given text into a number instance of the given target class, using the corresponding decode / valueOf methods.
static
<T extends Number>
T
parseNumber(String text, Class<T> targetClass, NumberFormat numberFormat)
Parse the given text into a number instance of the given target class, using the given NumberFormat.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

NumberUtils

public NumberUtils()
Method Detail

convertNumberToTargetClass

public static <T extends Number> T convertNumberToTargetClass(Number number,
                                                              Class<T> targetClass)
                                                   throws IllegalArgumentException
Convert the given number into an instance of the given target class.

Parameters:
number - the number to convert
targetClass - the target class to convert to
Returns:
the converted number
Throws:
IllegalArgumentException - if the target class is not supported (i.e. not a standard Number subclass as included in the JDK)
See Also:
Byte, Short, Integer, Long, BigInteger, Float, Double, BigDecimal

parseNumber

public static <T extends Number> T parseNumber(String text,
                                               Class<T> targetClass)
Parse the given text into a number instance of the given target class, using the corresponding decode / valueOf methods.

Trims the input String before attempting to parse the number. Supports numbers in hex format (with leading "0x", "0X" or "#") as well.

Parameters:
text - the text to convert
targetClass - the target class to parse into
Returns:
the parsed number
Throws:
IllegalArgumentException - if the target class is not supported (i.e. not a standard Number subclass as included in the JDK)
See Also:
Byte.decode(java.lang.String),
Short.decode(java.lang.String),
Integer.decode(java.lang.String),
Long.decode(java.lang.String),
decodeBigInteger(String),
Float.valueOf(java.lang.String),
Double.valueOf(java.lang.String),
BigDecimal.BigDecimal(String)

parseNumber

public static <T extends Number> T parseNumber(String text,
                                               Class<T> targetClass,
                                               NumberFormat numberFormat)
Parse the given text into a number instance of the given target class, using the given NumberFormat. Trims the input String before attempting to parse the number.

Parameters:
text - the text to convert
targetClass - the target class to parse into
numberFormat - the NumberFormat to use for parsing (if null, this method falls back to parseNumber(String, Class))
Returns:
the parsed number
Throws:
IllegalArgumentException - if the target class is not supported (i.e. not a standard Number subclass as included in the JDK)
See Also:
NumberFormat.parse(java.lang.String, java.text.ParsePosition),
convertNumberToTargetClass(java.lang.Number, java.lang.Class),
parseNumber(String, Class)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ObjectUtils

org.springframework.util
Class ObjectUtils

java.lang.Object
    extended by  org.springframework.util.ObjectUtils

public abstract class ObjectUtils
extends Object

Miscellaneous object utility methods.

Mainly for internal use within the framework; consider Jakarta's Commons Lang for a more comprehensive suite of object utilities.

Thanks to Alex Ruiz for contributing several enhancements to this class!

Since:
19.03.2004
Author:
Juergen Hoeller, Keith Donald, Rod Johnson, Rob Harrop
See Also:
org.apache.commons.lang.ObjectUtils

Constructor Summary
ObjectUtils()
Method Summary
static Object[] | addObjectToArray(Object[] array, Object obj) Append the given Object to the given array, returning a new array consisting of the input array contents plus the given Object.
static boolean | containsElement(Object[] array, Object element) Check whether the given array contains the given element.
static String | getDisplayString(Object obj) Return a content-based String representation if obj is not null; otherwise returns an empty String.
static String | getIdentityHexString(Object obj) Return a hex String form of an object's identity hash code.
static int | hashCode(boolean bool) Return the same value as Boolean.hashCode().
static int | hashCode(double dbl) Return the same value as Double.hashCode().
static int | hashCode(float flt) Return the same value as Float.hashCode().
static int | hashCode(long lng) Return the same value as Long.hashCode().
static String | identityToString(Object obj) Return a String representation of an object's overall identity.
static boolean | isArray(Object obj) Determine whether the given object is an array: either an Object array or a primitive array.
static boolean | isCheckedException(Throwable ex) Return whether the given throwable is a checked exception: that is, neither a RuntimeException nor an Error.
static boolean | isCompatibleWithThrowsClause(Throwable ex, Class[] declaredExceptions) Check whether the given exception is compatible with the exceptions declared in a throws clause.
static boolean | isEmpty(Object[] array) Determine whether the given array is empty: i.e.
static String | nullSafeClassName(Object obj) Determine the class name for the given object.
static boolean | nullSafeEquals(Object o1, Object o2) Determine if the given objects are equal, returning true if both are null or false if only one is null.
static int | nullSafeHashCode(boolean[] array) Return a hash code based on the contents of the specified array.
static int | nullSafeHashCode(byte[] array) Return a hash code based on the contents of the specified array.
static int | nullSafeHashCode(char[] array) Return a hash code based on the contents of the specified array.
static int | nullSafeHashCode(double[] array) Return a hash code based on the contents of the specified array.
static int | nullSafeHashCode(float[] array) Return a hash code based on the contents of the specified array.
static int | nullSafeHashCode(int[] array) Return a hash code based on the contents of the specified array.
static int | nullSafeHashCode(long[] array) Return a hash code based on the contents of the specified array.
static int | nullSafeHashCode(Object obj) Return as hash code for the given object; typically the value of Object.hashCode().
static int | nullSafeHashCode(Object[] array) Return a hash code based on the contents of the specified array.
static int | nullSafeHashCode(short[] array) Return a hash code based on the contents of the specified array.
static String | nullSafeToString(boolean[] array) Return a String representation of the contents of the specified array.
static String | nullSafeToString(byte[] array) Return a String representation of the contents of the specified array.
static String | nullSafeToString(char[] array) Return a String representation of the contents of the specified array.
static String | nullSafeToString(double[] array) Return a String representation of the contents of the specified array.
static String | nullSafeToString(float[] array) Return a String representation of the contents of the specified array.
static String | nullSafeToString(int[] array) Return a String representation of the contents of the specified array.
static String | nullSafeToString(long[] array) Return a String representation of the contents of the specified array.
static String | nullSafeToString(Object obj) Return a String representation of the specified Object.
static String | nullSafeToString(Object[] array) Return a String representation of the contents of the specified array.
static String | nullSafeToString(short[] array) Return a String representation of the contents of the specified array.
static Object[] | toObjectArray(Object source) Convert the given array (which may be a primitive array) to an object array (if necessary of primitive wrapper objects).
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ObjectUtils

public ObjectUtils()
Method Detail

isCheckedException

public static boolean isCheckedException(Throwable ex)
Return whether the given throwable is a checked exception: that is, neither a RuntimeException nor an Error.

Parameters:
ex - the throwable to check
Returns:
whether the throwable is a checked exception
See Also:
Exception, RuntimeException, Error

isCompatibleWithThrowsClause

public static boolean isCompatibleWithThrowsClause(Throwable ex,
                                                   Class[] declaredExceptions)
Check whether the given exception is compatible with the exceptions declared in a throws clause.

Parameters:
ex - the exception to checked
declaredExceptions - the exceptions declared in the throws clause
Returns:
whether the given exception is compatible

isArray

public static boolean isArray(Object obj)
Determine whether the given object is an array: either an Object array or a primitive array.

Parameters:
obj - the object to check

isEmpty

public static boolean isEmpty(Object[] array)
Determine whether the given array is empty: i.e. null or of zero length.

Parameters:
array - the array to check

containsElement

public static boolean containsElement(Object[] array,
                                      Object element)
Check whether the given array contains the given element.

Parameters:
array - the array to check (may be null, in which case the return value will always be false)
element - the element to check for
Returns:
whether the element has been found in the given array

addObjectToArray

public static Object[] addObjectToArray(Object[] array,
                                        Object obj)
Append the given Object to the given array, returning a new array consisting of the input array contents plus the given Object.

Parameters:
array - the array to append to (can be null)
obj - the Object to append
Returns:
the new array (of the same component type; never null)

toObjectArray

public static Object[] toObjectArray(Object source)
Convert the given array (which may be a primitive array) to an object array (if necessary of primitive wrapper objects).

A null source value will be converted to an empty Object array.

Parameters:
source - the (potentially primitive) array
Returns:
the corresponding object array (never null)
Throws:
IllegalArgumentException - if the parameter is not an array

nullSafeEquals

public static boolean nullSafeEquals(Object o1,
                                     Object o2)
Determine if the given objects are equal, returning true if both are null or false if only one is null.

Compares arrays with Arrays.equals, performing an equality check based on the array elements rather than the array reference.

Parameters:
o1 - first Object to compare
o2 - second Object to compare
Returns:
whether the given objects are equal
See Also:
Arrays.equals(long[], long[])

nullSafeHashCode

public static int nullSafeHashCode(Object obj)
Return as hash code for the given object; typically the value of Object.hashCode(). If the object is an array, this method will delegate to any of the nullSafeHashCode methods for arrays in this class. If the object is null, this method returns 0.

See Also:
nullSafeHashCode(Object[]), nullSafeHashCode(boolean[]), nullSafeHashCode(byte[]), nullSafeHashCode(char[]), nullSafeHashCode(double[]), nullSafeHashCode(float[]), nullSafeHashCode(int[]), nullSafeHashCode(long[]), nullSafeHashCode(short[])

nullSafeHashCode

public static int nullSafeHashCode(Object[] array)
Return a hash code based on the contents of the specified array. If array is null, this method returns 0.

nullSafeHashCode

public static int nullSafeHashCode(boolean[] array)
Return a hash code based on the contents of the specified array. If array is null, this method returns 0.

nullSafeHashCode

public static int nullSafeHashCode(byte[] array)
Return a hash code based on the contents of the specified array. If array is null, this method returns 0.

nullSafeHashCode

public static int nullSafeHashCode(char[] array)
Return a hash code based on the contents of the specified array. If array is null, this method returns 0.

nullSafeHashCode

public static int nullSafeHashCode(double[] array)
Return a hash code based on the contents of the specified array. If array is null, this method returns 0.

nullSafeHashCode

public static int nullSafeHashCode(float[] array)
Return a hash code based on the contents of the specified array. If array is null, this method returns 0.

nullSafeHashCode

public static int nullSafeHashCode(int[] array)
Return a hash code based on the contents of the specified array. If array is null, this method returns 0.

nullSafeHashCode

public static int nullSafeHashCode(long[] array)
Return a hash code based on the contents of the specified array. If array is null, this method returns 0.

nullSafeHashCode

public static int nullSafeHashCode(short[] array)
Return a hash code based on the contents of the specified array. If array is null, this method returns 0.

hashCode

public static int hashCode(boolean bool)
Return the same value as Boolean.hashCode().

See Also:
Boolean.hashCode()

hashCode

public static int hashCode(double dbl)
Return the same value as Double.hashCode().

See Also:
Double.hashCode()

hashCode

public static int hashCode(float flt)
Return the same value as Float.hashCode().

See Also:
Float.hashCode()

hashCode

public static int hashCode(long lng)
Return the same value as Long.hashCode().

See Also:
Long.hashCode()

identityToString

public static String identityToString(Object obj)
Return a String representation of an object's overall identity.

Parameters:
obj - the object (may be null)
Returns:
the object's identity as String representation, or an empty String if the object was null

getIdentityHexString

public static String getIdentityHexString(Object obj)
Return a hex String form of an object's identity hash code.

Parameters:
obj - the object
Returns:
the object's identity code in hex notation

getDisplayString

public static String getDisplayString(Object obj)
Return a content-based String representation if obj is not null; otherwise returns an empty String.

Differs from nullSafeToString(Object) in that it returns an empty String rather than "null" for a null value.

Parameters:
obj - the object to build a display String for
Returns:
a display String representation of obj
See Also:
nullSafeToString(Object)

nullSafeClassName

public static String nullSafeClassName(Object obj)
Determine the class name for the given object.

Returns "null" if obj is null.

Parameters:
obj - the object to introspect (may be null)
Returns:
the corresponding class name

nullSafeToString

public static String nullSafeToString(Object obj)
Return a String representation of the specified Object.

Builds a String representation of the contents in case of an array. Returns "null" if obj is null.

Parameters:
obj - the object to build a String representation for
Returns:
a String representation of obj

nullSafeToString

public static String nullSafeToString(Object[] array)
Return a String representation of the contents of the specified array.

The String representation consists of a list of the array's elements, enclosed in curly braces ("{}"). Adjacent elements are separated by the characters ", " (a comma followed by a space). Returns "null" if array is null.

Parameters:
array - the array to build a String representation for
Returns:
a String representation of array

nullSafeToString

public static String nullSafeToString(boolean[] array)
Return a String representation of the contents of the specified array.

The String representation consists of a list of the array's elements, enclosed in curly braces ("{}"). Adjacent elements are separated by the characters ", " (a comma followed by a space). Returns "null" if array is null.

Parameters:
array - the array to build a String representation for
Returns:
a String representation of array

nullSafeToString

public static String nullSafeToString(byte[] array)
Return a String representation of the contents of the specified array.

The String representation consists of a list of the array's elements, enclosed in curly braces ("{}"). Adjacent elements are separated by the characters ", " (a comma followed by a space). Returns "null" if array is null.

Parameters:
array - the array to build a String representation for
Returns:
a String representation of array

nullSafeToString

public static String nullSafeToString(char[] array)
Return a String representation of the contents of the specified array.

The String representation consists of a list of the array's elements, enclosed in curly braces ("{}"). Adjacent elements are separated by the characters ", " (a comma followed by a space). Returns "null" if array is null.

Parameters:
array - the array to build a String representation for
Returns:
a String representation of array

nullSafeToString

public static String nullSafeToString(double[] array)
Return a String representation of the contents of the specified array.

The String representation consists of a list of the array's elements, enclosed in curly braces ("{}"). Adjacent elements are separated by the characters ", " (a comma followed by a space). Returns "null" if array is null.

Parameters:
array - the array to build a String representation for
Returns:
a String representation of array

nullSafeToString

public static String nullSafeToString(float[] array)
Return a String representation of the contents of the specified array.

The String representation consists of a list of the array's elements, enclosed in curly braces ("{}"). Adjacent elements are separated by the characters ", " (a comma followed by a space). Returns "null" if array is null.

Parameters:
array - the array to build a String representation for
Returns:
a String representation of array

nullSafeToString

public static String nullSafeToString(int[] array)
Return a String representation of the contents of the specified array.

The String representation consists of a list of the array's elements, enclosed in curly braces ("{}"). Adjacent elements are separated by the characters ", " (a comma followed by a space). Returns "null" if array is null.

Parameters:
array - the array to build a String representation for
Returns:
a String representation of array

nullSafeToString

public static String nullSafeToString(long[] array)
Return a String representation of the contents of the specified array.

The String representation consists of a list of the array's elements, enclosed in curly braces ("{}"). Adjacent elements are separated by the characters ", " (a comma followed by a space). Returns "null" if array is null.

Parameters:
array - the array to build a String representation for
Returns:
a String representation of array

nullSafeToString

public static String nullSafeToString(short[] array)
Return a String representation of the contents of the specified array.

The String representation consists of a list of the array's elements, enclosed in curly braces ("{}"). Adjacent elements are separated by the characters ", " (a comma followed by a space). Returns "null" if array is null.

Parameters:
array - the array to build a String representation for
Returns:
a String representation of array
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PatternMatchUtils

org.springframework.util
Class PatternMatchUtils

java.lang.Object
    extended by  org.springframework.util.PatternMatchUtils

public abstract class PatternMatchUtils
extends Object

Utility methods for simple pattern matching, in particular for Spring's typical "xxx*", "*xxx" and "*xxx*" pattern styles.

Since:
2.0
Author:
Juergen Hoeller

Constructor Summary
PatternMatchUtils()
Method Summary
static boolean | simpleMatch(String[] patterns, String str) Match a String against the given patterns, supporting the following simple pattern styles: "xxx*", "*xxx", "*xxx*" and "xxx*yyy" matches (with an arbitrary number of pattern parts), as well as direct equality.
static boolean | simpleMatch(String pattern, String str) Match a String against the given pattern, supporting the following simple pattern styles: "xxx*", "*xxx", "*xxx*" and "xxx*yyy" matches (with an arbitrary number of pattern parts), as well as direct equality.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PatternMatchUtils

public PatternMatchUtils()
Method Detail

simpleMatch

public static boolean simpleMatch(String pattern,
                                  String str)
Match a String against the given pattern, supporting the following simple pattern styles: "xxx*", "*xxx", "*xxx*" and "xxx*yyy" matches (with an arbitrary number of pattern parts), as well as direct equality.

Parameters:
pattern - the pattern to match against
str - the String to match
Returns:
whether the String matches the given pattern

simpleMatch

public static boolean simpleMatch(String[] patterns,
                                  String str)
Match a String against the given patterns, supporting the following simple pattern styles: "xxx*", "*xxx", "*xxx*" and "xxx*yyy" matches (with an arbitrary number of pattern parts), as well as direct equality.

Parameters:
patterns - the patterns to match against
str - the String to match
Returns:
whether the String matches any of the given patterns
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertyPlaceholderHelper

org.springframework.util
Class PropertyPlaceholderHelper

java.lang.Object
    extended by  org.springframework.util.PropertyPlaceholderHelper

public class PropertyPlaceholderHelper
extends Object

Utility class for working with Strings that have placeholder values in them. A placeholder takes the form ${name}. Using PropertyPlaceholderHelper these placeholders can be substituted for user-supplied values.

Values for substitution can be supplied using a Properties instance or using a PropertyPlaceholderHelper.PlaceholderResolver.

Since:
3.0
Author:
Juergen Hoeller, Rob Harrop

Nested Class Summary
static interface PropertyPlaceholderHelper.PlaceholderResolver
Strategy interface used to resolve replacement values for placeholders contained in Strings.
Constructor Summary
PropertyPlaceholderHelper(String placeholderPrefix, String placeholderSuffix)
Creates a new PropertyPlaceholderHelper that uses the supplied prefix and suffix.
PropertyPlaceholderHelper(String placeholderPrefix, String placeholderSuffix, String valueSeparator, boolean ignoreUnresolvablePlaceholders)
Creates a new PropertyPlaceholderHelper that uses the supplied prefix and suffix.
Method Summary
protected String | parseStringValue(String strVal, PropertyPlaceholderHelper.PlaceholderResolver placeholderResolver, Set<String> visitedPlaceholders)
String | replacePlaceholders(String value, Properties properties) Replaces all placeholders of format ${name} with the corresponding property from the supplied Properties.
String | replacePlaceholders(String value, PropertyPlaceholderHelper.PlaceholderResolver placeholderResolver) Replaces all placeholders of format ${name} with the value returned from the supplied PropertyPlaceholderHelper.PlaceholderResolver.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PropertyPlaceholderHelper

public PropertyPlaceholderHelper(String placeholderPrefix,
                                 String placeholderSuffix)
Creates a new PropertyPlaceholderHelper that uses the supplied prefix and suffix. Unresolvable placeholders are ignored.

Parameters:
placeholderPrefix - the prefix that denotes the start of a placeholder.
placeholderSuffix - the suffix that denotes the end of a placeholder.

PropertyPlaceholderHelper

public PropertyPlaceholderHelper(String placeholderPrefix,
                                 String placeholderSuffix,
                                 String valueSeparator,
                                 boolean ignoreUnresolvablePlaceholders)
Creates a new PropertyPlaceholderHelper that uses the supplied prefix and suffix.

Parameters:
placeholderPrefix - the prefix that denotes the start of a placeholder.
placeholderSuffix - the suffix that denotes the end of a placeholder.
ignoreUnresolvablePlaceholders - indicates whether unresolvable placeholders should be ignored (true) or cause an exception (false).
Method Detail

replacePlaceholders

public String replacePlaceholders(String value,
                                  Properties properties)
Replaces all placeholders of format ${name} with the corresponding property from the supplied Properties.

Parameters:
value - the value containing the placeholders to be replaced.
properties - the Properties to use for replacement.
Returns:
the supplied value with placeholders replaced inline.

replacePlaceholders

public String replacePlaceholders(String value,
                                  PropertyPlaceholderHelper.PlaceholderResolver placeholderResolver)
Replaces all placeholders of format ${name} with the value returned from the supplied PropertyPlaceholderHelper.PlaceholderResolver.

Parameters:
value - the value containing the placeholders to be replaced.
placeholderResolver - the PlaceholderResolver to use for replacement.
Returns:
the supplied value with placeholders replaced inline.

parseStringValue

protected String parseStringValue(String strVal,
                                  PropertyPlaceholderHelper.PlaceholderResolver placeholderResolver,
                                  Set<String> visitedPlaceholders)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertyPlaceholderHelper.PlaceholderResolver

org.springframework.util
Interface PropertyPlaceholderHelper.PlaceholderResolver

Enclosing class:
PropertyPlaceholderHelper
public static interface PropertyPlaceholderHelper.PlaceholderResolver

Strategy interface used to resolve replacement values for placeholders contained in Strings.

See Also:
PropertyPlaceholderHelper

Method Summary
 String resolvePlaceholder(String placeholderName)
Resolves the supplied placeholder name into the replacement value.

Method Detail

resolvePlaceholder

String resolvePlaceholder(String placeholderName)
Resolves the supplied placeholder name into the replacement value.

Parameters:
placeholderName - the name of the placeholder to resolve.
Returns:
the replacement value or null if no replacement is to be made.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ReflectionUtils

org.springframework.util
Class ReflectionUtils

java.lang.Object
    extended by  org.springframework.util.ReflectionUtils

public abstract class ReflectionUtils
extends Object

Simple utility class for working with the reflection API and handling reflection exceptions.

Only intended for internal use.

Since:
1.2.2
Author:
Juergen Hoeller, Rob Harrop, Rod Johnson, Costin Leau, Sam Brannen

Nested Class Summary
static interface | ReflectionUtils.FieldCallback Callback interface invoked on each field in the hierarchy.
static interface | ReflectionUtils.FieldFilter Callback optionally used to filter fields to be operated on by a field callback.
static interface | ReflectionUtils.MethodCallback Action to take on each method.
static interface | ReflectionUtils.MethodFilter Callback optionally used to method fields to be operated on by a method callback.
Field Summary
static ReflectionUtils.FieldFilter | COPYABLE_FIELDS Pre-built FieldFilter that matches all non-static, non-final fields.
static ReflectionUtils.MethodFilter | NON_BRIDGED_METHODS Pre-built MethodFilter that matches all non-bridge methods.
Constructor Summary
ReflectionUtils()
Method Summary
static boolean | declaresException(Method method, Class<?> exceptionType) Determine whether the given method explicitly declares the given exception or one of its superclasses, which means that an exception of that type can be propagated as-is within a reflective invocation.
static void | doWithFields(Class<?> clazz, ReflectionUtils.FieldCallback fc) Invoke the given callback on all fields in the target class, going up the class hierarchy to get all declared fields.
static void | doWithFields(Class<?> clazz, ReflectionUtils.FieldCallback fc, ReflectionUtils.FieldFilter ff) Invoke the given callback on all fields in the target class, going up the class hierarchy to get all declared fields.
static void | doWithMethods(Class<?> clazz, ReflectionUtils.MethodCallback mc) Perform the given callback operation on all matching methods of the given class and superclasses.
static void | doWithMethods(Class<?> clazz, ReflectionUtils.MethodCallback mc, ReflectionUtils.MethodFilter mf) Perform the given callback operation on all matching methods of the given class and superclasses.
static Field | findField(Class<?> clazz, String name) Attempt to find a field on the supplied Class with the supplied name.
static Field | findField(Class<?> clazz, String name, Class<?> type) Attempt to find a field on the supplied Class with the supplied name and/or type.
static Method | findMethod(Class<?> clazz, String name) Attempt to find a Method on the supplied class with the supplied name and no parameters.
static Method | findMethod(Class<?> clazz, String name, Class<?>... paramTypes) Attempt to find a Method on the supplied class with the supplied name and parameter types.
static Method[] | getAllDeclaredMethods(Class<?> leafClass) Get all declared methods on the leaf class and all superclasses.
static Object | getField(Field field, Object target) Get the field represented by the supplied field object on the specified target object.
static void | handleInvocationTargetException(InvocationTargetException ex) Handle the given invocation target exception.
static void | handleReflectionException(Exception ex) Handle the given reflection exception.
static Object | invokeJdbcMethod(Method method, Object target) Invoke the specified JDBC API Method against the supplied target object with no arguments.
static Object | invokeJdbcMethod(Method method, Object target, Object... args) Invoke the specified JDBC API Method against the supplied target object with the supplied arguments.
static Object | invokeMethod(Method method, Object target) Invoke the specified Method against the supplied target object with no arguments.
static Object | invokeMethod(Method method, Object target, Object... args) Invoke the specified Method against the supplied target object with the supplied arguments.
static boolean | isEqualsMethod(Method method) Determine whether the given method is an "equals" method.
static boolean | isHashCodeMethod(Method method) Determine whether the given method is a "hashCode" method.
static boolean | isPublicStaticFinal(Field field) Determine whether the given field is a "public static final" constant.
static boolean | isToStringMethod(Method method) Determine whether the given method is a "toString" method.
static void | makeAccessible(Constructor<?> ctor) Make the given constructor accessible, explicitly setting it accessible if necessary.
static void | makeAccessible(Field field) Make the given field accessible, explicitly setting it accessible if necessary.
static void | makeAccessible(Method method) Make the given method accessible, explicitly setting it accessible if necessary.
static void | rethrowException(Throwable ex) Rethrow the given exception, which is presumably the target exception of an InvocationTargetException.
static void | rethrowRuntimeException(Throwable ex) Rethrow the given exception, which is presumably the target exception of an InvocationTargetException.
static void | setField(Field field, Object target, Object value) Set the field represented by the supplied field object on the specified target object to the specified value.
static void | shallowCopyFieldState(Object src, Object dest) Given the source object and the destination, which must be the same class or a subclass, copy all fields, including inherited fields.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

COPYABLE_FIELDS

public static ReflectionUtils.FieldFilter COPYABLE_FIELDS
Pre-built FieldFilter that matches all non-static, non-final fields.

NON_BRIDGED_METHODS

public static ReflectionUtils.MethodFilter NON_BRIDGED_METHODS
Pre-built MethodFilter that matches all non-bridge methods.

Constructor Detail

ReflectionUtils

public ReflectionUtils()
Method Detail

findField

public static Field findField(Class<?> clazz,
                              String name)
Attempt to find a field on the supplied Class with the supplied name. Searches all superclasses up to Object.

Parameters:
clazz - the class to introspect
name - the name of the field
Returns:
the corresponding Field object, or null if not found

findField

public static Field findField(Class<?> clazz,
                              String name,
                              Class<?> type)
Attempt to find a field on the supplied Class with the supplied name and/or type. Searches all superclasses up to Object.

Parameters:
clazz - the class to introspect
name - the name of the field (may be null if type is specified)
type - the type of the field (may be null if name is specified)
Returns:
the corresponding Field object, or null if not found

setField

public static void setField(Field field,
                            Object target,
                            Object value)
Set the field represented by the supplied field object on the specified target object to the specified value. In accordance with Field.set(Object, Object) semantics, the new value is automatically unwrapped if the underlying field has a primitive type.

Thrown exceptions are handled via a call to handleReflectionException(Exception).

Parameters:
field - the field to set
target - the target object on which to set the field
value - the value to set; may be null

getField

public static Object getField(Field field,
                              Object target)
Get the field represented by the supplied field object on the specified target object. In accordance with Field.get(Object) semantics, the returned value is automatically wrapped if the underlying field has a primitive type.

Thrown exceptions are handled via a call to handleReflectionException(Exception).

Parameters:
field - the field to get
target - the target object from which to get the field
Returns:
the field's current value

findMethod

public static Method findMethod(Class<?> clazz,
                                String name)
Attempt to find a Method on the supplied class with the supplied name and no parameters. Searches all superclasses up to Object.

Returns null if no Method can be found.

Parameters:
clazz - the class to introspect
name - the name of the method
Returns:
the Method object, or null if none found

findMethod

public static Method findMethod(Class<?> clazz,
                                String name,
                                Class<?>... paramTypes)
Attempt to find a Method on the supplied class with the supplied name and parameter types. Searches all superclasses up to Object.

Returns null if no Method can be found.

Parameters:
clazz - the class to introspect
name - the name of the method
paramTypes - the parameter types of the method (may be null to indicate any signature)
Returns:
the Method object, or null if none found

invokeMethod

public static Object invokeMethod(Method method,
                                  Object target)
Invoke the specified Method against the supplied target object with no arguments. The target object can be null when invoking a static Method.

Thrown exceptions are handled via a call to handleReflectionException(java.lang.Exception).

Parameters:
method - the method to invoke
target - the target object to invoke the method on
Returns:
the invocation result, if any
See Also:
invokeMethod(java.lang.reflect.Method, Object, Object[])

invokeMethod

public static Object invokeMethod(Method method,
                                  Object target,
                                  Object... args)
Invoke the specified Method against the supplied target object with the supplied arguments. The target object can be null when invoking a static Method.

Thrown exceptions are handled via a call to handleReflectionException(java.lang.Exception).

Parameters:
method - the method to invoke
target - the target object to invoke the method on
args - the invocation arguments (may be null)
Returns:
the invocation result, if any

invokeJdbcMethod

public static Object invokeJdbcMethod(Method method,
                                      Object target)
                               throws SQLException
Invoke the specified JDBC API Method against the supplied target object with no arguments.

Parameters:
method - the method to invoke
target - the target object to invoke the method on
Returns:
the invocation result, if any
Throws:
SQLException - the JDBC API SQLException to rethrow (if any)
See Also:
invokeJdbcMethod(java.lang.reflect.Method, Object, Object[])

invokeJdbcMethod

public static Object invokeJdbcMethod(Method method,
                                      Object target,
                                      Object... args)
                               throws SQLException
Invoke the specified JDBC API Method against the supplied target object with the supplied arguments.

Parameters:
method - the method to invoke
target - the target object to invoke the method on
args - the invocation arguments (may be null)
Returns:
the invocation result, if any
Throws:
SQLException - the JDBC API SQLException to rethrow (if any)
See Also:
invokeMethod(java.lang.reflect.Method, Object, Object[])

handleReflectionException

public static void handleReflectionException(Exception ex)
Handle the given reflection exception. Should only be called if no checked exception is expected to be thrown by the target method.

Throws the underlying RuntimeException or Error in case of an InvocationTargetException with such a root cause. Throws an IllegalStateException with an appropriate message else.

Parameters:
ex - the reflection exception to handle

handleInvocationTargetException

public static void handleInvocationTargetException(InvocationTargetException ex)
Handle the given invocation target exception. Should only be called if no checked exception is expected to be thrown by the target method.

Throws the underlying RuntimeException or Error in case of such a root cause. Throws an IllegalStateException else.

Parameters:
ex - the invocation target exception to handle

rethrowRuntimeException

public static void rethrowRuntimeException(Throwable ex)
Rethrow the given exception, which is presumably the target exception of an InvocationTargetException. Should only be called if no checked exception is expected to be thrown by the target method.

Rethrows the underlying exception cast to an RuntimeException or Error if appropriate; otherwise, throws an IllegalStateException.

Parameters:
ex - the exception to rethrow
Throws:
RuntimeException - the rethrown exception

rethrowException

public static void rethrowException(Throwable ex)
                             throws Exception
Rethrow the given exception, which is presumably the target exception of an InvocationTargetException. Should only be called if no checked exception is expected to be thrown by the target method.

Rethrows the underlying exception cast to an Exception or Error if appropriate; otherwise, throws an IllegalStateException.

Parameters:
ex - the exception to rethrow
Throws:
Exception - the rethrown exception (in case of a checked exception)

declaresException

public static boolean declaresException(Method method,
                                        Class<?> exceptionType)
Determine whether the given method explicitly declares the given exception or one of its superclasses, which means that an exception of that type can be propagated as-is within a reflective invocation.

Parameters:
method - the declaring method
exceptionType - the exception to throw
Returns:
true if the exception can be thrown as-is; false if it needs to be wrapped

isPublicStaticFinal

public static boolean isPublicStaticFinal(Field field)
Determine whether the given field is a "public static final" constant.

Parameters:
field - the field to check

isEqualsMethod

public static boolean isEqualsMethod(Method method)
Determine whether the given method is an "equals" method.

See Also:
Object.equals(Object)

isHashCodeMethod

public static boolean isHashCodeMethod(Method method)
Determine whether the given method is a "hashCode" method.

See Also:
Object.hashCode()

isToStringMethod

public static boolean isToStringMethod(Method method)
Determine whether the given method is a "toString" method.

See Also:
Object.toString()

makeAccessible

public static void makeAccessible(Field field)
Make the given field accessible, explicitly setting it accessible if necessary. The setAccessible(true) method is only called when actually necessary, to avoid unnecessary conflicts with a JVM SecurityManager (if active).

Parameters:
field - the field to make accessible
See Also:
AccessibleObject.setAccessible(java.lang.reflect.AccessibleObject[], boolean)

makeAccessible

public static void makeAccessible(Method method)
Make the given method accessible, explicitly setting it accessible if necessary. The setAccessible(true) method is only called when actually necessary, to avoid unnecessary conflicts with a JVM SecurityManager (if active).

Parameters:
method - the method to make accessible
See Also:
AccessibleObject.setAccessible(java.lang.reflect.AccessibleObject[], boolean)

makeAccessible

public static void makeAccessible(Constructor<?> ctor)
Make the given constructor accessible, explicitly setting it accessible if necessary. The setAccessible(true) method is only called when actually necessary, to avoid unnecessary conflicts with a JVM SecurityManager (if active).

Parameters:
ctor - the constructor to make accessible
See Also:
AccessibleObject.setAccessible(java.lang.reflect.AccessibleObject[], boolean)

doWithMethods

public static void doWithMethods(Class<?> clazz,
                                 ReflectionUtils.MethodCallback mc)
                          throws IllegalArgumentException
Perform the given callback operation on all matching methods of the given class and superclasses.

The same named method occurring on subclass and superclass will appear twice, unless excluded by a ReflectionUtils.MethodFilter.

Parameters:
clazz - class to start looking at
mc - the callback to invoke for each method
Throws:
IllegalArgumentException
See Also:
doWithMethods(Class, MethodCallback, MethodFilter)

doWithMethods

public static void doWithMethods(Class<?> clazz,
                                 ReflectionUtils.MethodCallback mc,
                                 ReflectionUtils.MethodFilter mf)
                          throws IllegalArgumentException
Perform the given callback operation on all matching methods of the given class and superclasses.

The same named method occurring on subclass and superclass will appear twice, unless excluded by the specified ReflectionUtils.MethodFilter.

Parameters:
clazz - class to start looking at
mc - the callback to invoke for each method
mf - the filter that determines the methods to apply the callback to
Throws:
IllegalArgumentException

getAllDeclaredMethods

public static Method[] getAllDeclaredMethods(Class<?> leafClass)
                                      throws IllegalArgumentException
Get all declared methods on the leaf class and all superclasses. Leaf class methods are included first.

Throws:
IllegalArgumentException

doWithFields

public static void doWithFields(Class<?> clazz,
                                ReflectionUtils.FieldCallback fc)
                         throws IllegalArgumentException
Invoke the given callback on all fields in the target class, going up the class hierarchy to get all declared fields.

Parameters:
clazz - the target class to analyze
fc - the callback to invoke for each field
Throws:
IllegalArgumentException

doWithFields

public static void doWithFields(Class<?> clazz,
                                ReflectionUtils.FieldCallback fc,
                                ReflectionUtils.FieldFilter ff)
                         throws IllegalArgumentException
Invoke the given callback on all fields in the target class, going up the class hierarchy to get all declared fields.

Parameters:
clazz - the target class to analyze
fc - the callback to invoke for each field
ff - the filter that determines the fields to apply the callback to
Throws:
IllegalArgumentException

shallowCopyFieldState

public static void shallowCopyFieldState(Object src,
                                         Object dest)
                                  throws IllegalArgumentException
Given the source object and the destination, which must be the same class or a subclass, copy all fields, including inherited fields. Designed to work on objects with public no-arg constructors.

Throws:
IllegalArgumentException - if the arguments are incompatible
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ReflectionUtils.FieldCallback

org.springframework.util
Interface ReflectionUtils.FieldCallback

Enclosing class:
ReflectionUtils
public static interface ReflectionUtils.FieldCallback

Callback interface invoked on each field in the hierarchy.

Method Summary
 void doWith(Field field)
Perform an operation using the given field.

Method Detail

doWith

void doWith(Field field)
            throws IllegalArgumentException,
                   IllegalAccessException
Perform an operation using the given field.

Parameters:
field - the field to operate on
Throws:
IllegalArgumentException
IllegalAccessException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ReflectionUtils.FieldFilter

org.springframework.util
Interface ReflectionUtils.FieldFilter

Enclosing class:
ReflectionUtils
public static interface ReflectionUtils.FieldFilter

Callback optionally used to filter fields to be operated on by a field callback.

Method Summary
 boolean matches(Field field)
Determine whether the given field matches.

Method Detail

matches

boolean matches(Field field)
Determine whether the given field matches.

Parameters:
field - the field to check
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ReflectionUtils.MethodCallback

org.springframework.util
Interface ReflectionUtils.MethodCallback

Enclosing class:
ReflectionUtils
public static interface ReflectionUtils.MethodCallback

Action to take on each method.

Method Summary
 void doWith(Method method)
Perform an operation using the given method.

Method Detail

doWith

void doWith(Method method)
            throws IllegalArgumentException,
                   IllegalAccessException
Perform an operation using the given method.

Parameters:
method - the method to operate on
Throws:
IllegalArgumentException
IllegalAccessException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ReflectionUtils.MethodFilter

org.springframework.util
Interface ReflectionUtils.MethodFilter

Enclosing class:
ReflectionUtils
public static interface ReflectionUtils.MethodFilter

Callback optionally used to method fields to be operated on by a method callback.

Method Summary
 boolean matches(Method method)
Determine whether the given method matches.

Method Detail

matches

boolean matches(Method method)
Determine whether the given method matches.

Parameters:
method - the method to check
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResourceUtils

org.springframework.util
Class ResourceUtils

java.lang.Object
    extended by  org.springframework.util.ResourceUtils

public abstract class ResourceUtils
extends Object

Utility methods for resolving resource locations to files in the file system. Mainly for internal use within the framework.

Consider using Spring's Resource abstraction in the core package for handling all kinds of file resources in a uniform manner. ResourceLoader's getResource method can resolve any location to a Resource object, which in turn allows to obtain a java.io.File in the file system through its getFile() method.

The main reason for these utility methods for resource location handling is to support Log4jConfigurer, which must be able to resolve resource locations before the logging system has been initialized. Spring' Resource abstraction in the core package, on the other hand, already expects the logging system to be available.

Since:
1.1.5
Author:
Juergen Hoeller
See Also:
Resource, ClassPathResource, FileSystemResource, UrlResource, ResourceLoader

Field Summary
static String | CLASSPATH_URL_PREFIX Pseudo URL prefix for loading from the class path: "classpath:"
static String | FILE_URL_PREFIX URL prefix for loading from the file system: "file:"
static String | JAR_URL_SEPARATOR Separator between JAR URL and file path within the JAR
static String | URL_PROTOCOL_CODE_SOURCE URL protocol for an entry from an OC4J jar file: "code-source"
static String | URL_PROTOCOL_FILE URL protocol for a file in the file system: "file"
static String | URL_PROTOCOL_JAR URL protocol for an entry from a jar file: "jar"
static String | URL_PROTOCOL_VFS URL protocol for a JBoss VFS resource: "vfs"
static String | URL_PROTOCOL_VFSZIP URL protocol for an entry from a JBoss jar file: "vfszip"
static String | URL_PROTOCOL_WSJAR URL protocol for an entry from a WebSphere jar file: "wsjar"
static String | URL_PROTOCOL_ZIP URL protocol for an entry from a zip file: "zip"
Constructor Summary
ResourceUtils()
Method Summary
static URL | extractJarFileURL(URL jarUrl) Extract the URL for the actual jar file from the given URL (which may point to a resource in a jar file or to a jar file itself).
static File | getFile(String resourceLocation) Resolve the given resource location to a java.io.File, i.e.
static File | getFile(URI resourceUri) Resolve the given resource URI to a java.io.File, i.e.
static File | getFile(URI resourceUri, String description) Resolve the given resource URI to a java.io.File, i.e.
static File | getFile(URL resourceUrl) Resolve the given resource URL to a java.io.File, i.e.
static File | getFile(URL resourceUrl, String description) Resolve the given resource URL to a java.io.File, i.e.
static URL | getURL(String resourceLocation) Resolve the given resource location to a java.net.URL.
static boolean | isJarURL(URL url) Determine whether the given URL points to a resource in a jar file, that is, has protocol "jar", "zip", "wsjar" or "code-source".
static boolean | isUrl(String resourceLocation) Return whether the given resource location is a URL: either a special "classpath" pseudo URL or a standard URL.
static URI | toURI(String location) Create a URI instance for the given location String, replacing spaces with "%20" quotes first.
static URI | toURI(URL url) Create a URI instance for the given URL, replacing spaces with "%20" quotes first.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

CLASSPATH_URL_PREFIX

public static final String CLASSPATH_URL_PREFIX
Pseudo URL prefix for loading from the class path: "classpath:"

See Also:
Constant Field Values

FILE_URL_PREFIX

public static final String FILE_URL_PREFIX
URL prefix for loading from the file system: "file:"

See Also:
Constant Field Values

URL_PROTOCOL_FILE

public static final String URL_PROTOCOL_FILE
URL protocol for a file in the file system: "file"

See Also:
Constant Field Values

URL_PROTOCOL_JAR

public static final String URL_PROTOCOL_JAR
URL protocol for an entry from a jar file: "jar"

See Also:
Constant Field Values

URL_PROTOCOL_ZIP

public static final String URL_PROTOCOL_ZIP
URL protocol for an entry from a zip file: "zip"

See Also:
Constant Field Values

URL_PROTOCOL_VFSZIP

public static final String URL_PROTOCOL_VFSZIP
URL protocol for an entry from a JBoss jar file: "vfszip"

See Also:
Constant Field Values

URL_PROTOCOL_VFS

public static final String URL_PROTOCOL_VFS
URL protocol for a JBoss VFS resource: "vfs"

See Also:
Constant Field Values

URL_PROTOCOL_WSJAR

public static final String URL_PROTOCOL_WSJAR
URL protocol for an entry from a WebSphere jar file: "wsjar"

See Also:
Constant Field Values

URL_PROTOCOL_CODE_SOURCE

public static final String URL_PROTOCOL_CODE_SOURCE
URL protocol for an entry from an OC4J jar file: "code-source"

See Also:
Constant Field Values

JAR_URL_SEPARATOR

public static final String JAR_URL_SEPARATOR
Separator between JAR URL and file path within the JAR

See Also:
Constant Field Values
Constructor Detail

ResourceUtils

public ResourceUtils()
Method Detail

isUrl

public static boolean isUrl(String resourceLocation)
Return whether the given resource location is a URL: either a special "classpath" pseudo URL or a standard URL.

Parameters:
resourceLocation - the location String to check
Returns:
whether the location qualifies as a URL
See Also:
CLASSPATH_URL_PREFIX, URL

getURL

public static URL getURL(String resourceLocation)
                  throws FileNotFoundException
Resolve the given resource location to a java.net.URL.

Does not check whether the URL actually exists; simply returns the URL that the given location would correspond to.

Parameters:
resourceLocation - the resource location to resolve: either a "classpath:" pseudo URL, a "file:" URL, or a plain file path
Returns:
a corresponding URL object
Throws:
FileNotFoundException - if the resource cannot be resolved to a URL

getFile

public static File getFile(String resourceLocation)
                    throws FileNotFoundException
Resolve the given resource location to a java.io.File, i.e. to a file in the file system.

Does not check whether the fil actually exists; simply returns the File that the given location would correspond to.

Parameters:
resourceLocation - the resource location to resolve: either a "classpath:" pseudo URL, a "file:" URL, or a plain file path
Returns:
a corresponding File object
Throws:
FileNotFoundException - if the resource cannot be resolved to a file in the file system

getFile

public static File getFile(URL resourceUrl)
                    throws FileNotFoundException
Resolve the given resource URL to a java.io.File, i.e. to a file in the file system.

Parameters:
resourceUrl - the resource URL to resolve
Returns:
a corresponding File object
Throws:
FileNotFoundException - if the URL cannot be resolved to a file in the file system

getFile

public static File getFile(URL resourceUrl,
                           String description)
                    throws FileNotFoundException
Resolve the given resource URL to a java.io.File, i.e. to a file in the file system.

Parameters:
resourceUrl - the resource URL to resolve
description - a description of the original resource that the URL was created for (for example, a class path location)
Returns:
a corresponding File object
Throws:
FileNotFoundException - if the URL cannot be resolved to a file in the file system

getFile

public static File getFile(URI resourceUri)
                    throws FileNotFoundException
Resolve the given resource URI to a java.io.File, i.e. to a file in the file system.

Parameters:
resourceUri - the resource URI to resolve
Returns:
a corresponding File object
Throws:
FileNotFoundException - if the URL cannot be resolved to a file in the file system

getFile

public static File getFile(URI resourceUri,
                           String description)
                    throws FileNotFoundException
Resolve the given resource URI to a java.io.File, i.e. to a file in the file system.

Parameters:
resourceUri - the resource URI to resolve
description - a description of the original resource that the URI was created for (for example, a class path location)
Returns:
a corresponding File object
Throws:
FileNotFoundException - if the URL cannot be resolved to a file in the file system

isJarURL

public static boolean isJarURL(URL url)
Determine whether the given URL points to a resource in a jar file, that is, has protocol "jar", "zip", "wsjar" or "code-source".

"zip" and "wsjar" are used by BEA WebLogic Server and IBM WebSphere, respectively, but can be treated like jar files. The same applies to "code-source" URLs on Oracle OC4J, provided that the path contains a jar separator.

Parameters:
url - the URL to check
Returns:
whether the URL has been identified as a JAR URL

extractJarFileURL

public static URL extractJarFileURL(URL jarUrl)
                             throws MalformedURLException
Extract the URL for the actual jar file from the given URL (which may point to a resource in a jar file or to a jar file itself).

Parameters:
jarUrl - the original URL
Returns:
the URL for the actual jar file
Throws:
MalformedURLException - if no valid jar file URL could be extracted

toURI

public static URI toURI(URL url)
                 throws URISyntaxException
Create a URI instance for the given URL, replacing spaces with "%20" quotes first.

Furthermore, this method works on JDK 1.4 as well, in contrast to the URL.toURI() method.

Parameters:
url - the URL to convert into a URI instance
Returns:
the URI instance
Throws:
URISyntaxException - if the URL wasn't a valid URI
See Also:
URL.toURI()

toURI

public static URI toURI(String location)
                 throws URISyntaxException
Create a URI instance for the given location String, replacing spaces with "%20" quotes first.

Parameters:
location - the location String to convert into a URI instance
Returns:
the URI instance
Throws:
URISyntaxException - if the location wasn't a valid URI
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StopWatch

org.springframework.util
Class StopWatch

java.lang.Object
    extended by  org.springframework.util.StopWatch

public class StopWatch
extends Object

Simple stop watch, allowing for timing of a number of tasks, exposing total running time and running time for each named task.

Conceals use of System.currentTimeMillis(), improving the readability of application code and reducing the likelihood of calculation errors.

Note that this object is not designed to be thread-safe and does not use synchronization.

This class is normally used to verify performance during proof-of-concepts and in development, rather than as part of production applications.

Since:
May 2, 2001
Author:
Rod Johnson, Juergen Hoeller, Sam Brannen

Nested Class Summary
static class StopWatch.TaskInfo
Inner class to hold data about one task executed within the stop watch.
Constructor Summary
StopWatch()
Construct a new stop watch.
StopWatch(String id)
Construct a new stop watch with the given id.
Method Summary
 String getLastTaskName()
Return the name of the last task.
 long getLastTaskTimeMillis()
Return the time taken by the last task.
 int getTaskCount()
Return the number of tasks timed.
 StopWatch.TaskInfo[] getTaskInfo()
Return an array of the data for tasks performed.
 long getTotalTimeMillis()
Return the total time in milliseconds for all tasks.
 double getTotalTimeSeconds()
Return the total time in seconds for all tasks.
 boolean isRunning()
Return whether the stop watch is currently running.
 String prettyPrint()
Return a string with a table describing all tasks performed.
 void setKeepTaskList(boolean keepTaskList)
Determine whether the TaskInfo array is built over time.
 String shortSummary()
Return a short description of the total running time.
 void start()
Start an unnamed task.
 void start(String taskName)
Start a named task.
 void stop()
Stop the current task.
 String toString()
Return an informative string describing all tasks performed For custom reporting, call getTaskInfo() and use the task info directly.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

StopWatch

public StopWatch()
Construct a new stop watch. Does not start any task.

StopWatch

public StopWatch(String id)
Construct a new stop watch with the given id. Does not start any task.

Parameters:
id - identifier for this stop watch. Handy when we have output from multiple stop watches and need to distinguish between them.
Method Detail

setKeepTaskList

public void setKeepTaskList(boolean keepTaskList)
Determine whether the TaskInfo array is built over time. Set this to "false" when using a StopWatch for millions of intervals, or the task info structure will consume excessive memory. Default is "true".

start

public void start()
           throws IllegalStateException
Start an unnamed task. The results are undefined if stop() or timing methods are called without invoking this method.

Throws:
IllegalStateException
See Also:
stop()

start

public void start(String taskName)
           throws IllegalStateException
Start a named task. The results are undefined if stop() or timing methods are called without invoking this method.

Parameters:
taskName - the name of the task to start
Throws:
IllegalStateException
See Also:
stop()

stop

public void stop()
          throws IllegalStateException
Stop the current task. The results are undefined if timing methods are called without invoking at least one pair start() / stop() methods.

Throws:
IllegalStateException
See Also:
start()

isRunning

public boolean isRunning()
Return whether the stop watch is currently running.

getLastTaskTimeMillis

public long getLastTaskTimeMillis()
                           throws IllegalStateException
Return the time taken by the last task.

Throws:
IllegalStateException

getLastTaskName

public String getLastTaskName()
                       throws IllegalStateException
Return the name of the last task.

Throws:
IllegalStateException

getTotalTimeMillis

public long getTotalTimeMillis()
Return the total time in milliseconds for all tasks.

getTotalTimeSeconds

public double getTotalTimeSeconds()
Return the total time in seconds for all tasks.

getTaskCount

public int getTaskCount()
Return the number of tasks timed.

getTaskInfo

public StopWatch.TaskInfo[] getTaskInfo()
Return an array of the data for tasks performed.

shortSummary

public String shortSummary()
Return a short description of the total running time.

prettyPrint

public String prettyPrint()
Return a string with a table describing all tasks performed. For custom reporting, call getTaskInfo() and use the task info directly.

toString

public String toString()
Return an informative string describing all tasks performed For custom reporting, call getTaskInfo() and use the task info directly.

Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StopWatch.TaskInfo

org.springframework.util
Class StopWatch.TaskInfo

java.lang.Object
    extended by  org.springframework.util.StopWatch.TaskInfo
Enclosing class:
StopWatch
public static class StopWatch.TaskInfo
extends Object

Inner class to hold data about one task executed within the stop watch.

Method Summary
String | getTaskName() Return the name of this task.
long | getTimeMillis() Return the time in milliseconds this task took.
double | getTimeSeconds() Return the time in seconds this task took.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail

getTaskName

public String getTaskName()
Return the name of this task.

getTimeMillis

public long getTimeMillis()
Return the time in milliseconds this task took.

getTimeSeconds

public double getTimeSeconds()
Return the time in seconds this task took.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StringUtils

org.springframework.util
Class StringUtils

java.lang.Object
    extended by  org.springframework.util.StringUtils

public abstract class StringUtils
extends Object

Miscellaneous String utility methods.

Mainly for internal use within the framework; consider Jakarta's Commons Lang for a more comprehensive suite of String utilities.

This class delivers some simple functionality that should really be provided by the core Java String and StringBuilder classes, such as the ability to replace(java.lang.String, java.lang.String, java.lang.String) all occurrences of a given substring in a target string. It also provides easy-to-use methods to convert between delimited strings, such as CSV strings, and collections and arrays.

Since:
16 April 2001
Author:
Rod Johnson, Juergen Hoeller, Keith Donald, Rob Harrop, Rick Evans, Arjen Poutsma
See Also:
org.apache.commons.lang.StringUtils

Constructor Summary
StringUtils()
Method Summary
static String[] | addStringToArray(String[] array, String str) Append the given String to the given String array, returning a new array consisting of the input array contents plus the given String.
static String | applyRelativePath(String path, String relativePath) Apply the given relative path to the given path, assuming standard Java folder separation (i.e.
static String | arrayToCommaDelimitedString(Object[] arr) Convenience method to return a String array as a CSV String.
static String | arrayToDelimitedString(Object[] arr, String delim) Convenience method to return a String array as a delimited (e.g.
static String | capitalize(String str) Capitalize a String, changing the first letter to upper case as per Character.toUpperCase(char).
static String | cleanPath(String path) Normalize the path by suppressing sequences like "path/.." and inner simple dots.
static String | collectionToCommaDelimitedString(Collection coll) Convenience method to return a Collection as a CSV String.
static String | collectionToDelimitedString(Collection coll, String delim) Convenience method to return a Collection as a delimited (e.g.
static String | collectionToDelimitedString(Collection coll, String delim, String prefix, String suffix) Convenience method to return a Collection as a delimited (e.g.
static Set<String> | commaDelimitedListToSet(String str) Convenience method to convert a CSV string list to a set.
static String[] | commaDelimitedListToStringArray(String str) Convert a CSV list into an array of Strings.
static String[] | concatenateStringArrays(String[] array1, String[] array2) Concatenate the given String arrays into one, with overlapping array elements included twice.
static boolean | containsWhitespace(CharSequence str) Check whether the given CharSequence contains any whitespace characters.
static boolean | containsWhitespace(String str) Check whether the given String contains any whitespace characters.
static int | countOccurrencesOf(String str, String sub) Count the occurrences of the substring in string s.
static String | delete(String inString, String pattern) Delete all occurrences of the given substring.
static String | deleteAny(String inString, String charsToDelete) Delete any character in a given String.
static String[] | delimitedListToStringArray(String str, String delimiter) Take a String which is a delimited list and convert it to a String array.
static String[] | delimitedListToStringArray(String str, String delimiter, String charsToDelete) Take a String which is a delimited list and convert it to a String array.
static boolean | endsWithIgnoreCase(String str, String suffix) Test if the given String ends with the specified suffix, ignoring upper/lower case.
static String | getFilename(String path) Extract the filename from the given path, e.g.
static String | getFilenameExtension(String path) Extract the filename extension from the given path, e.g.
static boolean | hasLength(CharSequence str) Check that the given CharSequence is neither null nor of length 0.
static boolean | hasLength(String str) Check that the given String is neither null nor of length 0.
static boolean | hasText(CharSequence str) Check whether the given CharSequence has actual text.
static boolean | hasText(String str) Check whether the given String has actual text.
static String[] | mergeStringArrays(String[] array1, String[] array2) Merge the given String arrays into one, with overlapping array elements only included once.
static Locale | parseLocaleString(String localeString) Parse the given localeString into a Locale.
static boolean | pathEquals(String path1, String path2) Compare two paths after normalization of them.
static String | quote(String str) Quote the given String with single quotes.
static Object | quoteIfString(Object obj) Turn the given Object into a String with single quotes if it is a String; keeping the Object as-is else.
static String[] | removeDuplicateStrings(String[] array) Remove duplicate Strings from the given array.
static String | replace(String inString, String oldPattern, String newPattern) Replace all occurences of a substring within a string with another string.
static String[] | sortStringArray(String[] array) Turn given source String array into sorted array.
static String[] | split(String toSplit, String delimiter) Split a String at the first occurrence of the delimiter.
static Properties | splitArrayElementsIntoProperties(String[] array, String delimiter) Take an array Strings and split each element based on the given delimiter.
static Properties | splitArrayElementsIntoProperties(String[] array, String delimiter, String charsToDelete) Take an array Strings and split each element based on the given delimiter.
static boolean | startsWithIgnoreCase(String str, String prefix) Test if the given String starts with the specified prefix, ignoring upper/lower case.
static String | stripFilenameExtension(String path) Strip the filename extension from the given path, e.g.
static boolean | substringMatch(CharSequence str, int index, CharSequence substring) Test whether the given string matches the given substring at the given index.
static String[] | tokenizeToStringArray(String str, String delimiters) Tokenize the given String into a String array via a StringTokenizer.
static String[] | tokenizeToStringArray(String str, String delimiters, boolean trimTokens, boolean ignoreEmptyTokens) Tokenize the given String into a String array via a StringTokenizer.
static String | toLanguageTag(Locale locale) Determine the RFC 3066 compliant language tag, as used for the HTTP "Accept-Language" header.
static String[] | toStringArray(Collection<String> collection) Copy the given Collection into a String array.
static String[] | toStringArray(Enumeration<String> enumeration) Copy the given Enumeration into a String array.
static String | trimAllWhitespace(String str) Trim all whitespace from the given String: leading, trailing, and inbetween characters.
static String[] | trimArrayElements(String[] array) Trim the elements of the given String array, calling String.trim() on each of them.
static String | trimLeadingCharacter(String str, char leadingCharacter) Trim all occurences of the supplied leading character from the given String.
static String | trimLeadingWhitespace(String str) Trim leading whitespace from the given String.
static String | trimTrailingCharacter(String str, char trailingCharacter) Trim all occurences of the supplied trailing character from the given String.
static String | trimTrailingWhitespace(String str) Trim trailing whitespace from the given String.
static String | trimWhitespace(String str) Trim leading and trailing whitespace from the given String.
static String | uncapitalize(String str) Uncapitalize a String, changing the first letter to lower case as per Character.toLowerCase(char).
static String | unqualify(String qualifiedName) Unqualify a string qualified by a '.' dot character.
static String | unqualify(String qualifiedName, char separator) Unqualify a string qualified by a separator character.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

StringUtils

public StringUtils()
Method Detail

hasLength

public static boolean hasLength(CharSequence str)
Check that the given CharSequence is neither null nor of length 0. Note: Will return true for a CharSequence that purely consists of whitespace.

 StringUtils.hasLength(null) = false
 StringUtils.hasLength("") = false
 StringUtils.hasLength(" ") = true
 StringUtils.hasLength("Hello") = true

Parameters:
str - the CharSequence to check (may be null)
Returns:
true if the CharSequence is not null and has length
See Also:
hasText(String)

hasLength

public static boolean hasLength(String str)
Check that the given String is neither null nor of length 0. Note: Will return true for a String that purely consists of whitespace.

Parameters:
str - the String to check (may be null)
Returns:
true if the String is not null and has length
See Also:
hasLength(CharSequence)

hasText

public static boolean hasText(CharSequence str)
Check whether the given CharSequence has actual text. More specifically, returns true if the string not null, its length is greater than 0, and it contains at least one non-whitespace character.

 StringUtils.hasText(null) = false
 StringUtils.hasText("") = false
 StringUtils.hasText(" ") = false
 StringUtils.hasText("12345") = true
 StringUtils.hasText(" 12345 ") = true

Parameters:
str - the CharSequence to check (may be null)
Returns:
true if the CharSequence is not null, its length is greater than 0, and it does not contain whitespace only
See Also:
Character.isWhitespace(char)

hasText

public static boolean hasText(String str)
Check whether the given String has actual text. More specifically, returns true if the string not null, its length is greater than 0, and it contains at least one non-whitespace character.

Parameters:
str - the String to check (may be null)
Returns:
true if the String is not null, its length is greater than 0, and it does not contain whitespace only
See Also:
hasText(CharSequence)

containsWhitespace

public static boolean containsWhitespace(CharSequence str)
Check whether the given CharSequence contains any whitespace characters.

Parameters:
str - the CharSequence to check (may be null)
Returns:
true if the CharSequence is not empty and contains at least 1 whitespace character
See Also:
Character.isWhitespace(char)

containsWhitespace

public static boolean containsWhitespace(String str)
Check whether the given String contains any whitespace characters.

Parameters:
str - the String to check (may be null)
Returns:
true if the String is not empty and contains at least 1 whitespace character
See Also:
containsWhitespace(CharSequence)

trimWhitespace

public static String trimWhitespace(String str)
Trim leading and trailing whitespace from the given String.

Parameters:
str - the String to check
Returns:
the trimmed String
See Also:
Character.isWhitespace(char)

trimAllWhitespace

public static String trimAllWhitespace(String str)
Trim all whitespace from the given String: leading, trailing, and inbetween characters.

Parameters:
str - the String to check
Returns:
the trimmed String
See Also:
Character.isWhitespace(char)

trimLeadingWhitespace

public static String trimLeadingWhitespace(String str)
Trim leading whitespace from the given String.

Parameters:
str - the String to check
Returns:
the trimmed String
See Also:
Character.isWhitespace(char)

trimTrailingWhitespace

public static String trimTrailingWhitespace(String str)
Trim trailing whitespace from the given String.

Parameters:
str - the String to check
Returns:
the trimmed String
See Also:
Character.isWhitespace(char)

trimLeadingCharacter

public static String trimLeadingCharacter(String str,
                                          char leadingCharacter)
Trim all occurences of the supplied leading character from the given String.

Parameters:
str - the String to check
leadingCharacter - the leading character to be trimmed
Returns:
the trimmed String

trimTrailingCharacter

public static String trimTrailingCharacter(String str,
                                           char trailingCharacter)
Trim all occurences of the supplied trailing character from the given String.

Parameters:
str - the String to check
trailingCharacter - the trailing character to be trimmed
Returns:
the trimmed String

startsWithIgnoreCase

public static boolean startsWithIgnoreCase(String str,
                                           String prefix)
Test if the given String starts with the specified prefix, ignoring upper/lower case.

Parameters:
str - the String to check
prefix - the prefix to look for
See Also:
String.startsWith(java.lang.String, int)

endsWithIgnoreCase

public static boolean endsWithIgnoreCase(String str,
                                         String suffix)
Test if the given String ends with the specified suffix, ignoring upper/lower case.

Parameters:
str - the String to check
suffix - the suffix to look for
See Also:
String.endsWith(java.lang.String)

substringMatch

public static boolean substringMatch(CharSequence str,
                                     int index,
                                     CharSequence substring)
Test whether the given string matches the given substring at the given index.

Parameters:
str - the original string (or StringBuilder)
index - the index in the original string to start matching against
substring - the substring to match at the given index

countOccurrencesOf

public static int countOccurrencesOf(String str,
                                     String sub)
Count the occurrences of the substring in string s.

Parameters:
str - string to search in. Return 0 if this is null.
sub - string to search for. Return 0 if this is null.

replace

public static String replace(String inString,
                             String oldPattern,
                             String newPattern)
Replace all occurences of a substring within a string with another string.

Parameters:
inString - String to examine
oldPattern - String to replace
newPattern - String to insert
Returns:
a String with the replacements

delete

public static String delete(String inString,
                            String pattern)
Delete all occurrences of the given substring.

Parameters:
inString - the original String
pattern - the pattern to delete all occurrences of
Returns:
the resulting String

deleteAny

public static String deleteAny(String inString,
                               String charsToDelete)
Delete any character in a given String.

Parameters:
inString - the original String
charsToDelete - a set of characters to delete. E.g. "az\n" will delete 'a's, 'z's and new lines.
Returns:
the resulting String

quote

public static String quote(String str)
Quote the given String with single quotes.

Parameters:
str - the input String (e.g. "myString")
Returns:
the quoted String (e.g. "'myString'"), or null if the input was null

quoteIfString

public static Object quoteIfString(Object obj)
Turn the given Object into a String with single quotes if it is a String; keeping the Object as-is else.

Parameters:
obj - the input Object (e.g. "myString")
Returns:
the quoted String (e.g. "'myString'"), or the input object as-is if not a String

unqualify

public static String unqualify(String qualifiedName)
Unqualify a string qualified by a '.' dot character. For example, "this.name.is.qualified", returns "qualified".

Parameters:
qualifiedName - the qualified name

unqualify

public static String unqualify(String qualifiedName,
                               char separator)
Unqualify a string qualified by a separator character. For example, "this:name:is:qualified" returns "qualified" if using a ':' separator.

Parameters:
qualifiedName - the qualified name
separator - the separator

capitalize

public static String capitalize(String str)
Capitalize a String, changing the first letter to upper case as per Character.toUpperCase(char). No other letters are changed.

Parameters:
str - the String to capitalize, may be null
Returns:
the capitalized String, null if null

uncapitalize

public static String uncapitalize(String str)
Uncapitalize a String, changing the first letter to lower case as per Character.toLowerCase(char). No other letters are changed.

Parameters:
str - the String to uncapitalize, may be null
Returns:
the uncapitalized String, null if null

getFilename

public static String getFilename(String path)
Extract the filename from the given path, e.g. "mypath/myfile.txt" -> "myfile.txt".

Parameters:
path - the file path (may be null)
Returns:
the extracted filename, or null if none

getFilenameExtension

public static String getFilenameExtension(String path)
Extract the filename extension from the given path, e.g. "mypath/myfile.txt" -> "txt".

Parameters:
path - the file path (may be null)
Returns:
the extracted filename extension, or null if none

stripFilenameExtension

public static String stripFilenameExtension(String path)
Strip the filename extension from the given path, e.g. "mypath/myfile.txt" -> "mypath/myfile".

Parameters:
path - the file path (may be null)
Returns:
the path with stripped filename extension, or null if none

applyRelativePath

public static String applyRelativePath(String path,
                                       String relativePath)
Apply the given relative path to the given path, assuming standard Java folder separation (i.e. "/" separators);

Parameters:
path - the path to start from (usually a full file path)
relativePath - the relative path to apply (relative to the full file path above)
Returns:
the full file path that results from applying the relative path

cleanPath

public static String cleanPath(String path)
Normalize the path by suppressing sequences like "path/.." and inner simple dots.

The result is convenient for path comparison. For other uses, notice that Windows separators ("\") are replaced by simple slashes.

Parameters:
path - the original path
Returns:
the normalized path

pathEquals

public static boolean pathEquals(String path1,
                                 String path2)
Compare two paths after normalization of them.

Parameters:
path1 - first path for comparison
path2 - second path for comparison
Returns:
whether the two paths are equivalent after normalization

parseLocaleString

public static Locale parseLocaleString(String localeString)
Parse the given localeString into a Locale.

This is the inverse operation of Locale's toString.

Parameters:
localeString - the locale string, following Locale's toString() format ("en", "en_UK", etc); also accepts spaces as separators, as an alternative to underscores
Returns:
a corresponding Locale instance

toLanguageTag

public static String toLanguageTag(Locale locale)
Determine the RFC 3066 compliant language tag, as used for the HTTP "Accept-Language" header.

Parameters:
locale - the Locale to transform to a language tag
Returns:
the RFC 3066 compliant language tag as String

addStringToArray

public static String[] addStringToArray(String[] array,
                                        String str)
Append the given String to the given String array, returning a new array consisting of the input array contents plus the given String.

Parameters:
array - the array to append to (can be null)
str - the String to append
Returns:
the new array (never null)

concatenateStringArrays

public static String[] concatenateStringArrays(String[] array1,
                                               String[] array2)
Concatenate the given String arrays into one, with overlapping array elements included twice.

The order of elements in the original arrays is preserved.

Parameters:
array1 - the first array (can be null)
array2 - the second array (can be null)
Returns:
the new array (null if both given arrays were null)

mergeStringArrays

public static String[] mergeStringArrays(String[] array1,
                                         String[] array2)
Merge the given String arrays into one, with overlapping array elements only included once.

The order of elements in the original arrays is preserved (with the exception of overlapping elements, which are only included on their first occurence).

Parameters:
array1 - the first array (can be null)
array2 - the second array (can be null)
Returns:
the new array (null if both given arrays were null)

sortStringArray

public static String[] sortStringArray(String[] array)
Turn given source String array into sorted array.

Parameters:
array - the source array
Returns:
the sorted array (never null)

toStringArray

public static String[] toStringArray(Collection<String> collection)
Copy the given Collection into a String array. The Collection must contain String elements only.

Parameters:
collection - the Collection to copy
Returns:
the String array (null if the passed-in Collection was null)

toStringArray

public static String[] toStringArray(Enumeration<String> enumeration)
Copy the given Enumeration into a String array. The Enumeration must contain String elements only.

Parameters:
enumeration - the Enumeration to copy
Returns:
the String array (null if the passed-in Enumeration was null)

trimArrayElements

public static String[] trimArrayElements(String[] array)
Trim the elements of the given String array, calling String.trim() on each of them.

Parameters:
array - the original String array
Returns:
the resulting array (of the same size) with trimmed elements

removeDuplicateStrings

public static String[] removeDuplicateStrings(String[] array)
Remove duplicate Strings from the given array. Also sorts the array, as it uses a TreeSet.

Parameters:
array - the String array
Returns:
an array without duplicates, in natural sort order

split

public static String[] split(String toSplit,
                             String delimiter)
Split a String at the first occurrence of the delimiter. Does not include the delimiter in the result.

Parameters:
toSplit - the string to split
delimiter - to split the string up with
Returns:
a two element array with index 0 being before the delimiter, and index 1 being after the delimiter (neither element includes the delimiter); or null if the delimiter wasn't found in the given input String

splitArrayElementsIntoProperties

public static Properties splitArrayElementsIntoProperties(String[] array,
                                                          String delimiter)
Take an array Strings and split each element based on the given delimiter. A Properties instance is then generated, with the left of the delimiter providing the key, and the right of the delimiter providing the value.

Will trim both the key and value before adding them to the Properties instance.

Parameters:
array - the array to process
delimiter - to split each element using (typically the equals symbol)
Returns:
a Properties instance representing the array contents, or null if the array to process was null or empty

splitArrayElementsIntoProperties

public static Properties splitArrayElementsIntoProperties(String[] array,
                                                          String delimiter,
                                                          String charsToDelete)
Take an array Strings and split each element based on the given delimiter. A Properties instance is then generated, with the left of the delimiter providing the key, and the right of the delimiter providing the value.

Will trim both the key and value before adding them to the Properties instance.

Parameters:
array - the array to process
delimiter - to split each element using (typically the equals symbol)
charsToDelete - one or more characters to remove from each element prior to attempting the split operation (typically the quotation mark symbol), or null if no removal should occur
Returns:
a Properties instance representing the array contents, or null if the array to process was null or empty

tokenizeToStringArray

public static String[] tokenizeToStringArray(String str,
                                             String delimiters)
Tokenize the given String into a String array via a StringTokenizer. Trims tokens and omits empty tokens.

The given delimiters string is supposed to consist of any number of delimiter characters. Each of those characters can be used to separate tokens. A delimiter is always a single character; for multi-character delimiters, consider using delimitedListToStringArray

Parameters:
str - the String to tokenize
delimiters - the delimiter characters, assembled as String (each of those characters is individually considered as delimiter).
Returns:
an array of the tokens
See Also:
StringTokenizer, String.trim(), delimitedListToStringArray(java.lang.String, java.lang.String)

tokenizeToStringArray

public static String[] tokenizeToStringArray(String str,
                                             String delimiters,
                                             boolean trimTokens,
                                             boolean ignoreEmptyTokens)
Tokenize the given String into a String array via a StringTokenizer.

The given delimiters string is supposed to consist of any number of delimiter characters. Each of those characters can be used to separate tokens. A delimiter is always a single character; for multi-character delimiters, consider using delimitedListToStringArray

Parameters:
str - the String to tokenize
delimiters - the delimiter characters, assembled as String (each of those characters is individually considered as delimiter)
trimTokens - trim the tokens via String's trim
ignoreEmptyTokens - omit empty tokens from the result array (only applies to tokens that are empty after trimming; StringTokenizer will not consider subsequent delimiters as token in the first place).
Returns:
an array of the tokens (null if the input String was null)
See Also:
StringTokenizer, String.trim(), delimitedListToStringArray(java.lang.String, java.lang.String)

delimitedListToStringArray

public static String[] delimitedListToStringArray(String str,
                                                  String delimiter)
Take a String which is a delimited list and convert it to a String array.

A single delimiter can consists of more than one character: It will still be considered as single delimiter string, rather than as bunch of potential delimiter characters - in contrast to tokenizeToStringArray.

Parameters:
str - the input String
delimiter - the delimiter between elements (this is a single delimiter, rather than a bunch individual delimiter characters)
Returns:
an array of the tokens in the list
See Also:
tokenizeToStringArray(java.lang.String, java.lang.String)

delimitedListToStringArray

public static String[] delimitedListToStringArray(String str,
                                                  String delimiter,
                                                  String charsToDelete)
Take a String which is a delimited list and convert it to a String array.

A single delimiter can consists of more than one character: It will still be considered as single delimiter string, rather than as bunch of potential delimiter characters - in contrast to tokenizeToStringArray.

Parameters:
str - the input String
delimiter - the delimiter between elements (this is a single delimiter, rather than a bunch individual delimiter characters)
charsToDelete - a set of characters to delete. Useful for deleting unwanted line breaks: e.g. "\r\n\f" will delete all new lines and line feeds in a String.
Returns:
an array of the tokens in the list
See Also:
tokenizeToStringArray(java.lang.String, java.lang.String)

commaDelimitedListToStringArray

public static String[] commaDelimitedListToStringArray(String str)
Convert a CSV list into an array of Strings.

Parameters:
str - the input String
Returns:
an array of Strings, or the empty array in case of empty input

commaDelimitedListToSet

public static Set<String> commaDelimitedListToSet(String str)
Convenience method to convert a CSV string list to a set. Note that this will suppress duplicates.

Parameters:
str - the input String
Returns:
a Set of String entries in the list

collectionToDelimitedString

public static String collectionToDelimitedString(Collection coll,
                                                 String delim,
                                                 String prefix,
                                                 String suffix)
Convenience method to return a Collection as a delimited (e.g. CSV) String. E.g. useful for toString() implementations.

Parameters:
coll - the Collection to display
delim - the delimiter to use (probably a ",")
prefix - the String to start each element with
suffix - the String to end each element with
Returns:
the delimited String

collectionToDelimitedString

public static String collectionToDelimitedString(Collection coll,
                                                 String delim)
Convenience method to return a Collection as a delimited (e.g. CSV) String. E.g. useful for toString() implementations.

Parameters:
coll - the Collection to display
delim - the delimiter to use (probably a ",")
Returns:
the delimited String

collectionToCommaDelimitedString

public static String collectionToCommaDelimitedString(Collection coll)
Convenience method to return a Collection as a CSV String. E.g. useful for toString() implementations.

Parameters:
coll - the Collection to display
Returns:
the delimited String

arrayToDelimitedString

public static String arrayToDelimitedString(Object[] arr,
                                            String delim)
Convenience method to return a String array as a delimited (e.g. CSV) String. E.g. useful for toString() implementations.

Parameters:
arr - the array to display
delim - the delimiter to use (probably a ",")
Returns:
the delimited String

arrayToCommaDelimitedString

public static String arrayToCommaDelimitedString(Object[] arr)
Convenience method to return a String array as a CSV String. E.g. useful for toString() implementations.

Parameters:
arr - the array to display
Returns:
the delimited String
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


SystemPropertyUtils

org.springframework.util
Class SystemPropertyUtils

java.lang.Object
    extended by  org.springframework.util.SystemPropertyUtils

public abstract class SystemPropertyUtils
extends Object

Helper class for resolving placeholders in texts. Usually applied to file paths.

A text may contain ${...} placeholders, to be resolved as system properties: e.g. ${user.dir}. Default values can be supplied using the ":" separator between key and value.

Since:
1.2.5
Author:
Juergen Hoeller, Rob Harrop, Dave Syer
See Also:
PLACEHOLDER_PREFIX, PLACEHOLDER_SUFFIX, System.getProperty(String)

Field Summary
static String | PLACEHOLDER_PREFIX Prefix for system property placeholders: "${"
static String | PLACEHOLDER_SUFFIX Suffix for system property placeholders: "}"
static String | VALUE_SEPARATOR Value separator for system property placeholders: ":"
Constructor Summary
SystemPropertyUtils()
Method Summary
static String | resolvePlaceholders(String text) Resolve ${...} placeholders in the given text, replacing them with corresponding system property values.
static String | resolvePlaceholders(String text, boolean ignoreUnresolvablePlaceholders) Resolve ${...} placeholders in the given text, replacing them with corresponding system property values.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

PLACEHOLDER_PREFIX

public static final String PLACEHOLDER_PREFIX
Prefix for system property placeholders: "${"

See Also:
Constant Field Values

PLACEHOLDER_SUFFIX

public static final String PLACEHOLDER_SUFFIX
Suffix for system property placeholders: "}"

See Also:
Constant Field Values

VALUE_SEPARATOR

public static final String VALUE_SEPARATOR
Value separator for system property placeholders: ":"

See Also:
Constant Field Values
Constructor Detail

SystemPropertyUtils

public SystemPropertyUtils()
Method Detail

resolvePlaceholders

public static String resolvePlaceholders(String text)
Resolve ${...} placeholders in the given text, replacing them with corresponding system property values.

Parameters:
text - the String to resolve
Returns:
the resolved String
Throws:
IllegalArgumentException - if there is an unresolvable placeholder
See Also:
PLACEHOLDER_PREFIX, PLACEHOLDER_SUFFIX

resolvePlaceholders

public static String resolvePlaceholders(String text,
                                         boolean ignoreUnresolvablePlaceholders)
Resolve ${...} placeholders in the given text, replacing them with corresponding system property values. Unresolvable placeholders with no default value are ignored and passed through unchanged if the flag is set to true.

Parameters:
text - the String to resolve
ignoreUnresolvablePlaceholders - flag to determine is unresolved placeholders are ignored
Returns:
the resolved String
Throws:
IllegalArgumentException - if there is an unresolvable placeholder and the flag is false
See Also:
PLACEHOLDER_PREFIX, PLACEHOLDER_SUFFIX
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TypeUtils

org.springframework.util
Class TypeUtils

java.lang.Object
    extended by  org.springframework.util.TypeUtils

public abstract class TypeUtils
extends Object

Utility to work with Java 5 generic type parameters. Mainly for internal use within the framework.

Since:
2.0.7
Author:
Ramnivas Laddad, Juergen Hoeller, Chris Beams

Constructor Summary
TypeUtils()
Method Summary
static boolean | isAssignable(Type lhsType, Type rhsType) Check if the right-hand side type may be assigned to the left-hand side type following the Java generics rules.
static boolean | isAssignableBound(Type lhsType, Type rhsType)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TypeUtils

public TypeUtils()
Method Detail

isAssignable

public static boolean isAssignable(Type lhsType,
                                   Type rhsType)
Check if the right-hand side type may be assigned to the left-hand side type following the Java generics rules.

Parameters:
lhsType - the target type
rhsType - the value type that should be assigned to the target type
Returns:
true if rhs is assignable to lhs

isAssignableBound

public static boolean isAssignableBound(Type lhsType,
                                        Type rhsType)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WeakReferenceMonitor

org.springframework.util
Class WeakReferenceMonitor

java.lang.Object
    extended by  org.springframework.util.WeakReferenceMonitor

public class WeakReferenceMonitor
extends Object

Track references to arbitrary objects using proxy and weak references. To monitor a handle, one should call monitor(Object, ReleaseListener), with the given handle object usually being a holder that uses the target object underneath, and the release listener performing cleanup of the target object once the handle is not strongly referenced anymore.

When a given handle becomes weakly reachable, the specified listener will be called by a background thread. This thread will only be started lazily and will be stopped once no handles are registered for monitoring anymore, to be restarted if further handles are added.

Thanks to Tomasz Wysocki for the suggestion and the original implementation of this class!

Since:
1.2
Author:
Colin Sampaleanu, Juergen Hoeller
See Also:
monitor(java.lang.Object, org.springframework.util.WeakReferenceMonitor.ReleaseListener)

Nested Class Summary
static interface WeakReferenceMonitor.ReleaseListener
Listener that is notified when the handle is being released.
Constructor Summary
WeakReferenceMonitor()
Method Summary
static void monitor(Object handle, WeakReferenceMonitor.ReleaseListener listener)
Start to monitor given handle object for becoming weakly reachable.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

WeakReferenceMonitor

public WeakReferenceMonitor()
Method Detail

monitor

public static void monitor(Object handle,
                           WeakReferenceMonitor.ReleaseListener listener)
Start to monitor given handle object for becoming weakly reachable. When the handle isn't used anymore, the given listener will be called.

Parameters:
handle - the object that will be monitored
listener - the listener that will be called upon release of the handle
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WeakReferenceMonitor.ReleaseListener

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.util
Interface WeakReferenceMonitor.ReleaseListener

Enclosing class:
WeakReferenceMonitor
public static interface WeakReferenceMonitor.ReleaseListener

Listener that is notified when the handle is being released. To be implemented by users of this reference monitor.

Method Summary
 void released()
This callback method is invoked once the associated handle has been released, i.e.

Method Detail

released

void released()
This callback method is invoked once the associated handle has been released, i.e. once there are no monitored strong references to the handle anymore.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.util.comparator

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.util.comparator

Useful generic java.util.Comparator implementations, such as an invertible comparator and a compound comparator.

See:
Description

Class Summary
BooleanComparator | A Comparator for Boolean objects that can sort either true or false first.
ComparableComparator<T extends Comparable<T>> | Comparator that adapts Comparables to the Comparator interface.
CompoundComparator<T> | A comparator that chains a sequence of one or more more Comparators.
InvertibleComparator<T> | A decorator for a comparator, with an "ascending" flag denoting whether comparison results should be treated in forward (standard ascending) order or flipped for reverse (descending) order.
NullSafeComparator<T> | A Comparator that will safely compare nulls to be lower or higher than other objects.

Package org.springframework.util.comparator Description

Useful generic java.util.Comparator implementations, such as an invertible comparator and a compound comparator.


org.springframework.util.comparator Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.util.comparator

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.util.comparator.BooleanComparator (implements java.util.Comparator<T>, java.io.Serializable)
    • org.springframework.util.comparator.ComparableComparator<T> (implements java.util.Comparator<T>)
    • org.springframework.util.comparator.CompoundComparator<T> (implements java.util.Comparator<T>, java.io.Serializable)
    • org.springframework.util.comparator.InvertibleComparator<T> (implements java.util.Comparator<T>, java.io.Serializable)
    • org.springframework.util.comparator.NullSafeComparator<T> (implements java.util.Comparator<T>)


BooleanComparator

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.util.comparator
Class BooleanComparator

java.lang.Object
    extended by  org.springframework.util.comparator.BooleanComparator
All Implemented Interfaces:
Serializable, Comparator<Boolean>
public final class BooleanComparator
extends Object
implements Comparator<Boolean>, Serializable

A Comparator for Boolean objects that can sort either true or false first.

Since:
1.2.2
Author:
Keith Donald
See Also:
Serialized Form

Field Summary
static BooleanComparator | TRUE_HIGH A shared default instance of this comparator, treating true higher than false.
static BooleanComparator | TRUE_LOW A shared default instance of this comparator, treating true lower than false.
Constructor Summary
BooleanComparator(boolean trueLow)
Create a BooleanComparator that sorts boolean values based on the provided flag.
Method Summary
int | compare(Boolean v1, Boolean v2)
boolean | equals(Object obj)
int | hashCode()
String | toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail

TRUE_LOW

public static final BooleanComparator TRUE_LOW
A shared default instance of this comparator, treating true lower than false.

TRUE_HIGH

public static final BooleanComparator TRUE_HIGH
A shared default instance of this comparator, treating true higher than false.

Constructor Detail

BooleanComparator

public BooleanComparator(boolean trueLow)
Create a BooleanComparator that sorts boolean values based on the provided flag.

Alternatively, you can use the default shared instances: BooleanComparator.TRUE_LOW and BooleanComparator.TRUE_HIGH.

Parameters:
trueLow - whether to treat true as lower or higher than false
See Also:
TRUE_LOW, TRUE_HIGH
Method Detail

compare

public int compare(Boolean v1,
                   Boolean v2)
Specified by:
compare in interface Comparator<Boolean>

equals

public boolean equals(Object obj)
Specified by:
equals in interface Comparator<Boolean>
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ComparableComparator

org.springframework.util.comparator
Class ComparableComparator<T extends Comparable<T>>

java.lang.Object
    extended by  org.springframework.util.comparator.ComparableComparator<T>
All Implemented Interfaces:
Comparator<T>
public class ComparableComparator<T extends Comparable<T>>
extends Object
implements Comparator<T>

Comparator that adapts Comparables to the Comparator interface. Mainly for internal use in other Comparators, when supposed to work on Comparables.

Since:
1.2.2
Author:
Keith Donald
See Also:
Comparable

Constructor Summary
ComparableComparator()
Method Summary
 int compare(T o1, T o2)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals

Constructor Detail

ComparableComparator

public ComparableComparator()
Method Detail

compare

public int compare(T o1,
                   T o2)
Specified by:
compare in interface Comparator<T extends Comparable<T>>
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CompoundComparator

org.springframework.util.comparator
Class CompoundComparator<T>

java.lang.Object
    extended by  org.springframework.util.comparator.CompoundComparator<T>
All Implemented Interfaces:
Serializable, Comparator<T>
public class CompoundComparator<T>
extends Object
implements Comparator<T>, Serializable

A comparator that chains a sequence of one or more more Comparators.

A compound comparator calls each Comparator in sequence until a single Comparator returns a non-zero result, or the comparators are exhausted and zero is returned.

This facilitates in-memory sorting similar to multi-column sorting in SQL. The order of any single Comparator in the list can also be reversed.

Since:
1.2.2
Author:
Keith Donald, Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
CompoundComparator()
Construct a CompoundComparator with initially no Comparators.
CompoundComparator(Comparator[] comparators)
Construct a CompoundComparator from the Comparators in the provided array.
Method Summary
void | addComparator(Comparator<T> comparator) Add a Comparator to the end of the chain.
void | addComparator(Comparator<T> comparator, boolean ascending) Add a Comparator to the end of the chain using the provided sort order.
int | compare(T o1, T o2)
boolean | equals(Object obj)
int | getComparatorCount() Returns the number of aggregated comparators.
int | hashCode()
void | invertOrder() Invert the sort order of each sort definition contained by this compound comparator.
void | invertOrder(int index) Invert the sort order of the sort definition at the specified index.
void | setAscendingOrder(int index) Change the sort order at the given index to ascending.
void | setComparator(int index, Comparator<T> comparator) Replace the Comparator at the given index.
void | setComparator(int index, Comparator<T> comparator, boolean ascending) Replace the Comparator at the given index using the given sort order.
void | setDescendingOrder(int index) Change the sort order at the given index to descending sort.
String | toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

CompoundComparator

public CompoundComparator()
Construct a CompoundComparator with initially no Comparators. Clients must add at least one Comparator before calling the compare method or an IllegalStateException is thrown.

CompoundComparator

public CompoundComparator(Comparator[] comparators)
Construct a CompoundComparator from the Comparators in the provided array.

All Comparators will default to ascending sort order, unless they are InvertibleComparators.

Parameters:
comparators - the comparators to build into a compound comparator
See Also:
InvertibleComparator
Method Detail

addComparator

public void addComparator(Comparator<T> comparator)
Add a Comparator to the end of the chain.

The Comparator will default to ascending sort order, unless it is a InvertibleComparator.

Parameters:
comparator - the Comparator to add to the end of the chain
See Also:
InvertibleComparator

addComparator

public void addComparator(Comparator<T> comparator,
                          boolean ascending)
Add a Comparator to the end of the chain using the provided sort order.

Parameters:
comparator - the Comparator to add to the end of the chain
ascending - the sort order: ascending (true) or descending (false)

setComparator

public void setComparator(int index,
                          Comparator<T> comparator)
Replace the Comparator at the given index.

The Comparator will default to ascending sort order, unless it is a InvertibleComparator.

Parameters:
index - the index of the Comparator to replace
comparator - the Comparator to place at the given index
See Also:
InvertibleComparator

setComparator

public void setComparator(int index,
                          Comparator<T> comparator,
                          boolean ascending)
Replace the Comparator at the given index using the given sort order.

Parameters:
index - the index of the Comparator to replace
comparator - the Comparator to place at the given index
ascending - the sort order: ascending (true) or descending (false)

invertOrder

public void invertOrder()
Invert the sort order of each sort definition contained by this compound comparator.

invertOrder

public void invertOrder(int index)
Invert the sort order of the sort definition at the specified index.

Parameters:
index - the index of the comparator to invert

setAscendingOrder

public void setAscendingOrder(int index)
Change the sort order at the given index to ascending.

Parameters:
index - the index of the comparator to change

setDescendingOrder

public void setDescendingOrder(int index)
Change the sort order at the given index to descending sort.

Parameters:
index - the index of the comparator to change

getComparatorCount

public int getComparatorCount()
Returns the number of aggregated comparators.

compare

public int compare(T o1,
                   T o2)
Specified by:
compare in interface Comparator<T>

equals

public boolean equals(Object obj)
Specified by:
equals in interface Comparator<T>
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InvertibleComparator

org.springframework.util.comparator
Class InvertibleComparator<T>

java.lang.Object
    extended by  org.springframework.util.comparator.InvertibleComparator<T>
All Implemented Interfaces:
Serializable, Comparator<T>
public class InvertibleComparator<T>
extends Object
implements Comparator<T>, Serializable

A decorator for a comparator, with an "ascending" flag denoting whether comparison results should be treated in forward (standard ascending) order or flipped for reverse (descending) order.

Since:
1.2.2
Author:
Keith Donald, Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
InvertibleComparator(Comparator<T> comparator)
Create an InvertibleComparator that sorts ascending by default.
InvertibleComparator(Comparator<T> comparator, boolean ascending)
Create an InvertibleComparator that sorts based on the provided order.
Method Summary
int | compare(T o1, T o2)
boolean | equals(Object obj)
int | hashCode()
void | invertOrder() Invert the sort order: ascending -> descending or descending -> ascending.
boolean | isAscending() Return the sort order: ascending (true) or descending (false).
void | setAscending(boolean ascending) Specify the sort order: ascending (true) or descending (false).
String | toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

InvertibleComparator

public InvertibleComparator(Comparator<T> comparator)
Create an InvertibleComparator that sorts ascending by default. For the actual comparison, the specified Comparator will be used.

Parameters:
comparator - the comparator to decorate

InvertibleComparator

public InvertibleComparator(Comparator<T> comparator,
                            boolean ascending)
Create an InvertibleComparator that sorts based on the provided order. For the actual comparison, the specified Comparator will be used.

Parameters:
comparator - the comparator to decorate
ascending - the sort order: ascending (true) or descending (false)
Method Detail

setAscending

public void setAscending(boolean ascending)
Specify the sort order: ascending (true) or descending (false).

isAscending

public boolean isAscending()
Return the sort order: ascending (true) or descending (false).

invertOrder

public void invertOrder()
Invert the sort order: ascending -> descending or descending -> ascending.

compare

public int compare(T o1,
                   T o2)
Specified by:
compare in interface Comparator<T>

equals

public boolean equals(Object obj)
Specified by:
equals in interface Comparator<T>
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NullSafeComparator

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.util.comparator
Class NullSafeComparator<T>

java.lang.Object
    extended by  org.springframework.util.comparator.NullSafeComparator<T>
All Implemented Interfaces:
Comparator<T>
public class NullSafeComparator<T>
extends Object
implements Comparator<T>

A Comparator that will safely compare nulls to be lower or higher than other objects. Can decorate a given Comparator or work on Comparables.

Since:
1.2.2
Author:
Keith Donald, Juergen Hoeller
See Also:
Comparable

Field Summary
static NullSafeComparator | NULLS_HIGH A shared default instance of this comparator, treating nulls higher than non-null objects.
static NullSafeComparator | NULLS_LOW A shared default instance of this comparator, treating nulls lower than non-null objects.
Constructor Summary
NullSafeComparator(Comparator<T> comparator, boolean nullsLow)
Create a NullSafeComparator that sorts null based on the provided flag, decorating the given Comparator.
Method Summary
int | compare(T o1, T o2)
boolean | equals(Object obj)
int | hashCode()
String | toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail

NULLS_LOW

public static final NullSafeComparator NULLS_LOW
A shared default instance of this comparator, treating nulls lower than non-null objects.

NULLS_HIGH

public static final NullSafeComparator NULLS_HIGH
A shared default instance of this comparator, treating nulls higher than non-null objects.

Constructor Detail

NullSafeComparator

public NullSafeComparator(Comparator<T> comparator,
                          boolean nullsLow)
Create a NullSafeComparator that sorts null based on the provided flag, decorating the given Comparator.

When comparing two non-null objects, the specified Comparator will be used. The given underlying Comparator must be able to handle the elements that this Comparator will be applied to.

Parameters:
comparator - the comparator to use when comparing two non-null objects
nullsLow - whether to treat nulls lower or higher than non-null objects
Method Detail

compare

public int compare(T o1,
                   T o2)
Specified by:
compare in interface Comparator<T>

equals

public boolean equals(Object obj)
Specified by:
equals in interface Comparator<T>
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.util.xml

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.util.xml

Miscellaneous utility classes for XML parsing and transformation, such as error handlers that log warnings via Commons Logging.

See:
Description

Class Summary
DomUtils | Convenience methods for working with the DOM API, in particular for working with DOM Nodes and DOM Elements.
SimpleNamespaceContext | Simple javax.xml.namespace.NamespaceContext implementation.
SimpleSaxErrorHandler | Simple org.xml.sax.ErrorHandler implementation: logs warnings using the given Commons Logging logger instance, and rethrows errors to discontinue the XML transformation.
SimpleTransformErrorListener | Simple javax.xml.transform.ErrorListener implementation: logs warnings using the given Commons Logging logger instance, and rethrows errors to discontinue the XML transformation.
StaxUtils | Convenience methods for working with the StAX API.
TransformerUtils | Contains common behavior relating to Transformers, and the javax.xml.transform package in general.
XmlValidationModeDetector | Detects whether an XML stream is using DTD- or XSD-based validation.

Package org.springframework.util.xml Description

Miscellaneous utility classes for XML parsing and transformation, such as error handlers that log warnings via Commons Logging.


org.springframework.util.xml Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.util.xml

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.util.xml.DomUtils
    • org.springframework.util.xml.SimpleNamespaceContext (implements javax.xml.namespace.NamespaceContext)
    • org.springframework.util.xml.SimpleSaxErrorHandler (implements org.xml.sax.ErrorHandler)
    • org.springframework.util.xml.SimpleTransformErrorListener (implements javax.xml.transform.ErrorListener)
    • org.springframework.util.xml.StaxUtils
    • org.springframework.util.xml.TransformerUtils
    • org.springframework.util.xml.XmlValidationModeDetector


DomUtils

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.util.xml
Class DomUtils

java.lang.Object
    extended by  org.springframework.util.xml.DomUtils

public abstract class DomUtils
extends Object

Convenience methods for working with the DOM API, in particular for working with DOM Nodes and DOM Elements.

Since:
1.2
Author:
Juergen Hoeller, Rob Harrop, Costin Leau, Arjen Poutsma
See Also:
Node, Element

Constructor Summary
DomUtils()
Method Summary
static ContentHandler | createContentHandler(Node node) Returns a SAX ContentHandler that transforms callback calls to DOM Nodes.
static Element | getChildElementByTagName(Element ele, String childEleName) Utility method that returns the first child element identified by its name.
static List<Element> | getChildElementsByTagName(Element ele, String childEleName) Retrieve all child elements of the given DOM element that match the given element name.
static List<Element> | getChildElementsByTagName(Element ele, String[] childEleNames) Retrieve all child elements of the given DOM element that match any of the given element names.
static String | getChildElementValueByTagName(Element ele, String childEleName) Utility method that returns the first child element value identified by its name.
static String | getTextValue(Element valueEle) Extract the text value from the given DOM element, ignoring XML comments.
static boolean | nodeNameEquals(Node node, String desiredName) Namespace-aware equals comparison.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DomUtils

public DomUtils()
Method Detail

getChildElementsByTagName

public static List<Element> getChildElementsByTagName(Element ele,
                                                      String[] childEleNames)
Retrieve all child elements of the given DOM element that match any of the given element names. Only look at the direct child level of the given element; do not go into further depth (in contrast to the DOM API's getElementsByTagName method).

Parameters:
ele - the DOM element to analyze
childEleNames - the child element names to look for
Returns:
a List of child org.w3c.dom.Element instances
See Also:
Element, Element.getElementsByTagName(java.lang.String)

getChildElementsByTagName

public static List<Element> getChildElementsByTagName(Element ele,
                                                      String childEleName)
Retrieve all child elements of the given DOM element that match the given element name. Only look at the direct child level of the given element; do not go into further depth (in contrast to the DOM API's getElementsByTagName method).

Parameters:
ele - the DOM element to analyze
childEleName - the child element name to look for
Returns:
a List of child org.w3c.dom.Element instances
See Also:
Element, Element.getElementsByTagName(java.lang.String)

getChildElementByTagName

public static Element getChildElementByTagName(Element ele,
                                               String childEleName)
Utility method that returns the first child element identified by its name.

Parameters:
ele - the DOM element to analyze
childEleName - the child element name to look for
Returns:
the org.w3c.dom.Element instance, or null if none found

getChildElementValueByTagName

public static String getChildElementValueByTagName(Element ele,
                                                   String childEleName)
Utility method that returns the first child element value identified by its name.

Parameters:
ele - the DOM element to analyze
childEleName - the child element name to look for
Returns:
the extracted text value, or null if no child element found

getTextValue

public static String getTextValue(Element valueEle)
Extract the text value from the given DOM element, ignoring XML comments.

Appends all CharacterData nodes and EntityReference nodes into a single String value, excluding Comment nodes.

See Also:
CharacterData, EntityReference, Comment

nodeNameEquals

public static boolean nodeNameEquals(Node node,
                                     String desiredName)
Namespace-aware equals comparison. Returns true if either Node.getLocalName() or Node.getNodeName() equals desiredName, otherwise returns false.

createContentHandler

public static ContentHandler createContentHandler(Node node)
Returns a SAX ContentHandler that transforms callback calls to DOM Nodes.

Parameters:
node - the node to publish events to
Returns:
the content handler
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


SimpleNamespaceContext

org.springframework.util.xml
Class SimpleNamespaceContext

java.lang.Object
    extended by  org.springframework.util.xml.SimpleNamespaceContext
All Implemented Interfaces:
NamespaceContext
public class SimpleNamespaceContext
extends Object
implements NamespaceContext

Simple javax.xml.namespace.NamespaceContext implementation. Follows the standard NamespaceContext contract, and is loadable via a java.util.Map or java.util.Properties object

Since:
3.0
Author:
Arjen Poutsma

Constructor Summary
SimpleNamespaceContext()
Method Summary
void | bindDefaultNamespaceUri(String namespaceUri) Binds the given namespace as default namespace.
void | bindNamespaceUri(String prefix, String namespaceUri) Binds the given prefix to the given namespace.
void | clear() Removes all declared prefixes.
Iterator | getBoundPrefixes() Returns all declared prefixes.
String | getNamespaceURI(String prefix)
String | getPrefix(String namespaceUri)
Iterator | getPrefixes(String namespaceUri)
void | removeBinding(String prefix) Removes the given prefix from this context.
void | setBindings(Map<String,String> bindings) Sets the bindings for this namespace context.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleNamespaceContext

public SimpleNamespaceContext()
Method Detail

getNamespaceURI

public String getNamespaceURI(String prefix)
Specified by:
getNamespaceURI in interface NamespaceContext

getPrefix

public String getPrefix(String namespaceUri)
Specified by:
getPrefix in interface NamespaceContext

getPrefixes

public Iterator getPrefixes(String namespaceUri)
Specified by:
getPrefixes in interface NamespaceContext

setBindings

public void setBindings(Map<String,String> bindings)
Sets the bindings for this namespace context. The supplied map must consist of string key value pairs.

Parameters:
bindings - the bindings

bindDefaultNamespaceUri

public void bindDefaultNamespaceUri(String namespaceUri)
Binds the given namespace as default namespace.

Parameters:
namespaceUri - the namespace uri

bindNamespaceUri

public void bindNamespaceUri(String prefix,
                             String namespaceUri)
Binds the given prefix to the given namespace.

Parameters:
prefix - the namespace prefix
namespaceUri - the namespace uri

clear

public void clear()
Removes all declared prefixes.

getBoundPrefixes

public Iterator getBoundPrefixes()
Returns all declared prefixes.

Returns:
the declared prefixes

removeBinding

public void removeBinding(String prefix)
Removes the given prefix from this context.

Parameters:
prefix - the prefix to be removed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleSaxErrorHandler

org.springframework.util.xml
Class SimpleSaxErrorHandler

java.lang.Object
    extended by  org.springframework.util.xml.SimpleSaxErrorHandler
All Implemented Interfaces:
ErrorHandler
public class SimpleSaxErrorHandler
extends Object
implements ErrorHandler

Simple org.xml.sax.ErrorHandler implementation: logs warnings using the given Commons Logging logger instance, and rethrows errors to discontinue the XML transformation.

Since:
1.2
Author:
Juergen Hoeller

Constructor Summary
SimpleSaxErrorHandler(Log logger)
Create a new SimpleSaxErrorHandler for the given Commons Logging logger instance.
Method Summary
void | error(SAXParseException ex)
void | fatalError(SAXParseException ex)
void | warning(SAXParseException ex)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleSaxErrorHandler

public SimpleSaxErrorHandler(Log logger)
Create a new SimpleSaxErrorHandler for the given Commons Logging logger instance.

Method Detail

warning

public void warning(SAXParseException ex)
             throws SAXException
Specified by:
warning in interface ErrorHandler
Throws:
SAXException

error

public void error(SAXParseException ex)
           throws SAXException
Specified by:
error in interface ErrorHandler
Throws:
SAXException

fatalError

public void fatalError(SAXParseException ex)
                throws SAXException
Specified by:
fatalError in interface ErrorHandler
Throws:
SAXException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleTransformErrorListener

org.springframework.util.xml
Class SimpleTransformErrorListener

java.lang.Object
    extended by  org.springframework.util.xml.SimpleTransformErrorListener
All Implemented Interfaces:
ErrorListener
public class SimpleTransformErrorListener
extends Object
implements ErrorListener

Simple javax.xml.transform.ErrorListener implementation: logs warnings using the given Commons Logging logger instance, and rethrows errors to discontinue the XML transformation.

Since:
1.2
Author:
Juergen Hoeller

Constructor Summary
SimpleTransformErrorListener(Log logger)
Create a new SimpleTransformErrorListener for the given Commons Logging logger instance.
Method Summary
void | error(TransformerException ex)
void | fatalError(TransformerException ex)
void | warning(TransformerException ex)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleTransformErrorListener

public SimpleTransformErrorListener(Log logger)
Create a new SimpleTransformErrorListener for the given Commons Logging logger instance.

Method Detail

warning

public void warning(TransformerException ex)
             throws TransformerException
Specified by:
warning in interface ErrorListener
Throws:
TransformerException

error

public void error(TransformerException ex)
           throws TransformerException
Specified by:
error in interface ErrorListener
Throws:
TransformerException

fatalError

public void fatalError(TransformerException ex)
                throws TransformerException
Specified by:
fatalError in interface ErrorListener
Throws:
TransformerException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StaxUtils

org.springframework.util.xml
Class StaxUtils

java.lang.Object
    extended by  org.springframework.util.xml.StaxUtils

public abstract class StaxUtils
extends Object

Convenience methods for working with the StAX API.

In particular, methods for using StAX in combination with the TrAX API (javax.xml.transform), and converting StAX readers/writers into SAX readers/handlers and vice-versa.

Since:
3.0
Author:
Arjen Poutsma, Juergen Hoeller

Constructor Summary
StaxUtils()
Method Summary
static ContentHandler | createContentHandler(XMLEventWriter eventWriter) Create a SAX ContentHandler that writes events to the given StAX XMLEventWriter.
static ContentHandler | createContentHandler(XMLStreamWriter streamWriter) Create a SAX ContentHandler that writes to the given StAX XMLStreamWriter.
static XMLStreamReader | createEventStreamReader(XMLEventReader eventReader) Return a XMLStreamReader that reads from a XMLEventReader.
static Result | createStaxResult(XMLEventWriter eventWriter) Create a StAX Result for the given XMLEventWriter.
static Result | createStaxResult(XMLStreamWriter streamWriter) Create a StAX Result for the given XMLStreamWriter.
static Source | createStaxSource(XMLEventReader eventReader) Create a StAX Source for the given XMLEventReader.
static Source | createStaxSource(XMLStreamReader streamReader) Create a StAX Source for the given XMLStreamReader.
static XMLReader | createXMLReader(XMLEventReader eventReader) Create a SAX XMLReader that reads from the given StAX XMLEventReader.
static XMLReader | createXMLReader(XMLStreamReader streamReader) Create a SAX XMLReader that reads from the given StAX XMLStreamReader.
static XMLEventReader | getXMLEventReader(Source source) Return the XMLEventReader for the given StAX Source.
static XMLEventWriter | getXMLEventWriter(Result result) Return the XMLEventWriter for the given StAX Result.
static XMLStreamReader | getXMLStreamReader(Source source) Return the XMLStreamReader for the given StAX Source.
static XMLStreamWriter | getXMLStreamWriter(Result result) Return the XMLStreamWriter for the given StAX Result.
static boolean | isStaxResult(Result result) Indicate whether the given Result is a StAX Result.
static boolean | isStaxSource(Source source) Indicate whether the given Source is a StAX Source.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

StaxUtils

public StaxUtils()
Method Detail

createStaxSource

public static Source createStaxSource(XMLStreamReader streamReader)
Create a StAX Source for the given XMLStreamReader.

Parameters:
streamReader - the StAX stream reader
Returns:
a source wrapping streamReader

createStaxSource

public static Source createStaxSource(XMLEventReader eventReader)
                               throws XMLStreamException
Create a StAX Source for the given XMLEventReader.

Parameters:
eventReader - the StAX event reader
Returns:
a source wrapping streamReader
Throws:
XMLStreamException - in case of StAX errors

isStaxSource

public static boolean isStaxSource(Source source)
Indicate whether the given Source is a StAX Source.

Returns:
true if source is a Spring StaxSource or JAXP 1.4 StAXSource; false otherwise.

createStaxResult

public static Result createStaxResult(XMLStreamWriter streamWriter)
Create a StAX Result for the given XMLStreamWriter.

Parameters:
streamWriter - the StAX stream writer
Returns:
a result wrapping streamWriter

createStaxResult

public static Result createStaxResult(XMLEventWriter eventWriter)
                               throws XMLStreamException
Create a StAX Result for the given XMLEventWriter.

Parameters:
eventWriter - the StAX event writer
Returns:
a result wrapping streamReader
Throws:
XMLStreamException - in case of StAX errors

isStaxResult

public static boolean isStaxResult(Result result)
Indicate whether the given Result is a StAX Result.

Returns:
true if result is a Spring StaxResult or JAXP 1.4 StAXResult; false otherwise.

getXMLStreamReader

public static XMLStreamReader getXMLStreamReader(Source source)
Return the XMLStreamReader for the given StAX Source.

Parameters:
source - a Spring StaxSource or JAXP 1.4 StAXSource
Returns:
the XMLStreamReader
Throws:
IllegalArgumentException - if source is neither a Spring StaxSource nor JAXP 1.4 StAXSource

getXMLEventReader

public static XMLEventReader getXMLEventReader(Source source)
Return the XMLEventReader for the given StAX Source.

Parameters:
source - a Spring StaxSource or JAXP 1.4 StAXSource
Returns:
the XMLEventReader
Throws:
IllegalArgumentException - if source is neither a Spring StaxSource nor a JAXP 1.4 StAXSource

getXMLStreamWriter

public static XMLStreamWriter getXMLStreamWriter(Result result)
Return the XMLStreamWriter for the given StAX Result.

Parameters:
result - a Spring StaxResult or JAXP 1.4 StAXResult
Returns:
the XMLStreamReader
Throws:
IllegalArgumentException - if source is neither a Spring StaxResult nor a JAXP 1.4 StAXResult

getXMLEventWriter

public static XMLEventWriter getXMLEventWriter(Result result)
Return the XMLEventWriter for the given StAX Result.

Parameters:
result - a Spring StaxResult or JAXP 1.4 StAXResult
Returns:
the XMLStreamReader
Throws:
IllegalArgumentException - if source is neither a Spring StaxResult nor a JAXP 1.4 StAXResult

createContentHandler

public static ContentHandler createContentHandler(XMLStreamWriter streamWriter)
Create a SAX ContentHandler that writes to the given StAX XMLStreamWriter.

Parameters:
streamWriter - the StAX stream writer
Returns:
a content handler writing to the streamWriter

createContentHandler

public static ContentHandler createContentHandler(XMLEventWriter eventWriter)
Create a SAX ContentHandler that writes events to the given StAX XMLEventWriter.

Parameters:
eventWriter - the StAX event writer
Returns:
a content handler writing to the eventWriter

createXMLReader

public static XMLReader createXMLReader(XMLStreamReader streamReader)
Create a SAX XMLReader that reads from the given StAX XMLStreamReader.

Parameters:
streamReader - the StAX stream reader
Returns:
a XMLReader reading from the streamWriter

createXMLReader

public static XMLReader createXMLReader(XMLEventReader eventReader)
Create a SAX XMLReader that reads from the given StAX XMLEventReader.

Parameters:
eventReader - the StAX event reader
Returns:
a XMLReader reading from the eventWriter

createEventStreamReader

public static XMLStreamReader createEventStreamReader(XMLEventReader eventReader)
                                               throws XMLStreamException
Return a XMLStreamReader that reads from a XMLEventReader. Useful, because the StAX XMLInputFactory allows one to create a event reader from a stream reader, but not vice-versa.

Returns:
a stream reader that reads from an event reader
Throws:
XMLStreamException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransformerUtils

org.springframework.util.xml
Class TransformerUtils

java.lang.Object
    extended by  org.springframework.util.xml.TransformerUtils

public abstract class TransformerUtils
extends Object

Contains common behavior relating to Transformers, and the javax.xml.transform package in general.

Since:
2.5.5
Author:
Rick Evans, Juergen Hoeller

Field Summary
static int DEFAULT_INDENT_AMOUNT
The indent amount of characters if indenting is enabled.
Constructor Summary
TransformerUtils()
Method Summary
static void | disableIndenting(Transformer transformer) Disable indenting for the supplied Transformer.
static void | enableIndenting(Transformer transformer) Enable indenting for the supplied Transformer.
static void | enableIndenting(Transformer transformer, int indentAmount) Enable indenting for the supplied Transformer.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_INDENT_AMOUNT

public static final int DEFAULT_INDENT_AMOUNT
The indent amount of characters if indenting is enabled.

Defaults to "2".

See Also:
Constant Field Values
Constructor Detail

TransformerUtils

public TransformerUtils()
Method Detail

enableIndenting

public static void enableIndenting(Transformer transformer)
Enable indenting for the supplied Transformer.

If the underlying XSLT engine is Xalan, then the special output key indent-amount will be also be set to a value of DEFAULT_INDENT_AMOUNT characters.

Parameters:
transformer - the target transformer
See Also:
Transformer.setOutputProperty(String, String), OutputKeys.INDENT

enableIndenting

public static void enableIndenting(Transformer transformer,
                                   int indentAmount)
Enable indenting for the supplied Transformer.

If the underlying XSLT engine is Xalan, then the special output key indent-amount will be also be set to a value of DEFAULT_INDENT_AMOUNT characters.

Parameters:
transformer - the target transformer
indentAmount - the size of the indent (2 characters, 3 characters, etc.)
See Also:
Transformer.setOutputProperty(String, String), OutputKeys.INDENT

disableIndenting

public static void disableIndenting(Transformer transformer)
Disable indenting for the supplied Transformer.

Parameters:
transformer - the target transformer
See Also:
OutputKeys.INDENT
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XmlValidationModeDetector

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.util.xml
Class XmlValidationModeDetector

java.lang.Object
    extended by  org.springframework.util.xml.XmlValidationModeDetector

public class XmlValidationModeDetector
extends Object

Detects whether an XML stream is using DTD- or XSD-based validation.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller

Field Summary
static int | VALIDATION_AUTO Indicates that the validation mode should be auto-guessed, since we cannot find a clear indication (probably choked on some special characters, or the like).
static int | VALIDATION_DTD Indicates that DTD validation should be used (we found a "DOCTYPE" declaration).
static int | VALIDATION_NONE Indicates that the validation should be disabled.
static int | VALIDATION_XSD Indicates that XSD validation should be used (found no "DOCTYPE" declaration).
Constructor Summary
XmlValidationModeDetector()
Method Summary
 int detectValidationMode(InputStream inputStream)
Detect the validation mode for the XML document in the supplied InputStream.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

VALIDATION_NONE

public static final int VALIDATION_NONE
Indicates that the validation should be disabled.

See Also:
Constant Field Values

VALIDATION_AUTO

public static final int VALIDATION_AUTO
Indicates that the validation mode should be auto-guessed, since we cannot find a clear indication (probably choked on some special characters, or the like).

See Also:
Constant Field Values

VALIDATION_DTD

public static final int VALIDATION_DTD
Indicates that DTD validation should be used (we found a "DOCTYPE" declaration).

See Also:
Constant Field Values

VALIDATION_XSD

public static final int VALIDATION_XSD
Indicates that XSD validation should be used (found no "DOCTYPE" declaration).

See Also:
Constant Field Values
Constructor Detail

XmlValidationModeDetector

public XmlValidationModeDetector()
Method Detail

detectValidationMode

public int detectValidationMode(InputStream inputStream)
                         throws IOException
Detect the validation mode for the XML document in the supplied InputStream. Note that the supplied InputStream is closed by this method before returning.

Parameters:
inputStream - the InputStream to parse
Throws:
IOException - in case of I/O failure
See Also:
VALIDATION_DTD, VALIDATION_XSD
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.validation

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.validation

Provides data binding and validation functionality, for usage in business and/or UI layers.

See:
Description

Interface Summary
BindingErrorProcessor | Strategy for processing DataBinder's missing field errors, and for translating a PropertyAccessException to a FieldError.
BindingResult | General interface that represents binding results.
Errors | Stores and exposes information about data-binding and validation errors for a specific object.
MessageCodesResolver | Strategy interface for building message codes from validation error codes.
Validator | A validator for application-specific objects.

Class Summary
AbstractBindingResult | Abstract implementation of the BindingResult interface and its super-interface Errors.
AbstractErrors | Abstract implementation of the Errors interface.
AbstractPropertyBindingResult | Abstract base class for BindingResult implementations that work with Spring's PropertyAccessor mechanism.
BeanPropertyBindingResult | Default implementation of the Errors and BindingResult interfaces, for the registration and evaluation of binding errors on JavaBean objects.
BindingResultUtils | Convenience methods for looking up BindingResults in a model Map.
DataBinder | Binder that allows for setting property values onto a target object, including support for validation and binding result analysis.
DefaultBindingErrorProcessor | Default BindingErrorProcessor implementation.
DefaultMessageCodesResolver | Default implementation of the MessageCodesResolver interface.
DirectFieldBindingResult | Special implementation of the Errors and BindingResult interfaces, supporting registration and evaluation of binding errors on value objects.
FieldError | Encapsulates a field error, that is, a reason for rejecting a specific field value.
MapBindingResult | Map-based implementation of the BindingResult interface, supporting registration and evaluation of binding errors on Map attributes.
ObjectError | Encapsulates an object error, that is, a global reason for rejecting an object.
ValidationUtils | Utility class offering convenient methods for invoking a Validator and for rejecting empty fields.

Exception Summary
BindException Thrown when binding errors are considered fatal.

Package org.springframework.validation Description

Provides data binding and validation functionality, for usage in business and/or UI layers.


org.springframework.validation Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.validation

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.validation.AbstractErrors (implements org.springframework.validation.Errors, java.io.Serializable)
      • org.springframework.validation.AbstractBindingResult (implements org.springframework.validation.BindingResult, java.io.Serializable)
        • org.springframework.validation.AbstractPropertyBindingResult
          • org.springframework.validation.BeanPropertyBindingResult (implements java.io.Serializable)
          • org.springframework.validation.DirectFieldBindingResult
        • org.springframework.validation.MapBindingResult (implements java.io.Serializable)
    • org.springframework.validation.BindingResultUtils
    • org.springframework.validation.DataBinder (implements org.springframework.beans.PropertyEditorRegistry, org.springframework.beans.TypeConverter)
    • org.springframework.validation.DefaultBindingErrorProcessor (implements org.springframework.validation.BindingErrorProcessor)
    • org.springframework.validation.DefaultMessageCodesResolver (implements org.springframework.validation.MessageCodesResolver, java.io.Serializable)
    • org.springframework.context.support.DefaultMessageSourceResolvable (implements org.springframework.context.MessageSourceResolvable, java.io.Serializable)
      • org.springframework.validation.ObjectError
        • org.springframework.validation.FieldError
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • org.springframework.validation.BindException (implements org.springframework.validation.BindingResult)
    • org.springframework.validation.ValidationUtils

Interface Hierarchy

  • org.springframework.validation.BindingErrorProcessor
  • org.springframework.validation.Errors
    • org.springframework.validation.BindingResult
  • org.springframework.validation.MessageCodesResolver
  • org.springframework.validation.Validator


BindingErrorProcessor

org.springframework.validation
Interface BindingErrorProcessor

All Known Implementing Classes:
DefaultBindingErrorProcessor
public interface BindingErrorProcessor

Strategy for processing DataBinder's missing field errors, and for translating a PropertyAccessException to a FieldError.

The error processor is pluggable so you can treat errors differently if you want to. A default implementation is provided for typical needs.

Note: As of Spring 2.0, this interface operates on a given BindingResult, to be compatible with any binding strategy (bean property, direct field access, etc). It can still receive a BindException as argument (since a BindException implements the BindingResult interface as well) but no longer operates on it directly.

Since:
1.2
Author:
Alef Arendsen, Juergen Hoeller
See Also:
DataBinder.setBindingErrorProcessor(org.springframework.validation.BindingErrorProcessor), DefaultBindingErrorProcessor, BindingResult, BindException

Method Summary
void | processMissingFieldError(String missingField, BindingResult bindingResult) Apply the missing field error to the given BindException.
void | processPropertyAccessException(PropertyAccessException ex, BindingResult bindingResult) Translate the given PropertyAccessException to an appropriate error registered on the given Errors instance.

Method Detail

processMissingFieldError

void processMissingFieldError(String missingField,
                              BindingResult bindingResult)
Apply the missing field error to the given BindException.

Usually, a field error is created for a missing required field.

Parameters:
missingField - the field that was missing during binding
bindingResult - the errors object to add the error(s) to. You can add more than just one error or maybe even ignore it. The BindingResult object features convenience utils such as a resolveMessageCodes method to resolve an error code.
See Also:
AbstractBindingResult.addError(org.springframework.validation.ObjectError), AbstractBindingResult.resolveMessageCodes(java.lang.String)

processPropertyAccessException

void processPropertyAccessException(PropertyAccessException ex,
                                    BindingResult bindingResult)
Translate the given PropertyAccessException to an appropriate error registered on the given Errors instance.

Note that two error types are available: FieldError and ObjectError. Usually, field errors are created, but in certain situations one might want to create a global ObjectError instead.

Parameters:
ex - the PropertyAccessException to translate
bindingResult - the errors object to add the error(s) to. You can add more than just one error or maybe even ignore it. The BindingResult object features convenience utils such as a resolveMessageCodes method to resolve an error code.
See Also:
Errors, FieldError, ObjectError, MessageCodesResolver, AbstractBindingResult.addError(org.springframework.validation.ObjectError), AbstractBindingResult.resolveMessageCodes(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BindingResult

org.springframework.validation
Interface BindingResult

All Superinterfaces:
Errors
All Known Implementing Classes:
AbstractBindingResult, AbstractPropertyBindingResult, BeanPropertyBindingResult, BindException, DirectFieldBindingResult, MapBindingResult
public interface BindingResult
extends Errors

General interface that represents binding results. Extends the interface for error registration capabilities, allowing for a Validator to be applied, and adds binding-specific analysis and model building.

Serves as result holder for a DataBinder, obtained via the DataBinder.getBindingResult() method. BindingResult implementations can also be used directly, for example to invoke a Validator on it (e.g. as part of a unit test).

Since:
2.0
Author:
Juergen Hoeller
See Also:
DataBinder, Errors, Validator, BeanPropertyBindingResult, DirectFieldBindingResult, MapBindingResult

Field Summary
static String MODEL_KEY_PREFIX
Prefix for the name of the BindingResult instance in a model, followed by the object name.
Fields inherited from interface org.springframework.validation.Errors
NESTED_PATH_SEPARATOR
Method Summary
void | addError(ObjectError error) Add a custom ObjectError or FieldError to the errors list.
PropertyEditor | findEditor(String field, Class valueType) Find a custom property editor for the given type and property.
Map<String,Object> | getModel() Return a model Map for the obtained state, exposing a BindingResult instance as 'MODEL_KEY_PREFIX + objectName' and the object itself as 'objectName'.
PropertyEditorRegistry | getPropertyEditorRegistry() Return the underlying PropertyEditorRegistry.
Object | getRawFieldValue(String field) Extract the raw field value for the given field.
String[] | getSuppressedFields() Return the list of fields that were suppressed during the bind process.
Object | getTarget() Return the wrapped target object, which may be a bean, an object with public fields, a Map - depending on the concrete binding strategy.
void | recordSuppressedField(String field) Mark the specified disallowed field as suppressed.
String[] | resolveMessageCodes(String errorCode, String field) Resolve the given error code into message codes for the given field.
Methods inherited from interface org.springframework.validation.Errors
addAllErrors, getAllErrors, getErrorCount, getFieldError, getFieldError, getFieldErrorCount, getFieldErrorCount, getFieldErrors, getFieldErrors, getFieldType, getFieldValue, getGlobalError, getGlobalErrorCount, getGlobalErrors, getNestedPath, getObjectName, hasErrors, hasFieldErrors, hasFieldErrors, hasGlobalErrors, popNestedPath, pushNestedPath, reject, reject, reject, rejectValue, rejectValue, rejectValue, setNestedPath

Field Detail

MODEL_KEY_PREFIX

static final String MODEL_KEY_PREFIX
Prefix for the name of the BindingResult instance in a model, followed by the object name.

Method Detail

getTarget

Object getTarget()
Return the wrapped target object, which may be a bean, an object with public fields, a Map - depending on the concrete binding strategy.

getModel

Map<String,Object> getModel()
Return a model Map for the obtained state, exposing a BindingResult instance as 'MODEL_KEY_PREFIX + objectName' and the object itself as 'objectName'.

Note that the Map is constructed every time you're calling this method. Adding things to the map and then re-calling this method will not work.

The attributes in the model Map returned by this method are usually included in the ModelAndView for a form view that uses Spring's bind tag in a JSP, which needs access to the BindingResult instance. Spring's pre-built form controllers will do this for you when rendering a form view. When building the ModelAndView instance yourself, you need to include the attributes from the model Map returned by this method.

See Also:
Errors.getObjectName(), MODEL_KEY_PREFIX, ModelAndView, BindTag, SimpleFormController

getRawFieldValue

Object getRawFieldValue(String field)
Extract the raw field value for the given field. Typically used for comparison purposes.

Parameters:
field - the field to check
Returns:
the current value of the field in its raw form, or null if not known

findEditor

PropertyEditor findEditor(String field,
                          Class valueType)
Find a custom property editor for the given type and property.

Parameters:
field - the path of the property (name or nested path), or null if looking for an editor for all properties of the given type
valueType - the type of the property (can be null if a property is given but should be specified in any case for consistency checking)
Returns:
the registered editor, or null if none

getPropertyEditorRegistry

PropertyEditorRegistry getPropertyEditorRegistry()
Return the underlying PropertyEditorRegistry.

Returns:
the PropertyEditorRegistry, or null if none available for this BindingResult

addError

void addError(ObjectError error)
Add a custom ObjectError or FieldError to the errors list.

Intended to be used by cooperating strategies such as BindingErrorProcessor.

See Also:
ObjectError, FieldError, BindingErrorProcessor

resolveMessageCodes

String[] resolveMessageCodes(String errorCode,
                             String field)
Resolve the given error code into message codes for the given field.

Calls the configured MessageCodesResolver with appropriate parameters.

Parameters:
errorCode - the error code to resolve into message codes
field - the field to resolve message codes for
Returns:
the resolved message codes

recordSuppressedField

void recordSuppressedField(String field)
Mark the specified disallowed field as suppressed.

The data binder invokes this for each field value that was detected to target a disallowed field.

See Also:
DataBinder.setAllowedFields(java.lang.String...)

getSuppressedFields

String[] getSuppressedFields()
Return the list of fields that were suppressed during the bind process.

Can be used to determine whether any field values were targeting disallowed fields.

See Also:
DataBinder.setAllowedFields(java.lang.String...)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Errors

org.springframework.validation
Interface Errors

All Known Subinterfaces:
BindingResult
All Known Implementing Classes:
AbstractBindingResult, AbstractErrors, AbstractPropertyBindingResult, BeanPropertyBindingResult, BindException, DirectFieldBindingResult, EscapedErrors, MapBindingResult
public interface Errors

Stores and exposes information about data-binding and validation errors for a specific object.

Field names can be properties of the target object (e.g. "name" when binding to a customer object), or nested fields in case of subobjects (e.g. "address.street"). Supports subtree navigation via setNestedPath(String): for example, an AddressValidator validates "address", not being aware that this is a subobject of customer.

Note: Errors objects are single-threaded.

Author:
Rod Johnson, Juergen Hoeller
See Also:
setNestedPath(java.lang.String), BindException, DataBinder, ValidationUtils

Field Summary
static String NESTED_PATH_SEPARATOR
The separator between path elements in a nested path, for example in "customer.name" or "customer.address.street".
Method Summary
void | addAllErrors(Errors errors) Add all errors from the given Errors instance to this Errors instance.
List<ObjectError> | getAllErrors() Get all errors, both global and field ones.
int | getErrorCount() Return the total number of errors.
FieldError | getFieldError() Get the first error associated with a field, if any.
FieldError | getFieldError(String field) Get the first error associated with the given field, if any.
int | getFieldErrorCount() Return the number of errors associated with a field.
int | getFieldErrorCount(String field) Return the number of errors associated with the given field.
List<FieldError> | getFieldErrors() Get all errors associated with a field.
List<FieldError> | getFieldErrors(String field) Get all errors associated with the given field.
Class | getFieldType(String field) Return the type of a given field.
Object | getFieldValue(String field) Return the current value of the given field, either the current bean property value or a rejected update from the last binding.
ObjectError | getGlobalError() Get the first global error, if any.
int | getGlobalErrorCount() Return the number of global errors.
List<ObjectError> | getGlobalErrors() Get all global errors.
String | getNestedPath() Return the current nested path of this Errors object.
String | getObjectName() Return the name of the bound root object.
boolean | hasErrors() Return if there were any errors.
boolean | hasFieldErrors() Are there any field errors?
boolean | hasFieldErrors(String field) Are there any errors associated with the given field?
boolean | hasGlobalErrors() Are there any global errors?
void | popNestedPath() Pop the former nested path from the nested path stack.
void | pushNestedPath(String subPath) Push the given sub path onto the nested path stack.
void | reject(String errorCode) Register a global error for the entire target object, using the given error description.
void | reject(String errorCode, Object[] errorArgs, String defaultMessage) Register a global error for the entire target object, using the given error description.
void | reject(String errorCode, String defaultMessage) Register a global error for the entire target object, using the given error description.
void | rejectValue(String field, String errorCode) Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description.
void | rejectValue(String field, String errorCode, Object[] errorArgs, String defaultMessage) Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description.
void | rejectValue(String field, String errorCode, String defaultMessage) Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description.
void | setNestedPath(String nestedPath) Allow context to be changed so that standard validators can validate subtrees.

Field Detail

NESTED_PATH_SEPARATOR

static final String NESTED_PATH_SEPARATOR
The separator between path elements in a nested path, for example in "customer.name" or "customer.address.street".

"." = same as the nested property separator in the beans package.

See Also:
Constant Field Values
Method Detail

getObjectName

String getObjectName()
Return the name of the bound root object.

setNestedPath

void setNestedPath(String nestedPath)
Allow context to be changed so that standard validators can validate subtrees. Reject calls prepend the given path to the field names.

For example, an address validator could validate the subobject "address" of a customer object.

Parameters:
nestedPath - nested path within this object, e.g. "address" (defaults to "", null is also acceptable). Can end with a dot: both "address" and "address." are valid.

getNestedPath

String getNestedPath()
Return the current nested path of this Errors object.

Returns a nested path with a dot, i.e. "address.", for easy building of concatenated paths. Default is an empty String.

pushNestedPath

void pushNestedPath(String subPath)
Push the given sub path onto the nested path stack.

A popNestedPath() call will reset the original nested path before the corresponding pushNestedPath(String) call.

Using the nested path stack allows to set temporary nested paths for subobjects without having to worry about a temporary path holder.

For example: current path "spouse.", pushNestedPath("child") -> result path "spouse.child."; popNestedPath() -> "spouse." again.

Parameters:
subPath - the sub path to push onto the nested path stack
See Also:
popNestedPath()

popNestedPath

void popNestedPath()
                   throws IllegalStateException
Pop the former nested path from the nested path stack.

Throws:
IllegalStateException - if there is no former nested path on the stack
See Also:
pushNestedPath(java.lang.String)

reject

void reject(String errorCode)
Register a global error for the entire target object, using the given error description.

Parameters:
errorCode - error code, interpretable as a message key

reject

void reject(String errorCode,
            String defaultMessage)
Register a global error for the entire target object, using the given error description.

Parameters:
errorCode - error code, interpretable as a message key
defaultMessage - fallback default message

reject

void reject(String errorCode,
            Object[] errorArgs,
            String defaultMessage)
Register a global error for the entire target object, using the given error description.

Parameters:
errorCode - error code, interpretable as a message key
errorArgs - error arguments, for argument binding via MessageFormat (can be null)
defaultMessage - fallback default message

rejectValue

void rejectValue(String field,
                 String errorCode)
Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description.

The field name may be null or empty String to indicate the current object itself rather than a field of it. This may result in a corresponding field error within the nested object graph or a global error if the current object is the top object.

Parameters:
field - the field name (may be null or empty String)
errorCode - error code, interpretable as a message key
See Also:
getNestedPath()

rejectValue

void rejectValue(String field,
                 String errorCode,
                 String defaultMessage)
Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description.

The field name may be null or empty String to indicate the current object itself rather than a field of it. This may result in a corresponding field error within the nested object graph or a global error if the current object is the top object.

Parameters:
field - the field name (may be null or empty String)
errorCode - error code, interpretable as a message key
defaultMessage - fallback default message
See Also:
getNestedPath()

rejectValue

void rejectValue(String field,
                 String errorCode,
                 Object[] errorArgs,
                 String defaultMessage)
Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description.

The field name may be null or empty String to indicate the current object itself rather than a field of it. This may result in a corresponding field error within the nested object graph or a global error if the current object is the top object.

Parameters:
field - the field name (may be null or empty String)
errorCode - error code, interpretable as a message key
errorArgs - error arguments, for argument binding via MessageFormat (can be null)
defaultMessage - fallback default message
See Also:
getNestedPath()

addAllErrors

void addAllErrors(Errors errors)
Add all errors from the given Errors instance to this Errors instance.

This is a onvenience method to avoid repeated reject(..) calls for merging an Errors instance into another Errors instance.

Note that the passed-in Errors instance is supposed to refer to the same target object, or at least contain compatible errors that apply to the target object of this Errors instance.

Parameters:
errors - the Errors instance to merge in

hasErrors

boolean hasErrors()
Return if there were any errors.

getErrorCount

int getErrorCount()
Return the total number of errors.

getAllErrors

List<ObjectError> getAllErrors()
Get all errors, both global and field ones.

Returns:
List of ObjectError instances

hasGlobalErrors

boolean hasGlobalErrors()
Are there any global errors?

Returns:
true if there are any global errors
See Also:
hasFieldErrors()

getGlobalErrorCount

int getGlobalErrorCount()
Return the number of global errors.

Returns:
the number of global errors
See Also:
getFieldErrorCount()

getGlobalErrors

List<ObjectError> getGlobalErrors()
Get all global errors.

Returns:
List of ObjectError instances

getGlobalError

ObjectError getGlobalError()
Get the first global error, if any.

Returns:
the global error, or null

hasFieldErrors

boolean hasFieldErrors()
Are there any field errors?

Returns:
true if there are any errors associated with a field
See Also:
hasGlobalErrors()

getFieldErrorCount

int getFieldErrorCount()
Return the number of errors associated with a field.

Returns:
the number of errors associated with a field
See Also:
getGlobalErrorCount()

getFieldErrors

List<FieldError> getFieldErrors()
Get all errors associated with a field.

Returns:
a List of FieldError instances

getFieldError

FieldError getFieldError()
Get the first error associated with a field, if any.

Returns:
the field-specific error, or null

hasFieldErrors

boolean hasFieldErrors(String field)
Are there any errors associated with the given field?

Parameters:
field - the field name
Returns:
true if there were any errors associated with the given field

getFieldErrorCount

int getFieldErrorCount(String field)
Return the number of errors associated with the given field.

Parameters:
field - the field name
Returns:
the number of errors associated with the given field

getFieldErrors

List<FieldError> getFieldErrors(String field)
Get all errors associated with the given field.

Implementations should support not only full field names like "name" but also pattern matches like "na*" or "address.*".

Parameters:
field - the field name
Returns:
a List of FieldError instances

getFieldError

FieldError getFieldError(String field)
Get the first error associated with the given field, if any.

Parameters:
field - the field name
Returns:
the field-specific error, or null

getFieldValue

Object getFieldValue(String field)
Return the current value of the given field, either the current bean property value or a rejected update from the last binding.

Allows for convenient access to user-specified field values, even if there were type mismatches.

Parameters:
field - the field name
Returns:
the current value of the given field

getFieldType

Class getFieldType(String field)
Return the type of a given field.

Implementations should be able to determine the type even when the field value is null, for example from some associated descriptor.

Parameters:
field - the field name
Returns:
the type of the field, or null if not determinable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageCodesResolver

org.springframework.validation
Interface MessageCodesResolver

All Known Implementing Classes:
DefaultMessageCodesResolver
public interface MessageCodesResolver

Strategy interface for building message codes from validation error codes. Used by DataBinder to build the codes list for ObjectErrors and FieldErrors.

The resulting message codes correspond to the codes of a MessageSourceResolvable (as implemented by ObjectError and FieldError).

Since:
1.0.1
Author:
Juergen Hoeller
See Also:
DataBinder.setMessageCodesResolver(org.springframework.validation.MessageCodesResolver), ObjectError, FieldError, MessageSourceResolvable.getCodes()

Method Summary
String[] | resolveMessageCodes(String errorCode, String objectName) Build message codes for the given error code and object name.
String[] | resolveMessageCodes(String errorCode, String objectName, String field, Class fieldType) Build message codes for the given error code and field specification.

Method Detail

resolveMessageCodes

String[] resolveMessageCodes(String errorCode,
                             String objectName)
Build message codes for the given error code and object name. Used for building the codes list of an ObjectError.

Parameters:
errorCode - the error code used for rejecting the object
objectName - the name of the object
Returns:
the message codes to use

resolveMessageCodes

String[] resolveMessageCodes(String errorCode,
                             String objectName,
                             String field,
                             Class fieldType)
Build message codes for the given error code and field specification. Used for building the codes list of an FieldError.

Parameters:
errorCode - the error code used for rejecting the value
objectName - the name of the object
field - the field name
fieldType - the field type (may be null if not determinable)
Returns:
the message codes to use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Validator

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.validation
Interface Validator

public interface Validator

A validator for application-specific objects.

This interface is totally divorced from any infrastructure or context; that is to say it is not coupled to validating only objects in the web tier, the data-access tier, or the whatever-tier. As such it is amenable to being used in any layer of an application, and supports the encapsulation of validation logic as a first-class citizen in its own right.

Find below a simple but complete Validator implementation, which validates that the various String properties of a UserLogin instance are not empty (that is they are not null and do not consist wholly of whitespace), and that any password that is present is at least 'MINIMUM_PASSWORD_LENGTH' characters in length.

 public class UserLoginValidator implements Validator {

    private static final int MINIMUM_PASSWORD_LENGTH = 6;

    public boolean supports(Class clazz) {
       return UserLogin.class.isAssignableFrom(clazz);
    }

    public void validate(Object target, Errors errors) {
       ValidationUtils.rejectIfEmptyOrWhitespace(errors, "userName", "field.required");
       ValidationUtils.rejectIfEmptyOrWhitespace(errors, "password", "field.required");
       UserLogin login = (UserLogin) target;
       if (login.getPassword() != null
             && login.getPassword().trim().length() < MINIMUM_PASSWORD_LENGTH) {
          errors.rejectValue("password", "field.min.length",
                new Object[]{Integer.valueOf(MINIMUM_PASSWORD_LENGTH)},
                "The password must be at least [" + MINIMUM_PASSWORD_LENGTH + "] characters in length.");
       }
    }
 }

See also the Spring reference manual for a fuller discussion of the Validator interface and it's role in an enterprise application.

Author:
Rod Johnson
See Also:
Errors, ValidationUtils

Method Summary
boolean | supports(Class<?> clazz) Can this Validator validate instances of the supplied clazz?
void | validate(Object target, Errors errors) Validate the supplied target object, which must be of a Class for which the supports(Class) method typically has (or would) return true.

Method Detail

supports

boolean supports(Class<?> clazz)
Can this Validator validate instances of the supplied clazz?

This method is typically implemented like so:

return Foo.class.isAssignableFrom(clazz);
(Where Foo is the class (or superclass) of the actual object instance that is to be validated.)

Parameters:
clazz - the Class that this Validator is being asked if it can validate
Returns:
true if this Validator can indeed validate instances of the supplied clazz

validate

void validate(Object target,
              Errors errors)
Validate the supplied target object, which must be of a Class for which the supports(Class) method typically has (or would) return true.

The supplied errors instance can be used to report any resulting validation errors.

Parameters:
target - the object that is to be validated (can be null)
errors - contextual state about the validation process (never null)
See Also:
ValidationUtils
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractBindingResult

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.validation
Class AbstractBindingResult

java.lang.Object
    extended by  org.springframework.validation.AbstractErrors
        extended by  org.springframework.validation.AbstractBindingResult
All Implemented Interfaces:
Serializable, BindingResult, Errors
Direct Known Subclasses:
AbstractPropertyBindingResult, MapBindingResult
public abstract class AbstractBindingResult
extends AbstractErrors
implements BindingResult, Serializable

Abstract implementation of the BindingResult interface and its super-interface Errors. Encapsulates common management of ObjectErrors and FieldErrors.

Since:
2.0
Author:
Juergen Hoeller, Rob Harrop
See Also:
Errors, Serialized Form

Field Summary
Fields inherited from interface org.springframework.validation.BindingResult
MODEL_KEY_PREFIX
Fields inherited from interface org.springframework.validation.Errors
NESTED_PATH_SEPARATOR
Constructor Summary
protected AbstractBindingResult(String objectName)
Create a new AbstractBindingResult instance.
Method Summary
void | addAllErrors(Errors errors) Add all errors from the given Errors instance to this Errors instance.
void | addError(ObjectError error) Add a custom ObjectError or FieldError to the errors list.
boolean | equals(Object other)
PropertyEditor | findEditor(String field, Class valueType) This implementation delegates to the PropertyEditorRegistry's editor lookup facility, if available.
protected Object | formatFieldValue(String field, Object value) Format the given value for the specified field.
protected abstract Object | getActualFieldValue(String field) Extract the actual field value for the given field.
List<ObjectError> | getAllErrors() Get all errors, both global and field ones.
int | getErrorCount() Return the total number of errors.
FieldError | getFieldError() Get the first error associated with a field, if any.
FieldError | getFieldError(String field) Get the first error associated with the given field, if any.
List<FieldError> | getFieldErrors() Get all errors associated with a field.
List<FieldError> | getFieldErrors(String field) Get all errors associated with the given field.
Class | getFieldType(String field) This default implementation determines the type based on the actual field value, if any.
Object | getFieldValue(String field) Return the current value of the given field, either the current bean property value or a rejected update from the last binding.
ObjectError | getGlobalError() Get the first global error, if any.
List<ObjectError> | getGlobalErrors() Get all global errors.
MessageCodesResolver | getMessageCodesResolver() Return the strategy to use for resolving errors into message codes.
Map<String,Object> | getModel() Return a model Map for the obtained state, exposing an Errors instance as 'MODEL_KEY_PREFIX + objectName' and the object itself.
String | getObjectName() Return the name of the bound root object.
PropertyEditorRegistry | getPropertyEditorRegistry() This implementation returns null.
Object | getRawFieldValue(String field) Extract the raw field value for the given field.
String[] | getSuppressedFields() Return the list of fields that were suppressed during the bind process.
abstract Object | getTarget() Return the wrapped target object.
boolean | hasErrors() Return if there were any errors.
int | hashCode()
void | recordSuppressedField(String field) Mark the specified disallowed field as suppressed.
void | reject(String errorCode, Object[] errorArgs, String defaultMessage) Register a global error for the entire target object, using the given error description.
void | rejectValue(String field, String errorCode, Object[] errorArgs, String defaultMessage) Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description.
String[] | resolveMessageCodes(String errorCode) Resolve the given error code into message codes.
String[] | resolveMessageCodes(String errorCode, String field) Resolve the given error code into message codes for the given field.
void | setMessageCodesResolver(MessageCodesResolver messageCodesResolver) Set the strategy to use for resolving errors into message codes.
Methods inherited from class org.springframework.validation.AbstractErrors
canonicalFieldName, doSetNestedPath, fixedField, getFieldErrorCount, getFieldErrorCount, getGlobalErrorCount, getNestedPath, hasFieldErrors, hasFieldErrors, hasGlobalErrors, isMatchingFieldError, popNestedPath, pushNestedPath, reject, reject, rejectValue, rejectValue, setNestedPath, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.validation.Errors
getFieldErrorCount, getFieldErrorCount, getGlobalErrorCount, getNestedPath, hasFieldErrors, hasFieldErrors, hasGlobalErrors, popNestedPath, pushNestedPath, reject, reject, rejectValue, rejectValue, setNestedPath

Constructor Detail

AbstractBindingResult

protected AbstractBindingResult(String objectName)
Create a new AbstractBindingResult instance.

Parameters:
objectName - the name of the target object
See Also:
DefaultMessageCodesResolver
Method Detail

setMessageCodesResolver

public void setMessageCodesResolver(MessageCodesResolver messageCodesResolver)
Set the strategy to use for resolving errors into message codes. Default is DefaultMessageCodesResolver.

See Also:
DefaultMessageCodesResolver

getMessageCodesResolver

public MessageCodesResolver getMessageCodesResolver()
Return the strategy to use for resolving errors into message codes.

getObjectName

public String getObjectName()
Description copied from interface: Errors
Return the name of the bound root object.

Specified by:
getObjectName in interface Errors

reject

public void reject(String errorCode,
                   Object[] errorArgs,
                   String defaultMessage)
Description copied from interface: Errors
Register a global error for the entire target object, using the given error description.

Specified by:
reject in interface Errors
Parameters:
errorCode - error code, interpretable as a message key
errorArgs - error arguments, for argument binding via MessageFormat (can be null)
defaultMessage - fallback default message

rejectValue

public void rejectValue(String field,
                        String errorCode,
                        Object[] errorArgs,
                        String defaultMessage)
Description copied from interface: Errors
Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description.

The field name may be null or empty String to indicate the current object itself rather than a field of it. This may result in a corresponding field error within the nested object graph or a global error if the current object is the top object.

Specified by:
rejectValue in interface Errors
Parameters:
field - the field name (may be null or empty String)
errorCode - error code, interpretable as a message key
errorArgs - error arguments, for argument binding via MessageFormat (can be null)
defaultMessage - fallback default message
See Also:
Errors.getNestedPath()

addError

public void addError(ObjectError error)
Description copied from interface: BindingResult
Add a custom ObjectError or FieldError to the errors list.

Intended to be used by cooperating strategies such as BindingErrorProcessor.

Specified by:
addError in interface BindingResult
See Also:
ObjectError, FieldError, BindingErrorProcessor

addAllErrors

public void addAllErrors(Errors errors)
Description copied from interface: Errors
Add all errors from the given Errors instance to this Errors instance.

This is a onvenience method to avoid repeated reject(..) calls for merging an Errors instance into another Errors instance.

Note that the passed-in Errors instance is supposed to refer to the same target object, or at least contain compatible errors that apply to the target object of this Errors instance.

Specified by:
addAllErrors in interface Errors
Parameters:
errors - the Errors instance to merge in

resolveMessageCodes

public String[] resolveMessageCodes(String errorCode)
Resolve the given error code into message codes. Calls the MessageCodesResolver with appropriate parameters.

Parameters:
errorCode - the error code to resolve into message codes
Returns:
the resolved message codes
See Also:
setMessageCodesResolver(org.springframework.validation.MessageCodesResolver)

resolveMessageCodes

public String[] resolveMessageCodes(String errorCode,
                                    String field)
Description copied from interface: BindingResult
Resolve the given error code into message codes for the given field.

Calls the configured MessageCodesResolver with appropriate parameters.

Specified by:
resolveMessageCodes in interface BindingResult
Parameters:
errorCode - the error code to resolve into message codes
field - the field to resolve message codes for
Returns:
the resolved message codes

hasErrors

public boolean hasErrors()
Description copied from interface: Errors
Return if there were any errors.

Specified by:
hasErrors in interface Errors
Overrides:
hasErrors in class AbstractErrors

getErrorCount

public int getErrorCount()
Description copied from interface: Errors
Return the total number of errors.

Specified by:
getErrorCount in interface Errors
Overrides:
getErrorCount in class AbstractErrors

getAllErrors

public List<ObjectError> getAllErrors()
Description copied from interface: Errors
Get all errors, both global and field ones.

Specified by:
getAllErrors in interface Errors
Overrides:
getAllErrors in class AbstractErrors
Returns:
List of ObjectError instances

getGlobalErrors

public List<ObjectError> getGlobalErrors()
Description copied from interface: Errors
Get all global errors.

Specified by:
getGlobalErrors in interface Errors
Returns:
List of ObjectError instances

getGlobalError

public ObjectError getGlobalError()
Description copied from interface: Errors
Get the first global error, if any.

Specified by:
getGlobalError in interface Errors
Overrides:
getGlobalError in class AbstractErrors
Returns:
the global error, or null

getFieldErrors

public List<FieldError> getFieldErrors()
Description copied from interface: Errors
Get all errors associated with a field.

Specified by:
getFieldErrors in interface Errors
Returns:
a List of FieldError instances

getFieldError

public FieldError getFieldError()
Description copied from interface: Errors
Get the first error associated with a field, if any.

Specified by:
getFieldError in interface Errors
Overrides:
getFieldError in class AbstractErrors
Returns:
the field-specific error, or null

getFieldErrors

public List<FieldError> getFieldErrors(String field)
Description copied from interface: Errors
Get all errors associated with the given field.

Implementations should support not only full field names like "name" but also pattern matches like "na*" or "address.*".

Specified by:
getFieldErrors in interface Errors
Overrides:
getFieldErrors in class AbstractErrors
Parameters:
field - the field name
Returns:
a List of FieldError instances

getFieldError

public FieldError getFieldError(String field)
Description copied from interface: Errors
Get the first error associated with the given field, if any.

Specified by:
getFieldError in interface Errors
Overrides:
getFieldError in class AbstractErrors
Parameters:
field - the field name
Returns:
the field-specific error, or null

getFieldValue

public Object getFieldValue(String field)
Description copied from interface: Errors
Return the current value of the given field, either the current bean property value or a rejected update from the last binding.

Allows for convenient access to user-specified field values, even if there were type mismatches.

Specified by:
getFieldValue in interface Errors
Parameters:
field - the field name
Returns:
the current value of the given field

getFieldType

public Class getFieldType(String field)
This default implementation determines the type based on the actual field value, if any. Subclasses should override this to determine the type from a descriptor, even for null values.

Specified by:
getFieldType in interface Errors
Overrides:
getFieldType in class AbstractErrors
Parameters:
field - the field name
Returns:
the type of the field, or null if not determinable
See Also:
getActualFieldValue(java.lang.String)

getModel

public Map<String,Object> getModel()
Return a model Map for the obtained state, exposing an Errors instance as 'MODEL_KEY_PREFIX + objectName' and the object itself.

Note that the Map is constructed every time you're calling this method. Adding things to the map and then re-calling this method will not work.

The attributes in the model Map returned by this method are usually included in the ModelAndView for a form view that uses Spring's bind tag, which needs access to the Errors instance. Spring's SimpleFormController will do this for you when rendering its form or success view. When building the ModelAndView yourself, you need to include the attributes from the model Map returned by this method yourself.

Specified by:
getModel in interface BindingResult
See Also:
getObjectName(), BindingResult.MODEL_KEY_PREFIX, ModelAndView, BindTag, SimpleFormController

getRawFieldValue

public Object getRawFieldValue(String field)
Description copied from interface: BindingResult
Extract the raw field value for the given field. Typically used for comparison purposes.

Specified by:
getRawFieldValue in interface BindingResult
Parameters:
field - the field to check
Returns:
the current value of the field in its raw form, or null if not known

findEditor

public PropertyEditor findEditor(String field,
                                 Class valueType)
This implementation delegates to the PropertyEditorRegistry's editor lookup facility, if available.

Specified by:
findEditor in interface BindingResult
Parameters:
field - the path of the property (name or nested path), or null if looking for an editor for all properties of the given type
valueType - the type of the property (can be null if a property is given but should be specified in any case for consistency checking)
Returns:
the registered editor, or null if none

getPropertyEditorRegistry

public PropertyEditorRegistry getPropertyEditorRegistry()
This implementation returns null.

Specified by:
getPropertyEditorRegistry in interface BindingResult
Returns:
the PropertyEditorRegistry, or null if none available for this BindingResult

recordSuppressedField

public void recordSuppressedField(String field)
Mark the specified disallowed field as suppressed.

The data binder invokes this for each field value that was detected to target a disallowed field.

Specified by:
recordSuppressedField in interface BindingResult
See Also:
DataBinder.setAllowedFields(java.lang.String...)

getSuppressedFields

public String[] getSuppressedFields()
Return the list of fields that were suppressed during the bind process.

Can be used to determine whether any field values were targetting disallowed fields.

Specified by:
getSuppressedFields in interface BindingResult
See Also:
DataBinder.setAllowedFields(java.lang.String...)

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getTarget

public abstract Object getTarget()
Return the wrapped target object.

Specified by:
getTarget in interface BindingResult

getActualFieldValue

protected abstract Object getActualFieldValue(String field)
Extract the actual field value for the given field.

Parameters:
field - the field to check
Returns:
the current value of the field

formatFieldValue

protected Object formatFieldValue(String field,
                                  Object value)
Format the given value for the specified field.

The default implementation simply returns the field value as-is.

Parameters:
field - the field to check
value - the value of the field (either a rejected value other than from a binding error, or an actual field value)
Returns:
the formatted value
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractErrors

org.springframework.validation
Class AbstractErrors

java.lang.Object
    extended by  org.springframework.validation.AbstractErrors
All Implemented Interfaces:
Serializable, Errors
Direct Known Subclasses:
AbstractBindingResult
public abstract class AbstractErrors
extends Object
implements Errors, Serializable

Abstract implementation of the Errors interface. Provides common access to evaluated errors; however, does not define concrete management of ObjectErrors and FieldErrors.

Since:
2.5.3
Author:
Juergen Hoeller
See Also:
Serialized Form

Field Summary
Fields inherited from interface org.springframework.validation.Errors
NESTED_PATH_SEPARATOR
Constructor Summary
AbstractErrors()
Method Summary
protected String | canonicalFieldName(String field) Determine the canonical field name for the given field.
protected void | doSetNestedPath(String nestedPath) Actually set the nested path.
protected String | fixedField(String field) Transform the given field into its full path, regarding the nested path of this instance.
List<ObjectError> | getAllErrors() Get all errors, both global and field ones.
int | getErrorCount() Return the total number of errors.
FieldError | getFieldError() Get the first error associated with a field, if any.
FieldError | getFieldError(String field) Get the first error associated with the given field, if any.
int | getFieldErrorCount() Return the number of errors associated with a field.
int | getFieldErrorCount(String field) Return the number of errors associated with the given field.
List<FieldError> | getFieldErrors(String field) Get all errors associated with the given field.
Class | getFieldType(String field) Return the type of a given field.
ObjectError | getGlobalError() Get the first global error, if any.
int | getGlobalErrorCount() Return the number of global errors.
String | getNestedPath() Return the current nested path of this Errors object.
boolean | hasErrors() Return if there were any errors.
boolean | hasFieldErrors() Are there any field errors?
boolean | hasFieldErrors(String field) Are there any errors associated with the given field?
boolean | hasGlobalErrors() Are there any global errors?
protected boolean | isMatchingFieldError(String field, FieldError fieldError) Check whether the given FieldError matches the given field.
void | popNestedPath() Pop the former nested path from the nested path stack.
void | pushNestedPath(String subPath) Push the given sub path onto the nested path stack.
void | reject(String errorCode) Register a global error for the entire target object, using the given error description.
void | reject(String errorCode, String defaultMessage) Register a global error for the entire target object, using the given error description.
void | rejectValue(String field, String errorCode) Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description.
void | rejectValue(String field, String errorCode, String defaultMessage) Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description.
void | setNestedPath(String nestedPath) Allow context to be changed so that standard validators can validate subtrees.
String | toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.validation.Errors
addAllErrors, getFieldErrors, getFieldValue, getGlobalErrors, getObjectName, reject, rejectValue

Constructor Detail

AbstractErrors

public AbstractErrors()
Method Detail

setNestedPath

public void setNestedPath(String nestedPath)
Description copied from interface: Errors
Allow context to be changed so that standard validators can validate subtrees. Reject calls prepend the given path to the field names.

For example, an address validator could validate the subobject "address" of a customer object.

Specified by:
setNestedPath in interface Errors
Parameters:
nestedPath - nested path within this object, e.g. "address" (defaults to "", null is also acceptable). Can end with a dot: both "address" and "address." are valid.

getNestedPath

public String getNestedPath()
Description copied from interface: Errors
Return the current nested path of this Errors object.

Returns a nested path with a dot, i.e. "address.", for easy building of concatenated paths. Default is an empty String.

Specified by:
getNestedPath in interface Errors

pushNestedPath

public void pushNestedPath(String subPath)
Description copied from interface: Errors
Push the given sub path onto the nested path stack.

A Errors.popNestedPath() call will reset the original nested path before the corresponding pushNestedPath(String) call.

Using the nested path stack allows to set temporary nested paths for subobjects without having to worry about a temporary path holder.

For example: current path "spouse.", pushNestedPath("child") -> result path "spouse.child."; popNestedPath() -> "spouse." again.

Specified by:
pushNestedPath in interface Errors
Parameters:
subPath - the sub path to push onto the nested path stack
See Also:
Errors.popNestedPath()

popNestedPath

public void popNestedPath()
                   throws IllegalArgumentException
Description copied from interface: Errors
Pop the former nested path from the nested path stack.

Specified by:
popNestedPath in interface Errors
Throws:
IllegalArgumentException
See Also:
Errors.pushNestedPath(java.lang.String)

doSetNestedPath

protected void doSetNestedPath(String nestedPath)
Actually set the nested path. Delegated to by setNestedPath and pushNestedPath.

fixedField

protected String fixedField(String field)
Transform the given field into its full path, regarding the nested path of this instance.

canonicalFieldName

protected String canonicalFieldName(String field)
Determine the canonical field name for the given field.

The default implementation simply returns the field name as-is.

Parameters:
field - the original field name
Returns:
the canonical field name

reject

public void reject(String errorCode)
Description copied from interface: Errors
Register a global error for the entire target object, using the given error description.

Specified by:
reject in interface Errors
Parameters:
errorCode - error code, interpretable as a message key

reject

public void reject(String errorCode,
                   String defaultMessage)
Description copied from interface: Errors
Register a global error for the entire target object, using the given error description.

Specified by:
reject in interface Errors
Parameters:
errorCode - error code, interpretable as a message key
defaultMessage - fallback default message

rejectValue

public void rejectValue(String field,
                        String errorCode)
Description copied from interface: Errors
Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description.

The field name may be null or empty String to indicate the current object itself rather than a field of it. This may result in a corresponding field error within the nested object graph or a global error if the current object is the top object.

Specified by:
rejectValue in interface Errors
Parameters:
field - the field name (may be null or empty String)
errorCode - error code, interpretable as a message key
See Also:
Errors.getNestedPath()

rejectValue

public void rejectValue(String field,
                        String errorCode,
                        String defaultMessage)
Description copied from interface: Errors
Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description.

The field name may be null or empty String to indicate the current object itself rather than a field of it. This may result in a corresponding field error within the nested object graph or a global error if the current object is the top object.

Specified by:
rejectValue in interface Errors
Parameters:
field - the field name (may be null or empty String)
errorCode - error code, interpretable as a message key
defaultMessage - fallback default message
See Also:
Errors.getNestedPath()

hasErrors

public boolean hasErrors()
Description copied from interface: Errors
Return if there were any errors.

Specified by:
hasErrors in interface Errors

getErrorCount

public int getErrorCount()
Description copied from interface: Errors
Return the total number of errors.

Specified by:
getErrorCount in interface Errors

getAllErrors

public List<ObjectError> getAllErrors()
Description copied from interface: Errors
Get all errors, both global and field ones.

Specified by:
getAllErrors in interface Errors
Returns:
List of ObjectError instances

hasGlobalErrors

public boolean hasGlobalErrors()
Description copied from interface: Errors
Are there any global errors?

Specified by:
hasGlobalErrors in interface Errors
Returns:
true if there are any global errors
See Also:
Errors.hasFieldErrors()

getGlobalErrorCount

public int getGlobalErrorCount()
Description copied from interface: Errors
Return the number of global errors.

Specified by:
getGlobalErrorCount in interface Errors
Returns:
the number of global errors
See Also:
Errors.getFieldErrorCount()

getGlobalError

public ObjectError getGlobalError()
Description copied from interface: Errors
Get the first global error, if any.

Specified by:
getGlobalError in interface Errors
Returns:
the global error, or null

hasFieldErrors

public boolean hasFieldErrors()
Description copied from interface: Errors
Are there any field errors?

Specified by:
hasFieldErrors in interface Errors
Returns:
true if there are any errors associated with a field
See Also:
Errors.hasGlobalErrors()

getFieldErrorCount

public int getFieldErrorCount()
Description copied from interface: Errors
Return the number of errors associated with a field.

Specified by:
getFieldErrorCount in interface Errors
Returns:
the number of errors associated with a field
See Also:
Errors.getGlobalErrorCount()

getFieldError

public FieldError getFieldError()
Description copied from interface: Errors
Get the first error associated with a field, if any.

Specified by:
getFieldError in interface Errors
Returns:
the field-specific error, or null

hasFieldErrors

public boolean hasFieldErrors(String field)
Description copied from interface: Errors
Are there any errors associated with the given field?

Specified by:
hasFieldErrors in interface Errors
Parameters:
field - the field name
Returns:
true if there were any errors associated with the given field

getFieldErrorCount

public int getFieldErrorCount(String field)
Description copied from interface: Errors
Return the number of errors associated with the given field.

Specified by:
getFieldErrorCount in interface Errors
Parameters:
field - the field name
Returns:
the number of errors associated with the given field

getFieldErrors

public List<FieldError> getFieldErrors(String field)
Description copied from interface: Errors
Get all errors associated with the given field.

Implementations should support not only full field names like "name" but also pattern matches like "na*" or "address.*".

Specified by:
getFieldErrors in interface Errors
Parameters:
field - the field name
Returns:
a List of FieldError instances

getFieldError

public FieldError getFieldError(String field)
Description copied from interface: Errors
Get the first error associated with the given field, if any.

Specified by:
getFieldError in interface Errors
Parameters:
field - the field name
Returns:
the field-specific error, or null

getFieldType

public Class getFieldType(String field)
Description copied from interface: Errors
Return the type of a given field.

Implementations should be able to determine the type even when the field value is null, for example from some associated descriptor.

Specified by:
getFieldType in interface Errors
Parameters:
field - the field name
Returns:
the type of the field, or null if not determinable

isMatchingFieldError

protected boolean isMatchingFieldError(String field,
                                       FieldError fieldError)
Check whether the given FieldError matches the given field.

Parameters:
field - the field that we are looking up FieldErrors for
fieldError - the candidate FieldError
Returns:
whether the FieldError matches the given field

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractPropertyBindingResult

org.springframework.validation
Class AbstractPropertyBindingResult

java.lang.Object
    extended by  org.springframework.validation.AbstractErrors
        extended by  org.springframework.validation.AbstractBindingResult
            extended by  org.springframework.validation.AbstractPropertyBindingResult
All Implemented Interfaces:
Serializable, BindingResult, Errors
Direct Known Subclasses:
BeanPropertyBindingResult, DirectFieldBindingResult
public abstract class AbstractPropertyBindingResult
extends AbstractBindingResult

Abstract base class for BindingResult implementations that work with Spring's PropertyAccessor mechanism. Pre-implements field access through delegation to the corresponding PropertyAccessor methods.

Since:
2.0
Author:
Juergen Hoeller
See Also:
getPropertyAccessor(), PropertyAccessor, ConfigurablePropertyAccessor, Serialized Form

Field Summary
Fields inherited from interface org.springframework.validation.BindingResult
MODEL_KEY_PREFIX
Fields inherited from interface org.springframework.validation.Errors
NESTED_PATH_SEPARATOR
Constructor Summary
protected AbstractPropertyBindingResult(String objectName)
Create a new AbstractPropertyBindingResult instance.
Method Summary
protected String | canonicalFieldName(String field) Returns the canonical property name.
PropertyEditor | findEditor(String field, Class valueType) This implementation exposes a PropertyEditor adapter for a Formatter, if applicable.
protected Object | formatFieldValue(String field, Object value) Formats the field value based on registered PropertyEditors.
protected Object | getActualFieldValue(String field) Fetches the field value from the PropertyAccessor.
protected PropertyEditor | getCustomEditor(String fixedField) Retrieve the custom PropertyEditor for the given field, if any.
Class | getFieldType(String field) Determines the field type from the property type.
abstract ConfigurablePropertyAccessor | getPropertyAccessor() Provide the PropertyAccessor to work with, according to the concrete strategy of access.
PropertyEditorRegistry | getPropertyEditorRegistry() Returns the underlying PropertyAccessor.
void | initConversion(ConversionService conversionService)
Methods inherited from class org.springframework.validation.AbstractBindingResult
addAllErrors, addError, equals, getAllErrors, getErrorCount, getFieldError, getFieldError, getFieldErrors, getFieldErrors, getFieldValue, getGlobalError, getGlobalErrors, getMessageCodesResolver, getModel, getObjectName, getRawFieldValue, getSuppressedFields, getTarget, hasErrors, hashCode, recordSuppressedField, reject, rejectValue, resolveMessageCodes, resolveMessageCodes, setMessageCodesResolver
Methods inherited from class org.springframework.validation.AbstractErrors
doSetNestedPath, fixedField, getFieldErrorCount, getFieldErrorCount, getGlobalErrorCount, getNestedPath, hasFieldErrors, hasFieldErrors, hasGlobalErrors, isMatchingFieldError, popNestedPath, pushNestedPath, reject, reject, rejectValue, rejectValue, setNestedPath, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.validation.Errors
getFieldErrorCount, getFieldErrorCount, getGlobalErrorCount, getNestedPath, hasFieldErrors, hasFieldErrors, hasGlobalErrors, popNestedPath, pushNestedPath, reject, reject, rejectValue, rejectValue, setNestedPath

Constructor Detail

AbstractPropertyBindingResult

protected AbstractPropertyBindingResult(String objectName)
Create a new AbstractPropertyBindingResult instance.

Parameters:
objectName - the name of the target object
See Also:
DefaultMessageCodesResolver
Method Detail

initConversion

public void initConversion(ConversionService conversionService)

getPropertyEditorRegistry

public PropertyEditorRegistry getPropertyEditorRegistry()
Returns the underlying PropertyAccessor.

Specified by:
getPropertyEditorRegistry in interface BindingResult
Overrides:
getPropertyEditorRegistry in class AbstractBindingResult
Returns:
the PropertyEditorRegistry, or null if none available for this BindingResult
See Also:
getPropertyAccessor()

canonicalFieldName

protected String canonicalFieldName(String field)
Returns the canonical property name.

Overrides:
canonicalFieldName in class AbstractErrors
Parameters:
field - the original field name
Returns:
the canonical field name
See Also:
PropertyAccessorUtils.canonicalPropertyName(java.lang.String)

getFieldType

public Class getFieldType(String field)
Determines the field type from the property type.

Specified by:
getFieldType in interface Errors
Overrides:
getFieldType in class AbstractBindingResult
Parameters:
field - the field name
Returns:
the type of the field, or null if not determinable
See Also:
getPropertyAccessor()

getActualFieldValue

protected Object getActualFieldValue(String field)
Fetches the field value from the PropertyAccessor.

Specified by:
getActualFieldValue in class AbstractBindingResult
Parameters:
field - the field to check
Returns:
the current value of the field
See Also:
getPropertyAccessor()

formatFieldValue

protected Object formatFieldValue(String field,
                                  Object value)
Formats the field value based on registered PropertyEditors.

Overrides:
formatFieldValue in class AbstractBindingResult
Parameters:
field - the field to check
value - the value of the field (either a rejected value other than from a binding error, or an actual field value)
Returns:
the formatted value
See Also:
getCustomEditor(java.lang.String)

getCustomEditor

protected PropertyEditor getCustomEditor(String fixedField)
Retrieve the custom PropertyEditor for the given field, if any.

Parameters:
fixedField - the fully qualified field name
Returns:
the custom PropertyEditor, or null

findEditor

public PropertyEditor findEditor(String field,
                                 Class valueType)
This implementation exposes a PropertyEditor adapter for a Formatter, if applicable.

Specified by:
findEditor in interface BindingResult
Overrides:
findEditor in class AbstractBindingResult
Parameters:
field - the path of the property (name or nested path), or null if looking for an editor for all properties of the given type
valueType - the type of the property (can be null if a property is given but should be specified in any case for consistency checking)
Returns:
the registered editor, or null if none

getPropertyAccessor

public abstract ConfigurablePropertyAccessor getPropertyAccessor()
Provide the PropertyAccessor to work with, according to the concrete strategy of access.

Note that a PropertyAccessor used by a BindingResult should always have its "extractOldValueForEditor" flag set to "true" by default, since this is typically possible without side effects for model objects that serve as data binding target.

See Also:
ConfigurablePropertyAccessor.setExtractOldValueForEditor(boolean)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanPropertyBindingResult

org.springframework.validation
Class BeanPropertyBindingResult

java.lang.Object
    extended by  org.springframework.validation.AbstractErrors
        extended by  org.springframework.validation.AbstractBindingResult
            extended by  org.springframework.validation.AbstractPropertyBindingResult
                extended by  org.springframework.validation.BeanPropertyBindingResult
All Implemented Interfaces:
Serializable, BindingResult, Errors
public class BeanPropertyBindingResult
extends AbstractPropertyBindingResult
implements Serializable

Default implementation of the Errors and BindingResult interfaces, for the registration and evaluation of binding errors on JavaBean objects.

Performs standard JavaBean property access, also supporting nested properties. Normally, application code will work with the Errors interface or the BindingResult interface. A DataBinder returns its BindingResult via DataBinder.getBindingResult().

Since:
2.0
Author:
Juergen Hoeller
See Also:
DataBinder.getBindingResult(), DataBinder.initBeanPropertyAccess(), DirectFieldBindingResult, Serialized Form

Field Summary
Fields inherited from interface org.springframework.validation.BindingResult
MODEL_KEY_PREFIX
Fields inherited from interface org.springframework.validation.Errors
NESTED_PATH_SEPARATOR
Constructor Summary
BeanPropertyBindingResult(Object target, String objectName)
Creates a new instance of the BeanPropertyBindingResult class.
BeanPropertyBindingResult(Object target, String objectName, boolean autoGrowNestedPaths)
Creates a new instance of the BeanPropertyBindingResult class.
Method Summary
protected BeanWrapper | createBeanWrapper() Create a new BeanWrapper for the underlying target object.
ConfigurablePropertyAccessor | getPropertyAccessor() Returns the BeanWrapper that this instance uses.
Object | getTarget() Return the wrapped target object.
Methods inherited from class org.springframework.validation.AbstractPropertyBindingResult
canonicalFieldName, findEditor, formatFieldValue, getActualFieldValue, getCustomEditor, getFieldType, getPropertyEditorRegistry, initConversion
Methods inherited from class org.springframework.validation.AbstractBindingResult
addAllErrors, addError, equals, getAllErrors, getErrorCount, getFieldError, getFieldError, getFieldErrors, getFieldErrors, getFieldValue, getGlobalError, getGlobalErrors, getMessageCodesResolver, getModel, getObjectName, getRawFieldValue, getSuppressedFields, hasErrors, hashCode, recordSuppressedField, reject, rejectValue, resolveMessageCodes, resolveMessageCodes, setMessageCodesResolver
Methods inherited from class org.springframework.validation.AbstractErrors
doSetNestedPath, fixedField, getFieldErrorCount, getFieldErrorCount, getGlobalErrorCount, getNestedPath, hasFieldErrors, hasFieldErrors, hasGlobalErrors, isMatchingFieldError, popNestedPath, pushNestedPath, reject, reject, rejectValue, rejectValue, setNestedPath, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.validation.Errors
getFieldErrorCount, getFieldErrorCount, getGlobalErrorCount, getNestedPath, hasFieldErrors, hasFieldErrors, hasGlobalErrors, popNestedPath, pushNestedPath, reject, reject, rejectValue, rejectValue, setNestedPath

Constructor Detail

BeanPropertyBindingResult

public BeanPropertyBindingResult(Object target,
                                 String objectName)
Creates a new instance of the BeanPropertyBindingResult class.

Parameters:
target - the target bean to bind onto
objectName - the name of the target object

BeanPropertyBindingResult

public BeanPropertyBindingResult(Object target,
                                 String objectName,
                                 boolean autoGrowNestedPaths)
Creates a new instance of the BeanPropertyBindingResult class.

Parameters:
target - the target bean to bind onto
objectName - the name of the target object
autoGrowNestedPaths - whether to "auto-grow" a nested path that contains a null value
Method Detail

getTarget

public final Object getTarget()
Description copied from class: AbstractBindingResult
Return the wrapped target object.

Specified by:
getTarget in interface BindingResult
Specified by:
getTarget in class AbstractBindingResult

getPropertyAccessor

public final ConfigurablePropertyAccessor getPropertyAccessor()
Returns the BeanWrapper that this instance uses. Creates a new one if none existed before.

Specified by:
getPropertyAccessor in class AbstractPropertyBindingResult
See Also:
createBeanWrapper()

createBeanWrapper

protected BeanWrapper createBeanWrapper()
Create a new BeanWrapper for the underlying target object.

See Also:
getTarget()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BindingResultUtils

org.springframework.validation
Class BindingResultUtils

java.lang.Object
    extended by  org.springframework.validation.BindingResultUtils

public abstract class BindingResultUtils
extends Object

Convenience methods for looking up BindingResults in a model Map.

Since:
2.0
Author:
Juergen Hoeller
See Also:
BindingResult.MODEL_KEY_PREFIX

Constructor Summary
BindingResultUtils()
Method Summary
static BindingResult | getBindingResult(Map model, String name) Find the BindingResult for the given name in the given model.
static BindingResult | getRequiredBindingResult(Map model, String name) Find a required BindingResult for the given name in the given model.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BindingResultUtils

public BindingResultUtils()
Method Detail

getBindingResult

public static BindingResult getBindingResult(Map model,
                                             String name)
Find the BindingResult for the given name in the given model.

Parameters:
model - the model to search
name - the name of the target object to find a BindingResult for
Returns:
the BindingResult, or null if none found
Throws:
IllegalStateException - if the attribute found is not of type BindingResult

getRequiredBindingResult

public static BindingResult getRequiredBindingResult(Map model,
                                                     String name)
Find a required BindingResult for the given name in the given model.

Parameters:
model - the model to search
name - the name of the target object to find a BindingResult for
Returns:
the BindingResult (never null)
Throws:
IllegalStateException - if no BindingResult found
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DataBinder

org.springframework.validation
Class DataBinder

java.lang.Object
    extended by  org.springframework.validation.DataBinder
All Implemented Interfaces:
PropertyEditorRegistry, TypeConverter
Direct Known Subclasses:
WebDataBinder
public class DataBinder
extends Object
implements PropertyEditorRegistry, TypeConverter

Binder that allows for setting property values onto a target object, including support for validation and binding result analysis. The binding process can be customized through specifying allowed fields, required fields, custom editors, etc.

Note that there are potential security implications in failing to set an array of allowed fields. In the case of HTTP form POST data for example, malicious clients can attempt to subvert an application by supplying values for fields or properties that do not exist on the form. In some cases this could lead to illegal data being set on command objects or their nested objects. For this reason, it is highly recommended to specify the allowedFields property on the DataBinder.

The binding results can be examined via the BindingResult interface, extending the Errors interface: see the getBindingResult() method. Missing fields and property access exceptions will be converted to FieldErrors, collected in the Errors instance, using the following error codes:

  • Missing field error: "required"
  • Type mismatch error: "typeMismatch"
  • Method invocation error: "methodInvocation"

By default, binding errors get resolved through the BindingErrorProcessor strategy, processing for missing fields and property access exceptions: see the setBindingErrorProcessor(org.springframework.validation.BindingErrorProcessor) method. You can override the default strategy if needed, for example to generate different error codes.

Custom validation errors can be added afterwards. You will typically want to resolve such error codes into proper user-visible error messages; this can be achieved through resolving each error via a MessageSource, which is able to resolve an ObjectError/FieldError through its MessageSource.getMessage(org.springframework.context.MessageSourceResolvable, java.util.Locale) method. The list of message codes can be customized through the MessageCodesResolver strategy: see the setMessageCodesResolver(org.springframework.validation.MessageCodesResolver) method. DefaultMessageCodesResolver's javadoc states details on the default resolution rules.

This generic data binder can be used in any kind of environment. It is typically used by Spring web MVC controllers, via the web-specific subclasses ServletRequestDataBinder and PortletRequestDataBinder.

Author:
Rod Johnson, Juergen Hoeller, Rob Harrop
See Also:
setAllowedFields(java.lang.String...),
setRequiredFields(java.lang.String...),
registerCustomEditor(java.lang.Class, java.beans.PropertyEditor),
setMessageCodesResolver(org.springframework.validation.MessageCodesResolver),
setBindingErrorProcessor(org.springframework.validation.BindingErrorProcessor),
bind(org.springframework.beans.PropertyValues),
getBindingResult(),
DefaultMessageCodesResolver,
DefaultBindingErrorProcessor,
MessageSource,
ServletRequestDataBinder

Field Summary
static String | DEFAULT_OBJECT_NAME Default object name used for binding: "target"
protected static Log | logger We'll create a lot of DataBinder instances: Let's use a static logger.
Constructor Summary
DataBinder(Object target)
Create a new DataBinder instance, with default object name.
DataBinder(Object target, String objectName)
Create a new DataBinder instance.
Method Summary
protected  void applyPropertyValues(MutablePropertyValues mpvs)
Apply given property values to the target object.
 void bind(PropertyValues pvs)
Bind the given property values to this binder's target.
protected  void checkAllowedFields(MutablePropertyValues mpvs)
Check the given property values against the allowed fields, removing values for fields that are not allowed.
protected  void checkRequiredFields(MutablePropertyValues mpvs)
Check the given property values against the required fields, generating missing field errors where appropriate.
 Map close()
Close this DataBinder, which may result in throwing a BindException if it encountered any errors.
<T> T
convertIfNecessary(Object value, Class<T> requiredType)
Convert the value to the required type (if necessary from a String).
<T> T
convertIfNecessary(Object value, Class<T> requiredType, MethodParameter methodParam)
Convert the value to the required type (if necessary from a String).
protected  void doBind(MutablePropertyValues mpvs)
Actual implementation of the binding process, working with the passed-in MutablePropertyValues instance.
 PropertyEditor findCustomEditor(Class requiredType, String propertyPath)
Find a custom property editor for the given type and property.
 String[] getAllowedFields()
Return the fields that should be allowed for binding.
 BindingErrorProcessor getBindingErrorProcessor()
Return the strategy for processing binding errors.
 BindingResult getBindingResult()
Return the BindingResult instance created by this DataBinder.
 ConversionService getConversionService()
Return the associated ConversionService, if any.
 String[] getDisallowedFields()
Return the fields that should not be allowed for binding.
 BindException getErrors()
Deprecated. in favor of getBindingResult(). Use the BindException.BindException(BindingResult) constructor to create a BindException instance if still needed.
protected  AbstractPropertyBindingResult getInternalBindingResult()
Return the internal BindingResult held by this DataBinder, as AbstractPropertyBindingResult.
 String getObjectName()
Return the name of the bound object.
protected  ConfigurablePropertyAccessor getPropertyAccessor()
Return the underlying PropertyAccessor of this binder's BindingResult.
protected  PropertyEditorRegistry getPropertyEditorRegistry()
Return the underlying TypeConverter of this binder's BindingResult.
 String[] getRequiredFields()
Return the fields that are required for each binding process.
protected  SimpleTypeConverter getSimpleTypeConverter()
Return this binder's underlying SimpleTypeConverter.
 Object getTarget()
Return the wrapped target object.
protected  TypeConverter getTypeConverter()
Return the underlying TypeConverter of this binder's BindingResult.
 Validator getValidator()
Return the Validator to apply after each binding step, if any.
 void initBeanPropertyAccess()
Initialize standard JavaBean property access for this DataBinder.
 void initDirectFieldAccess()
Initialize direct field access for this DataBinder, as alternative to the default bean property access.
protected  boolean isAllowed(String field)
Return if the given field is allowed for binding.
 boolean isAutoGrowNestedPaths()
Return whether "auto-growing" of nested paths has been activated.
 boolean isIgnoreInvalidFields()
Return whether to ignore invalid fields when binding.
 boolean isIgnoreUnknownFields()
Return whether to ignore unknown fields when binding.
 void registerCustomEditor(Class requiredType, PropertyEditor propertyEditor)
Register the given custom property editor for all properties of the given type.
 void registerCustomEditor(Class requiredType, String field, PropertyEditor propertyEditor)
Register the given custom property editor for the given type and property, or for all properties of the given type.
 void setAllowedFields(String... allowedFields)
Register fields that should be allowed for binding.
 void setAutoGrowNestedPaths(boolean autoGrowNestedPaths)
Set whether this binder should attempt to "auto-grow" a nested path that contains a null value.
 void setBindingErrorProcessor(BindingErrorProcessor bindingErrorProcessor)
Set the strategy to use for processing binding errors, that is, required field errors and PropertyAccessExceptions.
 void setConversionService(ConversionService conversionService)
Specify a Spring 3.0 ConversionService to use for converting property values, as an alternative to JavaBeans PropertyEditors.
 void setDisallowedFields(String... disallowedFields)
Register fields that should not be allowed for binding.
 void setExtractOldValueForEditor(boolean extractOldValueForEditor)
Set whether to extract the old field value when applying a property editor to a new value for a field.
 void setIgnoreInvalidFields(boolean ignoreInvalidFields)
Set whether to ignore invalid fields, that is, whether to ignore bind parameters that have corresponding fields in the target object which are not accessible (for example because of null values in the nested path).
 void setIgnoreUnknownFields(boolean ignoreUnknownFields)
Set whether to ignore unknown fields, that is, whether to ignore bind parameters that do not have corresponding fields in the target object.
 void setMessageCodesResolver(MessageCodesResolver messageCodesResolver)
Set the strategy to use for resolving errors into message codes.
 void setRequiredFields(String... requiredFields)
Register fields that are required for each binding process.
 void setValidator(Validator validator)
Set the Validator to apply after each binding step.
 void validate()
Invoke the specified Validator, if any.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_OBJECT_NAME

public static final String DEFAULT_OBJECT_NAME
Default object name used for binding: "target"

See Also:
Constant Field Values

logger

protected static final Log logger
We'll create a lot of DataBinder instances: Let's use a static logger.

Constructor Detail

DataBinder

public DataBinder(Object target)
Create a new DataBinder instance, with default object name.

Parameters:
target - the target object to bind onto (or null if the binder is just used to convert a plain parameter value)
See Also:
DEFAULT_OBJECT_NAME

DataBinder

public DataBinder(Object target,
                  String objectName)
Create a new DataBinder instance.

Parameters:
target - the target object to bind onto (or null if the binder is just used to convert a plain parameter value)
objectName - the name of the target object
Method Detail

getTarget

public Object getTarget()
Return the wrapped target object.

getObjectName

public String getObjectName()
Return the name of the bound object.

setAutoGrowNestedPaths

public void setAutoGrowNestedPaths(boolean autoGrowNestedPaths)
Set whether this binder should attempt to "auto-grow" a nested path that contains a null value.

If "true", a null path location will be populated with a default object value and traversed instead of resulting in an exception. This flag also enables auto-growth of collection elements when accessing an out-of-bounds index.

Default is "true" on a standard DataBinder. Note that this feature is only supported for bean property access (DataBinder's default mode), not for field access.

See Also:
initBeanPropertyAccess(), BeanWrapper.setAutoGrowNestedPaths(boolean)

isAutoGrowNestedPaths

public boolean isAutoGrowNestedPaths()
Return whether "auto-growing" of nested paths has been activated.

initBeanPropertyAccess

public void initBeanPropertyAccess()
Initialize standard JavaBean property access for this DataBinder.

This is the default; an explicit call just leads to eager initialization.

See Also:
initDirectFieldAccess()

initDirectFieldAccess

public void initDirectFieldAccess()
Initialize direct field access for this DataBinder, as alternative to the default bean property access.

See Also:
initBeanPropertyAccess()

getInternalBindingResult

protected AbstractPropertyBindingResult getInternalBindingResult()
Return the internal BindingResult held by this DataBinder, as AbstractPropertyBindingResult.

getPropertyAccessor

protected ConfigurablePropertyAccessor getPropertyAccessor()
Return the underlying PropertyAccessor of this binder's BindingResult.

getSimpleTypeConverter

protected SimpleTypeConverter getSimpleTypeConverter()
Return this binder's underlying SimpleTypeConverter.

getPropertyEditorRegistry

protected PropertyEditorRegistry getPropertyEditorRegistry()
Return the underlying TypeConverter of this binder's BindingResult.

getTypeConverter

protected TypeConverter getTypeConverter()
Return the underlying TypeConverter of this binder's BindingResult.

getBindingResult

public BindingResult getBindingResult()
Return the BindingResult instance created by this DataBinder. This allows for convenient access to the binding results after a bind operation.

Returns:
the BindingResult instance, to be treated as BindingResult or as Errors instance (Errors is a super-interface of BindingResult)
See Also:
Errors, bind(org.springframework.beans.PropertyValues)

getErrors

@Deprecated
public BindException getErrors()
Deprecated. in favor of getBindingResult(). Use the BindException.BindException(BindingResult) constructor to create a BindException instance if still needed.

Return the Errors instance for this data binder.

Returns:
the Errors instance, to be treated as Errors or as BindException
See Also:
getBindingResult()

setIgnoreUnknownFields

public void setIgnoreUnknownFields(boolean ignoreUnknownFields)
Set whether to ignore unknown fields, that is, whether to ignore bind parameters that do not have corresponding fields in the target object.

Default is "true". Turn this off to enforce that all bind parameters must have a matching field in the target object.

Note that this setting only applies to binding operations on this DataBinder, not to retrieving values via its BindingResult.

See Also:
bind(org.springframework.beans.PropertyValues)

isIgnoreUnknownFields

public boolean isIgnoreUnknownFields()
Return whether to ignore unknown fields when binding.

setIgnoreInvalidFields

public void setIgnoreInvalidFields(boolean ignoreInvalidFields)
Set whether to ignore invalid fields, that is, whether to ignore bind parameters that have corresponding fields in the target object which are not accessible (for example because of null values in the nested path).

Default is "false". Turn this on to ignore bind parameters for nested objects in non-existing parts of the target object graph.

Note that this setting only applies to binding operations on this DataBinder, not to retrieving values via its BindingResult.

See Also:
bind(org.springframework.beans.PropertyValues)

isIgnoreInvalidFields

public boolean isIgnoreInvalidFields()
Return whether to ignore invalid fields when binding.

setAllowedFields

public void setAllowedFields(String... allowedFields)
Register fields that should be allowed for binding. Default is all fields. Restrict this for example to avoid unwanted modifications by malicious users when binding HTTP request parameters.

Supports "xxx*", "*xxx" and "*xxx*" patterns. More sophisticated matching can be implemented by overriding the isAllowed method.

Alternatively, specify a list of disallowed fields.

Parameters:
allowedFields - array of field names
See Also:
setDisallowedFields(java.lang.String...), isAllowed(String), ServletRequestDataBinder

getAllowedFields

public String[] getAllowedFields()
Return the fields that should be allowed for binding.

Returns:
array of field names

setDisallowedFields

public void setDisallowedFields(String... disallowedFields)
Register fields that should not be allowed for binding. Default is none. Mark fields as disallowed for example to avoid unwanted modifications by malicious users when binding HTTP request parameters.

Supports "xxx*", "*xxx" and "*xxx*" patterns. More sophisticated matching can be implemented by overriding the isAllowed method.

Alternatively, specify a list of allowed fields.

Parameters:
disallowedFields - array of field names
See Also:
setAllowedFields(java.lang.String...), isAllowed(String), ServletRequestDataBinder

getDisallowedFields

public String[] getDisallowedFields()
Return the fields that should not be allowed for binding.

Returns:
array of field names

setRequiredFields

public void setRequiredFields(String... requiredFields)
Register fields that are required for each binding process.

If one of the specified fields is not contained in the list of incoming property values, a corresponding "missing field" error will be created, with error code "required" (by the default binding error processor).

Parameters:
requiredFields - array of field names
See Also:
setBindingErrorProcessor(org.springframework.validation.BindingErrorProcessor), DefaultBindingErrorProcessor.MISSING_FIELD_ERROR_CODE

getRequiredFields

public String[] getRequiredFields()
Return the fields that are required for each binding process.

Returns:
array of field names

setExtractOldValueForEditor

public void setExtractOldValueForEditor(boolean extractOldValueForEditor)
Set whether to extract the old field value when applying a property editor to a new value for a field.

Default is "true", exposing previous field values to custom editors. Turn this to "false" to avoid side effects caused by getters.

setMessageCodesResolver

public void setMessageCodesResolver(MessageCodesResolver messageCodesResolver)
Set the strategy to use for resolving errors into message codes. Applies the given strategy to the underlying errors holder.

Default is a DefaultMessageCodesResolver.

See Also:
AbstractBindingResult.setMessageCodesResolver(org.springframework.validation.MessageCodesResolver), DefaultMessageCodesResolver

setBindingErrorProcessor

public void setBindingErrorProcessor(BindingErrorProcessor bindingErrorProcessor)
Set the strategy to use for processing binding errors, that is, required field errors and PropertyAccessExceptions.

Default is a DefaultBindingErrorProcessor.

See Also:
DefaultBindingErrorProcessor

getBindingErrorProcessor

public BindingErrorProcessor getBindingErrorProcessor()
Return the strategy for processing binding errors.

setValidator

public void setValidator(Validator validator)
Set the Validator to apply after each binding step.

getValidator

public Validator getValidator()
Return the Validator to apply after each binding step, if any.

setConversionService

public void setConversionService(ConversionService conversionService)
Specify a Spring 3.0 ConversionService to use for converting property values, as an alternative to JavaBeans PropertyEditors.

getConversionService

public ConversionService getConversionService()
Return the associated ConversionService, if any.

registerCustomEditor

public void registerCustomEditor(Class requiredType,
                                 PropertyEditor propertyEditor)
Description copied from interface: PropertyEditorRegistry
Register the given custom property editor for all properties of the given type.

Specified by:
registerCustomEditor in interface PropertyEditorRegistry
Parameters:
requiredType - the type of the property
propertyEditor - the editor to register

registerCustomEditor

public void registerCustomEditor(Class requiredType,
                                 String field,
                                 PropertyEditor propertyEditor)
Description copied from interface: PropertyEditorRegistry
Register the given custom property editor for the given type and property, or for all properties of the given type.

If the property path denotes an array or Collection property, the editor will get applied either to the array/Collection itself (the PropertyEditor has to create an array or Collection value) or to each element (the PropertyEditor has to create the element type), depending on the specified required type.

Note: Only one single registered custom editor per property path is supported. In the case of a Collection/array, do not register an editor for both the Collection/array and each element on the same property.

For example, if you wanted to register an editor for "items[n].quantity" (for all values n), you would use "items.quantity" as the value of the 'propertyPath' argument to this method.

Specified by:
registerCustomEditor in interface PropertyEditorRegistry
Parameters:
requiredType - the type of the property. This may be null if a property is given but should be specified in any case, in particular in case of a Collection - making clear whether the editor is supposed to apply to the entire Collection itself or to each of its entries. So as a general rule: Do not specify null here in case of a Collection/array!
field - the path of the property (name or nested path), or null if registering an editor for all properties of the given type
propertyEditor - editor to register

findCustomEditor

public PropertyEditor findCustomEditor(Class requiredType,
                                       String propertyPath)
Description copied from interface: PropertyEditorRegistry
Find a custom property editor for the given type and property.

Specified by:
findCustomEditor in interface PropertyEditorRegistry
Parameters:
requiredType - the type of the property (can be null if a property is given but should be specified in any case for consistency checking)
propertyPath - the path of the property (name or nested path), or null if looking for an editor for all properties of the given type
Returns:
the registered editor, or null if none

convertIfNecessary

public <T> T convertIfNecessary(Object value,
                                Class<T> requiredType)
                     throws TypeMismatchException
Description copied from interface: TypeConverter
Convert the value to the required type (if necessary from a String).

Conversions from String to any type will typically use the setAsText method of the PropertyEditor class. Note that a PropertyEditor must be registered for the given class for this to work; this is a standard JavaBeans API. A number of PropertyEditors are automatically registered.

Specified by:
convertIfNecessary in interface TypeConverter
Parameters:
value - the value to convert
requiredType - the type we must convert to (or null if not known, for example in case of a collection element)
Returns:
the new value, possibly the result of type conversion
Throws:
TypeMismatchException - if type conversion failed
See Also:
PropertyEditor.setAsText(String), PropertyEditor.getValue()

convertIfNecessary

public <T> T convertIfNecessary(Object value,
                                Class<T> requiredType,
                                MethodParameter methodParam)
                     throws TypeMismatchException
Description copied from interface: TypeConverter
Convert the value to the required type (if necessary from a String).

Conversions from String to any type will typically use the setAsText method of the PropertyEditor class. Note that a PropertyEditor must be registered for the given class for this to work; this is a standard JavaBeans API. A number of PropertyEditors are automatically registered.

Specified by:
convertIfNecessary in interface TypeConverter
Parameters:
value - the value to convert
requiredType - the type we must convert to (or null if not known, for example in case of a collection element)
methodParam - the method parameter that is the target of the conversion (for analysis of generic types; may be null)
Returns:
the new value, possibly the result of type conversion
Throws:
TypeMismatchException - if type conversion failed
See Also:
PropertyEditor.setAsText(String), PropertyEditor.getValue()

bind

public void bind(PropertyValues pvs)
Bind the given property values to this binder's target.

This call can create field errors, representing basic binding errors like a required field (code "required"), or type mismatch between value and bean property (code "typeMismatch").

Note that the given PropertyValues should be a throwaway instance: For efficiency, it will be modified to just contain allowed fields if it implements the MutablePropertyValues interface; else, an internal mutable copy will be created for this purpose. Pass in a copy of the PropertyValues if you want your original instance to stay unmodified in any case.

Parameters:
pvs - property values to bind
See Also:
doBind(org.springframework.beans.MutablePropertyValues)

doBind

protected void doBind(MutablePropertyValues mpvs)
Actual implementation of the binding process, working with the passed-in MutablePropertyValues instance.

Parameters:
mpvs - the property values to bind, as MutablePropertyValues instance
See Also:
checkAllowedFields(org.springframework.beans.MutablePropertyValues),
checkRequiredFields(org.springframework.beans.MutablePropertyValues),
applyPropertyValues(org.springframework.beans.MutablePropertyValues)

checkAllowedFields

protected void checkAllowedFields(MutablePropertyValues mpvs)
Check the given property values against the allowed fields, removing values for fields that are not allowed.

Parameters:
mpvs - the property values to be bound (can be modified)
See Also:
getAllowedFields(), isAllowed(String)

isAllowed

protected boolean isAllowed(String field)
Return if the given field is allowed for binding. Invoked for each passed-in property value.

The default implementation checks for "xxx*", "*xxx" and "*xxx*" matches, as well as direct equality, in the specified lists of allowed fields and disallowed fields. A field matching a disallowed pattern will not be accepted even if it also happens to match a pattern in the allowed list.

Can be overridden in subclasses.

Parameters:
field - the field to check
Returns:
if the field is allowed
See Also:
setAllowedFields(java.lang.String...),
setDisallowedFields(java.lang.String...),
PatternMatchUtils.simpleMatch(String, String)

checkRequiredFields

protected void checkRequiredFields(MutablePropertyValues mpvs)
Check the given property values against the required fields, generating missing field errors where appropriate.

Parameters:
mpvs - the property values to be bound (can be modified)
See Also:
getRequiredFields(),
getBindingErrorProcessor(),
BindingErrorProcessor.processMissingFieldError(java.lang.String, org.springframework.validation.BindingResult)

applyPropertyValues

protected void applyPropertyValues(MutablePropertyValues mpvs)
Apply given property values to the target object.

Default implementation applies all of the supplied property values as bean property values. By default, unknown fields will be ignored.

Parameters:
mpvs - the property values to be bound (can be modified)
See Also:
getTarget(),
getPropertyAccessor(),
isIgnoreUnknownFields(),
getBindingErrorProcessor(),
BindingErrorProcessor.processPropertyAccessException(org.springframework.beans.PropertyAccessException, org.springframework.validation.BindingResult)

validate

public void validate()
Invoke the specified Validator, if any.

See Also:
setValidator(Validator), getBindingResult()

close

public Map close()
          throws BindException
Close this DataBinder, which may result in throwing a BindException if it encountered any errors.

Returns:
the model Map, containing target object and Errors instance
Throws:
BindException - if there were any errors in the bind operation
See Also:
BindingResult.getModel()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultBindingErrorProcessor

org.springframework.validation
Class DefaultBindingErrorProcessor

java.lang.Object
    extended by  org.springframework.validation.DefaultBindingErrorProcessor
All Implemented Interfaces:
BindingErrorProcessor
public class DefaultBindingErrorProcessor
extends Object
implements BindingErrorProcessor

Default BindingErrorProcessor implementation.

Uses the "required" error code and the field name to resolve message codes for a missing field error.

Creates a FieldError for each PropertyAccessException given, using the PropertyAccessException's error code ("typeMismatch", "methodInvocation") for resolving message codes.

Since:
1.2
Author:
Alef Arendsen, Juergen Hoeller
See Also:
MISSING_FIELD_ERROR_CODE, DataBinder.setBindingErrorProcessor(org.springframework.validation.BindingErrorProcessor), AbstractBindingResult.addError(org.springframework.validation.ObjectError), AbstractBindingResult.resolveMessageCodes(java.lang.String), ErrorCoded.getErrorCode(), TypeMismatchException.ERROR_CODE, MethodInvocationException.ERROR_CODE

Field Summary
static String MISSING_FIELD_ERROR_CODE
Error code that a missing field error (i.e.
Constructor Summary
DefaultBindingErrorProcessor()
Method Summary
protected Object[] | getArgumentsForBindError(String objectName, String field) Return FieldError arguments for a binding error on the given field.
void | processMissingFieldError(String missingField, BindingResult bindingResult) Apply the missing field error to the given BindException.
void | processPropertyAccessException(PropertyAccessException ex, BindingResult bindingResult) Translate the given PropertyAccessException to an appropriate error registered on the given Errors instance.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

MISSING_FIELD_ERROR_CODE

public static final String MISSING_FIELD_ERROR_CODE
Error code that a missing field error (i.e. a required field not found in the list of property values) will be registered with: "required".

See Also:
Constant Field Values
Constructor Detail

DefaultBindingErrorProcessor

public DefaultBindingErrorProcessor()
Method Detail

processMissingFieldError

public void processMissingFieldError(String missingField,
                                     BindingResult bindingResult)
Description copied from interface: BindingErrorProcessor
Apply the missing field error to the given BindException.

Usually, a field error is created for a missing required field.

Specified by:
processMissingFieldError in interface BindingErrorProcessor
Parameters:
missingField - the field that was missing during binding
bindingResult - the errors object to add the error(s) to. You can add more than just one error or maybe even ignore it. The BindingResult object features convenience utils such as a resolveMessageCodes method to resolve an error code.
See Also:
AbstractBindingResult.addError(org.springframework.validation.ObjectError), AbstractBindingResult.resolveMessageCodes(java.lang.String)

processPropertyAccessException

public void processPropertyAccessException(PropertyAccessException ex,
                                           BindingResult bindingResult)
Description copied from interface: BindingErrorProcessor
Translate the given PropertyAccessException to an appropriate error registered on the given Errors instance.

Note that two error types are available: FieldError and ObjectError. Usually, field errors are created, but in certain situations one might want to create a global ObjectError instead.

Specified by:
processPropertyAccessException in interface BindingErrorProcessor
Parameters:
ex - the PropertyAccessException to translate
bindingResult - the errors object to add the error(s) to. You can add more than just one error or maybe even ignore it. The BindingResult object features convenience utils such as a resolveMessageCodes method to resolve an error code.
See Also:
Errors, FieldError, ObjectError, MessageCodesResolver, AbstractBindingResult.addError(org.springframework.validation.ObjectError), AbstractBindingResult.resolveMessageCodes(java.lang.String)

getArgumentsForBindError

protected Object[] getArgumentsForBindError(String objectName,
                                            String field)
Return FieldError arguments for a binding error on the given field. Invoked for each missing required field and each type mismatch.

The default implementation returns a single argument of type DefaultMessageSourceResolvable, with "objectName.field" and "field" as codes.

Parameters:
objectName - the name of the target object
field - the field that caused the binding error
Returns:
the Object array that represents the FieldError arguments
See Also:
DefaultMessageSourceResolvable.getArguments(), DefaultMessageSourceResolvable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultMessageCodesResolver

org.springframework.validation
Class DefaultMessageCodesResolver

java.lang.Object
    extended by  org.springframework.validation.DefaultMessageCodesResolver
All Implemented Interfaces:
Serializable, MessageCodesResolver
public class DefaultMessageCodesResolver
extends Object
implements MessageCodesResolver, Serializable

Default implementation of the MessageCodesResolver interface.

Will create two message codes for an object error, in the following order:

  • 1.: code + "." + object name
  • 2.: code

Will create four message codes for a field specification, in the following order:

  • 1.: code + "." + object name + "." + field
  • 2.: code + "." + field
  • 3.: code + "." + field type
  • 4.: code

For example, in case of code "typeMismatch", object name "user", field "age":

  • 1. try "typeMismatch.user.age"
  • 2. try "typeMismatch.age"
  • 3. try "typeMismatch.int"
  • 4. try "typeMismatch"

This resolution algorithm thus can be leveraged for example to show specific messages for binding errors like "required" and "typeMismatch":

  • at the object + field level ("age" field, but only on "user");
  • at the field level (all "age" fields, no matter which object name);
  • or at the general level (all fields, on any object).

In case of array, List or Map properties, both codes for specific elements and for the whole collection are generated. Assuming a field "name" of an array "groups" in object "user":

  • 1. try "typeMismatch.user.groups[0].name"
  • 2. try "typeMismatch.user.groups.name"
  • 3. try "typeMismatch.groups[0].name"
  • 4. try "typeMismatch.groups.name"
  • 5. try "typeMismatch.name"
  • 6. try "typeMismatch.java.lang.String"
  • 7. try "typeMismatch"

In order to group all codes into a specific category within your resource bundles, e.g. "validation.typeMismatch.name" instead of the default "typeMismatch.name", consider specifying a prefix to be applied.

Since:
1.0.1
Author:
Juergen Hoeller
See Also:
Serialized Form

Field Summary
static String CODE_SEPARATOR
The separator that this implementation uses when resolving message codes.
Constructor Summary
DefaultMessageCodesResolver()
Method Summary
protected void | buildFieldList(String field, List<String> fieldList) Add both keyed and non-keyed entries for the supplied field to the supplied field list.
protected String | getPrefix() Return the prefix to be applied to any code built by this resolver.
protected String | postProcessMessageCode(String code) Post-process the given message code, built by this resolver.
String[] | resolveMessageCodes(String errorCode, String objectName) Build message codes for the given error code and object name.
String[] | resolveMessageCodes(String errorCode, String objectName, String field, Class fieldType) Build the code list for the given code and field: an object/field-specific code, a field-specific code, a plain error code.
void | setPrefix(String prefix) Specify a prefix to be applied to any code built by this resolver.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

CODE_SEPARATOR

public static final String CODE_SEPARATOR
The separator that this implementation uses when resolving message codes.

See Also:
Constant Field Values
Constructor Detail

DefaultMessageCodesResolver

public DefaultMessageCodesResolver()
Method Detail

setPrefix

public void setPrefix(String prefix)
Specify a prefix to be applied to any code built by this resolver.

Default is none. Specify, for example, "validation." to get error codes like "validation.typeMismatch.name".

getPrefix

protected String getPrefix()
Return the prefix to be applied to any code built by this resolver.

Returns an empty String in case of no prefix.

resolveMessageCodes

public String[] resolveMessageCodes(String errorCode,
                                    String objectName)
Description copied from interface: MessageCodesResolver
Build message codes for the given error code and object name. Used for building the codes list of an ObjectError.

Specified by:
resolveMessageCodes in interface MessageCodesResolver
Parameters:
errorCode - the error code used for rejecting the object
objectName - the name of the object
Returns:
the message codes to use

resolveMessageCodes

public String[] resolveMessageCodes(String errorCode,
                                    String objectName,
                                    String field,
                                    Class fieldType)
Build the code list for the given code and field: an object/field-specific code, a field-specific code, a plain error code.

Arrays, Lists and Maps are resolved both for specific elements and the whole collection.

See the class level Javadoc for details on the generated codes.

Specified by:
resolveMessageCodes in interface MessageCodesResolver
Parameters:
errorCode - the error code used for rejecting the value
objectName - the name of the object
field - the field name
fieldType - the field type (may be null if not determinable)
Returns:
the list of codes

buildFieldList

protected void buildFieldList(String field,
                              List<String> fieldList)
Add both keyed and non-keyed entries for the supplied field to the supplied field list.

postProcessMessageCode

protected String postProcessMessageCode(String code)
Post-process the given message code, built by this resolver.

The default implementation applies the specified prefix, if any.

Parameters:
code - the message code as built by this resolver
Returns:
the final message code to be returned
See Also:
setPrefix(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DirectFieldBindingResult

org.springframework.validation
Class DirectFieldBindingResult

java.lang.Object
    extended by  org.springframework.validation.AbstractErrors
        extended by  org.springframework.validation.AbstractBindingResult
            extended by  org.springframework.validation.AbstractPropertyBindingResult
                extended by  org.springframework.validation.DirectFieldBindingResult
All Implemented Interfaces:
Serializable, BindingResult, Errors
public class DirectFieldBindingResult
extends AbstractPropertyBindingResult

Special implementation of the Errors and BindingResult interfaces, supporting registration and evaluation of binding errors on value objects. Performs direct field access instead of going through JavaBean getters.

This implementation just supports fields in the actual target object. It is not able to traverse nested fields.

Since:
2.0
Author:
Juergen Hoeller
See Also:
DataBinder.getBindingResult(), DataBinder.initDirectFieldAccess(), BeanPropertyBindingResult, Serialized Form

Field Summary
Fields inherited from interface org.springframework.validation.BindingResult
MODEL_KEY_PREFIX
Fields inherited from interface org.springframework.validation.Errors
NESTED_PATH_SEPARATOR
Constructor Summary
DirectFieldBindingResult(Object target, String objectName)
Create a new DirectFieldBindingResult instance.
Method Summary
protected ConfigurablePropertyAccessor | createDirectFieldAccessor() Create a new DirectFieldAccessor for the underlying target object.
ConfigurablePropertyAccessor | getPropertyAccessor() Returns the DirectFieldAccessor that this instance uses.
Object | getTarget() Return the wrapped target object.
Methods inherited from class org.springframework.validation.AbstractPropertyBindingResult
canonicalFieldName, findEditor, formatFieldValue, getActualFieldValue, getCustomEditor, getFieldType, getPropertyEditorRegistry, initConversion
Methods inherited from class org.springframework.validation.AbstractBindingResult
addAllErrors, addError, equals, getAllErrors, getErrorCount, getFieldError, getFieldError, getFieldErrors, getFieldErrors, getFieldValue, getGlobalError, getGlobalErrors, getMessageCodesResolver, getModel, getObjectName, getRawFieldValue, getSuppressedFields, hasErrors, hashCode, recordSuppressedField, reject, rejectValue, resolveMessageCodes, resolveMessageCodes, setMessageCodesResolver
Methods inherited from class org.springframework.validation.AbstractErrors
doSetNestedPath, fixedField, getFieldErrorCount, getFieldErrorCount, getGlobalErrorCount, getNestedPath, hasFieldErrors, hasFieldErrors, hasGlobalErrors, isMatchingFieldError, popNestedPath, pushNestedPath, reject, reject, rejectValue, rejectValue, setNestedPath, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.validation.Errors
getFieldErrorCount, getFieldErrorCount, getGlobalErrorCount, getNestedPath, hasFieldErrors, hasFieldErrors, hasGlobalErrors, popNestedPath, pushNestedPath, reject, reject, rejectValue, rejectValue, setNestedPath

Constructor Detail

DirectFieldBindingResult

public DirectFieldBindingResult(Object target,
                                String objectName)
Create a new DirectFieldBindingResult instance.

Parameters:
target - the target object to bind onto
objectName - the name of the target object
Method Detail

getTarget

public final Object getTarget()
Description copied from class: AbstractBindingResult
Return the wrapped target object.

Specified by:
getTarget in interface BindingResult
Specified by:
getTarget in class AbstractBindingResult

getPropertyAccessor

public final ConfigurablePropertyAccessor getPropertyAccessor()
Returns the DirectFieldAccessor that this instance uses. Creates a new one if none existed before.

Specified by:
getPropertyAccessor in class AbstractPropertyBindingResult
See Also:
createDirectFieldAccessor()

createDirectFieldAccessor

protected ConfigurablePropertyAccessor createDirectFieldAccessor()
Create a new DirectFieldAccessor for the underlying target object.

See Also:
getTarget()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FieldError

org.springframework.validation
Class FieldError

java.lang.Object
    extended by  org.springframework.context.support.DefaultMessageSourceResolvable
        extended by  org.springframework.validation.ObjectError
            extended by  org.springframework.validation.FieldError
All Implemented Interfaces:
Serializable, MessageSourceResolvable
public class FieldError
extends ObjectError

Encapsulates a field error, that is, a reason for rejecting a specific field value.

See the DefaultMessageCodesResolver javadoc for details on how a message code list is built for a FieldError.

Since:
10.03.2003
Author:
Rod Johnson, Juergen Hoeller
See Also:
DefaultMessageCodesResolver, Serialized Form

Constructor Summary
FieldError(String objectName, String field, Object rejectedValue, boolean bindingFailure, String[] codes, Object[] arguments, String defaultMessage)
Create a new FieldError instance.
FieldError(String objectName, String field, String defaultMessage)
Create a new FieldError instance.
Method Summary
boolean | equals(Object other)
String | getField() Return the affected field of the object.
Object | getRejectedValue() Return the rejected field value.
int | hashCode()
boolean | isBindingFailure() Return whether this error represents a binding failure (like a type mismatch); otherwise it is a validation failure.
String | toString() Default implementation exposes the attributes of this MessageSourceResolvable.
Methods inherited from class org.springframework.validation.ObjectError
getObjectName
Methods inherited from class org.springframework.context.support.DefaultMessageSourceResolvable
getArguments, getCode, getCodes, getDefaultMessage, resolvableToString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

FieldError

public FieldError(String objectName,
                  String field,
                  String defaultMessage)
Create a new FieldError instance.

Parameters:
objectName - the name of the affected object
field - the affected field of the object
defaultMessage - the default message to be used to resolve this message

FieldError

public FieldError(String objectName,
                  String field,
                  Object rejectedValue,
                  boolean bindingFailure,
                  String[] codes,
                  Object[] arguments,
                  String defaultMessage)
Create a new FieldError instance.

Parameters:
objectName - the name of the affected object
field - the affected field of the object
rejectedValue - the rejected field value
bindingFailure - whether this error represents a binding failure (like a type mismatch); else, it is a validation failure
codes - the codes to be used to resolve this message
arguments - the array of arguments to be used to resolve this message
defaultMessage - the default message to be used to resolve this message
Method Detail

getField

public String getField()
Return the affected field of the object.

getRejectedValue

public Object getRejectedValue()
Return the rejected field value.

isBindingFailure

public boolean isBindingFailure()
Return whether this error represents a binding failure (like a type mismatch); otherwise it is a validation failure.

toString

public String toString()
Description copied from class: DefaultMessageSourceResolvable
Default implementation exposes the attributes of this MessageSourceResolvable. To be overridden in more specific subclasses, potentially including the resolvable content through resolvableToString().

Overrides:
toString in class ObjectError
See Also:
DefaultMessageSourceResolvable.resolvableToString()

equals

public boolean equals(Object other)
Overrides:
equals in class ObjectError

hashCode

public int hashCode()
Overrides:
hashCode in class ObjectError
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MapBindingResult

org.springframework.validation
Class MapBindingResult

java.lang.Object
    extended by  org.springframework.validation.AbstractErrors
        extended by  org.springframework.validation.AbstractBindingResult
            extended by  org.springframework.validation.MapBindingResult
All Implemented Interfaces:
Serializable, BindingResult, Errors
public class MapBindingResult
extends AbstractBindingResult
implements Serializable

Map-based implementation of the BindingResult interface, supporting registration and evaluation of binding errors on Map attributes.

Can be used as errors holder for custom binding onto a Map, for example when invoking a Validator for a Map object.

Since:
2.0
Author:
Juergen Hoeller
See Also:
Map, Serialized Form

Field Summary
Fields inherited from interface org.springframework.validation.BindingResult
MODEL_KEY_PREFIX
Fields inherited from interface org.springframework.validation.Errors
NESTED_PATH_SEPARATOR
Constructor Summary
MapBindingResult(Map target, String objectName)
Create a new MapBindingResult instance.
Method Summary
protected Object | getActualFieldValue(String field) Extract the actual field value for the given field.
Object | getTarget() Return the wrapped target object.
Map | getTargetMap()
Methods inherited from class org.springframework.validation.AbstractBindingResult
addAllErrors, addError, equals, findEditor, formatFieldValue, getAllErrors, getErrorCount, getFieldError, getFieldError, getFieldErrors, getFieldErrors, getFieldType, getFieldValue, getGlobalError, getGlobalErrors, getMessageCodesResolver, getModel, getObjectName, getPropertyEditorRegistry, getRawFieldValue, getSuppressedFields, hasErrors, hashCode, recordSuppressedField, reject, rejectValue, resolveMessageCodes, resolveMessageCodes, setMessageCodesResolver
Methods inherited from class org.springframework.validation.AbstractErrors
canonicalFieldName, doSetNestedPath, fixedField, getFieldErrorCount, getFieldErrorCount, getGlobalErrorCount, getNestedPath, hasFieldErrors, hasFieldErrors, hasGlobalErrors, isMatchingFieldError, popNestedPath, pushNestedPath, reject, reject, rejectValue, rejectValue, setNestedPath, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.validation.Errors
getFieldErrorCount, getFieldErrorCount, getGlobalErrorCount, getNestedPath, hasFieldErrors, hasFieldErrors, hasGlobalErrors, popNestedPath, pushNestedPath, reject, reject, rejectValue, rejectValue, setNestedPath

Constructor Detail

MapBindingResult

public MapBindingResult(Map target,
                        String objectName)
Create a new MapBindingResult instance.

Parameters:
target - the target Map to bind onto
objectName - the name of the target object
Method Detail

getTargetMap

public final Map getTargetMap()

getTarget

public final Object getTarget()
Description copied from class: AbstractBindingResult
Return the wrapped target object.

Specified by:
getTarget in interface BindingResult
Specified by:
getTarget in class AbstractBindingResult

getActualFieldValue

protected Object getActualFieldValue(String field)
Description copied from class: AbstractBindingResult
Extract the actual field value for the given field.

Specified by:
getActualFieldValue in class AbstractBindingResult
Parameters:
field - the field to check
Returns:
the current value of the field
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ObjectError

org.springframework.validation
Class ObjectError

java.lang.Object
    extended by  org.springframework.context.support.DefaultMessageSourceResolvable
        extended by  org.springframework.validation.ObjectError
All Implemented Interfaces:
Serializable, MessageSourceResolvable
Direct Known Subclasses:
FieldError
public class ObjectError
extends DefaultMessageSourceResolvable

Encapsulates an object error, that is, a global reason for rejecting an object.

See the DefaultMessageCodesResolver javadoc for details on how a message code list is built for an ObjectError.

Since:
10.03.2003
Author:
Juergen Hoeller
See Also:
FieldError, DefaultMessageCodesResolver, Serialized Form

Constructor Summary
ObjectError(String objectName, String defaultMessage)
Create a new instance of the ObjectError class.
ObjectError(String objectName, String[] codes, Object[] arguments, String defaultMessage)
Create a new instance of the ObjectError class.
Method Summary
boolean | equals(Object other)
String | getObjectName() Return the name of the affected object.
int | hashCode()
String | toString() Default implementation exposes the attributes of this MessageSourceResolvable.
Methods inherited from class org.springframework.context.support.DefaultMessageSourceResolvable
getArguments, getCode, getCodes, getDefaultMessage, resolvableToString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

ObjectError

public ObjectError(String objectName,
                   String defaultMessage)
Create a new instance of the ObjectError class.

Parameters:
objectName - the name of the affected object
defaultMessage - the default message to be used to resolve this message

ObjectError

public ObjectError(String objectName,
                   String[] codes,
                   Object[] arguments,
                   String defaultMessage)
Create a new instance of the ObjectError class.

Parameters:
objectName - the name of the affected object
codes - the codes to be used to resolve this message
arguments - the array of arguments to be used to resolve this message
defaultMessage - the default message to be used to resolve this message
Method Detail

getObjectName

public String getObjectName()
Return the name of the affected object.

toString

public String toString()
Description copied from class: DefaultMessageSourceResolvable
Default implementation exposes the attributes of this MessageSourceResolvable. To be overridden in more specific subclasses, potentially including the resolvable content through resolvableToString().

Overrides:
toString in class DefaultMessageSourceResolvable
See Also:
DefaultMessageSourceResolvable.resolvableToString()

equals

public boolean equals(Object other)
Overrides:
equals in class DefaultMessageSourceResolvable

hashCode

public int hashCode()
Overrides:
hashCode in class DefaultMessageSourceResolvable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ValidationUtils

org.springframework.validation
Class ValidationUtils

java.lang.Object
    extended by  org.springframework.validation.ValidationUtils

public abstract class ValidationUtils
extends Object

Utility class offering convenient methods for invoking a Validator and for rejecting empty fields.

Checks for an empty field in Validator implementations can become one-liners when using rejectIfEmpty(org.springframework.validation.Errors, java.lang.String, java.lang.String) or rejectIfEmptyOrWhitespace(org.springframework.validation.Errors, java.lang.String, java.lang.String).

Since:
06.05.2003
Author:
Juergen Hoeller, Dmitriy Kopylenko
See Also:
Validator, Errors

Constructor Summary
ValidationUtils()
Method Summary
static void | invokeValidator(Validator validator, Object obj, Errors errors) Invoke the given Validator for the supplied object and Errors instance.
static void | rejectIfEmpty(Errors errors, String field, String errorCode) Reject the given field with the given error code if the value is empty.
static void | rejectIfEmpty(Errors errors, String field, String errorCode, Object[] errorArgs) Reject the given field with the given error codea nd error arguments if the value is empty.
static void | rejectIfEmpty(Errors errors, String field, String errorCode, Object[] errorArgs, String defaultMessage) Reject the given field with the given error code, error arguments and default message if the value is empty.
static void | rejectIfEmpty(Errors errors, String field, String errorCode, String defaultMessage) Reject the given field with the given error code and default message if the value is empty.
static void | rejectIfEmptyOrWhitespace(Errors errors, String field, String errorCode) Reject the given field with the given error code if the value is empty or just contains whitespace.
static void | rejectIfEmptyOrWhitespace(Errors errors, String field, String errorCode, Object[] errorArgs) Reject the given field with the given error code and error arguments if the value is empty or just contains whitespace.
static void | rejectIfEmptyOrWhitespace(Errors errors, String field, String errorCode, Object[] errorArgs, String defaultMessage) Reject the given field with the given error code, error arguments and default message if the value is empty or just contains whitespace.
static void | rejectIfEmptyOrWhitespace(Errors errors, String field, String errorCode, String defaultMessage) Reject the given field with the given error code and default message if the value is empty or just contains whitespace.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ValidationUtils

public ValidationUtils()
Method Detail

invokeValidator

public static void invokeValidator(Validator validator,
                                   Object obj,
                                   Errors errors)
Invoke the given Validator for the supplied object and Errors instance.

Parameters:
validator - the Validator to be invoked (must not be null)
obj - the object to bind the parameters to
errors - the Errors instance that should store the errors (must not be null)
Throws:
IllegalArgumentException - if either of the Validator or Errors arguments is null; or if the supplied Validator does not support the validation of the supplied object's type

rejectIfEmpty

public static void rejectIfEmpty(Errors errors,
                                 String field,
                                 String errorCode)
Reject the given field with the given error code if the value is empty.

An 'empty' value in this context means either null or the empty string "".

The object whose field is being validated does not need to be passed in because the Errors instance can resolve field values by itself (it will usually hold an internal reference to the target object).

Parameters:
errors - the Errors instance to register errors on
field - the field name to check
errorCode - the error code, interpretable as message key

rejectIfEmpty

public static void rejectIfEmpty(Errors errors,
                                 String field,
                                 String errorCode,
                                 String defaultMessage)
Reject the given field with the given error code and default message if the value is empty.

An 'empty' value in this context means either null or the empty string "".

The object whose field is being validated does not need to be passed in because the Errors instance can resolve field values by itself (it will usually hold an internal reference to the target object).

Parameters:
errors - the Errors instance to register errors on
field - the field name to check
errorCode - error code, interpretable as message key
defaultMessage - fallback default message

rejectIfEmpty

public static void rejectIfEmpty(Errors errors,
                                 String field,
                                 String errorCode,
                                 Object[] errorArgs)
Reject the given field with the given error codea nd error arguments if the value is empty.

An 'empty' value in this context means either null or the empty string "".

The object whose field is being validated does not need to be passed in because the Errors instance can resolve field values by itself (it will usually hold an internal reference to the target object).

Parameters:
errors - the Errors instance to register errors on
field - the field name to check
errorCode - the error code, interpretable as message key
errorArgs - the error arguments, for argument binding via MessageFormat (can be null)

rejectIfEmpty

public static void rejectIfEmpty(Errors errors,
                                 String field,
                                 String errorCode,
                                 Object[] errorArgs,
                                 String defaultMessage)
Reject the given field with the given error code, error arguments and default message if the value is empty.

An 'empty' value in this context means either null or the empty string "".

The object whose field is being validated does not need to be passed in because the Errors instance can resolve field values by itself (it will usually hold an internal reference to the target object).

Parameters:
errors - the Errors instance to register errors on
field - the field name to check
errorCode - the error code, interpretable as message key
errorArgs - the error arguments, for argument binding via MessageFormat (can be null)
defaultMessage - fallback default message

rejectIfEmptyOrWhitespace

public static void rejectIfEmptyOrWhitespace(Errors errors,
                                             String field,
                                             String errorCode)
Reject the given field with the given error code if the value is empty or just contains whitespace.

An 'empty' value in this context means either null, the empty string "", or consisting wholly of whitespace.

The object whose field is being validated does not need to be passed in because the Errors instance can resolve field values by itself (it will usually hold an internal reference to the target object).

Parameters:
errors - the Errors instance to register errors on
field - the field name to check
errorCode - the error code, interpretable as message key

rejectIfEmptyOrWhitespace

public static void rejectIfEmptyOrWhitespace(Errors errors,
                                             String field,
                                             String errorCode,
                                             String defaultMessage)
Reject the given field with the given error code and default message if the value is empty or just contains whitespace.

An 'empty' value in this context means either null, the empty string "", or consisting wholly of whitespace.

The object whose field is being validated does not need to be passed in because the Errors instance can resolve field values by itself (it will usually hold an internal reference to the target object).

Parameters:
errors - the Errors instance to register errors on
field - the field name to check
errorCode - the error code, interpretable as message key
defaultMessage - fallback default message

rejectIfEmptyOrWhitespace

public static void rejectIfEmptyOrWhitespace(Errors errors,
                                             String field,
                                             String errorCode,
                                             Object[] errorArgs)
Reject the given field with the given error code and error arguments if the value is empty or just contains whitespace.

An 'empty' value in this context means either null, the empty string "", or consisting wholly of whitespace.

The object whose field is being validated does not need to be passed in because the Errors instance can resolve field values by itself (it will usually hold an internal reference to the target object).

Parameters:
errors - the Errors instance to register errors on
field - the field name to check
errorCode - the error code, interpretable as message key
errorArgs - the error arguments, for argument binding via MessageFormat (can be null)

rejectIfEmptyOrWhitespace

public static void rejectIfEmptyOrWhitespace(Errors errors,
                                             String field,
                                             String errorCode,
                                             Object[] errorArgs,
                                             String defaultMessage)
Reject the given field with the given error code, error arguments and default message if the value is empty or just contains whitespace.

An 'empty' value in this context means either null, the empty string "", or consisting wholly of whitespace.

The object whose field is being validated does not need to be passed in because the Errors instance can resolve field values by itself (it will usually hold an internal reference to the target object).

Parameters:
errors - the Errors instance to register errors on
field - the field name to check
errorCode - the error code, interpretable as message key
errorArgs - the error arguments, for argument binding via MessageFormat (can be null)
defaultMessage - fallback default message
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BindException

org.springframework.validation
Class BindException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  org.springframework.validation.BindException
All Implemented Interfaces:
Serializable, BindingResult, Errors
public class BindException
extends Exception
implements BindingResult

Thrown when binding errors are considered fatal. Implements the BindingResult interface (and its super-interface Errors) to allow for the direct analysis of binding errors.

As of Spring 2.0, this is a special-purpose class. Normally, application code will work with the BindingResult interface, or with a DataBinder that in turn exposes a BindingResult via DataBinder.getBindingResult().

Author:
Rod Johnson, Juergen Hoeller, Rob Harrop
See Also:
BindingResult, DataBinder.getBindingResult(), DataBinder.close(), Serialized Form

Field Summary
Fields inherited from interface org.springframework.validation.BindingResult
MODEL_KEY_PREFIX
Fields inherited from interface org.springframework.validation.Errors
NESTED_PATH_SEPARATOR
Constructor Summary
BindException(BindingResult bindingResult)
Create a new BindException instance for a BindingResult.
BindException(Object target, String objectName)
Create a new BindException instance for a target bean.
Method Summary
void | addAllErrors(Errors errors) Add all errors from the given Errors instance to this Errors instance.
void | addError(ObjectError error) Add a custom ObjectError or FieldError to the errors list.
boolean | equals(Object other)
PropertyEditor | findEditor(String field, Class valueType) Find a custom property editor for the given type and property.
List | getAllErrors() Get all errors, both global and field ones.
BindingResult | getBindingResult() Return the BindingResult that this BindException wraps.
int | getErrorCount() Return the total number of errors.
FieldError | getFieldError() Get the first error associated with a field, if any.
FieldError | getFieldError(String field) Get the first error associated with the given field, if any.
int | getFieldErrorCount() Return the number of errors associated with a field.
int | getFieldErrorCount(String field) Return the number of errors associated with the given field.
List | getFieldErrors() Get all errors associated with a field.
List | getFieldErrors(String field) Get all errors associated with the given field.
Class | getFieldType(String field) Return the type of a given field.
Object | getFieldValue(String field) Return the current value of the given field, either the current bean property value or a rejected update from the last binding.
ObjectError | getGlobalError() Get the first global error, if any.
int | getGlobalErrorCount() Return the number of global errors.
List | getGlobalErrors() Get all global errors.
String | getMessage() Returns diagnostic information about the errors held in this object.
Map<String,Object> | getModel() Return a model Map for the obtained state, exposing a BindingResult instance as 'MODEL_KEY_PREFIX + objectName' and the object itself as 'objectName'.
String | getNestedPath() Return the current nested path of this Errors object.
String | getObjectName() Return the name of the bound root object.
PropertyEditorRegistry | getPropertyEditorRegistry() Return the underlying PropertyEditorRegistry.
Object | getRawFieldValue(String field) Extract the raw field value for the given field.
String[] | getSuppressedFields() Return the list of fields that were suppressed during the bind process.
Object | getTarget() Return the wrapped target object, which may be a bean, an object with public fields, a Map - depending on the concrete binding strategy.
boolean | hasErrors() Return if there were any errors.
boolean | hasFieldErrors() Are there any field errors?
boolean | hasFieldErrors(String field) Are there any errors associated with the given field?
boolean | hasGlobalErrors() Are there any global errors?
int | hashCode()
void | popNestedPath() Pop the former nested path from the nested path stack.
void | pushNestedPath(String subPath) Push the given sub path onto the nested path stack.
void | recordSuppressedField(String field) Mark the specified disallowed field as suppressed.
void | reject(String errorCode) Register a global error for the entire target object, using the given error description.
void | reject(String errorCode, Object[] errorArgs, String defaultMessage) Register a global error for the entire target object, using the given error description.
void | reject(String errorCode, String defaultMessage) Register a global error for the entire target object, using the given error description.
void | rejectValue(String field, String errorCode) Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description.
void | rejectValue(String field, String errorCode, Object[] errorArgs, String defaultMessage) Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description.
void | rejectValue(String field, String errorCode, String defaultMessage) Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description.
String[] | resolveMessageCodes(String errorCode, String field) Resolve the given error code into message codes for the given field.
void | setNestedPath(String nestedPath) Allow context to be changed so that standard validators can validate subtrees.
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

BindException

public BindException(BindingResult bindingResult)
Create a new BindException instance for a BindingResult.

Parameters:
bindingResult - the BindingResult instance to wrap

BindException

public BindException(Object target,
                     String objectName)
Create a new BindException instance for a target bean.

Parameters:
target - target bean to bind onto
objectName - the name of the target object
See Also:
BeanPropertyBindingResult
Method Detail

getBindingResult

public final BindingResult getBindingResult()
Return the BindingResult that this BindException wraps. Will typically be a BeanPropertyBindingResult.

See Also:
BeanPropertyBindingResult

getObjectName

public String getObjectName()
Description copied from interface: Errors
Return the name of the bound root object.

Specified by:
getObjectName in interface Errors

setNestedPath

public void setNestedPath(String nestedPath)
Description copied from interface: Errors
Allow context to be changed so that standard validators can validate subtrees. Reject calls prepend the given path to the field names.

For example, an address validator could validate the subobject "address" of a customer object.

Specified by:
setNestedPath in interface Errors
Parameters:
nestedPath - nested path within this object, e.g. "address" (defaults to "", null is also acceptable). Can end with a dot: both "address" and "address." are valid.

getNestedPath

public String getNestedPath()
Description copied from interface: Errors
Return the current nested path of this Errors object.

Returns a nested path with a dot, i.e. "address.", for easy building of concatenated paths. Default is an empty String.

Specified by:
getNestedPath in interface Errors

pushNestedPath

public void pushNestedPath(String subPath)
Description copied from interface: Errors
Push the given sub path onto the nested path stack.

A Errors.popNestedPath() call will reset the original nested path before the corresponding pushNestedPath(String) call.

Using the nested path stack allows to set temporary nested paths for subobjects without having to worry about a temporary path holder.

For example: current path "spouse.", pushNestedPath("child") -> result path "spouse.child."; popNestedPath() -> "spouse." again.

Specified by:
pushNestedPath in interface Errors
Parameters:
subPath - the sub path to push onto the nested path stack
See Also:
Errors.popNestedPath()

popNestedPath

public void popNestedPath()
                   throws IllegalStateException
Description copied from interface: Errors
Pop the former nested path from the nested path stack.

Specified by:
popNestedPath in interface Errors
Throws:
IllegalStateException - if there is no former nested path on the stack
See Also:
Errors.pushNestedPath(java.lang.String)

reject

public void reject(String errorCode)
Description copied from interface: Errors
Register a global error for the entire target object, using the given error description.

Specified by:
reject in interface Errors
Parameters:
errorCode - error code, interpretable as a message key

reject

public void reject(String errorCode,
                   String defaultMessage)
Description copied from interface: Errors
Register a global error for the entire target object, using the given error description.

Specified by:
reject in interface Errors
Parameters:
errorCode - error code, interpretable as a message key
defaultMessage - fallback default message

reject

public void reject(String errorCode,
                   Object[] errorArgs,
                   String defaultMessage)
Description copied from interface: Errors
Register a global error for the entire target object, using the given error description.

Specified by:
reject in interface Errors
Parameters:
errorCode - error code, interpretable as a message key
errorArgs - error arguments, for argument binding via MessageFormat (can be null)
defaultMessage - fallback default message

rejectValue

public void rejectValue(String field,
                        String errorCode)
Description copied from interface: Errors
Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description.

The field name may be null or empty String to indicate the current object itself rather than a field of it. This may result in a corresponding field error within the nested object graph or a global error if the current object is the top object.

Specified by:
rejectValue in interface Errors
Parameters:
field - the field name (may be null or empty String)
errorCode - error code, interpretable as a message key
See Also:
Errors.getNestedPath()

rejectValue

public void rejectValue(String field,
                        String errorCode,
                        String defaultMessage)
Description copied from interface: Errors
Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description.

The field name may be null or empty String to indicate the current object itself rather than a field of it. This may result in a corresponding field error within the nested object graph or a global error if the current object is the top object.

Specified by:
rejectValue in interface Errors
Parameters:
field - the field name (may be null or empty String)
errorCode - error code, interpretable as a message key
defaultMessage - fallback default message
See Also:
Errors.getNestedPath()

rejectValue

public void rejectValue(String field,
                        String errorCode,
                        Object[] errorArgs,
                        String defaultMessage)
Description copied from interface: Errors
Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description.

The field name may be null or empty String to indicate the current object itself rather than a field of it. This may result in a corresponding field error within the nested object graph or a global error if the current object is the top object.

Specified by:
rejectValue in interface Errors
Parameters:
field - the field name (may be null or empty String)
errorCode - error code, interpretable as a message key
errorArgs - error arguments, for argument binding via MessageFormat (can be null)
defaultMessage - fallback default message
See Also:
Errors.getNestedPath()

addAllErrors

public void addAllErrors(Errors errors)
Description copied from interface: Errors
Add all errors from the given Errors instance to this Errors instance.

This is a onvenience method to avoid repeated reject(..) calls for merging an Errors instance into another Errors instance.

Note that the passed-in Errors instance is supposed to refer to the same target object, or at least contain compatible errors that apply to the target object of this Errors instance.

Specified by:
addAllErrors in interface Errors
Parameters:
errors - the Errors instance to merge in

hasErrors

public boolean hasErrors()
Description copied from interface: Errors
Return if there were any errors.

Specified by:
hasErrors in interface Errors

getErrorCount

public int getErrorCount()
Description copied from interface: Errors
Return the total number of errors.

Specified by:
getErrorCount in interface Errors

getAllErrors

public List getAllErrors()
Description copied from interface: Errors
Get all errors, both global and field ones.

Specified by:
getAllErrors in interface Errors
Returns:
List of ObjectError instances

hasGlobalErrors

public boolean hasGlobalErrors()
Description copied from interface: Errors
Are there any global errors?

Specified by:
hasGlobalErrors in interface Errors
Returns:
true if there are any global errors
See Also:
Errors.hasFieldErrors()

getGlobalErrorCount

public int getGlobalErrorCount()
Description copied from interface: Errors
Return the number of global errors.

Specified by:
getGlobalErrorCount in interface Errors
Returns:
the number of global errors
See Also:
Errors.getFieldErrorCount()

getGlobalErrors

public List getGlobalErrors()
Description copied from interface: Errors
Get all global errors.

Specified by:
getGlobalErrors in interface Errors
Returns:
List of ObjectError instances

getGlobalError

public ObjectError getGlobalError()
Description copied from interface: Errors
Get the first global error, if any.

Specified by:
getGlobalError in interface Errors
Returns:
the global error, or null

hasFieldErrors

public boolean hasFieldErrors()
Description copied from interface: Errors
Are there any field errors?

Specified by:
hasFieldErrors in interface Errors
Returns:
true if there are any errors associated with a field
See Also:
Errors.hasGlobalErrors()

getFieldErrorCount

public int getFieldErrorCount()
Description copied from interface: Errors
Return the number of errors associated with a field.

Specified by:
getFieldErrorCount in interface Errors
Returns:
the number of errors associated with a field
See Also:
Errors.getGlobalErrorCount()

getFieldErrors

public List getFieldErrors()
Description copied from interface: Errors
Get all errors associated with a field.

Specified by:
getFieldErrors in interface Errors
Returns:
a List of FieldError instances

getFieldError

public FieldError getFieldError()
Description copied from interface: Errors
Get the first error associated with a field, if any.

Specified by:
getFieldError in interface Errors
Returns:
the field-specific error, or null

hasFieldErrors

public boolean hasFieldErrors(String field)
Description copied from interface: Errors
Are there any errors associated with the given field?

Specified by:
hasFieldErrors in interface Errors
Parameters:
field - the field name
Returns:
true if there were any errors associated with the given field

getFieldErrorCount

public int getFieldErrorCount(String field)
Description copied from interface: Errors
Return the number of errors associated with the given field.

Specified by:
getFieldErrorCount in interface Errors
Parameters:
field - the field name
Returns:
the number of errors associated with the given field

getFieldErrors

public List getFieldErrors(String field)
Description copied from interface: Errors
Get all errors associated with the given field.

Implementations should support not only full field names like "name" but also pattern matches like "na*" or "address.*".

Specified by:
getFieldErrors in interface Errors
Parameters:
field - the field name
Returns:
a List of FieldError instances

getFieldError

public FieldError getFieldError(String field)
Description copied from interface: Errors
Get the first error associated with the given field, if any.

Specified by:
getFieldError in interface Errors
Parameters:
field - the field name
Returns:
the field-specific error, or null

getFieldValue

public Object getFieldValue(String field)
Description copied from interface: Errors
Return the current value of the given field, either the current bean property value or a rejected update from the last binding.

Allows for convenient access to user-specified field values, even if there were type mismatches.

Specified by:
getFieldValue in interface Errors
Parameters:
field - the field name
Returns:
the current value of the given field

getFieldType

public Class getFieldType(String field)
Description copied from interface: Errors
Return the type of a given field.

Implementations should be able to determine the type even when the field value is null, for example from some associated descriptor.

Specified by:
getFieldType in interface Errors
Parameters:
field - the field name
Returns:
the type of the field, or null if not determinable

getTarget

public Object getTarget()
Description copied from interface: BindingResult
Return the wrapped target object, which may be a bean, an object with public fields, a Map - depending on the concrete binding strategy.

Specified by:
getTarget in interface BindingResult

getModel

public Map<String,Object> getModel()
Description copied from interface: BindingResult
Return a model Map for the obtained state, exposing a BindingResult instance as 'MODEL_KEY_PREFIX + objectName' and the object itself as 'objectName'.

Note that the Map is constructed every time you're calling this method. Adding things to the map and then re-calling this method will not work.

The attributes in the model Map returned by this method are usually included in the ModelAndView for a form view that uses Spring's bind tag in a JSP, which needs access to the BindingResult instance. Spring's pre-built form controllers will do this for you when rendering a form view. When building the ModelAndView instance yourself, you need to include the attributes from the model Map returned by this method.

Specified by:
getModel in interface BindingResult
See Also:
Errors.getObjectName(), BindingResult.MODEL_KEY_PREFIX, ModelAndView, BindTag, SimpleFormController

getRawFieldValue

public Object getRawFieldValue(String field)
Description copied from interface: BindingResult
Extract the raw field value for the given field. Typically used for comparison purposes.

Specified by:
getRawFieldValue in interface BindingResult
Parameters:
field - the field to check
Returns:
the current value of the field in its raw form, or null if not known

findEditor

public PropertyEditor findEditor(String field,
                                 Class valueType)
Description copied from interface: BindingResult
Find a custom property editor for the given type and property.

Specified by:
findEditor in interface BindingResult
Parameters:
field - the path of the property (name or nested path), or null if looking for an editor for all properties of the given type
valueType - the type of the property (can be null if a property is given but should be specified in any case for consistency checking)
Returns:
the registered editor, or null if none

getPropertyEditorRegistry

public PropertyEditorRegistry getPropertyEditorRegistry()
Description copied from interface: BindingResult
Return the underlying PropertyEditorRegistry.

Specified by:
getPropertyEditorRegistry in interface BindingResult
Returns:
the PropertyEditorRegistry, or null if none available for this BindingResult

addError

public void addError(ObjectError error)
Description copied from interface: BindingResult
Add a custom ObjectError or FieldError to the errors list.

Intended to be used by cooperating strategies such as BindingErrorProcessor.

Specified by:
addError in interface BindingResult
See Also:
ObjectError, FieldError, BindingErrorProcessor

resolveMessageCodes

public String[] resolveMessageCodes(String errorCode,
                                    String field)
Description copied from interface: BindingResult
Resolve the given error code into message codes for the given field.

Calls the configured MessageCodesResolver with appropriate parameters.

Specified by:
resolveMessageCodes in interface BindingResult
Parameters:
errorCode - the error code to resolve into message codes
field - the field to resolve message codes for
Returns:
the resolved message codes

recordSuppressedField

public void recordSuppressedField(String field)
Description copied from interface: BindingResult
Mark the specified disallowed field as suppressed.

The data binder invokes this for each field value that was detected to target a disallowed field.

Specified by:
recordSuppressedField in interface BindingResult
See Also:
DataBinder.setAllowedFields(java.lang.String...)

getSuppressedFields

public String[] getSuppressedFields()
Description copied from interface: BindingResult
Return the list of fields that were suppressed during the bind process.

Can be used to determine whether any field values were targeting disallowed fields.

Specified by:
getSuppressedFields in interface BindingResult
See Also:
DataBinder.setAllowedFields(java.lang.String...)

getMessage

public String getMessage()
Returns diagnostic information about the errors held in this object.

Overrides:
getMessage in class Throwable

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.validation.beanvalidation

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.validation.beanvalidation

Support classes for integrating a JSR-303 Bean Validation provider (such as Hibernate Validator 4.0) into a Spring ApplicationContext and in particular with Spring's data binding and validation APIs.

See:
Description

Class Summary
BeanValidationPostProcessor | Simple BeanPostProcessor that checks JSR-303 constraint annotations in Spring-managed beans, throwing an initialization exception in case of constraint violations right before calling the bean's init method (if any).
CustomValidatorBean | Configurable bean class that exposes a specific JSR-303 Validator through its original interface as well as through the Spring Validator interface.
LocaleContextMessageInterpolator | Delegates to a target MessageInterpolator implementation but enforces Spring's managed Locale.
LocalValidatorFactoryBean | This is the central class for javax.validation (JSR-303) setup in a Spring application context: It bootstraps a javax.validation.ValidationFactory and exposes it through the Spring Validator interface as well as through the JSR-303 Validator interface and the ValidatorFactory interface itself.
SpringConstraintValidatorFactory | JSR-303 ConstraintValidatorFactory implementation that delegates to a Spring BeanFactory for creating autowired ConstraintValidator instances.
SpringValidatorAdapter | Adapter that takes a JSR-303 javax.validator.Validator and exposes it as a Spring Validator while also exposing the original JSR-303 Validator interface itself.

Package org.springframework.validation.beanvalidation Description

Support classes for integrating a JSR-303 Bean Validation provider (such as Hibernate Validator 4.0) into a Spring ApplicationContext and in particular with Spring's data binding and validation APIs.

The central class is LocalValidatorFactoryBean which defines a shared ValidatorFactory/Validator setup for availability to other Spring components.


org.springframework.validation.beanvalidation Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.validation.beanvalidation

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.validation.beanvalidation.BeanValidationPostProcessor (implements org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.beans.factory.InitializingBean)
    • org.springframework.validation.beanvalidation.LocaleContextMessageInterpolator (implements javax.validation.MessageInterpolator)
    • org.springframework.validation.beanvalidation.SpringConstraintValidatorFactory (implements javax.validation.ConstraintValidatorFactory)
    • org.springframework.validation.beanvalidation.SpringValidatorAdapter (implements org.springframework.validation.Validator, javax.validation.Validator)
      • org.springframework.validation.beanvalidation.CustomValidatorBean (implements org.springframework.beans.factory.InitializingBean, javax.validation.Validator)
      • org.springframework.validation.beanvalidation.LocalValidatorFactoryBean (implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean, javax.validation.ValidatorFactory)


BeanValidationPostProcessor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.validation.beanvalidation
Class BeanValidationPostProcessor

java.lang.Object
    extended by  org.springframework.validation.beanvalidation.BeanValidationPostProcessor
All Implemented Interfaces:
BeanPostProcessor, InitializingBean
public class BeanValidationPostProcessor
extends Object
implements BeanPostProcessor, InitializingBean

Simple BeanPostProcessor that checks JSR-303 constraint annotations in Spring-managed beans, throwing an initialization exception in case of constraint violations right before calling the bean's init method (if any).

Since:
3.0
Author:
Juergen Hoeller

Constructor Summary
BeanValidationPostProcessor()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected void | doValidate(Object bean) Perform validation of the given bean.
Object | postProcessAfterInitialization(Object bean, String beanName) Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).
Object | postProcessBeforeInitialization(Object bean, String beanName) Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).
void | setAfterInitialization(boolean afterInitialization) Choose whether to perform validation after bean initialization (i.e.
void | setValidator(javax.validation.Validator validator) Set the JSR-303 Validator to delegate to for validating beans.
void | setValidatorFactory(javax.validation.ValidatorFactory validatorFactory) Set the JSR-303 ValidatorFactory to delegate to for validating beans, using its default Validator.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BeanValidationPostProcessor

public BeanValidationPostProcessor()
Method Detail

setValidator

public void setValidator(javax.validation.Validator validator)
Set the JSR-303 Validator to delegate to for validating beans.

Default is the default ValidatorFactory's default Validator.

setValidatorFactory

public void setValidatorFactory(javax.validation.ValidatorFactory validatorFactory)
Set the JSR-303 ValidatorFactory to delegate to for validating beans, using its default Validator.

Default is the default ValidatorFactory's default Validator.

See Also:
ValidatorFactory.getValidator()

setAfterInitialization

public void setAfterInitialization(boolean afterInitialization)
Choose whether to perform validation after bean initialization (i.e. after init methods) instead of before (which is the default).

Default is "false" (before initialization). Switch this to "true" (after initialization) if you would like to give init methods a chance to populate constrained fields before they get validated.

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

postProcessBeforeInitialization

public Object postProcessBeforeInitialization(Object bean,
                                              String beanName)
                                       throws BeansException
Description copied from interface: BeanPostProcessor
Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

Specified by:
postProcessBeforeInitialization in interface BeanPostProcessor
Parameters:
bean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
Throws:
BeansException - in case of errors
See Also:
InitializingBean.afterPropertiesSet()

postProcessAfterInitialization

public Object postProcessAfterInitialization(Object bean,
                                             String beanName)
                                      throws BeansException
Description copied from interface: BeanPostProcessor
Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

In case of a FactoryBean, this callback will be invoked for both the FactoryBean instance and the objects created by the FactoryBean (as of Spring 2.0). The post-processor can decide whether to apply to either the FactoryBean or created objects or both through corresponding bean instanceof FactoryBean checks.

This callback will also be invoked after a short-circuiting triggered by a InstantiationAwareBeanPostProcessor.postProcessBeforeInstantiation(java.lang.Class, java.lang.String) method, in contrast to all other BeanPostProcessor callbacks.

Specified by:
postProcessAfterInitialization in interface BeanPostProcessor
Parameters:
bean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
Throws:
BeansException - in case of errors
See Also:
InitializingBean.afterPropertiesSet(), FactoryBean

doValidate

protected void doValidate(Object bean)
Perform validation of the given bean.

Parameters:
bean - the bean instance to validate
See Also:
Validator.validate(T, java.lang.Class...)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


CustomValidatorBean

org.springframework.validation.beanvalidation
Class CustomValidatorBean

java.lang.Object
    extended by  org.springframework.validation.beanvalidation.SpringValidatorAdapter
        extended by  org.springframework.validation.beanvalidation.CustomValidatorBean
All Implemented Interfaces:
javax.validation.Validator, InitializingBean
public class CustomValidatorBean
extends SpringValidatorAdapter
implements javax.validation.Validator, InitializingBean

Configurable bean class that exposes a specific JSR-303 Validator through its original interface as well as through the Spring Validator interface.

Since:
3.0
Author:
Juergen Hoeller

Constructor Summary
CustomValidatorBean()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
void | setMessageInterpolator(javax.validation.MessageInterpolator messageInterpolator) Specify a custom MessageInterpolator to use for this Validator.
void | setTraversableResolver(javax.validation.TraversableResolver traversableResolver) Specify a custom TraversableResolver to use for this Validator.
void | setValidatorFactory(javax.validation.ValidatorFactory validatorFactory) Set the ValidatorFactory to obtain the target Validator from.
Methods inherited from class org.springframework.validation.beanvalidation.SpringValidatorAdapter
getArgumentsForConstraint, getConstraintsForClass, supports, unwrap, validate, validate, validateProperty, validateValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.validation.Validator
getConstraintsForClass, unwrap, validate, validateProperty, validateValue

Constructor Detail

CustomValidatorBean

public CustomValidatorBean()
Method Detail

setValidatorFactory

public void setValidatorFactory(javax.validation.ValidatorFactory validatorFactory)
Set the ValidatorFactory to obtain the target Validator from.

Default is Validation.buildDefaultValidatorFactory().

setMessageInterpolator

public void setMessageInterpolator(javax.validation.MessageInterpolator messageInterpolator)
Specify a custom MessageInterpolator to use for this Validator.

setTraversableResolver

public void setTraversableResolver(javax.validation.TraversableResolver traversableResolver)
Specify a custom TraversableResolver to use for this Validator.

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LocaleContextMessageInterpolator

org.springframework.validation.beanvalidation
Class LocaleContextMessageInterpolator

java.lang.Object
    extended by  org.springframework.validation.beanvalidation.LocaleContextMessageInterpolator
All Implemented Interfaces:
javax.validation.MessageInterpolator
public class LocaleContextMessageInterpolator
extends Object
implements javax.validation.MessageInterpolator

Delegates to a target MessageInterpolator implementation but enforces Spring's managed Locale. Typically used to wrap the validation provider's default interpolator.

Since:
3.0
Author:
Juergen Hoeller
See Also:
LocaleContextHolder.getLocale()

Nested Class Summary
Nested classes/interfaces inherited from interface javax.validation.MessageInterpolator
javax.validation.MessageInterpolator.Context
Constructor Summary
LocaleContextMessageInterpolator(javax.validation.MessageInterpolator targetInterpolator)
Create a new LocaleContextMessageInterpolator, wrapping the given target interpolator.
Method Summary
String | interpolate(String message, javax.validation.MessageInterpolator.Context context)
String | interpolate(String message, javax.validation.MessageInterpolator.Context context, Locale locale)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

LocaleContextMessageInterpolator

public LocaleContextMessageInterpolator(javax.validation.MessageInterpolator targetInterpolator)
Create a new LocaleContextMessageInterpolator, wrapping the given target interpolator.

Parameters:
targetInterpolator - the target MessageInterpolator to wrap
Method Detail

interpolate

public String interpolate(String message,
                          javax.validation.MessageInterpolator.Context context)
Specified by:
interpolate in interface javax.validation.MessageInterpolator

interpolate

public String interpolate(String message,
                          javax.validation.MessageInterpolator.Context context,
                          Locale locale)
Specified by:
interpolate in interface javax.validation.MessageInterpolator
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LocalValidatorFactoryBean

org.springframework.validation.beanvalidation
Class LocalValidatorFactoryBean

java.lang.Object
    extended by  org.springframework.validation.beanvalidation.SpringValidatorAdapter
        extended by  org.springframework.validation.beanvalidation.LocalValidatorFactoryBean
All Implemented Interfaces:
javax.validation.Validator, javax.validation.ValidatorFactory, InitializingBean, ApplicationContextAware
public class LocalValidatorFactoryBean
extends SpringValidatorAdapter
implements javax.validation.ValidatorFactory, ApplicationContextAware, InitializingBean

This is the central class for javax.validation (JSR-303) setup in a Spring application context: It bootstraps a javax.validation.ValidationFactory and exposes it through the Spring Validator interface as well as through the JSR-303 Validator interface and the ValidatorFactory interface itself.

When talking to an instance of this bean through the Spring or JSR-303 Validator interfaces, you'll be talking to the default Validator of the underlying ValidatorFactory. This is very convenient in that you don't have to perform yet another call on the factory, assuming that you will almost always use the default Validator anyway. This can also be injected directly into any target dependency of type Validator!

Since:
3.0
Author:
Juergen Hoeller
See Also:
ValidatorFactory, Validator, Validation.buildDefaultValidatorFactory(), ValidatorFactory.getValidator()

Constructor Summary
LocalValidatorFactoryBean()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
javax.validation.ConstraintValidatorFactory | getConstraintValidatorFactory()
javax.validation.MessageInterpolator | getMessageInterpolator()
javax.validation.TraversableResolver | getTraversableResolver()
Map<String,String> | getValidationPropertyMap() Allow Map access to the bean validation properties to be passed to the validation provider, with the option to add or override specific entries.
javax.validation.Validator | getValidator()
void | setApplicationContext(ApplicationContext applicationContext) Set the ApplicationContext that this object runs in.
void | setConstraintValidatorFactory(javax.validation.ConstraintValidatorFactory constraintValidatorFactory) Specify a custom ConstraintValidatorFactory to use for this ValidatorFactory.
void | setMappingLocations(Resource[] mappingLocations) Specify resource locations to load XML constraint mapping files from, if any.
void | setMessageInterpolator(javax.validation.MessageInterpolator messageInterpolator) Specify a custom MessageInterpolator to use for this ValidatorFactory and its exposed default Validator.
void | setProviderClass(Class<? extends javax.validation.spi.ValidationProvider> providerClass) Specify the desired provider class, if any.
void | setTraversableResolver(javax.validation.TraversableResolver traversableResolver) Specify a custom TraversableResolver to use for this ValidatorFactory and its exposed default Validator.
void | setValidationProperties(Properties jpaProperties) Specify bean validation properties to be passed to the validation provider.
void | setValidationPropertyMap(Map<String,String> validationProperties) Specify bean validation properties to be passed to the validation provider as a Map.
javax.validation.ValidatorContext | usingContext()
Methods inherited from class org.springframework.validation.beanvalidation.SpringValidatorAdapter
getArgumentsForConstraint, getConstraintsForClass, supports, unwrap, validate, validate, validateProperty, validateValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.validation.ValidatorFactory
unwrap

Constructor Detail

LocalValidatorFactoryBean

public LocalValidatorFactoryBean()
Method Detail

setProviderClass

public void setProviderClass(Class<? extends javax.validation.spi.ValidationProvider> providerClass)
Specify the desired provider class, if any.

If not specified, JSR-303's default search mechanism will be used.

See Also:
Validation.byProvider(Class), Validation.byDefaultProvider()

setMessageInterpolator

public void setMessageInterpolator(javax.validation.MessageInterpolator messageInterpolator)
Specify a custom MessageInterpolator to use for this ValidatorFactory and its exposed default Validator.

setTraversableResolver

public void setTraversableResolver(javax.validation.TraversableResolver traversableResolver)
Specify a custom TraversableResolver to use for this ValidatorFactory and its exposed default Validator.

setConstraintValidatorFactory

public void setConstraintValidatorFactory(javax.validation.ConstraintValidatorFactory constraintValidatorFactory)
Specify a custom ConstraintValidatorFactory to use for this ValidatorFactory.

Default is a SpringConstraintValidatorFactory, delegating to the containing ApplicationContext for creating autowired ConstraintValidator instances.

setMappingLocations

public void setMappingLocations(Resource[] mappingLocations)
Specify resource locations to load XML constraint mapping files from, if any.

setValidationProperties

public void setValidationProperties(Properties jpaProperties)
Specify bean validation properties to be passed to the validation provider.

Can be populated with a String "value" (parsed via PropertiesEditor) or a "props" element in XML bean definitions.

See Also:
Configuration.addProperty(String, String)

setValidationPropertyMap

public void setValidationPropertyMap(Map<String,String> validationProperties)
Specify bean validation properties to be passed to the validation provider as a Map.

Can be populated with a "map" or "props" element in XML bean definitions.

See Also:
Configuration.addProperty(String, String)

getValidationPropertyMap

public Map<String,String> getValidationPropertyMap()
Allow Map access to the bean validation properties to be passed to the validation provider, with the option to add or override specific entries.

Useful for specifying entries directly, for example via "validationPropertyMap[myKey]".

setApplicationContext

public void setApplicationContext(ApplicationContext applicationContext)
Description copied from interface: ApplicationContextAware
Set the ApplicationContext that this object runs in. Normally this call will be used to initialize the object.

Invoked after population of normal bean properties but before an init callback such as InitializingBean.afterPropertiesSet() or a custom init-method. Invoked after ResourceLoaderAware.setResourceLoader(org.springframework.core.io.ResourceLoader), ApplicationEventPublisherAware.setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher) and MessageSourceAware, if applicable.

Specified by:
setApplicationContext in interface ApplicationContextAware
Parameters:
applicationContext - the ApplicationContext object to be used by this object
See Also:
BeanInitializationException

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

getValidator

public javax.validation.Validator getValidator()
Specified by:
getValidator in interface javax.validation.ValidatorFactory

usingContext

public javax.validation.ValidatorContext usingContext()
Specified by:
usingContext in interface javax.validation.ValidatorFactory

getMessageInterpolator

public javax.validation.MessageInterpolator getMessageInterpolator()
Specified by:
getMessageInterpolator in interface javax.validation.ValidatorFactory

getTraversableResolver

public javax.validation.TraversableResolver getTraversableResolver()
Specified by:
getTraversableResolver in interface javax.validation.ValidatorFactory

getConstraintValidatorFactory

public javax.validation.ConstraintValidatorFactory getConstraintValidatorFactory()
Specified by:
getConstraintValidatorFactory in interface javax.validation.ValidatorFactory
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SpringConstraintValidatorFactory

org.springframework.validation.beanvalidation
Class SpringConstraintValidatorFactory

java.lang.Object
    extended by  org.springframework.validation.beanvalidation.SpringConstraintValidatorFactory
All Implemented Interfaces:
javax.validation.ConstraintValidatorFactory
public class SpringConstraintValidatorFactory
extends Object
implements javax.validation.ConstraintValidatorFactory

JSR-303 ConstraintValidatorFactory implementation that delegates to a Spring BeanFactory for creating autowired ConstraintValidator instances.

Since:
3.0
Author:
Juergen Hoeller
See Also:
AutowireCapableBeanFactory.createBean(Class), ApplicationContext.getAutowireCapableBeanFactory()

Constructor Summary
SpringConstraintValidatorFactory(AutowireCapableBeanFactory beanFactory)
Create a new SpringConstraintValidatorFactory for the given BeanFactory.
Method Summary
<T extends javax.validation.ConstraintValidator<?,?>>
T
getInstance(Class<T> key)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SpringConstraintValidatorFactory

public SpringConstraintValidatorFactory(AutowireCapableBeanFactory beanFactory)
Create a new SpringConstraintValidatorFactory for the given BeanFactory.

Parameters:
beanFactory - the target BeanFactory
Method Detail

getInstance

public <T extends javax.validation.ConstraintValidator<?,?>> T getInstance(Class<T> key)
Specified by:
getInstance in interface javax.validation.ConstraintValidatorFactory
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SpringValidatorAdapter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.validation.beanvalidation
Class SpringValidatorAdapter

java.lang.Object
    extended by  org.springframework.validation.beanvalidation.SpringValidatorAdapter
All Implemented Interfaces:
javax.validation.Validator
Direct Known Subclasses:
CustomValidatorBean, LocalValidatorFactoryBean
public class SpringValidatorAdapter
extends Object
implements Validator, javax.validation.Validator

Adapter that takes a JSR-303 javax.validator.Validator and exposes it as a Spring Validator while also exposing the original JSR-303 Validator interface itself.

Can be used as a programmatic wrapper. Also serves as base class for CustomValidatorBean and LocalValidatorFactoryBean.

Since:
3.0
Author:
Juergen Hoeller

Constructor Summary
SpringValidatorAdapter(javax.validation.Validator targetValidator)
Create a new SpringValidatorAdapter for the given JSR-303 Validator.
Method Summary
protected  Object[] getArgumentsForConstraint(String objectName, String field, javax.validation.metadata.ConstraintDescriptor<?> descriptor)
Return FieldError arguments for a validation error on the given field.
 javax.validation.metadata.BeanDescriptor getConstraintsForClass(Class<?> clazz)
 boolean supports(Class<?> clazz)
Can this Validator validate instances of the supplied clazz?
<T> T
unwrap(Class<T> type)
 void validate(Object target, Errors errors)
Validate the supplied target object, which must be of a Class for which the Validator.supports(Class) method typically has (or would) return true.
<T> Set<javax.validation.ConstraintViolation<T>>
validate(T object, Class<?>... groups)
<T> Set<javax.validation.ConstraintViolation<T>>
validateProperty(T object, String propertyName, Class<?>... groups)
<T> Set<javax.validation.ConstraintViolation<T>>
validateValue(Class<T> beanType, String propertyName, Object value, Class<?>... groups)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SpringValidatorAdapter

public SpringValidatorAdapter(javax.validation.Validator targetValidator)
Create a new SpringValidatorAdapter for the given JSR-303 Validator.

Parameters:
targetValidator - the JSR-303 Validator to wrap
Method Detail

supports

public boolean supports(Class<?> clazz)
Description copied from interface: Validator
Can this Validator validate instances of the supplied clazz?

This method is typically implemented like so:

return Foo.class.isAssignableFrom(clazz);
(Where Foo is the class (or superclass) of the actual object instance that is to be validated.)

Parameters:
clazz - the Class that this Validator is being asked if it can validate
Returns:
true if this Validator can indeed validate instances of the supplied clazz

validate

public void validate(Object target,
                     Errors errors)
Description copied from interface: Validator
Validate the supplied target object, which must be of a Class for which the Validator.supports(Class) method typically has (or would) return true.

The supplied errors instance can be used to report any resulting validation errors.

Parameters:
target - the object that is to be validated (can be null)
errors - contextual state about the validation process (never null)
See Also:
ValidationUtils

getArgumentsForConstraint

protected Object[] getArgumentsForConstraint(String objectName,
                                             String field,
                                             javax.validation.metadata.ConstraintDescriptor<?> descriptor)
Return FieldError arguments for a validation error on the given field. Invoked for each violated constraint.

The default implementation returns a single argument of type DefaultMessageSourceResolvable, with "objectName.field" and "field" as codes.

Parameters:
objectName - the name of the target object
field - the field that caused the binding error
descriptor - the JSR-303 constraint descriptor
Returns:
the Object array that represents the FieldError arguments
See Also:
DefaultMessageSourceResolvable.getArguments(), DefaultMessageSourceResolvable, DefaultBindingErrorProcessor.getArgumentsForBindError(java.lang.String, java.lang.String)

validate

public <T> Set<javax.validation.ConstraintViolation<T>> validate(T object,
                                                                 Class<?>... groups)
Specified by:
validate in interface javax.validation.Validator

validateProperty

public <T> Set<javax.validation.ConstraintViolation<T>> validateProperty(T object,
                                                                         String propertyName,
                                                                         Class<?>... groups)
Specified by:
validateProperty in interface javax.validation.Validator

validateValue

public <T> Set<javax.validation.ConstraintViolation<T>> validateValue(Class<T> beanType,
                                                                      String propertyName,
                                                                      Object value,
                                                                      Class<?>... groups)
Specified by:
validateValue in interface javax.validation.Validator

getConstraintsForClass

public javax.validation.metadata.BeanDescriptor getConstraintsForClass(Class<?> clazz)
Specified by:
getConstraintsForClass in interface javax.validation.Validator

unwrap

public <T> T unwrap(Class<T> type)
Specified by:
unwrap in interface javax.validation.Validator
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.validation.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.validation.support

Support classes for handling validation results.

See:
Description

Class Summary
BindingAwareModelMap Subclass of ExtendedModelMap that automatically removes a BindingResult object if the corresponding target attribute gets replaced.

Package org.springframework.validation.support Description

Support classes for handling validation results.


org.springframework.validation.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.validation.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.util.AbstractMap<K,V> (implements java.util.Map<K,V>)
      • java.util.HashMap<K,V> (implements java.lang.Cloneable, java.util.Map<K,V>, java.io.Serializable)
        • java.util.LinkedHashMap<K,V> (implements java.util.Map<K,V>)
          • org.springframework.ui.ModelMap
            • org.springframework.ui.ExtendedModelMap (implements org.springframework.ui.Model)
              • org.springframework.validation.support.BindingAwareModelMap


BindingAwareModelMap

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.validation.support
Class BindingAwareModelMap

java.lang.Object
    extended by  java.util.AbstractMap<K,V>
        extended by  java.util.HashMap<K,V>
            extended by  java.util.LinkedHashMap<String,Object>
                extended by  org.springframework.ui.ModelMap
                    extended by  org.springframework.ui.ExtendedModelMap
                        extended by  org.springframework.validation.support.BindingAwareModelMap
All Implemented Interfaces:
Serializable, Cloneable, Map<String,Object>, Model
public class BindingAwareModelMap
extends ExtendedModelMap

Subclass of ExtendedModelMap that automatically removes a BindingResult object if the corresponding target attribute gets replaced.

Used by AnnotationMethodHandlerAdapter and AnnotationMethodHandlerAdapter.

Since:
2.5.6
Author:
Juergen Hoeller
See Also:
BindingResult, Serialized Form

Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor Summary
BindingAwareModelMap()
Method Summary
Object | put(String key, Object value)
void | putAll(Map<? extends String,?> map)
Methods inherited from class org.springframework.ui.ExtendedModelMap
addAllAttributes, addAllAttributes, addAttribute, addAttribute, asMap, mergeAttributes
Methods inherited from class org.springframework.ui.ModelMap
addAllObjects, addAllObjects, addObject, addObject, containsAttribute
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, get, removeEldestEntry
Methods inherited from class java.util.HashMap
clone, containsKey, entrySet, isEmpty, keySet, remove, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.ui.Model
containsAttribute
Methods inherited from interface java.util.Map
containsKey, entrySet, equals, hashCode, isEmpty, keySet, remove, size, values

Constructor Detail

BindingAwareModelMap

public BindingAwareModelMap()
Method Detail

put

public Object put(String key,
                  Object value)
Specified by:
put in interface Map<String,Object>
Overrides:
put in class HashMap<String,Object>

putAll

public void putAll(Map<? extends String,?> map)
Specified by:
putAll in interface Map<String,Object>
Overrides:
putAll in class HashMap<String,Object>
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web

Common, generic interfaces that define minimal boundary points between Spring's web infrastructure and other framework modules.

See:
Description

Interface Summary
HttpRequestHandler Plain handler interface for components that process HTTP requests, analogous to a Servlet.

Exception Summary
HttpMediaTypeException | Abstract base for exceptions related to media types.
HttpMediaTypeNotAcceptableException | Exception thrown when the request handler cannot generate a response that is acceptable by the client.
HttpMediaTypeNotSupportedException | Exception thrown when a client POSTs or PUTs content not supported by request handler.
HttpRequestMethodNotSupportedException | Exception thrown when a request handler does not support a specific request method.
HttpSessionRequiredException | Exception thrown when an HTTP request handler requires a pre-existing session.

Package org.springframework.web Description

Common, generic interfaces that define minimal boundary points between Spring's web infrastructure and other framework modules.


org.springframework.web Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • javax.servlet.ServletException
          • org.springframework.web.HttpMediaTypeException
            • org.springframework.web.HttpMediaTypeNotAcceptableException
            • org.springframework.web.HttpMediaTypeNotSupportedException
          • org.springframework.web.HttpRequestMethodNotSupportedException
          • org.springframework.web.HttpSessionRequiredException

Interface Hierarchy

  • org.springframework.web.HttpRequestHandler


HttpRequestHandler

org.springframework.web
Interface HttpRequestHandler

All Known Implementing Classes:
BurlapServiceExporter, HessianServiceExporter, HttpInvokerServiceExporter
public interface HttpRequestHandler

Plain handler interface for components that process HTTP requests, analogous to a Servlet. Only declares ServletException and IOException, to allow for usage within any HttpServlet}. This interface is essentially the direct equivalent of an HttpServlet, reduced to a central handle method.

The easiest way to expose an HttpRequestHandler bean in Spring style is to define it in Spring's root web application context and define an HttpRequestHandlerServlet in web.xml, pointing at the target HttpRequestHandler bean through its servlet-name which needs to match the target bean name.

Supported as a handler type within Spring's DispatcherServlet, being able to interact with the dispatcher's advanced mapping and interception facilities. This is the recommended way of exposing an HttpRequestHandler, while keeping the handler implementations free of direct dependencies on a DispatcherServlet environment.

Typically implemented to generate binary responses directly, with no separate view resource involved. This differentiates it from a Controller within Spring's Web MVC framework. The lack of a ModelAndView return value gives a clearer signature to callers other than the DispatcherServlet, indicating that there will never be a view to render.

As of Spring 2.0, Spring's HTTP-based remote exporters, such as HttpInvokerServiceExporter and HessianServiceExporter, implement this interface rather than the more extensive Controller interface, for minimal dependencies on Spring-specific web infrastructure.

Note that HttpRequestHandlers may optionally implement the LastModified interface, just like Controllers can, provided that they run within Spring's DispatcherServlet. However, this is usually not necessary, since HttpRequestHandlers typically only support POST requests to begin with. Alternatively, a handler may implement the "If-Modified-Since" HTTP header processing manually within its handle method.

Since:
2.0
Author:
Juergen Hoeller
See Also:
HttpRequestHandlerServlet, DispatcherServlet, ModelAndView, Controller, LastModified, HttpRequestHandlerAdapter, HttpInvokerServiceExporter, HessianServiceExporter, BurlapServiceExporter

Method Summary
 void handleRequest(HttpServletRequest request, HttpServletResponse response)
Process the given request, generating a response.

Method Detail

handleRequest

void handleRequest(HttpServletRequest request,
                   HttpServletResponse response)
                   throws ServletException,
                          IOException
Process the given request, generating a response.

Parameters:
request - current HTTP request
response - current HTTP response
Throws:
ServletException - in case of general errors
IOException - in case of I/O errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HttpMediaTypeException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web
Class HttpMediaTypeException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.servlet.ServletException
                extended by  org.springframework.web.HttpMediaTypeException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
HttpMediaTypeNotAcceptableException, HttpMediaTypeNotSupportedException
public abstract class HttpMediaTypeException
extends ServletException

Abstract base for exceptions related to media types. Adds a list of supported MediaTypes.

Since:
3.0
Author:
Arjen Poutsma
See Also:
Serialized Form

Constructor Summary
protected | HttpMediaTypeException(String message) Create a new MediaTypeException.
protected | HttpMediaTypeException(String message, List<MediaType> supportedMediaTypes) Create a new HttpMediaTypeNotSupportedException.
Method Summary
 List<MediaType> getSupportedMediaTypes()
Return the list of supported media types.
Methods inherited from class javax.servlet.ServletException
getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

HttpMediaTypeException

protected HttpMediaTypeException(String message)
Create a new MediaTypeException.

Parameters:
message - the exception message

HttpMediaTypeException

protected HttpMediaTypeException(String message,
                                 List<MediaType> supportedMediaTypes)
Create a new HttpMediaTypeNotSupportedException.

Parameters:
supportedMediaTypes - the list of supported media types
Method Detail

getSupportedMediaTypes

public List<MediaType> getSupportedMediaTypes()
Return the list of supported media types.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


HttpMediaTypeNotAcceptableException

org.springframework.web
Class HttpMediaTypeNotAcceptableException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.servlet.ServletException
                extended by  org.springframework.web.HttpMediaTypeException
                    extended by  org.springframework.web.HttpMediaTypeNotAcceptableException
All Implemented Interfaces:
Serializable
public class HttpMediaTypeNotAcceptableException
extends HttpMediaTypeException

Exception thrown when the request handler cannot generate a response that is acceptable by the client.

Since:
3.0
Author:
Arjen Poutsma
See Also:
Serialized Form

Constructor Summary
HttpMediaTypeNotAcceptableException(List<MediaType> supportedMediaTypes)
Create a new HttpMediaTypeNotSupportedException.
HttpMediaTypeNotAcceptableException(String message)
Create a new HttpMediaTypeNotAcceptableException.
Method Summary
Methods inherited from class org.springframework.web.HttpMediaTypeException
getSupportedMediaTypes
Methods inherited from class javax.servlet.ServletException
getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

HttpMediaTypeNotAcceptableException

public HttpMediaTypeNotAcceptableException(String message)
Create a new HttpMediaTypeNotAcceptableException.

Parameters:
message - the exception message

HttpMediaTypeNotAcceptableException

public HttpMediaTypeNotAcceptableException(List<MediaType> supportedMediaTypes)
Create a new HttpMediaTypeNotSupportedException.

Parameters:
supportedMediaTypes - the list of supported media types
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HttpMediaTypeNotSupportedException

org.springframework.web
Class HttpMediaTypeNotSupportedException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.servlet.ServletException
                extended by  org.springframework.web.HttpMediaTypeException
                    extended by  org.springframework.web.HttpMediaTypeNotSupportedException
All Implemented Interfaces:
Serializable
public class HttpMediaTypeNotSupportedException
extends HttpMediaTypeException

Exception thrown when a client POSTs or PUTs content not supported by request handler.

Since:
3.0
Author:
Arjen Poutsma
See Also:
Serialized Form

Constructor Summary
HttpMediaTypeNotSupportedException(MediaType contentType, List<MediaType> supportedMediaTypes)
Create a new HttpMediaTypeNotSupportedException.
HttpMediaTypeNotSupportedException(MediaType contentType, List<MediaType> supportedMediaTypes, String msg)
Create a new HttpMediaTypeNotSupportedException.
HttpMediaTypeNotSupportedException(String message)
Create a new HttpMediaTypeNotSupportedException.
Method Summary
 MediaType getContentType()
Return the HTTP request content type method that caused the failure.
Methods inherited from class org.springframework.web.HttpMediaTypeException
getSupportedMediaTypes
Methods inherited from class javax.servlet.ServletException
getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

HttpMediaTypeNotSupportedException

public HttpMediaTypeNotSupportedException(String message)
Create a new HttpMediaTypeNotSupportedException.

Parameters:
message - the exception message

HttpMediaTypeNotSupportedException

public HttpMediaTypeNotSupportedException(MediaType contentType,
                                          List<MediaType> supportedMediaTypes)
Create a new HttpMediaTypeNotSupportedException.

Parameters:
contentType - the unsupported content type
supportedMediaTypes - the list of supported media types

HttpMediaTypeNotSupportedException

public HttpMediaTypeNotSupportedException(MediaType contentType,
                                          List<MediaType> supportedMediaTypes,
                                          String msg)
Create a new HttpMediaTypeNotSupportedException.

Parameters:
contentType - the unsupported content type
supportedMediaTypes - the list of supported media types
msg - the detail message
Method Detail

getContentType

public MediaType getContentType()
Return the HTTP request content type method that caused the failure.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HttpRequestMethodNotSupportedException

org.springframework.web
Class HttpRequestMethodNotSupportedException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.servlet.ServletException
                extended by  org.springframework.web.HttpRequestMethodNotSupportedException
All Implemented Interfaces:
Serializable
public class HttpRequestMethodNotSupportedException
extends ServletException

Exception thrown when a request handler does not support a specific request method.

Since:
2.0
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
HttpRequestMethodNotSupportedException(String method)
Create a new HttpRequestMethodNotSupportedException.
HttpRequestMethodNotSupportedException(String method, String msg)
Create a new HttpRequestMethodNotSupportedException.
HttpRequestMethodNotSupportedException(String method, String[] supportedMethods)
Create a new HttpRequestMethodNotSupportedException.
HttpRequestMethodNotSupportedException(String method, String[] supportedMethods, String msg)
Create a new HttpRequestMethodNotSupportedException.
Method Summary
String | getMethod() Return the HTTP request method that caused the failure.
String[] | getSupportedMethods() Return the actually supported HTTP methods, if known.
Methods inherited from class javax.servlet.ServletException
getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

HttpRequestMethodNotSupportedException

public HttpRequestMethodNotSupportedException(String method)
Create a new HttpRequestMethodNotSupportedException.

Parameters:
method - the unsupported HTTP request method

HttpRequestMethodNotSupportedException

public HttpRequestMethodNotSupportedException(String method,
                                              String[] supportedMethods)
Create a new HttpRequestMethodNotSupportedException.

Parameters:
method - the unsupported HTTP request method
supportedMethods - the actually supported HTTP methods

HttpRequestMethodNotSupportedException

public HttpRequestMethodNotSupportedException(String method,
                                              String msg)
Create a new HttpRequestMethodNotSupportedException.

Parameters:
method - the unsupported HTTP request method
msg - the detail message

HttpRequestMethodNotSupportedException

public HttpRequestMethodNotSupportedException(String method,
                                              String[] supportedMethods,
                                              String msg)
Create a new HttpRequestMethodNotSupportedException.

Parameters:
method - the unsupported HTTP request method
supportedMethods - the actually supported HTTP methods
msg - the detail message
Method Detail

getMethod

public String getMethod()
Return the HTTP request method that caused the failure.

getSupportedMethods

public String[] getSupportedMethods()
Return the actually supported HTTP methods, if known.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HttpSessionRequiredException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web
Class HttpSessionRequiredException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.servlet.ServletException
                extended by  org.springframework.web.HttpSessionRequiredException
All Implemented Interfaces:
Serializable
public class HttpSessionRequiredException
extends ServletException

Exception thrown when an HTTP request handler requires a pre-existing session.

Since:
2.0
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
HttpSessionRequiredException(String msg)
Create a new HttpSessionRequiredException.
Method Summary
Methods inherited from class javax.servlet.ServletException
getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

HttpSessionRequiredException

public HttpSessionRequiredException(String msg)
Create a new HttpSessionRequiredException.

Parameters:
msg - the detail message
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.bind

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.bind

Provides web-specific data binding functionality.

See:
Description

Class Summary
EscapedErrors | Errors wrapper that adds automatic HTML escaping to the wrapped instance, for convenient usage in HTML views.
ServletRequestDataBinder | Special DataBinder to perform data binding from servlet request parameters to JavaBeans, including support for multipart files.
ServletRequestParameterPropertyValues | PropertyValues implementation created from parameters in a ServletRequest.
ServletRequestUtils | Parameter extraction methods, for an approach distinct from data binding, in which parameters of specific types are required.
WebDataBinder | Special DataBinder for data binding from web request parameters to JavaBean objects.

Exception Summary
MissingServletRequestParameterException | ServletRequestBindingException subclass that indicates a missing parameter.
ServletRequestBindingException | Fatal binding exception, thrown when we want to treat binding exceptions as unrecoverable.
UnsatisfiedServletRequestParameterException | ServletRequestBindingException subclass that indicates an unsatisfied parameter condition, as typically expressed using an @RequestMapping annotation at the @Controller type level.

Package org.springframework.web.bind Description

Provides web-specific data binding functionality.


org.springframework.web.bind Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.bind

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.validation.DataBinder (implements org.springframework.beans.PropertyEditorRegistry, org.springframework.beans.TypeConverter)
      • org.springframework.web.bind.WebDataBinder
        • org.springframework.web.bind.ServletRequestDataBinder
    • org.springframework.web.bind.EscapedErrors (implements org.springframework.validation.Errors)
    • org.springframework.beans.MutablePropertyValues (implements org.springframework.beans.PropertyValues, java.io.Serializable)
      • org.springframework.web.bind.ServletRequestParameterPropertyValues
    • org.springframework.web.bind.ServletRequestUtils
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • javax.servlet.ServletException
          • org.springframework.web.util.NestedServletException
            • org.springframework.web.bind.ServletRequestBindingException
              • org.springframework.web.bind.MissingServletRequestParameterException
              • org.springframework.web.bind.UnsatisfiedServletRequestParameterException


EscapedErrors

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.bind
Class EscapedErrors

java.lang.Object
    extended by  org.springframework.web.bind.EscapedErrors
All Implemented Interfaces:
Errors
public class EscapedErrors
extends Object
implements Errors

Errors wrapper that adds automatic HTML escaping to the wrapped instance, for convenient usage in HTML views. Can be retrieved easily via RequestContext's getErrors method.

Note that BindTag does not use this class to avoid unnecessary creation of ObjectError instances. It just escapes the messages and values that get copied into the respective BindStatus instance.

Since:
01.03.2003
Author:
Juergen Hoeller
See Also:
RequestContext.getErrors(java.lang.String), BindTag

Field Summary
Fields inherited from interface org.springframework.validation.Errors
NESTED_PATH_SEPARATOR
Constructor Summary
EscapedErrors(Errors source)
Create a new EscapedErrors instance for the given source instance.
Method Summary
void | addAllErrors(Errors errors) Add all errors from the given Errors instance to this Errors instance.
List<ObjectError> | getAllErrors() Get all errors, both global and field ones.
int | getErrorCount() Return the total number of errors.
FieldError | getFieldError() Get the first error associated with a field, if any.
FieldError | getFieldError(String field) Get the first error associated with the given field, if any.
int | getFieldErrorCount() Return the number of errors associated with a field.
int | getFieldErrorCount(String field) Return the number of errors associated with the given field.
List<FieldError> | getFieldErrors() Get all errors associated with a field.
List<FieldError> | getFieldErrors(String field) Get all errors associated with the given field.
Class | getFieldType(String field) Return the type of a given field.
Object | getFieldValue(String field) Return the current value of the given field, either the current bean property value or a rejected update from the last binding.
ObjectError | getGlobalError() Get the first global error, if any.
int | getGlobalErrorCount() Return the number of global errors.
List<ObjectError> | getGlobalErrors() Get all global errors.
String | getNestedPath() Return the current nested path of this Errors object.
String | getObjectName() Return the name of the bound root object.
Errors | getSource()
boolean | hasErrors() Return if there were any errors.
boolean | hasFieldErrors() Are there any field errors?
boolean | hasFieldErrors(String field) Are there any errors associated with the given field?
boolean | hasGlobalErrors() Are there any global errors?
void | popNestedPath() Pop the former nested path from the nested path stack.
void | pushNestedPath(String subPath) Push the given sub path onto the nested path stack.
void | reject(String errorCode) Register a global error for the entire target object, using the given error description.
void | reject(String errorCode, Object[] errorArgs, String defaultMessage) Register a global error for the entire target object, using the given error description.
void | reject(String errorCode, String defaultMessage) Register a global error for the entire target object, using the given error description.
void | rejectValue(String field, String errorCode) Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description.
void | rejectValue(String field, String errorCode, Object[] errorArgs, String defaultMessage) Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description.
void | rejectValue(String field, String errorCode, String defaultMessage) Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description.
void | setNestedPath(String nestedPath) Allow context to be changed so that standard validators can validate subtrees.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

EscapedErrors

public EscapedErrors(Errors source)
Create a new EscapedErrors instance for the given source instance.

Method Detail

getSource

public Errors getSource()

getObjectName

public String getObjectName()
Description copied from interface: Errors
Return the name of the bound root object.

Specified by:
getObjectName in interface Errors

setNestedPath

public void setNestedPath(String nestedPath)
Description copied from interface: Errors
Allow context to be changed so that standard validators can validate subtrees. Reject calls prepend the given path to the field names.

For example, an address validator could validate the subobject "address" of a customer object.

Specified by:
setNestedPath in interface Errors
Parameters:
nestedPath - nested path within this object, e.g. "address" (defaults to "", null is also acceptable). Can end with a dot: both "address" and "address." are valid.

getNestedPath

public String getNestedPath()
Description copied from interface: Errors
Return the current nested path of this Errors object.

Returns a nested path with a dot, i.e. "address.", for easy building of concatenated paths. Default is an empty String.

Specified by:
getNestedPath in interface Errors

pushNestedPath

public void pushNestedPath(String subPath)
Description copied from interface: Errors
Push the given sub path onto the nested path stack.

A Errors.popNestedPath() call will reset the original nested path before the corresponding pushNestedPath(String) call.

Using the nested path stack allows to set temporary nested paths for subobjects without having to worry about a temporary path holder.

For example: current path "spouse.", pushNestedPath("child") -> result path "spouse.child."; popNestedPath() -> "spouse." again.

Specified by:
pushNestedPath in interface Errors
Parameters:
subPath - the sub path to push onto the nested path stack
See Also:
Errors.popNestedPath()

popNestedPath

public void popNestedPath()
                   throws IllegalStateException
Description copied from interface: Errors
Pop the former nested path from the nested path stack.

Specified by:
popNestedPath in interface Errors
Throws:
IllegalStateException - if there is no former nested path on the stack
See Also:
Errors.pushNestedPath(java.lang.String)

reject

public void reject(String errorCode)
Description copied from interface: Errors
Register a global error for the entire target object, using the given error description.

Specified by:
reject in interface Errors
Parameters:
errorCode - error code, interpretable as a message key

reject

public void reject(String errorCode,
                   String defaultMessage)
Description copied from interface: Errors
Register a global error for the entire target object, using the given error description.

Specified by:
reject in interface Errors
Parameters:
errorCode - error code, interpretable as a message key
defaultMessage - fallback default message

reject

public void reject(String errorCode,
                   Object[] errorArgs,
                   String defaultMessage)
Description copied from interface: Errors
Register a global error for the entire target object, using the given error description.

Specified by:
reject in interface Errors
Parameters:
errorCode - error code, interpretable as a message key
errorArgs - error arguments, for argument binding via MessageFormat (can be null)
defaultMessage - fallback default message

rejectValue

public void rejectValue(String field,
                        String errorCode)
Description copied from interface: Errors
Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description.

The field name may be null or empty String to indicate the current object itself rather than a field of it. This may result in a corresponding field error within the nested object graph or a global error if the current object is the top object.

Specified by:
rejectValue in interface Errors
Parameters:
field - the field name (may be null or empty String)
errorCode - error code, interpretable as a message key
See Also:
Errors.getNestedPath()

rejectValue

public void rejectValue(String field,
                        String errorCode,
                        String defaultMessage)
Description copied from interface: Errors
Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description.

The field name may be null or empty String to indicate the current object itself rather than a field of it. This may result in a corresponding field error within the nested object graph or a global error if the current object is the top object.

Specified by:
rejectValue in interface Errors
Parameters:
field - the field name (may be null or empty String)
errorCode - error code, interpretable as a message key
defaultMessage - fallback default message
See Also:
Errors.getNestedPath()

rejectValue

public void rejectValue(String field,
                        String errorCode,
                        Object[] errorArgs,
                        String defaultMessage)
Description copied from interface: Errors
Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description.

The field name may be null or empty String to indicate the current object itself rather than a field of it. This may result in a corresponding field error within the nested object graph or a global error if the current object is the top object.

Specified by:
rejectValue in interface Errors
Parameters:
field - the field name (may be null or empty String)
errorCode - error code, interpretable as a message key
errorArgs - error arguments, for argument binding via MessageFormat (can be null)
defaultMessage - fallback default message
See Also:
Errors.getNestedPath()

addAllErrors

public void addAllErrors(Errors errors)
Description copied from interface: Errors
Add all errors from the given Errors instance to this Errors instance.

This is a onvenience method to avoid repeated reject(..) calls for merging an Errors instance into another Errors instance.

Note that the passed-in Errors instance is supposed to refer to the same target object, or at least contain compatible errors that apply to the target object of this Errors instance.

Specified by:
addAllErrors in interface Errors
Parameters:
errors - the Errors instance to merge in

hasErrors

public boolean hasErrors()
Description copied from interface: Errors
Return if there were any errors.

Specified by:
hasErrors in interface Errors

getErrorCount

public int getErrorCount()
Description copied from interface: Errors
Return the total number of errors.

Specified by:
getErrorCount in interface Errors

getAllErrors

public List<ObjectError> getAllErrors()
Description copied from interface: Errors
Get all errors, both global and field ones.

Specified by:
getAllErrors in interface Errors
Returns:
List of ObjectError instances

hasGlobalErrors

public boolean hasGlobalErrors()
Description copied from interface: Errors
Are there any global errors?

Specified by:
hasGlobalErrors in interface Errors
Returns:
true if there are any global errors
See Also:
Errors.hasFieldErrors()

getGlobalErrorCount

public int getGlobalErrorCount()
Description copied from interface: Errors
Return the number of global errors.

Specified by:
getGlobalErrorCount in interface Errors
Returns:
the number of global errors
See Also:
Errors.getFieldErrorCount()

getGlobalErrors

public List<ObjectError> getGlobalErrors()
Description copied from interface: Errors
Get all global errors.

Specified by:
getGlobalErrors in interface Errors
Returns:
List of ObjectError instances

getGlobalError

public ObjectError getGlobalError()
Description copied from interface: Errors
Get the first global error, if any.

Specified by:
getGlobalError in interface Errors
Returns:
the global error, or null

hasFieldErrors

public boolean hasFieldErrors()
Description copied from interface: Errors
Are there any field errors?

Specified by:
hasFieldErrors in interface Errors
Returns:
true if there are any errors associated with a field
See Also:
Errors.hasGlobalErrors()

getFieldErrorCount

public int getFieldErrorCount()
Description copied from interface: Errors
Return the number of errors associated with a field.

Specified by:
getFieldErrorCount in interface Errors
Returns:
the number of errors associated with a field
See Also:
Errors.getGlobalErrorCount()

getFieldErrors

public List<FieldError> getFieldErrors()
Description copied from interface: Errors
Get all errors associated with a field.

Specified by:
getFieldErrors in interface Errors
Returns:
a List of FieldError instances

getFieldError

public FieldError getFieldError()
Description copied from interface: Errors
Get the first error associated with a field, if any.

Specified by:
getFieldError in interface Errors
Returns:
the field-specific error, or null

hasFieldErrors

public boolean hasFieldErrors(String field)
Description copied from interface: Errors
Are there any errors associated with the given field?

Specified by:
hasFieldErrors in interface Errors
Parameters:
field - the field name
Returns:
true if there were any errors associated with the given field

getFieldErrorCount

public int getFieldErrorCount(String field)
Description copied from interface: Errors
Return the number of errors associated with the given field.

Specified by:
getFieldErrorCount in interface Errors
Parameters:
field - the field name
Returns:
the number of errors associated with the given field

getFieldErrors

public List<FieldError> getFieldErrors(String field)
Description copied from interface: Errors
Get all errors associated with the given field.

Implementations should support not only full field names like "name" but also pattern matches like "na*" or "address.*".

Specified by:
getFieldErrors in interface Errors
Parameters:
field - the field name
Returns:
a List of FieldError instances

getFieldError

public FieldError getFieldError(String field)
Description copied from interface: Errors
Get the first error associated with the given field, if any.

Specified by:
getFieldError in interface Errors
Parameters:
field - the field name
Returns:
the field-specific error, or null

getFieldValue

public Object getFieldValue(String field)
Description copied from interface: Errors
Return the current value of the given field, either the current bean property value or a rejected update from the last binding.

Allows for convenient access to user-specified field values, even if there were type mismatches.

Specified by:
getFieldValue in interface Errors
Parameters:
field - the field name
Returns:
the current value of the given field

getFieldType

public Class getFieldType(String field)
Description copied from interface: Errors
Return the type of a given field.

Implementations should be able to determine the type even when the field value is null, for example from some associated descriptor.

Specified by:
getFieldType in interface Errors
Parameters:
field - the field name
Returns:
the type of the field, or null if not determinable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ServletRequestDataBinder

org.springframework.web.bind
Class ServletRequestDataBinder

java.lang.Object
    extended by  org.springframework.validation.DataBinder
        extended by  org.springframework.web.bind.WebDataBinder
            extended by  org.springframework.web.bind.ServletRequestDataBinder
All Implemented Interfaces:
PropertyEditorRegistry, TypeConverter
public class ServletRequestDataBinder
extends WebDataBinder

Special DataBinder to perform data binding from servlet request parameters to JavaBeans, including support for multipart files.

See the DataBinder/WebDataBinder superclasses for customization options, which include specifying allowed/required fields, and registering custom property editors.

Used by Spring Web MVC's BaseCommandController and MultiActionController. Note that BaseCommandController and its subclasses allow for easy customization of the binder instances that they use through overriding initBinder.

Can also be used for manual data binding in custom web controllers: for example, in a plain Controller implementation or in a MultiActionController handler method. Simply instantiate a ServletRequestDataBinder for each binding process, and invoke bind with the current ServletRequest as argument:

 MyBean myBean = new MyBean();
 // apply binder to custom target object
 ServletRequestDataBinder binder = new ServletRequestDataBinder(myBean);
 // register custom editors, if desired
 binder.registerCustomEditor(...);
 // trigger actual binding of request parameters
 binder.bind(request);
 // optionally evaluate binding errors
 Errors errors = binder.getErrors();
 ...

Author:
Rod Johnson, Juergen Hoeller
See Also:
bind(javax.servlet.ServletRequest),
DataBinder.registerCustomEditor(java.lang.Class, java.beans.PropertyEditor),
DataBinder.setAllowedFields(java.lang.String...),
DataBinder.setRequiredFields(java.lang.String...),
WebDataBinder.setFieldMarkerPrefix(java.lang.String),
BaseCommandController.initBinder(javax.servlet.http.HttpServletRequest, org.springframework.web.bind.ServletRequestDataBinder)

Field Summary
Fields inherited from class org.springframework.web.bind.WebDataBinder
DEFAULT_FIELD_DEFAULT_PREFIX, DEFAULT_FIELD_MARKER_PREFIX
Fields inherited from class org.springframework.validation.DataBinder
DEFAULT_OBJECT_NAME, logger
Constructor Summary
ServletRequestDataBinder(Object target)
Create a new ServletRequestDataBinder instance, with default object name.
ServletRequestDataBinder(Object target, String objectName)
Create a new ServletRequestDataBinder instance.
Method Summary
void | bind(ServletRequest request) Bind the parameters of the given request to this binder's target, also binding multipart files in case of a multipart request.
void | closeNoCatch() Treats errors as fatal.
Methods inherited from class org.springframework.web.bind.WebDataBinder
bindMultipartFiles, checkFieldDefaults, checkFieldMarkers, doBind, getEmptyValue, getFieldDefaultPrefix, getFieldMarkerPrefix, isBindEmptyMultipartFiles, setBindEmptyMultipartFiles, setFieldDefaultPrefix, setFieldMarkerPrefix
Methods inherited from class org.springframework.validation.DataBinder
applyPropertyValues, bind, checkAllowedFields, checkRequiredFields, close, convertIfNecessary, convertIfNecessary, findCustomEditor, getAllowedFields, getBindingErrorProcessor, getBindingResult, getConversionService, getDisallowedFields, getErrors, getInternalBindingResult, getObjectName, getPropertyAccessor, getPropertyEditorRegistry, getRequiredFields, getSimpleTypeConverter, getTarget, getTypeConverter, getValidator, initBeanPropertyAccess, initDirectFieldAccess, isAllowed, isAutoGrowNestedPaths, isIgnoreInvalidFields, isIgnoreUnknownFields, registerCustomEditor, registerCustomEditor, setAllowedFields, setAutoGrowNestedPaths, setBindingErrorProcessor, setConversionService, setDisallowedFields, setExtractOldValueForEditor, setIgnoreInvalidFields, setIgnoreUnknownFields, setMessageCodesResolver, setRequiredFields, setValidator, validate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ServletRequestDataBinder

public ServletRequestDataBinder(Object target)
Create a new ServletRequestDataBinder instance, with default object name.

Parameters:
target - the target object to bind onto (or null if the binder is just used to convert a plain parameter value)
See Also:
DataBinder.DEFAULT_OBJECT_NAME

ServletRequestDataBinder

public ServletRequestDataBinder(Object target,
                                String objectName)
Create a new ServletRequestDataBinder instance.

Parameters:
target - the target object to bind onto (or null if the binder is just used to convert a plain parameter value)
objectName - the name of the target object
Method Detail

bind

public void bind(ServletRequest request)
Bind the parameters of the given request to this binder's target, also binding multipart files in case of a multipart request.

This call can create field errors, representing basic binding errors like a required field (code "required"), or type mismatch between value and bean property (code "typeMismatch").

Multipart files are bound via their parameter name, just like normal HTTP parameters: i.e. "uploadedFile" to an "uploadedFile" bean property, invoking a "setUploadedFile" setter method.

The type of the target property for a multipart file can be MultipartFile, byte[], or String. The latter two receive the contents of the uploaded file; all metadata like original file name, content type, etc are lost in those cases.

Parameters:
request - request with parameters to bind (can be multipart)
See Also:
MultipartHttpServletRequest, MultipartFile, WebDataBinder.bindMultipartFiles(java.util.Map, org.springframework.beans.MutablePropertyValues), DataBinder.bind(org.springframework.beans.PropertyValues)

closeNoCatch

public void closeNoCatch()
                  throws ServletRequestBindingException
Treats errors as fatal.

Use this method only if it's an error if the input isn't valid. This might be appropriate if all input is from dropdowns, for example.

Throws:
ServletRequestBindingException - subclass of ServletException on any binding problem
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletRequestParameterPropertyValues

org.springframework.web.bind
Class ServletRequestParameterPropertyValues

java.lang.Object
    extended by  org.springframework.beans.MutablePropertyValues
        extended by  org.springframework.web.bind.ServletRequestParameterPropertyValues
All Implemented Interfaces:
Serializable, PropertyValues
public class ServletRequestParameterPropertyValues
extends MutablePropertyValues

PropertyValues implementation created from parameters in a ServletRequest. Can look for all property values beginning with a certain prefix and prefix separator (default is "_").

For example, with a prefix of "spring", "spring_param1" and "spring_param2" result in a Map with "param1" and "param2" as keys.

This class is not immutable to be able to efficiently remove property values that should be ignored for binding.

Author:
Rod Johnson, Juergen Hoeller
See Also:
WebUtils.getParametersStartingWith(javax.servlet.ServletRequest, java.lang.String), Serialized Form

Field Summary
static String DEFAULT_PREFIX_SEPARATOR
Default prefix separator
Constructor Summary
ServletRequestParameterPropertyValues(ServletRequest request)
Create new ServletRequestPropertyValues using no prefix (and hence, no prefix separator).
ServletRequestParameterPropertyValues(ServletRequest request, String prefix)
Create new ServletRequestPropertyValues using the given prefix and the default prefix separator (the underscore character "_").
ServletRequestParameterPropertyValues(ServletRequest request, String prefix, String prefixSeparator)
Create new ServletRequestPropertyValues supplying both prefix and prefix separator.
Method Summary
Methods inherited from class org.springframework.beans.MutablePropertyValues
add, addPropertyValue, addPropertyValue, addPropertyValues, addPropertyValues, changesSince, contains, equals, getPropertyValue, getPropertyValueList, getPropertyValues, hashCode, isConverted, isEmpty, registerProcessedProperty, removePropertyValue, removePropertyValue, setConverted, setPropertyValueAt, size, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail

DEFAULT_PREFIX_SEPARATOR

public static final String DEFAULT_PREFIX_SEPARATOR
Default prefix separator

See Also:
Constant Field Values
Constructor Detail

ServletRequestParameterPropertyValues

public ServletRequestParameterPropertyValues(ServletRequest request)
Create new ServletRequestPropertyValues using no prefix (and hence, no prefix separator).

Parameters:
request - HTTP request

ServletRequestParameterPropertyValues

public ServletRequestParameterPropertyValues(ServletRequest request,
                                             String prefix)
Create new ServletRequestPropertyValues using the given prefix and the default prefix separator (the underscore character "_").

Parameters:
request - HTTP request
prefix - the prefix for parameters (the full prefix will consist of this plus the separator)
See Also:
DEFAULT_PREFIX_SEPARATOR

ServletRequestParameterPropertyValues

public ServletRequestParameterPropertyValues(ServletRequest request,
                                             String prefix,
                                             String prefixSeparator)
Create new ServletRequestPropertyValues supplying both prefix and prefix separator.

Parameters:
request - HTTP request
prefix - the prefix for parameters (the full prefix will consist of this plus the separator)
prefixSeparator - separator delimiting prefix (e.g. "spring") and the rest of the parameter name ("param1", "param2")
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletRequestUtils

org.springframework.web.bind
Class ServletRequestUtils

java.lang.Object
    extended by  org.springframework.web.bind.ServletRequestUtils

public abstract class ServletRequestUtils
extends Object

Parameter extraction methods, for an approach distinct from data binding, in which parameters of specific types are required.

This approach is very useful for simple submissions, where binding request parameters to a command object would be overkill.

Since:
2.0
Author:
Juergen Hoeller, Keith Donald

Constructor Summary
ServletRequestUtils()
Method Summary
static Boolean | getBooleanParameter(ServletRequest request, String name) Get a Boolean parameter, or null if not present.
static boolean | getBooleanParameter(ServletRequest request, String name, boolean defaultVal) Get a boolean parameter, with a fallback value.
static boolean[] | getBooleanParameters(ServletRequest request, String name) Get an array of boolean parameters, return an empty array if not found.
static Double | getDoubleParameter(ServletRequest request, String name) Get a Double parameter, or null if not present.
static double | getDoubleParameter(ServletRequest request, String name, double defaultVal) Get a double parameter, with a fallback value.
static double[] | getDoubleParameters(ServletRequest request, String name) Get an array of double parameters, return an empty array if not found.
static Float | getFloatParameter(ServletRequest request, String name) Get a Float parameter, or null if not present.
static float | getFloatParameter(ServletRequest request, String name, float defaultVal) Get a float parameter, with a fallback value.
static float[] | getFloatParameters(ServletRequest request, String name) Get an array of float parameters, return an empty array if not found.
static Integer | getIntParameter(ServletRequest request, String name) Get an Integer parameter, or null if not present.
static int | getIntParameter(ServletRequest request, String name, int defaultVal) Get an int parameter, with a fallback value.
static int[] | getIntParameters(ServletRequest request, String name) Get an array of int parameters, return an empty array if not found.
static Long | getLongParameter(ServletRequest request, String name) Get a Long parameter, or null if not present.
static long | getLongParameter(ServletRequest request, String name, long defaultVal) Get a long parameter, with a fallback value.
static long[] | getLongParameters(ServletRequest request, String name) Get an array of long parameters, return an empty array if not found.
static boolean | getRequiredBooleanParameter(ServletRequest request, String name) Get a boolean parameter, throwing an exception if it isn't found or isn't a boolean.
static boolean[] | getRequiredBooleanParameters(ServletRequest request, String name) Get an array of boolean parameters, throwing an exception if not found or one isn't a boolean.
static double | getRequiredDoubleParameter(ServletRequest request, String name) Get a double parameter, throwing an exception if it isn't found or isn't a number.
static double[] | getRequiredDoubleParameters(ServletRequest request, String name) Get an array of double parameters, throwing an exception if not found or one is not a number.
static float | getRequiredFloatParameter(ServletRequest request, String name) Get a float parameter, throwing an exception if it isn't found or isn't a number.
static float[] | getRequiredFloatParameters(ServletRequest request, String name) Get an array of float parameters, throwing an exception if not found or one is not a number.
static int | getRequiredIntParameter(ServletRequest request, String name) Get an int parameter, throwing an exception if it isn't found or isn't a number.
static int[] | getRequiredIntParameters(ServletRequest request, String name) Get an array of int parameters, throwing an exception if not found or one is not a number..
static long | getRequiredLongParameter(ServletRequest request, String name) Get a long parameter, throwing an exception if it isn't found or isn't a number.
static long[] | getRequiredLongParameters(ServletRequest request, String name) Get an array of long parameters, throwing an exception if not found or one is not a number.
static String | getRequiredStringParameter(ServletRequest request, String name) Get a String parameter, throwing an exception if it isn't found.
static String[] | getRequiredStringParameters(ServletRequest request, String name) Get an array of String parameters, throwing an exception if not found.
static String | getStringParameter(ServletRequest request, String name) Get a String parameter, or null if not present.
static String | getStringParameter(ServletRequest request, String name, String defaultVal) Get a String parameter, with a fallback value.
static String[] | getStringParameters(ServletRequest request, String name) Get an array of String parameters, return an empty array if not found.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ServletRequestUtils

public ServletRequestUtils()
Method Detail

getIntParameter

public static Integer getIntParameter(ServletRequest request,
                                      String name)
                               throws ServletRequestBindingException
Get an Integer parameter, or null if not present. Throws an exception if it the parameter value isn't a number.

Parameters:
request - current HTTP request
name - the name of the parameter
Returns:
the Integer value, or null if not present
Throws:
ServletRequestBindingException - a subclass of ServletException, so it doesn't need to be caught

getIntParameter

public static int getIntParameter(ServletRequest request,
                                  String name,
                                  int defaultVal)
Get an int parameter, with a fallback value. Never throws an exception. Can pass a distinguished value as default to enable checks of whether it was supplied.

Parameters:
request - current HTTP request
name - the name of the parameter
defaultVal - the default value to use as fallback

getIntParameters

public static int[] getIntParameters(ServletRequest request,
                                     String name)
Get an array of int parameters, return an empty array if not found.

Parameters:
request - current HTTP request
name - the name of the parameter with multiple possible values

getRequiredIntParameter

public static int getRequiredIntParameter(ServletRequest request,
                                          String name)
                                   throws ServletRequestBindingException
Get an int parameter, throwing an exception if it isn't found or isn't a number.

Parameters:
request - current HTTP request
name - the name of the parameter
Throws:
ServletRequestBindingException - a subclass of ServletException, so it doesn't need to be caught

getRequiredIntParameters

public static int[] getRequiredIntParameters(ServletRequest request,
                                             String name)
                                      throws ServletRequestBindingException
Get an array of int parameters, throwing an exception if not found or one is not a number..

Parameters:
request - current HTTP request
name - the name of the parameter with multiple possible values
Throws:
ServletRequestBindingException - a subclass of ServletException, so it doesn't need to be caught

getLongParameter

public static Long getLongParameter(ServletRequest request,
                                    String name)
                             throws ServletRequestBindingException
Get a Long parameter, or null if not present. Throws an exception if it the parameter value isn't a number.

Parameters:
request - current HTTP request
name - the name of the parameter
Returns:
the Long value, or null if not present
Throws:
ServletRequestBindingException - a subclass of ServletException, so it doesn't need to be caught

getLongParameter

public static long getLongParameter(ServletRequest request,
                                    String name,
                                    long defaultVal)
Get a long parameter, with a fallback value. Never throws an exception. Can pass a distinguished value as default to enable checks of whether it was supplied.

Parameters:
request - current HTTP request
name - the name of the parameter
defaultVal - the default value to use as fallback

getLongParameters

public static long[] getLongParameters(ServletRequest request,
                                       String name)
Get an array of long parameters, return an empty array if not found.

Parameters:
request - current HTTP request
name - the name of the parameter with multiple possible values

getRequiredLongParameter

public static long getRequiredLongParameter(ServletRequest request,
                                            String name)
                                     throws ServletRequestBindingException
Get a long parameter, throwing an exception if it isn't found or isn't a number.

Parameters:
request - current HTTP request
name - the name of the parameter
Throws:
ServletRequestBindingException - a subclass of ServletException, so it doesn't need to be caught

getRequiredLongParameters

public static long[] getRequiredLongParameters(ServletRequest request,
                                               String name)
                                        throws ServletRequestBindingException
Get an array of long parameters, throwing an exception if not found or one is not a number.

Parameters:
request - current HTTP request
name - the name of the parameter with multiple possible values
Throws:
ServletRequestBindingException - a subclass of ServletException, so it doesn't need to be caught

getFloatParameter

public static Float getFloatParameter(ServletRequest request,
                                      String name)
                               throws ServletRequestBindingException
Get a Float parameter, or null if not present. Throws an exception if it the parameter value isn't a number.

Parameters:
request - current HTTP request
name - the name of the parameter
Returns:
the Float value, or null if not present
Throws:
ServletRequestBindingException - a subclass of ServletException, so it doesn't need to be caught

getFloatParameter

public static float getFloatParameter(ServletRequest request,
                                      String name,
                                      float defaultVal)
Get a float parameter, with a fallback value. Never throws an exception. Can pass a distinguished value as default to enable checks of whether it was supplied.

Parameters:
request - current HTTP request
name - the name of the parameter
defaultVal - the default value to use as fallback

getFloatParameters

public static float[] getFloatParameters(ServletRequest request,
                                         String name)
Get an array of float parameters, return an empty array if not found.

Parameters:
request - current HTTP request
name - the name of the parameter with multiple possible values

getRequiredFloatParameter

public static float getRequiredFloatParameter(ServletRequest request,
                                              String name)
                                       throws ServletRequestBindingException
Get a float parameter, throwing an exception if it isn't found or isn't a number.

Parameters:
request - current HTTP request
name - the name of the parameter
Throws:
ServletRequestBindingException - a subclass of ServletException, so it doesn't need to be caught

getRequiredFloatParameters

public static float[] getRequiredFloatParameters(ServletRequest request,
                                                 String name)
                                          throws ServletRequestBindingException
Get an array of float parameters, throwing an exception if not found or one is not a number.

Parameters:
request - current HTTP request
name - the name of the parameter with multiple possible values
Throws:
ServletRequestBindingException - a subclass of ServletException, so it doesn't need to be caught

getDoubleParameter

public static Double getDoubleParameter(ServletRequest request,
                                        String name)
                                 throws ServletRequestBindingException
Get a Double parameter, or null if not present. Throws an exception if it the parameter value isn't a number.

Parameters:
request - current HTTP request
name - the name of the parameter
Returns:
the Double value, or null if not present
Throws:
ServletRequestBindingException - a subclass of ServletException, so it doesn't need to be caught

getDoubleParameter

public static double getDoubleParameter(ServletRequest request,
                                        String name,
                                        double defaultVal)
Get a double parameter, with a fallback value. Never throws an exception. Can pass a distinguished value as default to enable checks of whether it was supplied.

Parameters:
request - current HTTP request
name - the name of the parameter
defaultVal - the default value to use as fallback

getDoubleParameters

public static double[] getDoubleParameters(ServletRequest request,
                                           String name)
Get an array of double parameters, return an empty array if not found.

Parameters:
request - current HTTP request
name - the name of the parameter with multiple possible values

getRequiredDoubleParameter

public static double getRequiredDoubleParameter(ServletRequest request,
                                                String name)
                                         throws ServletRequestBindingException
Get a double parameter, throwing an exception if it isn't found or isn't a number.

Parameters:
request - current HTTP request
name - the name of the parameter
Throws:
ServletRequestBindingException - a subclass of ServletException, so it doesn't need to be caught

getRequiredDoubleParameters

public static double[] getRequiredDoubleParameters(ServletRequest request,
                                                   String name)
                                            throws ServletRequestBindingException
Get an array of double parameters, throwing an exception if not found or one is not a number.

Parameters:
request - current HTTP request
name - the name of the parameter with multiple possible values
Throws:
ServletRequestBindingException - a subclass of ServletException, so it doesn't need to be caught

getBooleanParameter

public static Boolean getBooleanParameter(ServletRequest request,
                                          String name)
                                   throws ServletRequestBindingException
Get a Boolean parameter, or null if not present. Throws an exception if it the parameter value isn't a boolean.

Accepts "true", "on", "yes" (any case) and "1" as values for true; treats every other non-empty value as false (i.e. parses leniently).

Parameters:
request - current HTTP request
name - the name of the parameter
Returns:
the Boolean value, or null if not present
Throws:
ServletRequestBindingException - a subclass of ServletException, so it doesn't need to be caught

getBooleanParameter

public static boolean getBooleanParameter(ServletRequest request,
                                          String name,
                                          boolean defaultVal)
Get a boolean parameter, with a fallback value. Never throws an exception. Can pass a distinguished value as default to enable checks of whether it was supplied.

Accepts "true", "on", "yes" (any case) and "1" as values for true; treats every other non-empty value as false (i.e. parses leniently).

Parameters:
request - current HTTP request
name - the name of the parameter
defaultVal - the default value to use as fallback

getBooleanParameters

public static boolean[] getBooleanParameters(ServletRequest request,
                                             String name)
Get an array of boolean parameters, return an empty array if not found.

Accepts "true", "on", "yes" (any case) and "1" as values for true; treats every other non-empty value as false (i.e. parses leniently).

Parameters:
request - current HTTP request
name - the name of the parameter with multiple possible values

getRequiredBooleanParameter

public static boolean getRequiredBooleanParameter(ServletRequest request,
                                                  String name)
                                           throws ServletRequestBindingException
Get a boolean parameter, throwing an exception if it isn't found or isn't a boolean.

Accepts "true", "on", "yes" (any case) and "1" as values for true; treats every other non-empty value as false (i.e. parses leniently).

Parameters:
request - current HTTP request
name - the name of the parameter
Throws:
ServletRequestBindingException - a subclass of ServletException, so it doesn't need to be caught

getRequiredBooleanParameters

public static boolean[] getRequiredBooleanParameters(ServletRequest request,
                                                     String name)
                                              throws ServletRequestBindingException
Get an array of boolean parameters, throwing an exception if not found or one isn't a boolean.

Accepts "true", "on", "yes" (any case) and "1" as values for true; treats every other non-empty value as false (i.e. parses leniently).

Parameters:
request - current HTTP request
name - the name of the parameter
Throws:
ServletRequestBindingException - a subclass of ServletException, so it doesn't need to be caught

getStringParameter

public static String getStringParameter(ServletRequest request,
                                        String name)
                                 throws ServletRequestBindingException
Get a String parameter, or null if not present.

Parameters:
request - current HTTP request
name - the name of the parameter
Returns:
the String value, or null if not present
Throws:
ServletRequestBindingException - a subclass of ServletException, so it doesn't need to be caught

getStringParameter

public static String getStringParameter(ServletRequest request,
                                        String name,
                                        String defaultVal)
Get a String parameter, with a fallback value. Never throws an exception. Can pass a distinguished value to default to enable checks of whether it was supplied.

Parameters:
request - current HTTP request
name - the name of the parameter
defaultVal - the default value to use as fallback

getStringParameters

public static String[] getStringParameters(ServletRequest request,
                                           String name)
Get an array of String parameters, return an empty array if not found.

Parameters:
request - current HTTP request
name - the name of the parameter with multiple possible values

getRequiredStringParameter

public static String getRequiredStringParameter(ServletRequest request,
                                                String name)
                                         throws ServletRequestBindingException
Get a String parameter, throwing an exception if it isn't found.

Parameters:
request - current HTTP request
name - the name of the parameter
Throws:
ServletRequestBindingException - a subclass of ServletException, so it doesn't need to be caught

getRequiredStringParameters

public static String[] getRequiredStringParameters(ServletRequest request,
                                                   String name)
                                            throws ServletRequestBindingException
Get an array of String parameters, throwing an exception if not found.

Parameters:
request - current HTTP request
name - the name of the parameter
Throws:
ServletRequestBindingException - a subclass of ServletException, so it doesn't need to be caught
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WebDataBinder

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.bind
Class WebDataBinder

java.lang.Object
    extended by  org.springframework.validation.DataBinder
        extended by  org.springframework.web.bind.WebDataBinder
All Implemented Interfaces:
PropertyEditorRegistry, TypeConverter
Direct Known Subclasses:
PortletRequestDataBinder, ServletRequestDataBinder, WebRequestDataBinder
public class WebDataBinder
extends DataBinder

Special DataBinder for data binding from web request parameters to JavaBean objects. Designed for web environments, but not dependent on the Servlet API; serves as base class for more specific DataBinder variants, such as ServletRequestDataBinder.

Includes support for field markers which address a common problem with HTML checkboxes and select options: detecting that a field was part of the form, but did not generate a request parameter because it was empty. A field marker allows to detect that state and reset the corresponding bean property accordingly. Default values, for parameters that are otherwise not present, can specify a value for the field other then empty.

Since:
1.2
Author:
Juergen Hoeller, Scott Andrews
See Also:
DataBinder.registerCustomEditor(java.lang.Class, java.beans.PropertyEditor),
DataBinder.setAllowedFields(java.lang.String...),
DataBinder.setRequiredFields(java.lang.String...),
setFieldMarkerPrefix(java.lang.String),
setFieldDefaultPrefix(java.lang.String),
ServletRequestDataBinder

Field Summary
static String | DEFAULT_FIELD_DEFAULT_PREFIX Default prefix that field default parameters start with, followed by the field name: e.g.
static String | DEFAULT_FIELD_MARKER_PREFIX Default prefix that field marker parameters start with, followed by the field name: e.g.
Fields inherited from class org.springframework.validation.DataBinder
DEFAULT_OBJECT_NAME, logger
Constructor Summary
WebDataBinder(Object target)
Create a new WebDataBinder instance, with default object name.
WebDataBinder(Object target, String objectName)
Create a new WebDataBinder instance.
Method Summary
protected void | bindMultipartFiles(Map<String,MultipartFile> multipartFiles, MutablePropertyValues mpvs) Bind the multipart files contained in the given request, if any (in case of a multipart request).
protected void | checkFieldDefaults(MutablePropertyValues mpvs) Check the given property values for field defaults, i.e.
protected void | checkFieldMarkers(MutablePropertyValues mpvs) Check the given property values for field markers, i.e.
protected void | doBind(MutablePropertyValues mpvs) This implementation performs a field default and marker check before delegating to the superclass binding process.
protected Object | getEmptyValue(String field, Class fieldType) Determine an empty value for the specified field.
String | getFieldDefaultPrefix() Return the prefix for parameters that mark default fields.
String | getFieldMarkerPrefix() Return the prefix for parameters that mark potentially empty fields.
boolean | isBindEmptyMultipartFiles() Return whether to bind empty MultipartFile parameters.
void | setBindEmptyMultipartFiles(boolean bindEmptyMultipartFiles) Set whether to bind empty MultipartFile parameters.
void | setFieldDefaultPrefix(String fieldDefaultPrefix) Specify a prefix that can be used for parameters that indicate default value fields, having "prefix + field" as name.
void | setFieldMarkerPrefix(String fieldMarkerPrefix) Specify a prefix that can be used for parameters that mark potentially empty fields, having "prefix + field" as name.
Methods inherited from class org.springframework.validation.DataBinder
applyPropertyValues, bind, checkAllowedFields, checkRequiredFields, close, convertIfNecessary, convertIfNecessary, findCustomEditor, getAllowedFields, getBindingErrorProcessor, getBindingResult, getConversionService, getDisallowedFields, getErrors, getInternalBindingResult, getObjectName, getPropertyAccessor, getPropertyEditorRegistry, getRequiredFields, getSimpleTypeConverter, getTarget, getTypeConverter, getValidator, initBeanPropertyAccess, initDirectFieldAccess, isAllowed, isAutoGrowNestedPaths, isIgnoreInvalidFields, isIgnoreUnknownFields, registerCustomEditor, registerCustomEditor, setAllowedFields, setAutoGrowNestedPaths, setBindingErrorProcessor, setConversionService, setDisallowedFields, setExtractOldValueForEditor, setIgnoreInvalidFields, setIgnoreUnknownFields, setMessageCodesResolver, setRequiredFields, setValidator, validate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_FIELD_MARKER_PREFIX

public static final String DEFAULT_FIELD_MARKER_PREFIX
Default prefix that field marker parameters start with, followed by the field name: e.g. "_subscribeToNewsletter" for a field "subscribeToNewsletter".

Such a marker parameter indicates that the field was visible, that is, existed in the form that caused the submission. If no corresponding field value parameter was found, the field will be reset. The value of the field marker parameter does not matter in this case; an arbitrary value can be used. This is particularly useful for HTML checkboxes and select options.

See Also:
setFieldMarkerPrefix(java.lang.String), Constant Field Values

DEFAULT_FIELD_DEFAULT_PREFIX

public static final String DEFAULT_FIELD_DEFAULT_PREFIX
Default prefix that field default parameters start with, followed by the field name: e.g. "!subscribeToNewsletter" for a field "subscribeToNewsletter".

Default parameters differ from field markers in that they provide a default value instead of an empty value.

See Also:
setFieldDefaultPrefix(java.lang.String), Constant Field Values
Constructor Detail

WebDataBinder

public WebDataBinder(Object target)
Create a new WebDataBinder instance, with default object name.

Parameters:
target - the target object to bind onto (or null if the binder is just used to convert a plain parameter value)
See Also:
DataBinder.DEFAULT_OBJECT_NAME

WebDataBinder

public WebDataBinder(Object target,
                     String objectName)
Create a new WebDataBinder instance.

Parameters:
target - the target object to bind onto (or null if the binder is just used to convert a plain parameter value)
objectName - the name of the target object
Method Detail

setFieldMarkerPrefix

public void setFieldMarkerPrefix(String fieldMarkerPrefix)
Specify a prefix that can be used for parameters that mark potentially empty fields, having "prefix + field" as name. Such a marker parameter is checked by existence: You can send any value for it, for example "visible". This is particularly useful for HTML checkboxes and select options.

Default is "_", for "_FIELD" parameters (e.g. "_subscribeToNewsletter"). Set this to null if you want to turn off the empty field check completely.

HTML checkboxes only send a value when they're checked, so it is not possible to detect that a formerly checked box has just been unchecked, at least not with standard HTML means.

One way to address this is to look for a checkbox parameter value if you know that the checkbox has been visible in the form, resetting the checkbox if no value found. In Spring web MVC, this typically happens in a custom onBind implementation.

This auto-reset mechanism addresses this deficiency, provided that a marker parameter is sent for each checkbox field, like "_subscribeToNewsletter" for a "subscribeToNewsletter" field. As the marker parameter is sent in any case, the data binder can detect an empty field and automatically reset its value.

See Also:
DEFAULT_FIELD_MARKER_PREFIX, BaseCommandController.onBind(javax.servlet.http.HttpServletRequest, java.lang.Object, org.springframework.validation.BindException)

getFieldMarkerPrefix

public String getFieldMarkerPrefix()
Return the prefix for parameters that mark potentially empty fields.

setFieldDefaultPrefix

public void setFieldDefaultPrefix(String fieldDefaultPrefix)
Specify a prefix that can be used for parameters that indicate default value fields, having "prefix + field" as name. The value of the default field is used when the field is not provided.

Default is "!", for "!FIELD" parameters (e.g. "!subscribeToNewsletter"). Set this to null if you want to turn off the field defaults completely.

HTML checkboxes only send a value when they're checked, so it is not possible to detect that a formerly checked box has just been unchecked, at least not with standard HTML means. A default field is especially useful when a checkbox represents a non-boolean value.

The presence of a default parameter preempts the behavior of a field marker for the given field.

See Also:
DEFAULT_FIELD_DEFAULT_PREFIX, BaseCommandController.onBind(javax.servlet.http.HttpServletRequest, java.lang.Object, org.springframework.validation.BindException)

getFieldDefaultPrefix

public String getFieldDefaultPrefix()
Return the prefix for parameters that mark default fields.

setBindEmptyMultipartFiles

public void setBindEmptyMultipartFiles(boolean bindEmptyMultipartFiles)
Set whether to bind empty MultipartFile parameters. Default is "true".

Turn this off if you want to keep an already bound MultipartFile when the user resubmits the form without choosing a different file. Else, the already bound MultipartFile will be replaced by an empty MultipartFile holder.

See Also:
MultipartFile

isBindEmptyMultipartFiles

public boolean isBindEmptyMultipartFiles()
Return whether to bind empty MultipartFile parameters.

doBind

protected void doBind(MutablePropertyValues mpvs)
This implementation performs a field default and marker check before delegating to the superclass binding process.

Overrides:
doBind in class DataBinder
Parameters:
mpvs - the property values to bind, as MutablePropertyValues instance
See Also:
checkFieldDefaults(org.springframework.beans.MutablePropertyValues), checkFieldMarkers(org.springframework.beans.MutablePropertyValues)

checkFieldDefaults

protected void checkFieldDefaults(MutablePropertyValues mpvs)
Check the given property values for field defaults, i.e. for fields that start with the field default prefix.

The existence of a field defaults indicates that the specified value should be used if the field is otherwise not present.

Parameters:
mpvs - the property values to be bound (can be modified)
See Also:
getFieldDefaultPrefix()

checkFieldMarkers

protected void checkFieldMarkers(MutablePropertyValues mpvs)
Check the given property values for field markers, i.e. for fields that start with the field marker prefix.

The existence of a field marker indicates that the specified field existed in the form. If the property values do not contain a corresponding field value, the field will be considered as empty and will be reset appropriately.

Parameters:
mpvs - the property values to be bound (can be modified)
See Also:
getFieldMarkerPrefix(), getEmptyValue(String, Class)

getEmptyValue

protected Object getEmptyValue(String field,
                               Class fieldType)
Determine an empty value for the specified field.

Default implementation returns Boolean.FALSE for boolean fields and an empty array of array types. Else, null is used as default.

Parameters:
field - the name of the field
fieldType - the type of the field
Returns:
the empty value (for most fields: null)

bindMultipartFiles

protected void bindMultipartFiles(Map<String,MultipartFile> multipartFiles,
                                  MutablePropertyValues mpvs)
Bind the multipart files contained in the given request, if any (in case of a multipart request).

Multipart files will only be added to the property values if they are not empty or if we're configured to bind empty multipart files too.

Parameters:
multipartFiles - Map of field name String to MultipartFile object
mpvs - the property values to be bound (can be modified)
See Also:
MultipartFile, setBindEmptyMultipartFiles(boolean)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


MissingServletRequestParameterException

org.springframework.web.bind
Class MissingServletRequestParameterException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.servlet.ServletException
                extended by  org.springframework.web.util.NestedServletException
                    extended by  org.springframework.web.bind.ServletRequestBindingException
                        extended by  org.springframework.web.bind.MissingServletRequestParameterException
All Implemented Interfaces:
Serializable
public class MissingServletRequestParameterException
extends ServletRequestBindingException

ServletRequestBindingException subclass that indicates a missing parameter.

Since:
2.0.2
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
MissingServletRequestParameterException(String parameterName, String parameterType)
Constructor for MissingServletRequestParameterException.
Method Summary
String | getMessage() Return the detail message, including the message from the nested exception if there is one.
String | getParameterName() Return the name of the offending parameter.
String | getParameterType() Return the expected type of the offending parameter.
Methods inherited from class javax.servlet.ServletException
getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

MissingServletRequestParameterException

public MissingServletRequestParameterException(String parameterName,
                                               String parameterType)
Constructor for MissingServletRequestParameterException.

Parameters:
parameterName - the name of the missing parameter
parameterType - the expected type of the missing parameter
Method Detail

getMessage

public String getMessage()
Description copied from class: NestedServletException
Return the detail message, including the message from the nested exception if there is one.

Overrides:
getMessage in class NestedServletException

getParameterName

public final String getParameterName()
Return the name of the offending parameter.

getParameterType

public final String getParameterType()
Return the expected type of the offending parameter.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletRequestBindingException

org.springframework.web.bind
Class ServletRequestBindingException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.servlet.ServletException
                extended by  org.springframework.web.util.NestedServletException
                    extended by  org.springframework.web.bind.ServletRequestBindingException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
MissingServletRequestParameterException, UnsatisfiedServletRequestParameterException
public class ServletRequestBindingException
extends NestedServletException

Fatal binding exception, thrown when we want to treat binding exceptions as unrecoverable.

Extends ServletException for convenient throwing in any Servlet resource (such as a Filter), and NestedServletException for proper root cause handling (as the plain ServletException doesn't expose its root cause at all).

Author:
Rod Johnson, Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
ServletRequestBindingException(String msg)
Constructor for ServletRequestBindingException.
ServletRequestBindingException(String msg, Throwable cause)
Constructor for ServletRequestBindingException.
Method Summary
Methods inherited from class org.springframework.web.util.NestedServletException
getMessage
Methods inherited from class javax.servlet.ServletException
getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ServletRequestBindingException

public ServletRequestBindingException(String msg)
Constructor for ServletRequestBindingException.

Parameters:
msg - the detail message

ServletRequestBindingException

public ServletRequestBindingException(String msg,
                                      Throwable cause)
Constructor for ServletRequestBindingException.

Parameters:
msg - the detail message
cause - the root cause
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UnsatisfiedServletRequestParameterException

org.springframework.web.bind
Class UnsatisfiedServletRequestParameterException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.servlet.ServletException
                extended by  org.springframework.web.util.NestedServletException
                    extended by  org.springframework.web.bind.ServletRequestBindingException
                        extended by  org.springframework.web.bind.UnsatisfiedServletRequestParameterException
All Implemented Interfaces:
Serializable
public class UnsatisfiedServletRequestParameterException
extends ServletRequestBindingException

ServletRequestBindingException subclass that indicates an unsatisfied parameter condition, as typically expressed using an @RequestMapping annotation at the @Controller type level.

Since:
3.0
Author:
Juergen Hoeller
See Also:
RequestMapping.params(), Serialized Form

Constructor Summary
UnsatisfiedServletRequestParameterException(String[] paramConditions, Map actualParams)
Create a new UnsatisfiedServletRequestParameterException.
Method Summary
Map<String,String[]> | getActualParams() Return the actual parameter Map associated with the ServletRequest.
String | getMessage() Return the detail message, including the message from the nested exception if there is one.
String[] | getParamConditions() Return the parameter conditions that have been violated.
Methods inherited from class javax.servlet.ServletException
getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

UnsatisfiedServletRequestParameterException

public UnsatisfiedServletRequestParameterException(String[] paramConditions,
                                                   Map actualParams)
Create a new UnsatisfiedServletRequestParameterException.

Parameters:
paramConditions - the parameter conditions that have been violated
actualParams - the actual parameter Map associated with the ServletRequest
Method Detail

getMessage

public String getMessage()
Description copied from class: NestedServletException
Return the detail message, including the message from the nested exception if there is one.

Overrides:
getMessage in class NestedServletException

getParamConditions

public final String[] getParamConditions()
Return the parameter conditions that have been violated.

See Also:
RequestMapping.params()

getActualParams

public final Map<String,String[]> getActualParams()
Return the actual parameter Map associated with the ServletRequest.

See Also:
ServletRequest.getParameterMap()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.web.bind.annotation

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.bind.annotation

Annotations for binding requests to controllers and handler methods as well as for binding request parameters to method arguments.

See:
Description

Interface Summary
ValueConstants Common value constants shared between bind annotations.

Enum Summary
RequestMethod Java 5 enumeration of HTTP request methods.

Annotation Types Summary
CookieValue | Annotation which indicates that a method parameter should be bound to an HTTP cookie.
ExceptionHandler | Annotation for handling exceptions in specific handler classes and/or handler methods.
InitBinder | Annotation that identifies methods which initialize the WebDataBinder which will be used for populating command and form object arguments of annotated handler methods.
Mapping | Meta annotation that indicates a web mapping annotation.
ModelAttribute | Annotation that binds a method parameter or method return value to a named model attribute, exposed to a web view.
PathVariable | Annotation which indicates that a method parameter should be bound to a URI template variable.
RequestBody | Annotation which indicates that a method parameter should be bound to the web request body.
RequestHeader | Annotation which indicates that a method parameter should be bound to a web request header.
RequestMapping | Annotation for mapping web requests onto specific handler classes and/or handler methods.
RequestParam | Annotation which indicates that a method parameter should be bound to a web request parameter.
ResponseBody | Annotation which indicates that a method return value should be bound to the web response body.
ResponseStatus | Marks a method or exception class with the status code and reason that should be returned.
SessionAttributes | Annotation that indicates the session attributes that a specific handler uses.

Package org.springframework.web.bind.annotation Description

Annotations for binding requests to controllers and handler methods as well as for binding request parameters to method arguments.


org.springframework.web.bind.annotation Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.bind.annotation

Package Hierarchies:
All Packages

Interface Hierarchy

  • org.springframework.web.bind.annotation.ValueConstants

Annotation Type Hierarchy

  • org.springframework.web.bind.annotation.SessionAttributes (implements java.lang.annotation.Annotation)
  • org.springframework.web.bind.annotation.ResponseStatus (implements java.lang.annotation.Annotation)
  • org.springframework.web.bind.annotation.ResponseBody (implements java.lang.annotation.Annotation)
  • org.springframework.web.bind.annotation.RequestParam (implements java.lang.annotation.Annotation)
  • org.springframework.web.bind.annotation.RequestMapping (implements java.lang.annotation.Annotation)
  • org.springframework.web.bind.annotation.RequestHeader (implements java.lang.annotation.Annotation)
  • org.springframework.web.bind.annotation.RequestBody (implements java.lang.annotation.Annotation)
  • org.springframework.web.bind.annotation.PathVariable (implements java.lang.annotation.Annotation)
  • org.springframework.web.bind.annotation.ModelAttribute (implements java.lang.annotation.Annotation)
  • org.springframework.web.bind.annotation.Mapping (implements java.lang.annotation.Annotation)
  • org.springframework.web.bind.annotation.InitBinder (implements java.lang.annotation.Annotation)
  • org.springframework.web.bind.annotation.ExceptionHandler (implements java.lang.annotation.Annotation)
  • org.springframework.web.bind.annotation.CookieValue (implements java.lang.annotation.Annotation)

Enum Hierarchy

  • java.lang.Object
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)
      • org.springframework.web.bind.annotation.RequestMethod


ValueConstants

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.bind.annotation
Interface ValueConstants

public interface ValueConstants

Common value constants shared between bind annotations.

Since:
3.0.1
Author:
Juergen Hoeller

Field Summary
static String DEFAULT_NONE
Constant defining a value for no default - as a replacement for null which we cannot use in annotation attributes.

Field Detail

DEFAULT_NONE

static final String DEFAULT_NONE
Constant defining a value for no default - as a replacement for null which we cannot use in annotation attributes.

This is an artificial arrangement of 16 unicode characters, with its sole purpose being to never match user-declared values.

See Also:
RequestParam.defaultValue(),
RequestHeader.defaultValue(),
CookieValue.defaultValue(),
Constant Field Values
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


RequestMethod

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

org.springframework.web.bind.annotation
Enum RequestMethod

java.lang.Object
    extended by  java.lang.Enum<RequestMethod>
        extended by  org.springframework.web.bind.annotation.RequestMethod
All Implemented Interfaces:
Serializable, Comparable<RequestMethod>
public enum RequestMethod
extends Enum<RequestMethod>

Java 5 enumeration of HTTP request methods. Intended for use with the RequestMapping.method() attribute of the RequestMapping annotation.

Note that, by default, DispatcherServlet supports GET, HEAD, POST, PUT and DELETE only. DispatcherServlet will process TRACE and OPTIONS with the default HttpServlet behavior unless explicitly told to dispatch those request types as well: Check out the "dispatchOptionsRequest" and "dispatchTraceRequest" properties, switching them to "true" if necessary.

Since:
2.5
Author:
Juergen Hoeller
See Also:
RequestMapping, FrameworkServlet.setDispatchOptionsRequest(boolean), FrameworkServlet.setDispatchTraceRequest(boolean)

Enum Constant Summary
DELETE
GET
HEAD
OPTIONS
POST
PUT
TRACE
Method Summary
static RequestMethod | valueOf(String name) Returns the enum constant of this type with the specified name.
static RequestMethod[] | values() Returns an array containing the constants of this enum type, in the order they are declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

GET

public static final RequestMethod GET

HEAD

public static final RequestMethod HEAD

POST

public static final RequestMethod POST

PUT

public static final RequestMethod PUT

DELETE

public static final RequestMethod DELETE

OPTIONS

public static final RequestMethod OPTIONS

TRACE

public static final RequestMethod TRACE
Method Detail

values

public static RequestMethod[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (RequestMethod c : RequestMethod.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static RequestMethod valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


CookieValue

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

org.springframework.web.bind.annotation
Annotation Type CookieValue

@Target(value=PARAMETER)
@Retention(value=RUNTIME)
@Documented
public @interface CookieValue

Annotation which indicates that a method parameter should be bound to an HTTP cookie. Supported for annotated handler methods in Servlet and Portlet environments.

The method parameter may be declared as type Cookie or as cookie value type (String, int, etc).

Since:
3.0
Author:
Juergen Hoeller
See Also:
RequestMapping, RequestParam, RequestHeader, RequestMapping, AnnotationMethodHandlerAdapter, AnnotationMethodHandlerAdapter

Optional Element Summary
String | defaultValue The default value to use as a fallback.
boolean | required Whether the header is required.
String | value The name of the cookie to bind to.

value

public abstract String value
The name of the cookie to bind to.

Default:
""

required

public abstract boolean required
Whether the header is required.

Default is true, leading to an exception being thrown in case the header is missing in the request. Switch this to false if you prefer a null in case of the missing header.

Alternatively, provide a defaultValue, which implicitly sets this flag to false.

Default:
true

defaultValue

public abstract String defaultValue
The default value to use as a fallback. Supplying a default value implicitly sets required() to false.

Default:
"\n\t\t\n\t\t\n\ue000\ue001\ue002\n\t\t\t\t\n"
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS | FRAMES    NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT


ExceptionHandler

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.web.bind.annotation
Annotation Type ExceptionHandler

@Target(value=METHOD)
@Retention(value=RUNTIME)
@Documented
public @interface ExceptionHandler

Annotation for handling exceptions in specific handler classes and/or handler methods. Provides consistent style between Servlet and Portlet environments, with the semantics adapting to the concrete environment.

Handler methods which are annotated with this annotation are allowed to have very flexible signatures. They may have arguments of the following types, in arbitrary order:

  • An exception argument: declared as a general Exception or as a more specific exception. This also serves as a mapping hint if the annotation itself does not narrow the exception types through its value().
  • Request and/or response objects (Servlet API or Portlet API). You may choose any specific request/response type, e.g. ServletRequest / HttpServletRequest or PortletRequest / ActionRequest / RenderRequest. Note that in the Portlet case, an explicitly declared action/render argument is also used for mapping specific request types onto a handler method (in case of no other information given that differentiates between action and render requests).
  • Session object (Servlet API or Portlet API): either HttpSession or PortletSession. An argument of this type will enforce the presence of a corresponding session. As a consequence, such an argument will never be null. Note that session access may not be thread-safe, in particular in a Servlet environment: Consider switching the "synchronizeOnSession" flag to "true" if multiple requests are allowed to access a session concurrently.
  • WebRequest or NativeWebRequest. Allows for generic request parameter access as well as request/session attribute access, without ties to the native Servlet/Portlet API.
  • Locale for the current request locale (determined by the most specific locale resolver available, i.e. the configured LocaleResolver in a Servlet environment and the portal locale in a Portlet environment).
  • InputStream / Reader for access to the request's content. This will be the raw InputStream/Reader as exposed by the Servlet/Portlet API.
  • OutputStream / Writer for generating the response's content. This will be the raw OutputStream/Writer as exposed by the Servlet/Portlet API.

The following return types are supported for handler methods:

  • A ModelAndView object (Servlet MVC or Portlet MVC).
  • A Model object, with the view name implicitly determined through a RequestToViewNameTranslator.
  • A Map object for exposing a model, with the view name implicitly determined through a RequestToViewNameTranslator.
  • A View object.
  • A String value which is interpreted as view name.
  • void if the method handles the response itself (by writing the response content directly, declaring an argument of type ServletResponse / HttpServletResponse / RenderResponse for that purpose) or if the view name is supposed to be implicitly determined through a RequestToViewNameTranslator (not declaring a response argument in the handler method signature; only applicable in a Servlet environment).

In Servlet environments, you can combine the ExceptionHandler annotation with @ResponseStatus, to define the response status for the HTTP response.

Note: In Portlet environments, ExceptionHandler annotated methods will only be called during the render and resource phases - just like HandlerExceptionResolver beans would. Exceptions carried over from the action and event phases will be invoked during the render phase as well, with exception handler methods having to be present on the controller class that defines the applicable render method.

Since:
3.0
Author:
Arjen Poutsma, Juergen Hoeller
See Also:
WebRequest, AnnotationMethodHandlerExceptionResolver, AnnotationMethodHandlerExceptionResolver

Optional Element Summary
 Class<? extends Throwable>[] value
Exceptions handled by the annotation method.

value

public abstract Class<? extends Throwable>[] value
Exceptions handled by the annotation method. If empty, will default to any exceptions listed in the method argument list.

Default:
{}
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


InitBinder

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.web.bind.annotation
Annotation Type InitBinder

@Target(value=METHOD)
@Retention(value=RUNTIME)
@Documented
public @interface InitBinder

Annotation that identifies methods which initialize the WebDataBinder which will be used for populating command and form object arguments of annotated handler methods.

Such init-binder methods support all arguments that RequestMapping supports, except for command/form objects and corresponding validation result objects. Init-binder methods must not have a return value; they are usually declared as void.

Typical arguments are WebDataBinder in combination with WebRequest or Locale, allowing to register context-specific editors.

Since:
2.5
Author:
Juergen Hoeller
See Also:
WebDataBinder, WebRequest

Optional Element Summary
 String[] value
The names of command/form attributes and/or request parameters that this init-binder method is supposed to apply to.

value

public abstract String[] value
The names of command/form attributes and/or request parameters that this init-binder method is supposed to apply to.

Default is to apply to all command/form attributes and all request parameters processed by the annotated handler class. Specifying model attribute names or request parameter names here restricts the init-binder method to those specific attributes/parameters, with different init-binder methods typically applying to different groups of attributes or parameters.

Default:
{}
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Mapping

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.web.bind.annotation
Annotation Type Mapping

@Target(value=ANNOTATION_TYPE)
@Retention(value=RUNTIME)
public @interface Mapping

Meta annotation that indicates a web mapping annotation.

Since:
3.0
Author:
Juergen Hoeller
See Also:
RequestMapping

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


ModelAttribute

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.web.bind.annotation
Annotation Type ModelAttribute

@Target(value={PARAMETER,METHOD})
@Retention(value=RUNTIME)
@Documented
public @interface ModelAttribute

Annotation that binds a method parameter or method return value to a named model attribute, exposed to a web view. Supported for RequestMapping annotated handler classes.

Can be used to expose command objects to a web view, using specific attribute names, through annotating corresponding parameters of a RequestMapping annotated handler method).

Can also be used to expose reference data to a web view through annotating accessor methods in a controller class which is based on RequestMapping annotated handler methods, with such accessor methods allowed to have any arguments that RequestMapping supports for handler methods, returning the model attribute value to expose.

Since:
2.5
Author:
Juergen Hoeller

Optional Element Summary
 String value
The name of the model attribute to bind to.

value

public abstract String value
The name of the model attribute to bind to.

The default model attribute name is inferred from the declared attribute type (i.e. the method parameter type or method return type), based on the non-qualified class name: e.g. "orderAddress" for class "mypackage.OrderAddress", or "orderAddressList" for "List<mypackage.OrderAddress>".

Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


PathVariable

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.web.bind.annotation
Annotation Type PathVariable

@Target(value=PARAMETER)
@Retention(value=RUNTIME)
@Documented
public @interface PathVariable

Annotation which indicates that a method parameter should be bound to a URI template variable. Supported for RequestMapping annotated handler methods in Servlet environments.

Since:
3.0
Author:
Arjen Poutsma
See Also:
RequestMapping, AnnotationMethodHandlerAdapter

Optional Element Summary
 String value
The URI template variable to bind to.

value

public abstract String value
The URI template variable to bind to.

Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


RequestBody

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.web.bind.annotation
Annotation Type RequestBody

@Target(value=PARAMETER)
@Retention(value=RUNTIME)
@Documented
public @interface RequestBody

Annotation which indicates that a method parameter should be bound to the web request body. Supported for annotated handler methods in Servlet environments.

Since:
3.0
Author:
Arjen Poutsma
See Also:
RequestHeader, ResponseBody, AnnotationMethodHandlerAdapter

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


RequestHeader

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.web.bind.annotation
Annotation Type RequestHeader

@Target(value=PARAMETER)
@Retention(value=RUNTIME)
@Documented
public @interface RequestHeader

Annotation which indicates that a method parameter should be bound to a web request header. Supported for annotated handler methods in Servlet and Portlet environments.

Since:
3.0
Author:
Juergen Hoeller
See Also:
RequestMapping, RequestParam, CookieValue, AnnotationMethodHandlerAdapter, AnnotationMethodHandlerAdapter

Optional Element Summary
String | defaultValue The default value to use as a fallback.
boolean | required Whether the header is required.
String | value The name of the request header to bind to.

value

public abstract String value
The name of the request header to bind to.

Default:
""

required

public abstract boolean required
Whether the header is required.

Default is true, leading to an exception thrown in case of the header missing in the request. Switch this to false if you prefer a null in case of the header missing.

Alternatively, provide a defaultValue, which implicitely sets this flag to false.

Default:
true

defaultValue

public abstract String defaultValue
The default value to use as a fallback. Supplying a default value implicitely sets required() to false.

Default:
"\n\t\t\n\t\t\n\ue000\ue001\ue002\n\t\t\t\t\n"
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


RequestMapping

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.web.bind.annotation
Annotation Type RequestMapping

@Target(value={METHOD,TYPE})
@Retention(value=RUNTIME)
@Documented
public @interface RequestMapping

Annotation for mapping web requests onto specific handler classes and/or handler methods. Provides consistent style between Servlet and Portlet environments, with the semantics adapting to the concrete environment.

NOTE: Method-level mappings are only allowed to narrow the mapping expressed at the class level (if any). In the Servlet case, an HTTP path needs to uniquely map onto one specific handler bean (not spread across multiple handler beans); the remaining mapping parameters and conditions are effectively assertions only. In the Portlet case, a portlet mode in combination with specific parameter conditions needs to uniquely map onto one specific handler bean, with all conditions evaluated for mapping purposes. It is strongly recommended to co-locate related handler methods into the same bean and therefore keep the mappings simple and intuitive.

Handler methods which are annotated with this annotation are allowed to have very flexible signatures. They may have arguments of the following types, in arbitrary order (except for validation results, which need to follow right after the corresponding command object, if desired):

  • Request and/or response objects (Servlet API or Portlet API). You may choose any specific request/response type, e.g. ServletRequest / HttpServletRequest or PortletRequest / ActionRequest / RenderRequest. Note that in the Portlet case, an explicitly declared action/render argument is also used for mapping specific request types onto a handler method (in case of no other information given that differentiates between action and render requests).
  • Session object (Servlet API or Portlet API): either HttpSession or PortletSession. An argument of this type will enforce the presence of a corresponding session. As a consequence, such an argument will never be null. Note that session access may not be thread-safe, in particular in a Servlet environment: Consider switching the "synchronizeOnSession" flag to "true" if multiple requests are allowed to access a session concurrently.
  • WebRequest or NativeWebRequest. Allows for generic request parameter access as well as request/session attribute access, without ties to the native Servlet/Portlet API.
  • Locale for the current request locale (determined by the most specific locale resolver available, i.e. the configured LocaleResolver in a Servlet environment and the portal locale in a Portlet environment).
  • InputStream / Reader for access to the request's content. This will be the raw InputStream/Reader as exposed by the Servlet/Portlet API.
  • OutputStream / Writer for generating the response's content. This will be the raw OutputStream/Writer as exposed by the Servlet/Portlet API.
  • @PathVariable annotated parameters for access to URI template values (i.e. /hotels/{hotel}). Variable values will be converted to the declared method argument type. By default, the URI template will match against the regular expression [^\.]* (i.e. any character other than period), but this can be changed by specifying another regular expression, like so: /hotels/{hotel:\d+}.
  • @RequestParam annotated parameters for access to specific Servlet/Portlet request parameters. Parameter values will be converted to the declared method argument type. Additionally, @RequestParam can be used on a Map<String, String> or MultiValueMap<String, String> method parameter to gain access to all request parameters.
  • @RequestHeader annotated parameters for access to specific Servlet/Portlet request HTTP headers. Parameter values will be converted to the declared method argument type. Additionally, @RequestHeader can be used on a Map<String, String>, MultiValueMap<String, String>, or HttpHeaders method parameter to gain access to all request headers.
  • @RequestBody annotated parameters for access to the Servlet request HTTP contents. The request stream will be converted to the declared method argument type using message converters.
  • HttpEntity<?> parameters for access to the Servlet request HTTP headers and contents. The request stream will be converted to the entity body using message converters.
  • Map / Model / ModelMap for enriching the implicit model that will be exposed to the web view.
  • Command/form objects to bind parameters to: as bean properties or fields, with customizable type conversion, depending on InitBinder methods and/or the HandlerAdapter configuration - see the "webBindingInitializer" property on AnnotationMethodHandlerAdapter. Such command objects along with their validation results will be exposed as model attributes, by default using the non-qualified command class name in property notation (e.g. "orderAddress" for type "mypackage.OrderAddress"). Specify a parameter-level ModelAttribute annotation for declaring a specific model attribute name.
  • Errors / BindingResult validation results for a preceding command/form object (the immediate preceding argument).
  • SessionStatus status handle for marking form processing as complete (triggering the cleanup of session attributes that have been indicated by the SessionAttributes annotation at the handler type level).

The following return types are supported for handler methods:

  • A ModelAndView object (Servlet MVC or Portlet MVC), with the model implicitly enriched with command objects and the results of ModelAttribute annotated reference data accessor methods.
  • A Model object, with the view name implicitly determined through a RequestToViewNameTranslator and the model implicitly enriched with command objects and the results of ModelAttribute annotated reference data accessor methods.
  • A Map object for exposing a model, with the view name implicitly determined through a RequestToViewNameTranslator and the model implicitly enriched with command objects and the results of ModelAttribute annotated reference data accessor methods.
  • A View object, with the model implicitly determined through command objects and ModelAttribute annotated reference data accessor methods. The handler method may also programmatically enrich the model by declaring a Model argument (see above).
  • A String value which is interpreted as view name, with the model implicitly determined through command objects and ModelAttribute annotated reference data accessor methods. The handler method may also programmatically enrich the model by declaring a ModelMap argument (see above).
  • @ResponseBody annotated methods for access to the Servlet response HTTP contents. The return value will be converted to the response stream using message converters.
  • A HttpEntity<?> or ResponseEntity<?> object to access to the Servlet reponse HTTP headers and contents. The entity body will be converted to the response stream using message converters.
  • void if the method handles the response itself (by writing the response content directly, declaring an argument of type ServletResponse / HttpServletResponse / RenderResponse for that purpose) or if the view name is supposed to be implicitly determined through a RequestToViewNameTranslator (not declaring a response argument in the handler method signature; only applicable in a Servlet environment).
  • Any other return type will be considered as single model attribute to be exposed to the view, using the attribute name specified through ModelAttribute at the method level (or the default attribute name based on the return type's class name otherwise). The model will be implicitly enriched with command objects and the results of ModelAttribute annotated reference data accessor methods.

NOTE: @RequestMapping will only be processed if a corresponding HandlerMapping (for type level annotations) and/or HandlerAdapter (for method level annotations) is present in the dispatcher. This is the case by default in both DispatcherServlet and DispatcherPortlet. However, if you are defining custom HandlerMappings or HandlerAdapters, then you need to make sure that a corresponding custom DefaultAnnotationHandlerMapping and/or AnnotationMethodHandlerAdapter is defined as well - provided that you intend to use @RequestMapping.

NOTE: When using controller interfaces (e.g. for AOP proxying), make sure to consistently put all your mapping annotations - such as @RequestMapping and @SessionAttributes - on the controller interface rather than on the implementation class.

Since:
2.5
Author:
Juergen Hoeller, Arjen Poutsma, Sam Brannen
See Also:
RequestParam, ModelAttribute, SessionAttributes, InitBinder, WebRequest, DefaultAnnotationHandlerMapping, AnnotationMethodHandlerAdapter, DefaultAnnotationHandlerMapping, AnnotationMethodHandlerAdapter

Optional Element Summary
String[] | headers The headers of the mapped request, narrowing the primary mapping.
RequestMethod[] | method The HTTP request methods to map to, narrowing the primary mapping: GET, POST, HEAD, OPTIONS, PUT, DELETE, TRACE.
String[] | params The parameters of the mapped request, narrowing the primary mapping.
String[] | value The primary mapping expressed by this annotation.

value

public abstract String[] value
The primary mapping expressed by this annotation.

In a Servlet environment: the path mapping URIs (e.g. "/myPath.do"). Ant-style path patterns are also supported (e.g. "/myPath/*.do"). At the method level, relative paths (e.g. "edit.do") are supported within the primary mapping expressed at the type level.

In a Portlet environment: the mapped portlet modes (i.e. "EDIT", "VIEW", "HELP" or any custom modes).

Supported at the type level as well as at the method level! When used at the type level, all method-level mappings inherit this primary mapping, narrowing it for a specific handler method.

In case of Servlet-based handler methods, the method names are taken into account for narrowing if no path was specified explicitly, according to the specified MethodNameResolver (by default an InternalPathMethodNameResolver). Note that this only applies in case of ambiguous annotation mappings that do not specify a path mapping explicitly. In other words, the method name is only used for narrowing among a set of matching methods; it does not constitute a primary path mapping itself.

If you have a single default method (without explicit path mapping), then all requests without a more specific mapped method found will be dispatched to it. If you have multiple such default methods, then the method name will be taken into account for choosing between them.

Default:
{}

method

public abstract RequestMethod[] method
The HTTP request methods to map to, narrowing the primary mapping: GET, POST, HEAD, OPTIONS, PUT, DELETE, TRACE.

Supported at the type level as well as at the method level! When used at the type level, all method-level mappings inherit this HTTP method restriction (i.e. the type-level restriction gets checked before the handler method is even resolved).

Supported for Servlet environments as well as Portlet 2.0 environments.

Default:
{}

params

public abstract String[] params
The parameters of the mapped request, narrowing the primary mapping.

Same format for any environment: a sequence of "myParam=myValue" style expressions, with a request only mapped if each such parameter is found to have the given value. "myParam" style expressions are also supported, with such parameters having to be present in the request (allowed to have any value). Finally, "!myParam" style expressions indicate that the specified parameter is not supposed to be present in the request.

Supported at the type level as well as at the method level! When used at the type level, all method-level mappings inherit this parameter restriction (i.e. the type-level restriction gets checked before the handler method is even resolved).

In a Servlet environment, parameter mappings are considered as restrictions that are enforced at the type level. The primary path mapping (i.e. the specified URI value) still has to uniquely identify the target handler, with parameter mappings simply expressing preconditions for invoking the handler.

In a Portlet environment, parameters are taken into account as mapping differentiators, i.e. the primary portlet mode mapping plus the parameter conditions uniquely identify the target handler. Different handlers may be mapped onto the same portlet mode, as long as their parameter mappings differ.

Default:
{}

headers

public abstract String[] headers
The headers of the mapped request, narrowing the primary mapping.

Same format for any environment: a sequence of "My-Header=myValue" style expressions, with a request only mapped if each such header is found to have the given value. "My-Header" style expressions are also supported, with such headers having to be present in the request (allowed to have any value). Finally, "!My-Header" style expressions indicate that the specified header is not supposed to be present in the request.

Also supports media type wildcards (*), for headers such as Accept and Content-Type. For instance,

 @RequestMapping(value = "/something", headers = "content-type=text/*")
will match requests with a Content-Type of "text/html", "text/plain", etc.

Supported at the type level as well as at the method level! When used at the type level, all method-level mappings inherit this header restriction (i.e. the type-level restriction gets checked before the handler method is even resolved).

Maps against HttpServletRequest headers in a Servlet environment, and against PortletRequest properties in a Portlet 2.0 environment.

See Also:
MediaType
Default:
{}
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


RequestParam

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.web.bind.annotation
Annotation Type RequestParam

@Target(value=PARAMETER)
@Retention(value=RUNTIME)
@Documented
public @interface RequestParam

Annotation which indicates that a method parameter should be bound to a web request parameter. Supported for annotated handler methods in Servlet and Portlet environments.

Since:
2.5
Author:
Arjen Poutsma, Juergen Hoeller
See Also:
RequestMapping, RequestHeader, CookieValue, AnnotationMethodHandlerAdapter, AnnotationMethodHandlerAdapter

Optional Element Summary
String | defaultValue The default value to use as a fallback.
boolean | required Whether the parameter is required.
String | value The name of the request parameter to bind to.

value

public abstract String value
The name of the request parameter to bind to.

Default:
""

required

public abstract boolean required
Whether the parameter is required.

Default is true, leading to an exception thrown in case of the parameter missing in the request. Switch this to false if you prefer a null in case of the parameter missing.

Alternatively, provide a defaultValue, which implicitly sets this flag to false.

Default:
true

defaultValue

public abstract String defaultValue
The default value to use as a fallback. Supplying a default value implicitly sets required() to false.

Default:
"\n\t\t\n\t\t\n\ue000\ue001\ue002\n\t\t\t\t\n"
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


ResponseBody

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.web.bind.annotation
Annotation Type ResponseBody

@Target(value=METHOD)
@Retention(value=RUNTIME)
@Documented
public @interface ResponseBody

Annotation which indicates that a method return value should be bound to the web response body. Supported for annotated handler methods in Servlet environments.

Since:
3.0
Author:
Arjen Poutsma
See Also:
RequestBody, AnnotationMethodHandlerAdapter

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


ResponseStatus

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.web.bind.annotation
Annotation Type ResponseStatus

@Target(value={TYPE,METHOD})
@Retention(value=RUNTIME)
@Documented
public @interface ResponseStatus

Marks a method or exception class with the status code and reason that should be returned. The status code is applied to the HTTP response when the handler method is invoked, or whenever said exception is thrown.

Since:
3.0
Author:
Arjen Poutsma
See Also:
ResponseStatusExceptionResolver

Required Element Summary
 HttpStatus value
The status code to use for the response.
Optional Element Summary
 String reason
The reason to be used for the response.

Element Detail

value

public abstract HttpStatus value
The status code to use for the response.

See Also:
HttpServletResponse.setStatus(int)

reason

public abstract String reason
The reason to be used for the response.

If this element is not set, it will default to the standard status message for the status code.

See Also:
HttpServletResponse.sendError(int, String)
Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


SessionAttributes

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.web.bind.annotation
Annotation Type SessionAttributes

@Target(value=TYPE)
@Retention(value=RUNTIME)
@Inherited
@Documented
public @interface SessionAttributes

Annotation that indicates the session attributes that a specific handler uses. This will typically list the names of model attributes which should be transparently stored in the session or some conversational storage, serving as form-backing beans. Declared at the type level, applying to the model attributes that the annotated handler class operates on.

NOTE: Session attributes as indicated using this annotation correspond to a specific handler's model attributes, getting transparently stored in a conversational session. Those attributes will be removed once the handler indicates completion of its conversational session. Therefore, use this facility for such conversational attributes which are supposed to be stored in the session temporarily during the course of a specific handler's conversation.

For permanent session attributes, e.g. a user authentication object, use the traditional session.setAttribute method instead. Alternatively, consider using the attribute management capabilities of the generic WebRequest interface.

NOTE: When using controller interfaces (e.g. for AOP proxying), make sure to consistently put all your mapping annotations - such as @RequestMapping and @SessionAttributes - on the controller interface rather than on the implementation class.

Since:
2.5
Author:
Juergen Hoeller

Optional Element Summary
Class[] | types The types of session attributes in the model, to be stored in the session or some conversational storage.
String[] | value The names of session attributes in the model, to be stored in the session or some conversational storage.

value

public abstract String[] value
The names of session attributes in the model, to be stored in the session or some conversational storage.

Note: This indicates the model attribute names. The session attribute names may or may not match the model attribute names; applications should not rely on the session attribute names but rather operate on the model only.

Default:
{}

types

public abstract Class[] types
The types of session attributes in the model, to be stored in the session or some conversational storage. All model attributes of this type will be stored in the session, regardless of attribute name.

Default:
{}
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


org.springframework.web.bind.annotation.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.bind.annotation.support

Support classes for web annotation processing.

See:
Description

Class Summary
HandlerMethodInvoker | Support class for invoking an annotated handler method.
HandlerMethodResolver | Support class for resolving web method annotations in a handler type.

Exception Summary
HandlerMethodInvocationException Exception indicating that the execution of an annotated MVC handler method failed.

Package org.springframework.web.bind.annotation.support Description

Support classes for web annotation processing.


org.springframework.web.bind.annotation.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.bind.annotation.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.web.bind.annotation.support.HandlerMethodInvoker
    • org.springframework.web.bind.annotation.support.HandlerMethodResolver
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.web.bind.annotation.support.HandlerMethodInvocationException


HandlerMethodInvoker

org.springframework.web.bind.annotation.support
Class HandlerMethodInvoker

java.lang.Object
    extended by  org.springframework.web.bind.annotation.support.HandlerMethodInvoker

public class HandlerMethodInvoker
extends Object

Support class for invoking an annotated handler method. Operates on the introspection results of a HandlerMethodResolver for a specific handler type.

Used by AnnotationMethodHandlerAdapter and AnnotationMethodHandlerAdapter.

Since:
2.5.2
Author:
Juergen Hoeller, Arjen Poutsma
See Also:
invokeHandlerMethod(java.lang.reflect.Method, java.lang.Object, org.springframework.web.context.request.NativeWebRequest, org.springframework.ui.ExtendedModelMap)

Constructor Summary
HandlerMethodInvoker(HandlerMethodResolver methodResolver)
HandlerMethodInvoker(HandlerMethodResolver methodResolver, WebBindingInitializer bindingInitializer)
HandlerMethodInvoker(HandlerMethodResolver methodResolver, WebBindingInitializer bindingInitializer, SessionAttributeStore sessionAttributeStore, ParameterNameDiscoverer parameterNameDiscoverer, WebArgumentResolver[] customArgumentResolvers, HttpMessageConverter[] messageConverters)
Method Summary
protected void | addReturnValueAsModelAttribute(Method handlerMethod, Class handlerType, Object returnValue, ExtendedModelMap implicitModel)
protected WebDataBinder | createBinder(NativeWebRequest webRequest, Object target, String objectName)
protected HttpInputMessage | createHttpInputMessage(NativeWebRequest webRequest) Return a HttpInputMessage for the given NativeWebRequest.
protected HttpOutputMessage | createHttpOutputMessage(NativeWebRequest webRequest) Return a HttpOutputMessage for the given NativeWebRequest.
protected void | doBind(WebDataBinder binder, NativeWebRequest webRequest)
protected void | initBinder(Object handler, String attrName, WebDataBinder binder, NativeWebRequest webRequest)
Object | invokeHandlerMethod(Method handlerMethod, Object handler, NativeWebRequest webRequest, ExtendedModelMap implicitModel)
protected boolean | isBindingCandidate(Object value) Determine whether the given value qualifies as a "binding candidate", i.e.
protected String | parseDefaultValueAttribute(String value)
protected void | raiseMissingCookieException(String cookieName, Class paramType)
protected void | raiseMissingHeaderException(String headerName, Class paramType)
protected void | raiseMissingParameterException(String paramName, Class paramType)
protected void | raiseSessionRequiredException(String message)
protected Object | resolveCommonArgument(MethodParameter methodParameter, NativeWebRequest webRequest)
protected Object | resolveCookieValue(String cookieName, Class paramType, NativeWebRequest webRequest) Resolves the given @CookieValue annotation.
protected Object | resolveDefaultValue(String value)
protected String | resolvePathVariable(String pathVarName, Class paramType, NativeWebRequest webRequest) Resolves the given @PathVariable annotation.
protected Object | resolveRequestBody(MethodParameter methodParam, NativeWebRequest webRequest, Object handler) Resolves the given @RequestBody annotation.
protected Object | resolveStandardArgument(Class parameterType, NativeWebRequest webRequest)
void | updateModelAttributes(Object handler, Map<String,Object> mavModel, ExtendedModelMap implicitModel, NativeWebRequest webRequest)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

HandlerMethodInvoker

public HandlerMethodInvoker(HandlerMethodResolver methodResolver)

HandlerMethodInvoker

public HandlerMethodInvoker(HandlerMethodResolver methodResolver,
                            WebBindingInitializer bindingInitializer)

HandlerMethodInvoker

public HandlerMethodInvoker(HandlerMethodResolver methodResolver,
                            WebBindingInitializer bindingInitializer,
                            SessionAttributeStore sessionAttributeStore,
                            ParameterNameDiscoverer parameterNameDiscoverer,
                            WebArgumentResolver[] customArgumentResolvers,
                            HttpMessageConverter[] messageConverters)
Method Detail

invokeHandlerMethod

public final Object invokeHandlerMethod(Method handlerMethod,
                                        Object handler,
                                        NativeWebRequest webRequest,
                                        ExtendedModelMap implicitModel)
                                 throws Exception
Throws:
Exception

updateModelAttributes

public final void updateModelAttributes(Object handler,
                                        Map<String,Object> mavModel,
                                        ExtendedModelMap implicitModel,
                                        NativeWebRequest webRequest)
                                 throws Exception
Throws:
Exception

initBinder

protected void initBinder(Object handler,
                          String attrName,
                          WebDataBinder binder,
                          NativeWebRequest webRequest)
                   throws Exception
Throws:
Exception

resolveRequestBody

protected Object resolveRequestBody(MethodParameter methodParam,
                                    NativeWebRequest webRequest,
                                    Object handler)
                             throws Exception
Resolves the given @RequestBody annotation.

Throws:
Exception

resolveCookieValue

protected Object resolveCookieValue(String cookieName,
                                    Class paramType,
                                    NativeWebRequest webRequest)
                             throws Exception
Resolves the given @CookieValue annotation.

Throws an UnsupportedOperationException by default.

Throws:
Exception

resolvePathVariable

protected String resolvePathVariable(String pathVarName,
                                     Class paramType,
                                     NativeWebRequest webRequest)
                              throws Exception
Resolves the given @PathVariable annotation.

Throws an UnsupportedOperationException by default.

Throws:
Exception

isBindingCandidate

protected boolean isBindingCandidate(Object value)
Determine whether the given value qualifies as a "binding candidate", i.e. might potentially be subject to bean-style data binding later on.

raiseMissingParameterException

protected void raiseMissingParameterException(String paramName,
                                              Class paramType)
                                       throws Exception
Throws:
Exception

raiseMissingHeaderException

protected void raiseMissingHeaderException(String headerName,
                                           Class paramType)
                                    throws Exception
Throws:
Exception

raiseMissingCookieException

protected void raiseMissingCookieException(String cookieName,
                                           Class paramType)
                                    throws Exception
Throws:
Exception

raiseSessionRequiredException

protected void raiseSessionRequiredException(String message)
                                      throws Exception
Throws:
Exception

createBinder

protected WebDataBinder createBinder(NativeWebRequest webRequest,
                                     Object target,
                                     String objectName)
                              throws Exception
Throws:
Exception

doBind

protected void doBind(WebDataBinder binder,
                      NativeWebRequest webRequest)
               throws Exception
Throws:
Exception

createHttpInputMessage

protected HttpInputMessage createHttpInputMessage(NativeWebRequest webRequest)
                                           throws Exception
Return a HttpInputMessage for the given NativeWebRequest.

Throws an UnsupportedOperation1Exception by default.

Throws:
Exception

createHttpOutputMessage

protected HttpOutputMessage createHttpOutputMessage(NativeWebRequest webRequest)
                                             throws Exception
Return a HttpOutputMessage for the given NativeWebRequest.

Throws an UnsupportedOperationException by default.

Throws:
Exception

parseDefaultValueAttribute

protected String parseDefaultValueAttribute(String value)

resolveDefaultValue

protected Object resolveDefaultValue(String value)

resolveCommonArgument

protected Object resolveCommonArgument(MethodParameter methodParameter,
                                       NativeWebRequest webRequest)
                                throws Exception
Throws:
Exception

resolveStandardArgument

protected Object resolveStandardArgument(Class parameterType,
                                         NativeWebRequest webRequest)
                                  throws Exception
Throws:
Exception

addReturnValueAsModelAttribute

protected final void addReturnValueAsModelAttribute(Method handlerMethod,
                                                    Class handlerType,
                                                    Object returnValue,
                                                    ExtendedModelMap implicitModel)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HandlerMethodResolver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.bind.annotation.support
Class HandlerMethodResolver

java.lang.Object
    extended by  org.springframework.web.bind.annotation.support.HandlerMethodResolver

public class HandlerMethodResolver
extends Object

Support class for resolving web method annotations in a handler type. Processes @RequestMapping, @InitBinder, @ModelAttribute and @SessionAttributes.

Used by AnnotationMethodHandlerAdapter and AnnotationMethodHandlerAdapter.

Since:
2.5.2
Author:
Juergen Hoeller
See Also:
RequestMapping, InitBinder, ModelAttribute, SessionAttributes

Constructor Summary
HandlerMethodResolver()
Method Summary
Set<String> | getActualSessionAttributeNames()
Set<Method> | getHandlerMethods()
Set<Method> | getInitBinderMethods()
Set<Method> | getModelAttributeMethods()
RequestMapping | getTypeLevelMapping()
boolean | hasHandlerMethods()
boolean | hasSessionAttributes()
boolean | hasTypeLevelMapping()
void | init(Class<?> handlerType) Initialize a new HandlerMethodResolver for the specified handler type.
protected boolean | isHandlerMethod(Method method)
boolean | isSessionAttribute(String attrName, Class attrType)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

HandlerMethodResolver

public HandlerMethodResolver()
Method Detail

init

public void init(Class<?> handlerType)
Initialize a new HandlerMethodResolver for the specified handler type.

Parameters:
handlerType - the handler class to introspect

isHandlerMethod

protected boolean isHandlerMethod(Method method)

hasHandlerMethods

public final boolean hasHandlerMethods()

getHandlerMethods

public final Set<Method> getHandlerMethods()

getInitBinderMethods

public final Set<Method> getInitBinderMethods()

getModelAttributeMethods

public final Set<Method> getModelAttributeMethods()

hasTypeLevelMapping

public boolean hasTypeLevelMapping()

getTypeLevelMapping

public RequestMapping getTypeLevelMapping()

hasSessionAttributes

public boolean hasSessionAttributes()

isSessionAttribute

public boolean isSessionAttribute(String attrName,
                                  Class attrType)

getActualSessionAttributeNames

public Set<String> getActualSessionAttributeNames()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


HandlerMethodInvocationException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.bind.annotation.support
Class HandlerMethodInvocationException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.web.bind.annotation.support.HandlerMethodInvocationException
All Implemented Interfaces:
Serializable
public class HandlerMethodInvocationException
extends NestedRuntimeException

Exception indicating that the execution of an annotated MVC handler method failed.

Since:
2.5.6
Author:
Juergen Hoeller
See Also:
HandlerMethodInvoker.invokeHandlerMethod(java.lang.reflect.Method, java.lang.Object, org.springframework.web.context.request.NativeWebRequest, org.springframework.ui.ExtendedModelMap), Serialized Form

Constructor Summary
HandlerMethodInvocationException(Method handlerMethod, Throwable cause)
Create a new HandlerMethodInvocationException for the given Method handle and cause.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

HandlerMethodInvocationException

public HandlerMethodInvocationException(Method handlerMethod,
                                        Throwable cause)
Create a new HandlerMethodInvocationException for the given Method handle and cause.

Parameters:
handlerMethod - the handler method handle
cause - the cause of the invocation failure
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.bind.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.bind.support

Support classes for web data binding.

See:
Description

Interface Summary
SessionAttributeStore | Strategy interface for storing model attributes in a backend session.
SessionStatus | Simple interface that can be injected into handler methods, allowing them to signal that their session processing is complete.
WebArgumentResolver | SPI for resolving custom arguments for a specific handler method parameter.
WebBindingInitializer | Callback interface for initializing a WebDataBinder for performing data binding in the context of a specific web request.

Class Summary
ConfigurableWebBindingInitializer | Convenient WebBindingInitializer for declarative configuration in a Spring application context.
DefaultSessionAttributeStore | Default implementation of the SessionAttributeStore interface, storing the attributes in the WebRequest session (i.e.
SimpleSessionStatus | Simple implementation of the SessionStatus interface, keeping the complete flag as an instance variable.
WebRequestDataBinder | Special DataBinder to perform data binding from web request parameters to JavaBeans, including support for multipart files.

Package org.springframework.web.bind.support Description

Support classes for web data binding.


org.springframework.web.bind.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.bind.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.web.bind.support.ConfigurableWebBindingInitializer (implements org.springframework.web.bind.support.WebBindingInitializer)
    • org.springframework.validation.DataBinder (implements org.springframework.beans.PropertyEditorRegistry, org.springframework.beans.TypeConverter)
      • org.springframework.web.bind.WebDataBinder
        • org.springframework.web.bind.support.WebRequestDataBinder
    • org.springframework.web.bind.support.DefaultSessionAttributeStore (implements org.springframework.web.bind.support.SessionAttributeStore)
    • org.springframework.web.bind.support.SimpleSessionStatus (implements org.springframework.web.bind.support.SessionStatus)

Interface Hierarchy

  • org.springframework.web.bind.support.SessionAttributeStore
  • org.springframework.web.bind.support.SessionStatus
  • org.springframework.web.bind.support.WebArgumentResolver
  • org.springframework.web.bind.support.WebBindingInitializer


SessionAttributeStore

org.springframework.web.bind.support
Interface SessionAttributeStore

All Known Implementing Classes:
DefaultSessionAttributeStore
public interface SessionAttributeStore

Strategy interface for storing model attributes in a backend session.

Since:
2.5
Author:
Juergen Hoeller
See Also:
SessionAttributes

Method Summary
void | cleanupAttribute(WebRequest request, String attributeName) Clean up the specified attribute in the backend session.
Object | retrieveAttribute(WebRequest request, String attributeName) Retrieve the specified attribute from the backend session.
void | storeAttribute(WebRequest request, String attributeName, Object attributeValue) Store the supplied attribute in the backend session.

Method Detail

storeAttribute

void storeAttribute(WebRequest request,
                    String attributeName,
                    Object attributeValue)
Store the supplied attribute in the backend session.

Can be called for new attributes as well as for existing attributes. In the latter case, this signals that the attribute value may have been modified.

Parameters:
request - the current request
attributeName - the name of the attribute
attributeValue - the attribute value to store

retrieveAttribute

Object retrieveAttribute(WebRequest request,
                         String attributeName)
Retrieve the specified attribute from the backend session.

This will typically be called with the expectation that the attribute is already present, with an exception to be thrown if this method returns null.

Parameters:
request - the current request
attributeName - the name of the attribute
Returns:
the current attribute value, or null if none

cleanupAttribute

void cleanupAttribute(WebRequest request,
                      String attributeName)
Clean up the specified attribute in the backend session.

Indicates that the attribute name will not be used anymore.

Parameters:
request - the current request
attributeName - the name of the attribute
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SessionStatus

org.springframework.web.bind.support
Interface SessionStatus

All Known Implementing Classes:
SimpleSessionStatus
public interface SessionStatus

Simple interface that can be injected into handler methods, allowing them to signal that their session processing is complete. The handler invoker may then follow up with appropriate cleanup, e.g. of session attributes which have been implicitly created during this handler's processing (according to the @SessionAttributes annotation).

Since:
2.5
Author:
Juergen Hoeller
See Also:
RequestMapping, SessionAttributes

Method Summary
boolean | isComplete() Return whether the current handler's session processing has been marked as complete.
void | setComplete() Mark the current handler's session processing as complete, allowing for cleanup of session attributes.

Method Detail

setComplete

void setComplete()
Mark the current handler's session processing as complete, allowing for cleanup of session attributes.

isComplete

boolean isComplete()
Return whether the current handler's session processing has been marked as complete.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WebArgumentResolver

org.springframework.web.bind.support
Interface WebArgumentResolver

public interface WebArgumentResolver

SPI for resolving custom arguments for a specific handler method parameter. Typically implemented to detect special parameter types, resolving well-known argument values for them.

A typical implementation could look like as follows:

 public class MySpecialArgumentResolver implements WebArgumentResolver {

   public Object resolveArgument(MethodParameter methodParameter, NativeWebRequest webRequest) {
     if (methodParameter.getParameterType().equals(MySpecialArg.class)) {
       return new MySpecialArg("myValue");
     }
     return UNRESOLVED;
   }
 }

Since:
2.5.2
Author:
Juergen Hoeller
See Also:
AnnotationMethodHandlerAdapter.setCustomArgumentResolvers(org.springframework.web.bind.support.WebArgumentResolver[]), AnnotationMethodHandlerAdapter.setCustomArgumentResolvers(org.springframework.web.bind.support.WebArgumentResolver[])

Field Summary
static Object UNRESOLVED
Marker to be returned when the resolver does not know how to handle the given method parameter.
Method Summary
 Object resolveArgument(MethodParameter methodParameter, NativeWebRequest webRequest)
Resolve an argument for the given handler method parameter within the given web request.

Field Detail

UNRESOLVED

static final Object UNRESOLVED
Marker to be returned when the resolver does not know how to handle the given method parameter.

Method Detail

resolveArgument

Object resolveArgument(MethodParameter methodParameter,
                       NativeWebRequest webRequest)
                       throws Exception
Resolve an argument for the given handler method parameter within the given web request.

Parameters:
methodParameter - the handler method parameter to resolve
webRequest - the current web request, allowing access to the native request as well
Returns:
the argument value, or UNRESOLVED if not resolvable
Throws:
Exception - in case of resolution failure
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WebBindingInitializer

org.springframework.web.bind.support
Interface WebBindingInitializer

All Known Implementing Classes:
ConfigurableWebBindingInitializer
public interface WebBindingInitializer

Callback interface for initializing a WebDataBinder for performing data binding in the context of a specific web request.

Since:
2.5
Author:
Juergen Hoeller

Method Summary
 void initBinder(WebDataBinder binder, WebRequest request)
Initialize the given DataBinder for the given request.

Method Detail

initBinder

void initBinder(WebDataBinder binder,
                WebRequest request)
Initialize the given DataBinder for the given request.

Parameters:
binder - the DataBinder to initialize
request - the web request that the data binding happens within
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConfigurableWebBindingInitializer

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.bind.support
Class ConfigurableWebBindingInitializer

java.lang.Object
    extended by  org.springframework.web.bind.support.ConfigurableWebBindingInitializer
All Implemented Interfaces:
WebBindingInitializer
public class ConfigurableWebBindingInitializer
extends Object
implements WebBindingInitializer

Convenient WebBindingInitializer for declarative configuration in a Spring application context. Allows for reusing pre-configured initializers with multiple controller/handlers.

Since:
2.5
Author:
Juergen Hoeller
See Also:
setDirectFieldAccess(boolean), setMessageCodesResolver(org.springframework.validation.MessageCodesResolver), setBindingErrorProcessor(org.springframework.validation.BindingErrorProcessor), setValidator(Validator), setConversionService(ConversionService), setPropertyEditorRegistrar(org.springframework.beans.PropertyEditorRegistrar)

Constructor Summary
ConfigurableWebBindingInitializer()
Method Summary
BindingErrorProcessor | getBindingErrorProcessor() Return the strategy to use for processing binding errors.
ConversionService | getConversionService() Return the ConversionService which will apply to every DataBinder.
MessageCodesResolver | getMessageCodesResolver() Return the strategy to use for resolving errors into message codes.
PropertyEditorRegistrar[] | getPropertyEditorRegistrars() Return the PropertyEditorRegistrars to be applied to every DataBinder.
Validator | getValidator() Return the Validator to apply after each binding step, if any.
void | initBinder(WebDataBinder binder, WebRequest request) Initialize the given DataBinder for the given request.
void | setBindingErrorProcessor(BindingErrorProcessor bindingErrorProcessor) Set the strategy to use for processing binding errors, that is, required field errors and PropertyAccessExceptions.
void | setConversionService(ConversionService conversionService) Specify a ConversionService which will apply to every DataBinder.
void | setDirectFieldAccess(boolean directFieldAccess) Set whether to use direct field access instead of bean property access.
void | setMessageCodesResolver(MessageCodesResolver messageCodesResolver) Set the strategy to use for resolving errors into message codes.
void | setPropertyEditorRegistrar(PropertyEditorRegistrar propertyEditorRegistrar) Specify a single PropertyEditorRegistrar to be applied to every DataBinder.
void | setPropertyEditorRegistrars(PropertyEditorRegistrar[] propertyEditorRegistrars) Specify multiple PropertyEditorRegistrars to be applied to every DataBinder.
void | setValidator(Validator validator) Set the Validator to apply after each binding step.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ConfigurableWebBindingInitializer

public ConfigurableWebBindingInitializer()
Method Detail

setDirectFieldAccess

public final void setDirectFieldAccess(boolean directFieldAccess)
Set whether to use direct field access instead of bean property access.

Default is false, using bean property access. Switch this to true for enforcing direct field access.

setMessageCodesResolver

public final void setMessageCodesResolver(MessageCodesResolver messageCodesResolver)
Set the strategy to use for resolving errors into message codes. Applies the given strategy to all data binders used by this controller.

Default is null, i.e. using the default strategy of the data binder.

See Also:
DataBinder.setMessageCodesResolver(org.springframework.validation.MessageCodesResolver)

getMessageCodesResolver

public final MessageCodesResolver getMessageCodesResolver()
Return the strategy to use for resolving errors into message codes.

setBindingErrorProcessor

public final void setBindingErrorProcessor(BindingErrorProcessor bindingErrorProcessor)
Set the strategy to use for processing binding errors, that is, required field errors and PropertyAccessExceptions.

Default is null, that is, using the default strategy of the data binder.

See Also:
DataBinder.setBindingErrorProcessor(org.springframework.validation.BindingErrorProcessor)

getBindingErrorProcessor

public final BindingErrorProcessor getBindingErrorProcessor()
Return the strategy to use for processing binding errors.

setValidator

public final void setValidator(Validator validator)
Set the Validator to apply after each binding step.

getValidator

public final Validator getValidator()
Return the Validator to apply after each binding step, if any.

setConversionService

public final void setConversionService(ConversionService conversionService)
Specify a ConversionService which will apply to every DataBinder.

Since:
3.0

getConversionService

public final ConversionService getConversionService()
Return the ConversionService which will apply to every DataBinder.

setPropertyEditorRegistrar

public final void setPropertyEditorRegistrar(PropertyEditorRegistrar propertyEditorRegistrar)
Specify a single PropertyEditorRegistrar to be applied to every DataBinder.

setPropertyEditorRegistrars

public final void setPropertyEditorRegistrars(PropertyEditorRegistrar[] propertyEditorRegistrars)
Specify multiple PropertyEditorRegistrars to be applied to every DataBinder.

getPropertyEditorRegistrars

public final PropertyEditorRegistrar[] getPropertyEditorRegistrars()
Return the PropertyEditorRegistrars to be applied to every DataBinder.

initBinder

public void initBinder(WebDataBinder binder,
                       WebRequest request)
Description copied from interface: WebBindingInitializer
Initialize the given DataBinder for the given request.

Specified by:
initBinder in interface WebBindingInitializer
Parameters:
binder - the DataBinder to initialize
request - the web request that the data binding happens within
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


DefaultSessionAttributeStore

org.springframework.web.bind.support
Class DefaultSessionAttributeStore

java.lang.Object
    extended by  org.springframework.web.bind.support.DefaultSessionAttributeStore
All Implemented Interfaces:
SessionAttributeStore
public class DefaultSessionAttributeStore
extends Object
implements SessionAttributeStore

Default implementation of the SessionAttributeStore interface, storing the attributes in the WebRequest session (i.e. HttpSession or PortletSession).

Since:
2.5
Author:
Juergen Hoeller
See Also:
setAttributeNamePrefix(java.lang.String),
RequestAttributes.setAttribute(java.lang.String, java.lang.Object, int),
RequestAttributes.getAttribute(java.lang.String, int),
RequestAttributes.removeAttribute(java.lang.String, int)

Constructor Summary
DefaultSessionAttributeStore()
Method Summary
void | cleanupAttribute(WebRequest request, String attributeName) Clean up the specified attribute in the backend session.
protected String | getAttributeNameInSession(WebRequest request, String attributeName) Calculate the attribute name in the backend session.
Object | retrieveAttribute(WebRequest request, String attributeName) Retrieve the specified attribute from the backend session.
void | setAttributeNamePrefix(String attributeNamePrefix) Specify a prefix to use for the attribute names in the backend session.
void | storeAttribute(WebRequest request, String attributeName, Object attributeValue) Store the supplied attribute in the backend session.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DefaultSessionAttributeStore

public DefaultSessionAttributeStore()
Method Detail

setAttributeNamePrefix

public void setAttributeNamePrefix(String attributeNamePrefix)
Specify a prefix to use for the attribute names in the backend session.

Default is to use no prefix, storing the session attributes with the same name as in the model.

storeAttribute

public void storeAttribute(WebRequest request,
                           String attributeName,
                           Object attributeValue)
Description copied from interface: SessionAttributeStore
Store the supplied attribute in the backend session.

Can be called for new attributes as well as for existing attributes. In the latter case, this signals that the attribute value may have been modified.

Specified by:
storeAttribute in interface SessionAttributeStore
Parameters:
request - the current request
attributeName - the name of the attribute
attributeValue - the attribute value to store

retrieveAttribute

public Object retrieveAttribute(WebRequest request,
                                String attributeName)
Description copied from interface: SessionAttributeStore
Retrieve the specified attribute from the backend session.

This will typically be called with the expectation that the attribute is already present, with an exception to be thrown if this method returns null.

Specified by:
retrieveAttribute in interface SessionAttributeStore
Parameters:
request - the current request
attributeName - the name of the attribute
Returns:
the current attribute value, or null if none

cleanupAttribute

public void cleanupAttribute(WebRequest request,
                             String attributeName)
Description copied from interface: SessionAttributeStore
Clean up the specified attribute in the backend session.

Indicates that the attribute name will not be used anymore.

Specified by:
cleanupAttribute in interface SessionAttributeStore
Parameters:
request - the current request
attributeName - the name of the attribute

getAttributeNameInSession

protected String getAttributeNameInSession(WebRequest request,
                                           String attributeName)
Calculate the attribute name in the backend session.

The default implementation simply prepends the configured "attributeNamePrefix", if any.

Parameters:
request - the current request
attributeName - the name of the attribute
Returns:
the attribute name in the backend session
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleSessionStatus

org.springframework.web.bind.support
Class SimpleSessionStatus

java.lang.Object
    extended by  org.springframework.web.bind.support.SimpleSessionStatus
All Implemented Interfaces:
SessionStatus
public class SimpleSessionStatus
extends Object
implements SessionStatus

Simple implementation of the SessionStatus interface, keeping the complete flag as an instance variable.

Since:
2.5
Author:
Juergen Hoeller

Constructor Summary
SimpleSessionStatus()
Method Summary
boolean | isComplete() Return whether the current handler's session processing has been marked as complete.
void | setComplete() Mark the current handler's session processing as complete, allowing for cleanup of session attributes.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleSessionStatus

public SimpleSessionStatus()
Method Detail

setComplete

public void setComplete()
Description copied from interface: SessionStatus
Mark the current handler's session processing as complete, allowing for cleanup of session attributes.

Specified by:
setComplete in interface SessionStatus

isComplete

public boolean isComplete()
Description copied from interface: SessionStatus
Return whether the current handler's session processing has been marked as complete.

Specified by:
isComplete in interface SessionStatus
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WebRequestDataBinder

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.bind.support
Class WebRequestDataBinder

java.lang.Object
    extended by  org.springframework.validation.DataBinder
        extended by  org.springframework.web.bind.WebDataBinder
            extended by  org.springframework.web.bind.support.WebRequestDataBinder
All Implemented Interfaces:
PropertyEditorRegistry, TypeConverter
public class WebRequestDataBinder
extends WebDataBinder

Special DataBinder to perform data binding from web request parameters to JavaBeans, including support for multipart files.

See the DataBinder/WebDataBinder superclasses for customization options, which include specifying allowed/required fields, and registering custom property editors.

Can also used for manual data binding in custom web controllers or interceptors that build on Spring's WebRequest abstraction: e.g. in a WebRequestInterceptor implementation. Simply instantiate a WebRequestDataBinder for each binding process, and invoke bind with the current WebRequest as argument:

 MyBean myBean = new MyBean();
 // apply binder to custom target object
 WebRequestDataBinder binder = new WebRequestDataBinder(myBean);
 // register custom editors, if desired
 binder.registerCustomEditor(...);
 // trigger actual binding of request parameters
 binder.bind(request);
 // optionally evaluate binding errors
 Errors errors = binder.getErrors();
 ...

Since:
2.5.2
Author:
Juergen Hoeller
See Also:
bind(org.springframework.web.context.request.WebRequest),
DataBinder.registerCustomEditor(java.lang.Class, java.beans.PropertyEditor),
DataBinder.setAllowedFields(java.lang.String...),
DataBinder.setRequiredFields(java.lang.String...),
WebDataBinder.setFieldMarkerPrefix(java.lang.String)

Field Summary
Fields inherited from class org.springframework.web.bind.WebDataBinder
DEFAULT_FIELD_DEFAULT_PREFIX, DEFAULT_FIELD_MARKER_PREFIX
Fields inherited from class org.springframework.validation.DataBinder
DEFAULT_OBJECT_NAME, logger
Constructor Summary
WebRequestDataBinder(Object target)
Create a new WebRequestDataBinder instance, with default object name.
WebRequestDataBinder(Object target, String objectName)
Create a new WebRequestDataBinder instance.
Method Summary
void | bind(WebRequest request) Bind the parameters of the given request to this binder's target, also binding multipart files in case of a multipart request.
void | closeNoCatch() Treats errors as fatal.
Methods inherited from class org.springframework.web.bind.WebDataBinder
bindMultipartFiles, checkFieldDefaults, checkFieldMarkers, doBind, getEmptyValue, getFieldDefaultPrefix, getFieldMarkerPrefix, isBindEmptyMultipartFiles, setBindEmptyMultipartFiles, setFieldDefaultPrefix, setFieldMarkerPrefix
Methods inherited from class org.springframework.validation.DataBinder
applyPropertyValues, bind, checkAllowedFields, checkRequiredFields, close, convertIfNecessary, convertIfNecessary, findCustomEditor, getAllowedFields, getBindingErrorProcessor, getBindingResult, getConversionService, getDisallowedFields, getErrors, getInternalBindingResult, getObjectName, getPropertyAccessor, getPropertyEditorRegistry, getRequiredFields, getSimpleTypeConverter, getTarget, getTypeConverter, getValidator, initBeanPropertyAccess, initDirectFieldAccess, isAllowed, isAutoGrowNestedPaths, isIgnoreInvalidFields, isIgnoreUnknownFields, registerCustomEditor, registerCustomEditor, setAllowedFields, setAutoGrowNestedPaths, setBindingErrorProcessor, setConversionService, setDisallowedFields, setExtractOldValueForEditor, setIgnoreInvalidFields, setIgnoreUnknownFields, setMessageCodesResolver, setRequiredFields, setValidator, validate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

WebRequestDataBinder

public WebRequestDataBinder(Object target)
Create a new WebRequestDataBinder instance, with default object name.

Parameters:
target - the target object to bind onto (or null if the binder is just used to convert a plain parameter value)
See Also:
DataBinder.DEFAULT_OBJECT_NAME

WebRequestDataBinder

public WebRequestDataBinder(Object target,
                            String objectName)
Create a new WebRequestDataBinder instance.

Parameters:
target - the target object to bind onto (or null if the binder is just used to convert a plain parameter value)
objectName - the name of the target object
Method Detail

bind

public void bind(WebRequest request)
Bind the parameters of the given request to this binder's target, also binding multipart files in case of a multipart request.

This call can create field errors, representing basic binding errors like a required field (code "required"), or type mismatch between value and bean property (code "typeMismatch").

Multipart files are bound via their parameter name, just like normal HTTP parameters: i.e. "uploadedFile" to an "uploadedFile" bean property, invoking a "setUploadedFile" setter method.

The type of the target property for a multipart file can be MultipartFile, byte[], or String. The latter two receive the contents of the uploaded file; all metadata like original file name, content type, etc are lost in those cases.

Parameters:
request - request with parameters to bind (can be multipart)
See Also:
MultipartRequest, MultipartFile, WebDataBinder.bindMultipartFiles(java.util.Map, org.springframework.beans.MutablePropertyValues), DataBinder.bind(org.springframework.beans.PropertyValues)

closeNoCatch

public void closeNoCatch()
                  throws BindException
Treats errors as fatal.

Use this method only if it's an error if the input isn't valid. This might be appropriate if all input is from dropdowns, for example.

Throws:
BindException - if binding errors have been encountered
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.client

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.client

Core package of the client-side web support.

See:
Description

Interface Summary
RequestCallback | Callback interface for code that operates on a ClientHttpRequest.
ResponseErrorHandler | Strategy interface used by the RestTemplate to determine whether a particular response has an error or not.
ResponseExtractor<T> | Generic callback interface used by RestTemplate's retrieval methods Implementations of this interface perform the actual work of extracting data from a ClientHttpResponse, but don't need to worry about exception handling or closing resources.
RestOperations | Interface specifying a basic set of RESTful operations.

Class Summary
DefaultResponseErrorHandler | Default implementation of the ResponseErrorHandler interface.
HttpMessageConverterExtractor<T> | Response extractor that uses the given entity converters to convert the response into a type T.
RestTemplate | The central class for client-side HTTP access. It simplifies communication with HTTP servers, and enforces RESTful principles.

Exception Summary
HttpClientErrorException | Exception thrown when an HTTP 4xx is received.
HttpServerErrorException | Exception thrown when an HTTP 5xx is received.
HttpStatusCodeException | Abstract base class for exceptions based on an HttpStatus.
ResourceAccessException | Exception thrown when an I/O error occurs.
RestClientException | Base class for exceptions thrown by RestTemplate whenever it encounters client-side HTTP errors.

Package org.springframework.web.client Description

Core package of the client-side web support. Provides a RestTemplate class and various callback interfaces.


org.springframework.web.client Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.client

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.web.client.DefaultResponseErrorHandler (implements org.springframework.web.client.ResponseErrorHandler)
    • org.springframework.http.client.support.HttpAccessor
      • org.springframework.web.client.RestTemplate (implements org.springframework.web.client.RestOperations)
    • org.springframework.web.client.HttpMessageConverterExtractor<T> (implements org.springframework.web.client.ResponseExtractor<T>)
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.web.client.RestClientException
              • org.springframework.web.client.HttpStatusCodeException
                • org.springframework.web.client.HttpClientErrorException
                • org.springframework.web.client.HttpServerErrorException
              • org.springframework.web.client.ResourceAccessException

Interface Hierarchy

  • org.springframework.web.client.RequestCallback
  • org.springframework.web.client.ResponseErrorHandler
  • org.springframework.web.client.ResponseExtractor<T>
  • org.springframework.web.client.RestOperations


RequestCallback

org.springframework.web.client
Interface RequestCallback

public interface RequestCallback

Callback interface for code that operates on a ClientHttpRequest. Allows to manipulate the request headers, and write to the request body.

Used internally by the RestTemplate, but also useful for application code.

Since:
3.0
Author:
Arjen Poutsma
See Also:
RestTemplate.execute(java.lang.String, org.springframework.http.HttpMethod, org.springframework.web.client.RequestCallback, org.springframework.web.client.ResponseExtractor, java.lang.Object...)

Method Summary
 void doWithRequest(ClientHttpRequest request)
Gets called by RestTemplate.execute(java.lang.String, org.springframework.http.HttpMethod, org.springframework.web.client.RequestCallback, org.springframework.web.client.ResponseExtractor, java.lang.Object...) with an opened ClientHttpRequest.

Method Detail

doWithRequest

void doWithRequest(ClientHttpRequest request)
                   throws IOException
Gets called by RestTemplate.execute(java.lang.String, org.springframework.http.HttpMethod, org.springframework.web.client.RequestCallback, org.springframework.web.client.ResponseExtractor, java.lang.Object...) with an opened ClientHttpRequest. Does not need to care about closing the request or about handling errors: this will all be handled by the RestTemplate.

Parameters:
request - the active HTTP request
Throws:
IOException - in case of I/O errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResponseErrorHandler

org.springframework.web.client
Interface ResponseErrorHandler

All Known Implementing Classes:
DefaultResponseErrorHandler
public interface ResponseErrorHandler

Strategy interface used by the RestTemplate to determine whether a particular response has an error or not.

Since:
3.0
Author:
Arjen Poutsma

Method Summary
void | handleError(ClientHttpResponse response) Handles the error in the given response.
boolean | hasError(ClientHttpResponse response) Indicates whether the given response has any errors.

Method Detail

hasError

boolean hasError(ClientHttpResponse response)
                 throws IOException
Indicates whether the given response has any errors. Implementations will typically inspect the HttpStatus of the response.

Parameters:
response - the response to inspect
Returns:
true if the response has an error; false otherwise
Throws:
IOException - in case of I/O errors

handleError

void handleError(ClientHttpResponse response)
                 throws IOException
Handles the error in the given response. This method is only called when hasError(ClientHttpResponse) has returned true.

Parameters:
response - the response with the error
Throws:
IOException - in case of I/O errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResponseExtractor

org.springframework.web.client
Interface ResponseExtractor<T>

All Known Implementing Classes:
HttpMessageConverterExtractor
public interface ResponseExtractor<T>

Generic callback interface used by RestTemplate's retrieval methods Implementations of this interface perform the actual work of extracting data from a ClientHttpResponse, but don't need to worry about exception handling or closing resources.

Used internally by the RestTemplate, but also useful for application code.

Since:
3.0
Author:
Arjen Poutsma
See Also:
RestTemplate.execute(java.lang.String, org.springframework.http.HttpMethod, org.springframework.web.client.RequestCallback, org.springframework.web.client.ResponseExtractor, java.lang.Object...)

Method Summary
 T extractData(ClientHttpResponse response)
Extract data from the given ClientHttpResponse and return it.

Method Detail

extractData

T extractData(ClientHttpResponse response)
              throws IOException
Extract data from the given ClientHttpResponse and return it.

Parameters:
response - the HTTP response
Returns:
the extracted data
Throws:
IOException - in case of I/O errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RestOperations

org.springframework.web.client
Interface RestOperations

All Known Implementing Classes:
RestTemplate
public interface RestOperations

Interface specifying a basic set of RESTful operations. Implemented by RestTemplate. Not often used directly, but a useful option to enhance testability, as it can easily be mocked or stubbed.

Since:
3.0
Author:
Arjen Poutsma, Juergen Hoeller
See Also:
RestTemplate

Method Summary
 void delete(String url, Map<String,?> uriVariables)
Delete the resources at the specified URI.
 void delete(String url, Object... uriVariables)
Delete the resources at the specified URI.
 void delete(URI url)
Delete the resources at the specified URL.
<T> ResponseEntity<T>
exchange(String url, HttpMethod method, HttpEntity<?> requestEntity, Class<T> responseType, Map<String,?> uriVariables)
Execute the HTTP method to the given URI template, writing the given request entity to the request, and returns the response as ResponseEntity.
<T> ResponseEntity<T>
exchange(String url, HttpMethod method, HttpEntity<?> requestEntity, Class<T> responseType, Object... uriVariables)
Execute the HTTP method to the given URI template, writing the given request entity to the request, and returns the response as ResponseEntity.
<T> ResponseEntity<T>
exchange(URI url, HttpMethod method, HttpEntity<?> requestEntity, Class<T> responseType)
Execute the HTTP method to the given URI template, writing the given request entity to the request, and returns the response as ResponseEntity.
<T> T
execute(String url, HttpMethod method, RequestCallback requestCallback, ResponseExtractor<T> responseExtractor, Map<String,?> uriVariables)
Execute the HTTP method to the given URI template, preparing the request with the RequestCallback, and reading the response with a ResponseExtractor.
<T> T
execute(String url, HttpMethod method, RequestCallback requestCallback, ResponseExtractor<T> responseExtractor, Object... uriVariables)
Execute the HTTP method to the given URI template, preparing the request with the RequestCallback, and reading the response with a ResponseExtractor.
<T> T
execute(URI url, HttpMethod method, RequestCallback requestCallback, ResponseExtractor<T> responseExtractor)
Execute the HTTP method to the given URL, preparing the request with the RequestCallback, and reading the response with a ResponseExtractor.
<T> ResponseEntity<T>
getForEntity(String url, Class<T> responseType, Map<String,?> uriVariables)
Retrieve a representation by doing a GET on the URI template.
<T> ResponseEntity<T>
getForEntity(String url, Class<T> responseType, Object... uriVariables)
Retrieve an entity by doing a GET on the specified URL.
<T> ResponseEntity<T>
getForEntity(URI url, Class<T> responseType)
Retrieve a representation by doing a GET on the URL .
<T> T
getForObject(String url, Class<T> responseType, Map<String,?> uriVariables)
Retrieve a representation by doing a GET on the URI template.
<T> T
getForObject(String url, Class<T> responseType, Object... uriVariables)
Retrieve a representation by doing a GET on the specified URL.
<T> T
getForObject(URI url, Class<T> responseType)
Retrieve a representation by doing a GET on the URL .
 HttpHeaders headForHeaders(String url, Map<String,?> uriVariables)
Retrieve all headers of the resource specified by the URI template.
 HttpHeaders headForHeaders(String url, Object... uriVariables)
Retrieve all headers of the resource specified by the URI template.
 HttpHeaders headForHeaders(URI url)
Retrieve all headers of the resource specified by the URL.
 Set<HttpMethod> optionsForAllow(String url, Map<String,?> uriVariables)
Return the value of the Allow header for the given URI.
 Set<HttpMethod> optionsForAllow(String url, Object... uriVariables)
Return the value of the Allow header for the given URI.
 Set<HttpMethod> optionsForAllow(URI url)
Return the value of the Allow header for the given URL.
<T> HttpEntity<T>
postForEntity(String url, Object request, Class<T> responseType, Map<String,?> uriVariables)
Create a new resource by POSTing the given object to the URI template, and returns the response as HttpEntity.
<T> ResponseEntity<T>
postForEntity(String url, Object request, Class<T> responseType, Object... uriVariables)
Create a new resource by POSTing the given object to the URI template, and returns the response as ResponseEntity.
<T> ResponseEntity<T>
postForEntity(URI url, Object request, Class<T> responseType)
Create a new resource by POSTing the given object to the URL, and returns the response as ResponseEntity.
 URI postForLocation(String url, Object request, Map<String,?> uriVariables)
Create a new resource by POSTing the given object to the URI template, and returns the value of the Location header.
 URI postForLocation(String url, Object request, Object... uriVariables)
Create a new resource by POSTing the given object to the URI template, and returns the value of the Location header.
 URI postForLocation(URI url, Object request)
Create a new resource by POSTing the given object to the URL, and returns the value of the Location header.
<T> T
postForObject(String url, Object request, Class<T> responseType, Map<String,?> uriVariables)
Create a new resource by POSTing the given object to the URI template, and returns the representation found in the response.
<T> T
postForObject(String url, Object request, Class<T> responseType, Object... uriVariables)
Create a new resource by POSTing the given object to the URI template, and returns the representation found in the response.
<T> T
postForObject(URI url, Object request, Class<T> responseType)
Create a new resource by POSTing the given object to the URL, and returns the representation found in the response.
 void put(String url, Object request, Map<String,?> uriVariables)
Creates a new resource by PUTting the given object to URI template.
 void put(String url, Object request, Object... uriVariables)
Create or update a resource by PUTting the given object to the URI.
 void put(URI url, Object request)
Creates a new resource by PUTting the given object to URL.

Method Detail

getForObject

<T> T getForObject(String url,
                   Class<T> responseType,
                   Object... uriVariables)
               throws RestClientException
Retrieve a representation by doing a GET on the specified URL. The response (if any) is converted and returned.

URI Template variables are expanded using the given URI variables, if any.

Parameters:
url - the URL
responseType - the type of the return value
uriVariables - the variables to expand the template
Returns:
the converted object
Throws:
RestClientException

getForObject

<T> T getForObject(String url,
                   Class<T> responseType,
                   Map<String,?> uriVariables)
               throws RestClientException
Retrieve a representation by doing a GET on the URI template. The response (if any) is converted and returned.

URI Template variables are expanded using the given map.

Parameters:
url - the URL
responseType - the type of the return value
uriVariables - the map containing variables for the URI template
Returns:
the converted object
Throws:
RestClientException

getForObject

<T> T getForObject(URI url,
                   Class<T> responseType)
               throws RestClientException
Retrieve a representation by doing a GET on the URL . The response (if any) is converted and returned.

Parameters:
url - the URL
responseType - the type of the return value
Returns:
the converted object
Throws:
RestClientException

getForEntity

<T> ResponseEntity<T> getForEntity(String url,
                                   Class<T> responseType,
                                   Object... uriVariables)
                               throws RestClientException
Retrieve an entity by doing a GET on the specified URL. The response is converted and stored in an ResponseEntity.

URI Template variables are expanded using the given URI variables, if any.

Parameters:
url - the URL
responseType - the type of the return value
uriVariables - the variables to expand the template
Returns:
the entity
Throws:
RestClientException
Since:
3.0.2

getForEntity

<T> ResponseEntity<T> getForEntity(String url,
                                   Class<T> responseType,
                                   Map<String,?> uriVariables)
                               throws RestClientException
Retrieve a representation by doing a GET on the URI template. The response is converted and stored in an ResponseEntity.

URI Template variables are expanded using the given map.

Parameters:
url - the URL
responseType - the type of the return value
uriVariables - the map containing variables for the URI template
Returns:
the converted object
Throws:
RestClientException
Since:
3.0.2

getForEntity

<T> ResponseEntity<T> getForEntity(URI url,
                                   Class<T> responseType)
                               throws RestClientException
Retrieve a representation by doing a GET on the URL . The response is converted and stored in an ResponseEntity.

Parameters:
url - the URL
responseType - the type of the return value
Returns:
the converted object
Throws:
RestClientException
Since:
3.0.2

headForHeaders

HttpHeaders headForHeaders(String url,
                           Object... uriVariables)
                           throws RestClientException
Retrieve all headers of the resource specified by the URI template.

URI Template variables are expanded using the given URI variables, if any.

Parameters:
url - the URL
uriVariables - the variables to expand the template
Returns:
all HTTP headers of that resource
Throws:
RestClientException

headForHeaders

HttpHeaders headForHeaders(String url,
                           Map<String,?> uriVariables)
                           throws RestClientException
Retrieve all headers of the resource specified by the URI template.

URI Template variables are expanded using the given map.

Parameters:
url - the URL
uriVariables - the map containing variables for the URI template
Returns:
all HTTP headers of that resource
Throws:
RestClientException

headForHeaders

HttpHeaders headForHeaders(URI url)
                           throws RestClientException
Retrieve all headers of the resource specified by the URL.

Parameters:
url - the URL
Returns:
all HTTP headers of that resource
Throws:
RestClientException

postForLocation

URI postForLocation(String url,
                    Object request,
                    Object... uriVariables)
                    throws RestClientException
Create a new resource by POSTing the given object to the URI template, and returns the value of the Location header. This header typically indicates where the new resource is stored.

URI Template variables are expanded using the given URI variables, if any.

The request parameter can be a HttpEntity in order to add additional HTTP headers to the request.

Parameters:
url - the URL
request - the Object to be POSTed, may be null
uriVariables - the variables to expand the template
Returns:
the value for the Location header
Throws:
RestClientException
See Also:
HttpEntity

postForLocation

URI postForLocation(String url,
                    Object request,
                    Map<String,?> uriVariables)
                    throws RestClientException
Create a new resource by POSTing the given object to the URI template, and returns the value of the Location header. This header typically indicates where the new resource is stored.

URI Template variables are expanded using the given map.

The request parameter can be a HttpEntity in order to add additional HTTP headers to the request.

Parameters:
url - the URL
request - the Object to be POSTed, may be null
uriVariables - the variables to expand the template
Returns:
the value for the Location header
Throws:
RestClientException
See Also:
HttpEntity

postForLocation

URI postForLocation(URI url,
                    Object request)
                    throws RestClientException
Create a new resource by POSTing the given object to the URL, and returns the value of the Location header. This header typically indicates where the new resource is stored.

The request parameter can be a HttpEntity in order to add additional HTTP headers to the request.

Parameters:
url - the URL
request - the Object to be POSTed, may be null
Returns:
the value for the Location header
Throws:
RestClientException
See Also:
HttpEntity

postForObject

<T> T postForObject(String url,
                    Object request,
                    Class<T> responseType,
                    Object... uriVariables)
                throws RestClientException
Create a new resource by POSTing the given object to the URI template, and returns the representation found in the response.

URI Template variables are expanded using the given URI variables, if any.

The request parameter can be a HttpEntity in order to add additional HTTP headers to the request.

Parameters:
url - the URL
request - the Object to be POSTed, may be null
responseType - the type of the return value
uriVariables - the variables to expand the template
Returns:
the converted object
Throws:
RestClientException
See Also:
HttpEntity

postForObject

<T> T postForObject(String url,
                    Object request,
                    Class<T> responseType,
                    Map<String,?> uriVariables)
                throws RestClientException
Create a new resource by POSTing the given object to the URI template, and returns the representation found in the response.

URI Template variables are expanded using the given map.

The request parameter can be a HttpEntity in order to add additional HTTP headers to the request.

Parameters:
url - the URL
request - the Object to be POSTed, may be null
responseType - the type of the return value
uriVariables - the variables to expand the template
Returns:
the converted object
Throws:
RestClientException
See Also:
HttpEntity

postForObject

<T> T postForObject(URI url,
                    Object request,
                    Class<T> responseType)
                throws RestClientException
Create a new resource by POSTing the given object to the URL, and returns the representation found in the response.

The request parameter can be a HttpEntity in order to add additional HTTP headers to the request.

Parameters:
url - the URL
request - the Object to be POSTed, may be null
responseType - the type of the return value
Returns:
the converted object
Throws:
RestClientException
See Also:
HttpEntity

postForEntity

<T> ResponseEntity<T> postForEntity(String url,
                                    Object request,
                                    Class<T> responseType,
                                    Object... uriVariables)
                                throws RestClientException
Create a new resource by POSTing the given object to the URI template, and returns the response as ResponseEntity.

URI Template variables are expanded using the given URI variables, if any.

The request parameter can be a HttpEntity in order to add additional HTTP headers to the request.

Parameters:
url - the URL
request - the Object to be POSTed, may be null
uriVariables - the variables to expand the template
Returns:
the converted object
Throws:
RestClientException
Since:
3.0.2
See Also:
HttpEntity

postForEntity

<T> HttpEntity<T> postForEntity(String url,
                                Object request,
                                Class<T> responseType,
                                Map<String,?> uriVariables)
                            throws RestClientException
Create a new resource by POSTing the given object to the URI template, and returns the response as HttpEntity.

URI Template variables are expanded using the given map.

The request parameter can be a HttpEntity in order to add additional HTTP headers to the request.

Parameters:
url - the URL
request - the Object to be POSTed, may be null
uriVariables - the variables to expand the template
Returns:
the converted object
Throws:
RestClientException
Since:
3.0.2
See Also:
HttpEntity

postForEntity

<T> ResponseEntity<T> postForEntity(URI url,
                                    Object request,
                                    Class<T> responseType)
                                throws RestClientException
Create a new resource by POSTing the given object to the URL, and returns the response as ResponseEntity.

The request parameter can be a HttpEntity in order to add additional HTTP headers to the request.

Parameters:
url - the URL
request - the Object to be POSTed, may be null
Returns:
the converted object
Throws:
RestClientException
Since:
3.0.2
See Also:
HttpEntity

put

void put(String url,
         Object request,
         Object... uriVariables)
         throws RestClientException
Create or update a resource by PUTting the given object to the URI.

URI Template variables are expanded using the given URI variables, if any.

The request parameter can be a HttpEntity in order to add additional HTTP headers to the request.

Parameters:
url - the URL
request - the Object to be PUT, may be null
uriVariables - the variables to expand the template
Throws:
RestClientException
See Also:
HttpEntity

put

void put(String url,
         Object request,
         Map<String,?> uriVariables)
         throws RestClientException
Creates a new resource by PUTting the given object to URI template.

URI Template variables are expanded using the given map.

The request parameter can be a HttpEntity in order to add additional HTTP headers to the request.

Parameters:
url - the URL
request - the Object to be PUT, may be null
uriVariables - the variables to expand the template
Throws:
RestClientException
See Also:
HttpEntity

put

void put(URI url,
         Object request)
         throws RestClientException
Creates a new resource by PUTting the given object to URL.

The request parameter can be a HttpEntity in order to add additional HTTP headers to the request.

Parameters:
url - the URL
request - the Object to be PUT, may be null
Throws:
RestClientException
See Also:
HttpEntity

delete

void delete(String url,
            Object... uriVariables)
            throws RestClientException
Delete the resources at the specified URI.

URI Template variables are expanded using the given URI variables, if any.

Parameters:
url - the URL
uriVariables - the variables to expand in the template
Throws:
RestClientException

delete

void delete(String url,
            Map<String,?> uriVariables)
            throws RestClientException
Delete the resources at the specified URI.

URI Template variables are expanded using the given map.

Parameters:
url - the URL
uriVariables - the variables to expand the template
Throws:
RestClientException

delete

void delete(URI url)
            throws RestClientException
Delete the resources at the specified URL.

Parameters:
url - the URL
Throws:
RestClientException

optionsForAllow

Set<HttpMethod> optionsForAllow(String url,
                                Object... uriVariables)
                                throws RestClientException
Return the value of the Allow header for the given URI.

URI Template variables are expanded using the given URI variables, if any.

Parameters:
url - the URL
uriVariables - the variables to expand in the template
Returns:
the value of the allow header
Throws:
RestClientException

optionsForAllow

Set<HttpMethod> optionsForAllow(String url,
                                Map<String,?> uriVariables)
                                throws RestClientException
Return the value of the Allow header for the given URI.

URI Template variables are expanded using the given map.

Parameters:
url - the URL
uriVariables - the variables to expand in the template
Returns:
the value of the allow header
Throws:
RestClientException

optionsForAllow

Set<HttpMethod> optionsForAllow(URI url)
                                throws RestClientException
Return the value of the Allow header for the given URL.

Parameters:
url - the URL
Returns:
the value of the allow header
Throws:
RestClientException

exchange

<T> ResponseEntity<T> exchange(String url,
                               HttpMethod method,
                               HttpEntity<?> requestEntity,
                               Class<T> responseType,
                               Object... uriVariables)
                           throws RestClientException
Execute the HTTP method to the given URI template, writing the given request entity to the request, and returns the response as ResponseEntity.

URI Template variables are expanded using the given URI variables, if any.

Parameters:
url - the URL
method - the HTTP method (GET, POST, etc)
requestEntity - the entity (headers and/or body) to write to the request, may be null
responseType - the type of the return value
uriVariables - the variables to expand in the template
Returns:
the response as entity
Throws:
RestClientException
Since:
3.0.2

exchange

<T> ResponseEntity<T> exchange(String url,
                               HttpMethod method,
                               HttpEntity<?> requestEntity,
                               Class<T> responseType,
                               Map<String,?> uriVariables)
                           throws RestClientException
Execute the HTTP method to the given URI template, writing the given request entity to the request, and returns the response as ResponseEntity.

URI Template variables are expanded using the given URI variables, if any.

Parameters:
url - the URL
method - the HTTP method (GET, POST, etc)
requestEntity - the entity (headers and/or body) to write to the request, may be null
responseType - the type of the return value
uriVariables - the variables to expand in the template
Returns:
the response as entity
Throws:
RestClientException
Since:
3.0.2

exchange

<T> ResponseEntity<T> exchange(URI url,
                               HttpMethod method,
                               HttpEntity<?> requestEntity,
                               Class<T> responseType)
                           throws RestClientException
Execute the HTTP method to the given URI template, writing the given request entity to the request, and returns the response as ResponseEntity.

Parameters:
url - the URL
method - the HTTP method (GET, POST, etc)
requestEntity - the entity (headers and/or body) to write to the request, may be null
responseType - the type of the return value
Returns:
the response as entity
Throws:
RestClientException
Since:
3.0.2

execute

<T> T execute(String url,
              HttpMethod method,
              RequestCallback requestCallback,
              ResponseExtractor<T> responseExtractor,
              Object... uriVariables)
          throws RestClientException
Execute the HTTP method to the given URI template, preparing the request with the RequestCallback, and reading the response with a ResponseExtractor.

URI Template variables are expanded using the given URI variables, if any.

Parameters:
url - the URL
method - the HTTP method (GET, POST, etc)
requestCallback - object that prepares the request
responseExtractor - object that extracts the return value from the response
uriVariables - the variables to expand in the template
Returns:
an arbitrary object, as returned by the ResponseExtractor
Throws:
RestClientException

execute

<T> T execute(String url,
              HttpMethod method,
              RequestCallback requestCallback,
              ResponseExtractor<T> responseExtractor,
              Map<String,?> uriVariables)
          throws RestClientException
Execute the HTTP method to the given URI template, preparing the request with the RequestCallback, and reading the response with a ResponseExtractor.

URI Template variables are expanded using the given URI variables map.

Parameters:
url - the URL
method - the HTTP method (GET, POST, etc)
requestCallback - object that prepares the request
responseExtractor - object that extracts the return value from the response
uriVariables - the variables to expand in the template
Returns:
an arbitrary object, as returned by the ResponseExtractor
Throws:
RestClientException

execute

<T> T execute(URI url,
              HttpMethod method,
              RequestCallback requestCallback,
              ResponseExtractor<T> responseExtractor)
          throws RestClientException
Execute the HTTP method to the given URL, preparing the request with the RequestCallback, and reading the response with a ResponseExtractor.

Parameters:
url - the URL
method - the HTTP method (GET, POST, etc)
requestCallback - object that prepares the request
responseExtractor - object that extracts the return value from the response
Returns:
an arbitrary object, as returned by the ResponseExtractor
Throws:
RestClientException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultResponseErrorHandler

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.client
Class DefaultResponseErrorHandler

java.lang.Object
    extended by  org.springframework.web.client.DefaultResponseErrorHandler
All Implemented Interfaces:
ResponseErrorHandler
public class DefaultResponseErrorHandler
extends Object
implements ResponseErrorHandler

Default implementation of the ResponseErrorHandler interface.

This error handler checks for the status code on the ClientHttpResponse: any code with series HttpStatus.Series.CLIENT_ERROR or HttpStatus.Series.SERVER_ERROR is considered to be an error. This behavior can be changed by overriding the hasError(HttpStatus) method.

Since:
3.0
Author:
Arjen Poutsma
See Also:
RestTemplate.setErrorHandler(org.springframework.web.client.ResponseErrorHandler)

Constructor Summary
DefaultResponseErrorHandler()
Method Summary
void | handleError(ClientHttpResponse response) Handles the error in the given response.
boolean | hasError(ClientHttpResponse response) Delegates to hasError(HttpStatus) with the response status code.
protected boolean | hasError(HttpStatus statusCode) Template method called from hasError(ClientHttpResponse).
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DefaultResponseErrorHandler

public DefaultResponseErrorHandler()
Method Detail

hasError

public boolean hasError(ClientHttpResponse response)
                 throws IOException
Delegates to hasError(HttpStatus) with the response status code.

Specified by:
hasError in interface ResponseErrorHandler
Parameters:
response - the response to inspect
Returns:
true if the response has an error; false otherwise
Throws:
IOException - in case of I/O errors

hasError

protected boolean hasError(HttpStatus statusCode)
Template method called from hasError(ClientHttpResponse).

The default implementation checks if the given status code is CLIENT_ERROR or SERVER_ERROR. Can be overridden in subclasses.

Parameters:
statusCode - the HTTP status code
Returns:
true if the response has an error; false otherwise

handleError

public void handleError(ClientHttpResponse response)
                 throws IOException
Handles the error in the given response. This method is only called when ResponseErrorHandler.hasError(ClientHttpResponse) has returned true.

The default implementation throws a HttpClientErrorException if the response status code is HttpStatus.Series.CLIENT_ERROR, a HttpServerErrorException if it is HttpStatus.Series.SERVER_ERROR, and a RestClientException in other cases.

Specified by:
handleError in interface ResponseErrorHandler
Parameters:
response - the response with the error
Throws:
IOException - in case of I/O errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


HttpMessageConverterExtractor

org.springframework.web.client
Class HttpMessageConverterExtractor<T>

java.lang.Object
    extended by  org.springframework.web.client.HttpMessageConverterExtractor<T>
All Implemented Interfaces:
ResponseExtractor<T>
public class HttpMessageConverterExtractor<T>
extends Object
implements ResponseExtractor<T>

Response extractor that uses the given entity converters to convert the response into a type T.

Since:
3.0
Author:
Arjen Poutsma
See Also:
RestTemplate

Constructor Summary
HttpMessageConverterExtractor(Class<T> responseType, List<HttpMessageConverter<?>> messageConverters)
Creates a new instance of the HttpMessageConverterExtractor with the given response type and message converters.
Method Summary
 T extractData(ClientHttpResponse response)
Extract data from the given ClientHttpResponse and return it.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

HttpMessageConverterExtractor

public HttpMessageConverterExtractor(Class<T> responseType,
                                     List<HttpMessageConverter<?>> messageConverters)
Creates a new instance of the HttpMessageConverterExtractor with the given response type and message converters. The given converters must support the response type.

Method Detail

extractData

public T extractData(ClientHttpResponse response)
              throws IOException
Description copied from interface: ResponseExtractor
Extract data from the given ClientHttpResponse and return it.

Specified by:
extractData in interface ResponseExtractor<T>
Parameters:
response - the HTTP response
Returns:
the extracted data
Throws:
IOException - in case of I/O errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RestTemplate

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.client
Class RestTemplate

java.lang.Object
    extended by  org.springframework.http.client.support.HttpAccessor
        extended by  org.springframework.web.client.RestTemplate
All Implemented Interfaces:
RestOperations
public class RestTemplate
extends HttpAccessor
implements RestOperations

The central class for client-side HTTP access. It simplifies communication with HTTP servers, and enforces RESTful principles. It handles HTTP connections, leaving application code to provide URLs (with possible template variables) and extract results.

The main entry points of this template are the methods named after the six main HTTP methods:

HTTP method | RestTemplate methods
DELETE | delete(java.lang.String, java.lang.Object...)
GET | getForObject(java.lang.String, java.lang.Class, java.lang.Object...)
 | getForEntity(java.lang.String, java.lang.Class, java.lang.Object...)
HEAD | headForHeaders(java.lang.String, java.lang.Object...)
OPTIONS | optionsForAllow(java.lang.String, java.lang.Object...)
POST | postForLocation(java.lang.String, java.lang.Object, java.lang.Object...)
 | postForObject(java.lang.String, java.lang.Object, java.lang.Class, java.lang.Object...)
PUT | put(java.lang.String, java.lang.Object, java.lang.Object...)
any | exchange(java.lang.String, org.springframework.http.HttpMethod, org.springframework.http.HttpEntity, java.lang.Class, java.lang.Object...)
 | execute(java.lang.String, org.springframework.http.HttpMethod, org.springframework.web.client.RequestCallback, org.springframework.web.client.ResponseExtractor, java.lang.Object...)

For each of these HTTP methods, there are three corresponding Java methods in the RestTemplate. Two variant take a String URI as first argument (eg. getForObject(String, Class, Object[]), getForObject(String, Class, Map)), and are capable of substituting any URI templates in that URL using either a String variable arguments array, or a Map<String, String>. The string varargs variant expands the given template variables in order, so that

 String result = restTemplate.getForObject("http://example.com/hotels/{hotel}/bookings/{booking}", String.class,"42",
 "21");
will perform a GET on http://example.com/hotels/42/bookings/21. The map variant expands the template based on variable name, and is therefore more useful when using many variables, or when a single variable is used multiple times. For example:
 Map<String, String> vars = Collections.singletonMap("hotel", "42");
 String result = restTemplate.getForObject("http://example.com/hotels/{hotel}/rooms/{hotel}", String.class, vars);
will perform a GET on http://example.com/hotels/42/rooms/42. Alternatively, there are URI variant methods (getForObject(URI, Class)), which do not allow for URI templates, but allow you to reuse a single, expanded URI multiple times.

Furthermore, the String-argument methods assume that the URL String is unencoded. This means that

 restTemplate.getForObject("http://example.com/hotel list");
will perform a GET on http://example.com/hotel%20list. As a result, any URL passed that is already encoded will be encoded twice (i.e. http://example.com/hotel%20list will become http://example.com/hotel%2520list). If this behavior is undesirable, use the URI-argument methods, which will not perform any URL encoding.

Objects passed to and returned from these methods are converted to and from HTTP messages by HttpMessageConverter instances. Converters for the main mime types are registered by default, but you can also write your own converter and register it via the messageConverters bean property.

This template uses a SimpleClientHttpRequestFactory and a DefaultResponseErrorHandler as default strategies for creating HTTP connections or handling HTTP errors, respectively. These defaults can be overridden through the requestFactory and errorHandler bean properties.

Since:
3.0
Author:
Arjen Poutsma
See Also:
HttpMessageConverter, RequestCallback, ResponseExtractor, ResponseErrorHandler

Field Summary
Fields inherited from class org.springframework.http.client.support.HttpAccessor
logger
Constructor Summary
RestTemplate()
Create a new instance of the RestTemplate using default settings.
RestTemplate(ClientHttpRequestFactory requestFactory)
Create a new instance of the RestTemplate based on the given ClientHttpRequestFactory.
Method Summary
 void delete(String url, Map<String,?> urlVariables)
Delete the resources at the specified URI.
 void delete(String url, Object... urlVariables)
Delete the resources at the specified URI.
 void delete(URI url)
Delete the resources at the specified URL.
protected
<T> T
doExecute(URI url, HttpMethod method, RequestCallback requestCallback, ResponseExtractor<T> responseExtractor)
Execute the given method on the provided URI.
<T> ResponseEntity<T>
exchange(String url, HttpMethod method, HttpEntity<?> requestEntity, Class<T> responseType, Map<String,?> uriVariables)
Execute the HTTP method to the given URI template, writing the given request entity to the request, and returns the response as ResponseEntity.
<T> ResponseEntity<T>
exchange(String url, HttpMethod method, HttpEntity<?> requestEntity, Class<T> responseType, Object... uriVariables)
Execute the HTTP method to the given URI template, writing the given request entity to the request, and returns the response as ResponseEntity.
<T> ResponseEntity<T>
exchange(URI url, HttpMethod method, HttpEntity<?> requestEntity, Class<T> responseType)
Execute the HTTP method to the given URI template, writing the given request entity to the request, and returns the response as ResponseEntity.
<T> T
execute(String url, HttpMethod method, RequestCallback requestCallback, ResponseExtractor<T> responseExtractor, Map<String,?> urlVariables)
Execute the HTTP method to the given URI template, preparing the request with the RequestCallback, and reading the response with a ResponseExtractor.
<T> T
execute(String url, HttpMethod method, RequestCallback requestCallback, ResponseExtractor<T> responseExtractor, Object... urlVariables)
Execute the HTTP method to the given URI template, preparing the request with the RequestCallback, and reading the response with a ResponseExtractor.
<T> T
execute(URI url, HttpMethod method, RequestCallback requestCallback, ResponseExtractor<T> responseExtractor)
Execute the HTTP method to the given URL, preparing the request with the RequestCallback, and reading the response with a ResponseExtractor.
 ResponseErrorHandler getErrorHandler()
Return the error handler.
<T> ResponseEntity<T>
getForEntity(String url, Class<T> responseType, Map<String,?> urlVariables)
Retrieve a representation by doing a GET on the URI template.
<T> ResponseEntity<T>
getForEntity(String url, Class<T> responseType, Object... urlVariables)
Retrieve an entity by doing a GET on the specified URL.
<T> ResponseEntity<T>
getForEntity(URI url, Class<T> responseType)
Retrieve a representation by doing a GET on the URL .
<T> T
getForObject(String url, Class<T> responseType, Map<String,?> urlVariables)
Retrieve a representation by doing a GET on the URI template.
<T> T
getForObject(String url, Class<T> responseType, Object... urlVariables)
Retrieve a representation by doing a GET on the specified URL.
<T> T
getForObject(URI url, Class<T> responseType)
Retrieve a representation by doing a GET on the URL .
 List<HttpMessageConverter<?>> getMessageConverters()
Returns the message body converters.
 HttpHeaders headForHeaders(String url, Map<String,?> urlVariables)
Retrieve all headers of the resource specified by the URI template.
 HttpHeaders headForHeaders(String url, Object... urlVariables)
Retrieve all headers of the resource specified by the URI template.
 HttpHeaders headForHeaders(URI url)
Retrieve all headers of the resource specified by the URL.
 Set<HttpMethod> optionsForAllow(String url, Map<String,?> urlVariables)
Return the value of the Allow header for the given URI.
 Set<HttpMethod> optionsForAllow(String url, Object... urlVariables)
Return the value of the Allow header for the given URI.
 Set<HttpMethod> optionsForAllow(URI url)
Return the value of the Allow header for the given URL.
<T> HttpEntity<T>
postForEntity(String url, Object request, Class<T> responseType, Map<String,?> uriVariables)
Create a new resource by POSTing the given object to the URI template, and returns the response as HttpEntity.
<T> ResponseEntity<T>
postForEntity(String url, Object request, Class<T> responseType, Object... uriVariables)
Create a new resource by POSTing the given object to the URI template, and returns the response as ResponseEntity.
<T> ResponseEntity<T>
postForEntity(URI url, Object request, Class<T> responseType)
Create a new resource by POSTing the given object to the URL, and returns the response as ResponseEntity.
 URI postForLocation(String url, Object request, Map<String,?> urlVariables)
Create a new resource by POSTing the given object to the URI template, and returns the value of the Location header.
 URI postForLocation(String url, Object request, Object... urlVariables)
Create a new resource by POSTing the given object to the URI template, and returns the value of the Location header.
 URI postForLocation(URI url, Object request)
Create a new resource by POSTing the given object to the URL, and returns the value of the Location header.
<T> T
postForObject(String url, Object request, Class<T> responseType, Map<String,?> uriVariables)
Create a new resource by POSTing the given object to the URI template, and returns the representation found in the response.
<T> T
postForObject(String url, Object request, Class<T> responseType, Object... uriVariables)
Create a new resource by POSTing the given object to the URI template, and returns the representation found in the response.
<T> T
postForObject(URI url, Object request, Class<T> responseType)
Create a new resource by POSTing the given object to the URL, and returns the representation found in the response.
 void put(String url, Object request, Map<String,?> urlVariables)
Creates a new resource by PUTting the given object to URI template.
 void put(String url, Object request, Object... urlVariables)
Create or update a resource by PUTting the given object to the URI.
 void put(URI url, Object request)
Creates a new resource by PUTting the given object to URL.
 void setErrorHandler(ResponseErrorHandler errorHandler)
Set the error handler.
 void setMessageConverters(List<HttpMessageConverter<?>> messageConverters)
Set the message body converters to use.
Methods inherited from class org.springframework.http.client.support.HttpAccessor
createRequest, getRequestFactory, setRequestFactory
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

RestTemplate

public RestTemplate()
Create a new instance of the RestTemplate using default settings.

RestTemplate

public RestTemplate(ClientHttpRequestFactory requestFactory)
Create a new instance of the RestTemplate based on the given ClientHttpRequestFactory.

Parameters:
requestFactory - HTTP request factory to use
See Also:
SimpleClientHttpRequestFactory, CommonsClientHttpRequestFactory
Method Detail

setMessageConverters

public void setMessageConverters(List<HttpMessageConverter<?>> messageConverters)
Set the message body converters to use. These converters are used to convert from and to HTTP requests and responses.

getMessageConverters

public List<HttpMessageConverter<?>> getMessageConverters()
Returns the message body converters. These converters are used to convert from and to HTTP requests and responses.

setErrorHandler

public void setErrorHandler(ResponseErrorHandler errorHandler)
Set the error handler.

getErrorHandler

public ResponseErrorHandler getErrorHandler()
Return the error handler. By default, this is the DefaultResponseErrorHandler.

getForObject

public <T> T getForObject(String url,
                          Class<T> responseType,
                          Object... urlVariables)
               throws RestClientException
Description copied from interface: RestOperations
Retrieve a representation by doing a GET on the specified URL. The response (if any) is converted and returned.

URI Template variables are expanded using the given URI variables, if any.

Specified by:
getForObject in interface RestOperations
Parameters:
url - the URL
responseType - the type of the return value
urlVariables - the variables to expand the template
Returns:
the converted object
Throws:
RestClientException

getForObject

public <T> T getForObject(String url,
                          Class<T> responseType,
                          Map<String,?> urlVariables)
               throws RestClientException
Description copied from interface: RestOperations
Retrieve a representation by doing a GET on the URI template. The response (if any) is converted and returned.

URI Template variables are expanded using the given map.

Specified by:
getForObject in interface RestOperations
Parameters:
url - the URL
responseType - the type of the return value
urlVariables - the map containing variables for the URI template
Returns:
the converted object
Throws:
RestClientException

getForObject

public <T> T getForObject(URI url,
                          Class<T> responseType)
               throws RestClientException
Description copied from interface: RestOperations
Retrieve a representation by doing a GET on the URL . The response (if any) is converted and returned.

Specified by:
getForObject in interface RestOperations
Parameters:
url - the URL
responseType - the type of the return value
Returns:
the converted object
Throws:
RestClientException

getForEntity

public <T> ResponseEntity<T> getForEntity(String url,
                                          Class<T> responseType,
                                          Object... urlVariables)
                               throws RestClientException
Description copied from interface: RestOperations
Retrieve an entity by doing a GET on the specified URL. The response is converted and stored in an ResponseEntity.

URI Template variables are expanded using the given URI variables, if any.

Specified by:
getForEntity in interface RestOperations
Parameters:
url - the URL
responseType - the type of the return value
urlVariables - the variables to expand the template
Returns:
the entity
Throws:
RestClientException

getForEntity

public <T> ResponseEntity<T> getForEntity(String url,
                                          Class<T> responseType,
                                          Map<String,?> urlVariables)
                               throws RestClientException
Description copied from interface: RestOperations
Retrieve a representation by doing a GET on the URI template. The response is converted and stored in an ResponseEntity.

URI Template variables are expanded using the given map.

Specified by:
getForEntity in interface RestOperations
Parameters:
url - the URL
responseType - the type of the return value
urlVariables - the map containing variables for the URI template
Returns:
the converted object
Throws:
RestClientException

getForEntity

public <T> ResponseEntity<T> getForEntity(URI url,
                                          Class<T> responseType)
                               throws RestClientException
Description copied from interface: RestOperations
Retrieve a representation by doing a GET on the URL . The response is converted and stored in an ResponseEntity.

Specified by:
getForEntity in interface RestOperations
Parameters:
url - the URL
responseType - the type of the return value
Returns:
the converted object
Throws:
RestClientException

headForHeaders

public HttpHeaders headForHeaders(String url,
                                  Object... urlVariables)
                           throws RestClientException
Description copied from interface: RestOperations
Retrieve all headers of the resource specified by the URI template.

URI Template variables are expanded using the given URI variables, if any.

Specified by:
headForHeaders in interface RestOperations
Parameters:
url - the URL
urlVariables - the variables to expand the template
Returns:
all HTTP headers of that resource
Throws:
RestClientException

headForHeaders

public HttpHeaders headForHeaders(String url,
                                  Map<String,?> urlVariables)
                           throws RestClientException
Description copied from interface: RestOperations
Retrieve all headers of the resource specified by the URI template.

URI Template variables are expanded using the given map.

Specified by:
headForHeaders in interface RestOperations
Parameters:
url - the URL
urlVariables - the map containing variables for the URI template
Returns:
all HTTP headers of that resource
Throws:
RestClientException

headForHeaders

public HttpHeaders headForHeaders(URI url)
                           throws RestClientException
Description copied from interface: RestOperations
Retrieve all headers of the resource specified by the URL.

Specified by:
headForHeaders in interface RestOperations
Parameters:
url - the URL
Returns:
all HTTP headers of that resource
Throws:
RestClientException

postForLocation

public URI postForLocation(String url,
                           Object request,
                           Object... urlVariables)
                    throws RestClientException
Description copied from interface: RestOperations
Create a new resource by POSTing the given object to the URI template, and returns the value of the Location header. This header typically indicates where the new resource is stored.

URI Template variables are expanded using the given URI variables, if any.

The request parameter can be a HttpEntity in order to add additional HTTP headers to the request.

Specified by:
postForLocation in interface RestOperations
Parameters:
url - the URL
request - the Object to be POSTed, may be null
urlVariables - the variables to expand the template
Returns:
the value for the Location header
Throws:
RestClientException
See Also:
HttpEntity

postForLocation

public URI postForLocation(String url,
                           Object request,
                           Map<String,?> urlVariables)
                    throws RestClientException
Description copied from interface: RestOperations
Create a new resource by POSTing the given object to the URI template, and returns the value of the Location header. This header typically indicates where the new resource is stored.

URI Template variables are expanded using the given map.

The request parameter can be a HttpEntity in order to add additional HTTP headers to the request.

Specified by:
postForLocation in interface RestOperations
Parameters:
url - the URL
request - the Object to be POSTed, may be null
urlVariables - the variables to expand the template
Returns:
the value for the Location header
Throws:
RestClientException
See Also:
HttpEntity

postForLocation

public URI postForLocation(URI url,
                           Object request)
                    throws RestClientException
Description copied from interface: RestOperations
Create a new resource by POSTing the given object to the URL, and returns the value of the Location header. This header typically indicates where the new resource is stored.

The request parameter can be a HttpEntity in order to add additional HTTP headers to the request.

Specified by:
postForLocation in interface RestOperations
Parameters:
url - the URL
request - the Object to be POSTed, may be null
Returns:
the value for the Location header
Throws:
RestClientException
See Also:
HttpEntity

postForObject

public <T> T postForObject(String url,
                           Object request,
                           Class<T> responseType,
                           Object... uriVariables)
                throws RestClientException
Description copied from interface: RestOperations
Create a new resource by POSTing the given object to the URI template, and returns the representation found in the response.

URI Template variables are expanded using the given URI variables, if any.

The request parameter can be a HttpEntity in order to add additional HTTP headers to the request.

Specified by:
postForObject in interface RestOperations
Parameters:
url - the URL
request - the Object to be POSTed, may be null
responseType - the type of the return value
uriVariables - the variables to expand the template
Returns:
the converted object
Throws:
RestClientException
See Also:
HttpEntity

postForObject

public <T> T postForObject(String url,
                           Object request,
                           Class<T> responseType,
                           Map<String,?> uriVariables)
                throws RestClientException
Description copied from interface: RestOperations
Create a new resource by POSTing the given object to the URI template, and returns the representation found in the response.

URI Template variables are expanded using the given map.

The request parameter can be a HttpEntity in order to add additional HTTP headers to the request.

Specified by:
postForObject in interface RestOperations
Parameters:
url - the URL
request - the Object to be POSTed, may be null
responseType - the type of the return value
uriVariables - the variables to expand the template
Returns:
the converted object
Throws:
RestClientException
See Also:
HttpEntity

postForObject

public <T> T postForObject(URI url,
                           Object request,
                           Class<T> responseType)
                throws RestClientException
Description copied from interface: RestOperations
Create a new resource by POSTing the given object to the URL, and returns the representation found in the response.

The request parameter can be a HttpEntity in order to add additional HTTP headers to the request.

Specified by:
postForObject in interface RestOperations
Parameters:
url - the URL
request - the Object to be POSTed, may be null
responseType - the type of the return value
Returns:
the converted object
Throws:
RestClientException
See Also:
HttpEntity

postForEntity

public <T> ResponseEntity<T> postForEntity(String url,
                                           Object request,
                                           Class<T> responseType,
                                           Object... uriVariables)
                                throws RestClientException
Description copied from interface: RestOperations
Create a new resource by POSTing the given object to the URI template, and returns the response as ResponseEntity.

URI Template variables are expanded using the given URI variables, if any.

The request parameter can be a HttpEntity in order to add additional HTTP headers to the request.

Specified by:
postForEntity in interface RestOperations
Parameters:
url - the URL
request - the Object to be POSTed, may be null
uriVariables - the variables to expand the template
Returns:
the converted object
Throws:
RestClientException
See Also:
HttpEntity

postForEntity

public <T> HttpEntity<T> postForEntity(String url,
                                       Object request,
                                       Class<T> responseType,
                                       Map<String,?> uriVariables)
                            throws RestClientException
Description copied from interface: RestOperations
Create a new resource by POSTing the given object to the URI template, and returns the response as HttpEntity.

URI Template variables are expanded using the given map.

The request parameter can be a HttpEntity in order to add additional HTTP headers to the request.

Specified by:
postForEntity in interface RestOperations
Parameters:
url - the URL
request - the Object to be POSTed, may be null
uriVariables - the variables to expand the template
Returns:
the converted object
Throws:
RestClientException
See Also:
HttpEntity

postForEntity

public <T> ResponseEntity<T> postForEntity(URI url,
                                           Object request,
                                           Class<T> responseType)
                                throws RestClientException
Description copied from interface: RestOperations
Create a new resource by POSTing the given object to the URL, and returns the response as ResponseEntity.

The request parameter can be a HttpEntity in order to add additional HTTP headers to the request.

Specified by:
postForEntity in interface RestOperations
Parameters:
url - the URL
request - the Object to be POSTed, may be null
Returns:
the converted object
Throws:
RestClientException
See Also:
HttpEntity

put

public void put(String url,
                Object request,
                Object... urlVariables)
         throws RestClientException
Description copied from interface: RestOperations
Create or update a resource by PUTting the given object to the URI.

URI Template variables are expanded using the given URI variables, if any.

The request parameter can be a HttpEntity in order to add additional HTTP headers to the request.

Specified by:
put in interface RestOperations
Parameters:
url - the URL
request - the Object to be PUT, may be null
urlVariables - the variables to expand the template
Throws:
RestClientException
See Also:
HttpEntity

put

public void put(String url,
                Object request,
                Map<String,?> urlVariables)
         throws RestClientException
Description copied from interface: RestOperations
Creates a new resource by PUTting the given object to URI template.

URI Template variables are expanded using the given map.

The request parameter can be a HttpEntity in order to add additional HTTP headers to the request.

Specified by:
put in interface RestOperations
Parameters:
url - the URL
request - the Object to be PUT, may be null
urlVariables - the variables to expand the template
Throws:
RestClientException
See Also:
HttpEntity

put

public void put(URI url,
                Object request)
         throws RestClientException
Description copied from interface: RestOperations
Creates a new resource by PUTting the given object to URL.

The request parameter can be a HttpEntity in order to add additional HTTP headers to the request.

Specified by:
put in interface RestOperations
Parameters:
url - the URL
request - the Object to be PUT, may be null
Throws:
RestClientException
See Also:
HttpEntity

delete

public void delete(String url,
                   Object... urlVariables)
            throws RestClientException
Description copied from interface: RestOperations
Delete the resources at the specified URI.

URI Template variables are expanded using the given URI variables, if any.

Specified by:
delete in interface RestOperations
Parameters:
url - the URL
urlVariables - the variables to expand in the template
Throws:
RestClientException

delete

public void delete(String url,
                   Map<String,?> urlVariables)
            throws RestClientException
Description copied from interface: RestOperations
Delete the resources at the specified URI.

URI Template variables are expanded using the given map.

Specified by:
delete in interface RestOperations
Parameters:
url - the URL
urlVariables - the variables to expand the template
Throws:
RestClientException

delete

public void delete(URI url)
            throws RestClientException
Description copied from interface: RestOperations
Delete the resources at the specified URL.

Specified by:
delete in interface RestOperations
Parameters:
url - the URL
Throws:
RestClientException

optionsForAllow

public Set<HttpMethod> optionsForAllow(String url,
                                       Object... urlVariables)
                                throws RestClientException
Description copied from interface: RestOperations
Return the value of the Allow header for the given URI.

URI Template variables are expanded using the given URI variables, if any.

Specified by:
optionsForAllow in interface RestOperations
Parameters:
url - the URL
urlVariables - the variables to expand in the template
Returns:
the value of the allow header
Throws:
RestClientException

optionsForAllow

public Set<HttpMethod> optionsForAllow(String url,
                                       Map<String,?> urlVariables)
                                throws RestClientException
Description copied from interface: RestOperations
Return the value of the Allow header for the given URI.

URI Template variables are expanded using the given map.

Specified by:
optionsForAllow in interface RestOperations
Parameters:
url - the URL
urlVariables - the variables to expand in the template
Returns:
the value of the allow header
Throws:
RestClientException

optionsForAllow

public Set<HttpMethod> optionsForAllow(URI url)
                                throws RestClientException
Description copied from interface: RestOperations
Return the value of the Allow header for the given URL.

Specified by:
optionsForAllow in interface RestOperations
Parameters:
url - the URL
Returns:
the value of the allow header
Throws:
RestClientException

exchange

public <T> ResponseEntity<T> exchange(String url,
                                      HttpMethod method,
                                      HttpEntity<?> requestEntity,
                                      Class<T> responseType,
                                      Object... uriVariables)
                           throws RestClientException
Description copied from interface: RestOperations
Execute the HTTP method to the given URI template, writing the given request entity to the request, and returns the response as ResponseEntity.

URI Template variables are expanded using the given URI variables, if any.

Specified by:
exchange in interface RestOperations
Parameters:
url - the URL
method - the HTTP method (GET, POST, etc)
requestEntity - the entity (headers and/or body) to write to the request, may be null
responseType - the type of the return value
uriVariables - the variables to expand in the template
Returns:
the response as entity
Throws:
RestClientException

exchange

public <T> ResponseEntity<T> exchange(String url,
                                      HttpMethod method,
                                      HttpEntity<?> requestEntity,
                                      Class<T> responseType,
                                      Map<String,?> uriVariables)
                           throws RestClientException
Description copied from interface: RestOperations
Execute the HTTP method to the given URI template, writing the given request entity to the request, and returns the response as ResponseEntity.

URI Template variables are expanded using the given URI variables, if any.

Specified by:
exchange in interface RestOperations
Parameters:
url - the URL
method - the HTTP method (GET, POST, etc)
requestEntity - the entity (headers and/or body) to write to the request, may be null
responseType - the type of the return value
uriVariables - the variables to expand in the template
Returns:
the response as entity
Throws:
RestClientException

exchange

public <T> ResponseEntity<T> exchange(URI url,
                                      HttpMethod method,
                                      HttpEntity<?> requestEntity,
                                      Class<T> responseType)
                           throws RestClientException
Description copied from interface: RestOperations
Execute the HTTP method to the given URI template, writing the given request entity to the request, and returns the response as ResponseEntity.

Specified by:
exchange in interface RestOperations
Parameters:
url - the URL
method - the HTTP method (GET, POST, etc)
requestEntity - the entity (headers and/or body) to write to the request, may be null
responseType - the type of the return value
Returns:
the response as entity
Throws:
RestClientException

execute

public <T> T execute(String url,
                     HttpMethod method,
                     RequestCallback requestCallback,
                     ResponseExtractor<T> responseExtractor,
                     Object... urlVariables)
          throws RestClientException
Description copied from interface: RestOperations
Execute the HTTP method to the given URI template, preparing the request with the RequestCallback, and reading the response with a ResponseExtractor.

URI Template variables are expanded using the given URI variables, if any.

Specified by:
execute in interface RestOperations
Parameters:
url - the URL
method - the HTTP method (GET, POST, etc)
requestCallback - object that prepares the request
responseExtractor - object that extracts the return value from the response
urlVariables - the variables to expand in the template
Returns:
an arbitrary object, as returned by the ResponseExtractor
Throws:
RestClientException

execute

public <T> T execute(String url,
                     HttpMethod method,
                     RequestCallback requestCallback,
                     ResponseExtractor<T> responseExtractor,
                     Map<String,?> urlVariables)
          throws RestClientException
Description copied from interface: RestOperations
Execute the HTTP method to the given URI template, preparing the request with the RequestCallback, and reading the response with a ResponseExtractor.

URI Template variables are expanded using the given URI variables map.

Specified by:
execute in interface RestOperations
Parameters:
url - the URL
method - the HTTP method (GET, POST, etc)
requestCallback - object that prepares the request
responseExtractor - object that extracts the return value from the response
urlVariables - the variables to expand in the template
Returns:
an arbitrary object, as returned by the ResponseExtractor
Throws:
RestClientException

execute

public <T> T execute(URI url,
                     HttpMethod method,
                     RequestCallback requestCallback,
                     ResponseExtractor<T> responseExtractor)
          throws RestClientException
Description copied from interface: RestOperations
Execute the HTTP method to the given URL, preparing the request with the RequestCallback, and reading the response with a ResponseExtractor.

Specified by:
execute in interface RestOperations
Parameters:
url - the URL
method - the HTTP method (GET, POST, etc)
requestCallback - object that prepares the request
responseExtractor - object that extracts the return value from the response
Returns:
an arbitrary object, as returned by the ResponseExtractor
Throws:
RestClientException

doExecute

protected <T> T doExecute(URI url,
                          HttpMethod method,
                          RequestCallback requestCallback,
                          ResponseExtractor<T> responseExtractor)
               throws RestClientException
Execute the given method on the provided URI. The ClientHttpRequest is processed using the RequestCallback; the response with the ResponseExtractor.

Parameters:
url - the fully-expanded URL to connect to
method - the HTTP method to execute (GET, POST, etc.)
requestCallback - object that prepares the request (can be null)
responseExtractor - object that extracts the return value from the response (can be null)
Returns:
an arbitrary object, as returned by the ResponseExtractor
Throws:
RestClientException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


HttpClientErrorException

org.springframework.web.client
Class HttpClientErrorException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.web.client.RestClientException
                        extended by  org.springframework.web.client.HttpStatusCodeException
                            extended by  org.springframework.web.client.HttpClientErrorException
All Implemented Interfaces:
Serializable
public class HttpClientErrorException
extends HttpStatusCodeException

Exception thrown when an HTTP 4xx is received.

Since:
3.0
Author:
Arjen Poutsma
See Also:
DefaultResponseErrorHandler, Serialized Form

Constructor Summary
HttpClientErrorException(HttpStatus statusCode)
Construct a new instance of HttpClientErrorException based on a HttpStatus.
HttpClientErrorException(HttpStatus statusCode, String statusText)
Construct a new instance of HttpClientErrorException based on a HttpStatus and status text.
Method Summary
Methods inherited from class org.springframework.web.client.HttpStatusCodeException
getStatusCode, getStatusText
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

HttpClientErrorException

public HttpClientErrorException(HttpStatus statusCode)
Construct a new instance of HttpClientErrorException based on a HttpStatus.

Parameters:
statusCode - the status code

HttpClientErrorException

public HttpClientErrorException(HttpStatus statusCode,
                                String statusText)
Construct a new instance of HttpClientErrorException based on a HttpStatus and status text.

Parameters:
statusCode - the status code
statusText - the status text
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HttpServerErrorException

org.springframework.web.client
Class HttpServerErrorException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.web.client.RestClientException
                        extended by  org.springframework.web.client.HttpStatusCodeException
                            extended by  org.springframework.web.client.HttpServerErrorException
All Implemented Interfaces:
Serializable
public class HttpServerErrorException
extends HttpStatusCodeException

Exception thrown when an HTTP 5xx is received.

Since:
3.0
Author:
Arjen Poutsma
See Also:
DefaultResponseErrorHandler, Serialized Form

Constructor Summary
HttpServerErrorException(HttpStatus statusCode)
Construct a new instance of HttpServerErrorException based on a HttpStatus.
HttpServerErrorException(HttpStatus statusCode, String statusText)
Construct a new instance of HttpServerErrorException based on a HttpStatus and status text.
Method Summary
Methods inherited from class org.springframework.web.client.HttpStatusCodeException
getStatusCode, getStatusText
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

HttpServerErrorException

public HttpServerErrorException(HttpStatus statusCode)
Construct a new instance of HttpServerErrorException based on a HttpStatus.

Parameters:
statusCode - the status code

HttpServerErrorException

public HttpServerErrorException(HttpStatus statusCode,
                                String statusText)
Construct a new instance of HttpServerErrorException based on a HttpStatus and status text.

Parameters:
statusCode - the status code
statusText - the status text
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HttpStatusCodeException

org.springframework.web.client
Class HttpStatusCodeException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.web.client.RestClientException
                        extended by  org.springframework.web.client.HttpStatusCodeException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
HttpClientErrorException, HttpServerErrorException
public abstract class HttpStatusCodeException
extends RestClientException

Abstract base class for exceptions based on an HttpStatus.

Since:
3.0
Author:
Arjen Poutsma
See Also:
Serialized Form

Constructor Summary
protected | HttpStatusCodeException(HttpStatus statusCode) Construct a new instance of HttpStatusCodeException based on a HttpStatus.
protected | HttpStatusCodeException(HttpStatus statusCode, String statusText) Construct a new instance of HttpStatusCodeException based on a HttpStatus and status text.
Method Summary
HttpStatus | getStatusCode() Returns the HTTP status code.
String | getStatusText() Returns the HTTP status text.
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

HttpStatusCodeException

protected HttpStatusCodeException(HttpStatus statusCode)
Construct a new instance of HttpStatusCodeException based on a HttpStatus.

Parameters:
statusCode - the status code

HttpStatusCodeException

protected HttpStatusCodeException(HttpStatus statusCode,
                                  String statusText)
Construct a new instance of HttpStatusCodeException based on a HttpStatus and status text.

Parameters:
statusCode - the status code
statusText - the status text
Method Detail

getStatusCode

public HttpStatus getStatusCode()
Returns the HTTP status code.

getStatusText

public String getStatusText()
Returns the HTTP status text.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResourceAccessException

org.springframework.web.client
Class ResourceAccessException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.web.client.RestClientException
                        extended by  org.springframework.web.client.ResourceAccessException
All Implemented Interfaces:
Serializable
public class ResourceAccessException
extends RestClientException

Exception thrown when an I/O error occurs.

Since:
3.0
Author:
Arjen Poutsma
See Also:
Serialized Form

Constructor Summary
ResourceAccessException(String msg)
Construct a new HttpIOException with the given message.
ResourceAccessException(String msg, IOException ex)
Construct a new HttpIOException with the given message and IOException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ResourceAccessException

public ResourceAccessException(String msg)
Construct a new HttpIOException with the given message.

Parameters:
msg - the message

ResourceAccessException

public ResourceAccessException(String msg,
                               IOException ex)
Construct a new HttpIOException with the given message and IOException.

Parameters:
msg - the message
ex - the IOException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RestClientException

org.springframework.web.client
Class RestClientException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.web.client.RestClientException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
HttpStatusCodeException, ResourceAccessException
public class RestClientException
extends NestedRuntimeException

Base class for exceptions thrown by RestTemplate whenever it encounters client-side HTTP errors.

Since:
3.0
Author:
Arjen Poutsma
See Also:
Serialized Form

Constructor Summary
RestClientException(String msg)
Construct a new instance of HttpClientException with the given message.
RestClientException(String msg, Throwable ex)
Construct a new instance of HttpClientException with the given message and exception.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

RestClientException

public RestClientException(String msg)
Construct a new instance of HttpClientException with the given message.

Parameters:
msg - the message

RestClientException

public RestClientException(String msg,
                           Throwable ex)
Construct a new instance of HttpClientException with the given message and exception.

Parameters:
msg - the message
ex - the exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.web.client.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.client.support

Classes supporting the org.springframework.web.client package.

See:
Description

Class Summary
RestGatewaySupport Convenient super class for application classes that need REST access.

Package org.springframework.web.client.support Description

Classes supporting the org.springframework.web.client package. Contains a base class for RestTemplate usage.


org.springframework.web.client.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.client.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.web.client.support.RestGatewaySupport


RestGatewaySupport

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.client.support
Class RestGatewaySupport

java.lang.Object
    extended by  org.springframework.web.client.support.RestGatewaySupport

public class RestGatewaySupport
extends Object

Convenient super class for application classes that need REST access.

Requires a ClientHttpRequestFactory or a RestTemplate instance to be set.

Since:
3.0
Author:
Arjen Poutsma
See Also:
setRestTemplate(org.springframework.web.client.RestTemplate), RestTemplate

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
RestGatewaySupport()
Construct a new instance of the RestGatewaySupport, with default parameters.
RestGatewaySupport(ClientHttpRequestFactory requestFactory)
Construct a new instance of the RestGatewaySupport, with the given ClientHttpRequestFactory.
Method Summary
RestTemplate | getRestTemplate() Returns the RestTemplate for the gateway.
void | setRestTemplate(RestTemplate restTemplate) Sets the RestTemplate for the gateway.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

RestGatewaySupport

public RestGatewaySupport()
Construct a new instance of the RestGatewaySupport, with default parameters.

RestGatewaySupport

public RestGatewaySupport(ClientHttpRequestFactory requestFactory)
Construct a new instance of the RestGatewaySupport, with the given ClientHttpRequestFactory.

See Also:
RestTemplate.RestTemplate(ClientHttpRequestFactory)
Method Detail

setRestTemplate

public void setRestTemplate(RestTemplate restTemplate)
Sets the RestTemplate for the gateway.

getRestTemplate

public RestTemplate getRestTemplate()
Returns the RestTemplate for the gateway.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.context

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.context

Contains a variant of the application context interface for web applications, and the ContextLoaderListener that bootstraps a root web application context.

See:
Description

Interface Summary
ConfigurableWebApplicationContext | Interface to be implemented by configurable web application contexts.
ServletConfigAware | Interface to be implemented by any object that wishes to be notified of the ServletConfig (typically determined by the WebApplicationContext) that it runs in.
ServletContextAware | Interface to be implemented by any object that wishes to be notified of the ServletContext (typically determined by the WebApplicationContext) that it runs in.
WebApplicationContext | Interface to provide configuration for a web application.

Class Summary
ContextCleanupListener | Web application listener that cleans up remaining disposable attributes in the ServletContext, i.e.
ContextLoader | Performs the actual initialization work for the root application context.
ContextLoaderListener | Bootstrap listener to start up and shut down Spring's root WebApplicationContext.

Package org.springframework.web.context Description

Contains a variant of the application context interface for web applications, and the ContextLoaderListener that bootstraps a root web application context.


org.springframework.web.context Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.context

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.web.context.ContextCleanupListener (implements javax.servlet.ServletContextListener)
    • org.springframework.web.context.ContextLoader
      • org.springframework.web.context.ContextLoaderListener (implements javax.servlet.ServletContextListener)

Interface Hierarchy

  • org.springframework.context.ApplicationEventPublisher
    • org.springframework.context.ApplicationContext (also extends org.springframework.beans.factory.HierarchicalBeanFactory, org.springframework.beans.factory.ListableBeanFactory, org.springframework.context.MessageSource, org.springframework.core.io.support.ResourcePatternResolver)
      • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.Lifecycle)
        • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
      • org.springframework.web.context.WebApplicationContext
        • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
  • org.springframework.beans.factory.BeanFactory
    • org.springframework.beans.factory.HierarchicalBeanFactory
      • org.springframework.context.ApplicationContext (also extends org.springframework.context.ApplicationEventPublisher, org.springframework.beans.factory.ListableBeanFactory, org.springframework.context.MessageSource, org.springframework.core.io.support.ResourcePatternResolver)
        • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.Lifecycle)
          • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
        • org.springframework.web.context.WebApplicationContext
          • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
    • org.springframework.beans.factory.ListableBeanFactory
      • org.springframework.context.ApplicationContext (also extends org.springframework.context.ApplicationEventPublisher, org.springframework.beans.factory.HierarchicalBeanFactory, org.springframework.context.MessageSource, org.springframework.core.io.support.ResourcePatternResolver)
        • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.Lifecycle)
          • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
        • org.springframework.web.context.WebApplicationContext
          • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
  • org.springframework.context.Lifecycle
    • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.ApplicationContext)
      • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
  • org.springframework.context.MessageSource
    • org.springframework.context.ApplicationContext (also extends org.springframework.context.ApplicationEventPublisher, org.springframework.beans.factory.HierarchicalBeanFactory, org.springframework.beans.factory.ListableBeanFactory, org.springframework.core.io.support.ResourcePatternResolver)
      • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.Lifecycle)
        • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
      • org.springframework.web.context.WebApplicationContext
        • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
  • org.springframework.core.io.ResourceLoader
    • org.springframework.core.io.support.ResourcePatternResolver
      • org.springframework.context.ApplicationContext (also extends org.springframework.context.ApplicationEventPublisher, org.springframework.beans.factory.HierarchicalBeanFactory, org.springframework.beans.factory.ListableBeanFactory, org.springframework.context.MessageSource)
        • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.Lifecycle)
          • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
        • org.springframework.web.context.WebApplicationContext
          • org.springframework.web.context.ConfigurableWebApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
  • org.springframework.web.context.ServletConfigAware
  • org.springframework.web.context.ServletContextAware


ConfigurableWebApplicationContext

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.context
Interface ConfigurableWebApplicationContext

All Superinterfaces:
ApplicationContext, ApplicationEventPublisher, BeanFactory, ConfigurableApplicationContext, HierarchicalBeanFactory, Lifecycle, ListableBeanFactory, MessageSource, ResourceLoader, ResourcePatternResolver, WebApplicationContext
All Known Implementing Classes:
AbstractRefreshableWebApplicationContext, AnnotationConfigWebApplicationContext, StaticWebApplicationContext, XmlWebApplicationContext
public interface ConfigurableWebApplicationContext
extends WebApplicationContext, ConfigurableApplicationContext

Interface to be implemented by configurable web application contexts. Supported by ContextLoader and FrameworkServlet.

Note: The setters of this interface need to be called before an invocation of the ConfigurableApplicationContext.refresh() method inherited from ConfigurableApplicationContext. They do not cause an initialization of the context on their own.

Since:
05.12.2003
Author:
Juergen Hoeller
See Also:
ConfigurableApplicationContext.refresh(),
ContextLoader.createWebApplicationContext(javax.servlet.ServletContext, org.springframework.context.ApplicationContext),
FrameworkServlet.createWebApplicationContext(org.springframework.context.ApplicationContext)

Field Summary
static String | APPLICATION_CONTEXT_ID_PREFIX Prefix for ApplicationContext ids that refer to context path and/or servlet name.
static String | SERVLET_CONFIG_BEAN_NAME Name of the ServletConfig environment bean in the factory.
Fields inherited from interface org.springframework.web.context.WebApplicationContext
CONTEXT_ATTRIBUTES_BEAN_NAME, CONTEXT_PARAMETERS_BEAN_NAME, ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, SCOPE_APPLICATION, SCOPE_GLOBAL_SESSION, SCOPE_REQUEST, SCOPE_SESSION, SERVLET_CONTEXT_BEAN_NAME
Fields inherited from interface org.springframework.context.ConfigurableApplicationContext
CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAME
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Method Summary
String[] | getConfigLocations() Return the config locations for this web application context, or null if none specified.
String | getNamespace() Return the namespace for this web application context, if any.
ServletConfig | getServletConfig() Return the ServletConfig for this web application context, if any.
void | setConfigLocation(String configLocation) Set the config locations for this web application context in init-param style, i.e.
void | setConfigLocations(String[] configLocations) Set the config locations for this web application context.
void | setNamespace(String namespace) Set the namespace for this web application context, to be used for building a default context config location.
void | setServletConfig(ServletConfig servletConfig) Set the ServletConfig for this web application context.
void | setServletContext(ServletContext servletContext) Set the ServletContext for this web application context.
Methods inherited from interface org.springframework.web.context.WebApplicationContext
getServletContext
Methods inherited from interface org.springframework.context.ConfigurableApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, close, getBeanFactory, isActive, refresh, registerShutdownHook, setId, setParent
Methods inherited from interface org.springframework.context.ApplicationContext
getAutowireCapableBeanFactory, getDisplayName, getId, getParent, getStartupDate
Methods inherited from interface org.springframework.beans.factory.ListableBeanFactory
containsBeanDefinition, findAnnotationOnBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation
Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory
containsLocalBean, getParentBeanFactory
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getBean, getBean, getType, isPrototype, isSingleton, isTypeMatch
Methods inherited from interface org.springframework.context.MessageSource
getMessage, getMessage, getMessage
Methods inherited from interface org.springframework.context.ApplicationEventPublisher
publishEvent
Methods inherited from interface org.springframework.core.io.support.ResourcePatternResolver
getResources
Methods inherited from interface org.springframework.core.io.ResourceLoader
getClassLoader, getResource
Methods inherited from interface org.springframework.context.Lifecycle
isRunning, start, stop

Field Detail

APPLICATION_CONTEXT_ID_PREFIX

static final String APPLICATION_CONTEXT_ID_PREFIX
Prefix for ApplicationContext ids that refer to context path and/or servlet name.

SERVLET_CONFIG_BEAN_NAME

static final String SERVLET_CONFIG_BEAN_NAME
Name of the ServletConfig environment bean in the factory.

See Also:
ServletConfig, Constant Field Values
Method Detail

setServletContext

void setServletContext(ServletContext servletContext)
Set the ServletContext for this web application context.

Does not cause an initialization of the context: refresh needs to be called after the setting of all configuration properties.

See Also:
ConfigurableApplicationContext.refresh()

setServletConfig

void setServletConfig(ServletConfig servletConfig)
Set the ServletConfig for this web application context. Only called for a WebApplicationContext that belongs to a specific Servlet.

See Also:
ConfigurableApplicationContext.refresh()

getServletConfig

ServletConfig getServletConfig()
Return the ServletConfig for this web application context, if any.

setNamespace

void setNamespace(String namespace)
Set the namespace for this web application context, to be used for building a default context config location. The root web application context does not have a namespace.

getNamespace

String getNamespace()
Return the namespace for this web application context, if any.

setConfigLocation

void setConfigLocation(String configLocation)
Set the config locations for this web application context in init-param style, i.e. with distinct locations separated by commas, semicolons or whitespace.

If not set, the implementation is supposed to use a default for the given namespace or the root web application context, as appropriate.

setConfigLocations

void setConfigLocations(String[] configLocations)
Set the config locations for this web application context.

If not set, the implementation is supposed to use a default for the given namespace or the root web application context, as appropriate.

getConfigLocations

String[] getConfigLocations()
Return the config locations for this web application context, or null if none specified.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ServletConfigAware

org.springframework.web.context
Interface ServletConfigAware

All Known Implementing Classes:
SimpleServletPostProcessor
public interface ServletConfigAware

Interface to be implemented by any object that wishes to be notified of the ServletConfig (typically determined by the WebApplicationContext) that it runs in.

Only satisfied if actually running within a Servlet-specific WebApplicationContext. If this callback interface is encountered elsewhere, an exception will be thrown on bean creation.

Since:
2.0
Author:
Juergen Hoeller
See Also:
ServletContextAware

Method Summary
 void setServletConfig(ServletConfig servletConfig)
Set the ServletConfig that this object runs in.

Method Detail

setServletConfig

void setServletConfig(ServletConfig servletConfig)
Set the ServletConfig that this object runs in.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked after ApplicationContextAware's setApplicationContext.

Parameters:
servletConfig - ServletConfig object to be used by this object
See Also:
InitializingBean.afterPropertiesSet(), ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletContextAware

org.springframework.web.context
Interface ServletContextAware

All Known Implementing Classes:
AbstractAtomFeedView, AbstractCachingViewResolver, AbstractCommandController, AbstractController, AbstractControllerUrlHandlerMapping, AbstractDetectingUrlHandlerMapping, AbstractExcelView, AbstractFeedView, AbstractFormController, AbstractHandlerMapping, AbstractJasperReportsSingleFormatView, AbstractJasperReportsView, AbstractJExcelView, AbstractPdfStamperView, AbstractPdfView, AbstractRequestLoggingFilter, AbstractRssFeedView, AbstractTemplateView, AbstractTemplateViewResolver, AbstractUrlBasedView, AbstractUrlHandlerMapping, AbstractUrlViewController, AbstractView, AbstractWizardFormController, AbstractXsltView, AnnotationMethodHandlerAdapter, BaseCommandController, BeanNameUrlHandlerMapping, BeanNameViewResolver, CancellableFormController, CharacterEncodingFilter, CommonsMultipartResolver, CommonsRequestLoggingFilter, ConfigurableJasperReportsView, ContentNegotiatingViewResolver, ControllerBeanNameHandlerMapping, ControllerClassNameHandlerMapping, DefaultAnnotationHandlerMapping, DelegatingFilterProxy, FreeMarkerConfigurer, FreeMarkerView, FreeMarkerViewResolver, GenericFilterBean, HiddenHttpMethodFilter, InternalResourceView, InternalResourceViewResolver, JasperReportsCsvView, JasperReportsHtmlView, JasperReportsMultiFormatView, JasperReportsPdfView, JasperReportsViewResolver, JasperReportsXlsView, JstlView, Log4jNestedDiagnosticContextFilter, MappingJacksonJsonView, MarshallingView, MultiActionController, MultipartFilter, OncePerRequestFilter, OpenEntityManagerInViewFilter, OpenPersistenceManagerInViewFilter, OpenSessionInViewFilter, ParameterizableViewController, RedirectView, RequestContextFilter, ResourceBundleViewResolver, ServletContextAttributeExporter, ServletContextAttributeFactoryBean, ServletContextFactoryBean, ServletContextParameterFactoryBean, ServletContextPropertyPlaceholderConfigurer, ServletContextRequestLoggingFilter, ServletForwardingController, ServletWrappingController, ShallowEtagHeaderFilter, SimpleFormController, SimpleServletPostProcessor, SimpleUrlHandlerMapping, TilesConfigurer, TilesConfigurer, TilesJstlView, TilesView, TilesView, TilesViewResolver, UrlBasedViewResolver, UrlFilenameViewController, VelocityConfigurer, VelocityLayoutView, VelocityLayoutViewResolver, VelocityToolboxView, VelocityView, VelocityViewResolver, WebApplicationObjectSupport, WebContentGenerator, WebContentInterceptor, XmlViewResolver, XsltView, XsltViewResolver
public interface ServletContextAware

Interface to be implemented by any object that wishes to be notified of the ServletContext (typically determined by the WebApplicationContext) that it runs in.

Since:
12.03.2004
Author:
Juergen Hoeller
See Also:
ServletConfigAware

Method Summary
 void setServletContext(ServletContext servletContext)
Set the ServletContext that this object runs in.

Method Detail

setServletContext

void setServletContext(ServletContext servletContext)
Set the ServletContext that this object runs in.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked after ApplicationContextAware's setApplicationContext.

Parameters:
servletContext - ServletContext object to be used by this object
See Also:
InitializingBean.afterPropertiesSet(), ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WebApplicationContext

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.context
Interface WebApplicationContext

All Superinterfaces:
ApplicationContext, ApplicationEventPublisher, BeanFactory, HierarchicalBeanFactory, ListableBeanFactory, MessageSource, ResourceLoader, ResourcePatternResolver
All Known Subinterfaces:
ConfigurablePortletApplicationContext, ConfigurableWebApplicationContext
All Known Implementing Classes:
AbstractRefreshablePortletApplicationContext, AbstractRefreshableWebApplicationContext, AnnotationConfigWebApplicationContext, GenericWebApplicationContext, StaticPortletApplicationContext, StaticWebApplicationContext, XmlPortletApplicationContext, XmlWebApplicationContext
public interface WebApplicationContext
extends ApplicationContext

Interface to provide configuration for a web application. This is read-only while the application is running, but may be reloaded if the implementation supports this.

This interface adds a getServletContext() method to the generic ApplicationContext interface, and defines a well-known application attribute name that the root context must be bound to in the bootstrap process.

Like generic application contexts, web application contexts are hierarchical. There is a single root context per application, while each servlet in the application (including a dispatcher servlet in the MVC framework) has its own child context.

In addition to standard application context lifecycle capabilities, WebApplicationContext implementations need to detect ServletContextAware beans and invoke the setServletContext method accordingly.

Since:
January 19, 2001
Author:
Rod Johnson, Juergen Hoeller
See Also:
ServletContextAware.setServletContext(javax.servlet.ServletContext)

Field Summary
static String | CONTEXT_ATTRIBUTES_BEAN_NAME Name of the ServletContext/PortletContext attributes environment bean in the factory.
static String | CONTEXT_PARAMETERS_BEAN_NAME Name of the ServletContext/PortletContext init-params environment bean in the factory.
static String | ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE Context attribute to bind root WebApplicationContext to on successful startup.
static String | SCOPE_APPLICATION Scope identifier for the global web application scope: "application".
static String | SCOPE_GLOBAL_SESSION Scope identifier for global session scope: "globalSession".
static String | SCOPE_REQUEST Scope identifier for request scope: "request".
static String | SCOPE_SESSION Scope identifier for session scope: "session".
static String | SERVLET_CONTEXT_BEAN_NAME Name of the ServletContext environment bean in the factory.
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Method Summary
 ServletContext getServletContext()
Return the standard Servlet API ServletContext for this application.
Methods inherited from interface org.springframework.context.ApplicationContext
getAutowireCapableBeanFactory, getDisplayName, getId, getParent, getStartupDate
Methods inherited from interface org.springframework.beans.factory.ListableBeanFactory
containsBeanDefinition, findAnnotationOnBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation
Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory
containsLocalBean, getParentBeanFactory
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getBean, getBean, getType, isPrototype, isSingleton, isTypeMatch
Methods inherited from interface org.springframework.context.MessageSource
getMessage, getMessage, getMessage
Methods inherited from interface org.springframework.context.ApplicationEventPublisher
publishEvent
Methods inherited from interface org.springframework.core.io.support.ResourcePatternResolver
getResources
Methods inherited from interface org.springframework.core.io.ResourceLoader
getClassLoader, getResource

Field Detail

ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE

static final String ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE
Context attribute to bind root WebApplicationContext to on successful startup.

Note: If the startup of the root context fails, this attribute can contain an exception or error as value. Use WebApplicationContextUtils for convenient lookup of the root WebApplicationContext.

See Also:
WebApplicationContextUtils.getWebApplicationContext(javax.servlet.ServletContext), WebApplicationContextUtils.getRequiredWebApplicationContext(javax.servlet.ServletContext)

SCOPE_REQUEST

static final String SCOPE_REQUEST
Scope identifier for request scope: "request". Supported in addition to the standard scopes "singleton" and "prototype".

See Also:
Constant Field Values

SCOPE_SESSION

static final String SCOPE_SESSION
Scope identifier for session scope: "session". Supported in addition to the standard scopes "singleton" and "prototype".

See Also:
Constant Field Values

SCOPE_GLOBAL_SESSION

static final String SCOPE_GLOBAL_SESSION
Scope identifier for global session scope: "globalSession". Supported in addition to the standard scopes "singleton" and "prototype".

See Also:
Constant Field Values

SCOPE_APPLICATION

static final String SCOPE_APPLICATION
Scope identifier for the global web application scope: "application". Supported in addition to the standard scopes "singleton" and "prototype".

See Also:
Constant Field Values

SERVLET_CONTEXT_BEAN_NAME

static final String SERVLET_CONTEXT_BEAN_NAME
Name of the ServletContext environment bean in the factory.

See Also:
ServletContext, Constant Field Values

CONTEXT_PARAMETERS_BEAN_NAME

static final String CONTEXT_PARAMETERS_BEAN_NAME
Name of the ServletContext/PortletContext init-params environment bean in the factory.

Note: Possibly merged with ServletConfig/PortletConfig parameters. ServletConfig parameters override ServletContext parameters of the same name.

See Also:
ServletContext.getInitParameterNames(),
ServletContext.getInitParameter(String),
ServletConfig.getInitParameterNames(),
ServletConfig.getInitParameter(String),
Constant Field Values

CONTEXT_ATTRIBUTES_BEAN_NAME

static final String CONTEXT_ATTRIBUTES_BEAN_NAME
Name of the ServletContext/PortletContext attributes environment bean in the factory.

See Also:
ServletContext.getAttributeNames(), ServletContext.getAttribute(String), Constant Field Values
Method Detail

getServletContext

ServletContext getServletContext()
Return the standard Servlet API ServletContext for this application.

Also available for a Portlet application, in addition to the PortletContext.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ContextCleanupListener

org.springframework.web.context
Class ContextCleanupListener

java.lang.Object
    extended by  org.springframework.web.context.ContextCleanupListener
All Implemented Interfaces:
EventListener, ServletContextListener
public class ContextCleanupListener
extends Object
implements ServletContextListener

Web application listener that cleans up remaining disposable attributes in the ServletContext, i.e. attributes which implement DisposableBean and haven't been removed before. This is typically used for destroying objects in "application" scope, for which the lifecycle implies destruction at the very end of the web application's shutdown phase.

Since:
3.0
Author:
Juergen Hoeller
See Also:
ServletContextScope, ContextLoaderListener

Constructor Summary
ContextCleanupListener()
Method Summary
void | contextDestroyed(ServletContextEvent event)
void | contextInitialized(ServletContextEvent event)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ContextCleanupListener

public ContextCleanupListener()
Method Detail

contextInitialized

public void contextInitialized(ServletContextEvent event)
Specified by:
contextInitialized in interface ServletContextListener

contextDestroyed

public void contextDestroyed(ServletContextEvent event)
Specified by:
contextDestroyed in interface ServletContextListener
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ContextLoader

org.springframework.web.context
Class ContextLoader

java.lang.Object
    extended by  org.springframework.web.context.ContextLoader
Direct Known Subclasses:
ContextLoaderListener
public class ContextLoader
extends Object

Performs the actual initialization work for the root application context. Called by ContextLoaderListener.

Looks for a "contextClass" parameter at the web.xml context-param level to specify the context class type, falling back to the default of XmlWebApplicationContext if not found. With the default ContextLoader implementation, any context class specified needs to implement the ConfigurableWebApplicationContext interface.

Processes a "contextConfigLocation" context-param and passes its value to the context instance, parsing it into potentially multiple file paths which can be separated by any number of commas and spaces, e.g. "WEB-INF/applicationContext1.xml, WEB-INF/applicationContext2.xml". Ant-style path patterns are supported as well, e.g. "WEB-INF/*Context.xml,WEB-INF/spring*.xml" or "WEB-INF/**/*Context.xml". If not explicitly specified, the context implementation is supposed to use a default location (with XmlWebApplicationContext: "/WEB-INF/applicationContext.xml").

Note: In case of multiple config locations, later bean definitions will override ones defined in previously loaded files, at least when using one of Spring's default ApplicationContext implementations. This can be leveraged to deliberately override certain bean definitions via an extra XML file.

Above and beyond loading the root application context, this class can optionally load or obtain and hook up a shared parent context to the root application context. See the loadParentContext(ServletContext) method for more information.

Since:
17.02.2003
Author:
Juergen Hoeller, Colin Sampaleanu, Sam Brannen
See Also:
ContextLoaderListener, ConfigurableWebApplicationContext, XmlWebApplicationContext

Field Summary
static String | CONFIG_LOCATION_PARAM Name of servlet context parameter (i.e., "contextConfigLocation") that can specify the config location for the root context, falling back to the implementation's default otherwise.
static String | CONTEXT_CLASS_PARAM Config param for the root WebApplicationContext implementation class to use: "contextClass"
static String | LOCATOR_FACTORY_KEY_PARAM Optional servlet context parameter (i.e., "parentContextKey") used only when obtaining a parent context using the default implementation of loadParentContext(ServletContext servletContext).
static String | LOCATOR_FACTORY_SELECTOR_PARAM Optional servlet context parameter (i.e., "locatorFactorySelector") used only when obtaining a parent context using the default implementation of loadParentContext(ServletContext servletContext).
Constructor Summary
ContextLoader()
Method Summary
void | closeWebApplicationContext(ServletContext servletContext) Close Spring's web application context for the given servlet context.
protected WebApplicationContext | createWebApplicationContext(ServletContext sc, ApplicationContext parent) Instantiate the root WebApplicationContext for this loader, either the default context class or a custom context class if specified.
protected void | customizeContext(ServletContext servletContext, ConfigurableWebApplicationContext applicationContext) Customize the ConfigurableWebApplicationContext created by this ContextLoader after config locations have been supplied to the context but before the context is refreshed.
protected Class<?> | determineContextClass(ServletContext servletContext) Return the WebApplicationContext implementation class to use, either the default XmlWebApplicationContext or a custom context class if specified.
static WebApplicationContext | getCurrentWebApplicationContext() Obtain the Spring root web application context for the current thread (i.e.
WebApplicationContext | initWebApplicationContext(ServletContext servletContext) Initialize Spring's web application context for the given servlet context, according to the "contextClass" and "contextConfigLocation" context-params.
protected ApplicationContext | loadParentContext(ServletContext servletContext) Template method with default implementation (which may be overridden by a subclass), to load or obtain an ApplicationContext instance which will be used as the parent context of the root WebApplicationContext.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

CONTEXT_CLASS_PARAM

public static final String CONTEXT_CLASS_PARAM
Config param for the root WebApplicationContext implementation class to use: "contextClass"

See Also:
Constant Field Values

CONFIG_LOCATION_PARAM

public static final String CONFIG_LOCATION_PARAM
Name of servlet context parameter (i.e., "contextConfigLocation") that can specify the config location for the root context, falling back to the implementation's default otherwise.

See Also:
XmlWebApplicationContext.DEFAULT_CONFIG_LOCATION, Constant Field Values

LOCATOR_FACTORY_SELECTOR_PARAM

public static final String LOCATOR_FACTORY_SELECTOR_PARAM
Optional servlet context parameter (i.e., "locatorFactorySelector") used only when obtaining a parent context using the default implementation of loadParentContext(ServletContext servletContext). Specifies the 'selector' used in the ContextSingletonBeanFactoryLocator.getInstance(String selector) method call, which is used to obtain the BeanFactoryLocator instance from which the parent context is obtained.

The default is classpath*:beanRefContext.xml, matching the default applied for the ContextSingletonBeanFactoryLocator.getInstance() method. Supplying the "parentContextKey" parameter is sufficient in this case.

See Also:
Constant Field Values

LOCATOR_FACTORY_KEY_PARAM

public static final String LOCATOR_FACTORY_KEY_PARAM
Optional servlet context parameter (i.e., "parentContextKey") used only when obtaining a parent context using the default implementation of loadParentContext(ServletContext servletContext). Specifies the 'factoryKey' used in the BeanFactoryLocator.useBeanFactory(String factoryKey) method call, obtaining the parent application context from the BeanFactoryLocator instance.

Supplying this "parentContextKey" parameter is sufficient when relying on the default classpath*:beanRefContext.xml selector for candidate factory references.

See Also:
Constant Field Values
Constructor Detail

ContextLoader

public ContextLoader()
Method Detail

initWebApplicationContext

public WebApplicationContext initWebApplicationContext(ServletContext servletContext)
Initialize Spring's web application context for the given servlet context, according to the "contextClass" and "contextConfigLocation" context-params.

Parameters:
servletContext - current servlet context
Returns:
the new WebApplicationContext
See Also:
CONTEXT_CLASS_PARAM, CONFIG_LOCATION_PARAM

createWebApplicationContext

protected WebApplicationContext createWebApplicationContext(ServletContext sc,
                                                            ApplicationContext parent)
Instantiate the root WebApplicationContext for this loader, either the default context class or a custom context class if specified.

This implementation expects custom contexts to implement the ConfigurableWebApplicationContext interface. Can be overridden in subclasses.

In addition, customizeContext(javax.servlet.ServletContext, org.springframework.web.context.ConfigurableWebApplicationContext) gets called prior to refreshing the context, allowing subclasses to perform custom modifications to the context.

Parameters:
sc - current servlet context
parent - the parent ApplicationContext to use, or null if none
Returns:
the root WebApplicationContext
See Also:
ConfigurableWebApplicationContext

determineContextClass

protected Class<?> determineContextClass(ServletContext servletContext)
Return the WebApplicationContext implementation class to use, either the default XmlWebApplicationContext or a custom context class if specified.

Parameters:
servletContext - current servlet context
Returns:
the WebApplicationContext implementation class to use
See Also:
CONTEXT_CLASS_PARAM, XmlWebApplicationContext

customizeContext

protected void customizeContext(ServletContext servletContext,
                                ConfigurableWebApplicationContext applicationContext)
Customize the ConfigurableWebApplicationContext created by this ContextLoader after config locations have been supplied to the context but before the context is refreshed.

The default implementation is empty but can be overridden in subclasses to customize the application context.

Parameters:
servletContext - the current servlet context
applicationContext - the newly created application context
See Also:
createWebApplicationContext(ServletContext, ApplicationContext)

loadParentContext

protected ApplicationContext loadParentContext(ServletContext servletContext)
Template method with default implementation (which may be overridden by a subclass), to load or obtain an ApplicationContext instance which will be used as the parent context of the root WebApplicationContext. If the return value from the method is null, no parent context is set.

The main reason to load a parent context here is to allow multiple root web application contexts to all be children of a shared EAR context, or alternately to also share the same parent context that is visible to EJBs. For pure web applications, there is usually no need to worry about having a parent context to the root web application context.

The default implementation uses ContextSingletonBeanFactoryLocator, configured via LOCATOR_FACTORY_SELECTOR_PARAM and LOCATOR_FACTORY_KEY_PARAM, to load a parent context which will be shared by all other users of ContextsingletonBeanFactoryLocator which also use the same configuration parameters.

Parameters:
servletContext - current servlet context
Returns:
the parent application context, or null if none
See Also:
ContextSingletonBeanFactoryLocator

closeWebApplicationContext

public void closeWebApplicationContext(ServletContext servletContext)
Close Spring's web application context for the given servlet context. If the default loadParentContext(ServletContext) implementation, which uses ContextSingletonBeanFactoryLocator, has loaded any shared parent context, release one reference to that shared parent context.

If overriding loadParentContext(ServletContext), you may have to override this method as well.

Parameters:
servletContext - the ServletContext that the WebApplicationContext runs in

getCurrentWebApplicationContext

public static WebApplicationContext getCurrentWebApplicationContext()
Obtain the Spring root web application context for the current thread (i.e. for the current thread's context ClassLoader, which needs to be the web application's ClassLoader).

Returns:
the current root web application context, or null if none found
See Also:
SpringBeanAutowiringSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ContextLoaderListener

org.springframework.web.context
Class ContextLoaderListener

java.lang.Object
    extended by  org.springframework.web.context.ContextLoader
        extended by  org.springframework.web.context.ContextLoaderListener
All Implemented Interfaces:
EventListener, ServletContextListener
public class ContextLoaderListener
extends ContextLoader
implements ServletContextListener

Bootstrap listener to start up and shut down Spring's root WebApplicationContext. Simply delegates to ContextLoader as well as to ContextCleanupListener.

This listener should be registered after Log4jConfigListener in web.xml, if the latter is used.

Since:
17.02.2003
Author:
Juergen Hoeller
See Also:
Log4jConfigListener

Field Summary
Fields inherited from class org.springframework.web.context.ContextLoader
CONFIG_LOCATION_PARAM, CONTEXT_CLASS_PARAM, LOCATOR_FACTORY_KEY_PARAM, LOCATOR_FACTORY_SELECTOR_PARAM
Constructor Summary
ContextLoaderListener()
Method Summary
void | contextDestroyed(ServletContextEvent event) Close the root web application context.
void | contextInitialized(ServletContextEvent event) Initialize the root web application context.
protected ContextLoader | createContextLoader() Deprecated. in favor of simply subclassing ContextLoaderListener itself (which extends ContextLoader, as of Spring 3.0)
ContextLoader | getContextLoader() Deprecated. in favor of simply subclassing ContextLoaderListener itself (which extends ContextLoader, as of Spring 3.0)
Methods inherited from class org.springframework.web.context.ContextLoader
closeWebApplicationContext, createWebApplicationContext, customizeContext, determineContextClass, getCurrentWebApplicationContext, initWebApplicationContext, loadParentContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ContextLoaderListener

public ContextLoaderListener()
Method Detail

contextInitialized

public void contextInitialized(ServletContextEvent event)
Initialize the root web application context.

Specified by:
contextInitialized in interface ServletContextListener

createContextLoader

@Deprecated
protected ContextLoader createContextLoader()
Deprecated. in favor of simply subclassing ContextLoaderListener itself (which extends ContextLoader, as of Spring 3.0)

Create the ContextLoader to use. Can be overridden in subclasses.

Returns:
the new ContextLoader

getContextLoader

@Deprecated
public ContextLoader getContextLoader()
Deprecated. in favor of simply subclassing ContextLoaderListener itself (which extends ContextLoader, as of Spring 3.0)

Return the ContextLoader used by this listener.

Returns:
the current ContextLoader

contextDestroyed

public void contextDestroyed(ServletContextEvent event)
Close the root web application context.

Specified by:
contextDestroyed in interface ServletContextListener
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.web.context.request

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.context.request

Support for generic request context holding, in particular for scoping of application objects per HTTP request or HTTP session.

See:
Description

Interface Summary
NativeWebRequest | Extension of the WebRequest interface, exposing the native request and response objects in a generic fashion.
RequestAttributes | Abstraction for accessing attribute objects associated with a request.
WebRequest | Generic interface for a web request.
WebRequestInterceptor | Interface for general web request interception.

Class Summary
AbstractRequestAttributes | Abstract support class for RequestAttributes implementations, offering a request completion mechanism for request-specific destruction callbacks and for updating accessed session attributes.
AbstractRequestAttributesScope | Abstract Scope implementation that reads from a particular scope in the current thread-bound RequestAttributes object.
DestructionCallbackBindingListener | Adapter that implements the Servlet 2.3 HttpSessionBindingListener interface, wrapping a session destruction callback.
FacesRequestAttributes | RequestAttributes adapter for a JSF FacesContext.
FacesWebRequest | WebRequest adapter for a JSF FacesContext.
Log4jNestedDiagnosticContextInterceptor | Request logging interceptor that adds a request context message to the Log4J nested diagnostic context (NDC) before the request is processed, removing it again after the request is processed.
RequestContextHolder | Holder class to expose the web request in the form of a thread-bound RequestAttributes object.
RequestContextListener | Servlet 2.4+ listener that exposes the request to the current thread, through both LocaleContextHolder and RequestContextHolder.
RequestScope | Request-backed Scope implementation.
ServletRequestAttributes | Servlet-based implementation of the RequestAttributes interface.
ServletWebRequest | WebRequest adapter for an HttpServletRequest.
SessionScope | Session-backed Scope implementation.

Package org.springframework.web.context.request Description

Support for generic request context holding, in particular for scoping of application objects per HTTP request or HTTP session.


org.springframework.web.context.request Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.context.request

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.web.context.request.AbstractRequestAttributes (implements org.springframework.web.context.request.RequestAttributes)
      • org.springframework.web.context.request.ServletRequestAttributes
        • org.springframework.web.context.request.ServletWebRequest (implements org.springframework.web.context.request.NativeWebRequest)
    • org.springframework.web.context.request.AbstractRequestAttributesScope (implements org.springframework.beans.factory.config.Scope)
      • org.springframework.web.context.request.RequestScope
      • org.springframework.web.context.request.SessionScope
    • org.springframework.web.context.request.DestructionCallbackBindingListener (implements javax.servlet.http.HttpSessionBindingListener, java.io.Serializable)
    • org.springframework.web.context.request.FacesRequestAttributes (implements org.springframework.web.context.request.RequestAttributes)
      • org.springframework.web.context.request.FacesWebRequest (implements org.springframework.web.context.request.NativeWebRequest)
    • org.springframework.web.context.request.Log4jNestedDiagnosticContextInterceptor (implements org.springframework.web.context.request.WebRequestInterceptor)
    • org.springframework.web.context.request.RequestContextHolder
    • org.springframework.web.context.request.RequestContextListener (implements javax.servlet.ServletRequestListener)

Interface Hierarchy

  • org.springframework.web.context.request.RequestAttributes
    • org.springframework.web.context.request.WebRequest
      • org.springframework.web.context.request.NativeWebRequest
  • org.springframework.web.context.request.WebRequestInterceptor


NativeWebRequest

org.springframework.web.context.request
Interface NativeWebRequest

All Superinterfaces:
RequestAttributes, WebRequest
All Known Implementing Classes:
DispatcherServletWebRequest, FacesWebRequest, PortletWebRequest, ServletWebRequest
public interface NativeWebRequest
extends WebRequest

Extension of the WebRequest interface, exposing the native request and response objects in a generic fashion.

Mainly intended for framework-internal usage, in particular for generic argument resolution code.

Since:
2.5.2
Author:
Juergen Hoeller

Field Summary
Fields inherited from interface org.springframework.web.context.request.RequestAttributes
REFERENCE_REQUEST, REFERENCE_SESSION, SCOPE_GLOBAL_SESSION, SCOPE_REQUEST, SCOPE_SESSION
Method Summary
 Object getNativeRequest()
Return the underlying native request object, if available.
<T> T
getNativeRequest(Class<T> requiredType)
Return the underlying native request object, if available.
 Object getNativeResponse()
Return the underlying native response object, if available.
<T> T
getNativeResponse(Class<T> requiredType)
Return the underlying native request object, if available.
Methods inherited from interface org.springframework.web.context.request.WebRequest
checkNotModified, getContextPath, getDescription, getHeader, getHeaderNames, getHeaderValues, getLocale, getParameter, getParameterMap, getParameterNames, getParameterValues, getRemoteUser, getUserPrincipal, isSecure, isUserInRole
Methods inherited from interface org.springframework.web.context.request.RequestAttributes
getAttribute, getAttributeNames, getSessionId, getSessionMutex, registerDestructionCallback, removeAttribute, resolveReference, setAttribute

Method Detail

getNativeRequest

Object getNativeRequest()
Return the underlying native request object, if available.

See Also:
HttpServletRequest, ActionRequest, RenderRequest

getNativeResponse

Object getNativeResponse()
Return the underlying native response object, if available.

See Also:
HttpServletResponse, ActionResponse, RenderResponse

getNativeRequest

<T> T getNativeRequest(Class<T> requiredType)
Return the underlying native request object, if available.

Parameters:
requiredType - the desired type of request object
Returns:
the matching request object, or null if none of that type is available
See Also:
HttpServletRequest, ActionRequest, RenderRequest

getNativeResponse

<T> T getNativeResponse(Class<T> requiredType)
Return the underlying native request object, if available.

Parameters:
requiredType - the desired type of response object
Returns:
the matching response object, or null if none of that type is available
See Also:
HttpServletRequest, ActionRequest, RenderRequest
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RequestAttributes

org.springframework.web.context.request
Interface RequestAttributes

All Known Subinterfaces:
NativeWebRequest, WebRequest
All Known Implementing Classes:
AbstractRequestAttributes, DispatcherServletWebRequest, FacesRequestAttributes, FacesWebRequest, PortletRequestAttributes, PortletWebRequest, ServletRequestAttributes, ServletWebRequest
public interface RequestAttributes

Abstraction for accessing attribute objects associated with a request. Supports access to request-scoped attributes as well as to session-scoped attributes, with the optional notion of a "global session".

Can be implemented for any kind of request/session mechanism, in particular for servlet requests and portlet requests.

Since:
2.0
Author:
Juergen Hoeller
See Also:
ServletRequestAttributes, PortletRequestAttributes

Field Summary
static String | REFERENCE_REQUEST Name of the standard reference to the request object: "request".
static String | REFERENCE_SESSION Name of the standard reference to the session object: "session".
static int | SCOPE_GLOBAL_SESSION Constant that indicates global session scope.
static int | SCOPE_REQUEST Constant that indicates request scope.
static int | SCOPE_SESSION Constant that indicates session scope.
Method Summary
Object | getAttribute(String name, int scope) Return the value for the scoped attribute of the given name, if any.
String[] | getAttributeNames(int scope) Retrieve the names of all attributes in the scope.
String | getSessionId() Return an id for the current underlying session.
Object | getSessionMutex() Expose the best available mutex for the underlying session: that is, an object to synchronize on for the underlying session.
void | registerDestructionCallback(String name, Runnable callback, int scope) Register a callback to be executed on destruction of the specified attribute in the given scope.
void | removeAttribute(String name, int scope) Remove the scoped attribute of the given name, if it exists.
Object | resolveReference(String key) Resolve the contextual reference for the given key, if any.
void | setAttribute(String name, Object value, int scope) Set the value for the scoped attribute of the given name, replacing an existing value (if any).

Field Detail

SCOPE_REQUEST

static final int SCOPE_REQUEST
Constant that indicates request scope.

See Also:
Constant Field Values

SCOPE_SESSION

static final int SCOPE_SESSION
Constant that indicates session scope.

This preferably refers to a locally isolated session, if such a distinction is available (for example, in a Portlet environment). Else, it simply refers to the common session.

See Also:
Constant Field Values

SCOPE_GLOBAL_SESSION

static final int SCOPE_GLOBAL_SESSION
Constant that indicates global session scope.

This explicitly refers to a globally shared session, if such a distinction is available (for example, in a Portlet environment). Else, it simply refers to the common session.

See Also:
Constant Field Values

REFERENCE_REQUEST

static final String REFERENCE_REQUEST
Name of the standard reference to the request object: "request".

See Also:
resolveReference(java.lang.String), Constant Field Values

REFERENCE_SESSION

static final String REFERENCE_SESSION
Name of the standard reference to the session object: "session".

See Also:
resolveReference(java.lang.String), Constant Field Values
Method Detail

getAttribute

Object getAttribute(String name,
                    int scope)
Return the value for the scoped attribute of the given name, if any.

Parameters:
name - the name of the attribute
scope - the scope identifier
Returns:
the current attribute value, or null if not found

setAttribute

void setAttribute(String name,
                  Object value,
                  int scope)
Set the value for the scoped attribute of the given name, replacing an existing value (if any).

Parameters:
name - the name of the attribute
scope - the scope identifier
value - the value for the attribute

removeAttribute

void removeAttribute(String name,
                     int scope)
Remove the scoped attribute of the given name, if it exists.

Note that an implementation should also remove a registered destruction callback for the specified attribute, if any. It does, however, not need to execute a registered destruction callback in this case, since the object will be destroyed by the caller (if appropriate).

Parameters:
name - the name of the attribute
scope - the scope identifier

getAttributeNames

String[] getAttributeNames(int scope)
Retrieve the names of all attributes in the scope.

Parameters:
scope - the scope identifier
Returns:
the attribute names as String array

registerDestructionCallback

void registerDestructionCallback(String name,
                                 Runnable callback,
                                 int scope)
Register a callback to be executed on destruction of the specified attribute in the given scope.

Implementations should do their best to execute the callback at the appropriate time: that is, at request completion or session termination, respectively. If such a callback is not supported by the underlying runtime environment, the callback must be ignored and a corresponding warning should be logged.

Note that 'destruction' usually corresponds to destruction of the entire scope, not to the individual attribute having been explicitly removed by the application. If an attribute gets removed via this facade's removeAttribute(String, int) method, any registered destruction callback should be disabled as well, assuming that the removed object will be reused or manually destroyed.

NOTE: Callback objects should generally be serializable if they are being registered for a session scope. Otherwise the callback (or even the entire session) might not survive web app restarts.

Parameters:
name - the name of the attribute to register the callback for
callback - the destruction callback to be executed
scope - the scope identifier

resolveReference

Object resolveReference(String key)
Resolve the contextual reference for the given key, if any.

At a minimum: the HttpServletRequest/PortletRequest reference for key "request", and the HttpSession/PortletSession reference for key "session".

Parameters:
key - the contextual key
Returns:
the corresponding object, or null if none found

getSessionId

String getSessionId()
Return an id for the current underlying session.

Returns:
the session id as String (never null

getSessionMutex

Object getSessionMutex()
Expose the best available mutex for the underlying session: that is, an object to synchronize on for the underlying session.

Returns:
the session mutex to use (never null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WebRequest

org.springframework.web.context.request
Interface WebRequest

All Superinterfaces:
RequestAttributes
All Known Subinterfaces:
NativeWebRequest
All Known Implementing Classes:
DispatcherServletWebRequest, FacesWebRequest, PortletWebRequest, ServletWebRequest
public interface WebRequest
extends RequestAttributes

Generic interface for a web request. Mainly intended for generic web request interceptors, giving them access to general request metadata, not for actual handling of the request.

Since:
2.0
Author:
Juergen Hoeller
See Also:
WebRequestInterceptor

Field Summary
Fields inherited from interface org.springframework.web.context.request.RequestAttributes
REFERENCE_REQUEST, REFERENCE_SESSION, SCOPE_GLOBAL_SESSION, SCOPE_REQUEST, SCOPE_SESSION
Method Summary
boolean | checkNotModified(long lastModifiedTimestamp) Check whether the request qualifies as not modified given the supplied last-modified timestamp (as determined by the application).
String | getContextPath() Return the context path for this request (usually the base path that the current web application is mapped to).
String | getDescription(boolean includeClientInfo) Get a short description of this request, typically containing request URI and session id.
String | getHeader(String headerName) Return the request header of the given name, or null if none.
Iterator<String> | getHeaderNames() Return a Iterator over request header names.
String[] | getHeaderValues(String headerName) Return the request header values for the given header name, or null if none.
Locale | getLocale() Return the primary Locale for this request.
String | getParameter(String paramName) Return the request parameter of the given name, or null if none.
Map<String,String[]> | getParameterMap() Return a immutable Map of the request parameters, with parameter names as map keys and parameter values as map values.
Iterator<String> | getParameterNames() Return a Iterator over request parameter names.
String[] | getParameterValues(String paramName) Return the request parameter values for the given parameter name, or null if none.
String | getRemoteUser() Return the remote user for this request, if any.
Principal | getUserPrincipal() Return the user principal for this request, if any.
boolean | isSecure() Return whether this request has been sent over a secure transport mechanism (such as SSL).
boolean | isUserInRole(String role) Determine whether the user is in the given role for this request.
Methods inherited from interface org.springframework.web.context.request.RequestAttributes
getAttribute, getAttributeNames, getSessionId, getSessionMutex, registerDestructionCallback, removeAttribute, resolveReference, setAttribute

Method Detail

getHeader

String getHeader(String headerName)
Return the request header of the given name, or null if none.

Retrieves the first header value in case of a multi-value header.

See Also:
HttpServletRequest.getHeader(String)

getHeaderValues

String[] getHeaderValues(String headerName)
Return the request header values for the given header name, or null if none.

A single-value header will be exposed as an array with a single element.

See Also:
HttpServletRequest.getHeaders(String)

getHeaderNames

Iterator<String> getHeaderNames()
Return a Iterator over request header names.

Since:
3.0
See Also:
HttpServletRequest.getHeaderNames()

getParameter

String getParameter(String paramName)
Return the request parameter of the given name, or null if none.

Retrieves the first parameter value in case of a multi-value parameter.

See Also:
ServletRequest.getParameter(String)

getParameterValues

String[] getParameterValues(String paramName)
Return the request parameter values for the given parameter name, or null if none.

A single-value parameter will be exposed as an array with a single element.

See Also:
ServletRequest.getParameterValues(String)

getParameterNames

Iterator<String> getParameterNames()
Return a Iterator over request parameter names.

Since:
3.0
See Also:
ServletRequest.getParameterNames()

getParameterMap

Map<String,String[]> getParameterMap()
Return a immutable Map of the request parameters, with parameter names as map keys and parameter values as map values. The map values will be of type String array.

A single-value parameter will be exposed as an array with a single element.

See Also:
ServletRequest.getParameterMap()

getLocale

Locale getLocale()
Return the primary Locale for this request.

See Also:
ServletRequest.getLocale()

getContextPath

String getContextPath()
Return the context path for this request (usually the base path that the current web application is mapped to).

See Also:
HttpServletRequest.getContextPath()

getRemoteUser

String getRemoteUser()
Return the remote user for this request, if any.

See Also:
HttpServletRequest.getRemoteUser()

getUserPrincipal

Principal getUserPrincipal()
Return the user principal for this request, if any.

See Also:
HttpServletRequest.getUserPrincipal()

isUserInRole

boolean isUserInRole(String role)
Determine whether the user is in the given role for this request.

See Also:
HttpServletRequest.isUserInRole(String)

isSecure

boolean isSecure()
Return whether this request has been sent over a secure transport mechanism (such as SSL).

See Also:
ServletRequest.isSecure()

checkNotModified

boolean checkNotModified(long lastModifiedTimestamp)
Check whether the request qualifies as not modified given the supplied last-modified timestamp (as determined by the application).

This will also transparently set the appropriate response headers, for both the modified case and the not-modified case.

Typical usage:

 public String myHandleMethod(WebRequest webRequest, Model model) {
   long lastModified = // application-specific calculation
   if (request.checkNotModified(lastModified)) {
     // shortcut exit - no further processing necessary
     return null;
   }
   // further request processing, actually building content
   model.addAttribute(...);
   return "myViewName";
 }

Parameters:
lastModifiedTimestamp - the last-modified timestamp that the application determined for the underlying resource
Returns:
whether the request qualifies as not modified, allowing to abort request processing and relying on the response telling the client that the content has not been modified

getDescription

String getDescription(boolean includeClientInfo)
Get a short description of this request, typically containing request URI and session id.

Parameters:
includeClientInfo - whether to include client-specific information such as session id and user name
Returns:
the requested description as String
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WebRequestInterceptor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.context.request
Interface WebRequestInterceptor

All Known Implementing Classes:
Log4jNestedDiagnosticContextInterceptor, OpenEntityManagerInViewInterceptor, OpenPersistenceManagerInViewInterceptor, OpenSessionInViewInterceptor
public interface WebRequestInterceptor

Interface for general web request interception. Allows for being applied to Servlet request as well as Portlet request environments, by building on the WebRequest abstraction.

This interface assumes MVC-style request processing: A handler gets executed, exposes a set of model objects, then a view gets rendered based on that model. Alternatively, a handler may also process the request completely, with no view to be rendered.

This interface is deliberately minimalistic to keep the dependencies of generic request interceptors as minimal as feasible.

NOTE: While this interceptor is applied to the entire request processing in a Servlet environment, it is by default only applied to the render phase in a Portlet environment, preparing and rendering a Portlet view. To apply WebRequestInterceptors to the action phase as well, set the HandlerMapping's "applyWebRequestInterceptorsToRenderPhaseOnly" flag to "false". Alternatively, consider using the Portlet-specific HandlerInterceptor mechanism for such needs.

Since:
2.0
Author:
Juergen Hoeller
See Also:
ServletWebRequest, DispatcherServlet, AbstractHandlerMapping.setInterceptors(java.lang.Object[]), HandlerInterceptor, PortletWebRequest, DispatcherPortlet, AbstractHandlerMapping.setInterceptors(java.lang.Object[]), AbstractHandlerMapping.setApplyWebRequestInterceptorsToRenderPhaseOnly(boolean), HandlerInterceptor

Method Summary
void | afterCompletion(WebRequest request, Exception ex) Callback after completion of request processing, that is, after rendering the view.
void | postHandle(WebRequest request, ModelMap model) Intercept the execution of a request handler after its successful invocation, right before view rendering (if any).
void | preHandle(WebRequest request) Intercept the execution of a request handler before its invocation.

Method Detail

preHandle

void preHandle(WebRequest request)
               throws Exception
Intercept the execution of a request handler before its invocation.

Allows for preparing context resources (such as a Hibernate Session) and expose them as request attributes or as thread-local objects.

Parameters:
request - the current web request
Throws:
Exception - in case of errors

postHandle

void postHandle(WebRequest request,
                ModelMap model)
                throws Exception
Intercept the execution of a request handler after its successful invocation, right before view rendering (if any).

Allows for modifying context resources after successful handler execution (for example, flushing a Hibernate Session).

Parameters:
request - the current web request
model - the map of model objects that will be exposed to the view (may be null). Can be used to analyze the exposed model and/or to add further model attributes, if desired.
Throws:
Exception - in case of errors

afterCompletion

void afterCompletion(WebRequest request,
                     Exception ex)
                     throws Exception
Callback after completion of request processing, that is, after rendering the view. Will be called on any outcome of handler execution, thus allows for proper resource cleanup.

Note: Will only be called if this interceptor's preHandle method has successfully completed!

Parameters:
request - the current web request
ex - exception thrown on handler execution, if any
Throws:
Exception - in case of errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractRequestAttributes

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.context.request
Class AbstractRequestAttributes

java.lang.Object
    extended by  org.springframework.web.context.request.AbstractRequestAttributes
All Implemented Interfaces:
RequestAttributes
Direct Known Subclasses:
PortletRequestAttributes, ServletRequestAttributes
public abstract class AbstractRequestAttributes
extends Object
implements RequestAttributes

Abstract support class for RequestAttributes implementations, offering a request completion mechanism for request-specific destruction callbacks and for updating accessed session attributes.

Since:
2.0
Author:
Juergen Hoeller
See Also:
requestCompleted()

Field Summary
protected  Map<String,Runnable> requestDestructionCallbacks
Map from attribute name String to destruction callback Runnable
Fields inherited from interface org.springframework.web.context.request.RequestAttributes
REFERENCE_REQUEST, REFERENCE_SESSION, SCOPE_GLOBAL_SESSION, SCOPE_REQUEST, SCOPE_SESSION
Constructor Summary
AbstractRequestAttributes()
Method Summary
protected boolean | isRequestActive() Determine whether the original request is still active.
protected void | registerRequestDestructionCallback(String name, Runnable callback) Register the given callback as to be executed after request completion.
protected void | removeRequestDestructionCallback(String name) Remove the request destruction callback for the specified attribute, if any.
void | requestCompleted() Signal that the request has been completed.
protected abstract void | updateAccessedSessionAttributes() Update all session attributes that have been accessed during request processing, to expose their potentially updated state to the underlying session manager.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.web.context.request.RequestAttributes
getAttribute, getAttributeNames, getSessionId, getSessionMutex, registerDestructionCallback, removeAttribute, resolveReference, setAttribute

Field Detail

requestDestructionCallbacks

protected final Map<String,Runnable> requestDestructionCallbacks
Map from attribute name String to destruction callback Runnable

Constructor Detail

AbstractRequestAttributes

public AbstractRequestAttributes()
Method Detail

requestCompleted

public void requestCompleted()
Signal that the request has been completed.

Executes all request destruction callbacks and updates the session attributes that have been accessed during request processing.

isRequestActive

protected final boolean isRequestActive()
Determine whether the original request is still active.

See Also:
requestCompleted()

registerRequestDestructionCallback

protected final void registerRequestDestructionCallback(String name,
                                                        Runnable callback)
Register the given callback as to be executed after request completion.

Parameters:
name - the name of the attribute to register the callback for
callback - the callback to be executed for destruction

removeRequestDestructionCallback

protected final void removeRequestDestructionCallback(String name)
Remove the request destruction callback for the specified attribute, if any.

Parameters:
name - the name of the attribute to remove the callback for

updateAccessedSessionAttributes

protected abstract void updateAccessedSessionAttributes()
Update all session attributes that have been accessed during request processing, to expose their potentially updated state to the underlying session manager.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractRequestAttributesScope

org.springframework.web.context.request
Class AbstractRequestAttributesScope

java.lang.Object
    extended by  org.springframework.web.context.request.AbstractRequestAttributesScope
All Implemented Interfaces:
Scope
Direct Known Subclasses:
RequestScope, SessionScope
public abstract class AbstractRequestAttributesScope
extends Object
implements Scope

Abstract Scope implementation that reads from a particular scope in the current thread-bound RequestAttributes object.

Subclasses simply need to implement getScope() to instruct this class which RequestAttributes scope to read attributes from.

Subclasses may wish to override the get(java.lang.String, org.springframework.beans.factory.ObjectFactory) and remove(java.lang.String) methods to add synchronization around the call back into this super class.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller, Rob Harrop

Constructor Summary
AbstractRequestAttributesScope()
Method Summary
Object | get(String name, ObjectFactory objectFactory) Return the object with the given name from the underlying scope, creating it if not found in the underlying storage mechanism.
protected abstract int | getScope() Template method that determines the actual target scope.
void | registerDestructionCallback(String name, Runnable callback) Register a callback to be executed on destruction of the specified object in the scope (or at destruction of the entire scope, if the scope does not destroy individual objects but rather only terminates in its entirety).
Object | remove(String name) Remove the object with the given name from the underlying scope.
Object | resolveContextualObject(String key) Resolve the contextual object for the given key, if any.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.config.Scope
getConversationId

Constructor Detail

AbstractRequestAttributesScope

public AbstractRequestAttributesScope()
Method Detail

get

public Object get(String name,
                  ObjectFactory objectFactory)
Description copied from interface: Scope
Return the object with the given name from the underlying scope, creating it if not found in the underlying storage mechanism.

This is the central operation of a Scope, and the only operation that is absolutely required.

Specified by:
get in interface Scope
Parameters:
name - the name of the object to retrieve
objectFactory - the ObjectFactory to use to create the scoped object if it is not present in the underlying storage mechanism
Returns:
the desired object (never null)

remove

public Object remove(String name)
Description copied from interface: Scope
Remove the object with the given name from the underlying scope.

Returns null if no object was found; otherwise returns the removed Object.

Note that an implementation should also remove a registered destruction callback for the specified object, if any. It does, however, not need to execute a registered destruction callback in this case, since the object will be destroyed by the caller (if appropriate).

Note: This is an optional operation. Implementations may throw UnsupportedOperationException if they do not support explicitly removing an object.

Specified by:
remove in interface Scope
Parameters:
name - the name of the object to remove
Returns:
the removed object, or null if no object was present
See Also:
Scope.registerDestructionCallback(java.lang.String, java.lang.Runnable)

registerDestructionCallback

public void registerDestructionCallback(String name,
                                        Runnable callback)
Description copied from interface: Scope
Register a callback to be executed on destruction of the specified object in the scope (or at destruction of the entire scope, if the scope does not destroy individual objects but rather only terminates in its entirety).

Note: This is an optional operation. This method will only be called for scoped beans with actual destruction configuration (DisposableBean, destroy-method, DestructionAwareBeanPostProcessor). Implementations should do their best to execute a given callback at the appropriate time. If such a callback is not supported by the underlying runtime environment at all, the callback must be ignored and a corresponding warning should be logged.

Note that 'destruction' refers to to automatic destruction of the object as part of the scope's own lifecycle, not to the individual scoped object having been explicitly removed by the application. If a scoped object gets removed via this facade's Scope.remove(String) method, any registered destruction callback should be removed as well, assuming that the removed object will be reused or manually destroyed.

Specified by:
registerDestructionCallback in interface Scope
Parameters:
name - the name of the object to execute the destruction callback for
callback - the destruction callback to be executed. Note that the passed-in Runnable will never throw an exception, so it can safely be executed without an enclosing try-catch block. Furthermore, the Runnable will usually be serializable, provided that its target object is serializable as well.
See Also:
DisposableBean, AbstractBeanDefinition.getDestroyMethodName(), DestructionAwareBeanPostProcessor

resolveContextualObject

public Object resolveContextualObject(String key)
Description copied from interface: Scope
Resolve the contextual object for the given key, if any. E.g. the HttpServletRequest object for key "request".

Specified by:
resolveContextualObject in interface Scope
Parameters:
key - the contextual key
Returns:
the corresponding object, or null if none found

getScope

protected abstract int getScope()
Template method that determines the actual target scope.

Returns:
the target scope, in the form of an appropriate RequestAttributes constant
See Also:
RequestAttributes.SCOPE_REQUEST, RequestAttributes.SCOPE_SESSION, RequestAttributes.SCOPE_GLOBAL_SESSION
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DestructionCallbackBindingListener

org.springframework.web.context.request
Class DestructionCallbackBindingListener

java.lang.Object
    extended by  org.springframework.web.context.request.DestructionCallbackBindingListener
All Implemented Interfaces:
Serializable, EventListener, HttpSessionBindingListener
public class DestructionCallbackBindingListener
extends Object
implements HttpSessionBindingListener, Serializable

Adapter that implements the Servlet 2.3 HttpSessionBindingListener interface, wrapping a session destruction callback.

Since:
3.0
Author:
Juergen Hoeller
See Also:
RequestAttributes.registerDestructionCallback(java.lang.String, java.lang.Runnable, int), ServletRequestAttributes.registerSessionDestructionCallback(java.lang.String, java.lang.Runnable), Serialized Form

Constructor Summary
DestructionCallbackBindingListener(Runnable destructionCallback)
Create a new DestructionCallbackBindingListener for the given callback.
Method Summary
void | valueBound(HttpSessionBindingEvent event)
void | valueUnbound(HttpSessionBindingEvent event)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DestructionCallbackBindingListener

public DestructionCallbackBindingListener(Runnable destructionCallback)
Create a new DestructionCallbackBindingListener for the given callback.

Parameters:
destructionCallback - the Runnable to execute when this listener object gets unbound from the session
Method Detail

valueBound

public void valueBound(HttpSessionBindingEvent event)
Specified by:
valueBound in interface HttpSessionBindingListener

valueUnbound

public void valueUnbound(HttpSessionBindingEvent event)
Specified by:
valueUnbound in interface HttpSessionBindingListener
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FacesRequestAttributes

org.springframework.web.context.request
Class FacesRequestAttributes

java.lang.Object
    extended by  org.springframework.web.context.request.FacesRequestAttributes
All Implemented Interfaces:
RequestAttributes
Direct Known Subclasses:
FacesWebRequest
public class FacesRequestAttributes
extends Object
implements RequestAttributes

RequestAttributes adapter for a JSF FacesContext. Used as default in a JSF environment, wrapping the current FacesContext.

NOTE: In contrast to ServletRequestAttributes, this variant does not support destruction callbacks for scoped attributes, neither for the request scope nor for the session scope. If you rely on such implicit destruction callbacks, consider defining a Spring RequestContextListener in your web.xml.

Since:
2.5.2
Author:
Juergen Hoeller
See Also:
FacesContext.getExternalContext(),
ExternalContext.getRequestMap(),
ExternalContext.getSessionMap(),
RequestContextHolder.currentRequestAttributes()

Field Summary
Fields inherited from interface org.springframework.web.context.request.RequestAttributes
REFERENCE_REQUEST, REFERENCE_SESSION, SCOPE_GLOBAL_SESSION, SCOPE_REQUEST, SCOPE_SESSION
Constructor Summary
FacesRequestAttributes(javax.faces.context.FacesContext facesContext)
Create a new FacesRequestAttributes adapter for the given FacesContext.
Method Summary
Object | getAttribute(String name, int scope) Return the value for the scoped attribute of the given name, if any.
protected Map<String,Object> | getAttributeMap(int scope) Return the JSF attribute Map for the specified scope
String[] | getAttributeNames(int scope) Retrieve the names of all attributes in the scope.
protected javax.faces.context.ExternalContext | getExternalContext() Return the JSF ExternalContext that this adapter operates on.
protected javax.faces.context.FacesContext | getFacesContext() Return the JSF FacesContext that this adapter operates on.
String | getSessionId() Return an id for the current underlying session.
Object | getSessionMutex() Expose the best available mutex for the underlying session: that is, an object to synchronize on for the underlying session.
void | registerDestructionCallback(String name, Runnable callback, int scope) Register a callback to be executed on destruction of the specified attribute in the given scope.
void | removeAttribute(String name, int scope) Remove the scoped attribute of the given name, if it exists.
Object | resolveReference(String key) Resolve the contextual reference for the given key, if any.
void | setAttribute(String name, Object value, int scope) Set the value for the scoped attribute of the given name, replacing an existing value (if any).
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

FacesRequestAttributes

public FacesRequestAttributes(javax.faces.context.FacesContext facesContext)
Create a new FacesRequestAttributes adapter for the given FacesContext.

Parameters:
facesContext - the current FacesContext
See Also:
FacesContext.getCurrentInstance()
Method Detail

getFacesContext

protected final javax.faces.context.FacesContext getFacesContext()
Return the JSF FacesContext that this adapter operates on.

getExternalContext

protected final javax.faces.context.ExternalContext getExternalContext()
Return the JSF ExternalContext that this adapter operates on.

See Also:
FacesContext.getExternalContext()

getAttributeMap

protected Map<String,Object> getAttributeMap(int scope)
Return the JSF attribute Map for the specified scope

Parameters:
scope - constant indicating request or session scope
Returns:
the Map representation of the attributes in the specified scope
See Also:
RequestAttributes.SCOPE_REQUEST, RequestAttributes.SCOPE_SESSION

getAttribute

public Object getAttribute(String name,
                           int scope)
Description copied from interface: RequestAttributes
Return the value for the scoped attribute of the given name, if any.

Specified by:
getAttribute in interface RequestAttributes
Parameters:
name - the name of the attribute
scope - the scope identifier
Returns:
the current attribute value, or null if not found

setAttribute

public void setAttribute(String name,
                         Object value,
                         int scope)
Description copied from interface: RequestAttributes
Set the value for the scoped attribute of the given name, replacing an existing value (if any).

Specified by:
setAttribute in interface RequestAttributes
Parameters:
name - the name of the attribute
value - the value for the attribute
scope - the scope identifier

removeAttribute

public void removeAttribute(String name,
                            int scope)
Description copied from interface: RequestAttributes
Remove the scoped attribute of the given name, if it exists.

Note that an implementation should also remove a registered destruction callback for the specified attribute, if any. It does, however, not need to execute a registered destruction callback in this case, since the object will be destroyed by the caller (if appropriate).

Specified by:
removeAttribute in interface RequestAttributes
Parameters:
name - the name of the attribute
scope - the scope identifier

getAttributeNames

public String[] getAttributeNames(int scope)
Description copied from interface: RequestAttributes
Retrieve the names of all attributes in the scope.

Specified by:
getAttributeNames in interface RequestAttributes
Parameters:
scope - the scope identifier
Returns:
the attribute names as String array

registerDestructionCallback

public void registerDestructionCallback(String name,
                                        Runnable callback,
                                        int scope)
Description copied from interface: RequestAttributes
Register a callback to be executed on destruction of the specified attribute in the given scope.

Implementations should do their best to execute the callback at the appropriate time: that is, at request completion or session termination, respectively. If such a callback is not supported by the underlying runtime environment, the callback must be ignored and a corresponding warning should be logged.

Note that 'destruction' usually corresponds to destruction of the entire scope, not to the individual attribute having been explicitly removed by the application. If an attribute gets removed via this facade's RequestAttributes.removeAttribute(String, int) method, any registered destruction callback should be disabled as well, assuming that the removed object will be reused or manually destroyed.

NOTE: Callback objects should generally be serializable if they are being registered for a session scope. Otherwise the callback (or even the entire session) might not survive web app restarts.

Specified by:
registerDestructionCallback in interface RequestAttributes
Parameters:
name - the name of the attribute to register the callback for
callback - the destruction callback to be executed
scope - the scope identifier

resolveReference

public Object resolveReference(String key)
Description copied from interface: RequestAttributes
Resolve the contextual reference for the given key, if any.

At a minimum: the HttpServletRequest/PortletRequest reference for key "request", and the HttpSession/PortletSession reference for key "session".

Specified by:
resolveReference in interface RequestAttributes
Parameters:
key - the contextual key
Returns:
the corresponding object, or null if none found

getSessionId

public String getSessionId()
Description copied from interface: RequestAttributes
Return an id for the current underlying session.

Specified by:
getSessionId in interface RequestAttributes
Returns:
the session id as String (never null

getSessionMutex

public Object getSessionMutex()
Description copied from interface: RequestAttributes
Expose the best available mutex for the underlying session: that is, an object to synchronize on for the underlying session.

Specified by:
getSessionMutex in interface RequestAttributes
Returns:
the session mutex to use (never null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FacesWebRequest

org.springframework.web.context.request
Class FacesWebRequest

java.lang.Object
    extended by  org.springframework.web.context.request.FacesRequestAttributes
        extended by  org.springframework.web.context.request.FacesWebRequest
All Implemented Interfaces:
NativeWebRequest, RequestAttributes, WebRequest
public class FacesWebRequest
extends FacesRequestAttributes
implements NativeWebRequest

WebRequest adapter for a JSF FacesContext.

Since:
2.5.2
Author:
Juergen Hoeller

Field Summary
Fields inherited from interface org.springframework.web.context.request.RequestAttributes
REFERENCE_REQUEST, REFERENCE_SESSION, SCOPE_GLOBAL_SESSION, SCOPE_REQUEST, SCOPE_SESSION
Constructor Summary
FacesWebRequest(javax.faces.context.FacesContext facesContext)
Create a new FacesWebRequest adapter for the given FacesContext.
Method Summary
 boolean checkNotModified(long lastModifiedTimestamp)
Check whether the request qualifies as not modified given the supplied last-modified timestamp (as determined by the application).
 String getContextPath()
Return the context path for this request (usually the base path that the current web application is mapped to).
 String getDescription(boolean includeClientInfo)
Get a short description of this request, typically containing request URI and session id.
 String getHeader(String headerName)
Return the request header of the given name, or null if none.
 Iterator<String> getHeaderNames()
Return a Iterator over request header names.
 String[] getHeaderValues(String headerName)
Return the request header values for the given header name, or null if none.
 Locale getLocale()
Return the primary Locale for this request.
 Object getNativeRequest()
Return the underlying native request object, if available.
<T> T
getNativeRequest(Class<T> requiredType)
Return the underlying native request object, if available.
 Object getNativeResponse()
Return the underlying native response object, if available.
<T> T
getNativeResponse(Class<T> requiredType)
Return the underlying native request object, if available.
 String getParameter(String paramName)
Return the request parameter of the given name, or null if none.
 Map<String,String[]> getParameterMap()
Return a immutable Map of the request parameters, with parameter names as map keys and parameter values as map values.
 Iterator<String> getParameterNames()
Return a Iterator over request parameter names.
 String[] getParameterValues(String paramName)
Return the request parameter values for the given parameter name, or null if none.
 String getRemoteUser()
Return the remote user for this request, if any.
 Principal getUserPrincipal()
Return the user principal for this request, if any.
 boolean isSecure()
Return whether this request has been sent over a secure transport mechanism (such as SSL).
 boolean isUserInRole(String role)
Determine whether the user is in the given role for this request.
 String toString()
Methods inherited from class org.springframework.web.context.request.FacesRequestAttributes
getAttribute, getAttributeMap, getAttributeNames, getExternalContext, getFacesContext, getSessionId, getSessionMutex, registerDestructionCallback, removeAttribute, resolveReference, setAttribute
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.web.context.request.RequestAttributes
getAttribute, getAttributeNames, getSessionId, getSessionMutex, registerDestructionCallback, removeAttribute, resolveReference, setAttribute

Constructor Detail

FacesWebRequest

public FacesWebRequest(javax.faces.context.FacesContext facesContext)
Create a new FacesWebRequest adapter for the given FacesContext.

Parameters:
facesContext - the current FacesContext
See Also:
FacesContext.getCurrentInstance()
Method Detail

getNativeRequest

public Object getNativeRequest()
Description copied from interface: NativeWebRequest
Return the underlying native request object, if available.

Specified by:
getNativeRequest in interface NativeWebRequest
See Also:
HttpServletRequest, ActionRequest, RenderRequest

getNativeResponse

public Object getNativeResponse()
Description copied from interface: NativeWebRequest
Return the underlying native response object, if available.

Specified by:
getNativeResponse in interface NativeWebRequest
See Also:
HttpServletResponse, ActionResponse, RenderResponse

getNativeRequest

public <T> T getNativeRequest(Class<T> requiredType)
Description copied from interface: NativeWebRequest
Return the underlying native request object, if available.

Specified by:
getNativeRequest in interface NativeWebRequest
Parameters:
requiredType - the desired type of request object
Returns:
the matching request object, or null if none of that type is available
See Also:
HttpServletRequest, ActionRequest, RenderRequest

getNativeResponse

public <T> T getNativeResponse(Class<T> requiredType)
Description copied from interface: NativeWebRequest
Return the underlying native request object, if available.

Specified by:
getNativeResponse in interface NativeWebRequest
Parameters:
requiredType - the desired type of response object
Returns:
the matching response object, or null if none of that type is available
See Also:
HttpServletRequest, ActionRequest, RenderRequest

getHeader

public String getHeader(String headerName)
Description copied from interface: WebRequest
Return the request header of the given name, or null if none.

Retrieves the first header value in case of a multi-value header.

Specified by:
getHeader in interface WebRequest
See Also:
HttpServletRequest.getHeader(String)

getHeaderValues

public String[] getHeaderValues(String headerName)
Description copied from interface: WebRequest
Return the request header values for the given header name, or null if none.

A single-value header will be exposed as an array with a single element.

Specified by:
getHeaderValues in interface WebRequest
See Also:
HttpServletRequest.getHeaders(String)

getHeaderNames

public Iterator<String> getHeaderNames()
Description copied from interface: WebRequest
Return a Iterator over request header names.

Specified by:
getHeaderNames in interface WebRequest
See Also:
HttpServletRequest.getHeaderNames()

getParameter

public String getParameter(String paramName)
Description copied from interface: WebRequest
Return the request parameter of the given name, or null if none.

Retrieves the first parameter value in case of a multi-value parameter.

Specified by:
getParameter in interface WebRequest
See Also:
ServletRequest.getParameter(String)

getParameterNames

public Iterator<String> getParameterNames()
Description copied from interface: WebRequest
Return a Iterator over request parameter names.

Specified by:
getParameterNames in interface WebRequest
See Also:
ServletRequest.getParameterNames()

getParameterValues

public String[] getParameterValues(String paramName)
Description copied from interface: WebRequest
Return the request parameter values for the given parameter name, or null if none.

A single-value parameter will be exposed as an array with a single element.

Specified by:
getParameterValues in interface WebRequest
See Also:
ServletRequest.getParameterValues(String)

getParameterMap

public Map<String,String[]> getParameterMap()
Description copied from interface: WebRequest
Return a immutable Map of the request parameters, with parameter names as map keys and parameter values as map values. The map values will be of type String array.

A single-value parameter will be exposed as an array with a single element.

Specified by:
getParameterMap in interface WebRequest
See Also:
ServletRequest.getParameterMap()

getLocale

public Locale getLocale()
Description copied from interface: WebRequest
Return the primary Locale for this request.

Specified by:
getLocale in interface WebRequest
See Also:
ServletRequest.getLocale()

getContextPath

public String getContextPath()
Description copied from interface: WebRequest
Return the context path for this request (usually the base path that the current web application is mapped to).

Specified by:
getContextPath in interface WebRequest
See Also:
HttpServletRequest.getContextPath()

getRemoteUser

public String getRemoteUser()
Description copied from interface: WebRequest
Return the remote user for this request, if any.

Specified by:
getRemoteUser in interface WebRequest
See Also:
HttpServletRequest.getRemoteUser()

getUserPrincipal

public Principal getUserPrincipal()
Description copied from interface: WebRequest
Return the user principal for this request, if any.

Specified by:
getUserPrincipal in interface WebRequest
See Also:
HttpServletRequest.getUserPrincipal()

isUserInRole

public boolean isUserInRole(String role)
Description copied from interface: WebRequest
Determine whether the user is in the given role for this request.

Specified by:
isUserInRole in interface WebRequest
See Also:
HttpServletRequest.isUserInRole(String)

isSecure

public boolean isSecure()
Description copied from interface: WebRequest
Return whether this request has been sent over a secure transport mechanism (such as SSL).

Specified by:
isSecure in interface WebRequest
See Also:
ServletRequest.isSecure()

checkNotModified

public boolean checkNotModified(long lastModifiedTimestamp)
Description copied from interface: WebRequest
Check whether the request qualifies as not modified given the supplied last-modified timestamp (as determined by the application).

This will also transparently set the appropriate response headers, for both the modified case and the not-modified case.

Typical usage:

 public String myHandleMethod(WebRequest webRequest, Model model) {
   long lastModified = // application-specific calculation
   if (request.checkNotModified(lastModified)) {
     // shortcut exit - no further processing necessary
     return null;
   }
   // further request processing, actually building content
   model.addAttribute(...);
   return "myViewName";
 }

Specified by:
checkNotModified in interface WebRequest
Parameters:
lastModifiedTimestamp - the last-modified timestamp that the application determined for the underlying resource
Returns:
whether the request qualifies as not modified, allowing to abort request processing and relying on the response telling the client that the content has not been modified

getDescription

public String getDescription(boolean includeClientInfo)
Description copied from interface: WebRequest
Get a short description of this request, typically containing request URI and session id.

Specified by:
getDescription in interface WebRequest
Parameters:
includeClientInfo - whether to include client-specific information such as session id and user name
Returns:
the requested description as String

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Log4jNestedDiagnosticContextInterceptor

org.springframework.web.context.request
Class Log4jNestedDiagnosticContextInterceptor

java.lang.Object
    extended by  org.springframework.web.context.request.Log4jNestedDiagnosticContextInterceptor
All Implemented Interfaces:
WebRequestInterceptor
public class Log4jNestedDiagnosticContextInterceptor
extends Object
implements WebRequestInterceptor

Request logging interceptor that adds a request context message to the Log4J nested diagnostic context (NDC) before the request is processed, removing it again after the request is processed.

Since:
2.5
Author:
Juergen Hoeller
See Also:
NDC.push(String), NDC.pop()

Field Summary
protected  Logger log4jLogger
Logger available to subclasses
Constructor Summary
Log4jNestedDiagnosticContextInterceptor()
Method Summary
void | afterCompletion(WebRequest request, Exception ex) Removes the log message from the Log4J NDC after the request is processed.
protected String | getNestedDiagnosticContextMessage(WebRequest request) Determine the message to be pushed onto the Log4J nested diagnostic context.
protected boolean | isIncludeClientInfo() Return whether or not the session id and user name should be included in the log message.
void | postHandle(WebRequest request, ModelMap model) Intercept the execution of a request handler after its successful invocation, right before view rendering (if any).
void | preHandle(WebRequest request) Adds a message the Log4J NDC before the request is processed.
void | setIncludeClientInfo(boolean includeClientInfo) Set whether or not the session id and user name should be included in the log message.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

log4jLogger

protected final Logger log4jLogger
Logger available to subclasses

Constructor Detail

Log4jNestedDiagnosticContextInterceptor

public Log4jNestedDiagnosticContextInterceptor()
Method Detail

setIncludeClientInfo

public void setIncludeClientInfo(boolean includeClientInfo)
Set whether or not the session id and user name should be included in the log message.

isIncludeClientInfo

protected boolean isIncludeClientInfo()
Return whether or not the session id and user name should be included in the log message.

preHandle

public void preHandle(WebRequest request)
               throws Exception
Adds a message the Log4J NDC before the request is processed.

Specified by:
preHandle in interface WebRequestInterceptor
Parameters:
request - the current web request
Throws:
Exception - in case of errors

getNestedDiagnosticContextMessage

protected String getNestedDiagnosticContextMessage(WebRequest request)
Determine the message to be pushed onto the Log4J nested diagnostic context.

Default is the request object's getDescription result.

Parameters:
request - current HTTP request
Returns:
the message to be pushed onto the Log4J NDC
See Also:
WebRequest.getDescription(boolean), isIncludeClientInfo()

postHandle

public void postHandle(WebRequest request,
                       ModelMap model)
                throws Exception
Description copied from interface: WebRequestInterceptor
Intercept the execution of a request handler after its successful invocation, right before view rendering (if any).

Allows for modifying context resources after successful handler execution (for example, flushing a Hibernate Session).

Specified by:
postHandle in interface WebRequestInterceptor
Parameters:
request - the current web request
model - the map of model objects that will be exposed to the view (may be null). Can be used to analyze the exposed model and/or to add further model attributes, if desired.
Throws:
Exception - in case of errors

afterCompletion

public void afterCompletion(WebRequest request,
                            Exception ex)
                     throws Exception
Removes the log message from the Log4J NDC after the request is processed.

Specified by:
afterCompletion in interface WebRequestInterceptor
Parameters:
request - the current web request
ex - exception thrown on handler execution, if any
Throws:
Exception - in case of errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RequestContextHolder

org.springframework.web.context.request
Class RequestContextHolder

java.lang.Object
    extended by  org.springframework.web.context.request.RequestContextHolder

public abstract class RequestContextHolder
extends Object

Holder class to expose the web request in the form of a thread-bound RequestAttributes object.

Use RequestContextListener or RequestContextFilter to expose the current web request. Note that DispatcherServlet and DispatcherPortlet already expose the current request by default.

Since:
2.0
Author:
Juergen Hoeller, Rod Johnson
See Also:
RequestContextListener, RequestContextFilter, DispatcherServlet, DispatcherPortlet

Constructor Summary
RequestContextHolder()
Method Summary
static RequestAttributes | currentRequestAttributes() Return the RequestAttributes currently bound to the thread.
static RequestAttributes | getRequestAttributes() Return the RequestAttributes currently bound to the thread.
static void | resetRequestAttributes() Reset the RequestAttributes for the current thread.
static void | setRequestAttributes(RequestAttributes attributes) Bind the given RequestAttributes to the current thread, not exposing it as inheritable for child threads.
static void | setRequestAttributes(RequestAttributes attributes, boolean inheritable) Bind the given RequestAttributes to the current thread.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

RequestContextHolder

public RequestContextHolder()
Method Detail

resetRequestAttributes

public static void resetRequestAttributes()
Reset the RequestAttributes for the current thread.

setRequestAttributes

public static void setRequestAttributes(RequestAttributes attributes)
Bind the given RequestAttributes to the current thread, not exposing it as inheritable for child threads.

Parameters:
attributes - the RequestAttributes to expose
See Also:
setRequestAttributes(RequestAttributes, boolean)

setRequestAttributes

public static void setRequestAttributes(RequestAttributes attributes,
                                        boolean inheritable)
Bind the given RequestAttributes to the current thread.

Parameters:
attributes - the RequestAttributes to expose
inheritable - whether to expose the RequestAttributes as inheritable for child threads (using an InheritableThreadLocal)

getRequestAttributes

public static RequestAttributes getRequestAttributes()
Return the RequestAttributes currently bound to the thread.

Returns:
the RequestAttributes currently bound to the thread, or null if none bound

currentRequestAttributes

public static RequestAttributes currentRequestAttributes()
                                                  throws IllegalStateException
Return the RequestAttributes currently bound to the thread.

Exposes the previously bound RequestAttributes instance, if any. Falls back to the current JSF FacesContext, if any.

Returns:
the RequestAttributes currently bound to the thread
Throws:
IllegalStateException - if no RequestAttributes object is bound to the current thread
See Also:
setRequestAttributes(org.springframework.web.context.request.RequestAttributes), ServletRequestAttributes, FacesRequestAttributes, FacesContext.getCurrentInstance()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RequestContextListener

org.springframework.web.context.request
Class RequestContextListener

java.lang.Object
    extended by  org.springframework.web.context.request.RequestContextListener
All Implemented Interfaces:
EventListener, ServletRequestListener
public class RequestContextListener
extends Object
implements ServletRequestListener

Servlet 2.4+ listener that exposes the request to the current thread, through both LocaleContextHolder and RequestContextHolder. To be registered as listener in web.xml.

Alternatively, Spring's RequestContextFilter and Spring's DispatcherServlet also expose the same request context to the current thread. In contrast to this listener, advanced options are available there (e.g. "threadContextInheritable").

This listener is mainly for use with third-party servlets, e.g. the JSF FacesServlet. Within Spring's own web support, DispatcherServlet's processing is perfectly sufficient.

Since:
2.0
Author:
Juergen Hoeller
See Also:
ServletRequestListener, LocaleContextHolder, RequestContextHolder, RequestContextFilter, DispatcherServlet

Constructor Summary
RequestContextListener()
Method Summary
void | requestDestroyed(ServletRequestEvent requestEvent)
void | requestInitialized(ServletRequestEvent requestEvent)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

RequestContextListener

public RequestContextListener()
Method Detail

requestInitialized

public void requestInitialized(ServletRequestEvent requestEvent)
Specified by:
requestInitialized in interface ServletRequestListener

requestDestroyed

public void requestDestroyed(ServletRequestEvent requestEvent)
Specified by:
requestDestroyed in interface ServletRequestListener
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RequestScope

org.springframework.web.context.request
Class RequestScope

java.lang.Object
    extended by  org.springframework.web.context.request.AbstractRequestAttributesScope
        extended by  org.springframework.web.context.request.RequestScope
All Implemented Interfaces:
Scope
public class RequestScope
extends AbstractRequestAttributesScope

Request-backed Scope implementation.

Relies on a thread-bound RequestAttributes instance, which can be exported through RequestContextListener, RequestContextFilter or DispatcherServlet.

This Scope will also work for Portlet environments, through an alternate RequestAttributes implementation (as exposed out-of-the-box by Spring's DispatcherPortlet.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller, Rob Harrop
See Also:
RequestContextHolder.currentRequestAttributes(), RequestAttributes.SCOPE_REQUEST, RequestContextListener, RequestContextFilter, DispatcherServlet, DispatcherPortlet

Constructor Summary
RequestScope()
Method Summary
String | getConversationId() There is no conversation id concept for a request, so this method returns null.
protected int | getScope() Template method that determines the actual target scope.
Methods inherited from class org.springframework.web.context.request.AbstractRequestAttributesScope
get, registerDestructionCallback, remove, resolveContextualObject
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

RequestScope

public RequestScope()
Method Detail

getScope

protected int getScope()
Description copied from class: AbstractRequestAttributesScope
Template method that determines the actual target scope.

Specified by:
getScope in class AbstractRequestAttributesScope
Returns:
the target scope, in the form of an appropriate RequestAttributes constant
See Also:
RequestAttributes.SCOPE_REQUEST, RequestAttributes.SCOPE_SESSION, RequestAttributes.SCOPE_GLOBAL_SESSION

getConversationId

public String getConversationId()
There is no conversation id concept for a request, so this method returns null.

Returns:
the conversation ID, or null if there is no conversation ID for the current scope
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletRequestAttributes

org.springframework.web.context.request
Class ServletRequestAttributes

java.lang.Object
    extended by  org.springframework.web.context.request.AbstractRequestAttributes
        extended by  org.springframework.web.context.request.ServletRequestAttributes
All Implemented Interfaces:
RequestAttributes
Direct Known Subclasses:
ServletWebRequest
public class ServletRequestAttributes
extends AbstractRequestAttributes

Servlet-based implementation of the RequestAttributes interface.

Accesses objects from servlet request and HTTP session scope, with no distinction between "session" and "global session".

Since:
2.0
Author:
Juergen Hoeller
See Also:
ServletRequest.getAttribute(java.lang.String), HttpSession.getAttribute(java.lang.String)

Field Summary
static String DESTRUCTION_CALLBACK_NAME_PREFIX
Constant identifying the String prefixed to the name of a destruction callback when it is stored in a HttpSession.
Fields inherited from class org.springframework.web.context.request.AbstractRequestAttributes
requestDestructionCallbacks
Fields inherited from interface org.springframework.web.context.request.RequestAttributes
REFERENCE_REQUEST, REFERENCE_SESSION, SCOPE_GLOBAL_SESSION, SCOPE_REQUEST, SCOPE_SESSION
Constructor Summary
ServletRequestAttributes(HttpServletRequest request)
Create a new ServletRequestAttributes instance for the given request.
Method Summary
Object | getAttribute(String name, int scope) Return the value for the scoped attribute of the given name, if any.
String[] | getAttributeNames(int scope) Retrieve the names of all attributes in the scope.
HttpServletRequest | getRequest() Exposes the native HttpServletRequest that we're wrapping.
protected HttpSession | getSession(boolean allowCreate) Exposes the HttpSession that we're wrapping.
String | getSessionId() Return an id for the current underlying session.
Object | getSessionMutex() Expose the best available mutex for the underlying session: that is, an object to synchronize on for the underlying session.
void | registerDestructionCallback(String name, Runnable callback, int scope) Register a callback to be executed on destruction of the specified attribute in the given scope.
protected void | registerSessionDestructionCallback(String name, Runnable callback) Register the given callback as to be executed after session termination.
void | removeAttribute(String name, int scope) Remove the scoped attribute of the given name, if it exists.
Object | resolveReference(String key) Resolve the contextual reference for the given key, if any.
void | setAttribute(String name, Object value, int scope) Set the value for the scoped attribute of the given name, replacing an existing value (if any).
String | toString()
protected void | updateAccessedSessionAttributes() Update all accessed session attributes through session.setAttribute calls, explicitly indicating to the container that they might have been modified.
Methods inherited from class org.springframework.web.context.request.AbstractRequestAttributes
isRequestActive, registerRequestDestructionCallback, removeRequestDestructionCallback, requestCompleted
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

DESTRUCTION_CALLBACK_NAME_PREFIX

public static final String DESTRUCTION_CALLBACK_NAME_PREFIX
Constant identifying the String prefixed to the name of a destruction callback when it is stored in a HttpSession.

Constructor Detail

ServletRequestAttributes

public ServletRequestAttributes(HttpServletRequest request)
Create a new ServletRequestAttributes instance for the given request.

Parameters:
request - current HTTP request
Method Detail

getRequest

public final HttpServletRequest getRequest()
Exposes the native HttpServletRequest that we're wrapping.

getSession

protected final HttpSession getSession(boolean allowCreate)
Exposes the HttpSession that we're wrapping.

Parameters:
allowCreate - whether to allow creation of a new session if none exists yet

getAttribute

public Object getAttribute(String name,
                           int scope)
Description copied from interface: RequestAttributes
Return the value for the scoped attribute of the given name, if any.

Parameters:
name - the name of the attribute
scope - the scope identifier
Returns:
the current attribute value, or null if not found

setAttribute

public void setAttribute(String name,
                         Object value,
                         int scope)
Description copied from interface: RequestAttributes
Set the value for the scoped attribute of the given name, replacing an existing value (if any).

Parameters:
name - the name of the attribute
value - the value for the attribute
scope - the scope identifier

removeAttribute

public void removeAttribute(String name,
                            int scope)
Description copied from interface: RequestAttributes
Remove the scoped attribute of the given name, if it exists.

Note that an implementation should also remove a registered destruction callback for the specified attribute, if any. It does, however, not need to execute a registered destruction callback in this case, since the object will be destroyed by the caller (if appropriate).

Parameters:
name - the name of the attribute
scope - the scope identifier

getAttributeNames

public String[] getAttributeNames(int scope)
Description copied from interface: RequestAttributes
Retrieve the names of all attributes in the scope.

Parameters:
scope - the scope identifier
Returns:
the attribute names as String array

registerDestructionCallback

public void registerDestructionCallback(String name,
                                        Runnable callback,
                                        int scope)
Description copied from interface: RequestAttributes
Register a callback to be executed on destruction of the specified attribute in the given scope.

Implementations should do their best to execute the callback at the appropriate time: that is, at request completion or session termination, respectively. If such a callback is not supported by the underlying runtime environment, the callback must be ignored and a corresponding warning should be logged.

Note that 'destruction' usually corresponds to destruction of the entire scope, not to the individual attribute having been explicitly removed by the application. If an attribute gets removed via this facade's RequestAttributes.removeAttribute(String, int) method, any registered destruction callback should be disabled as well, assuming that the removed object will be reused or manually destroyed.

NOTE: Callback objects should generally be serializable if they are being registered for a session scope. Otherwise the callback (or even the entire session) might not survive web app restarts.

Parameters:
name - the name of the attribute to register the callback for
callback - the destruction callback to be executed
scope - the scope identifier

resolveReference

public Object resolveReference(String key)
Description copied from interface: RequestAttributes
Resolve the contextual reference for the given key, if any.

At a minimum: the HttpServletRequest/PortletRequest reference for key "request", and the HttpSession/PortletSession reference for key "session".

Parameters:
key - the contextual key
Returns:
the corresponding object, or null if none found

getSessionId

public String getSessionId()
Description copied from interface: RequestAttributes
Return an id for the current underlying session.

Returns:
the session id as String (never null

getSessionMutex

public Object getSessionMutex()
Description copied from interface: RequestAttributes
Expose the best available mutex for the underlying session: that is, an object to synchronize on for the underlying session.

Returns:
the session mutex to use (never null

updateAccessedSessionAttributes

protected void updateAccessedSessionAttributes()
Update all accessed session attributes through session.setAttribute calls, explicitly indicating to the container that they might have been modified.

Specified by:
updateAccessedSessionAttributes in class AbstractRequestAttributes

registerSessionDestructionCallback

protected void registerSessionDestructionCallback(String name,
                                                  Runnable callback)
Register the given callback as to be executed after session termination.

Note: The callback object should be serializable in order to survive web app restarts.

Parameters:
name - the name of the attribute to register the callback for
callback - the callback to be executed for destruction

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletWebRequest

org.springframework.web.context.request
Class ServletWebRequest

java.lang.Object
    extended by  org.springframework.web.context.request.AbstractRequestAttributes
        extended by  org.springframework.web.context.request.ServletRequestAttributes
            extended by  org.springframework.web.context.request.ServletWebRequest
All Implemented Interfaces:
NativeWebRequest, RequestAttributes, WebRequest
Direct Known Subclasses:
DispatcherServletWebRequest
public class ServletWebRequest
extends ServletRequestAttributes
implements NativeWebRequest

WebRequest adapter for an HttpServletRequest.

Since:
2.0
Author:
Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.web.context.request.ServletRequestAttributes
DESTRUCTION_CALLBACK_NAME_PREFIX
Fields inherited from class org.springframework.web.context.request.AbstractRequestAttributes
requestDestructionCallbacks
Fields inherited from interface org.springframework.web.context.request.RequestAttributes
REFERENCE_REQUEST, REFERENCE_SESSION, SCOPE_GLOBAL_SESSION, SCOPE_REQUEST, SCOPE_SESSION
Constructor Summary
ServletWebRequest(HttpServletRequest request)
Create a new ServletWebRequest instance for the given request.
ServletWebRequest(HttpServletRequest request, HttpServletResponse response)
Create a new ServletWebRequest instance for the given request/response pair.
Method Summary
 boolean checkNotModified(long lastModifiedTimestamp)
Check whether the request qualifies as not modified given the supplied last-modified timestamp (as determined by the application).
 String getContextPath()
Return the context path for this request (usually the base path that the current web application is mapped to).
 String getDescription(boolean includeClientInfo)
Get a short description of this request, typically containing request URI and session id.
 String getHeader(String headerName)
Return the request header of the given name, or null if none.
 Iterator<String> getHeaderNames()
Return a Iterator over request header names.
 String[] getHeaderValues(String headerName)
Return the request header values for the given header name, or null if none.
 Locale getLocale()
Return the primary Locale for this request.
 Object getNativeRequest()
Return the underlying native request object, if available.
<T> T
getNativeRequest(Class<T> requiredType)
Return the underlying native request object, if available.
 Object getNativeResponse()
Return the underlying native response object, if available.
<T> T
getNativeResponse(Class<T> requiredType)
Return the underlying native request object, if available.
 String getParameter(String paramName)
Return the request parameter of the given name, or null if none.
 Map<String,String[]> getParameterMap()
Return a immutable Map of the request parameters, with parameter names as map keys and parameter values as map values.
 Iterator<String> getParameterNames()
Return a Iterator over request parameter names.
 String[] getParameterValues(String paramName)
Return the request parameter values for the given parameter name, or null if none.
 String getRemoteUser()
Return the remote user for this request, if any.
 HttpServletResponse getResponse()
Exposes the native HttpServletRequest that we're wrapping (if any).
 Principal getUserPrincipal()
Return the user principal for this request, if any.
 boolean isNotModified()
 boolean isSecure()
Return whether this request has been sent over a secure transport mechanism (such as SSL).
 boolean isUserInRole(String role)
Determine whether the user is in the given role for this request.
 String toString()
Methods inherited from class org.springframework.web.context.request.ServletRequestAttributes
getAttribute, getAttributeNames, getRequest, getSession, getSessionId, getSessionMutex, registerDestructionCallback, registerSessionDestructionCallback, removeAttribute, resolveReference, setAttribute, updateAccessedSessionAttributes
Methods inherited from class org.springframework.web.context.request.AbstractRequestAttributes
isRequestActive, registerRequestDestructionCallback, removeRequestDestructionCallback, requestCompleted
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.web.context.request.RequestAttributes
getAttribute, getAttributeNames, getSessionId, getSessionMutex, registerDestructionCallback, removeAttribute, resolveReference, setAttribute

Constructor Detail

ServletWebRequest

public ServletWebRequest(HttpServletRequest request)
Create a new ServletWebRequest instance for the given request.

Parameters:
request - current HTTP request

ServletWebRequest

public ServletWebRequest(HttpServletRequest request,
                         HttpServletResponse response)
Create a new ServletWebRequest instance for the given request/response pair.

Parameters:
request - current HTTP request
response - current HTTP response (for automatic last-modified handling)
Method Detail

getResponse

public final HttpServletResponse getResponse()
Exposes the native HttpServletRequest that we're wrapping (if any).

getNativeRequest

public Object getNativeRequest()
Description copied from interface: NativeWebRequest
Return the underlying native request object, if available.

Specified by:
getNativeRequest in interface NativeWebRequest
See Also:
HttpServletRequest, ActionRequest, RenderRequest

getNativeResponse

public Object getNativeResponse()
Description copied from interface: NativeWebRequest
Return the underlying native response object, if available.

Specified by:
getNativeResponse in interface NativeWebRequest
See Also:
HttpServletResponse, ActionResponse, RenderResponse

getNativeRequest

public <T> T getNativeRequest(Class<T> requiredType)
Description copied from interface: NativeWebRequest
Return the underlying native request object, if available.

Specified by:
getNativeRequest in interface NativeWebRequest
Parameters:
requiredType - the desired type of request object
Returns:
the matching request object, or null if none of that type is available
See Also:
HttpServletRequest, ActionRequest, RenderRequest

getNativeResponse

public <T> T getNativeResponse(Class<T> requiredType)
Description copied from interface: NativeWebRequest
Return the underlying native request object, if available.

Specified by:
getNativeResponse in interface NativeWebRequest
Parameters:
requiredType - the desired type of response object
Returns:
the matching response object, or null if none of that type is available
See Also:
HttpServletRequest, ActionRequest, RenderRequest

getHeader

public String getHeader(String headerName)
Description copied from interface: WebRequest
Return the request header of the given name, or null if none.

Retrieves the first header value in case of a multi-value header.

Specified by:
getHeader in interface WebRequest
See Also:
HttpServletRequest.getHeader(String)

getHeaderValues

public String[] getHeaderValues(String headerName)
Description copied from interface: WebRequest
Return the request header values for the given header name, or null if none.

A single-value header will be exposed as an array with a single element.

Specified by:
getHeaderValues in interface WebRequest
See Also:
HttpServletRequest.getHeaders(String)

getHeaderNames

public Iterator<String> getHeaderNames()
Description copied from interface: WebRequest
Return a Iterator over request header names.

Specified by:
getHeaderNames in interface WebRequest
See Also:
HttpServletRequest.getHeaderNames()

getParameter

public String getParameter(String paramName)
Description copied from interface: WebRequest
Return the request parameter of the given name, or null if none.

Retrieves the first parameter value in case of a multi-value parameter.

Specified by:
getParameter in interface WebRequest
See Also:
ServletRequest.getParameter(String)

getParameterValues

public String[] getParameterValues(String paramName)
Description copied from interface: WebRequest
Return the request parameter values for the given parameter name, or null if none.

A single-value parameter will be exposed as an array with a single element.

Specified by:
getParameterValues in interface WebRequest
See Also:
ServletRequest.getParameterValues(String)

getParameterNames

public Iterator<String> getParameterNames()
Description copied from interface: WebRequest
Return a Iterator over request parameter names.

Specified by:
getParameterNames in interface WebRequest
See Also:
ServletRequest.getParameterNames()

getParameterMap

public Map<String,String[]> getParameterMap()
Description copied from interface: WebRequest
Return a immutable Map of the request parameters, with parameter names as map keys and parameter values as map values. The map values will be of type String array.

A single-value parameter will be exposed as an array with a single element.

Specified by:
getParameterMap in interface WebRequest
See Also:
ServletRequest.getParameterMap()

getLocale

public Locale getLocale()
Description copied from interface: WebRequest
Return the primary Locale for this request.

Specified by:
getLocale in interface WebRequest
See Also:
ServletRequest.getLocale()

getContextPath

public String getContextPath()
Description copied from interface: WebRequest
Return the context path for this request (usually the base path that the current web application is mapped to).

Specified by:
getContextPath in interface WebRequest
See Also:
HttpServletRequest.getContextPath()

getRemoteUser

public String getRemoteUser()
Description copied from interface: WebRequest
Return the remote user for this request, if any.

Specified by:
getRemoteUser in interface WebRequest
See Also:
HttpServletRequest.getRemoteUser()

getUserPrincipal

public Principal getUserPrincipal()
Description copied from interface: WebRequest
Return the user principal for this request, if any.

Specified by:
getUserPrincipal in interface WebRequest
See Also:
HttpServletRequest.getUserPrincipal()

isUserInRole

public boolean isUserInRole(String role)
Description copied from interface: WebRequest
Determine whether the user is in the given role for this request.

Specified by:
isUserInRole in interface WebRequest
See Also:
HttpServletRequest.isUserInRole(String)

isSecure

public boolean isSecure()
Description copied from interface: WebRequest
Return whether this request has been sent over a secure transport mechanism (such as SSL).

Specified by:
isSecure in interface WebRequest
See Also:
ServletRequest.isSecure()

checkNotModified

public boolean checkNotModified(long lastModifiedTimestamp)
Description copied from interface: WebRequest
Check whether the request qualifies as not modified given the supplied last-modified timestamp (as determined by the application).

This will also transparently set the appropriate response headers, for both the modified case and the not-modified case.

Typical usage:

 public String myHandleMethod(WebRequest webRequest, Model model) {
   long lastModified = // application-specific calculation
   if (request.checkNotModified(lastModified)) {
     // shortcut exit - no further processing necessary
     return null;
   }
   // further request processing, actually building content
   model.addAttribute(...);
   return "myViewName";
 }

Specified by:
checkNotModified in interface WebRequest
Parameters:
lastModifiedTimestamp - the last-modified timestamp that the application determined for the underlying resource
Returns:
whether the request qualifies as not modified, allowing to abort request processing and relying on the response telling the client that the content has not been modified

isNotModified

public boolean isNotModified()

getDescription

public String getDescription(boolean includeClientInfo)
Description copied from interface: WebRequest
Get a short description of this request, typically containing request URI and session id.

Specified by:
getDescription in interface WebRequest
Parameters:
includeClientInfo - whether to include client-specific information such as session id and user name
Returns:
the requested description as String

toString

public String toString()
Overrides:
toString in class ServletRequestAttributes
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SessionScope

org.springframework.web.context.request
Class SessionScope

java.lang.Object
    extended by  org.springframework.web.context.request.AbstractRequestAttributesScope
        extended by  org.springframework.web.context.request.SessionScope
All Implemented Interfaces:
Scope
public class SessionScope
extends AbstractRequestAttributesScope

Session-backed Scope implementation.

Relies on a thread-bound RequestAttributes instance, which can be exported through RequestContextListener, RequestContextFilter or DispatcherServlet.

This Scope will also work for Portlet environments, through an alternate RequestAttributes implementation (as exposed out-of-the-box by Spring's DispatcherPortlet.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller, Rob Harrop
See Also:
RequestContextHolder.currentRequestAttributes(), RequestAttributes.SCOPE_SESSION, RequestAttributes.SCOPE_GLOBAL_SESSION, RequestContextListener, RequestContextFilter, DispatcherServlet, DispatcherPortlet

Constructor Summary
SessionScope()
Create a new SessionScope, storing attributes in a locally isolated session (or default session, if there is no distinction between a global session and a component-specific session).
SessionScope(boolean globalSession)
Create a new SessionScope, specifying whether to store attributes in the global session, provided that such a distinction is available.
Method Summary
Object | get(String name, ObjectFactory objectFactory) Return the object with the given name from the underlying scope, creating it if not found in the underlying storage mechanism.
String | getConversationId() Return the conversation ID for the current underlying scope, if any.
protected int | getScope() Template method that determines the actual target scope.
Object | remove(String name) Remove the object with the given name from the underlying scope.
Methods inherited from class org.springframework.web.context.request.AbstractRequestAttributesScope
registerDestructionCallback, resolveContextualObject
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SessionScope

public SessionScope()
Create a new SessionScope, storing attributes in a locally isolated session (or default session, if there is no distinction between a global session and a component-specific session).

SessionScope

public SessionScope(boolean globalSession)
Create a new SessionScope, specifying whether to store attributes in the global session, provided that such a distinction is available.

This distinction is important for Portlet environments, where there are two notions of a session: "portlet scope" and "application scope". If this flag is on, objects will be put into the "application scope" session; else they will end up in the "portlet scope" session (the typical default).

In a Servlet environment, this flag is effectively ignored.

Parameters:
globalSession - true in case of the global session as target; false in case of a component-specific session as target
See Also:
PortletRequestAttributes, ServletRequestAttributes
Method Detail

getScope

protected int getScope()
Description copied from class: AbstractRequestAttributesScope
Template method that determines the actual target scope.

Specified by:
getScope in class AbstractRequestAttributesScope
Returns:
the target scope, in the form of an appropriate RequestAttributes constant
See Also:
RequestAttributes.SCOPE_REQUEST, RequestAttributes.SCOPE_SESSION, RequestAttributes.SCOPE_GLOBAL_SESSION

getConversationId

public String getConversationId()
Description copied from interface: Scope
Return the conversation ID for the current underlying scope, if any.

The exact meaning of the conversation ID depends on the underlying storage mechanism. In the case of session-scoped objects, the conversation ID would typically be equal to (or derived from) the session ID; in the case of a custom conversation that sits within the overall session, the specific ID for the current conversation would be appropriate.

Note: This is an optional operation. It is perfectly valid to return null in an implementation of this method if the underlying storage mechanism has no obvious candidate for such an ID.

Returns:
the conversation ID, or null if there is no conversation ID for the current scope

get

public Object get(String name,
                  ObjectFactory objectFactory)
Description copied from interface: Scope
Return the object with the given name from the underlying scope, creating it if not found in the underlying storage mechanism.

This is the central operation of a Scope, and the only operation that is absolutely required.

Specified by:
get in interface Scope
Overrides:
get in class AbstractRequestAttributesScope
Parameters:
name - the name of the object to retrieve
objectFactory - the ObjectFactory to use to create the scoped object if it is not present in the underlying storage mechanism
Returns:
the desired object (never null)

remove

public Object remove(String name)
Description copied from interface: Scope
Remove the object with the given name from the underlying scope.

Returns null if no object was found; otherwise returns the removed Object.

Note that an implementation should also remove a registered destruction callback for the specified object, if any. It does, however, not need to execute a registered destruction callback in this case, since the object will be destroyed by the caller (if appropriate).

Note: This is an optional operation. Implementations may throw UnsupportedOperationException if they do not support explicitly removing an object.

Specified by:
remove in interface Scope
Overrides:
remove in class AbstractRequestAttributesScope
Parameters:
name - the name of the object to remove
Returns:
the removed object, or null if no object was present
See Also:
Scope.registerDestructionCallback(java.lang.String, java.lang.Runnable)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.web.context.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.context.support

Classes supporting the org.springframework.web.context package, such as WebApplicationContext implementations and various utility classes.

See:
Description

Class Summary
AbstractRefreshableWebApplicationContext | AbstractRefreshableApplicationContext subclass which implements the ConfigurableWebApplicationContext interface for web environments.
AnnotationConfigWebApplicationContext | WebApplicationContext implementation which accepts annotated classes as input - in particular @Configuration-annotated classes, but also plain @Components and JSR-330 compliant classes using javax.inject annotations.
ContextExposingHttpServletRequest | HttpServletRequest decorator that makes all Spring beans in a given WebApplicationContext accessible as request attributes, through lazy checking once an attribute gets accessed.
GenericWebApplicationContext | Subclass of GenericApplicationContext, suitable for web environments.
HttpRequestHandlerServlet | Simple HttpServlet that delegates to an HttpRequestHandler bean defined in Spring's root web application context.
RequestHandledEvent | Event raised when a request is handled within an ApplicationContext.
ServletContextAttributeExporter | Exporter that takes Spring-defined objects and exposes them as ServletContext attributes.
ServletContextAttributeFactoryBean | FactoryBean that fetches a specific, existing ServletContext attribute.
ServletContextAwareProcessor | BeanPostProcessor implementation that passes the ServletContext to beans that implement the ServletContextAware interface.
ServletContextFactoryBean | Deprecated. as of Spring 3.0, since "servletContext" is now available as a default bean in every WebApplicationContext
ServletContextParameterFactoryBean | FactoryBean that retrieves a specific ServletContext init parameter (that is, a "context-param" defined in web.xml).
ServletContextPropertyPlaceholderConfigurer | Subclass of PropertyPlaceholderConfigurer that resolves placeholders as ServletContext init parameters (that is, web.xml context-param entries).
ServletContextResource | Resource implementation for ServletContext resources, interpreting relative paths within the web application root directory.
ServletContextResourceLoader | ResourceLoader implementation that resolves paths as ServletContext resources, for use outside a WebApplicationContext (for example, in an HttpServletBean or GenericFilterBean subclass).
ServletContextResourcePatternResolver | ServletContext-aware subclass of PathMatchingResourcePatternResolver, able to find matching resources below the web application root directory via Servlet 2.3's ServletContext.getResourcePaths.
ServletContextScope | Scope wrapper for a ServletContext, i.e.
ServletRequestHandledEvent | Servlet-specific subclass of RequestHandledEvent, adding servlet-specific context information.
SpringBeanAutowiringSupport | Convenient base class for self-autowiring classes that gets constructed within a Spring-based web application.
StaticWebApplicationContext | Static WebApplicationContext implementation for testing.
WebApplicationContextUtils | Convenience methods for retrieving the root WebApplicationContext for a given ServletContext.
WebApplicationObjectSupport | Convenient superclass for application objects running in a WebApplicationContext.
XmlWebApplicationContext | WebApplicationContext implementation which takes its configuration from XML documents, understood by an XmlBeanDefinitionReader.

Package org.springframework.web.context.support Description

Classes supporting the org.springframework.web.context package, such as WebApplicationContext implementations and various utility classes.


org.springframework.web.context.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.context.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.core.io.AbstractResource (implements org.springframework.core.io.Resource)
      • org.springframework.web.context.support.ServletContextResource (implements org.springframework.core.io.ContextResource)
    • org.springframework.context.support.ApplicationObjectSupport (implements org.springframework.context.ApplicationContextAware)
      • org.springframework.web.context.support.WebApplicationObjectSupport (implements org.springframework.web.context.ServletContextAware)
    • org.springframework.core.io.DefaultResourceLoader (implements org.springframework.core.io.ResourceLoader)
      • org.springframework.context.support.AbstractApplicationContext (implements org.springframework.context.ConfigurableApplicationContext, org.springframework.beans.factory.DisposableBean)
        • org.springframework.context.support.AbstractRefreshableApplicationContext
          • org.springframework.context.support.AbstractRefreshableConfigApplicationContext (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean)
            • org.springframework.web.context.support.AbstractRefreshableWebApplicationContext (implements org.springframework.web.context.ConfigurableWebApplicationContext, org.springframework.ui.context.ThemeSource)
              • org.springframework.web.context.support.AnnotationConfigWebApplicationContext
              • org.springframework.web.context.support.XmlWebApplicationContext
        • org.springframework.context.support.GenericApplicationContext (implements org.springframework.beans.factory.support.BeanDefinitionRegistry)
          • org.springframework.web.context.support.GenericWebApplicationContext (implements org.springframework.ui.context.ThemeSource, org.springframework.web.context.WebApplicationContext)
          • org.springframework.context.support.StaticApplicationContext
            • org.springframework.web.context.support.StaticWebApplicationContext (implements org.springframework.web.context.ConfigurableWebApplicationContext, org.springframework.ui.context.ThemeSource)
      • org.springframework.web.context.support.ServletContextResourceLoader
    • java.util.EventObject (implements java.io.Serializable)
      • org.springframework.context.ApplicationEvent
        • org.springframework.web.context.support.RequestHandledEvent
          • org.springframework.web.context.support.ServletRequestHandledEvent
    • javax.servlet.GenericServlet (implements java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig)
      • javax.servlet.http.HttpServlet (implements java.io.Serializable)
        • org.springframework.web.context.support.HttpRequestHandlerServlet
    • org.springframework.core.io.support.PathMatchingResourcePatternResolver (implements org.springframework.core.io.support.ResourcePatternResolver)
      • org.springframework.web.context.support.ServletContextResourcePatternResolver
    • org.springframework.core.io.support.PropertiesLoaderSupport
      • org.springframework.beans.factory.config.PropertyResourceConfigurer (implements org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.core.PriorityOrdered)
        • org.springframework.beans.factory.config.PropertyPlaceholderConfigurer (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware)
          • org.springframework.web.context.support.ServletContextPropertyPlaceholderConfigurer (implements org.springframework.web.context.ServletContextAware)
    • org.springframework.web.context.support.ServletContextAttributeExporter (implements org.springframework.web.context.ServletContextAware)
    • org.springframework.web.context.support.ServletContextAttributeFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.web.context.ServletContextAware)
    • org.springframework.web.context.support.ServletContextAwareProcessor (implements org.springframework.beans.factory.config.BeanPostProcessor)
    • org.springframework.web.context.support.ServletContextFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.web.context.ServletContextAware)
    • org.springframework.web.context.support.ServletContextParameterFactoryBean (implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.web.context.ServletContextAware)
    • org.springframework.web.context.support.ServletContextScope (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.config.Scope)
    • javax.servlet.ServletRequestWrapper (implements javax.servlet.ServletRequest)
      • javax.servlet.http.HttpServletRequestWrapper (implements javax.servlet.http.HttpServletRequest)
        • org.springframework.web.context.support.ContextExposingHttpServletRequest
    • org.springframework.web.context.support.SpringBeanAutowiringSupport
    • org.springframework.web.context.support.WebApplicationContextUtils


AbstractRefreshableWebApplicationContext

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.context.support
Class AbstractRefreshableWebApplicationContext

java.lang.Object
    extended by  org.springframework.core.io.DefaultResourceLoader
        extended by  org.springframework.context.support.AbstractApplicationContext
            extended by  org.springframework.context.support.AbstractRefreshableApplicationContext
                extended by  org.springframework.context.support.AbstractRefreshableConfigApplicationContext
                    extended by  org.springframework.web.context.support.AbstractRefreshableWebApplicationContext
All Implemented Interfaces:
BeanFactory, BeanNameAware, DisposableBean, HierarchicalBeanFactory, InitializingBean, ListableBeanFactory, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, ResourceLoader, ResourcePatternResolver, ThemeSource, ConfigurableWebApplicationContext, WebApplicationContext
Direct Known Subclasses:
AnnotationConfigWebApplicationContext, XmlWebApplicationContext
public abstract class AbstractRefreshableWebApplicationContext
extends AbstractRefreshableConfigApplicationContext
implements ConfigurableWebApplicationContext, ThemeSource

AbstractRefreshableApplicationContext subclass which implements the ConfigurableWebApplicationContext interface for web environments. Provides a "configLocations" property, to be populated through the ConfigurableWebApplicationContext interface on web application startup.

This class is as easy to subclass as AbstractRefreshableApplicationContext: All you need to implements is the AbstractRefreshableApplicationContext.loadBeanDefinitions(org.springframework.beans.factory.support.DefaultListableBeanFactory) method; see the superclass javadoc for details. Note that implementations are supposed to load bean definitions from the files specified by the locations returned by the getConfigLocations() method.

Interprets resource paths as servlet context resources, i.e. as paths beneath the web application root. Absolute paths, e.g. for files outside the web app root, can be accessed via "file:" URLs, as implemented by DefaultResourceLoader.

In addition to the special beans detected by AbstractApplicationContext, this class detects a bean of type ThemeSource in the context, under the special bean name "themeSource".

This is the web context to be subclassed for a different bean definition format. Such a context implementation can be specified as "contextClass" context-param for ContextLoader or as "contextClass" init-param for FrameworkServlet, replacing the default XmlWebApplicationContext. It will then automatically receive the "contextConfigLocation" context-param or init-param, respectively.

Note that WebApplicationContext implementations are generally supposed to configure themselves based on the configuration received through the ConfigurableWebApplicationContext interface. In contrast, a standalone application context might allow for configuration in custom startup code (for example, GenericApplicationContext).

Since:
1.1.3
Author:
Juergen Hoeller
See Also:
AbstractRefreshableApplicationContext.loadBeanDefinitions(org.springframework.beans.factory.support.DefaultListableBeanFactory), ConfigurableWebApplicationContext.setConfigLocations(java.lang.String[]), ThemeSource, XmlWebApplicationContext

Field Summary
Fields inherited from class org.springframework.context.support.AbstractApplicationContext
APPLICATION_EVENT_MULTICASTER_BEAN_NAME, LIFECYCLE_PROCESSOR_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAME
Fields inherited from interface org.springframework.web.context.ConfigurableWebApplicationContext
APPLICATION_CONTEXT_ID_PREFIX, SERVLET_CONFIG_BEAN_NAME
Fields inherited from interface org.springframework.web.context.WebApplicationContext
CONTEXT_ATTRIBUTES_BEAN_NAME, CONTEXT_PARAMETERS_BEAN_NAME, ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, SCOPE_APPLICATION, SCOPE_GLOBAL_SESSION, SCOPE_REQUEST, SCOPE_SESSION, SERVLET_CONTEXT_BEAN_NAME
Fields inherited from interface org.springframework.context.ConfigurableApplicationContext
CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAME
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Constructor Summary
AbstractRefreshableWebApplicationContext()
Method Summary
String[] | getConfigLocations() Return an array of resource locations, referring to the XML bean definition files that this context should be built with.
String | getNamespace() Return the namespace for this web application context, if any.
protected Resource | getResourceByPath(String path) This implementation supports file paths beneath the root of the ServletContext.
protected ResourcePatternResolver | getResourcePatternResolver() This implementation supports pattern matching in unexpanded WARs too.
ServletConfig | getServletConfig() Return the ServletConfig for this web application context, if any.
ServletContext | getServletContext() Return the standard Servlet API ServletContext for this application.
Theme | getTheme(String themeName) Return the Theme instance for the given theme name.
protected void | onRefresh() Initialize the theme capability.
protected void | postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) Register request/session scopes, a ServletContextAwareProcessor, etc.
void | setNamespace(String namespace) Set the namespace for this web application context, to be used for building a default context config location.
void | setServletConfig(ServletConfig servletConfig) Set the ServletConfig for this web application context.
void | setServletContext(ServletContext servletContext) Set the ServletContext for this web application context.
Methods inherited from class org.springframework.context.support.AbstractRefreshableConfigApplicationContext
afterPropertiesSet, getDefaultConfigLocations, resolvePath, setBeanName, setConfigLocation, setConfigLocations, setId
Methods inherited from class org.springframework.context.support.AbstractRefreshableApplicationContext
cancelRefresh, closeBeanFactory, createBeanFactory, customizeBeanFactory, getBeanFactory, hasBeanFactory, loadBeanDefinitions, refreshBeanFactory, setAllowBeanDefinitionOverriding, setAllowCircularReferences
Methods inherited from class org.springframework.context.support.AbstractApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, addListener, close, containsBean, containsBeanDefinition, containsLocalBean, destroy, destroyBeans, doClose, findAnnotationOnBean, finishBeanFactoryInitialization, finishRefresh, getAliases, getApplicationListeners, getAutowireCapableBeanFactory, getBean, getBean, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getDisplayName, getId, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getResources, getStartupDate, getType, initApplicationEventMulticaster, initLifecycleProcessor, initMessageSource, invokeBeanFactoryPostProcessors, isActive, isPrototype, isRunning, isSingleton, isTypeMatch, obtainFreshBeanFactory, onClose, prepareBeanFactory, prepareRefresh, publishEvent, refresh, registerBeanPostProcessors, registerListeners, registerShutdownHook, setDisplayName, setParent, start, stop, toString
Methods inherited from class org.springframework.core.io.DefaultResourceLoader
getClassLoader, getResource, setClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.web.context.ConfigurableWebApplicationContext
setConfigLocation, setConfigLocations
Methods inherited from interface org.springframework.context.ConfigurableApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, close, getBeanFactory, isActive, refresh, registerShutdownHook, setId, setParent
Methods inherited from interface org.springframework.context.ApplicationContext
getAutowireCapableBeanFactory, getDisplayName, getId, getParent, getStartupDate
Methods inherited from interface org.springframework.beans.factory.ListableBeanFactory
containsBeanDefinition, findAnnotationOnBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation
Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory
containsLocalBean, getParentBeanFactory
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getBean, getBean, getType, isPrototype, isSingleton, isTypeMatch
Methods inherited from interface org.springframework.context.MessageSource
getMessage, getMessage, getMessage
Methods inherited from interface org.springframework.context.ApplicationEventPublisher
publishEvent
Methods inherited from interface org.springframework.core.io.support.ResourcePatternResolver
getResources
Methods inherited from interface org.springframework.core.io.ResourceLoader
getClassLoader, getResource
Methods inherited from interface org.springframework.context.Lifecycle
isRunning, start, stop

Constructor Detail

AbstractRefreshableWebApplicationContext

public AbstractRefreshableWebApplicationContext()
Method Detail

setServletContext

public void setServletContext(ServletContext servletContext)
Description copied from interface: ConfigurableWebApplicationContext
Set the ServletContext for this web application context.

Does not cause an initialization of the context: refresh needs to be called after the setting of all configuration properties.

Specified by:
setServletContext in interface ConfigurableWebApplicationContext
See Also:
ConfigurableApplicationContext.refresh()

getServletContext

public ServletContext getServletContext()
Description copied from interface: WebApplicationContext
Return the standard Servlet API ServletContext for this application.

Also available for a Portlet application, in addition to the PortletContext.

Specified by:
getServletContext in interface WebApplicationContext

setServletConfig

public void setServletConfig(ServletConfig servletConfig)
Description copied from interface: ConfigurableWebApplicationContext
Set the ServletConfig for this web application context. Only called for a WebApplicationContext that belongs to a specific Servlet.

Specified by:
setServletConfig in interface ConfigurableWebApplicationContext
See Also:
ConfigurableApplicationContext.refresh()

getServletConfig

public ServletConfig getServletConfig()
Description copied from interface: ConfigurableWebApplicationContext
Return the ServletConfig for this web application context, if any.

Specified by:
getServletConfig in interface ConfigurableWebApplicationContext

setNamespace

public void setNamespace(String namespace)
Description copied from interface: ConfigurableWebApplicationContext
Set the namespace for this web application context, to be used for building a default context config location. The root web application context does not have a namespace.

Specified by:
setNamespace in interface ConfigurableWebApplicationContext

getNamespace

public String getNamespace()
Description copied from interface: ConfigurableWebApplicationContext
Return the namespace for this web application context, if any.

Specified by:
getNamespace in interface ConfigurableWebApplicationContext

getConfigLocations

public String[] getConfigLocations()
Description copied from class: AbstractRefreshableConfigApplicationContext
Return an array of resource locations, referring to the XML bean definition files that this context should be built with. Can also include location patterns, which will get resolved via a ResourcePatternResolver.

The default implementation returns null. Subclasses can override this to provide a set of resource locations to load bean definitions from.

Specified by:
getConfigLocations in interface ConfigurableWebApplicationContext
Overrides:
getConfigLocations in class AbstractRefreshableConfigApplicationContext
Returns:
an array of resource locations, or null if none
See Also:
AbstractApplicationContext.getResources(java.lang.String), AbstractApplicationContext.getResourcePatternResolver()

postProcessBeanFactory

protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
Register request/session scopes, a ServletContextAwareProcessor, etc.

Overrides:
postProcessBeanFactory in class AbstractApplicationContext
Parameters:
beanFactory - the bean factory used by the application context

getResourceByPath

protected Resource getResourceByPath(String path)
This implementation supports file paths beneath the root of the ServletContext.

Overrides:
getResourceByPath in class DefaultResourceLoader
Parameters:
path - the path to the resource
Returns:
the corresponding Resource handle
See Also:
ServletContextResource

getResourcePatternResolver

protected ResourcePatternResolver getResourcePatternResolver()
This implementation supports pattern matching in unexpanded WARs too.

Overrides:
getResourcePatternResolver in class AbstractApplicationContext
Returns:
the ResourcePatternResolver for this context
See Also:
ServletContextResourcePatternResolver

onRefresh

protected void onRefresh()
Initialize the theme capability.

Overrides:
onRefresh in class AbstractApplicationContext
See Also:
AbstractApplicationContext.refresh()

getTheme

public Theme getTheme(String themeName)
Description copied from interface: ThemeSource
Return the Theme instance for the given theme name.

The returned Theme will resolve theme-specific messages, codes, file paths, etc (e.g. CSS and image files in a web environment).

Specified by:
getTheme in interface ThemeSource
Parameters:
themeName - the name of the theme
Returns:
the corresponding Theme, or null if none defined. Note that, by convention, a ThemeSource should at least be able to return a default Theme for the default theme name "theme" but may also return default Themes for other theme names.
See Also:
AbstractThemeResolver.ORIGINAL_DEFAULT_THEME_NAME
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AnnotationConfigWebApplicationContext

org.springframework.web.context.support
Class AnnotationConfigWebApplicationContext

java.lang.Object
    extended by  org.springframework.core.io.DefaultResourceLoader
        extended by  org.springframework.context.support.AbstractApplicationContext
            extended by  org.springframework.context.support.AbstractRefreshableApplicationContext
                extended by  org.springframework.context.support.AbstractRefreshableConfigApplicationContext
                    extended by  org.springframework.web.context.support.AbstractRefreshableWebApplicationContext
                        extended by  org.springframework.web.context.support.AnnotationConfigWebApplicationContext
All Implemented Interfaces:
BeanFactory, BeanNameAware, DisposableBean, HierarchicalBeanFactory, InitializingBean, ListableBeanFactory, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, ResourceLoader, ResourcePatternResolver, ThemeSource, ConfigurableWebApplicationContext, WebApplicationContext
public class AnnotationConfigWebApplicationContext
extends AbstractRefreshableWebApplicationContext

WebApplicationContext implementation which accepts annotated classes as input - in particular @Configuration-annotated classes, but also plain @Components and JSR-330 compliant classes using javax.inject annotations. Allows for registering classes one by one (specifying class names as config location) as well as for classpath scanning (specifying base packages as config location).

This is essentially the equivalent of AnnotationConfigApplicationContext for a web environment.

To make use of this application context, the "contextClass" context-param for ContextLoader and/or "contextClass" init-param for FrameworkServlet must be set to the fully-qualified name of this class.

Unlike XmlWebApplicationContext, no default configuration class locations are assumed. Rather, it is a requirement to set the "contextConfigLocation" context-param for ContextLoader and/or "contextConfigLocation" init-param for FrameworkServlet. The param-value may contain both fully-qualified class names and base packages to scan for components.

Note: In case of multiple @Configuration classes, later @Bean definitions will override ones defined in earlier loaded files. This can be leveraged to deliberately override certain bean definitions via an extra Configuration class.

Since:
3.0
Author:
Chris Beams, Juergen Hoeller
See Also:
AnnotationConfigApplicationContext

Field Summary
Fields inherited from class org.springframework.context.support.AbstractApplicationContext
APPLICATION_EVENT_MULTICASTER_BEAN_NAME, LIFECYCLE_PROCESSOR_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAME
Fields inherited from interface org.springframework.web.context.ConfigurableWebApplicationContext
APPLICATION_CONTEXT_ID_PREFIX, SERVLET_CONFIG_BEAN_NAME
Fields inherited from interface org.springframework.web.context.WebApplicationContext
CONTEXT_ATTRIBUTES_BEAN_NAME, CONTEXT_PARAMETERS_BEAN_NAME, ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, SCOPE_APPLICATION, SCOPE_GLOBAL_SESSION, SCOPE_REQUEST, SCOPE_SESSION, SERVLET_CONTEXT_BEAN_NAME
Fields inherited from interface org.springframework.context.ConfigurableApplicationContext
CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAME
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Constructor Summary
AnnotationConfigWebApplicationContext()
Method Summary
protected BeanNameGenerator | getBeanNameGenerator() Provide a custom BeanNameGenerator for use with AnnotatedBeanDefinitionReader and/or ClassPathBeanDefinitionScanner, if any.
protected ScopeMetadataResolver | getScopeMetadataResolver() Provide a custom ScopeMetadataResolver for use with AnnotatedBeanDefinitionReader and/or ClassPathBeanDefinitionScanner, if any.
protected void | loadBeanDefinitions(DefaultListableBeanFactory beanFactory) Register a BeanDefinition for each class specified by AbstractRefreshableWebApplicationContext.getConfigLocations(), or scan each specified package for annotated classes.
Methods inherited from class org.springframework.web.context.support.AbstractRefreshableWebApplicationContext
getConfigLocations, getNamespace, getResourceByPath, getResourcePatternResolver, getServletConfig, getServletContext, getTheme, onRefresh, postProcessBeanFactory, setNamespace, setServletConfig, setServletContext
Methods inherited from class org.springframework.context.support.AbstractRefreshableConfigApplicationContext
afterPropertiesSet, getDefaultConfigLocations, resolvePath, setBeanName, setConfigLocation, setConfigLocations, setId
Methods inherited from class org.springframework.context.support.AbstractRefreshableApplicationContext
cancelRefresh, closeBeanFactory, createBeanFactory, customizeBeanFactory, getBeanFactory, hasBeanFactory, refreshBeanFactory, setAllowBeanDefinitionOverriding, setAllowCircularReferences
Methods inherited from class org.springframework.context.support.AbstractApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, addListener, close, containsBean, containsBeanDefinition, containsLocalBean, destroy, destroyBeans, doClose, findAnnotationOnBean, finishBeanFactoryInitialization, finishRefresh, getAliases, getApplicationListeners, getAutowireCapableBeanFactory, getBean, getBean, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getDisplayName, getId, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getResources, getStartupDate, getType, initApplicationEventMulticaster, initLifecycleProcessor, initMessageSource, invokeBeanFactoryPostProcessors, isActive, isPrototype, isRunning, isSingleton, isTypeMatch, obtainFreshBeanFactory, onClose, prepareBeanFactory, prepareRefresh, publishEvent, refresh, registerBeanPostProcessors, registerListeners, registerShutdownHook, setDisplayName, setParent, start, stop, toString
Methods inherited from class org.springframework.core.io.DefaultResourceLoader
getClassLoader, getResource, setClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.web.context.ConfigurableWebApplicationContext
setConfigLocation, setConfigLocations
Methods inherited from interface org.springframework.context.ConfigurableApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, close, getBeanFactory, isActive, refresh, registerShutdownHook, setId, setParent
Methods inherited from interface org.springframework.context.ApplicationContext
getAutowireCapableBeanFactory, getDisplayName, getId, getParent, getStartupDate
Methods inherited from interface org.springframework.beans.factory.ListableBeanFactory
containsBeanDefinition, findAnnotationOnBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation
Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory
containsLocalBean, getParentBeanFactory
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getBean, getBean, getType, isPrototype, isSingleton, isTypeMatch
Methods inherited from interface org.springframework.context.MessageSource
getMessage, getMessage, getMessage
Methods inherited from interface org.springframework.context.ApplicationEventPublisher
publishEvent
Methods inherited from interface org.springframework.core.io.support.ResourcePatternResolver
getResources
Methods inherited from interface org.springframework.core.io.ResourceLoader
getClassLoader, getResource
Methods inherited from interface org.springframework.context.Lifecycle
isRunning, start, stop

Constructor Detail

AnnotationConfigWebApplicationContext

public AnnotationConfigWebApplicationContext()
Method Detail

loadBeanDefinitions

protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory)
Register a BeanDefinition for each class specified by AbstractRefreshableWebApplicationContext.getConfigLocations(), or scan each specified package for annotated classes. Enables the default set of annotation configuration post processors, such that @Autowired, @Required, and associated annotations can be used.

Configuration class bean definitions are registered with generated bean definition names unless the value attribute is provided to the stereotype annotation.

Specified by:
loadBeanDefinitions in class AbstractRefreshableApplicationContext
Parameters:
beanFactory - the bean factory to load bean definitions into
See Also:
AbstractRefreshableWebApplicationContext.getConfigLocations(), AnnotatedBeanDefinitionReader, ClassPathBeanDefinitionScanner

getBeanNameGenerator

protected BeanNameGenerator getBeanNameGenerator()
Provide a custom BeanNameGenerator for use with AnnotatedBeanDefinitionReader and/or ClassPathBeanDefinitionScanner, if any.

Default is AnnotationBeanNameGenerator.

See Also:
AnnotatedBeanDefinitionReader.setBeanNameGenerator(org.springframework.beans.factory.support.BeanNameGenerator), ClassPathBeanDefinitionScanner.setBeanNameGenerator(org.springframework.beans.factory.support.BeanNameGenerator)

getScopeMetadataResolver

protected ScopeMetadataResolver getScopeMetadataResolver()
Provide a custom ScopeMetadataResolver for use with AnnotatedBeanDefinitionReader and/or ClassPathBeanDefinitionScanner, if any.

Default is AnnotationScopeMetadataResolver.

See Also:
AnnotatedBeanDefinitionReader.setScopeMetadataResolver(org.springframework.context.annotation.ScopeMetadataResolver), ClassPathBeanDefinitionScanner.setScopeMetadataResolver(org.springframework.context.annotation.ScopeMetadataResolver)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ContextExposingHttpServletRequest

org.springframework.web.context.support
Class ContextExposingHttpServletRequest

java.lang.Object
    extended by  javax.servlet.ServletRequestWrapper
        extended by  javax.servlet.http.HttpServletRequestWrapper
            extended by  org.springframework.web.context.support.ContextExposingHttpServletRequest
All Implemented Interfaces:
HttpServletRequest, ServletRequest
public class ContextExposingHttpServletRequest
extends HttpServletRequestWrapper

HttpServletRequest decorator that makes all Spring beans in a given WebApplicationContext accessible as request attributes, through lazy checking once an attribute gets accessed.

Since:
2.5
Author:
Juergen Hoeller

Field Summary
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
Constructor Summary
ContextExposingHttpServletRequest(HttpServletRequest originalRequest, WebApplicationContext context)
Create a new ContextExposingHttpServletRequest for the given request.
ContextExposingHttpServletRequest(HttpServletRequest originalRequest, WebApplicationContext context, Set<String> exposedContextBeanNames)
Create a new ContextExposingHttpServletRequest for the given request.
Method Summary
Object | getAttribute(String name)
WebApplicationContext | getWebApplicationContext() Return the WebApplicationContext that this request runs in.
void | setAttribute(String name, Object value)
Methods inherited from class javax.servlet.http.HttpServletRequestWrapper
getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole
Methods inherited from class javax.servlet.ServletRequestWrapper
getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setCharacterEncoding, setRequest
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.servlet.ServletRequest
getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setCharacterEncoding

Constructor Detail

ContextExposingHttpServletRequest

public ContextExposingHttpServletRequest(HttpServletRequest originalRequest,
                                         WebApplicationContext context)
Create a new ContextExposingHttpServletRequest for the given request.

Parameters:
originalRequest - the original HttpServletRequest
context - the WebApplicationContext that this request runs in

ContextExposingHttpServletRequest

public ContextExposingHttpServletRequest(HttpServletRequest originalRequest,
                                         WebApplicationContext context,
                                         Set<String> exposedContextBeanNames)
Create a new ContextExposingHttpServletRequest for the given request.

Parameters:
originalRequest - the original HttpServletRequest
context - the WebApplicationContext that this request runs in
exposedContextBeanNames - the names of beans in the context which are supposed to be exposed (if this is non-null, only the beans in this Set are eligible for exposure as attributes)
Method Detail

getWebApplicationContext

public final WebApplicationContext getWebApplicationContext()
Return the WebApplicationContext that this request runs in.

getAttribute

public Object getAttribute(String name)
Specified by:
getAttribute in interface ServletRequest
Overrides:
getAttribute in class ServletRequestWrapper

setAttribute

public void setAttribute(String name,
                         Object value)
Specified by:
setAttribute in interface ServletRequest
Overrides:
setAttribute in class ServletRequestWrapper
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


GenericWebApplicationContext

org.springframework.web.context.support
Class GenericWebApplicationContext

java.lang.Object
    extended by  org.springframework.core.io.DefaultResourceLoader
        extended by  org.springframework.context.support.AbstractApplicationContext
            extended by  org.springframework.context.support.GenericApplicationContext
                extended by  org.springframework.web.context.support.GenericWebApplicationContext
All Implemented Interfaces:
BeanFactory, DisposableBean, HierarchicalBeanFactory, ListableBeanFactory, BeanDefinitionRegistry, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, AliasRegistry, ResourceLoader, ResourcePatternResolver, ThemeSource, WebApplicationContext
public class GenericWebApplicationContext
extends GenericApplicationContext
implements WebApplicationContext, ThemeSource

Subclass of GenericApplicationContext, suitable for web environments.

Implements the WebApplicationContext interface, but not ConfigurableWebApplicationContext, as it is not intended for declarative setup in web.xml. Instead, it is designed for programmatic setup, for example for building nested contexts.

If you intend to implement a WebApplicationContext that reads bean definitions from configuration files, consider deriving from AbstractRefreshableWebApplicationContext, reading the bean definitions in an implementation of the loadBeanDefinitions method.

Interprets resource paths as servlet context resources, i.e. as paths beneath the web application root. Absolute paths, e.g. for files outside the web app root, can be accessed via "file:" URLs, as implemented by AbstractApplicationContext.

In addition to the special beans detected by AbstractApplicationContext, this class detects a ThemeSource bean in the context, with the name "themeSource".

Since:
1.2
Author:
Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.context.support.AbstractApplicationContext
APPLICATION_EVENT_MULTICASTER_BEAN_NAME, LIFECYCLE_PROCESSOR_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAME
Fields inherited from interface org.springframework.web.context.WebApplicationContext
CONTEXT_ATTRIBUTES_BEAN_NAME, CONTEXT_PARAMETERS_BEAN_NAME, ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, SCOPE_APPLICATION, SCOPE_GLOBAL_SESSION, SCOPE_REQUEST, SCOPE_SESSION, SERVLET_CONTEXT_BEAN_NAME
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Fields inherited from interface org.springframework.context.ConfigurableApplicationContext
CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAME
Constructor Summary
GenericWebApplicationContext()
Create a new GenericWebApplicationContext.
GenericWebApplicationContext(DefaultListableBeanFactory beanFactory)
Create a new GenericWebApplicationContext with the given DefaultListableBeanFactory.
GenericWebApplicationContext(DefaultListableBeanFactory beanFactory, ServletContext servletContext)
Create a new GenericWebApplicationContext with the given DefaultListableBeanFactory.
GenericWebApplicationContext(ServletContext servletContext)
Create a new GenericWebApplicationContext for the given ServletContext.
Method Summary
protected Resource | getResourceByPath(String path) This implementation supports file paths beneath the root of the ServletContext.
protected ResourcePatternResolver | getResourcePatternResolver() This implementation supports pattern matching in unexpanded WARs too.
ServletContext | getServletContext() Return the standard Servlet API ServletContext for this application.
Theme | getTheme(String themeName) Return the Theme instance for the given theme name.
protected void | onRefresh() Initialize the theme capability.
protected void | postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) Register ServletContextAwareProcessor.
void | setServletContext(ServletContext servletContext) Set the ServletContext that this WebApplicationContext runs in.
Methods inherited from class org.springframework.context.support.GenericApplicationContext
closeBeanFactory, getBeanDefinition, getBeanFactory, getDefaultListableBeanFactory, getResource, getResources, isAlias, isBeanNameInUse, refreshBeanFactory, registerAlias, registerBeanDefinition, removeAlias, removeBeanDefinition, setAllowBeanDefinitionOverriding, setAllowCircularReferences, setId, setParent, setResourceLoader
Methods inherited from class org.springframework.context.support.AbstractApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, addListener, cancelRefresh, close, containsBean, containsBeanDefinition, containsLocalBean, destroy, destroyBeans, doClose, findAnnotationOnBean, finishBeanFactoryInitialization, finishRefresh, getAliases, getApplicationListeners, getAutowireCapableBeanFactory, getBean, getBean, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getDisplayName, getId, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getStartupDate, getType, initApplicationEventMulticaster, initLifecycleProcessor, initMessageSource, invokeBeanFactoryPostProcessors, isActive, isPrototype, isRunning, isSingleton, isTypeMatch, obtainFreshBeanFactory, onClose, prepareBeanFactory, prepareRefresh, publishEvent, refresh, registerBeanPostProcessors, registerListeners, registerShutdownHook, setDisplayName, start, stop, toString
Methods inherited from class org.springframework.core.io.DefaultResourceLoader
getClassLoader, setClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.context.ApplicationContext
getAutowireCapableBeanFactory, getDisplayName, getId, getParent, getStartupDate
Methods inherited from interface org.springframework.beans.factory.ListableBeanFactory
containsBeanDefinition, findAnnotationOnBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation
Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory
containsLocalBean, getParentBeanFactory
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getBean, getBean, getType, isPrototype, isSingleton, isTypeMatch
Methods inherited from interface org.springframework.context.MessageSource
getMessage, getMessage, getMessage
Methods inherited from interface org.springframework.context.ApplicationEventPublisher
publishEvent
Methods inherited from interface org.springframework.core.io.support.ResourcePatternResolver
getResources
Methods inherited from interface org.springframework.core.io.ResourceLoader
getClassLoader, getResource
Methods inherited from interface org.springframework.beans.factory.support.BeanDefinitionRegistry
containsBeanDefinition, getBeanDefinitionCount, getBeanDefinitionNames
Methods inherited from interface org.springframework.core.AliasRegistry
getAliases

Constructor Detail

GenericWebApplicationContext

public GenericWebApplicationContext()
Create a new GenericWebApplicationContext.

See Also:
setServletContext(javax.servlet.ServletContext),
GenericApplicationContext.registerBeanDefinition(java.lang.String, org.springframework.beans.factory.config.BeanDefinition),
AbstractApplicationContext.refresh()

GenericWebApplicationContext

public GenericWebApplicationContext(ServletContext servletContext)
Create a new GenericWebApplicationContext for the given ServletContext.

Parameters:
servletContext - the ServletContext to run in
See Also:
GenericApplicationContext.registerBeanDefinition(java.lang.String, org.springframework.beans.factory.config.BeanDefinition), AbstractApplicationContext.refresh()

GenericWebApplicationContext

public GenericWebApplicationContext(DefaultListableBeanFactory beanFactory)
Create a new GenericWebApplicationContext with the given DefaultListableBeanFactory.

Parameters:
beanFactory - the DefaultListableBeanFactory instance to use for this context
See Also:
setServletContext(javax.servlet.ServletContext),
GenericApplicationContext.registerBeanDefinition(java.lang.String, org.springframework.beans.factory.config.BeanDefinition),
AbstractApplicationContext.refresh()

GenericWebApplicationContext

public GenericWebApplicationContext(DefaultListableBeanFactory beanFactory,
                                    ServletContext servletContext)
Create a new GenericWebApplicationContext with the given DefaultListableBeanFactory.

Parameters:
beanFactory - the DefaultListableBeanFactory instance to use for this context
servletContext - the ServletContext to run in
See Also:
GenericApplicationContext.registerBeanDefinition(java.lang.String, org.springframework.beans.factory.config.BeanDefinition), AbstractApplicationContext.refresh()
Method Detail

setServletContext

public void setServletContext(ServletContext servletContext)
Set the ServletContext that this WebApplicationContext runs in.

getServletContext

public ServletContext getServletContext()
Description copied from interface: WebApplicationContext
Return the standard Servlet API ServletContext for this application.

Also available for a Portlet application, in addition to the PortletContext.

Specified by:
getServletContext in interface WebApplicationContext

postProcessBeanFactory

protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
Register ServletContextAwareProcessor.

Overrides:
postProcessBeanFactory in class AbstractApplicationContext
Parameters:
beanFactory - the bean factory used by the application context
See Also:
ServletContextAwareProcessor

getResourceByPath

protected Resource getResourceByPath(String path)
This implementation supports file paths beneath the root of the ServletContext.

Overrides:
getResourceByPath in class DefaultResourceLoader
Parameters:
path - the path to the resource
Returns:
the corresponding Resource handle
See Also:
ServletContextResource

getResourcePatternResolver

protected ResourcePatternResolver getResourcePatternResolver()
This implementation supports pattern matching in unexpanded WARs too.

Overrides:
getResourcePatternResolver in class AbstractApplicationContext
Returns:
the ResourcePatternResolver for this context
See Also:
ServletContextResourcePatternResolver

onRefresh

protected void onRefresh()
Initialize the theme capability.

Overrides:
onRefresh in class AbstractApplicationContext
See Also:
AbstractApplicationContext.refresh()

getTheme

public Theme getTheme(String themeName)
Description copied from interface: ThemeSource
Return the Theme instance for the given theme name.

The returned Theme will resolve theme-specific messages, codes, file paths, etc (e.g. CSS and image files in a web environment).

Specified by:
getTheme in interface ThemeSource
Parameters:
themeName - the name of the theme
Returns:
the corresponding Theme, or null if none defined. Note that, by convention, a ThemeSource should at least be able to return a default Theme for the default theme name "theme" but may also return default Themes for other theme names.
See Also:
AbstractThemeResolver.ORIGINAL_DEFAULT_THEME_NAME
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HttpRequestHandlerServlet

org.springframework.web.context.support
Class HttpRequestHandlerServlet

java.lang.Object
    extended by  javax.servlet.GenericServlet
        extended by  javax.servlet.http.HttpServlet
            extended by  org.springframework.web.context.support.HttpRequestHandlerServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig
public class HttpRequestHandlerServlet
extends HttpServlet

Simple HttpServlet that delegates to an HttpRequestHandler bean defined in Spring's root web application context. The target bean name must match the HttpRequestHandlerServlet servlet-name as defined in web.xml.

This can for example be used to expose a single Spring remote exporter, such as HttpInvokerServiceExporter or HessianServiceExporter, per HttpRequestHandlerServlet definition. This is a minimal alternative to defining remote exporters as beans in a DispatcherServlet context (with advanced mapping and interception facilities being available there).

Since:
2.0
Author:
Juergen Hoeller
See Also:
HttpRequestHandler, DispatcherServlet, Serialized Form

Constructor Summary
HttpRequestHandlerServlet()
Method Summary
void | init()
protected void | service(HttpServletRequest request, HttpServletResponse response)
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

HttpRequestHandlerServlet

public HttpRequestHandlerServlet()
Method Detail

init

public void init()
          throws ServletException
Overrides:
init in class GenericServlet
Throws:
ServletException

service

protected void service(HttpServletRequest request,
                       HttpServletResponse response)
                throws ServletException,
                       IOException
Overrides:
service in class HttpServlet
Throws:
ServletException
IOException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RequestHandledEvent

org.springframework.web.context.support
Class RequestHandledEvent

java.lang.Object
    extended by  java.util.EventObject
        extended by  org.springframework.context.ApplicationEvent
            extended by  org.springframework.web.context.support.RequestHandledEvent
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
PortletRequestHandledEvent, ServletRequestHandledEvent
public class RequestHandledEvent
extends ApplicationEvent

Event raised when a request is handled within an ApplicationContext.

Supported by Spring's own FrameworkServlet (through a specific ServletRequestHandledEvent subclass), but can also be raised by any other web component. Used, for example, by Spring's out-of-the-box PerformanceMonitorListener.

Since:
January 17, 2001
Author:
Rod Johnson, Juergen Hoeller
See Also:
ServletRequestHandledEvent, FrameworkServlet, ApplicationEventPublisher.publishEvent(org.springframework.context.ApplicationEvent), Serialized Form

Field Summary
Fields inherited from class java.util.EventObject
source
Constructor Summary
RequestHandledEvent(Object source, String sessionId, String userName, long processingTimeMillis)
Create a new RequestHandledEvent with session information.
RequestHandledEvent(Object source, String sessionId, String userName, long processingTimeMillis, Throwable failureCause)
Create a new RequestHandledEvent with session information.
Method Summary
String | getDescription() Return a full description of this event, involving all available context data.
Throwable | getFailureCause() Return the cause of failure, if any.
long | getProcessingTimeMillis() Return the processing time of the request in milliseconds.
String | getSessionId() Return the id of the HTTP session, if any.
String | getShortDescription() Return a short description of this event, only involving the most important context data.
String | getUserName() Return the name of the user that was associated with the request (usually the UserPrincipal).
String | toString()
boolean | wasFailure() Return whether the request failed.
Methods inherited from class org.springframework.context.ApplicationEvent
getTimestamp
Methods inherited from class java.util.EventObject
getSource
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

RequestHandledEvent

public RequestHandledEvent(Object source,
                           String sessionId,
                           String userName,
                           long processingTimeMillis)
Create a new RequestHandledEvent with session information.

Parameters:
source - the component that published the event
sessionId - the id of the HTTP session, if any
userName - the name of the user that was associated with the request, if any (usually the UserPrincipal)
processingTimeMillis - the processing time of the request in milliseconds

RequestHandledEvent

public RequestHandledEvent(Object source,
                           String sessionId,
                           String userName,
                           long processingTimeMillis,
                           Throwable failureCause)
Create a new RequestHandledEvent with session information.

Parameters:
source - the component that published the event
sessionId - the id of the HTTP session, if any
userName - the name of the user that was associated with the request, if any (usually the UserPrincipal)
processingTimeMillis - the processing time of the request in milliseconds
failureCause - the cause of failure, if any
Method Detail

getProcessingTimeMillis

public long getProcessingTimeMillis()
Return the processing time of the request in milliseconds.

getSessionId

public String getSessionId()
Return the id of the HTTP session, if any.

getUserName

public String getUserName()
Return the name of the user that was associated with the request (usually the UserPrincipal).

See Also:
HttpServletRequest.getUserPrincipal()

wasFailure

public boolean wasFailure()
Return whether the request failed.

getFailureCause

public Throwable getFailureCause()
Return the cause of failure, if any.

getShortDescription

public String getShortDescription()
Return a short description of this event, only involving the most important context data.

getDescription

public String getDescription()
Return a full description of this event, involving all available context data.

toString

public String toString()
Overrides:
toString in class EventObject
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletContextAttributeExporter

org.springframework.web.context.support
Class ServletContextAttributeExporter

java.lang.Object
    extended by  org.springframework.web.context.support.ServletContextAttributeExporter
All Implemented Interfaces:
ServletContextAware
public class ServletContextAttributeExporter
extends Object
implements ServletContextAware

Exporter that takes Spring-defined objects and exposes them as ServletContext attributes. Usually, bean references will be used to export Spring-defined beans as ServletContext attributes.

Useful to make Spring-defined beans available to code that is not aware of Spring at all, but rather just of the Servlet API. Client code can then use plain ServletContext attribute lookups to access those objects, despite them being defined in a Spring application context.

Alternatively, consider using the WebApplicationContextUtils class to access Spring-defined beans via the WebApplicationContext interface. This makes client code aware of Spring API, of course.

Since:
1.1.4
Author:
Juergen Hoeller
See Also:
ServletContext.getAttribute(java.lang.String), WebApplicationContextUtils.getWebApplicationContext(javax.servlet.ServletContext)

Field Summary
protected  Log logger
Constructor Summary
ServletContextAttributeExporter()
Method Summary
void | setAttributes(Map<String,Object> attributes) Set the ServletContext attributes to expose as key-value pairs.
void | setServletContext(ServletContext servletContext) Set the ServletContext that this object runs in.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Constructor Detail

ServletContextAttributeExporter

public ServletContextAttributeExporter()
Method Detail

setAttributes

public void setAttributes(Map<String,Object> attributes)
Set the ServletContext attributes to expose as key-value pairs. Each key will be considered a ServletContext attributes key, and each value will be used as corresponding attribute value.

Usually, you will use bean references for the values, to export Spring-defined beans as ServletContext attributes. Of course, it is also possible to define plain values to export.

setServletContext

public void setServletContext(ServletContext servletContext)
Description copied from interface: ServletContextAware
Set the ServletContext that this object runs in.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked after ApplicationContextAware's setApplicationContext.

Specified by:
setServletContext in interface ServletContextAware
Parameters:
servletContext - ServletContext object to be used by this object
See Also:
InitializingBean.afterPropertiesSet(), ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletContextAttributeFactoryBean

org.springframework.web.context.support
Class ServletContextAttributeFactoryBean

java.lang.Object
    extended by  org.springframework.web.context.support.ServletContextAttributeFactoryBean
All Implemented Interfaces:
FactoryBean<Object>, ServletContextAware
public class ServletContextAttributeFactoryBean
extends Object
implements FactoryBean<Object>, ServletContextAware

FactoryBean that fetches a specific, existing ServletContext attribute. Exposes that ServletContext attribute when used as bean reference, effectively making it available as named Spring bean instance.

Intended to link in ServletContext attributes that exist before the startup of the Spring application context. Typically, such attributes will have been put there by third-party web frameworks. In a purely Spring-based web application, no such linking in of ServletContext attributes will be necessary.

NOTE: As of Spring 3.0, you may also use the "contextAttributes" default bean which is of type Map, and dereference it using an "#{contextAttributes.myKey}" expression to access a specific attribute by name.

Since:
1.1.4
Author:
Juergen Hoeller
See Also:
WebApplicationContext.CONTEXT_ATTRIBUTES_BEAN_NAME, ServletContextParameterFactoryBean

Constructor Summary
ServletContextAttributeFactoryBean()
Method Summary
 Object getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<?> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setAttributeName(String attributeName)
Set the name of the ServletContext attribute to expose.
 void setServletContext(ServletContext servletContext)
Set the ServletContext that this object runs in.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ServletContextAttributeFactoryBean

public ServletContextAttributeFactoryBean()
Method Detail

setAttributeName

public void setAttributeName(String attributeName)
Set the name of the ServletContext attribute to expose.

setServletContext

public void setServletContext(ServletContext servletContext)
Description copied from interface: ServletContextAware
Set the ServletContext that this object runs in.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked after ApplicationContextAware's setApplicationContext.

Specified by:
setServletContext in interface ServletContextAware
Parameters:
servletContext - ServletContext object to be used by this object
See Also:
InitializingBean.afterPropertiesSet(), ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)

getObject

public Object getObject()
                 throws Exception
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<Object>
Returns:
an instance of the bean (can be null)
Throws:
Exception - in case of creation errors
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<?> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<Object>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<Object>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletContextAwareProcessor

org.springframework.web.context.support
Class ServletContextAwareProcessor

java.lang.Object
    extended by  org.springframework.web.context.support.ServletContextAwareProcessor
All Implemented Interfaces:
BeanPostProcessor
public class ServletContextAwareProcessor
extends Object
implements BeanPostProcessor

BeanPostProcessor implementation that passes the ServletContext to beans that implement the ServletContextAware interface.

Web application contexts will automatically register this with their underlying bean factory. Applications do not use this directly.

Since:
12.03.2004
Author:
Juergen Hoeller
See Also:
ServletContextAware, AbstractRefreshableWebApplicationContext.postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory)

Constructor Summary
ServletContextAwareProcessor(ServletConfig servletConfig)
Create a new ServletContextAwareProcessor for the given config.
ServletContextAwareProcessor(ServletContext servletContext)
Create a new ServletContextAwareProcessor for the given context.
ServletContextAwareProcessor(ServletContext servletContext, ServletConfig servletConfig)
Create a new ServletContextAwareProcessor for the given context and config.
Method Summary
Object | postProcessAfterInitialization(Object bean, String beanName) Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).
Object | postProcessBeforeInitialization(Object bean, String beanName) Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ServletContextAwareProcessor

public ServletContextAwareProcessor(ServletContext servletContext)
Create a new ServletContextAwareProcessor for the given context.

ServletContextAwareProcessor

public ServletContextAwareProcessor(ServletConfig servletConfig)
Create a new ServletContextAwareProcessor for the given config.

ServletContextAwareProcessor

public ServletContextAwareProcessor(ServletContext servletContext,
                                    ServletConfig servletConfig)
Create a new ServletContextAwareProcessor for the given context and config.

Method Detail

postProcessBeforeInitialization

public Object postProcessBeforeInitialization(Object bean,
                                              String beanName)
                                       throws BeansException
Description copied from interface: BeanPostProcessor
Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

Specified by:
postProcessBeforeInitialization in interface BeanPostProcessor
Parameters:
bean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
Throws:
BeansException - in case of errors
See Also:
InitializingBean.afterPropertiesSet()

postProcessAfterInitialization

public Object postProcessAfterInitialization(Object bean,
                                             String beanName)
Description copied from interface: BeanPostProcessor
Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

In case of a FactoryBean, this callback will be invoked for both the FactoryBean instance and the objects created by the FactoryBean (as of Spring 2.0). The post-processor can decide whether to apply to either the FactoryBean or created objects or both through corresponding bean instanceof FactoryBean checks.

This callback will also be invoked after a short-circuiting triggered by a InstantiationAwareBeanPostProcessor.postProcessBeforeInstantiation(java.lang.Class, java.lang.String) method, in contrast to all other BeanPostProcessor callbacks.

Specified by:
postProcessAfterInitialization in interface BeanPostProcessor
Parameters:
bean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
See Also:
InitializingBean.afterPropertiesSet(), FactoryBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletContextFactoryBean

org.springframework.web.context.support
Class ServletContextFactoryBean

java.lang.Object
    extended by  org.springframework.web.context.support.ServletContextFactoryBean
All Implemented Interfaces:
FactoryBean<ServletContext>, ServletContextAware
Deprecated. as of Spring 3.0, since "servletContext" is now available as a default bean in every WebApplicationContext

@Deprecated
public class ServletContextFactoryBean
extends Object
implements FactoryBean<ServletContext>, ServletContextAware

FactoryBean that exposes the ServletContext for bean references. Can be used as alternative to implementing the ServletContextAware callback interface. Allows for passing the ServletContext reference to a constructor argument or any custom bean property.

Note that there's a special FactoryBean for exposing a specific ServletContext attribute, named ServletContextAttributeFactoryBean. So if all you need from the ServletContext is access to a specific attribute, ServletContextAttributeFactoryBean allows you to expose a constructor argument or bean property of the attribute type, which is a preferable to a dependency on the full ServletContext.

Since:
1.1.4
Author:
Juergen Hoeller
See Also:
ServletContext, ServletContextAware, ServletContextAttributeFactoryBean, WebApplicationContext.SERVLET_CONTEXT_BEAN_NAME

Constructor Summary
ServletContextFactoryBean()
Deprecated.
Method Summary
 ServletContext getObject()
Deprecated. Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<? extends ServletContext> getObjectType()
Deprecated. Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Deprecated. Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setServletContext(ServletContext servletContext)
Deprecated. Set the ServletContext that this object runs in.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ServletContextFactoryBean

public ServletContextFactoryBean()
Deprecated.
Method Detail

setServletContext

public void setServletContext(ServletContext servletContext)
Deprecated.
Description copied from interface: ServletContextAware
Set the ServletContext that this object runs in.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked after ApplicationContextAware's setApplicationContext.

Specified by:
setServletContext in interface ServletContextAware
Parameters:
servletContext - ServletContext object to be used by this object
See Also:
InitializingBean.afterPropertiesSet(), ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)

getObject

public ServletContext getObject()
Deprecated.
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<ServletContext>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<? extends ServletContext> getObjectType()
Deprecated.
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<ServletContext>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Deprecated.
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<ServletContext>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletContextParameterFactoryBean

org.springframework.web.context.support
Class ServletContextParameterFactoryBean

java.lang.Object
    extended by  org.springframework.web.context.support.ServletContextParameterFactoryBean
All Implemented Interfaces:
FactoryBean<String>, ServletContextAware
public class ServletContextParameterFactoryBean
extends Object
implements FactoryBean<String>, ServletContextAware

FactoryBean that retrieves a specific ServletContext init parameter (that is, a "context-param" defined in web.xml). Exposes that ServletContext init parameter when used as bean reference, effectively making it available as named Spring bean instance.

NOTE: As of Spring 3.0, you may also use the "contextParameters" default bean which is of type Map, and dereference it using an "#{contextParameters.myKey}" expression to access a specific parameter by name.

Since:
1.2.4
Author:
Juergen Hoeller
See Also:
WebApplicationContext.CONTEXT_PARAMETERS_BEAN_NAME, ServletContextAttributeFactoryBean

Constructor Summary
ServletContextParameterFactoryBean()
Method Summary
 String getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.
 Class<String> getObjectType()
Return the type of object that this FactoryBean creates, or null if not known in advance.
 boolean isSingleton()
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
 void setInitParamName(String initParamName)
Set the name of the ServletContext init parameter to expose.
 void setServletContext(ServletContext servletContext)
Set the ServletContext that this object runs in.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ServletContextParameterFactoryBean

public ServletContextParameterFactoryBean()
Method Detail

setInitParamName

public void setInitParamName(String initParamName)
Set the name of the ServletContext init parameter to expose.

setServletContext

public void setServletContext(ServletContext servletContext)
Description copied from interface: ServletContextAware
Set the ServletContext that this object runs in.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked after ApplicationContextAware's setApplicationContext.

Specified by:
setServletContext in interface ServletContextAware
Parameters:
servletContext - ServletContext object to be used by this object
See Also:
InitializingBean.afterPropertiesSet(), ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)

getObject

public String getObject()
Description copied from interface: FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.

As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.

If this FactoryBean is not fully initialized yet at the time of the call (for example because it is involved in a circular reference), throw a corresponding FactoryBeanNotInitializedException.

As of Spring 2.0, FactoryBeans are allowed to return null objects. The factory will consider this as normal value to be used; it will not throw a FactoryBeanNotInitializedException in this case anymore. FactoryBean implementations are encouraged to throw FactoryBeanNotInitializedException themselves now, as appropriate.

Specified by:
getObject in interface FactoryBean<String>
Returns:
an instance of the bean (can be null)
See Also:
FactoryBeanNotInitializedException

getObjectType

public Class<String> getObjectType()
Description copied from interface: FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.

This allows one to check for specific types of beans without instantiating objects, for example on autowiring.

In the case of implementations that are creating a singleton object, this method should try to avoid singleton creation as far as possible; it should rather estimate the type in advance. For prototypes, returning a meaningful type here is advisable too.

This method can be called before this FactoryBean has been fully initialized. It must not rely on state created during initialization; of course, it can still use such state if available.

NOTE: Autowiring will simply ignore FactoryBeans that return null here. Therefore it is highly recommended to implement this method properly, using the current state of the FactoryBean.

Specified by:
getObjectType in interface FactoryBean<String>
Returns:
the type of object that this FactoryBean creates, or null if not known at the time of the call
See Also:
ListableBeanFactory.getBeansOfType(java.lang.Class)

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?

NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.

The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

NOTE: This method returning false does not necessarily indicate that returned objects are independent instances. An implementation of the extended SmartFactoryBean interface may explicitly indicate independent instances through its SmartFactoryBean.isPrototype() method. Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if the isSingleton() implementation returns false.

Specified by:
isSingleton in interface FactoryBean<String>
Returns:
whether the exposed object is a singleton
See Also:
FactoryBean.getObject(), SmartFactoryBean.isPrototype()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletContextPropertyPlaceholderConfigurer

org.springframework.web.context.support
Class ServletContextPropertyPlaceholderConfigurer

java.lang.Object
    extended by  org.springframework.core.io.support.PropertiesLoaderSupport
        extended by  org.springframework.beans.factory.config.PropertyResourceConfigurer
            extended by  org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
                extended by  org.springframework.web.context.support.ServletContextPropertyPlaceholderConfigurer
All Implemented Interfaces:
BeanFactoryAware, BeanNameAware, BeanFactoryPostProcessor, Ordered, PriorityOrdered, ServletContextAware
public class ServletContextPropertyPlaceholderConfigurer
extends PropertyPlaceholderConfigurer
implements ServletContextAware

Subclass of PropertyPlaceholderConfigurer that resolves placeholders as ServletContext init parameters (that is, web.xml context-param entries).

Can be combined with "locations" and/or "properties" values in addition to web.xml context-params. Alternatively, can be defined without local properties, to resolve all placeholders as web.xml context-params (or JVM system properties).

If a placeholder could not be resolved against the provided local properties within the application, this configurer will fall back to ServletContext parameters. Can also be configured to let ServletContext init parameters override local properties (contextOverride=true).

Optionally supports searching for ServletContext attributes: If turned on, an otherwise unresolvable placeholder will matched against the corresponding ServletContext attribute, using its stringified value if found. This can be used to feed dynamic values into Spring's placeholder resolution.

If not running within a WebApplicationContext (or any other context that is able to satisfy the ServletContextAware callback), this class will behave like the default PropertyPlaceholderConfigurer. This allows for keeping ServletContextPropertyPlaceholderConfigurer definitions in test suites.

Since:
1.1.4
Author:
Juergen Hoeller
See Also:
PropertiesLoaderSupport.setLocations(org.springframework.core.io.Resource[]),
PropertiesLoaderSupport.setProperties(java.util.Properties),
PropertyPlaceholderConfigurer.setSystemPropertiesModeName(java.lang.String),
setContextOverride(boolean),
setSearchContextAttributes(boolean),
ServletContext.getInitParameter(String),
ServletContext.getAttribute(String)

Field Summary
Fields inherited from class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
DEFAULT_PLACEHOLDER_PREFIX, DEFAULT_PLACEHOLDER_SUFFIX, DEFAULT_VALUE_SEPARATOR, SYSTEM_PROPERTIES_MODE_FALLBACK, SYSTEM_PROPERTIES_MODE_NEVER, SYSTEM_PROPERTIES_MODE_OVERRIDE
Fields inherited from class org.springframework.core.io.support.PropertiesLoaderSupport
logger, XML_FILE_EXTENSION
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
ServletContextPropertyPlaceholderConfigurer()
Method Summary
protected String | resolvePlaceholder(String placeholder, Properties props) Resolve the given placeholder using the given properties.
protected String | resolvePlaceholder(String placeholder, ServletContext servletContext, boolean searchContextAttributes) Resolves the given placeholder using the init parameters and optionally also the attributes of the given ServletContext.
void | setContextOverride(boolean contextOverride) Set whether ServletContext init parameters (and optionally also ServletContext attributes) should override local properties within the application.
void | setSearchContextAttributes(boolean searchContextAttributes) Set whether to search for matching a ServletContext attribute before checking a ServletContext init parameter.
void | setServletContext(ServletContext servletContext) Set the ServletContext to resolve placeholders against.
Methods inherited from class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
parseStringValue, processProperties, resolvePlaceholder, resolveSystemProperty, setBeanFactory, setBeanName, setIgnoreUnresolvablePlaceholders, setNullValue, setPlaceholderPrefix, setPlaceholderSuffix, setSearchSystemEnvironment, setSystemPropertiesMode, setSystemPropertiesModeName
Methods inherited from class org.springframework.beans.factory.config.PropertyResourceConfigurer
convertProperties, convertPropertyValue, getOrder, postProcessBeanFactory, setOrder
Methods inherited from class org.springframework.core.io.support.PropertiesLoaderSupport
loadProperties, mergeProperties, setFileEncoding, setIgnoreResourceNotFound, setLocalOverride, setLocation, setLocations, setProperties, setPropertiesArray, setPropertiesPersister
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ServletContextPropertyPlaceholderConfigurer

public ServletContextPropertyPlaceholderConfigurer()
Method Detail

setContextOverride

public void setContextOverride(boolean contextOverride)
Set whether ServletContext init parameters (and optionally also ServletContext attributes) should override local properties within the application. Default is "false": ServletContext settings serve as fallback.

Note that system properties will still override ServletContext settings, if the system properties mode is set to "SYSTEM_PROPERTIES_MODE_OVERRIDE".

See Also:
setSearchContextAttributes(boolean), PropertyPlaceholderConfigurer.setSystemPropertiesModeName(java.lang.String), PropertyPlaceholderConfigurer.SYSTEM_PROPERTIES_MODE_OVERRIDE

setSearchContextAttributes

public void setSearchContextAttributes(boolean searchContextAttributes)
Set whether to search for matching a ServletContext attribute before checking a ServletContext init parameter. Default is "false": only checking init parameters.

If turned on, the configurer will look for a ServletContext attribute with the same name as the placeholder, and use its stringified value if found. Exposure of such ServletContext attributes can be used to dynamically override init parameters defined in web.xml, for example in a custom context listener.

See Also:
ServletContext.getInitParameter(String), ServletContext.getAttribute(String)

setServletContext

public void setServletContext(ServletContext servletContext)
Set the ServletContext to resolve placeholders against. Will be auto-populated when running in a WebApplicationContext.

If not set, this configurer will simply not resolve placeholders against the ServletContext: It will effectively behave like a plain PropertyPlaceholderConfigurer in such a scenario.

Specified by:
setServletContext in interface ServletContextAware
Parameters:
servletContext - ServletContext object to be used by this object
See Also:
InitializingBean.afterPropertiesSet(), ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)

resolvePlaceholder

protected String resolvePlaceholder(String placeholder,
                                    Properties props)
Description copied from class: PropertyPlaceholderConfigurer
Resolve the given placeholder using the given properties. The default implementation simply checks for a corresponding property key.

Subclasses can override this for customized placeholder-to-key mappings or custom resolution strategies, possibly just using the given properties as fallback.

Note that system properties will still be checked before respectively after this method is invoked, according to the system properties mode.

Overrides:
resolvePlaceholder in class PropertyPlaceholderConfigurer
Parameters:
placeholder - the placeholder to resolve
props - the merged properties of this configurer
Returns:
the resolved value, of null if none
See Also:
PropertyPlaceholderConfigurer.setSystemPropertiesMode(int)

resolvePlaceholder

protected String resolvePlaceholder(String placeholder,
                                    ServletContext servletContext,
                                    boolean searchContextAttributes)
Resolves the given placeholder using the init parameters and optionally also the attributes of the given ServletContext.

Default implementation checks ServletContext attributes before init parameters. Can be overridden to customize this behavior, potentially also applying specific naming patterns for parameters and/or attributes (instead of using the exact placeholder name).

Parameters:
placeholder - the placeholder to resolve
servletContext - the ServletContext to check
searchContextAttributes - whether to search for a matching ServletContext attribute
Returns:
the resolved value, of null if none
See Also:
ServletContext.getInitParameter(String), ServletContext.getAttribute(String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletContextResource

org.springframework.web.context.support
Class ServletContextResource

java.lang.Object
    extended by  org.springframework.core.io.AbstractResource
        extended by  org.springframework.web.context.support.ServletContextResource
All Implemented Interfaces:
ContextResource, InputStreamSource, Resource
public class ServletContextResource
extends AbstractResource
implements ContextResource

Resource implementation for ServletContext resources, interpreting relative paths within the web application root directory.

Always supports stream access and URL access, but only allows java.io.File access when the web application archive is expanded.

Since:
28.12.2003
Author:
Juergen Hoeller
See Also:
ServletContext.getResourceAsStream(java.lang.String),
ServletContext.getResource(java.lang.String),
ServletContext.getRealPath(java.lang.String)

Constructor Summary
ServletContextResource(ServletContext servletContext, String path)
Create a new ServletContextResource.
Method Summary
Resource | createRelative(String relativePath) This implementation creates a ServletContextResource, applying the given path relative to the path of the underlying file of this resource descriptor.
boolean | equals(Object obj) This implementation compares the underlying ServletContext resource locations.
boolean | exists() This implementation checks ServletContext.getResource.
String | getDescription() This implementation returns a description that includes the ServletContext resource location.
File | getFile() This implementation delegates to ServletContext.getRealPath, but throws a FileNotFoundException if not found or not resolvable.
String | getFilename() This implementation returns the name of the file that this ServletContext resource refers to.
InputStream | getInputStream() This implementation delegates to ServletContext.getResourceAsStream, but throws a FileNotFoundException if no resource found.
String | getPath() Return the path for this resource.
String | getPathWithinContext() Return the path within the enclosing 'context'.
ServletContext | getServletContext() Return the ServletContext for this resource.
URL | getURL() This implementation delegates to ServletContext.getResource, but throws a FileNotFoundException if no resource found.
int | hashCode() This implementation returns the hash code of the underlying ServletContext resource location.
Methods inherited from class org.springframework.core.io.AbstractResource
getFileForLastModifiedCheck, getURI, isOpen, isReadable, lastModified, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.core.io.Resource
getURI, isOpen, isReadable, lastModified

Constructor Detail

ServletContextResource

public ServletContextResource(ServletContext servletContext,
                              String path)
Create a new ServletContextResource.

The Servlet spec requires that resource paths start with a slash, even if many containers accept paths without leading slash too. Consequently, the given path will be prepended with a slash if it doesn't already start with one.

Parameters:
servletContext - the ServletContext to load from
path - the path of the resource
Method Detail

getServletContext

public final ServletContext getServletContext()
Return the ServletContext for this resource.

getPath

public final String getPath()
Return the path for this resource.

exists

public boolean exists()
This implementation checks ServletContext.getResource.

Specified by:
exists in interface Resource
Overrides:
exists in class AbstractResource
See Also:
ServletContext.getResource(String)

getInputStream

public InputStream getInputStream()
                           throws IOException
This implementation delegates to ServletContext.getResourceAsStream, but throws a FileNotFoundException if no resource found.

Specified by:
getInputStream in interface InputStreamSource
Throws:
IOException - if the stream could not be opened
See Also:
ServletContext.getResourceAsStream(String)

getURL

public URL getURL()
           throws IOException
This implementation delegates to ServletContext.getResource, but throws a FileNotFoundException if no resource found.

Specified by:
getURL in interface Resource
Overrides:
getURL in class AbstractResource
Throws:
IOException - if the resource cannot be resolved as URL, i.e. if the resource is not available as descriptor
See Also:
ServletContext.getResource(String)

getFile

public File getFile()
             throws IOException
This implementation delegates to ServletContext.getRealPath, but throws a FileNotFoundException if not found or not resolvable.

Specified by:
getFile in interface Resource
Overrides:
getFile in class AbstractResource
Throws:
IOException - if the resource cannot be resolved as absolute file path, i.e. if the resource is not available in a file system
See Also:
ServletContext.getRealPath(String)

createRelative

public Resource createRelative(String relativePath)
This implementation creates a ServletContextResource, applying the given path relative to the path of the underlying file of this resource descriptor.

Specified by:
createRelative in interface Resource
Overrides:
createRelative in class AbstractResource
Parameters:
relativePath - the relative path (relative to this resource)
Returns:
the resource handle for the relative resource
See Also:
StringUtils.applyRelativePath(String, String)

getFilename

public String getFilename()
This implementation returns the name of the file that this ServletContext resource refers to.

Specified by:
getFilename in interface Resource
Overrides:
getFilename in class AbstractResource
See Also:
StringUtils.getFilename(String)

getDescription

public String getDescription()
This implementation returns a description that includes the ServletContext resource location.

Specified by:
getDescription in interface Resource
See Also:
Object.toString()

getPathWithinContext

public String getPathWithinContext()
Description copied from interface: ContextResource
Return the path within the enclosing 'context'.

This is typically path relative to a context-specific root directory, e.g. a ServletContext root or a PortletContext root.

Specified by:
getPathWithinContext in interface ContextResource

equals

public boolean equals(Object obj)
This implementation compares the underlying ServletContext resource locations.

Overrides:
equals in class AbstractResource
See Also:
Resource.getDescription()

hashCode

public int hashCode()
This implementation returns the hash code of the underlying ServletContext resource location.

Overrides:
hashCode in class AbstractResource
See Also:
Resource.getDescription()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletContextResourceLoader

org.springframework.web.context.support
Class ServletContextResourceLoader

java.lang.Object
    extended by  org.springframework.core.io.DefaultResourceLoader
        extended by  org.springframework.web.context.support.ServletContextResourceLoader
All Implemented Interfaces:
ResourceLoader
public class ServletContextResourceLoader
extends DefaultResourceLoader

ResourceLoader implementation that resolves paths as ServletContext resources, for use outside a WebApplicationContext (for example, in an HttpServletBean or GenericFilterBean subclass).

Within a WebApplicationContext, resource paths are automatically resolved as ServletContext resources by the context implementation.

Since:
1.0.2
Author:
Juergen Hoeller
See Also:
getResourceByPath(java.lang.String), ServletContextResource, WebApplicationContext, HttpServletBean, GenericFilterBean

Field Summary
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Constructor Summary
ServletContextResourceLoader(ServletContext servletContext)
Create a new ServletContextResourceLoader.
Method Summary
protected  Resource getResourceByPath(String path)
This implementation supports file paths beneath the root of the web application.
Methods inherited from class org.springframework.core.io.DefaultResourceLoader
getClassLoader, getResource, setClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ServletContextResourceLoader

public ServletContextResourceLoader(ServletContext servletContext)
Create a new ServletContextResourceLoader.

Parameters:
servletContext - the ServletContext to load resources with
Method Detail

getResourceByPath

protected Resource getResourceByPath(String path)
This implementation supports file paths beneath the root of the web application.

Overrides:
getResourceByPath in class DefaultResourceLoader
Parameters:
path - the path to the resource
Returns:
the corresponding Resource handle
See Also:
ServletContextResource
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletContextResourcePatternResolver

org.springframework.web.context.support
Class ServletContextResourcePatternResolver

java.lang.Object
    extended by  org.springframework.core.io.support.PathMatchingResourcePatternResolver
        extended by  org.springframework.web.context.support.ServletContextResourcePatternResolver
All Implemented Interfaces:
ResourceLoader, ResourcePatternResolver
public class ServletContextResourcePatternResolver
extends PathMatchingResourcePatternResolver

ServletContext-aware subclass of PathMatchingResourcePatternResolver, able to find matching resources below the web application root directory via Servlet 2.3's ServletContext.getResourcePaths. Falls back to the superclass' file system checking for other resources.

Since:
1.1.2
Author:
Juergen Hoeller

Field Summary
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Constructor Summary
ServletContextResourcePatternResolver(ResourceLoader resourceLoader)
Create a new ServletContextResourcePatternResolver.
ServletContextResourcePatternResolver(ServletContext servletContext)
Create a new ServletContextResourcePatternResolver.
Method Summary
protected Set<Resource> | doFindPathMatchingFileResources(Resource rootDirResource, String subPattern) Overridden version which checks for ServletContextResource and uses ServletContext.getResourcePaths to find matching resources below the web application root directory.
protected void | doRetrieveMatchingServletContextResources(ServletContext servletContext, String fullPattern, String dir, Set<Resource> result) Recursively retrieve ServletContextResources that match the given pattern, adding them to the given result set.
Methods inherited from class org.springframework.core.io.support.PathMatchingResourcePatternResolver
convertClassLoaderURL, determineRootDir, doFindMatchingFileSystemResources, doFindPathMatchingJarResources, doRetrieveMatchingFiles, findAllClassPathResources, findPathMatchingResources, getClassLoader, getJarFile, getPathMatcher, getResource, getResourceLoader, getResources, isJarResource, resolveRootDirResource, retrieveMatchingFiles, setPathMatcher
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ServletContextResourcePatternResolver

public ServletContextResourcePatternResolver(ServletContext servletContext)
Create a new ServletContextResourcePatternResolver.

Parameters:
servletContext - the ServletContext to load resources with
See Also:
ServletContextResourceLoader.ServletContextResourceLoader(javax.servlet.ServletContext)

ServletContextResourcePatternResolver

public ServletContextResourcePatternResolver(ResourceLoader resourceLoader)
Create a new ServletContextResourcePatternResolver.

Parameters:
resourceLoader - the ResourceLoader to load root directories and actual resources with
Method Detail

doFindPathMatchingFileResources

protected Set<Resource> doFindPathMatchingFileResources(Resource rootDirResource,
                                                        String subPattern)
                                                 throws IOException
Overridden version which checks for ServletContextResource and uses ServletContext.getResourcePaths to find matching resources below the web application root directory. In case of other resources, delegates to the superclass version.

Overrides:
doFindPathMatchingFileResources in class PathMatchingResourcePatternResolver
Parameters:
rootDirResource - the root directory as Resource
subPattern - the sub pattern to match (below the root directory)
Returns:
the Set of matching Resource instances
Throws:
IOException - in case of I/O errors
See Also:
doRetrieveMatchingServletContextResources(javax.servlet.ServletContext, java.lang.String, java.lang.String, java.util.Set), ServletContextResource, ServletContext.getResourcePaths(java.lang.String)

doRetrieveMatchingServletContextResources

protected void doRetrieveMatchingServletContextResources(ServletContext servletContext,
                                                         String fullPattern,
                                                         String dir,
                                                         Set<Resource> result)
                                                  throws IOException
Recursively retrieve ServletContextResources that match the given pattern, adding them to the given result set.

Parameters:
servletContext - the ServletContext to work on
fullPattern - the pattern to match against, with preprended root directory path
dir - the current directory
result - the Set of matching Resources to add to
Throws:
IOException - if directory contents could not be retrieved
See Also:
ServletContextResource, ServletContext.getResourcePaths(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletContextScope

org.springframework.web.context.support
Class ServletContextScope

java.lang.Object
    extended by  org.springframework.web.context.support.ServletContextScope
All Implemented Interfaces:
Scope, DisposableBean
public class ServletContextScope
extends Object
implements Scope, DisposableBean

Scope wrapper for a ServletContext, i.e. for global web application attributes.

This differs from traditional Spring singletons in that it exposes attributes in the ServletContext. Those attributes will get destroyed whenever the entire application shuts down, which might be earlier or later than the shutdown of the containing Spring ApplicationContext.

The associated destruction mechanism relies on a ContextCleanupListener being registered in web.xml. Note that ContextLoaderListener includes ContextCleanupListener's functionality.

This scope is registered as default scope with key "application".

Since:
3.0
Author:
Juergen Hoeller
See Also:
ContextCleanupListener

Constructor Summary
ServletContextScope(ServletContext servletContext)
Create a new Scope wrapper for the given ServletContext.
Method Summary
void | destroy() Invoke all registered destruction callbacks.
Object | get(String name, ObjectFactory<?> objectFactory) Return the object with the given name from the underlying scope, creating it if not found in the underlying storage mechanism.
String | getConversationId() Return the conversation ID for the current underlying scope, if any.
void | registerDestructionCallback(String name, Runnable callback) Register a callback to be executed on destruction of the specified object in the scope (or at destruction of the entire scope, if the scope does not destroy individual objects but rather only terminates in its entirety).
Object | remove(String name) Remove the object with the given name from the underlying scope.
Object | resolveContextualObject(String key) Resolve the contextual object for the given key, if any.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ServletContextScope

public ServletContextScope(ServletContext servletContext)
Create a new Scope wrapper for the given ServletContext.

Parameters:
servletContext - the ServletContext to wrap
Method Detail

get

public Object get(String name,
                  ObjectFactory<?> objectFactory)
Description copied from interface: Scope
Return the object with the given name from the underlying scope, creating it if not found in the underlying storage mechanism.

This is the central operation of a Scope, and the only operation that is absolutely required.

Specified by:
get in interface Scope
Parameters:
name - the name of the object to retrieve
objectFactory - the ObjectFactory to use to create the scoped object if it is not present in the underlying storage mechanism
Returns:
the desired object (never null)

remove

public Object remove(String name)
Description copied from interface: Scope
Remove the object with the given name from the underlying scope.

Returns null if no object was found; otherwise returns the removed Object.

Note that an implementation should also remove a registered destruction callback for the specified object, if any. It does, however, not need to execute a registered destruction callback in this case, since the object will be destroyed by the caller (if appropriate).

Note: This is an optional operation. Implementations may throw UnsupportedOperationException if they do not support explicitly removing an object.

Specified by:
remove in interface Scope
Parameters:
name - the name of the object to remove
Returns:
the removed object, or null if no object was present
See Also:
Scope.registerDestructionCallback(java.lang.String, java.lang.Runnable)

registerDestructionCallback

public void registerDestructionCallback(String name,
                                        Runnable callback)
Description copied from interface: Scope
Register a callback to be executed on destruction of the specified object in the scope (or at destruction of the entire scope, if the scope does not destroy individual objects but rather only terminates in its entirety).

Note: This is an optional operation. This method will only be called for scoped beans with actual destruction configuration (DisposableBean, destroy-method, DestructionAwareBeanPostProcessor). Implementations should do their best to execute a given callback at the appropriate time. If such a callback is not supported by the underlying runtime environment at all, the callback must be ignored and a corresponding warning should be logged.

Note that 'destruction' refers to to automatic destruction of the object as part of the scope's own lifecycle, not to the individual scoped object having been explicitly removed by the application. If a scoped object gets removed via this facade's Scope.remove(String) method, any registered destruction callback should be removed as well, assuming that the removed object will be reused or manually destroyed.

Specified by:
registerDestructionCallback in interface Scope
Parameters:
name - the name of the object to execute the destruction callback for
callback - the destruction callback to be executed. Note that the passed-in Runnable will never throw an exception, so it can safely be executed without an enclosing try-catch block. Furthermore, the Runnable will usually be serializable, provided that its target object is serializable as well.
See Also:
DisposableBean, AbstractBeanDefinition.getDestroyMethodName(), DestructionAwareBeanPostProcessor

resolveContextualObject

public Object resolveContextualObject(String key)
Description copied from interface: Scope
Resolve the contextual object for the given key, if any. E.g. the HttpServletRequest object for key "request".

Specified by:
resolveContextualObject in interface Scope
Parameters:
key - the contextual key
Returns:
the corresponding object, or null if none found

getConversationId

public String getConversationId()
Description copied from interface: Scope
Return the conversation ID for the current underlying scope, if any.

The exact meaning of the conversation ID depends on the underlying storage mechanism. In the case of session-scoped objects, the conversation ID would typically be equal to (or derived from) the session ID; in the case of a custom conversation that sits within the overall session, the specific ID for the current conversation would be appropriate.

Note: This is an optional operation. It is perfectly valid to return null in an implementation of this method if the underlying storage mechanism has no obvious candidate for such an ID.

Specified by:
getConversationId in interface Scope
Returns:
the conversation ID, or null if there is no conversation ID for the current scope

destroy

public void destroy()
Invoke all registered destruction callbacks. To be called on ServletContext shutdown.

Specified by:
destroy in interface DisposableBean
See Also:
ContextCleanupListener
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletRequestHandledEvent

org.springframework.web.context.support
Class ServletRequestHandledEvent

java.lang.Object
    extended by  java.util.EventObject
        extended by  org.springframework.context.ApplicationEvent
            extended by  org.springframework.web.context.support.RequestHandledEvent
                extended by  org.springframework.web.context.support.ServletRequestHandledEvent
All Implemented Interfaces:
Serializable
public class ServletRequestHandledEvent
extends RequestHandledEvent

Servlet-specific subclass of RequestHandledEvent, adding servlet-specific context information.

Since:
2.0
Author:
Juergen Hoeller
See Also:
FrameworkServlet, ApplicationEventPublisher.publishEvent(org.springframework.context.ApplicationEvent), Serialized Form

Field Summary
Fields inherited from class java.util.EventObject
source
Constructor Summary
ServletRequestHandledEvent(Object source, String requestUrl, String clientAddress, String method, String servletName, String sessionId, String userName, long processingTimeMillis)
Create a new ServletRequestHandledEvent.
ServletRequestHandledEvent(Object source, String requestUrl, String clientAddress, String method, String servletName, String sessionId, String userName, long processingTimeMillis, Throwable failureCause)
Create a new ServletRequestHandledEvent.
Method Summary
String | getClientAddress() Return the IP address that the request came from.
String | getDescription() Return a full description of this event, involving all available context data.
String | getMethod() Return the HTTP method of the request (usually GET or POST).
String | getRequestUrl() Return the URL of the request.
String | getServletName() Return the name of the servlet that handled the request.
String | getShortDescription() Return a short description of this event, only involving the most important context data.
String | toString()
Methods inherited from class org.springframework.web.context.support.RequestHandledEvent
getFailureCause, getProcessingTimeMillis, getSessionId, getUserName, wasFailure
Methods inherited from class org.springframework.context.ApplicationEvent
getTimestamp
Methods inherited from class java.util.EventObject
getSource
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ServletRequestHandledEvent

public ServletRequestHandledEvent(Object source,
                                  String requestUrl,
                                  String clientAddress,
                                  String method,
                                  String servletName,
                                  String sessionId,
                                  String userName,
                                  long processingTimeMillis)
Create a new ServletRequestHandledEvent.

Parameters:
source - the component that published the event
requestUrl - the URL of the request
clientAddress - the IP address that the request came from
method - the HTTP method of the request (usually GET or POST)
servletName - the name of the servlet that handled the request
sessionId - the id of the HTTP session, if any
userName - the name of the user that was associated with the request, if any (usually the UserPrincipal)
processingTimeMillis - the processing time of the request in milliseconds

ServletRequestHandledEvent

public ServletRequestHandledEvent(Object source,
                                  String requestUrl,
                                  String clientAddress,
                                  String method,
                                  String servletName,
                                  String sessionId,
                                  String userName,
                                  long processingTimeMillis,
                                  Throwable failureCause)
Create a new ServletRequestHandledEvent.

Parameters:
source - the component that published the event
requestUrl - the URL of the request
clientAddress - the IP address that the request came from
method - the HTTP method of the request (usually GET or POST)
servletName - the name of the servlet that handled the request
sessionId - the id of the HTTP session, if any
userName - the name of the user that was associated with the request, if any (usually the UserPrincipal)
processingTimeMillis - the processing time of the request in milliseconds
failureCause - the cause of failure, if any
Method Detail

getRequestUrl

public String getRequestUrl()
Return the URL of the request.

getClientAddress

public String getClientAddress()
Return the IP address that the request came from.

getMethod

public String getMethod()
Return the HTTP method of the request (usually GET or POST).

getServletName

public String getServletName()
Return the name of the servlet that handled the request.

getShortDescription

public String getShortDescription()
Description copied from class: RequestHandledEvent
Return a short description of this event, only involving the most important context data.

Overrides:
getShortDescription in class RequestHandledEvent

getDescription

public String getDescription()
Description copied from class: RequestHandledEvent
Return a full description of this event, involving all available context data.

Overrides:
getDescription in class RequestHandledEvent

toString

public String toString()
Overrides:
toString in class RequestHandledEvent
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SpringBeanAutowiringSupport

org.springframework.web.context.support
Class SpringBeanAutowiringSupport

java.lang.Object
    extended by  org.springframework.web.context.support.SpringBeanAutowiringSupport

public abstract class SpringBeanAutowiringSupport
extends Object

Convenient base class for self-autowiring classes that gets constructed within a Spring-based web application. Resolves @Autowired annotations in the endpoint class against beans in the current Spring root web application context (as determined by the current thread's context ClassLoader, which needs to be the web application's ClassLoader). Can alternatively be used as a delegate instead of as a base class.

A typical usage of this base class is a JAX-WS endpoint class: Such a Spring-based JAX-WS endpoint implementation will follow the standard JAX-WS contract for endpoint classes but will be 'thin' in that it delegates the actual work to one or more Spring-managed service beans - typically obtained using @Autowired. The lifecycle of such an endpoint instance will be managed by the JAX-WS runtime, hence the need for this base class to provide @Autowired processing based on the current Spring context.

NOTE: If there is an explicit way to access the ServletContext, prefer such a way over using this class. The WebApplicationContextUtils class allows for easy access to the Spring root web application context based on the ServletContext.

Since:
2.5.1
Author:
Juergen Hoeller
See Also:
WebApplicationObjectSupport

Constructor Summary
SpringBeanAutowiringSupport()
This constructor performs injection on this instance, based on the current web application context.
Method Summary
static void | processInjectionBasedOnCurrentContext(Object target) Process @Autowired injection for the given target object, based on the current web application context.
static void | processInjectionBasedOnServletContext(Object target, ServletContext servletContext) Process @Autowired injection for the given target object, based on the current root web application context as stored in the ServletContext.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SpringBeanAutowiringSupport

public SpringBeanAutowiringSupport()
This constructor performs injection on this instance, based on the current web application context.

Intended for use as a base class.

See Also:
processInjectionBasedOnCurrentContext(java.lang.Object)
Method Detail

processInjectionBasedOnCurrentContext

public static void processInjectionBasedOnCurrentContext(Object target)
Process @Autowired injection for the given target object, based on the current web application context.

Intended for use as a delegate.

Parameters:
target - the target object to process
See Also:
ContextLoader.getCurrentWebApplicationContext()

processInjectionBasedOnServletContext

public static void processInjectionBasedOnServletContext(Object target,
                                                         ServletContext servletContext)
Process @Autowired injection for the given target object, based on the current root web application context as stored in the ServletContext.

Intended for use as a delegate.

Parameters:
target - the target object to process
servletContext - the ServletContext to find the Spring web application context in
See Also:
WebApplicationContextUtils.getWebApplicationContext(javax.servlet.ServletContext)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StaticWebApplicationContext

org.springframework.web.context.support
Class StaticWebApplicationContext

java.lang.Object
    extended by  org.springframework.core.io.DefaultResourceLoader
        extended by  org.springframework.context.support.AbstractApplicationContext
            extended by  org.springframework.context.support.GenericApplicationContext
                extended by  org.springframework.context.support.StaticApplicationContext
                    extended by  org.springframework.web.context.support.StaticWebApplicationContext
All Implemented Interfaces:
BeanFactory, DisposableBean, HierarchicalBeanFactory, ListableBeanFactory, BeanDefinitionRegistry, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, AliasRegistry, ResourceLoader, ResourcePatternResolver, ThemeSource, ConfigurableWebApplicationContext, WebApplicationContext
public class StaticWebApplicationContext
extends StaticApplicationContext
implements ConfigurableWebApplicationContext, ThemeSource

Static WebApplicationContext implementation for testing. Not intended for use in production applications.

Implements the ConfigurableWebApplicationContext interface to allow for direct replacement of an XmlWebApplicationContext, despite not actually supporting external configuration files.

Interprets resource paths as servlet context resources, i.e. as paths beneath the web application root. Absolute paths, e.g. for files outside the web app root, can be accessed via "file:" URLs, as implemented by DefaultResourceLoader.

In addition to the special beans detected by AbstractApplicationContext, this class detects a bean of type ThemeSource in the context, under the special bean name "themeSource".

Author:
Rod Johnson, Juergen Hoeller
See Also:
ThemeSource

Field Summary
Fields inherited from class org.springframework.context.support.AbstractApplicationContext
APPLICATION_EVENT_MULTICASTER_BEAN_NAME, LIFECYCLE_PROCESSOR_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAME
Fields inherited from interface org.springframework.web.context.ConfigurableWebApplicationContext
APPLICATION_CONTEXT_ID_PREFIX, SERVLET_CONFIG_BEAN_NAME
Fields inherited from interface org.springframework.web.context.WebApplicationContext
CONTEXT_ATTRIBUTES_BEAN_NAME, CONTEXT_PARAMETERS_BEAN_NAME, ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, SCOPE_APPLICATION, SCOPE_GLOBAL_SESSION, SCOPE_REQUEST, SCOPE_SESSION, SERVLET_CONTEXT_BEAN_NAME
Fields inherited from interface org.springframework.context.ConfigurableApplicationContext
CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAME
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Constructor Summary
StaticWebApplicationContext()
Method Summary
String[] | getConfigLocations() Return the config locations for this web application context, or null if none specified.
String | getNamespace() Return the namespace for this web application context, if any.
protected Resource | getResourceByPath(String path) This implementation supports file paths beneath the root of the ServletContext.
protected ResourcePatternResolver | getResourcePatternResolver() This implementation supports pattern matching in unexpanded WARs too.
ServletConfig | getServletConfig() Return the ServletConfig for this web application context, if any.
ServletContext | getServletContext() Return the standard Servlet API ServletContext for this application.
Theme | getTheme(String themeName) Return the Theme instance for the given theme name.
protected void | onRefresh() Initialize the theme capability.
protected void | postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) Register request/session scopes, a ServletContextAwareProcessor, etc.
void | setConfigLocation(String configLocation) The StaticWebApplicationContext class does not support this method.
void | setConfigLocations(String[] configLocations) The StaticWebApplicationContext class does not support this method.
void | setNamespace(String namespace) Set the namespace for this web application context, to be used for building a default context config location.
void | setServletConfig(ServletConfig servletConfig) Set the ServletConfig for this web application context.
void | setServletContext(ServletContext servletContext) Set the ServletContext that this WebApplicationContext runs in.
Methods inherited from class org.springframework.context.support.StaticApplicationContext
addMessage, getStaticMessageSource, registerPrototype, registerPrototype, registerSingleton, registerSingleton
Methods inherited from class org.springframework.context.support.GenericApplicationContext
closeBeanFactory, getBeanDefinition, getBeanFactory, getDefaultListableBeanFactory, getResource, getResources, isAlias, isBeanNameInUse, refreshBeanFactory, registerAlias, registerBeanDefinition, removeAlias, removeBeanDefinition, setAllowBeanDefinitionOverriding, setAllowCircularReferences, setId, setParent, setResourceLoader
Methods inherited from class org.springframework.context.support.AbstractApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, addListener, cancelRefresh, close, containsBean, containsBeanDefinition, containsLocalBean, destroy, destroyBeans, doClose, findAnnotationOnBean, finishBeanFactoryInitialization, finishRefresh, getAliases, getApplicationListeners, getAutowireCapableBeanFactory, getBean, getBean, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getDisplayName, getId, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getStartupDate, getType, initApplicationEventMulticaster, initLifecycleProcessor, initMessageSource, invokeBeanFactoryPostProcessors, isActive, isPrototype, isRunning, isSingleton, isTypeMatch, obtainFreshBeanFactory, onClose, prepareBeanFactory, prepareRefresh, publishEvent, refresh, registerBeanPostProcessors, registerListeners, registerShutdownHook, setDisplayName, start, stop, toString
Methods inherited from class org.springframework.core.io.DefaultResourceLoader
getClassLoader, setClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.context.ConfigurableApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, close, getBeanFactory, isActive, refresh, registerShutdownHook, setId, setParent
Methods inherited from interface org.springframework.context.ApplicationContext
getAutowireCapableBeanFactory, getDisplayName, getId, getParent, getStartupDate
Methods inherited from interface org.springframework.beans.factory.ListableBeanFactory
containsBeanDefinition, findAnnotationOnBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation
Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory
containsLocalBean, getParentBeanFactory
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getBean, getBean, getType, isPrototype, isSingleton, isTypeMatch
Methods inherited from interface org.springframework.context.MessageSource
getMessage, getMessage, getMessage
Methods inherited from interface org.springframework.context.ApplicationEventPublisher
publishEvent
Methods inherited from interface org.springframework.core.io.support.ResourcePatternResolver
getResources
Methods inherited from interface org.springframework.core.io.ResourceLoader
getClassLoader, getResource
Methods inherited from interface org.springframework.context.Lifecycle
isRunning, start, stop
Methods inherited from interface org.springframework.beans.factory.support.BeanDefinitionRegistry
containsBeanDefinition, getBeanDefinitionCount, getBeanDefinitionNames
Methods inherited from interface org.springframework.core.AliasRegistry
getAliases

Constructor Detail

StaticWebApplicationContext

public StaticWebApplicationContext()
Method Detail

setServletContext

public void setServletContext(ServletContext servletContext)
Set the ServletContext that this WebApplicationContext runs in.

Specified by:
setServletContext in interface ConfigurableWebApplicationContext
See Also:
ConfigurableApplicationContext.refresh()

getServletContext

public ServletContext getServletContext()
Description copied from interface: WebApplicationContext
Return the standard Servlet API ServletContext for this application.

Also available for a Portlet application, in addition to the PortletContext.

Specified by:
getServletContext in interface WebApplicationContext

setServletConfig

public void setServletConfig(ServletConfig servletConfig)
Description copied from interface: ConfigurableWebApplicationContext
Set the ServletConfig for this web application context. Only called for a WebApplicationContext that belongs to a specific Servlet.

Specified by:
setServletConfig in interface ConfigurableWebApplicationContext
See Also:
ConfigurableApplicationContext.refresh()

getServletConfig

public ServletConfig getServletConfig()
Description copied from interface: ConfigurableWebApplicationContext
Return the ServletConfig for this web application context, if any.

Specified by:
getServletConfig in interface ConfigurableWebApplicationContext

setNamespace

public void setNamespace(String namespace)
Description copied from interface: ConfigurableWebApplicationContext
Set the namespace for this web application context, to be used for building a default context config location. The root web application context does not have a namespace.

Specified by:
setNamespace in interface ConfigurableWebApplicationContext

getNamespace

public String getNamespace()
Description copied from interface: ConfigurableWebApplicationContext
Return the namespace for this web application context, if any.

Specified by:
getNamespace in interface ConfigurableWebApplicationContext

setConfigLocation

public void setConfigLocation(String configLocation)
The StaticWebApplicationContext class does not support this method.

Specified by:
setConfigLocation in interface ConfigurableWebApplicationContext
Throws:
UnsupportedOperationException - always

setConfigLocations

public void setConfigLocations(String[] configLocations)
The StaticWebApplicationContext class does not support this method.

Specified by:
setConfigLocations in interface ConfigurableWebApplicationContext
Throws:
UnsupportedOperationException - always

getConfigLocations

public String[] getConfigLocations()
Description copied from interface: ConfigurableWebApplicationContext
Return the config locations for this web application context, or null if none specified.

Specified by:
getConfigLocations in interface ConfigurableWebApplicationContext

postProcessBeanFactory

protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
Register request/session scopes, a ServletContextAwareProcessor, etc.

Overrides:
postProcessBeanFactory in class AbstractApplicationContext
Parameters:
beanFactory - the bean factory used by the application context

getResourceByPath

protected Resource getResourceByPath(String path)
This implementation supports file paths beneath the root of the ServletContext.

Overrides:
getResourceByPath in class DefaultResourceLoader
Parameters:
path - the path to the resource
Returns:
the corresponding Resource handle
See Also:
ServletContextResource

getResourcePatternResolver

protected ResourcePatternResolver getResourcePatternResolver()
This implementation supports pattern matching in unexpanded WARs too.

Overrides:
getResourcePatternResolver in class AbstractApplicationContext
Returns:
the ResourcePatternResolver for this context
See Also:
ServletContextResourcePatternResolver

onRefresh

protected void onRefresh()
Initialize the theme capability.

Overrides:
onRefresh in class AbstractApplicationContext
See Also:
AbstractApplicationContext.refresh()

getTheme

public Theme getTheme(String themeName)
Description copied from interface: ThemeSource
Return the Theme instance for the given theme name.

The returned Theme will resolve theme-specific messages, codes, file paths, etc (e.g. CSS and image files in a web environment).

Specified by:
getTheme in interface ThemeSource
Parameters:
themeName - the name of the theme
Returns:
the corresponding Theme, or null if none defined. Note that, by convention, a ThemeSource should at least be able to return a default Theme for the default theme name "theme" but may also return default Themes for other theme names.
See Also:
AbstractThemeResolver.ORIGINAL_DEFAULT_THEME_NAME
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WebApplicationContextUtils

org.springframework.web.context.support
Class WebApplicationContextUtils

java.lang.Object
    extended by  org.springframework.web.context.support.WebApplicationContextUtils

public abstract class WebApplicationContextUtils
extends Object

Convenience methods for retrieving the root WebApplicationContext for a given ServletContext. This is e.g. useful for accessing a Spring context from within custom web views or Struts actions.

Note that there are more convenient ways of accessing the root context for many web frameworks, either part of Spring or available as external library. This helper class is just the most generic way to access the root context.

Author:
Juergen Hoeller
See Also:
ContextLoader, FrameworkServlet, DispatcherServlet, FacesContextUtils, SpringBeanVariableResolver, SpringBeanFacesELResolver

Constructor Summary
WebApplicationContextUtils()
Method Summary
static WebApplicationContext | getRequiredWebApplicationContext(ServletContext sc) Find the root WebApplicationContext for this web application, which is typically loaded via ContextLoaderListener.
static WebApplicationContext | getWebApplicationContext(ServletContext sc) Find the root WebApplicationContext for this web application, which is typically loaded via ContextLoaderListener.
static WebApplicationContext | getWebApplicationContext(ServletContext sc, String attrName) Find a custom WebApplicationContext for this web application.
static void | registerEnvironmentBeans(ConfigurableListableBeanFactory bf, ServletContext sc) Register web-specific environment beans ("contextParameters", "contextAttributes") with the given BeanFactory, as used by the WebApplicationContext.
static void | registerEnvironmentBeans(ConfigurableListableBeanFactory bf, ServletContext sc, ServletConfig config) Register web-specific environment beans ("contextParameters", "contextAttributes") with the given BeanFactory, as used by the WebApplicationContext.
static void | registerWebApplicationScopes(ConfigurableListableBeanFactory beanFactory) Register web-specific scopes ("request", "session", "globalSession") with the given BeanFactory, as used by the WebApplicationContext.
static void | registerWebApplicationScopes(ConfigurableListableBeanFactory beanFactory, ServletContext sc) Register web-specific scopes ("request", "session", "globalSession", "application") with the given BeanFactory, as used by the WebApplicationContext.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

WebApplicationContextUtils

public WebApplicationContextUtils()
Method Detail

getRequiredWebApplicationContext

public static WebApplicationContext getRequiredWebApplicationContext(ServletContext sc)
                                                              throws IllegalStateException
Find the root WebApplicationContext for this web application, which is typically loaded via ContextLoaderListener.

Will rethrow an exception that happened on root context startup, to differentiate between a failed context startup and no context at all.

Parameters:
sc - ServletContext to find the web application context for
Returns:
the root WebApplicationContext for this web app
Throws:
IllegalStateException - if the root WebApplicationContext could not be found
See Also:
WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE

getWebApplicationContext

public static WebApplicationContext getWebApplicationContext(ServletContext sc)
Find the root WebApplicationContext for this web application, which is typically loaded via ContextLoaderListener.

Will rethrow an exception that happened on root context startup, to differentiate between a failed context startup and no context at all.

Parameters:
sc - ServletContext to find the web application context for
Returns:
the root WebApplicationContext for this web app, or null if none
See Also:
WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE

getWebApplicationContext

public static WebApplicationContext getWebApplicationContext(ServletContext sc,
                                                             String attrName)
Find a custom WebApplicationContext for this web application.

Parameters:
sc - ServletContext to find the web application context for
attrName - the name of the ServletContext attribute to look for
Returns:
the desired WebApplicationContext for this web app, or null if none

registerWebApplicationScopes

public static void registerWebApplicationScopes(ConfigurableListableBeanFactory beanFactory)
Register web-specific scopes ("request", "session", "globalSession") with the given BeanFactory, as used by the WebApplicationContext.

Parameters:
beanFactory - the BeanFactory to configure

registerWebApplicationScopes

public static void registerWebApplicationScopes(ConfigurableListableBeanFactory beanFactory,
                                                ServletContext sc)
Register web-specific scopes ("request", "session", "globalSession", "application") with the given BeanFactory, as used by the WebApplicationContext.

Parameters:
beanFactory - the BeanFactory to configure
sc - the ServletContext that we're running within

registerEnvironmentBeans

public static void registerEnvironmentBeans(ConfigurableListableBeanFactory bf,
                                            ServletContext sc)
Register web-specific environment beans ("contextParameters", "contextAttributes") with the given BeanFactory, as used by the WebApplicationContext.

Parameters:
bf - the BeanFactory to configure
sc - the ServletContext that we're running within

registerEnvironmentBeans

public static void registerEnvironmentBeans(ConfigurableListableBeanFactory bf,
                                            ServletContext sc,
                                            ServletConfig config)
Register web-specific environment beans ("contextParameters", "contextAttributes") with the given BeanFactory, as used by the WebApplicationContext.

Parameters:
bf - the BeanFactory to configure
sc - the ServletContext that we're running within
config - the ServletConfig of the containing Portlet
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WebApplicationObjectSupport

org.springframework.web.context.support
Class WebApplicationObjectSupport

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
All Implemented Interfaces:
ApplicationContextAware, ServletContextAware
Direct Known Subclasses:
AbstractCachingViewResolver, AbstractHandlerMapping, AbstractView, BeanNameViewResolver, ContentNegotiatingViewResolver, TilesConfigurer, WebContentGenerator
public abstract class WebApplicationObjectSupport
extends ApplicationObjectSupport
implements ServletContextAware

Convenient superclass for application objects running in a WebApplicationContext. Provides getWebApplicationContext(), getServletContext(), and getTempDir() methods.

Since:
28.08.2003
Author:
Juergen Hoeller
See Also:
SpringBeanAutowiringSupport

Field Summary
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Constructor Summary
WebApplicationObjectSupport()
Method Summary
protected ServletContext | getServletContext() Return the current ServletContext.
protected File | getTempDir() Return the temporary directory for the current web application, as provided by the servlet container.
protected WebApplicationContext | getWebApplicationContext() Return the current application context as WebApplicationContext.
protected void | initApplicationContext(ApplicationContext context) Calls initServletContext(javax.servlet.ServletContext) if the given ApplicationContext is a WebApplicationContext.
protected void | initServletContext(ServletContext servletContext) Subclasses may override this for custom initialization based on the ServletContext that this application object runs in.
protected boolean | isContextRequired() Overrides the base class behavior to enforce running in an ApplicationContext.
void | setServletContext(ServletContext servletContext) Set the ServletContext that this object runs in.
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

WebApplicationObjectSupport

public WebApplicationObjectSupport()
Method Detail

setServletContext

public final void setServletContext(ServletContext servletContext)
Description copied from interface: ServletContextAware
Set the ServletContext that this object runs in.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked after ApplicationContextAware's setApplicationContext.

Specified by:
setServletContext in interface ServletContextAware
Parameters:
servletContext - ServletContext object to be used by this object
See Also:
InitializingBean.afterPropertiesSet(), ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)

isContextRequired

protected boolean isContextRequired()
Overrides the base class behavior to enforce running in an ApplicationContext. All accessors will throw IllegalStateException if not running in a context.

Overrides:
isContextRequired in class ApplicationObjectSupport
See Also:
ApplicationObjectSupport.getApplicationContext(),
ApplicationObjectSupport.getMessageSourceAccessor(),
getWebApplicationContext(),
getServletContext(),
getTempDir()

initApplicationContext

protected void initApplicationContext(ApplicationContext context)
Calls initServletContext(javax.servlet.ServletContext) if the given ApplicationContext is a WebApplicationContext.

Overrides:
initApplicationContext in class ApplicationObjectSupport
Parameters:
context - the containing ApplicationContext
See Also:
ApplicationObjectSupport.setApplicationContext(org.springframework.context.ApplicationContext)

initServletContext

protected void initServletContext(ServletContext servletContext)
Subclasses may override this for custom initialization based on the ServletContext that this application object runs in.

The default implementation is empty. Called by initApplicationContext(org.springframework.context.ApplicationContext) as well as setServletContext(javax.servlet.ServletContext).

Parameters:
servletContext - the ServletContext that this application object runs in (never null)

getWebApplicationContext

protected final WebApplicationContext getWebApplicationContext()
                                                        throws IllegalStateException
Return the current application context as WebApplicationContext.

NOTE: Only use this if you actually need to access WebApplicationContext-specific functionality. Preferably use getApplicationContext() or getServletContext() else, to be able to run in non-WebApplicationContext environments as well.

Throws:
IllegalStateException - if not running in a WebApplicationContext
See Also:
ApplicationObjectSupport.getApplicationContext()

getServletContext

protected final ServletContext getServletContext()
                                          throws IllegalStateException
Return the current ServletContext.

Throws:
IllegalStateException - if not running within a ServletContext

getTempDir

protected final File getTempDir()
                         throws IllegalStateException
Return the temporary directory for the current web application, as provided by the servlet container.

Returns:
the File representing the temporary directory
Throws:
IllegalStateException - if not running within a ServletContext
See Also:
WebUtils.getTempDir(javax.servlet.ServletContext)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XmlWebApplicationContext

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.context.support
Class XmlWebApplicationContext

java.lang.Object
    extended by  org.springframework.core.io.DefaultResourceLoader
        extended by  org.springframework.context.support.AbstractApplicationContext
            extended by  org.springframework.context.support.AbstractRefreshableApplicationContext
                extended by  org.springframework.context.support.AbstractRefreshableConfigApplicationContext
                    extended by  org.springframework.web.context.support.AbstractRefreshableWebApplicationContext
                        extended by  org.springframework.web.context.support.XmlWebApplicationContext
All Implemented Interfaces:
BeanFactory, BeanNameAware, DisposableBean, HierarchicalBeanFactory, InitializingBean, ListableBeanFactory, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, ResourceLoader, ResourcePatternResolver, ThemeSource, ConfigurableWebApplicationContext, WebApplicationContext
public class XmlWebApplicationContext
extends AbstractRefreshableWebApplicationContext

WebApplicationContext implementation which takes its configuration from XML documents, understood by an XmlBeanDefinitionReader. This is essentially the equivalent of AbstractXmlApplicationContext for a web environment.

By default, the configuration will be taken from "/WEB-INF/applicationContext.xml" for the root context, and "/WEB-INF/test-servlet.xml" for a context with the namespace "test-servlet" (like for a DispatcherServlet instance with the servlet-name "test").

The config location defaults can be overridden via the "contextConfigLocation" context-param of ContextLoader and servlet init-param of FrameworkServlet. Config locations can either denote concrete files like "/WEB-INF/context.xml" or Ant-style patterns like "/WEB-INF/*-context.xml" (see PathMatcher javadoc for pattern details).

Note: In case of multiple config locations, later bean definitions will override ones defined in earlier loaded files. This can be leveraged to deliberately override certain bean definitions via an extra XML file.

For a WebApplicationContext that reads in a different bean definition format, create an analogous subclass of AbstractRefreshableWebApplicationContext. Such a context implementation can be specified as "contextClass" context-param for ContextLoader or "contextClass" init-param for FrameworkServlet.

Author:
Rod Johnson, Juergen Hoeller
See Also:
AbstractRefreshableWebApplicationContext.setNamespace(java.lang.String), AbstractRefreshableConfigApplicationContext.setConfigLocations(java.lang.String[]), XmlBeanDefinitionReader, ContextLoader.initWebApplicationContext(javax.servlet.ServletContext), FrameworkServlet.initWebApplicationContext()

Field Summary
static String | DEFAULT_CONFIG_LOCATION Default config location for the root context
static String | DEFAULT_CONFIG_LOCATION_PREFIX Default prefix for building a config location for a namespace
static String | DEFAULT_CONFIG_LOCATION_SUFFIX Default suffix for building a config location for a namespace
Fields inherited from class org.springframework.context.support.AbstractApplicationContext
APPLICATION_EVENT_MULTICASTER_BEAN_NAME, LIFECYCLE_PROCESSOR_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAME
Fields inherited from interface org.springframework.web.context.ConfigurableWebApplicationContext
APPLICATION_CONTEXT_ID_PREFIX, SERVLET_CONFIG_BEAN_NAME
Fields inherited from interface org.springframework.web.context.WebApplicationContext
CONTEXT_ATTRIBUTES_BEAN_NAME, CONTEXT_PARAMETERS_BEAN_NAME, ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, SCOPE_APPLICATION, SCOPE_GLOBAL_SESSION, SCOPE_REQUEST, SCOPE_SESSION, SERVLET_CONTEXT_BEAN_NAME
Fields inherited from interface org.springframework.context.ConfigurableApplicationContext
CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAME
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Constructor Summary
XmlWebApplicationContext()
Method Summary
protected String[] | getDefaultConfigLocations() The default location for the root context is "/WEB-INF/applicationContext.xml", and "/WEB-INF/test-servlet.xml" for a context with the namespace "test-servlet" (like for a DispatcherServlet instance with the servlet-name "test").
protected void | initBeanDefinitionReader(XmlBeanDefinitionReader beanDefinitionReader) Initialize the bean definition reader used for loading the bean definitions of this context.
protected void | loadBeanDefinitions(DefaultListableBeanFactory beanFactory) Loads the bean definitions via an XmlBeanDefinitionReader.
protected void | loadBeanDefinitions(XmlBeanDefinitionReader reader) Load the bean definitions with the given XmlBeanDefinitionReader.
Methods inherited from class org.springframework.web.context.support.AbstractRefreshableWebApplicationContext
getConfigLocations, getNamespace, getResourceByPath, getResourcePatternResolver, getServletConfig, getServletContext, getTheme, onRefresh, postProcessBeanFactory, setNamespace, setServletConfig, setServletContext
Methods inherited from class org.springframework.context.support.AbstractRefreshableConfigApplicationContext
afterPropertiesSet, resolvePath, setBeanName, setConfigLocation, setConfigLocations, setId
Methods inherited from class org.springframework.context.support.AbstractRefreshableApplicationContext
cancelRefresh, closeBeanFactory, createBeanFactory, customizeBeanFactory, getBeanFactory, hasBeanFactory, refreshBeanFactory, setAllowBeanDefinitionOverriding, setAllowCircularReferences
Methods inherited from class org.springframework.context.support.AbstractApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, addListener, close, containsBean, containsBeanDefinition, containsLocalBean, destroy, destroyBeans, doClose, findAnnotationOnBean, finishBeanFactoryInitialization, finishRefresh, getAliases, getApplicationListeners, getAutowireCapableBeanFactory, getBean, getBean, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getDisplayName, getId, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getResources, getStartupDate, getType, initApplicationEventMulticaster, initLifecycleProcessor, initMessageSource, invokeBeanFactoryPostProcessors, isActive, isPrototype, isRunning, isSingleton, isTypeMatch, obtainFreshBeanFactory, onClose, prepareBeanFactory, prepareRefresh, publishEvent, refresh, registerBeanPostProcessors, registerListeners, registerShutdownHook, setDisplayName, setParent, start, stop, toString
Methods inherited from class org.springframework.core.io.DefaultResourceLoader
getClassLoader, getResource, setClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.web.context.ConfigurableWebApplicationContext
setConfigLocation, setConfigLocations
Methods inherited from interface org.springframework.context.ConfigurableApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, close, getBeanFactory, isActive, refresh, registerShutdownHook, setId, setParent
Methods inherited from interface org.springframework.context.ApplicationContext
getAutowireCapableBeanFactory, getDisplayName, getId, getParent, getStartupDate
Methods inherited from interface org.springframework.beans.factory.ListableBeanFactory
containsBeanDefinition, findAnnotationOnBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation
Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory
containsLocalBean, getParentBeanFactory
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getBean, getBean, getType, isPrototype, isSingleton, isTypeMatch
Methods inherited from interface org.springframework.context.MessageSource
getMessage, getMessage, getMessage
Methods inherited from interface org.springframework.context.ApplicationEventPublisher
publishEvent
Methods inherited from interface org.springframework.core.io.support.ResourcePatternResolver
getResources
Methods inherited from interface org.springframework.core.io.ResourceLoader
getClassLoader, getResource
Methods inherited from interface org.springframework.context.Lifecycle
isRunning, start, stop

Field Detail

DEFAULT_CONFIG_LOCATION

public static final String DEFAULT_CONFIG_LOCATION
Default config location for the root context

See Also:
Constant Field Values

DEFAULT_CONFIG_LOCATION_PREFIX

public static final String DEFAULT_CONFIG_LOCATION_PREFIX
Default prefix for building a config location for a namespace

See Also:
Constant Field Values

DEFAULT_CONFIG_LOCATION_SUFFIX

public static final String DEFAULT_CONFIG_LOCATION_SUFFIX
Default suffix for building a config location for a namespace

See Also:
Constant Field Values
Constructor Detail

XmlWebApplicationContext

public XmlWebApplicationContext()
Method Detail

loadBeanDefinitions

protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory)
                            throws BeansException,
                                   IOException
Loads the bean definitions via an XmlBeanDefinitionReader.

Specified by:
loadBeanDefinitions in class AbstractRefreshableApplicationContext
Parameters:
beanFactory - the bean factory to load bean definitions into
Throws:
BeansException - if parsing of the bean definitions failed
IOException - if loading of bean definition files failed
See Also:
XmlBeanDefinitionReader, initBeanDefinitionReader(org.springframework.beans.factory.xml.XmlBeanDefinitionReader), loadBeanDefinitions(org.springframework.beans.factory.support.DefaultListableBeanFactory)

initBeanDefinitionReader

protected void initBeanDefinitionReader(XmlBeanDefinitionReader beanDefinitionReader)
Initialize the bean definition reader used for loading the bean definitions of this context. Default implementation is empty.

Can be overridden in subclasses, e.g. for turning off XML validation or using a different XmlBeanDefinitionParser implementation.

Parameters:
beanDefinitionReader - the bean definition reader used by this context
See Also:
XmlBeanDefinitionReader.setValidationMode(int), XmlBeanDefinitionReader.setDocumentReaderClass(java.lang.Class)

loadBeanDefinitions

protected void loadBeanDefinitions(XmlBeanDefinitionReader reader)
                            throws IOException
Load the bean definitions with the given XmlBeanDefinitionReader.

The lifecycle of the bean factory is handled by the refreshBeanFactory method; therefore this method is just supposed to load and/or register bean definitions.

Delegates to a ResourcePatternResolver for resolving location patterns into Resource instances.

Throws:
IOException - if the required XML document isn't found
See Also:
AbstractRefreshableApplicationContext.refreshBeanFactory(),
AbstractRefreshableWebApplicationContext.getConfigLocations(),
AbstractApplicationContext.getResources(java.lang.String),
AbstractRefreshableWebApplicationContext.getResourcePatternResolver()

getDefaultConfigLocations

protected String[] getDefaultConfigLocations()
The default location for the root context is "/WEB-INF/applicationContext.xml", and "/WEB-INF/test-servlet.xml" for a context with the namespace "test-servlet" (like for a DispatcherServlet instance with the servlet-name "test").

Overrides:
getDefaultConfigLocations in class AbstractRefreshableConfigApplicationContext
Returns:
an array of default config locations, if any
See Also:
AbstractRefreshableConfigApplicationContext.setConfigLocations(java.lang.String[])
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.filter

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.filter

Provides generic filter base classes allowing for bean-style configuration.

See:
Description

Class Summary
AbstractRequestLoggingFilter | Base class for Filters that perform logging operations before and after a request is processed.
CharacterEncodingFilter | Servlet 2.3/2.4 Filter that allows one to specify a character encoding for requests.
CommonsRequestLoggingFilter | Simple request logging filter that writes the request URI (and optionally the query string) to the Commons Log.
DelegatingFilterProxy | Proxy for a standard Servlet 2.3 Filter, delegating to a Spring-managed bean that implements the Filter interface.
GenericFilterBean | Simple base implementation of Filter which treats its config parameters (init-param entries within the filter tag in web.xml) as bean properties.
HiddenHttpMethodFilter | Filter that converts posted method parameters into HTTP methods, retrievable via HttpServletRequest.getMethod().
Log4jNestedDiagnosticContextFilter | Request logging filter that adds the request log message to the Log4J nested diagnostic context (NDC) before the request is processed, removing it again after the request is processed.
OncePerRequestFilter | Filter base class that guarantees to be just executed once per request, on any servlet container.
RequestContextFilter | Servlet 2.3 Filter that exposes the request to the current thread, through both LocaleContextHolder and RequestContextHolder.
ServletContextRequestLoggingFilter | Simple request logging filter that writes the request URI (and optionally the query string) to the ServletContext log.
ShallowEtagHeaderFilter | Filter that generates an ETag value based on the content on the response.

Package org.springframework.web.filter Description

Provides generic filter base classes allowing for bean-style configuration.


org.springframework.web.filter Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.filter

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.web.filter.GenericFilterBean (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, javax.servlet.Filter, org.springframework.beans.factory.InitializingBean, org.springframework.web.context.ServletContextAware)
      • org.springframework.web.filter.DelegatingFilterProxy
      • org.springframework.web.filter.OncePerRequestFilter
        • org.springframework.web.filter.AbstractRequestLoggingFilter
          • org.springframework.web.filter.CommonsRequestLoggingFilter
          • org.springframework.web.filter.Log4jNestedDiagnosticContextFilter
          • org.springframework.web.filter.ServletContextRequestLoggingFilter
        • org.springframework.web.filter.CharacterEncodingFilter
        • org.springframework.web.filter.HiddenHttpMethodFilter
        • org.springframework.web.filter.RequestContextFilter
        • org.springframework.web.filter.ShallowEtagHeaderFilter


AbstractRequestLoggingFilter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.filter
Class AbstractRequestLoggingFilter

java.lang.Object
    extended by  org.springframework.web.filter.GenericFilterBean
        extended by  org.springframework.web.filter.OncePerRequestFilter
            extended by  org.springframework.web.filter.AbstractRequestLoggingFilter
All Implemented Interfaces:
Filter, BeanNameAware, DisposableBean, InitializingBean, ServletContextAware
Direct Known Subclasses:
CommonsRequestLoggingFilter, Log4jNestedDiagnosticContextFilter, ServletContextRequestLoggingFilter
public abstract class AbstractRequestLoggingFilter
extends OncePerRequestFilter

Base class for Filters that perform logging operations before and after a request is processed.

Subclasses should override the beforeRequest(HttpServletRequest, String) and afterRequest(HttpServletRequest, String) methods to perform the actual logging around the request.

Subclasses are passed the message to write to the log in the beforeRequest and afterRequest methods. By default, only the URI of the request is logged. However, setting the includeQueryString property to true will cause the query string of the request to be included also. The payload (body) of the request can be logged via the includePayload flag. Note that this will only log that which is read, which might not be the entire payload.

Prefixes and suffixes for the before and after messages can be configured using the beforeMessagePrefix, afterMessagePrefix, beforeMessageSuffix and afterMessageSuffix properties,

Since:
1.2.5
Author:
Rob Harrop, Juergen Hoeller
See Also:
beforeRequest(javax.servlet.http.HttpServletRequest, java.lang.String), afterRequest(javax.servlet.http.HttpServletRequest, java.lang.String)

Field Summary
static String | DEFAULT_AFTER_MESSAGE_PREFIX
static String | DEFAULT_AFTER_MESSAGE_SUFFIX
static String | DEFAULT_BEFORE_MESSAGE_PREFIX
static String | DEFAULT_BEFORE_MESSAGE_SUFFIX
Fields inherited from class org.springframework.web.filter.OncePerRequestFilter
ALREADY_FILTERED_SUFFIX
Fields inherited from class org.springframework.web.filter.GenericFilterBean
logger
Constructor Summary
AbstractRequestLoggingFilter()
Method Summary
protected abstract void | afterRequest(HttpServletRequest request, String message) Concrete subclasses should implement this method to write a log message after the request is processed.
protected abstract void | beforeRequest(HttpServletRequest request, String message) Concrete subclasses should implement this method to write a log message before the request is processed.
protected String | createMessage(HttpServletRequest request, String prefix, String suffix) Create a log message for the given request, prefix and suffix.
protected void | doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) Forwards the request to the next filter in the chain and delegates down to the subclasses to perform the actual request logging both before and after the request is processed.
protected int | getMaxPayloadLength() Return the maximum length of the payload body to be included in the log message.
protected boolean | isIncludeClientInfo() Return whether or not the client address and session id should be included in the log message.
protected boolean | isIncludePayload() Return whether or not the request payload (body) should be included in the log message.
protected boolean | isIncludeQueryString() Return whether or not the query string should be included in the log message.
void | setAfterMessagePrefix(String afterMessagePrefix) Set the value that should be prepended to the log message written after a request is processed.
void | setAfterMessageSuffix(String afterMessageSuffix) Set the value that should be appended to the log message written after a request is processed.
void | setBeforeMessagePrefix(String beforeMessagePrefix) Set the value that should be prepended to the log message written before a request is processed.
void | setBeforeMessageSuffix(String beforeMessageSuffix) Set the value that should be apppended to the log message written before a request is processed.
void | setIncludeClientInfo(boolean includeClientInfo) Set whether or not the client address and session id should be included in the log message.
void | setIncludePayload(boolean includePayload) Set whether or not the request payload (body) should be included in the log message.
void | setIncludeQueryString(boolean includeQueryString) Set whether or not the query string should be included in the log message.
void | setMaxPayloadLength(int maxPayloadLength) Sets the maximum length of the payload body to be included in the log message.
Methods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, getAlreadyFilteredAttributeName, shouldNotFilter
Methods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setServletContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_BEFORE_MESSAGE_PREFIX

public static final String DEFAULT_BEFORE_MESSAGE_PREFIX
See Also:
Constant Field Values

DEFAULT_BEFORE_MESSAGE_SUFFIX

public static final String DEFAULT_BEFORE_MESSAGE_SUFFIX
See Also:
Constant Field Values

DEFAULT_AFTER_MESSAGE_PREFIX

public static final String DEFAULT_AFTER_MESSAGE_PREFIX
See Also:
Constant Field Values

DEFAULT_AFTER_MESSAGE_SUFFIX

public static final String DEFAULT_AFTER_MESSAGE_SUFFIX
See Also:
Constant Field Values
Constructor Detail

AbstractRequestLoggingFilter

public AbstractRequestLoggingFilter()
Method Detail

setIncludeQueryString

public void setIncludeQueryString(boolean includeQueryString)
Set whether or not the query string should be included in the log message.

Should be configured using an <init-param> for parameter name "includeQueryString" in the filter definition in web.xml.

isIncludeQueryString

protected boolean isIncludeQueryString()
Return whether or not the query string should be included in the log message.

setIncludeClientInfo

public void setIncludeClientInfo(boolean includeClientInfo)
Set whether or not the client address and session id should be included in the log message.

Should be configured using an <init-param> for parameter name "includeClientInfo" in the filter definition in web.xml.

isIncludeClientInfo

protected boolean isIncludeClientInfo()
Return whether or not the client address and session id should be included in the log message.

setIncludePayload

public void setIncludePayload(boolean includePayload)
Set whether or not the request payload (body) should be included in the log message.

Should be configured using an <init-param> for parameter name "includePayload" in the filter definition in web.xml.

isIncludePayload

protected boolean isIncludePayload()
Return whether or not the request payload (body) should be included in the log message.

setMaxPayloadLength

public void setMaxPayloadLength(int maxPayloadLength)
Sets the maximum length of the payload body to be included in the log message. Default is 50 characters.

getMaxPayloadLength

protected int getMaxPayloadLength()
Return the maximum length of the payload body to be included in the log message.

setBeforeMessagePrefix

public void setBeforeMessagePrefix(String beforeMessagePrefix)
Set the value that should be prepended to the log message written before a request is processed.

setBeforeMessageSuffix

public void setBeforeMessageSuffix(String beforeMessageSuffix)
Set the value that should be apppended to the log message written before a request is processed.

setAfterMessagePrefix

public void setAfterMessagePrefix(String afterMessagePrefix)
Set the value that should be prepended to the log message written after a request is processed.

setAfterMessageSuffix

public void setAfterMessageSuffix(String afterMessageSuffix)
Set the value that should be appended to the log message written after a request is processed.

doFilterInternal

protected void doFilterInternal(HttpServletRequest request,
                                HttpServletResponse response,
                                FilterChain filterChain)
                         throws ServletException,
                                IOException
Forwards the request to the next filter in the chain and delegates down to the subclasses to perform the actual request logging both before and after the request is processed.

Specified by:
doFilterInternal in class OncePerRequestFilter
Throws:
ServletException
IOException
See Also:
beforeRequest(javax.servlet.http.HttpServletRequest, java.lang.String), afterRequest(javax.servlet.http.HttpServletRequest, java.lang.String)

createMessage

protected String createMessage(HttpServletRequest request,
                               String prefix,
                               String suffix)
Create a log message for the given request, prefix and suffix.

If includeQueryString is true then the inner part of the log message will take the form request_uri?query_string otherwise the message will simply be of the form request_uri.

The final message is composed of the inner part as described and the supplied prefix and suffix.

beforeRequest

protected abstract void beforeRequest(HttpServletRequest request,
                                      String message)
Concrete subclasses should implement this method to write a log message before the request is processed.

Parameters:
request - current HTTP request
message - the message to log

afterRequest

protected abstract void afterRequest(HttpServletRequest request,
                                     String message)
Concrete subclasses should implement this method to write a log message after the request is processed.

Parameters:
request - current HTTP request
message - the message to log
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


CharacterEncodingFilter

org.springframework.web.filter
Class CharacterEncodingFilter

java.lang.Object
    extended by  org.springframework.web.filter.GenericFilterBean
        extended by  org.springframework.web.filter.OncePerRequestFilter
            extended by  org.springframework.web.filter.CharacterEncodingFilter
All Implemented Interfaces:
Filter, BeanNameAware, DisposableBean, InitializingBean, ServletContextAware
public class CharacterEncodingFilter
extends OncePerRequestFilter

Servlet 2.3/2.4 Filter that allows one to specify a character encoding for requests. This is useful because current browsers typically do not set a character encoding even if specified in the HTML page or form.

This filter can either apply its encoding if the request does not already specify an encoding, or enforce this filter's encoding in any case ("forceEncoding"="true"). In the latter case, the encoding will also be applied as default response encoding on Servlet 2.4+ containers (although this will usually be overridden by a full content type set in the view).

Since:
15.03.2004
Author:
Juergen Hoeller
See Also:
setEncoding(java.lang.String), setForceEncoding(boolean), ServletRequest.setCharacterEncoding(java.lang.String), ServletResponse.setCharacterEncoding(java.lang.String)

Field Summary
Fields inherited from class org.springframework.web.filter.OncePerRequestFilter
ALREADY_FILTERED_SUFFIX
Fields inherited from class org.springframework.web.filter.GenericFilterBean
logger
Constructor Summary
CharacterEncodingFilter()
Method Summary
protected void | doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) Same contract as for doFilter, but guaranteed to be just invoked once per request.
void | setEncoding(String encoding) Set the encoding to use for requests.
void | setForceEncoding(boolean forceEncoding) Set whether the configured encoding of this filter is supposed to override existing request and response encodings.
Methods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, getAlreadyFilteredAttributeName, shouldNotFilter
Methods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setServletContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CharacterEncodingFilter

public CharacterEncodingFilter()
Method Detail

setEncoding

public void setEncoding(String encoding)
Set the encoding to use for requests. This encoding will be passed into a ServletRequest.setCharacterEncoding(java.lang.String) call.

Whether this encoding will override existing request encodings (and whether it will be applied as default response encoding as well) depends on the "forceEncoding" flag.

setForceEncoding

public void setForceEncoding(boolean forceEncoding)
Set whether the configured encoding of this filter is supposed to override existing request and response encodings.

Default is "false", i.e. do not modify the encoding if ServletRequest.getCharacterEncoding() returns a non-null value. Switch this to "true" to enforce the specified encoding in any case, applying it as default response encoding as well.

Note that the response encoding will only be set on Servlet 2.4+ containers, since Servlet 2.3 did not provide a facility for setting a default response encoding.

doFilterInternal

protected void doFilterInternal(HttpServletRequest request,
                                HttpServletResponse response,
                                FilterChain filterChain)
                         throws ServletException,
                                IOException
Description copied from class: OncePerRequestFilter
Same contract as for doFilter, but guaranteed to be just invoked once per request. Provides HttpServletRequest and HttpServletResponse arguments instead of the default ServletRequest and ServletResponse ones.

Specified by:
doFilterInternal in class OncePerRequestFilter
Throws:
ServletException
IOException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CommonsRequestLoggingFilter

org.springframework.web.filter
Class CommonsRequestLoggingFilter

java.lang.Object
    extended by  org.springframework.web.filter.GenericFilterBean
        extended by  org.springframework.web.filter.OncePerRequestFilter
            extended by  org.springframework.web.filter.AbstractRequestLoggingFilter
                extended by  org.springframework.web.filter.CommonsRequestLoggingFilter
All Implemented Interfaces:
Filter, BeanNameAware, DisposableBean, InitializingBean, ServletContextAware
public class CommonsRequestLoggingFilter
extends AbstractRequestLoggingFilter

Simple request logging filter that writes the request URI (and optionally the query string) to the Commons Log.

Since:
1.2.5
Author:
Rob Harrop
See Also:
AbstractRequestLoggingFilter.setIncludeQueryString(boolean),
AbstractRequestLoggingFilter.setBeforeMessagePrefix(java.lang.String),
AbstractRequestLoggingFilter.setBeforeMessageSuffix(java.lang.String),
AbstractRequestLoggingFilter.setAfterMessagePrefix(java.lang.String),
AbstractRequestLoggingFilter.setAfterMessageSuffix(java.lang.String),
Log.debug(Object)

Field Summary
Fields inherited from class org.springframework.web.filter.AbstractRequestLoggingFilter
DEFAULT_AFTER_MESSAGE_PREFIX, DEFAULT_AFTER_MESSAGE_SUFFIX, DEFAULT_BEFORE_MESSAGE_PREFIX, DEFAULT_BEFORE_MESSAGE_SUFFIX
Fields inherited from class org.springframework.web.filter.OncePerRequestFilter
ALREADY_FILTERED_SUFFIX
Fields inherited from class org.springframework.web.filter.GenericFilterBean
logger
Constructor Summary
CommonsRequestLoggingFilter()
Method Summary
protected void | afterRequest(HttpServletRequest request, String message) Writes a log message after the request is processed.
protected void | beforeRequest(HttpServletRequest request, String message) Writes a log message before the request is processed.
Methods inherited from class org.springframework.web.filter.AbstractRequestLoggingFilter
createMessage, doFilterInternal, getMaxPayloadLength, isIncludeClientInfo, isIncludePayload, isIncludeQueryString, setAfterMessagePrefix, setAfterMessageSuffix, setBeforeMessagePrefix, setBeforeMessageSuffix, setIncludeClientInfo, setIncludePayload, setIncludeQueryString, setMaxPayloadLength
Methods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, getAlreadyFilteredAttributeName, shouldNotFilter
Methods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setServletContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CommonsRequestLoggingFilter

public CommonsRequestLoggingFilter()
Method Detail

beforeRequest

protected void beforeRequest(HttpServletRequest request,
                             String message)
Writes a log message before the request is processed.

Specified by:
beforeRequest in class AbstractRequestLoggingFilter
Parameters:
request - current HTTP request
message - the message to log

afterRequest

protected void afterRequest(HttpServletRequest request,
                            String message)
Writes a log message after the request is processed.

Specified by:
afterRequest in class AbstractRequestLoggingFilter
Parameters:
request - current HTTP request
message - the message to log
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DelegatingFilterProxy

org.springframework.web.filter
Class DelegatingFilterProxy

java.lang.Object
    extended by  org.springframework.web.filter.GenericFilterBean
        extended by  org.springframework.web.filter.DelegatingFilterProxy
All Implemented Interfaces:
Filter, BeanNameAware, DisposableBean, InitializingBean, ServletContextAware
public class DelegatingFilterProxy
extends GenericFilterBean

Proxy for a standard Servlet 2.3 Filter, delegating to a Spring-managed bean that implements the Filter interface. Supports a "targetBeanName" filter init-param in web.xml, specifying the name of the target bean in the Spring application context.

web.xml will usually contain a DelegatingFilterProxy definition, with the specified filter-name corresponding to a bean name in Spring's root application context. All calls to the filter proxy will then be delegated to that bean in the Spring context, which is required to implement the standard Servlet 2.3 Filter interface.

This approach is particularly useful for Filter implementation with complex setup needs, allowing to apply the full Spring bean definition machinery to Filter instances. Alternatively, consider standard Filter setup in combination with looking up service beans from the Spring root application context.

NOTE: The lifecycle methods defined by the Servlet Filter interface will by default not be delegated to the target bean, relying on the Spring application context to manage the lifecycle of that bean. Specifying the "targetFilterLifecycle" filter init-param as "true" will enforce invocation of the Filter.init and Filter.destroy lifecycle methods on the target bean, letting the servlet container manage the filter lifecycle.

This class is inspired by Acegi Security's FilterToBeanProxy class, written by Ben Alex.

Since:
1.2
Author:
Juergen Hoeller, Sam Brannen
See Also:
setTargetBeanName(java.lang.String),
setTargetFilterLifecycle(boolean),
Filter.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain),
Filter.init(javax.servlet.FilterConfig),
Filter.destroy()

Field Summary
Fields inherited from class org.springframework.web.filter.GenericFilterBean
logger
Constructor Summary
DelegatingFilterProxy()
Method Summary
void | destroy() Subclasses may override this to perform custom filter shutdown.
protected void | destroyDelegate(Filter delegate) Destroy the Filter delegate.
void | doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain)
protected WebApplicationContext | findWebApplicationContext() Retrieve a WebApplicationContext from the ServletContext attribute with the configured name.
String | getContextAttribute() Return the name of the ServletContext attribute which should be used to retrieve the WebApplicationContext from which to load the delegate Filter bean.
protected String | getTargetBeanName() Return the name of the target bean in the Spring application context.
protected Filter | initDelegate(WebApplicationContext wac) Initialize the Filter delegate, defined as bean the given Spring application context.
protected void | initFilterBean() Subclasses may override this to perform custom initialization.
protected void | invokeDelegate(Filter delegate, ServletRequest request, ServletResponse response, FilterChain filterChain) Actually invoke the delegate Filter with the given request and response.
protected boolean | isTargetFilterLifecycle() Return whether to invoke the Filter.init and Filter.destroy lifecycle methods on the target bean.
void | setContextAttribute(String contextAttribute) Set the name of the ServletContext attribute which should be used to retrieve the WebApplicationContext from which to load the delegate Filter bean.
void | setTargetBeanName(String targetBeanName) Set the name of the target bean in the Spring application context.
void | setTargetFilterLifecycle(boolean targetFilterLifecycle) Set whether to invoke the Filter.init and Filter.destroy lifecycle methods on the target bean.
Methods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, setBeanName, setServletContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DelegatingFilterProxy

public DelegatingFilterProxy()
Method Detail

setContextAttribute

public void setContextAttribute(String contextAttribute)
Set the name of the ServletContext attribute which should be used to retrieve the WebApplicationContext from which to load the delegate Filter bean.

getContextAttribute

public String getContextAttribute()
Return the name of the ServletContext attribute which should be used to retrieve the WebApplicationContext from which to load the delegate Filter bean.

setTargetBeanName

public void setTargetBeanName(String targetBeanName)
Set the name of the target bean in the Spring application context. The target bean must implement the standard Servlet 2.3 Filter interface.

By default, the filter-name as specified for the DelegatingFilterProxy in web.xml will be used.

getTargetBeanName

protected String getTargetBeanName()
Return the name of the target bean in the Spring application context.

setTargetFilterLifecycle

public void setTargetFilterLifecycle(boolean targetFilterLifecycle)
Set whether to invoke the Filter.init and Filter.destroy lifecycle methods on the target bean.

Default is "false"; target beans usually rely on the Spring application context for managing their lifecycle. Setting this flag to "true" means that the servlet container will control the lifecycle of the target Filter, with this proxy delegating the corresponding calls.

isTargetFilterLifecycle

protected boolean isTargetFilterLifecycle()
Return whether to invoke the Filter.init and Filter.destroy lifecycle methods on the target bean.

initFilterBean

protected void initFilterBean()
                       throws ServletException
Description copied from class: GenericFilterBean
Subclasses may override this to perform custom initialization. All bean properties of this filter will have been set before this method is invoked.

Note: This method will be called from standard filter initialization as well as filter bean initialization in a Spring application context. Filter name and ServletContext will be available in both cases.

This default implementation is empty.

Overrides:
initFilterBean in class GenericFilterBean
Throws:
ServletException - if subclass initialization fails
See Also:
GenericFilterBean.getFilterName(), GenericFilterBean.getServletContext()

doFilter

public void doFilter(ServletRequest request,
                     ServletResponse response,
                     FilterChain filterChain)
              throws ServletException,
                     IOException
Throws:
ServletException
IOException

destroy

public void destroy()
Description copied from class: GenericFilterBean
Subclasses may override this to perform custom filter shutdown.

Note: This method will be called from standard filter destruction as well as filter bean destruction in a Spring application context.

This default implementation is empty.

Specified by:
destroy in interface Filter
Specified by:
destroy in interface DisposableBean
Overrides:
destroy in class GenericFilterBean

findWebApplicationContext

protected WebApplicationContext findWebApplicationContext()
Retrieve a WebApplicationContext from the ServletContext attribute with the configured name. The WebApplicationContext must have already been loaded and stored in the ServletContext before this filter gets initialized (or invoked).

Subclasses may override this method to provide a different WebApplicationContext retrieval strategy.

Returns:
the WebApplicationContext for this proxy, or null if not found
See Also:
getContextAttribute()

initDelegate

protected Filter initDelegate(WebApplicationContext wac)
                       throws ServletException
Initialize the Filter delegate, defined as bean the given Spring application context.

The default implementation fetches the bean from the application context and calls the standard Filter.init method on it, passing in the FilterConfig of this Filter proxy.

Parameters:
wac - the root application context
Returns:
the initialized delegate Filter
Throws:
ServletException - if thrown by the Filter
See Also:
getTargetBeanName(),
isTargetFilterLifecycle(),
GenericFilterBean.getFilterConfig(),
Filter.init(javax.servlet.FilterConfig)

invokeDelegate

protected void invokeDelegate(Filter delegate,
                              ServletRequest request,
                              ServletResponse response,
                              FilterChain filterChain)
                       throws ServletException,
                              IOException
Actually invoke the delegate Filter with the given request and response.

Parameters:
delegate - the delegate Filter
request - the current HTTP request
response - the current HTTP response
filterChain - the current FilterChain
Throws:
ServletException - if thrown by the Filter
IOException - if thrown by the Filter

destroyDelegate

protected void destroyDelegate(Filter delegate)
Destroy the Filter delegate. Default implementation simply calls Filter.destroy on it.

Parameters:
delegate - the Filter delegate (never null)
See Also:
isTargetFilterLifecycle(), Filter.destroy()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


GenericFilterBean

org.springframework.web.filter
Class GenericFilterBean

java.lang.Object
    extended by  org.springframework.web.filter.GenericFilterBean
All Implemented Interfaces:
Filter, BeanNameAware, DisposableBean, InitializingBean, ServletContextAware
Direct Known Subclasses:
DelegatingFilterProxy, OncePerRequestFilter
public abstract class GenericFilterBean
extends Object
implements Filter, BeanNameAware, ServletContextAware, InitializingBean, DisposableBean

Simple base implementation of Filter which treats its config parameters (init-param entries within the filter tag in web.xml) as bean properties.

A handy superclass for any type of filter. Type conversion of config parameters is automatic, with the corresponding setter method getting invoked with the converted value. It is also possible for subclasses to specify required properties. Parameters without matching bean property setter will simply be ignored.

This filter leaves actual filtering to subclasses, which have to implement the Filter.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) method.

This generic filter base class has no dependency on the Spring ApplicationContext concept. Filters usually don't load their own context but rather access service beans from the Spring root application context, accessible via the filter's ServletContext (see WebApplicationContextUtils).

Since:
06.12.2003
Author:
Juergen Hoeller
See Also:
addRequiredProperty(java.lang.String),
initFilterBean(),
Filter.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
GenericFilterBean()
Method Summary
protected  void addRequiredProperty(String property)
Subclasses can invoke this method to specify that this property (which must match a JavaBean property they expose) is mandatory, and must be supplied as a config parameter.
 void afterPropertiesSet()
Calls the initFilterBean() method that might contain custom initialization of a subclass.
 void destroy()
Subclasses may override this to perform custom filter shutdown.
 FilterConfig getFilterConfig()
Make the FilterConfig of this filter available, if any.
protected  String getFilterName()
Make the name of this filter available to subclasses.
protected  ServletContext getServletContext()
Make the ServletContext of this filter available to subclasses.
 void init(FilterConfig filterConfig)
Standard way of initializing this filter.
protected  void initBeanWrapper(BeanWrapper bw)
Initialize the BeanWrapper for this GenericFilterBean, possibly with custom editors.
protected  void initFilterBean()
Subclasses may override this to perform custom initialization.
 void setBeanName(String beanName)
Stores the bean name as defined in the Spring bean factory.
 void setServletContext(ServletContext servletContext)
Stores the ServletContext that the bean factory runs in.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.servlet.Filter
doFilter

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

GenericFilterBean

public GenericFilterBean()
Method Detail

setBeanName

public final void setBeanName(String beanName)
Stores the bean name as defined in the Spring bean factory.

Only relevant in case of initialization as bean, to have a name as fallback to the filter name usually provided by a FilterConfig instance.

Specified by:
setBeanName in interface BeanNameAware
Parameters:
beanName - the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use the BeanFactoryUtils.originalBeanName(String) method to extract the original bean name (without suffix), if desired.
See Also:
BeanNameAware, getFilterName()

setServletContext

public final void setServletContext(ServletContext servletContext)
Stores the ServletContext that the bean factory runs in.

Only relevant in case of initialization as bean, to have a ServletContext as fallback to the context usually provided by a FilterConfig instance.

Specified by:
setServletContext in interface ServletContextAware
Parameters:
servletContext - ServletContext object to be used by this object
See Also:
ServletContextAware, getServletContext()

afterPropertiesSet

public void afterPropertiesSet()
                        throws ServletException
Calls the initFilterBean() method that might contain custom initialization of a subclass.

Only relevant in case of initialization as bean, where the standard init(FilterConfig) method won't be called.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
ServletException
See Also:
initFilterBean(), init(javax.servlet.FilterConfig)

addRequiredProperty

protected final void addRequiredProperty(String property)
Subclasses can invoke this method to specify that this property (which must match a JavaBean property they expose) is mandatory, and must be supplied as a config parameter. This should be called from the constructor of a subclass.

This method is only relevant in case of traditional initialization driven by a FilterConfig instance.

Parameters:
property - name of the required property

init

public final void init(FilterConfig filterConfig)
                throws ServletException
Standard way of initializing this filter. Map config parameters onto bean properties of this filter, and invoke subclass initialization.

Specified by:
init in interface Filter
Parameters:
filterConfig - the configuration for this filter
Throws:
ServletException - if bean properties are invalid (or required properties are missing), or if subclass initialization fails.
See Also:
initFilterBean()

initBeanWrapper

protected void initBeanWrapper(BeanWrapper bw)
                        throws BeansException
Initialize the BeanWrapper for this GenericFilterBean, possibly with custom editors.

This default implementation is empty.

Parameters:
bw - the BeanWrapper to initialize
Throws:
BeansException - if thrown by BeanWrapper methods
See Also:
PropertyEditorRegistry.registerCustomEditor(java.lang.Class, java.beans.PropertyEditor)

getFilterConfig

public final FilterConfig getFilterConfig()
Make the FilterConfig of this filter available, if any. Analogous to GenericServlet's getServletConfig().

Public to resemble the getFilterConfig() method of the Servlet Filter version that shipped with WebLogic 6.1.

Returns:
the FilterConfig instance, or null if none available
See Also:
GenericServlet.getServletConfig()

getFilterName

protected final String getFilterName()
Make the name of this filter available to subclasses. Analogous to GenericServlet's getServletName().

Takes the FilterConfig's filter name by default. If initialized as bean in a Spring application context, it falls back to the bean name as defined in the bean factory.

Returns:
the filter name, or null if none available
See Also:
GenericServlet.getServletName(),
FilterConfig.getFilterName(),
setBeanName(java.lang.String)

getServletContext

protected final ServletContext getServletContext()
Make the ServletContext of this filter available to subclasses. Analogous to GenericServlet's getServletContext().

Takes the FilterConfig's ServletContext by default. If initialized as bean in a Spring application context, it falls back to the ServletContext that the bean factory runs in.

Returns:
the ServletContext instance, or null if none available
See Also:
GenericServlet.getServletContext(),
FilterConfig.getServletContext(),
setServletContext(javax.servlet.ServletContext)

initFilterBean

protected void initFilterBean()
                       throws ServletException
Subclasses may override this to perform custom initialization. All bean properties of this filter will have been set before this method is invoked.

Note: This method will be called from standard filter initialization as well as filter bean initialization in a Spring application context. Filter name and ServletContext will be available in both cases.

This default implementation is empty.

Throws:
ServletException - if subclass initialization fails
See Also:
getFilterName(), getServletContext()

destroy

public void destroy()
Subclasses may override this to perform custom filter shutdown.

Note: This method will be called from standard filter destruction as well as filter bean destruction in a Spring application context.

This default implementation is empty.

Specified by:
destroy in interface Filter
Specified by:
destroy in interface DisposableBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HiddenHttpMethodFilter

org.springframework.web.filter
Class HiddenHttpMethodFilter

java.lang.Object
    extended by  org.springframework.web.filter.GenericFilterBean
        extended by  org.springframework.web.filter.OncePerRequestFilter
            extended by  org.springframework.web.filter.HiddenHttpMethodFilter
All Implemented Interfaces:
Filter, BeanNameAware, DisposableBean, InitializingBean, ServletContextAware
public class HiddenHttpMethodFilter
extends OncePerRequestFilter

Filter that converts posted method parameters into HTTP methods, retrievable via HttpServletRequest.getMethod(). Since browsers currently only support GET and POST, a common technique - used by the Prototype library, for instance - is to use a normal POST with an additional hidden form field (_method) to pass the "real" HTTP method. This filter reads that parameter, and changes of HttpServletRequestWrapper.getMethod() accordingly.

The name of the request parameter defaults to _method, but can be changed via the methodParam property.

NOTE: This filter needs to run after multipart processing in case of a multipart POST request, due to its inherent need for checking a POST body parameter. So typically, put a Spring MultipartFilter before this HiddenHttpMethodFilter in your web.xml filter chain.

Since:
3.0
Author:
Arjen Poutsma

Field Summary
static String DEFAULT_METHOD_PARAM
Default method parameter: _method
Fields inherited from class org.springframework.web.filter.OncePerRequestFilter
ALREADY_FILTERED_SUFFIX
Fields inherited from class org.springframework.web.filter.GenericFilterBean
logger
Constructor Summary
HiddenHttpMethodFilter()
Method Summary
protected void | doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) Same contract as for doFilter, but guaranteed to be just invoked once per request.
void | setMethodParam(String methodParam) Set the parameter name to look for HTTP methods.
Methods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, getAlreadyFilteredAttributeName, shouldNotFilter
Methods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setServletContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_METHOD_PARAM

public static final String DEFAULT_METHOD_PARAM
Default method parameter: _method

See Also:
Constant Field Values
Constructor Detail

HiddenHttpMethodFilter

public HiddenHttpMethodFilter()
Method Detail

setMethodParam

public void setMethodParam(String methodParam)
Set the parameter name to look for HTTP methods.

See Also:
DEFAULT_METHOD_PARAM

doFilterInternal

protected void doFilterInternal(HttpServletRequest request,
                                HttpServletResponse response,
                                FilterChain filterChain)
                         throws ServletException,
                                IOException
Description copied from class: OncePerRequestFilter
Same contract as for doFilter, but guaranteed to be just invoked once per request. Provides HttpServletRequest and HttpServletResponse arguments instead of the default ServletRequest and ServletResponse ones.

Specified by:
doFilterInternal in class OncePerRequestFilter
Throws:
ServletException
IOException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Log4jNestedDiagnosticContextFilter

org.springframework.web.filter
Class Log4jNestedDiagnosticContextFilter

java.lang.Object
    extended by  org.springframework.web.filter.GenericFilterBean
        extended by  org.springframework.web.filter.OncePerRequestFilter
            extended by  org.springframework.web.filter.AbstractRequestLoggingFilter
                extended by  org.springframework.web.filter.Log4jNestedDiagnosticContextFilter
All Implemented Interfaces:
Filter, BeanNameAware, DisposableBean, InitializingBean, ServletContextAware
public class Log4jNestedDiagnosticContextFilter
extends AbstractRequestLoggingFilter

Request logging filter that adds the request log message to the Log4J nested diagnostic context (NDC) before the request is processed, removing it again after the request is processed.

Since:
1.2.5
Author:
Juergen Hoeller, Rob Harrop
See Also:
AbstractRequestLoggingFilter.setIncludeQueryString(boolean),
AbstractRequestLoggingFilter.setBeforeMessagePrefix(java.lang.String),
AbstractRequestLoggingFilter.setBeforeMessageSuffix(java.lang.String),
AbstractRequestLoggingFilter.setAfterMessagePrefix(java.lang.String),
AbstractRequestLoggingFilter.setAfterMessageSuffix(java.lang.String),
NDC.push(String),
NDC.pop()

Field Summary
protected  Logger log4jLogger
Logger available to subclasses
Fields inherited from class org.springframework.web.filter.AbstractRequestLoggingFilter
DEFAULT_AFTER_MESSAGE_PREFIX, DEFAULT_AFTER_MESSAGE_SUFFIX, DEFAULT_BEFORE_MESSAGE_PREFIX, DEFAULT_BEFORE_MESSAGE_SUFFIX
Fields inherited from class org.springframework.web.filter.OncePerRequestFilter
ALREADY_FILTERED_SUFFIX
Fields inherited from class org.springframework.web.filter.GenericFilterBean
logger
Constructor Summary
Log4jNestedDiagnosticContextFilter()
Method Summary
protected void | afterRequest(HttpServletRequest request, String message) Removes the log message from the Log4J NDC after the request is processed and logs the after-request message through Log4J.
protected void | beforeRequest(HttpServletRequest request, String message) Logs the before-request message through Log4J and adds a message the Log4J NDC before the request is processed.
protected String | getNestedDiagnosticContextMessage(HttpServletRequest request) Determine the message to be pushed onto the Log4J nested diagnostic context.
Methods inherited from class org.springframework.web.filter.AbstractRequestLoggingFilter
createMessage, doFilterInternal, getMaxPayloadLength, isIncludeClientInfo, isIncludePayload, isIncludeQueryString, setAfterMessagePrefix, setAfterMessageSuffix, setBeforeMessagePrefix, setBeforeMessageSuffix, setIncludeClientInfo, setIncludePayload, setIncludeQueryString, setMaxPayloadLength
Methods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, getAlreadyFilteredAttributeName, shouldNotFilter
Methods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setServletContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

log4jLogger

protected final Logger log4jLogger
Logger available to subclasses

Constructor Detail

Log4jNestedDiagnosticContextFilter

public Log4jNestedDiagnosticContextFilter()
Method Detail

beforeRequest

protected void beforeRequest(HttpServletRequest request,
                             String message)
Logs the before-request message through Log4J and adds a message the Log4J NDC before the request is processed.

Specified by:
beforeRequest in class AbstractRequestLoggingFilter
Parameters:
request - current HTTP request
message - the message to log

getNestedDiagnosticContextMessage

protected String getNestedDiagnosticContextMessage(HttpServletRequest request)
Determine the message to be pushed onto the Log4J nested diagnostic context.

Default is a plain request log message without prefix or suffix.

Parameters:
request - current HTTP request
Returns:
the message to be pushed onto the Log4J NDC
See Also:
AbstractRequestLoggingFilter.createMessage(javax.servlet.http.HttpServletRequest, java.lang.String, java.lang.String)

afterRequest

protected void afterRequest(HttpServletRequest request,
                            String message)
Removes the log message from the Log4J NDC after the request is processed and logs the after-request message through Log4J.

Specified by:
afterRequest in class AbstractRequestLoggingFilter
Parameters:
request - current HTTP request
message - the message to log
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OncePerRequestFilter

org.springframework.web.filter
Class OncePerRequestFilter

java.lang.Object
    extended by  org.springframework.web.filter.GenericFilterBean
        extended by  org.springframework.web.filter.OncePerRequestFilter
All Implemented Interfaces:
Filter, BeanNameAware, DisposableBean, InitializingBean, ServletContextAware
Direct Known Subclasses:
AbstractRequestLoggingFilter, CharacterEncodingFilter, HiddenHttpMethodFilter, MultipartFilter, OpenEntityManagerInViewFilter, OpenPersistenceManagerInViewFilter, OpenSessionInViewFilter, RequestContextFilter, ShallowEtagHeaderFilter
public abstract class OncePerRequestFilter
extends GenericFilterBean

Filter base class that guarantees to be just executed once per request, on any servlet container. It provides a doFilterInternal(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain) method with HttpServletRequest and HttpServletResponse arguments.

The getAlreadyFilteredAttributeName() method determines how to identify that a request is already filtered. The default implementation is based on the configured name of the concrete filter instance.

Since:
06.12.2003
Author:
Juergen Hoeller

Field Summary
static String ALREADY_FILTERED_SUFFIX
Suffix that gets appended to the filter name for the "already filtered" request attribute.
Fields inherited from class org.springframework.web.filter.GenericFilterBean
logger
Constructor Summary
OncePerRequestFilter()
Method Summary
void | doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) This doFilter implementation stores a request attribute for "already filtered", proceeding without filtering again if the attribute is already there.
protected abstract void | doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) Same contract as for doFilter, but guaranteed to be just invoked once per request.
protected String | getAlreadyFilteredAttributeName() Return the name of the request attribute that identifies that a request is already filtered.
protected boolean | shouldNotFilter(HttpServletRequest request) Can be overridden in subclasses for custom filtering control, returning true to avoid filtering of the given request.
Methods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setServletContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

ALREADY_FILTERED_SUFFIX

public static final String ALREADY_FILTERED_SUFFIX
Suffix that gets appended to the filter name for the "already filtered" request attribute.

See Also:
getAlreadyFilteredAttributeName(), Constant Field Values
Constructor Detail

OncePerRequestFilter

public OncePerRequestFilter()
Method Detail

doFilter

public final void doFilter(ServletRequest request,
                           ServletResponse response,
                           FilterChain filterChain)
                    throws ServletException,
                           IOException
This doFilter implementation stores a request attribute for "already filtered", proceeding without filtering again if the attribute is already there.

Throws:
ServletException
IOException
See Also:
getAlreadyFilteredAttributeName(),
shouldNotFilter(javax.servlet.http.HttpServletRequest),
doFilterInternal(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain)

getAlreadyFilteredAttributeName

protected String getAlreadyFilteredAttributeName()
Return the name of the request attribute that identifies that a request is already filtered.

Default implementation takes the configured name of the concrete filter instance and appends ".FILTERED". If the filter is not fully initialized, it falls back to its class name.

See Also:
GenericFilterBean.getFilterName(), ALREADY_FILTERED_SUFFIX

shouldNotFilter

protected boolean shouldNotFilter(HttpServletRequest request)
                           throws ServletException
Can be overridden in subclasses for custom filtering control, returning true to avoid filtering of the given request.

The default implementation always returns false.

Parameters:
request - current HTTP request
Returns:
whether the given request should not be filtered
Throws:
ServletException - in case of errors

doFilterInternal

protected abstract void doFilterInternal(HttpServletRequest request,
                                         HttpServletResponse response,
                                         FilterChain filterChain)
                                  throws ServletException,
                                         IOException
Same contract as for doFilter, but guaranteed to be just invoked once per request. Provides HttpServletRequest and HttpServletResponse arguments instead of the default ServletRequest and ServletResponse ones.

Throws:
ServletException
IOException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RequestContextFilter

org.springframework.web.filter
Class RequestContextFilter

java.lang.Object
    extended by  org.springframework.web.filter.GenericFilterBean
        extended by  org.springframework.web.filter.OncePerRequestFilter
            extended by  org.springframework.web.filter.RequestContextFilter
All Implemented Interfaces:
Filter, BeanNameAware, DisposableBean, InitializingBean, ServletContextAware
public class RequestContextFilter
extends OncePerRequestFilter

Servlet 2.3 Filter that exposes the request to the current thread, through both LocaleContextHolder and RequestContextHolder. To be registered as filter in web.xml.

Alternatively, Spring's RequestContextListener and Spring's DispatcherServlet also expose the same request context to the current thread.

This filter is mainly for use with third-party servlets, e.g. the JSF FacesServlet. Within Spring's own web support, DispatcherServlet's processing is perfectly sufficient.

Since:
2.0
Author:
Juergen Hoeller, Rod Johnson
See Also:
LocaleContextHolder, RequestContextHolder, RequestContextListener, DispatcherServlet

Field Summary
Fields inherited from class org.springframework.web.filter.OncePerRequestFilter
ALREADY_FILTERED_SUFFIX
Fields inherited from class org.springframework.web.filter.GenericFilterBean
logger
Constructor Summary
RequestContextFilter()
Method Summary
protected void | doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) Same contract as for doFilter, but guaranteed to be just invoked once per request.
void | setThreadContextInheritable(boolean threadContextInheritable) Set whether to expose the LocaleContext and RequestAttributes as inheritable for child threads (using an InheritableThreadLocal).
Methods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, getAlreadyFilteredAttributeName, shouldNotFilter
Methods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setServletContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

RequestContextFilter

public RequestContextFilter()
Method Detail

setThreadContextInheritable

public void setThreadContextInheritable(boolean threadContextInheritable)
Set whether to expose the LocaleContext and RequestAttributes as inheritable for child threads (using an InheritableThreadLocal).

Default is "false", to avoid side effects on spawned background threads. Switch this to "true" to enable inheritance for custom child threads which are spawned during request processing and only used for this request (that is, ending after their initial task, without reuse of the thread).

WARNING: Do not use inheritance for child threads if you are accessing a thread pool which is configured to potentially add new threads on demand (e.g. a JDK ThreadPoolExecutor), since this will expose the inherited context to such a pooled thread.

doFilterInternal

protected void doFilterInternal(HttpServletRequest request,
                                HttpServletResponse response,
                                FilterChain filterChain)
                         throws ServletException,
                                IOException
Description copied from class: OncePerRequestFilter
Same contract as for doFilter, but guaranteed to be just invoked once per request. Provides HttpServletRequest and HttpServletResponse arguments instead of the default ServletRequest and ServletResponse ones.

Specified by:
doFilterInternal in class OncePerRequestFilter
Throws:
ServletException
IOException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletContextRequestLoggingFilter

org.springframework.web.filter
Class ServletContextRequestLoggingFilter

java.lang.Object
    extended by  org.springframework.web.filter.GenericFilterBean
        extended by  org.springframework.web.filter.OncePerRequestFilter
            extended by  org.springframework.web.filter.AbstractRequestLoggingFilter
                extended by  org.springframework.web.filter.ServletContextRequestLoggingFilter
All Implemented Interfaces:
Filter, BeanNameAware, DisposableBean, InitializingBean, ServletContextAware
public class ServletContextRequestLoggingFilter
extends AbstractRequestLoggingFilter

Simple request logging filter that writes the request URI (and optionally the query string) to the ServletContext log.

Since:
1.2.5
Author:
Juergen Hoeller
See Also:
AbstractRequestLoggingFilter.setIncludeQueryString(boolean),
AbstractRequestLoggingFilter.setBeforeMessagePrefix(java.lang.String),
AbstractRequestLoggingFilter.setBeforeMessageSuffix(java.lang.String),
AbstractRequestLoggingFilter.setAfterMessagePrefix(java.lang.String),
AbstractRequestLoggingFilter.setAfterMessageSuffix(java.lang.String),
ServletContext.log(String)

Field Summary
Fields inherited from class org.springframework.web.filter.AbstractRequestLoggingFilter
DEFAULT_AFTER_MESSAGE_PREFIX, DEFAULT_AFTER_MESSAGE_SUFFIX, DEFAULT_BEFORE_MESSAGE_PREFIX, DEFAULT_BEFORE_MESSAGE_SUFFIX
Fields inherited from class org.springframework.web.filter.OncePerRequestFilter
ALREADY_FILTERED_SUFFIX
Fields inherited from class org.springframework.web.filter.GenericFilterBean
logger
Constructor Summary
ServletContextRequestLoggingFilter()
Method Summary
protected void | afterRequest(HttpServletRequest request, String message) Writes a log message after the request is processed.
protected void | beforeRequest(HttpServletRequest request, String message) Writes a log message before the request is processed.
Methods inherited from class org.springframework.web.filter.AbstractRequestLoggingFilter
createMessage, doFilterInternal, getMaxPayloadLength, isIncludeClientInfo, isIncludePayload, isIncludeQueryString, setAfterMessagePrefix, setAfterMessageSuffix, setBeforeMessagePrefix, setBeforeMessageSuffix, setIncludeClientInfo, setIncludePayload, setIncludeQueryString, setMaxPayloadLength
Methods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, getAlreadyFilteredAttributeName, shouldNotFilter
Methods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setServletContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ServletContextRequestLoggingFilter

public ServletContextRequestLoggingFilter()
Method Detail

beforeRequest

protected void beforeRequest(HttpServletRequest request,
                             String message)
Writes a log message before the request is processed.

Specified by:
beforeRequest in class AbstractRequestLoggingFilter
Parameters:
request - current HTTP request
message - the message to log

afterRequest

protected void afterRequest(HttpServletRequest request,
                            String message)
Writes a log message after the request is processed.

Specified by:
afterRequest in class AbstractRequestLoggingFilter
Parameters:
request - current HTTP request
message - the message to log
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ShallowEtagHeaderFilter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.filter
Class ShallowEtagHeaderFilter

java.lang.Object
    extended by  org.springframework.web.filter.GenericFilterBean
        extended by  org.springframework.web.filter.OncePerRequestFilter
            extended by  org.springframework.web.filter.ShallowEtagHeaderFilter
All Implemented Interfaces:
Filter, BeanNameAware, DisposableBean, InitializingBean, ServletContextAware
public class ShallowEtagHeaderFilter
extends OncePerRequestFilter

Filter that generates an ETag value based on the content on the response. This ETag is compared to the If-None-Match header of the request. If these headers are equal, the resonse content is not sent, but rather a 304 "Not Modified" status.

Since the ETag is based on the response content, the response (or View) is still rendered. As such, this filter only saves bandwidth, not server performance.

Since:
3.0
Author:
Arjen Poutsma

Field Summary
Fields inherited from class org.springframework.web.filter.OncePerRequestFilter
ALREADY_FILTERED_SUFFIX
Fields inherited from class org.springframework.web.filter.GenericFilterBean
logger
Constructor Summary
ShallowEtagHeaderFilter()
Method Summary
protected void | doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) Same contract as for doFilter, but guaranteed to be just invoked once per request.
protected String | generateETagHeaderValue(byte[] bytes) Generate the ETag header value from the given response body byte array.
protected boolean | isEligibleForEtag(HttpServletRequest request, HttpServletResponse response, int responseStatusCode, byte[] responseBody) Indicates whether the given request and response are eligible for ETag generation.
Methods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, getAlreadyFilteredAttributeName, shouldNotFilter
Methods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setServletContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ShallowEtagHeaderFilter

public ShallowEtagHeaderFilter()
Method Detail

doFilterInternal

protected void doFilterInternal(HttpServletRequest request,
                                HttpServletResponse response,
                                FilterChain filterChain)
                         throws ServletException,
                                IOException
Description copied from class: OncePerRequestFilter
Same contract as for doFilter, but guaranteed to be just invoked once per request. Provides HttpServletRequest and HttpServletResponse arguments instead of the default ServletRequest and ServletResponse ones.

Specified by:
doFilterInternal in class OncePerRequestFilter
Throws:
ServletException
IOException

isEligibleForEtag

protected boolean isEligibleForEtag(HttpServletRequest request,
                                    HttpServletResponse response,
                                    int responseStatusCode,
                                    byte[] responseBody)
Indicates whether the given request and response are eligible for ETag generation.

Default implementation returns true for response status codes in the 2xx series.

Parameters:
request - the HTTP request
response - the HTTP response
responseStatusCode - the HTTP response status code
responseBody - the response body
Returns:
true if eligible for ETag generation; false otherwise

generateETagHeaderValue

protected String generateETagHeaderValue(byte[] bytes)
Generate the ETag header value from the given response body byte array.

The default implementation generates an MD5 hash.

Parameters:
bytes - the response bdoy as byte array
Returns:
the ETag header value
See Also:
DigestUtils
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.jsf

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.jsf

Support classes for integrating a JSF web tier with a Spring middle tier which is hosted in a Spring root WebApplicationContext.

See:
Description

Class Summary
DecoratingNavigationHandler | Base class for JSF NavigationHandler implementations that want to be capable of decorating an original NavigationHandler.
DelegatingNavigationHandlerProxy | JSF NavigationHandler implementation that delegates to a NavigationHandler bean obtained from the Spring root WebApplicationContext.
DelegatingPhaseListenerMulticaster | JSF PhaseListener implementation that delegates to one or more Spring-managed PhaseListener beans coming from the Spring root WebApplicationContext.
DelegatingVariableResolver | JSF 1.1 VariableResolver that first delegates to the original resolver of the underlying JSF implementation (for resolving managed-bean objects as defined in faces-config.xml as well as well-known implicit EL attributes), then to the Spring root WebApplicationContext (for resolving Spring beans).
FacesContextUtils | Convenience methods to retrieve the root WebApplicationContext for a given FacesContext.
SpringBeanVariableResolver | This is a subclass of the JSF 1.1 DelegatingVariableResolver, letting Spring bean definitions override other attributes of the same name.
WebApplicationContextVariableResolver | Special JSF 1.1 VariableResolver that exposes the Spring WebApplicationContext instance under a variable named "webApplicationContext".

Package org.springframework.web.jsf Description

Support classes for integrating a JSF web tier with a Spring middle tier which is hosted in a Spring root WebApplicationContext.

Supports easy access to beans in the Spring root WebApplicationContext from JSF EL expressions, for example in property values of JSF-managed beans.


org.springframework.web.jsf Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.jsf

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.web.jsf.DelegatingPhaseListenerMulticaster (implements javax.faces.event.PhaseListener)
    • org.springframework.web.jsf.FacesContextUtils
    • javax.faces.application.NavigationHandler
      • org.springframework.web.jsf.DecoratingNavigationHandler
      • org.springframework.web.jsf.DelegatingNavigationHandlerProxy
    • javax.faces.el.VariableResolver
      • org.springframework.web.jsf.DelegatingVariableResolver
        • org.springframework.web.jsf.SpringBeanVariableResolver
      • org.springframework.web.jsf.WebApplicationContextVariableResolver


DecoratingNavigationHandler

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.jsf
Class DecoratingNavigationHandler

java.lang.Object
    extended by  javax.faces.application.NavigationHandler
        extended by  org.springframework.web.jsf.DecoratingNavigationHandler

public abstract class DecoratingNavigationHandler
extends javax.faces.application.NavigationHandler

Base class for JSF NavigationHandler implementations that want to be capable of decorating an original NavigationHandler.

Supports the standard JSF style of decoration (through a constructor argument) as well as an overloaded handleNavigation method with explicit NavigationHandler argument (passing in the original NavigationHandler). Subclasses are forced to implement this overloaded handleNavigation method. Standard JSF invocations will automatically delegate to the overloaded method, with the constructor-injected NavigationHandler as argument.

Since:
1.2.7
Author:
Juergen Hoeller
See Also:
DelegatingNavigationHandlerProxy

Constructor Summary
protected | DecoratingNavigationHandler() Create a DecoratingNavigationHandler without fixed original NavigationHandler.
protected | DecoratingNavigationHandler(javax.faces.application.NavigationHandler originalNavigationHandler) Create a DecoratingNavigationHandler with fixed original NavigationHandler.
Method Summary
protected void | callNextHandlerInChain(javax.faces.context.FacesContext facesContext, String fromAction, String outcome, javax.faces.application.NavigationHandler originalNavigationHandler) Method to be called by subclasses when intending to delegate to the next handler in the NavigationHandler chain.
javax.faces.application.NavigationHandler | getDecoratedNavigationHandler() Return the fixed original NavigationHandler decorated by this handler, if any (that is, if passed in through the constructor).
void | handleNavigation(javax.faces.context.FacesContext facesContext, String fromAction, String outcome) This implementation of the standard JSF handleNavigation method delegates to the overloaded variant, passing in constructor-injected NavigationHandler as argument.
abstract void | handleNavigation(javax.faces.context.FacesContext facesContext, String fromAction, String outcome, javax.faces.application.NavigationHandler originalNavigationHandler) Special handleNavigation variant with explicit NavigationHandler argument.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DecoratingNavigationHandler

protected DecoratingNavigationHandler()
Create a DecoratingNavigationHandler without fixed original NavigationHandler.

DecoratingNavigationHandler

protected DecoratingNavigationHandler(javax.faces.application.NavigationHandler originalNavigationHandler)
Create a DecoratingNavigationHandler with fixed original NavigationHandler.

Parameters:
originalNavigationHandler - the original NavigationHandler to decorate
Method Detail

getDecoratedNavigationHandler

public final javax.faces.application.NavigationHandler getDecoratedNavigationHandler()
Return the fixed original NavigationHandler decorated by this handler, if any (that is, if passed in through the constructor).

handleNavigation

public final void handleNavigation(javax.faces.context.FacesContext facesContext,
                                   String fromAction,
                                   String outcome)
This implementation of the standard JSF handleNavigation method delegates to the overloaded variant, passing in constructor-injected NavigationHandler as argument.

Specified by:
handleNavigation in class javax.faces.application.NavigationHandler
See Also:
handleNavigation(javax.faces.context.FacesContext, String, String, javax.faces.application.NavigationHandler)

handleNavigation

public abstract void handleNavigation(javax.faces.context.FacesContext facesContext,
                                      String fromAction,
                                      String outcome,
                                      javax.faces.application.NavigationHandler originalNavigationHandler)
Special handleNavigation variant with explicit NavigationHandler argument. Either called directly, by code with an explicit original handler, or called from the standard handleNavigation method, as plain JSF-defined NavigationHandler.

Implementations should invoke callNextHandlerInChain to delegate to the next handler in the chain. This will always call the most appropriate next handler (see callNextHandlerInChain javadoc). Alternatively, the decorated NavigationHandler or the passed-in original NavigationHandler can also be called directly; however, this is not as flexible in terms of reacting to potential positions in the chain.

Parameters:
facesContext - the current JSF context
fromAction - the action binding expression that was evaluated to retrieve the specified outcome, or null if the outcome was acquired by some other means
outcome - the logical outcome returned by a previous invoked application action (which may be null)
originalNavigationHandler - the original NavigationHandler, or null if none
See Also:
callNextHandlerInChain(javax.faces.context.FacesContext, java.lang.String, java.lang.String, javax.faces.application.NavigationHandler)

callNextHandlerInChain

protected final void callNextHandlerInChain(javax.faces.context.FacesContext facesContext,
                                            String fromAction,
                                            String outcome,
                                            javax.faces.application.NavigationHandler originalNavigationHandler)
Method to be called by subclasses when intending to delegate to the next handler in the NavigationHandler chain. Will always call the most appropriate next handler, either the decorated NavigationHandler passed in as constructor argument or the original NavigationHandler as passed into this method - according to the position of this instance in the chain.

Will call the decorated NavigationHandler specified as constructor argument, if any. In case of a DecoratingNavigationHandler as target, the original NavigationHandler as passed into this method will be passed on to the next element in the chain: This ensures propagation of the original handler that the last element in the handler chain might delegate back to. In case of a standard NavigationHandler as target, the original handler will simply not get passed on; no delegating back to the original is possible further down the chain in that scenario.

If no decorated NavigationHandler specified as constructor argument, this instance is the last element in the chain. Hence, this method will call the original NavigationHandler as passed into this method. If no original NavigantionHandler has been passed in (for example if this instance is the last element in a chain with standard NavigationHandlers as earlier elements), this method corresponds to a no-op.

Parameters:
facesContext - the current JSF context
fromAction - the action binding expression that was evaluated to retrieve the specified outcome, or null if the outcome was acquired by some other means
outcome - the logical outcome returned by a previous invoked application action (which may be null)
originalNavigationHandler - the original NavigationHandler, or null if none
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


DelegatingNavigationHandlerProxy

org.springframework.web.jsf
Class DelegatingNavigationHandlerProxy

java.lang.Object
    extended by  javax.faces.application.NavigationHandler
        extended by  org.springframework.web.jsf.DelegatingNavigationHandlerProxy

public class DelegatingNavigationHandlerProxy
extends javax.faces.application.NavigationHandler

JSF NavigationHandler implementation that delegates to a NavigationHandler bean obtained from the Spring root WebApplicationContext.

Configure this handler proxy in your faces-config.xml file as follows:

 <application>
   ...
   <navigation-handler>
           org.springframework.web.jsf.DelegatingNavigationHandlerProxy
   </navigation-handler>
   ...
 </application>
By default, the Spring ApplicationContext will be searched for the NavigationHandler under the bean name "jsfNavigationHandler". In the simplest case, this is a plain Spring bean definition like the following. However, all of Spring's bean configuration power can be applied to such a bean, in particular all flavors of dependency injection.
 <bean name="jsfNavigationHandler" class="mypackage.MyNavigationHandler">
   <property name="myProperty" ref="myOtherBean"/>
 </bean>
The target NavigationHandler bean will typically extend the standard JSF NavigationHandler class. However, note that decorating the original NavigationHandler (the JSF provider's default handler) is not supported in such a scenario, since we can't inject the original handler in standard JSF style (that is, as constructor argument).

For decorating the original NavigationHandler, make sure that your target bean extends Spring's DecoratingNavigationHandler class. This allows to pass in the original handler as method argument, which this proxy automatically detects. Note that a DecoratingNavigationHandler subclass will still work as standard JSF NavigationHandler as well!

This proxy may be subclassed to change the bean name used to search for the navigation handler, change the strategy used to obtain the target handler, or change the strategy used to access the ApplicationContext (normally obtained via FacesContextUtils.getWebApplicationContext(FacesContext)).

Since:
1.2.7
Author:
Juergen Hoeller, Colin Sampaleanu
See Also:
DecoratingNavigationHandler

Field Summary
static String DEFAULT_TARGET_BEAN_NAME
Default name of the target bean in the Spring application context: "jsfNavigationHandler"
Constructor Summary
DelegatingNavigationHandlerProxy()
Create a new DelegatingNavigationHandlerProxy.
DelegatingNavigationHandlerProxy(javax.faces.application.NavigationHandler originalNavigationHandler)
Create a new DelegatingNavigationHandlerProxy.
Method Summary
protected BeanFactory | getBeanFactory(javax.faces.context.FacesContext facesContext) Retrieve the Spring BeanFactory to delegate bean name resolution to.
protected javax.faces.application.NavigationHandler | getDelegate(javax.faces.context.FacesContext facesContext) Return the target NavigationHandler to delegate to.
protected String | getTargetBeanName(javax.faces.context.FacesContext facesContext) Return the name of the target NavigationHandler bean in the BeanFactory.
protected WebApplicationContext | getWebApplicationContext(javax.faces.context.FacesContext facesContext) Retrieve the web application context to delegate bean name resolution to.
void | handleNavigation(javax.faces.context.FacesContext facesContext, String fromAction, String outcome) Handle the navigation request implied by the specified parameters, through delegating to the target bean in the Spring application context.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_TARGET_BEAN_NAME

public static final String DEFAULT_TARGET_BEAN_NAME
Default name of the target bean in the Spring application context: "jsfNavigationHandler"

See Also:
Constant Field Values
Constructor Detail

DelegatingNavigationHandlerProxy

public DelegatingNavigationHandlerProxy()
Create a new DelegatingNavigationHandlerProxy.

DelegatingNavigationHandlerProxy

public DelegatingNavigationHandlerProxy(javax.faces.application.NavigationHandler originalNavigationHandler)
Create a new DelegatingNavigationHandlerProxy.

Parameters:
originalNavigationHandler - the original NavigationHandler
Method Detail

handleNavigation

public void handleNavigation(javax.faces.context.FacesContext facesContext,
                             String fromAction,
                             String outcome)
Handle the navigation request implied by the specified parameters, through delegating to the target bean in the Spring application context.

The target bean needs to extend the JSF NavigationHandler class. If it extends Spring's DecoratingNavigationHandler, the overloaded handleNavigation method with the original NavigationHandler as argument will be used. Else, the standard handleNavigation method will be called.

Specified by:
handleNavigation in class javax.faces.application.NavigationHandler

getDelegate

protected javax.faces.application.NavigationHandler getDelegate(javax.faces.context.FacesContext facesContext)
Return the target NavigationHandler to delegate to.

By default, a bean with the name "jsfNavigationHandler" is obtained from the Spring root WebApplicationContext, for every invocation.

Parameters:
facesContext - the current JSF context
Returns:
the target NavigationHandler to delegate to
See Also:
getTargetBeanName(javax.faces.context.FacesContext), getBeanFactory(javax.faces.context.FacesContext)

getTargetBeanName

protected String getTargetBeanName(javax.faces.context.FacesContext facesContext)
Return the name of the target NavigationHandler bean in the BeanFactory. Default is "jsfNavigationHandler".

Parameters:
facesContext - the current JSF context
Returns:
the name of the target bean

getBeanFactory

protected BeanFactory getBeanFactory(javax.faces.context.FacesContext facesContext)
Retrieve the Spring BeanFactory to delegate bean name resolution to.

Default implementation delegates to getWebApplicationContext. Can be overridden to provide an arbitrary BeanFactory reference to resolve against; usually, this will be a full Spring ApplicationContext.

Parameters:
facesContext - the current JSF context
Returns:
the Spring BeanFactory (never null)
See Also:
getWebApplicationContext(javax.faces.context.FacesContext)

getWebApplicationContext

protected WebApplicationContext getWebApplicationContext(javax.faces.context.FacesContext facesContext)
Retrieve the web application context to delegate bean name resolution to.

Default implementation delegates to FacesContextUtils.

Parameters:
facesContext - the current JSF context
Returns:
the Spring web application context (never null)
See Also:
FacesContextUtils.getRequiredWebApplicationContext(javax.faces.context.FacesContext)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DelegatingPhaseListenerMulticaster

org.springframework.web.jsf
Class DelegatingPhaseListenerMulticaster

java.lang.Object
    extended by  org.springframework.web.jsf.DelegatingPhaseListenerMulticaster
All Implemented Interfaces:
Serializable, EventListener, javax.faces.event.PhaseListener
public class DelegatingPhaseListenerMulticaster
extends Object
implements javax.faces.event.PhaseListener

JSF PhaseListener implementation that delegates to one or more Spring-managed PhaseListener beans coming from the Spring root WebApplicationContext.

Configure this listener multicaster in your faces-config.xml file as follows:

 <application>
   ...
   <phase-listener>
     org.springframework.web.jsf.DelegatingPhaseListenerMulticaster
   </phase-listener>
   ...
 </application>
The multicaster will delegate all beforePhase and afterPhase events to all target PhaseListener beans. By default, those will simply be obtained by type: All beans in the Spring root WebApplicationContext that implement the PhaseListener interface will be fetched and invoked.

Note: This multicaster's getPhaseId() method will always return ANY_PHASE. The phase id exposed by the target listener beans will be ignored; all events will be propagated to all listeners.

This multicaster may be subclassed to change the strategy used to obtain the listener beans, or to change the strategy used to access the ApplicationContext (normally obtained via FacesContextUtils.getWebApplicationContext(FacesContext)).

Since:
1.2.7
Author:
Juergen Hoeller, Colin Sampaleanu
See Also:
Serialized Form

Constructor Summary
DelegatingPhaseListenerMulticaster()
Method Summary
void | afterPhase(javax.faces.event.PhaseEvent event)
void | beforePhase(javax.faces.event.PhaseEvent event)
protected ListableBeanFactory | getBeanFactory(javax.faces.context.FacesContext facesContext) Retrieve the Spring BeanFactory to delegate bean name resolution to.
protected Collection<javax.faces.event.PhaseListener> | getDelegates(javax.faces.context.FacesContext facesContext) Obtain the delegate PhaseListener beans from the Spring root WebApplicationContext.
javax.faces.event.PhaseId | getPhaseId()
protected WebApplicationContext | getWebApplicationContext(javax.faces.context.FacesContext facesContext) Retrieve the web application context to delegate bean name resolution to.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DelegatingPhaseListenerMulticaster

public DelegatingPhaseListenerMulticaster()
Method Detail

getPhaseId

public javax.faces.event.PhaseId getPhaseId()
Specified by:
getPhaseId in interface javax.faces.event.PhaseListener

beforePhase

public void beforePhase(javax.faces.event.PhaseEvent event)
Specified by:
beforePhase in interface javax.faces.event.PhaseListener

afterPhase

public void afterPhase(javax.faces.event.PhaseEvent event)
Specified by:
afterPhase in interface javax.faces.event.PhaseListener

getDelegates

protected Collection<javax.faces.event.PhaseListener> getDelegates(javax.faces.context.FacesContext facesContext)
Obtain the delegate PhaseListener beans from the Spring root WebApplicationContext.

Parameters:
facesContext - the current JSF context
Returns:
a Collection of PhaseListener objects
See Also:
getBeanFactory(javax.faces.context.FacesContext), ListableBeanFactory.getBeansOfType(Class)

getBeanFactory

protected ListableBeanFactory getBeanFactory(javax.faces.context.FacesContext facesContext)
Retrieve the Spring BeanFactory to delegate bean name resolution to.

The default implementation delegates to getWebApplicationContext. Can be overridden to provide an arbitrary ListableBeanFactory reference to resolve against; usually, this will be a full Spring ApplicationContext.

Parameters:
facesContext - the current JSF context
Returns:
the Spring ListableBeanFactory (never null)
See Also:
getWebApplicationContext(javax.faces.context.FacesContext)

getWebApplicationContext

protected WebApplicationContext getWebApplicationContext(javax.faces.context.FacesContext facesContext)
Retrieve the web application context to delegate bean name resolution to.

The default implementation delegates to FacesContextUtils.

Parameters:
facesContext - the current JSF context
Returns:
the Spring web application context (never null)
See Also:
FacesContextUtils.getRequiredWebApplicationContext(javax.faces.context.FacesContext)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DelegatingVariableResolver

org.springframework.web.jsf
Class DelegatingVariableResolver

java.lang.Object
    extended by  javax.faces.el.VariableResolver
        extended by  org.springframework.web.jsf.DelegatingVariableResolver
Direct Known Subclasses:
SpringBeanVariableResolver
public class DelegatingVariableResolver
extends javax.faces.el.VariableResolver

JSF 1.1 VariableResolver that first delegates to the original resolver of the underlying JSF implementation (for resolving managed-bean objects as defined in faces-config.xml as well as well-known implicit EL attributes), then to the Spring root WebApplicationContext (for resolving Spring beans).

Configure this resolver in your faces-config.xml file as follows:

 <application>
   ...
   <variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>
 </application>
All your JSF expressions can then implicitly refer to the names of Spring-managed service layer beans, for example in property values of JSF-managed beans:
 <managed-bean>
   <managed-bean-name>myJsfManagedBean</managed-bean-name>
   <managed-bean-class>example.MyJsfManagedBean</managed-bean-class>
   <managed-bean-scope>session</managed-bean-scope>
   <managed-property>
     <property-name>mySpringManagedBusinessObject</property-name>
     <value>#{mySpringManagedBusinessObject}</value>
   </managed-property>
 </managed-bean>
with "mySpringManagedBusinessObject" defined as Spring bean in applicationContext.xml:
 <bean id="mySpringManagedBusinessObject" class="example.MySpringManagedBusinessObject">
   ...
 </bean>

Since:
1.1
Author:
Juergen Hoeller
See Also:
WebApplicationContextVariableResolver, FacesContextUtils.getRequiredWebApplicationContext(javax.faces.context.FacesContext)

Field Summary
protected Log | logger Logger available to subclasses
protected javax.faces.el.VariableResolver | originalVariableResolver
Constructor Summary
DelegatingVariableResolver(javax.faces.el.VariableResolver originalVariableResolver)
Create a new DelegatingVariableResolver, using the given original VariableResolver.
Method Summary
protected BeanFactory | getBeanFactory(javax.faces.context.FacesContext facesContext) Retrieve the Spring BeanFactory to delegate bean name resolution to.
protected javax.faces.el.VariableResolver | getOriginalVariableResolver() Return the original JSF VariableResolver that this resolver delegates to.
protected WebApplicationContext | getWebApplicationContext(javax.faces.context.FacesContext facesContext) Retrieve the web application context to delegate bean name resolution to.
protected Object | resolveOriginal(javax.faces.context.FacesContext facesContext, String name) Resolve the attribute via the original JSF VariableResolver.
protected Object | resolveSpringBean(javax.faces.context.FacesContext facesContext, String name) Resolve the attribute as a Spring bean in the ApplicationContext.
Object | resolveVariable(javax.faces.context.FacesContext facesContext, String name) Delegate to the original VariableResolver first, then try to resolve the variable as Spring bean in the root WebApplicationContext.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

originalVariableResolver

protected final javax.faces.el.VariableResolver originalVariableResolver
Constructor Detail

DelegatingVariableResolver

public DelegatingVariableResolver(javax.faces.el.VariableResolver originalVariableResolver)
Create a new DelegatingVariableResolver, using the given original VariableResolver.

A JSF implementation will automatically pass its original resolver into the constructor of a configured resolver, provided that there is a corresponding constructor argument.

Parameters:
originalVariableResolver - the original VariableResolver
Method Detail

getOriginalVariableResolver

protected final javax.faces.el.VariableResolver getOriginalVariableResolver()
Return the original JSF VariableResolver that this resolver delegates to. Used to resolve standard JSF-managed beans.

resolveVariable

public Object resolveVariable(javax.faces.context.FacesContext facesContext,
                              String name)
                       throws javax.faces.el.EvaluationException
Delegate to the original VariableResolver first, then try to resolve the variable as Spring bean in the root WebApplicationContext.

Specified by:
resolveVariable in class javax.faces.el.VariableResolver
Throws:
javax.faces.el.EvaluationException

resolveOriginal

protected Object resolveOriginal(javax.faces.context.FacesContext facesContext,
                                 String name)
Resolve the attribute via the original JSF VariableResolver.

resolveSpringBean

protected Object resolveSpringBean(javax.faces.context.FacesContext facesContext,
                                   String name)
Resolve the attribute as a Spring bean in the ApplicationContext.

getBeanFactory

protected BeanFactory getBeanFactory(javax.faces.context.FacesContext facesContext)
Retrieve the Spring BeanFactory to delegate bean name resolution to.

The default implementation delegates to getWebApplicationContext. Can be overridden to provide an arbitrary BeanFactory reference to resolve against; usually, this will be a full Spring ApplicationContext.

Parameters:
facesContext - the current JSF context
Returns:
the Spring BeanFactory (never null)
See Also:
getWebApplicationContext(javax.faces.context.FacesContext)

getWebApplicationContext

protected WebApplicationContext getWebApplicationContext(javax.faces.context.FacesContext facesContext)
Retrieve the web application context to delegate bean name resolution to.

The default implementation delegates to FacesContextUtils.

Parameters:
facesContext - the current JSF context
Returns:
the Spring web application context (never null)
See Also:
FacesContextUtils.getRequiredWebApplicationContext(javax.faces.context.FacesContext)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FacesContextUtils

org.springframework.web.jsf
Class FacesContextUtils

java.lang.Object
    extended by  org.springframework.web.jsf.FacesContextUtils

public abstract class FacesContextUtils
extends Object

Convenience methods to retrieve the root WebApplicationContext for a given FacesContext. This is e.g. useful for accessing a Spring context from custom JSF code.

Analogous to Spring's WebApplicationContextUtils for the ServletContext.

Since:
1.1
Author:
Juergen Hoeller
See Also:
ContextLoader, WebApplicationContextUtils

Constructor Summary
FacesContextUtils()
Method Summary
static WebApplicationContext | getRequiredWebApplicationContext(javax.faces.context.FacesContext fc) Find the root WebApplicationContext for this web app, which is typically loaded via ContextLoaderListener or ContextLoaderServlet.
static Object | getSessionMutex(javax.faces.context.FacesContext fc) Return the best available mutex for the given session: that is, an object to synchronize on for the given session.
static WebApplicationContext | getWebApplicationContext(javax.faces.context.FacesContext fc) Find the root WebApplicationContext for this web app, which is typically loaded via ContextLoaderListener or ContextLoaderServlet.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

FacesContextUtils

public FacesContextUtils()
Method Detail

getWebApplicationContext

public static WebApplicationContext getWebApplicationContext(javax.faces.context.FacesContext fc)
Find the root WebApplicationContext for this web app, which is typically loaded via ContextLoaderListener or ContextLoaderServlet.

Will rethrow an exception that happened on root context startup, to differentiate between a failed context startup and no context at all.

Parameters:
fc - the FacesContext to find the web application context for
Returns:
the root WebApplicationContext for this web app, or null if none
See Also:
WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE

getRequiredWebApplicationContext

public static WebApplicationContext getRequiredWebApplicationContext(javax.faces.context.FacesContext fc)
                                                              throws IllegalStateException
Find the root WebApplicationContext for this web app, which is typically loaded via ContextLoaderListener or ContextLoaderServlet.

Will rethrow an exception that happened on root context startup, to differentiate between a failed context startup and no context at all.

Parameters:
fc - the FacesContext to find the web application context for
Returns:
the root WebApplicationContext for this web app
Throws:
IllegalStateException - if the root WebApplicationContext could not be found
See Also:
WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE

getSessionMutex

public static Object getSessionMutex(javax.faces.context.FacesContext fc)
Return the best available mutex for the given session: that is, an object to synchronize on for the given session.

Returns the session mutex attribute if available; usually, this means that the HttpSessionMutexListener needs to be defined in web.xml. Falls back to the Session reference itself if no mutex attribute found.

The session mutex is guaranteed to be the same object during the entire lifetime of the session, available under the key defined by the SESSION_MUTEX_ATTRIBUTE constant. It serves as a safe reference to synchronize on for locking on the current session.

In many cases, the Session reference itself is a safe mutex as well, since it will always be the same object reference for the same active logical session. However, this is not guaranteed across different servlet containers; the only 100% safe way is a session mutex.

Parameters:
fc - the FacesContext to find the session mutex for
Returns:
the mutex object (never null)
See Also:
WebUtils.SESSION_MUTEX_ATTRIBUTE, HttpSessionMutexListener
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SpringBeanVariableResolver

org.springframework.web.jsf
Class SpringBeanVariableResolver

java.lang.Object
    extended by  javax.faces.el.VariableResolver
        extended by  org.springframework.web.jsf.DelegatingVariableResolver
            extended by  org.springframework.web.jsf.SpringBeanVariableResolver

public class SpringBeanVariableResolver
extends DelegatingVariableResolver

This is a subclass of the JSF 1.1 DelegatingVariableResolver, letting Spring bean definitions override other attributes of the same name.

The main purpose of this class is to provide behavior that is analogous to the JSF 1.2 SpringBeanFacesELResolver.

Since:
2.5
Author:
Juergen Hoeller
See Also:
WebApplicationContextVariableResolver, FacesContextUtils.getRequiredWebApplicationContext(javax.faces.context.FacesContext)

Field Summary
Fields inherited from class org.springframework.web.jsf.DelegatingVariableResolver
logger, originalVariableResolver
Constructor Summary
SpringBeanVariableResolver(javax.faces.el.VariableResolver originalVariableResolver)
Method Summary
 Object resolveVariable(javax.faces.context.FacesContext facesContext, String name)
Delegate to the original VariableResolver first, then try to resolve the variable as Spring bean in the root WebApplicationContext.
Methods inherited from class org.springframework.web.jsf.DelegatingVariableResolver
getBeanFactory, getOriginalVariableResolver, getWebApplicationContext, resolveOriginal, resolveSpringBean
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SpringBeanVariableResolver

public SpringBeanVariableResolver(javax.faces.el.VariableResolver originalVariableResolver)
Method Detail

resolveVariable

public Object resolveVariable(javax.faces.context.FacesContext facesContext,
                              String name)
                       throws javax.faces.el.EvaluationException
Description copied from class: DelegatingVariableResolver
Delegate to the original VariableResolver first, then try to resolve the variable as Spring bean in the root WebApplicationContext.

Overrides:
resolveVariable in class DelegatingVariableResolver
Throws:
javax.faces.el.EvaluationException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WebApplicationContextVariableResolver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.jsf
Class WebApplicationContextVariableResolver

java.lang.Object
    extended by  javax.faces.el.VariableResolver
        extended by  org.springframework.web.jsf.WebApplicationContextVariableResolver

public class WebApplicationContextVariableResolver
extends javax.faces.el.VariableResolver

Special JSF 1.1 VariableResolver that exposes the Spring WebApplicationContext instance under a variable named "webApplicationContext".

In contrast to DelegatingVariableResolver, this VariableResolver does not resolve JSF variable names as Spring bean names. It rather exposes Spring's root WebApplicationContext itself under a special name. JSF-managed beans can then use Spring's WebApplicationContext API to retrieve Spring-managed beans, access resources, etc.

Configure this resolver in your faces-config.xml file as follows:

 <application>
   ...
   <variable-resolver>org.springframework.web.jsf.WebApplicationContextVariableResolver</variable-resolver>
 </application>

Since:
1.2.5
Author:
Colin Sampaleanu, Juergen Hoeller
See Also:
DelegatingVariableResolver, FacesContextUtils.getWebApplicationContext(javax.faces.context.FacesContext)

Field Summary
protected javax.faces.el.VariableResolver | originalVariableResolver
static String | WEB_APPLICATION_CONTEXT_VARIABLE_NAME Name of the exposed WebApplicationContext variable: "webApplicationContext".
Constructor Summary
WebApplicationContextVariableResolver(javax.faces.el.VariableResolver originalVariableResolver)
Create a new WebApplicationContextVariableResolver, using the given original VariableResolver.
Method Summary
protected javax.faces.el.VariableResolver | getOriginalVariableResolver() Return the original JSF VariableResolver that this resolver delegates to.
protected WebApplicationContext | getWebApplicationContext(javax.faces.context.FacesContext facesContext) Retrieve the WebApplicationContext reference to expose.
Object | resolveVariable(javax.faces.context.FacesContext context, String name) Check for the special "webApplicationContext" variable first, then delegate to the original VariableResolver.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

WEB_APPLICATION_CONTEXT_VARIABLE_NAME

public static final String WEB_APPLICATION_CONTEXT_VARIABLE_NAME
Name of the exposed WebApplicationContext variable: "webApplicationContext".

See Also:
Constant Field Values

originalVariableResolver

protected final javax.faces.el.VariableResolver originalVariableResolver
Constructor Detail

WebApplicationContextVariableResolver

public WebApplicationContextVariableResolver(javax.faces.el.VariableResolver originalVariableResolver)
Create a new WebApplicationContextVariableResolver, using the given original VariableResolver.

A JSF implementation will automatically pass its original resolver into the constructor of a configured resolver, provided that there is a corresponding constructor argument.

Parameters:
originalVariableResolver - the original VariableResolver
Method Detail

getOriginalVariableResolver

protected final javax.faces.el.VariableResolver getOriginalVariableResolver()
Return the original JSF VariableResolver that this resolver delegates to. Used to resolve standard JSF-managed beans.

resolveVariable

public Object resolveVariable(javax.faces.context.FacesContext context,
                              String name)
                       throws javax.faces.el.EvaluationException
Check for the special "webApplicationContext" variable first, then delegate to the original VariableResolver.

If no WebApplicationContext is available, all requests will be delegated to the original VariableResolver.

Specified by:
resolveVariable in class javax.faces.el.VariableResolver
Throws:
javax.faces.el.EvaluationException

getWebApplicationContext

protected WebApplicationContext getWebApplicationContext(javax.faces.context.FacesContext facesContext)
Retrieve the WebApplicationContext reference to expose.

The default implementation delegates to FacesContextUtils, returning null if no WebApplicationContext found.

Parameters:
facesContext - the current JSF context
Returns:
the Spring web application context
See Also:
FacesContextUtils.getWebApplicationContext(javax.faces.context.FacesContext)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.jsf.el

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.jsf.el

Support classes for integrating a JSF 1.2 web tier with a Spring middle tier which is hosted in a Spring root WebApplicationContext.

See:
Description

Class Summary
SpringBeanFacesELResolver | JSF 1.2 ELResolver that delegates to the Spring root WebApplicationContext, resolving name references to Spring-defined beans.
WebApplicationContextFacesELResolver | Special JSF 1.2 ELResolver that exposes the Spring WebApplicationContext instance under a variable named "webApplicationContext".

Package org.springframework.web.jsf.el Description

Support classes for integrating a JSF 1.2 web tier with a Spring middle tier which is hosted in a Spring root WebApplicationContext.

Supports JSF 1.2's ELResolver mechanism, providing closer integration than JSF 1.1's VariableResolver mechanism allowed for.


org.springframework.web.jsf.el Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.jsf.el

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.el.ELResolver
      • org.springframework.beans.factory.access.el.SpringBeanELResolver
        • org.springframework.web.jsf.el.SpringBeanFacesELResolver
      • org.springframework.web.jsf.el.WebApplicationContextFacesELResolver


SpringBeanFacesELResolver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.jsf.el
Class SpringBeanFacesELResolver

java.lang.Object
    extended by  javax.el.ELResolver
        extended by  org.springframework.beans.factory.access.el.SpringBeanELResolver
            extended by  org.springframework.web.jsf.el.SpringBeanFacesELResolver

public class SpringBeanFacesELResolver
extends SpringBeanELResolver

JSF 1.2 ELResolver that delegates to the Spring root WebApplicationContext, resolving name references to Spring-defined beans.

Configure this resolver in your faces-config.xml file as follows:

 <application>
   ...
   <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
 </application>
All your JSF expressions can then implicitly refer to the names of Spring-managed service layer beans, for example in property values of JSF-managed beans:
 <managed-bean>
   <managed-bean-name>myJsfManagedBean</managed-bean-name>
   <managed-bean-class>example.MyJsfManagedBean</managed-bean-class>
   <managed-bean-scope>session</managed-bean-scope>
   <managed-property>
     <property-name>mySpringManagedBusinessObject</property-name>
     <value>#{mySpringManagedBusinessObject}</value>
   </managed-property>
 </managed-bean>
with "mySpringManagedBusinessObject" defined as Spring bean in applicationContext.xml:
 <bean id="mySpringManagedBusinessObject" class="example.MySpringManagedBusinessObject">
   ...
 </bean>

Since:
2.5
Author:
Juergen Hoeller
See Also:
WebApplicationContextFacesELResolver, FacesContextUtils.getRequiredWebApplicationContext(javax.faces.context.FacesContext)

Field Summary
Fields inherited from class org.springframework.beans.factory.access.el.SpringBeanELResolver
logger
Fields inherited from class javax.el.ELResolver
RESOLVABLE_AT_DESIGN_TIME, TYPE
Constructor Summary
SpringBeanFacesELResolver()
Method Summary
protected  BeanFactory getBeanFactory(javax.el.ELContext elContext)
This implementation delegates to getWebApplicationContext(javax.el.ELContext).
protected  WebApplicationContext getWebApplicationContext(javax.el.ELContext elContext)
Retrieve the web application context to delegate bean name resolution to.
Methods inherited from class org.springframework.beans.factory.access.el.SpringBeanELResolver
getCommonPropertyType, getFeatureDescriptors, getType, getValue, isReadOnly, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SpringBeanFacesELResolver

public SpringBeanFacesELResolver()
Method Detail

getBeanFactory

protected BeanFactory getBeanFactory(javax.el.ELContext elContext)
This implementation delegates to getWebApplicationContext(javax.el.ELContext). Can be overridden to provide an arbitrary BeanFactory reference to resolve against; usually, this will be a full Spring ApplicationContext.

Specified by:
getBeanFactory in class SpringBeanELResolver
Parameters:
elContext - the current JSF ELContext
Returns:
the Spring BeanFactory (never null)

getWebApplicationContext

protected WebApplicationContext getWebApplicationContext(javax.el.ELContext elContext)
Retrieve the web application context to delegate bean name resolution to.

The default implementation delegates to FacesContextUtils.

Parameters:
elContext - the current JSF ELContext
Returns:
the Spring web application context (never null)
See Also:
FacesContextUtils.getRequiredWebApplicationContext(javax.faces.context.FacesContext)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


WebApplicationContextFacesELResolver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.jsf.el
Class WebApplicationContextFacesELResolver

java.lang.Object
    extended by  javax.el.ELResolver
        extended by  org.springframework.web.jsf.el.WebApplicationContextFacesELResolver

public class WebApplicationContextFacesELResolver
extends javax.el.ELResolver

Special JSF 1.2 ELResolver that exposes the Spring WebApplicationContext instance under a variable named "webApplicationContext".

In contrast to SpringBeanFacesELResolver, this ELResolver variant does not resolve JSF variable names as Spring bean names. It rather exposes Spring's root WebApplicationContext itself under a special name, and is able to resolve "webApplicationContext.mySpringManagedBusinessObject" dereferences to Spring-defined beans in that application context.

Configure this resolver in your faces-config.xml file as follows:

 <application>
   ...
   <el-resolver>org.springframework.web.jsf.el.WebApplicationContextFacesELResolver</el-resolver>
 </application>

Since:
2.5
Author:
Juergen Hoeller
See Also:
SpringBeanFacesELResolver, FacesContextUtils.getWebApplicationContext(javax.faces.context.FacesContext)

Field Summary
protected Log | logger Logger available to subclasses
static String | WEB_APPLICATION_CONTEXT_VARIABLE_NAME Name of the exposed WebApplicationContext variable: "webApplicationContext".
Fields inherited from class javax.el.ELResolver
RESOLVABLE_AT_DESIGN_TIME, TYPE
Constructor Summary
WebApplicationContextFacesELResolver()
Method Summary
Class<?> | getCommonPropertyType(javax.el.ELContext elContext, Object base)
Iterator<FeatureDescriptor> | getFeatureDescriptors(javax.el.ELContext elContext, Object base)
Class<?> | getType(javax.el.ELContext elContext, Object base, Object property)
Object | getValue(javax.el.ELContext elContext, Object base, Object property)
protected WebApplicationContext | getWebApplicationContext(javax.el.ELContext elContext) Retrieve the WebApplicationContext reference to expose.
boolean | isReadOnly(javax.el.ELContext elContext, Object base, Object property)
void | setValue(javax.el.ELContext elContext, Object base, Object property, Object value)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

WEB_APPLICATION_CONTEXT_VARIABLE_NAME

public static final String WEB_APPLICATION_CONTEXT_VARIABLE_NAME
Name of the exposed WebApplicationContext variable: "webApplicationContext".

See Also:
Constant Field Values

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

WebApplicationContextFacesELResolver

public WebApplicationContextFacesELResolver()
Method Detail

getValue

public Object getValue(javax.el.ELContext elContext,
                       Object base,
                       Object property)
                throws javax.el.ELException
Specified by:
getValue in class javax.el.ELResolver
Throws:
javax.el.ELException

getType

public Class<?> getType(javax.el.ELContext elContext,
                        Object base,
                        Object property)
                 throws javax.el.ELException
Specified by:
getType in class javax.el.ELResolver
Throws:
javax.el.ELException

setValue

public void setValue(javax.el.ELContext elContext,
                     Object base,
                     Object property,
                     Object value)
              throws javax.el.ELException
Specified by:
setValue in class javax.el.ELResolver
Throws:
javax.el.ELException

isReadOnly

public boolean isReadOnly(javax.el.ELContext elContext,
                          Object base,
                          Object property)
                   throws javax.el.ELException
Specified by:
isReadOnly in class javax.el.ELResolver
Throws:
javax.el.ELException

getFeatureDescriptors

public Iterator<FeatureDescriptor> getFeatureDescriptors(javax.el.ELContext elContext,
                                                         Object base)
Specified by:
getFeatureDescriptors in class javax.el.ELResolver

getCommonPropertyType

public Class<?> getCommonPropertyType(javax.el.ELContext elContext,
                                      Object base)
Specified by:
getCommonPropertyType in class javax.el.ELResolver

getWebApplicationContext

protected WebApplicationContext getWebApplicationContext(javax.el.ELContext elContext)
Retrieve the WebApplicationContext reference to expose.

The default implementation delegates to FacesContextUtils, returning null if no WebApplicationContext found.

Parameters:
elContext - the current JSF ELContext
Returns:
the Spring web application context
See Also:
FacesContextUtils.getWebApplicationContext(javax.faces.context.FacesContext)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.multipart

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.multipart

Multipart resolution framework for handling file uploads.

See:
Description

Interface Summary
MultipartFile | A representation of an uploaded file received in a multipart request.
MultipartHttpServletRequest | Provides additional methods for dealing with multipart content within a servlet request, allowing to access uploaded files.
MultipartRequest | This interface defines the multipart request access operations that are exposed for actual multipart requests.
MultipartResolver | A strategy interface for multipart file upload resolution in accordance with RFC 1867.

Exception Summary
MaxUploadSizeExceededException | MultipartException subclass thrown when an upload exceeds the maximum upload size allowed.
MultipartException | Exception thrown when multipart resolution fails.

Package org.springframework.web.multipart Description

Multipart resolution framework for handling file uploads. Provides a MultipartResolver strategy interface, and a generic extension of the HttpServletRequest interface for accessing multipart files in web application code.


org.springframework.web.multipart Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.multipart

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.web.multipart.MultipartException
              • org.springframework.web.multipart.MaxUploadSizeExceededException

Interface Hierarchy

  • org.springframework.web.multipart.MultipartFile
  • org.springframework.web.multipart.MultipartRequest
    • org.springframework.web.multipart.MultipartHttpServletRequest (also extends javax.servlet.http.HttpServletRequest)
  • org.springframework.web.multipart.MultipartResolver
  • javax.servlet.ServletRequest
    • javax.servlet.http.HttpServletRequest
      • org.springframework.web.multipart.MultipartHttpServletRequest (also extends org.springframework.web.multipart.MultipartRequest)


MultipartFile

org.springframework.web.multipart
Interface MultipartFile

All Known Implementing Classes:
CommonsMultipartFile, MockMultipartFile
public interface MultipartFile

A representation of an uploaded file received in a multipart request.

The file contents are either stored in memory or temporarily on disk. In either case, the user is responsible for copying file contents to a session-level or persistent store as and if desired. The temporary storages will be cleared at the end of request processing.

Since:
29.09.2003
Author:
Juergen Hoeller, Trevor D. Cook
See Also:
MultipartHttpServletRequest, MultipartResolver

Method Summary
byte[] | getBytes() Return the contents of the file as an array of bytes.
String | getContentType() Return the content type of the file.
InputStream | getInputStream() Return an InputStream to read the contents of the file from.
String | getName() Return the name of the parameter in the multipart form.
String | getOriginalFilename() Return the original filename in the client's filesystem.
long | getSize() Return the size of the file in bytes.
boolean | isEmpty() Return whether the uploaded file is empty, that is, either no file has been chosen in the multipart form or the chosen file has no content.
void | transferTo(File dest) Transfer the received file to the given destination file.

Method Detail

getName

String getName()
Return the name of the parameter in the multipart form.

Returns:
the name of the parameter (never null or empty)

getOriginalFilename

String getOriginalFilename()
Return the original filename in the client's filesystem.

This may contain path information depending on the browser used, but it typically will not with any other than Opera.

Returns:
the original filename, or the empty String if no file has been chosen in the multipart form

getContentType

String getContentType()
Return the content type of the file.

Returns:
the content type, or null if not defined (or no file has been chosen in the multipart form)

isEmpty

boolean isEmpty()
Return whether the uploaded file is empty, that is, either no file has been chosen in the multipart form or the chosen file has no content.

getSize

long getSize()
Return the size of the file in bytes.

Returns:
the size of the file, or 0 if empty

getBytes

byte[] getBytes()
                throws IOException
Return the contents of the file as an array of bytes.

Returns:
the contents of the file as bytes, or an empty byte array if empty
Throws:
IOException - in case of access errors (if the temporary store fails)

getInputStream

InputStream getInputStream()
                           throws IOException
Return an InputStream to read the contents of the file from. The user is responsible for closing the stream.

Returns:
the contents of the file as stream, or an empty stream if empty
Throws:
IOException - in case of access errors (if the temporary store fails)

transferTo

void transferTo(File dest)
                throws IOException,
                       IllegalStateException
Transfer the received file to the given destination file.

This may either move the file in the filesystem, copy the file in the filesystem, or save memory-held contents to the destination file. If the destination file already exists, it will be deleted first.

If the file has been moved in the filesystem, this operation cannot be invoked again. Therefore, call this method just once to be able to work with any storage mechanism.

Parameters:
dest - the destination file
Throws:
IOException - in case of reading or writing errors
IllegalStateException - if the file has already been moved in the filesystem and is not available anymore for another transfer
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MultipartHttpServletRequest

org.springframework.web.multipart
Interface MultipartHttpServletRequest

All Superinterfaces:
HttpServletRequest, MultipartRequest, ServletRequest
All Known Implementing Classes:
AbstractMultipartHttpServletRequest, DefaultMultipartHttpServletRequest, MockMultipartHttpServletRequest
public interface MultipartHttpServletRequest
extends HttpServletRequest, MultipartRequest

Provides additional methods for dealing with multipart content within a servlet request, allowing to access uploaded files. Implementations also need to override the standard ServletRequest methods for parameter access, making multipart parameters available.

A concrete implementation is DefaultMultipartHttpServletRequest. As an intermediate step, AbstractMultipartHttpServletRequest can be subclassed.

Since:
29.09.2003
Author:
Juergen Hoeller, Trevor D. Cook
See Also:
MultipartResolver, MultipartFile, ServletRequest.getParameter(java.lang.String), ServletRequest.getParameterNames(), ServletRequest.getParameterMap(), DefaultMultipartHttpServletRequest, AbstractMultipartHttpServletRequest

Field Summary
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
Method Summary
Methods inherited from interface javax.servlet.http.HttpServletRequest
getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole
Methods inherited from interface javax.servlet.ServletRequest
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding
Methods inherited from interface org.springframework.web.multipart.MultipartRequest
getFile, getFileMap, getFileNames, getFiles, getMultiFileMap

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MultipartRequest

org.springframework.web.multipart
Interface MultipartRequest

All Known Subinterfaces:
MultipartActionRequest, MultipartHttpServletRequest
All Known Implementing Classes:
AbstractMultipartHttpServletRequest, DefaultMultipartActionRequest, DefaultMultipartHttpServletRequest, MockMultipartActionRequest, MockMultipartHttpServletRequest
public interface MultipartRequest

This interface defines the multipart request access operations that are exposed for actual multipart requests. It is extended by MultipartHttpServletRequest and the Portlet MultipartActionRequest.

Since:
2.5.2
Author:
Juergen Hoeller, Arjen Poutsma

Method Summary
MultipartFile | getFile(String name) Return the contents plus description of an uploaded file in this request, or null if it does not exist.
Map<String,MultipartFile> | getFileMap() Return a Map of the multipart files contained in this request.
Iterator<String> | getFileNames() Return an Iterator of String objects containing the parameter names of the multipart files contained in this request.
List<MultipartFile> | getFiles(String name) Return the contents plus description of uploaded files in this request, or an empty list if it does not exist.
MultiValueMap<String,MultipartFile> | getMultiFileMap() Return a MultiValueMap of the multipart files contained in this request.

Method Detail

getFileNames

Iterator<String> getFileNames()
Return an Iterator of String objects containing the parameter names of the multipart files contained in this request. These are the field names of the form (like with normal parameters), not the original file names.

Returns:
the names of the files

getFile

MultipartFile getFile(String name)
Return the contents plus description of an uploaded file in this request, or null if it does not exist.

Parameters:
name - a String specifying the parameter name of the multipart file
Returns:
the uploaded content in the form of a MultipartFile object

getFiles

List<MultipartFile> getFiles(String name)
Return the contents plus description of uploaded files in this request, or an empty list if it does not exist.

Parameters:
name - a String specifying the parameter name of the multipart file
Returns:
the uploaded content in the form of a MultipartFile list
Since:
3.0

getFileMap

Map<String,MultipartFile> getFileMap()
Return a Map of the multipart files contained in this request.

Returns:
a map containing the parameter names as keys, and the MultipartFile objects as values
See Also:
MultipartFile

getMultiFileMap

MultiValueMap<String,MultipartFile> getMultiFileMap()
Return a MultiValueMap of the multipart files contained in this request.

Returns:
a map containing the parameter names as keys, and a list of MultipartFile objects as values
Since:
3.0
See Also:
MultipartFile
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MultipartResolver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.multipart
Interface MultipartResolver

All Known Implementing Classes:
CommonsMultipartResolver
public interface MultipartResolver

A strategy interface for multipart file upload resolution in accordance with RFC 1867. Implementations are typically usable both within an application context and standalone.

There is only one concrete implementation included in Spring, as of Spring 2.5:

  • CommonsMultipartResolver for Jakarta Commons FileUpload

There is no default resolver implementation used for Spring DispatcherServlets, as an application might choose to parse its multipart requests itself. To define an implementation, create a bean with the id "multipartResolver" in a DispatcherServlet's application context. Such a resolver gets applied to all requests handled by that DispatcherServlet.

If a DispatcherServlet detects a multipart request, it will resolve it via the configured MultipartResolver and pass on a wrapped HttpServletRequest. Controllers can then cast their given request to the MultipartHttpServletRequest interface, which permits access to any MultipartFiles. Note that this cast is only supported in case of an actual multipart request.

 public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) {
   MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
   MultipartFile multipartFile = multipartRequest.getFile("image");
   ...
 }
Instead of direct access, command or form controllers can register a ByteArrayMultipartFileEditor or StringMultipartFileEditor with their data binder, to automatically apply multipart content to command bean properties.

As an alternative to using a MultipartResolver with a DispatcherServlet, a MultipartFilter can be registered in web.xml. It will delegate to a corresponding MultipartResolver bean in the root application context. This is mainly intended for applications that do not use Spring's own web MVC framework.

Note: There is hardly ever a need to access the MultipartResolver itself from application code. It will simply do its work behind the scenes, making MultipartHttpServletRequests available to controllers.

Since:
29.09.2003
Author:
Juergen Hoeller, Trevor D. Cook
See Also:
MultipartHttpServletRequest, MultipartFile, CommonsMultipartResolver, ByteArrayMultipartFileEditor, StringMultipartFileEditor, DispatcherServlet

Method Summary
void | cleanupMultipart(MultipartHttpServletRequest request) Cleanup any resources used for the multipart handling, like a storage for the uploaded files.
boolean | isMultipart(HttpServletRequest request) Determine if the given request contains multipart content.
MultipartHttpServletRequest | resolveMultipart(HttpServletRequest request) Parse the given HTTP request into multipart files and parameters, and wrap the request inside a MultipartHttpServletRequest object that provides access to file descriptors and makes contained parameters accessible via the standard ServletRequest methods.

Method Detail

isMultipart

boolean isMultipart(HttpServletRequest request)
Determine if the given request contains multipart content.

Will typically check for content type "multipart/form-data", but the actually accepted requests might depend on the capabilities of the resolver implementation.

Parameters:
request - the servlet request to be evaluated
Returns:
whether the request contains multipart content

resolveMultipart

MultipartHttpServletRequest resolveMultipart(HttpServletRequest request)
                                             throws MultipartException
Parse the given HTTP request into multipart files and parameters, and wrap the request inside a MultipartHttpServletRequest object that provides access to file descriptors and makes contained parameters accessible via the standard ServletRequest methods.

Parameters:
request - the servlet request to wrap (must be of a multipart content type)
Returns:
the wrapped servlet request
Throws:
MultipartException - if the servlet request is not multipart, or if implementation-specific problems are encountered (such as exceeding file size limits)
See Also:
MultipartRequest.getFile(java.lang.String),
MultipartRequest.getFileNames(),
MultipartRequest.getFileMap(),
ServletRequest.getParameter(java.lang.String),
ServletRequest.getParameterNames(),
ServletRequest.getParameterMap()

cleanupMultipart

void cleanupMultipart(MultipartHttpServletRequest request)
Cleanup any resources used for the multipart handling, like a storage for the uploaded files.

Parameters:
request - the request to cleanup resources for
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


MaxUploadSizeExceededException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.multipart
Class MaxUploadSizeExceededException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.web.multipart.MultipartException
                        extended by  org.springframework.web.multipart.MaxUploadSizeExceededException
All Implemented Interfaces:
Serializable
public class MaxUploadSizeExceededException
extends MultipartException

MultipartException subclass thrown when an upload exceeds the maximum upload size allowed.

Since:
1.0.1
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
MaxUploadSizeExceededException(long maxUploadSize)
Constructor for MaxUploadSizeExceededException.
MaxUploadSizeExceededException(long maxUploadSize, Throwable ex)
Constructor for MaxUploadSizeExceededException.
Method Summary
 long getMaxUploadSize()
Return the maximum upload size allowed.
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

MaxUploadSizeExceededException

public MaxUploadSizeExceededException(long maxUploadSize)
Constructor for MaxUploadSizeExceededException.

Parameters:
maxUploadSize - the maximum upload size allowed

MaxUploadSizeExceededException

public MaxUploadSizeExceededException(long maxUploadSize,
                                      Throwable ex)
Constructor for MaxUploadSizeExceededException.

Parameters:
maxUploadSize - the maximum upload size allowed
ex - root cause from multipart parsing API in use
Method Detail

getMaxUploadSize

public long getMaxUploadSize()
Return the maximum upload size allowed.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


MultipartException

org.springframework.web.multipart
Class MultipartException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  org.springframework.core.NestedRuntimeException
                    extended by  org.springframework.web.multipart.MultipartException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
MaxUploadSizeExceededException
public class MultipartException
extends NestedRuntimeException

Exception thrown when multipart resolution fails.

Since:
29.09.2003
Author:
Trevor D. Cook, Juergen Hoeller
See Also:
MultipartResolver.resolveMultipart(javax.servlet.http.HttpServletRequest), MultipartFilter, Serialized Form

Constructor Summary
MultipartException(String msg)
Constructor for MultipartException.
MultipartException(String msg, Throwable cause)
Constructor for MultipartException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

MultipartException

public MultipartException(String msg)
Constructor for MultipartException.

Parameters:
msg - the detail message

MultipartException

public MultipartException(String msg,
                          Throwable cause)
Constructor for MultipartException.

Parameters:
msg - the detail message
cause - the root cause from the multipart parsing API in use
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.web.multipart.commons

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.multipart.commons

MultipartResolver implementation for Jakarta Commons FileUpload.

See:
Description

Class Summary
CommonsFileUploadSupport | Base class for multipart resolvers that use Jakarta Commons FileUpload 1.2 or above.
CommonsFileUploadSupport.MultipartParsingResult | Holder for a Map of Spring MultipartFiles and a Map of multipart parameters.
CommonsMultipartFile | MultipartFile implementation for Jakarta Commons FileUpload.
CommonsMultipartResolver | Servlet-based MultipartResolver implementation for Jakarta Commons FileUpload 1.2 or above.

Package org.springframework.web.multipart.commons Description

MultipartResolver implementation for Jakarta Commons FileUpload.


org.springframework.web.multipart.commons Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.multipart.commons

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.web.multipart.commons.CommonsFileUploadSupport
      • org.springframework.web.multipart.commons.CommonsMultipartResolver (implements org.springframework.web.multipart.MultipartResolver, org.springframework.web.context.ServletContextAware)
    • org.springframework.web.multipart.commons.CommonsFileUploadSupport.MultipartParsingResult
    • org.springframework.web.multipart.commons.CommonsMultipartFile (implements org.springframework.web.multipart.MultipartFile, java.io.Serializable)


CommonsFileUploadSupport

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.multipart.commons
Class CommonsFileUploadSupport

java.lang.Object
    extended by  org.springframework.web.multipart.commons.CommonsFileUploadSupport
Direct Known Subclasses:
CommonsMultipartResolver, CommonsPortletMultipartResolver
public abstract class CommonsFileUploadSupport
extends Object

Base class for multipart resolvers that use Jakarta Commons FileUpload 1.2 or above.

Provides common configuration properties and parsing functionality for multipart requests, using a Map of Spring CommonsMultipartFile instances as representation of uploaded files and a String-based parameter Map as representation of uploaded form fields.

Subclasses implement concrete resolution strategies for Servlet or Portlet environments: see CommonsMultipartResolver and CommonsPortletMultipartResolver, respectively. This base class is not tied to either of those APIs, factoring out common functionality.

Since:
2.0
Author:
Juergen Hoeller
See Also:
CommonsMultipartFile, CommonsMultipartResolver, CommonsPortletMultipartResolver

Nested Class Summary
protected static class CommonsFileUploadSupport.MultipartParsingResult
Holder for a Map of Spring MultipartFiles and a Map of multipart parameters.
Field Summary
protected  Log logger
Constructor Summary
CommonsFileUploadSupport()
Instantiate a new CommonsFileUploadSupport with its corresponding FileItemFactory and FileUpload instances.
Method Summary
protected void | cleanupFileItems(Collection<MultipartFile> multipartFiles) Cleanup the Spring MultipartFiles created during multipart parsing, potentially holding temporary data on disk.
protected String | getDefaultEncoding()
DiskFileItemFactory | getFileItemFactory() Return the underlying org.apache.commons.fileupload.disk.DiskFileItemFactory instance.
FileUpload | getFileUpload() Return the underlying org.apache.commons.fileupload.FileUpload instance.
protected boolean | isUploadTempDirSpecified()
protected DiskFileItemFactory | newFileItemFactory() Factory method for a Commons DiskFileItemFactory instance.
protected abstract FileUpload | newFileUpload(FileItemFactory fileItemFactory) Factory method for a Commons FileUpload instance.
protected CommonsFileUploadSupport.MultipartParsingResult | parseFileItems(List<FileItem> fileItems, String encoding) Parse the given List of Commons FileItems into a Spring MultipartParsingResult, containing Spring MultipartFile instances and a Map of multipart parameter.
protected FileUpload | prepareFileUpload(String encoding) Determine an appropriate FileUpload instance for the given encoding.
void | setDefaultEncoding(String defaultEncoding) Set the default character encoding to use for parsing requests, to be applied to headers of individual parts and to form fields.
void | setMaxInMemorySize(int maxInMemorySize) Set the maximum allowed size (in bytes) before uploads are written to disk.
void | setMaxUploadSize(long maxUploadSize) Set the maximum allowed size (in bytes) before uploads are refused.
void | setUploadTempDir(Resource uploadTempDir) Set the temporary directory where uploaded files get stored.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Constructor Detail

CommonsFileUploadSupport

public CommonsFileUploadSupport()
Instantiate a new CommonsFileUploadSupport with its corresponding FileItemFactory and FileUpload instances.

See Also:
newFileItemFactory(), newFileUpload(org.apache.commons.fileupload.FileItemFactory)
Method Detail

getFileItemFactory

public DiskFileItemFactory getFileItemFactory()
Return the underlying org.apache.commons.fileupload.disk.DiskFileItemFactory instance. There is hardly any need to access this.

Returns:
the underlying DiskFileItemFactory instance

getFileUpload

public FileUpload getFileUpload()
Return the underlying org.apache.commons.fileupload.FileUpload instance. There is hardly any need to access this.

Returns:
the underlying FileUpload instance

setMaxUploadSize

public void setMaxUploadSize(long maxUploadSize)
Set the maximum allowed size (in bytes) before uploads are refused. -1 indicates no limit (the default).

Parameters:
maxUploadSize - the maximum upload size allowed
See Also:
FileUploadBase.setSizeMax(long)

setMaxInMemorySize

public void setMaxInMemorySize(int maxInMemorySize)
Set the maximum allowed size (in bytes) before uploads are written to disk. Uploaded files will still be received past this amount, but they will not be stored in memory. Default is 10240, according to Commons FileUpload.

Parameters:
maxInMemorySize - the maximum in memory size allowed
See Also:
DiskFileItemFactory.setSizeThreshold(int)

setDefaultEncoding

public void setDefaultEncoding(String defaultEncoding)
Set the default character encoding to use for parsing requests, to be applied to headers of individual parts and to form fields. Default is ISO-8859-1, according to the Servlet spec.

If the request specifies a character encoding itself, the request encoding will override this setting. This also allows for generically overriding the character encoding in a filter that invokes the ServletRequest.setCharacterEncoding method.

Parameters:
defaultEncoding - the character encoding to use
See Also:
ServletRequest.getCharacterEncoding(), ServletRequest.setCharacterEncoding(java.lang.String), WebUtils.DEFAULT_CHARACTER_ENCODING, FileUploadBase.setHeaderEncoding(java.lang.String)

getDefaultEncoding

protected String getDefaultEncoding()

setUploadTempDir

public void setUploadTempDir(Resource uploadTempDir)
                      throws IOException
Set the temporary directory where uploaded files get stored. Default is the servlet container's temporary directory for the web application.

Throws:
IOException
See Also:
WebUtils.TEMP_DIR_CONTEXT_ATTRIBUTE

isUploadTempDirSpecified

protected boolean isUploadTempDirSpecified()

newFileItemFactory

protected DiskFileItemFactory newFileItemFactory()
Factory method for a Commons DiskFileItemFactory instance.

Default implementation returns a standard DiskFileItemFactory. Can be overridden to use a custom subclass, e.g. for testing purposes.

Returns:
the new DiskFileItemFactory instance

newFileUpload

protected abstract FileUpload newFileUpload(FileItemFactory fileItemFactory)
Factory method for a Commons FileUpload instance.

To be implemented by subclasses.

Parameters:
fileItemFactory - the Commons FileItemFactory to build upon
Returns:
the Commons FileUpload instance

prepareFileUpload

protected FileUpload prepareFileUpload(String encoding)
Determine an appropriate FileUpload instance for the given encoding.

Default implementation returns the shared FileUpload instance if the encoding matches, else creates a new FileUpload instance with the same configuration other than the desired encoding.

Parameters:
encoding - the character encoding to use
Returns:
an appropriate FileUpload instance.

parseFileItems

protected CommonsFileUploadSupport.MultipartParsingResult parseFileItems(List<FileItem> fileItems,
                                                                         String encoding)
Parse the given List of Commons FileItems into a Spring MultipartParsingResult, containing Spring MultipartFile instances and a Map of multipart parameter.

Parameters:
fileItems - the Commons FileIterms to parse
encoding - the encoding to use for form fields
Returns:
the Spring MultipartParsingResult
See Also:
CommonsMultipartFile.CommonsMultipartFile(org.apache.commons.fileupload.FileItem)

cleanupFileItems

protected void cleanupFileItems(Collection<MultipartFile> multipartFiles)
Cleanup the Spring MultipartFiles created during multipart parsing, potentially holding temporary data on disk.

Deletes the underlying Commons FileItem instances.

Parameters:
multipartFiles - Collection of MultipartFile instances
See Also:
FileItem.delete()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


CommonsFileUploadSupport.MultipartParsingResult

org.springframework.web.multipart.commons
Class CommonsFileUploadSupport.MultipartParsingResult

java.lang.Object
    extended by  org.springframework.web.multipart.commons.CommonsFileUploadSupport.MultipartParsingResult
Enclosing class:
CommonsFileUploadSupport
protected static class CommonsFileUploadSupport.MultipartParsingResult
extends Object

Holder for a Map of Spring MultipartFiles and a Map of multipart parameters.

Constructor Summary
CommonsFileUploadSupport.MultipartParsingResult(MultiValueMap<String,MultipartFile> mpFiles, Map<String,String[]> mpParams)
Create a new MultipartParsingResult.
Method Summary
MultiValueMap<String,MultipartFile> | getMultipartFiles() Return the multipart files as Map of field name to MultipartFile instance.
Map<String,String[]> | getMultipartParameters() Return the multipart parameters as Map of field name to form field String value.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CommonsFileUploadSupport.MultipartParsingResult

public CommonsFileUploadSupport.MultipartParsingResult(MultiValueMap<String,MultipartFile> mpFiles,
                                                       Map<String,String[]> mpParams)
Create a new MultipartParsingResult.

Parameters:
mpFiles - Map of field name to MultipartFile instance
mpParams - Map of field name to form field String value
Method Detail

getMultipartFiles

public MultiValueMap<String,MultipartFile> getMultipartFiles()
Return the multipart files as Map of field name to MultipartFile instance.

getMultipartParameters

public Map<String,String[]> getMultipartParameters()
Return the multipart parameters as Map of field name to form field String value.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CommonsMultipartFile

org.springframework.web.multipart.commons
Class CommonsMultipartFile

java.lang.Object
    extended by  org.springframework.web.multipart.commons.CommonsMultipartFile
All Implemented Interfaces:
Serializable, MultipartFile
public class CommonsMultipartFile
extends Object
implements MultipartFile, Serializable

MultipartFile implementation for Jakarta Commons FileUpload.

NOTE: As of Spring 2.0, this class requires Commons FileUpload 1.1 or higher. The implementation does not use any deprecated FileUpload 1.0 API anymore, to be compatible with future Commons FileUpload releases.

Since:
29.09.2003
Author:
Trevor D. Cook, Juergen Hoeller
See Also:
CommonsMultipartResolver, Serialized Form

Field Summary
protected static Log logger
Constructor Summary
CommonsMultipartFile(FileItem fileItem)
Create an instance wrapping the given FileItem.
Method Summary
byte[] | getBytes() Return the contents of the file as an array of bytes.
String | getContentType() Return the content type of the file.
FileItem | getFileItem() Return the underlying org.apache.commons.fileupload.FileItem instance.
InputStream | getInputStream() Return an InputStream to read the contents of the file from.
String | getName() Return the name of the parameter in the multipart form.
String | getOriginalFilename() Return the original filename in the client's filesystem.
long | getSize() Return the size of the file in bytes.
String | getStorageDescription() Return a description for the storage location of the multipart content.
protected boolean | isAvailable() Determine whether the multipart content is still available.
boolean | isEmpty() Return whether the uploaded file is empty, that is, either no file has been chosen in the multipart form or the chosen file has no content.
void | transferTo(File dest) Transfer the received file to the given destination file.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected static final Log logger
Constructor Detail

CommonsMultipartFile

public CommonsMultipartFile(FileItem fileItem)
Create an instance wrapping the given FileItem.

Parameters:
fileItem - the FileItem to wrap
Method Detail

getFileItem

public final FileItem getFileItem()
Return the underlying org.apache.commons.fileupload.FileItem instance. There is hardly any need to access this.

getName

public String getName()
Description copied from interface: MultipartFile
Return the name of the parameter in the multipart form.

Specified by:
getName in interface MultipartFile
Returns:
the name of the parameter (never null or empty)

getOriginalFilename

public String getOriginalFilename()
Description copied from interface: MultipartFile
Return the original filename in the client's filesystem.

This may contain path information depending on the browser used, but it typically will not with any other than Opera.

Specified by:
getOriginalFilename in interface MultipartFile
Returns:
the original filename, or the empty String if no file has been chosen in the multipart form

getContentType

public String getContentType()
Description copied from interface: MultipartFile
Return the content type of the file.

Specified by:
getContentType in interface MultipartFile
Returns:
the content type, or null if not defined (or no file has been chosen in the multipart form)

isEmpty

public boolean isEmpty()
Description copied from interface: MultipartFile
Return whether the uploaded file is empty, that is, either no file has been chosen in the multipart form or the chosen file has no content.

Specified by:
isEmpty in interface MultipartFile

getSize

public long getSize()
Description copied from interface: MultipartFile
Return the size of the file in bytes.

Specified by:
getSize in interface MultipartFile
Returns:
the size of the file, or 0 if empty

getBytes

public byte[] getBytes()
Description copied from interface: MultipartFile
Return the contents of the file as an array of bytes.

Specified by:
getBytes in interface MultipartFile
Returns:
the contents of the file as bytes, or an empty byte array if empty

getInputStream

public InputStream getInputStream()
                           throws IOException
Description copied from interface: MultipartFile
Return an InputStream to read the contents of the file from. The user is responsible for closing the stream.

Specified by:
getInputStream in interface MultipartFile
Returns:
the contents of the file as stream, or an empty stream if empty
Throws:
IOException - in case of access errors (if the temporary store fails)

transferTo

public void transferTo(File dest)
                throws IOException,
                       IllegalStateException
Description copied from interface: MultipartFile
Transfer the received file to the given destination file.

This may either move the file in the filesystem, copy the file in the filesystem, or save memory-held contents to the destination file. If the destination file already exists, it will be deleted first.

If the file has been moved in the filesystem, this operation cannot be invoked again. Therefore, call this method just once to be able to work with any storage mechanism.

Specified by:
transferTo in interface MultipartFile
Parameters:
dest - the destination file
Throws:
IOException - in case of reading or writing errors
IllegalStateException - if the file has already been moved in the filesystem and is not available anymore for another transfer

isAvailable

protected boolean isAvailable()
Determine whether the multipart content is still available. If a temporary file has been moved, the content is no longer available.

getStorageDescription

public String getStorageDescription()
Return a description for the storage location of the multipart content. Tries to be as specific as possible: mentions the file location in case of a temporary file.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CommonsMultipartResolver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.multipart.commons
Class CommonsMultipartResolver

java.lang.Object
    extended by  org.springframework.web.multipart.commons.CommonsFileUploadSupport
        extended by  org.springframework.web.multipart.commons.CommonsMultipartResolver
All Implemented Interfaces:
ServletContextAware, MultipartResolver
public class CommonsMultipartResolver
extends CommonsFileUploadSupport
implements MultipartResolver, ServletContextAware

Servlet-based MultipartResolver implementation for Jakarta Commons FileUpload 1.2 or above.

Provides "maxUploadSize", "maxInMemorySize" and "defaultEncoding" settings as bean properties (inherited from CommonsFileUploadSupport). See corresponding ServletFileUpload / DiskFileItemFactory properties ("sizeMax", "sizeThreshold", "headerEncoding") for details in terms of defaults and accepted values.

Saves temporary files to the servlet container's temporary directory. Needs to be initialized either by an application context or via the constructor that takes a ServletContext (for standalone usage).

Since:
29.09.2003
Author:
Trevor D. Cook, Juergen Hoeller
See Also:
CommonsMultipartResolver(ServletContext), setResolveLazily(boolean), CommonsPortletMultipartResolver, ServletFileUpload, DiskFileItemFactory

Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.web.multipart.commons.CommonsFileUploadSupport
CommonsFileUploadSupport.MultipartParsingResult
Field Summary
Fields inherited from class org.springframework.web.multipart.commons.CommonsFileUploadSupport
logger
Constructor Summary
CommonsMultipartResolver()
Constructor for use as bean.
CommonsMultipartResolver(ServletContext servletContext)
Constructor for standalone usage.
Method Summary
void | cleanupMultipart(MultipartHttpServletRequest request) Cleanup any resources used for the multipart handling, like a storage for the uploaded files.
protected String | determineEncoding(HttpServletRequest request) Determine the encoding for the given request.
boolean | isMultipart(HttpServletRequest request) Determine if the given request contains multipart content.
protected FileUpload | newFileUpload(FileItemFactory fileItemFactory) Initialize the underlying org.apache.commons.fileupload.servlet.ServletFileUpload instance.
protected CommonsFileUploadSupport.MultipartParsingResult | parseRequest(HttpServletRequest request) Parse the given servlet request, resolving its multipart elements.
MultipartHttpServletRequest | resolveMultipart(HttpServletRequest request) Parse the given HTTP request into multipart files and parameters, and wrap the request inside a MultipartHttpServletRequest object that provides access to file descriptors and makes contained parameters accessible via the standard ServletRequest methods.
void | setResolveLazily(boolean resolveLazily) Set whether to resolve the multipart request lazily at the time of file or parameter access.
void | setServletContext(ServletContext servletContext) Set the ServletContext that this object runs in.
Methods inherited from class org.springframework.web.multipart.commons.CommonsFileUploadSupport
cleanupFileItems, getDefaultEncoding, getFileItemFactory, getFileUpload, isUploadTempDirSpecified, newFileItemFactory, parseFileItems, prepareFileUpload, setDefaultEncoding, setMaxInMemorySize, setMaxUploadSize, setUploadTempDir
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CommonsMultipartResolver

public CommonsMultipartResolver()
Constructor for use as bean. Determines the servlet container's temporary directory via the ServletContext passed in as through the ServletContextAware interface (typically by a WebApplicationContext).

See Also:
setServletContext(javax.servlet.ServletContext), ServletContextAware, WebApplicationContext

CommonsMultipartResolver

public CommonsMultipartResolver(ServletContext servletContext)
Constructor for standalone usage. Determines the servlet container's temporary directory via the given ServletContext.

Parameters:
servletContext - the ServletContext to use
Method Detail

setResolveLazily

public void setResolveLazily(boolean resolveLazily)
Set whether to resolve the multipart request lazily at the time of file or parameter access.

Default is "false", resolving the multipart elements immediately, throwing corresponding exceptions at the time of the resolveMultipart(javax.servlet.http.HttpServletRequest) call. Switch this to "true" for lazy multipart parsing, throwing parse exceptions once the application attempts to obtain multipart files or parameters.

newFileUpload

protected FileUpload newFileUpload(FileItemFactory fileItemFactory)
Initialize the underlying org.apache.commons.fileupload.servlet.ServletFileUpload instance. Can be overridden to use a custom subclass, e.g. for testing purposes.

Specified by:
newFileUpload in class CommonsFileUploadSupport
Parameters:
fileItemFactory - the Commons FileItemFactory to use
Returns:
the new ServletFileUpload instance

setServletContext

public void setServletContext(ServletContext servletContext)
Description copied from interface: ServletContextAware
Set the ServletContext that this object runs in.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked after ApplicationContextAware's setApplicationContext.

Specified by:
setServletContext in interface ServletContextAware
Parameters:
servletContext - ServletContext object to be used by this object
See Also:
InitializingBean.afterPropertiesSet(), ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)

isMultipart

public boolean isMultipart(HttpServletRequest request)
Description copied from interface: MultipartResolver
Determine if the given request contains multipart content.

Will typically check for content type "multipart/form-data", but the actually accepted requests might depend on the capabilities of the resolver implementation.

Specified by:
isMultipart in interface MultipartResolver
Parameters:
request - the servlet request to be evaluated
Returns:
whether the request contains multipart content

resolveMultipart

public MultipartHttpServletRequest resolveMultipart(HttpServletRequest request)
                                             throws MultipartException
Description copied from interface: MultipartResolver
Parse the given HTTP request into multipart files and parameters, and wrap the request inside a MultipartHttpServletRequest object that provides access to file descriptors and makes contained parameters accessible via the standard ServletRequest methods.

Specified by:
resolveMultipart in interface MultipartResolver
Parameters:
request - the servlet request to wrap (must be of a multipart content type)
Returns:
the wrapped servlet request
Throws:
MultipartException - if the servlet request is not multipart, or if implementation-specific problems are encountered (such as exceeding file size limits)
See Also:
MultipartRequest.getFile(java.lang.String),
MultipartRequest.getFileNames(),
MultipartRequest.getFileMap(),
ServletRequest.getParameter(java.lang.String),
ServletRequest.getParameterNames(),
ServletRequest.getParameterMap()

parseRequest

protected CommonsFileUploadSupport.MultipartParsingResult parseRequest(HttpServletRequest request)
                                                                throws MultipartException
Parse the given servlet request, resolving its multipart elements.

Parameters:
request - the request to parse
Returns:
the parsing result
Throws:
MultipartException - if multipart resolution failed.

determineEncoding

protected String determineEncoding(HttpServletRequest request)
Determine the encoding for the given request. Can be overridden in subclasses.

The default implementation checks the request encoding, falling back to the default encoding specified for this resolver.

Parameters:
request - current HTTP request
Returns:
the encoding for the request (never null)
See Also:
ServletRequest.getCharacterEncoding(), CommonsFileUploadSupport.setDefaultEncoding(java.lang.String)

cleanupMultipart

public void cleanupMultipart(MultipartHttpServletRequest request)
Description copied from interface: MultipartResolver
Cleanup any resources used for the multipart handling, like a storage for the uploaded files.

Specified by:
cleanupMultipart in interface MultipartResolver
Parameters:
request - the request to cleanup resources for
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.multipart.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.multipart.support

Support classes for the multipart resolution framework.

See:
Description

Class Summary
AbstractMultipartHttpServletRequest | Abstract base implementation of the MultipartHttpServletRequest interface.
ByteArrayMultipartFileEditor | Custom PropertyEditor for converting MultipartFiles to byte arrays.
DefaultMultipartHttpServletRequest | Default implementation of the MultipartHttpServletRequest interface.
MultipartFilter | Servlet 2.3 Filter that resolves multipart requests via a MultipartResolver.
StringMultipartFileEditor | Custom PropertyEditor for converting MultipartFiles to Strings.

Package org.springframework.web.multipart.support Description

Support classes for the multipart resolution framework. Contains property editors for multipart files, and a servlet filter for multipart handling without Spring's web MVC.


org.springframework.web.multipart.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.multipart.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.web.filter.GenericFilterBean (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, javax.servlet.Filter, org.springframework.beans.factory.InitializingBean, org.springframework.web.context.ServletContextAware)
      • org.springframework.web.filter.OncePerRequestFilter
        • org.springframework.web.multipart.support.MultipartFilter
    • java.beans.PropertyEditorSupport (implements java.beans.PropertyEditor)
      • org.springframework.beans.propertyeditors.ByteArrayPropertyEditor
        • org.springframework.web.multipart.support.ByteArrayMultipartFileEditor
      • org.springframework.web.multipart.support.StringMultipartFileEditor
    • javax.servlet.ServletRequestWrapper (implements javax.servlet.ServletRequest)
      • javax.servlet.http.HttpServletRequestWrapper (implements javax.servlet.http.HttpServletRequest)
        • org.springframework.web.multipart.support.AbstractMultipartHttpServletRequest (implements org.springframework.web.multipart.MultipartHttpServletRequest)
          • org.springframework.web.multipart.support.DefaultMultipartHttpServletRequest


AbstractMultipartHttpServletRequest

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.multipart.support
Class AbstractMultipartHttpServletRequest

java.lang.Object
    extended by  javax.servlet.ServletRequestWrapper
        extended by  javax.servlet.http.HttpServletRequestWrapper
            extended by  org.springframework.web.multipart.support.AbstractMultipartHttpServletRequest
All Implemented Interfaces:
HttpServletRequest, ServletRequest, MultipartHttpServletRequest, MultipartRequest
Direct Known Subclasses:
DefaultMultipartHttpServletRequest
public abstract class AbstractMultipartHttpServletRequest
extends HttpServletRequestWrapper
implements MultipartHttpServletRequest

Abstract base implementation of the MultipartHttpServletRequest interface. Provides management of pre-generated MultipartFile instances.

Since:
06.10.2003
Author:
Juergen Hoeller, Arjen Poutsma

Field Summary
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
Constructor Summary
protected AbstractMultipartHttpServletRequest(HttpServletRequest request)
Wrap the given HttpServletRequest in a MultipartHttpServletRequest.
Method Summary
MultipartFile | getFile(String name) Return the contents plus description of an uploaded file in this request, or null if it does not exist.
Map<String,MultipartFile> | getFileMap() Return a Map of the multipart files contained in this request.
Iterator<String> | getFileNames() Return an Iterator of String objects containing the parameter names of the multipart files contained in this request.
List<MultipartFile> | getFiles(String name) Return the contents plus description of uploaded files in this request, or an empty list if it does not exist.
MultiValueMap<String,MultipartFile> | getMultiFileMap() Return a MultiValueMap of the multipart files contained in this request.
protected MultiValueMap<String,MultipartFile> | getMultipartFiles() Obtain the MultipartFile Map for retrieval, lazily initializing it if necessary.
protected void | initializeMultipart() Lazily initialize the multipart request, if possible.
protected void | setMultipartFiles(MultiValueMap<String,MultipartFile> multipartFiles) Set a Map with parameter names as keys and list of MultipartFile objects as values.
Methods inherited from class javax.servlet.http.HttpServletRequestWrapper
getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole
Methods inherited from class javax.servlet.ServletRequestWrapper
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding, setRequest
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.servlet.http.HttpServletRequest
getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole
Methods inherited from interface javax.servlet.ServletRequest
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding

Constructor Detail

AbstractMultipartHttpServletRequest

protected AbstractMultipartHttpServletRequest(HttpServletRequest request)
Wrap the given HttpServletRequest in a MultipartHttpServletRequest.

Parameters:
request - the request to wrap
Method Detail

getFileNames

public Iterator<String> getFileNames()
Description copied from interface: MultipartRequest
Return an Iterator of String objects containing the parameter names of the multipart files contained in this request. These are the field names of the form (like with normal parameters), not the original file names.

Specified by:
getFileNames in interface MultipartRequest
Returns:
the names of the files

getFile

public MultipartFile getFile(String name)
Description copied from interface: MultipartRequest
Return the contents plus description of an uploaded file in this request, or null if it does not exist.

Specified by:
getFile in interface MultipartRequest
Parameters:
name - a String specifying the parameter name of the multipart file
Returns:
the uploaded content in the form of a MultipartFile object

getFiles

public List<MultipartFile> getFiles(String name)
Description copied from interface: MultipartRequest
Return the contents plus description of uploaded files in this request, or an empty list if it does not exist.

Specified by:
getFiles in interface MultipartRequest
Parameters:
name - a String specifying the parameter name of the multipart file
Returns:
the uploaded content in the form of a MultipartFile list

getFileMap

public Map<String,MultipartFile> getFileMap()
Description copied from interface: MultipartRequest
Return a Map of the multipart files contained in this request.

Specified by:
getFileMap in interface MultipartRequest
Returns:
a map containing the parameter names as keys, and the MultipartFile objects as values
See Also:
MultipartFile

getMultiFileMap

public MultiValueMap<String,MultipartFile> getMultiFileMap()
Description copied from interface: MultipartRequest
Return a MultiValueMap of the multipart files contained in this request.

Specified by:
getMultiFileMap in interface MultipartRequest
Returns:
a map containing the parameter names as keys, and a list of MultipartFile objects as values
See Also:
MultipartFile

setMultipartFiles

protected final void setMultipartFiles(MultiValueMap<String,MultipartFile> multipartFiles)
Set a Map with parameter names as keys and list of MultipartFile objects as values. To be invoked by subclasses on initialization.

getMultipartFiles

protected MultiValueMap<String,MultipartFile> getMultipartFiles()
Obtain the MultipartFile Map for retrieval, lazily initializing it if necessary.

See Also:
initializeMultipart()

initializeMultipart

protected void initializeMultipart()
Lazily initialize the multipart request, if possible. Only called if not already eagerly initialized.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ByteArrayMultipartFileEditor

org.springframework.web.multipart.support
Class ByteArrayMultipartFileEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.beans.propertyeditors.ByteArrayPropertyEditor
            extended by  org.springframework.web.multipart.support.ByteArrayMultipartFileEditor
All Implemented Interfaces:
PropertyEditor
public class ByteArrayMultipartFileEditor
extends ByteArrayPropertyEditor

Custom PropertyEditor for converting MultipartFiles to byte arrays.

Since:
13.10.2003
Author:
Juergen Hoeller

Constructor Summary
ByteArrayMultipartFileEditor()
Method Summary
String | getAsText()
void | setValue(Object value)
Methods inherited from class org.springframework.beans.propertyeditors.ByteArrayPropertyEditor
setAsText
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ByteArrayMultipartFileEditor

public ByteArrayMultipartFileEditor()
Method Detail

setValue

public void setValue(Object value)
Specified by:
setValue in interface PropertyEditor
Overrides:
setValue in class PropertyEditorSupport

getAsText

public String getAsText()
Specified by:
getAsText in interface PropertyEditor
Overrides:
getAsText in class ByteArrayPropertyEditor
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultMultipartHttpServletRequest

org.springframework.web.multipart.support
Class DefaultMultipartHttpServletRequest

java.lang.Object
    extended by  javax.servlet.ServletRequestWrapper
        extended by  javax.servlet.http.HttpServletRequestWrapper
            extended by  org.springframework.web.multipart.support.AbstractMultipartHttpServletRequest
                extended by  org.springframework.web.multipart.support.DefaultMultipartHttpServletRequest
All Implemented Interfaces:
HttpServletRequest, ServletRequest, MultipartHttpServletRequest, MultipartRequest
public class DefaultMultipartHttpServletRequest
extends AbstractMultipartHttpServletRequest

Default implementation of the MultipartHttpServletRequest interface. Provides management of pre-generated parameter values.

Since:
29.09.2003
Author:
Trevor D. Cook, Juergen Hoeller, Arjen Poutsma
See Also:
MultipartResolver

Field Summary
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
Constructor Summary
DefaultMultipartHttpServletRequest(HttpServletRequest request)
Wrap the given HttpServletRequest in a MultipartHttpServletRequest.
DefaultMultipartHttpServletRequest(HttpServletRequest request, MultiValueMap<String,MultipartFile> mpFiles, Map<String,String[]> mpParams)
Wrap the given HttpServletRequest in a MultipartHttpServletRequest.
Method Summary
protected Map<String,String[]> | getMultipartParameters() Obtain the multipart parameter Map for retrieval, lazily initializing it if necessary.
String | getParameter(String name)
Map<String,String[]> | getParameterMap()
Enumeration<String> | getParameterNames()
String[] | getParameterValues(String name)
protected void | setMultipartParameters(Map<String,String[]> multipartParameters) Set a Map with parameter names as keys and String array objects as values.
Methods inherited from class org.springframework.web.multipart.support.AbstractMultipartHttpServletRequest
getFile, getFileMap, getFileNames, getFiles, getMultiFileMap, getMultipartFiles, initializeMultipart, setMultipartFiles
Methods inherited from class javax.servlet.http.HttpServletRequestWrapper
getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole
Methods inherited from class javax.servlet.ServletRequestWrapper
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding, setRequest
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.servlet.http.HttpServletRequest
getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole
Methods inherited from interface javax.servlet.ServletRequest
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding

Constructor Detail

DefaultMultipartHttpServletRequest

public DefaultMultipartHttpServletRequest(HttpServletRequest request,
                                          MultiValueMap<String,MultipartFile> mpFiles,
                                          Map<String,String[]> mpParams)
Wrap the given HttpServletRequest in a MultipartHttpServletRequest.

Parameters:
request - the servlet request to wrap
mpFiles - a map of the multipart files
mpParams - a map of the parameters to expose, with Strings as keys and String arrays as values

DefaultMultipartHttpServletRequest

public DefaultMultipartHttpServletRequest(HttpServletRequest request)
Wrap the given HttpServletRequest in a MultipartHttpServletRequest.

Parameters:
request - the servlet request to wrap
Method Detail

getParameterNames

public Enumeration<String> getParameterNames()
Specified by:
getParameterNames in interface ServletRequest
Overrides:
getParameterNames in class ServletRequestWrapper

getParameter

public String getParameter(String name)
Specified by:
getParameter in interface ServletRequest
Overrides:
getParameter in class ServletRequestWrapper

getParameterValues

public String[] getParameterValues(String name)
Specified by:
getParameterValues in interface ServletRequest
Overrides:
getParameterValues in class ServletRequestWrapper

getParameterMap

public Map<String,String[]> getParameterMap()
Specified by:
getParameterMap in interface ServletRequest
Overrides:
getParameterMap in class ServletRequestWrapper

setMultipartParameters

protected final void setMultipartParameters(Map<String,String[]> multipartParameters)
Set a Map with parameter names as keys and String array objects as values. To be invoked by subclasses on initialization.

getMultipartParameters

protected Map<String,String[]> getMultipartParameters()
Obtain the multipart parameter Map for retrieval, lazily initializing it if necessary.

See Also:
AbstractMultipartHttpServletRequest.initializeMultipart()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MultipartFilter

org.springframework.web.multipart.support
Class MultipartFilter

java.lang.Object
    extended by  org.springframework.web.filter.GenericFilterBean
        extended by  org.springframework.web.filter.OncePerRequestFilter
            extended by  org.springframework.web.multipart.support.MultipartFilter
All Implemented Interfaces:
Filter, BeanNameAware, DisposableBean, InitializingBean, ServletContextAware
public class MultipartFilter
extends OncePerRequestFilter

Servlet 2.3 Filter that resolves multipart requests via a MultipartResolver. in the root web application context.

Looks up the MultipartResolver in Spring's root web application context. Supports a "multipartResolverBeanName" filter init-param in web.xml; the default bean name is "filterMultipartResolver". Looks up the MultipartResolver on each request, to avoid initialization order issues (when using ContextLoaderServlet, the root application context will get initialized after this filter).

MultipartResolver lookup is customizable: Override this filter's lookupMultipartResolver method to use a custom MultipartResolver instance, for example if not using a Spring web application context. Note that the lookup method should not create a new MultipartResolver instance for each call but rather return a reference to a pre-built instance.

Note: This filter is an alternative to using DispatcherServlet's MultipartResolver support, for example for web applications with custom web views which do not use Spring's web MVC, or for custom filters applied before a Spring MVC DispatcherServlet (e.g. HiddenHttpMethodFilter). In any case, this filter should not be combined with servlet-specific multipart resolution.

Since:
08.10.2003
Author:
Juergen Hoeller
See Also:
setMultipartResolverBeanName(java.lang.String), lookupMultipartResolver(javax.servlet.http.HttpServletRequest), MultipartResolver, DispatcherServlet

Field Summary
static String DEFAULT_MULTIPART_RESOLVER_BEAN_NAME
Fields inherited from class org.springframework.web.filter.OncePerRequestFilter
ALREADY_FILTERED_SUFFIX
Fields inherited from class org.springframework.web.filter.GenericFilterBean
logger
Constructor Summary
MultipartFilter()
Method Summary
protected void | doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) Check for a multipart request via this filter's MultipartResolver, and wrap the original request with a MultipartHttpServletRequest if appropriate.
protected String | getMultipartResolverBeanName() Return the bean name of the MultipartResolver to fetch from Spring's root application context.
protected MultipartResolver | lookupMultipartResolver() Look for a MultipartResolver bean in the root web application context.
protected MultipartResolver | lookupMultipartResolver(HttpServletRequest request) Look up the MultipartResolver that this filter should use, taking the current HTTP request as argument.
void | setMultipartResolverBeanName(String multipartResolverBeanName) Set the bean name of the MultipartResolver to fetch from Spring's root application context.
Methods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, getAlreadyFilteredAttributeName, shouldNotFilter
Methods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setServletContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_MULTIPART_RESOLVER_BEAN_NAME

public static final String DEFAULT_MULTIPART_RESOLVER_BEAN_NAME
See Also:
Constant Field Values
Constructor Detail

MultipartFilter

public MultipartFilter()
Method Detail

setMultipartResolverBeanName

public void setMultipartResolverBeanName(String multipartResolverBeanName)
Set the bean name of the MultipartResolver to fetch from Spring's root application context. Default is "filterMultipartResolver".

getMultipartResolverBeanName

protected String getMultipartResolverBeanName()
Return the bean name of the MultipartResolver to fetch from Spring's root application context.

doFilterInternal

protected void doFilterInternal(HttpServletRequest request,
                                HttpServletResponse response,
                                FilterChain filterChain)
                         throws ServletException,
                                IOException
Check for a multipart request via this filter's MultipartResolver, and wrap the original request with a MultipartHttpServletRequest if appropriate.

All later elements in the filter chain, most importantly servlets, benefit from proper parameter extraction in the multipart case, and are able to cast to MultipartHttpServletRequest if they need to.

Specified by:
doFilterInternal in class OncePerRequestFilter
Throws:
ServletException
IOException

lookupMultipartResolver

protected MultipartResolver lookupMultipartResolver(HttpServletRequest request)
Look up the MultipartResolver that this filter should use, taking the current HTTP request as argument.

Default implementation delegates to the lookupMultipartResolver without arguments.

Returns:
the MultipartResolver to use
See Also:
lookupMultipartResolver()

lookupMultipartResolver

protected MultipartResolver lookupMultipartResolver()
Look for a MultipartResolver bean in the root web application context. Supports a "multipartResolverBeanName" filter init param; the default bean name is "filterMultipartResolver".

This can be overridden to use a custom MultipartResolver instance, for example if not using a Spring web application context.

Returns:
the MultipartResolver instance, or null if none found
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StringMultipartFileEditor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.multipart.support
Class StringMultipartFileEditor

java.lang.Object
    extended by  java.beans.PropertyEditorSupport
        extended by  org.springframework.web.multipart.support.StringMultipartFileEditor
All Implemented Interfaces:
PropertyEditor
public class StringMultipartFileEditor
extends PropertyEditorSupport

Custom PropertyEditor for converting MultipartFiles to Strings.

Allows one to specify the charset to use.

Since:
13.10.2003
Author:
Juergen Hoeller

Constructor Summary
StringMultipartFileEditor()
Create a new StringMultipartFileEditor, using the default charset.
StringMultipartFileEditor(String charsetName)
Create a new StringMultipartFileEditor, using the given charset.
Method Summary
void | setAsText(String text)
void | setValue(Object value)
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getAsText, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, supportsCustomEditor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

StringMultipartFileEditor

public StringMultipartFileEditor()
Create a new StringMultipartFileEditor, using the default charset.

StringMultipartFileEditor

public StringMultipartFileEditor(String charsetName)
Create a new StringMultipartFileEditor, using the given charset.

Parameters:
charsetName - valid charset name
See Also:
String.String(byte[],String)
Method Detail

setAsText

public void setAsText(String text)
Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport

setValue

public void setValue(Object value)
Specified by:
setValue in interface PropertyEditor
Overrides:
setValue in class PropertyEditorSupport
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.portlet

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.portlet

Provides JSR-168 portlets that integrate with the application context infrastructure, and the core interfaces and classes for the Portlet variant of Spring's web MVC framework.

See:
Description

Interface Summary
HandlerAdapter | Portlet MVC framework SPI interface, allowing parameterization of core MVC workflow.
HandlerExceptionResolver | Interface to be implemented by objects than can resolve exceptions thrown during handler mapping or execution, in the typical case to error views.
HandlerInterceptor | Workflow interface that allows for customized handler execution chains.
HandlerMapping | Interface to be implemented by objects that define a mapping between requests and handler objects.

Class Summary
DispatcherPortlet | Central dispatcher for use within the Portlet MVC framework, e.g.
FrameworkPortlet | Base portlet for Spring's portlet framework.
GenericPortletBean | Simple extension of javax.portlet.GenericPortlet that treats its config parameters as bean properties.
HandlerExecutionChain | Handler execution chain, consisting of handler object and any handler interceptors.
ModelAndView | Holder for both Model and View in the web MVC framework.

Exception Summary
ModelAndViewDefiningException Exception to be thrown on error conditions that should forward to a specific view with a specific model.

Package org.springframework.web.portlet Description

Provides JSR-168 portlets that integrate with the application context infrastructure, and the core interfaces and classes for the Portlet variant of Spring's web MVC framework.


org.springframework.web.portlet Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.portlet

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.portlet.GenericPortlet (implements javax.portlet.EventPortlet, javax.portlet.Portlet, javax.portlet.PortletConfig, javax.portlet.ResourceServingPortlet)
      • org.springframework.web.portlet.GenericPortletBean
        • org.springframework.web.portlet.FrameworkPortlet (implements org.springframework.context.ApplicationListener<E>)
          • org.springframework.web.portlet.DispatcherPortlet
    • org.springframework.web.portlet.HandlerExecutionChain
    • org.springframework.web.portlet.ModelAndView
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • javax.portlet.PortletException
          • org.springframework.web.portlet.ModelAndViewDefiningException

Interface Hierarchy

  • org.springframework.web.portlet.HandlerAdapter
  • org.springframework.web.portlet.HandlerExceptionResolver
  • org.springframework.web.portlet.HandlerInterceptor
  • org.springframework.web.portlet.HandlerMapping


HandlerAdapter

org.springframework.web.portlet
Interface HandlerAdapter

All Known Implementing Classes:
AnnotationMethodHandlerAdapter, SimpleControllerHandlerAdapter, SimplePortletHandlerAdapter
public interface HandlerAdapter

Portlet MVC framework SPI interface, allowing parameterization of core MVC workflow.

Interface that must be implemented for each handler type to handle a request. This interface is used to allow the DispatcherPortlet to be indefinitely extensible. The DispatcherPortlet accesses all installed handlers through this interface, meaning that it does not contain code specific to any handler type.

Note that a handler can be of type Object. This is to enable handlers from other frameworks to be integrated with this framework without custom coding.

This interface is not intended for application developers. It is available to handlers who want to develop their own web workflow.

Note: Implementations can implement the Ordered interface to be able to specify a sorting order and thus a priority for getting applied by DispatcherPortlet. Non-Ordered instances get treated as lowest priority.

Since:
2.0
Author:
John A. Lewis
See Also:
SimpleControllerHandlerAdapter

Method Summary
void | handleAction(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response, Object handler) Use the given handler to handle this action request.
void | handleEvent(javax.portlet.EventRequest request, javax.portlet.EventResponse response, Object handler) Use the given handler to handle this event request.
ModelAndView | handleRender(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response, Object handler) Use the given handler to handle this render request.
ModelAndView | handleResource(javax.portlet.ResourceRequest request, javax.portlet.ResourceResponse response, Object handler) Use the given handler to handle this resource request.
boolean | supports(Object handler) Given a handler instance, return whether or not this HandlerAdapter can support it.

Method Detail

supports

boolean supports(Object handler)
Given a handler instance, return whether or not this HandlerAdapter can support it. Typical HandlerAdapters will base the decision on the handler type. HandlerAdapters will usually only support one handler type each.

A typical implementation:

return (handler instanceof MyHandler);

Parameters:
handler - handler object to check
Returns:
whether or not this object can use the given handler

handleAction

void handleAction(javax.portlet.ActionRequest request,
                  javax.portlet.ActionResponse response,
                  Object handler)
                  throws Exception
Use the given handler to handle this action request. The workflow that is required may vary widely.

Parameters:
request - current action request
response - current action response
handler - handler to use. This object must have previously been passed to the supports method of this interface, which must have returned true.
Throws:
Exception - in case of errors
See Also:
Portlet.processAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse)

handleRender

ModelAndView handleRender(javax.portlet.RenderRequest request,
                          javax.portlet.RenderResponse response,
                          Object handler)
                          throws Exception
Use the given handler to handle this render request. The workflow that is required may vary widely.

Parameters:
request - current render request
response - current render response
handler - handler to use. This object must have previously been passed to the supports method of this interface, which must have returned true.
Returns:
ModelAndView object with the name of the view and the required model data, or null if the request has been handled directly
Throws:
Exception - in case of errors
See Also:
Portlet.render(javax.portlet.RenderRequest, javax.portlet.RenderResponse)

handleResource

ModelAndView handleResource(javax.portlet.ResourceRequest request,
                            javax.portlet.ResourceResponse response,
                            Object handler)
                            throws Exception
Use the given handler to handle this resource request. The workflow that is required may vary widely.

Parameters:
request - current render request
response - current render response
handler - handler to use. This object must have previously been passed to the supports method of this interface, which must have returned true.
Returns:
ModelAndView object with the name of the view and the required model data, or null if the request has been handled directly
Throws:
Exception - in case of errors
See Also:
ResourceServingPortlet.serveResource(javax.portlet.ResourceRequest, javax.portlet.ResourceResponse)

handleEvent

void handleEvent(javax.portlet.EventRequest request,
                 javax.portlet.EventResponse response,
                 Object handler)
                 throws Exception
Use the given handler to handle this event request. The workflow that is required may vary widely.

Parameters:
request - current action request
response - current action response
handler - handler to use. This object must have previously been passed to the supports method of this interface, which must have returned true.
Throws:
Exception - in case of errors
See Also:
EventPortlet.processEvent(javax.portlet.EventRequest, javax.portlet.EventResponse)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HandlerExceptionResolver

org.springframework.web.portlet
Interface HandlerExceptionResolver

All Known Implementing Classes:
AbstractHandlerExceptionResolver, AnnotationMethodHandlerExceptionResolver, SimpleMappingExceptionResolver
public interface HandlerExceptionResolver

Interface to be implemented by objects than can resolve exceptions thrown during handler mapping or execution, in the typical case to error views. Implementors are typically registered as beans in the application context.

Error views are analogous to the error page JSPs, but can be used with any kind of exception including any checked exception, with potentially fine-granular mappings for specific handlers.

Since:
2.0
Author:
Juergen Hoeller, John A. Lewis

Method Summary
ModelAndView | resolveException(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response, Object handler, Exception ex) Try to resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.
ModelAndView | resolveException(javax.portlet.ResourceRequest request, javax.portlet.ResourceResponse response, Object handler, Exception ex) Try to resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.

Method Detail

resolveException

ModelAndView resolveException(javax.portlet.RenderRequest request,
                              javax.portlet.RenderResponse response,
                              Object handler,
                              Exception ex)
Try to resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.

Parameters:
request - current portlet request
response - current portlet response
handler - the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
ex - the exception that got thrown during handler execution
Returns:
a corresponding ModelAndView to forward to, or null for default processing

resolveException

ModelAndView resolveException(javax.portlet.ResourceRequest request,
                              javax.portlet.ResourceResponse response,
                              Object handler,
                              Exception ex)
Try to resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.

Parameters:
request - current portlet request
response - current portlet response
handler - the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
ex - the exception that got thrown during handler execution
Returns:
a corresponding ModelAndView to forward to, or null for default processing
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HandlerInterceptor

org.springframework.web.portlet
Interface HandlerInterceptor

All Known Implementing Classes:
HandlerInterceptorAdapter, ParameterMappingInterceptor, UserRoleAuthorizationInterceptor, WebRequestHandlerInterceptorAdapter
public interface HandlerInterceptor

Workflow interface that allows for customized handler execution chains. Applications can register any number of existing or custom interceptors for certain groups of handlers, to add common pre-processing behavior without needing to modify each handler implementation.

A HandlerInterceptor gets called before the appropriate HandlerAdapter triggers the execution of the handler itself. This mechanism can be used for a large field of preprocessing aspects, e.g. for authorization checks, or common handler behavior like locale or theme changes. Its main purpose is to permit the factoring out of otherwise repetitive handler code.

Typically an interceptor chain is defined per HandlerMapping bean, sharing its granularity. To be able to apply a certain interceptor chain to a group of handlers, one needs to map the desired handlers via one HandlerMapping bean. The interceptors themselves are defined as beans in the application context, referenced by the mapping bean definition via its "interceptors" property (in XML: a <list> of <ref> elements).

A HandlerInterceptor is basically similar to a Servlet Filter, but in contrast to the latter it allows custom pre-processing with the option to prohibit the execution of the handler itself, and custom post-processing. Filters are more powerful; for example they allow for exchanging the request and response objects that are handed down the chain. Note that a filter gets configured in web.xml, a HandlerInterceptor in the application context.

As a basic guideline, fine-grained handler-related pre-processing tasks are candidates for HandlerInterceptor implementations, especially factored-out common handler code and authorization checks. On the other hand, a Filter is well-suited for request content and view content handling, like multipart forms and GZIP compression. This typically shows when one needs to map the filter to certain content types (e.g. images), or to all requests.

Be aware that filters cannot be applied to portlet requests (they only operate on servlet requests), so for portlet requests interceptors are essential.

If we assume a "sunny day" request cycle (i.e. a request where nothing goes wrong and all is well), the workflow of a HandlerInterceptor will be as follows:

Action Request:

  1. DispatcherPortlet maps the action request to a particular handler and assembles a handler execution chain consisting of the handler that is to be invoked and all of the HandlerInterceptor instances that apply to the request.
  2. preHandleAction(..) is called; if the invocation of this method returns true then this workflow continues
  3. The target handler handles the action request (via HandlerAdapter.handleAction(..))
  4. afterActionCompletion(..) is called

Render Request:

  1. DispatcherPortlet maps the render request to a particular handler and assembles a handler execution chain consisting of the handler that is to be invoked and all of the HandlerInterceptor instances that apply to the request.
  2. preHandleRender(..) is called; if the invocation of this method returns true then this workflow continues
  3. The target handler handles the render request (via HandlerAdapter.handleRender(..))
  4. postHandleRender(..) is called
  5. If the HandlerAdapter returned a ModelAndView, then DispatcherPortlet renders the view accordingly
  6. afterRenderCompletion(..) is called

Since:
2.0
Author:
Juergen Hoeller, John A. Lewis
See Also:
HandlerExecutionChain.getInterceptors(), HandlerMapping, AbstractHandlerMapping.setInterceptors(java.lang.Object[]), HandlerExecutionChain

Method Summary
void | afterActionCompletion(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response, Object handler, Exception ex) Callback after completion of request processing in the action phase, that is, after rendering the view.
void | afterEventCompletion(javax.portlet.EventRequest request, javax.portlet.EventResponse response, Object handler, Exception ex) Callback after completion of request processing in the action phase, that is, after rendering the view.
void | afterRenderCompletion(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response, Object handler, Exception ex) Callback after completion of request processing, that is, after rendering the view.
void | afterResourceCompletion(javax.portlet.ResourceRequest request, javax.portlet.ResourceResponse response, Object handler, Exception ex) Callback after completion of request processing, that is, after rendering the view.
void | postHandleRender(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response, Object handler, ModelAndView modelAndView) Intercept the execution of a handler in the render phase.
void | postHandleResource(javax.portlet.ResourceRequest request, javax.portlet.ResourceResponse response, Object handler, ModelAndView modelAndView) Intercept the execution of a handler in the render phase.
boolean | preHandleAction(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response, Object handler) Intercept the execution of a handler in the action phase.
boolean | preHandleEvent(javax.portlet.EventRequest request, javax.portlet.EventResponse response, Object handler) Intercept the execution of a handler in the action phase.
boolean | preHandleRender(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response, Object handler) Intercept the execution of a handler in the render phase.
boolean | preHandleResource(javax.portlet.ResourceRequest request, javax.portlet.ResourceResponse response, Object handler) Intercept the execution of a handler in the render phase.

Method Detail

preHandleAction

boolean preHandleAction(javax.portlet.ActionRequest request,
                        javax.portlet.ActionResponse response,
                        Object handler)
                        throws Exception
Intercept the execution of a handler in the action phase.

Called after a HandlerMapping determines an appropriate handler object to handle an ActionRequest, but before said HandlerAdapter actually invokes the handler.

DispatcherPortlet processes a handler in an execution chain, consisting of any number of interceptors, with the handler itself at the end. With this method, each interceptor can decide to abort the execution chain, typically throwing an exception or writing a custom response.

Parameters:
request - current portlet action request
response - current portlet action response
handler - chosen handler to execute, for type and/or instance evaluation
Returns:
true if the execution chain should proceed with the next interceptor or the handler itself. Else, DispatcherPortlet assumes that this interceptor has already dealt with the response itself
Throws:
Exception - in case of errors

afterActionCompletion

void afterActionCompletion(javax.portlet.ActionRequest request,
                           javax.portlet.ActionResponse response,
                           Object handler,
                           Exception ex)
                           throws Exception
Callback after completion of request processing in the action phase, that is, after rendering the view. Will be called on any outcome of handler execution, thus allowing for proper resource cleanup.

Note: Will only be called if this interceptor's preHandleAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse, Object) method has successfully completed and returned true!

Parameters:
request - current portlet action request
response - current portlet action response
handler - chosen handler to execute, for type and/or instance examination
ex - exception thrown on handler execution, if any (only included as additional context information for the case where a handler threw an exception; request execution may have failed even when this argument is null)
Throws:
Exception - in case of errors

preHandleRender

boolean preHandleRender(javax.portlet.RenderRequest request,
                        javax.portlet.RenderResponse response,
                        Object handler)
                        throws Exception
Intercept the execution of a handler in the render phase.

Called after a HandlerMapping determines an appropriate handler object to handle a RenderRequest, but before said HandlerAdapter actually invokes the handler.

DispatcherPortlet processes a handler in an execution chain, consisting of any number of interceptors, with the handler itself at the end. With this method, each interceptor can decide to abort the execution chain, typically throwing an exception or writing a custom response.

Parameters:
request - current portlet render request
response - current portlet render response
handler - chosen handler to execute, for type and/or instance evaluation
Returns:
true if the execution chain should proceed with the next interceptor or the handler itself. Else, DispatcherPortlet assumes that this interceptor has already dealt with the response itself
Throws:
Exception - in case of errors

postHandleRender

void postHandleRender(javax.portlet.RenderRequest request,
                      javax.portlet.RenderResponse response,
                      Object handler,
                      ModelAndView modelAndView)
                      throws Exception
Intercept the execution of a handler in the render phase.

Called after a HandlerAdapter actually invoked the handler, but before the DispatcherPortlet renders the view. Can thus expose additional model objects to the view via the given ModelAndView.

DispatcherPortlet processes a handler in an execution chain, consisting of any number of interceptors, with the handler itself at the end. With this method, each interceptor can post-process an execution, getting applied in inverse order of the execution chain.

Parameters:
request - current portlet render request
response - current portlet render response
handler - chosen handler to execute, for type and/or instance examination
modelAndView - the ModelAndView that the handler returned (can also be null)
Throws:
Exception - in case of errors

afterRenderCompletion

void afterRenderCompletion(javax.portlet.RenderRequest request,
                           javax.portlet.RenderResponse response,
                           Object handler,
                           Exception ex)
                           throws Exception
Callback after completion of request processing, that is, after rendering the view. Will be called on any outcome of handler execution, thus allowing for proper resource cleanup.

Note: Will only be called if this interceptor's preHandleRender(javax.portlet.RenderRequest, javax.portlet.RenderResponse, Object) method has successfully completed and returned true!

Parameters:
request - current portlet render request
response - current portlet render response
handler - chosen handler to execute, for type and/or instance examination
ex - exception thrown on handler execution, if any
Throws:
Exception - in case of errors

preHandleResource

boolean preHandleResource(javax.portlet.ResourceRequest request,
                          javax.portlet.ResourceResponse response,
                          Object handler)
                          throws Exception
Intercept the execution of a handler in the render phase.

Called after a HandlerMapping determines an appropriate handler object to handle a RenderRequest, but before said HandlerAdapter actually invokes the handler.

DispatcherPortlet processes a handler in an execution chain, consisting of any number of interceptors, with the handler itself at the end. With this method, each interceptor can decide to abort the execution chain, typically throwing an exception or writing a custom response.

Parameters:
request - current portlet render request
response - current portlet render response
handler - chosen handler to execute, for type and/or instance evaluation
Returns:
true if the execution chain should proceed with the next interceptor or the handler itself. Else, DispatcherPortlet assumes that this interceptor has already dealt with the response itself
Throws:
Exception - in case of errors

postHandleResource

void postHandleResource(javax.portlet.ResourceRequest request,
                        javax.portlet.ResourceResponse response,
                        Object handler,
                        ModelAndView modelAndView)
                        throws Exception
Intercept the execution of a handler in the render phase.

Called after a HandlerAdapter actually invoked the handler, but before the DispatcherPortlet renders the view. Can thus expose additional model objects to the view via the given ModelAndView.

DispatcherPortlet processes a handler in an execution chain, consisting of any number of interceptors, with the handler itself at the end. With this method, each interceptor can post-process an execution, getting applied in inverse order of the execution chain.

Parameters:
request - current portlet render request
response - current portlet render response
handler - chosen handler to execute, for type and/or instance examination
modelAndView - the ModelAndView that the handler returned (can also be null)
Throws:
Exception - in case of errors

afterResourceCompletion

void afterResourceCompletion(javax.portlet.ResourceRequest request,
                             javax.portlet.ResourceResponse response,
                             Object handler,
                             Exception ex)
                             throws Exception
Callback after completion of request processing, that is, after rendering the view. Will be called on any outcome of handler execution, thus allowing for proper resource cleanup.

Note: Will only be called if this interceptor's preHandleRender(javax.portlet.RenderRequest, javax.portlet.RenderResponse, Object) method has successfully completed and returned true!

Parameters:
request - current portlet render request
response - current portlet render response
handler - chosen handler to execute, for type and/or instance examination
ex - exception thrown on handler execution, if any
Throws:
Exception - in case of errors

preHandleEvent

boolean preHandleEvent(javax.portlet.EventRequest request,
                       javax.portlet.EventResponse response,
                       Object handler)
                       throws Exception
Intercept the execution of a handler in the action phase.

Called after a HandlerMapping determines an appropriate handler object to handle an ActionRequest, but before said HandlerAdapter actually invokes the handler.

DispatcherPortlet processes a handler in an execution chain, consisting of any number of interceptors, with the handler itself at the end. With this method, each interceptor can decide to abort the execution chain, typically throwing an exception or writing a custom response.

Parameters:
request - current portlet action request
response - current portlet action response
handler - chosen handler to execute, for type and/or instance evaluation
Returns:
true if the execution chain should proceed with the next interceptor or the handler itself. Else, DispatcherPortlet assumes that this interceptor has already dealt with the response itself
Throws:
Exception - in case of errors

afterEventCompletion

void afterEventCompletion(javax.portlet.EventRequest request,
                          javax.portlet.EventResponse response,
                          Object handler,
                          Exception ex)
                          throws Exception
Callback after completion of request processing in the action phase, that is, after rendering the view. Will be called on any outcome of handler execution, thus allowing for proper resource cleanup.

Note: Will only be called if this interceptor's preHandleAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse, Object) method has successfully completed and returned true!

Parameters:
request - current portlet action request
response - current portlet action response
handler - chosen handler to execute, for type and/or instance examination
ex - exception thrown on handler execution, if any (only included as additional context information for the case where a handler threw an exception; request execution may have failed even when this argument is null)
Throws:
Exception - in case of errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HandlerMapping

org.springframework.web.portlet
Interface HandlerMapping

All Known Implementing Classes:
AbstractHandlerMapping, AbstractMapBasedHandlerMapping, DefaultAnnotationHandlerMapping, ParameterHandlerMapping, PortletModeHandlerMapping, PortletModeParameterHandlerMapping
public interface HandlerMapping

Interface to be implemented by objects that define a mapping between requests and handler objects.

This class can be implemented by application developers, although this is not necessary, as PortletModeHandlerMapping, ParameterHandlerMapping and PortletModeParameterHandlerMapping are included in the framework. The first is the default if no HandlerMapping bean is registered in the portlet application context.

HandlerMapping implementations can support mapped interceptors but do not have to. A handler will always be wrapped in a HandlerExecutionChain instance, optionally accompanied by some HandlerInterceptor instances. The DispatcherPortlet will first call each HandlerInterceptor's preHandle method in the given order, finally invoking the handler itself if all preHandle methods have returned true.

The ability to parameterize this mapping is a powerful and unusual capability of this Portlet MVC framework. For example, it is possible to write a custom mapping based on session state, cookie state or many other variables. No other MVC framework seems to be equally flexible.

Note: Implementations can implement the Ordered interface to be able to specify a sorting order and thus a priority for getting applied by DispatcherPortlet. Non-Ordered instances get treated as lowest priority.

Author:
John A. Lewis, Juergen Hoeller
See Also:
Ordered, AbstractHandlerMapping, PortletModeHandlerMapping, ParameterHandlerMapping, PortletModeParameterHandlerMapping

Method Summary
 HandlerExecutionChain getHandler(javax.portlet.PortletRequest request)
Return a handler and any interceptors for this request.

Method Detail

getHandler

HandlerExecutionChain getHandler(javax.portlet.PortletRequest request)
                                 throws Exception
Return a handler and any interceptors for this request. The choice may be made on portlet mode, session state, or any factor the implementing class chooses.

The returned HandlerExecutionChain contains a handler Object, rather than even a tag interface, so that handlers are not constrained in any way. For example, a HandlerAdapter could be written to allow another framework's handler objects to be used.

Returns null if no match was found. This is not an error. The DispatcherPortlet will query all registered HandlerMapping beans to find a match, and only decide there is an error if none can find a handler.

Parameters:
request - current portlet request
Returns:
a HandlerExecutionChain instance containing handler object and any interceptors, or null if no mapping found
Throws:
Exception - if there is an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DispatcherPortlet

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.portlet
Class DispatcherPortlet

java.lang.Object
    extended by  javax.portlet.GenericPortlet
        extended by  org.springframework.web.portlet.GenericPortletBean
            extended by  org.springframework.web.portlet.FrameworkPortlet
                extended by  org.springframework.web.portlet.DispatcherPortlet
All Implemented Interfaces:
EventListener, javax.portlet.EventPortlet, javax.portlet.Portlet, javax.portlet.PortletConfig, javax.portlet.ResourceServingPortlet, ApplicationListener<ContextRefreshedEvent>
public class DispatcherPortlet
extends FrameworkPortlet

Central dispatcher for use within the Portlet MVC framework, e.g. for web UI controllers. Dispatches to registered handlers for processing a portlet request.

This portlet is very flexible: It can be used with just about any workflow, with the installation of the appropriate adapter classes. It offers the following functionality that distinguishes it from other request-driven portlet MVC frameworks:

  • It is based around a JavaBeans configuration mechanism.
  • It can use any HandlerMapping implementation - pre-built or provided as part of an application - to control the routing of requests to handler objects. Default is a DefaultAnnotationHandlerMapping. HandlerMapping objects can be defined as beans in the portlet's application context, implementing the HandlerMapping interface, overriding the default HandlerMapping if present. HandlerMappings can be given any bean name (they are tested by type).
  • It can use any HandlerAdapter; this allows for using any handler interface. The default adapter is SimpleControllerHandlerAdapter for Spring's Controller interface. A default AnnotationMethodHandlerAdapter will be registered as well. HandlerAdapter objects can be added as beans in the application context, overriding the default HandlerAdapter. Like HandlerMappings, HandlerAdapters can be given any bean name (they are tested by type).
  • The dispatcher's exception resolution strategy can be specified via a HandlerExceptionResolver, for example mapping certain exceptions to error pages. Default is none. Additional HandlerExceptionResolvers can be added through the application context. HandlerExceptionResolver can be given any bean name (they are tested by type).
  • Its view resolution strategy can be specified via a ViewResolver implementation, resolving symbolic view names into View objects. Default is InternalResourceViewResolver. ViewResolver objects can be added as beans in the application context, overriding the default ViewResolver. ViewResolvers can be given any bean name (they are tested by type).
  • The dispatcher's strategy for resolving multipart requests is determined by a PortletMultipartResolver implementation. An implementations for Jakarta Commons FileUpload is included: CommonsPortletMultipartResolver. The MultipartResolver bean name is "portletMultipartResolver"; default is none.

NOTE: The @RequestMapping annotation will only be processed if a corresponding HandlerMapping (for type level annotations) and/or HandlerAdapter (for method level annotations) is present in the dispatcher. This is the case by default. However, if you are defining custom HandlerMappings or HandlerAdapters, then you need to make sure that a corresponding custom DefaultAnnotationHandlerMapping and/or AnnotationMethodHandlerAdapter is defined as well - provided that you intend to use @RequestMapping.

A web application can define any number of DispatcherPortlets. Each portlet will operate in its own namespace, loading its own application context with mappings, handlers, etc. Only the root application context as loaded by ContextLoaderListener, if any, will be shared.

Thanks to Rainer Schmitz and Nick Lothian for their suggestions!

Since:
2.0
Author:
William G. Thompson, Jr., John A. Lewis, Juergen Hoeller
See Also:
Controller, ViewRendererServlet, ContextLoaderListener

Field Summary
static String | ACTION_EXCEPTION_RENDER_PARAMETER This render parameter is used to indicate forward to the render phase that an exception occurred during the action phase.
static String | ACTION_EXCEPTION_SESSION_ATTRIBUTE Unlike the Servlet version of this class, we have to deal with the two-phase nature of the portlet request.
static String | DEFAULT_VIEW_RENDERER_URL Default URL to ViewRendererServlet.
static String | HANDLER_ADAPTER_BEAN_NAME Well-known name for the HandlerAdapter object in the bean factory for this namespace.
static String | HANDLER_EXCEPTION_RESOLVER_BEAN_NAME Well-known name for the HandlerExceptionResolver object in the bean factory for this namespace.
static String | HANDLER_EXECUTION_CHAIN_ATTRIBUTE Request attribute to hold the currently chosen HandlerExecutionChain.
static String | HANDLER_MAPPING_BEAN_NAME Well-known name for the HandlerMapping object in the bean factory for this namespace.
static String | MULTIPART_RESOLVER_BEAN_NAME Well-known name for the PortletMultipartResolver object in the bean factory for this namespace.
static String | PAGE_NOT_FOUND_LOG_CATEGORY Log category to use when no mapped handler is found for a request.
protected static Log | pageNotFoundLogger Additional logger to use when no mapped handler is found for a request.
static String | VIEW_RESOLVER_BEAN_NAME Well-known name for the ViewResolver object in the bean factory for this namespace.
Fields inherited from class org.springframework.web.portlet.FrameworkPortlet
DEFAULT_CONTEXT_CLASS, DEFAULT_NAMESPACE_SUFFIX, DEFAULT_USERINFO_ATTRIBUTE_NAMES, PORTLET_CONTEXT_PREFIX
Fields inherited from class org.springframework.web.portlet.GenericPortletBean
logger
Constructor Summary
DispatcherPortlet()
Method Summary
protected  javax.portlet.ActionRequest checkMultipart(javax.portlet.ActionRequest request)
Convert the request into a multipart request, and make multipart resolver available.
protected  Object createDefaultStrategy(ApplicationContext context, Class<?> clazz)
Create a default strategy.
protected  void doActionService(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response)
Processes the actual dispatching to the handler for action requests.
protected  void doEventService(javax.portlet.EventRequest request, javax.portlet.EventResponse response)
Processes the actual dispatching to the handler for event requests.
protected  void doRender(View view, Map model, javax.portlet.PortletRequest request, javax.portlet.MimeResponse response)
Actually render the given view.
protected  void doRenderService(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
Processes the actual dispatching to the handler for render requests.
protected  void doResourceService(javax.portlet.ResourceRequest request, javax.portlet.ResourceResponse response)
Processes the actual dispatching to the handler for resource requests.
protected
<T> List<T>
getDefaultStrategies(ApplicationContext context, Class<T> strategyInterface)
Create a List of default strategy objects for the given strategy interface.
protected
<T> T
getDefaultStrategy(ApplicationContext context, Class<T> strategyInterface)
Return the default strategy object for the given strategy interface.
protected  HandlerExecutionChain getHandler(javax.portlet.PortletRequest request, boolean cache)
Return the HandlerExecutionChain for this request.
protected  HandlerAdapter getHandlerAdapter(Object handler)
Return the HandlerAdapter for this handler object.
 PortletMultipartResolver getMultipartResolver()
Obtain this portlet's PortletMultipartResolver, if any.
protected  void initStrategies(ApplicationContext context)
Refresh the strategy objects that this portlet uses.
protected  void noHandlerFound(javax.portlet.PortletRequest request, javax.portlet.PortletResponse response)
No handler found -> throw appropriate exception.
 void onRefresh(ApplicationContext context)
This implementation calls initStrategies(org.springframework.context.ApplicationContext).
protected  ModelAndView processHandlerException(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response, Object handler, Exception ex)
Determine an error ModelAndView via the registered HandlerExceptionResolvers.
protected  ModelAndView processHandlerException(javax.portlet.ResourceRequest request, javax.portlet.ResourceResponse response, Object handler, Exception ex)
Determine an error ModelAndView via the registered HandlerExceptionResolvers.
protected  void render(ModelAndView mv, javax.portlet.PortletRequest request, javax.portlet.MimeResponse response)
Render the given ModelAndView.
protected  View resolveViewName(String viewName, Map model, javax.portlet.PortletRequest request)
Resolve the given view name into a View object (to be rendered).
 void setDetectAllHandlerAdapters(boolean detectAllHandlerAdapters)
Set whether to detect all HandlerAdapter beans in this portlet's context.
 void setDetectAllHandlerExceptionResolvers(boolean detectAllHandlerExceptionResolvers)
Set whether to detect all HandlerExceptionResolver beans in this portlet's context.
 void setDetectAllHandlerMappings(boolean detectAllHandlerMappings)
Set whether to detect all HandlerMapping beans in this portlet's context.
 void setDetectAllViewResolvers(boolean detectAllViewResolvers)
Set whether to detect all ViewResolver beans in this portlet's context.
 void setViewRendererUrl(String viewRendererUrl)
Set the URL to the ViewRendererServlet.
Methods inherited from class org.springframework.web.portlet.FrameworkPortlet
buildLocaleContext, createPortletApplicationContext, destroy, doDispatch, getContextClass, getContextConfigLocation, getNamespace, getPortletApplicationContext, getPortletContextAttributeName, getTitle, getUsernameForRequest, initFrameworkPortlet, initPortletApplicationContext, initPortletBean, onApplicationEvent, postProcessPortletApplicationContext, processAction, processEvent, processRequest, refresh, serveResource, setContextClass, setContextConfigLocation, setNamespace, setPublishContext, setPublishEvents, setThreadContextInheritable, setUserinfoUsernameAttributes
Methods inherited from class org.springframework.web.portlet.GenericPortletBean
addRequiredProperty, getPortletContext, getPortletName, init, initBeanWrapper
Methods inherited from class javax.portlet.GenericPortlet
doEdit, doHeaders, doHelp, doView, getContainerRuntimeOptions, getDefaultNamespace, getInitParameter, getInitParameterNames, getNextPossiblePortletModes, getPortletConfig, getProcessingEventQNames, getPublicRenderParameterNames, getPublishingEventQNames, getResourceBundle, getSupportedLocales, init, render
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

MULTIPART_RESOLVER_BEAN_NAME

public static final String MULTIPART_RESOLVER_BEAN_NAME
Well-known name for the PortletMultipartResolver object in the bean factory for this namespace.

See Also:
Constant Field Values

HANDLER_MAPPING_BEAN_NAME

public static final String HANDLER_MAPPING_BEAN_NAME
Well-known name for the HandlerMapping object in the bean factory for this namespace. Only used when "detectAllHandlerMappings" is turned off.

See Also:
setDetectAllViewResolvers(boolean), Constant Field Values

HANDLER_ADAPTER_BEAN_NAME

public static final String HANDLER_ADAPTER_BEAN_NAME
Well-known name for the HandlerAdapter object in the bean factory for this namespace. Only used when "detectAllHandlerAdapters" is turned off.

See Also:
setDetectAllHandlerAdapters(boolean), Constant Field Values

HANDLER_EXCEPTION_RESOLVER_BEAN_NAME

public static final String HANDLER_EXCEPTION_RESOLVER_BEAN_NAME
Well-known name for the HandlerExceptionResolver object in the bean factory for this namespace. Only used when "detectAllHandlerExceptionResolvers" is turned off.

See Also:
setDetectAllViewResolvers(boolean), Constant Field Values

VIEW_RESOLVER_BEAN_NAME

public static final String VIEW_RESOLVER_BEAN_NAME
Well-known name for the ViewResolver object in the bean factory for this namespace.

See Also:
Constant Field Values

DEFAULT_VIEW_RENDERER_URL

public static final String DEFAULT_VIEW_RENDERER_URL
Default URL to ViewRendererServlet. This bridge servlet is used to convert portlet render requests to servlet requests in order to leverage the view support in the org.springframework.web.view package.

See Also:
Constant Field Values

HANDLER_EXECUTION_CHAIN_ATTRIBUTE

public static final String HANDLER_EXECUTION_CHAIN_ATTRIBUTE
Request attribute to hold the currently chosen HandlerExecutionChain. Only used for internal optimizations.

ACTION_EXCEPTION_SESSION_ATTRIBUTE

public static final String ACTION_EXCEPTION_SESSION_ATTRIBUTE
Unlike the Servlet version of this class, we have to deal with the two-phase nature of the portlet request. To do this, we need to pass forward any exception that occurs during the action phase, so that it can be displayed in the render phase. The only direct way to pass things forward and preserve them for each render request is through render parameters, but these are limited to String objects and we need to pass the Exception itself. The only other way to do this is in the session. The bad thing about using the session is that we have no way of knowing when we are done re-rendering the request and so we don't know when we can remove the objects from the session. So we will end up polluting the session with an old exception when we finally leave the render phase of one request and move on to something else.

ACTION_EXCEPTION_RENDER_PARAMETER

public static final String ACTION_EXCEPTION_RENDER_PARAMETER
This render parameter is used to indicate forward to the render phase that an exception occurred during the action phase.

See Also:
Constant Field Values

PAGE_NOT_FOUND_LOG_CATEGORY

public static final String PAGE_NOT_FOUND_LOG_CATEGORY
Log category to use when no mapped handler is found for a request.

See Also:
Constant Field Values

pageNotFoundLogger

protected static final Log pageNotFoundLogger
Additional logger to use when no mapped handler is found for a request.

Constructor Detail

DispatcherPortlet

public DispatcherPortlet()
Method Detail

setDetectAllHandlerMappings

public void setDetectAllHandlerMappings(boolean detectAllHandlerMappings)
Set whether to detect all HandlerMapping beans in this portlet's context. Else, just a single bean with name "handlerMapping" will be expected.

Default is true. Turn this off if you want this portlet to use a single HandlerMapping, despite multiple HandlerMapping beans being defined in the context.

setDetectAllHandlerAdapters

public void setDetectAllHandlerAdapters(boolean detectAllHandlerAdapters)
Set whether to detect all HandlerAdapter beans in this portlet's context. Else, just a single bean with name "handlerAdapter" will be expected.

Default is "true". Turn this off if you want this portlet to use a single HandlerAdapter, despite multiple HandlerAdapter beans being defined in the context.

setDetectAllHandlerExceptionResolvers

public void setDetectAllHandlerExceptionResolvers(boolean detectAllHandlerExceptionResolvers)
Set whether to detect all HandlerExceptionResolver beans in this portlet's context. Else, just a single bean with name "handlerExceptionResolver" will be expected.

Default is true. Turn this off if you want this portlet to use a single HandlerExceptionResolver, despite multiple HandlerExceptionResolver beans being defined in the context.

setDetectAllViewResolvers

public void setDetectAllViewResolvers(boolean detectAllViewResolvers)
Set whether to detect all ViewResolver beans in this portlet's context. Else, just a single bean with name "viewResolver" will be expected.

Default is true. Turn this off if you want this portlet to use a single ViewResolver, despite multiple ViewResolver beans being defined in the context.

setViewRendererUrl

public void setViewRendererUrl(String viewRendererUrl)
Set the URL to the ViewRendererServlet. That servlet is used to ultimately render all views in the portlet application.

onRefresh

public void onRefresh(ApplicationContext context)
This implementation calls initStrategies(org.springframework.context.ApplicationContext).

Overrides:
onRefresh in class FrameworkPortlet
Parameters:
context - the current Portlet ApplicationContext
See Also:
FrameworkPortlet.refresh()

initStrategies

protected void initStrategies(ApplicationContext context)
Refresh the strategy objects that this portlet uses.

May be overridden in subclasses in order to initialize further strategy objects.

getDefaultStrategy

protected <T> T getDefaultStrategy(ApplicationContext context,
                                   Class<T> strategyInterface)
Return the default strategy object for the given strategy interface.

The default implementation delegates to getDefaultStrategies(org.springframework.context.ApplicationContext, java.lang.Class), expecting a single object in the list.

Parameters:
context - the current Portlet ApplicationContext
strategyInterface - the strategy interface
Returns:
the corresponding strategy object
See Also:
getDefaultStrategies(org.springframework.context.ApplicationContext, java.lang.Class)

getDefaultStrategies

protected <T> List<T> getDefaultStrategies(ApplicationContext context,
                                           Class<T> strategyInterface)
Create a List of default strategy objects for the given strategy interface.

The default implementation uses the "DispatcherPortlet.properties" file (in the same package as the DispatcherPortlet class) to determine the class names. It instantiates the strategy objects and satisifies ApplicationContextAware if necessary.

Parameters:
context - the current Portlet ApplicationContext
strategyInterface - the strategy interface
Returns:
the List of corresponding strategy objects

createDefaultStrategy

protected Object createDefaultStrategy(ApplicationContext context,
                                       Class<?> clazz)
Create a default strategy.

The default implementation uses AutowireCapableBeanFactory.createBean(java.lang.Class).

Parameters:
context - the current Portlet ApplicationContext
clazz - the strategy implementation class to instantiate
Returns:
the fully configured strategy instance
See Also:
ApplicationContext.getAutowireCapableBeanFactory()

getMultipartResolver

public PortletMultipartResolver getMultipartResolver()
Obtain this portlet's PortletMultipartResolver, if any.

Returns:
the PortletMultipartResolver used by this portlet, or null if none (indicating that no multipart support is available)

doActionService

protected void doActionService(javax.portlet.ActionRequest request,
                               javax.portlet.ActionResponse response)
                        throws Exception
Processes the actual dispatching to the handler for action requests.

The handler will be obtained by applying the portlet's HandlerMappings in order. The HandlerAdapter will be obtained by querying the portlet's installed HandlerAdapters to find the first that supports the handler class.

Specified by:
doActionService in class FrameworkPortlet
Parameters:
request - current portlet action request
response - current portlet Action response
Throws:
Exception - in case of any kind of processing failure
See Also:
GenericPortlet.processAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse)

doRenderService

protected void doRenderService(javax.portlet.RenderRequest request,
                               javax.portlet.RenderResponse response)
                        throws Exception
Processes the actual dispatching to the handler for render requests.

The handler will be obtained by applying the portlet's HandlerMappings in order. The HandlerAdapter will be obtained by querying the portlet's installed HandlerAdapters to find the first that supports the handler class.

Specified by:
doRenderService in class FrameworkPortlet
Parameters:
request - current portlet render request
response - current portlet render response
Throws:
Exception - in case of any kind of processing failure
See Also:
GenericPortlet.doDispatch(javax.portlet.RenderRequest, javax.portlet.RenderResponse)

doResourceService

protected void doResourceService(javax.portlet.ResourceRequest request,
                                 javax.portlet.ResourceResponse response)
                          throws Exception
Processes the actual dispatching to the handler for resource requests.

The handler will be obtained by applying the portlet's HandlerMappings in order. The HandlerAdapter will be obtained by querying the portlet's installed HandlerAdapters to find the first that supports the handler class.

Specified by:
doResourceService in class FrameworkPortlet
Parameters:
request - current portlet render request
response - current portlet render response
Throws:
Exception - in case of any kind of processing failure
See Also:
GenericPortlet.serveResource(javax.portlet.ResourceRequest, javax.portlet.ResourceResponse)

doEventService

protected void doEventService(javax.portlet.EventRequest request,
                              javax.portlet.EventResponse response)
                       throws Exception
Processes the actual dispatching to the handler for event requests.

The handler will be obtained by applying the portlet's HandlerMappings in order. The HandlerAdapter will be obtained by querying the portlet's installed HandlerAdapters to find the first that supports the handler class.

Specified by:
doEventService in class FrameworkPortlet
Parameters:
request - current portlet action request
response - current portlet Action response
Throws:
Exception - in case of any kind of processing failure
See Also:
GenericPortlet.processEvent(javax.portlet.EventRequest, javax.portlet.EventResponse)

checkMultipart

protected javax.portlet.ActionRequest checkMultipart(javax.portlet.ActionRequest request)
                                              throws MultipartException
Convert the request into a multipart request, and make multipart resolver available. If no multipart resolver is set, simply use the existing request.

Parameters:
request - current HTTP request
Returns:
the processed request (multipart wrapper if necessary)
Throws:
MultipartException

getHandler

protected HandlerExecutionChain getHandler(javax.portlet.PortletRequest request,
                                           boolean cache)
                                    throws Exception
Return the HandlerExecutionChain for this request. Try all handler mappings in order.

Parameters:
request - current portlet request
cache - whether to cache the HandlerExecutionChain in a request attribute
Returns:
the HandlerExceutionChain, or null if no handler could be found
Throws:
Exception

noHandlerFound

protected void noHandlerFound(javax.portlet.PortletRequest request,
                              javax.portlet.PortletResponse response)
                       throws Exception
No handler found -> throw appropriate exception.

Parameters:
request - current portlet request
response - current portlet response
Throws:
Exception - if preparing the response failed

getHandlerAdapter

protected HandlerAdapter getHandlerAdapter(Object handler)
                                    throws javax.portlet.PortletException
Return the HandlerAdapter for this handler object.

Parameters:
handler - the handler object to find an adapter for
Throws:
javax.portlet.PortletException - if no HandlerAdapter can be found for the handler. This is a fatal error.

render

protected void render(ModelAndView mv,
                      javax.portlet.PortletRequest request,
                      javax.portlet.MimeResponse response)
               throws Exception
Render the given ModelAndView. This is the last stage in handling a request. It may involve resolving the view by name.

Parameters:
mv - the ModelAndView to render
request - current portlet render request
response - current portlet render response
Throws:
Exception - if there's a problem rendering the view

resolveViewName

protected View resolveViewName(String viewName,
                               Map model,
                               javax.portlet.PortletRequest request)
                        throws Exception
Resolve the given view name into a View object (to be rendered).

Default implementations asks all ViewResolvers of this dispatcher. Can be overridden for custom resolution strategies, potentially based on specific model attributes or request parameters.

Parameters:
viewName - the name of the view to resolve
model - the model to be passed to the view
request - current portlet render request
Returns:
the View object, or null if none found
Throws:
Exception - if the view cannot be resolved (typically in case of problems creating an actual View object)
See Also:
ViewResolver.resolveViewName(java.lang.String, java.util.Locale)

doRender

protected void doRender(View view,
                        Map model,
                        javax.portlet.PortletRequest request,
                        javax.portlet.MimeResponse response)
                 throws Exception
Actually render the given view.

The default implementation delegates to ViewRendererServlet.

Parameters:
view - the View to render
model - the associated model
request - current portlet render request
response - current portlet render response
Throws:
Exception - if there's a problem rendering the view

processHandlerException

protected ModelAndView processHandlerException(javax.portlet.RenderRequest request,
                                               javax.portlet.RenderResponse response,
                                               Object handler,
                                               Exception ex)
                                        throws Exception
Determine an error ModelAndView via the registered HandlerExceptionResolvers.

Parameters:
request - current portlet request
response - current portlet response
handler - the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
ex - the exception that got thrown during handler execution
Returns:
a corresponding ModelAndView to forward to
Throws:
Exception - if no error ModelAndView found

processHandlerException

protected ModelAndView processHandlerException(javax.portlet.ResourceRequest request,
                                               javax.portlet.ResourceResponse response,
                                               Object handler,
                                               Exception ex)
                                        throws Exception
Determine an error ModelAndView via the registered HandlerExceptionResolvers.

Parameters:
request - current portlet request
response - current portlet response
handler - the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
ex - the exception that got thrown during handler execution
Returns:
a corresponding ModelAndView to forward to
Throws:
Exception - if no error ModelAndView found
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


FrameworkPortlet

org.springframework.web.portlet
Class FrameworkPortlet

java.lang.Object
    extended by  javax.portlet.GenericPortlet
        extended by  org.springframework.web.portlet.GenericPortletBean
            extended by  org.springframework.web.portlet.FrameworkPortlet
All Implemented Interfaces:
EventListener, javax.portlet.EventPortlet, javax.portlet.Portlet, javax.portlet.PortletConfig, javax.portlet.ResourceServingPortlet, ApplicationListener<ContextRefreshedEvent>
Direct Known Subclasses:
DispatcherPortlet
public abstract class FrameworkPortlet
extends GenericPortletBean
implements ApplicationListener<ContextRefreshedEvent>

Base portlet for Spring's portlet framework. Provides integration with a Spring application context, in a JavaBean-based overall solution.

This class offers the following functionality:

  • Manages a Portlet ApplicationContext instance per portlet. The portlet's configuration is determined by beans in the portlet's namespace.
  • Publishes events on request processing, whether or not a request is successfully handled.

Subclasses must implement doActionService(javax.portlet.ActionRequest, javax.portlet.ActionResponse) and doRenderService(javax.portlet.RenderRequest, javax.portlet.RenderResponse) to handle action and render requests. Because this extends GenericPortletBean rather than Portlet directly, bean properties are mapped onto it. Subclasses can override initFrameworkPortlet() for custom initialization.

Regards a "contextClass" parameter at the portlet init-param level, falling back to the default context class (XmlPortletApplicationContext) if not found. Note that, with the default FrameworkPortlet, a context class needs to implement the ConfigurablePortletApplicationContext SPI.

Passes a "contextConfigLocation" portlet init-param to the context instance, parsing it into potentially multiple file paths which can be separated by any number of commas and spaces, like "test-portlet.xml, myPortlet.xml". If not explicitly specified, the context implementation is supposed to build a default location from the namespace of the portlet.

Note: In case of multiple config locations, later bean definitions will override ones defined in earlier loaded files, at least when using one of Spring's default ApplicationContext implementations. This can be leveraged to deliberately override certain bean definitions via an extra XML file.

The default namespace is "'portlet-name'-portlet", e.g. "test-portlet" for a portlet-name "test" (leading to a "/WEB-INF/test-portlet.xml" default location with XmlPortletApplicationContext). The namespace can also be set explicitly via the "namespace" portlet init-param.

Since:
2.0
Author:
William G. Thompson, Jr., John A. Lewis, Juergen Hoeller
See Also:
doActionService(javax.portlet.ActionRequest, javax.portlet.ActionResponse),
doRenderService(javax.portlet.RenderRequest, javax.portlet.RenderResponse),
setContextClass(java.lang.Class),
setContextConfigLocation(java.lang.String),
setNamespace(java.lang.String)

Field Summary
static Class | DEFAULT_CONTEXT_CLASS Default context class for FrameworkPortlet.
static String | DEFAULT_NAMESPACE_SUFFIX Suffix for Portlet ApplicationContext namespaces.
static String[] | DEFAULT_USERINFO_ATTRIBUTE_NAMES Default USER_INFO attribute names to search for the current username: "user.login.id", "user.name".
static String | PORTLET_CONTEXT_PREFIX Prefix for the PortletContext attribute for the Portlet ApplicationContext.
Fields inherited from class org.springframework.web.portlet.GenericPortletBean
logger
Constructor Summary
FrameworkPortlet()
Method Summary
protected LocaleContext | buildLocaleContext(javax.portlet.PortletRequest request) Build a LocaleContext for the given request, exposing the request's primary locale as current locale.
protected ApplicationContext | createPortletApplicationContext(ApplicationContext parent) Instantiate the Portlet ApplicationContext for this portlet, either a default XmlPortletApplicationContext or a custom context class if set.
void | destroy() Close the ApplicationContext of this portlet.
protected abstract void | doActionService(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response) Subclasses must implement this method to do the work of action request handling.
protected void | doDispatch(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response) Delegate render requests to processRequest/doRenderService.
protected abstract void | doEventService(javax.portlet.EventRequest request, javax.portlet.EventResponse response) Subclasses must implement this method to do the work of event request handling.
protected abstract void | doRenderService(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response) Subclasses must implement this method to do the work of render request handling.
protected abstract void | doResourceService(javax.portlet.ResourceRequest request, javax.portlet.ResourceResponse response) Subclasses must implement this method to do the work of resource request handling.
Class | getContextClass() Return the custom context class.
String | getContextConfigLocation() Return the explicit context config location, if any.
String | getNamespace() Return the namespace for this portlet, falling back to default scheme if no custom namespace was set.
ApplicationContext | getPortletApplicationContext() Return this portlet's ApplicationContext.
String | getPortletContextAttributeName() Return the PortletContext attribute name for this portlets's ApplicationContext.
protected String | getTitle(javax.portlet.RenderRequest renderRequest) Overridden for friendlier behavior in unit tests.
protected String | getUsernameForRequest(javax.portlet.PortletRequest request) Determine the username for the given request.
protected void | initFrameworkPortlet() This method will be invoked after any bean properties have been set and the ApplicationContext has been loaded.
protected ApplicationContext | initPortletApplicationContext() Initialize and publish the Portlet ApplicationContext for this portlet.
protected void | initPortletBean() Overridden method of GenericPortletBean, invoked after any bean properties have been set.
void | onApplicationEvent(ContextRefreshedEvent event) ApplicationListener endpoint that receives events from this servlet's WebApplicationContext.
protected void | onRefresh(ApplicationContext context) Template method which can be overridden to add portlet-specific refresh work.
protected void | postProcessPortletApplicationContext(ConfigurableApplicationContext pac) Post-process the given Portlet ApplicationContext before it is refreshed and activated as context for this portlet.
void | processAction(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response) Delegate action requests to processRequest/doActionService.
void | processEvent(javax.portlet.EventRequest request, javax.portlet.EventResponse response)
protected void | processRequest(javax.portlet.PortletRequest request, javax.portlet.PortletResponse response) Process this request, publishing an event regardless of the outcome.
void | refresh() Refresh this portlet's application context, as well as the dependent state of the portlet.
void | serveResource(javax.portlet.ResourceRequest request, javax.portlet.ResourceResponse response)
void | setContextClass(Class contextClass) Set a custom context class.
void | setContextConfigLocation(String contextConfigLocation) Set the context config location explicitly, instead of relying on the default location built from the namespace.
void | setNamespace(String namespace) Set a custom namespace for this portlet, to be used for building a default context config location.
void | setPublishContext(boolean publishContext) Set whether to publish this portlet's context as a PortletContext attribute, available to all objects in the web container.
void | setPublishEvents(boolean publishEvents) Set whether this portlet should publish a PortletRequestHandledEvent at the end of each request.
void | setThreadContextInheritable(boolean threadContextInheritable) Set whether to expose the LocaleContext and RequestAttributes as inheritable for child threads (using an InheritableThreadLocal).
void | setUserinfoUsernameAttributes(String[] userinfoUsernameAttributes) Set the list of attributes to search in the USER_INFO map when trying to find the username of the current user.
Methods inherited from class org.springframework.web.portlet.GenericPortletBean
addRequiredProperty, getPortletContext, getPortletName, init, initBeanWrapper
Methods inherited from class javax.portlet.GenericPortlet
doEdit, doHeaders, doHelp, doView, getContainerRuntimeOptions, getDefaultNamespace, getInitParameter, getInitParameterNames, getNextPossiblePortletModes, getPortletConfig, getProcessingEventQNames, getPublicRenderParameterNames, getPublishingEventQNames, getResourceBundle, getSupportedLocales, init, render
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_CONTEXT_CLASS

public static final Class DEFAULT_CONTEXT_CLASS
Default context class for FrameworkPortlet.

See Also:
XmlPortletApplicationContext

DEFAULT_NAMESPACE_SUFFIX

public static final String DEFAULT_NAMESPACE_SUFFIX
Suffix for Portlet ApplicationContext namespaces. If a portlet of this class is given the name "test" in a context, the namespace used by the portlet will resolve to "test-portlet".

See Also:
Constant Field Values

PORTLET_CONTEXT_PREFIX

public static final String PORTLET_CONTEXT_PREFIX
Prefix for the PortletContext attribute for the Portlet ApplicationContext. The completion is the portlet name.

DEFAULT_USERINFO_ATTRIBUTE_NAMES

public static final String[] DEFAULT_USERINFO_ATTRIBUTE_NAMES
Default USER_INFO attribute names to search for the current username: "user.login.id", "user.name".

Constructor Detail

FrameworkPortlet

public FrameworkPortlet()
Method Detail

setContextClass

public void setContextClass(Class contextClass)
Set a custom context class. This class must be of type ApplicationContext; when using the default FrameworkPortlet implementation, the context class must also implement ConfigurablePortletApplicationContext.

See Also:
createPortletApplicationContext(org.springframework.context.ApplicationContext)

getContextClass

public Class getContextClass()
Return the custom context class.

setNamespace

public void setNamespace(String namespace)
Set a custom namespace for this portlet, to be used for building a default context config location.

getNamespace

public String getNamespace()
Return the namespace for this portlet, falling back to default scheme if no custom namespace was set. (e.g. "test-portlet" for a portlet named "test")

setContextConfigLocation

public void setContextConfigLocation(String contextConfigLocation)
Set the context config location explicitly, instead of relying on the default location built from the namespace. This location string can consist of multiple locations separated by any number of commas and spaces.

getContextConfigLocation

public String getContextConfigLocation()
Return the explicit context config location, if any.

setPublishContext

public void setPublishContext(boolean publishContext)
Set whether to publish this portlet's context as a PortletContext attribute, available to all objects in the web container. Default is true.

This is especially handy during testing, although it is debatable whether it's good practice to let other application objects access the context this way.

setPublishEvents

public void setPublishEvents(boolean publishEvents)
Set whether this portlet should publish a PortletRequestHandledEvent at the end of each request. Default is true; can be turned off for a slight performance improvement, provided that no ApplicationListeners rely on such events.

See Also:
PortletRequestHandledEvent

setThreadContextInheritable

public void setThreadContextInheritable(boolean threadContextInheritable)
Set whether to expose the LocaleContext and RequestAttributes as inheritable for child threads (using an InheritableThreadLocal).

Default is "false", to avoid side effects on spawned background threads. Switch this to "true" to enable inheritance for custom child threads which are spawned during request processing and only used for this request (that is, ending after their initial task, without reuse of the thread).

WARNING: Do not use inheritance for child threads if you are accessing a thread pool which is configured to potentially add new threads on demand (e.g. a JDK ThreadPoolExecutor), since this will expose the inherited context to such a pooled thread.

setUserinfoUsernameAttributes

public void setUserinfoUsernameAttributes(String[] userinfoUsernameAttributes)
Set the list of attributes to search in the USER_INFO map when trying to find the username of the current user.

See Also:
getUsernameForRequest(javax.portlet.PortletRequest)

initPortletBean

protected final void initPortletBean()
                              throws javax.portlet.PortletException
Overridden method of GenericPortletBean, invoked after any bean properties have been set. Creates this portlet's ApplicationContext.

Overrides:
initPortletBean in class GenericPortletBean
Throws:
javax.portlet.PortletException - if subclass initialization fails

initPortletApplicationContext

protected ApplicationContext initPortletApplicationContext()
Initialize and publish the Portlet ApplicationContext for this portlet.

Delegates to createPortletApplicationContext(org.springframework.context.ApplicationContext) for actual creation. Can be overridden in subclasses.

Returns:
the ApplicationContext for this portlet

createPortletApplicationContext

protected ApplicationContext createPortletApplicationContext(ApplicationContext parent)
Instantiate the Portlet ApplicationContext for this portlet, either a default XmlPortletApplicationContext or a custom context class if set.

This implementation expects custom contexts to implement ConfigurablePortletApplicationContext. Can be overridden in subclasses.

Parameters:
parent - the parent ApplicationContext to use, or null if none
Returns:
the Portlet ApplicationContext for this portlet
See Also:
setContextClass(java.lang.Class), XmlPortletApplicationContext

postProcessPortletApplicationContext

protected void postProcessPortletApplicationContext(ConfigurableApplicationContext pac)
Post-process the given Portlet ApplicationContext before it is refreshed and activated as context for this portlet.

The default implementation is empty. refresh() will be called automatically after this method returns.

Parameters:
pac - the configured Portlet ApplicationContext (not refreshed yet)
See Also:
createPortletApplicationContext(org.springframework.context.ApplicationContext), ConfigurableApplicationContext.refresh()

getPortletContextAttributeName

public String getPortletContextAttributeName()
Return the PortletContext attribute name for this portlets's ApplicationContext.

The default implementation returns PORTLET_CONTEXT_PREFIX + portlet name.

See Also:
PORTLET_CONTEXT_PREFIX, GenericPortletBean.getPortletName()

getPortletApplicationContext

public final ApplicationContext getPortletApplicationContext()
Return this portlet's ApplicationContext.

initFrameworkPortlet

protected void initFrameworkPortlet()
                             throws javax.portlet.PortletException
This method will be invoked after any bean properties have been set and the ApplicationContext has been loaded.

The default implementation is empty; subclasses may override this method to perform any initialization they require.

Throws:
javax.portlet.PortletException - in case of an initialization exception

refresh

public void refresh()
Refresh this portlet's application context, as well as the dependent state of the portlet.

See Also:
getPortletApplicationContext(), ConfigurableApplicationContext.refresh()

onApplicationEvent

public void onApplicationEvent(ContextRefreshedEvent event)
ApplicationListener endpoint that receives events from this servlet's WebApplicationContext.

The default implementation calls onRefresh(org.springframework.context.ApplicationContext) in case of a ContextRefreshedEvent, triggering a refresh of this servlet's context-dependent state.

Specified by:
onApplicationEvent in interface ApplicationListener<ContextRefreshedEvent>
Parameters:
event - the incoming ApplicationContext event

onRefresh

protected void onRefresh(ApplicationContext context)
Template method which can be overridden to add portlet-specific refresh work. Called after successful context refresh.

This implementation is empty.

Parameters:
context - the current Portlet ApplicationContext
See Also:
refresh()

getTitle

protected String getTitle(javax.portlet.RenderRequest renderRequest)
Overridden for friendlier behavior in unit tests.

Overrides:
getTitle in class javax.portlet.GenericPortlet

processAction

public final void processAction(javax.portlet.ActionRequest request,
                                javax.portlet.ActionResponse response)
                         throws javax.portlet.PortletException,
                                IOException
Delegate action requests to processRequest/doActionService.

Specified by:
processAction in interface javax.portlet.Portlet
Overrides:
processAction in class javax.portlet.GenericPortlet
Throws:
javax.portlet.PortletException
IOException

doDispatch

protected final void doDispatch(javax.portlet.RenderRequest request,
                                javax.portlet.RenderResponse response)
                         throws javax.portlet.PortletException,
                                IOException
Delegate render requests to processRequest/doRenderService.

Overrides:
doDispatch in class javax.portlet.GenericPortlet
Throws:
javax.portlet.PortletException
IOException

serveResource

public void serveResource(javax.portlet.ResourceRequest request,
                          javax.portlet.ResourceResponse response)
                   throws javax.portlet.PortletException,
                          IOException
Specified by:
serveResource in interface javax.portlet.ResourceServingPortlet
Overrides:
serveResource in class javax.portlet.GenericPortlet
Throws:
javax.portlet.PortletException
IOException

processEvent

public void processEvent(javax.portlet.EventRequest request,
                         javax.portlet.EventResponse response)
                  throws javax.portlet.PortletException,
                         IOException
Specified by:
processEvent in interface javax.portlet.EventPortlet
Overrides:
processEvent in class javax.portlet.GenericPortlet
Throws:
javax.portlet.PortletException
IOException

processRequest

protected final void processRequest(javax.portlet.PortletRequest request,
                                    javax.portlet.PortletResponse response)
                             throws javax.portlet.PortletException,
                                    IOException
Process this request, publishing an event regardless of the outcome. The actual event handling is performed by the abstract doActionService() and doRenderService() template methods.

Throws:
javax.portlet.PortletException
IOException
See Also:
doActionService(javax.portlet.ActionRequest, javax.portlet.ActionResponse), doRenderService(javax.portlet.RenderRequest, javax.portlet.RenderResponse)

buildLocaleContext

protected LocaleContext buildLocaleContext(javax.portlet.PortletRequest request)
Build a LocaleContext for the given request, exposing the request's primary locale as current locale.

Parameters:
request - current HTTP request
Returns:
the corresponding LocaleContext

getUsernameForRequest

protected String getUsernameForRequest(javax.portlet.PortletRequest request)
Determine the username for the given request.

The default implementation first tries the UserPrincipal. If that does not exist, then it checks the USER_INFO map. Can be overridden in subclasses.

Parameters:
request - current portlet request
Returns:
the username, or null if none found
See Also:
PortletRequest.getUserPrincipal(), PortletRequest.getRemoteUser(), PortletRequest.USER_INFO, setUserinfoUsernameAttributes(java.lang.String[])

doActionService

protected abstract void doActionService(javax.portlet.ActionRequest request,
                                        javax.portlet.ActionResponse response)
                                 throws Exception
Subclasses must implement this method to do the work of action request handling.

The contract is essentially the same as that for the processAction method of GenericPortlet.

This class intercepts calls to ensure that exception handling and event publication takes place.

Parameters:
request - current action request
response - current action response
Throws:
Exception - in case of any kind of processing failure
See Also:
GenericPortlet.processAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse)

doRenderService

protected abstract void doRenderService(javax.portlet.RenderRequest request,
                                        javax.portlet.RenderResponse response)
                                 throws Exception
Subclasses must implement this method to do the work of render request handling.

The contract is essentially the same as that for the doDispatch method of GenericPortlet.

This class intercepts calls to ensure that exception handling and event publication takes place.

Parameters:
request - current render request
response - current render response
Throws:
Exception - in case of any kind of processing failure
See Also:
GenericPortlet.doDispatch(javax.portlet.RenderRequest, javax.portlet.RenderResponse)

doResourceService

protected abstract void doResourceService(javax.portlet.ResourceRequest request,
                                          javax.portlet.ResourceResponse response)
                                   throws Exception
Subclasses must implement this method to do the work of resource request handling.

The contract is essentially the same as that for the serveResource method of GenericPortlet.

This class intercepts calls to ensure that exception handling and event publication takes place.

Parameters:
request - current resource request
response - current resource response
Throws:
Exception - in case of any kind of processing failure
See Also:
GenericPortlet.serveResource(javax.portlet.ResourceRequest, javax.portlet.ResourceResponse)

doEventService

protected abstract void doEventService(javax.portlet.EventRequest request,
                                       javax.portlet.EventResponse response)
                                throws Exception
Subclasses must implement this method to do the work of event request handling.

The contract is essentially the same as that for the processEvent method of GenericPortlet.

This class intercepts calls to ensure that exception handling and event publication takes place.

Parameters:
request - current event request
response - current event response
Throws:
Exception - in case of any kind of processing failure
See Also:
GenericPortlet.processEvent(javax.portlet.EventRequest, javax.portlet.EventResponse)

destroy

public void destroy()
Close the ApplicationContext of this portlet.

Specified by:
destroy in interface javax.portlet.Portlet
Overrides:
destroy in class javax.portlet.GenericPortlet
See Also:
ConfigurableApplicationContext.close()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


GenericPortletBean

org.springframework.web.portlet
Class GenericPortletBean

java.lang.Object
    extended by  javax.portlet.GenericPortlet
        extended by  org.springframework.web.portlet.GenericPortletBean
All Implemented Interfaces:
javax.portlet.EventPortlet, javax.portlet.Portlet, javax.portlet.PortletConfig, javax.portlet.ResourceServingPortlet
Direct Known Subclasses:
FrameworkPortlet
public abstract class GenericPortletBean
extends javax.portlet.GenericPortlet

Simple extension of javax.portlet.GenericPortlet that treats its config parameters as bean properties.

A very handy superclass for any type of portlet. Type conversion is automatic. It is also possible for subclasses to specify required properties.

This portlet leaves request handling to subclasses, inheriting the default behaviour of GenericPortlet (doDispatch, processAction, etc).

This portlet superclass has no dependency on a Spring application context, in contrast to the FrameworkPortlet class which loads its own context.

Since:
2.0
Author:
William G. Thompson, Jr., John A. Lewis, Juergen Hoeller
See Also:
addRequiredProperty(java.lang.String),
initPortletBean(),
GenericPortlet.doDispatch(javax.portlet.RenderRequest, javax.portlet.RenderResponse),
GenericPortlet.processAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse),
FrameworkPortlet

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
GenericPortletBean()
Method Summary
protected void | addRequiredProperty(String property) Subclasses can invoke this method to specify that this property (which must match a JavaBean property they expose) is mandatory, and must be supplied as a config parameter.
javax.portlet.PortletContext | getPortletContext() Overridden method that simply returns null when no PortletConfig set yet.
String | getPortletName() Overridden method that simply returns null when no PortletConfig set yet.
void | init() Map config parameters onto bean properties of this portlet, and invoke subclass initialization.
protected void | initBeanWrapper(BeanWrapper bw) Initialize the BeanWrapper for this GenericPortletBean, possibly with custom editors.
protected void | initPortletBean() Subclasses may override this to perform custom initialization.
Methods inherited from class javax.portlet.GenericPortlet
destroy, doDispatch, doEdit, doHeaders, doHelp, doView, getContainerRuntimeOptions, getDefaultNamespace, getInitParameter, getInitParameterNames, getNextPossiblePortletModes, getPortletConfig, getProcessingEventQNames, getPublicRenderParameterNames, getPublishingEventQNames, getResourceBundle, getSupportedLocales, getTitle, init, processAction, processEvent, render, serveResource
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

GenericPortletBean

public GenericPortletBean()
Method Detail

addRequiredProperty

protected final void addRequiredProperty(String property)
Subclasses can invoke this method to specify that this property (which must match a JavaBean property they expose) is mandatory, and must be supplied as a config parameter. This method would normally be called from a subclass constructor.

Parameters:
property - name of the required property

init

public final void init()
                throws javax.portlet.PortletException
Map config parameters onto bean properties of this portlet, and invoke subclass initialization.

Overrides:
init in class javax.portlet.GenericPortlet
Throws:
javax.portlet.PortletException - if bean properties are invalid (or required properties are missing), or if subclass initialization fails.

initBeanWrapper

protected void initBeanWrapper(BeanWrapper bw)
                        throws BeansException
Initialize the BeanWrapper for this GenericPortletBean, possibly with custom editors.

Parameters:
bw - the BeanWrapper to initialize
Throws:
BeansException - if thrown by BeanWrapper methods
See Also:
PropertyEditorRegistry.registerCustomEditor(java.lang.Class, java.beans.PropertyEditor)

getPortletName

public final String getPortletName()
Overridden method that simply returns null when no PortletConfig set yet.

Specified by:
getPortletName in interface javax.portlet.PortletConfig
Overrides:
getPortletName in class javax.portlet.GenericPortlet
See Also:
GenericPortlet.getPortletConfig()

getPortletContext

public final javax.portlet.PortletContext getPortletContext()
Overridden method that simply returns null when no PortletConfig set yet.

Specified by:
getPortletContext in interface javax.portlet.PortletConfig
Overrides:
getPortletContext in class javax.portlet.GenericPortlet
See Also:
GenericPortlet.getPortletConfig()

initPortletBean

protected void initPortletBean()
                        throws javax.portlet.PortletException
Subclasses may override this to perform custom initialization. All bean properties of this portlet will have been set before this method is invoked. This default implementation does nothing.

Throws:
javax.portlet.PortletException - if subclass initialization fails
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HandlerExecutionChain

org.springframework.web.portlet
Class HandlerExecutionChain

java.lang.Object
    extended by  org.springframework.web.portlet.HandlerExecutionChain

public class HandlerExecutionChain
extends Object

Handler execution chain, consisting of handler object and any handler interceptors. Returned by HandlerMapping's HandlerMapping.getHandler(javax.portlet.PortletRequest) method.

Since:
2.0
Author:
Juergen Hoeller, John A. Lewis
See Also:
HandlerInterceptor

Constructor Summary
HandlerExecutionChain(Object handler)
Create a new HandlerExecutionChain.
HandlerExecutionChain(Object handler, HandlerInterceptor[] interceptors)
Create a new HandlerExecutionChain.
Method Summary
 void addInterceptor(HandlerInterceptor interceptor)
 void addInterceptors(HandlerInterceptor[] interceptors)
 Object getHandler()
Return the handler object to execute.
 HandlerInterceptor[] getInterceptors()
Return the array of interceptors to apply (in the given order).
 String toString()
Delegates to the handler's toString().
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

HandlerExecutionChain

public HandlerExecutionChain(Object handler)
Create a new HandlerExecutionChain.

Parameters:
handler - the handler object to execute

HandlerExecutionChain

public HandlerExecutionChain(Object handler,
                             HandlerInterceptor[] interceptors)
Create a new HandlerExecutionChain.

Parameters:
handler - the handler object to execute
interceptors - the array of interceptors to apply (in the given order) before the handler itself executes
Method Detail

getHandler

public Object getHandler()
Return the handler object to execute.

Returns:
the handler object

addInterceptor

public void addInterceptor(HandlerInterceptor interceptor)

addInterceptors

public void addInterceptors(HandlerInterceptor[] interceptors)

getInterceptors

public HandlerInterceptor[] getInterceptors()
Return the array of interceptors to apply (in the given order).

Returns:
the array of HandlerInterceptors instances (may be null)

toString

public String toString()
Delegates to the handler's toString().

Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ModelAndView

org.springframework.web.portlet
Class ModelAndView

java.lang.Object
    extended by  org.springframework.web.portlet.ModelAndView

public class ModelAndView
extends Object

Holder for both Model and View in the web MVC framework. Note that these are entirely distinct. This class merely holds both to make it possible for a controller to return both model and view in a single return value.

Represents a model and view returned by a handler, to be resolved by a DispatcherPortlet. The view can take the form of a String view name which will need to be resolved by a ViewResolver object; alternatively a view object can be specified directly. The model is a Map, allowing the use of multiple objects keyed by name.

Since:
2.0
Author:
Juergen Hoeller
See Also:
DispatcherPortlet, ViewResolver, HandlerAdapter, Controller

Constructor Summary
ModelAndView()
Default constructor for bean-style usage: populating bean properties instead of passing in constructor arguments.
ModelAndView(Object view)
Convenient constructor when there is no model data to expose.
ModelAndView(Object view, Map<String,?> model)
Create a new ModelAndView given a View object and a model.
ModelAndView(Object view, String modelName, Object modelObject)
Convenient constructor to take a single model object.
ModelAndView(String viewName)
Convenient constructor when there is no model data to expose.
ModelAndView(String viewName, Map<String,?> model)
Create a new ModelAndView given a view name and a model.
ModelAndView(String viewName, String modelName, Object modelObject)
Convenient constructor to take a single model object.
Method Summary
 ModelAndView addAllObjects(Map<String,?> modelMap)
Add all attributes contained in the provided Map to the model.
 ModelAndView addObject(Object attributeValue)
Add an attribute to the model using parameter name generation.
 ModelAndView addObject(String attributeName, Object attributeValue)
Add an attribute to the model.
 void clear()
Clear the state of this ModelAndView object.
 Map<String,Object> getModel()
Return the model map.
protected  Map<String,Object> getModelInternal()
Return the model map.
 ModelMap getModelMap()
Return the underlying ModelMap instance (never null).
 Object getView()
Return the View object, or null if we are using a view name to be resolved by the DispatcherPortlet via a ViewResolver.
 String getViewName()
Return the view name to be resolved by the DispatcherPortlet via a ViewResolver, or null if we are using a view object.
 boolean hasView()
Indicate whether or not this ModelAndView has a view, either as a view name or as a direct view instance.
 boolean isEmpty()
Return whether this ModelAndView object is empty, i.e.
 boolean isReference()
Return whether we use a view reference, i.e.
 void setView(Object view)
Set a View object for this ModelAndView.
 void setViewName(String viewName)
Set a view name for this ModelAndView, to be resolved by the DispatcherPortlet via a ViewResolver.
 String toString()
Return diagnostic information about this model and view.
 boolean wasCleared()
Return whether this ModelAndView object is empty as a result of a call to clear() i.e.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ModelAndView

public ModelAndView()
Default constructor for bean-style usage: populating bean properties instead of passing in constructor arguments.

See Also:
setView(Object), setViewName(String)

ModelAndView

public ModelAndView(String viewName)
Convenient constructor when there is no model data to expose. Can also be used in conjunction with addObject.

Parameters:
viewName - name of the View to render, to be resolved by the DispatcherPortlet's ViewResolver
See Also:
addObject(java.lang.String, java.lang.Object)

ModelAndView

public ModelAndView(Object view)
Convenient constructor when there is no model data to expose. Can also be used in conjunction with addObject.

Parameters:
view - View object to render (usually a Servlet MVC View object)
See Also:
addObject(java.lang.String, java.lang.Object)

ModelAndView

public ModelAndView(String viewName,
                    Map<String,?> model)
Create a new ModelAndView given a view name and a model.

Parameters:
viewName - name of the View to render, to be resolved by the DispatcherPortlet's ViewResolver
model - Map of model names (Strings) to model objects (Objects). Model entries may not be null, but the model Map may be null if there is no model data.

ModelAndView

public ModelAndView(Object view,
                    Map<String,?> model)
Create a new ModelAndView given a View object and a model.

Parameters:
view - View object to render (usually a Servlet MVC View object)
model - Map of model names (Strings) to model objects (Objects). Model entries may not be null, but the model Map may be null if there is no model data.

ModelAndView

public ModelAndView(String viewName,
                    String modelName,
                    Object modelObject)
Convenient constructor to take a single model object.

Parameters:
viewName - name of the View to render, to be resolved by the DispatcherPortlet's ViewResolver
modelName - name of the single entry in the model
modelObject - the single model object

ModelAndView

public ModelAndView(Object view,
                    String modelName,
                    Object modelObject)
Convenient constructor to take a single model object.

Parameters:
view - View object to render (usually a Servlet MVC View object)
modelName - name of the single entry in the model
modelObject - the single model object
Method Detail

setViewName

public void setViewName(String viewName)
Set a view name for this ModelAndView, to be resolved by the DispatcherPortlet via a ViewResolver. Will override any pre-existing view name or View.

getViewName

public String getViewName()
Return the view name to be resolved by the DispatcherPortlet via a ViewResolver, or null if we are using a view object.

setView

public void setView(Object view)
Set a View object for this ModelAndView. Will override any pre-existing view name or View.

The given View object will usually be a Servlet MVC View object. This is nevertheless typed as Object to avoid a Servlet API dependency in the Portlet ModelAndView class.

getView

public Object getView()
Return the View object, or null if we are using a view name to be resolved by the DispatcherPortlet via a ViewResolver.

hasView

public boolean hasView()
Indicate whether or not this ModelAndView has a view, either as a view name or as a direct view instance.

isReference

public boolean isReference()
Return whether we use a view reference, i.e. true if the view has been specified via a name to be resolved by the DispatcherPortlet via a ViewResolver.

getModelInternal

protected Map<String,Object> getModelInternal()
Return the model map. May return null. Called by DispatcherPortlet for evaluation of the model.

getModelMap

public ModelMap getModelMap()
Return the underlying ModelMap instance (never null).

getModel

public Map<String,Object> getModel()
Return the model map. Never returns null. To be called by application code for modifying the model.

addObject

public ModelAndView addObject(String attributeName,
                              Object attributeValue)
Add an attribute to the model.

Parameters:
attributeName - name of the object to add to the model
attributeValue - object to add to the model (never null)
See Also:
ModelMap.addAttribute(String, Object), getModelMap()

addObject

public ModelAndView addObject(Object attributeValue)
Add an attribute to the model using parameter name generation.

Parameters:
attributeValue - the object to add to the model (never null)
See Also:
ModelMap.addAttribute(Object), getModelMap()

addAllObjects

public ModelAndView addAllObjects(Map<String,?> modelMap)
Add all attributes contained in the provided Map to the model.

Parameters:
modelMap - a Map of attributeName -> attributeValue pairs
See Also:
ModelMap.addAllAttributes(Map), getModelMap()

clear

public void clear()
Clear the state of this ModelAndView object. The object will be empty afterwards.

Can be used to suppress rendering of a given ModelAndView object in the postHandleRender method of a HandlerInterceptor.

See Also:
isEmpty(), HandlerInterceptor.postHandleRender(javax.portlet.RenderRequest, javax.portlet.RenderResponse, java.lang.Object, org.springframework.web.portlet.ModelAndView)

isEmpty

public boolean isEmpty()
Return whether this ModelAndView object is empty, i.e. whether it does not hold any view and does not contain a model.

wasCleared

public boolean wasCleared()
Return whether this ModelAndView object is empty as a result of a call to clear() i.e. whether it does not hold any view and does not contain a model. Returns false if any additional state was added to the instance after the call to clear().

See Also:
clear()

toString

public String toString()
Return diagnostic information about this model and view.

Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ModelAndViewDefiningException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.portlet
Class ModelAndViewDefiningException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.portlet.PortletException
                extended by  org.springframework.web.portlet.ModelAndViewDefiningException
All Implemented Interfaces:
Serializable
public class ModelAndViewDefiningException
extends javax.portlet.PortletException

Exception to be thrown on error conditions that should forward to a specific view with a specific model.

Can be thrown at any time during handler processing. This includes any template methods of pre-built controllers. For example, a form controller might abort to a specific error page if certain parameters do not allow to proceed with the normal workflow.

Since:
2.0
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
ModelAndViewDefiningException(ModelAndView modelAndView)
Create new ModelAndViewDefiningException with the given ModelAndView, typically representing a specific error page.
Method Summary
 ModelAndView getModelAndView()
Return the ModelAndView that this exception contains for forwarding to.
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ModelAndViewDefiningException

public ModelAndViewDefiningException(ModelAndView modelAndView)
Create new ModelAndViewDefiningException with the given ModelAndView, typically representing a specific error page.

Parameters:
modelAndView - ModelAndView with view to forward to and model to expose
Method Detail

getModelAndView

public ModelAndView getModelAndView()
Return the ModelAndView that this exception contains for forwarding to.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.portlet.bind

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.portlet.bind

Provides portlet-specific data binding functionality.

See:
Description

Class Summary
PortletRequestDataBinder | Special DataBinder to perform data binding from portlet request parameters to JavaBeans, including support for multipart files.
PortletRequestParameterPropertyValues | PropertyValues implementation created from parameters in a PortletRequest.
PortletRequestUtils | Parameter extraction methods, for an approach distinct from data binding, in which parameters of specific types are required.

Exception Summary
MissingPortletRequestParameterException | PortletRequestBindingException subclass that indicates a missing parameter.
PortletRequestBindingException | Fatal binding exception, thrown when we want to treat binding exceptions as unrecoverable.

Package org.springframework.web.portlet.bind Description

Provides portlet-specific data binding functionality.


org.springframework.web.portlet.bind Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.portlet.bind

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.validation.DataBinder (implements org.springframework.beans.PropertyEditorRegistry, org.springframework.beans.TypeConverter)
      • org.springframework.web.bind.WebDataBinder
        • org.springframework.web.portlet.bind.PortletRequestDataBinder
    • org.springframework.beans.MutablePropertyValues (implements org.springframework.beans.PropertyValues, java.io.Serializable)
      • org.springframework.web.portlet.bind.PortletRequestParameterPropertyValues
    • org.springframework.web.portlet.bind.PortletRequestUtils
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • javax.portlet.PortletException
          • org.springframework.web.portlet.bind.PortletRequestBindingException
            • org.springframework.web.portlet.bind.MissingPortletRequestParameterException


PortletRequestDataBinder

org.springframework.web.portlet.bind
Class PortletRequestDataBinder

java.lang.Object
    extended by  org.springframework.validation.DataBinder
        extended by  org.springframework.web.bind.WebDataBinder
            extended by  org.springframework.web.portlet.bind.PortletRequestDataBinder
All Implemented Interfaces:
PropertyEditorRegistry, TypeConverter
public class PortletRequestDataBinder
extends WebDataBinder

Special DataBinder to perform data binding from portlet request parameters to JavaBeans, including support for multipart files.

See the DataBinder/WebDataBinder superclasses for customization options, which include specifying allowed/required fields, and registering custom property editors.

Used by Spring Portlet MVC's BaseCommandController. Note that BaseCommandController and its subclasses allow for easy customization of the binder instances that they use through overriding initBinder.

Can also be used for manual data binding in custom web controllers: for example, in a plain Portlet Controller implementation. Simply instantiate a PortletRequestDataBinder for each binding process, and invoke bind with the current PortletRequest as argument:

 MyBean myBean = new MyBean();
 // apply binder to custom target object
 PortletRequestDataBinder binder = new PortletRequestDataBinder(myBean);
 // register custom editors, if desired
 binder.registerCustomEditor(...);
 // trigger actual binding of request parameters
 binder.bind(request);
 // optionally evaluate binding errors
 Errors errors = binder.getErrors();
 ...

Since:
2.0
Author:
Juergen Hoeller, John A. Lewis
See Also:
bind(javax.portlet.PortletRequest),
DataBinder.registerCustomEditor(java.lang.Class, java.beans.PropertyEditor),
DataBinder.setAllowedFields(java.lang.String...),
DataBinder.setRequiredFields(java.lang.String...),
WebDataBinder.setFieldMarkerPrefix(java.lang.String),
BaseCommandController.initBinder(javax.portlet.PortletRequest, org.springframework.web.portlet.bind.PortletRequestDataBinder)

Field Summary
Fields inherited from class org.springframework.web.bind.WebDataBinder
DEFAULT_FIELD_DEFAULT_PREFIX, DEFAULT_FIELD_MARKER_PREFIX
Fields inherited from class org.springframework.validation.DataBinder
DEFAULT_OBJECT_NAME, logger
Constructor Summary
PortletRequestDataBinder(Object target)
Create a new PortletRequestDataBinder instance, with default object name.
PortletRequestDataBinder(Object target, String objectName)
Create a new PortletRequestDataBinder instance.
Method Summary
void | bind(javax.portlet.PortletRequest request) Bind the parameters of the given request to this binder's target, also binding multipart files in case of a multipart request.
void | closeNoCatch() Treats errors as fatal.
Methods inherited from class org.springframework.web.bind.WebDataBinder
bindMultipartFiles, checkFieldDefaults, checkFieldMarkers, doBind, getEmptyValue, getFieldDefaultPrefix, getFieldMarkerPrefix, isBindEmptyMultipartFiles, setBindEmptyMultipartFiles, setFieldDefaultPrefix, setFieldMarkerPrefix
Methods inherited from class org.springframework.validation.DataBinder
applyPropertyValues, bind, checkAllowedFields, checkRequiredFields, close, convertIfNecessary, convertIfNecessary, findCustomEditor, getAllowedFields, getBindingErrorProcessor, getBindingResult, getConversionService, getDisallowedFields, getErrors, getInternalBindingResult, getObjectName, getPropertyAccessor, getPropertyEditorRegistry, getRequiredFields, getSimpleTypeConverter, getTarget, getTypeConverter, getValidator, initBeanPropertyAccess, initDirectFieldAccess, isAllowed, isAutoGrowNestedPaths, isIgnoreInvalidFields, isIgnoreUnknownFields, registerCustomEditor, registerCustomEditor, setAllowedFields, setAutoGrowNestedPaths, setBindingErrorProcessor, setConversionService, setDisallowedFields, setExtractOldValueForEditor, setIgnoreInvalidFields, setIgnoreUnknownFields, setMessageCodesResolver, setRequiredFields, setValidator, validate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PortletRequestDataBinder

public PortletRequestDataBinder(Object target)
Create a new PortletRequestDataBinder instance, with default object name.

Parameters:
target - the target object to bind onto (or null if the binder is just used to convert a plain parameter value)
See Also:
DataBinder.DEFAULT_OBJECT_NAME

PortletRequestDataBinder

public PortletRequestDataBinder(Object target,
                                String objectName)
Create a new PortletRequestDataBinder instance.

Parameters:
target - the target object to bind onto (or null if the binder is just used to convert a plain parameter value)
objectName - the name of the target object
Method Detail

bind

public void bind(javax.portlet.PortletRequest request)
Bind the parameters of the given request to this binder's target, also binding multipart files in case of a multipart request.

This call can create field errors, representing basic binding errors like a required field (code "required"), or type mismatch between value and bean property (code "typeMismatch").

Multipart files are bound via their parameter name, just like normal HTTP parameters: i.e. "uploadedFile" to an "uploadedFile" bean property, invoking a "setUploadedFile" setter method.

The type of the target property for a multipart file can be MultipartFile, byte[], or String. The latter two receive the contents of the uploaded file; all metadata like original file name, content type, etc are lost in those cases.

Parameters:
request - request with parameters to bind (can be multipart)
See Also:
MultipartActionRequest, MultipartFile, WebDataBinder.bindMultipartFiles(java.util.Map, org.springframework.beans.MutablePropertyValues), DataBinder.bind(org.springframework.beans.PropertyValues)

closeNoCatch

public void closeNoCatch()
                  throws PortletRequestBindingException
Treats errors as fatal.

Use this method only if it's an error if the input isn't valid. This might be appropriate if all input is from dropdowns, for example.

Throws:
PortletRequestBindingException - subclass of PortletException on any binding problem
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PortletRequestParameterPropertyValues

org.springframework.web.portlet.bind
Class PortletRequestParameterPropertyValues

java.lang.Object
    extended by  org.springframework.beans.MutablePropertyValues
        extended by  org.springframework.web.portlet.bind.PortletRequestParameterPropertyValues
All Implemented Interfaces:
Serializable, PropertyValues
public class PortletRequestParameterPropertyValues
extends MutablePropertyValues

PropertyValues implementation created from parameters in a PortletRequest. Can look for all property values beginning with a certain prefix and prefix separator (default is "_").

For example, with a prefix of "spring", "spring_param1" and "spring_param2" result in a Map with "param1" and "param2" as keys.

This class is not immutable to be able to efficiently remove property values that should be ignored for binding.

Since:
2.0
Author:
Juergen Hoeller, John A. Lewis
See Also:
PortletUtils.getParametersStartingWith(javax.portlet.PortletRequest, java.lang.String), Serialized Form

Field Summary
static String DEFAULT_PREFIX_SEPARATOR
Default prefix separator
Constructor Summary
PortletRequestParameterPropertyValues(javax.portlet.PortletRequest request)
Create new PortletRequestPropertyValues using no prefix (and hence, no prefix separator).
PortletRequestParameterPropertyValues(javax.portlet.PortletRequest request, String prefix)
Create new PortletRequestPropertyValues using the given prefix and the default prefix separator (the underscore character "_").
PortletRequestParameterPropertyValues(javax.portlet.PortletRequest request, String prefix, String prefixSeparator)
Create new PortletRequestPropertyValues supplying both prefix and prefix separator.
Method Summary
Methods inherited from class org.springframework.beans.MutablePropertyValues
add, addPropertyValue, addPropertyValue, addPropertyValues, addPropertyValues, changesSince, contains, equals, getPropertyValue, getPropertyValueList, getPropertyValues, hashCode, isConverted, isEmpty, registerProcessedProperty, removePropertyValue, removePropertyValue, setConverted, setPropertyValueAt, size, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail

DEFAULT_PREFIX_SEPARATOR

public static final String DEFAULT_PREFIX_SEPARATOR
Default prefix separator

See Also:
Constant Field Values
Constructor Detail

PortletRequestParameterPropertyValues

public PortletRequestParameterPropertyValues(javax.portlet.PortletRequest request)
Create new PortletRequestPropertyValues using no prefix (and hence, no prefix separator).

Parameters:
request - portlet request

PortletRequestParameterPropertyValues

public PortletRequestParameterPropertyValues(javax.portlet.PortletRequest request,
                                             String prefix)
Create new PortletRequestPropertyValues using the given prefix and the default prefix separator (the underscore character "_").

Parameters:
request - portlet request
prefix - the prefix for parameters (the full prefix will consist of this plus the separator)
See Also:
DEFAULT_PREFIX_SEPARATOR

PortletRequestParameterPropertyValues

public PortletRequestParameterPropertyValues(javax.portlet.PortletRequest request,
                                             String prefix,
                                             String prefixSeparator)
Create new PortletRequestPropertyValues supplying both prefix and prefix separator.

Parameters:
request - portlet request
prefix - the prefix for parameters (the full prefix will consist of this plus the separator)
prefixSeparator - separator delimiting prefix (e.g. "spring") and the rest of the parameter name ("param1", "param2")
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PortletRequestUtils

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.portlet.bind
Class PortletRequestUtils

java.lang.Object
    extended by  org.springframework.web.portlet.bind.PortletRequestUtils

public abstract class PortletRequestUtils
extends Object

Parameter extraction methods, for an approach distinct from data binding, in which parameters of specific types are required.

This approach is very useful for simple submissions, where binding request parameters to a command object would be overkill.

Since:
2.0
Author:
Juergen Hoeller, Keith Donald, John A. Lewis

Constructor Summary
PortletRequestUtils()
Method Summary
static Boolean | getBooleanParameter(javax.portlet.PortletRequest request, String name) Get a Boolean parameter, or null if not present.
static boolean | getBooleanParameter(javax.portlet.PortletRequest request, String name, boolean defaultVal) Get a boolean parameter, with a fallback value.
static boolean[] | getBooleanParameters(javax.portlet.PortletRequest request, String name) Get an array of boolean parameters, return an empty array if not found.
static Double | getDoubleParameter(javax.portlet.PortletRequest request, String name) Get a Double parameter, or null if not present.
static double | getDoubleParameter(javax.portlet.PortletRequest request, String name, double defaultVal) Get a double parameter, with a fallback value.
static double[] | getDoubleParameters(javax.portlet.PortletRequest request, String name) Get an array of double parameters, return an empty array if not found.
static Float | getFloatParameter(javax.portlet.PortletRequest request, String name) Get a Float parameter, or null if not present.
static float | getFloatParameter(javax.portlet.PortletRequest request, String name, float defaultVal) Get a float parameter, with a fallback value.
static float[] | getFloatParameters(javax.portlet.PortletRequest request, String name) Get an array of float parameters, return an empty array if not found.
static Integer | getIntParameter(javax.portlet.PortletRequest request, String name) Get an Integer parameter, or null if not present.
static int | getIntParameter(javax.portlet.PortletRequest request, String name, int defaultVal) Get an int parameter, with a fallback value.
static int[] | getIntParameters(javax.portlet.PortletRequest request, String name) Get an array of int parameters, return an empty array if not found.
static Long | getLongParameter(javax.portlet.PortletRequest request, String name) Get a Long parameter, or null if not present.
static long | getLongParameter(javax.portlet.PortletRequest request, String name, long defaultVal) Get a long parameter, with a fallback value.
static long[] | getLongParameters(javax.portlet.PortletRequest request, String name) Get an array of long parameters, return an empty array if not found.
static boolean | getRequiredBooleanParameter(javax.portlet.PortletRequest request, String name) Get a boolean parameter, throwing an exception if it isn't found or isn't a boolean.
static boolean[] | getRequiredBooleanParameters(javax.portlet.PortletRequest request, String name) Get an array of boolean parameters, throwing an exception if not found or one isn't a boolean.
static double | getRequiredDoubleParameter(javax.portlet.PortletRequest request, String name) Get a double parameter, throwing an exception if it isn't found or isn't a number.
static double[] | getRequiredDoubleParameters(javax.portlet.PortletRequest request, String name) Get an array of double parameters, throwing an exception if not found or one is not a number.
static float | getRequiredFloatParameter(javax.portlet.PortletRequest request, String name) Get a float parameter, throwing an exception if it isn't found or isn't a number.
static float[] | getRequiredFloatParameters(javax.portlet.PortletRequest request, String name) Get an array of float parameters, throwing an exception if not found or one is not a number.
static int | getRequiredIntParameter(javax.portlet.PortletRequest request, String name) Get an int parameter, throwing an exception if it isn't found or isn't a number.
static int[] | getRequiredIntParameters(javax.portlet.PortletRequest request, String name) Get an array of int parameters, throwing an exception if not found or one is not a number..
static long | getRequiredLongParameter(javax.portlet.PortletRequest request, String name) Get a long parameter, throwing an exception if it isn't found or isn't a number.
static long[] | getRequiredLongParameters(javax.portlet.PortletRequest request, String name) Get an array of long parameters, throwing an exception if not found or one is not a number.
static String | getRequiredStringParameter(javax.portlet.PortletRequest request, String name) Get a String parameter, throwing an exception if it isn't found or is empty.
static String[] | getRequiredStringParameters(javax.portlet.PortletRequest request, String name) Get an array of String parameters, throwing an exception if not found or one is empty.
static String | getStringParameter(javax.portlet.PortletRequest request, String name) Get a String parameter, or null if not present.
static String | getStringParameter(javax.portlet.PortletRequest request, String name, String defaultVal) Get a String parameter, with a fallback value.
static String[] | getStringParameters(javax.portlet.PortletRequest request, String name) Get an array of String parameters, return an empty array if not found.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PortletRequestUtils

public PortletRequestUtils()
Method Detail

getIntParameter

public static Integer getIntParameter(javax.portlet.PortletRequest request,
                                      String name)
                               throws PortletRequestBindingException
Get an Integer parameter, or null if not present. Throws an exception if it the parameter value isn't a number.

Parameters:
request - current portlet request
name - the name of the parameter
Returns:
the Integer value, or null if not present
Throws:
PortletRequestBindingException - a subclass of PortletException, so it doesn't need to be caught

getIntParameter

public static int getIntParameter(javax.portlet.PortletRequest request,
                                  String name,
                                  int defaultVal)
Get an int parameter, with a fallback value. Never throws an exception. Can pass a distinguished value as default to enable checks of whether it was supplied.

Parameters:
request - current portlet request
name - the name of the parameter
defaultVal - the default value to use as fallback

getIntParameters

public static int[] getIntParameters(javax.portlet.PortletRequest request,
                                     String name)
Get an array of int parameters, return an empty array if not found.

Parameters:
request - current portlet request
name - the name of the parameter with multiple possible values

getRequiredIntParameter

public static int getRequiredIntParameter(javax.portlet.PortletRequest request,
                                          String name)
                                   throws PortletRequestBindingException
Get an int parameter, throwing an exception if it isn't found or isn't a number.

Parameters:
request - current portlet request
name - the name of the parameter
Throws:
PortletRequestBindingException - a subclass of PortletException, so it doesn't need to be caught

getRequiredIntParameters

public static int[] getRequiredIntParameters(javax.portlet.PortletRequest request,
                                             String name)
                                      throws PortletRequestBindingException
Get an array of int parameters, throwing an exception if not found or one is not a number..

Parameters:
request - current portlet request
name - the name of the parameter with multiple possible values
Throws:
PortletRequestBindingException - a subclass of PortletException, so it doesn't need to be caught

getLongParameter

public static Long getLongParameter(javax.portlet.PortletRequest request,
                                    String name)
                             throws PortletRequestBindingException
Get a Long parameter, or null if not present. Throws an exception if it the parameter value isn't a number.

Parameters:
request - current portlet request
name - the name of the parameter
Returns:
the Long value, or null if not present
Throws:
PortletRequestBindingException - a subclass of PortletException, so it doesn't need to be caught

getLongParameter

public static long getLongParameter(javax.portlet.PortletRequest request,
                                    String name,
                                    long defaultVal)
Get a long parameter, with a fallback value. Never throws an exception. Can pass a distinguished value as default to enable checks of whether it was supplied.

Parameters:
request - current portlet request
name - the name of the parameter
defaultVal - the default value to use as fallback

getLongParameters

public static long[] getLongParameters(javax.portlet.PortletRequest request,
                                       String name)
Get an array of long parameters, return an empty array if not found.

Parameters:
request - current portlet request
name - the name of the parameter with multiple possible values

getRequiredLongParameter

public static long getRequiredLongParameter(javax.portlet.PortletRequest request,
                                            String name)
                                     throws PortletRequestBindingException
Get a long parameter, throwing an exception if it isn't found or isn't a number.

Parameters:
request - current portlet request
name - the name of the parameter
Throws:
PortletRequestBindingException - a subclass of PortletException, so it doesn't need to be caught

getRequiredLongParameters

public static long[] getRequiredLongParameters(javax.portlet.PortletRequest request,
                                               String name)
                                        throws PortletRequestBindingException
Get an array of long parameters, throwing an exception if not found or one is not a number.

Parameters:
request - current portlet request
name - the name of the parameter with multiple possible values
Throws:
PortletRequestBindingException - a subclass of PortletException, so it doesn't need to be caught

getFloatParameter

public static Float getFloatParameter(javax.portlet.PortletRequest request,
                                      String name)
                               throws PortletRequestBindingException
Get a Float parameter, or null if not present. Throws an exception if it the parameter value isn't a number.

Parameters:
request - current portlet request
name - the name of the parameter
Returns:
the Float value, or null if not present
Throws:
PortletRequestBindingException - a subclass of PortletException, so it doesn't need to be caught

getFloatParameter

public static float getFloatParameter(javax.portlet.PortletRequest request,
                                      String name,
                                      float defaultVal)
Get a float parameter, with a fallback value. Never throws an exception. Can pass a distinguished value as default to enable checks of whether it was supplied.

Parameters:
request - current portlet request
name - the name of the parameter
defaultVal - the default value to use as fallback

getFloatParameters

public static float[] getFloatParameters(javax.portlet.PortletRequest request,
                                         String name)
Get an array of float parameters, return an empty array if not found.

Parameters:
request - current portlet request
name - the name of the parameter with multiple possible values

getRequiredFloatParameter

public static float getRequiredFloatParameter(javax.portlet.PortletRequest request,
                                              String name)
                                       throws PortletRequestBindingException
Get a float parameter, throwing an exception if it isn't found or isn't a number.

Parameters:
request - current portlet request
name - the name of the parameter
Throws:
PortletRequestBindingException - a subclass of PortletException, so it doesn't need to be caught

getRequiredFloatParameters

public static float[] getRequiredFloatParameters(javax.portlet.PortletRequest request,
                                                 String name)
                                          throws PortletRequestBindingException
Get an array of float parameters, throwing an exception if not found or one is not a number.

Parameters:
request - current portlet request
name - the name of the parameter with multiple possible values
Throws:
PortletRequestBindingException - a subclass of PortletException, so it doesn't need to be caught

getDoubleParameter

public static Double getDoubleParameter(javax.portlet.PortletRequest request,
                                        String name)
                                 throws PortletRequestBindingException
Get a Double parameter, or null if not present. Throws an exception if it the parameter value isn't a number.

Parameters:
request - current portlet request
name - the name of the parameter
Returns:
the Double value, or null if not present
Throws:
PortletRequestBindingException - a subclass of PortletException, so it doesn't need to be caught

getDoubleParameter

public static double getDoubleParameter(javax.portlet.PortletRequest request,
                                        String name,
                                        double defaultVal)
Get a double parameter, with a fallback value. Never throws an exception. Can pass a distinguished value as default to enable checks of whether it was supplied.

Parameters:
request - current portlet request
name - the name of the parameter
defaultVal - the default value to use as fallback

getDoubleParameters

public static double[] getDoubleParameters(javax.portlet.PortletRequest request,
                                           String name)
Get an array of double parameters, return an empty array if not found.

Parameters:
request - current portlet request
name - the name of the parameter with multiple possible values

getRequiredDoubleParameter

public static double getRequiredDoubleParameter(javax.portlet.PortletRequest request,
                                                String name)
                                         throws PortletRequestBindingException
Get a double parameter, throwing an exception if it isn't found or isn't a number.

Parameters:
request - current portlet request
name - the name of the parameter
Throws:
PortletRequestBindingException - a subclass of PortletException, so it doesn't need to be caught

getRequiredDoubleParameters

public static double[] getRequiredDoubleParameters(javax.portlet.PortletRequest request,
                                                   String name)
                                            throws PortletRequestBindingException
Get an array of double parameters, throwing an exception if not found or one is not a number.

Parameters:
request - current portlet request
name - the name of the parameter with multiple possible values
Throws:
PortletRequestBindingException - a subclass of PortletException, so it doesn't need to be caught

getBooleanParameter

public static Boolean getBooleanParameter(javax.portlet.PortletRequest request,
                                          String name)
                                   throws PortletRequestBindingException
Get a Boolean parameter, or null if not present. Throws an exception if it the parameter value isn't a boolean.

Accepts "true", "on", "yes" (any case) and "1" as values for true; treats every other non-empty value as false (i.e. parses leniently).

Parameters:
request - current portlet request
name - the name of the parameter
Returns:
the Boolean value, or null if not present
Throws:
PortletRequestBindingException - a subclass of PortletException, so it doesn't need to be caught

getBooleanParameter

public static boolean getBooleanParameter(javax.portlet.PortletRequest request,
                                          String name,
                                          boolean defaultVal)
Get a boolean parameter, with a fallback value. Never throws an exception. Can pass a distinguished value as default to enable checks of whether it was supplied.

Accepts "true", "on", "yes" (any case) and "1" as values for true; treats every other non-empty value as false (i.e. parses leniently).

Parameters:
request - current portlet request
name - the name of the parameter
defaultVal - the default value to use as fallback

getBooleanParameters

public static boolean[] getBooleanParameters(javax.portlet.PortletRequest request,
                                             String name)
Get an array of boolean parameters, return an empty array if not found.

Accepts "true", "on", "yes" (any case) and "1" as values for true; treats every other non-empty value as false (i.e. parses leniently).

Parameters:
request - current portlet request
name - the name of the parameter with multiple possible values

getRequiredBooleanParameter

public static boolean getRequiredBooleanParameter(javax.portlet.PortletRequest request,
                                                  String name)
                                           throws PortletRequestBindingException
Get a boolean parameter, throwing an exception if it isn't found or isn't a boolean.

Accepts "true", "on", "yes" (any case) and "1" as values for true; treats every other non-empty value as false (i.e. parses leniently).

Parameters:
request - current portlet request
name - the name of the parameter
Throws:
PortletRequestBindingException - a subclass of PortletException, so it doesn't need to be caught

getRequiredBooleanParameters

public static boolean[] getRequiredBooleanParameters(javax.portlet.PortletRequest request,
                                                     String name)
                                              throws PortletRequestBindingException
Get an array of boolean parameters, throwing an exception if not found or one isn't a boolean.

Accepts "true", "on", "yes" (any case) and "1" as values for true; treats every other non-empty value as false (i.e. parses leniently).

Parameters:
request - current portlet request
name - the name of the parameter
Throws:
PortletRequestBindingException - a subclass of PortletException, so it doesn't need to be caught

getStringParameter

public static String getStringParameter(javax.portlet.PortletRequest request,
                                        String name)
                                 throws PortletRequestBindingException
Get a String parameter, or null if not present. Throws an exception if it the parameter value is empty.

Parameters:
request - current portlet request
name - the name of the parameter
Returns:
the String value, or null if not present
Throws:
PortletRequestBindingException - a subclass of PortletException, so it doesn't need to be caught

getStringParameter

public static String getStringParameter(javax.portlet.PortletRequest request,
                                        String name,
                                        String defaultVal)
Get a String parameter, with a fallback value. Never throws an exception. Can pass a distinguished value to default to enable checks of whether it was supplied.

Parameters:
request - current portlet request
name - the name of the parameter
defaultVal - the default value to use as fallback

getStringParameters

public static String[] getStringParameters(javax.portlet.PortletRequest request,
                                           String name)
Get an array of String parameters, return an empty array if not found.

Parameters:
request - current portlet request
name - the name of the parameter with multiple possible values

getRequiredStringParameter

public static String getRequiredStringParameter(javax.portlet.PortletRequest request,
                                                String name)
                                         throws PortletRequestBindingException
Get a String parameter, throwing an exception if it isn't found or is empty.

Parameters:
request - current portlet request
name - the name of the parameter
Throws:
PortletRequestBindingException - a subclass of PortletException, so it doesn't need to be caught

getRequiredStringParameters

public static String[] getRequiredStringParameters(javax.portlet.PortletRequest request,
                                                   String name)
                                            throws PortletRequestBindingException
Get an array of String parameters, throwing an exception if not found or one is empty.

Parameters:
request - current portlet request
name - the name of the parameter
Throws:
PortletRequestBindingException - a subclass of PortletException, so it doesn't need to be caught
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


MissingPortletRequestParameterException

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.portlet.bind
Class MissingPortletRequestParameterException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.portlet.PortletException
                extended by  org.springframework.web.portlet.bind.PortletRequestBindingException
                    extended by  org.springframework.web.portlet.bind.MissingPortletRequestParameterException
All Implemented Interfaces:
Serializable
public class MissingPortletRequestParameterException
extends PortletRequestBindingException

PortletRequestBindingException subclass that indicates a missing parameter.

Since:
2.0.2
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
MissingPortletRequestParameterException(String parameterName, String parameterType)
Constructor for MissingPortletRequestParameterException.
Method Summary
String | getMessage()
String | getParameterName() Return the name of the offending parameter.
String | getParameterType() Return the expected type of the offending parameter.
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

MissingPortletRequestParameterException

public MissingPortletRequestParameterException(String parameterName,
                                               String parameterType)
Constructor for MissingPortletRequestParameterException.

Parameters:
parameterName - the name of the missing parameter
parameterType - the expected type of the missing parameter
Method Detail

getMessage

public String getMessage()
Overrides:
getMessage in class Throwable

getParameterName

public final String getParameterName()
Return the name of the offending parameter.

getParameterType

public final String getParameterType()
Return the expected type of the offending parameter.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


PortletRequestBindingException

org.springframework.web.portlet.bind
Class PortletRequestBindingException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.portlet.PortletException
                extended by  org.springframework.web.portlet.bind.PortletRequestBindingException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
MissingPortletRequestParameterException
public class PortletRequestBindingException
extends javax.portlet.PortletException

Fatal binding exception, thrown when we want to treat binding exceptions as unrecoverable.

Since:
2.0
Author:
Juergen Hoeller, John A. Lewis
See Also:
Serialized Form

Constructor Summary
PortletRequestBindingException(String msg)
Constructor for PortletRequestBindingException.
PortletRequestBindingException(String msg, Throwable cause)
Constructor for PortletRequestBindingException.
Method Summary
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

PortletRequestBindingException

public PortletRequestBindingException(String msg)
Constructor for PortletRequestBindingException.

Parameters:
msg - the detail message

PortletRequestBindingException

public PortletRequestBindingException(String msg,
                                      Throwable cause)
Constructor for PortletRequestBindingException.

Parameters:
msg - the detail message
cause - the root cause
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.web.portlet.bind.annotation

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.portlet.bind.annotation

Annotations for binding portlet requests to handler methods.

See:
Description

Annotation Types Summary
ActionMapping | Annotation for mapping Portlet action requests onto handler methods.
EventMapping | Annotation for mapping Portlet event requests onto handler methods.
RenderMapping | Annotation for mapping Portlet render requests onto handler methods.
ResourceMapping | Annotation for mapping Portlet resource requests onto handler methods.

Package org.springframework.web.portlet.bind.annotation Description

Annotations for binding portlet requests to handler methods.


org.springframework.web.portlet.bind.annotation Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.portlet.bind.annotation

Package Hierarchies:
All Packages

Annotation Type Hierarchy

  • org.springframework.web.portlet.bind.annotation.ResourceMapping (implements java.lang.annotation.Annotation)
  • org.springframework.web.portlet.bind.annotation.RenderMapping (implements java.lang.annotation.Annotation)
  • org.springframework.web.portlet.bind.annotation.EventMapping (implements java.lang.annotation.Annotation)
  • org.springframework.web.portlet.bind.annotation.ActionMapping (implements java.lang.annotation.Annotation)


ActionMapping

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

org.springframework.web.portlet.bind.annotation
Annotation Type ActionMapping

@Target(value=METHOD)
@Retention(value=RUNTIME)
@Documented
public @interface ActionMapping

Annotation for mapping Portlet action requests onto handler methods.

Since:
3.0
Author:
Juergen Hoeller
See Also:
RequestMapping

Optional Element Summary
String[] | params The parameters of the mapped request, narrowing the primary mapping.
String | value The name of the action, according to the Portlet 2.0 "javax.portlet.action" parameter.

value

public abstract String value
The name of the action, according to the Portlet 2.0 "javax.portlet.action" parameter.

If not specified, the method will be used as default handler: i.e. for action requests where no specific action mapping was found.

Note that all such annotated action methods only apply within the @RequestMapping constraints of the containing handler class.

See Also:
ActionRequest.ACTION_NAME
Default:
""

params

public abstract String[] params
The parameters of the mapped request, narrowing the primary mapping.

Same format for any environment: a sequence of "myParam=myValue" style expressions, with a request only mapped if each such parameter is found to have the given value. "myParam" style expressions are also supported, with such parameters having to be present in the request (allowed to have any value). Finally, "!myParam" style expressions indicate that the specified parameter is not supposed to be present in the request.

See Also:
RequestMapping.params()
Default:
{}
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT


EventMapping

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.web.portlet.bind.annotation
Annotation Type EventMapping

@Target(value=METHOD)
@Retention(value=RUNTIME)
@Documented
public @interface EventMapping

Annotation for mapping Portlet event requests onto handler methods.

Since:
3.0
Author:
Juergen Hoeller
See Also:
RequestMapping

Optional Element Summary
 String value
The name of the event to be handled.

value

public abstract String value
The name of the event to be handled. This name uniquely identifies an event within a portlet mode.

Typically the local name of the event, but fully qualified names with a "{...}" namespace part will be mapped correctly as well.

If not specified, the handler method will be invoked for any event request within its general mapping.

See Also:
EventRequest.getEvent(), Event.getName()
Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


RenderMapping

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

org.springframework.web.portlet.bind.annotation
Annotation Type RenderMapping

@Target(value=METHOD)
@Retention(value=RUNTIME)
@Documented
public @interface RenderMapping

Annotation for mapping Portlet render requests onto handler methods.

Since:
3.0
Author:
Juergen Hoeller
See Also:
RequestMapping

Optional Element Summary
String[] | params The parameters of the mapped request, narrowing the primary mapping.
String | value The window state that the annotated render method applies for.

value

public abstract String value
The window state that the annotated render method applies for.

If not specified, the render method will be invoked for any window state within its general mapping.

Standard Portlet spec values: "NORMAL", "MAXIMIZED", "MINIMIZED". Custom window states can be used as well, as supported by the portal.

See Also:
PortletRequest.getWindowState()
Default:
""

params

public abstract String[] params
The parameters of the mapped request, narrowing the primary mapping.

Same format for any environment: a sequence of "myParam=myValue" style expressions, with a request only mapped if each such parameter is found to have the given value. "myParam" style expressions are also supported, with such parameters having to be present in the request (allowed to have any value). Finally, "!myParam" style expressions indicate that the specified parameter is not supposed to be present in the request.

See Also:
RequestMapping.params()
Default:
{}
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


ResourceMapping

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

org.springframework.web.portlet.bind.annotation
Annotation Type ResourceMapping

@Target(value=METHOD)
@Retention(value=RUNTIME)
@Documented
public @interface ResourceMapping

Annotation for mapping Portlet resource requests onto handler methods.

Since:
3.0
Author:
Juergen Hoeller
See Also:
RequestMapping

Optional Element Summary
 String value
The id of the resource to be handled.

value

public abstract String value
The id of the resource to be handled. This id uniquely identifies a resource within a portlet mode.

If not specified, the handler method will be invoked for any resource request within its general mapping.

See Also:
ResourceRequest.getResourceID()
Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT


org.springframework.web.portlet.context

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.portlet.context

Support for Spring's application context concept in a portlet environment, including ApplicationContext implementations and various utility classes.

See:
Description

Interface Summary
ConfigurablePortletApplicationContext | Interface to be implemented by configurable portlet application contexts.
PortletConfigAware | Interface to be implemented by any object that wishes to be notified of the PortletConfig (typically determined by the PortletApplicationContext) that it runs in.
PortletContextAware | Interface to be implemented by any object that wishes to be notified of the PortletContext (typically determined by the PortletApplicationContext) that it runs in.

Class Summary
AbstractRefreshablePortletApplicationContext | AbstractRefreshableApplicationContext subclass which implements the ConfigurablePortletApplicationContext interface for portlet environments.
PortletApplicationContextUtils | Convenience methods for retrieving the root WebApplicationContext for a given PortletContext.
PortletApplicationObjectSupport | Convenient superclass for application objects running in a Portlet ApplicationContext.
PortletContextAwareProcessor | BeanPostProcessor implementation that passes the PortletContext to beans that implement the PortletContextAware interface.
PortletContextResource | Resource implementation for PortletContext resources, interpreting relative paths within the portlet application root directory.
PortletContextResourceLoader | ResourceLoader implementation that resolves paths as PortletContext resources, for use outside a Portlet ApplicationContext (for example, in a GenericPortletBean subclass).
PortletContextResourcePatternResolver | PortletContext-aware subclass of PathMatchingResourcePatternResolver, able to find matching resources below the web application root directory via Portlet API's PortletContext.getResourcePaths.
PortletContextScope | Scope wrapper for a PortletContext, i.e.
PortletRequestAttributes | Portlet-based implementation of the RequestAttributes interface.
PortletRequestHandledEvent | Portlet-specific subclass of RequestHandledEvent, adding portlet-specific context information.
PortletWebRequest | WebRequest adapter for a PortletRequest.
StaticPortletApplicationContext | Static Portlet-based ApplicationContext implementation for testing.
XmlPortletApplicationContext | Portlet-based WebApplicationContext implementation which takes its configuration from XML documents, understood by an XmlBeanDefinitionReader.

Package org.springframework.web.portlet.context Description

Support for Spring's application context concept in a portlet environment, including ApplicationContext implementations and various utility classes.


org.springframework.web.portlet.context Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.portlet.context

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.web.context.request.AbstractRequestAttributes (implements org.springframework.web.context.request.RequestAttributes)
      • org.springframework.web.portlet.context.PortletRequestAttributes
        • org.springframework.web.portlet.context.PortletWebRequest (implements org.springframework.web.context.request.NativeWebRequest)
    • org.springframework.core.io.AbstractResource (implements org.springframework.core.io.Resource)
      • org.springframework.web.portlet.context.PortletContextResource (implements org.springframework.core.io.ContextResource)
    • org.springframework.context.support.ApplicationObjectSupport (implements org.springframework.context.ApplicationContextAware)
      • org.springframework.web.portlet.context.PortletApplicationObjectSupport (implements org.springframework.web.portlet.context.PortletContextAware)
    • org.springframework.core.io.DefaultResourceLoader (implements org.springframework.core.io.ResourceLoader)
      • org.springframework.context.support.AbstractApplicationContext (implements org.springframework.context.ConfigurableApplicationContext, org.springframework.beans.factory.DisposableBean)
        • org.springframework.context.support.AbstractRefreshableApplicationContext
          • org.springframework.context.support.AbstractRefreshableConfigApplicationContext (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean)
            • org.springframework.web.portlet.context.AbstractRefreshablePortletApplicationContext (implements org.springframework.web.portlet.context.ConfigurablePortletApplicationContext, org.springframework.web.context.WebApplicationContext)
              • org.springframework.web.portlet.context.XmlPortletApplicationContext
        • org.springframework.context.support.GenericApplicationContext (implements org.springframework.beans.factory.support.BeanDefinitionRegistry)
          • org.springframework.context.support.StaticApplicationContext
            • org.springframework.web.portlet.context.StaticPortletApplicationContext (implements org.springframework.web.portlet.context.ConfigurablePortletApplicationContext)
      • org.springframework.web.portlet.context.PortletContextResourceLoader
    • java.util.EventObject (implements java.io.Serializable)
      • org.springframework.context.ApplicationEvent
        • org.springframework.web.context.support.RequestHandledEvent
          • org.springframework.web.portlet.context.PortletRequestHandledEvent
    • org.springframework.core.io.support.PathMatchingResourcePatternResolver (implements org.springframework.core.io.support.ResourcePatternResolver)
      • org.springframework.web.portlet.context.PortletContextResourcePatternResolver
    • org.springframework.web.portlet.context.PortletApplicationContextUtils
    • org.springframework.web.portlet.context.PortletContextAwareProcessor (implements org.springframework.beans.factory.config.BeanPostProcessor)
    • org.springframework.web.portlet.context.PortletContextScope (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.config.Scope)

Interface Hierarchy

  • org.springframework.context.ApplicationEventPublisher
    • org.springframework.context.ApplicationContext (also extends org.springframework.beans.factory.HierarchicalBeanFactory, org.springframework.beans.factory.ListableBeanFactory, org.springframework.context.MessageSource, org.springframework.core.io.support.ResourcePatternResolver)
      • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.Lifecycle)
        • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
      • org.springframework.web.context.WebApplicationContext
        • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
  • org.springframework.beans.factory.BeanFactory
    • org.springframework.beans.factory.HierarchicalBeanFactory
      • org.springframework.context.ApplicationContext (also extends org.springframework.context.ApplicationEventPublisher, org.springframework.beans.factory.ListableBeanFactory, org.springframework.context.MessageSource, org.springframework.core.io.support.ResourcePatternResolver)
        • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.Lifecycle)
          • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
        • org.springframework.web.context.WebApplicationContext
          • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
    • org.springframework.beans.factory.ListableBeanFactory
      • org.springframework.context.ApplicationContext (also extends org.springframework.context.ApplicationEventPublisher, org.springframework.beans.factory.HierarchicalBeanFactory, org.springframework.context.MessageSource, org.springframework.core.io.support.ResourcePatternResolver)
        • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.Lifecycle)
          • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
        • org.springframework.web.context.WebApplicationContext
          • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
  • org.springframework.context.Lifecycle
    • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.ApplicationContext)
      • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
  • org.springframework.context.MessageSource
    • org.springframework.context.ApplicationContext (also extends org.springframework.context.ApplicationEventPublisher, org.springframework.beans.factory.HierarchicalBeanFactory, org.springframework.beans.factory.ListableBeanFactory, org.springframework.core.io.support.ResourcePatternResolver)
      • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.Lifecycle)
        • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
      • org.springframework.web.context.WebApplicationContext
        • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)
  • org.springframework.web.portlet.context.PortletConfigAware
  • org.springframework.web.portlet.context.PortletContextAware
  • org.springframework.core.io.ResourceLoader
    • org.springframework.core.io.support.ResourcePatternResolver
      • org.springframework.context.ApplicationContext (also extends org.springframework.context.ApplicationEventPublisher, org.springframework.beans.factory.HierarchicalBeanFactory, org.springframework.beans.factory.ListableBeanFactory, org.springframework.context.MessageSource)
        • org.springframework.context.ConfigurableApplicationContext (also extends org.springframework.context.Lifecycle)
          • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.web.context.WebApplicationContext)
        • org.springframework.web.context.WebApplicationContext
          • org.springframework.web.portlet.context.ConfigurablePortletApplicationContext (also extends org.springframework.context.ConfigurableApplicationContext)


ConfigurablePortletApplicationContext

org.springframework.web.portlet.context
Interface ConfigurablePortletApplicationContext

All Superinterfaces:
ApplicationContext, ApplicationEventPublisher, BeanFactory, ConfigurableApplicationContext, HierarchicalBeanFactory, Lifecycle, ListableBeanFactory, MessageSource, ResourceLoader, ResourcePatternResolver, WebApplicationContext
All Known Implementing Classes:
AbstractRefreshablePortletApplicationContext, StaticPortletApplicationContext, XmlPortletApplicationContext
public interface ConfigurablePortletApplicationContext
extends WebApplicationContext, ConfigurableApplicationContext

Interface to be implemented by configurable portlet application contexts. Supported by FrameworkPortlet.

Note: The setters of this interface need to be called before an invocation of the ConfigurableApplicationContext.refresh() method inherited from ConfigurableApplicationContext. They do not cause an initialization of the context on their own.

Since:
2.0
Author:
Juergen Hoeller, William G. Thompson, Jr., John A. Lewis
See Also:
ConfigurableApplicationContext.refresh(),
ContextLoader.createWebApplicationContext(javax.servlet.ServletContext, org.springframework.context.ApplicationContext),
FrameworkPortlet.createPortletApplicationContext(org.springframework.context.ApplicationContext),
ConfigurableWebApplicationContext

Field Summary
static String | APPLICATION_CONTEXT_ID_PREFIX Prefix for ApplicationContext ids that refer to portlet name.
static String | PORTLET_CONFIG_BEAN_NAME Name of the PortletConfig environment bean in the factory.
static String | PORTLET_CONTEXT_BEAN_NAME Name of the PortletContext environment bean in the factory.
Fields inherited from interface org.springframework.web.context.WebApplicationContext
CONTEXT_ATTRIBUTES_BEAN_NAME, CONTEXT_PARAMETERS_BEAN_NAME, ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, SCOPE_APPLICATION, SCOPE_GLOBAL_SESSION, SCOPE_REQUEST, SCOPE_SESSION, SERVLET_CONTEXT_BEAN_NAME
Fields inherited from interface org.springframework.context.ConfigurableApplicationContext
CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAME
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Method Summary
String[] | getConfigLocations() Return the config locations for this web application context, or null if none specified.
String | getNamespace() Return the namespace for this web application context, if any.
javax.portlet.PortletConfig | getPortletConfig() Return the PortletConfig for this portlet application context, if any.
javax.portlet.PortletContext | getPortletContext() Return the standard Portlet API PortletContext for this application.
void | setConfigLocation(String configLocation) Set the config locations for this portlet application context in init-param style, i.e.
void | setConfigLocations(String[] configLocations) Set the config locations for this portlet application context.
void | setNamespace(String namespace) Set the namespace for this portlet application context, to be used for building a default context config location.
void | setPortletConfig(javax.portlet.PortletConfig portletConfig) Set the PortletConfig for this portlet application context.
void | setPortletContext(javax.portlet.PortletContext portletContext) Set the PortletContext for this portlet application context.
Methods inherited from interface org.springframework.web.context.WebApplicationContext
getServletContext
Methods inherited from interface org.springframework.context.ConfigurableApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, close, getBeanFactory, isActive, refresh, registerShutdownHook, setId, setParent
Methods inherited from interface org.springframework.context.ApplicationContext
getAutowireCapableBeanFactory, getDisplayName, getId, getParent, getStartupDate
Methods inherited from interface org.springframework.beans.factory.ListableBeanFactory
containsBeanDefinition, findAnnotationOnBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation
Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory
containsLocalBean, getParentBeanFactory
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getBean, getBean, getType, isPrototype, isSingleton, isTypeMatch
Methods inherited from interface org.springframework.context.MessageSource
getMessage, getMessage, getMessage
Methods inherited from interface org.springframework.context.ApplicationEventPublisher
publishEvent
Methods inherited from interface org.springframework.core.io.support.ResourcePatternResolver
getResources
Methods inherited from interface org.springframework.core.io.ResourceLoader
getClassLoader, getResource
Methods inherited from interface org.springframework.context.Lifecycle
isRunning, start, stop

Field Detail

APPLICATION_CONTEXT_ID_PREFIX

static final String APPLICATION_CONTEXT_ID_PREFIX
Prefix for ApplicationContext ids that refer to portlet name.

PORTLET_CONTEXT_BEAN_NAME

static final String PORTLET_CONTEXT_BEAN_NAME
Name of the PortletContext environment bean in the factory.

See Also:
PortletContext, Constant Field Values

PORTLET_CONFIG_BEAN_NAME

static final String PORTLET_CONFIG_BEAN_NAME
Name of the PortletConfig environment bean in the factory.

See Also:
PortletConfig, Constant Field Values
Method Detail

setPortletContext

void setPortletContext(javax.portlet.PortletContext portletContext)
Set the PortletContext for this portlet application context.

Does not cause an initialization of the context: refresh needs to be called after the setting of all configuration properties.

See Also:
ConfigurableApplicationContext.refresh()

getPortletContext

javax.portlet.PortletContext getPortletContext()
Return the standard Portlet API PortletContext for this application.

setPortletConfig

void setPortletConfig(javax.portlet.PortletConfig portletConfig)
Set the PortletConfig for this portlet application context.

See Also:
ConfigurableApplicationContext.refresh()

getPortletConfig

javax.portlet.PortletConfig getPortletConfig()
Return the PortletConfig for this portlet application context, if any.

setNamespace

void setNamespace(String namespace)
Set the namespace for this portlet application context, to be used for building a default context config location.

getNamespace

String getNamespace()
Return the namespace for this web application context, if any.

setConfigLocation

void setConfigLocation(String configLocation)
Set the config locations for this portlet application context in init-param style, i.e. with distinct locations separated by commas, semicolons or whitespace.

If not set, the implementation is supposed to use a default for the given namespace.

setConfigLocations

void setConfigLocations(String[] configLocations)
Set the config locations for this portlet application context.

If not set, the implementation is supposed to use a default for the given namespace.

getConfigLocations

String[] getConfigLocations()
Return the config locations for this web application context, or null if none specified.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PortletConfigAware

org.springframework.web.portlet.context
Interface PortletConfigAware

All Known Implementing Classes:
PortletWrappingController, SimplePortletPostProcessor
public interface PortletConfigAware

Interface to be implemented by any object that wishes to be notified of the PortletConfig (typically determined by the PortletApplicationContext) that it runs in.

Since:
2.0
Author:
Juergen Hoeller
See Also:
PortletContextAware

Method Summary
 void setPortletConfig(javax.portlet.PortletConfig portletConfig)
Set the PortletConfigthat this object runs in.

Method Detail

setPortletConfig

void setPortletConfig(javax.portlet.PortletConfig portletConfig)
Set the PortletConfigthat this object runs in.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked after ApplicationContextAware's setApplicationContext.

Parameters:
portletConfig - PortletConfig object to be used by this object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PortletContextAware

org.springframework.web.portlet.context
Interface PortletContextAware

All Known Implementing Classes:
AbstractCommandController, AbstractController, AbstractFormController, AbstractWizardFormController, AnnotationMethodHandlerAdapter, BaseCommandController, CommonsPortletMultipartResolver, ParameterizableViewController, PortletApplicationObjectSupport, PortletContentGenerator, PortletWrappingController, SimpleControllerHandlerAdapter, SimpleFormController, SimplePortletHandlerAdapter, SimplePortletPostProcessor
public interface PortletContextAware

Interface to be implemented by any object that wishes to be notified of the PortletContext (typically determined by the PortletApplicationContext) that it runs in.

Since:
2.0
Author:
Juergen Hoeller, William G. Thompson, Jr.
See Also:
PortletConfigAware

Method Summary
 void setPortletContext(javax.portlet.PortletContext portletContext)
Set the PortletContext that this object runs in.

Method Detail

setPortletContext

void setPortletContext(javax.portlet.PortletContext portletContext)
Set the PortletContext that this object runs in.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked after ApplicationContextAware's setApplicationContext.

Parameters:
portletContext - PortletContext object to be used by this object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractRefreshablePortletApplicationContext

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.portlet.context
Class AbstractRefreshablePortletApplicationContext

java.lang.Object
    extended by  org.springframework.core.io.DefaultResourceLoader
        extended by  org.springframework.context.support.AbstractApplicationContext
            extended by  org.springframework.context.support.AbstractRefreshableApplicationContext
                extended by  org.springframework.context.support.AbstractRefreshableConfigApplicationContext
                    extended by  org.springframework.web.portlet.context.AbstractRefreshablePortletApplicationContext
All Implemented Interfaces:
BeanFactory, BeanNameAware, DisposableBean, HierarchicalBeanFactory, InitializingBean, ListableBeanFactory, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, ResourceLoader, ResourcePatternResolver, WebApplicationContext, ConfigurablePortletApplicationContext
Direct Known Subclasses:
XmlPortletApplicationContext
public abstract class AbstractRefreshablePortletApplicationContext
extends AbstractRefreshableConfigApplicationContext
implements WebApplicationContext, ConfigurablePortletApplicationContext

AbstractRefreshableApplicationContext subclass which implements the ConfigurablePortletApplicationContext interface for portlet environments. Provides a "configLocations" property, to be populated through the ConfigurablePortletApplicationContext interface on portlet application startup.

This class is as easy to subclass as AbstractRefreshableApplicationContext: All you need to implements is the AbstractRefreshableApplicationContext.loadBeanDefinitions(org.springframework.beans.factory.support.DefaultListableBeanFactory) method; see the superclass javadoc for details. Note that implementations are supposed to load bean definitions from the files specified by the locations returned by the getConfigLocations() method.

Interprets resource paths as servlet context resources, i.e. as paths beneath the web application root. Absolute paths, e.g. for files outside the web app root, can be accessed via "file:" URLs, as implemented by DefaultResourceLoader.

This is the portlet context to be subclassed for a different bean definition format. Such a context implementation can be specified as "contextClass" init-param for FrameworkPortlet, replacing the default XmlPortletApplicationContext. It will then automatically receive the "contextConfigLocation" init-param.

Note that Portlet-based context implementations are generally supposed to configure themselves based on the configuration received through the ConfigurablePortletApplicationContext interface. In contrast, a standalone application context might allow for configuration in custom startup code (for example, GenericApplicationContext).

Since:
2.0
Author:
Juergen Hoeller, John A. Lewis
See Also:
AbstractRefreshableApplicationContext.loadBeanDefinitions(org.springframework.beans.factory.support.DefaultListableBeanFactory), ConfigurablePortletApplicationContext.setConfigLocations(java.lang.String[]), XmlPortletApplicationContext

Field Summary
Fields inherited from class org.springframework.context.support.AbstractApplicationContext
APPLICATION_EVENT_MULTICASTER_BEAN_NAME, LIFECYCLE_PROCESSOR_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAME
Fields inherited from interface org.springframework.web.portlet.context.ConfigurablePortletApplicationContext
APPLICATION_CONTEXT_ID_PREFIX, PORTLET_CONFIG_BEAN_NAME, PORTLET_CONTEXT_BEAN_NAME
Fields inherited from interface org.springframework.web.context.WebApplicationContext
CONTEXT_ATTRIBUTES_BEAN_NAME, CONTEXT_PARAMETERS_BEAN_NAME, ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, SCOPE_APPLICATION, SCOPE_GLOBAL_SESSION, SCOPE_REQUEST, SCOPE_SESSION, SERVLET_CONTEXT_BEAN_NAME
Fields inherited from interface org.springframework.context.ConfigurableApplicationContext
CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAME
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Constructor Summary
AbstractRefreshablePortletApplicationContext()
Method Summary
String[] | getConfigLocations() Return an array of resource locations, referring to the XML bean definition files that this context should be built with.
String | getNamespace() Return the namespace for this web application context, if any.
javax.portlet.PortletConfig | getPortletConfig() Return the PortletConfig for this portlet application context, if any.
javax.portlet.PortletContext | getPortletContext() Return the standard Portlet API PortletContext for this application.
protected Resource | getResourceByPath(String path) This implementation supports file paths beneath the root of the PortletContext.
protected ResourcePatternResolver | getResourcePatternResolver() This implementation supports pattern matching in unexpanded WARs too.
ServletContext | getServletContext() Return the standard Servlet API ServletContext for this application.
protected void | postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) Register request/session scopes, a PortletContextAwareProcessor, etc.
void | setNamespace(String namespace) Set the namespace for this portlet application context, to be used for building a default context config location.
void | setParent(ApplicationContext parent) Set the parent of this application context.
void | setPortletConfig(javax.portlet.PortletConfig portletConfig) Set the PortletConfig for this portlet application context.
void | setPortletContext(javax.portlet.PortletContext portletContext) Set the PortletContext for this portlet application context.
Methods inherited from class org.springframework.context.support.AbstractRefreshableConfigApplicationContext
afterPropertiesSet, getDefaultConfigLocations, resolvePath, setBeanName, setConfigLocation, setConfigLocations, setId
Methods inherited from class org.springframework.context.support.AbstractRefreshableApplicationContext
cancelRefresh, closeBeanFactory, createBeanFactory, customizeBeanFactory, getBeanFactory, hasBeanFactory, loadBeanDefinitions, refreshBeanFactory, setAllowBeanDefinitionOverriding, setAllowCircularReferences
Methods inherited from class org.springframework.context.support.AbstractApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, addListener, close, containsBean, containsBeanDefinition, containsLocalBean, destroy, destroyBeans, doClose, findAnnotationOnBean, finishBeanFactoryInitialization, finishRefresh, getAliases, getApplicationListeners, getAutowireCapableBeanFactory, getBean, getBean, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getDisplayName, getId, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getResources, getStartupDate, getType, initApplicationEventMulticaster, initLifecycleProcessor, initMessageSource, invokeBeanFactoryPostProcessors, isActive, isPrototype, isRunning, isSingleton, isTypeMatch, obtainFreshBeanFactory, onClose, onRefresh, prepareBeanFactory, prepareRefresh, publishEvent, refresh, registerBeanPostProcessors, registerListeners, registerShutdownHook, setDisplayName, start, stop, toString
Methods inherited from class org.springframework.core.io.DefaultResourceLoader
getClassLoader, getResource, setClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.web.portlet.context.ConfigurablePortletApplicationContext
setConfigLocation, setConfigLocations
Methods inherited from interface org.springframework.context.ConfigurableApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, close, getBeanFactory, isActive, refresh, registerShutdownHook, setId
Methods inherited from interface org.springframework.context.ApplicationContext
getAutowireCapableBeanFactory, getDisplayName, getId, getParent, getStartupDate
Methods inherited from interface org.springframework.beans.factory.ListableBeanFactory
containsBeanDefinition, findAnnotationOnBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation
Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory
containsLocalBean, getParentBeanFactory
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getBean, getBean, getType, isPrototype, isSingleton, isTypeMatch
Methods inherited from interface org.springframework.context.MessageSource
getMessage, getMessage, getMessage
Methods inherited from interface org.springframework.context.ApplicationEventPublisher
publishEvent
Methods inherited from interface org.springframework.core.io.support.ResourcePatternResolver
getResources
Methods inherited from interface org.springframework.core.io.ResourceLoader
getClassLoader, getResource
Methods inherited from interface org.springframework.context.Lifecycle
isRunning, start, stop

Constructor Detail

AbstractRefreshablePortletApplicationContext

public AbstractRefreshablePortletApplicationContext()
Method Detail

setParent

public void setParent(ApplicationContext parent)
Description copied from interface: ConfigurableApplicationContext
Set the parent of this application context.

Note that the parent shouldn't be changed: It should only be set outside a constructor if it isn't available when an object of this class is created, for example in case of WebApplicationContext setup.

Specified by:
setParent in interface ConfigurableApplicationContext
Overrides:
setParent in class AbstractApplicationContext
Parameters:
parent - the parent context
See Also:
ConfigurableWebApplicationContext

getServletContext

public ServletContext getServletContext()
Description copied from interface: WebApplicationContext
Return the standard Servlet API ServletContext for this application.

Also available for a Portlet application, in addition to the PortletContext.

Specified by:
getServletContext in interface WebApplicationContext

setPortletContext

public void setPortletContext(javax.portlet.PortletContext portletContext)
Description copied from interface: ConfigurablePortletApplicationContext
Set the PortletContext for this portlet application context.

Does not cause an initialization of the context: refresh needs to be called after the setting of all configuration properties.

Specified by:
setPortletContext in interface ConfigurablePortletApplicationContext
See Also:
ConfigurableApplicationContext.refresh()

getPortletContext

public javax.portlet.PortletContext getPortletContext()
Description copied from interface: ConfigurablePortletApplicationContext
Return the standard Portlet API PortletContext for this application.

Specified by:
getPortletContext in interface ConfigurablePortletApplicationContext

setPortletConfig

public void setPortletConfig(javax.portlet.PortletConfig portletConfig)
Description copied from interface: ConfigurablePortletApplicationContext
Set the PortletConfig for this portlet application context.

Specified by:
setPortletConfig in interface ConfigurablePortletApplicationContext
See Also:
ConfigurableApplicationContext.refresh()

getPortletConfig

public javax.portlet.PortletConfig getPortletConfig()
Description copied from interface: ConfigurablePortletApplicationContext
Return the PortletConfig for this portlet application context, if any.

Specified by:
getPortletConfig in interface ConfigurablePortletApplicationContext

setNamespace

public void setNamespace(String namespace)
Description copied from interface: ConfigurablePortletApplicationContext
Set the namespace for this portlet application context, to be used for building a default context config location.

Specified by:
setNamespace in interface ConfigurablePortletApplicationContext

getNamespace

public String getNamespace()
Description copied from interface: ConfigurablePortletApplicationContext
Return the namespace for this web application context, if any.

Specified by:
getNamespace in interface ConfigurablePortletApplicationContext

getConfigLocations

public String[] getConfigLocations()
Description copied from class: AbstractRefreshableConfigApplicationContext
Return an array of resource locations, referring to the XML bean definition files that this context should be built with. Can also include location patterns, which will get resolved via a ResourcePatternResolver.

The default implementation returns null. Subclasses can override this to provide a set of resource locations to load bean definitions from.

Specified by:
getConfigLocations in interface ConfigurablePortletApplicationContext
Overrides:
getConfigLocations in class AbstractRefreshableConfigApplicationContext
Returns:
an array of resource locations, or null if none
See Also:
AbstractApplicationContext.getResources(java.lang.String), AbstractApplicationContext.getResourcePatternResolver()

postProcessBeanFactory

protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
Register request/session scopes, a PortletContextAwareProcessor, etc.

Overrides:
postProcessBeanFactory in class AbstractApplicationContext
Parameters:
beanFactory - the bean factory used by the application context

getResourceByPath

protected Resource getResourceByPath(String path)
This implementation supports file paths beneath the root of the PortletContext.

Overrides:
getResourceByPath in class DefaultResourceLoader
Parameters:
path - the path to the resource
Returns:
the corresponding Resource handle
See Also:
PortletContextResource

getResourcePatternResolver

protected ResourcePatternResolver getResourcePatternResolver()
This implementation supports pattern matching in unexpanded WARs too.

Overrides:
getResourcePatternResolver in class AbstractApplicationContext
Returns:
the ResourcePatternResolver for this context
See Also:
PortletContextResourcePatternResolver
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


PortletApplicationContextUtils

org.springframework.web.portlet.context
Class PortletApplicationContextUtils

java.lang.Object
    extended by  org.springframework.web.portlet.context.PortletApplicationContextUtils

public abstract class PortletApplicationContextUtils
extends Object

Convenience methods for retrieving the root WebApplicationContext for a given PortletContext. This is e.g. useful for accessing a Spring context from within custom Portlet implementations.

Since:
2.0
Author:
Juergen Hoeller, John A. Lewis
See Also:
ContextLoader, WebApplicationContextUtils, FrameworkPortlet, DispatcherPortlet

Constructor Summary
PortletApplicationContextUtils()
Method Summary
static ApplicationContext | getRequiredWebApplicationContext(javax.portlet.PortletContext pc) Find the root WebApplicationContext for this portlet application, which is typically loaded via ContextLoaderListener or ContextLoaderServlet.
static ApplicationContext | getWebApplicationContext(javax.portlet.PortletContext pc) Find the root WebApplicationContext for this portlet application, which is typically loaded via ContextLoaderListener or ContextLoaderServlet.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PortletApplicationContextUtils

public PortletApplicationContextUtils()
Method Detail

getWebApplicationContext

public static ApplicationContext getWebApplicationContext(javax.portlet.PortletContext pc)
Find the root WebApplicationContext for this portlet application, which is typically loaded via ContextLoaderListener or ContextLoaderServlet.

Will rethrow an exception that happened on root context startup, to differentiate between a failed context startup and no context at all.

Parameters:
pc - PortletContext to find the web application context for
Returns:
the root WebApplicationContext for this web app, or null if none (typed to ApplicationContext to avoid a Servlet API dependency; can usually be casted to WebApplicationContext, but there shouldn't be a need to)
See Also:
WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE

getRequiredWebApplicationContext

public static ApplicationContext getRequiredWebApplicationContext(javax.portlet.PortletContext pc)
                                                           throws IllegalStateException
Find the root WebApplicationContext for this portlet application, which is typically loaded via ContextLoaderListener or ContextLoaderServlet.

Will rethrow an exception that happened on root context startup, to differentiate between a failed context startup and no context at all.

Parameters:
pc - PortletContext to find the web application context for
Returns:
the root WebApplicationContext for this web app (typed to ApplicationContext to avoid a Servlet API dependency; can usually be casted to WebApplicationContext, but there shouldn't be a need to)
Throws:
IllegalStateException - if the root WebApplicationContext could not be found
See Also:
WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PortletApplicationObjectSupport

org.springframework.web.portlet.context
Class PortletApplicationObjectSupport

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.portlet.context.PortletApplicationObjectSupport
All Implemented Interfaces:
ApplicationContextAware, PortletContextAware
Direct Known Subclasses:
PortletContentGenerator
public abstract class PortletApplicationObjectSupport
extends ApplicationObjectSupport
implements PortletContextAware

Convenient superclass for application objects running in a Portlet ApplicationContext. Provides getApplicationContext, getServletContext, and getTempDir methods.

Since:
2.0
Author:
Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Constructor Summary
PortletApplicationObjectSupport()
Method Summary
protected javax.portlet.PortletContext | getPortletContext() Return the current PortletContext.
protected File | getTempDir() Return the temporary directory for the current web application, as provided by the servlet container.
protected boolean | isContextRequired() Overrides the base class behavior to enforce running in an ApplicationContext.
void | setPortletContext(javax.portlet.PortletContext portletContext) Set the PortletContext that this object runs in.
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PortletApplicationObjectSupport

public PortletApplicationObjectSupport()
Method Detail

setPortletContext

public void setPortletContext(javax.portlet.PortletContext portletContext)
Description copied from interface: PortletContextAware
Set the PortletContext that this object runs in.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked after ApplicationContextAware's setApplicationContext.

Specified by:
setPortletContext in interface PortletContextAware
Parameters:
portletContext - PortletContext object to be used by this object

isContextRequired

protected boolean isContextRequired()
Overrides the base class behavior to enforce running in an ApplicationContext. All accessors will throw IllegalStateException if not running in a context.

Overrides:
isContextRequired in class ApplicationObjectSupport
See Also:
ApplicationObjectSupport.getApplicationContext(),
ApplicationObjectSupport.getMessageSourceAccessor(),
getPortletContext(),
getTempDir()

getPortletContext

protected final javax.portlet.PortletContext getPortletContext()
                                                        throws IllegalStateException
Return the current PortletContext.

Throws:
IllegalStateException - if not running within a PortletContext

getTempDir

protected final File getTempDir()
                         throws IllegalStateException
Return the temporary directory for the current web application, as provided by the servlet container.

Returns:
the File representing the temporary directory
Throws:
IllegalStateException - if not running within a PortletContext
See Also:
PortletUtils.getTempDir(javax.portlet.PortletContext)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PortletContextAwareProcessor

org.springframework.web.portlet.context
Class PortletContextAwareProcessor

java.lang.Object
    extended by  org.springframework.web.portlet.context.PortletContextAwareProcessor
All Implemented Interfaces:
BeanPostProcessor
public class PortletContextAwareProcessor
extends Object
implements BeanPostProcessor

BeanPostProcessor implementation that passes the PortletContext to beans that implement the PortletContextAware interface.

Portlet application contexts will automatically register this with their underlying bean factory. Applications do not use this directly.

Since:
2.0
Author:
Juergen Hoeller, John A. Lewis
See Also:
PortletContextAware, AbstractRefreshablePortletApplicationContext.postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory)

Constructor Summary
PortletContextAwareProcessor(javax.portlet.PortletConfig portletConfig)
Create a new PortletContextAwareProcessor for the given config.
PortletContextAwareProcessor(javax.portlet.PortletContext portletContext)
Create a new PortletContextAwareProcessor for the given context.
PortletContextAwareProcessor(javax.portlet.PortletContext portletContext, javax.portlet.PortletConfig portletConfig)
Create a new PortletContextAwareProcessor for the given context and config.
Method Summary
Object | postProcessAfterInitialization(Object bean, String beanName) Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).
Object | postProcessBeforeInitialization(Object bean, String beanName) Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PortletContextAwareProcessor

public PortletContextAwareProcessor(javax.portlet.PortletContext portletContext)
Create a new PortletContextAwareProcessor for the given context.

PortletContextAwareProcessor

public PortletContextAwareProcessor(javax.portlet.PortletConfig portletConfig)
Create a new PortletContextAwareProcessor for the given config.

PortletContextAwareProcessor

public PortletContextAwareProcessor(javax.portlet.PortletContext portletContext,
                                    javax.portlet.PortletConfig portletConfig)
Create a new PortletContextAwareProcessor for the given context and config.

Method Detail

postProcessBeforeInitialization

public Object postProcessBeforeInitialization(Object bean,
                                              String beanName)
                                       throws BeansException
Description copied from interface: BeanPostProcessor
Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

Specified by:
postProcessBeforeInitialization in interface BeanPostProcessor
Parameters:
bean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
Throws:
BeansException - in case of errors
See Also:
InitializingBean.afterPropertiesSet()

postProcessAfterInitialization

public Object postProcessAfterInitialization(Object bean,
                                             String beanName)
Description copied from interface: BeanPostProcessor
Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

In case of a FactoryBean, this callback will be invoked for both the FactoryBean instance and the objects created by the FactoryBean (as of Spring 2.0). The post-processor can decide whether to apply to either the FactoryBean or created objects or both through corresponding bean instanceof FactoryBean checks.

This callback will also be invoked after a short-circuiting triggered by a InstantiationAwareBeanPostProcessor.postProcessBeforeInstantiation(java.lang.Class, java.lang.String) method, in contrast to all other BeanPostProcessor callbacks.

Specified by:
postProcessAfterInitialization in interface BeanPostProcessor
Parameters:
bean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
See Also:
InitializingBean.afterPropertiesSet(), FactoryBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PortletContextResource

org.springframework.web.portlet.context
Class PortletContextResource

java.lang.Object
    extended by  org.springframework.core.io.AbstractResource
        extended by  org.springframework.web.portlet.context.PortletContextResource
All Implemented Interfaces:
ContextResource, InputStreamSource, Resource
public class PortletContextResource
extends AbstractResource
implements ContextResource

Resource implementation for PortletContext resources, interpreting relative paths within the portlet application root directory.

Always supports stream access and URL access, but only allows java.io.File access when the portlet application archive is expanded.

Since:
2.0
Author:
Juergen Hoeller, John A. Lewis
See Also:
PortletContext.getResourceAsStream(java.lang.String), PortletContext.getRealPath(java.lang.String)

Constructor Summary
PortletContextResource(javax.portlet.PortletContext portletContext, String path)
Create a new PortletContextResource.
Method Summary
Resource | createRelative(String relativePath) This implementation throws a FileNotFoundException, assuming that relative resources cannot be created for this resource.
boolean | equals(Object obj) This implementation compares description strings.
boolean | exists() This implementation checks PortletContext.getResource.
String | getDescription() Return a description for this resource, to be used for error output when working with the resource.
File | getFile() This implementation delegates to PortletContext.getRealPath, but throws a FileNotFoundException if not found or not resolvable.
String | getFilename() This implementation always throws IllegalStateException, assuming that the resource does not carry a filename.
InputStream | getInputStream() This implementation delegates to PortletContext.getResourceAsStream, but throws a FileNotFoundException if not found.
String | getPath() Return the path for this resource.
String | getPathWithinContext() Return the path within the enclosing 'context'.
javax.portlet.PortletContext | getPortletContext() Return the PortletContext for this resource.
URL | getURL() This implementation delegates to PortletContext.getResource, but throws a FileNotFoundException if no resource found.
int | hashCode() This implementation returns the description's hash code.
Methods inherited from class org.springframework.core.io.AbstractResource
getFileForLastModifiedCheck, getURI, isOpen, isReadable, lastModified, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.core.io.Resource
getURI, isOpen, isReadable, lastModified

Constructor Detail

PortletContextResource

public PortletContextResource(javax.portlet.PortletContext portletContext,
                              String path)
Create a new PortletContextResource.

The Portlet spec requires that resource paths start with a slash, even if many containers accept paths without leading slash too. Consequently, the given path will be prepended with a slash if it doesn't already start with one.

Parameters:
portletContext - the PortletContext to load from
path - the path of the resource
Method Detail

getPortletContext

public final javax.portlet.PortletContext getPortletContext()
Return the PortletContext for this resource.

getPath

public final String getPath()
Return the path for this resource.

exists

public boolean exists()
This implementation checks PortletContext.getResource.

Specified by:
exists in interface Resource
Overrides:
exists in class AbstractResource
See Also:
PortletContext.getResource(String)

getInputStream

public InputStream getInputStream()
                           throws IOException
This implementation delegates to PortletContext.getResourceAsStream, but throws a FileNotFoundException if not found.

Specified by:
getInputStream in interface InputStreamSource
Throws:
IOException - if the stream could not be opened
See Also:
PortletContext.getResourceAsStream(String)

getURL

public URL getURL()
           throws IOException
This implementation delegates to PortletContext.getResource, but throws a FileNotFoundException if no resource found.

Specified by:
getURL in interface Resource
Overrides:
getURL in class AbstractResource
Throws:
IOException - if the resource cannot be resolved as URL, i.e. if the resource is not available as descriptor
See Also:
PortletContext.getResource(String)

getFile

public File getFile()
             throws IOException
This implementation delegates to PortletContext.getRealPath, but throws a FileNotFoundException if not found or not resolvable.

Specified by:
getFile in interface Resource
Overrides:
getFile in class AbstractResource
Throws:
IOException - if the resource cannot be resolved as absolute file path, i.e. if the resource is not available in a file system
See Also:
PortletContext.getRealPath(String)

createRelative

public Resource createRelative(String relativePath)
Description copied from class: AbstractResource
This implementation throws a FileNotFoundException, assuming that relative resources cannot be created for this resource.

Specified by:
createRelative in interface Resource
Overrides:
createRelative in class AbstractResource
Parameters:
relativePath - the relative path (relative to this resource)
Returns:
the resource handle for the relative resource

getFilename

public String getFilename()
Description copied from class: AbstractResource
This implementation always throws IllegalStateException, assuming that the resource does not carry a filename.

Specified by:
getFilename in interface Resource
Overrides:
getFilename in class AbstractResource

getDescription

public String getDescription()
Description copied from interface: Resource
Return a description for this resource, to be used for error output when working with the resource.

Implementations are also encouraged to return this value from their toString method.

Specified by:
getDescription in interface Resource
See Also:
Object.toString()

getPathWithinContext

public String getPathWithinContext()
Description copied from interface: ContextResource
Return the path within the enclosing 'context'.

This is typically path relative to a context-specific root directory, e.g. a ServletContext root or a PortletContext root.

Specified by:
getPathWithinContext in interface ContextResource

equals

public boolean equals(Object obj)
Description copied from class: AbstractResource
This implementation compares description strings.

Overrides:
equals in class AbstractResource
See Also:
Resource.getDescription()

hashCode

public int hashCode()
Description copied from class: AbstractResource
This implementation returns the description's hash code.

Overrides:
hashCode in class AbstractResource
See Also:
Resource.getDescription()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PortletContextResourceLoader

org.springframework.web.portlet.context
Class PortletContextResourceLoader

java.lang.Object
    extended by  org.springframework.core.io.DefaultResourceLoader
        extended by  org.springframework.web.portlet.context.PortletContextResourceLoader
All Implemented Interfaces:
ResourceLoader
public class PortletContextResourceLoader
extends DefaultResourceLoader

ResourceLoader implementation that resolves paths as PortletContext resources, for use outside a Portlet ApplicationContext (for example, in a GenericPortletBean subclass).

Within a WebApplicationContext, resource paths are automatically resolved as PortletContext resources by the context implementation.

Since:
2.0
Author:
Juergen Hoeller, John A. Lewis
See Also:
getResourceByPath(java.lang.String), PortletContextResource, GenericPortletBean

Field Summary
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Constructor Summary
PortletContextResourceLoader(javax.portlet.PortletContext portletContext)
Create a new PortletContextResourceLoader.
Method Summary
protected  Resource getResourceByPath(String path)
This implementation supports file paths beneath the root of the web application.
Methods inherited from class org.springframework.core.io.DefaultResourceLoader
getClassLoader, getResource, setClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PortletContextResourceLoader

public PortletContextResourceLoader(javax.portlet.PortletContext portletContext)
Create a new PortletContextResourceLoader.

Parameters:
portletContext - the PortletContext to load resources with
Method Detail

getResourceByPath

protected Resource getResourceByPath(String path)
This implementation supports file paths beneath the root of the web application.

Overrides:
getResourceByPath in class DefaultResourceLoader
Parameters:
path - the path to the resource
Returns:
the corresponding Resource handle
See Also:
PortletContextResource
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PortletContextResourcePatternResolver

org.springframework.web.portlet.context
Class PortletContextResourcePatternResolver

java.lang.Object
    extended by  org.springframework.core.io.support.PathMatchingResourcePatternResolver
        extended by  org.springframework.web.portlet.context.PortletContextResourcePatternResolver
All Implemented Interfaces:
ResourceLoader, ResourcePatternResolver
public class PortletContextResourcePatternResolver
extends PathMatchingResourcePatternResolver

PortletContext-aware subclass of PathMatchingResourcePatternResolver, able to find matching resources below the web application root directory via Portlet API's PortletContext.getResourcePaths. Falls back to the superclass' file system checking for other resources.

The advantage of using PortletContext.getResourcePaths to find matching files is that it will work in a WAR file which has not been expanded too.

Since:
2.0
Author:
Juergen Hoeller, John A. Lewis

Field Summary
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Constructor Summary
PortletContextResourcePatternResolver(javax.portlet.PortletContext portletContext)
Create a new PortletContextResourcePatternResolver.
PortletContextResourcePatternResolver(ResourceLoader resourceLoader)
Create a new PortletContextResourcePatternResolver.
Method Summary
protected Set<Resource> | doFindPathMatchingFileResources(Resource rootDirResource, String subPattern) Overridden version which checks for PortletContextResource and uses PortletContext.getResourcePaths to find matching resources below the web application root directory.
protected void | doRetrieveMatchingPortletContextResources(javax.portlet.PortletContext portletContext, String fullPattern, String dir, Set<Resource> result) Recursively retrieve PortletContextResources that match the given pattern, adding them to the given result set.
Methods inherited from class org.springframework.core.io.support.PathMatchingResourcePatternResolver
convertClassLoaderURL, determineRootDir, doFindMatchingFileSystemResources, doFindPathMatchingJarResources, doRetrieveMatchingFiles, findAllClassPathResources, findPathMatchingResources, getClassLoader, getJarFile, getPathMatcher, getResource, getResourceLoader, getResources, isJarResource, resolveRootDirResource, retrieveMatchingFiles, setPathMatcher
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PortletContextResourcePatternResolver

public PortletContextResourcePatternResolver(javax.portlet.PortletContext portletContext)
Create a new PortletContextResourcePatternResolver.

Parameters:
portletContext - the PortletContext to load resources with
See Also:
PortletContextResourceLoader.PortletContextResourceLoader(javax.portlet.PortletContext)

PortletContextResourcePatternResolver

public PortletContextResourcePatternResolver(ResourceLoader resourceLoader)
Create a new PortletContextResourcePatternResolver.

Parameters:
resourceLoader - the ResourceLoader to load root directories and actual resources with
Method Detail

doFindPathMatchingFileResources

protected Set<Resource> doFindPathMatchingFileResources(Resource rootDirResource,
                                                        String subPattern)
                                                 throws IOException
Overridden version which checks for PortletContextResource and uses PortletContext.getResourcePaths to find matching resources below the web application root directory. In case of other resources, delegates to the superclass version.

Overrides:
doFindPathMatchingFileResources in class PathMatchingResourcePatternResolver
Parameters:
rootDirResource - the root directory as Resource
subPattern - the sub pattern to match (below the root directory)
Returns:
the Set of matching Resource instances
Throws:
IOException - in case of I/O errors
See Also:
doRetrieveMatchingPortletContextResources(javax.portlet.PortletContext, java.lang.String, java.lang.String, java.util.Set), PortletContextResource, PortletContext.getResourcePaths(java.lang.String)

doRetrieveMatchingPortletContextResources

protected void doRetrieveMatchingPortletContextResources(javax.portlet.PortletContext portletContext,
                                                         String fullPattern,
                                                         String dir,
                                                         Set<Resource> result)
                                                  throws IOException
Recursively retrieve PortletContextResources that match the given pattern, adding them to the given result set.

Parameters:
portletContext - the PortletContext to work on
fullPattern - the pattern to match against, with preprended root directory path
dir - the current directory
result - the Set of matching Resources to add to
Throws:
IOException - if directory contents could not be retrieved
See Also:
PortletContextResource, PortletContext.getResourcePaths(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PortletContextScope

org.springframework.web.portlet.context
Class PortletContextScope

java.lang.Object
    extended by  org.springframework.web.portlet.context.PortletContextScope
All Implemented Interfaces:
Scope, DisposableBean
public class PortletContextScope
extends Object
implements Scope, DisposableBean

Scope wrapper for a PortletContext, i.e. for global web application attributes.

This differs from traditional Spring singletons in that it exposes attributes in the PortletContext. Those attributes will get destroyed whenever the entire application shuts down, which might be earlier or later than the shutdown of the containing Spring ApplicationContext.

The associated destruction mechanism relies on a ContextCleanupListener being registered in web.xml. Note that ContextLoaderListener includes ContextCleanupListener's functionality.

This scope is registered as default scope with key "application".

Since:
3.0
Author:
Juergen Hoeller
See Also:
ContextCleanupListener

Constructor Summary
PortletContextScope(javax.portlet.PortletContext portletContext)
Create a new Scope wrapper for the given PortletContext.
Method Summary
void | destroy() Invoke all registered destruction callbacks.
Object | get(String name, ObjectFactory<?> objectFactory) Return the object with the given name from the underlying scope, creating it if not found in the underlying storage mechanism.
String | getConversationId() Return the conversation ID for the current underlying scope, if any.
void | registerDestructionCallback(String name, Runnable callback) Register a callback to be executed on destruction of the specified object in the scope (or at destruction of the entire scope, if the scope does not destroy individual objects but rather only terminates in its entirety).
Object | remove(String name) Remove the object with the given name from the underlying scope.
Object | resolveContextualObject(String key) Resolve the contextual object for the given key, if any.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PortletContextScope

public PortletContextScope(javax.portlet.PortletContext portletContext)
Create a new Scope wrapper for the given PortletContext.

Parameters:
PortletContext - the PortletContext to wrap
Method Detail

get

public Object get(String name,
                  ObjectFactory<?> objectFactory)
Description copied from interface: Scope
Return the object with the given name from the underlying scope, creating it if not found in the underlying storage mechanism.

This is the central operation of a Scope, and the only operation that is absolutely required.

Specified by:
get in interface Scope
Parameters:
name - the name of the object to retrieve
objectFactory - the ObjectFactory to use to create the scoped object if it is not present in the underlying storage mechanism
Returns:
the desired object (never null)

remove

public Object remove(String name)
Description copied from interface: Scope
Remove the object with the given name from the underlying scope.

Returns null if no object was found; otherwise returns the removed Object.

Note that an implementation should also remove a registered destruction callback for the specified object, if any. It does, however, not need to execute a registered destruction callback in this case, since the object will be destroyed by the caller (if appropriate).

Note: This is an optional operation. Implementations may throw UnsupportedOperationException if they do not support explicitly removing an object.

Specified by:
remove in interface Scope
Parameters:
name - the name of the object to remove
Returns:
the removed object, or null if no object was present
See Also:
Scope.registerDestructionCallback(java.lang.String, java.lang.Runnable)

registerDestructionCallback

public void registerDestructionCallback(String name,
                                        Runnable callback)
Description copied from interface: Scope
Register a callback to be executed on destruction of the specified object in the scope (or at destruction of the entire scope, if the scope does not destroy individual objects but rather only terminates in its entirety).

Note: This is an optional operation. This method will only be called for scoped beans with actual destruction configuration (DisposableBean, destroy-method, DestructionAwareBeanPostProcessor). Implementations should do their best to execute a given callback at the appropriate time. If such a callback is not supported by the underlying runtime environment at all, the callback must be ignored and a corresponding warning should be logged.

Note that 'destruction' refers to to automatic destruction of the object as part of the scope's own lifecycle, not to the individual scoped object having been explicitly removed by the application. If a scoped object gets removed via this facade's Scope.remove(String) method, any registered destruction callback should be removed as well, assuming that the removed object will be reused or manually destroyed.

Specified by:
registerDestructionCallback in interface Scope
Parameters:
name - the name of the object to execute the destruction callback for
callback - the destruction callback to be executed. Note that the passed-in Runnable will never throw an exception, so it can safely be executed without an enclosing try-catch block. Furthermore, the Runnable will usually be serializable, provided that its target object is serializable as well.
See Also:
DisposableBean, AbstractBeanDefinition.getDestroyMethodName(), DestructionAwareBeanPostProcessor

resolveContextualObject

public Object resolveContextualObject(String key)
Description copied from interface: Scope
Resolve the contextual object for the given key, if any. E.g. the HttpServletRequest object for key "request".

Specified by:
resolveContextualObject in interface Scope
Parameters:
key - the contextual key
Returns:
the corresponding object, or null if none found

getConversationId

public String getConversationId()
Description copied from interface: Scope
Return the conversation ID for the current underlying scope, if any.

The exact meaning of the conversation ID depends on the underlying storage mechanism. In the case of session-scoped objects, the conversation ID would typically be equal to (or derived from) the session ID; in the case of a custom conversation that sits within the overall session, the specific ID for the current conversation would be appropriate.

Note: This is an optional operation. It is perfectly valid to return null in an implementation of this method if the underlying storage mechanism has no obvious candidate for such an ID.

Specified by:
getConversationId in interface Scope
Returns:
the conversation ID, or null if there is no conversation ID for the current scope

destroy

public void destroy()
Invoke all registered destruction callbacks. To be called on ServletContext shutdown.

Specified by:
destroy in interface DisposableBean
See Also:
ContextCleanupListener
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PortletRequestAttributes

org.springframework.web.portlet.context
Class PortletRequestAttributes

java.lang.Object
    extended by  org.springframework.web.context.request.AbstractRequestAttributes
        extended by  org.springframework.web.portlet.context.PortletRequestAttributes
All Implemented Interfaces:
RequestAttributes
Direct Known Subclasses:
PortletWebRequest
public class PortletRequestAttributes
extends AbstractRequestAttributes

Portlet-based implementation of the RequestAttributes interface.

Accesses objects from portlet request and portlet session scope, with a distinction between "session" (the PortletSession's "portlet scope") and "global session" (the PortletSession's "application scope").

Since:
2.0
Author:
Juergen Hoeller
See Also:
PortletRequest.getAttribute(java.lang.String), PortletSession.getAttribute(java.lang.String), PortletSession.PORTLET_SCOPE, PortletSession.APPLICATION_SCOPE, RequestAttributes.SCOPE_SESSION, RequestAttributes.SCOPE_GLOBAL_SESSION

Field Summary
static String DESTRUCTION_CALLBACK_NAME_PREFIX
Constant identifying the String prefixed to the name of a destruction callback when it is stored in a PortletSession.
Fields inherited from class org.springframework.web.context.request.AbstractRequestAttributes
requestDestructionCallbacks
Fields inherited from interface org.springframework.web.context.request.RequestAttributes
REFERENCE_REQUEST, REFERENCE_SESSION, SCOPE_GLOBAL_SESSION, SCOPE_REQUEST, SCOPE_SESSION
Constructor Summary
PortletRequestAttributes(javax.portlet.PortletRequest request)
Create a new PortletRequestAttributes instance for the given request.
Method Summary
Object | getAttribute(String name, int scope) Return the value for the scoped attribute of the given name, if any.
String[] | getAttributeNames(int scope) Retrieve the names of all attributes in the scope.
javax.portlet.PortletRequest | getRequest() Exposes the native PortletRequest that we're wrapping.
protected javax.portlet.PortletSession | getSession(boolean allowCreate) Exposes the PortletSession that we're wrapping.
String | getSessionId() Return an id for the current underlying session.
Object | getSessionMutex() Expose the best available mutex for the underlying session: that is, an object to synchronize on for the underlying session.
void | registerDestructionCallback(String name, Runnable callback, int scope) Register a callback to be executed on destruction of the specified attribute in the given scope.
protected void | registerSessionDestructionCallback(String name, Runnable callback) Register the given callback as to be executed after session termination.
void | removeAttribute(String name, int scope) Remove the scoped attribute of the given name, if it exists.
Object | resolveReference(String key) Resolve the contextual reference for the given key, if any.
void | setAttribute(String name, Object value, int scope) Set the value for the scoped attribute of the given name, replacing an existing value (if any).
String | toString()
protected void | updateAccessedSessionAttributes() Update all accessed session attributes through session.setAttribute calls, explicitly indicating to the container that they might have been modified.
Methods inherited from class org.springframework.web.context.request.AbstractRequestAttributes
isRequestActive, registerRequestDestructionCallback, removeRequestDestructionCallback, requestCompleted
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

DESTRUCTION_CALLBACK_NAME_PREFIX

public static final String DESTRUCTION_CALLBACK_NAME_PREFIX
Constant identifying the String prefixed to the name of a destruction callback when it is stored in a PortletSession.

Constructor Detail

PortletRequestAttributes

public PortletRequestAttributes(javax.portlet.PortletRequest request)
Create a new PortletRequestAttributes instance for the given request.

Parameters:
request - current portlet request
Method Detail

getRequest

public final javax.portlet.PortletRequest getRequest()
Exposes the native PortletRequest that we're wrapping.

getSession

protected final javax.portlet.PortletSession getSession(boolean allowCreate)
Exposes the PortletSession that we're wrapping.

Parameters:
allowCreate - whether to allow creation of a new session if none exists yet

getAttribute

public Object getAttribute(String name,
                           int scope)
Description copied from interface: RequestAttributes
Return the value for the scoped attribute of the given name, if any.

Parameters:
name - the name of the attribute
scope - the scope identifier
Returns:
the current attribute value, or null if not found

setAttribute

public void setAttribute(String name,
                         Object value,
                         int scope)
Description copied from interface: RequestAttributes
Set the value for the scoped attribute of the given name, replacing an existing value (if any).

Parameters:
name - the name of the attribute
value - the value for the attribute
scope - the scope identifier

removeAttribute

public void removeAttribute(String name,
                            int scope)
Description copied from interface: RequestAttributes
Remove the scoped attribute of the given name, if it exists.

Note that an implementation should also remove a registered destruction callback for the specified attribute, if any. It does, however, not need to execute a registered destruction callback in this case, since the object will be destroyed by the caller (if appropriate).

Parameters:
name - the name of the attribute
scope - the scope identifier

getAttributeNames

public String[] getAttributeNames(int scope)
Description copied from interface: RequestAttributes
Retrieve the names of all attributes in the scope.

Parameters:
scope - the scope identifier
Returns:
the attribute names as String array

registerDestructionCallback

public void registerDestructionCallback(String name,
                                        Runnable callback,
                                        int scope)
Description copied from interface: RequestAttributes
Register a callback to be executed on destruction of the specified attribute in the given scope.

Implementations should do their best to execute the callback at the appropriate time: that is, at request completion or session termination, respectively. If such a callback is not supported by the underlying runtime environment, the callback must be ignored and a corresponding warning should be logged.

Note that 'destruction' usually corresponds to destruction of the entire scope, not to the individual attribute having been explicitly removed by the application. If an attribute gets removed via this facade's RequestAttributes.removeAttribute(String, int) method, any registered destruction callback should be disabled as well, assuming that the removed object will be reused or manually destroyed.

NOTE: Callback objects should generally be serializable if they are being registered for a session scope. Otherwise the callback (or even the entire session) might not survive web app restarts.

Parameters:
name - the name of the attribute to register the callback for
callback - the destruction callback to be executed
scope - the scope identifier

resolveReference

public Object resolveReference(String key)
Description copied from interface: RequestAttributes
Resolve the contextual reference for the given key, if any.

At a minimum: the HttpServletRequest/PortletRequest reference for key "request", and the HttpSession/PortletSession reference for key "session".

Parameters:
key - the contextual key
Returns:
the corresponding object, or null if none found

getSessionId

public String getSessionId()
Description copied from interface: RequestAttributes
Return an id for the current underlying session.

Returns:
the session id as String (never null

getSessionMutex

public Object getSessionMutex()
Description copied from interface: RequestAttributes
Expose the best available mutex for the underlying session: that is, an object to synchronize on for the underlying session.

Returns:
the session mutex to use (never null

updateAccessedSessionAttributes

protected void updateAccessedSessionAttributes()
Update all accessed session attributes through session.setAttribute calls, explicitly indicating to the container that they might have been modified.

Specified by:
updateAccessedSessionAttributes in class AbstractRequestAttributes

registerSessionDestructionCallback

protected void registerSessionDestructionCallback(String name,
                                                  Runnable callback)
Register the given callback as to be executed after session termination.

Note: The callback object should be serializable in order to survive web app restarts.

Parameters:
name - the name of the attribute to register the callback for
callback - the callback to be executed for destruction

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PortletRequestHandledEvent

org.springframework.web.portlet.context
Class PortletRequestHandledEvent

java.lang.Object
    extended by  java.util.EventObject
        extended by  org.springframework.context.ApplicationEvent
            extended by  org.springframework.web.context.support.RequestHandledEvent
                extended by  org.springframework.web.portlet.context.PortletRequestHandledEvent
All Implemented Interfaces:
Serializable
public class PortletRequestHandledEvent
extends RequestHandledEvent

Portlet-specific subclass of RequestHandledEvent, adding portlet-specific context information.

Since:
2.0
Author:
Juergen Hoeller, John A. Lewis
See Also:
FrameworkPortlet, ApplicationEventPublisher.publishEvent(org.springframework.context.ApplicationEvent), Serialized Form

Field Summary
Fields inherited from class java.util.EventObject
source
Constructor Summary
PortletRequestHandledEvent(Object source, String portletName, String portletMode, String requestType, String sessionId, String userName, long processingTimeMillis)
Create a new PortletRequestHandledEvent.
PortletRequestHandledEvent(Object source, String portletName, String portletMode, String requestType, String sessionId, String userName, long processingTimeMillis, Throwable failureCause)
Create a new PortletRequestHandledEvent.
Method Summary
String | getDescription() Return a full description of this event, involving all available context data.
String | getPortletMode() Return the mode of the portlet request (usually 'view', 'edit', or 'help').
String | getPortletName() Return the name of the portlet that handled the request.
String | getRequestType() Return the the type of Portlet Request ('action' or 'render').
String | getShortDescription() Return a short description of this event, only involving the most important context data.
String | toString()
Methods inherited from class org.springframework.web.context.support.RequestHandledEvent
getFailureCause, getProcessingTimeMillis, getSessionId, getUserName, wasFailure
Methods inherited from class org.springframework.context.ApplicationEvent
getTimestamp
Methods inherited from class java.util.EventObject
getSource
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

PortletRequestHandledEvent

public PortletRequestHandledEvent(Object source,
                                  String portletName,
                                  String portletMode,
                                  String requestType,
                                  String sessionId,
                                  String userName,
                                  long processingTimeMillis)
Create a new PortletRequestHandledEvent.

Parameters:
source - the component that published the event
portletName - the name of the portlet that handled the request
portletMode - the PortletMode of the request (usually 'view', 'edit', or 'help')
requestType - the type of Portlet request ('action' or 'render')
sessionId - the id of the HTTP session, if any
userName - the name of the user that was associated with the request, if any (usually the UserPrincipal)
processingTimeMillis - the processing time of the request in milliseconds

PortletRequestHandledEvent

public PortletRequestHandledEvent(Object source,
                                  String portletName,
                                  String portletMode,
                                  String requestType,
                                  String sessionId,
                                  String userName,
                                  long processingTimeMillis,
                                  Throwable failureCause)
Create a new PortletRequestHandledEvent.

Parameters:
source - the component that published the event
portletName - the name of the portlet that handled the request
portletMode - the PortletMode of the request (usually 'view', 'edit', or 'help')
requestType - the type of Portlet request ('action' or 'render')
sessionId - the id of the HTTP session, if any
userName - the name of the user that was associated with the request, if any (usually the UserPrincipal)
processingTimeMillis - the processing time of the request in milliseconds
failureCause - the cause of failure, if any
Method Detail

getPortletName

public String getPortletName()
Return the name of the portlet that handled the request.

getPortletMode

public String getPortletMode()
Return the mode of the portlet request (usually 'view', 'edit', or 'help').

getRequestType

public String getRequestType()
Return the the type of Portlet Request ('action' or 'render').

getShortDescription

public String getShortDescription()
Description copied from class: RequestHandledEvent
Return a short description of this event, only involving the most important context data.

Overrides:
getShortDescription in class RequestHandledEvent

getDescription

public String getDescription()
Description copied from class: RequestHandledEvent
Return a full description of this event, involving all available context data.

Overrides:
getDescription in class RequestHandledEvent

toString

public String toString()
Overrides:
toString in class RequestHandledEvent
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PortletWebRequest

org.springframework.web.portlet.context
Class PortletWebRequest

java.lang.Object
    extended by  org.springframework.web.context.request.AbstractRequestAttributes
        extended by  org.springframework.web.portlet.context.PortletRequestAttributes
            extended by  org.springframework.web.portlet.context.PortletWebRequest
All Implemented Interfaces:
NativeWebRequest, RequestAttributes, WebRequest
public class PortletWebRequest
extends PortletRequestAttributes
implements NativeWebRequest

WebRequest adapter for a PortletRequest.

Since:
2.0
Author:
Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.web.portlet.context.PortletRequestAttributes
DESTRUCTION_CALLBACK_NAME_PREFIX
Fields inherited from class org.springframework.web.context.request.AbstractRequestAttributes
requestDestructionCallbacks
Fields inherited from interface org.springframework.web.context.request.RequestAttributes
REFERENCE_REQUEST, REFERENCE_SESSION, SCOPE_GLOBAL_SESSION, SCOPE_REQUEST, SCOPE_SESSION
Constructor Summary
PortletWebRequest(javax.portlet.PortletRequest request)
Create a new PortletWebRequest instance for the given request.
PortletWebRequest(javax.portlet.PortletRequest request, javax.portlet.PortletResponse response)
Create a new PortletWebRequest instance for the given request/response pair.
Method Summary
 boolean checkNotModified(long lastModifiedTimestamp)
Last-modified handling not supported for portlet requests: As a consequence, this method always returns false.
 String getContextPath()
Return the context path for this request (usually the base path that the current web application is mapped to).
 String getDescription(boolean includeClientInfo)
Get a short description of this request, typically containing request URI and session id.
 String getHeader(String headerName)
Return the request header of the given name, or null if none.
 Iterator<String> getHeaderNames()
Return a Iterator over request header names.
 String[] getHeaderValues(String headerName)
Return the request header values for the given header name, or null if none.
 Locale getLocale()
Return the primary Locale for this request.
 Object getNativeRequest()
Return the underlying native request object, if available.
<T> T
getNativeRequest(Class<T> requiredType)
Return the underlying native request object, if available.
 Object getNativeResponse()
Return the underlying native response object, if available.
<T> T
getNativeResponse(Class<T> requiredType)
Return the underlying native request object, if available.
 String getParameter(String paramName)
Return the request parameter of the given name, or null if none.
 Map<String,String[]> getParameterMap()
Return a immutable Map of the request parameters, with parameter names as map keys and parameter values as map values.
 Iterator<String> getParameterNames()
Return a Iterator over request parameter names.
 String[] getParameterValues(String paramName)
Return the request parameter values for the given parameter name, or null if none.
 String getRemoteUser()
Return the remote user for this request, if any.
 javax.portlet.PortletResponse getResponse()
Exposes the native PortletResponse that we're wrapping (if any).
 Principal getUserPrincipal()
Return the user principal for this request, if any.
 boolean isSecure()
Return whether this request has been sent over a secure transport mechanism (such as SSL).
 boolean isUserInRole(String role)
Determine whether the user is in the given role for this request.
 String toString()
Methods inherited from class org.springframework.web.portlet.context.PortletRequestAttributes
getAttribute, getAttributeNames, getRequest, getSession, getSessionId, getSessionMutex, registerDestructionCallback, registerSessionDestructionCallback, removeAttribute, resolveReference, setAttribute, updateAccessedSessionAttributes
Methods inherited from class org.springframework.web.context.request.AbstractRequestAttributes
isRequestActive, registerRequestDestructionCallback, removeRequestDestructionCallback, requestCompleted
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.web.context.request.RequestAttributes
getAttribute, getAttributeNames, getSessionId, getSessionMutex, registerDestructionCallback, removeAttribute, resolveReference, setAttribute

Constructor Detail

PortletWebRequest

public PortletWebRequest(javax.portlet.PortletRequest request)
Create a new PortletWebRequest instance for the given request.

Parameters:
request - current portlet request

PortletWebRequest

public PortletWebRequest(javax.portlet.PortletRequest request,
                         javax.portlet.PortletResponse response)
Create a new PortletWebRequest instance for the given request/response pair.

Parameters:
request - current portlet request
response - current portlet response
Method Detail

getResponse

public final javax.portlet.PortletResponse getResponse()
Exposes the native PortletResponse that we're wrapping (if any).

getNativeRequest

public Object getNativeRequest()
Description copied from interface: NativeWebRequest
Return the underlying native request object, if available.

Specified by:
getNativeRequest in interface NativeWebRequest
See Also:
HttpServletRequest, ActionRequest, RenderRequest

getNativeResponse

public Object getNativeResponse()
Description copied from interface: NativeWebRequest
Return the underlying native response object, if available.

Specified by:
getNativeResponse in interface NativeWebRequest
See Also:
HttpServletResponse, ActionResponse, RenderResponse

getNativeRequest

public <T> T getNativeRequest(Class<T> requiredType)
Description copied from interface: NativeWebRequest
Return the underlying native request object, if available.

Specified by:
getNativeRequest in interface NativeWebRequest
Parameters:
requiredType - the desired type of request object
Returns:
the matching request object, or null if none of that type is available
See Also:
HttpServletRequest, ActionRequest, RenderRequest

getNativeResponse

public <T> T getNativeResponse(Class<T> requiredType)
Description copied from interface: NativeWebRequest
Return the underlying native request object, if available.

Specified by:
getNativeResponse in interface NativeWebRequest
Parameters:
requiredType - the desired type of response object
Returns:
the matching response object, or null if none of that type is available
See Also:
HttpServletRequest, ActionRequest, RenderRequest

getHeader

public String getHeader(String headerName)
Description copied from interface: WebRequest
Return the request header of the given name, or null if none.

Retrieves the first header value in case of a multi-value header.

Specified by:
getHeader in interface WebRequest
See Also:
HttpServletRequest.getHeader(String)

getHeaderValues

public String[] getHeaderValues(String headerName)
Description copied from interface: WebRequest
Return the request header values for the given header name, or null if none.

A single-value header will be exposed as an array with a single element.

Specified by:
getHeaderValues in interface WebRequest
See Also:
HttpServletRequest.getHeaders(String)

getHeaderNames

public Iterator<String> getHeaderNames()
Description copied from interface: WebRequest
Return a Iterator over request header names.

Specified by:
getHeaderNames in interface WebRequest
See Also:
HttpServletRequest.getHeaderNames()

getParameter

public String getParameter(String paramName)
Description copied from interface: WebRequest
Return the request parameter of the given name, or null if none.

Retrieves the first parameter value in case of a multi-value parameter.

Specified by:
getParameter in interface WebRequest
See Also:
ServletRequest.getParameter(String)

getParameterValues

public String[] getParameterValues(String paramName)
Description copied from interface: WebRequest
Return the request parameter values for the given parameter name, or null if none.

A single-value parameter will be exposed as an array with a single element.

Specified by:
getParameterValues in interface WebRequest
See Also:
ServletRequest.getParameterValues(String)

getParameterNames

public Iterator<String> getParameterNames()
Description copied from interface: WebRequest
Return a Iterator over request parameter names.

Specified by:
getParameterNames in interface WebRequest
See Also:
ServletRequest.getParameterNames()

getParameterMap

public Map<String,String[]> getParameterMap()
Description copied from interface: WebRequest
Return a immutable Map of the request parameters, with parameter names as map keys and parameter values as map values. The map values will be of type String array.

A single-value parameter will be exposed as an array with a single element.

Specified by:
getParameterMap in interface WebRequest
See Also:
ServletRequest.getParameterMap()

getLocale

public Locale getLocale()
Description copied from interface: WebRequest
Return the primary Locale for this request.

Specified by:
getLocale in interface WebRequest
See Also:
ServletRequest.getLocale()

getContextPath

public String getContextPath()
Description copied from interface: WebRequest
Return the context path for this request (usually the base path that the current web application is mapped to).

Specified by:
getContextPath in interface WebRequest
See Also:
HttpServletRequest.getContextPath()

getRemoteUser

public String getRemoteUser()
Description copied from interface: WebRequest
Return the remote user for this request, if any.

Specified by:
getRemoteUser in interface WebRequest
See Also:
HttpServletRequest.getRemoteUser()

getUserPrincipal

public Principal getUserPrincipal()
Description copied from interface: WebRequest
Return the user principal for this request, if any.

Specified by:
getUserPrincipal in interface WebRequest
See Also:
HttpServletRequest.getUserPrincipal()

isUserInRole

public boolean isUserInRole(String role)
Description copied from interface: WebRequest
Determine whether the user is in the given role for this request.

Specified by:
isUserInRole in interface WebRequest
See Also:
HttpServletRequest.isUserInRole(String)

isSecure

public boolean isSecure()
Description copied from interface: WebRequest
Return whether this request has been sent over a secure transport mechanism (such as SSL).

Specified by:
isSecure in interface WebRequest
See Also:
ServletRequest.isSecure()

checkNotModified

public boolean checkNotModified(long lastModifiedTimestamp)
Last-modified handling not supported for portlet requests: As a consequence, this method always returns false.

Specified by:
checkNotModified in interface WebRequest
Parameters:
lastModifiedTimestamp - the last-modified timestamp that the application determined for the underlying resource
Returns:
whether the request qualifies as not modified, allowing to abort request processing and relying on the response telling the client that the content has not been modified

getDescription

public String getDescription(boolean includeClientInfo)
Description copied from interface: WebRequest
Get a short description of this request, typically containing request URI and session id.

Specified by:
getDescription in interface WebRequest
Parameters:
includeClientInfo - whether to include client-specific information such as session id and user name
Returns:
the requested description as String

toString

public String toString()
Overrides:
toString in class PortletRequestAttributes
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StaticPortletApplicationContext

org.springframework.web.portlet.context
Class StaticPortletApplicationContext

java.lang.Object
    extended by  org.springframework.core.io.DefaultResourceLoader
        extended by  org.springframework.context.support.AbstractApplicationContext
            extended by  org.springframework.context.support.GenericApplicationContext
                extended by  org.springframework.context.support.StaticApplicationContext
                    extended by  org.springframework.web.portlet.context.StaticPortletApplicationContext
All Implemented Interfaces:
BeanFactory, DisposableBean, HierarchicalBeanFactory, ListableBeanFactory, BeanDefinitionRegistry, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, AliasRegistry, ResourceLoader, ResourcePatternResolver, WebApplicationContext, ConfigurablePortletApplicationContext
public class StaticPortletApplicationContext
extends StaticApplicationContext
implements ConfigurablePortletApplicationContext

Static Portlet-based ApplicationContext implementation for testing. Not intended for use in production applications.

Implements the ConfigurablePortletApplicationContext interface to allow for direct replacement of an XmlPortletApplicationContext, despite not actually supporting external configuration files.

Interprets resource paths as portlet context resources, that is, as paths beneath the portlet application root. Absolute paths, for example for files outside the portlet app root, can be accessed via "file:" URLs, as implemented by DefaultResourceLoader.

Since:
2.0
Author:
Juergen Hoeller, Mark Fisher

Field Summary
Fields inherited from class org.springframework.context.support.AbstractApplicationContext
APPLICATION_EVENT_MULTICASTER_BEAN_NAME, LIFECYCLE_PROCESSOR_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAME
Fields inherited from interface org.springframework.web.portlet.context.ConfigurablePortletApplicationContext
APPLICATION_CONTEXT_ID_PREFIX, PORTLET_CONFIG_BEAN_NAME, PORTLET_CONTEXT_BEAN_NAME
Fields inherited from interface org.springframework.web.context.WebApplicationContext
CONTEXT_ATTRIBUTES_BEAN_NAME, CONTEXT_PARAMETERS_BEAN_NAME, ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, SCOPE_APPLICATION, SCOPE_GLOBAL_SESSION, SCOPE_REQUEST, SCOPE_SESSION, SERVLET_CONTEXT_BEAN_NAME
Fields inherited from interface org.springframework.context.ConfigurableApplicationContext
CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAME
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Constructor Summary
StaticPortletApplicationContext()
Method Summary
String[] | getConfigLocations() Return the config locations for this web application context, or null if none specified.
String | getNamespace() Return the namespace for this web application context, if any.
javax.portlet.PortletConfig | getPortletConfig() Return the PortletConfig for this portlet application context, if any.
javax.portlet.PortletContext | getPortletContext() Return the standard Portlet API PortletContext for this application.
protected Resource | getResourceByPath(String path) This implementation supports file paths beneath the root of the PortletContext.
protected ResourcePatternResolver | getResourcePatternResolver() This implementation supports pattern matching in unexpanded WARs too.
ServletContext | getServletContext() Return the standard Servlet API ServletContext for this application.
protected void | postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) Register request/session scopes, a PortletContextAwareProcessor, etc.
void | setConfigLocation(String configLocation) The StaticPortletApplicationContext class does not support this method.
void | setConfigLocations(String[] configLocations) The StaticPortletApplicationContext class does not support this method.
void | setNamespace(String namespace) Set the namespace for this portlet application context, to be used for building a default context config location.
void | setParent(ApplicationContext parent) Set the parent of this application context, also setting the parent of the internal BeanFactory accordingly.
void | setPortletConfig(javax.portlet.PortletConfig portletConfig) Set the PortletConfig for this portlet application context.
void | setPortletContext(javax.portlet.PortletContext portletContext) Set the PortletContext for this portlet application context.
Methods inherited from class org.springframework.context.support.StaticApplicationContext
addMessage, getStaticMessageSource, registerPrototype, registerPrototype, registerSingleton, registerSingleton
Methods inherited from class org.springframework.context.support.GenericApplicationContext
closeBeanFactory, getBeanDefinition, getBeanFactory, getDefaultListableBeanFactory, getResource, getResources, isAlias, isBeanNameInUse, refreshBeanFactory, registerAlias, registerBeanDefinition, removeAlias, removeBeanDefinition, setAllowBeanDefinitionOverriding, setAllowCircularReferences, setId, setResourceLoader
Methods inherited from class org.springframework.context.support.AbstractApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, addListener, cancelRefresh, close, containsBean, containsBeanDefinition, containsLocalBean, destroy, destroyBeans, doClose, findAnnotationOnBean, finishBeanFactoryInitialization, finishRefresh, getAliases, getApplicationListeners, getAutowireCapableBeanFactory, getBean, getBean, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getDisplayName, getId, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getStartupDate, getType, initApplicationEventMulticaster, initLifecycleProcessor, initMessageSource, invokeBeanFactoryPostProcessors, isActive, isPrototype, isRunning, isSingleton, isTypeMatch, obtainFreshBeanFactory, onClose, onRefresh, prepareBeanFactory, prepareRefresh, publishEvent, refresh, registerBeanPostProcessors, registerListeners, registerShutdownHook, setDisplayName, start, stop, toString
Methods inherited from class org.springframework.core.io.DefaultResourceLoader
getClassLoader, setClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.context.ConfigurableApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, close, getBeanFactory, isActive, refresh, registerShutdownHook, setId
Methods inherited from interface org.springframework.context.ApplicationContext
getAutowireCapableBeanFactory, getDisplayName, getId, getParent, getStartupDate
Methods inherited from interface org.springframework.beans.factory.ListableBeanFactory
containsBeanDefinition, findAnnotationOnBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation
Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory
containsLocalBean, getParentBeanFactory
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getBean, getBean, getType, isPrototype, isSingleton, isTypeMatch
Methods inherited from interface org.springframework.context.MessageSource
getMessage, getMessage, getMessage
Methods inherited from interface org.springframework.context.ApplicationEventPublisher
publishEvent
Methods inherited from interface org.springframework.core.io.support.ResourcePatternResolver
getResources
Methods inherited from interface org.springframework.core.io.ResourceLoader
getClassLoader, getResource
Methods inherited from interface org.springframework.context.Lifecycle
isRunning, start, stop
Methods inherited from interface org.springframework.beans.factory.support.BeanDefinitionRegistry
containsBeanDefinition, getBeanDefinitionCount, getBeanDefinitionNames
Methods inherited from interface org.springframework.core.AliasRegistry
getAliases

Constructor Detail

StaticPortletApplicationContext

public StaticPortletApplicationContext()
Method Detail

setParent

public void setParent(ApplicationContext parent)
Description copied from class: GenericApplicationContext
Set the parent of this application context, also setting the parent of the internal BeanFactory accordingly.

Specified by:
setParent in interface ConfigurableApplicationContext
Overrides:
setParent in class GenericApplicationContext
Parameters:
parent - the parent context
See Also:
ConfigurableBeanFactory.setParentBeanFactory(org.springframework.beans.factory.BeanFactory)

getServletContext

public ServletContext getServletContext()
Description copied from interface: WebApplicationContext
Return the standard Servlet API ServletContext for this application.

Also available for a Portlet application, in addition to the PortletContext.

Specified by:
getServletContext in interface WebApplicationContext

setPortletContext

public void setPortletContext(javax.portlet.PortletContext portletContext)
Description copied from interface: ConfigurablePortletApplicationContext
Set the PortletContext for this portlet application context.

Does not cause an initialization of the context: refresh needs to be called after the setting of all configuration properties.

Specified by:
setPortletContext in interface ConfigurablePortletApplicationContext
See Also:
ConfigurableApplicationContext.refresh()

getPortletContext

public javax.portlet.PortletContext getPortletContext()
Description copied from interface: ConfigurablePortletApplicationContext
Return the standard Portlet API PortletContext for this application.

Specified by:
getPortletContext in interface ConfigurablePortletApplicationContext

setPortletConfig

public void setPortletConfig(javax.portlet.PortletConfig portletConfig)
Description copied from interface: ConfigurablePortletApplicationContext
Set the PortletConfig for this portlet application context.

Specified by:
setPortletConfig in interface ConfigurablePortletApplicationContext
See Also:
ConfigurableApplicationContext.refresh()

getPortletConfig

public javax.portlet.PortletConfig getPortletConfig()
Description copied from interface: ConfigurablePortletApplicationContext
Return the PortletConfig for this portlet application context, if any.

Specified by:
getPortletConfig in interface ConfigurablePortletApplicationContext

setNamespace

public void setNamespace(String namespace)
Description copied from interface: ConfigurablePortletApplicationContext
Set the namespace for this portlet application context, to be used for building a default context config location.

Specified by:
setNamespace in interface ConfigurablePortletApplicationContext

getNamespace

public String getNamespace()
Description copied from interface: ConfigurablePortletApplicationContext
Return the namespace for this web application context, if any.

Specified by:
getNamespace in interface ConfigurablePortletApplicationContext

setConfigLocation

public void setConfigLocation(String configLocation)
The StaticPortletApplicationContext class does not support this method.

Specified by:
setConfigLocation in interface ConfigurablePortletApplicationContext
Throws:
UnsupportedOperationException - always

setConfigLocations

public void setConfigLocations(String[] configLocations)
The StaticPortletApplicationContext class does not support this method.

Specified by:
setConfigLocations in interface ConfigurablePortletApplicationContext
Throws:
UnsupportedOperationException - always

getConfigLocations

public String[] getConfigLocations()
Description copied from interface: ConfigurablePortletApplicationContext
Return the config locations for this web application context, or null if none specified.

Specified by:
getConfigLocations in interface ConfigurablePortletApplicationContext

postProcessBeanFactory

protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
Register request/session scopes, a PortletContextAwareProcessor, etc.

Overrides:
postProcessBeanFactory in class AbstractApplicationContext
Parameters:
beanFactory - the bean factory used by the application context

getResourceByPath

protected Resource getResourceByPath(String path)
This implementation supports file paths beneath the root of the PortletContext.

Overrides:
getResourceByPath in class DefaultResourceLoader
Parameters:
path - the path to the resource
Returns:
the corresponding Resource handle
See Also:
PortletContextResource

getResourcePatternResolver

protected ResourcePatternResolver getResourcePatternResolver()
This implementation supports pattern matching in unexpanded WARs too.

Overrides:
getResourcePatternResolver in class AbstractApplicationContext
Returns:
the ResourcePatternResolver for this context
See Also:
PortletContextResourcePatternResolver
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XmlPortletApplicationContext

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.portlet.context
Class XmlPortletApplicationContext

java.lang.Object
    extended by  org.springframework.core.io.DefaultResourceLoader
        extended by  org.springframework.context.support.AbstractApplicationContext
            extended by  org.springframework.context.support.AbstractRefreshableApplicationContext
                extended by  org.springframework.context.support.AbstractRefreshableConfigApplicationContext
                    extended by  org.springframework.web.portlet.context.AbstractRefreshablePortletApplicationContext
                        extended by  org.springframework.web.portlet.context.XmlPortletApplicationContext
All Implemented Interfaces:
BeanFactory, BeanNameAware, DisposableBean, HierarchicalBeanFactory, InitializingBean, ListableBeanFactory, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, ResourceLoader, ResourcePatternResolver, WebApplicationContext, ConfigurablePortletApplicationContext
public class XmlPortletApplicationContext
extends AbstractRefreshablePortletApplicationContext

Portlet-based WebApplicationContext implementation which takes its configuration from XML documents, understood by an XmlBeanDefinitionReader. This is essentially the equivalent of AbstractXmlApplicationContext for a portlet environment.

By default, the configuration will be taken from "/WEB-INF/applicationContext.xml" for the root context, and "/WEB-INF/test-portlet.xml" for a context with the namespace "test-portlet" (like for a DispatcherPortlet instance with the portlet-name "test").

The config location defaults can be overridden via the "contextConfigLocation" portlet init-param of FrameworkPortlet. Config locations can either denote concrete files like "/WEB-INF/context.xml" or Ant-style patterns like "/WEB-INF/*-context.xml" (see PathMatcher javadoc for pattern details).

Note: In case of multiple config locations, later bean definitions will override ones defined in earlier loaded files. This can be leveraged to deliberately override certain bean definitions via an extra XML file.

For a Portlet-based context that reads in a different bean definition format, create an analogous subclass of AbstractRefreshablePortletApplicationContext. Such a context implementation can be specified as "contextClass" init-param for a FrameworkPortlet instance.

Since:
2.0
Author:
Juergen Hoeller, John A. Lewis
See Also:
AbstractRefreshablePortletApplicationContext.setNamespace(java.lang.String), AbstractRefreshableConfigApplicationContext.setConfigLocations(java.lang.String[]), XmlBeanDefinitionReader, FrameworkPortlet.initPortletApplicationContext()

Field Summary
static String | DEFAULT_CONFIG_LOCATION Default config location for the root context
static String | DEFAULT_CONFIG_LOCATION_PREFIX Default prefix for building a config location for a namespace
static String | DEFAULT_CONFIG_LOCATION_SUFFIX Default suffix for building a config location for a namespace
Fields inherited from class org.springframework.context.support.AbstractApplicationContext
APPLICATION_EVENT_MULTICASTER_BEAN_NAME, LIFECYCLE_PROCESSOR_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAME
Fields inherited from interface org.springframework.web.portlet.context.ConfigurablePortletApplicationContext
APPLICATION_CONTEXT_ID_PREFIX, PORTLET_CONFIG_BEAN_NAME, PORTLET_CONTEXT_BEAN_NAME
Fields inherited from interface org.springframework.web.context.WebApplicationContext
CONTEXT_ATTRIBUTES_BEAN_NAME, CONTEXT_PARAMETERS_BEAN_NAME, ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, SCOPE_APPLICATION, SCOPE_GLOBAL_SESSION, SCOPE_REQUEST, SCOPE_SESSION, SERVLET_CONTEXT_BEAN_NAME
Fields inherited from interface org.springframework.context.ConfigurableApplicationContext
CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAME
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Constructor Summary
XmlPortletApplicationContext()
Method Summary
protected String[] | getDefaultConfigLocations() The default location for the root context is "/WEB-INF/applicationContext.xml", and "/WEB-INF/test-portlet.xml" for a context with the namespace "test-portlet" (like for a DispatcherPortlet instance with the portlet-name "test").
protected void | initBeanDefinitionReader(XmlBeanDefinitionReader beanDefinitionReader) Initialize the bean definition reader used for loading the bean definitions of this context.
protected void | loadBeanDefinitions(DefaultListableBeanFactory beanFactory) Loads the bean definitions via an XmlBeanDefinitionReader.
protected void | loadBeanDefinitions(XmlBeanDefinitionReader reader) Load the bean definitions with the given XmlBeanDefinitionReader.
Methods inherited from class org.springframework.web.portlet.context.AbstractRefreshablePortletApplicationContext
getConfigLocations, getNamespace, getPortletConfig, getPortletContext, getResourceByPath, getResourcePatternResolver, getServletContext, postProcessBeanFactory, setNamespace, setParent, setPortletConfig, setPortletContext
Methods inherited from class org.springframework.context.support.AbstractRefreshableConfigApplicationContext
afterPropertiesSet, resolvePath, setBeanName, setConfigLocation, setConfigLocations, setId
Methods inherited from class org.springframework.context.support.AbstractRefreshableApplicationContext
cancelRefresh, closeBeanFactory, createBeanFactory, customizeBeanFactory, getBeanFactory, hasBeanFactory, refreshBeanFactory, setAllowBeanDefinitionOverriding, setAllowCircularReferences
Methods inherited from class org.springframework.context.support.AbstractApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, addListener, close, containsBean, containsBeanDefinition, containsLocalBean, destroy, destroyBeans, doClose, findAnnotationOnBean, finishBeanFactoryInitialization, finishRefresh, getAliases, getApplicationListeners, getAutowireCapableBeanFactory, getBean, getBean, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getDisplayName, getId, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getResources, getStartupDate, getType, initApplicationEventMulticaster, initLifecycleProcessor, initMessageSource, invokeBeanFactoryPostProcessors, isActive, isPrototype, isRunning, isSingleton, isTypeMatch, obtainFreshBeanFactory, onClose, onRefresh, prepareBeanFactory, prepareRefresh, publishEvent, refresh, registerBeanPostProcessors, registerListeners, registerShutdownHook, setDisplayName, start, stop, toString
Methods inherited from class org.springframework.core.io.DefaultResourceLoader
getClassLoader, getResource, setClassLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.web.portlet.context.ConfigurablePortletApplicationContext
setConfigLocation, setConfigLocations
Methods inherited from interface org.springframework.context.ConfigurableApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, close, getBeanFactory, isActive, refresh, registerShutdownHook, setId
Methods inherited from interface org.springframework.context.ApplicationContext
getAutowireCapableBeanFactory, getDisplayName, getId, getParent, getStartupDate
Methods inherited from interface org.springframework.beans.factory.ListableBeanFactory
containsBeanDefinition, findAnnotationOnBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation
Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory
containsLocalBean, getParentBeanFactory
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getBean, getBean, getType, isPrototype, isSingleton, isTypeMatch
Methods inherited from interface org.springframework.context.MessageSource
getMessage, getMessage, getMessage
Methods inherited from interface org.springframework.context.ApplicationEventPublisher
publishEvent
Methods inherited from interface org.springframework.core.io.support.ResourcePatternResolver
getResources
Methods inherited from interface org.springframework.core.io.ResourceLoader
getClassLoader, getResource
Methods inherited from interface org.springframework.context.Lifecycle
isRunning, start, stop

Field Detail

DEFAULT_CONFIG_LOCATION

public static final String DEFAULT_CONFIG_LOCATION
Default config location for the root context

See Also:
Constant Field Values

DEFAULT_CONFIG_LOCATION_PREFIX

public static final String DEFAULT_CONFIG_LOCATION_PREFIX
Default prefix for building a config location for a namespace

See Also:
Constant Field Values

DEFAULT_CONFIG_LOCATION_SUFFIX

public static final String DEFAULT_CONFIG_LOCATION_SUFFIX
Default suffix for building a config location for a namespace

See Also:
Constant Field Values
Constructor Detail

XmlPortletApplicationContext

public XmlPortletApplicationContext()
Method Detail

loadBeanDefinitions

protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory)
                            throws BeansException,
                                   IOException
Loads the bean definitions via an XmlBeanDefinitionReader.

Specified by:
loadBeanDefinitions in class AbstractRefreshableApplicationContext
Parameters:
beanFactory - the bean factory to load bean definitions into
Throws:
BeansException - if parsing of the bean definitions failed
IOException - if loading of bean definition files failed
See Also:
XmlBeanDefinitionReader, initBeanDefinitionReader(org.springframework.beans.factory.xml.XmlBeanDefinitionReader), loadBeanDefinitions(org.springframework.beans.factory.support.DefaultListableBeanFactory)

initBeanDefinitionReader

protected void initBeanDefinitionReader(XmlBeanDefinitionReader beanDefinitionReader)
Initialize the bean definition reader used for loading the bean definitions of this context. Default implementation is empty.

Can be overridden in subclasses, e.g. for turning off XML validation or using a different XmlBeanDefinitionParser implementation.

Parameters:
beanDefinitionReader - the bean definition reader used by this context
See Also:
XmlBeanDefinitionReader.setValidationMode(int), XmlBeanDefinitionReader.setDocumentReaderClass(java.lang.Class)

loadBeanDefinitions

protected void loadBeanDefinitions(XmlBeanDefinitionReader reader)
                            throws BeansException,
                                   IOException
Load the bean definitions with the given XmlBeanDefinitionReader.

The lifecycle of the bean factory is handled by the refreshBeanFactory method; therefore this method is just supposed to load and/or register bean definitions.

Delegates to a ResourcePatternResolver for resolving location patterns into Resource instances.

Throws:
BeansException - in case of bean registration errors
IOException - if the required XML document isn't found
See Also:
AbstractRefreshableApplicationContext.refreshBeanFactory(),
AbstractRefreshablePortletApplicationContext.getConfigLocations(),
AbstractApplicationContext.getResources(java.lang.String),
AbstractRefreshablePortletApplicationContext.getResourcePatternResolver()

getDefaultConfigLocations

protected String[] getDefaultConfigLocations()
The default location for the root context is "/WEB-INF/applicationContext.xml", and "/WEB-INF/test-portlet.xml" for a context with the namespace "test-portlet" (like for a DispatcherPortlet instance with the portlet-name "test").

Overrides:
getDefaultConfigLocations in class AbstractRefreshableConfigApplicationContext
Returns:
an array of default config locations, if any
See Also:
AbstractRefreshableConfigApplicationContext.setConfigLocations(java.lang.String[])
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.portlet.handler

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.portlet.handler

Provides standard HandlerMapping implementations, including abstract base classes for custom implementations.

See:
Description

Interface Summary
AbstractMapBasedHandlerMapping.PortletRequestMappingPredicate Predicate interface for determining a match with a given request.

Class Summary
AbstractHandlerExceptionResolver | Abstract base class for HandlerExceptionResolver implementations.
AbstractHandlerMapping | Abstract base class for HandlerMapping implementations.
AbstractMapBasedHandlerMapping<K> | Abstract base class for HandlerMapping implementations that rely on a map which caches handler objects per lookup key.
HandlerInterceptorAdapter | Abstract adapter class for the HandlerInterceptor interface, for simplified implementation of pre-only/post-only interceptors.
ParameterHandlerMapping | Implementation of the HandlerMapping to map from a request parameter to request handler beans.
ParameterMappingInterceptor | Interceptor to forward a request parameter from the ActionRequest to the RenderRequest.
PortletContentGenerator | Convenient superclass for any kind of web content generator, like AbstractController.
PortletModeHandlerMapping | Implementation of the HandlerMapping interface to map from the current PortletMode to request handler beans.
PortletModeParameterHandlerMapping | Implementation of the HandlerMapping interface to map from the current PortletMode and a request parameter to request handler beans.
SimpleMappingExceptionResolver | HandlerExceptionResolver implementation that allows for mapping exception class names to view names, either for a set of given handlers or for all handlers in the DispatcherPortlet.
SimplePortletHandlerAdapter | Adapter to use the Portlet interface with the generic DispatcherPortlet.
SimplePortletPostProcessor | Bean post-processor that applies initialization and destruction callbacks to beans that implement the Portlet interface.
UserRoleAuthorizationInterceptor | Interceptor that checks the authorization of the current user via the user's roles, as evaluated by PortletRequest's isUserInRole method.
WebRequestHandlerInterceptorAdapter | Adapter that implements the Portlet HandlerInterceptor interface and wraps an underlying WebRequestInterceptor.

Exception Summary
PortletRequestMethodNotSupportedException | Exception thrown when a request handler does not support a specific request method.
PortletSessionRequiredException | Exception thrown when a portlet content generator requires a pre-existing session.

Package org.springframework.web.portlet.handler Description

Provides standard HandlerMapping implementations, including abstract base classes for custom implementations.


org.springframework.web.portlet.handler Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.portlet.handler

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.web.portlet.handler.AbstractHandlerExceptionResolver (implements org.springframework.web.portlet.HandlerExceptionResolver, org.springframework.core.Ordered)
      • org.springframework.web.portlet.handler.SimpleMappingExceptionResolver
    • org.springframework.context.support.ApplicationObjectSupport (implements org.springframework.context.ApplicationContextAware)
      • org.springframework.web.portlet.handler.AbstractHandlerMapping (implements org.springframework.web.portlet.HandlerMapping, org.springframework.core.Ordered)
        • org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping<K>
          • org.springframework.web.portlet.handler.ParameterHandlerMapping
          • org.springframework.web.portlet.handler.PortletModeHandlerMapping
          • org.springframework.web.portlet.handler.PortletModeParameterHandlerMapping
      • org.springframework.web.portlet.context.PortletApplicationObjectSupport (implements org.springframework.web.portlet.context.PortletContextAware)
        • org.springframework.web.portlet.handler.PortletContentGenerator
    • org.springframework.web.portlet.handler.HandlerInterceptorAdapter (implements org.springframework.web.portlet.HandlerInterceptor)
      • org.springframework.web.portlet.handler.ParameterMappingInterceptor
      • org.springframework.web.portlet.handler.UserRoleAuthorizationInterceptor
    • org.springframework.web.portlet.handler.SimplePortletHandlerAdapter (implements org.springframework.web.portlet.HandlerAdapter, org.springframework.web.portlet.context.PortletContextAware)
    • org.springframework.web.portlet.handler.SimplePortletPostProcessor (implements org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor, org.springframework.web.portlet.context.PortletConfigAware, org.springframework.web.portlet.context.PortletContextAware)
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • javax.portlet.PortletException
          • org.springframework.web.portlet.handler.PortletRequestMethodNotSupportedException
          • org.springframework.web.portlet.handler.PortletSessionRequiredException
    • org.springframework.web.portlet.handler.WebRequestHandlerInterceptorAdapter (implements org.springframework.web.portlet.HandlerInterceptor)

Interface Hierarchy

  • java.lang.Comparable<T>
    • org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping.PortletRequestMappingPredicate


AbstractHandlerExceptionResolver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.portlet.handler
Class AbstractHandlerExceptionResolver

java.lang.Object
    extended by  org.springframework.web.portlet.handler.AbstractHandlerExceptionResolver
All Implemented Interfaces:
Ordered, HandlerExceptionResolver
Direct Known Subclasses:
AnnotationMethodHandlerExceptionResolver, SimpleMappingExceptionResolver
public abstract class AbstractHandlerExceptionResolver
extends Object
implements HandlerExceptionResolver, Ordered

Abstract base class for HandlerExceptionResolver implementations.

Provides a set of mapped handlers that the resolver should map to, and the Ordered implementation.

Since:
3.0
Author:
Arjen Poutsma

Field Summary
protected  Log logger
Logger available to subclasses
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AbstractHandlerExceptionResolver()
Method Summary
protected String | buildLogMessage(Exception ex, javax.portlet.PortletRequest request) Build a log message for the given exception, occured during processing the given request.
protected abstract ModelAndView | doResolveException(javax.portlet.PortletRequest request, javax.portlet.MimeResponse response, Object handler, Exception ex) Actually resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
protected void | logException(Exception ex, javax.portlet.PortletRequest request) Log the given exception at warn level, provided that warn logging has been activated through the "warnLogCategory" property.
ModelAndView | resolveException(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response, Object handler, Exception ex) Checks whether this resolver is supposed to apply (i.e.
ModelAndView | resolveException(javax.portlet.ResourceRequest request, javax.portlet.ResourceResponse response, Object handler, Exception ex) Try to resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.
void | setMappedHandlerClasses(Class[] mappedHandlerClasses) Specify the set of classes that this exception resolver should apply to.
void | setMappedHandlers(Set mappedHandlers) Specify the set of handlers that this exception resolver should map.
void | setOrder(int order)
void | setRenderWhenMinimized(boolean renderWhenMinimized) Set if the resolver should render a view when the portlet is in a minimized window.
void | setWarnLogCategory(String loggerName) Set the log category for warn logging.
protected boolean | shouldApplyTo(javax.portlet.PortletRequest request, Object handler) Check whether this resolver is supposed to apply to the given handler.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

AbstractHandlerExceptionResolver

public AbstractHandlerExceptionResolver()
Method Detail

setOrder

public void setOrder(int order)

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

setMappedHandlers

public void setMappedHandlers(Set mappedHandlers)
Specify the set of handlers that this exception resolver should map. The exception mappings and the default error view will only apply to the specified handlers.

If no handlers set, both the exception mappings and the default error view will apply to all handlers. This means that a specified default error view will be used as fallback for all exceptions; any further HandlerExceptionResolvers in the chain will be ignored in this case.

setMappedHandlerClasses

public void setMappedHandlerClasses(Class[] mappedHandlerClasses)
Specify the set of classes that this exception resolver should apply to. The exception mappings and the default error view will only apply to handlers of the specified type; the specified types may be interfaces and superclasses of handlers as well.

If no handlers and handler classes are set, the exception mappings and the default error view will apply to all handlers. This means that a specified default error view will be used as fallback for all exceptions; any further HandlerExceptionResolvers in the chain will be ignored in this case.

setWarnLogCategory

public void setWarnLogCategory(String loggerName)
Set the log category for warn logging. The name will be passed to the underlying logger implementation through Commons Logging, getting interpreted as log category according to the logger's configuration.

Default is no warn logging. Specify this setting to activate warn logging into a specific category. Alternatively, override the logException(java.lang.Exception, javax.portlet.PortletRequest) method for custom logging.

See Also:
LogFactory.getLog(String),
Logger.getLogger(String),
Logger.getLogger(String)

setRenderWhenMinimized

public void setRenderWhenMinimized(boolean renderWhenMinimized)
Set if the resolver should render a view when the portlet is in a minimized window. The default is "false".

See Also:
PortletRequest.getWindowState(), WindowState.MINIMIZED

resolveException

public ModelAndView resolveException(javax.portlet.RenderRequest request,
                                     javax.portlet.RenderResponse response,
                                     Object handler,
                                     Exception ex)
Checks whether this resolver is supposed to apply (i.e. the handler matches in case of "mappedHandlers" having been specified), then delegates to the doResolveException(javax.portlet.PortletRequest, javax.portlet.MimeResponse, java.lang.Object, java.lang.Exception) template method.

Specified by:
resolveException in interface HandlerExceptionResolver
Parameters:
request - current portlet request
response - current portlet response
handler - the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
ex - the exception that got thrown during handler execution
Returns:
a corresponding ModelAndView to forward to, or null for default processing

resolveException

public ModelAndView resolveException(javax.portlet.ResourceRequest request,
                                     javax.portlet.ResourceResponse response,
                                     Object handler,
                                     Exception ex)
Description copied from interface: HandlerExceptionResolver
Try to resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.

Specified by:
resolveException in interface HandlerExceptionResolver
Parameters:
request - current portlet request
response - current portlet response
handler - the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
ex - the exception that got thrown during handler execution
Returns:
a corresponding ModelAndView to forward to, or null for default processing

shouldApplyTo

protected boolean shouldApplyTo(javax.portlet.PortletRequest request,
                                Object handler)
Check whether this resolver is supposed to apply to the given handler.

The default implementation checks against the specified mapped handlers and handler classes, if any, and alspo checks the window state (according to the "renderWhenMinimize" property).

Parameters:
request - current portlet request
handler - the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
Returns:
whether this resolved should proceed with resolving the exception for the given request and handler
See Also:
setMappedHandlers(java.util.Set), setMappedHandlerClasses(java.lang.Class[])

logException

protected void logException(Exception ex,
                            javax.portlet.PortletRequest request)
Log the given exception at warn level, provided that warn logging has been activated through the "warnLogCategory" property.

Calls buildLogMessage(java.lang.Exception, javax.portlet.PortletRequest) in order to determine the concrete message to log. Always passes the full exception to the logger.

Parameters:
ex - the exception that got thrown during handler execution
request - current portlet request (useful for obtaining metadata)
See Also:
setWarnLogCategory(java.lang.String),
buildLogMessage(java.lang.Exception, javax.portlet.PortletRequest),
Log.warn(Object, Throwable)

buildLogMessage

protected String buildLogMessage(Exception ex,
                                 javax.portlet.PortletRequest request)
Build a log message for the given exception, occured during processing the given request.

Parameters:
ex - the exception that got thrown during handler execution
request - current portlet request (useful for obtaining metadata)
Returns:
the log message to use

doResolveException

protected abstract ModelAndView doResolveException(javax.portlet.PortletRequest request,
                                                   javax.portlet.MimeResponse response,
                                                   Object handler,
                                                   Exception ex)
Actually resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.

Must be overridden in subclasses, in order to apply specific exception checks. Note that this template method will be invoked after checking whether this resolved applies ("mappedHandlers" etc), so an implementation may simply proceed with its actual exception handling.

Parameters:
request - current portlet request
response - current portlet response
handler - the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
ex - the exception that got thrown during handler execution
Returns:
a corresponding ModelAndView to forward to, or null for default processing
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractHandlerMapping

org.springframework.web.portlet.handler
Class AbstractHandlerMapping

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.portlet.handler.AbstractHandlerMapping
All Implemented Interfaces:
ApplicationContextAware, Ordered, HandlerMapping
Direct Known Subclasses:
AbstractMapBasedHandlerMapping
public abstract class AbstractHandlerMapping
extends ApplicationObjectSupport
implements HandlerMapping, Ordered

Abstract base class for HandlerMapping implementations. Supports ordering, a default handler, and handler interceptors.

Since:
2.0
Author:
Juergen Hoeller, John A. Lewis
See Also:
getHandlerInternal(javax.portlet.PortletRequest),
setDefaultHandler(java.lang.Object),
setInterceptors(java.lang.Object[]),
HandlerInterceptor

Field Summary
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AbstractHandlerMapping()
Method Summary
protected HandlerInterceptor | adaptInterceptor(Object interceptor) Adapt the given interceptor object to the HandlerInterceptor interface.
protected void | extendInterceptors(List interceptors) Extension hook that subclasses can override to register additional interceptors, given the configured interceptors (see setInterceptors(java.lang.Object[])).
protected HandlerInterceptor[] | getAdaptedInterceptors() Return the adapted interceptors as HandlerInterceptor array.
Object | getDefaultHandler() Return the default handler for this handler mapping, or null if none.
HandlerExecutionChain | getHandler(javax.portlet.PortletRequest request) Look up a handler for the given request, falling back to the default handler if no specific one is found.
protected HandlerExecutionChain | getHandlerExecutionChain(Object handler, javax.portlet.PortletRequest request) Build a HandlerExecutionChain for the given handler, including applicable interceptors.
protected abstract Object | getHandlerInternal(javax.portlet.PortletRequest request) Look up a handler for the given request, returning null if no specific one is found.
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
protected void | initApplicationContext() Initializes the interceptors.
protected void | initInterceptors() Initialize the specified interceptors, adapting them where necessary.
void | setApplyWebRequestInterceptorsToRenderPhaseOnly(boolean applyWebRequestInterceptorsToRenderPhaseOnly) Specify whether to apply WebRequestInterceptors to the Portlet render phase only ("true", or whether to apply them to the Portlet action phase as well ("false").
void | setDefaultHandler(Object defaultHandler) Set the default handler for this handler mapping.
void | setInterceptors(Object[] interceptors) Set the interceptors to apply for all handlers mapped by this handler mapping.
void | setOrder(int order) Specify the order value for this HandlerMapping bean.
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, isContextRequired, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractHandlerMapping

public AbstractHandlerMapping()
Method Detail

setOrder

public final void setOrder(int order)
Specify the order value for this HandlerMapping bean.

Default value is Integer.MAX_VALUE, meaning that it's non-ordered.

See Also:
Ordered.getOrder()

getOrder

public final int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

setDefaultHandler

public void setDefaultHandler(Object defaultHandler)
Set the default handler for this handler mapping. This handler will be returned if no specific mapping was found.

Default is null, indicating no default handler.

getDefaultHandler

public Object getDefaultHandler()
Return the default handler for this handler mapping, or null if none.

setInterceptors

public void setInterceptors(Object[] interceptors)
Set the interceptors to apply for all handlers mapped by this handler mapping.

Supported interceptor types are HandlerInterceptor and WebRequestInterceptor. Each given WebRequestInterceptor will be wrapped in a WebRequestHandlerInterceptorAdapter.

Parameters:
interceptors - array of handler interceptors, or null if none
See Also:
adaptInterceptor(java.lang.Object), HandlerInterceptor, WebRequestInterceptor

setApplyWebRequestInterceptorsToRenderPhaseOnly

public void setApplyWebRequestInterceptorsToRenderPhaseOnly(boolean applyWebRequestInterceptorsToRenderPhaseOnly)
Specify whether to apply WebRequestInterceptors to the Portlet render phase only ("true", or whether to apply them to the Portlet action phase as well ("false").

Default is "true", since WebRequestInterceptors are usually built for MVC-style handler execution plus rendering process (which is, for example, the primary target scenario for "Open Session in View" interceptors, offering lazy loading of persistent objects during view rendering). Set this to "false" to have WebRequestInterceptors apply to the action phase as well (for example, in case of an "Open Session in View" interceptor, to allow for lazy loading outside of a transaction during the action phase).

See Also:
setInterceptors(java.lang.Object[]), WebRequestInterceptor, WebRequestHandlerInterceptorAdapter.WebRequestHandlerInterceptorAdapter(WebRequestInterceptor, boolean), OpenSessionInViewInterceptor

initApplicationContext

protected void initApplicationContext()
                               throws BeansException
Initializes the interceptors.

Overrides:
initApplicationContext in class ApplicationObjectSupport
Throws:
ApplicationContextException - in case of initialization errors
BeansException - if thrown by ApplicationContext methods
See Also:
extendInterceptors(java.util.List), initInterceptors()

extendInterceptors

protected void extendInterceptors(List interceptors)
Extension hook that subclasses can override to register additional interceptors, given the configured interceptors (see setInterceptors(java.lang.Object[])).

Will be invoked before initInterceptors() adapts the specified interceptors into HandlerInterceptor instances.

The default implementation is empty.

Parameters:
interceptors - the configured interceptor List (never null), allowing to add further interceptors before as well as after the existing interceptors

initInterceptors

protected void initInterceptors()
Initialize the specified interceptors, adapting them where necessary.

See Also:
setInterceptors(java.lang.Object[]), adaptInterceptor(java.lang.Object)

adaptInterceptor

protected HandlerInterceptor adaptInterceptor(Object interceptor)
Adapt the given interceptor object to the HandlerInterceptor interface.

Supported interceptor types are HandlerInterceptor and WebRequestInterceptor. Each given WebRequestInterceptor will be wrapped in a WebRequestHandlerInterceptorAdapter. Can be overridden in subclasses.

Parameters:
interceptor - the specified interceptor object
Returns:
the interceptor wrapped as HandlerInterceptor
See Also:
setApplyWebRequestInterceptorsToRenderPhaseOnly(boolean), HandlerInterceptor, WebRequestInterceptor, WebRequestHandlerInterceptorAdapter

getAdaptedInterceptors

protected final HandlerInterceptor[] getAdaptedInterceptors()
Return the adapted interceptors as HandlerInterceptor array.

Returns:
the array of HandlerInterceptors, or null if none

getHandler

public final HandlerExecutionChain getHandler(javax.portlet.PortletRequest request)
                                       throws Exception
Look up a handler for the given request, falling back to the default handler if no specific one is found.

Specified by:
getHandler in interface HandlerMapping
Parameters:
request - current portlet request
Returns:
the corresponding handler instance, or the default handler
Throws:
Exception - if there is an internal error
See Also:
getHandlerInternal(javax.portlet.PortletRequest)

getHandlerInternal

protected abstract Object getHandlerInternal(javax.portlet.PortletRequest request)
                                      throws Exception
Look up a handler for the given request, returning null if no specific one is found. This method is called by getHandler(javax.portlet.PortletRequest); a null return value will lead to the default handler, if one is set.

Note: This method may also return a pre-built HandlerExecutionChain, combining a handler object with dynamically determined interceptors. Statically specified interceptors will get merged into such an existing chain.

Parameters:
request - current portlet request
Returns:
the corresponding handler instance, or null if none found
Throws:
Exception - if there is an internal error
See Also:
getHandler(javax.portlet.PortletRequest)

getHandlerExecutionChain

protected HandlerExecutionChain getHandlerExecutionChain(Object handler,
                                                         javax.portlet.PortletRequest request)
Build a HandlerExecutionChain for the given handler, including applicable interceptors.

The default implementation simply builds a standard HandlerExecutionChain with the given handler and this handler mapping's common interceptors. Subclasses may override this in order to extend/rearrange the list of interceptors.

NOTE: The passed-in handler object may be a raw handler or a pre-built HandlerExecutionChain. This method should handle those two cases explicitly, either building a new HandlerExecutionChain or extending the existing chain.

For simply adding an interceptor, consider calling super.getHandlerExecutionChain and invoking HandlerExecutionChain.addInterceptor(org.springframework.web.portlet.HandlerInterceptor) on the returned chain object.

Parameters:
handler - the resolved handler instance (never null)
request - current HTTP request
Returns:
the HandlerExecutionChain (never null)
See Also:
getAdaptedInterceptors()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractMapBasedHandlerMapping

org.springframework.web.portlet.handler
Class AbstractMapBasedHandlerMapping<K>

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.portlet.handler.AbstractHandlerMapping
            extended by  org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping<K>
All Implemented Interfaces:
ApplicationContextAware, Ordered, HandlerMapping
Direct Known Subclasses:
DefaultAnnotationHandlerMapping, ParameterHandlerMapping, PortletModeHandlerMapping, PortletModeParameterHandlerMapping
public abstract class AbstractMapBasedHandlerMapping<K>
extends AbstractHandlerMapping

Abstract base class for HandlerMapping implementations that rely on a map which caches handler objects per lookup key. Supports arbitrary lookup keys, and automatically resolves handler bean names into handler bean instances.

Since:
2.0
Author:
Juergen Hoeller
See Also:
getLookupKey(javax.portlet.PortletRequest), registerHandler(Object, Object)

Nested Class Summary
protected static interface AbstractMapBasedHandlerMapping.PortletRequestMappingPredicate
Predicate interface for determining a match with a given request.
Field Summary
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AbstractMapBasedHandlerMapping()
Method Summary
protected Object | getHandlerInternal(javax.portlet.PortletRequest request) Determines a handler for the computed lookup key for the given request.
protected abstract K | getLookupKey(javax.portlet.PortletRequest request) Build a lookup key for the given request.
protected void | registerHandler(K lookupKey, Object handler) Register the given handler instance for the given parameter value.
protected void | registerHandler(K lookupKey, Object handler, AbstractMapBasedHandlerMapping.PortletRequestMappingPredicate predicate) Register the given handler instance for the given parameter value.
protected void | registerHandlers(Map<K,?> handlerMap) Register all handlers specified in the Portlet mode map for the corresponding modes.
void | setLazyInitHandlers(boolean lazyInitHandlers) Set whether to lazily initialize handlers.
Methods inherited from class org.springframework.web.portlet.handler.AbstractHandlerMapping
adaptInterceptor, extendInterceptors, getAdaptedInterceptors, getDefaultHandler, getHandler, getHandlerExecutionChain, getOrder, initApplicationContext, initInterceptors, setApplyWebRequestInterceptorsToRenderPhaseOnly, setDefaultHandler, setInterceptors, setOrder
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, isContextRequired, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractMapBasedHandlerMapping

public AbstractMapBasedHandlerMapping()
Method Detail

setLazyInitHandlers

public void setLazyInitHandlers(boolean lazyInitHandlers)
Set whether to lazily initialize handlers. Only applicable to singleton handlers, as prototypes are always lazily initialized. Default is false, as eager initialization allows for more efficiency through referencing the handler objects directly.

If you want to allow your handlers to be lazily initialized, make them "lazy-init" and set this flag to true. Just making them "lazy-init" will not work, as they are initialized through the references from the handler mapping in this case.

getHandlerInternal

protected Object getHandlerInternal(javax.portlet.PortletRequest request)
                             throws Exception
Determines a handler for the computed lookup key for the given request.

Specified by:
getHandlerInternal in class AbstractHandlerMapping
Parameters:
request - current portlet request
Returns:
the corresponding handler instance, or null if none found
Throws:
Exception - if there is an internal error
See Also:
getLookupKey(javax.portlet.PortletRequest)

getLookupKey

protected abstract K getLookupKey(javax.portlet.PortletRequest request)
                           throws Exception
Build a lookup key for the given request.

Parameters:
request - current portlet request
Returns:
the lookup key (never null)
Throws:
Exception - if key computation failed

registerHandlers

protected void registerHandlers(Map<K,?> handlerMap)
                         throws BeansException
Register all handlers specified in the Portlet mode map for the corresponding modes.

Parameters:
handlerMap - Map with lookup keys as keys and handler beans or bean names as values
Throws:
BeansException - if the handler couldn't be registered

registerHandler

protected void registerHandler(K lookupKey,
                               Object handler)
                        throws BeansException,
                               IllegalStateException
Register the given handler instance for the given parameter value.

Parameters:
lookupKey - the key to map the handler onto
handler - the handler instance or handler bean name String (a bean name will automatically be resolved into the corresponding handler bean)
Throws:
BeansException - if the handler couldn't be registered
IllegalStateException - if there is a conflicting handler registered

registerHandler

protected void registerHandler(K lookupKey,
                               Object handler,
                               AbstractMapBasedHandlerMapping.PortletRequestMappingPredicate predicate)
                        throws BeansException,
                               IllegalStateException
Register the given handler instance for the given parameter value.

Parameters:
lookupKey - the key to map the handler onto
handler - the handler instance or handler bean name String (a bean name will automatically be resolved into the corresponding handler bean)
predicate - a predicate object for this handler (may be null), determining a match with the primary lookup key
Throws:
BeansException - if the handler couldn't be registered
IllegalStateException - if there is a conflicting handler registered
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractMapBasedHandlerMapping.PortletRequestMappingPredicate

org.springframework.web.portlet.handler
Interface AbstractMapBasedHandlerMapping.PortletRequestMappingPredicate

All Superinterfaces:
Comparable
Enclosing class:
AbstractMapBasedHandlerMapping<K>
protected static interface AbstractMapBasedHandlerMapping.PortletRequestMappingPredicate
extends Comparable

Predicate interface for determining a match with a given request.

Method Summary
boolean | match(javax.portlet.PortletRequest request) Determine whether the given request matches this predicate.
void | validate(javax.portlet.PortletRequest request) Validate this predicate's mapping against the current request.
Methods inherited from interface java.lang.Comparable
compareTo

Method Detail

match

boolean match(javax.portlet.PortletRequest request)
Determine whether the given request matches this predicate.

Parameters:
request - current portlet request

validate

void validate(javax.portlet.PortletRequest request)
              throws javax.portlet.PortletException
Validate this predicate's mapping against the current request.

Parameters:
request - current portlet request
Throws:
javax.portlet.PortletException - if validation failed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HandlerInterceptorAdapter

org.springframework.web.portlet.handler
Class HandlerInterceptorAdapter

java.lang.Object
    extended by  org.springframework.web.portlet.handler.HandlerInterceptorAdapter
All Implemented Interfaces:
HandlerInterceptor
Direct Known Subclasses:
ParameterMappingInterceptor, UserRoleAuthorizationInterceptor
public abstract class HandlerInterceptorAdapter
extends Object
implements HandlerInterceptor

Abstract adapter class for the HandlerInterceptor interface, for simplified implementation of pre-only/post-only interceptors.

Since:
2.0
Author:
Juergen Hoeller, John A. Lewis

Constructor Summary
HandlerInterceptorAdapter()
Method Summary
 void afterActionCompletion(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response, Object handler, Exception ex)
This implementation delegates to afterCompletion(javax.portlet.PortletRequest, javax.portlet.PortletResponse, java.lang.Object, java.lang.Exception).
protected  void afterCompletion(javax.portlet.PortletRequest request, javax.portlet.PortletResponse response, Object handler, Exception ex)
Default callback that all "after*" methods delegate to.
 void afterEventCompletion(javax.portlet.EventRequest request, javax.portlet.EventResponse response, Object handler, Exception ex)
This implementation delegates to afterCompletion(javax.portlet.PortletRequest, javax.portlet.PortletResponse, java.lang.Object, java.lang.Exception).
 void afterRenderCompletion(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response, Object handler, Exception ex)
This implementation delegates to afterCompletion(javax.portlet.PortletRequest, javax.portlet.PortletResponse, java.lang.Object, java.lang.Exception).
 void afterResourceCompletion(javax.portlet.ResourceRequest request, javax.portlet.ResourceResponse response, Object handler, Exception ex)
This implementation delegates to afterCompletion(javax.portlet.PortletRequest, javax.portlet.PortletResponse, java.lang.Object, java.lang.Exception).
 void postHandleRender(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response, Object handler, ModelAndView modelAndView)
This implementation is empty.
 void postHandleResource(javax.portlet.ResourceRequest request, javax.portlet.ResourceResponse response, Object handler, ModelAndView modelAndView)
This implementation is empty.
protected  boolean preHandle(javax.portlet.PortletRequest request, javax.portlet.PortletResponse response, Object handler)
Default callback that all "pre*" methods delegate to.
 boolean preHandleAction(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response, Object handler)
This implementation delegates to preHandle(javax.portlet.PortletRequest, javax.portlet.PortletResponse, java.lang.Object).
 boolean preHandleEvent(javax.portlet.EventRequest request, javax.portlet.EventResponse response, Object handler)
This implementation delegates to preHandle(javax.portlet.PortletRequest, javax.portlet.PortletResponse, java.lang.Object).
 boolean preHandleRender(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response, Object handler)
This implementation delegates to preHandle(javax.portlet.PortletRequest, javax.portlet.PortletResponse, java.lang.Object).
 boolean preHandleResource(javax.portlet.ResourceRequest request, javax.portlet.ResourceResponse response, Object handler)
This implementation delegates to preHandle(javax.portlet.PortletRequest, javax.portlet.PortletResponse, java.lang.Object).
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

HandlerInterceptorAdapter

public HandlerInterceptorAdapter()
Method Detail

preHandleAction

public boolean preHandleAction(javax.portlet.ActionRequest request,
                               javax.portlet.ActionResponse response,
                               Object handler)
                        throws Exception
This implementation delegates to preHandle(javax.portlet.PortletRequest, javax.portlet.PortletResponse, java.lang.Object).

Specified by:
preHandleAction in interface HandlerInterceptor
Parameters:
request - current portlet action request
response - current portlet action response
handler - chosen handler to execute, for type and/or instance evaluation
Returns:
true if the execution chain should proceed with the next interceptor or the handler itself. Else, DispatcherPortlet assumes that this interceptor has already dealt with the response itself
Throws:
Exception - in case of errors

afterActionCompletion

public void afterActionCompletion(javax.portlet.ActionRequest request,
                                  javax.portlet.ActionResponse response,
                                  Object handler,
                                  Exception ex)
                           throws Exception
This implementation delegates to afterCompletion(javax.portlet.PortletRequest, javax.portlet.PortletResponse, java.lang.Object, java.lang.Exception).

Specified by:
afterActionCompletion in interface HandlerInterceptor
Parameters:
request - current portlet action request
response - current portlet action response
handler - chosen handler to execute, for type and/or instance examination
ex - exception thrown on handler execution, if any (only included as additional context information for the case where a handler threw an exception; request execution may have failed even when this argument is null)
Throws:
Exception - in case of errors

preHandleRender

public boolean preHandleRender(javax.portlet.RenderRequest request,
                               javax.portlet.RenderResponse response,
                               Object handler)
                        throws Exception
This implementation delegates to preHandle(javax.portlet.PortletRequest, javax.portlet.PortletResponse, java.lang.Object).

Specified by:
preHandleRender in interface HandlerInterceptor
Parameters:
request - current portlet render request
response - current portlet render response
handler - chosen handler to execute, for type and/or instance evaluation
Returns:
true if the execution chain should proceed with the next interceptor or the handler itself. Else, DispatcherPortlet assumes that this interceptor has already dealt with the response itself
Throws:
Exception - in case of errors

postHandleRender

public void postHandleRender(javax.portlet.RenderRequest request,
                             javax.portlet.RenderResponse response,
                             Object handler,
                             ModelAndView modelAndView)
                      throws Exception
This implementation is empty.

Specified by:
postHandleRender in interface HandlerInterceptor
Parameters:
request - current portlet render request
response - current portlet render response
handler - chosen handler to execute, for type and/or instance examination
modelAndView - the ModelAndView that the handler returned (can also be null)
Throws:
Exception - in case of errors

afterRenderCompletion

public void afterRenderCompletion(javax.portlet.RenderRequest request,
                                  javax.portlet.RenderResponse response,
                                  Object handler,
                                  Exception ex)
                           throws Exception
This implementation delegates to afterCompletion(javax.portlet.PortletRequest, javax.portlet.PortletResponse, java.lang.Object, java.lang.Exception).

Specified by:
afterRenderCompletion in interface HandlerInterceptor
Parameters:
request - current portlet render request
response - current portlet render response
handler - chosen handler to execute, for type and/or instance examination
ex - exception thrown on handler execution, if any
Throws:
Exception - in case of errors

preHandleResource

public boolean preHandleResource(javax.portlet.ResourceRequest request,
                                 javax.portlet.ResourceResponse response,
                                 Object handler)
                          throws Exception
This implementation delegates to preHandle(javax.portlet.PortletRequest, javax.portlet.PortletResponse, java.lang.Object).

Specified by:
preHandleResource in interface HandlerInterceptor
Parameters:
request - current portlet render request
response - current portlet render response
handler - chosen handler to execute, for type and/or instance evaluation
Returns:
true if the execution chain should proceed with the next interceptor or the handler itself. Else, DispatcherPortlet assumes that this interceptor has already dealt with the response itself
Throws:
Exception - in case of errors

postHandleResource

public void postHandleResource(javax.portlet.ResourceRequest request,
                               javax.portlet.ResourceResponse response,
                               Object handler,
                               ModelAndView modelAndView)
                        throws Exception
This implementation is empty.

Specified by:
postHandleResource in interface HandlerInterceptor
Parameters:
request - current portlet render request
response - current portlet render response
handler - chosen handler to execute, for type and/or instance examination
modelAndView - the ModelAndView that the handler returned (can also be null)
Throws:
Exception - in case of errors

afterResourceCompletion

public void afterResourceCompletion(javax.portlet.ResourceRequest request,
                                    javax.portlet.ResourceResponse response,
                                    Object handler,
                                    Exception ex)
                             throws Exception
This implementation delegates to afterCompletion(javax.portlet.PortletRequest, javax.portlet.PortletResponse, java.lang.Object, java.lang.Exception).

Specified by:
afterResourceCompletion in interface HandlerInterceptor
Parameters:
request - current portlet render request
response - current portlet render response
handler - chosen handler to execute, for type and/or instance examination
ex - exception thrown on handler execution, if any
Throws:
Exception - in case of errors

preHandleEvent

public boolean preHandleEvent(javax.portlet.EventRequest request,
                              javax.portlet.EventResponse response,
                              Object handler)
                       throws Exception
This implementation delegates to preHandle(javax.portlet.PortletRequest, javax.portlet.PortletResponse, java.lang.Object).

Specified by:
preHandleEvent in interface HandlerInterceptor
Parameters:
request - current portlet action request
response - current portlet action response
handler - chosen handler to execute, for type and/or instance evaluation
Returns:
true if the execution chain should proceed with the next interceptor or the handler itself. Else, DispatcherPortlet assumes that this interceptor has already dealt with the response itself
Throws:
Exception - in case of errors

afterEventCompletion

public void afterEventCompletion(javax.portlet.EventRequest request,
                                 javax.portlet.EventResponse response,
                                 Object handler,
                                 Exception ex)
                          throws Exception
This implementation delegates to afterCompletion(javax.portlet.PortletRequest, javax.portlet.PortletResponse, java.lang.Object, java.lang.Exception).

Specified by:
afterEventCompletion in interface HandlerInterceptor
Parameters:
request - current portlet action request
response - current portlet action response
handler - chosen handler to execute, for type and/or instance examination
ex - exception thrown on handler execution, if any (only included as additional context information for the case where a handler threw an exception; request execution may have failed even when this argument is null)
Throws:
Exception - in case of errors

preHandle

protected boolean preHandle(javax.portlet.PortletRequest request,
                            javax.portlet.PortletResponse response,
                            Object handler)
                     throws Exception
Default callback that all "pre*" methods delegate to.

This implementation always returns true.

Throws:
Exception

afterCompletion

protected void afterCompletion(javax.portlet.PortletRequest request,
                               javax.portlet.PortletResponse response,
                               Object handler,
                               Exception ex)
                        throws Exception
Default callback that all "after*" methods delegate to.

This implementation is empty.

Throws:
Exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ParameterHandlerMapping

org.springframework.web.portlet.handler
Class ParameterHandlerMapping

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.portlet.handler.AbstractHandlerMapping
            extended by  org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping<String>
                extended by  org.springframework.web.portlet.handler.ParameterHandlerMapping
All Implemented Interfaces:
ApplicationContextAware, Ordered, HandlerMapping
public class ParameterHandlerMapping
extends AbstractMapBasedHandlerMapping<String>

Implementation of the HandlerMapping to map from a request parameter to request handler beans.

The default name of the parameter is "action", but can be changed using setParameterName().

The bean configuration for this mapping will look somthing like this:

 <bean id="parameterHandlerMapping" class="org.springframework.web.portlet.handler.ParameterHandlerMapping">
   <property name="parameterMap">
     <map>
             <entry key="add"><ref bean="addItemHandler"/></entry>
       <entry key="edit"><ref bean="editItemHandler"/></entry>
       <entry key="delete"><ref bean="deleteItemHandler"/></entry>
     </map>
   </property>
 </bean>
Thanks to Rainer Schmitz for suggesting this mapping strategy!

Since:
2.0
Author:
John A. Lewis, Juergen Hoeller
See Also:
ParameterMappingInterceptor

Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping
AbstractMapBasedHandlerMapping.PortletRequestMappingPredicate
Field Summary
static String DEFAULT_PARAMETER_NAME
Default request parameter name to use for mapping to handlers: "action".
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
ParameterHandlerMapping()
Method Summary
protected String | getLookupKey(javax.portlet.PortletRequest request) Uses the value of the specified parameter as lookup key.
void | initApplicationContext() Calls the registerHandlers method in addition to the superclass's initialization.
void | setParameterMap(Map<String,?> parameterMap) Set a Map with parameters as keys and handler beans or bean names as values.
void | setParameterName(String parameterName) Set the name of the parameter used for mapping to handlers.
Methods inherited from class org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping
getHandlerInternal, registerHandler, registerHandler, registerHandlers, setLazyInitHandlers
Methods inherited from class org.springframework.web.portlet.handler.AbstractHandlerMapping
adaptInterceptor, extendInterceptors, getAdaptedInterceptors, getDefaultHandler, getHandler, getHandlerExecutionChain, getOrder, initInterceptors, setApplyWebRequestInterceptorsToRenderPhaseOnly, setDefaultHandler, setInterceptors, setOrder
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, isContextRequired, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_PARAMETER_NAME

public static final String DEFAULT_PARAMETER_NAME
Default request parameter name to use for mapping to handlers: "action".

See Also:
Constant Field Values
Constructor Detail

ParameterHandlerMapping

public ParameterHandlerMapping()
Method Detail

setParameterName

public void setParameterName(String parameterName)
Set the name of the parameter used for mapping to handlers.

Default is "action".

setParameterMap

public void setParameterMap(Map<String,?> parameterMap)
Set a Map with parameters as keys and handler beans or bean names as values. Convenient for population with bean references.

Parameters:
parameterMap - map with parameters as keys and beans as values

initApplicationContext

public void initApplicationContext()
                            throws BeansException
Calls the registerHandlers method in addition to the superclass's initialization.

Overrides:
initApplicationContext in class AbstractHandlerMapping
Throws:
ApplicationContextException - in case of initialization errors
BeansException - if thrown by ApplicationContext methods
See Also:
AbstractMapBasedHandlerMapping.registerHandlers(java.util.Map)

getLookupKey

protected String getLookupKey(javax.portlet.PortletRequest request)
                       throws Exception
Uses the value of the specified parameter as lookup key.

Specified by:
getLookupKey in class AbstractMapBasedHandlerMapping<String>
Parameters:
request - current portlet request
Returns:
the lookup key (never null)
Throws:
Exception - if key computation failed
See Also:
setParameterName(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ParameterMappingInterceptor

org.springframework.web.portlet.handler
Class ParameterMappingInterceptor

java.lang.Object
    extended by  org.springframework.web.portlet.handler.HandlerInterceptorAdapter
        extended by  org.springframework.web.portlet.handler.ParameterMappingInterceptor
All Implemented Interfaces:
HandlerInterceptor
public class ParameterMappingInterceptor
extends HandlerInterceptorAdapter

Interceptor to forward a request parameter from the ActionRequest to the RenderRequest.

This can be useful when using ParameterHandlerMapping or PortletModeParameterHandlerMapping. It will ensure that the parameter that was used to map the ActionRequest to a handler will be forwarded to the RenderRequest so that it will also be mapped the same way.

When using this Interceptor, you can still change the value of the mapping parameter in your handler in order to change where the render request will get mapped.

Be aware that this Interceptor does call ActionResponse.setRenderParameter, which means that you will not be able to call ActionResponse.sendRedirect in your handler. If you may need to issue a redirect, then you should avoid this Interceptor and either write a different one that does this in a different way, or manually forward the parameter from within your handler(s).

Thanks to Rainer Schmitz for suggesting this mapping strategy!

Since:
2.0
Author:
John A. Lewis
See Also:
ParameterHandlerMapping, PortletModeParameterHandlerMapping

Field Summary
static String DEFAULT_PARAMETER_NAME
Request parameter name to use for mapping to handlers
Constructor Summary
ParameterMappingInterceptor()
Method Summary
boolean | preHandleAction(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response, Object handler) If request is an ActionRequest, get handler mapping parameter and add it to the ActionResponse.
void | setParameterName(String parameterName) Set the name of the parameter used for mapping.
Methods inherited from class org.springframework.web.portlet.handler.HandlerInterceptorAdapter
afterActionCompletion, afterCompletion, afterEventCompletion, afterRenderCompletion, afterResourceCompletion, postHandleRender, postHandleResource, preHandle, preHandleEvent, preHandleRender, preHandleResource
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_PARAMETER_NAME

public static final String DEFAULT_PARAMETER_NAME
Request parameter name to use for mapping to handlers

See Also:
Constant Field Values
Constructor Detail

ParameterMappingInterceptor

public ParameterMappingInterceptor()
Method Detail

setParameterName

public void setParameterName(String parameterName)
Set the name of the parameter used for mapping.

preHandleAction

public boolean preHandleAction(javax.portlet.ActionRequest request,
                               javax.portlet.ActionResponse response,
                               Object handler)
If request is an ActionRequest, get handler mapping parameter and add it to the ActionResponse.

Specified by:
preHandleAction in interface HandlerInterceptor
Overrides:
preHandleAction in class HandlerInterceptorAdapter
Parameters:
request - current portlet action request
response - current portlet action response
handler - chosen handler to execute, for type and/or instance evaluation
Returns:
true if the execution chain should proceed with the next interceptor or the handler itself. Else, DispatcherPortlet assumes that this interceptor has already dealt with the response itself
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PortletContentGenerator

org.springframework.web.portlet.handler
Class PortletContentGenerator

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.portlet.context.PortletApplicationObjectSupport
            extended by  org.springframework.web.portlet.handler.PortletContentGenerator
All Implemented Interfaces:
ApplicationContextAware, PortletContextAware
Direct Known Subclasses:
AbstractController, AnnotationMethodHandlerAdapter
public abstract class PortletContentGenerator
extends PortletApplicationObjectSupport

Convenient superclass for any kind of web content generator, like AbstractController. Can also be used for custom handlers that have their own HandlerAdapter.

Supports portlet cache control options.

Since:
2.0
Author:
Juergen Hoeller, John A. Lewis
See Also:
setCacheSeconds(int), setRequireSession(boolean)

Field Summary
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Constructor Summary
PortletContentGenerator()
Method Summary
protected void | applyCacheSeconds(javax.portlet.MimeResponse response, int seconds) Apply the given cache seconds to the render response
protected void | cacheForSeconds(javax.portlet.MimeResponse response, int seconds) Set portlet response to allow caching for the given number of seconds.
protected void | check(javax.portlet.PortletRequest request, javax.portlet.PortletResponse response) Check and prepare the given request and response according to the settings of this generator.
protected void | checkAndPrepare(javax.portlet.PortletRequest request, javax.portlet.MimeResponse response) Check and prepare the given request and response according to the settings of this generator.
protected void | checkAndPrepare(javax.portlet.PortletRequest request, javax.portlet.MimeResponse response, int cacheSeconds) Check and prepare the given request and response according to the settings of this generator.
int | getCacheSeconds() Return the number of seconds that content is cached.
boolean | isRequireSession() Return whether a session is required to handle requests.
protected void | preventCaching(javax.portlet.MimeResponse response) Prevent the render response from being cached.
void | setCacheSeconds(int seconds) Cache content for the given number of seconds.
void | setRequireSession(boolean requireSession) Set whether a session should be required to handle requests.
Methods inherited from class org.springframework.web.portlet.context.PortletApplicationObjectSupport
getPortletContext, getTempDir, isContextRequired, setPortletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PortletContentGenerator

public PortletContentGenerator()
Method Detail

setRequireSession

public final void setRequireSession(boolean requireSession)
Set whether a session should be required to handle requests.

isRequireSession

public final boolean isRequireSession()
Return whether a session is required to handle requests.

setCacheSeconds

public final void setCacheSeconds(int seconds)
Cache content for the given number of seconds. Default is -1, indicating no override of portlet content caching.

Only if this is set to 0 (no cache) or a positive value (cache for this many seconds) will this class override the portlet settings.

The cache setting can be overwritten by subclasses, before content is generated.

getCacheSeconds

public final int getCacheSeconds()
Return the number of seconds that content is cached.

check

protected final void check(javax.portlet.PortletRequest request,
                           javax.portlet.PortletResponse response)
                    throws javax.portlet.PortletException
Check and prepare the given request and response according to the settings of this generator. Checks for a required session, and applies the number of cache seconds configured for this generator (if it is a render request/response).

Parameters:
request - current portlet request
response - current portlet response
Throws:
javax.portlet.PortletException - if the request cannot be handled because a check failed

checkAndPrepare

protected final void checkAndPrepare(javax.portlet.PortletRequest request,
                                     javax.portlet.MimeResponse response)
                              throws javax.portlet.PortletException
Check and prepare the given request and response according to the settings of this generator. Checks for a required session, and applies the number of cache seconds configured for this generator (if it is a render request/response).

Parameters:
request - current portlet request
response - current portlet response
Throws:
javax.portlet.PortletException - if the request cannot be handled because a check failed

checkAndPrepare

protected final void checkAndPrepare(javax.portlet.PortletRequest request,
                                     javax.portlet.MimeResponse response,
                                     int cacheSeconds)
                              throws javax.portlet.PortletException
Check and prepare the given request and response according to the settings of this generator. Checks for a required session, and applies the given number of cache seconds (if it is a render request/response).

Parameters:
request - current portlet request
response - current portlet response
cacheSeconds - positive number of seconds into the future that the response should be cacheable for, 0 to prevent caching
Throws:
javax.portlet.PortletException - if the request cannot be handled because a check failed

preventCaching

protected final void preventCaching(javax.portlet.MimeResponse response)
Prevent the render response from being cached.

cacheForSeconds

protected final void cacheForSeconds(javax.portlet.MimeResponse response,
                                     int seconds)
Set portlet response to allow caching for the given number of seconds.

Parameters:
response - current portlet render response
seconds - number of seconds into the future that the response should be cacheable for

applyCacheSeconds

protected final void applyCacheSeconds(javax.portlet.MimeResponse response,
                                       int seconds)
Apply the given cache seconds to the render response

Parameters:
response - current portlet render response
seconds - positive number of seconds into the future that the response should be cacheable for, 0 to prevent caching
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PortletModeHandlerMapping

org.springframework.web.portlet.handler
Class PortletModeHandlerMapping

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.portlet.handler.AbstractHandlerMapping
            extended by  org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping<javax.portlet.PortletMode>
                extended by  org.springframework.web.portlet.handler.PortletModeHandlerMapping
All Implemented Interfaces:
ApplicationContextAware, Ordered, HandlerMapping
public class PortletModeHandlerMapping
extends AbstractMapBasedHandlerMapping<javax.portlet.PortletMode>

Implementation of the HandlerMapping interface to map from the current PortletMode to request handler beans.

The bean configuration for this mapping will look something like this:

        <bean id="portletModeHandlerMapping" class="org.springframework.web.portlet.handler.PortletModeHandlerMapping">
                <property name="portletModeMap">
                        <map>
                                <entry key="view"><ref bean="viewHandler"/></entry>
                                <entry key="edit"><ref bean="editHandler"/></entry>
                                <entry key="help"><ref bean="helpHandler"/></entry>
                        </map>
                </property>
        </bean>

Since:
2.0
Author:
William G. Thompson, Jr., John A. Lewis

Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping
AbstractMapBasedHandlerMapping.PortletRequestMappingPredicate
Field Summary
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
PortletModeHandlerMapping()
Method Summary
protected javax.portlet.PortletMode | getLookupKey(javax.portlet.PortletRequest request) Uses the current PortletMode as lookup key.
void | initApplicationContext() Calls the registerHandlers method in addition to the superclass's initialization.
protected void | registerHandlersByMode(Map<String,Object> portletModeMap) Register all handlers specified in the Portlet mode map for the corresponding modes.
void | setMappings(Properties mappings) Set PortletMode to handler bean name mappings from a Properties object.
void | setPortletModeMap(Map<String,?> portletModeMap) Set a Map with PortletModes as keys and handler beans as values.
Methods inherited from class org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping
getHandlerInternal, registerHandler, registerHandler, registerHandlers, setLazyInitHandlers
Methods inherited from class org.springframework.web.portlet.handler.AbstractHandlerMapping
adaptInterceptor, extendInterceptors, getAdaptedInterceptors, getDefaultHandler, getHandler, getHandlerExecutionChain, getOrder, initInterceptors, setApplyWebRequestInterceptorsToRenderPhaseOnly, setDefaultHandler, setInterceptors, setOrder
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, isContextRequired, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PortletModeHandlerMapping

public PortletModeHandlerMapping()
Method Detail

setMappings

public void setMappings(Properties mappings)
Set PortletMode to handler bean name mappings from a Properties object.

Parameters:
mappings - properties with PortletMode names as keys and bean names as values

setPortletModeMap

public void setPortletModeMap(Map<String,?> portletModeMap)
Set a Map with PortletModes as keys and handler beans as values. Convenient for population with bean references.

Parameters:
portletModeMap - map with PortletMode names as keys and beans or bean names as values

initApplicationContext

public void initApplicationContext()
                            throws BeansException
Calls the registerHandlers method in addition to the superclass's initialization.

Overrides:
initApplicationContext in class AbstractHandlerMapping
Throws:
ApplicationContextException - in case of initialization errors
BeansException - if thrown by ApplicationContext methods
See Also:
AbstractMapBasedHandlerMapping.registerHandlers(java.util.Map)

registerHandlersByMode

protected void registerHandlersByMode(Map<String,Object> portletModeMap)
Register all handlers specified in the Portlet mode map for the corresponding modes.

Parameters:
portletModeMap - Map with mode names as keys and handler beans or bean names as values

getLookupKey

protected javax.portlet.PortletMode getLookupKey(javax.portlet.PortletRequest request)
                                          throws Exception
Uses the current PortletMode as lookup key.

Specified by:
getLookupKey in class AbstractMapBasedHandlerMapping<javax.portlet.PortletMode>
Parameters:
request - current portlet request
Returns:
the lookup key (never null)
Throws:
Exception - if key computation failed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PortletModeParameterHandlerMapping

org.springframework.web.portlet.handler
Class PortletModeParameterHandlerMapping

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.portlet.handler.AbstractHandlerMapping
            extended by  org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping<org.springframework.web.portlet.handler.PortletModeParameterLookupKey>
                extended by  org.springframework.web.portlet.handler.PortletModeParameterHandlerMapping
All Implemented Interfaces:
ApplicationContextAware, Ordered, HandlerMapping
public class PortletModeParameterHandlerMapping
extends AbstractMapBasedHandlerMapping<org.springframework.web.portlet.handler.PortletModeParameterLookupKey>

Implementation of the HandlerMapping interface to map from the current PortletMode and a request parameter to request handler beans. The mapping consists of two levels: first the PortletMode and then the parameter value. In order to be mapped, both elements must match the mapping definition.

This is a combination of the methods used in PortletModeHandlerMapping and ParameterHandlerMapping. Unlike those two classes, this mapping cannot be initialized with properties since it requires a two-level map.

The default name of the parameter is "action", but can be changed using setParameterName().

By default, the same parameter value may not be used in two different portlet modes. This is so that if the portal itself changes the portlet mode, the request will no longer be valid in the mapping. This behavior can be changed with setAllowDupParameters().

The bean configuration for this mapping will look somthing like this:

 <bean id="portletModeParameterHandlerMapping" class="org.springframework.web.portlet.handler.PortletModeParameterHandlerMapping">
   <property name="portletModeParameterMap">
     <map>
       <entry key="view"> <!-- portlet mode: view -->
         <map>
           <entry key="add"><ref bean="addItemHandler"/></entry>
           <entry key="edit"><ref bean="editItemHandler"/></entry>
           <entry key="delete"><ref bean="deleteItemHandler"/></entry>
         </map>
       </entry>
       <entry key="edit"> <!-- portlet mode: edit -->
         <map>
           <entry key="prefs"><ref bean="preferencesHandler"/></entry>
           <entry key="resetPrefs"><ref bean="resetPreferencesHandler"/></entry>
         </map>
       </entry>
     </map>
   </property>
 </bean>

This mapping can be chained ahead of a PortletModeHandlerMapping, which can then provide defaults for each mode and an overall default as well.

Thanks to Rainer Schmitz and Yujin Kim for suggesting this mapping strategy!

Since:
2.0
Author:
John A. Lewis, Juergen Hoeller
See Also:
ParameterMappingInterceptor

Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping
AbstractMapBasedHandlerMapping.PortletRequestMappingPredicate
Field Summary
static String DEFAULT_PARAMETER_NAME
Default request parameter name to use for mapping to handlers: "action".
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
PortletModeParameterHandlerMapping()
Method Summary
protected org.springframework.web.portlet.handler.PortletModeParameterLookupKey | getLookupKey(javax.portlet.PortletRequest request) Returns a lookup key that combines the current PortletMode and the current value of the specified parameter.
void | initApplicationContext() Calls the registerHandlers method in addition to the superclass's initialization.
protected void | registerHandler(javax.portlet.PortletMode mode, Map<String,?> parameterMap) Register all handlers specified in the given parameter map.
protected void | registerHandler(javax.portlet.PortletMode mode, String parameter, Object handler) Register the given handler instance for the given PortletMode and parameter value, under an appropriate lookup key.
protected void | registerHandlersByModeAndParameter(Map<String,Map<String,?>> portletModeParameterMap) Register all handlers specified in the Portlet mode map for the corresponding modes.
void | setAllowDuplicateParameters(boolean allowDuplicateParameters) Set whether to allow duplicate parameter values across different portlet modes.
void | setParameterName(String parameterName) Set the name of the parameter used for mapping to handlers.
void | setPortletModeParameterMap(Map<String,Map<String,?>> portletModeParameterMap) Set a Map with portlet mode names as keys and another Map as values.
Methods inherited from class org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping
getHandlerInternal, registerHandler, registerHandler, registerHandlers, setLazyInitHandlers
Methods inherited from class org.springframework.web.portlet.handler.AbstractHandlerMapping
adaptInterceptor, extendInterceptors, getAdaptedInterceptors, getDefaultHandler, getHandler, getHandlerExecutionChain, getOrder, initInterceptors, setApplyWebRequestInterceptorsToRenderPhaseOnly, setDefaultHandler, setInterceptors, setOrder
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, isContextRequired, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_PARAMETER_NAME

public static final String DEFAULT_PARAMETER_NAME
Default request parameter name to use for mapping to handlers: "action".

See Also:
Constant Field Values
Constructor Detail

PortletModeParameterHandlerMapping

public PortletModeParameterHandlerMapping()
Method Detail

setParameterName

public void setParameterName(String parameterName)
Set the name of the parameter used for mapping to handlers.

Default is "action".

setPortletModeParameterMap

public void setPortletModeParameterMap(Map<String,Map<String,?>> portletModeParameterMap)
Set a Map with portlet mode names as keys and another Map as values. The sub-map has parameter names as keys and handler bean or bean names as values.

Convenient for population with bean references.

Parameters:
portletModeParameterMap - two-level map of portlet modes and parameters to handler beans

setAllowDuplicateParameters

public void setAllowDuplicateParameters(boolean allowDuplicateParameters)
Set whether to allow duplicate parameter values across different portlet modes. Default is "false".

Doing this is dangerous because the portlet mode can be changed by the portal itself and the only way to see that is a rerender of the portlet. If the same parameter value is legal in multiple modes, then a change in mode could result in a matched mapping that is not intended and the user could end up in a strange place in the application.

initApplicationContext

public void initApplicationContext()
                            throws BeansException
Calls the registerHandlers method in addition to the superclass's initialization.

Overrides:
initApplicationContext in class AbstractHandlerMapping
Throws:
ApplicationContextException - in case of initialization errors
BeansException - if thrown by ApplicationContext methods
See Also:
AbstractMapBasedHandlerMapping.registerHandlers(java.util.Map)

registerHandlersByModeAndParameter

protected void registerHandlersByModeAndParameter(Map<String,Map<String,?>> portletModeParameterMap)
Register all handlers specified in the Portlet mode map for the corresponding modes.

Parameters:
portletModeParameterMap - Map with mode names as keys and parameter Maps as values

registerHandler

protected void registerHandler(javax.portlet.PortletMode mode,
                               Map<String,?> parameterMap)
Register all handlers specified in the given parameter map.

Parameters:
parameterMap - Map with parameter names as keys and handler beans or bean names as values

registerHandler

protected void registerHandler(javax.portlet.PortletMode mode,
                               String parameter,
                               Object handler)
                        throws BeansException,
                               IllegalStateException
Register the given handler instance for the given PortletMode and parameter value, under an appropriate lookup key.

Parameters:
mode - the PortletMode for which this mapping is valid
parameter - the parameter value to which this handler is mapped
handler - the handler instance bean
Throws:
BeansException - if the handler couldn't be registered
IllegalStateException - if there is a conflicting handler registered
See Also:
AbstractMapBasedHandlerMapping.registerHandler(Object, Object)

getLookupKey

protected org.springframework.web.portlet.handler.PortletModeParameterLookupKey getLookupKey(javax.portlet.PortletRequest request)
                                                                                throws Exception
Returns a lookup key that combines the current PortletMode and the current value of the specified parameter.

Specified by:
getLookupKey in class AbstractMapBasedHandlerMapping<org.springframework.web.portlet.handler.PortletModeParameterLookupKey>
Parameters:
request - current portlet request
Returns:
the lookup key (never null)
Throws:
Exception - if key computation failed
See Also:
PortletRequest.getPortletMode(), setParameterName(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleMappingExceptionResolver

org.springframework.web.portlet.handler
Class SimpleMappingExceptionResolver

java.lang.Object
    extended by  org.springframework.web.portlet.handler.AbstractHandlerExceptionResolver
        extended by  org.springframework.web.portlet.handler.SimpleMappingExceptionResolver
All Implemented Interfaces:
Ordered, HandlerExceptionResolver
public class SimpleMappingExceptionResolver
extends AbstractHandlerExceptionResolver

HandlerExceptionResolver implementation that allows for mapping exception class names to view names, either for a set of given handlers or for all handlers in the DispatcherPortlet.

Error views are analogous to error page JSPs, but can be used with any kind of exception including any checked one, with fine-granular mappings for specific handlers.

Since:
2.0
Author:
Juergen Hoeller, John A. Lewis, Arjen Poutsma

Field Summary
static String DEFAULT_EXCEPTION_ATTRIBUTE
The default name of the exception attribute: "exception".
Fields inherited from class org.springframework.web.portlet.handler.AbstractHandlerExceptionResolver
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
SimpleMappingExceptionResolver()
Method Summary
protected String | determineViewName(Exception ex, javax.portlet.PortletRequest request) Determine the view name for the given exception, searching the "exceptionMappings", using the "defaultErrorView" as fallback.
protected ModelAndView | doResolveException(javax.portlet.PortletRequest request, javax.portlet.MimeResponse response, Object handler, Exception ex) Actually resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.
protected String | findMatchingViewName(Properties exceptionMappings, Exception ex) Find a matching view name in the given exception mappings
protected int | getDepth(String exceptionMapping, Exception ex) Return the depth to the superclass matching.
protected ModelAndView | getModelAndView(String viewName, Exception ex) Return a ModelAndView for the given view name and exception.
protected ModelAndView | getModelAndView(String viewName, Exception ex, javax.portlet.PortletRequest request) Return a ModelAndView for the given request, view name and exception.
void | setDefaultErrorView(String defaultErrorView) Set the name of the default error view.
void | setExceptionAttribute(String exceptionAttribute) Set the name of the model attribute as which the exception should be exposed.
void | setExceptionMappings(Properties mappings) Set the mappings between exception class names and error view names.
Methods inherited from class org.springframework.web.portlet.handler.AbstractHandlerExceptionResolver
buildLogMessage, getOrder, logException, resolveException, resolveException, setMappedHandlerClasses, setMappedHandlers, setOrder, setRenderWhenMinimized, setWarnLogCategory, shouldApplyTo
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_EXCEPTION_ATTRIBUTE

public static final String DEFAULT_EXCEPTION_ATTRIBUTE
The default name of the exception attribute: "exception".

See Also:
Constant Field Values
Constructor Detail

SimpleMappingExceptionResolver

public SimpleMappingExceptionResolver()
Method Detail

setExceptionMappings

public void setExceptionMappings(Properties mappings)
Set the mappings between exception class names and error view names. The exception class name can be a substring, with no wildcard support at present. A value of "PortletException" would match javax.portet.PortletException and subclasses, for example.

NB: Consider carefully how specific the pattern is, and whether to include package information (which isn't mandatory). For example, "Exception" will match nearly anything, and will probably hide other rules. "java.lang.Exception" would be correct if "Exception" was meant to define a rule for all checked exceptions. With more unusual exception names such as "BaseBusinessException" there's no need to use a FQN.

Follows the same matching algorithm as RuleBasedTransactionAttribute and RollbackRuleAttribute.

Parameters:
mappings - exception patterns (can also be fully qualified class names) as keys, and error view names as values
See Also:
RuleBasedTransactionAttribute, RollbackRuleAttribute

setDefaultErrorView

public void setDefaultErrorView(String defaultErrorView)
Set the name of the default error view. This view will be returned if no specific mapping was found.

Default is none.

setExceptionAttribute

public void setExceptionAttribute(String exceptionAttribute)
Set the name of the model attribute as which the exception should be exposed. Default is "exception".

See Also:
DEFAULT_EXCEPTION_ATTRIBUTE

doResolveException

protected ModelAndView doResolveException(javax.portlet.PortletRequest request,
                                          javax.portlet.MimeResponse response,
                                          Object handler,
                                          Exception ex)
Actually resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.

Specified by:
doResolveException in class AbstractHandlerExceptionResolver
Parameters:
request - current portlet request
response - current portlet response
handler - the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
ex - the exception that got thrown during handler execution
Returns:
a corresponding ModelAndView to forward to, or null for default processing

determineViewName

protected String determineViewName(Exception ex,
                                   javax.portlet.PortletRequest request)
Determine the view name for the given exception, searching the "exceptionMappings", using the "defaultErrorView" as fallback.

Parameters:
ex - the exception that got thrown during handler execution
request - current portlet request (useful for obtaining metadata)
Returns:
the resolved view name, or null if none found

findMatchingViewName

protected String findMatchingViewName(Properties exceptionMappings,
                                      Exception ex)
Find a matching view name in the given exception mappings

Parameters:
exceptionMappings - mappings between exception class names and error view names
ex - the exception that got thrown during handler execution
Returns:
the view name, or null if none found
See Also:
setExceptionMappings(java.util.Properties)

getDepth

protected int getDepth(String exceptionMapping,
                       Exception ex)
Return the depth to the superclass matching.

0 means ex matches exactly. Returns -1 if there's no match. Otherwise, returns depth. Lowest depth wins.

Follows the same algorithm as RollbackRuleAttribute.

getModelAndView

protected ModelAndView getModelAndView(String viewName,
                                       Exception ex,
                                       javax.portlet.PortletRequest request)
Return a ModelAndView for the given request, view name and exception. Default implementation delegates to getModelAndView(viewName, ex).

Parameters:
viewName - the name of the error view
ex - the exception that got thrown during handler execution
request - current portlet request (useful for obtaining metadata)
Returns:
the ModelAndView instance
See Also:
getModelAndView(String, Exception)

getModelAndView

protected ModelAndView getModelAndView(String viewName,
                                       Exception ex)
Return a ModelAndView for the given view name and exception. Default implementation adds the specified exception attribute. Can be overridden in subclasses.

Parameters:
viewName - the name of the error view
ex - the exception that got thrown during handler execution
Returns:
the ModelAndView instance
See Also:
setExceptionAttribute(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimplePortletHandlerAdapter

org.springframework.web.portlet.handler
Class SimplePortletHandlerAdapter

java.lang.Object
    extended by  org.springframework.web.portlet.handler.SimplePortletHandlerAdapter
All Implemented Interfaces:
PortletContextAware, HandlerAdapter
public class SimplePortletHandlerAdapter
extends Object
implements HandlerAdapter, PortletContextAware

Adapter to use the Portlet interface with the generic DispatcherPortlet. Calls the Portlet's render and processAction methods to handle a request.

This adapter is not activated by default; it needs to be defined as a bean in the DispatcherPortlet context. It will automatically apply to mapped handler beans that implement the Portlet interface then.

Note that Portlet instances defined as bean will not receive initialization and destruction callbacks, unless a special post-processor such as SimplePortletPostProcessor is defined in the DispatcherPortlet context.

Alternatively, consider wrapping a Portlet with Spring's PortletWrappingController. This is particularly appropriate for existing Portlet classes, allowing to specify Portlet initialization parameters, etc.

Since:
2.0
Author:
John A. Lewis
See Also:
Portlet, SimplePortletPostProcessor, PortletWrappingController

Constructor Summary
SimplePortletHandlerAdapter()
Method Summary
void | handleAction(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response, Object handler) Use the given handler to handle this action request.
void | handleEvent(javax.portlet.EventRequest request, javax.portlet.EventResponse response, Object handler) Use the given handler to handle this event request.
ModelAndView | handleRender(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response, Object handler) Use the given handler to handle this render request.
ModelAndView | handleResource(javax.portlet.ResourceRequest request, javax.portlet.ResourceResponse response, Object handler) Use the given handler to handle this resource request.
void | setPortletContext(javax.portlet.PortletContext portletContext) Set the PortletContext that this object runs in.
boolean | supports(Object handler) Given a handler instance, return whether or not this HandlerAdapter can support it.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimplePortletHandlerAdapter

public SimplePortletHandlerAdapter()
Method Detail

setPortletContext

public void setPortletContext(javax.portlet.PortletContext portletContext)
Description copied from interface: PortletContextAware
Set the PortletContext that this object runs in.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked after ApplicationContextAware's setApplicationContext.

Specified by:
setPortletContext in interface PortletContextAware
Parameters:
portletContext - PortletContext object to be used by this object

supports

public boolean supports(Object handler)
Description copied from interface: HandlerAdapter
Given a handler instance, return whether or not this HandlerAdapter can support it. Typical HandlerAdapters will base the decision on the handler type. HandlerAdapters will usually only support one handler type each.

A typical implementation:

return (handler instanceof MyHandler);

Specified by:
supports in interface HandlerAdapter
Parameters:
handler - handler object to check
Returns:
whether or not this object can use the given handler

handleAction

public void handleAction(javax.portlet.ActionRequest request,
                         javax.portlet.ActionResponse response,
                         Object handler)
                  throws Exception
Description copied from interface: HandlerAdapter
Use the given handler to handle this action request. The workflow that is required may vary widely.

Specified by:
handleAction in interface HandlerAdapter
Parameters:
request - current action request
response - current action response
handler - handler to use. This object must have previously been passed to the supports method of this interface, which must have returned true.
Throws:
Exception - in case of errors
See Also:
Portlet.processAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse)

handleRender

public ModelAndView handleRender(javax.portlet.RenderRequest request,
                                 javax.portlet.RenderResponse response,
                                 Object handler)
                          throws Exception
Description copied from interface: HandlerAdapter
Use the given handler to handle this render request. The workflow that is required may vary widely.

Specified by:
handleRender in interface HandlerAdapter
Parameters:
request - current render request
response - current render response
handler - handler to use. This object must have previously been passed to the supports method of this interface, which must have returned true.
Returns:
ModelAndView object with the name of the view and the required model data, or null if the request has been handled directly
Throws:
Exception - in case of errors
See Also:
Portlet.render(javax.portlet.RenderRequest, javax.portlet.RenderResponse)

handleResource

public ModelAndView handleResource(javax.portlet.ResourceRequest request,
                                   javax.portlet.ResourceResponse response,
                                   Object handler)
                            throws Exception
Description copied from interface: HandlerAdapter
Use the given handler to handle this resource request. The workflow that is required may vary widely.

Specified by:
handleResource in interface HandlerAdapter
Parameters:
request - current render request
response - current render response
handler - handler to use. This object must have previously been passed to the supports method of this interface, which must have returned true.
Returns:
ModelAndView object with the name of the view and the required model data, or null if the request has been handled directly
Throws:
Exception - in case of errors
See Also:
ResourceServingPortlet.serveResource(javax.portlet.ResourceRequest, javax.portlet.ResourceResponse)

handleEvent

public void handleEvent(javax.portlet.EventRequest request,
                        javax.portlet.EventResponse response,
                        Object handler)
                 throws Exception
Description copied from interface: HandlerAdapter
Use the given handler to handle this event request. The workflow that is required may vary widely.

Specified by:
handleEvent in interface HandlerAdapter
Parameters:
request - current action request
response - current action response
handler - handler to use. This object must have previously been passed to the supports method of this interface, which must have returned true.
Throws:
Exception - in case of errors
See Also:
EventPortlet.processEvent(javax.portlet.EventRequest, javax.portlet.EventResponse)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimplePortletPostProcessor

org.springframework.web.portlet.handler
Class SimplePortletPostProcessor

java.lang.Object
    extended by  org.springframework.web.portlet.handler.SimplePortletPostProcessor
All Implemented Interfaces:
BeanPostProcessor, DestructionAwareBeanPostProcessor, PortletConfigAware, PortletContextAware
public class SimplePortletPostProcessor
extends Object
implements DestructionAwareBeanPostProcessor, PortletContextAware, PortletConfigAware

Bean post-processor that applies initialization and destruction callbacks to beans that implement the Portlet interface.

After initialization of the bean instance, the Portlet init method will be called with a PortletConfig that contains the bean name of the Portlet and the PortletContext that it is running in.

Before destruction of the bean instance, the Portlet destroy will be called.

Note that this post-processor does not support Portlet initialization parameters. Bean instances that implement the Portlet interface are supposed to be configured like any other Spring bean, that is, through constructor arguments or bean properties.

For reuse of a Portlet implementation in a plain Portlet container and as a bean in a Spring context, consider deriving from Spring's GenericPortletBean base class that applies Portlet initialization parameters as bean properties, supporting both initialization styles.

Alternatively, consider wrapping a Portlet with Spring's PortletWrappingController. This is particularly appropriate for existing Portlet classes, allowing to specify Portlet initialization parameters etc.

Since:
2.0
Author:
Juergen Hoeller, John A. Lewis
See Also:
Portlet, PortletConfig, SimplePortletHandlerAdapter, GenericPortletBean, PortletWrappingController

Constructor Summary
SimplePortletPostProcessor()
Method Summary
Object | postProcessAfterInitialization(Object bean, String beanName) Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).
void | postProcessBeforeDestruction(Object bean, String beanName) Apply this BeanPostProcessor to the given bean instance before its destruction.
Object | postProcessBeforeInitialization(Object bean, String beanName) Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).
void | setPortletConfig(javax.portlet.PortletConfig portletConfig) Set the PortletConfigthat this object runs in.
void | setPortletContext(javax.portlet.PortletContext portletContext) Set the PortletContext that this object runs in.
void | setUseSharedPortletConfig(boolean useSharedPortletConfig) Set whether to use the shared PortletConfig object passed in through setPortletConfig, if available.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimplePortletPostProcessor

public SimplePortletPostProcessor()
Method Detail

setUseSharedPortletConfig

public void setUseSharedPortletConfig(boolean useSharedPortletConfig)
Set whether to use the shared PortletConfig object passed in through setPortletConfig, if available.

Default is "true". Turn this setting to "false" to pass in a mock PortletConfig object with the bean name as portlet name, holding the current PortletContext.

See Also:
setPortletConfig(javax.portlet.PortletConfig)

setPortletContext

public void setPortletContext(javax.portlet.PortletContext portletContext)
Description copied from interface: PortletContextAware
Set the PortletContext that this object runs in.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked after ApplicationContextAware's setApplicationContext.

Specified by:
setPortletContext in interface PortletContextAware
Parameters:
portletContext - PortletContext object to be used by this object

setPortletConfig

public void setPortletConfig(javax.portlet.PortletConfig portletConfig)
Description copied from interface: PortletConfigAware
Set the PortletConfigthat this object runs in.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked after ApplicationContextAware's setApplicationContext.

Specified by:
setPortletConfig in interface PortletConfigAware
Parameters:
portletConfig - PortletConfig object to be used by this object

postProcessBeforeInitialization

public Object postProcessBeforeInitialization(Object bean,
                                              String beanName)
                                       throws BeansException
Description copied from interface: BeanPostProcessor
Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

Specified by:
postProcessBeforeInitialization in interface BeanPostProcessor
Parameters:
bean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
Throws:
BeansException - in case of errors
See Also:
InitializingBean.afterPropertiesSet()

postProcessAfterInitialization

public Object postProcessAfterInitialization(Object bean,
                                             String beanName)
                                      throws BeansException
Description copied from interface: BeanPostProcessor
Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

In case of a FactoryBean, this callback will be invoked for both the FactoryBean instance and the objects created by the FactoryBean (as of Spring 2.0). The post-processor can decide whether to apply to either the FactoryBean or created objects or both through corresponding bean instanceof FactoryBean checks.

This callback will also be invoked after a short-circuiting triggered by a InstantiationAwareBeanPostProcessor.postProcessBeforeInstantiation(java.lang.Class, java.lang.String) method, in contrast to all other BeanPostProcessor callbacks.

Specified by:
postProcessAfterInitialization in interface BeanPostProcessor
Parameters:
bean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
Throws:
BeansException - in case of errors
See Also:
InitializingBean.afterPropertiesSet(), FactoryBean

postProcessBeforeDestruction

public void postProcessBeforeDestruction(Object bean,
                                         String beanName)
                                  throws BeansException
Description copied from interface: DestructionAwareBeanPostProcessor
Apply this BeanPostProcessor to the given bean instance before its destruction. Can invoke custom destruction callbacks.

Like DisposableBean's destroy and a custom destroy method, this callback just applies to singleton beans in the factory (including inner beans).

Specified by:
postProcessBeforeDestruction in interface DestructionAwareBeanPostProcessor
Parameters:
bean - the bean instance to be destroyed
beanName - the name of the bean
Throws:
BeansException - in case of errors
See Also:
DisposableBean, AbstractBeanDefinition.setDestroyMethodName(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UserRoleAuthorizationInterceptor

org.springframework.web.portlet.handler
Class UserRoleAuthorizationInterceptor

java.lang.Object
    extended by  org.springframework.web.portlet.handler.HandlerInterceptorAdapter
        extended by  org.springframework.web.portlet.handler.UserRoleAuthorizationInterceptor
All Implemented Interfaces:
HandlerInterceptor
public class UserRoleAuthorizationInterceptor
extends HandlerInterceptorAdapter

Interceptor that checks the authorization of the current user via the user's roles, as evaluated by PortletRequest's isUserInRole method.

Since:
2.0
Author:
John A. Lewis, Juergen Hoeller
See Also:
PortletRequest.isUserInRole(java.lang.String)

Constructor Summary
UserRoleAuthorizationInterceptor()
Method Summary
protected void | handleNotAuthorized(javax.portlet.PortletRequest request, javax.portlet.PortletResponse response, Object handler) Handle a request that is not authorized according to this interceptor.
boolean | preHandle(javax.portlet.PortletRequest request, javax.portlet.PortletResponse response, Object handler) Default callback that all "pre*" methods delegate to.
void | setAuthorizedRoles(String[] authorizedRoles) Set the roles that this interceptor should treat as authorized.
Methods inherited from class org.springframework.web.portlet.handler.HandlerInterceptorAdapter
afterActionCompletion, afterCompletion, afterEventCompletion, afterRenderCompletion, afterResourceCompletion, postHandleRender, postHandleResource, preHandleAction, preHandleEvent, preHandleRender, preHandleResource
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

UserRoleAuthorizationInterceptor

public UserRoleAuthorizationInterceptor()
Method Detail

setAuthorizedRoles

public final void setAuthorizedRoles(String[] authorizedRoles)
Set the roles that this interceptor should treat as authorized.

Parameters:
authorizedRoles - array of role names

preHandle

public final boolean preHandle(javax.portlet.PortletRequest request,
                               javax.portlet.PortletResponse response,
                               Object handler)
                        throws javax.portlet.PortletException,
                               IOException
Description copied from class: HandlerInterceptorAdapter
Default callback that all "pre*" methods delegate to.

This implementation always returns true.

Overrides:
preHandle in class HandlerInterceptorAdapter
Throws:
javax.portlet.PortletException
IOException

handleNotAuthorized

protected void handleNotAuthorized(javax.portlet.PortletRequest request,
                                   javax.portlet.PortletResponse response,
                                   Object handler)
                            throws javax.portlet.PortletException,
                                   IOException
Handle a request that is not authorized according to this interceptor. Default implementation throws a new PortletSecurityException.

This method can be overridden to write a custom message, forward or redirect to some error page or login page, or throw a PortletException.

Parameters:
request - current portlet request
response - current portlet response
handler - chosen handler to execute, for type and/or instance evaluation
Throws:
javax.portlet.PortletException - if there is an internal error
IOException - in case of an I/O error when writing the response
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WebRequestHandlerInterceptorAdapter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.portlet.handler
Class WebRequestHandlerInterceptorAdapter

java.lang.Object
    extended by  org.springframework.web.portlet.handler.WebRequestHandlerInterceptorAdapter
All Implemented Interfaces:
HandlerInterceptor
public class WebRequestHandlerInterceptorAdapter
extends Object
implements HandlerInterceptor

Adapter that implements the Portlet HandlerInterceptor interface and wraps an underlying WebRequestInterceptor.

NOTE: The WebRequestInterceptor is by default only applied to the Portlet render phase, which is dealing with preparing and rendering a Portlet view. The Portlet action phase will only be intercepted with WebRequestInterceptor calls if the renderPhaseOnly flag is explicitly set to false. In general, it is recommended to use the Portlet-specific HandlerInterceptor mechanism for differentiating between action and render interception.

Since:
2.0
Author:
Juergen Hoeller
See Also:
WebRequestInterceptor, HandlerInterceptor

Constructor Summary
WebRequestHandlerInterceptorAdapter(WebRequestInterceptor requestInterceptor)
Create a new WebRequestHandlerInterceptorAdapter for the given WebRequestInterceptor, applying to the render phase only.
WebRequestHandlerInterceptorAdapter(WebRequestInterceptor requestInterceptor, boolean renderPhaseOnly)
Create a new WebRequestHandlerInterceptorAdapter for the given WebRequestInterceptor.
Method Summary
void | afterActionCompletion(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response, Object handler, Exception ex) Callback after completion of request processing in the action phase, that is, after rendering the view.
void | afterEventCompletion(javax.portlet.EventRequest request, javax.portlet.EventResponse response, Object handler, Exception ex) Callback after completion of request processing in the action phase, that is, after rendering the view.
void | afterRenderCompletion(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response, Object handler, Exception ex) Callback after completion of request processing, that is, after rendering the view.
void | afterResourceCompletion(javax.portlet.ResourceRequest request, javax.portlet.ResourceResponse response, Object handler, Exception ex) Callback after completion of request processing, that is, after rendering the view.
void | postHandleRender(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response, Object handler, ModelAndView modelAndView) Intercept the execution of a handler in the render phase.
void | postHandleResource(javax.portlet.ResourceRequest request, javax.portlet.ResourceResponse response, Object handler, ModelAndView modelAndView) Intercept the execution of a handler in the render phase.
boolean | preHandleAction(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response, Object handler) Intercept the execution of a handler in the action phase.
boolean | preHandleEvent(javax.portlet.EventRequest request, javax.portlet.EventResponse response, Object handler) Intercept the execution of a handler in the action phase.
boolean | preHandleRender(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response, Object handler) Intercept the execution of a handler in the render phase.
boolean | preHandleResource(javax.portlet.ResourceRequest request, javax.portlet.ResourceResponse response, Object handler) Intercept the execution of a handler in the render phase.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

WebRequestHandlerInterceptorAdapter

public WebRequestHandlerInterceptorAdapter(WebRequestInterceptor requestInterceptor)
Create a new WebRequestHandlerInterceptorAdapter for the given WebRequestInterceptor, applying to the render phase only.

Parameters:
requestInterceptor - the WebRequestInterceptor to wrap

WebRequestHandlerInterceptorAdapter

public WebRequestHandlerInterceptorAdapter(WebRequestInterceptor requestInterceptor,
                                           boolean renderPhaseOnly)
Create a new WebRequestHandlerInterceptorAdapter for the given WebRequestInterceptor.

Parameters:
requestInterceptor - the WebRequestInterceptor to wrap
renderPhaseOnly - whether to apply to the render phase only (true) or to the action phase as well (false)
Method Detail

preHandleAction

public boolean preHandleAction(javax.portlet.ActionRequest request,
                               javax.portlet.ActionResponse response,
                               Object handler)
                        throws Exception
Description copied from interface: HandlerInterceptor
Intercept the execution of a handler in the action phase.

Called after a HandlerMapping determines an appropriate handler object to handle an ActionRequest, but before said HandlerAdapter actually invokes the handler.

DispatcherPortlet processes a handler in an execution chain, consisting of any number of interceptors, with the handler itself at the end. With this method, each interceptor can decide to abort the execution chain, typically throwing an exception or writing a custom response.

Specified by:
preHandleAction in interface HandlerInterceptor
Parameters:
request - current portlet action request
response - current portlet action response
handler - chosen handler to execute, for type and/or instance evaluation
Returns:
true if the execution chain should proceed with the next interceptor or the handler itself. Else, DispatcherPortlet assumes that this interceptor has already dealt with the response itself
Throws:
Exception - in case of errors

afterActionCompletion

public void afterActionCompletion(javax.portlet.ActionRequest request,
                                  javax.portlet.ActionResponse response,
                                  Object handler,
                                  Exception ex)
                           throws Exception
Description copied from interface: HandlerInterceptor
Callback after completion of request processing in the action phase, that is, after rendering the view. Will be called on any outcome of handler execution, thus allowing for proper resource cleanup.

Note: Will only be called if this interceptor's HandlerInterceptor.preHandleAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse, Object) method has successfully completed and returned true!

Specified by:
afterActionCompletion in interface HandlerInterceptor
Parameters:
request - current portlet action request
response - current portlet action response
handler - chosen handler to execute, for type and/or instance examination
ex - exception thrown on handler execution, if any (only included as additional context information for the case where a handler threw an exception; request execution may have failed even when this argument is null)
Throws:
Exception - in case of errors

preHandleRender

public boolean preHandleRender(javax.portlet.RenderRequest request,
                               javax.portlet.RenderResponse response,
                               Object handler)
                        throws Exception
Description copied from interface: HandlerInterceptor
Intercept the execution of a handler in the render phase.

Called after a HandlerMapping determines an appropriate handler object to handle a RenderRequest, but before said HandlerAdapter actually invokes the handler.

DispatcherPortlet processes a handler in an execution chain, consisting of any number of interceptors, with the handler itself at the end. With this method, each interceptor can decide to abort the execution chain, typically throwing an exception or writing a custom response.

Specified by:
preHandleRender in interface HandlerInterceptor
Parameters:
request - current portlet render request
response - current portlet render response
handler - chosen handler to execute, for type and/or instance evaluation
Returns:
true if the execution chain should proceed with the next interceptor or the handler itself. Else, DispatcherPortlet assumes that this interceptor has already dealt with the response itself
Throws:
Exception - in case of errors

postHandleRender

public void postHandleRender(javax.portlet.RenderRequest request,
                             javax.portlet.RenderResponse response,
                             Object handler,
                             ModelAndView modelAndView)
                      throws Exception
Description copied from interface: HandlerInterceptor
Intercept the execution of a handler in the render phase.

Called after a HandlerAdapter actually invoked the handler, but before the DispatcherPortlet renders the view. Can thus expose additional model objects to the view via the given ModelAndView.

DispatcherPortlet processes a handler in an execution chain, consisting of any number of interceptors, with the handler itself at the end. With this method, each interceptor can post-process an execution, getting applied in inverse order of the execution chain.

Specified by:
postHandleRender in interface HandlerInterceptor
Parameters:
request - current portlet render request
response - current portlet render response
handler - chosen handler to execute, for type and/or instance examination
modelAndView - the ModelAndView that the handler returned (can also be null)
Throws:
Exception - in case of errors

afterRenderCompletion

public void afterRenderCompletion(javax.portlet.RenderRequest request,
                                  javax.portlet.RenderResponse response,
                                  Object handler,
                                  Exception ex)
                           throws Exception
Description copied from interface: HandlerInterceptor
Callback after completion of request processing, that is, after rendering the view. Will be called on any outcome of handler execution, thus allowing for proper resource cleanup.

Note: Will only be called if this interceptor's HandlerInterceptor.preHandleRender(javax.portlet.RenderRequest, javax.portlet.RenderResponse, Object) method has successfully completed and returned true!

Specified by:
afterRenderCompletion in interface HandlerInterceptor
Parameters:
request - current portlet render request
response - current portlet render response
handler - chosen handler to execute, for type and/or instance examination
ex - exception thrown on handler execution, if any
Throws:
Exception - in case of errors

preHandleResource

public boolean preHandleResource(javax.portlet.ResourceRequest request,
                                 javax.portlet.ResourceResponse response,
                                 Object handler)
                          throws Exception
Description copied from interface: HandlerInterceptor
Intercept the execution of a handler in the render phase.

Called after a HandlerMapping determines an appropriate handler object to handle a RenderRequest, but before said HandlerAdapter actually invokes the handler.

DispatcherPortlet processes a handler in an execution chain, consisting of any number of interceptors, with the handler itself at the end. With this method, each interceptor can decide to abort the execution chain, typically throwing an exception or writing a custom response.

Specified by:
preHandleResource in interface HandlerInterceptor
Parameters:
request - current portlet render request
response - current portlet render response
handler - chosen handler to execute, for type and/or instance evaluation
Returns:
true if the execution chain should proceed with the next interceptor or the handler itself. Else, DispatcherPortlet assumes that this interceptor has already dealt with the response itself
Throws:
Exception - in case of errors

postHandleResource

public void postHandleResource(javax.portlet.ResourceRequest request,
                               javax.portlet.ResourceResponse response,
                               Object handler,
                               ModelAndView modelAndView)
                        throws Exception
Description copied from interface: HandlerInterceptor
Intercept the execution of a handler in the render phase.

Called after a HandlerAdapter actually invoked the handler, but before the DispatcherPortlet renders the view. Can thus expose additional model objects to the view via the given ModelAndView.

DispatcherPortlet processes a handler in an execution chain, consisting of any number of interceptors, with the handler itself at the end. With this method, each interceptor can post-process an execution, getting applied in inverse order of the execution chain.

Specified by:
postHandleResource in interface HandlerInterceptor
Parameters:
request - current portlet render request
response - current portlet render response
handler - chosen handler to execute, for type and/or instance examination
modelAndView - the ModelAndView that the handler returned (can also be null)
Throws:
Exception - in case of errors

afterResourceCompletion

public void afterResourceCompletion(javax.portlet.ResourceRequest request,
                                    javax.portlet.ResourceResponse response,
                                    Object handler,
                                    Exception ex)
                             throws Exception
Description copied from interface: HandlerInterceptor
Callback after completion of request processing, that is, after rendering the view. Will be called on any outcome of handler execution, thus allowing for proper resource cleanup.

Note: Will only be called if this interceptor's HandlerInterceptor.preHandleRender(javax.portlet.RenderRequest, javax.portlet.RenderResponse, Object) method has successfully completed and returned true!

Specified by:
afterResourceCompletion in interface HandlerInterceptor
Parameters:
request - current portlet render request
response - current portlet render response
handler - chosen handler to execute, for type and/or instance examination
ex - exception thrown on handler execution, if any
Throws:
Exception - in case of errors

preHandleEvent

public boolean preHandleEvent(javax.portlet.EventRequest request,
                              javax.portlet.EventResponse response,
                              Object handler)
                       throws Exception
Description copied from interface: HandlerInterceptor
Intercept the execution of a handler in the action phase.

Called after a HandlerMapping determines an appropriate handler object to handle an ActionRequest, but before said HandlerAdapter actually invokes the handler.

DispatcherPortlet processes a handler in an execution chain, consisting of any number of interceptors, with the handler itself at the end. With this method, each interceptor can decide to abort the execution chain, typically throwing an exception or writing a custom response.

Specified by:
preHandleEvent in interface HandlerInterceptor
Parameters:
request - current portlet action request
response - current portlet action response
handler - chosen handler to execute, for type and/or instance evaluation
Returns:
true if the execution chain should proceed with the next interceptor or the handler itself. Else, DispatcherPortlet assumes that this interceptor has already dealt with the response itself
Throws:
Exception - in case of errors

afterEventCompletion

public void afterEventCompletion(javax.portlet.EventRequest request,
                                 javax.portlet.EventResponse response,
                                 Object handler,
                                 Exception ex)
                          throws Exception
Description copied from interface: HandlerInterceptor
Callback after completion of request processing in the action phase, that is, after rendering the view. Will be called on any outcome of handler execution, thus allowing for proper resource cleanup.

Note: Will only be called if this interceptor's HandlerInterceptor.preHandleAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse, Object) method has successfully completed and returned true!

Specified by:
afterEventCompletion in interface HandlerInterceptor
Parameters:
request - current portlet action request
response - current portlet action response
handler - chosen handler to execute, for type and/or instance examination
ex - exception thrown on handler execution, if any (only included as additional context information for the case where a handler threw an exception; request execution may have failed even when this argument is null)
Throws:
Exception - in case of errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


PortletRequestMethodNotSupportedException

org.springframework.web.portlet.handler
Class PortletRequestMethodNotSupportedException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.portlet.PortletException
                extended by  org.springframework.web.portlet.handler.PortletRequestMethodNotSupportedException
All Implemented Interfaces:
Serializable
public class PortletRequestMethodNotSupportedException
extends javax.portlet.PortletException

Exception thrown when a request handler does not support a specific request method.

Since:
3.0
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
PortletRequestMethodNotSupportedException(String method)
Create a new PortletRequestMethodNotSupportedException.
PortletRequestMethodNotSupportedException(String[] supportedMethods)
Create a new PortletRequestMethodNotSupportedException.
PortletRequestMethodNotSupportedException(String method, String[] supportedMethods)
Create a new PortletRequestMethodNotSupportedException.
Method Summary
String | getMethod() Return the HTTP request method that caused the failure.
String[] | getSupportedMethods() Return the actually supported HTTP methods, if known.
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

PortletRequestMethodNotSupportedException

public PortletRequestMethodNotSupportedException(String method)
Create a new PortletRequestMethodNotSupportedException.

Parameters:
method - the unsupported HTTP request method

PortletRequestMethodNotSupportedException

public PortletRequestMethodNotSupportedException(String method,
                                                 String[] supportedMethods)
Create a new PortletRequestMethodNotSupportedException.

Parameters:
method - the unsupported HTTP request method
supportedMethods - the actually supported HTTP methods

PortletRequestMethodNotSupportedException

public PortletRequestMethodNotSupportedException(String[] supportedMethods)
Create a new PortletRequestMethodNotSupportedException.

Parameters:
method - the unsupported HTTP request method
supportedMethods - the actually supported HTTP methods
Method Detail

getMethod

public String getMethod()
Return the HTTP request method that caused the failure.

getSupportedMethods

public String[] getSupportedMethods()
Return the actually supported HTTP methods, if known.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PortletSessionRequiredException

org.springframework.web.portlet.handler
Class PortletSessionRequiredException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.portlet.PortletException
                extended by  org.springframework.web.portlet.handler.PortletSessionRequiredException
All Implemented Interfaces:
Serializable
public class PortletSessionRequiredException
extends javax.portlet.PortletException

Exception thrown when a portlet content generator requires a pre-existing session.

Since:
2.0
Author:
John A. Lewis
See Also:
PortletContentGenerator, Serialized Form

Constructor Summary
PortletSessionRequiredException(String msg)
Create a new PortletSessionRequiredException.
Method Summary
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

PortletSessionRequiredException

public PortletSessionRequiredException(String msg)
Create a new PortletSessionRequiredException.

Parameters:
msg - the detail message
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.web.portlet.multipart

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.portlet.multipart

Multipart resolution framework for handling file uploads.

See:
Description

Interface Summary
MultipartActionRequest | Interface which provides additional methods for dealing with multipart content within a portlet request, allowing to access uploaded files.
PortletMultipartResolver | Portlet version of Spring's multipart resolution strategy for file uploads as defined in RFC 1867.

Class Summary
CommonsPortletMultipartResolver | PortletMultipartResolver implementation for Jakarta Commons FileUpload 1.2 or above.
DefaultMultipartActionRequest | Default implementation of the MultipartActionRequest interface.

Package org.springframework.web.portlet.multipart Description

Multipart resolution framework for handling file uploads. Provides a PortletMultipartResolver strategy interface, and a generic extension of the ActionRequest interface for accessing multipart files in web application code.


org.springframework.web.portlet.multipart Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.portlet.multipart

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.web.multipart.commons.CommonsFileUploadSupport
      • org.springframework.web.portlet.multipart.CommonsPortletMultipartResolver (implements org.springframework.web.portlet.context.PortletContextAware, org.springframework.web.portlet.multipart.PortletMultipartResolver)
    • javax.portlet.filter.PortletRequestWrapper (implements javax.portlet.PortletRequest)
      • javax.portlet.filter.ActionRequestWrapper (implements javax.portlet.ActionRequest)
        • org.springframework.web.portlet.multipart.DefaultMultipartActionRequest (implements org.springframework.web.portlet.multipart.MultipartActionRequest)

Interface Hierarchy

  • org.springframework.web.multipart.MultipartRequest
    • org.springframework.web.portlet.multipart.MultipartActionRequest (also extends javax.portlet.ActionRequest)
  • org.springframework.web.portlet.multipart.PortletMultipartResolver
  • javax.portlet.PortletRequest
    • javax.portlet.ClientDataRequest
      • javax.portlet.ActionRequest
        • org.springframework.web.portlet.multipart.MultipartActionRequest (also extends org.springframework.web.multipart.MultipartRequest)


MultipartActionRequest

org.springframework.web.portlet.multipart
Interface MultipartActionRequest

All Superinterfaces:
javax.portlet.ActionRequest, javax.portlet.ClientDataRequest, MultipartRequest, javax.portlet.PortletRequest
All Known Implementing Classes:
DefaultMultipartActionRequest, MockMultipartActionRequest
public interface MultipartActionRequest
extends javax.portlet.ActionRequest, MultipartRequest

Interface which provides additional methods for dealing with multipart content within a portlet request, allowing to access uploaded files. Implementations also need to override the standard ActionRequest methods for parameter access, making multipart parameters available.

A concrete implementation is DefaultMultipartActionRequest.

Since:
2.0
Author:
Juergen Hoeller
See Also:
PortletMultipartResolver,
MultipartFile,
PortletRequest.getParameter(java.lang.String),
PortletRequest.getParameterNames(),
PortletRequest.getParameterMap()

Nested Class Summary
Nested classes/interfaces inherited from interface javax.portlet.PortletRequest
javax.portlet.PortletRequest.P3PUserInfos
Field Summary
Fields inherited from interface javax.portlet.ActionRequest
ACTION_NAME
Fields inherited from interface javax.portlet.PortletRequest
ACTION_PHASE, ACTION_SCOPE_ID, BASIC_AUTH, CCPP_PROFILE, CLIENT_CERT_AUTH, DIGEST_AUTH, EVENT_PHASE, FORM_AUTH, LIFECYCLE_PHASE, RENDER_HEADERS, RENDER_MARKUP, RENDER_PART, RENDER_PHASE, RESOURCE_PHASE, USER_INFO
Method Summary
Methods inherited from interface javax.portlet.ClientDataRequest
getCharacterEncoding, getContentLength, getContentType, getMethod, getPortletInputStream, getReader, setCharacterEncoding
Methods inherited from interface javax.portlet.PortletRequest
getAttribute, getAttributeNames, getAuthType, getContextPath, getCookies, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getPortalContext, getPortletMode, getPortletSession, getPortletSession, getPreferences, getPrivateParameterMap, getProperties, getProperty, getPropertyNames, getPublicParameterMap, getRemoteUser, getRequestedSessionId, getResponseContentType, getResponseContentTypes, getScheme, getServerName, getServerPort, getUserPrincipal, getWindowID, getWindowState, isPortletModeAllowed, isRequestedSessionIdValid, isSecure, isUserInRole, isWindowStateAllowed, removeAttribute, setAttribute
Methods inherited from interface org.springframework.web.multipart.MultipartRequest
getFile, getFileMap, getFileNames, getFiles, getMultiFileMap

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PortletMultipartResolver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.portlet.multipart
Interface PortletMultipartResolver

All Known Implementing Classes:
CommonsPortletMultipartResolver
public interface PortletMultipartResolver

Portlet version of Spring's multipart resolution strategy for file uploads as defined in RFC 1867.

Implementations are typically usable both within any application context and standalone.

There is one concrete implementation included in Spring:

  • CommonsMultipartResolver for Jakarta Commons FileUpload

There is no default resolver implementation used for Spring DispatcherPortlets, as an application might choose to parse its multipart requests itself. To define an implementation, create a bean with the id "portletMultipartResolver" in a DispatcherPortlet's application context. Such a resolver gets applied to all requests handled by that DispatcherPortlet.

If a DispatcherPortlet detects a multipart request, it will resolve it via the configured MultipartResolver and pass on a wrapped Portlet ActionRequest. Controllers can then cast their given request to the MultipartActionRequest interface, being able to access MultipartFiles. Note that this cast is only supported in case of an actual multipart request.

 public void handleActionRequest(ActionRequest request, ActionResponse response) {
   MultipartActionRequest multipartRequest = (MultipartActionRequest) request;
   MultipartFile multipartFile = multipartRequest.getFile("image");
   ...
 }
Instead of direct access, command or form controllers can register a ByteArrayMultipartFileEditor or StringMultipartFileEditor with their data binder, to automatically apply multipart content to command bean properties.

Note: There is hardly ever a need to access the MultipartResolver itself from application code. It will simply do its work behind the scenes, making MultipartActionRequests available to controllers.

Since:
2.0
Author:
Juergen Hoeller
See Also:
MultipartActionRequest, MultipartFile, CommonsPortletMultipartResolver, ByteArrayMultipartFileEditor, StringMultipartFileEditor, DispatcherPortlet

Method Summary
void | cleanupMultipart(MultipartActionRequest request) Cleanup any resources used for the multipart handling, such as storage for any uploaded file(s).
boolean | isMultipart(javax.portlet.ActionRequest request) Determine if the given request contains multipart content.
MultipartActionRequest | resolveMultipart(javax.portlet.ActionRequest request) Parse the given portlet request into multipart files and parameters, and wrap the request inside a MultipartActionRequest object that provides access to file descriptors and makes contained parameters accessible via the standard PortletRequest methods.

Method Detail

isMultipart

boolean isMultipart(javax.portlet.ActionRequest request)
Determine if the given request contains multipart content.

Will typically check for content type "multipart/form-data", but the actually accepted requests might depend on the capabilities of the resolver implementation.

Parameters:
request - the portlet request to be evaluated
Returns:
whether the request contains multipart content

resolveMultipart

MultipartActionRequest resolveMultipart(javax.portlet.ActionRequest request)
                                        throws MultipartException
Parse the given portlet request into multipart files and parameters, and wrap the request inside a MultipartActionRequest object that provides access to file descriptors and makes contained parameters accessible via the standard PortletRequest methods.

Parameters:
request - the portlet request to wrap (must be of a multipart content type)
Returns:
the wrapped portlet request
Throws:
MultipartException - if the portlet request is not multipart, or if implementation-specific problems are encountered (such as exceeding file size limits)
See Also:
MultipartRequest.getFile(java.lang.String),
MultipartRequest.getFileNames(),
MultipartRequest.getFileMap(),
PortletRequest.getParameter(java.lang.String),
PortletRequest.getParameterNames(),
PortletRequest.getParameterMap()

cleanupMultipart

void cleanupMultipart(MultipartActionRequest request)
Cleanup any resources used for the multipart handling, such as storage for any uploaded file(s).

Parameters:
request - the request to cleanup resources for
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


CommonsPortletMultipartResolver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.portlet.multipart
Class CommonsPortletMultipartResolver

java.lang.Object
    extended by  org.springframework.web.multipart.commons.CommonsFileUploadSupport
        extended by  org.springframework.web.portlet.multipart.CommonsPortletMultipartResolver
All Implemented Interfaces:
PortletContextAware, PortletMultipartResolver
public class CommonsPortletMultipartResolver
extends CommonsFileUploadSupport
implements PortletMultipartResolver, PortletContextAware

PortletMultipartResolver implementation for Jakarta Commons FileUpload 1.2 or above.

Provides "maxUploadSize", "maxInMemorySize" and "defaultEncoding" settings as bean properties (inherited from CommonsFileUploadSupport). See corresponding PortletFileUpload / DiskFileItemFactory properties ("sizeMax", "sizeThreshold", "headerEncoding") for details in terms of defaults and accepted values.

Saves temporary files to the portlet container's temporary directory. Needs to be initialized either by an application context or via the constructor that takes a PortletContext (for standalone usage).

Since:
2.0
Author:
Juergen Hoeller
See Also:
CommonsPortletMultipartResolver(javax.portlet.PortletContext), setResolveLazily(boolean), CommonsMultipartResolver, PortletFileUpload, DiskFileItemFactory

Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.web.multipart.commons.CommonsFileUploadSupport
CommonsFileUploadSupport.MultipartParsingResult
Field Summary
Fields inherited from class org.springframework.web.multipart.commons.CommonsFileUploadSupport
logger
Constructor Summary
CommonsPortletMultipartResolver()
Constructor for use as bean.
CommonsPortletMultipartResolver(javax.portlet.PortletContext portletContext)
Constructor for standalone usage.
Method Summary
void | cleanupMultipart(MultipartActionRequest request) Cleanup any resources used for the multipart handling, such as storage for any uploaded file(s).
protected String | determineEncoding(javax.portlet.ActionRequest request) Determine the encoding for the given request.
boolean | isMultipart(javax.portlet.ActionRequest request) Determine if the given request contains multipart content.
protected FileUpload | newFileUpload(FileItemFactory fileItemFactory) Initialize the underlying org.apache.commons.fileupload.portlet.PortletFileUpload instance.
protected CommonsFileUploadSupport.MultipartParsingResult | parseRequest(javax.portlet.ActionRequest request) Parse the given portlet request, resolving its multipart elements.
MultipartActionRequest | resolveMultipart(javax.portlet.ActionRequest request) Parse the given portlet request into multipart files and parameters, and wrap the request inside a MultipartActionRequest object that provides access to file descriptors and makes contained parameters accessible via the standard PortletRequest methods.
void | setPortletContext(javax.portlet.PortletContext portletContext) Set the PortletContext that this object runs in.
void | setResolveLazily(boolean resolveLazily) Set whether to resolve the multipart request lazily at the time of file or parameter access.
Methods inherited from class org.springframework.web.multipart.commons.CommonsFileUploadSupport
cleanupFileItems, getDefaultEncoding, getFileItemFactory, getFileUpload, isUploadTempDirSpecified, newFileItemFactory, parseFileItems, prepareFileUpload, setDefaultEncoding, setMaxInMemorySize, setMaxUploadSize, setUploadTempDir
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CommonsPortletMultipartResolver

public CommonsPortletMultipartResolver()
Constructor for use as bean. Determines the portlet container's temporary directory via the PortletContext passed in as through the PortletContextAware interface (typically by an ApplicationContext).

See Also:
setPortletContext(javax.portlet.PortletContext), PortletContextAware

CommonsPortletMultipartResolver

public CommonsPortletMultipartResolver(javax.portlet.PortletContext portletContext)
Constructor for standalone usage. Determines the portlet container's temporary directory via the given PortletContext.

Parameters:
portletContext - the PortletContext to use
Method Detail

setResolveLazily

public void setResolveLazily(boolean resolveLazily)
Set whether to resolve the multipart request lazily at the time of file or parameter access.

Default is "false", resolving the multipart elements immediately, throwing corresponding exceptions at the time of the resolveMultipart(javax.portlet.ActionRequest) call. Switch this to "true" for lazy multipart parsing, throwing parse exceptions once the application attempts to obtain multipart files or parameters.

newFileUpload

protected FileUpload newFileUpload(FileItemFactory fileItemFactory)
Initialize the underlying org.apache.commons.fileupload.portlet.PortletFileUpload instance. Can be overridden to use a custom subclass, e.g. for testing purposes.

Specified by:
newFileUpload in class CommonsFileUploadSupport
Parameters:
fileItemFactory - the Commons FileItemFactory to build upon
Returns:
the new PortletFileUpload instance

setPortletContext

public void setPortletContext(javax.portlet.PortletContext portletContext)
Description copied from interface: PortletContextAware
Set the PortletContext that this object runs in.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked after ApplicationContextAware's setApplicationContext.

Specified by:
setPortletContext in interface PortletContextAware
Parameters:
portletContext - PortletContext object to be used by this object

isMultipart

public boolean isMultipart(javax.portlet.ActionRequest request)
Description copied from interface: PortletMultipartResolver
Determine if the given request contains multipart content.

Will typically check for content type "multipart/form-data", but the actually accepted requests might depend on the capabilities of the resolver implementation.

Specified by:
isMultipart in interface PortletMultipartResolver
Parameters:
request - the portlet request to be evaluated
Returns:
whether the request contains multipart content

resolveMultipart

public MultipartActionRequest resolveMultipart(javax.portlet.ActionRequest request)
                                        throws MultipartException
Description copied from interface: PortletMultipartResolver
Parse the given portlet request into multipart files and parameters, and wrap the request inside a MultipartActionRequest object that provides access to file descriptors and makes contained parameters accessible via the standard PortletRequest methods.

Specified by:
resolveMultipart in interface PortletMultipartResolver
Parameters:
request - the portlet request to wrap (must be of a multipart content type)
Returns:
the wrapped portlet request
Throws:
MultipartException - if the portlet request is not multipart, or if implementation-specific problems are encountered (such as exceeding file size limits)
See Also:
MultipartRequest.getFile(java.lang.String),
MultipartRequest.getFileNames(),
MultipartRequest.getFileMap(),
PortletRequest.getParameter(java.lang.String),
PortletRequest.getParameterNames(),
PortletRequest.getParameterMap()

parseRequest

protected CommonsFileUploadSupport.MultipartParsingResult parseRequest(javax.portlet.ActionRequest request)
                                                                throws MultipartException
Parse the given portlet request, resolving its multipart elements.

Parameters:
request - the request to parse
Returns:
the parsing result
Throws:
MultipartException - if multipart resolution failed.

determineEncoding

protected String determineEncoding(javax.portlet.ActionRequest request)
Determine the encoding for the given request. Can be overridden in subclasses.

The default implementation checks the request encoding, falling back to the default encoding specified for this resolver.

Parameters:
request - current portlet request
Returns:
the encoding for the request (never null)
See Also:
ClientDataRequest.getCharacterEncoding(), CommonsFileUploadSupport.setDefaultEncoding(java.lang.String)

cleanupMultipart

public void cleanupMultipart(MultipartActionRequest request)
Description copied from interface: PortletMultipartResolver
Cleanup any resources used for the multipart handling, such as storage for any uploaded file(s).

Specified by:
cleanupMultipart in interface PortletMultipartResolver
Parameters:
request - the request to cleanup resources for
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


DefaultMultipartActionRequest

org.springframework.web.portlet.multipart
Class DefaultMultipartActionRequest

java.lang.Object
    extended by  javax.portlet.filter.PortletRequestWrapper
        extended by  javax.portlet.filter.ActionRequestWrapper
            extended by  org.springframework.web.portlet.multipart.DefaultMultipartActionRequest
All Implemented Interfaces:
javax.portlet.ActionRequest, javax.portlet.ClientDataRequest, javax.portlet.PortletRequest, MultipartRequest, MultipartActionRequest
public class DefaultMultipartActionRequest
extends javax.portlet.filter.ActionRequestWrapper
implements MultipartActionRequest

Default implementation of the MultipartActionRequest interface. Provides management of pre-generated parameter values.

Since:
2.0
Author:
Juergen Hoeller, Arjen Poutsma
See Also:
PortletMultipartResolver

Nested Class Summary
Nested classes/interfaces inherited from interface javax.portlet.PortletRequest
javax.portlet.PortletRequest.P3PUserInfos
Field Summary
Fields inherited from interface javax.portlet.ActionRequest
ACTION_NAME
Fields inherited from interface javax.portlet.PortletRequest
ACTION_PHASE, ACTION_SCOPE_ID, BASIC_AUTH, CCPP_PROFILE, CLIENT_CERT_AUTH, DIGEST_AUTH, EVENT_PHASE, FORM_AUTH, LIFECYCLE_PHASE, RENDER_HEADERS, RENDER_MARKUP, RENDER_PART, RENDER_PHASE, RESOURCE_PHASE, USER_INFO
Constructor Summary
protected | DefaultMultipartActionRequest(javax.portlet.ActionRequest request) Wrap the given Portlet ActionRequest in a MultipartActionRequest.
 | DefaultMultipartActionRequest(javax.portlet.ActionRequest request, MultiValueMap<String,MultipartFile> mpFiles, Map<String,String[]> mpParams) Wrap the given Portlet ActionRequest in a MultipartActionRequest.
Method Summary
MultipartFile | getFile(String name) Return the contents plus description of an uploaded file in this request, or null if it does not exist.
Map<String,MultipartFile> | getFileMap() Return a Map of the multipart files contained in this request.
Iterator<String> | getFileNames() Return an Iterator of String objects containing the parameter names of the multipart files contained in this request.
List<MultipartFile> | getFiles(String name) Return the contents plus description of uploaded files in this request, or an empty list if it does not exist.
MultiValueMap<String,MultipartFile> | getMultiFileMap() Return a MultiValueMap of the multipart files contained in this request.
protected MultiValueMap<String,MultipartFile> | getMultipartFiles() Obtain the MultipartFile Map for retrieval, lazily initializing it if necessary.
protected Map<String,String[]> | getMultipartParameters() Obtain the multipart parameter Map for retrieval, lazily initializing it if necessary.
String | getParameter(String name)
Map<String,String[]> | getParameterMap()
Enumeration<String> | getParameterNames()
String[] | getParameterValues(String name)
protected void | initializeMultipart() Lazily initialize the multipart request, if possible.
protected void | setMultipartFiles(MultiValueMap<String,MultipartFile> multipartFiles) Set a Map with parameter names as keys and list of MultipartFile objects as values.
protected void | setMultipartParameters(Map<String,String[]> multipartParameters) Set a Map with parameter names as keys and String array objects as values.
Methods inherited from class javax.portlet.filter.ActionRequestWrapper
getCharacterEncoding, getContentLength, getContentType, getMethod, getPortletInputStream, getReader, getRequest, setCharacterEncoding, setRequest
Methods inherited from class javax.portlet.filter.PortletRequestWrapper
getAttribute, getAttributeNames, getAuthType, getContextPath, getCookies, getLocale, getLocales, getPortalContext, getPortletMode, getPortletSession, getPortletSession, getPreferences, getPrivateParameterMap, getProperties, getProperty, getPropertyNames, getPublicParameterMap, getRemoteUser, getRequestedSessionId, getResponseContentType, getResponseContentTypes, getScheme, getServerName, getServerPort, getUserPrincipal, getWindowID, getWindowState, isPortletModeAllowed, isRequestedSessionIdValid, isSecure, isUserInRole, isWindowStateAllowed, removeAttribute, setAttribute, setRequest
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.portlet.ClientDataRequest
getCharacterEncoding, getContentLength, getContentType, getMethod, getPortletInputStream, getReader, setCharacterEncoding
Methods inherited from interface javax.portlet.PortletRequest
getAttribute, getAttributeNames, getAuthType, getContextPath, getCookies, getLocale, getLocales, getPortalContext, getPortletMode, getPortletSession, getPortletSession, getPreferences, getPrivateParameterMap, getProperties, getProperty, getPropertyNames, getPublicParameterMap, getRemoteUser, getRequestedSessionId, getResponseContentType, getResponseContentTypes, getScheme, getServerName, getServerPort, getUserPrincipal, getWindowID, getWindowState, isPortletModeAllowed, isRequestedSessionIdValid, isSecure, isUserInRole, isWindowStateAllowed, removeAttribute, setAttribute

Constructor Detail

DefaultMultipartActionRequest

public DefaultMultipartActionRequest(javax.portlet.ActionRequest request,
                                     MultiValueMap<String,MultipartFile> mpFiles,
                                     Map<String,String[]> mpParams)
Wrap the given Portlet ActionRequest in a MultipartActionRequest.

Parameters:
request - the request to wrap
mpFiles - a map of the multipart files
mpParams - a map of the parameters to expose, with Strings as keys and String arrays as values

DefaultMultipartActionRequest

protected DefaultMultipartActionRequest(javax.portlet.ActionRequest request)
Wrap the given Portlet ActionRequest in a MultipartActionRequest.

Parameters:
request - the request to wrap
Method Detail

getFileNames

public Iterator<String> getFileNames()
Description copied from interface: MultipartRequest
Return an Iterator of String objects containing the parameter names of the multipart files contained in this request. These are the field names of the form (like with normal parameters), not the original file names.

Specified by:
getFileNames in interface MultipartRequest
Returns:
the names of the files

getFile

public MultipartFile getFile(String name)
Description copied from interface: MultipartRequest
Return the contents plus description of an uploaded file in this request, or null if it does not exist.

Specified by:
getFile in interface MultipartRequest
Parameters:
name - a String specifying the parameter name of the multipart file
Returns:
the uploaded content in the form of a MultipartFile object

getFiles

public List<MultipartFile> getFiles(String name)
Description copied from interface: MultipartRequest
Return the contents plus description of uploaded files in this request, or an empty list if it does not exist.

Specified by:
getFiles in interface MultipartRequest
Parameters:
name - a String specifying the parameter name of the multipart file
Returns:
the uploaded content in the form of a MultipartFile list

getFileMap

public Map<String,MultipartFile> getFileMap()
Description copied from interface: MultipartRequest
Return a Map of the multipart files contained in this request.

Specified by:
getFileMap in interface MultipartRequest
Returns:
a map containing the parameter names as keys, and the MultipartFile objects as values
See Also:
MultipartFile

getMultiFileMap

public MultiValueMap<String,MultipartFile> getMultiFileMap()
Description copied from interface: MultipartRequest
Return a MultiValueMap of the multipart files contained in this request.

Specified by:
getMultiFileMap in interface MultipartRequest
Returns:
a map containing the parameter names as keys, and a list of MultipartFile objects as values
See Also:
MultipartFile

getParameterNames

public Enumeration<String> getParameterNames()
Specified by:
getParameterNames in interface javax.portlet.PortletRequest
Overrides:
getParameterNames in class javax.portlet.filter.PortletRequestWrapper

getParameter

public String getParameter(String name)
Specified by:
getParameter in interface javax.portlet.PortletRequest
Overrides:
getParameter in class javax.portlet.filter.PortletRequestWrapper

getParameterValues

public String[] getParameterValues(String name)
Specified by:
getParameterValues in interface javax.portlet.PortletRequest
Overrides:
getParameterValues in class javax.portlet.filter.PortletRequestWrapper

getParameterMap

public Map<String,String[]> getParameterMap()
Specified by:
getParameterMap in interface javax.portlet.PortletRequest
Overrides:
getParameterMap in class javax.portlet.filter.PortletRequestWrapper

setMultipartFiles

protected final void setMultipartFiles(MultiValueMap<String,MultipartFile> multipartFiles)
Set a Map with parameter names as keys and list of MultipartFile objects as values. To be invoked by subclasses on initialization.

getMultipartFiles

protected MultiValueMap<String,MultipartFile> getMultipartFiles()
Obtain the MultipartFile Map for retrieval, lazily initializing it if necessary.

See Also:
initializeMultipart()

setMultipartParameters

protected final void setMultipartParameters(Map<String,String[]> multipartParameters)
Set a Map with parameter names as keys and String array objects as values. To be invoked by subclasses on initialization.

getMultipartParameters

protected Map<String,String[]> getMultipartParameters()
Obtain the multipart parameter Map for retrieval, lazily initializing it if necessary.

See Also:
initializeMultipart()

initializeMultipart

protected void initializeMultipart()
Lazily initialize the multipart request, if possible. Only called if not already eagerly initialized.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.web.portlet.mvc

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.portlet.mvc

Standard controller implementations for the portlet MVC framework that comes with Spring.

See:
Description

Interface Summary
Controller | Base portlet Controller interface, representing a component that receives RenderRequest/RenderResponse and ActionRequest/ActionResponse like a Portlet but is able to participate in an MVC workflow.
EventAwareController | Extension of the Portlet Controller interface that allows for handling Portlet 2.0 event requests as well.
ResourceAwareController | Extension of the Portlet Controller interface that allows for handling Portlet 2.0 resource requests as well.

Class Summary
AbstractCommandController | Deprecated. as of Spring 3.0, in favor of annotated controllers
AbstractController | Convenient superclass for controller implementations, using the Template Method design pattern.
AbstractFormController | Deprecated. as of Spring 3.0, in favor of annotated controllers
AbstractWizardFormController | Deprecated. as of Spring 3.0, in favor of annotated controllers
BaseCommandController | Deprecated. as of Spring 3.0, in favor of annotated controllers
ParameterizableViewController | Trivial controller that always returns a named view.
PortletModeNameViewController | Trivial controller that transforms the PortletMode to a view name.
PortletWrappingController | Controller implementation that wraps a portlet instance which it manages internally.
SimpleControllerHandlerAdapter | Adapter to use the Controller workflow interface with the generic DispatcherPortlet.
SimpleFormController | Deprecated. as of Spring 3.0, in favor of annotated controllers

Package org.springframework.web.portlet.mvc Description

Standard controller implementations for the portlet MVC framework that comes with Spring. Provides both abstract base classes and concrete implementations for often seen use cases.

A Controller - as defined in this package - is analogous to a Struts Action. Usually Controllers are JavaBeans to allow easy configuration using the org.springframework.beans package. Controllers define the C from so-called MVC paradigm and can be used in conjunction with the ModelAndView to achieve interactive applications. The view might be represented by a HTML interface, but, because of model and the controller being completely independent of the view, PDF views are possible, as well as for instance Excel views.

Especially useful to read, while getting into the Spring MVC framework are the following:

  • Controller
  • BaseCommandController
  • ParameterizableViewController


org.springframework.web.portlet.mvc Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.portlet.mvc

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.context.support.ApplicationObjectSupport (implements org.springframework.context.ApplicationContextAware)
      • org.springframework.web.portlet.context.PortletApplicationObjectSupport (implements org.springframework.web.portlet.context.PortletContextAware)
        • org.springframework.web.portlet.handler.PortletContentGenerator
          • org.springframework.web.portlet.mvc.AbstractController (implements org.springframework.web.portlet.mvc.Controller)
            • org.springframework.web.portlet.mvc.BaseCommandController
              • org.springframework.web.portlet.mvc.AbstractCommandController
              • org.springframework.web.portlet.mvc.AbstractFormController
                • org.springframework.web.portlet.mvc.AbstractWizardFormController
                • org.springframework.web.portlet.mvc.SimpleFormController
            • org.springframework.web.portlet.mvc.ParameterizableViewController
            • org.springframework.web.portlet.mvc.PortletWrappingController (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.web.portlet.context.PortletConfigAware, org.springframework.web.portlet.context.PortletContextAware)
    • org.springframework.web.portlet.mvc.PortletModeNameViewController (implements org.springframework.web.portlet.mvc.Controller)
    • org.springframework.web.portlet.mvc.SimpleControllerHandlerAdapter (implements org.springframework.web.portlet.HandlerAdapter, org.springframework.web.portlet.context.PortletContextAware)

Interface Hierarchy

  • org.springframework.web.portlet.mvc.Controller
  • org.springframework.web.portlet.mvc.EventAwareController
  • org.springframework.web.portlet.mvc.ResourceAwareController


Controller

org.springframework.web.portlet.mvc
Interface Controller

All Known Implementing Classes:
AbstractCommandController, AbstractController, AbstractFormController, AbstractWizardFormController, BaseCommandController, ParameterizableViewController, PortletModeNameViewController, PortletWrappingController, SimpleFormController
public interface Controller

Base portlet Controller interface, representing a component that receives RenderRequest/RenderResponse and ActionRequest/ActionResponse like a Portlet but is able to participate in an MVC workflow.

Any implementation of the portlet Controller interface should be a reusable, threadsafe class, capable of handling multiple portlet requests throughout the lifecycle of an application. To be able to configure Controller(s) in an easy way, Controllers are usually JavaBeans.

Workflow:

After the DispatcherPortlet has received a request and has done its work to resolve locales, themes and suchlike, it tries to resolve a Controller to handle that request, using a HandlerMapping. When a Controller has been found, the handleRenderRequest or handleActionRequest method will be invoked, which is responsible for handling the actual request and - if applicable - returning an appropriate ModelAndView. So actually, these method are the main entrypoint for the DispatcherPortlet which delegates requests to controllers.

So basically any direct implementation of the Controller interface just handles RenderRequests/ActionRequests and should return a ModelAndView, to be further used by the DispatcherPortlet. Any additional functionality such as optional validation, form handling, etc should be obtained through extending one of the abstract controller classes mentioned above.

Since:
2.0
Author:
William G. Thompson, Jr., John A. Lewis
See Also:
ResourceAwareController, EventAwareController, SimpleControllerHandlerAdapter, AbstractController, PortletContextAware

Method Summary
void | handleActionRequest(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response) Process the action request.
ModelAndView | handleRenderRequest(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response) Process the render request and return a ModelAndView object which the DispatcherPortlet will render.

Method Detail

handleActionRequest

void handleActionRequest(javax.portlet.ActionRequest request,
                         javax.portlet.ActionResponse response)
                         throws Exception
Process the action request. There is nothing to return.

Parameters:
request - current portlet action request
response - current portlet action response
Throws:
Exception - in case of errors

handleRenderRequest

ModelAndView handleRenderRequest(javax.portlet.RenderRequest request,
                                 javax.portlet.RenderResponse response)
                                 throws Exception
Process the render request and return a ModelAndView object which the DispatcherPortlet will render. A null return value is not an error: It indicates that this object completed request processing itself, thus there is no ModelAndView to render.

Parameters:
request - current portlet render request
response - current portlet render response
Returns:
a ModelAndView to render, or null if handled directly
Throws:
Exception - in case of errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EventAwareController

org.springframework.web.portlet.mvc
Interface EventAwareController

public interface EventAwareController

Extension of the Portlet Controller interface that allows for handling Portlet 2.0 event requests as well. Can also be implemented by AbstractController subclasses.

Since:
3.0
Author:
Juergen Hoeller
See Also:
EventPortlet, Controller, ResourceAwareController

Method Summary
 void handleEventRequest(javax.portlet.EventRequest request, javax.portlet.EventResponse response)
Process the event request.

Method Detail

handleEventRequest

void handleEventRequest(javax.portlet.EventRequest request,
                        javax.portlet.EventResponse response)
                        throws Exception
Process the event request. There is nothing to return.

Parameters:
request - current portlet event request
response - current portlet event response
Throws:
Exception - in case of errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResourceAwareController

org.springframework.web.portlet.mvc
Interface ResourceAwareController

public interface ResourceAwareController

Extension of the Portlet Controller interface that allows for handling Portlet 2.0 resource requests as well. Can also be implemented by AbstractController subclasses.

Since:
3.0
Author:
Juergen Hoeller
See Also:
ResourceServingPortlet, Controller, EventAwareController

Method Summary
 ModelAndView handleResourceRequest(javax.portlet.ResourceRequest request, javax.portlet.ResourceResponse response)
Process the resource request and return a ModelAndView object which the DispatcherPortlet will render.

Method Detail

handleResourceRequest

ModelAndView handleResourceRequest(javax.portlet.ResourceRequest request,
                                   javax.portlet.ResourceResponse response)
                                   throws Exception
Process the resource request and return a ModelAndView object which the DispatcherPortlet will render. A null return value is not an error: It indicates that this object completed request processing itself, thus there is no ModelAndView to render.

Parameters:
request - current portlet resource request
response - current portlet resource response
Returns:
a ModelAndView to render, or null if handled directly
Throws:
Exception - in case of errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractCommandController

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.portlet.mvc
Class AbstractCommandController

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.portlet.context.PortletApplicationObjectSupport
            extended by  org.springframework.web.portlet.handler.PortletContentGenerator
                extended by  org.springframework.web.portlet.mvc.AbstractController
                    extended by  org.springframework.web.portlet.mvc.BaseCommandController
                        extended by  org.springframework.web.portlet.mvc.AbstractCommandController
All Implemented Interfaces:
ApplicationContextAware, PortletContextAware, Controller
Deprecated. as of Spring 3.0, in favor of annotated controllers

@Deprecated
public abstract class AbstractCommandController
extends BaseCommandController

Abstract base class for custom command controllers. Autopopulates a command bean from the request. For command validation, a validator (property inherited from BaseCommandController) can be used.

This command controller should preferrable not be used to handle form submission, because functionality for forms is more offered in more detail by the AbstractFormController and its corresponding implementations.

Exposed configuration properties (and those defined by superclass):
none (so only those available in superclass).

Workflow (and that defined by superclass):

Since:
2.0
Author:
John A. Lewis, Juergen Hoeller
See Also:
BaseCommandController.setCommandClass(java.lang.Class),
BaseCommandController.setCommandName(java.lang.String),
BaseCommandController.setValidator(org.springframework.validation.Validator)

Field Summary
Fields inherited from class org.springframework.web.portlet.mvc.BaseCommandController
DEFAULT_COMMAND_NAME
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Constructor Summary
AbstractCommandController()
Deprecated. Create a new AbstractCommandController.
AbstractCommandController(Class commandClass)
Deprecated. Create a new AbstractCommandController.
AbstractCommandController(Class commandClass, String commandName)
Deprecated. Create a new AbstractCommandController.
Method Summary
protected String | getCommandInSessionParameterName() Deprecated. Return the name of the render parameter that indicates there is a valid command (and errors) object in the session.
protected abstract void | handleAction(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response, Object command, BindException errors) Deprecated. Template method for request handling, providing a populated and validated instance of the command class, and an Errors object containing binding and validation errors.
protected void | handleActionRequestInternal(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response) Deprecated. Subclasses are meant to override this method if the controller is expected to handle action requests.
protected abstract ModelAndView | handleRender(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response, Object command, BindException errors) Deprecated. Template method for render request handling, providing a populated and validated instance of the command class, and an Errors object containing binding and validation errors.
protected ModelAndView | handleRenderRequestInternal(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response) Deprecated. Subclasses are meant to override this method if the controller is expected to handle render requests.
protected boolean | isCommandInSession(javax.portlet.RenderRequest request) Deprecated. Determine if there is a valid command (and errors) object in the session for this render request.
protected void | setCommandInSession(javax.portlet.ActionResponse response) Deprecated. Set the action response parameter that indicates there is a command (and errors) object in the session for the render phase.
Methods inherited from class org.springframework.web.portlet.mvc.BaseCommandController
bindAndValidate, checkCommand, createBinder, createCommand, getBindingErrorProcessor, getCommand, getCommandClass, getCommandName, getMessageCodesResolver, getPropertyEditorRegistrars, getRenderCommand, getRenderCommandSessionAttributeName, getRenderErrors, getRenderErrorsSessionAttributeName, getValidator, getValidators, getWebBindingInitializer, initApplicationContext, initBinder, isValidateOnBinding, onBind, onBind, onBindAndValidate, prepareBinder, setBindingErrorProcessor, setCommandClass, setCommandName, setMessageCodesResolver, setPropertyEditorRegistrar, setPropertyEditorRegistrars, setRenderCommandAndErrors, setValidateOnBinding, setValidator, setValidators, setWebBindingInitializer, suppressBinding, suppressValidation, useDirectFieldAccess
Methods inherited from class org.springframework.web.portlet.mvc.AbstractController
handleActionRequest, handleRenderRequest, isRenderWhenMinimized, isSynchronizeOnSession, setRenderWhenMinimized, setSynchronizeOnSession
Methods inherited from class org.springframework.web.portlet.handler.PortletContentGenerator
applyCacheSeconds, cacheForSeconds, check, checkAndPrepare, checkAndPrepare, getCacheSeconds, isRequireSession, preventCaching, setCacheSeconds, setRequireSession
Methods inherited from class org.springframework.web.portlet.context.PortletApplicationObjectSupport
getPortletContext, getTempDir, isContextRequired, setPortletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractCommandController

public AbstractCommandController()
Deprecated.
Create a new AbstractCommandController.

AbstractCommandController

public AbstractCommandController(Class commandClass)
Deprecated.
Create a new AbstractCommandController.

Parameters:
commandClass - class of the command bean

AbstractCommandController

public AbstractCommandController(Class commandClass,
                                 String commandName)
Deprecated.
Create a new AbstractCommandController.

Parameters:
commandClass - class of the command bean
commandName - name of the command bean
Method Detail

handleActionRequestInternal

protected final void handleActionRequestInternal(javax.portlet.ActionRequest request,
                                                 javax.portlet.ActionResponse response)
                                          throws Exception
Deprecated.
Description copied from class: AbstractController
Subclasses are meant to override this method if the controller is expected to handle action requests. The contract is the same as for handleActionRequest.

The default implementation throws a PortletException.

Overrides:
handleActionRequestInternal in class AbstractController
Throws:
Exception
See Also:
AbstractController.handleActionRequest(javax.portlet.ActionRequest, javax.portlet.ActionResponse), AbstractController.handleRenderRequestInternal(javax.portlet.RenderRequest, javax.portlet.RenderResponse)

handleRenderRequestInternal

protected final ModelAndView handleRenderRequestInternal(javax.portlet.RenderRequest request,
                                                         javax.portlet.RenderResponse response)
                                                  throws Exception
Deprecated.
Description copied from class: AbstractController
Subclasses are meant to override this method if the controller is expected to handle render requests. The contract is the same as for handleRenderRequest.

The default implementation throws a PortletException.

Overrides:
handleRenderRequestInternal in class AbstractController
Throws:
Exception
See Also:
AbstractController.handleRenderRequest(javax.portlet.RenderRequest, javax.portlet.RenderResponse), AbstractController.handleActionRequestInternal(javax.portlet.ActionRequest, javax.portlet.ActionResponse)

handleAction

protected abstract void handleAction(javax.portlet.ActionRequest request,
                                     javax.portlet.ActionResponse response,
                                     Object command,
                                     BindException errors)
                              throws Exception
Deprecated.
Template method for request handling, providing a populated and validated instance of the command class, and an Errors object containing binding and validation errors.

Call errors.getModel() to populate the ModelAndView model with the command and the Errors instance, under the specified command name, as expected by the "spring:bind" tag.

Parameters:
request - current action request
response - current action response
command - the populated command object
errors - validation errors holder
Throws:
Exception
See Also:
Errors, BindException.getModel()

handleRender

protected abstract ModelAndView handleRender(javax.portlet.RenderRequest request,
                                             javax.portlet.RenderResponse response,
                                             Object command,
                                             BindException errors)
                                      throws Exception
Deprecated.
Template method for render request handling, providing a populated and validated instance of the command class, and an Errors object containing binding and validation errors.

Call errors.getModel() to populate the ModelAndView model with the command and the Errors instance, under the specified command name, as expected by the "spring:bind" tag.

Parameters:
request - current render request
response - current render response
command - the populated command object
errors - validation errors holder
Returns:
a ModelAndView to render, or null if handled directly
Throws:
Exception
See Also:
Errors, BindException.getModel()

getCommandInSessionParameterName

protected String getCommandInSessionParameterName()
Deprecated.
Return the name of the render parameter that indicates there is a valid command (and errors) object in the session.

Returns:
the name of the render parameter
See Also:
PortletRequest.getParameter(java.lang.String)

setCommandInSession

protected final void setCommandInSession(javax.portlet.ActionResponse response)
Deprecated.
Set the action response parameter that indicates there is a command (and errors) object in the session for the render phase.

Parameters:
response - the current action response
See Also:
getCommandInSessionParameterName(), isCommandInSession(javax.portlet.RenderRequest)

isCommandInSession

protected boolean isCommandInSession(javax.portlet.RenderRequest request)
Deprecated.
Determine if there is a valid command (and errors) object in the session for this render request.

Parameters:
request - current render request
Returns:
if there is a valid command object in the session
See Also:
getCommandInSessionParameterName(), setCommandInSession(javax.portlet.ActionResponse)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractController

org.springframework.web.portlet.mvc
Class AbstractController

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.portlet.context.PortletApplicationObjectSupport
            extended by  org.springframework.web.portlet.handler.PortletContentGenerator
                extended by  org.springframework.web.portlet.mvc.AbstractController
All Implemented Interfaces:
ApplicationContextAware, PortletContextAware, Controller
Direct Known Subclasses:
BaseCommandController, ParameterizableViewController, PortletWrappingController
public abstract class AbstractController
extends PortletContentGenerator
implements Controller

Convenient superclass for controller implementations, using the Template Method design pattern.

As stated in the Controller interface, a lot of functionality is already provided by certain abstract base controllers. The AbstractController is one of the most important abstract base controller providing basic features such controlling if a session is required and render caching.

Workflow (and that defined by interface):

  1. If this is an action request, handleActionRequest will be called by the DispatcherPortlet once to perform the action defined by this controller.
  2. If a session is required, try to get it (PortletException if not found).
  3. Call method handleActionRequestInternal, (optionally synchronizing around the call on the PortletSession), which should be overridden by extending classes to provide actual functionality to perform the desired action of the controller. This will be executed only once.
  4. For a straight render request, or the render phase of an action request (assuming the same controller is called for the render phase -- see tip below), handleRenderRequest will be called by the DispatcherPortlet repeatedly to render the display defined by this controller.
  5. If a session is required, try to get it (PortletException if none found).
  6. It will control caching as defined by the cacheSeconds property.
  7. Call method handleRenderRequestInternal, (optionally synchronizing around the call on the PortletSession), which should be overridden by extending classes to provide actual functionality to return ModelAndView objects. This will be executed repeatedly as the portal updates the current displayed page.

Exposed configuration properties (and those defined by interface):

name | default | description
requireSession | false | whether a session should be required for requests to be able to be handled by this controller. This ensures, derived controller can - without fear of Nullpointers - call request.getSession() to retrieve a session. If no session can be found while processing the request, a PortletException will be thrown
synchronizeOnSession | false | whether the calls to handleRenderRequestInternal and handleRenderRequestInternal should be synchronized around the PortletSession, to serialize invocations from the same client. No effect if there is no PortletSession.
cacheSeconds | -1 | indicates the amount of seconds to specify caching is allowed in the render response generatedby this request. 0 (zero) will indicate no caching is allowed at all, -1 (the default) will not override the portlet configuration and any positive number will cause the render response to declare the amount indicated as seconds to cache the content
renderWhenMinimized | false | whether should be rendered when the portlet is in a minimized state -- will return null for the ModelandView when the portlet is minimized and this is false

TIP: The controller mapping will be run twice by the PortletDispatcher for action requests -- once for the action phase and again for the render phase. You can reach the render phase of a different controller by simply changing the values for the criteria your mapping is using, such as portlet mode or a request parameter, during the action phase of your controller. This is very handy since redirects within the portlet are apparently impossible. Before doing this, it is usually wise to call clearAllRenderParameters and then explicitly set all the parameters that you want the new controller to see. This avoids unexpected parameters from being passed to the render phase of the second controller, such as the parameter indicating a form submit ocurred in an AbstractFormController.

Thanks to Rainer Schmitz and Nick Lothian for their suggestions!

Since:
2.0
Author:
John A. Lewis, Juergen Hoeller
See Also:
ResourceAwareController, EventAwareController

Field Summary
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Constructor Summary
AbstractController()
Method Summary
void | handleActionRequest(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response) Process the action request.
protected void | handleActionRequestInternal(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response) Subclasses are meant to override this method if the controller is expected to handle action requests.
ModelAndView | handleRenderRequest(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response) Process the render request and return a ModelAndView object which the DispatcherPortlet will render.
protected ModelAndView | handleRenderRequestInternal(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response) Subclasses are meant to override this method if the controller is expected to handle render requests.
boolean | isRenderWhenMinimized() Return whether controller will render when portlet is minimized.
boolean | isSynchronizeOnSession() Return whether controller execution should be synchronized on the session.
void | setRenderWhenMinimized(boolean renderWhenMinimized) Set if the controller should render an view when the portlet is in a minimized window.
void | setSynchronizeOnSession(boolean synchronizeOnSession) Set if controller execution should be synchronized on the session, to serialize parallel invocations from the same client.
Methods inherited from class org.springframework.web.portlet.handler.PortletContentGenerator
applyCacheSeconds, cacheForSeconds, check, checkAndPrepare, checkAndPrepare, getCacheSeconds, isRequireSession, preventCaching, setCacheSeconds, setRequireSession
Methods inherited from class org.springframework.web.portlet.context.PortletApplicationObjectSupport
getPortletContext, getTempDir, isContextRequired, setPortletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractController

public AbstractController()
Method Detail

setSynchronizeOnSession

public final void setSynchronizeOnSession(boolean synchronizeOnSession)
Set if controller execution should be synchronized on the session, to serialize parallel invocations from the same client.

More specifically, the execution of the handleActionRequestInternal method will get synchronized if this flag is "true". The best available session mutex will be used for the synchronization; ideally, this will be a mutex exposed by HttpSessionMutexListener.

The session mutex is guaranteed to be the same object during the entire lifetime of the session, available under the key defined by the SESSION_MUTEX_ATTRIBUTE constant. It serves as a safe reference to synchronize on for locking on the current session.

In many cases, the PortletSession reference itself is a safe mutex as well, since it will always be the same object reference for the same active logical session. However, this is not guaranteed across different servlet containers; the only 100% safe way is a session mutex.

See Also:
handleActionRequestInternal(javax.portlet.ActionRequest, javax.portlet.ActionResponse), HttpSessionMutexListener, PortletUtils.getSessionMutex(javax.portlet.PortletSession)

isSynchronizeOnSession

public final boolean isSynchronizeOnSession()
Return whether controller execution should be synchronized on the session.

setRenderWhenMinimized

public final void setRenderWhenMinimized(boolean renderWhenMinimized)
Set if the controller should render an view when the portlet is in a minimized window. The default is false.

See Also:
PortletRequest.getWindowState(), WindowState.MINIMIZED

isRenderWhenMinimized

public final boolean isRenderWhenMinimized()
Return whether controller will render when portlet is minimized.

handleActionRequest

public void handleActionRequest(javax.portlet.ActionRequest request,
                                javax.portlet.ActionResponse response)
                         throws Exception
Description copied from interface: Controller
Process the action request. There is nothing to return.

Specified by:
handleActionRequest in interface Controller
Parameters:
request - current portlet action request
response - current portlet action response
Throws:
Exception - in case of errors

handleRenderRequest

public ModelAndView handleRenderRequest(javax.portlet.RenderRequest request,
                                        javax.portlet.RenderResponse response)
                                 throws Exception
Description copied from interface: Controller
Process the render request and return a ModelAndView object which the DispatcherPortlet will render. A null return value is not an error: It indicates that this object completed request processing itself, thus there is no ModelAndView to render.

Specified by:
handleRenderRequest in interface Controller
Parameters:
request - current portlet render request
response - current portlet render response
Returns:
a ModelAndView to render, or null if handled directly
Throws:
Exception - in case of errors

handleActionRequestInternal

protected void handleActionRequestInternal(javax.portlet.ActionRequest request,
                                           javax.portlet.ActionResponse response)
                                    throws Exception
Subclasses are meant to override this method if the controller is expected to handle action requests. The contract is the same as for handleActionRequest.

The default implementation throws a PortletException.

Throws:
Exception
See Also:
handleActionRequest(javax.portlet.ActionRequest, javax.portlet.ActionResponse), handleRenderRequestInternal(javax.portlet.RenderRequest, javax.portlet.RenderResponse)

handleRenderRequestInternal

protected ModelAndView handleRenderRequestInternal(javax.portlet.RenderRequest request,
                                                   javax.portlet.RenderResponse response)
                                            throws Exception
Subclasses are meant to override this method if the controller is expected to handle render requests. The contract is the same as for handleRenderRequest.

The default implementation throws a PortletException.

Throws:
Exception
See Also:
handleRenderRequest(javax.portlet.RenderRequest, javax.portlet.RenderResponse), handleActionRequestInternal(javax.portlet.ActionRequest, javax.portlet.ActionResponse)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractFormController

org.springframework.web.portlet.mvc
Class AbstractFormController

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.portlet.context.PortletApplicationObjectSupport
            extended by  org.springframework.web.portlet.handler.PortletContentGenerator
                extended by  org.springframework.web.portlet.mvc.AbstractController
                    extended by  org.springframework.web.portlet.mvc.BaseCommandController
                        extended by  org.springframework.web.portlet.mvc.AbstractFormController
All Implemented Interfaces:
ApplicationContextAware, PortletContextAware, Controller
Direct Known Subclasses:
AbstractWizardFormController, SimpleFormController
Deprecated. as of Spring 3.0, in favor of annotated controllers

@Deprecated
public abstract class AbstractFormController
extends BaseCommandController

Form controller that auto-populates a form bean from the request. This, either using a new bean instance per request, or using the same bean when the sessionForm property has been set to true.

This class is the base class for both framework subclasses such as SimpleFormController and AbstractWizardFormController and custom form controllers that you may provide yourself.

A form-input view and an after-submission view have to be provided programmatically. To provide those views using configuration properties, use the SimpleFormController.

Subclasses need to override showForm to prepare the form view, processFormSubmission to handle submit requests, and renderFormSubmission to display the results of the submit. For the latter two methods, binding errors like type mismatches will be reported via the given "errors" holder. For additional custom form validation, a validator (property inherited from BaseCommandController) can be used, reporting via the same "errors" instance.

Comparing this Controller to the Struts notion of the Action shows us that with Spring, you can use any ordinary JavaBeans or database- backed JavaBeans without having to implement a framework-specific class (like Struts' ActionForm). More complex properties of JavaBeans (Dates, Locales, but also your own application-specific or compound types) can be represented and submitted to the controller, by using the notion of a java.beans.PropertyEditors. For more information on that subject, see the workflow of this controller and the explanation of the BaseCommandController.

This controller is different from it's servlet counterpart in that it must take into account the two phases of a portlet request: the action phase and the render phase. See the JSR-168 spec for more details on these two phases. Be especially aware that the action phase is called only once, but that the render phase will be called repeatedly by the portal; it does this every time the page containing the portlet is updated, even if the activity is in some other portlet. (This is not quite true, the portal can also be told to cache the results of the render for a period of time, but assume it is true for programming purposes.)

Workflow (and that defined by superclass):

  1. The controller receives a request for a new form (typically a Render Request only). The render phase will proceed to display the form as follows.
  2. Call to formBackingObject() which by default, returns an instance of the commandClass that has been configured (see the properties the superclass exposes), but can also be overridden to e.g. retrieve an object from the database (that needs to be modified using the form).
  3. Call to initBinder() which allows you to register custom editors for certain fields (often properties of non- primitive or non-String types) of the command class. This will render appropriate Strings for those property values, e.g. locale-specific date strings.
  4. The PortletRequestDataBinder gets applied to populate the new form object with initial request parameters and the onBindOnNewForm(RenderRequest, Object, BindException) callback method is invoked. (only if bindOnNewForm is set to true) Make sure that the initial parameters do not include the parameter that indicates a form submission has occurred.
  5. Call to showForm to return a View that should be rendered (typically the view that renders the form). This method has to be implemented in subclasses.
  6. The showForm() implementation will call referenceData, which you can implement to provide any relevant reference data you might need when editing a form (e.g. a List of Locale objects you're going to let the user select one from).
  7. Model gets exposed and view gets rendered, to let the user fill in the form.
  8. The controller receives a form submission (typically an Action Request). To use a different way of detecting a form submission, override the isFormSubmission method. The action phase will proceed to process the form submission as follows.
  9. If sessionForm is not set, formBackingObject is called to retrieve a form object. Otherwise, the controller tries to find the command object which is already bound in the session. If it cannot find the object, the action phase does a call to handleInvalidSubmit which - by default - tries to create a new form object and resubmit the form. It then sets a render parameter that will indicate to the render phase that this was an invalid submit.
  10. Still in the action phase of a valid submit, the PortletRequestDataBinder gets applied to populate the form object with current request parameters.
  11. Call to onBind(PortletRequest, Object, Errors) which allows you to do custom processing after binding but before validation (e.g. to manually bind request parameters to bean properties, to be seen by the Validator).
  12. If validateOnBinding is set, a registered Validator will be invoked. The Validator will check the form object properties, and register corresponding errors via the given Errors object.
  13. Call to onBindAndValidate which allows you to do custom processing after binding and validation (e.g. to manually bind request parameters, and to validate them outside a Validator).
  14. Call to processFormSubmission to process the submission, with or without binding errors. This method has to be implemented in subclasses and will be called only once per form submission.
  15. The portal will then call the render phase of processing the form submission. This phase will be called repeatedly by the portal every time the page is refreshed. All processing here should take this into account. Any one-time-only actions (such as modifying a database) must be done in the action phase.
  16. If the action phase indicated this is an invalid submit, the render phase calls renderInvalidSubmit which – also by default – will render the results of the resubmitted form. Be sure to override both handleInvalidSubmit and renderInvalidSubmit if you want to change this overall behavior.
  17. Finally, call renderFormSubmission to render the results of the submission, with or without binding errors. This method has to be implemented in subclasses and will be called repeatedly by the portal.

In session form mode, a submission without an existing form object in the session is considered invalid, like in the case of a resubmit/reload by the browser. The handleInvalidSubmit / renderInvalidSubmit methods are invoked then, by default trying to resubmit. This can be overridden in subclasses to show corresponding messages or to redirect to a new form, in order to avoid duplicate submissions. The form object in the session can be considered a transaction token in that case.

Make sure that any URLs that take you to your form controller are Render URLs, so that it will not try to treat the initial call as a form submission. If you use action URLs to link to your controller, you will need to override the isFormSubmission method to use a different mechanism for determining whether a form has been submitted. Make sure this method will work for both the ActionRequest and the RenderRequest objects.

Note that views should never retrieve form beans from the session but always from the request, as prepared by the form controller. Remember that some view technologies like Velocity cannot even access a HTTP session.

Exposed configuration properties (and those defined by superclass):

name | default | description
bindOnNewForm | false | Indicates whether to bind portlet request parameters when creating a new form. Otherwise, the parameters will only be bound on form submission attempts.
sessionForm | false | Indicates whether the form object should be kept in the session when a user asks for a new form. This allows you e.g. to retrieve an object from the database, let the user edit it, and then persist it again. Otherwise, a new command object will be created for each request (even when showing the form again after validation errors).
redirectAction | false | Specifies whether processFormSubmission is expected to call ActionResponse.sendRedirect. This is important because some methods may not be called before ActionResponse.sendRedirect (e.g. ActionResponse.setRenderParameter). Setting this flag will prevent AbstractFormController from setting render parameters that it normally needs for the render phase. If this is set true and sendRedirect is not called, then processFormSubmission must call setFormSubmit. Otherwise, the render phase will not realize the form was submitted and will simply display a new blank form.
renderParameters | null | An array of parameters that will be passed forward from the action phase to the render phase if the form needs to be displayed again. These can also be passed forward explicitly by calling the passRenderParameters method from any action phase method. Abstract descendants of this controller should follow similar behavior. If there are parameters you need in renderFormSubmission, then you need to pass those forward from processFormSubmission. If you override the default behavior of invalid submits and you set sessionForm to true, then you probably will not need to set this because your parameters are only going to be needed on the first request.

Thanks to Rainer Schmitz and Nick Lothian for their suggestions!

Since:
2.0
Author:
John A. Lewis, Juergen Hoeller, Alef Arendsen, Rob Harrop
See Also:
showForm(RenderRequest, RenderResponse, BindException), SimpleFormController, AbstractWizardFormController

Field Summary
Fields inherited from class org.springframework.web.portlet.mvc.BaseCommandController
DEFAULT_COMMAND_NAME
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Constructor Summary
AbstractFormController()
Deprecated. Create a new AbstractFormController.
Method Summary
protected  Object formBackingObject(javax.portlet.PortletRequest request)
Deprecated. Retrieve a backing object for the current form from the given request.
protected  Object getCommand(javax.portlet.PortletRequest request)
Deprecated. Return the form object for the given request.
protected  BindException getErrorsForNewForm(javax.portlet.RenderRequest request)
Deprecated. Create a BindException instance for a new form.
protected  String getFormSessionAttributeName()
Deprecated. Return the name of the PortletSession attribute that holds the form object for this form controller.
protected  String getFormSessionAttributeName(javax.portlet.PortletRequest request)
Deprecated. Return the name of the PortletSession attribute that holds the form object for this form controller.
protected  String getFormSubmitParameterName()
Deprecated. Return the name of the render parameter that indicates this was a form submission.
protected  String getInvalidSubmitParameterName()
Deprecated. Return the name of the render parameter that indicates this was an invalid form submission.
 String[] getRenderParameters()
Deprecated. Returns the list of parameters that will be passed forward from the action phase to the render phase whenever the form is rerendered or when passRenderParameters(javax.portlet.ActionRequest, javax.portlet.ActionResponse) is called.
protected  void handleActionRequestInternal(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response)
Deprecated. Handles action phase of two cases: form submissions and showing a new form.
protected  void handleInvalidSubmit(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response)
Deprecated. Handle an invalid submit request, e.g.
protected  ModelAndView handleRenderRequestInternal(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
Deprecated. Handles render phase of two cases: form submissions and showing a new form.
 boolean isBindOnNewForm()
Deprecated. Return if request parameters should be bound in case of a new form.
protected  boolean isFormSubmission(javax.portlet.PortletRequest request)
Deprecated. Determine if the given request represents a form submission.
protected  boolean isInvalidSubmission(javax.portlet.PortletRequest request)
Deprecated. Determine if the given request represents an invalid form submission.
 boolean isRedirectAction()
Deprecated. Return if ActionResponse.sendRedirect(java.lang.String) is expected to be called in the action phase.
 boolean isSessionForm()
Deprecated. Return if session form mode is activated.
protected  void onBindOnNewForm(javax.portlet.RenderRequest request, Object command)
Deprecated. Callback for custom post-processing in terms of binding for a new form.
protected  void onBindOnNewForm(javax.portlet.RenderRequest request, Object command, BindException errors)
Deprecated. Callback for custom post-processing in terms of binding for a new form.
protected  void passRenderParameters(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response)
Deprecated. Pass the specified list of action request parameters to the render phase by putting them into the action response object.
protected abstract  void processFormSubmission(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response, Object command, BindException errors)
Deprecated. Process action phase of form submission request.
protected  Map referenceData(javax.portlet.PortletRequest request, Object command, Errors errors)
Deprecated. Create a reference data map for the given request, consisting of bean name/bean instance pairs as expected by ModelAndView.
protected abstract  ModelAndView renderFormSubmission(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response, Object command, BindException errors)
Deprecated. Process render phase of form submission request.
protected  ModelAndView renderInvalidSubmit(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
Deprecated. Handle an invalid submit request, e.g.
 void setBindOnNewForm(boolean bindOnNewForm)
Deprecated. Set if request parameters should be bound to the form object in case of a non-submitting request, i.e.
protected  void setFormSubmit(javax.portlet.ActionResponse response)
Deprecated. Set the action response parameter that indicates this in a form submission.
protected  void setInvalidSubmit(javax.portlet.ActionResponse response)
Deprecated. Set the action response parameter that indicates this in an invalid submission.
 void setRedirectAction(boolean redirectAction)
Deprecated. Specify whether the action phase is expected to call ActionResponse.sendRedirect(java.lang.String).
 void setRenderParameters(String[] parameters)
Deprecated. Specify the list of parameters that should be passed forward from the action phase to the render phase whenever the form is re-rendered or when passRenderParameters(javax.portlet.ActionRequest, javax.portlet.ActionResponse) is called.
 void setSessionForm(boolean sessionForm)
Deprecated. Activate/deactivate session form mode.
protected  ModelAndView showForm(javax.portlet.RenderRequest request, BindException errors, String viewName)
Deprecated. Prepare model and view for the given form, including reference and errors.
protected  ModelAndView showForm(javax.portlet.RenderRequest request, BindException errors, String viewName, Map controlModel)
Deprecated. Prepare model and view for the given form, including reference and errors, adding a controller-specific control model.
protected abstract  ModelAndView showForm(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response, BindException errors)
Deprecated. Prepare the form model and view, including reference and error data.
protected  ModelAndView showNewForm(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
Deprecated. Show a new form.
Methods inherited from class org.springframework.web.portlet.mvc.BaseCommandController
bindAndValidate, checkCommand, createBinder, createCommand, getBindingErrorProcessor, getCommandClass, getCommandName, getMessageCodesResolver, getPropertyEditorRegistrars, getRenderCommand, getRenderCommandSessionAttributeName, getRenderErrors, getRenderErrorsSessionAttributeName, getValidator, getValidators, getWebBindingInitializer, initApplicationContext, initBinder, isValidateOnBinding, onBind, onBind, onBindAndValidate, prepareBinder, setBindingErrorProcessor, setCommandClass, setCommandName, setMessageCodesResolver, setPropertyEditorRegistrar, setPropertyEditorRegistrars, setRenderCommandAndErrors, setValidateOnBinding, setValidator, setValidators, setWebBindingInitializer, suppressBinding, suppressValidation, useDirectFieldAccess
Methods inherited from class org.springframework.web.portlet.mvc.AbstractController
handleActionRequest, handleRenderRequest, isRenderWhenMinimized, isSynchronizeOnSession, setRenderWhenMinimized, setSynchronizeOnSession
Methods inherited from class org.springframework.web.portlet.handler.PortletContentGenerator
applyCacheSeconds, cacheForSeconds, check, checkAndPrepare, checkAndPrepare, getCacheSeconds, isRequireSession, preventCaching, setCacheSeconds, setRequireSession
Methods inherited from class org.springframework.web.portlet.context.PortletApplicationObjectSupport
getPortletContext, getTempDir, isContextRequired, setPortletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractFormController

public AbstractFormController()
Deprecated.
Create a new AbstractFormController.

Subclasses should set the following properties, either in the constructor or via a BeanFactory: commandName, commandClass, bindOnNewForm, sessionForm. Note that commandClass doesn't need to be set when overriding formBackingObject, as the latter determines the class anyway.

"cacheSeconds" is by default set to 0 (-> no caching for all form controllers).

See Also:
BaseCommandController.setCommandName(java.lang.String), BaseCommandController.setCommandClass(java.lang.Class), setBindOnNewForm(boolean), setSessionForm(boolean), formBackingObject(javax.portlet.PortletRequest)
Method Detail

setBindOnNewForm

public final void setBindOnNewForm(boolean bindOnNewForm)
Deprecated.
Set if request parameters should be bound to the form object in case of a non-submitting request, i.e. a new form.

isBindOnNewForm

public final boolean isBindOnNewForm()
Deprecated.
Return if request parameters should be bound in case of a new form.

setSessionForm

public final void setSessionForm(boolean sessionForm)
Deprecated.
Activate/deactivate session form mode. In session form mode, the form is stored in the session to keep the form object instance between requests, instead of creating a new one on each request.

This is necessary for either wizard-style controllers that populate a single form object from multiple pages, or forms that populate a persistent object that needs to be identical to allow for tracking changes.

isSessionForm

public final boolean isSessionForm()
Deprecated.
Return if session form mode is activated.

setRedirectAction

public void setRedirectAction(boolean redirectAction)
Deprecated.
Specify whether the action phase is expected to call ActionResponse.sendRedirect(java.lang.String). This information is important because some methods may not be called before ActionResponse.sendRedirect(java.lang.String), e.g. StateAwareResponse.setRenderParameter(java.lang.String, java.lang.String) and StateAwareResponse.setRenderParameters(java.util.Map).

NOTE: Call this at initialization time of your controller: either in the constructor or in the bean definition for your controller.

See Also:
ActionResponse.sendRedirect(java.lang.String)

isRedirectAction

public boolean isRedirectAction()
Deprecated.
Return if ActionResponse.sendRedirect(java.lang.String) is expected to be called in the action phase.

setRenderParameters

public void setRenderParameters(String[] parameters)
Deprecated.
Specify the list of parameters that should be passed forward from the action phase to the render phase whenever the form is re-rendered or when passRenderParameters(javax.portlet.ActionRequest, javax.portlet.ActionResponse) is called.

See Also:
passRenderParameters(javax.portlet.ActionRequest, javax.portlet.ActionResponse)

getRenderParameters

public String[] getRenderParameters()
Deprecated.
Returns the list of parameters that will be passed forward from the action phase to the render phase whenever the form is rerendered or when passRenderParameters(javax.portlet.ActionRequest, javax.portlet.ActionResponse) is called.

Returns:
the list of parameters
See Also:
passRenderParameters(javax.portlet.ActionRequest, javax.portlet.ActionResponse)

handleActionRequestInternal

protected void handleActionRequestInternal(javax.portlet.ActionRequest request,
                                           javax.portlet.ActionResponse response)
                                    throws Exception
Deprecated.
Handles action phase of two cases: form submissions and showing a new form. Delegates the decision between the two to isFormSubmission, always treating requests without existing form session attribute as new form when using session form mode.

Overrides:
handleActionRequestInternal in class AbstractController
Throws:
Exception
See Also:
isFormSubmission(javax.portlet.PortletRequest),
processFormSubmission(javax.portlet.ActionRequest, javax.portlet.ActionResponse, java.lang.Object, org.springframework.validation.BindException),
handleRenderRequestInternal(javax.portlet.RenderRequest, javax.portlet.RenderResponse)

handleRenderRequestInternal

protected ModelAndView handleRenderRequestInternal(javax.portlet.RenderRequest request,
                                                   javax.portlet.RenderResponse response)
                                            throws Exception
Deprecated.
Handles render phase of two cases: form submissions and showing a new form. Delegates the decision between the two to isFormSubmission, always treating requests without existing form session attribute as new form when using session form mode.

Overrides:
handleRenderRequestInternal in class AbstractController
Throws:
Exception
See Also:
isFormSubmission(javax.portlet.PortletRequest),
showNewForm(javax.portlet.RenderRequest, javax.portlet.RenderResponse),
processFormSubmission(javax.portlet.ActionRequest, javax.portlet.ActionResponse, java.lang.Object, org.springframework.validation.BindException),
handleActionRequestInternal(javax.portlet.ActionRequest, javax.portlet.ActionResponse)

isFormSubmission

protected boolean isFormSubmission(javax.portlet.PortletRequest request)
Deprecated.
Determine if the given request represents a form submission.

The default implementation checks to see if this is an ActionRequest and treats all action requests as form submission. During the action phase it will pass forward a render parameter to indicate to the render phase that this is a form submission. This method can check both kinds of requests and indicate if this is a form submission.

Subclasses can override this to use a custom strategy, e.g. a specific request parameter (assumably a hidden field or submit button name). Make sure that the override can handle both ActionRequest and RenderRequest objects properly.

Parameters:
request - current request
Returns:
if the request represents a form submission

isInvalidSubmission

protected boolean isInvalidSubmission(javax.portlet.PortletRequest request)
Deprecated.
Determine if the given request represents an invalid form submission.

getFormSubmitParameterName

protected String getFormSubmitParameterName()
Deprecated.
Return the name of the render parameter that indicates this was a form submission.

Returns:
the name of the render parameter
See Also:
PortletRequest.getParameter(java.lang.String)

getInvalidSubmitParameterName

protected String getInvalidSubmitParameterName()
Deprecated.
Return the name of the render parameter that indicates this was an invalid form submission.

Returns:
the name of the render parameter
See Also:
PortletRequest.getParameter(java.lang.String)

setFormSubmit

protected final void setFormSubmit(javax.portlet.ActionResponse response)
Deprecated.
Set the action response parameter that indicates this in a form submission.

Parameters:
response - the current action response
See Also:
getFormSubmitParameterName()

setInvalidSubmit

protected final void setInvalidSubmit(javax.portlet.ActionResponse response)
Deprecated.
Set the action response parameter that indicates this in an invalid submission.

Parameters:
response - the current action response
See Also:
getInvalidSubmitParameterName()

getFormSessionAttributeName

protected String getFormSessionAttributeName(javax.portlet.PortletRequest request)
Deprecated.
Return the name of the PortletSession attribute that holds the form object for this form controller.

The default implementation delegates to the getFormSessionAttributeName version without arguments.

Parameters:
request - current HTTP request
Returns:
the name of the form session attribute, or null if not in session form mode
See Also:
getFormSessionAttributeName(), PortletSession.getAttribute(java.lang.String)

getFormSessionAttributeName

protected String getFormSessionAttributeName()
Deprecated.
Return the name of the PortletSession attribute that holds the form object for this form controller.

Default is an internal name, of no relevance to applications, as the form session attribute is not usually accessed directly. Can be overridden to use an application-specific attribute name, which allows other code to access the session attribute directly.

Returns:
the name of the form session attribute
See Also:
PortletSession.getAttribute(java.lang.String)

passRenderParameters

protected void passRenderParameters(javax.portlet.ActionRequest request,
                                    javax.portlet.ActionResponse response)
Deprecated.
Pass the specified list of action request parameters to the render phase by putting them into the action response object. This may not be called when the action will call will call sendRedirect.

Parameters:
request - the current action request
response - the current action response
See Also:
StateAwareResponse.setRenderParameter(java.lang.String, java.lang.String)

showNewForm

protected final ModelAndView showNewForm(javax.portlet.RenderRequest request,
                                         javax.portlet.RenderResponse response)
                                  throws Exception
Deprecated.
Show a new form. Prepares a backing object for the current form and the given request, including checking its validity.

Parameters:
request - current render request
response - current render response
Returns:
the prepared form view
Throws:
Exception - in case of an invalid new form object
See Also:
getErrorsForNewForm(javax.portlet.RenderRequest)

getErrorsForNewForm

protected final BindException getErrorsForNewForm(javax.portlet.RenderRequest request)
                                           throws Exception
Deprecated.
Create a BindException instance for a new form. Called by showNewForm.

Can be used directly when intending to show a new form but with special errors registered on it (for example, on invalid submit). Usually, the resulting BindException will be passed to showForm, after registering the errors on it.

Parameters:
request - current render request
Returns:
the BindException instance
Throws:
Exception - in case of an invalid new form object

onBindOnNewForm

protected void onBindOnNewForm(javax.portlet.RenderRequest request,
                               Object command,
                               BindException errors)
                        throws Exception
Deprecated.
Callback for custom post-processing in terms of binding for a new form. Called when preparing a new form if bindOnNewForm is true.

Default implementation delegates to onBindOnNewForm(request, command).

Parameters:
request - current render request
command - the command object to perform further binding on
errors - validation errors holder, allowing for additional custom registration of binding errors
Throws:
Exception - in case of invalid state or arguments
See Also:
onBindOnNewForm(RenderRequest, Object), setBindOnNewForm(boolean)

onBindOnNewForm

protected void onBindOnNewForm(javax.portlet.RenderRequest request,
                               Object command)
                        throws Exception
Deprecated.
Callback for custom post-processing in terms of binding for a new form. Called by the default implementation of the onBindOnNewForm version with all parameters, after standard binding when displaying the form view. Only called if bindOnNewForm is set to true.

The default implementation is empty.

Parameters:
request - current render request
command - the command object to perform further binding on
Throws:
Exception - in case of invalid state or arguments
See Also:
onBindOnNewForm(RenderRequest, Object, BindException), setBindOnNewForm(boolean)

getCommand

protected final Object getCommand(javax.portlet.PortletRequest request)
                           throws Exception
Deprecated.
Return the form object for the given request.

Calls formBackingObject if the object is not in the session

Overrides:
getCommand in class BaseCommandController
Parameters:
request - current request
Returns:
object form to bind onto
Throws:
Exception
See Also:
formBackingObject(javax.portlet.PortletRequest)

formBackingObject

protected Object formBackingObject(javax.portlet.PortletRequest request)
                            throws Exception
Deprecated.
Retrieve a backing object for the current form from the given request.

The properties of the form object will correspond to the form field values in your form view. This object will be exposed in the model under the specified command name, to be accessed under that name in the view: for example, with a "spring:bind" tag. The default command name is "command".

Note that you need to activate session form mode to reuse the form-backing object across the entire form workflow. Else, a new instance of the command class will be created for each submission attempt, just using this backing object as template for the initial form.

The default implementation calls BaseCommandController.createCommand, creating a new empty instance of the command class. Subclasses can override this to provide a preinitialized backing object.

Parameters:
request - current portlet request
Returns:
the backing object
Throws:
Exception - in case of invalid state or arguments
See Also:
BaseCommandController.setCommandName(java.lang.String),
BaseCommandController.setCommandClass(java.lang.Class),
BaseCommandController.createCommand()

showForm

protected abstract ModelAndView showForm(javax.portlet.RenderRequest request,
                                         javax.portlet.RenderResponse response,
                                         BindException errors)
                                  throws Exception
Deprecated.
Prepare the form model and view, including reference and error data. Can show a configured form page, or generate a form view programmatically.

A typical implementation will call showForm(request, errors, "myView") to prepare the form view for a specific view name, returning the ModelAndView provided there.

For building a custom ModelAndView, call errors.getModel() to populate the ModelAndView model with the command and the Errors instance, under the specified command name, as expected by the "spring:bind" tag. You also need to include the model returned by referenceData.

Note: If you decide to have a "formView" property specifying the view name, consider using SimpleFormController.

Parameters:
request - current render request
response - current render response
errors - validation errors holder
Returns:
the prepared form view, or null if handled directly
Throws:
Exception - in case of invalid state or arguments
See Also:
showForm(RenderRequest, BindException, String),
Errors,
BindException.getModel(),
referenceData(PortletRequest, Object, Errors),
SimpleFormController.setFormView(java.lang.String)

showForm

protected final ModelAndView showForm(javax.portlet.RenderRequest request,
                                      BindException errors,
                                      String viewName)
                               throws Exception
Deprecated.
Prepare model and view for the given form, including reference and errors.

In session form mode: Re-puts the form object in the session when returning to the form, as it has been removed by getCommand.

Can be used in subclasses to redirect back to a specific form page.

Parameters:
request - current render request
errors - validation errors holder
viewName - name of the form view
Returns:
the prepared form view
Throws:
Exception - in case of invalid state or arguments
See Also:
showForm(RenderRequest, BindException, String, Map), showForm(RenderRequest, RenderResponse, BindException)

showForm

protected final ModelAndView showForm(javax.portlet.RenderRequest request,
                                      BindException errors,
                                      String viewName,
                                      Map controlModel)
                               throws Exception
Deprecated.
Prepare model and view for the given form, including reference and errors, adding a controller-specific control model.

In session form mode: Re-puts the form object in the session when returning to the form, as it has been removed by getCommand.

Can be used in subclasses to redirect back to a specific form page.

Parameters:
request - current render request
errors - validation errors holder
viewName - name of the form view
controlModel - model map containing controller-specific control data (e.g. current page in wizard-style controllers or special error message)
Returns:
the prepared form view
Throws:
Exception - in case of invalid state or arguments
See Also:
showForm(RenderRequest, BindException, String), showForm(RenderRequest, RenderResponse, BindException)

referenceData

protected Map referenceData(javax.portlet.PortletRequest request,
                            Object command,
                            Errors errors)
                     throws Exception
Deprecated.
Create a reference data map for the given request, consisting of bean name/bean instance pairs as expected by ModelAndView.

The default implementation returns null. Subclasses can override this to set reference data used in the view.

Parameters:
request - current render request
command - form object with request parameters bound onto it
errors - validation errors holder
Returns:
a Map with reference data entries, or null if none
Throws:
Exception - in case of invalid state or arguments
See Also:
ModelAndView

renderFormSubmission

protected abstract ModelAndView renderFormSubmission(javax.portlet.RenderRequest request,
                                                     javax.portlet.RenderResponse response,
                                                     Object command,
                                                     BindException errors)
                                              throws Exception
Deprecated.
Process render phase of form submission request. Called by handleRequestInternal in case of a form submission, with or without binding errors. Implementations need to proceed properly, typically showing a form view in case of binding errors or rendering the result of a submit action else.

For a success view, call errors.getModel() to populate the ModelAndView model with the command and the Errors instance, under the specified command name, as expected by the "spring:bind" tag. For a form view, simply return the ModelAndView object privded by showForm.

Parameters:
request - current render request
response - current render response
command - form object with request parameters bound onto it
errors - errors holder
Returns:
the prepared model and view, or null
Throws:
Exception - in case of errors
See Also:
handleRenderRequestInternal(javax.portlet.RenderRequest, javax.portlet.RenderResponse),
processFormSubmission(javax.portlet.ActionRequest, javax.portlet.ActionResponse, java.lang.Object, org.springframework.validation.BindException),
isFormSubmission(javax.portlet.PortletRequest),
showForm(RenderRequest, RenderResponse, BindException),
Errors,
BindException.getModel()

processFormSubmission

protected abstract void processFormSubmission(javax.portlet.ActionRequest request,
                                              javax.portlet.ActionResponse response,
                                              Object command,
                                              BindException errors)
                                       throws Exception
Deprecated.
Process action phase of form submission request. Called by handleRequestInternal in case of a form submission, with or without binding errors. Implementations need to proceed properly, typically performing a submit action if there are no binding errors.

Subclasses can implement this to provide custom submission handling like triggering a custom action. They can also provide custom validation or proceed with the submission accordingly.

Parameters:
request - current action request
response - current action response
command - form object with request parameters bound onto it
errors - errors holder (subclass can add errors if it wants to)
Throws:
Exception - in case of errors
See Also:
handleActionRequestInternal(javax.portlet.ActionRequest, javax.portlet.ActionResponse),
renderFormSubmission(javax.portlet.RenderRequest, javax.portlet.RenderResponse, java.lang.Object, org.springframework.validation.BindException),
isFormSubmission(javax.portlet.PortletRequest),
Errors

renderInvalidSubmit

protected ModelAndView renderInvalidSubmit(javax.portlet.RenderRequest request,
                                           javax.portlet.RenderResponse response)
                                    throws Exception
Deprecated.
Handle an invalid submit request, e.g. when in session form mode but no form object was found in the session (like in case of an invalid resubmit by the browser).

The default implementation simply tries to resubmit the form with a new form object. This should also work if the user hit the back button, changed some form data, and resubmitted the form.

Note: To avoid duplicate submissions, you need to override this method. Either show some "invalid submit" message, or call showNewForm for resetting the form (prepopulating it with the current values if "bindOnNewForm" is true). In this case, the form object in the session serves as transaction token.

 protected ModelAndView renderInvalidSubmit(RenderRequest request, RenderResponse response) throws Exception {
   return showNewForm(request, response);
 }
You can also show a new form but with special errors registered on it:
 protected ModelAndView renderInvalidSubmit(RenderRequest request, RenderResponse response) throws Exception {
   BindException errors = getErrorsForNewForm(request);
   errors.reject("duplicateFormSubmission", "Duplicate form submission");
   return showForm(request, response, errors);
 }

WARNING: If you override this method, be sure to also override the action phase version of this method so that it will not attempt to perform the resubmit action by default.

Parameters:
request - current render request
response - current render response
Returns:
a prepared view, or null if handled directly
Throws:
Exception - in case of errors
See Also:
handleInvalidSubmit(javax.portlet.ActionRequest, javax.portlet.ActionResponse)

handleInvalidSubmit

protected void handleInvalidSubmit(javax.portlet.ActionRequest request,
                                   javax.portlet.ActionResponse response)
                            throws Exception
Deprecated.
Handle an invalid submit request, e.g. when in session form mode but no form object was found in the session (like in case of an invalid resubmit by the browser).

The default implementation simply tries to resubmit the form with a new form object. This should also work if the user hit the back button, changed some form data, and resubmitted the form.

Note: To avoid duplicate submissions, you need to override this method. Most likely you will simply want it to do nothing here in the action phase and diplay an appropriate error and a new form in the render phase.

 protected void handleInvalidSubmit(ActionRequest request, ActionResponse response) throws Exception {
 }

If you override this method but you do need a command object and bind errors in the render phase, be sure to call setRenderCommandAndErrors from here.

Parameters:
request - current action request
response - current action response
Throws:
Exception - in case of errors
See Also:
renderInvalidSubmit(javax.portlet.RenderRequest, javax.portlet.RenderResponse), BaseCommandController.setRenderCommandAndErrors(javax.portlet.ActionRequest, java.lang.Object, org.springframework.validation.BindException)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractWizardFormController

org.springframework.web.portlet.mvc
Class AbstractWizardFormController

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.portlet.context.PortletApplicationObjectSupport
            extended by  org.springframework.web.portlet.handler.PortletContentGenerator
                extended by  org.springframework.web.portlet.mvc.AbstractController
                    extended by  org.springframework.web.portlet.mvc.BaseCommandController
                        extended by  org.springframework.web.portlet.mvc.AbstractFormController
                            extended by  org.springframework.web.portlet.mvc.AbstractWizardFormController
All Implemented Interfaces:
ApplicationContextAware, PortletContextAware, Controller
Deprecated. as of Spring 3.0, in favor of annotated controllers

@Deprecated
public abstract class AbstractWizardFormController
extends AbstractFormController

Form controller for typical wizard-style workflows.

In contrast to classic forms, wizards have more than one form view page. Therefore, there are various actions instead of one single submit action:

  • finish: trying to leave the wizard successfully, i.e. performing its final action, and thus needing a valid state;
  • cancel: leaving the wizard without performing its final action, and thus without regard to the validity of its current state;
  • page change: showing another wizard page, e.g. the next or previous one, with regard to "dirty back" and "dirty forward".

Finish and cancel actions can be triggered by request parameters, named PARAM_FINISH ("_finish") and PARAM_CANCEL ("_cancel"), ignoring parameter values to allow for HTML buttons. The target page for page changes can be specified by PARAM_TARGET, appending the page number to the parameter name (e.g. "_target1"). The action parameters are recognized when triggered by image buttons too (via "_finish.x", "_abort.x", or "_target1.x").

The current page number will be stored in the session. It can also be specified as request parameter PARAM_PAGE ("_page") in order to properly handle usage of the back button in a browser: In this case, a submission will always contain the correct page number, even if the user submitted from an old view.

The page can only be changed if it validates correctly, except if a "dirty back" or "dirty forward" is allowed. At finish, all pages get validated again to guarantee a consistent state.

Note that a validator's default validate method is not executed when using this class! Rather, the validatePage implementation should call special validateXXX methods that the validator needs to provide, validating certain pieces of the object. These can be combined to validate the elements of individual pages.

Note: Page numbering starts with 0, to be able to pass an array consisting of the corresponding view names to the "pages" bean property.

Parameters indicated with setPassRenderParameters will be present for each page. If there are render parameters you need in renderFinish or renderCancel, then you need to pass those forward from the processFinish or processCancel methods, respectively.

Since:
2.0
Author:
Juergen Hoeller, John A. Lewis
See Also:
setPages(java.lang.String[]),
validatePage(java.lang.Object, org.springframework.validation.Errors, int, boolean),
processFinish(javax.portlet.ActionRequest, javax.portlet.ActionResponse, java.lang.Object, org.springframework.validation.BindException),
processCancel(javax.portlet.ActionRequest, javax.portlet.ActionResponse, java.lang.Object, org.springframework.validation.BindException)

Field Summary
static String | PARAM_CANCEL Deprecated. Parameter triggering the cancel action.
static String | PARAM_FINISH Deprecated. Parameter triggering the finish action.
static String | PARAM_PAGE Deprecated. Parameter specifying the current page as value.
static String | PARAM_TARGET Deprecated. Parameter specifying the target page, appending the page number to the name.
Fields inherited from class org.springframework.web.portlet.mvc.BaseCommandController
DEFAULT_COMMAND_NAME
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Constructor Summary
AbstractWizardFormController()
Deprecated. Create a new AbstractWizardFormController.
Method Summary
protected int | getCurrentPage(javax.portlet.PortletRequest request) Deprecated. Return the current page number.
protected int | getInitialPage(javax.portlet.PortletRequest request) Deprecated. Return the initial page of the wizard, i.e.
protected int | getInitialPage(javax.portlet.PortletRequest request, Object command) Deprecated. Return the initial page of the wizard, i.e.
String | getPageAttribute() Deprecated. Return the name of the page attribute in the model.
protected int | getPageCount() Deprecated. Return the number of wizard pages.
protected int | getPageCount(javax.portlet.PortletRequest request, Object command) Deprecated. Return the page count for this wizard form controller.
String[] | getPages() Deprecated. Return the wizard pages, i.e.
protected String | getPageSessionAttributeName() Deprecated. Return the name of the PortletSession attribute that holds the page object for this wizard form controller.
protected String | getPageSessionAttributeName(javax.portlet.PortletRequest request) Deprecated. Return the name of the PortletSession attribute that holds the page object for this wizard form controller.
protected int | getTargetPage(javax.portlet.PortletRequest request, int currentPage) Deprecated. Return the target page specified in the request.
protected int | getTargetPage(javax.portlet.PortletRequest request, Object command, Errors errors, int currentPage) Deprecated. Return the target page specified in the request.
protected String | getViewName(javax.portlet.PortletRequest request, Object command, int page) Deprecated. Return the name of the view for the specified page of this wizard form controller.
protected void | handleInvalidSubmit(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response) Deprecated. Handle an invalid submit request, e.g.
boolean | isAllowDirtyBack() Deprecated. Return whether "dirty back" is allowed.
boolean | isAllowDirtyForward() Deprecated. Return whether "dirty forward" is allowed.
protected boolean | isCancelRequest(javax.portlet.PortletRequest request) Deprecated. Determine whether the incoming request is a request to cancel the processing of the current form.
protected boolean | isFinishRequest(javax.portlet.PortletRequest request) Deprecated. Determine whether the incoming request is a request to finish the processing of the current form.
protected boolean | isFormSubmission(javax.portlet.PortletRequest request) Deprecated. Consider an explicit finish or cancel request as a form submission too.
protected void | onBindAndValidate(javax.portlet.PortletRequest request, Object command, BindException errors) Deprecated. Calls page-specific onBindAndValidate method.
protected void | onBindAndValidate(javax.portlet.PortletRequest request, Object command, BindException errors, int page) Deprecated. Callback for custom post-processing in terms of binding and validation.
protected void | postProcessPage(javax.portlet.ActionRequest request, Object command, Errors errors, int page) Deprecated. Post-process the given page after binding and validation, potentially updating its command object.
protected void | processCancel(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response, Object command, BindException errors) Deprecated. Template method for the action phase of the cancel action of this wizard.
protected void | processFinish(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response, Object command, BindException errors) Deprecated. Template method for the action phase of the finish action of this wizard.
protected void | processFormSubmission(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response, Object command, BindException errors) Deprecated. Apply wizard workflow: finish, cancel, page change.
protected Map | referenceData(javax.portlet.PortletRequest request, int page) Deprecated. Create a reference data map for the given request, consisting of bean name/bean instance pairs as expected by ModelAndView.
protected Map | referenceData(javax.portlet.PortletRequest request, Object command, Errors errors) Deprecated. Calls page-specific referenceData method.
protected Map | referenceData(javax.portlet.PortletRequest request, Object command, Errors errors, int page) Deprecated. Create a reference data map for the given request, consisting of bean name/bean instance pairs as expected by ModelAndView.
protected ModelAndView | renderCancel(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response, Object command, BindException errors) Deprecated. Template method for the render phase of the cancel action of this wizard.
protected ModelAndView | renderFinish(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response, Object command, BindException errors) Deprecated. Template method for the render phase of the finish action of this wizard.
protected ModelAndView | renderFormSubmission(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response, Object command, BindException errors) Deprecated. Apply wizard workflow: finish, cancel, page change.
protected ModelAndView | renderInvalidSubmit(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response) Deprecated. Handle an invalid submit request, e.g.
void | setAllowDirtyBack(boolean allowDirtyBack) Deprecated. Set if "dirty back" is allowed, i.e.
void | setAllowDirtyForward(boolean allowDirtyForward) Deprecated. Set if "dirty forward" is allowed, i.e.
protected void | setCancelRenderParameter(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response) Deprecated. Pass the the parameter that indicates a cancel request forward to the render phase.
protected void | setFinishRenderParameter(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response) Deprecated. Pass the the parameter that indicates a finish request forward to the render phase.
void | setPageAttribute(String pageAttribute) Deprecated. Set the name of the page attribute in the model, containing an Integer with the current page number.
protected void | setPageRenderParameter(javax.portlet.ActionResponse response, int page) Deprecated. Pass the page number to the render phase by setting a render parameter.
void | setPages(String[] pages) Deprecated. Set the wizard pages, i.e.
protected void | setTargetRenderParameter(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response) Deprecated. Pass the the parameter that indicates the target page of the request forward to the render phase.
protected ModelAndView | showForm(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response, BindException errors) Deprecated. Show the first page as form view.
protected ModelAndView | showPage(javax.portlet.RenderRequest request, BindException errors, int page) Deprecated. Prepare the form model and view, including reference and error data, for the given page.
protected void | validatePage(Object command, Errors errors, int page) Deprecated. Template method for custom validation logic for individual pages.
protected void | validatePage(Object command, Errors errors, int page, boolean finish) Deprecated. Template method for custom validation logic for individual pages.
Methods inherited from class org.springframework.web.portlet.mvc.AbstractFormController
formBackingObject, getCommand, getErrorsForNewForm, getFormSessionAttributeName, getFormSessionAttributeName, getFormSubmitParameterName, getInvalidSubmitParameterName, getRenderParameters, handleActionRequestInternal, handleRenderRequestInternal, isBindOnNewForm, isInvalidSubmission, isRedirectAction, isSessionForm, onBindOnNewForm, onBindOnNewForm, passRenderParameters, setBindOnNewForm, setFormSubmit, setInvalidSubmit, setRedirectAction, setRenderParameters, setSessionForm, showForm, showForm, showNewForm
Methods inherited from class org.springframework.web.portlet.mvc.BaseCommandController
bindAndValidate, checkCommand, createBinder, createCommand, getBindingErrorProcessor, getCommandClass, getCommandName, getMessageCodesResolver, getPropertyEditorRegistrars, getRenderCommand, getRenderCommandSessionAttributeName, getRenderErrors, getRenderErrorsSessionAttributeName, getValidator, getValidators, getWebBindingInitializer, initApplicationContext, initBinder, isValidateOnBinding, onBind, onBind, prepareBinder, setBindingErrorProcessor, setCommandClass, setCommandName, setMessageCodesResolver, setPropertyEditorRegistrar, setPropertyEditorRegistrars, setRenderCommandAndErrors, setValidateOnBinding, setValidator, setValidators, setWebBindingInitializer, suppressBinding, suppressValidation, useDirectFieldAccess
Methods inherited from class org.springframework.web.portlet.mvc.AbstractController
handleActionRequest, handleRenderRequest, isRenderWhenMinimized, isSynchronizeOnSession, setRenderWhenMinimized, setSynchronizeOnSession
Methods inherited from class org.springframework.web.portlet.handler.PortletContentGenerator
applyCacheSeconds, cacheForSeconds, check, checkAndPrepare, checkAndPrepare, getCacheSeconds, isRequireSession, preventCaching, setCacheSeconds, setRequireSession
Methods inherited from class org.springframework.web.portlet.context.PortletApplicationObjectSupport
getPortletContext, getTempDir, isContextRequired, setPortletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

PARAM_FINISH

public static final String PARAM_FINISH
Deprecated.
Parameter triggering the finish action. Can be called from any wizard page!

See Also:
Constant Field Values

PARAM_CANCEL

public static final String PARAM_CANCEL
Deprecated.
Parameter triggering the cancel action. Can be called from any wizard page!

See Also:
Constant Field Values

PARAM_TARGET

public static final String PARAM_TARGET
Deprecated.
Parameter specifying the target page, appending the page number to the name.

See Also:
Constant Field Values

PARAM_PAGE

public static final String PARAM_PAGE
Deprecated.
Parameter specifying the current page as value. Not necessary on form pages, but allows to properly handle usage of the back button.

See Also:
setPageAttribute(java.lang.String), Constant Field Values
Constructor Detail

AbstractWizardFormController

public AbstractWizardFormController()
Deprecated.
Create a new AbstractWizardFormController.

"sessionForm" is automatically turned on, "validateOnBinding" turned off, and "cacheSeconds" set to 0 by the base class (-> no caching for all form controllers).

Method Detail

setPages

public final void setPages(String[] pages)
Deprecated.
Set the wizard pages, i.e. the view names for the pages. The array index is interpreted as page number.

Parameters:
pages - view names for the pages

getPages

public final String[] getPages()
Deprecated.
Return the wizard pages, i.e. the view names for the pages. The array index corresponds to the page number.

Note that a concrete wizard form controller might override getViewName(PortletRequest, Object, int) to determine the view name for each page dynamically.

See Also:
getViewName(PortletRequest, Object, int)

getPageCount

protected final int getPageCount()
Deprecated.
Return the number of wizard pages. Useful to check whether the last page has been reached.

Note that a concrete wizard form controller might override getPageCount(PortletRequest, Object) to determine the page count dynamically.

See Also:
getPageCount(PortletRequest, Object)

setPageAttribute

public final void setPageAttribute(String pageAttribute)
Deprecated.
Set the name of the page attribute in the model, containing an Integer with the current page number.

This will be necessary for single views rendering multiple view pages. It also allows for specifying the optional "_page" parameter.

Parameters:
pageAttribute - name of the page attribute
See Also:
PARAM_PAGE

getPageAttribute

public final String getPageAttribute()
Deprecated.
Return the name of the page attribute in the model.

setAllowDirtyBack

public final void setAllowDirtyBack(boolean allowDirtyBack)
Deprecated.
Set if "dirty back" is allowed, i.e. if moving to a former wizard page is allowed in case of validation errors for the current page.

Parameters:
allowDirtyBack - if "dirty back" is allowed

isAllowDirtyBack

public final boolean isAllowDirtyBack()
Deprecated.
Return whether "dirty back" is allowed.

setAllowDirtyForward

public final void setAllowDirtyForward(boolean allowDirtyForward)
Deprecated.
Set if "dirty forward" is allowed, i.e. if moving to a later wizard page is allowed in case of validation errors for the current page.

Parameters:
allowDirtyForward - if "dirty forward" is allowed

isAllowDirtyForward

public final boolean isAllowDirtyForward()
Deprecated.
Return whether "dirty forward" is allowed.

onBindAndValidate

protected final void onBindAndValidate(javax.portlet.PortletRequest request,
                                       Object command,
                                       BindException errors)
                                throws Exception
Deprecated.
Calls page-specific onBindAndValidate method.

Overrides:
onBindAndValidate in class BaseCommandController
Parameters:
request - current portlet request
command - the command object, still allowing for further binding
errors - validation errors holder, allowing for additional custom validation
Throws:
Exception - in case of invalid state or arguments
See Also:
BaseCommandController.bindAndValidate(javax.portlet.PortletRequest, java.lang.Object), Errors

onBindAndValidate

protected void onBindAndValidate(javax.portlet.PortletRequest request,
                                 Object command,
                                 BindException errors,
                                 int page)
                          throws Exception
Deprecated.
Callback for custom post-processing in terms of binding and validation. Called on each submit, after standard binding but before page-specific validation of this wizard form controller.

Note: AbstractWizardFormController does not perform standard validation on binding but rather applies page-specific validation on processing the form submission.

Parameters:
request - current portlet request
command - bound command
errors - Errors instance for additional custom validation
page - current wizard page
Throws:
Exception - in case of invalid state or arguments
See Also:
BaseCommandController.bindAndValidate(javax.portlet.PortletRequest, java.lang.Object), processFormSubmission(javax.portlet.ActionRequest, javax.portlet.ActionResponse, java.lang.Object, org.springframework.validation.BindException), Errors

isFormSubmission

protected boolean isFormSubmission(javax.portlet.PortletRequest request)
Deprecated.
Consider an explicit finish or cancel request as a form submission too.

Overrides:
isFormSubmission in class AbstractFormController
Parameters:
request - current request
Returns:
if the request represents a form submission
See Also:
isFinishRequest(PortletRequest), isCancelRequest(PortletRequest)

referenceData

protected final Map referenceData(javax.portlet.PortletRequest request,
                                  Object command,
                                  Errors errors)
                           throws Exception
Deprecated.
Calls page-specific referenceData method.

Overrides:
referenceData in class AbstractFormController
Parameters:
request - current render request
command - form object with request parameters bound onto it
errors - validation errors holder
Returns:
a Map with reference data entries, or null if none
Throws:
Exception - in case of invalid state or arguments
See Also:
ModelAndView

referenceData

protected Map referenceData(javax.portlet.PortletRequest request,
                            Object command,
                            Errors errors,
                            int page)
                     throws Exception
Deprecated.
Create a reference data map for the given request, consisting of bean name/bean instance pairs as expected by ModelAndView.

The default implementation delegates to referenceData(PortletRequest, int). Subclasses can override this to set reference data used in the view.

Parameters:
request - current portlet request
command - form object with request parameters bound onto it
errors - validation errors holder
page - current wizard page
Returns:
a Map with reference data entries, or null if none
Throws:
Exception - in case of invalid state or arguments
See Also:
referenceData(PortletRequest, int), ModelAndView

referenceData

protected Map referenceData(javax.portlet.PortletRequest request,
                            int page)
                     throws Exception
Deprecated.
Create a reference data map for the given request, consisting of bean name/bean instance pairs as expected by ModelAndView.

The default implementation returns null. Subclasses can override this to set reference data used in the view.

Parameters:
request - current portlet request
page - current wizard page
Returns:
a Map with reference data entries, or null if none
Throws:
Exception - in case of invalid state or arguments
See Also:
ModelAndView

showForm

protected ModelAndView showForm(javax.portlet.RenderRequest request,
                                javax.portlet.RenderResponse response,
                                BindException errors)
                         throws Exception
Deprecated.
Show the first page as form view.

This can be overridden in subclasses, e.g. to prepare wizard-specific error views in case of an Exception.

Specified by:
showForm in class AbstractFormController
Parameters:
request - current render request
response - current render response
errors - validation errors holder
Returns:
the prepared form view, or null if handled directly
Throws:
Exception - in case of invalid state or arguments
See Also:
AbstractFormController.showForm(RenderRequest, BindException, String),
Errors,
BindException.getModel(),
AbstractFormController.referenceData(PortletRequest, Object, Errors),
SimpleFormController.setFormView(java.lang.String)

showPage

protected final ModelAndView showPage(javax.portlet.RenderRequest request,
                                      BindException errors,
                                      int page)
                               throws Exception
Deprecated.
Prepare the form model and view, including reference and error data, for the given page. Can be used in processFinish implementations, to show the corresponding page in case of validation errors.

Parameters:
request - current portlet render request
errors - validation errors holder
page - number of page to show
Returns:
the prepared form view
Throws:
Exception - in case of invalid state or arguments

getPageCount

protected int getPageCount(javax.portlet.PortletRequest request,
                           Object command)
Deprecated.
Return the page count for this wizard form controller.

The default implementation delegates to getPageCount(). Can be overridden to dynamically adapt the page count.

Parameters:
request - current portlet request
command - the command object as returned by formBackingObject
Returns:
the current page count
See Also:
getPageCount()

getViewName

protected String getViewName(javax.portlet.PortletRequest request,
                             Object command,
                             int page)
Deprecated.
Return the name of the view for the specified page of this wizard form controller.

The default implementation takes the view name from the getPages() array. Can be overridden to dynamically switch the page view or to return view names for dynamically defined pages.

Parameters:
request - current portlet request
command - the command object as returned by formBackingObject
Returns:
the current page count
See Also:
getPageCount()

getInitialPage

protected int getInitialPage(javax.portlet.PortletRequest request,
                             Object command)
Deprecated.
Return the initial page of the wizard, i.e. the page shown at wizard startup.

The default implementation delegates to getInitialPage(PortletRequest).

Parameters:
request - current portlet request
command - the command object as returned by formBackingObject
Returns:
the initial page number
See Also:
getInitialPage(PortletRequest), AbstractFormController.formBackingObject(javax.portlet.PortletRequest)

getInitialPage

protected int getInitialPage(javax.portlet.PortletRequest request)
Deprecated.
Return the initial page of the wizard, i.e. the page shown at wizard startup.

The default implementation returns 0 for first page.

Parameters:
request - current portlet request
Returns:
the initial page number

getPageSessionAttributeName

protected String getPageSessionAttributeName(javax.portlet.PortletRequest request)
Deprecated.
Return the name of the PortletSession attribute that holds the page object for this wizard form controller.

The default implementation delegates to the getPageSessionAttributeName version without arguments.

Parameters:
request - current portlet request
Returns:
the name of the form session attribute, or null if not in session form mode
See Also:
getPageSessionAttributeName(javax.portlet.PortletRequest),
AbstractFormController.getFormSessionAttributeName(javax.portlet.PortletRequest),
PortletSession.getAttribute(java.lang.String)

getPageSessionAttributeName

protected String getPageSessionAttributeName()
Deprecated.
Return the name of the PortletSession attribute that holds the page object for this wizard form controller.

Default is an internal name, of no relevance to applications, as the form session attribute is not usually accessed directly. Can be overridden to use an application-specific attribute name, which allows other code to access the session attribute directly.

Returns:
the name of the page session attribute
See Also:
AbstractFormController.getFormSessionAttributeName(javax.portlet.PortletRequest), PortletSession.getAttribute(java.lang.String)

setPageRenderParameter

protected void setPageRenderParameter(javax.portlet.ActionResponse response,
                                      int page)
Deprecated.
Pass the page number to the render phase by setting a render parameter. This method may not be called when the action calls ActionResponse.sendRedirect(String).

Parameters:
response - the current action response
page - the page number
See Also:
StateAwareResponse.setRenderParameter(java.lang.String, java.lang.String)

setTargetRenderParameter

protected void setTargetRenderParameter(javax.portlet.ActionRequest request,
                                        javax.portlet.ActionResponse response)
Deprecated.
Pass the the parameter that indicates the target page of the request forward to the render phase. If the getTargetPage method was overridden, this may need to be overriden as well.

Parameters:
request - the current action request
response - the current action response
See Also:
PARAM_TARGET,
getTargetPage(PortletRequest, int),
getTargetPage(PortletRequest, Object, Errors, int),
StateAwareResponse.setRenderParameter(java.lang.String, java.lang.String)

setFinishRenderParameter

protected void setFinishRenderParameter(javax.portlet.ActionRequest request,
                                        javax.portlet.ActionResponse response)
Deprecated.
Pass the the parameter that indicates a finish request forward to the render phase. If the isFinishRequest method was overridden, this may need to be overriden as well.

Parameters:
request - the current action request
response - the current action response
See Also:
PARAM_FINISH, isFinishRequest(javax.portlet.PortletRequest), StateAwareResponse.setRenderParameter(java.lang.String, java.lang.String)

setCancelRenderParameter

protected void setCancelRenderParameter(javax.portlet.ActionRequest request,
                                        javax.portlet.ActionResponse response)
Deprecated.
Pass the the parameter that indicates a cancel request forward to the render phase. If the isCancelRequest method was overridden, this may need to be overriden as well.

Parameters:
request - the current action request
response - the current action response
See Also:
PARAM_CANCEL, isCancelRequest(javax.portlet.PortletRequest), StateAwareResponse.setRenderParameter(java.lang.String, java.lang.String)

renderInvalidSubmit

protected ModelAndView renderInvalidSubmit(javax.portlet.RenderRequest request,
                                           javax.portlet.RenderResponse response)
                                    throws Exception
Deprecated.
Handle an invalid submit request, e.g. when in session form mode but no form object was found in the session (like in case of an invalid resubmit by the browser).

The default implementation for wizard form controllers simply shows the initial page of a new wizard form. If you want to show some "invalid submit" message, you need to override this method.

Overrides:
renderInvalidSubmit in class AbstractFormController
Parameters:
request - current portlet render request
response - current portlet render response
Returns:
a prepared view, or null if handled directly
Throws:
Exception - in case of errors
See Also:
AbstractFormController.showNewForm(javax.portlet.RenderRequest, javax.portlet.RenderResponse),
AbstractFormController.setBindOnNewForm(boolean),
handleInvalidSubmit(javax.portlet.ActionRequest, javax.portlet.ActionResponse)

handleInvalidSubmit

protected void handleInvalidSubmit(javax.portlet.ActionRequest request,
                                   javax.portlet.ActionResponse response)
                            throws Exception
Deprecated.
Handle an invalid submit request, e.g. when in session form mode but no form object was found in the session (like in case of an invalid resubmit by the browser).

The default implementation for wizard form controllers simply shows the initial page of a new wizard form, so here in the action phase this method does nothing. If you want to take some action on an invalid submit, you need to override this method.

Overrides:
handleInvalidSubmit in class AbstractFormController
Parameters:
request - current portlet action request
response - current portlet action response
Throws:
Exception - in case of errors
See Also:
renderInvalidSubmit(javax.portlet.RenderRequest, javax.portlet.RenderResponse)

renderFormSubmission

protected final ModelAndView renderFormSubmission(javax.portlet.RenderRequest request,
                                                  javax.portlet.RenderResponse response,
                                                  Object command,
                                                  BindException errors)
                                           throws Exception
Deprecated.
Apply wizard workflow: finish, cancel, page change.

Specified by:
renderFormSubmission in class AbstractFormController
Parameters:
request - current render request
response - current render response
command - form object with request parameters bound onto it
errors - errors holder
Returns:
the prepared model and view, or null
Throws:
Exception - in case of errors
See Also:
processFormSubmission(javax.portlet.ActionRequest, javax.portlet.ActionResponse, java.lang.Object, org.springframework.validation.BindException)

processFormSubmission

protected final void processFormSubmission(javax.portlet.ActionRequest request,
                                           javax.portlet.ActionResponse response,
                                           Object command,
                                           BindException errors)
                                    throws Exception
Deprecated.
Apply wizard workflow: finish, cancel, page change.

Specified by:
processFormSubmission in class AbstractFormController
Parameters:
request - current action request
response - current action response
command - form object with request parameters bound onto it
errors - errors holder (subclass can add errors if it wants to)
Throws:
Exception - in case of errors
See Also:
renderFormSubmission(javax.portlet.RenderRequest, javax.portlet.RenderResponse, java.lang.Object, org.springframework.validation.BindException)

getCurrentPage

protected int getCurrentPage(javax.portlet.PortletRequest request)
Deprecated.
Return the current page number. Used by processFormSubmission(javax.portlet.ActionRequest, javax.portlet.ActionResponse, java.lang.Object, org.springframework.validation.BindException).

The default implementation checks the page session attribute. Subclasses can override this for customized page determination.

Parameters:
request - current portlet request
Returns:
the current page number
See Also:
getPageSessionAttributeName()

isFinishRequest

protected boolean isFinishRequest(javax.portlet.PortletRequest request)
Deprecated.
Determine whether the incoming request is a request to finish the processing of the current form.

By default, this method returns true if a parameter matching the "_finish" key is present in the request, otherwise it returns false. Subclasses may override this method to provide custom logic to detect a finish request.

The parameter is recognized both when sent as a plain parameter ("_finish") or when triggered by an image button ("_finish.x").

Parameters:
request - current portlet request
Returns:
whether the request indicates to finish form processing
See Also:
PARAM_FINISH

isCancelRequest

protected boolean isCancelRequest(javax.portlet.PortletRequest request)
Deprecated.
Determine whether the incoming request is a request to cancel the processing of the current form.

By default, this method returns true if a parameter matching the "_cancel" key is present in the request, otherwise it returns false. Subclasses may override this method to provide custom logic to detect a cancel request.

The parameter is recognized both when sent as a plain parameter ("_cancel") or when triggered by an image button ("_cancel.x").

Parameters:
request - current portlet request
Returns:
whether the request indicates to cancel form processing
See Also:
PARAM_CANCEL

getTargetPage

protected int getTargetPage(javax.portlet.PortletRequest request,
                            Object command,
                            Errors errors,
                            int currentPage)
Deprecated.
Return the target page specified in the request.

The default implementation delegates to getTargetPage(PortletRequest, int). Subclasses can override this for customized target page determination.

Parameters:
request - current portlet request
command - form object with request parameters bound onto it
errors - validation errors holder
currentPage - the current page, to be returned as fallback if no target page specified
Returns:
the page specified in the request, or current page if not found
See Also:
getTargetPage(PortletRequest, int)

getTargetPage

protected int getTargetPage(javax.portlet.PortletRequest request,
                            int currentPage)
Deprecated.
Return the target page specified in the request.

The default implementation examines "_target" parameter (e.g. "_target1"). Subclasses can override this for customized target page determination.

Parameters:
request - current portlet request
currentPage - the current page, to be returned as fallback if no target page specified
Returns:
the page specified in the request, or current page if not found
See Also:
PARAM_TARGET

validatePage

protected void validatePage(Object command,
                            Errors errors,
                            int page,
                            boolean finish)
Deprecated.
Template method for custom validation logic for individual pages. The default implementation calls validatePage(command, errors, page).

Implementations will typically call fine-granular validateXXX methods of this instance's Validator, combining them to validation of the corresponding pages. The Validator's default validate method will not be called by a wizard form controller!

Parameters:
command - form object with the current wizard state
errors - validation errors holder
page - number of page to validate
finish - whether this method is called during final revalidation on finish (else, it is called for validating the current page)
See Also:
validatePage(Object, Errors, int), Validator.validate(java.lang.Object, org.springframework.validation.Errors)

validatePage

protected void validatePage(Object command,
                            Errors errors,
                            int page)
Deprecated.
Template method for custom validation logic for individual pages. The default implementation is empty.

Implementations will typically call fine-granular validateXXX methods of this instance's validator, combining them to validation of the corresponding pages. The validator's default validate method will not be called by a wizard form controller!

Parameters:
command - form object with the current wizard state
errors - validation errors holder
page - number of page to validate
See Also:
Validator.validate(java.lang.Object, org.springframework.validation.Errors)

postProcessPage

protected void postProcessPage(javax.portlet.ActionRequest request,
                               Object command,
                               Errors errors,
                               int page)
                        throws Exception
Deprecated.
Post-process the given page after binding and validation, potentially updating its command object. The passed-in request might contain special parameters sent by the page.

Only invoked when displaying another page or the same page again, not when finishing or cancelling.

Parameters:
request - current action request
command - form object with request parameters bound onto it
errors - validation errors holder
page - number of page to post-process
Throws:
Exception - in case of invalid state or arguments

renderFinish

protected ModelAndView renderFinish(javax.portlet.RenderRequest request,
                                    javax.portlet.RenderResponse response,
                                    Object command,
                                    BindException errors)
                             throws Exception
Deprecated.
Template method for the render phase of the finish action of this wizard.

The default implementation throws a PortletException, saying that a finish render request is not supported by this controller. Thus, you do not need to implement this template method if you do not need to render after a finish.

Call errors.getModel() to populate the ModelAndView model with the command and the Errors instance, under the specified command name, as expected by the "spring:bind" tag.

Parameters:
request - current portlet render request
response - current portlet render response
command - form object with the current wizard state
errors - validation errors holder
Returns:
the finish view
Throws:
Exception - in case of invalid state or arguments
See Also:
processFinish(javax.portlet.ActionRequest, javax.portlet.ActionResponse, java.lang.Object, org.springframework.validation.BindException), Errors, BindException.getModel()

processFinish

protected void processFinish(javax.portlet.ActionRequest request,
                             javax.portlet.ActionResponse response,
                             Object command,
                             BindException errors)
                      throws Exception
Deprecated.
Template method for the action phase of the finish action of this wizard.

The default implementation throws a PortletException, saying that a finish action request is not supported by this controller. You will almost certainly need to override this method.

Parameters:
request - current portlet action request
response - current portlet action response
command - form object with the current wizard state
errors - validation errors holder
Throws:
Exception - in case of invalid state or arguments
See Also:
renderFinish(javax.portlet.RenderRequest, javax.portlet.RenderResponse, java.lang.Object, org.springframework.validation.BindException), Errors

renderCancel

protected ModelAndView renderCancel(javax.portlet.RenderRequest request,
                                    javax.portlet.RenderResponse response,
                                    Object command,
                                    BindException errors)
                             throws Exception
Deprecated.
Template method for the render phase of the cancel action of this wizard.

The default implementation throws a PortletException, saying that a cancel render request is not supported by this controller. Thus, you do not need to implement this template method if you do not support a cancel operation.

Call errors.getModel() to populate the ModelAndView model with the command and the Errors instance, under the specified command name, as expected by the "spring:bind" tag.

Parameters:
request - current portlet render request
response - current portlet render response
command - form object with the current wizard state
errors - Errors instance containing errors
Returns:
the cancellation view
Throws:
Exception - in case of invalid state or arguments
See Also:
processCancel(javax.portlet.ActionRequest, javax.portlet.ActionResponse, java.lang.Object, org.springframework.validation.BindException), Errors, BindException.getModel()

processCancel

protected void processCancel(javax.portlet.ActionRequest request,
                             javax.portlet.ActionResponse response,
                             Object command,
                             BindException errors)
                      throws Exception
Deprecated.
Template method for the action phase of the cancel action of this wizard.

The default implementation throws a PortletException, saying that a cancel action request is not supported by this controller. Thus, you do not need to implement this template method if you do not support a cancel operation.

Parameters:
request - current portlet action request
response - current portlet action response
command - form object with the current wizard state
errors - Errors instance containing errors
Throws:
Exception - in case of invalid state or arguments
See Also:
renderCancel(javax.portlet.RenderRequest, javax.portlet.RenderResponse, java.lang.Object, org.springframework.validation.BindException), Errors
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


BaseCommandController

org.springframework.web.portlet.mvc
Class BaseCommandController

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.portlet.context.PortletApplicationObjectSupport
            extended by  org.springframework.web.portlet.handler.PortletContentGenerator
                extended by  org.springframework.web.portlet.mvc.AbstractController
                    extended by  org.springframework.web.portlet.mvc.BaseCommandController
All Implemented Interfaces:
ApplicationContextAware, PortletContextAware, Controller
Direct Known Subclasses:
AbstractCommandController, AbstractFormController
Deprecated. as of Spring 3.0, in favor of annotated controllers

@Deprecated
public abstract class BaseCommandController
extends AbstractController

Controller implementation which creates an object (the command object) on receipt of a request and attempts to populate this object with request parameters.

This controller is the base for all controllers wishing to populate JavaBeans based on request parameters, validate the content of such JavaBeans using Validators and use custom editors (in the form of PropertyEditors) to transform objects into strings and vice versa, for example. Three notions are mentioned here:

Command class:
An instance of the command class will be created for each request and populated with request parameters. A command class can basically be any Java class; the only requirement is a no-arg constructor. The command class should preferably be a JavaBean in order to be able to populate bean properties with request parameters.

Populating using request parameters and PropertyEditors:
Upon receiving a request, any BaseCommandController will attempt to fill the command object using the request parameters. This is done using the typical and well-known JavaBeans property notation. When a request parameter named 'firstName' exists, the framework will attempt to call setFirstName([value]) passing the value of the parameter. Nested properties are of course supported. For instance a parameter named 'address.city' will result in a getAddress().setCity([value]) call on the command class.

It's important to realize that you are not limited to String arguments in your JavaBeans. Using the PropertyEditor-notion as supplied by the java.beans package, you will be able to transform Strings to Objects and the other way around. For instance setLocale(Locale loc) is perfectly possible for a request parameter named locale having a value of en, as long as you register the appropriate PropertyEditor in the Controller (see initBinder() for more information on that matter).

Validators: After the controller has successfully populated the command object with parameters from the request, it will use any configured validators to validate the object. Validation results will be put in a Errors object which can be used in a View to render any input problems.

Workflow (and that defined by superclass):
Since this class is an abstract base class for more specific implementation, it does not override the handleRequestInternal() methods and also has no actual workflow. Implementing classes like AbstractFormController, AbstractCommandController, SimpleFormController and AbstractWizardFormController provide actual functionality and workflow. More information on workflow performed by superclasses can be found here.

Exposed configuration properties (and those defined by superclass):

name | default | description
commandName | command | the name to use when binding the instantiated command class to the request
commandClass | null | the class to use upon receiving a request and which to fill using the request parameters. What object is used and whether or not it should be created is defined by extending classes and their configuration properties and methods.
validators | null | Array of Validator beans. The validator will be called at appropriate places in the workflow of subclasses (have a look at those for more info) to validate the command object.
validator | null | Short-form property for setting only one Validator bean (usually passed in using a <ref bean="beanId"/> property.
validateOnBinding | true | Indicates whether or not to validate the command object after the object has been populated with request parameters.

Thanks to Rainer Schmitz and Nick Lothian for their suggestions!

Since:
2.0
Author:
Juergen Hoeller, John A. Lewis

Field Summary
static String DEFAULT_COMMAND_NAME
Deprecated.
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Constructor Summary
BaseCommandController()
Deprecated.
Method Summary
protected PortletRequestDataBinder | bindAndValidate(javax.portlet.PortletRequest request, Object command) Deprecated. Bind the parameters of the given request to the given command object.
protected boolean | checkCommand(Object command) Deprecated. Check if the given command object is a valid for this controller, i.e.
protected PortletRequestDataBinder | createBinder(javax.portlet.PortletRequest request, Object command) Deprecated. Create a new binder instance for the given command and request.
protected Object | createCommand() Deprecated. Create a new command instance for the command class of this controller.
BindingErrorProcessor | getBindingErrorProcessor() Deprecated. Return the strategy to use for processing binding errors (if any).
protected Object | getCommand(javax.portlet.PortletRequest request) Deprecated. Retrieve a command object for the given request.
Class | getCommandClass() Deprecated. Return the command class for this controller.
String | getCommandName() Deprecated. Return the name of the command in the model.
MessageCodesResolver | getMessageCodesResolver() Deprecated. Return the strategy to use for resolving errors into message codes (if any).
PropertyEditorRegistrar[] | getPropertyEditorRegistrars() Deprecated. Return the PropertyEditorRegistrars (if any) to be applied to every DataBinder that this controller uses.
protected Object | getRenderCommand(javax.portlet.RenderRequest request) Deprecated. Get the command object cached for the render phase.
protected String | getRenderCommandSessionAttributeName() Deprecated. Return the name of the session attribute that holds the render phase command object for this form controller.
protected BindException | getRenderErrors(javax.portlet.RenderRequest request) Deprecated. Get the bind and validation errors cached for the render phase.
protected String | getRenderErrorsSessionAttributeName() Deprecated. Return the name of the session attribute that holds the render phase command object for this form controller.
Validator | getValidator() Deprecated.
Validator[] | getValidators() Deprecated. Return the Validators for this controller.
WebBindingInitializer | getWebBindingInitializer() Deprecated. Return the WebBindingInitializer (if any) which will apply pre-configured configuration to every DataBinder that this controller uses.
protected void | initApplicationContext() Deprecated. Subclasses can override this for custom initialization behavior.
protected void | initBinder(javax.portlet.PortletRequest request, PortletRequestDataBinder binder) Deprecated. Initialize the given binder instance, for example with custom editors.
boolean | isValidateOnBinding() Deprecated. Return if the Validator should get applied when binding.
protected void | onBind(javax.portlet.PortletRequest request, Object command) Deprecated. Callback for custom post-processing in terms of binding.
protected void | onBind(javax.portlet.PortletRequest request, Object command, BindException errors) Deprecated. Callback for custom post-processing in terms of binding.
protected void | onBindAndValidate(javax.portlet.PortletRequest request, Object command, BindException errors) Deprecated. Callback for custom post-processing in terms of binding and validation.
protected void | prepareBinder(PortletRequestDataBinder binder) Deprecated. Prepare the given binder, applying the specified MessageCodesResolver, BindingErrorProcessor and PropertyEditorRegistrars (if any).
void | setBindingErrorProcessor(BindingErrorProcessor bindingErrorProcessor) Deprecated. Set the strategy to use for processing binding errors, that is, required field errors and PropertyAccessExceptions.
void | setCommandClass(Class commandClass) Deprecated. Set the command class for this controller.
void | setCommandName(String commandName) Deprecated. Set the name of the command in the model.
void | setMessageCodesResolver(MessageCodesResolver messageCodesResolver) Deprecated. Set the strategy to use for resolving errors into message codes.
void | setPropertyEditorRegistrar(PropertyEditorRegistrar propertyEditorRegistrar) Deprecated. Specify a single PropertyEditorRegistrar to be applied to every DataBinder that this controller uses.
void | setPropertyEditorRegistrars(PropertyEditorRegistrar[] propertyEditorRegistrars) Deprecated. Specify one or more PropertyEditorRegistrars to be applied to every DataBinder that this controller uses.
protected void | setRenderCommandAndErrors(javax.portlet.ActionRequest request, Object command, BindException errors) Deprecated. Set the command object and errors object for the render phase.
void | setValidateOnBinding(boolean validateOnBinding) Deprecated. Set if the Validator should get applied when binding.
void | setValidator(Validator validator) Deprecated. Set the primary Validator for this controller.
void | setValidators(Validator[] validators) Deprecated. Set the Validators for this controller.
void | setWebBindingInitializer(WebBindingInitializer webBindingInitializer) Deprecated. Specify a WebBindingInitializer which will apply pre-configured configuration to every DataBinder that this controller uses.
protected boolean | suppressBinding(javax.portlet.PortletRequest request) Deprecated. Return whether to suppress binding for the given request.
protected boolean | suppressValidation(javax.portlet.PortletRequest request) Deprecated. Return whether to suppress validation for the given request.
protected boolean | useDirectFieldAccess() Deprecated. Determine whether to use direct field access instead of bean property access.
Methods inherited from class org.springframework.web.portlet.mvc.AbstractController
handleActionRequest, handleActionRequestInternal, handleRenderRequest, handleRenderRequestInternal, isRenderWhenMinimized, isSynchronizeOnSession, setRenderWhenMinimized, setSynchronizeOnSession
Methods inherited from class org.springframework.web.portlet.handler.PortletContentGenerator
applyCacheSeconds, cacheForSeconds, check, checkAndPrepare, checkAndPrepare, getCacheSeconds, isRequireSession, preventCaching, setCacheSeconds, setRequireSession
Methods inherited from class org.springframework.web.portlet.context.PortletApplicationObjectSupport
getPortletContext, getTempDir, isContextRequired, setPortletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_COMMAND_NAME

public static final String DEFAULT_COMMAND_NAME
Deprecated.
See Also:
Constant Field Values
Constructor Detail

BaseCommandController

public BaseCommandController()
Deprecated.
Method Detail

setCommandName

public final void setCommandName(String commandName)
Deprecated.
Set the name of the command in the model. The command object will be included in the model under this name.

getCommandName

public final String getCommandName()
Deprecated.
Return the name of the command in the model.

setCommandClass

public final void setCommandClass(Class commandClass)
Deprecated.
Set the command class for this controller. An instance of this class gets populated and validated on each request.

getCommandClass

public final Class getCommandClass()
Deprecated.
Return the command class for this controller.

setValidator

public final void setValidator(Validator validator)
Deprecated.
Set the primary Validator for this controller. The Validator must support the specified command class. If there are one or more existing validators set already when this method is called, only the specified validator will be kept. Use setValidators(Validator[]) to set multiple validators.

getValidator

public final Validator getValidator()
Deprecated.
Returns:
the primary Validator for this controller.

setValidators

public final void setValidators(Validator[] validators)
Deprecated.
Set the Validators for this controller. The Validator must support the specified command class.

getValidators

public final Validator[] getValidators()
Deprecated.
Return the Validators for this controller.

setValidateOnBinding

public final void setValidateOnBinding(boolean validateOnBinding)
Deprecated.
Set if the Validator should get applied when binding.

isValidateOnBinding

public final boolean isValidateOnBinding()
Deprecated.
Return if the Validator should get applied when binding.

setMessageCodesResolver

public final void setMessageCodesResolver(MessageCodesResolver messageCodesResolver)
Deprecated.
Set the strategy to use for resolving errors into message codes. Applies the given strategy to all data binders used by this controller.

Default is null, i.e. using the default strategy of the data binder.

See Also:
createBinder(javax.portlet.PortletRequest, java.lang.Object), DataBinder.setMessageCodesResolver(org.springframework.validation.MessageCodesResolver)

getMessageCodesResolver

public final MessageCodesResolver getMessageCodesResolver()
Deprecated.
Return the strategy to use for resolving errors into message codes (if any).

setBindingErrorProcessor

public final void setBindingErrorProcessor(BindingErrorProcessor bindingErrorProcessor)
Deprecated.
Set the strategy to use for processing binding errors, that is, required field errors and PropertyAccessExceptions.

Default is null, i.e. using the default strategy of the data binder.

See Also:
createBinder(javax.portlet.PortletRequest, java.lang.Object), DataBinder.setBindingErrorProcessor(org.springframework.validation.BindingErrorProcessor)

getBindingErrorProcessor

public final BindingErrorProcessor getBindingErrorProcessor()
Deprecated.
Return the strategy to use for processing binding errors (if any).

setPropertyEditorRegistrar

public final void setPropertyEditorRegistrar(PropertyEditorRegistrar propertyEditorRegistrar)
Deprecated.
Specify a single PropertyEditorRegistrar to be applied to every DataBinder that this controller uses.

Allows for factoring out the registration of PropertyEditors to separate objects, as an alternative to initBinder.

See Also:
initBinder(javax.portlet.PortletRequest, org.springframework.web.portlet.bind.PortletRequestDataBinder)

setPropertyEditorRegistrars

public final void setPropertyEditorRegistrars(PropertyEditorRegistrar[] propertyEditorRegistrars)
Deprecated.
Specify one or more PropertyEditorRegistrars to be applied to every DataBinder that this controller uses.

Allows for factoring out the registration of PropertyEditors to separate objects, as alternative to initBinder.

See Also:
initBinder(javax.portlet.PortletRequest, org.springframework.web.portlet.bind.PortletRequestDataBinder)

getPropertyEditorRegistrars

public final PropertyEditorRegistrar[] getPropertyEditorRegistrars()
Deprecated.
Return the PropertyEditorRegistrars (if any) to be applied to every DataBinder that this controller uses.

setWebBindingInitializer

public final void setWebBindingInitializer(WebBindingInitializer webBindingInitializer)
Deprecated.
Specify a WebBindingInitializer which will apply pre-configured configuration to every DataBinder that this controller uses.

Allows for factoring out the entire binder configuration to separate objects, as an alternative to initBinder(javax.portlet.PortletRequest, org.springframework.web.portlet.bind.PortletRequestDataBinder).

getWebBindingInitializer

public final WebBindingInitializer getWebBindingInitializer()
Deprecated.
Return the WebBindingInitializer (if any) which will apply pre-configured configuration to every DataBinder that this controller uses.

initApplicationContext

protected void initApplicationContext()
Deprecated.
Description copied from class: ApplicationObjectSupport
Subclasses can override this for custom initialization behavior.

The default implementation is empty. Called by ApplicationObjectSupport.initApplicationContext(org.springframework.context.ApplicationContext).

Overrides:
initApplicationContext in class ApplicationObjectSupport
See Also:
ApplicationObjectSupport.setApplicationContext(org.springframework.context.ApplicationContext)

getCommand

protected Object getCommand(javax.portlet.PortletRequest request)
                     throws Exception
Deprecated.
Retrieve a command object for the given request.

The default implementation calls createCommand(). Subclasses can override this.

Parameters:
request - current portlet request
Returns:
object command to bind onto
Throws:
Exception
See Also:
createCommand()

createCommand

protected final Object createCommand()
                              throws Exception
Deprecated.
Create a new command instance for the command class of this controller.

This implementation uses BeanUtils.instantiateClass, so the command needs to have a no-arg constructor (supposed to be public, but not required to).

Returns:
the new command instance
Throws:
Exception - if the command object could not be instantiated
See Also:
BeanUtils.instantiateClass(Class)

checkCommand

protected final boolean checkCommand(Object command)
Deprecated.
Check if the given command object is a valid for this controller, i.e. its command class.

Parameters:
command - the command object to check
Returns:
if the command object is valid for this controller

bindAndValidate

protected final PortletRequestDataBinder bindAndValidate(javax.portlet.PortletRequest request,
                                                         Object command)
                                                  throws Exception
Deprecated.
Bind the parameters of the given request to the given command object.

Parameters:
request - current portlet request
command - the command to bind onto
Returns:
the PortletRequestDataBinder instance for additional custom validation
Throws:
Exception - in case of invalid state or arguments

suppressBinding

protected boolean suppressBinding(javax.portlet.PortletRequest request)
Deprecated.
Return whether to suppress binding for the given request.

The default implementation always returns false. Can be overridden in subclasses to suppress validation: for example, if a special request parameter is set.

Parameters:
request - current portlet request
Returns:
whether to suppress binding for the given request
See Also:
suppressValidation(javax.portlet.PortletRequest)

createBinder

protected PortletRequestDataBinder createBinder(javax.portlet.PortletRequest request,
                                                Object command)
                                         throws Exception
Deprecated.
Create a new binder instance for the given command and request.

Called by bindAndValidate. Can be overridden to plug in custom PortletRequestDataBinder instances.

The default implementation creates a standard PortletRequestDataBinder and invokes prepareBinder and initBinder.

Note that neither prepareBinder nor initBinder will be invoked automatically if you override this method! Call those methods at appropriate points of your overridden method.

Parameters:
request - current portlet request
command - the command to bind onto
Returns:
the new binder instance
Throws:
Exception - in case of invalid state or arguments
See Also:
bindAndValidate(javax.portlet.PortletRequest, java.lang.Object),
prepareBinder(org.springframework.web.portlet.bind.PortletRequestDataBinder),
initBinder(javax.portlet.PortletRequest, org.springframework.web.portlet.bind.PortletRequestDataBinder)

prepareBinder

protected final void prepareBinder(PortletRequestDataBinder binder)
Deprecated.
Prepare the given binder, applying the specified MessageCodesResolver, BindingErrorProcessor and PropertyEditorRegistrars (if any). Called by createBinder.

Parameters:
binder - the new binder instance
See Also:
createBinder(javax.portlet.PortletRequest, java.lang.Object),
setMessageCodesResolver(org.springframework.validation.MessageCodesResolver),
setBindingErrorProcessor(org.springframework.validation.BindingErrorProcessor)

useDirectFieldAccess

protected boolean useDirectFieldAccess()
Deprecated.
Determine whether to use direct field access instead of bean property access. Applied by prepareBinder.

The default is false. Can be overridden in subclasses.

See Also:
prepareBinder(org.springframework.web.portlet.bind.PortletRequestDataBinder), DataBinder.initDirectFieldAccess()

initBinder

protected void initBinder(javax.portlet.PortletRequest request,
                          PortletRequestDataBinder binder)
                   throws Exception
Deprecated.
Initialize the given binder instance, for example with custom editors. Called by createBinder.

This method allows you to register custom editors for certain fields of your command class. For instance, you will be able to transform Date objects into a String pattern and back, in order to allow your JavaBeans to have Date properties and still be able to set and display them in an HTML interface.

The default implementation is empty.

Parameters:
request - current portlet request
binder - new binder instance
Throws:
Exception - in case of invalid state or arguments
See Also:
createBinder(javax.portlet.PortletRequest, java.lang.Object), DataBinder.registerCustomEditor(java.lang.Class, java.beans.PropertyEditor), CustomDateEditor

onBind

protected void onBind(javax.portlet.PortletRequest request,
                      Object command,
                      BindException errors)
               throws Exception
Deprecated.
Callback for custom post-processing in terms of binding. Called on each submit, after standard binding but before validation.

The default implementation delegates to onBind(request, command).

Parameters:
request - current portlet request
command - the command object to perform further binding on
errors - validation errors holder, allowing for additional custom registration of binding errors
Throws:
Exception - in case of invalid state or arguments
See Also:
bindAndValidate(javax.portlet.PortletRequest, java.lang.Object), onBind(PortletRequest, Object)

onBind

protected void onBind(javax.portlet.PortletRequest request,
                      Object command)
               throws Exception
Deprecated.
Callback for custom post-processing in terms of binding. Called by the default implementation of the onBind version with all parameters, after standard binding but before validation.

The default implementation is empty.

Parameters:
request - current portlet request
command - the command object to perform further binding on
Throws:
Exception - in case of invalid state or arguments
See Also:
onBind(PortletRequest, Object, BindException)

suppressValidation

protected boolean suppressValidation(javax.portlet.PortletRequest request)
Deprecated.
Return whether to suppress validation for the given request.

The default implementation always returns false. Can be overridden in subclasses to suppress validation: for example, if a special request parameter is set.

Parameters:
request - current portlet request
Returns:
whether to suppress validation for the given request

onBindAndValidate

protected void onBindAndValidate(javax.portlet.PortletRequest request,
                                 Object command,
                                 BindException errors)
                          throws Exception
Deprecated.
Callback for custom post-processing in terms of binding and validation. Called on each submit, after standard binding and validation, but before error evaluation.

The default implementation is empty.

Parameters:
request - current portlet request
command - the command object, still allowing for further binding
errors - validation errors holder, allowing for additional custom validation
Throws:
Exception - in case of invalid state or arguments
See Also:
bindAndValidate(javax.portlet.PortletRequest, java.lang.Object), Errors

getRenderCommandSessionAttributeName

protected String getRenderCommandSessionAttributeName()
Deprecated.
Return the name of the session attribute that holds the render phase command object for this form controller.

Returns:
the name of the render phase command object session attribute
See Also:
PortletSession.getAttribute(java.lang.String)

getRenderErrorsSessionAttributeName

protected String getRenderErrorsSessionAttributeName()
Deprecated.
Return the name of the session attribute that holds the render phase command object for this form controller.

Returns:
the name of the render phase command object session attribute
See Also:
PortletSession.getAttribute(java.lang.String)

getRenderCommand

protected final Object getRenderCommand(javax.portlet.RenderRequest request)
                                 throws javax.portlet.PortletException
Deprecated.
Get the command object cached for the render phase.

Throws:
javax.portlet.PortletException
See Also:
getRenderErrors(javax.portlet.RenderRequest),
getRenderCommandSessionAttributeName(),
setRenderCommandAndErrors(javax.portlet.ActionRequest, java.lang.Object, org.springframework.validation.BindException)

getRenderErrors

protected final BindException getRenderErrors(javax.portlet.RenderRequest request)
                                       throws javax.portlet.PortletException
Deprecated.
Get the bind and validation errors cached for the render phase.

Throws:
javax.portlet.PortletException
See Also:
getRenderCommand(javax.portlet.RenderRequest),
getRenderErrorsSessionAttributeName(),
setRenderCommandAndErrors(javax.portlet.ActionRequest, java.lang.Object, org.springframework.validation.BindException)

setRenderCommandAndErrors

protected final void setRenderCommandAndErrors(javax.portlet.ActionRequest request,
                                               Object command,
                                               BindException errors)
                                        throws Exception
Deprecated.
Set the command object and errors object for the render phase.

Parameters:
request - the current action request
command - the command object to preserve for the render phase
errors - the errors from binding and validation to preserve for the render phase
Throws:
Exception
See Also:
getRenderCommand(javax.portlet.RenderRequest),
getRenderErrors(javax.portlet.RenderRequest),
getRenderCommandSessionAttributeName(),
getRenderErrorsSessionAttributeName()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ParameterizableViewController

org.springframework.web.portlet.mvc
Class ParameterizableViewController

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.portlet.context.PortletApplicationObjectSupport
            extended by  org.springframework.web.portlet.handler.PortletContentGenerator
                extended by  org.springframework.web.portlet.mvc.AbstractController
                    extended by  org.springframework.web.portlet.mvc.ParameterizableViewController
All Implemented Interfaces:
ApplicationContextAware, PortletContextAware, Controller
public class ParameterizableViewController
extends AbstractController

Trivial controller that always returns a named view. The view can be configured using an exposed configuration property. This controller offers an alternative to sending a request straight to a view such as a JSP. The advantage here is that the client is not exposed to the concrete view technology but rather just to the controller URL; the concrete view will be determined by the ViewResolver.

Workflow (and that defined by superclass):

  1. Render request is received by the controller
  2. call to handleRenderRequestInternal which just returns the view, named by the configuration property viewName. Nothing more, nothing less

This controller does not handle action requests.

Exposed configuration properties (and those defined by superclass):

name | default | description
viewName | null | the name of the view the viewResolver will use to forward to (if this property is not set, an exception will be thrown during initialization)

Since:
2.0
Author:
John A. Lewis

Field Summary
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Constructor Summary
ParameterizableViewController()
Method Summary
String | getViewName() Return the name of the view to delegate to.
protected ModelAndView | handleRenderRequestInternal(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response) Return a ModelAndView object with the specified view name.
protected void | initApplicationContext() Subclasses can override this for custom initialization behavior.
void | setViewName(String viewName) Set the name of the view to delegate to.
Methods inherited from class org.springframework.web.portlet.mvc.AbstractController
handleActionRequest, handleActionRequestInternal, handleRenderRequest, isRenderWhenMinimized, isSynchronizeOnSession, setRenderWhenMinimized, setSynchronizeOnSession
Methods inherited from class org.springframework.web.portlet.handler.PortletContentGenerator
applyCacheSeconds, cacheForSeconds, check, checkAndPrepare, checkAndPrepare, getCacheSeconds, isRequireSession, preventCaching, setCacheSeconds, setRequireSession
Methods inherited from class org.springframework.web.portlet.context.PortletApplicationObjectSupport
getPortletContext, getTempDir, isContextRequired, setPortletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ParameterizableViewController

public ParameterizableViewController()
Method Detail

setViewName

public void setViewName(String viewName)
Set the name of the view to delegate to.

getViewName

public String getViewName()
Return the name of the view to delegate to.

initApplicationContext

protected void initApplicationContext()
Description copied from class: ApplicationObjectSupport
Subclasses can override this for custom initialization behavior.

The default implementation is empty. Called by ApplicationObjectSupport.initApplicationContext(org.springframework.context.ApplicationContext).

Overrides:
initApplicationContext in class ApplicationObjectSupport
See Also:
ApplicationObjectSupport.setApplicationContext(org.springframework.context.ApplicationContext)

handleRenderRequestInternal

protected ModelAndView handleRenderRequestInternal(javax.portlet.RenderRequest request,
                                                   javax.portlet.RenderResponse response)
                                            throws Exception
Return a ModelAndView object with the specified view name.

Overrides:
handleRenderRequestInternal in class AbstractController
Throws:
Exception
See Also:
AbstractController.handleRenderRequest(javax.portlet.RenderRequest, javax.portlet.RenderResponse), AbstractController.handleActionRequestInternal(javax.portlet.ActionRequest, javax.portlet.ActionResponse)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PortletModeNameViewController

org.springframework.web.portlet.mvc
Class PortletModeNameViewController

java.lang.Object
    extended by  org.springframework.web.portlet.mvc.PortletModeNameViewController
All Implemented Interfaces:
Controller
public class PortletModeNameViewController
extends Object
implements Controller

Trivial controller that transforms the PortletMode to a view name. The advantage here is that the client is not exposed to the concrete view technology but rather just to the controller URL; the concrete view will be determined by the ViewResolver.

Example: PortletMode.VIEW -> "view"

This controller does not handle action requests.

Since:
2.0
Author:
William G. Thompson, Jr., John A. Lewis

Constructor Summary
PortletModeNameViewController()
Method Summary
void | handleActionRequest(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response) Process the action request.
ModelAndView | handleRenderRequest(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response) Process the render request and return a ModelAndView object which the DispatcherPortlet will render.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PortletModeNameViewController

public PortletModeNameViewController()
Method Detail

handleActionRequest

public void handleActionRequest(javax.portlet.ActionRequest request,
                                javax.portlet.ActionResponse response)
                         throws Exception
Description copied from interface: Controller
Process the action request. There is nothing to return.

Specified by:
handleActionRequest in interface Controller
Parameters:
request - current portlet action request
response - current portlet action response
Throws:
Exception - in case of errors

handleRenderRequest

public ModelAndView handleRenderRequest(javax.portlet.RenderRequest request,
                                        javax.portlet.RenderResponse response)
Description copied from interface: Controller
Process the render request and return a ModelAndView object which the DispatcherPortlet will render. A null return value is not an error: It indicates that this object completed request processing itself, thus there is no ModelAndView to render.

Specified by:
handleRenderRequest in interface Controller
Parameters:
request - current portlet render request
response - current portlet render response
Returns:
a ModelAndView to render, or null if handled directly
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PortletWrappingController

org.springframework.web.portlet.mvc
Class PortletWrappingController

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.portlet.context.PortletApplicationObjectSupport
            extended by  org.springframework.web.portlet.handler.PortletContentGenerator
                extended by  org.springframework.web.portlet.mvc.AbstractController
                    extended by  org.springframework.web.portlet.mvc.PortletWrappingController
All Implemented Interfaces:
BeanNameAware, DisposableBean, InitializingBean, ApplicationContextAware, PortletConfigAware, PortletContextAware, Controller
public class PortletWrappingController
extends AbstractController
implements BeanNameAware, InitializingBean, DisposableBean, PortletContextAware, PortletConfigAware

Controller implementation that wraps a portlet instance which it manages internally. Such a wrapped portlet is not known outside of this controller; its entire lifecycle is covered here.

Useful to invoke an existing portlet via Spring's dispatching infrastructure, for example to apply Spring HandlerInterceptors to its requests.

Example:

<bean id="wrappingController" class="org.springframework.web.portlet.mvc.PortletWrappingController">
   <property name="portletClass">
     <value>org.springframework.web.portlet.sample.HelloWorldPortlet</value>
   </property>
   <property name="portletName">
     <value>hello-world</value>
   </property>
   <property name="initParameters">
     <props>
       <prop key="config">/WEB-INF/hello-world-portlet-config.xml</prop>
     </props>
   </property>
 </bean>

Since:
2.0
Author:
Juergen Hoeller, John A. Lewis

Field Summary
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Constructor Summary
PortletWrappingController()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
void | destroy() Invoked by a BeanFactory on destruction of a singleton.
protected void | handleActionRequestInternal(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response) Subclasses are meant to override this method if the controller is expected to handle action requests.
protected ModelAndView | handleRenderRequestInternal(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response) Subclasses are meant to override this method if the controller is expected to handle render requests.
void | setBeanName(String name) Set the name of the bean in the bean factory that created this bean.
void | setInitParameters(Map<String,String> initParameters) Specify init parameters for the portlet to wrap, as name-value pairs.
void | setPortletClass(Class portletClass) Set the class of the Portlet to wrap.
void | setPortletConfig(javax.portlet.PortletConfig portletConfig) Set the PortletConfigthat this object runs in.
void | setPortletContext(javax.portlet.PortletContext portletContext) Set the PortletContext that this object runs in.
void | setPortletName(String portletName) Set the name of the Portlet to wrap.
void | setUseSharedPortletConfig(boolean useSharedPortletConfig) Set whether to use the shared PortletConfig object passed in through setPortletConfig, if available.
Methods inherited from class org.springframework.web.portlet.mvc.AbstractController
handleActionRequest, handleRenderRequest, isRenderWhenMinimized, isSynchronizeOnSession, setRenderWhenMinimized, setSynchronizeOnSession
Methods inherited from class org.springframework.web.portlet.handler.PortletContentGenerator
applyCacheSeconds, cacheForSeconds, check, checkAndPrepare, checkAndPrepare, getCacheSeconds, isRequireSession, preventCaching, setCacheSeconds, setRequireSession
Methods inherited from class org.springframework.web.portlet.context.PortletApplicationObjectSupport
getPortletContext, getTempDir, isContextRequired
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PortletWrappingController

public PortletWrappingController()
Method Detail

setUseSharedPortletConfig

public void setUseSharedPortletConfig(boolean useSharedPortletConfig)
Set whether to use the shared PortletConfig object passed in through setPortletConfig, if available.

Default is "true". Turn this setting to "false" to pass in a mock PortletConfig object with the bean name as portlet name, holding the current PortletContext.

See Also:
setPortletConfig(javax.portlet.PortletConfig)

setPortletContext

public void setPortletContext(javax.portlet.PortletContext portletContext)
Description copied from interface: PortletContextAware
Set the PortletContext that this object runs in.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked after ApplicationContextAware's setApplicationContext.

Specified by:
setPortletContext in interface PortletContextAware
Overrides:
setPortletContext in class PortletApplicationObjectSupport
Parameters:
portletContext - PortletContext object to be used by this object

setPortletConfig

public void setPortletConfig(javax.portlet.PortletConfig portletConfig)
Description copied from interface: PortletConfigAware
Set the PortletConfigthat this object runs in.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked after ApplicationContextAware's setApplicationContext.

Specified by:
setPortletConfig in interface PortletConfigAware
Parameters:
portletConfig - PortletConfig object to be used by this object

setPortletClass

public void setPortletClass(Class portletClass)
Set the class of the Portlet to wrap. Needs to implement javax.portlet.Portlet.

See Also:
Portlet

setPortletName

public void setPortletName(String portletName)
Set the name of the Portlet to wrap. Default is the bean name of this controller.

setInitParameters

public void setInitParameters(Map<String,String> initParameters)
Specify init parameters for the portlet to wrap, as name-value pairs.

setBeanName

public void setBeanName(String name)
Description copied from interface: BeanNameAware
Set the name of the bean in the bean factory that created this bean.

Invoked after population of normal bean properties but before an init callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanName in interface BeanNameAware
Parameters:
name - the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use the BeanFactoryUtils.originalBeanName(String) method to extract the original bean name (without suffix), if desired.

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception - in the event of misconfiguration (such as failure to set an essential property) or if initialization fails.

handleActionRequestInternal

protected void handleActionRequestInternal(javax.portlet.ActionRequest request,
                                           javax.portlet.ActionResponse response)
                                    throws Exception
Description copied from class: AbstractController
Subclasses are meant to override this method if the controller is expected to handle action requests. The contract is the same as for handleActionRequest.

The default implementation throws a PortletException.

Overrides:
handleActionRequestInternal in class AbstractController
Throws:
Exception
See Also:
AbstractController.handleActionRequest(javax.portlet.ActionRequest, javax.portlet.ActionResponse), AbstractController.handleRenderRequestInternal(javax.portlet.RenderRequest, javax.portlet.RenderResponse)

handleRenderRequestInternal

protected ModelAndView handleRenderRequestInternal(javax.portlet.RenderRequest request,
                                                   javax.portlet.RenderResponse response)
                                            throws Exception
Description copied from class: AbstractController
Subclasses are meant to override this method if the controller is expected to handle render requests. The contract is the same as for handleRenderRequest.

The default implementation throws a PortletException.

Overrides:
handleRenderRequestInternal in class AbstractController
Throws:
Exception
See Also:
AbstractController.handleRenderRequest(javax.portlet.RenderRequest, javax.portlet.RenderResponse), AbstractController.handleActionRequestInternal(javax.portlet.ActionRequest, javax.portlet.ActionResponse)

destroy

public void destroy()
Description copied from interface: DisposableBean
Invoked by a BeanFactory on destruction of a singleton.

Specified by:
destroy in interface DisposableBean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleControllerHandlerAdapter

org.springframework.web.portlet.mvc
Class SimpleControllerHandlerAdapter

java.lang.Object
    extended by  org.springframework.web.portlet.mvc.SimpleControllerHandlerAdapter
All Implemented Interfaces:
PortletContextAware, HandlerAdapter
public class SimpleControllerHandlerAdapter
extends Object
implements HandlerAdapter, PortletContextAware

Adapter to use the Controller workflow interface with the generic DispatcherPortlet.

This is an SPI class, not used directly by application code.

Since:
2.0
Author:
Juergen Hoeller, John A. Lewis
See Also:
DispatcherPortlet, Controller, ResourceAwareController, EventAwareController

Constructor Summary
SimpleControllerHandlerAdapter()
Method Summary
void | handleAction(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response, Object handler) Use the given handler to handle this action request.
void | handleEvent(javax.portlet.EventRequest request, javax.portlet.EventResponse response, Object handler) Use the given handler to handle this event request.
ModelAndView | handleRender(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response, Object handler) Use the given handler to handle this render request.
ModelAndView | handleResource(javax.portlet.ResourceRequest request, javax.portlet.ResourceResponse response, Object handler) Use the given handler to handle this resource request.
void | setPortletContext(javax.portlet.PortletContext portletContext) Set the PortletContext that this object runs in.
boolean | supports(Object handler) Given a handler instance, return whether or not this HandlerAdapter can support it.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleControllerHandlerAdapter

public SimpleControllerHandlerAdapter()
Method Detail

setPortletContext

public void setPortletContext(javax.portlet.PortletContext portletContext)
Description copied from interface: PortletContextAware
Set the PortletContext that this object runs in.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked after ApplicationContextAware's setApplicationContext.

Specified by:
setPortletContext in interface PortletContextAware
Parameters:
portletContext - PortletContext object to be used by this object

supports

public boolean supports(Object handler)
Description copied from interface: HandlerAdapter
Given a handler instance, return whether or not this HandlerAdapter can support it. Typical HandlerAdapters will base the decision on the handler type. HandlerAdapters will usually only support one handler type each.

A typical implementation:

return (handler instanceof MyHandler);

Specified by:
supports in interface HandlerAdapter
Parameters:
handler - handler object to check
Returns:
whether or not this object can use the given handler

handleAction

public void handleAction(javax.portlet.ActionRequest request,
                         javax.portlet.ActionResponse response,
                         Object handler)
                  throws Exception
Description copied from interface: HandlerAdapter
Use the given handler to handle this action request. The workflow that is required may vary widely.

Specified by:
handleAction in interface HandlerAdapter
Parameters:
request - current action request
response - current action response
handler - handler to use. This object must have previously been passed to the supports method of this interface, which must have returned true.
Throws:
Exception - in case of errors
See Also:
Portlet.processAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse)

handleRender

public ModelAndView handleRender(javax.portlet.RenderRequest request,
                                 javax.portlet.RenderResponse response,
                                 Object handler)
                          throws Exception
Description copied from interface: HandlerAdapter
Use the given handler to handle this render request. The workflow that is required may vary widely.

Specified by:
handleRender in interface HandlerAdapter
Parameters:
request - current render request
response - current render response
handler - handler to use. This object must have previously been passed to the supports method of this interface, which must have returned true.
Returns:
ModelAndView object with the name of the view and the required model data, or null if the request has been handled directly
Throws:
Exception - in case of errors
See Also:
Portlet.render(javax.portlet.RenderRequest, javax.portlet.RenderResponse)

handleResource

public ModelAndView handleResource(javax.portlet.ResourceRequest request,
                                   javax.portlet.ResourceResponse response,
                                   Object handler)
                            throws Exception
Description copied from interface: HandlerAdapter
Use the given handler to handle this resource request. The workflow that is required may vary widely.

Specified by:
handleResource in interface HandlerAdapter
Parameters:
request - current render request
response - current render response
handler - handler to use. This object must have previously been passed to the supports method of this interface, which must have returned true.
Returns:
ModelAndView object with the name of the view and the required model data, or null if the request has been handled directly
Throws:
Exception - in case of errors
See Also:
ResourceServingPortlet.serveResource(javax.portlet.ResourceRequest, javax.portlet.ResourceResponse)

handleEvent

public void handleEvent(javax.portlet.EventRequest request,
                        javax.portlet.EventResponse response,
                        Object handler)
                 throws Exception
Description copied from interface: HandlerAdapter
Use the given handler to handle this event request. The workflow that is required may vary widely.

Specified by:
handleEvent in interface HandlerAdapter
Parameters:
request - current action request
response - current action response
handler - handler to use. This object must have previously been passed to the supports method of this interface, which must have returned true.
Throws:
Exception - in case of errors
See Also:
EventPortlet.processEvent(javax.portlet.EventRequest, javax.portlet.EventResponse)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleFormController

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.portlet.mvc
Class SimpleFormController

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.portlet.context.PortletApplicationObjectSupport
            extended by  org.springframework.web.portlet.handler.PortletContentGenerator
                extended by  org.springframework.web.portlet.mvc.AbstractController
                    extended by  org.springframework.web.portlet.mvc.BaseCommandController
                        extended by  org.springframework.web.portlet.mvc.AbstractFormController
                            extended by  org.springframework.web.portlet.mvc.SimpleFormController
All Implemented Interfaces:
ApplicationContextAware, PortletContextAware, Controller
Deprecated. as of Spring 3.0, in favor of annotated controllers

@Deprecated
public class SimpleFormController
extends AbstractFormController

Concrete FormController implementation that provides configurable form and success views, and an onSubmit chain for convenient overriding. Automatically resubmits to the form view in case of validation errors, and renders the success view in case of a valid submission.

The workflow of this Controller does not differ much from the one described in the AbstractFormController. The difference is that you do not need to implement showForm, processFormSubmission, and renderFormSubmission: A form view and a success view can be configured declaratively.

This controller is different from it's servlet counterpart in that it must take into account the two phases of a portlet request: the action phase and the render phase. See the JSR-168 spec for more details on these two phases. Be especially aware that the action phase is called only once, but that the render phase will be called repeatedly by the portal -- it does this every time the page containing the portlet is updated, even if the activity is in some other portlet. The main difference in the methods in this class is that the onSubmit methods have all been split into onSubmitAction and onSubmitRender to account for the two phases.

Workflow (in addition to the superclass):

  1. Call to processFormSubmission which inspects the Errors object to see if any errors have occurred during binding and validation.
  2. If errors occured, the controller will return the configured formView, showing the form again (possibly rendering according error messages).
  3. If isFormChangeRequest is overridden and returns true for the given request, the controller will return the formView too. In that case, the controller will also suppress validation. Before returning the formView, the controller will invoke onFormChange(javax.portlet.ActionRequest, javax.portlet.ActionResponse, java.lang.Object, org.springframework.validation.BindException), giving sub-classes a chance to make modification to the command object. This is intended for requests that change the structure of the form, which should not cause validation and show the form in any case.
  4. If no errors occurred, the controller will call onSubmitAction during the action phase and then onSubmitRender during the render phase, which in case of the default implementation delegate to onSubmitAction and onSubmitRender with just the command object. The default implementation of the latter method will return the configured successView. Consider just implementing doSubmitAction for simply performing a submit action during the action phase and then rendering the success view during the render phase.

The submit behavior can be customized by overriding one of the onSubmitAction or onSubmitRender methods. Submit actions can also perform custom validation if necessary (typically database-driven checks), calling showForm in case of validation errors to show the form view again. You do not have to override both the onSubmitAction and onSubmitRender methods at a given level unless you truly have custom logic to perform in both.

WARNING: Make sure that any one-time system updates (such as database updates or file writes) are performed in either an onSubmitAction method or the doSubmitAction method. Logic in the onSubmitRender methods may be executed repeatedly by the portal whenever the page containing the portlet is updated.

Exposed configuration properties (and those defined by superclass):

name | default | description
formView | null | Indicates what view to use when the user asks for a new form or when validation errors have occurred on form submission.
successView | null | Indicates what view to use when successful form submissions have occurred. Such a success view could e.g. display a submission summary. More sophisticated actions can be implemented by overriding one of the onSubmitRender() methods.

Parameters indicated with setPassRenderParameters will be preserved if the form has errors or if a form change request occurs. If there are render parameters you need in onSubmitRender, then you need to pass those forward from onSubmitAction.

Thanks to Rainer Schmitz and Nick Lothian for their suggestions!

Since:
2.0
Author:
John A. Lewis, Juergen Hoeller, Rob Harrop

Field Summary
Fields inherited from class org.springframework.web.portlet.mvc.BaseCommandController
DEFAULT_COMMAND_NAME
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Constructor Summary
SimpleFormController()
Deprecated. Create a new SimpleFormController.
Method Summary
protected  void doSubmitAction(Object command)
Deprecated. Template method for submit actions.
 String getFormView()
Deprecated. Return the name of the view that should be used for form display.
 String getSuccessView()
Deprecated. Return the name of the view that should be shown on successful submit.
protected  boolean isFormChangeRequest(javax.portlet.PortletRequest request)
Deprecated. Determine whether the given request is a form change request.
protected  void onFormChange(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response, Object command)
Deprecated. Simpler onFormChange variant, called by the full version onFormChange(request, response, command, errors).
protected  void onFormChange(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response, Object command, BindException errors)
Deprecated. Called during form submission if isFormChangeRequest(PortletRequest) returns true.
protected  void onSubmitAction(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response, Object command, BindException errors)
Deprecated. Submit action phase callback with all parameters.
protected  void onSubmitAction(Object command)
Deprecated. Simplest onSubmitAction version.
protected  void onSubmitAction(Object command, BindException errors)
Deprecated. Simpler onSubmitAction version.
protected  ModelAndView onSubmitRender(Object command)
Deprecated. Simplest onSubmitRender version.
protected  ModelAndView onSubmitRender(Object command, BindException errors)
Deprecated. Simpler onSubmitRender version.
protected  ModelAndView onSubmitRender(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response, Object command, BindException errors)
Deprecated. Submit render phase callback with all parameters.
protected  void processFormSubmission(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response, Object command, BindException errors)
Deprecated. This implementation does nothing in case of errors, and delegates to onSubmitAction's full version else.
protected  Map referenceData(javax.portlet.PortletRequest request)
Deprecated. Create a reference data map for the given request.
protected  Map referenceData(javax.portlet.PortletRequest request, Object command, Errors errors)
Deprecated. Create a reference data map for the given request and command, consisting of bean name/bean instance pairs as expected by ModelAndView.
protected  ModelAndView renderFormSubmission(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response, Object command, BindException errors)
Deprecated. This implementation calls showForm in case of errors, and delegates to onSubmitRender's full version else.
 void setFormView(String formView)
Deprecated. Set the name of the view that should be used for form display.
 void setSuccessView(String successView)
Deprecated. Set the name of the view that should be shown on successful submit.
protected  ModelAndView showForm(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response, BindException errors)
Deprecated. This implementation shows the configured form view, delegating to the analogous showForm version with a controlModel argument.
protected  ModelAndView showForm(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response, BindException errors, Map controlModel)
Deprecated. This implementation shows the configured form view.
protected  boolean suppressValidation(javax.portlet.PortletRequest request)
Deprecated. This implementation delegates to isFormChangeRequest(javax.portlet.PortletRequest): A form change request changes the appearance of the form and should not get validated but just show the new form.
Methods inherited from class org.springframework.web.portlet.mvc.AbstractFormController
formBackingObject, getCommand, getErrorsForNewForm, getFormSessionAttributeName, getFormSessionAttributeName, getFormSubmitParameterName, getInvalidSubmitParameterName, getRenderParameters, handleActionRequestInternal, handleInvalidSubmit, handleRenderRequestInternal, isBindOnNewForm, isFormSubmission, isInvalidSubmission, isRedirectAction, isSessionForm, onBindOnNewForm, onBindOnNewForm, passRenderParameters, renderInvalidSubmit, setBindOnNewForm, setFormSubmit, setInvalidSubmit, setRedirectAction, setRenderParameters, setSessionForm, showForm, showForm, showNewForm
Methods inherited from class org.springframework.web.portlet.mvc.BaseCommandController
bindAndValidate, checkCommand, createBinder, createCommand, getBindingErrorProcessor, getCommandClass, getCommandName, getMessageCodesResolver, getPropertyEditorRegistrars, getRenderCommand, getRenderCommandSessionAttributeName, getRenderErrors, getRenderErrorsSessionAttributeName, getValidator, getValidators, getWebBindingInitializer, initApplicationContext, initBinder, isValidateOnBinding, onBind, onBind, onBindAndValidate, prepareBinder, setBindingErrorProcessor, setCommandClass, setCommandName, setMessageCodesResolver, setPropertyEditorRegistrar, setPropertyEditorRegistrars, setRenderCommandAndErrors, setValidateOnBinding, setValidator, setValidators, setWebBindingInitializer, suppressBinding, useDirectFieldAccess
Methods inherited from class org.springframework.web.portlet.mvc.AbstractController
handleActionRequest, handleRenderRequest, isRenderWhenMinimized, isSynchronizeOnSession, setRenderWhenMinimized, setSynchronizeOnSession
Methods inherited from class org.springframework.web.portlet.handler.PortletContentGenerator
applyCacheSeconds, cacheForSeconds, check, checkAndPrepare, checkAndPrepare, getCacheSeconds, isRequireSession, preventCaching, setCacheSeconds, setRequireSession
Methods inherited from class org.springframework.web.portlet.context.PortletApplicationObjectSupport
getPortletContext, getTempDir, isContextRequired, setPortletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleFormController

public SimpleFormController()
Deprecated.
Create a new SimpleFormController.

Subclasses should set the following properties, either in the constructor or via a BeanFactory: commandName, commandClass, sessionForm, formView, successView. Note that commandClass doesn't need to be set when overriding formBackingObject, as this determines the class anyway.

See Also:
BaseCommandController.setCommandClass(Class),
BaseCommandController.setCommandName(String),
AbstractFormController.setSessionForm(boolean),
setFormView(java.lang.String),
setSuccessView(java.lang.String),
AbstractFormController.formBackingObject(PortletRequest)
Method Detail

setFormView

public final void setFormView(String formView)
Deprecated.
Set the name of the view that should be used for form display.

getFormView

public final String getFormView()
Deprecated.
Return the name of the view that should be used for form display.

setSuccessView

public final void setSuccessView(String successView)
Deprecated.
Set the name of the view that should be shown on successful submit.

getSuccessView

public final String getSuccessView()
Deprecated.
Return the name of the view that should be shown on successful submit.

showForm

protected ModelAndView showForm(javax.portlet.RenderRequest request,
                                javax.portlet.RenderResponse response,
                                BindException errors)
                         throws Exception
Deprecated.
This implementation shows the configured form view, delegating to the analogous showForm version with a controlModel argument.

Can be called within onSubmit implementations, to redirect back to the form in case of custom validation errors (i.e. not determined by the validator).

Can be overridden in subclasses to show a custom view, writing directly to the response or preparing the response before rendering a view.

If calling showForm with a custom control model in subclasses, it's preferable to override the analogous showForm version with a controlModel argument (which will handle both standard form showing and custom form showing then).

Specified by:
showForm in class AbstractFormController
Parameters:
request - current render request
response - current render response
errors - validation errors holder
Returns:
the prepared form view, or null if handled directly
Throws:
Exception - in case of invalid state or arguments
See Also:
setFormView(java.lang.String), showForm(RenderRequest, RenderResponse, BindException, Map)

showForm

protected ModelAndView showForm(javax.portlet.RenderRequest request,
                                javax.portlet.RenderResponse response,
                                BindException errors,
                                Map controlModel)
                         throws Exception
Deprecated.
This implementation shows the configured form view.

Can be called within onSubmit implementations, to redirect back to the form in case of custom validation errors (i.e. not determined by the validator).

Can be overridden in subclasses to show a custom view, writing directly to the response or preparing the response before rendering a view.

Parameters:
request - current render request
errors - validation errors holder
controlModel - model map containing controller-specific control data (e.g. current page in wizard-style controllers or special error message)
Returns:
the prepared form view
Throws:
Exception - in case of invalid state or arguments
See Also:
setFormView(java.lang.String)

referenceData

protected Map referenceData(javax.portlet.PortletRequest request,
                            Object command,
                            Errors errors)
                     throws Exception
Deprecated.
Create a reference data map for the given request and command, consisting of bean name/bean instance pairs as expected by ModelAndView.

The default implementation delegates to referenceData(PortletRequest). Subclasses can override this to set reference data used in the view.

Overrides:
referenceData in class AbstractFormController
Parameters:
request - current portlet request
command - form object with request parameters bound onto it
errors - validation errors holder
Returns:
a Map with reference data entries, or null if none
Throws:
Exception - in case of invalid state or arguments
See Also:
ModelAndView

referenceData

protected Map referenceData(javax.portlet.PortletRequest request)
                     throws Exception
Deprecated.
Create a reference data map for the given request. Called by referenceData version with all parameters.

The default implementation returns null. Subclasses can override this to set reference data used in the view.

Parameters:
request - current portlet request
Returns:
a Map with reference data entries, or null if none
Throws:
Exception - in case of invalid state or arguments
See Also:
referenceData(PortletRequest, Object, Errors), ModelAndView

renderFormSubmission

protected ModelAndView renderFormSubmission(javax.portlet.RenderRequest request,
                                            javax.portlet.RenderResponse response,
                                            Object command,
                                            BindException errors)
                                     throws Exception
Deprecated.
This implementation calls showForm in case of errors, and delegates to onSubmitRender's full version else.

This can only be overridden to check for an action that should be executed without respect to binding errors, like a cancel action. To just handle successful submissions without binding errors, override one of the onSubmitRender methods.

Specified by:
renderFormSubmission in class AbstractFormController
Parameters:
request - current render request
response - current render response
command - form object with request parameters bound onto it
errors - errors holder
Returns:
the prepared model and view, or null
Throws:
Exception - in case of errors
See Also:
showForm(RenderRequest, RenderResponse, BindException),
onSubmitRender(RenderRequest, RenderResponse, Object, BindException),
onSubmitRender(Object, BindException),
onSubmitRender(Object),
processFormSubmission(ActionRequest, ActionResponse, Object, BindException)

processFormSubmission

protected void processFormSubmission(javax.portlet.ActionRequest request,
                                     javax.portlet.ActionResponse response,
                                     Object command,
                                     BindException errors)
                              throws Exception
Deprecated.
This implementation does nothing in case of errors, and delegates to onSubmitAction's full version else.

This can only be overridden to check for an action that should be executed without respect to binding errors, like a cancel action. To just handle successful submissions without binding errors, override one of the onSubmitAction methods or doSubmitAction.

Specified by:
processFormSubmission in class AbstractFormController
Parameters:
request - current action request
response - current action response
command - form object with request parameters bound onto it
errors - errors holder (subclass can add errors if it wants to)
Throws:
Exception - in case of errors
See Also:
showForm(javax.portlet.RenderRequest, javax.portlet.RenderResponse, org.springframework.validation.BindException),
onSubmitAction(ActionRequest, ActionResponse, Object, BindException),
onSubmitAction(Object, BindException),
onSubmitAction(Object),
doSubmitAction(Object),
renderFormSubmission(RenderRequest, RenderResponse, Object, BindException)

suppressValidation

protected boolean suppressValidation(javax.portlet.PortletRequest request)
Deprecated.
This implementation delegates to isFormChangeRequest(javax.portlet.PortletRequest): A form change request changes the appearance of the form and should not get validated but just show the new form.

Overrides:
suppressValidation in class BaseCommandController
Parameters:
request - current portlet request
Returns:
whether to suppress validation for the given request
See Also:
isFormChangeRequest(javax.portlet.PortletRequest)

isFormChangeRequest

protected boolean isFormChangeRequest(javax.portlet.PortletRequest request)
Deprecated.
Determine whether the given request is a form change request. A form change request changes the appearance of the form and should always show the new form, without validation.

Gets called by suppressValidation(javax.portlet.PortletRequest) and processFormSubmission(javax.portlet.ActionRequest, javax.portlet.ActionResponse, java.lang.Object, org.springframework.validation.BindException). Consequently, this single method determines to suppress validation and to show the form view in any case.

The default implementation returns false

Parameters:
request - current portlet request
Returns:
whether the given request is a form change request
See Also:
suppressValidation(javax.portlet.PortletRequest), processFormSubmission(javax.portlet.ActionRequest, javax.portlet.ActionResponse, java.lang.Object, org.springframework.validation.BindException)

onFormChange

protected void onFormChange(javax.portlet.ActionRequest request,
                            javax.portlet.ActionResponse response,
                            Object command,
                            BindException errors)
                     throws Exception
Deprecated.
Called during form submission if isFormChangeRequest(PortletRequest) returns true. Allows subclasses to implement custom logic to modify the command object to directly modify data in the form.

The default implementation delegates to onFormChange(request, response, command).

Parameters:
request - current action request
response - current action response
command - form object with request parameters bound onto it
errors - validation errors holder, allowing for additional custom validation
Throws:
Exception - in case of errors
See Also:
isFormChangeRequest(PortletRequest), onFormChange(ActionRequest, ActionResponse, Object)

onFormChange

protected void onFormChange(javax.portlet.ActionRequest request,
                            javax.portlet.ActionResponse response,
                            Object command)
                     throws Exception
Deprecated.
Simpler onFormChange variant, called by the full version onFormChange(request, response, command, errors).

The default implementation is empty.

Parameters:
request - current action request
response - current action response
command - form object with request parameters bound onto it
Throws:
Exception - in case of errors
See Also:
onFormChange(ActionRequest, ActionResponse, Object, BindException)

onSubmitRender

protected ModelAndView onSubmitRender(javax.portlet.RenderRequest request,
                                      javax.portlet.RenderResponse response,
                                      Object command,
                                      BindException errors)
                               throws Exception
Deprecated.
Submit render phase callback with all parameters. Called in case of submit without errors reported by the registered validator, or on every submit if no validator.

The default implementation delegates to onSubmitRender(Object, BindException). For simply performing a submit action and rendering the specified success view, do not implement an onSubmitRender at all.

Subclasses can override this to provide custom rendering to display results of the action phase. Implementations can also call showForm to return to the form if the onSubmitAction failed custom validation. Do not implement multiple onSubmitRender methods: In that case, just this method will be called by the controller.

Call errors.getModel() to populate the ModelAndView model with the command and the Errors instance, under the specified command name, as expected by the "spring:bind" tag.

Parameters:
request - current render request
response - current render response
command - form object with request parameters bound onto it
errors - Errors instance without errors (subclass can add errors if it wants to)
Returns:
the prepared model and view
Throws:
Exception - in case of errors
See Also:
onSubmitAction(ActionRequest, ActionResponse, Object, BindException),
onSubmitRender(Object, BindException),
doSubmitAction(java.lang.Object),
showForm(javax.portlet.RenderRequest, javax.portlet.RenderResponse, org.springframework.validation.BindException),
Errors,
BindException.getModel()

onSubmitAction

protected void onSubmitAction(javax.portlet.ActionRequest request,
                              javax.portlet.ActionResponse response,
                              Object command,
                              BindException errors)
                       throws Exception
Deprecated.
Submit action phase callback with all parameters. Called in case of submit without errors reported by the registered validator respectively on every submit if no validator.

The default implementation delegates to onSubmitAction(Object, BindException). For simply performing a submit action consider implementing doSubmitAction rather than an onSubmitAction version.

Subclasses can override this to provide custom submission handling like storing the object to the database. Implementations can also perform custom validation and signal the render phase to call showForm to return to the form. Do not implement multiple onSubmitAction methods: In that case, just this method will be called by the controller.

Parameters:
request - current action request
response - current action response
command - form object with request parameters bound onto it
errors - Errors instance without errors (subclass can add errors if it wants to)
Throws:
Exception - in case of errors
See Also:
onSubmitRender(RenderRequest, RenderResponse, Object, BindException),
onSubmitAction(Object, BindException),
doSubmitAction(java.lang.Object),
Errors

onSubmitRender

protected ModelAndView onSubmitRender(Object command,
                                      BindException errors)
                               throws Exception
Deprecated.
Simpler onSubmitRender version. Called by the default implementation of the onSubmitRender version with all parameters.

The default implementation calls onSubmitRender(Object), using the returned ModelAndView if actually implemented in a subclass. Else, the default behavior will apply: rendering the success view with the command and Errors instance as model.

Subclasses can override this to provide custom submission handling that does not need request and response.

Call errors.getModel() to populate the ModelAndView model with the command and the Errors instance, under the specified command name, as expected by the "spring:bind" tag.

Parameters:
command - form object with request parameters bound onto it
errors - Errors instance without errors
Returns:
the prepared model and view, or null
Throws:
Exception - in case of errors
See Also:
onSubmitRender(RenderRequest, RenderResponse, Object, BindException), onSubmitRender(Object), onSubmitAction(Object, BindException), setSuccessView(java.lang.String), Errors, BindException.getModel()

onSubmitAction

protected void onSubmitAction(Object command,
                              BindException errors)
                       throws Exception
Deprecated.
Simpler onSubmitAction version. Called by the default implementation of the onSubmitAction version with all parameters.

The default implementation calls onSubmitAction(Object).

Subclasses can override this to provide custom submission handling that does not need request and response.

Parameters:
command - form object with request parameters bound onto it
errors - Errors instance without errors
Throws:
Exception - in case of errors
See Also:
onSubmitAction(ActionRequest, ActionResponse, Object, BindException), onSubmitAction(Object), onSubmitRender(Object, BindException), Errors

onSubmitRender

protected ModelAndView onSubmitRender(Object command)
                               throws Exception
Deprecated.
Simplest onSubmitRender version. Called by the default implementation of the onSubmitRender version with command and BindException parameters.

This implementation returns null as ModelAndView, making the calling onSubmitRender method perform its default rendering of the success view.

Subclasses can override this to provide custom submission handling that just depends on the command object.

Parameters:
command - form object with request parameters bound onto it
Returns:
the prepared model and view, or null for default (i.e. successView)
Throws:
Exception - in case of errors
See Also:
onSubmitRender(Object, BindException), onSubmitAction(Object), doSubmitAction(java.lang.Object), setSuccessView(java.lang.String)

onSubmitAction

protected void onSubmitAction(Object command)
                       throws Exception
Deprecated.
Simplest onSubmitAction version. Called by the default implementation of the onSubmitAction version with command and BindException parameters.

This implementation calls doSubmitAction.

Subclasses can override this to provide custom submission handling that just depends on the command object.

Parameters:
command - form object with request parameters bound onto it
Throws:
Exception - in case of errors
See Also:
onSubmitAction(Object, BindException), onSubmitRender(Object), doSubmitAction(java.lang.Object)

doSubmitAction

protected void doSubmitAction(Object command)
                       throws Exception
Deprecated.
Template method for submit actions. Called by the default implementation of the simplest onSubmitAction version.

This is the preferred submit callback to implement if you want to perform an action (like storing changes to the database) and then render the success view with the command and Errors instance as model.

Parameters:
command - form object with request parameters bound onto it
Throws:
Exception - in case of errors
See Also:
onSubmitAction(Object), onSubmitRender(Object), setSuccessView(java.lang.String)
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS | FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.portlet.mvc.annotation

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.portlet.mvc.annotation

Support package for annotation-based Portlet MVC controllers.

See:
Description

Class Summary
AnnotationMethodHandlerAdapter | Implementation of the HandlerAdapter interface that maps handler methods based on portlet modes, action/render phases and request parameters expressed through the RequestMapping annotation.
AnnotationMethodHandlerExceptionResolver | Implementation of the HandlerExceptionResolver interface that handles exceptions through the ExceptionHandler annotation.
DefaultAnnotationHandlerMapping | Implementation of the HandlerMapping interface that maps handlers based on portlet modes expressed through the RequestMapping annotation at the type or method level.

Package org.springframework.web.portlet.mvc.annotation Description

Support package for annotation-based Portlet MVC controllers.


org.springframework.web.portlet.mvc.annotation Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.portlet.mvc.annotation

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.web.portlet.handler.AbstractHandlerExceptionResolver (implements org.springframework.web.portlet.HandlerExceptionResolver, org.springframework.core.Ordered)
      • org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver
    • org.springframework.context.support.ApplicationObjectSupport (implements org.springframework.context.ApplicationContextAware)
      • org.springframework.web.portlet.handler.AbstractHandlerMapping (implements org.springframework.web.portlet.HandlerMapping, org.springframework.core.Ordered)
        • org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping<K>
          • org.springframework.web.portlet.mvc.annotation.DefaultAnnotationHandlerMapping
      • org.springframework.web.portlet.context.PortletApplicationObjectSupport (implements org.springframework.web.portlet.context.PortletContextAware)
        • org.springframework.web.portlet.handler.PortletContentGenerator
          • org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.web.portlet.HandlerAdapter, org.springframework.core.Ordered)


AnnotationMethodHandlerAdapter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.portlet.mvc.annotation
Class AnnotationMethodHandlerAdapter

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.portlet.context.PortletApplicationObjectSupport
            extended by  org.springframework.web.portlet.handler.PortletContentGenerator
                extended by  org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter
All Implemented Interfaces:
BeanFactoryAware, ApplicationContextAware, Ordered, PortletContextAware, HandlerAdapter
public class AnnotationMethodHandlerAdapter
extends PortletContentGenerator
implements HandlerAdapter, Ordered, BeanFactoryAware

Implementation of the HandlerAdapter interface that maps handler methods based on portlet modes, action/render phases and request parameters expressed through the RequestMapping annotation.

Supports request parameter binding through the RequestParam annotation. Also supports the ModelAttribute annotation for exposing model attribute values to the view, as well as InitBinder for binder initialization methods and SessionAttributes for automatic session management of specific attributes.

This adapter can be customized through various bean properties. A common use case is to apply shared binder initialization logic through a custom WebBindingInitializer.

Since:
2.5
Author:
Juergen Hoeller, Arjen Poutsma
See Also:
setWebBindingInitializer(org.springframework.web.bind.support.WebBindingInitializer), setSessionAttributeStore(org.springframework.web.bind.support.SessionAttributeStore)

Field Summary
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AnnotationMethodHandlerAdapter()
Method Summary
protected PortletRequestDataBinder | createBinder(javax.portlet.PortletRequest request, Object target, String objectName) Template method for creating a new PortletRequestDataBinder instance.
protected ModelAndView | doHandle(javax.portlet.PortletRequest request, javax.portlet.PortletResponse response, Object handler)
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
void | handleAction(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response, Object handler) Use the given handler to handle this action request.
void | handleEvent(javax.portlet.EventRequest request, javax.portlet.EventResponse response, Object handler) Use the given handler to handle this event request.
ModelAndView | handleRender(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response, Object handler) Use the given handler to handle this render request.
ModelAndView | handleResource(javax.portlet.ResourceRequest request, javax.portlet.ResourceResponse response, Object handler) Use the given handler to handle this resource request.
void | setBeanFactory(BeanFactory beanFactory) Callback that supplies the owning factory to a bean instance.
void | setCacheSecondsForSessionAttributeHandlers(int cacheSecondsForSessionAttributeHandlers) Cache content produced by @SessionAttributes annotated handlers for the given number of seconds.
void | setCustomArgumentResolver(WebArgumentResolver argumentResolver) Set a custom WebArgumentResolver to use for special method parameter types.
void | setCustomArgumentResolvers(WebArgumentResolver[] argumentResolvers) Set one or more custom WebArgumentResolvers to use for special method parameter types.
void | setCustomModelAndViewResolver(ModelAndViewResolver customModelAndViewResolver) Set a custom ModelAndViewResolvers to use for special method return types.
void | setCustomModelAndViewResolvers(ModelAndViewResolver[] customModelAndViewResolvers) Set one or more custom ModelAndViewResolvers to use for special method return types.
void | setOrder(int order) Specify the order value for this HandlerAdapter bean.
void | setParameterNameDiscoverer(ParameterNameDiscoverer parameterNameDiscoverer) Set the ParameterNameDiscoverer to use for resolving method parameter names if needed (e.g.
void | setSessionAttributeStore(SessionAttributeStore sessionAttributeStore) Specify the strategy to store session attributes with.
void | setSynchronizeOnSession(boolean synchronizeOnSession) Set if controller execution should be synchronized on the session, to serialize parallel invocations from the same client.
void | setWebBindingInitializer(WebBindingInitializer webBindingInitializer) Specify a WebBindingInitializer which will apply pre-configured configuration to every DataBinder that this controller uses.
boolean | supports(Object handler) Given a handler instance, return whether or not this HandlerAdapter can support it.
Methods inherited from class org.springframework.web.portlet.handler.PortletContentGenerator
applyCacheSeconds, cacheForSeconds, check, checkAndPrepare, checkAndPrepare, getCacheSeconds, isRequireSession, preventCaching, setCacheSeconds, setRequireSession
Methods inherited from class org.springframework.web.portlet.context.PortletApplicationObjectSupport
getPortletContext, getTempDir, isContextRequired, setPortletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AnnotationMethodHandlerAdapter

public AnnotationMethodHandlerAdapter()
Method Detail

setWebBindingInitializer

public void setWebBindingInitializer(WebBindingInitializer webBindingInitializer)
Specify a WebBindingInitializer which will apply pre-configured configuration to every DataBinder that this controller uses.

setSessionAttributeStore

public void setSessionAttributeStore(SessionAttributeStore sessionAttributeStore)
Specify the strategy to store session attributes with.

Default is DefaultSessionAttributeStore, storing session attributes in the PortletSession, using the same attribute name as in the model.

setCacheSecondsForSessionAttributeHandlers

public void setCacheSecondsForSessionAttributeHandlers(int cacheSecondsForSessionAttributeHandlers)
Cache content produced by @SessionAttributes annotated handlers for the given number of seconds. Default is 0, preventing caching completely.

In contrast to the "cacheSeconds" property which will apply to all general handlers (but not to @SessionAttributes annotated handlers), this setting will apply to @SessionAttributes annotated handlers only.

See Also:
PortletContentGenerator.setCacheSeconds(int), SessionAttributes

setSynchronizeOnSession

public void setSynchronizeOnSession(boolean synchronizeOnSession)
Set if controller execution should be synchronized on the session, to serialize parallel invocations from the same client.

More specifically, the execution of each handler method will get synchronized if this flag is "true". The best available session mutex will be used for the synchronization; ideally, this will be a mutex exposed by HttpSessionMutexListener.

The session mutex is guaranteed to be the same object during the entire lifetime of the session, available under the key defined by the SESSION_MUTEX_ATTRIBUTE constant. It serves as a safe reference to synchronize on for locking on the current session.

In many cases, the PortletSession reference itself is a safe mutex as well, since it will always be the same object reference for the same active logical session. However, this is not guaranteed across different servlet containers; the only 100% safe way is a session mutex.

See Also:
HttpSessionMutexListener, PortletUtils.getSessionMutex(javax.portlet.PortletSession)

setParameterNameDiscoverer

public void setParameterNameDiscoverer(ParameterNameDiscoverer parameterNameDiscoverer)
Set the ParameterNameDiscoverer to use for resolving method parameter names if needed (e.g. for default attribute names).

Default is a LocalVariableTableParameterNameDiscoverer.

setCustomArgumentResolver

public void setCustomArgumentResolver(WebArgumentResolver argumentResolver)
Set a custom WebArgumentResolver to use for special method parameter types. Such a custom WebArgumentResolver will kick in first, having a chance to resolve an argument value before the standard argument handling kicks in.

setCustomArgumentResolvers

public void setCustomArgumentResolvers(WebArgumentResolver[] argumentResolvers)
Set one or more custom WebArgumentResolvers to use for special method parameter types. Any such custom WebArgumentResolver will kick in first, having a chance to resolve an argument value before the standard argument handling kicks in.

setCustomModelAndViewResolver

public void setCustomModelAndViewResolver(ModelAndViewResolver customModelAndViewResolver)
Set a custom ModelAndViewResolvers to use for special method return types. Such a custom ModelAndViewResolver will kick in first, having a chance to resolve an return value before the standard ModelAndView handling kicks in.

setCustomModelAndViewResolvers

public void setCustomModelAndViewResolvers(ModelAndViewResolver[] customModelAndViewResolvers)
Set one or more custom ModelAndViewResolvers to use for special method return types. Any such custom ModelAndViewResolver will kick in first, having a chance to resolve an return value before the standard ModelAndView handling kicks in.

setOrder

public void setOrder(int order)
Specify the order value for this HandlerAdapter bean.

Default value is Integer.MAX_VALUE, meaning that it's non-ordered.

See Also:
Ordered.getOrder()

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
BeanInitializationException

supports

public boolean supports(Object handler)
Description copied from interface: HandlerAdapter
Given a handler instance, return whether or not this HandlerAdapter can support it. Typical HandlerAdapters will base the decision on the handler type. HandlerAdapters will usually only support one handler type each.

A typical implementation:

return (handler instanceof MyHandler);

Specified by:
supports in interface HandlerAdapter
Parameters:
handler - handler object to check
Returns:
whether or not this object can use the given handler

handleAction

public void handleAction(javax.portlet.ActionRequest request,
                         javax.portlet.ActionResponse response,
                         Object handler)
                  throws Exception
Description copied from interface: HandlerAdapter
Use the given handler to handle this action request. The workflow that is required may vary widely.

Specified by:
handleAction in interface HandlerAdapter
Parameters:
request - current action request
response - current action response
handler - handler to use. This object must have previously been passed to the supports method of this interface, which must have returned true.
Throws:
Exception - in case of errors
See Also:
Portlet.processAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse)

handleRender

public ModelAndView handleRender(javax.portlet.RenderRequest request,
                                 javax.portlet.RenderResponse response,
                                 Object handler)
                          throws Exception
Description copied from interface: HandlerAdapter
Use the given handler to handle this render request. The workflow that is required may vary widely.

Specified by:
handleRender in interface HandlerAdapter
Parameters:
request - current render request
response - current render response
handler - handler to use. This object must have previously been passed to the supports method of this interface, which must have returned true.
Returns:
ModelAndView object with the name of the view and the required model data, or null if the request has been handled directly
Throws:
Exception - in case of errors
See Also:
Portlet.render(javax.portlet.RenderRequest, javax.portlet.RenderResponse)

handleResource

public ModelAndView handleResource(javax.portlet.ResourceRequest request,
                                   javax.portlet.ResourceResponse response,
                                   Object handler)
                            throws Exception
Description copied from interface: HandlerAdapter
Use the given handler to handle this resource request. The workflow that is required may vary widely.

Specified by:
handleResource in interface HandlerAdapter
Parameters:
request - current render request
response - current render response
handler - handler to use. This object must have previously been passed to the supports method of this interface, which must have returned true.
Returns:
ModelAndView object with the name of the view and the required model data, or null if the request has been handled directly
Throws:
Exception - in case of errors
See Also:
ResourceServingPortlet.serveResource(javax.portlet.ResourceRequest, javax.portlet.ResourceResponse)

handleEvent

public void handleEvent(javax.portlet.EventRequest request,
                        javax.portlet.EventResponse response,
                        Object handler)
                 throws Exception
Description copied from interface: HandlerAdapter
Use the given handler to handle this event request. The workflow that is required may vary widely.

Specified by:
handleEvent in interface HandlerAdapter
Parameters:
request - current action request
response - current action response
handler - handler to use. This object must have previously been passed to the supports method of this interface, which must have returned true.
Throws:
Exception - in case of errors
See Also:
EventPortlet.processEvent(javax.portlet.EventRequest, javax.portlet.EventResponse)

doHandle

protected ModelAndView doHandle(javax.portlet.PortletRequest request,
                                javax.portlet.PortletResponse response,
                                Object handler)
                         throws Exception
Throws:
Exception

createBinder

protected PortletRequestDataBinder createBinder(javax.portlet.PortletRequest request,
                                                Object target,
                                                String objectName)
                                         throws Exception
Template method for creating a new PortletRequestDataBinder instance.

The default implementation creates a standard PortletRequestDataBinder. This can be overridden for custom PortletRequestDataBinder subclasses.

Parameters:
request - current portlet request
target - the target object to bind onto (or null if the binder is just used to convert a plain parameter value)
objectName - the objectName of the target object
Returns:
the PortletRequestDataBinder instance to use
Throws:
Exception - in case of invalid state or arguments
See Also:
PortletRequestDataBinder.bind(javax.portlet.PortletRequest), DataBinder.convertIfNecessary(Object, Class, MethodParameter)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AnnotationMethodHandlerExceptionResolver

org.springframework.web.portlet.mvc.annotation
Class AnnotationMethodHandlerExceptionResolver

java.lang.Object
    extended by  org.springframework.web.portlet.handler.AbstractHandlerExceptionResolver
        extended by  org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver
All Implemented Interfaces:
Ordered, HandlerExceptionResolver
public class AnnotationMethodHandlerExceptionResolver
extends AbstractHandlerExceptionResolver

Implementation of the HandlerExceptionResolver interface that handles exceptions through the ExceptionHandler annotation.

This exception resolver is enabled by default in the DispatcherPortlet.

Since:
3.0
Author:
Arjen Poutsma

Field Summary
Fields inherited from class org.springframework.web.portlet.handler.AbstractHandlerExceptionResolver
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AnnotationMethodHandlerExceptionResolver()
Method Summary
protected ModelAndView | doResolveException(javax.portlet.PortletRequest request, javax.portlet.MimeResponse response, Object handler, Exception ex) Actually resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.
protected List<Class<? extends Throwable>> | getHandledExceptions(Method method) Returns all the exception classes handled by the given method.
protected Object | resolveCommonArgument(MethodParameter methodParameter, NativeWebRequest webRequest, Exception thrownException) Resolves common method arguments.
protected Object | resolveStandardArgument(Class parameterType, NativeWebRequest webRequest, Exception thrownException) Resolves standard method arguments.
void | setCustomArgumentResolver(WebArgumentResolver argumentResolver) Set a custom ArgumentResolvers to use for special method parameter types.
void | setCustomArgumentResolvers(WebArgumentResolver[] argumentResolvers) Set one or more custom ArgumentResolvers to use for special method parameter types.
Methods inherited from class org.springframework.web.portlet.handler.AbstractHandlerExceptionResolver
buildLogMessage, getOrder, logException, resolveException, resolveException, setMappedHandlerClasses, setMappedHandlers, setOrder, setRenderWhenMinimized, setWarnLogCategory, shouldApplyTo
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AnnotationMethodHandlerExceptionResolver

public AnnotationMethodHandlerExceptionResolver()
Method Detail

setCustomArgumentResolver

public void setCustomArgumentResolver(WebArgumentResolver argumentResolver)
Set a custom ArgumentResolvers to use for special method parameter types. Such a custom ArgumentResolver will kick in first, having a chance to resolve an argument value before the standard argument handling kicks in.

setCustomArgumentResolvers

public void setCustomArgumentResolvers(WebArgumentResolver[] argumentResolvers)
Set one or more custom ArgumentResolvers to use for special method parameter types. Any such custom ArgumentResolver will kick in first, having a chance to resolve an argument value before the standard argument handling kicks in.

doResolveException

protected ModelAndView doResolveException(javax.portlet.PortletRequest request,
                                          javax.portlet.MimeResponse response,
                                          Object handler,
                                          Exception ex)
Description copied from class: AbstractHandlerExceptionResolver
Actually resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.

Must be overridden in subclasses, in order to apply specific exception checks. Note that this template method will be invoked after checking whether this resolved applies ("mappedHandlers" etc), so an implementation may simply proceed with its actual exception handling.

Specified by:
doResolveException in class AbstractHandlerExceptionResolver
Parameters:
request - current portlet request
response - current portlet response
handler - the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
ex - the exception that got thrown during handler execution
Returns:
a corresponding ModelAndView to forward to, or null for default processing

getHandledExceptions

protected List<Class<? extends Throwable>> getHandledExceptions(Method method)
Returns all the exception classes handled by the given method.

Default implementation looks for exceptions in the annotation, or - if that annotation element is empty - any exceptions listed in the method parameters if the method is annotated with @ExceptionHandler.

Parameters:
method - the method
Returns:
the handled exceptions

resolveCommonArgument

protected Object resolveCommonArgument(MethodParameter methodParameter,
                                       NativeWebRequest webRequest,
                                       Exception thrownException)
                                throws Exception
Resolves common method arguments. Delegates to registered argumentResolvers first, then checking resolveStandardArgument(java.lang.Class, org.springframework.web.context.request.NativeWebRequest, java.lang.Exception).

Parameters:
methodParameter - the method parameter
webRequest - the request
thrownException - the exception thrown
Returns:
the argument value, or WebArgumentResolver.UNRESOLVED
Throws:
Exception

resolveStandardArgument

protected Object resolveStandardArgument(Class parameterType,
                                         NativeWebRequest webRequest,
                                         Exception thrownException)
                                  throws Exception
Resolves standard method arguments. The default implementation handles NativeWebRequest, ServletRequest, ServletResponse, HttpSession, Principal, Locale, request InputStream, request Reader, response OutputStream, response Writer, and the given thrownException.

Parameters:
parameterType - the method parameter type
webRequest - the request
thrownException - the exception thrown
Returns:
the argument value, or WebArgumentResolver.UNRESOLVED
Throws:
Exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultAnnotationHandlerMapping

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.portlet.mvc.annotation
Class DefaultAnnotationHandlerMapping

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.portlet.handler.AbstractHandlerMapping
            extended by  org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping<javax.portlet.PortletMode>
                extended by  org.springframework.web.portlet.mvc.annotation.DefaultAnnotationHandlerMapping
All Implemented Interfaces:
ApplicationContextAware, Ordered, HandlerMapping
public class DefaultAnnotationHandlerMapping
extends AbstractMapBasedHandlerMapping<javax.portlet.PortletMode>

Implementation of the HandlerMapping interface that maps handlers based on portlet modes expressed through the RequestMapping annotation at the type or method level.

Registered by default in DispatcherPortlet on Java 5+. NOTE: If you define custom HandlerMapping beans in your DispatcherPortlet context, you need to add a DefaultAnnotationHandlerMapping bean explicitly, since custom HandlerMapping beans replace the default mapping strategies. Defining a DefaultAnnotationHandlerMapping also allows for registering custom interceptors:

 <bean class="org.springframework.web.portlet.mvc.annotation.DefaultAnnotationHandlerMapping">
   <property name="interceptors">
     ...
   </property>
 </bean>
Annotated controllers are usually marked with the Controller stereotype at the type level. This is not strictly necessary when RequestMapping is applied at the type level (since such a handler usually implements the Controller interface). However, Controller is required for detecting RequestMapping annotations at the method level.

NOTE: Method-level mappings are only allowed to narrow the mapping expressed at the class level (if any). A portlet mode in combination with specific parameter conditions needs to uniquely map onto one specific handler bean, not spread across multiple handler beans. It is strongly recommended to co-locate related handler methods into the same bean.

The AnnotationMethodHandlerAdapter is responsible for processing annotated handler methods, as mapped by this HandlerMapping. For RequestMapping at the type level, specific HandlerAdapters such as SimpleControllerHandlerAdapter apply.

Since:
2.5
Author:
Juergen Hoeller
See Also:
RequestMapping, AnnotationMethodHandlerAdapter

Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping
AbstractMapBasedHandlerMapping.PortletRequestMappingPredicate
Field Summary
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
DefaultAnnotationHandlerMapping()
Method Summary
protected boolean | detectHandlerMethods(Class handlerType, String beanName, RequestMapping typeMapping) Derive portlet mode mappings from the handler's method-level mappings.
protected void | detectHandlers() Register all handlers specified in the Portlet mode map for the corresponding modes.
protected javax.portlet.PortletMode | getLookupKey(javax.portlet.PortletRequest request) Uses the current PortletMode as lookup key.
void | initApplicationContext() Calls the registerHandlers method in addition to the superclass's initialization.
protected void | validateHandler(Object handler, javax.portlet.PortletRequest request) Validate the given annotated handler against the current request.
protected void | validateMapping(RequestMapping mapping, javax.portlet.PortletRequest request) Validate the given type-level mapping metadata against the current request, checking HTTP request method and parameter conditions.
Methods inherited from class org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping
getHandlerInternal, registerHandler, registerHandler, registerHandlers, setLazyInitHandlers
Methods inherited from class org.springframework.web.portlet.handler.AbstractHandlerMapping
adaptInterceptor, extendInterceptors, getAdaptedInterceptors, getDefaultHandler, getHandler, getHandlerExecutionChain, getOrder, initInterceptors, setApplyWebRequestInterceptorsToRenderPhaseOnly, setDefaultHandler, setInterceptors, setOrder
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, isContextRequired, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DefaultAnnotationHandlerMapping

public DefaultAnnotationHandlerMapping()
Method Detail

initApplicationContext

public void initApplicationContext()
                            throws BeansException
Calls the registerHandlers method in addition to the superclass's initialization.

Overrides:
initApplicationContext in class AbstractHandlerMapping
Throws:
ApplicationContextException - in case of initialization errors
BeansException - if thrown by ApplicationContext methods
See Also:
detectHandlers()

detectHandlers

protected void detectHandlers()
                       throws BeansException
Register all handlers specified in the Portlet mode map for the corresponding modes.

Throws:
BeansException - if the handler couldn't be registered

detectHandlerMethods

protected boolean detectHandlerMethods(Class handlerType,
                                       String beanName,
                                       RequestMapping typeMapping)
Derive portlet mode mappings from the handler's method-level mappings.

Parameters:
handlerType - the handler type to introspect
beanName - the name of the bean introspected
typeMapping - the type level mapping (if any)
Returns:
true if at least 1 handler method has been registered; false otherwise

getLookupKey

protected javax.portlet.PortletMode getLookupKey(javax.portlet.PortletRequest request)
                                          throws Exception
Uses the current PortletMode as lookup key.

Specified by:
getLookupKey in class AbstractMapBasedHandlerMapping<javax.portlet.PortletMode>
Parameters:
request - current portlet request
Returns:
the lookup key (never null)
Throws:
Exception - if key computation failed

validateHandler

protected void validateHandler(Object handler,
                               javax.portlet.PortletRequest request)
                        throws Exception
Validate the given annotated handler against the current request.

Throws:
Exception
See Also:
validateMapping(org.springframework.web.bind.annotation.RequestMapping, javax.portlet.PortletRequest)

validateMapping

protected void validateMapping(RequestMapping mapping,
                               javax.portlet.PortletRequest request)
                        throws Exception
Validate the given type-level mapping metadata against the current request, checking HTTP request method and parameter conditions.

Parameters:
mapping - the mapping metadata to validate
request - current HTTP request
Throws:
Exception - if validation failed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.portlet.util

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.portlet.util

Miscellaneous portlet utility classes.

See:
Description

Class Summary
PortletUtils Miscellaneous utilities for portlet applications.

Package org.springframework.web.portlet.util Description

Miscellaneous portlet utility classes.


org.springframework.web.portlet.util Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.portlet.util

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.web.portlet.util.PortletUtils


PortletUtils

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.portlet.util
Class PortletUtils

java.lang.Object
    extended by  org.springframework.web.portlet.util.PortletUtils

public abstract class PortletUtils
extends Object

Miscellaneous utilities for portlet applications. Used by various framework classes.

Since:
2.0
Author:
Juergen Hoeller, William G. Thompson, Jr., John A. Lewis

Constructor Summary
PortletUtils()
Method Summary
static void clearAllRenderParameters(javax.portlet.ActionResponse response)
Clear all the render parameters from the ActionResponse.
static void exposeRequestAttributes(javax.portlet.PortletRequest request, Map<String,?> attributes)
Expose the given Map as request attributes, using the keys as attribute names and the values as corresponding attribute values.
static Cookie getCookie(javax.portlet.PortletRequest request, String name)
Retrieve the first cookie with the given name.
static Object getOrCreateSessionAttribute(javax.portlet.PortletSession session, String name, Class clazz)
Get the specified session attribute under the PortletSession.PORTLET_SCOPE, creating and setting a new attribute if no existing found.
static Object getOrCreateSessionAttribute(javax.portlet.PortletSession session, String name, Class clazz, int scope)
Get the specified session attribute in the given scope, creating and setting a new attribute if no existing found.
static Map<String,Object> getParametersStartingWith(javax.portlet.PortletRequest request, String prefix)
Return a map containing all parameters with the given prefix.
static String getRealPath(javax.portlet.PortletContext portletContext, String path)
Return the real path of the given path within the web application, as provided by the portlet container.
static Object getRequiredSessionAttribute(javax.portlet.PortletRequest request, String name)
Check the given request for a session attribute of the given name under the PortletSession.PORTLET_SCOPE.
static Object getRequiredSessionAttribute(javax.portlet.PortletRequest request, String name, int scope)
Check the given request for a session attribute of the given name in the given scope.
static Object getSessionAttribute(javax.portlet.PortletRequest request, String name)
Check the given request for a session attribute of the given name under the PortletSession.PORTLET_SCOPE.
static Object getSessionAttribute(javax.portlet.PortletRequest request, String name, int scope)
Check the given request for a session attribute of the given name in the given scope.
static Object getSessionMutex(javax.portlet.PortletSession session)
Return the best available mutex for the given session: that is, an object to synchronize on for the given session.
static String getSubmitParameter(javax.portlet.PortletRequest request, String name)
Return the full name of a specific input type="submit" parameter if it was sent in the request, either via a button (directly with name) or via an image (name + ".x" or name + ".y").
static int getTargetPage(javax.portlet.PortletRequest request, String paramPrefix, int currentPage)
Return the target page specified in the request.
static File getTempDir(javax.portlet.PortletContext portletContext)
Return the temporary directory for the current web application, as provided by the portlet container.
static boolean hasSubmitParameter(javax.portlet.PortletRequest request, String name)
Check if a specific input type="submit" parameter was sent in the request, either via a button (directly with name) or via an image (name + ".x" or name + ".y").
static void passAllParametersToRenderPhase(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response)
Pass all the action request parameters to the render phase by putting them into the action response object.
static void setSessionAttribute(javax.portlet.PortletRequest request, String name, Object value)
Set the session attribute with the given name to the given value under the PortletSession.PORTLET_SCOPE.
static void setSessionAttribute(javax.portlet.PortletRequest request, String name, Object value, int scope)
Set the session attribute with the given name to the given value in the given scope.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PortletUtils

public PortletUtils()
Method Detail

getTempDir

public static File getTempDir(javax.portlet.PortletContext portletContext)
Return the temporary directory for the current web application, as provided by the portlet container.

Parameters:
portletContext - the portlet context of the web application
Returns:
the File representing the temporary directory

getRealPath

public static String getRealPath(javax.portlet.PortletContext portletContext,
                                 String path)
                          throws FileNotFoundException
Return the real path of the given path within the web application, as provided by the portlet container.

Prepends a slash if the path does not already start with a slash, and throws a FileNotFoundException if the path cannot be resolved to a resource (in contrast to PortletContext's getRealPath, which simply returns null).

Parameters:
portletContext - the portlet context of the web application
path - the relative path within the web application
Returns:
the corresponding real path
Throws:
FileNotFoundException - if the path cannot be resolved to a resource
See Also:
PortletContext.getRealPath(java.lang.String)

getSessionAttribute

public static Object getSessionAttribute(javax.portlet.PortletRequest request,
                                         String name)
Check the given request for a session attribute of the given name under the PortletSession.PORTLET_SCOPE. Returns null if there is no session or if the session has no such attribute in that scope. Does not create a new session if none has existed before!

Parameters:
request - current portlet request
name - the name of the session attribute
Returns:
the value of the session attribute, or null if not found

getSessionAttribute

public static Object getSessionAttribute(javax.portlet.PortletRequest request,
                                         String name,
                                         int scope)
Check the given request for a session attribute of the given name in the given scope. Returns null if there is no session or if the session has no such attribute in that scope. Does not create a new session if none has existed before!

Parameters:
request - current portlet request
name - the name of the session attribute
scope - session scope of this attribute
Returns:
the value of the session attribute, or null if not found

getRequiredSessionAttribute

public static Object getRequiredSessionAttribute(javax.portlet.PortletRequest request,
                                                 String name)
                                          throws IllegalStateException
Check the given request for a session attribute of the given name under the PortletSession.PORTLET_SCOPE. Throws an exception if there is no session or if the session has no such attribute in that scope.

Does not create a new session if none has existed before!

Parameters:
request - current portlet request
name - the name of the session attribute
Returns:
the value of the session attribute
Throws:
IllegalStateException - if the session attribute could not be found

getRequiredSessionAttribute

public static Object getRequiredSessionAttribute(javax.portlet.PortletRequest request,
                                                 String name,
                                                 int scope)
                                          throws IllegalStateException
Check the given request for a session attribute of the given name in the given scope. Throws an exception if there is no session or if the session has no such attribute in that scope.

Does not create a new session if none has existed before!

Parameters:
request - current portlet request
name - the name of the session attribute
scope - session scope of this attribute
Returns:
the value of the session attribute
Throws:
IllegalStateException - if the session attribute could not be found

setSessionAttribute

public static void setSessionAttribute(javax.portlet.PortletRequest request,
                                       String name,
                                       Object value)
Set the session attribute with the given name to the given value under the PortletSession.PORTLET_SCOPE. Removes the session attribute if value is null, if a session existed at all. Does not create a new session if not necessary!

Parameters:
request - current portlet request
name - the name of the session attribute
value - the value of the session attribute

setSessionAttribute

public static void setSessionAttribute(javax.portlet.PortletRequest request,
                                       String name,
                                       Object value,
                                       int scope)
Set the session attribute with the given name to the given value in the given scope. Removes the session attribute if value is null, if a session existed at all. Does not create a new session if not necessary!

Parameters:
request - current portlet request
name - the name of the session attribute
value - the value of the session attribute
scope - session scope of this attribute

getOrCreateSessionAttribute

public static Object getOrCreateSessionAttribute(javax.portlet.PortletSession session,
                                                 String name,
                                                 Class clazz)
                                          throws IllegalArgumentException
Get the specified session attribute under the PortletSession.PORTLET_SCOPE, creating and setting a new attribute if no existing found. The given class needs to have a public no-arg constructor. Useful for on-demand state objects in a web tier, like shopping carts.

Parameters:
session - current portlet session
name - the name of the session attribute
clazz - the class to instantiate for a new attribute
Returns:
the value of the session attribute, newly created if not found
Throws:
IllegalArgumentException - if the session attribute could not be instantiated

getOrCreateSessionAttribute

public static Object getOrCreateSessionAttribute(javax.portlet.PortletSession session,
                                                 String name,
                                                 Class clazz,
                                                 int scope)
                                          throws IllegalArgumentException
Get the specified session attribute in the given scope, creating and setting a new attribute if no existing found. The given class needs to have a public no-arg constructor. Useful for on-demand state objects in a web tier, like shopping carts.

Parameters:
session - current portlet session
name - the name of the session attribute
clazz - the class to instantiate for a new attribute
scope - the session scope of this attribute
Returns:
the value of the session attribute, newly created if not found
Throws:
IllegalArgumentException - if the session attribute could not be instantiated

getSessionMutex

public static Object getSessionMutex(javax.portlet.PortletSession session)
Return the best available mutex for the given session: that is, an object to synchronize on for the given session.

Returns the session mutex attribute if available; usually, this means that the HttpSessionMutexListener needs to be defined in web.xml. Falls back to the PortletSession itself if no mutex attribute found.

The session mutex is guaranteed to be the same object during the entire lifetime of the session, available under the key defined by the WebUtils.SESSION_MUTEX_ATTRIBUTE constant. It serves as a safe reference to synchronize on for locking on the current session.

In many cases, the PortletSession reference itself is a safe mutex as well, since it will always be the same object reference for the same active logical session. However, this is not guaranteed across different servlet containers; the only 100% safe way is a session mutex.

Parameters:
session - the HttpSession to find a mutex for
Returns:
the mutex object (never null)
See Also:
WebUtils.SESSION_MUTEX_ATTRIBUTE, HttpSessionMutexListener

exposeRequestAttributes

public static void exposeRequestAttributes(javax.portlet.PortletRequest request,
                                           Map<String,?> attributes)
Expose the given Map as request attributes, using the keys as attribute names and the values as corresponding attribute values. Keys must be Strings.

Parameters:
request - current portlet request
attributes - the attributes Map

getCookie

public static Cookie getCookie(javax.portlet.PortletRequest request,
                               String name)
Retrieve the first cookie with the given name. Note that multiple cookies can have the same name but different paths or domains.

Parameters:
request - current servlet request
name - cookie name
Returns:
the first cookie with the given name, or null if none is found

hasSubmitParameter

public static boolean hasSubmitParameter(javax.portlet.PortletRequest request,
                                         String name)
Check if a specific input type="submit" parameter was sent in the request, either via a button (directly with name) or via an image (name + ".x" or name + ".y").

Parameters:
request - current portlet request
name - name of the parameter
Returns:
if the parameter was sent
See Also:
WebUtils.SUBMIT_IMAGE_SUFFIXES

getSubmitParameter

public static String getSubmitParameter(javax.portlet.PortletRequest request,
                                        String name)
Return the full name of a specific input type="submit" parameter if it was sent in the request, either via a button (directly with name) or via an image (name + ".x" or name + ".y").

Parameters:
request - current portlet request
name - name of the parameter
Returns:
the actual parameter name with suffix if needed - null if not present
See Also:
WebUtils.SUBMIT_IMAGE_SUFFIXES

getParametersStartingWith

public static Map<String,Object> getParametersStartingWith(javax.portlet.PortletRequest request,
                                                           String prefix)
Return a map containing all parameters with the given prefix. Maps single values to String and multiple values to String array.

For example, with a prefix of "spring_", "spring_param1" and "spring_param2" result in a Map with "param1" and "param2" as keys.

Similar to portlet PortletRequest.getParameterMap(), but more flexible.

Parameters:
request - portlet request in which to look for parameters
prefix - the beginning of parameter names (if this is null or the empty string, all parameters will match)
Returns:
map containing request parameters without the prefix, containing either a String or a String array as values
See Also:
PortletRequest.getParameterNames(),
PortletRequest.getParameterValues(java.lang.String),
PortletRequest.getParameterMap()

getTargetPage

public static int getTargetPage(javax.portlet.PortletRequest request,
                                String paramPrefix,
                                int currentPage)
Return the target page specified in the request.

Parameters:
request - current portlet request
paramPrefix - the parameter prefix to check for (e.g. "_target" for parameters like "_target1" or "_target2")
currentPage - the current page, to be returned as fallback if no target page specified
Returns:
the page specified in the request, or current page if not found

passAllParametersToRenderPhase

public static void passAllParametersToRenderPhase(javax.portlet.ActionRequest request,
                                                  javax.portlet.ActionResponse response)
Pass all the action request parameters to the render phase by putting them into the action response object. This may not be called when the action will call sendRedirect.

Parameters:
request - the current action request
response - the current action response
See Also:
StateAwareResponse.setRenderParameter(java.lang.String, java.lang.String)

clearAllRenderParameters

public static void clearAllRenderParameters(javax.portlet.ActionResponse response)
Clear all the render parameters from the ActionResponse. This may not be called when the action will call sendRedirect.

Parameters:
response - the current action response
See Also:
StateAwareResponse.setRenderParameters(java.util.Map)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.servlet

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.servlet

Provides servlets that integrate with the application context infrastructure, and the core interfaces and classes for the Spring web MVC framework.

See:
Description

Interface Summary
HandlerAdapter | MVC framework SPI interface, allowing parameterization of core MVC workflow.
HandlerExceptionResolver | Interface to be implemented by objects than can resolve exceptions thrown during handler mapping or execution, in the typical case to error views.
HandlerInterceptor | Workflow interface that allows for customized handler execution chains.
HandlerMapping | Interface to be implemented by objects that define a mapping between requests and handler objects.
LocaleResolver | Interface for web-based locale resolution strategies that allows for both locale resolution via the request and locale modification via request and response.
RequestToViewNameTranslator | Strategy interface for translating an incoming HttpServletRequest into a logical view name when no view name is explicitly supplied.
ThemeResolver | Interface for web-based theme resolution strategies that allows for both theme resolution via the request and theme modification via request and response.
View | MVC View for a web interaction.
ViewResolver | Interface to be implemented by objects that can resolve views by name.

Class Summary
DispatcherServlet | Central dispatcher for HTTP request handlers/controllers, e.g.
FrameworkServlet | Base servlet for Spring's web framework.
HandlerExecutionChain | Handler execution chain, consisting of handler object and any handler interceptors.
HttpServletBean | Simple extension of HttpServlet which treats its config parameters (init-param entries within the servlet tag in web.xml) as bean properties.
ModelAndView | Holder for both Model and View in the web MVC framework.
ResourceServlet | Simple servlet that can expose an internal resource, including a default URL if the specified resource is not found.
ViewRendererServlet | ViewRendererServlet is a bridge servlet, mainly for the Portlet MVC support.

Exception Summary
ModelAndViewDefiningException Exception to be thrown on error conditions that should forward to a specific view with a specific model.

Package org.springframework.web.servlet Description

Provides servlets that integrate with the application context infrastructure, and the core interfaces and classes for the Spring web MVC framework.

This package and related packages are discussed in Chapters 12 and 13 of Expert One-On-One J2EE Design and Development by Rod Johnson (Wrox, 2002).


org.springframework.web.servlet Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.servlet

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.servlet.GenericServlet (implements java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig)
      • javax.servlet.http.HttpServlet (implements java.io.Serializable)
        • org.springframework.web.servlet.HttpServletBean
          • org.springframework.web.servlet.FrameworkServlet
            • org.springframework.web.servlet.DispatcherServlet
          • org.springframework.web.servlet.ResourceServlet
        • org.springframework.web.servlet.ViewRendererServlet
    • org.springframework.web.servlet.HandlerExecutionChain
    • org.springframework.web.servlet.ModelAndView
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • javax.servlet.ServletException
          • org.springframework.web.servlet.ModelAndViewDefiningException

Interface Hierarchy

  • org.springframework.web.servlet.HandlerAdapter
  • org.springframework.web.servlet.HandlerExceptionResolver
  • org.springframework.web.servlet.HandlerInterceptor
  • org.springframework.web.servlet.HandlerMapping
  • org.springframework.web.servlet.LocaleResolver
  • org.springframework.web.servlet.RequestToViewNameTranslator
  • org.springframework.web.servlet.ThemeResolver
  • org.springframework.web.servlet.View
  • org.springframework.web.servlet.ViewResolver


HandlerAdapter

org.springframework.web.servlet
Interface HandlerAdapter

All Known Implementing Classes:
AnnotationMethodHandlerAdapter, HttpRequestHandlerAdapter, SimpleControllerHandlerAdapter, SimpleServletHandlerAdapter
public interface HandlerAdapter

MVC framework SPI interface, allowing parameterization of core MVC workflow.

Interface that must be implemented for each handler type to handle a request. This interface is used to allow the DispatcherServlet to be indefinitely extensible. The DispatcherServlet accesses all installed handlers through this interface, meaning that it does not contain code specific to any handler type.

Note that a handler can be of type Object. This is to enable handlers from other frameworks to be integrated with this framework without custom coding, as well as to allow for annotation handler objects that do not obey any specific Java interface.

This interface is not intended for application developers. It is available to handlers who want to develop their own web workflow.

Note: HandlerAdaptger implementators may implement the Ordered interface to be able to specify a sorting order (and thus a priority) for getting applied by DispatcherServlet. Non-Ordered instances get treated as lowest priority.

Author:
Rod Johnson, Juergen Hoeller
See Also:
SimpleControllerHandlerAdapter, SimpleServletHandlerAdapter

Method Summary
long | getLastModified(HttpServletRequest request, Object handler) Same contract as for HttpServlet's getLastModified method.
ModelAndView | handle(HttpServletRequest request, HttpServletResponse response, Object handler) Use the given handler to handle this request.
boolean | supports(Object handler) Given a handler instance, return whether or not this HandlerAdapter can support it.

Method Detail

supports

boolean supports(Object handler)
Given a handler instance, return whether or not this HandlerAdapter can support it. Typical HandlerAdapters will base the decision on the handler type. HandlerAdapters will usually only support one handler type each.

A typical implementation:

return (handler instanceof MyHandler);

Parameters:
handler - handler object to check
Returns:
whether or not this object can use the given handler

handle

ModelAndView handle(HttpServletRequest request,
                    HttpServletResponse response,
                    Object handler)
                    throws Exception
Use the given handler to handle this request. The workflow that is required may vary widely.

Parameters:
request - current HTTP request
response - current HTTP response
handler - handler to use. This object must have previously been passed to the supports method of this interface, which must have returned true.
Returns:
ModelAndView object with the name of the view and the required model data, or null if the request has been handled directly
Throws:
Exception - in case of errors

getLastModified

long getLastModified(HttpServletRequest request,
                     Object handler)
Same contract as for HttpServlet's getLastModified method. Can simply return -1 if there's no support in the handler class.

Parameters:
request - current HTTP request
handler - handler to use
Returns:
the lastModified value for the given handler
See Also:
HttpServlet.getLastModified(javax.servlet.http.HttpServletRequest), LastModified.getLastModified(javax.servlet.http.HttpServletRequest)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HandlerExceptionResolver

org.springframework.web.servlet
Interface HandlerExceptionResolver

All Known Implementing Classes:
AbstractHandlerExceptionResolver, AnnotationMethodHandlerExceptionResolver, DefaultHandlerExceptionResolver, ResponseStatusExceptionResolver, SimpleMappingExceptionResolver
public interface HandlerExceptionResolver

Interface to be implemented by objects than can resolve exceptions thrown during handler mapping or execution, in the typical case to error views. Implementors are typically registered as beans in the application context.

Error views are analogous to the error page JSPs, but can be used with any kind of exception including any checked exception, with potentially fine-granular mappings for specific handlers.

Since:
22.11.2003
Author:
Juergen Hoeller

Method Summary
 ModelAndView resolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
Try to resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.

Method Detail

resolveException

ModelAndView resolveException(HttpServletRequest request,
                              HttpServletResponse response,
                              Object handler,
                              Exception ex)
Try to resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.

The returned ModelAndView may be empty to indicate that the exception has been resolved successfully, but that no view should be rendered, for instance by setting a status code.

Parameters:
request - current HTTP request
response - current HTTP response
handler - the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
ex - the exception that got thrown during handler execution
Returns:
a corresponding ModelAndView to forward to, or null for default processing
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HandlerInterceptor

org.springframework.web.servlet
Interface HandlerInterceptor

All Known Implementing Classes:
ConversionServiceExposingInterceptor, HandlerInterceptorAdapter, LocaleChangeInterceptor, ThemeChangeInterceptor, UserRoleAuthorizationInterceptor, WebContentInterceptor, WebRequestHandlerInterceptorAdapter
public interface HandlerInterceptor

Workflow interface that allows for customized handler execution chains. Applications can register any number of existing or custom interceptors for certain groups of handlers, to add common preprocessing behavior without needing to modify each handler implementation.

A HandlerInterceptor gets called before the appropriate HandlerAdapter triggers the execution of the handler itself. This mechanism can be used for a large field of preprocessing aspects, e.g. for authorization checks, or common handler behavior like locale or theme changes. Its main purpose is to allow for factoring out repetitive handler code.

Typically an interceptor chain is defined per HandlerMapping bean, sharing its granularity. To be able to apply a certain interceptor chain to a group of handlers, one needs to map the desired handlers via one HandlerMapping bean. The interceptors themselves are defined as beans in the application context, referenced by the mapping bean definition via its "interceptors" property (in XML: a <list> of <ref>).

HandlerInterceptor is basically similar to a Servlet 2.3 Filter, but in contrast to the latter it just allows custom pre-processing with the option of prohibiting the execution of the handler itself, and custom post-processing. Filters are more powerful, for example they allow for exchanging the request and response objects that are handed down the chain. Note that a filter gets configured in web.xml, a HandlerInterceptor in the application context.

As a basic guideline, fine-grained handler-related preprocessing tasks are candidates for HandlerInterceptor implementations, especially factored-out common handler code and authorization checks. On the other hand, a Filter is well-suited for request content and view content handling, like multipart forms and GZIP compression. This typically shows when one needs to map the filter to certain content types (e.g. images), or to all requests.

Since:
20.06.2003
Author:
Juergen Hoeller
See Also:
HandlerExecutionChain.getInterceptors(), HandlerInterceptorAdapter, AbstractHandlerMapping.setInterceptors(java.lang.Object[]), UserRoleAuthorizationInterceptor, LocaleChangeInterceptor, ThemeChangeInterceptor, Filter

Method Summary
void | afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) Callback after completion of request processing, that is, after rendering the view.
void | postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) Intercept the execution of a handler.
boolean | preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) Intercept the execution of a handler.

Method Detail

preHandle

boolean preHandle(HttpServletRequest request,
                  HttpServletResponse response,
                  Object handler)
                  throws Exception
Intercept the execution of a handler. Called after HandlerMapping determined an appropriate handler object, but before HandlerAdapter invokes the handler.

DispatcherServlet processes a handler in an execution chain, consisting of any number of interceptors, with the handler itself at the end. With this method, each interceptor can decide to abort the execution chain, typically sending a HTTP error or writing a custom response.

Parameters:
request - current HTTP request
response - current HTTP response
handler - chosen handler to execute, for type and/or instance evaluation
Returns:
true if the execution chain should proceed with the next interceptor or the handler itself. Else, DispatcherServlet assumes that this interceptor has already dealt with the response itself.
Throws:
Exception - in case of errors

postHandle

void postHandle(HttpServletRequest request,
                HttpServletResponse response,
                Object handler,
                ModelAndView modelAndView)
                throws Exception
Intercept the execution of a handler. Called after HandlerAdapter actually invoked the handler, but before the DispatcherServlet renders the view. Can expose additional model objects to the view via the given ModelAndView.

DispatcherServlet processes a handler in an execution chain, consisting of any number of interceptors, with the handler itself at the end. With this method, each interceptor can post-process an execution, getting applied in inverse order of the execution chain.

Parameters:
request - current HTTP request
response - current HTTP response
handler - chosen handler to execute, for type and/or instance examination
modelAndView - the ModelAndView that the handler returned (can also be null)
Throws:
Exception - in case of errors

afterCompletion

void afterCompletion(HttpServletRequest request,
                     HttpServletResponse response,
                     Object handler,
                     Exception ex)
                     throws Exception
Callback after completion of request processing, that is, after rendering the view. Will be called on any outcome of handler execution, thus allows for proper resource cleanup.

Note: Will only be called if this interceptor's preHandle method has successfully completed and returned true!

As with the postHandle method, the method will be invoked on each interceptor in the chain in reverse order, so the first interceptor will be the last to be invoked.

Parameters:
request - current HTTP request
response - current HTTP response
handler - chosen handler to execute, for type and/or instance examination
ex - exception thrown on handler execution, if any
Throws:
Exception - in case of errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HandlerMapping

org.springframework.web.servlet
Interface HandlerMapping

All Known Implementing Classes:
AbstractControllerUrlHandlerMapping, AbstractDetectingUrlHandlerMapping, AbstractHandlerMapping, AbstractUrlHandlerMapping, BeanNameUrlHandlerMapping, ControllerBeanNameHandlerMapping, ControllerClassNameHandlerMapping, DefaultAnnotationHandlerMapping, SimpleUrlHandlerMapping
public interface HandlerMapping

Interface to be implemented by objects that define a mapping between requests and handler objects.

This class can be implemented by application developers, although this is not necessary, as BeanNameUrlHandlerMapping and SimpleUrlHandlerMapping are included in the framework. The former is the default if no HandlerMapping bean is registered in the application context.

HandlerMapping implementations can support mapped interceptors but do not have to. A handler will always be wrapped in a HandlerExecutionChain instance, optionally accompanied by some HandlerInterceptor instances. The DispatcherServlet will first call each HandlerInterceptor's preHandle method in the given order, finally invoking the handler itself if all preHandle methods have returned true.

The ability to parameterize this mapping is a powerful and unusual capability of this MVC framework. For example, it is possible to write a custom mapping based on session state, cookie state or many other variables. No other MVC framework seems to be equally flexible.

Note: Implementations can implement the Ordered interface to be able to specify a sorting order and thus a priority for getting applied by DispatcherServlet. Non-Ordered instances get treated as lowest priority.

Author:
Rod Johnson, Juergen Hoeller
See Also:
Ordered, AbstractHandlerMapping, BeanNameUrlHandlerMapping, SimpleUrlHandlerMapping

Field Summary
static String | BEST_MATCHING_PATTERN_ATTRIBUTE Name of the HttpServletRequest attribute that contains the best matching pattern within the handler mapping.
static String | PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE Name of the HttpServletRequest attribute that contains the path within the handler mapping, in case of a pattern match, or the full relevant URI (typically within the DispatcherServlet's mapping) else.
static String | URI_TEMPLATE_VARIABLES_ATTRIBUTE Name of the HttpServletRequest attribute that contains the URI templates map, mapping variable names to values.
Method Summary
 HandlerExecutionChain getHandler(HttpServletRequest request)
Return a handler and any interceptors for this request.

Field Detail

PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE

static final String PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE
Name of the HttpServletRequest attribute that contains the path within the handler mapping, in case of a pattern match, or the full relevant URI (typically within the DispatcherServlet's mapping) else.

Note: This attribute is not required to be supported by all HandlerMapping implementations. URL-based HandlerMappings will typically support it, but handlers should not necessarily expect this request attribute to be present in all scenarios.

BEST_MATCHING_PATTERN_ATTRIBUTE

static final String BEST_MATCHING_PATTERN_ATTRIBUTE
Name of the HttpServletRequest attribute that contains the best matching pattern within the handler mapping.

Note: This attribute is not required to be supported by all HandlerMapping implementations. URL-based HandlerMappings will typically support it, but handlers should not necessarily expect this request attribute to be present in all scenarios.

URI_TEMPLATE_VARIABLES_ATTRIBUTE

static final String URI_TEMPLATE_VARIABLES_ATTRIBUTE
Name of the HttpServletRequest attribute that contains the URI templates map, mapping variable names to values.

Note: This attribute is not required to be supported by all HandlerMapping implementations. URL-based HandlerMappings will typically support it, but handlers should not necessarily expect this request attribute to be present in all scenarios.

Method Detail

getHandler

HandlerExecutionChain getHandler(HttpServletRequest request)
                                 throws Exception
Return a handler and any interceptors for this request. The choice may be made on request URL, session state, or any factor the implementing class chooses.

The returned HandlerExecutionChain contains a handler Object, rather than even a tag interface, so that handlers are not constrained in any way. For example, a HandlerAdapter could be written to allow another framework's handler objects to be used.

Returns null if no match was found. This is not an error. The DispatcherServlet will query all registered HandlerMapping beans to find a match, and only decide there is an error if none can find a handler.

Parameters:
request - current HTTP request
Returns:
a HandlerExecutionChain instance containing handler object and any interceptors, or null if no mapping found
Throws:
Exception - if there is an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LocaleResolver

org.springframework.web.servlet
Interface LocaleResolver

All Known Implementing Classes:
AbstractLocaleResolver, AcceptHeaderLocaleResolver, CookieLocaleResolver, FixedLocaleResolver, SessionLocaleResolver
public interface LocaleResolver

Interface for web-based locale resolution strategies that allows for both locale resolution via the request and locale modification via request and response.

This interface allows for implementations based on request, session, cookies, etc. The default implementation is AcceptHeaderLocaleResolver, simply using the request's locale provided by the respective HTTP header.

Use RequestContext.getLocale() to retrieve the current locale in controllers or views, independent of the actual resolution strategy.

Since:
27.02.2003
Author:
Juergen Hoeller
See Also:
AcceptHeaderLocaleResolver, RequestContext.getLocale()

Method Summary
Locale | resolveLocale(HttpServletRequest request) Resolve the current locale via the given request.
void | setLocale(HttpServletRequest request, HttpServletResponse response, Locale locale) Set the current locale to the given one.

Method Detail

resolveLocale

Locale resolveLocale(HttpServletRequest request)
Resolve the current locale via the given request. Should return a default locale as fallback in any case.

Parameters:
request - the request to resolve the locale for
Returns:
the current locale (never null)

setLocale

void setLocale(HttpServletRequest request,
               HttpServletResponse response,
               Locale locale)
Set the current locale to the given one.

Parameters:
request - the request to be used for locale modification
response - the response to be used for locale modification
locale - the new locale, or null to clear the locale
Throws:
UnsupportedOperationException - if the LocaleResolver implementation does not support dynamic changing of the theme
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RequestToViewNameTranslator

org.springframework.web.servlet
Interface RequestToViewNameTranslator

All Known Implementing Classes:
DefaultRequestToViewNameTranslator
public interface RequestToViewNameTranslator

Strategy interface for translating an incoming HttpServletRequest into a logical view name when no view name is explicitly supplied.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller

Method Summary
 String getViewName(HttpServletRequest request)
Translate the given HttpServletRequest into a view name.

Method Detail

getViewName

String getViewName(HttpServletRequest request)
                   throws Exception
Translate the given HttpServletRequest into a view name.

Parameters:
request - the incoming HttpServletRequest providing the context from which a view name is to be resolved
Returns:
the view name (or null if no default found)
Throws:
Exception - if view name translation fails
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ThemeResolver

org.springframework.web.servlet
Interface ThemeResolver

All Known Implementing Classes:
AbstractThemeResolver, CookieThemeResolver, FixedThemeResolver, SessionThemeResolver
public interface ThemeResolver

Interface for web-based theme resolution strategies that allows for both theme resolution via the request and theme modification via request and response.

This interface allows for implementations based on session, cookies, etc. The default implementation is FixedThemeResolver, simply using a configured default theme.

Note that this resolver is only responsible for determining the current theme name. The Theme instance for the resolved theme name gets looked up by DispatcherServlet via the respective ThemeSource, i.e. the current WebApplicationContext.

Use RequestContext.getTheme() to retrieve the current theme in controllers or views, independent of the actual resolution strategy.

Since:
17.06.2003
Author:
Jean-Pierre Pawlak, Juergen Hoeller
See Also:
FixedThemeResolver, Theme, ThemeSource, RequestContext.getTheme()

Method Summary
String | resolveThemeName(HttpServletRequest request) Resolve the current theme name via the given request.
void | setThemeName(HttpServletRequest request, HttpServletResponse response, String themeName) Set the current theme name to the given one.

Method Detail

resolveThemeName

String resolveThemeName(HttpServletRequest request)
Resolve the current theme name via the given request. Should return a default theme as fallback in any case.

Parameters:
request - request to be used for resolution
Returns:
the current theme name

setThemeName

void setThemeName(HttpServletRequest request,
                  HttpServletResponse response,
                  String themeName)
Set the current theme name to the given one.

Parameters:
request - request to be used for theme name modification
response - response to be used for theme name modification
themeName - the new theme name
Throws:
UnsupportedOperationException - if the ThemeResolver implementation does not support dynamic changing of the theme
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


View

org.springframework.web.servlet
Interface View

All Known Implementing Classes:
AbstractAtomFeedView, AbstractExcelView, AbstractFeedView, AbstractJasperReportsSingleFormatView, AbstractJasperReportsView, AbstractJExcelView, AbstractPdfStamperView, AbstractPdfView, AbstractRssFeedView, AbstractTemplateView, AbstractUrlBasedView, AbstractView, AbstractXsltView, ConfigurableJasperReportsView, FreeMarkerView, InternalResourceView, JasperReportsCsvView, JasperReportsHtmlView, JasperReportsMultiFormatView, JasperReportsPdfView, JasperReportsXlsView, JstlView, MappingJacksonJsonView, MarshallingView, RedirectView, TilesJstlView, TilesView, TilesView, VelocityLayoutView, VelocityToolboxView, VelocityView, XsltView
public interface View

MVC View for a web interaction. Implementations are responsible for rendering content, and exposing the model. A single view exposes multiple model attributes.

This class and the MVC approach associated with it is discussed in Chapter 12 of Expert One-On-One J2EE Design and Development by Rod Johnson (Wrox, 2002).

View implementations may differ widely. An obvious implementation would be JSP-based. Other implementations might be XSLT-based, or use an HTML generation library. This interface is designed to avoid restricting the range of possible implementations.

Views should be beans. They are likely to be instantiated as beans by a ViewResolver. As this interface is stateless, view implementations should be thread-safe.

Author:
Rod Johnson, Arjen Poutsma
See Also:
AbstractView, InternalResourceView

Field Summary
static String RESPONSE_STATUS_ATTRIBUTE
Name of the HttpServletRequest attribute that contains the response status code.
Method Summary
String | getContentType() Return the content type of the view, if predetermined.
void | render(Map<String,?> model, HttpServletRequest request, HttpServletResponse response) Render the view given the specified model.

Field Detail

RESPONSE_STATUS_ATTRIBUTE

static final String RESPONSE_STATUS_ATTRIBUTE
Name of the HttpServletRequest attribute that contains the response status code.

Note: This attribute is not required to be supported by all View implementations.

Method Detail

getContentType

String getContentType()
Return the content type of the view, if predetermined.

Can be used to check the content type upfront, before the actual rendering process.

Returns:
the content type String (optionally including a character set), or null if not predetermined.

render

void render(Map<String,?> model,
            HttpServletRequest request,
            HttpServletResponse response)
            throws Exception
Render the view given the specified model.

The first step will be preparing the request: In the JSP case, this would mean setting model objects as request attributes. The second step will be the actual rendering of the view, for example including the JSP via a RequestDispatcher.

Parameters:
model - Map with name Strings as keys and corresponding model objects as values (Map can also be null in case of empty model)
request - current HTTP request
response - HTTP response we are building
Throws:
Exception - if rendering failed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ViewResolver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet
Interface ViewResolver

All Known Implementing Classes:
AbstractCachingViewResolver, AbstractTemplateViewResolver, BeanNameViewResolver, ContentNegotiatingViewResolver, FreeMarkerViewResolver, InternalResourceViewResolver, JasperReportsViewResolver, ResourceBundleViewResolver, TilesViewResolver, UrlBasedViewResolver, VelocityLayoutViewResolver, VelocityViewResolver, XmlViewResolver, XsltViewResolver
public interface ViewResolver

Interface to be implemented by objects that can resolve views by name.

View state doesn't change during the running of the application, so implementations are free to cache views.

Implementations are encouraged to support internationalization, i.e. localized view resolution.

Author:
Rod Johnson, Juergen Hoeller
See Also:
InternalResourceViewResolver, ResourceBundleViewResolver, XmlViewResolver

Method Summary
 View resolveViewName(String viewName, Locale locale)
Resolve the given view by name.

Method Detail

resolveViewName

View resolveViewName(String viewName,
                     Locale locale)
                     throws Exception
Resolve the given view by name.

Note: To allow for ViewResolver chaining, a ViewResolver should return null if a view with the given name is not defined in it. However, this is not required: Some ViewResolvers will always attempt to build View objects with the given name, unable to return null (rather throwing an exception when View creation failed).

Parameters:
viewName - name of the view to resolve
locale - Locale in which to resolve the view. ViewResolvers that support internationalization should respect this.
Returns:
the View object, or null if not found (optional, to allow for ViewResolver chaining)
Throws:
Exception - if the view cannot be resolved (typically in case of problems creating an actual View object)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


DispatcherServlet

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet
Class DispatcherServlet

java.lang.Object
    extended by  javax.servlet.GenericServlet
        extended by  javax.servlet.http.HttpServlet
            extended by  org.springframework.web.servlet.HttpServletBean
                extended by  org.springframework.web.servlet.FrameworkServlet
                    extended by  org.springframework.web.servlet.DispatcherServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig
public class DispatcherServlet
extends FrameworkServlet

Central dispatcher for HTTP request handlers/controllers, e.g. for web UI controllers or HTTP-based remote service exporters. Dispatches to registered handlers for processing a web request, providing convenient mapping and exception handling facilities.

This servlet is very flexible: It can be used with just about any workflow, with the installation of the appropriate adapter classes. It offers the following functionality that distinguishes it from other request-driven web MVC frameworks:

  • It is based around a JavaBeans configuration mechanism.
  • It can use any HandlerMapping implementation - pre-built or provided as part of an application - to control the routing of requests to handler objects. Default is BeanNameUrlHandlerMapping and DefaultAnnotationHandlerMapping. HandlerMapping objects can be defined as beans in the servlet's application context, implementing the HandlerMapping interface, overriding the default HandlerMapping if present. HandlerMappings can be given any bean name (they are tested by type).
  • It can use any HandlerAdapter; this allows for using any handler interface. Default adapters are HttpRequestHandlerAdapter, SimpleControllerHandlerAdapter, for Spring's HttpRequestHandler and Controller interfaces, respectively. A default AnnotationMethodHandlerAdapter will be registered as well. HandlerAdapter objects can be added as beans in the application context, overriding the default HandlerAdapters. Like HandlerMappings, HandlerAdapters can be given any bean name (they are tested by type).
  • The dispatcher's exception resolution strategy can be specified via a HandlerExceptionResolver, for example mapping certain exceptions to error pages. Default are AnnotationMethodHandlerExceptionResolver, ResponseStatusExceptionResolver, and DefaultHandlerExceptionResolver. These HandlerExceptionResolvers can be overridden through the application context. HandlerExceptionResolver can be given any bean name (they are tested by type).
  • Its view resolution strategy can be specified via a ViewResolver implementation, resolving symbolic view names into View objects. Default is InternalResourceViewResolver. ViewResolver objects can be added as beans in the application context, overriding the default ViewResolver. ViewResolvers can be given any bean name (they are tested by type).
  • If a View or view name is not supplied by the user, then the configured RequestToViewNameTranslator will translate the current request into a view name. The corresponding bean name is "viewNameTranslator"; the default is DefaultRequestToViewNameTranslator.
  • The dispatcher's strategy for resolving multipart requests is determined by a MultipartResolver implementation. Implementations for Jakarta Commons FileUpload and Jason Hunter's COS are included; the typical choise is CommonsMultipartResolver. The MultipartResolver bean name is "multipartResolver"; default is none.
  • Its locale resolution strategy is determined by a LocaleResolver. Out-of-the-box implementations work via HTTP accept header, cookie, or session. The LocaleResolver bean name is "localeResolver"; default is AcceptHeaderLocaleResolver.
  • Its theme resolution strategy is determined by a ThemeResolver. Implementations for a fixed theme and for cookie and session storage are included. The ThemeResolver bean name is "themeResolver"; default is FixedThemeResolver.

NOTE: The @RequestMapping annotation will only be processed if a corresponding HandlerMapping (for type level annotations) and/or HandlerAdapter (for method level annotations) is present in the dispatcher. This is the case by default. However, if you are defining custom HandlerMappings or HandlerAdapters, then you need to make sure that a corresponding custom DefaultAnnotationHandlerMapping and/or AnnotationMethodHandlerAdapter is defined as well - provided that you intend to use @RequestMapping.

A web application can define any number of DispatcherServlets. Each servlet will operate in its own namespace, loading its own application context with mappings, handlers, etc. Only the root application context as loaded by ContextLoaderListener, if any, will be shared.

Author:
Rod Johnson, Juergen Hoeller, Rob Harrop
See Also:
HttpRequestHandler, Controller, ContextLoaderListener, Serialized Form

Field Summary
static String | HANDLER_ADAPTER_BEAN_NAME Well-known name for the HandlerAdapter object in the bean factory for this namespace.
static String | HANDLER_EXCEPTION_RESOLVER_BEAN_NAME Well-known name for the HandlerExceptionResolver object in the bean factory for this namespace.
static String | HANDLER_EXECUTION_CHAIN_ATTRIBUTE Request attribute to hold the currently chosen HandlerExecutionChain.
static String | HANDLER_MAPPING_BEAN_NAME Well-known name for the HandlerMapping object in the bean factory for this namespace.
static String | LOCALE_RESOLVER_ATTRIBUTE Request attribute to hold the current LocaleResolver, retrievable by views.
static String | LOCALE_RESOLVER_BEAN_NAME Well-known name for the LocaleResolver object in the bean factory for this namespace.
static String | MULTIPART_RESOLVER_BEAN_NAME Well-known name for the MultipartResolver object in the bean factory for this namespace.
static String | PAGE_NOT_FOUND_LOG_CATEGORY Log category to use when no mapped handler is found for a request.
protected static Log | pageNotFoundLogger Additional logger to use when no mapped handler is found for a request.
static String | REQUEST_TO_VIEW_NAME_TRANSLATOR_BEAN_NAME Well-known name for the RequestToViewNameTranslator object in the bean factory for this namespace.
static String | THEME_RESOLVER_ATTRIBUTE Request attribute to hold the current ThemeResolver, retrievable by views.
static String | THEME_RESOLVER_BEAN_NAME Well-known name for the ThemeResolver object in the bean factory for this namespace.
static String | THEME_SOURCE_ATTRIBUTE Request attribute to hold the current ThemeSource, retrievable by views.
static String | VIEW_RESOLVER_BEAN_NAME Well-known name for the ViewResolver object in the bean factory for this namespace.
static String | WEB_APPLICATION_CONTEXT_ATTRIBUTE Request attribute to hold the current web application context.
Fields inherited from class org.springframework.web.servlet.FrameworkServlet
DEFAULT_CONTEXT_CLASS, DEFAULT_NAMESPACE_SUFFIX, SERVLET_CONTEXT_PREFIX
Fields inherited from class org.springframework.web.servlet.HttpServletBean
logger
Constructor Summary
DispatcherServlet()
Method Summary
protected  LocaleContext buildLocaleContext(HttpServletRequest request)
Build a LocaleContext for the given request, exposing the request's primary locale as current locale.
protected  HttpServletRequest checkMultipart(HttpServletRequest request)
Convert the request into a multipart request, and make multipart resolver available.
protected  void cleanupMultipart(HttpServletRequest request)
Clean up any resources used by the given multipart request (if any).
protected  Object createDefaultStrategy(ApplicationContext context, Class<?> clazz)
Create a default strategy.
protected  void doDispatch(HttpServletRequest request, HttpServletResponse response)
Process the actual dispatching to the handler.
protected  void doService(HttpServletRequest request, HttpServletResponse response)
Exposes the DispatcherServlet-specific request attributes and delegates to doDispatch(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) for the actual dispatching.
protected
<T> List<T>
getDefaultStrategies(ApplicationContext context, Class<T> strategyInterface)
Create a List of default strategy objects for the given strategy interface.
protected
<T> T
getDefaultStrategy(ApplicationContext context, Class<T> strategyInterface)
Return the default strategy object for the given strategy interface.
protected  String getDefaultViewName(HttpServletRequest request)
Translate the supplied request into a default view name.
protected  HandlerExecutionChain getHandler(HttpServletRequest request, boolean cache)
Return the HandlerExecutionChain for this request.
protected  HandlerAdapter getHandlerAdapter(Object handler)
Return the HandlerAdapter for this handler object.
protected  long getLastModified(HttpServletRequest request)
Override HttpServlet's getLastModified method to evaluate the Last-Modified value of the mapped handler.
 MultipartResolver getMultipartResolver()
Obtain this servlet's MultipartResolver, if any.
 ThemeSource getThemeSource()
Return this servlet's ThemeSource, if any; else return null.
protected  void initStrategies(ApplicationContext context)
Initialize the strategy objects that this servlet uses.
protected  void noHandlerFound(HttpServletRequest request, HttpServletResponse response)
No handler found -> set appropriate HTTP response status.
protected  void onRefresh(ApplicationContext context)
This implementation calls initStrategies(org.springframework.context.ApplicationContext).
protected  ModelAndView processHandlerException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
Determine an error ModelAndView via the registered HandlerExceptionResolvers.
protected  void render(ModelAndView mv, HttpServletRequest request, HttpServletResponse response)
Render the given ModelAndView.
protected  View resolveViewName(String viewName, Map<String,Object> model, Locale locale, HttpServletRequest request)
Resolve the given view name into a View object (to be rendered).
 void setCleanupAfterInclude(boolean cleanupAfterInclude)
Set whether to perform cleanup of request attributes after an include request, that is, whether to reset the original state of all request attributes after the DispatcherServlet has processed within an include request.
 void setDetectAllHandlerAdapters(boolean detectAllHandlerAdapters)
Set whether to detect all HandlerAdapter beans in this servlet's context.
 void setDetectAllHandlerExceptionResolvers(boolean detectAllHandlerExceptionResolvers)
Set whether to detect all HandlerExceptionResolver beans in this servlet's context.
 void setDetectAllHandlerMappings(boolean detectAllHandlerMappings)
Set whether to detect all HandlerMapping beans in this servlet's context.
 void setDetectAllViewResolvers(boolean detectAllViewResolvers)
Set whether to detect all ViewResolver beans in this servlet's context.
Methods inherited from class org.springframework.web.servlet.FrameworkServlet
createWebApplicationContext, createWebApplicationContext, destroy, doDelete, doGet, doOptions, doPost, doPut, doTrace, findWebApplicationContext, getContextAttribute, getContextClass, getContextConfigLocation, getNamespace, getServletContextAttributeName, getUsernameForRequest, getWebApplicationContext, initFrameworkServlet, initServletBean, initWebApplicationContext, onApplicationEvent, postProcessWebApplicationContext, processRequest, refresh, setContextAttribute, setContextClass, setContextConfigLocation, setDispatchOptionsRequest, setDispatchTraceRequest, setNamespace, setPublishContext, setPublishEvents, setThreadContextInheritable
Methods inherited from class org.springframework.web.servlet.HttpServletBean
addRequiredProperty, getServletContext, getServletName, init, initBeanWrapper
Methods inherited from class javax.servlet.http.HttpServlet
doHead, service, service
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletInfo, init, log, log
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

MULTIPART_RESOLVER_BEAN_NAME

public static final String MULTIPART_RESOLVER_BEAN_NAME
Well-known name for the MultipartResolver object in the bean factory for this namespace.

See Also:
Constant Field Values

LOCALE_RESOLVER_BEAN_NAME

public static final String LOCALE_RESOLVER_BEAN_NAME
Well-known name for the LocaleResolver object in the bean factory for this namespace.

See Also:
Constant Field Values

THEME_RESOLVER_BEAN_NAME

public static final String THEME_RESOLVER_BEAN_NAME
Well-known name for the ThemeResolver object in the bean factory for this namespace.

See Also:
Constant Field Values

HANDLER_MAPPING_BEAN_NAME

public static final String HANDLER_MAPPING_BEAN_NAME
Well-known name for the HandlerMapping object in the bean factory for this namespace. Only used when "detectAllHandlerMappings" is turned off.

See Also:
setDetectAllHandlerMappings(boolean), Constant Field Values

HANDLER_ADAPTER_BEAN_NAME

public static final String HANDLER_ADAPTER_BEAN_NAME
Well-known name for the HandlerAdapter object in the bean factory for this namespace. Only used when "detectAllHandlerAdapters" is turned off.

See Also:
setDetectAllHandlerAdapters(boolean), Constant Field Values

HANDLER_EXCEPTION_RESOLVER_BEAN_NAME

public static final String HANDLER_EXCEPTION_RESOLVER_BEAN_NAME
Well-known name for the HandlerExceptionResolver object in the bean factory for this namespace. Only used when "detectAllHandlerExceptionResolvers" is turned off.

See Also:
setDetectAllHandlerExceptionResolvers(boolean), Constant Field Values

REQUEST_TO_VIEW_NAME_TRANSLATOR_BEAN_NAME

public static final String REQUEST_TO_VIEW_NAME_TRANSLATOR_BEAN_NAME
Well-known name for the RequestToViewNameTranslator object in the bean factory for this namespace.

See Also:
Constant Field Values

VIEW_RESOLVER_BEAN_NAME

public static final String VIEW_RESOLVER_BEAN_NAME
Well-known name for the ViewResolver object in the bean factory for this namespace. Only used when "detectAllViewResolvers" is turned off.

See Also:
setDetectAllViewResolvers(boolean), Constant Field Values

HANDLER_EXECUTION_CHAIN_ATTRIBUTE

public static final String HANDLER_EXECUTION_CHAIN_ATTRIBUTE
Request attribute to hold the currently chosen HandlerExecutionChain. Only used for internal optimizations.

WEB_APPLICATION_CONTEXT_ATTRIBUTE

public static final String WEB_APPLICATION_CONTEXT_ATTRIBUTE
Request attribute to hold the current web application context. Otherwise only the global web app context is obtainable by tags etc.

See Also:
RequestContextUtils.getWebApplicationContext(javax.servlet.ServletRequest)

LOCALE_RESOLVER_ATTRIBUTE

public static final String LOCALE_RESOLVER_ATTRIBUTE
Request attribute to hold the current LocaleResolver, retrievable by views.

See Also:
RequestContextUtils.getLocaleResolver(javax.servlet.http.HttpServletRequest)

THEME_RESOLVER_ATTRIBUTE

public static final String THEME_RESOLVER_ATTRIBUTE
Request attribute to hold the current ThemeResolver, retrievable by views.

See Also:
RequestContextUtils.getThemeResolver(javax.servlet.http.HttpServletRequest)

THEME_SOURCE_ATTRIBUTE

public static final String THEME_SOURCE_ATTRIBUTE
Request attribute to hold the current ThemeSource, retrievable by views.

See Also:
RequestContextUtils.getThemeSource(javax.servlet.http.HttpServletRequest)

PAGE_NOT_FOUND_LOG_CATEGORY

public static final String PAGE_NOT_FOUND_LOG_CATEGORY
Log category to use when no mapped handler is found for a request.

See Also:
Constant Field Values

pageNotFoundLogger

protected static final Log pageNotFoundLogger
Additional logger to use when no mapped handler is found for a request.

Constructor Detail

DispatcherServlet

public DispatcherServlet()
Method Detail

setDetectAllHandlerMappings

public void setDetectAllHandlerMappings(boolean detectAllHandlerMappings)
Set whether to detect all HandlerMapping beans in this servlet's context. Otherwise, just a single bean with name "handlerMapping" will be expected.

Default is "true". Turn this off if you want this servlet to use a single HandlerMapping, despite multiple HandlerMapping beans being defined in the context.

setDetectAllHandlerAdapters

public void setDetectAllHandlerAdapters(boolean detectAllHandlerAdapters)
Set whether to detect all HandlerAdapter beans in this servlet's context. Otherwise, just a single bean with name "handlerAdapter" will be expected.

Default is "true". Turn this off if you want this servlet to use a single HandlerAdapter, despite multiple HandlerAdapter beans being defined in the context.

setDetectAllHandlerExceptionResolvers

public void setDetectAllHandlerExceptionResolvers(boolean detectAllHandlerExceptionResolvers)
Set whether to detect all HandlerExceptionResolver beans in this servlet's context. Otherwise, just a single bean with name "handlerExceptionResolver" will be expected.

Default is "true". Turn this off if you want this servlet to use a single HandlerExceptionResolver, despite multiple HandlerExceptionResolver beans being defined in the context.

setDetectAllViewResolvers

public void setDetectAllViewResolvers(boolean detectAllViewResolvers)
Set whether to detect all ViewResolver beans in this servlet's context. Otherwise, just a single bean with name "viewResolver" will be expected.

Default is "true". Turn this off if you want this servlet to use a single ViewResolver, despite multiple ViewResolver beans being defined in the context.

setCleanupAfterInclude

public void setCleanupAfterInclude(boolean cleanupAfterInclude)
Set whether to perform cleanup of request attributes after an include request, that is, whether to reset the original state of all request attributes after the DispatcherServlet has processed within an include request. Otherwise, just the DispatcherServlet's own request attributes will be reset, but not model attributes for JSPs or special attributes set by views (for example, JSTL's).

Default is "true", which is strongly recommended. Views should not rely on request attributes having been set by (dynamic) includes. This allows JSP views rendered by an included controller to use any model attributes, even with the same names as in the main JSP, without causing side effects. Only turn this off for special needs, for example to deliberately allow main JSPs to access attributes from JSP views rendered by an included controller.

onRefresh

protected void onRefresh(ApplicationContext context)
This implementation calls initStrategies(org.springframework.context.ApplicationContext).

Overrides:
onRefresh in class FrameworkServlet
Parameters:
context - the current WebApplicationContext
See Also:
FrameworkServlet.refresh()

initStrategies

protected void initStrategies(ApplicationContext context)
Initialize the strategy objects that this servlet uses.

May be overridden in subclasses in order to initialize further strategy objects.

getThemeSource

public final ThemeSource getThemeSource()
Return this servlet's ThemeSource, if any; else return null.

Default is to return the WebApplicationContext as ThemeSource, provided that it implements the ThemeSource interface.

Returns:
the ThemeSource, if any
See Also:
FrameworkServlet.getWebApplicationContext()

getMultipartResolver

public final MultipartResolver getMultipartResolver()
Obtain this servlet's MultipartResolver, if any.

Returns:
the MultipartResolver used by this servlet, or null if none (indicating that no multipart support is available)

getDefaultStrategy

protected <T> T getDefaultStrategy(ApplicationContext context,
                                   Class<T> strategyInterface)
Return the default strategy object for the given strategy interface.

The default implementation delegates to getDefaultStrategies(org.springframework.context.ApplicationContext, java.lang.Class), expecting a single object in the list.

Parameters:
context - the current WebApplicationContext
strategyInterface - the strategy interface
Returns:
the corresponding strategy object
See Also:
getDefaultStrategies(org.springframework.context.ApplicationContext, java.lang.Class)

getDefaultStrategies

protected <T> List<T> getDefaultStrategies(ApplicationContext context,
                                           Class<T> strategyInterface)
Create a List of default strategy objects for the given strategy interface.

The default implementation uses the "DispatcherServlet.properties" file (in the same package as the DispatcherServlet class) to determine the class names. It instantiates the strategy objects through the context's BeanFactory.

Parameters:
context - the current WebApplicationContext
strategyInterface - the strategy interface
Returns:
the List of corresponding strategy objects

createDefaultStrategy

protected Object createDefaultStrategy(ApplicationContext context,
                                       Class<?> clazz)
Create a default strategy.

The default implementation uses AutowireCapableBeanFactory.createBean(java.lang.Class).

Parameters:
context - the current WebApplicationContext
clazz - the strategy implementation class to instantiate
Returns:
the fully configured strategy instance
See Also:
ApplicationContext.getAutowireCapableBeanFactory(), AutowireCapableBeanFactory.createBean(java.lang.Class)

doService

protected void doService(HttpServletRequest request,
                         HttpServletResponse response)
                  throws Exception
Exposes the DispatcherServlet-specific request attributes and delegates to doDispatch(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) for the actual dispatching.

Specified by:
doService in class FrameworkServlet
Parameters:
request - current HTTP request
response - current HTTP response
Throws:
Exception - in case of any kind of processing failure
See Also:
HttpServlet.doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), HttpServlet.doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

doDispatch

protected void doDispatch(HttpServletRequest request,
                          HttpServletResponse response)
                   throws Exception
Process the actual dispatching to the handler.

The handler will be obtained by applying the servlet's HandlerMappings in order. The HandlerAdapter will be obtained by querying the servlet's installed HandlerAdapters to find the first that supports the handler class.

All HTTP methods are handled by this method. It's up to HandlerAdapters or handlers themselves to decide which methods are acceptable.

Parameters:
request - current HTTP request
response - current HTTP response
Throws:
Exception - in case of any kind of processing failure

getLastModified

protected long getLastModified(HttpServletRequest request)
Override HttpServlet's getLastModified method to evaluate the Last-Modified value of the mapped handler.

Overrides:
getLastModified in class HttpServlet

buildLocaleContext

protected LocaleContext buildLocaleContext(HttpServletRequest request)
Build a LocaleContext for the given request, exposing the request's primary locale as current locale.

The default implementation uses the dispatcher's LocaleResolver to obtain the current locale, which might change during a request.

Overrides:
buildLocaleContext in class FrameworkServlet
Parameters:
request - current HTTP request
Returns:
the corresponding LocaleContext

checkMultipart

protected HttpServletRequest checkMultipart(HttpServletRequest request)
                                     throws MultipartException
Convert the request into a multipart request, and make multipart resolver available.

If no multipart resolver is set, simply use the existing request.

Parameters:
request - current HTTP request
Returns:
the processed request (multipart wrapper if necessary)
Throws:
MultipartException
See Also:
MultipartResolver.resolveMultipart(javax.servlet.http.HttpServletRequest)

cleanupMultipart

protected void cleanupMultipart(HttpServletRequest request)
Clean up any resources used by the given multipart request (if any).

Parameters:
request - current HTTP request
See Also:
MultipartResolver.cleanupMultipart(org.springframework.web.multipart.MultipartHttpServletRequest)

getHandler

protected HandlerExecutionChain getHandler(HttpServletRequest request,
                                           boolean cache)
                                    throws Exception
Return the HandlerExecutionChain for this request. Try all handler mappings in order.

Parameters:
request - current HTTP request
cache - whether to cache the HandlerExecutionChain in a request attribute
Returns:
the HandlerExceutionChain, or null if no handler could be found
Throws:
Exception

noHandlerFound

protected void noHandlerFound(HttpServletRequest request,
                              HttpServletResponse response)
                       throws Exception
No handler found -> set appropriate HTTP response status.

Parameters:
request - current HTTP request
response - current HTTP response
Throws:
Exception - if preparing the response failed

getHandlerAdapter

protected HandlerAdapter getHandlerAdapter(Object handler)
                                    throws ServletException
Return the HandlerAdapter for this handler object.

Parameters:
handler - the handler object to find an adapter for
Throws:
ServletException - if no HandlerAdapter can be found for the handler. This is a fatal error.

processHandlerException

protected ModelAndView processHandlerException(HttpServletRequest request,
                                               HttpServletResponse response,
                                               Object handler,
                                               Exception ex)
                                        throws Exception
Determine an error ModelAndView via the registered HandlerExceptionResolvers.

Parameters:
request - current HTTP request
response - current HTTP response
handler - the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
ex - the exception that got thrown during handler execution
Returns:
a corresponding ModelAndView to forward to
Throws:
Exception - if no error ModelAndView found

render

protected void render(ModelAndView mv,
                      HttpServletRequest request,
                      HttpServletResponse response)
               throws Exception
Render the given ModelAndView.

This is the last stage in handling a request. It may involve resolving the view by name.

Parameters:
mv - the ModelAndView to render
request - current HTTP servlet request
response - current HTTP servlet response
Throws:
Exception - if there's a problem rendering the view

getDefaultViewName

protected String getDefaultViewName(HttpServletRequest request)
                             throws Exception
Translate the supplied request into a default view name.

Parameters:
request - current HTTP servlet request
Returns:
the view name (or null if no default found)
Throws:
Exception - if view name translation failed

resolveViewName

protected View resolveViewName(String viewName,
                               Map<String,Object> model,
                               Locale locale,
                               HttpServletRequest request)
                        throws Exception
Resolve the given view name into a View object (to be rendered).

The default implementations asks all ViewResolvers of this dispatcher. Can be overridden for custom resolution strategies, potentially based on specific model attributes or request parameters.

Parameters:
viewName - the name of the view to resolve
model - the model to be passed to the view
locale - the current locale
request - current HTTP servlet request
Returns:
the View object, or null if none found
Throws:
Exception - if the view cannot be resolved (typically in case of problems creating an actual View object)
See Also:
ViewResolver.resolveViewName(java.lang.String, java.util.Locale)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


FrameworkServlet

org.springframework.web.servlet
Class FrameworkServlet

java.lang.Object
    extended by  javax.servlet.GenericServlet
        extended by  javax.servlet.http.HttpServlet
            extended by  org.springframework.web.servlet.HttpServletBean
                extended by  org.springframework.web.servlet.FrameworkServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig
Direct Known Subclasses:
DispatcherServlet
public abstract class FrameworkServlet
extends HttpServletBean

Base servlet for Spring's web framework. Provides integration with a Spring application context, in a JavaBean-based overall solution.

This class offers the following functionality:

  • Manages a WebApplicationContext instance per servlet. The servlet's configuration is determined by beans in the servlet's namespace.
  • Publishes events on request processing, whether or not a request is successfully handled.

Subclasses must implement doService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) to handle requests. Because this extends HttpServletBean rather than HttpServlet directly, bean properties are automatically mapped onto it. Subclasses can override initFrameworkServlet() for custom initialization.

Detects a "contextClass" parameter at the servlet init-param level, falling back to the default context class, XmlWebApplicationContext, if not found. Note that, with the default FrameworkServlet, a custom context class needs to implement the ConfigurableWebApplicationContext SPI.

Passes a "contextConfigLocation" servlet init-param to the context instance, parsing it into potentially multiple file paths which can be separated by any number of commas and spaces, like "test-servlet.xml, myServlet.xml". If not explicitly specified, the context implementation is supposed to build a default location from the namespace of the servlet.

Note: In case of multiple config locations, later bean definitions will override ones defined in earlier loaded files, at least when using Spring's default ApplicationContext implementation. This can be leveraged to deliberately override certain bean definitions via an extra XML file.

The default namespace is "'servlet-name'-servlet", e.g. "test-servlet" for a servlet-name "test" (leading to a "/WEB-INF/test-servlet.xml" default location with XmlWebApplicationContext). The namespace can also be set explicitly via the "namespace" servlet init-param.

Author:
Rod Johnson, Juergen Hoeller, Sam Brannen
See Also:
doService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse),
setContextClass(java.lang.Class),
setContextConfigLocation(java.lang.String),
setNamespace(java.lang.String),
Serialized Form

Field Summary
static Class | DEFAULT_CONTEXT_CLASS Default context class for FrameworkServlet.
static String | DEFAULT_NAMESPACE_SUFFIX Suffix for WebApplicationContext namespaces.
static String | SERVLET_CONTEXT_PREFIX Prefix for the ServletContext attribute for the WebApplicationContext.
Fields inherited from class org.springframework.web.servlet.HttpServletBean
logger
Constructor Summary
FrameworkServlet()
Method Summary
protected  LocaleContext buildLocaleContext(HttpServletRequest request)
Build a LocaleContext for the given request, exposing the request's primary locale as current locale.
protected  WebApplicationContext createWebApplicationContext(ApplicationContext parent)
Instantiate the WebApplicationContext for this servlet, either a default XmlWebApplicationContext or a custom context class, if set.
protected  WebApplicationContext createWebApplicationContext(WebApplicationContext parent)
Instantiate the WebApplicationContext for this servlet, either a default XmlWebApplicationContext or a custom context class, if set.
 void destroy()
Close the WebApplicationContext of this servlet.
protected  void doDelete(HttpServletRequest request, HttpServletResponse response)
Delegate DELETE requests to processRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse).
protected  void doGet(HttpServletRequest request, HttpServletResponse response)
Delegate GET requests to processRequest/doService.
protected  void doOptions(HttpServletRequest request, HttpServletResponse response)
Delegate OPTIONS requests to processRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), if desired.
protected  void doPost(HttpServletRequest request, HttpServletResponse response)
Delegate POST requests to processRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse).
protected  void doPut(HttpServletRequest request, HttpServletResponse response)
Delegate PUT requests to processRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse).
protected abstract  void doService(HttpServletRequest request, HttpServletResponse response)
Subclasses must implement this method to do the work of request handling, receiving a centralized callback for GET, POST, PUT and DELETE.
protected  void doTrace(HttpServletRequest request, HttpServletResponse response)
Delegate TRACE requests to processRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), if desired.
protected  WebApplicationContext findWebApplicationContext()
Retrieve a WebApplicationContext from the ServletContext attribute with the configured name.
 String getContextAttribute()
Return the name of the ServletContext attribute which should be used to retrieve the WebApplicationContext that this servlet is supposed to use.
 Class getContextClass()
Return the custom context class.
 String getContextConfigLocation()
Return the explicit context config location, if any.
 String getNamespace()
Return the namespace for this servlet, falling back to default scheme if no custom namespace was set: e.g.
 String getServletContextAttributeName()
Return the ServletContext attribute name for this servlet's WebApplicationContext.
protected  String getUsernameForRequest(HttpServletRequest request)
Determine the username for the given request.
 WebApplicationContext getWebApplicationContext()
Return this servlet's WebApplicationContext.
protected  void initFrameworkServlet()
This method will be invoked after any bean properties have been set and the WebApplicationContext has been loaded.
protected  void initServletBean()
Overridden method of HttpServletBean, invoked after any bean properties have been set.
protected  WebApplicationContext initWebApplicationContext()
Initialize and publish the WebApplicationContext for this servlet.
 void onApplicationEvent(ContextRefreshedEvent event)
Callback that receives refresh events from this servlet's WebApplicationContext.
protected  void onRefresh(ApplicationContext context)
Template method which can be overridden to add servlet-specific refresh work.
protected  void postProcessWebApplicationContext(ConfigurableWebApplicationContext wac)
Post-process the given WebApplicationContext before it is refreshed and activated as context for this servlet.
protected  void processRequest(HttpServletRequest request, HttpServletResponse response)
Process this request, publishing an event regardless of the outcome.
 void refresh()
Refresh this servlet's application context, as well as the dependent state of the servlet.
 void setContextAttribute(String contextAttribute)
Set the name of the ServletContext attribute which should be used to retrieve the WebApplicationContext that this servlet is supposed to use.
 void setContextClass(Class contextClass)
Set a custom context class.
 void setContextConfigLocation(String contextConfigLocation)
Set the context config location explicitly, instead of relying on the default location built from the namespace.
 void setDispatchOptionsRequest(boolean dispatchOptionsRequest)
Set whether this servlet should dispatch an HTTP OPTIONS request to the doService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) method.
 void setDispatchTraceRequest(boolean dispatchTraceRequest)
Set whether this servlet should dispatch an HTTP TRACE request to the doService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) method.
 void setNamespace(String namespace)
Set a custom namespace for this servlet, to be used for building a default context config location.
 void setPublishContext(boolean publishContext)
Set whether to publish this servlet's context as a ServletContext attribute, available to all objects in the web container.
 void setPublishEvents(boolean publishEvents)
Set whether this servlet should publish a ServletRequestHandledEvent at the end of each request.
 void setThreadContextInheritable(boolean threadContextInheritable)
Set whether to expose the LocaleContext and RequestAttributes as inheritable for child threads (using an InheritableThreadLocal).
Methods inherited from class org.springframework.web.servlet.HttpServletBean
addRequiredProperty, getServletContext, getServletName, init, initBeanWrapper
Methods inherited from class javax.servlet.http.HttpServlet
doHead, getLastModified, service, service
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletInfo, init, log, log
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_NAMESPACE_SUFFIX

public static final String DEFAULT_NAMESPACE_SUFFIX
Suffix for WebApplicationContext namespaces. If a servlet of this class is given the name "test" in a context, the namespace used by the servlet will resolve to "test-servlet".

See Also:
Constant Field Values

DEFAULT_CONTEXT_CLASS

public static final Class DEFAULT_CONTEXT_CLASS
Default context class for FrameworkServlet.

See Also:
XmlWebApplicationContext

SERVLET_CONTEXT_PREFIX

public static final String SERVLET_CONTEXT_PREFIX
Prefix for the ServletContext attribute for the WebApplicationContext. The completion is the servlet name.

Constructor Detail

FrameworkServlet

public FrameworkServlet()
Method Detail

setContextAttribute

public void setContextAttribute(String contextAttribute)
Set the name of the ServletContext attribute which should be used to retrieve the WebApplicationContext that this servlet is supposed to use.

getContextAttribute

public String getContextAttribute()
Return the name of the ServletContext attribute which should be used to retrieve the WebApplicationContext that this servlet is supposed to use.

setContextClass

public void setContextClass(Class contextClass)
Set a custom context class. This class must be of type WebApplicationContext.

When using the default FrameworkServlet implementation, the context class must also implement the ConfigurableWebApplicationContext interface.

See Also:
createWebApplicationContext(org.springframework.context.ApplicationContext)

getContextClass

public Class getContextClass()
Return the custom context class.

setNamespace

public void setNamespace(String namespace)
Set a custom namespace for this servlet, to be used for building a default context config location.

getNamespace

public String getNamespace()
Return the namespace for this servlet, falling back to default scheme if no custom namespace was set: e.g. "test-servlet" for a servlet named "test".

setContextConfigLocation

public void setContextConfigLocation(String contextConfigLocation)
Set the context config location explicitly, instead of relying on the default location built from the namespace. This location string can consist of multiple locations separated by any number of commas and spaces.

getContextConfigLocation

public String getContextConfigLocation()
Return the explicit context config location, if any.

setPublishContext

public void setPublishContext(boolean publishContext)
Set whether to publish this servlet's context as a ServletContext attribute, available to all objects in the web container. Default is "true".

This is especially handy during testing, although it is debatable whether it's good practice to let other application objects access the context this way.

setPublishEvents

public void setPublishEvents(boolean publishEvents)
Set whether this servlet should publish a ServletRequestHandledEvent at the end of each request. Default is "true"; can be turned off for a slight performance improvement, provided that no ApplicationListeners rely on such events.

See Also:
ServletRequestHandledEvent

setThreadContextInheritable

public void setThreadContextInheritable(boolean threadContextInheritable)
Set whether to expose the LocaleContext and RequestAttributes as inheritable for child threads (using an InheritableThreadLocal).

Default is "false", to avoid side effects on spawned background threads. Switch this to "true" to enable inheritance for custom child threads which are spawned during request processing and only used for this request (that is, ending after their initial task, without reuse of the thread).

WARNING: Do not use inheritance for child threads if you are accessing a thread pool which is configured to potentially add new threads on demand (e.g. a JDK ThreadPoolExecutor), since this will expose the inherited context to such a pooled thread.

setDispatchOptionsRequest

public void setDispatchOptionsRequest(boolean dispatchOptionsRequest)
Set whether this servlet should dispatch an HTTP OPTIONS request to the doService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) method.

Default is "false", applying HttpServlet's default behavior (i.e. enumerating all standard HTTP request methods as a response to the OPTIONS request).

Turn this flag on if you prefer OPTIONS requests to go through the regular dispatching chain, just like other HTTP requests. This usually means that your controllers will receive those requests; make sure that those endpoints are actually able to handle an OPTIONS request.

Note that HttpServlet's default OPTIONS processing will be applied in any case. Your controllers are simply available to override the default headers and optionally generate a response body.

setDispatchTraceRequest

public void setDispatchTraceRequest(boolean dispatchTraceRequest)
Set whether this servlet should dispatch an HTTP TRACE request to the doService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) method.

Default is "false", applying HttpServlet's default behavior (i.e. reflecting the message received back to the client).

Turn this flag on if you prefer TRACE requests to go through the regular dispatching chain, just like other HTTP requests. This usually means that your controllers will receive those requests; make sure that those endpoints are actually able to handle a TRACE request.

Note that HttpServlet's default TRACE processing will be applied in any case. Your controllers are simply available to override the default headers and the default body, calling response.reset() if necessary.

initServletBean

protected final void initServletBean()
                              throws ServletException
Overridden method of HttpServletBean, invoked after any bean properties have been set. Creates this servlet's WebApplicationContext.

Overrides:
initServletBean in class HttpServletBean
Throws:
ServletException - if subclass initialization fails

initWebApplicationContext

protected WebApplicationContext initWebApplicationContext()
Initialize and publish the WebApplicationContext for this servlet.

Delegates to createWebApplicationContext(org.springframework.context.ApplicationContext) for actual creation of the context. Can be overridden in subclasses.

Returns:
the WebApplicationContext instance
See Also:
setContextClass(java.lang.Class), setContextConfigLocation(java.lang.String)

findWebApplicationContext

protected WebApplicationContext findWebApplicationContext()
Retrieve a WebApplicationContext from the ServletContext attribute with the configured name. The WebApplicationContext must have already been loaded and stored in the ServletContext before this servlet gets initialized (or invoked).

Subclasses may override this method to provide a different WebApplicationContext retrieval strategy.

Returns:
the WebApplicationContext for this servlet, or null if not found
See Also:
getContextAttribute()

createWebApplicationContext

protected WebApplicationContext createWebApplicationContext(ApplicationContext parent)
Instantiate the WebApplicationContext for this servlet, either a default XmlWebApplicationContext or a custom context class, if set.

This implementation expects custom contexts to implement the ConfigurableWebApplicationContext interface. Can be overridden in subclasses.

Do not forget to register this servlet instance as application listener on the created context (for triggering its callback, and to call ConfigurableApplicationContext.refresh() before returning the context instance.

Parameters:
parent - the parent ApplicationContext to use, or null if none
Returns:
the WebApplicationContext for this servlet
See Also:
XmlWebApplicationContext

createWebApplicationContext

protected WebApplicationContext createWebApplicationContext(WebApplicationContext parent)
Instantiate the WebApplicationContext for this servlet, either a default XmlWebApplicationContext or a custom context class, if set. Delegates to #createWebApplicationContext(ApplicationContext).

Parameters:
parent - the parent WebApplicationContext to use, or null if none
Returns:
the WebApplicationContext for this servlet
See Also:
XmlWebApplicationContext, createWebApplicationContext(ApplicationContext)

postProcessWebApplicationContext

protected void postProcessWebApplicationContext(ConfigurableWebApplicationContext wac)
Post-process the given WebApplicationContext before it is refreshed and activated as context for this servlet.

The default implementation is empty. refresh() will be called automatically after this method returns.

Parameters:
wac - the configured WebApplicationContext (not refreshed yet)
See Also:
createWebApplicationContext(org.springframework.context.ApplicationContext), ConfigurableApplicationContext.refresh()

getServletContextAttributeName

public String getServletContextAttributeName()
Return the ServletContext attribute name for this servlet's WebApplicationContext.

The default implementation returns SERVLET_CONTEXT_PREFIX + servlet name.

See Also:
SERVLET_CONTEXT_PREFIX, HttpServletBean.getServletName()

getWebApplicationContext

public final WebApplicationContext getWebApplicationContext()
Return this servlet's WebApplicationContext.

initFrameworkServlet

protected void initFrameworkServlet()
                             throws ServletException
This method will be invoked after any bean properties have been set and the WebApplicationContext has been loaded. The default implementation is empty; subclasses may override this method to perform any initialization they require.

Throws:
ServletException - in case of an initialization exception

refresh

public void refresh()
Refresh this servlet's application context, as well as the dependent state of the servlet.

See Also:
getWebApplicationContext(), ConfigurableApplicationContext.refresh()

onApplicationEvent

public void onApplicationEvent(ContextRefreshedEvent event)
Callback that receives refresh events from this servlet's WebApplicationContext.

The default implementation calls onRefresh(org.springframework.context.ApplicationContext), triggering a refresh of this servlet's context-dependent state.

Parameters:
event - the incoming ApplicationContext event

onRefresh

protected void onRefresh(ApplicationContext context)
Template method which can be overridden to add servlet-specific refresh work. Called after successful context refresh.

This implementation is empty.

Parameters:
context - the current WebApplicationContext
See Also:
refresh()

doGet

protected final void doGet(HttpServletRequest request,
                           HttpServletResponse response)
                    throws ServletException,
                           IOException
Delegate GET requests to processRequest/doService.

Will also be invoked by HttpServlet's default implementation of doHead, with a NoBodyResponse that just captures the content length.

Overrides:
doGet in class HttpServlet
Throws:
ServletException
IOException
See Also:
doService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), HttpServlet.doHead(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

doPost

protected final void doPost(HttpServletRequest request,
                            HttpServletResponse response)
                     throws ServletException,
                            IOException
Delegate POST requests to processRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse).

Overrides:
doPost in class HttpServlet
Throws:
ServletException
IOException
See Also:
doService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

doPut

protected final void doPut(HttpServletRequest request,
                           HttpServletResponse response)
                    throws ServletException,
                           IOException
Delegate PUT requests to processRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse).

Overrides:
doPut in class HttpServlet
Throws:
ServletException
IOException
See Also:
doService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

doDelete

protected final void doDelete(HttpServletRequest request,
                              HttpServletResponse response)
                       throws ServletException,
                              IOException
Delegate DELETE requests to processRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse).

Overrides:
doDelete in class HttpServlet
Throws:
ServletException
IOException
See Also:
doService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

doOptions

protected void doOptions(HttpServletRequest request,
                         HttpServletResponse response)
                  throws ServletException,
                         IOException
Delegate OPTIONS requests to processRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), if desired.

Applies HttpServlet's standard OPTIONS processing first.

Overrides:
doOptions in class HttpServlet
Throws:
ServletException
IOException
See Also:
doService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

doTrace

protected void doTrace(HttpServletRequest request,
                       HttpServletResponse response)
                throws ServletException,
                       IOException
Delegate TRACE requests to processRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), if desired.

Applies HttpServlet's standard TRACE processing first.

Overrides:
doTrace in class HttpServlet
Throws:
ServletException
IOException
See Also:
doService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

processRequest

protected final void processRequest(HttpServletRequest request,
                                    HttpServletResponse response)
                             throws ServletException,
                                    IOException
Process this request, publishing an event regardless of the outcome.

The actual event handling is performed by the abstract doService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) template method.

Throws:
ServletException
IOException

buildLocaleContext

protected LocaleContext buildLocaleContext(HttpServletRequest request)
Build a LocaleContext for the given request, exposing the request's primary locale as current locale.

Parameters:
request - current HTTP request
Returns:
the corresponding LocaleContext

getUsernameForRequest

protected String getUsernameForRequest(HttpServletRequest request)
Determine the username for the given request.

The default implementation takes the name of the UserPrincipal, if any. Can be overridden in subclasses.

Parameters:
request - current HTTP request
Returns:
the username, or null if none found
See Also:
HttpServletRequest.getUserPrincipal()

doService

protected abstract void doService(HttpServletRequest request,
                                  HttpServletResponse response)
                           throws Exception
Subclasses must implement this method to do the work of request handling, receiving a centralized callback for GET, POST, PUT and DELETE.

The contract is essentially the same as that for the commonly overridden doGet or doPost methods of HttpServlet.

This class intercepts calls to ensure that exception handling and event publication takes place.

Parameters:
request - current HTTP request
response - current HTTP response
Throws:
Exception - in case of any kind of processing failure
See Also:
HttpServlet.doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), HttpServlet.doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

destroy

public void destroy()
Close the WebApplicationContext of this servlet.

Specified by:
destroy in interface Servlet
Overrides:
destroy in class GenericServlet
See Also:
ConfigurableApplicationContext.close()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HandlerExecutionChain

org.springframework.web.servlet
Class HandlerExecutionChain

java.lang.Object
    extended by  org.springframework.web.servlet.HandlerExecutionChain

public class HandlerExecutionChain
extends Object

Handler execution chain, consisting of handler object and any handler interceptors. Returned by HandlerMapping's HandlerMapping.getHandler(javax.servlet.http.HttpServletRequest) method.

Since:
20.06.2003
Author:
Juergen Hoeller
See Also:
HandlerInterceptor

Constructor Summary
HandlerExecutionChain(Object handler)
Create a new HandlerExecutionChain.
HandlerExecutionChain(Object handler, HandlerInterceptor[] interceptors)
Create a new HandlerExecutionChain.
Method Summary
 void addInterceptor(HandlerInterceptor interceptor)
 void addInterceptors(HandlerInterceptor[] interceptors)
 Object getHandler()
Return the handler object to execute.
 HandlerInterceptor[] getInterceptors()
Return the array of interceptors to apply (in the given order).
 String toString()
Delegates to the handler's toString().
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

HandlerExecutionChain

public HandlerExecutionChain(Object handler)
Create a new HandlerExecutionChain.

Parameters:
handler - the handler object to execute

HandlerExecutionChain

public HandlerExecutionChain(Object handler,
                             HandlerInterceptor[] interceptors)
Create a new HandlerExecutionChain.

Parameters:
handler - the handler object to execute
interceptors - the array of interceptors to apply (in the given order) before the handler itself executes
Method Detail

getHandler

public Object getHandler()
Return the handler object to execute.

Returns:
the handler object

addInterceptor

public void addInterceptor(HandlerInterceptor interceptor)

addInterceptors

public void addInterceptors(HandlerInterceptor[] interceptors)

getInterceptors

public HandlerInterceptor[] getInterceptors()
Return the array of interceptors to apply (in the given order).

Returns:
the array of HandlerInterceptors instances (may be null)

toString

public String toString()
Delegates to the handler's toString().

Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HttpServletBean

org.springframework.web.servlet
Class HttpServletBean

java.lang.Object
    extended by  javax.servlet.GenericServlet
        extended by  javax.servlet.http.HttpServlet
            extended by  org.springframework.web.servlet.HttpServletBean
All Implemented Interfaces:
Serializable, Servlet, ServletConfig
Direct Known Subclasses:
FrameworkServlet, ResourceServlet
public abstract class HttpServletBean
extends HttpServlet

Simple extension of HttpServlet which treats its config parameters (init-param entries within the servlet tag in web.xml) as bean properties.

A handy superclass for any type of servlet. Type conversion of config parameters is automatic, with the corresponding setter method getting invoked with the converted value. It is also possible for subclasses to specify required properties. Parameters without matching bean property setter will simply be ignored.

This servlet leaves request handling to subclasses, inheriting the default behavior of HttpServlet (doGet, doPost, etc).

This generic servlet base class has no dependency on the Spring ApplicationContext concept. Simple servlets usually don't load their own context but rather access service beans from the Spring root application context, accessible via the filter's ServletContext (see WebApplicationContextUtils).

The FrameworkServlet class is a more specific servlet base class which loads its own application context. FrameworkServlet serves as direct base class of Spring's full-fledged DispatcherServlet.

Author:
Rod Johnson, Juergen Hoeller
See Also:
addRequiredProperty(java.lang.String),
initServletBean(),
HttpServlet.doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse),
HttpServlet.doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse),
Serialized Form

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
HttpServletBean()
Method Summary
protected void | addRequiredProperty(String property) Subclasses can invoke this method to specify that this property (which must match a JavaBean property they expose) is mandatory, and must be supplied as a config parameter.
ServletContext | getServletContext() Overridden method that simply returns null when no ServletConfig set yet.
String | getServletName() Overridden method that simply returns null when no ServletConfig set yet.
void | init() Map config parameters onto bean properties of this servlet, and invoke subclass initialization.
protected void | initBeanWrapper(BeanWrapper bw) Initialize the BeanWrapper for this HttpServletBean, possibly with custom editors.
protected void | initServletBean() Subclasses may override this to perform custom initialization.
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletInfo, init, log, log
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

HttpServletBean

public HttpServletBean()
Method Detail

addRequiredProperty

protected final void addRequiredProperty(String property)
Subclasses can invoke this method to specify that this property (which must match a JavaBean property they expose) is mandatory, and must be supplied as a config parameter. This should be called from the constructor of a subclass.

This method is only relevant in case of traditional initialization driven by a ServletConfig instance.

Parameters:
property - name of the required property

init

public final void init()
                throws ServletException
Map config parameters onto bean properties of this servlet, and invoke subclass initialization.

Overrides:
init in class GenericServlet
Throws:
ServletException - if bean properties are invalid (or required properties are missing), or if subclass initialization fails.

initBeanWrapper

protected void initBeanWrapper(BeanWrapper bw)
                        throws BeansException
Initialize the BeanWrapper for this HttpServletBean, possibly with custom editors.

This default implementation is empty.

Parameters:
bw - the BeanWrapper to initialize
Throws:
BeansException - if thrown by BeanWrapper methods
See Also:
PropertyEditorRegistry.registerCustomEditor(java.lang.Class, java.beans.PropertyEditor)

getServletName

public final String getServletName()
Overridden method that simply returns null when no ServletConfig set yet.

Specified by:
getServletName in interface ServletConfig
Overrides:
getServletName in class GenericServlet
See Also:
GenericServlet.getServletConfig()

getServletContext

public final ServletContext getServletContext()
Overridden method that simply returns null when no ServletConfig set yet.

Specified by:
getServletContext in interface ServletConfig
Overrides:
getServletContext in class GenericServlet
See Also:
GenericServlet.getServletConfig()

initServletBean

protected void initServletBean()
                        throws ServletException
Subclasses may override this to perform custom initialization. All bean properties of this servlet will have been set before this method is invoked.

This default implementation is empty.

Throws:
ServletException - if subclass initialization fails
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ModelAndView

org.springframework.web.servlet
Class ModelAndView

java.lang.Object
    extended by  org.springframework.web.servlet.ModelAndView

public class ModelAndView
extends Object

Holder for both Model and View in the web MVC framework. Note that these are entirely distinct. This class merely holds both to make it possible for a controller to return both model and view in a single return value.

Represents a model and view returned by a handler, to be resolved by a DispatcherServlet. The view can take the form of a String view name which will need to be resolved by a ViewResolver object; alternatively a View object can be specified directly. The model is a Map, allowing the use of multiple objects keyed by name.

Author:
Rod Johnson, Juergen Hoeller, Rob Harrop
See Also:
DispatcherServlet, ViewResolver, HandlerAdapter.handle(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object), Controller.handleRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

Constructor Summary
ModelAndView()
Default constructor for bean-style usage: populating bean properties instead of passing in constructor arguments.
ModelAndView(String viewName)
Convenient constructor when there is no model data to expose.
ModelAndView(String viewName, Map<String,?> model)
Creates new ModelAndView given a view name and a model.
ModelAndView(String viewName, String modelName, Object modelObject)
Convenient constructor to take a single model object.
ModelAndView(View view)
Convenient constructor when there is no model data to expose.
ModelAndView(View view, Map<String,?> model)
Creates new ModelAndView given a View object and a model.
ModelAndView(View view, String modelName, Object modelObject)
Convenient constructor to take a single model object.
Method Summary
 ModelAndView addAllObjects(Map<String,?> modelMap)
Add all attributes contained in the provided Map to the model.
 ModelAndView addObject(Object attributeValue)
Add an attribute to the model using parameter name generation.
 ModelAndView addObject(String attributeName, Object attributeValue)
Add an attribute to the model.
 void clear()
Clear the state of this ModelAndView object.
 Map<String,Object> getModel()
Return the model map.
protected  Map<String,Object> getModelInternal()
Return the model map.
 ModelMap getModelMap()
Return the underlying ModelMap instance (never null).
 View getView()
Return the View object, or null if we are using a view name to be resolved by the DispatcherServlet via a ViewResolver.
 String getViewName()
Return the view name to be resolved by the DispatcherServlet via a ViewResolver, or null if we are using a View object.
 boolean hasView()
Indicate whether or not this ModelAndView has a view, either as a view name or as a direct View instance.
 boolean isEmpty()
Return whether this ModelAndView object is empty, i.e.
 boolean isReference()
Return whether we use a view reference, i.e.
 void setView(View view)
Set a View object for this ModelAndView.
 void setViewName(String viewName)
Set a view name for this ModelAndView, to be resolved by the DispatcherServlet via a ViewResolver.
 String toString()
Return diagnostic information about this model and view.
 boolean wasCleared()
Return whether this ModelAndView object is empty as a result of a call to clear() i.e.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ModelAndView

public ModelAndView()
Default constructor for bean-style usage: populating bean properties instead of passing in constructor arguments.

See Also:
setView(View), setViewName(String)

ModelAndView

public ModelAndView(String viewName)
Convenient constructor when there is no model data to expose. Can also be used in conjunction with addObject.

Parameters:
viewName - name of the View to render, to be resolved by the DispatcherServlet's ViewResolver
See Also:
addObject(java.lang.String, java.lang.Object)

ModelAndView

public ModelAndView(View view)
Convenient constructor when there is no model data to expose. Can also be used in conjunction with addObject.

Parameters:
view - View object to render
See Also:
addObject(java.lang.String, java.lang.Object)

ModelAndView

public ModelAndView(String viewName,
                    Map<String,?> model)
Creates new ModelAndView given a view name and a model.

Parameters:
viewName - name of the View to render, to be resolved by the DispatcherServlet's ViewResolver
model - Map of model names (Strings) to model objects (Objects). Model entries may not be null, but the model Map may be null if there is no model data.

ModelAndView

public ModelAndView(View view,
                    Map<String,?> model)
Creates new ModelAndView given a View object and a model. Note: the supplied model data is copied into the internal storage of this class. You should not consider to modify the supplied Map after supplying it to this class

Parameters:
view - View object to render
model - Map of model names (Strings) to model objects (Objects). Model entries may not be null, but the model Map may be null if there is no model data.

ModelAndView

public ModelAndView(String viewName,
                    String modelName,
                    Object modelObject)
Convenient constructor to take a single model object.

Parameters:
viewName - name of the View to render, to be resolved by the DispatcherServlet's ViewResolver
modelName - name of the single entry in the model
modelObject - the single model object

ModelAndView

public ModelAndView(View view,
                    String modelName,
                    Object modelObject)
Convenient constructor to take a single model object.

Parameters:
view - View object to render
modelName - name of the single entry in the model
modelObject - the single model object
Method Detail

setViewName

public void setViewName(String viewName)
Set a view name for this ModelAndView, to be resolved by the DispatcherServlet via a ViewResolver. Will override any pre-existing view name or View.

getViewName

public String getViewName()
Return the view name to be resolved by the DispatcherServlet via a ViewResolver, or null if we are using a View object.

setView

public void setView(View view)
Set a View object for this ModelAndView. Will override any pre-existing view name or View.

getView

public View getView()
Return the View object, or null if we are using a view name to be resolved by the DispatcherServlet via a ViewResolver.

hasView

public boolean hasView()
Indicate whether or not this ModelAndView has a view, either as a view name or as a direct View instance.

isReference

public boolean isReference()
Return whether we use a view reference, i.e. true if the view has been specified via a name to be resolved by the DispatcherServlet via a ViewResolver.

getModelInternal

protected Map<String,Object> getModelInternal()
Return the model map. May return null. Called by DispatcherServlet for evaluation of the model.

getModelMap

public ModelMap getModelMap()
Return the underlying ModelMap instance (never null).

getModel

public Map<String,Object> getModel()
Return the model map. Never returns null. To be called by application code for modifying the model.

addObject

public ModelAndView addObject(String attributeName,
                              Object attributeValue)
Add an attribute to the model.

Parameters:
attributeName - name of the object to add to the model
attributeValue - object to add to the model (never null)
See Also:
ModelMap.addAttribute(String, Object), getModelMap()

addObject

public ModelAndView addObject(Object attributeValue)
Add an attribute to the model using parameter name generation.

Parameters:
attributeValue - the object to add to the model (never null)
See Also:
ModelMap.addAttribute(Object), getModelMap()

addAllObjects

public ModelAndView addAllObjects(Map<String,?> modelMap)
Add all attributes contained in the provided Map to the model.

Parameters:
modelMap - a Map of attributeName -> attributeValue pairs
See Also:
ModelMap.addAllAttributes(Map), getModelMap()

clear

public void clear()
Clear the state of this ModelAndView object. The object will be empty afterwards.

Can be used to suppress rendering of a given ModelAndView object in the postHandle method of a HandlerInterceptor.

See Also:
isEmpty(), HandlerInterceptor.postHandle(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object, org.springframework.web.servlet.ModelAndView)

isEmpty

public boolean isEmpty()
Return whether this ModelAndView object is empty, i.e. whether it does not hold any view and does not contain a model.

wasCleared

public boolean wasCleared()
Return whether this ModelAndView object is empty as a result of a call to clear() i.e. whether it does not hold any view and does not contain a model.

Returns false if any additional state was added to the instance after the call to clear().

See Also:
clear()

toString

public String toString()
Return diagnostic information about this model and view.

Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResourceServlet

org.springframework.web.servlet
Class ResourceServlet

java.lang.Object
    extended by  javax.servlet.GenericServlet
        extended by  javax.servlet.http.HttpServlet
            extended by  org.springframework.web.servlet.HttpServletBean
                extended by  org.springframework.web.servlet.ResourceServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig
public class ResourceServlet
extends HttpServletBean

Simple servlet that can expose an internal resource, including a default URL if the specified resource is not found. An alternative, for example, to trying and catching exceptions when using JSP include.

A further usage of this servlet is the ability to apply last-modified timestamps to quasi-static resources (typically JSPs). This can happen as bridge to parameter-specified resources, or as proxy for a specific target resource (or a list of specific target resources to combine).

A typical usage would map a URL like "/ResourceServlet" onto an instance of this servlet, and use the "JSP include" action to include this URL, with the "resource" parameter indicating the actual target path in the WAR.

The defaultUrl property can be set to the internal resource path of a default URL, to be rendered when the target resource is not found or not specified in the first place.

The "resource" parameter and the defaultUrl property can also specify a list of target resources to combine. Those resources will be included one by one to build the response. If last-modified determination is active, the newest timestamp among those files will be used.

The allowedResources property can be set to a URL pattern of resources that should be available via this servlet. If not set, any target resource can be requested, including resources in the WEB-INF directory!

If using this servlet for direct access rather than via includes, the contentType property should be specified to apply a proper content type. Note that a content type header in the target JSP will be ignored when including the resource via a RequestDispatcher include.

To apply last-modified timestamps for the target resource, set the applyLastModified property to true. This servlet will then return the file timestamp of the target resource as last-modified value, falling back to the startup time of this servlet if not retrievable.

Note that applying the last-modified timestamp in the above fashion just makes sense if the target resource does not generate content that depends on the HttpSession or cookies; it is just allowed to evaluate request parameters.

A typical case for such last-modified usage is a JSP that just makes minimal usage of basic means like includes or message resolution to build quasi-static content. Regenerating such content on every request is unnecessary; it can be cached as long as the file hasn't changed.

Note that this servlet will apply the last-modified timestamp if you tell it to do so: It's your decision whether the content of the target resource can be cached in such a fashion. Typical use cases are helper resources that are not fronted by a controller, like JavaScript files that are generated by a JSP (without depending on the HttpSession).

Author:
Juergen Hoeller, Rod Johnson
See Also:
setDefaultUrl(java.lang.String), setAllowedResources(java.lang.String), setApplyLastModified(boolean), Serialized Form

Field Summary
static String | RESOURCE_PARAM_NAME Name of the parameter that must contain the actual resource path.
static String | RESOURCE_URL_DELIMITERS Any number of these characters are considered delimiters between multiple resource paths in a single String value.
Fields inherited from class org.springframework.web.servlet.HttpServletBean
logger
Constructor Summary
ResourceServlet()
Method Summary
protected String | determineResourceUrl(HttpServletRequest request) Determine the URL of the target resource of this request.
protected void | doGet(HttpServletRequest request, HttpServletResponse response) Determine the URL of the target resource and include it.
protected long | getFileTimestamp(String resourceUrl) Return the file timestamp for the given resource.
protected long | getLastModified(HttpServletRequest request) Return the last-modified timestamp of the file that corresponds to the target resource URL (i.e.
protected PathMatcher | getPathMatcher() Return a PathMatcher to use for matching the "allowedResources" URL pattern.
protected void | initServletBean() Remember the startup time, using no last-modified time before it.
void | setAllowedResources(String allowedResources) Set allowed resources as URL pattern, e.g.
void | setApplyLastModified(boolean applyLastModified) Set whether to apply the file timestamp of the target resource as last-modified value.
void | setContentType(String contentType) Set the content type of the target resource (typically a JSP).
void | setDefaultUrl(String defaultUrl) Set the URL within the current web application from which to include content if the requested path isn't found, or if none is specified in the first place.
Methods inherited from class org.springframework.web.servlet.HttpServletBean
addRequiredProperty, getServletContext, getServletName, init, initBeanWrapper
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, service, service
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletInfo, init, log, log
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

RESOURCE_URL_DELIMITERS

public static final String RESOURCE_URL_DELIMITERS
Any number of these characters are considered delimiters between multiple resource paths in a single String value.

See Also:
Constant Field Values

RESOURCE_PARAM_NAME

public static final String RESOURCE_PARAM_NAME
Name of the parameter that must contain the actual resource path.

See Also:
Constant Field Values
Constructor Detail

ResourceServlet

public ResourceServlet()
Method Detail

setDefaultUrl

public void setDefaultUrl(String defaultUrl)
Set the URL within the current web application from which to include content if the requested path isn't found, or if none is specified in the first place.

If specifying multiple URLs, they will be included one by one to build the response. If last-modified determination is active, the newest timestamp among those files will be used.

See Also:
setApplyLastModified(boolean)

setAllowedResources

public void setAllowedResources(String allowedResources)
Set allowed resources as URL pattern, e.g. "/WEB-INF/res/*.jsp", The parameter can be any Ant-style pattern parsable by AntPathMatcher.

See Also:
AntPathMatcher

setContentType

public void setContentType(String contentType)
Set the content type of the target resource (typically a JSP). Default is none, which is appropriate when including resources.

For directly accessing resources, for example to leverage this servlet's last-modified support, specify a content type here. Note that a content type header in the target JSP will be ignored when including the resource via a RequestDispatcher include.

setApplyLastModified

public void setApplyLastModified(boolean applyLastModified)
Set whether to apply the file timestamp of the target resource as last-modified value. Default is "false".

This is mainly intended for JSP targets that don't generate session-specific or database-driven content: Such files can be cached by the browser as long as the last-modified timestamp of the JSP file doesn't change.

This will only work correctly with expanded WAR files that allow access to the file timestamps. Else, the startup time of this servlet is returned.

initServletBean

protected void initServletBean()
Remember the startup time, using no last-modified time before it.

Overrides:
initServletBean in class HttpServletBean

getPathMatcher

protected PathMatcher getPathMatcher()
Return a PathMatcher to use for matching the "allowedResources" URL pattern. Default is AntPathMatcher.

See Also:
setAllowedResources(java.lang.String), AntPathMatcher

doGet

protected final void doGet(HttpServletRequest request,
                           HttpServletResponse response)
                    throws ServletException,
                           IOException
Determine the URL of the target resource and include it.

Overrides:
doGet in class HttpServlet
Throws:
ServletException
IOException
See Also:
determineResourceUrl(javax.servlet.http.HttpServletRequest)

determineResourceUrl

protected String determineResourceUrl(HttpServletRequest request)
Determine the URL of the target resource of this request.

Default implementation returns the value of the "resource" parameter. Can be overridden in subclasses.

Parameters:
request - current HTTP request
Returns:
the URL of the target resource, or null if none found
See Also:
RESOURCE_PARAM_NAME

getLastModified

protected final long getLastModified(HttpServletRequest request)
Return the last-modified timestamp of the file that corresponds to the target resource URL (i.e. typically the request ".jsp" file). Will simply return -1 if "applyLastModified" is false (the default).

Returns no last-modified date before the startup time of this servlet, to allow for message resolution etc that influences JSP contents, assuming that those background resources might have changed on restart.

Returns the startup time of this servlet if the file that corresponds to the target resource URL coudln't be resolved (for example, because the WAR is not expanded).

Overrides:
getLastModified in class HttpServlet
See Also:
determineResourceUrl(javax.servlet.http.HttpServletRequest), getFileTimestamp(java.lang.String)

getFileTimestamp

protected long getFileTimestamp(String resourceUrl)
Return the file timestamp for the given resource.

Parameters:
resourceUrl - the URL of the resource
Returns:
the file timestamp in milliseconds, or -1 if not determinable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ViewRendererServlet

org.springframework.web.servlet
Class ViewRendererServlet

java.lang.Object
    extended by  javax.servlet.GenericServlet
        extended by  javax.servlet.http.HttpServlet
            extended by  org.springframework.web.servlet.ViewRendererServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig
public class ViewRendererServlet
extends HttpServlet

ViewRendererServlet is a bridge servlet, mainly for the Portlet MVC support.

For usage with Portlets, this Servlet is necessary to force the portlet container to convert the PortletRequest to a ServletRequest, which it has to do when including a resource via the PortletRequestDispatcher. This allows for reuse of the entire Servlet-based View support even in a Portlet environment.

The actual mapping of the bridge servlet is configurable in the DispatcherPortlet, via a "viewRendererUrl" property. The default is "/WEB-INF/servlet/view", which is just available for internal resource dispatching.

Since:
2.0
Author:
William G. Thompson, Jr., John A. Lewis, Juergen Hoeller
See Also:
Serialized Form

Field Summary
static String | MODEL_ATTRIBUTE Name of request attribute that holds the model Map
static String | VIEW_ATTRIBUTE Name of request attribute that holds the View object
static String | WEB_APPLICATION_CONTEXT_ATTRIBUTE Request attribute to hold current web application context.
Constructor Summary
ViewRendererServlet()
Method Summary
protected void | doGet(HttpServletRequest request, HttpServletResponse response)
protected void | doPost(HttpServletRequest request, HttpServletResponse response)
protected void | processRequest(HttpServletRequest request, HttpServletResponse response) Process this request, handling exceptions.
protected void | renderView(HttpServletRequest request, HttpServletResponse response) Retrieve the View instance and model Map to render and trigger actual rendering.
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

WEB_APPLICATION_CONTEXT_ATTRIBUTE

public static final String WEB_APPLICATION_CONTEXT_ATTRIBUTE
Request attribute to hold current web application context. Otherwise only the global web app context is obtainable by tags etc.

See Also:
RequestContextUtils.getWebApplicationContext(javax.servlet.ServletRequest)

VIEW_ATTRIBUTE

public static final String VIEW_ATTRIBUTE
Name of request attribute that holds the View object

MODEL_ATTRIBUTE

public static final String MODEL_ATTRIBUTE
Name of request attribute that holds the model Map

Constructor Detail

ViewRendererServlet

public ViewRendererServlet()
Method Detail

doGet

protected final void doGet(HttpServletRequest request,
                           HttpServletResponse response)
                    throws ServletException,
                           IOException
Overrides:
doGet in class HttpServlet
Throws:
ServletException
IOException

doPost

protected final void doPost(HttpServletRequest request,
                            HttpServletResponse response)
                     throws ServletException,
                            IOException
Overrides:
doPost in class HttpServlet
Throws:
ServletException
IOException

processRequest

protected final void processRequest(HttpServletRequest request,
                                    HttpServletResponse response)
                             throws ServletException,
                                    IOException
Process this request, handling exceptions. The actually event handling is performed by the abstract renderView() template method.

Throws:
ServletException
IOException
See Also:
renderView(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

renderView

protected void renderView(HttpServletRequest request,
                          HttpServletResponse response)
                   throws Exception
Retrieve the View instance and model Map to render and trigger actual rendering.

Parameters:
request - current HTTP request
response - current HTTP response
Throws:
Exception - in case of any kind of processing failure
See Also:
View.render(java.util.Map, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ModelAndViewDefiningException

org.springframework.web.servlet
Class ModelAndViewDefiningException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.servlet.ServletException
                extended by  org.springframework.web.servlet.ModelAndViewDefiningException
All Implemented Interfaces:
Serializable
public class ModelAndViewDefiningException
extends ServletException

Exception to be thrown on error conditions that should forward to a specific view with a specific model.

Can be thrown at any time during handler processing. This includes any template methods of pre-built controllers. For example, a form controller might abort to a specific error page if certain parameters do not allow to proceed with the normal workflow.

Since:
22.11.2003
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
ModelAndViewDefiningException(ModelAndView modelAndView)
Create new ModelAndViewDefiningException with the given ModelAndView, typically representing a specific error page.
Method Summary
 ModelAndView getModelAndView()
Return the ModelAndView that this exception contains for forwarding to.
Methods inherited from class javax.servlet.ServletException
getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ModelAndViewDefiningException

public ModelAndViewDefiningException(ModelAndView modelAndView)
Create new ModelAndViewDefiningException with the given ModelAndView, typically representing a specific error page.

Parameters:
modelAndView - ModelAndView with view to forward to and model to expose
Method Detail

getModelAndView

public ModelAndView getModelAndView()
Return the ModelAndView that this exception contains for forwarding to.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.web.servlet.config

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.servlet.config

Defines the Spring MVC configuration namespace.

See:
Description

Class Summary
MvcNamespaceHandler NamespaceHandler for Spring MVC configuration namespace.

Package org.springframework.web.servlet.config Description

Defines the Spring MVC configuration namespace.


org.springframework.web.servlet.config Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.servlet.config

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.beans.factory.xml.NamespaceHandlerSupport (implements org.springframework.beans.factory.xml.NamespaceHandler)
      • org.springframework.web.servlet.config.MvcNamespaceHandler


MvcNamespaceHandler

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.config
Class MvcNamespaceHandler

java.lang.Object
    extended by  org.springframework.beans.factory.xml.NamespaceHandlerSupport
        extended by  org.springframework.web.servlet.config.MvcNamespaceHandler
All Implemented Interfaces:
NamespaceHandler
public class MvcNamespaceHandler
extends NamespaceHandlerSupport

NamespaceHandler for Spring MVC configuration namespace.

Since:
3.0
Author:
Keith Donald

Constructor Summary
MvcNamespaceHandler()
Method Summary
 void init()
Invoked by the DefaultBeanDefinitionDocumentReader after construction but before any custom elements are parsed.
Methods inherited from class org.springframework.beans.factory.xml.NamespaceHandlerSupport
decorate, parse, registerBeanDefinitionDecorator, registerBeanDefinitionDecoratorForAttribute, registerBeanDefinitionParser
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MvcNamespaceHandler

public MvcNamespaceHandler()
Method Detail

init

public void init()
Description copied from interface: NamespaceHandler
Invoked by the DefaultBeanDefinitionDocumentReader after construction but before any custom elements are parsed.

See Also:
NamespaceHandlerSupport.registerBeanDefinitionParser(String, BeanDefinitionParser)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.servlet.handler

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.servlet.handler

Provides standard HandlerMapping implementations, including abstract base classes for custom implementations.

See:
Description

Class Summary
AbstractDetectingUrlHandlerMapping | Abstract implementation of the HandlerMapping interface, detecting URL mappings for handler beans through introspection of all defined beans in the application context.
AbstractHandlerExceptionResolver | Abstract base class for HandlerExceptionResolver implementations.
AbstractHandlerMapping | Abstract base class for HandlerMapping implementations.
AbstractUrlHandlerMapping | Abstract base class for URL-mapped HandlerMapping implementations.
BeanNameUrlHandlerMapping | Implementation of the HandlerMapping interface that map from URLs to beans with names that start with a slash ("/"), similar to how Struts maps URLs to action names.
ConversionServiceExposingInterceptor | Interceptor that places the configured ConversionService in request scope so it's available during request processing.
DispatcherServletWebRequest | ServletWebRequest subclass that is aware of DispatcherServlet's request context, such as the Locale determined by the configured LocaleResolver.
HandlerInterceptorAdapter | Abstract adapter class for the HandlerInterceptor interface, for simplified implementation of pre-only/post-only interceptors.
MappedInterceptor | Holds information about a HandlerInterceptor mapped to a path into the application.
SimpleMappingExceptionResolver | HandlerExceptionResolver implementation that allows for mapping exception class names to view names, either for a set of given handlers or for all handlers in the DispatcherServlet.
SimpleServletHandlerAdapter | Adapter to use the Servlet interface with the generic DispatcherServlet.
SimpleServletPostProcessor | BeanPostProcessor that applies initialization and destruction callbacks to beans that implement the Servlet interface.
SimpleUrlHandlerMapping | Implementation of the HandlerMapping interface to map from URLs to request handler beans.
UserRoleAuthorizationInterceptor | Interceptor that checks the authorization of the current user via the user's roles, as evaluated by HttpServletRequest's isUserInRole method.
WebRequestHandlerInterceptorAdapter | Adapter that implements the Servlet HandlerInterceptor interface and wraps an underlying WebRequestInterceptor.

Package org.springframework.web.servlet.handler Description

Provides standard HandlerMapping implementations, including abstract base classes for custom implementations.


org.springframework.web.servlet.handler Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.servlet.handler

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver (implements org.springframework.web.servlet.HandlerExceptionResolver, org.springframework.core.Ordered)
      • org.springframework.web.servlet.handler.SimpleMappingExceptionResolver
    • org.springframework.web.context.request.AbstractRequestAttributes (implements org.springframework.web.context.request.RequestAttributes)
      • org.springframework.web.context.request.ServletRequestAttributes
        • org.springframework.web.context.request.ServletWebRequest (implements org.springframework.web.context.request.NativeWebRequest)
          • org.springframework.web.servlet.handler.DispatcherServletWebRequest
    • org.springframework.context.support.ApplicationObjectSupport (implements org.springframework.context.ApplicationContextAware)
      • org.springframework.web.context.support.WebApplicationObjectSupport (implements org.springframework.web.context.ServletContextAware)
        • org.springframework.web.servlet.handler.AbstractHandlerMapping (implements org.springframework.web.servlet.HandlerMapping, org.springframework.core.Ordered)
          • org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
            • org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping
              • org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping
            • org.springframework.web.servlet.handler.SimpleUrlHandlerMapping
    • org.springframework.web.servlet.handler.HandlerInterceptorAdapter (implements org.springframework.web.servlet.HandlerInterceptor)
      • org.springframework.web.servlet.handler.ConversionServiceExposingInterceptor
      • org.springframework.web.servlet.handler.UserRoleAuthorizationInterceptor
    • org.springframework.web.servlet.handler.MappedInterceptor
    • org.springframework.web.servlet.handler.SimpleServletHandlerAdapter (implements org.springframework.web.servlet.HandlerAdapter)
    • org.springframework.web.servlet.handler.SimpleServletPostProcessor (implements org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor, org.springframework.web.context.ServletConfigAware, org.springframework.web.context.ServletContextAware)
    • org.springframework.web.servlet.handler.WebRequestHandlerInterceptorAdapter (implements org.springframework.web.servlet.HandlerInterceptor)


AbstractDetectingUrlHandlerMapping

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.handler
Class AbstractDetectingUrlHandlerMapping

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.handler.AbstractHandlerMapping
                extended by  org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
                    extended by  org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping
All Implemented Interfaces:
ApplicationContextAware, Ordered, ServletContextAware, HandlerMapping
Direct Known Subclasses:
AbstractControllerUrlHandlerMapping, BeanNameUrlHandlerMapping, DefaultAnnotationHandlerMapping
public abstract class AbstractDetectingUrlHandlerMapping
extends AbstractUrlHandlerMapping

Abstract implementation of the HandlerMapping interface, detecting URL mappings for handler beans through introspection of all defined beans in the application context.

Since:
2.5
Author:
Juergen Hoeller
See Also:
determineUrlsForHandler(java.lang.String)

Field Summary
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.HandlerMapping
BEST_MATCHING_PATTERN_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTE
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AbstractDetectingUrlHandlerMapping()
Method Summary
protected  void detectHandlers()
Register all handlers found in the current ApplicationContext.
protected abstract  String[] determineUrlsForHandler(String beanName)
Determine the URLs for the given handler bean.
 void initApplicationContext()
Calls the detectHandlers() method in addition to the superclass's initialization.
 void setDetectHandlersInAncestorContexts(boolean detectHandlersInAncestorContexts)
Set whether to detect handler beans in ancestor ApplicationContexts.
Methods inherited from class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
buildPathExposingHandler, exposePathWithinMapping, exposeUriTemplateVariables, getHandlerInternal, getHandlerMap, getPathMatcher, getRootHandler, initInterceptors, lookupHandler, registerHandler, registerHandler, setAlwaysUseFullPath, setLazyInitHandlers, setMappedInterceptors, setPathMatcher, setRootHandler, setUrlDecode, setUrlPathHelper, validateHandler
Methods inherited from class org.springframework.web.servlet.handler.AbstractHandlerMapping
adaptInterceptor, extendInterceptors, getAdaptedInterceptors, getDefaultHandler, getHandler, getHandlerExecutionChain, getOrder, setDefaultHandler, setInterceptors, setOrder
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractDetectingUrlHandlerMapping

public AbstractDetectingUrlHandlerMapping()
Method Detail

setDetectHandlersInAncestorContexts

public void setDetectHandlersInAncestorContexts(boolean detectHandlersInAncestorContexts)
Set whether to detect handler beans in ancestor ApplicationContexts.

Default is "false": Only handler beans in the current ApplicationContext will be detected, i.e. only in the context that this HandlerMapping itself is defined in (typically the current DispatcherServlet's context).

Switch this flag on to detect handler beans in ancestor contexts (typically the Spring root WebApplicationContext) as well.

initApplicationContext

public void initApplicationContext()
                            throws ApplicationContextException
Calls the detectHandlers() method in addition to the superclass's initialization.

Overrides:
initApplicationContext in class AbstractHandlerMapping
Throws:
ApplicationContextException - in case of initialization errors
See Also:
AbstractHandlerMapping.extendInterceptors(java.util.List), AbstractHandlerMapping.initInterceptors()

detectHandlers

protected void detectHandlers()
                       throws BeansException
Register all handlers found in the current ApplicationContext.

The actual URL determination for a handler is up to the concrete determineUrlsForHandler(String) implementation. A bean for which no such URLs could be determined is simply not considered a handler.

Throws:
BeansException - if the handler couldn't be registered
See Also:
determineUrlsForHandler(String)

determineUrlsForHandler

protected abstract String[] determineUrlsForHandler(String beanName)
Determine the URLs for the given handler bean.

Parameters:
beanName - the name of the candidate bean
Returns:
the URLs determined for the bean, or null or an empty array if none
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractHandlerExceptionResolver

org.springframework.web.servlet.handler
Class AbstractHandlerExceptionResolver

java.lang.Object
    extended by  org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
All Implemented Interfaces:
Ordered, HandlerExceptionResolver
Direct Known Subclasses:
AnnotationMethodHandlerExceptionResolver, DefaultHandlerExceptionResolver, ResponseStatusExceptionResolver, SimpleMappingExceptionResolver
public abstract class AbstractHandlerExceptionResolver
extends Object
implements HandlerExceptionResolver, Ordered

Abstract base class for HandlerExceptionResolver implementations.

Provides a set of mapped handlers that the resolver should map to, and the Ordered implementation.

Since:
3.0
Author:
Arjen Poutsma

Field Summary
protected  Log logger
Logger available to subclasses
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AbstractHandlerExceptionResolver()
Method Summary
protected String | buildLogMessage(Exception ex, HttpServletRequest request) Build a log message for the given exception, occured during processing the given request.
protected abstract ModelAndView | doResolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) Actually resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
protected void | logException(Exception ex, HttpServletRequest request) Log the given exception at warn level, provided that warn logging has been activated through the "warnLogCategory" property.
ModelAndView | resolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) Checks whether this resolver is supposed to apply (i.e.
void | setMappedHandlerClasses(Class[] mappedHandlerClasses) Specify the set of classes that this exception resolver should apply to.
void | setMappedHandlers(Set mappedHandlers) Specify the set of handlers that this exception resolver should apply to.
void | setOrder(int order)
void | setWarnLogCategory(String loggerName) Set the log category for warn logging.
protected boolean | shouldApplyTo(HttpServletRequest request, Object handler) Check whether this resolver is supposed to apply to the given handler.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

AbstractHandlerExceptionResolver

public AbstractHandlerExceptionResolver()
Method Detail

setOrder

public void setOrder(int order)

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

setMappedHandlers

public void setMappedHandlers(Set mappedHandlers)
Specify the set of handlers that this exception resolver should apply to. The exception mappings and the default error view will only apply to the specified handlers.

If no handlers and handler classes are set, the exception mappings and the default error view will apply to all handlers. This means that a specified default error view will be used as fallback for all exceptions; any further HandlerExceptionResolvers in the chain will be ignored in this case.

setMappedHandlerClasses

public void setMappedHandlerClasses(Class[] mappedHandlerClasses)
Specify the set of classes that this exception resolver should apply to. The exception mappings and the default error view will only apply to handlers of the specified type; the specified types may be interfaces and superclasses of handlers as well.

If no handlers and handler classes are set, the exception mappings and the default error view will apply to all handlers. This means that a specified default error view will be used as fallback for all exceptions; any further HandlerExceptionResolvers in the chain will be ignored in this case.

setWarnLogCategory

public void setWarnLogCategory(String loggerName)
Set the log category for warn logging. The name will be passed to the underlying logger implementation through Commons Logging, getting interpreted as log category according to the logger's configuration.

Default is no warn logging. Specify this setting to activate warn logging into a specific category. Alternatively, override the logException(java.lang.Exception, javax.servlet.http.HttpServletRequest) method for custom logging.

See Also:
LogFactory.getLog(String),
Logger.getLogger(String),
Logger.getLogger(String)

resolveException

public ModelAndView resolveException(HttpServletRequest request,
                                     HttpServletResponse response,
                                     Object handler,
                                     Exception ex)
Checks whether this resolver is supposed to apply (i.e. the handler matches in case of "mappedHandlers" having been specified), then delegates to the doResolveException(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object, java.lang.Exception) template method.

Specified by:
resolveException in interface HandlerExceptionResolver
Parameters:
request - current HTTP request
response - current HTTP response
handler - the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
ex - the exception that got thrown during handler execution
Returns:
a corresponding ModelAndView to forward to, or null for default processing

shouldApplyTo

protected boolean shouldApplyTo(HttpServletRequest request,
                                Object handler)
Check whether this resolver is supposed to apply to the given handler.

The default implementation checks against the specified mapped handlers and handler classes, if any.

Parameters:
request - current HTTP request
handler - the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
Returns:
whether this resolved should proceed with resolving the exception for the given request and handler
See Also:
setMappedHandlers(java.util.Set), setMappedHandlerClasses(java.lang.Class[])

logException

protected void logException(Exception ex,
                            HttpServletRequest request)
Log the given exception at warn level, provided that warn logging has been activated through the "warnLogCategory" property.

Calls buildLogMessage(java.lang.Exception, javax.servlet.http.HttpServletRequest) in order to determine the concrete message to log. Always passes the full exception to the logger.

Parameters:
ex - the exception that got thrown during handler execution
request - current HTTP request (useful for obtaining metadata)
See Also:
setWarnLogCategory(java.lang.String),
buildLogMessage(java.lang.Exception, javax.servlet.http.HttpServletRequest),
Log.warn(Object, Throwable)

buildLogMessage

protected String buildLogMessage(Exception ex,
                                 HttpServletRequest request)
Build a log message for the given exception, occured during processing the given request.

Parameters:
ex - the exception that got thrown during handler execution
request - current HTTP request (useful for obtaining metadata)
Returns:
the log message to use

doResolveException

protected abstract ModelAndView doResolveException(HttpServletRequest request,
                                                   HttpServletResponse response,
                                                   Object handler,
                                                   Exception ex)
Actually resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.

May be overridden in subclasses, in order to apply specific exception checks. Note that this template method will be invoked after checking whether this resolved applies ("mappedHandlers" etc), so an implementation may simply proceed with its actual exception handling.

Parameters:
request - current HTTP request
response - current HTTP response
handler - the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
ex - the exception that got thrown during handler execution
Returns:
a corresponding ModelAndView to forward to, or null for default processing
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractHandlerMapping

org.springframework.web.servlet.handler
Class AbstractHandlerMapping

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.handler.AbstractHandlerMapping
All Implemented Interfaces:
ApplicationContextAware, Ordered, ServletContextAware, HandlerMapping
Direct Known Subclasses:
AbstractUrlHandlerMapping
public abstract class AbstractHandlerMapping
extends WebApplicationObjectSupport
implements HandlerMapping, Ordered

Abstract base class for HandlerMapping implementations. Supports ordering, a default handler, and handler interceptors.

Note: This base class does not support exposure of the HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE. Support for this attribute is up to concrete subclasses, typically based on request URL mappings.

Since:
07.04.2003
Author:
Juergen Hoeller
See Also:
getHandlerInternal(javax.servlet.http.HttpServletRequest),
setDefaultHandler(java.lang.Object),
setInterceptors(java.lang.Object[]),
HandlerInterceptor

Field Summary
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.HandlerMapping
BEST_MATCHING_PATTERN_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTE
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AbstractHandlerMapping()
Method Summary
protected HandlerInterceptor | adaptInterceptor(Object interceptor) Adapt the given interceptor object to the HandlerInterceptor interface.
protected void | extendInterceptors(List<Object> interceptors) Extension hook that subclasses can override to register additional interceptors, given the configured interceptors (see setInterceptors(java.lang.Object[])).
protected HandlerInterceptor[] | getAdaptedInterceptors() Return the adapted interceptors as HandlerInterceptor array.
Object | getDefaultHandler() Return the default handler for this handler mapping, or null if none.
HandlerExecutionChain | getHandler(HttpServletRequest request) Look up a handler for the given request, falling back to the default handler if no specific one is found.
protected HandlerExecutionChain | getHandlerExecutionChain(Object handler, HttpServletRequest request) Build a HandlerExecutionChain for the given handler, including applicable interceptors.
protected abstract Object | getHandlerInternal(HttpServletRequest request) Look up a handler for the given request, returning null if no specific one is found.
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
protected void | initApplicationContext() Initializes the interceptors.
protected void | initInterceptors() Initialize the specified interceptors, adapting them where necessary.
void | setDefaultHandler(Object defaultHandler) Set the default handler for this handler mapping.
void | setInterceptors(Object[] interceptors) Set the interceptors to apply for all handlers mapped by this handler mapping.
void | setOrder(int order) Specify the order value for this HandlerMapping bean.
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractHandlerMapping

public AbstractHandlerMapping()
Method Detail

setOrder

public final void setOrder(int order)
Specify the order value for this HandlerMapping bean.

Default value is Integer.MAX_VALUE, meaning that it's non-ordered.

See Also:
Ordered.getOrder()

getOrder

public final int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

setDefaultHandler

public void setDefaultHandler(Object defaultHandler)
Set the default handler for this handler mapping. This handler will be returned if no specific mapping was found.

Default is null, indicating no default handler.

getDefaultHandler

public Object getDefaultHandler()
Return the default handler for this handler mapping, or null if none.

setInterceptors

public void setInterceptors(Object[] interceptors)
Set the interceptors to apply for all handlers mapped by this handler mapping.

Supported interceptor types are HandlerInterceptor and WebRequestInterceptor.

Parameters:
interceptors - array of handler interceptors, or null if none
See Also:
adaptInterceptor(java.lang.Object), HandlerInterceptor, WebRequestInterceptor

initApplicationContext

protected void initApplicationContext()
                               throws BeansException
Initializes the interceptors.

Overrides:
initApplicationContext in class ApplicationObjectSupport
Throws:
ApplicationContextException - in case of initialization errors
BeansException - if thrown by ApplicationContext methods
See Also:
extendInterceptors(java.util.List), initInterceptors()

extendInterceptors

protected void extendInterceptors(List<Object> interceptors)
Extension hook that subclasses can override to register additional interceptors, given the configured interceptors (see setInterceptors(java.lang.Object[])).

Will be invoked before initInterceptors() adapts the specified interceptors into HandlerInterceptor instances.

The default implementation is empty.

Parameters:
interceptors - the configured interceptor List (never null), allowing to add further interceptors before as well as after the existing interceptors

initInterceptors

protected void initInterceptors()
Initialize the specified interceptors, adapting them where necessary.

See Also:
setInterceptors(java.lang.Object[]), adaptInterceptor(java.lang.Object)

adaptInterceptor

protected HandlerInterceptor adaptInterceptor(Object interceptor)
Adapt the given interceptor object to the HandlerInterceptor interface.

Supported interceptor types are HandlerInterceptor and WebRequestInterceptor. Each given WebRequestInterceptor will be wrapped in a WebRequestHandlerInterceptorAdapter. Can be overridden in subclasses.

Parameters:
interceptor - the specified interceptor object
Returns:
the interceptor wrapped as HandlerInterceptor
See Also:
HandlerInterceptor, WebRequestInterceptor, WebRequestHandlerInterceptorAdapter

getAdaptedInterceptors

protected final HandlerInterceptor[] getAdaptedInterceptors()
Return the adapted interceptors as HandlerInterceptor array.

Returns:
the array of HandlerInterceptors, or null if none

getHandler

public final HandlerExecutionChain getHandler(HttpServletRequest request)
                                       throws Exception
Look up a handler for the given request, falling back to the default handler if no specific one is found.

Specified by:
getHandler in interface HandlerMapping
Parameters:
request - current HTTP request
Returns:
the corresponding handler instance, or the default handler
Throws:
Exception - if there is an internal error
See Also:
getHandlerInternal(javax.servlet.http.HttpServletRequest)

getHandlerInternal

protected abstract Object getHandlerInternal(HttpServletRequest request)
                                      throws Exception
Look up a handler for the given request, returning null if no specific one is found. This method is called by getHandler(javax.servlet.http.HttpServletRequest); a null return value will lead to the default handler, if one is set.

Note: This method may also return a pre-built HandlerExecutionChain, combining a handler object with dynamically determined interceptors. Statically specified interceptors will get merged into such an existing chain.

Parameters:
request - current HTTP request
Returns:
the corresponding handler instance, or null if none found
Throws:
Exception - if there is an internal error

getHandlerExecutionChain

protected HandlerExecutionChain getHandlerExecutionChain(Object handler,
                                                         HttpServletRequest request)
Build a HandlerExecutionChain for the given handler, including applicable interceptors.

The default implementation simply builds a standard HandlerExecutionChain with the given handler and this handler mapping's common interceptors. Subclasses may override this in order to extend/rearrange the list of interceptors.

NOTE: The passed-in handler object may be a raw handler or a pre-built HandlerExecutionChain. This method should handle those two cases explicitly, either building a new HandlerExecutionChain or extending the existing chain.

For simply adding an interceptor, consider calling super.getHandlerExecutionChain and invoking HandlerExecutionChain.addInterceptor(org.springframework.web.servlet.HandlerInterceptor) on the returned chain object.

Parameters:
handler - the resolved handler instance (never null)
request - current HTTP request
Returns:
the HandlerExecutionChain (never null)
See Also:
getAdaptedInterceptors()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractUrlHandlerMapping

org.springframework.web.servlet.handler
Class AbstractUrlHandlerMapping

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.handler.AbstractHandlerMapping
                extended by  org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
All Implemented Interfaces:
ApplicationContextAware, Ordered, ServletContextAware, HandlerMapping
Direct Known Subclasses:
AbstractDetectingUrlHandlerMapping, SimpleUrlHandlerMapping
public abstract class AbstractUrlHandlerMapping
extends AbstractHandlerMapping

Abstract base class for URL-mapped HandlerMapping implementations. Provides infrastructure for mapping handlers to URLs and configurable URL lookup. For information on the latter, see "alwaysUseFullPath" property.

Supports direct matches, e.g. a registered "/test" matches "/test", and various Ant-style pattern matches, e.g. a registered "/t*" pattern matches both "/test" and "/team", "/test/*" matches all paths in the "/test" directory, "/test/**" matches all paths below "/test". For details, see the AntPathMatcher javadoc.

Will search all path patterns to find the most exact match for the current request path. The most exact match is defined as the longest path pattern that matches the current request path.

Since:
16.04.2003
Author:
Juergen Hoeller, Arjen Poutsma
See Also:
setAlwaysUseFullPath(boolean), setUrlDecode(boolean), AntPathMatcher

Field Summary
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.HandlerMapping
BEST_MATCHING_PATTERN_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTE
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AbstractUrlHandlerMapping()
Method Summary
protected Object | buildPathExposingHandler(Object rawHandler, String bestMatchingPattern, String pathWithinMapping, Map<String,String> uriTemplateVariables) Build a handler object for the given raw handler, exposing the actual handler, the HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, as well as the HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE before executing the handler.
protected void | exposePathWithinMapping(String bestMatchingPattern, String pathWithinMapping, HttpServletRequest request) Expose the path within the current mapping as request attribute.
protected void | exposeUriTemplateVariables(Map<String,String> uriTemplateVariables, HttpServletRequest request) Expose the URI templates variables as request attribute.
protected Object | getHandlerInternal(HttpServletRequest request) Look up a handler for the URL path of the given request.
Map<String,Object> | getHandlerMap() Return the registered handlers as an unmodifiable Map, with the registered path as key and the handler object (or handler bean name in case of a lazy-init handler) as value.
PathMatcher | getPathMatcher() Return the PathMatcher implementation to use for matching URL paths against registered URL patterns.
Object | getRootHandler() Return the root handler for this handler mapping (registered for "/"), or null if none.
protected void | initInterceptors() Initialize the specified interceptors, adapting them where necessary.
protected Object | lookupHandler(String urlPath, HttpServletRequest request) Look up a handler instance for the given URL path.
protected void | registerHandler(String[] urlPaths, String beanName) Register the specified handler for the given URL paths.
protected void | registerHandler(String urlPath, Object handler) Register the specified handler for the given URL path.
void | setAlwaysUseFullPath(boolean alwaysUseFullPath) Set if URL lookup should always use the full path within the current servlet context.
void | setLazyInitHandlers(boolean lazyInitHandlers) Set whether to lazily initialize handlers.
void | setMappedInterceptors(MappedInterceptor[] mappedInterceptors)
void | setPathMatcher(PathMatcher pathMatcher) Set the PathMatcher implementation to use for matching URL paths against registered URL patterns.
void | setRootHandler(Object rootHandler) Set the root handler for this handler mapping, that is, the handler to be registered for the root path ("/").
void | setUrlDecode(boolean urlDecode) Set if context path and request URI should be URL-decoded.
void | setUrlPathHelper(UrlPathHelper urlPathHelper) Set the UrlPathHelper to use for resolution of lookup paths.
protected void | validateHandler(Object handler, HttpServletRequest request) Validate the given handler against the current request.
Methods inherited from class org.springframework.web.servlet.handler.AbstractHandlerMapping
adaptInterceptor, extendInterceptors, getAdaptedInterceptors, getDefaultHandler, getHandler, getHandlerExecutionChain, getOrder, initApplicationContext, setDefaultHandler, setInterceptors, setOrder
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractUrlHandlerMapping

public AbstractUrlHandlerMapping()
Method Detail

setAlwaysUseFullPath

public void setAlwaysUseFullPath(boolean alwaysUseFullPath)
Set if URL lookup should always use the full path within the current servlet context. Else, the path within the current servlet mapping is used if applicable (that is, in the case of a ".../*" servlet mapping in web.xml).

Default is "false".

See Also:
UrlPathHelper.setAlwaysUseFullPath(boolean)

setUrlDecode

public void setUrlDecode(boolean urlDecode)
Set if context path and request URI should be URL-decoded. Both are returned undecoded by the Servlet API, in contrast to the servlet path.

Uses either the request encoding or the default encoding according to the Servlet spec (ISO-8859-1).

See Also:
UrlPathHelper.setUrlDecode(boolean)

setUrlPathHelper

public void setUrlPathHelper(UrlPathHelper urlPathHelper)
Set the UrlPathHelper to use for resolution of lookup paths.

Use this to override the default UrlPathHelper with a custom subclass, or to share common UrlPathHelper settings across multiple HandlerMappings and MethodNameResolvers.

See Also:
AbstractUrlMethodNameResolver.setUrlPathHelper(org.springframework.web.util.UrlPathHelper)

setPathMatcher

public void setPathMatcher(PathMatcher pathMatcher)
Set the PathMatcher implementation to use for matching URL paths against registered URL patterns. Default is AntPathMatcher.

See Also:
AntPathMatcher

getPathMatcher

public PathMatcher getPathMatcher()
Return the PathMatcher implementation to use for matching URL paths against registered URL patterns.

setRootHandler

public void setRootHandler(Object rootHandler)
Set the root handler for this handler mapping, that is, the handler to be registered for the root path ("/").

Default is null, indicating no root handler.

getRootHandler

public Object getRootHandler()
Return the root handler for this handler mapping (registered for "/"), or null if none.

setLazyInitHandlers

public void setLazyInitHandlers(boolean lazyInitHandlers)
Set whether to lazily initialize handlers. Only applicable to singleton handlers, as prototypes are always lazily initialized. Default is "false", as eager initialization allows for more efficiency through referencing the controller objects directly.

If you want to allow your controllers to be lazily initialized, make them "lazy-init" and set this flag to true. Just making them "lazy-init" will not work, as they are initialized through the references from the handler mapping in this case.

setMappedInterceptors

public void setMappedInterceptors(MappedInterceptor[] mappedInterceptors)

initInterceptors

protected void initInterceptors()
Description copied from class: AbstractHandlerMapping
Initialize the specified interceptors, adapting them where necessary.

Overrides:
initInterceptors in class AbstractHandlerMapping
See Also:
AbstractHandlerMapping.setInterceptors(java.lang.Object[]), AbstractHandlerMapping.adaptInterceptor(java.lang.Object)

getHandlerInternal

protected Object getHandlerInternal(HttpServletRequest request)
                             throws Exception
Look up a handler for the URL path of the given request.

Specified by:
getHandlerInternal in class AbstractHandlerMapping
Parameters:
request - current HTTP request
Returns:
the handler instance, or null if none found
Throws:
Exception - if there is an internal error

lookupHandler

protected Object lookupHandler(String urlPath,
                               HttpServletRequest request)
                        throws Exception
Look up a handler instance for the given URL path.

Supports direct matches, e.g. a registered "/test" matches "/test", and various Ant-style pattern matches, e.g. a registered "/t*" matches both "/test" and "/team". For details, see the AntPathMatcher class.

Looks for the most exact pattern, where most exact is defined as the longest path pattern.

Parameters:
urlPath - URL the bean is mapped to
request - current HTTP request (to expose the path within the mapping to)
Returns:
the associated handler instance, or null if not found
Throws:
Exception
See Also:
exposePathWithinMapping(java.lang.String, java.lang.String, javax.servlet.http.HttpServletRequest), AntPathMatcher

validateHandler

protected void validateHandler(Object handler,
                               HttpServletRequest request)
                        throws Exception
Validate the given handler against the current request.

The default implementation is empty. Can be overridden in subclasses, for example to enforce specific preconditions expressed in URL mappings.

Parameters:
handler - the handler object to validate
request - current HTTP request
Throws:
Exception - if validation failed

buildPathExposingHandler

protected Object buildPathExposingHandler(Object rawHandler,
                                          String bestMatchingPattern,
                                          String pathWithinMapping,
                                          Map<String,String> uriTemplateVariables)
Build a handler object for the given raw handler, exposing the actual handler, the HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, as well as the HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE before executing the handler.

The default implementation builds a HandlerExecutionChain with a special interceptor that exposes the path attribute and uri template variables

Parameters:
rawHandler - the raw handler to expose
pathWithinMapping - the path to expose before executing the handler
uriTemplateVariables - the URI template variables, can be null if no variables found
Returns:
the final handler object

exposePathWithinMapping

protected void exposePathWithinMapping(String bestMatchingPattern,
                                       String pathWithinMapping,
                                       HttpServletRequest request)
Expose the path within the current mapping as request attribute.

Parameters:
pathWithinMapping - the path within the current mapping
request - the request to expose the path to
See Also:
HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE

exposeUriTemplateVariables

protected void exposeUriTemplateVariables(Map<String,String> uriTemplateVariables,
                                          HttpServletRequest request)
Expose the URI templates variables as request attribute.

Parameters:
uriTemplateVariables - the URI template variables
request - the request to expose the path to
See Also:
HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE

registerHandler

protected void registerHandler(String[] urlPaths,
                               String beanName)
                        throws BeansException,
                               IllegalStateException
Register the specified handler for the given URL paths.

Parameters:
urlPaths - the URLs that the bean should be mapped to
beanName - the name of the handler bean
Throws:
BeansException - if the handler couldn't be registered
IllegalStateException - if there is a conflicting handler registered

registerHandler

protected void registerHandler(String urlPath,
                               Object handler)
                        throws BeansException,
                               IllegalStateException
Register the specified handler for the given URL path.

Parameters:
urlPath - the URL the bean should be mapped to
handler - the handler instance or handler bean name String (a bean name will automatically be resolved into the corresponding handler bean)
Throws:
BeansException - if the handler couldn't be registered
IllegalStateException - if there is a conflicting handler registered

getHandlerMap

public final Map<String,Object> getHandlerMap()
Return the registered handlers as an unmodifiable Map, with the registered path as key and the handler object (or handler bean name in case of a lazy-init handler) as value.

See Also:
AbstractHandlerMapping.getDefaultHandler()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanNameUrlHandlerMapping

org.springframework.web.servlet.handler
Class BeanNameUrlHandlerMapping

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.handler.AbstractHandlerMapping
                extended by  org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
                    extended by  org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping
                        extended by  org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping
All Implemented Interfaces:
ApplicationContextAware, Ordered, ServletContextAware, HandlerMapping
public class BeanNameUrlHandlerMapping
extends AbstractDetectingUrlHandlerMapping

Implementation of the HandlerMapping interface that map from URLs to beans with names that start with a slash ("/"), similar to how Struts maps URLs to action names.

This is the default implementation used by the DispatcherServlet, along with DefaultAnnotationHandlerMapping (on Java 5 and higher). Alternatively, SimpleUrlHandlerMapping allows for customizing a handler mapping declaratively.

The mapping is from URL to bean name. Thus an incoming URL "/foo" would map to a handler named "/foo", or to "/foo /foo2" in case of multiple mappings to a single handler. Note: In XML definitions, you'll need to use an alias name="/foo" in the bean definition, as the XML id may not contain slashes.

Supports direct matches (given "/test" -> registered "/test") and "*" matches (given "/test" -> registered "/t*"). Note that the default is to map within the current servlet mapping if applicable; see the "alwaysUseFullPath" property for details. For details on the pattern options, see the AntPathMatcher javadoc.

Author:
Rod Johnson, Juergen Hoeller
See Also:
SimpleUrlHandlerMapping

Field Summary
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.HandlerMapping
BEST_MATCHING_PATTERN_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTE
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
BeanNameUrlHandlerMapping()
Method Summary
protected  String[] determineUrlsForHandler(String beanName)
Checks name and aliases of the given bean for URLs, starting with "/".
Methods inherited from class org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping
detectHandlers, initApplicationContext, setDetectHandlersInAncestorContexts
Methods inherited from class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
buildPathExposingHandler, exposePathWithinMapping, exposeUriTemplateVariables, getHandlerInternal, getHandlerMap, getPathMatcher, getRootHandler, initInterceptors, lookupHandler, registerHandler, registerHandler, setAlwaysUseFullPath, setLazyInitHandlers, setMappedInterceptors, setPathMatcher, setRootHandler, setUrlDecode, setUrlPathHelper, validateHandler
Methods inherited from class org.springframework.web.servlet.handler.AbstractHandlerMapping
adaptInterceptor, extendInterceptors, getAdaptedInterceptors, getDefaultHandler, getHandler, getHandlerExecutionChain, getOrder, setDefaultHandler, setInterceptors, setOrder
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BeanNameUrlHandlerMapping

public BeanNameUrlHandlerMapping()
Method Detail

determineUrlsForHandler

protected String[] determineUrlsForHandler(String beanName)
Checks name and aliases of the given bean for URLs, starting with "/".

Specified by:
determineUrlsForHandler in class AbstractDetectingUrlHandlerMapping
Parameters:
beanName - the name of the candidate bean
Returns:
the URLs determined for the bean, or null or an empty array if none
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConversionServiceExposingInterceptor

org.springframework.web.servlet.handler
Class ConversionServiceExposingInterceptor

java.lang.Object
    extended by  org.springframework.web.servlet.handler.HandlerInterceptorAdapter
        extended by  org.springframework.web.servlet.handler.ConversionServiceExposingInterceptor
All Implemented Interfaces:
HandlerInterceptor
public class ConversionServiceExposingInterceptor
extends HandlerInterceptorAdapter

Interceptor that places the configured ConversionService in request scope so it's available during request processing. The request attribute name is "org.springframework.core.convert.ConversionService", the value of ConversionService.class.getName().

Mainly for use within JSP tags such as the spring:eval tag.

Since:
3.0.1
Author:
Keith Donald

Constructor Summary
ConversionServiceExposingInterceptor(ConversionService conversionService)
Creates a new ConversionServiceExposingInterceptor.
Method Summary
 boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
This implementation always returns true.
Methods inherited from class org.springframework.web.servlet.handler.HandlerInterceptorAdapter
afterCompletion, postHandle
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ConversionServiceExposingInterceptor

public ConversionServiceExposingInterceptor(ConversionService conversionService)
Creates a new ConversionServiceExposingInterceptor.

Parameters:
conversionService - the conversion service to export to request scope when this interceptor is invoked
Method Detail

preHandle

public boolean preHandle(HttpServletRequest request,
                         HttpServletResponse response,
                         Object handler)
                  throws ServletException,
                         IOException
Description copied from class: HandlerInterceptorAdapter
This implementation always returns true.

Specified by:
preHandle in interface HandlerInterceptor
Overrides:
preHandle in class HandlerInterceptorAdapter
Parameters:
request - current HTTP request
response - current HTTP response
handler - chosen handler to execute, for type and/or instance evaluation
Returns:
true if the execution chain should proceed with the next interceptor or the handler itself. Else, DispatcherServlet assumes that this interceptor has already dealt with the response itself.
Throws:
ServletException
IOException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DispatcherServletWebRequest

org.springframework.web.servlet.handler
Class DispatcherServletWebRequest

java.lang.Object
    extended by  org.springframework.web.context.request.AbstractRequestAttributes
        extended by  org.springframework.web.context.request.ServletRequestAttributes
            extended by  org.springframework.web.context.request.ServletWebRequest
                extended by  org.springframework.web.servlet.handler.DispatcherServletWebRequest
All Implemented Interfaces:
NativeWebRequest, RequestAttributes, WebRequest
public class DispatcherServletWebRequest
extends ServletWebRequest

ServletWebRequest subclass that is aware of DispatcherServlet's request context, such as the Locale determined by the configured LocaleResolver.

Since:
2.0
Author:
Juergen Hoeller
See Also:
getLocale(), LocaleResolver

Field Summary
Fields inherited from class org.springframework.web.context.request.ServletRequestAttributes
DESTRUCTION_CALLBACK_NAME_PREFIX
Fields inherited from class org.springframework.web.context.request.AbstractRequestAttributes
requestDestructionCallbacks
Fields inherited from interface org.springframework.web.context.request.RequestAttributes
REFERENCE_REQUEST, REFERENCE_SESSION, SCOPE_GLOBAL_SESSION, SCOPE_REQUEST, SCOPE_SESSION
Constructor Summary
DispatcherServletWebRequest(HttpServletRequest request)
Create a new DispatcherServletWebRequest instance for the given request.
DispatcherServletWebRequest(HttpServletRequest request, HttpServletResponse response)
Create a new DispatcherServletWebRequest instance for the given request and response.
Method Summary
 Locale getLocale()
Return the primary Locale for this request.
Methods inherited from class org.springframework.web.context.request.ServletWebRequest
checkNotModified, getContextPath, getDescription, getHeader, getHeaderNames, getHeaderValues, getNativeRequest, getNativeRequest, getNativeResponse, getNativeResponse, getParameter, getParameterMap, getParameterNames, getParameterValues, getRemoteUser, getResponse, getUserPrincipal, isNotModified, isSecure, isUserInRole, toString
Methods inherited from class org.springframework.web.context.request.ServletRequestAttributes
getAttribute, getAttributeNames, getRequest, getSession, getSessionId, getSessionMutex, registerDestructionCallback, registerSessionDestructionCallback, removeAttribute, resolveReference, setAttribute, updateAccessedSessionAttributes
Methods inherited from class org.springframework.web.context.request.AbstractRequestAttributes
isRequestActive, registerRequestDestructionCallback, removeRequestDestructionCallback, requestCompleted
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.web.context.request.RequestAttributes
getAttribute, getAttributeNames, getSessionId, getSessionMutex, registerDestructionCallback, removeAttribute, resolveReference, setAttribute

Constructor Detail

DispatcherServletWebRequest

public DispatcherServletWebRequest(HttpServletRequest request)
Create a new DispatcherServletWebRequest instance for the given request.

Parameters:
request - current HTTP request

DispatcherServletWebRequest

public DispatcherServletWebRequest(HttpServletRequest request,
                                   HttpServletResponse response)
Create a new DispatcherServletWebRequest instance for the given request and response.

Parameters:
request - current HTTP request
request - current HTTP response
Method Detail

getLocale

public Locale getLocale()
Description copied from interface: WebRequest
Return the primary Locale for this request.

Specified by:
getLocale in interface WebRequest
Overrides:
getLocale in class ServletWebRequest
See Also:
ServletRequest.getLocale()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HandlerInterceptorAdapter

org.springframework.web.servlet.handler
Class HandlerInterceptorAdapter

java.lang.Object
    extended by  org.springframework.web.servlet.handler.HandlerInterceptorAdapter
All Implemented Interfaces:
HandlerInterceptor
Direct Known Subclasses:
ConversionServiceExposingInterceptor, LocaleChangeInterceptor, ThemeChangeInterceptor, UserRoleAuthorizationInterceptor
public abstract class HandlerInterceptorAdapter
extends Object
implements HandlerInterceptor

Abstract adapter class for the HandlerInterceptor interface, for simplified implementation of pre-only/post-only interceptors.

Since:
05.12.2003
Author:
Juergen Hoeller

Constructor Summary
HandlerInterceptorAdapter()
Method Summary
void | afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) This implementation is empty.
void | postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) This implementation is empty.
boolean | preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) This implementation always returns true.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

HandlerInterceptorAdapter

public HandlerInterceptorAdapter()
Method Detail

preHandle

public boolean preHandle(HttpServletRequest request,
                         HttpServletResponse response,
                         Object handler)
                  throws Exception
This implementation always returns true.

Specified by:
preHandle in interface HandlerInterceptor
Parameters:
request - current HTTP request
response - current HTTP response
handler - chosen handler to execute, for type and/or instance evaluation
Returns:
true if the execution chain should proceed with the next interceptor or the handler itself. Else, DispatcherServlet assumes that this interceptor has already dealt with the response itself.
Throws:
Exception - in case of errors

postHandle

public void postHandle(HttpServletRequest request,
                       HttpServletResponse response,
                       Object handler,
                       ModelAndView modelAndView)
                throws Exception
This implementation is empty.

Specified by:
postHandle in interface HandlerInterceptor
Parameters:
request - current HTTP request
response - current HTTP response
handler - chosen handler to execute, for type and/or instance examination
modelAndView - the ModelAndView that the handler returned (can also be null)
Throws:
Exception - in case of errors

afterCompletion

public void afterCompletion(HttpServletRequest request,
                            HttpServletResponse response,
                            Object handler,
                            Exception ex)
                     throws Exception
This implementation is empty.

Specified by:
afterCompletion in interface HandlerInterceptor
Parameters:
request - current HTTP request
response - current HTTP response
handler - chosen handler to execute, for type and/or instance examination
ex - exception thrown on handler execution, if any
Throws:
Exception - in case of errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MappedInterceptor

org.springframework.web.servlet.handler
Class MappedInterceptor

java.lang.Object
    extended by  org.springframework.web.servlet.handler.MappedInterceptor

public final class MappedInterceptor
extends Object

Holds information about a HandlerInterceptor mapped to a path into the application.

Since:
3.0
Author:
Keith Donald

Constructor Summary
MappedInterceptor(String[] pathPatterns, HandlerInterceptor interceptor)
Create a new mapped interceptor.
MappedInterceptor(String[] pathPatterns, WebRequestInterceptor interceptor)
Create a new mapped interceptor.
Method Summary
HandlerInterceptor | getInterceptor() The actual Interceptor reference.
String[] | getPathPatterns() The path into the application the interceptor is mapped to.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MappedInterceptor

public MappedInterceptor(String[] pathPatterns,
                         HandlerInterceptor interceptor)
Create a new mapped interceptor.

Parameters:
pathPatterns - the path patterns
interceptor - the interceptor

MappedInterceptor

public MappedInterceptor(String[] pathPatterns,
                         WebRequestInterceptor interceptor)
Create a new mapped interceptor.

Parameters:
pathPatterns - the path patterns
interceptor - the interceptor
Method Detail

getPathPatterns

public String[] getPathPatterns()
The path into the application the interceptor is mapped to.

getInterceptor

public HandlerInterceptor getInterceptor()
The actual Interceptor reference.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleMappingExceptionResolver

org.springframework.web.servlet.handler
Class SimpleMappingExceptionResolver

java.lang.Object
    extended by  org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
        extended by  org.springframework.web.servlet.handler.SimpleMappingExceptionResolver
All Implemented Interfaces:
Ordered, HandlerExceptionResolver
public class SimpleMappingExceptionResolver
extends AbstractHandlerExceptionResolver

HandlerExceptionResolver implementation that allows for mapping exception class names to view names, either for a set of given handlers or for all handlers in the DispatcherServlet.

Error views are analogous to error page JSPs, but can be used with any kind of exception including any checked one, with fine-granular mappings for specific handlers.

Since:
22.11.2003
Author:
Juergen Hoeller, Arjen Poutsma
See Also:
DispatcherServlet

Field Summary
static String DEFAULT_EXCEPTION_ATTRIBUTE
The default name of the exception attribute: "exception".
Fields inherited from class org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
SimpleMappingExceptionResolver()
Method Summary
protected void | applyStatusCodeIfPossible(HttpServletRequest request, HttpServletResponse response, int statusCode) Apply the specified HTTP status code to the given response, if possible (that is, if not executing within an include request).
protected Integer | determineStatusCode(HttpServletRequest request, String viewName) Determine the HTTP status code to apply for the given error view.
protected String | determineViewName(Exception ex, HttpServletRequest request) Determine the view name for the given exception, searching the "exceptionMappings", using the "defaultErrorView" as fallback.
protected ModelAndView | doResolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) Actually resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.
protected String | findMatchingViewName(Properties exceptionMappings, Exception ex) Find a matching view name in the given exception mappings.
protected int | getDepth(String exceptionMapping, Exception ex) Return the depth to the superclass matching.
protected ModelAndView | getModelAndView(String viewName, Exception ex) Return a ModelAndView for the given view name and exception.
protected ModelAndView | getModelAndView(String viewName, Exception ex, HttpServletRequest request) Return a ModelAndView for the given request, view name and exception.
void | setDefaultErrorView(String defaultErrorView) Set the name of the default error view.
void | setDefaultStatusCode(int defaultStatusCode) Set the default HTTP status code that this exception resolver will apply if it resolves an error view and if there is no status code mapping defined.
void | setExceptionAttribute(String exceptionAttribute) Set the name of the model attribute as which the exception should be exposed.
void | setExceptionMappings(Properties mappings) Set the mappings between exception class names and error view names.
void | setStatusCodes(Properties statusCodes) Set the HTTP status code that this exception resolver will apply for a given resolved error view.
Methods inherited from class org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
buildLogMessage, getOrder, logException, resolveException, setMappedHandlerClasses, setMappedHandlers, setOrder, setWarnLogCategory, shouldApplyTo
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_EXCEPTION_ATTRIBUTE

public static final String DEFAULT_EXCEPTION_ATTRIBUTE
The default name of the exception attribute: "exception".

See Also:
Constant Field Values
Constructor Detail

SimpleMappingExceptionResolver

public SimpleMappingExceptionResolver()
Method Detail

setExceptionMappings

public void setExceptionMappings(Properties mappings)
Set the mappings between exception class names and error view names. The exception class name can be a substring, with no wildcard support at present. A value of "ServletException" would match javax.servlet.ServletException and subclasses, for example.

NB: Consider carefully how specific the pattern is, and whether to include package information (which isn't mandatory). For example, "Exception" will match nearly anything, and will probably hide other rules. "java.lang.Exception" would be correct if "Exception" was meant to define a rule for all checked exceptions. With more unusual exception names such as "BaseBusinessException" there's no need to use a FQN.

Parameters:
mappings - exception patterns (can also be fully qualified class names) as keys, and error view names as values

setDefaultErrorView

public void setDefaultErrorView(String defaultErrorView)
Set the name of the default error view. This view will be returned if no specific mapping was found.

Default is none.

setStatusCodes

public void setStatusCodes(Properties statusCodes)
Set the HTTP status code that this exception resolver will apply for a given resolved error view. Keys are view names; values are status codes.

Note that this error code will only get applied in case of a top-level request. It will not be set for an include request, since the HTTP status cannot be modified from within an include.

If not specified, the default status code will be applied.

See Also:
setDefaultStatusCode(int)

setDefaultStatusCode

public void setDefaultStatusCode(int defaultStatusCode)
Set the default HTTP status code that this exception resolver will apply if it resolves an error view and if there is no status code mapping defined.

Note that this error code will only get applied in case of a top-level request. It will not be set for an include request, since the HTTP status cannot be modified from within an include.

If not specified, no status code will be applied, either leaving this to the controller or view, or keeping the servlet engine's default of 200 (OK).

Parameters:
defaultStatusCode - HTTP status code value, for example 500 (HttpServletResponse.SC_INTERNAL_SERVER_ERROR) or 404 (HttpServletResponse.SC_NOT_FOUND)
See Also:
setStatusCodes(Properties)

setExceptionAttribute

public void setExceptionAttribute(String exceptionAttribute)
Set the name of the model attribute as which the exception should be exposed. Default is "exception".

This can be either set to a different attribute name or to null for not exposing an exception attribute at all.

See Also:
DEFAULT_EXCEPTION_ATTRIBUTE

doResolveException

protected ModelAndView doResolveException(HttpServletRequest request,
                                          HttpServletResponse response,
                                          Object handler,
                                          Exception ex)
Actually resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.

May be overridden in subclasses, in order to apply specific exception checks. Note that this template method will be invoked after checking whether this resolved applies ("mappedHandlers" etc), so an implementation may simply proceed with its actual exception handling.

Specified by:
doResolveException in class AbstractHandlerExceptionResolver
Parameters:
request - current HTTP request
response - current HTTP response
handler - the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
ex - the exception that got thrown during handler execution
Returns:
a corresponding ModelAndView to forward to, or null for default processing

determineViewName

protected String determineViewName(Exception ex,
                                   HttpServletRequest request)
Determine the view name for the given exception, searching the "exceptionMappings", using the "defaultErrorView" as fallback.

Parameters:
ex - the exception that got thrown during handler execution
request - current HTTP request (useful for obtaining metadata)
Returns:
the resolved view name, or null if none found

findMatchingViewName

protected String findMatchingViewName(Properties exceptionMappings,
                                      Exception ex)
Find a matching view name in the given exception mappings.

Parameters:
exceptionMappings - mappings between exception class names and error view names
ex - the exception that got thrown during handler execution
Returns:
the view name, or null if none found
See Also:
setExceptionMappings(java.util.Properties)

getDepth

protected int getDepth(String exceptionMapping,
                       Exception ex)
Return the depth to the superclass matching.

0 means ex matches exactly. Returns -1 if there's no match. Otherwise, returns depth. Lowest depth wins.

determineStatusCode

protected Integer determineStatusCode(HttpServletRequest request,
                                      String viewName)
Determine the HTTP status code to apply for the given error view.

The default implementation returns the status code for the given view name (specified through the statusCodes property), or falls back to the defaultStatusCode if there is no match.

Override this in a custom subclass to customize this behavior.

Parameters:
request - current HTTP request
viewName - the name of the error view
Returns:
the HTTP status code to use, or null for the servlet container's default (200 in case of a standard error view)
See Also:
setDefaultStatusCode(int), applyStatusCodeIfPossible(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, int)

applyStatusCodeIfPossible

protected void applyStatusCodeIfPossible(HttpServletRequest request,
                                         HttpServletResponse response,
                                         int statusCode)
Apply the specified HTTP status code to the given response, if possible (that is, if not executing within an include request).

Parameters:
request - current HTTP request
response - current HTTP response
statusCode - the status code to apply
See Also:
determineStatusCode(javax.servlet.http.HttpServletRequest, java.lang.String), setDefaultStatusCode(int), HttpServletResponse.setStatus(int)

getModelAndView

protected ModelAndView getModelAndView(String viewName,
                                       Exception ex,
                                       HttpServletRequest request)
Return a ModelAndView for the given request, view name and exception.

The default implementation delegates to getModelAndView(String, Exception).

Parameters:
viewName - the name of the error view
ex - the exception that got thrown during handler execution
request - current HTTP request (useful for obtaining metadata)
Returns:
the ModelAndView instance

getModelAndView

protected ModelAndView getModelAndView(String viewName,
                                       Exception ex)
Return a ModelAndView for the given view name and exception.

The default implementation adds the specified exception attribute. Can be overridden in subclasses.

Parameters:
viewName - the name of the error view
ex - the exception that got thrown during handler execution
Returns:
the ModelAndView instance
See Also:
setExceptionAttribute(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleServletHandlerAdapter

org.springframework.web.servlet.handler
Class SimpleServletHandlerAdapter

java.lang.Object
    extended by  org.springframework.web.servlet.handler.SimpleServletHandlerAdapter
All Implemented Interfaces:
HandlerAdapter
public class SimpleServletHandlerAdapter
extends Object
implements HandlerAdapter

Adapter to use the Servlet interface with the generic DispatcherServlet. Calls the Servlet's service method to handle a request.

Last-modified checking is not explicitly supported: This is typically handled by the Servlet implementation itself (usually deriving from the HttpServlet base class).

This adapter is not activated by default; it needs to be defined as a bean in the DispatcherServlet context. It will automatically apply to mapped handler beans that implement the Servlet interface then.

Note that Servlet instances defined as bean will not receive initialization and destruction callbacks, unless a special post-processor such as SimpleServletPostProcessor is defined in the DispatcherServlet context.

Alternatively, consider wrapping a Servlet with Spring's ServletWrappingController. This is particularly appropriate for existing Servlet classes, allowing to specify Servlet initialization parameters etc.

Since:
1.1.5
Author:
Juergen Hoeller
See Also:
Servlet, HttpServlet, SimpleServletPostProcessor, ServletWrappingController

Constructor Summary
SimpleServletHandlerAdapter()
Method Summary
long | getLastModified(HttpServletRequest request, Object handler) Same contract as for HttpServlet's getLastModified method.
ModelAndView | handle(HttpServletRequest request, HttpServletResponse response, Object handler) Use the given handler to handle this request.
boolean | supports(Object handler) Given a handler instance, return whether or not this HandlerAdapter can support it.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleServletHandlerAdapter

public SimpleServletHandlerAdapter()
Method Detail

supports

public boolean supports(Object handler)
Description copied from interface: HandlerAdapter
Given a handler instance, return whether or not this HandlerAdapter can support it. Typical HandlerAdapters will base the decision on the handler type. HandlerAdapters will usually only support one handler type each.

A typical implementation:

return (handler instanceof MyHandler);

Specified by:
supports in interface HandlerAdapter
Parameters:
handler - handler object to check
Returns:
whether or not this object can use the given handler

handle

public ModelAndView handle(HttpServletRequest request,
                           HttpServletResponse response,
                           Object handler)
                    throws Exception
Description copied from interface: HandlerAdapter
Use the given handler to handle this request. The workflow that is required may vary widely.

Specified by:
handle in interface HandlerAdapter
Parameters:
request - current HTTP request
response - current HTTP response
handler - handler to use. This object must have previously been passed to the supports method of this interface, which must have returned true.
Returns:
ModelAndView object with the name of the view and the required model data, or null if the request has been handled directly
Throws:
Exception - in case of errors

getLastModified

public long getLastModified(HttpServletRequest request,
                            Object handler)
Description copied from interface: HandlerAdapter
Same contract as for HttpServlet's getLastModified method. Can simply return -1 if there's no support in the handler class.

Specified by:
getLastModified in interface HandlerAdapter
Parameters:
request - current HTTP request
handler - handler to use
Returns:
the lastModified value for the given handler
See Also:
HttpServlet.getLastModified(javax.servlet.http.HttpServletRequest), LastModified.getLastModified(javax.servlet.http.HttpServletRequest)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleServletPostProcessor

org.springframework.web.servlet.handler
Class SimpleServletPostProcessor

java.lang.Object
    extended by  org.springframework.web.servlet.handler.SimpleServletPostProcessor
All Implemented Interfaces:
BeanPostProcessor, DestructionAwareBeanPostProcessor, ServletConfigAware, ServletContextAware
public class SimpleServletPostProcessor
extends Object
implements DestructionAwareBeanPostProcessor, ServletContextAware, ServletConfigAware

BeanPostProcessor that applies initialization and destruction callbacks to beans that implement the Servlet interface.

After initialization of the bean instance, the Servlet init method will be called with a ServletConfig that contains the bean name of the Servlet and the ServletContext that it is running in.

Before destruction of the bean instance, the Servlet destroy will be called.

Note that this post-processor does not support Servlet initialization parameters. Bean instances that implement the Servlet interface are supposed to be configured like any other Spring bean, that is, through constructor arguments or bean properties.

For reuse of a Servlet implementation in a plain Servlet container and as a bean in a Spring context, consider deriving from Spring's HttpServletBean base class that applies Servlet initialization parameters as bean properties, supporting both the standard Servlet and the Spring bean initialization style.

Alternatively, consider wrapping a Servlet with Spring's ServletWrappingController. This is particularly appropriate for existing Servlet classes, allowing to specify Servlet initialization parameters etc.

Since:
1.1.5
Author:
Juergen Hoeller
See Also:
Servlet.init(javax.servlet.ServletConfig), Servlet.destroy(), SimpleServletHandlerAdapter

Constructor Summary
SimpleServletPostProcessor()
Method Summary
Object | postProcessAfterInitialization(Object bean, String beanName) Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).
void | postProcessBeforeDestruction(Object bean, String beanName) Apply this BeanPostProcessor to the given bean instance before its destruction.
Object | postProcessBeforeInitialization(Object bean, String beanName) Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).
void | setServletConfig(ServletConfig servletConfig) Set the ServletConfig that this object runs in.
void | setServletContext(ServletContext servletContext) Set the ServletContext that this object runs in.
void | setUseSharedServletConfig(boolean useSharedServletConfig) Set whether to use the shared ServletConfig object passed in through setServletConfig, if available.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleServletPostProcessor

public SimpleServletPostProcessor()
Method Detail

setUseSharedServletConfig

public void setUseSharedServletConfig(boolean useSharedServletConfig)
Set whether to use the shared ServletConfig object passed in through setServletConfig, if available.

Default is "true". Turn this setting to "false" to pass in a mock ServletConfig object with the bean name as servlet name, holding the current ServletContext.

See Also:
setServletConfig(javax.servlet.ServletConfig)

setServletContext

public void setServletContext(ServletContext servletContext)
Description copied from interface: ServletContextAware
Set the ServletContext that this object runs in.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked after ApplicationContextAware's setApplicationContext.

Specified by:
setServletContext in interface ServletContextAware
Parameters:
servletContext - ServletContext object to be used by this object
See Also:
InitializingBean.afterPropertiesSet(), ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)

setServletConfig

public void setServletConfig(ServletConfig servletConfig)
Description copied from interface: ServletConfigAware
Set the ServletConfig that this object runs in.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked after ApplicationContextAware's setApplicationContext.

Specified by:
setServletConfig in interface ServletConfigAware
Parameters:
servletConfig - ServletConfig object to be used by this object
See Also:
InitializingBean.afterPropertiesSet(), ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)

postProcessBeforeInitialization

public Object postProcessBeforeInitialization(Object bean,
                                              String beanName)
                                       throws BeansException
Description copied from interface: BeanPostProcessor
Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

Specified by:
postProcessBeforeInitialization in interface BeanPostProcessor
Parameters:
bean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
Throws:
BeansException - in case of errors
See Also:
InitializingBean.afterPropertiesSet()

postProcessAfterInitialization

public Object postProcessAfterInitialization(Object bean,
                                             String beanName)
                                      throws BeansException
Description copied from interface: BeanPostProcessor
Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

In case of a FactoryBean, this callback will be invoked for both the FactoryBean instance and the objects created by the FactoryBean (as of Spring 2.0). The post-processor can decide whether to apply to either the FactoryBean or created objects or both through corresponding bean instanceof FactoryBean checks.

This callback will also be invoked after a short-circuiting triggered by a InstantiationAwareBeanPostProcessor.postProcessBeforeInstantiation(java.lang.Class, java.lang.String) method, in contrast to all other BeanPostProcessor callbacks.

Specified by:
postProcessAfterInitialization in interface BeanPostProcessor
Parameters:
bean - the new bean instance
beanName - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
Throws:
BeansException - in case of errors
See Also:
InitializingBean.afterPropertiesSet(), FactoryBean

postProcessBeforeDestruction

public void postProcessBeforeDestruction(Object bean,
                                         String beanName)
                                  throws BeansException
Description copied from interface: DestructionAwareBeanPostProcessor
Apply this BeanPostProcessor to the given bean instance before its destruction. Can invoke custom destruction callbacks.

Like DisposableBean's destroy and a custom destroy method, this callback just applies to singleton beans in the factory (including inner beans).

Specified by:
postProcessBeforeDestruction in interface DestructionAwareBeanPostProcessor
Parameters:
bean - the bean instance to be destroyed
beanName - the name of the bean
Throws:
BeansException - in case of errors
See Also:
DisposableBean, AbstractBeanDefinition.setDestroyMethodName(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleUrlHandlerMapping

org.springframework.web.servlet.handler
Class SimpleUrlHandlerMapping

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.handler.AbstractHandlerMapping
                extended by  org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
                    extended by  org.springframework.web.servlet.handler.SimpleUrlHandlerMapping
All Implemented Interfaces:
ApplicationContextAware, Ordered, ServletContextAware, HandlerMapping
public class SimpleUrlHandlerMapping
extends AbstractUrlHandlerMapping

Implementation of the HandlerMapping interface to map from URLs to request handler beans. Supports both mapping to bean instances and mapping to bean names; the latter is required for non-singleton handlers.

The "urlMap" property is suitable for populating the handler map with bean references, e.g. via the map element in XML bean definitions.

Mappings to bean names can be set via the "mappings" property, in a form accepted by the java.util.Properties class, like as follows:
/welcome.html=ticketController /show.html=ticketController
The syntax is PATH=HANDLER_BEAN_NAME. If the path doesn't begin with a slash, one is prepended.

Supports direct matches (given "/test" -> registered "/test") and "*" matches (given "/test" -> registered "/t*"). Note that the default is to map within the current servlet mapping if applicable; see the "alwaysUseFullPath" property for details. For details on the pattern options, see the AntPathMatcher javadoc.

Author:
Rod Johnson, Juergen Hoeller
See Also:
setMappings(java.util.Properties), setUrlMap(java.util.Map), BeanNameUrlHandlerMapping

Field Summary
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.HandlerMapping
BEST_MATCHING_PATTERN_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTE
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
SimpleUrlHandlerMapping()
Method Summary
 Map<String,?> getUrlMap()
Allow Map access to the URL path mappings, with the option to add or override specific entries.
 void initApplicationContext()
Calls the registerHandlers(java.util.Map) method in addition to the superclass's initialization.
protected  void registerHandlers(Map<String,Object> urlMap)
Register all handlers specified in the URL map for the corresponding paths.
 void setMappings(Properties mappings)
Map URL paths to handler bean names.
 void setUrlMap(Map<String,?> urlMap)
Set a Map with URL paths as keys and handler beans (or handler bean names) as values.
Methods inherited from class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
buildPathExposingHandler, exposePathWithinMapping, exposeUriTemplateVariables, getHandlerInternal, getHandlerMap, getPathMatcher, getRootHandler, initInterceptors, lookupHandler, registerHandler, registerHandler, setAlwaysUseFullPath, setLazyInitHandlers, setMappedInterceptors, setPathMatcher, setRootHandler, setUrlDecode, setUrlPathHelper, validateHandler
Methods inherited from class org.springframework.web.servlet.handler.AbstractHandlerMapping
adaptInterceptor, extendInterceptors, getAdaptedInterceptors, getDefaultHandler, getHandler, getHandlerExecutionChain, getOrder, setDefaultHandler, setInterceptors, setOrder
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleUrlHandlerMapping

public SimpleUrlHandlerMapping()
Method Detail

setMappings

public void setMappings(Properties mappings)
Map URL paths to handler bean names. This is the typical way of configuring this HandlerMapping.

Supports direct URL matches and Ant-style pattern matches. For syntax details, see the AntPathMatcher javadoc.

Parameters:
mappings - properties with URLs as keys and bean names as values
See Also:
setUrlMap(java.util.Map)

setUrlMap

public void setUrlMap(Map<String,?> urlMap)
Set a Map with URL paths as keys and handler beans (or handler bean names) as values. Convenient for population with bean references.

Supports direct URL matches and Ant-style pattern matches. For syntax details, see the AntPathMatcher javadoc.

Parameters:
urlMap - map with URLs as keys and beans as values
See Also:
setMappings(java.util.Properties)

getUrlMap

public Map<String,?> getUrlMap()
Allow Map access to the URL path mappings, with the option to add or override specific entries.

Useful for specifying entries directly, for example via "urlMap[myKey]". This is particularly useful for adding or overriding entries in child bean definitions.

initApplicationContext

public void initApplicationContext()
                            throws BeansException
Calls the registerHandlers(java.util.Map) method in addition to the superclass's initialization.

Overrides:
initApplicationContext in class AbstractHandlerMapping
Throws:
ApplicationContextException - in case of initialization errors
BeansException - if thrown by ApplicationContext methods
See Also:
AbstractHandlerMapping.extendInterceptors(java.util.List), AbstractHandlerMapping.initInterceptors()

registerHandlers

protected void registerHandlers(Map<String,Object> urlMap)
                         throws BeansException
Register all handlers specified in the URL map for the corresponding paths.

Parameters:
urlMap - Map with URL paths as keys and handler beans or bean names as values
Throws:
BeansException - if a handler couldn't be registered
IllegalStateException - if there is a conflicting handler registered
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UserRoleAuthorizationInterceptor

org.springframework.web.servlet.handler
Class UserRoleAuthorizationInterceptor

java.lang.Object
    extended by  org.springframework.web.servlet.handler.HandlerInterceptorAdapter
        extended by  org.springframework.web.servlet.handler.UserRoleAuthorizationInterceptor
All Implemented Interfaces:
HandlerInterceptor
public class UserRoleAuthorizationInterceptor
extends HandlerInterceptorAdapter

Interceptor that checks the authorization of the current user via the user's roles, as evaluated by HttpServletRequest's isUserInRole method.

Since:
20.06.2003
Author:
Juergen Hoeller
See Also:
HttpServletRequest.isUserInRole(java.lang.String)

Constructor Summary
UserRoleAuthorizationInterceptor()
Method Summary
protected void | handleNotAuthorized(HttpServletRequest request, HttpServletResponse response, Object handler) Handle a request that is not authorized according to this interceptor.
boolean | preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) This implementation always returns true.
void | setAuthorizedRoles(String[] authorizedRoles) Set the roles that this interceptor should treat as authorized.
Methods inherited from class org.springframework.web.servlet.handler.HandlerInterceptorAdapter
afterCompletion, postHandle
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

UserRoleAuthorizationInterceptor

public UserRoleAuthorizationInterceptor()
Method Detail

setAuthorizedRoles

public final void setAuthorizedRoles(String[] authorizedRoles)
Set the roles that this interceptor should treat as authorized.

Parameters:
authorizedRoles - array of role names

preHandle

public final boolean preHandle(HttpServletRequest request,
                               HttpServletResponse response,
                               Object handler)
                        throws ServletException,
                               IOException
Description copied from class: HandlerInterceptorAdapter
This implementation always returns true.

Specified by:
preHandle in interface HandlerInterceptor
Overrides:
preHandle in class HandlerInterceptorAdapter
Parameters:
request - current HTTP request
response - current HTTP response
handler - chosen handler to execute, for type and/or instance evaluation
Returns:
true if the execution chain should proceed with the next interceptor or the handler itself. Else, DispatcherServlet assumes that this interceptor has already dealt with the response itself.
Throws:
ServletException
IOException

handleNotAuthorized

protected void handleNotAuthorized(HttpServletRequest request,
                                   HttpServletResponse response,
                                   Object handler)
                            throws ServletException,
                                   IOException
Handle a request that is not authorized according to this interceptor. Default implementation sends HTTP status code 403 ("forbidden").

This method can be overridden to write a custom message, forward or redirect to some error page or login page, or throw a ServletException.

Parameters:
request - current HTTP request
response - current HTTP response
handler - chosen handler to execute, for type and/or instance evaluation
Throws:
ServletException - if there is an internal error
IOException - in case of an I/O error when writing the response
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WebRequestHandlerInterceptorAdapter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.handler
Class WebRequestHandlerInterceptorAdapter

java.lang.Object
    extended by  org.springframework.web.servlet.handler.WebRequestHandlerInterceptorAdapter
All Implemented Interfaces:
HandlerInterceptor
public class WebRequestHandlerInterceptorAdapter
extends Object
implements HandlerInterceptor

Adapter that implements the Servlet HandlerInterceptor interface and wraps an underlying WebRequestInterceptor.

Since:
2.0
Author:
Juergen Hoeller
See Also:
WebRequestInterceptor, HandlerInterceptor

Constructor Summary
WebRequestHandlerInterceptorAdapter(WebRequestInterceptor requestInterceptor)
Create a new WebRequestHandlerInterceptorAdapter for the given WebRequestInterceptor.
Method Summary
void | afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) Callback after completion of request processing, that is, after rendering the view.
void | postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) Intercept the execution of a handler.
boolean | preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) Intercept the execution of a handler.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

WebRequestHandlerInterceptorAdapter

public WebRequestHandlerInterceptorAdapter(WebRequestInterceptor requestInterceptor)
Create a new WebRequestHandlerInterceptorAdapter for the given WebRequestInterceptor.

Parameters:
requestInterceptor - the WebRequestInterceptor to wrap
Method Detail

preHandle

public boolean preHandle(HttpServletRequest request,
                         HttpServletResponse response,
                         Object handler)
                  throws Exception
Description copied from interface: HandlerInterceptor
Intercept the execution of a handler. Called after HandlerMapping determined an appropriate handler object, but before HandlerAdapter invokes the handler.

DispatcherServlet processes a handler in an execution chain, consisting of any number of interceptors, with the handler itself at the end. With this method, each interceptor can decide to abort the execution chain, typically sending a HTTP error or writing a custom response.

Specified by:
preHandle in interface HandlerInterceptor
Parameters:
request - current HTTP request
response - current HTTP response
handler - chosen handler to execute, for type and/or instance evaluation
Returns:
true if the execution chain should proceed with the next interceptor or the handler itself. Else, DispatcherServlet assumes that this interceptor has already dealt with the response itself.
Throws:
Exception - in case of errors

postHandle

public void postHandle(HttpServletRequest request,
                       HttpServletResponse response,
                       Object handler,
                       ModelAndView modelAndView)
                throws Exception
Description copied from interface: HandlerInterceptor
Intercept the execution of a handler. Called after HandlerAdapter actually invoked the handler, but before the DispatcherServlet renders the view. Can expose additional model objects to the view via the given ModelAndView.

DispatcherServlet processes a handler in an execution chain, consisting of any number of interceptors, with the handler itself at the end. With this method, each interceptor can post-process an execution, getting applied in inverse order of the execution chain.

Specified by:
postHandle in interface HandlerInterceptor
Parameters:
request - current HTTP request
response - current HTTP response
handler - chosen handler to execute, for type and/or instance examination
modelAndView - the ModelAndView that the handler returned (can also be null)
Throws:
Exception - in case of errors

afterCompletion

public void afterCompletion(HttpServletRequest request,
                            HttpServletResponse response,
                            Object handler,
                            Exception ex)
                     throws Exception
Description copied from interface: HandlerInterceptor
Callback after completion of request processing, that is, after rendering the view. Will be called on any outcome of handler execution, thus allows for proper resource cleanup.

Note: Will only be called if this interceptor's preHandle method has successfully completed and returned true!

As with the postHandle method, the method will be invoked on each interceptor in the chain in reverse order, so the first interceptor will be the last to be invoked.

Specified by:
afterCompletion in interface HandlerInterceptor
Parameters:
request - current HTTP request
response - current HTTP response
handler - chosen handler to execute, for type and/or instance examination
ex - exception thrown on handler execution, if any
Throws:
Exception - in case of errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.servlet.i18n

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.servlet.i18n

Locale support classes for Spring's web MVC framework.

See:
Description

Class Summary
AbstractLocaleResolver | Abstract base class for LocaleResolver implementations.
AcceptHeaderLocaleResolver | Implementation of LocaleResolver that simply uses the primary locale specified in the "accept-language" header of the HTTP request (that is, the locale sent by the client browser, normally that of the client's OS).
CookieLocaleResolver | LocaleResolver implementation that uses a cookie sent back to the user in case of a custom setting, with a fallback to the specified default locale or the request's accept-header locale.
FixedLocaleResolver | LocaleResolver implementation that always returns a fixed default locale.
LocaleChangeInterceptor | Interceptor that allows for changing the current locale on every request, via a configurable request parameter.
SessionLocaleResolver | Implementation of LocaleResolver that uses a locale attribute in the user's session in case of a custom setting, with a fallback to the specified default locale or the request's accept-header locale.

Package org.springframework.web.servlet.i18n Description

Locale support classes for Spring's web MVC framework. Provides standard LocaleResolver implementations, and a HandlerInterceptor for locale changes.


org.springframework.web.servlet.i18n Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.servlet.i18n

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.web.servlet.i18n.AbstractLocaleResolver (implements org.springframework.web.servlet.LocaleResolver)
      • org.springframework.web.servlet.i18n.FixedLocaleResolver
      • org.springframework.web.servlet.i18n.SessionLocaleResolver
    • org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver (implements org.springframework.web.servlet.LocaleResolver)
    • org.springframework.web.util.CookieGenerator
      • org.springframework.web.servlet.i18n.CookieLocaleResolver (implements org.springframework.web.servlet.LocaleResolver)
    • org.springframework.web.servlet.handler.HandlerInterceptorAdapter (implements org.springframework.web.servlet.HandlerInterceptor)
      • org.springframework.web.servlet.i18n.LocaleChangeInterceptor


AbstractLocaleResolver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.i18n
Class AbstractLocaleResolver

java.lang.Object
    extended by  org.springframework.web.servlet.i18n.AbstractLocaleResolver
All Implemented Interfaces:
LocaleResolver
Direct Known Subclasses:
FixedLocaleResolver, SessionLocaleResolver
public abstract class AbstractLocaleResolver
extends Object
implements LocaleResolver

Abstract base class for LocaleResolver implementations. Provides support for a default locale.

Since:
1.2.9
Author:
Juergen Hoeller

Constructor Summary
AbstractLocaleResolver()
Method Summary
protected Locale | getDefaultLocale() Return the default Locale that this resolver is supposed to fall back to, if any.
void | setDefaultLocale(Locale defaultLocale) Set a default Locale that this resolver will return if no other locale found.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.web.servlet.LocaleResolver
resolveLocale, setLocale

Constructor Detail

AbstractLocaleResolver

public AbstractLocaleResolver()
Method Detail

setDefaultLocale

public void setDefaultLocale(Locale defaultLocale)
Set a default Locale that this resolver will return if no other locale found.

getDefaultLocale

protected Locale getDefaultLocale()
Return the default Locale that this resolver is supposed to fall back to, if any.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AcceptHeaderLocaleResolver

org.springframework.web.servlet.i18n
Class AcceptHeaderLocaleResolver

java.lang.Object
    extended by  org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver
All Implemented Interfaces:
LocaleResolver
public class AcceptHeaderLocaleResolver
extends Object
implements LocaleResolver

Implementation of LocaleResolver that simply uses the primary locale specified in the "accept-language" header of the HTTP request (that is, the locale sent by the client browser, normally that of the client's OS).

Note: Does not support setLocale, since the accept header can only be changed through changing the client's locale settings.

Since:
27.02.2003
Author:
Juergen Hoeller
See Also:
ServletRequest.getLocale()

Constructor Summary
AcceptHeaderLocaleResolver()
Method Summary
Locale | resolveLocale(HttpServletRequest request) Resolve the current locale via the given request.
void | setLocale(HttpServletRequest request, HttpServletResponse response, Locale locale) Set the current locale to the given one.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AcceptHeaderLocaleResolver

public AcceptHeaderLocaleResolver()
Method Detail

resolveLocale

public Locale resolveLocale(HttpServletRequest request)
Description copied from interface: LocaleResolver
Resolve the current locale via the given request. Should return a default locale as fallback in any case.

Specified by:
resolveLocale in interface LocaleResolver
Parameters:
request - the request to resolve the locale for
Returns:
the current locale (never null)

setLocale

public void setLocale(HttpServletRequest request,
                      HttpServletResponse response,
                      Locale locale)
Description copied from interface: LocaleResolver
Set the current locale to the given one.

Specified by:
setLocale in interface LocaleResolver
Parameters:
request - the request to be used for locale modification
response - the response to be used for locale modification
locale - the new locale, or null to clear the locale
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CookieLocaleResolver

org.springframework.web.servlet.i18n
Class CookieLocaleResolver

java.lang.Object
    extended by  org.springframework.web.util.CookieGenerator
        extended by  org.springframework.web.servlet.i18n.CookieLocaleResolver
All Implemented Interfaces:
LocaleResolver
public class CookieLocaleResolver
extends CookieGenerator
implements LocaleResolver

LocaleResolver implementation that uses a cookie sent back to the user in case of a custom setting, with a fallback to the specified default locale or the request's accept-header locale.

This is particularly useful for stateless applications without user sessions.

Custom controllers can thus override the user's locale by calling setLocale(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.util.Locale), for example responding to a certain locale change request.

Since:
27.02.2003
Author:
Juergen Hoeller, Jean-Pierre Pawlak
See Also:
setDefaultLocale(java.util.Locale), setLocale(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.util.Locale)

Field Summary
static String | DEFAULT_COOKIE_NAME The default cookie name used if none is explicitly set.
static String | LOCALE_REQUEST_ATTRIBUTE_NAME The name of the request attribute that holds the locale.
Fields inherited from class org.springframework.web.util.CookieGenerator
DEFAULT_COOKIE_MAX_AGE, DEFAULT_COOKIE_PATH, logger
Constructor Summary
CookieLocaleResolver()
Creates a new instance of the CookieLocaleResolver class using the default cookie name.
Method Summary
protected Locale | determineDefaultLocale(HttpServletRequest request) Determine the default locale for the given request, Called if no locale cookie has been found.
protected Locale | getDefaultLocale() Return the fixed Locale that this resolver will return if no cookie found, if any.
Locale | resolveLocale(HttpServletRequest request) Resolve the current locale via the given request.
void | setDefaultLocale(Locale defaultLocale) Set a fixed Locale that this resolver will return if no cookie found.
void | setLocale(HttpServletRequest request, HttpServletResponse response, Locale locale) Set the current locale to the given one.
Methods inherited from class org.springframework.web.util.CookieGenerator
addCookie, createCookie, getCookieDomain, getCookieMaxAge, getCookieName, getCookiePath, isCookieSecure, removeCookie, setCookieDomain, setCookieMaxAge, setCookieName, setCookiePath, setCookieSecure
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

LOCALE_REQUEST_ATTRIBUTE_NAME

public static final String LOCALE_REQUEST_ATTRIBUTE_NAME
The name of the request attribute that holds the locale.

Only used for overriding a cookie value if the locale has been changed in the course of the current request! Use RequestContext.getLocale() to retrieve the current locale in controllers or views.

See Also:
RequestContext.getLocale()

DEFAULT_COOKIE_NAME

public static final String DEFAULT_COOKIE_NAME
The default cookie name used if none is explicitly set.

Constructor Detail

CookieLocaleResolver

public CookieLocaleResolver()
Creates a new instance of the CookieLocaleResolver class using the default cookie name.

Method Detail

setDefaultLocale

public void setDefaultLocale(Locale defaultLocale)
Set a fixed Locale that this resolver will return if no cookie found.

getDefaultLocale

protected Locale getDefaultLocale()
Return the fixed Locale that this resolver will return if no cookie found, if any.

resolveLocale

public Locale resolveLocale(HttpServletRequest request)
Description copied from interface: LocaleResolver
Resolve the current locale via the given request. Should return a default locale as fallback in any case.

Specified by:
resolveLocale in interface LocaleResolver
Parameters:
request - the request to resolve the locale for
Returns:
the current locale (never null)

setLocale

public void setLocale(HttpServletRequest request,
                      HttpServletResponse response,
                      Locale locale)
Description copied from interface: LocaleResolver
Set the current locale to the given one.

Specified by:
setLocale in interface LocaleResolver
Parameters:
request - the request to be used for locale modification
response - the response to be used for locale modification
locale - the new locale, or null to clear the locale

determineDefaultLocale

protected Locale determineDefaultLocale(HttpServletRequest request)
Determine the default locale for the given request, Called if no locale cookie has been found.

The default implementation returns the specified default locale, if any, else falls back to the request's accept-header locale.

Parameters:
request - the request to resolve the locale for
Returns:
the default locale (never null)
See Also:
setDefaultLocale(java.util.Locale), ServletRequest.getLocale()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FixedLocaleResolver

org.springframework.web.servlet.i18n
Class FixedLocaleResolver

java.lang.Object
    extended by  org.springframework.web.servlet.i18n.AbstractLocaleResolver
        extended by  org.springframework.web.servlet.i18n.FixedLocaleResolver
All Implemented Interfaces:
LocaleResolver
public class FixedLocaleResolver
extends AbstractLocaleResolver

LocaleResolver implementation that always returns a fixed default locale. Default is the current JVM's default locale.

Note: Does not support setLocale, as the fixed locale cannot be changed.

Since:
1.1
Author:
Juergen Hoeller
See Also:
AbstractLocaleResolver.setDefaultLocale(java.util.Locale)

Constructor Summary
FixedLocaleResolver()
Create a default FixedLocaleResolver, exposing a configured default locale (or the JVM's default locale as fallback).
FixedLocaleResolver(Locale locale)
Create a FixedLocaleResolver that exposes the given locale.
Method Summary
Locale | resolveLocale(HttpServletRequest request) Resolve the current locale via the given request.
void | setLocale(HttpServletRequest request, HttpServletResponse response, Locale locale) Set the current locale to the given one.
Methods inherited from class org.springframework.web.servlet.i18n.AbstractLocaleResolver
getDefaultLocale, setDefaultLocale
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

FixedLocaleResolver

public FixedLocaleResolver()
Create a default FixedLocaleResolver, exposing a configured default locale (or the JVM's default locale as fallback).

See Also:
AbstractLocaleResolver.setDefaultLocale(java.util.Locale)

FixedLocaleResolver

public FixedLocaleResolver(Locale locale)
Create a FixedLocaleResolver that exposes the given locale.

Parameters:
locale - the locale to expose
Method Detail

resolveLocale

public Locale resolveLocale(HttpServletRequest request)
Description copied from interface: LocaleResolver
Resolve the current locale via the given request. Should return a default locale as fallback in any case.

Parameters:
request - the request to resolve the locale for
Returns:
the current locale (never null)

setLocale

public void setLocale(HttpServletRequest request,
                      HttpServletResponse response,
                      Locale locale)
Description copied from interface: LocaleResolver
Set the current locale to the given one.

Parameters:
request - the request to be used for locale modification
response - the response to be used for locale modification
locale - the new locale, or null to clear the locale
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LocaleChangeInterceptor

org.springframework.web.servlet.i18n
Class LocaleChangeInterceptor

java.lang.Object
    extended by  org.springframework.web.servlet.handler.HandlerInterceptorAdapter
        extended by  org.springframework.web.servlet.i18n.LocaleChangeInterceptor
All Implemented Interfaces:
HandlerInterceptor
public class LocaleChangeInterceptor
extends HandlerInterceptorAdapter

Interceptor that allows for changing the current locale on every request, via a configurable request parameter.

Since:
20.06.2003
Author:
Juergen Hoeller
See Also:
LocaleResolver

Field Summary
static String DEFAULT_PARAM_NAME
Default name of the locale specification parameter: "locale".
Constructor Summary
LocaleChangeInterceptor()
Method Summary
String | getParamName() Return the name of the parameter that contains a locale specification in a locale change request.
boolean | preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) This implementation always returns true.
void | setParamName(String paramName) Set the name of the parameter that contains a locale specification in a locale change request.
Methods inherited from class org.springframework.web.servlet.handler.HandlerInterceptorAdapter
afterCompletion, postHandle
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_PARAM_NAME

public static final String DEFAULT_PARAM_NAME
Default name of the locale specification parameter: "locale".

See Also:
Constant Field Values
Constructor Detail

LocaleChangeInterceptor

public LocaleChangeInterceptor()
Method Detail

setParamName

public void setParamName(String paramName)
Set the name of the parameter that contains a locale specification in a locale change request. Default is "locale".

getParamName

public String getParamName()
Return the name of the parameter that contains a locale specification in a locale change request.

preHandle

public boolean preHandle(HttpServletRequest request,
                         HttpServletResponse response,
                         Object handler)
                  throws ServletException
Description copied from class: HandlerInterceptorAdapter
This implementation always returns true.

Specified by:
preHandle in interface HandlerInterceptor
Overrides:
preHandle in class HandlerInterceptorAdapter
Parameters:
request - current HTTP request
response - current HTTP response
handler - chosen handler to execute, for type and/or instance evaluation
Returns:
true if the execution chain should proceed with the next interceptor or the handler itself. Else, DispatcherServlet assumes that this interceptor has already dealt with the response itself.
Throws:
ServletException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SessionLocaleResolver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.i18n
Class SessionLocaleResolver

java.lang.Object
    extended by  org.springframework.web.servlet.i18n.AbstractLocaleResolver
        extended by  org.springframework.web.servlet.i18n.SessionLocaleResolver
All Implemented Interfaces:
LocaleResolver
public class SessionLocaleResolver
extends AbstractLocaleResolver

Implementation of LocaleResolver that uses a locale attribute in the user's session in case of a custom setting, with a fallback to the specified default locale or the request's accept-header locale.

This is most appropriate if the application needs user sessions anyway, that is, when the HttpSession does not have to be created for the locale.

Custom controllers can override the user's locale by calling setLocale, e.g. responding to a locale change request.

Since:
27.02.2003
Author:
Juergen Hoeller
See Also:
AbstractLocaleResolver.setDefaultLocale(java.util.Locale), setLocale(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.util.Locale)

Field Summary
static String LOCALE_SESSION_ATTRIBUTE_NAME
Name of the session attribute that holds the locale.
Constructor Summary
SessionLocaleResolver()
Method Summary
protected Locale | determineDefaultLocale(HttpServletRequest request) Determine the default locale for the given request, Called if no locale session attribute has been found.
Locale | resolveLocale(HttpServletRequest request) Resolve the current locale via the given request.
void | setLocale(HttpServletRequest request, HttpServletResponse response, Locale locale) Set the current locale to the given one.
Methods inherited from class org.springframework.web.servlet.i18n.AbstractLocaleResolver
getDefaultLocale, setDefaultLocale
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

LOCALE_SESSION_ATTRIBUTE_NAME

public static final String LOCALE_SESSION_ATTRIBUTE_NAME
Name of the session attribute that holds the locale. Only used internally by this implementation. Use RequestContext(Utils).getLocale() to retrieve the current locale in controllers or views.

See Also:
RequestContext.getLocale(), RequestContextUtils.getLocale(javax.servlet.http.HttpServletRequest)
Constructor Detail

SessionLocaleResolver

public SessionLocaleResolver()
Method Detail

resolveLocale

public Locale resolveLocale(HttpServletRequest request)
Description copied from interface: LocaleResolver
Resolve the current locale via the given request. Should return a default locale as fallback in any case.

Parameters:
request - the request to resolve the locale for
Returns:
the current locale (never null)

determineDefaultLocale

protected Locale determineDefaultLocale(HttpServletRequest request)
Determine the default locale for the given request, Called if no locale session attribute has been found.

The default implementation returns the specified default locale, if any, else falls back to the request's accept-header locale.

Parameters:
request - the request to resolve the locale for
Returns:
the default locale (never null)
See Also:
AbstractLocaleResolver.setDefaultLocale(java.util.Locale), ServletRequest.getLocale()

setLocale

public void setLocale(HttpServletRequest request,
                      HttpServletResponse response,
                      Locale locale)
Description copied from interface: LocaleResolver
Set the current locale to the given one.

Parameters:
request - the request to be used for locale modification
response - the response to be used for locale modification
locale - the new locale, or null to clear the locale
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.servlet.mvc

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.servlet.mvc

Standard controller implementations for the servlet MVC framework that comes with Spring.

See:
Description

Interface Summary
Controller | Base Controller interface, representing a component that receives HttpServletRequest and HttpServletResponse instances just like a HttpServlet but is able to participate in an MVC workflow.
LastModified | Supports last-modified HTTP requests to facilitate content caching.

Class Summary
AbstractCommandController | Deprecated. as of Spring 3.0, in favor of annotated controllers
AbstractController | Convenient superclass for controller implementations, using the Template Method design pattern.
AbstractFormController | Deprecated. as of Spring 3.0, in favor of annotated controllers
AbstractUrlViewController | Abstract base class for Controllers that return a view name based on the request URL.
AbstractWizardFormController | Deprecated. as of Spring 3.0, in favor of annotated controllers
BaseCommandController | Deprecated. as of Spring 3.0, in favor of annotated controllers
CancellableFormController | Deprecated. as of Spring 3.0, in favor of annotated controllers
HttpRequestHandlerAdapter | Adapter to use the plain HttpRequestHandler interface with the generic DispatcherServlet.
ParameterizableViewController | Trivial controller that always returns a named view.
ServletForwardingController | Spring Controller implementation that forwards to a named servlet, i.e.
ServletWrappingController | Spring Controller implementation that wraps a servlet instance which it manages internally.
SimpleControllerHandlerAdapter | Adapter to use the plain Controller workflow interface with the generic DispatcherServlet.
SimpleFormController | Deprecated. as of Spring 3.0, in favor of annotated controllers
UrlFilenameViewController | Simple Controller implementation that transforms the virtual path of a URL into a view name and returns that view.
WebContentInterceptor | Interceptor that checks and prepares request and response.

Package org.springframework.web.servlet.mvc Description

Standard controller implementations for the servlet MVC framework that comes with Spring. Provides both abstract base classes and concrete implementations for often seen use cases.

A Controller - as defined in this package - is analogous to a Struts Action. Usually Controllers are JavaBeans to allow easy configuration using the org.springframework.beans package. Controllers define the C from so-called MVC paradigm and can be used in conjunction with the ModelAndView to achieve interactive applications. The view might be represented by a HTML interface, but, because of model and the controller being completely independent of the view, PDF views are possible, as well as for instance Excel views.

How to actually set up a (web)application using the MVC framework Spring provides is explained in more detail in the MVC-Step-by-Step tutorial, also provided in this package (or have a look here for an online version). The classes contained by this package explain in more detail the actual workflow of some of the abstract and concrete controller and how to extend and fully use their functionality.

Especially useful to read, while getting into the Spring MVC framework are the following:

  • Controller
  • BaseCommandController
  • ParameterizableViewController


org.springframework.web.servlet.mvc Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.servlet.mvc

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.context.support.ApplicationObjectSupport (implements org.springframework.context.ApplicationContextAware)
      • org.springframework.web.context.support.WebApplicationObjectSupport (implements org.springframework.web.context.ServletContextAware)
        • org.springframework.web.servlet.support.WebContentGenerator
          • org.springframework.web.servlet.mvc.AbstractController (implements org.springframework.web.servlet.mvc.Controller)
            • org.springframework.web.servlet.mvc.AbstractUrlViewController
              • org.springframework.web.servlet.mvc.UrlFilenameViewController
            • org.springframework.web.servlet.mvc.BaseCommandController
              • org.springframework.web.servlet.mvc.AbstractCommandController
              • org.springframework.web.servlet.mvc.AbstractFormController
                • org.springframework.web.servlet.mvc.AbstractWizardFormController
                • org.springframework.web.servlet.mvc.SimpleFormController
                  • org.springframework.web.servlet.mvc.CancellableFormController
            • org.springframework.web.servlet.mvc.ParameterizableViewController
            • org.springframework.web.servlet.mvc.ServletForwardingController (implements org.springframework.beans.factory.BeanNameAware)
            • org.springframework.web.servlet.mvc.ServletWrappingController (implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean)
          • org.springframework.web.servlet.mvc.WebContentInterceptor (implements org.springframework.web.servlet.HandlerInterceptor)
    • org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter (implements org.springframework.web.servlet.HandlerAdapter)
    • org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter (implements org.springframework.web.servlet.HandlerAdapter)

Interface Hierarchy

  • org.springframework.web.servlet.mvc.Controller
  • org.springframework.web.servlet.mvc.LastModified


Controller

org.springframework.web.servlet.mvc
Interface Controller

All Known Implementing Classes:
AbstractCommandController, AbstractController, AbstractFormController, AbstractUrlViewController, AbstractWizardFormController, BaseCommandController, CancellableFormController, MultiActionController, ParameterizableViewController, ServletForwardingController, ServletWrappingController, SimpleFormController, UrlFilenameViewController
public interface Controller

Base Controller interface, representing a component that receives HttpServletRequest and HttpServletResponse instances just like a HttpServlet but is able to participate in an MVC workflow. Controllers are comparable to the notion of a Struts Action.

Any implementation of the Controller interface should be a reusable, thread-safe class, capable of handling multiple HTTP requests throughout the lifecycle of an application. To be able to configure a Controller easily, Controller implementations are encouraged to be (and usually are) JavaBeans.

Workflow

After a DispatcherServlet has received a request and has done its work to resolve locales, themes and suchlike, it then tries to resolve a Controller, using a HandlerMapping. When a Controller has been found to handle the request, the handleRequest method of the located Controller will be invoked; the located Controller is then responsible for handling the actual request and - if applicable - returning an appropriate ModelAndView. So actually, this method is the main entrypoint for the DispatcherServlet which delegates requests to controllers.

So basically any direct implementation of the Controller interface just handles HttpServletRequests and should return a ModelAndView, to be further interpreted by the DispatcherServlet. Any additional functionality such as optional validation, form handling, etc should be obtained through extending one of the abstract controller classes mentioned above.

Notes on design and testing

The Controller interface is explicitly designed to operate on HttpServletRequest and HttpServletResponse objects, just like an HttpServlet. It does not aim to decouple itself from the Servlet API, in contrast to, for example, WebWork, JSF or Tapestry. Instead, the full power of the Servlet API is available, allowing Controllers to be general-purpose: a Controller is able to not only handle web user interface requests but also to process remoting protocols or to generate reports on demand.

Controllers can easily be tested by passing in mock objects for the HttpServletRequest and HttpServletResponse objects as parameters to the handleRequest method. As a convenience, Spring ships with a set of Servlet API mocks that are suitable for testing any kind of web components, but are particularly suitable for testing Spring web controllers. In contrast to a Struts Action, there is no need to mock the ActionServlet or any other infrastructure; HttpServletRequest and HttpServletResponse are sufficient.

If Controllers need to be aware of specific environment references, they can choose to implement specific awareness interfaces, just like any other bean in a Spring (web) application context can do, for example:

  • org.springframework.context.ApplicationContextAware
  • org.springframework.context.ResourceLoaderAware
  • org.springframework.web.context.ServletContextAware

Such environment references can easily be passed in testing environments, through the corresponding setters defined in the respective awareness interfaces. In general, it is recommended to keep the dependencies as minimal as possible: for example, if all you need is resource loading, implement ResourceLoaderAware only. Alternatively, derive from the WebApplicationObjectSupport base class, which gives you all those references through convenient accessors - but requires an ApplicationContext reference on initialization.

Controllers can optionally implement the LastModified interface.

Author:
Rod Johnson, Juergen Hoeller
See Also:
LastModified, SimpleControllerHandlerAdapter, AbstractController, MockHttpServletRequest, MockHttpServletResponse, ApplicationContextAware, ResourceLoaderAware, ServletContextAware, WebApplicationObjectSupport

Method Summary
 ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
Process the request and return a ModelAndView object which the DispatcherServlet will render.

Method Detail

handleRequest

ModelAndView handleRequest(HttpServletRequest request,
                           HttpServletResponse response)
                           throws Exception
Process the request and return a ModelAndView object which the DispatcherServlet will render. A null return value is not an error: It indicates that this object completed request processing itself, thus there is no ModelAndView to render.

Parameters:
request - current HTTP request
response - current HTTP response
Returns:
a ModelAndView to render, or null if handled directly
Throws:
Exception - in case of errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LastModified

org.springframework.web.servlet.mvc
Interface LastModified

All Known Implementing Classes:
MultiActionController
public interface LastModified

Supports last-modified HTTP requests to facilitate content caching. Same contract as for the Servlet API's getLastModified method.

Delegated to by a HandlerAdapter.getLastModified(javax.servlet.http.HttpServletRequest, java.lang.Object) implementation. By default, any Controller or HttpRequestHandler within Spring's default framework can implement this interface to enable last-modified checking.

Note: Alternative handler implementation approaches have different last-modified handling styles. For example, Spring 2.5's annotated controller approach (using @RequestMapping) provides last-modified support through the WebRequest.checkNotModified(long) method, allowing for last-modified checking within the main handler method.

Author:
Rod Johnson, Juergen Hoeller
See Also:
HttpServlet.getLastModified(javax.servlet.http.HttpServletRequest), Controller, SimpleControllerHandlerAdapter, HttpRequestHandler, HttpRequestHandlerAdapter

Method Summary
 long getLastModified(HttpServletRequest request)
Same contract as for HttpServlet's getLastModified method.

Method Detail

getLastModified

long getLastModified(HttpServletRequest request)
Same contract as for HttpServlet's getLastModified method. Invoked before request processing.

The return value will be sent to the HTTP client as Last-Modified header, and compared with If-Modified-Since headers that the client sends back. The content will only get regenerated if there has been a modification.

Parameters:
request - current HTTP request
Returns:
the time the underlying resource was last modified, or -1 meaning that the content must always be regenerated
See Also:
HandlerAdapter.getLastModified(javax.servlet.http.HttpServletRequest, java.lang.Object), HttpServlet.getLastModified(javax.servlet.http.HttpServletRequest)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractCommandController

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.mvc
Class AbstractCommandController

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.support.WebContentGenerator
                extended by  org.springframework.web.servlet.mvc.AbstractController
                    extended by  org.springframework.web.servlet.mvc.BaseCommandController
                        extended by  org.springframework.web.servlet.mvc.AbstractCommandController
All Implemented Interfaces:
ApplicationContextAware, ServletContextAware, Controller
Deprecated. as of Spring 3.0, in favor of annotated controllers

@Deprecated
public abstract class AbstractCommandController
extends BaseCommandController

Abstract base class for custom command controllers.

Autopopulates a command bean from the request. For command validation, a validator (property inherited from BaseCommandController) can be used.

In most cases this command controller should not be used to handle form submission, because functionality for forms is offered in more detail by the AbstractFormController and its corresponding implementations.

Exposed configuration properties (and those defined by superclass):
none (so only those available in superclass).

Workflow (and that defined by superclass):

Author:
Rod Johnson, Juergen Hoeller
See Also:
BaseCommandController.setCommandClass(java.lang.Class),
BaseCommandController.setCommandName(java.lang.String),
BaseCommandController.setValidator(org.springframework.validation.Validator)

Field Summary
Fields inherited from class org.springframework.web.servlet.mvc.BaseCommandController
DEFAULT_COMMAND_NAME
Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator
METHOD_GET, METHOD_HEAD, METHOD_POST
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Constructor Summary
AbstractCommandController()
Deprecated. Create a new AbstractCommandController.
AbstractCommandController(Class commandClass)
Deprecated. Create a new AbstractCommandController.
AbstractCommandController(Class commandClass, String commandName)
Deprecated. Create a new AbstractCommandController.
Method Summary
protected abstract ModelAndView | handle(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) Deprecated. Template method for request handling, providing a populated and validated instance of the command class, and an Errors object containing binding and validation errors.
protected ModelAndView | handleRequestInternal(HttpServletRequest request, HttpServletResponse response) Deprecated. Template method.
Methods inherited from class org.springframework.web.servlet.mvc.BaseCommandController
bindAndValidate, checkCommand, createBinder, createCommand, getBindingErrorProcessor, getCommand, getCommandClass, getCommandName, getMessageCodesResolver, getPropertyEditorRegistrars, getValidator, getValidators, getWebBindingInitializer, initApplicationContext, initBinder, isValidateOnBinding, onBind, onBind, onBindAndValidate, prepareBinder, setBindingErrorProcessor, setCommandClass, setCommandName, setMessageCodesResolver, setPropertyEditorRegistrar, setPropertyEditorRegistrars, setValidateOnBinding, setValidator, setValidators, setWebBindingInitializer, suppressBinding, suppressValidation, suppressValidation, suppressValidation, useDirectFieldAccess
Methods inherited from class org.springframework.web.servlet.mvc.AbstractController
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession
Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractCommandController

public AbstractCommandController()
Deprecated.
Create a new AbstractCommandController.

AbstractCommandController

public AbstractCommandController(Class commandClass)
Deprecated.
Create a new AbstractCommandController.

Parameters:
commandClass - class of the command bean

AbstractCommandController

public AbstractCommandController(Class commandClass,
                                 String commandName)
Deprecated.
Create a new AbstractCommandController.

Parameters:
commandClass - class of the command bean
commandName - name of the command bean
Method Detail

handleRequestInternal

protected ModelAndView handleRequestInternal(HttpServletRequest request,
                                             HttpServletResponse response)
                                      throws Exception
Deprecated.
Description copied from class: AbstractController
Template method. Subclasses must implement this. The contract is the same as for handleRequest.

Specified by:
handleRequestInternal in class AbstractController
Throws:
Exception
See Also:
AbstractController.handleRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

handle

protected abstract ModelAndView handle(HttpServletRequest request,
                                       HttpServletResponse response,
                                       Object command,
                                       BindException errors)
                                throws Exception
Deprecated.
Template method for request handling, providing a populated and validated instance of the command class, and an Errors object containing binding and validation errors.

Call errors.getModel() to populate the ModelAndView model with the command and the Errors instance, under the specified command name, as expected by the "spring:bind" tag.

Parameters:
request - current HTTP request
response - current HTTP response
command - the populated command object
errors - validation errors holder
Returns:
a ModelAndView to render, or null if handled directly
Throws:
Exception
See Also:
Errors, BindException.getModel()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractController

org.springframework.web.servlet.mvc
Class AbstractController

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.support.WebContentGenerator
                extended by  org.springframework.web.servlet.mvc.AbstractController
All Implemented Interfaces:
ApplicationContextAware, ServletContextAware, Controller
Direct Known Subclasses:
AbstractUrlViewController, BaseCommandController, MultiActionController, ParameterizableViewController, ServletForwardingController, ServletWrappingController
public abstract class AbstractController
extends WebContentGenerator
implements Controller

Convenient superclass for controller implementations, using the Template Method design pattern.

As stated in the Controller interface, a lot of functionality is already provided by certain abstract base controllers. The AbstractController is one of the most important abstract base controller providing basic features such as the generation of caching headers and the enabling or disabling of supported methods (GET/POST).

Workflow (and that defined by interface):

  1. handleRequest() will be called by the DispatcherServlet
  2. Inspection of supported methods (ServletException if request method is not support)
  3. If session is required, try to get it (ServletException if not found)
  4. Set caching headers if needed according to the cacheSeconds property
  5. Call abstract method handleRequestInternal() (optionally synchronizing around the call on the HttpSession), which should be implemented by extending classes to provide actual functionality to return ModelAndView objects.

Exposed configuration properties (and those defined by interface):

name | default | description
supportedMethods | GET,POST | comma-separated (CSV) list of methods supported by this controller, such as GET, POST and PUT
requireSession | false | whether a session should be required for requests to be able to be handled by this controller. This ensures that derived controller can - without fear of null pointers - call request.getSession() to retrieve a session. If no session can be found while processing the request, a ServletException will be thrown
cacheSeconds | -1 | indicates the amount of seconds to include in the cache header for the response following on this request. 0 (zero) will include headers for no caching at all, -1 (the default) will not generate any headers and any positive number will generate headers that state the amount indicated as seconds to cache the content
synchronizeOnSession | false | whether the call to handleRequestInternal should be synchronized around the HttpSession, to serialize invocations from the same client. No effect if there is no HttpSession.

Author:
Rod Johnson, Juergen Hoeller
See Also:
WebContentInterceptor

Field Summary
Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator
METHOD_GET, METHOD_HEAD, METHOD_POST
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Constructor Summary
AbstractController()
Method Summary
ModelAndView | handleRequest(HttpServletRequest request, HttpServletResponse response) Process the request and return a ModelAndView object which the DispatcherServlet will render.
protected abstract ModelAndView | handleRequestInternal(HttpServletRequest request, HttpServletResponse response) Template method.
boolean | isSynchronizeOnSession() Return whether controller execution should be synchronized on the session.
void | setSynchronizeOnSession(boolean synchronizeOnSession) Set if controller execution should be synchronized on the session, to serialize parallel invocations from the same client.
Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractController

public AbstractController()
Method Detail

setSynchronizeOnSession

public final void setSynchronizeOnSession(boolean synchronizeOnSession)
Set if controller execution should be synchronized on the session, to serialize parallel invocations from the same client.

More specifically, the execution of the handleRequestInternal method will get synchronized if this flag is "true". The best available session mutex will be used for the synchronization; ideally, this will be a mutex exposed by HttpSessionMutexListener.

The session mutex is guaranteed to be the same object during the entire lifetime of the session, available under the key defined by the SESSION_MUTEX_ATTRIBUTE constant. It serves as a safe reference to synchronize on for locking on the current session.

In many cases, the HttpSession reference itself is a safe mutex as well, since it will always be the same object reference for the same active logical session. However, this is not guaranteed across different servlet containers; the only 100% safe way is a session mutex.

See Also:
handleRequestInternal(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), HttpSessionMutexListener, WebUtils.getSessionMutex(javax.servlet.http.HttpSession)

isSynchronizeOnSession

public final boolean isSynchronizeOnSession()
Return whether controller execution should be synchronized on the session.

handleRequest

public ModelAndView handleRequest(HttpServletRequest request,
                                  HttpServletResponse response)
                           throws Exception
Description copied from interface: Controller
Process the request and return a ModelAndView object which the DispatcherServlet will render. A null return value is not an error: It indicates that this object completed request processing itself, thus there is no ModelAndView to render.

Specified by:
handleRequest in interface Controller
Parameters:
request - current HTTP request
response - current HTTP response
Returns:
a ModelAndView to render, or null if handled directly
Throws:
Exception - in case of errors

handleRequestInternal

protected abstract ModelAndView handleRequestInternal(HttpServletRequest request,
                                                      HttpServletResponse response)
                                               throws Exception
Template method. Subclasses must implement this. The contract is the same as for handleRequest.

Throws:
Exception
See Also:
handleRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractFormController

org.springframework.web.servlet.mvc
Class AbstractFormController

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.support.WebContentGenerator
                extended by  org.springframework.web.servlet.mvc.AbstractController
                    extended by  org.springframework.web.servlet.mvc.BaseCommandController
                        extended by  org.springframework.web.servlet.mvc.AbstractFormController
All Implemented Interfaces:
ApplicationContextAware, ServletContextAware, Controller
Direct Known Subclasses:
AbstractWizardFormController, SimpleFormController
Deprecated. as of Spring 3.0, in favor of annotated controllers

@Deprecated
public abstract class AbstractFormController
extends BaseCommandController

Form controller that auto-populates a form bean from the request. This, either using a new bean instance per request, or using the same bean when the sessionForm property has been set to true.

This class is the base class for both framework subclasses such as SimpleFormController and AbstractWizardFormController and custom form controllers that you may provide yourself.

A form-input view and an after-submission view have to be provided programmatically. To provide those views using configuration properties, use the SimpleFormController.

Subclasses need to override showForm to prepare the form view, and processFormSubmission to handle submit requests. For the latter, binding errors like type mismatches will be reported via the given "errors" holder. For additional custom form validation, a validator (property inherited from BaseCommandController) can be used, reporting via the same "errors" instance.

Comparing this Controller to the Struts notion of the Action shows us that with Spring, you can use any ordinary JavaBeans or database- backed JavaBeans without having to implement a framework-specific class (like Struts' ActionForm). More complex properties of JavaBeans (Dates, Locales, but also your own application-specific or compound types) can be represented and submitted to the controller, by using the notion of a java.beans.PropertyEditor. For more information on that subject, see the workflow of this controller and the explanation of the BaseCommandController.

Workflow (and that defined by superclass):

  1. The controller receives a request for a new form (typically a GET).
  2. Call to formBackingObject() which by default, returns an instance of the commandClass that has been configured (see the properties the superclass exposes), but can also be overridden to e.g. retrieve an object from the database (that needs to be modified using the form).
  3. Call to initBinder() which allows you to register custom editors for certain fields (often properties of non-primitive or non-String types) of the command class. This will render appropriate Strings for those property values, e.g. locale-specific date strings.
  4. Only if bindOnNewForm is set to true, then ServletRequestDataBinder gets applied to populate the new form object with initial request parameters and the onBindOnNewForm(HttpServletRequest, Object, BindException) callback method is called. Note: any defined Validators are not applied at this point, to allow partial binding. However be aware that any Binder customizations applied via initBinder() (such as DataBinder.setRequiredFields(String[]) will still apply. As such, if using bindOnNewForm=true and initBinder() customizations are used to validate fields instead of using Validators, in the case that only some fields will be populated for the new form, there will potentially be some bind errors for missing fields in the errors object. Any view (JSP, etc.) that displays binder errors needs to be intelligent and for this case take into account whether it is displaying the initial form view or subsequent post results, skipping error display for the former.
  5. Call to showForm() to return a View that should be rendered (typically the view that renders the form). This method has to be implemented in subclasses.
  6. The showForm() implementation will call referenceData(), which you can implement to provide any relevant reference data you might need when editing a form (e.g. a List of Locale objects you're going to let the user select one from).
  7. Model gets exposed and view gets rendered, to let the user fill in the form.
  8. The controller receives a form submission (typically a POST). To use a different way of detecting a form submission, override the isFormSubmission method.
  9. If sessionForm is not set, formBackingObject() is called to retrieve a form object. Otherwise, the controller tries to find the command object which is already bound in the session. If it cannot find the object, it does a call to handleInvalidSubmit which - by default - tries to create a new form object and resubmit the form.
  10. The ServletRequestDataBinder gets applied to populate the form object with current request parameters.
  11. Call to onBind(HttpServletRequest, Object, Errors) which allows you to do custom processing after binding but before validation (e.g. to manually bind request parameters to bean properties, to be seen by the Validator).
  12. If validateOnBinding is set, a registered Validator will be invoked. The Validator will check the form object properties, and register corresponding errors via the given Errors
    13. object.
  13. Call to onBindAndValidate() which allows you to do custom processing after binding and validation (e.g. to manually bind request parameters, and to validate them outside a Validator).
  14. Call processFormSubmission() to process the submission, with or without binding errors. This method has to be implemented in subclasses.

In session form mode, a submission without an existing form object in the session is considered invalid, like in case of a resubmit/reload by the browser. The handleInvalidSubmit method is invoked then, by default trying to resubmit. It can be overridden in subclasses to show corresponding messages or to redirect to a new form, in order to avoid duplicate submissions. The form object in the session can be considered a transaction token in that case.

Note that views should never retrieve form beans from the session but always from the request, as prepared by the form controller. Remember that some view technologies like Velocity cannot even access a HTTP session.

Exposed configuration properties (and those defined by superclass):

name | default | description
bindOnNewForm | false | Indicates whether to bind servlet request parameters when creating a new form. Otherwise, the parameters will only be bound on form submission attempts.
sessionForm | false | Indicates whether the form object should be kept in the session when a user asks for a new form. This allows you e.g. to retrieve an object from the database, let the user edit it, and then persist it again. Otherwise, a new command object will be created for each request (even when showing the form again after validation errors).

Author:
Rod Johnson, Juergen Hoeller, Alef Arendsen, Rob Harrop, Colin Sampaleanu
See Also:
showForm(HttpServletRequest, HttpServletResponse, BindException), processFormSubmission(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object, org.springframework.validation.BindException), SimpleFormController, AbstractWizardFormController

Field Summary
Fields inherited from class org.springframework.web.servlet.mvc.BaseCommandController
DEFAULT_COMMAND_NAME
Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator
METHOD_GET, METHOD_HEAD, METHOD_POST
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Constructor Summary
AbstractFormController()
Deprecated. Create a new AbstractFormController.
Method Summary
protected Object | currentFormObject(HttpServletRequest request, Object sessionFormObject) Deprecated. Return the current form object to use for binding and further processing, based on the passed-in form object as found in the HttpSession.
protected Object | formBackingObject(HttpServletRequest request) Deprecated. Retrieve a backing object for the current form from the given request.
protected Object | getCommand(HttpServletRequest request) Deprecated. Return the form object for the given request.
protected BindException | getErrorsForNewForm(HttpServletRequest request) Deprecated. Create a BindException instance for a new form.
protected String | getFormSessionAttributeName() Deprecated. Return the name of the HttpSession attribute that holds the form object for this form controller.
protected String | getFormSessionAttributeName(HttpServletRequest request) Deprecated. Return the name of the HttpSession attribute that holds the form object for this form controller.
protected ModelAndView | handleInvalidSubmit(HttpServletRequest request, HttpServletResponse response) Deprecated. Handle an invalid submit request, e.g.
protected ModelAndView | handleRequestInternal(HttpServletRequest request, HttpServletResponse response) Deprecated. Handles two cases: form submissions and showing a new form.
boolean | isBindOnNewForm() Deprecated. Return true if request parameters should be bound in case of a new form.
protected boolean | isFormSubmission(HttpServletRequest request) Deprecated. Determine if the given request represents a form submission.
boolean | isSessionForm() Deprecated. Return true if session form mode is activated.
protected void | onBindOnNewForm(HttpServletRequest request, Object command) Deprecated. Callback for custom post-processing in terms of binding for a new form.
protected void | onBindOnNewForm(HttpServletRequest request, Object command, BindException errors) Deprecated. Callback for custom post-processing in terms of binding for a new form.
protected abstract ModelAndView | processFormSubmission(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) Deprecated. Process form submission request.
protected Map | referenceData(HttpServletRequest request, Object command, Errors errors) Deprecated. Create a reference data map for the given request, consisting of bean name/bean instance pairs as expected by ModelAndView.
void | setBindOnNewForm(boolean bindOnNewForm) Deprecated. Set whether request parameters should be bound to the form object in case of a non-submitting request, that is, a new form.
void | setSessionForm(boolean sessionForm) Deprecated. Activate/deactivate session form mode.
protected ModelAndView | showForm(HttpServletRequest request, BindException errors, String viewName) Deprecated. Prepare model and view for the given form, including reference and errors.
protected ModelAndView | showForm(HttpServletRequest request, BindException errors, String viewName, Map controlModel) Deprecated. Prepare model and view for the given form, including reference and errors, adding a controller-specific control model.
protected abstract ModelAndView | showForm(HttpServletRequest request, HttpServletResponse response, BindException errors) Deprecated. Prepare the form model and view, including reference and error data.
protected ModelAndView | showNewForm(HttpServletRequest request, HttpServletResponse response) Deprecated. Show a new form.
Methods inherited from class org.springframework.web.servlet.mvc.BaseCommandController
bindAndValidate, checkCommand, createBinder, createCommand, getBindingErrorProcessor, getCommandClass, getCommandName, getMessageCodesResolver, getPropertyEditorRegistrars, getValidator, getValidators, getWebBindingInitializer, initApplicationContext, initBinder, isValidateOnBinding, onBind, onBind, onBindAndValidate, prepareBinder, setBindingErrorProcessor, setCommandClass, setCommandName, setMessageCodesResolver, setPropertyEditorRegistrar, setPropertyEditorRegistrars, setValidateOnBinding, setValidator, setValidators, setWebBindingInitializer, suppressBinding, suppressValidation, suppressValidation, suppressValidation, useDirectFieldAccess
Methods inherited from class org.springframework.web.servlet.mvc.AbstractController
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession
Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractFormController

public AbstractFormController()
Deprecated.
Create a new AbstractFormController.

Subclasses should set the following properties, either in the constructor or via a BeanFactory: commandName, commandClass, bindOnNewForm, sessionForm. Note that "commandClass" doesn't need to be set when overriding formBackingObject(javax.servlet.http.HttpServletRequest), since the latter determines the class anyway.

"cacheSeconds" is by default set to 0 (-> no caching for all form controllers).

See Also:
BaseCommandController.setCommandName(java.lang.String), BaseCommandController.setCommandClass(java.lang.Class), setBindOnNewForm(boolean), setSessionForm(boolean), formBackingObject(javax.servlet.http.HttpServletRequest)
Method Detail

setBindOnNewForm

public final void setBindOnNewForm(boolean bindOnNewForm)
Deprecated.
Set whether request parameters should be bound to the form object in case of a non-submitting request, that is, a new form.

isBindOnNewForm

public final boolean isBindOnNewForm()
Deprecated.
Return true if request parameters should be bound in case of a new form.

setSessionForm

public final void setSessionForm(boolean sessionForm)
Deprecated.
Activate/deactivate session form mode. In session form mode, the form is stored in the session to keep the form object instance between requests, instead of creating a new one on each request.

This is necessary for either wizard-style controllers that populate a single form object from multiple pages, or forms that populate a persistent object that needs to be identical to allow for tracking changes.

Please note that the AbstractFormController class (and all subclasses of it unless stated to the contrary) do not support the notion of a conversation. This is important in the context of this property, because it means that there is only one form per session: this means that if session form mode is activated and a user opens up say two tabs in their browser and attempts to edit two distinct objects using the same form, then the shared session state can potentially (and most probably will) be overwritten by the last tab to be opened, which can lead to errors when either of the forms in each is finally submitted.

If you need to have per-form, per-session state management (that is, stateful web conversations), the recommendation is to use Spring WebFlow, which has full support for conversations and has a much more flexible usage model overall.

Parameters:
sessionForm - true if session form mode is to be activated

isSessionForm

public final boolean isSessionForm()
Deprecated.
Return true if session form mode is activated.

handleRequestInternal

protected ModelAndView handleRequestInternal(HttpServletRequest request,
                                             HttpServletResponse response)
                                      throws Exception
Deprecated.
Handles two cases: form submissions and showing a new form. Delegates the decision between the two to isFormSubmission(javax.servlet.http.HttpServletRequest), always treating requests without existing form session attribute as new form when using session form mode.

Specified by:
handleRequestInternal in class AbstractController
Throws:
Exception
See Also:
isFormSubmission(javax.servlet.http.HttpServletRequest),
showNewForm(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse),
processFormSubmission(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object, org.springframework.validation.BindException)

isFormSubmission

protected boolean isFormSubmission(HttpServletRequest request)
Deprecated.
Determine if the given request represents a form submission.

The default implementation treats a POST request as form submission. Note: If the form session attribute doesn't exist when using session form mode, the request is always treated as new form by handleRequestInternal.

Subclasses can override this to use a custom strategy, e.g. a specific request parameter (assumably a hidden field or submit button name).

Parameters:
request - current HTTP request
Returns:
if the request represents a form submission

getFormSessionAttributeName

protected String getFormSessionAttributeName(HttpServletRequest request)
Deprecated.
Return the name of the HttpSession attribute that holds the form object for this form controller.

The default implementation delegates to the getFormSessionAttributeName() variant without arguments.

Parameters:
request - current HTTP request
Returns:
the name of the form session attribute, or null if not in session form mode
See Also:
getFormSessionAttributeName(javax.servlet.http.HttpServletRequest), HttpSession.getAttribute(java.lang.String)

getFormSessionAttributeName

protected String getFormSessionAttributeName()
Deprecated.
Return the name of the HttpSession attribute that holds the form object for this form controller.

Default is an internal name, of no relevance to applications, as the form session attribute is not usually accessed directly. Can be overridden to use an application-specific attribute name, which allows other code to access the session attribute directly.

Returns:
the name of the form session attribute
See Also:
HttpSession.getAttribute(java.lang.String)

showNewForm

protected final ModelAndView showNewForm(HttpServletRequest request,
                                         HttpServletResponse response)
                                  throws Exception
Deprecated.
Show a new form. Prepares a backing object for the current form and the given request, including checking its validity.

Parameters:
request - current HTTP request
response - current HTTP response
Returns:
the prepared form view
Throws:
Exception - in case of an invalid new form object
See Also:
getErrorsForNewForm(javax.servlet.http.HttpServletRequest)

getErrorsForNewForm

protected final BindException getErrorsForNewForm(HttpServletRequest request)
                                           throws Exception
Deprecated.
Create a BindException instance for a new form. Called by showNewForm(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse).

Can be used directly when intending to show a new form but with special errors registered on it (for example, on invalid submit). Usually, the resulting BindException will be passed to showForm(HttpServletRequest, HttpServletResponse, BindException), after registering the errors on it.

Parameters:
request - current HTTP request
Returns:
the BindException instance
Throws:
Exception - in case of an invalid new form object
See Also:
showNewForm(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse),
showForm(HttpServletRequest, HttpServletResponse, BindException),
handleInvalidSubmit(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

onBindOnNewForm

protected void onBindOnNewForm(HttpServletRequest request,
                               Object command,
                               BindException errors)
                        throws Exception
Deprecated.
Callback for custom post-processing in terms of binding for a new form. Called when preparing a new form if bindOnNewForm is true.

The default implementation delegates to onBindOnNewForm(request, command).

Parameters:
request - current HTTP request
command - the command object to perform further binding on
errors - validation errors holder, allowing for additional custom registration of binding errors
Throws:
Exception - in case of invalid state or arguments
See Also:
onBindOnNewForm(javax.servlet.http.HttpServletRequest, Object), setBindOnNewForm(boolean)

onBindOnNewForm

protected void onBindOnNewForm(HttpServletRequest request,
                               Object command)
                        throws Exception
Deprecated.
Callback for custom post-processing in terms of binding for a new form.

Called by the default implementation of the onBindOnNewForm(HttpServletRequest, Object, BindException) variant with all parameters, after standard binding when displaying the form view. Only called if bindOnNewForm is set to true.

The default implementation is empty.

Parameters:
request - current HTTP request
command - the command object to perform further binding on
Throws:
Exception - in case of invalid state or arguments
See Also:
onBindOnNewForm(HttpServletRequest, Object, BindException), setBindOnNewForm(boolean)

getCommand

protected final Object getCommand(HttpServletRequest request)
                           throws Exception
Deprecated.
Return the form object for the given request.

Calls formBackingObject(javax.servlet.http.HttpServletRequest) if not in session form mode. Else, retrieves the form object from the session. Note that the form object gets removed from the session, but it will be re-added when showing the form for resubmission.

Overrides:
getCommand in class BaseCommandController
Parameters:
request - current HTTP request
Returns:
object form to bind onto
Throws:
HttpSessionRequiredException - if a session was expected but no active session (or session form object) found
Exception - in case of invalid state or arguments
See Also:
formBackingObject(javax.servlet.http.HttpServletRequest)

formBackingObject

protected Object formBackingObject(HttpServletRequest request)
                            throws Exception
Deprecated.
Retrieve a backing object for the current form from the given request.

The properties of the form object will correspond to the form field values in your form view. This object will be exposed in the model under the specified command name, to be accessed under that name in the view: for example, with a "spring:bind" tag. The default command name is "command".

Note that you need to activate session form mode to reuse the form-backing object across the entire form workflow. Else, a new instance of the command class will be created for each submission attempt, just using this backing object as template for the initial form.

The default implementation calls BaseCommandController.createCommand(), creating a new empty instance of the specified command class. Subclasses can override this to provide a preinitialized backing object.

Parameters:
request - current HTTP request
Returns:
the backing object
Throws:
Exception - in case of invalid state or arguments
See Also:
BaseCommandController.setCommandName(java.lang.String),
BaseCommandController.setCommandClass(java.lang.Class),
BaseCommandController.createCommand()

currentFormObject

protected Object currentFormObject(HttpServletRequest request,
                                   Object sessionFormObject)
                            throws Exception
Deprecated.
Return the current form object to use for binding and further processing, based on the passed-in form object as found in the HttpSession.

The default implementation simply returns the session form object as-is. Subclasses can override this to post-process the session form object, for example reattaching it to a persistence manager.

Parameters:
sessionFormObject - the form object retrieved from the HttpSession
Returns:
the form object to use for binding and further processing
Throws:
Exception - in case of invalid state or arguments

showForm

protected abstract ModelAndView showForm(HttpServletRequest request,
                                         HttpServletResponse response,
                                         BindException errors)
                                  throws Exception
Deprecated.
Prepare the form model and view, including reference and error data. Can show a configured form page, or generate a form view programmatically.

A typical implementation will call showForm(request, errors, "myView") to prepare the form view for a specific view name, returning the ModelAndView provided there.

For building a custom ModelAndView, call errors.getModel() to populate the ModelAndView model with the command and the Errors instance, under the specified command name, as expected by the "spring:bind" tag. You also need to include the model returned by referenceData(javax.servlet.http.HttpServletRequest, java.lang.Object, org.springframework.validation.Errors).

Note: If you decide to have a "formView" property specifying the view name, consider using SimpleFormController.

Parameters:
request - current HTTP request
response - current HTTP response
errors - validation errors holder
Returns:
the prepared form view, or null if handled directly
Throws:
Exception - in case of invalid state or arguments
See Also:
showForm(HttpServletRequest, BindException, String),
Errors,
BindException.getModel(),
referenceData(HttpServletRequest, Object, Errors),
SimpleFormController.setFormView(java.lang.String)

showForm

protected final ModelAndView showForm(HttpServletRequest request,
                                      BindException errors,
                                      String viewName)
                               throws Exception
Deprecated.
Prepare model and view for the given form, including reference and errors.

In session form mode: Re-puts the form object in the session when returning to the form, as it has been removed by getCommand.

Can be used in subclasses to redirect back to a specific form page.

Parameters:
request - current HTTP request
errors - validation errors holder
viewName - name of the form view
Returns:
the prepared form view
Throws:
Exception - in case of invalid state or arguments

showForm

protected final ModelAndView showForm(HttpServletRequest request,
                                      BindException errors,
                                      String viewName,
                                      Map controlModel)
                               throws Exception
Deprecated.
Prepare model and view for the given form, including reference and errors, adding a controller-specific control model.

In session form mode: Re-puts the form object in the session when returning to the form, as it has been removed by getCommand.

Can be used in subclasses to redirect back to a specific form page.

Parameters:
request - current HTTP request
errors - validation errors holder
viewName - name of the form view
controlModel - model map containing controller-specific control data (e.g. current page in wizard-style controllers or special error message)
Returns:
the prepared form view
Throws:
Exception - in case of invalid state or arguments

referenceData

protected Map referenceData(HttpServletRequest request,
                            Object command,
                            Errors errors)
                     throws Exception
Deprecated.
Create a reference data map for the given request, consisting of bean name/bean instance pairs as expected by ModelAndView.

The default implementation returns null. Subclasses can override this to set reference data used in the view.

Parameters:
request - current HTTP request
command - form object with request parameters bound onto it
errors - validation errors holder
Returns:
a Map with reference data entries, or null if none
Throws:
Exception - in case of invalid state or arguments
See Also:
ModelAndView

processFormSubmission

protected abstract ModelAndView processFormSubmission(HttpServletRequest request,
                                                      HttpServletResponse response,
                                                      Object command,
                                                      BindException errors)
                                               throws Exception
Deprecated.
Process form submission request. Called by handleRequestInternal(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) in case of a form submission, with or without binding errors. Implementations need to proceed properly, typically showing a form view in case of binding errors or performing a submit action else.

Subclasses can implement this to provide custom submission handling like triggering a custom action. They can also provide custom validation and call showForm(HttpServletRequest, HttpServletResponse, BindException) or proceed with the submission accordingly.

For a success view, call errors.getModel() to populate the ModelAndView model with the command and the Errors instance, under the specified command name, as expected by the "spring:bind" tag. For a form view, simply return the ModelAndView object provided by showForm(HttpServletRequest, HttpServletResponse, BindException).

Parameters:
request - current servlet request
response - current servlet response
command - form object with request parameters bound onto it
errors - holder without errors (subclass can add errors if it wants to)
Returns:
the prepared model and view, or null
Throws:
Exception - in case of errors
See Also:
handleRequestInternal(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse),
isFormSubmission(javax.servlet.http.HttpServletRequest),
showForm(HttpServletRequest, HttpServletResponse, BindException),
Errors,
BindException.getModel()

handleInvalidSubmit

protected ModelAndView handleInvalidSubmit(HttpServletRequest request,
                                           HttpServletResponse response)
                                    throws Exception
Deprecated.
Handle an invalid submit request, e.g. when in session form mode but no form object was found in the session (like in case of an invalid resubmit by the browser).

The default implementation simply tries to resubmit the form with a new form object. This should also work if the user hit the back button, changed some form data, and resubmitted the form.

Note: To avoid duplicate submissions, you need to override this method. Either show some "invalid submit" message, or call showNewForm(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) for resetting the form (prepopulating it with the current values if "bindOnNewForm" is true). In this case, the form object in the session serves as transaction token.

 protected ModelAndView handleInvalidSubmit(HttpServletRequest request, HttpServletResponse response) throws Exception {
   return showNewForm(request, response);
 }
You can also show a new form but with special errors registered on it:
 protected ModelAndView handleInvalidSubmit(HttpServletRequest request, HttpServletResponse response) throws Exception {
   BindException errors = getErrorsForNewForm(request);
   errors.reject("duplicateFormSubmission", "Duplicate form submission");
   return showForm(request, response, errors);
 }

Parameters:
request - current HTTP request
response - current HTTP response
Returns:
a prepared view, or null if handled directly
Throws:
Exception - in case of errors
See Also:
showNewForm(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse),
getErrorsForNewForm(javax.servlet.http.HttpServletRequest),
showForm(HttpServletRequest, HttpServletResponse, BindException),
setBindOnNewForm(boolean)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractUrlViewController

org.springframework.web.servlet.mvc
Class AbstractUrlViewController

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.support.WebContentGenerator
                extended by  org.springframework.web.servlet.mvc.AbstractController
                    extended by  org.springframework.web.servlet.mvc.AbstractUrlViewController
All Implemented Interfaces:
ApplicationContextAware, ServletContextAware, Controller
Direct Known Subclasses:
UrlFilenameViewController
public abstract class AbstractUrlViewController
extends AbstractController

Abstract base class for Controllers that return a view name based on the request URL.

Provides infrastructure for determining view names from URLs and configurable URL lookup. For information on the latter, see alwaysUseFullPath and urlDecode properties.

Since:
1.2.6
Author:
Juergen Hoeller
See Also:
setAlwaysUseFullPath(boolean), setUrlDecode(boolean)

Field Summary
Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator
METHOD_GET, METHOD_HEAD, METHOD_POST
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Constructor Summary
AbstractUrlViewController()
Method Summary
protected  UrlPathHelper getUrlPathHelper()
Return the UrlPathHelper to use for the resolution of lookup paths.
protected abstract  String getViewNameForRequest(HttpServletRequest request)
Return the name of the view to render for this request, based on the given lookup path.
protected  ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
Retrieves the URL path to use for lookup and delegates to getViewNameForRequest(javax.servlet.http.HttpServletRequest).
 void setAlwaysUseFullPath(boolean alwaysUseFullPath)
Set if URL lookup should always use full path within current servlet context.
 void setUrlDecode(boolean urlDecode)
Set if context path and request URI should be URL-decoded.
 void setUrlPathHelper(UrlPathHelper urlPathHelper)
Set the UrlPathHelper to use for the resolution of lookup paths.
Methods inherited from class org.springframework.web.servlet.mvc.AbstractController
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession
Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractUrlViewController

public AbstractUrlViewController()
Method Detail

setAlwaysUseFullPath

public void setAlwaysUseFullPath(boolean alwaysUseFullPath)
Set if URL lookup should always use full path within current servlet context. Else, the path within the current servlet mapping is used if applicable (i.e. in the case of a ".../*" servlet mapping in web.xml). Default is "false".

See Also:
UrlPathHelper.setAlwaysUseFullPath(boolean)

setUrlDecode

public void setUrlDecode(boolean urlDecode)
Set if context path and request URI should be URL-decoded. Both are returned undecoded by the Servlet API, in contrast to the servlet path.

Uses either the request encoding or the default encoding according to the Servlet spec (ISO-8859-1).

See Also:
UrlPathHelper.setUrlDecode(boolean)

setUrlPathHelper

public void setUrlPathHelper(UrlPathHelper urlPathHelper)
Set the UrlPathHelper to use for the resolution of lookup paths.

Use this to override the default UrlPathHelper with a custom subclass, or to share common UrlPathHelper settings across multiple MethodNameResolvers and HandlerMappings.

See Also:
AbstractUrlHandlerMapping.setUrlPathHelper(org.springframework.web.util.UrlPathHelper)

getUrlPathHelper

protected UrlPathHelper getUrlPathHelper()
Return the UrlPathHelper to use for the resolution of lookup paths.

handleRequestInternal

protected ModelAndView handleRequestInternal(HttpServletRequest request,
                                             HttpServletResponse response)
Retrieves the URL path to use for lookup and delegates to getViewNameForRequest(javax.servlet.http.HttpServletRequest).

Specified by:
handleRequestInternal in class AbstractController
See Also:
AbstractController.handleRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

getViewNameForRequest

protected abstract String getViewNameForRequest(HttpServletRequest request)
Return the name of the view to render for this request, based on the given lookup path. Called by handleRequestInternal(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse).

Parameters:
request - current HTTP request
Returns:
a view name for this request (never null)
See Also:
handleRequestInternal(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), setAlwaysUseFullPath(boolean), setUrlDecode(boolean)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractWizardFormController

org.springframework.web.servlet.mvc
Class AbstractWizardFormController

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.support.WebContentGenerator
                extended by  org.springframework.web.servlet.mvc.AbstractController
                    extended by  org.springframework.web.servlet.mvc.BaseCommandController
                        extended by  org.springframework.web.servlet.mvc.AbstractFormController
                            extended by  org.springframework.web.servlet.mvc.AbstractWizardFormController
All Implemented Interfaces:
ApplicationContextAware, ServletContextAware, Controller
Deprecated. as of Spring 3.0, in favor of annotated controllers

@Deprecated
public abstract class AbstractWizardFormController
extends AbstractFormController

Form controller for typical wizard-style workflows.

In contrast to classic forms, wizards have more than one form view page. Therefore, there are various actions instead of one single submit action:

  • finish: trying to leave the wizard successfully, that is, perform its final action, and thus requiring a valid state;
  • cancel: leaving the wizard without performing its final action, and thus without regard to the validity of its current state;
  • page change: showing another wizard page, e.g. the next or previous one, with regard to "dirty back" and "dirty forward".

Finish and cancel actions can be triggered by request parameters, named PARAM_FINISH ("_finish") and PARAM_CANCEL ("_cancel"), ignoring parameter values to allow for HTML buttons. The target page for page changes can be specified by PARAM_TARGET, appending the page number to the parameter name (e.g. "_target1"). The action parameters are recognized when triggered by image buttons too (via "_finish.x", "_abort.x", or "_target1.x").

The current page number will be stored in the session. It can also be specified as request parameter PARAM_PAGE ("_page") in order to properly handle usage of the back button in a browser: In this case, a submission will always contain the correct page number, even if the user submitted from an old view.

The page can only be changed if it validates correctly, except if a "dirty back" or "dirty forward" is allowed. At finish, all pages get validated again to guarantee a consistent state.

Note that a validator's default validate method is not executed when using this class! Rather, the validatePage(java.lang.Object, org.springframework.validation.Errors, int, boolean) implementation should call special validateXXX methods that the validator needs to provide, validating certain pieces of the object. These can be combined to validate the elements of individual pages.

Note: Page numbering starts with 0, to be able to pass an array consisting of the corresponding view names to the "pages" bean property.

Since:
25.04.2003
Author:
Juergen Hoeller
See Also:
setPages(java.lang.String[]),
validatePage(java.lang.Object, org.springframework.validation.Errors, int, boolean),
processFinish(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object, org.springframework.validation.BindException),
processCancel(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object, org.springframework.validation.BindException)

Field Summary
static String | PARAM_CANCEL Deprecated. Parameter triggering the cancel action.
static String | PARAM_FINISH Deprecated. Parameter triggering the finish action.
static String | PARAM_PAGE Deprecated. Parameter specifying the current page as value.
static String | PARAM_TARGET Deprecated. Parameter specifying the target page, appending the page number to the name.
Fields inherited from class org.springframework.web.servlet.mvc.BaseCommandController
DEFAULT_COMMAND_NAME
Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator
METHOD_GET, METHOD_HEAD, METHOD_POST
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Constructor Summary
AbstractWizardFormController()
Deprecated. Create a new AbstractWizardFormController.
Method Summary
protected int | getCurrentPage(HttpServletRequest request) Deprecated. Return the current page number.
protected int | getInitialPage(HttpServletRequest request) Deprecated. Return the initial page of the wizard, that is, the page shown at wizard startup.
protected int | getInitialPage(HttpServletRequest request, Object command) Deprecated. Return the initial page of the wizard, that is, the page shown at wizard startup.
String | getPageAttribute() Deprecated. Return the name of the page attribute in the model.
protected int | getPageCount() Deprecated. Return the number of wizard pages.
protected int | getPageCount(HttpServletRequest request, Object command) Deprecated. Return the page count for this wizard form controller.
String[] | getPages() Deprecated. Return the wizard pages, i.e.
protected String | getPageSessionAttributeName() Deprecated. Return the name of the HttpSession attribute that holds the page object for this wizard form controller.
protected String | getPageSessionAttributeName(HttpServletRequest request) Deprecated. Return the name of the HttpSession attribute that holds the page object for this wizard form controller.
protected int | getTargetPage(HttpServletRequest request, int currentPage) Deprecated. Return the target page specified in the request.
protected int | getTargetPage(HttpServletRequest request, Object command, Errors errors, int currentPage) Deprecated. Return the target page specified in the request.
protected String | getViewName(HttpServletRequest request, Object command, int page) Deprecated. Return the name of the view for the specified page of this wizard form controller.
protected ModelAndView | handleInvalidSubmit(HttpServletRequest request, HttpServletResponse response) Deprecated. Handle an invalid submit request, e.g.
boolean | isAllowDirtyBack() Deprecated. Return whether "dirty back" is allowed.
boolean | isAllowDirtyForward() Deprecated. Return whether "dirty forward" is allowed.
protected boolean | isCancelRequest(HttpServletRequest request) Deprecated. Determine whether the incoming request is a request to cancel the processing of the current form.
protected boolean | isFinishRequest(HttpServletRequest request) Deprecated. Determine whether the incoming request is a request to finish the processing of the current form.
protected boolean | isFormSubmission(HttpServletRequest request) Deprecated. Consider an explicit finish or cancel request as a form submission too.
protected void | onBindAndValidate(HttpServletRequest request, Object command, BindException errors) Deprecated. Calls page-specific onBindAndValidate method.
protected void | onBindAndValidate(HttpServletRequest request, Object command, BindException errors, int page) Deprecated. Callback for custom post-processing in terms of binding and validation.
protected void | postProcessPage(HttpServletRequest request, Object command, Errors errors, int page) Deprecated. Post-process the given page after binding and validation, potentially updating its command object.
protected ModelAndView | processCancel(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) Deprecated. Template method for processing the cancel action of this wizard.
protected abstract ModelAndView | processFinish(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) Deprecated. Template method for processing the final action of this wizard.
protected ModelAndView | processFormSubmission(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) Deprecated. Apply wizard workflow: finish, cancel, page change.
protected Map | referenceData(HttpServletRequest request, int page) Deprecated. Create a reference data map for the given request, consisting of bean name/bean instance pairs as expected by ModelAndView.
protected Map | referenceData(HttpServletRequest request, Object command, Errors errors) Deprecated. Calls page-specific referenceData method.
protected Map | referenceData(HttpServletRequest request, Object command, Errors errors, int page) Deprecated. Create a reference data map for the given request, consisting of bean name/bean instance pairs as expected by ModelAndView.
void | setAllowDirtyBack(boolean allowDirtyBack) Deprecated. Set if "dirty back" is allowed, that is, if moving to a former wizard page is allowed in case of validation errors for the current page.
void | setAllowDirtyForward(boolean allowDirtyForward) Deprecated. Set if "dirty forward" is allowed, that is, if moving to a later wizard page is allowed in case of validation errors for the current page.
void | setPageAttribute(String pageAttribute) Deprecated. Set the name of the page attribute in the model, containing an Integer with the current page number.
void | setPages(String[] pages) Deprecated. Set the wizard pages, i.e.
protected ModelAndView | showForm(HttpServletRequest request, HttpServletResponse response, BindException errors) Deprecated. Show the first page as form view.
protected ModelAndView | showPage(HttpServletRequest request, BindException errors, int page) Deprecated. Prepare the form model and view, including reference and error data, for the given page.
protected void | validatePage(Object command, Errors errors, int page) Deprecated. Template method for custom validation logic for individual pages.
protected void | validatePage(Object command, Errors errors, int page, boolean finish) Deprecated. Template method for custom validation logic for individual pages.
Methods inherited from class org.springframework.web.servlet.mvc.AbstractFormController
currentFormObject, formBackingObject, getCommand, getErrorsForNewForm, getFormSessionAttributeName, getFormSessionAttributeName, handleRequestInternal, isBindOnNewForm, isSessionForm, onBindOnNewForm, onBindOnNewForm, setBindOnNewForm, setSessionForm, showForm, showForm, showNewForm
Methods inherited from class org.springframework.web.servlet.mvc.BaseCommandController
bindAndValidate, checkCommand, createBinder, createCommand, getBindingErrorProcessor, getCommandClass, getCommandName, getMessageCodesResolver, getPropertyEditorRegistrars, getValidator, getValidators, getWebBindingInitializer, initApplicationContext, initBinder, isValidateOnBinding, onBind, onBind, prepareBinder, setBindingErrorProcessor, setCommandClass, setCommandName, setMessageCodesResolver, setPropertyEditorRegistrar, setPropertyEditorRegistrars, setValidateOnBinding, setValidator, setValidators, setWebBindingInitializer, suppressBinding, suppressValidation, suppressValidation, suppressValidation, useDirectFieldAccess
Methods inherited from class org.springframework.web.servlet.mvc.AbstractController
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession
Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

PARAM_FINISH

public static final String PARAM_FINISH
Deprecated.
Parameter triggering the finish action. Can be called from any wizard page!

See Also:
Constant Field Values

PARAM_CANCEL

public static final String PARAM_CANCEL
Deprecated.
Parameter triggering the cancel action. Can be called from any wizard page!

See Also:
Constant Field Values

PARAM_TARGET

public static final String PARAM_TARGET
Deprecated.
Parameter specifying the target page, appending the page number to the name.

See Also:
Constant Field Values

PARAM_PAGE

public static final String PARAM_PAGE
Deprecated.
Parameter specifying the current page as value. Not necessary on form pages, but allows to properly handle usage of the back button.

See Also:
setPageAttribute(java.lang.String), Constant Field Values
Constructor Detail

AbstractWizardFormController

public AbstractWizardFormController()
Deprecated.
Create a new AbstractWizardFormController.

"sessionForm" is automatically turned on, "validateOnBinding" turned off, and "cacheSeconds" set to 0 by the base class (-> no caching for all form controllers).

Method Detail

setPages

public final void setPages(String[] pages)
Deprecated.
Set the wizard pages, i.e. the view names for the pages. The array index is interpreted as page number.

Parameters:
pages - view names for the pages

getPages

public final String[] getPages()
Deprecated.
Return the wizard pages, i.e. the view names for the pages. The array index corresponds to the page number.

Note that a concrete wizard form controller might override getViewName(HttpServletRequest, Object, int) to determine the view name for each page dynamically.

See Also:
getViewName(javax.servlet.http.HttpServletRequest, Object, int)

getPageCount

protected final int getPageCount()
Deprecated.
Return the number of wizard pages. Useful to check whether the last page has been reached.

Note that a concrete wizard form controller might override getPageCount(HttpServletRequest, Object) to determine the page count dynamically. The default implementation of that extended getPageCount variant returns the static page count as determined by this getPageCount() method.

See Also:
getPageCount(javax.servlet.http.HttpServletRequest, Object)

setPageAttribute

public final void setPageAttribute(String pageAttribute)
Deprecated.
Set the name of the page attribute in the model, containing an Integer with the current page number.

This will be necessary for single views rendering multiple view pages. It also allows for specifying the optional "_page" parameter.

Parameters:
pageAttribute - name of the page attribute
See Also:
PARAM_PAGE

getPageAttribute

public final String getPageAttribute()
Deprecated.
Return the name of the page attribute in the model.

setAllowDirtyBack

public final void setAllowDirtyBack(boolean allowDirtyBack)
Deprecated.
Set if "dirty back" is allowed, that is, if moving to a former wizard page is allowed in case of validation errors for the current page.

Parameters:
allowDirtyBack - if "dirty back" is allowed

isAllowDirtyBack

public final boolean isAllowDirtyBack()
Deprecated.
Return whether "dirty back" is allowed.

setAllowDirtyForward

public final void setAllowDirtyForward(boolean allowDirtyForward)
Deprecated.
Set if "dirty forward" is allowed, that is, if moving to a later wizard page is allowed in case of validation errors for the current page.

Parameters:
allowDirtyForward - if "dirty forward" is allowed

isAllowDirtyForward

public final boolean isAllowDirtyForward()
Deprecated.
Return whether "dirty forward" is allowed.

onBindAndValidate

protected final void onBindAndValidate(HttpServletRequest request,
                                       Object command,
                                       BindException errors)
                                throws Exception
Deprecated.
Calls page-specific onBindAndValidate method.

Overrides:
onBindAndValidate in class BaseCommandController
Parameters:
request - current HTTP request
command - the command object, still allowing for further binding
errors - validation errors holder, allowing for additional custom validation
Throws:
Exception - in case of invalid state or arguments
See Also:
BaseCommandController.bindAndValidate(javax.servlet.http.HttpServletRequest, java.lang.Object), Errors

onBindAndValidate

protected void onBindAndValidate(HttpServletRequest request,
                                 Object command,
                                 BindException errors,
                                 int page)
                          throws Exception
Deprecated.
Callback for custom post-processing in terms of binding and validation. Called on each submit, after standard binding but before page-specific validation of this wizard form controller.

Note: AbstractWizardFormController does not perform standand validation on binding but rather applies page-specific validation on processing the form submission.

Parameters:
request - current HTTP request
command - bound command
errors - Errors instance for additional custom validation
page - current wizard page
Throws:
Exception - in case of invalid state or arguments
See Also:
BaseCommandController.bindAndValidate(javax.servlet.http.HttpServletRequest, java.lang.Object), processFormSubmission(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object, org.springframework.validation.BindException), Errors

isFormSubmission

protected boolean isFormSubmission(HttpServletRequest request)
Deprecated.
Consider an explicit finish or cancel request as a form submission too.

Overrides:
isFormSubmission in class AbstractFormController
Parameters:
request - current HTTP request
Returns:
if the request represents a form submission
See Also:
isFinishRequest(javax.servlet.http.HttpServletRequest), isCancelRequest(javax.servlet.http.HttpServletRequest)

referenceData

protected final Map referenceData(HttpServletRequest request,
                                  Object command,
                                  Errors errors)
                           throws Exception
Deprecated.
Calls page-specific referenceData method.

Overrides:
referenceData in class AbstractFormController
Parameters:
request - current HTTP request
command - form object with request parameters bound onto it
errors - validation errors holder
Returns:
a Map with reference data entries, or null if none
Throws:
Exception - in case of invalid state or arguments
See Also:
ModelAndView

referenceData

protected Map referenceData(HttpServletRequest request,
                            Object command,
                            Errors errors,
                            int page)
                     throws Exception
Deprecated.
Create a reference data map for the given request, consisting of bean name/bean instance pairs as expected by ModelAndView.

The default implementation delegates to referenceData(HttpServletRequest, int). Subclasses can override this to set reference data used in the view.

Parameters:
request - current HTTP request
command - form object with request parameters bound onto it
errors - validation errors holder
page - current wizard page
Returns:
a Map with reference data entries, or null if none
Throws:
Exception - in case of invalid state or arguments
See Also:
referenceData(HttpServletRequest, int), ModelAndView

referenceData

protected Map referenceData(HttpServletRequest request,
                            int page)
                     throws Exception
Deprecated.
Create a reference data map for the given request, consisting of bean name/bean instance pairs as expected by ModelAndView.

The default implementation returns null. Subclasses can override this to set reference data used in the view.

Parameters:
request - current HTTP request
page - current wizard page
Returns:
a Map with reference data entries, or null if none
Throws:
Exception - in case of invalid state or arguments
See Also:
ModelAndView

showForm

protected ModelAndView showForm(HttpServletRequest request,
                                HttpServletResponse response,
                                BindException errors)
                         throws Exception
Deprecated.
Show the first page as form view.

This can be overridden in subclasses, e.g. to prepare wizard-specific error views in case of an Exception.

Specified by:
showForm in class AbstractFormController
Parameters:
request - current HTTP request
response - current HTTP response
errors - validation errors holder
Returns:
the prepared form view, or null if handled directly
Throws:
Exception - in case of invalid state or arguments
See Also:
AbstractFormController.showForm(HttpServletRequest, BindException, String),
Errors,
BindException.getModel(),
AbstractFormController.referenceData(HttpServletRequest, Object, Errors),
SimpleFormController.setFormView(java.lang.String)

showPage

protected final ModelAndView showPage(HttpServletRequest request,
                                      BindException errors,
                                      int page)
                               throws Exception
Deprecated.
Prepare the form model and view, including reference and error data, for the given page. Can be used in processFinish(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object, org.springframework.validation.BindException) implementations, to show the corresponding page in case of validation errors.

Parameters:
request - current HTTP request
errors - validation errors holder
page - number of page to show
Returns:
the prepared form view
Throws:
Exception - in case of invalid state or arguments

getPageCount

protected int getPageCount(HttpServletRequest request,
                           Object command)
Deprecated.
Return the page count for this wizard form controller. The default implementation delegates to getPageCount().

Can be overridden to dynamically adapt the page count.

Parameters:
request - current HTTP request
command - the command object as returned by formBackingObject
Returns:
the current page count
See Also:
getPageCount()

getViewName

protected String getViewName(HttpServletRequest request,
                             Object command,
                             int page)
Deprecated.
Return the name of the view for the specified page of this wizard form controller.

The default implementation takes the view name from the getPages() array.

Can be overridden to dynamically switch the page view or to return view names for dynamically defined pages.

Parameters:
request - current HTTP request
command - the command object as returned by formBackingObject
page - the current page number
Returns:
the current page count
See Also:
getPageCount()

getInitialPage

protected int getInitialPage(HttpServletRequest request,
                             Object command)
Deprecated.
Return the initial page of the wizard, that is, the page shown at wizard startup.

The default implementation delegates to getInitialPage(HttpServletRequest).

Parameters:
request - current HTTP request
command - the command object as returned by formBackingObject
Returns:
the initial page number
See Also:
getInitialPage(HttpServletRequest), AbstractFormController.formBackingObject(javax.servlet.http.HttpServletRequest)

getInitialPage

protected int getInitialPage(HttpServletRequest request)
Deprecated.
Return the initial page of the wizard, that is, the page shown at wizard startup.

The default implementation returns 0 for first page.

Parameters:
request - current HTTP request
Returns:
the initial page number

getPageSessionAttributeName

protected String getPageSessionAttributeName(HttpServletRequest request)
Deprecated.
Return the name of the HttpSession attribute that holds the page object for this wizard form controller.

The default implementation delegates to the getPageSessionAttributeName() variant without arguments.

Parameters:
request - current HTTP request
Returns:
the name of the form session attribute, or null if not in session form mode
See Also:
getPageSessionAttributeName(javax.servlet.http.HttpServletRequest),
AbstractFormController.getFormSessionAttributeName(javax.servlet.http.HttpServletRequest),
HttpSession.getAttribute(java.lang.String)

getPageSessionAttributeName

protected String getPageSessionAttributeName()
Deprecated.
Return the name of the HttpSession attribute that holds the page object for this wizard form controller.

Default is an internal name, of no relevance to applications, as the form session attribute is not usually accessed directly. Can be overridden to use an application-specific attribute name, which allows other code to access the session attribute directly.

Returns:
the name of the page session attribute
See Also:
AbstractFormController.getFormSessionAttributeName(javax.servlet.http.HttpServletRequest), HttpSession.getAttribute(java.lang.String)

handleInvalidSubmit

protected ModelAndView handleInvalidSubmit(HttpServletRequest request,
                                           HttpServletResponse response)
                                    throws Exception
Deprecated.
Handle an invalid submit request, e.g. when in session form mode but no form object was found in the session (like in case of an invalid resubmit by the browser).

The default implementation for wizard form controllers simply shows the initial page of a new wizard form. If you want to show some "invalid submit" message, you need to override this method.

Overrides:
handleInvalidSubmit in class AbstractFormController
Parameters:
request - current HTTP request
response - current HTTP response
Returns:
a prepared view, or null if handled directly
Throws:
Exception - in case of errors
See Also:
AbstractFormController.showNewForm(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), AbstractFormController.setBindOnNewForm(boolean)

processFormSubmission

protected final ModelAndView processFormSubmission(HttpServletRequest request,
                                                   HttpServletResponse response,
                                                   Object command,
                                                   BindException errors)
                                            throws Exception
Deprecated.
Apply wizard workflow: finish, cancel, page change.

Specified by:
processFormSubmission in class AbstractFormController
Parameters:
request - current servlet request
response - current servlet response
command - form object with request parameters bound onto it
errors - holder without errors (subclass can add errors if it wants to)
Returns:
the prepared model and view, or null
Throws:
Exception - in case of errors
See Also:
AbstractFormController.handleRequestInternal(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse),
AbstractFormController.isFormSubmission(javax.servlet.http.HttpServletRequest),
AbstractFormController.showForm(HttpServletRequest, HttpServletResponse, BindException),
Errors,
BindException.getModel()

getCurrentPage

protected int getCurrentPage(HttpServletRequest request)
Deprecated.
Return the current page number. Used by processFormSubmission(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object, org.springframework.validation.BindException).

The default implementation checks the page session attribute. Subclasses can override this for customized page determination.

Parameters:
request - current HTTP request
Returns:
the current page number
See Also:
getPageSessionAttributeName()

isFinishRequest

protected boolean isFinishRequest(HttpServletRequest request)
Deprecated.
Determine whether the incoming request is a request to finish the processing of the current form.

By default, this method returns true if a parameter matching the "_finish" key is present in the request, otherwise it returns false. Subclasses may override this method to provide custom logic to detect a finish request.

The parameter is recognized both when sent as a plain parameter ("_finish") or when triggered by an image button ("_finish.x").

Parameters:
request - current HTTP request
Returns:
whether the request indicates to finish form processing
See Also:
PARAM_FINISH

isCancelRequest

protected boolean isCancelRequest(HttpServletRequest request)
Deprecated.
Determine whether the incoming request is a request to cancel the processing of the current form.

By default, this method returns true if a parameter matching the "_cancel" key is present in the request, otherwise it returns false. Subclasses may override this method to provide custom logic to detect a cancel request.

The parameter is recognized both when sent as a plain parameter ("_cancel") or when triggered by an image button ("_cancel.x").

Parameters:
request - current HTTP request
Returns:
whether the request indicates to cancel form processing
See Also:
PARAM_CANCEL

getTargetPage

protected int getTargetPage(HttpServletRequest request,
                            Object command,
                            Errors errors,
                            int currentPage)
Deprecated.
Return the target page specified in the request.

The default implementation delegates to getTargetPage(HttpServletRequest, int). Subclasses can override this for customized target page determination.

Parameters:
request - current HTTP request
command - form object with request parameters bound onto it
errors - validation errors holder
currentPage - the current page, to be returned as fallback if no target page specified
Returns:
the page specified in the request, or current page if not found
See Also:
getTargetPage(HttpServletRequest, int)

getTargetPage

protected int getTargetPage(HttpServletRequest request,
                            int currentPage)
Deprecated.
Return the target page specified in the request.

The default implementation examines "_target" parameter (e.g. "_target1"). Subclasses can override this for customized target page determination.

Parameters:
request - current HTTP request
currentPage - the current page, to be returned as fallback if no target page specified
Returns:
the page specified in the request, or current page if not found
See Also:
PARAM_TARGET

validatePage

protected void validatePage(Object command,
                            Errors errors,
                            int page,
                            boolean finish)
Deprecated.
Template method for custom validation logic for individual pages. The default implementation calls validatePage(Object, Errors, int).

Implementations will typically call fine-granular validateXXX methods of this instance's Validator, combining them to validation of the corresponding pages. The Validator's default validate method will not be called by a wizard form controller!

Parameters:
command - form object with the current wizard state
errors - validation errors holder
page - number of page to validate
finish - whether this method is called during final revalidation on finish (else, it is called for validating the current page)
See Also:
validatePage(Object, Errors, int), Validator.validate(java.lang.Object, org.springframework.validation.Errors)

validatePage

protected void validatePage(Object command,
                            Errors errors,
                            int page)
Deprecated.
Template method for custom validation logic for individual pages. The default implementation is empty.

Implementations will typically call fine-granular validateXXX methods of this instance's validator, combining them to validation of the corresponding pages. The validator's default validate method will not be called by a wizard form controller!

Parameters:
command - form object with the current wizard state
errors - validation errors holder
page - number of page to validate
See Also:
Validator.validate(java.lang.Object, org.springframework.validation.Errors)

postProcessPage

protected void postProcessPage(HttpServletRequest request,
                               Object command,
                               Errors errors,
                               int page)
                        throws Exception
Deprecated.
Post-process the given page after binding and validation, potentially updating its command object. The passed-in request might contain special parameters sent by the page.

Only invoked when displaying another page or the same page again, not when finishing or cancelling.

Parameters:
request - current HTTP request
command - form object with request parameters bound onto it
errors - validation errors holder
page - number of page to post-process
Throws:
Exception - in case of invalid state or arguments

processFinish

protected abstract ModelAndView processFinish(HttpServletRequest request,
                                              HttpServletResponse response,
                                              Object command,
                                              BindException errors)
                                       throws Exception
Deprecated.
Template method for processing the final action of this wizard.

Call errors.getModel() to populate the ModelAndView model with the command and the Errors instance, under the specified command name, as expected by the "spring:bind" tag.

You can call the showPage(javax.servlet.http.HttpServletRequest, org.springframework.validation.BindException, int) method to return back to the wizard, in case of last-minute validation errors having been found that you would like to present to the user within the original wizard form.

Parameters:
request - current HTTP request
response - current HTTP response
command - form object with the current wizard state
errors - validation errors holder
Returns:
the finish view
Throws:
Exception - in case of invalid state or arguments
See Also:
Errors, BindException.getModel(), showPage(javax.servlet.http.HttpServletRequest, org.springframework.validation.BindException, int)

processCancel

protected ModelAndView processCancel(HttpServletRequest request,
                                     HttpServletResponse response,
                                     Object command,
                                     BindException errors)
                              throws Exception
Deprecated.
Template method for processing the cancel action of this wizard.

The default implementation throws a ServletException, saying that a cancel operation is not supported by this controller. Thus, you do not need to implement this template method if you do not support a cancel operation.

Call errors.getModel() to populate the ModelAndView model with the command and the Errors instance, under the specified command name, as expected by the "spring:bind" tag.

Parameters:
request - current HTTP request
response - current HTTP response
command - form object with the current wizard state
errors - Errors instance containing errors
Returns:
the cancellation view
Throws:
Exception - in case of invalid state or arguments
See Also:
Errors, BindException.getModel()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BaseCommandController

org.springframework.web.servlet.mvc
Class BaseCommandController

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.support.WebContentGenerator
                extended by  org.springframework.web.servlet.mvc.AbstractController
                    extended by  org.springframework.web.servlet.mvc.BaseCommandController
All Implemented Interfaces:
ApplicationContextAware, ServletContextAware, Controller
Direct Known Subclasses:
AbstractCommandController, AbstractFormController
Deprecated. as of Spring 3.0, in favor of annotated controllers

@Deprecated
public abstract class BaseCommandController
extends AbstractController

Controller implementation which creates an object (the command object) on receipt of a request and attempts to populate this object with request parameters.

This controller is the base for all controllers wishing to populate JavaBeans based on request parameters, validate the content of such JavaBeans using Validators and use custom editors (in the form of PropertyEditors) to transform objects into strings and vice versa, for example. Three notions are mentioned here:

Command class:
An instance of the command class will be created for each request and populated with request parameters. A command class can basically be any Java class; the only requirement is a no-arg constructor. The command class should preferably be a JavaBean in order to be able to populate bean properties with request parameters.

Populating using request parameters and PropertyEditors:
Upon receiving a request, any BaseCommandController will attempt to fill the command object using the request parameters. This is done using the typical and well-known JavaBeans property notation. When a request parameter named 'firstName' exists, the framework will attempt to call setFirstName([value]) passing the value of the parameter. Nested properties are of course supported. For instance a parameter named 'address.city' will result in a getAddress().setCity([value]) call on the command class.

It's important to realise that you are not limited to String arguments in your JavaBeans. Using the PropertyEditor-notion as supplied by the java.beans package, you will be able to transform Strings to Objects and the other way around. For instance setLocale(Locale loc) is perfectly possible for a request parameter named locale having a value of en, as long as you register the appropriate PropertyEditor in the Controller (see initBinder() for more information on that matter.

Validators: After the controller has successfully populated the command object with parameters from the request, it will use any configured validators to validate the object. Validation results will be put in a Errors object which can be used in a View to render any input problems.

Workflow (and that defined by superclass):
Since this class is an abstract base class for more specific implementation, it does not override the handleRequestInternal() method and also has no actual workflow. Implementing classes like AbstractFormController, AbstractcommandController, SimpleFormController and AbstractWizardFormController provide actual functionality and workflow. More information on workflow performed by superclasses can be found here.

Exposed configuration properties (and those defined by superclass):

name | default | description
commandName | command | the name to use when binding the instantiated command class to the request
commandClass | null | the class to use upon receiving a request and which to fill using the request parameters. What object is used and whether or not it should be created is defined by extending classes and their configuration properties and methods.
validators | null | Array of Validator beans. The validator will be called at appropriate places in the workflow of subclasses (have a look at those for more info) to validate the command object.
validator | null | Short-form property for setting only one Validator bean (usually passed in using a <ref bean="beanId"/> property.
validateOnBinding | true | Indicates whether or not to validate the command object after the object has been populated with request parameters.

Author:
Rod Johnson, Juergen Hoeller

Field Summary
static String DEFAULT_COMMAND_NAME
Deprecated. Default command name used for binding command objects: "command"
Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator
METHOD_GET, METHOD_HEAD, METHOD_POST
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Constructor Summary
BaseCommandController()
Deprecated.
Method Summary
protected ServletRequestDataBinder | bindAndValidate(HttpServletRequest request, Object command) Deprecated. Bind the parameters of the given request to the given command object.
protected boolean | checkCommand(Object command) Deprecated. Check if the given command object is a valid for this controller, i.e.
protected ServletRequestDataBinder | createBinder(HttpServletRequest request, Object command) Deprecated. Create a new binder instance for the given command and request.
protected Object | createCommand() Deprecated. Create a new command instance for the command class of this controller.
BindingErrorProcessor | getBindingErrorProcessor() Deprecated. Return the strategy to use for processing binding errors (if any).
protected Object | getCommand(HttpServletRequest request) Deprecated. Retrieve a command object for the given request.
Class | getCommandClass() Deprecated. Return the command class for this controller.
String | getCommandName() Deprecated. Return the name of the command in the model.
MessageCodesResolver | getMessageCodesResolver() Deprecated. Return the strategy to use for resolving errors into message codes (if any).
PropertyEditorRegistrar[] | getPropertyEditorRegistrars() Deprecated. Return the PropertyEditorRegistrars (if any) to be applied to every DataBinder that this controller uses.
Validator | getValidator() Deprecated. Return the primary Validator for this controller.
Validator[] | getValidators() Deprecated. Return the Validators for this controller.
WebBindingInitializer | getWebBindingInitializer() Deprecated. Return the WebBindingInitializer (if any) which will apply pre-configured configuration to every DataBinder that this controller uses.
protected void | initApplicationContext() Deprecated. Subclasses can override this for custom initialization behavior.
protected void | initBinder(HttpServletRequest request, ServletRequestDataBinder binder) Deprecated. Initialize the given binder instance, for example with custom editors.
boolean | isValidateOnBinding() Deprecated. Return if the Validator should get applied when binding.
protected void | onBind(HttpServletRequest request, Object command) Deprecated. Callback for custom post-processing in terms of binding.
protected void | onBind(HttpServletRequest request, Object command, BindException errors) Deprecated. Callback for custom post-processing in terms of binding.
protected void | onBindAndValidate(HttpServletRequest request, Object command, BindException errors) Deprecated. Callback for custom post-processing in terms of binding and validation.
protected void | prepareBinder(ServletRequestDataBinder binder) Deprecated. Prepare the given binder, applying the specified MessageCodesResolver, BindingErrorProcessor and PropertyEditorRegistrars (if any).
void | setBindingErrorProcessor(BindingErrorProcessor bindingErrorProcessor) Deprecated. Set the strategy to use for processing binding errors, that is, required field errors and PropertyAccessExceptions.
void | setCommandClass(Class commandClass) Deprecated. Set the command class for this controller.
void | setCommandName(String commandName) Deprecated. Set the name of the command in the model.
void | setMessageCodesResolver(MessageCodesResolver messageCodesResolver) Deprecated. Set the strategy to use for resolving errors into message codes.
void | setPropertyEditorRegistrar(PropertyEditorRegistrar propertyEditorRegistrar) Deprecated. Specify a single PropertyEditorRegistrar to be applied to every DataBinder that this controller uses.
void | setPropertyEditorRegistrars(PropertyEditorRegistrar[] propertyEditorRegistrars) Deprecated. Specify multiple PropertyEditorRegistrars to be applied to every DataBinder that this controller uses.
void | setValidateOnBinding(boolean validateOnBinding) Deprecated. Set if the Validator should get applied when binding.
void | setValidator(Validator validator) Deprecated. Set the primary Validator for this controller.
void | setValidators(Validator[] validators) Deprecated. Set the Validators for this controller.
void | setWebBindingInitializer(WebBindingInitializer webBindingInitializer) Deprecated. Specify a WebBindingInitializer which will apply pre-configured configuration to every DataBinder that this controller uses.
protected boolean | suppressBinding(HttpServletRequest request) Deprecated. Return whether to suppress binding for the given request.
protected boolean | suppressValidation(HttpServletRequest request) Deprecated. as of Spring 2.0.4, in favor of the suppressValidation(HttpServletRequest, Object) variant
protected boolean | suppressValidation(HttpServletRequest request, Object command) Deprecated. Return whether to suppress validation for the given request.
protected boolean | suppressValidation(HttpServletRequest request, Object command, BindException errors) Deprecated. Return whether to suppress validation for the given request.
protected boolean | useDirectFieldAccess() Deprecated. Determine whether to use direct field access instead of bean property access.
Methods inherited from class org.springframework.web.servlet.mvc.AbstractController
handleRequest, handleRequestInternal, isSynchronizeOnSession, setSynchronizeOnSession
Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_COMMAND_NAME

public static final String DEFAULT_COMMAND_NAME
Deprecated.
Default command name used for binding command objects: "command"

See Also:
Constant Field Values
Constructor Detail

BaseCommandController

public BaseCommandController()
Deprecated.
Method Detail

setCommandName

public final void setCommandName(String commandName)
Deprecated.
Set the name of the command in the model. The command object will be included in the model under this name.

getCommandName

public final String getCommandName()
Deprecated.
Return the name of the command in the model.

setCommandClass

public final void setCommandClass(Class commandClass)
Deprecated.
Set the command class for this controller. An instance of this class gets populated and validated on each request.

getCommandClass

public final Class getCommandClass()
Deprecated.
Return the command class for this controller.

setValidator

public final void setValidator(Validator validator)
Deprecated.
Set the primary Validator for this controller. The Validator must support the specified command class. If there are one or more existing validators set already when this method is called, only the specified validator will be kept. Use setValidators(Validator[]) to set multiple validators.

getValidator

public final Validator getValidator()
Deprecated.
Return the primary Validator for this controller.

setValidators

public final void setValidators(Validator[] validators)
Deprecated.
Set the Validators for this controller. The Validator must support the specified command class.

getValidators

public final Validator[] getValidators()
Deprecated.
Return the Validators for this controller.

setValidateOnBinding

public final void setValidateOnBinding(boolean validateOnBinding)
Deprecated.
Set if the Validator should get applied when binding.

isValidateOnBinding

public final boolean isValidateOnBinding()
Deprecated.
Return if the Validator should get applied when binding.

setMessageCodesResolver

public final void setMessageCodesResolver(MessageCodesResolver messageCodesResolver)
Deprecated.
Set the strategy to use for resolving errors into message codes. Applies the given strategy to all data binders used by this controller.

Default is null, i.e. using the default strategy of the data binder.

See Also:
createBinder(javax.servlet.http.HttpServletRequest, java.lang.Object), DataBinder.setMessageCodesResolver(org.springframework.validation.MessageCodesResolver)

getMessageCodesResolver

public final MessageCodesResolver getMessageCodesResolver()
Deprecated.
Return the strategy to use for resolving errors into message codes (if any).

setBindingErrorProcessor

public final void setBindingErrorProcessor(BindingErrorProcessor bindingErrorProcessor)
Deprecated.
Set the strategy to use for processing binding errors, that is, required field errors and PropertyAccessExceptions.

Default is null, that is, using the default strategy of the data binder.

See Also:
createBinder(javax.servlet.http.HttpServletRequest, java.lang.Object), DataBinder.setBindingErrorProcessor(org.springframework.validation.BindingErrorProcessor)

getBindingErrorProcessor

public final BindingErrorProcessor getBindingErrorProcessor()
Deprecated.
Return the strategy to use for processing binding errors (if any).

setPropertyEditorRegistrar

public final void setPropertyEditorRegistrar(PropertyEditorRegistrar propertyEditorRegistrar)
Deprecated.
Specify a single PropertyEditorRegistrar to be applied to every DataBinder that this controller uses.

Allows for factoring out the registration of PropertyEditors to separate objects, as an alternative to initBinder(javax.servlet.http.HttpServletRequest, org.springframework.web.bind.ServletRequestDataBinder).

See Also:
initBinder(javax.servlet.http.HttpServletRequest, org.springframework.web.bind.ServletRequestDataBinder)

setPropertyEditorRegistrars

public final void setPropertyEditorRegistrars(PropertyEditorRegistrar[] propertyEditorRegistrars)
Deprecated.
Specify multiple PropertyEditorRegistrars to be applied to every DataBinder that this controller uses.

Allows for factoring out the registration of PropertyEditors to separate objects, as an alternative to initBinder(javax.servlet.http.HttpServletRequest, org.springframework.web.bind.ServletRequestDataBinder).

See Also:
initBinder(javax.servlet.http.HttpServletRequest, org.springframework.web.bind.ServletRequestDataBinder)

getPropertyEditorRegistrars

public final PropertyEditorRegistrar[] getPropertyEditorRegistrars()
Deprecated.
Return the PropertyEditorRegistrars (if any) to be applied to every DataBinder that this controller uses.

setWebBindingInitializer

public final void setWebBindingInitializer(WebBindingInitializer webBindingInitializer)
Deprecated.
Specify a WebBindingInitializer which will apply pre-configured configuration to every DataBinder that this controller uses.

Allows for factoring out the entire binder configuration to separate objects, as an alternative to initBinder(javax.servlet.http.HttpServletRequest, org.springframework.web.bind.ServletRequestDataBinder).

getWebBindingInitializer

public final WebBindingInitializer getWebBindingInitializer()
Deprecated.
Return the WebBindingInitializer (if any) which will apply pre-configured configuration to every DataBinder that this controller uses.

initApplicationContext

protected void initApplicationContext()
Deprecated.
Description copied from class: ApplicationObjectSupport
Subclasses can override this for custom initialization behavior.

The default implementation is empty. Called by ApplicationObjectSupport.initApplicationContext(org.springframework.context.ApplicationContext).

Overrides:
initApplicationContext in class ApplicationObjectSupport
See Also:
ApplicationObjectSupport.setApplicationContext(org.springframework.context.ApplicationContext)

getCommand

protected Object getCommand(HttpServletRequest request)
                     throws Exception
Deprecated.
Retrieve a command object for the given request.

The default implementation calls createCommand(). Subclasses can override this.

Parameters:
request - current HTTP request
Returns:
object command to bind onto
Throws:
Exception - if the command object could not be obtained
See Also:
createCommand()

createCommand

protected final Object createCommand()
                              throws Exception
Deprecated.
Create a new command instance for the command class of this controller.

This implementation uses BeanUtils.instantiateClass, so the command needs to have a no-arg constructor (supposed to be public, but not required to).

Returns:
the new command instance
Throws:
Exception - if the command object could not be instantiated
See Also:
BeanUtils.instantiateClass(Class)

checkCommand

protected final boolean checkCommand(Object command)
Deprecated.
Check if the given command object is a valid for this controller, i.e. its command class.

Parameters:
command - the command object to check
Returns:
if the command object is valid for this controller

bindAndValidate

protected final ServletRequestDataBinder bindAndValidate(HttpServletRequest request,
                                                         Object command)
                                                  throws Exception
Deprecated.
Bind the parameters of the given request to the given command object.

Parameters:
request - current HTTP request
command - the command to bind onto
Returns:
the ServletRequestDataBinder instance for additional custom validation
Throws:
Exception - in case of invalid state or arguments

suppressBinding

protected boolean suppressBinding(HttpServletRequest request)
Deprecated.
Return whether to suppress binding for the given request.

The default implementation always returns "false". Can be overridden in subclasses to suppress validation, for example, if a special request parameter is set.

Parameters:
request - current HTTP request
Returns:
whether to suppress binding for the given request
See Also:
suppressValidation(javax.servlet.http.HttpServletRequest, java.lang.Object, org.springframework.validation.BindException)

createBinder

protected ServletRequestDataBinder createBinder(HttpServletRequest request,
                                                Object command)
                                         throws Exception
Deprecated.
Create a new binder instance for the given command and request.

Called by bindAndValidate(javax.servlet.http.HttpServletRequest, java.lang.Object). Can be overridden to plug in custom ServletRequestDataBinder instances.

The default implementation creates a standard ServletRequestDataBinder and invokes prepareBinder(org.springframework.web.bind.ServletRequestDataBinder) and initBinder(javax.servlet.http.HttpServletRequest, org.springframework.web.bind.ServletRequestDataBinder).

Note that neither prepareBinder(org.springframework.web.bind.ServletRequestDataBinder) nor initBinder(javax.servlet.http.HttpServletRequest, org.springframework.web.bind.ServletRequestDataBinder) will be invoked automatically if you override this method! Call those methods at appropriate points of your overridden method.

Parameters:
request - current HTTP request
command - the command to bind onto
Returns:
the new binder instance
Throws:
Exception - in case of invalid state or arguments
See Also:
bindAndValidate(javax.servlet.http.HttpServletRequest, java.lang.Object),
prepareBinder(org.springframework.web.bind.ServletRequestDataBinder),
initBinder(javax.servlet.http.HttpServletRequest, org.springframework.web.bind.ServletRequestDataBinder)

prepareBinder

protected final void prepareBinder(ServletRequestDataBinder binder)
Deprecated.
Prepare the given binder, applying the specified MessageCodesResolver, BindingErrorProcessor and PropertyEditorRegistrars (if any). Called by createBinder(javax.servlet.http.HttpServletRequest, java.lang.Object).

Parameters:
binder - the new binder instance
See Also:
createBinder(javax.servlet.http.HttpServletRequest, java.lang.Object),
setMessageCodesResolver(org.springframework.validation.MessageCodesResolver),
setBindingErrorProcessor(org.springframework.validation.BindingErrorProcessor)

useDirectFieldAccess

protected boolean useDirectFieldAccess()
Deprecated.
Determine whether to use direct field access instead of bean property access. Applied by prepareBinder(org.springframework.web.bind.ServletRequestDataBinder).

Default is "false". Can be overridden in subclasses.

Returns:
whether to use direct field access (true) or bean property access (false)
See Also:
prepareBinder(org.springframework.web.bind.ServletRequestDataBinder), DataBinder.initDirectFieldAccess()

initBinder

protected void initBinder(HttpServletRequest request,
                          ServletRequestDataBinder binder)
                   throws Exception
Deprecated.
Initialize the given binder instance, for example with custom editors. Called by createBinder(javax.servlet.http.HttpServletRequest, java.lang.Object).

This method allows you to register custom editors for certain fields of your command class. For instance, you will be able to transform Date objects into a String pattern and back, in order to allow your JavaBeans to have Date properties and still be able to set and display them in an HTML interface.

The default implementation is empty.

Parameters:
request - current HTTP request
binder - the new binder instance
Throws:
Exception - in case of invalid state or arguments
See Also:
createBinder(javax.servlet.http.HttpServletRequest, java.lang.Object), DataBinder.registerCustomEditor(java.lang.Class, java.beans.PropertyEditor), CustomDateEditor

onBind

protected void onBind(HttpServletRequest request,
                      Object command,
                      BindException errors)
               throws Exception
Deprecated.
Callback for custom post-processing in terms of binding. Called on each submit, after standard binding but before validation.

The default implementation delegates to onBind(HttpServletRequest, Object).

Parameters:
request - current HTTP request
command - the command object to perform further binding on
errors - validation errors holder, allowing for additional custom registration of binding errors
Throws:
Exception - in case of invalid state or arguments
See Also:
bindAndValidate(javax.servlet.http.HttpServletRequest, java.lang.Object), onBind(HttpServletRequest, Object)

onBind

protected void onBind(HttpServletRequest request,
                      Object command)
               throws Exception
Deprecated.
Callback for custom post-processing in terms of binding.

Called by the default implementation of the onBind(HttpServletRequest, Object, BindException) variant with all parameters, after standard binding but before validation.

The default implementation is empty.

Parameters:
request - current HTTP request
command - the command object to perform further binding on
Throws:
Exception - in case of invalid state or arguments
See Also:
onBind(HttpServletRequest, Object, BindException)

suppressValidation

protected boolean suppressValidation(HttpServletRequest request,
                                     Object command,
                                     BindException errors)
Deprecated.
Return whether to suppress validation for the given request.

The default implementation delegates to suppressValidation(HttpServletRequest, Object).

Parameters:
request - current HTTP request
command - the command object to validate
errors - validation errors holder, allowing for additional custom registration of binding errors
Returns:
whether to suppress validation for the given request

suppressValidation

protected boolean suppressValidation(HttpServletRequest request,
                                     Object command)
Deprecated.
Return whether to suppress validation for the given request.

Called by the default implementation of the suppressValidation(HttpServletRequest, Object, BindException) variant with all parameters.

The default implementation delegates to suppressValidation(HttpServletRequest).

Parameters:
request - current HTTP request
command - the command object to validate
Returns:
whether to suppress validation for the given request

suppressValidation

@Deprecated
protected boolean suppressValidation(HttpServletRequest request)
Deprecated. as of Spring 2.0.4, in favor of the suppressValidation(HttpServletRequest, Object) variant

Return whether to suppress validation for the given request.

Called by the default implementation of the suppressValidation(HttpServletRequest, Object) variant with all parameters.

The default implementation is empty.

Parameters:
request - current HTTP request
Returns:
whether to suppress validation for the given request

onBindAndValidate

protected void onBindAndValidate(HttpServletRequest request,
                                 Object command,
                                 BindException errors)
                          throws Exception
Deprecated.
Callback for custom post-processing in terms of binding and validation. Called on each submit, after standard binding and validation, but before error evaluation.

The default implementation is empty.

Parameters:
request - current HTTP request
command - the command object, still allowing for further binding
errors - validation errors holder, allowing for additional custom validation
Throws:
Exception - in case of invalid state or arguments
See Also:
bindAndValidate(javax.servlet.http.HttpServletRequest, java.lang.Object), Errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CancellableFormController

org.springframework.web.servlet.mvc
Class CancellableFormController

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.support.WebContentGenerator
                extended by  org.springframework.web.servlet.mvc.AbstractController
                    extended by  org.springframework.web.servlet.mvc.BaseCommandController
                        extended by  org.springframework.web.servlet.mvc.AbstractFormController
                            extended by  org.springframework.web.servlet.mvc.SimpleFormController
                                extended by  org.springframework.web.servlet.mvc.CancellableFormController
All Implemented Interfaces:
ApplicationContextAware, ServletContextAware, Controller
Deprecated. as of Spring 3.0, in favor of annotated controllers

@Deprecated
public class CancellableFormController
extends SimpleFormController

Extension of SimpleFormController that supports "cancellation" of form processing. By default, this controller looks for a given parameter in the request, identified by the cancelParamKey. If this parameter is present, then the controller will return the configured cancelView, otherwise processing is passed back to the superclass.

Workflow (in addition to the superclass):

  1. Call to processFormSubmission which calls isCancelRequest(javax.servlet.http.HttpServletRequest) to see if the incoming request is to cancel the current form entry. By default, isCancelRequest(javax.servlet.http.HttpServletRequest) returns true if the configured cancelParamKey exists in the request. This behavior can be overridden in subclasses.
  2. If isCancelRequest(javax.servlet.http.HttpServletRequest) returns false, then the controller will delegate all processing back to SimpleFormController, otherwise it will call the onCancel(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object) version with all parameters. By default, that method will delegate to the onCancel(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object) version with just the command object, which will in turn simply return the configured cancelView. This behavior can be overridden in subclasses.

Thanks to Erwin Bolwidt for submitting the original prototype of such a cancellable form controller!

Since:
1.2.3
Author:
Rob Harrop, Juergen Hoeller
See Also:
setCancelParamKey(java.lang.String),
setCancelView(java.lang.String),
isCancelRequest(javax.servlet.http.HttpServletRequest),
onCancel(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, Object)

Field Summary

Fields inherited from class org.springframework.web.servlet.mvc.BaseCommandController
DEFAULT_COMMAND_NAME

Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator
METHOD_GET, METHOD_HEAD, METHOD_POST

Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger

Constructor Summary
CancellableFormController()
          Deprecated.

Method Summary
 String getCancelParamKey()
          Deprecated. Return the key of the request parameter used to identify a cancel request.
 String getCancelView()
          Deprecated. Gets the name of the cancel view.
protected  boolean isCancelRequest(HttpServletRequest request)
          Deprecated. Determine whether the incoming request is a request to cancel the processing of the current form.
protected  boolean isFormSubmission(HttpServletRequest request)
          Deprecated. Consider an explicit cancel request as a form submission too.
protected  ModelAndView onCancel(HttpServletRequest request, HttpServletResponse response, Object command)
          Deprecated. Callback method for handling a cancel request.
protected  ModelAndView onCancel(Object command)
          Deprecated. Simple onCancel version.
protected  ModelAndView processFormSubmission(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors)
          Deprecated. This implementation first checks to see if the incoming is a cancel request, through a call to isCancelRequest(javax.servlet.http.HttpServletRequest).
 void setCancelParamKey(String cancelParamKey)
          Deprecated. Set the key of the request parameter used to identify a cancel request.
 void setCancelView(String cancelView)
          Deprecated. Sets the name of the cancel view.
protected  boolean suppressValidation(HttpServletRequest request, Object command)
          Deprecated. Suppress validation for an explicit cancel request too.

Methods inherited from class org.springframework.web.servlet.mvc.SimpleFormController
doSubmitAction, getFormView, getSuccessView, isFormChangeRequest, isFormChangeRequest, onFormChange, onFormChange, onSubmit, onSubmit, onSubmit, referenceData, referenceData, setFormView, setSuccessView, showForm, showForm

Methods inherited from class org.springframework.web.servlet.mvc.AbstractFormController
currentFormObject, formBackingObject, getCommand, getErrorsForNewForm, getFormSessionAttributeName, getFormSessionAttributeName, handleInvalidSubmit, handleRequestInternal, isBindOnNewForm, isSessionForm, onBindOnNewForm, onBindOnNewForm, setBindOnNewForm, setSessionForm, showForm, showForm, showNewForm

Methods inherited from class org.springframework.web.servlet.mvc.BaseCommandController
bindAndValidate, checkCommand, createBinder, createCommand, getBindingErrorProcessor, getCommandClass, getCommandName, getMessageCodesResolver, getPropertyEditorRegistrars, getValidator, getValidators, getWebBindingInitializer, initApplicationContext, initBinder, isValidateOnBinding, onBind, onBind, onBindAndValidate, prepareBinder, setBindingErrorProcessor, setCommandClass, setCommandName, setMessageCodesResolver, setPropertyEditorRegistrar, setPropertyEditorRegistrars, setValidateOnBinding, setValidator, setValidators, setWebBindingInitializer, suppressBinding, suppressValidation, suppressValidation, useDirectFieldAccess

Methods inherited from class org.springframework.web.servlet.mvc.AbstractController
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession

Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader

Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext

Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CancellableFormController

public CancellableFormController()
Deprecated.
Method Detail

setCancelParamKey

public final void setCancelParamKey(String cancelParamKey)
Deprecated.
Set the key of the request parameter used to identify a cancel request. Default is "_cancel".

The parameter is recognized both when sent as a plain parameter ("_cancel") or when triggered by an image button ("_cancel.x").

getCancelParamKey

public final String getCancelParamKey()
Deprecated.
Return the key of the request parameter used to identify a cancel request.

setCancelView

public final void setCancelView(String cancelView)
Deprecated.
Sets the name of the cancel view.

getCancelView

public final String getCancelView()
Deprecated.
Gets the name of the cancel view.

isFormSubmission

protected boolean isFormSubmission(HttpServletRequest request)
Deprecated.
Consider an explicit cancel request as a form submission too.

Overrides:
isFormSubmission in class AbstractFormController
Parameters:
request - current HTTP request
Returns:
if the request represents a form submission
See Also:
isCancelRequest(javax.servlet.http.HttpServletRequest)

suppressValidation

protected boolean suppressValidation(HttpServletRequest request,
                                     Object command)
Deprecated.
Suppress validation for an explicit cancel request too.

Overrides:
suppressValidation in class SimpleFormController
Parameters:
request - current HTTP request
command - the command object to validate
Returns:
whether to suppress validation for the given request
See Also:
isCancelRequest(javax.servlet.http.HttpServletRequest)

processFormSubmission

protected ModelAndView processFormSubmission(HttpServletRequest request,
                                             HttpServletResponse response,
                                             Object command,
                                             BindException errors)
                                      throws Exception
Deprecated.
This implementation first checks to see if the incoming is a cancel request, through a call to isCancelRequest(javax.servlet.http.HttpServletRequest). If so, control is passed to onCancel(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object); otherwise, control is passed up to SimpleFormController.processFormSubmission(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object, org.springframework.validation.BindException).

Overrides:
processFormSubmission in class SimpleFormController
Parameters:
request - current servlet request
response - current servlet response
command - form object with request parameters bound onto it
errors - holder without errors (subclass can add errors if it wants to)
Returns:
the prepared model and view, or null
Throws:
Exception - in case of errors
See Also:
isCancelRequest(javax.servlet.http.HttpServletRequest),
onCancel(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, Object),
SimpleFormController.processFormSubmission(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object, org.springframework.validation.BindException)

isCancelRequest

protected boolean isCancelRequest(HttpServletRequest request)
Deprecated.
Determine whether the incoming request is a request to cancel the processing of the current form.

By default, this method returns true if a parameter matching the configured cancelParamKey is present in the request, otherwise it returns false. Subclasses may override this method to provide custom logic to detect a cancel request.

The parameter is recognized both when sent as a plain parameter ("_cancel") or when triggered by an image button ("_cancel.x").

Parameters:
request - current HTTP request
See Also:
setCancelParamKey(java.lang.String), PARAM_CANCEL

onCancel

protected ModelAndView onCancel(HttpServletRequest request,
                                HttpServletResponse response,
                                Object command)
                         throws Exception
Deprecated.
Callback method for handling a cancel request. Called if isCancelRequest(javax.servlet.http.HttpServletRequest) returns true.

Default implementation delegates to onCancel(Object) to return the configured cancelView. Subclasses may override either of the two methods to build a custom ModelAndView that may contain model parameters used in the cancel view.

If you simply want to move the user to a new view and you don't want to add additional model parameters, use setCancelView(String) rather than overriding an onCancel method.

Parameters:
request - current servlet request
response - current servlet response
command - form object with request parameters bound onto it
Returns:
the prepared model and view, or null
Throws:
Exception - in case of errors
See Also:
isCancelRequest(javax.servlet.http.HttpServletRequest), onCancel(Object), setCancelView(java.lang.String)

onCancel

protected ModelAndView onCancel(Object command)
                         throws Exception
Deprecated.
Simple onCancel version. Called by the default implementation of the onCancel version with all parameters.

Default implementation returns eturns the configured cancelView. Subclasses may override this method to build a custom ModelAndView that may contain model parameters used in the cancel view.

If you simply want to move the user to a new view and you don't want to add additional model parameters, use setCancelView(String) rather than overriding an onCancel method.

Parameters:
command - form object with request parameters bound onto it
Returns:
the prepared model and view, or null
Throws:
Exception - in case of errors
See Also:
onCancel(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, Object), setCancelView(java.lang.String)
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


HttpRequestHandlerAdapter

org.springframework.web.servlet.mvc
Class HttpRequestHandlerAdapter

java.lang.Object
    extended by  org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter
All Implemented Interfaces:
HandlerAdapter
public class HttpRequestHandlerAdapter
extends Object
implements HandlerAdapter

Adapter to use the plain HttpRequestHandler interface with the generic DispatcherServlet. Supports handlers that implement the LastModified interface.

This is an SPI class, not used directly by application code.

Since:
2.0
Author:
Juergen Hoeller
See Also:
DispatcherServlet, HttpRequestHandler, LastModified, SimpleControllerHandlerAdapter

Constructor Summary
HttpRequestHandlerAdapter()
Method Summary
long | getLastModified(HttpServletRequest request, Object handler) Same contract as for HttpServlet's getLastModified method.
ModelAndView | handle(HttpServletRequest request, HttpServletResponse response, Object handler) Use the given handler to handle this request.
boolean | supports(Object handler) Given a handler instance, return whether or not this HandlerAdapter can support it.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

HttpRequestHandlerAdapter

public HttpRequestHandlerAdapter()
Method Detail

supports

public boolean supports(Object handler)
Description copied from interface: HandlerAdapter
Given a handler instance, return whether or not this HandlerAdapter can support it. Typical HandlerAdapters will base the decision on the handler type. HandlerAdapters will usually only support one handler type each.

A typical implementation:

return (handler instanceof MyHandler);

Specified by:
supports in interface HandlerAdapter
Parameters:
handler - handler object to check
Returns:
whether or not this object can use the given handler

handle

public ModelAndView handle(HttpServletRequest request,
                           HttpServletResponse response,
                           Object handler)
                    throws Exception
Description copied from interface: HandlerAdapter
Use the given handler to handle this request. The workflow that is required may vary widely.

Specified by:
handle in interface HandlerAdapter
Parameters:
request - current HTTP request
response - current HTTP response
handler - handler to use. This object must have previously been passed to the supports method of this interface, which must have returned true.
Returns:
ModelAndView object with the name of the view and the required model data, or null if the request has been handled directly
Throws:
Exception - in case of errors

getLastModified

public long getLastModified(HttpServletRequest request,
                            Object handler)
Description copied from interface: HandlerAdapter
Same contract as for HttpServlet's getLastModified method. Can simply return -1 if there's no support in the handler class.

Specified by:
getLastModified in interface HandlerAdapter
Parameters:
request - current HTTP request
handler - handler to use
Returns:
the lastModified value for the given handler
See Also:
HttpServlet.getLastModified(javax.servlet.http.HttpServletRequest), LastModified.getLastModified(javax.servlet.http.HttpServletRequest)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ParameterizableViewController

org.springframework.web.servlet.mvc
Class ParameterizableViewController

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.support.WebContentGenerator
                extended by  org.springframework.web.servlet.mvc.AbstractController
                    extended by  org.springframework.web.servlet.mvc.ParameterizableViewController
All Implemented Interfaces:
ApplicationContextAware, ServletContextAware, Controller
public class ParameterizableViewController
extends AbstractController

Trivial controller that always returns a named view. The view can be configured using an exposed configuration property. This controller offers an alternative to sending a request straight to a view such as a JSP. The advantage here is that the client is not exposed to the concrete view technology but rather just to the controller URL; the concrete view will be determined by the ViewResolver.

An alternative to the ParameterizableViewController is a MultiActionController, which can define a variety of handler methods that just return a plain ModelAndView instance for a given view name.

Workflow (and that defined by superclass):

  1. Request is received by the controller
  2. call to handleRequestInternal which just returns the view, named by the configuration property viewName. Nothing more, nothing less

Exposed configuration properties (and those defined by superclass):

name | default | description
viewName | null | the name of the view the viewResolver will use to forward to (if this property is not set, a null view name will be returned directing the caller to calculate the view name from the current request)

Author:
Rod Johnson, Juergen Hoeller, Keith Donald

Field Summary
Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator
METHOD_GET, METHOD_HEAD, METHOD_POST
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Constructor Summary
ParameterizableViewController()
Method Summary
String | getViewName() Return the name of the view to delegate to.
protected ModelAndView | handleRequestInternal(HttpServletRequest request, HttpServletResponse response) Return a ModelAndView object with the specified view name.
void | setViewName(String viewName) Set the name of the view to delegate to.
Methods inherited from class org.springframework.web.servlet.mvc.AbstractController
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession
Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ParameterizableViewController

public ParameterizableViewController()
Method Detail

setViewName

public void setViewName(String viewName)
Set the name of the view to delegate to.

getViewName

public String getViewName()
Return the name of the view to delegate to.

handleRequestInternal

protected ModelAndView handleRequestInternal(HttpServletRequest request,
                                             HttpServletResponse response)
                                      throws Exception
Return a ModelAndView object with the specified view name.

Specified by:
handleRequestInternal in class AbstractController
Throws:
Exception
See Also:
getViewName()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletForwardingController

org.springframework.web.servlet.mvc
Class ServletForwardingController

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.support.WebContentGenerator
                extended by  org.springframework.web.servlet.mvc.AbstractController
                    extended by  org.springframework.web.servlet.mvc.ServletForwardingController
All Implemented Interfaces:
BeanNameAware, ApplicationContextAware, ServletContextAware, Controller
public class ServletForwardingController
extends AbstractController
implements BeanNameAware

Spring Controller implementation that forwards to a named servlet, i.e. the "servlet-name" in web.xml rather than a URL path mapping. A target servlet doesn't even need a "servlet-mapping" in web.xml in the first place: A "servlet" declaration is sufficient.

Useful to invoke an existing servlet via Spring's dispatching infrastructure, for example to apply Spring HandlerInterceptors to its requests. This will work even in a minimal Servlet container that does not support Servlet filters.

Example: web.xml, mapping all "/myservlet" requests to a Spring dispatcher. Also defines a custom "myServlet", but without servlet mapping.

 <servlet>
   <servlet-name>myServlet</servlet-name>
   <servlet-class>mypackage.TestServlet</servlet-class>
 </servlet>

 <servlet>
   <servlet-name>myDispatcher</servlet-name>
   <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
 </servlet>

 <servlet-mapping>
   <servlet-name>myDispatcher</servlet-name>
   <url-pattern>/myservlet</url-pattern>
 </servlet-mapping>
Example: myDispatcher-servlet.xml, in turn forwarding "/myservlet" to your servlet (identified by servlet name). All such requests will go through the configured HandlerInterceptor chain (e.g. an OpenSessionInViewInterceptor). From the servlet point of view, everything will work as usual.
 <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
   <property name="interceptors">
     <list>
       <ref bean="openSessionInViewInterceptor"/>
     </list>
   </property>
   <property name="mappings">
     <props>
       <prop key="/myservlet">myServletForwardingController</prop>
     </props>
   </property>
 </bean>

 <bean id="myServletForwardingController" class="org.springframework.web.servlet.mvc.ServletForwardingController">
   <property name="servletName"><value>myServlet</value></property>
 </bean>

Since:
1.1.1
Author:
Juergen Hoeller
See Also:
ServletWrappingController, OpenSessionInViewInterceptor, OpenSessionInViewFilter, OpenPersistenceManagerInViewInterceptor, OpenPersistenceManagerInViewFilter

Field Summary
Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator
METHOD_GET, METHOD_HEAD, METHOD_POST
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Constructor Summary
ServletForwardingController()
Method Summary
protected ModelAndView | handleRequestInternal(HttpServletRequest request, HttpServletResponse response) Template method.
void | setBeanName(String name) Set the name of the bean in the bean factory that created this bean.
void | setServletName(String servletName) Set the name of the servlet to forward to, i.e.
protected boolean | useInclude(HttpServletRequest request, HttpServletResponse response) Determine whether to use RequestDispatcher's include or forward method.
Methods inherited from class org.springframework.web.servlet.mvc.AbstractController
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession
Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ServletForwardingController

public ServletForwardingController()
Method Detail

setServletName

public void setServletName(String servletName)
Set the name of the servlet to forward to, i.e. the "servlet-name" of the target servlet in web.xml.

Default is the bean name of this controller.

setBeanName

public void setBeanName(String name)
Description copied from interface: BeanNameAware
Set the name of the bean in the bean factory that created this bean.

Invoked after population of normal bean properties but before an init callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanName in interface BeanNameAware
Parameters:
name - the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use the BeanFactoryUtils.originalBeanName(String) method to extract the original bean name (without suffix), if desired.

handleRequestInternal

protected ModelAndView handleRequestInternal(HttpServletRequest request,
                                             HttpServletResponse response)
                                      throws Exception
Description copied from class: AbstractController
Template method. Subclasses must implement this. The contract is the same as for handleRequest.

Specified by:
handleRequestInternal in class AbstractController
Throws:
Exception
See Also:
AbstractController.handleRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

useInclude

protected boolean useInclude(HttpServletRequest request,
                             HttpServletResponse response)
Determine whether to use RequestDispatcher's include or forward method.

Performs a check whether an include URI attribute is found in the request, indicating an include request, and whether the response has already been committed. In both cases, an include will be performed, as a forward is not possible anymore.

Parameters:
request - current HTTP request
response - current HTTP response
Returns:
true for include, false for forward
See Also:
RequestDispatcher.forward(javax.servlet.ServletRequest, javax.servlet.ServletResponse),
RequestDispatcher.include(javax.servlet.ServletRequest, javax.servlet.ServletResponse),
ServletResponse.isCommitted(),
WebUtils.isIncludeRequest(javax.servlet.ServletRequest)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletWrappingController

org.springframework.web.servlet.mvc
Class ServletWrappingController

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.support.WebContentGenerator
                extended by  org.springframework.web.servlet.mvc.AbstractController
                    extended by  org.springframework.web.servlet.mvc.ServletWrappingController
All Implemented Interfaces:
BeanNameAware, DisposableBean, InitializingBean, ApplicationContextAware, ServletContextAware, Controller
public class ServletWrappingController
extends AbstractController
implements BeanNameAware, InitializingBean, DisposableBean

Spring Controller implementation that wraps a servlet instance which it manages internally. Such a wrapped servlet is not known outside of this controller; its entire lifecycle is covered here (in contrast to ServletForwardingController).

Useful to invoke an existing servlet via Spring's dispatching infrastructure, for example to apply Spring HandlerInterceptors to its requests.

Note that Struts has a special requirement in that it parses web.xml to find its servlet mapping. Therefore, you need to specify the DispatcherServlet's servlet name as "servletName" on this controller, so that Struts finds the DispatcherServlet's mapping (thinking that it refers to the ActionServlet).

Example: a DispatcherServlet XML context, forwarding "*.do" to the Struts ActionServlet wrapped by a ServletWrappingController. All such requests will go through the configured HandlerInterceptor chain (e.g. an OpenSessionInViewInterceptor). From the Struts point of view, everything will work as usual.

 <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
   <property name="interceptors">
     <list>
       <ref bean="openSessionInViewInterceptor"/>
     </list>
   </property>
   <property name="mappings">
     <props>
       <prop key="*.do">strutsWrappingController</prop>
     </props>
   </property>
 </bean>

 <bean id="strutsWrappingController" class="org.springframework.web.servlet.mvc.ServletWrappingController">
   <property name="servletClass">
     <value>org.apache.struts.action.ActionServlet</value>
   </property>
   <property name="servletName">
     <value>action</value>
   </property>
   <property name="initParameters">
     <props>
       <prop key="config">/WEB-INF/struts-config.xml</prop>
     </props>
   </property>
 </bean>

Since:
1.1.1
Author:
Juergen Hoeller
See Also:
ServletForwardingController, OpenSessionInViewInterceptor, OpenSessionInViewFilter, OpenPersistenceManagerInViewInterceptor, OpenPersistenceManagerInViewFilter

Field Summary
Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator
METHOD_GET, METHOD_HEAD, METHOD_POST
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Constructor Summary
ServletWrappingController()
Method Summary
void | afterPropertiesSet() Initialize the wrapped Servlet instance.
void | destroy() Destroy the wrapped Servlet instance.
protected ModelAndView | handleRequestInternal(HttpServletRequest request, HttpServletResponse response) Invoke the the wrapped Servlet instance.
void | setBeanName(String name) Set the name of the bean in the bean factory that created this bean.
void | setInitParameters(Properties initParameters) Specify init parameters for the servlet to wrap, as name-value pairs.
void | setServletClass(Class servletClass) Set the class of the servlet to wrap.
void | setServletName(String servletName) Set the name of the servlet to wrap.
Methods inherited from class org.springframework.web.servlet.mvc.AbstractController
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession
Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ServletWrappingController

public ServletWrappingController()
Method Detail

setServletClass

public void setServletClass(Class servletClass)
Set the class of the servlet to wrap. Needs to implement javax.servlet.Servlet.

See Also:
Servlet

setServletName

public void setServletName(String servletName)
Set the name of the servlet to wrap. Default is the bean name of this controller.

setInitParameters

public void setInitParameters(Properties initParameters)
Specify init parameters for the servlet to wrap, as name-value pairs.

setBeanName

public void setBeanName(String name)
Description copied from interface: BeanNameAware
Set the name of the bean in the bean factory that created this bean.

Invoked after population of normal bean properties but before an init callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanName in interface BeanNameAware
Parameters:
name - the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use the BeanFactoryUtils.originalBeanName(String) method to extract the original bean name (without suffix), if desired.

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Initialize the wrapped Servlet instance.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception - in the event of misconfiguration (such as failure to set an essential property) or if initialization fails.
See Also:
Servlet.init(javax.servlet.ServletConfig)

handleRequestInternal

protected ModelAndView handleRequestInternal(HttpServletRequest request,
                                             HttpServletResponse response)
                                      throws Exception
Invoke the the wrapped Servlet instance.

Specified by:
handleRequestInternal in class AbstractController
Throws:
Exception
See Also:
Servlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)

destroy

public void destroy()
Destroy the wrapped Servlet instance.

Specified by:
destroy in interface DisposableBean
See Also:
Servlet.destroy()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleControllerHandlerAdapter

org.springframework.web.servlet.mvc
Class SimpleControllerHandlerAdapter

java.lang.Object
    extended by  org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter
All Implemented Interfaces:
HandlerAdapter
public class SimpleControllerHandlerAdapter
extends Object
implements HandlerAdapter

Adapter to use the plain Controller workflow interface with the generic DispatcherServlet. Supports handlers that implement the LastModified interface.

This is an SPI class, not used directly by application code.

Author:
Rod Johnson, Juergen Hoeller
See Also:
DispatcherServlet, Controller, LastModified, HttpRequestHandlerAdapter

Constructor Summary
SimpleControllerHandlerAdapter()
Method Summary
long | getLastModified(HttpServletRequest request, Object handler) Same contract as for HttpServlet's getLastModified method.
ModelAndView | handle(HttpServletRequest request, HttpServletResponse response, Object handler) Use the given handler to handle this request.
boolean | supports(Object handler) Given a handler instance, return whether or not this HandlerAdapter can support it.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleControllerHandlerAdapter

public SimpleControllerHandlerAdapter()
Method Detail

supports

public boolean supports(Object handler)
Description copied from interface: HandlerAdapter
Given a handler instance, return whether or not this HandlerAdapter can support it. Typical HandlerAdapters will base the decision on the handler type. HandlerAdapters will usually only support one handler type each.

A typical implementation:

return (handler instanceof MyHandler);

Specified by:
supports in interface HandlerAdapter
Parameters:
handler - handler object to check
Returns:
whether or not this object can use the given handler

handle

public ModelAndView handle(HttpServletRequest request,
                           HttpServletResponse response,
                           Object handler)
                    throws Exception
Description copied from interface: HandlerAdapter
Use the given handler to handle this request. The workflow that is required may vary widely.

Specified by:
handle in interface HandlerAdapter
Parameters:
request - current HTTP request
response - current HTTP response
handler - handler to use. This object must have previously been passed to the supports method of this interface, which must have returned true.
Returns:
ModelAndView object with the name of the view and the required model data, or null if the request has been handled directly
Throws:
Exception - in case of errors

getLastModified

public long getLastModified(HttpServletRequest request,
                            Object handler)
Description copied from interface: HandlerAdapter
Same contract as for HttpServlet's getLastModified method. Can simply return -1 if there's no support in the handler class.

Specified by:
getLastModified in interface HandlerAdapter
Parameters:
request - current HTTP request
handler - handler to use
Returns:
the lastModified value for the given handler
See Also:
HttpServlet.getLastModified(javax.servlet.http.HttpServletRequest), LastModified.getLastModified(javax.servlet.http.HttpServletRequest)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleFormController

org.springframework.web.servlet.mvc
Class SimpleFormController

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.support.WebContentGenerator
                extended by  org.springframework.web.servlet.mvc.AbstractController
                    extended by  org.springframework.web.servlet.mvc.BaseCommandController
                        extended by  org.springframework.web.servlet.mvc.AbstractFormController
                            extended by  org.springframework.web.servlet.mvc.SimpleFormController
All Implemented Interfaces:
ApplicationContextAware, ServletContextAware, Controller
Direct Known Subclasses:
CancellableFormController
Deprecated. as of Spring 3.0, in favor of annotated controllers

@Deprecated
public class SimpleFormController
extends AbstractFormController

Concrete FormController implementation that provides configurable form and success views, and an onSubmit chain for convenient overriding. Automatically resubmits to the form view in case of validation errors, and renders the success view in case of a valid submission.

The workflow of this Controller does not differ much from the one described in the AbstractFormController. The difference is that you do not need to implement showForm and processFormSubmission: A form view and a success view can be configured declaratively.

Workflow (in addition to the superclass):

  1. Call to processFormSubmission which inspects the Errors object to see if any errors have occurred during binding and validation.
  2. If errors occured, the controller will return the configured formView, showing the form again (possibly rendering according error messages).
  3. If isFormChangeRequest is overridden and returns true for the given request, the controller will return the formView too. In that case, the controller will also suppress validation. Before returning the formView, the controller will invoke onFormChange(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object, org.springframework.validation.BindException), giving sub-classes a chance to make modification to the command object. This is intended for requests that change the structure of the form, which should not cause validation and show the form in any case.
  4. If no errors occurred, the controller will call onSubmit using all parameters, which in case of the default implementation delegates to onSubmit with just the command object. The default implementation of the latter method will return the configured successView. Consider implementing doSubmitAction(java.lang.Object) doSubmitAction for simply performing a submit action and rendering the success view.

The submit behavior can be customized by overriding one of the onSubmit methods. Submit actions can also perform custom validation if necessary (typically database-driven checks), calling showForm in case of validation errors to show the form view again.

Exposed configuration properties (and those defined by superclass):

name | default | description
formView | null | Indicates what view to use when the user asks for a new form or when validation errors have occurred on form submission.
successView | null | Indicates what view to use when successful form submissions have occurred. Such a success view could e.g. display a submission summary. More sophisticated actions can be implemented by overriding one of the onSubmit() methods.

Since:
05.05.2003
Author:
Juergen Hoeller, Rob Harrop

Field Summary
Fields inherited from class org.springframework.web.servlet.mvc.BaseCommandController
DEFAULT_COMMAND_NAME
Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator
METHOD_GET, METHOD_HEAD, METHOD_POST
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Constructor Summary
SimpleFormController()
Deprecated. Create a new SimpleFormController.
Method Summary
protected  void doSubmitAction(Object command)
Deprecated. Template method for submit actions.
 String getFormView()
Deprecated. Return the name of the view that should be used for form display.
 String getSuccessView()
Deprecated. Return the name of the view that should be shown on successful submit.
protected  boolean isFormChangeRequest(HttpServletRequest request)
Deprecated. Simpler isFormChangeRequest variant, called by the full variant isFormChangeRequest(HttpServletRequest, Object).
protected  boolean isFormChangeRequest(HttpServletRequest request, Object command)
Deprecated. Determine whether the given request is a form change request.
protected  void onFormChange(HttpServletRequest request, HttpServletResponse response, Object command)
Deprecated. Simpler onFormChange variant, called by the full variant onFormChange(HttpServletRequest, HttpServletResponse, Object, BindException).
protected  void onFormChange(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors)
Deprecated. Called during form submission if isFormChangeRequest(javax.servlet.http.HttpServletRequest) returns true.
protected  ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors)
Deprecated. Submit callback with all parameters.
protected  ModelAndView onSubmit(Object command)
Deprecated. Simplest onSubmit variant.
protected  ModelAndView onSubmit(Object command, BindException errors)
Deprecated. Simpler onSubmit variant.
protected  ModelAndView processFormSubmission(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors)
Deprecated. This implementation calls showForm(HttpServletRequest, HttpServletResponse, BindException) in case of errors, and delegates to the full onSubmit(HttpServletRequest, HttpServletResponse, Object, BindException)'s variant else.
protected  Map referenceData(HttpServletRequest request)
Deprecated. Create a reference data map for the given request.
protected  Map referenceData(HttpServletRequest request, Object command, Errors errors)
Deprecated. Create a reference data map for the given request and command, consisting of bean name/bean instance pairs as expected by ModelAndView.
 void setFormView(String formView)
Deprecated. Set the name of the view that should be used for form display.
 void setSuccessView(String successView)
Deprecated. Set the name of the view that should be shown on successful submit.
protected  ModelAndView showForm(HttpServletRequest request, HttpServletResponse response, BindException errors)
Deprecated. This implementation shows the configured form view, delegating to the analogous showForm(HttpServletRequest, HttpServletResponse, BindException, Map) variant with a "controlModel" argument.
protected  ModelAndView showForm(HttpServletRequest request, HttpServletResponse response, BindException errors, Map controlModel)
Deprecated. This implementation shows the configured form view.
protected  boolean suppressValidation(HttpServletRequest request, Object command)
Deprecated. This implementation delegates to isFormChangeRequest(HttpServletRequest, Object): A form change request changes the appearance of the form and should not get validated but just show the new form.
Methods inherited from class org.springframework.web.servlet.mvc.AbstractFormController
currentFormObject, formBackingObject, getCommand, getErrorsForNewForm, getFormSessionAttributeName, getFormSessionAttributeName, handleInvalidSubmit, handleRequestInternal, isBindOnNewForm, isFormSubmission, isSessionForm, onBindOnNewForm, onBindOnNewForm, setBindOnNewForm, setSessionForm, showForm, showForm, showNewForm
Methods inherited from class org.springframework.web.servlet.mvc.BaseCommandController
bindAndValidate, checkCommand, createBinder, createCommand, getBindingErrorProcessor, getCommandClass, getCommandName, getMessageCodesResolver, getPropertyEditorRegistrars, getValidator, getValidators, getWebBindingInitializer, initApplicationContext, initBinder, isValidateOnBinding, onBind, onBind, onBindAndValidate, prepareBinder, setBindingErrorProcessor, setCommandClass, setCommandName, setMessageCodesResolver, setPropertyEditorRegistrar, setPropertyEditorRegistrars, setValidateOnBinding, setValidator, setValidators, setWebBindingInitializer, suppressBinding, suppressValidation, suppressValidation, useDirectFieldAccess
Methods inherited from class org.springframework.web.servlet.mvc.AbstractController
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession
Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleFormController

public SimpleFormController()
Deprecated.
Create a new SimpleFormController.

Subclasses should set the following properties, either in the constructor or via a BeanFactory: commandName, commandClass, sessionForm, formView, successView. Note that commandClass doesn't need to be set when overriding formBackingObject, as this determines the class anyway.

See Also:
BaseCommandController.setCommandClass(java.lang.Class),
BaseCommandController.setCommandName(java.lang.String),
AbstractFormController.setSessionForm(boolean),
setFormView(java.lang.String),
setSuccessView(java.lang.String),
AbstractFormController.formBackingObject(javax.servlet.http.HttpServletRequest)
Method Detail

setFormView

public final void setFormView(String formView)
Deprecated.
Set the name of the view that should be used for form display.

getFormView

public final String getFormView()
Deprecated.
Return the name of the view that should be used for form display.

setSuccessView

public final void setSuccessView(String successView)
Deprecated.
Set the name of the view that should be shown on successful submit.

getSuccessView

public final String getSuccessView()
Deprecated.
Return the name of the view that should be shown on successful submit.

showForm

protected ModelAndView showForm(HttpServletRequest request,
                                HttpServletResponse response,
                                BindException errors)
                         throws Exception
Deprecated.
This implementation shows the configured form view, delegating to the analogous showForm(HttpServletRequest, HttpServletResponse, BindException, Map) variant with a "controlModel" argument.

Can be called within onSubmit(HttpServletRequest, HttpServletResponse, Object, BindException) implementations, to redirect back to the form in case of custom validation errors (errors not determined by the validator).

Can be overridden in subclasses to show a custom view, writing directly to the response or preparing the response before rendering a view.

If calling showForm with a custom control model in subclasses, it's preferable to override the analogous showForm version with a controlModel argument (which will handle both standard form showing and custom form showing then).

Specified by:
showForm in class AbstractFormController
Parameters:
request - current HTTP request
response - current HTTP response
errors - validation errors holder
Returns:
the prepared form view, or null if handled directly
Throws:
Exception - in case of invalid state or arguments
See Also:
setFormView(java.lang.String), showForm(HttpServletRequest, HttpServletResponse, BindException, Map)

showForm

protected ModelAndView showForm(HttpServletRequest request,
                                HttpServletResponse response,
                                BindException errors,
                                Map controlModel)
                         throws Exception
Deprecated.
This implementation shows the configured form view.

Can be called within onSubmit(HttpServletRequest, HttpServletResponse, Object, BindException) implementations, to redirect back to the form in case of custom validation errors (errors not determined by the validator).

Can be overridden in subclasses to show a custom view, writing directly to the response or preparing the response before rendering a view.

Parameters:
request - current HTTP request
errors - validation errors holder
controlModel - model map containing controller-specific control data (e.g. current page in wizard-style controllers or special error message)
Returns:
the prepared form view
Throws:
Exception - in case of invalid state or arguments
See Also:
setFormView(java.lang.String)

referenceData

protected Map referenceData(HttpServletRequest request,
                            Object command,
                            Errors errors)
                     throws Exception
Deprecated.
Create a reference data map for the given request and command, consisting of bean name/bean instance pairs as expected by ModelAndView.

The default implementation delegates to referenceData(HttpServletRequest). Subclasses can override this to set reference data used in the view.

Overrides:
referenceData in class AbstractFormController
Parameters:
request - current HTTP request
command - form object with request parameters bound onto it
errors - validation errors holder
Returns:
a Map with reference data entries, or null if none
Throws:
Exception - in case of invalid state or arguments
See Also:
ModelAndView

referenceData

protected Map referenceData(HttpServletRequest request)
                     throws Exception
Deprecated.
Create a reference data map for the given request. Called by the referenceData(HttpServletRequest, Object, Errors) variant with all parameters.

The default implementation returns null. Subclasses can override this to set reference data used in the view.

Parameters:
request - current HTTP request
Returns:
a Map with reference data entries, or null if none
Throws:
Exception - in case of invalid state or arguments
See Also:
referenceData(HttpServletRequest, Object, Errors), ModelAndView

processFormSubmission

protected ModelAndView processFormSubmission(HttpServletRequest request,
                                             HttpServletResponse response,
                                             Object command,
                                             BindException errors)
                                      throws Exception
Deprecated.
This implementation calls showForm(HttpServletRequest, HttpServletResponse, BindException) in case of errors, and delegates to the full onSubmit(HttpServletRequest, HttpServletResponse, Object, BindException)'s variant else.

This can only be overridden to check for an action that should be executed without respect to binding errors, like a cancel action. To just handle successful submissions without binding errors, override one of the onSubmit methods or doSubmitAction(java.lang.Object).

Specified by:
processFormSubmission in class AbstractFormController
Parameters:
request - current servlet request
response - current servlet response
command - form object with request parameters bound onto it
errors - holder without errors (subclass can add errors if it wants to)
Returns:
the prepared model and view, or null
Throws:
Exception - in case of errors
See Also:
showForm(HttpServletRequest, HttpServletResponse, BindException),
onSubmit(HttpServletRequest, HttpServletResponse, Object, BindException),
onSubmit(Object, BindException),
onSubmit(Object),
doSubmitAction(Object)

suppressValidation

protected boolean suppressValidation(HttpServletRequest request,
                                     Object command)
Deprecated.
This implementation delegates to isFormChangeRequest(HttpServletRequest, Object): A form change request changes the appearance of the form and should not get validated but just show the new form.

Overrides:
suppressValidation in class BaseCommandController
Parameters:
request - current HTTP request
command - the command object to validate
Returns:
whether to suppress validation for the given request
See Also:
isFormChangeRequest(javax.servlet.http.HttpServletRequest, java.lang.Object)

isFormChangeRequest

protected boolean isFormChangeRequest(HttpServletRequest request,
                                      Object command)
Deprecated.
Determine whether the given request is a form change request. A form change request changes the appearance of the form and should always show the new form, without validation.

Gets called by suppressValidation(javax.servlet.http.HttpServletRequest, java.lang.Object) and processFormSubmission(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object, org.springframework.validation.BindException). Consequently, this single method determines to suppress validation and to show the form view in any case.

The default implementation delegates to isFormChangeRequest(javax.servlet.http.HttpServletRequest).

Parameters:
request - current HTTP request
command - form object with request parameters bound onto it
Returns:
whether the given request is a form change request
See Also:
suppressValidation(javax.servlet.http.HttpServletRequest, java.lang.Object), processFormSubmission(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object, org.springframework.validation.BindException)

isFormChangeRequest

protected boolean isFormChangeRequest(HttpServletRequest request)
Deprecated.
Simpler isFormChangeRequest variant, called by the full variant isFormChangeRequest(HttpServletRequest, Object).

The default implementation returns false

Parameters:
request - current HTTP request
Returns:
whether the given request is a form change request
See Also:
suppressValidation(javax.servlet.http.HttpServletRequest, java.lang.Object), processFormSubmission(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object, org.springframework.validation.BindException)

onFormChange

protected void onFormChange(HttpServletRequest request,
                            HttpServletResponse response,
                            Object command,
                            BindException errors)
                     throws Exception
Deprecated.
Called during form submission if isFormChangeRequest(javax.servlet.http.HttpServletRequest) returns true. Allows subclasses to implement custom logic to modify the command object to directly modify data in the form.

The default implementation delegates to onFormChange(HttpServletRequest, HttpServletResponse, Object, BindException).

Parameters:
request - current servlet request
response - current servlet response
command - form object with request parameters bound onto it
errors - validation errors holder, allowing for additional custom validation
Throws:
Exception - in case of errors
See Also:
isFormChangeRequest(HttpServletRequest), onFormChange(HttpServletRequest, HttpServletResponse, Object)

onFormChange

protected void onFormChange(HttpServletRequest request,
                            HttpServletResponse response,
                            Object command)
                     throws Exception
Deprecated.
Simpler onFormChange variant, called by the full variant onFormChange(HttpServletRequest, HttpServletResponse, Object, BindException).

The default implementation is empty.

Parameters:
request - current servlet request
response - current servlet response
command - form object with request parameters bound onto it
Throws:
Exception - in case of errors
See Also:
onFormChange(HttpServletRequest, HttpServletResponse, Object, BindException)

onSubmit

protected ModelAndView onSubmit(HttpServletRequest request,
                                HttpServletResponse response,
                                Object command,
                                BindException errors)
                         throws Exception
Deprecated.
Submit callback with all parameters. Called in case of submit without errors reported by the registered validator, or on every submit if no validator.

The default implementation delegates to onSubmit(Object, BindException). For simply performing a submit action and rendering the specified success view, consider implementing doSubmitAction(java.lang.Object) rather than an onSubmit variant.

Subclasses can override this to provide custom submission handling like storing the object to the database. Implementations can also perform custom validation and call showForm to return to the form. Do not implement multiple onSubmit methods: In that case, just this method will be called by the controller.

Call errors.getModel() to populate the ModelAndView model with the command and the Errors instance, under the specified command name, as expected by the "spring:bind" tag.

Parameters:
request - current servlet request
response - current servlet response
command - form object with request parameters bound onto it
errors - Errors instance without errors (subclass can add errors if it wants to)
Returns:
the prepared model and view, or null
Throws:
Exception - in case of errors
See Also:
onSubmit(Object, BindException),
doSubmitAction(java.lang.Object),
showForm(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.springframework.validation.BindException),
Errors,
BindException.getModel()

onSubmit

protected ModelAndView onSubmit(Object command,
                                BindException errors)
                         throws Exception
Deprecated.
Simpler onSubmit variant. Called by the default implementation of the onSubmit(HttpServletRequest, HttpServletResponse, Object, BindException) variant with all parameters.

The default implementation calls onSubmit(Object), using the returned ModelAndView if actually implemented in a subclass. Else, the default behavior will apply: rendering the success view with the command and Errors instance as model.

Subclasses can override this to provide custom submission handling that does not need request and response.

Call errors.getModel() to populate the ModelAndView model with the command and the Errors instance, under the specified command name, as expected by the "spring:bind" tag.

Parameters:
command - form object with request parameters bound onto it
errors - Errors instance without errors
Returns:
the prepared model and view
Throws:
Exception - in case of errors
See Also:
onSubmit(HttpServletRequest, HttpServletResponse, Object, BindException), onSubmit(Object), setSuccessView(java.lang.String), Errors, BindException.getModel()

onSubmit

protected ModelAndView onSubmit(Object command)
                         throws Exception
Deprecated.
Simplest onSubmit variant. Called by the default implementation of the onSubmit(Object, BindException) variant.

This implementation calls doSubmitAction(Object) and returns null as ModelAndView, making the calling onSubmit method perform its default rendering of the success view.

Subclasses can override this to provide custom submission handling that just depends on the command object. It's preferable to use either onSubmit(Object, BindException) or doSubmitAction(Object), though: Use the former when you want to build your own ModelAndView; use the latter when you want to perform an action and forward to the successView.

Parameters:
command - form object with request parameters bound onto it
Returns:
the prepared model and view, or null for default (that is, rendering the configured "successView")
Throws:
Exception - in case of errors
See Also:
onSubmit(Object, BindException),
doSubmitAction(java.lang.Object),
setSuccessView(java.lang.String)

doSubmitAction

protected void doSubmitAction(Object command)
                       throws Exception
Deprecated.
Template method for submit actions. Called by the default implementation of the simplest onSubmit(Object) variant.

This is the preferred submit callback to implement if you want to perform an action (like storing changes to the database) and then render the success view with the command and Errors instance as model. You don't need to care about the success ModelAndView here.

Parameters:
command - form object with request parameters bound onto it
Throws:
Exception - in case of errors
See Also:
onSubmit(Object), setSuccessView(java.lang.String)
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


UrlFilenameViewController

org.springframework.web.servlet.mvc
Class UrlFilenameViewController

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.support.WebContentGenerator
                extended by  org.springframework.web.servlet.mvc.AbstractController
                    extended by  org.springframework.web.servlet.mvc.AbstractUrlViewController
                        extended by  org.springframework.web.servlet.mvc.UrlFilenameViewController
All Implemented Interfaces:
ApplicationContextAware, ServletContextAware, Controller
public class UrlFilenameViewController
extends AbstractUrlViewController

Simple Controller implementation that transforms the virtual path of a URL into a view name and returns that view.

Can optionally prepend a prefix and/or append a suffix to build the viewname from the URL filename.

Find below some examples:

  1. "/index" -> "index"
  2. "/index.html" -> "index"
  3. "/index.html" + prefix "pre_" and suffix "_suf" -> "pre_index_suf"
  4. "/products/view.html" -> "products/view"

Thanks to David Barri for suggesting prefix/suffix support!

Author:
Alef Arendsen, Juergen Hoeller, Rob Harrop
See Also:
setPrefix(java.lang.String), setSuffix(java.lang.String)

Field Summary
Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator
METHOD_GET, METHOD_HEAD, METHOD_POST
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Constructor Summary
UrlFilenameViewController()
Method Summary
protected String | extractOperableUrl(HttpServletRequest request) Extract a URL path from the given request, suitable for view name extraction.
protected String | extractViewNameFromUrlPath(String uri) Extract the URL filename from the given request URI.
protected String | getPrefix() Return the prefix to prepend to the request URL filename.
protected String | getSuffix() Return the suffix to append to the request URL filename.
protected String | getViewNameForRequest(HttpServletRequest request) Returns view name based on the URL filename, with prefix/suffix applied when appropriate.
protected String | getViewNameForUrlPath(String uri) Returns view name based on the URL filename, with prefix/suffix applied when appropriate.
protected String | postProcessViewName(String viewName) Build the full view name based on the given view name as indicated by the URL path.
void | setPrefix(String prefix) Set the prefix to prepend to the request URL filename to build a view name.
void | setSuffix(String suffix) Set the suffix to append to the request URL filename to build a view name.
Methods inherited from class org.springframework.web.servlet.mvc.AbstractUrlViewController
getUrlPathHelper, handleRequestInternal, setAlwaysUseFullPath, setUrlDecode, setUrlPathHelper
Methods inherited from class org.springframework.web.servlet.mvc.AbstractController
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession
Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

UrlFilenameViewController

public UrlFilenameViewController()
Method Detail

setPrefix

public void setPrefix(String prefix)
Set the prefix to prepend to the request URL filename to build a view name.

getPrefix

protected String getPrefix()
Return the prefix to prepend to the request URL filename.

setSuffix

public void setSuffix(String suffix)
Set the suffix to append to the request URL filename to build a view name.

getSuffix

protected String getSuffix()
Return the suffix to append to the request URL filename.

getViewNameForRequest

protected String getViewNameForRequest(HttpServletRequest request)
Returns view name based on the URL filename, with prefix/suffix applied when appropriate.

Specified by:
getViewNameForRequest in class AbstractUrlViewController
Parameters:
request - current HTTP request
Returns:
a view name for this request (never null)
See Also:
extractViewNameFromUrlPath(java.lang.String),
setPrefix(java.lang.String),
setSuffix(java.lang.String)

extractOperableUrl

protected String extractOperableUrl(HttpServletRequest request)
Extract a URL path from the given request, suitable for view name extraction.

Parameters:
request - current HTTP request
Returns:
the URL to use for view name extraction

getViewNameForUrlPath

protected String getViewNameForUrlPath(String uri)
Returns view name based on the URL filename, with prefix/suffix applied when appropriate.

Parameters:
uri - the request URI; for example "/index.html"
Returns:
the extracted URI filename; for example "index"
See Also:
extractViewNameFromUrlPath(java.lang.String), postProcessViewName(java.lang.String)

extractViewNameFromUrlPath

protected String extractViewNameFromUrlPath(String uri)
Extract the URL filename from the given request URI.

Parameters:
uri - the request URI; for example "/index.html"
Returns:
the extracted URI filename; for example "index"

postProcessViewName

protected String postProcessViewName(String viewName)
Build the full view name based on the given view name as indicated by the URL path.

The default implementation simply applies prefix and suffix. This can be overridden, for example, to manipulate upper case / lower case, etc.

Parameters:
viewName - the original view name, as indicated by the URL path
Returns:
the full view name to use
See Also:
getPrefix(), getSuffix()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WebContentInterceptor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.mvc
Class WebContentInterceptor

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.support.WebContentGenerator
                extended by  org.springframework.web.servlet.mvc.WebContentInterceptor
All Implemented Interfaces:
ApplicationContextAware, ServletContextAware, HandlerInterceptor
public class WebContentInterceptor
extends WebContentGenerator
implements HandlerInterceptor

Interceptor that checks and prepares request and response. Checks for supported methods and a required session, and applies the specified number of cache seconds. See superclass bean properties for configuration options.

All the settings supported by this interceptor can also be set on AbstractController. This interceptor is mainly intended for applying checks and preparations to a set of controllers mapped by a HandlerMapping.

Since:
27.11.2003
Author:
Juergen Hoeller
See Also:
AbstractController

Field Summary
Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator
METHOD_GET, METHOD_HEAD, METHOD_POST
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Constructor Summary
WebContentInterceptor()
Method Summary
void | afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) This implementation is empty.
protected Integer | lookupCacheSeconds(String urlPath) Look up a cache seconds value for the given URL path.
void | postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) This implementation is empty.
boolean | preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) Intercept the execution of a handler.
void | setAlwaysUseFullPath(boolean alwaysUseFullPath) Set if URL lookup should always use full path within current servlet context.
void | setCacheMappings(Properties cacheMappings) Map specific URL paths to specific cache seconds.
void | setPathMatcher(PathMatcher pathMatcher) Set the PathMatcher implementation to use for matching URL paths against registered URL patterns, for determining cache mappings.
void | setUrlDecode(boolean urlDecode) Set if context path and request URI should be URL-decoded.
void | setUrlPathHelper(UrlPathHelper urlPathHelper) Set the UrlPathHelper to use for resolution of lookup paths.
Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

WebContentInterceptor

public WebContentInterceptor()
Method Detail

setAlwaysUseFullPath

public void setAlwaysUseFullPath(boolean alwaysUseFullPath)
Set if URL lookup should always use full path within current servlet context. Else, the path within the current servlet mapping is used if applicable (i.e. in the case of a ".../*" servlet mapping in web.xml). Default is "false".

Only relevant for the "cacheMappings" setting.

See Also:
setCacheMappings(java.util.Properties), UrlPathHelper.setAlwaysUseFullPath(boolean)

setUrlDecode

public void setUrlDecode(boolean urlDecode)
Set if context path and request URI should be URL-decoded. Both are returned undecoded by the Servlet API, in contrast to the servlet path.

Uses either the request encoding or the default encoding according to the Servlet spec (ISO-8859-1).

Only relevant for the "cacheMappings" setting.

See Also:
setCacheMappings(java.util.Properties), UrlPathHelper.setUrlDecode(boolean)

setUrlPathHelper

public void setUrlPathHelper(UrlPathHelper urlPathHelper)
Set the UrlPathHelper to use for resolution of lookup paths.

Use this to override the default UrlPathHelper with a custom subclass, or to share common UrlPathHelper settings across multiple HandlerMappings and MethodNameResolvers.

Only relevant for the "cacheMappings" setting.

See Also:
setCacheMappings(java.util.Properties),
AbstractUrlHandlerMapping.setUrlPathHelper(org.springframework.web.util.UrlPathHelper),
AbstractUrlMethodNameResolver.setUrlPathHelper(org.springframework.web.util.UrlPathHelper)

setCacheMappings

public void setCacheMappings(Properties cacheMappings)
Map specific URL paths to specific cache seconds.

Overrides the default cache seconds setting of this interceptor. Can specify "-1" to exclude a URL path from default caching.

Supports direct matches, e.g. a registered "/test" matches "/test", and a various Ant-style pattern matches, e.g. a registered "/t*" matches both "/test" and "/team". For details, see the AntPathMatcher javadoc.

Parameters:
cacheMappings - a mapping between URL paths (as keys) and cache seconds (as values, need to be integer-parsable)
See Also:
WebContentGenerator.setCacheSeconds(int), AntPathMatcher

setPathMatcher

public void setPathMatcher(PathMatcher pathMatcher)
Set the PathMatcher implementation to use for matching URL paths against registered URL patterns, for determining cache mappings. Default is AntPathMatcher.

See Also:
setCacheMappings(java.util.Properties), AntPathMatcher

preHandle

public boolean preHandle(HttpServletRequest request,
                         HttpServletResponse response,
                         Object handler)
                  throws ServletException
Description copied from interface: HandlerInterceptor
Intercept the execution of a handler. Called after HandlerMapping determined an appropriate handler object, but before HandlerAdapter invokes the handler.

DispatcherServlet processes a handler in an execution chain, consisting of any number of interceptors, with the handler itself at the end. With this method, each interceptor can decide to abort the execution chain, typically sending a HTTP error or writing a custom response.

Specified by:
preHandle in interface HandlerInterceptor
Parameters:
request - current HTTP request
response - current HTTP response
handler - chosen handler to execute, for type and/or instance evaluation
Returns:
true if the execution chain should proceed with the next interceptor or the handler itself. Else, DispatcherServlet assumes that this interceptor has already dealt with the response itself.
Throws:
ServletException

lookupCacheSeconds

protected Integer lookupCacheSeconds(String urlPath)
Look up a cache seconds value for the given URL path.

Supports direct matches, e.g. a registered "/test" matches "/test", and various Ant-style pattern matches, e.g. a registered "/t*" matches both "/test" and "/team". For details, see the AntPathMatcher class.

Parameters:
urlPath - URL the bean is mapped to
Returns:
the associated cache seconds, or null if not found
See Also:
AntPathMatcher

postHandle

public void postHandle(HttpServletRequest request,
                       HttpServletResponse response,
                       Object handler,
                       ModelAndView modelAndView)
                throws Exception
This implementation is empty.

Specified by:
postHandle in interface HandlerInterceptor
Parameters:
request - current HTTP request
response - current HTTP response
handler - chosen handler to execute, for type and/or instance examination
modelAndView - the ModelAndView that the handler returned (can also be null)
Throws:
Exception - in case of errors

afterCompletion

public void afterCompletion(HttpServletRequest request,
                            HttpServletResponse response,
                            Object handler,
                            Exception ex)
                     throws Exception
This implementation is empty.

Specified by:
afterCompletion in interface HandlerInterceptor
Parameters:
request - current HTTP request
response - current HTTP response
handler - chosen handler to execute, for type and/or instance examination
ex - exception thrown on handler execution, if any
Throws:
Exception - in case of errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.servlet.mvc.annotation

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.servlet.mvc.annotation

Support package for annotation-based Servlet MVC controllers.

See:
Description

Interface Summary
ModelAndViewResolver SPI for resolving custom return values from a specific handler method.

Class Summary
AnnotationMethodHandlerAdapter | Implementation of the HandlerAdapter interface that maps handler methods based on HTTP paths, HTTP methods and request parameters expressed through the RequestMapping annotation.
AnnotationMethodHandlerExceptionResolver | Implementation of the HandlerExceptionResolver interface that handles exceptions through the ExceptionHandler annotation.
DefaultAnnotationHandlerMapping | Implementation of the HandlerMapping interface that maps handlers based on HTTP paths expressed through the RequestMapping annotation at the type or method level.
ResponseStatusExceptionResolver | Implementation of the HandlerExceptionResolver interface that uses the @ResponseStatus annotation to map exceptions to HTTP status codes.

Package org.springframework.web.servlet.mvc.annotation Description

Support package for annotation-based Servlet MVC controllers.


org.springframework.web.servlet.mvc.annotation Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.servlet.mvc.annotation

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver (implements org.springframework.web.servlet.HandlerExceptionResolver, org.springframework.core.Ordered)
      • org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver
      • org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver
    • org.springframework.context.support.ApplicationObjectSupport (implements org.springframework.context.ApplicationContextAware)
      • org.springframework.web.context.support.WebApplicationObjectSupport (implements org.springframework.web.context.ServletContextAware)
        • org.springframework.web.servlet.handler.AbstractHandlerMapping (implements org.springframework.web.servlet.HandlerMapping, org.springframework.core.Ordered)
          • org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
            • org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping
              • org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping
        • org.springframework.web.servlet.support.WebContentGenerator
          • org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter (implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.web.servlet.HandlerAdapter, org.springframework.core.Ordered)

Interface Hierarchy

  • org.springframework.web.servlet.mvc.annotation.ModelAndViewResolver


ModelAndViewResolver

org.springframework.web.servlet.mvc.annotation
Interface ModelAndViewResolver

public interface ModelAndViewResolver

SPI for resolving custom return values from a specific handler method. Typically implemented to detect special return types, resolving well-known result values for them.

A typical implementation could look like as follows:

 public class MyModelAndViewResolver implements ModelAndViewResolver {

   public ModelAndView resolveModelAndView(Method handlerMethod,
                                        Class handlerType,
                                        Object returnValue,
                                        ExtendedModelMap implicitModel,
                                        NativeWebRequest webRequest) {
     if (returnValue instanceof MySpecialRetVal.class)) {
       return new MySpecialRetVal(returnValue);
     }
     return UNRESOLVED;
   }
 }

Since:
3.0
Author:
Arjen Poutsma
See Also:
AnnotationMethodHandlerAdapter.setCustomModelAndViewResolvers(org.springframework.web.servlet.mvc.annotation.ModelAndViewResolver[]), AnnotationMethodHandlerAdapter.setCustomModelAndViewResolvers(org.springframework.web.servlet.mvc.annotation.ModelAndViewResolver[])

Field Summary
static ModelAndView UNRESOLVED
Marker to be returned when the resolver does not know how to handle the given method parameter.
Method Summary
 ModelAndView resolveModelAndView(Method handlerMethod, Class handlerType, Object returnValue, ExtendedModelMap implicitModel, NativeWebRequest webRequest)

Field Detail

UNRESOLVED

static final ModelAndView UNRESOLVED
Marker to be returned when the resolver does not know how to handle the given method parameter.

Method Detail

resolveModelAndView

ModelAndView resolveModelAndView(Method handlerMethod,
                                 Class handlerType,
                                 Object returnValue,
                                 ExtendedModelMap implicitModel,
                                 NativeWebRequest webRequest)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AnnotationMethodHandlerAdapter

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.mvc.annotation
Class AnnotationMethodHandlerAdapter

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.support.WebContentGenerator
                extended by  org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
All Implemented Interfaces:
BeanFactoryAware, ApplicationContextAware, Ordered, ServletContextAware, HandlerAdapter
public class AnnotationMethodHandlerAdapter
extends WebContentGenerator
implements HandlerAdapter, Ordered, BeanFactoryAware

Implementation of the HandlerAdapter interface that maps handler methods based on HTTP paths, HTTP methods and request parameters expressed through the RequestMapping annotation.

Supports request parameter binding through the RequestParam annotation. Also supports the ModelAttribute annotation for exposing model attribute values to the view, as well as InitBinder for binder initialization methods and SessionAttributes for automatic session management of specific attributes.

This adapter can be customized through various bean properties. A common use case is to apply shared binder initialization logic through a custom WebBindingInitializer.

Since:
2.5
Author:
Juergen Hoeller, Arjen Poutsma
See Also:
setPathMatcher(org.springframework.util.PathMatcher),
setMethodNameResolver(org.springframework.web.servlet.mvc.multiaction.MethodNameResolver),
setWebBindingInitializer(org.springframework.web.bind.support.WebBindingInitializer),
setSessionAttributeStore(org.springframework.web.bind.support.SessionAttributeStore)

Field Summary
static String | PAGE_NOT_FOUND_LOG_CATEGORY Log category to use when no mapped handler is found for a request.
protected static Log | pageNotFoundLogger Additional logger to use when no mapped handler is found for a request.
Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator
METHOD_GET, METHOD_HEAD, METHOD_POST
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AnnotationMethodHandlerAdapter()
Method Summary
protected ServletRequestDataBinder | createBinder(HttpServletRequest request, Object target, String objectName) Template method for creating a new ServletRequestDataBinder instance.
protected HttpInputMessage | createHttpInputMessage(HttpServletRequest servletRequest) Template method for creating a new HttpInputMessage instance.
protected HttpOutputMessage | createHttpOutputMessage(HttpServletResponse servletResponse) Template method for creating a new HttpOuputMessage instance.
long | getLastModified(HttpServletRequest request, Object handler) Same contract as for HttpServlet's getLastModified method.
HttpMessageConverter<?>[] | getMessageConverters() Return the message body converters that this adapter has been configured with.
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
ModelAndView | handle(HttpServletRequest request, HttpServletResponse response, Object handler) Use the given handler to handle this request.
protected ModelAndView | invokeHandlerMethod(HttpServletRequest request, HttpServletResponse response, Object handler)
void | setAlwaysUseFullPath(boolean alwaysUseFullPath) Set if URL lookup should always use the full path within the current servlet context.
void | setBeanFactory(BeanFactory beanFactory) Callback that supplies the owning factory to a bean instance.
void | setCacheSecondsForSessionAttributeHandlers(int cacheSecondsForSessionAttributeHandlers) Cache content produced by @SessionAttributes annotated handlers for the given number of seconds.
void | setCustomArgumentResolver(WebArgumentResolver argumentResolver) Set a custom WebArgumentResolvers to use for special method parameter types.
void | setCustomArgumentResolvers(WebArgumentResolver[] argumentResolvers) Set one or more custom WebArgumentResolvers to use for special method parameter types.
void | setCustomModelAndViewResolver(ModelAndViewResolver customModelAndViewResolver) Set a custom ModelAndViewResolvers to use for special method return types.
void | setCustomModelAndViewResolvers(ModelAndViewResolver[] customModelAndViewResolvers) Set one or more custom ModelAndViewResolvers to use for special method return types.
void | setMessageConverters(HttpMessageConverter<?>[] messageConverters) Set the message body converters to use.
void | setMethodNameResolver(MethodNameResolver methodNameResolver) Set the MethodNameResolver to use for resolving default handler methods (carrying an empty @RequestMapping annotation).
void | setOrder(int order) Specify the order value for this HandlerAdapter bean.
void | setParameterNameDiscoverer(ParameterNameDiscoverer parameterNameDiscoverer) Set the ParameterNameDiscoverer to use for resolving method parameter names if needed (e.g.
void | setPathMatcher(PathMatcher pathMatcher) Set the PathMatcher implementation to use for matching URL paths against registered URL patterns.
void | setSessionAttributeStore(SessionAttributeStore sessionAttributeStore) Specify the strategy to store session attributes with.
void | setSynchronizeOnSession(boolean synchronizeOnSession) Set if controller execution should be synchronized on the session, to serialize parallel invocations from the same client.
void | setUrlDecode(boolean urlDecode) Set if context path and request URI should be URL-decoded.
void | setUrlPathHelper(UrlPathHelper urlPathHelper) Set the UrlPathHelper to use for resolution of lookup paths.
void | setWebBindingInitializer(WebBindingInitializer webBindingInitializer) Specify a WebBindingInitializer which will apply pre-configured configuration to every DataBinder that this controller uses.
boolean | supports(Object handler) Given a handler instance, return whether or not this HandlerAdapter can support it.
Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

PAGE_NOT_FOUND_LOG_CATEGORY

public static final String PAGE_NOT_FOUND_LOG_CATEGORY
Log category to use when no mapped handler is found for a request.

See Also:
pageNotFoundLogger, Constant Field Values

pageNotFoundLogger

protected static final Log pageNotFoundLogger
Additional logger to use when no mapped handler is found for a request.

See Also:
PAGE_NOT_FOUND_LOG_CATEGORY
Constructor Detail

AnnotationMethodHandlerAdapter

public AnnotationMethodHandlerAdapter()
Method Detail

setAlwaysUseFullPath

public void setAlwaysUseFullPath(boolean alwaysUseFullPath)
Set if URL lookup should always use the full path within the current servlet context. Else, the path within the current servlet mapping is used if applicable (that is, in the case of a ".../*" servlet mapping in web.xml).

Default is "false".

See Also:
UrlPathHelper.setAlwaysUseFullPath(boolean)

setUrlDecode

public void setUrlDecode(boolean urlDecode)
Set if context path and request URI should be URL-decoded. Both are returned undecoded by the Servlet API, in contrast to the servlet path.

Uses either the request encoding or the default encoding according to the Servlet spec (ISO-8859-1).

See Also:
UrlPathHelper.setUrlDecode(boolean)

setUrlPathHelper

public void setUrlPathHelper(UrlPathHelper urlPathHelper)
Set the UrlPathHelper to use for resolution of lookup paths.

Use this to override the default UrlPathHelper with a custom subclass, or to share common UrlPathHelper settings across multiple HandlerMappings and HandlerAdapters.

setPathMatcher

public void setPathMatcher(PathMatcher pathMatcher)
Set the PathMatcher implementation to use for matching URL paths against registered URL patterns.

Default is AntPathMatcher.

setMethodNameResolver

public void setMethodNameResolver(MethodNameResolver methodNameResolver)
Set the MethodNameResolver to use for resolving default handler methods (carrying an empty @RequestMapping annotation).

Will only kick in when the handler method cannot be resolved uniquely through the annotation metadata already.

setWebBindingInitializer

public void setWebBindingInitializer(WebBindingInitializer webBindingInitializer)
Specify a WebBindingInitializer which will apply pre-configured configuration to every DataBinder that this controller uses.

setSessionAttributeStore

public void setSessionAttributeStore(SessionAttributeStore sessionAttributeStore)
Specify the strategy to store session attributes with.

Default is DefaultSessionAttributeStore, storing session attributes in the HttpSession, using the same attribute name as in the model.

setCacheSecondsForSessionAttributeHandlers

public void setCacheSecondsForSessionAttributeHandlers(int cacheSecondsForSessionAttributeHandlers)
Cache content produced by @SessionAttributes annotated handlers for the given number of seconds. Default is 0, preventing caching completely.

In contrast to the "cacheSeconds" property which will apply to all general handlers (but not to @SessionAttributes annotated handlers), this setting will apply to @SessionAttributes annotated handlers only.

See Also:
WebContentGenerator.setCacheSeconds(int), SessionAttributes

setSynchronizeOnSession

public void setSynchronizeOnSession(boolean synchronizeOnSession)
Set if controller execution should be synchronized on the session, to serialize parallel invocations from the same client.

More specifically, the execution of the handleRequestInternal method will get synchronized if this flag is "true". The best available session mutex will be used for the synchronization; ideally, this will be a mutex exposed by HttpSessionMutexListener.

The session mutex is guaranteed to be the same object during the entire lifetime of the session, available under the key defined by the SESSION_MUTEX_ATTRIBUTE constant. It serves as a safe reference to synchronize on for locking on the current session.

In many cases, the HttpSession reference itself is a safe mutex as well, since it will always be the same object reference for the same active logical session. However, this is not guaranteed across different servlet containers; the only 100% safe way is a session mutex.

See Also:
HttpSessionMutexListener, WebUtils.getSessionMutex(javax.servlet.http.HttpSession)

setParameterNameDiscoverer

public void setParameterNameDiscoverer(ParameterNameDiscoverer parameterNameDiscoverer)
Set the ParameterNameDiscoverer to use for resolving method parameter names if needed (e.g. for default attribute names).

Default is a LocalVariableTableParameterNameDiscoverer.

setCustomArgumentResolver

public void setCustomArgumentResolver(WebArgumentResolver argumentResolver)
Set a custom WebArgumentResolvers to use for special method parameter types.

Such a custom WebArgumentResolver will kick in first, having a chance to resolve an argument value before the standard argument handling kicks in.

setCustomArgumentResolvers

public void setCustomArgumentResolvers(WebArgumentResolver[] argumentResolvers)
Set one or more custom WebArgumentResolvers to use for special method parameter types.

Any such custom WebArgumentResolver will kick in first, having a chance to resolve an argument value before the standard argument handling kicks in.

setCustomModelAndViewResolver

public void setCustomModelAndViewResolver(ModelAndViewResolver customModelAndViewResolver)
Set a custom ModelAndViewResolvers to use for special method return types.

Such a custom ModelAndViewResolver will kick in first, having a chance to resolve a return value before the standard ModelAndView handling kicks in.

setCustomModelAndViewResolvers

public void setCustomModelAndViewResolvers(ModelAndViewResolver[] customModelAndViewResolvers)
Set one or more custom ModelAndViewResolvers to use for special method return types.

Any such custom ModelAndViewResolver will kick in first, having a chance to resolve a return value before the standard ModelAndView handling kicks in.

setMessageConverters

public void setMessageConverters(HttpMessageConverter<?>[] messageConverters)
Set the message body converters to use.

These converters are used to convert from and to HTTP requests and responses.

getMessageConverters

public HttpMessageConverter<?>[] getMessageConverters()
Return the message body converters that this adapter has been configured with.

setOrder

public void setOrder(int order)
Specify the order value for this HandlerAdapter bean.

Default value is Integer.MAX_VALUE, meaning that it's non-ordered.

See Also:
Ordered.getOrder()

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:
BeanInitializationException

supports

public boolean supports(Object handler)
Description copied from interface: HandlerAdapter
Given a handler instance, return whether or not this HandlerAdapter can support it. Typical HandlerAdapters will base the decision on the handler type. HandlerAdapters will usually only support one handler type each.

A typical implementation:

return (handler instanceof MyHandler);

Specified by:
supports in interface HandlerAdapter
Parameters:
handler - handler object to check
Returns:
whether or not this object can use the given handler

handle

public ModelAndView handle(HttpServletRequest request,
                           HttpServletResponse response,
                           Object handler)
                    throws Exception
Description copied from interface: HandlerAdapter
Use the given handler to handle this request. The workflow that is required may vary widely.

Specified by:
handle in interface HandlerAdapter
Parameters:
request - current HTTP request
response - current HTTP response
handler - handler to use. This object must have previously been passed to the supports method of this interface, which must have returned true.
Returns:
ModelAndView object with the name of the view and the required model data, or null if the request has been handled directly
Throws:
Exception - in case of errors

invokeHandlerMethod

protected ModelAndView invokeHandlerMethod(HttpServletRequest request,
                                           HttpServletResponse response,
                                           Object handler)
                                    throws Exception
Throws:
Exception

getLastModified

public long getLastModified(HttpServletRequest request,
                            Object handler)
Description copied from interface: HandlerAdapter
Same contract as for HttpServlet's getLastModified method. Can simply return -1 if there's no support in the handler class.

Specified by:
getLastModified in interface HandlerAdapter
Parameters:
request - current HTTP request
handler - handler to use
Returns:
the lastModified value for the given handler
See Also:
HttpServlet.getLastModified(javax.servlet.http.HttpServletRequest), LastModified.getLastModified(javax.servlet.http.HttpServletRequest)

createBinder

protected ServletRequestDataBinder createBinder(HttpServletRequest request,
                                                Object target,
                                                String objectName)
                                         throws Exception
Template method for creating a new ServletRequestDataBinder instance.

The default implementation creates a standard ServletRequestDataBinder. This can be overridden for custom ServletRequestDataBinder subclasses.

Parameters:
request - current HTTP request
target - the target object to bind onto (or null if the binder is just used to convert a plain parameter value)
objectName - the objectName of the target object
Returns:
the ServletRequestDataBinder instance to use
Throws:
Exception - in case of invalid state or arguments
See Also:
ServletRequestDataBinder.bind(javax.servlet.ServletRequest), DataBinder.convertIfNecessary(Object, Class, org.springframework.core.MethodParameter)

createHttpInputMessage

protected HttpInputMessage createHttpInputMessage(HttpServletRequest servletRequest)
                                           throws Exception
Template method for creating a new HttpInputMessage instance.

The default implementation creates a standard ServletServerHttpRequest. This can be overridden for custom HttpInputMessage implementations

Parameters:
servletRequest - current HTTP request
Returns:
the HttpInputMessage instance to use
Throws:
Exception - in case of errors

createHttpOutputMessage

protected HttpOutputMessage createHttpOutputMessage(HttpServletResponse servletResponse)
                                             throws Exception
Template method for creating a new HttpOuputMessage instance.

The default implementation creates a standard ServletServerHttpResponse. This can be overridden for custom HttpOutputMessage implementations

Parameters:
servletResponse - current HTTP response
Returns:
the HttpInputMessage instance to use
Throws:
Exception - in case of errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AnnotationMethodHandlerExceptionResolver

org.springframework.web.servlet.mvc.annotation
Class AnnotationMethodHandlerExceptionResolver

java.lang.Object
    extended by  org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
        extended by  org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver
All Implemented Interfaces:
Ordered, HandlerExceptionResolver
public class AnnotationMethodHandlerExceptionResolver
extends AbstractHandlerExceptionResolver

Implementation of the HandlerExceptionResolver interface that handles exceptions through the ExceptionHandler annotation.

This exception resolver is enabled by default in the DispatcherServlet.

Since:
3.0
Author:
Arjen Poutsma

Field Summary
Fields inherited from class org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AnnotationMethodHandlerExceptionResolver()
Method Summary
protected ModelAndView | doResolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) Actually resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.
protected List<Class<? extends Throwable>> | getHandledExceptions(Method method) Returns all the exception classes handled by the given method.
protected Object | resolveCommonArgument(MethodParameter methodParameter, NativeWebRequest webRequest, Exception thrownException) Resolves common method arguments.
protected Object | resolveStandardArgument(Class parameterType, NativeWebRequest webRequest, Exception thrownException) Resolves standard method arguments.
void | setCustomArgumentResolver(WebArgumentResolver argumentResolver) Set a custom ArgumentResolvers to use for special method parameter types.
void | setCustomArgumentResolvers(WebArgumentResolver[] argumentResolvers) Set one or more custom ArgumentResolvers to use for special method parameter types.
void | setMessageConverters(HttpMessageConverter<?>[] messageConverters) Set the message body converters to use.
Methods inherited from class org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
buildLogMessage, getOrder, logException, resolveException, setMappedHandlerClasses, setMappedHandlers, setOrder, setWarnLogCategory, shouldApplyTo
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AnnotationMethodHandlerExceptionResolver

public AnnotationMethodHandlerExceptionResolver()
Method Detail

setCustomArgumentResolver

public void setCustomArgumentResolver(WebArgumentResolver argumentResolver)
Set a custom ArgumentResolvers to use for special method parameter types.

Such a custom ArgumentResolver will kick in first, having a chance to resolve an argument value before the standard argument handling kicks in.

setCustomArgumentResolvers

public void setCustomArgumentResolvers(WebArgumentResolver[] argumentResolvers)
Set one or more custom ArgumentResolvers to use for special method parameter types.

Any such custom ArgumentResolver will kick in first, having a chance to resolve an argument value before the standard argument handling kicks in.

setMessageConverters

public void setMessageConverters(HttpMessageConverter<?>[] messageConverters)
Set the message body converters to use.

These converters are used to convert from and to HTTP requests and responses.

doResolveException

protected ModelAndView doResolveException(HttpServletRequest request,
                                          HttpServletResponse response,
                                          Object handler,
                                          Exception ex)
Description copied from class: AbstractHandlerExceptionResolver
Actually resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.

May be overridden in subclasses, in order to apply specific exception checks. Note that this template method will be invoked after checking whether this resolved applies ("mappedHandlers" etc), so an implementation may simply proceed with its actual exception handling.

Specified by:
doResolveException in class AbstractHandlerExceptionResolver
Parameters:
request - current HTTP request
response - current HTTP response
handler - the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
ex - the exception that got thrown during handler execution
Returns:
a corresponding ModelAndView to forward to, or null for default processing

getHandledExceptions

protected List<Class<? extends Throwable>> getHandledExceptions(Method method)
Returns all the exception classes handled by the given method.

The default implementation looks for exceptions in the annotation, or - if that annotation element is empty - any exceptions listed in the method parameters if the method is annotated with @ExceptionHandler.

Parameters:
method - the method
Returns:
the handled exceptions

resolveCommonArgument

protected Object resolveCommonArgument(MethodParameter methodParameter,
                                       NativeWebRequest webRequest,
                                       Exception thrownException)
                                throws Exception
Resolves common method arguments. Delegates to registered argumentResolvers first, then checking resolveStandardArgument(java.lang.Class, org.springframework.web.context.request.NativeWebRequest, java.lang.Exception).

Parameters:
methodParameter - the method parameter
webRequest - the request
thrownException - the exception thrown
Returns:
the argument value, or WebArgumentResolver.UNRESOLVED
Throws:
Exception

resolveStandardArgument

protected Object resolveStandardArgument(Class parameterType,
                                         NativeWebRequest webRequest,
                                         Exception thrownException)
                                  throws Exception
Resolves standard method arguments. The default implementation handles NativeWebRequest, ServletRequest, ServletResponse, HttpSession, Principal, Locale, request InputStream, request Reader, response OutputStream, response Writer, and the given thrownException.

Parameters:
parameterType - the method parameter type
webRequest - the request
thrownException - the exception thrown
Returns:
the argument value, or WebArgumentResolver.UNRESOLVED
Throws:
Exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultAnnotationHandlerMapping

org.springframework.web.servlet.mvc.annotation
Class DefaultAnnotationHandlerMapping

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.handler.AbstractHandlerMapping
                extended by  org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
                    extended by  org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping
                        extended by  org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping
All Implemented Interfaces:
ApplicationContextAware, Ordered, ServletContextAware, HandlerMapping
public class DefaultAnnotationHandlerMapping
extends AbstractDetectingUrlHandlerMapping

Implementation of the HandlerMapping interface that maps handlers based on HTTP paths expressed through the RequestMapping annotation at the type or method level.

Registered by default in DispatcherServlet on Java 5+. NOTE: If you define custom HandlerMapping beans in your DispatcherServlet context, you need to add a DefaultAnnotationHandlerMapping bean explicitly, since custom HandlerMapping beans replace the default mapping strategies. Defining a DefaultAnnotationHandlerMapping also allows for registering custom interceptors:

 <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
   <property name="interceptors">
     ...
   </property>
 </bean>
Annotated controllers are usually marked with the Controller stereotype at the type level. This is not strictly necessary when RequestMapping is applied at the type level (since such a handler usually implements the Controller interface). However, Controller is required for detecting RequestMapping annotations at the method level if RequestMapping is not present at the type level.

NOTE: Method-level mappings are only allowed to narrow the mapping expressed at the class level (if any). HTTP paths need to uniquely map onto specific handler beans, with any given HTTP path only allowed to be mapped onto one specific handler bean (not spread across multiple handler beans). It is strongly recommended to co-locate related handler methods into the same bean.

The AnnotationMethodHandlerAdapter is responsible for processing annotated handler methods, as mapped by this HandlerMapping. For RequestMapping at the type level, specific HandlerAdapters such as SimpleControllerHandlerAdapter apply.

Since:
2.5
Author:
Juergen Hoeller, Arjen Poutsma
See Also:
RequestMapping, AnnotationMethodHandlerAdapter

Field Summary
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.HandlerMapping
BEST_MATCHING_PATTERN_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTE
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
DefaultAnnotationHandlerMapping()
Method Summary
protected void | addUrlsForPath(Set<String> urls, String path) Add URLs and/or URL patterns for the given path.
protected String[] | determineUrlsForHandler(String beanName) Checks for presence of the RequestMapping annotation on the handler class and on any of its methods.
protected String[] | determineUrlsForHandlerMethods(Class<?> handlerType) Derive URL mappings from the handler's method-level mappings.
protected String[] | determineUrlsForHandlerMethods(Class<?> handlerType, boolean hasTypeLevelMapping) Derive URL mappings from the handler's method-level mappings.
void | setUseDefaultSuffixPattern(boolean useDefaultSuffixPattern) Set whether to register paths using the default suffix pattern as well: i.e.
protected void | validateHandler(Object handler, HttpServletRequest request) Validate the given annotated handler against the current request.
protected void | validateMapping(RequestMapping mapping, HttpServletRequest request) Validate the given type-level mapping metadata against the current request, checking HTTP request method and parameter conditions.
Methods inherited from class org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping
detectHandlers, initApplicationContext, setDetectHandlersInAncestorContexts
Methods inherited from class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
buildPathExposingHandler, exposePathWithinMapping, exposeUriTemplateVariables, getHandlerInternal, getHandlerMap, getPathMatcher, getRootHandler, initInterceptors, lookupHandler, registerHandler, registerHandler, setAlwaysUseFullPath, setLazyInitHandlers, setMappedInterceptors, setPathMatcher, setRootHandler, setUrlDecode, setUrlPathHelper
Methods inherited from class org.springframework.web.servlet.handler.AbstractHandlerMapping
adaptInterceptor, extendInterceptors, getAdaptedInterceptors, getDefaultHandler, getHandler, getHandlerExecutionChain, getOrder, setDefaultHandler, setInterceptors, setOrder
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DefaultAnnotationHandlerMapping

public DefaultAnnotationHandlerMapping()
Method Detail

setUseDefaultSuffixPattern

public void setUseDefaultSuffixPattern(boolean useDefaultSuffixPattern)
Set whether to register paths using the default suffix pattern as well: i.e. whether "/users" should be registered as "/users.*" and "/users/" too.

Default is "true". Turn this convention off if you intend to interpret your @RequestMapping paths strictly.

Note that paths which include a ".xxx" suffix or end with "/" already will not be transformed using the default suffix pattern in any case.

determineUrlsForHandler

protected String[] determineUrlsForHandler(String beanName)
Checks for presence of the RequestMapping annotation on the handler class and on any of its methods.

Specified by:
determineUrlsForHandler in class AbstractDetectingUrlHandlerMapping
Parameters:
beanName - the name of the candidate bean
Returns:
the URLs determined for the bean, or null or an empty array if none

determineUrlsForHandlerMethods

protected String[] determineUrlsForHandlerMethods(Class<?> handlerType,
                                                  boolean hasTypeLevelMapping)
Derive URL mappings from the handler's method-level mappings.

Parameters:
handlerType - the handler type to introspect
hasTypeLevelMapping - whether the method-level mappings are nested within a type-level mapping
Returns:
the array of mapped URLs

determineUrlsForHandlerMethods

protected String[] determineUrlsForHandlerMethods(Class<?> handlerType)
Derive URL mappings from the handler's method-level mappings.

Parameters:
handlerType - the handler type to introspect
Returns:
the array of mapped URLs

addUrlsForPath

protected void addUrlsForPath(Set<String> urls,
                              String path)
Add URLs and/or URL patterns for the given path.

Parameters:
urls - the Set of URLs for the current bean
path - the currently introspected path

validateHandler

protected void validateHandler(Object handler,
                               HttpServletRequest request)
                        throws Exception
Validate the given annotated handler against the current request.

Overrides:
validateHandler in class AbstractUrlHandlerMapping
Parameters:
handler - the handler object to validate
request - current HTTP request
Throws:
Exception - if validation failed
See Also:
validateMapping(org.springframework.web.bind.annotation.RequestMapping, javax.servlet.http.HttpServletRequest)

validateMapping

protected void validateMapping(RequestMapping mapping,
                               HttpServletRequest request)
                        throws Exception
Validate the given type-level mapping metadata against the current request, checking HTTP request method and parameter conditions.

Parameters:
mapping - the mapping metadata to validate
request - current HTTP request
Throws:
Exception - if validation failed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResponseStatusExceptionResolver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.mvc.annotation
Class ResponseStatusExceptionResolver

java.lang.Object
    extended by  org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
        extended by  org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver
All Implemented Interfaces:
Ordered, HandlerExceptionResolver
public class ResponseStatusExceptionResolver
extends AbstractHandlerExceptionResolver

Implementation of the HandlerExceptionResolver interface that uses the @ResponseStatus annotation to map exceptions to HTTP status codes.

This exception resolver is enabled by default in the DispatcherServlet.

Since:
3.0
Author:
Arjen Poutsma

Field Summary
Fields inherited from class org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
ResponseStatusExceptionResolver()
Method Summary
protected ModelAndView | doResolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) Actually resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.
protected ModelAndView | resolveResponseStatus(ResponseStatus responseStatus, HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) Template method that handles @ResponseStatus annotation.
Methods inherited from class org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
buildLogMessage, getOrder, logException, resolveException, setMappedHandlerClasses, setMappedHandlers, setOrder, setWarnLogCategory, shouldApplyTo
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ResponseStatusExceptionResolver

public ResponseStatusExceptionResolver()
Method Detail

doResolveException

protected ModelAndView doResolveException(HttpServletRequest request,
                                          HttpServletResponse response,
                                          Object handler,
                                          Exception ex)
Description copied from class: AbstractHandlerExceptionResolver
Actually resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.

May be overridden in subclasses, in order to apply specific exception checks. Note that this template method will be invoked after checking whether this resolved applies ("mappedHandlers" etc), so an implementation may simply proceed with its actual exception handling.

Specified by:
doResolveException in class AbstractHandlerExceptionResolver
Parameters:
request - current HTTP request
response - current HTTP response
handler - the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
ex - the exception that got thrown during handler execution
Returns:
a corresponding ModelAndView to forward to, or null for default processing

resolveResponseStatus

protected ModelAndView resolveResponseStatus(ResponseStatus responseStatus,
                                             HttpServletRequest request,
                                             HttpServletResponse response,
                                             Object handler,
                                             Exception ex)
                                      throws Exception
Template method that handles @ResponseStatus annotation.

Default implementation send a response error using HttpServletResponse.sendError(int), or HttpServletResponse.sendError(int, String) if the annotation has a reason. Returns an empty ModelAndView.

Parameters:
responseStatus - the annotation
request - current HTTP request
response - current HTTP response
handler - the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
ex - the exception that got thrown during handler execution
Returns:
a corresponding ModelAndView to forward to, or null for default processing
Throws:
Exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.servlet.mvc.multiaction

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.servlet.mvc.multiaction

Package allowing MVC Controller implementations to handle requests at method rather than class level.

See:
Description

Interface Summary
MethodNameResolver Interface that parameterizes the MultiActionController class using the Strategy GoF Design pattern, allowing the mapping from incoming request to handler method name to be varied without affecting other application code.

Class Summary
AbstractUrlMethodNameResolver | Abstract base class for URL-based MethodNameResolver implementations.
InternalPathMethodNameResolver | Simple implementation of MethodNameResolver that maps URL to method name.
MultiActionController | Controller implementation that allows multiple request types to be handled by the same class.
ParameterMethodNameResolver | Implementation of MethodNameResolver which supports several strategies for mapping parameter values to the names of methods to invoke.
PropertiesMethodNameResolver | The most flexible out-of-the-box implementation of the MethodNameResolver interface.

Exception Summary
NoSuchRequestHandlingMethodException Exception thrown when there is no handler method ("action" method) for a specific HTTP request.

Package org.springframework.web.servlet.mvc.multiaction Description

Package allowing MVC Controller implementations to handle requests at method rather than class level. This is useful when we want to avoid having many trivial controller classes, as can easily happen when using an MVC framework.

Typically a controller that handles multiple request types will extend MultiActionController, and implement multiple request handling methods that will be invoked by reflection if they follow this class' naming convention. Classes are analyzed at startup and methods cached, so the performance overhead of reflection in this approach is negligible.

This approach is analogous to the Struts 1.1 DispatcherAction class, but more sophisticated, as it supports configurable mapping from requests to URLs and allows for delegation as well as subclassing.

This package is discussed in Chapter 12 of Expert One-On-One J2EE Design and Development by Rod Johnson, and used in the sample application.


org.springframework.web.servlet.mvc.multiaction Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.servlet.mvc.multiaction

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.web.servlet.mvc.multiaction.AbstractUrlMethodNameResolver (implements org.springframework.web.servlet.mvc.multiaction.MethodNameResolver)
      • org.springframework.web.servlet.mvc.multiaction.InternalPathMethodNameResolver
      • org.springframework.web.servlet.mvc.multiaction.PropertiesMethodNameResolver (implements org.springframework.beans.factory.InitializingBean)
    • org.springframework.context.support.ApplicationObjectSupport (implements org.springframework.context.ApplicationContextAware)
      • org.springframework.web.context.support.WebApplicationObjectSupport (implements org.springframework.web.context.ServletContextAware)
        • org.springframework.web.servlet.support.WebContentGenerator
          • org.springframework.web.servlet.mvc.AbstractController (implements org.springframework.web.servlet.mvc.Controller)
            • org.springframework.web.servlet.mvc.multiaction.MultiActionController (implements org.springframework.web.servlet.mvc.LastModified)
    • org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver (implements org.springframework.web.servlet.mvc.multiaction.MethodNameResolver)
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • javax.servlet.ServletException
          • org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException

Interface Hierarchy

  • org.springframework.web.servlet.mvc.multiaction.MethodNameResolver


MethodNameResolver

org.springframework.web.servlet.mvc.multiaction
Interface MethodNameResolver

All Known Implementing Classes:
AbstractUrlMethodNameResolver, InternalPathMethodNameResolver, ParameterMethodNameResolver, PropertiesMethodNameResolver
public interface MethodNameResolver

Interface that parameterizes the MultiActionController class using the Strategy GoF Design pattern, allowing the mapping from incoming request to handler method name to be varied without affecting other application code.

Illustrates how delegation can be more flexible than subclassing.

Author:
Rod Johnson
See Also:
MultiActionController.setMethodNameResolver(org.springframework.web.servlet.mvc.multiaction.MethodNameResolver)

Method Summary
 String getHandlerMethodName(HttpServletRequest request)
Return a method name that can handle this request.

Method Detail

getHandlerMethodName

String getHandlerMethodName(HttpServletRequest request)
                            throws NoSuchRequestHandlingMethodException
Return a method name that can handle this request. Such mappings are typically, but not necessarily, based on URL.

Parameters:
request - current HTTP request
Returns:
a method name that can handle this request. Never returns null; throws exception if not resolvable.
Throws:
NoSuchRequestHandlingMethodException - if no handler method can be found for the given request
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractUrlMethodNameResolver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.mvc.multiaction
Class AbstractUrlMethodNameResolver

java.lang.Object
    extended by  org.springframework.web.servlet.mvc.multiaction.AbstractUrlMethodNameResolver
All Implemented Interfaces:
MethodNameResolver
Direct Known Subclasses:
InternalPathMethodNameResolver, PropertiesMethodNameResolver
public abstract class AbstractUrlMethodNameResolver
extends Object
implements MethodNameResolver

Abstract base class for URL-based MethodNameResolver implementations.

Provides infrastructure for mapping handlers to URLs and configurable URL lookup. For information on the latter, see the setAlwaysUseFullPath(boolean) "alwaysUseFullPath"} and "urlDecode" properties.

Since:
14.01.2004
Author:
Juergen Hoeller

Field Summary
protected  Log logger
Logger available to subclasses
Constructor Summary
AbstractUrlMethodNameResolver()
Method Summary
String | getHandlerMethodName(HttpServletRequest request) Retrieves the URL path to use for lookup and delegates to getHandlerMethodNameForUrlPath.
protected abstract String | getHandlerMethodNameForUrlPath(String urlPath) Return a method name that can handle this request, based on the given lookup path.
void | setAlwaysUseFullPath(boolean alwaysUseFullPath) Set if URL lookup should always use full path within current servlet context.
void | setUrlDecode(boolean urlDecode) Set if context path and request URI should be URL-decoded.
void | setUrlPathHelper(UrlPathHelper urlPathHelper) Set the UrlPathHelper to use for resolution of lookup paths.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

AbstractUrlMethodNameResolver

public AbstractUrlMethodNameResolver()
Method Detail

setAlwaysUseFullPath

public void setAlwaysUseFullPath(boolean alwaysUseFullPath)
Set if URL lookup should always use full path within current servlet context. Else, the path within the current servlet mapping is used if applicable (i.e. in the case of a ".../*" servlet mapping in web.xml). Default is "false".

See Also:
UrlPathHelper.setAlwaysUseFullPath(boolean)

setUrlDecode

public void setUrlDecode(boolean urlDecode)
Set if context path and request URI should be URL-decoded. Both are returned undecoded by the Servlet API, in contrast to the servlet path.

Uses either the request encoding or the default encoding according to the Servlet spec (ISO-8859-1).

See Also:
UrlPathHelper.setUrlDecode(boolean)

setUrlPathHelper

public void setUrlPathHelper(UrlPathHelper urlPathHelper)
Set the UrlPathHelper to use for resolution of lookup paths.

Use this to override the default UrlPathHelper with a custom subclass, or to share common UrlPathHelper settings across multiple MethodNameResolvers and HandlerMappings.

See Also:
AbstractUrlHandlerMapping.setUrlPathHelper(org.springframework.web.util.UrlPathHelper)

getHandlerMethodName

public final String getHandlerMethodName(HttpServletRequest request)
                                  throws NoSuchRequestHandlingMethodException
Retrieves the URL path to use for lookup and delegates to getHandlerMethodNameForUrlPath. Converts null values to NoSuchRequestHandlingMethodExceptions.

Specified by:
getHandlerMethodName in interface MethodNameResolver
Parameters:
request - current HTTP request
Returns:
a method name that can handle this request. Never returns null; throws exception if not resolvable.
Throws:
NoSuchRequestHandlingMethodException - if no handler method can be found for the given request
See Also:
getHandlerMethodNameForUrlPath(java.lang.String)

getHandlerMethodNameForUrlPath

protected abstract String getHandlerMethodNameForUrlPath(String urlPath)
Return a method name that can handle this request, based on the given lookup path. Called by getHandlerMethodName.

Parameters:
urlPath - the URL path to use for lookup, according to the settings in this class
Returns:
a method name that can handle this request. Should return null if no matching method found.
See Also:
getHandlerMethodName(javax.servlet.http.HttpServletRequest), setAlwaysUseFullPath(boolean), setUrlDecode(boolean)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


InternalPathMethodNameResolver

org.springframework.web.servlet.mvc.multiaction
Class InternalPathMethodNameResolver

java.lang.Object
    extended by  org.springframework.web.servlet.mvc.multiaction.AbstractUrlMethodNameResolver
        extended by  org.springframework.web.servlet.mvc.multiaction.InternalPathMethodNameResolver
All Implemented Interfaces:
MethodNameResolver
public class InternalPathMethodNameResolver
extends AbstractUrlMethodNameResolver

Simple implementation of MethodNameResolver that maps URL to method name. Although this is the default implementation used by the MultiActionController class (because it requires no configuration), it's bit naive for most applications. In particular, we don't usually want to tie URL to implementation methods.

Maps the resource name after the last slash, ignoring an extension. E.g. "/foo/bar/baz.html" to "baz", assuming a "/foo/bar/baz.html" controller mapping to the corresponding MultiActionController handler. method. Doesn't support wildcards.

Author:
Rod Johnson, Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.web.servlet.mvc.multiaction.AbstractUrlMethodNameResolver
logger
Constructor Summary
InternalPathMethodNameResolver()
Method Summary
protected String | extractHandlerMethodNameFromUrlPath(String uri) Extract the handler method name from the given request URI.
protected String | getHandlerMethodNameForUrlPath(String urlPath) Extracts the method name indicated by the URL path.
protected String | getPrefix() Return the common prefix for handler method names.
protected String | getSuffix() Return the common suffix for handler method names.
protected String | postProcessHandlerMethodName(String methodName) Build the full handler method name based on the given method name as indicated by the URL path.
void | setPrefix(String prefix) Specify a common prefix for handler method names.
void | setSuffix(String suffix) Specify a common suffix for handler method names.
Methods inherited from class org.springframework.web.servlet.mvc.multiaction.AbstractUrlMethodNameResolver
getHandlerMethodName, setAlwaysUseFullPath, setUrlDecode, setUrlPathHelper
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

InternalPathMethodNameResolver

public InternalPathMethodNameResolver()
Method Detail

setPrefix

public void setPrefix(String prefix)
Specify a common prefix for handler method names. Will be prepended to the internal path found in the URL: e.g. internal path "baz", prefix "my" -> method name "mybaz".

getPrefix

protected String getPrefix()
Return the common prefix for handler method names.

setSuffix

public void setSuffix(String suffix)
Specify a common suffix for handler method names. Will be appended to the internal path found in the URL: e.g. internal path "baz", suffix "Handler" -> method name "bazHandler".

getSuffix

protected String getSuffix()
Return the common suffix for handler method names.

getHandlerMethodNameForUrlPath

protected String getHandlerMethodNameForUrlPath(String urlPath)
Extracts the method name indicated by the URL path.

Specified by:
getHandlerMethodNameForUrlPath in class AbstractUrlMethodNameResolver
Parameters:
urlPath - the URL path to use for lookup, according to the settings in this class
Returns:
a method name that can handle this request. Should return null if no matching method found.
See Also:
extractHandlerMethodNameFromUrlPath(java.lang.String), postProcessHandlerMethodName(java.lang.String)

extractHandlerMethodNameFromUrlPath

protected String extractHandlerMethodNameFromUrlPath(String uri)
Extract the handler method name from the given request URI. Delegates to WebUtils.extractViewNameFromUrlPath(String).

Parameters:
uri - the request URI (e.g. "/index.html")
Returns:
the extracted URI filename (e.g. "index")
See Also:
WebUtils.extractFilenameFromUrlPath(java.lang.String)

postProcessHandlerMethodName

protected String postProcessHandlerMethodName(String methodName)
Build the full handler method name based on the given method name as indicated by the URL path.

The default implementation simply applies prefix and suffix. This can be overridden, for example, to manipulate upper case / lower case, etc.

Parameters:
methodName - the original method name, as indicated by the URL path
Returns:
the full method name to use
See Also:
getPrefix(), getSuffix()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MultiActionController

org.springframework.web.servlet.mvc.multiaction
Class MultiActionController

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.support.WebContentGenerator
                extended by  org.springframework.web.servlet.mvc.AbstractController
                    extended by  org.springframework.web.servlet.mvc.multiaction.MultiActionController
All Implemented Interfaces:
ApplicationContextAware, ServletContextAware, Controller, LastModified
public class MultiActionController
extends AbstractController
implements LastModified

Controller implementation that allows multiple request types to be handled by the same class. Subclasses of this class can handle several different types of request with methods of the form

public (ModelAndView | Map | String | void) actionName(HttpServletRequest request, HttpServletResponse response, [,HttpSession] [,AnyObject]);
A Map return value indicates a model that is supposed to be passed to a default view (determined through a RequestToViewNameTranslator). A String return value indicates the name of a view to be rendered without a specific model.

May take a third parameter (of type HttpSession) in which an existing session will be required, or a third parameter of an arbitrary class that gets treated as the command (that is, an instance of the class gets created, and request parameters get bound to it)

These methods can throw any kind of exception, but should only let propagate those that they consider fatal, or which their class or superclass is prepared to catch by implementing an exception handler.

When returning just a Map instance view name translation will be used to generate the view name. The configured RequestToViewNameTranslator will be used to determine the view name.

When returning void a return value of null is assumed meaning that the handler method is responsible for writing the response directly to the supplied HttpServletResponse.

This model allows for rapid coding, but loses the advantage of compile-time checking. It is similar to a Struts DispatchAction, but more sophisticated. Also supports delegation to another object.

An implementation of the MethodNameResolver interface defined in this package should return a method name for a given request, based on any aspect of the request, such as its URL or an "action" parameter. The actual strategy can be configured via the "methodNameResolver" bean property, for each MultiActionController.

The default MethodNameResolver is InternalPathMethodNameResolver; further included strategies are PropertiesMethodNameResolver and ParameterMethodNameResolver.

Subclasses can implement custom exception handler methods with names such as:

public ModelAndView anyMeaningfulName(HttpServletRequest request, HttpServletResponse response, ExceptionClass exception);
The third parameter can be any subclass or Exception or RuntimeException.

There can also be an optional xxxLastModified method for handlers, of signature:

public long anyMeaningfulNameLastModified(HttpServletRequest request)
If such a method is present, it will be invoked. Default return from getLastModified is -1, meaning that the content must always be regenerated.

Note that all handler methods need to be public and that method overloading is not allowed.

See also the description of the workflow performed by the superclass (in that section of the class level Javadoc entitled 'workflow').

Note: For maximum data binding flexibility, consider direct usage of a ServletRequestDataBinder in your controller method, instead of relying on a declared command argument. This allows for full control over the entire binder setup and usage, including the invocation of Validators and the subsequent evaluation of binding/validation errors.

Author:
Rod Johnson, Juergen Hoeller, Colin Sampaleanu, Rob Harrop, Sam Brannen
See Also:
MethodNameResolver, InternalPathMethodNameResolver, PropertiesMethodNameResolver, ParameterMethodNameResolver, LastModified.getLastModified(javax.servlet.http.HttpServletRequest), ServletRequestDataBinder

Field Summary
static String | DEFAULT_COMMAND_NAME Default command name used for binding command objects: "command"
static String | LAST_MODIFIED_METHOD_SUFFIX Suffix for last-modified methods
static String | PAGE_NOT_FOUND_LOG_CATEGORY Log category to use when no mapped handler is found for a request.
protected static Log | pageNotFoundLogger Additional logger to use when no mapped handler is found for a request.
Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator
METHOD_GET, METHOD_HEAD, METHOD_POST
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Constructor Summary
MultiActionController()
Constructor for MultiActionController that looks for handler methods in the present subclass.
MultiActionController(Object delegate)
Constructor for MultiActionController that looks for handler methods in delegate, rather than a subclass of this class.
Method Summary
protected void | bind(HttpServletRequest request, Object command) Bind request parameters onto the given command bean
protected ServletRequestDataBinder | createBinder(HttpServletRequest request, Object command) Create a new binder instance for the given command and request.
protected String | getCommandName(Object command) Return the command name to use for the given command object.
protected Method | getExceptionHandler(Throwable exception) Determine the exception handler method for the given exception.
long | getLastModified(HttpServletRequest request) Try to find an XXXXLastModified method, where XXXX is the name of a handler.
MethodNameResolver | getMethodNameResolver() Return the MethodNameResolver used by this class.
Validator[] | getValidators() Return the Validators for this controller.
WebBindingInitializer | getWebBindingInitializer() Return the WebBindingInitializer (if any) which will apply pre-configured configuration to every DataBinder that this controller uses.
protected ModelAndView | handleNoSuchRequestHandlingMethod(NoSuchRequestHandlingMethodException ex, HttpServletRequest request, HttpServletResponse response) Handle the case where no request handler method was found.
protected ModelAndView | handleRequestInternal(HttpServletRequest request, HttpServletResponse response) Determine a handler method and invoke it.
protected void | initBinder(HttpServletRequest request, ServletRequestDataBinder binder) Initialize the given binder instance, for example with custom editors.
protected ModelAndView | invokeNamedMethod(String methodName, HttpServletRequest request, HttpServletResponse response) Invokes the named method.
protected Object | newCommandObject(Class clazz) Create a new command object of the given class.
void | setDelegate(Object delegate) Set the delegate used by this class; the default is this, assuming that handler methods have been added by a subclass.
void | setMethodNameResolver(MethodNameResolver methodNameResolver) Set the method name resolver that this class should use.
void | setValidators(Validator[] validators) Set the Validators for this controller.
void | setWebBindingInitializer(WebBindingInitializer webBindingInitializer) Specify a WebBindingInitializer which will apply pre-configured configuration to every DataBinder that this controller uses.
Methods inherited from class org.springframework.web.servlet.mvc.AbstractController
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession
Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

LAST_MODIFIED_METHOD_SUFFIX

public static final String LAST_MODIFIED_METHOD_SUFFIX
Suffix for last-modified methods

See Also:
Constant Field Values

DEFAULT_COMMAND_NAME

public static final String DEFAULT_COMMAND_NAME
Default command name used for binding command objects: "command"

See Also:
Constant Field Values

PAGE_NOT_FOUND_LOG_CATEGORY

public static final String PAGE_NOT_FOUND_LOG_CATEGORY
Log category to use when no mapped handler is found for a request.

See Also:
pageNotFoundLogger, Constant Field Values

pageNotFoundLogger

protected static final Log pageNotFoundLogger
Additional logger to use when no mapped handler is found for a request.

See Also:
PAGE_NOT_FOUND_LOG_CATEGORY
Constructor Detail

MultiActionController

public MultiActionController()
Constructor for MultiActionController that looks for handler methods in the present subclass.

MultiActionController

public MultiActionController(Object delegate)
Constructor for MultiActionController that looks for handler methods in delegate, rather than a subclass of this class.

Parameters:
delegate - handler object. This does not need to implement any particular interface, as everything is done using reflection.
Method Detail

setDelegate

public final void setDelegate(Object delegate)
Set the delegate used by this class; the default is this, assuming that handler methods have been added by a subclass.

This method does not get invoked once the class is configured.

Parameters:
delegate - an object containing handler methods
Throws:
IllegalStateException - if no handler methods are found

setMethodNameResolver

public final void setMethodNameResolver(MethodNameResolver methodNameResolver)
Set the method name resolver that this class should use.

Allows parameterization of handler method mappings.

getMethodNameResolver

public final MethodNameResolver getMethodNameResolver()
Return the MethodNameResolver used by this class.

setValidators

public final void setValidators(Validator[] validators)
Set the Validators for this controller.

The Validators must support the specified command class.

getValidators

public final Validator[] getValidators()
Return the Validators for this controller.

setWebBindingInitializer

public final void setWebBindingInitializer(WebBindingInitializer webBindingInitializer)
Specify a WebBindingInitializer which will apply pre-configured configuration to every DataBinder that this controller uses.

Allows for factoring out the entire binder configuration to separate objects, as an alternative to initBinder(javax.servlet.http.HttpServletRequest, org.springframework.web.bind.ServletRequestDataBinder).

getWebBindingInitializer

public final WebBindingInitializer getWebBindingInitializer()
Return the WebBindingInitializer (if any) which will apply pre-configured configuration to every DataBinder that this controller uses.

getLastModified

public long getLastModified(HttpServletRequest request)
Try to find an XXXXLastModified method, where XXXX is the name of a handler. Return -1 if there's no such handler, indicating that content must be updated.

Specified by:
getLastModified in interface LastModified
Parameters:
request - current HTTP request
Returns:
the time the underlying resource was last modified, or -1 meaning that the content must always be regenerated
See Also:
LastModified.getLastModified(HttpServletRequest)

handleRequestInternal

protected ModelAndView handleRequestInternal(HttpServletRequest request,
                                             HttpServletResponse response)
                                      throws Exception
Determine a handler method and invoke it.

Specified by:
handleRequestInternal in class AbstractController
Throws:
Exception
See Also:
MethodNameResolver.getHandlerMethodName(javax.servlet.http.HttpServletRequest),
invokeNamedMethod(java.lang.String, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse),
handleNoSuchRequestHandlingMethod(org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

handleNoSuchRequestHandlingMethod

protected ModelAndView handleNoSuchRequestHandlingMethod(NoSuchRequestHandlingMethodException ex,
                                                         HttpServletRequest request,
                                                         HttpServletResponse response)
                                                  throws Exception
Handle the case where no request handler method was found.

The default implementation logs a warning and sends an HTTP 404 error. Alternatively, a fallback view could be chosen, or the NoSuchRequestHandlingMethodException could be rethrown as-is.

Parameters:
ex - the NoSuchRequestHandlingMethodException to be handled
request - current HTTP request
response - current HTTP response
Returns:
a ModelAndView to render, or null if handled directly
Throws:
Exception - an Exception that should be thrown as result of the servlet request

invokeNamedMethod

protected final ModelAndView invokeNamedMethod(String methodName,
                                               HttpServletRequest request,
                                               HttpServletResponse response)
                                        throws Exception
Invokes the named method.

Uses a custom exception handler if possible; otherwise, throw an unchecked exception; wrap a checked exception or Throwable.

Throws:
Exception

newCommandObject

protected Object newCommandObject(Class clazz)
                           throws Exception
Create a new command object of the given class.

This implementation uses BeanUtils.instantiateClass, so commands need to have public no-arg constructors. Subclasses can override this implementation if desired.

Throws:
Exception - if the command object could not be instantiated
See Also:
BeanUtils.instantiateClass(Class)

bind

protected void bind(HttpServletRequest request,
                    Object command)
             throws Exception
Bind request parameters onto the given command bean

Parameters:
request - request from which parameters will be bound
command - command object, that must be a JavaBean
Throws:
Exception - in case of invalid state or arguments

createBinder

protected ServletRequestDataBinder createBinder(HttpServletRequest request,
                                                Object command)
                                         throws Exception
Create a new binder instance for the given command and request.

Called by bind. Can be overridden to plug in custom ServletRequestDataBinder subclasses.

The default implementation creates a standard ServletRequestDataBinder, and invokes initBinder. Note that initBinder will not be invoked if you override this method!

Parameters:
request - current HTTP request
command - the command to bind onto
Returns:
the new binder instance
Throws:
Exception - in case of invalid state or arguments
See Also:
bind(javax.servlet.http.HttpServletRequest, java.lang.Object), initBinder(javax.servlet.http.HttpServletRequest, org.springframework.web.bind.ServletRequestDataBinder)

getCommandName

protected String getCommandName(Object command)
Return the command name to use for the given command object.

Default is "command".

Parameters:
command - the command object
Returns:
the command name to use
See Also:
DEFAULT_COMMAND_NAME

initBinder

protected void initBinder(HttpServletRequest request,
                          ServletRequestDataBinder binder)
                   throws Exception
Initialize the given binder instance, for example with custom editors. Called by createBinder.

This method allows you to register custom editors for certain fields of your command class. For instance, you will be able to transform Date objects into a String pattern and back, in order to allow your JavaBeans to have Date properties and still be able to set and display them in an HTML interface.

The default implementation is empty.

Note: the command object is not directly passed to this method, but it's available via DataBinder.getTarget()

Parameters:
request - current HTTP request
binder - new binder instance
Throws:
Exception - in case of invalid state or arguments
See Also:
createBinder(javax.servlet.http.HttpServletRequest, java.lang.Object), DataBinder.registerCustomEditor(java.lang.Class, java.beans.PropertyEditor), CustomDateEditor

getExceptionHandler

protected Method getExceptionHandler(Throwable exception)
Determine the exception handler method for the given exception.

Can return null if not found.

Parameters:
exception - the exception to handle
Returns:
a handler for the given exception type, or null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ParameterMethodNameResolver

org.springframework.web.servlet.mvc.multiaction
Class ParameterMethodNameResolver

java.lang.Object
    extended by  org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver
All Implemented Interfaces:
MethodNameResolver
public class ParameterMethodNameResolver
extends Object
implements MethodNameResolver

Implementation of MethodNameResolver which supports several strategies for mapping parameter values to the names of methods to invoke.

The simplest strategy looks for a specific named parameter, whose value is considered the name of the method to invoke. The name of the parameter may be specified as a JavaBean property, if the default action is not acceptable.

The alternative strategy uses the very existence of a request parameter ( i.e. a request parameter with a certain name is found) as an indication that a method with the same name should be dispatched to. In this case, the actual request parameter value is ignored. The list of parameter/method names may be set via the methodParamNames JavaBean property.

The second resolution strategy is primarily expected to be used with web pages containing multiple submit buttons. The 'name' attribute of each button should be set to the mapped method name, while the 'value' attribute is normally displayed as the button label by the browser, and will be ignored by the resolver.

Note that the second strategy also supports the use of submit buttons of type 'image'. That is, an image submit button named 'reset' will normally be submitted by the browser as two request paramters called 'reset.x', and 'reset.y'. When checking for the existence of a paramter from the methodParamNames list, to indicate that a specific method should be called, the code will look for request parameter in the "reset" form (exactly as spcified in the list), and in the "reset.x" form ('.x' appended to the name in the list). In this way it can handle both normal and image submit buttons. The actual method name resolved if there is a match will always be the bare form without the ".x".

Note: If both strategies are configured, i.e. both "paramName" and "methodParamNames" are specified, then both will be checked for any given request. A match for an explicit request parameter in the "methodParamNames" list always wins over a value specified for a "paramName" action parameter.

For use with either strategy, the name of a default handler method to use when there is no match, can be specified as a JavaBean property.

For both resolution strategies, the method name is of course coming from some sort of view code, (such as a JSP page). While this may be acceptable, it is sometimes desireable to treat this only as a 'logical' method name, with a further mapping to a 'real' method name. As such, an optional 'logical' mapping may be specified for this purpose.

Author:
Rod Johnson, Juergen Hoeller, Colin Sampaleanu
See Also:
setParamName(java.lang.String),
setMethodParamNames(java.lang.String[]),
setLogicalMappings(java.util.Properties),
setDefaultMethodName(java.lang.String)

Field Summary
static String | DEFAULT_PARAM_NAME Default name for the parameter whose value identifies the method to invoke: "action".
protected Log | logger

Constructor Summary
ParameterMethodNameResolver()

Method Summary
String | getHandlerMethodName(HttpServletRequest request) Return a method name that can handle this request.
void | setDefaultMethodName(String defaultMethodName) Set the name of the default handler method that should be used when no parameter was found in the request
void | setLogicalMappings(Properties logicalMappings) Specifies a set of optional logical method name mappings.
void | setMethodParamNames(String[] methodParamNames) Set a String array of parameter names, where the very existence of a parameter in the list (with value ignored) means that a method of the same name should be invoked.
void | setParamName(String paramName) Set the name of the parameter whose value identifies the name of the method to invoke.

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_PARAM_NAME

public static final String DEFAULT_PARAM_NAME
Default name for the parameter whose value identifies the method to invoke: "action".

See Also:
Constant Field Values

logger

protected final Log logger
Constructor Detail

ParameterMethodNameResolver

public ParameterMethodNameResolver()
Method Detail

setParamName

public void setParamName(String paramName)
Set the name of the parameter whose value identifies the name of the method to invoke. Default is "action".

Alternatively, specify parameter names where the very existence of each parameter means that a method of the same name should be invoked, via the "methodParamNames" property.

See Also:
setMethodParamNames(java.lang.String[])

setMethodParamNames

public void setMethodParamNames(String[] methodParamNames)
Set a String array of parameter names, where the very existence of a parameter in the list (with value ignored) means that a method of the same name should be invoked. This target method name may then be optionally further mapped via the logicalMappings property, in which case it can be considered a logical name only.

See Also:
setParamName(java.lang.String)

setLogicalMappings

public void setLogicalMappings(Properties logicalMappings)
Specifies a set of optional logical method name mappings. For both resolution strategies, the method name initially comes in from the view layer. If that needs to be treated as a 'logical' method name, and mapped to a 'real' method name, then a name/value pair for that purpose should be added to this Properties instance. Any method name not found in this mapping will be considered to already be the real method name.

Note that in the case of no match, where the defaultMethodName property is used if available, that method name is considered to already be the real method name, and is not run through the logical mapping.

Parameters:
logicalMappings - a Properties object mapping logical method names to real method names

setDefaultMethodName

public void setDefaultMethodName(String defaultMethodName)
Set the name of the default handler method that should be used when no parameter was found in the request

getHandlerMethodName

public String getHandlerMethodName(HttpServletRequest request)
                            throws NoSuchRequestHandlingMethodException
Description copied from interface: MethodNameResolver
Return a method name that can handle this request. Such mappings are typically, but not necessarily, based on URL.

Specified by:
getHandlerMethodName in interface MethodNameResolver
Parameters:
request - current HTTP request
Returns:
a method name that can handle this request. Never returns null; throws exception if not resolvable.
Throws:
NoSuchRequestHandlingMethodException - if no handler method can be found for the given request
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


PropertiesMethodNameResolver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.mvc.multiaction
Class PropertiesMethodNameResolver

java.lang.Object
    extended by  org.springframework.web.servlet.mvc.multiaction.AbstractUrlMethodNameResolver
        extended by  org.springframework.web.servlet.mvc.multiaction.PropertiesMethodNameResolver
All Implemented Interfaces:
InitializingBean, MethodNameResolver
public class PropertiesMethodNameResolver
extends AbstractUrlMethodNameResolver
implements InitializingBean

The most flexible out-of-the-box implementation of the MethodNameResolver interface. Uses java.util.Properties to define the mapping between the URL of incoming requests and the corresponding method name. Such properties can be held in an XML document.

Properties format is /welcome.html=displayGenresPage Note that method overloading isn't allowed, so there's no need to specify arguments.

Supports direct matches, e.g. a registered "/test" matches "/test", and a various Ant-style pattern matches, e.g. a registered "/t*" matches both "/test" and "/team". For details, see the AntPathMatcher javadoc.

Author:
Rod Johnson, Juergen Hoeller
See Also:
Properties, AntPathMatcher

Field Summary
Fields inherited from class org.springframework.web.servlet.mvc.multiaction.AbstractUrlMethodNameResolver
logger
Constructor Summary
PropertiesMethodNameResolver()
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected String | getHandlerMethodNameForUrlPath(String urlPath) Return a method name that can handle this request, based on the given lookup path.
void | setMappings(Properties mappings) Set explicit URL to method name mappings through a Properties object.
void | setPathMatcher(PathMatcher pathMatcher) Set the PathMatcher implementation to use for matching URL paths against registered URL patterns.
Methods inherited from class org.springframework.web.servlet.mvc.multiaction.AbstractUrlMethodNameResolver
getHandlerMethodName, setAlwaysUseFullPath, setUrlDecode, setUrlPathHelper
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PropertiesMethodNameResolver

public PropertiesMethodNameResolver()
Method Detail

setMappings

public void setMappings(Properties mappings)
Set explicit URL to method name mappings through a Properties object.

Parameters:
mappings - Properties with URL as key and method name as value

setPathMatcher

public void setPathMatcher(PathMatcher pathMatcher)
Set the PathMatcher implementation to use for matching URL paths against registered URL patterns. Default is AntPathMatcher.

See Also:
AntPathMatcher

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

getHandlerMethodNameForUrlPath

protected String getHandlerMethodNameForUrlPath(String urlPath)
Description copied from class: AbstractUrlMethodNameResolver
Return a method name that can handle this request, based on the given lookup path. Called by getHandlerMethodName.

Specified by:
getHandlerMethodNameForUrlPath in class AbstractUrlMethodNameResolver
Parameters:
urlPath - the URL path to use for lookup, according to the settings in this class
Returns:
a method name that can handle this request. Should return null if no matching method found.
See Also:
AbstractUrlMethodNameResolver.getHandlerMethodName(javax.servlet.http.HttpServletRequest),
AbstractUrlMethodNameResolver.setAlwaysUseFullPath(boolean),
AbstractUrlMethodNameResolver.setUrlDecode(boolean)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


NoSuchRequestHandlingMethodException

org.springframework.web.servlet.mvc.multiaction
Class NoSuchRequestHandlingMethodException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.servlet.ServletException
                extended by  org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException
All Implemented Interfaces:
Serializable
public class NoSuchRequestHandlingMethodException
extends ServletException

Exception thrown when there is no handler method ("action" method) for a specific HTTP request.

Author:
Rod Johnson, Juergen Hoeller
See Also:
MethodNameResolver.getHandlerMethodName(javax.servlet.http.HttpServletRequest), Serialized Form

Constructor Summary
NoSuchRequestHandlingMethodException(HttpServletRequest request)
Create a new NoSuchRequestHandlingMethodException for the given request.
NoSuchRequestHandlingMethodException(String methodName, Class controllerClass)
Create a new NoSuchRequestHandlingMethodException for the given request.
NoSuchRequestHandlingMethodException(String urlPath, String method, Map parameterMap)
Create a new NoSuchRequestHandlingMethodException.
Method Summary
 String getMethodName()
Return the name of the offending method, if known.
Methods inherited from class javax.servlet.ServletException
getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

NoSuchRequestHandlingMethodException

public NoSuchRequestHandlingMethodException(HttpServletRequest request)
Create a new NoSuchRequestHandlingMethodException for the given request.

Parameters:
request - the offending HTTP request

NoSuchRequestHandlingMethodException

public NoSuchRequestHandlingMethodException(String urlPath,
                                            String method,
                                            Map parameterMap)
Create a new NoSuchRequestHandlingMethodException.

Parameters:
urlPath - the request URI that has been used for handler lookup
method - the HTTP request method of the request
parameterMap - the request's parameters as map

NoSuchRequestHandlingMethodException

public NoSuchRequestHandlingMethodException(String methodName,
                                            Class controllerClass)
Create a new NoSuchRequestHandlingMethodException for the given request.

Parameters:
methodName - the name of the handler method that wasn't found
controllerClass - the class the handler method was expected to be in
Method Detail

getMethodName

public String getMethodName()
Return the name of the offending method, if known.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


org.springframework.web.servlet.mvc.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.servlet.mvc.support

Support package for MVC controllers.

See:
Description

Class Summary
AbstractControllerUrlHandlerMapping | Base class for HandlerMapping implementations that derive URL paths according to conventions for specific controller types.
ControllerBeanNameHandlerMapping | Implementation of HandlerMapping that follows a simple convention for generating URL path mappings from the bean names of registered Controller beans as well as @Controller annotated beans.
ControllerClassNameHandlerMapping | Implementation of HandlerMapping that follows a simple convention for generating URL path mappings from the class names of registered Controller beans as well as @Controller annotated beans.
DefaultHandlerExceptionResolver | Default implementation of the HandlerExceptionResolver interface that resolves standard Spring exceptions.

Package org.springframework.web.servlet.mvc.support Description

Support package for MVC controllers. Contains a special HandlerMapping for controller conventions.


org.springframework.web.servlet.mvc.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.servlet.mvc.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver (implements org.springframework.web.servlet.HandlerExceptionResolver, org.springframework.core.Ordered)
      • org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver
    • org.springframework.context.support.ApplicationObjectSupport (implements org.springframework.context.ApplicationContextAware)
      • org.springframework.web.context.support.WebApplicationObjectSupport (implements org.springframework.web.context.ServletContextAware)
        • org.springframework.web.servlet.handler.AbstractHandlerMapping (implements org.springframework.web.servlet.HandlerMapping, org.springframework.core.Ordered)
          • org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
            • org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping
              • org.springframework.web.servlet.mvc.support.AbstractControllerUrlHandlerMapping
                • org.springframework.web.servlet.mvc.support.ControllerBeanNameHandlerMapping
                • org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping


AbstractControllerUrlHandlerMapping

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.mvc.support
Class AbstractControllerUrlHandlerMapping

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.handler.AbstractHandlerMapping
                extended by  org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
                    extended by  org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping
                        extended by  org.springframework.web.servlet.mvc.support.AbstractControllerUrlHandlerMapping
All Implemented Interfaces:
ApplicationContextAware, Ordered, ServletContextAware, HandlerMapping
Direct Known Subclasses:
ControllerBeanNameHandlerMapping, ControllerClassNameHandlerMapping
public abstract class AbstractControllerUrlHandlerMapping
extends AbstractDetectingUrlHandlerMapping

Base class for HandlerMapping implementations that derive URL paths according to conventions for specific controller types.

Since:
2.5.3
Author:
Juergen Hoeller
See Also:
ControllerClassNameHandlerMapping, ControllerBeanNameHandlerMapping

Field Summary
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.HandlerMapping
BEST_MATCHING_PATTERN_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTE
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AbstractControllerUrlHandlerMapping()
Method Summary
protected abstract String[] | buildUrlsForHandler(String beanName, Class beanClass) Abstract template method to be implemented by subclasses.
protected String[] | determineUrlsForHandler(String beanName) This implementation delegates to buildUrlsForHandler(java.lang.String, java.lang.Class), provided that isEligibleForMapping(java.lang.String, java.lang.Class) returns true.
protected boolean | isControllerType(Class beanClass) Determine whether the given bean class indicates a controller type that is supported by this mapping strategy.
protected boolean | isEligibleForMapping(String beanName, Class beanClass) Determine whether the specified controller is excluded from this mapping.
protected boolean | isMultiActionControllerType(Class beanClass) Determine whether the given bean class indicates a controller type that dispatches to multiple action methods.
void | setExcludedClasses(Class[] excludedClasses) Specify controller classes that should be excluded from this mapping.
void | setExcludedPackages(String[] excludedPackages) Specify Java packages that should be excluded from this mapping.
void | setIncludeAnnotatedControllers(boolean includeAnnotatedControllers) Set whether to activate or deactivate detection of annotated controllers.
Methods inherited from class org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping
detectHandlers, initApplicationContext, setDetectHandlersInAncestorContexts
Methods inherited from class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
buildPathExposingHandler, exposePathWithinMapping, exposeUriTemplateVariables, getHandlerInternal, getHandlerMap, getPathMatcher, getRootHandler, initInterceptors, lookupHandler, registerHandler, registerHandler, setAlwaysUseFullPath, setLazyInitHandlers, setMappedInterceptors, setPathMatcher, setRootHandler, setUrlDecode, setUrlPathHelper, validateHandler
Methods inherited from class org.springframework.web.servlet.handler.AbstractHandlerMapping
adaptInterceptor, extendInterceptors, getAdaptedInterceptors, getDefaultHandler, getHandler, getHandlerExecutionChain, getOrder, setDefaultHandler, setInterceptors, setOrder
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractControllerUrlHandlerMapping

public AbstractControllerUrlHandlerMapping()
Method Detail

setIncludeAnnotatedControllers

public void setIncludeAnnotatedControllers(boolean includeAnnotatedControllers)
Set whether to activate or deactivate detection of annotated controllers.

setExcludedPackages

public void setExcludedPackages(String[] excludedPackages)
Specify Java packages that should be excluded from this mapping. Any classes in such a package (or any of its subpackages) will be ignored by this HandlerMapping.

Default is to exclude the entire "org.springframework.web.servlet.mvc" package, including its subpackages, since none of Spring's out-of-the-box Controller implementations is a reasonable candidate for this mapping strategy. Such controllers are typically handled by a separate HandlerMapping, e.g. a BeanNameUrlHandlerMapping, alongside this ControllerClassNameHandlerMapping for application controllers.

setExcludedClasses

public void setExcludedClasses(Class[] excludedClasses)
Specify controller classes that should be excluded from this mapping. Any such classes will simply be ignored by this HandlerMapping.

determineUrlsForHandler

protected String[] determineUrlsForHandler(String beanName)
This implementation delegates to buildUrlsForHandler(java.lang.String, java.lang.Class), provided that isEligibleForMapping(java.lang.String, java.lang.Class) returns true.

Specified by:
determineUrlsForHandler in class AbstractDetectingUrlHandlerMapping
Parameters:
beanName - the name of the candidate bean
Returns:
the URLs determined for the bean, or null or an empty array if none

isEligibleForMapping

protected boolean isEligibleForMapping(String beanName,
                                       Class beanClass)
Determine whether the specified controller is excluded from this mapping.

Parameters:
beanName - the name of the controller bean
beanClass - the concrete class of the controller bean
Returns:
whether the specified class is excluded
See Also:
setExcludedPackages(java.lang.String[]), setExcludedClasses(java.lang.Class[])

isControllerType

protected boolean isControllerType(Class beanClass)
Determine whether the given bean class indicates a controller type that is supported by this mapping strategy.

Parameters:
beanClass - the class to introspect

isMultiActionControllerType

protected boolean isMultiActionControllerType(Class beanClass)
Determine whether the given bean class indicates a controller type that dispatches to multiple action methods.

Parameters:
beanClass - the class to introspect

buildUrlsForHandler

protected abstract String[] buildUrlsForHandler(String beanName,
                                                Class beanClass)
Abstract template method to be implemented by subclasses.

Parameters:
beanName - the name of the bean
beanClass - the type of the bean
Returns:
the URLs determined for the bean
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ControllerBeanNameHandlerMapping

org.springframework.web.servlet.mvc.support
Class ControllerBeanNameHandlerMapping

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.handler.AbstractHandlerMapping
                extended by  org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
                    extended by  org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping
                        extended by  org.springframework.web.servlet.mvc.support.AbstractControllerUrlHandlerMapping
                            extended by  org.springframework.web.servlet.mvc.support.ControllerBeanNameHandlerMapping
All Implemented Interfaces:
ApplicationContextAware, Ordered, ServletContextAware, HandlerMapping
public class ControllerBeanNameHandlerMapping
extends AbstractControllerUrlHandlerMapping

Implementation of HandlerMapping that follows a simple convention for generating URL path mappings from the bean names of registered Controller beans as well as @Controller annotated beans.

This is similar to BeanNameUrlHandlerMapping but doesn't expect bean names to follow the URL convention: It turns plain bean names into URLs by prepending a slash and optionally applying a specified prefix and/or suffix. However, it only does so for well-known controller types, as listed above (analogous to ControllerClassNameHandlerMapping).

Since:
2.5.3
Author:
Juergen Hoeller
See Also:
ControllerClassNameHandlerMapping, BeanNameUrlHandlerMapping

Field Summary
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.HandlerMapping
BEST_MATCHING_PATTERN_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTE
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
ControllerBeanNameHandlerMapping()
Method Summary
protected String[] | buildUrlsForHandler(String beanName, Class beanClass) Abstract template method to be implemented by subclasses.
protected String | generatePathMapping(String beanName) Prepends a '/' if required and appends the URL suffix to the name.
void | setUrlPrefix(String urlPrefix) Set an optional prefix to prepend to generated URL mappings.
void | setUrlSuffix(String urlSuffix) Set an optional suffix to append to generated URL mappings.
Methods inherited from class org.springframework.web.servlet.mvc.support.AbstractControllerUrlHandlerMapping
determineUrlsForHandler, isControllerType, isEligibleForMapping, isMultiActionControllerType, setExcludedClasses, setExcludedPackages, setIncludeAnnotatedControllers
Methods inherited from class org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping
detectHandlers, initApplicationContext, setDetectHandlersInAncestorContexts
Methods inherited from class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
buildPathExposingHandler, exposePathWithinMapping, exposeUriTemplateVariables, getHandlerInternal, getHandlerMap, getPathMatcher, getRootHandler, initInterceptors, lookupHandler, registerHandler, registerHandler, setAlwaysUseFullPath, setLazyInitHandlers, setMappedInterceptors, setPathMatcher, setRootHandler, setUrlDecode, setUrlPathHelper, validateHandler
Methods inherited from class org.springframework.web.servlet.handler.AbstractHandlerMapping
adaptInterceptor, extendInterceptors, getAdaptedInterceptors, getDefaultHandler, getHandler, getHandlerExecutionChain, getOrder, setDefaultHandler, setInterceptors, setOrder
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ControllerBeanNameHandlerMapping

public ControllerBeanNameHandlerMapping()
Method Detail

setUrlPrefix

public void setUrlPrefix(String urlPrefix)
Set an optional prefix to prepend to generated URL mappings.

By default this is an empty String. If you want a prefix like "/myapp/", you can set it for all beans mapped by this mapping.

setUrlSuffix

public void setUrlSuffix(String urlSuffix)
Set an optional suffix to append to generated URL mappings.

By default this is an empty String. If you want a suffix like ".do", you can set it for all beans mapped by this mapping.

buildUrlsForHandler

protected String[] buildUrlsForHandler(String beanName,
                                       Class beanClass)
Description copied from class: AbstractControllerUrlHandlerMapping
Abstract template method to be implemented by subclasses.

Specified by:
buildUrlsForHandler in class AbstractControllerUrlHandlerMapping
Parameters:
beanName - the name of the bean
beanClass - the type of the bean
Returns:
the URLs determined for the bean

generatePathMapping

protected String generatePathMapping(String beanName)
Prepends a '/' if required and appends the URL suffix to the name.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ControllerClassNameHandlerMapping

org.springframework.web.servlet.mvc.support
Class ControllerClassNameHandlerMapping

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.handler.AbstractHandlerMapping
                extended by  org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
                    extended by  org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping
                        extended by  org.springframework.web.servlet.mvc.support.AbstractControllerUrlHandlerMapping
                            extended by  org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping
All Implemented Interfaces:
ApplicationContextAware, Ordered, ServletContextAware, HandlerMapping
public class ControllerClassNameHandlerMapping
extends AbstractControllerUrlHandlerMapping

Implementation of HandlerMapping that follows a simple convention for generating URL path mappings from the class names of registered Controller beans as well as @Controller annotated beans.

For simple Controller implementations (those that handle a single request type), the convention is to take the short name of the Class, remove the 'Controller' suffix if it exists and return the remaining text, lower-cased, as the mapping, with a leading /. For example:

  • WelcomeController -> /welcome*
  • HomeController -> /home*

For MultiActionControllers and @Controller beans, a similar mapping is registered, except that all sub-paths are registered using the trailing wildcard pattern /*. For example:

  • WelcomeController -> /welcome, /welcome/*
  • CatalogController -> /catalog, /catalog/*

For MultiActionController it is often useful to use this mapping strategy in conjunction with the InternalPathMethodNameResolver.

Thanks to Warren Oliver for suggesting the "caseSensitive", "pathPrefix" and "basePackage" properties which have been added in Spring 2.5.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
See Also:
Controller, MultiActionController

Field Summary
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.HandlerMapping
BEST_MATCHING_PATTERN_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTE
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
ControllerClassNameHandlerMapping()
Method Summary
protected String[] | buildUrlsForHandler(String beanName, Class beanClass) Abstract template method to be implemented by subclasses.
protected String[] | generatePathMappings(Class beanClass) Generate the actual URL paths for the given controller class.
void | setBasePackage(String basePackage) Set the base package to be used for generating path mappings, including all subpackages underneath this packages as path elements.
void | setCaseSensitive(boolean caseSensitive) Set whether to apply case sensitivity to the generated paths, e.g.
void | setPathPrefix(String prefixPath) Specify a prefix to prepend to the path generated from the controller name.
Methods inherited from class org.springframework.web.servlet.mvc.support.AbstractControllerUrlHandlerMapping
determineUrlsForHandler, isControllerType, isEligibleForMapping, isMultiActionControllerType, setExcludedClasses, setExcludedPackages, setIncludeAnnotatedControllers
Methods inherited from class org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping
detectHandlers, initApplicationContext, setDetectHandlersInAncestorContexts
Methods inherited from class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
buildPathExposingHandler, exposePathWithinMapping, exposeUriTemplateVariables, getHandlerInternal, getHandlerMap, getPathMatcher, getRootHandler, initInterceptors, lookupHandler, registerHandler, registerHandler, setAlwaysUseFullPath, setLazyInitHandlers, setMappedInterceptors, setPathMatcher, setRootHandler, setUrlDecode, setUrlPathHelper, validateHandler
Methods inherited from class org.springframework.web.servlet.handler.AbstractHandlerMapping
adaptInterceptor, extendInterceptors, getAdaptedInterceptors, getDefaultHandler, getHandler, getHandlerExecutionChain, getOrder, setDefaultHandler, setInterceptors, setOrder
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ControllerClassNameHandlerMapping

public ControllerClassNameHandlerMapping()
Method Detail

setCaseSensitive

public void setCaseSensitive(boolean caseSensitive)
Set whether to apply case sensitivity to the generated paths, e.g. turning the class name "BuyForm" into "buyForm".

Default is "false", using pure lower case paths, e.g. turning the class name "BuyForm" into "buyform".

setPathPrefix

public void setPathPrefix(String prefixPath)
Specify a prefix to prepend to the path generated from the controller name.

Default is a plain slash ("/"). A path like "/mymodule" can be specified in order to have controller path mappings prefixed with that path, e.g. "/mymodule/buyform" instead of "/buyform" for the class name "BuyForm".

setBasePackage

public void setBasePackage(String basePackage)
Set the base package to be used for generating path mappings, including all subpackages underneath this packages as path elements.

Default is null, using the short class name for the generated path, with the controller's package not represented in the path. Specify a base package like "com.mycompany.myapp" to include subpackages within that base package as path elements, e.g. generating the path "/mymodule/buyform" for the class name "com.mycompany.myapp.mymodule.BuyForm". Subpackage hierarchies are represented as individual path elements, e.g. "/mymodule/mysubmodule/buyform" for the class name "com.mycompany.myapp.mymodule.mysubmodule.BuyForm".

buildUrlsForHandler

protected String[] buildUrlsForHandler(String beanName,
                                       Class beanClass)
Description copied from class: AbstractControllerUrlHandlerMapping
Abstract template method to be implemented by subclasses.

Specified by:
buildUrlsForHandler in class AbstractControllerUrlHandlerMapping
Parameters:
beanName - the name of the bean
beanClass - the type of the bean
Returns:
the URLs determined for the bean

generatePathMappings

protected String[] generatePathMappings(Class beanClass)
Generate the actual URL paths for the given controller class.

Subclasses may choose to customize the paths that are generated by overriding this method.

Parameters:
beanClass - the controller bean class to generate a mapping for
Returns:
the URL path mappings for the given controller
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultHandlerExceptionResolver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.mvc.support
Class DefaultHandlerExceptionResolver

java.lang.Object
    extended by  org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
        extended by  org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver
All Implemented Interfaces:
Ordered, HandlerExceptionResolver
public class DefaultHandlerExceptionResolver
extends AbstractHandlerExceptionResolver

Default implementation of the HandlerExceptionResolver interface that resolves standard Spring exceptions.

Default implementations typically set the response status to a corresponding HTTP status code.

This exception resolver is enabled by default in the DispatcherServlet.

Since:
3.0
Author:
Arjen Poutsma
See Also:
handleNoSuchRequestHandlingMethod(org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object),
handleHttpRequestMethodNotSupported(org.springframework.web.HttpRequestMethodNotSupportedException, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object),
handleHttpMediaTypeNotSupported(org.springframework.web.HttpMediaTypeNotSupportedException, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object),
handleMissingServletRequestParameter(org.springframework.web.bind.MissingServletRequestParameterException, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object),
handleTypeMismatch(org.springframework.beans.TypeMismatchException, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object),
handleHttpMessageNotReadable(org.springframework.http.converter.HttpMessageNotReadableException, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object),
handleHttpMessageNotWritable(org.springframework.http.converter.HttpMessageNotWritableException, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object)

Field Summary
static String | PAGE_NOT_FOUND_LOG_CATEGORY Log category to use when no mapped handler is found for a request.
protected static Log | pageNotFoundLogger Additional logger to use when no mapped handler is found for a request.
Fields inherited from class org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
DefaultHandlerExceptionResolver()
Sets the order to Ordered.LOWEST_PRECEDENCE.
Method Summary
protected ModelAndView | doResolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) Actually resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.
protected ModelAndView | handleConversionNotSupported(ConversionNotSupportedException ex, HttpServletRequest request, HttpServletResponse response, Object handler) Handle the case when a WebDataBinder conversion cannot occur.
protected ModelAndView | handleHttpMediaTypeNotAcceptable(HttpMediaTypeNotAcceptableException ex, HttpServletRequest request, HttpServletResponse response, Object handler) Handle the case where no message converters were found that were acceptable for the client (expressed via the Accept header.
protected ModelAndView | handleHttpMediaTypeNotSupported(HttpMediaTypeNotSupportedException ex, HttpServletRequest request, HttpServletResponse response, Object handler) Handle the case where no message converters were found for the PUT or POSTed content.
protected ModelAndView | handleHttpMessageNotReadable(HttpMessageNotReadableException ex, HttpServletRequest request, HttpServletResponse response, Object handler) Handle the case where a message converter can not read from a HTTP request.
protected ModelAndView | handleHttpMessageNotWritable(HttpMessageNotWritableException ex, HttpServletRequest request, HttpServletResponse response, Object handler) Handle the case where a message converter can not write to a HTTP request.
protected ModelAndView | handleHttpRequestMethodNotSupported(HttpRequestMethodNotSupportedException ex, HttpServletRequest request, HttpServletResponse response, Object handler) Handle the case where no request handler method was found for the particular HTTP request method.
protected ModelAndView | handleMissingServletRequestParameter(MissingServletRequestParameterException ex, HttpServletRequest request, HttpServletResponse response, Object handler) Handle the case when a required parameter is missing.
protected ModelAndView | handleNoSuchRequestHandlingMethod(NoSuchRequestHandlingMethodException ex, HttpServletRequest request, HttpServletResponse response, Object handler) Handle the case where no request handler method was found.
protected ModelAndView | handleTypeMismatch(TypeMismatchException ex, HttpServletRequest request, HttpServletResponse response, Object handler) Handle the case when a WebDataBinder conversion error occurs.
Methods inherited from class org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
buildLogMessage, getOrder, logException, resolveException, setMappedHandlerClasses, setMappedHandlers, setOrder, setWarnLogCategory, shouldApplyTo
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

PAGE_NOT_FOUND_LOG_CATEGORY

public static final String PAGE_NOT_FOUND_LOG_CATEGORY
Log category to use when no mapped handler is found for a request.

See Also:
pageNotFoundLogger, Constant Field Values

pageNotFoundLogger

protected static final Log pageNotFoundLogger
Additional logger to use when no mapped handler is found for a request.

See Also:
PAGE_NOT_FOUND_LOG_CATEGORY
Constructor Detail

DefaultHandlerExceptionResolver

public DefaultHandlerExceptionResolver()
Sets the order to Ordered.LOWEST_PRECEDENCE.

Method Detail

doResolveException

protected ModelAndView doResolveException(HttpServletRequest request,
                                          HttpServletResponse response,
                                          Object handler,
                                          Exception ex)
Description copied from class: AbstractHandlerExceptionResolver
Actually resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.

May be overridden in subclasses, in order to apply specific exception checks. Note that this template method will be invoked after checking whether this resolved applies ("mappedHandlers" etc), so an implementation may simply proceed with its actual exception handling.

Specified by:
doResolveException in class AbstractHandlerExceptionResolver
Parameters:
request - current HTTP request
response - current HTTP response
handler - the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
ex - the exception that got thrown during handler execution
Returns:
a corresponding ModelAndView to forward to, or null for default processing

handleNoSuchRequestHandlingMethod

protected ModelAndView handleNoSuchRequestHandlingMethod(NoSuchRequestHandlingMethodException ex,
                                                         HttpServletRequest request,
                                                         HttpServletResponse response,
                                                         Object handler)
                                                  throws Exception
Handle the case where no request handler method was found.

The default implementation logs a warning, sends an HTTP 404 error, and returns an empty ModelAndView. Alternatively, a fallback view could be chosen, or the NoSuchRequestHandlingMethodException could be rethrown as-is.

Parameters:
ex - the NoSuchRequestHandlingMethodException to be handled
request - current HTTP request
response - current HTTP response
handler - the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
Returns:
a ModelAndView to render, or null if handled directly
Throws:
Exception - an Exception that should be thrown as result of the servlet request

handleHttpRequestMethodNotSupported

protected ModelAndView handleHttpRequestMethodNotSupported(HttpRequestMethodNotSupportedException ex,
                                                           HttpServletRequest request,
                                                           HttpServletResponse response,
                                                           Object handler)
                                                    throws Exception
Handle the case where no request handler method was found for the particular HTTP request method.

The default implementation logs a warning, sends an HTTP 405 error, sets the "Allow" header, and returns an empty ModelAndView. Alternatively, a fallback view could be chosen, or the HttpRequestMethodNotSupportedException could be rethrown as-is.

Parameters:
ex - the HttpRequestMethodNotSupportedException to be handled
request - current HTTP request
response - current HTTP response
handler - the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
Returns:
a ModelAndView to render, or null if handled directly
Throws:
Exception - an Exception that should be thrown as result of the servlet request

handleHttpMediaTypeNotSupported

protected ModelAndView handleHttpMediaTypeNotSupported(HttpMediaTypeNotSupportedException ex,
                                                       HttpServletRequest request,
                                                       HttpServletResponse response,
                                                       Object handler)
                                                throws Exception
Handle the case where no message converters were found for the PUT or POSTed content.

The default implementation sends an HTTP 415 error, sets the "Accept" header, and returns an empty ModelAndView. Alternatively, a fallback view could be chosen, or the HttpMediaTypeNotSupportedException could be rethrown as-is.

Parameters:
ex - the HttpMediaTypeNotSupportedException to be handled
request - current HTTP request
response - current HTTP response
handler - the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
Returns:
a ModelAndView to render, or null if handled directly
Throws:
Exception - an Exception that should be thrown as result of the servlet request

handleHttpMediaTypeNotAcceptable

protected ModelAndView handleHttpMediaTypeNotAcceptable(HttpMediaTypeNotAcceptableException ex,
                                                        HttpServletRequest request,
                                                        HttpServletResponse response,
                                                        Object handler)
                                                 throws Exception
Handle the case where no message converters were found that were acceptable for the client (expressed via the Accept header.

The default implementation sends an HTTP 406 error and returns an empty ModelAndView. Alternatively, a fallback view could be chosen, or the HttpMediaTypeNotAcceptableException could be rethrown as-is.

Parameters:
ex - the HttpMediaTypeNotAcceptableException to be handled
request - current HTTP request
response - current HTTP response
handler - the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
Returns:
a ModelAndView to render, or null if handled directly
Throws:
Exception - an Exception that should be thrown as result of the servlet request

handleMissingServletRequestParameter

protected ModelAndView handleMissingServletRequestParameter(MissingServletRequestParameterException ex,
                                                            HttpServletRequest request,
                                                            HttpServletResponse response,
                                                            Object handler)
                                                     throws Exception
Handle the case when a required parameter is missing.

The default implementation sends an HTTP 400 error, and returns an empty ModelAndView. Alternatively, a fallback view could be chosen, or the MissingServletRequestParameterException could be rethrown as-is.

Parameters:
ex - the MissingServletRequestParameterException to be handled
request - current HTTP request
response - current HTTP response
handler - the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
Returns:
a ModelAndView to render, or null if handled directly
Throws:
Exception - an Exception that should be thrown as result of the servlet request

handleConversionNotSupported

protected ModelAndView handleConversionNotSupported(ConversionNotSupportedException ex,
                                                    HttpServletRequest request,
                                                    HttpServletResponse response,
                                                    Object handler)
                                             throws Exception
Handle the case when a WebDataBinder conversion cannot occur.

The default implementation sends an HTTP 500 error, and returns an empty ModelAndView. Alternatively, a fallback view could be chosen, or the TypeMismatchException could be rethrown as-is.

Parameters:
ex - the ConversionNotSupportedException to be handled
request - current HTTP request
response - current HTTP response
handler - the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
Returns:
a ModelAndView to render, or null if handled directly
Throws:
Exception - an Exception that should be thrown as result of the servlet request

handleTypeMismatch

protected ModelAndView handleTypeMismatch(TypeMismatchException ex,
                                          HttpServletRequest request,
                                          HttpServletResponse response,
                                          Object handler)
                                   throws Exception
Handle the case when a WebDataBinder conversion error occurs.

The default implementation sends an HTTP 400 error, and returns an empty ModelAndView. Alternatively, a fallback view could be chosen, or the TypeMismatchException could be rethrown as-is.

Parameters:
ex - the TypeMismatchException to be handled
request - current HTTP request
response - current HTTP response
handler - the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
Returns:
a ModelAndView to render, or null if handled directly
Throws:
Exception - an Exception that should be thrown as result of the servlet request

handleHttpMessageNotReadable

protected ModelAndView handleHttpMessageNotReadable(HttpMessageNotReadableException ex,
                                                    HttpServletRequest request,
                                                    HttpServletResponse response,
                                                    Object handler)
                                             throws Exception
Handle the case where a message converter can not read from a HTTP request.

The default implementation sends an HTTP 400 error, and returns an empty ModelAndView. Alternatively, a fallback view could be chosen, or the HttpMediaTypeNotSupportedException could be rethrown as-is.

Parameters:
ex - the HttpMessageNotReadableException to be handled
request - current HTTP request
response - current HTTP response
handler - the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
Returns:
a ModelAndView to render, or null if handled directly
Throws:
Exception - an Exception that should be thrown as result of the servlet request

handleHttpMessageNotWritable

protected ModelAndView handleHttpMessageNotWritable(HttpMessageNotWritableException ex,
                                                    HttpServletRequest request,
                                                    HttpServletResponse response,
                                                    Object handler)
                                             throws Exception
Handle the case where a message converter can not write to a HTTP request.

The default implementation sends an HTTP 500 error, and returns an empty ModelAndView. Alternatively, a fallback view could be chosen, or the HttpMediaTypeNotSupportedException could be rethrown as-is.

Parameters:
ex - the HttpMessageNotWritableException to be handled
request - current HTTP request
response - current HTTP response
handler - the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
Returns:
a ModelAndView to render, or null if handled directly
Throws:
Exception - an Exception that should be thrown as result of the servlet request
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.servlet.support

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.servlet.support

Support classes for Spring's web MVC framework.

See:
Description

Class Summary
BindStatus | Simple adapter to expose the bind status of a field or object.
JspAwareRequestContext | JSP-aware (and JSTL-aware) subclass of RequestContext, allowing for population of the context from a javax.servlet.jsp.PageContext.
JstlUtils | Helper class for preparing JSTL views, in particular for exposing a JSTL localization context.
RequestContext | Context holder for request-specific state, like current web application context, current locale, current theme, and potential binding errors.
RequestContextUtils | Utility class for easy access to request-specific state which has been set by the DispatcherServlet.
WebContentGenerator | Convenient superclass for any kind of web content generator, like AbstractController and WebContentInterceptor.

Package org.springframework.web.servlet.support Description

Support classes for Spring's web MVC framework. Provides easy evaluation of the request context in views, and miscellaneous HandlerInterceptor implementations.


org.springframework.web.servlet.support Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.servlet.support

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.context.support.ApplicationObjectSupport (implements org.springframework.context.ApplicationContextAware)
      • org.springframework.web.context.support.WebApplicationObjectSupport (implements org.springframework.web.context.ServletContextAware)
        • org.springframework.web.servlet.support.WebContentGenerator
    • org.springframework.web.servlet.support.BindStatus
    • org.springframework.web.servlet.support.JstlUtils
    • org.springframework.web.servlet.support.RequestContext
      • org.springframework.web.servlet.support.JspAwareRequestContext
    • org.springframework.web.servlet.support.RequestContextUtils


BindStatus

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.support
Class BindStatus

java.lang.Object
    extended by  org.springframework.web.servlet.support.BindStatus

public class BindStatus
extends Object

Simple adapter to expose the bind status of a field or object. Set as a variable both by the JSP bind tag and Velocity/FreeMarker macros.

Obviously, object status representations (i.e. errors at the object level rather than the field level) do not have an expression and a value but only error codes and messages. For simplicity's sake and to be able to use the same tags and macros, the same status class is used for both scenarios.

Author:
Rod Johnson, Juergen Hoeller, Darren Davison
See Also:
RequestContext.getBindStatus(java.lang.String), BindTag, AbstractTemplateView.setExposeSpringMacroHelpers(boolean)

Constructor Summary
BindStatus(RequestContext requestContext, String path, boolean htmlEscape)
Create a new BindStatus instance, representing a field or object status.
Method Summary
PropertyEditor | findEditor(Class valueClass) Find a PropertyEditor for the given value class, associated with the property that this bound status is currently bound to.
Object | getActualValue() Return the actual value of the field, i.e.
String | getDisplayValue() Return a suitable display value for the field, i.e.
PropertyEditor | getEditor() Return the PropertyEditor for the property that this bind status is currently bound to.
String | getErrorCode() Return the first error codes for the field or object, if any.
String[] | getErrorCodes() Return the error codes for the field or object, if any.
String | getErrorMessage() Return the first error message for the field or object, if any.
String[] | getErrorMessages() Return the resolved error messages for the field or object, if any.
String | getErrorMessagesAsString(String delimiter) Return an error message string, concatenating all messages separated by the given delimiter.
Errors | getErrors() Return the Errors instance (typically a BindingResult) that this bind status is currently associated with.
String | getExpression() Return a bind expression that can be used in HTML forms as input name for the respective field, or null if not field-specific.
String | getPath() Return the bean and property path for which values and errors will be resolved (e.g.
Object | getValue() Return the current value of the field, i.e.
Class | getValueType() Get the 'Class' type of the field.
boolean | isError() Return if this status represents a field or object error.
String | toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

BindStatus

public BindStatus(RequestContext requestContext,
                  String path,
                  boolean htmlEscape)
           throws IllegalStateException
Create a new BindStatus instance, representing a field or object status.

Parameters:
requestContext - the current RequestContext
path - the bean and property path for which values and errors will be resolved (e.g. "customer.address.street")
htmlEscape - whether to HTML-escape error messages and string values
Throws:
IllegalStateException - if no corresponding Errors object found
Method Detail

getPath

public String getPath()
Return the bean and property path for which values and errors will be resolved (e.g. "customer.address.street").

getExpression

public String getExpression()
Return a bind expression that can be used in HTML forms as input name for the respective field, or null if not field-specific.

Returns a bind path appropriate for resubmission, e.g. "address.street". Note that the complete bind path as required by the bind tag is "customer.address.street", if bound to a "customer" bean.

getValue

public Object getValue()
Return the current value of the field, i.e. either the property value or a rejected update, or null if not field-specific.

This value will be an HTML-escaped String if the original value already was a String.

getValueType

public Class getValueType()
Get the 'Class' type of the field. Favor this instead of 'getValue().getClass()' since 'getValue()' may return 'null'.

getActualValue

public Object getActualValue()
Return the actual value of the field, i.e. the raw property value, or null if not available.

getDisplayValue

public String getDisplayValue()
Return a suitable display value for the field, i.e. the stringified value if not null, and an empty string in case of a null value.

This value will be an HTML-escaped String if the original value was non-null: the toString result of the original value will get HTML-escaped.

isError

public boolean isError()
Return if this status represents a field or object error.

getErrorCodes

public String[] getErrorCodes()
Return the error codes for the field or object, if any. Returns an empty array instead of null if none.

getErrorCode

public String getErrorCode()
Return the first error codes for the field or object, if any.

getErrorMessages

public String[] getErrorMessages()
Return the resolved error messages for the field or object, if any. Returns an empty array instead of null if none.

getErrorMessage

public String getErrorMessage()
Return the first error message for the field or object, if any.

getErrorMessagesAsString

public String getErrorMessagesAsString(String delimiter)
Return an error message string, concatenating all messages separated by the given delimiter.

Parameters:
delimiter - separator string, e.g. ", " or "
"
Returns:
the error message string

getErrors

public Errors getErrors()
Return the Errors instance (typically a BindingResult) that this bind status is currently associated with.

Returns:
the current Errors instance, or null if none
See Also:
BindingResult

getEditor

public PropertyEditor getEditor()
Return the PropertyEditor for the property that this bind status is currently bound to.

Returns:
the current PropertyEditor, or null if none

findEditor

public PropertyEditor findEditor(Class valueClass)
Find a PropertyEditor for the given value class, associated with the property that this bound status is currently bound to.

Parameters:
valueClass - the value class that an editor is needed for
Returns:
the associated PropertyEditor, or null if none

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


JspAwareRequestContext

org.springframework.web.servlet.support
Class JspAwareRequestContext

java.lang.Object
    extended by  org.springframework.web.servlet.support.RequestContext
        extended by  org.springframework.web.servlet.support.JspAwareRequestContext

public class JspAwareRequestContext
extends RequestContext

JSP-aware (and JSTL-aware) subclass of RequestContext, allowing for population of the context from a javax.servlet.jsp.PageContext.

This context will detect a JSTL locale attribute in page/request/session/application scope, in addition to the fallback locale strategy provided by the base class.

Since:
1.1.4
Author:
Juergen Hoeller
See Also:
getFallbackLocale()

Field Summary
Fields inherited from class org.springframework.web.servlet.support.RequestContext
DEFAULT_THEME_NAME, jstlPresent, WEB_APPLICATION_CONTEXT_ATTRIBUTE
Constructor Summary
JspAwareRequestContext(PageContext pageContext)
Create a new JspAwareRequestContext for the given page context, using the request attributes for Errors retrieval.
JspAwareRequestContext(PageContext pageContext, Map<String,Object> model)
Create a new JspAwareRequestContext for the given page context, using the given model attributes for Errors retrieval.
Method Summary
protected  Locale getFallbackLocale()
This implementation checks for a JSTL locale attribute in page, request, session or application scope; if not found, returns the HttpServletRequest.getLocale().
protected  PageContext getPageContext()
Return the underlying PageContext.
protected  void initContext(PageContext pageContext, Map<String,Object> model)
Initialize this context with the given page context, using the given model attributes for Errors retrieval.
Methods inherited from class org.springframework.web.servlet.support.RequestContext
getBindStatus, getBindStatus, getContextPath, getContextUrl, getDefaultHtmlEscape, getErrors, getErrors, getFallbackTheme, getLocale, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessageSource, getModel, getModelObject, getQueryString, getRequest, getRequestUri, getServletContext, getTheme, getThemeMessage, getThemeMessage, getThemeMessage, getThemeMessage, getThemeMessage, getThemeMessage, getThemeMessage, getUrlPathHelper, getWebApplicationContext, initContext, isDefaultHtmlEscape, setDefaultHtmlEscape, setUrlPathHelper
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JspAwareRequestContext

public JspAwareRequestContext(PageContext pageContext)
Create a new JspAwareRequestContext for the given page context, using the request attributes for Errors retrieval.

Parameters:
pageContext - current JSP page context

JspAwareRequestContext

public JspAwareRequestContext(PageContext pageContext,
                              Map<String,Object> model)
Create a new JspAwareRequestContext for the given page context, using the given model attributes for Errors retrieval.

Parameters:
pageContext - current JSP page context
model - the model attributes for the current view (can be null, using the request attributes for Errors retrieval)
Method Detail

initContext

protected void initContext(PageContext pageContext,
                           Map<String,Object> model)
Initialize this context with the given page context, using the given model attributes for Errors retrieval.

Parameters:
pageContext - current JSP page context
model - the model attributes for the current view (can be null, using the request attributes for Errors retrieval)

getPageContext

protected final PageContext getPageContext()
Return the underlying PageContext. Only intended for cooperating classes in this package.

getFallbackLocale

protected Locale getFallbackLocale()
This implementation checks for a JSTL locale attribute in page, request, session or application scope; if not found, returns the HttpServletRequest.getLocale().

Overrides:
getFallbackLocale in class RequestContext
Returns:
the fallback locale (never null)
See Also:
ServletRequest.getLocale()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JstlUtils

org.springframework.web.servlet.support
Class JstlUtils

java.lang.Object
    extended by  org.springframework.web.servlet.support.JstlUtils

public abstract class JstlUtils
extends Object

Helper class for preparing JSTL views, in particular for exposing a JSTL localization context.

Since:
20.08.2003
Author:
Juergen Hoeller

Constructor Summary
JstlUtils()
Method Summary
static void | exposeLocalizationContext(HttpServletRequest request, MessageSource messageSource) Exposes JSTL-specific request attributes specifying locale and resource bundle for JSTL's formatting and message tags, using Spring's locale and MessageSource.
static void | exposeLocalizationContext(RequestContext requestContext) Exposes JSTL-specific request attributes specifying locale and resource bundle for JSTL's formatting and message tags, using Spring's locale and MessageSource.
static MessageSource | getJstlAwareMessageSource(ServletContext servletContext, MessageSource messageSource) Checks JSTL's "javax.servlet.jsp.jstl.fmt.localizationContext" context-param and creates a corresponding child message source, with the provided Spring-defined MessageSource as parent.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JstlUtils

public JstlUtils()
Method Detail

getJstlAwareMessageSource

public static MessageSource getJstlAwareMessageSource(ServletContext servletContext,
                                                      MessageSource messageSource)
Checks JSTL's "javax.servlet.jsp.jstl.fmt.localizationContext" context-param and creates a corresponding child message source, with the provided Spring-defined MessageSource as parent.

Parameters:
servletContext - the ServletContext we're running in (to check JSTL-related context-params in web.xml)
messageSource - the MessageSource to expose, typically the ApplicationContext of the current DispatcherServlet
Returns:
the MessageSource to expose to JSTL; first checking the JSTL-defined bundle, then the Spring-defined MessageSource
See Also:
ApplicationContext

exposeLocalizationContext

public static void exposeLocalizationContext(HttpServletRequest request,
                                             MessageSource messageSource)
Exposes JSTL-specific request attributes specifying locale and resource bundle for JSTL's formatting and message tags, using Spring's locale and MessageSource.

Parameters:
request - the current HTTP request
messageSource - the MessageSource to expose, typically the current ApplicationContext (may be null)
See Also:
exposeLocalizationContext(RequestContext)

exposeLocalizationContext

public static void exposeLocalizationContext(RequestContext requestContext)
Exposes JSTL-specific request attributes specifying locale and resource bundle for JSTL's formatting and message tags, using Spring's locale and MessageSource.

Parameters:
requestContext - the context for the current HTTP request, including the ApplicationContext to expose as MessageSource
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RequestContext

org.springframework.web.servlet.support
Class RequestContext

java.lang.Object
    extended by  org.springframework.web.servlet.support.RequestContext
Direct Known Subclasses:
JspAwareRequestContext
public class RequestContext
extends Object

Context holder for request-specific state, like current web application context, current locale, current theme, and potential binding errors. Provides easy access to localized messages and Errors instances.

Suitable for exposition to views, and usage within JSP's "useBean" tag, JSP scriptlets, JSTL EL, Velocity templates, etc. Necessary for views that do not have access to the servlet request, like Velocity templates.

Can be instantiated manually, or automatically exposed to views as model attribute via AbstractView's "requestContextAttribute" property.

Will also work outside of DispatcherServlet requests, accessing the root WebApplicationContext and using an appropriate fallback for the locale (the HttpServletRequest's primary locale).

Since:
03.03.2003
Author:
Juergen Hoeller
See Also:
DispatcherServlet,
AbstractView.setRequestContextAttribute(java.lang.String),
UrlBasedViewResolver.setRequestContextAttribute(java.lang.String),
getFallbackLocale()

Field Summary
static String | DEFAULT_THEME_NAME Default theme name used if the RequestContext cannot find a ThemeResolver.
protected static boolean | jstlPresent
static String | WEB_APPLICATION_CONTEXT_ATTRIBUTE Request attribute to hold the current web application context for RequestContext usage.
Constructor Summary
protected | RequestContext() Default constructor for subclasses.
 | RequestContext(HttpServletRequest request) Create a new RequestContext for the given request, using the request attributes for Errors retrieval.
 | RequestContext(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext, Map<String,Object> model) Create a new RequestContext for the given request, using the given model attributes for Errors retrieval.
 | RequestContext(HttpServletRequest request, Map<String,Object> model) Create a new RequestContext for the given request, using the given model attributes for Errors retrieval.
 | RequestContext(HttpServletRequest request, ServletContext servletContext) Create a new RequestContext for the given request, using the request attributes for Errors retrieval.
Method Summary
BindStatus | getBindStatus(String path) Create a BindStatus for the given bind object, using the "defaultHtmlEscape" setting.
BindStatus | getBindStatus(String path, boolean htmlEscape) Create a BindStatus for the given bind object, using the "defaultHtmlEscape" setting.
String | getContextPath() Return the context path of the original request, that is, the path that indicates the current web application.
String | getContextUrl(String relativeUrl) Return a context-aware URl for the given relative URL.
Boolean | getDefaultHtmlEscape() Return the default HTML escape setting, differentiating between no default specified and an explicit value.
Errors | getErrors(String name) Retrieve the Errors instance for the given bind object, using the "defaultHtmlEscape" setting.
Errors | getErrors(String name, boolean htmlEscape) Retrieve the Errors instance for the given bind object.
protected Locale | getFallbackLocale() Determine the fallback locale for this context.
protected Theme | getFallbackTheme() Determine the fallback theme for this context.
Locale | getLocale() Return the current Locale (never null).
String | getMessage(MessageSourceResolvable resolvable) Retrieve the given MessageSourceResolvable (e.g.
String | getMessage(MessageSourceResolvable resolvable, boolean htmlEscape) Retrieve the given MessageSourceResolvable (e.g.
String | getMessage(String code) Retrieve the message for the given code, using the "defaultHtmlEscape" setting.
String | getMessage(String code, List args) Retrieve the message for the given code, using the "defaultHtmlEscape" setting.
String | getMessage(String code, List args, String defaultMessage) Retrieve the message for the given code, using the "defaultHtmlEscape" setting.
String | getMessage(String code, Object[] args) Retrieve the message for the given code, using the "defaultHtmlEscape" setting.
String | getMessage(String code, Object[] args, boolean htmlEscape) Retrieve the message for the given code.
String | getMessage(String code, Object[] args, String defaultMessage) Retrieve the message for the given code, using the "defaultHtmlEscape" setting.
String | getMessage(String code, Object[] args, String defaultMessage, boolean htmlEscape) Retrieve the message for the given code.
String | getMessage(String code, String defaultMessage) Retrieve the message for the given code, using the "defaultHtmlEscape" setting.
MessageSource | getMessageSource() Return the current WebApplicationContext as MessageSource.
Map<String,Object> | getModel() Return the model Map that this RequestContext encapsulates, if any.
protected Object | getModelObject(String modelName) Retrieve the model object for the given model name, either from the model or from the request attributes.
String | getQueryString() Return the query string of the current request, that is, the part after the request path.
protected HttpServletRequest | getRequest() Return the underlying HttpServletRequest.
String | getRequestUri() Return the request URI of the original request, that is, the invoked URL without parameters.
protected ServletContext | getServletContext() Return the underlying ServletContext.
Theme | getTheme() Return the current theme (never null).
String | getThemeMessage(MessageSourceResolvable resolvable) Retrieve the given MessageSourceResolvable in the current theme.
String | getThemeMessage(String code) Retrieve the theme message for the given code.
String | getThemeMessage(String code, List args) Retrieve the theme message for the given code.
String | getThemeMessage(String code, List args, String defaultMessage) Retrieve the theme message for the given code.
String | getThemeMessage(String code, Object[] args) Retrieve the theme message for the given code.
String | getThemeMessage(String code, Object[] args, String defaultMessage) Retrieve the theme message for the given code.
String | getThemeMessage(String code, String defaultMessage) Retrieve the theme message for the given code.
UrlPathHelper | getUrlPathHelper() Return the UrlPathHelper used for context path and request URI decoding.
WebApplicationContext | getWebApplicationContext() Return the current WebApplicationContext.
protected void | initContext(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext, Map<String,Object> model) Initialize this context with the given request, using the given model attributes for Errors retrieval.
boolean | isDefaultHtmlEscape() Is default HTML escaping active? Falls back to false in case of no explicit default given.
void | setDefaultHtmlEscape(boolean defaultHtmlEscape) (De)activate default HTML escaping for messages and errors, for the scope of this RequestContext.
void | setUrlPathHelper(UrlPathHelper urlPathHelper) Set the UrlPathHelper to use for context path and request URI decoding.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_THEME_NAME

public static final String DEFAULT_THEME_NAME
Default theme name used if the RequestContext cannot find a ThemeResolver. Only applies to non-DispatcherServlet requests.

Same as AbstractThemeResolver's default, but not linked in here to avoid package interdependencies.

See Also:
AbstractThemeResolver.ORIGINAL_DEFAULT_THEME_NAME, Constant Field Values

WEB_APPLICATION_CONTEXT_ATTRIBUTE

public static final String WEB_APPLICATION_CONTEXT_ATTRIBUTE
Request attribute to hold the current web application context for RequestContext usage. By default, the DispatcherServlet's context (or the root context as fallback) is exposed.

jstlPresent

protected static final boolean jstlPresent
Constructor Detail

RequestContext

public RequestContext(HttpServletRequest request)
Create a new RequestContext for the given request, using the request attributes for Errors retrieval.

This only works with InternalResourceViews, as Errors instances are part of the model and not normally exposed as request attributes. It will typically be used within JSPs or custom tags.

Will only work within a DispatcherServlet request. Pass in a ServletContext to be able to fallback to the root WebApplicationContext.

Parameters:
request - current HTTP request
See Also:
DispatcherServlet, RequestContext(javax.servlet.http.HttpServletRequest, javax.servlet.ServletContext)

RequestContext

public RequestContext(HttpServletRequest request,
                      ServletContext servletContext)
Create a new RequestContext for the given request, using the request attributes for Errors retrieval.

This only works with InternalResourceViews, as Errors instances are part of the model and not normally exposed as request attributes. It will typically be used within JSPs or custom tags.

If a ServletContext is specified, the RequestContext will also work with the root WebApplicationContext (outside a DispatcherServlet).

Parameters:
request - current HTTP request
servletContext - the servlet context of the web application (can be null; necessary for fallback to root WebApplicationContext)
See Also:
WebApplicationContext, DispatcherServlet

RequestContext

public RequestContext(HttpServletRequest request,
                      Map<String,Object> model)
Create a new RequestContext for the given request, using the given model attributes for Errors retrieval.

This works with all View implementations. It will typically be used by View implementations.

Will only work within a DispatcherServlet request. Pass in a ServletContext to be able to fallback to the root WebApplicationContext.

Parameters:
request - current HTTP request
model - the model attributes for the current view (can be null, using the request attributes for Errors retrieval)
See Also:
DispatcherServlet, #RequestContext(javax.servlet.http.HttpServletRequest, javax.servlet.ServletContext, Map)

RequestContext

public RequestContext(HttpServletRequest request,
                      HttpServletResponse response,
                      ServletContext servletContext,
                      Map<String,Object> model)
Create a new RequestContext for the given request, using the given model attributes for Errors retrieval.

This works with all View implementations. It will typically be used by View implementations.

If a ServletContext is specified, the RequestContext will also work with a root WebApplicationContext (outside a DispatcherServlet).

Parameters:
request - current HTTP request
response - current HTTP response
servletContext - the servlet context of the web application (can be null; necessary for fallback to root WebApplicationContext)
model - the model attributes for the current view (can be null, using the request attributes for Errors retrieval)
See Also:
WebApplicationContext, DispatcherServlet

RequestContext

protected RequestContext()
Default constructor for subclasses.

Method Detail

initContext

protected void initContext(HttpServletRequest request,
                           HttpServletResponse response,
                           ServletContext servletContext,
                           Map<String,Object> model)
Initialize this context with the given request, using the given model attributes for Errors retrieval.

Delegates to getFallbackLocale and getFallbackTheme for determining the fallback locale and theme, respectively, if no LocaleResolver and/or ThemeResolver can be found in the request.

Parameters:
request - current HTTP request
servletContext - the servlet context of the web application (can be null; necessary for fallback to root WebApplicationContext)
model - the model attributes for the current view (can be null, using the request attributes for Errors retrieval)
See Also:
getFallbackLocale(), getFallbackTheme(), DispatcherServlet.LOCALE_RESOLVER_ATTRIBUTE, DispatcherServlet.THEME_RESOLVER_ATTRIBUTE

getFallbackLocale

protected Locale getFallbackLocale()
Determine the fallback locale for this context.

The default implementation checks for a JSTL locale attribute in request, session or application scope; if not found, returns the HttpServletRequest.getLocale().

Returns:
the fallback locale (never null)
See Also:
ServletRequest.getLocale()

getFallbackTheme

protected Theme getFallbackTheme()
Determine the fallback theme for this context.

The default implementation returns the default theme (with name "theme").

Returns:
the fallback theme (never null)

getRequest

protected final HttpServletRequest getRequest()
Return the underlying HttpServletRequest. Only intended for cooperating classes in this package.

getServletContext

protected final ServletContext getServletContext()
Return the underlying ServletContext. Only intended for cooperating classes in this package.

getWebApplicationContext

public final WebApplicationContext getWebApplicationContext()
Return the current WebApplicationContext.

getMessageSource

public final MessageSource getMessageSource()
Return the current WebApplicationContext as MessageSource.

getModel

public final Map<String,Object> getModel()
Return the model Map that this RequestContext encapsulates, if any.

Returns:
the populated model Map, or null if none available

getLocale

public final Locale getLocale()
Return the current Locale (never null).

getTheme

public final Theme getTheme()
Return the current theme (never null).

Resolved lazily for more efficiency when theme support is not being used.

setDefaultHtmlEscape

public void setDefaultHtmlEscape(boolean defaultHtmlEscape)
(De)activate default HTML escaping for messages and errors, for the scope of this RequestContext. The default is the application-wide setting (the "defaultHtmlEscape" context-param in web.xml).

See Also:
WebUtils.isDefaultHtmlEscape(javax.servlet.ServletContext)

isDefaultHtmlEscape

public boolean isDefaultHtmlEscape()
Is default HTML escaping active? Falls back to false in case of no explicit default given.

getDefaultHtmlEscape

public Boolean getDefaultHtmlEscape()
Return the default HTML escape setting, differentiating between no default specified and an explicit value.

Returns:
whether default HTML escaping is enabled (null = no explicit default)

setUrlPathHelper

public void setUrlPathHelper(UrlPathHelper urlPathHelper)
Set the UrlPathHelper to use for context path and request URI decoding. Can be used to pass a shared UrlPathHelper instance in.

A default UrlPathHelper is always available.

getUrlPathHelper

public UrlPathHelper getUrlPathHelper()
Return the UrlPathHelper used for context path and request URI decoding. Can be used to configure the current UrlPathHelper.

A default UrlPathHelper is always available.

getContextPath

public String getContextPath()
Return the context path of the original request, that is, the path that indicates the current web application. This is useful for building links to other resources within the application.

Delegates to the UrlPathHelper for decoding.

See Also:
HttpServletRequest.getContextPath(), getUrlPathHelper()

getContextUrl

public String getContextUrl(String relativeUrl)
Return a context-aware URl for the given relative URL.

Parameters:
relativeUrl - the relative URL part
Returns:
a URL that points back to the server with an absolute path (also URL-encoded accordingly)

getRequestUri

public String getRequestUri()
Return the request URI of the original request, that is, the invoked URL without parameters. This is particularly useful as HTML form action target, possibly in combination with the original query string.

Note this implementation will correctly resolve to the URI of any originating root request in the presence of a forwarded request. However, this can only work when the Servlet 2.4 'forward' request attributes are present. For use in a Servlet 2.3 environment, you can rely on InternalResourceView to add these prior to dispatching the request.

Delegates to the UrlPathHelper for decoding.

See Also:
getQueryString(),
UrlPathHelper.getOriginatingRequestUri(javax.servlet.http.HttpServletRequest),
getUrlPathHelper()

getQueryString

public String getQueryString()
Return the query string of the current request, that is, the part after the request path. This is particularly useful for building an HTML form action target in combination with the original request URI.

Note this implementation will correctly resolve to the query string of any originating root request in the presence of a forwarded request. However, this can only work when the Servlet 2.4 'forward' request attributes are present. For use in a Servlet 2.3 environment, you can rely on InternalResourceView to add these prior to dispatching the request.

Delegates to the UrlPathHelper for decoding.

See Also:
getRequestUri(),
UrlPathHelper.getOriginatingQueryString(javax.servlet.http.HttpServletRequest),
getUrlPathHelper()

getMessage

public String getMessage(String code,
                         String defaultMessage)
Retrieve the message for the given code, using the "defaultHtmlEscape" setting.

Parameters:
code - code of the message
defaultMessage - String to return if the lookup fails
Returns:
the message

getMessage

public String getMessage(String code,
                         Object[] args,
                         String defaultMessage)
Retrieve the message for the given code, using the "defaultHtmlEscape" setting.

Parameters:
code - code of the message
args - arguments for the message, or null if none
defaultMessage - String to return if the lookup fails
Returns:
the message

getMessage

public String getMessage(String code,
                         List args,
                         String defaultMessage)
Retrieve the message for the given code, using the "defaultHtmlEscape" setting.

Parameters:
code - code of the message
args - arguments for the message as a List, or null if none
defaultMessage - String to return if the lookup fails
Returns:
the message

getMessage

public String getMessage(String code,
                         Object[] args,
                         String defaultMessage,
                         boolean htmlEscape)
Retrieve the message for the given code.

Parameters:
code - code of the message
args - arguments for the message, or null if none
defaultMessage - String to return if the lookup fails
htmlEscape - HTML escape the message?
Returns:
the message

getMessage

public String getMessage(String code)
                  throws NoSuchMessageException
Retrieve the message for the given code, using the "defaultHtmlEscape" setting.

Parameters:
code - code of the message
Returns:
the message
Throws:
NoSuchMessageException - if not found

getMessage

public String getMessage(String code,
                         Object[] args)
                  throws NoSuchMessageException
Retrieve the message for the given code, using the "defaultHtmlEscape" setting.

Parameters:
code - code of the message
args - arguments for the message, or null if none
Returns:
the message
Throws:
NoSuchMessageException - if not found

getMessage

public String getMessage(String code,
                         List args)
                  throws NoSuchMessageException
Retrieve the message for the given code, using the "defaultHtmlEscape" setting.

Parameters:
code - code of the message
args - arguments for the message as a List, or null if none
Returns:
the message
Throws:
NoSuchMessageException - if not found

getMessage

public String getMessage(String code,
                         Object[] args,
                         boolean htmlEscape)
                  throws NoSuchMessageException
Retrieve the message for the given code.

Parameters:
code - code of the message
args - arguments for the message, or null if none
htmlEscape - HTML escape the message?
Returns:
the message
Throws:
NoSuchMessageException - if not found

getMessage

public String getMessage(MessageSourceResolvable resolvable)
                  throws NoSuchMessageException
Retrieve the given MessageSourceResolvable (e.g. an ObjectError instance), using the "defaultHtmlEscape" setting.

Parameters:
resolvable - the MessageSourceResolvable
Returns:
the message
Throws:
NoSuchMessageException - if not found

getMessage

public String getMessage(MessageSourceResolvable resolvable,
                         boolean htmlEscape)
                  throws NoSuchMessageException
Retrieve the given MessageSourceResolvable (e.g. an ObjectError instance).

Parameters:
resolvable - the MessageSourceResolvable
htmlEscape - HTML escape the message?
Returns:
the message
Throws:
NoSuchMessageException - if not found

getThemeMessage

public String getThemeMessage(String code,
                              String defaultMessage)
Retrieve the theme message for the given code.

Note that theme messages are never HTML-escaped, as they typically denote theme-specific resource paths and not client-visible messages.

Parameters:
code - code of the message
defaultMessage - String to return if the lookup fails
Returns:
the message

getThemeMessage

public String getThemeMessage(String code,
                              Object[] args,
                              String defaultMessage)
Retrieve the theme message for the given code.

Note that theme messages are never HTML-escaped, as they typically denote theme-specific resource paths and not client-visible messages.

Parameters:
code - code of the message
args - arguments for the message, or null if none
defaultMessage - String to return if the lookup fails
Returns:
the message

getThemeMessage

public String getThemeMessage(String code,
                              List args,
                              String defaultMessage)
Retrieve the theme message for the given code.

Note that theme messages are never HTML-escaped, as they typically denote theme-specific resource paths and not client-visible messages.

Parameters:
code - code of the message
args - arguments for the message as a List, or null if none
defaultMessage - String to return if the lookup fails
Returns:
the message

getThemeMessage

public String getThemeMessage(String code)
                       throws NoSuchMessageException
Retrieve the theme message for the given code.

Note that theme messages are never HTML-escaped, as they typically denote theme-specific resource paths and not client-visible messages.

Parameters:
code - code of the message
Returns:
the message
Throws:
NoSuchMessageException - if not found

getThemeMessage

public String getThemeMessage(String code,
                              Object[] args)
                       throws NoSuchMessageException
Retrieve the theme message for the given code.

Note that theme messages are never HTML-escaped, as they typically denote theme-specific resource paths and not client-visible messages.

Parameters:
code - code of the message
args - arguments for the message, or null if none
Returns:
the message
Throws:
NoSuchMessageException - if not found

getThemeMessage

public String getThemeMessage(String code,
                              List args)
                       throws NoSuchMessageException
Retrieve the theme message for the given code.

Note that theme messages are never HTML-escaped, as they typically denote theme-specific resource paths and not client-visible messages.

Parameters:
code - code of the message
args - arguments for the message as a List, or null if none
Returns:
the message
Throws:
NoSuchMessageException - if not found

getThemeMessage

public String getThemeMessage(MessageSourceResolvable resolvable)
                       throws NoSuchMessageException
Retrieve the given MessageSourceResolvable in the current theme.

Note that theme messages are never HTML-escaped, as they typically denote theme-specific resource paths and not client-visible messages.

Parameters:
resolvable - the MessageSourceResolvable
Returns:
the message
Throws:
NoSuchMessageException - if not found

getErrors

public Errors getErrors(String name)
Retrieve the Errors instance for the given bind object, using the "defaultHtmlEscape" setting.

Parameters:
name - name of the bind object
Returns:
the Errors instance, or null if not found

getErrors

public Errors getErrors(String name,
                        boolean htmlEscape)
Retrieve the Errors instance for the given bind object.

Parameters:
name - name of the bind object
htmlEscape - create an Errors instance with automatic HTML escaping?
Returns:
the Errors instance, or null if not found

getModelObject

protected Object getModelObject(String modelName)
Retrieve the model object for the given model name, either from the model or from the request attributes.

Parameters:
modelName - the name of the model object
Returns:
the model object

getBindStatus

public BindStatus getBindStatus(String path)
                         throws IllegalStateException
Create a BindStatus for the given bind object, using the "defaultHtmlEscape" setting.

Parameters:
path - the bean and property path for which values and errors will be resolved (e.g. "person.age")
Returns:
the new BindStatus instance
Throws:
IllegalStateException - if no corresponding Errors object found

getBindStatus

public BindStatus getBindStatus(String path,
                                boolean htmlEscape)
                         throws IllegalStateException
Create a BindStatus for the given bind object, using the "defaultHtmlEscape" setting.

Parameters:
path - the bean and property path for which values and errors will be resolved (e.g. "person.age")
htmlEscape - create a BindStatus with automatic HTML escaping?
Returns:
the new BindStatus instance
Throws:
IllegalStateException - if no corresponding Errors object found
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RequestContextUtils

org.springframework.web.servlet.support
Class RequestContextUtils

java.lang.Object
    extended by  org.springframework.web.servlet.support.RequestContextUtils

public abstract class RequestContextUtils
extends Object

Utility class for easy access to request-specific state which has been set by the DispatcherServlet.

Supports lookup of current WebApplicationContext, LocaleResolver, Locale, ThemeResolver, Theme, and MultipartResolver.

Since:
03.03.2003
Author:
Juergen Hoeller
See Also:
RequestContext, DispatcherServlet

Constructor Summary
RequestContextUtils()
Method Summary
static Locale | getLocale(HttpServletRequest request) Retrieves the current locale from the given request, using the LocaleResolver bound to the request by the DispatcherServlet (if available), falling back to the request's accept-header Locale.
static LocaleResolver | getLocaleResolver(HttpServletRequest request) Return the LocaleResolver that has been bound to the request by the DispatcherServlet.
static Theme | getTheme(HttpServletRequest request) Retrieves the current theme from the given request, using the ThemeResolver and ThemeSource bound to the request by the DispatcherServlet.
static ThemeResolver | getThemeResolver(HttpServletRequest request) Return the ThemeResolver that has been bound to the request by the DispatcherServlet.
static ThemeSource | getThemeSource(HttpServletRequest request) Return the ThemeSource that has been bound to the request by the DispatcherServlet.
static WebApplicationContext | getWebApplicationContext(ServletRequest request) Look for the WebApplicationContext associated with the DispatcherServlet that has initiated request processing.
static WebApplicationContext | getWebApplicationContext(ServletRequest request, ServletContext servletContext) Look for the WebApplicationContext associated with the DispatcherServlet that has initiated request processing, and for the global context if none was found associated with the current request.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

RequestContextUtils

public RequestContextUtils()
Method Detail

getWebApplicationContext

public static WebApplicationContext getWebApplicationContext(ServletRequest request)
                                                      throws IllegalStateException
Look for the WebApplicationContext associated with the DispatcherServlet that has initiated request processing.

Parameters:
request - current HTTP request
Returns:
the request-specific web application context
Throws:
IllegalStateException - if no servlet-specific context has been found

getWebApplicationContext

public static WebApplicationContext getWebApplicationContext(ServletRequest request,
                                                             ServletContext servletContext)
                                                      throws IllegalStateException
Look for the WebApplicationContext associated with the DispatcherServlet that has initiated request processing, and for the global context if none was found associated with the current request. This method is useful to allow components outside the framework, such as JSP tag handlers, to access the most specific application context available.

Parameters:
request - current HTTP request
servletContext - current servlet context
Returns:
the request-specific WebApplicationContext, or the global one if no request-specific context has been found
Throws:
IllegalStateException - if neither a servlet-specific nor a global context has been found

getLocaleResolver

public static LocaleResolver getLocaleResolver(HttpServletRequest request)
Return the LocaleResolver that has been bound to the request by the DispatcherServlet.

Parameters:
request - current HTTP request
Returns:
the current LocaleResolver, or null if not found

getLocale

public static Locale getLocale(HttpServletRequest request)
Retrieves the current locale from the given request, using the LocaleResolver bound to the request by the DispatcherServlet (if available), falling back to the request's accept-header Locale.

Parameters:
request - current HTTP request
Returns:
the current locale, either from the LocaleResolver or from the plain request
See Also:
getLocaleResolver(javax.servlet.http.HttpServletRequest), ServletRequest.getLocale()

getThemeResolver

public static ThemeResolver getThemeResolver(HttpServletRequest request)
Return the ThemeResolver that has been bound to the request by the DispatcherServlet.

Parameters:
request - current HTTP request
Returns:
the current ThemeResolver, or null if not found

getThemeSource

public static ThemeSource getThemeSource(HttpServletRequest request)
Return the ThemeSource that has been bound to the request by the DispatcherServlet.

Parameters:
request - current HTTP request
Returns:
the current ThemeSource

getTheme

public static Theme getTheme(HttpServletRequest request)
Retrieves the current theme from the given request, using the ThemeResolver and ThemeSource bound to the request by the DispatcherServlet.

Parameters:
request - current HTTP request
Returns:
the current theme, or null if not found
See Also:
getThemeResolver(javax.servlet.http.HttpServletRequest)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WebContentGenerator

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.support
Class WebContentGenerator

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.support.WebContentGenerator
All Implemented Interfaces:
ApplicationContextAware, ServletContextAware
Direct Known Subclasses:
AbstractController, AnnotationMethodHandlerAdapter, WebContentInterceptor
public abstract class WebContentGenerator
extends WebApplicationObjectSupport

Convenient superclass for any kind of web content generator, like AbstractController and WebContentInterceptor. Can also be used for custom handlers that have their own HandlerAdapter.

Supports HTTP cache control options. The usage of corresponding HTTP headers can be controlled via the "useExpiresHeader", "useCacheControlHeader" and "useCacheControlNoStore" properties.

Author:
Rod Johnson, Juergen Hoeller
See Also:
setCacheSeconds(int), setRequireSession(boolean)

Field Summary
static String | METHOD_GET HTTP method "GET"
static String | METHOD_HEAD HTTP method "HEAD"
static String | METHOD_POST HTTP method "POST"
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Constructor Summary
WebContentGenerator()
Create a new WebContentGenerator which supports HTTP methods GET, HEAD and POST by default.
WebContentGenerator(boolean restrictDefaultSupportedMethods)
Create a new WebContentGenerator.
Method Summary
protected void | applyCacheSeconds(HttpServletResponse response, int seconds) Apply the given cache seconds and generate corresponding HTTP headers, i.e.
protected void | applyCacheSeconds(HttpServletResponse response, int seconds, boolean mustRevalidate) Apply the given cache seconds and generate respective HTTP headers.
protected void | cacheForSeconds(HttpServletResponse response, int seconds) Set HTTP headers to allow caching for the given number of seconds.
protected void | cacheForSeconds(HttpServletResponse response, int seconds, boolean mustRevalidate) Set HTTP headers to allow caching for the given number of seconds.
protected void | checkAndPrepare(HttpServletRequest request, HttpServletResponse response, boolean lastModified) Check and prepare the given request and response according to the settings of this generator.
protected void | checkAndPrepare(HttpServletRequest request, HttpServletResponse response, int cacheSeconds, boolean lastModified) Check and prepare the given request and response according to the settings of this generator.
int | getCacheSeconds() Return the number of seconds that content is cached.
String[] | getSupportedMethods() Return the HTTP methods that this content generator supports.
boolean | isRequireSession() Return whether a session is required to handle requests.
boolean | isUseCacheControlHeader() Return whether the HTTP 1.1 cache-control header is used.
boolean | isUseCacheControlNoStore() Return whether the HTTP 1.1 cache-control header value "no-store" is used.
boolean | isUseExpiresHeader() Return whether the HTTP 1.0 expires header is used.
protected void | preventCaching(HttpServletResponse response) Prevent the response from being cached.
void | setCacheSeconds(int seconds) Cache content for the given number of seconds.
void | setRequireSession(boolean requireSession) Set whether a session should be required to handle requests.
void | setSupportedMethods(String[] methods) Set the HTTP methods that this content generator should support.
void | setUseCacheControlHeader(boolean useCacheControlHeader) Set whether to use the HTTP 1.1 cache-control header.
void | setUseCacheControlNoStore(boolean useCacheControlNoStore) Set whether to use the HTTP 1.1 cache-control header value "no-store" when preventing caching.
void | setUseExpiresHeader(boolean useExpiresHeader) Set whether to use the HTTP 1.0 expires header.
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

METHOD_GET

public static final String METHOD_GET
HTTP method "GET"

See Also:
Constant Field Values

METHOD_HEAD

public static final String METHOD_HEAD
HTTP method "HEAD"

See Also:
Constant Field Values

METHOD_POST

public static final String METHOD_POST
HTTP method "POST"

See Also:
Constant Field Values
Constructor Detail

WebContentGenerator

public WebContentGenerator()
Create a new WebContentGenerator which supports HTTP methods GET, HEAD and POST by default.

WebContentGenerator

public WebContentGenerator(boolean restrictDefaultSupportedMethods)
Create a new WebContentGenerator.

Parameters:
restrictDefaultSupportedMethods - true if this generator should support HTTP methods GET, HEAD and POST by default, or false if it should be unrestricted
Method Detail

setSupportedMethods

public final void setSupportedMethods(String[] methods)
Set the HTTP methods that this content generator should support.

Default is GET, HEAD and POST for simple form controller types; unrestricted for general controllers and interceptors.

getSupportedMethods

public final String[] getSupportedMethods()
Return the HTTP methods that this content generator supports.

setRequireSession

public final void setRequireSession(boolean requireSession)
Set whether a session should be required to handle requests.

isRequireSession

public final boolean isRequireSession()
Return whether a session is required to handle requests.

setUseExpiresHeader

public final void setUseExpiresHeader(boolean useExpiresHeader)
Set whether to use the HTTP 1.0 expires header. Default is "true".

Note: Cache headers will only get applied if caching is enabled (or explicitly prevented) for the current request.

isUseExpiresHeader

public final boolean isUseExpiresHeader()
Return whether the HTTP 1.0 expires header is used.

setUseCacheControlHeader

public final void setUseCacheControlHeader(boolean useCacheControlHeader)
Set whether to use the HTTP 1.1 cache-control header. Default is "true".

Note: Cache headers will only get applied if caching is enabled (or explicitly prevented) for the current request.

isUseCacheControlHeader

public final boolean isUseCacheControlHeader()
Return whether the HTTP 1.1 cache-control header is used.

setUseCacheControlNoStore

public final void setUseCacheControlNoStore(boolean useCacheControlNoStore)
Set whether to use the HTTP 1.1 cache-control header value "no-store" when preventing caching. Default is "true".

isUseCacheControlNoStore

public final boolean isUseCacheControlNoStore()
Return whether the HTTP 1.1 cache-control header value "no-store" is used.

setCacheSeconds

public final void setCacheSeconds(int seconds)
Cache content for the given number of seconds. Default is -1, indicating no generation of cache-related headers.

Only if this is set to 0 (no cache) or a positive value (cache for this many seconds) will this class generate cache headers.

The headers can be overwritten by subclasses, before content is generated.

getCacheSeconds

public final int getCacheSeconds()
Return the number of seconds that content is cached.

checkAndPrepare

protected final void checkAndPrepare(HttpServletRequest request,
                                     HttpServletResponse response,
                                     boolean lastModified)
                              throws ServletException
Check and prepare the given request and response according to the settings of this generator. Checks for supported methods and a required session, and applies the number of cache seconds specified for this generator.

Parameters:
request - current HTTP request
response - current HTTP response
lastModified - if the mapped handler provides Last-Modified support
Throws:
ServletException - if the request cannot be handled because a check failed

checkAndPrepare

protected final void checkAndPrepare(HttpServletRequest request,
                                     HttpServletResponse response,
                                     int cacheSeconds,
                                     boolean lastModified)
                              throws ServletException
Check and prepare the given request and response according to the settings of this generator. Checks for supported methods and a required session, and applies the given number of cache seconds.

Parameters:
request - current HTTP request
response - current HTTP response
cacheSeconds - positive number of seconds into the future that the response should be cacheable for, 0 to prevent caching
lastModified - if the mapped handler provides Last-Modified support
Throws:
ServletException - if the request cannot be handled because a check failed

preventCaching

protected final void preventCaching(HttpServletResponse response)
Prevent the response from being cached. See http://www.mnot.net/cache_docs.

cacheForSeconds

protected final void cacheForSeconds(HttpServletResponse response,
                                     int seconds)
Set HTTP headers to allow caching for the given number of seconds. Does not tell the browser to revalidate the resource.

Parameters:
response - current HTTP response
seconds - number of seconds into the future that the response should be cacheable for
See Also:
cacheForSeconds(javax.servlet.http.HttpServletResponse, int, boolean)

cacheForSeconds

protected final void cacheForSeconds(HttpServletResponse response,
                                     int seconds,
                                     boolean mustRevalidate)
Set HTTP headers to allow caching for the given number of seconds. Tells the browser to revalidate the resource if mustRevalidate is true.

Parameters:
response - the current HTTP response
seconds - number of seconds into the future that the response should be cacheable for
mustRevalidate - whether the client should revalidate the resource (typically only necessary for controllers with last-modified support)

applyCacheSeconds

protected final void applyCacheSeconds(HttpServletResponse response,
                                       int seconds)
Apply the given cache seconds and generate corresponding HTTP headers, i.e. allow caching for the given number of seconds in case of a positive value, prevent caching if given a 0 value, do nothing else. Does not tell the browser to revalidate the resource.

Parameters:
response - current HTTP response
seconds - positive number of seconds into the future that the response should be cacheable for, 0 to prevent caching
See Also:
cacheForSeconds(javax.servlet.http.HttpServletResponse, int, boolean)

applyCacheSeconds

protected final void applyCacheSeconds(HttpServletResponse response,
                                       int seconds,
                                       boolean mustRevalidate)
Apply the given cache seconds and generate respective HTTP headers.

That is, allow caching for the given number of seconds in the case of a positive value, prevent caching if given a 0 value, else do nothing (i.e. leave caching to the client).

Parameters:
response - the current HTTP response
seconds - the (positive) number of seconds into the future that the response should be cacheable for; 0 to prevent caching; and a negative value to leave caching to the client.
mustRevalidate - whether the client should revalidate the resource (typically only necessary for controllers with last-modified support)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.servlet.tags

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.servlet.tags

Spring's JSP standard tag library for JSP 2.0+.

See:
Description

Interface Summary
EditorAwareTag | Interface to be implemented by JSP tags that expose a PropertyEditor for a property that they are currently bound to.
ParamAware | Allows implementing tag to utilize nested spring:param tags.

Class Summary
BindErrorsTag | JSP tag that evaluates content if there are binding errors for a certain bean.
BindTag | Bind tag, supporting evaluation of binding errors for a certain bean or bean property.
EscapeBodyTag | Custom JSP tag to escape its enclosed body content, applying HTML escaping and/or JavaScript escaping.
EvalTag | JSP tag for evaluating expressions with the Spring Expression Language (SpEL).
HtmlEscapeTag | Sets default HTML escape value for the current page.
HtmlEscapingAwareTag | Superclass for tags that output content that might get HTML-escaped.
MessageTag | Custom JSP tag to look up a message in the scope of this page.
NestedPathTag | Nested-path tag, to support and assist with nested beans or bean properties in the model.
Param | Bean used to pass name-value pair parameters from a ParamTag to a ParamAware tag.
ParamTag | JSP tag for collecting name-value parameters and passing them to a ParamAware ancestor in the tag hierarchy.
RequestContextAwareTag | Superclass for all tags that require a RequestContext.
ThemeTag | Custom tag to look up a theme message in the scope of this page.
TransformTag | Tag for transforming reference data values from form controllers and other objects inside a spring:bind tag (or a data-bound form element tag from Spring's form tag library).
UrlTag | JSP tag for creating URLs.

Package org.springframework.web.servlet.tags Description

Spring's JSP standard tag library for JSP 2.0+. Supports JSP view implementations within Spring's web MVC framework. See spring.tld for descriptions of the various tags.


org.springframework.web.servlet.tags Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.servlet.tags

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.web.servlet.tags.Param
    • javax.servlet.jsp.tagext.TagSupport (implements javax.servlet.jsp.tagext.IterationTag, java.io.Serializable)
      • javax.servlet.jsp.tagext.BodyTagSupport (implements javax.servlet.jsp.tagext.BodyTag)
        • org.springframework.web.servlet.tags.ParamTag
      • org.springframework.web.servlet.tags.NestedPathTag (implements javax.servlet.jsp.tagext.TryCatchFinally)
      • org.springframework.web.servlet.tags.RequestContextAwareTag (implements javax.servlet.jsp.tagext.TryCatchFinally)
        • org.springframework.web.servlet.tags.HtmlEscapeTag
        • org.springframework.web.servlet.tags.HtmlEscapingAwareTag
          • org.springframework.web.servlet.tags.BindErrorsTag
          • org.springframework.web.servlet.tags.BindTag (implements org.springframework.web.servlet.tags.EditorAwareTag)
          • org.springframework.web.servlet.tags.EscapeBodyTag (implements javax.servlet.jsp.tagext.BodyTag)
          • org.springframework.web.servlet.tags.EvalTag
          • org.springframework.web.servlet.tags.MessageTag
            • org.springframework.web.servlet.tags.ThemeTag
          • org.springframework.web.servlet.tags.TransformTag
          • org.springframework.web.servlet.tags.UrlTag (implements org.springframework.web.servlet.tags.ParamAware)

Interface Hierarchy

  • org.springframework.web.servlet.tags.EditorAwareTag
  • org.springframework.web.servlet.tags.ParamAware


EditorAwareTag

org.springframework.web.servlet.tags
Interface EditorAwareTag

All Known Implementing Classes:
AbstractCheckedElementTag, AbstractDataBoundFormElementTag, AbstractHtmlElementBodyTag, AbstractHtmlElementTag, AbstractHtmlInputElementTag, AbstractMultiCheckedElementTag, AbstractSingleCheckedElementTag, BindTag, CheckboxesTag, CheckboxTag, ErrorsTag, FormTag, HiddenInputTag, InputTag, LabelTag, OptionsTag, OptionTag, PasswordInputTag, RadioButtonsTag, RadioButtonTag, SelectTag, TextareaTag
public interface EditorAwareTag

Interface to be implemented by JSP tags that expose a PropertyEditor for a property that they are currently bound to.

Since:
2.5
Author:
Juergen Hoeller
See Also:
BindTag, AbstractDataBoundFormElementTag

Method Summary
 PropertyEditor getEditor()
Retrieve the PropertyEditor for the property that this tag is currently bound to.

Method Detail

getEditor

PropertyEditor getEditor()
                         throws JspException
Retrieve the PropertyEditor for the property that this tag is currently bound to. Intended for cooperating nesting tags.

Returns:
the current PropertyEditor, or null if none
Throws:
JspException - if resolving the editor failed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ParamAware

org.springframework.web.servlet.tags
Interface ParamAware

All Known Implementing Classes:
UrlTag
public interface ParamAware

Allows implementing tag to utilize nested spring:param tags.

Since:
3.0
Author:
Scott Andrews
See Also:
ParamTag

Method Summary
 void addParam(Param param)
Callback hook for nested spring:param tags to pass their value to the parent tag.

Method Detail

addParam

void addParam(Param param)
Callback hook for nested spring:param tags to pass their value to the parent tag.

Parameters:
param - the result of the nested spring:param tag
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BindErrorsTag

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.tags
Class BindErrorsTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapingAwareTag
                extended by  org.springframework.web.servlet.tags.BindErrorsTag
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag, TryCatchFinally
public class BindErrorsTag
extends HtmlEscapingAwareTag

JSP tag that evaluates content if there are binding errors for a certain bean. Exports an "errors" variable of type Errors for the given bean.

Author:
Rod Johnson, Juergen Hoeller
See Also:
BindTag, Errors, Serialized Form

Field Summary
static String ERRORS_VARIABLE_NAME
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
BindErrorsTag()
Method Summary
int | doEndTag()
void | doFinally()
protected int | doStartTagInternal() Called by doStartTag to perform the actual work.
Errors | getErrors() Retrieve the Errors instance that this tag is currently bound to.
String | getName() Return the name of the bean that this tag checks.
void | setName(String name) Set the name of the bean that this tag should check.
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isDefaultHtmlEscape, isHtmlEscape, setHtmlEscape
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doStartTag, getRequestContext
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

ERRORS_VARIABLE_NAME

public static final String ERRORS_VARIABLE_NAME
See Also:
Constant Field Values
Constructor Detail

BindErrorsTag

public BindErrorsTag()
Method Detail

setName

public void setName(String name)
Set the name of the bean that this tag should check.

getName

public String getName()
Return the name of the bean that this tag checks.

doStartTagInternal

protected final int doStartTagInternal()
                                throws ServletException,
                                       JspException
Description copied from class: RequestContextAwareTag
Called by doStartTag to perform the actual work.

Specified by:
doStartTagInternal in class RequestContextAwareTag
Returns:
same as TagSupport.doStartTag
Throws:
ServletException
JspException
See Also:
TagSupport.doStartTag()

doEndTag

public int doEndTag()
Specified by:
doEndTag in interface Tag
Overrides:
doEndTag in class TagSupport

getErrors

public final Errors getErrors()
Retrieve the Errors instance that this tag is currently bound to.

Intended for cooperating nesting tags.

doFinally

public void doFinally()
Specified by:
doFinally in interface TryCatchFinally
Overrides:
doFinally in class RequestContextAwareTag
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


BindTag

org.springframework.web.servlet.tags
Class BindTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapingAwareTag
                extended by  org.springframework.web.servlet.tags.BindTag
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag, TryCatchFinally, EditorAwareTag
public class BindTag
extends HtmlEscapingAwareTag
implements EditorAwareTag

Bind tag, supporting evaluation of binding errors for a certain bean or bean property. Exposes a "status" variable of type BindStatus, to both Java expressions and JSP EL expressions.

Can be used to bind to any bean or bean property in the model. The specified path determines whether the tag exposes the status of the bean itself (showing object-level errors), a specific bean property (showing field errors), or a matching set of bean properties (showing all corresponding field errors).

The Errors object that has been bound using this tag is exposed to collaborating tags, as well as the bean property that this errors object applies to. Nested tags such as the TransformTag can access those exposed properties.

Author:
Rod Johnson, Juergen Hoeller
See Also:
setPath(java.lang.String), Serialized Form

Field Summary
static String STATUS_VARIABLE_NAME
Name of the exposed variable within the scope of this tag: "status".
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
BindTag()
Method Summary
int | doEndTag()
void | doFinally()
protected int | doStartTagInternal() Called by doStartTag to perform the actual work.
PropertyEditor | getEditor() Retrieve the PropertyEditor for the property that this tag is currently bound to.
Errors | getErrors() Retrieve the Errors instance that this tag is currently bound to.
String | getPath() Return the path that this tag applies to.
String | getProperty() Retrieve the property that this tag is currently bound to, or null if bound to an object rather than a specific property.
boolean | isIgnoreNestedPath() Return whether to ignore a nested path, if any.
void | setIgnoreNestedPath(boolean ignoreNestedPath) Set whether to ignore a nested path, if any.
void | setPath(String path) Set the path that this tag should apply.
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isDefaultHtmlEscape, isHtmlEscape, setHtmlEscape
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doStartTag, getRequestContext
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

STATUS_VARIABLE_NAME

public static final String STATUS_VARIABLE_NAME
Name of the exposed variable within the scope of this tag: "status".

See Also:
Constant Field Values
Constructor Detail

BindTag

public BindTag()
Method Detail

setPath

public void setPath(String path)
Set the path that this tag should apply. Can be a bean (e.g. "person") to get global errors, or a bean property (e.g. "person.name") to get field errors (also supporting nested fields and "person.na*" mappings). "person.*" will return all errors for the specified bean, both global and field errors.

See Also:
Errors.getGlobalErrors(), Errors.getFieldErrors()

getPath

public String getPath()
Return the path that this tag applies to.

setIgnoreNestedPath

public void setIgnoreNestedPath(boolean ignoreNestedPath)
Set whether to ignore a nested path, if any. Default is to not ignore.

isIgnoreNestedPath

public boolean isIgnoreNestedPath()
Return whether to ignore a nested path, if any.

doStartTagInternal

protected final int doStartTagInternal()
                                throws Exception
Description copied from class: RequestContextAwareTag
Called by doStartTag to perform the actual work.

Specified by:
doStartTagInternal in class RequestContextAwareTag
Returns:
same as TagSupport.doStartTag
Throws:
Exception - any exception, any checked one other than a JspException gets wrapped in a JspException by doStartTag
See Also:
TagSupport.doStartTag()

doEndTag

public int doEndTag()
Specified by:
doEndTag in interface Tag
Overrides:
doEndTag in class TagSupport

getProperty

public final String getProperty()
Retrieve the property that this tag is currently bound to, or null if bound to an object rather than a specific property. Intended for cooperating nesting tags.

Returns:
the property that this tag is currently bound to, or null if none

getErrors

public final Errors getErrors()
Retrieve the Errors instance that this tag is currently bound to. Intended for cooperating nesting tags.

Returns:
the current Errors instance, or null if none

getEditor

public final PropertyEditor getEditor()
Description copied from interface: EditorAwareTag
Retrieve the PropertyEditor for the property that this tag is currently bound to. Intended for cooperating nesting tags.

Specified by:
getEditor in interface EditorAwareTag
Returns:
the current PropertyEditor, or null if none

doFinally

public void doFinally()
Specified by:
doFinally in interface TryCatchFinally
Overrides:
doFinally in class RequestContextAwareTag
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EscapeBodyTag

org.springframework.web.servlet.tags
Class EscapeBodyTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapingAwareTag
                extended by  org.springframework.web.servlet.tags.EscapeBodyTag
All Implemented Interfaces:
Serializable, BodyTag, IterationTag, JspTag, Tag, TryCatchFinally
public class EscapeBodyTag
extends HtmlEscapingAwareTag
implements BodyTag

Custom JSP tag to escape its enclosed body content, applying HTML escaping and/or JavaScript escaping.

Provides a "htmlEscape" property for explicitly specifying whether to apply HTML escaping. If not set, a page-level default (e.g. from the HtmlEscapeTag) or an application-wide default (the "defaultHtmlEscape" context-param in web.xml) is used.

Provides a "javaScriptEscape" property for specifying whether to apply JavaScript escaping. Can be combined with HTML escaping or used standalone.

Since:
1.1.1
Author:
Juergen Hoeller
See Also:
HtmlUtils, JavaScriptUtils, Serialized Form

Field Summary
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
EscapeBodyTag()
Method Summary
int | doAfterBody()
void | doInitBody()
protected int | doStartTagInternal() Called by doStartTag to perform the actual work.
protected String | readBodyContent() Read the unescaped body content from the page.
void | setBodyContent(BodyContent bodyContent)
void | setJavaScriptEscape(String javaScriptEscape) Set JavaScript escaping for this tag, as boolean value.
protected void | writeBodyContent(String content) Write the escaped body content to the page.
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isDefaultHtmlEscape, isHtmlEscape, setHtmlEscape
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doFinally, doStartTag, getRequestContext
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.servlet.jsp.tagext.Tag
doEndTag, doStartTag, getParent, release, setPageContext, setParent

Constructor Detail

EscapeBodyTag

public EscapeBodyTag()
Method Detail

setJavaScriptEscape

public void setJavaScriptEscape(String javaScriptEscape)
                         throws JspException
Set JavaScript escaping for this tag, as boolean value. Default is "false".

Throws:
JspException

doStartTagInternal

protected int doStartTagInternal()
Description copied from class: RequestContextAwareTag
Called by doStartTag to perform the actual work.

Specified by:
doStartTagInternal in class RequestContextAwareTag
Returns:
same as TagSupport.doStartTag
See Also:
TagSupport.doStartTag()

doInitBody

public void doInitBody()
Specified by:
doInitBody in interface BodyTag

setBodyContent

public void setBodyContent(BodyContent bodyContent)
Specified by:
setBodyContent in interface BodyTag

doAfterBody

public int doAfterBody()
                throws JspException
Specified by:
doAfterBody in interface IterationTag
Overrides:
doAfterBody in class TagSupport
Throws:
JspException

readBodyContent

protected String readBodyContent()
                          throws IOException
Read the unescaped body content from the page.

Returns:
the original content
Throws:
IOException - if reading failed

writeBodyContent

protected void writeBodyContent(String content)
                         throws IOException
Write the escaped body content to the page.

Can be overridden in subclasses, e.g. for testing purposes.

Parameters:
content - the content to write
Throws:
IOException - if writing failed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EvalTag

org.springframework.web.servlet.tags
Class EvalTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapingAwareTag
                extended by  org.springframework.web.servlet.tags.EvalTag
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag, TryCatchFinally
public class EvalTag
extends HtmlEscapingAwareTag

JSP tag for evaluating expressions with the Spring Expression Language (SpEL). Supports the standard JSP evaluation context consisting of implicit variables and scoped attributes.

Since:
3.0.1
Author:
Keith Donald
See Also:
Serialized Form

Field Summary
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
EvalTag()
Method Summary
int | doEndTag()
int | doStartTagInternal() Called by doStartTag to perform the actual work.
void | setExpression(String expression) Set the expression to evaluate.
void | setJavaScriptEscape(String javaScriptEscape) Set JavaScript escaping for this tag, as boolean value.
void | setPageContext(PageContext pageContext)
void | setScope(String scope) Set the scope to export the evaluation result to.
void | setVar(String var) Set the variable name to expose the evaluation result under.
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isDefaultHtmlEscape, isHtmlEscape, setHtmlEscape
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doFinally, doStartTag, getRequestContext
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

EvalTag

public EvalTag()
Method Detail

setPageContext

public void setPageContext(PageContext pageContext)
Specified by:
setPageContext in interface Tag
Overrides:
setPageContext in class TagSupport

setExpression

public void setExpression(String expression)
Set the expression to evaluate.

setVar

public void setVar(String var)
Set the variable name to expose the evaluation result under. Defaults to rendering the result to the current JspWriter.

setScope

public void setScope(String scope)
Set the scope to export the evaluation result to. This attribute has no meaning unless var is also defined.

setJavaScriptEscape

public void setJavaScriptEscape(String javaScriptEscape)
                         throws JspException
Set JavaScript escaping for this tag, as boolean value. Default is "false".

Throws:
JspException

doStartTagInternal

public int doStartTagInternal()
                       throws JspException
Description copied from class: RequestContextAwareTag
Called by doStartTag to perform the actual work.

Specified by:
doStartTagInternal in class RequestContextAwareTag
Returns:
same as TagSupport.doStartTag
Throws:
JspException
See Also:
TagSupport.doStartTag()

doEndTag

public int doEndTag()
             throws JspException
Specified by:
doEndTag in interface Tag
Overrides:
doEndTag in class TagSupport
Throws:
JspException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HtmlEscapeTag

org.springframework.web.servlet.tags
Class HtmlEscapeTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapeTag
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag, TryCatchFinally
public class HtmlEscapeTag
extends RequestContextAwareTag

Sets default HTML escape value for the current page. The actual value can be overridden by escaping-aware tags. The default is "false".

Note: You can also set a "defaultHtmlEscape" web.xml context-param. A page-level setting overrides a context-param.

Since:
04.03.2003
Author:
Juergen Hoeller
See Also:
HtmlEscapingAwareTag.setHtmlEscape(java.lang.String), Serialized Form

Field Summary
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
HtmlEscapeTag()
Method Summary
protected int | doStartTagInternal() Called by doStartTag to perform the actual work.
void | setDefaultHtmlEscape(String defaultHtmlEscape) Set the default value for HTML escaping, to be put into the current PageContext.
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doFinally, doStartTag, getRequestContext
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

HtmlEscapeTag

public HtmlEscapeTag()
Method Detail

setDefaultHtmlEscape

public void setDefaultHtmlEscape(String defaultHtmlEscape)
Set the default value for HTML escaping, to be put into the current PageContext.

doStartTagInternal

protected int doStartTagInternal()
                          throws JspException
Description copied from class: RequestContextAwareTag
Called by doStartTag to perform the actual work.

Specified by:
doStartTagInternal in class RequestContextAwareTag
Returns:
same as TagSupport.doStartTag
Throws:
JspException
See Also:
TagSupport.doStartTag()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HtmlEscapingAwareTag

org.springframework.web.servlet.tags
Class HtmlEscapingAwareTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapingAwareTag
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag, TryCatchFinally
Direct Known Subclasses:
AbstractFormTag, BindErrorsTag, BindTag, EscapeBodyTag, EvalTag, MessageTag, TransformTag, UrlTag
public abstract class HtmlEscapingAwareTag
extends RequestContextAwareTag

Superclass for tags that output content that might get HTML-escaped.

Provides a "htmlEscape" property for explicitly specifying whether to apply HTML escaping. If not set, a page-level default (e.g. from the HtmlEscapeTag) or an application-wide default (the "defaultHtmlEscape" context-param in web.xml) is used.

Since:
1.1
Author:
Juergen Hoeller
See Also:
setHtmlEscape(java.lang.String), HtmlEscapeTag, RequestContext.isDefaultHtmlEscape(), WebUtils.isDefaultHtmlEscape(javax.servlet.ServletContext), Serialized Form

Field Summary
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
HtmlEscapingAwareTag()
Method Summary
protected boolean | isDefaultHtmlEscape() Return the applicable default HTML escape setting for this tag.
protected boolean | isHtmlEscape() Return the HTML escaping setting for this tag, or the default setting if not overridden.
void | setHtmlEscape(String htmlEscape) Set HTML escaping for this tag, as boolean value.
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doFinally, doStartTag, doStartTagInternal, getRequestContext
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

HtmlEscapingAwareTag

public HtmlEscapingAwareTag()
Method Detail

setHtmlEscape

public void setHtmlEscape(String htmlEscape)
                   throws JspException
Set HTML escaping for this tag, as boolean value. Overrides the default HTML escaping setting for the current page.

Throws:
JspException
See Also:
HtmlEscapeTag.setDefaultHtmlEscape(java.lang.String)

isHtmlEscape

protected boolean isHtmlEscape()
Return the HTML escaping setting for this tag, or the default setting if not overridden.

See Also:
isDefaultHtmlEscape()

isDefaultHtmlEscape

protected boolean isDefaultHtmlEscape()
Return the applicable default HTML escape setting for this tag.

The default implementation checks the RequestContext's setting, falling back to false in case of no explicit default given.

See Also:
RequestContextAwareTag.getRequestContext()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageTag

org.springframework.web.servlet.tags
Class MessageTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapingAwareTag
                extended by  org.springframework.web.servlet.tags.MessageTag
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag, TryCatchFinally
Direct Known Subclasses:
ThemeTag
public class MessageTag
extends HtmlEscapingAwareTag

Custom JSP tag to look up a message in the scope of this page. Messages are resolved using the ApplicationContext and thus support internationalization.

Detects an HTML escaping setting, either on this tag instance, the page level, or the web.xml level. Can also apply JavaScript escaping.

If "code" isn't set or cannot be resolved, "text" will be used as default message. Thus, this tag can also be used for HTML escaping of any texts.

Author:
Rod Johnson, Juergen Hoeller
See Also:
setCode(java.lang.String),
setText(java.lang.String),
HtmlEscapingAwareTag.setHtmlEscape(java.lang.String),
setJavaScriptEscape(java.lang.String),
HtmlEscapeTag.setDefaultHtmlEscape(java.lang.String),
WebUtils.HTML_ESCAPE_CONTEXT_PARAM,
Serialized Form

Field Summary
static String DEFAULT_ARGUMENT_SEPARATOR
Default separator for splitting an arguments String: a comma (",")
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
MessageTag()
Method Summary
protected int | doStartTagInternal() Resolves the message, escapes it if demanded, and writes it to the page (or exposes it as variable).
protected MessageSource | getMessageSource() Use the current RequestContext's application context as MessageSource.
protected String | getNoSuchMessageExceptionDescription(NoSuchMessageException ex) Return default exception message.
protected Object[] | resolveArguments(Object arguments) Resolve the given arguments Object into an arguments array.
protected String | resolveMessage() Resolve the specified message into a concrete message String.
void | setArguments(Object arguments) Set optional message arguments for this tag, as a comma-delimited String (each String argument can contain JSP EL), an Object array (used as argument array), or a single Object (used as single argument).
void | setArgumentSeparator(String argumentSeparator) Set the separator to use for splitting an arguments String.
void | setCode(String code) Set the message code for this tag.
void | setJavaScriptEscape(String javaScriptEscape) Set JavaScript escaping for this tag, as boolean value.
void | setMessage(Object message) Set the MessageSourceResolvable for this tag.
void | setScope(String scope) Set the scope to export the variable to.
void | setText(String text) Set the message text for this tag.
void | setVar(String var) Set PageContext attribute name under which to expose a variable that contains the resolved message.
protected void | writeMessage(String msg) Write the message to the page.
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isDefaultHtmlEscape, isHtmlEscape, setHtmlEscape
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doFinally, doStartTag, getRequestContext
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_ARGUMENT_SEPARATOR

public static final String DEFAULT_ARGUMENT_SEPARATOR
Default separator for splitting an arguments String: a comma (",")

See Also:
Constant Field Values
Constructor Detail

MessageTag

public MessageTag()
Method Detail

setMessage

public void setMessage(Object message)
Set the MessageSourceResolvable for this tag. Accepts a direct MessageSourceResolvable instance as well as a JSP expression language String that points to a MessageSourceResolvable.

If a MessageSourceResolvable is specified, it effectively overrides any code, arguments or text specified on this tag.

setCode

public void setCode(String code)
Set the message code for this tag.

setArguments

public void setArguments(Object arguments)
Set optional message arguments for this tag, as a comma-delimited String (each String argument can contain JSP EL), an Object array (used as argument array), or a single Object (used as single argument).

setArgumentSeparator

public void setArgumentSeparator(String argumentSeparator)
Set the separator to use for splitting an arguments String. Default is a comma (",").

See Also:
setArguments(java.lang.Object)

setText

public void setText(String text)
Set the message text for this tag.

setVar

public void setVar(String var)
Set PageContext attribute name under which to expose a variable that contains the resolved message.

See Also:
setScope(java.lang.String), JspContext.setAttribute(java.lang.String, java.lang.Object)

setScope

public void setScope(String scope)
Set the scope to export the variable to. Default is SCOPE_PAGE ("page").

See Also:
setVar(java.lang.String), TagUtils.SCOPE_PAGE, JspContext.setAttribute(java.lang.String, java.lang.Object)

setJavaScriptEscape

public void setJavaScriptEscape(String javaScriptEscape)
                         throws JspException
Set JavaScript escaping for this tag, as boolean value. Default is "false".

Throws:
JspException

doStartTagInternal

protected final int doStartTagInternal()
                                throws JspException,
                                       IOException
Resolves the message, escapes it if demanded, and writes it to the page (or exposes it as variable).

Specified by:
doStartTagInternal in class RequestContextAwareTag
Returns:
same as TagSupport.doStartTag
Throws:
JspException
IOException
See Also:
resolveMessage(),
HtmlUtils.htmlEscape(String),
JavaScriptUtils.javaScriptEscape(String),
writeMessage(String)

resolveMessage

protected String resolveMessage()
                         throws JspException,
                                NoSuchMessageException
Resolve the specified message into a concrete message String. The returned message String should be unescaped.

Throws:
JspException
NoSuchMessageException

resolveArguments

protected Object[] resolveArguments(Object arguments)
                             throws JspException
Resolve the given arguments Object into an arguments array.

Parameters:
arguments - the specified arguments Object
Returns:
the resolved arguments as array
Throws:
JspException - if argument conversion failed
See Also:
setArguments(java.lang.Object)

writeMessage

protected void writeMessage(String msg)
                     throws IOException
Write the message to the page.

Can be overridden in subclasses, e.g. for testing purposes.

Parameters:
msg - the message to write
Throws:
IOException - if writing failed

getMessageSource

protected MessageSource getMessageSource()
Use the current RequestContext's application context as MessageSource.

getNoSuchMessageExceptionDescription

protected String getNoSuchMessageExceptionDescription(NoSuchMessageException ex)
Return default exception message.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NestedPathTag

org.springframework.web.servlet.tags
Class NestedPathTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.NestedPathTag
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag, TryCatchFinally
public class NestedPathTag
extends TagSupport
implements TryCatchFinally

Nested-path tag, to support and assist with nested beans or bean properties in the model. Exports a "nestedPath" variable of type String in request scope, visible to the current page and also included pages, if any.

The BindTag will auto-detect the current nested path and automatically prepend it to its own path to form a complete path to the bean or bean property.

This tag will also prepend any existing nested path that is currently set. Thus, you can nest multiple nested-path tags.

Thanks to Seth Ladd for the suggestion and the original implementation!

Since:
1.1
Author:
Juergen Hoeller
See Also:
Serialized Form

Field Summary
static String NESTED_PATH_VARIABLE_NAME
Name of the exposed variable within the scope of this tag: "nestedPath".
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
NestedPathTag()
Method Summary
void | doCatch(Throwable throwable)
int | doEndTag() Reset any previous nestedPath value.
void | doFinally()
int | doStartTag()
String | getPath() Return the path that this tag applies to.
void | setPath(String path) Set the path that this tag should apply.
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

NESTED_PATH_VARIABLE_NAME

public static final String NESTED_PATH_VARIABLE_NAME
Name of the exposed variable within the scope of this tag: "nestedPath".

See Also:
Constant Field Values
Constructor Detail

NestedPathTag

public NestedPathTag()
Method Detail

setPath

public void setPath(String path)
Set the path that this tag should apply.

E.g. "customer" to allow bind paths like "address.street" rather than "customer.address.street".

See Also:
BindTag.setPath(java.lang.String)

getPath

public String getPath()
Return the path that this tag applies to.

doStartTag

public int doStartTag()
               throws JspException
Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class TagSupport
Throws:
JspException

doEndTag

public int doEndTag()
Reset any previous nestedPath value.

Specified by:
doEndTag in interface Tag
Overrides:
doEndTag in class TagSupport

doCatch

public void doCatch(Throwable throwable)
             throws Throwable
Specified by:
doCatch in interface TryCatchFinally
Throws:
Throwable

doFinally

public void doFinally()
Specified by:
doFinally in interface TryCatchFinally
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Param

org.springframework.web.servlet.tags
Class Param

java.lang.Object
    extended by  org.springframework.web.servlet.tags.Param

public class Param
extends Object

Bean used to pass name-value pair parameters from a ParamTag to a ParamAware tag.

Attributes are the raw values passed to the spring:param tag and have not been encoded or escaped.

Since:
3.0
Author:
Scott Andrews
See Also:
ParamTag

Constructor Summary
Param()
Method Summary
String | getName()
String | getValue()
void | setName(String name) Set the raw name of the parameter
void | setValue(String value) Set the raw value of the parameter
String | toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

Param

public Param()
Method Detail

getName

public String getName()
Returns:
the raw parameter name

setName

public void setName(String name)
Set the raw name of the parameter

getValue

public String getValue()
Returns:
the raw parameter value

setValue

public void setValue(String value)
Set the raw value of the parameter

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ParamTag

org.springframework.web.servlet.tags
Class ParamTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  javax.servlet.jsp.tagext.BodyTagSupport
            extended by  org.springframework.web.servlet.tags.ParamTag
All Implemented Interfaces:
Serializable, BodyTag, IterationTag, JspTag, Tag
public class ParamTag
extends BodyTagSupport

JSP tag for collecting name-value parameters and passing them to a ParamAware ancestor in the tag hierarchy.

This tag must be nested under a param aware tag.

Since:
3.0
Author:
Scott Andrews
See Also:
Param, UrlTag, Serialized Form

Field Summary
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
ParamTag()
Method Summary
int | doEndTag()
void | setName(String name) Sets the name of the parameter
void | setValue(String value) Sets the value of the parameter
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doInitBody, doStartTag, getBodyContent, getPreviousOut, release, setBodyContent
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent

Constructor Detail

ParamTag

public ParamTag()
Method Detail

doEndTag

public int doEndTag()
             throws JspException
Specified by:
doEndTag in interface Tag
Overrides:
doEndTag in class BodyTagSupport
Throws:
JspException

setName

public void setName(String name)
Sets the name of the parameter

Required

Parameters:
name - the parameter name

setValue

public void setValue(String value)
Sets the value of the parameter

Optional. If not set, the tag's body content is evaluated

Parameters:
value - the parameter value
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RequestContextAwareTag

org.springframework.web.servlet.tags
Class RequestContextAwareTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag, TryCatchFinally
Direct Known Subclasses:
HtmlEscapeTag, HtmlEscapingAwareTag
public abstract class RequestContextAwareTag
extends TagSupport
implements TryCatchFinally

Superclass for all tags that require a RequestContext.

The RequestContext instance provides easy access to current state like the WebApplicationContext, the Locale, the Theme, etc.

Mainly intended for DispatcherServlet requests; will use fallbacks when used outside DispatcherServlet.

Author:
Rod Johnson, Juergen Hoeller
See Also:
RequestContext, DispatcherServlet, Serialized Form

Field Summary
protected Log | logger Logger available to subclasses
static String | REQUEST_CONTEXT_PAGE_ATTRIBUTE PageContext attribute for page-level RequestContext instance.
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
RequestContextAwareTag()
Method Summary
void | doCatch(Throwable throwable)
void | doFinally()
int | doStartTag() Create and expose the current RequestContext.
protected abstract int | doStartTagInternal() Called by doStartTag to perform the actual work.
protected RequestContext | getRequestContext() Return the current RequestContext.
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

REQUEST_CONTEXT_PAGE_ATTRIBUTE

public static final String REQUEST_CONTEXT_PAGE_ATTRIBUTE
PageContext attribute for page-level RequestContext instance.

See Also:
Constant Field Values

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

RequestContextAwareTag

public RequestContextAwareTag()
Method Detail

doStartTag

public final int doStartTag()
                     throws JspException
Create and expose the current RequestContext. Delegates to doStartTagInternal() for actual work.

Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class TagSupport
Throws:
JspException
See Also:
REQUEST_CONTEXT_PAGE_ATTRIBUTE, JspAwareRequestContext

getRequestContext

protected final RequestContext getRequestContext()
Return the current RequestContext.

doStartTagInternal

protected abstract int doStartTagInternal()
                                   throws Exception
Called by doStartTag to perform the actual work.

Returns:
same as TagSupport.doStartTag
Throws:
Exception - any exception, any checked one other than a JspException gets wrapped in a JspException by doStartTag
See Also:
TagSupport.doStartTag()

doCatch

public void doCatch(Throwable throwable)
             throws Throwable
Specified by:
doCatch in interface TryCatchFinally
Throws:
Throwable

doFinally

public void doFinally()
Specified by:
doFinally in interface TryCatchFinally
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ThemeTag

org.springframework.web.servlet.tags
Class ThemeTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapingAwareTag
                extended by  org.springframework.web.servlet.tags.MessageTag
                    extended by  org.springframework.web.servlet.tags.ThemeTag
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag, TryCatchFinally
public class ThemeTag
extends MessageTag

Custom tag to look up a theme message in the scope of this page. Messages are looked up using the ApplicationContext's ThemeSource, and thus should support internationalization.

Regards a HTML escaping setting, either on this tag instance, the page level, or the web.xml level.

If "code" isn't set or cannot be resolved, "text" will be used as default message.

Author:
Jean-Pierre Pawlak, Juergen Hoeller
See Also:
Theme, ThemeSource, MessageTag.setCode(java.lang.String), MessageTag.setText(java.lang.String), HtmlEscapingAwareTag.setHtmlEscape(java.lang.String), HtmlEscapeTag.setDefaultHtmlEscape(java.lang.String), WebUtils.HTML_ESCAPE_CONTEXT_PARAM, Serialized Form

Field Summary
Fields inherited from class org.springframework.web.servlet.tags.MessageTag
DEFAULT_ARGUMENT_SEPARATOR
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
ThemeTag()
Method Summary
protected MessageSource | getMessageSource() Use the theme MessageSource for theme message resolution.
protected String | getNoSuchMessageExceptionDescription(NoSuchMessageException ex) Return exception message that indicates the current theme.
Methods inherited from class org.springframework.web.servlet.tags.MessageTag
doStartTagInternal, resolveArguments, resolveMessage, setArguments, setArgumentSeparator, setCode, setJavaScriptEscape, setMessage, setScope, setText, setVar, writeMessage
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isDefaultHtmlEscape, isHtmlEscape, setHtmlEscape
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doFinally, doStartTag, getRequestContext
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ThemeTag

public ThemeTag()
Method Detail

getMessageSource

protected MessageSource getMessageSource()
Use the theme MessageSource for theme message resolution.

Overrides:
getMessageSource in class MessageTag

getNoSuchMessageExceptionDescription

protected String getNoSuchMessageExceptionDescription(NoSuchMessageException ex)
Return exception message that indicates the current theme.

Overrides:
getNoSuchMessageExceptionDescription in class MessageTag
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransformTag

org.springframework.web.servlet.tags
Class TransformTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapingAwareTag
                extended by  org.springframework.web.servlet.tags.TransformTag
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag, TryCatchFinally
public class TransformTag
extends HtmlEscapingAwareTag

Tag for transforming reference data values from form controllers and other objects inside a spring:bind tag (or a data-bound form element tag from Spring's form tag library).

The BindTag has a PropertyEditor that it uses to transform properties of a bean to a String, useable in HTML forms. This tag uses that PropertyEditor to transform objects passed into this tag.

Since:
20.09.2003
Author:
Alef Arendsen, Juergen Hoeller
See Also:
BindTag, Serialized Form

Field Summary
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
TransformTag()
Method Summary
protected int | doStartTagInternal() Called by doStartTag to perform the actual work.
void | setScope(String scope) Set the scope to export the variable to.
void | setValue(Object value) Set the value to transform, using the appropriate PropertyEditor from the enclosing BindTag.
void | setVar(String var) Set PageContext attribute name under which to expose a variable that contains the result of the transformation.
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isDefaultHtmlEscape, isHtmlEscape, setHtmlEscape
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doFinally, doStartTag, getRequestContext
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TransformTag

public TransformTag()
Method Detail

setValue

public void setValue(Object value)
Set the value to transform, using the appropriate PropertyEditor from the enclosing BindTag.

The value can either be a plain value to transform (a hard-coded String value in a JSP or a JSP expression), or a JSP EL expression to be evaluated (transforming the result of the expression).

Like all of Spring's JSP tags, this tag is capable of parsing EL expressions itself, on any JSP version. Note, however, that EL expressions in a JSP 2.0 page will be evaluated by the JSP container, with the result getting passed in here. For this reason, the type of this property is Object (accepting any result object from a pre-evaluated expression) rather than String.

setVar

public void setVar(String var)
Set PageContext attribute name under which to expose a variable that contains the result of the transformation.

See Also:
setScope(java.lang.String), JspContext.setAttribute(java.lang.String, java.lang.Object)

setScope

public void setScope(String scope)
Set the scope to export the variable to. Default is SCOPE_PAGE ("page").

See Also:
setVar(java.lang.String), TagUtils.SCOPE_PAGE, JspContext.setAttribute(java.lang.String, java.lang.Object)

doStartTagInternal

protected final int doStartTagInternal()
                                throws JspException
Description copied from class: RequestContextAwareTag
Called by doStartTag to perform the actual work.

Specified by:
doStartTagInternal in class RequestContextAwareTag
Returns:
same as TagSupport.doStartTag
Throws:
JspException
See Also:
TagSupport.doStartTag()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UrlTag

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.tags
Class UrlTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapingAwareTag
                extended by  org.springframework.web.servlet.tags.UrlTag
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag, TryCatchFinally, ParamAware
public class UrlTag
extends HtmlEscapingAwareTag
implements ParamAware

JSP tag for creating URLs. Modeled after the JSTL c:url tag with backwards compatibility in mind.

Enhancements to the JSTL functionality include:

  • URL encoded template URI variables
  • HTML/XML escaping of URLs
  • JavaScript escaping of URLs

Template URI variables are indicated in the 'value' attribute and marked by braces '{variableName}'. The braces and attribute name are replaced by the URL encoded value of a parameter defined with the spring:param tag in the body of the url tag. If no parameter is available the literal value is passed through. Params matched to template variables will not be added to the query string.

Use of the spring:param tag for URI template variables is strongly recommended over direct EL substitution as the values are URL encoded. Failure to properly encode URL can leave an application vulnerable to XSS and other injection attacks.

URLs can be HTML/XML escaped by setting the 'htmlEscape' attribute to 'true'. Detects an HTML escaping setting, either on this tag instance, the page level, or the web.xml level. The default is 'false'. When setting the URL value into a variable, escaping is not recommended.

Example usage:

<spring:url value="/url/path/{variableName}">
   <spring:param name="variableName" value="more than JSTL c:url" />
 </spring:url>
Results in: /currentApplicationContext/url/path/more%20than%20JSTL%20c%3Aurl

Since:
3.0
Author:
Scott Andrews
See Also:
ParamTag, Serialized Form

Field Summary
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
UrlTag()
Method Summary
void | addParam(Param param) Callback hook for nested spring:param tags to pass their value to the parent tag.
protected String | createQueryString(List<Param> params, Set<String> usedParams, boolean includeQueryStringDelimiter) Build the query string from available parameters that have not already been applied as template params.
int | doEndTag()
int | doStartTagInternal() Called by doStartTag to perform the actual work.
protected String | replaceUriTemplateParams(String uri, List<Param> params, Set<String> usedParams) Replace template markers in the URL matching available parameters.
void | setContext(String context) Set the context path for the URL.
void | setJavaScriptEscape(String javaScriptEscape) Set JavaScript escaping for this tag, as boolean value.
void | setScope(String scope) Set the scope to export the URL variable to.
void | setValue(String value) Sets the value of the URL
void | setVar(String var) Set the variable name to expose the URL under.
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isDefaultHtmlEscape, isHtmlEscape, setHtmlEscape
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doFinally, doStartTag, getRequestContext
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

UrlTag

public UrlTag()
Method Detail

setValue

public void setValue(String value)
Sets the value of the URL

setContext

public void setContext(String context)
Set the context path for the URL. Defaults to the current context

setVar

public void setVar(String var)
Set the variable name to expose the URL under. Defaults to rendering the URL to the current JspWriter

setScope

public void setScope(String scope)
Set the scope to export the URL variable to. This attribute has no meaning unless var is also defined.

setJavaScriptEscape

public void setJavaScriptEscape(String javaScriptEscape)
                         throws JspException
Set JavaScript escaping for this tag, as boolean value. Default is "false".

Throws:
JspException

addParam

public void addParam(Param param)
Description copied from interface: ParamAware
Callback hook for nested spring:param tags to pass their value to the parent tag.

Specified by:
addParam in interface ParamAware
Parameters:
param - the result of the nested spring:param tag

doStartTagInternal

public int doStartTagInternal()
                       throws JspException
Description copied from class: RequestContextAwareTag
Called by doStartTag to perform the actual work.

Specified by:
doStartTagInternal in class RequestContextAwareTag
Returns:
same as TagSupport.doStartTag
Throws:
JspException
See Also:
TagSupport.doStartTag()

doEndTag

public int doEndTag()
             throws JspException
Specified by:
doEndTag in interface Tag
Overrides:
doEndTag in class TagSupport
Throws:
JspException

createQueryString

protected String createQueryString(List<Param> params,
                                   Set<String> usedParams,
                                   boolean includeQueryStringDelimiter)
                            throws JspException
Build the query string from available parameters that have not already been applied as template params.

The names and values of parameters are URL encoded.

Parameters:
params - the parameters to build the query string from
usedParams - set of parameter names that have been applied as template params
includeQueryStringDelimiter - true if the query string should start with a '?' instead of '&'
Returns:
the query string
Throws:
JspException

replaceUriTemplateParams

protected String replaceUriTemplateParams(String uri,
                                          List<Param> params,
                                          Set<String> usedParams)
                                   throws JspException
Replace template markers in the URL matching available parameters. The name of matched parameters are added to the used parameters set.

Parameter values are URL encoded.

Parameters:
uri - the URL with template parameters to replace
params - parameters used to replace template markers
usedParams - set of template parameter names that have been replaced
Returns:
the URL with template parameters replaced
Throws:
JspException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.servlet.tags.form

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.servlet.tags.form

Spring's form tag library for JSP 2.0+.

See:
Description

Class Summary
AbstractCheckedElementTag | Abstract base class to provide common methods for implementing databinding-aware JSP tags for rendering an HTML 'input' element with a 'type' of 'checkbox' or 'radio'.
AbstractDataBoundFormElementTag | Base tag for all data-binding aware JSP form tags.
AbstractFormTag | Base class for all JSP form tags.
AbstractHtmlElementBodyTag | Convenient super class for many html tags that render content using the databinding features of the AbstractHtmlElementTag.
AbstractHtmlElementTag | Base class for databinding-aware JSP tags that render HTML element.
AbstractHtmlInputElementTag | Base class for databinding-aware JSP tags that render HTML form input element.
AbstractMultiCheckedElementTag | Abstract base class to provide common methods for implementing databinding-aware JSP tags for rendering multiple HTML 'input' elements with a 'type' of 'checkbox' or 'radio'.
AbstractSingleCheckedElementTag | Abstract base class to provide common methods for implementing databinding-aware JSP tags for rendering a single HTML 'input' element with a 'type' of 'checkbox' or 'radio'.
CheckboxesTag | Databinding-aware JSP tag for rendering multiple HTML 'input' elements with a 'type' of 'checkbox'.
CheckboxTag | Databinding-aware JSP tag for rendering an HTML 'input' element with a 'type' of 'checkbox'.
ErrorsTag | Form tag for displaying errors for a particular field or object.
FormTag | Databinding-aware JSP tag for rendering an HTML 'form' whose inner elements are bound to properties on a form object.
HiddenInputTag | Data-binding aware JSP tag for rendering a hidden HTML 'input' field containing the databound value.
InputTag | Data-binding-aware JSP tag for rendering an HTML 'input' element with a 'type' of 'text'.
LabelTag | Databinding-aware JSP tag for rendering an HTML 'label' element that defines text that is associated with a single form element.
OptionsTag | Convenient tag that allows one to supply a collection of objects that are to be rendered as 'option' tags within a 'select' tag.
OptionTag | JSP tag for rendering an HTML 'option' tag.
PasswordInputTag | Databinding-aware JSP tag for rendering an HTML 'input' element with a 'type' of 'password'.
RadioButtonsTag | Databinding-aware JSP tag for rendering multiple HTML 'input' elements with a 'type' of 'radio'.
RadioButtonTag | Databinding-aware JSP tag for rendering an HTML 'input' element with a 'type' of 'radio'.
SelectTag | Databinding-aware JSP tag that renders an HTML 'select' element.
TagWriter | Utility class for writing HTML content to a Writer instance.
TextareaTag | Databinding-aware JSP tag for rendering an HTML 'textarea'.

Package org.springframework.web.servlet.tags.form Description

Spring's form tag library for JSP 2.0+. Supports JSP view implementations for Spring's web MVC framework. See spring-form.tld for descriptions of the various tags.


org.springframework.web.servlet.tags.form Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.servlet.tags.form

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.servlet.jsp.tagext.TagSupport (implements javax.servlet.jsp.tagext.IterationTag, java.io.Serializable)
      • org.springframework.web.servlet.tags.RequestContextAwareTag (implements javax.servlet.jsp.tagext.TryCatchFinally)
        • org.springframework.web.servlet.tags.HtmlEscapingAwareTag
          • org.springframework.web.servlet.tags.form.AbstractFormTag
            • org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag (implements org.springframework.web.servlet.tags.EditorAwareTag)
              • org.springframework.web.servlet.tags.form.AbstractHtmlElementTag (implements javax.servlet.jsp.tagext.DynamicAttributes)
                • org.springframework.web.servlet.tags.form.AbstractHtmlElementBodyTag (implements javax.servlet.jsp.tagext.BodyTag)
                  • org.springframework.web.servlet.tags.form.ErrorsTag (implements javax.servlet.jsp.tagext.BodyTag)
                  • org.springframework.web.servlet.tags.form.OptionTag (implements javax.servlet.jsp.tagext.BodyTag)
                • org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
                  • org.springframework.web.servlet.tags.form.AbstractCheckedElementTag
                    • org.springframework.web.servlet.tags.form.AbstractMultiCheckedElementTag
                      • org.springframework.web.servlet.tags.form.CheckboxesTag
                      • org.springframework.web.servlet.tags.form.RadioButtonsTag
                    • org.springframework.web.servlet.tags.form.AbstractSingleCheckedElementTag
                      • org.springframework.web.servlet.tags.form.CheckboxTag
                      • org.springframework.web.servlet.tags.form.RadioButtonTag
                  • org.springframework.web.servlet.tags.form.InputTag
                    • org.springframework.web.servlet.tags.form.PasswordInputTag
                  • org.springframework.web.servlet.tags.form.SelectTag
                  • org.springframework.web.servlet.tags.form.TextareaTag
                • org.springframework.web.servlet.tags.form.FormTag
                • org.springframework.web.servlet.tags.form.LabelTag
                • org.springframework.web.servlet.tags.form.OptionsTag
              • org.springframework.web.servlet.tags.form.HiddenInputTag
    • org.springframework.web.servlet.tags.form.TagWriter


AbstractCheckedElementTag

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.tags.form
Class AbstractCheckedElementTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapingAwareTag
                extended by  org.springframework.web.servlet.tags.form.AbstractFormTag
                    extended by  org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
                        extended by  org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
                            extended by  org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
                                extended by  org.springframework.web.servlet.tags.form.AbstractCheckedElementTag
All Implemented Interfaces:
Serializable, DynamicAttributes, IterationTag, JspTag, Tag, TryCatchFinally, EditorAwareTag
Direct Known Subclasses:
AbstractMultiCheckedElementTag, AbstractSingleCheckedElementTag
public abstract class AbstractCheckedElementTag
extends AbstractHtmlInputElementTag

Abstract base class to provide common methods for implementing databinding-aware JSP tags for rendering an HTML 'input' element with a 'type' of 'checkbox' or 'radio'.

Since:
2.5
Author:
Thomas Risberg, Juergen Hoeller
See Also:
Serialized Form

Field Summary
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
ACCESSKEY_ATTRIBUTE, DISABLED_ATTRIBUTE, ONBLUR_ATTRIBUTE, ONCHANGE_ATTRIBUTE, ONFOCUS_ATTRIBUTE, READONLY_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
CLASS_ATTRIBUTE, DIR_ATTRIBUTE, LANG_ATTRIBUTE, ONCLICK_ATTRIBUTE, ONDBLCLICK_ATTRIBUTE, ONKEYDOWN_ATTRIBUTE, ONKEYPRESS_ATTRIBUTE, ONKEYUP_ATTRIBUTE, ONMOUSEDOWN_ATTRIBUTE, ONMOUSEMOVE_ATTRIBUTE, ONMOUSEOUT_ATTRIBUTE, ONMOUSEOVER_ATTRIBUTE, ONMOUSEUP_ATTRIBUTE, STYLE_ATTRIBUTE, TABINDEX_ATTRIBUTE, TITLE_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
COMMAND_NAME_VARIABLE_NAME, NESTED_PATH_VARIABLE_NAME
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
AbstractCheckedElementTag()
Method Summary
protected String | autogenerateId() Return a unique ID for the bound name within the current PageContext.
protected void | renderFromBoolean(Boolean boundValue, TagWriter tagWriter) Render the 'input(checkbox)' with the supplied value, marking the 'input' element as 'checked' if the supplied Boolean is true.
protected void | renderFromValue(Object item, Object value, TagWriter tagWriter) Render the 'input(checkbox)' with the supplied value, marking the 'input' element as 'checked' if the supplied value matches the bound value.
protected void | renderFromValue(Object value, TagWriter tagWriter) Render the 'input(checkbox)' with the supplied value, marking the 'input' element as 'checked' if the supplied value matches the bound value.
protected abstract int | writeTagContent(TagWriter tagWriter) Writes the 'input' element to the supplied TagWriter, marking it as 'checked' if appropriate.
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
getAccesskey, getDisabled, getOnblur, getOnchange, getOnfocus, getReadonly, isDisabled, isReadonly, setAccesskey, setDisabled, setOnblur, setOnchange, setOnfocus, setReadonly, writeOptionalAttributes
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
getCssClass, getCssErrorClass, getCssStyle, getDir, getDynamicAttributes, getLang, getOnclick, getOndblclick, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getTabindex, getTitle, resolveCssClass, setCssClass, setCssErrorClass, setCssStyle, setDir, setDynamicAttribute, setLang, setOnclick, setOndblclick, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setTabindex, setTitle, writeDefaultAttributes
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
doFinally, getBindStatus, getBoundValue, getEditor, getId, getName, getNestedPath, getPath, getPropertyEditor, getPropertyPath, resolveId, setId, setPath
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractFormTag
createTagWriter, doStartTagInternal, evaluate, evaluateBoolean, getDisplayString, getDisplayString, isDefaultHtmlEscape, writeOptionalAttribute
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isHtmlEscape, setHtmlEscape
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doStartTag, getRequestContext
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractCheckedElementTag

public AbstractCheckedElementTag()
Method Detail

renderFromValue

protected void renderFromValue(Object value,
                               TagWriter tagWriter)
                        throws JspException
Render the 'input(checkbox)' with the supplied value, marking the 'input' element as 'checked' if the supplied value matches the bound value.

Throws:
JspException

renderFromValue

protected void renderFromValue(Object item,
                               Object value,
                               TagWriter tagWriter)
                        throws JspException
Render the 'input(checkbox)' with the supplied value, marking the 'input' element as 'checked' if the supplied value matches the bound value.

Throws:
JspException

renderFromBoolean

protected void renderFromBoolean(Boolean boundValue,
                                 TagWriter tagWriter)
                          throws JspException
Render the 'input(checkbox)' with the supplied value, marking the 'input' element as 'checked' if the supplied Boolean is true.

Throws:
JspException

autogenerateId

protected String autogenerateId()
                         throws JspException
Return a unique ID for the bound name within the current PageContext.

Overrides:
autogenerateId in class AbstractDataBoundFormElementTag
Throws:
JspException

writeTagContent

protected abstract int writeTagContent(TagWriter tagWriter)
                                throws JspException
Writes the 'input' element to the supplied TagWriter, marking it as 'checked' if appropriate.

Specified by:
writeTagContent in class AbstractFormTag
Returns:
valid tag render instruction as per Tag.doStartTag().
Throws:
JspException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractDataBoundFormElementTag

org.springframework.web.servlet.tags.form
Class AbstractDataBoundFormElementTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapingAwareTag
                extended by  org.springframework.web.servlet.tags.form.AbstractFormTag
                    extended by  org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag, TryCatchFinally, EditorAwareTag
Direct Known Subclasses:
AbstractHtmlElementTag, HiddenInputTag
public abstract class AbstractDataBoundFormElementTag
extends AbstractFormTag
implements EditorAwareTag

Base tag for all data-binding aware JSP form tags.

Provides the common path and id properties. Provides sub-classes with utility methods for accessing the BindStatus of their bound value and also for interacting with the TagWriter.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
See Also:
Serialized Form

Field Summary
static String | COMMAND_NAME_VARIABLE_NAME Deprecated. as of Spring 2.5, in favor of FormTag.MODEL_ATTRIBUTE_VARIABLE_NAME
protected static String | NESTED_PATH_VARIABLE_NAME Name of the exposed path variable within the scope of this tag: "nestedPath".
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
AbstractDataBoundFormElementTag()
Method Summary
protected String | autogenerateId() Autogenerate the 'id' attribute value for this tag.
void | doFinally() Disposes of the BindStatus instance.
protected BindStatus | getBindStatus() Get the BindStatus for this tag.
protected Object | getBoundValue() Get the bound value.
PropertyEditor | getEditor() Exposes the PropertyEditor for EditorAwareTag.
String | getId() Get the value of the 'id' attribute.
protected String | getName() Get the value for the HTML 'name' attribute.
protected String | getNestedPath() Get the value of the nested path that may have been exposed by the NestedPathTag.
protected String | getPath() Get the resolved property path for the form object.
protected PropertyEditor | getPropertyEditor() Get the PropertyEditor, if any, in use for value bound to this tag.
protected String | getPropertyPath() Build the property path for this tag, including the nested path but not prefixed with the name of the form attribute.
protected String | resolveId() Determine the 'id' attribute value for this tag, autogenerating one if none specified.
void | setId(String id) Set the value of the 'id' attribute.
void | setPath(String path) Set the property path from the form object.
protected void | writeDefaultAttributes(TagWriter tagWriter) Writes the default set of attributes to the supplied TagWriter.
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractFormTag
createTagWriter, doStartTagInternal, evaluate, evaluateBoolean, getDisplayString, getDisplayString, isDefaultHtmlEscape, writeOptionalAttribute, writeTagContent
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isHtmlEscape, setHtmlEscape
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doStartTag, getRequestContext
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

NESTED_PATH_VARIABLE_NAME

protected static final String NESTED_PATH_VARIABLE_NAME
Name of the exposed path variable within the scope of this tag: "nestedPath". Same value as NestedPathTag.NESTED_PATH_VARIABLE_NAME.

See Also:
Constant Field Values

COMMAND_NAME_VARIABLE_NAME

@Deprecated
public static final String COMMAND_NAME_VARIABLE_NAME
Deprecated. as of Spring 2.5, in favor of FormTag.MODEL_ATTRIBUTE_VARIABLE_NAME
The name of the PageContext attribute under which the command object name is exposed.

Constructor Detail

AbstractDataBoundFormElementTag

public AbstractDataBoundFormElementTag()
Method Detail

setPath

public void setPath(String path)
Set the property path from the form object. May be a runtime expression.

getPath

protected final String getPath()
                        throws JspException
Get the resolved property path for the form object.

Throws:
JspException

setId

public void setId(String id)
Set the value of the 'id' attribute.

May be a runtime expression; defaults to the value of getName(). Note that the default value may not be valid for certain tags.

Overrides:
setId in class TagSupport

getId

public String getId()
Get the value of the 'id' attribute.

Overrides:
getId in class TagSupport

writeDefaultAttributes

protected void writeDefaultAttributes(TagWriter tagWriter)
                               throws JspException
Writes the default set of attributes to the supplied TagWriter. Further abstract sub-classes should override this method to add in any additional default attributes but must remember to call the super method.

Concrete sub-classes should call this method when/if they want to render default attributes.

Parameters:
tagWriter - the TagWriter to which any attributes are to be written
Throws:
JspException

resolveId

protected String resolveId()
                    throws JspException
Determine the 'id' attribute value for this tag, autogenerating one if none specified.

Throws:
JspException
See Also:
getId(), autogenerateId()

autogenerateId

protected String autogenerateId()
                         throws JspException
Autogenerate the 'id' attribute value for this tag.

The default implementation simply delegates to getName(), deleting invalid characters (such as "[" or "]").

Throws:
JspException

getName

protected String getName()
                  throws JspException
Get the value for the HTML 'name' attribute.

The default implementation simply delegates to getPropertyPath() to use the property path as the name. For the most part this is desirable as it links with the server-side expectation for data binding. However, some subclasses may wish to change the value of the 'name' attribute without changing the bind path.

Returns:
the value for the HTML 'name' attribute
Throws:
JspException

getBindStatus

protected BindStatus getBindStatus()
                            throws JspException
Get the BindStatus for this tag.

Throws:
JspException

getNestedPath

protected String getNestedPath()
Get the value of the nested path that may have been exposed by the NestedPathTag.

getPropertyPath

protected String getPropertyPath()
                          throws JspException
Build the property path for this tag, including the nested path but not prefixed with the name of the form attribute.

Throws:
JspException
See Also:
getNestedPath(), getPath()

getBoundValue

protected final Object getBoundValue()
                              throws JspException
Get the bound value.

Throws:
JspException
See Also:
getBindStatus()

getPropertyEditor

protected PropertyEditor getPropertyEditor()
                                    throws JspException
Get the PropertyEditor, if any, in use for value bound to this tag.

Throws:
JspException

getEditor

public final PropertyEditor getEditor()
                               throws JspException
Exposes the PropertyEditor for EditorAwareTag.

Use getPropertyEditor() for internal rendering purposes.

Specified by:
getEditor in interface EditorAwareTag
Returns:
the current PropertyEditor, or null if none
Throws:
JspException - if resolving the editor failed

doFinally

public void doFinally()
Disposes of the BindStatus instance.

Specified by:
doFinally in interface TryCatchFinally
Overrides:
doFinally in class RequestContextAwareTag
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractFormTag

org.springframework.web.servlet.tags.form
Class AbstractFormTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapingAwareTag
                extended by  org.springframework.web.servlet.tags.form.AbstractFormTag
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag, TryCatchFinally
Direct Known Subclasses:
AbstractDataBoundFormElementTag
public abstract class AbstractFormTag
extends HtmlEscapingAwareTag

Base class for all JSP form tags. Provides utility methods for null-safe EL evaluation and for accessing and working with a TagWriter.

Subclasses should implement the writeTagContent(TagWriter) to perform actual tag rendering.

Subclasses (or test classes) can override the createTagWriter() method to redirect output to a Writer other than the JspWriter associated with the current PageContext.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
See Also:
Serialized Form

Field Summary
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
AbstractFormTag()
Method Summary
protected  TagWriter createTagWriter()
Create the TagWriter which all output will be written to.
protected  int doStartTagInternal()
Provide a simple template method that calls createTagWriter() and passes the created TagWriter to the writeTagContent(TagWriter) method.
protected  Object evaluate(String attributeName, Object value)
Evaluate the supplied value for the supplied attribute name.
protected  boolean evaluateBoolean(String attributeName, String value)
Evaluate the supplied value for the supplied attribute name.
protected  String getDisplayString(Object value)
Get the display value of the supplied Object, HTML escaped as required.
protected  String getDisplayString(Object value, PropertyEditor propertyEditor)
Get the display value of the supplied Object, HTML escaped as required.
protected  boolean isDefaultHtmlEscape()
Overridden to default to true in case of no explicit default given.
protected  void writeOptionalAttribute(TagWriter tagWriter, String attributeName, String value)
Optionally writes the supplied value under the supplied attribute name into the supplied TagWriter.
protected abstract  int writeTagContent(TagWriter tagWriter)
Subclasses should implement this method to perform tag content rendering.
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isHtmlEscape, setHtmlEscape
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doFinally, doStartTag, getRequestContext
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractFormTag

public AbstractFormTag()
Method Detail

evaluate

protected Object evaluate(String attributeName,
                          Object value)
                   throws JspException
Evaluate the supplied value for the supplied attribute name. If the supplied value is null then null is returned, otherwise evaluation is handled using ExpressionEvaluationUtils.evaluate(String, String, javax.servlet.jsp.PageContext).

Throws:
JspException

evaluateBoolean

protected boolean evaluateBoolean(String attributeName,
                                  String value)
                           throws JspException
Evaluate the supplied value for the supplied attribute name. If the supplied value is null then false is returned, otherwise evaluation is handled using ExpressionEvaluationUtils.evaluate(String, String, javax.servlet.jsp.PageContext), with subsequent matching against Boolean.TRUE and Boolean.valueOf.

Throws:
JspException

writeOptionalAttribute

protected final void writeOptionalAttribute(TagWriter tagWriter,
                                            String attributeName,
                                            String value)
                                     throws JspException
Optionally writes the supplied value under the supplied attribute name into the supplied TagWriter. In this case, the supplied value is evaluated first and then the String representation is written as the attribute value. If the resultant String representation is null or empty, no attribute is written.

Throws:
JspException
See Also:
TagWriter.writeOptionalAttributeValue(String, String)

createTagWriter

protected TagWriter createTagWriter()
Create the TagWriter which all output will be written to. By default, the TagWriter writes its output to the JspWriter for the current PageContext. Subclasses may choose to change the Writer to which output is actually written.

doStartTagInternal

protected final int doStartTagInternal()
                                throws Exception
Provide a simple template method that calls createTagWriter() and passes the created TagWriter to the writeTagContent(TagWriter) method.

Specified by:
doStartTagInternal in class RequestContextAwareTag
Returns:
the value returned by writeTagContent(TagWriter)
Throws:
Exception - any exception, any checked one other than a JspException gets wrapped in a JspException by doStartTag
See Also:
TagSupport.doStartTag()

getDisplayString

protected String getDisplayString(Object value)
Get the display value of the supplied Object, HTML escaped as required. This version is not PropertyEditor-aware.

getDisplayString

protected String getDisplayString(Object value,
                                  PropertyEditor propertyEditor)
Get the display value of the supplied Object, HTML escaped as required. If the supplied value is not a String and the supplied PropertyEditor is not null then the PropertyEditor is used to obtain the display value.

isDefaultHtmlEscape

protected boolean isDefaultHtmlEscape()
Overridden to default to true in case of no explicit default given.

Overrides:
isDefaultHtmlEscape in class HtmlEscapingAwareTag
See Also:
RequestContextAwareTag.getRequestContext()

writeTagContent

protected abstract int writeTagContent(TagWriter tagWriter)
                                throws JspException
Subclasses should implement this method to perform tag content rendering.

Returns:
valid tag render instruction as per Tag.doStartTag().
Throws:
JspException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractHtmlElementBodyTag

org.springframework.web.servlet.tags.form
Class AbstractHtmlElementBodyTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapingAwareTag
                extended by  org.springframework.web.servlet.tags.form.AbstractFormTag
                    extended by  org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
                        extended by  org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
                            extended by  org.springframework.web.servlet.tags.form.AbstractHtmlElementBodyTag
All Implemented Interfaces:
Serializable, BodyTag, DynamicAttributes, IterationTag, JspTag, Tag, TryCatchFinally, EditorAwareTag
Direct Known Subclasses:
ErrorsTag, OptionTag
public abstract class AbstractHtmlElementBodyTag
extends AbstractHtmlElementTag
implements BodyTag

Convenient super class for many html tags that render content using the databinding features of the AbstractHtmlElementTag. The only thing sub tags need to do is override renderDefaultContent(TagWriter).

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
See Also:
Serialized Form

Field Summary
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
CLASS_ATTRIBUTE, DIR_ATTRIBUTE, LANG_ATTRIBUTE, ONCLICK_ATTRIBUTE, ONDBLCLICK_ATTRIBUTE, ONKEYDOWN_ATTRIBUTE, ONKEYPRESS_ATTRIBUTE, ONKEYUP_ATTRIBUTE, ONMOUSEDOWN_ATTRIBUTE, ONMOUSEMOVE_ATTRIBUTE, ONMOUSEOUT_ATTRIBUTE, ONMOUSEOVER_ATTRIBUTE, ONMOUSEUP_ATTRIBUTE, STYLE_ATTRIBUTE, TABINDEX_ATTRIBUTE, TITLE_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
COMMAND_NAME_VARIABLE_NAME, NESTED_PATH_VARIABLE_NAME
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
AbstractHtmlElementBodyTag()
Method Summary
 int doEndTag()
If rendering, flush any buffered BodyContent or, if no BodyContent is supplied, render the default content.
 void doFinally()
Clean up any attributes and stored resources.
 void doInitBody()
protected  void exposeAttributes()
Called during writeTagContent(org.springframework.web.servlet.tags.form.TagWriter) allowing subclasses to add any attributes to the PageContext as needed.
protected  void flushBufferedBodyContent(BodyContent bodyContent)
The user customised the output of the error messages - flush the buffered content into the main JspWriter.
protected  void onWriteTagContent()
Called at the start of writeTagContent(org.springframework.web.servlet.tags.form.TagWriter) allowing subclasses to perform any precondition checks or setup tasks that might be necessary.
protected  void removeAttributes()
Called by doFinally() allowing subclasses to remove any attributes from the PageContext as needed.
protected abstract  void renderDefaultContent(TagWriter tagWriter)
protected  void renderFromBodyContent(BodyContent bodyContent, TagWriter tagWriter)
Render the tag contents based on the supplied BodyContent.
 void setBodyContent(BodyContent bodyContent)
protected  boolean shouldRender()
Should rendering of this tag proceed at all.
protected  int writeTagContent(TagWriter tagWriter)
Subclasses should implement this method to perform tag content rendering.
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
getCssClass, getCssErrorClass, getCssStyle, getDir, getDynamicAttributes, getLang, getOnclick, getOndblclick, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getTabindex, getTitle, resolveCssClass, setCssClass, setCssErrorClass, setCssStyle, setDir, setDynamicAttribute, setLang, setOnclick, setOndblclick, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setTabindex, setTitle, writeDefaultAttributes, writeOptionalAttributes
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
autogenerateId, getBindStatus, getBoundValue, getEditor, getId, getName, getNestedPath, getPath, getPropertyEditor, getPropertyPath, resolveId, setId, setPath
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractFormTag
createTagWriter, doStartTagInternal, evaluate, evaluateBoolean, getDisplayString, getDisplayString, isDefaultHtmlEscape, writeOptionalAttribute
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isHtmlEscape, setHtmlEscape
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doStartTag, getRequestContext
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.servlet.jsp.tagext.IterationTag
doAfterBody
Methods inherited from interface javax.servlet.jsp.tagext.Tag
doStartTag, getParent, release, setPageContext, setParent

Constructor Detail

AbstractHtmlElementBodyTag

public AbstractHtmlElementBodyTag()
Method Detail

writeTagContent

protected int writeTagContent(TagWriter tagWriter)
                       throws JspException
Description copied from class: AbstractFormTag
Subclasses should implement this method to perform tag content rendering.

Specified by:
writeTagContent in class AbstractFormTag
Returns:
valid tag render instruction as per Tag.doStartTag().
Throws:
JspException

doEndTag

public int doEndTag()
             throws JspException
If rendering, flush any buffered BodyContent or, if no BodyContent is supplied, render the default content.

Specified by:
doEndTag in interface Tag
Overrides:
doEndTag in class TagSupport
Returns:
Tag#EVAL_PAGE
Throws:
JspException

renderFromBodyContent

protected void renderFromBodyContent(BodyContent bodyContent,
                                     TagWriter tagWriter)
                              throws JspException
Render the tag contents based on the supplied BodyContent.

The default implementation simply flushes the BodyContent directly to the output. Subclasses may choose to override this to add additional content to the output.

Throws:
JspException

doFinally

public void doFinally()
Clean up any attributes and stored resources.

Specified by:
doFinally in interface TryCatchFinally
Overrides:
doFinally in class AbstractDataBoundFormElementTag

onWriteTagContent

protected void onWriteTagContent()
Called at the start of writeTagContent(org.springframework.web.servlet.tags.form.TagWriter) allowing subclasses to perform any precondition checks or setup tasks that might be necessary.

shouldRender

protected boolean shouldRender()
                        throws JspException
Should rendering of this tag proceed at all. Returns 'true' by default causing rendering to occur always, Subclasses can override this if they provide conditional rendering.

Throws:
JspException

exposeAttributes

protected void exposeAttributes()
                         throws JspException
Called during writeTagContent(org.springframework.web.servlet.tags.form.TagWriter) allowing subclasses to add any attributes to the PageContext as needed.

Throws:
JspException

removeAttributes

protected void removeAttributes()
Called by doFinally() allowing subclasses to remove any attributes from the PageContext as needed.

flushBufferedBodyContent

protected void flushBufferedBodyContent(BodyContent bodyContent)
                                 throws JspException
The user customised the output of the error messages - flush the buffered content into the main JspWriter.

Throws:
JspException

renderDefaultContent

protected abstract void renderDefaultContent(TagWriter tagWriter)
                                      throws JspException
Throws:
JspException

doInitBody

public void doInitBody()
                throws JspException
Specified by:
doInitBody in interface BodyTag
Throws:
JspException

setBodyContent

public void setBodyContent(BodyContent bodyContent)
Specified by:
setBodyContent in interface BodyTag
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractHtmlElementTag

org.springframework.web.servlet.tags.form
Class AbstractHtmlElementTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapingAwareTag
                extended by  org.springframework.web.servlet.tags.form.AbstractFormTag
                    extended by  org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
                        extended by  org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
All Implemented Interfaces:
Serializable, DynamicAttributes, IterationTag, JspTag, Tag, TryCatchFinally, EditorAwareTag
Direct Known Subclasses:
AbstractHtmlElementBodyTag, AbstractHtmlInputElementTag, FormTag, LabelTag, OptionsTag
public abstract class AbstractHtmlElementTag
extends AbstractDataBoundFormElementTag
implements DynamicAttributes

Base class for databinding-aware JSP tags that render HTML element. Provides a set of properties corresponding to the set of HTML attributes that are common across elements.

Additionally, this base class allows for rendering non-standard attributes as part of the tag's output. These attributes are accessible to subclasses if needed via the dynamicAttributes map.

Since:
2.0
Author:
Rob Harrop, Jeremy Grelle
See Also:
Serialized Form

Field Summary
static String | CLASS_ATTRIBUTE
static String | DIR_ATTRIBUTE
static String | LANG_ATTRIBUTE
static String | ONCLICK_ATTRIBUTE
static String | ONDBLCLICK_ATTRIBUTE
static String | ONKEYDOWN_ATTRIBUTE
static String | ONKEYPRESS_ATTRIBUTE
static String | ONKEYUP_ATTRIBUTE
static String | ONMOUSEDOWN_ATTRIBUTE
static String | ONMOUSEMOVE_ATTRIBUTE
static String | ONMOUSEOUT_ATTRIBUTE
static String | ONMOUSEOVER_ATTRIBUTE
static String | ONMOUSEUP_ATTRIBUTE
static String | STYLE_ATTRIBUTE
static String | TABINDEX_ATTRIBUTE
static String | TITLE_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
COMMAND_NAME_VARIABLE_NAME, NESTED_PATH_VARIABLE_NAME
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
AbstractHtmlElementTag()
Method Summary
protected String | getCssClass() Get the value of the 'class' attribute.
protected String | getCssErrorClass() The CSS class to use when the field bound to a particular tag has errors.
protected String | getCssStyle() Get the value of the 'style' attribute.
protected String | getDir() Get the value of the 'dir' attribute.
protected Map<String,Object> | getDynamicAttributes() Get the map of dynamic attributes.
protected String | getLang() Get the value of the 'lang' attribute.
protected String | getOnclick() Get the value of the 'onclick' attribute.
protected String | getOndblclick() Get the value of the 'ondblclick' attribute.
protected String | getOnkeydown() Get the value of the 'onkeydown' attribute.
protected String | getOnkeypress() Get the value of the 'onkeypress' attribute.
protected String | getOnkeyup() Get the value of the 'onkeyup' attribute.
protected String | getOnmousedown() Get the value of the 'onmousedown' attribute.
protected String | getOnmousemove() Get the value of the 'onmousemove' attribute.
protected String | getOnmouseout() Get the value of the 'onmouseout' attribute.
protected String | getOnmouseover() Get the value of the 'onmouseover' attribute.
protected String | getOnmouseup() Get the value of the 'onmouseup' attribute.
protected String | getTabindex() Get the value of the 'tabindex' attribute.
protected String | getTitle() Get the value of the 'title' attribute.
protected String | resolveCssClass() Gets the appropriate CSS class to use based on the state of the current BindStatus object.
void | setCssClass(String cssClass) Set the value of the 'class' attribute.
void | setCssErrorClass(String cssErrorClass) The CSS class to use when the field bound to a particular tag has errors.
void | setCssStyle(String cssStyle) Set the value of the 'style' attribute.
void | setDir(String dir) Set the value of the 'dir' attribute.
void | setDynamicAttribute(String uri, String localName, Object value)
void | setLang(String lang) Set the value of the 'lang' attribute.
void | setOnclick(String onclick) Set the value of the 'onclick' attribute.
void | setOndblclick(String ondblclick) Set the value of the 'ondblclick' attribute.
void | setOnkeydown(String onkeydown) Set the value of the 'onkeydown' attribute.
void | setOnkeypress(String onkeypress) Set the value of the 'onkeypress' attribute.
void | setOnkeyup(String onkeyup) Set the value of the 'onkeyup' attribute.
void | setOnmousedown(String onmousedown) Set the value of the 'onmousedown' attribute.
void | setOnmousemove(String onmousemove) Set the value of the 'onmousemove' attribute.
void | setOnmouseout(String onmouseout) Set the value of the 'onmouseout' attribute.
void | setOnmouseover(String onmouseover) Set the value of the 'onmouseover' attribute.
void | setOnmouseup(String onmouseup) Set the value of the 'onmouseup' attribute.
void | setTabindex(String tabindex) Set the value of the 'tabindex' attribute.
void | setTitle(String title) Set the value of the 'title' attribute.
protected void | writeDefaultAttributes(TagWriter tagWriter) Writes the default attributes configured via this base class to the supplied TagWriter.
protected void | writeOptionalAttributes(TagWriter tagWriter) Writes the optional attributes configured via this base class to the supplied TagWriter.
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
autogenerateId, doFinally, getBindStatus, getBoundValue, getEditor, getId, getName, getNestedPath, getPath, getPropertyEditor, getPropertyPath, resolveId, setId, setPath
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractFormTag
createTagWriter, doStartTagInternal, evaluate, evaluateBoolean, getDisplayString, getDisplayString, isDefaultHtmlEscape, writeOptionalAttribute, writeTagContent
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isHtmlEscape, setHtmlEscape
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doStartTag, getRequestContext
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

CLASS_ATTRIBUTE

public static final String CLASS_ATTRIBUTE
See Also:
Constant Field Values

STYLE_ATTRIBUTE

public static final String STYLE_ATTRIBUTE
See Also:
Constant Field Values

LANG_ATTRIBUTE

public static final String LANG_ATTRIBUTE
See Also:
Constant Field Values

TITLE_ATTRIBUTE

public static final String TITLE_ATTRIBUTE
See Also:
Constant Field Values

DIR_ATTRIBUTE

public static final String DIR_ATTRIBUTE
See Also:
Constant Field Values

TABINDEX_ATTRIBUTE

public static final String TABINDEX_ATTRIBUTE
See Also:
Constant Field Values

ONCLICK_ATTRIBUTE

public static final String ONCLICK_ATTRIBUTE
See Also:
Constant Field Values

ONDBLCLICK_ATTRIBUTE

public static final String ONDBLCLICK_ATTRIBUTE
See Also:
Constant Field Values

ONMOUSEDOWN_ATTRIBUTE

public static final String ONMOUSEDOWN_ATTRIBUTE
See Also:
Constant Field Values

ONMOUSEUP_ATTRIBUTE

public static final String ONMOUSEUP_ATTRIBUTE
See Also:
Constant Field Values

ONMOUSEOVER_ATTRIBUTE

public static final String ONMOUSEOVER_ATTRIBUTE
See Also:
Constant Field Values

ONMOUSEMOVE_ATTRIBUTE

public static final String ONMOUSEMOVE_ATTRIBUTE
See Also:
Constant Field Values

ONMOUSEOUT_ATTRIBUTE

public static final String ONMOUSEOUT_ATTRIBUTE
See Also:
Constant Field Values

ONKEYPRESS_ATTRIBUTE

public static final String ONKEYPRESS_ATTRIBUTE
See Also:
Constant Field Values

ONKEYUP_ATTRIBUTE

public static final String ONKEYUP_ATTRIBUTE
See Also:
Constant Field Values

ONKEYDOWN_ATTRIBUTE

public static final String ONKEYDOWN_ATTRIBUTE
See Also:
Constant Field Values
Constructor Detail

AbstractHtmlElementTag

public AbstractHtmlElementTag()
Method Detail

setCssClass

public void setCssClass(String cssClass)
Set the value of the 'class' attribute. May be a runtime expression.

getCssClass

protected String getCssClass()
Get the value of the 'class' attribute. May be a runtime expression.

setCssErrorClass

public void setCssErrorClass(String cssErrorClass)
The CSS class to use when the field bound to a particular tag has errors. May be a runtime expression.

getCssErrorClass

protected String getCssErrorClass()
The CSS class to use when the field bound to a particular tag has errors. May be a runtime expression.

setCssStyle

public void setCssStyle(String cssStyle)
Set the value of the 'style' attribute. May be a runtime expression.

getCssStyle

protected String getCssStyle()
Get the value of the 'style' attribute. May be a runtime expression.

setLang

public void setLang(String lang)
Set the value of the 'lang' attribute. May be a runtime expression.

getLang

protected String getLang()
Get the value of the 'lang' attribute. May be a runtime expression.

setTitle

public void setTitle(String title)
Set the value of the 'title' attribute. May be a runtime expression.

getTitle

protected String getTitle()
Get the value of the 'title' attribute. May be a runtime expression.

setDir

public void setDir(String dir)
Set the value of the 'dir' attribute. May be a runtime expression.

getDir

protected String getDir()
Get the value of the 'dir' attribute. May be a runtime expression.

setTabindex

public void setTabindex(String tabindex)
Set the value of the 'tabindex' attribute. May be a runtime expression.

getTabindex

protected String getTabindex()
Get the value of the 'tabindex' attribute. May be a runtime expression.

setOnclick

public void setOnclick(String onclick)
Set the value of the 'onclick' attribute. May be a runtime expression.

getOnclick

protected String getOnclick()
Get the value of the 'onclick' attribute. May be a runtime expression.

setOndblclick

public void setOndblclick(String ondblclick)
Set the value of the 'ondblclick' attribute. May be a runtime expression.

getOndblclick

protected String getOndblclick()
Get the value of the 'ondblclick' attribute. May be a runtime expression.

setOnmousedown

public void setOnmousedown(String onmousedown)
Set the value of the 'onmousedown' attribute. May be a runtime expression.

getOnmousedown

protected String getOnmousedown()
Get the value of the 'onmousedown' attribute. May be a runtime expression.

setOnmouseup

public void setOnmouseup(String onmouseup)
Set the value of the 'onmouseup' attribute. May be a runtime expression.

getOnmouseup

protected String getOnmouseup()
Get the value of the 'onmouseup' attribute. May be a runtime expression.

setOnmouseover

public void setOnmouseover(String onmouseover)
Set the value of the 'onmouseover' attribute. May be a runtime expression.

getOnmouseover

protected String getOnmouseover()
Get the value of the 'onmouseover' attribute. May be a runtime expression.

setOnmousemove

public void setOnmousemove(String onmousemove)
Set the value of the 'onmousemove' attribute. May be a runtime expression.

getOnmousemove

protected String getOnmousemove()
Get the value of the 'onmousemove' attribute. May be a runtime expression.

setOnmouseout

public void setOnmouseout(String onmouseout)
Set the value of the 'onmouseout' attribute. May be a runtime expression.

getOnmouseout

protected String getOnmouseout()
Get the value of the 'onmouseout' attribute. May be a runtime expression.

setOnkeypress

public void setOnkeypress(String onkeypress)
Set the value of the 'onkeypress' attribute. May be a runtime expression.

getOnkeypress

protected String getOnkeypress()
Get the value of the 'onkeypress' attribute. May be a runtime expression.

setOnkeyup

public void setOnkeyup(String onkeyup)
Set the value of the 'onkeyup' attribute. May be a runtime expression.

getOnkeyup

protected String getOnkeyup()
Get the value of the 'onkeyup' attribute. May be a runtime expression.

setOnkeydown

public void setOnkeydown(String onkeydown)
Set the value of the 'onkeydown' attribute. May be a runtime expression.

getOnkeydown

protected String getOnkeydown()
Get the value of the 'onkeydown' attribute. May be a runtime expression.

getDynamicAttributes

protected Map<String,Object> getDynamicAttributes()
Get the map of dynamic attributes.

setDynamicAttribute

public void setDynamicAttribute(String uri,
                                String localName,
                                Object value)
                         throws JspException

Specified by:
setDynamicAttribute in interface DynamicAttributes
Throws:
JspException

writeDefaultAttributes

protected void writeDefaultAttributes(TagWriter tagWriter)
                               throws JspException
Writes the default attributes configured via this base class to the supplied TagWriter. Subclasses should call this when they want the base attribute set to be written to the output.

Overrides:
writeDefaultAttributes in class AbstractDataBoundFormElementTag
Parameters:
tagWriter - the TagWriter to which any attributes are to be written
Throws:
JspException

writeOptionalAttributes

protected void writeOptionalAttributes(TagWriter tagWriter)
                                throws JspException
Writes the optional attributes configured via this base class to the supplied TagWriter. The set of optional attributes that will be rendered includes any non-standard dynamic attributes. Called by writeDefaultAttributes(TagWriter).

Throws:
JspException

resolveCssClass

protected String resolveCssClass()
                          throws JspException
Gets the appropriate CSS class to use based on the state of the current BindStatus object.

Throws:
JspException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractHtmlInputElementTag

org.springframework.web.servlet.tags.form
Class AbstractHtmlInputElementTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapingAwareTag
                extended by  org.springframework.web.servlet.tags.form.AbstractFormTag
                    extended by  org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
                        extended by  org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
                            extended by  org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
All Implemented Interfaces:
Serializable, DynamicAttributes, IterationTag, JspTag, Tag, TryCatchFinally, EditorAwareTag
Direct Known Subclasses:
AbstractCheckedElementTag, InputTag, SelectTag, TextareaTag
public abstract class AbstractHtmlInputElementTag
extends AbstractHtmlElementTag

Base class for databinding-aware JSP tags that render HTML form input element.

Provides a set of properties corresponding to the set of HTML attributes that are common across form input elements.

Since:
2.0
Author:
Rob Harrop, Rick Evans, Juergen Hoeller
See Also:
Serialized Form

Field Summary
static String | ACCESSKEY_ATTRIBUTE The name of the 'accesskey' attribute.
static String | DISABLED_ATTRIBUTE The name of the 'disabled' attribute.
static String | ONBLUR_ATTRIBUTE The name of the 'onblur' attribute.
static String | ONCHANGE_ATTRIBUTE The name of the 'onchange' attribute.
static String | ONFOCUS_ATTRIBUTE The name of the 'onfocus' attribute.
static String | READONLY_ATTRIBUTE The name of the 'readonly' attribute.
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
CLASS_ATTRIBUTE, DIR_ATTRIBUTE, LANG_ATTRIBUTE, ONCLICK_ATTRIBUTE, ONDBLCLICK_ATTRIBUTE, ONKEYDOWN_ATTRIBUTE, ONKEYPRESS_ATTRIBUTE, ONKEYUP_ATTRIBUTE, ONMOUSEDOWN_ATTRIBUTE, ONMOUSEMOVE_ATTRIBUTE, ONMOUSEOUT_ATTRIBUTE, ONMOUSEOVER_ATTRIBUTE, ONMOUSEUP_ATTRIBUTE, STYLE_ATTRIBUTE, TABINDEX_ATTRIBUTE, TITLE_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
COMMAND_NAME_VARIABLE_NAME, NESTED_PATH_VARIABLE_NAME
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
AbstractHtmlInputElementTag()
Method Summary
protected String | getAccesskey() Get the value of the 'accesskey' attribute.
protected String | getDisabled() Get the value of the 'disabled' attribute.
protected String | getOnblur() Get the value of the 'onblur' attribute.
protected String | getOnchange() Get the value of the 'onchange' attribute.
protected String | getOnfocus() Get the value of the 'onfocus' attribute.
protected String | getReadonly() Gets the value of the 'readonly' attribute.
protected boolean | isDisabled() Is the current HTML tag disabled?
protected boolean | isReadonly() Is the current HTML tag readonly?
void | setAccesskey(String accesskey) Set the value of the 'accesskey' attribute.
void | setDisabled(String disabled) Set the value of the 'disabled' attribute.
void | setOnblur(String onblur) Set the value of the 'onblur' attribute.
void | setOnchange(String onchange) Set the value of the 'onchange' attribute.
void | setOnfocus(String onfocus) Set the value of the 'onfocus' attribute.
void | setReadonly(String readonly) Sets the value of the 'readonly' attribute.
protected void | writeOptionalAttributes(TagWriter tagWriter) Adds input-specific optional attributes as defined by this base class.
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
getCssClass, getCssErrorClass, getCssStyle, getDir, getDynamicAttributes, getLang, getOnclick, getOndblclick, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getTabindex, getTitle, resolveCssClass, setCssClass, setCssErrorClass, setCssStyle, setDir, setDynamicAttribute, setLang, setOnclick, setOndblclick, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setTabindex, setTitle, writeDefaultAttributes
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
autogenerateId, doFinally, getBindStatus, getBoundValue, getEditor, getId, getName, getNestedPath, getPath, getPropertyEditor, getPropertyPath, resolveId, setId, setPath
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractFormTag
createTagWriter, doStartTagInternal, evaluate, evaluateBoolean, getDisplayString, getDisplayString, isDefaultHtmlEscape, writeOptionalAttribute, writeTagContent
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isHtmlEscape, setHtmlEscape
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doStartTag, getRequestContext
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

ONFOCUS_ATTRIBUTE

public static final String ONFOCUS_ATTRIBUTE
The name of the 'onfocus' attribute.

See Also:
Constant Field Values

ONBLUR_ATTRIBUTE

public static final String ONBLUR_ATTRIBUTE
The name of the 'onblur' attribute.

See Also:
Constant Field Values

ONCHANGE_ATTRIBUTE

public static final String ONCHANGE_ATTRIBUTE
The name of the 'onchange' attribute.

See Also:
Constant Field Values

ACCESSKEY_ATTRIBUTE

public static final String ACCESSKEY_ATTRIBUTE
The name of the 'accesskey' attribute.

See Also:
Constant Field Values

DISABLED_ATTRIBUTE

public static final String DISABLED_ATTRIBUTE
The name of the 'disabled' attribute.

See Also:
Constant Field Values

READONLY_ATTRIBUTE

public static final String READONLY_ATTRIBUTE
The name of the 'readonly' attribute.

See Also:
Constant Field Values
Constructor Detail

AbstractHtmlInputElementTag

public AbstractHtmlInputElementTag()
Method Detail

setOnfocus

public void setOnfocus(String onfocus)
Set the value of the 'onfocus' attribute. May be a runtime expression.

getOnfocus

protected String getOnfocus()
Get the value of the 'onfocus' attribute.

setOnblur

public void setOnblur(String onblur)
Set the value of the 'onblur' attribute. May be a runtime expression.

getOnblur

protected String getOnblur()
Get the value of the 'onblur' attribute.

setOnchange

public void setOnchange(String onchange)
Set the value of the 'onchange' attribute. May be a runtime expression.

getOnchange

protected String getOnchange()
Get the value of the 'onchange' attribute.

setAccesskey

public void setAccesskey(String accesskey)
Set the value of the 'accesskey' attribute. May be a runtime expression.

getAccesskey

protected String getAccesskey()
Get the value of the 'accesskey' attribute.

setDisabled

public void setDisabled(String disabled)
Set the value of the 'disabled' attribute. May be a runtime expression.

getDisabled

protected String getDisabled()
Get the value of the 'disabled' attribute.

setReadonly

public void setReadonly(String readonly)
Sets the value of the 'readonly' attribute. May be a runtime expression.

See Also:
isReadonly()

getReadonly

protected String getReadonly()
Gets the value of the 'readonly' attribute. May be a runtime expression.

See Also:
isReadonly()

writeOptionalAttributes

protected void writeOptionalAttributes(TagWriter tagWriter)
                                throws JspException
Adds input-specific optional attributes as defined by this base class.

Overrides:
writeOptionalAttributes in class AbstractHtmlElementTag
Throws:
JspException

isDisabled

protected boolean isDisabled()
                      throws JspException
Is the current HTML tag disabled?

Throws:
JspException

isReadonly

protected boolean isReadonly()
                      throws JspException
Is the current HTML tag readonly?

Note: some AbstractHtmlInputElementTag subclasses (such a those for checkboxes and radiobuttons) may contain readonly attributes, but are not affected by them since their values don't change (only their status does.)

Throws:
JspException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractMultiCheckedElementTag

org.springframework.web.servlet.tags.form
Class AbstractMultiCheckedElementTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapingAwareTag
                extended by  org.springframework.web.servlet.tags.form.AbstractFormTag
                    extended by  org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
                        extended by  org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
                            extended by  org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
                                extended by  org.springframework.web.servlet.tags.form.AbstractCheckedElementTag
                                    extended by  org.springframework.web.servlet.tags.form.AbstractMultiCheckedElementTag
All Implemented Interfaces:
Serializable, DynamicAttributes, IterationTag, JspTag, Tag, TryCatchFinally, EditorAwareTag
Direct Known Subclasses:
CheckboxesTag, RadioButtonsTag
public abstract class AbstractMultiCheckedElementTag
extends AbstractCheckedElementTag

Abstract base class to provide common methods for implementing databinding-aware JSP tags for rendering multiple HTML 'input' elements with a 'type' of 'checkbox' or 'radio'.

Since:
2.5.2
Author:
Juergen Hoeller, Scott Andrews
See Also:
Serialized Form

Field Summary
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
ACCESSKEY_ATTRIBUTE, DISABLED_ATTRIBUTE, ONBLUR_ATTRIBUTE, ONCHANGE_ATTRIBUTE, ONFOCUS_ATTRIBUTE, READONLY_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
CLASS_ATTRIBUTE, DIR_ATTRIBUTE, LANG_ATTRIBUTE, ONCLICK_ATTRIBUTE, ONDBLCLICK_ATTRIBUTE, ONKEYDOWN_ATTRIBUTE, ONKEYPRESS_ATTRIBUTE, ONKEYUP_ATTRIBUTE, ONMOUSEDOWN_ATTRIBUTE, ONMOUSEMOVE_ATTRIBUTE, ONMOUSEOUT_ATTRIBUTE, ONMOUSEOVER_ATTRIBUTE, ONMOUSEUP_ATTRIBUTE, STYLE_ATTRIBUTE, TABINDEX_ATTRIBUTE, TITLE_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
COMMAND_NAME_VARIABLE_NAME, NESTED_PATH_VARIABLE_NAME
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
AbstractMultiCheckedElementTag()
Method Summary
 String getDelimiter()
Return the delimiter to be used between each 'input type="radio"' tag.
 String getElement()
Get the HTML element used to enclose 'input type="checkbox/radio"' tag.
protected abstract  String getInputType()
Return the type of the HTML input element to generate: "checkbox" or "radio".
protected  String getItemLabel()
Get the value to be displayed as part of the 'input type="checkbox/radio"' tag.
protected  Object getItems()
Get the Collection, Map or array of objects used to generate the 'input type="checkbox/radio"' tags.
protected  String getItemValue()
Get the name of the property mapped to the 'value' attribute of the 'input type="checkbox/radio"' tag.
protected  String resolveId()
Appends a counter to a specified id as well, since we're dealing with multiple HTML elements.
 void setDelimiter(String delimiter)
Set the delimiter to be used between each 'input type="checkbox/radio"' tag.
 void setElement(String element)
Set the HTML element used to enclose the 'input type="checkbox/radio"' tag.
 void setItemLabel(String itemLabel)
Set the value to be displayed as part of the 'input type="checkbox/radio"' tag.
 void setItems(Object items)
Set the Collection, Map or array of objects used to generate the 'input type="checkbox/radio"' tags.
 void setItemValue(String itemValue)
Set the name of the property mapped to the 'value' attribute of the 'input type="checkbox/radio"' tag.
protected  int writeTagContent(TagWriter tagWriter)
Renders the 'input type="radio"' element with the configured setItems(Object) values.
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractCheckedElementTag
autogenerateId, renderFromBoolean, renderFromValue, renderFromValue
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
getAccesskey, getDisabled, getOnblur, getOnchange, getOnfocus, getReadonly, isDisabled, isReadonly, setAccesskey, setDisabled, setOnblur, setOnchange, setOnfocus, setReadonly, writeOptionalAttributes
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
getCssClass, getCssErrorClass, getCssStyle, getDir, getDynamicAttributes, getLang, getOnclick, getOndblclick, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getTabindex, getTitle, resolveCssClass, setCssClass, setCssErrorClass, setCssStyle, setDir, setDynamicAttribute, setLang, setOnclick, setOndblclick, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setTabindex, setTitle, writeDefaultAttributes
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
doFinally, getBindStatus, getBoundValue, getEditor, getId, getName, getNestedPath, getPath, getPropertyEditor, getPropertyPath, setId, setPath
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractFormTag
createTagWriter, doStartTagInternal, evaluate, evaluateBoolean, getDisplayString, getDisplayString, isDefaultHtmlEscape, writeOptionalAttribute
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isHtmlEscape, setHtmlEscape
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doStartTag, getRequestContext
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractMultiCheckedElementTag

public AbstractMultiCheckedElementTag()
Method Detail

setItems

public void setItems(Object items)
Set the Collection, Map or array of objects used to generate the 'input type="checkbox/radio"' tags.

Typically a runtime expression.

Parameters:
items - said items

getItems

protected Object getItems()
Get the Collection, Map or array of objects used to generate the 'input type="checkbox/radio"' tags.

setItemValue

public void setItemValue(String itemValue)
Set the name of the property mapped to the 'value' attribute of the 'input type="checkbox/radio"' tag.

May be a runtime expression.

getItemValue

protected String getItemValue()
Get the name of the property mapped to the 'value' attribute of the 'input type="checkbox/radio"' tag.

setItemLabel

public void setItemLabel(String itemLabel)
Set the value to be displayed as part of the 'input type="checkbox/radio"' tag.

May be a runtime expression.

getItemLabel

protected String getItemLabel()
Get the value to be displayed as part of the 'input type="checkbox/radio"' tag.

setDelimiter

public void setDelimiter(String delimiter)
Set the delimiter to be used between each 'input type="checkbox/radio"' tag.

By default, there is no delimiter.

getDelimiter

public String getDelimiter()
Return the delimiter to be used between each 'input type="radio"' tag.

setElement

public void setElement(String element)
Set the HTML element used to enclose the 'input type="checkbox/radio"' tag.

Defaults to an HTML '<span/>' tag.

getElement

public String getElement()
Get the HTML element used to enclose 'input type="checkbox/radio"' tag.

resolveId

protected String resolveId()
                    throws JspException
Appends a counter to a specified id as well, since we're dealing with multiple HTML elements.

Overrides:
resolveId in class AbstractDataBoundFormElementTag
Throws:
JspException
See Also:
AbstractDataBoundFormElementTag.getId(), AbstractDataBoundFormElementTag.autogenerateId()

writeTagContent

protected int writeTagContent(TagWriter tagWriter)
                       throws JspException
Renders the 'input type="radio"' element with the configured setItems(Object) values. Marks the element as checked if the value matches the bound value.

Specified by:
writeTagContent in class AbstractCheckedElementTag
Returns:
valid tag render instruction as per Tag.doStartTag().
Throws:
JspException

getInputType

protected abstract String getInputType()
Return the type of the HTML input element to generate: "checkbox" or "radio".

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractSingleCheckedElementTag

org.springframework.web.servlet.tags.form
Class AbstractSingleCheckedElementTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapingAwareTag
                extended by  org.springframework.web.servlet.tags.form.AbstractFormTag
                    extended by  org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
                        extended by  org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
                            extended by  org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
                                extended by  org.springframework.web.servlet.tags.form.AbstractCheckedElementTag
                                    extended by  org.springframework.web.servlet.tags.form.AbstractSingleCheckedElementTag
All Implemented Interfaces:
Serializable, DynamicAttributes, IterationTag, JspTag, Tag, TryCatchFinally, EditorAwareTag
Direct Known Subclasses:
CheckboxTag, RadioButtonTag
public abstract class AbstractSingleCheckedElementTag
extends AbstractCheckedElementTag

Abstract base class to provide common methods for implementing databinding-aware JSP tags for rendering a single HTML 'input' element with a 'type' of 'checkbox' or 'radio'.

Since:
2.5.2
Author:
Juergen Hoeller
See Also:
Serialized Form

Field Summary
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
ACCESSKEY_ATTRIBUTE, DISABLED_ATTRIBUTE, ONBLUR_ATTRIBUTE, ONCHANGE_ATTRIBUTE, ONFOCUS_ATTRIBUTE, READONLY_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
CLASS_ATTRIBUTE, DIR_ATTRIBUTE, LANG_ATTRIBUTE, ONCLICK_ATTRIBUTE, ONDBLCLICK_ATTRIBUTE, ONKEYDOWN_ATTRIBUTE, ONKEYPRESS_ATTRIBUTE, ONKEYUP_ATTRIBUTE, ONMOUSEDOWN_ATTRIBUTE, ONMOUSEMOVE_ATTRIBUTE, ONMOUSEOUT_ATTRIBUTE, ONMOUSEOVER_ATTRIBUTE, ONMOUSEUP_ATTRIBUTE, STYLE_ATTRIBUTE, TABINDEX_ATTRIBUTE, TITLE_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
COMMAND_NAME_VARIABLE_NAME, NESTED_PATH_VARIABLE_NAME
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
AbstractSingleCheckedElementTag()
Method Summary
protected Object | getLabel() Get the value of the 'label' attribute.
protected Object | getValue() Get the value of the 'value' attribute.
void | setLabel(Object label) Set the value of the 'label' attribute.
void | setValue(Object value) Set the value of the 'value' attribute.
protected int | writeTagContent(TagWriter tagWriter) Renders the 'input(radio)' element with the configured value.
protected abstract void | writeTagDetails(TagWriter tagWriter) Write the details for the given primary tag: i.e.
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractCheckedElementTag
autogenerateId, renderFromBoolean, renderFromValue, renderFromValue
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
getAccesskey, getDisabled, getOnblur, getOnchange, getOnfocus, getReadonly, isDisabled, isReadonly, setAccesskey, setDisabled, setOnblur, setOnchange, setOnfocus, setReadonly, writeOptionalAttributes
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
getCssClass, getCssErrorClass, getCssStyle, getDir, getDynamicAttributes, getLang, getOnclick, getOndblclick, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getTabindex, getTitle, resolveCssClass, setCssClass, setCssErrorClass, setCssStyle, setDir, setDynamicAttribute, setLang, setOnclick, setOndblclick, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setTabindex, setTitle, writeDefaultAttributes
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
doFinally, getBindStatus, getBoundValue, getEditor, getId, getName, getNestedPath, getPath, getPropertyEditor, getPropertyPath, resolveId, setId, setPath
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractFormTag
createTagWriter, doStartTagInternal, evaluate, evaluateBoolean, getDisplayString, getDisplayString, isDefaultHtmlEscape, writeOptionalAttribute
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isHtmlEscape, setHtmlEscape
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doStartTag, getRequestContext
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractSingleCheckedElementTag

public AbstractSingleCheckedElementTag()
Method Detail

setValue

public void setValue(Object value)
Set the value of the 'value' attribute. May be a runtime expression.

getValue

protected Object getValue()
Get the value of the 'value' attribute.

setLabel

public void setLabel(Object label)
Set the value of the 'label' attribute. May be a runtime expression.

getLabel

protected Object getLabel()
Get the value of the 'label' attribute.

writeTagContent

protected int writeTagContent(TagWriter tagWriter)
                       throws JspException
Renders the 'input(radio)' element with the configured value. Marks the element as checked if the value matches the bound value.

Specified by:
writeTagContent in class AbstractCheckedElementTag
Returns:
valid tag render instruction as per Tag.doStartTag().
Throws:
JspException

writeTagDetails

protected abstract void writeTagDetails(TagWriter tagWriter)
                                 throws JspException
Write the details for the given primary tag: i.e. special attributes and the tag's value.

Throws:
JspException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CheckboxesTag

org.springframework.web.servlet.tags.form
Class CheckboxesTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapingAwareTag
                extended by  org.springframework.web.servlet.tags.form.AbstractFormTag
                    extended by  org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
                        extended by  org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
                            extended by  org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
                                extended by  org.springframework.web.servlet.tags.form.AbstractCheckedElementTag
                                    extended by  org.springframework.web.servlet.tags.form.AbstractMultiCheckedElementTag
                                        extended by  org.springframework.web.servlet.tags.form.CheckboxesTag
All Implemented Interfaces:
Serializable, DynamicAttributes, IterationTag, JspTag, Tag, TryCatchFinally, EditorAwareTag
public class CheckboxesTag
extends AbstractMultiCheckedElementTag

Databinding-aware JSP tag for rendering multiple HTML 'input' elements with a 'type' of 'checkbox'.

Intended to be used with a Collection as the AbstractMultiCheckedElementTag.getItems() bound value}.

Since:
2.5
Author:
Thomas Risberg, Juergen Hoeller, Mark Fisher
See Also:
Serialized Form

Field Summary
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
ACCESSKEY_ATTRIBUTE, DISABLED_ATTRIBUTE, ONBLUR_ATTRIBUTE, ONCHANGE_ATTRIBUTE, ONFOCUS_ATTRIBUTE, READONLY_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
CLASS_ATTRIBUTE, DIR_ATTRIBUTE, LANG_ATTRIBUTE, ONCLICK_ATTRIBUTE, ONDBLCLICK_ATTRIBUTE, ONKEYDOWN_ATTRIBUTE, ONKEYPRESS_ATTRIBUTE, ONKEYUP_ATTRIBUTE, ONMOUSEDOWN_ATTRIBUTE, ONMOUSEMOVE_ATTRIBUTE, ONMOUSEOUT_ATTRIBUTE, ONMOUSEOVER_ATTRIBUTE, ONMOUSEUP_ATTRIBUTE, STYLE_ATTRIBUTE, TABINDEX_ATTRIBUTE, TITLE_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
COMMAND_NAME_VARIABLE_NAME, NESTED_PATH_VARIABLE_NAME
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
CheckboxesTag()
Method Summary
protected String | getInputType() Return the type of the HTML input element to generate: "checkbox" or "radio".
protected int | writeTagContent(TagWriter tagWriter) Renders the 'input type="radio"' element with the configured AbstractMultiCheckedElementTag.setItems(Object) values.
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractMultiCheckedElementTag
getDelimiter, getElement, getItemLabel, getItems, getItemValue, resolveId, setDelimiter, setElement, setItemLabel, setItems, setItemValue
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractCheckedElementTag
autogenerateId, renderFromBoolean, renderFromValue, renderFromValue
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
getAccesskey, getDisabled, getOnblur, getOnchange, getOnfocus, getReadonly, isDisabled, isReadonly, setAccesskey, setDisabled, setOnblur, setOnchange, setOnfocus, setReadonly, writeOptionalAttributes
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
getCssClass, getCssErrorClass, getCssStyle, getDir, getDynamicAttributes, getLang, getOnclick, getOndblclick, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getTabindex, getTitle, resolveCssClass, setCssClass, setCssErrorClass, setCssStyle, setDir, setDynamicAttribute, setLang, setOnclick, setOndblclick, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setTabindex, setTitle, writeDefaultAttributes
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
doFinally, getBindStatus, getBoundValue, getEditor, getId, getName, getNestedPath, getPath, getPropertyEditor, getPropertyPath, setId, setPath
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractFormTag
createTagWriter, doStartTagInternal, evaluate, evaluateBoolean, getDisplayString, getDisplayString, isDefaultHtmlEscape, writeOptionalAttribute
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isHtmlEscape, setHtmlEscape
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doStartTag, getRequestContext
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CheckboxesTag

public CheckboxesTag()
Method Detail

writeTagContent

protected int writeTagContent(TagWriter tagWriter)
                       throws JspException
Description copied from class: AbstractMultiCheckedElementTag
Renders the 'input type="radio"' element with the configured AbstractMultiCheckedElementTag.setItems(Object) values. Marks the element as checked if the value matches the bound value.

Overrides:
writeTagContent in class AbstractMultiCheckedElementTag
Returns:
valid tag render instruction as per Tag.doStartTag().
Throws:
JspException

getInputType

protected String getInputType()
Description copied from class: AbstractMultiCheckedElementTag
Return the type of the HTML input element to generate: "checkbox" or "radio".

Specified by:
getInputType in class AbstractMultiCheckedElementTag
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CheckboxTag

org.springframework.web.servlet.tags.form
Class CheckboxTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapingAwareTag
                extended by  org.springframework.web.servlet.tags.form.AbstractFormTag
                    extended by  org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
                        extended by  org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
                            extended by  org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
                                extended by  org.springframework.web.servlet.tags.form.AbstractCheckedElementTag
                                    extended by  org.springframework.web.servlet.tags.form.AbstractSingleCheckedElementTag
                                        extended by  org.springframework.web.servlet.tags.form.CheckboxTag
All Implemented Interfaces:
Serializable, DynamicAttributes, IterationTag, JspTag, Tag, TryCatchFinally, EditorAwareTag
public class CheckboxTag
extends AbstractSingleCheckedElementTag

Databinding-aware JSP tag for rendering an HTML 'input' element with a 'type' of 'checkbox'.

May be used in one of three different approaches depending on the type of the bound value.

Approach One

When the bound value is of type Boolean then the 'input(checkbox)' is marked as 'checked' if the bound value is true. The 'value' attribute corresponds to the resolved value of the value property.

Approach Two

When the bound value is of type Collection then the 'input(checkbox)' is marked as 'checked' if the configured value is present in the bound Collection.

Approach Three

For any other bound value type, the 'input(checkbox)' is marked as 'checked' if the the configured value is equal to the bound value.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
See Also:
Serialized Form

Field Summary
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
ACCESSKEY_ATTRIBUTE, DISABLED_ATTRIBUTE, ONBLUR_ATTRIBUTE, ONCHANGE_ATTRIBUTE, ONFOCUS_ATTRIBUTE, READONLY_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
CLASS_ATTRIBUTE, DIR_ATTRIBUTE, LANG_ATTRIBUTE, ONCLICK_ATTRIBUTE, ONDBLCLICK_ATTRIBUTE, ONKEYDOWN_ATTRIBUTE, ONKEYPRESS_ATTRIBUTE, ONKEYUP_ATTRIBUTE, ONMOUSEDOWN_ATTRIBUTE, ONMOUSEMOVE_ATTRIBUTE, ONMOUSEOUT_ATTRIBUTE, ONMOUSEOVER_ATTRIBUTE, ONMOUSEUP_ATTRIBUTE, STYLE_ATTRIBUTE, TABINDEX_ATTRIBUTE, TITLE_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
COMMAND_NAME_VARIABLE_NAME, NESTED_PATH_VARIABLE_NAME
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
CheckboxTag()
Method Summary
protected int | writeTagContent(TagWriter tagWriter) Renders the 'input(radio)' element with the configured value.
protected void | writeTagDetails(TagWriter tagWriter) Write the details for the given primary tag: i.e.
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractSingleCheckedElementTag
getLabel, getValue, setLabel, setValue
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractCheckedElementTag
autogenerateId, renderFromBoolean, renderFromValue, renderFromValue
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
getAccesskey, getDisabled, getOnblur, getOnchange, getOnfocus, getReadonly, isDisabled, isReadonly, setAccesskey, setDisabled, setOnblur, setOnchange, setOnfocus, setReadonly, writeOptionalAttributes
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
getCssClass, getCssErrorClass, getCssStyle, getDir, getDynamicAttributes, getLang, getOnclick, getOndblclick, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getTabindex, getTitle, resolveCssClass, setCssClass, setCssErrorClass, setCssStyle, setDir, setDynamicAttribute, setLang, setOnclick, setOndblclick, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setTabindex, setTitle, writeDefaultAttributes
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
doFinally, getBindStatus, getBoundValue, getEditor, getId, getName, getNestedPath, getPath, getPropertyEditor, getPropertyPath, resolveId, setId, setPath
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractFormTag
createTagWriter, doStartTagInternal, evaluate, evaluateBoolean, getDisplayString, getDisplayString, isDefaultHtmlEscape, writeOptionalAttribute
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isHtmlEscape, setHtmlEscape
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doStartTag, getRequestContext
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CheckboxTag

public CheckboxTag()
Method Detail

writeTagContent

protected int writeTagContent(TagWriter tagWriter)
                       throws JspException
Description copied from class: AbstractSingleCheckedElementTag
Renders the 'input(radio)' element with the configured value. Marks the element as checked if the value matches the bound value.

Overrides:
writeTagContent in class AbstractSingleCheckedElementTag
Returns:
valid tag render instruction as per Tag.doStartTag().
Throws:
JspException

writeTagDetails

protected void writeTagDetails(TagWriter tagWriter)
                        throws JspException
Description copied from class: AbstractSingleCheckedElementTag
Write the details for the given primary tag: i.e. special attributes and the tag's value.

Specified by:
writeTagDetails in class AbstractSingleCheckedElementTag
Throws:
JspException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ErrorsTag

org.springframework.web.servlet.tags.form
Class ErrorsTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapingAwareTag
                extended by  org.springframework.web.servlet.tags.form.AbstractFormTag
                    extended by  org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
                        extended by  org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
                            extended by  org.springframework.web.servlet.tags.form.AbstractHtmlElementBodyTag
                                extended by  org.springframework.web.servlet.tags.form.ErrorsTag
All Implemented Interfaces:
Serializable, BodyTag, DynamicAttributes, IterationTag, JspTag, Tag, TryCatchFinally, EditorAwareTag
public class ErrorsTag
extends AbstractHtmlElementBodyTag
implements BodyTag

Form tag for displaying errors for a particular field or object.

This tag supports three main usage patterns:

  1. Field only - set 'path' to the field name (or path)
  2. Object errors only - omit 'path'
  3. All errors - set 'path' to '*'

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller, Rick Evans
See Also:
Serialized Form

Field Summary
static String | MESSAGES_ATTRIBUTE The key under which this tag exposes error messages in the page context scope.
static String | SPAN_TAG The HTML 'span' tag.
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
CLASS_ATTRIBUTE, DIR_ATTRIBUTE, LANG_ATTRIBUTE, ONCLICK_ATTRIBUTE, ONDBLCLICK_ATTRIBUTE, ONKEYDOWN_ATTRIBUTE, ONKEYPRESS_ATTRIBUTE, ONKEYUP_ATTRIBUTE, ONMOUSEDOWN_ATTRIBUTE, ONMOUSEMOVE_ATTRIBUTE, ONMOUSEOUT_ATTRIBUTE, ONMOUSEOVER_ATTRIBUTE, ONMOUSEUP_ATTRIBUTE, STYLE_ATTRIBUTE, TABINDEX_ATTRIBUTE, TITLE_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
COMMAND_NAME_VARIABLE_NAME, NESTED_PATH_VARIABLE_NAME
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
ErrorsTag()
Method Summary
protected String | autogenerateId() Get the value for the HTML 'id' attribute.
protected void | exposeAttributes() Exposes any bind status error messages under this key in the PageContext.PAGE_SCOPE.
String | getDelimiter() Return the delimiter to be used between error messages.
String | getElement() Get the HTML element must be used to render the error messages.
protected String | getName() Get the value for the HTML 'name' attribute.
protected void | removeAttributes() Removes any bind status error messages that were previously stored under this key in the PageContext.PAGE_SCOPE.
protected void | renderDefaultContent(TagWriter tagWriter)
void | setDelimiter(String delimiter) Set the delimiter to be used between error messages.
void | setElement(String element) Set the HTML element must be used to render the error messages.
protected boolean | shouldRender() Should rendering of this tag proceed at all?
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementBodyTag
doEndTag, doFinally, doInitBody, flushBufferedBodyContent, onWriteTagContent, renderFromBodyContent, setBodyContent, writeTagContent
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
getCssClass, getCssErrorClass, getCssStyle, getDir, getDynamicAttributes, getLang, getOnclick, getOndblclick, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getTabindex, getTitle, resolveCssClass, setCssClass, setCssErrorClass, setCssStyle, setDir, setDynamicAttribute, setLang, setOnclick, setOndblclick, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setTabindex, setTitle, writeDefaultAttributes, writeOptionalAttributes
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
getBindStatus, getBoundValue, getEditor, getId, getNestedPath, getPath, getPropertyEditor, getPropertyPath, resolveId, setId, setPath
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractFormTag
createTagWriter, doStartTagInternal, evaluate, evaluateBoolean, getDisplayString, getDisplayString, isDefaultHtmlEscape, writeOptionalAttribute
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isHtmlEscape, setHtmlEscape
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doStartTag, getRequestContext
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.servlet.jsp.tagext.BodyTag
doInitBody, setBodyContent
Methods inherited from interface javax.servlet.jsp.tagext.IterationTag
doAfterBody
Methods inherited from interface javax.servlet.jsp.tagext.Tag
doEndTag, doStartTag, getParent, release, setPageContext, setParent

Field Detail

MESSAGES_ATTRIBUTE

public static final String MESSAGES_ATTRIBUTE
The key under which this tag exposes error messages in the page context scope.

See Also:
Constant Field Values

SPAN_TAG

public static final String SPAN_TAG
The HTML 'span' tag.

See Also:
Constant Field Values
Constructor Detail

ErrorsTag

public ErrorsTag()
Method Detail

setElement

public void setElement(String element)
Set the HTML element must be used to render the error messages.

Defaults to an HTML '<span/>' tag.

getElement

public String getElement()
Get the HTML element must be used to render the error messages.

setDelimiter

public void setDelimiter(String delimiter)
Set the delimiter to be used between error messages.

Defaults to an HTML '<br/>' tag.

getDelimiter

public String getDelimiter()
Return the delimiter to be used between error messages.

autogenerateId

protected String autogenerateId()
                         throws JspException
Get the value for the HTML 'id' attribute.

Appends '.errors' to the value returned by AbstractDataBoundFormElementTag.getPropertyPath() or to the model attribute name if the <form:errors/> tag's 'path' attribute has been omitted.

Overrides:
autogenerateId in class AbstractDataBoundFormElementTag
Returns:
the value for the HTML 'id' attribute
Throws:
JspException
See Also:
AbstractDataBoundFormElementTag.getPropertyPath()

getName

protected String getName()
                  throws JspException
Get the value for the HTML 'name' attribute.

Simply returns null because the 'name' attribute is not a validate attribute for the 'span' element.

Overrides:
getName in class AbstractDataBoundFormElementTag
Returns:
the value for the HTML 'name' attribute
Throws:
JspException

shouldRender

protected boolean shouldRender()
                        throws JspException
Should rendering of this tag proceed at all?

Only renders output when there are errors for the configured path.

Overrides:
shouldRender in class AbstractHtmlElementBodyTag
Returns:
true only when there are errors for the configured path
Throws:
JspException

renderDefaultContent

protected void renderDefaultContent(TagWriter tagWriter)
                             throws JspException
Specified by:
renderDefaultContent in class AbstractHtmlElementBodyTag
Throws:
JspException

exposeAttributes

protected void exposeAttributes()
                         throws JspException
Exposes any bind status error messages under this key in the PageContext.PAGE_SCOPE.

Only called if shouldRender() returns true.

Overrides:
exposeAttributes in class AbstractHtmlElementBodyTag
Throws:
JspException
See Also:
removeAttributes()

removeAttributes

protected void removeAttributes()
Removes any bind status error messages that were previously stored under this key in the PageContext.PAGE_SCOPE.

Overrides:
removeAttributes in class AbstractHtmlElementBodyTag
See Also:
exposeAttributes()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FormTag

org.springframework.web.servlet.tags.form
Class FormTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapingAwareTag
                extended by  org.springframework.web.servlet.tags.form.AbstractFormTag
                    extended by  org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
                        extended by  org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
                            extended by  org.springframework.web.servlet.tags.form.FormTag
All Implemented Interfaces:
Serializable, DynamicAttributes, IterationTag, JspTag, Tag, TryCatchFinally, EditorAwareTag
public class FormTag
extends AbstractHtmlElementTag

Databinding-aware JSP tag for rendering an HTML 'form' whose inner elements are bound to properties on a form object.

Users should place the form object into the ModelAndView when populating the data for their view. The name of this form object can be configured using the "modelAttribute" property.

The default value for the "modelAttribute" property is 'command' which corresponds to the default name when using the SimpleFormController.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller, Scott Andrews
See Also:
SimpleFormController, Serialized Form

Field Summary
static String | DEFAULT_COMMAND_NAME The default attribute name: "command"
static String | MODEL_ATTRIBUTE_VARIABLE_NAME The name of the PageContext attribute under which the form object name is exposed.
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
CLASS_ATTRIBUTE, DIR_ATTRIBUTE, LANG_ATTRIBUTE, ONCLICK_ATTRIBUTE, ONDBLCLICK_ATTRIBUTE, ONKEYDOWN_ATTRIBUTE, ONKEYPRESS_ATTRIBUTE, ONKEYUP_ATTRIBUTE, ONMOUSEDOWN_ATTRIBUTE, ONMOUSEMOVE_ATTRIBUTE, ONMOUSEOUT_ATTRIBUTE, ONMOUSEOVER_ATTRIBUTE, ONMOUSEUP_ATTRIBUTE, STYLE_ATTRIBUTE, TABINDEX_ATTRIBUTE, TITLE_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
COMMAND_NAME_VARIABLE_NAME, NESTED_PATH_VARIABLE_NAME
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
FormTag()
Method Summary
protected String | autogenerateId() Autogenerated IDs correspond to the form object name.
int | doEndTag() Closes the 'form' block tag and removes the form object name from the PageContext.
void | doFinally() Clears the stored TagWriter.
protected String | getAcceptCharset() Get the value of the 'acceptCharset' attribute.
protected String | getAction() Get the value of the 'action' attribute.
protected String | getAutocomplete() Get the value of the 'autocomplete' attribute.
protected String | getCommandName() Get the name of the form attribute in the model.
protected String | getEnctype() Get the value of the 'enctype' attribute.
protected String | getMethod() Get the value of the 'method' attribute.
protected String | getMethodParameter() Get the name of the request param for non-browser supported HTTP methods.
protected String | getModelAttribute() Get the name of the form attribute in the model.
protected String | getName() Get the value of the 'name' attribute.
protected String | getOnreset() Get the value of the 'onreset' attribute.
protected String | getOnsubmit() Get the value of the 'onsubmit' attribute.
String | getTarget() Get the value of the 'target' attribute.
protected boolean | isMethodBrowserSupported(String method) Determine if the HTTP method is supported by browsers (i.e.
protected String | resolveAction() Resolve the value of the 'action' attribute.
protected String | resolveCssClass() Override resolve CSS class since error class is not supported.
protected String | resolveModelAttribute() Resolves and returns the name of the form object.
void | setAcceptCharset(String acceptCharset) Set the value of the 'acceptCharset' attribute.
void | setAction(String action) Set the value of the 'action' attribute.
void | setAutocomplete(String autocomplete) Set the value of the 'autocomplete' attribute.
void | setCommandName(String commandName) Set the name of the form attribute in the model.
void | setCssErrorClass(String cssErrorClass) Unsupported for forms.
void | setEnctype(String enctype) Set the value of the 'enctype' attribute.
void | setMethod(String method) Set the value of the 'method' attribute.
void | setMethodParam(String methodParam) Set the name of the request param for non-browser supported HTTP methods.
void | setModelAttribute(String modelAttribute) Set the name of the form attribute in the model.
void | setName(String name) Set the value of the 'name' attribute.
void | setOnreset(String onreset) Set the value of the 'onreset' attribute.
void | setOnsubmit(String onsubmit) Set the value of the 'onsubmit' attribute.
void | setPath(String path) Unsupported for forms.
void | setTarget(String target) Set the value of the 'target' attribute.
protected int | writeTagContent(TagWriter tagWriter) Writes the opening part of the block 'form' tag and exposes the form object name in the PageContext.
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
getCssClass, getCssErrorClass, getCssStyle, getDir, getDynamicAttributes, getLang, getOnclick, getOndblclick, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getTabindex, getTitle, setCssClass, setCssStyle, setDir, setDynamicAttribute, setLang, setOnclick, setOndblclick, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setTabindex, setTitle, writeDefaultAttributes, writeOptionalAttributes
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
getBindStatus, getBoundValue, getEditor, getId, getNestedPath, getPath, getPropertyEditor, getPropertyPath, resolveId, setId
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractFormTag
createTagWriter, doStartTagInternal, evaluate, evaluateBoolean, getDisplayString, getDisplayString, isDefaultHtmlEscape, writeOptionalAttribute
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isHtmlEscape, setHtmlEscape
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doStartTag, getRequestContext
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_COMMAND_NAME

public static final String DEFAULT_COMMAND_NAME
The default attribute name: "command"

See Also:
Constant Field Values

MODEL_ATTRIBUTE_VARIABLE_NAME

public static final String MODEL_ATTRIBUTE_VARIABLE_NAME
The name of the PageContext attribute under which the form object name is exposed.

Constructor Detail

FormTag

public FormTag()
Method Detail

setModelAttribute

public void setModelAttribute(String modelAttribute)
Set the name of the form attribute in the model.

May be a runtime expression.

getModelAttribute

protected String getModelAttribute()
Get the name of the form attribute in the model.

setCommandName

public void setCommandName(String commandName)
Set the name of the form attribute in the model.

May be a runtime expression.

See Also:
setModelAttribute(java.lang.String)

getCommandName

protected String getCommandName()
Get the name of the form attribute in the model.

See Also:
getModelAttribute()

setName

public void setName(String name)
Set the value of the 'name' attribute.

May be a runtime expression.

Name is not a valid attribute for form on XHTML 1.0. However, it is sometimes needed for backward compatibility.

getName

protected String getName()
                  throws JspException
Get the value of the 'name' attribute.

Overrides:
getName in class AbstractDataBoundFormElementTag
Returns:
the value for the HTML 'name' attribute
Throws:
JspException

setAction

public void setAction(String action)
Set the value of the 'action' attribute.

May be a runtime expression.

getAction

protected String getAction()
Get the value of the 'action' attribute.

setMethod

public void setMethod(String method)
Set the value of the 'method' attribute.

May be a runtime expression.

getMethod

protected String getMethod()
Get the value of the 'method' attribute.

setTarget

public void setTarget(String target)
Set the value of the 'target' attribute.

May be a runtime expression.

getTarget

public String getTarget()
Get the value of the 'target' attribute.

setEnctype

public void setEnctype(String enctype)
Set the value of the 'enctype' attribute.

May be a runtime expression.

getEnctype

protected String getEnctype()
Get the value of the 'enctype' attribute.

setAcceptCharset

public void setAcceptCharset(String acceptCharset)
Set the value of the 'acceptCharset' attribute.

May be a runtime expression.

getAcceptCharset

protected String getAcceptCharset()
Get the value of the 'acceptCharset' attribute.

setOnsubmit

public void setOnsubmit(String onsubmit)
Set the value of the 'onsubmit' attribute.

May be a runtime expression.

getOnsubmit

protected String getOnsubmit()
Get the value of the 'onsubmit' attribute.

setOnreset

public void setOnreset(String onreset)
Set the value of the 'onreset' attribute.

May be a runtime expression.

getOnreset

protected String getOnreset()
Get the value of the 'onreset' attribute.

setAutocomplete

public void setAutocomplete(String autocomplete)
Set the value of the 'autocomplete' attribute. May be a runtime expression.

getAutocomplete

protected String getAutocomplete()
Get the value of the 'autocomplete' attribute.

setMethodParam

public void setMethodParam(String methodParam)
Set the name of the request param for non-browser supported HTTP methods.

getMethodParameter

protected String getMethodParameter()
Get the name of the request param for non-browser supported HTTP methods.

isMethodBrowserSupported

protected boolean isMethodBrowserSupported(String method)
Determine if the HTTP method is supported by browsers (i.e. GET or POST).

writeTagContent

protected int writeTagContent(TagWriter tagWriter)
                       throws JspException
Writes the opening part of the block 'form' tag and exposes the form object name in the PageContext.

Specified by:
writeTagContent in class AbstractFormTag
Parameters:
tagWriter - the TagWriter to which the form content is to be written
Returns:
Tag.EVAL_BODY_INCLUDE
Throws:
JspException

autogenerateId

protected String autogenerateId()
                         throws JspException
Autogenerated IDs correspond to the form object name.

Overrides:
autogenerateId in class AbstractDataBoundFormElementTag
Throws:
JspException

resolveModelAttribute

protected String resolveModelAttribute()
                                throws JspException
Resolves and returns the name of the form object.

Throws:
IllegalArgumentException - if the form object resolves to null
JspException

resolveAction

protected String resolveAction()
                        throws JspException
Resolve the value of the 'action' attribute.

If the user configured an 'action' value then the result of evaluating this value is used. Otherwise, the originating URI is used.

Returns:
the value that is to be used for the 'action' attribute
Throws:
JspException

doEndTag

public int doEndTag()
             throws JspException
Closes the 'form' block tag and removes the form object name from the PageContext.

Specified by:
doEndTag in interface Tag
Overrides:
doEndTag in class TagSupport
Throws:
JspException

doFinally

public void doFinally()
Clears the stored TagWriter.

Specified by:
doFinally in interface TryCatchFinally
Overrides:
doFinally in class AbstractDataBoundFormElementTag

resolveCssClass

protected String resolveCssClass()
                          throws JspException
Override resolve CSS class since error class is not supported.

Overrides:
resolveCssClass in class AbstractHtmlElementTag
Throws:
JspException

setPath

public void setPath(String path)
Unsupported for forms.

Overrides:
setPath in class AbstractDataBoundFormElementTag
Throws:
UnsupportedOperationException - always

setCssErrorClass

public void setCssErrorClass(String cssErrorClass)
Unsupported for forms.

Overrides:
setCssErrorClass in class AbstractHtmlElementTag
Throws:
UnsupportedOperationException - always
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HiddenInputTag

org.springframework.web.servlet.tags.form
Class HiddenInputTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapingAwareTag
                extended by  org.springframework.web.servlet.tags.form.AbstractFormTag
                    extended by  org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
                        extended by  org.springframework.web.servlet.tags.form.HiddenInputTag
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag, TryCatchFinally, EditorAwareTag
public class HiddenInputTag
extends AbstractDataBoundFormElementTag

Data-binding aware JSP tag for rendering a hidden HTML 'input' field containing the databound value.

Example (binding to 'name' property of form backing object):

Serialized Form

Field Summary

Fields inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag

COMMAND_NAME_VARIABLE_NAME, NESTED_PATH_VARIABLE_NAME

Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag

logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE

Fields inherited from class javax.servlet.jsp.tagext.TagSupport

pageContext

Fields inherited from interface javax.servlet.jsp.tagext.IterationTag

EVAL_BODY_AGAIN

Fields inherited from interface javax.servlet.jsp.tagext.Tag

EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE

Constructor Summary

HiddenInputTag()

Method Summary

protected  int
writeTagContent(TagWriter tagWriter)

          Writes the HTML 'input' tag to the supplied TagWriter including the
 databound value.

Methods inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag

autogenerateId, doFinally, getBindStatus, getBoundValue, getEditor, getId, getName, getNestedPath, getPath, getPropertyEditor, getPropertyPath, resolveId, setId, setPath, writeDefaultAttributes

Methods inherited from class org.springframework.web.servlet.tags.form.AbstractFormTag

createTagWriter, doStartTagInternal, evaluate, evaluateBoolean, getDisplayString, getDisplayString, isDefaultHtmlEscape, writeOptionalAttribute

Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag

isHtmlEscape, setHtmlEscape

Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag

doCatch, doStartTag, getRequestContext

Methods inherited from class javax.servlet.jsp.tagext.TagSupport

doAfterBody, doEndTag, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValue

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

HiddenInputTag

public HiddenInputTag()

Method Detail

writeTagContent

protected int writeTagContent(TagWriter tagWriter)
                       throws JspException

Writes the HTML 'input' tag to the supplied TagWriter including the
 databound value.

Specified by:
writeTagContent in class AbstractFormTag

Returns:
valid tag render instruction as per Tag.doStartTag().

Throws:

JspException
See Also:
AbstractDataBoundFormElementTag.writeDefaultAttributes(TagWriter),
AbstractDataBoundFormElementTag.getBoundValue()

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


InputTag

org.springframework.web.servlet.tags.form
Class InputTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapingAwareTag
                extended by  org.springframework.web.servlet.tags.form.AbstractFormTag
                    extended by  org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
                        extended by  org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
                            extended by  org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
                                extended by  org.springframework.web.servlet.tags.form.InputTag
All Implemented Interfaces:
Serializable, DynamicAttributes, IterationTag, JspTag, Tag, TryCatchFinally, EditorAwareTag
Direct Known Subclasses:
PasswordInputTag
public class InputTag
extends AbstractHtmlInputElementTag

Data-binding-aware JSP tag for rendering an HTML 'input' element with a 'type' of 'text'.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
See Also:
Serialized Form

Field Summary
static String | ALT_ATTRIBUTE
static String | AUTOCOMPLETE_ATTRIBUTE
static String | MAXLENGTH_ATTRIBUTE
static String | ONSELECT_ATTRIBUTE
static String | READONLY_ATTRIBUTE
static String | SIZE_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
ACCESSKEY_ATTRIBUTE, DISABLED_ATTRIBUTE, ONBLUR_ATTRIBUTE, ONCHANGE_ATTRIBUTE, ONFOCUS_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
CLASS_ATTRIBUTE, DIR_ATTRIBUTE, LANG_ATTRIBUTE, ONCLICK_ATTRIBUTE, ONDBLCLICK_ATTRIBUTE, ONKEYDOWN_ATTRIBUTE, ONKEYPRESS_ATTRIBUTE, ONKEYUP_ATTRIBUTE, ONMOUSEDOWN_ATTRIBUTE, ONMOUSEMOVE_ATTRIBUTE, ONMOUSEOUT_ATTRIBUTE, ONMOUSEOVER_ATTRIBUTE, ONMOUSEUP_ATTRIBUTE, STYLE_ATTRIBUTE, TABINDEX_ATTRIBUTE, TITLE_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
COMMAND_NAME_VARIABLE_NAME, NESTED_PATH_VARIABLE_NAME
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
InputTag()
Method Summary
protected String | getAlt() Get the value of the 'alt' attribute.
protected String | getAutocomplete() Get the value of the 'autocomplete' attribute.
protected String | getMaxlength() Get the value of the 'maxlength' attribute.
protected String | getOnselect() Get the value of the 'onselect' attribute.
protected String | getSize() Get the value of the 'size' attribute.
protected String | getType() Get the value of the 'type' attribute.
void | setAlt(String alt) Set the value of the 'alt' attribute.
void | setAutocomplete(String autocomplete) Set the value of the 'autocomplete' attribute.
void | setMaxlength(String maxlength) Set the value of the 'maxlength' attribute.
void | setOnselect(String onselect) Set the value of the 'onselect' attribute.
void | setSize(String size) Set the value of the 'size' attribute.
protected int | writeTagContent(TagWriter tagWriter) Writes the 'input' tag to the supplied TagWriter.
protected void | writeValue(TagWriter tagWriter) Writes the 'value' attribute to the supplied TagWriter.
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
getAccesskey, getDisabled, getOnblur, getOnchange, getOnfocus, getReadonly, isDisabled, isReadonly, setAccesskey, setDisabled, setOnblur, setOnchange, setOnfocus, setReadonly, writeOptionalAttributes
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
getCssClass, getCssErrorClass, getCssStyle, getDir, getDynamicAttributes, getLang, getOnclick, getOndblclick, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getTabindex, getTitle, resolveCssClass, setCssClass, setCssErrorClass, setCssStyle, setDir, setDynamicAttribute, setLang, setOnclick, setOndblclick, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setTabindex, setTitle, writeDefaultAttributes
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
autogenerateId, doFinally, getBindStatus, getBoundValue, getEditor, getId, getName, getNestedPath, getPath, getPropertyEditor, getPropertyPath, resolveId, setId, setPath
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractFormTag
createTagWriter, doStartTagInternal, evaluate, evaluateBoolean, getDisplayString, getDisplayString, isDefaultHtmlEscape, writeOptionalAttribute
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isHtmlEscape, setHtmlEscape
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doStartTag, getRequestContext
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

SIZE_ATTRIBUTE

public static final String SIZE_ATTRIBUTE
See Also:
Constant Field Values

MAXLENGTH_ATTRIBUTE

public static final String MAXLENGTH_ATTRIBUTE
See Also:
Constant Field Values

ALT_ATTRIBUTE

public static final String ALT_ATTRIBUTE
See Also:
Constant Field Values

ONSELECT_ATTRIBUTE

public static final String ONSELECT_ATTRIBUTE
See Also:
Constant Field Values

READONLY_ATTRIBUTE

public static final String READONLY_ATTRIBUTE
See Also:
Constant Field Values

AUTOCOMPLETE_ATTRIBUTE

public static final String AUTOCOMPLETE_ATTRIBUTE
See Also:
Constant Field Values
Constructor Detail

InputTag

public InputTag()
Method Detail

setSize

public void setSize(String size)
Set the value of the 'size' attribute. May be a runtime expression.

getSize

protected String getSize()
Get the value of the 'size' attribute.

setMaxlength

public void setMaxlength(String maxlength)
Set the value of the 'maxlength' attribute. May be a runtime expression.

getMaxlength

protected String getMaxlength()
Get the value of the 'maxlength' attribute.

setAlt

public void setAlt(String alt)
Set the value of the 'alt' attribute. May be a runtime expression.

getAlt

protected String getAlt()
Get the value of the 'alt' attribute.

setOnselect

public void setOnselect(String onselect)
Set the value of the 'onselect' attribute. May be a runtime expression.

getOnselect

protected String getOnselect()
Get the value of the 'onselect' attribute.

setAutocomplete

public void setAutocomplete(String autocomplete)
Set the value of the 'autocomplete' attribute. May be a runtime expression.

getAutocomplete

protected String getAutocomplete()
Get the value of the 'autocomplete' attribute.

writeTagContent

protected int writeTagContent(TagWriter tagWriter)
                       throws JspException
Writes the 'input' tag to the supplied TagWriter. Uses the value returned by getType() to determine which type of 'input' element to render.

Specified by:
writeTagContent in class AbstractFormTag
Returns:
valid tag render instruction as per Tag.doStartTag().
Throws:
JspException

writeValue

protected void writeValue(TagWriter tagWriter)
                   throws JspException
Writes the 'value' attribute to the supplied TagWriter. Subclasses may choose to override this implementation to control exactly when the value is written.

Throws:
JspException

getType

protected String getType()
Get the value of the 'type' attribute. Subclasses can override this to change the type of 'input' element rendered. Default value is 'text'.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LabelTag

org.springframework.web.servlet.tags.form
Class LabelTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapingAwareTag
                extended by  org.springframework.web.servlet.tags.form.AbstractFormTag
                    extended by  org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
                        extended by  org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
                            extended by  org.springframework.web.servlet.tags.form.LabelTag
All Implemented Interfaces:
Serializable, DynamicAttributes, IterationTag, JspTag, Tag, TryCatchFinally, EditorAwareTag
public class LabelTag
extends AbstractHtmlElementTag

Databinding-aware JSP tag for rendering an HTML 'label' element that defines text that is associated with a single form element.

The 'for' attribute is required.

See the "formTags" showcase application that ships with the full Spring distribution for an example of this class in action.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
See Also:
Serialized Form

Field Summary
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
CLASS_ATTRIBUTE, DIR_ATTRIBUTE, LANG_ATTRIBUTE, ONCLICK_ATTRIBUTE, ONDBLCLICK_ATTRIBUTE, ONKEYDOWN_ATTRIBUTE, ONKEYPRESS_ATTRIBUTE, ONKEYUP_ATTRIBUTE, ONMOUSEDOWN_ATTRIBUTE, ONMOUSEMOVE_ATTRIBUTE, ONMOUSEOUT_ATTRIBUTE, ONMOUSEOVER_ATTRIBUTE, ONMOUSEUP_ATTRIBUTE, STYLE_ATTRIBUTE, TABINDEX_ATTRIBUTE, TITLE_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
COMMAND_NAME_VARIABLE_NAME, NESTED_PATH_VARIABLE_NAME
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
LabelTag()
Method Summary
protected  String autogenerateFor()
Autogenerate the 'for' attribute value for this tag.
 int doEndTag()
Close the 'label' tag.
 void doFinally()
Disposes of the TagWriter instance.
 String getFor()
Get the value of the 'id' attribute.
protected  String getName()
Overrides getName() to always return null, because the 'name' attribute is not supported by the 'label' tag.
protected  String resolveFor()
Determine the 'for' attribute value for this tag, autogenerating one if none specified.
 void setFor(String forId)
Set the value of the 'for' attribute.
protected  int writeTagContent(TagWriter tagWriter)
Writes the opening 'label' tag and forces a block tag so that body content is written correctly.
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
getCssClass, getCssErrorClass, getCssStyle, getDir, getDynamicAttributes, getLang, getOnclick, getOndblclick, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getTabindex, getTitle, resolveCssClass, setCssClass, setCssErrorClass, setCssStyle, setDir, setDynamicAttribute, setLang, setOnclick, setOndblclick, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setTabindex, setTitle, writeDefaultAttributes, writeOptionalAttributes
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
autogenerateId, getBindStatus, getBoundValue, getEditor, getId, getNestedPath, getPath, getPropertyEditor, getPropertyPath, resolveId, setId, setPath
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractFormTag
createTagWriter, doStartTagInternal, evaluate, evaluateBoolean, getDisplayString, getDisplayString, isDefaultHtmlEscape, writeOptionalAttribute
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isHtmlEscape, setHtmlEscape
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doStartTag, getRequestContext
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

LabelTag

public LabelTag()
Method Detail

setFor

public void setFor(String forId)
Set the value of the 'for' attribute.

Defaults to the value of AbstractDataBoundFormElementTag.getPath(); may be a runtime expression.

Throws:
IllegalArgumentException - if the supplied value is null

getFor

public String getFor()
Get the value of the 'id' attribute.

May be a runtime expression.

writeTagContent

protected int writeTagContent(TagWriter tagWriter)
                       throws JspException
Writes the opening 'label' tag and forces a block tag so that body content is written correctly.

Specified by:
writeTagContent in class AbstractFormTag
Returns:
Tag.EVAL_BODY_INCLUDE
Throws:
JspException

getName

protected String getName()
                  throws JspException
Overrides getName() to always return null, because the 'name' attribute is not supported by the 'label' tag.

Overrides:
getName in class AbstractDataBoundFormElementTag
Returns:
the value for the HTML 'name' attribute
Throws:
JspException

resolveFor

protected String resolveFor()
                     throws JspException
Determine the 'for' attribute value for this tag, autogenerating one if none specified.

Throws:
JspException
See Also:
getFor(), autogenerateFor()

autogenerateFor

protected String autogenerateFor()
                          throws JspException
Autogenerate the 'for' attribute value for this tag.

The default implementation delegates to AbstractDataBoundFormElementTag.getPropertyPath(), deleting invalid characters (such as "[" or "]").

Throws:
JspException

doEndTag

public int doEndTag()
             throws JspException
Close the 'label' tag.

Specified by:
doEndTag in interface Tag
Overrides:
doEndTag in class TagSupport
Throws:
JspException

doFinally

public void doFinally()
Disposes of the TagWriter instance.

Specified by:
doFinally in interface TryCatchFinally
Overrides:
doFinally in class AbstractDataBoundFormElementTag
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OptionsTag

org.springframework.web.servlet.tags.form
Class OptionsTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapingAwareTag
                extended by  org.springframework.web.servlet.tags.form.AbstractFormTag
                    extended by  org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
                        extended by  org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
                            extended by  org.springframework.web.servlet.tags.form.OptionsTag
All Implemented Interfaces:
Serializable, DynamicAttributes, IterationTag, JspTag, Tag, TryCatchFinally, EditorAwareTag
public class OptionsTag
extends AbstractHtmlElementTag

Convenient tag that allows one to supply a collection of objects that are to be rendered as 'option' tags within a 'select' tag.

Must be used within a 'select' tag.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller, Scott Andrews
See Also:
Serialized Form

Field Summary
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
CLASS_ATTRIBUTE, DIR_ATTRIBUTE, LANG_ATTRIBUTE, ONCLICK_ATTRIBUTE, ONDBLCLICK_ATTRIBUTE, ONKEYDOWN_ATTRIBUTE, ONKEYPRESS_ATTRIBUTE, ONKEYUP_ATTRIBUTE, ONMOUSEDOWN_ATTRIBUTE, ONMOUSEMOVE_ATTRIBUTE, ONMOUSEOUT_ATTRIBUTE, ONMOUSEOVER_ATTRIBUTE, ONMOUSEUP_ATTRIBUTE, STYLE_ATTRIBUTE, TABINDEX_ATTRIBUTE, TITLE_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
COMMAND_NAME_VARIABLE_NAME, NESTED_PATH_VARIABLE_NAME
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
OptionsTag()
Method Summary
protected BindStatus | getBindStatus() Get the BindStatus for this tag.
protected String | getDisabled() Get the value of the 'disabled' attribute.
protected String | getItemLabel() Get the name of the property mapped to the label (inner text) of the 'option' tag.
protected Object | getItems() Get the Collection, Map or array of objects used to generate the inner 'option' tags.
protected String | getItemValue() Return the name of the property mapped to the 'value' attribute of the 'option' tag.
protected boolean | isDisabled() Is the current HTML tag disabled?
protected String | resolveId() Appends a counter to a specified id, since we're dealing with multiple HTML elements.
void | setDisabled(String disabled) Set the value of the 'disabled' attribute.
void | setItemLabel(String itemLabel) Set the name of the property mapped to the label (inner text) of the 'option' tag.
void | setItems(Object items) Set the Collection, Map or array of objects used to generate the inner 'option' tags.
void | setItemValue(String itemValue) Set the name of the property mapped to the 'value' attribute of the 'option' tag.
protected int | writeTagContent(TagWriter tagWriter) Subclasses should implement this method to perform tag content rendering.
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
getCssClass, getCssErrorClass, getCssStyle, getDir, getDynamicAttributes, getLang, getOnclick, getOndblclick, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getTabindex, getTitle, resolveCssClass, setCssClass, setCssErrorClass, setCssStyle, setDir, setDynamicAttribute, setLang, setOnclick, setOndblclick, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setTabindex, setTitle, writeDefaultAttributes, writeOptionalAttributes
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
autogenerateId, doFinally, getBoundValue, getEditor, getId, getName, getNestedPath, getPath, getPropertyEditor, getPropertyPath, setId, setPath
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractFormTag
createTagWriter, doStartTagInternal, evaluate, evaluateBoolean, getDisplayString, getDisplayString, isDefaultHtmlEscape, writeOptionalAttribute
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isHtmlEscape, setHtmlEscape
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doStartTag, getRequestContext
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OptionsTag

public OptionsTag()
Method Detail

setItems

public void setItems(Object items)
Set the Collection, Map or array of objects used to generate the inner 'option' tags.

Required when wishing to render 'option' tags from an array, Collection or Map.

Typically a runtime expression.

getItems

protected Object getItems()
Get the Collection, Map or array of objects used to generate the inner 'option' tags.

Typically a runtime expression.

setItemValue

public void setItemValue(String itemValue)
Set the name of the property mapped to the 'value' attribute of the 'option' tag.

Required when wishing to render 'option' tags from an array or Collection.

May be a runtime expression.

getItemValue

protected String getItemValue()
Return the name of the property mapped to the 'value' attribute of the 'option' tag.

setItemLabel

public void setItemLabel(String itemLabel)
Set the name of the property mapped to the label (inner text) of the 'option' tag.

May be a runtime expression.

getItemLabel

protected String getItemLabel()
Get the name of the property mapped to the label (inner text) of the 'option' tag.

May be a runtime expression.

setDisabled

public void setDisabled(String disabled)
Set the value of the 'disabled' attribute.

May be a runtime expression.

Parameters:
disabled - the value of the 'disabled' attribute

getDisabled

protected String getDisabled()
Get the value of the 'disabled' attribute.

isDisabled

protected boolean isDisabled()
                      throws JspException
Is the current HTML tag disabled?

Returns:
true if this tag is disabled
Throws:
JspException

writeTagContent

protected int writeTagContent(TagWriter tagWriter)
                       throws JspException
Description copied from class: AbstractFormTag
Subclasses should implement this method to perform tag content rendering.

Specified by:
writeTagContent in class AbstractFormTag
Returns:
valid tag render instruction as per Tag.doStartTag().
Throws:
JspException

resolveId

protected String resolveId()
                    throws JspException
Appends a counter to a specified id, since we're dealing with multiple HTML elements.

Overrides:
resolveId in class AbstractDataBoundFormElementTag
Throws:
JspException
See Also:
AbstractDataBoundFormElementTag.getId(), AbstractDataBoundFormElementTag.autogenerateId()

getBindStatus

protected BindStatus getBindStatus()
Description copied from class: AbstractDataBoundFormElementTag
Get the BindStatus for this tag.

Overrides:
getBindStatus in class AbstractDataBoundFormElementTag
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OptionTag

org.springframework.web.servlet.tags.form
Class OptionTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapingAwareTag
                extended by  org.springframework.web.servlet.tags.form.AbstractFormTag
                    extended by  org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
                        extended by  org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
                            extended by  org.springframework.web.servlet.tags.form.AbstractHtmlElementBodyTag
                                extended by  org.springframework.web.servlet.tags.form.OptionTag
All Implemented Interfaces:
Serializable, BodyTag, DynamicAttributes, IterationTag, JspTag, Tag, TryCatchFinally, EditorAwareTag
public class OptionTag
extends AbstractHtmlElementBodyTag
implements BodyTag

JSP tag for rendering an HTML 'option' tag.

Must be used nested inside a SelectTag.

Provides full support for databinding by marking an 'option' as 'selected' if the value matches the value bound to the out SelectTag.

The value property is required and corresponds to the 'value' attribute of the rendered 'option'.

An optional label property can be specified, the value of which corresponds to inner text of the rendered 'option' tag. If no label is specified then the value property will be used when rendering the inner text.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
See Also:
Serialized Form

Field Summary
static String | DISPLAY_VALUE_VARIABLE_NAME The name of the JSP variable used to expose the display value for this tag.
static String | VALUE_VARIABLE_NAME The name of the JSP variable used to expose the value for this tag.
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
CLASS_ATTRIBUTE, DIR_ATTRIBUTE, LANG_ATTRIBUTE, ONCLICK_ATTRIBUTE, ONDBLCLICK_ATTRIBUTE, ONKEYDOWN_ATTRIBUTE, ONKEYPRESS_ATTRIBUTE, ONKEYUP_ATTRIBUTE, ONMOUSEDOWN_ATTRIBUTE, ONMOUSEMOVE_ATTRIBUTE, ONMOUSEOUT_ATTRIBUTE, ONMOUSEOVER_ATTRIBUTE, ONMOUSEUP_ATTRIBUTE, STYLE_ATTRIBUTE, TABINDEX_ATTRIBUTE, TITLE_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
COMMAND_NAME_VARIABLE_NAME, NESTED_PATH_VARIABLE_NAME
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
OptionTag()
Method Summary
protected  String autogenerateId()
Autogenerate the 'id' attribute value for this tag.
protected  void exposeAttributes()
Called during AbstractHtmlElementBodyTag.writeTagContent(org.springframework.web.servlet.tags.form.TagWriter) allowing subclasses to add any attributes to the PageContext as needed.
protected  BindStatus getBindStatus()
Get the BindStatus for this tag.
protected  String getDisabled()
Get the value of the 'disabled' attribute.
protected  String getLabel()
Get the text body of the rendered HTML <option> tag.
protected  Object getValue()
Get the 'value' attribute of the rendered HTML <option> tag.
protected  boolean isDisabled()
Is the current HTML tag disabled?
protected  void onWriteTagContent()
Make sure we are under a 'select' tag before proceeding.
protected  void removeAttributes()
Called by AbstractHtmlElementBodyTag.doFinally() allowing subclasses to remove any attributes from the PageContext as needed.
protected  void renderDefaultContent(TagWriter tagWriter)
protected  void renderFromBodyContent(BodyContent bodyContent, TagWriter tagWriter)
Render the tag contents based on the supplied BodyContent.
 void setDisabled(String disabled)
Set the value of the 'disabled' attribute.
 void setLabel(String label)
Set the text body of the rendered HTML <option> tag.
 void setValue(Object value)
Set the 'value' attribute of the rendered HTML <option> tag.
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementBodyTag
doEndTag, doFinally, doInitBody, flushBufferedBodyContent, setBodyContent, shouldRender, writeTagContent
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
getCssClass, getCssErrorClass, getCssStyle, getDir, getDynamicAttributes, getLang, getOnclick, getOndblclick, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getTabindex, getTitle, resolveCssClass, setCssClass, setCssErrorClass, setCssStyle, setDir, setDynamicAttribute, setLang, setOnclick, setOndblclick, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setTabindex, setTitle, writeDefaultAttributes, writeOptionalAttributes
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
getBoundValue, getEditor, getId, getName, getNestedPath, getPath, getPropertyEditor, getPropertyPath, resolveId, setId, setPath
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractFormTag
createTagWriter, doStartTagInternal, evaluate, evaluateBoolean, getDisplayString, getDisplayString, isDefaultHtmlEscape, writeOptionalAttribute
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isHtmlEscape, setHtmlEscape
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doStartTag, getRequestContext
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.servlet.jsp.tagext.BodyTag
doInitBody, setBodyContent
Methods inherited from interface javax.servlet.jsp.tagext.IterationTag
doAfterBody
Methods inherited from interface javax.servlet.jsp.tagext.Tag
doEndTag, doStartTag, getParent, release, setPageContext, setParent

Field Detail

VALUE_VARIABLE_NAME

public static final String VALUE_VARIABLE_NAME
The name of the JSP variable used to expose the value for this tag.

See Also:
Constant Field Values

DISPLAY_VALUE_VARIABLE_NAME

public static final String DISPLAY_VALUE_VARIABLE_NAME
The name of the JSP variable used to expose the display value for this tag.

See Also:
Constant Field Values
Constructor Detail

OptionTag

public OptionTag()
Method Detail

setValue

public void setValue(Object value)
Set the 'value' attribute of the rendered HTML <option> tag.

May be a runtime expression.

getValue

protected Object getValue()
Get the 'value' attribute of the rendered HTML <option> tag.

setDisabled

public void setDisabled(String disabled)
Set the value of the 'disabled' attribute.

May be a runtime expression.

Parameters:
disabled - the value of the 'disabled' attribute

getDisabled

protected String getDisabled()
Get the value of the 'disabled' attribute.

isDisabled

protected boolean isDisabled()
                      throws JspException
Is the current HTML tag disabled?

Returns:
true if this tag is disabled
Throws:
JspException

setLabel

public void setLabel(String label)
Set the text body of the rendered HTML <option> tag.

May be a runtime expression.

getLabel

protected String getLabel()
Get the text body of the rendered HTML <option> tag.

renderDefaultContent

protected void renderDefaultContent(TagWriter tagWriter)
                             throws JspException
Specified by:
renderDefaultContent in class AbstractHtmlElementBodyTag
Throws:
JspException

renderFromBodyContent

protected void renderFromBodyContent(BodyContent bodyContent,
                                     TagWriter tagWriter)
                              throws JspException
Description copied from class: AbstractHtmlElementBodyTag
Render the tag contents based on the supplied BodyContent.

The default implementation simply flushes the BodyContent directly to the output. Subclasses may choose to override this to add additional content to the output.

Overrides:
renderFromBodyContent in class AbstractHtmlElementBodyTag
Throws:
JspException

onWriteTagContent

protected void onWriteTagContent()
Make sure we are under a 'select' tag before proceeding.

Overrides:
onWriteTagContent in class AbstractHtmlElementBodyTag

exposeAttributes

protected void exposeAttributes()
                         throws JspException
Description copied from class: AbstractHtmlElementBodyTag
Called during AbstractHtmlElementBodyTag.writeTagContent(org.springframework.web.servlet.tags.form.TagWriter) allowing subclasses to add any attributes to the PageContext as needed.

Overrides:
exposeAttributes in class AbstractHtmlElementBodyTag
Throws:
JspException

getBindStatus

protected BindStatus getBindStatus()
Description copied from class: AbstractDataBoundFormElementTag
Get the BindStatus for this tag.

Overrides:
getBindStatus in class AbstractDataBoundFormElementTag

removeAttributes

protected void removeAttributes()
Description copied from class: AbstractHtmlElementBodyTag
Called by AbstractHtmlElementBodyTag.doFinally() allowing subclasses to remove any attributes from the PageContext as needed.

Overrides:
removeAttributes in class AbstractHtmlElementBodyTag

autogenerateId

protected String autogenerateId()
                         throws JspException
Description copied from class: AbstractDataBoundFormElementTag
Autogenerate the 'id' attribute value for this tag.

The default implementation simply delegates to AbstractDataBoundFormElementTag.getName(), deleting invalid characters (such as "[" or "]").

Overrides:
autogenerateId in class AbstractDataBoundFormElementTag
Throws:
JspException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PasswordInputTag

org.springframework.web.servlet.tags.form
Class PasswordInputTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapingAwareTag
                extended by  org.springframework.web.servlet.tags.form.AbstractFormTag
                    extended by  org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
                        extended by  org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
                            extended by  org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
                                extended by  org.springframework.web.servlet.tags.form.InputTag
                                    extended by  org.springframework.web.servlet.tags.form.PasswordInputTag
All Implemented Interfaces:
Serializable, DynamicAttributes, IterationTag, JspTag, Tag, TryCatchFinally, EditorAwareTag
public class PasswordInputTag
extends InputTag

Databinding-aware JSP tag for rendering an HTML 'input' element with a 'type' of 'password'.

Since:
2.0
Author:
Rob Harrop, Rick Evans
See Also:
Serialized Form

Field Summary
Fields inherited from class org.springframework.web.servlet.tags.form.InputTag
ALT_ATTRIBUTE, AUTOCOMPLETE_ATTRIBUTE, MAXLENGTH_ATTRIBUTE, ONSELECT_ATTRIBUTE, READONLY_ATTRIBUTE, SIZE_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
ACCESSKEY_ATTRIBUTE, DISABLED_ATTRIBUTE, ONBLUR_ATTRIBUTE, ONCHANGE_ATTRIBUTE, ONFOCUS_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
CLASS_ATTRIBUTE, DIR_ATTRIBUTE, LANG_ATTRIBUTE, ONCLICK_ATTRIBUTE, ONDBLCLICK_ATTRIBUTE, ONKEYDOWN_ATTRIBUTE, ONKEYPRESS_ATTRIBUTE, ONKEYUP_ATTRIBUTE, ONMOUSEDOWN_ATTRIBUTE, ONMOUSEMOVE_ATTRIBUTE, ONMOUSEOUT_ATTRIBUTE, ONMOUSEOVER_ATTRIBUTE, ONMOUSEUP_ATTRIBUTE, STYLE_ATTRIBUTE, TABINDEX_ATTRIBUTE, TITLE_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
COMMAND_NAME_VARIABLE_NAME, NESTED_PATH_VARIABLE_NAME
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
PasswordInputTag()
Method Summary
protected String | getType() Return 'password' causing the rendered HTML 'input' element to have a 'type' of 'password'.
boolean | isShowPassword() Is the password value to be rendered?
void | setShowPassword(boolean showPassword) Is the password value to be rendered?
protected void | writeValue(TagWriter tagWriter) The PasswordInputTag only writes it's value if the 'showPassword' property value is true.
Methods inherited from class org.springframework.web.servlet.tags.form.InputTag
getAlt, getAutocomplete, getMaxlength, getOnselect, getSize, setAlt, setAutocomplete, setMaxlength, setOnselect, setSize, writeTagContent
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
getAccesskey, getDisabled, getOnblur, getOnchange, getOnfocus, getReadonly, isDisabled, isReadonly, setAccesskey, setDisabled, setOnblur, setOnchange, setOnfocus, setReadonly, writeOptionalAttributes
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
getCssClass, getCssErrorClass, getCssStyle, getDir, getDynamicAttributes, getLang, getOnclick, getOndblclick, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getTabindex, getTitle, resolveCssClass, setCssClass, setCssErrorClass, setCssStyle, setDir, setDynamicAttribute, setLang, setOnclick, setOndblclick, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setTabindex, setTitle, writeDefaultAttributes
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
autogenerateId, doFinally, getBindStatus, getBoundValue, getEditor, getId, getName, getNestedPath, getPath, getPropertyEditor, getPropertyPath, resolveId, setId, setPath
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractFormTag
createTagWriter, doStartTagInternal, evaluate, evaluateBoolean, getDisplayString, getDisplayString, isDefaultHtmlEscape, writeOptionalAttribute
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isHtmlEscape, setHtmlEscape
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doStartTag, getRequestContext
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PasswordInputTag

public PasswordInputTag()
Method Detail

isShowPassword

public boolean isShowPassword()
Is the password value to be rendered?

Returns:
true if the password value to be rendered.

setShowPassword

public void setShowPassword(boolean showPassword)
Is the password value to be rendered?

Parameters:
showPassword - true if the password value is to be rendered.

getType

protected String getType()
Return 'password' causing the rendered HTML 'input' element to have a 'type' of 'password'.

Overrides:
getType in class InputTag

writeValue

protected void writeValue(TagWriter tagWriter)
                   throws JspException
The PasswordInputTag only writes it's value if the 'showPassword' property value is true.

Overrides:
writeValue in class InputTag
Throws:
JspException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RadioButtonsTag

org.springframework.web.servlet.tags.form
Class RadioButtonsTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapingAwareTag
                extended by  org.springframework.web.servlet.tags.form.AbstractFormTag
                    extended by  org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
                        extended by  org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
                            extended by  org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
                                extended by  org.springframework.web.servlet.tags.form.AbstractCheckedElementTag
                                    extended by  org.springframework.web.servlet.tags.form.AbstractMultiCheckedElementTag
                                        extended by  org.springframework.web.servlet.tags.form.RadioButtonsTag
All Implemented Interfaces:
Serializable, DynamicAttributes, IterationTag, JspTag, Tag, TryCatchFinally, EditorAwareTag
public class RadioButtonsTag
extends AbstractMultiCheckedElementTag

Databinding-aware JSP tag for rendering multiple HTML 'input' elements with a 'type' of 'radio'.

Rendered elements are marked as 'checked' if the configured value matches the bound value.

Since:
2.5
Author:
Thomas Risberg, Juergen Hoeller
See Also:
Serialized Form

Field Summary
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
ACCESSKEY_ATTRIBUTE, DISABLED_ATTRIBUTE, ONBLUR_ATTRIBUTE, ONCHANGE_ATTRIBUTE, ONFOCUS_ATTRIBUTE, READONLY_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
CLASS_ATTRIBUTE, DIR_ATTRIBUTE, LANG_ATTRIBUTE, ONCLICK_ATTRIBUTE, ONDBLCLICK_ATTRIBUTE, ONKEYDOWN_ATTRIBUTE, ONKEYPRESS_ATTRIBUTE, ONKEYUP_ATTRIBUTE, ONMOUSEDOWN_ATTRIBUTE, ONMOUSEMOVE_ATTRIBUTE, ONMOUSEOUT_ATTRIBUTE, ONMOUSEOVER_ATTRIBUTE, ONMOUSEUP_ATTRIBUTE, STYLE_ATTRIBUTE, TABINDEX_ATTRIBUTE, TITLE_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
COMMAND_NAME_VARIABLE_NAME, NESTED_PATH_VARIABLE_NAME
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
RadioButtonsTag()
Method Summary
protected  String getInputType()
Return the type of the HTML input element to generate: "checkbox" or "radio".
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractMultiCheckedElementTag
getDelimiter, getElement, getItemLabel, getItems, getItemValue, resolveId, setDelimiter, setElement, setItemLabel, setItems, setItemValue, writeTagContent
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractCheckedElementTag
autogenerateId, renderFromBoolean, renderFromValue, renderFromValue
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
getAccesskey, getDisabled, getOnblur, getOnchange, getOnfocus, getReadonly, isDisabled, isReadonly, setAccesskey, setDisabled, setOnblur, setOnchange, setOnfocus, setReadonly, writeOptionalAttributes
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
getCssClass, getCssErrorClass, getCssStyle, getDir, getDynamicAttributes, getLang, getOnclick, getOndblclick, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getTabindex, getTitle, resolveCssClass, setCssClass, setCssErrorClass, setCssStyle, setDir, setDynamicAttribute, setLang, setOnclick, setOndblclick, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setTabindex, setTitle, writeDefaultAttributes
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
doFinally, getBindStatus, getBoundValue, getEditor, getId, getName, getNestedPath, getPath, getPropertyEditor, getPropertyPath, setId, setPath
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractFormTag
createTagWriter, doStartTagInternal, evaluate, evaluateBoolean, getDisplayString, getDisplayString, isDefaultHtmlEscape, writeOptionalAttribute
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isHtmlEscape, setHtmlEscape
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doStartTag, getRequestContext
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

RadioButtonsTag

public RadioButtonsTag()
Method Detail

getInputType

protected String getInputType()
Description copied from class: AbstractMultiCheckedElementTag
Return the type of the HTML input element to generate: "checkbox" or "radio".

Specified by:
getInputType in class AbstractMultiCheckedElementTag
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RadioButtonTag

org.springframework.web.servlet.tags.form
Class RadioButtonTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapingAwareTag
                extended by  org.springframework.web.servlet.tags.form.AbstractFormTag
                    extended by  org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
                        extended by  org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
                            extended by  org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
                                extended by  org.springframework.web.servlet.tags.form.AbstractCheckedElementTag
                                    extended by  org.springframework.web.servlet.tags.form.AbstractSingleCheckedElementTag
                                        extended by  org.springframework.web.servlet.tags.form.RadioButtonTag
All Implemented Interfaces:
Serializable, DynamicAttributes, IterationTag, JspTag, Tag, TryCatchFinally, EditorAwareTag
public class RadioButtonTag
extends AbstractSingleCheckedElementTag

Databinding-aware JSP tag for rendering an HTML 'input' element with a 'type' of 'radio'.

Rendered elements are marked as 'checked' if the configured value matches the bound value.

A typical usage pattern will involved multiple tag instances bound to the same property but with different values.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
See Also:
Serialized Form

Field Summary
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
ACCESSKEY_ATTRIBUTE, DISABLED_ATTRIBUTE, ONBLUR_ATTRIBUTE, ONCHANGE_ATTRIBUTE, ONFOCUS_ATTRIBUTE, READONLY_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
CLASS_ATTRIBUTE, DIR_ATTRIBUTE, LANG_ATTRIBUTE, ONCLICK_ATTRIBUTE, ONDBLCLICK_ATTRIBUTE, ONKEYDOWN_ATTRIBUTE, ONKEYPRESS_ATTRIBUTE, ONKEYUP_ATTRIBUTE, ONMOUSEDOWN_ATTRIBUTE, ONMOUSEMOVE_ATTRIBUTE, ONMOUSEOUT_ATTRIBUTE, ONMOUSEOVER_ATTRIBUTE, ONMOUSEUP_ATTRIBUTE, STYLE_ATTRIBUTE, TABINDEX_ATTRIBUTE, TITLE_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
COMMAND_NAME_VARIABLE_NAME, NESTED_PATH_VARIABLE_NAME
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
RadioButtonTag()
Method Summary
protected  void writeTagDetails(TagWriter tagWriter)
Write the details for the given primary tag: i.e.
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractSingleCheckedElementTag
getLabel, getValue, setLabel, setValue, writeTagContent
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractCheckedElementTag
autogenerateId, renderFromBoolean, renderFromValue, renderFromValue
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
getAccesskey, getDisabled, getOnblur, getOnchange, getOnfocus, getReadonly, isDisabled, isReadonly, setAccesskey, setDisabled, setOnblur, setOnchange, setOnfocus, setReadonly, writeOptionalAttributes
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
getCssClass, getCssErrorClass, getCssStyle, getDir, getDynamicAttributes, getLang, getOnclick, getOndblclick, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getTabindex, getTitle, resolveCssClass, setCssClass, setCssErrorClass, setCssStyle, setDir, setDynamicAttribute, setLang, setOnclick, setOndblclick, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setTabindex, setTitle, writeDefaultAttributes
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
doFinally, getBindStatus, getBoundValue, getEditor, getId, getName, getNestedPath, getPath, getPropertyEditor, getPropertyPath, resolveId, setId, setPath
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractFormTag
createTagWriter, doStartTagInternal, evaluate, evaluateBoolean, getDisplayString, getDisplayString, isDefaultHtmlEscape, writeOptionalAttribute
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isHtmlEscape, setHtmlEscape
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doStartTag, getRequestContext
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

RadioButtonTag

public RadioButtonTag()
Method Detail

writeTagDetails

protected void writeTagDetails(TagWriter tagWriter)
                        throws JspException
Description copied from class: AbstractSingleCheckedElementTag
Write the details for the given primary tag: i.e. special attributes and the tag's value.

Specified by:
writeTagDetails in class AbstractSingleCheckedElementTag
Throws:
JspException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SelectTag

org.springframework.web.servlet.tags.form
Class SelectTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapingAwareTag
                extended by  org.springframework.web.servlet.tags.form.AbstractFormTag
                    extended by  org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
                        extended by  org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
                            extended by  org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
                                extended by  org.springframework.web.servlet.tags.form.SelectTag
All Implemented Interfaces:
Serializable, DynamicAttributes, IterationTag, JspTag, Tag, TryCatchFinally, EditorAwareTag
public class SelectTag
extends AbstractHtmlInputElementTag

Databinding-aware JSP tag that renders an HTML 'select' element.

Inner 'option' tags can be rendered using one of the approaches supported by the OptionWriter class.

Also supports the use of nested OptionTags or (typically one) nested OptionsTag.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
See Also:
OptionTag, Serialized Form

Field Summary
static String LIST_VALUE_PAGE_ATTRIBUTE
The PageContext attribute under which the bound value is exposed to inner OptionTags.
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
ACCESSKEY_ATTRIBUTE, DISABLED_ATTRIBUTE, ONBLUR_ATTRIBUTE, ONCHANGE_ATTRIBUTE, ONFOCUS_ATTRIBUTE, READONLY_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
CLASS_ATTRIBUTE, DIR_ATTRIBUTE, LANG_ATTRIBUTE, ONCLICK_ATTRIBUTE, ONDBLCLICK_ATTRIBUTE, ONKEYDOWN_ATTRIBUTE, ONKEYPRESS_ATTRIBUTE, ONKEYUP_ATTRIBUTE, ONMOUSEDOWN_ATTRIBUTE, ONMOUSEMOVE_ATTRIBUTE, ONMOUSEOUT_ATTRIBUTE, ONMOUSEOVER_ATTRIBUTE, ONMOUSEUP_ATTRIBUTE, STYLE_ATTRIBUTE, TABINDEX_ATTRIBUTE, TITLE_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
COMMAND_NAME_VARIABLE_NAME, NESTED_PATH_VARIABLE_NAME
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
SelectTag()
Method Summary
int | doEndTag() Closes any block tag that might have been opened when using nested options.
void | doFinally() Clears the TagWriter that might have been left over when using nested options.
protected String | getItemLabel() Get the value of the 'itemLabel' attribute.
protected Object | getItems() Get the value of the 'items' attribute.
protected String | getItemValue() Get the value of the 'itemValue' attribute.
protected Object | getMultiple() Get the value of the HTML 'multiple' attribute rendered on the final 'select' element.
protected String | getSize() Get the value of the 'size' attribute.
void | setItemLabel(String itemLabel) Set the name of the property mapped to the label (inner text) of the 'option' tag.
void | setItems(Object items) Set the Collection, Map or array of objects used to generate the inner 'option' tags.
void | setItemValue(String itemValue) Set the name of the property mapped to the 'value' attribute of the 'option' tag.
void | setMultiple(Object multiple) Set the value of the HTML 'multiple' attribute rendered on the final 'select' element.
void | setSize(String size) Set the value of the HTML 'size' attribute rendered on the final 'select' element.
protected int | writeTagContent(TagWriter tagWriter) Renders the HTML 'select' tag to the supplied TagWriter.
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
getAccesskey, getDisabled, getOnblur, getOnchange, getOnfocus, getReadonly, isDisabled, isReadonly, setAccesskey, setDisabled, setOnblur, setOnchange, setOnfocus, setReadonly, writeOptionalAttributes
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
getCssClass, getCssErrorClass, getCssStyle, getDir, getDynamicAttributes, getLang, getOnclick, getOndblclick, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getTabindex, getTitle, resolveCssClass, setCssClass, setCssErrorClass, setCssStyle, setDir, setDynamicAttribute, setLang, setOnclick, setOndblclick, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setTabindex, setTitle, writeDefaultAttributes
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
autogenerateId, getBindStatus, getBoundValue, getEditor, getId, getName, getNestedPath, getPath, getPropertyEditor, getPropertyPath, resolveId, setId, setPath
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractFormTag
createTagWriter, doStartTagInternal, evaluate, evaluateBoolean, getDisplayString, getDisplayString, isDefaultHtmlEscape, writeOptionalAttribute
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isHtmlEscape, setHtmlEscape
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doStartTag, getRequestContext
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

LIST_VALUE_PAGE_ATTRIBUTE

public static final String LIST_VALUE_PAGE_ATTRIBUTE
The PageContext attribute under which the bound value is exposed to inner OptionTags.

See Also:
Constant Field Values
Constructor Detail

SelectTag

public SelectTag()
Method Detail

setItems

public void setItems(Object items)
Set the Collection, Map or array of objects used to generate the inner 'option' tags.

Required when wishing to render 'option' tags from an array, Collection or Map.

Typically a runtime expression.

Parameters:
items - the items that comprise the options of this selection

getItems

protected Object getItems()
Get the value of the 'items' attribute.

May be a runtime expression.

setItemValue

public void setItemValue(String itemValue)
Set the name of the property mapped to the 'value' attribute of the 'option' tag.

Required when wishing to render 'option' tags from an array or Collection.

May be a runtime expression.

getItemValue

protected String getItemValue()
Get the value of the 'itemValue' attribute.

May be a runtime expression.

setItemLabel

public void setItemLabel(String itemLabel)
Set the name of the property mapped to the label (inner text) of the 'option' tag.

May be a runtime expression.

getItemLabel

protected String getItemLabel()
Get the value of the 'itemLabel' attribute.

May be a runtime expression.

setSize

public void setSize(String size)
Set the value of the HTML 'size' attribute rendered on the final 'select' element.

May be a runtime expression.

Parameters:
size - the desired value of the 'size' attribute

getSize

protected String getSize()
Get the value of the 'size' attribute.

May be a runtime expression.

setMultiple

public void setMultiple(Object multiple)
Set the value of the HTML 'multiple' attribute rendered on the final 'select' element.

May be a runtime expression.

getMultiple

protected Object getMultiple()
Get the value of the HTML 'multiple' attribute rendered on the final 'select' element.

May be a runtime expression.

writeTagContent

protected int writeTagContent(TagWriter tagWriter)
                       throws JspException
Renders the HTML 'select' tag to the supplied TagWriter.

Renders nested 'option' tags if the items property is set, otherwise exposes the bound value for the nested OptionTags.

Specified by:
writeTagContent in class AbstractFormTag
Returns:
valid tag render instruction as per Tag.doStartTag().
Throws:
JspException

doEndTag

public int doEndTag()
             throws JspException
Closes any block tag that might have been opened when using nested options.

Specified by:
doEndTag in interface Tag
Overrides:
doEndTag in class TagSupport
Throws:
JspException

doFinally

public void doFinally()
Clears the TagWriter that might have been left over when using nested options.

Specified by:
doFinally in interface TryCatchFinally
Overrides:
doFinally in class AbstractDataBoundFormElementTag
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TagWriter

org.springframework.web.servlet.tags.form
Class TagWriter

java.lang.Object
    extended by  org.springframework.web.servlet.tags.form.TagWriter

public class TagWriter
extends Object

Utility class for writing HTML content to a Writer instance.

Intended to support output from JSP tag libraries.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller

Constructor Summary
TagWriter(PageContext pageContext)
Create a new instance of the TagWriter class that writes to the supplied PageContext.
TagWriter(Writer writer)
Create a new instance of the TagWriter class that writes to the supplied Writer.
Method Summary
void | appendValue(String value) Close the current opening tag (if necessary) and appends the supplied value as inner text.
void | endTag() Close the current tag.
void | endTag(boolean enforceClosingTag) Close the current tag, allowing to enforce a full closing tag.
void | forceBlock() Indicate that the currently open tag should be closed and marked as a block level element.
void | startTag(String tagName) Start a new tag with the supplied name.
void | writeAttribute(String attributeName, String attributeValue) Write an HTML attribute with the specified name and value.
void | writeOptionalAttributeValue(String attributeName, String attributeValue) Write an HTML attribute if the supplied value is not null or zero length.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TagWriter

public TagWriter(PageContext pageContext)
Create a new instance of the TagWriter class that writes to the supplied PageContext.

Parameters:
pageContext - the JSP PageContext to obtain the Writer from

TagWriter

public TagWriter(Writer writer)
Create a new instance of the TagWriter class that writes to the supplied Writer.

Parameters:
writer - the Writer to write tag content to
Method Detail

startTag

public void startTag(String tagName)
              throws JspException
Start a new tag with the supplied name. Leaves the tag open so that attributes, inner text or nested tags can be written into it.

Throws:
JspException
See Also:
endTag()

writeAttribute

public void writeAttribute(String attributeName,
                           String attributeValue)
                    throws JspException
Write an HTML attribute with the specified name and value.

Be sure to write all attributes before writing any inner text or nested tags.

Throws:
IllegalStateException - if the opening tag is closed
JspException

writeOptionalAttributeValue

public void writeOptionalAttributeValue(String attributeName,
                                        String attributeValue)
                                 throws JspException
Write an HTML attribute if the supplied value is not null or zero length.

Throws:
JspException
See Also:
writeAttribute(String, String)

appendValue

public void appendValue(String value)
                 throws JspException
Close the current opening tag (if necessary) and appends the supplied value as inner text.

Throws:
IllegalStateException - if no tag is open
JspException

forceBlock

public void forceBlock()
                throws JspException
Indicate that the currently open tag should be closed and marked as a block level element.

Useful when you plan to write additional content in the body outside the context of the current TagWriter.

Throws:
JspException

endTag

public void endTag()
            throws JspException
Close the current tag.

Correctly writes an empty tag if no inner text or nested tags have been written.

Throws:
JspException

endTag

public void endTag(boolean enforceClosingTag)
            throws JspException
Close the current tag, allowing to enforce a full closing tag.

Correctly writes an empty tag if no inner text or nested tags have been written.

Parameters:
enforceClosingTag - whether a full closing tag should be rendered in any case, even in case of a non-block tag
Throws:
JspException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TextareaTag

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.tags.form
Class TextareaTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  org.springframework.web.servlet.tags.RequestContextAwareTag
            extended by  org.springframework.web.servlet.tags.HtmlEscapingAwareTag
                extended by  org.springframework.web.servlet.tags.form.AbstractFormTag
                    extended by  org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
                        extended by  org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
                            extended by  org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
                                extended by  org.springframework.web.servlet.tags.form.TextareaTag
All Implemented Interfaces:
Serializable, DynamicAttributes, IterationTag, JspTag, Tag, TryCatchFinally, EditorAwareTag
public class TextareaTag
extends AbstractHtmlInputElementTag

Databinding-aware JSP tag for rendering an HTML 'textarea'.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
See Also:
Serialized Form

Field Summary
static String | COLS_ATTRIBUTE
static String | ONSELECT_ATTRIBUTE
static String | READONLY_ATTRIBUTE
static String | ROWS_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
ACCESSKEY_ATTRIBUTE, DISABLED_ATTRIBUTE, ONBLUR_ATTRIBUTE, ONCHANGE_ATTRIBUTE, ONFOCUS_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
CLASS_ATTRIBUTE, DIR_ATTRIBUTE, LANG_ATTRIBUTE, ONCLICK_ATTRIBUTE, ONDBLCLICK_ATTRIBUTE, ONKEYDOWN_ATTRIBUTE, ONKEYPRESS_ATTRIBUTE, ONKEYUP_ATTRIBUTE, ONMOUSEDOWN_ATTRIBUTE, ONMOUSEMOVE_ATTRIBUTE, ONMOUSEOUT_ATTRIBUTE, ONMOUSEOVER_ATTRIBUTE, ONMOUSEUP_ATTRIBUTE, STYLE_ATTRIBUTE, TABINDEX_ATTRIBUTE, TITLE_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
COMMAND_NAME_VARIABLE_NAME, NESTED_PATH_VARIABLE_NAME
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
TextareaTag()
Method Summary
protected String | getCols() Get the value of the 'cols' attribute.
protected String | getOnselect() Get the value of the 'onselect' attribute.
protected String | getRows() Get the value of the 'rows' attribute.
void | setCols(String cols) Set the value of the 'cols' attribute.
void | setOnselect(String onselect) Set the value of the 'onselect' attribute.
void | setRows(String rows) Set the value of the 'rows' attribute.
protected int | writeTagContent(TagWriter tagWriter) Subclasses should implement this method to perform tag content rendering.
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
getAccesskey, getDisabled, getOnblur, getOnchange, getOnfocus, getReadonly, isDisabled, isReadonly, setAccesskey, setDisabled, setOnblur, setOnchange, setOnfocus, setReadonly, writeOptionalAttributes
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
getCssClass, getCssErrorClass, getCssStyle, getDir, getDynamicAttributes, getLang, getOnclick, getOndblclick, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getTabindex, getTitle, resolveCssClass, setCssClass, setCssErrorClass, setCssStyle, setDir, setDynamicAttribute, setLang, setOnclick, setOndblclick, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setTabindex, setTitle, writeDefaultAttributes
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
autogenerateId, doFinally, getBindStatus, getBoundValue, getEditor, getId, getName, getNestedPath, getPath, getPropertyEditor, getPropertyPath, resolveId, setId, setPath
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractFormTag
createTagWriter, doStartTagInternal, evaluate, evaluateBoolean, getDisplayString, getDisplayString, isDefaultHtmlEscape, writeOptionalAttribute
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isHtmlEscape, setHtmlEscape
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doStartTag, getRequestContext
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

ROWS_ATTRIBUTE

public static final String ROWS_ATTRIBUTE
See Also:
Constant Field Values

COLS_ATTRIBUTE

public static final String COLS_ATTRIBUTE
See Also:
Constant Field Values

ONSELECT_ATTRIBUTE

public static final String ONSELECT_ATTRIBUTE
See Also:
Constant Field Values

READONLY_ATTRIBUTE

public static final String READONLY_ATTRIBUTE
See Also:
Constant Field Values
Constructor Detail

TextareaTag

public TextareaTag()
Method Detail

setRows

public void setRows(String rows)
Set the value of the 'rows' attribute. May be a runtime expression.

getRows

protected String getRows()
Get the value of the 'rows' attribute.

setCols

public void setCols(String cols)
Set the value of the 'cols' attribute. May be a runtime expression.

getCols

protected String getCols()
Get the value of the 'cols' attribute.

setOnselect

public void setOnselect(String onselect)
Set the value of the 'onselect' attribute. May be a runtime expression.

getOnselect

protected String getOnselect()
Get the value of the 'onselect' attribute.

writeTagContent

protected int writeTagContent(TagWriter tagWriter)
                       throws JspException
Description copied from class: AbstractFormTag
Subclasses should implement this method to perform tag content rendering.

Specified by:
writeTagContent in class AbstractFormTag
Returns:
valid tag render instruction as per Tag.doStartTag().
Throws:
JspException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.servlet.theme

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.servlet.theme

Theme support classes for Spring's web MVC framework.

See:
Description

Class Summary
AbstractThemeResolver | Abstract base class for ThemeResolver implementations.
CookieThemeResolver | Implementation of ThemeResolver that uses a cookie sent back to the user in case of a custom setting, with a fallback to the default theme.
FixedThemeResolver | Implementation of ThemeResolver that simply uses a fixed theme.
SessionThemeResolver | Implementation of ThemeResolver that uses a theme attribute in the user's session in case of a custom setting, with a fallback to the default theme.
ThemeChangeInterceptor | Interceptor that allows for changing the current theme on every request, via a configurable request parameter.

Package org.springframework.web.servlet.theme Description

Theme support classes for Spring's web MVC framework. Provides standard ThemeResolver implementations, and a HandlerInterceptor for theme changes.

  • If you don't provide a bean of one of these classes as themeResolver, a FixedThemeResolver will be provided with the default theme name 'theme'.
  • If you use a defined FixedThemeResolver, you will able to use another theme name for default, but the users will stick on this theme.
  • With a CookieThemeResolver or SessionThemeResolver, you can allow the user to change his current theme.
  • Generally, you will put in the themes resource bundles the paths of CSS files, images and HTML constructs.
  • For retrieving themes data, you can either use the spring:theme tag in JSP or access via the RequestContext for other view technologies.
  • The pagedlist demo application uses themes


org.springframework.web.servlet.theme Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.servlet.theme

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.web.servlet.theme.AbstractThemeResolver (implements org.springframework.web.servlet.ThemeResolver)
      • org.springframework.web.servlet.theme.FixedThemeResolver
      • org.springframework.web.servlet.theme.SessionThemeResolver
    • org.springframework.web.util.CookieGenerator
      • org.springframework.web.servlet.theme.CookieThemeResolver (implements org.springframework.web.servlet.ThemeResolver)
    • org.springframework.web.servlet.handler.HandlerInterceptorAdapter (implements org.springframework.web.servlet.HandlerInterceptor)
      • org.springframework.web.servlet.theme.ThemeChangeInterceptor


AbstractThemeResolver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.theme
Class AbstractThemeResolver

java.lang.Object
    extended by  org.springframework.web.servlet.theme.AbstractThemeResolver
All Implemented Interfaces:
ThemeResolver
Direct Known Subclasses:
FixedThemeResolver, SessionThemeResolver
public abstract class AbstractThemeResolver
extends Object
implements ThemeResolver

Abstract base class for ThemeResolver implementations. Provides support for a default theme name.

Since:
17.06.2003
Author:
Juergen Hoeller, Jean-Pierre Pawlak

Field Summary
static String ORIGINAL_DEFAULT_THEME_NAME
Out-of-the-box value for the default theme name: "theme".
Constructor Summary
AbstractThemeResolver()
Method Summary
String | getDefaultThemeName() Return the name of the default theme.
void | setDefaultThemeName(String defaultThemeName) Set the name of the default theme.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.web.servlet.ThemeResolver
resolveThemeName, setThemeName

Field Detail

ORIGINAL_DEFAULT_THEME_NAME

public static final String ORIGINAL_DEFAULT_THEME_NAME
Out-of-the-box value for the default theme name: "theme".

See Also:
Constant Field Values
Constructor Detail

AbstractThemeResolver

public AbstractThemeResolver()
Method Detail

setDefaultThemeName

public void setDefaultThemeName(String defaultThemeName)
Set the name of the default theme. Out-of-the-box value is "theme".

getDefaultThemeName

public String getDefaultThemeName()
Return the name of the default theme.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


CookieThemeResolver

org.springframework.web.servlet.theme
Class CookieThemeResolver

java.lang.Object
    extended by  org.springframework.web.util.CookieGenerator
        extended by  org.springframework.web.servlet.theme.CookieThemeResolver
All Implemented Interfaces:
ThemeResolver
public class CookieThemeResolver
extends CookieGenerator
implements ThemeResolver

Implementation of ThemeResolver that uses a cookie sent back to the user in case of a custom setting, with a fallback to the default theme. This is particularly useful for stateless applications without user sessions.

Custom controllers can thus override the user's theme by calling setThemeName, e.g. responding to a certain theme change request.

Since:
17.06.2003
Author:
Jean-Pierre Pawlak, Juergen Hoeller
See Also:
setThemeName(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String)

Field Summary
static String | DEFAULT_COOKIE_NAME
static String | ORIGINAL_DEFAULT_THEME_NAME
static String | THEME_REQUEST_ATTRIBUTE_NAME Name of the request attribute that holds the theme name.
Fields inherited from class org.springframework.web.util.CookieGenerator
DEFAULT_COOKIE_MAX_AGE, DEFAULT_COOKIE_PATH, logger
Constructor Summary
CookieThemeResolver()
Method Summary
String | getDefaultThemeName() Return the name of the default theme.
String | resolveThemeName(HttpServletRequest request) Resolve the current theme name via the given request.
void | setDefaultThemeName(String defaultThemeName) Set the name of the default theme.
void | setThemeName(HttpServletRequest request, HttpServletResponse response, String themeName) Set the current theme name to the given one.
Methods inherited from class org.springframework.web.util.CookieGenerator
addCookie, createCookie, getCookieDomain, getCookieMaxAge, getCookieName, getCookiePath, isCookieSecure, removeCookie, setCookieDomain, setCookieMaxAge, setCookieName, setCookiePath, setCookieSecure
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

ORIGINAL_DEFAULT_THEME_NAME

public static final String ORIGINAL_DEFAULT_THEME_NAME
See Also:
Constant Field Values

THEME_REQUEST_ATTRIBUTE_NAME

public static final String THEME_REQUEST_ATTRIBUTE_NAME
Name of the request attribute that holds the theme name. Only used for overriding a cookie value if the theme has been changed in the course of the current request! Use RequestContext.getTheme() to retrieve the current theme in controllers or views.

See Also:
RequestContext.getTheme()

DEFAULT_COOKIE_NAME

public static final String DEFAULT_COOKIE_NAME
Constructor Detail

CookieThemeResolver

public CookieThemeResolver()
Method Detail

setDefaultThemeName

public void setDefaultThemeName(String defaultThemeName)
Set the name of the default theme.

getDefaultThemeName

public String getDefaultThemeName()
Return the name of the default theme.

resolveThemeName

public String resolveThemeName(HttpServletRequest request)
Description copied from interface: ThemeResolver
Resolve the current theme name via the given request. Should return a default theme as fallback in any case.

Specified by:
resolveThemeName in interface ThemeResolver
Parameters:
request - request to be used for resolution
Returns:
the current theme name

setThemeName

public void setThemeName(HttpServletRequest request,
                         HttpServletResponse response,
                         String themeName)
Description copied from interface: ThemeResolver
Set the current theme name to the given one.

Specified by:
setThemeName in interface ThemeResolver
Parameters:
request - request to be used for theme name modification
response - response to be used for theme name modification
themeName - the new theme name
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FixedThemeResolver

org.springframework.web.servlet.theme
Class FixedThemeResolver

java.lang.Object
    extended by  org.springframework.web.servlet.theme.AbstractThemeResolver
        extended by  org.springframework.web.servlet.theme.FixedThemeResolver
All Implemented Interfaces:
ThemeResolver
public class FixedThemeResolver
extends AbstractThemeResolver

Implementation of ThemeResolver that simply uses a fixed theme. The fixed name can be defined via the "defaultThemeName" property.

Note: Does not support setThemeName, as the fixed theme cannot be changed.

Since:
17.06.2003
Author:
Jean-Pierre Pawlak, Juergen Hoeller
See Also:
AbstractThemeResolver.setDefaultThemeName(java.lang.String)

Field Summary
Fields inherited from class org.springframework.web.servlet.theme.AbstractThemeResolver
ORIGINAL_DEFAULT_THEME_NAME
Constructor Summary
FixedThemeResolver()
Method Summary
String | resolveThemeName(HttpServletRequest request) Resolve the current theme name via the given request.
void | setThemeName(HttpServletRequest request, HttpServletResponse response, String themeName) Set the current theme name to the given one.
Methods inherited from class org.springframework.web.servlet.theme.AbstractThemeResolver
getDefaultThemeName, setDefaultThemeName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

FixedThemeResolver

public FixedThemeResolver()
Method Detail

resolveThemeName

public String resolveThemeName(HttpServletRequest request)
Description copied from interface: ThemeResolver
Resolve the current theme name via the given request. Should return a default theme as fallback in any case.

Parameters:
request - request to be used for resolution
Returns:
the current theme name

setThemeName

public void setThemeName(HttpServletRequest request,
                         HttpServletResponse response,
                         String themeName)
Description copied from interface: ThemeResolver
Set the current theme name to the given one.

Parameters:
request - request to be used for theme name modification
response - response to be used for theme name modification
themeName - the new theme name
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SessionThemeResolver

org.springframework.web.servlet.theme
Class SessionThemeResolver

java.lang.Object
    extended by  org.springframework.web.servlet.theme.AbstractThemeResolver
        extended by  org.springframework.web.servlet.theme.SessionThemeResolver
All Implemented Interfaces:
ThemeResolver
public class SessionThemeResolver
extends AbstractThemeResolver

Implementation of ThemeResolver that uses a theme attribute in the user's session in case of a custom setting, with a fallback to the default theme. This is most appropriate if the application needs user sessions anyway.

Custom controllers can override the user's theme by calling setThemeName, e.g. responding to a theme change request.

Since:
17.06.2003
Author:
Jean-Pierre Pawlak, Juergen Hoeller
See Also:
setThemeName(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String)

Field Summary
static String THEME_SESSION_ATTRIBUTE_NAME
Name of the session attribute that holds the theme name.
Fields inherited from class org.springframework.web.servlet.theme.AbstractThemeResolver
ORIGINAL_DEFAULT_THEME_NAME
Constructor Summary
SessionThemeResolver()
Method Summary
String | resolveThemeName(HttpServletRequest request) Resolve the current theme name via the given request.
void | setThemeName(HttpServletRequest request, HttpServletResponse response, String themeName) Set the current theme name to the given one.
Methods inherited from class org.springframework.web.servlet.theme.AbstractThemeResolver
getDefaultThemeName, setDefaultThemeName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

THEME_SESSION_ATTRIBUTE_NAME

public static final String THEME_SESSION_ATTRIBUTE_NAME
Name of the session attribute that holds the theme name. Only used internally by this implementation. Use RequestContext(Utils).getTheme() to retrieve the current theme in controllers or views.

See Also:
RequestContext.getTheme(), RequestContextUtils.getTheme(javax.servlet.http.HttpServletRequest)
Constructor Detail

SessionThemeResolver

public SessionThemeResolver()
Method Detail

resolveThemeName

public String resolveThemeName(HttpServletRequest request)
Description copied from interface: ThemeResolver
Resolve the current theme name via the given request. Should return a default theme as fallback in any case.

Parameters:
request - request to be used for resolution
Returns:
the current theme name

setThemeName

public void setThemeName(HttpServletRequest request,
                         HttpServletResponse response,
                         String themeName)
Description copied from interface: ThemeResolver
Set the current theme name to the given one.

Parameters:
request - request to be used for theme name modification
response - response to be used for theme name modification
themeName - the new theme name
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ThemeChangeInterceptor

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.theme
Class ThemeChangeInterceptor

java.lang.Object
    extended by  org.springframework.web.servlet.handler.HandlerInterceptorAdapter
        extended by  org.springframework.web.servlet.theme.ThemeChangeInterceptor
All Implemented Interfaces:
HandlerInterceptor
public class ThemeChangeInterceptor
extends HandlerInterceptorAdapter

Interceptor that allows for changing the current theme on every request, via a configurable request parameter.

Since:
20.06.2003
Author:
Juergen Hoeller
See Also:
ThemeResolver

Field Summary
static String DEFAULT_PARAM_NAME
Default name of the theme specification parameter: "theme".
Constructor Summary
ThemeChangeInterceptor()
Method Summary
String | getParamName() Return the name of the parameter that contains a theme specification in a theme change request.
boolean | preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) This implementation always returns true.
void | setParamName(String paramName) Set the name of the parameter that contains a theme specification in a theme change request.
Methods inherited from class org.springframework.web.servlet.handler.HandlerInterceptorAdapter
afterCompletion, postHandle
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_PARAM_NAME

public static final String DEFAULT_PARAM_NAME
Default name of the theme specification parameter: "theme".

See Also:
Constant Field Values
Constructor Detail

ThemeChangeInterceptor

public ThemeChangeInterceptor()
Method Detail

setParamName

public void setParamName(String paramName)
Set the name of the parameter that contains a theme specification in a theme change request. Default is "theme".

getParamName

public String getParamName()
Return the name of the parameter that contains a theme specification in a theme change request.

preHandle

public boolean preHandle(HttpServletRequest request,
                         HttpServletResponse response,
                         Object handler)
                  throws ServletException
Description copied from class: HandlerInterceptorAdapter
This implementation always returns true.

Specified by:
preHandle in interface HandlerInterceptor
Overrides:
preHandle in class HandlerInterceptorAdapter
Parameters:
request - current HTTP request
response - current HTTP response
handler - chosen handler to execute, for type and/or instance evaluation
Returns:
true if the execution chain should proceed with the next interceptor or the handler itself. Else, DispatcherServlet assumes that this interceptor has already dealt with the response itself.
Throws:
ServletException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.servlet.view

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.servlet.view

Provides standard View and ViewResolver implementations, including abstract base classes for custom implementations.

See:
Description

Class Summary
AbstractCachingViewResolver | Convenient base class for ViewResolver implementations.
AbstractTemplateView | Adapter base class for template-based view technologies such as Velocity and FreeMarker, with the ability to use request and session attributes in their model and the option to expose helper objects for Spring's Velocity/FreeMarker macro library.
AbstractTemplateViewResolver | Abstract base class for template view resolvers, in particular for Velocity and FreeMarker views.
AbstractUrlBasedView | Abstract base class for URL-based views.
AbstractView | Abstract base class for View implementations.
BeanNameViewResolver | Simple implementation of ViewResolver that interprets a view name as bean name in the current application context, i.e.
ContentNegotiatingViewResolver | Implementation of ViewResolver that resolves a view based on the request file name or Accept header.
DefaultRequestToViewNameTranslator | RequestToViewNameTranslator that simply transforms the URI of the incoming request into a view name.
InternalResourceView | Wrapper for a JSP or other resource within the same web application.
InternalResourceViewResolver | Convenient subclass of UrlBasedViewResolver that supports InternalResourceView (i.e.
JstlView | Specialization of InternalResourceView for JSTL pages, i.e.
RedirectView | View that redirects to an absolute, context relative, or current request relative URL.
ResourceBundleViewResolver | ViewResolver implementation that uses bean definitions in a ResourceBundle, specified by the bundle basename.
UrlBasedViewResolver | Simple implementation of the ViewResolver interface, allowing for direct resolution of symbolic view names to URLs, without explicit mapping definition.
XmlViewResolver | Implementation of ViewResolver that uses bean definitions in an XML file, specified by resource location.

Package org.springframework.web.servlet.view Description

Provides standard View and ViewResolver implementations, including abstract base classes for custom implementations.

Application developers don't usually need to implement views, as the framework provides standard views for JSPs, Velocity, XSLT, etc. However, the ability to implement custom views easily by subclassing the AbstractView class in this package can be very helpful if an application has unusual view requirements.


org.springframework.web.servlet.view Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.servlet.view

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.context.support.ApplicationObjectSupport (implements org.springframework.context.ApplicationContextAware)
      • org.springframework.web.context.support.WebApplicationObjectSupport (implements org.springframework.web.context.ServletContextAware)
        • org.springframework.web.servlet.view.AbstractCachingViewResolver (implements org.springframework.web.servlet.ViewResolver)
          • org.springframework.web.servlet.view.ResourceBundleViewResolver (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.core.Ordered)
          • org.springframework.web.servlet.view.UrlBasedViewResolver (implements org.springframework.core.Ordered)
            • org.springframework.web.servlet.view.AbstractTemplateViewResolver
            • org.springframework.web.servlet.view.InternalResourceViewResolver
          • org.springframework.web.servlet.view.XmlViewResolver (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.core.Ordered)
        • org.springframework.web.servlet.view.AbstractView (implements org.springframework.beans.factory.BeanNameAware, org.springframework.web.servlet.View)
          • org.springframework.web.servlet.view.AbstractUrlBasedView (implements org.springframework.beans.factory.InitializingBean)
            • org.springframework.web.servlet.view.AbstractTemplateView
            • org.springframework.web.servlet.view.InternalResourceView
              • org.springframework.web.servlet.view.JstlView
            • org.springframework.web.servlet.view.RedirectView
        • org.springframework.web.servlet.view.BeanNameViewResolver (implements org.springframework.core.Ordered, org.springframework.web.servlet.ViewResolver)
        • org.springframework.web.servlet.view.ContentNegotiatingViewResolver (implements org.springframework.core.Ordered, org.springframework.web.servlet.ViewResolver)
    • org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator (implements org.springframework.web.servlet.RequestToViewNameTranslator)


AbstractCachingViewResolver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.view
Class AbstractCachingViewResolver

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractCachingViewResolver
All Implemented Interfaces:
ApplicationContextAware, ServletContextAware, ViewResolver
Direct Known Subclasses:
ResourceBundleViewResolver, UrlBasedViewResolver, XmlViewResolver
public abstract class AbstractCachingViewResolver
extends WebApplicationObjectSupport
implements ViewResolver

Convenient base class for ViewResolver implementations. Caches View objects once resolved: This means that view resolution won't be a performance problem, no matter how costly initial view retrieval is.

Subclasses need to implement the loadView(java.lang.String, java.util.Locale) template method, building the View object for a specific view name and locale.

Author:
Rod Johnson, Juergen Hoeller
See Also:
loadView(java.lang.String, java.util.Locale)

Field Summary
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Constructor Summary
AbstractCachingViewResolver()
Method Summary
void | clearCache() Clear the entire view cache, removing all cached view objects.
protected View | createView(String viewName, Locale locale) Create the actual View object.
protected Object | getCacheKey(String viewName, Locale locale) Return the cache key for the given view name and the given locale.
boolean | isCache() Return if caching is enabled.
protected abstract View | loadView(String viewName, Locale locale) Subclasses must implement this method, building a View object for the specified view.
void | removeFromCache(String viewName, Locale locale) Provides functionality to clear the cache for a certain view.
View | resolveViewName(String viewName, Locale locale) Resolve the given view by name.
void | setCache(boolean cache) Enable or disable caching.
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractCachingViewResolver

public AbstractCachingViewResolver()
Method Detail

setCache

public void setCache(boolean cache)
Enable or disable caching.

Default is "true": caching is enabled. Disable this only for debugging and development.

Warning: Disabling caching can severely impact performance.

isCache

public boolean isCache()
Return if caching is enabled.

resolveViewName

public View resolveViewName(String viewName,
                            Locale locale)
                     throws Exception
Description copied from interface: ViewResolver
Resolve the given view by name.

Note: To allow for ViewResolver chaining, a ViewResolver should return null if a view with the given name is not defined in it. However, this is not required: Some ViewResolvers will always attempt to build View objects with the given name, unable to return null (rather throwing an exception when View creation failed).

Specified by:
resolveViewName in interface ViewResolver
Parameters:
viewName - name of the view to resolve
locale - Locale in which to resolve the view. ViewResolvers that support internationalization should respect this.
Returns:
the View object, or null if not found (optional, to allow for ViewResolver chaining)
Throws:
Exception - if the view cannot be resolved (typically in case of problems creating an actual View object)

getCacheKey

protected Object getCacheKey(String viewName,
                             Locale locale)
Return the cache key for the given view name and the given locale.

Default is a String consisting of view name and locale suffix. Can be overridden in subclasses.

Needs to respect the locale in general, as a different locale can lead to a different view resource.

removeFromCache

public void removeFromCache(String viewName,
                            Locale locale)
Provides functionality to clear the cache for a certain view.

This can be handy in case developer are able to modify views (e.g. Velocity templates) at runtime after which you'd need to clear the cache for the specified view.

Parameters:
viewName - the view name for which the cached view object (if any) needs to be removed
locale - the locale for which the view object should be removed

clearCache

public void clearCache()
Clear the entire view cache, removing all cached view objects. Subsequent resolve calls will lead to recreation of demanded view objects.

createView

protected View createView(String viewName,
                          Locale locale)
                   throws Exception
Create the actual View object.

The default implementation delegates to loadView(java.lang.String, java.util.Locale). This can be overridden to resolve certain view names in a special fashion, before delegating to the actual loadView implementation provided by the subclass.

Parameters:
viewName - the name of the view to retrieve
locale - the Locale to retrieve the view for
Returns:
the View instance, or null if not found (optional, to allow for ViewResolver chaining)
Throws:
Exception - if the view couldn't be resolved
See Also:
loadView(java.lang.String, java.util.Locale)

loadView

protected abstract View loadView(String viewName,
                                 Locale locale)
                          throws Exception
Subclasses must implement this method, building a View object for the specified view. The returned View objects will be cached by this ViewResolver base class.

Subclasses are not forced to support internationalization: A subclass that does not may simply ignore the locale parameter.

Parameters:
viewName - the name of the view to retrieve
locale - the Locale to retrieve the view for
Returns:
the View instance, or null if not found (optional, to allow for ViewResolver chaining)
Throws:
Exception - if the view couldn't be resolved
See Also:
resolveViewName(java.lang.String, java.util.Locale)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractTemplateView

org.springframework.web.servlet.view
Class AbstractTemplateView

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
                extended by  org.springframework.web.servlet.view.AbstractUrlBasedView
                    extended by  org.springframework.web.servlet.view.AbstractTemplateView
All Implemented Interfaces:
BeanNameAware, InitializingBean, ApplicationContextAware, ServletContextAware, View
Direct Known Subclasses:
FreeMarkerView, VelocityView
public abstract class AbstractTemplateView
extends AbstractUrlBasedView

Adapter base class for template-based view technologies such as Velocity and FreeMarker, with the ability to use request and session attributes in their model and the option to expose helper objects for Spring's Velocity/FreeMarker macro library.

JSP/JSTL and other view technologies automatically have access to the HttpServletRequest object and thereby the request/session attributes for the current user. Furthermore, they are able to create and cache helper objects as request attributes themselves.

Since:
1.0.2
Author:
Juergen Hoeller, Darren Davison
See Also:
AbstractTemplateViewResolver, VelocityView, FreeMarkerView

Field Summary
static String SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE
Variable name of the RequestContext instance in the template model, available to Spring's macros: e.g.
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
AbstractTemplateView()
Method Summary
protected void | applyContentType(HttpServletResponse response) Apply this view's content type as specified in the "contentType" bean property to the given response.
protected void | renderMergedOutputModel(Map<String,Object> model, HttpServletRequest request, HttpServletResponse response) Subclasses must implement this method to actually render the view.
protected abstract void | renderMergedTemplateModel(Map<String,Object> model, HttpServletRequest request, HttpServletResponse response) Subclasses must implement this method to actually render the view.
void | setAllowRequestOverride(boolean allowRequestOverride) Set whether HttpServletRequest attributes are allowed to override (hide) controller generated model attributes of the same name.
void | setAllowSessionOverride(boolean allowSessionOverride) Set whether HttpSession attributes are allowed to override (hide) controller generated model attributes of the same name.
void | setExposeRequestAttributes(boolean exposeRequestAttributes) Set whether all request attributes should be added to the model prior to merging with the template.
void | setExposeSessionAttributes(boolean exposeSessionAttributes) Set whether all HttpSession attributes should be added to the model prior to merging with the template.
void | setExposeSpringMacroHelpers(boolean exposeSpringMacroHelpers) Set whether to expose a RequestContext for use by Spring's macro library, under the name "springMacroRequestContext".
Methods inherited from class org.springframework.web.servlet.view.AbstractUrlBasedView
afterPropertiesSet, checkResource, getUrl, isUrlRequired, setUrl, toString
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE

public static final String SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE
Variable name of the RequestContext instance in the template model, available to Spring's macros: e.g. for creating BindStatus objects.

See Also:
Constant Field Values
Constructor Detail

AbstractTemplateView

public AbstractTemplateView()
Method Detail

setExposeRequestAttributes

public void setExposeRequestAttributes(boolean exposeRequestAttributes)
Set whether all request attributes should be added to the model prior to merging with the template. Default is "false".

setAllowRequestOverride

public void setAllowRequestOverride(boolean allowRequestOverride)
Set whether HttpServletRequest attributes are allowed to override (hide) controller generated model attributes of the same name. Default is "false", which causes an exception to be thrown if request attributes of the same name as model attributes are found.

setExposeSessionAttributes

public void setExposeSessionAttributes(boolean exposeSessionAttributes)
Set whether all HttpSession attributes should be added to the model prior to merging with the template. Default is "false".

setAllowSessionOverride

public void setAllowSessionOverride(boolean allowSessionOverride)
Set whether HttpSession attributes are allowed to override (hide) controller generated model attributes of the same name. Default is "false", which causes an exception to be thrown if session attributes of the same name as model attributes are found.

setExposeSpringMacroHelpers

public void setExposeSpringMacroHelpers(boolean exposeSpringMacroHelpers)
Set whether to expose a RequestContext for use by Spring's macro library, under the name "springMacroRequestContext". Default is "true".

Currently needed for Spring's Velocity and FreeMarker default macros. Note that this is not required for templates that use HTML forms unless you wish to take advantage of the Spring helper macros.

See Also:
SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE

renderMergedOutputModel

protected final void renderMergedOutputModel(Map<String,Object> model,
                                             HttpServletRequest request,
                                             HttpServletResponse response)
                                      throws Exception
Description copied from class: AbstractView
Subclasses must implement this method to actually render the view.

The first step will be preparing the request: In the JSP case, this would mean setting model objects as request attributes. The second step will be the actual rendering of the view, for example including the JSP via a RequestDispatcher.

Specified by:
renderMergedOutputModel in class AbstractView
Parameters:
model - combined output Map (never null), with dynamic values taking precedence over static attributes
request - current HTTP request
response - current HTTP response
Throws:
Exception - if rendering failed

applyContentType

protected void applyContentType(HttpServletResponse response)
Apply this view's content type as specified in the "contentType" bean property to the given response.

When running on Servlet 2.4, only applies the view's contentType if no content type has been set on the response before. This allows handlers to override the default content type beforehand.

Parameters:
response - current HTTP response
See Also:
AbstractView.setContentType(java.lang.String)

renderMergedTemplateModel

protected abstract void renderMergedTemplateModel(Map<String,Object> model,
                                                  HttpServletRequest request,
                                                  HttpServletResponse response)
                                           throws Exception
Subclasses must implement this method to actually render the view.

Parameters:
model - combined output Map, with request attributes and session attributes merged into it if required
request - current HTTP request
response - current HTTP response
Throws:
Exception - if rendering failed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractTemplateViewResolver

org.springframework.web.servlet.view
Class AbstractTemplateViewResolver

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractCachingViewResolver
                extended by  org.springframework.web.servlet.view.UrlBasedViewResolver
                    extended by  org.springframework.web.servlet.view.AbstractTemplateViewResolver
All Implemented Interfaces:
ApplicationContextAware, Ordered, ServletContextAware, ViewResolver
Direct Known Subclasses:
FreeMarkerViewResolver, VelocityViewResolver
public class AbstractTemplateViewResolver
extends UrlBasedViewResolver

Abstract base class for template view resolvers, in particular for Velocity and FreeMarker views.

Provides a convenient way to specify AbstractTemplateView's exposure flags for request attributes, session attributes, and Spring's macro helpers.

Since:
1.1
Author:
Juergen Hoeller
See Also:
AbstractTemplateView, VelocityViewResolver, FreeMarkerViewResolver

Field Summary
Fields inherited from class org.springframework.web.servlet.view.UrlBasedViewResolver
FORWARD_URL_PREFIX, REDIRECT_URL_PREFIX
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
AbstractTemplateViewResolver()
Method Summary
protected AbstractUrlBasedView | buildView(String viewName) Creates a new View instance of the specified view class and configures it.
protected Class | requiredViewClass() Return the required type of view for this resolver.
void | setAllowRequestOverride(boolean allowRequestOverride) Set whether HttpServletRequest attributes are allowed to override (hide) controller generated model attributes of the same name.
void | setAllowSessionOverride(boolean allowSessionOverride) Set whether HttpSession attributes are allowed to override (hide) controller generated model attributes of the same name.
void | setExposeRequestAttributes(boolean exposeRequestAttributes) Set whether all request attributes should be added to the model prior to merging with the template.
void | setExposeSessionAttributes(boolean exposeSessionAttributes) Set whether all HttpSession attributes should be added to the model prior to merging with the template.
void | setExposeSpringMacroHelpers(boolean exposeSpringMacroHelpers) Set whether to expose a RequestContext for use by Spring's macro library, under the name "springMacroRequestContext".
Methods inherited from class org.springframework.web.servlet.view.UrlBasedViewResolver
canHandle, createView, getAttributesMap, getCacheKey, getContentType, getOrder, getPrefix, getRequestContextAttribute, getSuffix, getViewClass, getViewNames, initApplicationContext, isRedirectContextRelative, isRedirectHttp10Compatible, loadView, setAttributes, setAttributesMap, setContentType, setOrder, setPrefix, setRedirectContextRelative, setRedirectHttp10Compatible, setRequestContextAttribute, setSuffix, setViewClass, setViewNames
Methods inherited from class org.springframework.web.servlet.view.AbstractCachingViewResolver
clearCache, isCache, removeFromCache, resolveViewName, setCache
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractTemplateViewResolver

public AbstractTemplateViewResolver()
Method Detail

requiredViewClass

protected Class requiredViewClass()
Description copied from class: UrlBasedViewResolver
Return the required type of view for this resolver. This implementation returns AbstractUrlBasedView.

Overrides:
requiredViewClass in class UrlBasedViewResolver
See Also:
AbstractUrlBasedView

setExposeRequestAttributes

public void setExposeRequestAttributes(boolean exposeRequestAttributes)
Set whether all request attributes should be added to the model prior to merging with the template. Default is "false".

See Also:
AbstractTemplateView.setExposeRequestAttributes(boolean)

setAllowRequestOverride

public void setAllowRequestOverride(boolean allowRequestOverride)
Set whether HttpServletRequest attributes are allowed to override (hide) controller generated model attributes of the same name. Default is "false", which causes an exception to be thrown if request attributes of the same name as model attributes are found.

See Also:
AbstractTemplateView.setAllowRequestOverride(boolean)

setExposeSessionAttributes

public void setExposeSessionAttributes(boolean exposeSessionAttributes)
Set whether all HttpSession attributes should be added to the model prior to merging with the template. Default is "false".

See Also:
AbstractTemplateView.setExposeSessionAttributes(boolean)

setAllowSessionOverride

public void setAllowSessionOverride(boolean allowSessionOverride)
Set whether HttpSession attributes are allowed to override (hide) controller generated model attributes of the same name. Default is "false", which causes an exception to be thrown if session attributes of the same name as model attributes are found.

See Also:
AbstractTemplateView.setAllowSessionOverride(boolean)

setExposeSpringMacroHelpers

public void setExposeSpringMacroHelpers(boolean exposeSpringMacroHelpers)
Set whether to expose a RequestContext for use by Spring's macro library, under the name "springMacroRequestContext". Default is "true".

See Also:
AbstractTemplateView.setExposeSpringMacroHelpers(boolean)

buildView

protected AbstractUrlBasedView buildView(String viewName)
                                  throws Exception
Description copied from class: UrlBasedViewResolver
Creates a new View instance of the specified view class and configures it. Does not perform any lookup for pre-defined View instances.

Spring lifecycle methods as defined by the bean container do not have to be called here; those will be applied by the loadView method after this method returns.

Subclasses will typically call super.buildView(viewName) first, before setting further properties themselves. loadView will then apply Spring lifecycle methods at the end of this process.

Overrides:
buildView in class UrlBasedViewResolver
Parameters:
viewName - the name of the view to build
Returns:
the View instance
Throws:
Exception - if the view couldn't be resolved
See Also:
UrlBasedViewResolver.loadView(String, java.util.Locale)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractUrlBasedView

org.springframework.web.servlet.view
Class AbstractUrlBasedView

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
                extended by  org.springframework.web.servlet.view.AbstractUrlBasedView
All Implemented Interfaces:
BeanNameAware, InitializingBean, ApplicationContextAware, ServletContextAware, View
Direct Known Subclasses:
AbstractJasperReportsView, AbstractPdfStamperView, AbstractTemplateView, InternalResourceView, RedirectView, TilesView, XsltView
public abstract class AbstractUrlBasedView
extends AbstractView
implements InitializingBean

Abstract base class for URL-based views. Provides a consistent way of holding the URL that a View wraps, in the form of a "url" bean property.

Since:
13.12.2003
Author:
Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
protected | AbstractUrlBasedView() Constructor for use as a bean.
protected | AbstractUrlBasedView(String url) Create a new AbstractUrlBasedView with the given URL.
Method Summary
void | afterPropertiesSet() Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
boolean | checkResource(Locale locale) Check whether the underlying resource that the configured URL points to actually exists.
String | getUrl() Return the URL of the resource that this view wraps.
protected boolean | isUrlRequired() Return whether the 'url' property is required.
void | setUrl(String url) Set the URL of the resource that this view wraps.
String | toString()
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, renderMergedOutputModel, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AbstractUrlBasedView

protected AbstractUrlBasedView()
Constructor for use as a bean.

AbstractUrlBasedView

protected AbstractUrlBasedView(String url)
Create a new AbstractUrlBasedView with the given URL.

Parameters:
url - the URL to forward to
Method Detail

setUrl

public void setUrl(String url)
Set the URL of the resource that this view wraps. The URL must be appropriate for the concrete View implementation.

getUrl

public String getUrl()
Return the URL of the resource that this view wraps.

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception - in the event of misconfiguration (such as failure to set an essential property) or if initialization fails.

isUrlRequired

protected boolean isUrlRequired()
Return whether the 'url' property is required.

The default implementation returns true

checkResource

public boolean checkResource(Locale locale)
                      throws Exception
Check whether the underlying resource that the configured URL points to actually exists.

Parameters:
locale - the desired Locale that we're looking for
Returns:
true if the resource exists (or is assumed to exist); false if we know that it does not exist
Throws:
Exception - if the resource exists but is invalid (e.g. could not be parsed)

toString

public String toString()
Overrides:
toString in class AbstractView
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


AbstractView

org.springframework.web.servlet.view
Class AbstractView

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
All Implemented Interfaces:
BeanNameAware, ApplicationContextAware, ServletContextAware, View
Direct Known Subclasses:
AbstractExcelView, AbstractFeedView, AbstractJExcelView, AbstractPdfView, AbstractUrlBasedView, AbstractXsltView, MappingJacksonJsonView, MarshallingView
public abstract class AbstractView
extends WebApplicationObjectSupport
implements View, BeanNameAware

Abstract base class for View implementations. Subclasses should be JavaBeans, to allow for convenient configuration as Spring-managed bean instances.

Provides support for static attributes, to be made available to the view, with a variety of ways to specify them. Static attributes will be merged with the given dynamic attributes (the model that the controller returned) for each render operation.

Extends WebApplicationObjectSupport, which will be helpful to some views. Subclasses just need to implement the actual rendering.

Author:
Rod Johnson, Juergen Hoeller
See Also:
setAttributes(java.util.Properties),
setAttributesMap(java.util.Map),
renderMergedOutputModel(java.util.Map, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

Field Summary
static String DEFAULT_CONTENT_TYPE
Default content type.
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
AbstractView()
Method Summary
void | addStaticAttribute(String name, Object value) Add static data to this view, exposed in each view.
protected RequestContext | createRequestContext(HttpServletRequest request, HttpServletResponse response, Map<String,Object> model) Create a RequestContext to expose under the specified attribute name.
protected ByteArrayOutputStream | createTemporaryOutputStream() Create a temporary OutputStream for this view.
protected void | exposeModelAsRequestAttributes(Map<String,Object> model, HttpServletRequest request) Expose the model objects in the given map as request attributes.
protected boolean | generatesDownloadContent() Return whether this view generates download content (typically binary content like PDF or Excel files).
Map<String,Object> | getAttributesMap() Allow Map access to the static attributes of this view, with the option to add or override specific entries.
String | getBeanName() Return the view's name.
String | getContentType() Return the content type for this view.
String | getRequestContextAttribute() Return the name of the RequestContext attribute, if any.
Map | getStaticAttributes() Return the static attributes for this view.
protected void | prepareResponse(HttpServletRequest request, HttpServletResponse response) Prepare the given response for rendering.
void | render(Map<String,?> model, HttpServletRequest request, HttpServletResponse response) Prepares the view given the specified model, merging it with static attributes and a RequestContext attribute, if necessary.
protected abstract void | renderMergedOutputModel(Map<String,Object> model, HttpServletRequest request, HttpServletResponse response) Subclasses must implement this method to actually render the view.
void | setAttributes(Properties attributes) Set static attributes for this view from a java.util.Properties object.
void | setAttributesCSV(String propString) Set static attributes as a CSV string.
void | setAttributesMap(Map<String,?> attributes) Set static attributes for this view from a Map.
void | setBeanName(String beanName) Set the view's name.
void | setContentType(String contentType) Set the content type for this view.
void | setRequestContextAttribute(String requestContextAttribute) Set the name of the RequestContext attribute for this view.
String | toString()
protected void | writeToResponse(HttpServletResponse response, ByteArrayOutputStream baos) Write the given temporary OutputStream to the HTTP response.
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

DEFAULT_CONTENT_TYPE

public static final String DEFAULT_CONTENT_TYPE
Default content type. Overridable as bean property.

See Also:
Constant Field Values
Constructor Detail

AbstractView

public AbstractView()
Method Detail

setBeanName

public void setBeanName(String beanName)
Set the view's name. Helpful for traceability.

Framework code must call this when constructing views.

Specified by:
setBeanName in interface BeanNameAware
Parameters:
beanName - the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use the BeanFactoryUtils.originalBeanName(String) method to extract the original bean name (without suffix), if desired.

getBeanName

public String getBeanName()
Return the view's name. Should never be null, if the view was correctly configured.

setContentType

public void setContentType(String contentType)
Set the content type for this view. Default is "text/html;charset=ISO-8859-1".

May be ignored by subclasses if the view itself is assumed to set the content type, e.g. in case of JSPs.

getContentType

public String getContentType()
Return the content type for this view.

Specified by:
getContentType in interface View
Returns:
the content type String (optionally including a character set), or null if not predetermined.

setRequestContextAttribute

public void setRequestContextAttribute(String requestContextAttribute)
Set the name of the RequestContext attribute for this view. Default is none.

getRequestContextAttribute

public String getRequestContextAttribute()
Return the name of the RequestContext attribute, if any.

setAttributesCSV

public void setAttributesCSV(String propString)
                      throws IllegalArgumentException
Set static attributes as a CSV string. Format is: attname0={value1},attname1={value1}

"Static" attributes are fixed attributes that are specified in the View instance configuration. "Dynamic" attributes, on the other hand, are values passed in as part of the model.

Throws:
IllegalArgumentException

setAttributes

public void setAttributes(Properties attributes)
Set static attributes for this view from a java.util.Properties object.

"Static" attributes are fixed attributes that are specified in the View instance configuration. "Dynamic" attributes, on the other hand, are values passed in as part of the model.

This is the most convenient way to set static attributes. Note that static attributes can be overridden by dynamic attributes, if a value with the same name is included in the model.

Can be populated with a String "value" (parsed via PropertiesEditor) or a "props" element in XML bean definitions.

See Also:
PropertiesEditor

setAttributesMap

public void setAttributesMap(Map<String,?> attributes)
Set static attributes for this view from a Map. This allows to set any kind of attribute values, for example bean references.

"Static" attributes are fixed attributes that are specified in the View instance configuration. "Dynamic" attributes, on the other hand, are values passed in as part of the model.

Can be populated with a "map" or "props" element in XML bean definitions.

Parameters:
attributes - Map with name Strings as keys and attribute objects as values

getAttributesMap

public Map<String,Object> getAttributesMap()
Allow Map access to the static attributes of this view, with the option to add or override specific entries.

Useful for specifying entries directly, for example via "attributesMap[myKey]". This is particularly useful for adding or overriding entries in child view definitions.

addStaticAttribute

public void addStaticAttribute(String name,
                               Object value)
Add static data to this view, exposed in each view.

"Static" attributes are fixed attributes that are specified in the View instance configuration. "Dynamic" attributes, on the other hand, are values passed in as part of the model.

Must be invoked before any calls to render.

Parameters:
name - the name of the attribute to expose
value - the attribute value to expose
See Also:
render(java.util.Map, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

getStaticAttributes

public Map getStaticAttributes()
Return the static attributes for this view. Handy for testing.

Returns an unmodifiable Map, as this is not intended for manipulating the Map but rather just for checking the contents.

Returns:
the static attributes in this view

render

public void render(Map<String,?> model,
                   HttpServletRequest request,
                   HttpServletResponse response)
            throws Exception
Prepares the view given the specified model, merging it with static attributes and a RequestContext attribute, if necessary. Delegates to renderMergedOutputModel for the actual rendering.

Specified by:
render in interface View
Parameters:
model - Map with name Strings as keys and corresponding model objects as values (Map can also be null in case of empty model)
request - current HTTP request
response - HTTP response we are building
Throws:
Exception - if rendering failed
See Also:
renderMergedOutputModel(java.util.Map, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

createRequestContext

protected RequestContext createRequestContext(HttpServletRequest request,
                                              HttpServletResponse response,
                                              Map<String,Object> model)
Create a RequestContext to expose under the specified attribute name.

Default implementation creates a standard RequestContext instance for the given request and model. Can be overridden in subclasses for custom instances.

Parameters:
request - current HTTP request
model - combined output Map (never null), with dynamic values taking precedence over static attributes
Returns:
the RequestContext instance
See Also:
setRequestContextAttribute(java.lang.String), RequestContext

prepareResponse

protected void prepareResponse(HttpServletRequest request,
                               HttpServletResponse response)
Prepare the given response for rendering.

The default implementation applies a workaround for an IE bug when sending download content via HTTPS.

Parameters:
request - current HTTP request
response - current HTTP response

generatesDownloadContent

protected boolean generatesDownloadContent()
Return whether this view generates download content (typically binary content like PDF or Excel files).

The default implementation returns false. Subclasses are encouraged to return true here if they know that they are generating download content that requires temporary caching on the client side, typically via the response OutputStream.

See Also:
prepareResponse(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), ServletResponse.getOutputStream()

renderMergedOutputModel

protected abstract void renderMergedOutputModel(Map<String,Object> model,
                                                HttpServletRequest request,
                                                HttpServletResponse response)
                                         throws Exception
Subclasses must implement this method to actually render the view.

The first step will be preparing the request: In the JSP case, this would mean setting model objects as request attributes. The second step will be the actual rendering of the view, for example including the JSP via a RequestDispatcher.

Parameters:
model - combined output Map (never null), with dynamic values taking precedence over static attributes
request - current HTTP request
response - current HTTP response
Throws:
Exception - if rendering failed

exposeModelAsRequestAttributes

protected void exposeModelAsRequestAttributes(Map<String,Object> model,
                                              HttpServletRequest request)
                                       throws Exception
Expose the model objects in the given map as request attributes. Names will be taken from the model Map. This method is suitable for all resources reachable by RequestDispatcher.

Parameters:
model - Map of model objects to expose
request - current HTTP request
Throws:
Exception

createTemporaryOutputStream

protected ByteArrayOutputStream createTemporaryOutputStream()
Create a temporary OutputStream for this view.

This is typically used as IE workaround, for setting the content length header from the temporary stream before actually writing the content to the HTTP response.

writeToResponse

protected void writeToResponse(HttpServletResponse response,
                               ByteArrayOutputStream baos)
                        throws IOException
Write the given temporary OutputStream to the HTTP response.

Parameters:
response - current HTTP response
baos - the temporary OutputStream to write
Throws:
IOException - if writing/flushing failed

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanNameViewResolver

org.springframework.web.servlet.view
Class BeanNameViewResolver

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.BeanNameViewResolver
All Implemented Interfaces:
ApplicationContextAware, Ordered, ServletContextAware, ViewResolver
public class BeanNameViewResolver
extends WebApplicationObjectSupport
implements ViewResolver, Ordered

Simple implementation of ViewResolver that interprets a view name as bean name in the current application context, i.e. in the XML file of the executing DispatcherServlet.

This resolver can be handy for small applications, keeping all definitions ranging from controllers to views in the same place. For normal applications, XmlViewResolver will be the better choice, as it separates the XML view bean definitions into a dedicated views file. View beans should virtually never have references to any other application beans - such a separation will make this clear.

This ViewResolver does not support internationalization. Conside ResourceBundleViewResolver if you need to apply different view resources per locale.

Note: This ViewResolver implements the Ordered interface to allow for flexible participation in ViewResolver chaining. For example, some special views could be defined via this ViewResolver (giving it 0 as "order" value), while all remaining views could be resolved by a UrlBasedViewResolver.

Since:
18.06.2003
Author:
Juergen Hoeller
See Also:
XmlViewResolver, ResourceBundleViewResolver, UrlBasedViewResolver

Field Summary
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
BeanNameViewResolver()
Method Summary
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
View | resolveViewName(String viewName, Locale locale) Resolve the given view by name.
void | setOrder(int order)
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BeanNameViewResolver

public BeanNameViewResolver()
Method Detail

setOrder

public void setOrder(int order)

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

resolveViewName

public View resolveViewName(String viewName,
                            Locale locale)
                     throws BeansException
Description copied from interface: ViewResolver
Resolve the given view by name.

Note: To allow for ViewResolver chaining, a ViewResolver should return null if a view with the given name is not defined in it. However, this is not required: Some ViewResolvers will always attempt to build View objects with the given name, unable to return null (rather throwing an exception when View creation failed).

Specified by:
resolveViewName in interface ViewResolver
Parameters:
viewName - name of the view to resolve
locale - Locale in which to resolve the view. ViewResolvers that support internationalization should respect this.
Returns:
the View object, or null if not found (optional, to allow for ViewResolver chaining)
Throws:
BeansException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ContentNegotiatingViewResolver

org.springframework.web.servlet.view
Class ContentNegotiatingViewResolver

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.ContentNegotiatingViewResolver
All Implemented Interfaces:
ApplicationContextAware, Ordered, ServletContextAware, ViewResolver
public class ContentNegotiatingViewResolver
extends WebApplicationObjectSupport
implements ViewResolver, Ordered

Implementation of ViewResolver that resolves a view based on the request file name or Accept header.

The ContentNegotiatingViewResolver does not resolve views itself, but delegates to other ViewResolvers. By default, these other view resolvers are picked up automatically from the application context, though they can also be set explicitly by using the viewResolvers property. Note that in order for this view resolver to work properly, the order property needs to be set to a higher precedence than the others (the default is Ordered.HIGHEST_PRECEDENCE.)

This view resolver uses the requested media type to select a suitable View for a request. This media type is determined by using the following criteria:

  1. If the requested path has a file extension and if the setFavorPathExtension(boolean) property is true, the mediaTypes property is inspected for a matching media type.
  2. If the request contains a parameter defining the extension and if the setFavorParameter(boolean) property is true, the mediaTypes property is inspected for a matching media type. The default name of the parameter is format and it can be configured using the parameterName property.
  3. If there is no match in the mediaTypes property and if the Java Activation Framework (JAF) is present on the class path, FileTypeMap.getContentType(String) is used instead.
  4. If the previous steps did not result in a media type, and ignoreAcceptHeader is false, the request Accept header is used.
Once the requested media type has been determined, this resolver queries each delegate view resolver for a View and determines if the requested media type is compatible with the view's content type). The most compatible view is returned.

Additionally, this view resolver exposes the defaultViews property, allowing you to override the views provided by the view resolvers. Note that these default views are offered as candicates, and still need have the content type requested (via file extension, parameter, or Accept header, described above). You can also set the default content type directly, which will be returned when the other mechanisms (Accept header, file extension or parameter) do not result in a match.

For example, if the request path is /view.html, this view resolver will look for a view that has the text/html content type (based on the html file extension). A request for /view with a text/html request Accept header has the same result.

Since:
3.0
Author:
Arjen Poutsma, Juergen Hoeller
See Also:
ViewResolver, InternalResourceViewResolver, BeanNameViewResolver

Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
ContentNegotiatingViewResolver()
Method Summary
protected MediaType | getMediaTypeFromFilename(String filename) Determines the MediaType for the given filename.
protected MediaType | getMediaTypeFromParameter(String parameterValue) Determines the MediaType for the given parameter value.
protected List<MediaType> | getMediaTypes(HttpServletRequest request) Determines the list of MediaType for the given HttpServletRequest.
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
protected void | initServletContext(ServletContext servletContext) Subclasses may override this for custom initialization based on the ServletContext that this application object runs in.
View | resolveViewName(String viewName, Locale locale) Resolve the given view by name.
void | setDefaultContentType(MediaType defaultContentType) Sets the default content type.
void | setDefaultViews(List<View> defaultViews) Sets the default views to use when a more specific view can not be obtained from the ViewResolver chain.
void | setFavorParameter(boolean favorParameter) Indicates whether a request parameter should be used to determine the requested media type, in favor of looking at the Accept header.
void | setFavorPathExtension(boolean favorPathExtension) Indicates whether the extension of the request path should be used to determine the requested media type, in favor of looking at the Accept header.
void | setIgnoreAcceptHeader(boolean ignoreAcceptHeader) Indicates whether the HTTP Accept header should be ignored.
void | setMediaTypes(Map<String,String> mediaTypes) Sets the mapping from file extensions to media types.
void | setOrder(int order)
void | setParameterName(String parameterName) Sets the parameter name that can be used to determine the requested media type if the setFavorParameter(boolean) property is true.
void | setUseNotAcceptableStatusCode(boolean useNotAcceptableStatusCode) Indicates whether a 406 Not Acceptable status code should be returned if no suitable view can be found.
void | setViewResolvers(List<ViewResolver> viewResolvers) Sets the view resolvers to be wrapped by this view resolver.
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ContentNegotiatingViewResolver

public ContentNegotiatingViewResolver()
Method Detail

setOrder

public void setOrder(int order)

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

setFavorPathExtension

public void setFavorPathExtension(boolean favorPathExtension)
Indicates whether the extension of the request path should be used to determine the requested media type, in favor of looking at the Accept header. The default value is true.

For instance, when this flag is true (the default), a request for /hotels.pdf will result in an AbstractPdfView being resolved, while the Accept header can be the browser-defined text/html,application/xhtml+xml.

setFavorParameter

public void setFavorParameter(boolean favorParameter)
Indicates whether a request parameter should be used to determine the requested media type, in favor of looking at the Accept header. The default value is false.

For instance, when this flag is true, a request for /hotels?format=pdf will result in an AbstractPdfView being resolved, while the Accept header can be the browser-defined text/html,application/xhtml+xml.

setParameterName

public void setParameterName(String parameterName)
Sets the parameter name that can be used to determine the requested media type if the setFavorParameter(boolean) property is true. The default parameter name is format.

setIgnoreAcceptHeader

public void setIgnoreAcceptHeader(boolean ignoreAcceptHeader)
Indicates whether the HTTP Accept header should be ignored. Default is false. If set to true, this view resolver will only refer to the file extension and/or paramter, as indicated by the favorPathExtension and favorParameter properties.

setUseNotAcceptableStatusCode

public void setUseNotAcceptableStatusCode(boolean useNotAcceptableStatusCode)
Indicates whether a 406 Not Acceptable status code should be returned if no suitable view can be found.

Default is false, meaning that this view resolver returns null for resolveViewName(String, Locale) when an acceptable view cannot be found. This will allow for view resolvers chaining. When this property is set to true, resolveViewName(String, Locale) will respond with a view that sets the response status to 406 Not Acceptable instead.

setMediaTypes

public void setMediaTypes(Map<String,String> mediaTypes)
Sets the mapping from file extensions to media types.

When this mapping is not set or when an extension is not present, this view resolver will fall back to using a FileTypeMap when the Java Action Framework is available.

setDefaultViews

public void setDefaultViews(List<View> defaultViews)
Sets the default views to use when a more specific view can not be obtained from the ViewResolver chain.

setDefaultContentType

public void setDefaultContentType(MediaType defaultContentType)
Sets the default content type.

This content type will be used when file extension, parameter, nor Accept header define a content-type, either through being disabled or empty.

setViewResolvers

public void setViewResolvers(List<ViewResolver> viewResolvers)
Sets the view resolvers to be wrapped by this view resolver.

If this property is not set, view resolvers will be detected automatically.

initServletContext

protected void initServletContext(ServletContext servletContext)
Description copied from class: WebApplicationObjectSupport
Subclasses may override this for custom initialization based on the ServletContext that this application object runs in.

The default implementation is empty. Called by WebApplicationObjectSupport.initApplicationContext(org.springframework.context.ApplicationContext) as well as WebApplicationObjectSupport.setServletContext(javax.servlet.ServletContext).

Overrides:
initServletContext in class WebApplicationObjectSupport
Parameters:
servletContext - the ServletContext that this application object runs in (never null)

getMediaTypes

protected List<MediaType> getMediaTypes(HttpServletRequest request)
Determines the list of MediaType for the given HttpServletRequest.

The default implementation invokes getMediaTypeFromFilename(String) if favorPathExtension property is true. If the property is false, or when a media type cannot be determined from the request path, this method will inspect the Accept header of the request.

This method can be overriden to provide a different algorithm.

Parameters:
request - the current servlet request
Returns:
the list of media types requested, if any

getMediaTypeFromFilename

protected MediaType getMediaTypeFromFilename(String filename)
Determines the MediaType for the given filename.

The default implementation will check the media types property first for a defined mapping. If not present, and if the Java Activation Framework can be found on the class path, it will call FileTypeMap.getContentType(String)

This method can be overriden to provide a different algorithm.

Parameters:
filename - the current request file name (i.e. hotels.html)
Returns:
the media type, if any

getMediaTypeFromParameter

protected MediaType getMediaTypeFromParameter(String parameterValue)
Determines the MediaType for the given parameter value.

The default implementation will check the media types property for a defined mapping.

This method can be overriden to provide a different algorithm.

Parameters:
parameterValue - the parameter value (i.e. pdf).
Returns:
the media type, if any

resolveViewName

public View resolveViewName(String viewName,
                            Locale locale)
                     throws Exception
Description copied from interface: ViewResolver
Resolve the given view by name.

Note: To allow for ViewResolver chaining, a ViewResolver should return null if a view with the given name is not defined in it. However, this is not required: Some ViewResolvers will always attempt to build View objects with the given name, unable to return null (rather throwing an exception when View creation failed).

Specified by:
resolveViewName in interface ViewResolver
Parameters:
viewName - name of the view to resolve
locale - Locale in which to resolve the view. ViewResolvers that support internationalization should respect this.
Returns:
the View object, or null if not found (optional, to allow for ViewResolver chaining)
Throws:
Exception - if the view cannot be resolved (typically in case of problems creating an actual View object)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultRequestToViewNameTranslator

org.springframework.web.servlet.view
Class DefaultRequestToViewNameTranslator

java.lang.Object
    extended by  org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator
All Implemented Interfaces:
RequestToViewNameTranslator
public class DefaultRequestToViewNameTranslator
extends Object
implements RequestToViewNameTranslator

RequestToViewNameTranslator that simply transforms the URI of the incoming request into a view name.

Can be explicitly defined as the "viewNameTranslator" bean in a DispatcherServlet context. Otherwise, a plain default instance will be used.

The default transformation simply strips leading and trailing slashes as well as the file extension of the URI, and returns the result as the view name with the configured "prefix" and a "suffix" added as appropriate.

The stripping of the leading slash and file extension can be disabled using the "stripLeadingSlash" and "stripExtension" properties, respectively.

Find below some examples of request to view name translation.

http://localhost:8080/gamecast/display.html -> display
 http://localhost:8080/gamecast/displayShoppingCart.html -> displayShoppingCart
 http://localhost:8080/gamecast/admin/index.html -> admin/index

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
See Also:
RequestToViewNameTranslator, ViewResolver

Constructor Summary
DefaultRequestToViewNameTranslator()
Method Summary
String | getViewName(HttpServletRequest request) Translates the request URI of the incoming HttpServletRequest into the view name based on the configured parameters.
void | setAlwaysUseFullPath(boolean alwaysUseFullPath) Set if URL lookup should always use the full path within the current servlet context.
void | setPrefix(String prefix) Set the prefix to prepend to generated view names.
void | setSeparator(String separator) Set the value that will replace '/' as the separator in the view name.
void | setStripExtension(boolean stripExtension) Set whether or not file extensions should be stripped from the URI when generating the view name.
void | setStripLeadingSlash(boolean stripLeadingSlash) Set whether or not leading slashes should be stripped from the URI when generating the view name.
void | setStripTrailingSlash(boolean stripTrailingSlash) Set whether or not trailing slashes should be stripped from the URI when generating the view name.
void | setSuffix(String suffix) Set the suffix to append to generated view names.
void | setUrlDecode(boolean urlDecode) Set if the context path and request URI should be URL-decoded.
void | setUrlPathHelper(UrlPathHelper urlPathHelper) Set the UrlPathHelper to use for the resolution of lookup paths.
protected String | transformPath(String lookupPath) Transform the request URI (in the context of the webapp) stripping slashes and extensions, and replacing the separator as required.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DefaultRequestToViewNameTranslator

public DefaultRequestToViewNameTranslator()
Method Detail

setPrefix

public void setPrefix(String prefix)
Set the prefix to prepend to generated view names.

Parameters:
prefix - the prefix to prepend to generated view names

setSuffix

public void setSuffix(String suffix)
Set the suffix to append to generated view names.

Parameters:
suffix - the suffix to append to generated view names

setSeparator

public void setSeparator(String separator)
Set the value that will replace '/' as the separator in the view name. The default behavior simply leaves '/' as the separator.

setStripLeadingSlash

public void setStripLeadingSlash(boolean stripLeadingSlash)
Set whether or not leading slashes should be stripped from the URI when generating the view name. Default is "true".

setStripTrailingSlash

public void setStripTrailingSlash(boolean stripTrailingSlash)
Set whether or not trailing slashes should be stripped from the URI when generating the view name. Default is "true".

setStripExtension

public void setStripExtension(boolean stripExtension)
Set whether or not file extensions should be stripped from the URI when generating the view name. Default is "true".

setAlwaysUseFullPath

public void setAlwaysUseFullPath(boolean alwaysUseFullPath)
Set if URL lookup should always use the full path within the current servlet context. Else, the path within the current servlet mapping is used if applicable (i.e. in the case of a ".../*" servlet mapping in web.xml). Default is "false".

See Also:
UrlPathHelper.setAlwaysUseFullPath(boolean)

setUrlDecode

public void setUrlDecode(boolean urlDecode)
Set if the context path and request URI should be URL-decoded. Both are returned undecoded by the Servlet API, in contrast to the servlet path.

Uses either the request encoding or the default encoding according to the Servlet spec (ISO-8859-1).

See Also:
UrlPathHelper.setUrlDecode(boolean)

setUrlPathHelper

public void setUrlPathHelper(UrlPathHelper urlPathHelper)
Set the UrlPathHelper to use for the resolution of lookup paths.

Use this to override the default UrlPathHelper with a custom subclass, or to share common UrlPathHelper settings across multiple web components.

getViewName

public String getViewName(HttpServletRequest request)
Translates the request URI of the incoming HttpServletRequest into the view name based on the configured parameters.

Specified by:
getViewName in interface RequestToViewNameTranslator
Parameters:
request - the incoming HttpServletRequest providing the context from which a view name is to be resolved
Returns:
the view name (or null if no default found)
See Also:
UrlPathHelper.getLookupPathForRequest(javax.servlet.http.HttpServletRequest), transformPath(java.lang.String)

transformPath

protected String transformPath(String lookupPath)
Transform the request URI (in the context of the webapp) stripping slashes and extensions, and replacing the separator as required.

Parameters:
lookupPath - the lookup path for the current request, as determined by the UrlPathHelper
Returns:
the transformed path, with slashes and extensions stripped if desired
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InternalResourceView

org.springframework.web.servlet.view
Class InternalResourceView

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
                extended by  org.springframework.web.servlet.view.AbstractUrlBasedView
                    extended by  org.springframework.web.servlet.view.InternalResourceView
All Implemented Interfaces:
BeanNameAware, InitializingBean, ApplicationContextAware, ServletContextAware, View
Direct Known Subclasses:
JstlView, TilesView
public class InternalResourceView
extends AbstractUrlBasedView

Wrapper for a JSP or other resource within the same web application. Exposes model objects as request attributes and forwards the request to the specified resource URL using a RequestDispatcher.

A URL for this view is supposed to specify a resource within the web application, suitable for RequestDispatcher's forward or include method.

If operating within an already included request or within a response that has already been committed, this view will fall back to an include instead of a forward. This can be enforced by calling response.flushBuffer() (which will commit the response) before rendering the view.

Typical usage with InternalResourceViewResolver looks as follows, from the perspective of the DispatcherServlet context definition:

<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
   <property name="prefix" value="/WEB-INF/jsp/"/>
   <property name="suffix" value=".jsp"/>
 </bean>
Every view name returned from a handler will be translated to a JSP resource (for example: "myView" -> "/WEB-INF/jsp/myView.jsp"), using this view class by default.

Author:
Rod Johnson, Juergen Hoeller, Rob Harrop
See Also:
RequestDispatcher.forward(javax.servlet.ServletRequest, javax.servlet.ServletResponse),
RequestDispatcher.include(javax.servlet.ServletRequest, javax.servlet.ServletResponse),
ServletResponse.flushBuffer(),
InternalResourceViewResolver,
JstlView

Field Summary
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
InternalResourceView()
Constructor for use as a bean.
InternalResourceView(String url)
Create a new InternalResourceView with the given URL.
InternalResourceView(String url, boolean alwaysInclude)
Create a new InternalResourceView with the given URL.
Method Summary
protected void | exposeForwardRequestAttributes(HttpServletRequest request) Expose the current request URI and paths as HttpServletRequest attributes under the keys defined in the Servlet 2.4 specification, for Servlet 2.3 containers as well as misbehaving Servlet 2.4 containers (such as OC4J).
protected void | exposeHelpers(HttpServletRequest request) Expose helpers unique to each rendering operation.
protected HttpServletRequest | getRequestToExpose(HttpServletRequest originalRequest) Get the request handle to expose to the RequestDispatcher, i.e.
protected void | initServletContext(ServletContext sc) Checks whether we need to explicitly expose the Servlet 2.4 request attributes by default.
protected boolean | isContextRequired() An ApplicationContext is not strictly required for InternalResourceView.
protected String | prepareForRendering(HttpServletRequest request, HttpServletResponse response) Prepare for rendering, and determine the request dispatcher path to forward to (or to include).
protected void | renderMergedOutputModel(Map<String,Object> model, HttpServletRequest request, HttpServletResponse response) Render the internal resource given the specified model.
void | setAlwaysInclude(boolean alwaysInclude) Specify whether to always include the view rather than forward to it.
void | setExposeContextBeansAsAttributes(boolean exposeContextBeansAsAttributes) Set whether to make all Spring beans in the application context accessible as request attributes, through lazy checking once an attribute gets accessed.
void | setExposedContextBeanNames(String[] exposedContextBeanNames) Specify the names of beans in the context which are supposed to be exposed.
void | setExposeForwardAttributes(boolean exposeForwardAttributes) Set whether to explictly expose the Servlet 2.4 forward request attributes when forwarding to the underlying view resource.
void | setPreventDispatchLoop(boolean preventDispatchLoop) Set whether to explicitly prevent dispatching back to the current handler path.
protected boolean | useInclude(HttpServletRequest request, HttpServletResponse response) Determine whether to use RequestDispatcher's include or forward method.
Methods inherited from class org.springframework.web.servlet.view.AbstractUrlBasedView
afterPropertiesSet, checkResource, getUrl, isUrlRequired, setUrl, toString
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

InternalResourceView

public InternalResourceView()
Constructor for use as a bean.

See Also:
AbstractUrlBasedView.setUrl(java.lang.String), setAlwaysInclude(boolean)

InternalResourceView

public InternalResourceView(String url)
Create a new InternalResourceView with the given URL.

Parameters:
url - the URL to forward to
See Also:
setAlwaysInclude(boolean)

InternalResourceView

public InternalResourceView(String url,
                            boolean alwaysInclude)
Create a new InternalResourceView with the given URL.

Parameters:
url - the URL to forward to
alwaysInclude - whether to always include the view rather than forward to it
Method Detail

setAlwaysInclude

public void setAlwaysInclude(boolean alwaysInclude)
Specify whether to always include the view rather than forward to it.

Default is "false". Switch this flag on to enforce the use of a Servlet include, even if a forward would be possible.

See Also:
RequestDispatcher.forward(javax.servlet.ServletRequest, javax.servlet.ServletResponse),
RequestDispatcher.include(javax.servlet.ServletRequest, javax.servlet.ServletResponse),
useInclude(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

setExposeForwardAttributes

public void setExposeForwardAttributes(boolean exposeForwardAttributes)
Set whether to explictly expose the Servlet 2.4 forward request attributes when forwarding to the underlying view resource.

Default is "true" on Servlet containers up until 2.4, and "false" for Servlet 2.5 and above. Note that Servlet containers at 2.4 level and above should expose those attributes automatically! This InternalResourceView feature exists for Servlet 2.3 containers and misbehaving 2.4 containers.

setExposeContextBeansAsAttributes

public void setExposeContextBeansAsAttributes(boolean exposeContextBeansAsAttributes)
Set whether to make all Spring beans in the application context accessible as request attributes, through lazy checking once an attribute gets accessed.

This will make all such beans accessible in plain ${...} expressions in a JSP 2.0 page, as well as in JSTL's c:out value expressions.

Default is "false". Switch this flag on to transparently expose all Spring beans in the request attribute namespace.

NOTE: Context beans will override any custom request or session attributes of the same name that have been manually added. However, model attributes (as explicitly exposed to this view) of the same name will always override context beans.

See Also:
getRequestToExpose(javax.servlet.http.HttpServletRequest)

setExposedContextBeanNames

public void setExposedContextBeanNames(String[] exposedContextBeanNames)
Specify the names of beans in the context which are supposed to be exposed. If this is non-null, only the specified beans are eligible for exposure as attributes.

If you'd like to expose all Spring beans in the application context, switch the "exposeContextBeansAsAttributes" flag on but do not list specific bean names for this property.

setPreventDispatchLoop

public void setPreventDispatchLoop(boolean preventDispatchLoop)
Set whether to explicitly prevent dispatching back to the current handler path.

Default is "false". Switch this to "true" for convention-based views where a dispatch back to the current handler path is a definitive error.

isContextRequired

protected boolean isContextRequired()
An ApplicationContext is not strictly required for InternalResourceView.

Overrides:
isContextRequired in class WebApplicationObjectSupport
See Also:
ApplicationObjectSupport.getApplicationContext(),
ApplicationObjectSupport.getMessageSourceAccessor(),
WebApplicationObjectSupport.getWebApplicationContext(),
WebApplicationObjectSupport.getServletContext(),
WebApplicationObjectSupport.getTempDir()

initServletContext

protected void initServletContext(ServletContext sc)
Checks whether we need to explicitly expose the Servlet 2.4 request attributes by default.

Overrides:
initServletContext in class WebApplicationObjectSupport
Parameters:
sc - the ServletContext that this application object runs in (never null)
See Also:
setExposeForwardAttributes(boolean), exposeForwardRequestAttributes(javax.servlet.http.HttpServletRequest)

renderMergedOutputModel

protected void renderMergedOutputModel(Map<String,Object> model,
                                       HttpServletRequest request,
                                       HttpServletResponse response)
                                throws Exception
Render the internal resource given the specified model. This includes setting the model as request attributes.

Specified by:
renderMergedOutputModel in class AbstractView
Parameters:
model - combined output Map (never null), with dynamic values taking precedence over static attributes
request - current HTTP request
response - current HTTP response
Throws:
Exception - if rendering failed

exposeHelpers

protected void exposeHelpers(HttpServletRequest request)
                      throws Exception
Expose helpers unique to each rendering operation. This is necessary so that different rendering operations can't overwrite each other's contexts etc.

Called by renderMergedOutputModel(Map, HttpServletRequest, HttpServletResponse). The default implementation is empty. This method can be overridden to add custom helpers as request attributes.

Parameters:
request - current HTTP request
Throws:
Exception - if there's a fatal error while we're adding attributes
See Also:
renderMergedOutputModel(java.util.Map, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), JstlView.exposeHelpers(javax.servlet.http.HttpServletRequest)

prepareForRendering

protected String prepareForRendering(HttpServletRequest request,
                                     HttpServletResponse response)
                              throws Exception
Prepare for rendering, and determine the request dispatcher path to forward to (or to include).

This implementation simply returns the configured URL. Subclasses can override this to determine a resource to render, typically interpreting the URL in a different manner.

Parameters:
request - current HTTP request
response - current HTTP response
Returns:
the request dispatcher path to use
Throws:
Exception - if preparations failed
See Also:
AbstractUrlBasedView.getUrl()

getRequestToExpose

protected HttpServletRequest getRequestToExpose(HttpServletRequest originalRequest)
Get the request handle to expose to the RequestDispatcher, i.e. to the view.

The default implementation wraps the original request for exposure of Spring beans as request attributes (if demanded).

Parameters:
originalRequest - the original servlet request as provided by the engine
Returns:
the wrapped request, or the original request if no wrapping is necessary
See Also:
setExposeContextBeansAsAttributes(boolean), ContextExposingHttpServletRequest

useInclude

protected boolean useInclude(HttpServletRequest request,
                             HttpServletResponse response)
Determine whether to use RequestDispatcher's include or forward method.

Performs a check whether an include URI attribute is found in the request, indicating an include request, and whether the response has already been committed. In both cases, an include will be performed, as a forward is not possible anymore.

Parameters:
request - current HTTP request
response - current HTTP response
Returns:
true for include, false for forward
See Also:
RequestDispatcher.forward(javax.servlet.ServletRequest, javax.servlet.ServletResponse),
RequestDispatcher.include(javax.servlet.ServletRequest, javax.servlet.ServletResponse),
ServletResponse.isCommitted(),
WebUtils.isIncludeRequest(javax.servlet.ServletRequest)

exposeForwardRequestAttributes

protected void exposeForwardRequestAttributes(HttpServletRequest request)
Expose the current request URI and paths as HttpServletRequest attributes under the keys defined in the Servlet 2.4 specification, for Servlet 2.3 containers as well as misbehaving Servlet 2.4 containers (such as OC4J).

Does not expose the attributes on Servlet 2.5 or above, mainly for GlassFish compatibility (GlassFish gets confused by pre-exposed attributes). In any case, Servlet 2.5 containers should finally properly support Servlet 2.4 features, shouldn't they...

Parameters:
request - current HTTP request
See Also:
WebUtils.exposeForwardRequestAttributes(javax.servlet.http.HttpServletRequest)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InternalResourceViewResolver

org.springframework.web.servlet.view
Class InternalResourceViewResolver

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractCachingViewResolver
                extended by  org.springframework.web.servlet.view.UrlBasedViewResolver
                    extended by  org.springframework.web.servlet.view.InternalResourceViewResolver
All Implemented Interfaces:
ApplicationContextAware, Ordered, ServletContextAware, ViewResolver
public class InternalResourceViewResolver
extends UrlBasedViewResolver

Convenient subclass of UrlBasedViewResolver that supports InternalResourceView (i.e. Servlets and JSPs) and subclasses such as JstlView.

The view class for all views generated by this resolver can be specified via UrlBasedViewResolver.setViewClass(java.lang.Class). See UrlBasedViewResolver's javadoc for details. The default is InternalResourceView, or JstlView if the JSTL API is present.

BTW, it's good practice to put JSP files that just serve as views under WEB-INF, to hide them from direct access (e.g. via a manually entered URL). Only controllers will be able to access them then.

Note: When chaining ViewResolvers, an InternalResourceViewResolver always needs to be last, as it will attempt to resolve any view name, no matter whether the underlying resource actually exists.

Since:
17.02.2003
Author:
Juergen Hoeller
See Also:
UrlBasedViewResolver.setViewClass(java.lang.Class),
UrlBasedViewResolver.setPrefix(java.lang.String),
UrlBasedViewResolver.setSuffix(java.lang.String),
UrlBasedViewResolver.setRequestContextAttribute(java.lang.String),
InternalResourceView,
JstlView

Field Summary
Fields inherited from class org.springframework.web.servlet.view.UrlBasedViewResolver
FORWARD_URL_PREFIX, REDIRECT_URL_PREFIX
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
InternalResourceViewResolver()
Sets the default view class to requiredViewClass(): by default InternalResourceView, or JstlView if the JSTL API is present.
Method Summary
protected AbstractUrlBasedView | buildView(String viewName) Creates a new View instance of the specified view class and configures it.
protected Class | requiredViewClass() This resolver requires InternalResourceView.
void | setAlwaysInclude(boolean alwaysInclude) Specify whether to always include the view rather than forward to it.
void | setExposeContextBeansAsAttributes(boolean exposeContextBeansAsAttributes) Set whether to make all Spring beans in the application context accessible as request attributes, through lazy checking once an attribute gets accessed.
void | setExposedContextBeanNames(String[] exposedContextBeanNames) Specify the names of beans in the context which are supposed to be exposed.
Methods inherited from class org.springframework.web.servlet.view.UrlBasedViewResolver
canHandle, createView, getAttributesMap, getCacheKey, getContentType, getOrder, getPrefix, getRequestContextAttribute, getSuffix, getViewClass, getViewNames, initApplicationContext, isRedirectContextRelative, isRedirectHttp10Compatible, loadView, setAttributes, setAttributesMap, setContentType, setOrder, setPrefix, setRedirectContextRelative, setRedirectHttp10Compatible, setRequestContextAttribute, setSuffix, setViewClass, setViewNames
Methods inherited from class org.springframework.web.servlet.view.AbstractCachingViewResolver
clearCache, isCache, removeFromCache, resolveViewName, setCache
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

InternalResourceViewResolver

public InternalResourceViewResolver()
Sets the default view class to requiredViewClass(): by default InternalResourceView, or JstlView if the JSTL API is present.

Method Detail

requiredViewClass

protected Class requiredViewClass()
This resolver requires InternalResourceView.

Overrides:
requiredViewClass in class UrlBasedViewResolver
See Also:
AbstractUrlBasedView

setAlwaysInclude

public void setAlwaysInclude(boolean alwaysInclude)
Specify whether to always include the view rather than forward to it.

Default is "false". Switch this flag on to enforce the use of a Servlet include, even if a forward would be possible.

See Also:
InternalResourceView.setAlwaysInclude(boolean)

setExposeContextBeansAsAttributes

public void setExposeContextBeansAsAttributes(boolean exposeContextBeansAsAttributes)
Set whether to make all Spring beans in the application context accessible as request attributes, through lazy checking once an attribute gets accessed.

This will make all such beans accessible in plain ${...} expressions in a JSP 2.0 page, as well as in JSTL's c:out value expressions.

Default is "false".

See Also:
InternalResourceView.setExposeContextBeansAsAttributes(boolean)

setExposedContextBeanNames

public void setExposedContextBeanNames(String[] exposedContextBeanNames)
Specify the names of beans in the context which are supposed to be exposed. If this is non-null, only the specified beans are eligible for exposure as attributes.

See Also:
InternalResourceView.setExposedContextBeanNames(java.lang.String[])

buildView

protected AbstractUrlBasedView buildView(String viewName)
                                  throws Exception
Description copied from class: UrlBasedViewResolver
Creates a new View instance of the specified view class and configures it. Does not perform any lookup for pre-defined View instances.

Spring lifecycle methods as defined by the bean container do not have to be called here; those will be applied by the loadView method after this method returns.

Subclasses will typically call super.buildView(viewName) first, before setting further properties themselves. loadView will then apply Spring lifecycle methods at the end of this process.

Overrides:
buildView in class UrlBasedViewResolver
Parameters:
viewName - the name of the view to build
Returns:
the View instance
Throws:
Exception - if the view couldn't be resolved
See Also:
UrlBasedViewResolver.loadView(String, java.util.Locale)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JstlView

org.springframework.web.servlet.view
Class JstlView

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
                extended by  org.springframework.web.servlet.view.AbstractUrlBasedView
                    extended by  org.springframework.web.servlet.view.InternalResourceView
                        extended by  org.springframework.web.servlet.view.JstlView
All Implemented Interfaces:
BeanNameAware, InitializingBean, ApplicationContextAware, ServletContextAware, View
public class JstlView
extends InternalResourceView

Specialization of InternalResourceView for JSTL pages, i.e. JSP pages that use the JSP Standard Tag Library.

Exposes JSTL-specific request attributes specifying locale and resource bundle for JSTL's formatting and message tags, using Spring's locale and MessageSource.

Typical usage with InternalResourceViewResolver would look as follows, from the perspective of the DispatcherServlet context definition:

 <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
   <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
   <property name="prefix" value="/WEB-INF/jsp/"/>
   <property name="suffix" value=".jsp"/>
 </bean>

 <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
   <property name="basename" value="messages"/>
 </bean>
Every view name returned from a handler will be translated to a JSP resource (for example: "myView" -> "/WEB-INF/jsp/myView.jsp"), using this view class to enable explicit JSTL support.

The specified MessageSource loads messages from "messages.properties" etc files in the class path. This will automatically be exposed to views as JSTL localization context, which the JSTL fmt tags (message etc) will use. Consider using Spring's ReloadableResourceBundleMessageSource instead of the standard ResourceBundleMessageSource for more sophistication. Of course, any other Spring components can share the same MessageSource.

This is a separate class mainly to avoid JSTL dependencies in InternalResourceView itself. JSTL has not been part of standard J2EE up until J2EE 1.4, so we can't assume the JSTL API jar to be available on the class path.

Hint: Set the InternalResourceView.setExposeContextBeansAsAttributes(boolean) flag to "true" in order to make all Spring beans in the application context accessible within JSTL expressions (e.g. in a c:out value expression). This will also make all such beans accessible in plain ${...} expressions in a JSP 2.0 page.

Since:
27.02.2003
Author:
Juergen Hoeller
See Also:
JstlUtils.exposeLocalizationContext(javax.servlet.http.HttpServletRequest, org.springframework.context.MessageSource), InternalResourceViewResolver, ResourceBundleMessageSource, ReloadableResourceBundleMessageSource

Field Summary
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
JstlView()
Constructor for use as a bean.
JstlView(String url)
Create a new JstlView with the given URL.
JstlView(String url, MessageSource messageSource)
Create a new JstlView with the given URL.
Method Summary
protected void | exposeHelpers(HttpServletRequest request) Exposes a JSTL LocalizationContext for Spring's locale and MessageSource.
protected void | initServletContext(ServletContext servletContext) Wraps the MessageSource with a JSTL-aware MessageSource that is aware of JSTL's javax.servlet.jsp.jstl.fmt.localizationContext context-param.
Methods inherited from class org.springframework.web.servlet.view.InternalResourceView
exposeForwardRequestAttributes, getRequestToExpose, isContextRequired, prepareForRendering, renderMergedOutputModel, setAlwaysInclude, setExposeContextBeansAsAttributes, setExposedContextBeanNames, setExposeForwardAttributes, setPreventDispatchLoop, useInclude
Methods inherited from class org.springframework.web.servlet.view.AbstractUrlBasedView
afterPropertiesSet, checkResource, getUrl, isUrlRequired, setUrl, toString
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

JstlView

public JstlView()
Constructor for use as a bean.

See Also:
AbstractUrlBasedView.setUrl(java.lang.String)

JstlView

public JstlView(String url)
Create a new JstlView with the given URL.

Parameters:
url - the URL to forward to

JstlView

public JstlView(String url,
                MessageSource messageSource)
Create a new JstlView with the given URL.

Parameters:
url - the URL to forward to
messageSource - the MessageSource to expose to JSTL tags (will be wrapped with a JSTL-aware MessageSource that is aware of JSTL's javax.servlet.jsp.jstl.fmt.localizationContext context-param)
See Also:
JstlUtils.getJstlAwareMessageSource(javax.servlet.ServletContext, org.springframework.context.MessageSource)
Method Detail

initServletContext

protected void initServletContext(ServletContext servletContext)
Wraps the MessageSource with a JSTL-aware MessageSource that is aware of JSTL's javax.servlet.jsp.jstl.fmt.localizationContext context-param.

Overrides:
initServletContext in class InternalResourceView
Parameters:
servletContext - the ServletContext that this application object runs in (never null)
See Also:
JstlUtils.getJstlAwareMessageSource(javax.servlet.ServletContext, org.springframework.context.MessageSource)

exposeHelpers

protected void exposeHelpers(HttpServletRequest request)
                      throws Exception
Exposes a JSTL LocalizationContext for Spring's locale and MessageSource.

Overrides:
exposeHelpers in class InternalResourceView
Parameters:
request - current HTTP request
Throws:
Exception - if there's a fatal error while we're adding attributes
See Also:
JstlUtils.exposeLocalizationContext(javax.servlet.http.HttpServletRequest, org.springframework.context.MessageSource)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RedirectView

org.springframework.web.servlet.view
Class RedirectView

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
                extended by  org.springframework.web.servlet.view.AbstractUrlBasedView
                    extended by  org.springframework.web.servlet.view.RedirectView
All Implemented Interfaces:
BeanNameAware, InitializingBean, ApplicationContextAware, ServletContextAware, View
public class RedirectView
extends AbstractUrlBasedView

View that redirects to an absolute, context relative, or current request relative URL. By default all primitive model attributes (or collections thereof) are exposed as HTTP query parameters, but this behavior can be changed by overriding the isEligibleProperty(String, Object) method.

A URL for this view is supposed to be a HTTP redirect URL, i.e. suitable for HttpServletResponse's sendRedirect method, which is what actually does the redirect if the HTTP 1.0 flag is on, or via sending back an HTTP 303 code - if the HTTP 1.0 compatibility flag is off.

Note that while the default value for the "contextRelative" flag is off, you will probably want to almost always set it to true. With the flag off, URLs starting with "/" are considered relative to the web server root, while with the flag on, they are considered relative to the web application root. Since most web applications will never know or care what their context path actually is, they are much better off setting this flag to true, and submitting paths which are to be considered relative to the web application root.

NOTE when using this redirect view in a Portlet environment: Make sure that your controller respects the Portlet sendRedirect constraints. When e.g. using SimpleFormController, make sure to set your controller's "redirectAction" property to "true", in order to make the controller base class behave accordingly.

Author:
Rod Johnson, Juergen Hoeller, Colin Sampaleanu, Sam Brannen, Arjen Poutsma
See Also:
setContextRelative(boolean), setHttp10Compatible(boolean), setExposeModelAttributes(boolean), HttpServletResponse.sendRedirect(java.lang.String)

Field Summary
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
RedirectView()
Constructor for use as a bean.
RedirectView(String url)
Create a new RedirectView with the given URL.
RedirectView(String url, boolean contextRelative)
Create a new RedirectView with the given URL.
RedirectView(String url, boolean contextRelative, boolean http10Compatible)
Create a new RedirectView with the given URL.
RedirectView(String url, boolean contextRelative, boolean http10Compatible, boolean exposeModelAttributes)
Create a new RedirectView with the given URL.
Method Summary
protected  void appendQueryProperties(StringBuilder targetUrl, Map<String,Object> model, String encodingScheme)
Append query properties to the redirect URL.
protected  HttpStatus getHttp11StatusCode(HttpServletRequest request, HttpServletResponse response, String targetUrl)
Determines the status code to use for HTTP 1.1 compatible requests.
protected  boolean isEligibleProperty(String key, Object value)
Determine whether the given model element should be exposed as a query property.
protected  boolean isEligibleValue(Object value)
Determine whether the given model element value is eligible for exposure.
protected  Map<String,Object> queryProperties(Map<String,Object> model)
Determine name-value pairs for query strings, which will be stringified, URL-encoded and formatted by appendQueryProperties(java.lang.StringBuilder, java.util.Map, java.lang.String).
protected  void renderMergedOutputModel(Map<String,Object> model, HttpServletRequest request, HttpServletResponse response)
Convert model to request parameters and redirect to the given URL.
protected  void sendRedirect(HttpServletRequest request, HttpServletResponse response, String targetUrl, boolean http10Compatible)
Send a redirect back to the HTTP client
 void setContextRelative(boolean contextRelative)
Set whether to interpret a given URL that starts with a slash ("/") as relative to the current ServletContext, i.e.
 void setEncodingScheme(String encodingScheme)
Set the encoding scheme for this view.
 void setExposeModelAttributes(boolean exposeModelAttributes)
Set the exposeModelAttributes flag which denotes whether or not model attributes should be exposed as HTTP query parameters.
 void setHttp10Compatible(boolean http10Compatible)
Set whether to stay compatible with HTTP 1.0 clients.
 void setStatusCode(HttpStatus statusCode)
Set the status code for this view.
protected  String urlEncode(String input, String encodingScheme)
URL-encode the given input String with the given encoding scheme.
Methods inherited from class org.springframework.web.servlet.view.AbstractUrlBasedView
afterPropertiesSet, checkResource, getUrl, isUrlRequired, setUrl, toString
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

RedirectView

public RedirectView()
Constructor for use as a bean.

RedirectView

public RedirectView(String url)
Create a new RedirectView with the given URL.

The given URL will be considered as relative to the web server, not as relative to the current ServletContext.

Parameters:
url - the URL to redirect to
See Also:
RedirectView(String, boolean)

RedirectView

public RedirectView(String url,
                    boolean contextRelative)
Create a new RedirectView with the given URL.

Parameters:
url - the URL to redirect to
contextRelative - whether to interpret the given URL as relative to the current ServletContext

RedirectView

public RedirectView(String url,
                    boolean contextRelative,
                    boolean http10Compatible)
Create a new RedirectView with the given URL.

Parameters:
url - the URL to redirect to
contextRelative - whether to interpret the given URL as relative to the current ServletContext
http10Compatible - whether to stay compatible with HTTP 1.0 clients

RedirectView

public RedirectView(String url,
                    boolean contextRelative,
                    boolean http10Compatible,
                    boolean exposeModelAttributes)
Create a new RedirectView with the given URL.

Parameters:
url - the URL to redirect to
contextRelative - whether to interpret the given URL as relative to the current ServletContext
http10Compatible - whether to stay compatible with HTTP 1.0 clients
exposeModelAttributes - whether or not model attributes should be exposed as query parameters
Method Detail

setContextRelative

public void setContextRelative(boolean contextRelative)
Set whether to interpret a given URL that starts with a slash ("/") as relative to the current ServletContext, i.e. as relative to the web application root.

Default is "false": A URL that starts with a slash will be interpreted as absolute, i.e. taken as-is. If "true", the context path will be prepended to the URL in such a case.

See Also:
HttpServletRequest.getContextPath()

setHttp10Compatible

public void setHttp10Compatible(boolean http10Compatible)
Set whether to stay compatible with HTTP 1.0 clients.

In the default implementation, this will enforce HTTP status code 302 in any case, i.e. delegate to HttpServletResponse.sendRedirect. Turning this off will send HTTP status code 303, which is the correct code for HTTP 1.1 clients, but not understood by HTTP 1.0 clients.

Many HTTP 1.1 clients treat 302 just like 303, not making any difference. However, some clients depend on 303 when redirecting after a POST request; turn this flag off in such a scenario.

See Also:
HttpServletResponse.sendRedirect(java.lang.String)

setExposeModelAttributes

public void setExposeModelAttributes(boolean exposeModelAttributes)
Set the exposeModelAttributes flag which denotes whether or not model attributes should be exposed as HTTP query parameters.

Defaults to true.

setEncodingScheme

public void setEncodingScheme(String encodingScheme)
Set the encoding scheme for this view.

Default is the request's encoding scheme (which is ISO-8859-1 if not specified otherwise).

setStatusCode

public void setStatusCode(HttpStatus statusCode)
Set the status code for this view.

Default is to send 302/303, depending on the value of the http10Compatible flag.

renderMergedOutputModel

protected void renderMergedOutputModel(Map<String,Object> model,
                                       HttpServletRequest request,
                                       HttpServletResponse response)
                                throws IOException
Convert model to request parameters and redirect to the given URL.

Specified by:
renderMergedOutputModel in class AbstractView
Parameters:
model - combined output Map (never null), with dynamic values taking precedence over static attributes
request - current HTTP request
response - current HTTP response
Throws:
IOException
See Also:
appendQueryProperties(java.lang.StringBuilder, java.util.Map, java.lang.String), sendRedirect(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String, boolean)

appendQueryProperties

protected void appendQueryProperties(StringBuilder targetUrl,
                                     Map<String,Object> model,
                                     String encodingScheme)
                              throws UnsupportedEncodingException
Append query properties to the redirect URL. Stringifies, URL-encodes and formats model attributes as query properties.

Parameters:
targetUrl - the StringBuilder to append the properties to
model - Map that contains model attributes
encodingScheme - the encoding scheme to use
Throws:
UnsupportedEncodingException - if string encoding failed
See Also:
queryProperties(java.util.Map)

queryProperties

protected Map<String,Object> queryProperties(Map<String,Object> model)
Determine name-value pairs for query strings, which will be stringified, URL-encoded and formatted by appendQueryProperties(java.lang.StringBuilder, java.util.Map, java.lang.String).

This implementation filters the model through checking isEligibleProperty(String, Object) for each element, by default accepting Strings, primitives and primitive wrappers only.

Parameters:
model - the original model Map
Returns:
the filtered Map of eligible query properties
See Also:
isEligibleProperty(String, Object)

isEligibleProperty

protected boolean isEligibleProperty(String key,
                                     Object value)
Determine whether the given model element should be exposed as a query property.

The default implementation considers Strings and primitives as eligible, and also arrays and Collections/Iterables with corresponding elements. This can be overridden in subclasses.

Parameters:
key - the key of the model element
value - the value of the model element
Returns:
whether the element is eligible as query property

isEligibleValue

protected boolean isEligibleValue(Object value)
Determine whether the given model element value is eligible for exposure.

The default implementation considers primitives, Strings, Numbers, Dates, URIs, URLs and Locale objects as eligible. This can be overridden in subclasses.

Parameters:
value - the model element value
Returns:
whether the element value is eligible
See Also:
BeanUtils.isSimpleValueType(java.lang.Class)

urlEncode

protected String urlEncode(String input,
                           String encodingScheme)
                    throws UnsupportedEncodingException
URL-encode the given input String with the given encoding scheme.

The default implementation uses URLEncoder.encode(input, enc).

Parameters:
input - the unencoded input String
encodingScheme - the encoding scheme
Returns:
the encoded output String
Throws:
UnsupportedEncodingException - if thrown by the JDK URLEncoder
See Also:
URLEncoder.encode(String, String), URLEncoder.encode(String)

sendRedirect

protected void sendRedirect(HttpServletRequest request,
                            HttpServletResponse response,
                            String targetUrl,
                            boolean http10Compatible)
                     throws IOException
Send a redirect back to the HTTP client

Parameters:
request - current HTTP request (allows for reacting to request method)
response - current HTTP response (for sending response headers)
targetUrl - the target URL to redirect to
http10Compatible - whether to stay compatible with HTTP 1.0 clients
Throws:
IOException - if thrown by response methods

getHttp11StatusCode

protected HttpStatus getHttp11StatusCode(HttpServletRequest request,
                                         HttpServletResponse response,
                                         String targetUrl)
Determines the status code to use for HTTP 1.1 compatible requests.

The default implemenetation returns the statusCode property if set, or the value of the View.RESPONSE_STATUS_ATTRIBUTE attribute. If neither are set, it defaults to HttpStatus.SEE_OTHER (303).

Parameters:
request - the request to inspect
Returns:
the response
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResourceBundleViewResolver

org.springframework.web.servlet.view
Class ResourceBundleViewResolver

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractCachingViewResolver
                extended by  org.springframework.web.servlet.view.ResourceBundleViewResolver
All Implemented Interfaces:
DisposableBean, InitializingBean, ApplicationContextAware, Ordered, ServletContextAware, ViewResolver
public class ResourceBundleViewResolver
extends AbstractCachingViewResolver
implements Ordered, InitializingBean, DisposableBean

ViewResolver implementation that uses bean definitions in a ResourceBundle, specified by the bundle basename.

The bundle is typically defined in a properties file, located in the class path. The default bundle basename is "views".

This ViewResolver supports localized view definitions, using the default support of PropertyResourceBundle. For example, the basename "views" will be resolved as class path resources "views_de_AT.properties", "views_de.properties", "views.properties" - for a given Locale "de_AT".

Note: this ViewResolver implements the Ordered interface to allow for flexible participation in ViewResolver chaining. For example, some special views could be defined via this ViewResolver (giving it 0 as "order" value), while all remaining views could be resolved by a UrlBasedViewResolver.

Author:
Rod Johnson, Juergen Hoeller
See Also:
ResourceBundle.getBundle(java.lang.String), PropertyResourceBundle, UrlBasedViewResolver

Field Summary
static String DEFAULT_BASENAME
The default basename if no other basename is supplied.
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
ResourceBundleViewResolver()
Method Summary
void | afterPropertiesSet() Eagerly initialize Locales if necessary.
void | destroy() Close the bundle View factories on context shutdown.
protected ResourceBundle | getBundle(String basename, Locale locale) Obtain the resource bundle for the given basename and Locale.
protected ClassLoader | getBundleClassLoader() Return the ClassLoader to load resource bundles with.
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
protected BeanFactory | initFactory(Locale locale) Initialize the View BeanFactory from the ResourceBundle, for the given locale.
protected View | loadView(String viewName, Locale locale) Subclasses must implement this method, building a View object for the specified view.
void | setBasename(String basename) Set a single basename, following ResourceBundle conventions.
void | setBasenames(String[] basenames) Set an array of basenames, each following ResourceBundle conventions.
void | setBundleClassLoader(ClassLoader classLoader) Set the ClassLoader to load resource bundles with.
void | setDefaultParentView(String defaultParentView) Set the default parent for views defined in the ResourceBundle.
void | setLocalesToInitialize(Locale[] localesToInitialize) Specify Locales to initialize eagerly, rather than lazily when actually accessed.
void | setOrder(int order)
Methods inherited from class org.springframework.web.servlet.view.AbstractCachingViewResolver
clearCache, createView, getCacheKey, isCache, removeFromCache, resolveViewName, setCache
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_BASENAME

public static final String DEFAULT_BASENAME
The default basename if no other basename is supplied.

See Also:
Constant Field Values
Constructor Detail

ResourceBundleViewResolver

public ResourceBundleViewResolver()
Method Detail

setOrder

public void setOrder(int order)

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

setBasename

public void setBasename(String basename)
Set a single basename, following ResourceBundle conventions. The default is "views".

ResourceBundle supports different suffixes. For example, a base name of "views" might map to ResourceBundle files "views", "views_en_au" and "views_de".

Note that ResourceBundle names are effectively classpath locations: As a consequence, the JDK's standard ResourceBundle treats dots as package separators. This means that "test.theme" is effectively equivalent to "test/theme", just like it is for programmatic java.util.ResourceBundle usage.

See Also:
setBasenames(java.lang.String[]), ResourceBundle.getBundle(String)

setBasenames

public void setBasenames(String[] basenames)
Set an array of basenames, each following ResourceBundle conventions. The default is a single basename "views".

ResourceBundle supports different suffixes. For example, a base name of "views" might map to ResourceBundle files "views", "views_en_au" and "views_de".

The associated resource bundles will be checked sequentially when resolving a message code. Note that message definitions in a previous resource bundle will override ones in a later bundle, due to the sequential lookup.

Note that ResourceBundle names are effectively classpath locations: As a consequence, the JDK's standard ResourceBundle treats dots as package separators. This means that "test.theme" is effectively equivalent to "test/theme", just like it is for programmatic java.util.ResourceBundle usage.

See Also:
setBasename(java.lang.String), ResourceBundle.getBundle(String)

setBundleClassLoader

public void setBundleClassLoader(ClassLoader classLoader)
Set the ClassLoader to load resource bundles with. Default is the thread context ClassLoader.

getBundleClassLoader

protected ClassLoader getBundleClassLoader()
Return the ClassLoader to load resource bundles with.

Default is the specified bundle ClassLoader, usually the thread context ClassLoader.

setDefaultParentView

public void setDefaultParentView(String defaultParentView)
Set the default parent for views defined in the ResourceBundle.

This avoids repeated "yyy1.(parent)=xxx", "yyy2.(parent)=xxx" definitions in the bundle, especially if all defined views share the same parent.

The parent will typically define the view class and common attributes. Concrete views might simply consist of an URL definition then: a la "yyy1.url=/my.jsp", "yyy2.url=/your.jsp".

View definitions that define their own parent or carry their own class can still override this. Strictly speaking, the rule that a default parent setting does not apply to a bean definition that carries a class is there for backwards compatiblity reasons. It still matches the typical use case.

setLocalesToInitialize

public void setLocalesToInitialize(Locale[] localesToInitialize)
Specify Locales to initialize eagerly, rather than lazily when actually accessed.

Allows for pre-initialization of common Locales, eagerly checking the view configuration for those Locales.

afterPropertiesSet

public void afterPropertiesSet()
                        throws BeansException
Eagerly initialize Locales if necessary.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
BeansException
See Also:
setLocalesToInitialize(java.util.Locale[])

loadView

protected View loadView(String viewName,
                        Locale locale)
                 throws Exception
Description copied from class: AbstractCachingViewResolver
Subclasses must implement this method, building a View object for the specified view. The returned View objects will be cached by this ViewResolver base class.

Subclasses are not forced to support internationalization: A subclass that does not may simply ignore the locale parameter.

Specified by:
loadView in class AbstractCachingViewResolver
Parameters:
viewName - the name of the view to retrieve
locale - the Locale to retrieve the view for
Returns:
the View instance, or null if not found (optional, to allow for ViewResolver chaining)
Throws:
Exception - if the view couldn't be resolved
See Also:
AbstractCachingViewResolver.resolveViewName(java.lang.String, java.util.Locale)

initFactory

protected BeanFactory initFactory(Locale locale)
                           throws BeansException
Initialize the View BeanFactory from the ResourceBundle, for the given locale.

Synchronized because of access by parallel threads.

Parameters:
locale - the target Locale
Returns:
the View factory for the given Locale
Throws:
BeansException - in case of initialization errors

getBundle

protected ResourceBundle getBundle(String basename,
                                   Locale locale)
                            throws MissingResourceException
Obtain the resource bundle for the given basename and Locale.

Parameters:
basename - the basename to look for
locale - the Locale to look for
Returns:
the corresponding ResourceBundle
Throws:
MissingResourceException - if no matching bundle could be found
See Also:
ResourceBundle.getBundle(String, java.util.Locale, ClassLoader)

destroy

public void destroy()
             throws BeansException
Close the bundle View factories on context shutdown.

Specified by:
destroy in interface DisposableBean
Throws:
BeansException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UrlBasedViewResolver

org.springframework.web.servlet.view
Class UrlBasedViewResolver

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractCachingViewResolver
                extended by  org.springframework.web.servlet.view.UrlBasedViewResolver
All Implemented Interfaces:
ApplicationContextAware, Ordered, ServletContextAware, ViewResolver
Direct Known Subclasses:
AbstractTemplateViewResolver, InternalResourceViewResolver, JasperReportsViewResolver, TilesViewResolver, XsltViewResolver
public class UrlBasedViewResolver
extends AbstractCachingViewResolver
implements Ordered

Simple implementation of the ViewResolver interface, allowing for direct resolution of symbolic view names to URLs, without explicit mapping definition. This is useful if your symbolic names match the names of your view resources in a straightforward manner (i.e. the symbolic name is the unique part of the resource's filename), without the need for a dedicated mapping to be defined for each view.

Supports AbstractUrlBasedView subclasses like InternalResourceView, VelocityView and FreeMarkerView. The view class for all views generated by this resolver can be specified via the "viewClass" property.

View names can either be resource URLs themselves, or get augmented by a specified prefix and/or suffix. Exporting an attribute that holds the RequestContext to all views is explicitly supported.

Example: prefix="/WEB-INF/jsp/", suffix=".jsp", viewname="test" -> "/WEB-INF/jsp/test.jsp"

As a special feature, redirect URLs can be specified via the "redirect:" prefix. E.g.: "redirect:myAction.do" will trigger a redirect to the given URL, rather than resolution as standard view name. This is typically used for redirecting to a controller URL after finishing a form workflow.

Furthermore, forward URLs can be specified via the "forward:" prefix. E.g.: "forward:myAction.do" will trigger a forward to the given URL, rather than resolution as standard view name. This is typically used for controller URLs; it is not supposed to be used for JSP URLs - use logical view names there.

Note: This class does not support localized resolution, i.e. resolving a symbolic view name to different resources depending on the current locale.

Note: When chaining ViewResolvers, a UrlBasedViewResolver will check whether the specified resource actually exists. However, with InternalResourceView, it is not generally possible to determine the existence of the target resource upfront. In such a scenario, a UrlBasedViewResolver will always return View for any given view name; as a consequence, it should be configured as the last ViewResolver in the chain.

Since:
13.12.2003
Author:
Juergen Hoeller, Rob Harrop
See Also:
setViewClass(java.lang.Class), setPrefix(java.lang.String), setSuffix(java.lang.String), setRequestContextAttribute(java.lang.String), REDIRECT_URL_PREFIX, AbstractUrlBasedView, InternalResourceView, VelocityView, FreeMarkerView

Field Summary
static String | FORWARD_URL_PREFIX Prefix for special view names that specify a forward URL (usually to a controller after a form has been submitted and processed).
static String | REDIRECT_URL_PREFIX Prefix for special view names that specify a redirect URL (usually to a controller after a form has been submitted and processed).
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
UrlBasedViewResolver()
Method Summary
protected AbstractUrlBasedView | buildView(String viewName) Creates a new View instance of the specified view class and configures it.
protected boolean | canHandle(String viewName, Locale locale) Indicates whether or not this ViewResolver can handle the supplied view name.
protected View | createView(String viewName, Locale locale) Overridden to implement check for "redirect:" prefix.
Map<String,Object> | getAttributesMap() Allow Map access to the static attributes for views returned by this resolver, with the option to add or override specific entries.
protected Object | getCacheKey(String viewName, Locale locale) This implementation returns just the view name, as this ViewResolver doesn't support localized resolution.
protected String | getContentType() Return the content type for all views, if any.
int | getOrder() Return the order in which this ViewResolver is evaluated.
protected String | getPrefix() Return the prefix that gets prepended to view names when building a URL.
protected String | getRequestContextAttribute() Return the name of the RequestContext attribute for all views, if any.
protected String | getSuffix() Return the suffix that gets appended to view names when building a URL.
protected Class | getViewClass() Return the view class to be used to create views.
protected String[] | getViewNames() Return the view names (or name patterns) that can be handled by this ViewResolver.
protected void | initApplicationContext() Subclasses can override this for custom initialization behavior.
protected boolean | isRedirectContextRelative() Return whether to interpret a given redirect URL that starts with a slash ("/") as relative to the current ServletContext, i.e.
protected boolean | isRedirectHttp10Compatible() Return whether redirects should stay compatible with HTTP 1.0 clients.
protected View | loadView(String viewName, Locale locale) Delegates to buildView for creating a new instance of the specified view class, and applies the following Spring lifecycle methods (as supported by the generic Spring bean factory): ApplicationContextAware's setApplicationContext InitializingBean's afterPropertiesSet
protected Class | requiredViewClass() Return the required type of view for this resolver.
void | setAttributes(Properties props) Set static attributes from a java.util.Properties object, for all views returned by this resolver.
void | setAttributesMap(Map<String,?> attributes) Set static attributes from a Map, for all views returned by this resolver.
void | setContentType(String contentType) Set the content type for all views.
void | setOrder(int order) Set the order in which this ViewResolver is evaluated.
void | setPrefix(String prefix) Set the prefix that gets prepended to view names when building a URL.
void | setRedirectContextRelative(boolean redirectContextRelative) Set whether to interpret a given redirect URL that starts with a slash ("/") as relative to the current ServletContext, i.e.
void | setRedirectHttp10Compatible(boolean redirectHttp10Compatible) Set whether redirects should stay compatible with HTTP 1.0 clients.
void | setRequestContextAttribute(String requestContextAttribute) Set the name of the RequestContext attribute for all views.
void | setSuffix(String suffix) Set the suffix that gets appended to view names when building a URL.
void | setViewClass(Class viewClass) Set the view class that should be used to create views.
void | setViewNames(String[] viewNames) Set the view names (or name patterns) that can be handled by this ViewResolver.
Methods inherited from class org.springframework.web.servlet.view.AbstractCachingViewResolver
clearCache, isCache, removeFromCache, resolveViewName, setCache
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

REDIRECT_URL_PREFIX

public static final String REDIRECT_URL_PREFIX
Prefix for special view names that specify a redirect URL (usually to a controller after a form has been submitted and processed). Such view names will not be resolved in the configured default way but rather be treated as special shortcut.

See Also:
Constant Field Values

FORWARD_URL_PREFIX

public static final String FORWARD_URL_PREFIX
Prefix for special view names that specify a forward URL (usually to a controller after a form has been submitted and processed). Such view names will not be resolved in the configured default way but rather be treated as special shortcut.

See Also:
Constant Field Values
Constructor Detail

UrlBasedViewResolver

public UrlBasedViewResolver()
Method Detail

setViewClass

public void setViewClass(Class viewClass)
Set the view class that should be used to create views.

Parameters:
viewClass - class that is assignable to the required view class (by default, AbstractUrlBasedView)
See Also:
AbstractUrlBasedView

getViewClass

protected Class getViewClass()
Return the view class to be used to create views.

requiredViewClass

protected Class requiredViewClass()
Return the required type of view for this resolver. This implementation returns AbstractUrlBasedView.

See Also:
AbstractUrlBasedView

setPrefix

public void setPrefix(String prefix)
Set the prefix that gets prepended to view names when building a URL.

getPrefix

protected String getPrefix()
Return the prefix that gets prepended to view names when building a URL.

setSuffix

public void setSuffix(String suffix)
Set the suffix that gets appended to view names when building a URL.

getSuffix

protected String getSuffix()
Return the suffix that gets appended to view names when building a URL.

setContentType

public void setContentType(String contentType)
Set the content type for all views.

May be ignored by view classes if the view itself is assumed to set the content type, e.g. in case of JSPs.

getContentType

protected String getContentType()
Return the content type for all views, if any.

setRedirectContextRelative

public void setRedirectContextRelative(boolean redirectContextRelative)
Set whether to interpret a given redirect URL that starts with a slash ("/") as relative to the current ServletContext, i.e. as relative to the web application root.

Default is "true": A redirect URL that starts with a slash will be interpreted as relative to the web application root, i.e. the context path will be prepended to the URL.

Redirect URLs can be specified via the "redirect:" prefix. E.g.: "redirect:myAction.do"

See Also:
RedirectView.setContextRelative(boolean), REDIRECT_URL_PREFIX

isRedirectContextRelative

protected boolean isRedirectContextRelative()
Return whether to interpret a given redirect URL that starts with a slash ("/") as relative to the current ServletContext, i.e. as relative to the web application root.

setRedirectHttp10Compatible

public void setRedirectHttp10Compatible(boolean redirectHttp10Compatible)
Set whether redirects should stay compatible with HTTP 1.0 clients.

In the default implementation, this will enforce HTTP status code 302 in any case, i.e. delegate to HttpServletResponse.sendRedirect. Turning this off will send HTTP status code 303, which is the correct code for HTTP 1.1 clients, but not understood by HTTP 1.0 clients.

Many HTTP 1.1 clients treat 302 just like 303, not making any difference. However, some clients depend on 303 when redirecting after a POST request; turn this flag off in such a scenario.

Redirect URLs can be specified via the "redirect:" prefix. E.g.: "redirect:myAction.do"

See Also:
RedirectView.setHttp10Compatible(boolean), REDIRECT_URL_PREFIX

isRedirectHttp10Compatible

protected boolean isRedirectHttp10Compatible()
Return whether redirects should stay compatible with HTTP 1.0 clients.

setRequestContextAttribute

public void setRequestContextAttribute(String requestContextAttribute)
Set the name of the RequestContext attribute for all views.

Parameters:
requestContextAttribute - name of the RequestContext attribute
See Also:
AbstractView.setRequestContextAttribute(java.lang.String)

getRequestContextAttribute

protected String getRequestContextAttribute()
Return the name of the RequestContext attribute for all views, if any.

setAttributes

public void setAttributes(Properties props)
Set static attributes from a java.util.Properties object, for all views returned by this resolver.

This is the most convenient way to set static attributes. Note that static attributes can be overridden by dynamic attributes, if a value with the same name is included in the model.

Can be populated with a String "value" (parsed via PropertiesEditor) or a "props" element in XML bean definitions.

See Also:
PropertiesEditor, AbstractView.setAttributes(java.util.Properties)

setAttributesMap

public void setAttributesMap(Map<String,?> attributes)
Set static attributes from a Map, for all views returned by this resolver. This allows to set any kind of attribute values, for example bean references.

Can be populated with a "map" or "props" element in XML bean definitions.

Parameters:
attributes - Map with name Strings as keys and attribute objects as values
See Also:
AbstractView.setAttributesMap(java.util.Map)

getAttributesMap

public Map<String,Object> getAttributesMap()
Allow Map access to the static attributes for views returned by this resolver, with the option to add or override specific entries.

Useful for specifying entries directly, for example via "attributesMap[myKey]". This is particularly useful for adding or overriding entries in child view definitions.

setViewNames

public void setViewNames(String[] viewNames)
Set the view names (or name patterns) that can be handled by this ViewResolver. View names can contain simple wildcards such that 'my*', '*Report' and '*Repo*' will all match the view name 'myReport'.

See Also:
canHandle(java.lang.String, java.util.Locale)

getViewNames

protected String[] getViewNames()
Return the view names (or name patterns) that can be handled by this ViewResolver.

setOrder

public void setOrder(int order)
Set the order in which this ViewResolver is evaluated.

getOrder

public int getOrder()
Return the order in which this ViewResolver is evaluated.

Specified by:
getOrder in interface Ordered
Returns:
the order value

initApplicationContext

protected void initApplicationContext()
Description copied from class: ApplicationObjectSupport
Subclasses can override this for custom initialization behavior.

The default implementation is empty. Called by ApplicationObjectSupport.initApplicationContext(org.springframework.context.ApplicationContext).

Overrides:
initApplicationContext in class ApplicationObjectSupport
See Also:
ApplicationObjectSupport.setApplicationContext(org.springframework.context.ApplicationContext)

getCacheKey

protected Object getCacheKey(String viewName,
                             Locale locale)
This implementation returns just the view name, as this ViewResolver doesn't support localized resolution.

Overrides:
getCacheKey in class AbstractCachingViewResolver

createView

protected View createView(String viewName,
                          Locale locale)
                   throws Exception
Overridden to implement check for "redirect:" prefix.

Not possible in loadView, since overridden loadView versions in subclasses might rely on the superclass always creating instances of the required view class.

Overrides:
createView in class AbstractCachingViewResolver
Parameters:
viewName - the name of the view to retrieve
locale - the Locale to retrieve the view for
Returns:
the View instance, or null if not found (optional, to allow for ViewResolver chaining)
Throws:
Exception - if the view couldn't be resolved
See Also:
loadView(java.lang.String, java.util.Locale), requiredViewClass()

canHandle

protected boolean canHandle(String viewName,
                            Locale locale)
Indicates whether or not this ViewResolver can handle the supplied view name. If not, createView(String, java.util.Locale) will return null. The default implementation checks against the configured view names.

Parameters:
viewName - the name of the view to retrieve
locale - the Locale to retrieve the view for
Returns:
whether this resolver applies to the specified view
See Also:
PatternMatchUtils.simpleMatch(String, String)

loadView

protected View loadView(String viewName,
                        Locale locale)
                 throws Exception
Delegates to buildView for creating a new instance of the specified view class, and applies the following Spring lifecycle methods (as supported by the generic Spring bean factory):
  • ApplicationContextAware's setApplicationContext
  • InitializingBean's afterPropertiesSet

Specified by:
loadView in class AbstractCachingViewResolver
Parameters:
viewName - the name of the view to retrieve
locale - the Locale to retrieve the view for
Returns:
the View instance
Throws:
Exception - if the view couldn't be resolved
See Also:
buildView(String), ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext), InitializingBean.afterPropertiesSet()

buildView

protected AbstractUrlBasedView buildView(String viewName)
                                  throws Exception
Creates a new View instance of the specified view class and configures it. Does not perform any lookup for pre-defined View instances.

Spring lifecycle methods as defined by the bean container do not have to be called here; those will be applied by the loadView method after this method returns.

Subclasses will typically call super.buildView(viewName) first, before setting further properties themselves. loadView will then apply Spring lifecycle methods at the end of this process.

Parameters:
viewName - the name of the view to build
Returns:
the View instance
Throws:
Exception - if the view couldn't be resolved
See Also:
loadView(String, java.util.Locale)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XmlViewResolver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.view
Class XmlViewResolver

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractCachingViewResolver
                extended by  org.springframework.web.servlet.view.XmlViewResolver
All Implemented Interfaces:
DisposableBean, InitializingBean, ApplicationContextAware, Ordered, ServletContextAware, ViewResolver
public class XmlViewResolver
extends AbstractCachingViewResolver
implements Ordered, InitializingBean, DisposableBean

Implementation of ViewResolver that uses bean definitions in an XML file, specified by resource location. The file will typically be located in the WEB-INF directory; default is "/WEB-INF/views.xml".

This ViewResolver does not support internationalization. Consider ResourceBundleViewResolver if you need to apply different view resources per locale.

Note: This ViewResolver implements the Ordered interface to allow for flexible participation in ViewResolver chaining. For example, some special views could be defined via this ViewResolver (giving it 0 as "order" value), while all remaining views could be resolved by a UrlBasedViewResolver.

Since:
18.06.2003
Author:
Juergen Hoeller
See Also:
ResourceLoader.getResource(java.lang.String), ResourceBundleViewResolver, UrlBasedViewResolver

Field Summary
static String DEFAULT_LOCATION
Default if no other location is supplied
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
XmlViewResolver()
Method Summary
void | afterPropertiesSet() Pre-initialize the factory from the XML file.
void | destroy() Close the view bean factory on context shutdown.
protected Object | getCacheKey(String viewName, Locale locale) This implementation returns just the view name, as XmlViewResolver doesn't support localized resolution.
int | getOrder() Return the order value of this object, with a higher value meaning greater in terms of sorting.
protected BeanFactory | initFactory() Initialize the view bean factory from the XML file.
protected View | loadView(String viewName, Locale locale) Subclasses must implement this method, building a View object for the specified view.
void | setLocation(Resource location) Set the location of the XML file that defines the view beans.
void | setOrder(int order)
Methods inherited from class org.springframework.web.servlet.view.AbstractCachingViewResolver
clearCache, createView, isCache, removeFromCache, resolveViewName, setCache
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_LOCATION

public static final String DEFAULT_LOCATION
Default if no other location is supplied

See Also:
Constant Field Values
Constructor Detail

XmlViewResolver

public XmlViewResolver()
Method Detail

setOrder

public void setOrder(int order)

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Returns:
the order value

setLocation

public void setLocation(Resource location)
Set the location of the XML file that defines the view beans.

The default is "/WEB-INF/views.xml".

Parameters:
location - the location of the XML file.

afterPropertiesSet

public void afterPropertiesSet()
                        throws BeansException
Pre-initialize the factory from the XML file. Only effective if caching is enabled.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
BeansException

getCacheKey

protected Object getCacheKey(String viewName,
                             Locale locale)
This implementation returns just the view name, as XmlViewResolver doesn't support localized resolution.

Overrides:
getCacheKey in class AbstractCachingViewResolver

loadView

protected View loadView(String viewName,
                        Locale locale)
                 throws BeansException
Description copied from class: AbstractCachingViewResolver
Subclasses must implement this method, building a View object for the specified view. The returned View objects will be cached by this ViewResolver base class.

Subclasses are not forced to support internationalization: A subclass that does not may simply ignore the locale parameter.

Specified by:
loadView in class AbstractCachingViewResolver
Parameters:
viewName - the name of the view to retrieve
locale - the Locale to retrieve the view for
Returns:
the View instance, or null if not found (optional, to allow for ViewResolver chaining)
Throws:
BeansException
See Also:
AbstractCachingViewResolver.resolveViewName(java.lang.String, java.util.Locale)

initFactory

protected BeanFactory initFactory()
                           throws BeansException
Initialize the view bean factory from the XML file. Synchronized because of access by parallel threads.

Throws:
BeansException - in case of initialization errors

destroy

public void destroy()
             throws BeansException
Close the view bean factory on context shutdown.

Specified by:
destroy in interface DisposableBean
Throws:
BeansException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.servlet.view.document

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.servlet.view.document

Support classes for document generation, providing View implementations for PDF and Excel.

See:
Description

Class Summary
AbstractExcelView | Convenient superclass for Excel document views.
AbstractJExcelView | Convenient superclass for Excel document views.
AbstractPdfStamperView | Abstract superclass for PDF views that operate on an existing document with an AcroForm.
AbstractPdfView | Abstract superclass for PDF views, using Bruno Lowagie's iText package.

Package org.springframework.web.servlet.view.document Description

Support classes for document generation, providing View implementations for PDF and Excel.


org.springframework.web.servlet.view.document Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.servlet.view.document

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.context.support.ApplicationObjectSupport (implements org.springframework.context.ApplicationContextAware)
      • org.springframework.web.context.support.WebApplicationObjectSupport (implements org.springframework.web.context.ServletContextAware)
        • org.springframework.web.servlet.view.AbstractView (implements org.springframework.beans.factory.BeanNameAware, org.springframework.web.servlet.View)
          • org.springframework.web.servlet.view.document.AbstractExcelView
          • org.springframework.web.servlet.view.document.AbstractJExcelView
          • org.springframework.web.servlet.view.document.AbstractPdfView
          • org.springframework.web.servlet.view.AbstractUrlBasedView (implements org.springframework.beans.factory.InitializingBean)
            • org.springframework.web.servlet.view.document.AbstractPdfStamperView


AbstractExcelView

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.view.document
Class AbstractExcelView

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
                extended by  org.springframework.web.servlet.view.document.AbstractExcelView
All Implemented Interfaces:
BeanNameAware, ApplicationContextAware, ServletContextAware, View
public abstract class AbstractExcelView
extends AbstractView

Convenient superclass for Excel document views. Compatible with Apache POI 3.0 as well as 3.5, as of Spring 3.0.

Properties:

  • url (optional): The url of an existing Excel document to pick as a starting point. It is done without localization part nor the ".xls" extension.

The file will be searched with locations in the following order:

  • [url]_[language]_[country].xls
  • [url]_[language].xls
  • [url].xls

For working with the workbook in the subclass, see Jakarta's POI site

As an example, you can try this snippet:

 protected void buildExcelDocument(
     Map<String, Object> model, HSSFWorkbook workbook,
     HttpServletRequest request, HttpServletResponse response) {

   // Go to the first sheet.
   // getSheetAt: only if workbook is created from an existing document
         // HSSFSheet sheet = workbook.getSheetAt(0);
         HSSFSheet sheet = workbook.createSheet("Spring");
         sheet.setDefaultColumnWidth(12);

   // Write a text at A1.
   HSSFCell cell = getCell(sheet, 0, 0);
   setText(cell, "Spring POI test");

   // Write the current date at A2.
   HSSFCellStyle dateStyle = workbook.createCellStyle();
   dateStyle.setDataFormat(HSSFDataFormat.getBuiltinFormat("m/d/yy"));
   cell = getCell(sheet, 1, 0);
   cell.setCellValue(new Date());
   cell.setCellStyle(dateStyle);

   // Write a number at A3
   getCell(sheet, 2, 0).setCellValue(458);

   // Write a range of numbers.
   HSSFRow sheetRow = sheet.createRow(3);
   for (short i = 0; i < 10; i++) {
     sheetRow.createCell(i).setCellValue(i * 10);
   }
 }
This class is similar to the AbstractPdfView class in usage style.

Author:
Jean-Pierre Pawlak, Juergen Hoeller
See Also:
AbstractPdfView

Field Summary
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
AbstractExcelView()
Default Constructor.
Method Summary
protected abstract void | buildExcelDocument(Map<String,Object> model, HSSFWorkbook workbook, HttpServletRequest request, HttpServletResponse response) Subclasses must implement this method to create an Excel HSSFWorkbook document, given the model.
protected boolean | generatesDownloadContent() Return whether this view generates download content (typically binary content like PDF or Excel files).
protected HSSFCell | getCell(HSSFSheet sheet, int row, int col) Convenient method to obtain the cell in the given sheet, row and column.
protected HSSFWorkbook | getTemplateSource(String url, HttpServletRequest request) Creates the workbook from an existing XLS document.
protected void | renderMergedOutputModel(Map<String,Object> model, HttpServletRequest request, HttpServletResponse response) Renders the Excel view, given the specified model.
protected void | setText(HSSFCell cell, String text) Convenient method to set a String as text content in a cell.
void | setUrl(String url) Set the URL of the Excel workbook source, without localization part nor extension.
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, toString, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AbstractExcelView

public AbstractExcelView()
Default Constructor. Sets the content type of the view to "application/vnd.ms-excel".

Method Detail

setUrl

public void setUrl(String url)
Set the URL of the Excel workbook source, without localization part nor extension.

generatesDownloadContent

protected boolean generatesDownloadContent()
Description copied from class: AbstractView
Return whether this view generates download content (typically binary content like PDF or Excel files).

The default implementation returns false. Subclasses are encouraged to return true here if they know that they are generating download content that requires temporary caching on the client side, typically via the response OutputStream.

Overrides:
generatesDownloadContent in class AbstractView
See Also:
AbstractView.prepareResponse(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), ServletResponse.getOutputStream()

renderMergedOutputModel

protected final void renderMergedOutputModel(Map<String,Object> model,
                                             HttpServletRequest request,
                                             HttpServletResponse response)
                                      throws Exception
Renders the Excel view, given the specified model.

Specified by:
renderMergedOutputModel in class AbstractView
Parameters:
model - combined output Map (never null), with dynamic values taking precedence over static attributes
request - current HTTP request
response - current HTTP response
Throws:
Exception - if rendering failed

getTemplateSource

protected HSSFWorkbook getTemplateSource(String url,
                                         HttpServletRequest request)
                                  throws Exception
Creates the workbook from an existing XLS document.

Parameters:
url - the URL of the Excel template without localization part nor extension
request - current HTTP request
Returns:
the HSSFWorkbook
Throws:
Exception - in case of failure

buildExcelDocument

protected abstract void buildExcelDocument(Map<String,Object> model,
                                           HSSFWorkbook workbook,
                                           HttpServletRequest request,
                                           HttpServletResponse response)
                                    throws Exception
Subclasses must implement this method to create an Excel HSSFWorkbook document, given the model.

Parameters:
model - the model Map
workbook - the Excel workbook to complete
request - in case we need locale etc. Shouldn't look at attributes.
response - in case we need to set cookies. Shouldn't write to it.
Throws:
Exception

getCell

protected HSSFCell getCell(HSSFSheet sheet,
                           int row,
                           int col)
Convenient method to obtain the cell in the given sheet, row and column.

Creates the row and the cell if they still doesn't already exist. Thus, the column can be passed as an int, the method making the needed downcasts.

Parameters:
sheet - a sheet object. The first sheet is usually obtained by workbook.getSheetAt(0)
row - thr row number
col - the column number
Returns:
the HSSFCell

setText

protected void setText(HSSFCell cell,
                       String text)
Convenient method to set a String as text content in a cell.

Parameters:
cell - the cell in which the text must be put
text - the text to put in the cell
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractJExcelView

org.springframework.web.servlet.view.document
Class AbstractJExcelView

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
                extended by  org.springframework.web.servlet.view.document.AbstractJExcelView
All Implemented Interfaces:
BeanNameAware, ApplicationContextAware, ServletContextAware, View
public abstract class AbstractJExcelView
extends AbstractView

Convenient superclass for Excel document views.

This class uses the JExcelAPI instead of POI. More information on JExcelAPI can be found on their website.

Properties:

  • url (optional): The url of an existing Excel document to pick as a starting point. It is done without localization part nor the .xls extension.

The file will be searched with locations in the following order:

  • [url]_[language]_[country].xls
  • [url]_[language].xls
  • [url].xls

For working with the workbook in the subclass, see Java Excel API site

As an example, you can try this snippet:

 protected void buildExcelDocument(
      Map<String, Object> model, WritableWorkbook workbook,
                HttpServletRequest request, HttpServletResponse response) {

         if (workbook.getNumberOfSheets() == 0) {
             workbook.createSheet("Spring", 0);
   }

         WritableSheet sheet = workbook.getSheet("Spring");
         Label label = new Label(0, 0, "This is a nice label");
         sheet.addCell(label);
 }
The use of this view is close to the AbstractExcelView class, just using the JExcel API instead of the Apache POI API.

Since:
1.2.5
Author:
Bram Smeets, Alef Arendsen, Juergen Hoeller
See Also:
AbstractExcelView, AbstractPdfView

Field Summary
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
AbstractJExcelView()
Default Constructor.
Method Summary
protected abstract void | buildExcelDocument(Map<String,Object> model, jxl.write.WritableWorkbook workbook, HttpServletRequest request, HttpServletResponse response) Subclasses must implement this method to create an Excel Workbook document, given the model.
protected boolean | generatesDownloadContent() Return whether this view generates download content (typically binary content like PDF or Excel files).
protected jxl.Workbook | getTemplateSource(String url, HttpServletRequest request) Create the workbook from an existing XLS document.
protected void | renderMergedOutputModel(Map<String,Object> model, HttpServletRequest request, HttpServletResponse response) Renders the Excel view, given the specified model.
void | setUrl(String url) Set the URL of the Excel workbook source, without localization part nor extension.
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, toString, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AbstractJExcelView

public AbstractJExcelView()
Default Constructor. Sets the content type of the view to "application/vnd.ms-excel".

Method Detail

setUrl

public void setUrl(String url)
Set the URL of the Excel workbook source, without localization part nor extension.

generatesDownloadContent

protected boolean generatesDownloadContent()
Description copied from class: AbstractView
Return whether this view generates download content (typically binary content like PDF or Excel files).

The default implementation returns false. Subclasses are encouraged to return true here if they know that they are generating download content that requires temporary caching on the client side, typically via the response OutputStream.

Overrides:
generatesDownloadContent in class AbstractView
See Also:
AbstractView.prepareResponse(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), ServletResponse.getOutputStream()

renderMergedOutputModel

protected final void renderMergedOutputModel(Map<String,Object> model,
                                             HttpServletRequest request,
                                             HttpServletResponse response)
                                      throws Exception
Renders the Excel view, given the specified model.

Specified by:
renderMergedOutputModel in class AbstractView
Parameters:
model - combined output Map (never null), with dynamic values taking precedence over static attributes
request - current HTTP request
response - current HTTP response
Throws:
Exception - if rendering failed

getTemplateSource

protected jxl.Workbook getTemplateSource(String url,
                                         HttpServletRequest request)
                                  throws Exception
Create the workbook from an existing XLS document.

Parameters:
url - the URL of the Excel template without localization part nor extension
request - current HTTP request
Returns:
the template workbook
Throws:
Exception - in case of failure

buildExcelDocument

protected abstract void buildExcelDocument(Map<String,Object> model,
                                           jxl.write.WritableWorkbook workbook,
                                           HttpServletRequest request,
                                           HttpServletResponse response)
                                    throws Exception
Subclasses must implement this method to create an Excel Workbook document, given the model.

Parameters:
model - the model Map
workbook - the Excel workbook to complete
request - in case we need locale etc. Shouldn't look at attributes.
response - in case we need to set cookies. Shouldn't write to it.
Throws:
Exception - in case of failure
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractPdfStamperView

org.springframework.web.servlet.view.document
Class AbstractPdfStamperView

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
                extended by  org.springframework.web.servlet.view.AbstractUrlBasedView
                    extended by  org.springframework.web.servlet.view.document.AbstractPdfStamperView
All Implemented Interfaces:
BeanNameAware, InitializingBean, ApplicationContextAware, ServletContextAware, View
public abstract class AbstractPdfStamperView
extends AbstractUrlBasedView

Abstract superclass for PDF views that operate on an existing document with an AcroForm. Application-specific view classes will extend this class to merge the PDF form with model data.

Thanks to Bryant Larsen for the suggestion and the original prototype!

Since:
2.5.4
Author:
Juergen Hoeller
See Also:
AbstractPdfView

Field Summary
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
AbstractPdfStamperView()
Method Summary
protected boolean | generatesDownloadContent() Return whether this view generates download content (typically binary content like PDF or Excel files).
protected abstract void | mergePdfDocument(Map<String,Object> model, com.lowagie.text.pdf.PdfStamper stamper, HttpServletRequest request, HttpServletResponse response) Subclasses must implement this method to merge the PDF form with the given model data.
protected com.lowagie.text.pdf.PdfReader | readPdfResource() Read the raw PDF resource into an iText PdfReader.
protected void | renderMergedOutputModel(Map<String,Object> model, HttpServletRequest request, HttpServletResponse response) Subclasses must implement this method to actually render the view.
Methods inherited from class org.springframework.web.servlet.view.AbstractUrlBasedView
afterPropertiesSet, checkResource, getUrl, isUrlRequired, setUrl, toString
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AbstractPdfStamperView

public AbstractPdfStamperView()
Method Detail

generatesDownloadContent

protected boolean generatesDownloadContent()
Description copied from class: AbstractView
Return whether this view generates download content (typically binary content like PDF or Excel files).

The default implementation returns false. Subclasses are encouraged to return true here if they know that they are generating download content that requires temporary caching on the client side, typically via the response OutputStream.

Overrides:
generatesDownloadContent in class AbstractView
See Also:
AbstractView.prepareResponse(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), ServletResponse.getOutputStream()

renderMergedOutputModel

protected final void renderMergedOutputModel(Map<String,Object> model,
                                             HttpServletRequest request,
                                             HttpServletResponse response)
                                      throws Exception
Description copied from class: AbstractView
Subclasses must implement this method to actually render the view.

The first step will be preparing the request: In the JSP case, this would mean setting model objects as request attributes. The second step will be the actual rendering of the view, for example including the JSP via a RequestDispatcher.

Specified by:
renderMergedOutputModel in class AbstractView
Parameters:
model - combined output Map (never null), with dynamic values taking precedence over static attributes
request - current HTTP request
response - current HTTP response
Throws:
Exception - if rendering failed

readPdfResource

protected com.lowagie.text.pdf.PdfReader readPdfResource()
                                                  throws IOException
Read the raw PDF resource into an iText PdfReader.

The default implementation resolve the specified "url" property as ApplicationContext resource.

Returns:
the PdfReader instance
Throws:
IOException - if resource access failed
See Also:
AbstractUrlBasedView.setUrl(java.lang.String)

mergePdfDocument

protected abstract void mergePdfDocument(Map<String,Object> model,
                                         com.lowagie.text.pdf.PdfStamper stamper,
                                         HttpServletRequest request,
                                         HttpServletResponse response)
                                  throws Exception
Subclasses must implement this method to merge the PDF form with the given model data.

This is where you are able to set values on the AcroForm. An example of what can be done at this level is:

 // get the form from the document
 AcroFields form = stamper.getAcroFields();

 // set some values on the form
 form.setField("field1", "value1");
 form.setField("field2", "Vvlue2");

 // set the disposition and filename
 response.setHeader("Content-disposition", "attachment; FILENAME=someName.pdf");

Note that the passed-in HTTP response is just supposed to be used for setting cookies or other HTTP headers. The built PDF document itself will automatically get written to the response after this method returns.

Parameters:
model - the model Map
stamper - the PdfStamper instance that will contain the AcroFields. You may also customize this PdfStamper instance according to your needs, e.g. setting the "formFlattening" property.
request - in case we need locale etc. Shouldn't look at attributes.
response - in case we need to set cookies. Shouldn't write to it.
Throws:
Exception - any exception that occured during document building
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractPdfView

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.view.document
Class AbstractPdfView

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
                extended by  org.springframework.web.servlet.view.document.AbstractPdfView
All Implemented Interfaces:
BeanNameAware, ApplicationContextAware, ServletContextAware, View
public abstract class AbstractPdfView
extends AbstractView

Abstract superclass for PDF views, using Bruno Lowagie's iText package. Application-specific view classes will extend this class. The view will be held in the subclass itself, not in a template.

Note: Internet Explorer requires a ".pdf" extension, as it doesn't always respect the declared content type.

Author:
Rod Johnson, Juergen Hoeller, Jean-Pierre Pawlak
See Also:
AbstractPdfStamperView

Field Summary
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
AbstractPdfView()
This constructor sets the appropriate content type "application/pdf".
Method Summary
protected abstract void | buildPdfDocument(Map<String,Object> model, com.lowagie.text.Document document, com.lowagie.text.pdf.PdfWriter writer, HttpServletRequest request, HttpServletResponse response) Subclasses must implement this method to build an iText PDF document, given the model.
protected void | buildPdfMetadata(Map<String,Object> model, com.lowagie.text.Document document, HttpServletRequest request) Populate the iText Document's meta fields (author, title, etc.).
protected boolean | generatesDownloadContent() Return whether this view generates download content (typically binary content like PDF or Excel files).
protected int | getViewerPreferences() Return the viewer preferences for the PDF file.
protected com.lowagie.text.Document | newDocument() Create a new document to hold the PDF contents.
protected com.lowagie.text.pdf.PdfWriter | newWriter(com.lowagie.text.Document document, OutputStream os) Create a new PdfWriter for the given iText Document.
protected void | prepareWriter(Map<String,Object> model, com.lowagie.text.pdf.PdfWriter writer, HttpServletRequest request) Prepare the given PdfWriter.
protected void | renderMergedOutputModel(Map<String,Object> model, HttpServletRequest request, HttpServletResponse response) Subclasses must implement this method to actually render the view.
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, toString, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AbstractPdfView

public AbstractPdfView()
This constructor sets the appropriate content type "application/pdf". Note that IE won't take much notice of this, but there's not a lot we can do about this. Generated documents should have a ".pdf" extension.

Method Detail

generatesDownloadContent

protected boolean generatesDownloadContent()
Description copied from class: AbstractView
Return whether this view generates download content (typically binary content like PDF or Excel files).

The default implementation returns false. Subclasses are encouraged to return true here if they know that they are generating download content that requires temporary caching on the client side, typically via the response OutputStream.

Overrides:
generatesDownloadContent in class AbstractView
See Also:
AbstractView.prepareResponse(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), ServletResponse.getOutputStream()

renderMergedOutputModel

protected final void renderMergedOutputModel(Map<String,Object> model,
                                             HttpServletRequest request,
                                             HttpServletResponse response)
                                      throws Exception
Description copied from class: AbstractView
Subclasses must implement this method to actually render the view.

The first step will be preparing the request: In the JSP case, this would mean setting model objects as request attributes. The second step will be the actual rendering of the view, for example including the JSP via a RequestDispatcher.

Specified by:
renderMergedOutputModel in class AbstractView
Parameters:
model - combined output Map (never null), with dynamic values taking precedence over static attributes
request - current HTTP request
response - current HTTP response
Throws:
Exception - if rendering failed

newDocument

protected com.lowagie.text.Document newDocument()
Create a new document to hold the PDF contents.

By default returns an A4 document, but the subclass can specify any Document, possibly parameterized via bean properties defined on the View.

Returns:
the newly created iText Document instance
See Also:
Document.Document(com.lowagie.text.Rectangle)

newWriter

protected com.lowagie.text.pdf.PdfWriter newWriter(com.lowagie.text.Document document,
                                                   OutputStream os)
                                            throws com.lowagie.text.DocumentException
Create a new PdfWriter for the given iText Document.

Parameters:
document - the iText Document to create a writer for
os - the OutputStream to write to
Returns:
the PdfWriter instance to use
Throws:
com.lowagie.text.DocumentException - if thrown during writer creation

prepareWriter

protected void prepareWriter(Map<String,Object> model,
                             com.lowagie.text.pdf.PdfWriter writer,
                             HttpServletRequest request)
                      throws com.lowagie.text.DocumentException
Prepare the given PdfWriter. Called before building the PDF document, that is, before the call to Document.open().

Useful for registering a page event listener, for example. The default implementation sets the viewer preferences as returned by this class's getViewerPreferences() method.

Parameters:
model - the model, in case meta information must be populated from it
writer - the PdfWriter to prepare
request - in case we need locale etc. Shouldn't look at attributes.
Throws:
com.lowagie.text.DocumentException - if thrown during writer preparation
See Also:
Document.open(),
PdfWriter.setPageEvent(com.lowagie.text.pdf.PdfPageEvent),
PdfWriter.setViewerPreferences(int),
getViewerPreferences()

getViewerPreferences

protected int getViewerPreferences()
Return the viewer preferences for the PDF file.

By default returns AllowPrinting and PageLayoutSinglePage, but can be subclassed. The subclass can either have fixed preferences or retrieve them from bean properties defined on the View.

Returns:
an int containing the bits information against PdfWriter definitions
See Also:
PdfWriter.AllowPrinting, PdfWriter.PageLayoutSinglePage

buildPdfMetadata

protected void buildPdfMetadata(Map<String,Object> model,
                                com.lowagie.text.Document document,
                                HttpServletRequest request)
Populate the iText Document's meta fields (author, title, etc.).
Default is an empty implementation. Subclasses may override this method to add meta fields such as title, subject, author, creator, keywords, etc. This method is called after assigning a PdfWriter to the Document and before calling document.open().

Parameters:
model - the model, in case meta information must be populated from it
document - the iText document being populated
request - in case we need locale etc. Shouldn't look at attributes.
See Also:
Document.addTitle(java.lang.String),
Document.addSubject(java.lang.String),
Document.addKeywords(java.lang.String),
Document.addAuthor(java.lang.String),
Document.addCreator(java.lang.String),
Document.addProducer(),
Document.addCreationDate(),
Document.addHeader(java.lang.String, java.lang.String)

buildPdfDocument

protected abstract void buildPdfDocument(Map<String,Object> model,
                                         com.lowagie.text.Document document,
                                         com.lowagie.text.pdf.PdfWriter writer,
                                         HttpServletRequest request,
                                         HttpServletResponse response)
                                  throws Exception
Subclasses must implement this method to build an iText PDF document, given the model. Called between Document.open() and Document.close() calls.

Note that the passed-in HTTP response is just supposed to be used for setting cookies or other HTTP headers. The built PDF document itself will automatically get written to the response after this method returns.

Parameters:
model - the model Map
document - the iText Document to add elements to
writer - the PdfWriter to use
request - in case we need locale etc. Shouldn't look at attributes.
response - in case we need to set cookies. Shouldn't write to it.
Throws:
Exception - any exception that occured during document building
See Also:
Document.open(), Document.close()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.servlet.view.feed

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.servlet.view.feed

Support classes for feed generation, providing View implementations for Atom and RSS

See:
Description

Class Summary
AbstractAtomFeedView | Abstract superclass for Atom Feed views, using java.net's ROME package.
AbstractFeedView<T extends WireFeed> | Abstract base class for Atom and RSS Feed views, using java.net's ROME package.
AbstractRssFeedView | Abstract superclass for RSS Feed views, using java.net's ROME package.

Package org.springframework.web.servlet.view.feed Description

Support classes for feed generation, providing View implementations for Atom and RSS


org.springframework.web.servlet.view.feed Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.servlet.view.feed

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.context.support.ApplicationObjectSupport (implements org.springframework.context.ApplicationContextAware)
      • org.springframework.web.context.support.WebApplicationObjectSupport (implements org.springframework.web.context.ServletContextAware)
        • org.springframework.web.servlet.view.AbstractView (implements org.springframework.beans.factory.BeanNameAware, org.springframework.web.servlet.View)
          • org.springframework.web.servlet.view.feed.AbstractFeedView<T>
            • org.springframework.web.servlet.view.feed.AbstractAtomFeedView
            • org.springframework.web.servlet.view.feed.AbstractRssFeedView


AbstractAtomFeedView

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.view.feed
Class AbstractAtomFeedView

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
                extended by  org.springframework.web.servlet.view.feed.AbstractFeedView<com.sun.syndication.feed.atom.Feed>
                    extended by  org.springframework.web.servlet.view.feed.AbstractAtomFeedView
All Implemented Interfaces:
BeanNameAware, ApplicationContextAware, ServletContextAware, View
public abstract class AbstractAtomFeedView
extends AbstractFeedView<com.sun.syndication.feed.atom.Feed>

Abstract superclass for Atom Feed views, using java.net's ROME package.

Application-specific view classes will extend this class. The view will be held in the subclass itself, not in a template.

Main entry points are the AbstractFeedView.buildFeedMetadata(Map, WireFeed, HttpServletRequest) and buildFeedEntries(Map, HttpServletRequest, HttpServletResponse).

Thanks to Jettro Coenradie and Sergio Bossa for the original feed view prototype!

Since:
3.0
Author:
Arjen Poutsma, Juergen Hoeller
See Also:
AbstractFeedView.buildFeedMetadata(Map, WireFeed, HttpServletRequest), buildFeedEntries(Map, HttpServletRequest, HttpServletResponse), Atom Syndication Format

Field Summary
static String DEFAULT_FEED_TYPE
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
AbstractAtomFeedView()
Method Summary
protected  void buildFeedEntries(Map<String,Object> model, com.sun.syndication.feed.atom.Feed feed, HttpServletRequest request, HttpServletResponse response)
Invokes buildFeedEntries(Map, HttpServletRequest, HttpServletResponse) to get a list of feed entries.
protected abstract  List<com.sun.syndication.feed.atom.Entry> buildFeedEntries(Map<String,Object> model, HttpServletRequest request, HttpServletResponse response)
Subclasses must implement this method to build feed entries, given the model.
protected  com.sun.syndication.feed.atom.Feed newFeed()
Create a new Feed instance to hold the entries.
 void setFeedType(String feedType)
Sets the Rome feed type to use.
Methods inherited from class org.springframework.web.servlet.view.feed.AbstractFeedView
buildFeedMetadata, renderMergedOutputModel
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, toString, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

DEFAULT_FEED_TYPE

public static final String DEFAULT_FEED_TYPE
See Also:
Constant Field Values
Constructor Detail

AbstractAtomFeedView

public AbstractAtomFeedView()
Method Detail

setFeedType

public void setFeedType(String feedType)
Sets the Rome feed type to use.

Defaults to Atom 1.0.

See Also:
WireFeed.setFeedType(String), DEFAULT_FEED_TYPE

newFeed

protected com.sun.syndication.feed.atom.Feed newFeed()
Create a new Feed instance to hold the entries.

By default returns an Atom 1.0 feed, but the subclass can specify any Feed.

Specified by:
newFeed in class AbstractFeedView<com.sun.syndication.feed.atom.Feed>
Returns:
the newly created Feed instance
See Also:
setFeedType(String)

buildFeedEntries

protected final void buildFeedEntries(Map<String,Object> model,
                                      com.sun.syndication.feed.atom.Feed feed,
                                      HttpServletRequest request,
                                      HttpServletResponse response)
                               throws Exception
Invokes buildFeedEntries(Map, HttpServletRequest, HttpServletResponse) to get a list of feed entries.

Specified by:
buildFeedEntries in class AbstractFeedView<com.sun.syndication.feed.atom.Feed>
Parameters:
model - the model Map
feed - the feed to add entries to
request - in case we need locale etc. Shouldn't look at attributes.
response - in case we need to set cookies. Shouldn't write to it.
Throws:
Exception - any exception that occured during building

buildFeedEntries

protected abstract List<com.sun.syndication.feed.atom.Entry> buildFeedEntries(Map<String,Object> model,
                                                                              HttpServletRequest request,
                                                                              HttpServletResponse response)
                                                                       throws Exception
Subclasses must implement this method to build feed entries, given the model.

Note that the passed-in HTTP response is just supposed to be used for setting cookies or other HTTP headers. The built feed itself will automatically get written to the response after this method returns.

Parameters:
model - the model Map
request - in case we need locale etc. Shouldn't look at attributes.
response - in case we need to set cookies. Shouldn't write to it.
Returns:
the feed entries to be added to the feed
Throws:
Exception - any exception that occured during document building
See Also:
Entry
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractFeedView

org.springframework.web.servlet.view.feed
Class AbstractFeedView<T extends com.sun.syndication.feed.WireFeed>

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
                extended by  org.springframework.web.servlet.view.feed.AbstractFeedView<T>
All Implemented Interfaces:
BeanNameAware, ApplicationContextAware, ServletContextAware, View
Direct Known Subclasses:
AbstractAtomFeedView, AbstractRssFeedView
public abstract class AbstractFeedView<T extends com.sun.syndication.feed.WireFeed>
extends AbstractView

Abstract base class for Atom and RSS Feed views, using java.net's ROME package.

Application-specific view classes will typically extend from either AbstractRssFeedView or AbstractAtomFeedView instead of from this class.

Thanks to Jettro Coenradie and Sergio Bossa for the original feed view prototype!

Since:
3.0
Author:
Arjen Poutsma, Juergen Hoeller
See Also:
AbstractRssFeedView, AbstractAtomFeedView

Field Summary
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
AbstractFeedView()
Method Summary
protected abstract void | buildFeedEntries(Map<String,Object> model, T feed, HttpServletRequest request, HttpServletResponse response) Subclasses must implement this method to build feed entries, given the model.
protected void | buildFeedMetadata(Map<String,Object> model, T feed, HttpServletRequest request) Populate the feed metadata (title, link, description, etc.).
protected abstract T | newFeed() Create a new feed to hold the entries.
protected void | renderMergedOutputModel(Map<String,Object> model, HttpServletRequest request, HttpServletResponse response) Subclasses must implement this method to actually render the view.
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, toString, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AbstractFeedView

public AbstractFeedView()
Method Detail

renderMergedOutputModel

protected final void renderMergedOutputModel(Map<String,Object> model,
                                             HttpServletRequest request,
                                             HttpServletResponse response)
                                      throws Exception
Description copied from class: AbstractView
Subclasses must implement this method to actually render the view.

The first step will be preparing the request: In the JSP case, this would mean setting model objects as request attributes. The second step will be the actual rendering of the view, for example including the JSP via a RequestDispatcher.

Specified by:
renderMergedOutputModel in class AbstractView
Parameters:
model - combined output Map (never null), with dynamic values taking precedence over static attributes
request - current HTTP request
response - current HTTP response
Throws:
Exception - if rendering failed

newFeed

protected abstract T newFeed()
Create a new feed to hold the entries.

Returns:
the newly created Feed instance

buildFeedMetadata

protected void buildFeedMetadata(Map<String,Object> model,
                                 T feed,
                                 HttpServletRequest request)
Populate the feed metadata (title, link, description, etc.).

Default is an empty implementation. Subclasses can override this method to add meta fields such as title, link description, etc.

Parameters:
model - the model, in case meta information must be populated from it
feed - the feed being populated
request - in case we need locale etc. Shouldn't look at attributes.

buildFeedEntries

protected abstract void buildFeedEntries(Map<String,Object> model,
                                         T feed,
                                         HttpServletRequest request,
                                         HttpServletResponse response)
                                  throws Exception
Subclasses must implement this method to build feed entries, given the model.

Note that the passed-in HTTP response is just supposed to be used for setting cookies or other HTTP headers. The built feed itself will automatically get written to the response after this method returns.

Parameters:
model - the model Map
feed - the feed to add entries to
request - in case we need locale etc. Shouldn't look at attributes.
response - in case we need to set cookies. Shouldn't write to it.
Throws:
Exception - any exception that occured during building
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbstractRssFeedView

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.view.feed
Class AbstractRssFeedView

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
                extended by  org.springframework.web.servlet.view.feed.AbstractFeedView<com.sun.syndication.feed.rss.Channel>
                    extended by  org.springframework.web.servlet.view.feed.AbstractRssFeedView
All Implemented Interfaces:
BeanNameAware, ApplicationContextAware, ServletContextAware, View
public abstract class AbstractRssFeedView
extends AbstractFeedView<com.sun.syndication.feed.rss.Channel>

Abstract superclass for RSS Feed views, using java.net's ROME package.

Application-specific view classes will extend this class. The view will be held in the subclass itself, not in a template.

Main entry points are the AbstractFeedView.buildFeedMetadata(Map, WireFeed , HttpServletRequest) and buildFeedItems(Map, HttpServletRequest, HttpServletResponse).

Thanks to Jettro Coenradie and Sergio Bossa for the original feed view prototype!

Since:
3.0
Author:
Arjen Poutsma, Juergen Hoeller
See Also:
AbstractFeedView.buildFeedMetadata(Map, WireFeed , HttpServletRequest), buildFeedItems(Map, HttpServletRequest, HttpServletResponse)

Field Summary
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
AbstractRssFeedView()
Method Summary
protected  void buildFeedEntries(Map<String,Object> model, com.sun.syndication.feed.rss.Channel channel, HttpServletRequest request, HttpServletResponse response)
Invokes buildFeedItems(Map, HttpServletRequest, HttpServletResponse) to get a list of feed items.
protected abstract  List<com.sun.syndication.feed.rss.Item> buildFeedItems(Map<String,Object> model, HttpServletRequest request, HttpServletResponse response)
Subclasses must implement this method to build feed items, given the model.
protected  com.sun.syndication.feed.rss.Channel newFeed()
Create a new Channel instance to hold the entries.
Methods inherited from class org.springframework.web.servlet.view.feed.AbstractFeedView
buildFeedMetadata, renderMergedOutputModel
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, toString, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AbstractRssFeedView

public AbstractRssFeedView()
Method Detail

newFeed

protected com.sun.syndication.feed.rss.Channel newFeed()
Create a new Channel instance to hold the entries.

By default returns an RSS 2.0 channel, but the subclass can specify any channel.

Specified by:
newFeed in class AbstractFeedView<com.sun.syndication.feed.rss.Channel>
Returns:
the newly created Feed instance

buildFeedEntries

protected final void buildFeedEntries(Map<String,Object> model,
                                      com.sun.syndication.feed.rss.Channel channel,
                                      HttpServletRequest request,
                                      HttpServletResponse response)
                               throws Exception
Invokes buildFeedItems(Map, HttpServletRequest, HttpServletResponse) to get a list of feed items.

Specified by:
buildFeedEntries in class AbstractFeedView<com.sun.syndication.feed.rss.Channel>
Parameters:
model - the model Map
channel - the feed to add entries to
request - in case we need locale etc. Shouldn't look at attributes.
response - in case we need to set cookies. Shouldn't write to it.
Throws:
Exception - any exception that occured during building

buildFeedItems

protected abstract List<com.sun.syndication.feed.rss.Item> buildFeedItems(Map<String,Object> model,
                                                                          HttpServletRequest request,
                                                                          HttpServletResponse response)
                                                                   throws Exception
Subclasses must implement this method to build feed items, given the model.

Note that the passed-in HTTP response is just supposed to be used for setting cookies or other HTTP headers. The built feed itself will automatically get written to the response after this method returns.

Parameters:
model - the model Map
request - in case we need locale etc. Shouldn't look at attributes.
response - in case we need to set cookies. Shouldn't write to it.
Returns:
the feed items to be added to the feed
Throws:
Exception - any exception that occured during document building
See Also:
Item
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.servlet.view.freemarker

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.servlet.view.freemarker

Support classes for the integration of FreeMarker as Spring web view technology.

See:
Description

Interface Summary
FreeMarkerConfig Interface to be implemented by objects that configure and manage a FreeMarker Configuration object in a web environment.

Class Summary
FreeMarkerConfigurer | JavaBean to configure FreeMarker for web usage, via the "configLocation" and/or "freemarkerSettings" and/or "templateLoaderPath" properties.
FreeMarkerView | View using the FreeMarker template engine.
FreeMarkerViewResolver | Convenience subclass of UrlBasedViewResolver that supports FreeMarkerView (i.e.

Package org.springframework.web.servlet.view.freemarker Description

Support classes for the integration of FreeMarker as Spring web view technology. Contains a View implementation for FreeMarker templates.


org.springframework.web.servlet.view.freemarker Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.servlet.view.freemarker

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.context.support.ApplicationObjectSupport (implements org.springframework.context.ApplicationContextAware)
      • org.springframework.web.context.support.WebApplicationObjectSupport (implements org.springframework.web.context.ServletContextAware)
        • org.springframework.web.servlet.view.AbstractCachingViewResolver (implements org.springframework.web.servlet.ViewResolver)
          • org.springframework.web.servlet.view.UrlBasedViewResolver (implements org.springframework.core.Ordered)
            • org.springframework.web.servlet.view.AbstractTemplateViewResolver
              • org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver
        • org.springframework.web.servlet.view.AbstractView (implements org.springframework.beans.factory.BeanNameAware, org.springframework.web.servlet.View)
          • org.springframework.web.servlet.view.AbstractUrlBasedView (implements org.springframework.beans.factory.InitializingBean)
            • org.springframework.web.servlet.view.AbstractTemplateView
              • org.springframework.web.servlet.view.freemarker.FreeMarkerView
    • org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
      • org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer (implements org.springframework.web.servlet.view.freemarker.FreeMarkerConfig, org.springframework.beans.factory.InitializingBean, org.springframework.context.ResourceLoaderAware, org.springframework.web.context.ServletContextAware)

Interface Hierarchy

  • org.springframework.web.servlet.view.freemarker.FreeMarkerConfig


FreeMarkerConfig

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.view.freemarker
Interface FreeMarkerConfig

All Known Implementing Classes:
FreeMarkerConfigurer
public interface FreeMarkerConfig

Interface to be implemented by objects that configure and manage a FreeMarker Configuration object in a web environment. Detected and used by FreeMarkerView.

Since:
03.03.2004
Author:
Darren Davison, Rob Harrop
See Also:
FreeMarkerConfigurer, FreeMarkerView

Method Summary
Configuration | getConfiguration() Return the FreeMarker Configuration object for the current web application context.
TaglibFactory | getTaglibFactory() Returns the TaglibFactory used to enable JSP tags to be accessed from FreeMarker templates.

Method Detail

getConfiguration

Configuration getConfiguration()
Return the FreeMarker Configuration object for the current web application context.

A FreeMarker Configuration object may be used to set FreeMarker properties and shared objects, and allows to retrieve templates.

Returns:
the FreeMarker Configuration

getTaglibFactory

TaglibFactory getTaglibFactory()
Returns the TaglibFactory used to enable JSP tags to be accessed from FreeMarker templates.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


FreeMarkerConfigurer

org.springframework.web.servlet.view.freemarker
Class FreeMarkerConfigurer

java.lang.Object
    extended by  org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
        extended by  org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer
All Implemented Interfaces:
InitializingBean, ResourceLoaderAware, ServletContextAware, FreeMarkerConfig
public class FreeMarkerConfigurer
extends FreeMarkerConfigurationFactory
implements FreeMarkerConfig, InitializingBean, ResourceLoaderAware, ServletContextAware

JavaBean to configure FreeMarker for web usage, via the "configLocation" and/or "freemarkerSettings" and/or "templateLoaderPath" properties. The simplest way to use this class is to specify just a "templateLoaderPath"; you do not need any further configuration then.

 <bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">
   <property name="templateLoaderPath"><value>/WEB-INF/freemarker/</value></property>
 </bean>
This bean must be included in the application context of any application using Spring's FreeMarkerView for web MVC. It exists purely to configure FreeMarker. It is not meant to be referenced by application components but just internally by FreeMarkerView. Implements FreeMarkerConfig to be found by FreeMarkerView without depending on the bean name the configurer. Each DispatcherServlet can define its own FreeMarkerConfigurer if desired.

Note that you can also refer to a preconfigured FreeMarker Configuration instance, for example one set up by FreeMarkerConfigurationFactoryBean, via the "configuration" property. This allows to share a FreeMarker Configuration for web and email usage, for example.

This configurer registers a template loader for this package, allowing to reference the "spring.ftl" macro library (contained in this package and thus in spring.jar) like this:

 <#import "spring.ftl" as spring/>
 <@spring.bind "person.age"/>
 age is ${spring.status.value}
Note: Spring's FreeMarker support requires FreeMarker 2.3 or higher.

Since:
03.03.2004
Author:
Darren Davison, Rob Harrop
See Also:
FreeMarkerConfigurationFactory.setConfigLocation(org.springframework.core.io.Resource),
FreeMarkerConfigurationFactory.setFreemarkerSettings(java.util.Properties),
FreeMarkerConfigurationFactory.setTemplateLoaderPath(java.lang.String),
setConfiguration(freemarker.template.Configuration),
FreeMarkerConfigurationFactoryBean,
FreeMarkerView

Field Summary
Fields inherited from class org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
logger
Constructor Summary
FreeMarkerConfigurer()
Method Summary
void | afterPropertiesSet() Initialize FreeMarkerConfigurationFactory's Configuration if not overridden by a preconfigured FreeMarker Configuation.
Configuration | getConfiguration() Return the Configuration object wrapped by this bean.
TaglibFactory | getTaglibFactory() Return the TaglibFactory object wrapped by this bean.
protected void | postProcessTemplateLoaders(List<TemplateLoader> templateLoaders) This implementation registers an additional ClassTemplateLoader for the Spring-provided macros, added to the end of the list.
void | setConfiguration(Configuration configuration) Set a preconfigured Configuration to use for the FreeMarker web config, e.g.
void | setServletContext(ServletContext servletContext) Initialize the TaglibFactory for the given ServletContext.
Methods inherited from class org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
createConfiguration, getAggregateTemplateLoader, getResourceLoader, getTemplateLoaderForPath, isPreferFileSystemAccess, newConfiguration, postProcessConfiguration, setConfigLocation, setDefaultEncoding, setFreemarkerSettings, setFreemarkerVariables, setPostTemplateLoaders, setPreferFileSystemAccess, setPreTemplateLoaders, setResourceLoader, setTemplateLoaderPath, setTemplateLoaderPaths, setTemplateLoaders
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.context.ResourceLoaderAware
setResourceLoader

Constructor Detail

FreeMarkerConfigurer

public FreeMarkerConfigurer()
Method Detail

setConfiguration

public void setConfiguration(Configuration configuration)
Set a preconfigured Configuration to use for the FreeMarker web config, e.g. a shared one for web and email usage, set up via FreeMarkerConfigurationFactoryBean. If this is not set, FreeMarkerConfigurationFactory's properties (inherited by this class) have to be specified.

See Also:
FreeMarkerConfigurationFactoryBean

setServletContext

public void setServletContext(ServletContext servletContext)
Initialize the TaglibFactory for the given ServletContext.

Specified by:
setServletContext in interface ServletContextAware
Parameters:
servletContext - ServletContext object to be used by this object
See Also:
InitializingBean.afterPropertiesSet(), ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)

afterPropertiesSet

public void afterPropertiesSet()
                        throws IOException,
                               TemplateException
Initialize FreeMarkerConfigurationFactory's Configuration if not overridden by a preconfigured FreeMarker Configuation.

Sets up a ClassTemplateLoader to use for loading Spring macros.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
IOException
TemplateException
See Also:
FreeMarkerConfigurationFactory.createConfiguration(), setConfiguration(freemarker.template.Configuration)

postProcessTemplateLoaders

protected void postProcessTemplateLoaders(List<TemplateLoader> templateLoaders)
This implementation registers an additional ClassTemplateLoader for the Spring-provided macros, added to the end of the list.

Overrides:
postProcessTemplateLoaders in class FreeMarkerConfigurationFactory
Parameters:
templateLoaders - the current List of TemplateLoader instances, to be modified by a subclass
See Also:
FreeMarkerConfigurationFactory.createConfiguration(), FreeMarkerConfigurationFactory.setPostTemplateLoaders(freemarker.cache.TemplateLoader[])

getConfiguration

public Configuration getConfiguration()
Return the Configuration object wrapped by this bean.

Specified by:
getConfiguration in interface FreeMarkerConfig
Returns:
the FreeMarker Configuration

getTaglibFactory

public TaglibFactory getTaglibFactory()
Return the TaglibFactory object wrapped by this bean.

Specified by:
getTaglibFactory in interface FreeMarkerConfig
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FreeMarkerView

org.springframework.web.servlet.view.freemarker
Class FreeMarkerView

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
                extended by  org.springframework.web.servlet.view.AbstractUrlBasedView
                    extended by  org.springframework.web.servlet.view.AbstractTemplateView
                        extended by  org.springframework.web.servlet.view.freemarker.FreeMarkerView
All Implemented Interfaces:
BeanNameAware, InitializingBean, ApplicationContextAware, ServletContextAware, View
public class FreeMarkerView
extends AbstractTemplateView

View using the FreeMarker template engine.

Exposes the following JavaBean properties:

  • url: the location of the FreeMarker template to be wrapped, relative to the FreeMarker template context (directory).
  • encoding (optional, default is determined by FreeMarker configuration): the encoding of the FreeMarker template file

Depends on a single FreeMarkerConfig object such as FreeMarkerConfigurer being accessible in the current web application context, with any bean name. Alternatively, you can set the FreeMarker Configuration object as bean property. See setConfiguration(freemarker.template.Configuration) for more details on the impacts of this approach.

Note: Spring's FreeMarker support requires FreeMarker 2.3 or higher.

Since:
03.03.2004
Author:
Darren Davison, Juergen Hoeller
See Also:
AbstractUrlBasedView.setUrl(java.lang.String),
AbstractTemplateView.setExposeSpringMacroHelpers(boolean),
setEncoding(java.lang.String),
setConfiguration(freemarker.template.Configuration),
FreeMarkerConfig,
FreeMarkerConfigurer

Field Summary
Fields inherited from class org.springframework.web.servlet.view.AbstractTemplateView
SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
FreeMarkerView()
Method Summary
protected FreeMarkerConfig | autodetectConfiguration() Autodetect a FreeMarkerConfig object via the ApplicationContext.
protected SimpleHash | buildTemplateModel(Map<String,Object> model, HttpServletRequest request, HttpServletResponse response) Build a FreeMarker template model for the given model Map.
boolean | checkResource(Locale locale) Check that the FreeMarker template used for this view exists and is valid.
protected void | doRender(Map<String,Object> model, HttpServletRequest request, HttpServletResponse response) Render the FreeMarker view to the given response, using the given model map which contains the complete template model to use.
protected void | exposeHelpers(Map<String,Object> model, HttpServletRequest request) Expose helpers unique to each rendering operation.
protected Configuration | getConfiguration() Return the FreeMarker configuration used by this view.
protected String | getEncoding() Return the encoding for the FreeMarker template.
protected ObjectWrapper | getObjectWrapper() Return the configured FreeMarker ObjectWrapper, or the default wrapper if none specified.
protected Template | getTemplate(Locale locale) Retrieve the FreeMarker template for the given locale, to be rendering by this view.
protected Template | getTemplate(String name, Locale locale) Retrieve the FreeMarker template specified by the given name, using the encoding specified by the "encoding" bean property.
protected void | initServletContext(ServletContext servletContext) Invoked on startup.
protected void | processTemplate(Template template, SimpleHash model, HttpServletResponse response) Process the FreeMarker template to the servlet response.
protected void | renderMergedTemplateModel(Map<String,Object> model, HttpServletRequest request, HttpServletResponse response) Process the model map by merging it with the FreeMarker template.
void | setConfiguration(Configuration configuration) Set the FreeMarker Configuration to be used by this view.
void | setEncoding(String encoding) Set the encoding of the FreeMarker template file.
Methods inherited from class org.springframework.web.servlet.view.AbstractTemplateView
applyContentType, renderMergedOutputModel, setAllowRequestOverride, setAllowSessionOverride, setExposeRequestAttributes, setExposeSessionAttributes, setExposeSpringMacroHelpers
Methods inherited from class org.springframework.web.servlet.view.AbstractUrlBasedView
afterPropertiesSet, getUrl, isUrlRequired, setUrl, toString
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

FreeMarkerView

public FreeMarkerView()
Method Detail

setEncoding

public void setEncoding(String encoding)
Set the encoding of the FreeMarker template file. Default is determined by the FreeMarker Configuration: "ISO-8859-1" if not specified otherwise.

Specify the encoding in the FreeMarker Configuration rather than per template if all your templates share a common encoding.

getEncoding

protected String getEncoding()
Return the encoding for the FreeMarker template.

setConfiguration

public void setConfiguration(Configuration configuration)
Set the FreeMarker Configuration to be used by this view.

If this is not set, the default lookup will occur: a single FreeMarkerConfig is expected in the current web application context, with any bean name. Note: using this method will cause a new instance of TaglibFactory to created for every single FreeMarkerView instance. This can be quite expensive in terms of memory and initial CPU usage. In production it is recommended that you use a FreeMarkerConfig which exposes a single shared TaglibFactory.

getConfiguration

protected Configuration getConfiguration()
Return the FreeMarker configuration used by this view.

initServletContext

protected void initServletContext(ServletContext servletContext)
                           throws BeansException
Invoked on startup. Looks for a single FreeMarkerConfig bean to find the relevant Configuration for this factory.

Checks that the template for the default Locale can be found: FreeMarker will check non-Locale-specific templates if a locale-specific one is not found.

Overrides:
initServletContext in class WebApplicationObjectSupport
Parameters:
servletContext - the ServletContext that this application object runs in (never null)
Throws:
BeansException
See Also:
TemplateCache.getTemplate(java.lang.String, java.util.Locale, java.lang.String, boolean)

autodetectConfiguration

protected FreeMarkerConfig autodetectConfiguration()
                                            throws BeansException
Autodetect a FreeMarkerConfig object via the ApplicationContext.

Returns:
the Configuration instance to use for FreeMarkerViews
Throws:
BeansException - if no Configuration instance could be found
See Also:
ApplicationObjectSupport.getApplicationContext(), setConfiguration(freemarker.template.Configuration)

getObjectWrapper

protected ObjectWrapper getObjectWrapper()
Return the configured FreeMarker ObjectWrapper, or the default wrapper if none specified.

See Also:
Configurable.getObjectWrapper()

checkResource

public boolean checkResource(Locale locale)
                      throws Exception
Check that the FreeMarker template used for this view exists and is valid.

Can be overridden to customize the behavior, for example in case of multiple templates to be rendered into a single view.

Overrides:
checkResource in class AbstractUrlBasedView
Parameters:
locale - the desired Locale that we're looking for
Returns:
true if the resource exists (or is assumed to exist); false if we know that it does not exist
Throws:
Exception - if the resource exists but is invalid (e.g. could not be parsed)

renderMergedTemplateModel

protected void renderMergedTemplateModel(Map<String,Object> model,
                                         HttpServletRequest request,
                                         HttpServletResponse response)
                                  throws Exception
Process the model map by merging it with the FreeMarker template. Output is directed to the servlet response.

This method can be overridden if custom behavior is needed.

Specified by:
renderMergedTemplateModel in class AbstractTemplateView
Parameters:
model - combined output Map, with request attributes and session attributes merged into it if required
request - current HTTP request
response - current HTTP response
Throws:
Exception - if rendering failed

exposeHelpers

protected void exposeHelpers(Map<String,Object> model,
                             HttpServletRequest request)
                      throws Exception
Expose helpers unique to each rendering operation. This is necessary so that different rendering operations can't overwrite each other's formats etc.

Called by renderMergedTemplateModel. The default implementation is empty. This method can be overridden to add custom helpers to the model.

Parameters:
model - The model that will be passed to the template at merge time
request - current HTTP request
Throws:
Exception - if there's a fatal error while we're adding information to the context
See Also:
renderMergedTemplateModel(java.util.Map, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

doRender

protected void doRender(Map<String,Object> model,
                        HttpServletRequest request,
                        HttpServletResponse response)
                 throws Exception
Render the FreeMarker view to the given response, using the given model map which contains the complete template model to use.

The default implementation renders the template specified by the "url" bean property, retrieved via getTemplate. It delegates to the processTemplate method to merge the template instance with the given template model.

Adds the standard Freemarker hash models to the model: request parameters, request, session and application (ServletContext), as well as the JSP tag library hash model.

Can be overridden to customize the behavior, for example to render multiple templates into a single view.

Parameters:
model - the model to use for rendering
request - current HTTP request
response - current servlet response
Throws:
IOException - if the template file could not be retrieved
Exception - if rendering failed
See Also:
AbstractUrlBasedView.setUrl(java.lang.String),
RequestContextUtils.getLocale(javax.servlet.http.HttpServletRequest),
getTemplate(java.util.Locale),
processTemplate(freemarker.template.Template, freemarker.template.SimpleHash, javax.servlet.http.HttpServletResponse),
FreemarkerServlet

buildTemplateModel

protected SimpleHash buildTemplateModel(Map<String,Object> model,
                                        HttpServletRequest request,
                                        HttpServletResponse response)
Build a FreeMarker template model for the given model Map.

The default implementation builds a AllHttpScopesHashModel.

Parameters:
model - the model to use for rendering
request - current HTTP request
response - current servlet response
Returns:
the FreeMarker template model, as a SimpleHash or subclass thereof

getTemplate

protected Template getTemplate(Locale locale)
                        throws IOException
Retrieve the FreeMarker template for the given locale, to be rendering by this view.

By default, the template specified by the "url" bean property will be retrieved.

Parameters:
locale - the current locale
Returns:
the FreeMarker template to render
Throws:
IOException - if the template file could not be retrieved
See Also:
AbstractUrlBasedView.setUrl(java.lang.String), getTemplate(String, java.util.Locale)

getTemplate

protected Template getTemplate(String name,
                               Locale locale)
                        throws IOException
Retrieve the FreeMarker template specified by the given name, using the encoding specified by the "encoding" bean property.

Can be called by subclasses to retrieve a specific template, for example to render multiple templates into a single view.

Parameters:
name - the file name of the desired template
locale - the current locale
Returns:
the FreeMarker template
Throws:
IOException - if the template file could not be retrieved

processTemplate

protected void processTemplate(Template template,
                               SimpleHash model,
                               HttpServletResponse response)
                        throws IOException,
                               TemplateException
Process the FreeMarker template to the servlet response.

Can be overridden to customize the behavior.

Parameters:
template - the template to process
model - the model for the template
response - servlet response (use this to get the OutputStream or Writer)
Throws:
IOException - if the template file could not be retrieved
TemplateException - if thrown by FreeMarker
See Also:
Template.process(Object, java.io.Writer)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FreeMarkerViewResolver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.view.freemarker
Class FreeMarkerViewResolver

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractCachingViewResolver
                extended by  org.springframework.web.servlet.view.UrlBasedViewResolver
                    extended by  org.springframework.web.servlet.view.AbstractTemplateViewResolver
                        extended by  org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver
All Implemented Interfaces:
ApplicationContextAware, Ordered, ServletContextAware, ViewResolver
public class FreeMarkerViewResolver
extends AbstractTemplateViewResolver

Convenience subclass of UrlBasedViewResolver that supports FreeMarkerView (i.e. FreeMarker templates) and custom subclasses of it.

The view class for all views generated by this resolver can be specified via the "viewClass" property. See UrlBasedViewResolver's javadoc for details.

Note: When chaining ViewResolvers, a FreeMarkerViewResolver will check for the existence of the specified template resources and only return a non-null View object if the template was actually found.

Since:
1.1
Author:
Juergen Hoeller
See Also:
UrlBasedViewResolver.setViewClass(java.lang.Class),
UrlBasedViewResolver.setPrefix(java.lang.String),
UrlBasedViewResolver.setSuffix(java.lang.String),
UrlBasedViewResolver.setRequestContextAttribute(java.lang.String),
AbstractTemplateViewResolver.setExposeSpringMacroHelpers(boolean),
FreeMarkerView

Field Summary
Fields inherited from class org.springframework.web.servlet.view.UrlBasedViewResolver
FORWARD_URL_PREFIX, REDIRECT_URL_PREFIX
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
FreeMarkerViewResolver()
Method Summary
protected  Class requiredViewClass()
Requires FreeMarkerView.
Methods inherited from class org.springframework.web.servlet.view.AbstractTemplateViewResolver
buildView, setAllowRequestOverride, setAllowSessionOverride, setExposeRequestAttributes, setExposeSessionAttributes, setExposeSpringMacroHelpers
Methods inherited from class org.springframework.web.servlet.view.UrlBasedViewResolver
canHandle, createView, getAttributesMap, getCacheKey, getContentType, getOrder, getPrefix, getRequestContextAttribute, getSuffix, getViewClass, getViewNames, initApplicationContext, isRedirectContextRelative, isRedirectHttp10Compatible, loadView, setAttributes, setAttributesMap, setContentType, setOrder, setPrefix, setRedirectContextRelative, setRedirectHttp10Compatible, setRequestContextAttribute, setSuffix, setViewClass, setViewNames
Methods inherited from class org.springframework.web.servlet.view.AbstractCachingViewResolver
clearCache, isCache, removeFromCache, resolveViewName, setCache
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

FreeMarkerViewResolver

public FreeMarkerViewResolver()
Method Detail

requiredViewClass

protected Class requiredViewClass()
Requires FreeMarkerView.

Overrides:
requiredViewClass in class AbstractTemplateViewResolver
See Also:
AbstractUrlBasedView
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.servlet.view.jasperreports

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.servlet.view.jasperreports

Support classes for the integration of JasperReports as Spring web view technology.

See:
Description

Class Summary
AbstractJasperReportsSingleFormatView | Extends AbstractJasperReportsView to provide basic rendering logic for views that use a fixed format, e.g.
AbstractJasperReportsView | Base class for all JasperReports views.
ConfigurableJasperReportsView | Configurable JasperReports View, allowing to specify the JasperReports exporter to be specified through bean properties rather than through the view class name.
JasperReportsCsvView | Implementation of AbstractJasperReportsSingleFormatView that renders report results in CSV format.
JasperReportsHtmlView | Implementation of AbstractJasperReportsSingleFormatView that renders report results in HTML format.
JasperReportsMultiFormatView | Jasper Reports view class that allows for the actual rendering format to be specified at runtime using a parameter contained in the model.
JasperReportsPdfView | Implementation of AbstractJasperReportsSingleFormatView that renders report results in PDF format.
JasperReportsViewResolver | ViewResolver implementation that resolves instances of AbstractJasperReportsView by translating the supplied view name into the URL of the report file.
JasperReportsXlsView | Implementation of AbstractJasperReportsSingleFormatView that renders report results in XLS format.

Package org.springframework.web.servlet.view.jasperreports Description

Support classes for the integration of JasperReports as Spring web view technology. Contains various View implementations for JasperReports.


org.springframework.web.servlet.view.jasperreports Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.servlet.view.jasperreports

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.context.support.ApplicationObjectSupport (implements org.springframework.context.ApplicationContextAware)
      • org.springframework.web.context.support.WebApplicationObjectSupport (implements org.springframework.web.context.ServletContextAware)
        • org.springframework.web.servlet.view.AbstractCachingViewResolver (implements org.springframework.web.servlet.ViewResolver)
          • org.springframework.web.servlet.view.UrlBasedViewResolver (implements org.springframework.core.Ordered)
            • org.springframework.web.servlet.view.jasperreports.JasperReportsViewResolver
        • org.springframework.web.servlet.view.AbstractView (implements org.springframework.beans.factory.BeanNameAware, org.springframework.web.servlet.View)
          • org.springframework.web.servlet.view.AbstractUrlBasedView (implements org.springframework.beans.factory.InitializingBean)
            • org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
              • org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsSingleFormatView
                • org.springframework.web.servlet.view.jasperreports.ConfigurableJasperReportsView
                • org.springframework.web.servlet.view.jasperreports.JasperReportsCsvView
                • org.springframework.web.servlet.view.jasperreports.JasperReportsHtmlView
                • org.springframework.web.servlet.view.jasperreports.JasperReportsPdfView
                • org.springframework.web.servlet.view.jasperreports.JasperReportsXlsView
              • org.springframework.web.servlet.view.jasperreports.JasperReportsMultiFormatView


AbstractJasperReportsSingleFormatView

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.view.jasperreports
Class AbstractJasperReportsSingleFormatView

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
                extended by  org.springframework.web.servlet.view.AbstractUrlBasedView
                    extended by  org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
                        extended by  org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsSingleFormatView
All Implemented Interfaces:
BeanNameAware, InitializingBean, ApplicationContextAware, ServletContextAware, View
Direct Known Subclasses:
ConfigurableJasperReportsView, JasperReportsCsvView, JasperReportsHtmlView, JasperReportsPdfView, JasperReportsXlsView
public abstract class AbstractJasperReportsSingleFormatView
extends AbstractJasperReportsView

Extends AbstractJasperReportsView to provide basic rendering logic for views that use a fixed format, e.g. always PDF or always HTML.

Subclasses need to implement two template methods: createExporter to create a JasperReports exporter for a specific output format, and useWriter to determine whether to write text or binary content.

Since:
1.1.5
Author:
Rob Harrop, Juergen Hoeller
See Also:
createExporter(), useWriter()

Field Summary
Fields inherited from class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
CONTENT_DISPOSITION_INLINE, HEADER_CONTENT_DISPOSITION
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
AbstractJasperReportsSingleFormatView()
Method Summary
protected abstract net.sf.jasperreports.engine.JRExporter | createExporter() Create a JasperReports exporter for a specific output format, which will be used to render the report to the HTTP response.
protected boolean | generatesDownloadContent() Return whether this view generates download content (typically binary content like PDF or Excel files).
protected void | renderReport(net.sf.jasperreports.engine.JasperPrint populatedReport, Map<String,Object> model, HttpServletResponse response) Perform rendering for a single Jasper Reports exporter, that is, for a pre-defined output format.
protected void | renderReportUsingOutputStream(net.sf.jasperreports.engine.JRExporter exporter, net.sf.jasperreports.engine.JasperPrint populatedReport, HttpServletResponse response) We need to write binary output to the response OutputStream.
protected void | renderReportUsingWriter(net.sf.jasperreports.engine.JRExporter exporter, net.sf.jasperreports.engine.JasperPrint populatedReport, HttpServletResponse response) We need to write text to the response Writer.
protected abstract boolean | useWriter() Return whether to use a java.io.Writer to write text content to the HTTP response.
Methods inherited from class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
convertExporterParameters, convertParameterValue, convertReportData, convertToExporterParameter, createReport, exposeLocalizationContext, fillReport, getConvertedExporterParameters, getExporterParameter, getExporterParameters, getJdbcDataSource, getReport, getReportData, getReportDataTypes, initApplicationContext, isUrlRequired, loadReport, loadReport, onInit, postProcessReport, renderMergedOutputModel, setConvertedExporterParameters, setExporterParameters, setHeaders, setJdbcDataSource, setReportDataKey, setSubReportDataKeys, setSubReportUrls
Methods inherited from class org.springframework.web.servlet.view.AbstractUrlBasedView
afterPropertiesSet, checkResource, getUrl, setUrl, toString
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AbstractJasperReportsSingleFormatView

public AbstractJasperReportsSingleFormatView()
Method Detail

generatesDownloadContent

protected boolean generatesDownloadContent()
Description copied from class: AbstractView
Return whether this view generates download content (typically binary content like PDF or Excel files).

The default implementation returns false. Subclasses are encouraged to return true here if they know that they are generating download content that requires temporary caching on the client side, typically via the response OutputStream.

Overrides:
generatesDownloadContent in class AbstractView
See Also:
AbstractView.prepareResponse(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), ServletResponse.getOutputStream()

renderReport

protected void renderReport(net.sf.jasperreports.engine.JasperPrint populatedReport,
                            Map<String,Object> model,
                            HttpServletResponse response)
                     throws Exception
Perform rendering for a single Jasper Reports exporter, that is, for a pre-defined output format.

Specified by:
renderReport in class AbstractJasperReportsView
Parameters:
populatedReport - the populated JasperPrint to render
model - the map containing report parameters
response - the HTTP response the report should be rendered to
Throws:
Exception - if rendering failed
See Also:
AbstractView.getContentType(),
ServletResponse.setContentType(java.lang.String),
ServletResponse.setCharacterEncoding(java.lang.String)

renderReportUsingWriter

protected void renderReportUsingWriter(net.sf.jasperreports.engine.JRExporter exporter,
                                       net.sf.jasperreports.engine.JasperPrint populatedReport,
                                       HttpServletResponse response)
                                throws Exception
We need to write text to the response Writer.

Parameters:
exporter - the JasperReports exporter to use
populatedReport - the populated JasperPrint to render
response - the HTTP response the report should be rendered to
Throws:
Exception - if rendering failed

renderReportUsingOutputStream

protected void renderReportUsingOutputStream(net.sf.jasperreports.engine.JRExporter exporter,
                                             net.sf.jasperreports.engine.JasperPrint populatedReport,
                                             HttpServletResponse response)
                                      throws Exception
We need to write binary output to the response OutputStream.

Parameters:
exporter - the JasperReports exporter to use
populatedReport - the populated JasperPrint to render
response - the HTTP response the report should be rendered to
Throws:
Exception - if rendering failed

createExporter

protected abstract net.sf.jasperreports.engine.JRExporter createExporter()
Create a JasperReports exporter for a specific output format, which will be used to render the report to the HTTP response.

The useWriter method determines whether the output will be written as text or as binary content.

See Also:
useWriter()

useWriter

protected abstract boolean useWriter()
Return whether to use a java.io.Writer to write text content to the HTTP response. Else, a java.io.OutputStream will be used, to write binary content to the response.

See Also:
ServletResponse.getWriter(), ServletResponse.getOutputStream()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractJasperReportsView

org.springframework.web.servlet.view.jasperreports
Class AbstractJasperReportsView

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
                extended by  org.springframework.web.servlet.view.AbstractUrlBasedView
                    extended by  org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
All Implemented Interfaces:
BeanNameAware, InitializingBean, ApplicationContextAware, ServletContextAware, View
Direct Known Subclasses:
AbstractJasperReportsSingleFormatView, JasperReportsMultiFormatView
public abstract class AbstractJasperReportsView
extends AbstractUrlBasedView

Base class for all JasperReports views. Applies on-the-fly compilation of report designs as required and coordinates the rendering process. The resource path of the main report needs to be specified as url.

This class is responsible for getting report data from the model that has been provided to the view. The default implementation checks for a model object under the specified reportDataKey first, then falls back to looking for a value of type JRDataSource, java.util.Collection, object array (in that order).

If no JRDataSource can be found in the model, then reports will be filled using the configured javax.sql.DataSource if any. If neither a JRDataSource or javax.sql.DataSource is available then an IllegalArgumentException is raised.

Provides support for sub-reports through the subReportUrls and subReportDataKeys properties.

When using sub-reports, the master report should be configured using the url property and the sub-reports files should be configured using the subReportUrls property. Each entry in the subReportUrls Map corresponds to an individual sub-report. The key of an entry must match up to a sub-report parameter in your report file of type net.sf.jasperreports.engine.JasperReport, and the value of an entry must be the URL for the sub-report file.

For sub-reports that require an instance of JRDataSource, that is, they don't have a hard-coded query for data retrieval, you can include the appropriate data in your model as would with the data source for the parent report. However, you must provide a List of parameter names that need to be converted to JRDataSource instances for the sub-report via the subReportDataKeys property. When using JRDataSource instances for sub-reports, you must specify a value for the reportDataKey property, indicating the data to use for the main report.

Allows for exporter parameters to be configured declatively using the exporterParameters property. This is a Map typed property where the key of an entry corresponds to the fully-qualified name of the static field for the JRExporterParameter and the value of an entry is the value you want to assign to the exporter parameter.

Response headers can be controlled via the headers property. Spring will attempt to set the correct value for the Content-Diposition header so that reports render correctly in Internet Explorer. However, you can override this setting through the headers property.

Since:
1.1.3
Author:
Rob Harrop, Juergen Hoeller
See Also:
AbstractUrlBasedView.setUrl(java.lang.String),
setReportDataKey(java.lang.String),
setSubReportUrls(java.util.Properties),
setSubReportDataKeys(java.lang.String[]),
setHeaders(java.util.Properties),
setExporterParameters(java.util.Map),
setJdbcDataSource(javax.sql.DataSource)

Field Summary
protected static String | CONTENT_DISPOSITION_INLINE The default Content-Disposition header.
protected static String | HEADER_CONTENT_DISPOSITION Constant that defines "Content-Disposition" header.
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
AbstractJasperReportsView()
Method Summary
protected  void convertExporterParameters()
Converts the exporter parameters passed in by the user which may be keyed by Strings corresponding to the fully qualified name of the JRExporterParameter into parameters which are keyed by JRExporterParameter.
protected  Object convertParameterValue(net.sf.jasperreports.engine.JRExporterParameter parameter, Object value)
Convert the supplied parameter value into the actual type required by the corresponding JRExporterParameter.
protected  net.sf.jasperreports.engine.JRDataSource convertReportData(Object value)
Convert the given report data value to a JRDataSource.
protected  net.sf.jasperreports.engine.JRExporterParameter convertToExporterParameter(String fqFieldName)
Convert the given fully qualified field name to a corresponding JRExporterParameter instance.
protected  net.sf.jasperreports.engine.JRDataSource createReport(net.sf.jasperreports.engine.JRDataSourceProvider provider)
Create a report using the given provider.
protected  void exposeLocalizationContext(Map<String,Object> model, HttpServletRequest request)
Expose current Spring-managed Locale and MessageSource to JasperReports i18n ($R expressions etc).
protected  net.sf.jasperreports.engine.JasperPrint fillReport(Map<String,Object> model)
Create a populated JasperPrint instance from the configured JasperReport instance.
protected  Map<net.sf.jasperreports.engine.JRExporterParameter,Object> getConvertedExporterParameters()
Allows subclasses to retrieve the converted exporter parameters.
protected  net.sf.jasperreports.engine.JRExporterParameter getExporterParameter(Object parameter)
Return a JRExporterParameter for the given parameter object, converting it from a String if necessary.
 Map<?,?> getExporterParameters()
Return the exporter parameters that this view uses, if any.
protected  DataSource getJdbcDataSource()
Return the javax.sql.DataSource that this view uses, if any.
protected  net.sf.jasperreports.engine.JasperReport getReport()
Determine the JasperReport to fill.
protected  net.sf.jasperreports.engine.JRDataSource getReportData(Map<String,Object> model)
Create an appropriate JRDataSource for passed-in report data.
protected  Class[] getReportDataTypes()
Return the value types that can be converted to a JRDataSource, in prioritized order.
protected  void initApplicationContext()
Checks to see that a valid report file URL is supplied in the configuration.
protected  boolean isUrlRequired()
JasperReports views do not strictly required a 'url' value.
protected  net.sf.jasperreports.engine.JasperReport loadReport()
Load the main JasperReport from the specified Resource.
protected  net.sf.jasperreports.engine.JasperReport loadReport(Resource resource)
Loads a JasperReport from the specified Resource.
protected  void onInit()
Subclasses can override this to add some custom initialization logic.
protected  void postProcessReport(net.sf.jasperreports.engine.JasperPrint populatedReport, Map<String,Object> model)
Template method to be overridden for custom post-processing of the populated report.
protected  void renderMergedOutputModel(Map<String,Object> model, HttpServletRequest request, HttpServletResponse response)
Finds the report data to use for rendering the report and then invokes the renderReport(net.sf.jasperreports.engine.JasperPrint, java.util.Map, javax.servlet.http.HttpServletResponse) method that should be implemented by the subclass.
protected abstract  void renderReport(net.sf.jasperreports.engine.JasperPrint populatedReport, Map<String,Object> model, HttpServletResponse response)
Subclasses should implement this method to perform the actual rendering process.
protected  void setConvertedExporterParameters(Map<net.sf.jasperreports.engine.JRExporterParameter,Object> convertedExporterParameters)
Allows subclasses to populate the converted exporter parameters.
 void setExporterParameters(Map<?,?> parameters)
Set the exporter parameters that should be used when rendering a view.
 void setHeaders(Properties headers)
Specify the set of headers that are included in each of response.
 void setJdbcDataSource(DataSource jdbcDataSource)
Specify the javax.sql.DataSource to use for reports with embedded SQL statements.
 void setReportDataKey(String reportDataKey)
Set the name of the model attribute that represents the report data.
 void setSubReportDataKeys(String[] subReportDataKeys)
Set the list of names corresponding to the model parameters that will contain data source objects for use in sub-reports.
 void setSubReportUrls(Properties subReports)
Specify resource paths which must be loaded as instances of JasperReport and passed to the JasperReports engine for rendering as sub-reports, under the same keys as in this mapping.
Methods inherited from class org.springframework.web.servlet.view.AbstractUrlBasedView
afterPropertiesSet, checkResource, getUrl, setUrl, toString
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

HEADER_CONTENT_DISPOSITION

protected static final String HEADER_CONTENT_DISPOSITION
Constant that defines "Content-Disposition" header.

See Also:
Constant Field Values

CONTENT_DISPOSITION_INLINE

protected static final String CONTENT_DISPOSITION_INLINE
The default Content-Disposition header. Used to make IE play nice.

See Also:
Constant Field Values
Constructor Detail

AbstractJasperReportsView

public AbstractJasperReportsView()
Method Detail

setReportDataKey

public void setReportDataKey(String reportDataKey)
Set the name of the model attribute that represents the report data. If not specified, the model map will be searched for a matching value type.

A JRDataSource will be taken as-is. For other types, conversion will apply: By default, a java.util.Collection will be converted to JRBeanCollectionDataSource, and an object array to JRBeanArrayDataSource.

Note: If you pass in a Collection or object array in the model map for use as plain report parameter, rather than as report data to extract fields from, you need to specify the key for the actual report data to use, to avoid mis-detection of report data by type.

See Also:
convertReportData(java.lang.Object), JRDataSource, JRBeanCollectionDataSource, JRBeanArrayDataSource

setSubReportUrls

public void setSubReportUrls(Properties subReports)
Specify resource paths which must be loaded as instances of JasperReport and passed to the JasperReports engine for rendering as sub-reports, under the same keys as in this mapping.

Parameters:
subReports - mapping between model keys and resource paths (Spring resource locations)
See Also:
AbstractUrlBasedView.setUrl(java.lang.String), ResourceLoader.getResource(java.lang.String)

setSubReportDataKeys

public void setSubReportDataKeys(String[] subReportDataKeys)
Set the list of names corresponding to the model parameters that will contain data source objects for use in sub-reports. Spring will convert these objects to instances of JRDataSource where applicable and will then include the resulting JRDataSource in the parameters passed into the JasperReports engine.

The name specified in the list should correspond to an attribute in the model Map, and to a sub-report data source parameter in your report file. If you pass in JRDataSource objects as model attributes, specifing this list of keys is not required.

If you specify a list of sub-report data keys, it is required to also specify a reportDataKey for the main report, to avoid confusion between the data source objects for the various reports involved.

Parameters:
subReportDataKeys - list of names for sub-report data source objects
See Also:
setReportDataKey(java.lang.String), convertReportData(java.lang.Object), JRDataSource, JRBeanCollectionDataSource, JRBeanArrayDataSource

setHeaders

public void setHeaders(Properties headers)
Specify the set of headers that are included in each of response.

Parameters:
headers - the headers to write to each response.

setExporterParameters

public void setExporterParameters(Map<?,?> parameters)
Set the exporter parameters that should be used when rendering a view.

Parameters:
parameters - Map with the fully qualified field name of the JRExporterParameter instance as key (e.g. "net.sf.jasperreports.engine.export.JRHtmlExporterParameter.IMAGES_URI") and the value you wish to assign to the parameter as value

getExporterParameters

public Map<?,?> getExporterParameters()
Return the exporter parameters that this view uses, if any.

setConvertedExporterParameters

protected void setConvertedExporterParameters(Map<net.sf.jasperreports.engine.JRExporterParameter,Object> convertedExporterParameters)
Allows subclasses to populate the converted exporter parameters.

getConvertedExporterParameters

protected Map<net.sf.jasperreports.engine.JRExporterParameter,Object> getConvertedExporterParameters()
Allows subclasses to retrieve the converted exporter parameters.

setJdbcDataSource

public void setJdbcDataSource(DataSource jdbcDataSource)
Specify the javax.sql.DataSource to use for reports with embedded SQL statements.

getJdbcDataSource

protected DataSource getJdbcDataSource()
Return the javax.sql.DataSource that this view uses, if any.

isUrlRequired

protected boolean isUrlRequired()
JasperReports views do not strictly required a 'url' value. Alternatively, the getReport() template method may be overridden.

Overrides:
isUrlRequired in class AbstractUrlBasedView

initApplicationContext

protected final void initApplicationContext()
                                     throws ApplicationContextException
Checks to see that a valid report file URL is supplied in the configuration. Compiles the report file is necessary.

Subclasses can add custom initialization logic by overriding the onInit() method.

Overrides:
initApplicationContext in class ApplicationObjectSupport
Throws:
ApplicationContextException - in case of initialization errors
See Also:
ApplicationObjectSupport.setApplicationContext(org.springframework.context.ApplicationContext)

onInit

protected void onInit()
Subclasses can override this to add some custom initialization logic. Called by initApplicationContext() as soon as all standard initialization logic has finished executing.

See Also:
initApplicationContext()

convertExporterParameters

protected final void convertExporterParameters()
Converts the exporter parameters passed in by the user which may be keyed by Strings corresponding to the fully qualified name of the JRExporterParameter into parameters which are keyed by JRExporterParameter.

See Also:
getExporterParameter(Object)

convertParameterValue

protected Object convertParameterValue(net.sf.jasperreports.engine.JRExporterParameter parameter,
                                       Object value)
Convert the supplied parameter value into the actual type required by the corresponding JRExporterParameter.

The default implementation simply converts the String values "true" and "false" into corresponding Boolean objects, and tries to convert String values that start with a digit into Integer objects (simply keeping them as String if number conversion fails).

Parameters:
parameter - the parameter key
value - the parameter value
Returns:
the converted parameter value

getExporterParameter

protected net.sf.jasperreports.engine.JRExporterParameter getExporterParameter(Object parameter)
Return a JRExporterParameter for the given parameter object, converting it from a String if necessary.

Parameters:
parameter - the parameter object, either a String or a JRExporterParameter
Returns:
a JRExporterParameter for the given parameter object
See Also:
convertToExporterParameter(String)

convertToExporterParameter

protected net.sf.jasperreports.engine.JRExporterParameter convertToExporterParameter(String fqFieldName)
Convert the given fully qualified field name to a corresponding JRExporterParameter instance.

Parameters:
fqFieldName - the fully qualified field name, consisting of the class name followed by a dot followed by the field name (e.g. "net.sf.jasperreports.engine.export.JRHtmlExporterParameter.IMAGES_URI")
Returns:
the corresponding JRExporterParameter instance

loadReport

protected net.sf.jasperreports.engine.JasperReport loadReport()
Load the main JasperReport from the specified Resource. If the Resource points to an uncompiled report design file then the report file is compiled dynamically and loaded into memory.

Returns:
a JasperReport instance, or null if no main report has been statically defined

loadReport

protected final net.sf.jasperreports.engine.JasperReport loadReport(Resource resource)
Loads a JasperReport from the specified Resource. If the Resource points to an uncompiled report design file then the report file is compiled dynamically and loaded into memory.

Parameters:
resource - the Resource containing the report definition or design
Returns:
a JasperReport instance

renderMergedOutputModel

protected void renderMergedOutputModel(Map<String,Object> model,
                                       HttpServletRequest request,
                                       HttpServletResponse response)
                                throws Exception
Finds the report data to use for rendering the report and then invokes the renderReport(net.sf.jasperreports.engine.JasperPrint, java.util.Map, javax.servlet.http.HttpServletResponse) method that should be implemented by the subclass.

Specified by:
renderMergedOutputModel in class AbstractView
Parameters:
model - the model map, as passed in for view rendering. Must contain a report data value that can be converted to a JRDataSource, acccording to the rules of the fillReport(java.util.Map) method.
request - current HTTP request
response - current HTTP response
Throws:
Exception - if rendering failed

exposeLocalizationContext

protected void exposeLocalizationContext(Map<String,Object> model,
                                         HttpServletRequest request)
Expose current Spring-managed Locale and MessageSource to JasperReports i18n ($R expressions etc). The MessageSource should only be exposed as JasperReports resource bundle if no such bundle is defined in the report itself.

Default implementation exposes the Spring RequestContext Locale and a MessageSourceResourceBundle adapter for the Spring ApplicationContext, analogous to the JstlUtils.exposeLocalizationContext method.

See Also:
RequestContextUtils.getLocale(javax.servlet.http.HttpServletRequest), MessageSourceResourceBundle, ApplicationObjectSupport.getApplicationContext(), JRParameter.REPORT_LOCALE, JRParameter.REPORT_RESOURCE_BUNDLE, JstlUtils.exposeLocalizationContext(javax.servlet.http.HttpServletRequest, org.springframework.context.MessageSource)

fillReport

protected net.sf.jasperreports.engine.JasperPrint fillReport(Map<String,Object> model)
                                                      throws Exception
Create a populated JasperPrint instance from the configured JasperReport instance.

By default, this method will use any JRDataSource instance (or wrappable Object) that can be located using setReportDataKey(java.lang.String), a lookup for type JRDataSource in the model Map, or a special value retrieved via getReportData(java.util.Map).

If no JRDataSource can be found, this method will use a JDBC Connection obtained from the configured javax.sql.DataSource (or a DataSource attribute in the model). If no JDBC DataSource can be found either, the JasperReports engine will be invoked with plain model Map, assuming that the model contains parameters that identify the source for report data (e.g. Hibernate or JPA queries).

Parameters:
model - the model for this request
Returns:
the populated JasperPrint instance
Throws:
IllegalArgumentException - if no JRDataSource can be found and no javax.sql.DataSource is supplied
SQLException - if there is an error when populating the report using the javax.sql.DataSource
net.sf.jasperreports.engine.JRException - if there is an error when populating the report using a JRDataSource
Exception
See Also:
getReportData(java.util.Map), setJdbcDataSource(javax.sql.DataSource)

getReport

protected net.sf.jasperreports.engine.JasperReport getReport()
Determine the JasperReport to fill. Called by fillReport(java.util.Map).

The default implementation returns the report as statically configured through the 'url' property (and loaded by loadReport()). Can be overridden in subclasses in order to dynamically obtain a JasperReport instance. As an alternative, consider overriding the fillReport(java.util.Map) template method itself.

Returns:
an instance of JasperReport

getReportData

protected net.sf.jasperreports.engine.JRDataSource getReportData(Map<String,Object> model)
Create an appropriate JRDataSource for passed-in report data. Called by fillReport(java.util.Map) when its own lookup steps were not successful.

The default implementation looks for a value of type java.util.Collection or object array (in that order). Can be overridden in subclasses.

Parameters:
model - the model map, as passed in for view rendering
Returns:
the JRDataSource or null if the data source is not found
See Also:
getReportDataTypes(), convertReportData(java.lang.Object)

convertReportData

protected net.sf.jasperreports.engine.JRDataSource convertReportData(Object value)
                                                              throws IllegalArgumentException
Convert the given report data value to a JRDataSource.

The default implementation delegates to JasperReportUtils unless the report data value is an instance of JRDataSourceProvider. A JRDataSource, JRDataSourceProvider, java.util.Collection or object array is detected. JRDataSources are returned as is, whilst JRDataSourceProviders are used to create an instance of JRDataSource which is then returned. The latter two are converted to JRBeanCollectionDataSource or JRBeanArrayDataSource, respectively.

Parameters:
value - the report data value to convert
Returns:
the JRDataSource
Throws:
IllegalArgumentException - if the value could not be converted
See Also:
JasperReportsUtils.convertReportData(java.lang.Object), JRDataSource, JRDataSourceProvider, JRBeanCollectionDataSource, JRBeanArrayDataSource

createReport

protected net.sf.jasperreports.engine.JRDataSource createReport(net.sf.jasperreports.engine.JRDataSourceProvider provider)
Create a report using the given provider.

Parameters:
provider - the JRDataSourceProvider to use
Returns:
the created report

getReportDataTypes

protected Class[] getReportDataTypes()
Return the value types that can be converted to a JRDataSource, in prioritized order. Should only return types that the convertReportData(java.lang.Object) method is actually able to convert.

Default value types are: java.util.Collection and Object array.

Returns:
the value types in prioritized order

postProcessReport

protected void postProcessReport(net.sf.jasperreports.engine.JasperPrint populatedReport,
                                 Map<String,Object> model)
                          throws Exception
Template method to be overridden for custom post-processing of the populated report. Invoked after filling but before rendering.

The default implementation is empty.

Parameters:
populatedReport - the populated JasperPrint
model - the map containing report parameters
Throws:
Exception - if post-processing failed

renderReport

protected abstract void renderReport(net.sf.jasperreports.engine.JasperPrint populatedReport,
                                     Map<String,Object> model,
                                     HttpServletResponse response)
                              throws Exception
Subclasses should implement this method to perform the actual rendering process.

Note that the content type has not been set yet: Implementors should build a content type String and set it via response.setContentType. If necessary, this can include a charset clause for a specific encoding. The latter will only be necessary for textual output onto a Writer, and only in case of the encoding being specified in the JasperReports exporter parameters.

WARNING: Implementors should not use response.setCharacterEncoding unless they are willing to depend on Servlet API 2.4 or higher. Prefer a concatenated content type String with a charset clause instead.

Parameters:
populatedReport - the populated JasperPrint to render
model - the map containing report parameters
response - the HTTP response the report should be rendered to
Throws:
Exception - if rendering failed
See Also:
AbstractView.getContentType(),
ServletResponse.setContentType(java.lang.String),
ServletResponse.setCharacterEncoding(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConfigurableJasperReportsView

org.springframework.web.servlet.view.jasperreports
Class ConfigurableJasperReportsView

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
                extended by  org.springframework.web.servlet.view.AbstractUrlBasedView
                    extended by  org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
                        extended by  org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsSingleFormatView
                            extended by  org.springframework.web.servlet.view.jasperreports.ConfigurableJasperReportsView
All Implemented Interfaces:
BeanNameAware, InitializingBean, ApplicationContextAware, ServletContextAware, View
public class ConfigurableJasperReportsView
extends AbstractJasperReportsSingleFormatView

Configurable JasperReports View, allowing to specify the JasperReports exporter to be specified through bean properties rather than through the view class name.

Since:
2.0
Author:
Rob Harrop
See Also:
JasperReportsCsvView, JasperReportsHtmlView, JasperReportsPdfView, JasperReportsXlsView

Field Summary
Fields inherited from class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
CONTENT_DISPOSITION_INLINE, HEADER_CONTENT_DISPOSITION
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
ConfigurableJasperReportsView()
Method Summary
protected net.sf.jasperreports.engine.JRExporter | createExporter() Returns a new instance of the specified JRExporter class.
protected void | onInit() Checks that the exporterClass property is specified.
void | setExporterClass(Class<? extends net.sf.jasperreports.engine.JRExporter> exporterClass) Set the JRExporter implementation Class to use.
void | setUseWriter(boolean useWriter) Specifies whether or not the JRExporter writes to the PrintWriter of the associated with the request (true) or whether it writes directly to the InputStream of the request (false).
protected boolean | useWriter() Indicates how the JRExporter should render its data.
Methods inherited from class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsSingleFormatView
generatesDownloadContent, renderReport, renderReportUsingOutputStream, renderReportUsingWriter
Methods inherited from class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
convertExporterParameters, convertParameterValue, convertReportData, convertToExporterParameter, createReport, exposeLocalizationContext, fillReport, getConvertedExporterParameters, getExporterParameter, getExporterParameters, getJdbcDataSource, getReport, getReportData, getReportDataTypes, initApplicationContext, isUrlRequired, loadReport, loadReport, postProcessReport, renderMergedOutputModel, setConvertedExporterParameters, setExporterParameters, setHeaders, setJdbcDataSource, setReportDataKey, setSubReportDataKeys, setSubReportUrls
Methods inherited from class org.springframework.web.servlet.view.AbstractUrlBasedView
afterPropertiesSet, checkResource, getUrl, setUrl, toString
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ConfigurableJasperReportsView

public ConfigurableJasperReportsView()
Method Detail

setExporterClass

public void setExporterClass(Class<? extends net.sf.jasperreports.engine.JRExporter> exporterClass)
Set the JRExporter implementation Class to use. Throws IllegalArgumentException if the Class doesn't implement JRExporter. Required setting, as it does not have a default.

setUseWriter

public void setUseWriter(boolean useWriter)
Specifies whether or not the JRExporter writes to the PrintWriter of the associated with the request (true) or whether it writes directly to the InputStream of the request (false). Default is true.

onInit

protected void onInit()
Checks that the exporterClass property is specified.

Overrides:
onInit in class AbstractJasperReportsView
See Also:
AbstractJasperReportsView.initApplicationContext()

createExporter

protected net.sf.jasperreports.engine.JRExporter createExporter()
Returns a new instance of the specified JRExporter class.

Specified by:
createExporter in class AbstractJasperReportsSingleFormatView
See Also:
setExporterClass(Class), BeanUtils.instantiateClass(Class)

useWriter

protected boolean useWriter()
Indicates how the JRExporter should render its data.

Specified by:
useWriter in class AbstractJasperReportsSingleFormatView
See Also:
setUseWriter(boolean)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JasperReportsCsvView

org.springframework.web.servlet.view.jasperreports
Class JasperReportsCsvView

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
                extended by  org.springframework.web.servlet.view.AbstractUrlBasedView
                    extended by  org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
                        extended by  org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsSingleFormatView
                            extended by  org.springframework.web.servlet.view.jasperreports.JasperReportsCsvView
All Implemented Interfaces:
BeanNameAware, InitializingBean, ApplicationContextAware, ServletContextAware, View
public class JasperReportsCsvView
extends AbstractJasperReportsSingleFormatView

Implementation of AbstractJasperReportsSingleFormatView that renders report results in CSV format.

Since:
1.1.3
Author:
Rob Harrop, Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
CONTENT_DISPOSITION_INLINE, HEADER_CONTENT_DISPOSITION
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
JasperReportsCsvView()
Method Summary
protected net.sf.jasperreports.engine.JRExporter | createExporter() Create a JasperReports exporter for a specific output format, which will be used to render the report to the HTTP response.
protected boolean | useWriter() Return whether to use a java.io.Writer to write text content to the HTTP response.
Methods inherited from class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsSingleFormatView
generatesDownloadContent, renderReport, renderReportUsingOutputStream, renderReportUsingWriter
Methods inherited from class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
convertExporterParameters, convertParameterValue, convertReportData, convertToExporterParameter, createReport, exposeLocalizationContext, fillReport, getConvertedExporterParameters, getExporterParameter, getExporterParameters, getJdbcDataSource, getReport, getReportData, getReportDataTypes, initApplicationContext, isUrlRequired, loadReport, loadReport, onInit, postProcessReport, renderMergedOutputModel, setConvertedExporterParameters, setExporterParameters, setHeaders, setJdbcDataSource, setReportDataKey, setSubReportDataKeys, setSubReportUrls
Methods inherited from class org.springframework.web.servlet.view.AbstractUrlBasedView
afterPropertiesSet, checkResource, getUrl, setUrl, toString
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

JasperReportsCsvView

public JasperReportsCsvView()
Method Detail

createExporter

protected net.sf.jasperreports.engine.JRExporter createExporter()
Description copied from class: AbstractJasperReportsSingleFormatView
Create a JasperReports exporter for a specific output format, which will be used to render the report to the HTTP response.

The useWriter method determines whether the output will be written as text or as binary content.

Specified by:
createExporter in class AbstractJasperReportsSingleFormatView
See Also:
AbstractJasperReportsSingleFormatView.useWriter()

useWriter

protected boolean useWriter()
Description copied from class: AbstractJasperReportsSingleFormatView
Return whether to use a java.io.Writer to write text content to the HTTP response. Else, a java.io.OutputStream will be used, to write binary content to the response.

Specified by:
useWriter in class AbstractJasperReportsSingleFormatView
See Also:
ServletResponse.getWriter(), ServletResponse.getOutputStream()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JasperReportsHtmlView

org.springframework.web.servlet.view.jasperreports
Class JasperReportsHtmlView

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
                extended by  org.springframework.web.servlet.view.AbstractUrlBasedView
                    extended by  org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
                        extended by  org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsSingleFormatView
                            extended by  org.springframework.web.servlet.view.jasperreports.JasperReportsHtmlView
All Implemented Interfaces:
BeanNameAware, InitializingBean, ApplicationContextAware, ServletContextAware, View
public class JasperReportsHtmlView
extends AbstractJasperReportsSingleFormatView

Implementation of AbstractJasperReportsSingleFormatView that renders report results in HTML format.

Since:
1.1.3
Author:
Rob Harrop, Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
CONTENT_DISPOSITION_INLINE, HEADER_CONTENT_DISPOSITION
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
JasperReportsHtmlView()
Method Summary
protected net.sf.jasperreports.engine.JRExporter | createExporter() Create a JasperReports exporter for a specific output format, which will be used to render the report to the HTTP response.
protected boolean | useWriter() Return whether to use a java.io.Writer to write text content to the HTTP response.
Methods inherited from class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsSingleFormatView
generatesDownloadContent, renderReport, renderReportUsingOutputStream, renderReportUsingWriter
Methods inherited from class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
convertExporterParameters, convertParameterValue, convertReportData, convertToExporterParameter, createReport, exposeLocalizationContext, fillReport, getConvertedExporterParameters, getExporterParameter, getExporterParameters, getJdbcDataSource, getReport, getReportData, getReportDataTypes, initApplicationContext, isUrlRequired, loadReport, loadReport, onInit, postProcessReport, renderMergedOutputModel, setConvertedExporterParameters, setExporterParameters, setHeaders, setJdbcDataSource, setReportDataKey, setSubReportDataKeys, setSubReportUrls
Methods inherited from class org.springframework.web.servlet.view.AbstractUrlBasedView
afterPropertiesSet, checkResource, getUrl, setUrl, toString
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

JasperReportsHtmlView

public JasperReportsHtmlView()
Method Detail

createExporter

protected net.sf.jasperreports.engine.JRExporter createExporter()
Description copied from class: AbstractJasperReportsSingleFormatView
Create a JasperReports exporter for a specific output format, which will be used to render the report to the HTTP response.

The useWriter method determines whether the output will be written as text or as binary content.

Specified by:
createExporter in class AbstractJasperReportsSingleFormatView
See Also:
AbstractJasperReportsSingleFormatView.useWriter()

useWriter

protected boolean useWriter()
Description copied from class: AbstractJasperReportsSingleFormatView
Return whether to use a java.io.Writer to write text content to the HTTP response. Else, a java.io.OutputStream will be used, to write binary content to the response.

Specified by:
useWriter in class AbstractJasperReportsSingleFormatView
See Also:
ServletResponse.getWriter(), ServletResponse.getOutputStream()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JasperReportsMultiFormatView

org.springframework.web.servlet.view.jasperreports
Class JasperReportsMultiFormatView

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
                extended by  org.springframework.web.servlet.view.AbstractUrlBasedView
                    extended by  org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
                        extended by  org.springframework.web.servlet.view.jasperreports.JasperReportsMultiFormatView
All Implemented Interfaces:
BeanNameAware, InitializingBean, ApplicationContextAware, ServletContextAware, View
public class JasperReportsMultiFormatView
extends AbstractJasperReportsView

Jasper Reports view class that allows for the actual rendering format to be specified at runtime using a parameter contained in the model.

This view works on the concept of a format key and a mapping key. The format key is used to pass the mapping key from your Controller to Spring through as part of the model and the mapping key is used to map a logical format to an actual JasperReports view class. For example you might add the following code to your Controller:

 Map model = new HashMap();
 model.put("format", "pdf");
Here format is the format key and pdf is the mapping key. When rendering a report, this class looks for a model parameter under the format key, which by default is format. It then uses the value of this parameter to lookup the actual View class to use. The default mappings for this lookup are:

  • csv - JasperReportsCsvView
  • html - JasperReportsHtmlView
  • pdf - JasperReportsPdfView
  • xls - JasperReportsXlsView

The format key can be changed using the formatKey property and the mapping key to view class mappings can be changed using the formatMappings property.

Since:
1.1.5
Author:
Rob Harrop, Juergen Hoeller
See Also:
setFormatKey(java.lang.String), setFormatMappings(java.util.Map>)

Field Summary
static String DEFAULT_FORMAT_KEY
Default value used for format key: "format"
Fields inherited from class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
CONTENT_DISPOSITION_INLINE, HEADER_CONTENT_DISPOSITION
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
JasperReportsMultiFormatView()
Creates a new JasperReportsMultiFormatView instance with a default set of mappings.
Method Summary
protected boolean | generatesDownloadContent() Return whether this view generates download content (typically binary content like PDF or Excel files).
Properties | getContentDispositionMappings() Return the mappings of Content-Disposition header values to mapping keys.
protected void | renderReport(net.sf.jasperreports.engine.JasperPrint populatedReport, Map<String,Object> model, HttpServletResponse response) Locates the format key in the model using the configured discriminator key and uses this key to lookup the appropriate view class from the mappings.
void | setContentDispositionMappings(Properties mappings) Set the mappings of Content-Disposition header values to mapping keys.
void | setFormatKey(String formatKey) Set the key of the model parameter that holds the format discriminator.
void | setFormatMappings(Map<String,Class<? extends AbstractJasperReportsView>> formatMappings) Set the mappings of format discriminators to view class names.
Methods inherited from class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
convertExporterParameters, convertParameterValue, convertReportData, convertToExporterParameter, createReport, exposeLocalizationContext, fillReport, getConvertedExporterParameters, getExporterParameter, getExporterParameters, getJdbcDataSource, getReport, getReportData, getReportDataTypes, initApplicationContext, isUrlRequired, loadReport, loadReport, onInit, postProcessReport, renderMergedOutputModel, setConvertedExporterParameters, setExporterParameters, setHeaders, setJdbcDataSource, setReportDataKey, setSubReportDataKeys, setSubReportUrls
Methods inherited from class org.springframework.web.servlet.view.AbstractUrlBasedView
afterPropertiesSet, checkResource, getUrl, setUrl, toString
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

DEFAULT_FORMAT_KEY

public static final String DEFAULT_FORMAT_KEY
Default value used for format key: "format"

See Also:
Constant Field Values
Constructor Detail

JasperReportsMultiFormatView

public JasperReportsMultiFormatView()
Creates a new JasperReportsMultiFormatView instance with a default set of mappings.

Method Detail

setFormatKey

public void setFormatKey(String formatKey)
Set the key of the model parameter that holds the format discriminator. Default is "format".

setFormatMappings

public void setFormatMappings(Map<String,Class<? extends AbstractJasperReportsView>> formatMappings)
Set the mappings of format discriminators to view class names. The default mappings are:

  • csv - JasperReportsCsvView
  • html - JasperReportsHtmlView
  • pdf - JasperReportsPdfView
  • xls - JasperReportsXlsView

setContentDispositionMappings

public void setContentDispositionMappings(Properties mappings)
Set the mappings of Content-Disposition header values to mapping keys. If specified, Spring will look at these mappings to determine the value of the Content-Disposition header for a given format mapping.

getContentDispositionMappings

public Properties getContentDispositionMappings()
Return the mappings of Content-Disposition header values to mapping keys. Mainly available for configuration through property paths that specify individual keys.

generatesDownloadContent

protected boolean generatesDownloadContent()
Description copied from class: AbstractView
Return whether this view generates download content (typically binary content like PDF or Excel files).

The default implementation returns false. Subclasses are encouraged to return true here if they know that they are generating download content that requires temporary caching on the client side, typically via the response OutputStream.

Overrides:
generatesDownloadContent in class AbstractView
See Also:
AbstractView.prepareResponse(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), ServletResponse.getOutputStream()

renderReport

protected void renderReport(net.sf.jasperreports.engine.JasperPrint populatedReport,
                            Map<String,Object> model,
                            HttpServletResponse response)
                     throws Exception
Locates the format key in the model using the configured discriminator key and uses this key to lookup the appropriate view class from the mappings. The rendering of the report is then delegated to an instance of that view class.

Specified by:
renderReport in class AbstractJasperReportsView
Parameters:
populatedReport - the populated JasperPrint to render
model - the map containing report parameters
response - the HTTP response the report should be rendered to
Throws:
Exception - if rendering failed
See Also:
AbstractView.getContentType(),
ServletResponse.setContentType(java.lang.String),
ServletResponse.setCharacterEncoding(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JasperReportsPdfView

org.springframework.web.servlet.view.jasperreports
Class JasperReportsPdfView

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
                extended by  org.springframework.web.servlet.view.AbstractUrlBasedView
                    extended by  org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
                        extended by  org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsSingleFormatView
                            extended by  org.springframework.web.servlet.view.jasperreports.JasperReportsPdfView
All Implemented Interfaces:
BeanNameAware, InitializingBean, ApplicationContextAware, ServletContextAware, View
public class JasperReportsPdfView
extends AbstractJasperReportsSingleFormatView

Implementation of AbstractJasperReportsSingleFormatView that renders report results in PDF format.

Since:
1.1.3
Author:
Rob Harrop, Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
CONTENT_DISPOSITION_INLINE, HEADER_CONTENT_DISPOSITION
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
JasperReportsPdfView()
Method Summary
protected net.sf.jasperreports.engine.JRExporter | createExporter() Create a JasperReports exporter for a specific output format, which will be used to render the report to the HTTP response.
protected boolean | useWriter() Return whether to use a java.io.Writer to write text content to the HTTP response.
Methods inherited from class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsSingleFormatView
generatesDownloadContent, renderReport, renderReportUsingOutputStream, renderReportUsingWriter
Methods inherited from class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
convertExporterParameters, convertParameterValue, convertReportData, convertToExporterParameter, createReport, exposeLocalizationContext, fillReport, getConvertedExporterParameters, getExporterParameter, getExporterParameters, getJdbcDataSource, getReport, getReportData, getReportDataTypes, initApplicationContext, isUrlRequired, loadReport, loadReport, onInit, postProcessReport, renderMergedOutputModel, setConvertedExporterParameters, setExporterParameters, setHeaders, setJdbcDataSource, setReportDataKey, setSubReportDataKeys, setSubReportUrls
Methods inherited from class org.springframework.web.servlet.view.AbstractUrlBasedView
afterPropertiesSet, checkResource, getUrl, setUrl, toString
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

JasperReportsPdfView

public JasperReportsPdfView()
Method Detail

createExporter

protected net.sf.jasperreports.engine.JRExporter createExporter()
Description copied from class: AbstractJasperReportsSingleFormatView
Create a JasperReports exporter for a specific output format, which will be used to render the report to the HTTP response.

The useWriter method determines whether the output will be written as text or as binary content.

Specified by:
createExporter in class AbstractJasperReportsSingleFormatView
See Also:
AbstractJasperReportsSingleFormatView.useWriter()

useWriter

protected boolean useWriter()
Description copied from class: AbstractJasperReportsSingleFormatView
Return whether to use a java.io.Writer to write text content to the HTTP response. Else, a java.io.OutputStream will be used, to write binary content to the response.

Specified by:
useWriter in class AbstractJasperReportsSingleFormatView
See Also:
ServletResponse.getWriter(), ServletResponse.getOutputStream()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JasperReportsViewResolver

org.springframework.web.servlet.view.jasperreports
Class JasperReportsViewResolver

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractCachingViewResolver
                extended by  org.springframework.web.servlet.view.UrlBasedViewResolver
                    extended by  org.springframework.web.servlet.view.jasperreports.JasperReportsViewResolver
All Implemented Interfaces:
ApplicationContextAware, Ordered, ServletContextAware, ViewResolver
public class JasperReportsViewResolver
extends UrlBasedViewResolver

ViewResolver implementation that resolves instances of AbstractJasperReportsView by translating the supplied view name into the URL of the report file.

Since:
1.2.6
Author:
Rob Harrop

Field Summary
Fields inherited from class org.springframework.web.servlet.view.UrlBasedViewResolver
FORWARD_URL_PREFIX, REDIRECT_URL_PREFIX
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
JasperReportsViewResolver()
Method Summary
protected AbstractUrlBasedView | buildView(String viewName) Creates a new View instance of the specified view class and configures it.
protected Class | requiredViewClass() Requires the view class to be a subclass of AbstractJasperReportsView.
void | setExporterParameters(Map<String,Object> exporterParameters) Set the exporterParameters the view class should use.
void | setHeaders(Properties headers) Set the headers the view class should use.
void | setJdbcDataSource(DataSource jdbcDataSource) Set the DataSource the view class should use.
void | setReportDataKey(String reportDataKey) Set the reportDataKey the view class should use.
void | setSubReportDataKeys(String[] subReportDataKeys) Set the subReportDataKeys the view class should use.
void | setSubReportUrls(Properties subReportUrls) Set the subReportUrls the view class should use.
Methods inherited from class org.springframework.web.servlet.view.UrlBasedViewResolver
canHandle, createView, getAttributesMap, getCacheKey, getContentType, getOrder, getPrefix, getRequestContextAttribute, getSuffix, getViewClass, getViewNames, initApplicationContext, isRedirectContextRelative, isRedirectHttp10Compatible, loadView, setAttributes, setAttributesMap, setContentType, setOrder, setPrefix, setRedirectContextRelative, setRedirectHttp10Compatible, setRequestContextAttribute, setSuffix, setViewClass, setViewNames
Methods inherited from class org.springframework.web.servlet.view.AbstractCachingViewResolver
clearCache, isCache, removeFromCache, resolveViewName, setCache
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JasperReportsViewResolver

public JasperReportsViewResolver()
Method Detail

requiredViewClass

protected Class requiredViewClass()
Requires the view class to be a subclass of AbstractJasperReportsView.

Overrides:
requiredViewClass in class UrlBasedViewResolver
See Also:
AbstractUrlBasedView

setReportDataKey

public void setReportDataKey(String reportDataKey)
Set the reportDataKey the view class should use.

See Also:
AbstractJasperReportsView.setReportDataKey(java.lang.String)

setSubReportUrls

public void setSubReportUrls(Properties subReportUrls)
Set the subReportUrls the view class should use.

See Also:
AbstractJasperReportsView.setSubReportUrls(java.util.Properties)

setSubReportDataKeys

public void setSubReportDataKeys(String[] subReportDataKeys)
Set the subReportDataKeys the view class should use.

See Also:
AbstractJasperReportsView.setSubReportDataKeys(java.lang.String[])

setHeaders

public void setHeaders(Properties headers)
Set the headers the view class should use.

See Also:
AbstractJasperReportsView.setHeaders(java.util.Properties)

setExporterParameters

public void setExporterParameters(Map<String,Object> exporterParameters)
Set the exporterParameters the view class should use.

See Also:
AbstractJasperReportsView.setExporterParameters(java.util.Map)

setJdbcDataSource

public void setJdbcDataSource(DataSource jdbcDataSource)
Set the DataSource the view class should use.

See Also:
AbstractJasperReportsView.setJdbcDataSource(javax.sql.DataSource)

buildView

protected AbstractUrlBasedView buildView(String viewName)
                                  throws Exception
Description copied from class: UrlBasedViewResolver
Creates a new View instance of the specified view class and configures it. Does not perform any lookup for pre-defined View instances.

Spring lifecycle methods as defined by the bean container do not have to be called here; those will be applied by the loadView method after this method returns.

Subclasses will typically call super.buildView(viewName) first, before setting further properties themselves. loadView will then apply Spring lifecycle methods at the end of this process.

Overrides:
buildView in class UrlBasedViewResolver
Parameters:
viewName - the name of the view to build
Returns:
the View instance
Throws:
Exception - if the view couldn't be resolved
See Also:
UrlBasedViewResolver.loadView(String, java.util.Locale)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JasperReportsXlsView

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.view.jasperreports
Class JasperReportsXlsView

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
                extended by  org.springframework.web.servlet.view.AbstractUrlBasedView
                    extended by  org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
                        extended by  org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsSingleFormatView
                            extended by  org.springframework.web.servlet.view.jasperreports.JasperReportsXlsView
All Implemented Interfaces:
BeanNameAware, InitializingBean, ApplicationContextAware, ServletContextAware, View
public class JasperReportsXlsView
extends AbstractJasperReportsSingleFormatView

Implementation of AbstractJasperReportsSingleFormatView that renders report results in XLS format.

Since:
1.1.3
Author:
Rob Harrop, Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
CONTENT_DISPOSITION_INLINE, HEADER_CONTENT_DISPOSITION
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
JasperReportsXlsView()
Method Summary
protected net.sf.jasperreports.engine.JRExporter | createExporter() Create a JasperReports exporter for a specific output format, which will be used to render the report to the HTTP response.
protected boolean | useWriter() Return whether to use a java.io.Writer to write text content to the HTTP response.
Methods inherited from class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsSingleFormatView
generatesDownloadContent, renderReport, renderReportUsingOutputStream, renderReportUsingWriter
Methods inherited from class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
convertExporterParameters, convertParameterValue, convertReportData, convertToExporterParameter, createReport, exposeLocalizationContext, fillReport, getConvertedExporterParameters, getExporterParameter, getExporterParameters, getJdbcDataSource, getReport, getReportData, getReportDataTypes, initApplicationContext, isUrlRequired, loadReport, loadReport, onInit, postProcessReport, renderMergedOutputModel, setConvertedExporterParameters, setExporterParameters, setHeaders, setJdbcDataSource, setReportDataKey, setSubReportDataKeys, setSubReportUrls
Methods inherited from class org.springframework.web.servlet.view.AbstractUrlBasedView
afterPropertiesSet, checkResource, getUrl, setUrl, toString
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

JasperReportsXlsView

public JasperReportsXlsView()
Method Detail

createExporter

protected net.sf.jasperreports.engine.JRExporter createExporter()
Description copied from class: AbstractJasperReportsSingleFormatView
Create a JasperReports exporter for a specific output format, which will be used to render the report to the HTTP response.

The useWriter method determines whether the output will be written as text or as binary content.

Specified by:
createExporter in class AbstractJasperReportsSingleFormatView
See Also:
AbstractJasperReportsSingleFormatView.useWriter()

useWriter

protected boolean useWriter()
Description copied from class: AbstractJasperReportsSingleFormatView
Return whether to use a java.io.Writer to write text content to the HTTP response. Else, a java.io.OutputStream will be used, to write binary content to the response.

Specified by:
useWriter in class AbstractJasperReportsSingleFormatView
See Also:
ServletResponse.getWriter(), ServletResponse.getOutputStream()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.servlet.view.json

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.servlet.view.json

Support classes for providing a View implementation based on JSON serialization.

See:
Description

Class Summary
MappingJacksonJsonView Spring-MVC View that renders JSON content by serializing the model for the current request using Jackson's ObjectMapper.

Package org.springframework.web.servlet.view.json Description

Support classes for providing a View implementation based on JSON serialization.


org.springframework.web.servlet.view.json Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.servlet.view.json

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.context.support.ApplicationObjectSupport (implements org.springframework.context.ApplicationContextAware)
      • org.springframework.web.context.support.WebApplicationObjectSupport (implements org.springframework.web.context.ServletContextAware)
        • org.springframework.web.servlet.view.AbstractView (implements org.springframework.beans.factory.BeanNameAware, org.springframework.web.servlet.View)
          • org.springframework.web.servlet.view.json.MappingJacksonJsonView


MappingJacksonJsonView

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.view.json
Class MappingJacksonJsonView

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
                extended by  org.springframework.web.servlet.view.json.MappingJacksonJsonView
All Implemented Interfaces:
BeanNameAware, ApplicationContextAware, ServletContextAware, View
public class MappingJacksonJsonView
extends AbstractView

Spring-MVC View that renders JSON content by serializing the model for the current request using Jackson's ObjectMapper.

By default, the entire contents of the model map (with the exception of framework-specific classes) will be encoded as JSON. For cases where the contents of the map need to be filtered, users may specify a specific set of model attributes to encode via the renderedAttributes property.

Since:
3.0
Author:
Jeremy Grelle, Arjen Poutsma
See Also:
MappingJacksonHttpMessageConverter

Field Summary
static String DEFAULT_CONTENT_TYPE
Default content type.
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
MappingJacksonJsonView()
Construct a new JacksonJsonView, setting the content type to application/json.
Method Summary
protected Object | filterModel(Map<String,Object> model) Filters out undesired attributes from the given model.
protected void | prepareResponse(HttpServletRequest request, HttpServletResponse response) Prepare the given response for rendering.
protected void | renderMergedOutputModel(Map<String,Object> model, HttpServletRequest request, HttpServletResponse response) Subclasses must implement this method to actually render the view.
void | setDisableCaching(boolean disableCaching) Disables caching of the generated JSON.
void | setEncoding(org.codehaus.jackson.JsonEncoding encoding) Sets the JsonEncoding for this converter.
void | setObjectMapper(org.codehaus.jackson.map.ObjectMapper objectMapper) Sets the ObjectMapper for this view.
void | setPrefixJson(boolean prefixJson) Indicates whether the JSON output by this view should be prefixed with "{} &&".
void | setRenderedAttributes(Set<String> renderedAttributes) Sets the attributes in the model that should be rendered by this view.
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, toString, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

DEFAULT_CONTENT_TYPE

public static final String DEFAULT_CONTENT_TYPE
Default content type. Overridable as bean property.

See Also:
Constant Field Values
Constructor Detail

MappingJacksonJsonView

public MappingJacksonJsonView()
Construct a new JacksonJsonView, setting the content type to application/json.

Method Detail

setObjectMapper

public void setObjectMapper(org.codehaus.jackson.map.ObjectMapper objectMapper)
Sets the ObjectMapper for this view. If not set, a default ObjectMapper is used.

Setting a custom-configured ObjectMapper is one way to take further control of the JSON serialization process. For example, an extended SerializerFactory can be configured that provides custom serializers for specific types. The other option for refining the serialization process is to use Jackson's provided annotations on the types to be serialized, in which case a custom-configured ObjectMapper is unnecessary.

setEncoding

public void setEncoding(org.codehaus.jackson.JsonEncoding encoding)
Sets the JsonEncoding for this converter. By default, UTF-8 is used.

setPrefixJson

public void setPrefixJson(boolean prefixJson)
Indicates whether the JSON output by this view should be prefixed with "{} &&". Default is false.

Prefixing the JSON string in this manner is used to help prevent JSON Hijacking. The prefix renders the string syntactically invalid as a script so that it cannot be hijacked. This prefix does not affect the evaluation of JSON, but if JSON validation is performed on the string, the prefix would need to be ignored.

setRenderedAttributes

public void setRenderedAttributes(Set<String> renderedAttributes)
Sets the attributes in the model that should be rendered by this view. When set, all other model attributes will be ignored.

setDisableCaching

public void setDisableCaching(boolean disableCaching)
Disables caching of the generated JSON.

Default is true, which will prevent the client from caching the generated JSON.

prepareResponse

protected void prepareResponse(HttpServletRequest request,
                               HttpServletResponse response)
Description copied from class: AbstractView
Prepare the given response for rendering.

The default implementation applies a workaround for an IE bug when sending download content via HTTPS.

Overrides:
prepareResponse in class AbstractView
Parameters:
request - current HTTP request
response - current HTTP response

renderMergedOutputModel

protected void renderMergedOutputModel(Map<String,Object> model,
                                       HttpServletRequest request,
                                       HttpServletResponse response)
                                throws Exception
Description copied from class: AbstractView
Subclasses must implement this method to actually render the view.

The first step will be preparing the request: In the JSP case, this would mean setting model objects as request attributes. The second step will be the actual rendering of the view, for example including the JSP via a RequestDispatcher.

Specified by:
renderMergedOutputModel in class AbstractView
Parameters:
model - combined output Map (never null), with dynamic values taking precedence over static attributes
request - current HTTP request
response - current HTTP response
Throws:
Exception - if rendering failed

filterModel

protected Object filterModel(Map<String,Object> model)
Filters out undesired attributes from the given model. The return value can be either another Map, or a single value object.

Default implementation removes BindingResult instances and entries not included in the renderedAttributes property.

Parameters:
model - the model, as passed on to renderMergedOutputModel(java.util.Map, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
Returns:
the object to be rendered
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.servlet.view.tiles

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.servlet.view.tiles

Support classes for the integration of Tiles (included in Struts) as Spring web view technology.

See:
Description

Class Summary
ComponentControllerSupport | Deprecated. as of Spring 3.0
TilesConfigurer | Deprecated. as of Spring 3.0
TilesJstlView | Deprecated. as of Spring 3.0
TilesView | Deprecated. as of Spring 3.0

Package org.springframework.web.servlet.view.tiles Description

Support classes for the integration of Tiles (included in Struts) as Spring web view technology. Contains a View implementation for Tiles definitions.


org.springframework.web.servlet.view.tiles Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.servlet.view.tiles

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.context.support.ApplicationObjectSupport (implements org.springframework.context.ApplicationContextAware)
      • org.springframework.web.context.support.WebApplicationObjectSupport (implements org.springframework.web.context.ServletContextAware)
        • org.springframework.web.servlet.view.AbstractView (implements org.springframework.beans.factory.BeanNameAware, org.springframework.web.servlet.View)
          • org.springframework.web.servlet.view.AbstractUrlBasedView (implements org.springframework.beans.factory.InitializingBean)
            • org.springframework.web.servlet.view.InternalResourceView
              • org.springframework.web.servlet.view.tiles.TilesView
                • org.springframework.web.servlet.view.tiles.TilesJstlView
        • org.springframework.web.servlet.view.tiles.TilesConfigurer (implements org.springframework.beans.factory.InitializingBean)
    • org.apache.struts.tiles.ControllerSupport (implements org.apache.struts.tiles.Controller)
      • org.springframework.web.servlet.view.tiles.ComponentControllerSupport


ComponentControllerSupport

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.view.tiles
Class ComponentControllerSupport

java.lang.Object
    extended by  org.apache.struts.tiles.ControllerSupport
        extended by  org.springframework.web.servlet.view.tiles.ComponentControllerSupport
All Implemented Interfaces:
Controller
Deprecated. as of Spring 3.0

@Deprecated
public abstract class ComponentControllerSupport
extends ControllerSupport

Convenience class for Spring-aware Tiles component controllers. Provides a reference to the current Spring application context, e.g. for bean lookup or resource loading.

Derives from the Tiles ControllerSupport class rather than implementing the Tiles Controller interface in order to be compatible with Struts 1.1 and 1.2. Implements both Struts 1.1's perform and Struts 1.2's execute method accordingly.

Since:
22.08.2003
Author:
Juergen Hoeller, Alef Arendsen
See Also:
WebApplicationObjectSupport

Constructor Summary
ComponentControllerSupport()
Deprecated.
Method Summary
protected abstract void | doPerform(ComponentContext componentContext, HttpServletRequest request, HttpServletResponse response) Deprecated. Perform the preparation for the component, allowing for any Exception to be thrown.
void | execute(ComponentContext componentContext, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext) Deprecated. This implementation delegates to doPerform, lazy-initializing the application context reference if necessary.
protected ApplicationContext | getApplicationContext() Deprecated. Return the current Spring ApplicationContext.
protected MessageSourceAccessor | getMessageSourceAccessor() Deprecated. Return a MessageSourceAccessor for the application context used by this object, for easy message access.
protected ServletContext | getServletContext() Deprecated. Return the current ServletContext.
protected File | getTempDir() Deprecated. Return the temporary directory for the current web application, as provided by the servlet container.
protected WebApplicationContext | getWebApplicationContext() Deprecated. Return the current Spring WebApplicationContext.
protected void | initApplicationContext() Deprecated. Subclasses can override this for custom initialization behavior.
void | perform(ComponentContext componentContext, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext) Deprecated. This implementation delegates to execute, converting non-Servlet/IO Exceptions to ServletException.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ComponentControllerSupport

public ComponentControllerSupport()
Deprecated.
Method Detail

perform

public final void perform(ComponentContext componentContext,
                          HttpServletRequest request,
                          HttpServletResponse response,
                          ServletContext servletContext)
                   throws ServletException,
                          IOException
Deprecated.
This implementation delegates to execute, converting non-Servlet/IO Exceptions to ServletException.

This is the only execution method available in Struts 1.1.

Specified by:
perform in interface Controller
Overrides:
perform in class ControllerSupport
Throws:
ServletException
IOException
See Also:
execute(org.apache.struts.tiles.ComponentContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.ServletContext)

execute

public final void execute(ComponentContext componentContext,
                          HttpServletRequest request,
                          HttpServletResponse response,
                          ServletContext servletContext)
                   throws Exception
Deprecated.
This implementation delegates to doPerform, lazy-initializing the application context reference if necessary.

This is the preferred execution method in Struts 1.2. When running with Struts 1.1, it will be called by perform.

Specified by:
execute in interface Controller
Overrides:
execute in class ControllerSupport
Throws:
Exception
See Also:
perform(org.apache.struts.tiles.ComponentContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.ServletContext), doPerform(org.apache.struts.tiles.ComponentContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

initApplicationContext

protected void initApplicationContext()
                               throws BeansException
Deprecated.
Subclasses can override this for custom initialization behavior. Gets called on initialization of the context for this controller.

Throws:
ApplicationContextException - in case of initialization errors
BeansException - if thrown by application context methods

getApplicationContext

protected final ApplicationContext getApplicationContext()
Deprecated.
Return the current Spring ApplicationContext.

getWebApplicationContext

protected final WebApplicationContext getWebApplicationContext()
Deprecated.
Return the current Spring WebApplicationContext.

getMessageSourceAccessor

protected final MessageSourceAccessor getMessageSourceAccessor()
Deprecated.
Return a MessageSourceAccessor for the application context used by this object, for easy message access.

getServletContext

protected final ServletContext getServletContext()
Deprecated.
Return the current ServletContext.

getTempDir

protected final File getTempDir()
Deprecated.
Return the temporary directory for the current web application, as provided by the servlet container.

Returns:
the File representing the temporary directory

doPerform

protected abstract void doPerform(ComponentContext componentContext,
                                  HttpServletRequest request,
                                  HttpServletResponse response)
                           throws Exception
Deprecated.
Perform the preparation for the component, allowing for any Exception to be thrown. The ServletContext can be retrieved via getServletContext, if necessary. The Spring WebApplicationContext can be accessed via getWebApplicationContext.

This method will be called both in the Struts 1.1 and Struts 1.2 case, by perform or execute, respectively.

Parameters:
componentContext - current Tiles component context
request - current HTTP request
response - current HTTP response
Throws:
Exception - in case of errors
See Also:
Controller.perform(org.apache.struts.tiles.ComponentContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.ServletContext),
getServletContext(),
getWebApplicationContext(),
perform(org.apache.struts.tiles.ComponentContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.ServletContext),
execute(org.apache.struts.tiles.ComponentContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.ServletContext)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


TilesConfigurer

org.springframework.web.servlet.view.tiles
Class TilesConfigurer

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.tiles.TilesConfigurer
All Implemented Interfaces:
InitializingBean, ApplicationContextAware, ServletContextAware
Deprecated. as of Spring 3.0

@Deprecated
public class TilesConfigurer
extends WebApplicationObjectSupport
implements InitializingBean

Helper class to configure Tiles 1.x for the Spring Framework. See http://struts.apache.org for more information about Struts Tiles, which basically is a templating mechanism for JSP-based web applications.

NOTE: This TilesConfigurer class supports Tiles 1.x, a.k.a. "Struts Tiles", which comes as part of Struts 1.x. For Tiles 2.x support, check out TilesConfigurer.

The TilesConfigurer simply configures a Tiles DefinitionsFactory using a set of files containing definitions, to be accessed by TilesView instances.

TilesViews can be managed by any ViewResolver. For simple convention-based view resolution, consider using UrlBasedViewResolver with the "viewClass" property set to "org.springframework.web.servlet.view.tiles.TilesView".

A typical TilesConfigurer bean definition looks as follows:

 <bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles.TilesConfigurer">
   <property name="definitions">
     <list>
       <value>/WEB-INF/defs/general.xml</value>
       <value>/WEB-INF/defs/widgets.xml</value>
       <value>/WEB-INF/defs/administrator.xml</value>
       <value>/WEB-INF/defs/customer.xml</value>
       <value>/WEB-INF/defs/templates.xml</value>
     </list>
   </property>
 </bean>
The values in the list are the actual files containing the definitions.

Author:
Alef Arendsen, Juergen Hoeller
See Also:
TilesView, UrlBasedViewResolver

Field Summary
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Constructor Summary
TilesConfigurer()
Deprecated.
Method Summary
void | afterPropertiesSet() Deprecated. Initialize the Tiles definition factory.
protected DefinitionsFactory | createDefinitionsFactory(DefinitionsFactoryConfig factoryConfig) Deprecated. Create the Tiles DefinitionsFactory and expose it to the ServletContext.
void | setDefinitions(String[] definitions) Deprecated. Set the Tiles definitions, i.e.
void | setFactoryClass(Class factoryClass) Deprecated. Set the factory class for Tiles.
void | setValidateDefinitions(boolean validateDefinitions) Deprecated. Set whether to validate the Tiles XML definitions.
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TilesConfigurer

public TilesConfigurer()
Deprecated.
Method Detail

setDefinitions

public void setDefinitions(String[] definitions)
Deprecated.
Set the Tiles definitions, i.e. the list of files containing the definitions.

setValidateDefinitions

public void setValidateDefinitions(boolean validateDefinitions)
Deprecated.
Set whether to validate the Tiles XML definitions. Default is "true".

setFactoryClass

public void setFactoryClass(Class factoryClass)
Deprecated.
Set the factory class for Tiles. Default is I18nFactorySet.

See Also:
I18nFactorySet

afterPropertiesSet

public void afterPropertiesSet()
                        throws DefinitionsFactoryException
Deprecated.
Initialize the Tiles definition factory. Delegates to createDefinitionsFactory for the actual creation.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
DefinitionsFactoryException - if an error occurs
See Also:
createDefinitionsFactory(org.apache.struts.tiles.DefinitionsFactoryConfig)

createDefinitionsFactory

protected DefinitionsFactory createDefinitionsFactory(DefinitionsFactoryConfig factoryConfig)
                                               throws DefinitionsFactoryException
Deprecated.
Create the Tiles DefinitionsFactory and expose it to the ServletContext.

Parameters:
factoryConfig - the configuration for the DefinitionsFactory
Returns:
the DefinitionsFactory
Throws:
DefinitionsFactoryException - if an error occurs
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TilesJstlView

org.springframework.web.servlet.view.tiles
Class TilesJstlView

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
                extended by  org.springframework.web.servlet.view.AbstractUrlBasedView
                    extended by  org.springframework.web.servlet.view.InternalResourceView
                        extended by  org.springframework.web.servlet.view.tiles.TilesView
                            extended by  org.springframework.web.servlet.view.tiles.TilesJstlView
All Implemented Interfaces:
BeanNameAware, InitializingBean, ApplicationContextAware, ServletContextAware, View
Deprecated. as of Spring 3.0

@Deprecated
public class TilesJstlView
extends TilesView

Specialization of TilesView for JSTL pages, i.e. Tiles pages that use the JSP Standard Tag Library.

NOTE: This TilesJstlView class supports Tiles 1.x, a.k.a. "Struts Tiles", which comes as part of Struts 1.x. For Tiles 2.x support, check out TilesView.

Exposes JSTL-specific request attributes specifying locale and resource bundle for JSTL's formatting and message tags, using Spring's locale and message source.

This is a separate class mainly to avoid JSTL dependencies in TilesView itself.

Since:
20.08.2003
Author:
Juergen Hoeller
See Also:
JstlUtils.exposeLocalizationContext(javax.servlet.http.HttpServletRequest, org.springframework.context.MessageSource)

Field Summary
Fields inherited from class org.springframework.web.servlet.view.tiles.TilesView
PATH_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
TilesJstlView()
Deprecated.
Method Summary
protected  void exposeHelpers(HttpServletRequest request)
Deprecated. Expose helpers unique to each rendering operation.
Methods inherited from class org.springframework.web.servlet.view.tiles.TilesView
executeController, getComponentContext, getComponentDefinition, getController, getDispatcherPath, initApplicationContext, prepareForRendering, setPath
Methods inherited from class org.springframework.web.servlet.view.InternalResourceView
exposeForwardRequestAttributes, getRequestToExpose, initServletContext, isContextRequired, renderMergedOutputModel, setAlwaysInclude, setExposeContextBeansAsAttributes, setExposedContextBeanNames, setExposeForwardAttributes, setPreventDispatchLoop, useInclude
Methods inherited from class org.springframework.web.servlet.view.AbstractUrlBasedView
afterPropertiesSet, checkResource, getUrl, isUrlRequired, setUrl, toString
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

TilesJstlView

public TilesJstlView()
Deprecated.
Method Detail

exposeHelpers

protected void exposeHelpers(HttpServletRequest request)
                      throws Exception
Deprecated.
Description copied from class: InternalResourceView
Expose helpers unique to each rendering operation. This is necessary so that different rendering operations can't overwrite each other's contexts etc.

Called by InternalResourceView.renderMergedOutputModel(Map, HttpServletRequest, HttpServletResponse). The default implementation is empty. This method can be overridden to add custom helpers as request attributes.

Overrides:
exposeHelpers in class InternalResourceView
Parameters:
request - current HTTP request
Throws:
Exception - if there's a fatal error while we're adding attributes
See Also:
InternalResourceView.renderMergedOutputModel(java.util.Map, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), JstlView.exposeHelpers(javax.servlet.http.HttpServletRequest)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TilesView

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.view.tiles
Class TilesView

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
                extended by  org.springframework.web.servlet.view.AbstractUrlBasedView
                    extended by  org.springframework.web.servlet.view.InternalResourceView
                        extended by  org.springframework.web.servlet.view.tiles.TilesView
All Implemented Interfaces:
BeanNameAware, InitializingBean, ApplicationContextAware, ServletContextAware, View
Direct Known Subclasses:
TilesJstlView
Deprecated. as of Spring 3.0

@Deprecated
public class TilesView
extends InternalResourceView

View implementation that retrieves a Tiles definition. The "url" property is interpreted as name of a Tiles definition.

TilesJstlView with JSTL support is a separate class, mainly to avoid JSTL dependencies in this class.

NOTE: This TilesView class supports Tiles 1.x, a.k.a. "Struts Tiles", which comes as part of Struts 1.x. For Tiles 2.x support, check out TilesView.

Depends on a Tiles DefinitionsFactory which must be available in the ServletContext. This factory is typically set up via a TilesConfigurer bean definition in the application context.

Check out ComponentControllerSupport which provides a convenient base class for Spring-aware component controllers, allowing convenient access to the Spring ApplicationContext.

Author:
Alef Arendsen, Juergen Hoeller
See Also:
AbstractUrlBasedView.setUrl(java.lang.String), TilesJstlView, TilesConfigurer, ComponentControllerSupport

Field Summary
static String PATH_ATTRIBUTE
Deprecated. Name of the attribute that will override the path of the layout page to render.
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
TilesView()
Deprecated.
Method Summary
protected void | executeController(Controller controller, ComponentContext context, HttpServletRequest request, HttpServletResponse response) Deprecated. Execute the given Tiles controller.
protected ComponentContext | getComponentContext(ComponentDefinition definition, HttpServletRequest request) Deprecated. Determine the Tiles component context for the given Tiles definition.
protected ComponentDefinition | getComponentDefinition(DefinitionsFactory factory, HttpServletRequest request) Deprecated. Determine the Tiles component definition for the given Tiles definitions factory.
protected Controller | getController(ComponentDefinition definition, HttpServletRequest request) Deprecated. Determine and initialize the Tiles component controller for the given Tiles definition, if any.
protected String | getDispatcherPath(ComponentDefinition definition, HttpServletRequest request) Deprecated. Determine the dispatcher path for the given Tiles definition, i.e.
protected void | initApplicationContext() Deprecated. Subclasses can override this for custom initialization behavior.
protected String | prepareForRendering(HttpServletRequest request, HttpServletResponse response) Deprecated. Prepare for rendering the Tiles definition: Execute the associated component controller if any, and determine the request dispatcher path.
static void | setPath(HttpServletRequest request, String path) Deprecated. Set the path of the layout page to render.
Methods inherited from class org.springframework.web.servlet.view.InternalResourceView
exposeForwardRequestAttributes, exposeHelpers, getRequestToExpose, initServletContext, isContextRequired, renderMergedOutputModel, setAlwaysInclude, setExposeContextBeansAsAttributes, setExposedContextBeanNames, setExposeForwardAttributes, setPreventDispatchLoop, useInclude
Methods inherited from class org.springframework.web.servlet.view.AbstractUrlBasedView
afterPropertiesSet, checkResource, getUrl, isUrlRequired, setUrl, toString
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

PATH_ATTRIBUTE

public static final String PATH_ATTRIBUTE
Deprecated.
Name of the attribute that will override the path of the layout page to render. A Tiles component controller can set such an attribute to dynamically switch the look and feel of a Tiles page.

See Also:
setPath(javax.servlet.http.HttpServletRequest, java.lang.String)
Constructor Detail

TilesView

public TilesView()
Deprecated.
Method Detail

setPath

public static void setPath(HttpServletRequest request,
                           String path)
Deprecated.
Set the path of the layout page to render.

Parameters:
request - current HTTP request
path - the path of the layout page
See Also:
PATH_ATTRIBUTE

initApplicationContext

protected void initApplicationContext()
                               throws ApplicationContextException
Deprecated.
Description copied from class: ApplicationObjectSupport
Subclasses can override this for custom initialization behavior.

The default implementation is empty. Called by ApplicationObjectSupport.initApplicationContext(org.springframework.context.ApplicationContext).

Overrides:
initApplicationContext in class ApplicationObjectSupport
Throws:
ApplicationContextException - in case of initialization errors
See Also:
ApplicationObjectSupport.setApplicationContext(org.springframework.context.ApplicationContext)

prepareForRendering

protected String prepareForRendering(HttpServletRequest request,
                                     HttpServletResponse response)
                              throws Exception
Deprecated.
Prepare for rendering the Tiles definition: Execute the associated component controller if any, and determine the request dispatcher path.

Overrides:
prepareForRendering in class InternalResourceView
Parameters:
request - current HTTP request
response - current HTTP response
Returns:
the request dispatcher path to use
Throws:
Exception - if preparations failed
See Also:
AbstractUrlBasedView.getUrl()

getComponentDefinition

protected ComponentDefinition getComponentDefinition(DefinitionsFactory factory,
                                                     HttpServletRequest request)
                                              throws Exception
Deprecated.
Determine the Tiles component definition for the given Tiles definitions factory.

Parameters:
factory - the Tiles definitions factory
request - current HTTP request
Returns:
the component definition
Throws:
Exception

getComponentContext

protected ComponentContext getComponentContext(ComponentDefinition definition,
                                               HttpServletRequest request)
                                        throws Exception
Deprecated.
Determine the Tiles component context for the given Tiles definition.

Parameters:
definition - the Tiles definition to render
request - current HTTP request
Returns:
the component context
Throws:
Exception - if preparations failed

getController

protected Controller getController(ComponentDefinition definition,
                                   HttpServletRequest request)
                            throws Exception
Deprecated.
Determine and initialize the Tiles component controller for the given Tiles definition, if any.

Parameters:
definition - the Tiles definition to render
request - current HTTP request
Returns:
the component controller to execute, or null if none
Throws:
Exception - if preparations failed

executeController

protected void executeController(Controller controller,
                                 ComponentContext context,
                                 HttpServletRequest request,
                                 HttpServletResponse response)
                          throws Exception
Deprecated.
Execute the given Tiles controller.

Parameters:
controller - the component controller to execute
context - the component context
request - current HTTP request
response - current HTTP response
Throws:
Exception - if controller execution failed

getDispatcherPath

protected String getDispatcherPath(ComponentDefinition definition,
                                   HttpServletRequest request)
                            throws Exception
Deprecated.
Determine the dispatcher path for the given Tiles definition, i.e. the request dispatcher path of the layout page.

Parameters:
definition - the Tiles definition to render
request - current HTTP request
Returns:
the path of the layout page to render
Throws:
Exception - if preparations failed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.servlet.view.tiles2

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.servlet.view.tiles2

Support classes for the integration of Tiles2 (the standalone version of Tiles) as Spring web view technology.

See:
Description

Class Summary
AbstractSpringPreparerFactory | Abstract implementation of the Tiles2 PreparerFactory interface, obtaining the current Spring WebApplicationContext and delegating to AbstractSpringPreparerFactory.getPreparer(String, org.springframework.web.context.WebApplicationContext).
SimpleSpringPreparerFactory | Tiles2 PreparerFactory implementation that expects preparer class names and builds preparer instances for those, creating them through the Spring ApplicationContext in order to apply Spring container callbacks and configured Spring BeanPostProcessors.
SpringBeanPreparerFactory | Tiles2 PreparerFactory implementation that expects preparer bean names and obtains preparer beans from the Spring ApplicationContext.
SpringLocaleResolver | Tiles LocaleResolver adapter that delegates to a Spring LocaleResolver, exposing the DispatcherServlet-managed locale.
SpringTilesApplicationContextFactory | Spring-specific subclass of the standard Tiles AbstractTilesApplicationContextFactory, passing given properties through as Tiles init-param map.
TilesConfigurer | Helper class to configure Tiles 2.x for the Spring Framework.
TilesView | View implementation that retrieves a Tiles definition.
TilesViewResolver | Convenience subclass of UrlBasedViewResolver that supports TilesView (i.e.

Package org.springframework.web.servlet.view.tiles2 Description

Support classes for the integration of Tiles2 (the standalone version of Tiles) as Spring web view technology. Contains a View implementation for Tiles definitions.


org.springframework.web.servlet.view.tiles2 Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.servlet.view.tiles2

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.web.servlet.view.tiles2.AbstractSpringPreparerFactory (implements org.apache.tiles.preparer.PreparerFactory)
      • org.springframework.web.servlet.view.tiles2.SimpleSpringPreparerFactory
      • org.springframework.web.servlet.view.tiles2.SpringBeanPreparerFactory
    • org.apache.tiles.context.AbstractTilesApplicationContextFactory
      • org.springframework.web.servlet.view.tiles2.SpringTilesApplicationContextFactory (implements org.apache.tiles.Initializable)
    • org.springframework.context.support.ApplicationObjectSupport (implements org.springframework.context.ApplicationContextAware)
      • org.springframework.web.context.support.WebApplicationObjectSupport (implements org.springframework.web.context.ServletContextAware)
        • org.springframework.web.servlet.view.AbstractCachingViewResolver (implements org.springframework.web.servlet.ViewResolver)
          • org.springframework.web.servlet.view.UrlBasedViewResolver (implements org.springframework.core.Ordered)
            • org.springframework.web.servlet.view.tiles2.TilesViewResolver
        • org.springframework.web.servlet.view.AbstractView (implements org.springframework.beans.factory.BeanNameAware, org.springframework.web.servlet.View)
          • org.springframework.web.servlet.view.AbstractUrlBasedView (implements org.springframework.beans.factory.InitializingBean)
            • org.springframework.web.servlet.view.tiles2.TilesView
    • org.apache.tiles.locale.impl.DefaultLocaleResolver (implements org.apache.tiles.locale.LocaleResolver)
      • org.springframework.web.servlet.view.tiles2.SpringLocaleResolver
    • org.springframework.web.servlet.view.tiles2.TilesConfigurer (implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.web.context.ServletContextAware)


AbstractSpringPreparerFactory

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.view.tiles2
Class AbstractSpringPreparerFactory

java.lang.Object
    extended by  org.springframework.web.servlet.view.tiles2.AbstractSpringPreparerFactory
All Implemented Interfaces:
PreparerFactory
Direct Known Subclasses:
SimpleSpringPreparerFactory, SpringBeanPreparerFactory
public abstract class AbstractSpringPreparerFactory
extends Object
implements PreparerFactory

Abstract implementation of the Tiles2 PreparerFactory interface, obtaining the current Spring WebApplicationContext and delegating to getPreparer(String, org.springframework.web.context.WebApplicationContext).

Since:
2.5
Author:
Juergen Hoeller
See Also:
getPreparer(String, org.springframework.web.context.WebApplicationContext), SimpleSpringPreparerFactory, SpringBeanPreparerFactory

Constructor Summary
AbstractSpringPreparerFactory()
Method Summary
ViewPreparer | getPreparer(String name, TilesRequestContext context)
protected abstract ViewPreparer | getPreparer(String name, WebApplicationContext context) Obtain a preparer instance for the given preparer name, based on the given Spring WebApplicationContext.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractSpringPreparerFactory

public AbstractSpringPreparerFactory()
Method Detail

getPreparer

public ViewPreparer getPreparer(String name,
                                TilesRequestContext context)
                         throws TilesException
Specified by:
getPreparer in interface PreparerFactory
Throws:
TilesException

getPreparer

protected abstract ViewPreparer getPreparer(String name,
                                            WebApplicationContext context)
                                     throws TilesException
Obtain a preparer instance for the given preparer name, based on the given Spring WebApplicationContext.

Parameters:
name - the name of the preparer
context - the current Spring WebApplicationContext
Returns:
the preparer instance
Throws:
TilesException - in case of failure
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


SimpleSpringPreparerFactory

org.springframework.web.servlet.view.tiles2
Class SimpleSpringPreparerFactory

java.lang.Object
    extended by  org.springframework.web.servlet.view.tiles2.AbstractSpringPreparerFactory
        extended by  org.springframework.web.servlet.view.tiles2.SimpleSpringPreparerFactory
All Implemented Interfaces:
PreparerFactory
public class SimpleSpringPreparerFactory
extends AbstractSpringPreparerFactory

Tiles2 PreparerFactory implementation that expects preparer class names and builds preparer instances for those, creating them through the Spring ApplicationContext in order to apply Spring container callbacks and configured Spring BeanPostProcessors.

Since:
2.5
Author:
Juergen Hoeller
See Also:
SpringBeanPreparerFactory

Constructor Summary
SimpleSpringPreparerFactory()
Method Summary
protected  ViewPreparer getPreparer(String name, WebApplicationContext context)
Obtain a preparer instance for the given preparer name, based on the given Spring WebApplicationContext.
Methods inherited from class org.springframework.web.servlet.view.tiles2.AbstractSpringPreparerFactory
getPreparer
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleSpringPreparerFactory

public SimpleSpringPreparerFactory()
Method Detail

getPreparer

protected ViewPreparer getPreparer(String name,
                                   WebApplicationContext context)
                            throws TilesException
Description copied from class: AbstractSpringPreparerFactory
Obtain a preparer instance for the given preparer name, based on the given Spring WebApplicationContext.

Specified by:
getPreparer in class AbstractSpringPreparerFactory
Parameters:
name - the name of the preparer
context - the current Spring WebApplicationContext
Returns:
the preparer instance
Throws:
TilesException - in case of failure
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SpringBeanPreparerFactory

org.springframework.web.servlet.view.tiles2
Class SpringBeanPreparerFactory

java.lang.Object
    extended by  org.springframework.web.servlet.view.tiles2.AbstractSpringPreparerFactory
        extended by  org.springframework.web.servlet.view.tiles2.SpringBeanPreparerFactory
All Implemented Interfaces:
PreparerFactory
public class SpringBeanPreparerFactory
extends AbstractSpringPreparerFactory

Tiles2 PreparerFactory implementation that expects preparer bean names and obtains preparer beans from the Spring ApplicationContext. The full bean creation process will be in the control of the Spring application context in this case, allowing for the use of scoped beans etc.

Since:
2.5
Author:
Juergen Hoeller
See Also:
SimpleSpringPreparerFactory

Constructor Summary
SpringBeanPreparerFactory()
Method Summary
protected  ViewPreparer getPreparer(String name, WebApplicationContext context)
Obtain a preparer instance for the given preparer name, based on the given Spring WebApplicationContext.
Methods inherited from class org.springframework.web.servlet.view.tiles2.AbstractSpringPreparerFactory
getPreparer
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SpringBeanPreparerFactory

public SpringBeanPreparerFactory()
Method Detail

getPreparer

protected ViewPreparer getPreparer(String name,
                                   WebApplicationContext context)
                            throws TilesException
Description copied from class: AbstractSpringPreparerFactory
Obtain a preparer instance for the given preparer name, based on the given Spring WebApplicationContext.

Specified by:
getPreparer in class AbstractSpringPreparerFactory
Parameters:
name - the name of the preparer
context - the current Spring WebApplicationContext
Returns:
the preparer instance
Throws:
TilesException - in case of failure
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SpringLocaleResolver

org.springframework.web.servlet.view.tiles2
Class SpringLocaleResolver

java.lang.Object
    extended by  org.apache.tiles.locale.impl.DefaultLocaleResolver
        extended by  org.springframework.web.servlet.view.tiles2.SpringLocaleResolver
All Implemented Interfaces:
LocaleResolver
public class SpringLocaleResolver
extends DefaultLocaleResolver

Tiles LocaleResolver adapter that delegates to a Spring LocaleResolver, exposing the DispatcherServlet-managed locale.

This adapter gets automatically registered by TilesConfigurer. If you are using standard Tiles bootstrap, specify the name of this class as value for the init-param "org.apache.tiles.locale.LocaleResolver".

Since:
2.5
Author:
Juergen Hoeller
See Also:
DefinitionsFactory.LOCALE_RESOLVER_IMPL_PROPERTY

Field Summary
Fields inherited from class org.apache.tiles.locale.impl.DefaultLocaleResolver
LOCALE_KEY
Constructor Summary
SpringLocaleResolver()
Method Summary
 Locale resolveLocale(TilesRequestContext context)
Methods inherited from class org.apache.tiles.locale.impl.DefaultLocaleResolver
init
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SpringLocaleResolver

public SpringLocaleResolver()
Method Detail

resolveLocale

public Locale resolveLocale(TilesRequestContext context)
Specified by:
resolveLocale in interface LocaleResolver
Overrides:
resolveLocale in class DefaultLocaleResolver
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SpringTilesApplicationContextFactory

org.springframework.web.servlet.view.tiles2
Class SpringTilesApplicationContextFactory

java.lang.Object
    extended by  org.apache.tiles.context.AbstractTilesApplicationContextFactory
        extended by  org.springframework.web.servlet.view.tiles2.SpringTilesApplicationContextFactory
All Implemented Interfaces:
Initializable
public class SpringTilesApplicationContextFactory
extends AbstractTilesApplicationContextFactory
implements Initializable

Spring-specific subclass of the standard Tiles AbstractTilesApplicationContextFactory, passing given properties through as Tiles init-param map.

Since:
3.0
Author:
Juergen Hoeller
See Also:
TilesConfigurer.setTilesProperties(java.util.Properties)

Field Summary
Fields inherited from class org.apache.tiles.context.AbstractTilesApplicationContextFactory
APPLICATION_CONTEXT_FACTORY_INIT_PARAM
Constructor Summary
SpringTilesApplicationContextFactory()
Method Summary
TilesApplicationContext | createApplicationContext(Object context)
void | init(Map<String,String> params)
Methods inherited from class org.apache.tiles.context.AbstractTilesApplicationContextFactory
createFactory
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SpringTilesApplicationContextFactory

public SpringTilesApplicationContextFactory()
Method Detail

init

public void init(Map<String,String> params)
Specified by:
init in interface Initializable

createApplicationContext

public TilesApplicationContext createApplicationContext(Object context)
Specified by:
createApplicationContext in class AbstractTilesApplicationContextFactory
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TilesConfigurer

org.springframework.web.servlet.view.tiles2
Class TilesConfigurer

java.lang.Object
    extended by  org.springframework.web.servlet.view.tiles2.TilesConfigurer
All Implemented Interfaces:
DisposableBean, InitializingBean, ServletContextAware
public class TilesConfigurer
extends Object
implements ServletContextAware, InitializingBean, DisposableBean

Helper class to configure Tiles 2.x for the Spring Framework. See http://tiles.apache.org for more information about Tiles, which basically is a templating mechanism for JSP-based web applications. Note: Spring 3.0 requires Tiles 2.1.2 or above, with explicit support for Tiles 2.2. Tiles 2.1's EL support will be activated by default when running on JSP 2.1 or above and when the Tiles EL module is present in the classpath.

The TilesConfigurer simply configures a TilesContainer using a set of files containing definitions, to be accessed by TilesView instances. This is a Spring-based alternative (for usage in Spring configuration) to the Tiles-provided TilesListener (for usage in web.xml).

TilesViews can be managed by any ViewResolver. For simple convention-based view resolution, consider using TilesViewResolver.

A typical TilesConfigurer bean definition looks as follows:

 <bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
   <property name="definitions">
     <list>
       <value>/WEB-INF/defs/general.xml</value>
       <value>/WEB-INF/defs/widgets.xml</value>
       <value>/WEB-INF/defs/administrator.xml</value>
       <value>/WEB-INF/defs/customer.xml</value>
       <value>/WEB-INF/defs/templates.xml</value>
     </list>
   </property>
 </bean>
The values in the list are the actual Tiles XML files containing the definitions.

Since:
2.5
Author:
Juergen Hoeller
See Also:
TilesView, TilesViewResolver

Field Summary
protected  Log logger
Constructor Summary
TilesConfigurer()
Method Summary
void | afterPropertiesSet() Creates and exposes a TilesContainer for this web application, delegating to the TilesInitializer.
protected TilesInitializer | createTilesInitializer() Creates a new instance of BasicTilesInitializer.
void | destroy() Removes the TilesContainer from this web application.
void | setCompleteAutoload(boolean completeAutoload) Specify whether to apply Tiles 2.2's "complete-autoload" configuration.
void | setDefinitions(String[] definitions) Set the Tiles definitions, i.e.
void | setDefinitionsFactoryClass(Class<? extends DefinitionsFactory> definitionsFactoryClass) Set the DefinitionsFactory implementation to use.
void | setPreparerFactoryClass(Class<? extends PreparerFactory> preparerFactoryClass) Set the PreparerFactory implementation to use.
void | setServletContext(ServletContext servletContext) Set the ServletContext that this object runs in.
void | setTilesInitializer(TilesInitializer tilesInitializer) Configure Tiles using a custom TilesInitializer, typically specified as an inner bean.
void | setTilesProperties(Properties tilesProperties) Set Tiles properties (equivalent to the ServletContext init-params in the Tiles documentation), overriding the default settings.
void | setUseMutableTilesContainer(boolean useMutableTilesContainer) Set whether to use a MutableTilesContainer (typically the CachingTilesContainer implementation) for this application.
void | setValidateDefinitions(boolean validateDefinitions) Set whether to validate the Tiles XML definitions.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

logger

protected final Log logger
Constructor Detail

TilesConfigurer

public TilesConfigurer()
Method Detail

setTilesInitializer

public void setTilesInitializer(TilesInitializer tilesInitializer)
Configure Tiles using a custom TilesInitializer, typically specified as an inner bean.

Default is a variant of DefaultTilesInitializer, respecting the "definitions", "preparerFactoryClass" etc properties on this configurer.

NOTE: Specifying a custom TilesInitializer effectively disables all other bean properties on this configurer. The entire initialization procedure is then left to the TilesInitializer as specified.

setCompleteAutoload

public void setCompleteAutoload(boolean completeAutoload)
Specify whether to apply Tiles 2.2's "complete-autoload" configuration.

See CompleteAutoloadTilesContainerFactory for details on the complete-autoload mode.

NOTE: Specifying the complete-autoload mode effectively disables all other bean properties on this configurer. The entire initialization procedure is then left to CompleteAutoloadTilesInitializer.

See Also:
CompleteAutoloadTilesContainerFactory, CompleteAutoloadTilesInitializer

setDefinitions

public void setDefinitions(String[] definitions)
Set the Tiles definitions, i.e. the list of files containing the definitions. Default is "/WEB-INF/tiles.xml".

setValidateDefinitions

public void setValidateDefinitions(boolean validateDefinitions)
Set whether to validate the Tiles XML definitions. Default is "true".

setDefinitionsFactoryClass

public void setDefinitionsFactoryClass(Class<? extends DefinitionsFactory> definitionsFactoryClass)
Set the DefinitionsFactory implementation to use. Default is UrlDefinitionsFactory, operating on definition resource URLs.

Specify a custom DefinitionsFactory, e.g. a UrlDefinitionsFactory subclass, to customize the creation of Tiles Definition objects. Note that such a DefinitionsFactory has to be able to handle URL source objects, unless you configure a different TilesContainerFactory.

setPreparerFactoryClass

public void setPreparerFactoryClass(Class<? extends PreparerFactory> preparerFactoryClass)
Set the PreparerFactory implementation to use. Default is BasicPreparerFactory, creating shared instances for specified preparer classes.

Specify SimpleSpringPreparerFactory to autowire ViewPreparer instances based on specified preparer classes, applying Spring's container callbacks as well as applying configured Spring BeanPostProcessors. If Spring's context-wide annotation-config has been activated, annotations in ViewPreparer classes will be automatically detected and applied.

Specify SpringBeanPreparerFactory to operate on specified preparer names instead of classes, obtaining the corresponding Spring bean from the DispatcherServlet's application context. The full bean creation process will be in the control of the Spring application context in this case, allowing for the use of scoped beans etc. Note that you need to define one Spring bean definition per preparer name (as used in your Tiles definitions).

See Also:
SimpleSpringPreparerFactory, SpringBeanPreparerFactory

setUseMutableTilesContainer

public void setUseMutableTilesContainer(boolean useMutableTilesContainer)
Set whether to use a MutableTilesContainer (typically the CachingTilesContainer implementation) for this application. Default is "false".

See Also:
MutableTilesContainer, CachingTilesContainer

setTilesProperties

public void setTilesProperties(Properties tilesProperties)
Set Tiles properties (equivalent to the ServletContext init-params in the Tiles documentation), overriding the default settings.

NOTE: This property is only effective with Tiles 2.1. Tiles 2.2 doesn't support property-based configuration anymore.

setServletContext

public void setServletContext(ServletContext servletContext)
Description copied from interface: ServletContextAware
Set the ServletContext that this object runs in.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked after ApplicationContextAware's setApplicationContext.

Specified by:
setServletContext in interface ServletContextAware
Parameters:
servletContext - ServletContext object to be used by this object
See Also:
InitializingBean.afterPropertiesSet(), ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)

afterPropertiesSet

public void afterPropertiesSet()
                        throws TilesException
Creates and exposes a TilesContainer for this web application, delegating to the TilesInitializer.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
TilesException - in case of setup failure
See Also:
createTilesInitializer()

createTilesInitializer

protected TilesInitializer createTilesInitializer()
Creates a new instance of BasicTilesInitializer.

Override it to use a different initializer.

See Also:
TilesListener

destroy

public void destroy()
             throws TilesException
Removes the TilesContainer from this web application.

Specified by:
destroy in interface DisposableBean
Throws:
TilesException - in case of cleanup failure
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TilesView

org.springframework.web.servlet.view.tiles2
Class TilesView

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
                extended by  org.springframework.web.servlet.view.AbstractUrlBasedView
                    extended by  org.springframework.web.servlet.view.tiles2.TilesView
All Implemented Interfaces:
BeanNameAware, InitializingBean, ApplicationContextAware, ServletContextAware, View
public class TilesView
extends AbstractUrlBasedView

View implementation that retrieves a Tiles definition. The "url" property is interpreted as name of a Tiles definition.

This class builds on Tiles2, which requires JSP 2.0. JSTL support is integrated out of the box due to JSTL's inclusion in JSP 2.0. Note: Spring 3.0 requires Tiles 2.1.2 or above.

Depends on a TilesContainer which must be available in the ServletContext. This container is typically set up via a TilesConfigurer bean definition in the application context.

Since:
2.5
Author:
Juergen Hoeller
See Also:
AbstractUrlBasedView.setUrl(java.lang.String), TilesConfigurer

Field Summary
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
TilesView()
Method Summary
boolean | checkResource(Locale locale) Check whether the underlying resource that the configured URL points to actually exists.
protected void | initServletContext(ServletContext sc) Checks whether we need to explicitly expose the Servlet 2.4 request attributes by default.
protected void | renderMergedOutputModel(Map<String,Object> model, HttpServletRequest request, HttpServletResponse response) Subclasses must implement this method to actually render the view.
Methods inherited from class org.springframework.web.servlet.view.AbstractUrlBasedView
afterPropertiesSet, getUrl, isUrlRequired, setUrl, toString
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

TilesView

public TilesView()
Method Detail

initServletContext

protected void initServletContext(ServletContext sc)
Checks whether we need to explicitly expose the Servlet 2.4 request attributes by default.

This will be done by default on Servlet containers up until 2.4, and skipped for Servlet 2.5 and above. Note that Servlet containers at 2.4 level and above should expose those attributes automatically! This feature exists for Servlet 2.3 containers and misbehaving 2.4 containers only.

Overrides:
initServletContext in class WebApplicationObjectSupport
Parameters:
sc - the ServletContext that this application object runs in (never null)

checkResource

public boolean checkResource(Locale locale)
                      throws Exception
Description copied from class: AbstractUrlBasedView
Check whether the underlying resource that the configured URL points to actually exists.

Overrides:
checkResource in class AbstractUrlBasedView
Parameters:
locale - the desired Locale that we're looking for
Returns:
true if the resource exists (or is assumed to exist); false if we know that it does not exist
Throws:
Exception - if the resource exists but is invalid (e.g. could not be parsed)

renderMergedOutputModel

protected void renderMergedOutputModel(Map<String,Object> model,
                                       HttpServletRequest request,
                                       HttpServletResponse response)
                                throws Exception
Description copied from class: AbstractView
Subclasses must implement this method to actually render the view.

The first step will be preparing the request: In the JSP case, this would mean setting model objects as request attributes. The second step will be the actual rendering of the view, for example including the JSP via a RequestDispatcher.

Specified by:
renderMergedOutputModel in class AbstractView
Parameters:
model - combined output Map (never null), with dynamic values taking precedence over static attributes
request - current HTTP request
response - current HTTP response
Throws:
Exception - if rendering failed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TilesViewResolver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.view.tiles2
Class TilesViewResolver

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractCachingViewResolver
                extended by  org.springframework.web.servlet.view.UrlBasedViewResolver
                    extended by  org.springframework.web.servlet.view.tiles2.TilesViewResolver
All Implemented Interfaces:
ApplicationContextAware, Ordered, ServletContextAware, ViewResolver
public class TilesViewResolver
extends UrlBasedViewResolver

Convenience subclass of UrlBasedViewResolver that supports TilesView (i.e. Tiles definitions) and custom subclasses of it.

The view class for all views generated by this resolver can be specified via the "viewClass" property. See UrlBasedViewResolver's javadoc for details.

Note: When chaining ViewResolvers, a TilesViewResolver will check for the existence of the specified template resources and only return a non-null View object if the template was actually found.

Since:
3.0
Author:
Juergen Hoeller
See Also:
UrlBasedViewResolver.setViewClass(java.lang.Class),
UrlBasedViewResolver.setPrefix(java.lang.String),
UrlBasedViewResolver.setSuffix(java.lang.String),
UrlBasedViewResolver.setRequestContextAttribute(java.lang.String),
TilesView

Field Summary
Fields inherited from class org.springframework.web.servlet.view.UrlBasedViewResolver
FORWARD_URL_PREFIX, REDIRECT_URL_PREFIX
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
TilesViewResolver()
Method Summary
protected  Class requiredViewClass()
Requires TilesView.
Methods inherited from class org.springframework.web.servlet.view.UrlBasedViewResolver
buildView, canHandle, createView, getAttributesMap, getCacheKey, getContentType, getOrder, getPrefix, getRequestContextAttribute, getSuffix, getViewClass, getViewNames, initApplicationContext, isRedirectContextRelative, isRedirectHttp10Compatible, loadView, setAttributes, setAttributesMap, setContentType, setOrder, setPrefix, setRedirectContextRelative, setRedirectHttp10Compatible, setRequestContextAttribute, setSuffix, setViewClass, setViewNames
Methods inherited from class org.springframework.web.servlet.view.AbstractCachingViewResolver
clearCache, isCache, removeFromCache, resolveViewName, setCache
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TilesViewResolver

public TilesViewResolver()
Method Detail

requiredViewClass

protected Class requiredViewClass()
Requires TilesView.

Overrides:
requiredViewClass in class UrlBasedViewResolver
See Also:
AbstractUrlBasedView
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.servlet.view.velocity

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.servlet.view.velocity

Support classes for the integration of Velocity as Spring web view technology.

See:
Description

Interface Summary
VelocityConfig Interface to be implemented by objects that configure and manage a VelocityEngine for automatic lookup in a web environment.

Class Summary
VelocityConfigurer | JavaBean to configure Velocity for web usage, via the "configLocation" and/or "velocityProperties" and/or "resourceLoaderPath" bean properties.
VelocityLayoutView | VelocityLayoutView emulates the functionality offered by Velocity's VelocityLayoutServlet to ease page composition from different templates.
VelocityLayoutViewResolver | Convenience subclass of VelocityViewResolver, adding support for VelocityLayoutView and its properties.
VelocityToolboxView | VelocityView subclass which adds support for Velocity Tools toolboxes and Velocity Tools ViewTool callbacks / Velocity Tools 1.3 init methods.
VelocityView | View using the Velocity template engine.
VelocityViewResolver | Convenience subclass of UrlBasedViewResolver that supports VelocityView (i.e.

Package org.springframework.web.servlet.view.velocity Description

Support classes for the integration of Velocity as Spring web view technology. Contains a View implementation for Velocity templates.


org.springframework.web.servlet.view.velocity Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.servlet.view.velocity

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.context.support.ApplicationObjectSupport (implements org.springframework.context.ApplicationContextAware)
      • org.springframework.web.context.support.WebApplicationObjectSupport (implements org.springframework.web.context.ServletContextAware)
        • org.springframework.web.servlet.view.AbstractCachingViewResolver (implements org.springframework.web.servlet.ViewResolver)
          • org.springframework.web.servlet.view.UrlBasedViewResolver (implements org.springframework.core.Ordered)
            • org.springframework.web.servlet.view.AbstractTemplateViewResolver
              • org.springframework.web.servlet.view.velocity.VelocityViewResolver
                • org.springframework.web.servlet.view.velocity.VelocityLayoutViewResolver
        • org.springframework.web.servlet.view.AbstractView (implements org.springframework.beans.factory.BeanNameAware, org.springframework.web.servlet.View)
          • org.springframework.web.servlet.view.AbstractUrlBasedView (implements org.springframework.beans.factory.InitializingBean)
            • org.springframework.web.servlet.view.AbstractTemplateView
              • org.springframework.web.servlet.view.velocity.VelocityView
                • org.springframework.web.servlet.view.velocity.VelocityToolboxView
                  • org.springframework.web.servlet.view.velocity.VelocityLayoutView
    • org.springframework.ui.velocity.VelocityEngineFactory
      • org.springframework.web.servlet.view.velocity.VelocityConfigurer (implements org.springframework.beans.factory.InitializingBean, org.springframework.context.ResourceLoaderAware, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.view.velocity.VelocityConfig)

Interface Hierarchy

  • org.springframework.web.servlet.view.velocity.VelocityConfig


VelocityConfig

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.view.velocity
Interface VelocityConfig

All Known Implementing Classes:
VelocityConfigurer
public interface VelocityConfig

Interface to be implemented by objects that configure and manage a VelocityEngine for automatic lookup in a web environment. Detected and used by VelocityView.

Author:
Rod Johnson
See Also:
VelocityConfigurer, VelocityView

Method Summary
 VelocityEngine getVelocityEngine()
Return the VelocityEngine for the current web application context.

Method Detail

getVelocityEngine

VelocityEngine getVelocityEngine()
Return the VelocityEngine for the current web application context. May be unique to one servlet, or shared in the root context.

Returns:
the VelocityEngine
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


VelocityConfigurer

org.springframework.web.servlet.view.velocity
Class VelocityConfigurer

java.lang.Object
    extended by  org.springframework.ui.velocity.VelocityEngineFactory
        extended by  org.springframework.web.servlet.view.velocity.VelocityConfigurer
All Implemented Interfaces:
InitializingBean, ResourceLoaderAware, ServletContextAware, VelocityConfig
public class VelocityConfigurer
extends VelocityEngineFactory
implements VelocityConfig, InitializingBean, ResourceLoaderAware, ServletContextAware

JavaBean to configure Velocity for web usage, via the "configLocation" and/or "velocityProperties" and/or "resourceLoaderPath" bean properties. The simplest way to use this class is to specify just a "resourceLoaderPath"; you do not need any further configuration then.

 <bean id="velocityConfig" class="org.springframework.web.servlet.view.velocity.VelocityConfigurer">
   <property name="resourceLoaderPath"><value>/WEB-INF/velocity/</value></property>
 </bean>
This bean must be included in the application context of any application using Spring's VelocityView for web MVC. It exists purely to configure Velocity; it is not meant to be referenced by application components (just internally by VelocityView). This class implements VelocityConfig in order to be found by VelocityView without depending on the bean name of this configurer. Each DispatcherServlet may define its own VelocityConfigurer if desired, potentially with different template loader paths.

Note that you can also refer to a pre-configured VelocityEngine instance via the "velocityEngine" property, e.g. set up by VelocityEngineFactoryBean, This allows to share a VelocityEngine for web and email usage, for example.

This configurer registers the "spring.vm" Velocimacro library for web views (contained in this package and thus in spring.jar), which makes all of Spring's default Velocity macros available to the views. This allows for using the Spring-provided macros such as follows:

 #springBind("person.age")
 age is ${status.value}

Author:
Rod Johnson, Juergen Hoeller, Darren Davison
See Also:
VelocityEngineFactory.setConfigLocation(org.springframework.core.io.Resource),
VelocityEngineFactory.setVelocityProperties(java.util.Properties),
VelocityEngineFactory.setResourceLoaderPath(java.lang.String),
setVelocityEngine(org.apache.velocity.app.VelocityEngine),
VelocityView

Field Summary
Fields inherited from class org.springframework.ui.velocity.VelocityEngineFactory
logger
Constructor Summary
VelocityConfigurer()
Method Summary
void | afterPropertiesSet() Initialize VelocityEngineFactory's VelocityEngine if not overridden by a pre-configured VelocityEngine.
VelocityEngine | getVelocityEngine() Return the VelocityEngine for the current web application context.
protected void | postProcessVelocityEngine(VelocityEngine velocityEngine) Provides a ClasspathResourceLoader in addition to any default or user-defined loader in order to load the spring Velocity macros from the class path.
void | setServletContext(ServletContext servletContext) Set the ServletContext that this object runs in.
void | setVelocityEngine(VelocityEngine velocityEngine) Set a pre-configured VelocityEngine to use for the Velocity web configuration: e.g.
Methods inherited from class org.springframework.ui.velocity.VelocityEngineFactory
createVelocityEngine, getResourceLoader, initSpringResourceLoader, initVelocityResourceLoader, isPreferFileSystemAccess, newVelocityEngine, setConfigLocation, setOverrideLogging, setPreferFileSystemAccess, setResourceLoader, setResourceLoaderPath, setVelocityProperties, setVelocityPropertiesMap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.context.ResourceLoaderAware
setResourceLoader

Constructor Detail

VelocityConfigurer

public VelocityConfigurer()
Method Detail

setVelocityEngine

public void setVelocityEngine(VelocityEngine velocityEngine)
Set a pre-configured VelocityEngine to use for the Velocity web configuration: e.g. a shared one for web and email usage, set up via VelocityEngineFactoryBean.

Note that the Spring macros will not be enabled automatically in case of an external VelocityEngine passed in here. Make sure to include spring.vm in your template loader path in such a scenario (if there is an actual need to use those macros).

If this is not set, VelocityEngineFactory's properties (inherited by this class) have to be specified.

setServletContext

public void setServletContext(ServletContext servletContext)
Description copied from interface: ServletContextAware
Set the ServletContext that this object runs in.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked after ApplicationContextAware's setApplicationContext.

Specified by:
setServletContext in interface ServletContextAware
Parameters:
servletContext - ServletContext object to be used by this object
See Also:
InitializingBean.afterPropertiesSet(), ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)

afterPropertiesSet

public void afterPropertiesSet()
                        throws IOException,
                               VelocityException
Initialize VelocityEngineFactory's VelocityEngine if not overridden by a pre-configured VelocityEngine.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
IOException
VelocityException
See Also:
VelocityEngineFactory.createVelocityEngine(), setVelocityEngine(org.apache.velocity.app.VelocityEngine)

postProcessVelocityEngine

protected void postProcessVelocityEngine(VelocityEngine velocityEngine)
Provides a ClasspathResourceLoader in addition to any default or user-defined loader in order to load the spring Velocity macros from the class path.

Overrides:
postProcessVelocityEngine in class VelocityEngineFactory
Parameters:
velocityEngine - the current VelocityEngine
See Also:
ClasspathResourceLoader

getVelocityEngine

public VelocityEngine getVelocityEngine()
Description copied from interface: VelocityConfig
Return the VelocityEngine for the current web application context. May be unique to one servlet, or shared in the root context.

Specified by:
getVelocityEngine in interface VelocityConfig
Returns:
the VelocityEngine
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


VelocityLayoutView

org.springframework.web.servlet.view.velocity
Class VelocityLayoutView

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
                extended by  org.springframework.web.servlet.view.AbstractUrlBasedView
                    extended by  org.springframework.web.servlet.view.AbstractTemplateView
                        extended by  org.springframework.web.servlet.view.velocity.VelocityView
                            extended by  org.springframework.web.servlet.view.velocity.VelocityToolboxView
                                extended by  org.springframework.web.servlet.view.velocity.VelocityLayoutView
All Implemented Interfaces:
BeanNameAware, InitializingBean, ApplicationContextAware, ServletContextAware, View
public class VelocityLayoutView
extends VelocityToolboxView

VelocityLayoutView emulates the functionality offered by Velocity's VelocityLayoutServlet to ease page composition from different templates.

The url property should be set to the content template for the view, and the layout template location should be specified as layoutUrl property. A view can override the configured layout template location by setting the appropriate key (the default is "layout") in the content template.

When the view is rendered, the VelocityContext is first merged with the content template (specified by the url property) and then merged with the layout template to produce the final output.

The layout template can include the screen content through a VelocityContext variable (the default is "screen_content"). At runtime, this variable will contain the rendered content template.

Since:
1.2
Author:
Darren Davison, Juergen Hoeller
See Also:
setLayoutUrl(java.lang.String),
setLayoutKey(java.lang.String),
setScreenContentKey(java.lang.String)

Field Summary
static String | DEFAULT_LAYOUT_KEY The default layout key.
static String | DEFAULT_LAYOUT_URL The default layout url.
static String | DEFAULT_SCREEN_CONTENT_KEY The default screen content key.
Fields inherited from class org.springframework.web.servlet.view.AbstractTemplateView
SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
VelocityLayoutView()
Method Summary
boolean | checkResource(Locale locale) Overrides VelocityView.checkTemplate() to additionally check that both the layout template and the screen content template can be loaded.
protected void | doRender(Context context, HttpServletResponse response) Overrides the normal rendering process in order to pre-process the Context, merging it with the screen template into a single value (identified by the value of screenContentKey).
void | setLayoutKey(String layoutKey) Set the context key used to specify an alternate layout to be used instead of the default layout.
void | setLayoutUrl(String layoutUrl) Set the layout template to use.
void | setScreenContentKey(String screenContentKey) Set the name of the context key that will hold the content of the screen within the layout template.
Methods inherited from class org.springframework.web.servlet.view.velocity.VelocityToolboxView
createVelocityContext, getToolboxConfigLocation, initTool, setToolboxConfigLocation
Methods inherited from class org.springframework.web.servlet.view.velocity.VelocityView
autodetectVelocityEngine, createVelocityContext, exposeHelpers, exposeHelpers, exposeHelpers, exposeToolAttributes, getEncoding, getTemplate, getTemplate, getVelocityEngine, initApplicationContext, isCacheTemplate, mergeTemplate, renderMergedTemplateModel, setCacheTemplate, setDateToolAttribute, setEncoding, setNumberToolAttribute, setToolAttributes, setVelocityEngine
Methods inherited from class org.springframework.web.servlet.view.AbstractTemplateView
applyContentType, renderMergedOutputModel, setAllowRequestOverride, setAllowSessionOverride, setExposeRequestAttributes, setExposeSessionAttributes, setExposeSpringMacroHelpers
Methods inherited from class org.springframework.web.servlet.view.AbstractUrlBasedView
afterPropertiesSet, getUrl, isUrlRequired, setUrl, toString
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

DEFAULT_LAYOUT_URL

public static final String DEFAULT_LAYOUT_URL
The default layout url.

See Also:
Constant Field Values

DEFAULT_LAYOUT_KEY

public static final String DEFAULT_LAYOUT_KEY
The default layout key.

See Also:
Constant Field Values

DEFAULT_SCREEN_CONTENT_KEY

public static final String DEFAULT_SCREEN_CONTENT_KEY
The default screen content key.

See Also:
Constant Field Values
Constructor Detail

VelocityLayoutView

public VelocityLayoutView()
Method Detail

setLayoutUrl

public void setLayoutUrl(String layoutUrl)
Set the layout template to use. Default is "layout.vm".

Parameters:
layoutUrl - the template location (relative to the template root directory)

setLayoutKey

public void setLayoutKey(String layoutKey)
Set the context key used to specify an alternate layout to be used instead of the default layout. Screen content templates can override the layout template that they wish to be wrapped with by setting this value in the template, for example:
#set( $layout = "MyLayout.vm" )

Default key is "layout", as illustrated above.

Parameters:
layoutKey - the name of the key you wish to use in your screen content templates to override the layout template

setScreenContentKey

public void setScreenContentKey(String screenContentKey)
Set the name of the context key that will hold the content of the screen within the layout template. This key must be present in the layout template for the current screen to be rendered.

Default is "screen_content": accessed in VTL as $screen_content.

Parameters:
screenContentKey - the name of the screen content key to use

checkResource

public boolean checkResource(Locale locale)
                      throws Exception
Overrides VelocityView.checkTemplate() to additionally check that both the layout template and the screen content template can be loaded. Note that during rendering of the screen content, the layout template can be changed which may invalidate any early checking done here.

Overrides:
checkResource in class VelocityView
Parameters:
locale - the desired Locale that we're looking for
Returns:
true if the resource exists (or is assumed to exist); false if we know that it does not exist
Throws:
Exception - if the resource exists but is invalid (e.g. could not be parsed)

doRender

protected void doRender(Context context,
                        HttpServletResponse response)
                 throws Exception
Overrides the normal rendering process in order to pre-process the Context, merging it with the screen template into a single value (identified by the value of screenContentKey). The layout template is then merged with the modified Context in the super class.

Overrides:
doRender in class VelocityView
Parameters:
context - the Velocity context to use for rendering
response - servlet response (use this to get the OutputStream or Writer)
Throws:
Exception - if thrown by Velocity
See Also:
AbstractUrlBasedView.setUrl(java.lang.String),
VelocityView.getTemplate(),
VelocityView.mergeTemplate(org.apache.velocity.Template, org.apache.velocity.context.Context, javax.servlet.http.HttpServletResponse)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


VelocityLayoutViewResolver

org.springframework.web.servlet.view.velocity
Class VelocityLayoutViewResolver

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractCachingViewResolver
                extended by  org.springframework.web.servlet.view.UrlBasedViewResolver
                    extended by  org.springframework.web.servlet.view.AbstractTemplateViewResolver
                        extended by  org.springframework.web.servlet.view.velocity.VelocityViewResolver
                            extended by  org.springframework.web.servlet.view.velocity.VelocityLayoutViewResolver
All Implemented Interfaces:
ApplicationContextAware, Ordered, ServletContextAware, ViewResolver
public class VelocityLayoutViewResolver
extends VelocityViewResolver

Convenience subclass of VelocityViewResolver, adding support for VelocityLayoutView and its properties.

See VelocityViewResolver's javadoc for general usage info.

Since:
1.2.7
Author:
Juergen Hoeller
See Also:
VelocityViewResolver,
VelocityLayoutView,
setLayoutUrl(java.lang.String),
setLayoutKey(java.lang.String),
setScreenContentKey(java.lang.String)

Field Summary
Fields inherited from class org.springframework.web.servlet.view.UrlBasedViewResolver
FORWARD_URL_PREFIX, REDIRECT_URL_PREFIX
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
VelocityLayoutViewResolver()
Method Summary
protected AbstractUrlBasedView | buildView(String viewName) Creates a new View instance of the specified view class and configures it.
protected Class | requiredViewClass() Requires VelocityLayoutView.
void | setLayoutKey(String layoutKey) Set the context key used to specify an alternate layout to be used instead of the default layout.
void | setLayoutUrl(String layoutUrl) Set the layout template to use.
void | setScreenContentKey(String screenContentKey) Set the name of the context key that will hold the content of the screen within the layout template.
Methods inherited from class org.springframework.web.servlet.view.velocity.VelocityViewResolver
initApplicationContext, setDateToolAttribute, setNumberToolAttribute, setToolboxConfigLocation
Methods inherited from class org.springframework.web.servlet.view.AbstractTemplateViewResolver
setAllowRequestOverride, setAllowSessionOverride, setExposeRequestAttributes, setExposeSessionAttributes, setExposeSpringMacroHelpers
Methods inherited from class org.springframework.web.servlet.view.UrlBasedViewResolver
canHandle, createView, getAttributesMap, getCacheKey, getContentType, getOrder, getPrefix, getRequestContextAttribute, getSuffix, getViewClass, getViewNames, isRedirectContextRelative, isRedirectHttp10Compatible, loadView, setAttributes, setAttributesMap, setContentType, setOrder, setPrefix, setRedirectContextRelative, setRedirectHttp10Compatible, setRequestContextAttribute, setSuffix, setViewClass, setViewNames
Methods inherited from class org.springframework.web.servlet.view.AbstractCachingViewResolver
clearCache, isCache, removeFromCache, resolveViewName, setCache
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

VelocityLayoutViewResolver

public VelocityLayoutViewResolver()
Method Detail

requiredViewClass

protected Class requiredViewClass()
Requires VelocityLayoutView.

Overrides:
requiredViewClass in class VelocityViewResolver
See Also:
VelocityLayoutView

setLayoutUrl

public void setLayoutUrl(String layoutUrl)
Set the layout template to use. Default is "layout.vm".

Parameters:
layoutUrl - the template location (relative to the template root directory)
See Also:
VelocityLayoutView.setLayoutUrl(java.lang.String)

setLayoutKey

public void setLayoutKey(String layoutKey)
Set the context key used to specify an alternate layout to be used instead of the default layout. Screen content templates can override the layout template that they wish to be wrapped with by setting this value in the template, for example:
#set( $layout = "MyLayout.vm" )

The default key is "layout", as illustrated above.

Parameters:
layoutKey - the name of the key you wish to use in your screen content templates to override the layout template
See Also:
VelocityLayoutView.setLayoutKey(java.lang.String)

setScreenContentKey

public void setScreenContentKey(String screenContentKey)
Set the name of the context key that will hold the content of the screen within the layout template. This key must be present in the layout template for the current screen to be rendered.

Default is "screen_content": accessed in VTL as $screen_content.

Parameters:
screenContentKey - the name of the screen content key to use
See Also:
VelocityLayoutView.setScreenContentKey(java.lang.String)

buildView

protected AbstractUrlBasedView buildView(String viewName)
                                  throws Exception
Description copied from class: UrlBasedViewResolver
Creates a new View instance of the specified view class and configures it. Does not perform any lookup for pre-defined View instances.

Spring lifecycle methods as defined by the bean container do not have to be called here; those will be applied by the loadView method after this method returns.

Subclasses will typically call super.buildView(viewName) first, before setting further properties themselves. loadView will then apply Spring lifecycle methods at the end of this process.

Overrides:
buildView in class VelocityViewResolver
Parameters:
viewName - the name of the view to build
Returns:
the View instance
Throws:
Exception - if the view couldn't be resolved
See Also:
UrlBasedViewResolver.loadView(String, java.util.Locale)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


VelocityToolboxView

org.springframework.web.servlet.view.velocity
Class VelocityToolboxView

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
                extended by  org.springframework.web.servlet.view.AbstractUrlBasedView
                    extended by  org.springframework.web.servlet.view.AbstractTemplateView
                        extended by  org.springframework.web.servlet.view.velocity.VelocityView
                            extended by  org.springframework.web.servlet.view.velocity.VelocityToolboxView
All Implemented Interfaces:
BeanNameAware, InitializingBean, ApplicationContextAware, ServletContextAware, View
Direct Known Subclasses:
VelocityLayoutView
public class VelocityToolboxView
extends VelocityView

VelocityView subclass which adds support for Velocity Tools toolboxes and Velocity Tools ViewTool callbacks / Velocity Tools 1.3 init methods.

Specify a "toolboxConfigLocation", for example "/WEB-INF/toolbox.xml", to automatically load a Velocity Tools toolbox definition file and expose all defined tools in the specified scopes. If no config location is specified, no toolbox will be loaded and exposed.

This view will always create a special Velocity context, namely an instance of the ChainedContext class which is part of the view package of Velocity tools. This allows to use tools from the view package of Velocity Tools, like LinkTool, which need to be initialized with a special context that implements the ViewContext interface (i.e. a ChainedContext).

This view also checks tools that are specified as "toolAttributes": If they implement the ViewTool interface, they will get initialized with the Velocity context. This allows tools from the view package of Velocity Tools, such as LinkTool, to be defined as "toolAttributes" on a VelocityToolboxView, instead of in a separate toolbox XML file.

This is a separate class mainly to avoid a required dependency on the view package of Velocity Tools in VelocityView itself. As of Spring 3.0, this class requires Velocity Tools 1.3 or higher.

Since:
1.1.3
Author:
Juergen Hoeller
See Also:
setToolboxConfigLocation(java.lang.String), initTool(java.lang.Object, org.apache.velocity.context.Context), ViewContext, ChainedContext

Field Summary
Fields inherited from class org.springframework.web.servlet.view.AbstractTemplateView
SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
VelocityToolboxView()
Method Summary
protected Context | createVelocityContext(Map<String,Object> model, HttpServletRequest request, HttpServletResponse response) Overridden to create a ChainedContext, which is part of the view package of Velocity Tools, as special context.
protected String | getToolboxConfigLocation() Return the Velocity Toolbox config location, if any.
protected void | initTool(Object tool, Context velocityContext) Overridden to check for the ViewContext interface which is part of the view package of Velocity Tools.
void | setToolboxConfigLocation(String toolboxConfigLocation) Set a Velocity Toolbox config location, for example "/WEB-INF/toolbox.xml", to automatically load a Velocity Tools toolbox definition file and expose all defined tools in the specified scopes.
Methods inherited from class org.springframework.web.servlet.view.velocity.VelocityView
autodetectVelocityEngine, checkResource, createVelocityContext, doRender, exposeHelpers, exposeHelpers, exposeHelpers, exposeToolAttributes, getEncoding, getTemplate, getTemplate, getVelocityEngine, initApplicationContext, isCacheTemplate, mergeTemplate, renderMergedTemplateModel, setCacheTemplate, setDateToolAttribute, setEncoding, setNumberToolAttribute, setToolAttributes, setVelocityEngine
Methods inherited from class org.springframework.web.servlet.view.AbstractTemplateView
applyContentType, renderMergedOutputModel, setAllowRequestOverride, setAllowSessionOverride, setExposeRequestAttributes, setExposeSessionAttributes, setExposeSpringMacroHelpers
Methods inherited from class org.springframework.web.servlet.view.AbstractUrlBasedView
afterPropertiesSet, getUrl, isUrlRequired, setUrl, toString
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

VelocityToolboxView

public VelocityToolboxView()
Method Detail

setToolboxConfigLocation

public void setToolboxConfigLocation(String toolboxConfigLocation)
Set a Velocity Toolbox config location, for example "/WEB-INF/toolbox.xml", to automatically load a Velocity Tools toolbox definition file and expose all defined tools in the specified scopes. If no config location is specified, no toolbox will be loaded and exposed.

The specfied location string needs to refer to a ServletContext resource, as expected by ServletToolboxManager which is part of the view package of Velocity Tools.

See Also:
ServletToolboxManager.getInstance(javax.servlet.ServletContext, java.lang.String)

getToolboxConfigLocation

protected String getToolboxConfigLocation()
Return the Velocity Toolbox config location, if any.

createVelocityContext

protected Context createVelocityContext(Map<String,Object> model,
                                        HttpServletRequest request,
                                        HttpServletResponse response)
                                 throws Exception
Overridden to create a ChainedContext, which is part of the view package of Velocity Tools, as special context. ChainedContext is needed for initialization of ViewTool instances.

Overrides:
createVelocityContext in class VelocityView
Parameters:
model - the model Map, containing the model attributes to be exposed to the view
request - current HTTP request
response - current HTTP response
Returns:
the Velocity Context
Throws:
Exception - if there's a fatal error while creating the context
See Also:
initTool(java.lang.Object, org.apache.velocity.context.Context)

initTool

protected void initTool(Object tool,
                        Context velocityContext)
                 throws Exception
Overridden to check for the ViewContext interface which is part of the view package of Velocity Tools. This requires a special Velocity context, like ChainedContext as set up by createVelocityContext(java.util.Map, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) in this class.

Overrides:
initTool in class VelocityView
Parameters:
tool - the tool instance to initialize
velocityContext - the Velocity context
Throws:
Exception - if initializion of the tool failed
See Also:
VelocityView.createVelocityContext(java.util.Map, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), ViewContext, ChainedContext, VelocityToolboxView
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


VelocityView

org.springframework.web.servlet.view.velocity
Class VelocityView

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
                extended by  org.springframework.web.servlet.view.AbstractUrlBasedView
                    extended by  org.springframework.web.servlet.view.AbstractTemplateView
                        extended by  org.springframework.web.servlet.view.velocity.VelocityView
All Implemented Interfaces:
BeanNameAware, InitializingBean, ApplicationContextAware, ServletContextAware, View
Direct Known Subclasses:
VelocityToolboxView
public class VelocityView
extends AbstractTemplateView

View using the Velocity template engine.

Exposes the following JavaBean properties:

  • url: the location of the Velocity template to be wrapped, relative to the Velocity resource loader path (see VelocityConfigurer).
  • encoding (optional, default is determined by Velocity configuration): the encoding of the Velocity template file
  • velocityFormatterAttribute (optional, default=null): the name of the VelocityFormatter helper object to expose in the Velocity context of this view, or null if not needed. VelocityFormatter is part of standard Velocity.
  • dateToolAttribute (optional, default=null): the name of the DateTool helper object to expose in the Velocity context of this view, or null if not needed. DateTool is part of Velocity Tools.
  • numberToolAttribute (optional, default=null): the name of the NumberTool helper object to expose in the Velocity context of this view, or null if not needed. NumberTool is part of Velocity Tools.
  • cacheTemplate (optional, default=false): whether or not the Velocity template should be cached. It should normally be true in production, but setting this to false enables us to modify Velocity templates without restarting the application (similar to JSPs). Note that this is a minor optimization only, as Velocity itself caches templates in a modification-aware fashion.

Depends on a VelocityConfig object such as VelocityConfigurer being accessible in the current web application context, with any bean name. Alternatively, you can set the VelocityEngine object as bean property.

Note: Spring 3.0's VelocityView requires Velocity 1.4 or higher, and optionally Velocity Tools 1.1 or higher (depending on the use of DateTool and/or NumberTool).

Author:
Rod Johnson, Juergen Hoeller, Dave Syer
See Also:
VelocityConfig, VelocityConfigurer, AbstractUrlBasedView.setUrl(java.lang.String), AbstractTemplateView.setExposeSpringMacroHelpers(boolean), setEncoding(java.lang.String), setVelocityEngine(org.apache.velocity.app.VelocityEngine), VelocityConfig, VelocityConfigurer

Field Summary
Fields inherited from class org.springframework.web.servlet.view.AbstractTemplateView
SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
VelocityView()
Method Summary
protected VelocityEngine | autodetectVelocityEngine() Autodetect a VelocityEngine via the ApplicationContext.
boolean | checkResource(Locale locale) Check that the Velocity template used for this view exists and is valid.
protected Context | createVelocityContext(Map<String,Object> model) Create a Velocity Context instance for the given model, to be passed to the template for merging.
protected Context | createVelocityContext(Map<String,Object> model, HttpServletRequest request, HttpServletResponse response) Create a Velocity Context instance for the given model, to be passed to the template for merging.
protected void | doRender(Context context, HttpServletResponse response) Render the Velocity view to the given response, using the given Velocity context which contains the complete template model to use.
protected void | exposeHelpers(Context velocityContext, HttpServletRequest request) Expose helpers unique to each rendering operation.
protected void | exposeHelpers(Context velocityContext, HttpServletRequest request, HttpServletResponse response) Expose helpers unique to each rendering operation.
protected void | exposeHelpers(Map<String,Object> model, HttpServletRequest request) Expose helpers unique to each rendering operation.
protected void | exposeToolAttributes(Context velocityContext, HttpServletRequest request) Expose the tool attributes, according to corresponding bean property settings.
protected String | getEncoding() Return the encoding for the Velocity template.
protected Template | getTemplate() Retrieve the Velocity template to be rendered by this view.
protected Template | getTemplate(String name) Retrieve the Velocity template specified by the given name, using the encoding specified by the "encoding" bean property.
protected VelocityEngine | getVelocityEngine() Return the VelocityEngine used by this view.
protected void | initApplicationContext() Invoked on startup.
protected void | initTool(Object tool, Context velocityContext) Initialize the given tool instance.
protected boolean | isCacheTemplate() Return whether the Velocity template should be cached.
protected void | mergeTemplate(Template template, Context context, HttpServletResponse response) Merge the template with the context.
protected void | renderMergedTemplateModel(Map<String,Object> model, HttpServletRequest request, HttpServletResponse response) Process the model map by merging it with the Velocity template.
void | setCacheTemplate(boolean cacheTemplate) Set whether the Velocity template should be cached.
void | setDateToolAttribute(String dateToolAttribute) Set the name of the DateTool helper object to expose in the Velocity context of this view, or null if not needed.
void | setEncoding(String encoding) Set the encoding of the Velocity template file.
void | setNumberToolAttribute(String numberToolAttribute) Set the name of the NumberTool helper object to expose in the Velocity context of this view, or null if not needed.
void | setToolAttributes(Map<String,Class> toolAttributes) Set tool attributes to expose to the view, as attribute name / class name pairs.
void | setVelocityEngine(VelocityEngine velocityEngine) Set the VelocityEngine to be used by this view.
Methods inherited from class org.springframework.web.servlet.view.AbstractTemplateView
applyContentType, renderMergedOutputModel, setAllowRequestOverride, setAllowSessionOverride, setExposeRequestAttributes, setExposeSessionAttributes, setExposeSpringMacroHelpers
Methods inherited from class org.springframework.web.servlet.view.AbstractUrlBasedView
afterPropertiesSet, getUrl, isUrlRequired, setUrl, toString
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

VelocityView

public VelocityView()
Method Detail

setToolAttributes

public void setToolAttributes(Map<String,Class> toolAttributes)
Set tool attributes to expose to the view, as attribute name / class name pairs. An instance of the given class will be added to the Velocity context for each rendering operation, under the given attribute name.

For example, an instance of MathTool, which is part of the generic package of Velocity Tools, can be bound under the attribute name "math", specifying the fully qualified class name "org.apache.velocity.tools.generic.MathTool" as value.

Note that VelocityView can only create simple generic tools or values, that is, classes with a public default constructor and no further initialization needs. This class does not do any further checks, to not introduce a required dependency on a specific tools package.

For tools that are part of the view package of Velocity Tools, a special Velocity context and a special init callback are needed. Use VelocityToolboxView in such a case, or override createVelocityContext and initTool accordingly.

For a simple VelocityFormatter instance or special locale-aware instances of DateTool/NumberTool, which are part of the generic package of Velocity Tools, specify the "velocityFormatterAttribute", "dateToolAttribute" or "numberToolAttribute" properties, respectively.

Parameters:
toolAttributes - attribute names as keys, and tool class names as values
See Also:
MathTool,
VelocityToolboxView,
createVelocityContext(java.util.Map, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse),
initTool(java.lang.Object, org.apache.velocity.context.Context),
setDateToolAttribute(java.lang.String),
setNumberToolAttribute(java.lang.String)

setDateToolAttribute

public void setDateToolAttribute(String dateToolAttribute)
Set the name of the DateTool helper object to expose in the Velocity context of this view, or null if not needed. The exposed DateTool will be aware of the current locale, as determined by Spring's LocaleResolver.

DateTool is part of the generic package of Velocity Tools 1.0. Spring uses a special locale-aware subclass of DateTool.

See Also:
DateTool, RequestContextUtils.getLocale(javax.servlet.http.HttpServletRequest), LocaleResolver

setNumberToolAttribute

public void setNumberToolAttribute(String numberToolAttribute)
Set the name of the NumberTool helper object to expose in the Velocity context of this view, or null if not needed. The exposed NumberTool will be aware of the current locale, as determined by Spring's LocaleResolver.

NumberTool is part of the generic package of Velocity Tools 1.1. Spring uses a special locale-aware subclass of NumberTool.

See Also:
NumberTool, RequestContextUtils.getLocale(javax.servlet.http.HttpServletRequest), LocaleResolver

setEncoding

public void setEncoding(String encoding)
Set the encoding of the Velocity template file. Default is determined by the VelocityEngine: "ISO-8859-1" if not specified otherwise.

Specify the encoding in the VelocityEngine rather than per template if all your templates share a common encoding.

getEncoding

protected String getEncoding()
Return the encoding for the Velocity template.

setCacheTemplate

public void setCacheTemplate(boolean cacheTemplate)
Set whether the Velocity template should be cached. Default is "false". It should normally be true in production, but setting this to false enables us to modify Velocity templates without restarting the application (similar to JSPs).

Note that this is a minor optimization only, as Velocity itself caches templates in a modification-aware fashion.

isCacheTemplate

protected boolean isCacheTemplate()
Return whether the Velocity template should be cached.

setVelocityEngine

public void setVelocityEngine(VelocityEngine velocityEngine)
Set the VelocityEngine to be used by this view.

If this is not set, the default lookup will occur: A single VelocityConfig is expected in the current web application context, with any bean name.

See Also:
VelocityConfig

getVelocityEngine

protected VelocityEngine getVelocityEngine()
Return the VelocityEngine used by this view.

initApplicationContext

protected void initApplicationContext()
                               throws BeansException
Invoked on startup. Looks for a single VelocityConfig bean to find the relevant VelocityEngine for this factory.

Overrides:
initApplicationContext in class ApplicationObjectSupport
Throws:
ApplicationContextException - in case of initialization errors
BeansException - if thrown by ApplicationContext methods
See Also:
ApplicationObjectSupport.setApplicationContext(org.springframework.context.ApplicationContext)

autodetectVelocityEngine

protected VelocityEngine autodetectVelocityEngine()
                                           throws BeansException
Autodetect a VelocityEngine via the ApplicationContext. Called if no explicit VelocityEngine has been specified.

Returns:
the VelocityEngine to use for VelocityViews
Throws:
BeansException - if no VelocityEngine could be found
See Also:
ApplicationObjectSupport.getApplicationContext(), setVelocityEngine(org.apache.velocity.app.VelocityEngine)

checkResource

public boolean checkResource(Locale locale)
                      throws Exception
Check that the Velocity template used for this view exists and is valid.

Can be overridden to customize the behavior, for example in case of multiple templates to be rendered into a single view.

Overrides:
checkResource in class AbstractUrlBasedView
Parameters:
locale - the desired Locale that we're looking for
Returns:
true if the resource exists (or is assumed to exist); false if we know that it does not exist
Throws:
Exception - if the resource exists but is invalid (e.g. could not be parsed)

renderMergedTemplateModel

protected void renderMergedTemplateModel(Map<String,Object> model,
                                         HttpServletRequest request,
                                         HttpServletResponse response)
                                  throws Exception
Process the model map by merging it with the Velocity template. Output is directed to the servlet response.

This method can be overridden if custom behavior is needed.

Specified by:
renderMergedTemplateModel in class AbstractTemplateView
Parameters:
model - combined output Map, with request attributes and session attributes merged into it if required
request - current HTTP request
response - current HTTP response
Throws:
Exception - if rendering failed

exposeHelpers

protected void exposeHelpers(Map<String,Object> model,
                             HttpServletRequest request)
                      throws Exception
Expose helpers unique to each rendering operation. This is necessary so that different rendering operations can't overwrite each other's formats etc.

Called by renderMergedTemplateModel. The default implementation is empty. This method can be overridden to add custom helpers to the model.

Parameters:
model - the model that will be passed to the template for merging
request - current HTTP request
Throws:
Exception - if there's a fatal error while we're adding model attributes
See Also:
renderMergedTemplateModel(java.util.Map, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

createVelocityContext

protected Context createVelocityContext(Map<String,Object> model,
                                        HttpServletRequest request,
                                        HttpServletResponse response)
                                 throws Exception
Create a Velocity Context instance for the given model, to be passed to the template for merging.

The default implementation delegates to createVelocityContext(Map). Can be overridden for a special context class, for example ChainedContext which is part of the view package of Velocity Tools. ChainedContext is needed for initialization of ViewTool instances.

Have a look at VelocityToolboxView, which pre-implements ChainedContext support. This is not part of the standard VelocityView class in order to avoid a required dependency on the view package of Velocity Tools.

Parameters:
model - the model Map, containing the model attributes to be exposed to the view
request - current HTTP request
response - current HTTP response
Returns:
the Velocity Context
Throws:
Exception - if there's a fatal error while creating the context
See Also:
createVelocityContext(Map), initTool(java.lang.Object, org.apache.velocity.context.Context), ChainedContext, VelocityToolboxView

createVelocityContext

protected Context createVelocityContext(Map<String,Object> model)
                                 throws Exception
Create a Velocity Context instance for the given model, to be passed to the template for merging.

Default implementation creates an instance of Velocity's VelocityContext implementation class.

Parameters:
model - the model Map, containing the model attributes to be exposed to the view
Returns:
the Velocity Context
Throws:
Exception - if there's a fatal error while creating the context
See Also:
VelocityContext

exposeHelpers

protected void exposeHelpers(Context velocityContext,
                             HttpServletRequest request,
                             HttpServletResponse response)
                      throws Exception
Expose helpers unique to each rendering operation. This is necessary so that different rendering operations can't overwrite each other's formats etc.

Called by renderMergedTemplateModel. Default implementation delegates to exposeHelpers(velocityContext, request). This method can be overridden to add special tools to the context, needing the servlet response to initialize (see Velocity Tools, for example LinkTool and ViewTool/ChainedContext).

Parameters:
velocityContext - Velocity context that will be passed to the template
request - current HTTP request
response - current HTTP response
Throws:
Exception - if there's a fatal error while we're adding model attributes
See Also:
exposeHelpers(org.apache.velocity.context.Context, HttpServletRequest)

exposeHelpers

protected void exposeHelpers(Context velocityContext,
                             HttpServletRequest request)
                      throws Exception
Expose helpers unique to each rendering operation. This is necessary so that different rendering operations can't overwrite each other's formats etc.

Default implementation is empty. This method can be overridden to add custom helpers to the Velocity context.

Parameters:
velocityContext - Velocity context that will be passed to the template
request - current HTTP request
Throws:
Exception - if there's a fatal error while we're adding model attributes
See Also:
exposeHelpers(Map, HttpServletRequest)

exposeToolAttributes

protected void exposeToolAttributes(Context velocityContext,
                                    HttpServletRequest request)
                             throws Exception
Expose the tool attributes, according to corresponding bean property settings.

Do not override this method unless for further tools driven by bean properties. Override one of the exposeHelpers methods to add custom helpers.

Parameters:
velocityContext - Velocity context that will be passed to the template
request - current HTTP request
Throws:
Exception - if there's a fatal error while we're adding model attributes
See Also:
setDateToolAttribute(java.lang.String),
setNumberToolAttribute(java.lang.String),
exposeHelpers(Map, HttpServletRequest),
exposeHelpers(org.apache.velocity.context.Context, HttpServletRequest, HttpServletResponse)

initTool

protected void initTool(Object tool,
                        Context velocityContext)
                 throws Exception
Initialize the given tool instance. The default implementation is empty.

Can be overridden to check for special callback interfaces, for example the ViewContext interface which is part of the view package of Velocity Tools. In the particular case of ViewContext, you'll usually also need a special Velocity context, like ChainedContext which is part of Velocity Tools too.

Have a look at VelocityToolboxView, which pre-implements such a ViewTool check. This is not part of the standard VelocityView class in order to avoid a required dependency on the view package of Velocity Tools.

Parameters:
tool - the tool instance to initialize
velocityContext - the Velocity context
Throws:
Exception - if initializion of the tool failed
See Also:
createVelocityContext(java.util.Map, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), ViewContext, ChainedContext, VelocityToolboxView

doRender

protected void doRender(Context context,
                        HttpServletResponse response)
                 throws Exception
Render the Velocity view to the given response, using the given Velocity context which contains the complete template model to use.

The default implementation renders the template specified by the "url" bean property, retrieved via getTemplate. It delegates to the mergeTemplate method to merge the template instance with the given Velocity context.

Can be overridden to customize the behavior, for example to render multiple templates into a single view.

Parameters:
context - the Velocity context to use for rendering
response - servlet response (use this to get the OutputStream or Writer)
Throws:
Exception - if thrown by Velocity
See Also:
AbstractUrlBasedView.setUrl(java.lang.String),
getTemplate(),
mergeTemplate(org.apache.velocity.Template, org.apache.velocity.context.Context, javax.servlet.http.HttpServletResponse)

getTemplate

protected Template getTemplate()
                        throws Exception
Retrieve the Velocity template to be rendered by this view.

By default, the template specified by the "url" bean property will be retrieved: either returning a cached template instance or loading a fresh instance (according to the "cacheTemplate" bean property)

Returns:
the Velocity template to render
Throws:
Exception - if thrown by Velocity
See Also:
AbstractUrlBasedView.setUrl(java.lang.String), setCacheTemplate(boolean), getTemplate(String)

getTemplate

protected Template getTemplate(String name)
                        throws Exception
Retrieve the Velocity template specified by the given name, using the encoding specified by the "encoding" bean property.

Can be called by subclasses to retrieve a specific template, for example to render multiple templates into a single view.

Parameters:
name - the file name of the desired template
Returns:
the Velocity template
Throws:
Exception - if thrown by Velocity
See Also:
VelocityEngine.getTemplate(java.lang.String)

mergeTemplate

protected void mergeTemplate(Template template,
                             Context context,
                             HttpServletResponse response)
                      throws Exception
Merge the template with the context. Can be overridden to customize the behavior.

Parameters:
template - the template to merge
context - the Velocity context to use for rendering
response - servlet response (use this to get the OutputStream or Writer)
Throws:
Exception - if thrown by Velocity
See Also:
Template.merge(org.apache.velocity.context.Context, java.io.Writer)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


VelocityViewResolver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.view.velocity
Class VelocityViewResolver

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractCachingViewResolver
                extended by  org.springframework.web.servlet.view.UrlBasedViewResolver
                    extended by  org.springframework.web.servlet.view.AbstractTemplateViewResolver
                        extended by  org.springframework.web.servlet.view.velocity.VelocityViewResolver
All Implemented Interfaces:
ApplicationContextAware, Ordered, ServletContextAware, ViewResolver
Direct Known Subclasses:
VelocityLayoutViewResolver
public class VelocityViewResolver
extends AbstractTemplateViewResolver

Convenience subclass of UrlBasedViewResolver that supports VelocityView (i.e. Velocity templates) and custom subclasses of it.

The view class for all views generated by this resolver can be specified via the "viewClass" property. See UrlBasedViewResolver's javadoc for details.

Note: When chaining ViewResolvers, a VelocityViewResolver will check for the existence of the specified template resources and only return a non-null View object if the template was actually found.

Since:
13.12.2003
Author:
Juergen Hoeller
See Also:
UrlBasedViewResolver.setViewClass(java.lang.Class),
UrlBasedViewResolver.setPrefix(java.lang.String),
UrlBasedViewResolver.setSuffix(java.lang.String),
UrlBasedViewResolver.setRequestContextAttribute(java.lang.String),
AbstractTemplateViewResolver.setExposeSpringMacroHelpers(boolean),
setDateToolAttribute(java.lang.String),
setNumberToolAttribute(java.lang.String),
VelocityView

Field Summary
Fields inherited from class org.springframework.web.servlet.view.UrlBasedViewResolver
FORWARD_URL_PREFIX, REDIRECT_URL_PREFIX
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
VelocityViewResolver()
Method Summary
protected AbstractUrlBasedView | buildView(String viewName) Creates a new View instance of the specified view class and configures it.
protected void | initApplicationContext() Subclasses can override this for custom initialization behavior.
protected Class | requiredViewClass() Requires VelocityView.
void | setDateToolAttribute(String dateToolAttribute) Set the name of the DateTool helper object to expose in the Velocity context of this view, or null if not needed.
void | setNumberToolAttribute(String numberToolAttribute) Set the name of the NumberTool helper object to expose in the Velocity context of this view, or null if not needed.
void | setToolboxConfigLocation(String toolboxConfigLocation) Set a Velocity Toolbox config location, for example "/WEB-INF/toolbox.xml", to automatically load a Velocity Tools toolbox definition file and expose all defined tools in the specified scopes.
Methods inherited from class org.springframework.web.servlet.view.AbstractTemplateViewResolver
setAllowRequestOverride, setAllowSessionOverride, setExposeRequestAttributes, setExposeSessionAttributes, setExposeSpringMacroHelpers
Methods inherited from class org.springframework.web.servlet.view.UrlBasedViewResolver
canHandle, createView, getAttributesMap, getCacheKey, getContentType, getOrder, getPrefix, getRequestContextAttribute, getSuffix, getViewClass, getViewNames, isRedirectContextRelative, isRedirectHttp10Compatible, loadView, setAttributes, setAttributesMap, setContentType, setOrder, setPrefix, setRedirectContextRelative, setRedirectHttp10Compatible, setRequestContextAttribute, setSuffix, setViewClass, setViewNames
Methods inherited from class org.springframework.web.servlet.view.AbstractCachingViewResolver
clearCache, isCache, removeFromCache, resolveViewName, setCache
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

VelocityViewResolver

public VelocityViewResolver()
Method Detail

requiredViewClass

protected Class requiredViewClass()
Requires VelocityView.

Overrides:
requiredViewClass in class AbstractTemplateViewResolver
See Also:
AbstractUrlBasedView

setDateToolAttribute

public void setDateToolAttribute(String dateToolAttribute)
Set the name of the DateTool helper object to expose in the Velocity context of this view, or null if not needed. DateTool is part of Velocity Tools 1.0.

See Also:
DateTool, VelocityView.setDateToolAttribute(java.lang.String)

setNumberToolAttribute

public void setNumberToolAttribute(String numberToolAttribute)
Set the name of the NumberTool helper object to expose in the Velocity context of this view, or null if not needed. NumberTool is part of Velocity Tools 1.1.

See Also:
NumberTool, VelocityView.setNumberToolAttribute(java.lang.String)

setToolboxConfigLocation

public void setToolboxConfigLocation(String toolboxConfigLocation)
Set a Velocity Toolbox config location, for example "/WEB-INF/toolbox.xml", to automatically load a Velocity Tools toolbox definition file and expose all defined tools in the specified scopes. If no config location is specified, no toolbox will be loaded and exposed.

The specfied location string needs to refer to a ServletContext resource, as expected by ServletToolboxManager which is part of the view package of Velocity Tools.

Note: Specifying a toolbox config location will lead to VelocityToolboxView instances being created.

See Also:
ServletToolboxManager.getInstance(javax.servlet.ServletContext, java.lang.String), VelocityToolboxView.setToolboxConfigLocation(java.lang.String)

initApplicationContext

protected void initApplicationContext()
Description copied from class: ApplicationObjectSupport
Subclasses can override this for custom initialization behavior.

The default implementation is empty. Called by ApplicationObjectSupport.initApplicationContext(org.springframework.context.ApplicationContext).

Overrides:
initApplicationContext in class UrlBasedViewResolver
See Also:
ApplicationObjectSupport.setApplicationContext(org.springframework.context.ApplicationContext)

buildView

protected AbstractUrlBasedView buildView(String viewName)
                                  throws Exception
Description copied from class: UrlBasedViewResolver
Creates a new View instance of the specified view class and configures it. Does not perform any lookup for pre-defined View instances.

Spring lifecycle methods as defined by the bean container do not have to be called here; those will be applied by the loadView method after this method returns.

Subclasses will typically call super.buildView(viewName) first, before setting further properties themselves. loadView will then apply Spring lifecycle methods at the end of this process.

Overrides:
buildView in class AbstractTemplateViewResolver
Parameters:
viewName - the name of the view to build
Returns:
the View instance
Throws:
Exception - if the view couldn't be resolved
See Also:
UrlBasedViewResolver.loadView(String, java.util.Locale)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.servlet.view.xml

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.servlet.view.xml

Support classes for providing a View implementation based on XML Marshalling.

See:
Description

Class Summary
MarshallingView Spring-MVC View that allows for response context to be rendered as the result of marshalling by a Marshaller.

Package org.springframework.web.servlet.view.xml Description

Support classes for providing a View implementation based on XML Marshalling.


org.springframework.web.servlet.view.xml Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.servlet.view.xml

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.context.support.ApplicationObjectSupport (implements org.springframework.context.ApplicationContextAware)
      • org.springframework.web.context.support.WebApplicationObjectSupport (implements org.springframework.web.context.ServletContextAware)
        • org.springframework.web.servlet.view.AbstractView (implements org.springframework.beans.factory.BeanNameAware, org.springframework.web.servlet.View)
          • org.springframework.web.servlet.view.xml.MarshallingView


MarshallingView

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.view.xml
Class MarshallingView

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
                extended by  org.springframework.web.servlet.view.xml.MarshallingView
All Implemented Interfaces:
BeanNameAware, ApplicationContextAware, ServletContextAware, View
public class MarshallingView
extends AbstractView

Spring-MVC View that allows for response context to be rendered as the result of marshalling by a Marshaller.

The Object to be marshalled is supplied as a parameter in the model and then detected during response rendering. Users can either specify a specific entry in the model via the sourceKey property or have Spring locate the Source object.

Since:
3.0
Author:
Arjen Poutsma

Field Summary
static String DEFAULT_CONTENT_TYPE
Default content type.
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
MarshallingView()
Constructs a new MarshallingView with no Marshaller set.
MarshallingView(Marshaller marshaller)
Constructs a new MarshallingView with the given Marshaller set.
Method Summary
protected void | initApplicationContext() Subclasses can override this for custom initialization behavior.
protected Object | locateToBeMarshalled(Map model) Locates the object to be marshalled.
protected void | renderMergedOutputModel(Map model, HttpServletRequest request, HttpServletResponse response) Subclasses must implement this method to actually render the view.
void | setMarshaller(Marshaller marshaller) Sets the Marshaller to be used by this view.
void | setModelKey(String modelKey) Set the name of the model key that represents the object to be marshalled.
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, toString, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

DEFAULT_CONTENT_TYPE

public static final String DEFAULT_CONTENT_TYPE
Default content type. Overridable as bean property.

See Also:
Constant Field Values
Constructor Detail

MarshallingView

public MarshallingView()
Constructs a new MarshallingView with no Marshaller set. The marshaller must be set after construction by invoking setMarshaller(Marshaller).

MarshallingView

public MarshallingView(Marshaller marshaller)
Constructs a new MarshallingView with the given Marshaller set.

Method Detail

setMarshaller

public void setMarshaller(Marshaller marshaller)
Sets the Marshaller to be used by this view.

setModelKey

public void setModelKey(String modelKey)
Set the name of the model key that represents the object to be marshalled. If not specified, the model map will be searched for a supported value type.

See Also:
Marshaller.supports(Class)

initApplicationContext

protected void initApplicationContext()
                               throws BeansException
Description copied from class: ApplicationObjectSupport
Subclasses can override this for custom initialization behavior.

The default implementation is empty. Called by ApplicationObjectSupport.initApplicationContext(org.springframework.context.ApplicationContext).

Overrides:
initApplicationContext in class ApplicationObjectSupport
Throws:
ApplicationContextException - in case of initialization errors
BeansException - if thrown by ApplicationContext methods
See Also:
ApplicationObjectSupport.setApplicationContext(org.springframework.context.ApplicationContext)

renderMergedOutputModel

protected void renderMergedOutputModel(Map model,
                                       HttpServletRequest request,
                                       HttpServletResponse response)
                                throws Exception
Description copied from class: AbstractView
Subclasses must implement this method to actually render the view.

The first step will be preparing the request: In the JSP case, this would mean setting model objects as request attributes. The second step will be the actual rendering of the view, for example including the JSP via a RequestDispatcher.

Specified by:
renderMergedOutputModel in class AbstractView
Parameters:
model - combined output Map (never null), with dynamic values taking precedence over static attributes
request - current HTTP request
response - current HTTP response
Throws:
Exception - if rendering failed

locateToBeMarshalled

protected Object locateToBeMarshalled(Map model)
                               throws ServletException
Locates the object to be marshalled. The default implementation first attempts to look under the configured model key, if any, before attempting to locate an object of supported type.

Parameters:
model - the model Map
Returns:
the Object to be marshalled (or null if none found)
Throws:
ServletException - if the model object specified by the model key is not supported by the marshaller
See Also:
setModelKey(String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.servlet.view.xslt

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.servlet.view.xslt

Support classes for XSLT, providing a View implementation for XSLT stylesheets.

See:
Description

Class Summary
AbstractXsltView | Deprecated. since Spring 2.5; superseded by XsltView and its more flexible XsltView.locateSource(java.util.Map) mechanism
XsltView | XSLT-driven View that allows for response context to be rendered as the result of an XSLT transformation.
XsltViewResolver | ViewResolver implementation that resolves instances of XsltView by translating the supplied view name into the URL of the XSLT stylesheet.

Package org.springframework.web.servlet.view.xslt Description

Support classes for XSLT, providing a View implementation for XSLT stylesheets.


org.springframework.web.servlet.view.xslt Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.servlet.view.xslt

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.context.support.ApplicationObjectSupport (implements org.springframework.context.ApplicationContextAware)
      • org.springframework.web.context.support.WebApplicationObjectSupport (implements org.springframework.web.context.ServletContextAware)
        • org.springframework.web.servlet.view.AbstractCachingViewResolver (implements org.springframework.web.servlet.ViewResolver)
          • org.springframework.web.servlet.view.UrlBasedViewResolver (implements org.springframework.core.Ordered)
            • org.springframework.web.servlet.view.xslt.XsltViewResolver
        • org.springframework.web.servlet.view.AbstractView (implements org.springframework.beans.factory.BeanNameAware, org.springframework.web.servlet.View)
          • org.springframework.web.servlet.view.AbstractUrlBasedView (implements org.springframework.beans.factory.InitializingBean)
            • org.springframework.web.servlet.view.xslt.XsltView
          • org.springframework.web.servlet.view.xslt.AbstractXsltView


AbstractXsltView

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.view.xslt
Class AbstractXsltView

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
                extended by  org.springframework.web.servlet.view.xslt.AbstractXsltView
All Implemented Interfaces:
BeanNameAware, ApplicationContextAware, ServletContextAware, View
Deprecated. since Spring 2.5; superseded by XsltView and its more flexible XsltView.locateSource(java.util.Map) mechanism

@Deprecated
public abstract class AbstractXsltView
extends AbstractView

Convenient superclass for views rendered using an XSLT stylesheet.

Subclasses typically must provide the Source to transform by overriding createXsltSource(java.util.Map, java.lang.String, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse). Subclasses do not need to concern themselves with XSLT other than providing a valid stylesheet location.

Properties:

  • stylesheetLocation: a Resource pointing to the XSLT stylesheet
  • root: the name of the root element; defaults to "DocRoot"
  • uriResolver: the URIResolver to be used in the transform
  • errorListener (optional): the ErrorListener implementation instance for custom handling of warnings and errors during TransformerFactory operations
  • indent (optional): whether additional whitespace may be added when outputting the result; defaults to true
  • cache (optional): are templates to be cached; debug setting only; defaults to true

Note that setting "cache" to false will cause the template objects to be reloaded for each rendering. This is useful during development, but will seriously affect performance in production and is not thread-safe.

Author:
Rod Johnson, Juergen Hoeller, Darren Davison

Field Summary
static String | DEFAULT_ROOT Deprecated. The default document root name
static String | XML_CONTENT_TYPE Deprecated. The default content type if no stylesheet specified
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
protected AbstractXsltView()
Deprecated. This constructor sets the content type to "text/xml;charset=ISO-8859-1" by default.
Method Summary
protected void | applyTransformerParameters(Map<String,Object> parameters, Transformer transformer) Deprecated. Apply the specified parameters to the given Transformer.
protected Transformer | buildTransformer(Map<String,Object> parameters) Deprecated. Build a Transformer object for immediate use, based on the given parameters.
protected Source | createXsltSource(Map<String,Object> model, String root, HttpServletRequest request, HttpServletResponse response) Deprecated. Return the XML Source to transform.
protected void | doTransform(Map<String,Object> model, Source source, HttpServletRequest request, HttpServletResponse response) Deprecated. Perform the actual transformation, writing to the HTTP response.
protected void | doTransform(Source source, Map<String,Object> parameters, Result result, String encoding) Deprecated. Perform the actual transformation, writing to the given result.
protected Map | getParameters(HttpServletRequest request) Deprecated. Return a Map of transformer parameters to be applied to the stylesheet.
protected Map | getParameters(Map<String,Object> model, HttpServletRequest request) Deprecated. Return a Map of transformer parameters to be applied to the stylesheet.
protected Resource | getStylesheetLocation() Deprecated. Return the location of the XSLT stylesheet, if any.
protected Source | getStylesheetSource(Resource stylesheetLocation) Deprecated. Load the stylesheet from the specified location.
protected Templates | getTemplates() Deprecated. Obtain the Templates object to use, based on the configured stylesheet, either a cached one or a freshly built one.
protected TransformerFactory | getTransformerFactory() Deprecated. Return the TransformerFactory used by this view.
protected void | initApplicationContext() Deprecated. Here we load our template, as we need the ApplicationContext to do it.
protected TransformerFactory | newTransformerFactory(Class transformerFactoryClass) Deprecated. Instantiate a new TransformerFactory for this view.
protected void | renderMergedOutputModel(Map<String,Object> model, HttpServletRequest request, HttpServletResponse response) Deprecated. Subclasses must implement this method to actually render the view.
void | resetCachedTemplates() Deprecated. Reset the cached Templates object, if any.
void | setCache(boolean cache) Deprecated. Set whether to activate the template cache for this view.
void | setContentType(String contentType) Deprecated. Set the content type for this view.
void | setErrorListener(ErrorListener errorListener) Deprecated. Set an implementation of the ErrorListener interface for custom handling of transformation errors and warnings.
void | setIndent(boolean indent) Deprecated. Set whether the XSLT transformer may add additional whitespace when outputting the result tree.
void | setOutputProperties(Properties outputProperties) Deprecated. Set arbitrary transformer output properties to be applied to the stylesheet.
void | setRoot(String root) Deprecated. The document root element name.
void | setStylesheetLocation(Resource stylesheetLocation) Deprecated. Set the location of the XSLT stylesheet.
void | setTransformerFactoryClass(Class transformerFactoryClass) Deprecated. Specify the XSLT TransformerFactory class to use.
void | setUriResolver(URIResolver uriResolver) Deprecated. Set the URIResolver used in the transform.
void | setUseSingleModelNameAsRoot(boolean useSingleModelNameAsRoot) Deprecated. Set whether to use the name of a given single model object as the document root element name.
protected boolean | useWriter() Deprecated. Return whether to use a java.io.Writer to write text content to the HTTP response.
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setRequestContextAttribute, toString, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

XML_CONTENT_TYPE

public static final String XML_CONTENT_TYPE
Deprecated.
The default content type if no stylesheet specified

See Also:
Constant Field Values

DEFAULT_ROOT

public static final String DEFAULT_ROOT
Deprecated.
The default document root name

See Also:
Constant Field Values
Constructor Detail

AbstractXsltView

protected AbstractXsltView()
Deprecated.
This constructor sets the content type to "text/xml;charset=ISO-8859-1" by default. This will be switched to the standard web view default "text/html;charset=ISO-8859-1" if a stylesheet location has been specified.

A specific content type can be configured via the "contentType" bean property.

Method Detail

setContentType

public void setContentType(String contentType)
Deprecated.
Description copied from class: AbstractView
Set the content type for this view. Default is "text/html;charset=ISO-8859-1".

May be ignored by subclasses if the view itself is assumed to set the content type, e.g. in case of JSPs.

Overrides:
setContentType in class AbstractView

setTransformerFactoryClass

public void setTransformerFactoryClass(Class transformerFactoryClass)
Deprecated.
Specify the XSLT TransformerFactory class to use.

The default constructor of the specified class will be called to build the TransformerFactory for this view.

setStylesheetLocation

public void setStylesheetLocation(Resource stylesheetLocation)
Deprecated.
Set the location of the XSLT stylesheet.

If the TransformerFactory used by this instance has already been initialized then invoking this setter will result in the attendant templates being re-cached.

Parameters:
stylesheetLocation - the location of the XSLT stylesheet
See Also:
ResourceLoader.getResource(java.lang.String)

getStylesheetLocation

protected Resource getStylesheetLocation()
Deprecated.
Return the location of the XSLT stylesheet, if any.

setRoot

public void setRoot(String root)
Deprecated.
The document root element name. Default is "DocRoot".

Only used if we're not passed a single Node as the model.

Parameters:
root - the document root element name
See Also:
DEFAULT_ROOT

setUseSingleModelNameAsRoot

public void setUseSingleModelNameAsRoot(boolean useSingleModelNameAsRoot)
Deprecated.
Set whether to use the name of a given single model object as the document root element name.

Default is true : If you pass in a model with a single object named "myElement", then the document root will be named "myElement" as well. Set this flag to false if you want to pass in a single model object while still using the root element name configured through the "root" property.

Parameters:
useSingleModelNameAsRoot - true if the name of a given single model object is to be used as the document root element name
See Also:
setRoot(java.lang.String)

setUriResolver

public void setUriResolver(URIResolver uriResolver)
Deprecated.
Set the URIResolver used in the transform.

The URIResolver handles calls to the XSLT document() function.

setErrorListener

public void setErrorListener(ErrorListener errorListener)
Deprecated.
Set an implementation of the ErrorListener interface for custom handling of transformation errors and warnings.

If not set, a default SimpleTransformErrorListener is used that simply logs warnings using the logger instance of the view class, and rethrows errors to discontinue the XML transformation.

See Also:
SimpleTransformErrorListener

setIndent

public void setIndent(boolean indent)
Deprecated.
Set whether the XSLT transformer may add additional whitespace when outputting the result tree.

Default is true (on); set this to false (off) to not specify an "indent" key, leaving the choice up to the stylesheet.

See Also:
OutputKeys.INDENT

setOutputProperties

public void setOutputProperties(Properties outputProperties)
Deprecated.
Set arbitrary transformer output properties to be applied to the stylesheet.

Any values specified here will override defaults that this view sets programmatically.

See Also:
Transformer.setOutputProperty(java.lang.String, java.lang.String)

setCache

public void setCache(boolean cache)
Deprecated.
Set whether to activate the template cache for this view.

Default is true. Turn this off to refresh the Templates object on every access, e.g. during development.

See Also:
resetCachedTemplates()

resetCachedTemplates

public final void resetCachedTemplates()
Deprecated.
Reset the cached Templates object, if any.

The Templates object will subsequently be rebuilt on next access, if caching is enabled.

See Also:
setCache(boolean)

initApplicationContext

protected final void initApplicationContext()
                                     throws ApplicationContextException
Deprecated.
Here we load our template, as we need the ApplicationContext to do it.

Overrides:
initApplicationContext in class ApplicationObjectSupport
Throws:
ApplicationContextException - in case of initialization errors
See Also:
ApplicationObjectSupport.setApplicationContext(org.springframework.context.ApplicationContext)

newTransformerFactory

protected TransformerFactory newTransformerFactory(Class transformerFactoryClass)
Deprecated.
Instantiate a new TransformerFactory for this view.

The default implementation simply calls TransformerFactory.newInstance(). If a "transformerFactoryClass" has been specified explicitly, the default constructor of the specified class will be called instead.

Can be overridden in subclasses.

Parameters:
transformerFactoryClass - the specified factory class (if any)
Returns:
the new TransactionFactory instance
Throws:
TransformerFactoryConfigurationError - in case of instantiation failure
See Also:
setTransformerFactoryClass(java.lang.Class), getTransformerFactory()

getTransformerFactory

protected final TransformerFactory getTransformerFactory()
Deprecated.
Return the TransformerFactory used by this view. Available once the View object has been fully initialized.

renderMergedOutputModel

protected final void renderMergedOutputModel(Map<String,Object> model,
                                             HttpServletRequest request,
                                             HttpServletResponse response)
                                      throws Exception
Deprecated.
Description copied from class: AbstractView
Subclasses must implement this method to actually render the view.

The first step will be preparing the request: In the JSP case, this would mean setting model objects as request attributes. The second step will be the actual rendering of the view, for example including the JSP via a RequestDispatcher.

Specified by:
renderMergedOutputModel in class AbstractView
Parameters:
model - combined output Map (never null), with dynamic values taking precedence over static attributes
request - current HTTP request
response - current HTTP response
Throws:
Exception - if rendering failed

createXsltSource

protected Source createXsltSource(Map<String,Object> model,
                                  String root,
                                  HttpServletRequest request,
                                  HttpServletResponse response)
                           throws Exception
Deprecated.
Return the XML Source to transform.

Parameters:
model - the model Map
root - name for root element. This can be supplied as a bean property to concrete subclasses within the view definition file, but will be overridden in the case of a single object in the model map to be the key for that object. If no root property is specified and multiple model objects exist, a default root tag name will be supplied.
request - HTTP request. Subclasses won't normally use this, as request processing should have been complete. However, we might want to create a RequestContext to expose as part of the model.
response - HTTP response. Subclasses won't normally use this, however there may sometimes be a need to set cookies.
Returns:
the XSLT Source to transform
Throws:
Exception - if an error occurs

doTransform

protected void doTransform(Map<String,Object> model,
                           Source source,
                           HttpServletRequest request,
                           HttpServletResponse response)
                    throws Exception
Deprecated.
Perform the actual transformation, writing to the HTTP response.

The default implementation delegates to the doTransform(javax.xml.transform.Source, java.util.Map, javax.xml.transform.Result, String) method, building a StreamResult for the ServletResponse OutputStream or for the ServletResponse Writer (according to useWriter()).

Parameters:
model - the model Map
source - the Source to transform
request - current HTTP request
response - current HTTP response
Throws:
Exception - if an error occurs
See Also:
StreamResult,
ServletResponse.getOutputStream(),
ServletResponse.getWriter(),
useWriter()

getParameters

protected Map getParameters(Map<String,Object> model,
                            HttpServletRequest request)
Deprecated.
Return a Map of transformer parameters to be applied to the stylesheet.

Subclasses can override this method in order to apply one or more parameters to the transformation process.

The default implementation delegates to the getParameters(HttpServletRequest) variant.

Parameters:
model - the model Map
request - current HTTP request
Returns:
a Map of parameters to apply to the transformation process
See Also:
Transformer.setParameter(java.lang.String, java.lang.Object)

getParameters

protected Map getParameters(HttpServletRequest request)
Deprecated.
Return a Map of transformer parameters to be applied to the stylesheet.

Subclasses can override this method in order to apply one or more parameters to the transformation process.

The default implementation simply returns null.

Parameters:
request - current HTTP request
Returns:
a Map of parameters to apply to the transformation process
See Also:
getParameters(Map, HttpServletRequest), Transformer.setParameter(java.lang.String, java.lang.Object)

useWriter

protected boolean useWriter()
Deprecated.
Return whether to use a java.io.Writer to write text content to the HTTP response. Else, a java.io.OutputStream will be used, to write binary content to the response.

The default implementation returns false, indicating a a java.io.OutputStream.

Returns:
whether to use a Writer (true) or an OutputStream (false)
See Also:
ServletResponse.getWriter(), ServletResponse.getOutputStream()

doTransform

protected void doTransform(Source source,
                           Map<String,Object> parameters,
                           Result result,
                           String encoding)
                    throws Exception
Deprecated.
Perform the actual transformation, writing to the given result.

Parameters:
source - the Source to transform
parameters - a Map of parameters to be applied to the stylesheet (as determined by getParameters(Map, HttpServletRequest))
result - the result to write to
encoding - the preferred character encoding that the underlying Transformer should use
Throws:
Exception - if an error occurs

buildTransformer

protected Transformer buildTransformer(Map<String,Object> parameters)
                                throws TransformerConfigurationException
Deprecated.
Build a Transformer object for immediate use, based on the given parameters.

Parameters:
parameters - a Map of parameters to be applied to the stylesheet (as determined by getParameters(Map, HttpServletRequest))
Returns:
the Transformer object (never null)
Throws:
TransformerConfigurationException - if the Transformer object could not be built

getTemplates

protected Templates getTemplates()
                          throws TransformerConfigurationException
Deprecated.
Obtain the Templates object to use, based on the configured stylesheet, either a cached one or a freshly built one.

Subclasses may override this method e.g. in order to refresh the Templates instance, calling resetCachedTemplates() before delegating to this getTemplates() implementation.

Returns:
the Templates object (or null if there is no stylesheet specified)
Throws:
TransformerConfigurationException - if the Templates object could not be built
See Also:
setStylesheetLocation(org.springframework.core.io.Resource), setCache(boolean), resetCachedTemplates()

applyTransformerParameters

protected void applyTransformerParameters(Map<String,Object> parameters,
                                          Transformer transformer)
Deprecated.
Apply the specified parameters to the given Transformer.

Parameters:
parameters - the transformer parameters (as determined by getParameters(Map, HttpServletRequest))
transformer - the Transformer to aply the parameters

getStylesheetSource

protected Source getStylesheetSource(Resource stylesheetLocation)
                              throws ApplicationContextException
Deprecated.
Load the stylesheet from the specified location.

Parameters:
stylesheetLocation - the stylesheet resource to be loaded
Returns:
the stylesheet source
Throws:
ApplicationContextException - if the stylesheet resource could not be loaded
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


XsltView

org.springframework.web.servlet.view.xslt
Class XsltView

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractView
                extended by  org.springframework.web.servlet.view.AbstractUrlBasedView
                    extended by  org.springframework.web.servlet.view.xslt.XsltView
All Implemented Interfaces:
BeanNameAware, InitializingBean, ApplicationContextAware, ServletContextAware, View
public class XsltView
extends AbstractUrlBasedView

XSLT-driven View that allows for response context to be rendered as the result of an XSLT transformation.

The XSLT Source object is supplied as a parameter in the model and then detected during response rendering. Users can either specify a specific entry in the model via the sourceKey property or have Spring locate the Source object. This class also provides basic conversion of objects into Source implementations. See here for more details.

All model parameters are passed to the XSLT Transformer as parameters. In addition the user can configure output properties to be passed to the Transformer.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
Constructor Summary
XsltView()
Method Summary
protected void | configureIndentation(Transformer transformer) Configure the indentation settings for the supplied Transformer.
protected void | configureResponse(Map<String,Object> model, HttpServletResponse response, Transformer transformer) Configure the supplied HttpServletResponse.
protected void | configureTransformer(Map<String,Object> model, HttpServletResponse response, Transformer transformer) Configure the supplied Transformer instance.
protected Source | convertSource(Object source) Convert the supplied Object into an XSLT Source if the Object type is supported.
protected void | copyModelParameters(Map<String,Object> model, Transformer transformer) Copy all entries from the supplied Map into the parameter set of the supplied Transformer.
protected void | copyOutputProperties(Transformer transformer) Copy the configured output Properties, if any, into the output property set of the supplied Transformer.
protected Result | createResult(HttpServletResponse response) Create the XSLT Result used to render the result of the transformation.
protected Transformer | createTransformer(Templates templates) Create the Transformer instance used to prefer the XSLT transformation.
protected Class[] | getSourceTypes() Return the array of Classes that are supported when converting to an XSLT Source.
protected Source | getStylesheetSource() Get the XSLT Source for the XSLT template under the configured URL.
protected TransformerFactory | getTransformerFactory() Return the TransformerFactory that this XsltView uses.
protected void | initApplicationContext() Initialize this XsltView's TransformerFactory.
protected Source | locateSource(Map<String,Object> model) Locate the Source object in the supplied model, converting objects as required.
protected TransformerFactory | newTransformerFactory(Class transformerFactoryClass) Instantiate a new TransformerFactory for this view.
protected void | renderMergedOutputModel(Map<String,Object> model, HttpServletRequest request, HttpServletResponse response) Subclasses must implement this method to actually render the view.
void | setCacheTemplates(boolean cacheTemplates) Turn on/off the caching of the XSLT Templates instance.
void | setErrorListener(ErrorListener errorListener) Set an implementation of the ErrorListener interface for custom handling of transformation errors and warnings.
void | setIndent(boolean indent) Set whether the XSLT transformer may add additional whitespace when outputting the result tree.
void | setOutputProperties(Properties outputProperties) Set arbitrary transformer output properties to be applied to the stylesheet.
void | setSourceKey(String sourceKey) Set the name of the model attribute that represents the XSLT Source.
void | setTransformerFactoryClass(Class transformerFactoryClass) Specify the XSLT TransformerFactory class to use.
void | setUriResolver(URIResolver uriResolver) Set the URIResolver used in the transform.
Methods inherited from class org.springframework.web.servlet.view.AbstractUrlBasedView
afterPropertiesSet, checkResource, getUrl, isUrlRequired, setUrl, toString
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

XsltView

public XsltView()
Method Detail

setTransformerFactoryClass

public void setTransformerFactoryClass(Class transformerFactoryClass)
Specify the XSLT TransformerFactory class to use.

The default constructor of the specified class will be called to build the TransformerFactory for this view.

setSourceKey

public void setSourceKey(String sourceKey)
Set the name of the model attribute that represents the XSLT Source. If not specified, the model map will be searched for a matching value type.

The following source types are supported out of the box: Source, Document, Node, Reader, InputStream and Resource.

See Also:
getSourceTypes(), convertSource(java.lang.Object)

setUriResolver

public void setUriResolver(URIResolver uriResolver)
Set the URIResolver used in the transform.

The URIResolver handles calls to the XSLT document() function.

setErrorListener

public void setErrorListener(ErrorListener errorListener)
Set an implementation of the ErrorListener interface for custom handling of transformation errors and warnings.

If not set, a default SimpleTransformErrorListener is used that simply logs warnings using the logger instance of the view class, and rethrows errors to discontinue the XML transformation.

See Also:
SimpleTransformErrorListener

setIndent

public void setIndent(boolean indent)
Set whether the XSLT transformer may add additional whitespace when outputting the result tree.

Default is true (on); set this to false (off) to not specify an "indent" key, leaving the choice up to the stylesheet.

See Also:
OutputKeys.INDENT

setOutputProperties

public void setOutputProperties(Properties outputProperties)
Set arbitrary transformer output properties to be applied to the stylesheet.

Any values specified here will override defaults that this view sets programmatically.

See Also:
Transformer.setOutputProperty(java.lang.String, java.lang.String)

setCacheTemplates

public void setCacheTemplates(boolean cacheTemplates)
Turn on/off the caching of the XSLT Templates instance.

The default value is "true". Only set this to "false" in development, where caching does not seriously impact performance.

initApplicationContext

protected void initApplicationContext()
                               throws BeansException
Initialize this XsltView's TransformerFactory.

Overrides:
initApplicationContext in class ApplicationObjectSupport
Throws:
ApplicationContextException - in case of initialization errors
BeansException - if thrown by ApplicationContext methods
See Also:
ApplicationObjectSupport.setApplicationContext(org.springframework.context.ApplicationContext)

newTransformerFactory

protected TransformerFactory newTransformerFactory(Class transformerFactoryClass)
Instantiate a new TransformerFactory for this view.

The default implementation simply calls TransformerFactory.newInstance(). If a "transformerFactoryClass" has been specified explicitly, the default constructor of the specified class will be called instead.

Can be overridden in subclasses.

Parameters:
transformerFactoryClass - the specified factory class (if any)
Returns:
the new TransactionFactory instance
See Also:
setTransformerFactoryClass(java.lang.Class), getTransformerFactory()

getTransformerFactory

protected final TransformerFactory getTransformerFactory()
Return the TransformerFactory that this XsltView uses.

Returns:
the TransformerFactory (never null)

renderMergedOutputModel

protected void renderMergedOutputModel(Map<String,Object> model,
                                       HttpServletRequest request,
                                       HttpServletResponse response)
                                throws Exception
Description copied from class: AbstractView
Subclasses must implement this method to actually render the view.

The first step will be preparing the request: In the JSP case, this would mean setting model objects as request attributes. The second step will be the actual rendering of the view, for example including the JSP via a RequestDispatcher.

Specified by:
renderMergedOutputModel in class AbstractView
Parameters:
model - combined output Map (never null), with dynamic values taking precedence over static attributes
request - current HTTP request
response - current HTTP response
Throws:
Exception - if rendering failed

createResult

protected Result createResult(HttpServletResponse response)
                       throws Exception
Create the XSLT Result used to render the result of the transformation.

The default implementation creates a StreamResult wrapping the supplied HttpServletResponse's OutputStream.

Parameters:
response - current HTTP response
Returns:
the XSLT Result to use
Throws:
Exception - if the Result cannot be built

locateSource

protected Source locateSource(Map<String,Object> model)
                       throws Exception

Locate the Source object in the supplied model, converting objects as required. The default implementation first attempts to look under the configured source key, if any, before attempting to locate an object of supported type.

Parameters:
model - the merged model Map
Returns:
the XSLT Source object (or null if none found)
Throws:
Exception - if an error occured during locating the source
See Also:
setSourceKey(java.lang.String), convertSource(java.lang.Object)

getSourceTypes

protected Class[] getSourceTypes()
Return the array of Classes that are supported when converting to an XSLT Source.

Currently supports Source, Document, Node, Reader, InputStream and Resource.

Returns:
the supported source types

convertSource

protected Source convertSource(Object source)
                        throws Exception
Convert the supplied Object into an XSLT Source if the Object type is supported.

Parameters:
source - the original source object
Returns:
the adapted XSLT Source
Throws:
IllegalArgumentException - if the given Object is not of a supported type
Exception

configureTransformer

protected void configureTransformer(Map<String,Object> model,
                                    HttpServletResponse response,
                                    Transformer transformer)
Configure the supplied Transformer instance.

The default implementation copies parameters from the model into the Transformer's parameter set. This implementation also copies the output properties into the Transformer output properties. Indentation properties are set as well.

Parameters:
model - merged output Map (never null)
response - current HTTP response
transformer - the target transformer
See Also:
copyModelParameters(Map, Transformer), copyOutputProperties(Transformer), configureIndentation(Transformer)

configureIndentation

protected final void configureIndentation(Transformer transformer)
Configure the indentation settings for the supplied Transformer.

Parameters:
transformer - the target transformer
See Also:
TransformerUtils.enableIndenting(javax.xml.transform.Transformer), TransformerUtils.disableIndenting(javax.xml.transform.Transformer)

copyOutputProperties

protected final void copyOutputProperties(Transformer transformer)
Copy the configured output Properties, if any, into the output property set of the supplied Transformer.

Parameters:
transformer - the target transformer

copyModelParameters

protected final void copyModelParameters(Map<String,Object> model,
                                         Transformer transformer)
Copy all entries from the supplied Map into the parameter set of the supplied Transformer.

Parameters:
model - merged output Map (never null)
transformer - the target transformer

configureResponse

protected void configureResponse(Map<String,Object> model,
                                 HttpServletResponse response,
                                 Transformer transformer)
Configure the supplied HttpServletResponse.

The default implementation of this method sets the content type and encoding from the "media-type" and "encoding" output properties specified in the Transformer.

Parameters:
model - merged output Map (never null)
response - current HTTP response
transformer - the target transformer

createTransformer

protected Transformer createTransformer(Templates templates)
                                 throws TransformerConfigurationException
Create the Transformer instance used to prefer the XSLT transformation.

The default implementation simply calls Templates.newTransformer(), and configures the Transformer with the custom URIResolver if specified.

Parameters:
templates - the XSLT Templates instance to create a Transformer for
Returns:
the Transformer object
Throws:
TransformerConfigurationException - in case of creation failure

getStylesheetSource

protected Source getStylesheetSource()
Get the XSLT Source for the XSLT template under the configured URL.

Returns:
the Source object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XsltViewResolver

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.servlet.view.xslt
Class XsltViewResolver

java.lang.Object
    extended by  org.springframework.context.support.ApplicationObjectSupport
        extended by  org.springframework.web.context.support.WebApplicationObjectSupport
            extended by  org.springframework.web.servlet.view.AbstractCachingViewResolver
                extended by  org.springframework.web.servlet.view.UrlBasedViewResolver
                    extended by  org.springframework.web.servlet.view.xslt.XsltViewResolver
All Implemented Interfaces:
ApplicationContextAware, Ordered, ServletContextAware, ViewResolver
public class XsltViewResolver
extends UrlBasedViewResolver

ViewResolver implementation that resolves instances of XsltView by translating the supplied view name into the URL of the XSLT stylesheet.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller

Field Summary
Fields inherited from class org.springframework.web.servlet.view.UrlBasedViewResolver
FORWARD_URL_PREFIX, REDIRECT_URL_PREFIX
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
XsltViewResolver()
Method Summary
protected AbstractUrlBasedView | buildView(String viewName) Creates a new View instance of the specified view class and configures it.
protected Class | requiredViewClass() Return the required type of view for this resolver.
void | setCacheTemplates(boolean cacheTemplates) Turn on/off the caching of the XSLT templates.
void | setErrorListener(ErrorListener errorListener) Set an implementation of the ErrorListener interface for custom handling of transformation errors and warnings.
void | setIndent(boolean indent) Set whether the XSLT transformer may add additional whitespace when outputting the result tree.
void | setOutputProperties(Properties outputProperties) Set arbitrary transformer output properties to be applied to the stylesheet.
void | setSourceKey(String sourceKey) Set the name of the model attribute that represents the XSLT Source.
void | setUriResolver(URIResolver uriResolver) Set the URIResolver used in the transform.
Methods inherited from class org.springframework.web.servlet.view.UrlBasedViewResolver
canHandle, createView, getAttributesMap, getCacheKey, getContentType, getOrder, getPrefix, getRequestContextAttribute, getSuffix, getViewClass, getViewNames, initApplicationContext, isRedirectContextRelative, isRedirectHttp10Compatible, loadView, setAttributes, setAttributesMap, setContentType, setOrder, setPrefix, setRedirectContextRelative, setRedirectHttp10Compatible, setRequestContextAttribute, setSuffix, setViewClass, setViewNames
Methods inherited from class org.springframework.web.servlet.view.AbstractCachingViewResolver
clearCache, isCache, removeFromCache, resolveViewName, setCache
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

XsltViewResolver

public XsltViewResolver()
Method Detail

setSourceKey

public void setSourceKey(String sourceKey)
Set the name of the model attribute that represents the XSLT Source. If not specified, the model map will be searched for a matching value type.

The following source types are supported out of the box: Source, Document, Node, Reader, InputStream and Resource.

setUriResolver

public void setUriResolver(URIResolver uriResolver)
Set the URIResolver used in the transform.

The URIResolver handles calls to the XSLT document() function.

setErrorListener

public void setErrorListener(ErrorListener errorListener)
Set an implementation of the ErrorListener interface for custom handling of transformation errors and warnings.

If not set, a default SimpleTransformErrorListener is used that simply logs warnings using the logger instance of the view class, and rethrows errors to discontinue the XML transformation.

See Also:
SimpleTransformErrorListener

setIndent

public void setIndent(boolean indent)
Set whether the XSLT transformer may add additional whitespace when outputting the result tree.

Default is true (on); set this to false (off) to not specify an "indent" key, leaving the choice up to the stylesheet.

See Also:
OutputKeys.INDENT

setOutputProperties

public void setOutputProperties(Properties outputProperties)
Set arbitrary transformer output properties to be applied to the stylesheet.

Any values specified here will override defaults that this view sets programmatically.

See Also:
Transformer.setOutputProperty(java.lang.String, java.lang.String)

setCacheTemplates

public void setCacheTemplates(boolean cacheTemplates)
Turn on/off the caching of the XSLT templates.

The default value is "true". Only set this to "false" in development, where caching does not seriously impact performance.

requiredViewClass

protected Class requiredViewClass()
Description copied from class: UrlBasedViewResolver
Return the required type of view for this resolver. This implementation returns AbstractUrlBasedView.

Overrides:
requiredViewClass in class UrlBasedViewResolver
See Also:
AbstractUrlBasedView

buildView

protected AbstractUrlBasedView buildView(String viewName)
                                  throws Exception
Description copied from class: UrlBasedViewResolver
Creates a new View instance of the specified view class and configures it. Does not perform any lookup for pre-defined View instances.

Spring lifecycle methods as defined by the bean container do not have to be called here; those will be applied by the loadView method after this method returns.

Subclasses will typically call super.buildView(viewName) first, before setting further properties themselves. loadView will then apply Spring lifecycle methods at the end of this process.

Overrides:
buildView in class UrlBasedViewResolver
Parameters:
viewName - the name of the view to build
Returns:
the View instance
Throws:
Exception - if the view couldn't be resolved
See Also:
UrlBasedViewResolver.loadView(String, java.util.Locale)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.struts

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
@Deprecated

Package org.springframework.web.struts

Support classes for integrating a Struts web tier with a Spring middle tier which is typically hosted in a Spring root WebApplicationContext.

See:
Description

Class Summary
ActionSupport | Deprecated. as of Spring 3.0
AutowiringRequestProcessor | Deprecated. as of Spring 3.0
AutowiringTilesRequestProcessor | Deprecated. as of Spring 3.0
ContextLoaderPlugIn | Deprecated. as of Spring 3.0
DelegatingActionProxy | Deprecated. as of Spring 3.0
DelegatingActionUtils | Deprecated. as of Spring 3.0
DelegatingRequestProcessor | Deprecated. as of Spring 3.0
DelegatingTilesRequestProcessor | Deprecated. as of Spring 3.0
DispatchActionSupport | Deprecated. as of Spring 3.0
LookupDispatchActionSupport | Deprecated. as of Spring 3.0
MappingDispatchActionSupport | Deprecated. as of Spring 3.0
SpringBindingActionForm | Deprecated. as of Spring 3.0

Package org.springframework.web.struts Description

Support classes for integrating a Struts web tier with a Spring middle tier which is typically hosted in a Spring root WebApplicationContext.

Supports easy access to the Spring root WebApplicationContext from Struts Actions via the ActionSupport and DispatchActionSupport classes. Actions have full access to Spring's WebApplicationContext facilities in this case, and explicitly look up Spring-managed beans.

Also supports wiring Struts Actions as Spring-managed beans in a ContextLoaderPlugIn context, passing middle tier references to them via bean references, using the Action path as bean name. There are two ways to make Struts delegate Action lookup to the ContextLoaderPlugIn:

  • Use DelegationActionProxy as Action "type" in struts-config. There's no further setup necessary; you can choose any RequestProcessor. Each such proxy will automatically delegate to the corresponding Spring-managed Action bean in the ContextLoaderPlugIn context.
  • Configure DelegatingRequestProcessor as "processorClass" in struts-config, using the original Action "type" (possibly generated by XDoclet) or no "type" at all. To also use Tiles, configure DelegatingTilesRequestProcessor instead.


org.springframework.web.struts Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.struts

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.apache.struts.action.Action
      • org.springframework.web.struts.ActionSupport
      • org.springframework.web.struts.DelegatingActionProxy
      • org.apache.struts.actions.DispatchAction
        • org.springframework.web.struts.DispatchActionSupport
        • org.apache.struts.actions.LookupDispatchAction
          • org.springframework.web.struts.LookupDispatchActionSupport
        • org.apache.struts.actions.MappingDispatchAction
          • org.springframework.web.struts.MappingDispatchActionSupport
    • org.apache.struts.action.ActionForm (implements java.io.Serializable)
      • org.springframework.web.struts.SpringBindingActionForm
    • org.springframework.web.struts.ContextLoaderPlugIn (implements org.apache.struts.action.PlugIn)
    • org.springframework.web.struts.DelegatingActionUtils
    • org.apache.struts.action.RequestProcessor
      • org.springframework.web.struts.AutowiringRequestProcessor
      • org.springframework.web.struts.DelegatingRequestProcessor
      • org.apache.struts.tiles.TilesRequestProcessor
        • org.springframework.web.struts.AutowiringTilesRequestProcessor
        • org.springframework.web.struts.DelegatingTilesRequestProcessor


ActionSupport

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.struts
Class ActionSupport

java.lang.Object
    extended by  org.apache.struts.action.Action
        extended by  org.springframework.web.struts.ActionSupport
Deprecated. as of Spring 3.0

@Deprecated
public abstract class ActionSupport
extends Action

Convenience class for Spring-aware Struts 1.1+ Actions.

Provides a reference to the current Spring application context, e.g. for bean lookup or resource loading. Auto-detects a ContextLoaderPlugIn context, falling back to the root WebApplicationContext. For typical usage, i.e. accessing middle tier beans, use a root WebApplicationContext.

For Struts DispatchActions or Lookup/MappingDispatchActions, use the analogous DispatchActionSupport or LookupDispatchActionSupport / MappingDispatchActionSupport class, respectively.

As an alternative approach, you can wire your Struts Actions themselves as Spring beans, passing references to them via IoC rather than looking up references in a programmatic fashion. Check out DelegatingActionProxy and DelegatingRequestProcessor.

Since:
1.0.1
Author:
Juergen Hoeller
See Also:
ContextLoaderPlugIn.SERVLET_CONTEXT_PREFIX, WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, ContextLoaderListener, org.springframework.web.context.ContextLoaderServlet, DispatchActionSupport, LookupDispatchActionSupport, MappingDispatchActionSupport, DelegatingActionProxy, DelegatingRequestProcessor

Field Summary
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
Constructor Summary
ActionSupport()
Deprecated.
Method Summary
protected MessageSourceAccessor | getMessageSourceAccessor() Deprecated. Return a MessageSourceAccessor for the application context used by this object, for easy message access.
protected ServletContext | getServletContext() Deprecated. Return the current ServletContext.
protected File | getTempDir() Deprecated. Return the temporary directory for the current web application, as provided by the servlet container.
protected WebApplicationContext | getWebApplicationContext() Deprecated. Return the current Spring WebApplicationContext.
protected WebApplicationContext | initWebApplicationContext(ActionServlet actionServlet) Deprecated. Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, falling back to the root WebApplicationContext (the usual case).
protected void | onDestroy() Deprecated. Callback for custom destruction when the ActionServlet shuts down.
protected void | onInit() Deprecated. Callback for custom initialization after the context has been set up.
void | setServlet(ActionServlet actionServlet) Deprecated. Initialize the WebApplicationContext for this Action.
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ActionSupport

public ActionSupport()
Deprecated.
Method Detail

setServlet

public void setServlet(ActionServlet actionServlet)
Deprecated.
Initialize the WebApplicationContext for this Action. Invokes onInit after successful initialization of the context.

Overrides:
setServlet in class Action
See Also:
initWebApplicationContext(org.apache.struts.action.ActionServlet), onInit()

initWebApplicationContext

protected WebApplicationContext initWebApplicationContext(ActionServlet actionServlet)
                                                   throws IllegalStateException
Deprecated.
Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, falling back to the root WebApplicationContext (the usual case).

Parameters:
actionServlet - the associated ActionServlet
Returns:
the WebApplicationContext
Throws:
IllegalStateException - if no WebApplicationContext could be found
See Also:
DelegatingActionUtils.findRequiredWebApplicationContext(org.apache.struts.action.ActionServlet, org.apache.struts.config.ModuleConfig)

getWebApplicationContext

protected final WebApplicationContext getWebApplicationContext()
Deprecated.
Return the current Spring WebApplicationContext.

getMessageSourceAccessor

protected final MessageSourceAccessor getMessageSourceAccessor()
Deprecated.
Return a MessageSourceAccessor for the application context used by this object, for easy message access.

getServletContext

protected final ServletContext getServletContext()
Deprecated.
Return the current ServletContext.

getTempDir

protected final File getTempDir()
Deprecated.
Return the temporary directory for the current web application, as provided by the servlet container.

Returns:
the File representing the temporary directory

onInit

protected void onInit()
Deprecated.
Callback for custom initialization after the context has been set up.

See Also:
setServlet(org.apache.struts.action.ActionServlet)

onDestroy

protected void onDestroy()
Deprecated.
Callback for custom destruction when the ActionServlet shuts down.

See Also:
setServlet(org.apache.struts.action.ActionServlet)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AutowiringRequestProcessor

org.springframework.web.struts
Class AutowiringRequestProcessor

java.lang.Object
    extended by  org.apache.struts.action.RequestProcessor
        extended by  org.springframework.web.struts.AutowiringRequestProcessor
Deprecated. as of Spring 3.0

@Deprecated
public class AutowiringRequestProcessor
extends RequestProcessor

Subclass of Struts's default RequestProcessor that autowires Struts Actions with Spring beans defined in ContextLoaderPlugIn's WebApplicationContext or - in case of general service layer beans - in the root WebApplicationContext.

In the Struts config file, you simply continue to specify the original Action class. The instance created for that class will automatically get wired with matching service layer beans, that is, bean property setters will automatically be called if a service layer bean matches the property.

 <action path="/login" type="myapp.MyAction"/>
There are two autowire modes available: "byType" and "byName". The default is "byType", matching service layer beans with the Action's bean property argument types. This behavior can be changed through specifying an "autowire" init-param for the Struts ActionServlet with the value "byName", which will match service layer bean names with the Action's bean property names.

Dependency checking is turned off by default: If no matching service layer bean can be found, the setter in question will simply not get invoked. To enforce matching service layer beans, consider specify the "dependencyCheck" init-param for the Struts ActionServlet with the value "true".

If you also need the Tiles setup functionality of the original TilesRequestProcessor, use AutowiringTilesRequestProcessor. As there's just a single central class to customize in Struts, we have to provide another subclass here, covering both the Tiles and the Spring delegation aspect.

The default implementation delegates to the DelegatingActionUtils class as fas as possible, to reuse as much code as possible despite the need to provide two RequestProcessor subclasses. If you need to subclass yet another RequestProcessor, take this class as a template, delegating to DelegatingActionUtils just like it.

Since:
2.0
Author:
Juergen Hoeller
See Also:
AutowiringTilesRequestProcessor, ContextLoaderPlugIn, DelegatingActionUtils

Field Summary
Fields inherited from class org.apache.struts.action.RequestProcessor
actions, INCLUDE_PATH_INFO, INCLUDE_SERVLET_PATH, log, moduleConfig, servlet
Constructor Summary
AutowiringRequestProcessor()
Deprecated.
Method Summary
protected int | getAutowireMode() Deprecated. Return the autowire mode to use for wiring Struts Actions.
protected boolean | getDependencyCheck() Deprecated. Return whether to apply a dependency check after wiring Struts Actions.
protected WebApplicationContext | getWebApplicationContext() Deprecated. Return the current Spring WebApplicationContext.
void | init(ActionServlet actionServlet, ModuleConfig moduleConfig) Deprecated.
protected int | initAutowireMode(ActionServlet actionServlet, ModuleConfig moduleConfig) Deprecated. Determine the autowire mode to use for wiring Struts Actions.
protected boolean | initDependencyCheck(ActionServlet actionServlet, ModuleConfig moduleConfig) Deprecated. Determine whether to apply a dependency check after wiring Struts Actions.
protected WebApplicationContext | initWebApplicationContext(ActionServlet actionServlet, ModuleConfig moduleConfig) Deprecated. Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, falling back to the root WebApplicationContext.
protected Action | processActionCreate(HttpServletRequest request, HttpServletResponse response, ActionMapping mapping) Deprecated. Extend the base class method to autowire each created Action instance.
Methods inherited from class org.apache.struts.action.RequestProcessor
destroy, doForward, doInclude, getInternal, getServletContext, internalModuleRelativeForward, internalModuleRelativeInclude, log, log, process, processActionForm, processActionPerform, processCachedMessages, processContent, processException, processForward, processForwardConfig, processInclude, processLocale, processMapping, processMultipart, processNoCache, processPath, processPopulate, processPreprocess, processRoles, processValidate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AutowiringRequestProcessor

public AutowiringRequestProcessor()
Deprecated.
Method Detail

init

public void init(ActionServlet actionServlet,
                 ModuleConfig moduleConfig)
          throws ServletException
Deprecated.
Overrides:
init in class RequestProcessor
Throws:
ServletException

initWebApplicationContext

protected WebApplicationContext initWebApplicationContext(ActionServlet actionServlet,
                                                          ModuleConfig moduleConfig)
                                                   throws IllegalStateException
Deprecated.
Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, falling back to the root WebApplicationContext. This context is supposed to contain the service layer beans to wire the Struts Actions with.

Parameters:
actionServlet - the associated ActionServlet
moduleConfig - the associated ModuleConfig
Returns:
the WebApplicationContext
Throws:
IllegalStateException - if no WebApplicationContext could be found
See Also:
DelegatingActionUtils.findRequiredWebApplicationContext(org.apache.struts.action.ActionServlet, org.apache.struts.config.ModuleConfig), ContextLoaderPlugIn.SERVLET_CONTEXT_PREFIX

initAutowireMode

protected int initAutowireMode(ActionServlet actionServlet,
                               ModuleConfig moduleConfig)
Deprecated.
Determine the autowire mode to use for wiring Struts Actions.

The default implementation checks the "autowire" init-param of the Struts ActionServlet, falling back to "AUTOWIRE_BY_TYPE" as default.

Parameters:
actionServlet - the associated ActionServlet
moduleConfig - the associated ModuleConfig
Returns:
the autowire mode to use
See Also:
DelegatingActionUtils.getAutowireMode(org.apache.struts.action.ActionServlet), AutowireCapableBeanFactory.autowireBeanProperties(java.lang.Object, int, boolean), AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE, AutowireCapableBeanFactory.AUTOWIRE_BY_NAME

initDependencyCheck

protected boolean initDependencyCheck(ActionServlet actionServlet,
                                      ModuleConfig moduleConfig)
Deprecated.
Determine whether to apply a dependency check after wiring Struts Actions.

The default implementation checks the "dependencyCheck" init-param of the Struts ActionServlet, falling back to no dependency check as default.

Parameters:
actionServlet - the associated ActionServlet
moduleConfig - the associated ModuleConfig
Returns:
whether to enforce a dependency check or not
See Also:
DelegatingActionUtils.getDependencyCheck(org.apache.struts.action.ActionServlet), AutowireCapableBeanFactory.autowireBeanProperties(java.lang.Object, int, boolean)

getWebApplicationContext

protected final WebApplicationContext getWebApplicationContext()
Deprecated.
Return the current Spring WebApplicationContext.

getAutowireMode

protected final int getAutowireMode()
Deprecated.
Return the autowire mode to use for wiring Struts Actions.

getDependencyCheck

protected final boolean getDependencyCheck()
Deprecated.
Return whether to apply a dependency check after wiring Struts Actions.

processActionCreate

protected Action processActionCreate(HttpServletRequest request,
                                     HttpServletResponse response,
                                     ActionMapping mapping)
                              throws IOException
Deprecated.
Extend the base class method to autowire each created Action instance.

Overrides:
processActionCreate in class RequestProcessor
Throws:
IOException
See Also:
AutowireCapableBeanFactory.autowireBeanProperties(java.lang.Object, int, boolean)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AutowiringTilesRequestProcessor

org.springframework.web.struts
Class AutowiringTilesRequestProcessor

java.lang.Object
    extended by  org.apache.struts.action.RequestProcessor
        extended by  org.apache.struts.tiles.TilesRequestProcessor
            extended by  org.springframework.web.struts.AutowiringTilesRequestProcessor
Deprecated. as of Spring 3.0

@Deprecated
public class AutowiringTilesRequestProcessor
extends TilesRequestProcessor

Subclass of Struts's TilesRequestProcessor that autowires Struts Actions with Spring beans defined in ContextLoaderPlugIn's WebApplicationContext or - in case of general service layer beans - in the root WebApplicationContext.

Behaves like AutowiringRequestProcessor, but also provides the Tiles functionality of the original TilesRequestProcessor. As there's just a single central class to customize in Struts, we have to provide another subclass here, covering both the Tiles and the Spring delegation aspect.

The default implementation delegates to the DelegatingActionUtils class as fas as possible, to reuse as much code as possible despite the need to provide two RequestProcessor subclasses. If you need to subclass yet another RequestProcessor, take this class as a template, delegating to DelegatingActionUtils just like it.

Since:
2.0
Author:
Juergen Hoeller
See Also:
AutowiringRequestProcessor, ContextLoaderPlugIn, DelegatingActionUtils

Field Summary
Fields inherited from class org.apache.struts.tiles.TilesRequestProcessor
definitionsFactory, log
Fields inherited from class org.apache.struts.action.RequestProcessor
actions, INCLUDE_PATH_INFO, INCLUDE_SERVLET_PATH, moduleConfig, servlet
Constructor Summary
AutowiringTilesRequestProcessor()
Deprecated.
Method Summary
protected int | getAutowireMode() Deprecated. Return the autowire mode to use for wiring Struts Actions.
protected boolean | getDependencyCheck() Deprecated. Return whether to apply a dependency check after wiring Struts Actions.
protected WebApplicationContext | getWebApplicationContext() Deprecated. Return the current Spring WebApplicationContext.
void | init(ActionServlet actionServlet, ModuleConfig moduleConfig) Deprecated.
protected int | initAutowireMode(ActionServlet actionServlet, ModuleConfig moduleConfig) Deprecated. Determine the autowire mode to use for wiring Struts Actions.
protected boolean | initDependencyCheck(ActionServlet actionServlet, ModuleConfig moduleConfig) Deprecated. Determine whether to apply a dependency check after wiring Struts Actions.
protected WebApplicationContext | initWebApplicationContext(ActionServlet actionServlet, ModuleConfig moduleConfig) Deprecated. Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, falling back to the root WebApplicationContext.
protected Action | processActionCreate(HttpServletRequest request, HttpServletResponse response, ActionMapping mapping) Deprecated. Extend the base class method to autowire each created Action instance.
Methods inherited from class org.apache.struts.tiles.TilesRequestProcessor
doForward, getDefinitionsFactory, initDefinitionsMapping, internalModuleRelativeForward, internalModuleRelativeInclude, processForwardConfig, processTilesDefinition
Methods inherited from class org.apache.struts.action.RequestProcessor
destroy, doInclude, getInternal, getServletContext, log, log, process, processActionForm, processActionPerform, processCachedMessages, processContent, processException, processForward, processInclude, processLocale, processMapping, processMultipart, processNoCache, processPath, processPopulate, processPreprocess, processRoles, processValidate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AutowiringTilesRequestProcessor

public AutowiringTilesRequestProcessor()
Deprecated.
Method Detail

init

public void init(ActionServlet actionServlet,
                 ModuleConfig moduleConfig)
          throws ServletException
Deprecated.
Overrides:
init in class TilesRequestProcessor
Throws:
ServletException

initWebApplicationContext

protected WebApplicationContext initWebApplicationContext(ActionServlet actionServlet,
                                                          ModuleConfig moduleConfig)
                                                   throws IllegalStateException
Deprecated.
Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, falling back to the root WebApplicationContext. This context is supposed to contain the service layer beans to wire the Struts Actions with.

Parameters:
actionServlet - the associated ActionServlet
moduleConfig - the associated ModuleConfig
Returns:
the WebApplicationContext
Throws:
IllegalStateException - if no WebApplicationContext could be found
See Also:
DelegatingActionUtils.findRequiredWebApplicationContext(org.apache.struts.action.ActionServlet, org.apache.struts.config.ModuleConfig), ContextLoaderPlugIn.SERVLET_CONTEXT_PREFIX

initAutowireMode

protected int initAutowireMode(ActionServlet actionServlet,
                               ModuleConfig moduleConfig)
Deprecated.
Determine the autowire mode to use for wiring Struts Actions.

The default implementation checks the "autowire" init-param of the Struts ActionServlet, falling back to "AUTOWIRE_BY_TYPE" as default.

Parameters:
actionServlet - the associated ActionServlet
moduleConfig - the associated ModuleConfig
Returns:
the autowire mode to use
See Also:
DelegatingActionUtils.getAutowireMode(org.apache.struts.action.ActionServlet), AutowireCapableBeanFactory.autowireBeanProperties(java.lang.Object, int, boolean), AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE, AutowireCapableBeanFactory.AUTOWIRE_BY_NAME

initDependencyCheck

protected boolean initDependencyCheck(ActionServlet actionServlet,
                                      ModuleConfig moduleConfig)
Deprecated.
Determine whether to apply a dependency check after wiring Struts Actions.

The default implementation checks the "dependencyCheck" init-param of the Struts ActionServlet, falling back to no dependency check as default.

Parameters:
actionServlet - the associated ActionServlet
moduleConfig - the associated ModuleConfig
Returns:
whether to enforce a dependency check or not
See Also:
DelegatingActionUtils.getDependencyCheck(org.apache.struts.action.ActionServlet), AutowireCapableBeanFactory.autowireBeanProperties(java.lang.Object, int, boolean)

getWebApplicationContext

protected final WebApplicationContext getWebApplicationContext()
Deprecated.
Return the current Spring WebApplicationContext.

getAutowireMode

protected final int getAutowireMode()
Deprecated.
Return the autowire mode to use for wiring Struts Actions.

getDependencyCheck

protected final boolean getDependencyCheck()
Deprecated.
Return whether to apply a dependency check after wiring Struts Actions.

processActionCreate

protected Action processActionCreate(HttpServletRequest request,
                                     HttpServletResponse response,
                                     ActionMapping mapping)
                              throws IOException
Deprecated.
Extend the base class method to autowire each created Action instance.

Overrides:
processActionCreate in class RequestProcessor
Throws:
IOException
See Also:
AutowireCapableBeanFactory.autowireBeanProperties(java.lang.Object, int, boolean)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ContextLoaderPlugIn

org.springframework.web.struts
Class ContextLoaderPlugIn

java.lang.Object
    extended by  org.springframework.web.struts.ContextLoaderPlugIn
All Implemented Interfaces:
PlugIn
Deprecated. as of Spring 3.0

@Deprecated
public class ContextLoaderPlugIn
extends Object
implements PlugIn

Struts 1.1+ PlugIn that loads a Spring application context for the Struts ActionServlet. This context will automatically refer to the root WebApplicationContext (loaded by ContextLoaderListener/Servlet) as parent.

The default namespace of the WebApplicationContext is the name of the Struts ActionServlet, suffixed with "-servlet" (e.g. "action-servlet"). The default location of the XmlWebApplicationContext configuration file is therefore "/WEB-INF/action-servlet.xml".

 <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn"/>
The location of the context configuration files can be customized through the "contextConfigLocation" setting, analogous to the root WebApplicationContext and FrameworkServlet contexts.
 <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
   <set-property property="contextConfigLocation" value="/WEB-INF/action-servlet.xml /WEB-INF/myContext.xml"/>
 </plug-in>
Beans defined in the ContextLoaderPlugIn context can be accessed from conventional Struts Actions, via fetching the WebApplicationContext reference from the ServletContext. ActionSupport and DispatchActionSupport are pre-built convenience classes that provide easy access to the context.

It is normally preferable to access Spring's root WebApplicationContext in such scenarios, though: A shared middle tier should be defined there rather than in a ContextLoaderPlugin context, for access by any web component. ActionSupport and DispatchActionSupport autodetect the root context too.

A special usage of this PlugIn is to define Struts Actions themselves as beans, typically wiring them with middle tier components defined in the root context. Such Actions will then be delegated to by proxy definitions in the Struts configuration, using the DelegatingActionProxy class or the DelegatingRequestProcessor.

Note that you can use a single ContextLoaderPlugIn for all Struts modules. That context can in turn be loaded from multiple XML files, for example split according to Struts modules. Alternatively, define one ContextLoaderPlugIn per Struts module, specifying appropriate "contextConfigLocation" parameters.

Note: The idea of delegating to Spring-managed Struts Actions originated in Don Brown's Spring Struts Plugin. ContextLoaderPlugIn and DelegatingActionProxy constitute a clean-room implementation of the same idea, essentially superseding the original plugin. Many thanks to Don Brown and Matt Raible for the original work and for the agreement to reimplement the idea in Spring proper!

Since:
1.0.1
Author:
Juergen Hoeller
See Also:
SERVLET_CONTEXT_PREFIX, ActionSupport, DispatchActionSupport, DelegatingActionProxy, DelegatingRequestProcessor, DelegatingTilesRequestProcessor, ContextLoaderListener, org.springframework.web.context.ContextLoaderServlet, FrameworkServlet

Field Summary
static Class | DEFAULT_CONTEXT_CLASS Deprecated. Default context class for ContextLoaderPlugIn.
static String | DEFAULT_NAMESPACE_SUFFIX Deprecated. Suffix for WebApplicationContext namespaces.
protected Log | logger Deprecated.
static String | SERVLET_CONTEXT_PREFIX Deprecated. Prefix for the ServletContext attribute for the WebApplicationContext.
Constructor Summary
ContextLoaderPlugIn()
Deprecated.
Method Summary
protected WebApplicationContext | createWebApplicationContext(WebApplicationContext parent) Deprecated. Instantiate the WebApplicationContext for the ActionServlet, either a default XmlWebApplicationContext or a custom context class if set.
void | destroy() Deprecated. Close the WebApplicationContext of the ActionServlet.
ActionServlet | getActionServlet() Deprecated. Return the Struts ActionServlet that this PlugIn is associated with.
Class | getContextClass() Deprecated. Return the custom context class.
String | getContextConfigLocation() Deprecated. Return the explicit context config location, if any.
ModuleConfig | getModuleConfig() Deprecated. Return the Struts ModuleConfig that this PlugIn is associated with.
String | getModulePrefix() Deprecated. Return the prefix of the ModuleConfig that this PlugIn is associated with.
String | getNamespace() Deprecated. Return the namespace for the ActionServlet, falling back to default scheme if no custom namespace was set: e.g.
ServletContext | getServletContext() Deprecated. Return the ServletContext that this PlugIn is associated with.
String | getServletContextAttributeName() Deprecated. Return the ServletContext attribute name for this PlugIn's WebApplicationContext.
String | getServletName() Deprecated. Return the name of the ActionServlet that this PlugIn is associated with.
WebApplicationContext | getWebApplicationContext() Deprecated. Return this PlugIn's WebApplicationContext.
void | init(ActionServlet actionServlet, ModuleConfig moduleConfig) Deprecated. Create the ActionServlet's WebApplicationContext.
protected WebApplicationContext | initWebApplicationContext() Deprecated. Initialize and publish the WebApplicationContext for the ActionServlet.
protected void | onInit() Deprecated. Callback for custom initialization after the context has been set up.
void | setContextClass(Class contextClass) Deprecated. Set a custom context class.
void | setContextClassName(String contextClassName) Deprecated. Set a custom context class by name.
void | setContextConfigLocation(String contextConfigLocation) Deprecated. Set the context config location explicitly, instead of relying on the default location built from the namespace.
void | setNamespace(String namespace) Deprecated. Set a custom namespace for the ActionServlet, to be used for building a default context config location.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_NAMESPACE_SUFFIX

public static final String DEFAULT_NAMESPACE_SUFFIX
Deprecated.
Suffix for WebApplicationContext namespaces. If a Struts ActionServlet is given the name "action" in a context, the namespace used by this PlugIn will resolve to "action-servlet".

See Also:
Constant Field Values

DEFAULT_CONTEXT_CLASS

public static final Class DEFAULT_CONTEXT_CLASS
Deprecated.
Default context class for ContextLoaderPlugIn.

See Also:
XmlWebApplicationContext

SERVLET_CONTEXT_PREFIX

public static final String SERVLET_CONTEXT_PREFIX
Deprecated.
Prefix for the ServletContext attribute for the WebApplicationContext. The completion is the Struts module name.

logger

protected final Log logger
Deprecated.
Constructor Detail

ContextLoaderPlugIn

public ContextLoaderPlugIn()
Deprecated.
Method Detail

setContextClassName

public void setContextClassName(String contextClassName)
                         throws ClassNotFoundException
Deprecated.
Set a custom context class by name. This class must be of type WebApplicationContext, when using the default ContextLoaderPlugIn implementation, the context class must also implement ConfigurableWebApplicationContext.

Throws:
ClassNotFoundException
See Also:
createWebApplicationContext(org.springframework.web.context.WebApplicationContext)

setContextClass

public void setContextClass(Class contextClass)
Deprecated.
Set a custom context class. This class must be of type WebApplicationContext, when using the default ContextLoaderPlugIn implementation, the context class must also implement ConfigurableWebApplicationContext.

See Also:
createWebApplicationContext(org.springframework.web.context.WebApplicationContext)

getContextClass

public Class getContextClass()
Deprecated.
Return the custom context class.

setNamespace

public void setNamespace(String namespace)
Deprecated.
Set a custom namespace for the ActionServlet, to be used for building a default context config location.

getNamespace

public String getNamespace()
Deprecated.
Return the namespace for the ActionServlet, falling back to default scheme if no custom namespace was set: e.g. "test-servlet" for a servlet named "test".

setContextConfigLocation

public void setContextConfigLocation(String contextConfigLocation)
Deprecated.
Set the context config location explicitly, instead of relying on the default location built from the namespace. This location string can consist of multiple locations separated by any number of commas and spaces.

getContextConfigLocation

public String getContextConfigLocation()
Deprecated.
Return the explicit context config location, if any.

init

public final void init(ActionServlet actionServlet,
                       ModuleConfig moduleConfig)
                throws ServletException
Deprecated.
Create the ActionServlet's WebApplicationContext.

Specified by:
init in interface PlugIn
Throws:
ServletException

getActionServlet

public final ActionServlet getActionServlet()
Deprecated.
Return the Struts ActionServlet that this PlugIn is associated with.

getServletName

public final String getServletName()
Deprecated.
Return the name of the ActionServlet that this PlugIn is associated with.

getServletContext

public final ServletContext getServletContext()
Deprecated.
Return the ServletContext that this PlugIn is associated with.

getModuleConfig

public final ModuleConfig getModuleConfig()
Deprecated.
Return the Struts ModuleConfig that this PlugIn is associated with.

getModulePrefix

public final String getModulePrefix()
Deprecated.
Return the prefix of the ModuleConfig that this PlugIn is associated with.

See Also:
ModuleConfig.getPrefix()

initWebApplicationContext

protected WebApplicationContext initWebApplicationContext()
                                                   throws BeansException,
                                                          IllegalStateException
Deprecated.
Initialize and publish the WebApplicationContext for the ActionServlet.

Delegates to createWebApplicationContext(org.springframework.web.context.WebApplicationContext) for actual creation.

Can be overridden in subclasses. Call getActionServlet() and/or getModuleConfig() to access the Struts configuration that this PlugIn is associated with.

Throws:
BeansException - if the context couldn't be initialized
IllegalStateException - if there is already a context for the Struts ActionServlet
See Also:
getActionServlet(),
getServletName(),
getServletContext(),
getModuleConfig(),
getModulePrefix()

createWebApplicationContext

protected WebApplicationContext createWebApplicationContext(WebApplicationContext parent)
                                                     throws BeansException
Deprecated.
Instantiate the WebApplicationContext for the ActionServlet, either a default XmlWebApplicationContext or a custom context class if set.

This implementation expects custom contexts to implement ConfigurableWebApplicationContext. Can be overridden in subclasses.

Throws:
BeansException - if the context couldn't be initialized
See Also:
setContextClass(java.lang.Class), XmlWebApplicationContext

getServletContextAttributeName

public String getServletContextAttributeName()
Deprecated.
Return the ServletContext attribute name for this PlugIn's WebApplicationContext.

The default implementation returns SERVLET_CONTEXT_PREFIX + module prefix.

See Also:
SERVLET_CONTEXT_PREFIX, getModulePrefix()

getWebApplicationContext

public final WebApplicationContext getWebApplicationContext()
Deprecated.
Return this PlugIn's WebApplicationContext.

onInit

protected void onInit()
               throws ServletException
Deprecated.
Callback for custom initialization after the context has been set up.

Throws:
ServletException - if initialization failed

destroy

public void destroy()
Deprecated.
Close the WebApplicationContext of the ActionServlet.

Specified by:
destroy in interface PlugIn
See Also:
ConfigurableApplicationContext.close()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DelegatingActionProxy

org.springframework.web.struts
Class DelegatingActionProxy

java.lang.Object
    extended by  org.apache.struts.action.Action
        extended by  org.springframework.web.struts.DelegatingActionProxy
Deprecated. as of Spring 3.0

@Deprecated
public class DelegatingActionProxy
extends Action

Proxy for a Spring-managed Struts Action that is defined in ContextLoaderPlugIn's WebApplicationContext.

The proxy is defined in the Struts config file, specifying this class as the action class. This class will delegate to a Struts Action bean in the ContextLoaderPlugIn context.

<action path="/login" type="org.springframework.web.struts.DelegatingActionProxy"/>
The name of the Action bean in the WebApplicationContext will be determined from the mapping path and module prefix. This can be customized by overriding the determineActionBeanName method.

Example:

  • mapping path "/login" -> bean name "/login"
  • mapping path "/login", module prefix "/mymodule" -> bean name "/mymodule/login"

A corresponding bean definition in the ContextLoaderPlugin context would look as follows; notice that the Action is now able to leverage fully Spring's configuration facilities:

 <bean name="/login" class="myapp.MyAction">
   <property name="...">...</property>
 </bean>
Note that you can use a single ContextLoaderPlugIn for all Struts modules. That context can in turn be loaded from multiple XML files, for example split according to Struts modules. Alternatively, define one ContextLoaderPlugIn per Struts module, specifying appropriate "contextConfigLocation" parameters. In both cases, the Spring bean name has to include the module prefix.

If you want to avoid having to specify DelegatingActionProxy as the Action type in your struts-config file (for example to be able to generate your Struts config file with XDoclet) consider using the DelegatingRequestProcessor. The latter's disadvantage is that it might conflict with the need for a different RequestProcessor subclass.

The default implementation delegates to the DelegatingActionUtils class as much as possible, to reuse as much code as possible with DelegatingRequestProcessor and DelegatingTilesRequestProcessor.

Note: The idea of delegating to Spring-managed Struts Actions originated in Don Brown's Spring Struts Plugin. ContextLoaderPlugIn and DelegatingActionProxy constitute a clean-room implementation of the same idea, essentially superseding the original plugin. Many thanks to Don Brown and Matt Raible for the original work and for the agreement to reimplement the idea in Spring proper!

Since:
1.0.1
Author:
Juergen Hoeller
See Also:
determineActionBeanName(org.apache.struts.action.ActionMapping), DelegatingRequestProcessor, DelegatingTilesRequestProcessor, DelegatingActionUtils, ContextLoaderPlugIn

Field Summary
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
Constructor Summary
DelegatingActionProxy()
Deprecated.
Method Summary
protected String | determineActionBeanName(ActionMapping mapping) Deprecated. Determine the name of the Action bean, to be looked up in the WebApplicationContext.
ActionForward | execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) Deprecated. Pass the execute call on to the Spring-managed delegate Action.
protected Action | getDelegateAction(ActionMapping mapping) Deprecated. Return the delegate Action for the given mapping.
protected WebApplicationContext | getWebApplicationContext(ActionServlet actionServlet, ModuleConfig moduleConfig) Deprecated. Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, falling back to the root WebApplicationContext.
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DelegatingActionProxy

public DelegatingActionProxy()
Deprecated.
Method Detail

execute

public ActionForward execute(ActionMapping mapping,
                             ActionForm form,
                             HttpServletRequest request,
                             HttpServletResponse response)
                      throws Exception
Deprecated.
Pass the execute call on to the Spring-managed delegate Action.

Overrides:
execute in class Action
Throws:
Exception
See Also:
getDelegateAction(org.apache.struts.action.ActionMapping)

getDelegateAction

protected Action getDelegateAction(ActionMapping mapping)
                            throws BeansException
Deprecated.
Return the delegate Action for the given mapping.

The default implementation determines a bean name from the given ActionMapping and looks up the corresponding bean in the WebApplicationContext.

Parameters:
mapping - the Struts ActionMapping
Returns:
the delegate Action
Throws:
BeansException - if thrown by WebApplicationContext methods
See Also:
determineActionBeanName(org.apache.struts.action.ActionMapping)

getWebApplicationContext

protected WebApplicationContext getWebApplicationContext(ActionServlet actionServlet,
                                                         ModuleConfig moduleConfig)
                                                  throws IllegalStateException
Deprecated.
Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, falling back to the root WebApplicationContext.

This context is supposed to contain the Struts Action beans to delegate to.

Parameters:
actionServlet - the associated ActionServlet
moduleConfig - the associated ModuleConfig
Returns:
the WebApplicationContext
Throws:
IllegalStateException - if no WebApplicationContext could be found
See Also:
DelegatingActionUtils.findRequiredWebApplicationContext(org.apache.struts.action.ActionServlet, org.apache.struts.config.ModuleConfig), ContextLoaderPlugIn.SERVLET_CONTEXT_PREFIX

determineActionBeanName

protected String determineActionBeanName(ActionMapping mapping)
Deprecated.
Determine the name of the Action bean, to be looked up in the WebApplicationContext.

The default implementation takes the mapping path and prepends the module prefix, if any.

Parameters:
mapping - the Struts ActionMapping
Returns:
the name of the Action bean
See Also:
DelegatingActionUtils.determineActionBeanName(org.apache.struts.action.ActionMapping),
ActionConfig.getPath(),
ModuleConfig.getPrefix()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DelegatingActionUtils

org.springframework.web.struts
Class DelegatingActionUtils

java.lang.Object
    extended by  org.springframework.web.struts.DelegatingActionUtils
Deprecated. as of Spring 3.0

@Deprecated
public abstract class DelegatingActionUtils
extends Object

Common methods for letting Struts Actions work with a Spring WebApplicationContext.

As everything in Struts is based on concrete inheritance, we have to provide an Action subclass (DelegatingActionProxy) and two RequestProcessor subclasses (DelegatingRequestProcessor and DelegatingTilesRequestProcessor). The only way to share common functionality is a utility class like this one.

Since:
1.0.2
Author:
Juergen Hoeller
See Also:
DelegatingActionProxy, DelegatingRequestProcessor, DelegatingTilesRequestProcessor

Field Summary
static String | AUTOWIRE_BY_NAME Deprecated. Value of the autowire init-param that indicates autowiring by name: "byName"
static String | AUTOWIRE_BY_TYPE Deprecated. Value of the autowire init-param that indicates autowiring by type: "byType"
static String | PARAM_AUTOWIRE Deprecated. The name of the autowire init-param specified on the Struts ActionServlet: "spring.autowire"
static String | PARAM_DEPENDENCY_CHECK Deprecated. The name of the dependency check init-param specified on the Struts ActionServlet: "spring.dependencyCheck"
Constructor Summary
DelegatingActionUtils()
Deprecated.
Method Summary
static String | determineActionBeanName(ActionMapping mapping) Deprecated. Default implementation of Action bean determination, taking the mapping path and prepending the module prefix, if any.
static WebApplicationContext | findRequiredWebApplicationContext(ActionServlet actionServlet, ModuleConfig moduleConfig) Deprecated. Find most specific context available: check ContextLoaderPlugIn's WebApplicationContext first, fall back to root WebApplicationContext else.
static int | getAutowireMode(ActionServlet actionServlet) Deprecated. Determine the autowire mode from the "autowire" init-param of the Struts ActionServlet, falling back to "AUTOWIRE_BY_TYPE" as default.
static boolean | getDependencyCheck(ActionServlet actionServlet) Deprecated. Determine the dependency check to use from the "dependencyCheck" init-param of the Struts ActionServlet, falling back to no dependency check as default.
static WebApplicationContext | getRequiredWebApplicationContext(ActionServlet actionServlet, ModuleConfig moduleConfig) Deprecated. Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext.
static WebApplicationContext | getWebApplicationContext(ActionServlet actionServlet, ModuleConfig moduleConfig) Deprecated. Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

PARAM_AUTOWIRE

public static final String PARAM_AUTOWIRE
Deprecated.
The name of the autowire init-param specified on the Struts ActionServlet: "spring.autowire"

See Also:
Constant Field Values

PARAM_DEPENDENCY_CHECK

public static final String PARAM_DEPENDENCY_CHECK
Deprecated.
The name of the dependency check init-param specified on the Struts ActionServlet: "spring.dependencyCheck"

See Also:
Constant Field Values

AUTOWIRE_BY_NAME

public static final String AUTOWIRE_BY_NAME
Deprecated.
Value of the autowire init-param that indicates autowiring by name: "byName"

See Also:
Constant Field Values

AUTOWIRE_BY_TYPE

public static final String AUTOWIRE_BY_TYPE
Deprecated.
Value of the autowire init-param that indicates autowiring by type: "byType"

See Also:
Constant Field Values
Constructor Detail

DelegatingActionUtils

public DelegatingActionUtils()
Deprecated.
Method Detail

getWebApplicationContext

public static WebApplicationContext getWebApplicationContext(ActionServlet actionServlet,
                                                             ModuleConfig moduleConfig)
Deprecated.
Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext.

Checks for a module-specific context first, falling back to the context for the default module else.

Parameters:
actionServlet - the associated ActionServlet
moduleConfig - the associated ModuleConfig (can be null)
Returns:
the WebApplicationContext, or null if none
See Also:
ContextLoaderPlugIn.SERVLET_CONTEXT_PREFIX

getRequiredWebApplicationContext

public static WebApplicationContext getRequiredWebApplicationContext(ActionServlet actionServlet,
                                                                     ModuleConfig moduleConfig)
                                                              throws IllegalStateException
Deprecated.
Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext.

Checks for a module-specific context first, falling back to the context for the default module else.

Parameters:
actionServlet - the associated ActionServlet
moduleConfig - the associated ModuleConfig (can be null)
Returns:
the WebApplicationContext
Throws:
IllegalStateException - if no WebApplicationContext could be found
See Also:
ContextLoaderPlugIn.SERVLET_CONTEXT_PREFIX

findRequiredWebApplicationContext

public static WebApplicationContext findRequiredWebApplicationContext(ActionServlet actionServlet,
                                                                      ModuleConfig moduleConfig)
                                                               throws IllegalStateException
Deprecated.
Find most specific context available: check ContextLoaderPlugIn's WebApplicationContext first, fall back to root WebApplicationContext else.

When checking the ContextLoaderPlugIn context: checks for a module-specific context first, falling back to the context for the default module else.

Parameters:
actionServlet - the associated ActionServlet
moduleConfig - the associated ModuleConfig (can be null)
Returns:
the WebApplicationContext
Throws:
IllegalStateException - if no WebApplicationContext could be found
See Also:
getWebApplicationContext(org.apache.struts.action.ActionServlet, org.apache.struts.config.ModuleConfig), WebApplicationContextUtils.getRequiredWebApplicationContext(javax.servlet.ServletContext)

determineActionBeanName

public static String determineActionBeanName(ActionMapping mapping)
Deprecated.
Default implementation of Action bean determination, taking the mapping path and prepending the module prefix, if any.

Parameters:
mapping - the Struts ActionMapping
Returns:
the name of the Action bean
See Also:
ActionConfig.getPath(), ModuleConfig.getPrefix()

getAutowireMode

public static int getAutowireMode(ActionServlet actionServlet)
Deprecated.
Determine the autowire mode from the "autowire" init-param of the Struts ActionServlet, falling back to "AUTOWIRE_BY_TYPE" as default.

Parameters:
actionServlet - the Struts ActionServlet
Returns:
the autowire mode to use
See Also:
PARAM_AUTOWIRE, AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AutowireCapableBeanFactory.autowireBeanProperties(java.lang.Object, int, boolean), AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE, AutowireCapableBeanFactory.AUTOWIRE_BY_NAME

getDependencyCheck

public static boolean getDependencyCheck(ActionServlet actionServlet)
Deprecated.
Determine the dependency check to use from the "dependencyCheck" init-param of the Struts ActionServlet, falling back to no dependency check as default.

Parameters:
actionServlet - the Struts ActionServlet
Returns:
whether to enforce a dependency check or not
See Also:
PARAM_DEPENDENCY_CHECK, AutowireCapableBeanFactory.autowireBeanProperties(java.lang.Object, int, boolean)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DelegatingRequestProcessor

org.springframework.web.struts
Class DelegatingRequestProcessor

java.lang.Object
    extended by  org.apache.struts.action.RequestProcessor
        extended by  org.springframework.web.struts.DelegatingRequestProcessor
Deprecated. as of Spring 3.0

@Deprecated
public class DelegatingRequestProcessor
extends RequestProcessor

Subclass of Struts's default RequestProcessor that looks up Spring-managed Struts Actions defined in ContextLoaderPlugIn's WebApplicationContext (or, as a fallback, in the root WebApplicationContext).

In the Struts config file, you can either specify the original Action class (as when generated by XDoclet), or no Action class at all. In any case, Struts will delegate to an Action bean in the ContextLoaderPlugIn context.

<action path="/login" type="myapp.MyAction"/>
or
<action path="/login"/>
The name of the Action bean in the WebApplicationContext will be determined from the mapping path and module prefix. This can be customized by overriding the determineActionBeanName(org.apache.struts.action.ActionMapping) method.

Example:

  • mapping path "/login" -> bean name "/login"
  • mapping path "/login", module prefix "/mymodule" -> bean name "/mymodule/login"

A corresponding bean definition in the ContextLoaderPlugin context would look as follows; notice that the Action is now able to leverage fully Spring's configuration facilities:

 <bean name="/login" class="myapp.MyAction">
   <property name="...">...</property>
 </bean>
Note that you can use a single ContextLoaderPlugIn for all Struts modules. That context can in turn be loaded from multiple XML files, for example split according to Struts modules. Alternatively, define one ContextLoaderPlugIn per Struts module, specifying appropriate "contextConfigLocation" parameters. In both cases, the Spring bean name has to include the module prefix.

If you also need the Tiles setup functionality of the original TilesRequestProcessor, use DelegatingTilesRequestProcessor. As there is just a single central class to customize in Struts, we have to provide another subclass here, covering both the Tiles and the Spring delegation aspect.

If this RequestProcessor conflicts with the need for a different RequestProcessor subclass (other than TilesRequestProcessor), consider using DelegatingActionProxy as the Struts Action type in your struts-config file.

The default implementation delegates to the DelegatingActionUtils class as much as possible, to reuse as much code as possible despite the need to provide two RequestProcessor subclasses. If you need to subclass yet another RequestProcessor, take this class as a template, delegating to DelegatingActionUtils just like it.

Since:
1.0.2
Author:
Juergen Hoeller
See Also:
determineActionBeanName(org.apache.struts.action.ActionMapping), DelegatingTilesRequestProcessor, DelegatingActionProxy, DelegatingActionUtils, ContextLoaderPlugIn

Field Summary
Fields inherited from class org.apache.struts.action.RequestProcessor
actions, INCLUDE_PATH_INFO, INCLUDE_SERVLET_PATH, log, moduleConfig, servlet
Constructor Summary
DelegatingRequestProcessor()
Deprecated.
Method Summary
protected String | determineActionBeanName(ActionMapping mapping) Deprecated. Determine the name of the Action bean, to be looked up in the WebApplicationContext.
protected Action | getDelegateAction(ActionMapping mapping) Deprecated. Return the delegate Action for the given mapping.
protected WebApplicationContext | getWebApplicationContext() Deprecated. Return the WebApplicationContext that this processor delegates to.
void | init(ActionServlet actionServlet, ModuleConfig moduleConfig) Deprecated.
protected WebApplicationContext | initWebApplicationContext(ActionServlet actionServlet, ModuleConfig moduleConfig) Deprecated. Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, falling back to the root WebApplicationContext.
protected Action | processActionCreate(HttpServletRequest request, HttpServletResponse response, ActionMapping mapping) Deprecated. Override the base class method to return the delegate action.
Methods inherited from class org.apache.struts.action.RequestProcessor
destroy, doForward, doInclude, getInternal, getServletContext, internalModuleRelativeForward, internalModuleRelativeInclude, log, log, process, processActionForm, processActionPerform, processCachedMessages, processContent, processException, processForward, processForwardConfig, processInclude, processLocale, processMapping, processMultipart, processNoCache, processPath, processPopulate, processPreprocess, processRoles, processValidate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DelegatingRequestProcessor

public DelegatingRequestProcessor()
Deprecated.
Method Detail

init

public void init(ActionServlet actionServlet,
                 ModuleConfig moduleConfig)
          throws ServletException
Deprecated.
Overrides:
init in class RequestProcessor
Throws:
ServletException

initWebApplicationContext

protected WebApplicationContext initWebApplicationContext(ActionServlet actionServlet,
                                                          ModuleConfig moduleConfig)
                                                   throws IllegalStateException
Deprecated.
Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, falling back to the root WebApplicationContext.

This context is supposed to contain the Struts Action beans to delegate to.

Parameters:
actionServlet - the associated ActionServlet
moduleConfig - the associated ModuleConfig
Returns:
the WebApplicationContext
Throws:
IllegalStateException - if no WebApplicationContext could be found
See Also:
DelegatingActionUtils.findRequiredWebApplicationContext(org.apache.struts.action.ActionServlet, org.apache.struts.config.ModuleConfig), ContextLoaderPlugIn.SERVLET_CONTEXT_PREFIX

getWebApplicationContext

protected final WebApplicationContext getWebApplicationContext()
Deprecated.
Return the WebApplicationContext that this processor delegates to.

processActionCreate

protected Action processActionCreate(HttpServletRequest request,
                                     HttpServletResponse response,
                                     ActionMapping mapping)
                              throws IOException
Deprecated.
Override the base class method to return the delegate action.

Overrides:
processActionCreate in class RequestProcessor
Throws:
IOException
See Also:
getDelegateAction(org.apache.struts.action.ActionMapping)

getDelegateAction

protected Action getDelegateAction(ActionMapping mapping)
                            throws BeansException
Deprecated.
Return the delegate Action for the given mapping.

The default implementation determines a bean name from the given ActionMapping and looks up the corresponding bean in the WebApplicationContext.

Parameters:
mapping - the Struts ActionMapping
Returns:
the delegate Action, or null if none found
Throws:
BeansException - if thrown by WebApplicationContext methods
See Also:
determineActionBeanName(org.apache.struts.action.ActionMapping)

determineActionBeanName

protected String determineActionBeanName(ActionMapping mapping)
Deprecated.
Determine the name of the Action bean, to be looked up in the WebApplicationContext.

The default implementation takes the mapping path and prepends the module prefix, if any.

Parameters:
mapping - the Struts ActionMapping
Returns:
the name of the Action bean
See Also:
DelegatingActionUtils.determineActionBeanName(org.apache.struts.action.ActionMapping),
ActionConfig.getPath(),
ModuleConfig.getPrefix()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DelegatingTilesRequestProcessor

org.springframework.web.struts
Class DelegatingTilesRequestProcessor

java.lang.Object
    extended by  org.apache.struts.action.RequestProcessor
        extended by  org.apache.struts.tiles.TilesRequestProcessor
            extended by  org.springframework.web.struts.DelegatingTilesRequestProcessor
Deprecated. as of Spring 3.0

@Deprecated
public class DelegatingTilesRequestProcessor
extends TilesRequestProcessor

Subclass of Struts's TilesRequestProcessor that autowires Struts Actions defined in ContextLoaderPlugIn's WebApplicationContext (or, as a fallback, in the root WebApplicationContext).

Behaves like DelegatingRequestProcessor, but also provides the Tiles functionality of the original TilesRequestProcessor. As there's just a single central class to customize in Struts, we have to provide another subclass here, covering both the Tiles and the Spring delegation aspect.

The default implementation delegates to the DelegatingActionUtils class as fas as possible, to reuse as much code as possible despite the need to provide two RequestProcessor subclasses. If you need to subclass yet another RequestProcessor, take this class as a template, delegating to DelegatingActionUtils just like it.

Since:
1.0.2
Author:
Juergen Hoeller
See Also:
DelegatingRequestProcessor, DelegatingActionProxy, DelegatingActionUtils, ContextLoaderPlugIn

Field Summary
Fields inherited from class org.apache.struts.tiles.TilesRequestProcessor
definitionsFactory, log
Fields inherited from class org.apache.struts.action.RequestProcessor
actions, INCLUDE_PATH_INFO, INCLUDE_SERVLET_PATH, moduleConfig, servlet
Constructor Summary
DelegatingTilesRequestProcessor()
Deprecated.
Method Summary
protected String | determineActionBeanName(ActionMapping mapping) Deprecated. Determine the name of the Action bean, to be looked up in the WebApplicationContext.
protected Action | getDelegateAction(ActionMapping mapping) Deprecated. Return the delegate Action for the given mapping.
protected WebApplicationContext | getWebApplicationContext() Deprecated. Return the WebApplicationContext that this processor delegates to.
void | init(ActionServlet actionServlet, ModuleConfig moduleConfig) Deprecated.
protected WebApplicationContext | initWebApplicationContext(ActionServlet actionServlet, ModuleConfig moduleConfig) Deprecated. Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, falling back to the root WebApplicationContext.
protected Action | processActionCreate(HttpServletRequest request, HttpServletResponse response, ActionMapping mapping) Deprecated. Override the base class method to return the delegate action.
Methods inherited from class org.apache.struts.tiles.TilesRequestProcessor
doForward, getDefinitionsFactory, initDefinitionsMapping, internalModuleRelativeForward, internalModuleRelativeInclude, processForwardConfig, processTilesDefinition
Methods inherited from class org.apache.struts.action.RequestProcessor
destroy, doInclude, getInternal, getServletContext, log, log, process, processActionForm, processActionPerform, processCachedMessages, processContent, processException, processForward, processInclude, processLocale, processMapping, processMultipart, processNoCache, processPath, processPopulate, processPreprocess, processRoles, processValidate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DelegatingTilesRequestProcessor

public DelegatingTilesRequestProcessor()
Deprecated.
Method Detail

init

public void init(ActionServlet actionServlet,
                 ModuleConfig moduleConfig)
          throws ServletException
Deprecated.
Overrides:
init in class TilesRequestProcessor
Throws:
ServletException

initWebApplicationContext

protected WebApplicationContext initWebApplicationContext(ActionServlet actionServlet,
                                                          ModuleConfig moduleConfig)
                                                   throws IllegalStateException
Deprecated.
Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, falling back to the root WebApplicationContext. This context is supposed to contain the Struts Action beans to delegate to.

Parameters:
actionServlet - the associated ActionServlet
moduleConfig - the associated ModuleConfig
Returns:
the WebApplicationContext
Throws:
IllegalStateException - if no WebApplicationContext could be found
See Also:
DelegatingActionUtils.findRequiredWebApplicationContext(org.apache.struts.action.ActionServlet, org.apache.struts.config.ModuleConfig), ContextLoaderPlugIn.SERVLET_CONTEXT_PREFIX

getWebApplicationContext

protected final WebApplicationContext getWebApplicationContext()
Deprecated.
Return the WebApplicationContext that this processor delegates to.

processActionCreate

protected Action processActionCreate(HttpServletRequest request,
                                     HttpServletResponse response,
                                     ActionMapping mapping)
                              throws IOException
Deprecated.
Override the base class method to return the delegate action.

Overrides:
processActionCreate in class RequestProcessor
Throws:
IOException
See Also:
getDelegateAction(org.apache.struts.action.ActionMapping)

getDelegateAction

protected Action getDelegateAction(ActionMapping mapping)
                            throws BeansException
Deprecated.
Return the delegate Action for the given mapping.

The default implementation determines a bean name from the given ActionMapping and looks up the corresponding bean in the WebApplicationContext.

Parameters:
mapping - the Struts ActionMapping
Returns:
the delegate Action, or null if none found
Throws:
BeansException - if thrown by WebApplicationContext methods
See Also:
determineActionBeanName(org.apache.struts.action.ActionMapping)

determineActionBeanName

protected String determineActionBeanName(ActionMapping mapping)
Deprecated.
Determine the name of the Action bean, to be looked up in the WebApplicationContext.

The default implementation takes the mapping path and prepends the module prefix, if any.

Parameters:
mapping - the Struts ActionMapping
Returns:
the name of the Action bean
See Also:
DelegatingActionUtils.determineActionBeanName(org.apache.struts.action.ActionMapping),
ActionConfig.getPath(),
ModuleConfig.getPrefix()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DispatchActionSupport

org.springframework.web.struts
Class DispatchActionSupport

java.lang.Object
    extended by  org.apache.struts.action.Action
        extended by  org.apache.struts.actions.DispatchAction
            extended by  org.springframework.web.struts.DispatchActionSupport
Deprecated. as of Spring 3.0

@Deprecated
public abstract class DispatchActionSupport
extends DispatchAction

Convenience class for Spring-aware Struts 1.1+ DispatchActions.

Provides a reference to the current Spring application context, e.g. for bean lookup or resource loading. Auto-detects a ContextLoaderPlugIn context, falling back to the root WebApplicationContext. For typical usage, i.e. accessing middle tier beans, use a root WebApplicationContext.

For classic Struts Actions or Lookup/MappingDispatchActions, use the analogous ActionSupport or LookupDispatchActionSupport / MappingDispatchActionSupport class, respectively.

As an alternative approach, you can wire your Struts Actions themselves as Spring beans, passing references to them via IoC rather than looking up references in a programmatic fashion. Check out DelegatingActionProxy and DelegatingRequestProcessor.

Since:
1.0.1
Author:
Juergen Hoeller
See Also:
ContextLoaderPlugIn.SERVLET_CONTEXT_PREFIX, WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, ContextLoaderListener, org.springframework.web.context.ContextLoaderServlet, ActionSupport, LookupDispatchActionSupport, MappingDispatchActionSupport, DelegatingActionProxy, DelegatingRequestProcessor

Field Summary
Fields inherited from class org.apache.struts.actions.DispatchAction
clazz, log, messages, methods, types
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
Constructor Summary
DispatchActionSupport()
Deprecated.
Method Summary
protected MessageSourceAccessor | getMessageSourceAccessor() Deprecated. Return a MessageSourceAccessor for the application context used by this object, for easy message access.
protected ServletContext | getServletContext() Deprecated. Return the current ServletContext.
protected File | getTempDir() Deprecated. Return the temporary directory for the current web application, as provided by the servlet container.
protected WebApplicationContext | getWebApplicationContext() Deprecated. Return the current Spring WebApplicationContext.
protected WebApplicationContext | initWebApplicationContext(ActionServlet actionServlet) Deprecated. Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, falling back to the root WebApplicationContext (the usual case).
protected void | onDestroy() Deprecated. Callback for custom destruction when the ActionServlet shuts down.
protected void | onInit() Deprecated. Callback for custom initialization after the context has been set up.
void | setServlet(ActionServlet actionServlet) Deprecated. Initialize the WebApplicationContext for this Action.
Methods inherited from class org.apache.struts.actions.DispatchAction
cancelled, dispatchMethod, execute, getMethod, getMethodName, getParameter, unspecified
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DispatchActionSupport

public DispatchActionSupport()
Deprecated.
Method Detail

setServlet

public void setServlet(ActionServlet actionServlet)
Deprecated.
Initialize the WebApplicationContext for this Action. Invokes onInit after successful initialization of the context.

Overrides:
setServlet in class Action
See Also:
initWebApplicationContext(org.apache.struts.action.ActionServlet), onInit()

initWebApplicationContext

protected WebApplicationContext initWebApplicationContext(ActionServlet actionServlet)
                                                   throws IllegalStateException
Deprecated.
Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, falling back to the root WebApplicationContext (the usual case).

Parameters:
actionServlet - the associated ActionServlet
Returns:
the WebApplicationContext
Throws:
IllegalStateException - if no WebApplicationContext could be found
See Also:
DelegatingActionUtils.findRequiredWebApplicationContext(org.apache.struts.action.ActionServlet, org.apache.struts.config.ModuleConfig)

getWebApplicationContext

protected final WebApplicationContext getWebApplicationContext()
Deprecated.
Return the current Spring WebApplicationContext.

getMessageSourceAccessor

protected final MessageSourceAccessor getMessageSourceAccessor()
Deprecated.
Return a MessageSourceAccessor for the application context used by this object, for easy message access.

getServletContext

protected final ServletContext getServletContext()
Deprecated.
Return the current ServletContext.

getTempDir

protected final File getTempDir()
Deprecated.
Return the temporary directory for the current web application, as provided by the servlet container.

Returns:
the File representing the temporary directory

onInit

protected void onInit()
Deprecated.
Callback for custom initialization after the context has been set up.

See Also:
setServlet(org.apache.struts.action.ActionServlet)

onDestroy

protected void onDestroy()
Deprecated.
Callback for custom destruction when the ActionServlet shuts down.

See Also:
setServlet(org.apache.struts.action.ActionServlet)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LookupDispatchActionSupport

org.springframework.web.struts
Class LookupDispatchActionSupport

java.lang.Object
    extended by  org.apache.struts.action.Action
        extended by  org.apache.struts.actions.DispatchAction
            extended by  org.apache.struts.actions.LookupDispatchAction
                extended by  org.springframework.web.struts.LookupDispatchActionSupport
Deprecated. as of Spring 3.0

@Deprecated
public abstract class LookupDispatchActionSupport
extends LookupDispatchAction

Convenience class for Spring-aware Struts 1.1+ LookupDispatchActions.

Provides a reference to the current Spring application context, e.g. for bean lookup or resource loading. Auto-detects a ContextLoaderPlugIn context, falling back to the root WebApplicationContext. For typical usage, i.e. accessing middle tier beans, use a root WebApplicationContext.

For classic Struts Actions, DispatchActions or MappingDispatchActions, use the analogous ActionSupport or DispatchActionSupport / MappingDispatchActionSupport class.

As an alternative approach, you can wire your Struts Actions themselves as Spring beans, passing references to them via IoC rather than looking up references in a programmatic fashion. Check out DelegatingActionProxy and DelegatingRequestProcessor.

Since:
1.1
Author:
Juergen Hoeller
See Also:
ContextLoaderPlugIn.SERVLET_CONTEXT_PREFIX, WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, ContextLoaderListener, org.springframework.web.context.ContextLoaderServlet, ActionSupport, DispatchActionSupport, MappingDispatchActionSupport, DelegatingActionProxy, DelegatingRequestProcessor

Field Summary
Fields inherited from class org.apache.struts.actions.LookupDispatchAction
keyMethodMap, localeMap
Fields inherited from class org.apache.struts.actions.DispatchAction
clazz, log, messages, methods, types
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
Constructor Summary
LookupDispatchActionSupport()
Deprecated.
Method Summary
protected MessageSourceAccessor | getMessageSourceAccessor() Deprecated. Return a MessageSourceAccessor for the application context used by this object, for easy message access.
protected ServletContext | getServletContext() Deprecated. Return the current ServletContext.
protected File | getTempDir() Deprecated. Return the temporary directory for the current web application, as provided by the servlet container.
protected WebApplicationContext | getWebApplicationContext() Deprecated. Return the current Spring WebApplicationContext.
protected WebApplicationContext | initWebApplicationContext(ActionServlet actionServlet) Deprecated. Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, falling back to the root WebApplicationContext (the usual case).
protected void | onDestroy() Deprecated. Callback for custom destruction when the ActionServlet shuts down.
protected void | onInit() Deprecated. Callback for custom initialization after the context has been set up.
void | setServlet(ActionServlet actionServlet) Deprecated. Initialize the WebApplicationContext for this Action.
Methods inherited from class org.apache.struts.actions.LookupDispatchAction
execute, getKeyMethodMap, getLookupMapName, getMethodName
Methods inherited from class org.apache.struts.actions.DispatchAction
cancelled, dispatchMethod, getMethod, getParameter, unspecified
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

LookupDispatchActionSupport

public LookupDispatchActionSupport()
Deprecated.
Method Detail

setServlet

public void setServlet(ActionServlet actionServlet)
Deprecated.
Initialize the WebApplicationContext for this Action. Invokes onInit after successful initialization of the context.

Overrides:
setServlet in class Action
See Also:
initWebApplicationContext(org.apache.struts.action.ActionServlet), onInit()

initWebApplicationContext

protected WebApplicationContext initWebApplicationContext(ActionServlet actionServlet)
                                                   throws IllegalStateException
Deprecated.
Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, falling back to the root WebApplicationContext (the usual case).

Parameters:
actionServlet - the associated ActionServlet
Returns:
the WebApplicationContext
Throws:
IllegalStateException - if no WebApplicationContext could be found
See Also:
DelegatingActionUtils.findRequiredWebApplicationContext(org.apache.struts.action.ActionServlet, org.apache.struts.config.ModuleConfig)

getWebApplicationContext

protected final WebApplicationContext getWebApplicationContext()
Deprecated.
Return the current Spring WebApplicationContext.

getMessageSourceAccessor

protected final MessageSourceAccessor getMessageSourceAccessor()
Deprecated.
Return a MessageSourceAccessor for the application context used by this object, for easy message access.

getServletContext

protected final ServletContext getServletContext()
Deprecated.
Return the current ServletContext.

getTempDir

protected final File getTempDir()
Deprecated.
Return the temporary directory for the current web application, as provided by the servlet container.

Returns:
the File representing the temporary directory

onInit

protected void onInit()
Deprecated.
Callback for custom initialization after the context has been set up.

See Also:
setServlet(org.apache.struts.action.ActionServlet)

onDestroy

protected void onDestroy()
Deprecated.
Callback for custom destruction when the ActionServlet shuts down.

See Also:
setServlet(org.apache.struts.action.ActionServlet)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MappingDispatchActionSupport

org.springframework.web.struts
Class MappingDispatchActionSupport

java.lang.Object
    extended by  org.apache.struts.action.Action
        extended by  org.apache.struts.actions.DispatchAction
            extended by  org.apache.struts.actions.MappingDispatchAction
                extended by  org.springframework.web.struts.MappingDispatchActionSupport
Deprecated. as of Spring 3.0

@Deprecated
public abstract class MappingDispatchActionSupport
extends MappingDispatchAction

Convenience class for Spring-aware Struts 1.2 MappingDispatchActions.

Provides a reference to the current Spring application context, e.g. for bean lookup or resource loading. Auto-detects a ContextLoaderPlugIn context, falling back to the root WebApplicationContext. For typical usage, i.e. accessing middle tier beans, use a root WebApplicationContext.

For classic Struts Actions, DispatchActions or LookupDispatchActions, use the analogous ActionSupport or DispatchActionSupport / LookupDispatchActionSupport class.

As an alternative approach, you can wire your Struts Actions themselves as Spring beans, passing references to them via IoC rather than looking up references in a programmatic fashion. Check out DelegatingActionProxy and DelegatingRequestProcessor.

Since:
1.1.3
Author:
Juergen Hoeller
See Also:
ContextLoaderPlugIn.SERVLET_CONTEXT_PREFIX, WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, ContextLoaderListener, org.springframework.web.context.ContextLoaderServlet, ActionSupport, DispatchActionSupport, LookupDispatchActionSupport, DelegatingActionProxy, DelegatingRequestProcessor

Field Summary
Fields inherited from class org.apache.struts.actions.DispatchAction
clazz, messages, methods, types
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
Constructor Summary
MappingDispatchActionSupport()
Deprecated.
Method Summary
protected MessageSourceAccessor | getMessageSourceAccessor() Deprecated. Return a MessageSourceAccessor for the application context used by this object, for easy message access.
protected ServletContext | getServletContext() Deprecated. Return the current ServletContext.
protected File | getTempDir() Deprecated. Return the temporary directory for the current web application, as provided by the servlet container.
protected WebApplicationContext | getWebApplicationContext() Deprecated. Return the current Spring WebApplicationContext.
protected WebApplicationContext | initWebApplicationContext(ActionServlet actionServlet) Deprecated. Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, falling back to the root WebApplicationContext (the usual case).
protected void | onDestroy() Deprecated. Callback for custom destruction when the ActionServlet shuts down.
protected void | onInit() Deprecated. Callback for custom initialization after the context has been set up.
void | setServlet(ActionServlet actionServlet) Deprecated. Initialize the WebApplicationContext for this Action.
Methods inherited from class org.apache.struts.actions.MappingDispatchAction
execute, getMethodName, unspecified
Methods inherited from class org.apache.struts.actions.DispatchAction
cancelled, dispatchMethod, getMethod, getParameter
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MappingDispatchActionSupport

public MappingDispatchActionSupport()
Deprecated.
Method Detail

setServlet

public void setServlet(ActionServlet actionServlet)
Deprecated.
Initialize the WebApplicationContext for this Action. Invokes onInit after successful initialization of the context.

Overrides:
setServlet in class Action
See Also:
initWebApplicationContext(org.apache.struts.action.ActionServlet), onInit()

initWebApplicationContext

protected WebApplicationContext initWebApplicationContext(ActionServlet actionServlet)
                                                   throws IllegalStateException
Deprecated.
Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, falling back to the root WebApplicationContext (the usual case).

Parameters:
actionServlet - the associated ActionServlet
Returns:
the WebApplicationContext
Throws:
IllegalStateException - if no WebApplicationContext could be found
See Also:
DelegatingActionUtils.findRequiredWebApplicationContext(org.apache.struts.action.ActionServlet, org.apache.struts.config.ModuleConfig)

getWebApplicationContext

protected final WebApplicationContext getWebApplicationContext()
Deprecated.
Return the current Spring WebApplicationContext.

getMessageSourceAccessor

protected final MessageSourceAccessor getMessageSourceAccessor()
Deprecated.
Return a MessageSourceAccessor for the application context used by this object, for easy message access.

getServletContext

protected final ServletContext getServletContext()
Deprecated.
Return the current ServletContext.

getTempDir

protected final File getTempDir()
Deprecated.
Return the temporary directory for the current web application, as provided by the servlet container.

Returns:
the File representing the temporary directory

onInit

protected void onInit()
Deprecated.
Callback for custom initialization after the context has been set up.

See Also:
setServlet(org.apache.struts.action.ActionServlet)

onDestroy

protected void onDestroy()
Deprecated.
Callback for custom destruction when the ActionServlet shuts down.

See Also:
setServlet(org.apache.struts.action.ActionServlet)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SpringBindingActionForm

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.struts
Class SpringBindingActionForm

java.lang.Object
    extended by  org.apache.struts.action.ActionForm
        extended by  org.springframework.web.struts.SpringBindingActionForm
All Implemented Interfaces:
Serializable
Deprecated. as of Spring 3.0

@Deprecated
public class SpringBindingActionForm
extends ActionForm

A thin Struts ActionForm adapter that delegates to Spring's more complete and advanced data binder and Errors object underneath the covers to bind to POJOs and manage rejected values.

Exposes Spring-managed errors to the standard Struts view tags, through exposing a corresponding Struts ActionMessages object as request attribute. Also exposes current field values in a Struts-compliant fashion, including rejected values (which Spring's binding keeps even for non-String fields).

Consequently, Struts views can be written in a completely traditional fashion (with standard html:form, html:errors, etc), seamlessly accessing a Spring-bound POJO form object underneath.

Note this ActionForm is designed explicitly for use in request scope. It expects to receive an expose call from the Action, passing in the Errors object to expose plus the current HttpServletRequest.

Example definition in struts-config.xml:

 <form-beans>
   <form-bean name="actionForm" type="org.springframework.web.struts.SpringBindingActionForm"/>
 </form-beans>
Example code in a custom Struts Action:
 public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception {
   SpringBindingActionForm form = (SpringBindingActionForm) actionForm;
   MyPojoBean bean = ...;
   ServletRequestDataBinder binder = new ServletRequestDataBinder(bean, "myPojo");
   binder.bind(request);
   form.expose(binder.getBindingResult(), request);
   return actionMapping.findForward("success");
 }
This class is compatible with both Struts 1.2.x and Struts 1.1. On Struts 1.2, default messages registered with Spring binding errors are exposed when none of the error codes could be resolved. On Struts 1.1, this is not possible due to a limitation in the Struts message facility; hence, we expose the plain default error code there.

Since:
1.2.2
Author:
Keith Donald, Juergen Hoeller
See Also:
expose(org.springframework.validation.Errors, javax.servlet.http.HttpServletRequest), Serialized Form

Field Summary
Fields inherited from class org.apache.struts.action.ActionForm
multipartRequestHandler, servlet
Constructor Summary
SpringBindingActionForm()
Deprecated.
Method Summary
 void expose(Errors errors, HttpServletRequest request)
Deprecated. Set the Errors object that this SpringBindingActionForm is supposed to wrap.
Methods inherited from class org.apache.struts.action.ActionForm
getMultipartRequestHandler, getServlet, getServletWrapper, reset, reset, setMultipartRequestHandler, setServlet, validate, validate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SpringBindingActionForm

public SpringBindingActionForm()
Deprecated.
Method Detail

expose

public void expose(Errors errors,
                   HttpServletRequest request)
Deprecated.
Set the Errors object that this SpringBindingActionForm is supposed to wrap. The contained field values and errors will be exposed to the view, accessible through Struts standard tags.

Parameters:
errors - the Spring Errors object to wrap, usually taken from a DataBinder that has been used for populating a POJO form object
request - the HttpServletRequest to retrieve the attributes from
See Also:
DataBinder.getBindingResult()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


org.springframework.web.util

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package org.springframework.web.util

Miscellaneous web utility classes, such as HTML escaping, log4j initialization, and cookie handling.

See:
Description

Class Summary
CookieGenerator | Helper class for cookie generation, carrying cookie descriptor settings as bean properties and being able to add and remove cookie to/from a given response.
ExpressionEvaluationUtils | Convenience methods for accessing JSP 2.0's ExpressionEvaluator.
HtmlUtils | Utility class for HTML escaping.
HttpSessionMutexListener | Servlet 2.3 HttpSessionListener that automatically exposes the session mutex when an HttpSession gets created.
IntrospectorCleanupListener | Listener that flushes the JDK's JavaBeans Introspector cache on web app shutdown.
JavaScriptUtils | Utility class for JavaScript escaping.
Log4jConfigListener | Bootstrap listener for custom log4j initialization in a web environment.
Log4jWebConfigurer | Convenience class that performs custom log4j initialization for web environments, allowing for log file paths within the web application, with the option to perform automatic refresh checks (for runtime changes in logging configuration).
TagUtils | Utility class for tag library related code, exposing functionality such as translating Strings to web scopes.
UriTemplate | Represents a URI template.
UriUtils | Utility class for URI encoding and decoding based on RFC 3986.
UrlPathHelper | Helper class for URL path matching.
WebAppRootListener | Listener that sets a system property to the web application root directory.
WebUtils | Miscellaneous utilities for web applications.

Exception Summary
NestedServletException Subclass of ServletException that properly handles a root cause in terms of message and stacktrace, just like NestedChecked/RuntimeException does.

Package org.springframework.web.util Description

Miscellaneous web utility classes, such as HTML escaping, log4j initialization, and cookie handling.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES


org.springframework.web.util Class Hierarchy

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package org.springframework.web.util

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • org.springframework.web.util.CookieGenerator
    • org.springframework.web.util.ExpressionEvaluationUtils
    • org.springframework.web.util.HtmlUtils
    • org.springframework.web.util.HttpSessionMutexListener (implements javax.servlet.http.HttpSessionListener)
    • org.springframework.web.util.IntrospectorCleanupListener (implements javax.servlet.ServletContextListener)
    • org.springframework.web.util.JavaScriptUtils
    • org.springframework.web.util.Log4jConfigListener (implements javax.servlet.ServletContextListener)
    • org.springframework.web.util.Log4jWebConfigurer
    • org.springframework.web.util.TagUtils
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • javax.servlet.ServletException
          • org.springframework.web.util.NestedServletException
    • org.springframework.web.util.UriTemplate
    • org.springframework.web.util.UriUtils
    • org.springframework.web.util.UrlPathHelper
    • org.springframework.web.util.WebAppRootListener (implements javax.servlet.ServletContextListener)
    • org.springframework.web.util.WebUtils
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES


CookieGenerator

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.util
Class CookieGenerator

java.lang.Object
    extended by  org.springframework.web.util.CookieGenerator
Direct Known Subclasses:
CookieLocaleResolver, CookieThemeResolver
public class CookieGenerator
extends Object

Helper class for cookie generation, carrying cookie descriptor settings as bean properties and being able to add and remove cookie to/from a given response.

Can serve as base class for components that generate specific cookies, like CookieLocaleResolcer and CookieThemeResolver.

Since:
1.1.4
Author:
Juergen Hoeller
See Also:
addCookie(javax.servlet.http.HttpServletResponse, java.lang.String), removeCookie(javax.servlet.http.HttpServletResponse), CookieLocaleResolver, CookieThemeResolver

Field Summary
static int | DEFAULT_COOKIE_MAX_AGE Deprecated. in favor of setting no max age value at all in such a case
static String | DEFAULT_COOKIE_PATH Default path that cookies will be visible to: "/", i.e.
protected Log | logger
Constructor Summary
CookieGenerator()
Method Summary
void | addCookie(HttpServletResponse response, String cookieValue) Add a cookie with the given value to the response, using the cookie descriptor settings of this generator.
protected Cookie | createCookie(String cookieValue) Create a cookie with the given value, using the cookie descriptor settings of this generator (except for "cookieMaxAge").
String | getCookieDomain() Return the domain for cookies created by this generator, if any.
Integer | getCookieMaxAge() Return the maximum age for cookies created by this generator.
String | getCookieName() Return the given name for cookies created by this generator.
String | getCookiePath() Return the path for cookies created by this generator.
boolean | isCookieSecure() Return whether the cookie should only be sent using a secure protocol, such as HTTPS (SSL).
void | removeCookie(HttpServletResponse response) Remove the cookie that this generator describes from the response.
void | setCookieDomain(String cookieDomain) Use the given domain for cookies created by this generator.
void | setCookieMaxAge(Integer cookieMaxAge) Use the given maximum age (in seconds) for cookies created by this generator.
void | setCookieName(String cookieName) Use the given name for cookies created by this generator.
void | setCookiePath(String cookiePath) Use the given path for cookies created by this generator.
void | setCookieSecure(boolean cookieSecure) Set whether the cookie should only be sent using a secure protocol, such as HTTPS (SSL).
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_COOKIE_PATH

public static final String DEFAULT_COOKIE_PATH
Default path that cookies will be visible to: "/", i.e. the entire server.

See Also:
Constant Field Values

DEFAULT_COOKIE_MAX_AGE

@Deprecated
public static final int DEFAULT_COOKIE_MAX_AGE
Deprecated. in favor of setting no max age value at all in such a case
Default maximum age of cookies: maximum integer value, i.e. forever.

See Also:
Constant Field Values

logger

protected final Log logger
Constructor Detail

CookieGenerator

public CookieGenerator()
Method Detail

setCookieName

public void setCookieName(String cookieName)
Use the given name for cookies created by this generator.

getCookieName

public String getCookieName()
Return the given name for cookies created by this generator.

setCookieDomain

public void setCookieDomain(String cookieDomain)
Use the given domain for cookies created by this generator. The cookie is only visible to servers in this domain.

getCookieDomain

public String getCookieDomain()
Return the domain for cookies created by this generator, if any.

setCookiePath

public void setCookiePath(String cookiePath)
Use the given path for cookies created by this generator. The cookie is only visible to URLs in this path and below.

getCookiePath

public String getCookiePath()
Return the path for cookies created by this generator.

setCookieMaxAge

public void setCookieMaxAge(Integer cookieMaxAge)
Use the given maximum age (in seconds) for cookies created by this generator. Useful special value: -1 ... not persistent, deleted when client shuts down

getCookieMaxAge

public Integer getCookieMaxAge()
Return the maximum age for cookies created by this generator.

setCookieSecure

public void setCookieSecure(boolean cookieSecure)
Set whether the cookie should only be sent using a secure protocol, such as HTTPS (SSL). This is an indication to the receiving browser, not processed by the HTTP server itself. Default is "false".

isCookieSecure

public boolean isCookieSecure()
Return whether the cookie should only be sent using a secure protocol, such as HTTPS (SSL).

addCookie

public void addCookie(HttpServletResponse response,
                      String cookieValue)
Add a cookie with the given value to the response, using the cookie descriptor settings of this generator.

Delegates to createCookie(java.lang.String) for cookie creation.

Parameters:
response - the HTTP response to add the cookie to
cookieValue - the value of the cookie to add
See Also:
setCookieName(java.lang.String),
setCookieDomain(java.lang.String),
setCookiePath(java.lang.String),
setCookieMaxAge(java.lang.Integer)

removeCookie

public void removeCookie(HttpServletResponse response)
Remove the cookie that this generator describes from the response. Will generate a cookie with empty value and max age 0.

Delegates to createCookie(java.lang.String) for cookie creation.

Parameters:
response - the HTTP response to remove the cookie from
See Also:
setCookieName(java.lang.String),
setCookieDomain(java.lang.String),
setCookiePath(java.lang.String)

createCookie

protected Cookie createCookie(String cookieValue)
Create a cookie with the given value, using the cookie descriptor settings of this generator (except for "cookieMaxAge").

Parameters:
cookieValue - the value of the cookie to crate
Returns:
the cookie
See Also:
setCookieName(java.lang.String),
setCookieDomain(java.lang.String),
setCookiePath(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ExpressionEvaluationUtils

org.springframework.web.util
Class ExpressionEvaluationUtils

java.lang.Object
    extended by  org.springframework.web.util.ExpressionEvaluationUtils

public abstract class ExpressionEvaluationUtils
extends Object

Convenience methods for accessing JSP 2.0's ExpressionEvaluator.

The evaluation methods check if the value contains "${" before invoking the EL evaluator, treating the value as "normal" expression (i.e. a literal String value) else.

Since:
11.07.2003
Author:
Juergen Hoeller, Alef Arendsen
See Also:
ExpressionEvaluator.evaluate(java.lang.String, java.lang.Class, javax.servlet.jsp.el.VariableResolver, javax.servlet.jsp.el.FunctionMapper)

Field Summary
static String | EXPRESSION_PREFIX
static String | EXPRESSION_SUFFIX
Constructor Summary
ExpressionEvaluationUtils()
Method Summary
static Object | evaluate(String attrName, String attrValue, Class resultClass, PageContext pageContext) Evaluate the given expression (be it EL or a literal String value) to an Object of a given type,
static Object | evaluate(String attrName, String attrValue, PageContext pageContext) Evaluate the given expression (be it EL or a literal String value) to an Object.
static boolean | evaluateBoolean(String attrName, String attrValue, PageContext pageContext) Evaluate the given expression (be it EL or a literal String value) to a boolean.
static int | evaluateInteger(String attrName, String attrValue, PageContext pageContext) Evaluate the given expression (be it EL or a literal String value) to an integer.
static String | evaluateString(String attrName, String attrValue, PageContext pageContext) Evaluate the given expression (be it EL or a literal String value) to a String.
static boolean | isExpressionLanguage(String value) Check if the given expression value is an EL expression.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

EXPRESSION_PREFIX

public static final String EXPRESSION_PREFIX
See Also:
Constant Field Values

EXPRESSION_SUFFIX

public static final String EXPRESSION_SUFFIX
See Also:
Constant Field Values
Constructor Detail

ExpressionEvaluationUtils

public ExpressionEvaluationUtils()
Method Detail

isExpressionLanguage

public static boolean isExpressionLanguage(String value)
Check if the given expression value is an EL expression.

Parameters:
value - the expression to check
Returns:
true if the expression is an EL expression, false otherwise

evaluate

public static Object evaluate(String attrName,
                              String attrValue,
                              Class resultClass,
                              PageContext pageContext)
                       throws JspException
Evaluate the given expression (be it EL or a literal String value) to an Object of a given type,

Parameters:
attrName - name of the attribute (typically a JSP tag attribute)
attrValue - value of the attribute
resultClass - class that the result should have (String, Integer, Boolean)
pageContext - current JSP PageContext
Returns:
the result of the evaluation
Throws:
JspException - in case of parsing errors, also in case of type mismatch if the passed-in literal value is not an EL expression and not assignable to the result class

evaluate

public static Object evaluate(String attrName,
                              String attrValue,
                              PageContext pageContext)
                       throws JspException
Evaluate the given expression (be it EL or a literal String value) to an Object.

Parameters:
attrName - name of the attribute (typically a JSP tag attribute)
attrValue - value of the attribute
pageContext - current JSP PageContext
Returns:
the result of the evaluation
Throws:
JspException - in case of parsing errors

evaluateString

public static String evaluateString(String attrName,
                                    String attrValue,
                                    PageContext pageContext)
                             throws JspException
Evaluate the given expression (be it EL or a literal String value) to a String.

Parameters:
attrName - name of the attribute (typically a JSP tag attribute)
attrValue - value of the attribute
pageContext - current JSP PageContext
Returns:
the result of the evaluation
Throws:
JspException - in case of parsing errors

evaluateInteger

public static int evaluateInteger(String attrName,
                                  String attrValue,
                                  PageContext pageContext)
                           throws JspException
Evaluate the given expression (be it EL or a literal String value) to an integer.

Parameters:
attrName - name of the attribute (typically a JSP tag attribute)
attrValue - value of the attribute
pageContext - current JSP PageContext
Returns:
the result of the evaluation
Throws:
JspException - in case of parsing errors

evaluateBoolean

public static boolean evaluateBoolean(String attrName,
                                      String attrValue,
                                      PageContext pageContext)
                               throws JspException
Evaluate the given expression (be it EL or a literal String value) to a boolean.

Parameters:
attrName - name of the attribute (typically a JSP tag attribute)
attrValue - value of the attribute
pageContext - current JSP PageContext
Returns:
the result of the evaluation
Throws:
JspException - in case of parsing errors
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HtmlUtils

org.springframework.web.util
Class HtmlUtils

java.lang.Object
    extended by  org.springframework.web.util.HtmlUtils

public abstract class HtmlUtils
extends Object

Utility class for HTML escaping. Escapes and unescapes based on the W3C HTML 4.01 recommendation, handling character entity references.

Reference: http://www.w3.org/TR/html4/charset.html

For a comprehensive set of String escaping utilities, consider Jakarta Commons Lang and its StringEscapeUtils class. We are not using that class here to avoid a runtime dependency on Commons Lang just for HTML escaping. Furthermore, Spring's HTML escaping is more flexible and 100% HTML 4.0 compliant.

Since:
01.03.2003
Author:
Juergen Hoeller, Martin Kersten
See Also:
org.apache.commons.lang.StringEscapeUtils

Constructor Summary
HtmlUtils()
Method Summary
static String | htmlEscape(String input) Turn special characters into HTML character references.
static String | htmlEscapeDecimal(String input) Turn special characters into HTML character references.
static String | htmlEscapeHex(String input) Turn special characters into HTML character references.
static String | htmlUnescape(String input) Turn HTML character references into their plain text UNICODE equivalent.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

HtmlUtils

public HtmlUtils()
Method Detail

htmlEscape

public static String htmlEscape(String input)
Turn special characters into HTML character references. Handles complete character set defined in HTML 4.01 recommendation.

Escapes all special characters to their corresponding entity reference (e.g. <).

Reference: http://www.w3.org/TR/html4/sgml/entities.html

Parameters:
input - the (unescaped) input string
Returns:
the escaped string

htmlEscapeDecimal

public static String htmlEscapeDecimal(String input)
Turn special characters into HTML character references. Handles complete character set defined in HTML 4.01 recommendation.

Escapes all special characters to their corresponding numeric reference in decimal format (&#Decimal;).

Reference: http://www.w3.org/TR/html4/sgml/entities.html

Parameters:
input - the (unescaped) input string
Returns:
the escaped string

htmlEscapeHex

public static String htmlEscapeHex(String input)
Turn special characters into HTML character references. Handles complete character set defined in HTML 4.01 recommendation.

Escapes all special characters to their corresponding numeric reference in hex format (&#xHex;).

Reference: http://www.w3.org/TR/html4/sgml/entities.html

Parameters:
input - the (unescaped) input string
Returns:
the escaped string

htmlUnescape

public static String htmlUnescape(String input)
Turn HTML character references into their plain text UNICODE equivalent.

Handles complete character set defined in HTML 4.01 recommendation and all reference types (decimal, hex, and entity).

Correctly converts the following formats:

&#Entity; - (Example: &amp;) case sensitive &#Decimal; - (Example: &#68;)
&#xHex; - (Example: &#xE5;) case insensitive
Gracefully handles malformed character references by copying original characters as is when encountered.

Reference: http://www.w3.org/TR/html4/sgml/entities.html

Parameters:
input - the (escaped) input string
Returns:
the unescaped string
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HttpSessionMutexListener

org.springframework.web.util
Class HttpSessionMutexListener

java.lang.Object
    extended by  org.springframework.web.util.HttpSessionMutexListener
All Implemented Interfaces:
EventListener, HttpSessionListener
public class HttpSessionMutexListener
extends Object
implements HttpSessionListener

Servlet 2.3 HttpSessionListener that automatically exposes the session mutex when an HttpSession gets created. To be registered as a listener in web.xml.

The session mutex is guaranteed to be the same object during the entire lifetime of the session, available under the key defined by the SESSION_MUTEX_ATTRIBUTE constant. It serves as a safe reference to synchronize on for locking on the current session.

In many cases, the HttpSession reference itself is a safe mutex as well, since it will always be the same object reference for the same active logical session. However, this is not guaranteed across different servlet containers; the only 100% safe way is a session mutex.

Since:
1.2.7
Author:
Juergen Hoeller
See Also:
WebUtils.SESSION_MUTEX_ATTRIBUTE, WebUtils.getSessionMutex(javax.servlet.http.HttpSession), AbstractController.setSynchronizeOnSession(boolean)

Constructor Summary
HttpSessionMutexListener()
Method Summary
void | sessionCreated(HttpSessionEvent event)
void | sessionDestroyed(HttpSessionEvent event)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

HttpSessionMutexListener

public HttpSessionMutexListener()
Method Detail

sessionCreated

public void sessionCreated(HttpSessionEvent event)
Specified by:
sessionCreated in interface HttpSessionListener

sessionDestroyed

public void sessionDestroyed(HttpSessionEvent event)
Specified by:
sessionDestroyed in interface HttpSessionListener
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


IntrospectorCleanupListener

org.springframework.web.util
Class IntrospectorCleanupListener

java.lang.Object
    extended by  org.springframework.web.util.IntrospectorCleanupListener
All Implemented Interfaces:
EventListener, ServletContextListener
public class IntrospectorCleanupListener
extends Object
implements ServletContextListener

Listener that flushes the JDK's JavaBeans Introspector cache on web app shutdown. Register this listener in your web.xml to guarantee proper release of the web application class loader and its loaded classes.

If the JavaBeans Introspector has been used to analyze application classes, the system-level Introspector cache will hold a hard reference to those classes. Consequently, those classes and the web application class loader will not be garbage-collected on web app shutdown! This listener performs proper cleanup, to allow for garbage collection to take effect.

Unfortunately, the only way to clean up the Introspector is to flush the entire cache, as there is no way to specifically determine the application's classes referenced there. This will remove cached introspection results for all other applications in the server too.

Note that this listener is not necessary when using Spring's beans infrastructure within the application, as Spring's own introspection results cache will immediately flush an analyzed class from the JavaBeans Introspector cache and only hold a cache within the application's own ClassLoader. Although Spring itself does not create JDK Introspector leaks, note that this listener should nevertheless be used in scenarios where the Spring framework classes themselves reside in a 'common' ClassLoader (such as the system ClassLoader). In such a scenario, this listener will properly clean up Spring's introspection cache.

Application classes hardly ever need to use the JavaBeans Introspector directly, so are normally not the cause of Introspector resource leaks. Rather, many libraries and frameworks do not clean up the Introspector: e.g. Struts and Quartz.

Note that a single such Introspector leak will cause the entire web app class loader to not get garbage collected! This has the consequence that you will see all the application's static class resources (like singletons) around after web app shutdown, which is not the fault of those classes!

This listener should be registered as the first one in web.xml, before any application listeners such as Spring's ContextLoaderListener. This allows the listener to take full effect at the right time of the lifecycle.

Since:
1.1
Author:
Juergen Hoeller
See Also:
Introspector.flushCaches(),
CachedIntrospectionResults.acceptClassLoader(java.lang.ClassLoader),
CachedIntrospectionResults.clearClassLoader(java.lang.ClassLoader)

Constructor Summary
IntrospectorCleanupListener()
Method Summary
void | contextDestroyed(ServletContextEvent event)
void | contextInitialized(ServletContextEvent event)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

IntrospectorCleanupListener

public IntrospectorCleanupListener()
Method Detail

contextInitialized

public void contextInitialized(ServletContextEvent event)
Specified by:
contextInitialized in interface ServletContextListener

contextDestroyed

public void contextDestroyed(ServletContextEvent event)
Specified by:
contextDestroyed in interface ServletContextListener
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JavaScriptUtils

org.springframework.web.util
Class JavaScriptUtils

java.lang.Object
    extended by  org.springframework.web.util.JavaScriptUtils

public class JavaScriptUtils
extends Object

Utility class for JavaScript escaping. Escapes based on the JavaScript 1.5 recommendation.

Reference: Core JavaScript 1.5 Guide

Since:
1.1.1
Author:
Juergen Hoeller, Rob Harrop

Constructor Summary
JavaScriptUtils()
Method Summary
static String javaScriptEscape(String input)
Turn special characters into escaped characters conforming to JavaScript.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JavaScriptUtils

public JavaScriptUtils()
Method Detail

javaScriptEscape

public static String javaScriptEscape(String input)
Turn special characters into escaped characters conforming to JavaScript. Handles complete character set defined in HTML 4.01 recommendation.

Parameters:
input - the input string
Returns:
the escaped string
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Log4jConfigListener

org.springframework.web.util
Class Log4jConfigListener

java.lang.Object
    extended by  org.springframework.web.util.Log4jConfigListener
All Implemented Interfaces:
EventListener, ServletContextListener
public class Log4jConfigListener
extends Object
implements ServletContextListener

Bootstrap listener for custom log4j initialization in a web environment. Delegates to Log4jWebConfigurer (see its javadoc for configuration details). WARNING: Assumes an expanded WAR file, both for loading the configuration file and for writing the log files. If you want to keep your WAR unexpanded or don't need application-specific log files within the WAR directory, don't use log4j setup within the application (thus, don't use Log4jConfigListener or Log4jConfigServlet). Instead, use a global, VM-wide log4j setup (for example, in JBoss) or JDK 1.4's java.util.logging (which is global too).

This listener should be registered before ContextLoaderListener in web.xml when using custom log4j initialization.

Since:
13.03.2003
Author:
Juergen Hoeller
See Also:
Log4jWebConfigurer, ContextLoaderListener, WebAppRootListener

Constructor Summary
Log4jConfigListener()
Method Summary
void | contextDestroyed(ServletContextEvent event)
void | contextInitialized(ServletContextEvent event)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Log4jConfigListener

public Log4jConfigListener()
Method Detail

contextInitialized

public void contextInitialized(ServletContextEvent event)
Specified by:
contextInitialized in interface ServletContextListener

contextDestroyed

public void contextDestroyed(ServletContextEvent event)
Specified by:
contextDestroyed in interface ServletContextListener
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Log4jWebConfigurer

org.springframework.web.util
Class Log4jWebConfigurer

java.lang.Object
    extended by  org.springframework.web.util.Log4jWebConfigurer

public abstract class Log4jWebConfigurer
extends Object

Convenience class that performs custom log4j initialization for web environments, allowing for log file paths within the web application, with the option to perform automatic refresh checks (for runtime changes in logging configuration).

WARNING: Assumes an expanded WAR file, both for loading the configuration file and for writing the log files. If you want to keep your WAR unexpanded or don't need application-specific log files within the WAR directory, don't use log4j setup within the application (thus, don't use Log4jConfigListener or Log4jConfigServlet). Instead, use a global, VM-wide log4j setup (for example, in JBoss) or JDK 1.4's java.util.logging (which is global too).

Supports three init parameters at the servlet context level (that is, context-param entries in web.xml):

  • "log4jConfigLocation":
    Location of the log4j config file; either a "classpath:" location (e.g. "classpath:myLog4j.properties"), an absolute file URL (e.g. "file:C:/log4j.properties), or a plain path relative to the web application root directory (e.g. "/WEB-INF/log4j.properties"). If not specified, default log4j initialization will apply ("log4j.properties" or "log4j.xml" in the class path; see the log4j documentation for details).
  • "log4jRefreshInterval":
    Interval between config file refresh checks, in milliseconds. If not specified, no refresh checks will happen, which avoids starting log4j's watchdog thread.
  • "log4jExposeWebAppRoot":
    Whether the web app root system property should be exposed, allowing for log file paths relative to the web application root directory. Default is "true"; specify "false" to suppress expose of the web app root system property. See below for details on how to use this system property in log file locations.

Note: initLogging should be called before any other Spring activity (when using log4j), for proper initialization before any Spring logging attempts.

Log4j's watchdog thread will asynchronously check whether the timestamp of the config file has changed, using the given interval between checks. A refresh interval of 1000 milliseconds (one second), which allows to do on-demand log level changes with immediate effect, is not unfeasible.

WARNING: Log4j's watchdog thread does not terminate until VM shutdown; in particular, it does not terminate on LogManager shutdown. Therefore, it is recommended to not use config file refreshing in a production J2EE environment; the watchdog thread would not stop on application shutdown there.

By default, this configurer automatically sets the web app root system property, for "${key}" substitutions within log file locations in the log4j config file, allowing for log file paths relative to the web application root directory. The default system property key is "webapp.root", to be used in a log4j config file like as follows:

log4j.appender.myfile.File=${webapp.root}/WEB-INF/demo.log

Alternatively, specify a unique context-param "webAppRootKey" per web application. For example, with "webAppRootKey = "demo.root":

log4j.appender.myfile.File=${demo.root}/WEB-INF/demo.log

WARNING: Some containers (like Tomcat) do not keep system properties separate per web app. You have to use unique "webAppRootKey" context-params per web app then, to avoid clashes. Other containers like Resin do isolate each web app's system properties: Here you can use the default key (i.e. no "webAppRootKey" context-param at all) without worrying.

Since:
12.08.2003
Author:
Juergen Hoeller
See Also:
Log4jConfigurer, Log4jConfigListener

Field Summary
static String | CONFIG_LOCATION_PARAM Parameter specifying the location of the log4j config file
static String | EXPOSE_WEB_APP_ROOT_PARAM Parameter specifying whether to expose the web app root system property
static String | REFRESH_INTERVAL_PARAM Parameter specifying the refresh interval for checking the log4j config file
Constructor Summary
Log4jWebConfigurer()
Method Summary
static void | initLogging(ServletContext servletContext) Initialize log4j, including setting the web app root system property.
static void | shutdownLogging(ServletContext servletContext) Shut down log4j, properly releasing all file locks and resetting the web app root system property.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

CONFIG_LOCATION_PARAM

public static final String CONFIG_LOCATION_PARAM
Parameter specifying the location of the log4j config file

See Also:
Constant Field Values

REFRESH_INTERVAL_PARAM

public static final String REFRESH_INTERVAL_PARAM
Parameter specifying the refresh interval for checking the log4j config file

See Also:
Constant Field Values

EXPOSE_WEB_APP_ROOT_PARAM

public static final String EXPOSE_WEB_APP_ROOT_PARAM
Parameter specifying whether to expose the web app root system property

See Also:
Constant Field Values
Constructor Detail

Log4jWebConfigurer

public Log4jWebConfigurer()
Method Detail

initLogging

public static void initLogging(ServletContext servletContext)
Initialize log4j, including setting the web app root system property.

Parameters:
servletContext - the current ServletContext
See Also:
WebUtils.setWebAppRootSystemProperty(javax.servlet.ServletContext)

shutdownLogging

public static void shutdownLogging(ServletContext servletContext)
Shut down log4j, properly releasing all file locks and resetting the web app root system property.

Parameters:
servletContext - the current ServletContext
See Also:
WebUtils.removeWebAppRootSystemProperty(javax.servlet.ServletContext)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TagUtils

org.springframework.web.util
Class TagUtils

java.lang.Object
    extended by  org.springframework.web.util.TagUtils

public abstract class TagUtils
extends Object

Utility class for tag library related code, exposing functionality such as translating Strings to web scopes.

  • page will be transformed to PageContext.PAGE_SCOPE
  • request will be transformed to PageContext.REQUEST_SCOPE
  • session will be transformed to PageContext.SESSION_SCOPE
  • application will be transformed to PageContext.APPLICATION_SCOPE

Author:
Alef Arendsen, Rob Harrop, Juergen Hoeller, Rick Evans

Field Summary
static String | SCOPE_APPLICATION Constant identifying the application scope
static String | SCOPE_PAGE Constant identifying the page scope
static String | SCOPE_REQUEST Constant identifying the request scope
static String | SCOPE_SESSION Constant identifying the session scope
Constructor Summary
TagUtils()
Method Summary
static void | assertHasAncestorOfType(Tag tag, Class ancestorTagClass, String tagName, String ancestorTagName) Determine whether the supplied Tag has any ancestor tag of the supplied type, throwing an IllegalStateException if not.
static int | getScope(String scope) Determines the scope for a given input String.
static boolean | hasAncestorOfType(Tag tag, Class ancestorTagClass) Determine whether the supplied Tag has any ancestor tag of the supplied type.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

SCOPE_PAGE

public static final String SCOPE_PAGE
Constant identifying the page scope

See Also:
Constant Field Values

SCOPE_REQUEST

public static final String SCOPE_REQUEST
Constant identifying the request scope

See Also:
Constant Field Values

SCOPE_SESSION

public static final String SCOPE_SESSION
Constant identifying the session scope

See Also:
Constant Field Values

SCOPE_APPLICATION

public static final String SCOPE_APPLICATION
Constant identifying the application scope

See Also:
Constant Field Values
Constructor Detail

TagUtils

public TagUtils()
Method Detail

getScope

public static int getScope(String scope)
Determines the scope for a given input String.

If the String does not match 'request', 'session', 'page' or 'application', the method will return PageContext.PAGE_SCOPE.

Parameters:
scope - the String to inspect
Returns:
the scope found, or PageContext.PAGE_SCOPE if no scope matched
Throws:
IllegalArgumentException - if the supplied scope is null

hasAncestorOfType

public static boolean hasAncestorOfType(Tag tag,
                                        Class ancestorTagClass)
Determine whether the supplied Tag has any ancestor tag of the supplied type.

Parameters:
tag - the tag whose ancestors are to be checked
ancestorTagClass - the ancestor Class being searched for
Returns:
true if the supplied Tag has any ancestor tag of the supplied type
Throws:
IllegalArgumentException - if either of the supplied arguments is null; or if the supplied ancestorTagClass is not type-assignable to the Tag class

assertHasAncestorOfType

public static void assertHasAncestorOfType(Tag tag,
                                           Class ancestorTagClass,
                                           String tagName,
                                           String ancestorTagName)
Determine whether the supplied Tag has any ancestor tag of the supplied type, throwing an IllegalStateException if not.

Parameters:
tag - the tag whose ancestors are to be checked
ancestorTagClass - the ancestor Class being searched for
tagName - the name of the tag; for example 'option'
ancestorTagName - the name of the ancestor tag; for example 'select'
Throws:
IllegalStateException - if the supplied tag does not have a tag of the supplied parentTagClass as an ancestor
IllegalArgumentException - if any of the supplied arguments is null, or in the case of the String-typed arguments, is composed wholly of whitespace; or if the supplied ancestorTagClass is not type-assignable to the Tag class
See Also:
hasAncestorOfType(javax.servlet.jsp.tagext.Tag, Class)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UriTemplate

org.springframework.web.util
Class UriTemplate

java.lang.Object
    extended by  org.springframework.web.util.UriTemplate

public class UriTemplate
extends Object

Represents a URI template. An URI template is a URI-like String that contained variables marked of in braces ({, }), which can be expanded to produce a URI.

See expand(Map), expand(Object[]), and match(String) for example usages.

Since:
3.0
Author:
Arjen Poutsma, Juergen Hoeller
See Also:
URI Templates

Constructor Summary
UriTemplate(String uriTemplate)
Construct a new UriTemplate with the given URI String.
Method Summary
protected URI | encodeUri(String uri) Encodes the given String as URL.
URI | expand(Map<String,?> uriVariables) Given the Map of variables, expands this template into a URI.
URI | expand(Object... uriVariableValues) Given an array of variables, expand this template into a full URI.
List<String> | getVariableNames() Return the names of the variables in the template, in order.
Map<String,String> | match(String uri) Match the given URI to a map of variable values.
boolean | matches(String uri) Indicate whether the given URI matches this template.
String | toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

UriTemplate

public UriTemplate(String uriTemplate)
Construct a new UriTemplate with the given URI String.

Parameters:
uriTemplate - the URI template string
Method Detail

getVariableNames

public List<String> getVariableNames()
Return the names of the variables in the template, in order.

Returns:
the template variable names

expand

public URI expand(Map<String,?> uriVariables)
Given the Map of variables, expands this template into a URI. The Map keys represent variable names, the Map values variable values. The order of variables is not significant.

Example:

 UriTemplate template = new UriTemplate("http://example.com/hotels/{hotel}/bookings/{booking}");
 Map<String, String> uriVariables = new HashMap<String, String>();
 uriVariables.put("booking", "42");
 uriVariables.put("hotel", "1");
 System.out.println(template.expand(uriVariables));
will print:
http://example.com/hotels/1/bookings/42

Parameters:
uriVariables - the map of URI variables
Returns:
the expanded URI
Throws:
IllegalArgumentException - if uriVariables is null; or if it does not contain values for all the variable names

expand

public URI expand(Object... uriVariableValues)
Given an array of variables, expand this template into a full URI. The array represent variable values. The order of variables is significant.

Example:

 will print:
http://example.com/hotels/1/bookings/42

Parameters:
uriVariableValues - the array of URI variables

Returns:
the expanded URI

Throws:

IllegalArgumentException - if uriVariables is null; or if it does not contain
 sufficient variables

matches

public boolean matches(String uri)
Indicate whether the given URI matches this template.

Parameters:
uri - the URI to match to
Returns:
true if it matches; false otherwise

match

public Map<String,String> match(String uri)
Match the given URI to a map of variable values. Keys in the returned map are variable names, values are variable values, as occurred in the given URI.

Example:

 UriTemplate template = new
 UriTemplate("http://example.com/hotels/{hotel}/bookings/{booking}"); System.out.println(template.match("http://example.com/hotels/1/bookings/42"));
will print:
{hotel=1, booking=42}

Parameters:
uri - the URI to match to
Returns:
a map of variable values

toString

public String toString()
Overrides:
toString in class Object

encodeUri

protected URI encodeUri(String uri)
Encodes the given String as URL.

Defaults to UriUtils.encodeUri(String, String).

Parameters:
uri - the URI to encode
Returns:
the encoded URI
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UriUtils

org.springframework.web.util
Class UriUtils

java.lang.Object
    extended by  org.springframework.web.util.UriUtils

public abstract class UriUtils
extends Object

Utility class for URI encoding and decoding based on RFC 3986. Offers encoding methods for the various URI components.

All encode*(String, String methods in this class operate in a similar way:

  • Valid characters for the specific URI component as defined in RFC 3986 stay the same.
  • All other characters are converted into one or more bytes in the given encoding scheme. Each of the resulting bytes is written as a hexadecimal string in the "%xy" format.

Since:
3.0
Author:
Arjen Poutsma
See Also:
RFC 3986

Constructor Summary
UriUtils()
Method Summary
static String | decode(String source, String encoding) Decodes the given encoded source String into an URI.
static String | encodeFragment(String fragment, String encoding) Encodes the given URI fragment.
static String | encodeHost(String host, String encoding) Encodes the given URI host.
static String | encodeHttpUrl(String httpUrl, String encoding) Encodes the given HTTP URI into an encoded String.
static String | encodePath(String path, String encoding) Encodes the given URI path.
static String | encodePathSegment(String segment, String encoding) Encodes the given URI path segment.
static String | encodePort(String port, String encoding) Encodes the given URI port.
static String | encodeQuery(String query, String encoding) Encodes the given URI query.
static String | encodeQueryParam(String queryParam, String encoding) Encodes the given URI query parameter.
static String | encodeScheme(String scheme, String encoding) Encodes the given URI scheme.
static String | encodeUri(String uri, String encoding) Encodes the given source URI into an encoded String.
static String | encodeUriComponents(String scheme, String authority, String userinfo, String host, String port, String path, String query, String fragment, String encoding) Encodes the given source URI components into an encoded String.
static String | encodeUserInfo(String userInfo, String encoding) Encodes the given URI user info.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

UriUtils

public UriUtils()
Method Detail

encodeUri

public static String encodeUri(String uri,
                               String encoding)
                        throws UnsupportedEncodingException
Encodes the given source URI into an encoded String. All various URI components are encoded according to their respective valid character sets.

Parameters:
uri - the URI to be encoded
encoding - the character encoding to encode to
Returns:
the encoded URI
Throws:
IllegalArgumentException - when the given uri parameter is not a valid URI
UnsupportedEncodingException - when the given encoding parameter is not supported

encodeHttpUrl

public static String encodeHttpUrl(String httpUrl,
                                   String encoding)
                            throws UnsupportedEncodingException
Encodes the given HTTP URI into an encoded String. All various URI components are encoded according to their respective valid character sets.

Note that this method does not support fragments (#), as these are not supposed to be sent to the server, but retained by the client.

Parameters:
httpUrl - the HTTP URL to be encoded
encoding - the character encoding to encode to
Returns:
the encoded URL
Throws:
IllegalArgumentException - when the given uri parameter is not a valid URI
UnsupportedEncodingException - when the given encoding parameter is not supported

encodeUriComponents

public static String encodeUriComponents(String scheme,
                                         String authority,
                                         String userinfo,
                                         String host,
                                         String port,
                                         String path,
                                         String query,
                                         String fragment,
                                         String encoding)
                                  throws UnsupportedEncodingException
Encodes the given source URI components into an encoded String. All various URI components are optional, but encoded according to their respective valid character sets.

Parameters:
scheme - the scheme
authority - the authority
userinfo - the user info
host - the host
port - the port
path - the path
query - the query
fragment - the fragment
encoding - the character encoding to encode to
Returns:
the encoded URI
Throws:
IllegalArgumentException - when the given uri parameter is not a valid URI
UnsupportedEncodingException - when the given encoding parameter is not supported

encodeScheme

public static String encodeScheme(String scheme,
                                  String encoding)
                           throws UnsupportedEncodingException
Encodes the given URI scheme.

Parameters:
scheme - the scheme to be encoded
encoding - the character encoding to encode to
Returns:
the encoded scheme
Throws:
UnsupportedEncodingException - when the given encoding parameter is not supported

encodeUserInfo

public static String encodeUserInfo(String userInfo,
                                    String encoding)
                             throws UnsupportedEncodingException
Encodes the given URI user info.

Parameters:
userInfo - the user info to be encoded
encoding - the character encoding to encode to
Returns:
the encoded user info
Throws:
UnsupportedEncodingException - when the given encoding parameter is not supported

encodeHost

public static String encodeHost(String host,
                                String encoding)
                         throws UnsupportedEncodingException
Encodes the given URI host.

Parameters:
host - the host to be encoded
encoding - the character encoding to encode to
Returns:
the encoded host
Throws:
UnsupportedEncodingException - when the given encoding parameter is not supported

encodePort

public static String encodePort(String port,
                                String encoding)
                         throws UnsupportedEncodingException
Encodes the given URI port.

Parameters:
port - the port to be encoded
encoding - the character encoding to encode to
Returns:
the encoded port
Throws:
UnsupportedEncodingException - when the given encoding parameter is not supported

encodePath

public static String encodePath(String path,
                                String encoding)
                         throws UnsupportedEncodingException
Encodes the given URI path.

Parameters:
path - the path to be encoded
encoding - the character encoding to encode to
Returns:
the encoded path
Throws:
UnsupportedEncodingException - when the given encoding parameter is not supported

encodePathSegment

public static String encodePathSegment(String segment,
                                       String encoding)
                                throws UnsupportedEncodingException
Encodes the given URI path segment.

Parameters:
segment - the segment to be encoded
encoding - the character encoding to encode to
Returns:
the encoded segment
Throws:
UnsupportedEncodingException - when the given encoding parameter is not supported

encodeQuery

public static String encodeQuery(String query,
                                 String encoding)
                          throws UnsupportedEncodingException
Encodes the given URI query.

Parameters:
query - the query to be encoded
encoding - the character encoding to encode to
Returns:
the encoded query
Throws:
UnsupportedEncodingException - when the given encoding parameter is not supported

encodeQueryParam

public static String encodeQueryParam(String queryParam,
                                      String encoding)
                               throws UnsupportedEncodingException
Encodes the given URI query parameter.

Parameters:
queryParam - the query parameter to be encoded
encoding - the character encoding to encode to
Returns:
the encoded query parameter
Throws:
UnsupportedEncodingException - when the given encoding parameter is not supported

encodeFragment

public static String encodeFragment(String fragment,
                                    String encoding)
                             throws UnsupportedEncodingException
Encodes the given URI fragment.

Parameters:
fragment - the fragment to be encoded
encoding - the character encoding to encode to
Returns:
the encoded fragment
Throws:
UnsupportedEncodingException - when the given encoding parameter is not supported

decode

public static String decode(String source,
                            String encoding)
                     throws UnsupportedEncodingException
Decodes the given encoded source String into an URI. Based on the following rules:
  • Alphanumeric characters "a" through "z", "A" through "Z", and "0" through "9" stay the same.
  • Special characters "-", "_", ".", and "*" stay the same.
  • All other characters are converted into one or more bytes using the given encoding scheme. Each of the resulting bytes is written as a hexadecimal string in the %xy format.
  • A sequence "%xy" is interpreted as a hexadecimal representation of the character.

Parameters:
source - the source string
encoding - the encoding
Returns:
the decoded URI
Throws:
UnsupportedEncodingException - when the given encoding parameter is not supported
See Also:
URLDecoder.decode(String, String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UrlPathHelper

org.springframework.web.util
Class UrlPathHelper

java.lang.Object
    extended by  org.springframework.web.util.UrlPathHelper

public class UrlPathHelper
extends Object

Helper class for URL path matching. Provides support for URL paths in RequestDispatcher includes and support for consistent URL decoding.

Used by AbstractUrlHandlerMapping, AbstractUrlMethodNameResolver and RequestContext for path matching and/or URI determination.

Since:
14.01.2004
Author:
Juergen Hoeller, Rob Harrop

Constructor Summary
UrlPathHelper()
Method Summary
String | decodeRequestString(HttpServletRequest request, String source) Decode the given source string with a URLDecoder.
protected String | determineEncoding(HttpServletRequest request) Determine the encoding for the given request.
String | getContextPath(HttpServletRequest request) Return the context path for the given request, detecting an include request URL if called within a RequestDispatcher include.
protected String | getDefaultEncoding() Return the default character encoding to use for URL decoding.
String | getLookupPathForRequest(HttpServletRequest request) Return the mapping lookup path for the given request, within the current servlet mapping if applicable, else within the web application.
String | getOriginatingContextPath(HttpServletRequest request) Return the context path for the given request, detecting an include request URL if called within a RequestDispatcher include.
String | getOriginatingQueryString(HttpServletRequest request) Return the request URI for root of the given request.
String | getOriginatingRequestUri(HttpServletRequest request) Return the request URI for root of the given request.
String | getPathWithinApplication(HttpServletRequest request) Return the path within the web application for the given request.
String | getPathWithinServletMapping(HttpServletRequest request) Return the path within the servlet mapping for the given request, i.e.
String | getRequestUri(HttpServletRequest request) Return the request URI for the given request, detecting an include request URL if called within a RequestDispatcher include.
String | getServletPath(HttpServletRequest request) Return the servlet path for the given request, regarding an include request URL if called within a RequestDispatcher include.
void | setAlwaysUseFullPath(boolean alwaysUseFullPath) Set if URL lookup should always use full path within current servlet context.
void | setDefaultEncoding(String defaultEncoding) Set the default character encoding to use for URL decoding.
void | setUrlDecode(boolean urlDecode) Set if context path and request URI should be URL-decoded.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

UrlPathHelper

public UrlPathHelper()
Method Detail

setAlwaysUseFullPath

public void setAlwaysUseFullPath(boolean alwaysUseFullPath)
Set if URL lookup should always use full path within current servlet context. Else, the path within the current servlet mapping is used if applicable (i.e. in the case of a ".../*" servlet mapping in web.xml). Default is "false".

setUrlDecode

public void setUrlDecode(boolean urlDecode)
Set if context path and request URI should be URL-decoded. Both are returned undecoded by the Servlet API, in contrast to the servlet path.

Uses either the request encoding or the default encoding according to the Servlet spec (ISO-8859-1).

Default is "true", as of Spring 2.5.

See Also:
getServletPath(javax.servlet.http.HttpServletRequest),
getContextPath(javax.servlet.http.HttpServletRequest),
getRequestUri(javax.servlet.http.HttpServletRequest),
WebUtils.DEFAULT_CHARACTER_ENCODING,
ServletRequest.getCharacterEncoding(),
URLDecoder.decode(String, String)

setDefaultEncoding

public void setDefaultEncoding(String defaultEncoding)
Set the default character encoding to use for URL decoding. Default is ISO-8859-1, according to the Servlet spec.

If the request specifies a character encoding itself, the request encoding will override this setting. This also allows for generically overriding the character encoding in a filter that invokes the ServletRequest.setCharacterEncoding method.

Parameters:
defaultEncoding - the character encoding to use
See Also:
determineEncoding(javax.servlet.http.HttpServletRequest),
ServletRequest.getCharacterEncoding(),
ServletRequest.setCharacterEncoding(String),
WebUtils.DEFAULT_CHARACTER_ENCODING

getDefaultEncoding

protected String getDefaultEncoding()
Return the default character encoding to use for URL decoding.

getLookupPathForRequest

public String getLookupPathForRequest(HttpServletRequest request)
Return the mapping lookup path for the given request, within the current servlet mapping if applicable, else within the web application.

Detects include request URL if called within a RequestDispatcher include.

Parameters:
request - current HTTP request
Returns:
the lookup path
See Also:
getPathWithinApplication(javax.servlet.http.HttpServletRequest), getPathWithinServletMapping(javax.servlet.http.HttpServletRequest)

getPathWithinServletMapping

public String getPathWithinServletMapping(HttpServletRequest request)
Return the path within the servlet mapping for the given request, i.e. the part of the request's URL beyond the part that called the servlet, or "" if the whole URL has been used to identify the servlet.

Detects include request URL if called within a RequestDispatcher include.

E.g.: servlet mapping = "/test/*"; request URI = "/test/a" -> "/a".

E.g.: servlet mapping = "/test"; request URI = "/test" -> "".

E.g.: servlet mapping = "/*.test"; request URI = "/a.test" -> "".

Parameters:
request - current HTTP request
Returns:
the path within the servlet mapping, or ""

getPathWithinApplication

public String getPathWithinApplication(HttpServletRequest request)
Return the path within the web application for the given request.

Detects include request URL if called within a RequestDispatcher include.

Parameters:
request - current HTTP request
Returns:
the path within the web application

getRequestUri

public String getRequestUri(HttpServletRequest request)
Return the request URI for the given request, detecting an include request URL if called within a RequestDispatcher include.

As the value returned by request.getRequestURI() is not decoded by the servlet container, this method will decode it.

The URI that the web container resolves should be correct, but some containers like JBoss/Jetty incorrectly include ";" strings like ";jsessionid" in the URI. This method cuts off such incorrect appendices.

Parameters:
request - current HTTP request
Returns:
the request URI

getContextPath

public String getContextPath(HttpServletRequest request)
Return the context path for the given request, detecting an include request URL if called within a RequestDispatcher include.

As the value returned by request.getContextPath() is not decoded by the servlet container, this method will decode it.

Parameters:
request - current HTTP request
Returns:
the context path

getServletPath

public String getServletPath(HttpServletRequest request)
Return the servlet path for the given request, regarding an include request URL if called within a RequestDispatcher include.

As the value returned by request.getServletPath() is already decoded by the servlet container, this method will not attempt to decode it.

Parameters:
request - current HTTP request
Returns:
the servlet path

getOriginatingRequestUri

public String getOriginatingRequestUri(HttpServletRequest request)
Return the request URI for root of the given request. If this is a forwarded request, correctly resolves to the request URI of the original request.

Relies on the Servlet 2.4 'forward' attributes. These attributes may be set by other components when running in a Servlet 2.3 environment.

getOriginatingContextPath

public String getOriginatingContextPath(HttpServletRequest request)
Return the context path for the given request, detecting an include request URL if called within a RequestDispatcher include.

As the value returned by request.getContextPath() is not decoded by the servlet container, this method will decode it.

Relies on the Servlet 2.4 'forward' attributes. These attributes may be set by other components when running in a Servlet 2.3 environment.

Parameters:
request - current HTTP request
Returns:
the context path

getOriginatingQueryString

public String getOriginatingQueryString(HttpServletRequest request)
Return the request URI for root of the given request. If this is a forwarded request, correctly resolves to the request URI of the original request.

Relies on the Servlet 2.4 'forward' attributes. These attributes may be set by other components when running in a Servlet 2.3 environment.

Parameters:
request - current HTTP request
Returns:
the query string

decodeRequestString

public String decodeRequestString(HttpServletRequest request,
                                  String source)
Decode the given source string with a URLDecoder. The encoding will be taken from the request, falling back to the default "ISO-8859-1".

The default implementation uses URLDecoder.decode(input, enc).

Parameters:
request - current HTTP request
source - the String to decode
Returns:
the decoded String
See Also:
WebUtils.DEFAULT_CHARACTER_ENCODING,
ServletRequest.getCharacterEncoding(),
URLDecoder.decode(String, String),
URLDecoder.decode(String)

determineEncoding

protected String determineEncoding(HttpServletRequest request)
Determine the encoding for the given request. Can be overridden in subclasses.

The default implementation checks the request encoding, falling back to the default encoding specified for this resolver.

Parameters:
request - current HTTP request
Returns:
the encoding for the request (never null)
See Also:
ServletRequest.getCharacterEncoding(), setDefaultEncoding(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WebAppRootListener

org.springframework.web.util
Class WebAppRootListener

java.lang.Object
    extended by  org.springframework.web.util.WebAppRootListener
All Implemented Interfaces:
EventListener, ServletContextListener
public class WebAppRootListener
extends Object
implements ServletContextListener

Listener that sets a system property to the web application root directory. The key of the system property can be defined with the "webAppRootKey" init parameter at the servlet context level (i.e. context-param in web.xml), the default key is "webapp.root".

Can be used for toolkits that support substition with system properties (i.e. System.getProperty values), like log4j's "${key}" syntax within log file locations.

Note: This listener should be placed before ContextLoaderListener in web.xml, at least when used for log4j. Log4jConfigListener sets the system property implicitly, so there's no need for this listener in addition to it.

WARNING: Some containers, e.g. Tomcat, do NOT keep system properties separate per web app. You have to use unique "webAppRootKey" context-params per web app then, to avoid clashes. Other containers like Resin do isolate each web app's system properties: Here you can use the default key (i.e. no "webAppRootKey" context-param at all) without worrying.

WARNING: The WAR file containing the web application needs to be expanded to allow for setting the web app root system property. This is by default not the case when a WAR file gets deployed to WebLogic, for example. Do not use this listener in such an environment!

Since:
18.04.2003
Author:
Juergen Hoeller
See Also:
WebUtils.setWebAppRootSystemProperty(javax.servlet.ServletContext), Log4jConfigListener, System.getProperty(java.lang.String)

Constructor Summary
WebAppRootListener()
Method Summary
void | contextDestroyed(ServletContextEvent event)
void | contextInitialized(ServletContextEvent event)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

WebAppRootListener

public WebAppRootListener()
Method Detail

contextInitialized

public void contextInitialized(ServletContextEvent event)
Specified by:
contextInitialized in interface ServletContextListener

contextDestroyed

public void contextDestroyed(ServletContextEvent event)
Specified by:
contextDestroyed in interface ServletContextListener
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WebUtils

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

org.springframework.web.util
Class WebUtils

java.lang.Object
    extended by  org.springframework.web.util.WebUtils

public abstract class WebUtils
extends Object

Miscellaneous utilities for web applications. Used by various framework classes.

Author:
Rod Johnson, Juergen Hoeller

Field Summary
static String | CONTENT_TYPE_CHARSET_PREFIX Prefix of the charset clause in a content type String: ";charset="
static String | DEFAULT_CHARACTER_ENCODING Default character encoding to use when request.getCharacterEncoding returns null, according to the Servlet spec.
static String | DEFAULT_WEB_APP_ROOT_KEY Default web app root key: "webapp.root"
static String | ERROR_EXCEPTION_ATTRIBUTE
static String | ERROR_EXCEPTION_TYPE_ATTRIBUTE
static String | ERROR_MESSAGE_ATTRIBUTE
static String | ERROR_REQUEST_URI_ATTRIBUTE
static String | ERROR_SERVLET_NAME_ATTRIBUTE
static String | ERROR_STATUS_CODE_ATTRIBUTE Standard Servlet 2.3+ spec request attributes for error pages.
static String | FORWARD_CONTEXT_PATH_ATTRIBUTE
static String | FORWARD_PATH_INFO_ATTRIBUTE
static String | FORWARD_QUERY_STRING_ATTRIBUTE
static String | FORWARD_REQUEST_URI_ATTRIBUTE Standard Servlet 2.4+ spec request attributes for forward URI and paths.
static String | FORWARD_SERVLET_PATH_ATTRIBUTE
static String | HTML_ESCAPE_CONTEXT_PARAM HTML escape parameter at the servlet context level (i.e.
static String | INCLUDE_CONTEXT_PATH_ATTRIBUTE
static String | INCLUDE_PATH_INFO_ATTRIBUTE
static String | INCLUDE_QUERY_STRING_ATTRIBUTE
static String | INCLUDE_REQUEST_URI_ATTRIBUTE Standard Servlet 2.3+ spec request attributes for include URI and paths.
static String | INCLUDE_SERVLET_PATH_ATTRIBUTE
static String | SESSION_MUTEX_ATTRIBUTE Key for the mutex session attribute
static String[] | SUBMIT_IMAGE_SUFFIXES Name suffixes in case of image buttons
static String | TEMP_DIR_CONTEXT_ATTRIBUTE Standard Servlet spec context attribute that specifies a temporary directory for the current web application, of type java.io.File.
static String | WEB_APP_ROOT_KEY_PARAM Web app root key parameter at the servlet context level (i.e.
Constructor Summary
WebUtils()
Method Summary
static void clearErrorRequestAttributes(HttpServletRequest request)
Clear the Servlet spec's error attributes as HttpServletRequest attributes under the keys defined in the Servlet 2.3 specification: javax.servlet.error.status_code, javax.servlet.error.exception_type, javax.servlet.error.message, javax.servlet.error.exception, javax.servlet.error.request_uri, javax.servlet.error.servlet_name.
static void exposeErrorRequestAttributes(HttpServletRequest request, Throwable ex, String servletName)
Expose the Servlet spec's error attributes as HttpServletRequest attributes under the keys defined in the Servlet 2.3 specification, for error pages that are rendered directly rather than through the Servlet container's error page resolution: javax.servlet.error.status_code, javax.servlet.error.exception_type, javax.servlet.error.message, javax.servlet.error.exception, javax.servlet.error.request_uri, javax.servlet.error.servlet_name.
static void exposeForwardRequestAttributes(HttpServletRequest request)
Expose the current request URI and paths as HttpServletRequest attributes under the keys defined in the Servlet 2.4 specification, for containers that implement 2.3 or an earlier version of the Servlet API: javax.servlet.forward.request_uri, javax.servlet.forward.context_path, javax.servlet.forward.servlet_path, javax.servlet.forward.path_info, javax.servlet.forward.query_string.
static void exposeRequestAttributes(ServletRequest request, Map<String,?> attributes)
Expose the given Map as request attributes, using the keys as attribute names and the values as corresponding attribute values.
static String extractFilenameFromUrlPath(String urlPath)
Extract the URL filename from the given request URL path.
static String extractFullFilenameFromUrlPath(String urlPath)
Extract the full URL filename (including file extension) from the given request URL path.
static String findParameterValue(Map<String,?> parameters, String name)
Obtain a named parameter from the given request parameters.
static String findParameterValue(ServletRequest request, String name)
Obtain a named parameter from the given request parameters.
static Cookie getCookie(HttpServletRequest request, String name)
Retrieve the first cookie with the given name.
static Boolean getDefaultHtmlEscape(ServletContext servletContext)
Return whether default HTML escaping is enabled for the web application, i.e.
static Object getOrCreateSessionAttribute(HttpSession session, String name, Class clazz)
Get the specified session attribute, creating and setting a new attribute if no existing found.
static Map<String,Object> getParametersStartingWith(ServletRequest request, String prefix)
Return a map containing all parameters with the given prefix.
static String getRealPath(ServletContext servletContext, String path)
Return the real path of the given path within the web application, as provided by the servlet container.
static Object getRequiredSessionAttribute(HttpServletRequest request, String name)
Check the given request for a session attribute of the given name.
static Object getSessionAttribute(HttpServletRequest request, String name)
Check the given request for a session attribute of the given name.
static String getSessionId(HttpServletRequest request)
Determine the session id of the given request, if any.
static Object getSessionMutex(HttpSession session)
Return the best available mutex for the given session: that is, an object to synchronize on for the given session.
static int getTargetPage(ServletRequest request, String paramPrefix, int currentPage)
Return the target page specified in the request.
static File getTempDir(ServletContext servletContext)
Return the temporary directory for the current web application, as provided by the servlet container.
static boolean hasSubmitParameter(ServletRequest request, String name)
Check if a specific input type="submit" parameter was sent in the request, either via a button (directly with name) or via an image (name + ".x" or name + ".y").
static boolean isDefaultHtmlEscape(ServletContext servletContext)
Return whether default HTML escaping is enabled for the web application, i.e.
static boolean isIncludeRequest(ServletRequest request)
Determine whether the given request is an include request, that is, not a top-level HTTP request coming in from the outside.
static void removeWebAppRootSystemProperty(ServletContext servletContext)
Remove the system property that points to the web app root directory.
static void setSessionAttribute(HttpServletRequest request, String name, Object value)
Set the session attribute with the given name to the given value.
static void setWebAppRootSystemProperty(ServletContext servletContext)
Set a system property to the web application root directory.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

INCLUDE_REQUEST_URI_ATTRIBUTE

public static final String INCLUDE_REQUEST_URI_ATTRIBUTE
Standard Servlet 2.3+ spec request attributes for include URI and paths.

If included via a RequestDispatcher, the current resource will see the originating request. Its own URI and paths are exposed as request attributes.

See Also:
Constant Field Values

INCLUDE_CONTEXT_PATH_ATTRIBUTE

public static final String INCLUDE_CONTEXT_PATH_ATTRIBUTE
See Also:
Constant Field Values

INCLUDE_SERVLET_PATH_ATTRIBUTE

public static final String INCLUDE_SERVLET_PATH_ATTRIBUTE
See Also:
Constant Field Values

INCLUDE_PATH_INFO_ATTRIBUTE

public static final String INCLUDE_PATH_INFO_ATTRIBUTE
See Also:
Constant Field Values

INCLUDE_QUERY_STRING_ATTRIBUTE

public static final String INCLUDE_QUERY_STRING_ATTRIBUTE
See Also:
Constant Field Values

FORWARD_REQUEST_URI_ATTRIBUTE

public static final String FORWARD_REQUEST_URI_ATTRIBUTE
Standard Servlet 2.4+ spec request attributes for forward URI and paths.

If forwarded to via a RequestDispatcher, the current resource will see its own URI and paths. The originating URI and paths are exposed as request attributes.

See Also:
Constant Field Values

FORWARD_CONTEXT_PATH_ATTRIBUTE

public static final String FORWARD_CONTEXT_PATH_ATTRIBUTE
See Also:
Constant Field Values

FORWARD_SERVLET_PATH_ATTRIBUTE

public static final String FORWARD_SERVLET_PATH_ATTRIBUTE
See Also:
Constant Field Values

FORWARD_PATH_INFO_ATTRIBUTE

public static final String FORWARD_PATH_INFO_ATTRIBUTE
See Also:
Constant Field Values

FORWARD_QUERY_STRING_ATTRIBUTE

public static final String FORWARD_QUERY_STRING_ATTRIBUTE
See Also:
Constant Field Values

ERROR_STATUS_CODE_ATTRIBUTE

public static final String ERROR_STATUS_CODE_ATTRIBUTE
Standard Servlet 2.3+ spec request attributes for error pages.

To be exposed to JSPs that are marked as error pages, when forwarding to them directly rather than through the servlet container's error page resolution mechanism.

See Also:
Constant Field Values

ERROR_EXCEPTION_TYPE_ATTRIBUTE

public static final String ERROR_EXCEPTION_TYPE_ATTRIBUTE
See Also:
Constant Field Values

ERROR_MESSAGE_ATTRIBUTE

public static final String ERROR_MESSAGE_ATTRIBUTE
See Also:
Constant Field Values

ERROR_EXCEPTION_ATTRIBUTE

public static final String ERROR_EXCEPTION_ATTRIBUTE
See Also:
Constant Field Values

ERROR_REQUEST_URI_ATTRIBUTE

public static final String ERROR_REQUEST_URI_ATTRIBUTE
See Also:
Constant Field Values

ERROR_SERVLET_NAME_ATTRIBUTE

public static final String ERROR_SERVLET_NAME_ATTRIBUTE
See Also:
Constant Field Values

CONTENT_TYPE_CHARSET_PREFIX

public static final String CONTENT_TYPE_CHARSET_PREFIX
Prefix of the charset clause in a content type String: ";charset="

See Also:
Constant Field Values

DEFAULT_CHARACTER_ENCODING

public static final String DEFAULT_CHARACTER_ENCODING
Default character encoding to use when request.getCharacterEncoding returns null, according to the Servlet spec.

See Also:
ServletRequest.getCharacterEncoding(), Constant Field Values

TEMP_DIR_CONTEXT_ATTRIBUTE

public static final String TEMP_DIR_CONTEXT_ATTRIBUTE
Standard Servlet spec context attribute that specifies a temporary directory for the current web application, of type java.io.File.

See Also:
Constant Field Values

HTML_ESCAPE_CONTEXT_PARAM

public static final String HTML_ESCAPE_CONTEXT_PARAM
HTML escape parameter at the servlet context level (i.e. a context-param in web.xml): "defaultHtmlEscape".

See Also:
Constant Field Values

WEB_APP_ROOT_KEY_PARAM

public static final String WEB_APP_ROOT_KEY_PARAM
Web app root key parameter at the servlet context level (i.e. a context-param in web.xml): "webAppRootKey".

See Also:
Constant Field Values

DEFAULT_WEB_APP_ROOT_KEY

public static final String DEFAULT_WEB_APP_ROOT_KEY
Default web app root key: "webapp.root"

See Also:
Constant Field Values

SUBMIT_IMAGE_SUFFIXES

public static final String[] SUBMIT_IMAGE_SUFFIXES
Name suffixes in case of image buttons

SESSION_MUTEX_ATTRIBUTE

public static final String SESSION_MUTEX_ATTRIBUTE
Key for the mutex session attribute

Constructor Detail

WebUtils

public WebUtils()
Method Detail

setWebAppRootSystemProperty

public static void setWebAppRootSystemProperty(ServletContext servletContext)
                                        throws IllegalStateException
Set a system property to the web application root directory. The key of the system property can be defined with the "webAppRootKey" context-param in web.xml. Default is "webapp.root".

Can be used for tools that support substition with System.getProperty values, like log4j's "${key}" syntax within log file locations.

Parameters:
servletContext - the servlet context of the web application
Throws:
IllegalStateException - if the system property is already set, or if the WAR file is not expanded
See Also:
WEB_APP_ROOT_KEY_PARAM, DEFAULT_WEB_APP_ROOT_KEY, WebAppRootListener, Log4jWebConfigurer

removeWebAppRootSystemProperty

public static void removeWebAppRootSystemProperty(ServletContext servletContext)
Remove the system property that points to the web app root directory. To be called on shutdown of the web application.

Parameters:
servletContext - the servlet context of the web application
See Also:
setWebAppRootSystemProperty(javax.servlet.ServletContext)

isDefaultHtmlEscape

public static boolean isDefaultHtmlEscape(ServletContext servletContext)
Return whether default HTML escaping is enabled for the web application, i.e. the value of the "defaultHtmlEscape" context-param in web.xml (if any). Falls back to false in case of no explicit default given.

Parameters:
servletContext - the servlet context of the web application
Returns:
whether default HTML escaping is enabled (default is false)

getDefaultHtmlEscape

public static Boolean getDefaultHtmlEscape(ServletContext servletContext)
Return whether default HTML escaping is enabled for the web application, i.e. the value of the "defaultHtmlEscape" context-param in web.xml (if any).

This method differentiates between no param specified at all and an actual boolean value specified, allowing to have a context-specific default in case of no setting at the global level.

Parameters:
servletContext - the servlet context of the web application
Returns:
whether default HTML escaping is enabled (null = no explicit default)

getTempDir

public static File getTempDir(ServletContext servletContext)
Return the temporary directory for the current web application, as provided by the servlet container.

Parameters:
servletContext - the servlet context of the web application
Returns:
the File representing the temporary directory

getRealPath

public static String getRealPath(ServletContext servletContext,
                                 String path)
                          throws FileNotFoundException
Return the real path of the given path within the web application, as provided by the servlet container.

Prepends a slash if the path does not already start with a slash, and throws a FileNotFoundException if the path cannot be resolved to a resource (in contrast to ServletContext's getRealPath, which returns null).

Parameters:
servletContext - the servlet context of the web application
path - the path within the web application
Returns:
the corresponding real path
Throws:
FileNotFoundException - if the path cannot be resolved to a resource
See Also:
ServletContext.getRealPath(java.lang.String)

getSessionId

public static String getSessionId(HttpServletRequest request)
Determine the session id of the given request, if any.

Parameters:
request - current HTTP request
Returns:
the session id, or null if none

getSessionAttribute

public static Object getSessionAttribute(HttpServletRequest request,
                                         String name)
Check the given request for a session attribute of the given name. Returns null if there is no session or if the session has no such attribute. Does not create a new session if none has existed before!

Parameters:
request - current HTTP request
name - the name of the session attribute
Returns:
the value of the session attribute, or null if not found

getRequiredSessionAttribute

public static Object getRequiredSessionAttribute(HttpServletRequest request,
                                                 String name)
                                          throws IllegalStateException
Check the given request for a session attribute of the given name. Throws an exception if there is no session or if the session has no such attribute. Does not create a new session if none has existed before!

Parameters:
request - current HTTP request
name - the name of the session attribute
Returns:
the value of the session attribute, or null if not found
Throws:
IllegalStateException - if the session attribute could not be found

setSessionAttribute

public static void setSessionAttribute(HttpServletRequest request,
                                       String name,
                                       Object value)
Set the session attribute with the given name to the given value. Removes the session attribute if value is null, if a session existed at all. Does not create a new session if not necessary!

Parameters:
request - current HTTP request
name - the name of the session attribute
value - the value of the session attribute

getOrCreateSessionAttribute

public static Object getOrCreateSessionAttribute(HttpSession session,
                                                 String name,
                                                 Class clazz)
                                          throws IllegalArgumentException
Get the specified session attribute, creating and setting a new attribute if no existing found. The given class needs to have a public no-arg constructor. Useful for on-demand state objects in a web tier, like shopping carts.

Parameters:
session - current HTTP session
name - the name of the session attribute
clazz - the class to instantiate for a new attribute
Returns:
the value of the session attribute, newly created if not found
Throws:
IllegalArgumentException - if the session attribute could not be instantiated

getSessionMutex

public static Object getSessionMutex(HttpSession session)
Return the best available mutex for the given session: that is, an object to synchronize on for the given session.

Returns the session mutex attribute if available; usually, this means that the HttpSessionMutexListener needs to be defined in web.xml. Falls back to the HttpSession itself if no mutex attribute found.

The session mutex is guaranteed to be the same object during the entire lifetime of the session, available under the key defined by the SESSION_MUTEX_ATTRIBUTE constant. It serves as a safe reference to synchronize on for locking on the current session.

In many cases, the HttpSession reference itself is a safe mutex as well, since it will always be the same object reference for the same active logical session. However, this is not guaranteed across different servlet containers; the only 100% safe way is a session mutex.

Parameters:
session - the HttpSession to find a mutex for
Returns:
the mutex object (never null)
See Also:
SESSION_MUTEX_ATTRIBUTE, HttpSessionMutexListener

isIncludeRequest

public static boolean isIncludeRequest(ServletRequest request)
Determine whether the given request is an include request, that is, not a top-level HTTP request coming in from the outside.

Checks the presence of the "javax.servlet.include.request_uri" request attribute. Could check any request attribute that is only present in an include request.

Parameters:
request - current servlet request
Returns:
whether the given request is an include request

exposeForwardRequestAttributes

public static void exposeForwardRequestAttributes(HttpServletRequest request)
Expose the current request URI and paths as HttpServletRequest attributes under the keys defined in the Servlet 2.4 specification, for containers that implement 2.3 or an earlier version of the Servlet API: javax.servlet.forward.request_uri, javax.servlet.forward.context_path, javax.servlet.forward.servlet_path, javax.servlet.forward.path_info, javax.servlet.forward.query_string.

Does not override values if already present, to not cause conflicts with the attributes exposed by Servlet 2.4+ containers themselves.

Parameters:
request - current servlet request

exposeErrorRequestAttributes

public static void exposeErrorRequestAttributes(HttpServletRequest request,
                                                Throwable ex,
                                                String servletName)
Expose the Servlet spec's error attributes as HttpServletRequest attributes under the keys defined in the Servlet 2.3 specification, for error pages that are rendered directly rather than through the Servlet container's error page resolution: javax.servlet.error.status_code, javax.servlet.error.exception_type, javax.servlet.error.message, javax.servlet.error.exception, javax.servlet.error.request_uri, javax.servlet.error.servlet_name.

Does not override values if already present, to respect attribute values that have been exposed explicitly before.

Exposes status code 200 by default. Set the "javax.servlet.error.status_code" attribute explicitly (before or after) in order to expose a different status code.

Parameters:
request - current servlet request
ex - the exception encountered
servletName - the name of the offending servlet

clearErrorRequestAttributes

public static void clearErrorRequestAttributes(HttpServletRequest request)
Clear the Servlet spec's error attributes as HttpServletRequest attributes under the keys defined in the Servlet 2.3 specification: javax.servlet.error.status_code, javax.servlet.error.exception_type, javax.servlet.error.message, javax.servlet.error.exception, javax.servlet.error.request_uri, javax.servlet.error.servlet_name.

Parameters:
request - current servlet request

exposeRequestAttributes

public static void exposeRequestAttributes(ServletRequest request,
                                           Map<String,?> attributes)
Expose the given Map as request attributes, using the keys as attribute names and the values as corresponding attribute values. Keys need to be Strings.

Parameters:
request - current HTTP request
attributes - the attributes Map

getCookie

public static Cookie getCookie(HttpServletRequest request,
                               String name)
Retrieve the first cookie with the given name. Note that multiple cookies can have the same name but different paths or domains.

Parameters:
request - current servlet request
name - cookie name
Returns:
the first cookie with the given name, or null if none is found

hasSubmitParameter

public static boolean hasSubmitParameter(ServletRequest request,
                                         String name)
Check if a specific input type="submit" parameter was sent in the request, either via a button (directly with name) or via an image (name + ".x" or name + ".y").

Parameters:
request - current HTTP request
name - name of the parameter
Returns:
if the parameter was sent
See Also:
SUBMIT_IMAGE_SUFFIXES

findParameterValue

public static String findParameterValue(ServletRequest request,
                                        String name)
Obtain a named parameter from the given request parameters.

See findParameterValue(java.util.Map, String) for a description of the lookup algorithm.

Parameters:
request - current HTTP request
name - the logical name of the request parameter
Returns:
the value of the parameter, or null if the parameter does not exist in given request

findParameterValue

public static String findParameterValue(Map<String,?> parameters,
                                        String name)
Obtain a named parameter from the given request parameters.

This method will try to obtain a parameter value using the following algorithm:

  1. Try to get the parameter value using just the given logical name. This handles parameters of the form logicalName = value. For normal parameters, e.g. submitted using a hidden HTML form field, this will return the requested value.
  2. Try to obtain the parameter value from the parameter name, where the parameter name in the request is of the form logicalName_value = xyz with "_" being the configured delimiter. This deals with parameter values submitted using an HTML form submit button.
  3. If the value obtained in the previous step has a ".x" or ".y" suffix, remove that. This handles cases where the value was submitted using an HTML form image button. In this case the parameter in the request would actually be of the form logicalName_value.x = 123.

Parameters:
parameters - the available parameter map
name - the logical name of the request parameter
Returns:
the value of the parameter, or null if the parameter does not exist in given request

getParametersStartingWith

public static Map<String,Object> getParametersStartingWith(ServletRequest request,
                                                           String prefix)
Return a map containing all parameters with the given prefix. Maps single values to String and multiple values to String array.

For example, with a prefix of "spring_", "spring_param1" and "spring_param2" result in a Map with "param1" and "param2" as keys.

Parameters:
request - HTTP request in which to look for parameters
prefix - the beginning of parameter names (if this is null or the empty string, all parameters will match)
Returns:
map containing request parameters without the prefix, containing either a String or a String array as values
See Also:
ServletRequest.getParameterNames(),
ServletRequest.getParameterValues(java.lang.String),
ServletRequest.getParameterMap()

getTargetPage

public static int getTargetPage(ServletRequest request,
                                String paramPrefix,
                                int currentPage)
Return the target page specified in the request.

Parameters:
request - current servlet request
paramPrefix - the parameter prefix to check for (e.g. "_target" for parameters like "_target1" or "_target2")
currentPage - the current page, to be returned as fallback if no target page specified
Returns:
the page specified in the request, or current page if not found

extractFilenameFromUrlPath

public static String extractFilenameFromUrlPath(String urlPath)
Extract the URL filename from the given request URL path. Correctly resolves nested paths such as "/products/view.html" as well.

Parameters:
urlPath - the request URL path (e.g. "/index.html")
Returns:
the extracted URI filename (e.g. "index")

extractFullFilenameFromUrlPath

public static String extractFullFilenameFromUrlPath(String urlPath)
Extract the full URL filename (including file extension) from the given request URL path. Correctly resolves nested paths such as "/products/view.html" as well.

Parameters:
urlPath - the request URL path (e.g. "/products/index.html")
Returns:
the extracted URI filename (e.g. "index.html")
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


NestedServletException

org.springframework.web.util
Class NestedServletException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.servlet.ServletException
                extended by  org.springframework.web.util.NestedServletException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ServletRequestBindingException
public class NestedServletException
extends ServletException

Subclass of ServletException that properly handles a root cause in terms of message and stacktrace, just like NestedChecked/RuntimeException does.

Note that the plain ServletException doesn't expose its root cause at all, neither in the exception message nor in printed stack traces! While this might be fixed in later Servlet API variants (which even differ per vendor for the same API version), it is not reliably available on Servlet 2.4 (the minimum version required by Spring 3.x), which is why we need to do it ourselves.

The similarity between this class and the NestedChecked/RuntimeException class is unavoidable, as this class needs to derive from ServletException.

Since:
1.2.5
Author:
Juergen Hoeller
See Also:
getMessage(), Throwable.printStackTrace(), NestedCheckedException, NestedRuntimeException, Serialized Form

Constructor Summary
NestedServletException(String msg)
Construct a NestedServletException with the specified detail message.
NestedServletException(String msg, Throwable cause)
Construct a NestedServletException with the specified detail message and nested exception.
Method Summary
 String getMessage()
Return the detail message, including the message from the nested exception if there is one.
Methods inherited from class javax.servlet.ServletException
getRootCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

NestedServletException

public NestedServletException(String msg)
Construct a NestedServletException with the specified detail message.

Parameters:
msg - the detail message

NestedServletException

public NestedServletException(String msg,
                              Throwable cause)
Construct a NestedServletException with the specified detail message and nested exception.

Parameters:
msg - the detail message
cause - the nested exception
Method Detail

getMessage

public String getMessage()
Return the detail message, including the message from the nested exception if there is one.

Overrides:
getMessage in class Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


 All Classes
AbstractAdvisorAutoProxyCreator
AbstractAnnotationAwareTransactionalTests
AbstractApplicationContext
AbstractApplicationEventMulticaster
AbstractAspectJAdvice
AbstractAspectJAdvisorFactory
AbstractAspectJAdvisorFactory.AspectJAnnotation
AbstractAspectJAdvisorFactory.AspectJAnnotationType
AbstractAspectjJpaTests
AbstractAtomFeedView
AbstractAutoProxyCreator
AbstractAutowireCapableBeanFactory
AbstractBeanDefinition
AbstractBeanDefinitionParser
AbstractBeanDefinitionReader
AbstractBeanFactory
AbstractBeanFactoryBasedTargetSource
AbstractBeanFactoryBasedTargetSourceCreator
AbstractBeanFactoryPointcutAdvisor
AbstractBindingResult
AbstractCachingLabeledEnumResolver
AbstractCachingViewResolver
AbstractCheckedElementTag
AbstractClassTestingTypeFilter
AbstractClientHttpRequest
AbstractColumnMaxValueIncrementer
AbstractCommandController
AbstractCommandController
AbstractComponentDefinition
AbstractConfigurableMBeanInfoAssembler
AbstractContextLoader
AbstractController
AbstractController
AbstractControllerUrlHandlerMapping
AbstractDataBoundFormElementTag
AbstractDataFieldMaxValueIncrementer
AbstractDataSource
AbstractDependencyInjectionSpringContextTests
AbstractDetectingUrlHandlerMapping
AbstractDriverBasedDataSource
AbstractEnterpriseBean
AbstractEntityManagerFactoryBean
AbstractErrors
AbstractExcelView
AbstractExpressionPointcut
AbstractFactoryBean
AbstractFallbackSQLExceptionTranslator
AbstractFallbackTransactionAttributeSource
AbstractFeedView
AbstractFileResolvingResource
AbstractFormController
AbstractFormController
AbstractFormTag
AbstractGenericContextLoader
AbstractGenericLabeledEnum
AbstractGenericPointcutAdvisor
AbstractHandlerExceptionResolver
AbstractHandlerExceptionResolver
AbstractHandlerMapping
AbstractHandlerMapping
AbstractHtmlElementBodyTag
AbstractHtmlElementTag
AbstractHtmlInputElementTag
AbstractHttpInvokerRequestExecutor
AbstractHttpMessageConverter
AbstractInterceptorDrivenBeanDefinitionDecorator
AbstractInterruptibleBatchPreparedStatementSetter
AbstractJasperReportsSingleFormatView
AbstractJasperReportsView
AbstractJaxb2HttpMessageConverter
AbstractJaxWsServiceExporter
AbstractJdbcCall
AbstractJdbcInsert
AbstractJExcelView
AbstractJmsListeningContainer
AbstractJmsListeningContainer.SharedConnectionNotInitializedException
AbstractJmsMessageDrivenBean
AbstractJmxAttribute
AbstractJpaTests
AbstractJpaVendorAdapter
AbstractJUnit38SpringContextTests
AbstractJUnit4SpringContextTests
AbstractLabeledEnum
AbstractLazyCreationTargetSource
AbstractLobCreatingPreparedStatementCallback
AbstractLobHandler
AbstractLobStreamingResultSetExtractor
AbstractLobType
AbstractLobTypeHandler
AbstractLocaleResolver
AbstractMapBasedHandlerMapping
AbstractMapBasedHandlerMapping.PortletRequestMappingPredicate
AbstractMarshaller
AbstractMBeanInfoAssembler
AbstractMessageDrivenBean
AbstractMessageEndpointFactory
AbstractMessageListenerContainer
AbstractMessageSource
AbstractModelAndViewTests
AbstractMonitoringInterceptor
AbstractMultiCheckedElementTag
AbstractMultipartHttpServletRequest
AbstractNumberFormatter
AbstractPdfStamperView
AbstractPdfView
AbstractPlatformTransactionManager
AbstractPlatformTransactionManager.SuspendedResourcesHolder
AbstractPointcutAdvisor
AbstractPollingMessageListenerContainer
AbstractPoolingTargetSource
AbstractPropertyAccessor
AbstractPropertyBindingResult
AbstractPrototypeBasedTargetSource
AbstractReflectiveMBeanInfoAssembler
AbstractRefreshableApplicationContext
AbstractRefreshableConfigApplicationContext
AbstractRefreshablePortletApplicationContext
AbstractRefreshableTargetSource
AbstractRefreshableWebApplicationContext
AbstractRegexpMethodPointcut
AbstractRemoteSlsbInvokerInterceptor
AbstractRequestAttributes
AbstractRequestAttributesScope
AbstractRequestLoggingFilter
AbstractResource
AbstractRoutingDataSource
AbstractRssFeedView
AbstractSequenceMaxValueIncrementer
AbstractServiceLoaderBasedFactoryBean
AbstractSessionBean
AbstractSessionFactoryBean
AbstractSimpleBeanDefinitionParser
AbstractSingleBeanDefinitionParser
AbstractSingleCheckedElementTag
AbstractSingleSpringContextTests
AbstractSingletonProxyFactoryBean
AbstractSlsbInvokerInterceptor
AbstractSpringContextTests
AbstractSpringPreparerFactory
AbstractSqlParameterSource
AbstractSqlTypeValue
AbstractStatefulSessionBean
AbstractStatelessSessionBean
AbstractTemplateView
AbstractTemplateViewResolver
AbstractTestExecutionListener
AbstractTestNGSpringContextTests
AbstractThemeResolver
AbstractTraceInterceptor
AbstractTransactionalDataSourceSpringContextTests
AbstractTransactionalJUnit38SpringContextTests
AbstractTransactionalJUnit4SpringContextTests
AbstractTransactionalSpringContextTests
AbstractTransactionalTestNGSpringContextTests
AbstractTransactionStatus
AbstractTypeHierarchyTraversingFilter
AbstractUrlBasedView
AbstractUrlHandlerMapping
AbstractUrlMethodNameResolver
AbstractUrlViewController
AbstractView
AbstractWireFeedHttpMessageConverter
AbstractWizardFormController
AbstractWizardFormController
AbstractXmlApplicationContext
AbstractXmlHttpMessageConverter
AbstractXsltView
AcceptHeaderLocaleResolver
AccessException
ActionMapping
ActionSupport
AdaptableJobFactory
AdviceEntry
Advised
AdvisedSupport
AdvisedSupportListener
Advisor
AdvisorAdapter
AdvisorAdapterRegistrationManager
AdvisorAdapterRegistry
AdvisorChainFactory
AdvisorComponentDefinition
AdvisorEntry
AfterAdvice
AfterReturningAdvice
AfterReturningAdviceInterceptor
AfterTransaction
AliasDefinition
AliasRegistry
AnnotatedBeanDefinition
AnnotatedBeanDefinitionReader
AnnotatedGenericBeanDefinition
AnnotationAwareAspectJAutoProxyCreator
AnnotationAwareOrderComparator
AnnotationBeanNameGenerator
AnnotationBeanUtils
AnnotationBeanWiringInfoResolver
AnnotationClassFilter
AnnotationConfigApplicationContext
AnnotationConfigBeanDefinitionParser
AnnotationConfigUtils
AnnotationConfigWebApplicationContext
AnnotationDrivenBeanDefinitionParser
AnnotationFormatterFactory
AnnotationJmxAttributeSource
AnnotationMatchingPointcut
AnnotationMBeanExporter
AnnotationMetadata
AnnotationMethodHandlerAdapter
AnnotationMethodHandlerAdapter
AnnotationMethodHandlerExceptionResolver
AnnotationMethodHandlerExceptionResolver
AnnotationMethodMatcher
AnnotationScopeMetadataResolver
AnnotationSessionFactoryBean
AnnotationTransactionAttributeSource
AnnotationTypeFilter
AnnotationUtils
AntPathMatcher
AopConfigException
AopConfigUtils
AopContext
AopInfrastructureBean
AopInvocationException
AopNamespaceHandler
AopNamespaceUtils
AopProxy
AopProxyFactory
AopProxyUtils
AopUtils
ApplicationContext
ApplicationContextAware
ApplicationContextEvent
ApplicationContextException
ApplicationEvent
ApplicationEventMulticaster
ApplicationEventPublisher
ApplicationEventPublisherAware
ApplicationListener
ApplicationObjectSupport
ArgumentConvertingMethodInvoker
AspectComponentDefinition
AspectEntry
AspectInstanceFactory
AspectJAdviceParameterNameDiscoverer
AspectJAdviceParameterNameDiscoverer.AmbiguousBindingException
AspectJAdvisorFactory
AspectJAfterAdvice
AspectJAfterReturningAdvice
AspectJAfterThrowingAdvice
AspectJAopUtils
AspectJAroundAdvice
AspectJAwareAdvisorAutoProxyCreator
AspectJExpressionPointcut
AspectJExpressionPointcutAdvisor
AspectJMethodBeforeAdvice
AspectJPointcutAdvisor
AspectJPrecedenceInformation
AspectJProxyFactory
AspectJProxyUtils
AspectJTypeFilter
AspectJWeaverMessageHandler
AspectJWeavingEnabler
AspectMetadata
Assert
AssertThrows
Assign
AssignableTypeFilter
AstUtils
Async
AsyncAnnotationAdvisor
AsyncAnnotationBeanPostProcessor
AsyncExecutionInterceptor
AsyncResult
AsyncTaskExecutor
AtomFeedHttpMessageConverter
AttributeAccessor
AttributeAccessorSupport
AutodetectCapableMBeanInfoAssembler
AutoPopulatingList
AutoPopulatingList.ElementFactory
AutoPopulatingList.ElementInstantiationException
AutoProxyUtils
Autowire
AutowireCandidateQualifier
AutowireCandidateResolver
AutowireCapableBeanFactory
Autowired
AutowiredAnnotationBeanPostProcessor
AutowiringRequestProcessor
AutowiringTilesRequestProcessor
BadSqlGrammarException
BaseCommandController
BaseCommandController
BatchPreparedStatementSetter
BatchSqlUpdate
BatchUpdateUtils
Bean
BeanClassLoaderAware
BeanComponentDefinition
BeanConfigurerSupport
BeanCreationException
BeanCreationNotAllowedException
BeanCurrentlyInCreationException
BeanDefinition
BeanDefinitionBuilder
BeanDefinitionDecorator
BeanDefinitionDefaults
BeanDefinitionDocumentReader
BeanDefinitionHolder
BeanDefinitionParser
BeanDefinitionParserDelegate
BeanDefinitionParsingException
BeanDefinitionReader
BeanDefinitionReaderUtils
BeanDefinitionRegistry
BeanDefinitionRegistryPostProcessor
BeanDefinitionStoreException
BeanDefinitionValidationException
BeanDefinitionVisitor
BeanEntry
BeanExpressionContext
BeanExpressionContextAccessor
BeanExpressionException
BeanExpressionResolver
BeanFactory
BeanFactoryAccessor
BeanFactoryAdvisorRetrievalHelper
BeanFactoryAspectInstanceFactory
BeanFactoryAspectJAdvisorsBuilder
BeanFactoryAware
BeanFactoryDataSourceLookup
BeanFactoryDestinationResolver
BeanFactoryLocator
BeanFactoryPostProcessor
BeanFactoryReference
BeanFactoryRefreshableTargetSource
BeanFactoryTransactionAttributeSourceAdvisor
BeanFactoryUtils
BeanInitializationException
BeanInstantiationException
BeanIsAbstractException
BeanIsNotAFactoryException
BeanMetadataAttribute
BeanMetadataAttributeAccessor
BeanMetadataElement
BeanNameAutoProxyCreator
BeanNameAware
BeanNameGenerator
BeanNameUrlHandlerMapping
BeanNameViewResolver
BeanNotOfRequiredTypeException
BeanPostProcessor
BeanPropertyBindingResult
BeanPropertyRowMapper
BeanPropertySqlParameterSource
BeanReference
BeanReferenceFactoryBean
BeansDtdResolver
BeansException
BeanUtils
BeanValidationPostProcessor
BeanWiringInfo
BeanWiringInfoResolver
BeanWrapper
BeanWrapperImpl
BeforeAdvice
BeforeTransaction
BindErrorsTag
BindException
BindingAwareModelMap
BindingErrorProcessor
BindingResult
BindingResultUtils
BindStatus
BindTag
BlobByteArrayType
BlobByteArrayTypeHandler
BlobSerializableType
BlobSerializableTypeHandler
BlobStringType
BooleanComparator
BooleanLiteral
BooleanTypedValue
BootstrapContextAware
BootstrapException
BridgeMethodResolver
BrowserCallback
BshScriptFactory
BshScriptUtils
BshScriptUtils.BshExecutionException
BufferedImageHttpMessageConverter
BurlapClientInterceptor
BurlapExporter
BurlapProxyFactoryBean
BurlapServiceExporter
ByteArrayHttpMessageConverter
ByteArrayMultipartFileEditor
ByteArrayPropertyEditor
ByteArrayResource
C3P0NativeJdbcExtractor
CachedIntrospectionResults
CachingConnectionFactory
CachingDestinationResolver
CachingMapDecorator
CachingMetadataReaderFactory
CallableStatementCallback
CallableStatementCreator
CallableStatementCreatorFactory
CallbackPreferringPlatformTransactionManager
CallMetaDataContext
CallMetaDataProvider
CallMetaDataProviderFactory
CallParameterMetaData
CancellableFormController
CannotAcquireLockException
CannotCreateRecordException
CannotCreateTransactionException
CannotGetCciConnectionException
CannotGetJdbcConnectionException
CannotLoadBeanClassException
CannotReadScriptException
CannotSerializeTransactionException
CastorMappingException
CastorMarshaller
CciDaoSupport
CciLocalTransactionManager
CciOperationNotSupportedException
CciOperations
CciTemplate
CglibSubclassingInstantiationStrategy
ChainedExceptionListener
ChainedPersistenceExceptionTranslator
CharacterEditor
CharacterEncodingFilter
CharArrayPropertyEditor
CharsetEditor
CheckboxesTag
CheckboxTag
ChildBeanDefinition
ClassArrayEditor
ClassEditor
ClassFilter
ClassFilters
ClassMetadata
ClassNameBeanWiringInfoResolver
ClassPathBeanDefinitionScanner
ClassPathResource
ClassPathScanningCandidateComponentProvider
ClassPathXmlApplicationContext
ClassRelativeResourceLoader
ClassUtils
CleanupFailureDataAccessException
ClientHttpRequest
ClientHttpRequestFactory
ClientHttpResponse
ClobStringType
ClobStringTypeHandler
CodebaseAwareObjectInputStream
CollectionFactory
CollectionUtils
ColumnMapRowMapper
CommAreaRecord
CommonAnnotationBeanPostProcessor
CommonsClientHttpRequestFactory
CommonsDbcpNativeJdbcExtractor
CommonsFileUploadSupport
CommonsFileUploadSupport.MultipartParsingResult
CommonsHttpInvokerRequestExecutor
CommonsLogFactoryBean
CommonsLoggingLogSystem
CommonsLogWriter
CommonsMultipartFile
CommonsMultipartResolver
CommonsPoolTargetSource
CommonsPortletMultipartResolver
CommonsRequestLoggingFilter
ComparableComparator
Component
ComponentControllerSupport
ComponentDefinition
ComponentScanBeanDefinitionParser
ComposablePointcut
CompositeComponentDefinition
CompositeIterator
CompositeStringExpression
CompositeTransactionAttributeSource
CompoundComparator
CompoundExpression
ConcurrencyFailureException
ConcurrencyThrottleInterceptor
ConcurrencyThrottleSupport
ConcurrentExecutorAdapter
ConcurrentMap
ConcurrentTaskExecutor
ConcurrentTaskExecutor
ConcurrentTaskScheduler
ConditionalGenericConverter
ConditionalTestCase
Configurable
ConfigurableApplicationContext
ConfigurableBeanFactory
ConfigurableJasperReportsView
ConfigurableListableBeanFactory
ConfigurableMimeFileTypeMap
ConfigurableObject
ConfigurableObjectInputStream
ConfigurablePortletApplicationContext
ConfigurablePropertyAccessor
ConfigurableWebApplicationContext
ConfigurableWebBindingInitializer
Configuration
ConfigurationClassPostProcessor
ConnectionCallback
ConnectionCallback
ConnectionFactoryUtils
ConnectionFactoryUtils
ConnectionFactoryUtils.ResourceFactory
ConnectionHandle
ConnectionHolder
ConnectionHolder
ConnectionProperties
ConnectionProxy
ConnectionSpecConnectionFactoryAdapter
ConnectorServerFactoryBean
ConstantException
Constants
ConstructorArgumentEntry
ConstructorArgumentValues
ConstructorArgumentValues.ValueHolder
ConstructorExecutor
ConstructorReference
ConstructorResolver
ContentNegotiatingViewResolver
ContextBeanFactoryReference
ContextCleanupListener
ContextClosedEvent
ContextConfiguration
ContextExposingHttpServletRequest
ContextJndiBeanFactoryLocator
ContextLoader
ContextLoader
ContextLoaderListener
ContextLoaderPlugIn
ContextNamespaceHandler
ContextRefreshedEvent
ContextResource
ContextSingletonBeanFactoryLocator
ContextStartedEvent
ContextStoppedEvent
ControlFlow
ControlFlowFactory
ControlFlowPointcut
Controller
Controller
Controller
ControllerBeanNameHandlerMapping
ControllerClassNameHandlerMapping
Conventions
ConversionException
ConversionFailedException
ConversionNotSupportedException
ConversionService
ConversionServiceExposingInterceptor
ConversionServiceFactory
ConversionServiceFactoryBean
Converter
ConverterFactory
ConverterNotFoundException
ConverterRegistry
ConvertingPropertyEditorAdapter
CookieGenerator
CookieLocaleResolver
CookieThemeResolver
CookieValue
CronSequenceGenerator
CronTrigger
CronTriggerBean
CurrencyEditor
CurrencyFormatter
CustomAutowireConfigurer
CustomBooleanEditor
CustomCollectionEditor
CustomDateEditor
CustomEditorConfigurer
CustomizableThreadCreator
CustomizableThreadFactory
CustomizableThreadFactory
CustomizableTraceInterceptor
CustomMapEditor
CustomNumberEditor
CustomScopeConfigurer
CustomSQLErrorCodesTranslation
CustomValidatorBean
DaoSupport
DataAccessException
DataAccessResourceFailureException
DataAccessUtils
Database
DatabaseMetaDataCallback
DatabasePopulator
DatabaseStartupValidator
DataBinder
DataFieldMaxValueIncrementer
DataIntegrityViolationException
DataRetrievalFailureException
DataSourceFactory
DataSourceInitializer
DataSourceLookup
DataSourceLookupFailureException
DataSourceTransactionManager
DataSourceUtils
DateFormatter
DateTimeFormat
DateTimeFormat.ISO
DateTimeParser
Db2CallMetaDataProvider
DB2MainframeSequenceMaxValueIncrementer
DB2SequenceMaxValueIncrementer
DeadlockLoserDataAccessException
DebugInterceptor
DeclareParentsAdvisor
DecoratingClassLoader
DecoratingNavigationHandler
DefaultAdvisorAdapterRegistry
DefaultAdvisorAutoProxyCreator
DefaultAdvisorChainFactory
DefaultAnnotationHandlerMapping
DefaultAnnotationHandlerMapping
DefaultAopProxyFactory
DefaultBeanDefinitionDocumentReader
DefaultBeanFactoryPointcutAdvisor
DefaultBeanNameGenerator
DefaultBindingErrorProcessor
DefaultContextLoadTimeWeaver
DefaultDocumentLoader
DefaultHandlerExceptionResolver
DefaultIntroductionAdvisor
DefaultJdoDialect
DefaultJmsActivationSpecFactory
DefaultJpaDialect
DefaultLifecycleProcessor
DefaultListableBeanFactory
DefaultLobHandler
DefaultLocatorFactory
DefaultMessageCodesResolver
DefaultMessageListenerContainer
DefaultMessageListenerContainer102
DefaultMessageSourceResolvable
DefaultMultipartActionRequest
DefaultMultipartHttpServletRequest
DefaultNamespaceHandlerResolver
DefaultPersistenceUnitManager
DefaultPointcutAdvisor
DefaultPropertiesPersister
DefaultRemoteInvocationExecutor
DefaultRemoteInvocationFactory
DefaultRequestToViewNameTranslator
DefaultResourceLoader
DefaultResponseErrorHandler
DefaultScopedObject
DefaultsDefinition
DefaultSessionAttributeStore
DefaultSingletonBeanRegistry
DefaultToStringStyler
DefaultTransactionAttribute
DefaultTransactionDefinition
DefaultTransactionStatus
DefaultValueStyler
DelegatePerTargetObjectIntroductionInterceptor
DelegatingActionProxy
DelegatingActionUtils
DelegatingConnectionFactory
DelegatingConnectionFactory
DelegatingDataSource
DelegatingEntityResolver
DelegatingErrorHandlingRunnable
DelegatingFilterProxy
DelegatingIntroductionInterceptor
DelegatingJob
DelegatingMessageSource
DelegatingNavigationHandlerProxy
DelegatingPhaseListenerMulticaster
DelegatingRequestProcessor
DelegatingServletInputStream
DelegatingServletOutputStream
DelegatingThemeSource
DelegatingTilesRequestProcessor
DelegatingTimerListener
DelegatingTimerTask
DelegatingTransactionAttribute
DelegatingTransactionDefinition
DelegatingVariableResolver
DelegatingWork
DelegatingWork
DependencyDescriptor
DependencyInjectionTestExecutionListener
DependsOn
DerbyCallMetaDataProvider
DerbyMaxValueIncrementer
DerbyTableMetaDataProvider
DescriptiveResource
DestinationResolutionException
DestinationResolver
DestructionAwareBeanPostProcessor
DestructionCallbackBindingListener
DigestUtils
DirectFieldAccessor
DirectFieldBindingResult
DirtiesContext
DirtiesContext.ClassMode
DirtiesContextTestExecutionListener
DispatchActionSupport
DispatcherPortlet
DispatcherServlet
DispatcherServletWebRequest
DisposableBean
DisposableSqlTypeValue
DocumentDefaultsDefinition
DocumentLoader
DomUtils
DriverManagerDataSource
DuplicateKeyException
DynamicDestinationResolver
DynamicIntroductionAdvice
DynamicMethodMatcher
DynamicMethodMatcherPointcut
EclipseLinkJpaDialect
EclipseLinkJpaVendorAdapter
EditorAwareTag
EhCacheFactoryBean
EhCacheManagerFactoryBean
EisOperation
Ejb3TransactionAnnotationParser
EjbAccessException
Elvis
EmbeddedDatabase
EmbeddedDatabaseBeanDefinitionParser
EmbeddedDatabaseBuilder
EmbeddedDatabaseConfigurer
EmbeddedDatabaseFactory
EmbeddedDatabaseFactoryBean
EmbeddedDatabaseType
EmptyReaderEventListener
EmptyResultDataAccessException
EmptyTargetSource
EncodedResource
EntityManagerFactoryAccessor
EntityManagerFactoryInfo
EntityManagerFactoryPlus
EntityManagerFactoryPlusOperations
EntityManagerFactoryUtils
EntityManagerHolder
EntityManagerPlus
EntityManagerPlusOperations
EntityManagerProxy
ErrorCoded
ErrorHandler
Errors
ErrorsTag
EscapeBodyTag
EscapedErrors
EvalTag
EvaluationContext
EvaluationException
EventAwareController
EventMapping
EventPublicationInterceptor
ExceptionHandler
ExecutorBeanDefinitionParser
ExecutorConfigurationSupport
ExecutorServiceAdapter
ExpectedException
ExpectedLookupTemplate
ExposeBeanNameAdvisors
ExposeInvocationInterceptor
Expression
ExpressionEvaluationUtils
ExpressionException
ExpressionParser
ExpressionPointcut
ExpressionState
ExpressionUtils
ExtendedEntityManagerCreator
ExtendedModelMap
FacesContextUtils
FacesRequestAttributes
FacesWebRequest
FactoryBean
FactoryBeanNotInitializedException
FactoryBeanRegistrySupport
FailFastProblemReporter
FatalBeanException
FieldError
FieldRetrievingFactoryBean
FileCopyUtils
FileEditor
FileSystemResource
FileSystemResourceLoader
FileSystemUtils
FileSystemXmlApplicationContext
FilterDefinitionFactoryBean
FilterType
FixedLocaleResolver
FixedThemeResolver
FormatHelper
Formatter
FormatterRegistry
FormattingConversionService
FormattingConversionServiceFactoryBean
FormHttpMessageConverter
FormTag
FrameworkPortlet
FrameworkServlet
FreeMarkerConfig
FreeMarkerConfigurationFactory
FreeMarkerConfigurationFactoryBean
FreeMarkerConfigurer
FreeMarkerTemplateUtils
FreeMarkerView
FreeMarkerViewResolver
FunctionReference
GeneratedKeyHolder
GenericApplicationContext
GenericApplicationListenerAdapter
GenericBeanDefinition
GenericCallMetaDataProvider
GenericCollectionTypeResolver
GenericConversionService
GenericConverter
GenericConverter.ConvertiblePair
GenericFilterBean
GenericMarshaller
GenericMessageEndpointFactory
GenericMessageEndpointFactory.InternalResourceException
GenericMessageEndpointManager
GenericPortletBean
GenericPropertiesContextLoader
GenericSqlQuery
GenericStoredProcedure
GenericTableMetaDataProvider
GenericTypeResolver
GenericUnmarshaller
GenericWebApplicationContext
GenericXmlApplicationContext
GenericXmlContextLoader
GlassFishLoadTimeWeaver
GlassFishWorkManagerTaskExecutor
GlobalAdvisorAdapterRegistry
GroovyObjectCustomizer
GroovyScriptFactory
H2SequenceMaxValueIncrementer
HandlerAdapter
HandlerAdapter
HandlerExceptionResolver
HandlerExceptionResolver
HandlerExecutionChain
HandlerExecutionChain
HandlerInterceptor
HandlerInterceptor
HandlerInterceptorAdapter
HandlerInterceptorAdapter
HandlerMapping
HandlerMapping
HandlerMethodInvocationException
HandlerMethodInvoker
HandlerMethodResolver
HessianClientInterceptor
HessianExporter
HessianProxyFactoryBean
HessianServiceExporter
HeuristicCompletionException
HibernateAccessor
HibernateCallback
HibernateDaoSupport
HibernateInterceptor
HibernateJdbcException
HibernateJpaDialect
HibernateJpaVendorAdapter
HibernateObjectRetrievalFailureException
HibernateOperations
HibernateOptimisticLockingFailureException
HibernateQueryException
HibernateSystemException
HibernateTemplate
HibernateTransactionManager
HiddenHttpMethodFilter
HiddenInputTag
HierarchicalBeanFactory
HierarchicalMessageSource
HierarchicalThemeSource
HotSwappableTargetSource
HsqlMaxValueIncrementer
HsqlSequenceMaxValueIncrementer
HsqlTableMetaDataProvider
HtmlEscapeTag
HtmlEscapingAwareTag
HtmlUtils
HttpAccessor
HttpClientErrorException
HttpEntity
HttpHeaders
HttpInputMessage
HttpInvokerClientConfiguration
HttpInvokerClientInterceptor
HttpInvokerProxyFactoryBean
HttpInvokerRequestExecutor
HttpInvokerServiceExporter
HttpMediaTypeException
HttpMediaTypeNotAcceptableException
HttpMediaTypeNotSupportedException
HttpMessage
HttpMessageConversionException
HttpMessageConverter
HttpMessageConverterExtractor
HttpMessageNotReadableException
HttpMessageNotWritableException
HttpMethod
HttpOutputMessage
HttpRequestHandler
HttpRequestHandlerAdapter
HttpRequestHandlerServlet
HttpRequestMethodNotSupportedException
HttpServerErrorException
HttpServletBean
HttpSessionMutexListener
HttpSessionRequiredException
HttpStatus
HttpStatus.Series
HttpStatusCodeException
Identifier
IdentityNamingStrategy
IdTransferringMergeEventListener
IfProfileValue
IllegalStateException
IllegalTransactionStateException
Import
ImportDefinition
ImportResource
IncorrectResultSetColumnCountException
IncorrectResultSizeDataAccessException
IncorrectUpdateSemanticsDataAccessException
Indexer
InfrastructureAdvisorAutoProxyCreator
InfrastructureProxy
InitBinder
InitDestroyAnnotationBeanPostProcessor
InitializeDatabaseBeanDefinitionParser
InitializingBean
InjectionMetadata
InjectionMetadata.InjectedElement
InputStreamEditor
InputStreamResource
InputStreamSource
InputTag
InstantiationAwareBeanPostProcessor
InstantiationAwareBeanPostProcessorAdapter
InstantiationModelAwarePointcutAdvisor
InstantiationStrategy
InstrumentationLoadTimeWeaver
InstrumentationSavingAgent
InteractionCallback
InterfaceBasedMBeanInfoAssembler
InternalParseException
InternalPathMethodNameResolver
InternalResourceView
InternalResourceViewResolver
InternetAddressEditor
InterruptibleBatchPreparedStatementSetter
IntLiteral
IntroductionAdvisor
IntroductionAwareMethodMatcher
IntroductionInfo
IntroductionInfoSupport
IntroductionInterceptor
IntrospectorCleanupListener
InvalidClientIDException
InvalidDataAccessApiUsageException
InvalidDataAccessResourceUsageException
InvalidDestinationException
InvalidInvocationException
InvalidIsolationLevelException
InvalidMetadataException
InvalidPropertyException
InvalidResultSetAccessException
InvalidResultSetAccessException
InvalidSelectorException
InvalidTimeoutException
InvertibleComparator
InvocationFailureException
Isolation
IsolationLevelDataSourceAdapter
IsolationLevelDataSourceRouter
JamonPerformanceMonitorInterceptor
JasperReportsCsvView
JasperReportsHtmlView
JasperReportsMultiFormatView
JasperReportsPdfView
JasperReportsUtils
JasperReportsViewResolver
JasperReportsXlsView
JavaMailSender
JavaMailSenderImpl
JavaScriptUtils
Jaxb2Marshaller
Jaxb2RootElementHttpMessageConverter
JaxRpcPortClientInterceptor
JaxRpcPortProxyFactoryBean
JaxRpcServicePostProcessor
JaxRpcSoapFaultException
JaxWsPortClientInterceptor
JaxWsPortProxyFactoryBean
JaxWsSoapFaultException
JBossLoadTimeWeaver
JBossNativeJdbcExtractor
JBossWorkManagerTaskExecutor
JBossWorkManagerUtils
Jdbc4NativeJdbcExtractor
Jdbc4SqlXmlHandler
JdbcAccessor
JdbcBeanDefinitionReader
JdbcDaoSupport
JdbcNamespaceHandler
JdbcOperations
JdbcTemplate
JdbcTestUtils
JdbcTransactionObjectSupport
JdbcUpdateAffectedIncorrectNumberOfRowsException
JdbcUtils
JdkRegexpMethodPointcut
JdkVersion
JdoAccessor
JdoCallback
JdoDaoSupport
JdoDialect
JdoInterceptor
JdoObjectRetrievalFailureException
JdoOperations
JdoOptimisticLockingFailureException
JdoResourceFailureException
JdoSystemException
JdoTemplate
JdoTransactionManager
JdoUsageException
JeeNamespaceHandler
JibxMarshaller
JmsAccessor
JmsActivationSpecConfig
JmsActivationSpecFactory
JmsDestinationAccessor
JmsException
JmsGatewaySupport
JmsInvokerClientInterceptor
JmsInvokerProxyFactoryBean
JmsInvokerServiceExporter
JmsMessageEndpointFactory
JmsMessageEndpointFactory.JmsResourceException
JmsMessageEndpointManager
JmsNamespaceHandler
JmsOperations
JmsResourceHolder
JmsSecurityException
JmsTemplate
JmsTemplate102
JmsTransactionManager
JmsTransactionManager102
JmsUtils
JmxAttributeSource
JmxException
JmxMetadataUtils
JmxUtils
JndiAccessor
JndiCallback
JndiDataSourceLookup
JndiDestinationResolver
JndiLocatorDelegate
JndiLocatorSupport
JndiLookupFailureException
JndiObjectFactoryBean
JndiObjectLocator
JndiObjectTargetSource
JndiRmiClientInterceptor
JndiRmiProxyFactoryBean
JndiRmiServiceExporter
JndiTemplate
JndiTemplateEditor
JobDetailAwareTrigger
JobDetailBean
JobMethodInvocationFailedException
JodaDateTimeFormatAnnotationFormatterFactory
JodaTimeContext
JodaTimeContextHolder
JodaTimeFormattingConfigurer
JpaAccessor
JpaCallback
JpaDaoSupport
JpaDialect
JpaInterceptor
JpaObjectRetrievalFailureException
JpaOperations
JpaOptimisticLockingFailureException
JpaSystemException
JpaTemplate
JpaTransactionManager
JpaVendorAdapter
JRubyScriptFactory
JRubyScriptUtils
JRubyScriptUtils.JRubyExecutionException
JspAwareRequestContext
Jsr330ScopeMetadataResolver
JstlUtils
JstlView
JtaAfterCompletionSynchronization
JtaLobCreatorSynchronization
JtaTransactionManager
JtaTransactionManagerBeanDefinitionParser
JtaTransactionObject
KeyHolder
KeyNamingStrategy
LabeledEnum
LabeledEnumResolver
LabelTag
LangNamespaceHandler
LangNamespaceUtils
LastModified
Lazy
LazyConnectionDataSourceProxy
LazyInitTargetSource
LazyInitTargetSourceCreator
LazySingletonAspectInstanceFactoryDecorator
LetterCodedLabeledEnum
Lifecycle
LifecycleProcessor
LinkedCaseInsensitiveMap
LinkedMultiValueMap
ListableBeanFactory
ListenerExecutionFailedException
ListFactoryBean
Literal
LiteralExpression
LoadTimeWeaver
LoadTimeWeaverAware
LoadTimeWeaverAwareProcessor
LobCreator
LobCreatorUtils
LobHandler
LobRetrievalFailureException
LocalCacheProviderProxy
LocalConnectionFactoryBean
LocalContainerEntityManagerFactoryBean
LocalDataSourceConnectionProvider
LocalDataSourceJobStore
LocaleChangeInterceptor
LocaleContext
LocaleContextHolder
LocaleContextMessageInterpolator
LocaleEditor
LocalEntityManagerFactoryBean
LocaleResolver
LocalizedResourceHelper
LocalJaxRpcServiceFactory
LocalJaxRpcServiceFactoryBean
LocalJaxWsServiceFactory
LocalJaxWsServiceFactoryBean
LocalJtaDataSourceConnectionProvider
LocalPersistenceManagerFactoryBean
LocalRegionFactoryProxy
LocalSessionFactoryBean
LocalSlsbInvokerInterceptor
LocalStatelessSessionProxyFactoryBean
LocalTaskExecutorThreadPool
LocalTransactionManagerLookup
LocalValidatorFactoryBean
LocalVariableTableParameterNameDiscoverer
Location
Log4jConfigListener
Log4jConfigurer
Log4jNestedDiagnosticContextFilter
Log4jNestedDiagnosticContextInterceptor
Log4jWebConfigurer
LongLiteral
LookupDispatchActionSupport
LookupOverride
MailAuthenticationException
MailException
MailMessage
MailParseException
MailPreparationException
MailSender
MailSendException
ManagedArray
ManagedAttribute
ManagedAttribute
ManagedList
ManagedMap
ManagedMetric
ManagedMetric
ManagedNotification
ManagedNotification
ManagedNotifications
ManagedOperation
ManagedOperation
ManagedOperationParameter
ManagedOperationParameter
ManagedOperationParameters
ManagedProperties
ManagedResource
ManagedResource
ManagedSet
ManagedTransactionAdapter
MapAccessor
MapBindingResult
MapDataSourceLookup
MapFactoryBean
MappedInterceptor
Mapping
MappingCommAreaOperation
MappingDispatchActionSupport
MappingJacksonHttpMessageConverter
MappingJacksonJsonView
MappingRecordOperation
MappingSqlQuery
MappingSqlQueryWithParameters
MapSqlParameterSource
Marshaller
MarshallingException
MarshallingFailureException
MarshallingHttpMessageConverter
MarshallingMessageConverter
MarshallingSource
MarshallingView
MatchAlwaysTransactionAttributeSource
MaxUploadSizeExceededException
MBeanClientInterceptor
MBeanConnectFailureException
MBeanExporter
MBeanExporterListener
MBeanExportException
MBeanExportOperations
MBeanInfoAssembler
MBeanInfoRetrievalException
MBeanProxyFactoryBean
MBeanRegistrationSupport
MBeanServerConnectionFactoryBean
MBeanServerFactoryBean
MBeanServerNotFoundException
MediaType
MediaTypeEditor
Mergeable
MergedBeanDefinitionPostProcessor
MessageCodesResolver
MessageConversionException
MessageConverter
MessageCreator
MessageEOFException
MessageFormatException
MessageListenerAdapter
MessageListenerAdapter102
MessageNotReadableException
MessageNotWriteableException
MessagePostProcessor
MessageSource
MessageSourceAccessor
MessageSourceAware
MessageSourceResolvable
MessageSourceResourceBundle
MessageSourceSupport
MessageTag
MessageType
MetaDataAccessException
MetadataAwareAspectInstanceFactory
MetadataMBeanInfoAssembler
MetadataNamingStrategy
MetadataReader
MetadataReaderFactory
MethodBeforeAdvice
MethodBeforeAdviceInterceptor
MethodExclusionMBeanInfoAssembler
MethodExecutor
MethodFilter
MethodInvocationException
MethodInvocationProceedingJoinPoint
MethodInvoker
MethodInvokingFactoryBean
MethodInvokingJobDetailFactoryBean
MethodInvokingJobDetailFactoryBean.MethodInvokingJob
MethodInvokingJobDetailFactoryBean.StatefulMethodInvokingJob
MethodInvokingRunnable
MethodInvokingTimerTaskFactoryBean
MethodLocatingFactoryBean
MethodMapTransactionAttributeSource
MethodMatcher
MethodMatchers
MethodMetadata
MethodNameBasedMBeanInfoAssembler
MethodNameResolver
MethodOverride
MethodOverrides
MethodParameter
MethodReference
MethodReplacer
MethodResolver
MetricType
MillisecondInstantPrinter
MimeContainer
MimeMailMessage
MimeMarshaller
MimeMessageHelper
MimeMessagePreparator
MimeUnmarshaller
MissingPortletRequestParameterException
MissingServletRequestParameterException
MockActionRequest
MockActionResponse
MockBaseURL
MockBodyContent
MockCacheControl
MockClientDataRequest
MockEvent
MockEventRequest
MockEventResponse
MockExpressionEvaluator
MockFilterChain
MockFilterConfig
MockHttpServletRequest
MockHttpServletResponse
MockHttpSession
MockJspWriter
MockMimeResponse
MockMultipartActionRequest
MockMultipartFile
MockMultipartHttpServletRequest
MockPageContext
MockPortalContext
MockPortletConfig
MockPortletContext
MockPortletPreferences
MockPortletRequest
MockPortletRequestDispatcher
MockPortletResponse
MockPortletSession
MockPortletURL
MockRenderRequest
MockRenderResponse
MockRequestDispatcher
MockResourceRequest
MockResourceResponse
MockResourceURL
MockServletConfig
MockServletContext
MockStateAwareResponse
MockStaticEntityMethods
Model
ModelAndView
ModelAndView
ModelAndViewAssert
ModelAndViewDefiningException
ModelAndViewDefiningException
ModelAndViewResolver
ModelAttribute
ModelMap
ModelMBeanNotificationPublisher
MultiActionController
MultipartActionRequest
MultipartException
MultipartFile
MultipartFilter
MultipartHttpServletRequest
MultipartRequest
MultipartResolver
MultiValueMap
MutablePersistenceUnitInfo
MutablePropertyValues
MutableSortDefinition
MvcNamespaceHandler
MySQLMaxValueIncrementer
NamedBean
NamedInheritableThreadLocal
NamedParameterBatchUpdateUtils
NamedParameterJdbcDaoSupport
NamedParameterJdbcOperations
NamedParameterJdbcTemplate
NamedParameterUtils
NamedThreadLocal
NameMatchMethodPointcut
NameMatchMethodPointcutAdvisor
NameMatchTransactionAttributeSource
NamespaceHandler
NamespaceHandlerResolver
NamespaceHandlerSupport
NativeJdbcExtractor
NativeJdbcExtractorAdapter
NativeWebRequest
NestedCheckedException
NestedExceptionUtils
NestedIOException
NestedPathTag
NestedRuntimeException
NestedServletException
NestedTransactionNotSupportedException
NonTransientDataAccessException
NonTransientDataAccessResourceException
NoRollbackRuleAttribute
NoSuchBeanDefinitionException
NoSuchMessageException
NoSuchRequestHandlingMethodException
NotAnAtAspectException
NotificationListenerBean
NotificationListenerHolder
NotificationListenerRegistrar
NotificationPublisher
NotificationPublisherAware
NoTransactionException
NotReadablePropertyException
NotSupportedRecordFactory
NotTransactional
NotWritablePropertyException
NullLiteral
NullSafeComparator
NullSourceExtractor
NullValueInNestedPathException
NumberFormat
NumberFormat.Style
NumberFormatAnnotationFormatterFactory
NumberFormatter
NumberUtils
ObjectError
ObjectFactory
ObjectFactoryCreatingFactoryBean
ObjectNameManager
ObjectNamingStrategy
ObjectOptimisticLockingFailureException
ObjectRetrievalFailureException
ObjectUtils
OC4JJtaTransactionManager
OC4JLoadTimeWeaver
OncePerRequestFilter
OpAnd
OpDivide
OpenEntityManagerInViewFilter
OpenEntityManagerInViewInterceptor
OpenJpaDialect
OpenJpaVendorAdapter
OpenPersistenceManagerInViewFilter
OpenPersistenceManagerInViewInterceptor
OpenSessionInViewFilter
OpenSessionInViewInterceptor
OpEQ
Operation
Operator
OperatorBetween
OperatorInstanceof
OperatorMatches
OperatorNot
OperatorOverloader
OperatorPower
OpGE
OpGT
OpLE
OpLT
OpMinus
OpModulus
OpMultiply
OpNE
OpOr
OpPlus
OptimisticLockingFailureException
OptionsTag
OptionTag
OracleCallMetaDataProvider
OracleLobHandler
OracleLobHandler.LobCallback
OracleSequenceMaxValueIncrementer
OracleTableMetaDataProvider
Order
OrderComparator
Ordered
OutputStreamFactory
OverridingClassLoader
OxmNamespaceHandler
PagedListHolder
Param
ParamAware
ParameterDisposer
ParameterHandlerMapping
ParameterizableViewController
ParameterizableViewController
ParameterizedBeanPropertyRowMapper
ParameterizedRowMapper
ParameterizedSingleColumnRowMapper
ParameterMapper
ParameterMappingInterceptor
ParameterMethodNameResolver
ParameterNameDiscoverer
ParamTag
ParsedSql
ParseException
Parser
ParserContext
ParserContext
ParseState
ParseState.Entry
PassThroughFilterChain
PassThroughSourceExtractor
PasswordInputTag
PathMatcher
PathMatchingResourcePatternResolver
PathVariable
PatternEditor
PatternMatchUtils
PercentFormatter
PerformanceMonitorInterceptor
PeriodicTrigger
PermissionDeniedDataAccessException
PersistenceAnnotationBeanPostProcessor
PersistenceExceptionTranslationAdvisor
PersistenceExceptionTranslationInterceptor
PersistenceExceptionTranslationPostProcessor
PersistenceExceptionTranslator
PersistenceManagerFactoryUtils
PersistenceManagerHolder
PersistenceUnitManager
PersistenceUnitPostProcessor
PessimisticLockingFailureException
Phased
PlatformTransactionManager
PluggableSchemaResolver
Pointcut
PointcutAdvisor
PointcutComponentDefinition
PointcutEntry
Pointcuts
PoolingConfig
PortletApplicationContextUtils
PortletApplicationObjectSupport
PortletConfigAware
PortletContentGenerator
PortletContextAware
PortletContextAwareProcessor
PortletContextResource
PortletContextResourceLoader
PortletContextResourcePatternResolver
PortletContextScope
PortletModeHandlerMapping
PortletModeNameViewController
PortletModeParameterHandlerMapping
PortletMultipartResolver
PortletRequestAttributes
PortletRequestBindingException
PortletRequestDataBinder
PortletRequestHandledEvent
PortletRequestMethodNotSupportedException
PortletRequestParameterPropertyValues
PortletRequestUtils
PortletSessionRequiredException
PortletUtils
PortletWebRequest
PortletWrappingController
PostgresCallMetaDataProvider
PostgreSQLSequenceMaxValueIncrementer
PostgresTableMetaDataProvider
PreferencesPlaceholderConfigurer
PreparedStatementCallback
PreparedStatementCreator
PreparedStatementCreatorFactory
PreparedStatementSetter
Primary
Printer
PrioritizedParameterNameDiscoverer
PriorityOrdered
Problem
ProblemReporter
ProducerCallback
ProfileValueSource
ProfileValueSourceConfiguration
ProfileValueUtils
Projection
Propagation
PropertiesBeanDefinitionReader
PropertiesEditor
PropertiesFactoryBean
PropertiesLoaderSupport
PropertiesLoaderUtils
PropertiesMethodNameResolver
PropertiesPersister
PropertyAccessException
PropertyAccessor
PropertyAccessor
PropertyAccessorFactory
PropertyAccessorUtils
PropertyBatchUpdateException
PropertyComparator
PropertyEditorRegistrar
PropertyEditorRegistry
PropertyEditorRegistrySupport
PropertyEntry
PropertyOrFieldReference
PropertyOverrideConfigurer
PropertyPathFactoryBean
PropertyPlaceholderConfigurer
PropertyPlaceholderHelper
PropertyPlaceholderHelper.PlaceholderResolver
PropertyResourceConfigurer
PropertyTypeDescriptor
PropertyValue
PropertyValues
PropertyValuesEditor
PrototypeAspectInstanceFactory
PrototypeTargetSource
ProviderCreatingFactoryBean
ProxyConfig
ProxyCreationContext
ProxyCreatorSupport
ProxyFactory
ProxyFactoryBean
ProxyMethodInvocation
QualifiedIdentifier
Qualifier
QualifierAnnotationAutowireCandidateResolver
QualifierEntry
QuartzJobBean
QuickTargetSourceCreator
RadioButtonsTag
RadioButtonTag
RawTargetAccess
RdbmsOperation
ReadableInstantPrinter
ReadablePartialPrinter
ReaderContext
ReaderEventListener
RealLiteral
RecordCreator
RecordExtractor
RecordTypeNotSupportedException
RecoverableDataAccessException
RedirectView
ReflectionHelper
ReflectionHelper.ArgsMatchKind
ReflectionHelper.ArgumentsMatchInfo
ReflectionTestUtils
ReflectionUtils
ReflectionUtils.FieldCallback
ReflectionUtils.FieldFilter
ReflectionUtils.MethodCallback
ReflectionUtils.MethodFilter
ReflectiveAspectJAdvisorFactory
ReflectiveAspectJAdvisorFactory.SyntheticInstantiationAdvisor
ReflectiveConstructorResolver
ReflectiveLoadTimeWeaver
ReflectiveMethodInvocation
ReflectiveMethodResolver
ReflectivePropertyAccessor
Refreshable
RefreshableScriptTargetSource
RegexPatternTypeFilter
RegexpMethodPointcutAdvisor
ReloadableResourceBundleMessageSource
RemoteAccessException
RemoteAccessor
RemoteConnectFailureException
RemoteExporter
RemoteInvocation
RemoteInvocationBasedAccessor
RemoteInvocationBasedExporter
RemoteInvocationExecutor
RemoteInvocationFactory
RemoteInvocationFailureException
RemoteInvocationResult
RemoteInvocationSerializingExporter
RemoteInvocationTraceInterceptor
RemoteInvocationUtils
RemoteLookupFailureException
RemoteProxyFailureException
RemotingSupport
RenderMapping
Repeat
ReplaceOverride
Repository
RequestAttributes
RequestBody
RequestCallback
RequestContext
RequestContextAwareTag
RequestContextFilter
RequestContextHolder
RequestContextListener
RequestContextUtils
RequestHandledEvent
RequestHeader
RequestMapping
RequestMethod
RequestParam
RequestScope
RequestToViewNameTranslator
Required
RequiredAnnotationBeanPostProcessor
Resource
ResourceAccessException
ResourceAdapterApplicationContext
ResourceAdapterFactoryBean
ResourceAllocationException
ResourceArrayPropertyEditor
ResourceAwareController
ResourceBundleEditor
ResourceBundleMessageSource
ResourceBundleThemeSource
ResourceBundleViewResolver
ResourceDatabasePopulator
ResourceEditor
ResourceEditorRegistrar
ResourceEntityResolver
ResourceHolder
ResourceHolderSupport
ResourceHolderSynchronization
ResourceHttpMessageConverter
ResourceLoader
ResourceLoaderAware
ResourceLoaderClassLoadHelper
ResourceMapping
ResourceOverridingShadowingClassLoader
ResourcePatternResolver
ResourcePatternUtils
ResourceScriptSource
ResourceServlet
ResourceTransactionManager
ResourceUtils
ResponseBody
ResponseEntity
ResponseErrorHandler
ResponseExtractor
ResponseStatus
ResponseStatusExceptionResolver
RestClientException
RestGatewaySupport
RestOperations
RestTemplate
ResultSetExtractor
ResultSetSupportingSqlParameter
ResultSetWrappingSqlRowSet
ResultSetWrappingSqlRowSetMetaData
RmiBasedExporter
RmiClientInterceptor
RmiClientInterceptorUtils
RmiInvocationHandler
RmiProxyFactoryBean
RmiRegistryFactoryBean
RmiServiceExporter
Rollback
RollbackRuleAttribute
RootBeanDefinition
RootClassFilter
RowCallbackHandler
RowCountCallbackHandler
RowMapper
RowMapperResultSetExtractor
RssChannelHttpMessageConverter
RuleBasedTransactionAttribute
RunAfterTestClassCallbacks
RunAfterTestMethodCallbacks
RunBeforeTestClassCallbacks
RunBeforeTestMethodCallbacks
RuntimeBeanNameReference
RuntimeBeanReference
SavepointManager
SaxResourceUtils
ScannedGenericBeanDefinition
Scheduled
ScheduledAnnotationBeanPostProcessor
ScheduledExecutorFactoryBean
ScheduledExecutorTask
ScheduledTaskRegistrar
ScheduledTasksBeanDefinitionParser
ScheduledTimerListener
ScheduledTimerTask
SchedulerAccessor
SchedulerAccessorBean
SchedulerBeanDefinitionParser
SchedulerContextAware
SchedulerFactoryBean
SchedulingAwareRunnable
SchedulingException
SchedulingTaskExecutor
Scope
Scope
ScopedBeanInterceptor
ScopedObject
ScopedProxyFactoryBean
ScopedProxyMode
ScopedProxyUtils
ScopeMetadata
ScopeMetadataResolver
ScriptCompilationException
ScriptFactory
ScriptFactoryPostProcessor
ScriptingDefaultsParser
ScriptSource
SecurityContextProvider
Selection
SelectTag
SelfNaming
ServerHttpRequest
ServerHttpResponse
Service
ServiceFactoryBean
ServiceListFactoryBean
ServiceLoaderFactoryBean
ServiceLocatorFactoryBean
ServletConfigAware
ServletContextAttributeExporter
ServletContextAttributeFactoryBean
ServletContextAware
ServletContextAwareProcessor
ServletContextFactoryBean
ServletContextParameterFactoryBean
ServletContextPropertyPlaceholderConfigurer
ServletContextRequestLoggingFilter
ServletContextResource
ServletContextResourceLoader
ServletContextResourcePatternResolver
ServletContextScope
ServletEndpointSupport
ServletForwardingController
ServletRequestAttributes
ServletRequestBindingException
ServletRequestDataBinder
ServletRequestHandledEvent
ServletRequestParameterPropertyValues
ServletRequestUtils
ServletServerHttpRequest
ServletServerHttpResponse
ServletWebRequest
ServletWrappingController
ServletWrappingPortletContext
SessionAttributes
SessionAttributeStore
SessionAwareMessageListener
SessionCallback
SessionFactoryUtils
SessionHolder
SessionLocaleResolver
SessionProxy
SessionScope
SessionStatus
SessionThemeResolver
SetFactoryBean
ShadowingClassLoader
ShallowEtagHeaderFilter
SharedEntityManagerBean
SharedEntityManagerCreator
ShortCodedLabeledEnum
SimpleAliasRegistry
SimpleApplicationEventMulticaster
SimpleAspectInstanceFactory
SimpleAsyncTaskExecutor
SimpleAutowireCandidateResolver
SimpleBeanDefinitionRegistry
SimpleBeanFactoryAwareAspectInstanceFactory
SimpleBeanTargetSource
SimpleBootstrapContext
SimpleBurlapServiceExporter
SimpleClientHttpRequestFactory
SimpleConnectionHandle
SimpleControllerHandlerAdapter
SimpleControllerHandlerAdapter
SimpleDriverDataSource
SimpleFormController
SimpleFormController
SimpleHessianServiceExporter
SimpleHttpInvokerRequestExecutor
SimpleHttpInvokerServiceExporter
SimpleHttpServerFactoryBean
SimpleHttpServerJaxWsServiceExporter
SimpleInstantiationStrategy
SimpleInstrumentableClassLoader
SimpleJaxWsServiceExporter
SimpleJdbcCall
SimpleJdbcCallOperations
SimpleJdbcDaoSupport
SimpleJdbcInsert
SimpleJdbcInsertOperations
SimpleJdbcOperations
SimpleJdbcTemplate
SimpleJdbcTestUtils
SimpleJndiBeanFactory
SimpleLoadTimeWeaver
SimpleLocaleContext
SimpleMailMessage
SimpleMappingExceptionResolver
SimpleMappingExceptionResolver
SimpleMessageConverter
SimpleMessageConverter102
SimpleMessageListenerContainer
SimpleMessageListenerContainer102
SimpleMetadataAwareAspectInstanceFactory
SimpleMetadataReaderFactory
SimpleNamespaceContext
SimpleNamingContext
SimpleNamingContextBuilder
SimpleNativeJdbcExtractor
SimplePortletHandlerAdapter
SimplePortletPostProcessor
SimplePropertyNamespaceHandler
SimpleRecordOperation
SimpleReflectiveMBeanInfoAssembler
SimpleRemoteSlsbInvokerInterceptor
SimpleRemoteStatelessSessionProxyFactoryBean
SimpleSaxErrorHandler
SimpleSecurityContextProvider
SimpleServletHandlerAdapter
SimpleServletPostProcessor
SimpleSessionStatus
SimpleSpringBeanELResolver
SimpleSpringPreparerFactory
SimpleTaskWorkManager
SimpleTheme
SimpleThreadPoolTaskExecutor
SimpleThreadScope
SimpleThrowawayClassLoader
SimpleTraceInterceptor
SimpleTransactionFactory
SimpleTransactionStatus
SimpleTransformErrorListener
SimpleTriggerBean
SimpleTriggerContext
SimpleTypeConverter
SimpleUrlHandlerMapping
SingleColumnRowMapper
SingleConnectionDataSource
SingleConnectionFactory
SingleConnectionFactory
SingleConnectionFactory102
SingleDataSourceLookup
SingletonAspectInstanceFactory
SingletonBeanFactoryLocator
SingletonBeanRegistry
SingletonMetadataAwareAspectInstanceFactory
SingletonTargetSource
SmartApplicationListener
SmartClassLoader
SmartConnectionFactory
SmartDataSource
SmartFactoryBean
SmartInstantiationAwareBeanPostProcessor
SmartLifecycle
SmartPersistenceUnitInfo
SmartSessionBean
SmartTransactionObject
SoapFaultException
SortDefinition
SortedResourcesFactoryBean
SourceExtractor
SourceFilteringListener
SourceHttpMessageConverter
SpelEvaluationException
SpelExpression
SpelExpressionParser
SpelMessage
SpelMessage.Kind
SpelNode
SpelNodeImpl
SpelParseException
SpelParserConfiguration
SpringBeanAutowiringInterceptor
SpringBeanAutowiringSupport
SpringBeanELResolver
SpringBeanFacesELResolver
SpringBeanJobFactory
SpringBeanPreparerFactory
SpringBeanVariableResolver
SpringBindingActionForm
SpringConstraintValidatorFactory
SpringContextResourceAdapter
SpringFailOnTimeout
SpringJtaSynchronizationAdapter
SpringJUnit4ClassRunner
SpringLobCreatorSynchronization
SpringLocaleResolver
SpringModelMBean
SpringPersistenceManagerProxyBean
SpringProxy
SpringRepeat
SpringResourceLoader
SpringSessionContext
SpringTemplateLoader
SpringTilesApplicationContextFactory
SpringTransactionAnnotationParser
SpringTransactionFactory
SpringValidatorAdapter
SpringVersion
SqlCall
SQLErrorCodes
SQLErrorCodesFactory
SQLErrorCodeSQLExceptionTranslator
SQLExceptionSubclassTranslator
SQLExceptionTranslator
SqlFunction
SqlInOutParameter
SqlLobValue
SqlMapClientCallback
SqlMapClientDaoSupport
SqlMapClientFactoryBean
SqlMapClientOperations
SqlMapClientTemplate
SqlOperation
SqlOutParameter
SqlParameter
SqlParameterSource
SqlParameterSourceUtils
SqlParameterValue
SqlProvider
SqlQuery
SqlReturnResultSet
SqlReturnType
SqlReturnUpdateCount
SqlRowSet
SqlRowSetMetaData
SqlRowSetResultSetExtractor
SqlServerCallMetaDataProvider
SqlServerMaxValueIncrementer
SQLStateSQLExceptionTranslator
SqlTypeValue
SqlUpdate
SqlValue
SQLWarningException
SqlXmlFeatureNotImplementedException
SqlXmlHandler
SqlXmlObjectMappingHandler
SqlXmlValue
StandardAnnotationMetadata
StandardBeanExpressionResolver
StandardClassMetadata
StandardEvaluationContext
StandardJmsActivationSpecFactory
StandardMethodMetadata
StandardOperatorOverloader
StandardPersistenceManagerProxyBean
StandardTypeComparator
StandardTypeConverter
StandardTypeLocator
StatementCallback
StatementCreatorUtils
StaticApplicationContext
StaticLabeledEnum
StaticLabeledEnumResolver
StaticListableBeanFactory
StaticMessageSource
StaticMethodMatcher
StaticMethodMatcherPointcut
StaticMethodMatcherPointcutAdvisor
StaticPortletApplicationContext
StaticScriptSource
StaticWebApplicationContext
StaxUtils
StopWatch
StopWatch.TaskInfo
StoredProcedure
StringArrayPropertyEditor
StringCodedLabeledEnum
StringHttpMessageConverter
StringLiteral
StringMultipartFileEditor
StringTrimmerEditor
StringUtils
StringValueResolver
StylerUtils
SubscriptionNameProvider
SybaseCallMetaDataProvider
SybaseMaxValueIncrementer
SynchedLocalTransactionFailedException
SyncTaskExecutor
SystemProfileValueSource
SystemPropertyUtils
TableMetaDataContext
TableMetaDataProvider
TableMetaDataProviderFactory
TableParameterMetaData
TagUtils
TagWriter
TargetClassAware
TargetSource
TargetSourceCreator
TaskExecutor
TaskExecutorAdapter
TaskExecutorFactoryBean
TaskNamespaceHandler
TaskRejectedException
TaskScheduler
TaskTimeoutException
TaskUtils
TemplateAwareExpressionParser
TemplateParserContext
Ternary
TestContext
TestContextManager
TestExecutionListener
TestExecutionListeners
TextareaTag
Theme
ThemeChangeInterceptor
ThemeResolver
ThemeSource
ThemeTag
ThreadLocalTargetSource
ThreadLocalTargetSourceStats
ThreadPoolExecutorFactoryBean
ThreadPoolTaskExecutor
ThreadPoolTaskExecutor
ThreadPoolTaskScheduler
ThrowsAdvice
ThrowsAdviceInterceptor
TilesConfigurer
TilesConfigurer
TilesJstlView
TilesView
TilesView
TilesViewResolver
Timed
TimerFactoryBean
TimerManagerAccessor
TimerManagerFactoryBean
TimerManagerTaskScheduler
TimerTaskExecutor
TimeZoneEditor
TomcatInstrumentableClassLoader
TopLinkJpaDialect
TopLinkJpaVendorAdapter
ToStringCreator
ToStringStyler
Transactional
TransactionalTestExecutionListener
TransactionAnnotationParser
TransactionAspectSupport
TransactionAspectUtils
TransactionAttribute
TransactionAttributeEditor
TransactionAttributeSource
TransactionAttributeSourceAdvisor
TransactionAttributeSourceEditor
TransactionAwareConnectionFactoryProxy
TransactionAwareConnectionFactoryProxy
TransactionAwareDataSourceConnectionProvider
TransactionAwareDataSourceProxy
TransactionAwarePersistenceManagerFactoryProxy
TransactionCallback
TransactionCallbackWithoutResult
TransactionConfiguration
TransactionConfigurationAttributes
TransactionDefinition
TransactionException
TransactionFactory
TransactionInProgressException
TransactionInterceptor
TransactionOperations
TransactionProxyFactoryBean
TransactionRolledBackException
TransactionStatus
TransactionSuspensionNotSupportedException
TransactionSynchronization
TransactionSynchronizationAdapter
TransactionSynchronizationManager
TransactionSynchronizationUtils
TransactionSystemException
TransactionTemplate
TransactionTimedOutException
TransactionUsageException
TransformerUtils
TransformTag
TransientDataAccessException
TransientDataAccessResourceException
Trigger
TriggerContext
TxNamespaceHandler
TypeCode
TypeComparator
TypeConverter
TypeConverter
TypeDefinitionBean
TypeDescriptor
TypedStringValue
TypedValue
TypeFilter
TypeLocator
TypeMismatchDataAccessException
TypeMismatchException
TypeMismatchNamingException
TypePatternClassFilter
TypeReference
TypeUtils
UiApplicationContextUtils
UnableToRegisterMBeanException
UnableToSendNotificationException
UncategorizedDataAccessException
UncategorizedJmsException
UncategorizedMappingException
UncategorizedSQLException
UnexpectedRollbackException
UnknownAdviceTypeException
Unmarshaller
UnmarshallingFailureException
UnsatisfiedDependencyException
UnsatisfiedServletRequestParameterException
UpdatableSqlQuery
URIEditor
UriTemplate
UriUtils
UrlBasedRemoteAccessor
UrlBasedViewResolver
URLEditor
UrlFilenameViewController
UrlPathHelper
UrlResource
UrlTag
UserCredentialsConnectionFactoryAdapter
UserCredentialsDataSourceAdapter
UserRoleAuthorizationInterceptor
UserRoleAuthorizationInterceptor
UserTransactionAdapter
UtilNamespaceHandler
UUIDEditor
ValidationFailureException
ValidationUtils
Validator
Value
ValueConstants
ValueStyler
VariableReference
VelocityConfig
VelocityConfigurer
VelocityEngineFactory
VelocityEngineFactoryBean
VelocityEngineUtils
VelocityLayoutView
VelocityLayoutViewResolver
VelocityToolboxView
VelocityView
VelocityViewResolver
VfsResource
View
ViewRendererServlet
ViewResolver
WeakReferenceMonitor
WeakReferenceMonitor.ReleaseListener
WeavingTransformer
WebApplicationContext
WebApplicationContextFacesELResolver
WebApplicationContextUtils
WebApplicationContextVariableResolver
WebApplicationObjectSupport
WebAppRootListener
WebArgumentResolver
WebBindingInitializer
WebContentGenerator
WebContentInterceptor
WebDataBinder
WebLogicJtaTransactionManager
WebLogicLoadTimeWeaver
WebLogicNativeJdbcExtractor
WebRequest
WebRequestDataBinder
WebRequestHandlerInterceptorAdapter
WebRequestHandlerInterceptorAdapter
WebRequestInterceptor
WebSphereDataSourceAdapter
WebSphereMBeanServerFactoryBean
WebSphereNativeJdbcExtractor
WebSphereUowTransactionManager
WebUtils
WorkManagerTaskExecutor
WorkManagerTaskExecutor
XmlBeanDefinitionReader
XmlBeanDefinitionStoreException
XmlBeanFactory
XmlBeansMarshaller
XmlBinaryStreamProvider
XmlCharacterStreamProvider
XmlMappingException
XmlOptionsFactoryBean
XmlPortletApplicationContext
XmlReaderContext
XmlResultProvider
XmlValidationModeDetector
XmlViewResolver
XmlWebApplicationContext
XsltView
XsltViewResolver
XStreamMarshaller


Constant Field Values

Contents
  • org.springframework.*
org.springframework.*

org.springframework.aop.config.AopConfigUtils
public static final String AUTO_PROXY_CREATOR_BEAN_NAME "org.springframework.aop.config.internalAutoProxyCreator"

org.springframework.aop.config.AopNamespaceUtils
public static final String PROXY_TARGET_CLASS_ATTRIBUTE "proxy-target-class"

org.springframework.aop.framework.ProxyFactoryBean
public static final String GLOBAL_SUFFIX "*"

org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator
public static final String SEPARATOR "."

org.springframework.aop.framework.autoproxy.target.QuickTargetSourceCreator
public static final String | PREFIX_COMMONS_POOL | ":"
public static final String | PREFIX_PROTOTYPE | "!"
public static final String | PREFIX_THREAD_LOCAL | "%"

org.springframework.aop.interceptor.CustomizableTraceInterceptor
public static final String | PLACEHOLDER_ARGUMENT_TYPES | "$[argumentTypes]"
public static final String | PLACEHOLDER_ARGUMENTS | "$[arguments]"
public static final String | PLACEHOLDER_EXCEPTION | "$[exception]"
public static final String | PLACEHOLDER_INVOCATION_TIME | "$[invocationTime]"
public static final String | PLACEHOLDER_METHOD_NAME | "$[methodName]"
public static final String | PLACEHOLDER_RETURN_VALUE | "$[returnValue]"
public static final String | PLACEHOLDER_TARGET_CLASS_NAME | "$[targetClassName]"
public static final String | PLACEHOLDER_TARGET_CLASS_SHORT_NAME | "$[targetClassShortName]"

org.springframework.beans.MethodInvocationException
public static final String ERROR_CODE "methodInvocation"

org.springframework.beans.PropertyAccessor
public static final String | NESTED_PROPERTY_SEPARATOR | "."
public static final char | NESTED_PROPERTY_SEPARATOR_CHAR | 46
public static final String | PROPERTY_KEY_PREFIX | "["
public static final char | PROPERTY_KEY_PREFIX_CHAR | 91
public static final String | PROPERTY_KEY_SUFFIX | "]"
public static final char | PROPERTY_KEY_SUFFIX_CHAR | 93

org.springframework.beans.TypeMismatchException
public static final String ERROR_CODE "typeMismatch"

org.springframework.beans.factory.BeanFactory
public static final String FACTORY_BEAN_PREFIX "&"

org.springframework.beans.factory.BeanFactoryUtils
public static final String GENERATED_BEAN_NAME_SEPARATOR "#"

org.springframework.beans.factory.config.AutowireCapableBeanFactory
public static final int | AUTOWIRE_AUTODETECT | 4
public static final int | AUTOWIRE_BY_NAME | 1
public static final int | AUTOWIRE_BY_TYPE | 2
public static final int | AUTOWIRE_CONSTRUCTOR | 3
public static final int | AUTOWIRE_NO | 0

org.springframework.beans.factory.config.BeanDefinition
public static final int | ROLE_APPLICATION | 0
public static final int | ROLE_INFRASTRUCTURE | 2
public static final int | ROLE_SUPPORT | 1
public static final String | SCOPE_PROTOTYPE | "prototype"
public static final String | SCOPE_SINGLETON | "singleton"

org.springframework.beans.factory.config.ConfigurableBeanFactory
public static final String | SCOPE_PROTOTYPE | "prototype"
public static final String | SCOPE_SINGLETON | "singleton"

org.springframework.beans.factory.config.PropertyOverrideConfigurer
public static final String DEFAULT_BEAN_NAME_SEPARATOR "."

org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
public static final String | DEFAULT_PLACEHOLDER_PREFIX | "${"
public static final String | DEFAULT_PLACEHOLDER_SUFFIX | "}"
public static final String | DEFAULT_VALUE_SEPARATOR | ":"
public static final int | SYSTEM_PROPERTIES_MODE_FALLBACK | 1
public static final int | SYSTEM_PROPERTIES_MODE_NEVER | 0
public static final int | SYSTEM_PROPERTIES_MODE_OVERRIDE | 2

org.springframework.beans.factory.support.AbstractBeanDefinition
public static final int | AUTOWIRE_AUTODETECT | 4
public static final int | AUTOWIRE_BY_NAME | 1
public static final int | AUTOWIRE_BY_TYPE | 2
public static final int | AUTOWIRE_CONSTRUCTOR | 3
public static final int | AUTOWIRE_NO | 0
public static final int | DEPENDENCY_CHECK_ALL | 3
public static final int | DEPENDENCY_CHECK_NONE | 0
public static final int | DEPENDENCY_CHECK_OBJECTS | 1
public static final int | DEPENDENCY_CHECK_SIMPLE | 2
public static final String | SCOPE_DEFAULT | ""

org.springframework.beans.factory.support.BeanDefinitionReaderUtils
public static final String GENERATED_BEAN_NAME_SEPARATOR "#"

org.springframework.beans.factory.support.PropertiesBeanDefinitionReader
public static final String | ABSTRACT_KEY | "(abstract)"
public static final String | CLASS_KEY | "(class)"
public static final String | CONSTRUCTOR_ARG_PREFIX | "$"
public static final String | LAZY_INIT_KEY | "(lazy-init)"
public static final String | PARENT_KEY | "(parent)"
public static final String | REF_PREFIX | "*"
public static final String | REF_SUFFIX | "(ref)"
public static final String | SCOPE_KEY | "(scope)"
public static final String | SEPARATOR | "."
public static final String | SINGLETON_KEY | "(singleton)"
public static final String | TRUE_VALUE | "true"

org.springframework.beans.factory.wiring.BeanWiringInfo
public static final int | AUTOWIRE_BY_NAME | 1
public static final int | AUTOWIRE_BY_TYPE | 2

org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
public static final String | ID_ATTRIBUTE | "id"
public static final String | NAME_ATTRIBUTE | "name"

org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
public static final String | ABSTRACT_ATTRIBUTE | "abstract"
public static final String | ARG_TYPE_ELEMENT | "arg-type"
public static final String | ARG_TYPE_MATCH_ATTRIBUTE | "match"
public static final String | ARRAY_ELEMENT | "array"
public static final String | AUTOWIRE_ATTRIBUTE | "autowire"
public static final String | AUTOWIRE_AUTODETECT_VALUE | "autodetect"
public static final String | AUTOWIRE_BY_NAME_VALUE | "byName"
public static final String | AUTOWIRE_BY_TYPE_VALUE | "byType"
public static final String | AUTOWIRE_CANDIDATE_ATTRIBUTE | "autowire-candidate"
public static final String | AUTOWIRE_CONSTRUCTOR_VALUE | "constructor"
public static final String | BEAN_ELEMENT | "bean"
public static final String | BEAN_NAME_DELIMITERS | ",; "
public static final String | BEAN_REF_ATTRIBUTE | "bean"
public static final String | BEANS_NAMESPACE_URI | "http://www.springframework.org/schema/beans"
public static final String | CLASS_ATTRIBUTE | "class"
public static final String | CONSTRUCTOR_ARG_ELEMENT | "constructor-arg"
public static final String | DEFAULT_AUTOWIRE_ATTRIBUTE | "default-autowire"
public static final String | DEFAULT_AUTOWIRE_CANDIDATES_ATTRIBUTE | "default-autowire-candidates"
public static final String | DEFAULT_DEPENDENCY_CHECK_ATTRIBUTE | "default-dependency-check"
public static final String | DEFAULT_DESTROY_METHOD_ATTRIBUTE | "default-destroy-method"
public static final String | DEFAULT_INIT_METHOD_ATTRIBUTE | "default-init-method"
public static final String | DEFAULT_LAZY_INIT_ATTRIBUTE | "default-lazy-init"
public static final String | DEFAULT_MERGE_ATTRIBUTE | "default-merge"
public static final String | DEFAULT_VALUE | "default"
public static final String | DEPENDENCY_CHECK_ALL_ATTRIBUTE_VALUE | "all"
public static final String | DEPENDENCY_CHECK_ATTRIBUTE | "dependency-check"
public static final String | DEPENDENCY_CHECK_OBJECTS_ATTRIBUTE_VALUE | "objects"
public static final String | DEPENDENCY_CHECK_SIMPLE_ATTRIBUTE_VALUE | "simple"
public static final String | DEPENDS_ON_ATTRIBUTE | "depends-on"
public static final String | DESCRIPTION_ELEMENT | "description"
public static final String | DESTROY_METHOD_ATTRIBUTE | "destroy-method"
public static final String | ENTRY_ELEMENT | "entry"
public static final String | FACTORY_BEAN_ATTRIBUTE | "factory-bean"
public static final String | FACTORY_METHOD_ATTRIBUTE | "factory-method"
public static final String | ID_ATTRIBUTE | "id"
public static final String | IDREF_ELEMENT | "idref"
public static final String | INDEX_ATTRIBUTE | "index"
public static final String | INIT_METHOD_ATTRIBUTE | "init-method"
public static final String | KEY_ATTRIBUTE | "key"
public static final String | KEY_ELEMENT | "key"
public static final String | KEY_REF_ATTRIBUTE | "key-ref"
public static final String | KEY_TYPE_ATTRIBUTE | "key-type"
public static final String | LAZY_INIT_ATTRIBUTE | "lazy-init"
public static final String | LIST_ELEMENT | "list"
public static final String | LOCAL_REF_ATTRIBUTE | "local"
public static final String | LOOKUP_METHOD_ELEMENT | "lookup-method"
public static final String | MAP_ELEMENT | "map"
public static final String | MERGE_ATTRIBUTE | "merge"
public static final String | META_ELEMENT | "meta"
public static final String | NAME_ATTRIBUTE | "name"
public static final String | NULL_ELEMENT | "null"
public static final String | PARENT_ATTRIBUTE | "parent"
public static final String | PARENT_REF_ATTRIBUTE | "parent"
public static final String | PRIMARY_ATTRIBUTE | "primary"
public static final String | PROP_ELEMENT | "prop"
public static final String | PROPERTY_ELEMENT | "property"
public static final String | PROPS_ELEMENT | "props"
public static final String | QUALIFIER_ATTRIBUTE_ELEMENT | "attribute"
public static final String | QUALIFIER_ELEMENT | "qualifier"
public static final String | REF_ATTRIBUTE | "ref"
public static final String | REF_ELEMENT | "ref"
public static final String | REPLACED_METHOD_ELEMENT | "replaced-method"
public static final String | REPLACER_ATTRIBUTE | "replacer"
public static final String | SCOPE_ATTRIBUTE | "scope"
public static final String | SET_ELEMENT | "set"
public static final String | SINGLETON_ATTRIBUTE | "singleton"
public static final String | TRUE_VALUE | "true"
public static final String | TYPE_ATTRIBUTE | "type"
public static final String | VALUE_ATTRIBUTE | "value"
public static final String | VALUE_ELEMENT | "value"
public static final String | VALUE_REF_ATTRIBUTE | "value-ref"
public static final String | VALUE_TYPE_ATTRIBUTE | "value-type"

org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader
public static final String | ALIAS_ATTRIBUTE | "alias"
public static final String | ALIAS_ELEMENT | "alias"
public static final String | BEAN_ELEMENT | "bean"
public static final String | IMPORT_ELEMENT | "import"
public static final String | NAME_ATTRIBUTE | "name"
public static final String | RESOURCE_ATTRIBUTE | "resource"

org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver
public static final String DEFAULT_HANDLER_MAPPINGS_LOCATION "META-INF/spring.handlers"

org.springframework.beans.factory.xml.DelegatingEntityResolver
public static final String | DTD_SUFFIX | ".dtd"
public static final String | XSD_SUFFIX | ".xsd"

org.springframework.beans.factory.xml.PluggableSchemaResolver
public static final String DEFAULT_SCHEMA_MAPPINGS_LOCATION "META-INF/spring.schemas"

org.springframework.beans.factory.xml.XmlBeanDefinitionReader
public static final int | VALIDATION_AUTO | 1
public static final int | VALIDATION_DTD | 2
public static final int | VALIDATION_NONE | 0
public static final int | VALIDATION_XSD | 3

org.springframework.beans.propertyeditors.CustomBooleanEditor
public static final String | VALUE_0 | "0"
public static final String | VALUE_1 | "1"
public static final String | VALUE_FALSE | "false"
public static final String | VALUE_NO | "no"
public static final String | VALUE_OFF | "off"
public static final String | VALUE_ON | "on"
public static final String | VALUE_TRUE | "true"
public static final String | VALUE_YES | "yes"

org.springframework.beans.propertyeditors.ResourceBundleEditor
public static final String BASE_NAME_SEPARATOR "_"

org.springframework.beans.propertyeditors.StringArrayPropertyEditor
public static final String DEFAULT_SEPARATOR ","

org.springframework.beans.support.PagedListHolder<E>
public static final int | DEFAULT_MAX_LINKED_PAGES | 10
public static final int | DEFAULT_PAGE_SIZE | 10

org.springframework.context.ConfigurableApplicationContext
public static final String | CONFIG_LOCATION_DELIMITERS | ",; \t\n"
public static final String | CONVERSION_SERVICE_BEAN_NAME | "conversionService"
public static final String | LOAD_TIME_WEAVER_BEAN_NAME | "loadTimeWeaver"
public static final String | SYSTEM_ENVIRONMENT_BEAN_NAME | "systemEnvironment"
public static final String | SYSTEM_PROPERTIES_BEAN_NAME | "systemProperties"

org.springframework.context.access.ContextJndiBeanFactoryLocator
public static final String BEAN_FACTORY_PATH_DELIMITERS ",; \t\n"

org.springframework.context.annotation.AnnotationConfigUtils
public static final String | AUTOWIRED_ANNOTATION_PROCESSOR_BEAN_NAME | "org.springframework.context.annotation.internalAutowiredAnnotationProcessor"
public static final String | COMMON_ANNOTATION_PROCESSOR_BEAN_NAME | "org.springframework.context.annotation.internalCommonAnnotationProcessor"
public static final String | CONFIGURATION_ANNOTATION_PROCESSOR_BEAN_NAME | "org.springframework.context.annotation.internalConfigurationAnnotationProcessor"
public static final String | PERSISTENCE_ANNOTATION_PROCESSOR_BEAN_NAME | "org.springframework.context.annotation.internalPersistenceAnnotationProcessor"
public static final String | REQUIRED_ANNOTATION_PROCESSOR_BEAN_NAME | "org.springframework.context.annotation.internalRequiredAnnotationProcessor"

org.springframework.context.expression.StandardBeanExpressionResolver
public static final String | DEFAULT_EXPRESSION_PREFIX | "#{"
public static final String | DEFAULT_EXPRESSION_SUFFIX | "}"

org.springframework.context.support.AbstractApplicationContext
public static final String | APPLICATION_EVENT_MULTICASTER_BEAN_NAME | "applicationEventMulticaster"
public static final String | LIFECYCLE_PROCESSOR_BEAN_NAME | "lifecycleProcessor"
public static final String | MESSAGE_SOURCE_BEAN_NAME | "messageSource"

org.springframework.core.JdkVersion
public static final int | JAVA_13 | 0
public static final int | JAVA_14 | 1
public static final int | JAVA_15 | 2
public static final int | JAVA_16 | 3
public static final int | JAVA_17 | 4

org.springframework.core.Ordered
public static final int | HIGHEST_PRECEDENCE | -2147483648
public static final int | LOWEST_PRECEDENCE | 2147483647

org.springframework.core.io.ResourceLoader
public static final String CLASSPATH_URL_PREFIX "classpath:"

org.springframework.core.io.support.LocalizedResourceHelper
public static final String DEFAULT_SEPARATOR "_"

org.springframework.core.io.support.PropertiesLoaderSupport
public static final String XML_FILE_EXTENSION ".xml"

org.springframework.core.io.support.ResourcePatternResolver
public static final String CLASSPATH_ALL_URL_PREFIX "classpath*:"

org.springframework.core.task.AsyncTaskExecutor
public static final long | TIMEOUT_IMMEDIATE | 0L
public static final long | TIMEOUT_INDEFINITE | 9223372036854775807L

org.springframework.core.task.SimpleAsyncTaskExecutor
public static final int | NO_CONCURRENCY | 0
public static final int | UNBOUNDED_CONCURRENCY | -1

org.springframework.ejb.support.AbstractEnterpriseBean
public static final String BEAN_FACTORY_PATH_ENVIRONMENT_KEY "java:comp/env/ejb/BeanFactoryPath"

org.springframework.expression.spel.ast.Selection
public static final int | ALL | 0
public static final int | FIRST | 1
public static final int | LAST | 2

org.springframework.jca.context.SpringContextResourceAdapter
public static final String | CONFIG_LOCATION_DELIMITERS | ",; \t\n"
public static final String | DEFAULT_CONTEXT_CONFIG_LOCATION | "META-INF/applicationContext.xml"

org.springframework.jdbc.core.SqlReturnType
public static final int TYPE_UNKNOWN -2147483648

org.springframework.jdbc.core.SqlTypeValue
public static final int TYPE_UNKNOWN -2147483648

org.springframework.jdbc.core.namedparam.SqlParameterSource
public static final int TYPE_UNKNOWN -2147483648

org.springframework.jdbc.datasource.ConnectionHolder
public static final String SAVEPOINT_NAME_PREFIX "SAVEPOINT_"

org.springframework.jdbc.datasource.DataSourceUtils
public static final int CONNECTION_SYNCHRONIZATION_ORDER 1000

org.springframework.jdbc.support.DatabaseStartupValidator
public static final int | DEFAULT_INTERVAL | 1
public static final int | DEFAULT_TIMEOUT | 60

org.springframework.jdbc.support.JdbcUtils
public static final int TYPE_UNKNOWN -2147483648

org.springframework.jdbc.support.SQLErrorCodesFactory
public static final String | SQL_ERROR_CODE_DEFAULT_PATH | "org/springframework/jdbc/support/sql-error-codes.xml"
public static final String | SQL_ERROR_CODE_OVERRIDE_PATH | "sql-error-codes.xml"

org.springframework.jdbc.support.lob.SpringLobCreatorSynchronization
public static final int LOB_CREATOR_SYNCHRONIZATION_ORDER 800

org.springframework.jms.core.JmsTemplate
public static final long | RECEIVE_TIMEOUT_INDEFINITE_WAIT | 0L
public static final long | RECEIVE_TIMEOUT_NO_WAIT | -1L

org.springframework.jms.listener.AbstractPollingMessageListenerContainer
public static final long DEFAULT_RECEIVE_TIMEOUT 1000L

org.springframework.jms.listener.DefaultMessageListenerContainer
public static final int | CACHE_AUTO | 4
public static final int | CACHE_CONNECTION | 1
public static final int | CACHE_CONSUMER | 3
public static final int | CACHE_NONE | 0
public static final int | CACHE_SESSION | 2
public static final long | DEFAULT_RECOVERY_INTERVAL | 5000L

org.springframework.jms.listener.adapter.MessageListenerAdapter
public static final String ORIGINAL_DEFAULT_LISTENER_METHOD "handleMessage"

org.springframework.jms.support.converter.SimpleMessageConverter102
public static final int BUFFER_SIZE 4096

org.springframework.jmx.export.MBeanExporter
public static final int | AUTODETECT_ALL | 3
public static final int | AUTODETECT_ASSEMBLER | 2
public static final int | AUTODETECT_MBEAN | 1
public static final int | AUTODETECT_NONE | 0

org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
protected static final int | ATTRIBUTE_OPERATION_VISIBILITY | 4
protected static final String | FIELD_CLASS | "class"
protected static final String | FIELD_CURRENCY_TIME_LIMIT | "currencyTimeLimit"
protected static final String | FIELD_DEFAULT | "default"
protected static final String | FIELD_DISPLAY_NAME | "displayName"
protected static final String | FIELD_GET_METHOD | "getMethod"
protected static final String | FIELD_LOG | "log"
protected static final String | FIELD_LOG_FILE | "logFile"
protected static final String | FIELD_METRIC_CATEGORY | "metricCategory"
protected static final String | FIELD_METRIC_TYPE | "metricType"
protected static final String | FIELD_PERSIST_LOCATION | "persistLocation"
protected static final String | FIELD_PERSIST_NAME | "persistName"
protected static final String | FIELD_PERSIST_PERIOD | "persistPeriod"
protected static final String | FIELD_PERSIST_POLICY | "persistPolicy"
protected static final String | FIELD_ROLE | "role"
protected static final String | FIELD_SET_METHOD | "setMethod"
protected static final String | FIELD_UNITS | "units"
protected static final String | FIELD_VISIBILITY | "visibility"
protected static final String | ROLE_GETTER | "getter"
protected static final String | ROLE_OPERATION | "operation"
protected static final String | ROLE_SETTER | "setter"

org.springframework.jmx.export.naming.IdentityNamingStrategy
public static final String | HASH_CODE_KEY | "hashCode"
public static final String | TYPE_KEY | "type"

org.springframework.jmx.support.ConnectorServerFactoryBean
public static final String DEFAULT_SERVICE_URL "service:jmx:jmxmp://localhost:9875"

org.springframework.jmx.support.JmxUtils
public static final String IDENTITY_OBJECT_NAME_KEY "identity"

org.springframework.jmx.support.MBeanRegistrationSupport
public static final int | REGISTRATION_FAIL_ON_EXISTING | 0
public static final int | REGISTRATION_IGNORE_EXISTING | 1
public static final int | REGISTRATION_REPLACE_EXISTING | 2

org.springframework.jndi.JndiLocatorSupport
public static final String CONTAINER_PREFIX "java:comp/env/"

org.springframework.mail.javamail.JavaMailSenderImpl
public static final int | DEFAULT_PORT | -1
public static final String | DEFAULT_PROTOCOL | "smtp"

org.springframework.mail.javamail.MimeMessageHelper
public static final int | MULTIPART_MODE_MIXED | 1
public static final int | MULTIPART_MODE_MIXED_RELATED | 3
public static final int | MULTIPART_MODE_NO | 0
public static final int | MULTIPART_MODE_RELATED | 2

org.springframework.mock.web.MockHttpServletRequest
public static final String | DEFAULT_PROTOCOL | "http"
public static final String | DEFAULT_REMOTE_ADDR | "127.0.0.1"
public static final String | DEFAULT_REMOTE_HOST | "localhost"
public static final String | DEFAULT_SERVER_ADDR | "127.0.0.1"
public static final String | DEFAULT_SERVER_NAME | "localhost"
public static final int | DEFAULT_SERVER_PORT | 80

org.springframework.mock.web.MockHttpServletResponse
public static final int DEFAULT_SERVER_PORT 80

org.springframework.mock.web.MockHttpSession
public static final String SESSION_COOKIE_NAME "JSESSION"

org.springframework.mock.web.portlet.MockBaseURL
public static final String | URL_TYPE_ACTION | "action"
public static final String | URL_TYPE_RENDER | "render"

org.springframework.mock.web.portlet.MockPortletURL
public static final String | URL_TYPE_ACTION | "action"
public static final String | URL_TYPE_RENDER | "render"

org.springframework.orm.hibernate3.HibernateAccessor
public static final int | FLUSH_ALWAYS | 4
public static final int | FLUSH_AUTO | 1
public static final int | FLUSH_COMMIT | 3
public static final int | FLUSH_EAGER | 2
public static final int | FLUSH_NEVER | 0

org.springframework.orm.hibernate3.SessionFactoryUtils
public static final int SESSION_SYNCHRONIZATION_ORDER 900

org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
public static final String DEFAULT_SESSION_FACTORY_BEAN_NAME "sessionFactory"

org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor
public static final String PARTICIPATE_SUFFIX ".PARTICIPATE"

org.springframework.orm.ibatis.support.AbstractLobTypeHandler
public static final int LOB_CREATOR_SYNCHRONIZATION_ORDER 800

org.springframework.orm.jdo.PersistenceManagerFactoryUtils
public static final int PERSISTENCE_MANAGER_SYNCHRONIZATION_ORDER 900

org.springframework.orm.jdo.support.OpenPersistenceManagerInViewFilter
public static final String DEFAULT_PERSISTENCE_MANAGER_FACTORY_BEAN_NAME "persistenceManagerFactory"

org.springframework.orm.jdo.support.OpenPersistenceManagerInViewInterceptor
public static final String PARTICIPATE_SUFFIX ".PARTICIPATE"

org.springframework.orm.jpa.EntityManagerFactoryUtils
public static final int ENTITY_MANAGER_SYNCHRONIZATION_ORDER 900

org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager
public static final String | DEFAULT_PERSISTENCE_XML_LOCATION | "classpath*:META-INF/persistence.xml"
public static final String | ORIGINAL_DEFAULT_PERSISTENCE_UNIT_ROOT_LOCATION | "classpath:"

org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter
public static final String DEFAULT_PERSISTENCE_MANAGER_FACTORY_BEAN_NAME "entityManagerFactory"

org.springframework.orm.jpa.support.OpenEntityManagerInViewInterceptor
public static final String PARTICIPATE_SUFFIX ".PARTICIPATE"

org.springframework.oxm.castor.CastorMarshaller
public static final String DEFAULT_ENCODING "UTF-8"

org.springframework.oxm.xstream.XStreamMarshaller
public static final String DEFAULT_ENCODING "UTF-8"

org.springframework.remoting.caucho.HessianExporter
public static final String CONTENT_TYPE_HESSIAN "application/x-hessian"

org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
public static final String | CONTENT_TYPE_SERIALIZED_OBJECT | "application/x-java-serialized-object"
protected static final String | ENCODING_GZIP | "gzip"
protected static final String | HTTP_HEADER_ACCEPT_ENCODING | "Accept-Encoding"
protected static final String | HTTP_HEADER_ACCEPT_LANGUAGE | "Accept-Language"
protected static final String | HTTP_HEADER_CONTENT_ENCODING | "Content-Encoding"
protected static final String | HTTP_HEADER_CONTENT_LENGTH | "Content-Length"
protected static final String | HTTP_HEADER_CONTENT_TYPE | "Content-Type"
protected static final String | HTTP_METHOD_POST | "POST"

org.springframework.remoting.jaxws.SimpleJaxWsServiceExporter
public static final String DEFAULT_BASE_ADDRESS "http://localhost:8080/"

org.springframework.remoting.rmi.RemoteInvocationSerializingExporter
public static final String CONTENT_TYPE_SERIALIZED_OBJECT "application/x-java-serialized-object"

org.springframework.scheduling.config.AnnotationDrivenBeanDefinitionParser
public static final String | ASYNC_ANNOTATION_PROCESSOR_BEAN_NAME | "org.springframework.scheduling.annotation.internalAsyncAnnotationProcessor"
public static final String | SCHEDULED_ANNOTATION_PROCESSOR_BEAN_NAME | "org.springframework.scheduling.annotation.internalScheduledAnnotationProcessor"

org.springframework.scheduling.quartz.LocalDataSourceJobStore
public static final String | NON_TX_DATA_SOURCE_PREFIX | "springNonTxDataSource."
public static final String | TX_DATA_SOURCE_PREFIX | "springTxDataSource."

org.springframework.scheduling.quartz.SchedulerFactoryBean
public static final int | DEFAULT_THREAD_COUNT | 10
public static final String | PROP_THREAD_COUNT | "org.quartz.threadPool.threadCount"

org.springframework.scripting.support.ScriptFactoryPostProcessor
public static final String INLINE_SCRIPT_PREFIX "inline:"

org.springframework.test.AbstractDependencyInjectionSpringContextTests
public static final int | AUTOWIRE_BY_NAME | 1
public static final int | AUTOWIRE_BY_TYPE | 2
public static final int | AUTOWIRE_NO | 0

org.springframework.test.jpa.AbstractAspectjJpaTests
public static final String DEFAULT_AOP_XML_LOCATION "META-INF/aop.xml"

org.springframework.transaction.HeuristicCompletionException
public static final int | STATE_COMMITTED | 1
public static final int | STATE_MIXED | 3
public static final int | STATE_ROLLED_BACK | 2
public static final int | STATE_UNKNOWN | 0

org.springframework.transaction.TransactionDefinition
public static final int | ISOLATION_DEFAULT | -1
public static final int | ISOLATION_READ_COMMITTED | 2
public static final int | ISOLATION_READ_UNCOMMITTED | 1
public static final int | ISOLATION_REPEATABLE_READ | 4
public static final int | ISOLATION_SERIALIZABLE | 8
public static final int | PROPAGATION_MANDATORY | 2
public static final int | PROPAGATION_NESTED | 6
public static final int | PROPAGATION_NEVER | 5
public static final int | PROPAGATION_NOT_SUPPORTED | 4
public static final int | PROPAGATION_REQUIRED | 0
public static final int | PROPAGATION_REQUIRES_NEW | 3
public static final int | PROPAGATION_SUPPORTS | 1
public static final int | TIMEOUT_DEFAULT | -1

org.springframework.transaction.interceptor.RuleBasedTransactionAttribute
public static final String | PREFIX_COMMIT_RULE | "+"
public static final String | PREFIX_ROLLBACK_RULE | "-"

org.springframework.transaction.jta.JtaTransactionManager
public static final String | DEFAULT_TRANSACTION_SYNCHRONIZATION_REGISTRY_NAME | "java:comp/TransactionSynchronizationRegistry"
public static final String | DEFAULT_USER_TRANSACTION_NAME | "java:comp/UserTransaction"

org.springframework.transaction.jta.WebSphereUowTransactionManager
public static final String DEFAULT_UOW_MANAGER_NAME "java:comp/websphere/UOWManager"

org.springframework.transaction.support.AbstractPlatformTransactionManager
public static final int | SYNCHRONIZATION_ALWAYS | 0
public static final int | SYNCHRONIZATION_NEVER | 2
public static final int | SYNCHRONIZATION_ON_ACTUAL_TRANSACTION | 1

org.springframework.transaction.support.DefaultTransactionDefinition
public static final String | PREFIX_ISOLATION | "ISOLATION_"
public static final String | PREFIX_PROPAGATION | "PROPAGATION_"
public static final String | PREFIX_TIMEOUT | "timeout_"
public static final String | READ_ONLY_MARKER | "readOnly"

org.springframework.transaction.support.TransactionSynchronization
public static final int | STATUS_COMMITTED | 0
public static final int | STATUS_ROLLED_BACK | 1
public static final int | STATUS_UNKNOWN | 2

org.springframework.ui.context.support.UiApplicationContextUtils
public static final String THEME_SOURCE_BEAN_NAME "themeSource"

org.springframework.ui.velocity.SpringResourceLoader
public static final String | NAME | "spring"
public static final String | SPRING_RESOURCE_LOADER | "spring.resource.loader"
public static final String | SPRING_RESOURCE_LOADER_CACHE | "spring.resource.loader.cache"
public static final String | SPRING_RESOURCE_LOADER_CLASS | "spring.resource.loader.class"
public static final String | SPRING_RESOURCE_LOADER_PATH | "spring.resource.loader.path"

org.springframework.util.AntPathMatcher
public static final String DEFAULT_PATH_SEPARATOR "/"

org.springframework.util.ClassUtils
public static final String | ARRAY_SUFFIX | "[]"
public static final String | CGLIB_CLASS_SEPARATOR | "$$"
public static final String | CLASS_FILE_SUFFIX | ".class"

org.springframework.util.ConcurrencyThrottleSupport
public static final int | NO_CONCURRENCY | 0
public static final int | UNBOUNDED_CONCURRENCY | -1

org.springframework.util.FileCopyUtils
public static final int BUFFER_SIZE 4096

org.springframework.util.Log4jConfigurer
public static final String | CLASSPATH_URL_PREFIX | "classpath:"
public static final String | XML_FILE_EXTENSION | ".xml"

org.springframework.util.ResourceUtils
public static final String | CLASSPATH_URL_PREFIX | "classpath:"
public static final String | FILE_URL_PREFIX | "file:"
public static final String | JAR_URL_SEPARATOR | "!/"
public static final String | URL_PROTOCOL_CODE_SOURCE | "code-source"
public static final String | URL_PROTOCOL_FILE | "file"
public static final String | URL_PROTOCOL_JAR | "jar"
public static final String | URL_PROTOCOL_VFS | "vfs"
public static final String | URL_PROTOCOL_VFSZIP | "vfszip"
public static final String | URL_PROTOCOL_WSJAR | "wsjar"
public static final String | URL_PROTOCOL_ZIP | "zip"

org.springframework.util.SystemPropertyUtils
public static final String | PLACEHOLDER_PREFIX | "${"
public static final String | PLACEHOLDER_SUFFIX | "}"
public static final String | VALUE_SEPARATOR | ":"

org.springframework.util.xml.TransformerUtils
public static final int DEFAULT_INDENT_AMOUNT 2

org.springframework.util.xml.XmlValidationModeDetector
public static final int | VALIDATION_AUTO | 1
public static final int | VALIDATION_DTD | 2
public static final int | VALIDATION_NONE | 0
public static final int | VALIDATION_XSD | 3

org.springframework.validation.DataBinder
public static final String DEFAULT_OBJECT_NAME "target"

org.springframework.validation.DefaultBindingErrorProcessor
public static final String MISSING_FIELD_ERROR_CODE "required"

org.springframework.validation.DefaultMessageCodesResolver
public static final String CODE_SEPARATOR "."

org.springframework.validation.Errors
public static final String NESTED_PATH_SEPARATOR "."

org.springframework.web.bind.ServletRequestParameterPropertyValues
public static final String DEFAULT_PREFIX_SEPARATOR "_"

org.springframework.web.bind.WebDataBinder
public static final String | DEFAULT_FIELD_DEFAULT_PREFIX | "!"
public static final String | DEFAULT_FIELD_MARKER_PREFIX | "_"

org.springframework.web.bind.annotation.ValueConstants
public static final String DEFAULT_NONE "\n\t\t\n\t\t\n\ue000\ue001\ue002\n\t\t\t\t\n"

org.springframework.web.context.ConfigurableWebApplicationContext
public static final String SERVLET_CONFIG_BEAN_NAME "servletConfig"

org.springframework.web.context.ContextLoader
public static final String | CONFIG_LOCATION_PARAM | "contextConfigLocation"
public static final String | CONTEXT_CLASS_PARAM | "contextClass"
public static final String | LOCATOR_FACTORY_KEY_PARAM | "parentContextKey"
public static final String | LOCATOR_FACTORY_SELECTOR_PARAM | "locatorFactorySelector"

org.springframework.web.context.WebApplicationContext
public static final String | CONTEXT_ATTRIBUTES_BEAN_NAME | "contextAttributes"
public static final String | CONTEXT_PARAMETERS_BEAN_NAME | "contextParameters"
public static final String | SCOPE_APPLICATION | "application"
public static final String | SCOPE_GLOBAL_SESSION | "globalSession"
public static final String | SCOPE_REQUEST | "request"
public static final String | SCOPE_SESSION | "session"
public static final String | SERVLET_CONTEXT_BEAN_NAME | "servletContext"

org.springframework.web.context.request.RequestAttributes
public static final String | REFERENCE_REQUEST | "request"
public static final String | REFERENCE_SESSION | "session"
public static final int | SCOPE_GLOBAL_SESSION | 2
public static final int | SCOPE_REQUEST | 0
public static final int | SCOPE_SESSION | 1

org.springframework.web.context.support.XmlWebApplicationContext
public static final String | DEFAULT_CONFIG_LOCATION | "/WEB-INF/applicationContext.xml"
public static final String | DEFAULT_CONFIG_LOCATION_PREFIX | "/WEB-INF/"
public static final String | DEFAULT_CONFIG_LOCATION_SUFFIX | ".xml"

org.springframework.web.filter.AbstractRequestLoggingFilter
public static final String | DEFAULT_AFTER_MESSAGE_PREFIX | "After request ["
public static final String | DEFAULT_AFTER_MESSAGE_SUFFIX | "]"
public static final String | DEFAULT_BEFORE_MESSAGE_PREFIX | "Before request ["
public static final String | DEFAULT_BEFORE_MESSAGE_SUFFIX | "]"

org.springframework.web.filter.HiddenHttpMethodFilter
public static final String DEFAULT_METHOD_PARAM "_method"

org.springframework.web.filter.OncePerRequestFilter
public static final String ALREADY_FILTERED_SUFFIX ".FILTERED"

org.springframework.web.jsf.DelegatingNavigationHandlerProxy
public static final String DEFAULT_TARGET_BEAN_NAME "jsfNavigationHandler"

org.springframework.web.jsf.WebApplicationContextVariableResolver
public static final String WEB_APPLICATION_CONTEXT_VARIABLE_NAME "webApplicationContext"

org.springframework.web.jsf.el.WebApplicationContextFacesELResolver
public static final String WEB_APPLICATION_CONTEXT_VARIABLE_NAME "webApplicationContext"

org.springframework.web.multipart.support.MultipartFilter
public static final String DEFAULT_MULTIPART_RESOLVER_BEAN_NAME "filterMultipartResolver"

org.springframework.web.portlet.DispatcherPortlet
public static final String | ACTION_EXCEPTION_RENDER_PARAMETER | "actionException"
public static final String | DEFAULT_VIEW_RENDERER_URL | "/WEB-INF/servlet/view"
public static final String | HANDLER_ADAPTER_BEAN_NAME | "handlerAdapter"
public static final String | HANDLER_EXCEPTION_RESOLVER_BEAN_NAME | "handlerExceptionResolver"
public static final String | HANDLER_MAPPING_BEAN_NAME | "handlerMapping"
public static final String | MULTIPART_RESOLVER_BEAN_NAME | "portletMultipartResolver"
public static final String | PAGE_NOT_FOUND_LOG_CATEGORY | "org.springframework.web.portlet.PageNotFound"
public static final String | VIEW_RESOLVER_BEAN_NAME | "viewResolver"

org.springframework.web.portlet.FrameworkPortlet
public static final String DEFAULT_NAMESPACE_SUFFIX "-portlet"

org.springframework.web.portlet.bind.PortletRequestParameterPropertyValues
public static final String DEFAULT_PREFIX_SEPARATOR "_"

org.springframework.web.portlet.context.ConfigurablePortletApplicationContext
public static final String | PORTLET_CONFIG_BEAN_NAME | "portletConfig"
public static final String | PORTLET_CONTEXT_BEAN_NAME | "portletContext"

org.springframework.web.portlet.context.XmlPortletApplicationContext
public static final String | DEFAULT_CONFIG_LOCATION | "/WEB-INF/applicationContext.xml"
public static final String | DEFAULT_CONFIG_LOCATION_PREFIX | "/WEB-INF/"
public static final String | DEFAULT_CONFIG_LOCATION_SUFFIX | ".xml"

org.springframework.web.portlet.handler.ParameterHandlerMapping
public static final String DEFAULT_PARAMETER_NAME "action"

org.springframework.web.portlet.handler.ParameterMappingInterceptor
public static final String DEFAULT_PARAMETER_NAME "action"

org.springframework.web.portlet.handler.PortletModeParameterHandlerMapping
public static final String DEFAULT_PARAMETER_NAME "action"

org.springframework.web.portlet.handler.SimpleMappingExceptionResolver
public static final String DEFAULT_EXCEPTION_ATTRIBUTE "exception"

org.springframework.web.portlet.mvc.AbstractWizardFormController
public static final String | PARAM_CANCEL | "_cancel"
public static final String | PARAM_FINISH | "_finish"
public static final String | PARAM_PAGE | "_page"
public static final String | PARAM_TARGET | "_target"

org.springframework.web.portlet.mvc.BaseCommandController
public static final String DEFAULT_COMMAND_NAME "command"

org.springframework.web.servlet.DispatcherServlet
public static final String | HANDLER_ADAPTER_BEAN_NAME | "handlerAdapter"
public static final String | HANDLER_EXCEPTION_RESOLVER_BEAN_NAME | "handlerExceptionResolver"
public static final String | HANDLER_MAPPING_BEAN_NAME | "handlerMapping"
public static final String | LOCALE_RESOLVER_BEAN_NAME | "localeResolver"
public static final String | MULTIPART_RESOLVER_BEAN_NAME | "multipartResolver"
public static final String | PAGE_NOT_FOUND_LOG_CATEGORY | "org.springframework.web.servlet.PageNotFound"
public static final String | REQUEST_TO_VIEW_NAME_TRANSLATOR_BEAN_NAME | "viewNameTranslator"
public static final String | THEME_RESOLVER_BEAN_NAME | "themeResolver"
public static final String | VIEW_RESOLVER_BEAN_NAME | "viewResolver"

org.springframework.web.servlet.FrameworkServlet
public static final String DEFAULT_NAMESPACE_SUFFIX "-servlet"

org.springframework.web.servlet.ResourceServlet
public static final String | RESOURCE_PARAM_NAME | "resource"
public static final String | RESOURCE_URL_DELIMITERS | ",; \t\n"

org.springframework.web.servlet.handler.SimpleMappingExceptionResolver
public static final String DEFAULT_EXCEPTION_ATTRIBUTE "exception"

org.springframework.web.servlet.i18n.LocaleChangeInterceptor
public static final String DEFAULT_PARAM_NAME "locale"

org.springframework.web.servlet.mvc.AbstractWizardFormController
public static final String | PARAM_CANCEL | "_cancel"
public static final String | PARAM_FINISH | "_finish"
public static final String | PARAM_PAGE | "_page"
public static final String | PARAM_TARGET | "_target"

org.springframework.web.servlet.mvc.BaseCommandController
public static final String DEFAULT_COMMAND_NAME "command"

org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
public static final String PAGE_NOT_FOUND_LOG_CATEGORY "org.springframework.web.servlet.PageNotFound"

org.springframework.web.servlet.mvc.multiaction.MultiActionController
public static final String | DEFAULT_COMMAND_NAME | "command"
public static final String | LAST_MODIFIED_METHOD_SUFFIX | "LastModified"
public static final String | PAGE_NOT_FOUND_LOG_CATEGORY | "org.springframework.web.servlet.PageNotFound"

org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver
public static final String DEFAULT_PARAM_NAME "action"

org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver
public static final String PAGE_NOT_FOUND_LOG_CATEGORY "org.springframework.web.servlet.PageNotFound"

org.springframework.web.servlet.support.RequestContext
public static final String DEFAULT_THEME_NAME "theme"

org.springframework.web.servlet.support.WebContentGenerator
public static final String | METHOD_GET | "GET"
public static final String | METHOD_HEAD | "HEAD"
public static final String | METHOD_POST | "POST"

org.springframework.web.servlet.tags.BindErrorsTag
public static final String ERRORS_VARIABLE_NAME "errors"

org.springframework.web.servlet.tags.BindTag
public static final String STATUS_VARIABLE_NAME "status"

org.springframework.web.servlet.tags.MessageTag
public static final String DEFAULT_ARGUMENT_SEPARATOR ","

org.springframework.web.servlet.tags.NestedPathTag
public static final String NESTED_PATH_VARIABLE_NAME "nestedPath"

org.springframework.web.servlet.tags.RequestContextAwareTag
public static final String REQUEST_CONTEXT_PAGE_ATTRIBUTE "org.springframework.web.servlet.tags.REQUEST_CONTEXT"

org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
protected static final String NESTED_PATH_VARIABLE_NAME "nestedPath"

org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
public static final String | CLASS_ATTRIBUTE | "class"
public static final String | DIR_ATTRIBUTE | "dir"
public static final String | LANG_ATTRIBUTE | "lang"
public static final String | ONCLICK_ATTRIBUTE | "onclick"
public static final String | ONDBLCLICK_ATTRIBUTE | "ondblclick"
public static final String | ONKEYDOWN_ATTRIBUTE | "onkeydown"
public static final String | ONKEYPRESS_ATTRIBUTE | "onkeypress"
public static final String | ONKEYUP_ATTRIBUTE | "onkeyup"
public static final String | ONMOUSEDOWN_ATTRIBUTE | "onmousedown"
public static final String | ONMOUSEMOVE_ATTRIBUTE | "onmousemove"
public static final String | ONMOUSEOUT_ATTRIBUTE | "onmouseout"
public static final String | ONMOUSEOVER_ATTRIBUTE | "onmouseover"
public static final String | ONMOUSEUP_ATTRIBUTE | "onmouseup"
public static final String | STYLE_ATTRIBUTE | "style"
public static final String | TABINDEX_ATTRIBUTE | "tabindex"
public static final String | TITLE_ATTRIBUTE | "title"

org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
public static final String | ACCESSKEY_ATTRIBUTE | "accesskey"
public static final String | DISABLED_ATTRIBUTE | "disabled"
public static final String | ONBLUR_ATTRIBUTE | "onblur"
public static final String | ONCHANGE_ATTRIBUTE | "onchange"
public static final String | ONFOCUS_ATTRIBUTE | "onfocus"
public static final String | READONLY_ATTRIBUTE | "readonly"

org.springframework.web.servlet.tags.form.ErrorsTag
public static final String | MESSAGES_ATTRIBUTE | "messages"
public static final String | SPAN_TAG | "span"

org.springframework.web.servlet.tags.form.FormTag
public static final String DEFAULT_COMMAND_NAME "command"

org.springframework.web.servlet.tags.form.InputTag
public static final String | ALT_ATTRIBUTE | "alt"
public static final String | AUTOCOMPLETE_ATTRIBUTE | "autocomplete"
public static final String | MAXLENGTH_ATTRIBUTE | "maxlength"
public static final String | ONSELECT_ATTRIBUTE | "onselect"
public static final String | READONLY_ATTRIBUTE | "readonly"
public static final String | SIZE_ATTRIBUTE | "size"

org.springframework.web.servlet.tags.form.OptionTag
public static final String | DISPLAY_VALUE_VARIABLE_NAME | "displayValue"
public static final String | VALUE_VARIABLE_NAME | "value"

org.springframework.web.servlet.tags.form.SelectTag
public static final String LIST_VALUE_PAGE_ATTRIBUTE "org.springframework.web.servlet.tags.form.SelectTag.listValue"

org.springframework.web.servlet.tags.form.TextareaTag
public static final String | COLS_ATTRIBUTE | "cols"
public static final String | ONSELECT_ATTRIBUTE | "onselect"
public static final String | READONLY_ATTRIBUTE | "readonly"
public static final String | ROWS_ATTRIBUTE | "rows"

org.springframework.web.servlet.theme.AbstractThemeResolver
public static final String ORIGINAL_DEFAULT_THEME_NAME "theme"

org.springframework.web.servlet.theme.CookieThemeResolver
public static final String ORIGINAL_DEFAULT_THEME_NAME "theme"

org.springframework.web.servlet.theme.ThemeChangeInterceptor
public static final String DEFAULT_PARAM_NAME "theme"

org.springframework.web.servlet.view.AbstractTemplateView
public static final String SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE "springMacroRequestContext"

org.springframework.web.servlet.view.AbstractView
public static final String DEFAULT_CONTENT_TYPE "text/html;charset=ISO-8859-1"

org.springframework.web.servlet.view.ResourceBundleViewResolver
public static final String DEFAULT_BASENAME "views"

org.springframework.web.servlet.view.UrlBasedViewResolver
public static final String | FORWARD_URL_PREFIX | "forward:"
public static final String | REDIRECT_URL_PREFIX | "redirect:"

org.springframework.web.servlet.view.XmlViewResolver
public static final String DEFAULT_LOCATION "/WEB-INF/views.xml"

org.springframework.web.servlet.view.feed.AbstractAtomFeedView
public static final String DEFAULT_FEED_TYPE "atom_1.0"

org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
protected static final String | CONTENT_DISPOSITION_INLINE | "inline"
protected static final String | HEADER_CONTENT_DISPOSITION | "Content-Disposition"

org.springframework.web.servlet.view.jasperreports.JasperReportsMultiFormatView
public static final String DEFAULT_FORMAT_KEY "format"

org.springframework.web.servlet.view.json.MappingJacksonJsonView
public static final String DEFAULT_CONTENT_TYPE "application/json"

org.springframework.web.servlet.view.velocity.VelocityLayoutView
public static final String | DEFAULT_LAYOUT_KEY | "layout"
public static final String | DEFAULT_LAYOUT_URL | "layout.vm"
public static final String | DEFAULT_SCREEN_CONTENT_KEY | "screen_content"

org.springframework.web.servlet.view.xml.MarshallingView
public static final String DEFAULT_CONTENT_TYPE "application/xml"

org.springframework.web.servlet.view.xslt.AbstractXsltView
public static final String | DEFAULT_ROOT | "DocRoot"
public static final String | XML_CONTENT_TYPE | "text/xml;charset=ISO-8859-1"

org.springframework.web.struts.ContextLoaderPlugIn
public static final String DEFAULT_NAMESPACE_SUFFIX "-servlet"

org.springframework.web.struts.DelegatingActionUtils
public static final String | AUTOWIRE_BY_NAME | "byName"
public static final String | AUTOWIRE_BY_TYPE | "byType"
public static final String | PARAM_AUTOWIRE | "spring.autowire"
public static final String | PARAM_DEPENDENCY_CHECK | "spring.dependencyCheck"

org.springframework.web.util.CookieGenerator
public static final int | DEFAULT_COOKIE_MAX_AGE | 2147483647
public static final String | DEFAULT_COOKIE_PATH | "/"

org.springframework.web.util.ExpressionEvaluationUtils
public static final String | EXPRESSION_PREFIX | "${"
public static final String | EXPRESSION_SUFFIX | "}"

org.springframework.web.util.Log4jWebConfigurer
public static final String | CONFIG_LOCATION_PARAM | "log4jConfigLocation"
public static final String | EXPOSE_WEB_APP_ROOT_PARAM | "log4jExposeWebAppRoot"
public static final String | REFRESH_INTERVAL_PARAM | "log4jRefreshInterval"

org.springframework.web.util.TagUtils
public static final String | SCOPE_APPLICATION | "application"
public static final String | SCOPE_PAGE | "page"
public static final String | SCOPE_REQUEST | "request"
public static final String | SCOPE_SESSION | "session"

org.springframework.web.util.WebUtils
public static final String | CONTENT_TYPE_CHARSET_PREFIX | ";charset="
public static final String | DEFAULT_CHARACTER_ENCODING | "ISO-8859-1"
public static final String | DEFAULT_WEB_APP_ROOT_KEY | "webapp.root"
public static final String | ERROR_EXCEPTION_ATTRIBUTE | "javax.servlet.error.exception"
public static final String | ERROR_EXCEPTION_TYPE_ATTRIBUTE | "javax.servlet.error.exception_type"
public static final String | ERROR_MESSAGE_ATTRIBUTE | "javax.servlet.error.message"
public static final String | ERROR_REQUEST_URI_ATTRIBUTE | "javax.servlet.error.request_uri"
public static final String | ERROR_SERVLET_NAME_ATTRIBUTE | "javax.servlet.error.servlet_name"
public static final String | ERROR_STATUS_CODE_ATTRIBUTE | "javax.servlet.error.status_code"
public static final String | FORWARD_CONTEXT_PATH_ATTRIBUTE | "javax.servlet.forward.context_path"
public static final String | FORWARD_PATH_INFO_ATTRIBUTE | "javax.servlet.forward.path_info"
public static final String | FORWARD_QUERY_STRING_ATTRIBUTE | "javax.servlet.forward.query_string"
public static final String | FORWARD_REQUEST_URI_ATTRIBUTE | "javax.servlet.forward.request_uri"
public static final String | FORWARD_SERVLET_PATH_ATTRIBUTE | "javax.servlet.forward.servlet_path"
public static final String | HTML_ESCAPE_CONTEXT_PARAM | "defaultHtmlEscape"
public static final String | INCLUDE_CONTEXT_PATH_ATTRIBUTE | "javax.servlet.include.context_path"
public static final String | INCLUDE_PATH_INFO_ATTRIBUTE | "javax.servlet.include.path_info"
public static final String | INCLUDE_QUERY_STRING_ATTRIBUTE | "javax.servlet.include.query_string"
public static final String | INCLUDE_REQUEST_URI_ATTRIBUTE | "javax.servlet.include.request_uri"
public static final String | INCLUDE_SERVLET_PATH_ATTRIBUTE | "javax.servlet.include.servlet_path"
public static final String | TEMP_DIR_CONTEXT_ATTRIBUTE | "javax.servlet.context.tempdir"
public static final String | WEB_APP_ROOT_KEY_PARAM | "webAppRootKey"

Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES


Deprecated List

PREV NEXT FRAMES NO FRAMES

Deprecated API

Contents
  • Deprecated Interfaces
  • Deprecated Classes
  • Deprecated Exceptions
  • Deprecated Annotation Types
  • Deprecated Fields
  • Deprecated Methods
  • Deprecated Constructors
Deprecated Interfaces
org.springframework.core.ConcurrentMap
as of Spring 3.0, since standard ConcurrentMap is available on Java 5+ anyway
org.springframework.remoting.jaxrpc.JaxRpcServicePostProcessor
in favor of JAX-WS support in org.springframework.remoting.jaxws
org.springframework.core.enums.LabeledEnum
as of Spring 3.0, in favor of Java 5 enums.
org.springframework.core.enums.LabeledEnumResolver
as of Spring 3.0, in favor of Java 5 enums.

Deprecated Classes
org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests
as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)
org.springframework.test.jpa.AbstractAspectjJpaTests
as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)
org.springframework.core.enums.AbstractCachingLabeledEnumResolver
as of Spring 3.0, in favor of Java 5 enums.
org.springframework.web.portlet.mvc.AbstractCommandController
as of Spring 3.0, in favor of annotated controllers
org.springframework.web.servlet.mvc.AbstractCommandController
as of Spring 3.0, in favor of annotated controllers
org.springframework.test.AbstractDependencyInjectionSpringContextTests
as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)
org.springframework.web.portlet.mvc.AbstractFormController
as of Spring 3.0, in favor of annotated controllers
org.springframework.web.servlet.mvc.AbstractFormController
as of Spring 3.0, in favor of annotated controllers
org.springframework.core.enums.AbstractGenericLabeledEnum
as of Spring 3.0, in favor of Java 5 enums.
org.springframework.test.jpa.AbstractJpaTests
as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)
org.springframework.core.enums.AbstractLabeledEnum
as of Spring 3.0, in favor of Java 5 enums.
org.springframework.test.web.AbstractModelAndViewTests
as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests) or ModelAndViewAssert with JUnit 4 and TestNG.
org.springframework.test.AbstractSingleSpringContextTests
as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)
org.springframework.test.AbstractSpringContextTests
as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)
org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)
org.springframework.test.AbstractTransactionalSpringContextTests
as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)
org.springframework.web.portlet.mvc.AbstractWizardFormController
as of Spring 3.0, in favor of annotated controllers
org.springframework.web.servlet.mvc.AbstractWizardFormController
as of Spring 3.0, in favor of annotated controllers
org.springframework.web.servlet.view.xslt.AbstractXsltView
since Spring 2.5; superseded by XsltView and its more flexible XsltView.locateSource(java.util.Map) mechanism
org.springframework.web.struts.ActionSupport
as of Spring 3.0
org.springframework.test.AssertThrows
favor use of JUnit 4's @Test(expected=...) support
org.springframework.web.struts.AutowiringRequestProcessor
as of Spring 3.0
org.springframework.web.struts.AutowiringTilesRequestProcessor
as of Spring 3.0
org.springframework.web.portlet.mvc.BaseCommandController
as of Spring 3.0, in favor of annotated controllers
org.springframework.web.servlet.mvc.BaseCommandController
as of Spring 3.0, in favor of annotated controllers
org.springframework.web.servlet.mvc.CancellableFormController
as of Spring 3.0, in favor of annotated controllers
org.springframework.web.servlet.view.tiles.ComponentControllerSupport
as of Spring 3.0
org.springframework.test.ConditionalTestCase
as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)
org.springframework.web.struts.ContextLoaderPlugIn
as of Spring 3.0
org.springframework.jms.listener.DefaultMessageListenerContainer102
as of Spring 3.0, in favor of the JMS 1.1 based DefaultMessageListenerContainer
org.springframework.web.struts.DelegatingActionProxy
as of Spring 3.0
org.springframework.web.struts.DelegatingActionUtils
as of Spring 3.0
org.springframework.web.struts.DelegatingRequestProcessor
as of Spring 3.0
org.springframework.web.struts.DelegatingTilesRequestProcessor
as of Spring 3.0
org.springframework.scheduling.timer.DelegatingTimerTask
as of Spring 3.0, in favor of the scheduling.concurrent package which is based on Java 5's java.util.concurrent.ExecutorService
org.springframework.web.struts.DispatchActionSupport
as of Spring 3.0
org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
in favor of JAX-WS support in org.springframework.remoting.jaxws
org.springframework.remoting.jaxrpc.JaxRpcPortProxyFactoryBean
in favor of JAX-WS support in org.springframework.remoting.jaxws
org.springframework.jms.core.JmsTemplate102
as of Spring 3.0, in favor of the JMS 1.1 based JmsTemplate
org.springframework.jms.connection.JmsTransactionManager102
as of Spring 3.0, in favor of the JMS 1.1 based JmsTransactionManager
org.springframework.core.enums.LetterCodedLabeledEnum
as of Spring 3.0, in favor of Java 5 enums.
org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
in favor of JAX-WS support in org.springframework.remoting.jaxws
org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactoryBean
in favor of JAX-WS support in org.springframework.remoting.jaxws
org.springframework.web.struts.LookupDispatchActionSupport
as of Spring 3.0
org.springframework.web.struts.MappingDispatchActionSupport
as of Spring 3.0
org.springframework.jms.listener.adapter.MessageListenerAdapter102
as of Spring 3.0, in favor of the JMS 1.1 based MessageListenerAdapter
org.springframework.scheduling.timer.MethodInvokingTimerTaskFactoryBean
as of Spring 3.0, in favor of the scheduling.concurrent package which is based on Java 5's java.util.concurrent.ExecutorService
org.springframework.scheduling.timer.ScheduledTimerTask
as of Spring 3.0, in favor of the scheduling.concurrent package which is based on Java 5's java.util.concurrent.ExecutorService
org.springframework.web.context.support.ServletContextFactoryBean
as of Spring 3.0, since "servletContext" is now available as a default bean in every WebApplicationContext
org.springframework.remoting.jaxrpc.ServletEndpointSupport
in favor of JAX-WS support in org.springframework.remoting.jaxws
org.springframework.core.enums.ShortCodedLabeledEnum
as of Spring 3.0, in favor of Java 5 enums.
org.springframework.web.portlet.mvc.SimpleFormController
as of Spring 3.0, in favor of annotated controllers
org.springframework.web.servlet.mvc.SimpleFormController
as of Spring 3.0, in favor of annotated controllers
org.springframework.jms.support.converter.SimpleMessageConverter102
as of Spring 3.0, in favor of the JMS 1.1 based SimpleMessageConverter
org.springframework.jms.listener.SimpleMessageListenerContainer102
as of Spring 3.0, in favor of the JMS 1.1 based SimpleMessageListenerContainer
org.springframework.jms.connection.SingleConnectionFactory102
as of Spring 3.0, in favor of the JMS 1.1 based SingleConnectionFactory
org.springframework.web.struts.SpringBindingActionForm
as of Spring 3.0
org.springframework.core.enums.StaticLabeledEnum
as of Spring 3.0, in favor of Java 5 enums.
org.springframework.core.enums.StaticLabeledEnumResolver
as of Spring 3.0, in favor of Java 5 enums.
org.springframework.core.enums.StringCodedLabeledEnum
as of Spring 3.0, in favor of Java 5 enums.
org.springframework.web.servlet.view.tiles.TilesConfigurer
as of Spring 3.0
org.springframework.web.servlet.view.tiles.TilesJstlView
as of Spring 3.0
org.springframework.web.servlet.view.tiles.TilesView
as of Spring 3.0
org.springframework.scheduling.timer.TimerFactoryBean
as of Spring 3.0, in favor of the scheduling.concurrent package which is based on Java 5's java.util.concurrent.ExecutorService
org.springframework.scheduling.timer.TimerTaskExecutor
as of Spring 3.0, in favor of the scheduling.concurrent package which is based on Java 5's java.util.concurrent.ExecutorService

Deprecated Exceptions
org.springframework.remoting.jaxrpc.JaxRpcSoapFaultException
in favor of JAX-WS support in org.springframework.remoting.jaxws

Deprecated Annotation Types
org.springframework.test.annotation.NotTransactional
as of Spring 3.0, in favor of moving the non-transactional test method to a separate (non-transactional) test class or to a @BeforeTransaction or @AfterTransaction method.

Deprecated Fields
org.springframework.beans.factory.config.AutowireCapableBeanFactory.AUTOWIRE_AUTODETECT
as of Spring 3.0: If you are using mixed autowiring strategies, prefer annotation-based autowiring for clearer demarcation of autowiring needs.
org.springframework.beans.factory.support.AbstractBeanDefinition.AUTOWIRE_AUTODETECT
as of Spring 3.0: If you are using mixed autowiring strategies, use annotation-based autowiring for clearer demarcation of autowiring needs.
org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.COMMAND_NAME_VARIABLE_NAME
as of Spring 2.5, in favor of FormTag.MODEL_ATTRIBUTE_VARIABLE_NAME
org.springframework.web.util.CookieGenerator.DEFAULT_COOKIE_MAX_AGE
in favor of setting no max age value at all in such a case

Deprecated Methods
org.springframework.aop.framework.AdvisedSupport.addAllAdvisors(Advisor[])
as of Spring 3.0, in favor of AdvisedSupport.addAdvisors(org.springframework.aop.Advisor...)
org.springframework.ui.ModelMap.addAllObjects(Collection)
as of Spring 2.5, in favor of ModelMap.addAllAttributes(Collection)
org.springframework.ui.ModelMap.addAllObjects(Map)
as of Spring 2.5, in favor of ModelMap.addAllAttributes(Map)
org.springframework.beans.factory.support.BeanDefinitionBuilder.addConstructorArg(Object)
since Spring 2.5, in favor of BeanDefinitionBuilder.addConstructorArgValue(java.lang.Object)
org.springframework.jdbc.core.simple.AbstractJdbcCall.addDeclaredRowMapper(String, ParameterizedRowMapper)
in favor of AbstractJdbcCall.addDeclaredRowMapper(String, org.springframework.jdbc.core.RowMapper)
org.springframework.context.support.AbstractApplicationContext.addListener(ApplicationListener)
as of Spring 3.0, in favor of AbstractApplicationContext.addApplicationListener(org.springframework.context.ApplicationListener)
org.springframework.ui.ModelMap.addObject(Object)
as of Spring 2.5, in favor of ModelMap.addAttribute(Object)
org.springframework.ui.ModelMap.addObject(String, Object)
as of Spring 2.5, in favor of ModelMap.addAttribute(String, Object)
org.springframework.core.CollectionFactory.createConcurrentMap(int)
as of Spring 3.0, for usage on JDK 1.5 or higher
org.springframework.core.CollectionFactory.createConcurrentMapIfPossible(int)
as of Spring 3.0, for usage on JDK 1.5 or higher
org.springframework.web.context.ContextLoaderListener.createContextLoader()
in favor of simply subclassing ContextLoaderListener itself (which extends ContextLoader, as of Spring 3.0)
org.springframework.core.CollectionFactory.createCopyOnWriteSet()
as of Spring 3.0, for usage on JDK 1.5 or higher
org.springframework.core.CollectionFactory.createIdentityMapIfPossible(int)
as of Spring 2.5, for usage on JDK 1.4 or higher
org.springframework.core.CollectionFactory.createLinkedCaseInsensitiveMapIfPossible(int)
as of Spring 3.0, for usage on JDK 1.5 or higher
org.springframework.core.CollectionFactory.createLinkedMapIfPossible(int)
as of Spring 2.5, for usage on JDK 1.4 or higher
org.springframework.core.CollectionFactory.createLinkedSetIfPossible(int)
as of Spring 2.5, for usage on JDK 1.4 or higher
org.springframework.remoting.rmi.RmiClientInterceptorUtils.doInvoke(MethodInvocation, Remote)
as of Spring 2.5, in favor of RmiClientInterceptorUtils.invokeRemoteMethod(org.aopalliance.intercept.MethodInvocation, java.lang.Object)
org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(SqlMapClientCallback)
as of Spring 3.0 - not really needed anymore with generic SqlMapClientTemplate.execute(org.springframework.orm.ibatis.SqlMapClientCallback) method
org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithMapResult(SqlMapClientCallback)
as of Spring 3.0 - not really needed anymore with generic SqlMapClientTemplate.execute(org.springframework.orm.ibatis.SqlMapClientCallback) method
org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.findUniqueProfileValueSourceFromContext(ApplicationContext)
Use @ProfileValueSourceConfiguration instead.
org.springframework.aop.config.AopNamespaceUtils.forceAutoProxyCreatorToUseClassProxying(BeanDefinitionRegistry)
since Spring 2.5, in favor of AopConfigUtils.forceAutoProxyCreatorToUseClassProxying(BeanDefinitionRegistry)
org.springframework.util.ClassUtils.forName(String)
as of Spring 3.0, in favor of specifying a ClassLoader explicitly: see ClassUtils.forName(String, ClassLoader)
org.springframework.web.context.ContextLoaderListener.getContextLoader()
in favor of simply subclassing ContextLoaderListener itself (which extends ContextLoader, as of Spring 3.0)
org.springframework.validation.DataBinder.getErrors()
in favor of DataBinder.getBindingResult(). Use the BindException.BindException(BindingResult) constructor to create a BindException instance if still needed.
org.springframework.remoting.rmi.RmiClientInterceptorUtils.invoke(MethodInvocation, Remote, String)
as of Spring 2.5, in favor of RmiClientInterceptorUtils.invokeRemoteMethod(org.aopalliance.intercept.MethodInvocation, java.lang.Object)
org.springframework.core.JdkVersion.isAtLeastJava14()
as of Spring 3.0 which requires Java 1.5+
org.springframework.core.JdkVersion.isAtLeastJava15()
as of Spring 3.0 which requires Java 1.5+
org.springframework.core.JdkVersion.isAtLeastJava16()
as of Spring 3.0, in favor of reflective checks for the specific Java 1.6 classes of interest
org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser.isEligibleAttribute(Attr)
in favour of AbstractSimpleBeanDefinitionParser.isEligibleAttribute(org.w3c.dom.Attr, ParserContext)
org.springframework.util.ClassUtils.isPresent(String)
as of Spring 2.5, in favor of ClassUtils.isPresent(String, ClassLoader)
org.springframework.beans.factory.support.AbstractBeanDefinition.overrideFrom(AbstractBeanDefinition)
since Spring 2.5, in favor of AbstractBeanDefinition.overrideFrom(BeanDefinition)
org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.parseStringValue(String, Properties, Set)
as of Spring 3.0, in favor of using PropertyPlaceholderConfigurer.resolvePlaceholder(java.lang.String, java.util.Properties, int) with PropertyPlaceholderHelper. Only retained for compatibility with Spring 2.5 extensions.
org.springframework.jdbc.core.simple.SimpleJdbcTemplate.query(String, ParameterizedRowMapper, Map)
org.springframework.jdbc.core.simple.SimpleJdbcOperations.query(String, ParameterizedRowMapper, Map)
as of Spring 3.0: Use the method using the newly genericized RowMapper interface instead since the RowMapper and ParameterizedRowMapper interfaces are equivalent now.
org.springframework.jdbc.core.simple.SimpleJdbcTemplate.query(String, ParameterizedRowMapper, Object...)
org.springframework.jdbc.core.simple.SimpleJdbcOperations.query(String, ParameterizedRowMapper, Object...)
as of Spring 3.0: Use the method using the newly genericized RowMapper interface instead since the RowMapper and ParameterizedRowMapper interfaces are equivalent now.
org.springframework.jdbc.core.simple.SimpleJdbcTemplate.query(String, ParameterizedRowMapper, SqlParameterSource)
org.springframework.jdbc.core.simple.SimpleJdbcOperations.query(String, ParameterizedRowMapper, SqlParameterSource)
as of Spring 3.0: Use the method using the newly genericized RowMapper interface instead since the RowMapper and ParameterizedRowMapper interfaces are equivalent now.
org.springframework.jdbc.core.simple.SimpleJdbcTemplate.queryForObject(String, ParameterizedRowMapper, Map)
org.springframework.jdbc.core.simple.SimpleJdbcOperations.queryForObject(String, ParameterizedRowMapper, Map)
as of Spring 3.0: Use the method using the newly genericized RowMapper interface instead since the RowMapper and ParameterizedRowMapper interfaces are equivalent now.
org.springframework.jdbc.core.simple.SimpleJdbcTemplate.queryForObject(String, ParameterizedRowMapper, Object...)
org.springframework.jdbc.core.simple.SimpleJdbcOperations.queryForObject(String, ParameterizedRowMapper, Object...)
as of Spring 3.0: Use the method using the newly genericized RowMapper interface instead since the RowMapper and ParameterizedRowMapper interfaces are equivalent now.
org.springframework.jdbc.core.simple.SimpleJdbcTemplate.queryForObject(String, ParameterizedRowMapper, SqlParameterSource)
org.springframework.jdbc.core.simple.SimpleJdbcOperations.queryForObject(String, ParameterizedRowMapper, SqlParameterSource)
as of Spring 3.0: Use the method using the newly genericized RowMapper interface instead since the RowMapper and ParameterizedRowMapper interfaces are equivalent now.
org.springframework.aop.config.AopNamespaceUtils.registerAutoProxyCreatorIfNecessary(ParserContext, Object)
since Spring 2.5, in favor of AopNamespaceUtils.registerAutoProxyCreatorIfNecessary(ParserContext, Element) and AopConfigUtils.registerAutoProxyCreatorIfNecessary(BeanDefinitionRegistry, Object)
org.springframework.beans.PropertyEditorRegistrySupport.registerSharedEditor(Class, PropertyEditor)
as of Spring 3.0, in favor of PropertyEditorRegistrars or ConversionService usage
org.springframework.jdbc.core.simple.SimpleJdbcCallOperations.returningResultSet(String, ParameterizedRowMapper)
in favor of SimpleJdbcCallOperations.returningResultSet(String, org.springframework.jdbc.core.RowMapper)
org.springframework.jdbc.core.simple.SimpleJdbcCall.returningResultSet(String, ParameterizedRowMapper)
in favor of SimpleJdbcCall.returningResultSet(String, org.springframework.jdbc.core.RowMapper)
org.springframework.orm.hibernate3.HibernateOperations.saveOrUpdateAll(Collection)
as of Spring 2.5, in favor of individual saveOrUpdate or merge usage
org.springframework.orm.hibernate3.LocalSessionFactoryBean.setCacheProvider(CacheProvider)
as of Spring 3.0, following Hibernate 3.3's deprecation of the CacheProvider SPI
org.springframework.beans.factory.support.BeanDefinitionBuilder.setFactoryBean(String, String)
since Spring 2.5, in favor of preparing this on the raw BeanDefinition object
org.springframework.beans.factory.support.BeanDefinitionBuilder.setResourceDescription(String)
since Spring 2.5, in favor of preparing this on the raw BeanDefinition object
org.springframework.beans.factory.support.BeanDefinitionBuilder.setSingleton(boolean)
since Spring 2.5, in favor of BeanDefinitionBuilder.setScope(java.lang.String)
org.springframework.beans.factory.support.AbstractBeanDefinition.setSingleton(boolean)
since Spring 2.5, in favor of AbstractBeanDefinition.setScope(java.lang.String)
org.springframework.beans.factory.support.BeanDefinitionBuilder.setSource(Object)
since Spring 2.5, in favor of preparing this on the raw BeanDefinition object
org.springframework.ui.freemarker.FreeMarkerConfigurationFactory.setTemplateLoaders(TemplateLoader[])
as of Spring 2.0.1, in favor of the "preTemplateLoaders" and "postTemplateLoaders" properties
org.springframework.web.servlet.mvc.BaseCommandController.suppressValidation(HttpServletRequest)
as of Spring 2.0.4, in favor of the BaseCommandController.suppressValidation(HttpServletRequest, Object) variant

Deprecated Constructors
org.springframework.beans.factory.support.AbstractBeanDefinition(AbstractBeanDefinition)
since Spring 2.5, in favor of AbstractBeanDefinition.AbstractBeanDefinition(BeanDefinition)
org.springframework.jdbc.CannotGetJdbcConnectionException(String, ClassNotFoundException)
since Spring 2.5, in favor of throwing an IllegalStateException in case of the driver not being found
org.springframework.jdbc.datasource.DriverManagerDataSource(String, String, String, String)
since Spring 2.5. DriverManagerDataSource is primarily intended for accessing pre-registered JDBC drivers. If you need to register a new driver, consider using SimpleDriverDataSource instead.
org.springframework.beans.factory.support.RootBeanDefinition(Class, boolean)
since Spring 2.5, in favor of AbstractBeanDefinition.setScope(java.lang.String)
org.springframework.beans.factory.support.RootBeanDefinition(Class, int)
as of Spring 3.0, in favor of AbstractBeanDefinition.setAutowireMode(int) usage
org.springframework.beans.factory.support.RootBeanDefinition(Class, MutablePropertyValues)
as of Spring 3.0, in favor of AbstractBeanDefinition.getPropertyValues() usage
org.springframework.beans.factory.support.RootBeanDefinition(Class, MutablePropertyValues, boolean)
since Spring 2.5, in favor of AbstractBeanDefinition.setScope(java.lang.String)
org.springframework.jdbc.datasource.SingleConnectionDataSource(String, String, String, String, boolean)
since Spring 2.5. Driver parameter usage is generally not recommended for a SingleConnectionDataSource. If you insist on using driver parameters directly, set up the Driver class manually before invoking this DataSource.

Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES


API Help

PREV NEXT FRAMES NO FRAMES

How This API Document Is Organized

This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.

Overview

The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.

Package

Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:

  • Interfaces (italic)
  • Classes
  • Enums
  • Exceptions
  • Errors
  • Annotation Types

Class/Interface

Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

  • Class inheritance diagram
  • Direct Subclasses
  • All Known Subinterfaces
  • All Known Implementing Classes
  • Class/interface declaration
  • Class/interface description

  • Nested Class Summary
  • Field Summary
  • Constructor Summary
  • Method Summary

  • Field Detail
  • Constructor Detail
  • Method Detail
Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.

Annotation Type

Each annotation type has its own separate page with the following sections:

  • Annotation Type declaration
  • Annotation Type description
  • Required Element Summary
  • Optional Element Summary
  • Element Detail

Enum

Each enum has its own separate page with the following sections:

  • Enum declaration
  • Enum description
  • Enum Constant Summary
  • Enum Constant Detail

Tree (Class Hierarchy)

There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
  • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
  • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.

Deprecated API

The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.

Index

The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.

Prev/Next

These links take you to the next or previous class, interface, package, or related page.

Frames/No Frames

These links show and hide the HTML frames. All pages are available with or without frames.

Serialized Form

Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.

Constant Field Values

The Constant Field Values page lists the static final fields and their values.

This help file applies to API documentation generated using the standard doclet.

Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES


Generated Documentation (Untitled)

Frame Alert

This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
Link toNon-frame version.


Overview List

All Classes

Packages
org.springframework.aop
org.springframework.aop.aspectj
org.springframework.aop.aspectj.annotation
org.springframework.aop.aspectj.autoproxy
org.springframework.aop.config
org.springframework.aop.framework
org.springframework.aop.framework.adapter
org.springframework.aop.framework.autoproxy
org.springframework.aop.framework.autoproxy.target
org.springframework.aop.interceptor
org.springframework.aop.scope
org.springframework.aop.support
org.springframework.aop.support.annotation
org.springframework.aop.target
org.springframework.aop.target.dynamic
org.springframework.beans
org.springframework.beans.annotation
org.springframework.beans.factory
org.springframework.beans.factory.access
org.springframework.beans.factory.access.el
org.springframework.beans.factory.annotation
org.springframework.beans.factory.aspectj
org.springframework.beans.factory.config
org.springframework.beans.factory.parsing
org.springframework.beans.factory.serviceloader
org.springframework.beans.factory.support
org.springframework.beans.factory.wiring
org.springframework.beans.factory.xml
org.springframework.beans.propertyeditors
org.springframework.beans.support
org.springframework.cache.ehcache
org.springframework.context
org.springframework.context.access
org.springframework.context.annotation
org.springframework.context.config
org.springframework.context.event
org.springframework.context.expression
org.springframework.context.i18n
org.springframework.context.support
org.springframework.context.weaving
org.springframework.core
org.springframework.core.annotation
org.springframework.core.convert
org.springframework.core.convert.converter
org.springframework.core.convert.support
org.springframework.core.enums
org.springframework.core.io
org.springframework.core.io.support
org.springframework.core.style
org.springframework.core.task
org.springframework.core.task.support
org.springframework.core.type
org.springframework.core.type.classreading
org.springframework.core.type.filter
org.springframework.dao
org.springframework.dao.annotation
org.springframework.dao.support
org.springframework.ejb.access
org.springframework.ejb.config
org.springframework.ejb.interceptor
org.springframework.ejb.support
org.springframework.expression
org.springframework.expression.common
org.springframework.expression.spel
org.springframework.expression.spel.ast
org.springframework.expression.spel.standard
org.springframework.expression.spel.support
org.springframework.format
org.springframework.format.annotation
org.springframework.format.datetime
org.springframework.format.datetime.joda
org.springframework.format.number
org.springframework.format.support
org.springframework.http
org.springframework.http.client
org.springframework.http.client.support
org.springframework.http.converter
org.springframework.http.converter.feed
org.springframework.http.converter.json
org.springframework.http.converter.xml
org.springframework.http.server
org.springframework.instrument
org.springframework.instrument.classloading
org.springframework.instrument.classloading.glassfish
org.springframework.instrument.classloading.jboss
org.springframework.instrument.classloading.oc4j
org.springframework.instrument.classloading.tomcat
org.springframework.instrument.classloading.weblogic
org.springframework.jca.cci
org.springframework.jca.cci.connection
org.springframework.jca.cci.core
org.springframework.jca.cci.core.support
org.springframework.jca.cci.object
org.springframework.jca.context
org.springframework.jca.endpoint
org.springframework.jca.support
org.springframework.jca.work
org.springframework.jca.work.glassfish
org.springframework.jca.work.jboss
org.springframework.jdbc
org.springframework.jdbc.config
org.springframework.jdbc.core
org.springframework.jdbc.core.metadata
org.springframework.jdbc.core.namedparam
org.springframework.jdbc.core.simple
org.springframework.jdbc.core.support
org.springframework.jdbc.datasource
org.springframework.jdbc.datasource.embedded
org.springframework.jdbc.datasource.init
org.springframework.jdbc.datasource.lookup
org.springframework.jdbc.object
org.springframework.jdbc.support
org.springframework.jdbc.support.incrementer
org.springframework.jdbc.support.lob
org.springframework.jdbc.support.nativejdbc
org.springframework.jdbc.support.rowset
org.springframework.jdbc.support.xml
org.springframework.jms
org.springframework.jms.config
org.springframework.jms.connection
org.springframework.jms.core
org.springframework.jms.core.support
org.springframework.jms.listener
org.springframework.jms.listener.adapter
org.springframework.jms.listener.endpoint
org.springframework.jms.remoting
org.springframework.jms.support
org.springframework.jms.support.converter
org.springframework.jms.support.destination
org.springframework.jmx
org.springframework.jmx.access
org.springframework.jmx.export
org.springframework.jmx.export.annotation
org.springframework.jmx.export.assembler
org.springframework.jmx.export.metadata
org.springframework.jmx.export.naming
org.springframework.jmx.export.notification
org.springframework.jmx.support
org.springframework.jndi
org.springframework.jndi.support
org.springframework.mail
org.springframework.mail.javamail
org.springframework.mock.jndi
org.springframework.mock.staticmock
org.springframework.mock.web
org.springframework.mock.web.portlet
org.springframework.orm
org.springframework.orm.hibernate3
org.springframework.orm.hibernate3.annotation
org.springframework.orm.hibernate3.support
org.springframework.orm.ibatis
org.springframework.orm.ibatis.support
org.springframework.orm.jdo
org.springframework.orm.jdo.support
org.springframework.orm.jpa
org.springframework.orm.jpa.persistenceunit
org.springframework.orm.jpa.support
org.springframework.orm.jpa.vendor
org.springframework.oxm
org.springframework.oxm.castor
org.springframework.oxm.config
org.springframework.oxm.jaxb
org.springframework.oxm.jibx
org.springframework.oxm.mime
org.springframework.oxm.support
org.springframework.oxm.xmlbeans
org.springframework.oxm.xstream
org.springframework.remoting
org.springframework.remoting.caucho
org.springframework.remoting.httpinvoker
org.springframework.remoting.jaxrpc
org.springframework.remoting.jaxws
org.springframework.remoting.rmi
org.springframework.remoting.soap
org.springframework.remoting.support
org.springframework.scheduling
org.springframework.scheduling.annotation
org.springframework.scheduling.backportconcurrent
org.springframework.scheduling.commonj
org.springframework.scheduling.concurrent
org.springframework.scheduling.config
org.springframework.scheduling.quartz
org.springframework.scheduling.support
org.springframework.scheduling.timer
org.springframework.scripting
org.springframework.scripting.bsh
org.springframework.scripting.config
org.springframework.scripting.groovy
org.springframework.scripting.jruby
org.springframework.scripting.support
org.springframework.stereotype
org.springframework.test
org.springframework.test.annotation
org.springframework.test.context
org.springframework.test.context.junit38
org.springframework.test.context.junit4
org.springframework.test.context.junit4.statements
org.springframework.test.context.support
org.springframework.test.context.testng
org.springframework.test.context.transaction
org.springframework.test.jdbc
org.springframework.test.jpa
org.springframework.test.util
org.springframework.test.web
org.springframework.transaction
org.springframework.transaction.annotation
org.springframework.transaction.config
org.springframework.transaction.interceptor
org.springframework.transaction.jta
org.springframework.transaction.support
org.springframework.ui
org.springframework.ui.context
org.springframework.ui.context.support
org.springframework.ui.freemarker
org.springframework.ui.jasperreports
org.springframework.ui.velocity
org.springframework.util
org.springframework.util.comparator
org.springframework.util.xml
org.springframework.validation
org.springframework.validation.beanvalidation
org.springframework.validation.support
org.springframework.web
org.springframework.web.bind
org.springframework.web.bind.annotation
org.springframework.web.bind.annotation.support
org.springframework.web.bind.support
org.springframework.web.client
org.springframework.web.client.support
org.springframework.web.context
org.springframework.web.context.request
org.springframework.web.context.support
org.springframework.web.filter
org.springframework.web.jsf
org.springframework.web.jsf.el
org.springframework.web.multipart
org.springframework.web.multipart.commons
org.springframework.web.multipart.support
org.springframework.web.portlet
org.springframework.web.portlet.bind
org.springframework.web.portlet.bind.annotation
org.springframework.web.portlet.context
org.springframework.web.portlet.handler
org.springframework.web.portlet.multipart
org.springframework.web.portlet.mvc
org.springframework.web.portlet.mvc.annotation
org.springframework.web.portlet.util
org.springframework.web.servlet
org.springframework.web.servlet.config
org.springframework.web.servlet.handler
org.springframework.web.servlet.i18n
org.springframework.web.servlet.mvc
org.springframework.web.servlet.mvc.annotation
org.springframework.web.servlet.mvc.multiaction
org.springframework.web.servlet.mvc.support
org.springframework.web.servlet.support
org.springframework.web.servlet.tags
org.springframework.web.servlet.tags.form
org.springframework.web.servlet.theme
org.springframework.web.servlet.view
org.springframework.web.servlet.view.document
org.springframework.web.servlet.view.feed
org.springframework.web.servlet.view.freemarker
org.springframework.web.servlet.view.jasperreports
org.springframework.web.servlet.view.json
org.springframework.web.servlet.view.tiles
org.springframework.web.servlet.view.tiles2
org.springframework.web.servlet.view.velocity
org.springframework.web.servlet.view.xml
org.springframework.web.servlet.view.xslt
org.springframework.web.struts
org.springframework.web.util


Serialized Form

Package org.springframework.aop

Class org.springframework.aop.AopInvocationException extends NestedRuntimeException implements Serializable

Package org.springframework.aop.aspectj

Class org.springframework.aop.aspectj.AspectJAdviceParameterNameDiscoverer.AmbiguousBindingException extends RuntimeException implements Serializable

Class org.springframework.aop.aspectj.AspectJExpressionPointcut extends AbstractExpressionPointcut implements Serializable

Serialization Methods

readObject

private void readObject(ObjectInputStream ois)
                 throws IOException,
                        ClassNotFoundException
Throws:
IOException
ClassNotFoundException
Serialized Fields

pointcutDeclarationScope

Class<T> pointcutDeclarationScope

pointcutParameterNames

String[] pointcutParameterNames

pointcutParameterTypes

Class<T>[] pointcutParameterTypes

beanFactory

BeanFactory beanFactory

Class org.springframework.aop.aspectj.AspectJExpressionPointcutAdvisor extends AbstractGenericPointcutAdvisor implements Serializable

Serialized Fields

pointcut

AspectJExpressionPointcut pointcut
Package org.springframework.aop.aspectj.annotation

Class org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator extends AspectJAwareAdvisorAutoProxyCreator implements Serializable

Serialized Fields

includePatterns

List<E> includePatterns

aspectJAdvisorFactory

AspectJAdvisorFactory aspectJAdvisorFactory

aspectJAdvisorsBuilder

BeanFactoryAspectJAdvisorsBuilder aspectJAdvisorsBuilder

Class org.springframework.aop.aspectj.annotation.AspectJProxyFactory extends ProxyCreatorSupport implements Serializable

Serialized Fields

aspectFactory

AspectJAdvisorFactory aspectFactory

Class org.springframework.aop.aspectj.annotation.NotAnAtAspectException extends AopConfigException implements Serializable

Serialized Fields

nonAspectClass

Class<T> nonAspectClass

Class org.springframework.aop.aspectj.annotation.ReflectiveAspectJAdvisorFactory.SyntheticInstantiationAdvisor extends DefaultPointcutAdvisor implements Serializable

Package org.springframework.aop.aspectj.autoproxy

Class org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator extends AbstractAdvisorAutoProxyCreator implements Serializable

Package org.springframework.aop.framework

Class org.springframework.aop.framework.AbstractSingletonProxyFactoryBean extends ProxyConfig implements Serializable

Serialized Fields

target

Object target

proxyInterfaces

Class<T>[] proxyInterfaces

preInterceptors

Object[] preInterceptors

postInterceptors

Object[] postInterceptors

advisorAdapterRegistry

AdvisorAdapterRegistry advisorAdapterRegistry
Default is global AdvisorAdapterRegistry

proxy

Object proxy

Class org.springframework.aop.framework.AdvisedSupport extends ProxyConfig implements Serializable

serialVersionUID: 2651364800145442165L

Serialization Methods

readObject

private void readObject(ObjectInputStream ois)
                 throws IOException,
                        ClassNotFoundException
Throws:
IOException
ClassNotFoundException
Serialized Fields

targetSource

TargetSource targetSource
Package-protected to allow direct access for efficiency

preFiltered

boolean preFiltered
Whether the Advisors are already filtered for the specific target class

advisorChainFactory

AdvisorChainFactory advisorChainFactory
The AdvisorChainFactory to use

interfaces

List<E> interfaces
Interfaces to be implemented by the proxy. Held in List to keep the order of registration, to create JDK proxy with specified order of interfaces.

advisors

List<E> advisors
List of Advisors. If an Advice is added, it will be wrapped in an Advisor before being added to this List.

advisorArray

Advisor[] advisorArray
Array updated on changes to the advisors list, which is easier to manipulate internally.

Class org.springframework.aop.framework.AopConfigException extends NestedRuntimeException implements Serializable

Class org.springframework.aop.framework.Cglib2AopProxy.SerializableNoOp extends Object implements Serializable

Class org.springframework.aop.framework.DefaultAdvisorChainFactory extends Object implements Serializable

Class org.springframework.aop.framework.DefaultAopProxyFactory extends Object implements Serializable

Class org.springframework.aop.framework.ProxyConfig extends Object implements Serializable

serialVersionUID: -8409359707199703185L

Serialized Fields

proxyTargetClass

boolean proxyTargetClass

optimize

boolean optimize

opaque

boolean opaque

exposeProxy

boolean exposeProxy

frozen

boolean frozen

Class org.springframework.aop.framework.ProxyCreatorSupport extends AdvisedSupport implements Serializable

Serialized Fields

aopProxyFactory

AopProxyFactory aopProxyFactory

listeners

List<E> listeners

active

boolean active
Set to true when the first AOP proxy has been created

Class org.springframework.aop.framework.ProxyFactory extends ProxyCreatorSupport implements Serializable

Class org.springframework.aop.framework.ProxyFactoryBean extends ProxyCreatorSupport implements Serializable

Serialization Methods

readObject

private void readObject(ObjectInputStream ois)
                 throws IOException,
                        ClassNotFoundException
Throws:
IOException
ClassNotFoundException
Serialized Fields

logger

Log logger

interceptorNames

String[] interceptorNames

targetName

String targetName

autodetectInterfaces

boolean autodetectInterfaces

singleton

boolean singleton

advisorAdapterRegistry

AdvisorAdapterRegistry advisorAdapterRegistry

freezeProxy

boolean freezeProxy

advisorChainInitialized

boolean advisorChainInitialized
Whether the advisor chain has already been initialized

singletonInstance

Object singletonInstance
If this is a singleton, the cached singleton proxy instance

Package org.springframework.aop.framework.adapter

Class org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor extends Object implements Serializable

Serialized Fields

advice

AfterReturningAdvice advice

Class org.springframework.aop.framework.adapter.DefaultAdvisorAdapterRegistry extends Object implements Serializable

Serialized Fields

adapters

List<E> adapters

Class org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor extends Object implements Serializable

Serialized Fields

advice

MethodBeforeAdvice advice

Class org.springframework.aop.framework.adapter.UnknownAdviceTypeException extends IllegalArgumentException implements Serializable

Package org.springframework.aop.framework.autoproxy

Class org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator extends AbstractAutoProxyCreator implements Serializable

Serialized Fields

advisorRetrievalHelper

BeanFactoryAdvisorRetrievalHelper advisorRetrievalHelper

Class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator extends ProxyConfig implements Serializable

Serialized Fields

logger

Log logger
Logger available to subclasses

order

int order
Default value is same as non-ordered

advisorAdapterRegistry

AdvisorAdapterRegistry advisorAdapterRegistry
Default is global AdvisorAdapterRegistry

freezeProxy

boolean freezeProxy
Indicates whether or not the proxy should be frozen. Overridden from super to prevent the configuration from becoming frozen too early.

interceptorNames

String[] interceptorNames
Default is no common interceptors

applyCommonInterceptorsFirst

boolean applyCommonInterceptorsFirst

customTargetSourceCreators

TargetSourceCreator[] customTargetSourceCreators

proxyClassLoader

ClassLoader proxyClassLoader

classLoaderConfigured

boolean classLoaderConfigured

beanFactory

BeanFactory beanFactory

targetSourcedBeans

Set<E> targetSourcedBeans

earlyProxyReferences

Set<E> earlyProxyReferences

advisedBeans

Set<E> advisedBeans

nonAdvisedBeans

Set<E> nonAdvisedBeans

proxyTypes

Map<K,V> proxyTypes

Class org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator extends AbstractAutoProxyCreator implements Serializable

Serialized Fields

beanNames

List<E> beanNames

Class org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator extends AbstractAdvisorAutoProxyCreator implements Serializable

Serialized Fields

usePrefix

boolean usePrefix

advisorBeanNamePrefix

String advisorBeanNamePrefix

Class org.springframework.aop.framework.autoproxy.InfrastructureAdvisorAutoProxyCreator extends AbstractAdvisorAutoProxyCreator implements Serializable

Serialized Fields

beanFactory

ConfigurableListableBeanFactory beanFactory
Package org.springframework.aop.interceptor

Class org.springframework.aop.interceptor.AbstractMonitoringInterceptor extends AbstractTraceInterceptor implements Serializable

Serialized Fields

prefix

String prefix

suffix

String suffix

logTargetClassInvocation

boolean logTargetClassInvocation

Class org.springframework.aop.interceptor.AbstractTraceInterceptor extends Object implements Serializable

Serialized Fields

hideProxyClassNames

boolean hideProxyClassNames
Indicates whether or not proxy class names should be hidden when using dynamic loggers.

See Also:
AbstractTraceInterceptor.setUseDynamicLogger(boolean)

Class org.springframework.aop.interceptor.ConcurrencyThrottleInterceptor extends ConcurrencyThrottleSupport implements Serializable

Class org.springframework.aop.interceptor.CustomizableTraceInterceptor extends AbstractTraceInterceptor implements Serializable

Serialized Fields

enterMessage

String enterMessage
The message for method entry.

exitMessage

String exitMessage
The message for method exit.

exceptionMessage

String exceptionMessage
The message for exceptions during method execution.

Class org.springframework.aop.interceptor.DebugInterceptor extends SimpleTraceInterceptor implements Serializable

Serialized Fields

count

long count

Class org.springframework.aop.interceptor.ExposeInvocationInterceptor extends Object implements Serializable

Serialization Methods

readResolve

private Object readResolve()
Required to support serialization. Replaces with canonical instance on deserialization, protecting Singleton pattern.

Alternative to overriding the equals method.

Class org.springframework.aop.interceptor.JamonPerformanceMonitorInterceptor extends AbstractMonitoringInterceptor implements Serializable

Serialized Fields

trackAllInvocations

boolean trackAllInvocations

Class org.springframework.aop.interceptor.PerformanceMonitorInterceptor extends AbstractMonitoringInterceptor implements Serializable

Class org.springframework.aop.interceptor.SimpleTraceInterceptor extends AbstractTraceInterceptor implements Serializable

Package org.springframework.aop.scope

Class org.springframework.aop.scope.DefaultScopedObject extends Object implements Serializable

Serialized Fields

beanFactory

ConfigurableBeanFactory beanFactory

targetBeanName

String targetBeanName

Class org.springframework.aop.scope.ScopedProxyFactoryBean extends ProxyConfig implements Serializable

Serialized Fields

scopedTargetSource

SimpleBeanTargetSource scopedTargetSource
The TargetSource that manages scoping

targetBeanName

String targetBeanName
The name of the target bean

proxy

Object proxy
The cached singleton proxy

Package org.springframework.aop.support

Class org.springframework.aop.support.AbstractBeanFactoryPointcutAdvisor extends AbstractPointcutAdvisor implements Serializable

Serialization Methods

readObject

private void readObject(ObjectInputStream ois)
                 throws IOException,
                        ClassNotFoundException
Throws:
IOException
ClassNotFoundException
Serialized Fields

adviceBeanName

String adviceBeanName

beanFactory

BeanFactory beanFactory

Class org.springframework.aop.support.AbstractExpressionPointcut extends Object implements Serializable

Serialized Fields

location

String location

expression

String expression

Class org.springframework.aop.support.AbstractGenericPointcutAdvisor extends AbstractPointcutAdvisor implements Serializable

Serialized Fields

advice

Advice advice

Class org.springframework.aop.support.AbstractPointcutAdvisor extends Object implements Serializable

Serialized Fields

order

Integer order

Class org.springframework.aop.support.AbstractRegexpMethodPointcut extends StaticMethodMatcherPointcut implements Serializable

Serialized Fields

patterns

String[] patterns
Regular expressions to match

excludedPatterns

String[] excludedPatterns
Regular expressions not to match

Class org.springframework.aop.support.ComposablePointcut extends Object implements Serializable

serialVersionUID: -2743223737633663832L

Serialized Fields

classFilter

ClassFilter classFilter

methodMatcher

MethodMatcher methodMatcher

Class org.springframework.aop.support.ControlFlowPointcut extends Object implements Serializable

Serialized Fields

clazz

Class<T> clazz

methodName

String methodName

evaluations

int evaluations

Class org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor extends AbstractBeanFactoryPointcutAdvisor implements Serializable

Serialized Fields

pointcut

Pointcut pointcut

Class org.springframework.aop.support.DefaultIntroductionAdvisor extends Object implements Serializable

Serialized Fields

advice

Advice advice

interfaces

Set<E> interfaces

order

int order

Class org.springframework.aop.support.DefaultPointcutAdvisor extends AbstractGenericPointcutAdvisor implements Serializable

Serialized Fields

pointcut

Pointcut pointcut

Class org.springframework.aop.support.DelegatePerTargetObjectIntroductionInterceptor extends IntroductionInfoSupport implements Serializable

Serialized Fields

delegateMap

Map<K,V> delegateMap
Hold weak references to keys as we don't want to interfere with garbage collection..

defaultImplType

Class<T> defaultImplType

interfaceType

Class<T> interfaceType

Class org.springframework.aop.support.DelegatingIntroductionInterceptor extends IntroductionInfoSupport implements Serializable

Serialized Fields

delegate

Object delegate
Object that actually implements the interfaces. May be "this" if a subclass implements the introduced interfaces.

Class org.springframework.aop.support.IntroductionInfoSupport extends Object implements Serializable

Serialization Methods

readObject

private void readObject(ObjectInputStream ois)
                 throws IOException,
                        ClassNotFoundException
This method is implemented only to restore the logger. We don't make the logger static as that would mean that subclasses would use this class's log category.

Throws:
IOException
ClassNotFoundException
Serialized Fields

publishedInterfaces

Set<E> publishedInterfaces

Class org.springframework.aop.support.JdkRegexpMethodPointcut extends AbstractRegexpMethodPointcut implements Serializable

Serialized Fields

compiledPatterns

Pattern[] compiledPatterns
Compiled form of the patterns.

compiledExclusionPatterns

Pattern[] compiledExclusionPatterns
Compiled form of the exclusion patterns.

Class org.springframework.aop.support.NameMatchMethodPointcut extends StaticMethodMatcherPointcut implements Serializable

Serialized Fields

mappedNames

List<E> mappedNames

Class org.springframework.aop.support.NameMatchMethodPointcutAdvisor extends AbstractGenericPointcutAdvisor implements Serializable

Serialized Fields

pointcut

NameMatchMethodPointcut pointcut

Class org.springframework.aop.support.RegexpMethodPointcutAdvisor extends AbstractGenericPointcutAdvisor implements Serializable

Serialized Fields

patterns

String[] patterns

pointcut

AbstractRegexpMethodPointcut pointcut

pointcutMonitor

Object pointcutMonitor

Class org.springframework.aop.support.RootClassFilter extends Object implements Serializable

Serialized Fields

clazz

Class<T> clazz

Class org.springframework.aop.support.StaticMethodMatcherPointcutAdvisor extends StaticMethodMatcherPointcut implements Serializable

Serialized Fields

order

int order

advice

Advice advice
Package org.springframework.aop.target

Class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource extends Object implements Serializable

serialVersionUID: -4721607536018568393L

Serialized Fields

logger

Log logger
Logger available to subclasses

targetBeanName

String targetBeanName
Name of the target bean we will create on each invocation

targetClass

Class<T> targetClass
Class of the target

beanFactory

BeanFactory beanFactory
BeanFactory that owns this TargetSource. We need to hold onto this reference so that we can create new prototype instances as necessary.

Class org.springframework.aop.target.AbstractPoolingTargetSource extends AbstractPrototypeBasedTargetSource implements Serializable

Serialized Fields

maxSize

int maxSize
The maximum size of the pool

Class org.springframework.aop.target.AbstractPrototypeBasedTargetSource extends AbstractBeanFactoryBasedTargetSource implements Serializable

Serialization Methods

writeReplace

protected Object writeReplace()
                       throws ObjectStreamException
Replaces this object with a SingletonTargetSource on serialization. Protected as otherwise it won't be invoked for subclasses. (The writeReplace() method must be visible to the class being serialized.)

With this implementation of this method, there is no need to mark non-serializable fields in this class or subclasses as transient.

Throws:
ObjectStreamException

Class org.springframework.aop.target.CommonsPoolTargetSource extends AbstractPoolingTargetSource implements Serializable

Serialized Fields

maxIdle

int maxIdle

minIdle

int minIdle

maxWait

long maxWait

timeBetweenEvictionRunsMillis

long timeBetweenEvictionRunsMillis

minEvictableIdleTimeMillis

long minEvictableIdleTimeMillis

whenExhaustedAction

byte whenExhaustedAction

pool

ObjectPool pool
The Jakarta Commons ObjectPool used to pool target objects

Class org.springframework.aop.target.EmptyTargetSource extends Object implements Serializable

serialVersionUID: 3680494563553489691L

Serialization Methods

readResolve

private Object readResolve()
Returns the canonical instance on deserialization in case of no target class, thus protecting the Singleton pattern.

Serialized Fields

targetClass

Class<T> targetClass

isStatic

boolean isStatic

Class org.springframework.aop.target.HotSwappableTargetSource extends Object implements Serializable

serialVersionUID: 7497929212653839187L

Serialized Fields

target

Object target
The current target object

Class org.springframework.aop.target.LazyInitTargetSource extends AbstractBeanFactoryBasedTargetSource implements Serializable

Serialized Fields

target

Object target

Class org.springframework.aop.target.PrototypeTargetSource extends AbstractPrototypeBasedTargetSource implements Serializable

Class org.springframework.aop.target.SimpleBeanTargetSource extends AbstractBeanFactoryBasedTargetSource implements Serializable

Class org.springframework.aop.target.SingletonTargetSource extends Object implements Serializable

serialVersionUID: 9031246629662423738L

Serialized Fields

target

Object target
Target cached and invoked using reflection

Class org.springframework.aop.target.ThreadLocalTargetSource extends AbstractPrototypeBasedTargetSource implements Serializable

Serialized Fields

targetInThread

ThreadLocal<T> targetInThread
ThreadLocal holding the target associated with the current thread. Unlike most ThreadLocals, which are static, this variable is meant to be per thread per instance of the ThreadLocalTargetSource class.

targetSet

Set<E> targetSet
Set of managed targets, enabling us to keep track of the targets we've created.

invocationCount

int invocationCount

hitCount

int hitCount
Package org.springframework.beans

Class org.springframework.beans.BeanInstantiationException extends FatalBeanException implements Serializable

Serialized Fields

beanClass

Class<T> beanClass

Class org.springframework.beans.BeanMetadataAttributeAccessor extends AttributeAccessorSupport implements Serializable

Serialized Fields

source

Object source

Class org.springframework.beans.BeansException extends NestedRuntimeException implements Serializable

Class org.springframework.beans.ConversionNotSupportedException extends TypeMismatchException implements Serializable

Class org.springframework.beans.FatalBeanException extends BeansException implements Serializable

Class org.springframework.beans.InvalidPropertyException extends FatalBeanException implements Serializable

Serialized Fields

beanClass

Class<T> beanClass

propertyName

String propertyName

Class org.springframework.beans.MethodInvocationException extends PropertyAccessException implements Serializable

Class org.springframework.beans.MutablePropertyValues extends Object implements Serializable

Serialized Fields

propertyValueList

List<E> propertyValueList

processedProperties

Set<E> processedProperties

converted

boolean converted

Class org.springframework.beans.NotReadablePropertyException extends InvalidPropertyException implements Serializable

Class org.springframework.beans.NotWritablePropertyException extends InvalidPropertyException implements Serializable

Serialized Fields

possibleMatches

String[] possibleMatches

Class org.springframework.beans.NullValueInNestedPathException extends InvalidPropertyException implements Serializable

Class org.springframework.beans.PropertyAccessException extends BeansException implements Serializable

Class org.springframework.beans.PropertyBatchUpdateException extends BeansException implements Serializable

Serialized Fields

propertyAccessExceptions

PropertyAccessException[] propertyAccessExceptions
List of PropertyAccessException objects

Class org.springframework.beans.PropertyValue extends BeanMetadataAttributeAccessor implements Serializable

Serialized Fields

name

String name

value

Object value

source

Object source

optional

boolean optional

converted

boolean converted

convertedValue

Object convertedValue

conversionNecessary

Boolean conversionNecessary
Package-visible field that indicates whether conversion is necessary

resolvedTokens

Object resolvedTokens
Package-visible field for caching the resolved property path tokens

resolvedDescriptor

PropertyDescriptor resolvedDescriptor
Package-visible field for caching the resolved PropertyDescriptor

Class org.springframework.beans.TypeMismatchException extends PropertyAccessException implements Serializable

Serialized Fields

requiredType

Class<T> requiredType
Package org.springframework.beans.factory

Class org.springframework.beans.factory.BeanCreationException extends FatalBeanException implements Serializable

Serialized Fields

beanName

String beanName

resourceDescription

String resourceDescription

relatedCauses

List<E> relatedCauses

Class org.springframework.beans.factory.BeanCreationNotAllowedException extends BeanCreationException implements Serializable

Class org.springframework.beans.factory.BeanCurrentlyInCreationException extends BeanCreationException implements Serializable

Class org.springframework.beans.factory.BeanDefinitionStoreException extends FatalBeanException implements Serializable

Serialized Fields

resourceDescription

String resourceDescription

beanName

String beanName

Class org.springframework.beans.factory.BeanExpressionException extends FatalBeanException implements Serializable

Class org.springframework.beans.factory.BeanInitializationException extends FatalBeanException implements Serializable

Class org.springframework.beans.factory.BeanIsAbstractException extends BeanCreationException implements Serializable

Class org.springframework.beans.factory.BeanIsNotAFactoryException extends BeanNotOfRequiredTypeException implements Serializable

Class org.springframework.beans.factory.BeanNotOfRequiredTypeException extends BeansException implements Serializable

Serialized Fields

beanName

String beanName
The name of the instance that was of the wrong type

requiredType

Class<T> requiredType
The required type

actualType

Class<T> actualType
The offending type

Class org.springframework.beans.factory.CannotLoadBeanClassException extends FatalBeanException implements Serializable

Serialized Fields

resourceDescription

String resourceDescription

beanName

String beanName

beanClassName

String beanClassName

Class org.springframework.beans.factory.FactoryBeanNotInitializedException extends FatalBeanException implements Serializable

Class org.springframework.beans.factory.NoSuchBeanDefinitionException extends BeansException implements Serializable

Serialized Fields

beanName

String beanName
Name of the missing bean

beanType

Class<T> beanType
Required bean type

Class org.springframework.beans.factory.UnsatisfiedDependencyException extends BeanCreationException implements Serializable

Package org.springframework.beans.factory.access

Class org.springframework.beans.factory.access.BootstrapException extends FatalBeanException implements Serializable

Package org.springframework.beans.factory.annotation

Class org.springframework.beans.factory.annotation.AnnotatedGenericBeanDefinition extends GenericBeanDefinition implements Serializable

Serialized Fields

annotationMetadata

AnnotationMetadata annotationMetadata

Class org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor extends Object implements Serializable

Serialization Methods

readObject

private void readObject(ObjectInputStream ois)
                 throws IOException,
                        ClassNotFoundException
Throws:
IOException
ClassNotFoundException
Serialized Fields

initAnnotationType

Class<T> initAnnotationType

destroyAnnotationType

Class<T> destroyAnnotationType

order

int order
Package org.springframework.beans.factory.config

Class org.springframework.beans.factory.config.DependencyDescriptor extends Object implements Serializable

Serialization Methods

readObject

private void readObject(ObjectInputStream ois)
                 throws IOException,
                        ClassNotFoundException
Throws:
IOException
ClassNotFoundException
Serialized Fields

declaringClass

Class<T> declaringClass

methodName

String methodName

parameterTypes

Class<T>[] parameterTypes

parameterIndex

int parameterIndex

fieldName

String fieldName

required

boolean required

eager

boolean eager
Package org.springframework.beans.factory.parsing

Class org.springframework.beans.factory.parsing.BeanDefinitionParsingException extends BeanDefinitionStoreException implements Serializable

Package org.springframework.beans.factory.support

Class org.springframework.beans.factory.support.AbstractBeanDefinition extends BeanMetadataAttributeAccessor implements Serializable

Serialized Fields

beanClass

Object beanClass

scope

String scope

singleton

boolean singleton

prototype

boolean prototype

abstractFlag

boolean abstractFlag

lazyInit

boolean lazyInit

autowireMode

int autowireMode

dependencyCheck

int dependencyCheck

dependsOn

String[] dependsOn

autowireCandidate

boolean autowireCandidate

primary

boolean primary

qualifiers

Map<K,V> qualifiers

nonPublicAccessAllowed

boolean nonPublicAccessAllowed

lenientConstructorResolution

boolean lenientConstructorResolution

constructorArgumentValues

ConstructorArgumentValues constructorArgumentValues

propertyValues

MutablePropertyValues propertyValues

methodOverrides

MethodOverrides methodOverrides

factoryBeanName

String factoryBeanName

factoryMethodName

String factoryMethodName

initMethodName

String initMethodName

destroyMethodName

String destroyMethodName

enforceInitMethod

boolean enforceInitMethod

enforceDestroyMethod

boolean enforceDestroyMethod

synthetic

boolean synthetic

role

int role

description

String description

resource

Resource resource

Class org.springframework.beans.factory.support.AutowireCandidateQualifier extends BeanMetadataAttributeAccessor implements Serializable

Serialized Fields

typeName

String typeName

Class org.springframework.beans.factory.support.BeanDefinitionValidationException extends FatalBeanException implements Serializable

Class org.springframework.beans.factory.support.ChildBeanDefinition extends AbstractBeanDefinition implements Serializable

Serialized Fields

parentName

String parentName

Class org.springframework.beans.factory.support.DefaultListableBeanFactory extends AbstractAutowireCapableBeanFactory implements Serializable

Serialization Methods

writeReplace

protected Object writeReplace()
                       throws ObjectStreamException
Throws:
ObjectStreamException
Serialized Fields

serializationId

String serializationId
Optional id for this factory, for serialization purposes

allowBeanDefinitionOverriding

boolean allowBeanDefinitionOverriding
Whether to allow re-registration of a different definition with the same name

allowEagerClassLoading

boolean allowEagerClassLoading
Whether to allow eager class loading even for lazy-init beans

autowireCandidateResolver

AutowireCandidateResolver autowireCandidateResolver
Resolver to use for checking if a bean definition is an autowire candidate

resolvableDependencies

Map<K,V> resolvableDependencies
Map from dependency type to corresponding autowired value

beanDefinitionMap

Map<K,V> beanDefinitionMap
Map of bean definition objects, keyed by bean name

beanDefinitionNames

List<E> beanDefinitionNames
List of bean definition names, in registration order

configurationFrozen

boolean configurationFrozen
Whether bean definition metadata may be cached for all beans

frozenBeanDefinitionNames

String[] frozenBeanDefinitionNames
Cached array of bean definition names in case of frozen configuration

Class org.springframework.beans.factory.support.GenericBeanDefinition extends AbstractBeanDefinition implements Serializable

Serialized Fields

parentName

String parentName

Class org.springframework.beans.factory.support.ManagedArray extends ManagedList<Object> implements Serializable

Serialized Fields

resolvedElementType

Class<T> resolvedElementType
Resolved element type for runtime creation of the target array

Class org.springframework.beans.factory.support.ManagedList extends ArrayList<E> implements Serializable

Serialized Fields

source

Object source

elementTypeName

String elementTypeName

mergeEnabled

boolean mergeEnabled

Class org.springframework.beans.factory.support.ManagedMap extends LinkedHashMap<K,V> implements Serializable

Serialized Fields

source

Object source

keyTypeName

String keyTypeName

valueTypeName

String valueTypeName

mergeEnabled

boolean mergeEnabled

Class org.springframework.beans.factory.support.ManagedProperties extends Properties implements Serializable

Serialized Fields

source

Object source

mergeEnabled

boolean mergeEnabled

Class org.springframework.beans.factory.support.ManagedSet extends LinkedHashSet<E> implements Serializable

Serialized Fields

source

Object source

elementTypeName

String elementTypeName

mergeEnabled

boolean mergeEnabled

Class org.springframework.beans.factory.support.RootBeanDefinition extends AbstractBeanDefinition implements Serializable

Serialized Fields

externallyManagedConfigMembers

Set<E> externallyManagedConfigMembers

externallyManagedInitMethods

Set<E> externallyManagedInitMethods

externallyManagedDestroyMethods

Set<E> externallyManagedDestroyMethods

decoratedDefinition

BeanDefinitionHolder decoratedDefinition

isFactoryMethodUnique

boolean isFactoryMethodUnique

resolvedConstructorOrFactoryMethod

Object resolvedConstructorOrFactoryMethod
Package-visible field for caching the resolved constructor or factory method

resolvedConstructorArguments

Object[] resolvedConstructorArguments
Package-visible field for caching fully resolved constructor arguments

preparedConstructorArguments

Object[] preparedConstructorArguments
Package-visible field for caching partly prepared constructor arguments

constructorArgumentsResolved

boolean constructorArgumentsResolved
Package-visible field that marks the constructor arguments as resolved

beforeInstantiationResolved

Boolean beforeInstantiationResolved
Package-visible field that indicates a before-instantiation post-processor having kicked in

postProcessed

boolean postProcessed
Package-visible field that indicates MergedBeanDefinitionPostProcessor having been applied

postProcessingLock

Object postProcessingLock
Package org.springframework.beans.factory.xml

Class org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException extends BeanDefinitionStoreException implements Serializable

Class org.springframework.beans.factory.xml.XmlBeanFactory extends DefaultListableBeanFactory implements Serializable

Serialized Fields

reader

XmlBeanDefinitionReader reader
Package org.springframework.beans.support

Class org.springframework.beans.support.MutableSortDefinition extends Object implements Serializable

Serialized Fields

property

String property

ignoreCase

boolean ignoreCase

ascending

boolean ascending

toggleAscendingOnProperty

boolean toggleAscendingOnProperty

Class org.springframework.beans.support.PagedListHolder extends Object implements Serializable

Serialized Fields

source

List<E> source

refreshDate

Date refreshDate

sort

SortDefinition sort

sortUsed

SortDefinition sortUsed

pageSize

int pageSize

page

int page

newPageSet

boolean newPageSet

maxLinkedPages

int maxLinkedPages
Package org.springframework.context

Class org.springframework.context.ApplicationContextException extends FatalBeanException implements Serializable

Class org.springframework.context.ApplicationEvent extends EventObject implements Serializable

serialVersionUID: 7099057708183571937L

Serialized Fields

timestamp

long timestamp
System time when the event happened

Class org.springframework.context.NoSuchMessageException extends RuntimeException implements Serializable

Package org.springframework.context.annotation

Class org.springframework.context.annotation.CommonAnnotationBeanPostProcessor extends InitDestroyAnnotationBeanPostProcessor implements Serializable

Serialized Fields

ignoredResourceTypes

Set<E> ignoredResourceTypes

fallbackToDefaultTypeMatch

boolean fallbackToDefaultTypeMatch

alwaysUseJndiLookup

boolean alwaysUseJndiLookup

Class org.springframework.context.annotation.ScannedGenericBeanDefinition extends GenericBeanDefinition implements Serializable

Serialized Fields

metadata

AnnotationMetadata metadata
Package org.springframework.context.event

Class org.springframework.context.event.ApplicationContextEvent extends ApplicationEvent implements Serializable

Class org.springframework.context.event.ContextClosedEvent extends ApplicationContextEvent implements Serializable

Class org.springframework.context.event.ContextRefreshedEvent extends ApplicationContextEvent implements Serializable

Class org.springframework.context.event.ContextStartedEvent extends ApplicationContextEvent implements Serializable

Class org.springframework.context.event.ContextStoppedEvent extends ApplicationContextEvent implements Serializable

Package org.springframework.context.support

Class org.springframework.context.support.DefaultMessageSourceResolvable extends Object implements Serializable

Serialized Fields

codes

String[] codes

arguments

Object[] arguments

defaultMessage

String defaultMessage
Package org.springframework.core

Class org.springframework.core.AttributeAccessorSupport extends Object implements Serializable

Serialized Fields

attributes

Map<K,V> attributes
Map with String keys and Object values

Class org.springframework.core.ConstantException extends IllegalArgumentException implements Serializable

Class org.springframework.core.NestedCheckedException extends Exception implements Serializable

serialVersionUID: 7100714597678207546L

Class org.springframework.core.NestedIOException extends IOException implements Serializable

Class org.springframework.core.NestedRuntimeException extends RuntimeException implements Serializable

serialVersionUID: 5439915454935047936L

Package org.springframework.core.convert

Class org.springframework.core.convert.ConversionException extends NestedRuntimeException implements Serializable

Class org.springframework.core.convert.ConversionFailedException extends ConversionException implements Serializable

Serialized Fields

sourceType

TypeDescriptor sourceType

targetType

TypeDescriptor targetType

value

Object value

Class org.springframework.core.convert.ConverterNotFoundException extends ConversionException implements Serializable

Serialized Fields

sourceType

TypeDescriptor sourceType

targetType

TypeDescriptor targetType
Package org.springframework.core.enums

Class org.springframework.core.enums.AbstractGenericLabeledEnum extends AbstractLabeledEnum implements Serializable

Serialized Fields

label

String label
Deprecated.
A descriptive label for the enum.

Class org.springframework.core.enums.AbstractLabeledEnum extends Object implements Serializable

Class org.springframework.core.enums.LetterCodedLabeledEnum extends AbstractGenericLabeledEnum implements Serializable

Serialized Fields

code

Character code
Deprecated.
The unique code of this enum.

Class org.springframework.core.enums.ShortCodedLabeledEnum extends AbstractGenericLabeledEnum implements Serializable

Serialized Fields

code

Short code
Deprecated.
The unique code of this enum.

Class org.springframework.core.enums.StaticLabeledEnum extends AbstractLabeledEnum implements Serializable

Serialization Methods

readResolve

protected Object readResolve()
Deprecated.
Return the resolved type safe static enum instance.

Serialized Fields

code

Short code
Deprecated.
The unique code of the enum.

Class org.springframework.core.enums.StringCodedLabeledEnum extends AbstractGenericLabeledEnum implements Serializable

Serialized Fields

code

String code
Deprecated.
The unique code of this enum.

Package org.springframework.core.task

Class org.springframework.core.task.SimpleAsyncTaskExecutor extends CustomizableThreadCreator implements Serializable

Serialized Fields

concurrencyThrottle

org.springframework.core.task.SimpleAsyncTaskExecutor.ConcurrencyThrottleAdapter concurrencyThrottle
Internal concurrency throttle used by this executor

threadFactory

ThreadFactory threadFactory

Class org.springframework.core.task.SyncTaskExecutor extends Object implements Serializable

Class org.springframework.core.task.TaskRejectedException extends RejectedExecutionException implements Serializable

Class org.springframework.core.task.TaskTimeoutException extends TaskRejectedException implements Serializable

Package org.springframework.dao

Class org.springframework.dao.CannotAcquireLockException extends PessimisticLockingFailureException implements Serializable

Class org.springframework.dao.CannotSerializeTransactionException extends PessimisticLockingFailureException implements Serializable

Class org.springframework.dao.CleanupFailureDataAccessException extends NonTransientDataAccessException implements Serializable

Class org.springframework.dao.ConcurrencyFailureException extends TransientDataAccessException implements Serializable

Class org.springframework.dao.DataAccessException extends NestedRuntimeException implements Serializable

Class org.springframework.dao.DataAccessResourceFailureException extends NonTransientDataAccessResourceException implements Serializable

Class org.springframework.dao.DataIntegrityViolationException extends NonTransientDataAccessException implements Serializable

Class org.springframework.dao.DataRetrievalFailureException extends NonTransientDataAccessException implements Serializable

Class org.springframework.dao.DeadlockLoserDataAccessException extends PessimisticLockingFailureException implements Serializable

Class org.springframework.dao.DuplicateKeyException extends DataIntegrityViolationException implements Serializable

Class org.springframework.dao.EmptyResultDataAccessException extends IncorrectResultSizeDataAccessException implements Serializable

Class org.springframework.dao.IncorrectResultSizeDataAccessException extends DataRetrievalFailureException implements Serializable

Serialized Fields

expectedSize

int expectedSize

actualSize

int actualSize

Class org.springframework.dao.IncorrectUpdateSemanticsDataAccessException extends InvalidDataAccessResourceUsageException implements Serializable

Class org.springframework.dao.InvalidDataAccessApiUsageException extends NonTransientDataAccessException implements Serializable

Class org.springframework.dao.InvalidDataAccessResourceUsageException extends NonTransientDataAccessException implements Serializable

Class org.springframework.dao.NonTransientDataAccessException extends DataAccessException implements Serializable

Class org.springframework.dao.NonTransientDataAccessResourceException extends NonTransientDataAccessException implements Serializable

Class org.springframework.dao.OptimisticLockingFailureException extends ConcurrencyFailureException implements Serializable

Class org.springframework.dao.PermissionDeniedDataAccessException extends NonTransientDataAccessException implements Serializable

Class org.springframework.dao.PessimisticLockingFailureException extends ConcurrencyFailureException implements Serializable

Class org.springframework.dao.RecoverableDataAccessException extends DataAccessException implements Serializable

Class org.springframework.dao.TransientDataAccessException extends DataAccessException implements Serializable

Class org.springframework.dao.TransientDataAccessResourceException extends TransientDataAccessException implements Serializable

Class org.springframework.dao.TypeMismatchDataAccessException extends InvalidDataAccessResourceUsageException implements Serializable

Class org.springframework.dao.UncategorizedDataAccessException extends NonTransientDataAccessException implements Serializable

Package org.springframework.dao.annotation

Class org.springframework.dao.annotation.PersistenceExceptionTranslationAdvisor extends AbstractPointcutAdvisor implements Serializable

Serialized Fields

advice

PersistenceExceptionTranslationInterceptor advice

pointcut

AnnotationMatchingPointcut pointcut

Class org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor extends ProxyConfig implements Serializable

Serialized Fields

repositoryAnnotationType

Class<T> repositoryAnnotationType

beanClassLoader

ClassLoader beanClassLoader

persistenceExceptionTranslationAdvisor

PersistenceExceptionTranslationAdvisor persistenceExceptionTranslationAdvisor
Package org.springframework.ejb.access

Class org.springframework.ejb.access.EjbAccessException extends NestedRuntimeException implements Serializable

Package org.springframework.ejb.support

Class org.springframework.ejb.support.AbstractEnterpriseBean extends Object implements Serializable

Serialized Fields

beanFactoryLocator

BeanFactoryLocator beanFactoryLocator
Helper strategy that knows how to locate a Spring BeanFactory (or ApplicationContext).

beanFactoryLocatorKey

String beanFactoryLocatorKey
factoryKey to be used with BeanFactoryLocator

beanFactoryReference

BeanFactoryReference beanFactoryReference
Spring BeanFactory that provides the namespace for this EJB

Class org.springframework.ejb.support.AbstractJmsMessageDrivenBean extends AbstractMessageDrivenBean implements Serializable

Class org.springframework.ejb.support.AbstractMessageDrivenBean extends AbstractEnterpriseBean implements Serializable

Serialized Fields

logger

Log logger
Logger available to subclasses

messageDrivenContext

MessageDrivenContext messageDrivenContext

Class org.springframework.ejb.support.AbstractSessionBean extends AbstractEnterpriseBean implements Serializable

Serialized Fields

sessionContext

SessionContext sessionContext
The SessionContext passed to this EJB

Class org.springframework.ejb.support.AbstractStatefulSessionBean extends AbstractSessionBean implements Serializable

Class org.springframework.ejb.support.AbstractStatelessSessionBean extends AbstractSessionBean implements Serializable

Serialized Fields

logger

Log logger
Logger available to subclasses

Package org.springframework.expression

Class org.springframework.expression.AccessException extends Exception implements Serializable

Class org.springframework.expression.EvaluationException extends ExpressionException implements Serializable

Class org.springframework.expression.ExpressionException extends RuntimeException implements Serializable

Serialized Fields

expressionString

String expressionString

position

int position

Class org.springframework.expression.ParseException extends ExpressionException implements Serializable

Package org.springframework.expression.spel

Class org.springframework.expression.spel.InternalParseException extends RuntimeException implements Serializable

Class org.springframework.expression.spel.SpelEvaluationException extends EvaluationException implements Serializable

Serialized Fields

message

SpelMessage message

inserts

Object[] inserts

Class org.springframework.expression.spel.SpelParseException extends ParseException implements Serializable

Serialized Fields

message

SpelMessage message

inserts

Object[] inserts
Package org.springframework.http.converter

Class org.springframework.http.converter.HttpMessageConversionException extends NestedRuntimeException implements Serializable

Class org.springframework.http.converter.HttpMessageNotReadableException extends HttpMessageConversionException implements Serializable

Class org.springframework.http.converter.HttpMessageNotWritableException extends HttpMessageConversionException implements Serializable

Package org.springframework.jca.cci

Class org.springframework.jca.cci.CannotCreateRecordException extends DataAccessResourceFailureException implements Serializable

Class org.springframework.jca.cci.CannotGetCciConnectionException extends DataAccessResourceFailureException implements Serializable

Class org.springframework.jca.cci.CciOperationNotSupportedException extends InvalidDataAccessResourceUsageException implements Serializable

Class org.springframework.jca.cci.InvalidResultSetAccessException extends InvalidDataAccessResourceUsageException implements Serializable

Class org.springframework.jca.cci.RecordTypeNotSupportedException extends InvalidDataAccessResourceUsageException implements Serializable

Package org.springframework.jca.cci.connection

Class org.springframework.jca.cci.connection.CciLocalTransactionManager extends AbstractPlatformTransactionManager implements Serializable

Serialized Fields

connectionFactory

ConnectionFactory connectionFactory

Class org.springframework.jca.cci.connection.ConnectionSpecConnectionFactoryAdapter extends DelegatingConnectionFactory implements Serializable

Serialized Fields

connectionSpec

ConnectionSpec connectionSpec

threadBoundSpec

ThreadLocal<T> threadBoundSpec

Class org.springframework.jca.cci.connection.DelegatingConnectionFactory extends Object implements Serializable

Serialized Fields

targetConnectionFactory

ConnectionFactory targetConnectionFactory

Class org.springframework.jca.cci.connection.SingleConnectionFactory extends DelegatingConnectionFactory implements Serializable

Serialized Fields

logger

Log logger

target

Connection target
Wrapped Connection

connection

Connection connection
Proxy Connection

connectionMonitor

Object connectionMonitor
Synchronization monitor for the shared Connection

Class org.springframework.jca.cci.connection.TransactionAwareConnectionFactoryProxy extends DelegatingConnectionFactory implements Serializable

Package org.springframework.jca.cci.core.support

Class org.springframework.jca.cci.core.support.CommAreaRecord extends Object implements Serializable

Serialized Fields

bytes

byte[] bytes

recordName

String recordName

recordShortDescription

String recordShortDescription
Package org.springframework.jca.endpoint

Class org.springframework.jca.endpoint.GenericMessageEndpointFactory.InternalResourceException extends RuntimeException implements Serializable

Package org.springframework.jdbc

Class org.springframework.jdbc.BadSqlGrammarException extends InvalidDataAccessResourceUsageException implements Serializable

Serialized Fields

sql

String sql

Class org.springframework.jdbc.CannotGetJdbcConnectionException extends DataAccessResourceFailureException implements Serializable

Class org.springframework.jdbc.IncorrectResultSetColumnCountException extends DataRetrievalFailureException implements Serializable

Serialized Fields

expectedCount

int expectedCount

actualCount

int actualCount

Class org.springframework.jdbc.InvalidResultSetAccessException extends InvalidDataAccessResourceUsageException implements Serializable

Serialized Fields

sql

String sql

Class org.springframework.jdbc.JdbcUpdateAffectedIncorrectNumberOfRowsException extends IncorrectUpdateSemanticsDataAccessException implements Serializable

Serialized Fields

expected

int expected
Number of rows that should have been affected

actual

int actual
Number of rows that actually were affected

Class org.springframework.jdbc.LobRetrievalFailureException extends DataRetrievalFailureException implements Serializable

Class org.springframework.jdbc.SQLWarningException extends UncategorizedDataAccessException implements Serializable

Class org.springframework.jdbc.UncategorizedSQLException extends UncategorizedDataAccessException implements Serializable

Serialized Fields

sql

String sql
SQL that led to the problem

Package org.springframework.jdbc.datasource

Class org.springframework.jdbc.datasource.DataSourceTransactionManager extends AbstractPlatformTransactionManager implements Serializable

Serialized Fields

dataSource

DataSource dataSource
Package org.springframework.jdbc.datasource.init

Class org.springframework.jdbc.datasource.init.CannotReadScriptException extends RuntimeException implements Serializable

Package org.springframework.jdbc.datasource.lookup

Class org.springframework.jdbc.datasource.lookup.DataSourceLookupFailureException extends NonTransientDataAccessException implements Serializable

Package org.springframework.jdbc.support

Class org.springframework.jdbc.support.MetaDataAccessException extends NestedCheckedException implements Serializable

Package org.springframework.jdbc.support.rowset

Class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet extends Object implements Serializable

serialVersionUID: -4688694393146734764L

Serialized Fields

resultSet

ResultSet resultSet

rowSetMetaData

SqlRowSetMetaData rowSetMetaData
Package org.springframework.jdbc.support.xml

Class org.springframework.jdbc.support.xml.SqlXmlFeatureNotImplementedException extends InvalidDataAccessApiUsageException implements Serializable

Package org.springframework.jms

Class org.springframework.jms.IllegalStateException extends JmsException implements Serializable

Class org.springframework.jms.InvalidClientIDException extends JmsException implements Serializable

Class org.springframework.jms.InvalidDestinationException extends JmsException implements Serializable

Class org.springframework.jms.InvalidSelectorException extends JmsException implements Serializable

Class org.springframework.jms.JmsException extends NestedRuntimeException implements Serializable

Class org.springframework.jms.JmsSecurityException extends JmsException implements Serializable

Class org.springframework.jms.MessageEOFException extends JmsException implements Serializable

Class org.springframework.jms.MessageFormatException extends JmsException implements Serializable

Class org.springframework.jms.MessageNotReadableException extends JmsException implements Serializable

Class org.springframework.jms.MessageNotWriteableException extends JmsException implements Serializable

Class org.springframework.jms.ResourceAllocationException extends JmsException implements Serializable

Class org.springframework.jms.TransactionInProgressException extends JmsException implements Serializable

Class org.springframework.jms.TransactionRolledBackException extends JmsException implements Serializable

Class org.springframework.jms.UncategorizedJmsException extends JmsException implements Serializable

Package org.springframework.jms.connection

Class org.springframework.jms.connection.JmsTransactionManager extends AbstractPlatformTransactionManager implements Serializable

Serialized Fields

connectionFactory

ConnectionFactory connectionFactory

Class org.springframework.jms.connection.JmsTransactionManager102 extends JmsTransactionManager implements Serializable

Serialized Fields

pubSubDomain

boolean pubSubDomain
Deprecated.

Class org.springframework.jms.connection.SynchedLocalTransactionFailedException extends JmsException implements Serializable

Package org.springframework.jms.listener

Class org.springframework.jms.listener.AbstractJmsListeningContainer.SharedConnectionNotInitializedException extends RuntimeException implements Serializable

Package org.springframework.jms.listener.adapter

Class org.springframework.jms.listener.adapter.ListenerExecutionFailedException extends JmsException implements Serializable

Package org.springframework.jms.listener.endpoint

Class org.springframework.jms.listener.endpoint.JmsMessageEndpointFactory.JmsResourceException extends RuntimeException implements Serializable

Package org.springframework.jms.support.converter

Class org.springframework.jms.support.converter.MessageConversionException extends JmsException implements Serializable

Package org.springframework.jms.support.destination

Class org.springframework.jms.support.destination.DestinationResolutionException extends JmsException implements Serializable

Package org.springframework.jmx

Class org.springframework.jmx.JmxException extends NestedRuntimeException implements Serializable

Class org.springframework.jmx.MBeanServerNotFoundException extends JmxException implements Serializable

Package org.springframework.jmx.access

Class org.springframework.jmx.access.InvalidInvocationException extends JMRuntimeException implements Serializable

Class org.springframework.jmx.access.InvocationFailureException extends JmxException implements Serializable

Class org.springframework.jmx.access.MBeanConnectFailureException extends JmxException implements Serializable

Class org.springframework.jmx.access.MBeanInfoRetrievalException extends JmxException implements Serializable

Package org.springframework.jmx.export

Class org.springframework.jmx.export.MBeanExportException extends JmxException implements Serializable

Class org.springframework.jmx.export.UnableToRegisterMBeanException extends MBeanExportException implements Serializable

Package org.springframework.jmx.export.metadata

Class org.springframework.jmx.export.metadata.InvalidMetadataException extends JmxException implements Serializable

Package org.springframework.jmx.export.notification

Class org.springframework.jmx.export.notification.UnableToSendNotificationException extends JmxException implements Serializable

Package org.springframework.jndi

Class org.springframework.jndi.JndiLookupFailureException extends NestedRuntimeException implements Serializable

Class org.springframework.jndi.TypeMismatchNamingException extends NamingException implements Serializable

Serialized Fields

requiredType

Class<T> requiredType

actualType

Class<T> actualType
Package org.springframework.mail

Class org.springframework.mail.MailAuthenticationException extends MailException implements Serializable

Class org.springframework.mail.MailException extends NestedRuntimeException implements Serializable

Class org.springframework.mail.MailParseException extends MailException implements Serializable

Class org.springframework.mail.MailPreparationException extends MailException implements Serializable

Class org.springframework.mail.MailSendException extends MailException implements Serializable

Serialized Fields

messageExceptions

Exception[] messageExceptions

Class org.springframework.mail.SimpleMailMessage extends Object implements Serializable

Serialized Fields

from

String from

replyTo

String replyTo

to

String[] to

cc

String[] cc

bcc

String[] bcc

sentDate

Date sentDate

subject

String subject

text

String text
Package org.springframework.orm

Class org.springframework.orm.ObjectOptimisticLockingFailureException extends OptimisticLockingFailureException implements Serializable

Serialized Fields

persistentClass

Object persistentClass

identifier

Object identifier

Class org.springframework.orm.ObjectRetrievalFailureException extends DataRetrievalFailureException implements Serializable

Serialized Fields

persistentClass

Object persistentClass

identifier

Object identifier
Package org.springframework.orm.hibernate3

Class org.springframework.orm.hibernate3.HibernateJdbcException extends UncategorizedDataAccessException implements Serializable

Class org.springframework.orm.hibernate3.HibernateObjectRetrievalFailureException extends ObjectRetrievalFailureException implements Serializable

Class org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException extends ObjectOptimisticLockingFailureException implements Serializable

Class org.springframework.orm.hibernate3.HibernateQueryException extends InvalidDataAccessResourceUsageException implements Serializable

Class org.springframework.orm.hibernate3.HibernateSystemException extends UncategorizedDataAccessException implements Serializable

Class org.springframework.orm.hibernate3.HibernateTransactionManager extends AbstractPlatformTransactionManager implements Serializable

Serialized Fields

sessionFactory

org.hibernate.SessionFactory sessionFactory

dataSource

DataSource dataSource

autodetectDataSource

boolean autodetectDataSource

prepareConnection

boolean prepareConnection

hibernateManagedSession

boolean hibernateManagedSession

earlyFlushBeforeCommit

boolean earlyFlushBeforeCommit

entityInterceptor

Object entityInterceptor

jdbcExceptionTranslator

SQLExceptionTranslator jdbcExceptionTranslator

defaultJdbcExceptionTranslator

SQLExceptionTranslator defaultJdbcExceptionTranslator

beanFactory

BeanFactory beanFactory
Just needed for entityInterceptorBeanName.

See Also:
HibernateTransactionManager.setEntityInterceptorBeanName(java.lang.String)

Class org.springframework.orm.hibernate3.SpringSessionContext extends Object implements Serializable

Serialized Fields

sessionFactory

org.hibernate.engine.SessionFactoryImplementor sessionFactory
Package org.springframework.orm.hibernate3.support

Class org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener extends org.hibernate.event.def.DefaultMergeEventListener implements Serializable

Class org.springframework.orm.hibernate3.support.ScopedBeanInterceptor extends org.hibernate.EmptyInterceptor implements Serializable

Package org.springframework.orm.jdo

Class org.springframework.orm.jdo.JdoObjectRetrievalFailureException extends ObjectRetrievalFailureException implements Serializable

Class org.springframework.orm.jdo.JdoOptimisticLockingFailureException extends ObjectOptimisticLockingFailureException implements Serializable

Class org.springframework.orm.jdo.JdoResourceFailureException extends DataAccessResourceFailureException implements Serializable

Class org.springframework.orm.jdo.JdoSystemException extends UncategorizedDataAccessException implements Serializable

Class org.springframework.orm.jdo.JdoTransactionManager extends AbstractPlatformTransactionManager implements Serializable

Serialized Fields

persistenceManagerFactory

javax.jdo.PersistenceManagerFactory persistenceManagerFactory

dataSource

DataSource dataSource

autodetectDataSource

boolean autodetectDataSource

jdoDialect

JdoDialect jdoDialect

Class org.springframework.orm.jdo.JdoUsageException extends InvalidDataAccessApiUsageException implements Serializable

Package org.springframework.orm.jpa

Class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean extends Object implements Serializable

Serialization Methods

writeReplace

protected Object writeReplace()
                       throws ObjectStreamException
Throws:
ObjectStreamException
Serialized Fields

logger

Log logger
Logger available to subclasses

persistenceProvider

javax.persistence.spi.PersistenceProvider persistenceProvider

persistenceUnitName

String persistenceUnitName

jpaPropertyMap

Map<K,V> jpaPropertyMap

entityManagerFactoryInterface

Class<T> entityManagerFactoryInterface

entityManagerInterface

Class<T> entityManagerInterface

jpaDialect

JpaDialect jpaDialect

jpaVendorAdapter

JpaVendorAdapter jpaVendorAdapter

beanClassLoader

ClassLoader beanClassLoader

beanFactory

BeanFactory beanFactory

beanName

String beanName

nativeEntityManagerFactory

javax.persistence.EntityManagerFactory nativeEntityManagerFactory
Raw EntityManagerFactory as returned by the PersistenceProvider

plusOperations

EntityManagerFactoryPlusOperations plusOperations

entityManagerFactory

javax.persistence.EntityManagerFactory entityManagerFactory

Class org.springframework.orm.jpa.DefaultJpaDialect extends Object implements Serializable

Class org.springframework.orm.jpa.JpaObjectRetrievalFailureException extends ObjectRetrievalFailureException implements Serializable

Class org.springframework.orm.jpa.JpaOptimisticLockingFailureException extends ObjectOptimisticLockingFailureException implements Serializable

Class org.springframework.orm.jpa.JpaSystemException extends UncategorizedDataAccessException implements Serializable

Class org.springframework.orm.jpa.JpaTransactionManager extends AbstractPlatformTransactionManager implements Serializable

Serialized Fields

entityManagerFactory

javax.persistence.EntityManagerFactory entityManagerFactory

jpaPropertyMap

Map<K,V> jpaPropertyMap

dataSource

DataSource dataSource

jpaDialect

JpaDialect jpaDialect

Class org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean extends AbstractEntityManagerFactoryBean implements Serializable

Serialized Fields

persistenceUnitManager

PersistenceUnitManager persistenceUnitManager

internalPersistenceUnitManager

DefaultPersistenceUnitManager internalPersistenceUnitManager

persistenceUnitInfo

javax.persistence.spi.PersistenceUnitInfo persistenceUnitInfo

Class org.springframework.orm.jpa.LocalEntityManagerFactoryBean extends AbstractEntityManagerFactoryBean implements Serializable

Package org.springframework.orm.jpa.support

Class org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor extends Object implements Serializable

Serialized Fields

jndiEnvironment

Object jndiEnvironment

resourceRef

boolean resourceRef

order

int order

extendedEntityManagersToClose

Map<K,V> extendedEntityManagersToClose
Package org.springframework.orm.jpa.vendor

Class org.springframework.orm.jpa.vendor.EclipseLinkJpaDialect extends DefaultJpaDialect implements Serializable

Serialized Fields

lazyDatabaseTransaction

boolean lazyDatabaseTransaction

Class org.springframework.orm.jpa.vendor.HibernateJpaDialect extends DefaultJpaDialect implements Serializable

Class org.springframework.orm.jpa.vendor.OpenJpaDialect extends DefaultJpaDialect implements Serializable

Class org.springframework.orm.jpa.vendor.TopLinkJpaDialect extends DefaultJpaDialect implements Serializable

Serialized Fields

lazyDatabaseTransaction

boolean lazyDatabaseTransaction
Package org.springframework.oxm

Class org.springframework.oxm.MarshallingException extends XmlMappingException implements Serializable

Class org.springframework.oxm.MarshallingFailureException extends MarshallingException implements Serializable

Class org.springframework.oxm.UncategorizedMappingException extends XmlMappingException implements Serializable

Class org.springframework.oxm.UnmarshallingFailureException extends MarshallingException implements Serializable

Class org.springframework.oxm.ValidationFailureException extends XmlMappingException implements Serializable

Class org.springframework.oxm.XmlMappingException extends NestedRuntimeException implements Serializable

Package org.springframework.oxm.castor

Class org.springframework.oxm.castor.CastorMappingException extends XmlMappingException implements Serializable

Package org.springframework.remoting

Class org.springframework.remoting.RemoteAccessException extends NestedRuntimeException implements Serializable

serialVersionUID: -4906825139312227864L

Class org.springframework.remoting.RemoteConnectFailureException extends RemoteAccessException implements Serializable

Class org.springframework.remoting.RemoteInvocationFailureException extends RemoteAccessException implements Serializable

Class org.springframework.remoting.RemoteLookupFailureException extends RemoteAccessException implements Serializable

Class org.springframework.remoting.RemoteProxyFailureException extends RemoteAccessException implements Serializable

Package org.springframework.remoting.jaxrpc

Class org.springframework.remoting.jaxrpc.JaxRpcSoapFaultException extends SoapFaultException implements Serializable

Package org.springframework.remoting.jaxws

Class org.springframework.remoting.jaxws.JaxWsSoapFaultException extends SoapFaultException implements Serializable

Package org.springframework.remoting.soap

Class org.springframework.remoting.soap.SoapFaultException extends RemoteInvocationFailureException implements Serializable

Package org.springframework.remoting.support

Class org.springframework.remoting.support.RemoteInvocation extends Object implements Serializable

serialVersionUID: 6876024250231820554L

Serialized Fields

methodName

String methodName

parameterTypes

Class<T>[] parameterTypes

arguments

Object[] arguments

attributes

Map<K,V> attributes

Class org.springframework.remoting.support.RemoteInvocationResult extends Object implements Serializable

serialVersionUID: 2138555143707773549L

Serialized Fields

value

Object value

exception

Throwable exception
Package org.springframework.scheduling

Class org.springframework.scheduling.SchedulingException extends NestedRuntimeException implements Serializable

Package org.springframework.scheduling.annotation

Class org.springframework.scheduling.annotation.AsyncAnnotationAdvisor extends AbstractPointcutAdvisor implements Serializable

Serialized Fields

advice

Advice advice

pointcut

Pointcut pointcut

Class org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcessor extends ProxyConfig implements Serializable

Serialized Fields

asyncAnnotationType

Class<T> asyncAnnotationType

executor

Executor executor

beanClassLoader

ClassLoader beanClassLoader

asyncAnnotationAdvisor

AsyncAnnotationAdvisor asyncAnnotationAdvisor
Package org.springframework.scheduling.backportconcurrent

Class org.springframework.scheduling.backportconcurrent.CustomizableThreadFactory extends CustomizableThreadCreator implements Serializable

Class org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor extends CustomizableThreadFactory implements Serializable

Serialized Fields

logger

Log logger

poolSizeMonitor

Object poolSizeMonitor

corePoolSize

int corePoolSize

maxPoolSize

int maxPoolSize

keepAliveSeconds

int keepAliveSeconds

allowCoreThreadTimeOut

boolean allowCoreThreadTimeOut

queueCapacity

int queueCapacity

threadFactory

edu.emory.mathcs.backport.java.util.concurrent.ThreadFactory threadFactory

rejectedExecutionHandler

edu.emory.mathcs.backport.java.util.concurrent.RejectedExecutionHandler rejectedExecutionHandler

waitForTasksToCompleteOnShutdown

boolean waitForTasksToCompleteOnShutdown

threadNamePrefixSet

boolean threadNamePrefixSet

beanName

String beanName

threadPoolExecutor

edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor threadPoolExecutor
Package org.springframework.scheduling.concurrent

Class org.springframework.scheduling.concurrent.CustomizableThreadFactory extends CustomizableThreadCreator implements Serializable

Class org.springframework.scheduling.concurrent.ExecutorConfigurationSupport extends CustomizableThreadFactory implements Serializable

Serialized Fields

logger

Log logger

threadFactory

ThreadFactory threadFactory

threadNamePrefixSet

boolean threadNamePrefixSet

rejectedExecutionHandler

RejectedExecutionHandler rejectedExecutionHandler

waitForTasksToCompleteOnShutdown

boolean waitForTasksToCompleteOnShutdown

beanName

String beanName

executor

ExecutorService executor

Class org.springframework.scheduling.concurrent.ScheduledExecutorFactoryBean extends ExecutorConfigurationSupport implements Serializable

Serialized Fields

poolSize

int poolSize

scheduledExecutorTasks

ScheduledExecutorTask[] scheduledExecutorTasks

continueScheduledExecutionAfterException

boolean continueScheduledExecutionAfterException

exposeUnconfigurableExecutor

boolean exposeUnconfigurableExecutor

exposedExecutor

ScheduledExecutorService exposedExecutor

Class org.springframework.scheduling.concurrent.ThreadPoolExecutorFactoryBean extends ExecutorConfigurationSupport implements Serializable

Serialized Fields

corePoolSize

int corePoolSize

maxPoolSize

int maxPoolSize

keepAliveSeconds

int keepAliveSeconds

allowCoreThreadTimeOut

boolean allowCoreThreadTimeOut

queueCapacity

int queueCapacity

exposeUnconfigurableExecutor

boolean exposeUnconfigurableExecutor

exposedExecutor

ExecutorService exposedExecutor

Class org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor extends ExecutorConfigurationSupport implements Serializable

Serialized Fields

poolSizeMonitor

Object poolSizeMonitor

corePoolSize

int corePoolSize

maxPoolSize

int maxPoolSize

keepAliveSeconds

int keepAliveSeconds

allowCoreThreadTimeOut

boolean allowCoreThreadTimeOut

queueCapacity

int queueCapacity

threadPoolExecutor

ThreadPoolExecutor threadPoolExecutor

Class org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler extends ExecutorConfigurationSupport implements Serializable

Serialized Fields

poolSize

int poolSize

scheduledExecutor

ScheduledExecutorService scheduledExecutor

errorHandler

ErrorHandler errorHandler
Package org.springframework.scheduling.quartz

Class org.springframework.scheduling.quartz.CronTriggerBean extends org.quartz.CronTrigger implements Serializable

Serialized Fields

jobDetail

org.quartz.JobDetail jobDetail

beanName

String beanName

startDelay

long startDelay

Class org.springframework.scheduling.quartz.JobDetailBean extends org.quartz.JobDetail implements Serializable

Serialized Fields

actualJobClass

Class<T> actualJobClass

beanName

String beanName

applicationContext

ApplicationContext applicationContext

applicationContextJobDataKey

String applicationContextJobDataKey

Class org.springframework.scheduling.quartz.JobMethodInvocationFailedException extends NestedRuntimeException implements Serializable

Class org.springframework.scheduling.quartz.SimpleTriggerBean extends org.quartz.SimpleTrigger implements Serializable

Serialized Fields

startDelay

long startDelay

jobDetail

org.quartz.JobDetail jobDetail

beanName

String beanName
Package org.springframework.scripting

Class org.springframework.scripting.ScriptCompilationException extends NestedRuntimeException implements Serializable

Serialized Fields

scriptSource

ScriptSource scriptSource
Package org.springframework.scripting.bsh

Class org.springframework.scripting.bsh.BshScriptUtils.BshExecutionException extends NestedRuntimeException implements Serializable

Package org.springframework.scripting.jruby

Class org.springframework.scripting.jruby.JRubyScriptUtils.JRubyExecutionException extends NestedRuntimeException implements Serializable

Package org.springframework.test.context

Class org.springframework.test.context.TestContext extends AttributeAccessorSupport implements Serializable

serialVersionUID: -5827157174866681233L

Serialized Fields

contextCache

org.springframework.test.context.ContextCache contextCache

contextLoader

ContextLoader contextLoader

locations

String[] locations

testClass

Class<T> testClass

testInstance

Object testInstance

testMethod

Method testMethod

testException

Throwable testException
Package org.springframework.transaction

Class org.springframework.transaction.CannotCreateTransactionException extends TransactionException implements Serializable

Class org.springframework.transaction.HeuristicCompletionException extends TransactionException implements Serializable

Serialized Fields

outcomeState

int outcomeState
The outcome state of the transaction: have some or all resources been committed?

Class org.springframework.transaction.IllegalTransactionStateException extends TransactionUsageException implements Serializable

Class org.springframework.transaction.InvalidIsolationLevelException extends TransactionUsageException implements Serializable

Class org.springframework.transaction.InvalidTimeoutException extends TransactionUsageException implements Serializable

Serialized Fields

timeout

int timeout

Class org.springframework.transaction.NestedTransactionNotSupportedException extends CannotCreateTransactionException implements Serializable

Class org.springframework.transaction.NoTransactionException extends TransactionUsageException implements Serializable

Class org.springframework.transaction.TransactionException extends NestedRuntimeException implements Serializable

Class org.springframework.transaction.TransactionSuspensionNotSupportedException extends CannotCreateTransactionException implements Serializable

Class org.springframework.transaction.TransactionSystemException extends TransactionException implements Serializable

Serialized Fields

applicationException

Throwable applicationException

Class org.springframework.transaction.TransactionTimedOutException extends TransactionException implements Serializable

Class org.springframework.transaction.TransactionUsageException extends TransactionException implements Serializable

Class org.springframework.transaction.UnexpectedRollbackException extends TransactionException implements Serializable

Package org.springframework.transaction.annotation

Class org.springframework.transaction.annotation.AnnotationTransactionAttributeSource extends AbstractFallbackTransactionAttributeSource implements Serializable

Serialized Fields

publicMethodsOnly

boolean publicMethodsOnly

annotationParsers

Set<E> annotationParsers

Class org.springframework.transaction.annotation.Ejb3TransactionAnnotationParser extends Object implements Serializable

Class org.springframework.transaction.annotation.SpringTransactionAnnotationParser extends Object implements Serializable

Package org.springframework.transaction.interceptor

Class org.springframework.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor extends AbstractBeanFactoryPointcutAdvisor implements Serializable

Serialized Fields

transactionAttributeSource

TransactionAttributeSource transactionAttributeSource

pointcut

org.springframework.transaction.interceptor.TransactionAttributeSourcePointcut pointcut

Class org.springframework.transaction.interceptor.CompositeTransactionAttributeSource extends Object implements Serializable

Serialized Fields

transactionAttributeSources

TransactionAttributeSource[] transactionAttributeSources

Class org.springframework.transaction.interceptor.DefaultTransactionAttribute extends DefaultTransactionDefinition implements Serializable

Serialized Fields

qualifier

String qualifier

Class org.springframework.transaction.interceptor.DelegatingTransactionAttribute extends DelegatingTransactionDefinition implements Serializable

Serialized Fields

targetAttribute

TransactionAttribute targetAttribute

Class org.springframework.transaction.interceptor.MatchAlwaysTransactionAttributeSource extends Object implements Serializable

Serialized Fields

transactionAttribute

TransactionAttribute transactionAttribute

Class org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource extends Object implements Serializable

Serialized Fields

nameMap

Map<K,V> nameMap
Keys are method names; values are TransactionAttributes

Class org.springframework.transaction.interceptor.NoRollbackRuleAttribute extends RollbackRuleAttribute implements Serializable

Class org.springframework.transaction.interceptor.RollbackRuleAttribute extends Object implements Serializable

Serialized Fields

exceptionName

String exceptionName
Could hold exception, resolving class name but would always require FQN. This way does multiple string comparisons, but how often do we decide whether to roll back a transaction following an exception?

Class org.springframework.transaction.interceptor.RuleBasedTransactionAttribute extends DefaultTransactionAttribute implements Serializable

Serialized Fields

rollbackRules

List<E> rollbackRules

Class org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor extends AbstractPointcutAdvisor implements Serializable

Serialized Fields

transactionInterceptor

TransactionInterceptor transactionInterceptor

pointcut

org.springframework.transaction.interceptor.TransactionAttributeSourcePointcut pointcut

Class org.springframework.transaction.interceptor.TransactionInterceptor extends TransactionAspectSupport implements Serializable

Serialization Methods

readObject

private void readObject(ObjectInputStream ois)
                 throws IOException,
                        ClassNotFoundException
Throws:
IOException
ClassNotFoundException

writeObject

private void writeObject(ObjectOutputStream oos)
                  throws IOException
Throws:
IOException

Class org.springframework.transaction.interceptor.TransactionProxyFactoryBean extends AbstractSingletonProxyFactoryBean implements Serializable

Serialized Fields

transactionInterceptor

TransactionInterceptor transactionInterceptor

pointcut

Pointcut pointcut
Package org.springframework.transaction.jta

Class org.springframework.transaction.jta.JtaTransactionManager extends AbstractPlatformTransactionManager implements Serializable

Serialization Methods

readObject

private void readObject(ObjectInputStream ois)
                 throws IOException,
                        ClassNotFoundException
Throws:
IOException
ClassNotFoundException
Serialized Fields

userTransactionName

String userTransactionName

autodetectUserTransaction

boolean autodetectUserTransaction

cacheUserTransaction

boolean cacheUserTransaction

userTransactionObtainedFromJndi

boolean userTransactionObtainedFromJndi

transactionManagerName

String transactionManagerName

autodetectTransactionManager

boolean autodetectTransactionManager

transactionSynchronizationRegistryName

String transactionSynchronizationRegistryName

allowCustomIsolationLevels

boolean allowCustomIsolationLevels

Class org.springframework.transaction.jta.OC4JJtaTransactionManager extends JtaTransactionManager implements Serializable

Serialized Fields

beginWithNameMethod

Method beginWithNameMethod

setTransactionIsolationMethod

Method setTransactionIsolationMethod

Class org.springframework.transaction.jta.WebLogicJtaTransactionManager extends JtaTransactionManager implements Serializable

Serialized Fields

weblogicUserTransactionAvailable

boolean weblogicUserTransactionAvailable

beginWithNameMethod

Method beginWithNameMethod

beginWithNameAndTimeoutMethod

Method beginWithNameAndTimeoutMethod

weblogicTransactionManagerAvailable

boolean weblogicTransactionManagerAvailable

forceResumeMethod

Method forceResumeMethod

setPropertyMethod

Method setPropertyMethod

transactionHelper

Object transactionHelper

Class org.springframework.transaction.jta.WebSphereUowTransactionManager extends JtaTransactionManager implements Serializable

Serialized Fields

uowManager

com.ibm.wsspi.uow.UOWManager uowManager

uowManagerName

String uowManagerName
Package org.springframework.transaction.support

Class org.springframework.transaction.support.AbstractPlatformTransactionManager extends Object implements Serializable

Serialization Methods

readObject

private void readObject(ObjectInputStream ois)
                 throws IOException,
                        ClassNotFoundException
Throws:
IOException
ClassNotFoundException
Serialized Fields

transactionSynchronization

int transactionSynchronization

defaultTimeout

int defaultTimeout

nestedTransactionAllowed

boolean nestedTransactionAllowed

validateExistingTransaction

boolean validateExistingTransaction

globalRollbackOnParticipationFailure

boolean globalRollbackOnParticipationFailure

failEarlyOnGlobalRollbackOnly

boolean failEarlyOnGlobalRollbackOnly

rollbackOnCommitFailure

boolean rollbackOnCommitFailure

Class org.springframework.transaction.support.DefaultTransactionDefinition extends Object implements Serializable

Serialized Fields

propagationBehavior

int propagationBehavior

isolationLevel

int isolationLevel

timeout

int timeout

readOnly

boolean readOnly

name

String name

Class org.springframework.transaction.support.DelegatingTransactionDefinition extends Object implements Serializable

Serialized Fields

targetDefinition

TransactionDefinition targetDefinition

Class org.springframework.transaction.support.TransactionTemplate extends DefaultTransactionDefinition implements Serializable

Serialized Fields

logger

Log logger
Logger available to subclasses

transactionManager

PlatformTransactionManager transactionManager
Package org.springframework.ui

Class org.springframework.ui.ExtendedModelMap extends ModelMap implements Serializable

Class org.springframework.ui.ModelMap extends LinkedHashMap<String,Object> implements Serializable

Package org.springframework.util

Class org.springframework.util.AutoPopulatingList extends Object implements Serializable

Serialized Fields

backingList

List<E> backingList
The List that all operations are eventually delegated to.

elementFactory

AutoPopulatingList.ElementFactory<E> elementFactory
The AutoPopulatingList.ElementFactory to use to create new List elements on demand.

Class org.springframework.util.AutoPopulatingList.ElementInstantiationException extends RuntimeException implements Serializable

Class org.springframework.util.CachingMapDecorator extends Object implements Serializable

Serialized Fields

targetMap

Map<K,V> targetMap

synchronize

boolean synchronize

weak

boolean weak

Class org.springframework.util.ConcurrencyThrottleSupport extends Object implements Serializable

Serialization Methods

readObject

private void readObject(ObjectInputStream ois)
                 throws IOException,
                        ClassNotFoundException
Throws:
IOException
ClassNotFoundException
Serialized Fields

concurrencyLimit

int concurrencyLimit

concurrencyCount

int concurrencyCount

Class org.springframework.util.CustomizableThreadCreator extends Object implements Serializable

Serialized Fields

threadNamePrefix

String threadNamePrefix

threadPriority

int threadPriority

daemon

boolean daemon

threadGroup

ThreadGroup threadGroup

threadCount

int threadCount

threadCountMonitor

Object threadCountMonitor

Class org.springframework.util.LinkedCaseInsensitiveMap extends LinkedHashMap<String,V> implements Serializable

Serialized Fields

caseInsensitiveKeys

Map<K,V> caseInsensitiveKeys

locale

Locale locale

Class org.springframework.util.LinkedMultiValueMap extends Object implements Serializable

serialVersionUID: 3801124242820219131L

Serialized Fields

targetMap

Map<K,V> targetMap
Package org.springframework.util.comparator

Class org.springframework.util.comparator.BooleanComparator extends Object implements Serializable

Serialized Fields

trueLow

boolean trueLow

Class org.springframework.util.comparator.CompoundComparator extends Object implements Serializable

Serialized Fields

comparators

List<E> comparators

Class org.springframework.util.comparator.InvertibleComparator extends Object implements Serializable

Serialized Fields

comparator

Comparator<T> comparator

ascending

boolean ascending
Package org.springframework.validation

Class org.springframework.validation.AbstractBindingResult extends AbstractErrors implements Serializable

Serialized Fields

objectName

String objectName

messageCodesResolver

MessageCodesResolver messageCodesResolver

errors

List<E> errors

suppressedFields

Set<E> suppressedFields

Class org.springframework.validation.AbstractErrors extends Object implements Serializable

Serialized Fields

nestedPath

String nestedPath

nestedPathStack

Stack<E> nestedPathStack

Class org.springframework.validation.AbstractPropertyBindingResult extends AbstractBindingResult implements Serializable

Serialized Fields

conversionService

ConversionService conversionService

Class org.springframework.validation.BeanPropertyBindingResult extends AbstractPropertyBindingResult implements Serializable

Serialized Fields

target

Object target

autoGrowNestedPaths

boolean autoGrowNestedPaths

Class org.springframework.validation.BindException extends Exception implements Serializable

Serialized Fields

bindingResult

BindingResult bindingResult

Class org.springframework.validation.DefaultMessageCodesResolver extends Object implements Serializable

Serialized Fields

prefix

String prefix

Class org.springframework.validation.DirectFieldBindingResult extends AbstractPropertyBindingResult implements Serializable

Serialized Fields

target

Object target

Class org.springframework.validation.FieldError extends ObjectError implements Serializable

Serialized Fields

field

String field

rejectedValue

Object rejectedValue

bindingFailure

boolean bindingFailure

Class org.springframework.validation.MapBindingResult extends AbstractBindingResult implements Serializable

Serialized Fields

target

Map<K,V> target

Class org.springframework.validation.ObjectError extends DefaultMessageSourceResolvable implements Serializable

Serialized Fields

objectName

String objectName
Package org.springframework.validation.support

Class org.springframework.validation.support.BindingAwareModelMap extends ExtendedModelMap implements Serializable

Package org.springframework.web

Class org.springframework.web.HttpMediaTypeException extends ServletException implements Serializable

Serialized Fields

supportedMediaTypes

List<E> supportedMediaTypes

Class org.springframework.web.HttpMediaTypeNotAcceptableException extends HttpMediaTypeException implements Serializable

Class org.springframework.web.HttpMediaTypeNotSupportedException extends HttpMediaTypeException implements Serializable

Serialized Fields

contentType

MediaType contentType

Class org.springframework.web.HttpRequestMethodNotSupportedException extends ServletException implements Serializable

Serialized Fields

method

String method

supportedMethods

String[] supportedMethods

Class org.springframework.web.HttpSessionRequiredException extends ServletException implements Serializable

Package org.springframework.web.bind

Class org.springframework.web.bind.MissingServletRequestParameterException extends ServletRequestBindingException implements Serializable

Serialized Fields

parameterName

String parameterName

parameterType

String parameterType

Class org.springframework.web.bind.ServletRequestBindingException extends NestedServletException implements Serializable

Class org.springframework.web.bind.ServletRequestParameterPropertyValues extends MutablePropertyValues implements Serializable

Class org.springframework.web.bind.UnsatisfiedServletRequestParameterException extends ServletRequestBindingException implements Serializable

Serialized Fields

paramConditions

String[] paramConditions

actualParams

Map<K,V> actualParams
Package org.springframework.web.bind.annotation.support

Class org.springframework.web.bind.annotation.support.HandlerMethodInvocationException extends NestedRuntimeException implements Serializable

Package org.springframework.web.client

Class org.springframework.web.client.HttpClientErrorException extends HttpStatusCodeException implements Serializable

Class org.springframework.web.client.HttpServerErrorException extends HttpStatusCodeException implements Serializable

Class org.springframework.web.client.HttpStatusCodeException extends RestClientException implements Serializable

Serialized Fields

statusCode

HttpStatus statusCode

statusText

String statusText

Class org.springframework.web.client.ResourceAccessException extends RestClientException implements Serializable

Class org.springframework.web.client.RestClientException extends NestedRuntimeException implements Serializable

Package org.springframework.web.context.request

Class org.springframework.web.context.request.DestructionCallbackBindingListener extends Object implements Serializable

Serialized Fields

destructionCallback

Runnable destructionCallback
Package org.springframework.web.context.support

Class org.springframework.web.context.support.HttpRequestHandlerServlet extends HttpServlet implements Serializable

Serialized Fields

target

HttpRequestHandler target

Class org.springframework.web.context.support.RequestHandledEvent extends ApplicationEvent implements Serializable

Serialized Fields

sessionId

String sessionId
Session id that applied to the request, if any

userName

String userName
Usually the UserPrincipal

processingTimeMillis

long processingTimeMillis
Request processing time

failureCause

Throwable failureCause
Cause of failure, if any

Class org.springframework.web.context.support.ServletRequestHandledEvent extends RequestHandledEvent implements Serializable

Serialized Fields

requestUrl

String requestUrl
URL that the triggered the request

clientAddress

String clientAddress
IP address that the request came from

method

String method
Usually GET or POST

servletName

String servletName
Name of the servlet that handled the request

Package org.springframework.web.jsf

Class org.springframework.web.jsf.DelegatingPhaseListenerMulticaster extends Object implements Serializable

Package org.springframework.web.multipart

Class org.springframework.web.multipart.MaxUploadSizeExceededException extends MultipartException implements Serializable

Serialized Fields

maxUploadSize

long maxUploadSize

Class org.springframework.web.multipart.MultipartException extends NestedRuntimeException implements Serializable

Package org.springframework.web.multipart.commons

Class org.springframework.web.multipart.commons.CommonsMultipartFile extends Object implements Serializable

Serialized Fields

fileItem

FileItem fileItem

size

long size
Package org.springframework.web.portlet

Class org.springframework.web.portlet.ModelAndViewDefiningException extends javax.portlet.PortletException implements Serializable

Serialized Fields

modelAndView

ModelAndView modelAndView
Package org.springframework.web.portlet.bind

Class org.springframework.web.portlet.bind.MissingPortletRequestParameterException extends PortletRequestBindingException implements Serializable

Serialized Fields

parameterName

String parameterName

parameterType

String parameterType

Class org.springframework.web.portlet.bind.PortletRequestBindingException extends javax.portlet.PortletException implements Serializable

Class org.springframework.web.portlet.bind.PortletRequestParameterPropertyValues extends MutablePropertyValues implements Serializable

Package org.springframework.web.portlet.context

Class org.springframework.web.portlet.context.PortletRequestHandledEvent extends RequestHandledEvent implements Serializable

Serialized Fields

portletName

String portletName
Name of the portlet that handled the request

portletMode

String portletMode
PortletMode of the request

requestType

String requestType
Type of Portlet Request

Package org.springframework.web.portlet.handler

Class org.springframework.web.portlet.handler.PortletRequestMethodNotSupportedException extends javax.portlet.PortletException implements Serializable

Serialized Fields

method

String method

supportedMethods

String[] supportedMethods

Class org.springframework.web.portlet.handler.PortletSessionRequiredException extends javax.portlet.PortletException implements Serializable

Package org.springframework.web.servlet

Class org.springframework.web.servlet.DispatcherServlet extends FrameworkServlet implements Serializable

Serialized Fields

detectAllHandlerMappings

boolean detectAllHandlerMappings
Detect all HandlerMappings or just expect "handlerMapping" bean?

detectAllHandlerAdapters

boolean detectAllHandlerAdapters
Detect all HandlerAdapters or just expect "handlerAdapter" bean?

detectAllHandlerExceptionResolvers

boolean detectAllHandlerExceptionResolvers
Detect all HandlerExceptionResolvers or just expect "handlerExceptionResolver" bean?

detectAllViewResolvers

boolean detectAllViewResolvers
Detect all ViewResolvers or just expect "viewResolver" bean?

cleanupAfterInclude

boolean cleanupAfterInclude
Perform cleanup of request attributes after include request?

multipartResolver

MultipartResolver multipartResolver
MultipartResolver used by this servlet

localeResolver

LocaleResolver localeResolver
LocaleResolver used by this servlet

themeResolver

ThemeResolver themeResolver
ThemeResolver used by this servlet

handlerMappings

List<E> handlerMappings
List of HandlerMappings used by this servlet

handlerAdapters

List<E> handlerAdapters
List of HandlerAdapters used by this servlet

handlerExceptionResolvers

List<E> handlerExceptionResolvers
List of HandlerExceptionResolvers used by this servlet

viewNameTranslator

RequestToViewNameTranslator viewNameTranslator
RequestToViewNameTranslator used by this servlet

viewResolvers

List<E> viewResolvers
List of ViewResolvers used by this servlet

Class org.springframework.web.servlet.FrameworkServlet extends HttpServletBean implements Serializable

Serialized Fields

contextAttribute

String contextAttribute
ServletContext attribute to find the WebApplicationContext in

contextClass

Class<T> contextClass
WebApplicationContext implementation class to create

namespace

String namespace
Namespace for this servlet

contextConfigLocation

String contextConfigLocation
Explicit context config location

publishContext

boolean publishContext
Should we publish the context as a ServletContext attribute?

publishEvents

boolean publishEvents
Should we publish a ServletRequestHandledEvent at the end of each request?

threadContextInheritable

boolean threadContextInheritable
Expose LocaleContext and RequestAttributes as inheritable for child threads?

dispatchOptionsRequest

boolean dispatchOptionsRequest
Should we dispatch an HTTP OPTIONS request to FrameworkServlet.doService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)?

dispatchTraceRequest

boolean dispatchTraceRequest
Should we dispatch an HTTP TRACE request to FrameworkServlet.doService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)?

webApplicationContext

WebApplicationContext webApplicationContext
WebApplicationContext for this servlet

refreshEventReceived

boolean refreshEventReceived
Flag used to detect whether onRefresh has already been called

Class org.springframework.web.servlet.HttpServletBean extends HttpServlet implements Serializable

Serialized Fields

logger

Log logger
Logger available to subclasses

requiredProperties

Set<E> requiredProperties
Set of required properties (Strings) that must be supplied as config parameters to this servlet.

Class org.springframework.web.servlet.ModelAndViewDefiningException extends ServletException implements Serializable

Serialized Fields

modelAndView

ModelAndView modelAndView

Class org.springframework.web.servlet.ResourceServlet extends HttpServletBean implements Serializable

Serialized Fields

defaultUrl

String defaultUrl

allowedResources

String allowedResources

contentType

String contentType

applyLastModified

boolean applyLastModified

pathMatcher

PathMatcher pathMatcher

startupTime

long startupTime

Class org.springframework.web.servlet.ViewRendererServlet extends HttpServlet implements Serializable

Package org.springframework.web.servlet.mvc.multiaction

Class org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException extends ServletException implements Serializable

Serialized Fields

methodName

String methodName
Package org.springframework.web.servlet.tags

Class org.springframework.web.servlet.tags.BindErrorsTag extends HtmlEscapingAwareTag implements Serializable

Serialized Fields

name

String name

errors

Errors errors

Class org.springframework.web.servlet.tags.BindTag extends HtmlEscapingAwareTag implements Serializable

Serialized Fields

path

String path

ignoreNestedPath

boolean ignoreNestedPath

status

BindStatus status

previousPageStatus

Object previousPageStatus

previousRequestStatus

Object previousRequestStatus

Class org.springframework.web.servlet.tags.EscapeBodyTag extends HtmlEscapingAwareTag implements Serializable

Serialized Fields

javaScriptEscape

boolean javaScriptEscape

bodyContent

BodyContent bodyContent

Class org.springframework.web.servlet.tags.EvalTag extends HtmlEscapingAwareTag implements Serializable

Serialized Fields

expressionParser

ExpressionParser expressionParser

evaluationContext

EvaluationContext evaluationContext

expression

Expression expression

var

String var

scope

int scope

javaScriptEscape

boolean javaScriptEscape

Class org.springframework.web.servlet.tags.HtmlEscapeTag extends RequestContextAwareTag implements Serializable

Serialized Fields

defaultHtmlEscape

String defaultHtmlEscape

Class org.springframework.web.servlet.tags.HtmlEscapingAwareTag extends RequestContextAwareTag implements Serializable

Serialized Fields

htmlEscape

Boolean htmlEscape

Class org.springframework.web.servlet.tags.MessageTag extends HtmlEscapingAwareTag implements Serializable

Serialized Fields

message

Object message

code

String code

arguments

Object arguments

argumentSeparator

String argumentSeparator

text

String text

var

String var

scope

String scope

javaScriptEscape

boolean javaScriptEscape

Class org.springframework.web.servlet.tags.NestedPathTag extends TagSupport implements Serializable

Serialized Fields

path

String path

previousNestedPath

String previousNestedPath
Caching a previous nested path, so that it may be reset

Class org.springframework.web.servlet.tags.ParamTag extends BodyTagSupport implements Serializable

Serialized Fields

name

String name

value

String value

param

Param param

Class org.springframework.web.servlet.tags.RequestContextAwareTag extends TagSupport implements Serializable

Serialized Fields

logger

Log logger
Logger available to subclasses

requestContext

RequestContext requestContext

Class org.springframework.web.servlet.tags.ThemeTag extends MessageTag implements Serializable

Class org.springframework.web.servlet.tags.TransformTag extends HtmlEscapingAwareTag implements Serializable

Serialized Fields

value

Object value
the value to transform using the appropriate property editor

var

String var
the variable to put the result in

scope

String scope
the scope of the variable the result will be put in

Class org.springframework.web.servlet.tags.UrlTag extends HtmlEscapingAwareTag implements Serializable

Serialized Fields

params

List<E> params

templateParams

Set<E> templateParams

type

org.springframework.web.servlet.tags.UrlTag.UrlType type

value

String value

context

String context

var

String var

scope

int scope

javaScriptEscape

boolean javaScriptEscape
Package org.springframework.web.servlet.tags.form

Class org.springframework.web.servlet.tags.form.AbstractCheckedElementTag extends AbstractHtmlInputElementTag implements Serializable

Class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag extends AbstractFormTag implements Serializable

Serialized Fields

path

String path
The property path from the form object.

id

String id
The value of the 'id' attribute.

bindStatus

BindStatus bindStatus
The BindStatus of this tag.

Class org.springframework.web.servlet.tags.form.AbstractFormTag extends HtmlEscapingAwareTag implements Serializable

Class org.springframework.web.servlet.tags.form.AbstractHtmlElementBodyTag extends AbstractHtmlElementTag implements Serializable

Serialized Fields

bodyContent

BodyContent bodyContent

tagWriter

TagWriter tagWriter

Class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag extends AbstractDataBoundFormElementTag implements Serializable

Serialized Fields

cssClass

String cssClass

cssErrorClass

String cssErrorClass

cssStyle

String cssStyle

lang

String lang

title

String title

dir

String dir

tabindex

String tabindex

onclick

String onclick

ondblclick

String ondblclick

onmousedown

String onmousedown

onmouseup

String onmouseup

onmouseover

String onmouseover

onmousemove

String onmousemove

onmouseout

String onmouseout

onkeypress

String onkeypress

onkeyup

String onkeyup

onkeydown

String onkeydown

dynamicAttributes

Map<K,V> dynamicAttributes

Class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag extends AbstractHtmlElementTag implements Serializable

Serialized Fields

onfocus

String onfocus

onblur

String onblur

onchange

String onchange

accesskey

String accesskey

disabled

String disabled

readonly

String readonly

Class org.springframework.web.servlet.tags.form.AbstractMultiCheckedElementTag extends AbstractCheckedElementTag implements Serializable

Serialized Fields

items

Object items
The Collection, Map or array of objects used to generate the 'input type="checkbox/radio"' tags.

itemValue

String itemValue
The name of the property mapped to the 'value' attribute of the 'input type="checkbox/radio"' tag.

itemLabel

String itemLabel
The value to be displayed as part of the 'input type="checkbox/radio"' tag.

element

String element
The HTML element used to enclose the 'input type="checkbox/radio"' tag.

delimiter

String delimiter
Delimiter to use between each 'input type="checkbox/radio"' tags.

Class org.springframework.web.servlet.tags.form.AbstractSingleCheckedElementTag extends AbstractCheckedElementTag implements Serializable

Serialized Fields

value

Object value
The value of the 'value' attribute.

label

Object label
The value of the 'label' attribute.

Class org.springframework.web.servlet.tags.form.CheckboxesTag extends AbstractMultiCheckedElementTag implements Serializable

Class org.springframework.web.servlet.tags.form.CheckboxTag extends AbstractSingleCheckedElementTag implements Serializable

Class org.springframework.web.servlet.tags.form.ErrorsTag extends AbstractHtmlElementBodyTag implements Serializable

Serialized Fields

element

String element

delimiter

String delimiter

oldMessages

Object oldMessages
Stores any value that existed in the 'errors messages' before the tag was started.

errorMessagesWereExposed

boolean errorMessagesWereExposed

Class org.springframework.web.servlet.tags.form.FormTag extends AbstractHtmlElementTag implements Serializable

Serialized Fields

tagWriter

TagWriter tagWriter

modelAttribute

String modelAttribute

name

String name

action

String action

method

String method

target

String target

enctype

String enctype

acceptCharset

String acceptCharset

onsubmit

String onsubmit

onreset

String onreset

autocomplete

String autocomplete

methodParam

String methodParam

previousNestedPath

String previousNestedPath
Caching a previous nested path, so that it may be reset

Class org.springframework.web.servlet.tags.form.HiddenInputTag extends AbstractDataBoundFormElementTag implements Serializable

Class org.springframework.web.servlet.tags.form.InputTag extends AbstractHtmlInputElementTag implements Serializable

Serialized Fields

size

String size

maxlength

String maxlength

alt

String alt

onselect

String onselect

autocomplete

String autocomplete

Class org.springframework.web.servlet.tags.form.LabelTag extends AbstractHtmlElementTag implements Serializable

Serialized Fields

tagWriter

TagWriter tagWriter
The TagWriter instance being used.

Stored so we can close the tag on LabelTag.doEndTag().

forId

String forId
The value of the 'for' attribute.

Class org.springframework.web.servlet.tags.form.OptionsTag extends AbstractHtmlElementTag implements Serializable

Serialized Fields

items

Object items
The Collection, Map or array of objects used to generate the inner 'option' tags.

itemValue

String itemValue
The name of the property mapped to the 'value' attribute of the 'option' tag.

itemLabel

String itemLabel
The name of the property mapped to the inner text of the 'option' tag.

disabled

String disabled

Class org.springframework.web.servlet.tags.form.OptionTag extends AbstractHtmlElementBodyTag implements Serializable

Serialized Fields

value

Object value
The 'value' attribute of the rendered HTML <option> tag.

label

String label
The text body of the rendered HTML <option> tag.

oldValue

Object oldValue

oldDisplayValue

Object oldDisplayValue

disabled

String disabled

Class org.springframework.web.servlet.tags.form.PasswordInputTag extends InputTag implements Serializable

Serialized Fields

showPassword

boolean showPassword

Class org.springframework.web.servlet.tags.form.RadioButtonsTag extends AbstractMultiCheckedElementTag implements Serializable

Class org.springframework.web.servlet.tags.form.RadioButtonTag extends AbstractSingleCheckedElementTag implements Serializable

Class org.springframework.web.servlet.tags.form.SelectTag extends AbstractHtmlInputElementTag implements Serializable

Serialized Fields

items

Object items
The Collection, Map or array of objects used to generate the inner 'option' tags.

itemValue

String itemValue
The name of the property mapped to the 'value' attribute of the 'option' tag.

itemLabel

String itemLabel
The name of the property mapped to the inner text of the 'option' tag.

size

String size
The value of the HTML 'size' attribute rendered on the final 'select' element.

multiple

Object multiple
Indicates whether or not the 'select' tag allows multiple-selections.

tagWriter

TagWriter tagWriter
The TagWriter instance that the output is being written.

Only used in conjunction with nested OptionTags.

Class org.springframework.web.servlet.tags.form.TextareaTag extends AbstractHtmlInputElementTag implements Serializable

Serialized Fields

rows

String rows

cols

String cols

onselect

String onselect
Package org.springframework.web.struts

Class org.springframework.web.struts.SpringBindingActionForm extends ActionForm implements Serializable

Serialized Fields

errors

Errors errors
Deprecated.

locale

Locale locale
Deprecated.

messageResources

MessageResources messageResources
Deprecated.
Package org.springframework.web.util

Class org.springframework.web.util.NestedServletException extends ServletException implements Serializable

serialVersionUID: -5292377985529381145L

Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES


A-Index

PREV LETTER NEXT LETTER FRAMES NO FRAMES
A B C D E F G H I J K L M N O P Q R S T U V W X

A

absolute(int) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
absolute(int) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Moves the cursor to the given row number in the RowSet, just after the last row.
ABSTRACT_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
ABSTRACT_KEY - Static variable in class org.springframework.beans.factory.support.PropertiesBeanDefinitionReader
Special key to distinguish owner.(abstract)=true Default is "false".
AbstractAdvisorAutoProxyCreator - Class in org.springframework.aop.framework.autoproxy
Generic auto proxy creator that builds AOP proxies for specific beans based on detected Advisors for each bean.
AbstractAdvisorAutoProxyCreator() - Constructor for class org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
AbstractAnnotationAwareTransactionalTests - Class in org.springframework.test.annotation
Deprecated. as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)
AbstractAnnotationAwareTransactionalTests() - Constructor for class org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests
Deprecated. Default constructor for AbstractAnnotationAwareTransactionalTests, which delegates to AbstractAnnotationAwareTransactionalTests.AbstractAnnotationAwareTransactionalTests(String).
AbstractAnnotationAwareTransactionalTests(String) - Constructor for class org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests
Deprecated. Constructs a new AbstractAnnotationAwareTransactionalTests instance with the specified JUnit name and retrieves the configured (or default) ProfileValueSource.
AbstractApplicationContext - Class in org.springframework.context.support
Abstract implementation of the ApplicationContext interface.
AbstractApplicationContext() - Constructor for class org.springframework.context.support.AbstractApplicationContext
Create a new AbstractApplicationContext with no parent.
AbstractApplicationContext(ApplicationContext) - Constructor for class org.springframework.context.support.AbstractApplicationContext
Create a new AbstractApplicationContext with the given parent context.
AbstractApplicationEventMulticaster - Class in org.springframework.context.event
Abstract implementation of the ApplicationEventMulticaster interface, providing the basic listener registration facility.
AbstractApplicationEventMulticaster() - Constructor for class org.springframework.context.event.AbstractApplicationEventMulticaster
AbstractAspectJAdvice - Class in org.springframework.aop.aspectj
Base class for AOP Alliance Advice classes wrapping an AspectJ aspect or an AspectJ-annotated advice method.
AbstractAspectJAdvice(Method, AspectJExpressionPointcut, AspectInstanceFactory) - Constructor for class org.springframework.aop.aspectj.AbstractAspectJAdvice
Create a new AbstractAspectJAdvice for the given advice method.
AbstractAspectJAdvisorFactory - Class in org.springframework.aop.aspectj.annotation
Abstract base class for factories that can create Spring AOP Advisors given AspectJ classes from classes honoring the AspectJ 5 annotation syntax.
AbstractAspectJAdvisorFactory() - Constructor for class org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory
AbstractAspectJAdvisorFactory.AspectJAnnotation<A extends Annotation> - Class in org.springframework.aop.aspectj.annotation
Class modelling an AspectJ annotation, exposing its type enumeration and pointcut String.
AbstractAspectJAdvisorFactory.AspectJAnnotation(A) - Constructor for class org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory.AspectJAnnotation
AbstractAspectJAdvisorFactory.AspectJAnnotationType - Enum in org.springframework.aop.aspectj.annotation
AbstractAspectjJpaTests - Class in org.springframework.test.jpa
Deprecated. as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)
AbstractAspectjJpaTests() - Constructor for class org.springframework.test.jpa.AbstractAspectjJpaTests
Deprecated.
AbstractAtomFeedView - Class in org.springframework.web.servlet.view.feed
Abstract superclass for Atom Feed views, using java.net's ROME package.
AbstractAtomFeedView() - Constructor for class org.springframework.web.servlet.view.feed.AbstractAtomFeedView
AbstractAutoProxyCreator - Class in org.springframework.aop.framework.autoproxy
BeanPostProcessor implementation that wraps each eligible bean with an AOP proxy, delegating to specified interceptors before invoking the bean itself.
AbstractAutoProxyCreator() - Constructor for class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
AbstractAutowireCapableBeanFactory - Class in org.springframework.beans.factory.support
Abstract bean factory superclass that implements default bean creation, with the full capabilities specified by the RootBeanDefinition class.
AbstractAutowireCapableBeanFactory() - Constructor for class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Create a new AbstractAutowireCapableBeanFactory.
AbstractAutowireCapableBeanFactory(BeanFactory) - Constructor for class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Create a new AbstractAutowireCapableBeanFactory with the given parent.
AbstractBeanDefinition - Class in org.springframework.beans.factory.support
Base class for concrete, full-fledged BeanDefinition classes, factoring out common properties of RootBeanDefinition and ChildBeanDefinition.
AbstractBeanDefinition() - Constructor for class org.springframework.beans.factory.support.AbstractBeanDefinition
Create a new AbstractBeanDefinition with default settings.
AbstractBeanDefinition(ConstructorArgumentValues, MutablePropertyValues) - Constructor for class org.springframework.beans.factory.support.AbstractBeanDefinition
Create a new AbstractBeanDefinition with the given constructor argument values and property values.
AbstractBeanDefinition(AbstractBeanDefinition) - Constructor for class org.springframework.beans.factory.support.AbstractBeanDefinition
Deprecated. since Spring 2.5, in favor of AbstractBeanDefinition.AbstractBeanDefinition(BeanDefinition)
AbstractBeanDefinition(BeanDefinition) - Constructor for class org.springframework.beans.factory.support.AbstractBeanDefinition
Create a new AbstractBeanDefinition as deep copy of the given bean definition.
AbstractBeanDefinitionParser - Class in org.springframework.beans.factory.xml
Abstract BeanDefinitionParser implementation providing a number of convenience methods and a template method that subclasses must override to provide the actual parsing logic.
AbstractBeanDefinitionParser() - Constructor for class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
AbstractBeanDefinitionReader - Class in org.springframework.beans.factory.support
Abstract base class for bean definition readers which implement the BeanDefinitionReader interface.
AbstractBeanDefinitionReader(BeanDefinitionRegistry) - Constructor for class org.springframework.beans.factory.support.AbstractBeanDefinitionReader
Create a new AbstractBeanDefinitionReader for the given bean factory.
AbstractBeanFactory - Class in org.springframework.beans.factory.support
Abstract base class for BeanFactory implementations, providing the full capabilities of the ConfigurableBeanFactory SPI.
AbstractBeanFactory() - Constructor for class org.springframework.beans.factory.support.AbstractBeanFactory
Create a new AbstractBeanFactory.
AbstractBeanFactory(BeanFactory) - Constructor for class org.springframework.beans.factory.support.AbstractBeanFactory
Create a new AbstractBeanFactory with the given parent.
AbstractBeanFactoryBasedTargetSource - Class in org.springframework.aop.target
Base class for TargetSource implementations that are based on a Spring BeanFactory, delegating to Spring-managed bean instances.
AbstractBeanFactoryBasedTargetSource() - Constructor for class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
AbstractBeanFactoryBasedTargetSourceCreator - Class in org.springframework.aop.framework.autoproxy.target
Convenient superclass for TargetSourceCreator implementations that require creating multiple instances of a prototype bean.
AbstractBeanFactoryBasedTargetSourceCreator() - Constructor for class org.springframework.aop.framework.autoproxy.target.AbstractBeanFactoryBasedTargetSourceCreator
AbstractBeanFactoryPointcutAdvisor - Class in org.springframework.aop.support
Abstract BeanFactory-based PointcutAdvisor that allows for any Advice to be configured as reference to an Advice bean in a BeanFactory.
AbstractBeanFactoryPointcutAdvisor() - Constructor for class org.springframework.aop.support.AbstractBeanFactoryPointcutAdvisor
AbstractBindingResult - Class in org.springframework.validation
Abstract implementation of the BindingResult interface and its super-interface Errors.
AbstractBindingResult(String) - Constructor for class org.springframework.validation.AbstractBindingResult
Create a new AbstractBindingResult instance.
AbstractCachingLabeledEnumResolver - Class in org.springframework.core.enums
Deprecated. as of Spring 3.0, in favor of Java 5 enums.
AbstractCachingLabeledEnumResolver() - Constructor for class org.springframework.core.enums.AbstractCachingLabeledEnumResolver
Deprecated.
AbstractCachingViewResolver - Class in org.springframework.web.servlet.view
Convenient base class for ViewResolver implementations.
AbstractCachingViewResolver() - Constructor for class org.springframework.web.servlet.view.AbstractCachingViewResolver
AbstractCheckedElementTag - Class in org.springframework.web.servlet.tags.form
Abstract base class to provide common methods for implementing databinding-aware JSP tags for rendering an HTML 'input' element with a 'type' of 'checkbox' or 'radio'.
AbstractCheckedElementTag() - Constructor for class org.springframework.web.servlet.tags.form.AbstractCheckedElementTag
AbstractClassTestingTypeFilter - Class in org.springframework.core.type.filter
Type filter that exposes a ClassMetadata object to subclasses, for class testing purposes.
AbstractClassTestingTypeFilter() - Constructor for class org.springframework.core.type.filter.AbstractClassTestingTypeFilter
AbstractClientHttpRequest - Class in org.springframework.http.client
Abstract base for ClientHttpRequest that makes sure that headers and body are not written multiple times.
AbstractClientHttpRequest() - Constructor for class org.springframework.http.client.AbstractClientHttpRequest
AbstractColumnMaxValueIncrementer - Class in org.springframework.jdbc.support.incrementer
Abstract base class for DataFieldMaxValueIncrementer implementations that use a column in a custom sequence table.
AbstractColumnMaxValueIncrementer() - Constructor for class org.springframework.jdbc.support.incrementer.AbstractColumnMaxValueIncrementer
Default constructor for bean property style usage.
AbstractColumnMaxValueIncrementer(DataSource, String, String) - Constructor for class org.springframework.jdbc.support.incrementer.AbstractColumnMaxValueIncrementer
Convenience constructor.
AbstractCommandController - Class in org.springframework.web.portlet.mvc
Deprecated. as of Spring 3.0, in favor of annotated controllers
AbstractCommandController() - Constructor for class org.springframework.web.portlet.mvc.AbstractCommandController
Deprecated. Create a new AbstractCommandController.
AbstractCommandController(Class) - Constructor for class org.springframework.web.portlet.mvc.AbstractCommandController
Deprecated. Create a new AbstractCommandController.
AbstractCommandController(Class, String) - Constructor for class org.springframework.web.portlet.mvc.AbstractCommandController
Deprecated. Create a new AbstractCommandController.
AbstractCommandController - Class in org.springframework.web.servlet.mvc
Deprecated. as of Spring 3.0, in favor of annotated controllers
AbstractCommandController() - Constructor for class org.springframework.web.servlet.mvc.AbstractCommandController
Deprecated. Create a new AbstractCommandController.
AbstractCommandController(Class) - Constructor for class org.springframework.web.servlet.mvc.AbstractCommandController
Deprecated. Create a new AbstractCommandController.
AbstractCommandController(Class, String) - Constructor for class org.springframework.web.servlet.mvc.AbstractCommandController
Deprecated. Create a new AbstractCommandController.
AbstractComponentDefinition - Class in org.springframework.beans.factory.parsing
Base implementation of ComponentDefinition that provides a basic implementation of AbstractComponentDefinition.getDescription() which delegates to ComponentDefinition.getName().
AbstractComponentDefinition() - Constructor for class org.springframework.beans.factory.parsing.AbstractComponentDefinition
AbstractConfigurableMBeanInfoAssembler - Class in org.springframework.jmx.export.assembler
Base class for MBeanInfoAssemblers that support configurable JMX notification behavior.
AbstractConfigurableMBeanInfoAssembler() - Constructor for class org.springframework.jmx.export.assembler.AbstractConfigurableMBeanInfoAssembler
AbstractContextLoader - Class in org.springframework.test.context.support
Abstract application context loader, which provides a basis for all concrete implementations of the ContextLoader strategy.
AbstractContextLoader() - Constructor for class org.springframework.test.context.support.AbstractContextLoader
AbstractController - Class in org.springframework.web.portlet.mvc
Convenient superclass for controller implementations, using the Template Method design pattern.
AbstractController() - Constructor for class org.springframework.web.portlet.mvc.AbstractController
AbstractController - Class in org.springframework.web.servlet.mvc
Convenient superclass for controller implementations, using the Template Method design pattern.
AbstractController() - Constructor for class org.springframework.web.servlet.mvc.AbstractController
AbstractControllerUrlHandlerMapping - Class in org.springframework.web.servlet.mvc.support
Base class for HandlerMapping implementations that derive URL paths according to conventions for specific controller types.
AbstractControllerUrlHandlerMapping() - Constructor for class org.springframework.web.servlet.mvc.support.AbstractControllerUrlHandlerMapping
AbstractDataBoundFormElementTag - Class in org.springframework.web.servlet.tags.form
Base tag for all data-binding aware JSP form tags.
AbstractDataBoundFormElementTag() - Constructor for class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
AbstractDataFieldMaxValueIncrementer - Class in org.springframework.jdbc.support.incrementer
Base implementation of DataFieldMaxValueIncrementer that delegates to a single AbstractDataFieldMaxValueIncrementer.getNextKey() template method that returns a long.
AbstractDataFieldMaxValueIncrementer() - Constructor for class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
Default constructor for bean property style usage.
AbstractDataFieldMaxValueIncrementer(DataSource, String) - Constructor for class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
Convenience constructor.
AbstractDataSource - Class in org.springframework.jdbc.datasource
Abstract base class for Spring's DataSource implementations, taking care of the padding.
AbstractDataSource() - Constructor for class org.springframework.jdbc.datasource.AbstractDataSource
AbstractDependencyInjectionSpringContextTests - Class in org.springframework.test
Deprecated. as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)
AbstractDependencyInjectionSpringContextTests() - Constructor for class org.springframework.test.AbstractDependencyInjectionSpringContextTests
Deprecated. Default constructor for AbstractDependencyInjectionSpringContextTests.
AbstractDependencyInjectionSpringContextTests(String) - Constructor for class org.springframework.test.AbstractDependencyInjectionSpringContextTests
Deprecated. Constructor for AbstractDependencyInjectionSpringContextTests with a JUnit name.
AbstractDetectingUrlHandlerMapping - Class in org.springframework.web.servlet.handler
Abstract implementation of the HandlerMapping interface, detecting URL mappings for handler beans through introspection of all defined beans in the application context.
AbstractDetectingUrlHandlerMapping() - Constructor for class org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping
AbstractDriverBasedDataSource - Class in org.springframework.jdbc.datasource
Abstract base class for JDBC DataSource implementations that operate on a JDBC Driver.
AbstractDriverBasedDataSource() - Constructor for class org.springframework.jdbc.datasource.AbstractDriverBasedDataSource
AbstractEnterpriseBean - Class in org.springframework.ejb.support
Base class for Spring-based EJB 2.x beans.
AbstractEnterpriseBean() - Constructor for class org.springframework.ejb.support.AbstractEnterpriseBean
AbstractEntityManagerFactoryBean - Class in org.springframework.orm.jpa
Abstract FactoryBean that creates a local JPA EntityManagerFactory instance within a Spring application context.
AbstractEntityManagerFactoryBean() - Constructor for class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
AbstractErrors - Class in org.springframework.validation
Abstract implementation of the Errors interface.
AbstractErrors() - Constructor for class org.springframework.validation.AbstractErrors
AbstractExcelView - Class in org.springframework.web.servlet.view.document
Convenient superclass for Excel document views.
AbstractExcelView() - Constructor for class org.springframework.web.servlet.view.document.AbstractExcelView
Default Constructor.
AbstractExpressionPointcut - Class in org.springframework.aop.support
Abstract superclass for expression pointcuts, offering location and expression properties.
AbstractExpressionPointcut() - Constructor for class org.springframework.aop.support.AbstractExpressionPointcut
AbstractFactoryBean<T> - Class in org.springframework.beans.factory.config
Simple template superclass for FactoryBean implementations that creates a singleton or a prototype object, depending on a flag.
AbstractFactoryBean() - Constructor for class org.springframework.beans.factory.config.AbstractFactoryBean
AbstractFallbackSQLExceptionTranslator - Class in org.springframework.jdbc.support
Base class for SQLExceptionTranslator implementations that allow for fallback to some other SQLExceptionTranslator.
AbstractFallbackSQLExceptionTranslator() - Constructor for class org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator
AbstractFallbackTransactionAttributeSource - Class in org.springframework.transaction.interceptor
Abstract implementation of TransactionAttributeSource that caches attributes for methods and implements a fallback policy: 1.
AbstractFallbackTransactionAttributeSource() - Constructor for class org.springframework.transaction.interceptor.AbstractFallbackTransactionAttributeSource
AbstractFeedView<T extends com.sun.syndication.feed.WireFeed> - Class in org.springframework.web.servlet.view.feed
Abstract base class for Atom and RSS Feed views, using java.net's ROME package.
AbstractFeedView() - Constructor for class org.springframework.web.servlet.view.feed.AbstractFeedView
AbstractFileResolvingResource - Class in org.springframework.core.io
Abstract base class for resources which resolve URLs into File references, such as UrlResource or ClassPathResource.
AbstractFileResolvingResource() - Constructor for class org.springframework.core.io.AbstractFileResolvingResource
AbstractFormController - Class in org.springframework.web.portlet.mvc
Deprecated. as of Spring 3.0, in favor of annotated controllers
AbstractFormController() - Constructor for class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Create a new AbstractFormController.
AbstractFormController - Class in org.springframework.web.servlet.mvc
Deprecated. as of Spring 3.0, in favor of annotated controllers
AbstractFormController() - Constructor for class org.springframework.web.servlet.mvc.AbstractFormController
Deprecated. Create a new AbstractFormController.
AbstractFormTag - Class in org.springframework.web.servlet.tags.form
Base class for all JSP form tags.
AbstractFormTag() - Constructor for class org.springframework.web.servlet.tags.form.AbstractFormTag
AbstractGenericContextLoader - Class in org.springframework.test.context.support
Abstract, generic extension of AbstractContextLoader which loads a GenericApplicationContext from the locations provided to AbstractGenericContextLoader.loadContext(String...).
AbstractGenericContextLoader() - Constructor for class org.springframework.test.context.support.AbstractGenericContextLoader
AbstractGenericLabeledEnum - Class in org.springframework.core.enums
Deprecated. as of Spring 3.0, in favor of Java 5 enums.
AbstractGenericLabeledEnum(String) - Constructor for class org.springframework.core.enums.AbstractGenericLabeledEnum
Deprecated. Create a new StaticLabeledEnum instance.
AbstractGenericPointcutAdvisor - Class in org.springframework.aop.support
Abstract generic PointcutAdvisor that allows for any Advice to be configured.
AbstractGenericPointcutAdvisor() - Constructor for class org.springframework.aop.support.AbstractGenericPointcutAdvisor
AbstractHandlerExceptionResolver - Class in org.springframework.web.portlet.handler
Abstract base class for HandlerExceptionResolver implementations.
AbstractHandlerExceptionResolver() - Constructor for class org.springframework.web.portlet.handler.AbstractHandlerExceptionResolver
AbstractHandlerExceptionResolver - Class in org.springframework.web.servlet.handler
Abstract base class for HandlerExceptionResolver implementations.
AbstractHandlerExceptionResolver() - Constructor for class org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
AbstractHandlerMapping - Class in org.springframework.web.portlet.handler
Abstract base class for HandlerMapping implementations.
AbstractHandlerMapping() - Constructor for class org.springframework.web.portlet.handler.AbstractHandlerMapping
AbstractHandlerMapping - Class in org.springframework.web.servlet.handler
Abstract base class for HandlerMapping implementations.
AbstractHandlerMapping() - Constructor for class org.springframework.web.servlet.handler.AbstractHandlerMapping
AbstractHtmlElementBodyTag - Class in org.springframework.web.servlet.tags.form
Convenient super class for many html tags that render content using the databinding features of the AbstractHtmlElementTag.
AbstractHtmlElementBodyTag() - Constructor for class org.springframework.web.servlet.tags.form.AbstractHtmlElementBodyTag
AbstractHtmlElementTag - Class in org.springframework.web.servlet.tags.form
Base class for databinding-aware JSP tags that render HTML element.
AbstractHtmlElementTag() - Constructor for class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
AbstractHtmlInputElementTag - Class in org.springframework.web.servlet.tags.form
Base class for databinding-aware JSP tags that render HTML form input element.
AbstractHtmlInputElementTag() - Constructor for class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
AbstractHttpInvokerRequestExecutor - Class in org.springframework.remoting.httpinvoker
Abstract base implementation of the HttpInvokerRequestExecutor interface.
AbstractHttpInvokerRequestExecutor() - Constructor for class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
AbstractHttpMessageConverter<T> - Class in org.springframework.http.converter
Abstract base class for most HttpMessageConverter implementations.
AbstractHttpMessageConverter() - Constructor for class org.springframework.http.converter.AbstractHttpMessageConverter
Construct an AbstractHttpMessageConverter with no supported media types.
AbstractHttpMessageConverter(MediaType) - Constructor for class org.springframework.http.converter.AbstractHttpMessageConverter
Construct an AbstractHttpMessageConverter with one supported media type.
AbstractHttpMessageConverter(MediaType...) - Constructor for class org.springframework.http.converter.AbstractHttpMessageConverter
Construct an AbstractHttpMessageConverter with multiple supported media type.
AbstractInterceptorDrivenBeanDefinitionDecorator - Class in org.springframework.aop.config
Base implementation for BeanDefinitionDecorators wishing to add an interceptor to the resulting bean.
AbstractInterceptorDrivenBeanDefinitionDecorator() - Constructor for class org.springframework.aop.config.AbstractInterceptorDrivenBeanDefinitionDecorator
AbstractInterruptibleBatchPreparedStatementSetter - Class in org.springframework.jdbc.core.support
Abstract implementation of the InterruptibleBatchPreparedStatementSetter interface, combining the check for available values and setting of those into a single callback method AbstractInterruptibleBatchPreparedStatementSetter.setValuesIfAvailable(java.sql.PreparedStatement, int).
AbstractInterruptibleBatchPreparedStatementSetter() - Constructor for class org.springframework.jdbc.core.support.AbstractInterruptibleBatchPreparedStatementSetter
AbstractJasperReportsSingleFormatView - Class in org.springframework.web.servlet.view.jasperreports
Extends AbstractJasperReportsView to provide basic rendering logic for views that use a fixed format, e.g.
AbstractJasperReportsSingleFormatView() - Constructor for class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsSingleFormatView
AbstractJasperReportsView - Class in org.springframework.web.servlet.view.jasperreports
Base class for all JasperReports views.
AbstractJasperReportsView() - Constructor for class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
AbstractJaxb2HttpMessageConverter<T> - Class in org.springframework.http.converter.xml
Abstract base class for HttpMessageConverters that use JAXB2.
AbstractJaxb2HttpMessageConverter() - Constructor for class org.springframework.http.converter.xml.AbstractJaxb2HttpMessageConverter
AbstractJaxWsServiceExporter - Class in org.springframework.remoting.jaxws
Abstract exporter for JAX-WS services, autodetecting annotated service beans (through the JAX-WS WebService annotation).
AbstractJaxWsServiceExporter() - Constructor for class org.springframework.remoting.jaxws.AbstractJaxWsServiceExporter
AbstractJdbcCall - Class in org.springframework.jdbc.core.simple
Abstract class to provide base functionality for easy stored procedure calls based on configuration options and database metadata.
AbstractJdbcCall(DataSource) - Constructor for class org.springframework.jdbc.core.simple.AbstractJdbcCall
Constructor to be used when initializing using a DataSource.
AbstractJdbcCall(JdbcTemplate) - Constructor for class org.springframework.jdbc.core.simple.AbstractJdbcCall
Constructor to be used when initializing using a JdbcTemplate.
AbstractJdbcInsert - Class in org.springframework.jdbc.core.simple
Abstract class to provide base functionality for easy inserts based on configuration options and database metadata.
AbstractJdbcInsert(DataSource) - Constructor for class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Constructor for sublasses to delegate to for setting the DataSource.
AbstractJdbcInsert(JdbcTemplate) - Constructor for class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Constructor for sublasses to delegate to for setting the JdbcTemplate.
AbstractJExcelView - Class in org.springframework.web.servlet.view.document
Convenient superclass for Excel document views.
AbstractJExcelView() - Constructor for class org.springframework.web.servlet.view.document.AbstractJExcelView
Default Constructor.
AbstractJmsListeningContainer - Class in org.springframework.jms.listener
Common base class for all containers which need to implement listening based on a JMS Connection (either shared or freshly obtained for each attempt).
AbstractJmsListeningContainer() - Constructor for class org.springframework.jms.listener.AbstractJmsListeningContainer
AbstractJmsListeningContainer.SharedConnectionNotInitializedException - Exception in org.springframework.jms.listener
Exception that indicates that the initial setup of this container's shared JMS Connection failed.
AbstractJmsListeningContainer.SharedConnectionNotInitializedException(String) - Constructor for exception org.springframework.jms.listener.AbstractJmsListeningContainer.SharedConnectionNotInitializedException
Create a new SharedConnectionNotInitializedException.
AbstractJmsMessageDrivenBean - Class in org.springframework.ejb.support
Convenient base class for JMS-based EJB 2.x MDBs.
AbstractJmsMessageDrivenBean() - Constructor for class org.springframework.ejb.support.AbstractJmsMessageDrivenBean
AbstractJmxAttribute - Class in org.springframework.jmx.export.metadata
Base class for all JMX metadata classes.
AbstractJmxAttribute() - Constructor for class org.springframework.jmx.export.metadata.AbstractJmxAttribute
AbstractJpaTests - Class in org.springframework.test.jpa
Deprecated. as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)
AbstractJpaTests() - Constructor for class org.springframework.test.jpa.AbstractJpaTests
Deprecated.
AbstractJpaVendorAdapter - Class in org.springframework.orm.jpa.vendor
Abstract JpaVendorAdapter implementation that defines common properties, to be translated into vendor-specific JPA properties by concrete subclasses.
AbstractJpaVendorAdapter() - Constructor for class org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter
AbstractJUnit38SpringContextTests - Class in org.springframework.test.context.junit38
Abstract base TestCase which integrates the Spring TestContext Framework and explicit ApplicationContext testing support in a JUnit 3.8 environment.
AbstractJUnit38SpringContextTests() - Constructor for class org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests
Constructs a new AbstractJUnit38SpringContextTests instance; initializes the internal TestContextManager for the current test; and retrieves the configured (or default) ProfileValueSource.
AbstractJUnit38SpringContextTests(String) - Constructor for class org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests
Constructs a new AbstractJUnit38SpringContextTests instance with the supplied name; initializes the internal TestContextManager for the current test; and retrieves the configured (or default) ProfileValueSource.
AbstractJUnit4SpringContextTests - Class in org.springframework.test.context.junit4
Abstract base test class which integrates the Spring TestContext Framework with explicit ApplicationContext testing support in a JUnit 4.5+ environment.
AbstractJUnit4SpringContextTests() - Constructor for class org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests
AbstractLabeledEnum - Class in org.springframework.core.enums
Deprecated. as of Spring 3.0, in favor of Java 5 enums.
AbstractLabeledEnum() - Constructor for class org.springframework.core.enums.AbstractLabeledEnum
Deprecated. Create a new AbstractLabeledEnum instance.
AbstractLazyCreationTargetSource - Class in org.springframework.aop.target
TargetSource implementation that will lazily create a user-managed object.
AbstractLazyCreationTargetSource() - Constructor for class org.springframework.aop.target.AbstractLazyCreationTargetSource
AbstractLobCreatingPreparedStatementCallback - Class in org.springframework.jdbc.core.support
Abstract PreparedStatementCallback implementation that manages a LobCreator.
AbstractLobCreatingPreparedStatementCallback(LobHandler) - Constructor for class org.springframework.jdbc.core.support.AbstractLobCreatingPreparedStatementCallback
Create a new AbstractLobCreatingPreparedStatementCallback for the given LobHandler.
AbstractLobHandler - Class in org.springframework.jdbc.support.lob
Abstract base class for LobHandler implementations.
AbstractLobHandler() - Constructor for class org.springframework.jdbc.support.lob.AbstractLobHandler
AbstractLobStreamingResultSetExtractor - Class in org.springframework.jdbc.core.support
Abstract ResultSetExtractor implementation that assumes streaming of LOB data.
AbstractLobStreamingResultSetExtractor() - Constructor for class org.springframework.jdbc.core.support.AbstractLobStreamingResultSetExtractor
AbstractLobType - Class in org.springframework.orm.hibernate3.support
Abstract base class for Hibernate UserType implementations that map to LOBs.
AbstractLobType() - Constructor for class org.springframework.orm.hibernate3.support.AbstractLobType
Constructor used by Hibernate: fetches config-time LobHandler and config-time JTA TransactionManager from LocalSessionFactoryBean.
AbstractLobType(LobHandler, TransactionManager) - Constructor for class org.springframework.orm.hibernate3.support.AbstractLobType
Constructor used for testing: takes an explicit LobHandler and an explicit JTA TransactionManager (can be null).
AbstractLobTypeHandler - Class in org.springframework.orm.ibatis.support
Abstract base class for iBATIS TypeHandler implementations that map to LOBs.
AbstractLobTypeHandler() - Constructor for class org.springframework.orm.ibatis.support.AbstractLobTypeHandler
Constructor used by iBATIS: fetches config-time LobHandler from SqlMapClientFactoryBean.
AbstractLobTypeHandler(LobHandler) - Constructor for class org.springframework.orm.ibatis.support.AbstractLobTypeHandler
Constructor used for testing: takes an explicit LobHandler.
AbstractLocaleResolver - Class in org.springframework.web.servlet.i18n
Abstract base class for LocaleResolver implementations.
AbstractLocaleResolver() - Constructor for class org.springframework.web.servlet.i18n.AbstractLocaleResolver
AbstractMapBasedHandlerMapping<K> - Class in org.springframework.web.portlet.handler
Abstract base class for HandlerMapping implementations that rely on a map which caches handler objects per lookup key.
AbstractMapBasedHandlerMapping() - Constructor for class org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping
AbstractMapBasedHandlerMapping.PortletRequestMappingPredicate - Interface in org.springframework.web.portlet.handler
Predicate interface for determining a match with a given request.
AbstractMarshaller - Class in org.springframework.oxm.support
Abstract implementation of the Marshaller and Unmarshaller interface.
AbstractMarshaller() - Constructor for class org.springframework.oxm.support.AbstractMarshaller
AbstractMBeanInfoAssembler - Class in org.springframework.jmx.export.assembler
Abstract implementation of the MBeanInfoAssembler interface that encapsulates the creation of a ModelMBeanInfo instance but delegates the creation of metadata to subclasses.
AbstractMBeanInfoAssembler() - Constructor for class org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler
AbstractMessageDrivenBean - Class in org.springframework.ejb.support
Convenient base class for EJB 2.x MDBs.
AbstractMessageDrivenBean() - Constructor for class org.springframework.ejb.support.AbstractMessageDrivenBean
AbstractMessageEndpointFactory - Class in org.springframework.jca.endpoint
Abstract base implementation of the JCA 1.5 MessageEndpointFactory interface, providing transaction management capabilities as well as ClassLoader exposure for endpoint invocations.
AbstractMessageEndpointFactory() - Constructor for class org.springframework.jca.endpoint.AbstractMessageEndpointFactory
AbstractMessageEndpointFactory.AbstractMessageEndpoint - Class in org.springframework.jca.endpoint
Inner class for actual endpoint implementations, based on template method to allow for any kind of concrete endpoint implementation.
AbstractMessageEndpointFactory.AbstractMessageEndpoint() - Constructor for class org.springframework.jca.endpoint.AbstractMessageEndpointFactory.AbstractMessageEndpoint
AbstractMessageListenerContainer - Class in org.springframework.jms.listener
Abstract base class for message listener containers.
AbstractMessageListenerContainer() - Constructor for class org.springframework.jms.listener.AbstractMessageListenerContainer
AbstractMessageSource - Class in org.springframework.context.support
Abstract implementation of the HierarchicalMessageSource interface, implementing common handling of message variants, making it easy to implement a specific strategy for a concrete MessageSource.
AbstractMessageSource() - Constructor for class org.springframework.context.support.AbstractMessageSource
AbstractModelAndViewTests - Class in org.springframework.test.web
Deprecated. as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests) or ModelAndViewAssert with JUnit 4 and TestNG.
AbstractModelAndViewTests() - Constructor for class org.springframework.test.web.AbstractModelAndViewTests
Deprecated.
AbstractMonitoringInterceptor - Class in org.springframework.aop.interceptor
Base class for monitoring interceptors, such as performance monitors.
AbstractMonitoringInterceptor() - Constructor for class org.springframework.aop.interceptor.AbstractMonitoringInterceptor
AbstractMultiCheckedElementTag - Class in org.springframework.web.servlet.tags.form
Abstract base class to provide common methods for implementing databinding-aware JSP tags for rendering multiple HTML 'input' elements with a 'type' of 'checkbox' or 'radio'.
AbstractMultiCheckedElementTag() - Constructor for class org.springframework.web.servlet.tags.form.AbstractMultiCheckedElementTag
AbstractMultipartHttpServletRequest - Class in org.springframework.web.multipart.support
Abstract base implementation of the MultipartHttpServletRequest interface.
AbstractMultipartHttpServletRequest(HttpServletRequest) - Constructor for class org.springframework.web.multipart.support.AbstractMultipartHttpServletRequest
Wrap the given HttpServletRequest in a MultipartHttpServletRequest.
AbstractNumberFormatter - Class in org.springframework.format.number
Abstract formatter for Numbers, providing a AbstractNumberFormatter.getNumberFormat(java.util.Locale) template method.
AbstractNumberFormatter() - Constructor for class org.springframework.format.number.AbstractNumberFormatter
AbstractPdfStamperView - Class in org.springframework.web.servlet.view.document
Abstract superclass for PDF views that operate on an existing document with an AcroForm.
AbstractPdfStamperView() - Constructor for class org.springframework.web.servlet.view.document.AbstractPdfStamperView
AbstractPdfView - Class in org.springframework.web.servlet.view.document
Abstract superclass for PDF views, using Bruno Lowagie's iText package.
AbstractPdfView() - Constructor for class org.springframework.web.servlet.view.document.AbstractPdfView
This constructor sets the appropriate content type "application/pdf".
AbstractPlatformTransactionManager - Class in org.springframework.transaction.support
Abstract base class that implements Spring's standard transaction workflow, serving as basis for concrete platform transaction managers like JtaTransactionManager.
AbstractPlatformTransactionManager() - Constructor for class org.springframework.transaction.support.AbstractPlatformTransactionManager
AbstractPlatformTransactionManager.SuspendedResourcesHolder - Class in org.springframework.transaction.support
Holder for suspended resources.
AbstractPointcutAdvisor - Class in org.springframework.aop.support
Abstract base class for PointcutAdvisor implementations.
AbstractPointcutAdvisor() - Constructor for class org.springframework.aop.support.AbstractPointcutAdvisor
AbstractPollingMessageListenerContainer - Class in org.springframework.jms.listener
Base class for listener container implementations which are based on polling.
AbstractPollingMessageListenerContainer() - Constructor for class org.springframework.jms.listener.AbstractPollingMessageListenerContainer
AbstractPoolingTargetSource - Class in org.springframework.aop.target
Abstract base class for pooling TargetSource implementations which maintain a pool of target instances, acquiring and releasing a target object from the pool for each method invocation.
AbstractPoolingTargetSource() - Constructor for class org.springframework.aop.target.AbstractPoolingTargetSource
AbstractPropertyAccessor - Class in org.springframework.beans
Abstract implementation of the PropertyAccessor interface.
AbstractPropertyAccessor() - Constructor for class org.springframework.beans.AbstractPropertyAccessor
AbstractPropertyBindingResult - Class in org.springframework.validation
Abstract base class for BindingResult implementations that work with Spring's PropertyAccessor mechanism.
AbstractPropertyBindingResult(String) - Constructor for class org.springframework.validation.AbstractPropertyBindingResult
Create a new AbstractPropertyBindingResult instance.
AbstractPrototypeBasedTargetSource - Class in org.springframework.aop.target
Base class for dynamic TargetSource implementations that create new prototype bean instances to support a pooling or new-instance-per-invocation strategy.
AbstractPrototypeBasedTargetSource() - Constructor for class org.springframework.aop.target.AbstractPrototypeBasedTargetSource
AbstractReflectiveMBeanInfoAssembler - Class in org.springframework.jmx.export.assembler
Builds on the AbstractMBeanInfoAssembler superclass to add a basic algorithm for building metadata based on the reflective metadata of the MBean class.
AbstractReflectiveMBeanInfoAssembler() - Constructor for class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
AbstractRefreshableApplicationContext - Class in org.springframework.context.support
Base class for ApplicationContext implementations which are supposed to support multiple calls to refresh, creating a new internal bean factory instance every time.
AbstractRefreshableApplicationContext() - Constructor for class org.springframework.context.support.AbstractRefreshableApplicationContext
Create a new AbstractRefreshableApplicationContext with no parent.
AbstractRefreshableApplicationContext(ApplicationContext) - Constructor for class org.springframework.context.support.AbstractRefreshableApplicationContext
Create a new AbstractRefreshableApplicationContext with the given parent context.
AbstractRefreshableConfigApplicationContext - Class in org.springframework.context.support
AbstractRefreshableApplicationContext subclass that adds common handling of specified config locations.
AbstractRefreshableConfigApplicationContext() - Constructor for class org.springframework.context.support.AbstractRefreshableConfigApplicationContext
Create a new AbstractRefreshableConfigApplicationContext with no parent.
AbstractRefreshableConfigApplicationContext(ApplicationContext) - Constructor for class org.springframework.context.support.AbstractRefreshableConfigApplicationContext
Create a new AbstractRefreshableConfigApplicationContext with the given parent context.
AbstractRefreshablePortletApplicationContext - Class in org.springframework.web.portlet.context
AbstractRefreshableApplicationContext subclass which implements the ConfigurablePortletApplicationContext interface for portlet environments.
AbstractRefreshablePortletApplicationContext() - Constructor for class org.springframework.web.portlet.context.AbstractRefreshablePortletApplicationContext
AbstractRefreshableTargetSource - Class in org.springframework.aop.target.dynamic
Abstract TargetSource implementation that wraps a refreshable target object.
AbstractRefreshableTargetSource() - Constructor for class org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource
AbstractRefreshableWebApplicationContext - Class in org.springframework.web.context.support
AbstractRefreshableApplicationContext subclass which implements the ConfigurableWebApplicationContext interface for web environments.
AbstractRefreshableWebApplicationContext() - Constructor for class org.springframework.web.context.support.AbstractRefreshableWebApplicationContext
AbstractRegexpMethodPointcut - Class in org.springframework.aop.support
Abstract base regular expression pointcut bean.
AbstractRegexpMethodPointcut() - Constructor for class org.springframework.aop.support.AbstractRegexpMethodPointcut
AbstractRemoteSlsbInvokerInterceptor - Class in org.springframework.ejb.access
Base class for interceptors proxying remote Stateless Session Beans.
AbstractRemoteSlsbInvokerInterceptor() - Constructor for class org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor
AbstractRequestAttributes - Class in org.springframework.web.context.request
Abstract support class for RequestAttributes implementations, offering a request completion mechanism for request-specific destruction callbacks and for updating accessed session attributes.
AbstractRequestAttributes() - Constructor for class org.springframework.web.context.request.AbstractRequestAttributes
AbstractRequestAttributesScope - Class in org.springframework.web.context.request
Abstract Scope implementation that reads from a particular scope in the current thread-bound RequestAttributes object.
AbstractRequestAttributesScope() - Constructor for class org.springframework.web.context.request.AbstractRequestAttributesScope
AbstractRequestLoggingFilter - Class in org.springframework.web.filter
Base class for Filters that perform logging operations before and after a request is processed.
AbstractRequestLoggingFilter() - Constructor for class org.springframework.web.filter.AbstractRequestLoggingFilter
AbstractResource - Class in org.springframework.core.io
Convenience base class for Resource implementations, pre-implementing typical behavior.
AbstractResource() - Constructor for class org.springframework.core.io.AbstractResource
AbstractRoutingDataSource - Class in org.springframework.jdbc.datasource.lookup
Abstract DataSource implementation that routes AbstractRoutingDataSource.getConnection() calls to one of various target DataSources based on a lookup key.
AbstractRoutingDataSource() - Constructor for class org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
AbstractRssFeedView - Class in org.springframework.web.servlet.view.feed
Abstract superclass for RSS Feed views, using java.net's ROME package.
AbstractRssFeedView() - Constructor for class org.springframework.web.servlet.view.feed.AbstractRssFeedView
AbstractSequenceMaxValueIncrementer - Class in org.springframework.jdbc.support.incrementer
Abstract base class for DataFieldMaxValueIncrementer implementations that use a database sequence.
AbstractSequenceMaxValueIncrementer() - Constructor for class org.springframework.jdbc.support.incrementer.AbstractSequenceMaxValueIncrementer
Default constructor for bean property style usage.
AbstractSequenceMaxValueIncrementer(DataSource, String) - Constructor for class org.springframework.jdbc.support.incrementer.AbstractSequenceMaxValueIncrementer
Convenience constructor.
AbstractServiceLoaderBasedFactoryBean - Class in org.springframework.beans.factory.serviceloader
Abstract base class for FactoryBeans operating on the JDK 1.6 ServiceLoader facility.
AbstractServiceLoaderBasedFactoryBean() - Constructor for class org.springframework.beans.factory.serviceloader.AbstractServiceLoaderBasedFactoryBean
AbstractSessionBean - Class in org.springframework.ejb.support
Base class for Spring-based EJB 2.x session beans.
AbstractSessionBean() - Constructor for class org.springframework.ejb.support.AbstractSessionBean
AbstractSessionFactoryBean - Class in org.springframework.orm.hibernate3
Abstract FactoryBean that creates a Hibernate SessionFactory within a Spring application context, providing general infrastructure not related to Hibernate's specific configuration API.
AbstractSessionFactoryBean() - Constructor for class org.springframework.orm.hibernate3.AbstractSessionFactoryBean
AbstractSimpleBeanDefinitionParser - Class in org.springframework.beans.factory.xml
Convenient base class for when there exists a one-to-one mapping between attribute names on the element that is to be parsed and the property names on the Class being configured.
AbstractSimpleBeanDefinitionParser() - Constructor for class org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser
AbstractSingleBeanDefinitionParser - Class in org.springframework.beans.factory.xml
Base class for those BeanDefinitionParser implementations that need to parse and define just a single BeanDefinition.
AbstractSingleBeanDefinitionParser() - Constructor for class org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
AbstractSingleCheckedElementTag - Class in org.springframework.web.servlet.tags.form
Abstract base class to provide common methods for implementing databinding-aware JSP tags for rendering a single HTML 'input' element with a 'type' of 'checkbox' or 'radio'.
AbstractSingleCheckedElementTag() - Constructor for class org.springframework.web.servlet.tags.form.AbstractSingleCheckedElementTag
AbstractSingleSpringContextTests - Class in org.springframework.test
Deprecated. as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)
AbstractSingleSpringContextTests() - Constructor for class org.springframework.test.AbstractSingleSpringContextTests
Deprecated. Default constructor for AbstractSingleSpringContextTests.
AbstractSingleSpringContextTests(String) - Constructor for class org.springframework.test.AbstractSingleSpringContextTests
Deprecated. Constructor for AbstractSingleSpringContextTests with a JUnit name.
AbstractSingletonProxyFactoryBean - Class in org.springframework.aop.framework
Convenient proxy factory bean superclass for proxy factory beans that create only singletons.
AbstractSingletonProxyFactoryBean() - Constructor for class org.springframework.aop.framework.AbstractSingletonProxyFactoryBean
AbstractSlsbInvokerInterceptor - Class in org.springframework.ejb.access
Base class for AOP interceptors invoking local or remote Stateless Session Beans.
AbstractSlsbInvokerInterceptor() - Constructor for class org.springframework.ejb.access.AbstractSlsbInvokerInterceptor
AbstractSpringContextTests - Class in org.springframework.test
Deprecated. as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)
AbstractSpringContextTests() - Constructor for class org.springframework.test.AbstractSpringContextTests
Deprecated. Default constructor for AbstractSpringContextTests.
AbstractSpringContextTests(String) - Constructor for class org.springframework.test.AbstractSpringContextTests
Deprecated. Constructor for AbstractSpringContextTests with a JUnit name.
AbstractSpringPreparerFactory - Class in org.springframework.web.servlet.view.tiles2
Abstract implementation of the Tiles2 PreparerFactory interface, obtaining the current Spring WebApplicationContext and delegating to AbstractSpringPreparerFactory.getPreparer(String, org.springframework.web.context.WebApplicationContext).
AbstractSpringPreparerFactory() - Constructor for class org.springframework.web.servlet.view.tiles2.AbstractSpringPreparerFactory
AbstractSqlParameterSource - Class in org.springframework.jdbc.core.namedparam
Abstract base class for SqlParameterSource implementations.
AbstractSqlParameterSource() - Constructor for class org.springframework.jdbc.core.namedparam.AbstractSqlParameterSource
AbstractSqlTypeValue - Class in org.springframework.jdbc.core.support
Abstract implementation of the SqlTypeValue interface, for convenient creation of type values that are supposed to be passed into the PreparedStatement.setObject method.
AbstractSqlTypeValue() - Constructor for class org.springframework.jdbc.core.support.AbstractSqlTypeValue
AbstractStatefulSessionBean - Class in org.springframework.ejb.support
Convenient base class for EJB 2.x stateful session beans (SFSBs).
AbstractStatefulSessionBean() - Constructor for class org.springframework.ejb.support.AbstractStatefulSessionBean
AbstractStatelessSessionBean - Class in org.springframework.ejb.support
Convenient base class for EJB 2.x stateless session beans (SLSBs), minimizing the work involved in implementing an SLSB and preventing common errors.
AbstractStatelessSessionBean() - Constructor for class org.springframework.ejb.support.AbstractStatelessSessionBean
AbstractTemplateView - Class in org.springframework.web.servlet.view
Adapter base class for template-based view technologies such as Velocity and FreeMarker, with the ability to use request and session attributes in their model and the option to expose helper objects for Spring's Velocity/FreeMarker macro library.
AbstractTemplateView() - Constructor for class org.springframework.web.servlet.view.AbstractTemplateView
AbstractTemplateViewResolver - Class in org.springframework.web.servlet.view
Abstract base class for template view resolvers, in particular for Velocity and FreeMarker views.
AbstractTemplateViewResolver() - Constructor for class org.springframework.web.servlet.view.AbstractTemplateViewResolver
AbstractTestExecutionListener - Class in org.springframework.test.context.support
Abstract implementation of the TestExecutionListener interface which provides empty method stubs.
AbstractTestExecutionListener() - Constructor for class org.springframework.test.context.support.AbstractTestExecutionListener
AbstractTestNGSpringContextTests - Class in org.springframework.test.context.testng
Abstract base test class which integrates the Spring TestContext Framework with explicit ApplicationContext testing support in a TestNG environment.
AbstractTestNGSpringContextTests() - Constructor for class org.springframework.test.context.testng.AbstractTestNGSpringContextTests
Construct a new AbstractTestNGSpringContextTests instance and initialize the internal TestContextManager for the current test.
AbstractThemeResolver - Class in org.springframework.web.servlet.theme
Abstract base class for ThemeResolver implementations.
AbstractThemeResolver() - Constructor for class org.springframework.web.servlet.theme.AbstractThemeResolver
AbstractTraceInterceptor - Class in org.springframework.aop.interceptor
Base MethodInterceptor implementation for tracing.
AbstractTraceInterceptor() - Constructor for class org.springframework.aop.interceptor.AbstractTraceInterceptor
AbstractTransactionalDataSourceSpringContextTests - Class in org.springframework.test
Deprecated. as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)
AbstractTransactionalDataSourceSpringContextTests() - Constructor for class org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
Deprecated. Default constructor for AbstractTransactionalDataSourceSpringContextTests.
AbstractTransactionalDataSourceSpringContextTests(String) - Constructor for class org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
Deprecated. Constructor for AbstractTransactionalDataSourceSpringContextTests with a JUnit name.
AbstractTransactionalJUnit38SpringContextTests - Class in org.springframework.test.context.junit38
Abstract transactional extension of AbstractJUnit38SpringContextTests which adds convenience functionality for JDBC access.
AbstractTransactionalJUnit38SpringContextTests() - Constructor for class org.springframework.test.context.junit38.AbstractTransactionalJUnit38SpringContextTests
Constructs a new AbstractTransactionalJUnit38SpringContextTests instance.
AbstractTransactionalJUnit38SpringContextTests(String) - Constructor for class org.springframework.test.context.junit38.AbstractTransactionalJUnit38SpringContextTests
Constructs a new AbstractTransactionalJUnit38SpringContextTests instance with the supplied name.
AbstractTransactionalJUnit4SpringContextTests - Class in org.springframework.test.context.junit4
Abstract transactional extension of AbstractJUnit4SpringContextTests which adds convenience functionality for JDBC access.
AbstractTransactionalJUnit4SpringContextTests() - Constructor for class org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests
AbstractTransactionalSpringContextTests - Class in org.springframework.test
Deprecated. as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)
AbstractTransactionalSpringContextTests() - Constructor for class org.springframework.test.AbstractTransactionalSpringContextTests
Deprecated. Default constructor for AbstractTransactionalSpringContextTests.
AbstractTransactionalSpringContextTests(String) - Constructor for class org.springframework.test.AbstractTransactionalSpringContextTests
Deprecated. Constructor for AbstractTransactionalSpringContextTests with a JUnit name.
AbstractTransactionalTestNGSpringContextTests - Class in org.springframework.test.context.testng
Abstract transactional extension of AbstractTestNGSpringContextTests which adds convenience functionality for JDBC access.
AbstractTransactionalTestNGSpringContextTests() - Constructor for class org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests
AbstractTransactionStatus - Class in org.springframework.transaction.support
Abstract base implementation of the TransactionStatus interface.
AbstractTransactionStatus() - Constructor for class org.springframework.transaction.support.AbstractTransactionStatus
AbstractTypeHierarchyTraversingFilter - Class in org.springframework.core.type.filter
Type filter that is aware of traversing over hierarchy.
AbstractTypeHierarchyTraversingFilter(boolean, boolean) - Constructor for class org.springframework.core.type.filter.AbstractTypeHierarchyTraversingFilter
AbstractUrlBasedView - Class in org.springframework.web.servlet.view
Abstract base class for URL-based views.
AbstractUrlBasedView() - Constructor for class org.springframework.web.servlet.view.AbstractUrlBasedView
Constructor for use as a bean.
AbstractUrlBasedView(String) - Constructor for class org.springframework.web.servlet.view.AbstractUrlBasedView
Create a new AbstractUrlBasedView with the given URL.
AbstractUrlHandlerMapping - Class in org.springframework.web.servlet.handler
Abstract base class for URL-mapped HandlerMapping implementations.
AbstractUrlHandlerMapping() - Constructor for class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
AbstractUrlMethodNameResolver - Class in org.springframework.web.servlet.mvc.multiaction
Abstract base class for URL-based MethodNameResolver implementations.
AbstractUrlMethodNameResolver() - Constructor for class org.springframework.web.servlet.mvc.multiaction.AbstractUrlMethodNameResolver
AbstractUrlViewController - Class in org.springframework.web.servlet.mvc
Abstract base class for Controllers that return a view name based on the request URL.
AbstractUrlViewController() - Constructor for class org.springframework.web.servlet.mvc.AbstractUrlViewController
AbstractView - Class in org.springframework.web.servlet.view
Abstract base class for View implementations.
AbstractView() - Constructor for class org.springframework.web.servlet.view.AbstractView
AbstractWireFeedHttpMessageConverter<T extends com.sun.syndication.feed.WireFeed> - Class in org.springframework.http.converter.feed
Abstract base class for Atom and RSS Feed message converters, using java.net's ROME package.
AbstractWireFeedHttpMessageConverter(MediaType) - Constructor for class org.springframework.http.converter.feed.AbstractWireFeedHttpMessageConverter
AbstractWizardFormController - Class in org.springframework.web.portlet.mvc
Deprecated. as of Spring 3.0, in favor of annotated controllers
AbstractWizardFormController() - Constructor for class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Create a new AbstractWizardFormController.
AbstractWizardFormController - Class in org.springframework.web.servlet.mvc
Deprecated. as of Spring 3.0, in favor of annotated controllers
AbstractWizardFormController() - Constructor for class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Create a new AbstractWizardFormController.
AbstractXmlApplicationContext - Class in org.springframework.context.support
Convenient base class for ApplicationContext implementations, drawing configuration from XML documents containing bean definitions understood by an XmlBeanDefinitionReader.
AbstractXmlApplicationContext() - Constructor for class org.springframework.context.support.AbstractXmlApplicationContext
Create a new AbstractXmlApplicationContext with no parent.
AbstractXmlApplicationContext(ApplicationContext) - Constructor for class org.springframework.context.support.AbstractXmlApplicationContext
Create a new AbstractXmlApplicationContext with the given parent context.
AbstractXmlHttpMessageConverter<T> - Class in org.springframework.http.converter.xml
Abstract base class for HttpMessageConverters that convert from/to XML.
AbstractXmlHttpMessageConverter() - Constructor for class org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter
Protected constructor that sets the supportedMediaTypes to text/xml and application/xml, and application/*-xml.
AbstractXsltView - Class in org.springframework.web.servlet.view.xslt
Deprecated. since Spring 2.5; superseded by XsltView and its more flexible XsltView.locateSource(java.util.Map) mechanism
AbstractXsltView() - Constructor for class org.springframework.web.servlet.view.xslt.AbstractXsltView
Deprecated. This constructor sets the content type to "text/xml;charset=ISO-8859-1" by default.
acceptClassLoader(ClassLoader) - Static method in class org.springframework.beans.CachedIntrospectionResults
Accept the given ClassLoader as cache-safe, even if its classes would not qualify as cache-safe in this CachedIntrospectionResults class.
AcceptHeaderLocaleResolver - Class in org.springframework.web.servlet.i18n
Implementation of LocaleResolver that simply uses the primary locale specified in the "accept-language" header of the HTTP request (that is, the locale sent by the client browser, normally that of the client's OS).
AcceptHeaderLocaleResolver() - Constructor for class org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver
access() - Method in class org.springframework.mock.web.MockHttpSession
access() - Method in class org.springframework.mock.web.portlet.MockPortletSession
AccessException - Exception in org.springframework.expression
An AccessException is thrown by an accessor if it has an unexpected problem.
AccessException(String, Exception) - Constructor for exception org.springframework.expression.AccessException
Create an AccessException with a specific message and cause.
AccessException(String) - Constructor for exception org.springframework.expression.AccessException
Create an AccessException with a specific message.
ACCESSKEY_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
The name of the 'accesskey' attribute.
ACTION_EXCEPTION_RENDER_PARAMETER - Static variable in class org.springframework.web.portlet.DispatcherPortlet
This render parameter is used to indicate forward to the render phase that an exception occurred during the action phase.
ACTION_EXCEPTION_SESSION_ATTRIBUTE - Static variable in class org.springframework.web.portlet.DispatcherPortlet
Unlike the Servlet version of this class, we have to deal with the two-phase nature of the portlet request.
ActionMapping - Annotation Type in org.springframework.web.portlet.bind.annotation
Annotation for mapping Portlet action requests onto handler methods.
ActionSupport - Class in org.springframework.web.struts
Deprecated. as of Spring 3.0
ActionSupport() - Constructor for class org.springframework.web.struts.ActionSupport
Deprecated.
activate() - Method in class org.springframework.mock.jndi.SimpleNamingContextBuilder
Register the context builder by registering it with the JNDI NamingManager.
activated(AdvisedSupport) - Method in interface org.springframework.aop.framework.AdvisedSupportListener
Invoked when the first proxy is created.
activateObject(Object) - Method in class org.springframework.aop.target.CommonsPoolTargetSource
AdaptableJobFactory - Class in org.springframework.scheduling.quartz
JobFactory implementation that supports Runnable objects as well as standard Quartz Job instances.
AdaptableJobFactory() - Constructor for class org.springframework.scheduling.quartz.AdaptableJobFactory
adaptInterceptor(Object) - Method in class org.springframework.web.portlet.handler.AbstractHandlerMapping
Adapt the given interceptor object to the HandlerInterceptor interface.
adaptInterceptor(Object) - Method in class org.springframework.web.servlet.handler.AbstractHandlerMapping
Adapt the given interceptor object to the HandlerInterceptor interface.
adaptJob(Object) - Method in class org.springframework.scheduling.quartz.AdaptableJobFactory
Adapt the given job object to the Quartz Job interface.
adaptMBeanIfPossible(Object) - Method in class org.springframework.jmx.export.MBeanExporter
Build an adapted MBean for the given bean instance, if possible.
add(String, Object) - Method in class org.springframework.beans.MutablePropertyValues
Add a PropertyValue object, replacing any existing one for the corresponding property or getting merged with it (if applicable).
add(String, String) - Method in class org.springframework.http.HttpHeaders
Add the given, single header value under the given name.
add(int, E) - Method in class org.springframework.util.AutoPopulatingList
add(E) - Method in class org.springframework.util.AutoPopulatingList
add(Iterator<E>) - Method in class org.springframework.util.CompositeIterator
Add given iterator to this composite.
add(K, V) - Method in class org.springframework.util.LinkedMultiValueMap
add(K, V) - Method in interface org.springframework.util.MultiValueMap
Add the given single value to the current list of values for the given key.
addAdvice(Advice) - Method in interface org.springframework.aop.framework.Advised
Add the given AOP Alliance advice to the tail of the advice (interceptor) chain.
addAdvice(int, Advice) - Method in interface org.springframework.aop.framework.Advised
Add the given AOP Alliance Advice at the specified position in the advice chain.
addAdvice(Advice) - Method in class org.springframework.aop.framework.AdvisedSupport
addAdvice(int, Advice) - Method in class org.springframework.aop.framework.AdvisedSupport
Cannot add introductions this way unless the advice implements IntroductionInfo.
addAdvisor(Advisor) - Method in interface org.springframework.aop.framework.Advised
Add an advisor at the end of the advisor chain.
addAdvisor(int, Advisor) - Method in interface org.springframework.aop.framework.Advised
Add an Advisor at the specified position in the chain.
addAdvisor(Advisor) - Method in class org.springframework.aop.framework.AdvisedSupport
addAdvisor(int, Advisor) - Method in class org.springframework.aop.framework.AdvisedSupport
addAdvisors(Advisor...) - Method in class org.springframework.aop.framework.AdvisedSupport
Add all of the given advisors to this proxy configuration.
addAdvisors(Collection<Advisor>) - Method in class org.springframework.aop.framework.AdvisedSupport
Add all of the given advisors to this proxy configuration.
addAll(Collection<? extends E>) - Method in class org.springframework.util.AutoPopulatingList
addAll(int, Collection<? extends E>) - Method in class org.springframework.util.AutoPopulatingList
addAllAdvisors(Advisor[]) - Method in class org.springframework.aop.framework.AdvisedSupport
Deprecated. as of Spring 3.0, in favor of AdvisedSupport.addAdvisors(org.springframework.aop.Advisor...)
addAllAttributes(Collection<?>) - Method in class org.springframework.ui.ExtendedModelMap
addAllAttributes(Map<String, ?>) - Method in class org.springframework.ui.ExtendedModelMap
addAllAttributes(Collection<?>) - Method in interface org.springframework.ui.Model
Copy all attributes in the supplied Collection into this Map, using attribute name generation for each element.
addAllAttributes(Map<String, ?>) - Method in interface org.springframework.ui.Model
Copy all attributes in the supplied Map into this Map.
addAllAttributes(Collection<?>) - Method in class org.springframework.ui.ModelMap
Copy all attributes in the supplied Collection into this Map, using attribute name generation for each element.
addAllAttributes(Map<String, ?>) - Method in class org.springframework.ui.ModelMap
Copy all attributes in the supplied Map into this Map.
addAllErrors(Errors) - Method in class org.springframework.validation.AbstractBindingResult
addAllErrors(Errors) - Method in exception org.springframework.validation.BindException
addAllErrors(Errors) - Method in interface org.springframework.validation.Errors
Add all errors from the given Errors instance to this Errors instance.
addAllErrors(Errors) - Method in class org.springframework.web.bind.EscapedErrors
addAllObjects(Collection) - Method in class org.springframework.ui.ModelMap
Deprecated. as of Spring 2.5, in favor of ModelMap.addAllAttributes(Collection)
addAllObjects(Map) - Method in class org.springframework.ui.ModelMap
Deprecated. as of Spring 2.5, in favor of ModelMap.addAllAttributes(Map)
addAllObjects(Map<String, ?>) - Method in class org.springframework.web.portlet.ModelAndView
Add all attributes contained in the provided Map to the model.
addAllObjects(Map<String, ?>) - Method in class org.springframework.web.servlet.ModelAndView
Add all attributes contained in the provided Map to the model.
addApplicationListener(ApplicationListener) - Method in interface org.springframework.context.ConfigurableApplicationContext
Add a new ApplicationListener that will be notified on context events such as context refresh and context shutdown.
addApplicationListener(ApplicationListener) - Method in class org.springframework.context.event.AbstractApplicationEventMulticaster
addApplicationListener(ApplicationListener) - Method in interface org.springframework.context.event.ApplicationEventMulticaster
Add a listener to be notified of all events.
addApplicationListener(ApplicationListener) - Method in class org.springframework.context.support.AbstractApplicationContext
addApplicationListenerBean(String) - Method in class org.springframework.context.event.AbstractApplicationEventMulticaster
addApplicationListenerBean(String) - Method in interface org.springframework.context.event.ApplicationEventMulticaster
Add a listener bean to be notified of all events.
addArgumentValues(ConstructorArgumentValues) - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues
Copy all given argument values into this object, using separate holder instances to keep the values independent from the original object.
addAspect(Object) - Method in class org.springframework.aop.aspectj.annotation.AspectJProxyFactory
Add the supplied aspect instance to the chain.
addAspect(Class) - Method in class org.springframework.aop.aspectj.annotation.AspectJProxyFactory
Add an aspect of the supplied type to the end of the advice chain.
addAttachment(String, DataSource) - Method in class org.springframework.mail.javamail.MimeMessageHelper
Add an attachment to the MimeMessage, taking the content from a javax.activation.DataSource.
addAttachment(String, File) - Method in class org.springframework.mail.javamail.MimeMessageHelper
Add an attachment to the MimeMessage, taking the content from a java.io.File.
addAttachment(String, InputStreamSource) - Method in class org.springframework.mail.javamail.MimeMessageHelper
Add an attachment to the MimeMessage, taking the content from an org.springframework.core.io.InputStreamResource.
addAttachment(String, InputStreamSource, String) - Method in class org.springframework.mail.javamail.MimeMessageHelper
Add an attachment to the MimeMessage, taking the content from an org.springframework.core.io.InputStreamResource.
addAttachment(String, DataHandler) - Method in interface org.springframework.oxm.mime.MimeContainer
Add the given data handler as an attachment to this container.
addAttribute(String, Serializable) - Method in class org.springframework.remoting.support.RemoteInvocation
Add an additional invocation attribute.
addAttribute(String, Object) - Method in class org.springframework.ui.ExtendedModelMap
addAttribute(Object) - Method in class org.springframework.ui.ExtendedModelMap
addAttribute(String, Object) - Method in interface org.springframework.ui.Model
Add the supplied attribute under the supplied name.
addAttribute(Object) - Method in interface org.springframework.ui.Model
Add the supplied attribute to this Map using a generated name.
addAttribute(String, Object) - Method in class org.springframework.ui.ModelMap
Add the supplied attribute under the supplied name.
addAttribute(Object) - Method in class org.springframework.ui.ModelMap
Add the supplied attribute to this Map using a generated name.
addBcc(InternetAddress) - Method in class org.springframework.mail.javamail.MimeMessageHelper
addBcc(String) - Method in class org.springframework.mail.javamail.MimeMessageHelper
addBcc(String, String) - Method in class org.springframework.mail.javamail.MimeMessageHelper
addBean(String, Object) - Method in class org.springframework.beans.factory.support.StaticListableBeanFactory
Add a new singleton bean.
addBeanFactoryPostProcessor(BeanFactoryPostProcessor) - Method in interface org.springframework.context.ConfigurableApplicationContext
Add a new BeanFactoryPostProcessor that will get applied to the internal bean factory of this application context on refresh, before any of the bean definitions get evaluated.
addBeanFactoryPostProcessor(BeanFactoryPostProcessor) - Method in class org.springframework.context.support.AbstractApplicationContext
addBeanPostProcessor(BeanPostProcessor) - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Add a new BeanPostProcessor that will get applied to beans created by this factory.
addBeanPostProcessor(BeanPostProcessor) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
addCc(InternetAddress) - Method in class org.springframework.mail.javamail.MimeMessageHelper
addCc(String) - Method in class org.springframework.mail.javamail.MimeMessageHelper
addCc(String, String) - Method in class org.springframework.mail.javamail.MimeMessageHelper
addComparator(Comparator<T>) - Method in class org.springframework.util.comparator.CompoundComparator
Add a Comparator to the end of the chain.
addComparator(Comparator<T>, boolean) - Method in class org.springframework.util.comparator.CompoundComparator
Add a Comparator to the end of the chain using the provided sort order.
addConnection(Connection) - Method in class org.springframework.jms.connection.JmsResourceHolder
addConstructorArg(Object) - Method in class org.springframework.beans.factory.support.BeanDefinitionBuilder
Deprecated. since Spring 2.5, in favor of BeanDefinitionBuilder.addConstructorArgValue(java.lang.Object)
addConstructorArgReference(String) - Method in class org.springframework.beans.factory.support.BeanDefinitionBuilder
Add a reference to a named bean as a constructor arg.
addConstructorArgValue(Object) - Method in class org.springframework.beans.factory.support.BeanDefinitionBuilder
Add an indexed constructor arg value.
addConstructorResolver(ConstructorResolver) - Method in class org.springframework.expression.spel.support.StandardEvaluationContext
addContainerRuntimeOption(String, String) - Method in class org.springframework.mock.web.portlet.MockPortletConfig
addContainerRuntimeOption(String, String[]) - Method in class org.springframework.mock.web.portlet.MockPortletConfig
addContainerRuntimeOption(String) - Method in class org.springframework.mock.web.portlet.MockPortletContext
addContext(Object, ConfigurableApplicationContext) - Method in class org.springframework.test.AbstractSpringContextTests
Deprecated. Explicitly add an ApplicationContext instance under a given key.
addConverter(Converter<?, ?>) - Method in interface org.springframework.core.convert.converter.ConverterRegistry
Add a plain converter to this registry.
addConverter(GenericConverter) - Method in interface org.springframework.core.convert.converter.ConverterRegistry
Add a generic converter to this registry.
addConverter(GenericConverter) - Method in class org.springframework.core.convert.support.GenericConversionService
addConverter(Converter<?, ?>) - Method in class org.springframework.core.convert.support.GenericConversionService
addConverterFactory(ConverterFactory<?, ?>) - Method in interface org.springframework.core.convert.converter.ConverterRegistry
Add a ranged converter factory to this registry.
addConverterFactory(ConverterFactory<?, ?>) - Method in class org.springframework.core.convert.support.GenericConversionService
addCookie(Cookie) - Method in class org.springframework.mock.web.MockHttpServletResponse
addCookie(HttpServletResponse, String) - Method in class org.springframework.web.util.CookieGenerator
Add a cookie with the given value to the response, using the cookie descriptor settings of this generator.
addCustomProperty(String, Object) - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Add a custom property to this JAX-RPC Stub/Call.
addCustomProperty(String, Object) - Method in class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
Add a custom property to this JAX-WS BindingProvider.
addDataSource(String, DataSource) - Method in class org.springframework.jdbc.datasource.lookup.MapDataSourceLookup
Add the supplied DataSource to the map of DataSources maintained by this object.
addDateHeader(String, long) - Method in class org.springframework.mock.web.MockHttpServletResponse
addDeclaredParameter(SqlParameter) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Add a declared parameter to the list of parameters for the call.
addDeclaredRowMapper(String, RowMapper) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Add a RowMapper for the specified parameter or column.
addDeclaredRowMapper(String, ParameterizedRowMapper) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Deprecated. in favor of AbstractJdbcCall.addDeclaredRowMapper(String, org.springframework.jdbc.core.RowMapper)
addDefaultConverters(GenericConversionService) - Static method in class org.springframework.core.convert.support.ConversionServiceFactory
Populate the given ConversionService instance with all applicable default converters.
addDefaultScripts() - Method in class org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder
Add default scripts to execute to populate the database.
addDelegate(PersistenceExceptionTranslator) - Method in class org.springframework.dao.support.ChainedPersistenceExceptionTranslator
Add a PersistenceExceptionTranslator to the chained delegate list.
addDelegate(ExceptionListener) - Method in class org.springframework.jms.connection.ChainedExceptionListener
Add an ExceptionListener to the chained delegate list.
addDependsOn(String) - Method in class org.springframework.beans.factory.support.BeanDefinitionBuilder
Append the specified bean name to the list of beans that this definition depends on.
addDiscoverer(ParameterNameDiscoverer) - Method in class org.springframework.core.PrioritizedParameterNameDiscoverer
Add a further ParameterNameDiscoverer to the list of discoverers that this PrioritizedParameterNameDiscoverer checks.
addEmbeddedValueResolver(StringValueResolver) - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Add a String resolver for embedded values such as annotation attributes.
addEmbeddedValueResolver(StringValueResolver) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
addError(ObjectError) - Method in class org.springframework.validation.AbstractBindingResult
addError(ObjectError) - Method in exception org.springframework.validation.BindException
addError(ObjectError) - Method in interface org.springframework.validation.BindingResult
Add a custom ObjectError or FieldError to the errors list.
addExcludeFilter(TypeFilter) - Method in class org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider
Add an exclude type filter to the front of the exclusion list.
addFile(MultipartFile) - Method in class org.springframework.mock.web.MockMultipartHttpServletRequest
Add a file to this request.
addFile(MultipartFile) - Method in class org.springframework.mock.web.portlet.MockMultipartActionRequest
Add a file to this request.
addFormatterForFieldAnnotation(AnnotationFormatterFactory<? extends Annotation>) - Method in interface org.springframework.format.FormatterRegistry
Adds a Formatter to format fields annotated with a specific format annotation.
addFormatterForFieldAnnotation(AnnotationFormatterFactory) - Method in class org.springframework.format.support.FormattingConversionService
addFormatterForFieldType(Class<?>, Formatter<?>) - Method in interface org.springframework.format.FormatterRegistry
Adds a Formatter to format fields of a specific type.
addFormatterForFieldType(Class<?>, Printer<?>, Parser<?>) - Method in interface org.springframework.format.FormatterRegistry
Adds a Printer/Parser pair to format fields of a specific type.
addFormatterForFieldType(Class<?>, Formatter<?>) - Method in class org.springframework.format.support.FormattingConversionService
addFormatterForFieldType(Class<?>, Printer<?>, Parser<?>) - Method in class org.springframework.format.support.FormattingConversionService
addGenericArgumentValue(Object) - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues
Add a generic argument value to be matched by type.
addGenericArgumentValue(Object, String) - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues
Add a generic argument value to be matched by type.
addGenericArgumentValue(ConstructorArgumentValues.ValueHolder) - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues
Add a generic argument value to be matched by type or name (if available).
addHeader(String, Object) - Method in class org.springframework.mock.web.MockHttpServletRequest
Add a header entry for the given name.
addHeader(String, String) - Method in class org.springframework.mock.web.MockHttpServletResponse
addIncludeFilter(TypeFilter) - Method in class org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider
Add an include type filter to the end of the inclusion list.
addIndexedArgumentValue(int, Object) - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues
Add an argument value for the given index in the constructor argument list.
addIndexedArgumentValue(int, Object, String) - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues
Add an argument value for the given index in the constructor argument list.
addIndexedArgumentValue(int, ConstructorArgumentValues.ValueHolder) - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues
Add an argument value for the given index in the constructor argument list.
addInitParameter(String, String) - Method in class org.springframework.mock.web.MockFilterConfig
addInitParameter(String, String) - Method in class org.springframework.mock.web.MockServletConfig
addInitParameter(String, String) - Method in class org.springframework.mock.web.MockServletContext
addInitParameter(String, String) - Method in class org.springframework.mock.web.portlet.MockPortletConfig
addInitParameter(String, String) - Method in class org.springframework.mock.web.portlet.MockPortletContext
addInline(String, DataSource) - Method in class org.springframework.mail.javamail.MimeMessageHelper
Add an inline element to the MimeMessage, taking the content from a javax.activation.DataSource.
addInline(String, File) - Method in class org.springframework.mail.javamail.MimeMessageHelper
Add an inline element to the MimeMessage, taking the content from a java.io.File.
addInline(String, Resource) - Method in class org.springframework.mail.javamail.MimeMessageHelper
Add an inline element to the MimeMessage, taking the content from a org.springframework.core.io.Resource.
addInline(String, InputStreamSource, String) - Method in class org.springframework.mail.javamail.MimeMessageHelper
Add an inline element to the MimeMessage, taking the content from an org.springframework.core.InputStreamResource, and specifying the content type explicitly.
addInterceptor(HandlerInterceptor) - Method in class org.springframework.web.portlet.HandlerExecutionChain
addInterceptor(HandlerInterceptor) - Method in class org.springframework.web.servlet.HandlerExecutionChain
addInterceptors(HandlerInterceptor[]) - Method in class org.springframework.web.portlet.HandlerExecutionChain
addInterceptors(HandlerInterceptor[]) - Method in class org.springframework.web.servlet.HandlerExecutionChain
addInterface(Class) - Method in class org.springframework.aop.framework.AdvisedSupport
Add a new proxied interface.
addInterface(Class) - Method in class org.springframework.aop.support.DefaultIntroductionAdvisor
Add the specified interface to the list of interfaces to introduce.
addIntHeader(String, int) - Method in class org.springframework.mock.web.MockHttpServletResponse
addJarFileUrl(URL) - Method in class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo
addListener(AdvisedSupportListener) - Method in class org.springframework.aop.framework.ProxyCreatorSupport
Add the given AdvisedSupportListener to this proxy configuration.
addListener(ApplicationListener) - Method in class org.springframework.context.support.AbstractApplicationContext
Deprecated. as of Spring 3.0, in favor of AbstractApplicationContext.addApplicationListener(org.springframework.context.ApplicationListener)
addLocale(Locale) - Method in class org.springframework.mock.web.portlet.MockPortletRequest
addManagedClassName(String) - Method in class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo
addMappingFileName(String) - Method in class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo
addMessage(String, Locale, String) - Method in class org.springframework.context.support.StaticApplicationContext
Associate the given message with the given code.
addMessage(String, Locale, String) - Method in class org.springframework.context.support.StaticMessageSource
Associate the given message with the given code.
addMessages(Map<String, String>, Locale) - Method in class org.springframework.context.support.StaticMessageSource
Associate the given message values with the given keys as codes.
addMetadataAttribute(BeanMetadataAttribute) - Method in class org.springframework.beans.BeanMetadataAttributeAccessor
Add the given BeanMetadataAttribute to this accessor's set of attributes.
addMethodName(String) - Method in class org.springframework.aop.support.NameMatchMethodPointcut
Add another eligible method name, in addition to those already named.
addMethodName(String) - Method in class org.springframework.aop.support.NameMatchMethodPointcutAdvisor
Add another eligible method name, in addition to those already named.
addMethodResolver(MethodResolver) - Method in class org.springframework.expression.spel.support.StandardEvaluationContext
addNestedComponent(ComponentDefinition) - Method in class org.springframework.beans.factory.parsing.CompositeComponentDefinition
Add the given component as nested element of this composite component.
addObject(String, Object) - Method in class org.springframework.mock.jndi.ExpectedLookupTemplate
Add the given object to the list of JNDI objects that this template will expose.
addObject(String, Object) - Method in class org.springframework.ui.ModelMap
Deprecated. as of Spring 2.5, in favor of ModelMap.addAttribute(String, Object)
addObject(Object) - Method in class org.springframework.ui.ModelMap
Deprecated. as of Spring 2.5, in favor of ModelMap.addAttribute(Object)
addObject(String, Object) - Method in class org.springframework.web.portlet.ModelAndView
Add an attribute to the model.
addObject(Object) - Method in class org.springframework.web.portlet.ModelAndView
Add an attribute to the model using parameter name generation.
addObject(String, Object) - Method in class org.springframework.web.servlet.ModelAndView
Add an attribute to the model.
addObject(Object) - Method in class org.springframework.web.servlet.ModelAndView
Add an attribute to the model using parameter name generation.
addObjectToArray(Object[], Object) - Static method in class org.springframework.util.ObjectUtils
Append the given Object to the given array, returning a new array consisting of the input array contents plus the given Object.
addOverride(MethodOverride) - Method in class org.springframework.beans.factory.support.MethodOverrides
Add the given method override.
addOverrides(MethodOverrides) - Method in class org.springframework.beans.factory.support.MethodOverrides
Copy all given method overrides into this object.
addParam(Param) - Method in interface org.springframework.web.servlet.tags.ParamAware
Callback hook for nested spring:param tags to pass their value to the parent tag.
addParam(Param) - Method in class org.springframework.web.servlet.tags.UrlTag
addParameter(SqlParameter) - Method in class org.springframework.jdbc.core.CallableStatementCreatorFactory
Add a new declared parameter.
addParameter(SqlParameter) - Method in class org.springframework.jdbc.core.PreparedStatementCreatorFactory
Add a new declared parameter.
addParameter(String, String) - Method in class org.springframework.mock.web.MockHttpServletRequest
Add a single value for the specified HTTP parameter.
addParameter(String, String[]) - Method in class org.springframework.mock.web.MockHttpServletRequest
Add an array of values for the specified HTTP parameter.
addParameter(String, String) - Method in class org.springframework.mock.web.portlet.MockPortletRequest
addParameter(String, String[]) - Method in class org.springframework.mock.web.portlet.MockPortletRequest
addParameters(Map) - Method in class org.springframework.mock.web.MockHttpServletRequest
Adds all provided parameters without replacing any existing values.
addPreferredLocale(Locale) - Method in class org.springframework.mock.web.MockHttpServletRequest
Add a new preferred locale, before any existing locales.
addPreferredLocale(Locale) - Method in class org.springframework.mock.web.portlet.MockPortletRequest
addPreferredResponseContentType(String) - Method in class org.springframework.mock.web.portlet.MockPortletRequest
addPrivateRenderParameter(String, String) - Method in class org.springframework.mock.web.portlet.MockResourceRequest
addPrivateRenderParameter(String, String[]) - Method in class org.springframework.mock.web.portlet.MockResourceRequest
addProcessingEventQName(QName) - Method in class org.springframework.mock.web.portlet.MockPortletConfig
addProperty(String, String) - Method in class org.springframework.mock.web.portlet.MockBaseURL
addProperty(String, String) - Method in class org.springframework.mock.web.portlet.MockPortletRequest
Add a single value for the specified property.
addProperty(String, String) - Method in class org.springframework.mock.web.portlet.MockPortletResponse
addProperty(Cookie) - Method in class org.springframework.mock.web.portlet.MockPortletResponse
addProperty(String, Element) - Method in class org.springframework.mock.web.portlet.MockPortletResponse
addProperty(String, String) - Method in class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo
addPropertyAccessor(PropertyAccessor) - Method in class org.springframework.expression.spel.support.StandardEvaluationContext
addPropertyEditorRegistrar(PropertyEditorRegistrar) - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Add a PropertyEditorRegistrar to be applied to all bean creation processes.
addPropertyEditorRegistrar(PropertyEditorRegistrar) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
addPropertyReference(String, String) - Method in class org.springframework.beans.factory.support.BeanDefinitionBuilder
Add a reference to the specified bean name under the property specified.
addPropertyValue(String, Object) - Method in class org.springframework.beans.factory.support.BeanDefinitionBuilder
Add the supplied property value under the given name.
addPropertyValue(PropertyValue) - Method in class org.springframework.beans.MutablePropertyValues
Add a PropertyValue object, replacing any existing one for the corresponding property or getting merged with it (if applicable).
addPropertyValue(String, Object) - Method in class org.springframework.beans.MutablePropertyValues
Overloaded version of addPropertyValue that takes a property name and a property value.
addPropertyValues(PropertyValues) - Method in class org.springframework.beans.MutablePropertyValues
Copy all given PropertyValues into this object.
addPropertyValues(Map<?, ?>) - Method in class org.springframework.beans.MutablePropertyValues
Add all property values from the given Map.
addPublicRenderParameterName(String) - Method in class org.springframework.mock.web.portlet.MockPortletConfig
addPublishingEventQName(QName) - Method in class org.springframework.mock.web.portlet.MockPortletConfig
addQualifier(AutowireCandidateQualifier) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Register a qualifier to be used for autowire candidate resolution, keyed by the qualifier's type name.
addQualifierType(Class<? extends Annotation>) - Method in class org.springframework.beans.factory.annotation.QualifierAnnotationAutowireCandidateResolver
Register the given type to be used as a qualifier when autowiring.
addRelatedCause(Throwable) - Method in exception org.springframework.beans.factory.BeanCreationException
Add a related cause to this bean creation exception, not being a direct cause of the failure but having occured earlier in the creation of the same bean instance.
addRequiredProperty(String) - Method in class org.springframework.web.filter.GenericFilterBean
Subclasses can invoke this method to specify that this property (which must match a JavaBean property they expose) is mandatory, and must be supplied as a config parameter.
addRequiredProperty(String) - Method in class org.springframework.web.portlet.GenericPortletBean
Subclasses can invoke this method to specify that this property (which must match a JavaBean property they expose) is mandatory, and must be supplied as a config parameter.
addRequiredProperty(String) - Method in class org.springframework.web.servlet.HttpServletBean
Subclasses can invoke this method to specify that this property (which must match a JavaBean property they expose) is mandatory, and must be supplied as a config parameter.
addResourcePathToPackagePath(Class<?>, String) - Static method in class org.springframework.util.ClassUtils
Return a path suitable for use with ClassLoader.getResource (also suitable for use with Class.getResource by prepending a slash ('/') to the return value).
addResponseContentType(String) - Method in class org.springframework.mock.web.portlet.MockPortletRequest
addReturnValueAsModelAttribute(Method, Class, Object, ExtendedModelMap) - Method in class org.springframework.web.bind.annotation.support.HandlerMethodInvoker
addScript(String) - Method in class org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder
Adds a SQL script to execute to populate the database.
addScript(Resource) - Method in class org.springframework.jdbc.datasource.init.ResourceDatabasePopulator
Add a script to execute to populate the database.
addSession(Session) - Method in class org.springframework.jms.connection.JmsResourceHolder
addSession(Session, Connection) - Method in class org.springframework.jms.connection.JmsResourceHolder
addSession(Session) - Method in class org.springframework.orm.hibernate3.SessionHolder
addSession(Object, Session) - Method in class org.springframework.orm.hibernate3.SessionHolder
addShareableResource(String) - Method in class org.springframework.jndi.support.SimpleJndiBeanFactory
Add the name of a shareable JNDI resource, which this factory is allowed to cache once obtained.
addSingleton(String, Object) - Method in class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
Add the given singleton object to the singleton cache of this factory.
addSingletonFactory(String, ObjectFactory) - Method in class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
Add the given singleton factory for building the specified singleton if necessary.
addStaticAttribute(String, Object) - Method in class org.springframework.web.servlet.view.AbstractView
Add static data to this view, exposed in each view.
addStringToArray(String[], String) - Static method in class org.springframework.util.StringUtils
Append the given String to the given String array, returning a new array consisting of the input array contents plus the given String.
addSupportedLocale(Locale) - Method in class org.springframework.mock.web.portlet.MockPortletConfig
addTo(InternetAddress) - Method in class org.springframework.mail.javamail.MimeMessageHelper
addTo(String) - Method in class org.springframework.mail.javamail.MimeMessageHelper
addTo(String, String) - Method in class org.springframework.mail.javamail.MimeMessageHelper
addToEnvironment(String, Object) - Method in class org.springframework.mock.jndi.SimpleNamingContext
addTransactionalMethod(String, TransactionAttribute) - Method in class org.springframework.transaction.interceptor.MethodMapTransactionAttributeSource
Add an attribute for a transactional method.
addTransactionalMethod(Class, String, TransactionAttribute) - Method in class org.springframework.transaction.interceptor.MethodMapTransactionAttributeSource
Add an attribute for a transactional method.
addTransactionalMethod(Method, TransactionAttribute) - Method in class org.springframework.transaction.interceptor.MethodMapTransactionAttributeSource
Add an attribute for a transactional method.
addTransactionalMethod(String, TransactionAttribute) - Method in class org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource
Add an attribute for a transactional method.
addTransformer(ClassFileTransformer) - Method in class org.springframework.context.weaving.DefaultContextLoadTimeWeaver
addTransformer(ClassFileTransformer) - Method in class org.springframework.instrument.classloading.glassfish.GlassFishLoadTimeWeaver
addTransformer(ClassFileTransformer) - Method in class org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver
addTransformer(ClassFileTransformer) - Method in class org.springframework.instrument.classloading.jboss.JBossLoadTimeWeaver
addTransformer(ClassFileTransformer) - Method in interface org.springframework.instrument.classloading.LoadTimeWeaver
Add a ClassFileTransformer to be applied by this LoadTimeWeaver.
addTransformer(ClassFileTransformer) - Method in class org.springframework.instrument.classloading.oc4j.OC4JLoadTimeWeaver
addTransformer(ClassFileTransformer) - Method in class org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver
addTransformer(ClassFileTransformer) - Method in class org.springframework.instrument.classloading.ShadowingClassLoader
Add the given ClassFileTransformer to the list of transformers that this ClassLoader will apply.
addTransformer(ClassFileTransformer) - Method in class org.springframework.instrument.classloading.SimpleInstrumentableClassLoader
Add a ClassFileTransformer to be applied by this ClassLoader.
addTransformer(ClassFileTransformer) - Method in class org.springframework.instrument.classloading.SimpleLoadTimeWeaver
addTransformer(ClassFileTransformer) - Method in class org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader
Delegate for LoadTimeWeaver's addTransformer method.
addTransformer(ClassFileTransformer) - Method in class org.springframework.instrument.classloading.WeavingTransformer
Add a class file transformer to be applied by this weaver.
addTransformer(ClassFileTransformer) - Method in class org.springframework.instrument.classloading.weblogic.WebLogicLoadTimeWeaver
addTransformer(ClassTransformer) - Method in class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo
This implementation throws an UnsupportedOperationException.
addTypeIdentifier(String) - Method in class org.springframework.beans.factory.support.ReplaceOverride
Add a fragment of a class string, like "Exception" or "java.lang.Exc", to identify a parameter type.
addUrlsForPath(Set<String>, String) - Method in class org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping
Add URLs and/or URL patterns for the given path.
addUserRole(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
addUserRole(String) - Method in class org.springframework.mock.web.portlet.MockPortletRequest
addValue(String, Object) - Method in class org.springframework.jdbc.core.namedparam.MapSqlParameterSource
Add a parameter to this parameter source.
addValue(String, Object, int) - Method in class org.springframework.jdbc.core.namedparam.MapSqlParameterSource
Add a parameter to this parameter source.
addValue(String, Object, int, String) - Method in class org.springframework.jdbc.core.namedparam.MapSqlParameterSource
Add a parameter to this parameter source.
addValues(Map<String, ?>) - Method in class org.springframework.jdbc.core.namedparam.MapSqlParameterSource
Add a Map of parameters to this parameter source.
adviceChanged() - Method in class org.springframework.aop.framework.AdvisedSupport
Invoked when advice has changed.
adviceChanged(AdvisedSupport) - Method in interface org.springframework.aop.framework.AdvisedSupportListener
Invoked when advice is changed after a proxy is created.
adviceChanged() - Method in class org.springframework.aop.framework.ProxyCreatorSupport
Propagate advice change event to all AdvisedSupportListeners.
adviceChanged() - Method in class org.springframework.aop.framework.ProxyFactoryBean
Blow away and recache singleton on an advice change.
AdviceEntry - Class in org.springframework.aop.config
ParseState entry representing an advice element.
AdviceEntry(String) - Constructor for class org.springframework.aop.config.AdviceEntry
Creates a new instance of the AdviceEntry class.
adviceIncluded(Advice) - Method in class org.springframework.aop.framework.AdvisedSupport
Is the given advice included in any advisor within this proxy configuration?
Advised - Interface in org.springframework.aop.framework
Interface to be implemented by classes that hold the configuration of a factory of AOP proxies.
AdvisedSupport - Class in org.springframework.aop.framework
Base class for AOP proxy configuration managers.
AdvisedSupport() - Constructor for class org.springframework.aop.framework.AdvisedSupport
No-arg constructor for use as a JavaBean.
AdvisedSupport(Class[]) - Constructor for class org.springframework.aop.framework.AdvisedSupport
Create a AdvisedSupport instance with the given parameters.
AdvisedSupportListener - Interface in org.springframework.aop.framework
Listener to be registered on ProxyCreatorSupport objects Allows for receiving callbacks on activation and change of advice.
Advisor - Interface in org.springframework.aop
Base interface holding AOP advice (action to take at a joinpoint) and a filter determining the applicability of the advice (such as a pointcut).
ADVISOR - Static variable in class org.springframework.aop.interceptor.ExposeInvocationInterceptor
Singleton advisor for this class.
AdvisorAdapter - Interface in org.springframework.aop.framework.adapter
Interface allowing extension to the Spring AOP framework to allow handling of new Advisors and Advice types.
AdvisorAdapterRegistrationManager - Class in org.springframework.aop.framework.adapter
BeanPostProcessor that registers AdvisorAdapter beans in the BeanFactory with an AdvisorAdapterRegistry (by default the GlobalAdvisorAdapterRegistry).
AdvisorAdapterRegistrationManager() - Constructor for class org.springframework.aop.framework.adapter.AdvisorAdapterRegistrationManager
AdvisorAdapterRegistry - Interface in org.springframework.aop.framework.adapter
Interface for registries of Advisor adapters.
AdvisorChainFactory - Interface in org.springframework.aop.framework
Factory interface for advisor chains.
AdvisorComponentDefinition - Class in org.springframework.aop.config
ComponentDefinition that bridges the gap between the advisor bean definition configured by the <aop:advisor> tag and the component definition infrastructure.
AdvisorComponentDefinition(String, BeanDefinition) - Constructor for class org.springframework.aop.config.AdvisorComponentDefinition
AdvisorComponentDefinition(String, BeanDefinition, BeanDefinition) - Constructor for class org.springframework.aop.config.AdvisorComponentDefinition
AdvisorEntry - Class in org.springframework.aop.config
ParseState entry representing an advisor.
AdvisorEntry(String) - Constructor for class org.springframework.aop.config.AdvisorEntry
Creates a new instance of the AdvisorEntry class.
advisorsPreFiltered() - Method in class org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
This auto-proxy creator always returns pre-filtered Advisors.
advisorsPreFiltered() - Method in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
Return whether the Advisors returned by the subclass are pre-filtered to match the bean's target class already, allowing the ClassFilter check to be skipped when building advisors chains for AOP invocations.
afterAccess() - Method in class org.springframework.util.ConcurrencyThrottleSupport
To be invoked after the main execution logic of concrete subclasses.
afterActionCompletion(ActionRequest, ActionResponse, Object, Exception) - Method in class org.springframework.web.portlet.handler.HandlerInterceptorAdapter
This implementation delegates to HandlerInterceptorAdapter.afterCompletion(javax.portlet.PortletRequest, javax.portlet.PortletResponse, java.lang.Object, java.lang.Exception).
afterActionCompletion(ActionRequest, ActionResponse, Object, Exception) - Method in class org.springframework.web.portlet.handler.WebRequestHandlerInterceptorAdapter
afterActionCompletion(ActionRequest, ActionResponse, Object, Exception) - Method in interface org.springframework.web.portlet.HandlerInterceptor
Callback after completion of request processing in the action phase, that is, after rendering the view.
AfterAdvice - Interface in org.springframework.aop
Common marker interface for after advice, such as AfterReturningAdvice and ThrowsAdvice.
afterCommit() - Method in class org.springframework.transaction.support.ResourceHolderSynchronization
afterCommit() - Method in interface org.springframework.transaction.support.TransactionSynchronization
Invoked after transaction commit.
afterCommit() - Method in class org.springframework.transaction.support.TransactionSynchronizationAdapter
afterCompletion(int) - Method in class org.springframework.jdbc.support.lob.JtaLobCreatorSynchronization
afterCompletion(int) - Method in class org.springframework.jdbc.support.lob.SpringLobCreatorSynchronization
afterCompletion(WebRequest, Exception) - Method in class org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor
Unbind the Hibernate Session from the thread and close it (in single session mode), or process deferred close for all sessions that have been opened during the current request (in deferred close mode).
afterCompletion(WebRequest, Exception) - Method in class org.springframework.orm.jdo.support.OpenPersistenceManagerInViewInterceptor
afterCompletion(WebRequest, Exception) - Method in class org.springframework.orm.jpa.support.OpenEntityManagerInViewInterceptor
afterCompletion(int) - Method in class org.springframework.transaction.jta.JtaAfterCompletionSynchronization
afterCompletion(int) - Method in class org.springframework.transaction.jta.SpringJtaSynchronizationAdapter
JTA afterCompletion callback: invoked after commit/rollback.
afterCompletion(int) - Method in class org.springframework.transaction.support.ResourceHolderSynchronization
afterCompletion(int) - Method in interface org.springframework.transaction.support.TransactionSynchronization
Invoked after transaction commit/rollback.
afterCompletion(int) - Method in class org.springframework.transaction.support.TransactionSynchronizationAdapter
afterCompletion(WebRequest, Exception) - Method in class org.springframework.web.context.request.Log4jNestedDiagnosticContextInterceptor
Removes the log message from the Log4J NDC after the request is processed.
afterCompletion(WebRequest, Exception) - Method in interface org.springframework.web.context.request.WebRequestInterceptor
Callback after completion of request processing, that is, after rendering the view.
afterCompletion(PortletRequest, PortletResponse, Object, Exception) - Method in class org.springframework.web.portlet.handler.HandlerInterceptorAdapter
Default callback that all "after*" methods delegate to.
afterCompletion(HttpServletRequest, HttpServletResponse, Object, Exception) - Method in class org.springframework.web.servlet.handler.HandlerInterceptorAdapter
This implementation is empty.
afterCompletion(HttpServletRequest, HttpServletResponse, Object, Exception) - Method in class org.springframework.web.servlet.handler.WebRequestHandlerInterceptorAdapter
afterCompletion(HttpServletRequest, HttpServletResponse, Object, Exception) - Method in interface org.springframework.web.servlet.HandlerInterceptor
Callback after completion of request processing, that is, after rendering the view.
afterCompletion(HttpServletRequest, HttpServletResponse, Object, Exception) - Method in class org.springframework.web.servlet.mvc.WebContentInterceptor
This implementation is empty.
afterDelivery() - Method in class org.springframework.jca.endpoint.AbstractMessageEndpointFactory.AbstractMessageEndpoint
This afterDelivery implementation resets the thread context ClassLoader and completes the transaction, if any.
afterEventCompletion(EventRequest, EventResponse, Object, Exception) - Method in class org.springframework.web.portlet.handler.HandlerInterceptorAdapter
This implementation delegates to HandlerInterceptorAdapter.afterCompletion(javax.portlet.PortletRequest, javax.portlet.PortletResponse, java.lang.Object, java.lang.Exception).
afterEventCompletion(EventRequest, EventResponse, Object, Exception) - Method in class org.springframework.web.portlet.handler.WebRequestHandlerInterceptorAdapter
afterEventCompletion(EventRequest, EventResponse, Object, Exception) - Method in interface org.springframework.web.portlet.HandlerInterceptor
Callback after completion of request processing in the action phase, that is, after rendering the view.
afterLast() - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
afterLast() - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Moves the cursor to the end of this RowSet.
afterPhase(PhaseEvent) - Method in class org.springframework.web.jsf.DelegatingPhaseListenerMulticaster
afterPropertiesSet() - Method in class org.springframework.aop.framework.AbstractSingletonProxyFactoryBean
afterPropertiesSet() - Method in class org.springframework.beans.factory.config.AbstractFactoryBean
Eagerly create the singleton instance, if necessary.
afterPropertiesSet() - Method in class org.springframework.beans.factory.config.CommonsLogFactoryBean
afterPropertiesSet() - Method in class org.springframework.beans.factory.config.FieldRetrievingFactoryBean
afterPropertiesSet() - Method in class org.springframework.beans.factory.config.MethodInvokingFactoryBean
afterPropertiesSet() - Method in class org.springframework.beans.factory.config.ObjectFactoryCreatingFactoryBean
afterPropertiesSet() - Method in class org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer
This implementation eagerly fetches the Preferences instances for the required system and user tree nodes.
afterPropertiesSet() - Method in class org.springframework.beans.factory.config.PropertiesFactoryBean
afterPropertiesSet() - Method in class org.springframework.beans.factory.config.ProviderCreatingFactoryBean
afterPropertiesSet() - Method in class org.springframework.beans.factory.config.ServiceLocatorFactoryBean
afterPropertiesSet() - Method in interface org.springframework.beans.factory.InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
afterPropertiesSet() - Method in class org.springframework.beans.factory.wiring.BeanConfigurerSupport
Check that a BeanFactory has been set.
afterPropertiesSet() - Method in class org.springframework.cache.ehcache.EhCacheFactoryBean
afterPropertiesSet() - Method in class org.springframework.cache.ehcache.EhCacheManagerFactoryBean
afterPropertiesSet() - Method in class org.springframework.context.event.EventPublicationInterceptor
afterPropertiesSet() - Method in class org.springframework.context.support.AbstractRefreshableConfigApplicationContext
Triggers AbstractApplicationContext.refresh() if not refreshed in the concrete context's constructor already.
afterPropertiesSet() - Method in class org.springframework.context.support.ConversionServiceFactoryBean
afterPropertiesSet() - Method in class org.springframework.dao.support.DaoSupport
afterPropertiesSet() - Method in class org.springframework.dao.support.PersistenceExceptionTranslationInterceptor
afterPropertiesSet() - Method in class org.springframework.ejb.access.AbstractSlsbInvokerInterceptor
Fetches EJB home on startup, if necessary.
afterPropertiesSet() - Method in class org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean
afterPropertiesSet() - Method in class org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean
afterPropertiesSet() - Method in class org.springframework.format.support.FormattingConversionServiceFactoryBean
afterPropertiesSet() - Method in class org.springframework.jca.cci.connection.CciLocalTransactionManager
afterPropertiesSet() - Method in class org.springframework.jca.cci.connection.DelegatingConnectionFactory
afterPropertiesSet() - Method in class org.springframework.jca.cci.connection.SingleConnectionFactory
Make sure a Connection or ConnectionFactory has been set.
afterPropertiesSet() - Method in class org.springframework.jca.cci.core.CciTemplate
afterPropertiesSet() - Method in class org.springframework.jca.cci.object.EisOperation
afterPropertiesSet() - Method in class org.springframework.jca.endpoint.GenericMessageEndpointManager
Prepares the message endpoint, and automatically activates it if the "autoStartup" flag is set to "true".
afterPropertiesSet() - Method in class org.springframework.jca.support.LocalConnectionFactoryBean
afterPropertiesSet() - Method in class org.springframework.jca.support.ResourceAdapterFactoryBean
Builds the BootstrapContext and starts the ResourceAdapter with it.
afterPropertiesSet() - Method in class org.springframework.jca.work.WorkManagerTaskExecutor
afterPropertiesSet() - Method in class org.springframework.jdbc.datasource.DataSourceTransactionManager
afterPropertiesSet() - Method in class org.springframework.jdbc.datasource.DelegatingDataSource
afterPropertiesSet() - Method in class org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactoryBean
afterPropertiesSet() - Method in class org.springframework.jdbc.datasource.init.DataSourceInitializer
Use the populator to set up data in the data source.
afterPropertiesSet() - Method in class org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy
afterPropertiesSet() - Method in class org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
afterPropertiesSet() - Method in class org.springframework.jdbc.datasource.WebSphereDataSourceAdapter
Checks that the specified 'targetDataSource' actually is a WebSphere WSDataSource.
afterPropertiesSet() - Method in class org.springframework.jdbc.object.GenericSqlQuery
afterPropertiesSet() - Method in class org.springframework.jdbc.object.RdbmsOperation
Ensures compilation if used in a bean factory.
afterPropertiesSet() - Method in class org.springframework.jdbc.support.DatabaseStartupValidator
Check whether the validation query can be executed on a Connection from the specified DataSource, with the specified interval between checks, until the specified timeout.
afterPropertiesSet() - Method in class org.springframework.jdbc.support.incrementer.AbstractColumnMaxValueIncrementer
afterPropertiesSet() - Method in class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
afterPropertiesSet() - Method in class org.springframework.jdbc.support.JdbcAccessor
Eagerly initialize the exception translator, if demanded, creating a default one for the specified DataSource if none set.
afterPropertiesSet() - Method in class org.springframework.jms.connection.DelegatingConnectionFactory
afterPropertiesSet() - Method in class org.springframework.jms.connection.JmsTransactionManager
Make sure the ConnectionFactory has been set.
afterPropertiesSet() - Method in class org.springframework.jms.connection.JmsTransactionManager102
Deprecated. In addition to checking if the connection factory is set, make sure that the supplied connection factory is of the appropriate type for the specified destination type: QueueConnectionFactory for queues, and TopicConnectionFactory for topics.
afterPropertiesSet() - Method in class org.springframework.jms.connection.SingleConnectionFactory
Make sure a Connection or ConnectionFactory has been set.
afterPropertiesSet() - Method in class org.springframework.jms.connection.SingleConnectionFactory102
Deprecated. In addition to checking whether the target ConnectionFactory is set, make sure that the supplied factory is of the appropriate type for the specified destination type: QueueConnectionFactory for queues, TopicConnectionFactory for topics.
afterPropertiesSet() - Method in class org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter
afterPropertiesSet() - Method in class org.springframework.jms.core.JmsTemplate102
Deprecated. In addition to checking if the connection factory is set, make sure that the supplied connection factory is of the appropriate type for the specified destination type: QueueConnectionFactory for queues, and TopicConnectionFactory for topics.
afterPropertiesSet() - Method in class org.springframework.jms.core.support.JmsGatewaySupport
afterPropertiesSet() - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Delegates to AbstractJmsListeningContainer.validateConfiguration() and AbstractJmsListeningContainer.initialize().
afterPropertiesSet() - Method in class org.springframework.jms.listener.endpoint.JmsMessageEndpointManager
afterPropertiesSet() - Method in class org.springframework.jms.remoting.JmsInvokerClientInterceptor
afterPropertiesSet() - Method in class org.springframework.jms.remoting.JmsInvokerProxyFactoryBean
afterPropertiesSet() - Method in class org.springframework.jms.remoting.JmsInvokerServiceExporter
afterPropertiesSet() - Method in class org.springframework.jms.support.converter.MarshallingMessageConverter
afterPropertiesSet() - Method in class org.springframework.jms.support.JmsAccessor
afterPropertiesSet() - Method in class org.springframework.jmx.access.MBeanClientInterceptor
Prepares the MBeanServerConnection if the "connectOnStartup" is turned on (which it is by default).
afterPropertiesSet() - Method in class org.springframework.jmx.access.MBeanProxyFactoryBean
Checks that the proxyInterface has been specified and then generates the proxy for the target MBean.
afterPropertiesSet() - Method in class org.springframework.jmx.access.NotificationListenerRegistrar
afterPropertiesSet() - Method in class org.springframework.jmx.export.assembler.InterfaceBasedMBeanInfoAssembler
afterPropertiesSet() - Method in class org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler
afterPropertiesSet() - Method in class org.springframework.jmx.export.MBeanExporter
Start bean registration automatically when deployed in an ApplicationContext.
afterPropertiesSet() - Method in class org.springframework.jmx.export.naming.KeyNamingStrategy
Merges the Properties configured in the mappings and mappingLocations into the final Properties instance used for ObjectName resolution.
afterPropertiesSet() - Method in class org.springframework.jmx.export.naming.MetadataNamingStrategy
afterPropertiesSet() - Method in class org.springframework.jmx.export.NotificationListenerBean
afterPropertiesSet() - Method in class org.springframework.jmx.support.ConnectorServerFactoryBean
Start the connector server.
afterPropertiesSet() - Method in class org.springframework.jmx.support.MBeanServerConnectionFactoryBean
Creates a JMXConnector for the given settings and exposes the associated MBeanServerConnection.
afterPropertiesSet() - Method in class org.springframework.jmx.support.MBeanServerFactoryBean
Creates the MBeanServer instance.
afterPropertiesSet() - Method in class org.springframework.jmx.support.WebSphereMBeanServerFactoryBean
afterPropertiesSet() - Method in class org.springframework.jndi.JndiObjectFactoryBean
Look up the JNDI object and store it.
afterPropertiesSet() - Method in class org.springframework.jndi.JndiObjectLocator
afterPropertiesSet() - Method in class org.springframework.jndi.JndiObjectTargetSource
afterPropertiesSet() - Method in class org.springframework.mail.javamail.ConfigurableMimeFileTypeMap
Creates the final merged mapping set.
afterPropertiesSet() - Method in class org.springframework.orm.hibernate3.AbstractSessionFactoryBean
Build and expose the SessionFactory.
afterPropertiesSet() - Method in class org.springframework.orm.hibernate3.FilterDefinitionFactoryBean
afterPropertiesSet() - Method in class org.springframework.orm.hibernate3.HibernateAccessor
afterPropertiesSet() - Method in class org.springframework.orm.hibernate3.HibernateTransactionManager
afterPropertiesSet() - Method in class org.springframework.orm.hibernate3.TypeDefinitionBean
afterPropertiesSet() - Method in class org.springframework.orm.ibatis.SqlMapClientFactoryBean
afterPropertiesSet() - Method in class org.springframework.orm.ibatis.SqlMapClientTemplate
afterPropertiesSet() - Method in class org.springframework.orm.jdo.JdoAccessor
Eagerly initialize the JDO dialect, creating a default one for the specified PersistenceManagerFactory if none set.
afterPropertiesSet() - Method in class org.springframework.orm.jdo.JdoTransactionManager
Eagerly initialize the JDO dialect, creating a default one for the specified PersistenceManagerFactory if none set.
afterPropertiesSet() - Method in class org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean
Initialize the PersistenceManagerFactory for the given location.
afterPropertiesSet() - Method in class org.springframework.orm.jdo.support.SpringPersistenceManagerProxyBean
afterPropertiesSet() - Method in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
afterPropertiesSet() - Method in class org.springframework.orm.jpa.JpaAccessor
Eagerly initialize the JPA dialect, creating a default one for the specified EntityManagerFactory if none set.
afterPropertiesSet() - Method in class org.springframework.orm.jpa.JpaTransactionManager
Eagerly initialize the JPA dialect, creating a default one for the specified EntityManagerFactory if none set.
afterPropertiesSet() - Method in class org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager
afterPropertiesSet() - Method in class org.springframework.orm.jpa.support.SharedEntityManagerBean
afterPropertiesSet() - Method in class org.springframework.oxm.castor.CastorMarshaller
afterPropertiesSet() - Method in class org.springframework.oxm.jaxb.Jaxb2Marshaller
afterPropertiesSet() - Method in class org.springframework.oxm.jibx.JibxMarshaller
afterPropertiesSet() - Method in class org.springframework.oxm.xstream.XStreamMarshaller
afterPropertiesSet() - Method in class org.springframework.remoting.caucho.BurlapClientInterceptor
afterPropertiesSet() - Method in class org.springframework.remoting.caucho.BurlapExporter
afterPropertiesSet() - Method in class org.springframework.remoting.caucho.BurlapProxyFactoryBean
afterPropertiesSet() - Method in class org.springframework.remoting.caucho.HessianClientInterceptor
afterPropertiesSet() - Method in class org.springframework.remoting.caucho.HessianExporter
afterPropertiesSet() - Method in class org.springframework.remoting.caucho.HessianProxyFactoryBean
afterPropertiesSet() - Method in class org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor
afterPropertiesSet() - Method in class org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean
afterPropertiesSet() - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Prepares the JAX-RPC service and port if the "lookupServiceOnStartup" is turned on (which it is by default).
afterPropertiesSet() - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortProxyFactoryBean
Deprecated.
afterPropertiesSet() - Method in class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactoryBean
Deprecated.
afterPropertiesSet() - Method in class org.springframework.remoting.jaxws.AbstractJaxWsServiceExporter
Immediately publish all endpoints when fully configured.
afterPropertiesSet() - Method in class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
afterPropertiesSet() - Method in class org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean
afterPropertiesSet() - Method in class org.springframework.remoting.jaxws.LocalJaxWsServiceFactoryBean
afterPropertiesSet() - Method in class org.springframework.remoting.jaxws.SimpleHttpServerJaxWsServiceExporter
afterPropertiesSet() - Method in class org.springframework.remoting.rmi.JndiRmiClientInterceptor
afterPropertiesSet() - Method in class org.springframework.remoting.rmi.JndiRmiProxyFactoryBean
afterPropertiesSet() - Method in class org.springframework.remoting.rmi.JndiRmiServiceExporter
afterPropertiesSet() - Method in class org.springframework.remoting.rmi.RemoteInvocationSerializingExporter
afterPropertiesSet() - Method in class org.springframework.remoting.rmi.RmiClientInterceptor
afterPropertiesSet() - Method in class org.springframework.remoting.rmi.RmiProxyFactoryBean
afterPropertiesSet() - Method in class org.springframework.remoting.rmi.RmiRegistryFactoryBean
afterPropertiesSet() - Method in class org.springframework.remoting.rmi.RmiServiceExporter
afterPropertiesSet() - Method in class org.springframework.remoting.support.SimpleHttpServerFactoryBean
afterPropertiesSet() - Method in class org.springframework.remoting.support.UrlBasedRemoteAccessor
afterPropertiesSet() - Method in class org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcessor
afterPropertiesSet() - Method in class org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor
Calls initialize() after the container applied all property values.
afterPropertiesSet() - Method in class org.springframework.scheduling.commonj.TimerManagerAccessor
afterPropertiesSet() - Method in class org.springframework.scheduling.commonj.TimerManagerFactoryBean
afterPropertiesSet() - Method in class org.springframework.scheduling.commonj.WorkManagerTaskExecutor
afterPropertiesSet() - Method in class org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
Calls initialize() after the container applied all property values.
afterPropertiesSet() - Method in class org.springframework.scheduling.config.ScheduledTaskRegistrar
afterPropertiesSet() - Method in class org.springframework.scheduling.quartz.CronTriggerBean
afterPropertiesSet() - Method in class org.springframework.scheduling.quartz.JobDetailBean
afterPropertiesSet() - Method in class org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean
afterPropertiesSet() - Method in class org.springframework.scheduling.quartz.SchedulerAccessorBean
afterPropertiesSet() - Method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
afterPropertiesSet() - Method in class org.springframework.scheduling.quartz.SimpleThreadPoolTaskExecutor
afterPropertiesSet() - Method in class org.springframework.scheduling.quartz.SimpleTriggerBean
afterPropertiesSet() - Method in class org.springframework.scheduling.support.MethodInvokingRunnable
afterPropertiesSet() - Method in class org.springframework.scheduling.timer.MethodInvokingTimerTaskFactoryBean
Deprecated.
afterPropertiesSet() - Method in class org.springframework.scheduling.timer.TimerFactoryBean
Deprecated.
afterPropertiesSet() - Method in class org.springframework.scheduling.timer.TimerTaskExecutor
Deprecated.
afterPropertiesSet() - Method in class org.springframework.transaction.interceptor.MethodMapTransactionAttributeSource
Eagerly initializes the specified "methodMap", if any.
afterPropertiesSet() - Method in class org.springframework.transaction.interceptor.TransactionAspectSupport
Check that required properties were set.
afterPropertiesSet() - Method in class org.springframework.transaction.jta.JtaTransactionManager
Initialize the UserTransaction as well as the TransactionManager handle.
afterPropertiesSet() - Method in class org.springframework.transaction.jta.OC4JJtaTransactionManager
afterPropertiesSet() - Method in class org.springframework.transaction.jta.WebLogicJtaTransactionManager
afterPropertiesSet() - Method in class org.springframework.transaction.jta.WebSphereUowTransactionManager
afterPropertiesSet() - Method in class org.springframework.transaction.support.TransactionTemplate
afterPropertiesSet() - Method in class org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean
afterPropertiesSet() - Method in class org.springframework.ui.velocity.VelocityEngineFactoryBean
afterPropertiesSet() - Method in class org.springframework.validation.beanvalidation.BeanValidationPostProcessor
afterPropertiesSet() - Method in class org.springframework.validation.beanvalidation.CustomValidatorBean
afterPropertiesSet() - Method in class org.springframework.validation.beanvalidation.LocalValidatorFactoryBean
afterPropertiesSet() - Method in class org.springframework.web.filter.GenericFilterBean
Calls the initFilterBean() method that might contain custom initialization of a subclass.
afterPropertiesSet() - Method in class org.springframework.web.portlet.mvc.PortletWrappingController
afterPropertiesSet() - Method in class org.springframework.web.servlet.mvc.multiaction.PropertiesMethodNameResolver
afterPropertiesSet() - Method in class org.springframework.web.servlet.mvc.ServletWrappingController
Initialize the wrapped Servlet instance.
afterPropertiesSet() - Method in class org.springframework.web.servlet.view.AbstractUrlBasedView
afterPropertiesSet() - Method in class org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer
Initialize FreeMarkerConfigurationFactory's Configuration if not overridden by a preconfigured FreeMarker Configuation.
afterPropertiesSet() - Method in class org.springframework.web.servlet.view.ResourceBundleViewResolver
Eagerly initialize Locales if necessary.
afterPropertiesSet() - Method in class org.springframework.web.servlet.view.tiles.TilesConfigurer
Deprecated. Initialize the Tiles definition factory.
afterPropertiesSet() - Method in class org.springframework.web.servlet.view.tiles2.TilesConfigurer
Creates and exposes a TilesContainer for this web application, delegating to the TilesInitializer.
afterPropertiesSet() - Method in class org.springframework.web.servlet.view.velocity.VelocityConfigurer
Initialize VelocityEngineFactory's VelocityEngine if not overridden by a pre-configured VelocityEngine.
afterPropertiesSet() - Method in class org.springframework.web.servlet.view.XmlViewResolver
Pre-initialize the factory from the XML file.
afterPrototypeCreation(String) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Callback after prototype creation.
afterRenderCompletion(RenderRequest, RenderResponse, Object, Exception) - Method in class org.springframework.web.portlet.handler.HandlerInterceptorAdapter
This implementation delegates to HandlerInterceptorAdapter.afterCompletion(javax.portlet.PortletRequest, javax.portlet.PortletResponse, java.lang.Object, java.lang.Exception).
afterRenderCompletion(RenderRequest, RenderResponse, Object, Exception) - Method in class org.springframework.web.portlet.handler.WebRequestHandlerInterceptorAdapter
afterRenderCompletion(RenderRequest, RenderResponse, Object, Exception) - Method in interface org.springframework.web.portlet.HandlerInterceptor
Callback after completion of request processing, that is, after rendering the view.
afterRequest(HttpServletRequest, String) - Method in class org.springframework.web.filter.AbstractRequestLoggingFilter
Concrete subclasses should implement this method to write a log message after the request is processed.
afterRequest(HttpServletRequest, String) - Method in class org.springframework.web.filter.CommonsRequestLoggingFilter
Writes a log message after the request is processed.
afterRequest(HttpServletRequest, String) - Method in class org.springframework.web.filter.Log4jNestedDiagnosticContextFilter
Removes the log message from the Log4J NDC after the request is processed and logs the after-request message through Log4J.
afterRequest(HttpServletRequest, String) - Method in class org.springframework.web.filter.ServletContextRequestLoggingFilter
Writes a log message after the request is processed.
afterResourceCompletion(ResourceRequest, ResourceResponse, Object, Exception) - Method in class org.springframework.web.portlet.handler.HandlerInterceptorAdapter
This implementation delegates to HandlerInterceptorAdapter.afterCompletion(javax.portlet.PortletRequest, javax.portlet.PortletResponse, java.lang.Object, java.lang.Exception).
afterResourceCompletion(ResourceRequest, ResourceResponse, Object, Exception) - Method in class org.springframework.web.portlet.handler.WebRequestHandlerInterceptorAdapter
afterResourceCompletion(ResourceRequest, ResourceResponse, Object, Exception) - Method in interface org.springframework.web.portlet.HandlerInterceptor
Callback after completion of request processing, that is, after rendering the view.
afterReturning(Object, Method, Object[], Object) - Method in interface org.springframework.aop.AfterReturningAdvice
Callback after a given method successfully returned.
afterReturning(Object, Method, Object[], Object) - Method in class org.springframework.aop.aspectj.AspectJAfterReturningAdvice
AfterReturningAdvice - Interface in org.springframework.aop
After returning advice is invoked only on normal method return, not if an exception is thrown.
AfterReturningAdviceInterceptor - Class in org.springframework.aop.framework.adapter
Interceptor to wrap am AfterReturningAdvice.
AfterReturningAdviceInterceptor(AfterReturningAdvice) - Constructor for class org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor
Create a new AfterReturningAdviceInterceptor for the given advice.
afterSessionFactoryCreation() - Method in class org.springframework.orm.hibernate3.AbstractSessionFactoryBean
Hook that allows post-processing after the SessionFactory has been successfully created.
afterSessionFactoryCreation() - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Executes schema update if requested.
afterSingletonCreation(String) - Method in class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
Callback after singleton creation.
afterTestClass(TestContext) - Method in class org.springframework.test.context.support.AbstractTestExecutionListener
The default implementation is empty.
afterTestClass(TestContext) - Method in class org.springframework.test.context.support.DirtiesContextTestExecutionListener
If the test class of the supplied test context is annotated with @DirtiesContext, the application context of the test context will be marked as dirty , and the REINJECT_DEPENDENCIES_ATTRIBUTE in the test context will be set to true.
afterTestClass() - Method in class org.springframework.test.context.TestContextManager
Hook for post-processing a test class after execution of all tests within the class.
afterTestClass(TestContext) - Method in interface org.springframework.test.context.TestExecutionListener
Post-processes a test class after execution of all tests within the class.
afterTestMethod(TestContext) - Method in class org.springframework.test.context.support.AbstractTestExecutionListener
The default implementation is empty.
afterTestMethod(TestContext) - Method in class org.springframework.test.context.support.DirtiesContextTestExecutionListener
If the current test method of the supplied test context is annotated with @DirtiesContext, or if the test class is annotated with @DirtiesContext and the class mode is set to AFTER_EACH_TEST_METHOD, the application context of the test context will be marked as dirty and the REINJECT_DEPENDENCIES_ATTRIBUTE in the test context will be set to true.
afterTestMethod(Object, Method, Throwable) - Method in class org.springframework.test.context.TestContextManager
Hook for post-processing a test after execution of the supplied test method, for example for tearing down test fixtures, ending a transaction, etc.
afterTestMethod(TestContext) - Method in interface org.springframework.test.context.TestExecutionListener
Post-processes a test after execution of the test method in the supplied test context, for example by tearing down test fixtures.
afterTestMethod(TestContext) - Method in class org.springframework.test.context.transaction.TransactionalTestExecutionListener
If a transaction is currently active for the test method of the supplied test context, this method will end the transaction and run @AfterTransaction methods.
AfterTransaction - Annotation Type in org.springframework.test.context.transaction
Test annotation to indicate that the annotated public void method should be executed after a transaction is ended for test methods configured to run within a transaction via the @Transactional annotation.
ALIAS_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader
ALIAS_ELEMENT - Static variable in class org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader
AliasDefinition - Class in org.springframework.beans.factory.parsing
Representation of an alias that has been registered during the parsing process.
AliasDefinition(String, String) - Constructor for class org.springframework.beans.factory.parsing.AliasDefinition
Create a new AliasDefinition.
AliasDefinition(String, String, Object) - Constructor for class org.springframework.beans.factory.parsing.AliasDefinition
Create a new AliasDefinition.
aliasRegistered(AliasDefinition) - Method in class org.springframework.beans.factory.parsing.EmptyReaderEventListener
aliasRegistered(AliasDefinition) - Method in interface org.springframework.beans.factory.parsing.ReaderEventListener
Notification that the given alias has been registered.
AliasRegistry - Interface in org.springframework.core
Common interface for managing aliases.
ALL - Static variable in class org.springframework.expression.spel.ast.Selection
ALL - Static variable in class org.springframework.http.MediaType
Public constant media type that includes all media ranges (i.e.
allowAliasOverriding() - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
Only allows alias overriding if bean definition overriding is allowed.
allowAliasOverriding() - Method in class org.springframework.core.SimpleAliasRegistry
Return whether alias overriding is allowed.
allowPublicMethodsOnly() - Method in class org.springframework.transaction.annotation.AnnotationTransactionAttributeSource
By default, only public methods can be made transactional.
allowPublicMethodsOnly() - Method in class org.springframework.transaction.interceptor.AbstractFallbackTransactionAttributeSource
Should only public methods be allowed to have transactional semantics?
allowsUnusedParameters() - Method in class org.springframework.jdbc.object.RdbmsOperation
Return whether this operation accepts additional parameters that are given but not actually used.
allowsUnusedParameters() - Method in class org.springframework.jdbc.object.StoredProcedure
StoredProcedure parameter Maps are by default allowed to contain additional entries that are not actually used as parameters.
ALREADY_FILTERED_SUFFIX - Static variable in class org.springframework.web.filter.OncePerRequestFilter
Suffix that gets appended to the filter name for the "already filtered" request attribute.
ALT_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.InputTag
alwaysCreateNewCollection() - Method in class org.springframework.beans.propertyeditors.CustomCollectionEditor
Return whether to always create a new Collection, even if the type of the passed-in Collection already matches.
alwaysCreateNewMap() - Method in class org.springframework.beans.propertyeditors.CustomMapEditor
Return whether to always create a new Map, even if the type of the passed-in Map already matches.
alwaysUseJaxRpcCall() - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Return whether to always use JAX-RPC dynamic calls.
AnnotatedBeanDefinition - Interface in org.springframework.beans.factory.annotation
Extended BeanDefinition interface that exposes AnnotationMetadata about its bean class - without requiring the class to be loaded yet.
AnnotatedBeanDefinitionReader - Class in org.springframework.context.annotation
Convenient adapter for programmatic registration of annotated bean classes.
AnnotatedBeanDefinitionReader(BeanDefinitionRegistry) - Constructor for class org.springframework.context.annotation.AnnotatedBeanDefinitionReader
Create a new AnnotatedBeanDefinitionReader for the given bean factory.
AnnotatedGenericBeanDefinition - Class in org.springframework.beans.factory.annotation
Extension of the GenericBeanDefinition class, adding support for annotation metadata exposed through the AnnotatedBeanDefinition interface.
AnnotatedGenericBeanDefinition(Class) - Constructor for class org.springframework.beans.factory.annotation.AnnotatedGenericBeanDefinition
Create a new AnnotatedGenericBeanDefinition for the given bean class.
AnnotationAwareAspectJAutoProxyCreator - Class in org.springframework.aop.aspectj.annotation
AspectJAwareAdvisorAutoProxyCreator subclass that processes all AspectJ annotation aspects in the current application context, as well as Spring Advisors.
AnnotationAwareAspectJAutoProxyCreator() - Constructor for class org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator
AnnotationAwareOrderComparator - Class in org.springframework.core.annotation
Comparator implementation that checks Ordered as well as the Order annotation, with an order value provided by an Ordered instance overriding a statically defined annotation value (if any).
AnnotationAwareOrderComparator() - Constructor for class org.springframework.core.annotation.AnnotationAwareOrderComparator
AnnotationBeanNameGenerator - Class in org.springframework.context.annotation
BeanNameGenerator implementation for bean classes annotated with the @Component annotation or with another annotation that is itself annotated with @Component as a meta-annotation.
AnnotationBeanNameGenerator() - Constructor for class org.springframework.context.annotation.AnnotationBeanNameGenerator
AnnotationBeanUtils - Class in org.springframework.beans.annotation
General utility methods for working with annotations in JavaBeans style.
AnnotationBeanUtils() - Constructor for class org.springframework.beans.annotation.AnnotationBeanUtils
AnnotationBeanWiringInfoResolver - Class in org.springframework.beans.factory.annotation
BeanWiringInfoResolver that uses the Configurable annotation to identify which classes need autowiring.
AnnotationBeanWiringInfoResolver() - Constructor for class org.springframework.beans.factory.annotation.AnnotationBeanWiringInfoResolver
AnnotationClassFilter - Class in org.springframework.aop.support.annotation
Simple ClassFilter that looks for a specific Java 5 annotation being present on a class.
AnnotationClassFilter(Class<? extends Annotation>) - Constructor for class org.springframework.aop.support.annotation.AnnotationClassFilter
Create a new AnnotationClassFilter for the given annotation type.
AnnotationClassFilter(Class<? extends Annotation>, boolean) - Constructor for class org.springframework.aop.support.annotation.AnnotationClassFilter
Create a new AnnotationClassFilter for the given annotation type.
AnnotationConfigApplicationContext - Class in org.springframework.context.annotation
Standalone application context, accepting annotated classes as input - in particular @Configuration-annotated classes, but also plain @Components and JSR-330 compliant classes using javax.inject annotations.
AnnotationConfigApplicationContext() - Constructor for class org.springframework.context.annotation.AnnotationConfigApplicationContext
Create a new AnnotationConfigApplicationContext that needs to be populated through #add calls and then manually refreshed.
AnnotationConfigApplicationContext(Class<?>...) - Constructor for class org.springframework.context.annotation.AnnotationConfigApplicationContext
Create a new AnnotationConfigApplicationContext, deriving bean definitions from the given annotated classes and automatically refreshing the context.
AnnotationConfigApplicationContext(String...) - Constructor for class org.springframework.context.annotation.AnnotationConfigApplicationContext
Create a new AnnotationConfigApplicationContext, scanning for bean definitions in the given packages and automatically refreshing the context.
AnnotationConfigBeanDefinitionParser - Class in org.springframework.context.annotation
Parser for the <context:annotation-config/> element.
AnnotationConfigBeanDefinitionParser() - Constructor for class org.springframework.context.annotation.AnnotationConfigBeanDefinitionParser
AnnotationConfigUtils - Class in org.springframework.context.annotation
Utility class that allows for convenient registration of common BeanPostProcessor and BeanFactoryPostProcessor definitions for annotation-based configuration.
AnnotationConfigUtils() - Constructor for class org.springframework.context.annotation.AnnotationConfigUtils
AnnotationConfigWebApplicationContext - Class in org.springframework.web.context.support
WebApplicationContext implementation which accepts annotated classes as input - in particular @Configuration-annotated classes, but also plain @Components and JSR-330 compliant classes using javax.inject annotations.
AnnotationConfigWebApplicationContext() - Constructor for class org.springframework.web.context.support.AnnotationConfigWebApplicationContext
AnnotationDrivenBeanDefinitionParser - Class in org.springframework.scheduling.config
Parser for the 'annotation-driven' element of the 'task' namespace.
AnnotationDrivenBeanDefinitionParser() - Constructor for class org.springframework.scheduling.config.AnnotationDrivenBeanDefinitionParser
AnnotationFormatterFactory<A extends Annotation> - Interface in org.springframework.format
A factory that creates formatters to format values of fields annotated with a particular Annotation.
AnnotationJmxAttributeSource - Class in org.springframework.jmx.export.annotation
Implementation of the JmxAttributeSource interface that reads JDK 1.5+ annotations and exposes the corresponding attributes.
AnnotationJmxAttributeSource() - Constructor for class org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource
AnnotationMatchingPointcut - Class in org.springframework.aop.support.annotation
Simple Pointcut that looks for a specific Java 5 annotation being present on a class or method.
AnnotationMatchingPointcut(Class<? extends Annotation>) - Constructor for class org.springframework.aop.support.annotation.AnnotationMatchingPointcut
Create a new AnnotationMatchingPointcut for the given annotation type.
AnnotationMatchingPointcut(Class<? extends Annotation>, boolean) - Constructor for class org.springframework.aop.support.annotation.AnnotationMatchingPointcut
Create a new AnnotationMatchingPointcut for the given annotation type.
AnnotationMatchingPointcut(Class<? extends Annotation>, Class<? extends Annotation>) - Constructor for class org.springframework.aop.support.annotation.AnnotationMatchingPointcut
Create a new AnnotationMatchingPointcut for the given annotation type.
AnnotationMBeanExporter - Class in org.springframework.jmx.export.annotation
Convenient subclass of Spring's standard MBeanExporter, activating Java 5 annotation usage for JMX exposure of Spring beans: ManagedResource, ManagedAttribute, ManagedOperation, etc.
AnnotationMBeanExporter() - Constructor for class org.springframework.jmx.export.annotation.AnnotationMBeanExporter
AnnotationMetadata - Interface in org.springframework.core.type
Interface that defines abstract access to the annotations of a specific class, in a form that does not require that class to be loaded yet.
AnnotationMethodHandlerAdapter - Class in org.springframework.web.portlet.mvc.annotation
Implementation of the HandlerAdapter interface that maps handler methods based on portlet modes, action/render phases and request parameters expressed through the RequestMapping annotation.
AnnotationMethodHandlerAdapter() - Constructor for class org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter
AnnotationMethodHandlerAdapter - Class in org.springframework.web.servlet.mvc.annotation
Implementation of the HandlerAdapter interface that maps handler methods based on HTTP paths, HTTP methods and request parameters expressed through the RequestMapping annotation.
AnnotationMethodHandlerAdapter() - Constructor for class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
AnnotationMethodHandlerExceptionResolver - Class in org.springframework.web.portlet.mvc.annotation
Implementation of the HandlerExceptionResolver interface that handles exceptions through the ExceptionHandler annotation.
AnnotationMethodHandlerExceptionResolver() - Constructor for class org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver
AnnotationMethodHandlerExceptionResolver - Class in org.springframework.web.servlet.mvc.annotation
Implementation of the HandlerExceptionResolver interface that handles exceptions through the ExceptionHandler annotation.
AnnotationMethodHandlerExceptionResolver() - Constructor for class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver
AnnotationMethodMatcher - Class in org.springframework.aop.support.annotation
Simple MethodMatcher that looks for a specific Java 5 annotation being present on a method (checking both the method on the invoked interface, if any, and the corresponding method on the target class).
AnnotationMethodMatcher(Class<? extends Annotation>) - Constructor for class org.springframework.aop.support.annotation.AnnotationMethodMatcher
Create a new AnnotationClassFilter for the given annotation type.
AnnotationScopeMetadataResolver - Class in org.springframework.context.annotation
A ScopeMetadataResolver implementation that by default checks for the presence of Spring's Scope annotation on the bean class.
AnnotationScopeMetadataResolver() - Constructor for class org.springframework.context.annotation.AnnotationScopeMetadataResolver
Create a new instance of the AnnotationScopeMetadataResolver class.
AnnotationScopeMetadataResolver(ScopedProxyMode) - Constructor for class org.springframework.context.annotation.AnnotationScopeMetadataResolver
Create a new instance of the AnnotationScopeMetadataResolver class.
AnnotationSessionFactoryBean - Class in org.springframework.orm.hibernate3.annotation
Subclass of Spring's standard LocalSessionFactoryBean for Hibernate, supporting JDK 1.5+ annotation metadata for mappings.
AnnotationSessionFactoryBean() - Constructor for class org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean
AnnotationTransactionAttributeSource - Class in org.springframework.transaction.annotation
Implementation of the TransactionAttributeSource interface for working with transaction metadata in JDK 1.5+ annotation format.
AnnotationTransactionAttributeSource() - Constructor for class org.springframework.transaction.annotation.AnnotationTransactionAttributeSource
Create a default AnnotationTransactionAttributeSource, supporting public methods that carry the Transactional annotation or the EJB3 TransactionAttribute annotation.
AnnotationTransactionAttributeSource(boolean) - Constructor for class org.springframework.transaction.annotation.AnnotationTransactionAttributeSource
Create a custom AnnotationTransactionAttributeSource, supporting public methods that carry the Transactional annotation or the EJB3 TransactionAttribute annotation.
AnnotationTransactionAttributeSource(TransactionAnnotationParser) - Constructor for class org.springframework.transaction.annotation.AnnotationTransactionAttributeSource
Create a custom AnnotationTransactionAttributeSource.
AnnotationTransactionAttributeSource(Set<TransactionAnnotationParser>) - Constructor for class org.springframework.transaction.annotation.AnnotationTransactionAttributeSource
Create a custom AnnotationTransactionAttributeSource.
AnnotationTypeFilter - Class in org.springframework.core.type.filter
A simple filter which matches classes with a given annotation, checking inherited annotations as well.
AnnotationTypeFilter(Class<? extends Annotation>) - Constructor for class org.springframework.core.type.filter.AnnotationTypeFilter
Create a new AnnotationTypeFilter for the given annotation type.
AnnotationTypeFilter(Class<? extends Annotation>, boolean) - Constructor for class org.springframework.core.type.filter.AnnotationTypeFilter
Create a new AnnotationTypeFilter for the given annotation type.
AnnotationUtils - Class in org.springframework.core.annotation
General utility methods for working with annotations, handling bridge methods (which the compiler generates for generic declarations) as well as super methods (for optional "annotation inheritance").
AnnotationUtils() - Constructor for class org.springframework.core.annotation.AnnotationUtils
AntPathMatcher - Class in org.springframework.util
PathMatcher implementation for Ant-style path patterns.
AntPathMatcher() - Constructor for class org.springframework.util.AntPathMatcher
AopConfigException - Exception in org.springframework.aop.framework
Exception that gets thrown on illegal AOP configuration arguments.
AopConfigException(String) - Constructor for exception org.springframework.aop.framework.AopConfigException
Constructor for AopConfigException.
AopConfigException(String, Throwable) - Constructor for exception org.springframework.aop.framework.AopConfigException
Constructor for AopConfigException.
AopConfigUtils - Class in org.springframework.aop.config
Utility class for handling registration of AOP auto-proxy creators.
AopConfigUtils() - Constructor for class org.springframework.aop.config.AopConfigUtils
AopContext - Class in org.springframework.aop.framework
Class containing static methods used to obtain information about the current AOP invocation.
AopContext() - Constructor for class org.springframework.aop.framework.AopContext
AopInfrastructureBean - Interface in org.springframework.aop.framework
Marker interface that indicates a bean that is part of Spring's AOP infrastructure.
AopInvocationException - Exception in org.springframework.aop
Exception that gets thrown when an AOP invocation failed because of misconfiguration or unexpected runtime issues.
AopInvocationException(String) - Constructor for exception org.springframework.aop.AopInvocationException
Constructor for AopInvocationException.
AopInvocationException(String, Throwable) - Constructor for exception org.springframework.aop.AopInvocationException
Constructor for AopInvocationException.
AopNamespaceHandler - Class in org.springframework.aop.config
NamespaceHandler for the aop namespace.
AopNamespaceHandler() - Constructor for class org.springframework.aop.config.AopNamespaceHandler
AopNamespaceUtils - Class in org.springframework.aop.config
Utility class for handling registration of auto-proxy creators used internally by the 'aop' namespace tags.
AopNamespaceUtils() - Constructor for class org.springframework.aop.config.AopNamespaceUtils
AopProxy - Interface in org.springframework.aop.framework
Delegate interface for a configured AOP proxy, allowing for the creation of actual proxy objects.
AopProxyFactory - Interface in org.springframework.aop.framework
Interface to be implemented by factories that are able to create AOP proxies based on AdvisedSupport configuration objects.
AopProxyUtils - Class in org.springframework.aop.framework
Utility methods for AOP proxy factories.
AopProxyUtils() - Constructor for class org.springframework.aop.framework.AopProxyUtils
AopUtils - Class in org.springframework.aop.support
Utility methods for AOP support code.
AopUtils() - Constructor for class org.springframework.aop.support.AopUtils
append(String, byte) - Method in class org.springframework.core.style.ToStringCreator
Append a byte field value.
append(String, short) - Method in class org.springframework.core.style.ToStringCreator
Append a short field value.
append(String, int) - Method in class org.springframework.core.style.ToStringCreator
Append a integer field value.
append(String, long) - Method in class org.springframework.core.style.ToStringCreator
Append a long field value.
append(String, float) - Method in class org.springframework.core.style.ToStringCreator
Append a float field value.
append(String, double) - Method in class org.springframework.core.style.ToStringCreator
Append a double field value.
append(String, boolean) - Method in class org.springframework.core.style.ToStringCreator
Append a boolean field value.
append(String, Object) - Method in class org.springframework.core.style.ToStringCreator
Append a field value.
append(Object) - Method in class org.springframework.core.style.ToStringCreator
Append the provided value.
appendIdentityToObjectName(ObjectName, Object) - Static method in class org.springframework.jmx.support.JmxUtils
Append an additional key/value pair to an existing ObjectName with the key being the static value identity and the value being the identity hash code of the managed resource being exposed on the supplied ObjectName.
appendMd5DigestAsHex(byte[], StringBuilder) - Static method in class org.springframework.util.DigestUtils
Append a hexadecimal string representation of the MD5 digest of the given bytes to the given StringBuilder.
appendQueryProperties(StringBuilder, Map<String, Object>, String) - Method in class org.springframework.web.servlet.view.RedirectView
Append query properties to the redirect URL.
appendValue(String) - Method in class org.springframework.web.servlet.tags.form.TagWriter
Close the current opening tag (if necessary) and appends the supplied value as inner text.
APPLICATION_ATOM_XML - Static variable in class org.springframework.http.MediaType
Public constant media type for application/atom+xml.
APPLICATION_CONTEXT_ID_PREFIX - Static variable in interface org.springframework.web.context.ConfigurableWebApplicationContext
Prefix for ApplicationContext ids that refer to context path and/or servlet name.
APPLICATION_CONTEXT_ID_PREFIX - Static variable in interface org.springframework.web.portlet.context.ConfigurablePortletApplicationContext
Prefix for ApplicationContext ids that refer to portlet name.
APPLICATION_EVENT_MULTICASTER_BEAN_NAME - Static variable in class org.springframework.context.support.AbstractApplicationContext
Name of the ApplicationEventMulticaster bean in the factory.
APPLICATION_FORM_URLENCODED - Static variable in class org.springframework.http.MediaType
Public constant media type for application/x-www-form-urlencoded.
APPLICATION_JSON - Static variable in class org.springframework.http.MediaType
Public constant media type for application/json.
APPLICATION_OCTET_STREAM - Static variable in class org.springframework.http.MediaType
Public constant media type for application/octet-stream.
APPLICATION_XHTML_XML - Static variable in class org.springframework.http.MediaType
Public constant media type for application/xhtml+xml.
APPLICATION_XML - Static variable in class org.springframework.http.MediaType
Public constant media type for image/xml.
ApplicationContext - Interface in org.springframework.context
Central interface to provide configuration for an application.
applicationContext - Variable in class org.springframework.test.AbstractSingleSpringContextTests
Deprecated. Application context this test will run against
applicationContext - Variable in class org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests
The ApplicationContext that was injected into this test instance via AbstractJUnit38SpringContextTests.setApplicationContext(ApplicationContext).
applicationContext - Variable in class org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests
The ApplicationContext that was injected into this test instance via AbstractJUnit4SpringContextTests.setApplicationContext(ApplicationContext).
applicationContext - Variable in class org.springframework.test.context.testng.AbstractTestNGSpringContextTests
The ApplicationContext that was injected into this test instance via AbstractTestNGSpringContextTests.setApplicationContext(ApplicationContext).
ApplicationContextAware - Interface in org.springframework.context
Interface to be implemented by any object that wishes to be notified of the ApplicationContext that it runs in.
ApplicationContextEvent - Class in org.springframework.context.event
Base class for events raised for an ApplicationContext.
ApplicationContextEvent(ApplicationContext) - Constructor for class org.springframework.context.event.ApplicationContextEvent
Create a new ContextStartedEvent.
ApplicationContextException - Exception in org.springframework.context
Exception thrown during application context initialization.
ApplicationContextException(String) - Constructor for exception org.springframework.context.ApplicationContextException
Create a new ApplicationContextException with the specified detail message and no root cause.
ApplicationContextException(String, Throwable) - Constructor for exception org.springframework.context.ApplicationContextException
Create a new ApplicationContextException with the specified detail message and the given root cause.
ApplicationEvent - Class in org.springframework.context
Class to be extended by all application events.
ApplicationEvent(Object) - Constructor for class org.springframework.context.ApplicationEvent
Create a new ApplicationEvent.
ApplicationEventMulticaster - Interface in org.springframework.context.event
Interface to be implemented by objects that can manage a number of ApplicationListener objects, and publish events to them.
ApplicationEventPublisher - Interface in org.springframework.context
Interface that encapsulates event publication functionality.
ApplicationEventPublisherAware - Interface in org.springframework.context
Interface to be implemented by any object that wishes to be notified of the ApplicationEventPublisher (typically the ApplicationContext) that it runs in.
ApplicationListener<E extends ApplicationEvent> - Interface in org.springframework.context
Interface to be implemented by application event listeners.
ApplicationObjectSupport - Class in org.springframework.context.support
Convenient superclass for application objects that want to be aware of the application context, e.g.
ApplicationObjectSupport() - Constructor for class org.springframework.context.support.ApplicationObjectSupport
applyAcknowledgeMode(BeanWrapper, int) - Method in class org.springframework.jms.listener.endpoint.DefaultJmsActivationSpecFactory
This implementation maps SESSION_TRANSACTED onto an ActivationSpec property named "useRAManagedTransaction", if available (following ActiveMQ's naming conventions).
applyAcknowledgeMode(BeanWrapper, int) - Method in class org.springframework.jms.listener.endpoint.StandardJmsActivationSpecFactory
Apply the specified acknowledge mode to the ActivationSpec object.
applyBeanPostProcessorsAfterInitialization(Object, String) - Method in interface org.springframework.beans.factory.config.AutowireCapableBeanFactory
Apply BeanPostProcessors to the given existing bean instance, invoking their postProcessAfterInitialization methods.
applyBeanPostProcessorsAfterInitialization(Object, String) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
applyBeanPostProcessorsBeforeInitialization(Object, String) - Method in interface org.springframework.beans.factory.config.AutowireCapableBeanFactory
Apply BeanPostProcessors to the given existing bean instance, invoking their postProcessBeforeInitialization methods.
applyBeanPostProcessorsBeforeInitialization(Object, String) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
applyBeanPostProcessorsBeforeInstantiation(Class, String) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Apply InstantiationAwareBeanPostProcessors to the specified bean definition (by class and name), invoking their postProcessBeforeInstantiation methods.
applyBeanPropertyValues(Object, String) - Method in interface org.springframework.beans.factory.config.AutowireCapableBeanFactory
Apply the property values of the bean definition with the given name to the given bean instance.
applyBeanPropertyValues(Object, String) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
applyCacheSeconds(MimeResponse, int) - Method in class org.springframework.web.portlet.handler.PortletContentGenerator
Apply the given cache seconds to the render response
applyCacheSeconds(HttpServletResponse, int) - Method in class org.springframework.web.servlet.support.WebContentGenerator
Apply the given cache seconds and generate corresponding HTTP headers, i.e.
applyCacheSeconds(HttpServletResponse, int, boolean) - Method in class org.springframework.web.servlet.support.WebContentGenerator
Apply the given cache seconds and generate respective HTTP headers.
applyContentType(HttpServletResponse) - Method in class org.springframework.web.servlet.view.AbstractTemplateView
Apply this view's content type as specified in the "contentType" bean property to the given response.
applyCurrencyTimeLimit(Descriptor, int) - Method in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Apply the given JMX "currencyTimeLimit" value to the given descriptor.
applyDefaultCurrencyTimeLimit(Descriptor) - Method in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Set the currencyTimeLimit field to the specified "defaultCurrencyTimeLimit", if any (by default none).
applyDefaults(BeanDefinitionDefaults) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Apply the provided default values to this bean.
applyFlushMode(Session, boolean) - Method in class org.springframework.orm.hibernate3.HibernateAccessor
Apply the flush mode that's been specified for this accessor to the given Session.
applyIsolationLevel(JtaTransactionObject, int) - Method in class org.springframework.transaction.jta.JtaTransactionManager
Apply the given transaction isolation level.
applyMergedBeanDefinitionPostProcessors(RootBeanDefinition, Class, String) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Apply MergedBeanDefinitionPostProcessors to the specified bean definition, invoking their postProcessMergedBeanDefinition methods.
applyNamedParameterToQuery(Query, String, Object) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
Apply the given name parameter to the given Query object.
applyPropertyValue(ConfigurableListableBeanFactory, String, String, String) - Method in class org.springframework.beans.factory.config.PropertyOverrideConfigurer
Apply the given property value to the corresponding bean.
applyPropertyValues(String, BeanDefinition, BeanWrapper, PropertyValues) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Apply the given property values, resolving any runtime references to other beans in this bean factory.
applyPropertyValues(MutablePropertyValues) - Method in class org.springframework.validation.DataBinder
Apply given property values to the target object.
applyQueryTimeout(Query, int) - Method in class org.springframework.orm.jdo.DefaultJdoDialect
This implementation sets the JPA 2.0 query hints "javax.persistence.lock.timeout" and "javax.persistence.query.timeout", assuming that JDO 2.1 providers are often JPA providers as well.
applyQueryTimeout(Query, int) - Method in interface org.springframework.orm.jdo.JdoDialect
Apply the given timeout to the given JDO query object.
applyRelativePath(String, String) - Static method in class org.springframework.util.StringUtils
Apply the given relative path to the given path, assuming standard Java folder separation (i.e.
applyStatementSettings(Statement) - Method in class org.springframework.jdbc.core.JdbcTemplate
Prepare the given JDBC Statement (or PreparedStatement or CallableStatement), applying statement settings such as fetch size, max rows, and query timeout.
applyStatusCodeIfPossible(HttpServletRequest, HttpServletResponse, int) - Method in class org.springframework.web.servlet.handler.SimpleMappingExceptionResolver
Apply the specified HTTP status code to the given response, if possible (that is, if not executing within an include request).
applyTimeout(Statement, DataSource, int) - Static method in class org.springframework.jdbc.datasource.DataSourceUtils
Apply the specified timeout - overridden by the current transaction timeout, if any - to the given JDBC Statement object.
applyTimeout(JtaTransactionObject, int) - Method in class org.springframework.transaction.jta.JtaTransactionManager
Apply the given transaction timeout.
applyTransactionConfig(SqlMapClient, TransactionConfig) - Method in class org.springframework.orm.ibatis.SqlMapClientFactoryBean
Apply the given iBATIS TransactionConfig to the SqlMapClient.
applyTransactionTimeout(Statement, DataSource) - Static method in class org.springframework.jdbc.datasource.DataSourceUtils
Apply the current transaction timeout, if any, to the given JDBC Statement object.
applyTransactionTimeout(Query, SessionFactory) - Static method in class org.springframework.orm.hibernate3.SessionFactoryUtils
Apply the current transaction timeout, if any, to the given Hibernate Query object.
applyTransactionTimeout(Criteria, SessionFactory) - Static method in class org.springframework.orm.hibernate3.SessionFactoryUtils
Apply the current transaction timeout, if any, to the given Hibernate Criteria object.
applyTransactionTimeout(Query, PersistenceManagerFactory, JdoDialect) - Static method in class org.springframework.orm.jdo.PersistenceManagerFactoryUtils
Apply the current transaction timeout, if any, to the given JDO Query object.
applyTransactionTimeout(Query, EntityManagerFactory) - Static method in class org.springframework.orm.jpa.EntityManagerFactoryUtils
Apply the current transaction timeout, if any, to the given JPA Query object.
applyTransformerParameters(Map<String, Object>, Transformer) - Method in class org.springframework.web.servlet.view.xslt.AbstractXsltView
Deprecated. Apply the specified parameters to the given Transformer.
areCallbacksLocalToHibernateTransactions() - Method in class org.springframework.orm.hibernate3.SpringTransactionFactory
ARG_TYPE_ELEMENT - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
ARG_TYPE_MATCH_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
argBinding(JoinPoint, JoinPointMatch, Object, Throwable) - Method in class org.springframework.aop.aspectj.AbstractAspectJAdvice
Take the arguments at the method execution join point and output a set of arguments to the advice method
argsRequiringConversion - Variable in class org.springframework.expression.spel.support.ReflectionHelper.ArgumentsMatchInfo
ArgumentConvertingMethodInvoker - Class in org.springframework.beans.support
Subclass of MethodInvoker that tries to convert the given arguments for the actual target method via a TypeConverter.
ArgumentConvertingMethodInvoker() - Constructor for class org.springframework.beans.support.ArgumentConvertingMethodInvoker
arguments - Variable in class org.springframework.aop.framework.ReflectiveMethodInvocation
ARRAY_ELEMENT - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
ARRAY_SUFFIX - Static variable in class org.springframework.util.ClassUtils
Suffix for array class names: "[]"
arrayToCommaDelimitedString(Object[]) - Static method in class org.springframework.util.StringUtils
Convenience method to return a String array as a CSV String.
arrayToDelimitedString(Object[], String) - Static method in class org.springframework.util.StringUtils
Convenience method to return a String array as a delimited (e.g.
arrayToList(Object) - Static method in class org.springframework.util.CollectionUtils
Convert the supplied array into a List.
asMap() - Method in class org.springframework.ui.ExtendedModelMap
asMap() - Method in interface org.springframework.ui.Model
Return the current set of model attributes as a Map.
asNumber(String) - Method in class org.springframework.core.Constants
Return a constant value cast to a Number.
asObject(String) - Method in class org.springframework.core.Constants
Parse the given String (upper or lower case accepted) and return the appropriate value if it's the name of a constant field in the class that we're analysing.
AspectComponentDefinition - Class in org.springframework.aop.config
ComponentDefinition that holds an aspect definition, including its nested pointcuts.
AspectComponentDefinition(String, BeanDefinition[], BeanReference[], Object) - Constructor for class org.springframework.aop.config.AspectComponentDefinition
AspectEntry - Class in org.springframework.aop.config
ParseState entry representing an aspect.
AspectEntry(String, String) - Constructor for class org.springframework.aop.config.AspectEntry
Create a new AspectEntry.
AspectInstanceFactory - Interface in org.springframework.aop.aspectj
Interface implemented to provide an instance of an AspectJ aspect.
ASPECTJ_ANNOTATION_PARAMETER_NAME_DISCOVERER - Static variable in class org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory
aspectJAdviceMethod - Variable in class org.springframework.aop.aspectj.AbstractAspectJAdvice
AspectJAdviceParameterNameDiscoverer - Class in org.springframework.aop.aspectj
ParameterNameDiscoverer implementation that tries to deduce parameter names for an advice method from the pointcut expression, returning, and throwing clauses.
AspectJAdviceParameterNameDiscoverer(String) - Constructor for class org.springframework.aop.aspectj.AspectJAdviceParameterNameDiscoverer
Create a new discoverer that attempts to discover parameter names from the given pointcut expression.
AspectJAdviceParameterNameDiscoverer.AmbiguousBindingException - Exception in org.springframework.aop.aspectj
Thrown in response to an ambiguous binding being detected when trying to resolve a method's parameter names.
AspectJAdviceParameterNameDiscoverer.AmbiguousBindingException(String) - Constructor for exception org.springframework.aop.aspectj.AspectJAdviceParameterNameDiscoverer.AmbiguousBindingException
Construct a new AmbiguousBindingException with the specified message.
AspectJAdvisorFactory - Interface in org.springframework.aop.aspectj.annotation
Interface for factories that can create Spring AOP Advisors from classes annotated with AspectJ annotation syntax.
AspectJAfterAdvice - Class in org.springframework.aop.aspectj
Spring AOP advice wrapping an AspectJ after advice method.
AspectJAfterAdvice(Method, AspectJExpressionPointcut, AspectInstanceFactory) - Constructor for class org.springframework.aop.aspectj.AspectJAfterAdvice
AspectJAfterReturningAdvice - Class in org.springframework.aop.aspectj
Spring AOP advice wrapping an AspectJ after-returning advice method.
AspectJAfterReturningAdvice(Method, AspectJExpressionPointcut, AspectInstanceFactory) - Constructor for class org.springframework.aop.aspectj.AspectJAfterReturningAdvice
AspectJAfterThrowingAdvice - Class in org.springframework.aop.aspectj
Spring AOP advice wrapping an AspectJ after-throwing advice method.
AspectJAfterThrowingAdvice(Method, AspectJExpressionPointcut, AspectInstanceFactory) - Constructor for class org.springframework.aop.aspectj.AspectJAfterThrowingAdvice
AspectJAopUtils - Class in org.springframework.aop.aspectj
Utility methods for dealing with AspectJ advisors.
AspectJAopUtils() - Constructor for class org.springframework.aop.aspectj.AspectJAopUtils
AspectJAroundAdvice - Class in org.springframework.aop.aspectj
Spring AOP around advice (MethodInterceptor) that wraps an AspectJ advice method.
AspectJAroundAdvice(Method, AspectJExpressionPointcut, AspectInstanceFactory) - Constructor for class org.springframework.aop.aspectj.AspectJAroundAdvice
AspectJAwareAdvisorAutoProxyCreator - Class in org.springframework.aop.aspectj.autoproxy
AbstractAdvisorAutoProxyCreator subclass that exposes AspectJ's invocation context and understands AspectJ's rules for advice precedence when multiple pieces of advice come from the same aspect.
AspectJAwareAdvisorAutoProxyCreator() - Constructor for class org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator
AspectJExpressionPointcut - Class in org.springframework.aop.aspectj
Spring Pointcut implementation that uses the AspectJ weaver to evaluate a pointcut expression.
AspectJExpressionPointcut() - Constructor for class org.springframework.aop.aspectj.AspectJExpressionPointcut
Create a new default AspectJExpressionPointcut.
AspectJExpressionPointcut(Class, String[], Class[]) - Constructor for class org.springframework.aop.aspectj.AspectJExpressionPointcut
Create a new AspectJExpressionPointcut with the given settings.
AspectJExpressionPointcutAdvisor - Class in org.springframework.aop.aspectj
Spring AOP Advisor that can be used for any AspectJ pointcut expression.
AspectJExpressionPointcutAdvisor() - Constructor for class org.springframework.aop.aspectj.AspectJExpressionPointcutAdvisor
AspectJMethodBeforeAdvice - Class in org.springframework.aop.aspectj
Spring AOP advice that wraps an AspectJ before method.
AspectJMethodBeforeAdvice(Method, AspectJExpressionPointcut, AspectInstanceFactory) - Constructor for class org.springframework.aop.aspectj.AspectJMethodBeforeAdvice
AspectJPointcutAdvisor - Class in org.springframework.aop.aspectj
AspectJPointcutAdvisor that adapts an AbstractAspectJAdvice to the PointcutAdvisor interface.
AspectJPointcutAdvisor(AbstractAspectJAdvice) - Constructor for class org.springframework.aop.aspectj.AspectJPointcutAdvisor
Create a new AspectJPointcutAdvisor for the given advice
AspectJPrecedenceInformation - Interface in org.springframework.aop.aspectj
Interface to be implemented by types that can supply the information needed to sort advice/advisors by AspectJ's precedence rules.
AspectJProxyFactory - Class in org.springframework.aop.aspectj.annotation
AspectJ-based proxy factory, allowing for programmatic building of proxies which include AspectJ aspects (code style as well Java 5 annotation style).
AspectJProxyFactory() - Constructor for class org.springframework.aop.aspectj.annotation.AspectJProxyFactory
Create a new AspectJProxyFactory.
AspectJProxyFactory(Object) - Constructor for class org.springframework.aop.aspectj.annotation.AspectJProxyFactory
Create a new AspectJProxyFactory.
AspectJProxyFactory(Class[]) - Constructor for class org.springframework.aop.aspectj.annotation.AspectJProxyFactory
Create a new AspectJProxyFactory.
AspectJProxyUtils - Class in org.springframework.aop.aspectj
Utility methods for working with AspectJ proxies.
AspectJProxyUtils() - Constructor for class org.springframework.aop.aspectj.AspectJProxyUtils
AspectJTypeFilter - Class in org.springframework.core.type.filter
Type filter that uses AspectJ type pattern for matching.
AspectJTypeFilter(String, ClassLoader) - Constructor for class org.springframework.core.type.filter.AspectJTypeFilter
AspectJWeaverMessageHandler - Class in org.springframework.aop.aspectj
Implementation of AspectJ's IMessageHandler interface that routes AspectJ weaving messages through the same logging system as the regular Spring messages.
AspectJWeaverMessageHandler() - Constructor for class org.springframework.aop.aspectj.AspectJWeaverMessageHandler
AspectJWeavingEnabler - Class in org.springframework.context.weaving
Post-processor that registers AspectJ's ClassPreProcessorAgentAdapter with the Spring application context's default LoadTimeWeaver.
AspectJWeavingEnabler() - Constructor for class org.springframework.context.weaving.AspectJWeavingEnabler
AspectMetadata - Class in org.springframework.aop.aspectj.annotation
Metadata for an AspectJ aspect class, with an additional Spring AOP pointcut for the per clause.
AspectMetadata(Class<?>, String) - Constructor for class org.springframework.aop.aspectj.annotation.AspectMetadata
Create a new AspectMetadata instance for the given aspect class.
assemble(Serializable, Object) - Method in class org.springframework.orm.hibernate3.support.AbstractLobType
This implementation returns the passed-in value as-is.
Assert - Class in org.springframework.util
Assertion utility class that assists in validating arguments.
Assert() - Constructor for class org.springframework.util.Assert
assertAndReturnModelAttributeOfType(ModelAndView, String, Class<T>) - Method in class org.springframework.test.web.AbstractModelAndViewTests
Deprecated. Checks whether the model value under the given modelName exists and checks it type, based on the expectedType.
assertAndReturnModelAttributeOfType(ModelAndView, String, Class<T>) - Static method in class org.springframework.test.web.ModelAndViewAssert
Checks whether the model value under the given modelName exists and checks it type, based on the expectedType.
assertCompareListModelAttribute(ModelAndView, String, List) - Method in class org.springframework.test.web.AbstractModelAndViewTests
Deprecated. Compare each individual entry in a list, without first sorting the lists.
assertCompareListModelAttribute(ModelAndView, String, List) - Static method in class org.springframework.test.web.ModelAndViewAssert
Compare each individual entry in a list, without first sorting the lists.
assertHasAncestorOfType(Tag, Class, String, String) - Static method in class org.springframework.web.util.TagUtils
Determine whether the supplied Tag has any ancestor tag of the supplied type, throwing an IllegalStateException if not.
assertModelAttributeAvailable(ModelAndView, String) - Method in class org.springframework.test.web.AbstractModelAndViewTests
Deprecated. Assert whether or not a model attribute is available.
assertModelAttributeAvailable(ModelAndView, String) - Static method in class org.springframework.test.web.ModelAndViewAssert
Assert whether or not a model attribute is available.
assertModelAttributeValue(ModelAndView, String, Object) - Method in class org.springframework.test.web.AbstractModelAndViewTests
Deprecated. Compare a given expectedValue to the value from the model bound under the given modelName.
assertModelAttributeValue(ModelAndView, String, Object) - Static method in class org.springframework.test.web.ModelAndViewAssert
Compare a given expectedValue to the value from the model bound under the given modelName.
assertModelAttributeValues(ModelAndView, Map<String, Object>) - Method in class org.springframework.test.web.AbstractModelAndViewTests
Deprecated. Inspect the expectedModel to see if all elements in the model appear and are equal.
assertModelAttributeValues(ModelAndView, Map<String, Object>) - Static method in class org.springframework.test.web.ModelAndViewAssert
Inspect the expectedModel to see if all elements in the model appear and are equal.
assertSortAndCompareListModelAttribute(ModelAndView, String, List, Comparator) - Method in class org.springframework.test.web.AbstractModelAndViewTests
Deprecated. Compare each individual entry in a list after having sorted both lists (optionally using a comparator).
assertSortAndCompareListModelAttribute(ModelAndView, String, List, Comparator) - Static method in class org.springframework.test.web.ModelAndViewAssert
Compare each individual entry in a list after having sorted both lists (optionally using a comparator).
AssertThrows - Class in org.springframework.test
Deprecated. favor use of JUnit 4's @Test(expected=...) support
AssertThrows(Class) - Constructor for class org.springframework.test.AssertThrows
Deprecated. Create a new instance of the AssertThrows class.
AssertThrows(Class, String) - Constructor for class org.springframework.test.AssertThrows
Deprecated. Create a new instance of the AssertThrows class.
assertViewName(ModelAndView, String) - Method in class org.springframework.test.web.AbstractModelAndViewTests
Deprecated. Check to see if the view name in the ModelAndView matches the given expectedName.
assertViewName(ModelAndView, String) - Static method in class org.springframework.test.web.ModelAndViewAssert
Check to see if the view name in the ModelAndView matches the given expectedName.
Assign - Class in org.springframework.expression.spel.ast
Represents assignment.
Assign(int, SpelNodeImpl...) - Constructor for class org.springframework.expression.spel.ast.Assign
AssignableTypeFilter - Class in org.springframework.core.type.filter
A simple filter which matches classes that are assignable to a given type.
AssignableTypeFilter(Class) - Constructor for class org.springframework.core.type.filter.AssignableTypeFilter
Create a new AssignableTypeFilter for the given type.
asString(String) - Method in class org.springframework.core.Constants
Return a constant value as a String.
asString() - Method in class org.springframework.core.convert.TypeDescriptor
A textual representation of the type descriptor (eg.
AstUtils - Class in org.springframework.expression.spel.ast
Utilities methods for use in the Ast classes.
AstUtils() - Constructor for class org.springframework.expression.spel.ast.AstUtils
Async - Annotation Type in org.springframework.scheduling.annotation
Annotation that marks a method as a candidate for asynchronous execution.
ASYNC_ANNOTATION_PROCESSOR_BEAN_NAME - Static variable in class org.springframework.scheduling.config.AnnotationDrivenBeanDefinitionParser
The bean name of the internally managed async annotation processor.
AsyncAnnotationAdvisor - Class in org.springframework.scheduling.annotation
Advisor that activates asynchronous method execution through the Async annotation.
AsyncAnnotationAdvisor() - Constructor for class org.springframework.scheduling.annotation.AsyncAnnotationAdvisor
Create a new ConcurrencyAnnotationBeanPostProcessor for bean-style configuration.
AsyncAnnotationAdvisor(Executor) - Constructor for class org.springframework.scheduling.annotation.AsyncAnnotationAdvisor
Create a new ConcurrencyAnnotationBeanPostProcessor for the given task executor.
AsyncAnnotationBeanPostProcessor - Class in org.springframework.scheduling.annotation
Bean post-processor that automatically applies asynchronous invocation behavior to any bean that carries the Async annotation at class or method-level by adding a corresponding AsyncAnnotationAdvisor to the exposed proxy (either an existing AOP proxy or a newly generated proxy that implements all of the target's interfaces).
AsyncAnnotationBeanPostProcessor() - Constructor for class org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcessor
AsyncExecutionInterceptor - Class in org.springframework.aop.interceptor
AOP Alliance MethodInterceptor that processes method invocations asynchronously, using a given AsyncTaskExecutor.
AsyncExecutionInterceptor(AsyncTaskExecutor) - Constructor for class org.springframework.aop.interceptor.AsyncExecutionInterceptor
Create a new AsyncExecutionInterceptor.
AsyncExecutionInterceptor(Executor) - Constructor for class org.springframework.aop.interceptor.AsyncExecutionInterceptor
Create a new AsyncExecutionInterceptor.
AsyncResult<V> - Class in org.springframework.scheduling.annotation
A pass-through Future handle that can be used for method signatures which are declared with a Future return type for asynchronous execution.
AsyncResult(V) - Constructor for class org.springframework.scheduling.annotation.AsyncResult
Create a new AsyncResult holder.
AsyncTaskExecutor - Interface in org.springframework.core.task
Extended interface for asynchronous TaskExecutor implementations, offering an overloaded AsyncTaskExecutor.execute(Runnable, long) variant with a start timeout parameter as well support for Callable.
AtomFeedHttpMessageConverter - Class in org.springframework.http.converter.feed
Implementation of HttpMessageConverter that can read and write Atom feeds.
AtomFeedHttpMessageConverter() - Constructor for class org.springframework.http.converter.feed.AtomFeedHttpMessageConverter
ATTRIBUTE_OPERATION_VISIBILITY - Static variable in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Lowest visibility, used for operations that correspond to accessors or mutators for attributes.
AttributeAccessor - Interface in org.springframework.core
Interface defining a generic contract for attaching and accessing metadata to/from arbitrary objects.
AttributeAccessorSupport - Class in org.springframework.core
Support class for AttributeAccessors, providing a base implementation of all methods.
AttributeAccessorSupport() - Constructor for class org.springframework.core.AttributeAccessorSupport
attributeNames() - Method in interface org.springframework.core.AttributeAccessor
Return the names of all attributes.
attributeNames() - Method in class org.springframework.core.AttributeAccessorSupport
attributeNameToPropertyName(String) - Static method in class org.springframework.core.Conventions
Convert Strings in attribute name format (lowercase, hyphens separating words) into property name format (camel-cased).
attributeSource - Variable in class org.springframework.test.context.transaction.TransactionalTestExecutionListener
AUTO_PROXY_CREATOR_BEAN_NAME - Static variable in class org.springframework.aop.config.AopConfigUtils
The bean name of the internally managed auto-proxy creator.
AUTOCOMPLETE_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.InputTag
AUTODETECT_ALL - Static variable in class org.springframework.jmx.export.MBeanExporter
Autodetection mode indicating that all autodetection mechanisms should be used.
AUTODETECT_ASSEMBLER - Static variable in class org.springframework.jmx.export.MBeanExporter
Autodetection mode indicating that only the MBeanInfoAssembler should be able to autodetect beans.
AUTODETECT_MBEAN - Static variable in class org.springframework.jmx.export.MBeanExporter
Autodetection mode indicating that only valid MBeans should be autodetected.
AUTODETECT_NONE - Static variable in class org.springframework.jmx.export.MBeanExporter
Autodetection mode indicating that no autodetection should be used.
AutodetectCapableMBeanInfoAssembler - Interface in org.springframework.jmx.export.assembler
Extends the MBeanInfoAssembler to add autodetection logic.
autodetectConfiguration() - Method in class org.springframework.web.servlet.view.freemarker.FreeMarkerView
Autodetect a FreeMarkerConfig object via the ApplicationContext.
autodetectVelocityEngine() - Method in class org.springframework.web.servlet.view.velocity.VelocityView
Autodetect a VelocityEngine via the ApplicationContext.
autogenerateFor() - Method in class org.springframework.web.servlet.tags.form.LabelTag
Autogenerate the 'for' attribute value for this tag.
autogenerateId() - Method in class org.springframework.web.servlet.tags.form.AbstractCheckedElementTag
Return a unique ID for the bound name within the current PageContext.
autogenerateId() - Method in class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
Autogenerate the 'id' attribute value for this tag.
autogenerateId() - Method in class org.springframework.web.servlet.tags.form.ErrorsTag
Get the value for the HTML 'id' attribute.
autogenerateId() - Method in class org.springframework.web.servlet.tags.form.FormTag
Autogenerated IDs correspond to the form object name.
autogenerateId() - Method in class org.springframework.web.servlet.tags.form.OptionTag
AutoPopulatingList<E> - Class in org.springframework.util
Simple List wrapper class that allows for elements to be automatically populated as they are requested.
AutoPopulatingList(Class<? extends E>) - Constructor for class org.springframework.util.AutoPopulatingList
Creates a new AutoPopulatingList that is backed by a standard ArrayList and adds new instances of the supplied element Class to the backing List on demand.
AutoPopulatingList(List<E>, Class<? extends E>) - Constructor for class org.springframework.util.AutoPopulatingList
Creates a new AutoPopulatingList that is backed by the supplied List and adds new instances of the supplied element Class to the backing List on demand.
AutoPopulatingList(AutoPopulatingList.ElementFactory<E>) - Constructor for class org.springframework.util.AutoPopulatingList
Creates a new AutoPopulatingList that is backed by a standard ArrayList and creates new elements on demand using the supplied AutoPopulatingList.ElementFactory.
AutoPopulatingList(List<E>, AutoPopulatingList.ElementFactory<E>) - Constructor for class org.springframework.util.AutoPopulatingList
Creates a new AutoPopulatingList that is backed by the supplied List and creates new elements on demand using the supplied AutoPopulatingList.ElementFactory.
AutoPopulatingList.ElementFactory<E> - Interface in org.springframework.util
Factory interface for creating elements for an index-based access data structure such as a List.
AutoPopulatingList.ElementInstantiationException - Exception in org.springframework.util
Exception to be thrown from ElementFactory.
AutoPopulatingList.ElementInstantiationException(String) - Constructor for exception org.springframework.util.AutoPopulatingList.ElementInstantiationException
AutoProxyUtils - Class in org.springframework.aop.framework.autoproxy
Utilities for auto-proxy aware components.
AutoProxyUtils() - Constructor for class org.springframework.aop.framework.autoproxy.AutoProxyUtils
Autowire - Enum in org.springframework.beans.factory.annotation
Enumeration determining autowiring status: that is, whether a bean should have its dependencies automatically injected by the Spring container using setter injection.
autowire(Class, int, boolean) - Method in interface org.springframework.beans.factory.config.AutowireCapableBeanFactory
Instantiate a new bean instance of the given class with the specified autowire strategy.
autowire(Class, int, boolean) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
AUTOWIRE_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
AUTOWIRE_AUTODETECT - Static variable in interface org.springframework.beans.factory.config.AutowireCapableBeanFactory
Deprecated. as of Spring 3.0: If you are using mixed autowiring strategies, prefer annotation-based autowiring for clearer demarcation of autowiring needs.
AUTOWIRE_AUTODETECT - Static variable in class org.springframework.beans.factory.support.AbstractBeanDefinition
Deprecated. as of Spring 3.0: If you are using mixed autowiring strategies, use annotation-based autowiring for clearer demarcation of autowiring needs.
AUTOWIRE_AUTODETECT_VALUE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
AUTOWIRE_BY_NAME - Static variable in interface org.springframework.beans.factory.config.AutowireCapableBeanFactory
Constant that indicates autowiring bean properties by name (applying to all bean property setters).
AUTOWIRE_BY_NAME - Static variable in class org.springframework.beans.factory.support.AbstractBeanDefinition
Constant that indicates autowiring bean properties by name.
AUTOWIRE_BY_NAME - Static variable in class org.springframework.beans.factory.wiring.BeanWiringInfo
Constant that indicates autowiring bean properties by name.
AUTOWIRE_BY_NAME - Static variable in class org.springframework.test.AbstractDependencyInjectionSpringContextTests
Deprecated. Constant that indicates autowiring bean properties by name.
AUTOWIRE_BY_NAME - Static variable in class org.springframework.web.struts.DelegatingActionUtils
Deprecated. Value of the autowire init-param that indicates autowiring by name: "byName"
AUTOWIRE_BY_NAME_VALUE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
AUTOWIRE_BY_TYPE - Static variable in interface org.springframework.beans.factory.config.AutowireCapableBeanFactory
Constant that indicates autowiring bean properties by type (applying to all bean property setters).
AUTOWIRE_BY_TYPE - Static variable in class org.springframework.beans.factory.support.AbstractBeanDefinition
Constant that indicates autowiring bean properties by type.
AUTOWIRE_BY_TYPE - Static variable in class org.springframework.beans.factory.wiring.BeanWiringInfo
Constant that indicates autowiring bean properties by type.
AUTOWIRE_BY_TYPE - Static variable in class org.springframework.test.AbstractDependencyInjectionSpringContextTests
Deprecated. Constant that indicates autowiring bean properties by type.
AUTOWIRE_BY_TYPE - Static variable in class org.springframework.web.struts.DelegatingActionUtils
Deprecated. Value of the autowire init-param that indicates autowiring by type: "byType"
AUTOWIRE_BY_TYPE_VALUE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
AUTOWIRE_CANDIDATE_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
AUTOWIRE_CONSTRUCTOR - Static variable in interface org.springframework.beans.factory.config.AutowireCapableBeanFactory
Constant that indicates autowiring the greediest constructor that can be satisfied (involves resolving the appropriate constructor).
AUTOWIRE_CONSTRUCTOR - Static variable in class org.springframework.beans.factory.support.AbstractBeanDefinition
Constant that indicates autowiring a constructor.
AUTOWIRE_CONSTRUCTOR_VALUE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
AUTOWIRE_NO - Static variable in interface org.springframework.beans.factory.config.AutowireCapableBeanFactory
Constant that indicates no externally defined autowiring.
AUTOWIRE_NO - Static variable in class org.springframework.beans.factory.support.AbstractBeanDefinition
Constant that indicates no autowiring at all.
AUTOWIRE_NO - Static variable in class org.springframework.test.AbstractDependencyInjectionSpringContextTests
Deprecated. Constant that indicates no autowiring at all.
autowireBean(Object) - Method in interface org.springframework.beans.factory.config.AutowireCapableBeanFactory
Populate the given bean instance through applying after-instantiation callbacks and bean property post-processing (e.g.
autowireBean(Object) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
autowireBean(InvocationContext) - Method in class org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor
Autowire the target bean after construction as well as after passivation.
autowireBeanProperties(Object, int, boolean) - Method in interface org.springframework.beans.factory.config.AutowireCapableBeanFactory
Autowire the bean properties of the given bean instance by name or type.
autowireBeanProperties(Object, int, boolean) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
autowireByName(String, AbstractBeanDefinition, BeanWrapper, MutablePropertyValues) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Fill in any missing property values with references to other beans in this factory if autowire is set to "byName".
autowireByType(String, AbstractBeanDefinition, BeanWrapper, MutablePropertyValues) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Abstract method defining "autowire by type" (bean properties by type) behavior.
AutowireCandidateQualifier - Class in org.springframework.beans.factory.support
Qualifier for resolving autowire candidates.
AutowireCandidateQualifier(Class) - Constructor for class org.springframework.beans.factory.support.AutowireCandidateQualifier
Construct a qualifier to match against an annotation of the given type.
AutowireCandidateQualifier(String) - Constructor for class org.springframework.beans.factory.support.AutowireCandidateQualifier
Construct a qualifier to match against an annotation of the given type name.
AutowireCandidateQualifier(Class, Object) - Constructor for class org.springframework.beans.factory.support.AutowireCandidateQualifier
Construct a qualifier to match against an annotation of the given type whose value attribute also matches the specified value.
AutowireCandidateQualifier(String, Object) - Constructor for class org.springframework.beans.factory.support.AutowireCandidateQualifier
Construct a qualifier to match against an annotation of the given type name whose value attribute also matches the specified value.
AutowireCandidateResolver - Interface in org.springframework.beans.factory.support
Strategy interface for determining whether a specific bean definition qualifies as an autowire candidate for a specific dependency.
AutowireCapableBeanFactory - Interface in org.springframework.beans.factory.config
Extension of the BeanFactory interface to be implemented by bean factories that are capable of autowiring, provided that they want to expose this functionality for existing bean instances.
autowireConstructor(String, RootBeanDefinition, Constructor[], Object[]) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
"autowire constructor" (with constructor arguments by type) behavior.
Autowired - Annotation Type in org.springframework.beans.factory.annotation
Marks a constructor, field, setter method or config method as to be autowired by Spring's dependency injection facilities.
AUTOWIRED_ANNOTATION_PROCESSOR_BEAN_NAME - Static variable in class org.springframework.context.annotation.AnnotationConfigUtils
The bean name of the internally managed Autowired annotation processor.
AutowiredAnnotationBeanPostProcessor - Class in org.springframework.beans.factory.annotation
BeanPostProcessor implementation that autowires annotated fields, setter methods and arbitrary config methods.
AutowiredAnnotationBeanPostProcessor() - Constructor for class org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor
Create a new AutowiredAnnotationBeanPostProcessor for Spring's standard Autowired annotation.
autowireResource(BeanFactory, CommonAnnotationBeanPostProcessor.LookupElement, String) - Method in class org.springframework.context.annotation.CommonAnnotationBeanPostProcessor
Obtain a resource object for the given name and type through autowiring based on the given factory.
AutowiringRequestProcessor - Class in org.springframework.web.struts
Deprecated. as of Spring 3.0
AutowiringRequestProcessor() - Constructor for class org.springframework.web.struts.AutowiringRequestProcessor
Deprecated.
AutowiringTilesRequestProcessor - Class in org.springframework.web.struts
Deprecated. as of Spring 3.0
AutowiringTilesRequestProcessor() - Constructor for class org.springframework.web.struts.AutowiringTilesRequestProcessor
Deprecated.
awaitTermination(long, TimeUnit) - Method in class org.springframework.core.task.support.ExecutorServiceAdapter
Overview Package Class Tree Deprecated Index Help
PREV LETTER NEXT LETTER FRAMES NO FRAMES
A B C D E F G H I J K L M N O P Q R S T U V W X


B-Index

PREV LETTER NEXT LETTER FRAMES NO FRAMES
A B C D E F G H I J K L M N O P Q R S T U V W X

B

BadSqlGrammarException - Exception in org.springframework.jdbc
Exception thrown when SQL specified is invalid.
BadSqlGrammarException(String, String, SQLException) - Constructor for exception org.springframework.jdbc.BadSqlGrammarException
Constructor for BadSqlGrammarException.
BASE_NAME_SEPARATOR - Static variable in class org.springframework.beans.propertyeditors.ResourceBundleEditor
The separator used to distinguish between the base name and the locale (if any) when converting from a String.
BaseCommandController - Class in org.springframework.web.portlet.mvc
Deprecated. as of Spring 3.0, in favor of annotated controllers
BaseCommandController() - Constructor for class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated.
BaseCommandController - Class in org.springframework.web.servlet.mvc
Deprecated. as of Spring 3.0, in favor of annotated controllers
BaseCommandController() - Constructor for class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated.
BatchPreparedStatementSetter - Interface in org.springframework.jdbc.core
Batch update callback interface used by the JdbcTemplate class.
BatchSqlUpdate - Class in org.springframework.jdbc.object
SqlUpdate subclass that performs batch update operations.
BatchSqlUpdate() - Constructor for class org.springframework.jdbc.object.BatchSqlUpdate
Constructor to allow use as a JavaBean.
BatchSqlUpdate(DataSource, String) - Constructor for class org.springframework.jdbc.object.BatchSqlUpdate
Construct an update object with a given DataSource and SQL.
BatchSqlUpdate(DataSource, String, int[]) - Constructor for class org.springframework.jdbc.object.BatchSqlUpdate
Construct an update object with a given DataSource, SQL and anonymous parameters.
BatchSqlUpdate(DataSource, String, int[], int) - Constructor for class org.springframework.jdbc.object.BatchSqlUpdate
Construct an update object with a given DataSource, SQL, anonymous parameters and specifying the maximum number of rows that may be affected.
batchUpdate(String[]) - Method in interface org.springframework.jdbc.core.JdbcOperations
Issue multiple SQL updates on a single JDBC Statement using batching.
batchUpdate(String, BatchPreparedStatementSetter) - Method in interface org.springframework.jdbc.core.JdbcOperations
Issue multiple update statements on a single PreparedStatement, using batch updates and a BatchPreparedStatementSetter to set values.
batchUpdate(String[]) - Method in class org.springframework.jdbc.core.JdbcTemplate
batchUpdate(String, BatchPreparedStatementSetter) - Method in class org.springframework.jdbc.core.JdbcTemplate
batchUpdate(String, Map<String, ?>[]) - Method in interface org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
Executes a batch using the supplied SQL statement with the batch of supplied arguments.
batchUpdate(String, SqlParameterSource[]) - Method in interface org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
Execute a batch using the supplied SQL statement with the batch of supplied arguments.
batchUpdate(String, Map<String, ?>[]) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
batchUpdate(String, SqlParameterSource[]) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
batchUpdate(String, Map<String, ?>[]) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Executes a batch using the supplied SQL statement with the batch of supplied arguments.
batchUpdate(String, SqlParameterSource[]) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Execute a batch using the supplied SQL statement with the batch of supplied arguments.
batchUpdate(String, List<Object[]>) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Execute a batch using the supplied SQL statement with the batch of supplied arguments.
batchUpdate(String, List<Object[]>, int[]) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Execute a batch using the supplied SQL statement with the batch of supplied arguments.
batchUpdate(String, List<Object[]>) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
batchUpdate(String, List<Object[]>, int[]) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
batchUpdate(String, Map<String, ?>[]) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
batchUpdate(String, SqlParameterSource[]) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
BatchUpdateUtils - Class in org.springframework.jdbc.core
Generic utility methods for working with JDBC batch statements.
BatchUpdateUtils() - Constructor for class org.springframework.jdbc.core.BatchUpdateUtils
Bean - Annotation Type in org.springframework.context.annotation
Indicates that a method produces a bean to be managed by the Spring container.
BEAN_ELEMENT - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
BEAN_ELEMENT - Static variable in class org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader
BEAN_FACTORY_PATH_DELIMITERS - Static variable in class org.springframework.context.access.ContextJndiBeanFactoryLocator
Any number of these characters are considered delimiters between multiple bean factory config paths in a single String value.
BEAN_FACTORY_PATH_ENVIRONMENT_KEY - Static variable in class org.springframework.ejb.support.AbstractEnterpriseBean
BEAN_NAME_DELIMITERS - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
BEAN_REF_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
BeanClassLoaderAware - Interface in org.springframework.beans.factory
Callback that allows a bean to be aware of the bean class loader; that is, the class loader used by the present bean factory to load bean classes.
BeanComponentDefinition - Class in org.springframework.beans.factory.parsing
ComponentDefinition based on a standard BeanDefinition, exposing the given bean definition as well as inner bean definitions and bean references for the given bean.
BeanComponentDefinition(BeanDefinition, String) - Constructor for class org.springframework.beans.factory.parsing.BeanComponentDefinition
Create a new BeanComponentDefinition for the given bean.
BeanComponentDefinition(BeanDefinition, String, String[]) - Constructor for class org.springframework.beans.factory.parsing.BeanComponentDefinition
Create a new BeanComponentDefinition for the given bean.
BeanComponentDefinition(BeanDefinitionHolder) - Constructor for class org.springframework.beans.factory.parsing.BeanComponentDefinition
Create a new BeanComponentDefinition for the given bean.
BeanConfigurerSupport - Class in org.springframework.beans.factory.wiring
Convenient base class for configurers that can perform Dependency Injection on objects (however they may be created).
BeanConfigurerSupport() - Constructor for class org.springframework.beans.factory.wiring.BeanConfigurerSupport
BeanCreationException - Exception in org.springframework.beans.factory
Exception thrown when a BeanFactory encounters an error when attempting to create a bean from a bean definition.
BeanCreationException(String) - Constructor for exception org.springframework.beans.factory.BeanCreationException
Create a new BeanCreationException.
BeanCreationException(String, Throwable) - Constructor for exception org.springframework.beans.factory.BeanCreationException
Create a new BeanCreationException.
BeanCreationException(String, String) - Constructor for exception org.springframework.beans.factory.BeanCreationException
Create a new BeanCreationException.
BeanCreationException(String, String, Throwable) - Constructor for exception org.springframework.beans.factory.BeanCreationException
Create a new BeanCreationException.
BeanCreationException(String, String, String) - Constructor for exception org.springframework.beans.factory.BeanCreationException
Create a new BeanCreationException.
BeanCreationException(String, String, String, Throwable) - Constructor for exception org.springframework.beans.factory.BeanCreationException
Create a new BeanCreationException.
BeanCreationNotAllowedException - Exception in org.springframework.beans.factory
Exception thrown in case of a bean being requested despite bean creation currently not being allowed (for example, during the shutdown phase of a bean factory).
BeanCreationNotAllowedException(String, String) - Constructor for exception org.springframework.beans.factory.BeanCreationNotAllowedException
Create a new BeanCreationNotAllowedException.
BeanCurrentlyInCreationException - Exception in org.springframework.beans.factory
Exception thrown in case of a reference to a bean that's currently in creation.
BeanCurrentlyInCreationException(String) - Constructor for exception org.springframework.beans.factory.BeanCurrentlyInCreationException
Create a new BeanCurrentlyInCreationException, with a default error message that indicates a circular reference.
BeanCurrentlyInCreationException(String, String) - Constructor for exception org.springframework.beans.factory.BeanCurrentlyInCreationException
Create a new BeanCurrentlyInCreationException.
BeanDefinition - Interface in org.springframework.beans.factory.config
A BeanDefinition describes a bean instance, which has property values, constructor argument values, and further information supplied by concrete implementations.
BeanDefinitionBuilder - Class in org.springframework.beans.factory.support
Programmatic means of constructing BeanDefinitions using the builder pattern.
BeanDefinitionDecorator - Interface in org.springframework.beans.factory.xml
Interface used by the DefaultBeanDefinitionDocumentReader to handle custom, nested (directly under a <bean>) tags.
BeanDefinitionDefaults - Class in org.springframework.beans.factory.support
A simple holder for BeanDefinition property defaults.
BeanDefinitionDefaults() - Constructor for class org.springframework.beans.factory.support.BeanDefinitionDefaults
BeanDefinitionDocumentReader - Interface in org.springframework.beans.factory.xml
SPI for parsing an XML document that contains Spring bean definitions.
BeanDefinitionHolder - Class in org.springframework.beans.factory.config
Holder for a BeanDefinition with name and aliases.
BeanDefinitionHolder(BeanDefinition, String) - Constructor for class org.springframework.beans.factory.config.BeanDefinitionHolder
Create a new BeanDefinitionHolder.
BeanDefinitionHolder(BeanDefinition, String, String[]) - Constructor for class org.springframework.beans.factory.config.BeanDefinitionHolder
Create a new BeanDefinitionHolder.
BeanDefinitionHolder(BeanDefinitionHolder) - Constructor for class org.springframework.beans.factory.config.BeanDefinitionHolder
Copy constructor: Create a new BeanDefinitionHolder with the same contents as the given BeanDefinitionHolder instance.
BeanDefinitionParser - Interface in org.springframework.beans.factory.xml
Interface used by the DefaultBeanDefinitionDocumentReader to handle custom, top-level (directly under <beans>) tags.
BeanDefinitionParserDelegate - Class in org.springframework.beans.factory.xml
Stateful delegate class used to parse XML bean definitions.
BeanDefinitionParserDelegate(XmlReaderContext) - Constructor for class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Create a new BeanDefinitionParserDelegate associated with the supplied XmlReaderContext.
BeanDefinitionParsingException - Exception in org.springframework.beans.factory.parsing
Exception thrown when a bean definition reader encounters an error during the parsing process.
BeanDefinitionParsingException(Problem) - Constructor for exception org.springframework.beans.factory.parsing.BeanDefinitionParsingException
Create a new BeanDefinitionParsingException.
BeanDefinitionReader - Interface in org.springframework.beans.factory.support
Simple interface for bean definition readers.
BeanDefinitionReaderUtils - Class in org.springframework.beans.factory.support
Utility methods that are useful for bean definition reader implementations.
BeanDefinitionReaderUtils() - Constructor for class org.springframework.beans.factory.support.BeanDefinitionReaderUtils
BeanDefinitionRegistry - Interface in org.springframework.beans.factory.support
Interface for registries that hold bean definitions, for example RootBeanDefinition and ChildBeanDefinition instances.
BeanDefinitionRegistryPostProcessor - Interface in org.springframework.beans.factory.support
Extension to the standard BeanFactoryPostProcessor SPI, allowing for the registration of further bean definitions before regular BeanFactoryPostProcessor detection kicks in.
BeanDefinitionStoreException - Exception in org.springframework.beans.factory
Exception thrown when a BeanFactory encounters an invalid bean definition: e.g.
BeanDefinitionStoreException(String) - Constructor for exception org.springframework.beans.factory.BeanDefinitionStoreException
Create a new BeanDefinitionStoreException.
BeanDefinitionStoreException(String, Throwable) - Constructor for exception org.springframework.beans.factory.BeanDefinitionStoreException
Create a new BeanDefinitionStoreException.
BeanDefinitionStoreException(String, String) - Constructor for exception org.springframework.beans.factory.BeanDefinitionStoreException
Create a new BeanDefinitionStoreException.
BeanDefinitionStoreException(String, String, Throwable) - Constructor for exception org.springframework.beans.factory.BeanDefinitionStoreException
Create a new BeanDefinitionStoreException.
BeanDefinitionStoreException(String, String, String) - Constructor for exception org.springframework.beans.factory.BeanDefinitionStoreException
Create a new BeanDefinitionStoreException.
BeanDefinitionStoreException(String, String, String, Throwable) - Constructor for exception org.springframework.beans.factory.BeanDefinitionStoreException
Create a new BeanDefinitionStoreException.
BeanDefinitionValidationException - Exception in org.springframework.beans.factory.support
Exception thrown when the validation of a bean definition failed.
BeanDefinitionValidationException(String) - Constructor for exception org.springframework.beans.factory.support.BeanDefinitionValidationException
Create a new BeanDefinitionValidationException with the specified message.
BeanDefinitionValidationException(String, Throwable) - Constructor for exception org.springframework.beans.factory.support.BeanDefinitionValidationException
Create a new BeanDefinitionValidationException with the specified message and root cause.
BeanDefinitionVisitor - Class in org.springframework.beans.factory.config
Visitor class for traversing BeanDefinition objects, in particular the property values and constructor argument values contained in them, resolving bean metadata values.
BeanDefinitionVisitor(StringValueResolver) - Constructor for class org.springframework.beans.factory.config.BeanDefinitionVisitor
Create a new BeanDefinitionVisitor, applying the specified value resolver to all bean metadata values.
BeanDefinitionVisitor() - Constructor for class org.springframework.beans.factory.config.BeanDefinitionVisitor
Create a new BeanDefinitionVisitor for subclassing.
BeanEntry - Class in org.springframework.beans.factory.parsing
ParseState entry representing a bean definition.
BeanEntry(String) - Constructor for class org.springframework.beans.factory.parsing.BeanEntry
Creates a new instance of BeanEntry class.
BeanExpressionContext - Class in org.springframework.beans.factory.config
Context object for evaluating an expression within a bean definition.
BeanExpressionContext(ConfigurableBeanFactory, Scope) - Constructor for class org.springframework.beans.factory.config.BeanExpressionContext
BeanExpressionContextAccessor - Class in org.springframework.context.expression
EL property accessor that knows how to traverse the beans and contextual objects of a Spring BeanExpressionContext.
BeanExpressionContextAccessor() - Constructor for class org.springframework.context.expression.BeanExpressionContextAccessor
BeanExpressionException - Exception in org.springframework.beans.factory
Exception that indicates an expression evaluation attempt having failed.
BeanExpressionException(String) - Constructor for exception org.springframework.beans.factory.BeanExpressionException
Create a new BeanExpressionException with the specified message.
BeanExpressionException(String, Throwable) - Constructor for exception org.springframework.beans.factory.BeanExpressionException
Create a new BeanExpressionException with the specified message and root cause.
BeanExpressionResolver - Interface in org.springframework.beans.factory.config
Strategy interface for resolving a value through evaluating it as an expression, if applicable.
BeanFactory - Interface in org.springframework.beans.factory
The root interface for accessing a Spring bean container.
BeanFactoryAccessor - Class in org.springframework.context.expression
EL property accessor that knows how to traverse the beans of a Spring BeanFactory.
BeanFactoryAccessor() - Constructor for class org.springframework.context.expression.BeanFactoryAccessor
BeanFactoryAdvisorRetrievalHelper - Class in org.springframework.aop.framework.autoproxy
Helper for retrieving standard Spring Advisors from a BeanFactory, for use with auto-proxying.
BeanFactoryAdvisorRetrievalHelper(ConfigurableListableBeanFactory) - Constructor for class org.springframework.aop.framework.autoproxy.BeanFactoryAdvisorRetrievalHelper
Create a new BeanFactoryAdvisorRetrievalHelper for the given BeanFactory.
BeanFactoryAspectInstanceFactory - Class in org.springframework.aop.aspectj.annotation
AspectInstanceFactory implementation backed by a Spring BeanFactory.
BeanFactoryAspectInstanceFactory(BeanFactory, String) - Constructor for class org.springframework.aop.aspectj.annotation.BeanFactoryAspectInstanceFactory
Create a BeanFactoryAspectInstanceFactory.
BeanFactoryAspectInstanceFactory(BeanFactory, String, Class) - Constructor for class org.springframework.aop.aspectj.annotation.BeanFactoryAspectInstanceFactory
Create a BeanFactoryAspectInstanceFactory, providing a type that AspectJ should introspect to create AJType metadata.
BeanFactoryAspectJAdvisorsBuilder - Class in org.springframework.aop.aspectj.annotation
Helper for retrieving @AspectJ beans from a BeanFactory and building Spring Advisors based on them, for use with auto-proxying.
BeanFactoryAspectJAdvisorsBuilder(ListableBeanFactory) - Constructor for class org.springframework.aop.aspectj.annotation.BeanFactoryAspectJAdvisorsBuilder
Create a new BeanFactoryAspectJAdvisorsBuilder for the given BeanFactory.
BeanFactoryAspectJAdvisorsBuilder(ListableBeanFactory, AspectJAdvisorFactory) - Constructor for class org.springframework.aop.aspectj.annotation.BeanFactoryAspectJAdvisorsBuilder
Create a new BeanFactoryAspectJAdvisorsBuilder for the given BeanFactory.
BeanFactoryAware - Interface in org.springframework.beans.factory
Interface to be implemented by beans that wish to be aware of their owning BeanFactory.
BeanFactoryDataSourceLookup - Class in org.springframework.jdbc.datasource.lookup
DataSourceLookup implementation based on a Spring BeanFactory.
BeanFactoryDataSourceLookup() - Constructor for class org.springframework.jdbc.datasource.lookup.BeanFactoryDataSourceLookup
Create a new instance of the BeanFactoryDataSourceLookup class.
BeanFactoryDataSourceLookup(BeanFactory) - Constructor for class org.springframework.jdbc.datasource.lookup.BeanFactoryDataSourceLookup
Create a new instance of the BeanFactoryDataSourceLookup class.
BeanFactoryDestinationResolver - Class in org.springframework.jms.support.destination
DestinationResolver implementation based on a Spring BeanFactory.
BeanFactoryDestinationResolver() - Constructor for class org.springframework.jms.support.destination.BeanFactoryDestinationResolver
Create a new instance of the BeanFactoryDestinationResolver class.
BeanFactoryDestinationResolver(BeanFactory) - Constructor for class org.springframework.jms.support.destination.BeanFactoryDestinationResolver
Create a new instance of the BeanFactoryDestinationResolver class.
BeanFactoryLocator - Interface in org.springframework.beans.factory.access
Defines a contract for the lookup, use, and release of a BeanFactory, or a BeanFactory subclass such as an ApplicationContext.
BeanFactoryPostProcessor - Interface in org.springframework.beans.factory.config
Allows for custom modification of an application context's bean definitions, adapting the bean property values of the context's underlying bean factory.
BeanFactoryReference - Interface in org.springframework.beans.factory.access
Used to track a reference to a BeanFactory obtained through a BeanFactoryLocator.
BeanFactoryRefreshableTargetSource - Class in org.springframework.aop.target.dynamic
Refreshable TargetSource that fetches fresh target beans from a BeanFactory.
BeanFactoryRefreshableTargetSource(BeanFactory, String) - Constructor for class org.springframework.aop.target.dynamic.BeanFactoryRefreshableTargetSource
Create a new BeanFactoryRefreshableTargetSource for the given bean factory and bean name.
BeanFactoryTransactionAttributeSourceAdvisor - Class in org.springframework.transaction.interceptor
Advisor driven by a TransactionAttributeSource, used to include a transaction advice bean for methods that are transactional.
BeanFactoryTransactionAttributeSourceAdvisor() - Constructor for class org.springframework.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor
BeanFactoryUtils - Class in org.springframework.beans.factory
Convenience methods operating on bean factories, in particular on the ListableBeanFactory interface.
BeanFactoryUtils() - Constructor for class org.springframework.beans.factory.BeanFactoryUtils
BeanInitializationException - Exception in org.springframework.beans.factory
Exception that a bean implementation is suggested to throw if its own factory-aware initialization code fails.
BeanInitializationException(String) - Constructor for exception org.springframework.beans.factory.BeanInitializationException
Create a new BeanInitializationException with the specified message.
BeanInitializationException(String, Throwable) - Constructor for exception org.springframework.beans.factory.BeanInitializationException
Create a new BeanInitializationException with the specified message and root cause.
BeanInstantiationException - Exception in org.springframework.beans
Exception thrown when instantiation of a bean failed.
BeanInstantiationException(Class, String) - Constructor for exception org.springframework.beans.BeanInstantiationException
Create a new BeanInstantiationException.
BeanInstantiationException(Class, String, Throwable) - Constructor for exception org.springframework.beans.BeanInstantiationException
Create a new BeanInstantiationException.
BeanIsAbstractException - Exception in org.springframework.beans.factory
Exception thrown when a bean instance has been requested for a bean definition which has been marked as abstract.
BeanIsAbstractException(String) - Constructor for exception org.springframework.beans.factory.BeanIsAbstractException
Create a new BeanIsAbstractException.
BeanIsNotAFactoryException - Exception in org.springframework.beans.factory
Exception thrown when a bean is not a factory, but a user tries to get at the factory for the given bean name.
BeanIsNotAFactoryException(String, Class) - Constructor for exception org.springframework.beans.factory.BeanIsNotAFactoryException
Create a new BeanIsNotAFactoryException.
BeanMetadataAttribute - Class in org.springframework.beans
Holder for a key-value style attribute that is part of a bean definition.
BeanMetadataAttribute(String, Object) - Constructor for class org.springframework.beans.BeanMetadataAttribute
Create a new AttributeValue instance.
BeanMetadataAttributeAccessor - Class in org.springframework.beans
Extension of AttributeAccessorSupport, holding attributes as BeanMetadataAttribute objects in order to keep track of the definition source.
BeanMetadataAttributeAccessor() - Constructor for class org.springframework.beans.BeanMetadataAttributeAccessor
BeanMetadataElement - Interface in org.springframework.beans
Interface to be implemented by bean metadata elements that carry a configuration source object.
BeanNameAutoProxyCreator - Class in org.springframework.aop.framework.autoproxy
Auto proxy creator that identifies beans to proxy via a list of names.
BeanNameAutoProxyCreator() - Constructor for class org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator
BeanNameAware - Interface in org.springframework.beans.factory
Interface to be implemented by beans that want to be aware of their bean name in a bean factory.
BeanNameGenerator - Interface in org.springframework.beans.factory.support
Strategy interface for generating bean names for bean definitions.
beanNamesForTypeIncludingAncestors(ListableBeanFactory, Class) - Static method in class org.springframework.beans.factory.BeanFactoryUtils
Get all bean names for the given type, including those defined in ancestor factories.
beanNamesForTypeIncludingAncestors(ListableBeanFactory, Class, boolean, boolean) - Static method in class org.springframework.beans.factory.BeanFactoryUtils
Get all bean names for the given type, including those defined in ancestor factories.
beanNamesIncludingAncestors(ListableBeanFactory) - Static method in class org.springframework.beans.factory.BeanFactoryUtils
Return all bean names in the factory, including ancestor factories.
BeanNameUrlHandlerMapping - Class in org.springframework.web.servlet.handler
Implementation of the HandlerMapping interface that map from URLs to beans with names that start with a slash ("/"), similar to how Struts maps URLs to action names.
BeanNameUrlHandlerMapping() - Constructor for class org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping
BeanNameViewResolver - Class in org.springframework.web.servlet.view
Simple implementation of ViewResolver that interprets a view name as bean name in the current application context, i.e.
BeanNameViewResolver() - Constructor for class org.springframework.web.servlet.view.BeanNameViewResolver
BeanNotOfRequiredTypeException - Exception in org.springframework.beans.factory
Thrown when a bean doesn't match the expected type.
BeanNotOfRequiredTypeException(String, Class, Class) - Constructor for exception org.springframework.beans.factory.BeanNotOfRequiredTypeException
Create a new BeanNotOfRequiredTypeException.
beanOfType(ListableBeanFactory, Class<T>) - Static method in class org.springframework.beans.factory.BeanFactoryUtils
Return a single bean of the given type or subtypes, not looking in ancestor factories.
beanOfType(ListableBeanFactory, Class<T>, boolean, boolean) - Static method in class org.springframework.beans.factory.BeanFactoryUtils
Return a single bean of the given type or subtypes, not looking in ancestor factories.
beanOfTypeIncludingAncestors(ListableBeanFactory, Class<T>) - Static method in class org.springframework.beans.factory.BeanFactoryUtils
Return a single bean of the given type or subtypes, also picking up beans defined in ancestor bean factories if the current bean factory is a HierarchicalBeanFactory.
beanOfTypeIncludingAncestors(ListableBeanFactory, Class<T>, boolean, boolean) - Static method in class org.springframework.beans.factory.BeanFactoryUtils
Return a single bean of the given type or subtypes, also picking up beans defined in ancestor bean factories if the current bean factory is a HierarchicalBeanFactory.
BeanPostProcessor - Interface in org.springframework.beans.factory.config
Factory hook that allows for custom modification of new bean instances, e.g.
BeanPropertyBindingResult - Class in org.springframework.validation
Default implementation of the Errors and BindingResult interfaces, for the registration and evaluation of binding errors on JavaBean objects.
BeanPropertyBindingResult(Object, String) - Constructor for class org.springframework.validation.BeanPropertyBindingResult
Creates a new instance of the BeanPropertyBindingResult class.
BeanPropertyBindingResult(Object, String, boolean) - Constructor for class org.springframework.validation.BeanPropertyBindingResult
Creates a new instance of the BeanPropertyBindingResult class.
BeanPropertyRowMapper<T> - Class in org.springframework.jdbc.core
RowMapper implementation that converts a row into a new instance of the specified mapped target class.
BeanPropertyRowMapper() - Constructor for class org.springframework.jdbc.core.BeanPropertyRowMapper
Create a new BeanPropertyRowMapper for bean-style configuration.
BeanPropertyRowMapper(Class<T>) - Constructor for class org.springframework.jdbc.core.BeanPropertyRowMapper
Create a new BeanPropertyRowMapper, accepting unpopulated properties in the target bean.
BeanPropertyRowMapper(Class<T>, boolean) - Constructor for class org.springframework.jdbc.core.BeanPropertyRowMapper
Create a new BeanPropertyRowMapper.
BeanPropertySqlParameterSource - Class in org.springframework.jdbc.core.namedparam
SqlParameterSource implementation that obtains parameter values from bean properties of a given JavaBean object.
BeanPropertySqlParameterSource(Object) - Constructor for class org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource
Create a new BeanPropertySqlParameterSource for the given bean.
BeanReference - Interface in org.springframework.beans.factory.config
Interface that exposes a reference to a bean name in an abstract fashion.
BeanReferenceFactoryBean - Class in org.springframework.beans.factory.config
FactoryBean that exposes an arbitrary target bean under a different name.
BeanReferenceFactoryBean() - Constructor for class org.springframework.beans.factory.config.BeanReferenceFactoryBean
BEANS_NAMESPACE_URI - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
BeansDtdResolver - Class in org.springframework.beans.factory.xml
EntityResolver implementation for the Spring beans DTD, to load the DTD from the Spring class path (or JAR file).
BeansDtdResolver() - Constructor for class org.springframework.beans.factory.xml.BeansDtdResolver
BeansException - Exception in org.springframework.beans
Abstract superclass for all exceptions thrown in the beans package and subpackages.
BeansException(String) - Constructor for exception org.springframework.beans.BeansException
Create a new BeansException with the specified message.
BeansException(String, Throwable) - Constructor for exception org.springframework.beans.BeansException
Create a new BeansException with the specified message and root cause.
beansOfTypeIncludingAncestors(ListableBeanFactory, Class<T>) - Static method in class org.springframework.beans.factory.BeanFactoryUtils
Return all beans of the given type or subtypes, also picking up beans defined in ancestor bean factories if the current bean factory is a HierarchicalBeanFactory.
beansOfTypeIncludingAncestors(ListableBeanFactory, Class<T>, boolean, boolean) - Static method in class org.springframework.beans.factory.BeanFactoryUtils
Return all beans of the given type or subtypes, also picking up beans defined in ancestor bean factories if the current bean factory is a HierarchicalBeanFactory.
BeanUtils - Class in org.springframework.beans
Static convenience methods for JavaBeans: for instantiating beans, checking bean property types, copying bean properties, etc.
BeanUtils() - Constructor for class org.springframework.beans.BeanUtils
BeanValidationPostProcessor - Class in org.springframework.validation.beanvalidation
Simple BeanPostProcessor that checks JSR-303 constraint annotations in Spring-managed beans, throwing an initialization exception in case of constraint violations right before calling the bean's init method (if any).
BeanValidationPostProcessor() - Constructor for class org.springframework.validation.beanvalidation.BeanValidationPostProcessor
BeanWiringInfo - Class in org.springframework.beans.factory.wiring
Holder for bean wiring metadata information about a particular class.
BeanWiringInfo() - Constructor for class org.springframework.beans.factory.wiring.BeanWiringInfo
Create a default BeanWiringInfo that suggests plain initialization of factory and post-processor callbacks that the bean class may expect.
BeanWiringInfo(String) - Constructor for class org.springframework.beans.factory.wiring.BeanWiringInfo
Create a new BeanWiringInfo that points to the given bean name.
BeanWiringInfo(String, boolean) - Constructor for class org.springframework.beans.factory.wiring.BeanWiringInfo
Create a new BeanWiringInfo that points to the given bean name.
BeanWiringInfo(int, boolean) - Constructor for class org.springframework.beans.factory.wiring.BeanWiringInfo
Create a new BeanWiringInfo that indicates autowiring.
BeanWiringInfoResolver - Interface in org.springframework.beans.factory.wiring
Strategy interface to be implemented by objects than can resolve bean name information, given a newly instantiated bean object.
BeanWrapper - Interface in org.springframework.beans
The central interface of Spring's low-level JavaBeans infrastructure.
BeanWrapperImpl - Class in org.springframework.beans
Default BeanWrapper implementation that should be sufficient for all typical use cases.
BeanWrapperImpl() - Constructor for class org.springframework.beans.BeanWrapperImpl
Create new empty BeanWrapperImpl.
BeanWrapperImpl(boolean) - Constructor for class org.springframework.beans.BeanWrapperImpl
Create new empty BeanWrapperImpl.
BeanWrapperImpl(Object) - Constructor for class org.springframework.beans.BeanWrapperImpl
Create new BeanWrapperImpl for the given object.
BeanWrapperImpl(Class<?>) - Constructor for class org.springframework.beans.BeanWrapperImpl
Create new BeanWrapperImpl, wrapping a new instance of the specified class.
BeanWrapperImpl(Object, String, Object) - Constructor for class org.springframework.beans.BeanWrapperImpl
Create new BeanWrapperImpl for the given object, registering a nested path that the object is in.
before(Method, Object[], Object) - Method in class org.springframework.aop.aspectj.AspectJMethodBeforeAdvice
before(Method, Object[], Object) - Method in interface org.springframework.aop.MethodBeforeAdvice
Callback before a given method is invoked.
beforeAccess() - Method in class org.springframework.util.ConcurrencyThrottleSupport
To be invoked before the main execution logic of concrete subclasses.
BeforeAdvice - Interface in org.springframework.aop
Common marker interface for before advice, such as MethodBeforeAdvice.
beforeCommit(boolean) - Method in class org.springframework.transaction.support.ResourceHolderSynchronization
beforeCommit(boolean) - Method in interface org.springframework.transaction.support.TransactionSynchronization
Invoked before transaction commit (before "beforeCompletion").
beforeCommit(boolean) - Method in class org.springframework.transaction.support.TransactionSynchronizationAdapter
beforeCompletion() - Method in class org.springframework.jdbc.support.lob.JtaLobCreatorSynchronization
beforeCompletion() - Method in class org.springframework.jdbc.support.lob.SpringLobCreatorSynchronization
beforeCompletion() - Method in class org.springframework.transaction.jta.JtaAfterCompletionSynchronization
beforeCompletion() - Method in class org.springframework.transaction.jta.SpringJtaSynchronizationAdapter
JTA beforeCompletion callback: just invoked before commit.
beforeCompletion() - Method in class org.springframework.transaction.support.ResourceHolderSynchronization
beforeCompletion() - Method in interface org.springframework.transaction.support.TransactionSynchronization
Invoked before transaction commit/rollback.
beforeCompletion() - Method in class org.springframework.transaction.support.TransactionSynchronizationAdapter
beforeDelivery(Method) - Method in class org.springframework.jca.endpoint.AbstractMessageEndpointFactory.AbstractMessageEndpoint
This beforeDelivery implementation starts a transaction, if necessary, and exposes the endpoint ClassLoader as current thread context ClassLoader.
beforeFirst() - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
beforeFirst() - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Moves the cursor to the front of this RowSet, just before the first row.
beforePhase(PhaseEvent) - Method in class org.springframework.web.jsf.DelegatingPhaseListenerMulticaster
beforePrototypeCreation(String) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Callback before prototype creation.
beforeRequest(HttpServletRequest, String) - Method in class org.springframework.web.filter.AbstractRequestLoggingFilter
Concrete subclasses should implement this method to write a log message before the request is processed.
beforeRequest(HttpServletRequest, String) - Method in class org.springframework.web.filter.CommonsRequestLoggingFilter
Writes a log message before the request is processed.
beforeRequest(HttpServletRequest, String) - Method in class org.springframework.web.filter.Log4jNestedDiagnosticContextFilter
Logs the before-request message through Log4J and adds a message the Log4J NDC before the request is processed.
beforeRequest(HttpServletRequest, String) - Method in class org.springframework.web.filter.ServletContextRequestLoggingFilter
Writes a log message before the request is processed.
beforeSessionFactoryDestruction() - Method in class org.springframework.orm.hibernate3.AbstractSessionFactoryBean
Hook that allows shutdown processing before the SessionFactory will be closed.
beforeSingletonCreation(String) - Method in class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
Callback before singleton creation.
beforeTestClass(TestContext) - Method in class org.springframework.test.context.support.AbstractTestExecutionListener
The default implementation is empty.
beforeTestClass() - Method in class org.springframework.test.context.TestContextManager
Hook for pre-processing a test class before execution of any tests within the class.
beforeTestClass(TestContext) - Method in interface org.springframework.test.context.TestExecutionListener
Pre-processes a test class before execution of all tests within the class.
beforeTestMethod(TestContext) - Method in class org.springframework.test.context.support.AbstractTestExecutionListener
The default implementation is empty.
beforeTestMethod(TestContext) - Method in class org.springframework.test.context.support.DependencyInjectionTestExecutionListener
If the DependencyInjectionTestExecutionListener.REINJECT_DEPENDENCIES_ATTRIBUTE in the supplied test context has a value of Boolean.TRUE, this method will have the same effect as prepareTestInstance(); otherwise, this method will have no effect.
beforeTestMethod(Object, Method) - Method in class org.springframework.test.context.TestContextManager
Hook for pre-processing a test before execution of the supplied test method, for example for setting up test fixtures, starting a transaction, etc.
beforeTestMethod(TestContext) - Method in interface org.springframework.test.context.TestExecutionListener
Pre-processes a test before execution of the test method in the supplied test context, for example by setting up test fixtures.
beforeTestMethod(TestContext) - Method in class org.springframework.test.context.transaction.TransactionalTestExecutionListener
If the test method of the supplied test context is configured to run within a transaction, this method will run @BeforeTransaction methods and start a new transaction.
BeforeTransaction - Annotation Type in org.springframework.test.context.transaction
Test annotation to indicate that the annotated public void method should be executed before a transaction is started for test methods configured to run within a transaction via the @Transactional annotation.
begin() - Method in class org.springframework.transaction.jta.UserTransactionAdapter
beginTransaction(Transaction, TransactionDefinition) - Method in class org.springframework.orm.jdo.DefaultJdoDialect
This implementation invokes the standard JDO Transaction.begin method.
beginTransaction(Transaction, TransactionDefinition) - Method in interface org.springframework.orm.jdo.JdoDialect
Begin the given JDO transaction, applying the semantics specified by the given Spring transaction definition (in particular, an isolation level and a timeout).
beginTransaction(EntityManager, TransactionDefinition) - Method in class org.springframework.orm.jpa.DefaultJpaDialect
This implementation invokes the standard JPA Transaction.begin method.
beginTransaction(EntityManager, TransactionDefinition) - Method in interface org.springframework.orm.jpa.JpaDialect
Begin the given JPA transaction, applying the semantics specified by the given Spring transaction definition (in particular, an isolation level and a timeout).
beginTransaction(EntityManager, TransactionDefinition) - Method in class org.springframework.orm.jpa.vendor.EclipseLinkJpaDialect
beginTransaction(EntityManager, TransactionDefinition) - Method in class org.springframework.orm.jpa.vendor.HibernateJpaDialect
beginTransaction(EntityManager, TransactionDefinition) - Method in class org.springframework.orm.jpa.vendor.OpenJpaDialect
beginTransaction(EntityManager, TransactionDefinition) - Method in class org.springframework.orm.jpa.vendor.TopLinkJpaDialect
BEST_MATCHING_PATTERN_ATTRIBUTE - Static variable in interface org.springframework.web.servlet.HandlerMapping
Name of the HttpServletRequest attribute that contains the best matching pattern within the handler mapping.
bind(String, Object) - Method in class org.springframework.jndi.JndiTemplate
Bind the given object to the current JNDI context, using the given name.
bind(String, Object) - Method in class org.springframework.mock.jndi.SimpleNamingContext
Bind the given object to the given name.
bind(Name, Object) - Method in class org.springframework.mock.jndi.SimpleNamingContext
bind(String, Object) - Method in class org.springframework.mock.jndi.SimpleNamingContextBuilder
Bind the given object under the given name, for all naming contexts that this context builder will generate.
bind(PropertyValues) - Method in class org.springframework.validation.DataBinder
Bind the given property values to this binder's target.
bind(ServletRequest) - Method in class org.springframework.web.bind.ServletRequestDataBinder
Bind the parameters of the given request to this binder's target, also binding multipart files in case of a multipart request.
bind(WebRequest) - Method in class org.springframework.web.bind.support.WebRequestDataBinder
Bind the parameters of the given request to this binder's target, also binding multipart files in case of a multipart request.
bind(PortletRequest) - Method in class org.springframework.web.portlet.bind.PortletRequestDataBinder
Bind the parameters of the given request to this binder's target, also binding multipart files in case of a multipart request.
bind(HttpServletRequest, Object) - Method in class org.springframework.web.servlet.mvc.multiaction.MultiActionController
Bind request parameters onto the given command bean
bindAndValidate(PortletRequest, Object) - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Bind the parameters of the given request to the given command object.
bindAndValidate(HttpServletRequest, Object) - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Bind the parameters of the given request to the given command object.
bindDefaultNamespaceUri(String) - Method in class org.springframework.util.xml.SimpleNamespaceContext
Binds the given namespace as default namespace.
BindErrorsTag - Class in org.springframework.web.servlet.tags
JSP tag that evaluates content if there are binding errors for a certain bean.
BindErrorsTag() - Constructor for class org.springframework.web.servlet.tags.BindErrorsTag
BindException - Exception in org.springframework.validation
Thrown when binding errors are considered fatal.
BindException(BindingResult) - Constructor for exception org.springframework.validation.BindException
Create a new BindException instance for a BindingResult.
BindException(Object, String) - Constructor for exception org.springframework.validation.BindException
Create a new BindException instance for a target bean.
BindingAwareModelMap - Class in org.springframework.validation.support
Subclass of ExtendedModelMap that automatically removes a BindingResult object if the corresponding target attribute gets replaced.
BindingAwareModelMap() - Constructor for class org.springframework.validation.support.BindingAwareModelMap
BindingErrorProcessor - Interface in org.springframework.validation
Strategy for processing DataBinder's missing field errors, and for translating a PropertyAccessException to a FieldError.
BindingResult - Interface in org.springframework.validation
General interface that represents binding results.
BindingResultUtils - Class in org.springframework.validation
Convenience methods for looking up BindingResults in a model Map.
BindingResultUtils() - Constructor for class org.springframework.validation.BindingResultUtils
bindMultipartFiles(Map<String, MultipartFile>, MutablePropertyValues) - Method in class org.springframework.web.bind.WebDataBinder
Bind the multipart files contained in the given request, if any (in case of a multipart request).
bindNamespaceUri(String, String) - Method in class org.springframework.util.xml.SimpleNamespaceContext
Binds the given prefix to the given namespace.
bindResource(Object, Object) - Static method in class org.springframework.transaction.support.TransactionSynchronizationManager
Bind the given resource for the given key to the current thread.
BindStatus - Class in org.springframework.web.servlet.support
Simple adapter to expose the bind status of a field or object.
BindStatus(RequestContext, String, boolean) - Constructor for class org.springframework.web.servlet.support.BindStatus
Create a new BindStatus instance, representing a field or object status.
BindTag - Class in org.springframework.web.servlet.tags
Bind tag, supporting evaluation of binding errors for a certain bean or bean property.
BindTag() - Constructor for class org.springframework.web.servlet.tags.BindTag
BlobByteArrayType - Class in org.springframework.orm.hibernate3.support
Hibernate UserType implementation for byte arrays that get mapped to BLOBs.
BlobByteArrayType() - Constructor for class org.springframework.orm.hibernate3.support.BlobByteArrayType
Constructor used by Hibernate: fetches config-time LobHandler and config-time JTA TransactionManager from LocalSessionFactoryBean.
BlobByteArrayType(LobHandler, TransactionManager) - Constructor for class org.springframework.orm.hibernate3.support.BlobByteArrayType
Constructor used for testing: takes an explicit LobHandler and an explicit JTA TransactionManager (can be null).
BlobByteArrayTypeHandler - Class in org.springframework.orm.ibatis.support
iBATIS TypeHandler implementation for byte arrays that get mapped to BLOBs.
BlobByteArrayTypeHandler() - Constructor for class org.springframework.orm.ibatis.support.BlobByteArrayTypeHandler
Constructor used by iBATIS: fetches config-time LobHandler from SqlMapClientFactoryBean.
BlobByteArrayTypeHandler(LobHandler) - Constructor for class org.springframework.orm.ibatis.support.BlobByteArrayTypeHandler
Constructor used for testing: takes an explicit LobHandler.
BlobSerializableType - Class in org.springframework.orm.hibernate3.support
Hibernate UserType implementation for arbitrary objects that get serialized to BLOBs.
BlobSerializableType() - Constructor for class org.springframework.orm.hibernate3.support.BlobSerializableType
Constructor used by Hibernate: fetches config-time LobHandler and config-time JTA TransactionManager from LocalSessionFactoryBean.
BlobSerializableType(LobHandler, TransactionManager) - Constructor for class org.springframework.orm.hibernate3.support.BlobSerializableType
Constructor used for testing: takes an explicit LobHandler and an explicit JTA TransactionManager (can be null).
BlobSerializableTypeHandler - Class in org.springframework.orm.ibatis.support
iBATIS TypeHandler implementation for arbitrary objects that get serialized to BLOBs.
BlobSerializableTypeHandler() - Constructor for class org.springframework.orm.ibatis.support.BlobSerializableTypeHandler
Constructor used by iBATIS: fetches config-time LobHandler from SqlMapClientFactoryBean.
BlobSerializableTypeHandler(LobHandler) - Constructor for class org.springframework.orm.ibatis.support.BlobSerializableTypeHandler
Constructor used for testing: takes an explicit LobHandler.
BlobStringType - Class in org.springframework.orm.hibernate3.support
Hibernate UserType implementation for Strings that get mapped to BLOBs.
BlobStringType() - Constructor for class org.springframework.orm.hibernate3.support.BlobStringType
Constructor used by Hibernate: fetches config-time LobHandler and config-time JTA TransactionManager from LocalSessionFactoryBean.
BlobStringType(LobHandler, TransactionManager) - Constructor for class org.springframework.orm.hibernate3.support.BlobStringType
Constructor used for testing: takes an explicit LobHandler and an explicit JTA TransactionManager (can be null).
blockForAvailableThreads() - Method in class org.springframework.scheduling.quartz.LocalTaskExecutorThreadPool
BooleanComparator - Class in org.springframework.util.comparator
A Comparator for Boolean objects that can sort either true or false first.
BooleanComparator(boolean) - Constructor for class org.springframework.util.comparator.BooleanComparator
Create a BooleanComparator that sorts boolean values based on the provided flag.
BooleanLiteral - Class in org.springframework.expression.spel.ast
Represents the literal values TRUE and FALSE.
BooleanLiteral(String, int, boolean) - Constructor for class org.springframework.expression.spel.ast.BooleanLiteral
BooleanTypedValue - Class in org.springframework.expression.spel.support
BootstrapContextAware - Interface in org.springframework.jca.context
Interface to be implemented by any object that wishes to be notified of the BootstrapContext (typically determined by the ResourceAdapterApplicationContext) that it runs in.
BootstrapException - Exception in org.springframework.beans.factory.access
Exception thrown if a bean factory could not be loaded by a bootstrap class.
BootstrapException(String) - Constructor for exception org.springframework.beans.factory.access.BootstrapException
Create a new BootstrapException with the specified message.
BootstrapException(String, Throwable) - Constructor for exception org.springframework.beans.factory.access.BootstrapException
Create a new BootstrapException with the specified message and root cause.
BridgeMethodResolver - Class in org.springframework.core
Helper for resolving synthetic bridge Methods to the Method being bridged.
BridgeMethodResolver() - Constructor for class org.springframework.core.BridgeMethodResolver
browse(BrowserCallback<T>) - Method in interface org.springframework.jms.core.JmsOperations
Browse messages in the default JMS queue.
browse(Queue, BrowserCallback<T>) - Method in interface org.springframework.jms.core.JmsOperations
Browse messages in a JMS queue.
browse(String, BrowserCallback<T>) - Method in interface org.springframework.jms.core.JmsOperations
Browse messages in a JMS queue.
browse(BrowserCallback<T>) - Method in class org.springframework.jms.core.JmsTemplate
browse(Queue, BrowserCallback<T>) - Method in class org.springframework.jms.core.JmsTemplate
browse(String, BrowserCallback<T>) - Method in class org.springframework.jms.core.JmsTemplate
BrowserCallback<T> - Interface in org.springframework.jms.core
Callback for browsing the messages in a JMS queue.
browseSelected(String, BrowserCallback<T>) - Method in interface org.springframework.jms.core.JmsOperations
Browse selected messages in a JMS queue.
browseSelected(Queue, String, BrowserCallback<T>) - Method in interface org.springframework.jms.core.JmsOperations
Browse selected messages in a JMS queue.
browseSelected(String, String, BrowserCallback<T>) - Method in interface org.springframework.jms.core.JmsOperations
Browse selected messages in a JMS queue.
browseSelected(String, BrowserCallback<T>) - Method in class org.springframework.jms.core.JmsTemplate
browseSelected(Queue, String, BrowserCallback<T>) - Method in class org.springframework.jms.core.JmsTemplate
browseSelected(String, String, BrowserCallback<T>) - Method in class org.springframework.jms.core.JmsTemplate
BshScriptFactory - Class in org.springframework.scripting.bsh
ScriptFactory implementation for a BeanShell script.
BshScriptFactory(String) - Constructor for class org.springframework.scripting.bsh.BshScriptFactory
Create a new BshScriptFactory for the given script source.
BshScriptFactory(String, Class[]) - Constructor for class org.springframework.scripting.bsh.BshScriptFactory
Create a new BshScriptFactory for the given script source.
BshScriptUtils - Class in org.springframework.scripting.bsh
Utility methods for handling BeanShell-scripted objects.
BshScriptUtils() - Constructor for class org.springframework.scripting.bsh.BshScriptUtils
BshScriptUtils.BshExecutionException - Exception in org.springframework.scripting.bsh
Exception to be thrown on script execution failure.
BUFFER_SIZE - Static variable in class org.springframework.jms.support.converter.SimpleMessageConverter102
Deprecated.
BUFFER_SIZE - Static variable in class org.springframework.util.FileCopyUtils
BufferedImageHttpMessageConverter - Class in org.springframework.http.converter
Implementation of HttpMessageConverter that can read and write BufferedImages.
BufferedImageHttpMessageConverter() - Constructor for class org.springframework.http.converter.BufferedImageHttpMessageConverter
build() - Method in class org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder
Build the embedded database.
buildAdvice(Executor) - Method in class org.springframework.scheduling.annotation.AsyncAnnotationAdvisor
buildAdvisors(String, Object[]) - Method in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
Determine the advisors for the given bean, including the specific interceptors as well as the common interceptor, all adapted to the Advisor interface.
buildAspectJAdvisors() - Method in class org.springframework.aop.aspectj.annotation.BeanFactoryAspectJAdvisorsBuilder
Look for AspectJ-annotated aspect beans in the current bean factory, and return to a list of Spring AOP Advisors representing them.
buildCache(String, Properties) - Method in class org.springframework.orm.hibernate3.LocalCacheProviderProxy
buildCollectionRegion(String, Properties, CacheDataDescription) - Method in class org.springframework.orm.hibernate3.LocalRegionFactoryProxy
buildDefaultBeanName(BeanDefinition) - Method in class org.springframework.context.annotation.AnnotationBeanNameGenerator
Derive a default bean name from the given bean definition.
buildEntityRegion(String, Properties, CacheDataDescription) - Method in class org.springframework.orm.hibernate3.LocalRegionFactoryProxy
buildExcelDocument(Map<String, Object>, HSSFWorkbook, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.document.AbstractExcelView
Subclasses must implement this method to create an Excel HSSFWorkbook document, given the model.
buildExcelDocument(Map<String, Object>, WritableWorkbook, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.document.AbstractJExcelView
Subclasses must implement this method to create an Excel Workbook document, given the model.
buildExceptionMessage(JMSException) - Static method in class org.springframework.jms.support.JmsUtils
Build a descriptive exception message for the given JMSException, incorporating a linked exception's message if appropriate.
buildFeedEntries(Map<String, Object>, Feed, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.feed.AbstractAtomFeedView
Invokes AbstractAtomFeedView.buildFeedEntries(Map, HttpServletRequest, HttpServletResponse) to get a list of feed entries.
buildFeedEntries(Map<String, Object>, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.feed.AbstractAtomFeedView
Subclasses must implement this method to build feed entries, given the model.
buildFeedEntries(Map<String, Object>, T, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.feed.AbstractFeedView
Subclasses must implement this method to build feed entries, given the model.
buildFeedEntries(Map<String, Object>, Channel, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.feed.AbstractRssFeedView
Invokes AbstractRssFeedView.buildFeedItems(Map, HttpServletRequest, HttpServletResponse) to get a list of feed items.
buildFeedItems(Map<String, Object>, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.feed.AbstractRssFeedView
Subclasses must implement this method to build feed items, given the model.
buildFeedMetadata(Map<String, Object>, T, HttpServletRequest) - Method in class org.springframework.web.servlet.view.feed.AbstractFeedView
Populate the feed metadata (title, link, description, etc.).
buildFieldList(String, List<String>) - Method in class org.springframework.validation.DefaultMessageCodesResolver
Add both keyed and non-keyed entries for the supplied field to the supplied field list.
buildHttpContext(Endpoint, String) - Method in class org.springframework.remoting.jaxws.SimpleHttpServerJaxWsServiceExporter
Build the HttpContext for the given endpoint.
buildInternalBeanFactory(ConfigurableBeanFactory) - Method in class org.springframework.aop.framework.autoproxy.target.AbstractBeanFactoryBasedTargetSourceCreator
Build an internal BeanFactory for resolving target beans.
buildListenerArguments(Object) - Method in class org.springframework.jms.listener.adapter.MessageListenerAdapter
Build an array of arguments to be passed into the target listener method.
buildLocaleContext(PortletRequest) - Method in class org.springframework.web.portlet.FrameworkPortlet
Build a LocaleContext for the given request, exposing the request's primary locale as current locale.
buildLocaleContext(HttpServletRequest) - Method in class org.springframework.web.servlet.DispatcherServlet
Build a LocaleContext for the given request, exposing the request's primary locale as current locale.
buildLocaleContext(HttpServletRequest) - Method in class org.springframework.web.servlet.FrameworkServlet
Build a LocaleContext for the given request, exposing the request's primary locale as current locale.
buildLogMessage(Exception, PortletRequest) - Method in class org.springframework.web.portlet.handler.AbstractHandlerExceptionResolver
Build a log message for the given exception, occured during processing the given request.
buildLogMessage(Exception, HttpServletRequest) - Method in class org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
Build a log message for the given exception, occured during processing the given request.
buildMessage(String, Throwable) - Static method in class org.springframework.core.NestedExceptionUtils
Build a message for the given base message and root cause.
buildMessage(String, String, SQLException) - Method in class org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator
Build a message String for the given SQLException.
buildMessage(Session, Object) - Method in class org.springframework.jms.listener.adapter.MessageListenerAdapter
Build a JMS message to be sent as response based on the given result object.
buildPathExposingHandler(Object, String, String, Map<String, String>) - Method in class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
Build a handler object for the given raw handler, exposing the actual handler, the HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, as well as the HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE before executing the handler.
buildPdfDocument(Map<String, Object>, Document, PdfWriter, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.document.AbstractPdfView
Subclasses must implement this method to build an iText PDF document, given the model.
buildPdfMetadata(Map<String, Object>, Document, HttpServletRequest) - Method in class org.springframework.web.servlet.view.document.AbstractPdfView
Populate the iText Document's meta fields (author, title, etc.).
buildPointcut(Set<Class<? extends Annotation>>) - Method in class org.springframework.scheduling.annotation.AsyncAnnotationAdvisor
Calculate a pointcut for the given target class, if any.
buildQueryResultsRegion(String, Properties) - Method in class org.springframework.orm.hibernate3.LocalRegionFactoryProxy
buildSafePointcut() - Method in class org.springframework.aop.aspectj.AbstractAspectJAdvice
Build a 'safe' pointcut that excludes the AspectJ advice method itself.
buildSessionFactory() - Method in class org.springframework.orm.hibernate3.AbstractSessionFactoryBean
Build the underlying Hibernate SessionFactory.
buildSessionFactory() - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
buildSqlMapClient(Resource[], Resource[], Properties) - Method in class org.springframework.orm.ibatis.SqlMapClientFactoryBean
Build a SqlMapClient instance based on the given standard configuration.
buildSqlTypeArray(ParsedSql, SqlParameterSource) - Static method in class org.springframework.jdbc.core.namedparam.NamedParameterUtils
Convert a Map of parameter types to a corresponding int array.
buildTemplateModel(Map<String, Object>, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.freemarker.FreeMarkerView
Build a FreeMarker template model for the given model Map.
buildTimestampsRegion(String, Properties) - Method in class org.springframework.orm.hibernate3.LocalRegionFactoryProxy
buildTransformer(Map<String, Object>) - Method in class org.springframework.web.servlet.view.xslt.AbstractXsltView
Deprecated. Build a Transformer object for immediate use, based on the given parameters.
buildTypedStringValue(String, String) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Build a typed String value Object for the given raw value.
buildTypedStringValueForMap(String, String, Element) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Build a typed String value Object for the given raw value.
buildUrlsForHandler(String, Class) - Method in class org.springframework.web.servlet.mvc.support.AbstractControllerUrlHandlerMapping
Abstract template method to be implemented by subclasses.
buildUrlsForHandler(String, Class) - Method in class org.springframework.web.servlet.mvc.support.ControllerBeanNameHandlerMapping
buildUrlsForHandler(String, Class) - Method in class org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping
buildUserTransaction(TransactionManager) - Method in class org.springframework.transaction.jta.JtaTransactionManager
Build a UserTransaction handle based on the given TransactionManager.
buildValueArray(ParsedSql, SqlParameterSource, List<SqlParameter>) - Static method in class org.springframework.jdbc.core.namedparam.NamedParameterUtils
Convert a Map of named parameter values to a corresponding array.
buildValueArray(String, Map<String, ?>) - Static method in class org.springframework.jdbc.core.namedparam.NamedParameterUtils
Convert a Map of named parameter values to a corresponding array.
buildView(String) - Method in class org.springframework.web.servlet.view.AbstractTemplateViewResolver
buildView(String) - Method in class org.springframework.web.servlet.view.InternalResourceViewResolver
buildView(String) - Method in class org.springframework.web.servlet.view.jasperreports.JasperReportsViewResolver
buildView(String) - Method in class org.springframework.web.servlet.view.UrlBasedViewResolver
Creates a new View instance of the specified view class and configures it.
buildView(String) - Method in class org.springframework.web.servlet.view.velocity.VelocityLayoutViewResolver
buildView(String) - Method in class org.springframework.web.servlet.view.velocity.VelocityViewResolver
buildView(String) - Method in class org.springframework.web.servlet.view.xslt.XsltViewResolver
buildWiringInfo(Object, Configurable) - Method in class org.springframework.beans.factory.annotation.AnnotationBeanWiringInfoResolver
Build the BeanWiringInfo for the given Configurable annotation.
bulkUpdate(String) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Update/delete all objects according to the given query.
bulkUpdate(String, Object) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Update/delete all objects according to the given query, binding one value to a "?" parameter in the query string.
bulkUpdate(String, Object...) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Update/delete all objects according to the given query, binding a number of values to "?" parameters in the query string.
bulkUpdate(String) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
bulkUpdate(String, Object) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
bulkUpdate(String, Object...) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
BurlapClientInterceptor - Class in org.springframework.remoting.caucho
MethodInterceptor for accessing a Burlap service.
BurlapClientInterceptor() - Constructor for class org.springframework.remoting.caucho.BurlapClientInterceptor
BurlapExporter - Class in org.springframework.remoting.caucho
General stream-based protocol exporter for a Burlap endpoint.
BurlapExporter() - Constructor for class org.springframework.remoting.caucho.BurlapExporter
BurlapProxyFactoryBean - Class in org.springframework.remoting.caucho
FactoryBean for Burlap proxies.
BurlapProxyFactoryBean() - Constructor for class org.springframework.remoting.caucho.BurlapProxyFactoryBean
BurlapServiceExporter - Class in org.springframework.remoting.caucho
Servlet-API-based HTTP request handler that exports the specified service bean as Burlap service endpoint, accessible via a Burlap proxy.
BurlapServiceExporter() - Constructor for class org.springframework.remoting.caucho.BurlapServiceExporter
byPassReturnParameter(String) - Method in interface org.springframework.jdbc.core.metadata.CallMetaDataProvider
Should we bypass the return parameter with the specified name.
byPassReturnParameter(String) - Method in class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
byPassReturnParameter(String) - Method in class org.springframework.jdbc.core.metadata.PostgresCallMetaDataProvider
byPassReturnParameter(String) - Method in class org.springframework.jdbc.core.metadata.SqlServerCallMetaDataProvider
byPassReturnParameter(String) - Method in class org.springframework.jdbc.core.metadata.SybaseCallMetaDataProvider
ByteArrayHttpMessageConverter - Class in org.springframework.http.converter
Implementation of HttpMessageConverter that can read and write byte arrays.
ByteArrayHttpMessageConverter() - Constructor for class org.springframework.http.converter.ByteArrayHttpMessageConverter
Creates a new instance of the ByteArrayHttpMessageConverter.
ByteArrayMultipartFileEditor - Class in org.springframework.web.multipart.support
Custom PropertyEditor for converting MultipartFiles to byte arrays.
ByteArrayMultipartFileEditor() - Constructor for class org.springframework.web.multipart.support.ByteArrayMultipartFileEditor
ByteArrayPropertyEditor - Class in org.springframework.beans.propertyeditors
Editor for byte arrays.
ByteArrayPropertyEditor() - Constructor for class org.springframework.beans.propertyeditors.ByteArrayPropertyEditor
ByteArrayResource - Class in org.springframework.core.io
Resource implementation for a given byte array.
ByteArrayResource(byte[]) - Constructor for class org.springframework.core.io.ByteArrayResource
Create a new ByteArrayResource.
ByteArrayResource(byte[], String) - Constructor for class org.springframework.core.io.ByteArrayResource
Create a new ByteArrayResource.
bytesToObject(byte[]) - Method in class org.springframework.jca.cci.object.MappingCommAreaOperation
Method used to convert the COMMAREA's bytes to an object.
Overview Package Class Tree Deprecated Index Help
A B C D E F G H I J K L M N O P Q R S T U V W X


C-Index

PREV LETTER NEXT LETTER FRAMES NO FRAMES
A B C D E F G H I J K L M N O P Q R S T U V W X

C

C3P0NativeJdbcExtractor - Class in org.springframework.jdbc.support.nativejdbc
Implementation of the NativeJdbcExtractor interface for the C3P0 connection pool.
C3P0NativeJdbcExtractor() - Constructor for class org.springframework.jdbc.support.nativejdbc.C3P0NativeJdbcExtractor
CACHE_AUTO - Static variable in class org.springframework.jms.listener.DefaultMessageListenerContainer
Constant that indicates automatic choice of an appropriate caching level (depending on the transaction management strategy).
CACHE_CONNECTION - Static variable in class org.springframework.jms.listener.DefaultMessageListenerContainer
Constant that indicates to cache a shared JMS Connection.
CACHE_CONSUMER - Static variable in class org.springframework.jms.listener.DefaultMessageListenerContainer
Constant that indicates to cache a shared JMS Connection and a JMS Session for each listener thread, as well as a JMS MessageConsumer for each listener thread.
CACHE_NONE - Static variable in class org.springframework.jms.listener.DefaultMessageListenerContainer
Constant that indicates to cache no JMS resources at all.
CACHE_SESSION - Static variable in class org.springframework.jms.listener.DefaultMessageListenerContainer
Constant that indicates to cache a shared JMS Connection and a JMS Session for each listener thread.
CachedIntrospectionResults - Class in org.springframework.beans
Internal class that caches JavaBeans PropertyDescriptor information for a Java class.
cacheForSeconds(MimeResponse, int) - Method in class org.springframework.web.portlet.handler.PortletContentGenerator
Set portlet response to allow caching for the given number of seconds.
cacheForSeconds(HttpServletResponse, int) - Method in class org.springframework.web.servlet.support.WebContentGenerator
Set HTTP headers to allow caching for the given number of seconds.
cacheForSeconds(HttpServletResponse, int, boolean) - Method in class org.springframework.web.servlet.support.WebContentGenerator
Set HTTP headers to allow caching for the given number of seconds.
cacheKeys() - Method in class org.springframework.test.jpa.AbstractJpaTests
Deprecated.
CachingConnectionFactory - Class in org.springframework.jms.connection
SingleConnectionFactory subclass that adds Session caching as well MessageProducer caching.
CachingConnectionFactory() - Constructor for class org.springframework.jms.connection.CachingConnectionFactory
Create a new CachingConnectionFactory for bean-style usage.
CachingConnectionFactory(ConnectionFactory) - Constructor for class org.springframework.jms.connection.CachingConnectionFactory
Create a new CachingConnectionFactory for the given target ConnectionFactory.
CachingDestinationResolver - Interface in org.springframework.jms.support.destination
Extension of the DestinationResolver interface, exposing methods for clearing the cache.
CachingMapDecorator<K,V> - Class in org.springframework.util
A simple decorator for a Map, encapsulating the workflow for caching expensive values in a target Map.
CachingMapDecorator() - Constructor for class org.springframework.util.CachingMapDecorator
Create a CachingMapDecorator with strong keys, using an underlying synchronized Map.
CachingMapDecorator(boolean) - Constructor for class org.springframework.util.CachingMapDecorator
Create a CachingMapDecorator, using an underlying synchronized Map.
CachingMapDecorator(boolean, int) - Constructor for class org.springframework.util.CachingMapDecorator
Create a CachingMapDecorator with initial size, using an underlying synchronized Map.
CachingMapDecorator(Map<K, V>) - Constructor for class org.springframework.util.CachingMapDecorator
Create a CachingMapDecorator for the given Map.
CachingMapDecorator(Map<K, V>, boolean, boolean) - Constructor for class org.springframework.util.CachingMapDecorator
Create a CachingMapDecorator for the given Map.
CachingMetadataReaderFactory - Class in org.springframework.core.type.classreading
Caching implementation of the MetadataReaderFactory interface, caching MetadataReader per Spring Resource handle (i.e.
CachingMetadataReaderFactory() - Constructor for class org.springframework.core.type.classreading.CachingMetadataReaderFactory
Create a new CachingMetadataReaderFactory for the default class loader.
CachingMetadataReaderFactory(ResourceLoader) - Constructor for class org.springframework.core.type.classreading.CachingMetadataReaderFactory
Create a new CachingMetadataReaderFactory for the given resource loader.
CachingMetadataReaderFactory(ClassLoader) - Constructor for class org.springframework.core.type.classreading.CachingMetadataReaderFactory
Create a new CachingMetadataReaderFactory for the given class loader.
calculateAllFilenames(String, Locale) - Method in class org.springframework.context.support.ReloadableResourceBundleMessageSource
Calculate all filenames for the given bundle basename and Locale.
calculateArgumentBindings() - Method in class org.springframework.aop.aspectj.AbstractAspectJAdvice
Do as much work as we can as part of the set-up so that argument binding on subsequent advice invocations can be as fast as possible.
calculateEndpointAddress(Endpoint, String) - Method in class org.springframework.remoting.jaxws.SimpleJaxWsServiceExporter
Calculate the full endpoint address for the given endpoint.
calculateEndpointPath(Endpoint, String) - Method in class org.springframework.remoting.jaxws.SimpleHttpServerJaxWsServiceExporter
Calculate the full endpoint path for the given endpoint.
calculateFilenamesForLocale(String, Locale) - Method in class org.springframework.context.support.ReloadableResourceBundleMessageSource
Calculate the filenames for the given bundle basename and Locale, appending language code, country code, and variant code.
call(CallableStatementCreator, List<SqlParameter>) - Method in interface org.springframework.jdbc.core.JdbcOperations
Execute a SQL call using a CallableStatementCreator to provide SQL and any required parameters.
call(CallableStatementCreator, List<SqlParameter>) - Method in class org.springframework.jdbc.core.JdbcTemplate
CallableStatementCallback<T> - Interface in org.springframework.jdbc.core
Generic callback interface for code that operates on a CallableStatement.
CallableStatementCreator - Interface in org.springframework.jdbc.core
One of the three central callback interfaces used by the JdbcTemplate class.
CallableStatementCreatorFactory - Class in org.springframework.jdbc.core
Helper class that efficiently creates multiple CallableStatementCreator objects with different parameters based on a SQL statement and a single set of parameter declarations.
CallableStatementCreatorFactory(String) - Constructor for class org.springframework.jdbc.core.CallableStatementCreatorFactory
Create a new factory.
CallableStatementCreatorFactory(String, List<SqlParameter>) - Constructor for class org.springframework.jdbc.core.CallableStatementCreatorFactory
Create a new factory with the given SQL and the given parameters.
CallbackPreferringPlatformTransactionManager - Interface in org.springframework.transaction.support
Extension of the PlatformTransactionManager interface, exposing a method for executing a given callback within a transaction.
CallMetaDataContext - Class in org.springframework.jdbc.core.metadata
Class to manage context metadata used for the configuration and execution of the call.
CallMetaDataContext() - Constructor for class org.springframework.jdbc.core.metadata.CallMetaDataContext
CallMetaDataProvider - Interface in org.springframework.jdbc.core.metadata
Interface specifying the API to be implemented by a class providing call metadata.
CallMetaDataProviderFactory - Class in org.springframework.jdbc.core.metadata
Factory used to create a CallMetaDataProvider implementation based on the type of databse being used.
CallMetaDataProviderFactory() - Constructor for class org.springframework.jdbc.core.metadata.CallMetaDataProviderFactory
callNextHandlerInChain(FacesContext, String, String, NavigationHandler) - Method in class org.springframework.web.jsf.DecoratingNavigationHandler
Method to be called by subclasses when intending to delegate to the next handler in the NavigationHandler chain.
CallParameterMetaData - Class in org.springframework.jdbc.core.metadata
Holder of metadata for a specific parameter that is used for call processing.
CallParameterMetaData(String, int, int, String, boolean) - Constructor for class org.springframework.jdbc.core.metadata.CallParameterMetaData
Constructor taking all the properties
canApply(Pointcut, Class<?>) - Static method in class org.springframework.aop.support.AopUtils
Can the given pointcut apply at all on the given class?
canApply(Pointcut, Class<?>, boolean) - Static method in class org.springframework.aop.support.AopUtils
Can the given pointcut apply at all on the given class?
canApply(Advisor, Class<?>) - Static method in class org.springframework.aop.support.AopUtils
Can the given advisor apply at all on the given class? This is an important test as it can be used to optimize out a advisor for a class.
canApply(Advisor, Class<?>, boolean) - Static method in class org.springframework.aop.support.AopUtils
Can the given advisor apply at all on the given class?
cancel(boolean) - Method in class org.springframework.scheduling.annotation.AsyncResult
CancellableFormController - Class in org.springframework.web.servlet.mvc
Deprecated. as of Spring 3.0, in favor of annotated controllers
CancellableFormController() - Constructor for class org.springframework.web.servlet.mvc.CancellableFormController
Deprecated.
cancelRefresh(BeansException) - Method in class org.springframework.context.support.AbstractApplicationContext
Cancel this context's refresh attempt, resetting the active flag after an exception got thrown.
cancelRefresh(BeansException) - Method in class org.springframework.context.support.AbstractRefreshableApplicationContext
canCompare(Object, Object) - Method in class org.springframework.expression.spel.support.StandardTypeComparator
canCompare(Object, Object) - Method in interface org.springframework.expression.TypeComparator
Return true if the comparator can compare these two objects
canConvert(Class<?>, Class<?>) - Method in interface org.springframework.core.convert.ConversionService
Returns true if objects of sourceType can be converted to targetType.
canConvert(TypeDescriptor, TypeDescriptor) - Method in interface org.springframework.core.convert.ConversionService
Returns true if objects of sourceType can be converted to the targetType.
canConvert(Class<?>, Class<?>) - Method in class org.springframework.core.convert.support.GenericConversionService
canConvert(TypeDescriptor, TypeDescriptor) - Method in class org.springframework.core.convert.support.GenericConversionService
canConvert(Class<?>, Class<?>) - Method in class org.springframework.expression.spel.support.StandardTypeConverter
canConvert(TypeDescriptor, TypeDescriptor) - Method in class org.springframework.expression.spel.support.StandardTypeConverter
canConvert(Class<?>, Class<?>) - Method in interface org.springframework.expression.TypeConverter
Return true if the type converter can convert the specified type to the desired target type.
canConvert(TypeDescriptor, TypeDescriptor) - Method in interface org.springframework.expression.TypeConverter
Return true if the type converter can convert the specified type to the desired target type.
canHandle(String, Locale) - Method in class org.springframework.web.servlet.view.UrlBasedViewResolver
Indicates whether or not this ViewResolver can handle the supplied view name.
CannotAcquireLockException - Exception in org.springframework.dao
Exception thrown on failure to aquire a lock during an update, for example during a "select for update" statement.
CannotAcquireLockException(String) - Constructor for exception org.springframework.dao.CannotAcquireLockException
Constructor for CannotAcquireLockException.
CannotAcquireLockException(String, Throwable) - Constructor for exception org.springframework.dao.CannotAcquireLockException
Constructor for CannotAcquireLockException.
CannotCreateRecordException - Exception in org.springframework.jca.cci
Exception thrown when the creating of a CCI Record failed for connector-internal reasons.
CannotCreateRecordException(String, ResourceException) - Constructor for exception org.springframework.jca.cci.CannotCreateRecordException
Constructor for CannotCreateRecordException.
CannotCreateTransactionException - Exception in org.springframework.transaction
Exception thrown when a transaction can't be created using an underlying transaction API such as JTA.
CannotCreateTransactionException(String) - Constructor for exception org.springframework.transaction.CannotCreateTransactionException
Constructor for CannotCreateTransactionException.
CannotCreateTransactionException(String, Throwable) - Constructor for exception org.springframework.transaction.CannotCreateTransactionException
Constructor for CannotCreateTransactionException.
CannotGetCciConnectionException - Exception in org.springframework.jca.cci
Fatal exception thrown when we can't connect to an EIS using CCI.
CannotGetCciConnectionException(String, ResourceException) - Constructor for exception org.springframework.jca.cci.CannotGetCciConnectionException
Constructor for CannotGetCciConnectionException.
CannotGetJdbcConnectionException - Exception in org.springframework.jdbc
Fatal exception thrown when we can't connect to an RDBMS using JDBC.
CannotGetJdbcConnectionException(String, SQLException) - Constructor for exception org.springframework.jdbc.CannotGetJdbcConnectionException
Constructor for CannotGetJdbcConnectionException.
CannotGetJdbcConnectionException(String, ClassNotFoundException) - Constructor for exception org.springframework.jdbc.CannotGetJdbcConnectionException
Deprecated. since Spring 2.5, in favor of throwing an IllegalStateException in case of the driver not being found
CannotLoadBeanClassException - Exception in org.springframework.beans.factory
Exception thrown when the BeanFactory cannot load the specified class of a given bean.
CannotLoadBeanClassException(String, String, String, ClassNotFoundException) - Constructor for exception org.springframework.beans.factory.CannotLoadBeanClassException
Create a new CannotLoadBeanClassException.
CannotLoadBeanClassException(String, String, String, LinkageError) - Constructor for exception org.springframework.beans.factory.CannotLoadBeanClassException
Create a new CannotLoadBeanClassException.
CannotReadScriptException - Exception in org.springframework.jdbc.datasource.init
Thrown by ResourceDatabasePopulator if one of its SQL scripts could not be read during population.
CannotReadScriptException(EncodedResource, Throwable) - Constructor for exception org.springframework.jdbc.datasource.init.CannotReadScriptException
Constructor a new CannotReadScriptException.
CannotSerializeTransactionException - Exception in org.springframework.dao
Exception thrown on failure to complete a transaction in serialized mode due to update conflicts.
CannotSerializeTransactionException(String) - Constructor for exception org.springframework.dao.CannotSerializeTransactionException
Constructor for CannotSerializeTransactionException.
CannotSerializeTransactionException(String, Throwable) - Constructor for exception org.springframework.dao.CannotSerializeTransactionException
Constructor for CannotSerializeTransactionException.
canonicalFieldName(String) - Method in class org.springframework.validation.AbstractErrors
Determine the canonical field name for the given field.
canonicalFieldName(String) - Method in class org.springframework.validation.AbstractPropertyBindingResult
Returns the canonical property name.
canonicalName(String) - Method in class org.springframework.core.SimpleAliasRegistry
Determine the raw name, resolving aliases to canonical names.
canonicalPropertyName(String) - Static method in class org.springframework.beans.PropertyAccessorUtils
Determine the canonical name for the given property path.
canonicalPropertyNames(String[]) - Static method in class org.springframework.beans.PropertyAccessorUtils
Determine the canonical names for the given property paths.
canRead(EvaluationContext, Object, String) - Method in class org.springframework.context.expression.BeanExpressionContextAccessor
canRead(EvaluationContext, Object, String) - Method in class org.springframework.context.expression.BeanFactoryAccessor
canRead(EvaluationContext, Object, String) - Method in class org.springframework.context.expression.MapAccessor
canRead(EvaluationContext, Object, String) - Method in interface org.springframework.expression.PropertyAccessor
Called to determine if a resolver instance is able to access a specified property on a specified target object.
canRead(EvaluationContext, Object, String) - Method in class org.springframework.expression.spel.support.ReflectivePropertyAccessor
canRead(Class<?>, MediaType) - Method in class org.springframework.http.converter.AbstractHttpMessageConverter
Indicates whether the given class can be read by this converter.
canRead(MediaType) - Method in class org.springframework.http.converter.AbstractHttpMessageConverter
Returns true if any of the supported media types include the given media type.
canRead(Class<?>, MediaType) - Method in class org.springframework.http.converter.BufferedImageHttpMessageConverter
canRead(Class<?>, MediaType) - Method in class org.springframework.http.converter.FormHttpMessageConverter
canRead(Class<?>, MediaType) - Method in interface org.springframework.http.converter.HttpMessageConverter
Indicates whether the given class can be read by this converter.
canRead(Class<?>, MediaType) - Method in class org.springframework.http.converter.json.MappingJacksonHttpMessageConverter
canRead(Class<?>, MediaType) - Method in class org.springframework.http.converter.ResourceHttpMessageConverter
canRead(Class<?>, MediaType) - Method in class org.springframework.http.converter.xml.Jaxb2RootElementHttpMessageConverter
canWrite(EvaluationContext, Object, String) - Method in class org.springframework.context.expression.BeanExpressionContextAccessor
canWrite(EvaluationContext, Object, String) - Method in class org.springframework.context.expression.BeanFactoryAccessor
canWrite(EvaluationContext, Object, String) - Method in class org.springframework.context.expression.MapAccessor
canWrite(EvaluationContext, Object, String) - Method in interface org.springframework.expression.PropertyAccessor
Called to determine if a resolver instance is able to write to a specified property on a specified target object.
canWrite(EvaluationContext, Object, String) - Method in class org.springframework.expression.spel.support.ReflectivePropertyAccessor
canWrite(Class<?>, MediaType) - Method in class org.springframework.http.converter.AbstractHttpMessageConverter
Indicates whether the given class can be written by this converter.
canWrite(MediaType) - Method in class org.springframework.http.converter.AbstractHttpMessageConverter
Returns true if the given media type includes any of the supported media types.
canWrite(Class<?>, MediaType) - Method in class org.springframework.http.converter.BufferedImageHttpMessageConverter
canWrite(Class<?>, MediaType) - Method in class org.springframework.http.converter.FormHttpMessageConverter
canWrite(Class<?>, MediaType) - Method in interface org.springframework.http.converter.HttpMessageConverter
Indicates whether the given class can be written by this converter.
canWrite(Class<?>, MediaType) - Method in class org.springframework.http.converter.json.MappingJacksonHttpMessageConverter
canWrite(Class<?>, MediaType) - Method in class org.springframework.http.converter.ResourceHttpMessageConverter
canWrite(Class<?>, MediaType) - Method in class org.springframework.http.converter.xml.Jaxb2RootElementHttpMessageConverter
capitalize(String) - Static method in class org.springframework.util.StringUtils
Capitalize a String, changing the first letter to upper case as per Character.toUpperCase(char).
CastorMappingException - Exception in org.springframework.oxm.castor
Exception thrown by CastorMarshaller whenever it encounters a mapping problem.
CastorMappingException(String, Throwable) - Constructor for exception org.springframework.oxm.castor.CastorMappingException
Construct a CastorMappingException with the specified detail message and nested exception.
CastorMarshaller - Class in org.springframework.oxm.castor
Implementation of the Marshaller interface for Castor.
CastorMarshaller() - Constructor for class org.springframework.oxm.castor.CastorMarshaller
catalogNameToUse(String) - Method in interface org.springframework.jdbc.core.metadata.CallMetaDataProvider
Provide any modification of the catalog name passed in to match the meta data currently used.
catalogNameToUse(String) - Method in class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
catalogNameToUse(String) - Method in class org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
catalogNameToUse(String) - Method in interface org.springframework.jdbc.core.metadata.TableMetaDataProvider
Get the catalog name formatted based on metadata information.
CciDaoSupport - Class in org.springframework.jca.cci.core.support
Convenient super class for CCI-based data access objects.
CciDaoSupport() - Constructor for class org.springframework.jca.cci.core.support.CciDaoSupport
CciLocalTransactionManager - Class in org.springframework.jca.cci.connection
PlatformTransactionManager implementation that manages local transactions for a single CCI ConnectionFactory.
CciLocalTransactionManager() - Constructor for class org.springframework.jca.cci.connection.CciLocalTransactionManager
Create a new CciLocalTransactionManager instance.
CciLocalTransactionManager(ConnectionFactory) - Constructor for class org.springframework.jca.cci.connection.CciLocalTransactionManager
Create a new CciLocalTransactionManager instance.
CciOperationNotSupportedException - Exception in org.springframework.jca.cci
Exception thrown when the connector doesn't support a specific CCI operation.
CciOperationNotSupportedException(String, ResourceException) - Constructor for exception org.springframework.jca.cci.CciOperationNotSupportedException
Constructor for CciOperationNotSupportedException.
CciOperations - Interface in org.springframework.jca.cci.core
Interface that specifies a basic set of CCI operations on an EIS.
CciTemplate - Class in org.springframework.jca.cci.core
This is the central class in the CCI core package. It simplifies the use of CCI and helps to avoid common errors.
CciTemplate() - Constructor for class org.springframework.jca.cci.core.CciTemplate
Construct a new CciTemplate for bean usage.
CciTemplate(ConnectionFactory) - Constructor for class org.springframework.jca.cci.core.CciTemplate
Construct a new CciTemplate, given a ConnectionFactory to obtain Connections from.
CciTemplate(ConnectionFactory, ConnectionSpec) - Constructor for class org.springframework.jca.cci.core.CciTemplate
Construct a new CciTemplate, given a ConnectionFactory to obtain Connections from.
CGLIB_CLASS_SEPARATOR - Static variable in class org.springframework.util.ClassUtils
The CGLIB class separator character "$$"
CglibSubclassingInstantiationStrategy - Class in org.springframework.beans.factory.support
Default object instantiation strategy for use in BeanFactories.
CglibSubclassingInstantiationStrategy() - Constructor for class org.springframework.beans.factory.support.CglibSubclassingInstantiationStrategy
ChainedExceptionListener - Class in org.springframework.jms.connection
Implementation of the JMS ExceptionListener interface that supports chaining, allowing the addition of multiple ExceptionListener instances in order.
ChainedExceptionListener() - Constructor for class org.springframework.jms.connection.ChainedExceptionListener
ChainedPersistenceExceptionTranslator - Class in org.springframework.dao.support
Implementation of PersistenceExceptionTranslator that supports chaining, allowing the addition of PersistenceExceptionTranslator instances in order.
ChainedPersistenceExceptionTranslator() - Constructor for class org.springframework.dao.support.ChainedPersistenceExceptionTranslator
changesSince(PropertyValues) - Method in class org.springframework.beans.MutablePropertyValues
changesSince(PropertyValues) - Method in interface org.springframework.beans.PropertyValues
Return the changes since the previous PropertyValues.
CharacterEditor - Class in org.springframework.beans.propertyeditors
Editor for a Character, to populate a property of type Character or char from a String value.
CharacterEditor(boolean) - Constructor for class org.springframework.beans.propertyeditors.CharacterEditor
Create a new CharacterEditor instance.
CharacterEncodingFilter - Class in org.springframework.web.filter
Servlet 2.3/2.4 Filter that allows one to specify a character encoding for requests.
CharacterEncodingFilter() - Constructor for class org.springframework.web.filter.CharacterEncodingFilter
CharArrayPropertyEditor - Class in org.springframework.beans.propertyeditors
Editor for char arrays.
CharArrayPropertyEditor() - Constructor for class org.springframework.beans.propertyeditors.CharArrayPropertyEditor
CharsetEditor - Class in org.springframework.beans.propertyeditors
Editor for java.nio.charset.Charset, translating charset String representations into Charset objects and back.
CharsetEditor() - Constructor for class org.springframework.beans.propertyeditors.CharsetEditor

check(PortletRequest, PortletResponse) - Method in class org.springframework.web.portlet.handler.PortletContentGenerator
Check and prepare the given request and response according to the settings of this generator.
checkActive() - Method in class org.springframework.mock.web.MockHttpServletRequest
Check whether this request is still active (that is, not completed yet), throwing an IllegalStateException if not active anymore.
checkActive() - Method in class org.springframework.mock.web.portlet.MockPortletRequest
Check whether this request is still active (that is, not completed yet), throwing an IllegalStateException if not active anymore.
checkAllowedFields(MutablePropertyValues) - Method in class org.springframework.validation.DataBinder
Check the given property values against the allowed fields, removing values for fields that are not allowed.
checkAndPrepare(PortletRequest, MimeResponse) - Method in class org.springframework.web.portlet.handler.PortletContentGenerator
Check and prepare the given request and response according to the settings of this generator.
checkAndPrepare(PortletRequest, MimeResponse, int) - Method in class org.springframework.web.portlet.handler.PortletContentGenerator
Check and prepare the given request and response according to the settings of this generator.
checkAndPrepare(HttpServletRequest, HttpServletResponse, boolean) - Method in class org.springframework.web.servlet.support.WebContentGenerator
Check and prepare the given request and response according to the settings of this generator.
checkAndPrepare(HttpServletRequest, HttpServletResponse, int, boolean) - Method in class org.springframework.web.servlet.support.WebContentGenerator
Check and prepare the given request and response according to the settings of this generator.
CheckboxesTag - Class in org.springframework.web.servlet.tags.form
Databinding-aware JSP tag for rendering multiple HTML 'input' elements with a 'type' of 'checkbox'.
CheckboxesTag() - Constructor for class org.springframework.web.servlet.tags.form.CheckboxesTag

CheckboxTag - Class in org.springframework.web.servlet.tags.form
Databinding-aware JSP tag for rendering an HTML 'input' element with a 'type' of 'checkbox'.
CheckboxTag() - Constructor for class org.springframework.web.servlet.tags.form.CheckboxTag

checkCandidate(String, BeanDefinition) - Method in class org.springframework.context.annotation.ClassPathBeanDefinitionScanner
Check the given candidate's bean name, determining whether the corresponding bean definition needs to be registered or conflicts with an existing definition.
checkCommand(Object) - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Check if the given command object is a valid for this controller, i.e.
checkCommand(Object) - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Check if the given command object is a valid for this controller, i.e.
checkCompiled() - Method in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Check whether this operation has been compiled already; lazily compile it if not already compiled.
checkCompiled() - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Check whether this operation has been compiled already; lazily compile it if not already compiled.
checkCompiled() - Method in class org.springframework.jdbc.object.RdbmsOperation
Check whether this operation has been compiled already; lazily compile it if not already compiled.
checkConfigMembers(RootBeanDefinition) - Method in class org.springframework.beans.factory.annotation.InjectionMetadata

checkDaoConfig() - Method in class org.springframework.dao.support.DaoSupport
Abstract subclasses must override this to check their configuration.
checkDaoConfig() - Method in class org.springframework.jca.cci.core.support.CciDaoSupport

checkDaoConfig() - Method in class org.springframework.jdbc.core.support.JdbcDaoSupport

checkDaoConfig() - Method in class org.springframework.orm.hibernate3.support.HibernateDaoSupport

checkDaoConfig() - Method in class org.springframework.orm.ibatis.support.SqlMapClientDaoSupport

checkDaoConfig() - Method in class org.springframework.orm.jdo.support.JdoDaoSupport

checkDaoConfig() - Method in class org.springframework.orm.jpa.support.JpaDaoSupport

checkDefaultConnectionProperties(Connection) - Method in class org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy
Check the default connection properties (auto-commit, transaction isolation), keeping them to be able to expose them correctly without fetching an actual JDBC Connection from the target DataSource.
checkDependencies(String, AbstractBeanDefinition, PropertyDescriptor[], PropertyValues) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Perform a dependency check that all properties exposed have been set, if desired.
checkExceptionExpectations(Exception) - Method in class org.springframework.test.AssertThrows
Deprecated. Does the donkey work of checking (verifying) that the Exception that was thrown in the body of a test is an instance of the AssertThrows.getExpectedException() class (or an instance of a subclass).
checkFieldDefaults(MutablePropertyValues) - Method in class org.springframework.web.bind.WebDataBinder
Check the given property values for field defaults, i.e.
checkFieldMarkers(MutablePropertyValues) - Method in class org.springframework.web.bind.WebDataBinder
Check the given property values for field markers, i.e.
checkIfConfigurationModificationIsAllowed() - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Method to check whether we are allowd to make any configuration changes at this time.
checkManagedBean(Object) - Method in class org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler
Check the given bean instance, throwing an IllegalArgumentException if it is not eligible for exposure with this assembler.
checkManagedBean(Object) - Method in class org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler
Throws an IllegalArgumentException if it encounters a JDK dynamic proxy.
checkMergedBeanDefinition(RootBeanDefinition, String, Object[]) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Check the given merged bean definition, potentially throwing validation exceptions.
checkMessageListener(Object) - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Check the given message listener, throwing an exception if it does not correspond to a supported listener type.
checkMultipart(ActionRequest) - Method in class org.springframework.web.portlet.DispatcherPortlet
Convert the request into a multipart request, and make multipart resolver available.
checkMultipart(HttpServletRequest) - Method in class org.springframework.web.servlet.DispatcherServlet
Convert the request into a multipart request, and make multipart resolver available.
checkNameUniqueness(String, List<String>, Element) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Validate that the specified bean name and aliases have not been used already.
checkNotModified(long) - Method in class org.springframework.web.context.request.FacesWebRequest

checkNotModified(long) - Method in class org.springframework.web.context.request.ServletWebRequest

checkNotModified(long) - Method in interface org.springframework.web.context.request.WebRequest
Check whether the request qualifies as not modified given the supplied last-modified timestamp (as determined by the application).
checkNotModified(long) - Method in class org.springframework.web.portlet.context.PortletWebRequest
Last-modified handling not supported for portlet requests: As a consequence, this method always returns false.
checkPropertySkipping(PropertyValues) - Method in class org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement
Checks whether this injector's property needs to be skipped due to an explicit property value having been specified.
checkQualifier(BeanDefinitionHolder, Annotation, TypeConverter) - Method in class org.springframework.beans.factory.annotation.QualifierAnnotationAutowireCandidateResolver
Match the given qualifier annotation against the candidate bean definition.
checkQualifiers(BeanDefinitionHolder, Annotation[]) - Method in class org.springframework.beans.factory.annotation.QualifierAnnotationAutowireCandidateResolver
Match the given qualifier annotations against the candidate bean definition.
checkRequiredFields(MutablePropertyValues) - Method in class org.springframework.validation.DataBinder
Check the given property values against the required fields, generating missing field errors where appropriate.
checkResource(Locale) - Method in class org.springframework.web.servlet.view.AbstractUrlBasedView
Check whether the underlying resource that the configured URL points to actually exists.
checkResource(Locale) - Method in class org.springframework.web.servlet.view.freemarker.FreeMarkerView
Check that the FreeMarker template used for this view exists and is valid.
checkResource(Locale) - Method in class org.springframework.web.servlet.view.tiles2.TilesView

checkResource(Locale) - Method in class org.springframework.web.servlet.view.velocity.VelocityLayoutView
Overrides VelocityView.checkTemplate() to additionally check that both the layout template and the screen content template can be loaded.
checkResource(Locale) - Method in class org.springframework.web.servlet.view.velocity.VelocityView
Check that the Velocity template used for this view exists and is valid.
checkResourceType(Class) - Method in class org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement

checkRowsAffected(int) - Method in class org.springframework.jdbc.object.SqlUpdate
Check the given number of affected rows against the specified maximum number or required number.
checkService() - Method in class org.springframework.remoting.support.RemoteExporter
Check whether the service reference has been set.
checkServiceInterface() - Method in class org.springframework.remoting.support.RemoteExporter
Check whether a service reference has been set, and whether it matches the specified service.
checkUserTransactionAndTransactionManager() - Method in class org.springframework.transaction.jta.JtaTransactionManager
Check the UserTransaction as well as the TransactionManager handle, assuming standard JTA requirements.
checkWriteOperationAllowed(Session) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
Check whether write operations are allowed on the given Session.
childBeanDefinition(String) - Static method in class org.springframework.beans.factory.support.BeanDefinitionBuilder
Create a new BeanDefinitionBuilder used to construct a ChildBeanDefinition.
ChildBeanDefinition - Class in org.springframework.beans.factory.support
Bean definition for beans which inherit settings from their parent.
ChildBeanDefinition(String) - Constructor for class org.springframework.beans.factory.support.ChildBeanDefinition
Create a new ChildBeanDefinition for the given parent, to be configured through its bean properties and configuration methods.
ChildBeanDefinition(String, MutablePropertyValues) - Constructor for class org.springframework.beans.factory.support.ChildBeanDefinition
Create a new ChildBeanDefinition for the given parent.
ChildBeanDefinition(String, ConstructorArgumentValues, MutablePropertyValues) - Constructor for class org.springframework.beans.factory.support.ChildBeanDefinition
Create a new ChildBeanDefinition for the given parent.
ChildBeanDefinition(String, Class, ConstructorArgumentValues, MutablePropertyValues) - Constructor for class org.springframework.beans.factory.support.ChildBeanDefinition
Create a new ChildBeanDefinition for the given parent, providing constructor arguments and property values.
ChildBeanDefinition(String, String, ConstructorArgumentValues, MutablePropertyValues) - Constructor for class org.springframework.beans.factory.support.ChildBeanDefinition
Create a new ChildBeanDefinition for the given parent, providing constructor arguments and property values.
ChildBeanDefinition(ChildBeanDefinition) - Constructor for class org.springframework.beans.factory.support.ChildBeanDefinition
Create a new ChildBeanDefinition as deep copy of the given bean definition.
children - Variable in class org.springframework.expression.spel.ast.SpelNodeImpl

CLASS_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate

CLASS_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag

CLASS_FILE_SUFFIX - Static variable in class org.springframework.util.ClassUtils
The ".class" file suffix
CLASS_KEY - Static variable in class org.springframework.beans.factory.support.PropertiesBeanDefinitionReader
Special key to distinguish owner.(class)=com.myapp.MyClass-
ClassArrayEditor - Class in org.springframework.beans.propertyeditors
Property editor for an array of Classes, to enable the direct population of a Class[] property without having to use a String class name property as bridge.
ClassArrayEditor() - Constructor for class org.springframework.beans.propertyeditors.ClassArrayEditor
Create a default ClassEditor, using the thread context ClassLoader.
ClassArrayEditor(ClassLoader) - Constructor for class org.springframework.beans.propertyeditors.ClassArrayEditor
Create a default ClassArrayEditor, using the given ClassLoader.
ClassEditor - Class in org.springframework.beans.propertyeditors
Property editor for java.lang.Class, to enable the direct population of a Class property without recourse to having to use a String class name property as bridge.
ClassEditor() - Constructor for class org.springframework.beans.propertyeditors.ClassEditor
Create a default ClassEditor, using the thread context ClassLoader.
ClassEditor(ClassLoader) - Constructor for class org.springframework.beans.propertyeditors.ClassEditor
Create a default ClassEditor, using the given ClassLoader.
ClassFilter - Interface in org.springframework.aop
Filter that restricts matching of a pointcut or introduction to a given set of target classes.
ClassFilters - Class in org.springframework.aop.support
Static utility methods for composing ClassFilters.
ClassFilters() - Constructor for class org.springframework.aop.support.ClassFilters

ClassMetadata - Interface in org.springframework.core.type
Interface that defines abstract metadata of a specific class, in a form that does not require that class to be loaded yet.
ClassNameBeanWiringInfoResolver - Class in org.springframework.beans.factory.wiring
Simple default implementation of the BeanWiringInfoResolver interface, looking for a bean with the same name as the fully-qualified class name.
ClassNameBeanWiringInfoResolver() - Constructor for class org.springframework.beans.factory.wiring.ClassNameBeanWiringInfoResolver

classNamesToString(Class...) - Static method in class org.springframework.util.ClassUtils
Build a String that consists of the names of the classes/interfaces in the given array.
classNamesToString(Collection<Class>) - Static method in class org.springframework.util.ClassUtils
Build a String that consists of the names of the classes/interfaces in the given collection.
classPackageAsResourcePath(Class<?>) - Static method in class org.springframework.util.ClassUtils
Given an input class object, return a string which consists of the class's package name as a pathname, i.e., all dots ('.') are replaced by slashes ('/').
CLASSPATH_ALL_URL_PREFIX - Static variable in interface org.springframework.core.io.support.ResourcePatternResolver
Pseudo URL prefix for all matching resources from the class path: "classpath*:" This differs from ResourceLoader's classpath URL prefix in that it retrieves all matching resources for a given name (e.g.
CLASSPATH_URL_PREFIX - Static variable in interface org.springframework.core.io.ResourceLoader
Pseudo URL prefix for loading from the class path: "classpath:"
CLASSPATH_URL_PREFIX - Static variable in class org.springframework.util.Log4jConfigurer
Pseudo URL prefix for loading from the class path: "classpath:"
CLASSPATH_URL_PREFIX - Static variable in class org.springframework.util.ResourceUtils
Pseudo URL prefix for loading from the class path: "classpath:"
ClassPathBeanDefinitionScanner - Class in org.springframework.context.annotation
A bean definition scanner that detects bean candidates on the classpath, registering corresponding bean definitions with a given registry (BeanFactory or ApplicationContext).
ClassPathBeanDefinitionScanner(BeanDefinitionRegistry) - Constructor for class org.springframework.context.annotation.ClassPathBeanDefinitionScanner
Create a new ClassPathBeanDefinitionScanner for the given bean factory.
ClassPathBeanDefinitionScanner(BeanDefinitionRegistry, boolean) - Constructor for class org.springframework.context.annotation.ClassPathBeanDefinitionScanner
Create a new ClassPathBeanDefinitionScanner for the given bean factory.
ClassPathResource - Class in org.springframework.core.io
Resource implementation for class path resources.
ClassPathResource(String) - Constructor for class org.springframework.core.io.ClassPathResource
Create a new ClassPathResource for ClassLoader usage.
ClassPathResource(String, ClassLoader) - Constructor for class org.springframework.core.io.ClassPathResource
Create a new ClassPathResource for ClassLoader usage.
ClassPathResource(String, Class<?>) - Constructor for class org.springframework.core.io.ClassPathResource
Create a new ClassPathResource for Class usage.
ClassPathResource(String, ClassLoader, Class<?>) - Constructor for class org.springframework.core.io.ClassPathResource
Create a new ClassPathResource with optional ClassLoader and Class.
ClassPathScanningCandidateComponentProvider - Class in org.springframework.context.annotation
A component provider that scans the classpath from a base package.
ClassPathScanningCandidateComponentProvider(boolean) - Constructor for class org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider
Create a ClassPathScanningCandidateComponentProvider.
ClassPathXmlApplicationContext - Class in org.springframework.context.support
Standalone XML application context, taking the context definition files from the class path, interpreting plain paths as class path resource names that include the package path (e.g.
ClassPathXmlApplicationContext() - Constructor for class org.springframework.context.support.ClassPathXmlApplicationContext
Create a new ClassPathXmlApplicationContext for bean-style configuration.
ClassPathXmlApplicationContext(ApplicationContext) - Constructor for class org.springframework.context.support.ClassPathXmlApplicationContext
Create a new ClassPathXmlApplicationContext for bean-style configuration.
ClassPathXmlApplicationContext(String) - Constructor for class org.springframework.context.support.ClassPathXmlApplicationContext
Create a new ClassPathXmlApplicationContext, loading the definitions from the given XML file and automatically refreshing the context.
ClassPathXmlApplicationContext(String...) - Constructor for class org.springframework.context.support.ClassPathXmlApplicationContext
Create a new ClassPathXmlApplicationContext, loading the definitions from the given XML files and automatically refreshing the context.
ClassPathXmlApplicationContext(String[], ApplicationContext) - Constructor for class org.springframework.context.support.ClassPathXmlApplicationContext
Create a new ClassPathXmlApplicationContext with the given parent, loading the definitions from the given XML files and automatically refreshing the context.
ClassPathXmlApplicationContext(String[], boolean) - Constructor for class org.springframework.context.support.ClassPathXmlApplicationContext
Create a new ClassPathXmlApplicationContext, loading the definitions from the given XML files.
ClassPathXmlApplicationContext(String[], boolean, ApplicationContext) - Constructor for class org.springframework.context.support.ClassPathXmlApplicationContext
Create a new ClassPathXmlApplicationContext with the given parent, loading the definitions from the given XML files.
ClassPathXmlApplicationContext(String, Class) - Constructor for class org.springframework.context.support.ClassPathXmlApplicationContext
Create a new ClassPathXmlApplicationContext, loading the definitions from the given XML file and automatically refreshing the context.
ClassPathXmlApplicationContext(String[], Class) - Constructor for class org.springframework.context.support.ClassPathXmlApplicationContext
Create a new ClassPathXmlApplicationContext, loading the definitions from the given XML files and automatically refreshing the context.
ClassPathXmlApplicationContext(String[], Class, ApplicationContext) - Constructor for class org.springframework.context.support.ClassPathXmlApplicationContext
Create a new ClassPathXmlApplicationContext with the given parent, loading the definitions from the given XML files and automatically refreshing the context.
ClassRelativeResourceLoader - Class in org.springframework.core.io
ResourceLoader implementation that interprets plain resource paths as relative to a given java.lang.Class.
ClassRelativeResourceLoader(Class) - Constructor for class org.springframework.core.io.ClassRelativeResourceLoader
Create a new ClassRelativeResourceLoader for the given class.
ClassUtils - Class in org.springframework.util
Miscellaneous class utility methods.
ClassUtils() - Constructor for class org.springframework.util.ClassUtils

cleanPath(String) - Static method in class org.springframework.util.StringUtils
Normalize the path by suppressing sequences like "path/.." and inner simple dots.
cleanup() - Method in interface org.springframework.jdbc.core.DisposableSqlTypeValue
Clean up resources held by this type value, for example the LobCreator in case of a SqlLobValue.
cleanup() - Method in class org.springframework.jdbc.core.support.SqlLobValue
Close the LobCreator, if any.
cleanup() - Method in interface org.springframework.jdbc.support.SqlValue
Clean up resources held by this value object.
cleanupAttribute(WebRequest, String) - Method in class org.springframework.web.bind.support.DefaultSessionAttributeStore

cleanupAttribute(WebRequest, String) - Method in interface org.springframework.web.bind.support.SessionAttributeStore
Clean up the specified attribute in the backend session.
CleanupFailureDataAccessException - Exception in org.springframework.dao
Exception thrown when we couldn't cleanup after a data access operation, but the actual operation went OK.
CleanupFailureDataAccessException(String, Throwable) - Constructor for exception org.springframework.dao.CleanupFailureDataAccessException
Constructor for CleanupFailureDataAccessException.
cleanupFileItems(Collection<MultipartFile>) - Method in class org.springframework.web.multipart.commons.CommonsFileUploadSupport
Cleanup the Spring MultipartFiles created during multipart parsing, potentially holding temporary data on disk.
cleanupMultipart(MultipartHttpServletRequest) - Method in class org.springframework.web.multipart.commons.CommonsMultipartResolver

cleanupMultipart(MultipartHttpServletRequest) - Method in interface org.springframework.web.multipart.MultipartResolver
Cleanup any resources used for the multipart handling, like a storage for the uploaded files.
cleanupMultipart(MultipartActionRequest) - Method in class org.springframework.web.portlet.multipart.CommonsPortletMultipartResolver

cleanupMultipart(MultipartActionRequest) - Method in interface org.springframework.web.portlet.multipart.PortletMultipartResolver
Cleanup any resources used for the multipart handling, such as storage for any uploaded file(s).
cleanupMultipart(HttpServletRequest) - Method in class org.springframework.web.servlet.DispatcherServlet
Clean up any resources used by the given multipart request (if any).
cleanupParameters() - Method in interface org.springframework.jdbc.core.ParameterDisposer
Close the resources allocated by parameters that the implementing object holds, for example in case of a DisposableSqlTypeValue (like a SqlLobValue).
cleanupParameters(Object[]) - Static method in class org.springframework.jdbc.core.StatementCreatorUtils
Clean up all resources held by parameter values which were passed to an execute method.
cleanupParameters(Collection) - Static method in class org.springframework.jdbc.core.StatementCreatorUtils
Clean up all resources held by parameter values which were passed to an execute method.
cleanupResource(H, K, boolean) - Method in class org.springframework.transaction.support.ResourceHolderSynchronization
Perform a cleanup on the given resource (which is left bound to the thread).
cleanupTransaction(Object) - Method in class org.springframework.orm.jdo.DefaultJdoDialect
This implementation does nothing, as the default beginTransaction implementation does not require any cleanup.
cleanupTransaction(Object) - Method in interface org.springframework.orm.jdo.JdoDialect
Clean up the transaction via the given transaction data.
cleanupTransaction(Object) - Method in class org.springframework.orm.jpa.DefaultJpaDialect
This implementation does nothing, since the default beginTransaction implementation does not require any cleanup.
cleanupTransaction(Object) - Method in interface org.springframework.orm.jpa.JpaDialect
Clean up the transaction via the given transaction data.
cleanupTransaction(Object) - Method in class org.springframework.orm.jpa.vendor.HibernateJpaDialect

cleanupTransactionInfo(TransactionAspectSupport.TransactionInfo) - Method in class org.springframework.transaction.interceptor.TransactionAspectSupport
Reset the TransactionInfo ThreadLocal.
clear() - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues
Clear this holder, removing all argument values.
clear() - Method in class org.springframework.http.HttpHeaders

clear() - Method in class org.springframework.jdbc.datasource.ConnectionHolder

clear() - Method in class org.springframework.mock.jndi.SimpleNamingContextBuilder
Clear all bindings in this context builder, while keeping it active.
clear() - Method in class org.springframework.mock.web.MockBodyContent

clear() - Method in class org.springframework.mock.web.MockJspWriter

clear() - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Remove all objects from the Session cache, and cancel all pending saves, updates and deletes.
clear() - Method in class org.springframework.orm.hibernate3.HibernateTemplate

clear() - Method in class org.springframework.orm.hibernate3.SessionHolder

clear() - Method in class org.springframework.orm.jdo.PersistenceManagerHolder

clear() - Method in class org.springframework.orm.jpa.EntityManagerHolder

clear() - Method in class org.springframework.transaction.support.ResourceHolderSupport
Clear the transactional state of this resource holder.
clear() - Static method in class org.springframework.transaction.support.TransactionSynchronizationManager
Clear the entire transaction synchronization state for the current thread: registered synchronizations as well as the various transaction characteristics.
clear() - Method in class org.springframework.util.AutoPopulatingList

clear() - Method in class org.springframework.util.CachingMapDecorator

clear() - Method in class org.springframework.util.LinkedCaseInsensitiveMap

clear() - Method in class org.springframework.util.LinkedMultiValueMap

clear() - Method in class org.springframework.util.xml.SimpleNamespaceContext
Removes all declared prefixes.
clear() - Method in class org.springframework.web.portlet.ModelAndView
Clear the state of this ModelAndView object.
clear() - Method in class org.springframework.web.servlet.ModelAndView
Clear the state of this ModelAndView object.
clearAllRenderParameters(ActionResponse) - Static method in class org.springframework.web.portlet.util.PortletUtils
Clear all the render parameters from the ActionResponse.
clearAttributes() - Method in class org.springframework.mock.web.MockHttpServletRequest
Clear all of this request's attributes.
clearAttributes() - Method in class org.springframework.mock.web.MockHttpSession
Clear all of this session's attributes.
clearAttributes() - Method in class org.springframework.mock.web.portlet.MockPortletSession
Clear all of this session's attributes.
clearBuffer() - Method in class org.springframework.mock.web.MockBodyContent

clearBuffer() - Method in class org.springframework.mock.web.MockJspWriter

clearCache() - Method in class org.springframework.context.support.ReloadableResourceBundleMessageSource
Clear the resource bundle cache.
clearCache() - Method in interface org.springframework.jms.support.destination.CachingDestinationResolver
Clear the entire destination cache.
clearCache() - Method in class org.springframework.jms.support.destination.JndiDestinationResolver

clearCache() - Method in class org.springframework.web.servlet.view.AbstractCachingViewResolver
Clear the entire view cache, removing all cached view objects.
clearCacheIncludingAncestors() - Method in class org.springframework.context.support.ReloadableResourceBundleMessageSource
Clear the resource bundle caches of this MessageSource and all its ancestors.
clearClassLoader(ClassLoader) - Static method in class org.springframework.beans.CachedIntrospectionResults
Clear the introspection cache for the given ClassLoader, removing the introspection results for all classes underneath that ClassLoader, and deregistering the ClassLoader (and any of its children) from the acceptance list.
clearErrorRequestAttributes(HttpServletRequest) - Static method in class org.springframework.web.util.WebUtils
Clear the Servlet spec's error attributes as HttpServletRequest attributes under the keys defined in the Servlet 2.3 specification: javax.servlet.error.status_code, javax.servlet.error.exception_type, javax.servlet.error.message, javax.servlet.error.exception, javax.servlet.error.request_uri, javax.servlet.error.servlet_name.
clearMergedBeanDefinition(String) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Remove the merged bean definition for the specified bean, recreating it on next access.
clearSynchronization() - Static method in class org.springframework.transaction.support.TransactionSynchronizationManager
Deactivate transaction synchronization for the current thread.
ClientHttpRequest - Interface in org.springframework.http.client
Represents a client-side HTTP request.
ClientHttpRequestFactory - Interface in org.springframework.http.client
Factory for ClientHttpRequest objects.
ClientHttpResponse - Interface in org.springframework.http.client
Represents a client-side HTTP response.
ClobStringType - Class in org.springframework.orm.hibernate3.support
Hibernate UserType implementation for Strings that get mapped to CLOBs.
ClobStringType() - Constructor for class org.springframework.orm.hibernate3.support.ClobStringType
Constructor used by Hibernate: fetches config-time LobHandler and config-time JTA TransactionManager from LocalSessionFactoryBean.
ClobStringType(LobHandler, TransactionManager) - Constructor for class org.springframework.orm.hibernate3.support.ClobStringType
Constructor used for testing: takes an explicit LobHandler and an explicit JTA TransactionManager (can be null).
ClobStringTypeHandler - Class in org.springframework.orm.ibatis.support
iBATIS TypeHandler implementation for Strings that get mapped to CLOBs.
ClobStringTypeHandler() - Constructor for class org.springframework.orm.ibatis.support.ClobStringTypeHandler
Constructor used by iBATIS: fetches config-time LobHandler from SqlMapClientFactoryBean.
ClobStringTypeHandler(LobHandler) - Constructor for class org.springframework.orm.ibatis.support.ClobStringTypeHandler
Constructor used for testing: takes an explicit LobHandler.
clone() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Public declaration of Object's clone() method.
clone() - Method in class org.springframework.jca.cci.core.support.CommAreaRecord

cloneBeanDefinition() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Clone this bean definition.
cloneBeanDefinition() - Method in class org.springframework.beans.factory.support.ChildBeanDefinition

cloneBeanDefinition() - Method in class org.springframework.beans.factory.support.GenericBeanDefinition

cloneBeanDefinition() - Method in class org.springframework.beans.factory.support.RootBeanDefinition

close() - Method in interface org.springframework.context.ConfigurableApplicationContext
Close this application context, releasing all resources and locks that the implementation might hold.
close() - Method in class org.springframework.context.support.AbstractApplicationContext
Close this application context, destroying all beans in its bean factory.
close() - Method in interface org.springframework.http.client.ClientHttpResponse
Closes this response, freeing any resources created.
close() - Method in interface org.springframework.http.server.ServerHttpResponse
Close this response, freeing any resources created.
close() - Method in class org.springframework.http.server.ServletServerHttpResponse

close() - Method in class org.springframework.jdbc.support.lob.DefaultLobHandler.DefaultLobCreator

close() - Method in interface org.springframework.jdbc.support.lob.LobCreator
Close this LobCreator session and free its temporarily created BLOBs and CLOBs.
close() - Method in class org.springframework.jdbc.support.lob.OracleLobHandler.OracleLobCreator
Free all temporary BLOBs and CLOBs created by this creator.
close() - Method in class org.springframework.mock.jndi.SimpleNamingContext

close() - Method in class org.springframework.mock.web.DelegatingServletInputStream

close() - Method in class org.springframework.mock.web.DelegatingServletOutputStream

close() - Method in class org.springframework.mock.web.MockBodyContent

close() - Method in class org.springframework.mock.web.MockHttpServletRequest
Mark this request as completed, keeping its state.
close() - Method in class org.springframework.mock.web.MockJspWriter

close() - Method in class org.springframework.mock.web.portlet.MockPortletRequest
Mark this request as completed.
close() - Method in class org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
This implementation does nothing: We're dealing with an externally managed DataSource.
close() - Method in class org.springframework.util.CommonsLogWriter

close() - Method in class org.springframework.validation.DataBinder
Close this DataBinder, which may result in throwing a BindException if it encountered any errors.
closeAll() - Method in class org.springframework.jms.connection.JmsResourceHolder

closeBeanFactory() - Method in class org.springframework.context.support.AbstractApplicationContext
Subclasses must implement this method to release their internal bean factory.
closeBeanFactory() - Method in class org.springframework.context.support.AbstractRefreshableApplicationContext

closeBeanFactory() - Method in class org.springframework.context.support.GenericApplicationContext
Not much to do: We hold a single internal BeanFactory that will never get released.
closeConnection(Connection) - Method in class org.springframework.jca.cci.connection.SingleConnectionFactory
Close the given Connection.
closeConnection(Connection) - Static method in class org.springframework.jdbc.support.JdbcUtils
Close the given JDBC Connection and ignore any thrown exception.
closeConnection(Connection) - Method in class org.springframework.jms.connection.SingleConnectionFactory
Close the given Connection.
closeConnection(Connection) - Static method in class org.springframework.jms.support.JmsUtils
Close the given JMS Connection and ignore any thrown exception.
closeConnection(Connection, boolean) - Static method in class org.springframework.jms.support.JmsUtils
Close the given JMS Connection and ignore any thrown exception.
closeConnection(Connection) - Method in class org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
This implementation simply calls Connection.close.
closeConnection(Connection) - Method in class org.springframework.scheduling.quartz.LocalDataSourceJobStore

closeEntityManager(EntityManager) - Static method in class org.springframework.orm.jpa.EntityManagerFactoryUtils
Close the given JPA EntityManager, catching and logging any cleanup exceptions thrown.
closeEntityManagerAfterFailedBegin(JpaTransactionManager.JpaTransactionObject) - Method in class org.springframework.orm.jpa.JpaTransactionManager
Close the current transaction's EntityManager.
closeIterator(Iterator) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Immediately close an Iterator created by any of the various iterate(..) operations, instead of waiting until the session is closed or disconnected.
closeIterator(Iterator) - Method in class org.springframework.orm.hibernate3.HibernateTemplate

closeMessageConsumer(MessageConsumer) - Static method in class org.springframework.jms.support.JmsUtils
Close the given JMS MessageConsumer and ignore any thrown exception.
closeMessageProducer(MessageProducer) - Static method in class org.springframework.jms.support.JmsUtils
Close the given JMS MessageProducer and ignore any thrown exception.
closeNoCatch() - Method in class org.springframework.web.bind.ServletRequestDataBinder
Treats errors as fatal.
closeNoCatch() - Method in class org.springframework.web.bind.support.WebRequestDataBinder
Treats errors as fatal.
closeNoCatch() - Method in class org.springframework.web.portlet.bind.PortletRequestDataBinder
Treats errors as fatal.
closePersistenceManagerAfterFailedBegin(JdoTransactionManager.JdoTransactionObject) - Method in class org.springframework.orm.jdo.JdoTransactionManager
Close the current transaction's EntityManager.
closeQueueBrowser(QueueBrowser) - Static method in class org.springframework.jms.support.JmsUtils
Close the given JMS QueueBrowser and ignore any thrown exception.
closeQueueRequestor(QueueRequestor) - Static method in class org.springframework.jms.support.JmsUtils
Close the given JMS QueueRequestor and ignore any thrown exception.
closeResultSet(ResultSet) - Static method in class org.springframework.jdbc.support.JdbcUtils
Close the given JDBC ResultSet and ignore any thrown exception.
closeSession(Session) - Static method in class org.springframework.jms.support.JmsUtils
Close the given JMS Session and ignore any thrown exception.
closeSession(Session) - Static method in class org.springframework.orm.hibernate3.SessionFactoryUtils
Perform actual closing of the Hibernate Session, catching and logging any cleanup exceptions thrown.
closeSession(Session, SessionFactory) - Method in class org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
Close the given Session.
closeStatement(Statement) - Static method in class org.springframework.jdbc.support.JdbcUtils
Close the given JDBC Statement and ignore any thrown exception.
closeTemplateSource(Object) - Method in class org.springframework.ui.freemarker.SpringTemplateLoader

closeWebApplicationContext(ServletContext) - Method in class org.springframework.web.context.ContextLoader
Close Spring's web application context for the given servlet context.
CODE_ORDER - Static variable in interface org.springframework.core.enums.LabeledEnum
Deprecated. Shared Comparator instance that sorts enumerations by CODE_ORDER.
CODE_SEPARATOR - Static variable in class org.springframework.validation.DefaultMessageCodesResolver
The separator that this implementation uses when resolving message codes.
CodebaseAwareObjectInputStream - Class in org.springframework.remoting.rmi
Special ObjectInputStream subclass that falls back to a specified codebase to load classes from if not found locally.
CodebaseAwareObjectInputStream(InputStream, String) - Constructor for class org.springframework.remoting.rmi.CodebaseAwareObjectInputStream
Create a new CodebaseAwareObjectInputStream for the given InputStream and codebase.
CodebaseAwareObjectInputStream(InputStream, ClassLoader, String) - Constructor for class org.springframework.remoting.rmi.CodebaseAwareObjectInputStream
Create a new CodebaseAwareObjectInputStream for the given InputStream and codebase.
CollectionFactory - Class in org.springframework.core
Factory for collections, being aware of Java 5 and Java 6 collections.
CollectionFactory() - Constructor for class org.springframework.core.CollectionFactory

collectionToCommaDelimitedString(Collection) - Static method in class org.springframework.util.StringUtils
Convenience method to return a Collection as a CSV String.
collectionToDelimitedString(Collection, String, String, String) - Static method in class org.springframework.util.StringUtils
Convenience method to return a Collection as a delimited (e.g.
collectionToDelimitedString(Collection, String) - Static method in class org.springframework.util.StringUtils
Convenience method to return a Collection as a delimited (e.g.
CollectionUtils - Class in org.springframework.util
Miscellaneous collection utility methods.
CollectionUtils() - Constructor for class org.springframework.util.CollectionUtils

COLS_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.TextareaTag

ColumnMapRowMapper - Class in org.springframework.jdbc.core
RowMapper implementation that creates a java.util.Map for each row, representing all columns as key-value pairs: one entry for each column, with the column name as key.
ColumnMapRowMapper() - Constructor for class org.springframework.jdbc.core.ColumnMapRowMapper

combine(String, String) - Method in class org.springframework.util.AntPathMatcher
Combines two patterns into a new pattern that is returned.
combine(String, String) - Method in interface org.springframework.util.PathMatcher
Combines two patterns into a new pattern that is returned.
commaDelimitedListToSet(String) - Static method in class org.springframework.util.StringUtils
Convenience method to convert a CSV string list to a set.
commaDelimitedListToStringArray(String) - Static method in class org.springframework.util.StringUtils
Convert a CSV list into an array of Strings.
COMMAND_NAME_VARIABLE_NAME - Static variable in class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
Deprecated. as of Spring 2.5, in favor of FormTag.MODEL_ATTRIBUTE_VARIABLE_NAME
CommAreaRecord - Class in org.springframework.jca.cci.core.support
CCI Record implementation for a COMMAREA, holding a byte array.
CommAreaRecord() - Constructor for class org.springframework.jca.cci.core.support.CommAreaRecord
Create a new CommAreaRecord.
CommAreaRecord(byte[]) - Constructor for class org.springframework.jca.cci.core.support.CommAreaRecord
Create a new CommAreaRecord.
commit() - Method in class org.springframework.transaction.jta.ManagedTransactionAdapter

commit() - Method in class org.springframework.transaction.jta.UserTransactionAdapter

commit(TransactionStatus) - Method in interface org.springframework.transaction.PlatformTransactionManager
Commit the given transaction, with regard to its status.
commit(TransactionStatus) - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
This implementation of commit handles participating in existing transactions and programmatic rollback requests.
commitAll() - Method in class org.springframework.jms.connection.JmsResourceHolder

commitIfNecessary(Session, Message) - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Perform a commit or message acknowledgement, as appropriate.
commitIfNecessary(Session) - Static method in class org.springframework.jms.support.JmsUtils
Commit the Session if not within a JTA transaction.
commitTransactionAfterReturning(TransactionAspectSupport.TransactionInfo) - Method in class org.springframework.transaction.interceptor.TransactionAspectSupport
Execute after successful completion of call, but not after an exception was handled.
COMMON_ANNOTATION_PROCESSOR_BEAN_NAME - Static variable in class org.springframework.context.annotation.AnnotationConfigUtils
The bean name of the internally managed JSR-250 annotation processor.
CommonAnnotationBeanPostProcessor - Class in org.springframework.context.annotation
BeanPostProcessor implementation that supports common Java annotations out of the box, in particular the JSR-250 annotations in the javax.annotation package.
CommonAnnotationBeanPostProcessor() - Constructor for class org.springframework.context.annotation.CommonAnnotationBeanPostProcessor
Create a new CommonAnnotationBeanPostProcessor, with the init and destroy annotation types set to PostConstruct and PreDestroy, respectively.
CommonAnnotationBeanPostProcessor.LookupElement - Class in org.springframework.context.annotation
Class representing generic injection information about an annotated field or setter method, supporting @Resource and related annotations.
CommonAnnotationBeanPostProcessor.LookupElement(Member, PropertyDescriptor) - Constructor for class org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.LookupElement

commonDatabaseName(String) - Static method in class org.springframework.jdbc.support.JdbcUtils
Extract a common name for the database in use even if various drivers/platforms provide varying names.
CommonsClientHttpRequestFactory - Class in org.springframework.http.client
ClientHttpRequestFactory implementation that uses Jakarta Commons HttpClient to create requests.
CommonsClientHttpRequestFactory() - Constructor for class org.springframework.http.client.CommonsClientHttpRequestFactory
Create a new instance of the CommonsHttpRequestFactory with a default HttpClient that uses a default MultiThreadedHttpConnectionManager.
CommonsClientHttpRequestFactory(HttpClient) - Constructor for class org.springframework.http.client.CommonsClientHttpRequestFactory
Create a new instance of the CommonsHttpRequestFactory with the given HttpClient instance.
CommonsDbcpNativeJdbcExtractor - Class in org.springframework.jdbc.support.nativejdbc
Implementation of the NativeJdbcExtractor interface for the Jakarta Commons DBCP connection pool, version 1.1 or higher.
CommonsDbcpNativeJdbcExtractor() - Constructor for class org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor

CommonsFileUploadSupport - Class in org.springframework.web.multipart.commons
Base class for multipart resolvers that use Jakarta Commons FileUpload 1.2 or above.
CommonsFileUploadSupport() - Constructor for class org.springframework.web.multipart.commons.CommonsFileUploadSupport
Instantiate a new CommonsFileUploadSupport with its corresponding FileItemFactory and FileUpload instances.
CommonsFileUploadSupport.MultipartParsingResult - Class in org.springframework.web.multipart.commons
Holder for a Map of Spring MultipartFiles and a Map of multipart parameters.
CommonsFileUploadSupport.MultipartParsingResult(MultiValueMap<String, MultipartFile>, Map<String, String[]>) - Constructor for class org.springframework.web.multipart.commons.CommonsFileUploadSupport.MultipartParsingResult
Create a new MultipartParsingResult.
CommonsHttpInvokerRequestExecutor - Class in org.springframework.remoting.httpinvoker
HttpInvokerRequestExecutor implementation that uses Jakarta Commons HttpClient to execute POST requests.
CommonsHttpInvokerRequestExecutor() - Constructor for class org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor
Create a new CommonsHttpInvokerRequestExecutor with a default HttpClient that uses a default MultiThreadedHttpConnectionManager.
CommonsHttpInvokerRequestExecutor(HttpClient) - Constructor for class org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor
Create a new CommonsHttpInvokerRequestExecutor with the given HttpClient instance.
CommonsLogFactoryBean - Class in org.springframework.beans.factory.config
Factory bean for commons-logging Log instances.
CommonsLogFactoryBean() - Constructor for class org.springframework.beans.factory.config.CommonsLogFactoryBean

CommonsLoggingLogSystem - Class in org.springframework.ui.velocity
Velocity LogSystem implementation for Jakarta Commons Logging.
CommonsLoggingLogSystem() - Constructor for class org.springframework.ui.velocity.CommonsLoggingLogSystem

CommonsLogWriter - Class in org.springframework.util
java.io.Writer adapter for a Commons Logging Log.
CommonsLogWriter(Log) - Constructor for class org.springframework.util.CommonsLogWriter
Create a new CommonsLogWriter for the given Commons Logging logger.
CommonsMultipartFile - Class in org.springframework.web.multipart.commons
MultipartFile implementation for Jakarta Commons FileUpload.
CommonsMultipartFile(FileItem) - Constructor for class org.springframework.web.multipart.commons.CommonsMultipartFile
Create an instance wrapping the given FileItem.
CommonsMultipartResolver - Class in org.springframework.web.multipart.commons
Servlet-based MultipartResolver implementation for Jakarta Commons FileUpload 1.2 or above.
CommonsMultipartResolver() - Constructor for class org.springframework.web.multipart.commons.CommonsMultipartResolver
Constructor for use as bean.
CommonsMultipartResolver(ServletContext) - Constructor for class org.springframework.web.multipart.commons.CommonsMultipartResolver
Constructor for standalone usage.
CommonsPoolTargetSource - Class in org.springframework.aop.target
TargetSource implementation that holds objects in a configurable Jakarta Commons Pool.
CommonsPoolTargetSource() - Constructor for class org.springframework.aop.target.CommonsPoolTargetSource
Create a CommonsPoolTargetSource with default settings.
CommonsPortletMultipartResolver - Class in org.springframework.web.portlet.multipart
PortletMultipartResolver implementation for Jakarta Commons FileUpload 1.2 or above.
CommonsPortletMultipartResolver() - Constructor for class org.springframework.web.portlet.multipart.CommonsPortletMultipartResolver
Constructor for use as bean.
CommonsPortletMultipartResolver(PortletContext) - Constructor for class org.springframework.web.portlet.multipart.CommonsPortletMultipartResolver
Constructor for standalone usage.
CommonsRequestLoggingFilter - Class in org.springframework.web.filter
Simple request logging filter that writes the request URI (and optionally the query string) to the Commons Log.
CommonsRequestLoggingFilter() - Constructor for class org.springframework.web.filter.CommonsRequestLoggingFilter

ComparableComparator<T extends Comparable<T>> - Class in org.springframework.util.comparator
Comparator that adapts Comparables to the Comparator interface.
ComparableComparator() - Constructor for class org.springframework.util.comparator.ComparableComparator

compare(Object, Object) - Method in class org.springframework.beans.support.PropertyComparator

compare(Object, Object) - Method in class org.springframework.core.OrderComparator

compare(Object, Object) - Method in class org.springframework.expression.spel.support.StandardTypeComparator

compare(Object, Object) - Method in interface org.springframework.expression.TypeComparator
Compare two objects.
compare(Boolean, Boolean) - Method in class org.springframework.util.comparator.BooleanComparator

compare(T, T) - Method in class org.springframework.util.comparator.ComparableComparator

compare(T, T) - Method in class org.springframework.util.comparator.CompoundComparator

compare(T, T) - Method in class org.springframework.util.comparator.InvertibleComparator

compare(T, T) - Method in class org.springframework.util.comparator.NullSafeComparator

compareArguments(Class[], Class[], TypeConverter) - Static method in class org.springframework.expression.spel.support.ReflectionHelper
Compare argument arrays and return information about whether they match.
compareArgumentsVarargs(Class[], Class[], TypeConverter) - Static method in class org.springframework.expression.spel.support.ReflectionHelper
Compare argument arrays and return information about whether they match.
compareTo(Object) - Method in class org.springframework.core.enums.AbstractLabeledEnum
Deprecated.
compareTo(MediaType) - Method in class org.springframework.http.MediaType
Compares this MediaType to another alphabetically.
compile() - Method in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Compile this JdbcCall using provided parameters and meta data plus other settings.
compile() - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Compile this JdbcInsert using provided parameters and meta data plus other settings.
compile() - Method in class org.springframework.jdbc.object.RdbmsOperation
Compile this query.
compileInternal() - Method in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Method to perform the actual compilation.
compileInternal() - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Method to perform the actual compilation.
compileInternal() - Method in class org.springframework.jdbc.object.RdbmsOperation
Subclasses must implement this template method to perform their own compilation.
compileInternal() - Method in class org.springframework.jdbc.object.SqlCall
Overridden method to configure the CallableStatementCreatorFactory based on our declared parameters.
compileInternal() - Method in class org.springframework.jdbc.object.SqlOperation
Overridden method to configure the PreparedStatementCreatorFactory based on our declared parameters.
completeProxiedInterfaces(AdvisedSupport) - Static method in class org.springframework.aop.framework.AopProxyUtils
Determine the complete set of interfaces to proxy for the given AOP configuration.
completeTransactionAfterThrowing(TransactionAspectSupport.TransactionInfo, Throwable) - Method in class org.springframework.transaction.interceptor.TransactionAspectSupport
Handle a throwable, completing the transaction.
Component - Annotation Type in org.springframework.stereotype
Indicates that an annotated class is a "component".
ComponentControllerSupport - Class in org.springframework.web.servlet.view.tiles
Deprecated. as of Spring 3.0
ComponentControllerSupport() - Constructor for class org.springframework.web.servlet.view.tiles.ComponentControllerSupport
Deprecated.
ComponentDefinition - Interface in org.springframework.beans.factory.parsing
Interface that describes the logical view of a set of BeanDefinitions and BeanReferences as presented in some configuration context.
componentRegistered(ComponentDefinition) - Method in class org.springframework.beans.factory.parsing.EmptyReaderEventListener

componentRegistered(ComponentDefinition) - Method in interface org.springframework.beans.factory.parsing.ReaderEventListener
Notification that the given component has been registered.
ComponentScanBeanDefinitionParser - Class in org.springframework.context.annotation
Parser for the <context:component-scan/> element.
ComponentScanBeanDefinitionParser() - Constructor for class org.springframework.context.annotation.ComponentScanBeanDefinitionParser

ComposablePointcut - Class in org.springframework.aop.support
Convenient class for building up pointcuts.
ComposablePointcut() - Constructor for class org.springframework.aop.support.ComposablePointcut
Create a default ComposablePointcut, with ClassFilter.TRUE and MethodMatcher.TRUE.
ComposablePointcut(Pointcut) - Constructor for class org.springframework.aop.support.ComposablePointcut
Create a ComposablePointcut based on the given Pointcut.
ComposablePointcut(ClassFilter) - Constructor for class org.springframework.aop.support.ComposablePointcut
Create a ComposablePointcut for the given ClassFilter, with MethodMatcher.TRUE.
ComposablePointcut(MethodMatcher) - Constructor for class org.springframework.aop.support.ComposablePointcut
Create a ComposablePointcut for the given MethodMatcher, with ClassFilter.TRUE.
ComposablePointcut(ClassFilter, MethodMatcher) - Constructor for class org.springframework.aop.support.ComposablePointcut
Create a ComposablePointcut for the given ClassFilter and MethodMatcher.
composeName(String, String) - Method in class org.springframework.mock.jndi.SimpleNamingContext

composeName(Name, Name) - Method in class org.springframework.mock.jndi.SimpleNamingContext

CompositeComponentDefinition - Class in org.springframework.beans.factory.parsing
ComponentDefinition implementation that holds one or more nested ComponentDefinition instances, aggregating them into a named group of components.
CompositeComponentDefinition(String, Object) - Constructor for class org.springframework.beans.factory.parsing.CompositeComponentDefinition
Create a new CompositeComponentDefinition.
CompositeIterator<E> - Class in org.springframework.util
Iterator that combines multiple other iterators.
CompositeIterator() - Constructor for class org.springframework.util.CompositeIterator
Create a new composite iterator.
CompositeStringExpression - Class in org.springframework.expression.common
Represents a template expression broken into pieces.
CompositeStringExpression(String, Expression[]) - Constructor for class org.springframework.expression.common.CompositeStringExpression

CompositeTransactionAttributeSource - Class in org.springframework.transaction.interceptor
Composite TransactionAttributeSource implementation that iterates over a given array of TransactionAttributeSource instances.
CompositeTransactionAttributeSource(TransactionAttributeSource[]) - Constructor for class org.springframework.transaction.interceptor.CompositeTransactionAttributeSource
Create a new CompositeTransactionAttributeSource for the given sources.
CompoundComparator<T> - Class in org.springframework.util.comparator
A comparator that chains a sequence of one or more more Comparators.
CompoundComparator() - Constructor for class org.springframework.util.comparator.CompoundComparator
Construct a CompoundComparator with initially no Comparators.
CompoundComparator(Comparator[]) - Constructor for class org.springframework.util.comparator.CompoundComparator
Construct a CompoundComparator from the Comparators in the provided array.
CompoundExpression - Class in org.springframework.expression.spel.ast
Represents a DOT separated expression sequence, such as 'property1.property2.methodOne()'
CompoundExpression(int, SpelNodeImpl...) - Constructor for class org.springframework.expression.spel.ast.CompoundExpression

concatenateStringArrays(String[], String[]) - Static method in class org.springframework.util.StringUtils
Concatenate the given String arrays into one, with overlapping array elements included twice.
ConcurrencyFailureException - Exception in org.springframework.dao
Exception thrown on concurrency failure.
ConcurrencyFailureException(String) - Constructor for exception org.springframework.dao.ConcurrencyFailureException
Constructor for ConcurrencyFailureException.
ConcurrencyFailureException(String, Throwable) - Constructor for exception org.springframework.dao.ConcurrencyFailureException
Constructor for ConcurrencyFailureException.
ConcurrencyThrottleInterceptor - Class in org.springframework.aop.interceptor
Interceptor that throttles concurrent access, blocking invocations if a specified concurrency limit is reached.
ConcurrencyThrottleInterceptor() - Constructor for class org.springframework.aop.interceptor.ConcurrencyThrottleInterceptor

ConcurrencyThrottleSupport - Class in org.springframework.util
Support class for throttling concurrent access to a specific resource.
ConcurrencyThrottleSupport() - Constructor for class org.springframework.util.ConcurrencyThrottleSupport

ConcurrentExecutorAdapter - Class in org.springframework.core.task.support
Adapter that exposes the Executor interface for any Spring TaskExecutor.
ConcurrentExecutorAdapter(TaskExecutor) - Constructor for class org.springframework.core.task.support.ConcurrentExecutorAdapter
Create a new ConcurrentExecutorAdapter for the given Spring TaskExecutor.
ConcurrentMap - Interface in org.springframework.core
Deprecated. as of Spring 3.0, since standard ConcurrentMap is available on Java 5+ anyway
ConcurrentTaskExecutor - Class in org.springframework.scheduling.backportconcurrent
Adapter that takes a JSR-166 backport edu.emory.mathcs.backport.java.util.concurrent.Executor and exposes a Spring TaskExecutor for it.
ConcurrentTaskExecutor() - Constructor for class org.springframework.scheduling.backportconcurrent.ConcurrentTaskExecutor
Create a new ConcurrentTaskExecutor, using a single thread executor as default.
ConcurrentTaskExecutor(Executor) - Constructor for class org.springframework.scheduling.backportconcurrent.ConcurrentTaskExecutor
Create a new ConcurrentTaskExecutor, using the given JSR-166 backport concurrent executor.
ConcurrentTaskExecutor - Class in org.springframework.scheduling.concurrent
Adapter that takes a JDK 1.5 java.util.concurrent.Executor and exposes a Spring TaskExecutor for it.
ConcurrentTaskExecutor() - Constructor for class org.springframework.scheduling.concurrent.ConcurrentTaskExecutor
Create a new ConcurrentTaskExecutor, using a single thread executor as default.
ConcurrentTaskExecutor(Executor) - Constructor for class org.springframework.scheduling.concurrent.ConcurrentTaskExecutor
Create a new ConcurrentTaskExecutor, using the given JDK 1.5 concurrent executor.
ConcurrentTaskScheduler - Class in org.springframework.scheduling.concurrent
Adapter that takes a JDK 1.5 java.util.concurrent.ScheduledExecutorService and exposes a Spring TaskScheduler for it.
ConcurrentTaskScheduler() - Constructor for class org.springframework.scheduling.concurrent.ConcurrentTaskScheduler
Create a new ConcurrentTaskScheduler, using a single thread executor as default.
ConcurrentTaskScheduler(ScheduledExecutorService) - Constructor for class org.springframework.scheduling.concurrent.ConcurrentTaskScheduler
Create a new ConcurrentTaskScheduler, using the given JDK 1.5 executor as shared delegate.
ConcurrentTaskScheduler(Executor, ScheduledExecutorService) - Constructor for class org.springframework.scheduling.concurrent.ConcurrentTaskScheduler
Create a new ConcurrentTaskScheduler, using the given JDK 1.5 executors as delegates.
ConditionalGenericConverter - Interface in org.springframework.core.convert.converter
A generic converter that conditionally executes.
ConditionalTestCase - Class in org.springframework.test
Deprecated. as of Spring 3.0, in favor of using the listener-based test context framework (AbstractJUnit38SpringContextTests)
ConditionalTestCase() - Constructor for class org.springframework.test.ConditionalTestCase
Deprecated. Default constructor for ConditionalTestCase.
ConditionalTestCase(String) - Constructor for class org.springframework.test.ConditionalTestCase
Deprecated. Constructor for ConditionalTestCase with a JUnit name.
CONFIG_LOCATION_DELIMITERS - Static variable in interface org.springframework.context.ConfigurableApplicationContext
Any number of these characters are considered delimiters between multiple context config paths in a single String value.
CONFIG_LOCATION_DELIMITERS - Static variable in class org.springframework.jca.context.SpringContextResourceAdapter
Any number of these characters are considered delimiters between multiple context config paths in a single String value.
CONFIG_LOCATION_PARAM - Static variable in class org.springframework.web.context.ContextLoader
Name of servlet context parameter (i.e., "contextConfigLocation") that can specify the config location for the root context, falling back to the implementation's default otherwise.
CONFIG_LOCATION_PARAM - Static variable in class org.springframework.web.util.Log4jWebConfigurer
Parameter specifying the location of the log4j config file
Configurable - Annotation Type in org.springframework.beans.factory.annotation
Marks a class as being eligible for Spring-driven configuration.
ConfigurableApplicationContext - Interface in org.springframework.context
SPI interface to be implemented by most if not all application contexts.
ConfigurableBeanFactory - Interface in org.springframework.beans.factory.config
Configuration interface to be implemented by most bean factories.
ConfigurableJasperReportsView - Class in org.springframework.web.servlet.view.jasperreports
Configurable JasperReports View, allowing to specify the JasperReports exporter to be specified through bean properties rather than through the view class name.
ConfigurableJasperReportsView() - Constructor for class org.springframework.web.servlet.view.jasperreports.ConfigurableJasperReportsView

ConfigurableListableBeanFactory - Interface in org.springframework.beans.factory.config
Configuration interface to be implemented by most listable bean factories.
ConfigurableMimeFileTypeMap - Class in org.springframework.mail.javamail
Spring-configurable FileTypeMap implementation that will read MIME type to file extension mappings from a standard JavaMail MIME type mapping file, using a standard MimetypesFileTypeMap underneath.
ConfigurableMimeFileTypeMap() - Constructor for class org.springframework.mail.javamail.ConfigurableMimeFileTypeMap

ConfigurableObject - Interface in org.springframework.beans.factory.aspectj
Marker interface for domain object that need DI through aspects.
ConfigurableObjectInputStream - Class in org.springframework.core
Special ObjectInputStream subclass that resolves class names against a specific ClassLoader.
ConfigurableObjectInputStream(InputStream, ClassLoader) - Constructor for class org.springframework.core.ConfigurableObjectInputStream
Create a new ConfigurableObjectInputStream for the given InputStream and ClassLoader.
ConfigurablePortletApplicationContext - Interface in org.springframework.web.portlet.context
Interface to be implemented by configurable portlet application contexts.
ConfigurablePropertyAccessor - Interface in org.springframework.beans
Interface that encapsulates configuration methods for a PropertyAccessor.
ConfigurableWebApplicationContext - Interface in org.springframework.web.context
Interface to be implemented by configurable web application contexts.
ConfigurableWebBindingInitializer - Class in org.springframework.web.bind.support
Convenient WebBindingInitializer for declarative configuration in a Spring application context.
ConfigurableWebBindingInitializer() - Constructor for class org.springframework.web.bind.support.ConfigurableWebBindingInitializer

Configuration - Annotation Type in org.springframework.context.annotation
Indicates that a class declares one or more Bean methods and may be processed by the Spring container to generate bean definitions and service requests for those beans at runtime.
CONFIGURATION_ANNOTATION_PROCESSOR_BEAN_NAME - Static variable in class org.springframework.context.annotation.AnnotationConfigUtils
The bean name of the internally managed Configuration annotation processor.
ConfigurationClassPostProcessor - Class in org.springframework.context.annotation
BeanFactoryPostProcessor used for bootstrapping processing of @Configuration classes.
ConfigurationClassPostProcessor() - Constructor for class org.springframework.context.annotation.ConfigurationClassPostProcessor

configure(Properties) - Method in class org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider

configure(Properties) - Method in class org.springframework.orm.hibernate3.SpringTransactionFactory

configureBean(Object, String) - Method in interface org.springframework.beans.factory.config.AutowireCapableBeanFactory
Configure the given raw bean: autowiring bean properties, applying bean property values, applying factory callbacks such as setBeanName and setBeanFactory, and also applying all bean post processors (including ones which might wrap the given raw bean).
configureBean(Object, String) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory

configureBean(Object) - Method in class org.springframework.beans.factory.wiring.BeanConfigurerSupport
Configure the bean instance.
configureBeanPostProcessor(AutowiredAnnotationBeanPostProcessor, Object) - Method in class org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor
Template method for configuring the AutowiredAnnotationBeanPostProcessor used for autowiring.
configureConnectionProperties(ConnectionProperties, String) - Method in interface org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseConfigurer
Configure the properties required to create and connect to the embedded database instance.
configureIndentation(Transformer) - Method in class org.springframework.web.servlet.view.xslt.XsltView
Configure the indentation settings for the supplied Transformer.
configureResponse(Map<String, Object>, HttpServletResponse, Transformer) - Method in class org.springframework.web.servlet.view.xslt.XsltView
Configure the supplied HttpServletResponse.
configureScanner(ParserContext, Element) - Method in class org.springframework.context.annotation.ComponentScanBeanDefinitionParser

configureTransformer(Map<String, Object>, HttpServletResponse, Transformer) - Method in class org.springframework.web.servlet.view.xslt.XsltView
Configure the supplied Transformer instance.
CONNECTION_SYNCHRONIZATION_ORDER - Static variable in class org.springframework.jdbc.datasource.DataSourceUtils
Order value for TransactionSynchronization objects that clean up JDBC Connections.
ConnectionCallback<T> - Interface in org.springframework.jca.cci.core
Generic callback interface for code that operates on a CCI Connection.
ConnectionCallback<T> - Interface in org.springframework.jdbc.core
Generic callback interface for code that operates on a JDBC Connection.
ConnectionFactoryUtils - Class in org.springframework.jca.cci.connection
Helper class that provides static methods for obtaining CCI Connections from a ConnectionFactory.
ConnectionFactoryUtils() - Constructor for class org.springframework.jca.cci.connection.ConnectionFactoryUtils

ConnectionFactoryUtils - Class in org.springframework.jms.connection
Helper class for managing a JMS ConnectionFactory, in particular for obtaining transactional JMS resources for a given ConnectionFactory.
ConnectionFactoryUtils() - Constructor for class org.springframework.jms.connection.ConnectionFactoryUtils

ConnectionFactoryUtils.ResourceFactory - Interface in org.springframework.jms.connection
Callback interface for resource creation.
ConnectionHandle - Interface in org.springframework.jdbc.datasource
Simple interface to be implemented by handles for a JDBC Connection.
ConnectionHolder - Class in org.springframework.jca.cci.connection
Connection holder, wrapping a CCI Connection.
ConnectionHolder(Connection) - Constructor for class org.springframework.jca.cci.connection.ConnectionHolder

ConnectionHolder - Class in org.springframework.jdbc.datasource
Connection holder, wrapping a JDBC Connection.
ConnectionHolder(ConnectionHandle) - Constructor for class org.springframework.jdbc.datasource.ConnectionHolder
Create a new ConnectionHolder for the given ConnectionHandle.
ConnectionHolder(Connection) - Constructor for class org.springframework.jdbc.datasource.ConnectionHolder
Create a new ConnectionHolder for the given JDBC Connection, wrapping it with a SimpleConnectionHandle, assuming that there is no ongoing transaction.
ConnectionHolder(Connection, boolean) - Constructor for class org.springframework.jdbc.datasource.ConnectionHolder
Create a new ConnectionHolder for the given JDBC Connection, wrapping it with a SimpleConnectionHandle.
ConnectionProperties - Interface in org.springframework.jdbc.datasource.embedded
DataSourceFactory helper that allows essential JDBC connection properties to be configured consistently, independent of the actual DataSource implementation.
ConnectionProxy - Interface in org.springframework.jdbc.datasource
Subinterface of Connection to be implemented by Connection proxies.
ConnectionSpecConnectionFactoryAdapter - Class in org.springframework.jca.cci.connection
An adapter for a target CCI ConnectionFactory, applying the given ConnectionSpec to every standard getConnection() call, that is, implicitly invoking getConnection(ConnectionSpec) on the target.
ConnectionSpecConnectionFactoryAdapter() - Constructor for class org.springframework.jca.cci.connection.ConnectionSpecConnectionFactoryAdapter

ConnectorServerFactoryBean - Class in org.springframework.jmx.support
FactoryBean that creates a JSR-160 JMXConnectorServer, optionally registers it with the MBeanServer and then starts it.
ConnectorServerFactoryBean() - Constructor for class org.springframework.jmx.support.ConnectorServerFactoryBean

ConstantException - Exception in org.springframework.core
Exception thrown when the Constants class is asked for an invalid constant name.
ConstantException(String, String, String) - Constructor for exception org.springframework.core.ConstantException
Thrown when an invalid constant name is requested.
ConstantException(String, String, Object) - Constructor for exception org.springframework.core.ConstantException
Thrown when an invalid constant value is looked up.
Constants - Class in org.springframework.core
This class can be used to parse other classes containing constant definitions in public static final members.
Constants(Class) - Constructor for class org.springframework.core.Constants
Create a new Constants converter class wrapping the given class.
CONSTRUCTOR_ARG_ELEMENT - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate

CONSTRUCTOR_ARG_PREFIX - Static variable in class org.springframework.beans.factory.support.PropertiesBeanDefinitionReader
Prefix used to denote a constructor argument definition.
ConstructorArgumentEntry - Class in org.springframework.beans.factory.parsing
ParseState entry representing a (possibly indexed) constructor argument.
ConstructorArgumentEntry() - Constructor for class org.springframework.beans.factory.parsing.ConstructorArgumentEntry
Creates a new instance of the ConstructorArgumentEntry class representing a constructor argument with a (currently) unknown index.
ConstructorArgumentEntry(int) - Constructor for class org.springframework.beans.factory.parsing.ConstructorArgumentEntry
Creates a new instance of the ConstructorArgumentEntry class representing a constructor argument at the supplied index.
ConstructorArgumentValues - Class in org.springframework.beans.factory.config
Holder for constructor argument values, typically as part of a bean definition.
ConstructorArgumentValues() - Constructor for class org.springframework.beans.factory.config.ConstructorArgumentValues
Create a new empty ConstructorArgumentValues object.
ConstructorArgumentValues(ConstructorArgumentValues) - Constructor for class org.springframework.beans.factory.config.ConstructorArgumentValues
Deep copy constructor.
ConstructorArgumentValues.ValueHolder - Class in org.springframework.beans.factory.config
Holder for a constructor argument value, with an optional type attribute indicating the target type of the actual constructor argument.
ConstructorArgumentValues.ValueHolder(Object) - Constructor for class org.springframework.beans.factory.config.ConstructorArgumentValues.ValueHolder
Create a new ValueHolder for the given value.
ConstructorArgumentValues.ValueHolder(Object, String) - Constructor for class org.springframework.beans.factory.config.ConstructorArgumentValues.ValueHolder
Create a new ValueHolder for the given value and type.
ConstructorArgumentValues.ValueHolder(Object, String, String) - Constructor for class org.springframework.beans.factory.config.ConstructorArgumentValues.ValueHolder
Create a new ValueHolder for the given value, type and name.
ConstructorExecutor - Interface in org.springframework.expression
Executors are built by resolvers and can be cached by the infrastructure to repeat an operation quickly without going back to the resolvers.
ConstructorReference - Class in org.springframework.expression.spel.ast
Represents the invocation of a constructor.
ConstructorReference(int, SpelNodeImpl...) - Constructor for class org.springframework.expression.spel.ast.ConstructorReference
Create a constructor reference.
ConstructorResolver - Interface in org.springframework.expression
A constructor resolver attempts locate a constructor and returns a ConstructorExecutor that can be used to invoke that constructor.
CONTAINER_PREFIX - Static variable in class org.springframework.jndi.JndiLocatorSupport
JNDI prefix used in a J2EE container
contains(Class) - Method in exception org.springframework.beans.factory.BeanCreationException

contains(String) - Method in class org.springframework.beans.MutablePropertyValues

contains(Class) - Method in exception org.springframework.beans.PropertyBatchUpdateException

contains(String) - Method in interface org.springframework.beans.PropertyValues
Is there a property value (or other processing entry) for this property?
contains(Class) - Method in exception org.springframework.core.NestedCheckedException
Check whether this exception contains an exception of the given type: either it is of the given class itself or it contains a nested cause of the given type.
contains(Class) - Method in exception org.springframework.core.NestedRuntimeException
Check whether this exception contains an exception of the given type: either it is of the given class itself or it contains a nested cause of the given type.
contains(Object) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Check whether the given object is in the Session cache.
contains(Object) - Method in class org.springframework.orm.hibernate3.HibernateTemplate

contains(Object) - Method in interface org.springframework.orm.jpa.JpaOperations

contains(Object) - Method in class org.springframework.orm.jpa.JpaTemplate

contains(Class) - Method in exception org.springframework.transaction.TransactionSystemException

contains(Object) - Method in class org.springframework.util.AutoPopulatingList

contains(Iterator, Object) - Static method in class org.springframework.util.CollectionUtils
Check whether the given Iterator contains the given element.
contains(Enumeration, Object) - Static method in class org.springframework.util.CollectionUtils
Check whether the given Enumeration contains the given element.
containsAll(Collection) - Method in class org.springframework.util.AutoPopulatingList

containsAny(Collection, Collection) - Static method in class org.springframework.util.CollectionUtils
Return true if any element in 'candidates' is contained in 'source'; otherwise returns false.
containsAttribute(String) - Method in interface org.springframework.ui.Model
Does this model contain an attribute of the given name?
containsAttribute(String) - Method in class org.springframework.ui.ModelMap
Does this model contain an attribute of the given name?
containsBean(String) - Method in interface org.springframework.beans.factory.BeanFactory
Does this bean factory contain a bean with the given name? More specifically, is BeanFactory.getBean(java.lang.String) able to obtain a bean instance for the given name?
containsBean(String) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory

containsBean(String) - Method in class org.springframework.beans.factory.support.StaticListableBeanFactory

containsBean(String) - Method in class org.springframework.context.support.AbstractApplicationContext

containsBean(String) - Method in class org.springframework.jndi.support.SimpleJndiBeanFactory

containsBeanDefinition(String) - Method in interface org.springframework.beans.factory.ListableBeanFactory
Check if this bean factory contains a bean definition with the given name.
containsBeanDefinition(String) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Check if this bean factory contains a bean definition with the given name.
containsBeanDefinition(String) - Method in interface org.springframework.beans.factory.support.BeanDefinitionRegistry
Check if this registry contains a bean definition with the given name.
containsBeanDefinition(String) - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory

containsBeanDefinition(String) - Method in class org.springframework.beans.factory.support.SimpleBeanDefinitionRegistry

containsBeanDefinition(String) - Method in class org.springframework.beans.factory.support.StaticListableBeanFactory

containsBeanDefinition(String) - Method in class org.springframework.context.support.AbstractApplicationContext

containsElement(Object[], Object) - Static method in class org.springframework.util.ObjectUtils
Check whether the given array contains the given element.
containsHeader(String) - Method in class org.springframework.mock.web.MockHttpServletResponse

containsInstance(Collection, Object) - Static method in class org.springframework.util.CollectionUtils
Check whether the given Collection contains the given element instance.
containsKey(Object) - Method in class org.springframework.http.HttpHeaders

containsKey(Object) - Method in class org.springframework.util.CachingMapDecorator

containsKey(Object) - Method in class org.springframework.util.LinkedCaseInsensitiveMap

containsKey(Object) - Method in class org.springframework.util.LinkedMultiValueMap

containsLocalBean(String) - Method in interface org.springframework.beans.factory.HierarchicalBeanFactory
Return whether the local bean factory contains a bean of the given name, ignoring beans defined in ancestor contexts.
containsLocalBean(String) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory

containsLocalBean(String) - Method in class org.springframework.context.support.AbstractApplicationContext

containsObject(String) - Method in class org.springframework.beans.factory.config.BeanExpressionContext

containsSession(Session) - Method in class org.springframework.jms.connection.JmsResourceHolder

containsSession(Session) - Method in class org.springframework.orm.hibernate3.SessionHolder

containsSingleton(String) - Method in interface org.springframework.beans.factory.config.SingletonBeanRegistry
Check if this registry contains a singleton instance with the given name.
containsSingleton(String) - Method in class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry

containsSqlScriptDelimiters(String, char) - Static method in class org.springframework.test.jdbc.JdbcTestUtils
Does the provided SQL script contain the specified delimiter?
containsValue(Object) - Method in class org.springframework.http.HttpHeaders

containsValue(Object) - Method in class org.springframework.util.CachingMapDecorator

containsValue(Object) - Method in class org.springframework.util.LinkedMultiValueMap

containsWhitespace(CharSequence) - Static method in class org.springframework.util.StringUtils
Check whether the given CharSequence contains any whitespace characters.
containsWhitespace(String) - Static method in class org.springframework.util.StringUtils
Check whether the given String contains any whitespace characters.
CONTENT_DISPOSITION_INLINE - Static variable in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
The default Content-Disposition header.
CONTENT_TYPE_CHARSET_PREFIX - Static variable in class org.springframework.web.util.WebUtils
Prefix of the charset clause in a content type String: ";charset="
CONTENT_TYPE_HESSIAN - Static variable in class org.springframework.remoting.caucho.HessianExporter

CONTENT_TYPE_SERIALIZED_OBJECT - Static variable in class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
Default content type: "application/x-java-serialized-object"
CONTENT_TYPE_SERIALIZED_OBJECT - Static variable in class org.springframework.remoting.rmi.RemoteInvocationSerializingExporter
Default content type: "application/x-java-serialized-object"
ContentNegotiatingViewResolver - Class in org.springframework.web.servlet.view
Implementation of ViewResolver that resolves a view based on the request file name or Accept header.
ContentNegotiatingViewResolver() - Constructor for class org.springframework.web.servlet.view.ContentNegotiatingViewResolver

CONTEXT_ATTRIBUTES_BEAN_NAME - Static variable in interface org.springframework.web.context.WebApplicationContext
Name of the ServletContext/PortletContext attributes environment bean in the factory.
CONTEXT_CLASS_PARAM - Static variable in class org.springframework.web.context.ContextLoader
Config param for the root WebApplicationContext implementation class to use: "contextClass"
CONTEXT_PARAMETERS_BEAN_NAME - Static variable in interface org.springframework.web.context.WebApplicationContext
Name of the ServletContext/PortletContext init-params environment bean in the factory.
ContextBeanFactoryReference - Class in org.springframework.context.access
ApplicationContext-specific implementation of BeanFactoryReference, wrapping a newly created ApplicationContext, closing it on release.
ContextBeanFactoryReference(ApplicationContext) - Constructor for class org.springframework.context.access.ContextBeanFactoryReference
Create a new ContextBeanFactoryReference for the given context.
ContextCleanupListener - Class in org.springframework.web.context
Web application listener that cleans up remaining disposable attributes in the ServletContext, i.e.
ContextCleanupListener() - Constructor for class org.springframework.web.context.ContextCleanupListener

ContextClosedEvent - Class in org.springframework.context.event
Event raised when an ApplicationContext gets closed.
ContextClosedEvent(ApplicationContext) - Constructor for class org.springframework.context.event.ContextClosedEvent
Creates a new ContextClosedEvent.
ContextConfiguration - Annotation Type in org.springframework.test.context
ContextConfiguration defines class-level metadata which can be used to instruct client code with regard to how to load and configure an ApplicationContext.
contextDestroyed(ServletContextEvent) - Method in class org.springframework.web.context.ContextCleanupListener

contextDestroyed(ServletContextEvent) - Method in class org.springframework.web.context.ContextLoaderListener
Close the root web application context.
contextDestroyed(ServletContextEvent) - Method in class org.springframework.web.util.IntrospectorCleanupListener

contextDestroyed(ServletContextEvent) - Method in class org.springframework.web.util.Log4jConfigListener

contextDestroyed(ServletContextEvent) - Method in class org.springframework.web.util.WebAppRootListener

ContextExposingHttpServletRequest - Class in org.springframework.web.context.support
HttpServletRequest decorator that makes all Spring beans in a given WebApplicationContext accessible as request attributes, through lazy checking once an attribute gets accessed.
ContextExposingHttpServletRequest(HttpServletRequest, WebApplicationContext) - Constructor for class org.springframework.web.context.support.ContextExposingHttpServletRequest
Create a new ContextExposingHttpServletRequest for the given request.
ContextExposingHttpServletRequest(HttpServletRequest, WebApplicationContext, Set<String>) - Constructor for class org.springframework.web.context.support.ContextExposingHttpServletRequest
Create a new ContextExposingHttpServletRequest for the given request.
contextInitialized(ServletContextEvent) - Method in class org.springframework.web.context.ContextCleanupListener

contextInitialized(ServletContextEvent) - Method in class org.springframework.web.context.ContextLoaderListener
Initialize the root web application context.
contextInitialized(ServletContextEvent) - Method in class org.springframework.web.util.IntrospectorCleanupListener

contextInitialized(ServletContextEvent) - Method in class org.springframework.web.util.Log4jConfigListener

contextInitialized(ServletContextEvent) - Method in class org.springframework.web.util.WebAppRootListener

ContextJndiBeanFactoryLocator - Class in org.springframework.context.access
BeanFactoryLocator implementation that creates the BeanFactory from one or more classpath locations specified in a JNDI environment variable.
ContextJndiBeanFactoryLocator() - Constructor for class org.springframework.context.access.ContextJndiBeanFactoryLocator

contextKey() - Method in class org.springframework.test.AbstractSingleSpringContextTests
Deprecated. Return a key for this context.
contextKeyString(Object) - Method in class org.springframework.test.AbstractSpringContextTests
Deprecated. Subclasses can override this to return a String representation of their context key for use in caching and logging.
ContextLoader - Interface in org.springframework.test.context
Strategy interface for loading an application context.
ContextLoader - Class in org.springframework.web.context
Performs the actual initialization work for the root application context.
ContextLoader() - Constructor for class org.springframework.web.context.ContextLoader

ContextLoaderListener - Class in org.springframework.web.context
Bootstrap listener to start up and shut down Spring's root WebApplicationContext.
ContextLoaderListener() - Constructor for class org.springframework.web.context.ContextLoaderListener

ContextLoaderPlugIn - Class in org.springframework.web.struts
Deprecated. as of Spring 3.0
ContextLoaderPlugIn() - Constructor for class org.springframework.web.struts.ContextLoaderPlugIn
Deprecated.
ContextNamespaceHandler - Class in org.springframework.context.config
NamespaceHandler for the 'context' namespace.
ContextNamespaceHandler() - Constructor for class org.springframework.context.config.ContextNamespaceHandler

ContextRefreshedEvent - Class in org.springframework.context.event
Event raised when an ApplicationContext gets initialized or refreshed.
ContextRefreshedEvent(ApplicationContext) - Constructor for class org.springframework.context.event.ContextRefreshedEvent
Create a new ContextRefreshedEvent.
ContextResource - Interface in org.springframework.core.io
Extended interface for a resource that is loaded from an enclosing 'context', e.g.
ContextSingletonBeanFactoryLocator - Class in org.springframework.context.access
Variant of SingletonBeanFactoryLocator which creates its internal bean factory reference as an ApplicationContext instead of SingletonBeanFactoryLocator's simple BeanFactory.
ContextSingletonBeanFactoryLocator(String) - Constructor for class org.springframework.context.access.ContextSingletonBeanFactoryLocator
Constructor which uses the the specified name as the resource name of the definition file(s).
ContextStartedEvent - Class in org.springframework.context.event
Event raised when an ApplicationContext gets started.
ContextStartedEvent(ApplicationContext) - Constructor for class org.springframework.context.event.ContextStartedEvent
Create a new ContextStartedEvent.
ContextStoppedEvent - Class in org.springframework.context.event
Event raised when an ApplicationContext gets stopped.
ContextStoppedEvent(ApplicationContext) - Constructor for class org.springframework.context.event.ContextStoppedEvent
Create a new ContextStoppedEvent.
ControlFlow - Interface in org.springframework.core
Interface to be implemented by objects that can return information about the current call stack.
ControlFlowFactory - Class in org.springframework.core
Static factory to conceal the automatic choice of the ControlFlow implementation class.
ControlFlowFactory() - Constructor for class org.springframework.core.ControlFlowFactory

ControlFlowPointcut - Class in org.springframework.aop.support
Pointcut and method matcher for use in simple cflow-style pointcut.
ControlFlowPointcut(Class) - Constructor for class org.springframework.aop.support.ControlFlowPointcut
Construct a new pointcut that matches all control flows below that class.
ControlFlowPointcut(Class, String) - Constructor for class org.springframework.aop.support.ControlFlowPointcut
Construct a new pointcut that matches all calls below the given method in the given class.
Controller - Annotation Type in org.springframework.stereotype
Indicates that an annotated class is a "Controller" (e.g.
Controller - Interface in org.springframework.web.portlet.mvc
Base portlet Controller interface, representing a component that receives RenderRequest/RenderResponse and ActionRequest/ActionResponse like a Portlet but is able to participate in an MVC workflow.
Controller - Interface in org.springframework.web.servlet.mvc
Base Controller interface, representing a component that receives HttpServletRequest and HttpServletResponse instances just like a HttpServlet but is able to participate in an MVC workflow.
ControllerBeanNameHandlerMapping - Class in org.springframework.web.servlet.mvc.support
Implementation of HandlerMapping that follows a simple convention for generating URL path mappings from the bean names of registered Controller beans as well as @Controller annotated beans.
ControllerBeanNameHandlerMapping() - Constructor for class org.springframework.web.servlet.mvc.support.ControllerBeanNameHandlerMapping

ControllerClassNameHandlerMapping - Class in org.springframework.web.servlet.mvc.support
Implementation of HandlerMapping that follows a simple convention for generating URL path mappings from the class names of registered Controller beans as well as @Controller annotated beans.
ControllerClassNameHandlerMapping() - Constructor for class org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping

Conventions - Class in org.springframework.core
Provides methods to support various naming and other conventions used throughout the framework.
Conventions() - Constructor for class org.springframework.core.Conventions

CONVERSION_SERVICE_BEAN_NAME - Static variable in interface org.springframework.context.ConfigurableApplicationContext
Name of the ConversionService bean in the factory.
ConversionException - Exception in org.springframework.core.convert
Base class for exceptions thrown by the convert system.
ConversionException(String, Throwable) - Constructor for exception org.springframework.core.convert.ConversionException
Construct a new conversion exception.
ConversionException(String) - Constructor for exception org.springframework.core.convert.ConversionException
Construct a new conversion exception.
ConversionFailedException - Exception in org.springframework.core.convert
Exception to be thrown when an actual type conversion attempt fails.
ConversionFailedException(TypeDescriptor, TypeDescriptor, Object, Throwable) - Constructor for exception org.springframework.core.convert.ConversionFailedException
Create a new conversion exception.
ConversionNotSupportedException - Exception in org.springframework.beans
Exception thrown when no suitable editor or converter can be found for a bean property.
ConversionNotSupportedException(PropertyChangeEvent, Class, Throwable) - Constructor for exception org.springframework.beans.ConversionNotSupportedException
Create a new ConversionNotSupportedException.
ConversionNotSupportedException(Object, Class, Throwable) - Constructor for exception org.springframework.beans.ConversionNotSupportedException
Create a new ConversionNotSupportedException.
ConversionService - Interface in org.springframework.core.convert
A service interface for type conversion.
ConversionServiceExposingInterceptor - Class in org.springframework.web.servlet.handler
Interceptor that places the configured ConversionService in request scope so it's available during request processing.
ConversionServiceExposingInterceptor(ConversionService) - Constructor for class org.springframework.web.servlet.handler.ConversionServiceExposingInterceptor
Creates a new ConversionServiceExposingInterceptor.
ConversionServiceFactory - Class in org.springframework.core.convert.support
A factory for common ConversionService configurations.
ConversionServiceFactory() - Constructor for class org.springframework.core.convert.support.ConversionServiceFactory

ConversionServiceFactoryBean - Class in org.springframework.context.support
A factory for a ConversionService that installs default converters appropriate for most environments.
ConversionServiceFactoryBean() - Constructor for class org.springframework.context.support.ConversionServiceFactoryBean

convert(Object, Class<T>) - Method in interface org.springframework.core.convert.ConversionService
Convert the source to targetType.
convert(Object, TypeDescriptor, TypeDescriptor) - Method in interface org.springframework.core.convert.ConversionService
Convert the source to targetType.
convert(S) - Method in interface org.springframework.core.convert.converter.Converter
Convert the source of type S to target type T.
convert(Object, TypeDescriptor, TypeDescriptor) - Method in interface org.springframework.core.convert.converter.GenericConverter
Convert the source to the targetType described by the TypeDescriptor.
convert(Object, Class<T>) - Method in class org.springframework.core.convert.support.GenericConversionService

convert(Object, TypeDescriptor, TypeDescriptor) - Method in class org.springframework.core.convert.support.GenericConversionService

convert(EvaluationContext, Object, Class<T>) - Static method in class org.springframework.expression.common.ExpressionUtils
Determines if there is a type converter available in the specified context and attempts to use it to convert the supplied value to the specified type.
convertAllArguments(Class[], boolean, TypeConverter, Object[]) - Static method in class org.springframework.expression.spel.support.ReflectionHelper
Convert a supplied set of arguments into the requested types.
convertAndSend(Object) - Method in interface org.springframework.jms.core.JmsOperations
Send the given object to the default destination, converting the object to a JMS message with a configured MessageConverter.
convertAndSend(Destination, Object) - Method in interface org.springframework.jms.core.JmsOperations
Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter.
convertAndSend(String, Object) - Method in interface org.springframework.jms.core.JmsOperations
Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter.
convertAndSend(Object, MessagePostProcessor) - Method in interface org.springframework.jms.core.JmsOperations
Send the given object to the default destination, converting the object to a JMS message with a configured MessageConverter.
convertAndSend(Destination, Object, MessagePostProcessor) - Method in interface org.springframework.jms.core.JmsOperations
Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter.
convertAndSend(String, Object, MessagePostProcessor) - Method in interface org.springframework.jms.core.JmsOperations
Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter.
convertAndSend(Object) - Method in class org.springframework.jms.core.JmsTemplate

convertAndSend(Destination, Object) - Method in class org.springframework.jms.core.JmsTemplate

convertAndSend(String, Object) - Method in class org.springframework.jms.core.JmsTemplate

convertAndSend(Object, MessagePostProcessor) - Method in class org.springframework.jms.core.JmsTemplate

convertAndSend(Destination, Object, MessagePostProcessor) - Method in class org.springframework.jms.core.JmsTemplate

convertAndSend(String, Object, MessagePostProcessor) - Method in class org.springframework.jms.core.JmsTemplate

convertArguments(Class[], boolean, TypeConverter, int[], Object[]) - Static method in class org.springframework.expression.spel.support.ReflectionHelper
Takes an input set of argument values and, following the positions specified in the int array, it converts them to the types specified as the required parameter types.
convertBurlapAccessException(Throwable) - Method in class org.springframework.remoting.caucho.BurlapClientInterceptor
Convert the given Burlap access exception to an appropriate Spring RemoteAccessException.
convertCastorException(XMLException, boolean) - Method in class org.springframework.oxm.castor.CastorMarshaller
Convert the given XMLException to an appropriate exception from the org.springframework.oxm hierarchy.
convertClassLoaderURL(URL) - Method in class org.springframework.core.io.support.PathMatchingResourcePatternResolver
Convert the given URL as returned from the ClassLoader into a Resource object.
convertClassNameToResourcePath(String) - Static method in class org.springframework.util.ClassUtils
Convert a "."-based fully qualified class name to a "/"-based resource path.
convertElement(Object) - Method in class org.springframework.beans.propertyeditors.CustomCollectionEditor
Hook to convert each encountered Collection/array element.
Converter<S,T> - Interface in org.springframework.core.convert.converter
A converter converts a source object of type S to a target of type T.
ConverterFactory<S,R> - Interface in org.springframework.core.convert.converter
A factory for "ranged" converters that can convert objects from S to subtypes of R.
ConverterNotFoundException - Exception in org.springframework.core.convert
Thrown when a suitable converter could not be found in a conversion service.
ConverterNotFoundException(TypeDescriptor, TypeDescriptor) - Constructor for exception org.springframework.core.convert.ConverterNotFoundException
Creates a new conversion executor not found exception.
ConverterRegistry - Interface in org.springframework.core.convert.converter
For registering converters with a type conversion system.
convertExporterParameters() - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
Converts the exporter parameters passed in by the user which may be keyed by Strings corresponding to the fully qualified name of the JRExporterParameter into parameters which are keyed by JRExporterParameter.
convertForProperty(Object, String) - Method in class org.springframework.beans.BeanWrapperImpl
Convert the given value for the specified property to the latter's type.
convertHessianAccessException(Throwable) - Method in class org.springframework.remoting.caucho.HessianClientInterceptor
Convert the given Hessian access exception to an appropriate Spring RemoteAccessException.
convertHibernateAccessException(HibernateException) - Method in class org.springframework.orm.hibernate3.AbstractSessionFactoryBean
Convert the given HibernateException to an appropriate exception from the org.springframework.dao hierarchy.
convertHibernateAccessException(HibernateException) - Method in class org.springframework.orm.hibernate3.HibernateAccessor
Convert the given HibernateException to an appropriate exception from the org.springframework.dao hierarchy.
convertHibernateAccessException(HibernateException) - Method in class org.springframework.orm.hibernate3.HibernateTransactionManager
Convert the given HibernateException to an appropriate exception from the org.springframework.dao hierarchy.
convertHibernateAccessException(HibernateException) - Static method in class org.springframework.orm.hibernate3.SessionFactoryUtils
Convert the given HibernateException to an appropriate exception from the org.springframework.dao hierarchy.
convertHibernateAccessException(HibernateException) - Method in class org.springframework.orm.hibernate3.support.HibernateDaoSupport
Convert the given HibernateException to an appropriate exception from the org.springframework.dao hierarchy.
convertHttpInvokerAccessException(Throwable) - Method in class org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor
Convert the given HTTP invoker access exception to an appropriate Spring RemoteAccessException.
convertIfNecessary(Object, Class<T>) - Method in class org.springframework.beans.AbstractPropertyAccessor

convertIfNecessary(Object, Class<T>, MethodParameter) - Method in class org.springframework.beans.BeanWrapperImpl

convertIfNecessary(Object, Class<T>, MethodParameter) - Method in class org.springframework.beans.DirectFieldAccessor

convertIfNecessary(Object, Class<T>) - Method in class org.springframework.beans.SimpleTypeConverter

convertIfNecessary(Object, Class<T>, MethodParameter) - Method in class org.springframework.beans.SimpleTypeConverter

convertIfNecessary(Object, Class<T>) - Method in interface org.springframework.beans.TypeConverter
Convert the value to the required type (if necessary from a String).
convertIfNecessary(Object, Class<T>, MethodParameter) - Method in interface org.springframework.beans.TypeConverter
Convert the value to the required type (if necessary from a String).
convertIfNecessary(Object, Class<T>) - Method in class org.springframework.validation.DataBinder

convertIfNecessary(Object, Class<T>, MethodParameter) - Method in class org.springframework.validation.DataBinder

ConvertingPropertyEditorAdapter - Class in org.springframework.core.convert.support
Adapter that exposes a PropertyEditor for any given ConversionService and specific target type.
ConvertingPropertyEditorAdapter(ConversionService, TypeDescriptor) - Constructor for class org.springframework.core.convert.support.ConvertingPropertyEditorAdapter
Create a new ConvertingPropertyEditorAdapter for a given ConversionService and the given target type.
convertJaxbException(JAXBException) - Method in class org.springframework.oxm.jaxb.Jaxb2Marshaller
Convert the given JAXBException to an appropriate exception from the org.springframework.oxm hierarchy.
convertJdbcAccessException(JDBCException, SQLExceptionTranslator) - Method in class org.springframework.orm.hibernate3.HibernateAccessor
Convert the given Hibernate JDBCException to an appropriate exception from the org.springframework.dao hierarchy, using the given SQLExceptionTranslator.
convertJdbcAccessException(SQLException) - Method in class org.springframework.orm.hibernate3.HibernateAccessor
Convert the given SQLException to an appropriate exception from the org.springframework.dao hierarchy.
convertJdbcAccessException(JDBCException, SQLExceptionTranslator) - Method in class org.springframework.orm.hibernate3.HibernateTransactionManager
Convert the given Hibernate JDBCException to an appropriate exception from the org.springframework.dao hierarchy, using the given SQLExceptionTranslator.
convertJdoAccessException(JDOException) - Method in class org.springframework.orm.jdo.JdoAccessor
Convert the given JDOException to an appropriate exception from the org.springframework.dao hierarchy.
convertJdoAccessException(JDOException) - Method in class org.springframework.orm.jdo.JdoTransactionManager
Convert the given JDOException to an appropriate exception from the org.springframework.dao hierarchy.
convertJdoAccessException(JDOException) - Static method in class org.springframework.orm.jdo.PersistenceManagerFactoryUtils
Convert the given JDOException to an appropriate exception from the org.springframework.dao hierarchy.
convertJdoAccessException(JDOException) - Method in class org.springframework.orm.jdo.support.JdoDaoSupport
Convert the given JDOException to an appropriate exception from the org.springframework.dao hierarchy.
convertJibxException(JiBXException, boolean) - Method in class org.springframework.oxm.jibx.JibxMarshaller
Convert the given JiBXException to an appropriate exception from the org.springframework.oxm hierarchy.
convertJmsAccessException(JMSException) - Method in class org.springframework.jms.support.JmsAccessor
Convert the specified checked JMSException to a Spring runtime JmsException equivalent.
convertJmsAccessException(JMSException) - Static method in class org.springframework.jms.support.JmsUtils
Convert the specified checked JMSException to a Spring runtime JmsException equivalent.
convertJmsInvokerAccessException(JMSException) - Method in class org.springframework.jms.remoting.JmsInvokerClientInterceptor
Convert the given JMS invoker access exception to an appropriate Spring RemoteAccessException.
convertJndiName(String) - Method in class org.springframework.jndi.JndiLocatorSupport
Convert the given JNDI name into the actual JNDI name to use.
convertJpaAccessExceptionIfPossible(RuntimeException) - Static method in class org.springframework.orm.jpa.EntityManagerFactoryUtils
Convert the given runtime exception to an appropriate exception from the org.springframework.dao hierarchy.
convertKey(Object) - Method in class org.springframework.beans.propertyeditors.CustomMapEditor
Hook to convert each encountered Map key.
convertKey(String) - Method in class org.springframework.util.LinkedCaseInsensitiveMap
Convert the given key to a case-insensitive key.
convertNullSource(TypeDescriptor, TypeDescriptor) - Method in class org.springframework.core.convert.support.GenericConversionService
Hook method to convert a null source.
convertNumberToTargetClass(Number, Class<T>) - Static method in class org.springframework.util.NumberUtils
Convert the given number into an instance of the given target class.
convertParameterValue(JRExporterParameter, Object) - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
Convert the supplied parameter value into the actual type required by the corresponding JRExporterParameter.
convertProperties(Properties) - Method in class org.springframework.beans.factory.config.PropertyResourceConfigurer
Convert the given merged properties, converting property values if necessary.
convertPropertyValue(String) - Method in class org.springframework.beans.factory.config.PropertyResourceConfigurer
Convert the given property value from the properties source to the value that should be applied.
convertReportData(Object) - Static method in class org.springframework.ui.jasperreports.JasperReportsUtils
Convert the given report data value to a JRDataSource.
convertReportData(Object) - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
Convert the given report data value to a JRDataSource.
convertResourcePathToClassName(String) - Static method in class org.springframework.util.ClassUtils
Convert a "/"-based resource path to a "."-based fully qualified class name.
convertResultValueIfNecessary(Object, MethodParameter) - Method in class org.springframework.jmx.access.MBeanClientInterceptor
Convert the given result object (from attribute access or operation invocation) to the specified target class for returning from the proxy method.
convertRmiAccessException(Method, Throwable, String) - Static method in class org.springframework.remoting.rmi.RmiClientInterceptorUtils
Wrap the given arbitrary exception that happened during remote access in either a RemoteException or a Spring RemoteAccessException (if the method signature does not support RemoteException).
convertRmiAccessException(Method, RemoteException, String) - Static method in class org.springframework.remoting.rmi.RmiClientInterceptorUtils
Convert the given RemoteException that happened during remote access to Spring's RemoteAccessException if the method signature does not support RemoteException.
convertRmiAccessException(Method, RemoteException, boolean, String) - Static method in class org.springframework.remoting.rmi.RmiClientInterceptorUtils
Convert the given RemoteException that happened during remote access to Spring's RemoteAccessException if the method signature does not support RemoteException.
convertSource(Object) - Method in class org.springframework.web.servlet.view.xslt.XsltView
Convert the supplied Object into an XSLT Source if the Object type is supported.
convertToExporterParameter(String) - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
Convert the given fully qualified field name to a corresponding JRExporterParameter instance.
convertToModelMBeanNotificationInfo(ManagedNotification) - Static method in class org.springframework.jmx.export.metadata.JmxMetadataUtils
Convert the supplied ManagedNotification into the corresponding ModelMBeanNotificationInfo.
convertToScriptSource(String, String, ResourceLoader) - Method in class org.springframework.scripting.support.ScriptFactoryPostProcessor
Convert the given script source locator to a ScriptSource instance.
convertToXopPackage() - Method in interface org.springframework.oxm.mime.MimeContainer
Turn this message into a XOP package.
convertTypedValue(EvaluationContext, TypedValue, Class<T>) - Static method in class org.springframework.expression.common.ExpressionUtils
Determines if there is a type converter available in the specified context and attempts to use it to convert the supplied value to the specified type.
convertUnderscoreNameToPropertyName(String) - Static method in class org.springframework.jdbc.support.JdbcUtils
Convert a column name with underscores to the corresponding property name using "camel case".
convertValue(Object) - Method in class org.springframework.beans.propertyeditors.CustomMapEditor
Hook to convert each encountered Map value.
convertValue(Object, TypeDescriptor) - Method in class org.springframework.expression.spel.ExpressionState

convertValue(TypedValue, TypeDescriptor) - Method in class org.springframework.expression.spel.ExpressionState

convertValue(Object, TypeDescriptor, TypeDescriptor) - Method in class org.springframework.expression.spel.support.StandardTypeConverter

convertValue(Object, TypeDescriptor, TypeDescriptor) - Method in interface org.springframework.expression.TypeConverter
Convert (may coerce) a value from one type to another, for example from a boolean to a string.
convertValueToRequiredType(Object, Class) - Method in class org.springframework.jdbc.core.SingleColumnRowMapper
Convert the given column value to the specified required type.
convertXmlBeansException(Exception, boolean) - Method in class org.springframework.oxm.xmlbeans.XmlBeansMarshaller
Convert the given XMLBeans exception to an appropriate exception from the org.springframework.oxm hierarchy.
convertXStreamException(Exception, boolean) - Method in class org.springframework.oxm.xstream.XStreamMarshaller
Convert the given XStream exception to an appropriate exception from the org.springframework.oxm hierarchy.
CookieGenerator - Class in org.springframework.web.util
Helper class for cookie generation, carrying cookie descriptor settings as bean properties and being able to add and remove cookie to/from a given response.
CookieGenerator() - Constructor for class org.springframework.web.util.CookieGenerator

CookieLocaleResolver - Class in org.springframework.web.servlet.i18n
LocaleResolver implementation that uses a cookie sent back to the user in case of a custom setting, with a fallback to the specified default locale or the request's accept-header locale.
CookieLocaleResolver() - Constructor for class org.springframework.web.servlet.i18n.CookieLocaleResolver
Creates a new instance of the CookieLocaleResolver class using the default cookie name.
CookieThemeResolver - Class in org.springframework.web.servlet.theme
Implementation of ThemeResolver that uses a cookie sent back to the user in case of a custom setting, with a fallback to the default theme.
CookieThemeResolver() - Constructor for class org.springframework.web.servlet.theme.CookieThemeResolver

CookieValue - Annotation Type in org.springframework.web.bind.annotation
Annotation which indicates that a method parameter should be bound to an HTTP cookie.
copy() - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues.ValueHolder
Create a copy of this ValueHolder: that is, an independent ValueHolder instance with the same contents.
copy(File, File) - Static method in class org.springframework.util.FileCopyUtils
Copy the contents of the given input File to the given output File.
copy(byte[], File) - Static method in class org.springframework.util.FileCopyUtils
Copy the contents of the given byte array to the given output File.
copy(InputStream, OutputStream) - Static method in class org.springframework.util.FileCopyUtils
Copy the contents of the given InputStream to the given OutputStream.
copy(byte[], OutputStream) - Static method in class org.springframework.util.FileCopyUtils
Copy the contents of the given byte array to the given OutputStream.
copy(Reader, Writer) - Static method in class org.springframework.util.FileCopyUtils
Copy the contents of the given Reader to the given Writer.
copy(String, Writer) - Static method in class org.springframework.util.FileCopyUtils
Copy the contents of the given String to the given output Writer.
COPYABLE_FIELDS - Static variable in class org.springframework.util.ReflectionUtils
Pre-built FieldFilter that matches all non-static, non-final fields.
copyAttributesFrom(AttributeAccessor) - Method in class org.springframework.core.AttributeAccessorSupport
Copy the attributes from the supplied AttributeAccessor to this accessor.
copyConfigurationFrom(AdvisedSupport) - Method in class org.springframework.aop.framework.AdvisedSupport
Call this method on a new instance created by the no-arg constructor to create an independent copy of the configuration from the given object.
copyConfigurationFrom(AdvisedSupport, TargetSource, List<Advisor>) - Method in class org.springframework.aop.framework.AdvisedSupport
Copy the AOP configuration from the given AdvisedSupport object, but allow substitution of a fresh TargetSource and a given interceptor chain.
copyConfigurationFrom(ConfigurableBeanFactory) - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Copy all relevant configuration from the given other factory.
copyConfigurationFrom(ConfigurableBeanFactory) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory

copyConfigurationFrom(ConfigurableBeanFactory) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory

copyConfigurationFrom(ConfigurableBeanFactory) - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory

copyCustomEditorsTo(PropertyEditorRegistry, String) - Method in class org.springframework.beans.PropertyEditorRegistrySupport
Copy the custom editors registered in this instance to the given target registry.
copyDefaultEditorsTo(PropertyEditorRegistrySupport) - Method in class org.springframework.beans.PropertyEditorRegistrySupport
Copy the default editors registered in this instance to the given target registry.
copyFrom(ProxyConfig) - Method in class org.springframework.aop.framework.ProxyConfig
Copy configuration from the other config object.
copyFrom(AbstractBeanFactoryBasedTargetSource) - Method in class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
Copy configuration from the other AbstractBeanFactoryBasedTargetSource object.
copyModelParameters(Map<String, Object>, Transformer) - Method in class org.springframework.web.servlet.view.xslt.XsltView
Copy all entries from the supplied Map into the parameter set of the supplied Transformer.
copyOutputProperties(Transformer) - Method in class org.springframework.web.servlet.view.xslt.XsltView
Copy the configured output Properties, if any, into the output property set of the supplied Transformer.
copyOverrides(ResourceOverridingShadowingClassLoader) - Method in class org.springframework.instrument.classloading.ResourceOverridingShadowingClassLoader
Copy all overrides from the given ClassLoader.
copyProperties(Object, Object) - Static method in class org.springframework.beans.BeanUtils
Copy the property values of the given source bean into the target bean.
copyProperties(Object, Object, Class<?>) - Static method in class org.springframework.beans.BeanUtils
Copy the property values of the given source bean into the given target bean, only setting properties defined in the given "editable" class (or interface).
copyProperties(Object, Object, String[]) - Static method in class org.springframework.beans.BeanUtils
Copy the property values of the given source bean into the given target bean, ignoring the given "ignoreProperties".
copyPropertiesToBean(Annotation, Object, String...) - Static method in class org.springframework.beans.annotation.AnnotationBeanUtils
Copy the properties of the supplied Annotation to the supplied target bean.
copyQualifiersFrom(AbstractBeanDefinition) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Copy the qualifiers from the supplied AbstractBeanDefinition to this bean definition.
copyRecursively(File, File) - Static method in class org.springframework.util.FileSystemUtils
Recursively copy the contents of the src file/directory to the dest file/directory.
copyRegisteredEditorsTo(PropertyEditorRegistry) - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Initialize the given PropertyEditorRegistry with the custom editors that have been registered with this BeanFactory.
copyRegisteredEditorsTo(PropertyEditorRegistry) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory

copySortDefinition(SortDefinition) - Method in class org.springframework.beans.support.PagedListHolder
Create a deep copy of the given sort definition, for use as state holder to compare a modified sort definition against.
copyTo(MailMessage) - Method in class org.springframework.mail.SimpleMailMessage
Copy the contents of this message to the given target message.
copyToByteArray(File) - Static method in class org.springframework.util.FileCopyUtils
Copy the contents of the given input File into a new byte array.
copyToByteArray(InputStream) - Static method in class org.springframework.util.FileCopyUtils
Copy the contents of the given InputStream into a new byte array.
copyToString(Reader) - Static method in class org.springframework.util.FileCopyUtils
Copy the contents of the given Reader into a String.
copyTransformers(ShadowingClassLoader) - Method in class org.springframework.instrument.classloading.ShadowingClassLoader
Copy all ClassFileTransformers from the given ClassLoader to the list of transformers that this ClassLoader will apply.
countAdvicesOfType(Class) - Method in class org.springframework.aop.framework.AdvisedSupport
Count advices of the given class.
countBeansIncludingAncestors(ListableBeanFactory) - Static method in class org.springframework.beans.factory.BeanFactoryUtils
Count all beans in any hierarchy in which this factory participates.
countOccurrencesOf(String, String) - Static method in class org.springframework.util.StringUtils
Count the occurrences of the substring in string s.
countRowsInTable(String) - Method in class org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
Deprecated. Count the rows in the given table
countRowsInTable(String) - Method in class org.springframework.test.context.junit38.AbstractTransactionalJUnit38SpringContextTests
Count the rows in the given table.
countRowsInTable(String) - Method in class org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests
Count the rows in the given table.
countRowsInTable(String) - Method in class org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests
Count the rows in the given table.
countRowsInTable(SimpleJdbcTemplate, String) - Static method in class org.springframework.test.jdbc.SimpleJdbcTestUtils
Count the rows in the given table.
create() - Method in class org.springframework.ejb.access.AbstractSlsbInvokerInterceptor
Invokes the create() method on the cached EJB home object.
create(K) - Method in class org.springframework.util.CachingMapDecorator
Create a value to cache for the given key.
createActionURL() - Method in class org.springframework.mock.web.portlet.MockMimeResponse

createActivationSpec(ResourceAdapter, JmsActivationSpecConfig) - Method in interface org.springframework.jms.listener.endpoint.JmsActivationSpecFactory
Create a JCA 1.5 ActivationSpec object based on the given JmsActivationSpecConfig object.
createActivationSpec(ResourceAdapter, JmsActivationSpecConfig) - Method in class org.springframework.jms.listener.endpoint.StandardJmsActivationSpecFactory

createAdvisorIntroducingNamedBean(String) - Static method in class org.springframework.aop.interceptor.ExposeBeanNameAdvisors
Create a new advisor that will expose the given bean name, introducing the NamedBean interface to make the bean name accessible without forcing the target object to be aware of this Spring IoC concept.
createAdvisorWithoutIntroduction(String) - Static method in class org.springframework.aop.interceptor.ExposeBeanNameAdvisors
Create a new advisor that will expose the given bean name, with no introduction
createAndConfigureMBean(Object, String) - Method in class org.springframework.jmx.export.MBeanExporter
Creates an MBean that is configured with the appropriate management interface for the supplied managed resource.
createAndHoldSavepoint() - Method in class org.springframework.transaction.support.AbstractTransactionStatus
Create a savepoint and hold it for the transaction.
createAopProxy(AdvisedSupport) - Method in interface org.springframework.aop.framework.AopProxyFactory
Create an AopProxy for the given AOP configuration.
createAopProxy(AdvisedSupport) - Method in class org.springframework.aop.framework.DefaultAopProxyFactory

createAopProxy() - Method in class org.springframework.aop.framework.ProxyCreatorSupport
Subclasses should call this to get a new AOP proxy.
createApplicationContext(String[]) - Method in class org.springframework.context.access.ContextJndiBeanFactoryLocator
Create the ApplicationContext instance, given an array of class path resource Strings which should be combined
createApplicationContext(BootstrapContext) - Method in class org.springframework.jca.context.SpringContextResourceAdapter
Build a Spring ApplicationContext for the given JCA BootstrapContext.
createApplicationContext(String[]) - Method in class org.springframework.test.AbstractSingleSpringContextTests
Deprecated. Create a Spring ConfigurableApplicationContext for use by this test.
createApplicationContext(Object) - Method in class org.springframework.web.servlet.view.tiles2.SpringTilesApplicationContextFactory

createApplicationManagedEntityManager(EntityManager, EntityManagerPlusOperations) - Static method in class org.springframework.orm.jpa.ExtendedEntityManagerCreator
Create an EntityManager that can join transactions with the joinTransaction() method, but is not automatically managed by the container.
createApplicationManagedEntityManager(EntityManager, EntityManagerPlusOperations, PersistenceExceptionTranslator) - Static method in class org.springframework.orm.jpa.ExtendedEntityManagerCreator
Create an EntityManager that can join transactions with the joinTransaction() method, but is not automatically managed by the container.
createApplicationManagedEntityManager(EntityManager, EntityManagerFactoryInfo) - Static method in class org.springframework.orm.jpa.ExtendedEntityManagerCreator
Create an EntityManager that can join transactions with the joinTransaction() method, but is not automatically managed by the container.
createApproximateCollection(Object, int) - Static method in class org.springframework.core.CollectionFactory
Create the most approximate collection for the given collection.
createApproximateMap(Object, int) - Static method in class org.springframework.core.CollectionFactory
Create the most approximate map for the given map.
createBatch(Map[]) - Static method in class org.springframework.jdbc.core.namedparam.SqlParameterSourceUtils
Create an array of MapSqlParameterSource objects populated with data from the values passed in.
createBatch(Object[]) - Static method in class org.springframework.jdbc.core.namedparam.SqlParameterSourceUtils
Create an array of BeanPropertySqlParameterSource objects populated with data from the values passed in.
createBean(Class<T>) - Method in interface org.springframework.beans.factory.config.AutowireCapableBeanFactory
Fully create a new bean instance of the given class.
createBean(Class, int, boolean) - Method in interface org.springframework.beans.factory.config.AutowireCapableBeanFactory
Fully create a new bean instance of the given class with the specified autowire strategy.
createBean(Class<T>) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory

createBean(Class, int, boolean) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory

createBean(String, RootBeanDefinition, Object[]) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Central method of this class: creates a bean instance, populates the bean instance, applies post-processors, etc.
createBean(String, RootBeanDefinition, Object[]) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Create a bean instance for the given bean definition.
createBeanDefinition(String, String, ClassLoader) - Static method in class org.springframework.beans.factory.support.BeanDefinitionReaderUtils
Create a new GenericBeanDefinition for the given parent name and class name, eagerly loading the bean class if a ClassLoader has been specified.
createBeanDefinition(String, String) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Create a bean definition for the given class name and parent name.
createBeanDefinitionDocumentReader() - Method in class org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Create the BeanDefinitionDocumentReader to use for actually reading bean definitions from an XML document.
createBeanDefinitionReader(GenericApplicationContext) - Method in class org.springframework.test.AbstractSingleSpringContextTests
Deprecated. Factory method for creating new BeanDefinitionReaders for loading bean definitions into the supplied context.
createBeanDefinitionReader(GenericApplicationContext) - Method in class org.springframework.test.context.support.AbstractGenericContextLoader
Factory method for creating new BeanDefinitionReaders for loading bean definitions into the supplied context.
createBeanDefinitionReader(GenericApplicationContext) - Method in class org.springframework.test.context.support.GenericPropertiesContextLoader
Creates a new PropertiesBeanDefinitionReader.
createBeanDefinitionReader(GenericApplicationContext) - Method in class org.springframework.test.context.support.GenericXmlContextLoader
Create a new XmlBeanDefinitionReader.
createBeanFactory(String[]) - Method in class org.springframework.context.access.ContextJndiBeanFactoryLocator
Create the BeanFactory instance, given an array of class path resource Strings which should be combined.
createBeanFactory() - Method in class org.springframework.context.support.AbstractRefreshableApplicationContext
Create an internal bean factory for this context.
createBeanFactoryBasedTargetSource(Class<?>, String) - Method in class org.springframework.aop.framework.autoproxy.target.AbstractBeanFactoryBasedTargetSourceCreator
Subclasses must implement this method to return a new AbstractPrototypeBasedTargetSource if they wish to create a custom TargetSource for this bean, or null if they are not interested it in, in which case no special target source will be created.
createBeanFactoryBasedTargetSource(Class, String) - Method in class org.springframework.aop.framework.autoproxy.target.LazyInitTargetSourceCreator

createBeanFactoryBasedTargetSource(Class, String) - Method in class org.springframework.aop.framework.autoproxy.target.QuickTargetSourceCreator

createBeanInstance(String, RootBeanDefinition, Object[]) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Create a new instance for the specified bean, using an appropriate instantiation strategy: factory method, constructor autowiring, or simple instantiation.
createBeanWrapper() - Method in class org.springframework.validation.BeanPropertyBindingResult
Create a new BeanWrapper for the underlying target object.
createBinder(NativeWebRequest, Object, String) - Method in class org.springframework.web.bind.annotation.support.HandlerMethodInvoker

createBinder(PortletRequest, Object, String) - Method in class org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter
Template method for creating a new PortletRequestDataBinder instance.
createBinder(PortletRequest, Object) - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Create a new binder instance for the given command and request.
createBinder(HttpServletRequest, Object, String) - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
Template method for creating a new ServletRequestDataBinder instance.
createBinder(HttpServletRequest, Object) - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Create a new binder instance for the given command and request.
createBinder(HttpServletRequest, Object) - Method in class org.springframework.web.servlet.mvc.multiaction.MultiActionController
Create a new binder instance for the given command and request.
createBrowser(Session, Queue, String) - Method in class org.springframework.jms.core.JmsTemplate
Create a JMS MessageProducer for the given Session and Destination, configuring it to disable message ids and/or timestamps (if necessary).
createBrowser(Session, Queue, String) - Method in class org.springframework.jms.core.JmsTemplate102
Deprecated.
createBshObject(String) - Static method in class org.springframework.scripting.bsh.BshScriptUtils
Create a new BeanShell-scripted object from the given script source.
createBshObject(String, Class[]) - Static method in class org.springframework.scripting.bsh.BshScriptUtils
Create a new BeanShell-scripted object from the given script source, using the default ClassLoader.
createBshObject(String, Class[], ClassLoader) - Static method in class org.springframework.scripting.bsh.BshScriptUtils
Create a new BeanShell-scripted object from the given script source.
createBurlapProxy(BurlapProxyFactory) - Method in class org.springframework.remoting.caucho.BurlapClientInterceptor
Create the Burlap proxy that is wrapped by this interceptor.
createCache() - Method in class org.springframework.cache.ehcache.EhCacheFactoryBean
Create a raw Cache object based on the configuration of this FactoryBean.
createCallableStatement(Connection) - Method in interface org.springframework.jdbc.core.CallableStatementCreator
Create a callable statement in this connection.
createCallString() - Method in class org.springframework.jdbc.core.metadata.CallMetaDataContext
Build the call string based on configuration and metadata information.
createCciTemplate(ConnectionFactory) - Method in class org.springframework.jca.cci.core.support.CciDaoSupport
Create a CciTemplate for the given ConnectionFactory.
createCollection(Class, int) - Method in class org.springframework.beans.propertyeditors.CustomCollectionEditor
Create a Collection of the given type, with the given initial capacity (if supported by the Collection type).
createCollection(Class<?>, int) - Static method in class org.springframework.core.CollectionFactory
Create the most appropriate collection for the given collection type.
createColumnMap(int) - Method in class org.springframework.jdbc.core.ColumnMapRowMapper
Create a Map instance to be used as column map.
createCommand() - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Create a new command instance for the command class of this controller.
createCommand() - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Create a new command instance for the command class of this controller.
createCommonsHttpMethod(HttpMethod, String) - Method in class org.springframework.http.client.CommonsClientHttpRequestFactory
Create a Commons HttpMethodBase object for the given HTTP method and URI specification.
createCompositeInterface(Class[]) - Method in class org.springframework.aop.framework.ProxyFactoryBean
Create a composite interface Class for the given interfaces, implementing the given interfaces in one single Class.
createCompositeInterface(Class[]) - Method in class org.springframework.jndi.JndiObjectFactoryBean
Create a composite interface Class for the given interfaces, implementing the given interfaces in one single Class.
createCompositeInterface(Class[]) - Method in class org.springframework.scripting.support.ScriptFactoryPostProcessor
Create a composite interface Class for the given interfaces, implementing the given interfaces in one single Class.
createCompositeInterface(Class<?>[], ClassLoader) - Static method in class org.springframework.util.ClassUtils
Create a composite interface Class for the given interfaces, implementing the given interfaces in one single Class.
createConcurrentMap(int) - Static method in class org.springframework.core.CollectionFactory
Deprecated. as of Spring 3.0, for usage on JDK 1.5 or higher
createConcurrentMapIfPossible(int) - Static method in class org.springframework.core.CollectionFactory
Deprecated. as of Spring 3.0, for usage on JDK 1.5 or higher
createConfigInterface(BeanDefinition, Class[]) - Method in class org.springframework.scripting.support.ScriptFactoryPostProcessor
Create a config interface for the given bean definition, defining setter methods for the defined property values as well as an init method and a destroy method (if defined).
createConfiguration() - Method in class org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
Prepare the FreeMarker Configuration and return it.
createConnection() - Method in interface org.springframework.jms.connection.ConnectionFactoryUtils.ResourceFactory
Create a new JMS Connection for registration with a JmsResourceHolder.
createConnection() - Method in class org.springframework.jms.connection.DelegatingConnectionFactory

createConnection(String, String) - Method in class org.springframework.jms.connection.DelegatingConnectionFactory

createConnection() - Method in class org.springframework.jms.connection.JmsTransactionManager
Create a JMS Connection via this template's ConnectionFactory.
createConnection() - Method in class org.springframework.jms.connection.JmsTransactionManager102
Deprecated. This implementation overrides the superclass method to use JMS 1.0.2 API.
createConnection() - Method in class org.springframework.jms.connection.SingleConnectionFactory

createConnection(String, String) - Method in class org.springframework.jms.connection.SingleConnectionFactory

createConnection() - Method in class org.springframework.jms.connection.TransactionAwareConnectionFactoryProxy

createConnection(String, String) - Method in class org.springframework.jms.connection.TransactionAwareConnectionFactoryProxy

createConnection() - Method in class org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter
Determine whether there are currently thread-bound credentials, using them if available, falling back to the statically specified username and password (i.e.
createConnection(String, String) - Method in class org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter
Delegate the call straight to the target ConnectionFactory.
createConnection() - Method in class org.springframework.jms.core.JmsTemplate102
Deprecated. This implementation overrides the superclass method to use JMS 1.0.2 API.
createConnection() - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer102
Deprecated. This implementation overrides the superclass method to use JMS 1.0.2 API.
createConnection() - Method in class org.springframework.jms.listener.SimpleMessageListenerContainer102
Deprecated. This implementation overrides the superclass method to use JMS 1.0.2 API.
createConnection() - Method in class org.springframework.jms.remoting.JmsInvokerClientInterceptor
Create a new JMS Connection for this JMS invoker, ideally a javax.jms.QueueConnection.
createConnection() - Method in class org.springframework.jms.support.JmsAccessor
Create a JMS Connection via this template's ConnectionFactory.
createConnectionProxy(Connection) - Method in class org.springframework.jdbc.core.JdbcTemplate
Create a close-suppressing proxy for the given JDBC Connection.
createConnectionSpec(Integer, Boolean, String, String) - Method in class org.springframework.jdbc.datasource.WebSphereDataSourceAdapter
Create a WebSphere JDBCConnectionSpec object for the given charateristics.
createConsumer(Session, Destination, String) - Method in class org.springframework.jms.core.JmsTemplate
Create a JMS MessageConsumer for the given Session and Destination.
createConsumer(Session, Destination, String) - Method in class org.springframework.jms.core.JmsTemplate102
Deprecated. This implementation overrides the superclass method to use JMS 1.0.2 API.
createConsumer(Session, Destination) - Method in class org.springframework.jms.listener.AbstractPollingMessageListenerContainer
Create a JMS MessageConsumer for the given Session and Destination.
createConsumer(Session, Destination) - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer102
Deprecated. This implementation overrides the superclass method to use JMS 1.0.2 API.
createConsumer(Session, Destination) - Method in class org.springframework.jms.listener.SimpleMessageListenerContainer
Create a JMS MessageConsumer for the given Session and Destination.
createConsumer(Session, Destination) - Method in class org.springframework.jms.listener.SimpleMessageListenerContainer102
Deprecated. This implementation overrides the superclass method to use JMS 1.0.2 API.
createContainerManagedEntityManager(EntityManager, EntityManagerPlusOperations) - Static method in class org.springframework.orm.jpa.ExtendedEntityManagerCreator
Create an EntityManager that automatically joins transactions on each operation in a transaction.
createContainerManagedEntityManager(EntityManager, EntityManagerPlusOperations, PersistenceExceptionTranslator) - Static method in class org.springframework.orm.jpa.ExtendedEntityManagerCreator
Create an EntityManager that automatically joins transactions on each operation in a transaction.
createContainerManagedEntityManager(EntityManager, EntityManagerFactoryInfo) - Static method in class org.springframework.orm.jpa.ExtendedEntityManagerCreator
Create an EntityManager that automatically joins transactions on each operation in a transaction.
createContainerManagedEntityManager(EntityManagerFactory) - Static method in class org.springframework.orm.jpa.ExtendedEntityManagerCreator
Create an EntityManager that automatically joins transactions on each operation in a transaction.
createContainerManagedEntityManager(EntityManagerFactory, Map) - Static method in class org.springframework.orm.jpa.ExtendedEntityManagerCreator
Create an EntityManager that automatically joins transactions on each operation in a transaction.
createContainerManagedEntityManager() - Method in class org.springframework.test.jpa.AbstractJpaTests
Deprecated. Create an EntityManager that will always automatically enlist itself in current transactions, in contrast to an EntityManager returned by EntityManagerFactory.createEntityManager() (which requires an explicit joinTransaction() call).
createContentHandler(Node) - Static method in class org.springframework.util.xml.DomUtils
Returns a SAX ContentHandler that transforms callback calls to DOM Nodes.
createContentHandler(XMLStreamWriter) - Static method in class org.springframework.util.xml.StaxUtils
Create a SAX ContentHandler that writes to the given StAX XMLStreamWriter.
createContentHandler(XMLEventWriter) - Static method in class org.springframework.util.xml.StaxUtils
Create a SAX ContentHandler that writes events to the given StAX XMLEventWriter.
createContextLoader() - Method in class org.springframework.web.context.ContextLoaderListener
Deprecated. in favor of simply subclassing ContextLoaderListener itself (which extends ContextLoader, as of Spring 3.0)
createControlFlow() - Static method in class org.springframework.core.ControlFlowFactory
Return an appropriate ControlFlow instance.
createConversionService() - Method in class org.springframework.context.support.ConversionServiceFactoryBean
Create the ConversionService instance returned by this factory bean.
createCookie(String) - Method in class org.springframework.web.util.CookieGenerator
Create a cookie with the given value, using the cookie descriptor settings of this generator (except for "cookieMaxAge").
createCopyOnWriteSet() - Static method in class org.springframework.core.CollectionFactory
Deprecated. as of Spring 3.0, for usage on JDK 1.5 or higher
createCustomException(String, String, SQLException, Class) - Method in class org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator
Create a custom DataAccessException, based on a given exception class from a CustomSQLErrorCodesTranslation definition.
createDatabaseSchema() - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Execute schema creation script, determined by the Configuration object used for creating the SessionFactory.
createDataSource(InputStreamSource, String, String) - Method in class org.springframework.mail.javamail.MimeMessageHelper
Create an Activation Framework DataSource for the given InputStreamSource.
createDefaultBeanWiringInfoResolver() - Method in class org.springframework.beans.factory.wiring.BeanConfigurerSupport
Create the default BeanWiringInfoResolver to be used if none was specified explicitly.
createDefaultConversionService() - Static method in class org.springframework.core.convert.support.ConversionServiceFactory
Create a new default ConversionService instance that can be safely modified.
createDefaultInOutParameter(String, CallParameterMetaData) - Method in interface org.springframework.jdbc.core.metadata.CallMetaDataProvider
Create a default inout parameter based on the provided meta data.
createDefaultInOutParameter(String, CallParameterMetaData) - Method in class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider

createDefaultInParameter(String, CallParameterMetaData) - Method in interface org.springframework.jdbc.core.metadata.CallMetaDataProvider
Create a default in parameter based on the provided meta data.
createDefaultInParameter(String, CallParameterMetaData) - Method in class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider

createDefaultNamespaceHandlerResolver() - Method in class org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Create the default implementation of NamespaceHandlerResolver used if none is specified.
createDefaultOutParameter(String, CallParameterMetaData) - Method in interface org.springframework.jdbc.core.metadata.CallMetaDataProvider
Create a default out parameter based on the provided meta data.
createDefaultOutParameter(String, CallParameterMetaData) - Method in class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider

createDefaultOutParameter(String, CallParameterMetaData) - Method in class org.springframework.jdbc.core.metadata.OracleCallMetaDataProvider

createDefaultOutParameter(String, CallParameterMetaData) - Method in class org.springframework.jdbc.core.metadata.PostgresCallMetaDataProvider

createDefaultStrategy(ApplicationContext, Class<?>) - Method in class org.springframework.web.portlet.DispatcherPortlet
Create a default strategy.
createDefaultStrategy(ApplicationContext, Class<?>) - Method in class org.springframework.web.servlet.DispatcherServlet
Create a default strategy.
createDefaultTaskExecutor() - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Create a default TaskExecutor.
createDefinition(String, String) - Method in class org.springframework.beans.factory.access.SingletonBeanFactoryLocator
Actually creates definition in the form of a BeanFactory, given a resource name which supports standard Spring resource prefixes ('classpath:', 'classpath*:', etc.) This is split out as a separate method so that subclasses can override the actual type used (to be an ApplicationContext, for example).
createDefinition(String, String) - Method in class org.springframework.context.access.ContextSingletonBeanFactoryLocator
Overrides the default method to create definition object as an ApplicationContext instead of the default BeanFactory.
createDefinitionsFactory(DefinitionsFactoryConfig) - Method in class org.springframework.web.servlet.view.tiles.TilesConfigurer
Deprecated. Create the Tiles DefinitionsFactory and expose it to the ServletContext.
createDirectFieldAccessor() - Method in class org.springframework.validation.DirectFieldBindingResult
Create a new DirectFieldAccessor for the underlying target object.
createDocumentBuilder(DocumentBuilderFactory, EntityResolver, ErrorHandler) - Method in class org.springframework.beans.factory.xml.DefaultDocumentLoader
Create a JAXP DocumentBuilder that this bean definition reader will use for parsing XML documents.
createDocumentBuilder(DocumentBuilderFactory) - Method in class org.springframework.oxm.support.AbstractMarshaller
Create a DocumentBuilder that this marshaller will use for creating DOM documents when passed an empty DOMSource.
createDocumentBuilderFactory(int, boolean) - Method in class org.springframework.beans.factory.xml.DefaultDocumentLoader
Create the DocumentBuilderFactory instance.
createDocumentBuilderFactory() - Method in class org.springframework.oxm.support.AbstractMarshaller
Create a DocumentBuilder that this marshaller will use for creating DOM documents when passed an empty DOMSource.
createElement(String) - Method in class org.springframework.mock.web.portlet.MockPortletResponse

createElement(int) - Method in interface org.springframework.util.AutoPopulatingList.ElementFactory
Create the element for the supplied index.
createEndpoint(XAResource) - Method in class org.springframework.jca.endpoint.AbstractMessageEndpointFactory
This implementation delegates to AbstractMessageEndpointFactory.createEndpointInternal(), initializing the endpoint's XAResource before the endpoint gets invoked.
createEndpoint(XAResource) - Method in class org.springframework.jca.endpoint.GenericMessageEndpointFactory
Wrap each concrete endpoint instance with an AOP proxy, exposing the message listener's interfaces as well as the endpoint SPI through an AOP introduction.
createEndpointInternal() - Method in class org.springframework.jca.endpoint.AbstractMessageEndpointFactory
Create the actual endpoint instance, as a subclass of the AbstractMessageEndpointFactory.AbstractMessageEndpoint inner class of this factory.
createEndpointInternal() - Method in class org.springframework.jca.endpoint.GenericMessageEndpointFactory
Creates a concrete generic message endpoint, internal to this factory.
createEndpointInternal() - Method in class org.springframework.jms.listener.endpoint.JmsMessageEndpointFactory
Creates a concrete JMS message endpoint, internal to this factory.
createEntityManager() - Method in class org.springframework.orm.jpa.EntityManagerFactoryAccessor
Obtain a new EntityManager from this accessor's EntityManagerFactory.
createEntityManager(EntityManagerFactory) - Method in class org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter
Create a JPA EntityManager to be bound to a request.
createEntityManagerFactoryProxy(EntityManagerFactory) - Method in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
Create a proxy of the given EntityManagerFactory.
createEntityManagerForTransaction() - Method in class org.springframework.orm.jpa.JpaTransactionManager
Create a JPA EntityManager to be used for a transaction.
createEntityManagerProxy(EntityManager) - Method in class org.springframework.orm.jpa.JpaTemplate
Create a close-suppressing proxy for the given JPA EntityManager.
createEventStreamReader(XMLEventReader) - Static method in class org.springframework.util.xml.StaxUtils
Return a XMLStreamReader that reads from a XMLEventReader.
createExecutor(int, ThreadFactory, RejectedExecutionHandler) - Method in class org.springframework.scheduling.concurrent.ScheduledExecutorFactoryBean
Create a new ScheduledExecutorService instance.
createExecutor(int, ThreadFactory, RejectedExecutionHandler) - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
Create a new ScheduledExecutorService instance.
createExporter() - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsSingleFormatView
Create a JasperReports exporter for a specific output format, which will be used to render the report to the HTTP response.
createExporter() - Method in class org.springframework.web.servlet.view.jasperreports.ConfigurableJasperReportsView
Returns a new instance of the specified JRExporter class.
createExporter() - Method in class org.springframework.web.servlet.view.jasperreports.JasperReportsCsvView

createExporter() - Method in class org.springframework.web.servlet.view.jasperreports.JasperReportsHtmlView

createExporter() - Method in class org.springframework.web.servlet.view.jasperreports.JasperReportsPdfView

createExporter() - Method in class org.springframework.web.servlet.view.jasperreports.JasperReportsXlsView

createFileTypeMap(Resource, String[]) - Method in class org.springframework.mail.javamail.ConfigurableMimeFileTypeMap
Compile a FileTypeMap from the mappings in the given mapping file and the given mapping entries.
createHelper(XmlReaderContext, Element) - Method in class org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader

createHessianProxy(HessianProxyFactory) - Method in class org.springframework.remoting.caucho.HessianClientInterceptor
Create the Hessian proxy that is wrapped by this interceptor.
createHibernateTemplate(SessionFactory) - Method in class org.springframework.orm.hibernate3.support.HibernateDaoSupport
Create a HibernateTemplate for the given SessionFactory.
createHttpInputMessage(NativeWebRequest) - Method in class org.springframework.web.bind.annotation.support.HandlerMethodInvoker
Return a HttpInputMessage for the given NativeWebRequest.
createHttpInputMessage(HttpServletRequest) - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
Template method for creating a new HttpInputMessage instance.
createHttpOutputMessage(NativeWebRequest) - Method in class org.springframework.web.bind.annotation.support.HandlerMethodInvoker
Return a HttpOutputMessage for the given NativeWebRequest.
createHttpOutputMessage(HttpServletResponse) - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
Template method for creating a new HttpOuputMessage instance.
createIdentityMapIfPossible(int) - Static method in class org.springframework.core.CollectionFactory
Deprecated. as of Spring 2.5, for usage on JDK 1.4 or higher
createIndexedRecord(String) - Method in class org.springframework.jca.cci.connection.NotSupportedRecordFactory

createIndexedRecord(String) - Method in class org.springframework.jca.cci.core.CciTemplate
Create an indexed Record through the ConnectionFactory's RecordFactory.
createInitialContext() - Method in class org.springframework.jndi.JndiTemplate
Create a new JNDI initial context.
createInitialContextFactory(Hashtable<?, ?>) - Method in class org.springframework.mock.jndi.SimpleNamingContextBuilder
Simple InitialContextFactoryBuilder implementation, creating a new SimpleNamingContext instance.
createInputRecord(RecordFactory, Object) - Method in class org.springframework.jca.cci.object.MappingCommAreaOperation

createInputRecord(RecordFactory, Object) - Method in class org.springframework.jca.cci.object.MappingRecordOperation
Subclasses must implement this method to generate an input Record from an input object passed into the execute method.
createInputSource(Resource) - Static method in class org.springframework.oxm.support.SaxResourceUtils
Create a SAX InputSource from the given resource.
createInsertString(String[]) - Method in class org.springframework.jdbc.core.metadata.TableMetaDataContext
Build the insert string based on configuration and metadata information
createInsertTypes() - Method in class org.springframework.jdbc.core.metadata.TableMetaDataContext
Build the array of Types based on configuration and metadata information
createInstance() - Method in class org.springframework.beans.factory.config.AbstractFactoryBean
Template method that subclasses must override to construct the object returned by this factory.
createInstance() - Method in class org.springframework.beans.factory.config.ListFactoryBean

createInstance() - Method in class org.springframework.beans.factory.config.MapFactoryBean

createInstance() - Method in class org.springframework.beans.factory.config.ObjectFactoryCreatingFactoryBean

createInstance() - Method in class org.springframework.beans.factory.config.ProviderCreatingFactoryBean

createInstance() - Method in class org.springframework.beans.factory.config.SetFactoryBean

createInstance() - Method in class org.springframework.beans.factory.serviceloader.AbstractServiceLoaderBasedFactoryBean
Delegates to AbstractServiceLoaderBasedFactoryBean.getObjectToExpose(java.util.ServiceLoader).
createInstance() - Method in class org.springframework.jdbc.config.SortedResourcesFactoryBean

createInterceptorDefinition(Node) - Method in class org.springframework.aop.config.AbstractInterceptorDrivenBeanDefinitionDecorator
Subclasses should implement this method to return the BeanDefinition for the interceptor they wish to apply to the bean being decorated.
createInvocationTraceName(MethodInvocation) - Method in class org.springframework.aop.interceptor.AbstractMonitoringInterceptor
Create a String name for the given MethodInvocation that can be used for trace/logging purposes.
createJaxRpcService() - Method in class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
Deprecated. Create a JAX-RPC Service according to the parameters of this factory.
createJaxWsService() - Method in class org.springframework.remoting.jaxws.LocalJaxWsServiceFactory
Create a JAX-WS Service according to the parameters of this factory.
createJdbcTemplate(DataSource) - Method in class org.springframework.jdbc.core.support.JdbcDaoSupport
Create a JdbcTemplate for the given DataSource.
createJdoTemplate(PersistenceManagerFactory) - Method in class org.springframework.orm.jdo.support.JdoDaoSupport
Create a JdoTemplate for the given PersistenceManagerFactory.
createJmsTemplate(ConnectionFactory) - Method in class org.springframework.jms.core.support.JmsGatewaySupport
Create a JmsTemplate for the given ConnectionFactory.
createJobInstance(TriggerFiredBundle) - Method in class org.springframework.scheduling.quartz.AdaptableJobFactory
Create an instance of the specified job class.
createJobInstance(TriggerFiredBundle) - Method in class org.springframework.scheduling.quartz.SpringBeanJobFactory
Create the job instance, populating it with property values taken from the scheduler context, job data map and trigger data map.
createJpaTemplate(EntityManagerFactory) - Method in class org.springframework.orm.jpa.support.JpaDaoSupport
Create a JpaTemplate for the given EntityManagerFactory.
createJpaTemplate(EntityManager) - Method in class org.springframework.orm.jpa.support.JpaDaoSupport
Create a JpaTemplate for the given EntityManager.
createJRubyObject(String, Class[]) - Static method in class org.springframework.scripting.jruby.JRubyScriptUtils
Create a new JRuby-scripted object from the given script source, using the default ClassLoader.
createJRubyObject(String, Class[], ClassLoader) - Static method in class org.springframework.scripting.jruby.JRubyScriptUtils
Create a new JRuby-scripted object from the given script source.
createLinkedCaseInsensitiveMapIfPossible(int) - Static method in class org.springframework.core.CollectionFactory
Deprecated. as of Spring 3.0, for usage on JDK 1.5 or higher
createLinkedMapIfPossible(int) - Static method in class org.springframework.core.CollectionFactory
Deprecated. as of Spring 2.5, for usage on JDK 1.4 or higher
createLinkedSetIfPossible(int) - Static method in class org.springframework.core.CollectionFactory
Deprecated. as of Spring 2.5, for usage on JDK 1.4 or higher
createListenerConsumer(Session) - Method in class org.springframework.jms.listener.AbstractPollingMessageListenerContainer
Create a MessageConsumer for the given JMS Session, registering a MessageListener for the specified listener.
createListenerConsumer(Session) - Method in class org.springframework.jms.listener.SimpleMessageListenerContainer
Create a MessageConsumer for the given JMS Session, registering a MessageListener for the specified listener.
createLob(PreparedStatement, boolean, OracleLobHandler.LobCallback) - Method in class org.springframework.jdbc.support.lob.OracleLobHandler.OracleLobCreator
Create a LOB instance for the given PreparedStatement, populating it via the given callback.
createMainInterceptor() - Method in class org.springframework.aop.framework.AbstractSingletonProxyFactoryBean
Create the "main" interceptor for this proxy factory bean.
createMainInterceptor() - Method in class org.springframework.transaction.interceptor.TransactionProxyFactoryBean
Creates an advisor for this FactoryBean's TransactionInterceptor.
createMap(Class, int) - Method in class org.springframework.beans.propertyeditors.CustomMapEditor
Create a Map of the given type, with the given initial capacity (if supported by the Map type).
createMap(Class<?>, int) - Static method in class org.springframework.core.CollectionFactory
Create the most approximate map for the given map.
createMap(Connection) - Method in interface org.springframework.jdbc.core.ParameterMapper
Create a Map of input parameters, keyed by name.
createMappedRecord(String) - Method in class org.springframework.jca.cci.connection.NotSupportedRecordFactory

createMappedRecord(String) - Method in class org.springframework.jca.cci.core.CciTemplate
Create a mapped Record from the ConnectionFactory's RecordFactory.
createMarshaller(Class) - Method in class org.springframework.http.converter.xml.AbstractJaxb2HttpMessageConverter
Creates a new Marshaller for the given class.
createMarshaller() - Method in class org.springframework.oxm.jaxb.Jaxb2Marshaller
Return a newly created JAXB marshaller.
createMarshallingContext() - Method in class org.springframework.oxm.jibx.JibxMarshaller
Create a new IMarshallingContext, configured with the correct indentation.
createMBeanServer(String, boolean) - Method in class org.springframework.jmx.support.MBeanServerFactoryBean
Create a new MBeanServer instance and register it with the MBeanServerFactory, if desired.
createMessage(Session) - Method in interface org.springframework.jms.core.MessageCreator
Create a Message to be sent.
createMessage(HttpServletRequest, String, String) - Method in class org.springframework.web.filter.AbstractRequestLoggingFilter
Create a log message for the given request, prefix and suffix.
createMessageForByteArray(byte[], Session) - Method in class org.springframework.jms.support.converter.SimpleMessageConverter
Create a JMS BytesMessage for the given byte array.
createMessageForMap(Map<?, ?>, Session) - Method in class org.springframework.jms.support.converter.SimpleMessageConverter
Create a JMS MapMessage for the given Map.
createMessageFormat(String, Locale) - Method in class org.springframework.context.support.MessageSourceSupport
Create a MessageFormat for the given message and Locale.
createMessageForNoExceptionThrown() - Method in class org.springframework.test.AssertThrows
Deprecated. Creates the failure message used if the test fails (i.e.
createMessageForSerializable(Serializable, Session) - Method in class org.springframework.jms.support.converter.SimpleMessageConverter
Create a JMS ObjectMessage for the given Serializable object.
createMessageForString(String, Session) - Method in class org.springframework.jms.support.converter.SimpleMessageConverter
Create a JMS TextMessage for the given String.
createMessageForWrongThrownExceptionType(Exception) - Method in class org.springframework.test.AssertThrows
Deprecated. Creates the failure message used if the wrong type of Exception is thrown in the body of the test.
createMessageSource(String) - Method in class org.springframework.ui.context.support.ResourceBundleThemeSource
Create a MessageSource for the given basename, to be used as MessageSource for the corresponding theme.
createMetaDataProvider(DataSource, CallMetaDataContext) - Static method in class org.springframework.jdbc.core.metadata.CallMetaDataProviderFactory
Create a CallMetaDataProvider based on the database metedata
createMetaDataProvider(DataSource, TableMetaDataContext) - Static method in class org.springframework.jdbc.core.metadata.TableMetaDataProviderFactory
Create a TableMetaDataProvider based on the database metedata
createMimeMessage() - Method in interface org.springframework.mail.javamail.JavaMailSender
Create a new JavaMail MimeMessage for the underlying JavaMail Session of this sender.
createMimeMessage(InputStream) - Method in interface org.springframework.mail.javamail.JavaMailSender
Create a new JavaMail MimeMessage for the underlying JavaMail Session of this sender, using the given input stream as the message source.
createMimeMessage() - Method in class org.springframework.mail.javamail.JavaMailSenderImpl
This implementation creates a SmartMimeMessage, holding the specified default encoding and default FileTypeMap.
createMimeMessage(InputStream) - Method in class org.springframework.mail.javamail.JavaMailSenderImpl

createMimeMultiparts(MimeMessage, int) - Method in class org.springframework.mail.javamail.MimeMessageHelper
Determine the MimeMultipart objects to use, which will be used to store attachments on the one hand and text(s) and inline elements on the other hand.
createModelMBean() - Method in class org.springframework.jmx.export.MBeanExporter
Create an instance of a class that implements ModelMBean.
createModelMBeanOperationInfo(Method, String, String) - Method in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Creates an instance of ModelMBeanOperationInfo for the given method.
createNativeEntityManagerFactory() - Method in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
Subclasses must implement this method to create the EntityManagerFactory that will be returned by the getObject() method.
createNativeEntityManagerFactory() - Method in class org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean

createNativeEntityManagerFactory() - Method in class org.springframework.orm.jpa.LocalEntityManagerFactoryBean
Initialize the EntityManagerFactory for the given configuration.
createObject() - Method in class org.springframework.aop.target.AbstractLazyCreationTargetSource
Subclasses should implement this method to return the lazy initialized object.
createObjectInputStream(InputStream, String) - Method in class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
Create an ObjectInputStream for the given InputStream and codebase.
createObjectInputStream(InputStream) - Method in class org.springframework.remoting.rmi.RemoteInvocationSerializingExporter
Create an ObjectInputStream for the given InputStream.
createObjectOutputStream(OutputStream) - Method in class org.springframework.remoting.rmi.RemoteInvocationSerializingExporter
Create an ObjectOutputStream for the given OutputStream.
createObjectPool() - Method in class org.springframework.aop.target.CommonsPoolTargetSource
Subclasses can override this if they want to return a specific Commons pool.
createOptimalAccessor(EvaluationContext, Object, String) - Method in class org.springframework.expression.spel.support.ReflectivePropertyAccessor
Attempt to create an optimized property accessor tailored for a property of a particular name on a particular class.
createParameterNameDiscoverer() - Method in class org.springframework.aop.aspectj.AbstractAspectJAdvice
Create a ParameterNameDiscoverer to be used for argument binding.
createPersistenceManagerProxy(PersistenceManager) - Method in class org.springframework.orm.jdo.JdoTemplate
Create a close-suppressing proxy for the given JDO PersistenceManager.
createPointcut() - Method in class org.springframework.aop.support.RegexpMethodPointcutAdvisor
Create the actual pointcut: By default, a JdkRegexpMethodPointcut will be used.
createPointcutExpression(Method, Class, String[]) - Method in class org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory
The pointcut and advice annotations both have an "argNames" member which contains a comma-separated list of the argument names.
createPool() - Method in class org.springframework.aop.target.AbstractPoolingTargetSource
Create the pool.
createPool() - Method in class org.springframework.aop.target.CommonsPoolTargetSource
Creates and holds an ObjectPool instance.
createPortletApplicationContext(ApplicationContext) - Method in class org.springframework.web.portlet.FrameworkPortlet
Instantiate the Portlet ApplicationContext for this portlet, either a default XmlPortletApplicationContext or a custom context class if set.
createPostMethod(HttpInvokerClientConfiguration) - Method in class org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor
Create a PostMethod for the given configuration.
createPreparedStatement(Connection) - Method in interface org.springframework.jdbc.core.PreparedStatementCreator
Create a statement in this connection.
createProducer(Session, Destination) - Method in class org.springframework.jms.core.JmsTemplate
Create a JMS MessageProducer for the given Session and Destination, configuring it to disable message ids and/or timestamps (if necessary).
createProxy(Class<?>, String, Object[], TargetSource) - Method in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
Create an AOP proxy for the given bean.
createQueryString(List<Param>, Set<String>, boolean) - Method in class org.springframework.web.servlet.tags.UrlTag
Build the query string from available parameters that have not already been applied as template params.
createQueue(int) - Method in class org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor
Create the BlockingQueue to use for the ThreadPoolExecutor.
createQueue(int) - Method in class org.springframework.scheduling.concurrent.ThreadPoolExecutorFactoryBean
Create the BlockingQueue to use for the ThreadPoolExecutor.
createQueue(int) - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
Create the BlockingQueue to use for the ThreadPoolExecutor.
createQueueConnection() - Method in class org.springframework.jms.connection.DelegatingConnectionFactory

createQueueConnection(String, String) - Method in class org.springframework.jms.connection.DelegatingConnectionFactory

createQueueConnection() - Method in class org.springframework.jms.connection.SingleConnectionFactory

createQueueConnection(String, String) - Method in class org.springframework.jms.connection.SingleConnectionFactory

createQueueConnection() - Method in class org.springframework.jms.connection.TransactionAwareConnectionFactoryProxy

createQueueConnection(String, String) - Method in class org.springframework.jms.connection.TransactionAwareConnectionFactoryProxy

createQueueConnection() - Method in class org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter
Determine whether there are currently thread-bound credentials, using them if available, falling back to the statically specified username and password (i.e.
createQueueConnection(String, String) - Method in class org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter
Delegate the call straight to the target QueueConnectionFactory.
createReaderContext(Resource) - Method in class org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Create the XmlReaderContext to pass over to the document reader.
createRecord(RecordCreator) - Method in class org.springframework.jca.cci.core.CciTemplate
Invoke the given RecordCreator, converting JCA ResourceExceptions to Spring's DataAccessException hierarchy.
createRecord(RecordFactory) - Method in interface org.springframework.jca.cci.core.RecordCreator
Create a CCI Record instance, usually based on the passed-in CCI RecordFactory.
createRecord(RecordFactory) - Method in class org.springframework.jca.cci.object.MappingRecordOperation.RecordCreatorImpl

createRefreshableProxy(TargetSource, Class[]) - Method in class org.springframework.scripting.support.ScriptFactoryPostProcessor
Create a refreshable proxy for the given AOP TargetSource.
createRelative(String) - Method in class org.springframework.core.io.AbstractResource
This implementation throws a FileNotFoundException, assuming that relative resources cannot be created for this resource.
createRelative(String) - Method in class org.springframework.core.io.ClassPathResource
This implementation creates a ClassPathResource, applying the given path relative to the path of the underlying resource of this descriptor.
createRelative(String) - Method in class org.springframework.core.io.FileSystemResource
This implementation creates a FileSystemResource, applying the given path relative to the path of the underlying file of this resource descriptor.
createRelative(String) - Method in interface org.springframework.core.io.Resource
Create a resource relative to this resource.
createRelative(String) - Method in class org.springframework.core.io.UrlResource
This implementation creates a UrlResource, applying the given path relative to the path of the underlying URL of this resource descriptor.
createRelative(String) - Method in class org.springframework.core.io.VfsResource

createRelative(String) - Method in class org.springframework.web.context.support.ServletContextResource
This implementation creates a ServletContextResource, applying the given path relative to the path of the underlying file of this resource descriptor.
createRelative(String) - Method in class org.springframework.web.portlet.context.PortletContextResource

createRemoteInvocation(MethodInvocation) - Method in class org.springframework.jms.remoting.JmsInvokerClientInterceptor
Create a new RemoteInvocation object for the given AOP method invocation.
createRemoteInvocation(MethodInvocation) - Method in class org.springframework.remoting.rmi.JndiRmiClientInterceptor
Create a new RemoteInvocation object for the given AOP method invocation.
createRemoteInvocation(MethodInvocation) - Method in class org.springframework.remoting.support.DefaultRemoteInvocationFactory

createRemoteInvocation(MethodInvocation) - Method in class org.springframework.remoting.support.RemoteInvocationBasedAccessor
Create a new RemoteInvocation object for the given AOP method invocation.
createRemoteInvocation(MethodInvocation) - Method in interface org.springframework.remoting.support.RemoteInvocationFactory
Create a serializable RemoteInvocation object from the given AOP MethodInvocation.
createRenderURL() - Method in class org.springframework.mock.web.portlet.MockMimeResponse

createReport(JRDataSourceProvider) - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
Create a report using the given provider.
createRequest(URI, HttpMethod) - Method in interface org.springframework.http.client.ClientHttpRequestFactory
Create a new ClientHttpRequest for the specified URI and HTTP method.
createRequest(URI, HttpMethod) - Method in class org.springframework.http.client.CommonsClientHttpRequestFactory

createRequest(URI, HttpMethod) - Method in class org.springframework.http.client.SimpleClientHttpRequestFactory

createRequest(URI, HttpMethod) - Method in class org.springframework.http.client.support.HttpAccessor
Create a new ClientHttpRequest via this template's ClientHttpRequestFactory.
createRequestContext(HttpServletRequest, HttpServletResponse, Map<String, Object>) - Method in class org.springframework.web.servlet.view.AbstractView
Create a RequestContext to expose under the specified attribute name.
createRequestMessage(Session, RemoteInvocation) - Method in class org.springframework.jms.remoting.JmsInvokerClientInterceptor
Create the invoker request message.
createResourceURL() - Method in class org.springframework.mock.web.portlet.MockMimeResponse

createResponseMessage(Message, Session, RemoteInvocationResult) - Method in class org.springframework.jms.remoting.JmsInvokerServiceExporter
Create the invocation result response message.
createResult(HttpServletResponse) - Method in class org.springframework.web.servlet.view.xslt.XsltView
Create the XSLT Result used to render the result of the transformation.
createResultsMap() - Method in class org.springframework.jdbc.core.JdbcTemplate
Create a Map instance to be used as results map.
createReturnResultSetParameter(String, RowMapper) - Method in class org.springframework.jdbc.core.metadata.CallMetaDataContext
Create a ReturnResultSetParameter/SqlOutParameter depending on the support provided by the JDBC driver used for the database in use.
createSavepoint() - Method in class org.springframework.jdbc.datasource.ConnectionHolder
Create a new JDBC 3.0 Savepoint for the current Connection, using generated savepoint names that are unique for the Connection.
createSavepoint() - Method in class org.springframework.jdbc.datasource.JdbcTransactionObjectSupport
This implementation creates a JDBC 3.0 Savepoint and returns it.
createSavepoint() - Method in interface org.springframework.transaction.SavepointManager
Create a new savepoint.
createSavepoint() - Method in class org.springframework.transaction.support.AbstractTransactionStatus
This implementation delegates to a SavepointManager for the underlying transaction, if possible.
createScanner(XmlReaderContext, boolean) - Method in class org.springframework.context.annotation.ComponentScanBeanDefinitionParser

createScheduler(SchedulerFactory, String) - Method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
Create the Scheduler instance for the given factory and scheduler name.
createScopedProxy(BeanDefinitionHolder, BeanDefinitionRegistry, boolean) - Static method in class org.springframework.aop.scope.ScopedProxyUtils
Generates a scoped proxy for the supplied target bean, registering the target bean with an internal name and setting 'targetBeanName' on the scoped proxy.
createScriptedObjectBeanDefinition(BeanDefinition, String, ScriptSource, Class[]) - Method in class org.springframework.scripting.support.ScriptFactoryPostProcessor
Create a bean definition for the scripted object, based on the given script definition, extracting the definition data that is relevant for the scripted object (that is, everything but bean class and constructor arguments).
createScriptFactoryBeanDefinition(BeanDefinition) - Method in class org.springframework.scripting.support.ScriptFactoryPostProcessor
Create a ScriptFactory bean definition based on the given script definition, extracting only the definition data that is relevant for the ScriptFactory (that is, only bean class and constructor arguments).
createServerSpecificLoadTimeWeaver(ClassLoader) - Method in class org.springframework.context.weaving.DefaultContextLoadTimeWeaver

createService(ServiceFactory) - Method in class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
Deprecated. Actually create the JAX-RPC Service instance, based on this factory's settings.
createServiceFactory() - Method in class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
Deprecated. Create a JAX-RPC ServiceFactory, either of the specified class or the default.
createServiceLocatorException(Constructor, BeansException) - Method in class org.springframework.beans.factory.config.ServiceLocatorFactoryBean
Create a service locator exception for the given cause.
createSession(Connection) - Method in interface org.springframework.jms.connection.ConnectionFactoryUtils.ResourceFactory
Create a new JMS Session for registration with a JmsResourceHolder.
createSession(Connection) - Method in class org.springframework.jms.connection.JmsTransactionManager
Create a JMS Session for the given Connection.
createSession(Connection) - Method in class org.springframework.jms.connection.JmsTransactionManager102
Deprecated. This implementation overrides the superclass method to use JMS 1.0.2 API.
createSession(Connection, Integer) - Method in class org.springframework.jms.connection.SingleConnectionFactory
Create a default Session for this ConnectionFactory, adaptign to JMS 1.0.2 style queue/topic mode if necessary.
createSession(Connection) - Method in class org.springframework.jms.core.JmsTemplate102
Deprecated. This implementation overrides the superclass method to use JMS 1.0.2 API.
createSession(Connection) - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer102
Deprecated. This implementation overrides the superclass method to use JMS 1.0.2 API.
createSession(Connection) - Method in class org.springframework.jms.listener.SimpleMessageListenerContainer102
Deprecated. This implementation overrides the superclass method to use JMS 1.0.2 API.
createSession(Connection) - Method in class org.springframework.jms.remoting.JmsInvokerClientInterceptor
Create a new JMS Session for this JMS invoker, ideally a javax.jms.QueueSession.
createSession(Connection) - Method in class org.springframework.jms.support.JmsAccessor
Create a JMS Session for the given Connection.
createSessionProxy(Session) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
Create a close-suppressing proxy for the given Hibernate Session.
createShadowingClassLoader(ClassLoader) - Method in class org.springframework.test.jpa.AbstractJpaTests
Deprecated. NB: This method must not have a return type of ShadowingClassLoader as that would cause that class to be loaded eagerly when this test case loads, creating verify errors at runtime.
createSharedConnection() - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Create a shared Connection for this container.
createSharedEntityManager(EntityManagerFactory) - Static method in class org.springframework.orm.jpa.SharedEntityManagerCreator
Create a transactional EntityManager proxy for the given EntityManagerFactory.
createSharedEntityManager(EntityManagerFactory, Map) - Static method in class org.springframework.orm.jpa.SharedEntityManagerCreator
Create a transactional EntityManager proxy for the given EntityManagerFactory.
createSharedEntityManager(EntityManagerFactory, Map, Class...) - Static method in class org.springframework.orm.jpa.SharedEntityManagerCreator
Create a transactional EntityManager proxy for the given EntityManagerFactory.
createSqlRowSet(ResultSet) - Method in class org.springframework.jdbc.core.SqlRowSetResultSetExtractor
Create a SqlRowSet that wraps the given ResultSet, representing its data in a disconnected fashion.
createStaxResult(XMLStreamWriter) - Static method in class org.springframework.util.xml.StaxUtils
Create a StAX Result for the given XMLStreamWriter.
createStaxResult(XMLEventWriter) - Static method in class org.springframework.util.xml.StaxUtils
Create a StAX Result for the given XMLEventWriter.
createStaxSource(XMLStreamReader) - Static method in class org.springframework.util.xml.StaxUtils
Create a StAX Source for the given XMLStreamReader.
createStaxSource(XMLEventReader) - Static method in class org.springframework.util.xml.StaxUtils
Create a StAX Source for the given XMLEventReader.
createSubcontext(String) - Method in class org.springframework.mock.jndi.SimpleNamingContext

createSubcontext(Name) - Method in class org.springframework.mock.jndi.SimpleNamingContext

createTagWriter() - Method in class org.springframework.web.servlet.tags.form.AbstractFormTag
Create the TagWriter which all output will be written to.
createTargetSource(Object) - Method in class org.springframework.aop.framework.AbstractSingletonProxyFactoryBean
Determine a TargetSource for the given target (or TargetSource).
createTemporaryOutputStream() - Method in class org.springframework.web.servlet.view.AbstractView
Create a temporary OutputStream for this view.
createTest() - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
Delegates to the parent implementation for creating the test instance and then allows the TestContextManager to prepare the test instance before returning it.
createTestContextManager(Class<?>) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
Creates a new TestContextManager for the supplied test class and the configured default ContextLoader class name.
createThread(Runnable) - Method in class org.springframework.util.CustomizableThreadCreator
Template method for the creation of a Thread.
createTilesInitializer() - Method in class org.springframework.web.servlet.view.tiles2.TilesConfigurer
Creates a new instance of BasicTilesInitializer.
createTimer() - Method in class org.springframework.jca.support.SimpleBootstrapContext

createTimer(String, boolean) - Method in class org.springframework.scheduling.timer.TimerFactoryBean
Deprecated. Create a new Timer instance.
createTimer() - Method in class org.springframework.scheduling.timer.TimerTaskExecutor
Deprecated. Create a new Timer instance.
createTopicConnection() - Method in class org.springframework.jms.connection.DelegatingConnectionFactory

createTopicConnection(String, String) - Method in class org.springframework.jms.connection.DelegatingConnectionFactory

createTopicConnection() - Method in class org.springframework.jms.connection.SingleConnectionFactory

createTopicConnection(String, String) - Method in class org.springframework.jms.connection.SingleConnectionFactory

createTopicConnection() - Method in class org.springframework.jms.connection.TransactionAwareConnectionFactoryProxy

createTopicConnection(String, String) - Method in class org.springframework.jms.connection.TransactionAwareConnectionFactoryProxy

createTopicConnection() - Method in class org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter
Determine whether there are currently thread-bound credentials, using them if available, falling back to the statically specified username and password (i.e.
createTopicConnection(String, String) - Method in class org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter
Delegate the call straight to the target TopicConnectionFactory.
createTransaction(JDBCContext, TransactionFactory.Context) - Method in class org.springframework.orm.hibernate3.SpringTransactionFactory

createTransaction(String, int) - Method in class org.springframework.transaction.jta.JtaTransactionManager

createTransaction(String, int) - Method in class org.springframework.transaction.jta.OC4JJtaTransactionManager

createTransaction(String, int) - Method in class org.springframework.transaction.jta.SimpleTransactionFactory

createTransaction(String, int) - Method in interface org.springframework.transaction.jta.TransactionFactory
Create an active Transaction object based on the given name and timeout.
createTransaction(String, int) - Method in class org.springframework.transaction.jta.WebLogicJtaTransactionManager

createTransactionIfNecessary(Method, Class) - Method in class org.springframework.transaction.interceptor.TransactionAspectSupport
Create a transaction if necessary, based on the given method and class.
createTransactionIfNecessary(PlatformTransactionManager, TransactionAttribute, String) - Method in class org.springframework.transaction.interceptor.TransactionAspectSupport
Create a transaction if necessary based on the given TransactionAttribute.
createTransformer(Templates) - Method in class org.springframework.web.servlet.view.xslt.XsltView
Create the Transformer instance used to prefer the XSLT transformation.
createTypeFilter(Element, ClassLoader) - Method in class org.springframework.context.annotation.ComponentScanBeanDefinitionParser

createTypeValue(Connection, int, String) - Method in class org.springframework.jdbc.core.support.AbstractSqlTypeValue
Create the type value to be passed into PreparedStatement.setObject.
createUnmarshaller(Class) - Method in class org.springframework.http.converter.xml.AbstractJaxb2HttpMessageConverter
Creates a new Unmarshaller for the given class.
createUnmarshaller() - Method in class org.springframework.oxm.jaxb.Jaxb2Marshaller
Return a newly created JAXB unmarshaller.
createUnmarshallingContext() - Method in class org.springframework.oxm.jibx.JibxMarshaller
Create a new IUnmarshallingContext.
createURI(String) - Method in class org.springframework.beans.propertyeditors.URIEditor
Create a URI instance for the given (resolved) String value.
createVelocityContext(Map<String, Object>, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.velocity.VelocityToolboxView
Overridden to create a ChainedContext, which is part of the view package of Velocity Tools, as special context.
createVelocityContext(Map<String, Object>, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.velocity.VelocityView
Create a Velocity Context instance for the given model, to be passed to the template for merging.
createVelocityContext(Map<String, Object>) - Method in class org.springframework.web.servlet.view.velocity.VelocityView
Create a Velocity Context instance for the given model, to be passed to the template for merging.
createVelocityEngine() - Method in class org.springframework.ui.velocity.VelocityEngineFactory
Prepare the VelocityEngine instance and return it.
createView(String, Locale) - Method in class org.springframework.web.servlet.view.AbstractCachingViewResolver
Create the actual View object.
createView(String, Locale) - Method in class org.springframework.web.servlet.view.UrlBasedViewResolver
Overridden to implement check for "redirect:" prefix.
createWebApplicationContext(ServletContext, ApplicationContext) - Method in class org.springframework.web.context.ContextLoader
Instantiate the root WebApplicationContext for this loader, either the default context class or a custom context class if specified.
createWebApplicationContext(ApplicationContext) - Method in class org.springframework.web.servlet.FrameworkServlet
Instantiate the WebApplicationContext for this servlet, either a default XmlWebApplicationContext or a custom context class, if set.
createWebApplicationContext(WebApplicationContext) - Method in class org.springframework.web.servlet.FrameworkServlet
Instantiate the WebApplicationContext for this servlet, either a default XmlWebApplicationContext or a custom context class, if set.
createWebApplicationContext(WebApplicationContext) - Method in class org.springframework.web.struts.ContextLoaderPlugIn
Deprecated. Instantiate the WebApplicationContext for the ActionServlet, either a default XmlWebApplicationContext or a custom context class if set.
createXMLContext(Resource[], Class[], String[]) - Method in class org.springframework.oxm.castor.CastorMarshaller
Create the Castor XMLContext.
createXmlReader() - Method in class org.springframework.oxm.support.AbstractMarshaller
Create a XMLReader that this marshaller will when passed an empty SAXSource.
createXMLReader(XMLStreamReader) - Static method in class org.springframework.util.xml.StaxUtils
Create a SAX XMLReader that reads from the given StAX XMLStreamReader.
createXMLReader(XMLEventReader) - Static method in class org.springframework.util.xml.StaxUtils
Create a SAX XMLReader that reads from the given StAX XMLEventReader.
createXsltSource(Map<String, Object>, String, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.xslt.AbstractXsltView
Deprecated. Return the XML Source to transform.
CronSequenceGenerator - Class in org.springframework.scheduling.support
Date sequence generator for a Crontab pattern, allowing clients to specify a pattern that the sequence matches.
CronSequenceGenerator(String, TimeZone) - Constructor for class org.springframework.scheduling.support.CronSequenceGenerator
Construct a CronSequenceGenerator from the pattern provided.
CronTrigger - Class in org.springframework.scheduling.support
Trigger implementation for cron expressions.
CronTrigger(String, TimeZone) - Constructor for class org.springframework.scheduling.support.CronTrigger
Build a CronTrigger from the pattern provided.
CronTrigger(String) - Constructor for class org.springframework.scheduling.support.CronTrigger
Build a CronTrigger from the pattern provided in the default time zone.
CronTriggerBean - Class in org.springframework.scheduling.quartz
Convenience subclass of Quartz's CronTrigger class, making bean-style usage easier.
CronTriggerBean() - Constructor for class org.springframework.scheduling.quartz.CronTriggerBean

CurrencyEditor - Class in org.springframework.beans.propertyeditors
Editor for java.util.Currency, translating currency codes into Currency objects.
CurrencyEditor() - Constructor for class org.springframework.beans.propertyeditors.CurrencyEditor

CurrencyFormatter - Class in org.springframework.format.number
A BigDecimal formatter for currency values.
CurrencyFormatter() - Constructor for class org.springframework.format.number.CurrencyFormatter

currentFormObject(HttpServletRequest, Object) - Method in class org.springframework.web.servlet.mvc.AbstractFormController
Deprecated. Return the current form object to use for binding and further processing, based on the passed-in form object as found in the HttpSession.
currentInvocation() - Static method in class org.springframework.aop.interceptor.ExposeInvocationInterceptor
Return the AOP Alliance MethodInvocation object associated with the current invocation.
currentJoinPoint() - Static method in class org.springframework.aop.aspectj.AbstractAspectJAdvice
Lazily instantiate joinpoint for the current invocation.
currentProxy() - Static method in class org.springframework.aop.framework.AopContext
Try to return the current AOP proxy.
currentRequestAttributes() - Static method in class org.springframework.web.context.request.RequestContextHolder
Return the RequestAttributes currently bound to the thread.
currentSession() - Method in class org.springframework.orm.hibernate3.SpringSessionContext
Retrieve the Spring-managed Session for the current thread, if any.
currentTransactionInfo() - Static method in class org.springframework.transaction.interceptor.TransactionAspectSupport
Subclasses can use this to return the current TransactionInfo.
currentTransactionStatus() - Static method in class org.springframework.transaction.interceptor.TransactionAspectSupport
Return the transaction status of the current method invocation.
CustomAutowireConfigurer - Class in org.springframework.beans.factory.annotation
A BeanFactoryPostProcessor implementation that allows for convenient registration of custom autowire qualifier types.
CustomAutowireConfigurer() - Constructor for class org.springframework.beans.factory.annotation.CustomAutowireConfigurer

CustomBooleanEditor - Class in org.springframework.beans.propertyeditors
Property editor for Boolean/boolean properties.
CustomBooleanEditor(boolean) - Constructor for class org.springframework.beans.propertyeditors.CustomBooleanEditor
Create a new CustomBooleanEditor instance, with "true"/"on"/"yes" and "false"/"off"/"no" as recognized String values.
CustomBooleanEditor(String, String, boolean) - Constructor for class org.springframework.beans.propertyeditors.CustomBooleanEditor
Create a new CustomBooleanEditor instance, with configurable String values for true and false.
CustomCollectionEditor - Class in org.springframework.beans.propertyeditors
Property editor for Collections, converting any source Collection to a given target Collection type.
CustomCollectionEditor(Class) - Constructor for class org.springframework.beans.propertyeditors.CustomCollectionEditor
Create a new CustomCollectionEditor for the given target type, keeping an incoming null as-is.
CustomCollectionEditor(Class, boolean) - Constructor for class org.springframework.beans.propertyeditors.CustomCollectionEditor
Create a new CustomCollectionEditor for the given target type.
CustomDateEditor - Class in org.springframework.beans.propertyeditors
Property editor for java.util.Date, supporting a custom java.text.DateFormat.
CustomDateEditor(DateFormat, boolean) - Constructor for class org.springframework.beans.propertyeditors.CustomDateEditor
Create a new CustomDateEditor instance, using the given DateFormat for parsing and rendering.
CustomDateEditor(DateFormat, boolean, int) - Constructor for class org.springframework.beans.propertyeditors.CustomDateEditor
Create a new CustomDateEditor instance, using the given DateFormat for parsing and rendering.
CustomEditorConfigurer - Class in org.springframework.beans.factory.config
BeanFactoryPostProcessor implementation that allows for convenient registration of custom property editors.
CustomEditorConfigurer() - Constructor for class org.springframework.beans.factory.config.CustomEditorConfigurer

CustomizableThreadCreator - Class in org.springframework.util
Simple customizable helper class for creating threads.
CustomizableThreadCreator() - Constructor for class org.springframework.util.CustomizableThreadCreator
Create a new CustomizableThreadCreator with default thread name prefix.
CustomizableThreadCreator(String) - Constructor for class org.springframework.util.CustomizableThreadCreator
Create a new CustomizableThreadCreator with the given thread name prefix.
CustomizableThreadFactory - Class in org.springframework.scheduling.backportconcurrent
Implementation of the JSR-166 backport ThreadFactory interface, allowing for customizing the created threads (name, priority, etc).
CustomizableThreadFactory() - Constructor for class org.springframework.scheduling.backportconcurrent.CustomizableThreadFactory
Create a new CustomizableThreadFactory with default thread name prefix.
CustomizableThreadFactory(String) - Constructor for class org.springframework.scheduling.backportconcurrent.CustomizableThreadFactory
Create a new CustomizableThreadFactory with the given thread name prefix.
CustomizableThreadFactory - Class in org.springframework.scheduling.concurrent
Implementation of the JDK 1.5 ThreadFactory interface, allowing for customizing the created threads (name, priority, etc).
CustomizableThreadFactory() - Constructor for class org.springframework.scheduling.concurrent.CustomizableThreadFactory
Create a new CustomizableThreadFactory with default thread name prefix.
CustomizableThreadFactory(String) - Constructor for class org.springframework.scheduling.concurrent.CustomizableThreadFactory
Create a new CustomizableThreadFactory with the given thread name prefix.
CustomizableTraceInterceptor - Class in org.springframework.aop.interceptor
MethodInterceptor implementation that allows for highly customizable method-level tracing, using placeholders.
CustomizableTraceInterceptor() - Constructor for class org.springframework.aop.interceptor.CustomizableTraceInterceptor

customize(GroovyObject) - Method in interface org.springframework.scripting.groovy.GroovyObjectCustomizer
Customize the supplied GroovyObject.
customizeBeanFactory(DefaultListableBeanFactory) - Method in class org.springframework.context.support.AbstractRefreshableApplicationContext
Customize the internal bean factory used by this context.
customizeBeanFactory(DefaultListableBeanFactory) - Method in class org.springframework.test.AbstractSingleSpringContextTests
Deprecated. Customize the internal bean factory of the ApplicationContext used by this test.
customizeBeanFactory(DefaultListableBeanFactory) - Method in class org.springframework.test.context.support.AbstractGenericContextLoader
Customize the internal bean factory of the ApplicationContext created by this ContextLoader.
customizeContext(GenericApplicationContext) - Method in class org.springframework.test.context.support.AbstractGenericContextLoader
Customize the GenericApplicationContext created by this ContextLoader after bean definitions have been loaded into the context but before the context is refreshed.
customizeContext(ServletContext, ConfigurableWebApplicationContext) - Method in class org.springframework.web.context.ContextLoader
Customize the ConfigurableWebApplicationContext created by this ContextLoader after config locations have been supplied to the context but before the context is refreshed.
customizeEvaluationContext(StandardEvaluationContext) - Method in class org.springframework.context.expression.StandardBeanExpressionResolver
Template method for customizing the expression evaluation context.
customizeMarshaller(Marshaller) - Method in class org.springframework.oxm.castor.CastorMarshaller
Template method that allows for customizing of the given Castor Marshaller.
customizeProxyFactory(ProxyFactory) - Method in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
Subclasses may choose to implement this: for example, to change the interfaces exposed.
customizeResourceOverridingShadowingClassLoader(ClassLoader) - Method in class org.springframework.test.jpa.AbstractAspectjJpaTests
Deprecated.
customizeResourceOverridingShadowingClassLoader(ClassLoader) - Method in class org.springframework.test.jpa.AbstractJpaTests
Deprecated. Customize the shadowing class loader.
customizeUnmarshaller(Unmarshaller) - Method in class org.springframework.oxm.castor.CastorMarshaller
Template method that allows for customizing of the given Castor Unmarshaller.
customizeXStream(XStream) - Method in class org.springframework.oxm.xstream.XStreamMarshaller
Template to allow for customizing of the given XStream.
CustomMapEditor - Class in org.springframework.beans.propertyeditors
Property editor for Maps, converting any source Map to a given target Map type.
CustomMapEditor(Class) - Constructor for class org.springframework.beans.propertyeditors.CustomMapEditor
Create a new CustomMapEditor for the given target type, keeping an incoming null as-is.
CustomMapEditor(Class, boolean) - Constructor for class org.springframework.beans.propertyeditors.CustomMapEditor
Create a new CustomMapEditor for the given target type.
CustomNumberEditor - Class in org.springframework.beans.propertyeditors
Property editor for any Number subclass such as Short, Integer, Long, BigInteger, Float, Double, BigDecimal.
CustomNumberEditor(Class, boolean) - Constructor for class org.springframework.beans.propertyeditors.CustomNumberEditor
Create a new CustomNumberEditor instance, using the default valueOf methods for parsing and toString methods for rendering.
CustomNumberEditor(Class, NumberFormat, boolean) - Constructor for class org.springframework.beans.propertyeditors.CustomNumberEditor
Create a new CustomNumberEditor instance, using the given NumberFormat for parsing and rendering.
CustomScopeConfigurer - Class in org.springframework.beans.factory.config
Simple BeanFactoryPostProcessor implementation that registers custom Scope(s) with the containing ConfigurableBeanFactory.
CustomScopeConfigurer() - Constructor for class org.springframework.beans.factory.config.CustomScopeConfigurer

CustomSQLErrorCodesTranslation - Class in org.springframework.jdbc.support
JavaBean for holding custom JDBC error codes translation for a particular database.
CustomSQLErrorCodesTranslation() - Constructor for class org.springframework.jdbc.support.CustomSQLErrorCodesTranslation

customTranslate(String, String, SQLException) - Method in class org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator
Subclasses can override this method to attempt a custom mapping from SQLException to DataAccessException.
CustomValidatorBean - Class in org.springframework.validation.beanvalidation
Configurable bean class that exposes a specific JSR-303 Validator through its original interface as well as through the Spring Validator interface.
CustomValidatorBean() - Constructor for class org.springframework.validation.beanvalidation.CustomValidatorBean

Overview  Package  Class  Tree  Deprecated   Index  Help
A B C D E F G H I J K L M N O P Q R S T U V W X


D-Index

PREV LETTER NEXT LETTER FRAMES NO FRAMES
A B C D E F G H I J K L M N O P Q R S T U V W X

D

DaoSupport - Class in org.springframework.dao.support
Generic base class for DAOs, defining template methods for DAO initialization.
DaoSupport() - Constructor for class org.springframework.dao.support.DaoSupport
DataAccessException - Exception in org.springframework.dao
Root of the hierarchy of data access exceptions discussed in Expert One-On-One J2EE Design and Development.
DataAccessException(String) - Constructor for exception org.springframework.dao.DataAccessException
Constructor for DataAccessException.
DataAccessException(String, Throwable) - Constructor for exception org.springframework.dao.DataAccessException
Constructor for DataAccessException.
DataAccessResourceFailureException - Exception in org.springframework.dao
Data access exception thrown when a resource fails completely: for example, if we can't connect to a database using JDBC.
DataAccessResourceFailureException(String) - Constructor for exception org.springframework.dao.DataAccessResourceFailureException
Constructor for DataAccessResourceFailureException.
DataAccessResourceFailureException(String, Throwable) - Constructor for exception org.springframework.dao.DataAccessResourceFailureException
Constructor for DataAccessResourceFailureException.
DataAccessUtils - Class in org.springframework.dao.support
Miscellaneous utility methods for DAO implementations.
DataAccessUtils() - Constructor for class org.springframework.dao.support.DataAccessUtils
Database - Enum in org.springframework.orm.jpa.vendor
Enumeration for common database platforms.
DatabaseMetaDataCallback - Interface in org.springframework.jdbc.support
A callback interface used by the JdbcUtils class.
DatabasePopulator - Interface in org.springframework.jdbc.datasource.init
Strategy used to populate a database during initialization.
DatabaseStartupValidator - Class in org.springframework.jdbc.support
Bean that checks if a database has already started up.
DatabaseStartupValidator() - Constructor for class org.springframework.jdbc.support.DatabaseStartupValidator
DataBinder - Class in org.springframework.validation
Binder that allows for setting property values onto a target object, including support for validation and binding result analysis.
DataBinder(Object) - Constructor for class org.springframework.validation.DataBinder
Create a new DataBinder instance, with default object name.
DataBinder(Object, String) - Constructor for class org.springframework.validation.DataBinder
Create a new DataBinder instance.
DataFieldMaxValueIncrementer - Interface in org.springframework.jdbc.support.incrementer
Interface that defines contract of incrementing any data store field's maximum value.
DataIntegrityViolationException - Exception in org.springframework.dao
Exception thrown when an attempt to insert or update data results in violation of an integrity constraint.
DataIntegrityViolationException(String) - Constructor for exception org.springframework.dao.DataIntegrityViolationException
Constructor for DataIntegrityViolationException.
DataIntegrityViolationException(String, Throwable) - Constructor for exception org.springframework.dao.DataIntegrityViolationException
Constructor for DataIntegrityViolationException.
DataRetrievalFailureException - Exception in org.springframework.dao
Exception thrown if certain expected data could not be retrieved, e.g.
DataRetrievalFailureException(String) - Constructor for exception org.springframework.dao.DataRetrievalFailureException
Constructor for DataRetrievalFailureException.
DataRetrievalFailureException(String, Throwable) - Constructor for exception org.springframework.dao.DataRetrievalFailureException
Constructor for DataRetrievalFailureException.
DataSourceFactory - Interface in org.springframework.jdbc.datasource.embedded
Encapsulates the creation of a particular DataSource implementation, such as a SimpleDriverDataSource or connection pool such as Apache DBCP or C3P0.
DataSourceInitializer - Class in org.springframework.jdbc.datasource.init
Used to populate a database during initialization.
DataSourceInitializer() - Constructor for class org.springframework.jdbc.datasource.init.DataSourceInitializer
DataSourceLookup - Interface in org.springframework.jdbc.datasource.lookup
Strategy interface for looking up DataSources by name.
DataSourceLookupFailureException - Exception in org.springframework.jdbc.datasource.lookup
Exception to be thrown by a DataSourceLookup implementation, indicating that the specified DataSource could not be obtained.
DataSourceLookupFailureException(String) - Constructor for exception org.springframework.jdbc.datasource.lookup.DataSourceLookupFailureException
Constructor for DataSourceLookupFailureException.
DataSourceLookupFailureException(String, Throwable) - Constructor for exception org.springframework.jdbc.datasource.lookup.DataSourceLookupFailureException
Constructor for DataSourceLookupFailureException.
DataSourceTransactionManager - Class in org.springframework.jdbc.datasource
PlatformTransactionManager implementation for a single JDBC DataSource.
DataSourceTransactionManager() - Constructor for class org.springframework.jdbc.datasource.DataSourceTransactionManager
Create a new DataSourceTransactionManager instance.
DataSourceTransactionManager(DataSource) - Constructor for class org.springframework.jdbc.datasource.DataSourceTransactionManager
Create a new DataSourceTransactionManager instance.
DataSourceUtils - Class in org.springframework.jdbc.datasource
Helper class that provides static methods for obtaining JDBC Connections from a DataSource.
DataSourceUtils() - Constructor for class org.springframework.jdbc.datasource.DataSourceUtils
DateFormatter - Class in org.springframework.format.datetime
A formatter for Date types.
DateFormatter() - Constructor for class org.springframework.format.datetime.DateFormatter
Create a new default DateFormatter.
DateFormatter(String) - Constructor for class org.springframework.format.datetime.DateFormatter
Create a new DateFormatter for the given date pattern.
DateTimeFormat - Annotation Type in org.springframework.format.annotation
Declares that a field should be formatted as a date time.
DateTimeFormat.ISO - Enum in org.springframework.format.annotation
Common ISO date time format patterns.
DateTimeParser - Class in org.springframework.format.datetime.joda
Parses Joda Time DateTime instances using a DateTimeFormatter.
DateTimeParser(DateTimeFormatter) - Constructor for class org.springframework.format.datetime.joda.DateTimeParser
Create a new DateTimeParser.
Db2CallMetaDataProvider - Class in org.springframework.jdbc.core.metadata
DB2 specific implementation for the CallMetaDataProvider interface.
Db2CallMetaDataProvider(DatabaseMetaData) - Constructor for class org.springframework.jdbc.core.metadata.Db2CallMetaDataProvider
DB2MainframeSequenceMaxValueIncrementer - Class in org.springframework.jdbc.support.incrementer
DataFieldMaxValueIncrementer that retrieves the next value of a given sequence on DB2/390 or DB2/400.
DB2MainframeSequenceMaxValueIncrementer() - Constructor for class org.springframework.jdbc.support.incrementer.DB2MainframeSequenceMaxValueIncrementer
Default constructor for bean property style usage.
DB2MainframeSequenceMaxValueIncrementer(DataSource, String) - Constructor for class org.springframework.jdbc.support.incrementer.DB2MainframeSequenceMaxValueIncrementer
Convenience constructor.
DB2SequenceMaxValueIncrementer - Class in org.springframework.jdbc.support.incrementer
DataFieldMaxValueIncrementer that retrieves the next value of a given sequence on DB2 UDB (for Unix and Windows).
DB2SequenceMaxValueIncrementer() - Constructor for class org.springframework.jdbc.support.incrementer.DB2SequenceMaxValueIncrementer
Default constructor for bean property style usage.
DB2SequenceMaxValueIncrementer(DataSource, String) - Constructor for class org.springframework.jdbc.support.incrementer.DB2SequenceMaxValueIncrementer
Convenience constructor.
deactivate() - Method in class org.springframework.mock.jndi.SimpleNamingContextBuilder
Temporarily deactivate this context builder.
DeadlockLoserDataAccessException - Exception in org.springframework.dao
Generic exception thrown when the current process was a deadlock loser, and its transaction rolled back.
DeadlockLoserDataAccessException(String, Throwable) - Constructor for exception org.springframework.dao.DeadlockLoserDataAccessException
Constructor for DeadlockLoserDataAccessException.
DebugInterceptor - Class in org.springframework.aop.interceptor
AOP Alliance MethodInterceptor that can be introduced in a chain to display verbose information about intercepted invocations to the logger.
DebugInterceptor() - Constructor for class org.springframework.aop.interceptor.DebugInterceptor
Create a new DebugInterceptor with a static logger.
DebugInterceptor(boolean) - Constructor for class org.springframework.aop.interceptor.DebugInterceptor
Create a new DebugInterceptor with dynamic or static logger, according to the given flag.
declareParameter(SqlParameter) - Method in class org.springframework.jdbc.object.RdbmsOperation
Declare a parameter for this operation.
declareParameter(SqlParameter) - Method in class org.springframework.jdbc.object.StoredProcedure
Declare a parameter.
declareParameters(SqlParameter...) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcCall
declareParameters(SqlParameter...) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcCallOperations
Specify one or more parameters if desired.
DeclareParentsAdvisor - Class in org.springframework.aop.aspectj
Introduction advisor delegating to the given object.
DeclareParentsAdvisor(Class, String, Class) - Constructor for class org.springframework.aop.aspectj.DeclareParentsAdvisor
Create a new advisor for this DeclareParents field.
DeclareParentsAdvisor(Class, String, Object) - Constructor for class org.springframework.aop.aspectj.DeclareParentsAdvisor
Create a new advisor for this DeclareParents field.
declaresException(Method, Class<?>) - Static method in class org.springframework.util.ReflectionUtils
Determine whether the given method explicitly declares the given exception or one of its superclasses, which means that an exception of that type can be propagated as-is within a reflective invocation.
decode(String, String) - Static method in class org.springframework.web.util.UriUtils
Decodes the given encoded source String into an URI.
decodeRequestString(HttpServletRequest, String) - Method in class org.springframework.web.util.UrlPathHelper
Decode the given source string with a URLDecoder.
decorate(Node, BeanDefinitionHolder, ParserContext) - Method in class org.springframework.aop.config.AbstractInterceptorDrivenBeanDefinitionDecorator
decorate(Node, BeanDefinitionHolder, ParserContext) - Method in interface org.springframework.beans.factory.xml.BeanDefinitionDecorator
Parse the specified Node (either an element or an attribute) and decorate the supplied BeanDefinition, returning the decorated definition.
decorate(Node, BeanDefinitionHolder, ParserContext) - Method in interface org.springframework.beans.factory.xml.NamespaceHandler
Parse the specified Node and decorate the supplied BeanDefinitionHolder, returning the decorated definition.
decorate(Node, BeanDefinitionHolder, ParserContext) - Method in class org.springframework.beans.factory.xml.NamespaceHandlerSupport
Decorates the supplied Node by delegating to the BeanDefinitionDecorator that is registered to handle that Node.
decorate(Node, BeanDefinitionHolder, ParserContext) - Method in class org.springframework.beans.factory.xml.SimplePropertyNamespaceHandler
decorateBeanDefinitionIfRequired(Element, BeanDefinitionHolder) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
decorateBeanDefinitionIfRequired(Element, BeanDefinitionHolder, BeanDefinition) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
decorateCache(Ehcache) - Method in class org.springframework.cache.ehcache.EhCacheFactoryBean
Decorate the given Cache, if necessary.
decorateInputStream(InputStream) - Method in class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
Return the InputStream to use for reading remote invocation results, potentially decorating the given original InputStream.
decorateInputStream(HttpServletRequest, InputStream) - Method in class org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter
Return the InputStream to use for reading remote invocations, potentially decorating the given original InputStream.
decorateInputStream(HttpExchange, InputStream) - Method in class org.springframework.remoting.httpinvoker.SimpleHttpInvokerServiceExporter
Return the InputStream to use for reading remote invocations, potentially decorating the given original InputStream.
decorateOutputStream(OutputStream) - Method in class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
Return the OutputStream to use for writing remote invocations, potentially decorating the given original OutputStream.
decorateOutputStream(HttpServletRequest, HttpServletResponse, OutputStream) - Method in class org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter
Return the OutputStream to use for writing remote invocation results, potentially decorating the given original OutputStream.
decorateOutputStream(HttpExchange, OutputStream) - Method in class org.springframework.remoting.httpinvoker.SimpleHttpInvokerServiceExporter
Return the OutputStream to use for writing remote invocation results, potentially decorating the given original OutputStream.
decorateTaskWithErrorHandler(Runnable, ErrorHandler, boolean) - Static method in class org.springframework.scheduling.support.TaskUtils
Decorates the task for error handling.
DecoratingClassLoader - Class in org.springframework.core
Base class for decorating ClassLoaders such as OverridingClassLoader and ShadowingClassLoader, providing common handling of excluded packages and classes.
DecoratingClassLoader() - Constructor for class org.springframework.core.DecoratingClassLoader
Create a new DecoratingClassLoader with no parent ClassLoader.
DecoratingClassLoader(ClassLoader) - Constructor for class org.springframework.core.DecoratingClassLoader
Create a new DecoratingClassLoader using the given parent ClassLoader for delegation.
DecoratingNavigationHandler - Class in org.springframework.web.jsf
Base class for JSF NavigationHandler implementations that want to be capable of decorating an original NavigationHandler.
DecoratingNavigationHandler() - Constructor for class org.springframework.web.jsf.DecoratingNavigationHandler
Create a DecoratingNavigationHandler without fixed original NavigationHandler.
DecoratingNavigationHandler(NavigationHandler) - Constructor for class org.springframework.web.jsf.DecoratingNavigationHandler
Create a DecoratingNavigationHandler with fixed original NavigationHandler.
decreaseNestingLevel() - Method in class org.springframework.core.MethodParameter
Decrease this parameter's nesting level.
deepCopy(Object) - Method in class org.springframework.orm.hibernate3.support.AbstractLobType
This implementation returns the passed-in value as-is.
deepCopy(Object) - Method in class org.springframework.orm.hibernate3.support.BlobByteArrayType
deepCopy(Object) - Method in class org.springframework.orm.hibernate3.support.BlobSerializableType
DEFAULT_AFTER_MESSAGE_PREFIX - Static variable in class org.springframework.web.filter.AbstractRequestLoggingFilter
DEFAULT_AFTER_MESSAGE_SUFFIX - Static variable in class org.springframework.web.filter.AbstractRequestLoggingFilter
DEFAULT_AOP_XML_LOCATION - Static variable in class org.springframework.test.jpa.AbstractAspectjJpaTests
Deprecated. Default location of the aop.xml file in the class path: "META-INF/aop.xml"
DEFAULT_ARGUMENT_SEPARATOR - Static variable in class org.springframework.web.servlet.tags.MessageTag
Default separator for splitting an arguments String: a comma (",")
DEFAULT_AUTOWIRE_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
DEFAULT_AUTOWIRE_CANDIDATES_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
DEFAULT_BASE_ADDRESS - Static variable in class org.springframework.remoting.jaxws.SimpleJaxWsServiceExporter
DEFAULT_BASENAME - Static variable in class org.springframework.web.servlet.view.ResourceBundleViewResolver
The default basename if no other basename is supplied.
DEFAULT_BATCH_SIZE - Static variable in class org.springframework.jdbc.object.BatchSqlUpdate
Default number of inserts to accumulate before commiting a batch (5000).
DEFAULT_BEAN_NAME_SEPARATOR - Static variable in class org.springframework.beans.factory.config.PropertyOverrideConfigurer
DEFAULT_BEFORE_MESSAGE_PREFIX - Static variable in class org.springframework.web.filter.AbstractRequestLoggingFilter
DEFAULT_BEFORE_MESSAGE_SUFFIX - Static variable in class org.springframework.web.filter.AbstractRequestLoggingFilter
DEFAULT_CHARACTER_ENCODING - Static variable in class org.springframework.web.util.WebUtils
Default character encoding to use when request.getCharacterEncoding returns null, according to the Servlet spec.
DEFAULT_CHARSET - Static variable in class org.springframework.http.converter.feed.AbstractWireFeedHttpMessageConverter
DEFAULT_CHARSET - Static variable in class org.springframework.http.converter.json.MappingJacksonHttpMessageConverter
DEFAULT_CHARSET - Static variable in class org.springframework.http.converter.StringHttpMessageConverter
DEFAULT_COMMAND_NAME - Static variable in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated.
DEFAULT_COMMAND_NAME - Static variable in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Default command name used for binding command objects: "command"
DEFAULT_COMMAND_NAME - Static variable in class org.springframework.web.servlet.mvc.multiaction.MultiActionController
Default command name used for binding command objects: "command"
DEFAULT_COMMAND_NAME - Static variable in class org.springframework.web.servlet.tags.form.FormTag
The default attribute name: "command"
DEFAULT_CONFIG_LOCATION - Static variable in class org.springframework.web.context.support.XmlWebApplicationContext
Default config location for the root context
DEFAULT_CONFIG_LOCATION - Static variable in class org.springframework.web.portlet.context.XmlPortletApplicationContext
Default config location for the root context
DEFAULT_CONFIG_LOCATION_PREFIX - Static variable in class org.springframework.web.context.support.XmlWebApplicationContext
Default prefix for building a config location for a namespace
DEFAULT_CONFIG_LOCATION_PREFIX - Static variable in class org.springframework.web.portlet.context.XmlPortletApplicationContext
Default prefix for building a config location for a namespace
DEFAULT_CONFIG_LOCATION_SUFFIX - Static variable in class org.springframework.web.context.support.XmlWebApplicationContext
Default suffix for building a config location for a namespace
DEFAULT_CONFIG_LOCATION_SUFFIX - Static variable in class org.springframework.web.portlet.context.XmlPortletApplicationContext
Default suffix for building a config location for a namespace
DEFAULT_CONTENT_TYPE - Static variable in class org.springframework.web.servlet.view.AbstractView
Default content type.
DEFAULT_CONTENT_TYPE - Static variable in class org.springframework.web.servlet.view.json.MappingJacksonJsonView
Default content type.
DEFAULT_CONTENT_TYPE - Static variable in class org.springframework.web.servlet.view.xml.MarshallingView
Default content type.
DEFAULT_CONTEXT_CLASS - Static variable in class org.springframework.web.portlet.FrameworkPortlet
Default context class for FrameworkPortlet.
DEFAULT_CONTEXT_CLASS - Static variable in class org.springframework.web.servlet.FrameworkServlet
Default context class for FrameworkServlet.
DEFAULT_CONTEXT_CLASS - Static variable in class org.springframework.web.struts.ContextLoaderPlugIn
Deprecated. Default context class for ContextLoaderPlugIn.
DEFAULT_CONTEXT_CONFIG_LOCATION - Static variable in class org.springframework.jca.context.SpringContextResourceAdapter
DEFAULT_COOKIE_MAX_AGE - Static variable in class org.springframework.web.util.CookieGenerator
Deprecated. in favor of setting no max age value at all in such a case
DEFAULT_COOKIE_NAME - Static variable in class org.springframework.web.servlet.i18n.CookieLocaleResolver
The default cookie name used if none is explicitly set.
DEFAULT_COOKIE_NAME - Static variable in class org.springframework.web.servlet.theme.CookieThemeResolver
DEFAULT_COOKIE_PATH - Static variable in class org.springframework.web.util.CookieGenerator
Default path that cookies will be visible to: "/", i.e.
DEFAULT_DEPENDENCY_CHECK_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
DEFAULT_DESTROY_METHOD_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
DEFAULT_ENCODING - Static variable in class org.springframework.oxm.castor.CastorMarshaller
The default encoding used for stream access: UTF-8.
DEFAULT_ENCODING - Static variable in class org.springframework.oxm.xstream.XStreamMarshaller
The default encoding used for stream access: UTF-8.
DEFAULT_EXCEPTION_ATTRIBUTE - Static variable in class org.springframework.web.portlet.handler.SimpleMappingExceptionResolver
The default name of the exception attribute: "exception".
DEFAULT_EXCEPTION_ATTRIBUTE - Static variable in class org.springframework.web.servlet.handler.SimpleMappingExceptionResolver
The default name of the exception attribute: "exception".
DEFAULT_EXCLUDED_PACKAGES - Static variable in class org.springframework.core.OverridingClassLoader
Packages that are excluded by default
DEFAULT_EXCLUDED_PACKAGES - Static variable in class org.springframework.instrument.classloading.ShadowingClassLoader
Packages that are excluded by default
DEFAULT_EXPRESSION_PREFIX - Static variable in class org.springframework.context.expression.StandardBeanExpressionResolver
Default expression prefix: "#{"
DEFAULT_EXPRESSION_SUFFIX - Static variable in class org.springframework.context.expression.StandardBeanExpressionResolver
Default expression suffix: "}"
DEFAULT_FEED_TYPE - Static variable in class org.springframework.web.servlet.view.feed.AbstractAtomFeedView
DEFAULT_FIELD_DEFAULT_PREFIX - Static variable in class org.springframework.web.bind.WebDataBinder
Default prefix that field default parameters start with, followed by the field name: e.g.
DEFAULT_FIELD_MARKER_PREFIX - Static variable in class org.springframework.web.bind.WebDataBinder
Default prefix that field marker parameters start with, followed by the field name: e.g.
DEFAULT_FORMAT_KEY - Static variable in class org.springframework.web.servlet.view.jasperreports.JasperReportsMultiFormatView
Default value used for format key: "format"
DEFAULT_HANDLER_MAPPINGS_LOCATION - Static variable in class org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver
The location to look for the mapping files.
DEFAULT_INDENT_AMOUNT - Static variable in class org.springframework.util.xml.TransformerUtils
The indent amount of characters if indenting is enabled.
DEFAULT_INIT_METHOD_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
DEFAULT_INTERVAL - Static variable in class org.springframework.jdbc.support.DatabaseStartupValidator
DEFAULT_LAYOUT_KEY - Static variable in class org.springframework.web.servlet.view.velocity.VelocityLayoutView
The default layout key.
DEFAULT_LAYOUT_URL - Static variable in class org.springframework.web.servlet.view.velocity.VelocityLayoutView
The default layout url.
DEFAULT_LAZY_INIT_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
DEFAULT_LOCATION - Static variable in class org.springframework.web.servlet.view.XmlViewResolver
Default if no other location is supplied
DEFAULT_MAX_LINKED_PAGES - Static variable in class org.springframework.beans.support.PagedListHolder
DEFAULT_MERGE_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
DEFAULT_METHOD_PARAM - Static variable in class org.springframework.web.filter.HiddenHttpMethodFilter
Default method parameter: _method
DEFAULT_MULTIPART_RESOLVER_BEAN_NAME - Static variable in class org.springframework.web.multipart.support.MultipartFilter
DEFAULT_NAMESPACE_SUFFIX - Static variable in class org.springframework.web.portlet.FrameworkPortlet
Suffix for Portlet ApplicationContext namespaces.
DEFAULT_NAMESPACE_SUFFIX - Static variable in class org.springframework.web.servlet.FrameworkServlet
Suffix for WebApplicationContext namespaces.
DEFAULT_NAMESPACE_SUFFIX - Static variable in class org.springframework.web.struts.ContextLoaderPlugIn
Deprecated. Suffix for WebApplicationContext namespaces.
DEFAULT_NONE - Static variable in interface org.springframework.web.bind.annotation.ValueConstants
Constant defining a value for no default - as a replacement for null which we cannot use in annotation attributes.
DEFAULT_OBJECT_NAME - Static variable in class org.springframework.validation.DataBinder
Default object name used for binding: "target"
DEFAULT_ORDER - Static variable in interface org.springframework.core.enums.LabeledEnum
Deprecated. Shared Comparator instance that sorts enumerations by LABEL_ORDER, then CODE_ORDER.
DEFAULT_PAGE_SIZE - Static variable in class org.springframework.beans.support.PagedListHolder
DEFAULT_PARAM_NAME - Static variable in class org.springframework.web.servlet.i18n.LocaleChangeInterceptor
Default name of the locale specification parameter: "locale".
DEFAULT_PARAM_NAME - Static variable in class org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver
Default name for the parameter whose value identifies the method to invoke: "action".
DEFAULT_PARAM_NAME - Static variable in class org.springframework.web.servlet.theme.ThemeChangeInterceptor
Default name of the theme specification parameter: "theme".
DEFAULT_PARAMETER_NAME - Static variable in class org.springframework.web.portlet.handler.ParameterHandlerMapping
Default request parameter name to use for mapping to handlers: "action".
DEFAULT_PARAMETER_NAME - Static variable in class org.springframework.web.portlet.handler.ParameterMappingInterceptor
Request parameter name to use for mapping to handlers
DEFAULT_PARAMETER_NAME - Static variable in class org.springframework.web.portlet.handler.PortletModeParameterHandlerMapping
Default request parameter name to use for mapping to handlers: "action".
DEFAULT_PATH_SEPARATOR - Static variable in class org.springframework.util.AntPathMatcher
Default path separator: "/"
DEFAULT_PERSISTENCE_MANAGER_FACTORY_BEAN_NAME - Static variable in class org.springframework.orm.jdo.support.OpenPersistenceManagerInViewFilter
DEFAULT_PERSISTENCE_MANAGER_FACTORY_BEAN_NAME - Static variable in class org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter
DEFAULT_PERSISTENCE_XML_LOCATION - Static variable in class org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager
Default location of the persistence.xml file: "classpath*:META-INF/persistence.xml".
DEFAULT_PLACEHOLDER_PREFIX - Static variable in class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
Default placeholder prefix: "${"
DEFAULT_PLACEHOLDER_SUFFIX - Static variable in class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
Default placeholder suffix: "}"
DEFAULT_PORT - Static variable in class org.springframework.mail.javamail.JavaMailSenderImpl
The default port: -1
DEFAULT_PREFIX_SEPARATOR - Static variable in class org.springframework.web.bind.ServletRequestParameterPropertyValues
Default prefix separator
DEFAULT_PREFIX_SEPARATOR - Static variable in class org.springframework.web.portlet.bind.PortletRequestParameterPropertyValues
Default prefix separator
DEFAULT_PROTOCOL - Static variable in class org.springframework.mail.javamail.JavaMailSenderImpl
The default protocol: 'smtp'
DEFAULT_PROTOCOL - Static variable in class org.springframework.mock.web.MockHttpServletRequest
The default protocol: 'http'.
DEFAULT_RECEIVE_TIMEOUT - Static variable in class org.springframework.jms.listener.AbstractPollingMessageListenerContainer
The default receive timeout: 1000 ms = 1 second.
DEFAULT_RECOVERY_INTERVAL - Static variable in class org.springframework.jms.listener.DefaultMessageListenerContainer
The default recovery interval: 5000 ms = 5 seconds.
DEFAULT_REMOTE_ADDR - Static variable in class org.springframework.mock.web.MockHttpServletRequest
The default remote address: '127.0.0.1'.
DEFAULT_REMOTE_HOST - Static variable in class org.springframework.mock.web.MockHttpServletRequest
The default remote host: 'localhost'.
DEFAULT_ROOT - Static variable in class org.springframework.web.servlet.view.xslt.AbstractXsltView
Deprecated. The default document root name
DEFAULT_SCHEMA_MAPPINGS_LOCATION - Static variable in class org.springframework.beans.factory.xml.PluggableSchemaResolver
The location of the file that defines schema mappings.
DEFAULT_SCREEN_CONTENT_KEY - Static variable in class org.springframework.web.servlet.view.velocity.VelocityLayoutView
The default screen content key.
DEFAULT_SEPARATOR - Static variable in class org.springframework.beans.propertyeditors.StringArrayPropertyEditor
Default separator for splitting a String: a comma (",")
DEFAULT_SEPARATOR - Static variable in class org.springframework.core.io.support.LocalizedResourceHelper
The default separator to use inbetween file name parts: an underscore
DEFAULT_SERVER_ADDR - Static variable in class org.springframework.mock.web.MockHttpServletRequest
The default server address: '127.0.0.1'.
DEFAULT_SERVER_NAME - Static variable in class org.springframework.mock.web.MockHttpServletRequest
The default server name: 'localhost'.
DEFAULT_SERVER_PORT - Static variable in class org.springframework.mock.web.MockHttpServletRequest
The default server port: '80'.
DEFAULT_SERVER_PORT - Static variable in class org.springframework.mock.web.MockHttpServletResponse
DEFAULT_SERVICE_URL - Static variable in class org.springframework.jmx.support.ConnectorServerFactoryBean
The default service URL
DEFAULT_SESSION_FACTORY_BEAN_NAME - Static variable in class org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
DEFAULT_TARGET_BEAN_NAME - Static variable in class org.springframework.web.jsf.DelegatingNavigationHandlerProxy
Default name of the target bean in the Spring application context: "jsfNavigationHandler"
DEFAULT_THEME_NAME - Static variable in class org.springframework.web.servlet.support.RequestContext
Default theme name used if the RequestContext cannot find a ThemeResolver.
DEFAULT_THREAD_COUNT - Static variable in class org.springframework.scheduling.quartz.SchedulerFactoryBean
DEFAULT_THREAD_NAME_PREFIX - Static variable in class org.springframework.jms.listener.DefaultMessageListenerContainer
Default thread name prefix: "DefaultMessageListenerContainer-".
DEFAULT_TIMEOUT - Static variable in class org.springframework.jdbc.support.DatabaseStartupValidator
DEFAULT_TRANSACTION_SYNCHRONIZATION_REGISTRY_NAME - Static variable in class org.springframework.transaction.jta.JtaTransactionManager
Standard Java EE 5 JNDI location for the JTA TransactionSynchronizationRegistry.
DEFAULT_UOW_MANAGER_NAME - Static variable in class org.springframework.transaction.jta.WebSphereUowTransactionManager
Default JNDI location for the WebSphere UOWManager.
DEFAULT_USER_TRANSACTION_NAME - Static variable in class org.springframework.transaction.jta.JtaTransactionManager
Default JNDI location for the JTA UserTransaction.
DEFAULT_USERINFO_ATTRIBUTE_NAMES - Static variable in class org.springframework.web.portlet.FrameworkPortlet
Default USER_INFO attribute names to search for the current username: "user.login.id", "user.name".
DEFAULT_VALUE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
DEFAULT_VALUE_SEPARATOR - Static variable in class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
Default value separator: ":"
DEFAULT_VIEW_RENDERER_URL - Static variable in class org.springframework.web.portlet.DispatcherPortlet
Default URL to ViewRendererServlet.
DEFAULT_WEB_APP_ROOT_KEY - Static variable in class org.springframework.web.util.WebUtils
Default web app root key: "webapp.root"
DefaultAdvisorAdapterRegistry - Class in org.springframework.aop.framework.adapter
Default implementation of the AdvisorAdapterRegistry interface.
DefaultAdvisorAdapterRegistry() - Constructor for class org.springframework.aop.framework.adapter.DefaultAdvisorAdapterRegistry
Create a new DefaultAdvisorAdapterRegistry, registering well-known adapters.
DefaultAdvisorAutoProxyCreator - Class in org.springframework.aop.framework.autoproxy
BeanPostProcessor implementation that creates AOP proxies based on all candidate Advisors in the current BeanFactory.
DefaultAdvisorAutoProxyCreator() - Constructor for class org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator
DefaultAdvisorChainFactory - Class in org.springframework.aop.framework
A simple but definitive way of working out an advice chain for a Method, given an Advised object.
DefaultAdvisorChainFactory() - Constructor for class org.springframework.aop.framework.DefaultAdvisorChainFactory
DefaultAnnotationHandlerMapping - Class in org.springframework.web.portlet.mvc.annotation
Implementation of the HandlerMapping interface that maps handlers based on portlet modes expressed through the RequestMapping annotation at the type or method level.
DefaultAnnotationHandlerMapping() - Constructor for class org.springframework.web.portlet.mvc.annotation.DefaultAnnotationHandlerMapping
DefaultAnnotationHandlerMapping - Class in org.springframework.web.servlet.mvc.annotation
Implementation of the HandlerMapping interface that maps handlers based on HTTP paths expressed through the RequestMapping annotation at the type or method level.
DefaultAnnotationHandlerMapping() - Constructor for class org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping
DefaultAopProxyFactory - Class in org.springframework.aop.framework
Default AopProxyFactory implementation, creating either a CGLIB proxy or a JDK dynamic proxy.
DefaultAopProxyFactory() - Constructor for class org.springframework.aop.framework.DefaultAopProxyFactory
defaultAutoCommit() - Method in class org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy
Expose the default auto-commit value.
DefaultBeanDefinitionDocumentReader - Class in org.springframework.beans.factory.xml
Default implementation of the BeanDefinitionDocumentReader interface.
DefaultBeanDefinitionDocumentReader() - Constructor for class org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader
DefaultBeanFactoryPointcutAdvisor - Class in org.springframework.aop.support
Concrete BeanFactory-based PointcutAdvisor that allows for any Advice to be configured as reference to an Advice bean in the BeanFactory, as well as the Pointcut to be configured through a bean property.
DefaultBeanFactoryPointcutAdvisor() - Constructor for class org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor
DefaultBeanNameGenerator - Class in org.springframework.beans.factory.support
Default implementation of the BeanNameGenerator interface, delegating to BeanDefinitionReaderUtils.generateBeanName(BeanDefinition, BeanDefinitionRegistry).
DefaultBeanNameGenerator() - Constructor for class org.springframework.beans.factory.support.DefaultBeanNameGenerator
DefaultBindingErrorProcessor - Class in org.springframework.validation
Default BindingErrorProcessor implementation.
DefaultBindingErrorProcessor() - Constructor for class org.springframework.validation.DefaultBindingErrorProcessor
DefaultContextLoadTimeWeaver - Class in org.springframework.context.weaving
Default LoadTimeWeaver bean for use in an application context, decorating an automatically detected internal LoadTimeWeaver.
DefaultContextLoadTimeWeaver() - Constructor for class org.springframework.context.weaving.DefaultContextLoadTimeWeaver
DefaultDocumentLoader - Class in org.springframework.beans.factory.xml
Spring's default DocumentLoader implementation.
DefaultDocumentLoader() - Constructor for class org.springframework.beans.factory.xml.DefaultDocumentLoader
DefaultHandlerExceptionResolver - Class in org.springframework.web.servlet.mvc.support
Default implementation of the HandlerExceptionResolver interface that resolves standard Spring exceptions.
DefaultHandlerExceptionResolver() - Constructor for class org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver
Sets the order to Ordered.LOWEST_PRECEDENCE.
DefaultIntroductionAdvisor - Class in org.springframework.aop.support
Simple IntroductionAdvisor implementation that by default applies to any class.
DefaultIntroductionAdvisor(Advice) - Constructor for class org.springframework.aop.support.DefaultIntroductionAdvisor
Create a DefaultIntroductionAdvisor for the given advice.
DefaultIntroductionAdvisor(Advice, IntroductionInfo) - Constructor for class org.springframework.aop.support.DefaultIntroductionAdvisor
Create a DefaultIntroductionAdvisor for the given advice.
DefaultIntroductionAdvisor(DynamicIntroductionAdvice, Class) - Constructor for class org.springframework.aop.support.DefaultIntroductionAdvisor
Create a DefaultIntroductionAdvisor for the given advice.
DefaultJdoDialect - Class in org.springframework.orm.jdo
Default implementation of the JdoDialect interface.
DefaultJdoDialect() - Constructor for class org.springframework.orm.jdo.DefaultJdoDialect
Create a new DefaultJdoDialect.
DefaultJmsActivationSpecFactory - Class in org.springframework.jms.listener.endpoint
Default implementation of the JmsActivationSpecFactory interface.
DefaultJmsActivationSpecFactory() - Constructor for class org.springframework.jms.listener.endpoint.DefaultJmsActivationSpecFactory
DefaultJpaDialect - Class in org.springframework.orm.jpa
Default implementation of the JpaDialect interface.
DefaultJpaDialect() - Constructor for class org.springframework.orm.jpa.DefaultJpaDialect
DefaultLifecycleProcessor - Class in org.springframework.context.support
Default implementation of the LifecycleProcessor strategy.
DefaultLifecycleProcessor() - Constructor for class org.springframework.context.support.DefaultLifecycleProcessor
DefaultListableBeanFactory - Class in org.springframework.beans.factory.support
Default implementation of the ListableBeanFactory and BeanDefinitionRegistry interfaces: a full-fledged bean factory based on bean definition objects.
DefaultListableBeanFactory() - Constructor for class org.springframework.beans.factory.support.DefaultListableBeanFactory
Create a new DefaultListableBeanFactory.
DefaultListableBeanFactory(BeanFactory) - Constructor for class org.springframework.beans.factory.support.DefaultListableBeanFactory
Create a new DefaultListableBeanFactory with the given parent.
DefaultLobHandler - Class in org.springframework.jdbc.support.lob
Default implementation of the LobHandler interface.
DefaultLobHandler() - Constructor for class org.springframework.jdbc.support.lob.DefaultLobHandler
DefaultLobHandler.DefaultLobCreator - Class in org.springframework.jdbc.support.lob
Default LobCreator implementation as inner class.
DefaultLobHandler.DefaultLobCreator() - Constructor for class org.springframework.jdbc.support.lob.DefaultLobHandler.DefaultLobCreator
DefaultLocatorFactory - Class in org.springframework.context.access
A factory class to get a default ContextSingletonBeanFactoryLocator instance.
DefaultLocatorFactory() - Constructor for class org.springframework.context.access.DefaultLocatorFactory
defaultLogger - Variable in class org.springframework.aop.interceptor.AbstractTraceInterceptor
The default Log instance used to write trace messages.
DefaultMessageCodesResolver - Class in org.springframework.validation
Default implementation of the MessageCodesResolver interface.
DefaultMessageCodesResolver() - Constructor for class org.springframework.validation.DefaultMessageCodesResolver
DefaultMessageListenerContainer - Class in org.springframework.jms.listener
Message listener container variant that uses plain JMS client API, specifically a loop of MessageConsumer.receive() calls that also allow for transactional reception of messages (registering them with XA transactions).
DefaultMessageListenerContainer() - Constructor for class org.springframework.jms.listener.DefaultMessageListenerContainer
DefaultMessageListenerContainer102 - Class in org.springframework.jms.listener
Deprecated. as of Spring 3.0, in favor of the JMS 1.1 based DefaultMessageListenerContainer
DefaultMessageListenerContainer102() - Constructor for class org.springframework.jms.listener.DefaultMessageListenerContainer102
Deprecated.
DefaultMessageSourceResolvable - Class in org.springframework.context.support
Default implementation of the MessageSourceResolvable interface.
DefaultMessageSourceResolvable(String) - Constructor for class org.springframework.context.support.DefaultMessageSourceResolvable
Create a new DefaultMessageSourceResolvable.
DefaultMessageSourceResolvable(String[]) - Constructor for class org.springframework.context.support.DefaultMessageSourceResolvable
Create a new DefaultMessageSourceResolvable.
DefaultMessageSourceResolvable(String[], String) - Constructor for class org.springframework.context.support.DefaultMessageSourceResolvable
Create a new DefaultMessageSourceResolvable.
DefaultMessageSourceResolvable(String[], Object[]) - Constructor for class org.springframework.context.support.DefaultMessageSourceResolvable
Create a new DefaultMessageSourceResolvable.
DefaultMessageSourceResolvable(String[], Object[], String) - Constructor for class org.springframework.context.support.DefaultMessageSourceResolvable
Create a new DefaultMessageSourceResolvable.
DefaultMessageSourceResolvable(MessageSourceResolvable) - Constructor for class org.springframework.context.support.DefaultMessageSourceResolvable
Copy constructor: Create a new instance from another resolvable.
DefaultMultipartActionRequest - Class in org.springframework.web.portlet.multipart
Default implementation of the MultipartActionRequest interface.
DefaultMultipartActionRequest(ActionRequest, MultiValueMap<String, MultipartFile>, Map<String, String[]>) - Constructor for class org.springframework.web.portlet.multipart.DefaultMultipartActionRequest
Wrap the given Portlet ActionRequest in a MultipartActionRequest.
DefaultMultipartActionRequest(ActionRequest) - Constructor for class org.springframework.web.portlet.multipart.DefaultMultipartActionRequest
Wrap the given Portlet ActionRequest in a MultipartActionRequest.
DefaultMultipartHttpServletRequest - Class in org.springframework.web.multipart.support
Default implementation of the MultipartHttpServletRequest interface.
DefaultMultipartHttpServletRequest(HttpServletRequest, MultiValueMap<String, MultipartFile>, Map<String, String[]>) - Constructor for class org.springframework.web.multipart.support.DefaultMultipartHttpServletRequest
Wrap the given HttpServletRequest in a MultipartHttpServletRequest.
DefaultMultipartHttpServletRequest(HttpServletRequest) - Constructor for class org.springframework.web.multipart.support.DefaultMultipartHttpServletRequest
Wrap the given HttpServletRequest in a MultipartHttpServletRequest.
DefaultNamespaceHandlerResolver - Class in org.springframework.beans.factory.xml
Default implementation of the NamespaceHandlerResolver interface.
DefaultNamespaceHandlerResolver() - Constructor for class org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver
Create a new DefaultNamespaceHandlerResolver using the default mapping file location.
DefaultNamespaceHandlerResolver(ClassLoader) - Constructor for class org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver
Create a new DefaultNamespaceHandlerResolver using the default mapping file location.
DefaultNamespaceHandlerResolver(ClassLoader, String) - Constructor for class org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver
Create a new DefaultNamespaceHandlerResolver using the supplied mapping file location.
DefaultPersistenceUnitManager - Class in org.springframework.orm.jpa.persistenceunit
Default implementation of the PersistenceUnitManager interface.
DefaultPersistenceUnitManager() - Constructor for class org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager
DefaultPointcutAdvisor - Class in org.springframework.aop.support
Convenient Pointcut-driven Advisor implementation.
DefaultPointcutAdvisor() - Constructor for class org.springframework.aop.support.DefaultPointcutAdvisor
Create an empty DefaultPointcutAdvisor.
DefaultPointcutAdvisor(Advice) - Constructor for class org.springframework.aop.support.DefaultPointcutAdvisor
Create a DefaultPointcutAdvisor that matches all methods.
DefaultPointcutAdvisor(Pointcut, Advice) - Constructor for class org.springframework.aop.support.DefaultPointcutAdvisor
Create a DefaultPointcutAdvisor, specifying Pointcut and Advice.
DefaultPropertiesPersister - Class in org.springframework.util
Default implementation of the PropertiesPersister interface.
DefaultPropertiesPersister() - Constructor for class org.springframework.util.DefaultPropertiesPersister
DefaultRemoteInvocationExecutor - Class in org.springframework.remoting.support
Default implementation of the RemoteInvocationExecutor interface.
DefaultRemoteInvocationExecutor() - Constructor for class org.springframework.remoting.support.DefaultRemoteInvocationExecutor
DefaultRemoteInvocationFactory - Class in org.springframework.remoting.support
Default implementation of the RemoteInvocationFactory interface.
DefaultRemoteInvocationFactory() - Constructor for class org.springframework.remoting.support.DefaultRemoteInvocationFactory
DefaultRequestToViewNameTranslator - Class in org.springframework.web.servlet.view
RequestToViewNameTranslator that simply transforms the URI of the incoming request into a view name.
DefaultRequestToViewNameTranslator() - Constructor for class org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator
DefaultResourceLoader - Class in org.springframework.core.io
Default implementation of the ResourceLoader interface.
DefaultResourceLoader() - Constructor for class org.springframework.core.io.DefaultResourceLoader
Create a new DefaultResourceLoader.
DefaultResourceLoader(ClassLoader) - Constructor for class org.springframework.core.io.DefaultResourceLoader
Create a new DefaultResourceLoader.
DefaultResponseErrorHandler - Class in org.springframework.web.client
Default implementation of the ResponseErrorHandler interface.
DefaultResponseErrorHandler() - Constructor for class org.springframework.web.client.DefaultResponseErrorHandler
DefaultScopedObject - Class in org.springframework.aop.scope
Default implementation of the ScopedObject interface.
DefaultScopedObject(ConfigurableBeanFactory, String) - Constructor for class org.springframework.aop.scope.DefaultScopedObject
Creates a new instance of the DefaultScopedObject class.
DefaultsDefinition - Interface in org.springframework.beans.factory.parsing
Marker interface for a defaults definition, extending BeanMetadataElement to inherit source exposure.
DefaultSessionAttributeStore - Class in org.springframework.web.bind.support
Default implementation of the SessionAttributeStore interface, storing the attributes in the WebRequest session (i.e.
DefaultSessionAttributeStore() - Constructor for class org.springframework.web.bind.support.DefaultSessionAttributeStore
DefaultSingletonBeanRegistry - Class in org.springframework.beans.factory.support
Generic registry for shared bean instances, implementing the SingletonBeanRegistry.
DefaultSingletonBeanRegistry() - Constructor for class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
defaultsRegistered(DefaultsDefinition) - Method in class org.springframework.beans.factory.parsing.EmptyReaderEventListener
defaultsRegistered(DefaultsDefinition) - Method in interface org.springframework.beans.factory.parsing.ReaderEventListener
Notification that the given defaults has been registered.
DefaultToStringStyler - Class in org.springframework.core.style
Spring's default toString() styler.
DefaultToStringStyler(ValueStyler) - Constructor for class org.springframework.core.style.DefaultToStringStyler
Create a new DefaultToStringStyler.
DefaultTransactionAttribute - Class in org.springframework.transaction.interceptor
Transaction attribute that takes the EJB approach to rolling back on runtime, but not checked, exceptions.
DefaultTransactionAttribute() - Constructor for class org.springframework.transaction.interceptor.DefaultTransactionAttribute
Create a new DefaultTransactionAttribute, with default settings.
DefaultTransactionAttribute(TransactionAttribute) - Constructor for class org.springframework.transaction.interceptor.DefaultTransactionAttribute
Copy constructor.
DefaultTransactionAttribute(int) - Constructor for class org.springframework.transaction.interceptor.DefaultTransactionAttribute
Create a new DefaultTransactionAttribute with the the given propagation behavior.
DefaultTransactionDefinition - Class in org.springframework.transaction.support
Default implementation of the TransactionDefinition interface, offering bean-style configuration and sensible default values (PROPAGATION_REQUIRED, ISOLATION_DEFAULT, TIMEOUT_DEFAULT, readOnly=false).
DefaultTransactionDefinition() - Constructor for class org.springframework.transaction.support.DefaultTransactionDefinition
Create a new DefaultTransactionDefinition, with default settings.
DefaultTransactionDefinition(TransactionDefinition) - Constructor for class org.springframework.transaction.support.DefaultTransactionDefinition
Copy constructor.
DefaultTransactionDefinition(int) - Constructor for class org.springframework.transaction.support.DefaultTransactionDefinition
Create a new DefaultTransactionDefinition with the the given propagation behavior.
defaultTransactionIsolation() - Method in class org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy
Expose the default transaction isolation value.
DefaultTransactionStatus - Class in org.springframework.transaction.support
Default implementation of the TransactionStatus interface, used by AbstractPlatformTransactionManager.
DefaultTransactionStatus(Object, boolean, boolean, boolean, boolean, Object) - Constructor for class org.springframework.transaction.support.DefaultTransactionStatus
Create a new DefaultTransactionStatus instance.
DefaultValueStyler - Class in org.springframework.core.style
Converts objects to String form, generally for debugging purposes, using Spring's toString styling conventions.
DefaultValueStyler() - Constructor for class org.springframework.core.style.DefaultValueStyler
DelegatePerTargetObjectIntroductionInterceptor - Class in org.springframework.aop.support
Convenient implementation of the IntroductionInterceptor interface.
DelegatePerTargetObjectIntroductionInterceptor(Class, Class) - Constructor for class org.springframework.aop.support.DelegatePerTargetObjectIntroductionInterceptor
DelegatingActionProxy - Class in org.springframework.web.struts
Deprecated. as of Spring 3.0
DelegatingActionProxy() - Constructor for class org.springframework.web.struts.DelegatingActionProxy
Deprecated.
DelegatingActionUtils - Class in org.springframework.web.struts
Deprecated. as of Spring 3.0
DelegatingActionUtils() - Constructor for class org.springframework.web.struts.DelegatingActionUtils
Deprecated.
DelegatingConnectionFactory - Class in org.springframework.jca.cci.connection
CCI ConnectionFactory implementation that delegates all calls to a given target ConnectionFactory.
DelegatingConnectionFactory() - Constructor for class org.springframework.jca.cci.connection.DelegatingConnectionFactory
DelegatingConnectionFactory - Class in org.springframework.jms.connection
ConnectionFactory implementation that delegates all calls to a given target ConnectionFactory, adapting specific create(Queue/Topic)Connection calls to the target ConnectionFactory if necessary (e.g.
DelegatingConnectionFactory() - Constructor for class org.springframework.jms.connection.DelegatingConnectionFactory
DelegatingDataSource - Class in org.springframework.jdbc.datasource
JDBC DataSource implementation that delegates all calls to a given target DataSource.
DelegatingDataSource() - Constructor for class org.springframework.jdbc.datasource.DelegatingDataSource
Create a new DelegatingDataSource.
DelegatingDataSource(DataSource) - Constructor for class org.springframework.jdbc.datasource.DelegatingDataSource
Create a new DelegatingDataSource.
DelegatingEntityResolver - Class in org.springframework.beans.factory.xml
EntityResolver implementation that delegates to a BeansDtdResolver and a PluggableSchemaResolver for DTDs and XML schemas, respectively.
DelegatingEntityResolver(ClassLoader) - Constructor for class org.springframework.beans.factory.xml.DelegatingEntityResolver
Create a new DelegatingEntityResolver that delegates to a default BeansDtdResolver and a default PluggableSchemaResolver.
DelegatingEntityResolver(EntityResolver, EntityResolver) - Constructor for class org.springframework.beans.factory.xml.DelegatingEntityResolver
Create a new DelegatingEntityResolver that delegates to the given EntityResolvers.
DelegatingErrorHandlingRunnable - Class in org.springframework.scheduling.support
Runnable wrapper that catches any exception or error thrown from its delegate Runnable and allows an ErrorHandler to handle it.
DelegatingErrorHandlingRunnable(Runnable, ErrorHandler) - Constructor for class org.springframework.scheduling.support.DelegatingErrorHandlingRunnable
Create a new DelegatingErrorHandlingRunnable.
DelegatingFilterProxy - Class in org.springframework.web.filter
Proxy for a standard Servlet 2.3 Filter, delegating to a Spring-managed bean that implements the Filter interface.
DelegatingFilterProxy() - Constructor for class org.springframework.web.filter.DelegatingFilterProxy
DelegatingIntroductionInterceptor - Class in org.springframework.aop.support
Convenient implementation of the IntroductionInterceptor interface.
DelegatingIntroductionInterceptor(Object) - Constructor for class org.springframework.aop.support.DelegatingIntroductionInterceptor
Construct a new DelegatingIntroductionInterceptor, providing a delegate that implements the interfaces to be introduced.
DelegatingIntroductionInterceptor() - Constructor for class org.springframework.aop.support.DelegatingIntroductionInterceptor
Construct a new DelegatingIntroductionInterceptor.
DelegatingJob - Class in org.springframework.scheduling.quartz
Simple Quartz Job adapter that delegates to a given Runnable instance.
DelegatingJob(Runnable) - Constructor for class org.springframework.scheduling.quartz.DelegatingJob
Create a new DelegatingJob.
DelegatingMessageSource - Class in org.springframework.context.support
Empty MessageSource that delegates all calls to the parent MessageSource.
DelegatingMessageSource() - Constructor for class org.springframework.context.support.DelegatingMessageSource
DelegatingNavigationHandlerProxy - Class in org.springframework.web.jsf
JSF NavigationHandler implementation that delegates to a NavigationHandler bean obtained from the Spring root WebApplicationContext.
DelegatingNavigationHandlerProxy() - Constructor for class org.springframework.web.jsf.DelegatingNavigationHandlerProxy
Create a new DelegatingNavigationHandlerProxy.
DelegatingNavigationHandlerProxy(NavigationHandler) - Constructor for class org.springframework.web.jsf.DelegatingNavigationHandlerProxy
Create a new DelegatingNavigationHandlerProxy.
DelegatingPhaseListenerMulticaster - Class in org.springframework.web.jsf
JSF PhaseListener implementation that delegates to one or more Spring-managed PhaseListener beans coming from the Spring root WebApplicationContext.
DelegatingPhaseListenerMulticaster() - Constructor for class org.springframework.web.jsf.DelegatingPhaseListenerMulticaster
DelegatingRequestProcessor - Class in org.springframework.web.struts
Deprecated. as of Spring 3.0
DelegatingRequestProcessor() - Constructor for class org.springframework.web.struts.DelegatingRequestProcessor
Deprecated.
DelegatingServletInputStream - Class in org.springframework.mock.web
Delegating implementation of ServletInputStream.
DelegatingServletInputStream(InputStream) - Constructor for class org.springframework.mock.web.DelegatingServletInputStream
Create a DelegatingServletInputStream for the given source stream.
DelegatingServletOutputStream - Class in org.springframework.mock.web
Delegating implementation of ServletOutputStream.
DelegatingServletOutputStream(OutputStream) - Constructor for class org.springframework.mock.web.DelegatingServletOutputStream
Create a DelegatingServletOutputStream for the given target stream.
DelegatingThemeSource - Class in org.springframework.ui.context.support
Empty ThemeSource that delegates all calls to the parent ThemeSource.
DelegatingThemeSource() - Constructor for class org.springframework.ui.context.support.DelegatingThemeSource
DelegatingTilesRequestProcessor - Class in org.springframework.web.struts
Deprecated. as of Spring 3.0
DelegatingTilesRequestProcessor() - Constructor for class org.springframework.web.struts.DelegatingTilesRequestProcessor
Deprecated.
DelegatingTimerListener - Class in org.springframework.scheduling.commonj
Simple TimerListener adapter that delegates to a given Runnable.
DelegatingTimerListener(Runnable) - Constructor for class org.springframework.scheduling.commonj.DelegatingTimerListener
Create a new DelegatingTimerListener.
DelegatingTimerTask - Class in org.springframework.scheduling.timer
Deprecated. as of Spring 3.0, in favor of the scheduling.concurrent package which is based on Java 5's java.util.concurrent.ExecutorService
DelegatingTimerTask(Runnable) - Constructor for class org.springframework.scheduling.timer.DelegatingTimerTask
Deprecated. Create a new DelegatingTimerTask.
DelegatingTransactionAttribute - Class in org.springframework.transaction.interceptor
TransactionAttribute implementation that delegates all calls to a given target TransactionAttribute instance.
DelegatingTransactionAttribute(TransactionAttribute) - Constructor for class org.springframework.transaction.interceptor.DelegatingTransactionAttribute
Create a DelegatingTransactionAttribute for the given target attribute.
DelegatingTransactionDefinition - Class in org.springframework.transaction.support
TransactionDefinition implementation that delegates all calls to a given target TransactionDefinition instance.
DelegatingTransactionDefinition(TransactionDefinition) - Constructor for class org.springframework.transaction.support.DelegatingTransactionDefinition
Create a DelegatingTransactionAttribute for the given target attribute.
DelegatingVariableResolver - Class in org.springframework.web.jsf
JSF 1.1 VariableResolver that first delegates to the original resolver of the underlying JSF implementation (for resolving managed-bean objects as defined in faces-config.xml as well as well-known implicit EL attributes), then to the Spring root WebApplicationContext (for resolving Spring beans).
DelegatingVariableResolver(VariableResolver) - Constructor for class org.springframework.web.jsf.DelegatingVariableResolver
Create a new DelegatingVariableResolver, using the given original VariableResolver.
DelegatingWork - Class in org.springframework.jca.work
Simple Work adapter that delegates to a given Runnable.
DelegatingWork(Runnable) - Constructor for class org.springframework.jca.work.DelegatingWork
Create a new DelegatingWork.
DelegatingWork - Class in org.springframework.scheduling.commonj
Simple Work adapter that delegates to a given Runnable.
DelegatingWork(Runnable) - Constructor for class org.springframework.scheduling.commonj.DelegatingWork
Create a new DelegatingWork.
delete(Object) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Delete the given persistent instance.
delete(Object, LockMode) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Delete the given persistent instance.
delete(String, Object) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Delete the given persistent instance.
delete(String, Object, LockMode) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Delete the given persistent instance.
delete(Object) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
delete(Object, LockMode) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
delete(String, Object) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
delete(String, Object, LockMode) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
delete(String) - Method in interface org.springframework.orm.ibatis.SqlMapClientOperations
delete(String, Object) - Method in interface org.springframework.orm.ibatis.SqlMapClientOperations
delete(String, Object, int) - Method in interface org.springframework.orm.ibatis.SqlMapClientOperations
Convenience method provided by Spring: execute a delete operation with an automatic check that the delete affected the given required number of rows.
delete(String) - Method in class org.springframework.orm.ibatis.SqlMapClientTemplate
delete(String, Object) - Method in class org.springframework.orm.ibatis.SqlMapClientTemplate
delete(String, Object, int) - Method in class org.springframework.orm.ibatis.SqlMapClientTemplate
delete(String, String) - Static method in class org.springframework.util.StringUtils
Delete all occurrences of the given substring.
delete(String, Object...) - Method in interface org.springframework.web.client.RestOperations
Delete the resources at the specified URI.
delete(String, Map<String, ?>) - Method in interface org.springframework.web.client.RestOperations
Delete the resources at the specified URI.
delete(URI) - Method in interface org.springframework.web.client.RestOperations
Delete the resources at the specified URL.
delete(String, Object...) - Method in class org.springframework.web.client.RestTemplate
delete(String, Map<String, ?>) - Method in class org.springframework.web.client.RestTemplate
delete(URI) - Method in class org.springframework.web.client.RestTemplate
deleteAll(Collection) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Delete all given persistent instances.
deleteAll(Collection) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
deleteAny(String, String) - Static method in class org.springframework.util.StringUtils
Delete any character in a given String.
deleteFromTables(String[]) - Method in class org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
Deprecated. Convenient method to delete all rows from these tables.
deleteFromTables(String...) - Method in class org.springframework.test.context.junit38.AbstractTransactionalJUnit38SpringContextTests
Convenience method for deleting all rows from the specified tables.
deleteFromTables(String...) - Method in class org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests
Convenience method for deleting all rows from the specified tables.
deleteFromTables(String...) - Method in class org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests
Convenience method for deleting all rows from the specified tables.
deleteFromTables(SimpleJdbcTemplate, String...) - Static method in class org.springframework.test.jdbc.SimpleJdbcTestUtils
Delete all rows from the specified tables.
deletePersistent(Object) - Method in interface org.springframework.orm.jdo.JdoOperations
Delete the given persistent instance.
deletePersistent(Object) - Method in class org.springframework.orm.jdo.JdoTemplate
deletePersistentAll(Collection) - Method in interface org.springframework.orm.jdo.JdoOperations
Delete all given persistent instances.
deletePersistentAll(Collection) - Method in class org.springframework.orm.jdo.JdoTemplate
deleteRecursively(File) - Static method in class org.springframework.util.FileSystemUtils
Delete the supplied File - for directories, recursively delete any nested directories or files as well.
delimitedListToStringArray(String, String) - Static method in class org.springframework.util.StringUtils
Take a String which is a delimited list and convert it to a String array.
delimitedListToStringArray(String, String, String) - Static method in class org.springframework.util.StringUtils
Take a String which is a delimited list and convert it to a String array.
delistResource(XAResource, int) - Method in class org.springframework.transaction.jta.ManagedTransactionAdapter
DEPENDENCY_CHECK_ALL - Static variable in class org.springframework.beans.factory.support.AbstractBeanDefinition
Constant that indicates dependency checking for all properties (object references as well as "simple" properties).
DEPENDENCY_CHECK_ALL_ATTRIBUTE_VALUE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
DEPENDENCY_CHECK_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
DEPENDENCY_CHECK_NONE - Static variable in class org.springframework.beans.factory.support.AbstractBeanDefinition
Constant that indicates no dependency check at all.
DEPENDENCY_CHECK_OBJECTS - Static variable in class org.springframework.beans.factory.support.AbstractBeanDefinition
Constant that indicates dependency checking for object references.
DEPENDENCY_CHECK_OBJECTS_ATTRIBUTE_VALUE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
DEPENDENCY_CHECK_SIMPLE - Static variable in class org.springframework.beans.factory.support.AbstractBeanDefinition
Constant that indicates dependency checking for "simple" properties.
DEPENDENCY_CHECK_SIMPLE_ATTRIBUTE_VALUE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
DependencyDescriptor - Class in org.springframework.beans.factory.config
Descriptor for a specific dependency that is about to be injected.
DependencyDescriptor(MethodParameter, boolean) - Constructor for class org.springframework.beans.factory.config.DependencyDescriptor
Create a new descriptor for a method or constructor parameter.
DependencyDescriptor(MethodParameter, boolean, boolean) - Constructor for class org.springframework.beans.factory.config.DependencyDescriptor
Create a new descriptor for a method or constructor parameter.
DependencyDescriptor(Field, boolean) - Constructor for class org.springframework.beans.factory.config.DependencyDescriptor
Create a new descriptor for a field.
DependencyDescriptor(Field, boolean, boolean) - Constructor for class org.springframework.beans.factory.config.DependencyDescriptor
Create a new descriptor for a field.
DependencyInjectionTestExecutionListener - Class in org.springframework.test.context.support
TestExecutionListener which provides support for dependency injection and initialization of test instances.
DependencyInjectionTestExecutionListener() - Constructor for class org.springframework.test.context.support.DependencyInjectionTestExecutionListener
DEPENDS_ON_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
DependsOn - Annotation Type in org.springframework.context.annotation
Beans on which the current bean depends.
DerbyCallMetaDataProvider - Class in org.springframework.jdbc.core.metadata
Derby specific implementation for the CallMetaDataProvider interface.
DerbyCallMetaDataProvider(DatabaseMetaData) - Constructor for class org.springframework.jdbc.core.metadata.DerbyCallMetaDataProvider
DerbyMaxValueIncrementer - Class in org.springframework.jdbc.support.incrementer
DataFieldMaxValueIncrementer that increments the maximum value of a given Derby table with the equivalent of an auto-increment column.
DerbyMaxValueIncrementer() - Constructor for class org.springframework.jdbc.support.incrementer.DerbyMaxValueIncrementer
Default constructor for bean property style usage.
DerbyMaxValueIncrementer(DataSource, String, String) - Constructor for class org.springframework.jdbc.support.incrementer.DerbyMaxValueIncrementer
Convenience constructor.
DerbyMaxValueIncrementer(DataSource, String, String, String) - Constructor for class org.springframework.jdbc.support.incrementer.DerbyMaxValueIncrementer
Convenience constructor.
DerbyTableMetaDataProvider - Class in org.springframework.jdbc.core.metadata
The Derby specific implementation of the TableMetaDataProvider.
DerbyTableMetaDataProvider(DatabaseMetaData) - Constructor for class org.springframework.jdbc.core.metadata.DerbyTableMetaDataProvider
DESCRIPTION_ELEMENT - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
DescriptiveResource - Class in org.springframework.core.io
Simple Resource implementation that holds a resource description but does not point to an actually readable resource.
DescriptiveResource(String) - Constructor for class org.springframework.core.io.DescriptiveResource
Create a new DescriptiveResource.
deserializeState(Serializable) - Method in class org.springframework.mock.web.MockHttpSession
Deserialize the attributes of this session from a state object created by MockHttpSession.serializeState().
DestinationResolutionException - Exception in org.springframework.jms.support.destination
Thrown by a DestinationResolver when it cannot resolve a destination name.
DestinationResolutionException(String) - Constructor for exception org.springframework.jms.support.destination.DestinationResolutionException
Create a new DestinationResolutionException.
DestinationResolutionException(String, Throwable) - Constructor for exception org.springframework.jms.support.destination.DestinationResolutionException
Create a new DestinationResolutionException.
DestinationResolver - Interface in org.springframework.jms.support.destination
Strategy interface for resolving JMS destinations.
destroy() - Method in class org.springframework.aop.framework.autoproxy.target.AbstractBeanFactoryBasedTargetSourceCreator
Destroys the internal BeanFactory on shutdown of the TargetSourceCreator.
destroy() - Method in class org.springframework.aop.target.CommonsPoolTargetSource
Closes the underlying ObjectPool when destroying this object.
destroy() - Method in class org.springframework.aop.target.ThreadLocalTargetSource
Dispose of targets if necessary; clear ThreadLocal.
destroy() - Method in class org.springframework.beans.factory.config.AbstractFactoryBean
Destroy the singleton instance, if any.
destroy() - Method in interface org.springframework.beans.factory.DisposableBean
Invoked by a BeanFactory on destruction of a singleton.
destroy() - Method in class org.springframework.beans.factory.wiring.BeanConfigurerSupport
Release references to the BeanFactory and BeanWiringInfoResolver when the container is destroyed.
destroy() - Method in class org.springframework.cache.ehcache.EhCacheManagerFactoryBean
destroy() - Method in class org.springframework.context.support.AbstractApplicationContext
DisposableBean callback for destruction of this instance.
destroy() - Method in class org.springframework.context.weaving.DefaultContextLoadTimeWeaver
destroy() - Method in class org.springframework.ejb.access.SimpleRemoteSlsbInvokerInterceptor
Remove the cached session bean instance, if necessary.
destroy() - Method in class org.springframework.http.client.CommonsClientHttpRequestFactory
Shutdown hook that closes the underlying HttpConnectionManager's connection pool, if any.
destroy() - Method in class org.springframework.jca.cci.connection.SingleConnectionFactory
Close the underlying Connection.
destroy() - Method in class org.springframework.jca.endpoint.GenericMessageEndpointManager
Deactivates the message endpoint, preparing it for shutdown.
destroy() - Method in class org.springframework.jca.support.ResourceAdapterFactoryBean
Stops the ResourceAdapter.
destroy() - Method in class org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactoryBean
destroy() - Method in class org.springframework.jdbc.datasource.SingleConnectionDataSource
Close the underlying Connection.
destroy() - Method in class org.springframework.jms.connection.SingleConnectionFactory
Close the underlying shared connection.
destroy() - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Calls AbstractJmsListeningContainer.shutdown() when the BeanFactory destroys the container instance.
destroy() - Method in class org.springframework.jmx.access.MBeanClientInterceptor
destroy() - Method in class org.springframework.jmx.access.NotificationListenerRegistrar
Unregisters the specified NotificationListener.
destroy() - Method in class org.springframework.jmx.export.MBeanExporter
Unregisters all beans that this exported has exposed via JMX when the enclosing ApplicationContext is destroyed.
destroy() - Method in class org.springframework.jmx.support.ConnectorServerFactoryBean
Stop the JMXConnectorServer managed by an instance of this class.
destroy() - Method in class org.springframework.jmx.support.MBeanServerConnectionFactoryBean
Closes the underlying JMXConnector.
destroy() - Method in class org.springframework.jmx.support.MBeanServerFactoryBean
Unregisters the MBeanServer instance, if necessary.
destroy() - Method in class org.springframework.orm.hibernate3.AbstractSessionFactoryBean
Close the SessionFactory on bean factory shutdown.
destroy() - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Allows for schema export on shutdown.
destroy() - Method in class org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean
Close the PersistenceManagerFactory on bean factory shutdown.
destroy() - Method in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
Close the EntityManagerFactory on bean factory shutdown.
destroy() - Method in class org.springframework.remoting.jaxrpc.ServletEndpointSupport
Deprecated. This implementation of destroy is empty.
destroy() - Method in class org.springframework.remoting.jaxws.AbstractJaxWsServiceExporter
Stops all published endpoints, taking the web services offline.
destroy() - Method in class org.springframework.remoting.jaxws.SimpleHttpServerJaxWsServiceExporter
destroy() - Method in class org.springframework.remoting.rmi.JndiRmiServiceExporter
Unbind the RMI service from JNDI on bean factory shutdown.
destroy() - Method in class org.springframework.remoting.rmi.RmiRegistryFactoryBean
Unexport the RMI registry on bean factory shutdown, provided that this bean actually created a registry.
destroy() - Method in class org.springframework.remoting.rmi.RmiServiceExporter
Unbind the RMI service from the registry on bean factory shutdown.
destroy() - Method in class org.springframework.remoting.support.SimpleHttpServerFactoryBean
destroy() - Method in class org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor
destroy() - Method in class org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor
Calls shutdown when the BeanFactory destroys the task executor instance.
destroy() - Method in class org.springframework.scheduling.commonj.TimerManagerAccessor
Stops the underlying TimerManager (if not shared).
destroy() - Method in class org.springframework.scheduling.commonj.TimerManagerFactoryBean
Cancels all statically registered Timers on shutdown, and stops the underlying TimerManager (if not shared).
destroy() - Method in class org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
Calls shutdown when the BeanFactory destroys the task executor instance.
destroy() - Method in class org.springframework.scheduling.config.ScheduledTaskRegistrar
destroy() - Method in class org.springframework.scheduling.config.TaskExecutorFactoryBean
destroy() - Method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
Shut down the Quartz scheduler on bean factory shutdown, stopping all scheduled jobs.
destroy() - Method in class org.springframework.scheduling.quartz.SimpleThreadPoolTaskExecutor
destroy() - Method in class org.springframework.scheduling.timer.TimerFactoryBean
Deprecated. Cancel the Timer on bean factory shutdown, stopping all scheduled tasks.
destroy() - Method in class org.springframework.scheduling.timer.TimerTaskExecutor
Deprecated. Cancel the Timer on bean factory shutdown, stopping all scheduled tasks.
destroy() - Method in class org.springframework.scripting.support.ScriptFactoryPostProcessor
Destroy the inner bean factory (used for scripts) on shutdown.
destroy() - Method in class org.springframework.web.context.support.ServletContextScope
Invoke all registered destruction callbacks.
destroy() - Method in class org.springframework.web.filter.DelegatingFilterProxy
destroy() - Method in class org.springframework.web.filter.GenericFilterBean
Subclasses may override this to perform custom filter shutdown.
destroy() - Method in class org.springframework.web.portlet.context.PortletContextScope
Invoke all registered destruction callbacks.
destroy() - Method in class org.springframework.web.portlet.FrameworkPortlet
Close the ApplicationContext of this portlet.
destroy() - Method in class org.springframework.web.portlet.mvc.PortletWrappingController
destroy() - Method in class org.springframework.web.servlet.FrameworkServlet
Close the WebApplicationContext of this servlet.
destroy() - Method in class org.springframework.web.servlet.mvc.ServletWrappingController
Destroy the wrapped Servlet instance.
destroy() - Method in class org.springframework.web.servlet.view.ResourceBundleViewResolver
Close the bundle View factories on context shutdown.
destroy() - Method in class org.springframework.web.servlet.view.tiles2.TilesConfigurer
Removes the TilesContainer from this web application.
destroy() - Method in class org.springframework.web.servlet.view.XmlViewResolver
Close the view bean factory on context shutdown.
destroy() - Method in class org.springframework.web.struts.ContextLoaderPlugIn
Deprecated. Close the WebApplicationContext of the ActionServlet.
DESTROY_METHOD_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
destroyBean(String, Object) - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Destroy the given bean instance (usually a prototype instance obtained from this factory) according to its bean definition.
destroyBean(String, Object) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
destroyBean(String, Object, RootBeanDefinition) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Destroy the given bean instance (usually a prototype instance obtained from this factory) according to the given bean definition.
destroyBean(String, DisposableBean) - Method in class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
Destroy the given bean.
destroyBeans() - Method in class org.springframework.context.support.AbstractApplicationContext
Template method for destroying all beans that this context manages.
destroyDefinition(BeanFactory, String) - Method in class org.springframework.beans.factory.access.SingletonBeanFactoryLocator
Destroy definition in separate method so subclass may work with other definition types.
destroyDefinition(BeanFactory, String) - Method in class org.springframework.context.access.ContextSingletonBeanFactoryLocator
Overrides the default method to operate on an ApplicationContext, invoking ConfigurableApplicationContext.close().
destroyDelegate(Filter) - Method in class org.springframework.web.filter.DelegatingFilterProxy
Destroy the Filter delegate.
destroyInstance(T) - Method in class org.springframework.beans.factory.config.AbstractFactoryBean
Callback for destroying a singleton instance.
destroyObject(Object) - Method in class org.springframework.aop.target.CommonsPoolTargetSource
destroyPrototypeInstance(Object) - Method in class org.springframework.aop.target.AbstractPrototypeBasedTargetSource
Subclasses should call this method to destroy an obsolete prototype instance.
destroyScopedBean(String) - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Destroy the specified scoped bean in the current target scope, if any.
destroyScopedBean(String) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
destroySingleton(String) - Method in class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
Destroy the given bean.
destroySingletons() - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Destroy all singleton beans in this factory, including inner beans that have been registered as disposable.
destroySingletons() - Method in class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
destroySubcontext(String) - Method in class org.springframework.mock.jndi.SimpleNamingContext
destroySubcontext(Name) - Method in class org.springframework.mock.jndi.SimpleNamingContext
DESTRUCTION_CALLBACK_NAME_PREFIX - Static variable in class org.springframework.web.context.request.ServletRequestAttributes
Constant identifying the String prefixed to the name of a destruction callback when it is stored in a HttpSession.
DESTRUCTION_CALLBACK_NAME_PREFIX - Static variable in class org.springframework.web.portlet.context.PortletRequestAttributes
Constant identifying the String prefixed to the name of a destruction callback when it is stored in a PortletSession.
DestructionAwareBeanPostProcessor - Interface in org.springframework.beans.factory.config
Subinterface of BeanPostProcessor that adds a before-destruction callback.
DestructionCallbackBindingListener - Class in org.springframework.web.context.request
Adapter that implements the Servlet 2.3 HttpSessionBindingListener interface, wrapping a session destruction callback.
DestructionCallbackBindingListener(Runnable) - Constructor for class org.springframework.web.context.request.DestructionCallbackBindingListener
Create a new DestructionCallbackBindingListener for the given callback.
detachCopy(T) - Method in interface org.springframework.orm.jdo.JdoOperations
Detach a copy of the given persistent instance from the current JDO transaction, for use outside a JDO transaction (for example, as web form object).
detachCopy(T) - Method in class org.springframework.orm.jdo.JdoTemplate
detachCopyAll(Collection<T>) - Method in interface org.springframework.orm.jdo.JdoOperations
Detach copies of the given persistent instances from the current JDO transaction, for use outside a JDO transaction (for example, as web form objects).
detachCopyAll(Collection<T>) - Method in class org.springframework.orm.jdo.JdoTemplate
detectHandlerMethods(Class, String, RequestMapping) - Method in class org.springframework.web.portlet.mvc.annotation.DefaultAnnotationHandlerMapping
Derive portlet mode mappings from the handler's method-level mappings.
detectHandlers() - Method in class org.springframework.web.portlet.mvc.annotation.DefaultAnnotationHandlerMapping
Register all handlers specified in the Portlet mode map for the corresponding modes.
detectHandlers() - Method in class org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping
Register all handlers found in the current ApplicationContext.
detectPersistenceExceptionTranslators(ListableBeanFactory) - Method in class org.springframework.dao.support.PersistenceExceptionTranslationInterceptor
Detect all PersistenceExceptionTranslators in the given BeanFactory.
detectValidationMode(Resource) - Method in class org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Detects which kind of validation to perform on the XML file identified by the supplied Resource.
detectValidationMode(InputStream) - Method in class org.springframework.util.xml.XmlValidationModeDetector
Detect the validation mode for the XML document in the supplied InputStream.
determineActionBeanName(ActionMapping) - Method in class org.springframework.web.struts.DelegatingActionProxy
Deprecated. Determine the name of the Action bean, to be looked up in the WebApplicationContext.
determineActionBeanName(ActionMapping) - Static method in class org.springframework.web.struts.DelegatingActionUtils
Deprecated. Default implementation of Action bean determination, taking the mapping path and prepending the module prefix, if any.
determineActionBeanName(ActionMapping) - Method in class org.springframework.web.struts.DelegatingRequestProcessor
Deprecated. Determine the name of the Action bean, to be looked up in the WebApplicationContext.
determineActionBeanName(ActionMapping) - Method in class org.springframework.web.struts.DelegatingTilesRequestProcessor
Deprecated. Determine the name of the Action bean, to be looked up in the WebApplicationContext.
determineActivationSpecClass(ResourceAdapter) - Method in class org.springframework.jms.listener.endpoint.DefaultJmsActivationSpecFactory
This implementation guesses the ActivationSpec class name from the provider's class name: e.g.
determineActivationSpecClass(ResourceAdapter) - Method in class org.springframework.jms.listener.endpoint.StandardJmsActivationSpecFactory
Determine the ActivationSpec class for the given ResourceAdapter, if possible.
determineBeanNameFromAnnotation(AnnotatedBeanDefinition) - Method in class org.springframework.context.annotation.AnnotationBeanNameGenerator
Derive a bean name from one of the annotations on the class.
determineCandidateConstructors(Class<?>, String) - Method in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
determineCandidateConstructors(Class, String) - Method in class org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor
determineCandidateConstructors(Class, String) - Method in class org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter
determineCandidateConstructors(Class<?>, String) - Method in interface org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor
Determine the candidate constructors to use for the given bean.
determineConstructorsFromBeanPostProcessors(Class, String) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Determine candidate constructors to use for the given bean, checking all registered SmartInstantiationAwareBeanPostProcessors.
determineContextClass(ServletContext) - Method in class org.springframework.web.context.ContextLoader
Return the WebApplicationContext implementation class to use, either the default XmlWebApplicationContext or a custom context class if specified.
determineCurrentLookupKey() - Method in class org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
Determine the current lookup key.
determineCurrentLookupKey() - Method in class org.springframework.jdbc.datasource.lookup.IsolationLevelDataSourceRouter
determineDatabaseDialectClass(Database) - Method in class org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter
Determine the Hibernate database dialect class for the given target database.
determineDatabaseDictionary(Database) - Method in class org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter
Determine the OpenJPA database dictionary name for the given database.
determineDefaultLocale(HttpServletRequest) - Method in class org.springframework.web.servlet.i18n.CookieLocaleResolver
Determine the default locale for the given request, Called if no locale cookie has been found.
determineDefaultLocale(HttpServletRequest) - Method in class org.springframework.web.servlet.i18n.SessionLocaleResolver
Determine the default locale for the given request, Called if no locale session attribute has been found.
determineEncoding(HttpServletRequest) - Method in class org.springframework.web.multipart.commons.CommonsMultipartResolver
Determine the encoding for the given request.
determineEncoding(ActionRequest) - Method in class org.springframework.web.portlet.multipart.CommonsPortletMultipartResolver
Determine the encoding for the given request.
determineEncoding(HttpServletRequest) - Method in class org.springframework.web.util.UrlPathHelper
Determine the encoding for the given request.
determinePersistenceUnitInfo(PersistenceUnitManager) - Method in class org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean
Determine the PersistenceUnitInfo to use for the EntityManagerFactory created by this bean.
determinePrimaryCandidate(Map<String, Object>, DependencyDescriptor) - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
Determine the primary autowire candidate in the given set of beans.
determineRequiredStatus(Annotation) - Method in class org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor
Determine if the annotated field or method requires its dependency.
determineResourceUrl(HttpServletRequest) - Method in class org.springframework.web.servlet.ResourceServlet
Determine the URL of the target resource of this request.
determineRootDir(String) - Method in class org.springframework.core.io.support.PathMatchingResourcePatternResolver
Determine the root directory for the given location.
determineServiceLocatorExceptionConstructor(Class) - Method in class org.springframework.beans.factory.config.ServiceLocatorFactoryBean
Determine the constructor to use for the given service locator exception class.
determineStatusCode(HttpServletRequest, String) - Method in class org.springframework.web.servlet.handler.SimpleMappingExceptionResolver
Determine the HTTP status code to apply for the given error view.
determineTargetDatabaseName(Database) - Method in class org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter
Determine the EclipseLink target database name for the given database.
determineTargetDatabaseName(Database) - Method in class org.springframework.orm.jpa.vendor.TopLinkJpaVendorAdapter
Determine the TopLink target database name for the given database.
determineTargetDataSource() - Method in class org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
Retrieve the current target DataSource.
determineTimeout(TransactionDefinition) - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Determine the actual timeout to use for the given definition.
determineTransactionAttribute(AnnotatedElement) - Method in class org.springframework.transaction.annotation.AnnotationTransactionAttributeSource
Determine the transaction attribute for the given method or class.
determineTransactionManager(TransactionAttribute) - Method in class org.springframework.transaction.interceptor.TransactionAspectSupport
Determine the specific transaction manager to use for the given transaction.
determineUrlsForHandler(String) - Method in class org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping
Determine the URLs for the given handler bean.
determineUrlsForHandler(String) - Method in class org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping
Checks name and aliases of the given bean for URLs, starting with "/".
determineUrlsForHandler(String) - Method in class org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping
Checks for presence of the RequestMapping annotation on the handler class and on any of its methods.
determineUrlsForHandler(String) - Method in class org.springframework.web.servlet.mvc.support.AbstractControllerUrlHandlerMapping
This implementation delegates to AbstractControllerUrlHandlerMapping.buildUrlsForHandler(java.lang.String, java.lang.Class), provided that AbstractControllerUrlHandlerMapping.isEligibleForMapping(java.lang.String, java.lang.Class) returns true.
determineUrlsForHandlerMethods(Class<?>, boolean) - Method in class org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping
Derive URL mappings from the handler's method-level mappings.
determineUrlsForHandlerMethods(Class<?>) - Method in class org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping
Derive URL mappings from the handler's method-level mappings.
determineViewName(Exception, PortletRequest) - Method in class org.springframework.web.portlet.handler.SimpleMappingExceptionResolver
Determine the view name for the given exception, searching the "exceptionMappings", using the "defaultErrorView" as fallback.
determineViewName(Exception, HttpServletRequest) - Method in class org.springframework.web.servlet.handler.SimpleMappingExceptionResolver
Determine the view name for the given exception, searching the "exceptionMappings", using the "defaultErrorView" as fallback.
DigestUtils - Class in org.springframework.util
Miscellaneous methods for calculating digests.
DigestUtils() - Constructor for class org.springframework.util.DigestUtils
DIR_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
DirectFieldAccessor - Class in org.springframework.beans
PropertyAccessor implementation that directly accesses instance fields.
DirectFieldAccessor(Object) - Constructor for class org.springframework.beans.DirectFieldAccessor
Create a new DirectFieldAccessor for the given target object.
DirectFieldBindingResult - Class in org.springframework.validation
Special implementation of the Errors and BindingResult interfaces, supporting registration and evaluation of binding errors on value objects.
DirectFieldBindingResult(Object, String) - Constructor for class org.springframework.validation.DirectFieldBindingResult
Create a new DirectFieldBindingResult instance.
DirtiesContext - Annotation Type in org.springframework.test.annotation
Test annotation which indicates that the ApplicationContext associated with a test is dirty and should be closed: after the current test, when declared at the method level after each test method in the current test class, when declared at the class level with class mode set to AFTER_EACH_TEST_METHOD after the current test class, when declared at the class level with class mode set to AFTER_CLASS
DirtiesContext.ClassMode - Enum in org.springframework.test.annotation
Defines modes which determine how @DirtiesContext is interpreted when used to annotate a test class.
DirtiesContextTestExecutionListener - Class in org.springframework.test.context.support
TestExecutionListener which provides support for marking the ApplicationContext associated with a test as dirty for both test classes and test methods configured with the @DirtiesContext annotation.
DirtiesContextTestExecutionListener() - Constructor for class org.springframework.test.context.support.DirtiesContextTestExecutionListener
dirtyContext(TestContext) - Method in class org.springframework.test.context.support.DirtiesContextTestExecutionListener
Marks the application context of the supplied test context as dirty, and sets the REINJECT_DEPENDENCIES_ATTRIBUTE in the test context to true .
DISABLED_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
The name of the 'disabled' attribute.
disableFilters(Session) - Method in class org.springframework.orm.hibernate3.HibernateAccessor
Disable the specified filters on the given Session.
disableIndenting(Transformer) - Static method in class org.springframework.util.xml.TransformerUtils
Disable indenting for the supplied Transformer.
disassemble(Object) - Method in class org.springframework.orm.hibernate3.support.AbstractLobType
This implementation returns the passed-in value as-is.
DispatchActionSupport - Class in org.springframework.web.struts
Deprecated. as of Spring 3.0
DispatchActionSupport() - Constructor for class org.springframework.web.struts.DispatchActionSupport
Deprecated.
DispatcherPortlet - Class in org.springframework.web.portlet
Central dispatcher for use within the Portlet MVC framework, e.g.
DispatcherPortlet() - Constructor for class org.springframework.web.portlet.DispatcherPortlet
DispatcherServlet - Class in org.springframework.web.servlet
Central dispatcher for HTTP request handlers/controllers, e.g.
DispatcherServlet() - Constructor for class org.springframework.web.servlet.DispatcherServlet
DispatcherServletWebRequest - Class in org.springframework.web.servlet.handler
ServletWebRequest subclass that is aware of DispatcherServlet's request context, such as the Locale determined by the configured LocaleResolver.
DispatcherServletWebRequest(HttpServletRequest) - Constructor for class org.springframework.web.servlet.handler.DispatcherServletWebRequest
Create a new DispatcherServletWebRequest instance for the given request.
DispatcherServletWebRequest(HttpServletRequest, HttpServletResponse) - Constructor for class org.springframework.web.servlet.handler.DispatcherServletWebRequest
Create a new DispatcherServletWebRequest instance for the given request and response.
DISPLAY_VALUE_VARIABLE_NAME - Static variable in class org.springframework.web.servlet.tags.form.OptionTag
The name of the JSP variable used to expose the display value for this tag.
DisposableBean - Interface in org.springframework.beans.factory
Interface to be implemented by beans that want to release resources on destruction.
DisposableSqlTypeValue - Interface in org.springframework.jdbc.core
Subinterface of SqlTypeValue that adds a cleanup callback, to be invoked after the value has been set and the corresponding statement has been executed.
DO_NOT_PROXY - Static variable in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
Convenience constant for subclasses: Return value for "do not proxy".
doActionService(ActionRequest, ActionResponse) - Method in class org.springframework.web.portlet.DispatcherPortlet
Processes the actual dispatching to the handler for action requests.
doActionService(ActionRequest, ActionResponse) - Method in class org.springframework.web.portlet.FrameworkPortlet
Subclasses must implement this method to do the work of action request handling.
doAfterBody() - Method in class org.springframework.web.servlet.tags.EscapeBodyTag
doAutowireBean(Object) - Method in class org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor
Actually autowire the target bean after construction/passivation.
doBegin(Object, TransactionDefinition) - Method in class org.springframework.jca.cci.connection.CciLocalTransactionManager
doBegin(Object, TransactionDefinition) - Method in class org.springframework.jdbc.datasource.DataSourceTransactionManager
This implementation sets the isolation level but ignores the timeout.
doBegin(Object, TransactionDefinition) - Method in class org.springframework.jms.connection.JmsTransactionManager
doBegin(Object, TransactionDefinition) - Method in class org.springframework.orm.hibernate3.HibernateTransactionManager
doBegin(Object, TransactionDefinition) - Method in class org.springframework.orm.jdo.JdoTransactionManager
doBegin(Object, TransactionDefinition) - Method in class org.springframework.orm.jpa.JpaTransactionManager
doBegin(Object, TransactionDefinition) - Method in class org.springframework.transaction.jta.JtaTransactionManager
doBegin(Object, TransactionDefinition) - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Begin a new transaction with semantics according to the given transaction definition.
doBind(MutablePropertyValues) - Method in class org.springframework.validation.DataBinder
Actual implementation of the binding process, working with the passed-in MutablePropertyValues instance.
doBind(WebDataBinder, NativeWebRequest) - Method in class org.springframework.web.bind.annotation.support.HandlerMethodInvoker
doBind(MutablePropertyValues) - Method in class org.springframework.web.bind.WebDataBinder
This implementation performs a field default and marker check before delegating to the superclass binding process.
doCatch(Throwable) - Method in class org.springframework.web.servlet.tags.NestedPathTag
doCatch(Throwable) - Method in class org.springframework.web.servlet.tags.RequestContextAwareTag
doCleanupAfterCompletion(Object) - Method in class org.springframework.jca.cci.connection.CciLocalTransactionManager
doCleanupAfterCompletion(Object) - Method in class org.springframework.jdbc.datasource.DataSourceTransactionManager
doCleanupAfterCompletion(Object) - Method in class org.springframework.jms.connection.JmsTransactionManager
doCleanupAfterCompletion(Object) - Method in class org.springframework.orm.hibernate3.HibernateTransactionManager
doCleanupAfterCompletion(Object) - Method in class org.springframework.orm.jdo.JdoTransactionManager
doCleanupAfterCompletion(Object) - Method in class org.springframework.orm.jpa.JpaTransactionManager
doCleanupAfterCompletion(Object) - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Cleanup resources after transaction completion.
doClearAttributes(Map<String, Object>) - Method in class org.springframework.mock.web.portlet.MockPortletSession
doClose() - Method in class org.springframework.context.support.AbstractApplicationContext
Actually performs context closing: publishes a ContextClosedEvent and destroys the singletons in the bean factory of this application context.
doCommit(DefaultTransactionStatus) - Method in class org.springframework.jca.cci.connection.CciLocalTransactionManager
doCommit(DefaultTransactionStatus) - Method in class org.springframework.jdbc.datasource.DataSourceTransactionManager
doCommit(DefaultTransactionStatus) - Method in class org.springframework.jms.connection.JmsTransactionManager
doCommit(DefaultTransactionStatus) - Method in class org.springframework.orm.hibernate3.HibernateTransactionManager
doCommit(DefaultTransactionStatus) - Method in class org.springframework.orm.jdo.JdoTransactionManager
doCommit(DefaultTransactionStatus) - Method in class org.springframework.orm.jpa.JpaTransactionManager
doCommit(DefaultTransactionStatus) - Method in class org.springframework.transaction.jta.JtaTransactionManager
doCommit(DefaultTransactionStatus) - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Perform an actual commit of the given transaction.
doConvertFromMessage(Message) - Method in class org.springframework.jms.core.JmsTemplate
Extract the content from the given JMS message.
doCreateBean(String, RootBeanDefinition, Object[]) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Actually create the specified bean.
doCreateConnection() - Method in class org.springframework.jca.cci.connection.SingleConnectionFactory
Create a CCI Connection via this template's ConnectionFactory.
doCreateConnection() - Method in class org.springframework.jms.connection.SingleConnectionFactory
Create a JMS Connection via this template's ConnectionFactory.
doCreateConnection() - Method in class org.springframework.jms.connection.SingleConnectionFactory102
Deprecated. This implementation overrides the superclass method to use JMS 1.0.2 API.
doCreateConnection(String, String) - Method in class org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter
This implementation delegates to the createConnection(username, password) method of the target ConnectionFactory, passing in the specified user credentials.
doCreateProducer(Session, Destination) - Method in class org.springframework.jms.core.JmsTemplate
Create a raw JMS MessageProducer for the given Session and Destination.
doCreateProducer(Session, Destination) - Method in class org.springframework.jms.core.JmsTemplate102
Deprecated. This implementation overrides the superclass method to use JMS 1.0.2 API.
doCreateQueueConnection(String, String) - Method in class org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter
This implementation delegates to the createQueueConnection(username, password) method of the target QueueConnectionFactory, passing in the specified user credentials.
doCreateTopicConnection(String, String) - Method in class org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter
This implementation delegates to the createTopicConnection(username, password) method of the target TopicConnectionFactory, passing in the specified user credentials.
DocumentDefaultsDefinition - Class in org.springframework.beans.factory.xml
Simple JavaBean that holds the defaults specified at the <beans> level in a standard Spring XML bean definition document: default-lazy-init, default-autowire, etc.
DocumentDefaultsDefinition() - Constructor for class org.springframework.beans.factory.xml.DocumentDefaultsDefinition
DocumentLoader - Interface in org.springframework.beans.factory.xml
Strategy interface for loading an XML Document.
doDelete(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.FrameworkServlet
Delegate DELETE requests to FrameworkServlet.processRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse).
doDispatch(RenderRequest, RenderResponse) - Method in class org.springframework.web.portlet.FrameworkPortlet
Delegate render requests to processRequest/doRenderService.
doDispatch(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.DispatcherServlet
Process the actual dispatching to the handler.
doEndTag() - Method in class org.springframework.web.servlet.tags.BindErrorsTag
doEndTag() - Method in class org.springframework.web.servlet.tags.BindTag
doEndTag() - Method in class org.springframework.web.servlet.tags.EvalTag
doEndTag() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementBodyTag
If rendering, flush any buffered BodyContent or, if no BodyContent is supplied, render the default content.
doEndTag() - Method in class org.springframework.web.servlet.tags.form.FormTag
Closes the 'form' block tag and removes the form object name from the PageContext.
doEndTag() - Method in class org.springframework.web.servlet.tags.form.LabelTag
Close the 'label' tag.
doEndTag() - Method in class org.springframework.web.servlet.tags.form.SelectTag
Closes any block tag that might have been opened when using nested options.
doEndTag() - Method in class org.springframework.web.servlet.tags.NestedPathTag
Reset any previous nestedPath value.
doEndTag() - Method in class org.springframework.web.servlet.tags.ParamTag
doEndTag() - Method in class org.springframework.web.servlet.tags.UrlTag
doesNotContain(String, String, String) - Static method in class org.springframework.util.Assert
Assert that the given text does not contain the given substring.
doesNotContain(String, String) - Static method in class org.springframework.util.Assert
Assert that the given text does not contain the given substring.
doesNotHoldNonDefaultSession() - Method in class org.springframework.orm.hibernate3.SessionHolder
doEvaluate(String, Class, FunctionMapper) - Method in class org.springframework.mock.web.MockExpressionEvaluator
doEventService(EventRequest, EventResponse) - Method in class org.springframework.web.portlet.DispatcherPortlet
Processes the actual dispatching to the handler for event requests.
doEventService(EventRequest, EventResponse) - Method in class org.springframework.web.portlet.FrameworkPortlet
Subclasses must implement this method to do the work of event request handling.
doExecute(Runnable) - Method in class org.springframework.core.task.SimpleAsyncTaskExecutor
Template method for the actual execution of a task.
doExecute(InteractionSpec, Record, Record, RecordExtractor<T>) - Method in class org.springframework.jca.cci.core.CciTemplate
Execute the specified interaction on an EIS with CCI.
doExecute(SqlParameterSource) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Method that provides execution of the call using the passed in SqlParameterSource
doExecute(Object[]) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Method that provides execution of the call using the passed in array of parameters
doExecute(Map<String, ?>) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Method that provides execution of the call using the passed in Map of parameters
doExecute(Map<String, Object>) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Method that provides execution of the insert using the passed in Map of parameters
doExecute(SqlParameterSource) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Method that provides execution of the insert using the passed in SqlParameterSource
doExecute(HibernateCallback<T>, boolean, boolean) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
Execute the action specified by the given action object within a Session.
doExecute(URI, HttpMethod, RequestCallback, ResponseExtractor<T>) - Method in class org.springframework.web.client.RestTemplate
Execute the given method on the provided URI.
doExecuteAndReturnKey(Map<String, Object>) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Method that provides execution of the insert using the passed in Map of parameters and returning a generated key
doExecuteAndReturnKey(SqlParameterSource) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Method that provides execution of the insert using the passed in SqlParameterSource and returning a generated key
doExecuteAndReturnKeyHolder(Map<String, Object>) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Method that provides execution of the insert using the passed in Map of parameters and returning all generated keys
doExecuteAndReturnKeyHolder(SqlParameterSource) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Method that provides execution of the insert using the passed in SqlParameterSource and returning all generated keys
doExecuteBatch(Map<String, Object>[]) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Method that provides execution of a batch insert using the passed in Maps of parameters
doExecuteBatch(SqlParameterSource[]) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Method that provides execution of a batch insert using the passed in array of SqlParameterSource
doExecuteListener(Session, Message) - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Execute the specified listener, committing or rolling back the transaction afterwards (if necessary).
doExecuteRequest(Session, Queue, Message) - Method in class org.springframework.jms.remoting.JmsInvokerClientInterceptor
Actually execute the given request, sending the invoker request message to the specified target queue and waiting for a corresponding response.
doExecuteRequest(HttpInvokerClientConfiguration, ByteArrayOutputStream) - Method in class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
Execute a request to send the given serialized remote invocation.
doExecuteRequest(HttpInvokerClientConfiguration, ByteArrayOutputStream) - Method in class org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor
Execute the given request through Commons HttpClient.
doExecuteRequest(HttpInvokerClientConfiguration, ByteArrayOutputStream) - Method in class org.springframework.remoting.httpinvoker.SimpleHttpInvokerRequestExecutor
Execute the given request through a standard J2SE HttpURLConnection.
doFail() - Method in class org.springframework.test.AssertThrows
Deprecated. Template method called when the test fails; i.e.
doFilter(ServletRequest, ServletResponse) - Method in class org.springframework.mock.web.MockFilterChain
Records the request and response.
doFilter(ServletRequest, ServletResponse) - Method in class org.springframework.mock.web.PassThroughFilterChain
Pass the call on to the Filter/Servlet.
doFilter(ServletRequest, ServletResponse, FilterChain) - Method in class org.springframework.web.filter.DelegatingFilterProxy
doFilter(ServletRequest, ServletResponse, FilterChain) - Method in class org.springframework.web.filter.OncePerRequestFilter
This doFilter implementation stores a request attribute for "already filtered", proceeding without filtering again if the attribute is already there.
doFilterInternal(HttpServletRequest, HttpServletResponse, FilterChain) - Method in class org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
doFilterInternal(HttpServletRequest, HttpServletResponse, FilterChain) - Method in class org.springframework.orm.jdo.support.OpenPersistenceManagerInViewFilter
doFilterInternal(HttpServletRequest, HttpServletResponse, FilterChain) - Method in class org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter
doFilterInternal(HttpServletRequest, HttpServletResponse, FilterChain) - Method in class org.springframework.web.filter.AbstractRequestLoggingFilter
Forwards the request to the next filter in the chain and delegates down to the subclasses to perform the actual request logging both before and after the request is processed.
doFilterInternal(HttpServletRequest, HttpServletResponse, FilterChain) - Method in class org.springframework.web.filter.CharacterEncodingFilter
doFilterInternal(HttpServletRequest, HttpServletResponse, FilterChain) - Method in class org.springframework.web.filter.HiddenHttpMethodFilter
doFilterInternal(HttpServletRequest, HttpServletResponse, FilterChain) - Method in class org.springframework.web.filter.OncePerRequestFilter
Same contract as for doFilter, but guaranteed to be just invoked once per request.
doFilterInternal(HttpServletRequest, HttpServletResponse, FilterChain) - Method in class org.springframework.web.filter.RequestContextFilter
doFilterInternal(HttpServletRequest, HttpServletResponse, FilterChain) - Method in class org.springframework.web.filter.ShallowEtagHeaderFilter
doFilterInternal(HttpServletRequest, HttpServletResponse, FilterChain) - Method in class org.springframework.web.multipart.support.MultipartFilter
Check for a multipart request via this filter's MultipartResolver, and wrap the original request with a MultipartHttpServletRequest if appropriate.
doFinally() - Method in class org.springframework.web.servlet.tags.BindErrorsTag
doFinally() - Method in class org.springframework.web.servlet.tags.BindTag
doFinally() - Method in class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
Disposes of the BindStatus instance.
doFinally() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementBodyTag
Clean up any attributes and stored resources.
doFinally() - Method in class org.springframework.web.servlet.tags.form.FormTag
Clears the stored TagWriter.
doFinally() - Method in class org.springframework.web.servlet.tags.form.LabelTag
Disposes of the TagWriter instance.
doFinally() - Method in class org.springframework.web.servlet.tags.form.SelectTag
Clears the TagWriter that might have been left over when using nested options.
doFinally() - Method in class org.springframework.web.servlet.tags.NestedPathTag
doFinally() - Method in class org.springframework.web.servlet.tags.RequestContextAwareTag
doFindMatchingFileSystemResources(File, String) - Method in class org.springframework.core.io.support.PathMatchingResourcePatternResolver
Find all resources in the file system that match the given location pattern via the Ant-style PathMatcher.
doFindMatchingMethod(Object[]) - Method in class org.springframework.beans.support.ArgumentConvertingMethodInvoker
Actually find a method with matching parameter type, i.e.
doFindPathMatchingFileResources(Resource, String) - Method in class org.springframework.core.io.support.PathMatchingResourcePatternResolver
Find all resources in the file system that match the given location pattern via the Ant-style PathMatcher.
doFindPathMatchingFileResources(Resource, String) - Method in class org.springframework.web.context.support.ServletContextResourcePatternResolver
Overridden version which checks for ServletContextResource and uses ServletContext.getResourcePaths to find matching resources below the web application root directory.
doFindPathMatchingFileResources(Resource, String) - Method in class org.springframework.web.portlet.context.PortletContextResourcePatternResolver
Overridden version which checks for PortletContextResource and uses PortletContext.getResourcePaths to find matching resources below the web application root directory.
doFindPathMatchingJarResources(Resource, String) - Method in class org.springframework.core.io.support.PathMatchingResourcePatternResolver
Find all resources in jar files that match the given location pattern via the Ant-style PathMatcher.
doGet(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.FrameworkServlet
Delegate GET requests to processRequest/doService.
doGet(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.ResourceServlet
Determine the URL of the target resource and include it.
doGet(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.ViewRendererServlet
doGetBean(String, Class<T>, Object[], boolean) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Return an instance, which may be shared or independent, of the specified bean.
doGetBundle(String, Locale) - Method in class org.springframework.context.support.ResourceBundleMessageSource
Obtain the resource bundle for the given basename and Locale.
doGetConnection(ConnectionFactory) - Static method in class org.springframework.jca.cci.connection.ConnectionFactoryUtils
Actually obtain a CCI Connection from the given ConnectionFactory.
doGetConnection(ConnectionSpec) - Method in class org.springframework.jca.cci.connection.ConnectionSpecConnectionFactoryAdapter
This implementation delegates to the getConnection(ConnectionSpec) method of the target ConnectionFactory, passing in the specified user credentials.
doGetConnection(DataSource) - Static method in class org.springframework.jdbc.datasource.DataSourceUtils
Actually obtain a JDBC Connection from the given DataSource.
doGetConnection(String, String) - Method in class org.springframework.jdbc.datasource.IsolationLevelDataSourceAdapter
Applies the current isolation level value and read-only flag to the returned Connection.
doGetConnection(String, String) - Method in class org.springframework.jdbc.datasource.UserCredentialsDataSourceAdapter
This implementation delegates to the getConnection(username, password) method of the target DataSource, passing in the specified user credentials.
doGetConnection(String, String) - Method in class org.springframework.jdbc.datasource.WebSphereDataSourceAdapter
Builds a WebSphere JDBCConnectionSpec object for the current settings and calls WSDataSource.getConnection(JDBCConnectionSpec).
doGetJtaTransaction(UserTransaction) - Method in class org.springframework.transaction.jta.JtaTransactionManager
Get a JTA transaction object for the given current UserTransaction.
doGetNativeConnection(Connection) - Method in class org.springframework.jdbc.support.nativejdbc.C3P0NativeJdbcExtractor
Retrieve the Connection via C3P0's rawConnectionOperation API, using the getRawConnection as callback to get access to the raw Connection (which is otherwise not directly supported by C3P0).
doGetNativeConnection(Connection) - Method in class org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor
doGetNativeConnection(Connection) - Method in class org.springframework.jdbc.support.nativejdbc.JBossNativeJdbcExtractor
Retrieve the Connection via JBoss' getUnderlyingConnection method.
doGetNativeConnection(Connection) - Method in class org.springframework.jdbc.support.nativejdbc.Jdbc4NativeJdbcExtractor
doGetNativeConnection(Connection) - Method in class org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
Not able to unwrap: return passed-in Connection.
doGetNativeConnection(Connection) - Method in class org.springframework.jdbc.support.nativejdbc.WebLogicNativeJdbcExtractor
Retrieve the Connection via WebLogic's getVendorConnection method.
doGetNativeConnection(Connection) - Method in class org.springframework.jdbc.support.nativejdbc.WebSphereNativeJdbcExtractor
Retrieve the Connection via WebSphere's getNativeConnection method.
doGetPersistenceManager(PersistenceManagerFactory, boolean) - Static method in class org.springframework.orm.jdo.PersistenceManagerFactoryUtils
Obtain a JDO PersistenceManager via the given factory.
doGetSession(SessionFactory, boolean) - Static method in class org.springframework.orm.hibernate3.SessionFactoryUtils
Get a Hibernate Session for the given SessionFactory.
doGetTransaction() - Method in class org.springframework.jca.cci.connection.CciLocalTransactionManager
doGetTransaction() - Method in class org.springframework.jdbc.datasource.DataSourceTransactionManager
doGetTransaction() - Method in class org.springframework.jms.connection.JmsTransactionManager
doGetTransaction() - Method in class org.springframework.orm.hibernate3.HibernateTransactionManager
doGetTransaction() - Method in class org.springframework.orm.jdo.JdoTransactionManager
doGetTransaction() - Method in class org.springframework.orm.jpa.JpaTransactionManager
doGetTransaction() - Method in class org.springframework.transaction.jta.JtaTransactionManager
This implementation returns a JtaTransactionObject instance for the JTA UserTransaction.
doGetTransaction() - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Return a transaction object for the current transaction state.
doGetTransactionalEntityManager(EntityManagerFactory, Map) - Static method in class org.springframework.orm.jpa.EntityManagerFactoryUtils
Obtain a JPA EntityManager from the given factory.
doGetTransactionalSession(ConnectionFactory, ConnectionFactoryUtils.ResourceFactory) - Static method in class org.springframework.jms.connection.ConnectionFactoryUtils
Obtain a JMS Session that is synchronized with the current transaction, if any.
doGetTransactionalSession(ConnectionFactory, ConnectionFactoryUtils.ResourceFactory, boolean) - Static method in class org.springframework.jms.connection.ConnectionFactoryUtils
Obtain a JMS Session that is synchronized with the current transaction, if any.
doHandle(PortletRequest, PortletResponse, Object) - Method in class org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter
doInCallableStatement(CallableStatement) - Method in interface org.springframework.jdbc.core.CallableStatementCallback
Gets called by JdbcTemplate.execute with an active JDBC CallableStatement.
doInConnection(Connection, ConnectionFactory) - Method in interface org.springframework.jca.cci.core.ConnectionCallback
Gets called by CciTemplate.execute with an active CCI Connection.
doInConnection(Connection) - Method in interface org.springframework.jdbc.core.ConnectionCallback
Gets called by JdbcTemplate.execute with an active JDBC Connection.
doInContext(Context) - Method in interface org.springframework.jndi.JndiCallback
Do something with the given JNDI context.
doInHibernate(Session) - Method in interface org.springframework.orm.hibernate3.HibernateCallback
Gets called by HibernateTemplate.execute with an active Hibernate Session.
doInInteraction(Interaction, ConnectionFactory) - Method in interface org.springframework.jca.cci.core.InteractionCallback
Gets called by CciTemplate.execute with an active CCI Interaction.
doInitBody() - Method in class org.springframework.web.servlet.tags.EscapeBodyTag
doInitBody() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementBodyTag
doInitialize() - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Register any invokers within this container.
doInitialize() - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Creates the specified number of concurrent consumers, in the form of a JMS Session plus associated MessageConsumer running in a separate thread.
doInitialize() - Method in class org.springframework.jms.listener.SimpleMessageListenerContainer
Creates the specified number of concurrent consumers, in the form of a JMS Session plus associated MessageConsumer.
doInJdo(PersistenceManager) - Method in interface org.springframework.orm.jdo.JdoCallback
Gets called by JdoTemplate.execute with an active JDO PersistenceManager.
doInJms(Session, QueueBrowser) - Method in interface org.springframework.jms.core.BrowserCallback
Perform operations on the given Session and QueueBrowser.
doInJms(Session, MessageProducer) - Method in interface org.springframework.jms.core.ProducerCallback
Perform operations on the given Session and MessageProducer.
doInJms(Session) - Method in interface org.springframework.jms.core.SessionCallback
Execute any number of operations against the supplied JMS Session, possibly returning a result.
doInJpa(EntityManager) - Method in interface org.springframework.orm.jpa.JpaCallback
Gets called by JpaTemplate.execute with an active JPA EntityManager.
doInPreparedStatement(PreparedStatement) - Method in interface org.springframework.jdbc.core.PreparedStatementCallback
Gets called by JdbcTemplate.execute with an active JDBC PreparedStatement.
doInPreparedStatement(PreparedStatement) - Method in class org.springframework.jdbc.core.support.AbstractLobCreatingPreparedStatementCallback
doInSqlMapClient(SqlMapExecutor) - Method in interface org.springframework.orm.ibatis.SqlMapClientCallback
Gets called by SqlMapClientTemplate.execute with an active SqlMapExecutor.
doInStatement(Statement) - Method in interface org.springframework.jdbc.core.StatementCallback
Gets called by JdbcTemplate.execute with an active JDBC Statement.
doInTransaction(TransactionStatus) - Method in interface org.springframework.transaction.support.TransactionCallback
Gets called by TransactionTemplate.execute(org.springframework.transaction.support.TransactionCallback) within a transactional context.
doInTransaction(TransactionStatus) - Method in class org.springframework.transaction.support.TransactionCallbackWithoutResult
doInTransactionWithoutResult(TransactionStatus) - Method in class org.springframework.transaction.support.TransactionCallbackWithoutResult
Gets called by TransactionTemplate.execute within a transactional context.
doInvoke(MethodInvocation) - Method in class org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor
Perform the given invocation on the current EJB home.
doInvoke(MethodInvocation) - Method in class org.springframework.ejb.access.SimpleRemoteSlsbInvokerInterceptor
This implementation "creates" a new EJB instance for each invocation.
doInvoke(MethodInvocation) - Method in class org.springframework.jmx.access.MBeanClientInterceptor
Route the invocation to the configured managed resource.
doInvoke(HessianSkeleton, InputStream, OutputStream) - Method in class org.springframework.remoting.caucho.HessianExporter
Actually invoke the skeleton with the given streams.
doInvoke(MethodInvocation) - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Perform a JAX-RPC service invocation based on the given method invocation.
doInvoke(MethodInvocation, Remote) - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Perform a JAX-RPC service invocation on the given port stub.
doInvoke(MethodInvocation) - Method in class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
Perform a JAX-WS service invocation based on the given method invocation.
doInvoke(MethodInvocation, Object) - Method in class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
Perform a JAX-WS service invocation on the given port stub.
doInvoke(MethodInvocation, Object) - Method in class org.springframework.remoting.rmi.JndiRmiClientInterceptor
Perform the given invocation on the given RMI stub.
doInvoke(MethodInvocation, RmiInvocationHandler) - Method in class org.springframework.remoting.rmi.JndiRmiClientInterceptor
Apply the given AOP method invocation to the given RmiInvocationHandler.
doInvoke(MethodInvocation, Remote) - Method in class org.springframework.remoting.rmi.RmiClientInterceptor
Perform the given invocation on the given RMI stub.
doInvoke(MethodInvocation, RmiInvocationHandler) - Method in class org.springframework.remoting.rmi.RmiClientInterceptor
Apply the given AOP method invocation to the given RmiInvocationHandler.
doInvoke(MethodInvocation, Remote) - Static method in class org.springframework.remoting.rmi.RmiClientInterceptorUtils
Deprecated. as of Spring 2.5, in favor of RmiClientInterceptorUtils.invokeRemoteMethod(org.aopalliance.intercept.MethodInvocation, java.lang.Object)
doInvokeListener(SessionAwareMessageListener, Session, Message) - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Invoke the specified listener as Spring SessionAwareMessageListener, exposing a new JMS Session (potentially with its own transaction) to the listener if demanded.
doInvokeListener(MessageListener, Message) - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Invoke the specified listener as standard JMS MessageListener.
doJtaBegin(JtaTransactionObject, TransactionDefinition) - Method in class org.springframework.transaction.jta.JtaTransactionManager
Perform a JTA begin on the JTA UserTransaction or TransactionManager.
doJtaBegin(JtaTransactionObject, TransactionDefinition) - Method in class org.springframework.transaction.jta.OC4JJtaTransactionManager
doJtaBegin(JtaTransactionObject, TransactionDefinition) - Method in class org.springframework.transaction.jta.WebLogicJtaTransactionManager
doJtaResume(JtaTransactionObject, Object) - Method in class org.springframework.transaction.jta.JtaTransactionManager
Perform a JTA resume on the JTA TransactionManager.
doJtaResume(JtaTransactionObject, Object) - Method in class org.springframework.transaction.jta.WebLogicJtaTransactionManager
doJtaSuspend(JtaTransactionObject) - Method in class org.springframework.transaction.jta.JtaTransactionManager
Perform a JTA suspend on the JTA TransactionManager.
doLoad(Properties, Reader) - Method in class org.springframework.util.DefaultPropertiesPersister
doLoadBeanDefinitions(InputSource, Resource) - Method in class org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Actually load bean definitions from the specified XML file.
doMatch(String, String, boolean, Map<String, String>) - Method in class org.springframework.util.AntPathMatcher
Actually match the given path against the given pattern.
DomUtils - Class in org.springframework.util.xml
Convenience methods for working with the DOM API, in particular for working with DOM Nodes and DOM Elements.
DomUtils() - Constructor for class org.springframework.util.xml.DomUtils
dontIgnore(IMessage.Kind) - Method in class org.springframework.aop.aspectj.AspectJWeaverMessageHandler
doOptions(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.FrameworkServlet
Delegate OPTIONS requests to FrameworkServlet.processRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), if desired.
doParse(Element, ParserContext, BeanDefinitionBuilder) - Method in class org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser
Parse the supplied Element and populate the supplied BeanDefinitionBuilder as required.
doParse(Element, ParserContext, BeanDefinitionBuilder) - Method in class org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
Parse the supplied Element and populate the supplied BeanDefinitionBuilder as required.
doParse(Element, BeanDefinitionBuilder) - Method in class org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
Parse the supplied Element and populate the supplied BeanDefinitionBuilder as required.
doParse(Element, ParserContext, BeanDefinitionBuilder) - Method in class org.springframework.scheduling.config.ExecutorBeanDefinitionParser
doParse(Element, ParserContext, BeanDefinitionBuilder) - Method in class org.springframework.scheduling.config.ScheduledTasksBeanDefinitionParser
doParse(Element, BeanDefinitionBuilder) - Method in class org.springframework.scheduling.config.SchedulerBeanDefinitionParser
doParseExpression(String, ParserContext) - Method in class org.springframework.expression.common.TemplateAwareExpressionParser
Actually parse the expression string and return an Expression object.
doParseExpression(String, ParserContext) - Method in class org.springframework.expression.spel.standard.SpelExpressionParser
doPerform(ComponentContext, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.tiles.ComponentControllerSupport
Deprecated. Perform the preparation for the component, allowing for any Exception to be thrown.
doPost(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.FrameworkServlet
Delegate POST requests to FrameworkServlet.processRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse).
doPost(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.ViewRendererServlet
doProceed(MethodInvocation) - Method in class org.springframework.aop.support.DelegatePerTargetObjectIntroductionInterceptor
Proceed with the supplied MethodInterceptor.
doProceed(MethodInvocation) - Method in class org.springframework.aop.support.DelegatingIntroductionInterceptor
Proceed with the supplied MethodInterceptor.
doPut(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.FrameworkServlet
Delegate PUT requests to FrameworkServlet.processRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse).
doReadRemoteInvocation(ObjectInputStream) - Method in class org.springframework.remoting.rmi.RemoteInvocationSerializingExporter
Perform the actual reading of an invocation result object from the given ObjectInputStream.
doReadRemoteInvocationResult(ObjectInputStream) - Method in class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
Perform the actual reading of an invocation object from the given ObjectInputStream.
doReceive(Session, Destination, String) - Method in class org.springframework.jms.core.JmsTemplate
Receive a JMS message.
doReceive(Session, MessageConsumer) - Method in class org.springframework.jms.core.JmsTemplate
Actually receive a JMS message.
doReceiveAndExecute(Object, Session, MessageConsumer, TransactionStatus) - Method in class org.springframework.jms.listener.AbstractPollingMessageListenerContainer
Actually execute the listener for a message received from the given consumer, fetching all requires resources and invoking the listener.
doRegister(Object, ObjectName) - Method in class org.springframework.jmx.support.MBeanRegistrationSupport
Actually register the MBean with the server.
doRegisterAfterCompletionWithJtaTransaction(JtaTransactionObject, List<TransactionSynchronization>) - Method in class org.springframework.transaction.jta.JtaTransactionManager
Register a JTA synchronization on the JTA TransactionManager, for calling afterCompletion on the given Spring TransactionSynchronizations.
doRegisterAfterCompletionWithJtaTransaction(JtaTransactionObject, List<TransactionSynchronization>) - Method in class org.springframework.transaction.jta.WebSphereUowTransactionManager
Registers the synchronizations as interposed JTA Synchronization on the UOWManager.
doReleaseBean(Object) - Method in class org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor
Actually release the BeanFactoryReference for the given target bean.
doReleaseConnection(Connection, ConnectionFactory) - Static method in class org.springframework.jca.cci.connection.ConnectionFactoryUtils
Actually close the given Connection, obtained from the given ConnectionFactory.
doReleaseConnection(Connection, DataSource) - Static method in class org.springframework.jdbc.datasource.DataSourceUtils
Actually close the given Connection, obtained from the given DataSource.
doReleasePersistenceManager(PersistenceManager, PersistenceManagerFactory) - Static method in class org.springframework.orm.jdo.PersistenceManagerFactoryUtils
Actually release a PersistenceManager for the given factory.
doRender(View, Map, PortletRequest, MimeResponse) - Method in class org.springframework.web.portlet.DispatcherPortlet
Actually render the given view.
doRender(Map<String, Object>, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.freemarker.FreeMarkerView
Render the FreeMarker view to the given response, using the given model map which contains the complete template model to use.
doRender(Context, HttpServletResponse) - Method in class org.springframework.web.servlet.view.velocity.VelocityLayoutView
Overrides the normal rendering process in order to pre-process the Context, merging it with the screen template into a single value (identified by the value of screenContentKey).
doRender(Context, HttpServletResponse) - Method in class org.springframework.web.servlet.view.velocity.VelocityView
Render the Velocity view to the given response, using the given Velocity context which contains the complete template model to use.
doRenderService(RenderRequest, RenderResponse) - Method in class org.springframework.web.portlet.DispatcherPortlet
Processes the actual dispatching to the handler for render requests.
doRenderService(RenderRequest, RenderResponse) - Method in class org.springframework.web.portlet.FrameworkPortlet
Subclasses must implement this method to do the work of render request handling.
doRescheduleTask(Object) - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Reschedule the given task object immediately.
doRescheduleTask(Object) - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Re-executes the given task via this listener container's TaskExecutor.
doResolveDependency(DependencyDescriptor, Class<?>, String, Set<String>, TypeConverter) - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
doResolveException(PortletRequest, MimeResponse, Object, Exception) - Method in class org.springframework.web.portlet.handler.AbstractHandlerExceptionResolver
Actually resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.
doResolveException(PortletRequest, MimeResponse, Object, Exception) - Method in class org.springframework.web.portlet.handler.SimpleMappingExceptionResolver
Actually resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.
doResolveException(PortletRequest, MimeResponse, Object, Exception) - Method in class org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver
doResolveException(HttpServletRequest, HttpServletResponse, Object, Exception) - Method in class org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
Actually resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.
doResolveException(HttpServletRequest, HttpServletResponse, Object, Exception) - Method in class org.springframework.web.servlet.handler.SimpleMappingExceptionResolver
Actually resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.
doResolveException(HttpServletRequest, HttpServletResponse, Object, Exception) - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver
doResolveException(HttpServletRequest, HttpServletResponse, Object, Exception) - Method in class org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver
doResolveException(HttpServletRequest, HttpServletResponse, Object, Exception) - Method in class org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver
doResourceService(ResourceRequest, ResourceResponse) - Method in class org.springframework.web.portlet.DispatcherPortlet
Processes the actual dispatching to the handler for resource requests.
doResourceService(ResourceRequest, ResourceResponse) - Method in class org.springframework.web.portlet.FrameworkPortlet
Subclasses must implement this method to do the work of resource request handling.
doResume(Object, Object) - Method in class org.springframework.jca.cci.connection.CciLocalTransactionManager
doResume(Object, Object) - Method in class org.springframework.jdbc.datasource.DataSourceTransactionManager
doResume(Object, Object) - Method in class org.springframework.jms.connection.JmsTransactionManager
doResume(Object, Object) - Method in class org.springframework.orm.hibernate3.HibernateTransactionManager
doResume(Object, Object) - Method in class org.springframework.orm.jdo.JdoTransactionManager
doResume(Object, Object) - Method in class org.springframework.orm.jpa.JpaTransactionManager
doResume(Object, Object) - Method in class org.springframework.transaction.jta.JtaTransactionManager
doResume(Object, Object) - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Resume the resources of the current transaction.
doRetrieveMatchingFiles(String, File, Set<File>) - Method in class org.springframework.core.io.support.PathMatchingResourcePatternResolver
Recursively retrieve files that match the given pattern, adding them to the given result list.
doRetrieveMatchingPortletContextResources(PortletContext, String, String, Set<Resource>) - Method in class org.springframework.web.portlet.context.PortletContextResourcePatternResolver
Recursively retrieve PortletContextResources that match the given pattern, adding them to the given result set.
doRetrieveMatchingServletContextResources(ServletContext, String, String, Set<Resource>) - Method in class org.springframework.web.context.support.ServletContextResourcePatternResolver
Recursively retrieve ServletContextResources that match the given pattern, adding them to the given result set.
doRollback(DefaultTransactionStatus) - Method in class org.springframework.jca.cci.connection.CciLocalTransactionManager
doRollback(DefaultTransactionStatus) - Method in class org.springframework.jdbc.datasource.DataSourceTransactionManager
doRollback(DefaultTransactionStatus) - Method in class org.springframework.jms.connection.JmsTransactionManager
doRollback(DefaultTransactionStatus) - Method in class org.springframework.orm.hibernate3.HibernateTransactionManager
doRollback(DefaultTransactionStatus) - Method in class org.springframework.orm.jdo.JdoTransactionManager
doRollback(DefaultTransactionStatus) - Method in class org.springframework.orm.jpa.JpaTransactionManager
doRollback(DefaultTransactionStatus) - Method in class org.springframework.transaction.jta.JtaTransactionManager
doRollback(DefaultTransactionStatus) - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Perform an actual rollback of the given transaction.
doScan(String...) - Method in class org.springframework.context.annotation.ClassPathBeanDefinitionScanner
Perform a scan within the specified base packages, returning the registered bean definitions.
doSend(Session, Destination, MessageCreator) - Method in class org.springframework.jms.core.JmsTemplate
Send the given JMS message.
doSend(MessageProducer, Message) - Method in class org.springframework.jms.core.JmsTemplate
Actually send the given JMS message.
doSend(MessageProducer, Message) - Method in class org.springframework.jms.core.JmsTemplate102
Deprecated. This implementation overrides the superclass method to use JMS 1.0.2 API.
doSend(MimeMessage[], Object[]) - Method in class org.springframework.mail.javamail.JavaMailSenderImpl
Actually send the given array of MimeMessages via JavaMail.
doService(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.DispatcherServlet
Exposes the DispatcherServlet-specific request attributes and delegates to DispatcherServlet.doDispatch(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) for the actual dispatching.
doService(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.FrameworkServlet
Subclasses must implement this method to do the work of request handling, receiving a centralized callback for GET, POST, PUT and DELETE.
doSetNestedPath(String) - Method in class org.springframework.validation.AbstractErrors
Actually set the nested path.
doSetRollbackOnly(DefaultTransactionStatus) - Method in class org.springframework.jca.cci.connection.CciLocalTransactionManager
doSetRollbackOnly(DefaultTransactionStatus) - Method in class org.springframework.jdbc.datasource.DataSourceTransactionManager
doSetRollbackOnly(DefaultTransactionStatus) - Method in class org.springframework.jms.connection.JmsTransactionManager
doSetRollbackOnly(DefaultTransactionStatus) - Method in class org.springframework.orm.hibernate3.HibernateTransactionManager
doSetRollbackOnly(DefaultTransactionStatus) - Method in class org.springframework.orm.jdo.JdoTransactionManager
doSetRollbackOnly(DefaultTransactionStatus) - Method in class org.springframework.orm.jpa.JpaTransactionManager
doSetRollbackOnly(DefaultTransactionStatus) - Method in class org.springframework.transaction.jta.JtaTransactionManager
doSetRollbackOnly(DefaultTransactionStatus) - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Set the given transaction rollback-only.
doShutdown() - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Close the registered invokers.
doShutdown() - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Destroy the registered JMS Sessions and associated MessageConsumers.
doShutdown() - Method in class org.springframework.jms.listener.SimpleMessageListenerContainer
Destroy the registered JMS Sessions and associated MessageConsumers.
doSort(List<E>, SortDefinition) - Method in class org.springframework.beans.support.PagedListHolder
Actually perform sorting of the given source list, according to the given sort definition.
doStart() - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Start the shared Connection, if any, and notify all invoker tasks.
doStart() - Method in class org.springframework.jms.listener.SimpleMessageListenerContainer
Re-initializes this container's JMS message consumers, if not initialized already.
doStartTag() - Method in class org.springframework.web.servlet.tags.NestedPathTag
doStartTag() - Method in class org.springframework.web.servlet.tags.RequestContextAwareTag
Create and expose the current RequestContext.
doStartTagInternal() - Method in class org.springframework.web.servlet.tags.BindErrorsTag
doStartTagInternal() - Method in class org.springframework.web.servlet.tags.BindTag
doStartTagInternal() - Method in class org.springframework.web.servlet.tags.EscapeBodyTag
doStartTagInternal() - Method in class org.springframework.web.servlet.tags.EvalTag
doStartTagInternal() - Method in class org.springframework.web.servlet.tags.form.AbstractFormTag
Provide a simple template method that calls AbstractFormTag.createTagWriter() and passes the created TagWriter to the AbstractFormTag.writeTagContent(TagWriter) method.
doStartTagInternal() - Method in class org.springframework.web.servlet.tags.HtmlEscapeTag
doStartTagInternal() - Method in class org.springframework.web.servlet.tags.MessageTag
Resolves the message, escapes it if demanded, and writes it to the page (or exposes it as variable).
doStartTagInternal() - Method in class org.springframework.web.servlet.tags.RequestContextAwareTag
Called by doStartTag to perform the actual work.
doStartTagInternal() - Method in class org.springframework.web.servlet.tags.TransformTag
doStartTagInternal() - Method in class org.springframework.web.servlet.tags.UrlTag
doStop() - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Notify all invoker tasks and stop the shared Connection, if any.
doStore(Properties, Writer, String) - Method in class org.springframework.util.DefaultPropertiesPersister
doSubmitAction(Object) - Method in class org.springframework.web.portlet.mvc.SimpleFormController
Deprecated. Template method for submit actions.
doSubmitAction(Object) - Method in class org.springframework.web.servlet.mvc.SimpleFormController
Deprecated. Template method for submit actions.
doSuspend(Object) - Method in class org.springframework.jca.cci.connection.CciLocalTransactionManager
doSuspend(Object) - Method in class org.springframework.jdbc.datasource.DataSourceTransactionManager
doSuspend(Object) - Method in class org.springframework.jms.connection.JmsTransactionManager
doSuspend(Object) - Method in class org.springframework.orm.hibernate3.HibernateTransactionManager
doSuspend(Object) - Method in class org.springframework.orm.jdo.JdoTransactionManager
doSuspend(Object) - Method in class org.springframework.orm.jpa.JpaTransactionManager
doSuspend(Object) - Method in class org.springframework.transaction.jta.JtaTransactionManager
doSuspend(Object) - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Suspend the resources of the current transaction.
doTrace(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.FrameworkServlet
Delegate TRACE requests to FrameworkServlet.processRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), if desired.
doTransform(Map<String, Object>, Source, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.xslt.AbstractXsltView
Deprecated. Perform the actual transformation, writing to the HTTP response.
doTransform(Source, Map<String, Object>, Result, String) - Method in class org.springframework.web.servlet.view.xslt.AbstractXsltView
Deprecated. Perform the actual transformation, writing to the given result.
doTranslate(String, String, SQLException) - Method in class org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator
Template method for actually translating the given exception.
doTranslate(String, String, SQLException) - Method in class org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator
doTranslate(String, String, SQLException) - Method in class org.springframework.jdbc.support.SQLExceptionSubclassTranslator
doTranslate(String, String, SQLException) - Method in class org.springframework.jdbc.support.SQLStateSQLExceptionTranslator
doUnregister(ObjectName) - Method in class org.springframework.jmx.support.MBeanRegistrationSupport
Actually unregister the specified MBean from the server.
doValidate(Object) - Method in class org.springframework.validation.beanvalidation.BeanValidationPostProcessor
Perform validation of the given bean.
doWith(Field) - Method in interface org.springframework.util.ReflectionUtils.FieldCallback
Perform an operation using the given field.
doWith(Method) - Method in interface org.springframework.util.ReflectionUtils.MethodCallback
Perform an operation using the given method.
doWithFields(Class<?>, ReflectionUtils.FieldCallback) - Static method in class org.springframework.util.ReflectionUtils
Invoke the given callback on all fields in the target class, going up the class hierarchy to get all declared fields.
doWithFields(Class<?>, ReflectionUtils.FieldCallback, ReflectionUtils.FieldFilter) - Static method in class org.springframework.util.ReflectionUtils
Invoke the given callback on all fields in the target class, going up the class hierarchy to get all declared fields.
doWithMethods(Class<?>, ReflectionUtils.MethodCallback) - Static method in class org.springframework.util.ReflectionUtils
Perform the given callback operation on all matching methods of the given class and superclasses.
doWithMethods(Class<?>, ReflectionUtils.MethodCallback, ReflectionUtils.MethodFilter) - Static method in class org.springframework.util.ReflectionUtils
Perform the given callback operation on all matching methods of the given class and superclasses.
doWithRequest(ClientHttpRequest) - Method in interface org.springframework.web.client.RequestCallback
Gets called by RestTemplate.execute(java.lang.String, org.springframework.http.HttpMethod, org.springframework.web.client.RequestCallback, org.springframework.web.client.ResponseExtractor, java.lang.Object...) with an opened ClientHttpRequest.
doWork(Work) - Method in class org.springframework.jca.work.SimpleTaskWorkManager
doWork(Work, long, ExecutionContext, WorkListener) - Method in class org.springframework.jca.work.SimpleTaskWorkManager
doWork(Work) - Method in class org.springframework.jca.work.WorkManagerTaskExecutor
doWork(Work, long, ExecutionContext, WorkListener) - Method in class org.springframework.jca.work.WorkManagerTaskExecutor
doWriteRemoteInvocation(RemoteInvocation, ObjectOutputStream) - Method in class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
Perform the actual writing of the given invocation object to the given ObjectOutputStream.
doWriteRemoteInvocationResult(RemoteInvocationResult, ObjectOutputStream) - Method in class org.springframework.remoting.rmi.RemoteInvocationSerializingExporter
Perform the actual writing of the given invocation result object to the given ObjectOutputStream.
DriverManagerDataSource - Class in org.springframework.jdbc.datasource
Simple implementation of the standard JDBC DataSource interface, configuring the plain old JDBC DriverManager via bean properties, and returning a new Connection from every getConnection call.
DriverManagerDataSource() - Constructor for class org.springframework.jdbc.datasource.DriverManagerDataSource
Constructor for bean-style configuration.
DriverManagerDataSource(String) - Constructor for class org.springframework.jdbc.datasource.DriverManagerDataSource
Create a new DriverManagerDataSource with the given JDBC URL, not specifying a username or password for JDBC access.
DriverManagerDataSource(String, String, String) - Constructor for class org.springframework.jdbc.datasource.DriverManagerDataSource
Create a new DriverManagerDataSource with the given standard DriverManager parameters.
DriverManagerDataSource(String, Properties) - Constructor for class org.springframework.jdbc.datasource.DriverManagerDataSource
Create a new DriverManagerDataSource with the given JDBC URL, not specifying a username or password for JDBC access.
DriverManagerDataSource(String, String, String, String) - Constructor for class org.springframework.jdbc.datasource.DriverManagerDataSource
Deprecated. since Spring 2.5. DriverManagerDataSource is primarily intended for accessing pre-registered JDBC drivers. If you need to register a new driver, consider using SimpleDriverDataSource instead.
dropDatabaseSchema() - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Execute schema drop script, determined by the Configuration object used for creating the SessionFactory.
DTD_SUFFIX - Static variable in class org.springframework.beans.factory.xml.DelegatingEntityResolver
Suffix for DTD files
DuplicateKeyException - Exception in org.springframework.dao
Exception thrown when an attempt to insert or update data results in violation of an primary key or unique constraint.
DuplicateKeyException(String) - Constructor for exception org.springframework.dao.DuplicateKeyException
Constructor for DuplicateKeyException.
DuplicateKeyException(String, Throwable) - Constructor for exception org.springframework.dao.DuplicateKeyException
Constructor for DuplicateKeyException.
DynamicDestinationResolver - Class in org.springframework.jms.support.destination
Simple DestinationResolver implementation resolving destination names as dynamic destinations.
DynamicDestinationResolver() - Constructor for class org.springframework.jms.support.destination.DynamicDestinationResolver
DynamicIntroductionAdvice - Interface in org.springframework.aop
Subinterface of AOP Alliance Advice that allows additional interfaces to be implemented by an Advice, and available via a proxy using that interceptor.
DynamicMethodMatcher - Class in org.springframework.aop.support
Convenient abstract superclass for dynamic method matchers, which do care about arguments at runtime.
DynamicMethodMatcher() - Constructor for class org.springframework.aop.support.DynamicMethodMatcher
DynamicMethodMatcherPointcut - Class in org.springframework.aop.support
Convenient superclass when we want to force subclasses to implement MethodMatcher interface, but subclasses will want to be pointcuts.
DynamicMethodMatcherPointcut() - Constructor for class org.springframework.aop.support.DynamicMethodMatcherPointcut
Overview Package Class Tree Deprecated Index Help
A B C D E F G H I J K L M N O P Q R S T U V W X


E-Index

PREV LETTER NEXT LETTER FRAMES NO FRAMES
A B C D E F G H I J K L M N O P Q R S T U V W X

E

EclipseLinkJpaDialect - Class in org.springframework.orm.jpa.vendor
JpaDialect implementation for Eclipse Persistence Services (EclipseLink).
EclipseLinkJpaDialect() - Constructor for class org.springframework.orm.jpa.vendor.EclipseLinkJpaDialect
EclipseLinkJpaVendorAdapter - Class in org.springframework.orm.jpa.vendor
JpaVendorAdapter implementation for Eclipse Persistence Services (EclipseLink).
EclipseLinkJpaVendorAdapter() - Constructor for class org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter
EditorAwareTag - Interface in org.springframework.web.servlet.tags
Interface to be implemented by JSP tags that expose a PropertyEditor for a property that they are currently bound to.
EhCacheFactoryBean - Class in org.springframework.cache.ehcache
FactoryBean that creates a named EHCache Cache instance (or a decorator that implements the Ehcache interface), representing a cache region within an EHCache CacheManager.
EhCacheFactoryBean() - Constructor for class org.springframework.cache.ehcache.EhCacheFactoryBean
EhCacheManagerFactoryBean - Class in org.springframework.cache.ehcache
FactoryBean that exposes an EHCache CacheManager instance (independent or shared), configured from a specified config location.
EhCacheManagerFactoryBean() - Constructor for class org.springframework.cache.ehcache.EhCacheManagerFactoryBean
EisOperation - Class in org.springframework.jca.cci.object
Base class for EIS operation objects that work with the CCI API.
EisOperation() - Constructor for class org.springframework.jca.cci.object.EisOperation
Ejb3TransactionAnnotationParser - Class in org.springframework.transaction.annotation
Strategy implementation for parsing EJB3's TransactionAttribute annotation.
Ejb3TransactionAnnotationParser() - Constructor for class org.springframework.transaction.annotation.Ejb3TransactionAnnotationParser
EjbAccessException - Exception in org.springframework.ejb.access
Exception that gets thrown when an EJB stub cannot be accessed properly.
EjbAccessException(String) - Constructor for exception org.springframework.ejb.access.EjbAccessException
Constructor for EjbAccessException.
EjbAccessException(String, Throwable) - Constructor for exception org.springframework.ejb.access.EjbAccessException
Constructor for EjbAccessException.
ejbActivate() - Method in class org.springframework.ejb.support.AbstractStatelessSessionBean
ejbCreate() - Method in class org.springframework.ejb.support.AbstractMessageDrivenBean
Lifecycle method required by the EJB specification but not the MessageDrivenBean interface.
ejbCreate() - Method in class org.springframework.ejb.support.AbstractStatelessSessionBean
This implementation loads the BeanFactory.
ejbPassivate() - Method in class org.springframework.ejb.support.AbstractStatelessSessionBean
ejbRemove() - Method in class org.springframework.ejb.support.AbstractEnterpriseBean
EJB lifecycle method, implemented to invoke onEjbRemove() and unload the BeanFactory afterwards.
Elvis - Class in org.springframework.expression.spel.ast
Represents the elvis operator ?:.
Elvis(int, SpelNodeImpl...) - Constructor for class org.springframework.expression.spel.ast.Elvis
EmbeddedDatabase - Interface in org.springframework.jdbc.datasource.embedded
A handle to an EmbeddedDatabase instance.
EmbeddedDatabaseBeanDefinitionParser - Class in org.springframework.jdbc.config
BeanDefinitionParser that parses embedded-database element and creates a BeanDefinition for EmbeddedDatabaseFactoryBean.
EmbeddedDatabaseBeanDefinitionParser() - Constructor for class org.springframework.jdbc.config.EmbeddedDatabaseBeanDefinitionParser
EmbeddedDatabaseBuilder - Class in org.springframework.jdbc.datasource.embedded
A builder that provides a fluent API for constructing an embedded database.
EmbeddedDatabaseBuilder() - Constructor for class org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder
Create a new embedded database builder.
EmbeddedDatabaseBuilder(ResourceLoader) - Constructor for class org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder
Create a new embedded database builder with the given ResourceLoader.
EmbeddedDatabaseConfigurer - Interface in org.springframework.jdbc.datasource.embedded
Encapsulates the configuration required to create, connect to, and shutdown a specific type of embedded database such as HSQL or H2.
EmbeddedDatabaseFactory - Class in org.springframework.jdbc.datasource.embedded
Creates a EmbeddedDatabase instance.
EmbeddedDatabaseFactory() - Constructor for class org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory
EmbeddedDatabaseFactoryBean - Class in org.springframework.jdbc.datasource.embedded
A subclass of EmbeddedDatabaseFactory that implements FactoryBean for registration as a Spring bean.
EmbeddedDatabaseFactoryBean() - Constructor for class org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactoryBean
EmbeddedDatabaseType - Enum in org.springframework.jdbc.datasource.embedded
A supported embedded database type.
EMPTY - Static variable in class org.springframework.http.HttpEntity
The empty HttpEntity, with no body or headers.
EMPTY - Static variable in class org.springframework.jmx.export.metadata.ManagedAttribute
EMPTY_TARGET_SOURCE - Static variable in class org.springframework.aop.framework.AdvisedSupport
Canonical TargetSource when there's no target, and behavior is supplied by the advisors.
emptyActivatedContextBuilder() - Static method in class org.springframework.mock.jndi.SimpleNamingContextBuilder
If no SimpleNamingContextBuilder is already configuring JNDI, create and activate one.
EmptyReaderEventListener - Class in org.springframework.beans.factory.parsing
Empty implementation of the ReaderEventListener interface, providing no-op implementations of all callback methods.
EmptyReaderEventListener() - Constructor for class org.springframework.beans.factory.parsing.EmptyReaderEventListener
EmptyResultDataAccessException - Exception in org.springframework.dao
Data access exception thrown when a result was expected to have at least one row (or element) but zero rows (or elements) were actually returned.
EmptyResultDataAccessException(int) - Constructor for exception org.springframework.dao.EmptyResultDataAccessException
Constructor for EmptyResultDataAccessException.
EmptyResultDataAccessException(String, int) - Constructor for exception org.springframework.dao.EmptyResultDataAccessException
Constructor for EmptyResultDataAccessException.
EmptyTargetSource - Class in org.springframework.aop.target
Canonical TargetSource when there is no target (or just the target class known), and behavior is supplied by interfaces and advisors only.
enableFilter(String) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Return an enabled Hibernate Filter for the given filter name.
enableFilter(String) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
enableFilters(Session) - Method in class org.springframework.orm.hibernate3.HibernateAccessor
Enable the specified filters on the given Session.
enableIndenting(Transformer) - Static method in class org.springframework.util.xml.TransformerUtils
Enable indenting for the supplied Transformer.
enableIndenting(Transformer, int) - Static method in class org.springframework.util.xml.TransformerUtils
Enable indenting for the supplied Transformer.
EncodedResource - Class in org.springframework.core.io.support
Holder that combines a Resource with a specific encoding to be used for reading from the resource.
EncodedResource(Resource) - Constructor for class org.springframework.core.io.support.EncodedResource
Create a new EncodedResource for the given Resource, not specifying a specific encoding.
EncodedResource(Resource, String) - Constructor for class org.springframework.core.io.support.EncodedResource
Create a new EncodedResource for the given Resource, using the specified encoding.
encodeFragment(String, String) - Static method in class org.springframework.web.util.UriUtils
Encodes the given URI fragment.
encodeHost(String, String) - Static method in class org.springframework.web.util.UriUtils
Encodes the given URI host.
encodeHttpUrl(String, String) - Static method in class org.springframework.web.util.UriUtils
Encodes the given HTTP URI into an encoded String.
encodeParameter(String, String) - Method in class org.springframework.mock.web.portlet.MockBaseURL
encodeParameter(String, String[]) - Method in class org.springframework.mock.web.portlet.MockBaseURL
encodePath(String, String) - Static method in class org.springframework.web.util.UriUtils
Encodes the given URI path.
encodePathSegment(String, String) - Static method in class org.springframework.web.util.UriUtils
Encodes the given URI path segment.
encodePort(String, String) - Static method in class org.springframework.web.util.UriUtils
Encodes the given URI port.
encodeQuery(String, String) - Static method in class org.springframework.web.util.UriUtils
Encodes the given URI query.
encodeQueryParam(String, String) - Static method in class org.springframework.web.util.UriUtils
Encodes the given URI query parameter.
encodeRedirectURL(String) - Method in class org.springframework.mock.web.MockHttpServletResponse
The default implementation delegates to MockHttpServletResponse.encodeURL(java.lang.String), returning the given URL String as-is.
encodeRedirectUrl(String) - Method in class org.springframework.mock.web.MockHttpServletResponse
encodeScheme(String, String) - Static method in class org.springframework.web.util.UriUtils
Encodes the given URI scheme.
encodeUri(String) - Method in class org.springframework.web.util.UriTemplate
Encodes the given String as URL.
encodeUri(String, String) - Static method in class org.springframework.web.util.UriUtils
Encodes the given source URI into an encoded String.
encodeUriComponents(String, String, String, String, String, String, String, String, String) - Static method in class org.springframework.web.util.UriUtils
Encodes the given source URI components into an encoded String.
encodeURL(String) - Method in class org.springframework.mock.web.MockHttpServletResponse
The default implementation returns the given URL String as-is.
encodeUrl(String) - Method in class org.springframework.mock.web.MockHttpServletResponse
encodeURL(String) - Method in class org.springframework.mock.web.portlet.MockPortletResponse
encodeUserInfo(String, String) - Static method in class org.springframework.web.util.UriUtils
Encodes the given URI user info.
ENCODING_GZIP - Static variable in class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
endpointActivation(MessageEndpointFactory, ActivationSpec) - Method in class org.springframework.jca.context.SpringContextResourceAdapter
This implementation always throws a NotSupportedException.
endpointDeactivation(MessageEndpointFactory, ActivationSpec) - Method in class org.springframework.jca.context.SpringContextResourceAdapter
This implementation does nothing.
endsWithContinuationMarker(String) - Method in class org.springframework.util.DefaultPropertiesPersister
endsWithIgnoreCase(String, String) - Static method in class org.springframework.util.StringUtils
Test if the given String ends with the specified suffix, ignoring upper/lower case.
endTag() - Method in class org.springframework.web.servlet.tags.form.TagWriter
Close the current tag.
endTag(boolean) - Method in class org.springframework.web.servlet.tags.form.TagWriter
Close the current tag, allowing to enforce a full closing tag.
endTransaction() - Method in class org.springframework.test.AbstractTransactionalSpringContextTests
Deprecated. Immediately force a commit or rollback of the transaction, according to the complete and rollback flags.
enhanceConfigurationClasses(ConfigurableListableBeanFactory) - Method in class org.springframework.context.annotation.ConfigurationClassPostProcessor
Post-processes a BeanFactory in search of Configuration class BeanDefinitions; any candidates are then enhanced by a ConfigurationClassEnhancer.
enlistResource(XAResource) - Method in class org.springframework.transaction.jta.ManagedTransactionAdapter
enterScope(Map<String, Object>) - Method in class org.springframework.expression.spel.ExpressionState
enterScope(String, Object) - Method in class org.springframework.expression.spel.ExpressionState
ENTITY_MANAGER_SYNCHRONIZATION_ORDER - Static variable in class org.springframework.orm.jpa.EntityManagerFactoryUtils
Order value for TransactionSynchronization objects that clean up JPA EntityManagers.
entityIsTransient(MergeEvent, Map) - Method in class org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener
Hibernate 3.1 implementation of ID transferral.
entityManagerFactory - Variable in class org.springframework.test.jpa.AbstractJpaTests
Deprecated.
EntityManagerFactoryAccessor - Class in org.springframework.orm.jpa
Base class for any class that needs to access an EntityManagerFactory, usually in order to obtain an EntityManager.
EntityManagerFactoryAccessor() - Constructor for class org.springframework.orm.jpa.EntityManagerFactoryAccessor
EntityManagerFactoryInfo - Interface in org.springframework.orm.jpa
Metadata interface for a Spring-managed JPA EntityManagerFactory.
EntityManagerFactoryPlus - Interface in org.springframework.orm.jpa
Extension of the standard JPA EntityManagerFactory interface, linking in Spring's EntityManagerFactoryPlusOperations interface which defines additional operations (beyond JPA 1.0) in a vendor-independent fashion.
EntityManagerFactoryPlusOperations - Interface in org.springframework.orm.jpa
Interface that defines common operations beyond the standard JPA EntityManagerFactory interface, in a vendor-independent fashion.
EntityManagerFactoryUtils - Class in org.springframework.orm.jpa
Helper class featuring methods for JPA EntityManager handling, allowing for reuse of EntityManager instances within transactions.
EntityManagerFactoryUtils() - Constructor for class org.springframework.orm.jpa.EntityManagerFactoryUtils
EntityManagerHolder - Class in org.springframework.orm.jpa
Holder wrapping a JPA EntityManager.
EntityManagerHolder(EntityManager) - Constructor for class org.springframework.orm.jpa.EntityManagerHolder
EntityManagerPlus - Interface in org.springframework.orm.jpa
Extension of the standard JPA EntityManager interface, linking in Spring's EntityManagerPlusOperations interface which defines additional operations (beyond JPA 1.0) in a vendor-independent fashion.
EntityManagerPlusOperations - Interface in org.springframework.orm.jpa
Interface that defines common operations beyond the standard JPA EntityManager interface, in a vendor-independent fashion.
EntityManagerProxy - Interface in org.springframework.orm.jpa
Subinterface of EntityManager to be implemented by EntityManager proxies.
ENTRY_ELEMENT - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
entrySet() - Method in class org.springframework.http.HttpHeaders
entrySet() - Method in class org.springframework.util.CachingMapDecorator
entrySet() - Method in class org.springframework.util.LinkedMultiValueMap
equals(Object) - Method in class org.springframework.aop.aspectj.AspectJExpressionPointcut
equals(Object) - Method in class org.springframework.aop.aspectj.AspectJPointcutAdvisor
equals(Object) - Method in class org.springframework.aop.support.AbstractPointcutAdvisor
equals(Object) - Method in class org.springframework.aop.support.AbstractRegexpMethodPointcut
equals(Object) - Method in class org.springframework.aop.support.ComposablePointcut
equals(Object) - Method in class org.springframework.aop.support.ControlFlowPointcut
equals(Object) - Method in class org.springframework.aop.support.DefaultIntroductionAdvisor
equals(Object) - Method in class org.springframework.aop.support.NameMatchMethodPointcut
equals(Object) - Method in class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
equals(Object) - Method in class org.springframework.aop.target.EmptyTargetSource
equals(Object) - Method in class org.springframework.aop.target.HotSwappableTargetSource
Two HotSwappableTargetSources are equal if the current target objects are equal.
equals(Object) - Method in class org.springframework.aop.target.SingletonTargetSource
Two invoker interceptors are equal if they have the same target or if the targets or the targets are equal.
equals(Object) - Method in class org.springframework.beans.BeanMetadataAttribute
equals(Object) - Method in exception org.springframework.beans.BeansException
equals(Object) - Method in class org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement
equals(Object) - Method in class org.springframework.beans.factory.config.BeanDefinitionHolder
equals(Object) - Method in class org.springframework.beans.factory.config.BeanExpressionContext
equals(Object) - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues
equals(Object) - Method in class org.springframework.beans.factory.config.RuntimeBeanNameReference
equals(Object) - Method in class org.springframework.beans.factory.config.RuntimeBeanReference
equals(Object) - Method in class org.springframework.beans.factory.config.TypedStringValue
equals(Object) - Method in class org.springframework.beans.factory.parsing.BeanComponentDefinition
This implementations expects the other object to be of type BeanComponentDefinition as well, in addition to the superclass's equality requirements.
equals(Object) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
equals(Object) - Method in class org.springframework.beans.factory.support.ChildBeanDefinition
equals(Object) - Method in class org.springframework.beans.factory.support.GenericBeanDefinition
equals(Object) - Method in class org.springframework.beans.factory.support.LookupOverride
equals(Object) - Method in class org.springframework.beans.factory.support.MethodOverride
equals(Object) - Method in class org.springframework.beans.factory.support.MethodOverrides
equals(Object) - Method in class org.springframework.beans.factory.support.ReplaceOverride
equals(Object) - Method in class org.springframework.beans.factory.support.RootBeanDefinition
equals(Object) - Method in class org.springframework.beans.MutablePropertyValues
equals(Object) - Method in class org.springframework.beans.PropertyValue
equals(Object) - Method in class org.springframework.beans.support.MutableSortDefinition
equals(Object) - Method in class org.springframework.context.support.DefaultMessageSourceResolvable
equals(Object) - Method in class org.springframework.core.AttributeAccessorSupport
equals(Object) - Method in class org.springframework.core.enums.AbstractLabeledEnum
Deprecated.
equals(Object) - Method in class org.springframework.core.io.AbstractResource
This implementation compares description strings.
equals(Object) - Method in class org.springframework.core.io.ByteArrayResource
This implementation compares the underlying byte array.
equals(Object) - Method in class org.springframework.core.io.ClassPathResource
This implementation compares the underlying class path locations.
equals(Object) - Method in class org.springframework.core.io.DescriptiveResource
This implementation compares the underlying description String.
equals(Object) - Method in class org.springframework.core.io.FileSystemResource
This implementation compares the underlying File references.
equals(Object) - Method in class org.springframework.core.io.InputStreamResource
This implementation compares the underlying InputStream.
equals(Object) - Method in class org.springframework.core.io.support.EncodedResource
equals(Object) - Method in class org.springframework.core.io.UrlResource
This implementation compares the underlying URL references.
equals(Object) - Method in class org.springframework.core.io.VfsResource
equals(Object) - Method in class org.springframework.http.HttpHeaders
equals(Object) - Method in class org.springframework.http.MediaType
equals(Object) - Method in class org.springframework.jmx.support.NotificationListenerHolder
equals(Object) - Method in class org.springframework.mail.SimpleMailMessage
equals(Object, Object) - Method in class org.springframework.orm.hibernate3.support.AbstractLobType
This implementation delegates to the Hibernate EqualsHelper.
equals(Object, Object) - Method in class org.springframework.orm.hibernate3.support.BlobByteArrayType
equals(Object) - Method in class org.springframework.scheduling.support.CronSequenceGenerator
equals(Object) - Method in class org.springframework.scheduling.support.CronTrigger
equals(Object) - Method in class org.springframework.scheduling.support.PeriodicTrigger
equals(Object) - Method in class org.springframework.transaction.interceptor.MatchAlwaysTransactionAttributeSource
equals(Object) - Method in class org.springframework.transaction.interceptor.MethodMapTransactionAttributeSource
equals(Object) - Method in class org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource
equals(Object) - Method in class org.springframework.transaction.interceptor.RollbackRuleAttribute
equals(Object) - Method in class org.springframework.transaction.support.DefaultTransactionDefinition
This implementation compares the toString() results.
equals(Object) - Method in class org.springframework.transaction.support.DelegatingTransactionDefinition
equals(Object) - Method in class org.springframework.util.AutoPopulatingList
equals(Object) - Method in class org.springframework.util.comparator.BooleanComparator
equals(Object) - Method in class org.springframework.util.comparator.CompoundComparator
equals(Object) - Method in class org.springframework.util.comparator.InvertibleComparator
equals(Object) - Method in class org.springframework.util.comparator.NullSafeComparator
equals(Object) - Method in class org.springframework.util.LinkedMultiValueMap
equals(Object) - Method in class org.springframework.validation.AbstractBindingResult
equals(Object) - Method in exception org.springframework.validation.BindException
equals(Object) - Method in class org.springframework.validation.FieldError
equals(Object) - Method in class org.springframework.validation.ObjectError
equals(Object) - Method in class org.springframework.web.context.support.ServletContextResource
This implementation compares the underlying ServletContext resource locations.
equals(Object) - Method in class org.springframework.web.portlet.context.PortletContextResource
equalsAdvisors(AdvisedSupport, AdvisedSupport) - Static method in class org.springframework.aop.framework.AopProxyUtils
Check equality of the advisors behind the given AdvisedSupport objects.
equalsInProxy(AdvisedSupport, AdvisedSupport) - Static method in class org.springframework.aop.framework.AopProxyUtils
Check equality of the proxies behind the given AdvisedSupport objects.
equalsProxiedInterfaces(AdvisedSupport, AdvisedSupport) - Static method in class org.springframework.aop.framework.AopProxyUtils
Check equality of the proxied interfaces behind the given AdvisedSupport objects.
error(Problem) - Method in class org.springframework.beans.factory.parsing.FailFastProblemReporter
Throws a BeanDefinitionParsingException detailing the error that has occurred.
error(Problem) - Method in interface org.springframework.beans.factory.parsing.ProblemReporter
Called when an error is encountered during the parsing process.
error(String, Object) - Method in class org.springframework.beans.factory.parsing.ReaderContext
error(String, Object, Throwable) - Method in class org.springframework.beans.factory.parsing.ReaderContext
error(String, Object, ParseState) - Method in class org.springframework.beans.factory.parsing.ReaderContext
error(String, Object, ParseState, Throwable) - Method in class org.springframework.beans.factory.parsing.ReaderContext
error(String, Node) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Report an error with the given message for the given source element.
error(String, Element) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Report an error with the given message for the given source element.
error(String, Element, Throwable) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Report an error with the given message for the given source element.
error(SAXParseException) - Method in class org.springframework.util.xml.SimpleSaxErrorHandler
error(TransformerException) - Method in class org.springframework.util.xml.SimpleTransformErrorListener
ERROR_CODE - Static variable in exception org.springframework.beans.MethodInvocationException
Error code that a method invocation error will be registered with.
ERROR_CODE - Static variable in exception org.springframework.beans.TypeMismatchException
Error code that a type mismatch error will be registered with.
ERROR_EXCEPTION_ATTRIBUTE - Static variable in class org.springframework.web.util.WebUtils
ERROR_EXCEPTION_TYPE_ATTRIBUTE - Static variable in class org.springframework.web.util.WebUtils
ERROR_MESSAGE_ATTRIBUTE - Static variable in class org.springframework.web.util.WebUtils
ERROR_REQUEST_URI_ATTRIBUTE - Static variable in class org.springframework.web.util.WebUtils
ERROR_SERVLET_NAME_ATTRIBUTE - Static variable in class org.springframework.web.util.WebUtils
ERROR_STATUS_CODE_ATTRIBUTE - Static variable in class org.springframework.web.util.WebUtils
Standard Servlet 2.3+ spec request attributes for error pages.
ErrorCoded - Interface in org.springframework.core
Interface that can be implemented by exceptions etc that are error coded.
ErrorHandler - Interface in org.springframework.util
A strategy for handling errors.
Errors - Interface in org.springframework.validation
Stores and exposes information about data-binding and validation errors for a specific object.
ERRORS_VARIABLE_NAME - Static variable in class org.springframework.web.servlet.tags.BindErrorsTag
ErrorsTag - Class in org.springframework.web.servlet.tags.form
Form tag for displaying errors for a particular field or object.
ErrorsTag() - Constructor for class org.springframework.web.servlet.tags.form.ErrorsTag
escape(String, boolean) - Method in class org.springframework.util.DefaultPropertiesPersister
EscapeBodyTag - Class in org.springframework.web.servlet.tags
Custom JSP tag to escape its enclosed body content, applying HTML escaping and/or JavaScript escaping.
EscapeBodyTag() - Constructor for class org.springframework.web.servlet.tags.EscapeBodyTag
EscapedErrors - Class in org.springframework.web.bind
Errors wrapper that adds automatic HTML escaping to the wrapped instance, for convenient usage in HTML views.
EscapedErrors(Errors) - Constructor for class org.springframework.web.bind.EscapedErrors
Create a new EscapedErrors instance for the given source instance.
establishSharedConnection() - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Establish a shared Connection for this container.
establishSharedConnection() - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Overridden to accept a failure in the initial setup - leaving it up to the asynchronous invokers to establish the shared Connection on first access.
EvalTag - Class in org.springframework.web.servlet.tags
JSP tag for evaluating expressions with the Spring Expression Language (SpEL).
EvalTag() - Constructor for class org.springframework.web.servlet.tags.EvalTag
evaluate(String, BeanExpressionContext) - Method in interface org.springframework.beans.factory.config.BeanExpressionResolver
Evaluate the given value as an expression, if applicable; return the value as-is otherwise.
evaluate(String, BeanExpressionContext) - Method in class org.springframework.context.expression.StandardBeanExpressionResolver
evaluate(String, Class, VariableResolver, FunctionMapper) - Method in class org.springframework.mock.web.MockExpressionEvaluator
evaluate() - Method in class org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks
Invokes the next Statement in the execution chain (typically an instance of RunAfters), catching any exceptions thrown, and then calls TestContextManager.afterTestClass().
evaluate() - Method in class org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks
Invokes the next Statement in the execution chain (typically an instance of RunAfters), catching any exceptions thrown, and then calls TestContextManager#afterTestMethod(Object, Method) with the first caught exception (if any).
evaluate() - Method in class org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks
Calls TestContextManager.beforeTestClass() and then invokes the next Statement in the execution chain (typically an instance of RunBefores).
evaluate() - Method in class org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks
Calls TestContextManager.beforeTestMethod(Object, Method) and then invokes the next Statement in the execution chain (typically an instance of RunBefores).
evaluate() - Method in class org.springframework.test.context.junit4.statements.SpringFailOnTimeout
Invokes the next statement in the execution chain (typically an instance of InvokeMethod or ExpectException) and throws an exception if the next statement takes more than the specified timeout .
evaluate() - Method in class org.springframework.test.context.junit4.statements.SpringRepeat
Invokes the next statement in the execution chain for the specified repeat count.
evaluate(String, Object) - Method in class org.springframework.web.servlet.tags.form.AbstractFormTag
Evaluate the supplied value for the supplied attribute name.
evaluate(String, String, Class, PageContext) - Static method in class org.springframework.web.util.ExpressionEvaluationUtils
Evaluate the given expression (be it EL or a literal String value) to an Object of a given type,
evaluate(String, String, PageContext) - Static method in class org.springframework.web.util.ExpressionEvaluationUtils
Evaluate the given expression (be it EL or a literal String value) to an Object.
evaluateBeanDefinitionString(String, BeanDefinition) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Evaluate the given String as contained in a bean definition, potentially resolving it as an expression.
evaluateBoolean(String, String) - Method in class org.springframework.web.servlet.tags.form.AbstractFormTag
Evaluate the supplied value for the supplied attribute name.
evaluateBoolean(String, String, PageContext) - Static method in class org.springframework.web.util.ExpressionEvaluationUtils
Evaluate the given expression (be it EL or a literal String value) to a boolean.
evaluateInteger(String, String, PageContext) - Static method in class org.springframework.web.util.ExpressionEvaluationUtils
Evaluate the given expression (be it EL or a literal String value) to an integer.
evaluateString(String, String, PageContext) - Static method in class org.springframework.web.util.ExpressionEvaluationUtils
Evaluate the given expression (be it EL or a literal String value) to a String.
EvaluationContext - Interface in org.springframework.expression
Expressions are executed in an evaluation context.
EvaluationException - Exception in org.springframework.expression
Represent an exception that occurs during expression evaluation.
EvaluationException(int, String) - Constructor for exception org.springframework.expression.EvaluationException
Creates a new expression evaluation exception.
EvaluationException(String, String) - Constructor for exception org.springframework.expression.EvaluationException
Creates a new expression evaluation exception.
EvaluationException(int, String, Throwable) - Constructor for exception org.springframework.expression.EvaluationException
Creates a new expression evaluation exception.
EvaluationException(String) - Constructor for exception org.springframework.expression.EvaluationException
Creates a new expression evaluation exception.
EvaluationException(String, Throwable) - Constructor for exception org.springframework.expression.EvaluationException
EventAwareController - Interface in org.springframework.web.portlet.mvc
Extension of the Portlet Controller interface that allows for handling Portlet 2.0 event requests as well.
EventMapping - Annotation Type in org.springframework.web.portlet.bind.annotation
Annotation for mapping Portlet event requests onto handler methods.
EventPublicationInterceptor - Class in org.springframework.context.event
Interceptor that publishes an ApplicationEvent to all ApplicationListeners registered with an ApplicationEventPublisher after each successful method invocation.
EventPublicationInterceptor() - Constructor for class org.springframework.context.event.EventPublicationInterceptor
evict(Object) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Remove the given object from the Session cache.
evict(Object) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
evict(Object) - Method in interface org.springframework.orm.jdo.JdoOperations
Remove the given object from the PersistenceManager cache.
evict(Object) - Method in class org.springframework.orm.jdo.JdoTemplate
evictAll(Collection) - Method in interface org.springframework.orm.jdo.JdoOperations
Remove all given objects from the PersistenceManager cache.
evictAll() - Method in interface org.springframework.orm.jdo.JdoOperations
Remove all objects from the PersistenceManager cache.
evictAll(Collection) - Method in class org.springframework.orm.jdo.JdoTemplate
evictAll() - Method in class org.springframework.orm.jdo.JdoTemplate
ExceptionHandler - Annotation Type in org.springframework.web.bind.annotation
Annotation for handling exceptions in specific handler classes and/or handler methods.
exchange(String, HttpMethod, HttpEntity<?>, Class<T>, Object...) - Method in interface org.springframework.web.client.RestOperations
Execute the HTTP method to the given URI template, writing the given request entity to the request, and returns the response as ResponseEntity.
exchange(String, HttpMethod, HttpEntity<?>, Class<T>, Map<String, ?>) - Method in interface org.springframework.web.client.RestOperations
Execute the HTTP method to the given URI template, writing the given request entity to the request, and returns the response as ResponseEntity.
exchange(URI, HttpMethod, HttpEntity<?>, Class<T>) - Method in interface org.springframework.web.client.RestOperations
Execute the HTTP method to the given URI template, writing the given request entity to the request, and returns the response as ResponseEntity.
exchange(String, HttpMethod, HttpEntity<?>, Class<T>, Object...) - Method in class org.springframework.web.client.RestTemplate
exchange(String, HttpMethod, HttpEntity<?>, Class<T>, Map<String, ?>) - Method in class org.springframework.web.client.RestTemplate
exchange(URI, HttpMethod, HttpEntity<?>, Class<T>) - Method in class org.springframework.web.client.RestTemplate
excludeClass(String) - Method in class org.springframework.core.DecoratingClassLoader
Add a class name to exclude from decoration (e.g.
excludePackage(String) - Method in class org.springframework.core.DecoratingClassLoader
Add a package name to exclude from decoration (e.g.
excludeUnlistedClasses() - Method in class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo
execute(Runnable, long) - Method in interface org.springframework.core.task.AsyncTaskExecutor
Execute the given task.
execute(Runnable) - Method in class org.springframework.core.task.SimpleAsyncTaskExecutor
Executes the given task, within a concurrency throttle if configured (through the superclass's settings).
execute(Runnable, long) - Method in class org.springframework.core.task.SimpleAsyncTaskExecutor
Executes the given task, within a concurrency throttle if configured (through the superclass's settings).
execute(Runnable) - Method in class org.springframework.core.task.support.ConcurrentExecutorAdapter
execute(Runnable) - Method in class org.springframework.core.task.support.ExecutorServiceAdapter
execute(Runnable) - Method in class org.springframework.core.task.support.TaskExecutorAdapter
Delegates to the specified JDK 1.5 concurrent executor.
execute(Runnable, long) - Method in class org.springframework.core.task.support.TaskExecutorAdapter
execute(Runnable) - Method in class org.springframework.core.task.SyncTaskExecutor
Executes the given task synchronously, through direct invocation of it's run() method.
execute(Runnable) - Method in interface org.springframework.core.task.TaskExecutor
Execute the given task.
execute(EvaluationContext, Object...) - Method in interface org.springframework.expression.ConstructorExecutor
Execute a constructor in the specified context using the specified arguments.
execute(EvaluationContext, Object, Object...) - Method in interface org.springframework.expression.MethodExecutor
Execute a command using the specified arguments, and using the specified expression state.
execute() - Method in class org.springframework.http.client.AbstractClientHttpRequest
execute() - Method in interface org.springframework.http.client.ClientHttpRequest
Execute this request, resulting in a ClientHttpResponse that can be read.
execute(ConnectionCallback<T>) - Method in interface org.springframework.jca.cci.core.CciOperations
Execute a request on an EIS with CCI, implemented as callback action working on a CCI Connection.
execute(InteractionCallback<T>) - Method in interface org.springframework.jca.cci.core.CciOperations
Execute a request on an EIS with CCI, implemented as callback action working on a CCI Interaction.
execute(InteractionSpec, Record) - Method in interface org.springframework.jca.cci.core.CciOperations
Execute the specified interaction on an EIS with CCI.
execute(InteractionSpec, Record, Record) - Method in interface org.springframework.jca.cci.core.CciOperations
Execute the specified interaction on an EIS with CCI.
execute(InteractionSpec, RecordCreator) - Method in interface org.springframework.jca.cci.core.CciOperations
Execute the specified interaction on an EIS with CCI.
execute(InteractionSpec, Record, RecordExtractor<T>) - Method in interface org.springframework.jca.cci.core.CciOperations
Execute the specified interaction on an EIS with CCI.
execute(InteractionSpec, RecordCreator, RecordExtractor<T>) - Method in interface org.springframework.jca.cci.core.CciOperations
Execute the specified interaction on an EIS with CCI.
execute(ConnectionCallback<T>) - Method in class org.springframework.jca.cci.core.CciTemplate
execute(InteractionCallback<T>) - Method in class org.springframework.jca.cci.core.CciTemplate
execute(InteractionSpec, Record) - Method in class org.springframework.jca.cci.core.CciTemplate
execute(InteractionSpec, Record, Record) - Method in class org.springframework.jca.cci.core.CciTemplate
execute(InteractionSpec, RecordCreator) - Method in class org.springframework.jca.cci.core.CciTemplate
execute(InteractionSpec, Record, RecordExtractor<T>) - Method in class org.springframework.jca.cci.core.CciTemplate
execute(InteractionSpec, RecordCreator, RecordExtractor<T>) - Method in class org.springframework.jca.cci.core.CciTemplate
execute(Object) - Method in class org.springframework.jca.cci.object.MappingRecordOperation
Execute the interaction encapsulated by this operation object.
execute(Record) - Method in class org.springframework.jca.cci.object.SimpleRecordOperation
Execute the CCI interaction encapsulated by this operation object.
execute(Record, Record) - Method in class org.springframework.jca.cci.object.SimpleRecordOperation
Execute the CCI interaction encapsulated by this operation object.
execute(Runnable) - Method in class org.springframework.jca.work.WorkManagerTaskExecutor
execute(Runnable, long) - Method in class org.springframework.jca.work.WorkManagerTaskExecutor
execute(ConnectionCallback<T>) - Method in interface org.springframework.jdbc.core.JdbcOperations
Execute a JDBC data access operation, implemented as callback action working on a JDBC Connection.
execute(StatementCallback<T>) - Method in interface org.springframework.jdbc.core.JdbcOperations
Execute a JDBC data access operation, implemented as callback action working on a JDBC Statement.
execute(String) - Method in interface org.springframework.jdbc.core.JdbcOperations
Issue a single SQL execute, typically a DDL statement.
execute(PreparedStatementCreator, PreparedStatementCallback<T>) - Method in interface org.springframework.jdbc.core.JdbcOperations
Execute a JDBC data access operation, implemented as callback action working on a JDBC PreparedStatement.
execute(String, PreparedStatementCallback<T>) - Method in interface org.springframework.jdbc.core.JdbcOperations
Execute a JDBC data access operation, implemented as callback action working on a JDBC PreparedStatement.
execute(CallableStatementCreator, CallableStatementCallback<T>) - Method in interface org.springframework.jdbc.core.JdbcOperations
Execute a JDBC data access operation, implemented as callback action working on a JDBC CallableStatement.
execute(String, CallableStatementCallback<T>) - Method in interface org.springframework.jdbc.core.JdbcOperations
Execute a JDBC data access operation, implemented as callback action working on a JDBC CallableStatement.
execute(ConnectionCallback<T>) - Method in class org.springframework.jdbc.core.JdbcTemplate
execute(StatementCallback<T>) - Method in class org.springframework.jdbc.core.JdbcTemplate
execute(String) - Method in class org.springframework.jdbc.core.JdbcTemplate
execute(PreparedStatementCreator, PreparedStatementCallback<T>) - Method in class org.springframework.jdbc.core.JdbcTemplate
execute(String, PreparedStatementCallback<T>) - Method in class org.springframework.jdbc.core.JdbcTemplate
execute(CallableStatementCreator, CallableStatementCallback<T>) - Method in class org.springframework.jdbc.core.JdbcTemplate
execute(String, CallableStatementCallback<T>) - Method in class org.springframework.jdbc.core.JdbcTemplate
execute(String, SqlParameterSource, PreparedStatementCallback<T>) - Method in interface org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
Execute a JDBC data access operation, implemented as callback action working on a JDBC PreparedStatement.
execute(String, Map<String, ?>, PreparedStatementCallback<T>) - Method in interface org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
Execute a JDBC data access operation, implemented as callback action working on a JDBC PreparedStatement.
execute(String, SqlParameterSource, PreparedStatementCallback<T>) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
execute(String, Map<String, ?>, PreparedStatementCallback<T>) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
execute(Object...) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcCall
execute(Map<String, ?>) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcCall
execute(SqlParameterSource) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcCall
execute(Object...) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcCallOperations
Execute the stored procedure and return a map of output params, keyed by name as in parameter declarations.
execute(Map<String, ?>) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcCallOperations
Execute the stored procedure and return a map of output params, keyed by name as in parameter declarations..
execute(SqlParameterSource) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcCallOperations
Execute the stored procedure and return a map of output params, keyed by name as in parameter declarations..
execute(Map<String, Object>) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcInsert
execute(SqlParameterSource) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcInsert
execute(Map<String, Object>) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcInsertOperations
Execute the insert using the values passed in.
execute(SqlParameterSource) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcInsertOperations
Execute the insert using the values passed in.
execute(Object[], Map) - Method in class org.springframework.jdbc.object.SqlQuery
Central execution method.
execute(Object...) - Method in class org.springframework.jdbc.object.SqlQuery
Convenient method to execute without context.
execute(Map) - Method in class org.springframework.jdbc.object.SqlQuery
Convenient method to execute without parameters.
execute() - Method in class org.springframework.jdbc.object.SqlQuery
Convenient method to execute without parameters nor context.
execute(int, Map) - Method in class org.springframework.jdbc.object.SqlQuery
Convenient method to execute with a single int parameter and context.
execute(int) - Method in class org.springframework.jdbc.object.SqlQuery
Convenient method to execute with a single int parameter.
execute(int, int, Map) - Method in class org.springframework.jdbc.object.SqlQuery
Convenient method to execute with two int parameters and context.
execute(int, int) - Method in class org.springframework.jdbc.object.SqlQuery
Convenient method to execute with two int parameters.
execute(long, Map) - Method in class org.springframework.jdbc.object.SqlQuery
Convenient method to execute with a single long parameter and context.
execute(long) - Method in class org.springframework.jdbc.object.SqlQuery
Convenient method to execute with a single long parameter.
execute(String, Map) - Method in class org.springframework.jdbc.object.SqlQuery
Convenient method to execute with a single String parameter and context.
execute(String) - Method in class org.springframework.jdbc.object.SqlQuery
Convenient method to execute with a single String parameter.
execute(Object...) - Method in class org.springframework.jdbc.object.StoredProcedure
Execute the stored procedure with the provided parameter values.
execute(Map<String, ?>) - Method in class org.springframework.jdbc.object.StoredProcedure
Execute the stored procedure.
execute(ParameterMapper) - Method in class org.springframework.jdbc.object.StoredProcedure
Execute the stored procedure.
execute(SessionCallback<T>) - Method in interface org.springframework.jms.core.JmsOperations
Execute the action specified by the given action object within a JMS Session.
execute(ProducerCallback<T>) - Method in interface org.springframework.jms.core.JmsOperations
Send messages to the default JMS destination (or one specified for each send operation).
execute(Destination, ProducerCallback<T>) - Method in interface org.springframework.jms.core.JmsOperations
Send messages to a JMS destination.
execute(String, ProducerCallback<T>) - Method in interface org.springframework.jms.core.JmsOperations
Send messages to a JMS destination.
execute(SessionCallback<T>) - Method in class org.springframework.jms.core.JmsTemplate
execute(SessionCallback<T>, boolean) - Method in class org.springframework.jms.core.JmsTemplate
Execute the action specified by the given action object within a JMS Session.
execute(ProducerCallback<T>) - Method in class org.springframework.jms.core.JmsTemplate
execute(Destination, ProducerCallback<T>) - Method in class org.springframework.jms.core.JmsTemplate
execute(String, ProducerCallback<T>) - Method in class org.springframework.jms.core.JmsTemplate
execute(JndiCallback<T>) - Method in class org.springframework.jndi.JndiTemplate
Execute the given JNDI context callback implementation.
execute(HibernateCallback<T>) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Execute the action specified by the given action object within a Session.
execute(HibernateCallback<T>) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
execute(SqlMapClientCallback<T>) - Method in class org.springframework.orm.ibatis.SqlMapClientTemplate
Execute the given data access action on a SqlMapExecutor.
execute(JdoCallback<T>) - Method in interface org.springframework.orm.jdo.JdoOperations
Execute the action specified by the given action object within a PersistenceManager.
execute(JdoCallback<T>) - Method in class org.springframework.orm.jdo.JdoTemplate
execute(JdoCallback<T>, boolean) - Method in class org.springframework.orm.jdo.JdoTemplate
Execute the action specified by the given action object within a PersistenceManager.
execute(JpaCallback<T>) - Method in interface org.springframework.orm.jpa.JpaOperations
execute(JpaCallback<T>) - Method in class org.springframework.orm.jpa.JpaTemplate
execute(JpaCallback<T>, boolean) - Method in class org.springframework.orm.jpa.JpaTemplate
Execute the action specified by the given action object within a EntityManager.
execute(Runnable) - Method in class org.springframework.scheduling.backportconcurrent.ConcurrentTaskExecutor
Delegates to the specified JSR-166 backport concurrent executor.
execute(Runnable, long) - Method in class org.springframework.scheduling.backportconcurrent.ConcurrentTaskExecutor
execute(Runnable) - Method in class org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor
Implementation of both the JSR-166 backport Executor interface and the Spring TaskExecutor interface, delegating to the ThreadPoolExecutor instance.
execute(Runnable, long) - Method in class org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor
execute(Runnable) - Method in class org.springframework.scheduling.commonj.WorkManagerTaskExecutor
execute(Runnable, long) - Method in class org.springframework.scheduling.commonj.WorkManagerTaskExecutor
execute(Runnable) - Method in class org.springframework.scheduling.concurrent.ConcurrentTaskExecutor
execute(Runnable, long) - Method in class org.springframework.scheduling.concurrent.ConcurrentTaskExecutor
execute(Runnable) - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
execute(Runnable, long) - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
execute(Runnable) - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
execute(Runnable, long) - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
execute(JobExecutionContext) - Method in class org.springframework.scheduling.quartz.DelegatingJob
Delegates execution to the underlying Runnable.
execute(JobExecutionContext) - Method in class org.springframework.scheduling.quartz.QuartzJobBean
This implementation applies the passed-in job data map as bean property values, and delegates to executeInternal afterwards.
execute(Runnable) - Method in class org.springframework.scheduling.quartz.SimpleThreadPoolTaskExecutor
execute(Runnable, long) - Method in class org.springframework.scheduling.quartz.SimpleThreadPoolTaskExecutor
execute(Runnable) - Method in class org.springframework.scheduling.timer.TimerTaskExecutor
Deprecated. Schedules the given Runnable on this executor's Timer instance, wrapping it in a DelegatingTimerTask.
execute(Runnable, long) - Method in class org.springframework.scheduling.timer.TimerTaskExecutor
Deprecated.
execute(TransactionDefinition, TransactionCallback<T>) - Method in class org.springframework.transaction.jta.WebSphereUowTransactionManager
execute(TransactionDefinition, TransactionCallback<T>) - Method in interface org.springframework.transaction.support.CallbackPreferringPlatformTransactionManager
Execute the action specified by the given callback object within a transaction.
execute(TransactionCallback<T>) - Method in interface org.springframework.transaction.support.TransactionOperations
Execute the action specified by the given callback object within a transaction.
execute(TransactionCallback<T>) - Method in class org.springframework.transaction.support.TransactionTemplate
execute(String, HttpMethod, RequestCallback, ResponseExtractor<T>, Object...) - Method in interface org.springframework.web.client.RestOperations
Execute the HTTP method to the given URI template, preparing the request with the RequestCallback, and reading the response with a ResponseExtractor.
execute(String, HttpMethod, RequestCallback, ResponseExtractor<T>, Map<String, ?>) - Method in interface org.springframework.web.client.RestOperations
Execute the HTTP method to the given URI template, preparing the request with the RequestCallback, and reading the response with a ResponseExtractor.
execute(URI, HttpMethod, RequestCallback, ResponseExtractor<T>) - Method in interface org.springframework.web.client.RestOperations
Execute the HTTP method to the given URL, preparing the request with the RequestCallback, and reading the response with a ResponseExtractor.
execute(String, HttpMethod, RequestCallback, ResponseExtractor<T>, Object...) - Method in class org.springframework.web.client.RestTemplate
execute(String, HttpMethod, RequestCallback, ResponseExtractor<T>, Map<String, ?>) - Method in class org.springframework.web.client.RestTemplate
execute(URI, HttpMethod, RequestCallback, ResponseExtractor<T>) - Method in class org.springframework.web.client.RestTemplate
execute(ComponentContext, HttpServletRequest, HttpServletResponse, ServletContext) - Method in class org.springframework.web.servlet.view.tiles.ComponentControllerSupport
Deprecated. This implementation delegates to doPerform, lazy-initializing the application context reference if necessary.
execute(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.struts.DelegatingActionProxy
Deprecated. Pass the execute call on to the Spring-managed delegate Action.
executeAndReturnKey(Map<String, Object>) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcInsert
executeAndReturnKey(SqlParameterSource) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcInsert
executeAndReturnKey(Map<String, Object>) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcInsertOperations
Execute the insert using the values passed in and return the generated key.
executeAndReturnKey(SqlParameterSource) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcInsertOperations
Execute the insert using the values passed in and return the generated key.
executeAndReturnKeyHolder(Map<String, Object>) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcInsert
executeAndReturnKeyHolder(SqlParameterSource) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcInsert
executeAndReturnKeyHolder(Map<String, Object>) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcInsertOperations
Execute the insert using the values passed in and return the generated keys.
executeAndReturnKeyHolder(SqlParameterSource) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcInsertOperations
Execute the insert using the values passed in and return the generated keys.
executeBatch(Map<String, Object>[]) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcInsert
executeBatch(SqlParameterSource[]) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcInsert
executeBatch(Map<String, Object>[]) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcInsertOperations
Execute a batch insert using the batch of values passed in.
executeBatch(SqlParameterSource[]) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcInsertOperations
Execute a batch insert using the batch of values passed in.
executeBatchUpdate(String, List<Object[]>, int[], JdbcOperations) - Static method in class org.springframework.jdbc.core.BatchUpdateUtils
executeBatchUpdateWithNamedParameters(ParsedSql, SqlParameterSource[], JdbcOperations) - Static method in class org.springframework.jdbc.core.namedparam.NamedParameterBatchUpdateUtils
executeByNamedParam(Map<String, ?>, Map) - Method in class org.springframework.jdbc.object.SqlQuery
Central execution method.
executeByNamedParam(Map<String, ?>) - Method in class org.springframework.jdbc.object.SqlQuery
Convenient method to execute without context.
executeController(Controller, ComponentContext, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.tiles.TilesView
Deprecated. Execute the given Tiles controller.
executeFind(HibernateCallback<?>) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Execute the specified action assuming that the result object is a List.
executeFind(HibernateCallback<?>) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
executeFind(JdoCallback<?>) - Method in interface org.springframework.orm.jdo.JdoOperations
Execute the specified action assuming that the result object is a Collection.
executeFind(JdoCallback<?>) - Method in class org.springframework.orm.jdo.JdoTemplate
executeFind(JpaCallback<?>) - Method in interface org.springframework.orm.jpa.JpaOperations
executeFind(JpaCallback<?>) - Method in class org.springframework.orm.jpa.JpaTemplate
executeFunction(Class<T>, Object...) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcCall
executeFunction(Class<T>, Map<String, ?>) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcCall
executeFunction(Class<T>, SqlParameterSource) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcCall
executeFunction(Class<T>, Object...) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcCallOperations
Execute the stored function and return the results obtained as an Object of the specified return type.
executeFunction(Class<T>, Map<String, ?>) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcCallOperations
Execute the stored function and return the results obtained as an Object of the specified return type.
executeFunction(Class<T>, SqlParameterSource) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcCallOperations
Execute the stored function and return the results obtained as an Object of the specified return type.
executeInternal(HttpHeaders, byte[]) - Method in class org.springframework.http.client.AbstractClientHttpRequest
Abstract template method that writes the given headers and content to the HTTP request.
executeInternal(JobExecutionContext) - Method in class org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean.MethodInvokingJob
Invoke the method via the MethodInvoker.
executeInternal(JobExecutionContext) - Method in class org.springframework.scheduling.quartz.QuartzJobBean
Execute the actual job.
executeListener(Session, Message) - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Execute the specified listener, committing or rolling back the transaction afterwards (if necessary).
executeObject(Class<T>, Object...) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcCall
executeObject(Class<T>, Map<String, ?>) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcCall
executeObject(Class<T>, SqlParameterSource) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcCall
executeObject(Class<T>, Object...) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcCallOperations
Execute the stored procedure and return the single out parameter as an Object of the specified return type.
executeObject(Class<T>, Map<String, ?>) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcCallOperations
Execute the stored procedure and return the single out parameter as an Object of the specified return type.
executeObject(Class<T>, SqlParameterSource) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcCallOperations
Execute the stored procedure and return the single out parameter as an Object of the specified return type.
executePostMethod(HttpInvokerClientConfiguration, HttpClient, PostMethod) - Method in class org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor
Execute the given PostMethod instance.
executeRequest(RemoteInvocation) - Method in class org.springframework.jms.remoting.JmsInvokerClientInterceptor
Execute the given remote invocation, sending an invoker request message to this accessor's target queue and waiting for a corresponding response.
executeRequest(HttpInvokerClientConfiguration, RemoteInvocation) - Method in class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
executeRequest(RemoteInvocation, MethodInvocation) - Method in class org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor
Execute the given remote invocation via the HttpInvokerRequestExecutor.
executeRequest(RemoteInvocation) - Method in class org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor
Execute the given remote invocation via the HttpInvokerRequestExecutor.
executeRequest(HttpInvokerClientConfiguration, RemoteInvocation) - Method in interface org.springframework.remoting.httpinvoker.HttpInvokerRequestExecutor
Execute a request to send the given remote invocation.
executeSchemaScript(Connection, String[]) - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Execute the given schema script on the given JDBC Connection.
executeSchemaStatement(Statement, String) - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Execute the given schema SQL on the given JDBC Statement.
executeScript(ScriptSource, Class) - Method in class org.springframework.scripting.groovy.GroovyScriptFactory
Instantiate the given Groovy script class and run it if necessary.
executeSqlScript(String, boolean) - Method in class org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
Deprecated. Execute the given SQL script.
executeSqlScript(String, boolean) - Method in class org.springframework.test.context.junit38.AbstractTransactionalJUnit38SpringContextTests
Execute the given SQL script.
executeSqlScript(String, boolean) - Method in class org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests
Execute the given SQL script.
executeSqlScript(String, boolean) - Method in class org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests
Execute the given SQL script.
executeSqlScript(SimpleJdbcTemplate, ResourceLoader, String, boolean) - Static method in class org.springframework.test.jdbc.SimpleJdbcTestUtils
Execute the given SQL script.
executeSqlScript(SimpleJdbcTemplate, Resource, boolean) - Static method in class org.springframework.test.jdbc.SimpleJdbcTestUtils
Execute the given SQL script.
executeSqlScript(SimpleJdbcTemplate, EncodedResource, boolean) - Static method in class org.springframework.test.jdbc.SimpleJdbcTestUtils
Execute the given SQL script.
executeWithListResult(SqlMapClientCallback<List>) - Method in class org.springframework.orm.ibatis.SqlMapClientTemplate
Deprecated. as of Spring 3.0 - not really needed anymore with generic SqlMapClientTemplate.execute(org.springframework.orm.ibatis.SqlMapClientCallback) method
executeWithMapResult(SqlMapClientCallback<Map>) - Method in class org.springframework.orm.ibatis.SqlMapClientTemplate
Deprecated. as of Spring 3.0 - not really needed anymore with generic SqlMapClientTemplate.execute(org.springframework.orm.ibatis.SqlMapClientCallback) method
executeWithNativeSession(HibernateCallback<T>) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
Execute the action specified by the given action object within a native Session.
executeWithNewSession(HibernateCallback<T>) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
Execute the action specified by the given action object within a new Session.
executeWork(TaskExecutor, Work, long, boolean, ExecutionContext, WorkListener) - Method in class org.springframework.jca.work.SimpleTaskWorkManager
Execute the given Work on the specified TaskExecutor.
ExecutorBeanDefinitionParser - Class in org.springframework.scheduling.config
Parser for the 'executor' element of the 'task' namespace.
ExecutorBeanDefinitionParser() - Constructor for class org.springframework.scheduling.config.ExecutorBeanDefinitionParser
ExecutorConfigurationSupport - Class in org.springframework.scheduling.concurrent
Base class for classes that are setting up a java.util.concurrent.ExecutorService (typically a ThreadPoolExecutor).
ExecutorConfigurationSupport() - Constructor for class org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
ExecutorServiceAdapter - Class in org.springframework.core.task.support
Adapter that takes a Spring TaskExecutor) and exposes a full java.util.concurrent.ExecutorService for it.
ExecutorServiceAdapter(TaskExecutor) - Constructor for class org.springframework.core.task.support.ExecutorServiceAdapter
Create a new ExecutorServiceAdapter, using the given target executor.
exists() - Method in class org.springframework.core.io.AbstractResource
This implementation checks whether a File can be opened, falling back to whether an InputStream can be opened.
exists() - Method in class org.springframework.core.io.ByteArrayResource
This implementation always returns true.
exists() - Method in class org.springframework.core.io.DescriptiveResource
exists() - Method in class org.springframework.core.io.FileSystemResource
This implementation returns whether the underlying file exists.
exists() - Method in class org.springframework.core.io.InputStreamResource
This implementation always returns true.
exists() - Method in interface org.springframework.core.io.Resource
Return whether this resource actually exists in physical form.
exists() - Method in class org.springframework.core.io.VfsResource
exists() - Method in class org.springframework.web.context.support.ServletContextResource
This implementation checks ServletContext.getResource.
exists() - Method in class org.springframework.web.portlet.context.PortletContextResource
This implementation checks PortletContext.getResource.
exitScope() - Method in class org.springframework.expression.spel.ExpressionState
expand(Map<String, ?>) - Method in class org.springframework.web.util.UriTemplate
Given the Map of variables, expands this template into a URI.
expand(Object...) - Method in class org.springframework.web.util.UriTemplate
Given an array of variables, expand this template into a full URI.
ExpectedException - Annotation Type in org.springframework.test.annotation
Test annotation to indicate that a test method is required to throw the specified exception.
ExpectedLookupTemplate - Class in org.springframework.mock.jndi
Simple extension of the JndiTemplate class that always returns a given object.
ExpectedLookupTemplate() - Constructor for class org.springframework.mock.jndi.ExpectedLookupTemplate
Construct a new JndiTemplate that will always return given objects for given names.
ExpectedLookupTemplate(String, Object) - Constructor for class org.springframework.mock.jndi.ExpectedLookupTemplate
Construct a new JndiTemplate that will always return the given object, but honour only requests for the given name.
expose(Errors, HttpServletRequest) - Method in class org.springframework.web.struts.SpringBindingActionForm
Deprecated. Set the Errors object that this SpringBindingActionForm is supposed to wrap.
EXPOSE_WEB_APP_ROOT_PARAM - Static variable in class org.springframework.web.util.Log4jWebConfigurer
Parameter specifying whether to expose the web app root system property
exposeAttributes() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementBodyTag
Called during AbstractHtmlElementBodyTag.writeTagContent(org.springframework.web.servlet.tags.form.TagWriter) allowing subclasses to add any attributes to the PageContext as needed.
exposeAttributes() - Method in class org.springframework.web.servlet.tags.form.ErrorsTag
Exposes any bind status error messages under this key in the PageContext.PAGE_SCOPE.
exposeAttributes() - Method in class org.springframework.web.servlet.tags.form.OptionTag
ExposeBeanNameAdvisors - Class in org.springframework.aop.interceptor
Convenient methods for creating advisors that may be used when autoproxying beans created with the Spring IoC container, binding the bean name to the current invocation.
ExposeBeanNameAdvisors() - Constructor for class org.springframework.aop.interceptor.ExposeBeanNameAdvisors
exposeErrorRequestAttributes(HttpServletRequest, Throwable, String) - Static method in class org.springframework.web.util.WebUtils
Expose the Servlet spec's error attributes as HttpServletRequest attributes under the keys defined in the Servlet 2.3 specification, for error pages that are rendered directly rather than through the Servlet container's error page resolution: javax.servlet.error.status_code, javax.servlet.error.exception_type, javax.servlet.error.message, javax.servlet.error.exception, javax.servlet.error.request_uri, javax.servlet.error.servlet_name.
exposeForwardRequestAttributes(HttpServletRequest) - Method in class org.springframework.web.servlet.view.InternalResourceView
Expose the current request URI and paths as HttpServletRequest attributes under the keys defined in the Servlet 2.4 specification, for Servlet 2.3 containers as well as misbehaving Servlet 2.4 containers (such as OC4J).
exposeForwardRequestAttributes(HttpServletRequest) - Static method in class org.springframework.web.util.WebUtils
Expose the current request URI and paths as HttpServletRequest attributes under the keys defined in the Servlet 2.4 specification, for containers that implement 2.3 or an earlier version of the Servlet API: javax.servlet.forward.request_uri, javax.servlet.forward.context_path, javax.servlet.forward.servlet_path, javax.servlet.forward.path_info, javax.servlet.forward.query_string.
exposeHelpers(Map<String, Object>, HttpServletRequest) - Method in class org.springframework.web.servlet.view.freemarker.FreeMarkerView
Expose helpers unique to each rendering operation.
exposeHelpers(HttpServletRequest) - Method in class org.springframework.web.servlet.view.InternalResourceView
Expose helpers unique to each rendering operation.
exposeHelpers(HttpServletRequest) - Method in class org.springframework.web.servlet.view.JstlView
Exposes a JSTL LocalizationContext for Spring's locale and MessageSource.
exposeHelpers(HttpServletRequest) - Method in class org.springframework.web.servlet.view.tiles.TilesJstlView
Deprecated.
exposeHelpers(Map<String, Object>, HttpServletRequest) - Method in class org.springframework.web.servlet.view.velocity.VelocityView
Expose helpers unique to each rendering operation.
exposeHelpers(Context, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.velocity.VelocityView
Expose helpers unique to each rendering operation.
exposeHelpers(Context, HttpServletRequest) - Method in class org.springframework.web.servlet.view.velocity.VelocityView
Expose helpers unique to each rendering operation.
ExposeInvocationInterceptor - Class in org.springframework.aop.interceptor
Interceptor that exposes the current MethodInvocation as a thread-local object.
exposeLocalizationContext(HttpServletRequest, MessageSource) - Static method in class org.springframework.web.servlet.support.JstlUtils
Exposes JSTL-specific request attributes specifying locale and resource bundle for JSTL's formatting and message tags, using Spring's locale and MessageSource.
exposeLocalizationContext(RequestContext) - Static method in class org.springframework.web.servlet.support.JstlUtils
Exposes JSTL-specific request attributes specifying locale and resource bundle for JSTL's formatting and message tags, using Spring's locale and MessageSource.
exposeLocalizationContext(Map<String, Object>, HttpServletRequest) - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
Expose current Spring-managed Locale and MessageSource to JasperReports i18n ($R expressions etc).
exposeModelAsRequestAttributes(Map<String, Object>, HttpServletRequest) - Method in class org.springframework.web.servlet.view.AbstractView
Expose the model objects in the given map as request attributes.
exposePathWithinMapping(String, String, HttpServletRequest) - Method in class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
Expose the path within the current mapping as request attribute.
exposeRequestAttributes(PortletRequest, Map<String, ?>) - Static method in class org.springframework.web.portlet.util.PortletUtils
Expose the given Map as request attributes, using the keys as attribute names and the values as corresponding attribute values.
exposeRequestAttributes(ServletRequest, Map<String, ?>) - Static method in class org.springframework.web.util.WebUtils
Expose the given Map as request attributes, using the keys as attribute names and the values as corresponding attribute values.
exposeToolAttributes(Context, HttpServletRequest) - Method in class org.springframework.web.servlet.view.velocity.VelocityView
Expose the tool attributes, according to corresponding bean property settings.
exposeUriTemplateVariables(Map<String, String>, HttpServletRequest) - Method in class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
Expose the URI templates variables as request attribute.
Expression - Interface in org.springframework.expression
An expression capable of evaluating itself against context objects.
EXPRESSION_PREFIX - Static variable in class org.springframework.web.util.ExpressionEvaluationUtils
EXPRESSION_SUFFIX - Static variable in class org.springframework.web.util.ExpressionEvaluationUtils
ExpressionEvaluationUtils - Class in org.springframework.web.util
Convenience methods for accessing JSP 2.0's ExpressionEvaluator.
ExpressionEvaluationUtils() - Constructor for class org.springframework.web.util.ExpressionEvaluationUtils
ExpressionException - Exception in org.springframework.expression
Super class for exceptions that can occur whilst processing expressions
ExpressionException(String, String) - Constructor for exception org.springframework.expression.ExpressionException
Creates a new expression exception.
ExpressionException(String, int, String) - Constructor for exception org.springframework.expression.ExpressionException
Creates a new expression exception.
ExpressionException(int, String) - Constructor for exception org.springframework.expression.ExpressionException
Creates a new expression exception.
ExpressionException(int, String, Throwable) - Constructor for exception org.springframework.expression.ExpressionException
Creates a new expression exception.
ExpressionException(String) - Constructor for exception org.springframework.expression.ExpressionException
Creates a new expression exception.
ExpressionException(String, Throwable) - Constructor for exception org.springframework.expression.ExpressionException
ExpressionParser - Interface in org.springframework.expression
Parses expression strings into compiled expressions that can be evaluated.
ExpressionPointcut - Interface in org.springframework.aop.support
Interface to be implemented by pointcuts that use String expressions.
ExpressionState - Class in org.springframework.expression.spel
An ExpressionState is for maintaining per-expression-evaluation state, any changes to it are not seen by other expressions but it gives a place to hold local variables and for component expressions in a compound expression to communicate state.
ExpressionState(EvaluationContext) - Constructor for class org.springframework.expression.spel.ExpressionState
ExpressionState(EvaluationContext, SpelParserConfiguration) - Constructor for class org.springframework.expression.spel.ExpressionState
ExpressionState(EvaluationContext, TypedValue) - Constructor for class org.springframework.expression.spel.ExpressionState
ExpressionState(EvaluationContext, TypedValue, SpelParserConfiguration) - Constructor for class org.springframework.expression.spel.ExpressionState
expressionString - Variable in exception org.springframework.expression.ExpressionException
ExpressionUtils - Class in org.springframework.expression.common
Common utility functions that may be used by any Expression Language provider.
ExpressionUtils() - Constructor for class org.springframework.expression.common.ExpressionUtils
extendAdvisors(List<Advisor>) - Method in class org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator
Adds an ExposeInvocationInterceptor to the beginning of the advice chain.
extendAdvisors(List<Advisor>) - Method in class org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
Extension hook that subclasses can override to register additional Advisors, given the sorted Advisors obtained to date.
ExtendedEntityManagerCreator - Class in org.springframework.orm.jpa
Factory for dynamic EntityManager proxies that follow the JPA spec's semantics for "extended" EntityManagers.
ExtendedEntityManagerCreator() - Constructor for class org.springframework.orm.jpa.ExtendedEntityManagerCreator
ExtendedModelMap - Class in org.springframework.ui
Subclass of ModelMap that implements the Model interface.
ExtendedModelMap() - Constructor for class org.springframework.ui.ExtendedModelMap
extendInterceptors(List) - Method in class org.springframework.web.portlet.handler.AbstractHandlerMapping
Extension hook that subclasses can override to register additional interceptors, given the configured interceptors (see AbstractHandlerMapping.setInterceptors(java.lang.Object[])).
extendInterceptors(List<Object>) - Method in class org.springframework.web.servlet.handler.AbstractHandlerMapping
Extension hook that subclasses can override to register additional interceptors, given the configured interceptors (see AbstractHandlerMapping.setInterceptors(java.lang.Object[])).
extractByteArrayFromMessage(BytesMessage) - Method in class org.springframework.jms.support.converter.SimpleMessageConverter
Extract a byte array from the given BytesMessage.
extractByteArrayFromMessage(BytesMessage) - Method in class org.springframework.jms.support.converter.SimpleMessageConverter102
Deprecated. Overrides superclass method to copy bytes from the message into a ByteArrayOutputStream, using a buffer, to avoid using the getBodyLength() method which has been introduced in JMS 1.1 and is therefore not available on a JMS 1.0.2 provider.
extractCaseInsensitiveParameterNames(SqlParameterSource) - Static method in class org.springframework.jdbc.core.namedparam.SqlParameterSourceUtils
Create a Map of case insensitive parameter names together with the original name.
extractData(Record) - Method in interface org.springframework.jca.cci.core.RecordExtractor
Process the data in the given Record, creating a corresponding result object.
extractData(Record) - Method in class org.springframework.jca.cci.object.MappingRecordOperation.RecordExtractorImpl
extractData(ResultSet) - Method in interface org.springframework.jdbc.core.ResultSetExtractor
Implementations must implement this method to process the entire ResultSet.
extractData(ResultSet) - Method in class org.springframework.jdbc.core.RowMapperResultSetExtractor
extractData(ResultSet) - Method in class org.springframework.jdbc.core.SqlRowSetResultSetExtractor
extractData(ResultSet) - Method in class org.springframework.jdbc.core.support.AbstractLobStreamingResultSetExtractor
Delegates to handleNoRowFound, handleMultipleRowsFound and streamData, according to the ResultSet state.
extractData(ClientHttpResponse) - Method in class org.springframework.web.client.HttpMessageConverterExtractor
extractData(ClientHttpResponse) - Method in interface org.springframework.web.client.ResponseExtractor
Extract data from the given ClientHttpResponse and return it.
extractDatabaseMetaData(DataSource, DatabaseMetaDataCallback) - Static method in class org.springframework.jdbc.support.JdbcUtils
Extract database meta data via the given DatabaseMetaDataCallback.
extractDatabaseMetaData(DataSource, String) - Static method in class org.springframework.jdbc.support.JdbcUtils
Call the specified method on DatabaseMetaData for the given DataSource, and extract the invocation result.
extractFilenameFromUrlPath(String) - Static method in class org.springframework.web.util.WebUtils
Extract the URL filename from the given request URL path.
extractFullFilenameFromUrlPath(String) - Static method in class org.springframework.web.util.WebUtils
Extract the full URL filename (including file extension) from the given request URL path.
extractHandlerMethodNameFromUrlPath(String) - Method in class org.springframework.web.servlet.mvc.multiaction.InternalPathMethodNameResolver
Extract the handler method name from the given request URI.
extractInvocationResult(Message) - Method in class org.springframework.jms.remoting.JmsInvokerClientInterceptor
Extract the invocation result from the response message.
extractJarFileURL(URL) - Static method in class org.springframework.util.ResourceUtils
Extract the URL for the actual jar file from the given URL (which may point to a resource in a jar file or to a jar file itself).
extractMapFromMessage(MapMessage) - Method in class org.springframework.jms.support.converter.SimpleMessageConverter
Extract a Map from the given MapMessage.
extractMessage(Message) - Method in class org.springframework.jms.listener.adapter.MessageListenerAdapter
Extract the message body from the given JMS message.
extractOperableUrl(HttpServletRequest) - Method in class org.springframework.web.servlet.mvc.UrlFilenameViewController
Extract a URL path from the given request, suitable for view name extraction.
extractOutputData(Record) - Method in class org.springframework.jca.cci.object.MappingCommAreaOperation
extractOutputData(Record) - Method in class org.springframework.jca.cci.object.MappingRecordOperation
Subclasses must implement this method to convert the Record returned by CCI execution into a result object for the execute method.
extractOutputParameters(CallableStatement, List<SqlParameter>) - Method in class org.springframework.jdbc.core.JdbcTemplate
Extract output parameters from the completed stored procedure.
extractPathWithinPattern(String, String) - Method in class org.springframework.util.AntPathMatcher
Given a pattern and a full path, determine the pattern-mapped part.
extractPathWithinPattern(String, String) - Method in interface org.springframework.util.PathMatcher
Given a pattern and a full path, determine the pattern-mapped part.
extractPropertyName(String) - Method in class org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser
Extract a JavaBean property name from the supplied attribute name.
extractReturnedResults(CallableStatement, List, List, int) - Method in class org.springframework.jdbc.core.JdbcTemplate
Extract returned ResultSets from the completed stored procedure.
extractSerializableFromMessage(ObjectMessage) - Method in class org.springframework.jms.support.converter.SimpleMessageConverter
Extract a Serializable object from the given ObjectMessage.
extractSource(Object, Resource) - Method in class org.springframework.beans.factory.parsing.NullSourceExtractor
This implementation simply returns null for any input.
extractSource(Object, Resource) - Method in class org.springframework.beans.factory.parsing.PassThroughSourceExtractor
Simply returns the supplied sourceCandidate as-is.
extractSource(Object) - Method in class org.springframework.beans.factory.parsing.ReaderContext
extractSource(Object, Resource) - Method in interface org.springframework.beans.factory.parsing.SourceExtractor
Extract the source metadata from the candidate object supplied by the configuration parser.
extractSource(Element) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Invoke the SourceExtractor to pull the source metadata from the supplied Element.
extractSource(Element) - Method in class org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader
Invoke the SourceExtractor to pull the source metadata from the supplied Element.
extractSource(Object) - Method in class org.springframework.beans.factory.xml.ParserContext
extractSqlStringFromException(JDOException) - Method in class org.springframework.orm.jdo.DefaultJdoDialect
Template method for extracting a SQL String from the given exception.
extractStringFromMessage(TextMessage) - Method in class org.springframework.jms.support.converter.SimpleMessageConverter
Extract a String from the given TextMessage.
extractUriTemplateVariables(String, String) - Method in class org.springframework.util.AntPathMatcher
extractUriTemplateVariables(String, String) - Method in interface org.springframework.util.PathMatcher
Given a pattern and a full path, extract the URI template variables.
extractViewNameFromUrlPath(String) - Method in class org.springframework.web.servlet.mvc.UrlFilenameViewController
Extract the URL filename from the given request URI.
Overview Package Class Tree Deprecated Index Help
A B C D E F G H I J K L M N O P Q R S T U V W X


F-Index

PREV LETTER NEXT LETTER FRAMES NO FRAMES
A B C D E F G H I J K L M N O P Q R S T U V W X

F

FacesContextUtils - Class in org.springframework.web.jsf
Convenience methods to retrieve the root WebApplicationContext for a given FacesContext.
FacesContextUtils() - Constructor for class org.springframework.web.jsf.FacesContextUtils
FacesRequestAttributes - Class in org.springframework.web.context.request
RequestAttributes adapter for a JSF FacesContext.
FacesRequestAttributes(FacesContext) - Constructor for class org.springframework.web.context.request.FacesRequestAttributes
Create a new FacesRequestAttributes adapter for the given FacesContext.
FacesWebRequest - Class in org.springframework.web.context.request
WebRequest adapter for a JSF FacesContext.
FacesWebRequest(FacesContext) - Constructor for class org.springframework.web.context.request.FacesWebRequest
Create a new FacesWebRequest adapter for the given FacesContext.
FACTORY_BEAN_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
FACTORY_BEAN_PREFIX - Static variable in interface org.springframework.beans.factory.BeanFactory
Used to dereference a FactoryBean instance and distinguish it from beans created by the FactoryBean.
FACTORY_METHOD_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
FactoryBean<T> - Interface in org.springframework.beans.factory
Interface to be implemented by objects used within a BeanFactory which are themselves factories.
FactoryBeanNotInitializedException - Exception in org.springframework.beans.factory
Exception to be thrown from a FactoryBean's getObject() method if the bean is not fully initialized yet, for example because it is involved in a circular reference.
FactoryBeanNotInitializedException() - Constructor for exception org.springframework.beans.factory.FactoryBeanNotInitializedException
Create a new FactoryBeanNotInitializedException with the default message.
FactoryBeanNotInitializedException(String) - Constructor for exception org.springframework.beans.factory.FactoryBeanNotInitializedException
Create a new FactoryBeanNotInitializedException with the given message.
FactoryBeanRegistrySupport - Class in org.springframework.beans.factory.support
Support base class for singleton registries which need to handle FactoryBean instances, integrated with DefaultSingletonBeanRegistry's singleton management.
FactoryBeanRegistrySupport() - Constructor for class org.springframework.beans.factory.support.FactoryBeanRegistrySupport
FailFastProblemReporter - Class in org.springframework.beans.factory.parsing
Simple ProblemReporter implementation that exhibits fail-fast behavior when errors are encountered.
FailFastProblemReporter() - Constructor for class org.springframework.beans.factory.parsing.FailFastProblemReporter
FALLBACK_TRANSACTION_MANAGER_NAMES - Static variable in class org.springframework.transaction.jta.JtaTransactionManager
Fallback JNDI locations for the JTA TransactionManager.
FALSE - Static variable in class org.springframework.expression.spel.support.BooleanTypedValue
fatal(Problem) - Method in class org.springframework.beans.factory.parsing.FailFastProblemReporter
Throws a BeanDefinitionParsingException detailing the error that has occurred.
fatal(Problem) - Method in interface org.springframework.beans.factory.parsing.ProblemReporter
Called when a fatal error is encountered during the parsing process.
fatal(String, Object) - Method in class org.springframework.beans.factory.parsing.ReaderContext
fatal(String, Object, Throwable) - Method in class org.springframework.beans.factory.parsing.ReaderContext
fatal(String, Object, ParseState) - Method in class org.springframework.beans.factory.parsing.ReaderContext
fatal(String, Object, ParseState, Throwable) - Method in class org.springframework.beans.factory.parsing.ReaderContext
FatalBeanException - Exception in org.springframework.beans
Thrown on an unrecoverable problem encountered in the beans packages or sub-packages, e.g.
FatalBeanException(String) - Constructor for exception org.springframework.beans.FatalBeanException
Create a new FatalBeanException with the specified message.
FatalBeanException(String, Throwable) - Constructor for exception org.springframework.beans.FatalBeanException
Create a new FatalBeanException with the specified message and root cause.
fatalError(SAXParseException) - Method in class org.springframework.util.xml.SimpleSaxErrorHandler
fatalError(TransformerException) - Method in class org.springframework.util.xml.SimpleTransformErrorListener
FIELD_CLASS - Static variable in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Constant identifier for the class field in a JMX Descriptor.
FIELD_CURRENCY_TIME_LIMIT - Static variable in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Constant identifier for the currency time limit field in a JMX Descriptor.
FIELD_DEFAULT - Static variable in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Constant identifier for the default field in a JMX Descriptor.
FIELD_DISPLAY_NAME - Static variable in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Constant identifier for the displayName field in a JMX Descriptor.
FIELD_GET_METHOD - Static variable in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Identifies a getter method in a JMX Descriptor.
FIELD_LOG - Static variable in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Constant identifier for the log field in a JMX Descriptor.
FIELD_LOG_FILE - Static variable in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Constant identifier for the logfile field in a JMX Descriptor.
FIELD_METRIC_CATEGORY - Static variable in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Constant identifier for the custom metricCategory field in a JMX Descriptor.
FIELD_METRIC_TYPE - Static variable in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Constant identifier for the metricType field in a JMX Descriptor.
FIELD_PERSIST_LOCATION - Static variable in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Constant identifier for the persistLocation field in a JMX Descriptor.
FIELD_PERSIST_NAME - Static variable in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Constant identifier for the persistName field in a JMX Descriptor.
FIELD_PERSIST_PERIOD - Static variable in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Constant identifier for the persistPeriod field in a JMX Descriptor.
FIELD_PERSIST_POLICY - Static variable in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Constant identifier for the persistPolicy field in a JMX Descriptor.
FIELD_ROLE - Static variable in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Constant identifier for the role field in a JMX Descriptor.
FIELD_SET_METHOD - Static variable in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Identifies a setter method in a JMX Descriptor.
FIELD_UNITS - Static variable in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Constant identifier for the units field in a JMX Descriptor.
FIELD_VISIBILITY - Static variable in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Constant identifier for the visibility field in a JMX Descriptor.
FieldError - Class in org.springframework.validation
Encapsulates a field error, that is, a reason for rejecting a specific field value.
FieldError(String, String, String) - Constructor for class org.springframework.validation.FieldError
Create a new FieldError instance.
FieldError(String, String, Object, boolean, String[], Object[], String) - Constructor for class org.springframework.validation.FieldError
Create a new FieldError instance.
FieldRetrievingFactoryBean - Class in org.springframework.beans.factory.config
FactoryBean which retrieves a static or non-static field value.
FieldRetrievingFactoryBean() - Constructor for class org.springframework.beans.factory.config.FieldRetrievingFactoryBean
FILE_URL_PREFIX - Static variable in class org.springframework.util.ResourceUtils
URL prefix for loading from the file system: "file:"
FileCopyUtils - Class in org.springframework.util
Simple utility methods for file and stream copying.
FileCopyUtils() - Constructor for class org.springframework.util.FileCopyUtils
FileEditor - Class in org.springframework.beans.propertyeditors
Editor for java.io.File, to directly populate a File property from a Spring resource location.
FileEditor() - Constructor for class org.springframework.beans.propertyeditors.FileEditor
Create a new FileEditor, using the default ResourceEditor underneath.
FileEditor(ResourceEditor) - Constructor for class org.springframework.beans.propertyeditors.FileEditor
Create a new FileEditor, using the given ResourceEditor underneath.
FileSystemResource - Class in org.springframework.core.io
Resource implementation for java.io.File handles.
FileSystemResource(File) - Constructor for class org.springframework.core.io.FileSystemResource
Create a new FileSystemResource from a File handle.
FileSystemResource(String) - Constructor for class org.springframework.core.io.FileSystemResource
Create a new FileSystemResource from a file path.
FileSystemResourceLoader - Class in org.springframework.core.io
ResourceLoader implementation that resolves plain paths as file system resources rather than as class path resources (the latter is DefaultResourceLoader's default strategy).
FileSystemResourceLoader() - Constructor for class org.springframework.core.io.FileSystemResourceLoader
FileSystemUtils - Class in org.springframework.util
Utility methods for working with the file system.
FileSystemUtils() - Constructor for class org.springframework.util.FileSystemUtils
FileSystemXmlApplicationContext - Class in org.springframework.context.support
Standalone XML application context, taking the context definition files from the file system or from URLs, interpreting plain paths as relative file system locations (e.g.
FileSystemXmlApplicationContext() - Constructor for class org.springframework.context.support.FileSystemXmlApplicationContext
Create a new FileSystemXmlApplicationContext for bean-style configuration.
FileSystemXmlApplicationContext(ApplicationContext) - Constructor for class org.springframework.context.support.FileSystemXmlApplicationContext
Create a new FileSystemXmlApplicationContext for bean-style configuration.
FileSystemXmlApplicationContext(String) - Constructor for class org.springframework.context.support.FileSystemXmlApplicationContext
Create a new FileSystemXmlApplicationContext, loading the definitions from the given XML file and automatically refreshing the context.
FileSystemXmlApplicationContext(String...) - Constructor for class org.springframework.context.support.FileSystemXmlApplicationContext
Create a new FileSystemXmlApplicationContext, loading the definitions from the given XML files and automatically refreshing the context.
FileSystemXmlApplicationContext(String[], ApplicationContext) - Constructor for class org.springframework.context.support.FileSystemXmlApplicationContext
Create a new FileSystemXmlApplicationContext with the given parent, loading the definitions from the given XML files and automatically refreshing the context.
FileSystemXmlApplicationContext(String[], boolean) - Constructor for class org.springframework.context.support.FileSystemXmlApplicationContext
Create a new FileSystemXmlApplicationContext, loading the definitions from the given XML files.
FileSystemXmlApplicationContext(String[], boolean, ApplicationContext) - Constructor for class org.springframework.context.support.FileSystemXmlApplicationContext
Create a new FileSystemXmlApplicationContext with the given parent, loading the definitions from the given XML files.
fillInClientStackTraceIfPossible(Throwable) - Static method in class org.springframework.remoting.support.RemoteInvocationUtils
Fill the current client-side stack trace into the given exception.
fillProperties(Properties, Resource) - Static method in class org.springframework.core.io.support.PropertiesLoaderUtils
Fill the given properties from the given resource.
fillReport(Map<String, Object>) - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
Create a populated JasperPrint instance from the configured JasperReport instance.
filter(List<Method>) - Method in interface org.springframework.expression.MethodFilter
Called by the method resolver to allow the SpEL user to organize the list of candidate methods that may be invoked.
FilterDefinitionFactoryBean - Class in org.springframework.orm.hibernate3
Convenient FactoryBean for defining Hibernate FilterDefinitions.
FilterDefinitionFactoryBean() - Constructor for class org.springframework.orm.hibernate3.FilterDefinitionFactoryBean
filterModel(Map<String, Object>) - Method in class org.springframework.web.servlet.view.json.MappingJacksonJsonView
Filters out undesired attributes from the given model.
filterPropertyDescriptorsForDependencyCheck(BeanWrapper) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Extract a filtered set of PropertyDescriptors from the given BeanWrapper, excluding ignored dependency types or properties defined on ignored dependency interfaces.
FilterType - Enum in org.springframework.context.annotation
Enumeration of the valid type filters to be added for annotation-driven configuration.
find(String) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Execute an HQL query.
find(String, Object) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Execute an HQL query, binding one value to a "?" parameter in the query string.
find(String, Object...) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Execute an HQL query, binding a number of values to "?" parameters in the query string.
find(String) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
find(String, Object) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
find(String, Object...) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
find(Class<T>) - Method in interface org.springframework.orm.jdo.JdoOperations
Find all persistent instances of the given class.
find(Class<T>, String) - Method in interface org.springframework.orm.jdo.JdoOperations
Find all persistent instances of the given class that match the given JDOQL filter.
find(Class<T>, String, String) - Method in interface org.springframework.orm.jdo.JdoOperations
Find all persistent instances of the given class that match the given JDOQL filter, with the given result ordering.
find(Class<T>, String, String, Object...) - Method in interface org.springframework.orm.jdo.JdoOperations
Find all persistent instances of the given class that match the given JDOQL filter, using the given parameter declarations and parameter values.
find(Class<T>, String, String, Object[], String) - Method in interface org.springframework.orm.jdo.JdoOperations
Find all persistent instances of the given class that match the given JDOQL filter, using the given parameter declarations and parameter values, with the given result ordering.
find(Class<T>, String, String, Map<String, ?>) - Method in interface org.springframework.orm.jdo.JdoOperations
Find all persistent instances of the given class that match the given JDOQL filter, using the given parameter declarations and parameter values.
find(Class<T>, String, String, Map<String, ?>, String) - Method in interface org.springframework.orm.jdo.JdoOperations
Find all persistent instances of the given class that match the given JDOQL filter, using the given parameter declarations and parameter values, with the given result ordering.
find(String, Object) - Method in interface org.springframework.orm.jdo.JdoOperations
Find persistent instances through the given query object in the specified query language.
find(String) - Method in interface org.springframework.orm.jdo.JdoOperations
Find persistent instances through the given single-string JDOQL query.
find(String, Object...) - Method in interface org.springframework.orm.jdo.JdoOperations
Find persistent instances through the given single-string JDOQL query.
find(String, Map<String, ?>) - Method in interface org.springframework.orm.jdo.JdoOperations
Find persistent instances through the given single-string JDOQL query.
find(Class<T>) - Method in class org.springframework.orm.jdo.JdoTemplate
find(Class<T>, String) - Method in class org.springframework.orm.jdo.JdoTemplate
find(Class<T>, String, String) - Method in class org.springframework.orm.jdo.JdoTemplate
find(Class<T>, String, String, Object...) - Method in class org.springframework.orm.jdo.JdoTemplate
find(Class<T>, String, String, Object[], String) - Method in class org.springframework.orm.jdo.JdoTemplate
find(Class<T>, String, String, Map<String, ?>) - Method in class org.springframework.orm.jdo.JdoTemplate
find(Class<T>, String, String, Map<String, ?>, String) - Method in class org.springframework.orm.jdo.JdoTemplate
find(String, Object) - Method in class org.springframework.orm.jdo.JdoTemplate
find(String) - Method in class org.springframework.orm.jdo.JdoTemplate
find(String, Object...) - Method in class org.springframework.orm.jdo.JdoTemplate
find(String, Map<String, ?>) - Method in class org.springframework.orm.jdo.JdoTemplate
find(Class<T>, Object) - Method in interface org.springframework.orm.jpa.JpaOperations
find(String) - Method in interface org.springframework.orm.jpa.JpaOperations
find(String, Object...) - Method in interface org.springframework.orm.jpa.JpaOperations
find(Class<T>, Object) - Method in class org.springframework.orm.jpa.JpaTemplate
find(String) - Method in class org.springframework.orm.jpa.JpaTemplate
find(String, Object...) - Method in class org.springframework.orm.jpa.JpaTemplate
findAdvisorBeans() - Method in class org.springframework.aop.framework.autoproxy.BeanFactoryAdvisorRetrievalHelper
Find all eligible Advisor beans in the current bean factory, ignoring FactoryBeans and excluding beans that are currently in creation.
findAdvisorsThatCanApply(List<Advisor>, Class, String) - Method in class org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
Search the given candidate Advisors to find all Advisors that can apply to the specified bean.
findAdvisorsThatCanApply(List<Advisor>, Class<?>) - Static method in class org.springframework.aop.support.AopUtils
Determine the sublist of the candidateAdvisors list that is applicable to the given class.
findAllClassPathResources(String) - Method in class org.springframework.core.io.support.PathMatchingResourcePatternResolver
Find all class location resources with the given location via the ClassLoader.
findAnnotation(Method, Class<A>) - Static method in class org.springframework.core.annotation.AnnotationUtils
Get a single Annotation of annotationType from the supplied Method, traversing its super methods if no annotation can be found on the given method itself.
findAnnotation(Class<?>, Class<A>) - Static method in class org.springframework.core.annotation.AnnotationUtils
Find a single Annotation of annotationType from the supplied Class, traversing its interfaces and super classes if no annotation can be found on the given class itself.
findAnnotationDeclaringClass(Class<? extends Annotation>, Class<?>) - Static method in class org.springframework.core.annotation.AnnotationUtils
Find the first Class in the inheritance hierarchy of the specified clazz (including the specified clazz itself) which declares an annotation for the specified annotationType, or null if not found.
findAnnotationOnBean(String, Class<A>) - Method in interface org.springframework.beans.factory.ListableBeanFactory
Find a Annotation of annotationType on the specified bean, traversing its interfaces and super classes if no annotation can be found on the given class itself.
findAnnotationOnBean(String, Class<A>) - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
Find a Annotation of annotationType on the specified bean, traversing its interfaces and super classes if no annotation can be found on the given class itself, as well as checking its raw bean class if not found on the exposed bean reference (e.g.
findAnnotationOnBean(String, Class<A>) - Method in class org.springframework.beans.factory.support.StaticListableBeanFactory
findAnnotationOnBean(String, Class<A>) - Method in class org.springframework.context.support.AbstractApplicationContext
findAspectJAnnotationOnMethod(Method) - Static method in class org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory
Find and return the first AspectJ annotation on the given method (there should only be one anyway...)
findAttribute(String) - Method in class org.springframework.mock.web.MockPageContext
findAutowireCandidates(Class<T>) - Method in class org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor
Obtain all beans of the given type as autowire candidates.
findAutowireCandidates(String, Class, DependencyDescriptor) - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
Find bean instances that match the required type.
findBridgedMethod(Method) - Static method in class org.springframework.core.BridgeMethodResolver
Find the original method for the supplied bridge Method.
findByCriteria(DetachedCriteria) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Execute a query based on a given Hibernate criteria object.
findByCriteria(DetachedCriteria, int, int) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Execute a query based on the given Hibernate criteria object.
findByCriteria(DetachedCriteria) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
findByCriteria(DetachedCriteria, int, int) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
findByExample(Object) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Execute a query based on the given example entity object.
findByExample(String, Object) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Execute a query based on the given example entity object.
findByExample(Object, int, int) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Execute a query based on a given example entity object.
findByExample(String, Object, int, int) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Execute a query based on a given example entity object.
findByExample(Object) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
findByExample(String, Object) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
findByExample(Object, int, int) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
findByExample(String, Object, int, int) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
findByNamedParam(String, String, Object) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Execute an HQL query, binding one value to a ":" named parameter in the query string.
findByNamedParam(String, String[], Object[]) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Execute an HQL query, binding a number of values to ":" named parameters in the query string.
findByNamedParam(String, String, Object) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
findByNamedParam(String, String[], Object[]) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
findByNamedParams(String, Map<String, ?>) - Method in interface org.springframework.orm.jpa.JpaOperations
findByNamedParams(String, Map<String, ?>) - Method in class org.springframework.orm.jpa.JpaTemplate
findByNamedQuery(String) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Execute a named query.
findByNamedQuery(String, Object) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Execute a named query, binding one value to a "?" parameter in the query string.
findByNamedQuery(String, Object...) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Execute a named query binding a number of values to "?" parameters in the query string.
findByNamedQuery(String) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
findByNamedQuery(String, Object) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
findByNamedQuery(String, Object...) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
findByNamedQuery(Class<T>, String) - Method in interface org.springframework.orm.jdo.JdoOperations
Find persistent instances through the given named query.
findByNamedQuery(Class<T>, String, Object...) - Method in interface org.springframework.orm.jdo.JdoOperations
Find persistent instances through the given named query.
findByNamedQuery(Class<T>, String, Map<String, ?>) - Method in interface org.springframework.orm.jdo.JdoOperations
Find persistent instances through the given named query.
findByNamedQuery(Class<T>, String) - Method in class org.springframework.orm.jdo.JdoTemplate
findByNamedQuery(Class<T>, String, Object...) - Method in class org.springframework.orm.jdo.JdoTemplate
findByNamedQuery(Class<T>, String, Map<String, ?>) - Method in class org.springframework.orm.jdo.JdoTemplate
findByNamedQuery(String) - Method in interface org.springframework.orm.jpa.JpaOperations
findByNamedQuery(String, Object...) - Method in interface org.springframework.orm.jpa.JpaOperations
findByNamedQuery(String) - Method in class org.springframework.orm.jpa.JpaTemplate
findByNamedQuery(String, Object...) - Method in class org.springframework.orm.jpa.JpaTemplate
findByNamedQueryAndNamedParam(String, String, Object) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Execute a named query, binding one value to a ":" named parameter in the query string.
findByNamedQueryAndNamedParam(String, String[], Object[]) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Execute a named query, binding a number of values to ":" named parameters in the query string.
findByNamedQueryAndNamedParam(String, String, Object) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
findByNamedQueryAndNamedParam(String, String[], Object[]) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
findByNamedQueryAndNamedParams(String, Map<String, ?>) - Method in interface org.springframework.orm.jpa.JpaOperations
findByNamedQueryAndNamedParams(String, Map<String, ?>) - Method in class org.springframework.orm.jpa.JpaTemplate
findByNamedQueryAndValueBean(String, Object) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Execute a named query, binding the properties of the given bean to ":" named parameters in the query string.
findByNamedQueryAndValueBean(String, Object) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
findByValueBean(String, Object) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Execute an HQL query, binding the properties of the given bean to named parameters in the query string.
findByValueBean(String, Object) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
findCandidateAdvisors() - Method in class org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator
findCandidateAdvisors() - Method in class org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
Find all candidate Advisors to use in auto-proxying.
findCandidateComponents(String) - Method in class org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider
Scan the class path for candidate components.
findColumn(String) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
findColumn(String) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Maps the given column name to its column index.
findCustomEditor(Class, String) - Method in interface org.springframework.beans.PropertyEditorRegistry
Find a custom property editor for the given type and property.
findCustomEditor(Class, String) - Method in class org.springframework.beans.PropertyEditorRegistrySupport
findCustomEditor(Class, String) - Method in class org.springframework.validation.DataBinder
findDeclaredMethod(Class<?>, String, Class<?>[]) - Static method in class org.springframework.beans.BeanUtils
Find a method with the given method name and the given parameter types, declared on the given class or one of its superclasses.
findDeclaredMethodWithMinimalParameters(Class<?>, String) - Static method in class org.springframework.beans.BeanUtils
Find a method with the given method name and minimal parameters (best case: none), declared on the given class or one of its superclasses.
findDefaultEntityManagerFactory(String) - Method in class org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
Find a single default EntityManagerFactory in the Spring application context.
findEditor(String, Class) - Method in class org.springframework.validation.AbstractBindingResult
This implementation delegates to the PropertyEditorRegistry's editor lookup facility, if available.
findEditor(String, Class) - Method in class org.springframework.validation.AbstractPropertyBindingResult
This implementation exposes a PropertyEditor adapter for a Formatter, if applicable.
findEditor(String, Class) - Method in exception org.springframework.validation.BindException
findEditor(String, Class) - Method in interface org.springframework.validation.BindingResult
Find a custom property editor for the given type and property.
findEditor(Class) - Method in class org.springframework.web.servlet.support.BindStatus
Find a PropertyEditor for the given value class, associated with the property that this bound status is currently bound to.
findEditorByConvention(Class<?>) - Static method in class org.springframework.beans.BeanUtils
Find a JavaBeans PropertyEditor following the 'Editor' suffix convention (e.g.
findEligibleAdvisors(Class, String) - Method in class org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
Find all eligible Advisors for auto-proxying this class.
findEntityManagerFactory(ListableBeanFactory, String) - Static method in class org.springframework.orm.jpa.EntityManagerFactoryUtils
Find an EntityManagerFactory with the given name in the given Spring application context (represented as ListableBeanFactory).
findEntityManagerFactory(String, String) - Method in class org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
Find an EntityManagerFactory with the given name in the current Spring application context, falling back to a single default EntityManagerFactory (if any) in case of no unit name specified.
findField(String, Class<?>, boolean) - Method in class org.springframework.expression.spel.support.ReflectivePropertyAccessor
Find a field of a certain name on a specified class
findField(Class<?>, String) - Static method in class org.springframework.util.ReflectionUtils
Attempt to find a field on the supplied Class with the supplied name.
findField(Class<?>, String, Class<?>) - Static method in class org.springframework.util.ReflectionUtils
Attempt to find a field on the supplied Class with the supplied name and/or type.
findFirstMatch(Collection, Collection) - Static method in class org.springframework.util.CollectionUtils
Return the first element in 'candidates' that is contained in 'source'.
findGetterForProperty(String, Class<?>, boolean) - Method in class org.springframework.expression.spel.support.ReflectivePropertyAccessor
Find a getter method for the specified property.
findLabeledEnums(Class) - Method in class org.springframework.core.enums.AbstractCachingLabeledEnumResolver
Deprecated. Template method to be implemented by subclasses.
findLabeledEnums(Class) - Method in class org.springframework.core.enums.StaticLabeledEnumResolver
Deprecated.
findLocalizedResource(String, String, Locale) - Method in class org.springframework.core.io.support.LocalizedResourceHelper
Find the most specific localized resource for the given name, extension and locale:
findMatchingMethod() - Method in class org.springframework.beans.support.ArgumentConvertingMethodInvoker
This implementation looks for a method with matching parameter types.
findMatchingMethod() - Method in class org.springframework.util.MethodInvoker
Find a matching method with the specified name for the specified arguments.
findMatchingViewName(Properties, Exception) - Method in class org.springframework.web.portlet.handler.SimpleMappingExceptionResolver
Find a matching view name in the given exception mappings
findMatchingViewName(Properties, Exception) - Method in class org.springframework.web.servlet.handler.SimpleMappingExceptionResolver
Find a matching view name in the given exception mappings.
findMethod(Class<?>, String, Class<?>...) - Static method in class org.springframework.beans.BeanUtils
Find a method with the given method name and the given parameter types, declared on the given class or one of its superclasses.
findMethod(Class<?>, String) - Static method in class org.springframework.util.ReflectionUtils
Attempt to find a Method on the supplied class with the supplied name and no parameters.
findMethod(Class<?>, String, Class<?>...) - Static method in class org.springframework.util.ReflectionUtils
Attempt to find a Method on the supplied class with the supplied name and parameter types.
findMethodWithMinimalParameters(Class<?>, String) - Static method in class org.springframework.beans.BeanUtils
Find a method with the given method name and minimal parameters (best case: none), declared on the given class or one of its superclasses.
findMethodWithMinimalParameters(Method[], String) - Static method in class org.springframework.beans.BeanUtils
Find a method with the given method name and minimal parameters (best case: none) in the given list of methods.
findNamedEntityManagerFactory(String, String) - Method in class org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
Find an EntityManagerFactory with the given name in the current Spring application context.
findObject(Object[], Map) - Method in class org.springframework.jdbc.object.SqlQuery
Generic object finder method, used by all other findObject methods.
findObject(Object...) - Method in class org.springframework.jdbc.object.SqlQuery
Convenient method to find a single object without context.
findObject(int, Map) - Method in class org.springframework.jdbc.object.SqlQuery
Convenient method to find a single object given a single int parameter and a context.
findObject(int) - Method in class org.springframework.jdbc.object.SqlQuery
Convenient method to find a single object given a single int parameter.
findObject(int, int, Map) - Method in class org.springframework.jdbc.object.SqlQuery
Convenient method to find a single object given two int parameters and a context.
findObject(int, int) - Method in class org.springframework.jdbc.object.SqlQuery
Convenient method to find a single object given two int parameters.
findObject(long, Map) - Method in class org.springframework.jdbc.object.SqlQuery
Convenient method to find a single object given a single long parameter and a context.
findObject(long) - Method in class org.springframework.jdbc.object.SqlQuery
Convenient method to find a single object given a single long parameter.
findObject(String, Map) - Method in class org.springframework.jdbc.object.SqlQuery
Convenient method to find a single object given a single String parameter and a context.
findObject(String) - Method in class org.springframework.jdbc.object.SqlQuery
Convenient method to find a single object given a single String parameter.
findObjectByNamedParam(Map<String, ?>, Map) - Method in class org.springframework.jdbc.object.SqlQuery
Generic object finder method for named parameters.
findObjectByNamedParam(Map<String, ?>) - Method in class org.springframework.jdbc.object.SqlQuery
Convenient method to execute without context.
findParameterValue(ServletRequest, String) - Static method in class org.springframework.web.util.WebUtils
Obtain a named parameter from the given request parameters.
findParameterValue(Map<String, ?>, String) - Static method in class org.springframework.web.util.WebUtils
Obtain a named parameter from the given request parameters.
findPathMatchingResources(String) - Method in class org.springframework.core.io.support.PathMatchingResourcePatternResolver
Find all resources that match the given location pattern via the Ant-style PathMatcher.
findPropertyForMethod(Method) - Static method in class org.springframework.beans.BeanUtils
Find a JavaBeans PropertyDescriptor for the given method, with the method either being the read method or the write method for that bean property.
findPropertyType(String, Class<?>[]) - Static method in class org.springframework.beans.BeanUtils
Determine the bean property type for the given property from the given classes/interfaces, if possible.
findRequiredWebApplicationContext(ActionServlet, ModuleConfig) - Static method in class org.springframework.web.struts.DelegatingActionUtils
Deprecated. Find most specific context available: check ContextLoaderPlugIn's WebApplicationContext first, fall back to root WebApplicationContext else.
findResourceInternal(String, String) - Method in class org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader
findScheduler(String) - Method in class org.springframework.scheduling.quartz.SchedulerAccessorBean
findSetterForProperty(String, Class<?>, boolean) - Method in class org.springframework.expression.spel.support.ReflectivePropertyAccessor
Find a setter method for the specified property.
findTemplateSource(String) - Method in class org.springframework.ui.freemarker.SpringTemplateLoader
findTransactionAttribute(Method) - Method in class org.springframework.transaction.annotation.AnnotationTransactionAttributeSource
findTransactionAttribute(Class) - Method in class org.springframework.transaction.annotation.AnnotationTransactionAttributeSource
findTransactionAttribute(Method) - Method in class org.springframework.transaction.interceptor.AbstractFallbackTransactionAttributeSource
Subclasses need to implement this to return the transaction attribute for the given method, if any.
findTransactionAttribute(Class) - Method in class org.springframework.transaction.interceptor.AbstractFallbackTransactionAttributeSource
Subclasses need to implement this to return the transaction attribute for the given class, if any.
findTransactionManager(UserTransaction) - Method in class org.springframework.transaction.jta.JtaTransactionManager
Find the JTA TransactionManager through autodetection: checking whether the UserTransaction object implements the TransactionManager, and checking the fallback JNDI locations.
findTransactionSynchronizationRegistry(UserTransaction, TransactionManager) - Method in class org.springframework.transaction.jta.JtaTransactionManager
Find the JTA 1.1 TransactionSynchronizationRegistry through autodetection: checking whether the UserTransaction object or TransactionManager object implements it, and checking Java EE 5's standard JNDI location.
findType(String) - Method in class org.springframework.expression.spel.ExpressionState
findType(String) - Method in class org.springframework.expression.spel.support.StandardTypeLocator
Find a (possibly unqualified) type reference - first using the typename as is, then trying any registered prefixes if the typename cannot be found.
findType(String) - Method in interface org.springframework.expression.TypeLocator
Find a type by name.
findUniqueProfileValueSourceFromContext(ApplicationContext) - Method in class org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests
Deprecated. Use @ProfileValueSourceConfiguration instead.
findUserTransaction() - Method in class org.springframework.transaction.jta.JtaTransactionManager
Find the JTA UserTransaction through a default JNDI lookup: "java:comp/UserTransaction".
findValue(Annotation[]) - Method in class org.springframework.beans.factory.annotation.QualifierAnnotationAutowireCandidateResolver
Determine a suggested value from any of the given candidate annotations.
findValueOfType(Collection<?>, Class<T>) - Static method in class org.springframework.util.CollectionUtils
Find a single value of the given type in the given Collection.
findValueOfType(Collection<?>, Class<?>[]) - Static method in class org.springframework.util.CollectionUtils
Find a single value of one of the given types in the given Collection: searching the Collection for a value of the first type, then searching for a value of the second type, etc.
findWebApplicationContext() - Method in class org.springframework.web.filter.DelegatingFilterProxy
Retrieve a WebApplicationContext from the ServletContext attribute with the configured name.
findWebApplicationContext() - Method in class org.springframework.web.servlet.FrameworkServlet
Retrieve a WebApplicationContext from the ServletContext attribute with the configured name.
finishBeanFactoryInitialization(ConfigurableListableBeanFactory) - Method in class org.springframework.context.support.AbstractApplicationContext
Finish the initialization of this context's bean factory, initializing all remaining singleton beans.
finishRefresh() - Method in class org.springframework.context.support.AbstractApplicationContext
Finish the refresh of this context, invoking the LifecycleProcessor's onRefresh() method and publishing the ContextRefreshedEvent.
fireAliasRegistered(String, String, Object) - Method in class org.springframework.beans.factory.parsing.ReaderContext
fireComponentRegistered(ComponentDefinition) - Method in class org.springframework.beans.factory.parsing.ReaderContext
fireDefaultsRegistered(DefaultsDefinition) - Method in class org.springframework.beans.factory.parsing.ReaderContext
fireImportProcessed(String, Object) - Method in class org.springframework.beans.factory.parsing.ReaderContext
fireImportProcessed(String, Resource[], Object) - Method in class org.springframework.beans.factory.parsing.ReaderContext
FIRST - Static variable in class org.springframework.expression.spel.ast.Selection
first() - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
first() - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Moves the cursor to the first row of this RowSet.
fixedField(String) - Method in class org.springframework.validation.AbstractErrors
Transform the given field into its full path, regarding the nested path of this instance.
FixedLocaleResolver - Class in org.springframework.web.servlet.i18n
LocaleResolver implementation that always returns a fixed default locale.
FixedLocaleResolver() - Constructor for class org.springframework.web.servlet.i18n.FixedLocaleResolver
Create a default FixedLocaleResolver, exposing a configured default locale (or the JVM's default locale as fallback).
FixedLocaleResolver(Locale) - Constructor for class org.springframework.web.servlet.i18n.FixedLocaleResolver
Create a FixedLocaleResolver that exposes the given locale.
FixedThemeResolver - Class in org.springframework.web.servlet.theme
Implementation of ThemeResolver that simply uses a fixed theme.
FixedThemeResolver() - Constructor for class org.springframework.web.servlet.theme.FixedThemeResolver
flush() - Method in class org.springframework.jdbc.datasource.JdbcTransactionObjectSupport
flush() - Method in class org.springframework.jdbc.object.BatchSqlUpdate
Trigger any queued update operations to be added as a final batch.
flush() - Method in class org.springframework.mock.web.DelegatingServletOutputStream
flush() - Method in class org.springframework.mock.web.MockJspWriter
flush() - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Flush all pending saves, updates and deletes to the database.
flush() - Method in class org.springframework.orm.hibernate3.HibernateTemplate
flush() - Method in interface org.springframework.orm.jdo.JdoOperations
Flush all transactional modifications to the database.
flush() - Method in class org.springframework.orm.jdo.JdoTemplate
flush() - Method in interface org.springframework.orm.jpa.JpaOperations
flush() - Method in class org.springframework.orm.jpa.JpaTemplate
flush() - Method in class org.springframework.transaction.jta.JtaTransactionObject
This implementation triggers flush callbacks, assuming that they will flush all affected ORM sessions.
flush() - Method in class org.springframework.transaction.support.AbstractTransactionStatus
This implementations is empty, considering flush as a no-op.
flush() - Method in class org.springframework.transaction.support.DefaultTransactionStatus
Delegate the flushing to the transaction object, provided that the latter implements the SmartTransactionObject interface.
flush() - Method in class org.springframework.transaction.support.ResourceHolderSynchronization
flush() - Method in interface org.springframework.transaction.support.SmartTransactionObject
Flush the underlying sessions to the datastore, if applicable: for example, all affected Hibernate/JPA sessions.
flush() - Method in interface org.springframework.transaction.support.TransactionSynchronization
Flush the underlying session to the datastore, if applicable: for example, a Hibernate/JPA session.
flush() - Method in class org.springframework.transaction.support.TransactionSynchronizationAdapter
flush() - Method in interface org.springframework.transaction.TransactionStatus
Flush the underlying session to the datastore, if applicable: for example, all affected Hibernate/JPA sessions.
flush() - Method in class org.springframework.util.CommonsLogWriter
FLUSH_ALWAYS - Static variable in class org.springframework.orm.hibernate3.HibernateAccessor
Flushing before every query statement is rarely necessary.
FLUSH_AUTO - Static variable in class org.springframework.orm.hibernate3.HibernateAccessor
Automatic flushing is the default mode for a Hibernate Session.
FLUSH_COMMIT - Static variable in class org.springframework.orm.hibernate3.HibernateAccessor
Flushing at commit only is intended for units of work where no intermediate flushing is desired, not even for find operations that might involve already modified instances.
FLUSH_EAGER - Static variable in class org.springframework.orm.hibernate3.HibernateAccessor
Eager flushing leads to immediate synchronization with the database, even if in a transaction.
FLUSH_NEVER - Static variable in class org.springframework.orm.hibernate3.HibernateAccessor
Never flush is a good strategy for read-only units of work.
flushBuffer() - Method in class org.springframework.mock.web.MockHttpServletResponse
flushBuffer() - Method in class org.springframework.mock.web.portlet.MockMimeResponse
flushBufferedBodyContent(BodyContent) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementBodyTag
The user customised the output of the error messages - flush the buffered content into the main JspWriter.
flushIfNecessary(Session, boolean) - Method in class org.springframework.orm.hibernate3.HibernateAccessor
Flush the given Hibernate Session if necessary.
flushIfNecessary(PersistenceManager, boolean) - Method in class org.springframework.orm.jdo.JdoAccessor
Flush the given JDO persistence manager if necessary.
flushIfNecessary(EntityManager, boolean) - Method in class org.springframework.orm.jpa.JpaAccessor
Flush the given JPA entity manager if necessary.
flushResource(H) - Method in class org.springframework.transaction.support.ResourceHolderSynchronization
Flush callback for the given resource holder.
forBeanPropertyAccess(Object) - Static method in class org.springframework.beans.PropertyAccessorFactory
Obtain a BeanWrapper for the given target object, accessing properties in JavaBeans style.
forceAutoProxyCreatorToUseClassProxying(BeanDefinitionRegistry) - Static method in class org.springframework.aop.config.AopConfigUtils
forceAutoProxyCreatorToUseClassProxying(BeanDefinitionRegistry) - Static method in class org.springframework.aop.config.AopNamespaceUtils
Deprecated. since Spring 2.5, in favor of AopConfigUtils.forceAutoProxyCreatorToUseClassProxying(BeanDefinitionRegistry)
forceBlock() - Method in class org.springframework.web.servlet.tags.form.TagWriter
Indicate that the currently open tag should be closed and marked as a block level element.
forClass(Class) - Static method in class org.springframework.aop.target.EmptyTargetSource
Return an EmptyTargetSource for the given target Class.
forClass(Class, boolean) - Static method in class org.springframework.aop.target.EmptyTargetSource
Return an EmptyTargetSource for the given target Class.
forClassAnnotation(Class<? extends Annotation>) - Static method in class org.springframework.aop.support.annotation.AnnotationMatchingPointcut
Factory method for an AnnotationMatchingPointcut that matches for the specified annotation at the class level.
forDirectFieldAccess(Object) - Static method in class org.springframework.beans.PropertyAccessorFactory
Obtain a PropertyAccessor for the given target object, accessing properties in direct field style.
forElementType(Class<?>) - Method in class org.springframework.core.convert.TypeDescriptor
Create a copy of this type descriptor, preserving the context information but exposing the specified element type (e.g.
formatClassNameForMessage(Class<?>) - Static method in class org.springframework.expression.spel.ast.FormatHelper
Produce a nice string for a given class object.
formatFieldValue(String, Object) - Method in class org.springframework.validation.AbstractBindingResult
Format the given value for the specified field.
formatFieldValue(String, Object) - Method in class org.springframework.validation.AbstractPropertyBindingResult
Formats the field value based on registered PropertyEditors.
FormatHelper - Class in org.springframework.expression.spel.ast
Utility methods (formatters, etc) used during parsing and evaluation.
FormatHelper() - Constructor for class org.springframework.expression.spel.ast.FormatHelper
formatMessage(String, Object[], Locale) - Method in class org.springframework.context.support.MessageSourceSupport
Format the given message String, using cached MessageFormats.
formatMessage(int, Object...) - Method in enum org.springframework.expression.spel.SpelMessage
Produce a complete message including the prefix, the position (if known) and with the inserts applied to the message.
formatMethodForMessage(String, Class<?>...) - Static method in class org.springframework.expression.spel.ast.FormatHelper
Produce a nice string for a given method name with specified arguments.
Formatter<T> - Interface in org.springframework.format
Formats objects of type T.
FormatterRegistry - Interface in org.springframework.format
A registry of field formatting logic.
FormattingConversionService - Class in org.springframework.format.support
A ConversionService implementation designed to be configured as a FormatterRegistry.
FormattingConversionService() - Constructor for class org.springframework.format.support.FormattingConversionService
FormattingConversionServiceFactoryBean - Class in org.springframework.format.support
A factory for a FormattingConversionService that installs default formatters for common types such as numbers and datetimes.
FormattingConversionServiceFactoryBean() - Constructor for class org.springframework.format.support.FormattingConversionServiceFactoryBean
formBackingObject(PortletRequest) - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Retrieve a backing object for the current form from the given request.
formBackingObject(HttpServletRequest) - Method in class org.springframework.web.servlet.mvc.AbstractFormController
Deprecated. Retrieve a backing object for the current form from the given request.
forMethodAnnotation(Class<? extends Annotation>) - Static method in class org.springframework.aop.support.annotation.AnnotationMatchingPointcut
Factory method for an AnnotationMatchingPointcut that matches for the specified annotation at the method level.
forMethodOrConstructor(Object, int) - Static method in class org.springframework.core.MethodParameter
Create a new MethodParameter for the given method or constructor.
FormHttpMessageConverter - Class in org.springframework.http.converter
Implementation of HttpMessageConverter that can handle form data, including multipart form data (i.e.
FormHttpMessageConverter() - Constructor for class org.springframework.http.converter.FormHttpMessageConverter
FormTag - Class in org.springframework.web.servlet.tags.form
Databinding-aware JSP tag for rendering an HTML 'form' whose inner elements are bound to properties on a form object.
FormTag() - Constructor for class org.springframework.web.servlet.tags.form.FormTag
forName(String) - Static method in class org.springframework.util.ClassUtils
Deprecated. as of Spring 3.0, in favor of specifying a ClassLoader explicitly: see ClassUtils.forName(String, ClassLoader)
forName(String, ClassLoader) - Static method in class org.springframework.util.ClassUtils
Replacement for Class.forName() that also returns Class instances for primitives (e.g."int") and array class names (e.g.
forObject(Object) - Static method in class org.springframework.core.convert.TypeDescriptor
Create a new type descriptor for the class of the given object.
forValue(boolean) - Static method in class org.springframework.expression.spel.support.BooleanTypedValue
forward(String) - Method in class org.springframework.mock.web.MockPageContext
forward(ServletRequest, ServletResponse) - Method in class org.springframework.mock.web.MockRequestDispatcher
forward(PortletRequest, PortletResponse) - Method in class org.springframework.mock.web.portlet.MockPortletRequestDispatcher
FORWARD_CONTEXT_PATH_ATTRIBUTE - Static variable in class org.springframework.web.util.WebUtils
FORWARD_PATH_INFO_ATTRIBUTE - Static variable in class org.springframework.web.util.WebUtils
FORWARD_QUERY_STRING_ATTRIBUTE - Static variable in class org.springframework.web.util.WebUtils
FORWARD_REQUEST_URI_ATTRIBUTE - Static variable in class org.springframework.web.util.WebUtils
Standard Servlet 2.4+ spec request attributes for forward URI and paths.
FORWARD_SERVLET_PATH_ATTRIBUTE - Static variable in class org.springframework.web.util.WebUtils
FORWARD_URL_PREFIX - Static variable in class org.springframework.web.servlet.view.UrlBasedViewResolver
Prefix for special view names that specify a forward URL (usually to a controller after a form has been submitted and processed).
FrameworkPortlet - Class in org.springframework.web.portlet
Base portlet for Spring's portlet framework.
FrameworkPortlet() - Constructor for class org.springframework.web.portlet.FrameworkPortlet
FrameworkServlet - Class in org.springframework.web.servlet
Base servlet for Spring's web framework.
FrameworkServlet() - Constructor for class org.springframework.web.servlet.FrameworkServlet
FreeMarkerConfig - Interface in org.springframework.web.servlet.view.freemarker
Interface to be implemented by objects that configure and manage a FreeMarker Configuration object in a web environment.
FreeMarkerConfigurationFactory - Class in org.springframework.ui.freemarker
Factory that configures a FreeMarker Configuration.
FreeMarkerConfigurationFactory() - Constructor for class org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
FreeMarkerConfigurationFactoryBean - Class in org.springframework.ui.freemarker
Factory bean that creates a FreeMarker Configuration and provides it as bean reference.
FreeMarkerConfigurationFactoryBean() - Constructor for class org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean
FreeMarkerConfigurer - Class in org.springframework.web.servlet.view.freemarker
JavaBean to configure FreeMarker for web usage, via the "configLocation" and/or "freemarkerSettings" and/or "templateLoaderPath" properties.
FreeMarkerConfigurer() - Constructor for class org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer
FreeMarkerTemplateUtils - Class in org.springframework.ui.freemarker
Utility class for working with FreeMarker.
FreeMarkerTemplateUtils() - Constructor for class org.springframework.ui.freemarker.FreeMarkerTemplateUtils
FreeMarkerView - Class in org.springframework.web.servlet.view.freemarker
View using the FreeMarker template engine.
FreeMarkerView() - Constructor for class org.springframework.web.servlet.view.freemarker.FreeMarkerView
FreeMarkerViewResolver - Class in org.springframework.web.servlet.view.freemarker
Convenience subclass of UrlBasedViewResolver that supports FreeMarkerView (i.e.
FreeMarkerViewResolver() - Constructor for class org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver
freezeConfiguration() - Method in interface org.springframework.beans.factory.config.ConfigurableListableBeanFactory
Freeze all bean definitions, signalling that the registered bean definitions will not be modified or post-processed any further.
freezeConfiguration() - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
freshTarget() - Method in class org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource
Obtain a fresh target object.
freshTarget() - Method in class org.springframework.aop.target.dynamic.BeanFactoryRefreshableTargetSource
Retrieve a fresh target object.
fromMessage(Message) - Method in class org.springframework.jms.support.converter.MarshallingMessageConverter
This implementation unmarshals the given Message into an object.
fromMessage(Message) - Method in interface org.springframework.jms.support.converter.MessageConverter
Convert from a JMS Message to a Java object.
fromMessage(Message) - Method in class org.springframework.jms.support.converter.SimpleMessageConverter
This implementation converts a TextMessage back to a String, a ByteMessage back to a byte array, a MapMessage back to a Map, and an ObjectMessage back to a Serializable object.
FunctionReference - Class in org.springframework.expression.spel.ast
A function reference is of the form "#someFunction(a,b,c)".
FunctionReference(String, int, SpelNodeImpl...) - Constructor for class org.springframework.expression.spel.ast.FunctionReference
Overview Package Class Tree Deprecated Index Help
A B C D E F G H I J K L M N O P Q R S T U V W X


G-Index

PREV LETTER NEXT LETTER FRAMES NO FRAMES
A B C D E F G H I J K L M N O P Q R S T U V W X

G

generateBeanName(BeanDefinition, BeanDefinitionRegistry, boolean) - Static method in class org.springframework.beans.factory.support.BeanDefinitionReaderUtils
Generate a bean name for the given bean definition, unique within the given bean factory.
generateBeanName(BeanDefinition, BeanDefinitionRegistry) - Static method in class org.springframework.beans.factory.support.BeanDefinitionReaderUtils
Generate a bean name for the given top-level bean definition, unique within the given bean factory.
generateBeanName(BeanDefinition, BeanDefinitionRegistry) - Method in interface org.springframework.beans.factory.support.BeanNameGenerator
Generate a bean name for the given bean definition.
generateBeanName(BeanDefinition, BeanDefinitionRegistry) - Method in class org.springframework.beans.factory.support.DefaultBeanNameGenerator
generateBeanName(BeanDefinition) - Method in class org.springframework.beans.factory.xml.XmlReaderContext
generateBeanName(BeanDefinition, BeanDefinitionRegistry) - Method in class org.springframework.context.annotation.AnnotationBeanNameGenerator
GENERATED_BEAN_NAME_SEPARATOR - Static variable in class org.springframework.beans.factory.BeanFactoryUtils
Separator for generated bean names.
GENERATED_BEAN_NAME_SEPARATOR - Static variable in class org.springframework.beans.factory.support.BeanDefinitionReaderUtils
Separator for generated bean names.
generateDefaultLocations(Class<?>) - Method in class org.springframework.test.context.support.AbstractContextLoader
Generates the default classpath resource locations array based on the supplied class.
GeneratedKeyHolder - Class in org.springframework.jdbc.support
Default implementation of the KeyHolder interface, to be used for holding auto-generated keys (as potentially returned by JDBC insert statements).
GeneratedKeyHolder() - Constructor for class org.springframework.jdbc.support.GeneratedKeyHolder
Create a new GeneratedKeyHolder with a default list.
GeneratedKeyHolder(List<Map<String, Object>>) - Constructor for class org.springframework.jdbc.support.GeneratedKeyHolder
Create a new GeneratedKeyHolder with a given list.
generateETagHeaderValue(byte[]) - Method in class org.springframework.web.filter.ShallowEtagHeaderFilter
Generate the ETag header value from the given response body byte array.
generateMultipartBoundary() - Method in class org.springframework.http.converter.FormHttpMessageConverter
Generate a multipart boundary.
generatePathMapping(String) - Method in class org.springframework.web.servlet.mvc.support.ControllerBeanNameHandlerMapping
Prepends a '/' if required and appends the URL suffix to the name.
generatePathMappings(Class) - Method in class org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping
Generate the actual URL paths for the given controller class.
generatesDownloadContent() - Method in class org.springframework.web.servlet.view.AbstractView
Return whether this view generates download content (typically binary content like PDF or Excel files).
generatesDownloadContent() - Method in class org.springframework.web.servlet.view.document.AbstractExcelView
generatesDownloadContent() - Method in class org.springframework.web.servlet.view.document.AbstractJExcelView
generatesDownloadContent() - Method in class org.springframework.web.servlet.view.document.AbstractPdfStamperView
generatesDownloadContent() - Method in class org.springframework.web.servlet.view.document.AbstractPdfView
generatesDownloadContent() - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsSingleFormatView
generatesDownloadContent() - Method in class org.springframework.web.servlet.view.jasperreports.JasperReportsMultiFormatView
GenericApplicationContext - Class in org.springframework.context.support
Generic ApplicationContext implementation that holds a single internal DefaultListableBeanFactory instance and does not assume a specific bean definition format.
GenericApplicationContext() - Constructor for class org.springframework.context.support.GenericApplicationContext
Create a new GenericApplicationContext.
GenericApplicationContext(DefaultListableBeanFactory) - Constructor for class org.springframework.context.support.GenericApplicationContext
Create a new GenericApplicationContext with the given DefaultListableBeanFactory.
GenericApplicationContext(ApplicationContext) - Constructor for class org.springframework.context.support.GenericApplicationContext
Create a new GenericApplicationContext with the given parent.
GenericApplicationContext(DefaultListableBeanFactory, ApplicationContext) - Constructor for class org.springframework.context.support.GenericApplicationContext
Create a new GenericApplicationContext with the given DefaultListableBeanFactory.
GenericApplicationListenerAdapter - Class in org.springframework.context.event
SmartApplicationListener adapter that determines supported event types through introspecting the generically declared type of the target listener.
GenericApplicationListenerAdapter(ApplicationListener) - Constructor for class org.springframework.context.event.GenericApplicationListenerAdapter
Create a new GenericApplicationListener for the given delegate.
genericBeanDefinition() - Static method in class org.springframework.beans.factory.support.BeanDefinitionBuilder
Create a new BeanDefinitionBuilder used to construct a GenericBeanDefinition.
genericBeanDefinition(Class) - Static method in class org.springframework.beans.factory.support.BeanDefinitionBuilder
Create a new BeanDefinitionBuilder used to construct a GenericBeanDefinition.
genericBeanDefinition(String) - Static method in class org.springframework.beans.factory.support.BeanDefinitionBuilder
Create a new BeanDefinitionBuilder used to construct a GenericBeanDefinition.
GenericBeanDefinition - Class in org.springframework.beans.factory.support
GenericBeanDefinition is a one-stop shop for standard bean definition purposes.
GenericBeanDefinition() - Constructor for class org.springframework.beans.factory.support.GenericBeanDefinition
Create a new GenericBeanDefinition, to be configured through its bean properties and configuration methods.
GenericBeanDefinition(BeanDefinition) - Constructor for class org.springframework.beans.factory.support.GenericBeanDefinition
Create a new GenericBeanDefinition as deep copy of the given bean definition.
GenericCallMetaDataProvider - Class in org.springframework.jdbc.core.metadata
Generic implementation for the CallMetaDataProvider interface.
GenericCallMetaDataProvider(DatabaseMetaData) - Constructor for class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
Constructor used to initialize with provided database meta data.
GenericCollectionTypeResolver - Class in org.springframework.core
Helper class for determining element types of collections and maps.
GenericCollectionTypeResolver() - Constructor for class org.springframework.core.GenericCollectionTypeResolver
GenericConversionService - Class in org.springframework.core.convert.support
Base ConversionService implementation suitable for use in most environments.
GenericConversionService() - Constructor for class org.springframework.core.convert.support.GenericConversionService
GenericConverter - Interface in org.springframework.core.convert.converter
Generic converter interface for converting between two or more types.
GenericConverter.ConvertiblePair - Class in org.springframework.core.convert.converter
Holder for a source-to-target class pair.
GenericConverter.ConvertiblePair(Class<?>, Class<?>) - Constructor for class org.springframework.core.convert.converter.GenericConverter.ConvertiblePair
Create a new source-to-target pair.
GenericFilterBean - Class in org.springframework.web.filter
Simple base implementation of Filter which treats its config parameters (init-param entries within the filter tag in web.xml) as bean properties.
GenericFilterBean() - Constructor for class org.springframework.web.filter.GenericFilterBean
GenericMarshaller - Interface in org.springframework.oxm
Subinterface of Marshaller that has support for Java 5 generics.
GenericMessageEndpointFactory - Class in org.springframework.jca.endpoint
Generic implementation of the JCA 1.5 MessageEndpointFactory interface, providing transaction management capabilities for any kind of message listener object (e.g.
GenericMessageEndpointFactory() - Constructor for class org.springframework.jca.endpoint.GenericMessageEndpointFactory
GenericMessageEndpointFactory.InternalResourceException - Exception in org.springframework.jca.endpoint
Internal exception thrown when a ResourceExeption has been encountered during the endpoint invocation.
GenericMessageEndpointFactory.InternalResourceException(ResourceException) - Constructor for exception org.springframework.jca.endpoint.GenericMessageEndpointFactory.InternalResourceException
GenericMessageEndpointManager - Class in org.springframework.jca.endpoint
Generic bean that manages JCA 1.5 message endpoints within a Spring application context, activating and deactivating the endpoint as part of the application context's lifecycle.
GenericMessageEndpointManager() - Constructor for class org.springframework.jca.endpoint.GenericMessageEndpointManager
GenericPortletBean - Class in org.springframework.web.portlet
Simple extension of javax.portlet.GenericPortlet that treats its config parameters as bean properties.
GenericPortletBean() - Constructor for class org.springframework.web.portlet.GenericPortletBean
GenericPropertiesContextLoader - Class in org.springframework.test.context.support
Concrete implementation of AbstractGenericContextLoader which reads bean definitions from Java Properties resources.
GenericPropertiesContextLoader() - Constructor for class org.springframework.test.context.support.GenericPropertiesContextLoader
GenericSqlQuery - Class in org.springframework.jdbc.object
GenericSqlQuery() - Constructor for class org.springframework.jdbc.object.GenericSqlQuery
GenericStoredProcedure - Class in org.springframework.jdbc.object
Concrete implementation making it possible to define the RDBMS stored procedures in an application context without writing a custom Java implementation class.
GenericStoredProcedure() - Constructor for class org.springframework.jdbc.object.GenericStoredProcedure
GenericTableMetaDataProvider - Class in org.springframework.jdbc.core.metadata
A generic implementation of the TableMetaDataProvider that should provide enough features for all supported databases.
GenericTableMetaDataProvider(DatabaseMetaData) - Constructor for class org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
Constructor used to initialize with provided database meta data.
GenericTypeResolver - Class in org.springframework.core
Helper class for resolving generic types against type variables.
GenericTypeResolver() - Constructor for class org.springframework.core.GenericTypeResolver
GenericUnmarshaller - Interface in org.springframework.oxm
Subinterface of Unmarshaller that has support for Java 5 generics.
GenericWebApplicationContext - Class in org.springframework.web.context.support
Subclass of GenericApplicationContext, suitable for web environments.
GenericWebApplicationContext() - Constructor for class org.springframework.web.context.support.GenericWebApplicationContext
Create a new GenericWebApplicationContext.
GenericWebApplicationContext(ServletContext) - Constructor for class org.springframework.web.context.support.GenericWebApplicationContext
Create a new GenericWebApplicationContext for the given ServletContext.
GenericWebApplicationContext(DefaultListableBeanFactory) - Constructor for class org.springframework.web.context.support.GenericWebApplicationContext
Create a new GenericWebApplicationContext with the given DefaultListableBeanFactory.
GenericWebApplicationContext(DefaultListableBeanFactory, ServletContext) - Constructor for class org.springframework.web.context.support.GenericWebApplicationContext
Create a new GenericWebApplicationContext with the given DefaultListableBeanFactory.
GenericXmlApplicationContext - Class in org.springframework.context.support
Convenient application context with built-in XML support.
GenericXmlApplicationContext() - Constructor for class org.springframework.context.support.GenericXmlApplicationContext
Create a new GenericXmlApplicationContext that needs to be populated through GenericXmlApplicationContext.load(org.springframework.core.io.Resource...) calls and then manually refreshed.
GenericXmlApplicationContext(Resource...) - Constructor for class org.springframework.context.support.GenericXmlApplicationContext
Create a new GenericXmlApplicationContext, loading bean definitions from the given resources and automatically refreshing the context.
GenericXmlApplicationContext(String...) - Constructor for class org.springframework.context.support.GenericXmlApplicationContext
Create a new GenericXmlApplicationContext, loading bean definitions from the given resource locations and automatically refreshing the context.
GenericXmlContextLoader - Class in org.springframework.test.context.support
Concrete implementation of AbstractGenericContextLoader which reads bean definitions from XML resources.
GenericXmlContextLoader() - Constructor for class org.springframework.test.context.support.GenericXmlContextLoader
get(String, ObjectFactory<?>) - Method in interface org.springframework.beans.factory.config.Scope
Return the object with the given name from the underlying scope, creating it if not found in the underlying storage mechanism.
get(String, ObjectFactory) - Method in class org.springframework.context.support.SimpleThreadScope
get(Object) - Method in class org.springframework.http.HttpHeaders
get(Class<T>, Serializable) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Return the persistent instance of the given entity class with the given identifier, or null if not found.
get(Class<T>, Serializable, LockMode) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Return the persistent instance of the given entity class with the given identifier, or null if not found.
get(String, Serializable) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Return the persistent instance of the given entity class with the given identifier, or null if not found.
get(String, Serializable, LockMode) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Return the persistent instance of the given entity class with the given identifier, or null if not found.
get(Class<T>, Serializable) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
get(Class<T>, Serializable, LockMode) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
get(String, Serializable) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
get(String, Serializable, LockMode) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
get() - Method in class org.springframework.scheduling.annotation.AsyncResult
get(long, TimeUnit) - Method in class org.springframework.scheduling.annotation.AsyncResult
get(String) - Method in interface org.springframework.test.annotation.ProfileValueSource
Get the profile value indicated by the specified key.
get(String) - Method in class org.springframework.test.annotation.SystemProfileValueSource
Get the profile value indicated by the specified key from the system properties.
get(int) - Method in class org.springframework.util.AutoPopulatingList
Get the element at the supplied index, creating it if there is no element at that index.
get(Object) - Method in class org.springframework.util.CachingMapDecorator
Get value for key.
get(Object) - Method in class org.springframework.util.LinkedCaseInsensitiveMap
get(Object) - Method in class org.springframework.util.LinkedMultiValueMap
get(String, ObjectFactory) - Method in class org.springframework.web.context.request.AbstractRequestAttributesScope
get(String, ObjectFactory) - Method in class org.springframework.web.context.request.SessionScope
get(String, ObjectFactory<?>) - Method in class org.springframework.web.context.support.ServletContextScope
get(String, ObjectFactory<?>) - Method in class org.springframework.web.portlet.context.PortletContextScope
getAccept() - Method in class org.springframework.http.HttpHeaders
Return the list of acceptable media types, as specified by the Accept header.
getAcceptCharset() - Method in class org.springframework.http.HttpHeaders
Return the list of acceptable charsets, as specified by the Accept-Charset header.
getAcceptCharset() - Method in class org.springframework.web.servlet.tags.form.FormTag
Get the value of the 'acceptCharset' attribute.
getAcceptedCharsets() - Method in class org.springframework.http.converter.StringHttpMessageConverter
Return the list of supported Charset.
getAccessControlContext() - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Provides a security access control context relevant to this factory.
getAccessControlContext() - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Delegate the creation of the access control context to the SecurityContextProvider.
getAccessControlContext() - Method in class org.springframework.beans.factory.support.FactoryBeanRegistrySupport
Returns the security context for this bean factory.
getAccessControlContext() - Method in interface org.springframework.beans.factory.support.SecurityContextProvider
Provides a security access control context relevant to a bean factory.
getAccessControlContext() - Method in class org.springframework.beans.factory.support.SimpleSecurityContextProvider
getAccesskey() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
Get the value of the 'accesskey' attribute.
getAcknowledgeMode() - Method in class org.springframework.jms.listener.endpoint.JmsActivationSpecConfig
Return the JMS acknowledgement mode to use.
getAction() - Method in class org.springframework.web.servlet.tags.form.FormTag
Get the value of the 'action' attribute.
getActionServlet() - Method in class org.springframework.web.struts.ContextLoaderPlugIn
Deprecated. Return the Struts ActionServlet that this PlugIn is associated with.
getActivationSpec() - Method in class org.springframework.jca.endpoint.GenericMessageEndpointManager
Return the JCA ActivationSpec to use for activating the endpoint.
getActiveConsumerCount() - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Return the number of currently active consumers.
getActiveContextObject() - Method in class org.springframework.expression.spel.ExpressionState
The active context object is what unqualified references to properties/etc are resolved against.
getActiveCount() - Method in class org.springframework.aop.target.CommonsPoolTargetSource
getActiveCount() - Method in interface org.springframework.aop.target.PoolingConfig
Return the number of active objects in the pool.
getActiveCount() - Method in class org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor
Return the number of currently active threads.
getActiveCount() - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
Return the number of currently active threads.
getActualAopXmlLocation() - Method in class org.springframework.test.jpa.AbstractAspectjJpaTests
Deprecated. Return the actual location of the aop.xml file in the class path.
getActualCount() - Method in exception org.springframework.jdbc.IncorrectResultSetColumnCountException
Return the actual column count.
getActualException() - Method in class org.springframework.test.AssertThrows
Deprecated. Expose the actual exception thrown from AssertThrows.test(), if any.
getActualFieldValue(String) - Method in class org.springframework.validation.AbstractBindingResult
Extract the actual field value for the given field.
getActualFieldValue(String) - Method in class org.springframework.validation.AbstractPropertyBindingResult
Fetches the field value from the PropertyAccessor.
getActualFieldValue(String) - Method in class org.springframework.validation.MapBindingResult
getActualOrmXmlLocation() - Method in class org.springframework.test.jpa.AbstractJpaTests
Deprecated. Subclasses can override this to return the real location path for orm.xml or null if they do not wish to find any orm.xml
getActualParams() - Method in exception org.springframework.web.bind.UnsatisfiedServletRequestParameterException
Return the actual parameter Map associated with the ServletRequest.
getActualResources() - Method in class org.springframework.beans.factory.parsing.ImportDefinition
getActualRowsAffected() - Method in exception org.springframework.jdbc.JdbcUpdateAffectedIncorrectNumberOfRowsException
Return the number of rows that have actually been affected.
getActualSessionAttributeNames() - Method in class org.springframework.web.bind.annotation.support.HandlerMethodResolver
getActualSize() - Method in exception org.springframework.dao.IncorrectResultSizeDataAccessException
Return the actual result size (or -1 if unknown).
getActualType() - Method in exception org.springframework.beans.factory.BeanNotOfRequiredTypeException
Return the actual type of the instance found.
getActualType() - Method in exception org.springframework.jndi.TypeMismatchNamingException
Return the actual type that the lookup returned, if available.
getActualValue() - Method in class org.springframework.web.servlet.support.BindStatus
Return the actual value of the field, i.e.
getAdaptedInterceptors() - Method in class org.springframework.web.portlet.handler.AbstractHandlerMapping
Return the adapted interceptors as HandlerInterceptor array.
getAdaptedInterceptors() - Method in class org.springframework.web.servlet.handler.AbstractHandlerMapping
Return the adapted interceptors as HandlerInterceptor array.
getAdvice() - Method in interface org.springframework.aop.Advisor
Return the advice part of this aspect.
getAdvice(Method, AspectJExpressionPointcut, MetadataAwareAspectInstanceFactory, int, String) - Method in interface org.springframework.aop.aspectj.annotation.AspectJAdvisorFactory
Build a Spring AOP Advice for the given AspectJ advice method.
getAdvice(Method, AspectJExpressionPointcut, MetadataAwareAspectInstanceFactory, int, String) - Method in class org.springframework.aop.aspectj.annotation.ReflectiveAspectJAdvisorFactory
getAdvice() - Method in class org.springframework.aop.aspectj.AspectJPointcutAdvisor
getAdvice() - Method in class org.springframework.aop.aspectj.DeclareParentsAdvisor
getAdvice() - Method in class org.springframework.aop.support.AbstractBeanFactoryPointcutAdvisor
getAdvice() - Method in class org.springframework.aop.support.AbstractGenericPointcutAdvisor
getAdvice() - Method in class org.springframework.aop.support.DefaultIntroductionAdvisor
getAdvice() - Method in class org.springframework.aop.support.StaticMethodMatcherPointcutAdvisor
getAdvice() - Method in class org.springframework.dao.annotation.PersistenceExceptionTranslationAdvisor
getAdvice() - Method in class org.springframework.scheduling.annotation.AsyncAnnotationAdvisor
getAdvice() - Method in class org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor
getAdviceBeanName() - Method in class org.springframework.aop.support.AbstractBeanFactoryPointcutAdvisor
Return the name of the advice bean that this advisor refers to, if any.
getAdvicesAndAdvisorsForBean(Class, String, TargetSource) - Method in class org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
getAdvicesAndAdvisorsForBean(Class<?>, String, TargetSource) - Method in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
Return whether the given bean is to be proxied, what additional advices (e.g.
getAdvicesAndAdvisorsForBean(Class, String, TargetSource) - Method in class org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator
Identify as bean to proxy if the bean name is in the configured list of names.
getAdvisor(Method, MetadataAwareAspectInstanceFactory, int, String) - Method in interface org.springframework.aop.aspectj.annotation.AspectJAdvisorFactory
Build a Spring AOP Advisor for the given AspectJ advice method.
getAdvisor(Method, MetadataAwareAspectInstanceFactory, int, String) - Method in class org.springframework.aop.aspectj.annotation.ReflectiveAspectJAdvisorFactory
getAdvisorBeanNamePrefix() - Method in class org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator
Return the prefix for bean names that will cause them to be included for auto-proxying by this object.
getAdvisorChainFactory() - Method in class org.springframework.aop.framework.AdvisedSupport
Return the advisor chain factory to use (never null).
getAdvisors(MetadataAwareAspectInstanceFactory) - Method in interface org.springframework.aop.aspectj.annotation.AspectJAdvisorFactory
Build Spring AOP Advisors for all annotated At-AspectJ methods on the specified aspect instance.
getAdvisors(MetadataAwareAspectInstanceFactory) - Method in class org.springframework.aop.aspectj.annotation.ReflectiveAspectJAdvisorFactory
getAdvisors() - Method in interface org.springframework.aop.framework.Advised
Return the advisors applying to this proxy.
getAdvisors() - Method in class org.springframework.aop.framework.AdvisedSupport
getAdvisorsInternal() - Method in class org.springframework.aop.framework.AdvisedSupport
Allows uncontrolled access to the List of Advisors.
getAggregateTemplateLoader(List<TemplateLoader>) - Method in class org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
Return a TemplateLoader based on the given TemplateLoader list.
getAjType() - Method in class org.springframework.aop.aspectj.annotation.AspectMetadata
Return AspectJ reflection information.
getAlias() - Method in class org.springframework.beans.factory.parsing.AliasDefinition
Return the alias registered for the bean.
getAliases(String) - Method in interface org.springframework.beans.factory.BeanFactory
Return the aliases for the given bean name, if any.
getAliases() - Method in class org.springframework.beans.factory.config.BeanDefinitionHolder
Return the alias names for the bean, as specified directly for the bean definition.
getAliases(String) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
getAliases(String) - Method in class org.springframework.beans.factory.support.StaticListableBeanFactory
getAliases(String) - Method in class org.springframework.context.support.AbstractApplicationContext
getAliases(String) - Method in interface org.springframework.core.AliasRegistry
Return the aliases for the given name, if defined.
getAliases(String) - Method in class org.springframework.core.SimpleAliasRegistry
getAliases(String) - Method in class org.springframework.jndi.support.SimpleJndiBeanFactory
getAllDeclaredMethods(Class<?>) - Static method in class org.springframework.util.ReflectionUtils
Get all declared methods on the leaf class and all superclasses.
getAllErrors() - Method in class org.springframework.validation.AbstractBindingResult
getAllErrors() - Method in class org.springframework.validation.AbstractErrors
getAllErrors() - Method in exception org.springframework.validation.BindException
getAllErrors() - Method in interface org.springframework.validation.Errors
Get all errors, both global and field ones.
getAllErrors() - Method in class org.springframework.web.bind.EscapedErrors
getAllInterfaces(Object) - Static method in class org.springframework.util.ClassUtils
Return all interfaces that the given instance implements as array, including ones implemented by superclasses.
getAllInterfacesAsSet(Object) - Static method in class org.springframework.util.ClassUtils
Return all interfaces that the given instance implements as Set, including ones implemented by superclasses.
getAllInterfacesForClass(Class<?>) - Static method in class org.springframework.util.ClassUtils
Return all interfaces that the given class implements as array, including ones implemented by superclasses.
getAllInterfacesForClass(Class<?>, ClassLoader) - Static method in class org.springframework.util.ClassUtils
Return all interfaces that the given class implements as array, including ones implemented by superclasses.
getAllInterfacesForClassAsSet(Class) - Static method in class org.springframework.util.ClassUtils
Return all interfaces that the given class implements as Set, including ones implemented by superclasses.
getAllInterfacesForClassAsSet(Class, ClassLoader) - Static method in class org.springframework.util.ClassUtils
Return all interfaces that the given class implements as Set, including ones implemented by superclasses.
getAllow() - Method in class org.springframework.http.HttpHeaders
Return the set of allowed HTTP methods, as specified by the Allow header.
getAllowedFields() - Method in class org.springframework.validation.DataBinder
Return the fields that should be allowed for binding.
getAlreadyFilteredAttributeName() - Method in class org.springframework.web.filter.OncePerRequestFilter
Return the name of the request attribute that identifies that a request is already filtered.
getAlt() - Method in class org.springframework.web.servlet.tags.form.InputTag
Get the value of the 'alt' attribute.
getAnnotatedMethods(String) - Method in interface org.springframework.core.type.AnnotationMetadata
Retrieve the method metadata for all methods that are annotated (or meta-annotated) with the given annotation type.
getAnnotatedMethods(String) - Method in class org.springframework.core.type.StandardAnnotationMetadata
getAnnotation() - Method in class org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory.AspectJAnnotation
getAnnotation(Method, Class<A>) - Static method in class org.springframework.core.annotation.AnnotationUtils
Get a single Annotation of annotationType from the supplied Method.
getAnnotation(Class<? extends Annotation>) - Method in class org.springframework.core.convert.TypeDescriptor
Obtain the annotation associated with the wrapped parameter/field, if any.
getAnnotationAttributes(Annotation) - Static method in class org.springframework.core.annotation.AnnotationUtils
Retrieve the given annotation's attributes as a Map, preserving all attribute types as-is.
getAnnotationAttributes(Annotation, boolean) - Static method in class org.springframework.core.annotation.AnnotationUtils
Retrieve the given annotation's attributes as a Map.
getAnnotationAttributes(String) - Method in interface org.springframework.core.type.AnnotationMetadata
Retrieve the attributes of the annotation of the given type, if any (i.e.
getAnnotationAttributes(String, boolean) - Method in interface org.springframework.core.type.AnnotationMetadata
Retrieve the attributes of the annotation of the given type, if any (i.e.
getAnnotationAttributes(String) - Method in interface org.springframework.core.type.MethodMetadata
Retrieve the attributes of the annotation of the given type, if any (i.e.
getAnnotationAttributes(String) - Method in class org.springframework.core.type.StandardAnnotationMetadata
getAnnotationAttributes(String, boolean) - Method in class org.springframework.core.type.StandardAnnotationMetadata
getAnnotationAttributes(String) - Method in class org.springframework.core.type.StandardMethodMetadata
getAnnotationMetadata() - Method in interface org.springframework.core.type.classreading.MetadataReader
Read full annotation metadata for the underlying class, including metadata for annotated methods.
getAnnotations() - Method in class org.springframework.beans.factory.config.DependencyDescriptor
Obtain the annotations associated with the wrapped parameter/field, if any.
getAnnotations(Method) - Static method in class org.springframework.core.annotation.AnnotationUtils
Get all Annotations from the supplied Method.
getAnnotations() - Method in class org.springframework.core.convert.support.PropertyTypeDescriptor
getAnnotations() - Method in class org.springframework.core.convert.TypeDescriptor
Obtain the annotations associated with the wrapped parameter/field, if any.
getAnnotationType() - Method in class org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory.AspectJAnnotation
getAnnotationTypes() - Method in interface org.springframework.core.type.AnnotationMetadata
Return the names of all annotation types defined on the underlying class.
getAnnotationTypes() - Method in class org.springframework.core.type.StandardAnnotationMetadata
getAnySession() - Method in class org.springframework.orm.hibernate3.SessionHolder
getAopProxyFactory() - Method in class org.springframework.aop.framework.ProxyCreatorSupport
Return the AopProxyFactory that this ProxyConfig uses.
getApplicationContext() - Method in class org.springframework.context.event.ApplicationContextEvent
Get the ApplicationContext that the event was raised for.
getApplicationContext() - Method in class org.springframework.context.support.ApplicationObjectSupport
Return the ApplicationContext that this object is associated with.
getApplicationContext() - Method in class org.springframework.remoting.jaxrpc.ServletEndpointSupport
Deprecated. Return the current Spring ApplicationContext.
getApplicationContext() - Method in class org.springframework.test.AbstractSingleSpringContextTests
Deprecated. Return the ApplicationContext that this base class manages; may be null.
getApplicationContext() - Method in class org.springframework.test.context.TestContext
Get the application context for this test context, possibly cached.
getApplicationContext() - Method in class org.springframework.web.servlet.view.tiles.ComponentControllerSupport
Deprecated. Return the current Spring ApplicationContext.
getApplicationException() - Method in exception org.springframework.transaction.TransactionSystemException
Return the application exception that was thrown before this transaction exception, if any.
getApplicationListeners() - Method in class org.springframework.context.event.AbstractApplicationEventMulticaster
Return a Collection containing all ApplicationListeners.
getApplicationListeners(ApplicationEvent) - Method in class org.springframework.context.event.AbstractApplicationEventMulticaster
Return a Collection of ApplicationListeners matching the given event type.
getApplicationListeners() - Method in class org.springframework.context.support.AbstractApplicationContext
Return the list of statically specified ApplicationListeners.
getArgNames() - Method in class org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory.AspectJAnnotation
getArgs() - Method in class org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint
getArgumentCount() - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues
Return the number of argument values held in this instance, counting both indexed and generic argument values.
getArguments() - Method in class org.springframework.aop.framework.ReflectiveMethodInvocation
getArguments() - Method in interface org.springframework.context.MessageSourceResolvable
Return the array of arguments to be used to resolve this message.
getArguments() - Method in class org.springframework.context.support.DefaultMessageSourceResolvable
getArguments() - Method in class org.springframework.remoting.support.RemoteInvocation
Return the arguments for the target method call.
getArguments() - Method in class org.springframework.util.MethodInvoker
Return the arguments for the method invocation.
getArgumentsForBindError(String, String) - Method in class org.springframework.validation.DefaultBindingErrorProcessor
Return FieldError arguments for a binding error on the given field.
getArgumentsForConstraint(String, String, ConstraintDescriptor<?>) - Method in class org.springframework.validation.beanvalidation.SpringValidatorAdapter
Return FieldError arguments for a validation error on the given field.
getArgumentValue(int, Class) - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues
Look for an argument value that either corresponds to the given index in the constructor argument list or generically matches by type.
getArgumentValue(int, Class, String) - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues
Look for an argument value that either corresponds to the given index in the constructor argument list or generically matches by type.
getArgumentValue(int, Class, String, Set<ConstructorArgumentValues.ValueHolder>) - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues
Look for an argument value that either corresponds to the given index in the constructor argument list or generically matches by type.
getAspectClass() - Method in class org.springframework.aop.aspectj.annotation.AspectMetadata
Return the aspect class.
getAspectClass() - Method in class org.springframework.aop.aspectj.SimpleAspectInstanceFactory
Return the specified aspect class (never null).
getAspectClassLoader() - Method in class org.springframework.aop.aspectj.AbstractAspectJAdvice
Return the ClassLoader for aspect instances.
getAspectClassLoader() - Method in class org.springframework.aop.aspectj.annotation.BeanFactoryAspectInstanceFactory
getAspectClassLoader() - Method in class org.springframework.aop.aspectj.annotation.LazySingletonAspectInstanceFactoryDecorator
getAspectClassLoader() - Method in interface org.springframework.aop.aspectj.AspectInstanceFactory
Expose the aspect class loader that this factory uses.
getAspectClassLoader() - Method in class org.springframework.aop.aspectj.SimpleAspectInstanceFactory
getAspectClassLoader() - Method in class org.springframework.aop.aspectj.SingletonAspectInstanceFactory
getAspectClassLoader() - Method in class org.springframework.aop.config.SimpleBeanFactoryAwareAspectInstanceFactory
getAspectInstance() - Method in class org.springframework.aop.aspectj.annotation.BeanFactoryAspectInstanceFactory
getAspectInstance() - Method in class org.springframework.aop.aspectj.annotation.LazySingletonAspectInstanceFactoryDecorator
getAspectInstance() - Method in interface org.springframework.aop.aspectj.AspectInstanceFactory
Create an instance of this factory's aspect.
getAspectInstance() - Method in class org.springframework.aop.aspectj.SimpleAspectInstanceFactory
getAspectInstance() - Method in class org.springframework.aop.aspectj.SingletonAspectInstanceFactory
getAspectInstance() - Method in class org.springframework.aop.config.SimpleBeanFactoryAwareAspectInstanceFactory
Look up the aspect bean from the BeanFactory and returns it.
getAspectInstanceFactory() - Method in class org.springframework.aop.aspectj.AbstractAspectJAdvice
Return the factory for aspect instances.
getAspectJAdviceMethod() - Method in class org.springframework.aop.aspectj.AbstractAspectJAdvice
Return the AspectJ-style advice method.
getAspectJPrecedenceInformationFor(Advisor) - Static method in class org.springframework.aop.aspectj.AspectJAopUtils
Return the AspectJPrecedenceInformation provided by this advisor or its advice.
getAspectMetadata() - Method in class org.springframework.aop.aspectj.annotation.BeanFactoryAspectInstanceFactory
getAspectMetadata() - Method in class org.springframework.aop.aspectj.annotation.LazySingletonAspectInstanceFactoryDecorator
getAspectMetadata() - Method in interface org.springframework.aop.aspectj.annotation.MetadataAwareAspectInstanceFactory
Return the AspectJ AspectMetadata for this factory's aspect.
getAspectMetadata() - Method in class org.springframework.aop.aspectj.annotation.SimpleMetadataAwareAspectInstanceFactory
getAspectMetadata() - Method in class org.springframework.aop.aspectj.annotation.SingletonMetadataAwareAspectInstanceFactory
getAspectName() - Method in class org.springframework.aop.aspectj.AbstractAspectJAdvice
getAspectName() - Method in class org.springframework.aop.aspectj.annotation.AspectMetadata
Return the aspect class.
getAspectName() - Method in interface org.springframework.aop.aspectj.AspectJPrecedenceInformation
The name of the aspect (bean) in which the advice was declared.
getAST() - Method in class org.springframework.expression.spel.standard.SpelExpression
getAsText() - Method in class org.springframework.beans.propertyeditors.ByteArrayPropertyEditor
getAsText() - Method in class org.springframework.beans.propertyeditors.CharacterEditor
getAsText() - Method in class org.springframework.beans.propertyeditors.CharArrayPropertyEditor
getAsText() - Method in class org.springframework.beans.propertyeditors.CharsetEditor
getAsText() - Method in class org.springframework.beans.propertyeditors.ClassArrayEditor
getAsText() - Method in class org.springframework.beans.propertyeditors.ClassEditor
getAsText() - Method in class org.springframework.beans.propertyeditors.CurrencyEditor
This implementation returns null to indicate that there is no appropriate text representation.
getAsText() - Method in class org.springframework.beans.propertyeditors.CustomBooleanEditor
getAsText() - Method in class org.springframework.beans.propertyeditors.CustomCollectionEditor
This implementation returns null to indicate that there is no appropriate text representation.
getAsText() - Method in class org.springframework.beans.propertyeditors.CustomDateEditor
Format the Date as String, using the specified DateFormat.
getAsText() - Method in class org.springframework.beans.propertyeditors.CustomMapEditor
This implementation returns null to indicate that there is no appropriate text representation.
getAsText() - Method in class org.springframework.beans.propertyeditors.CustomNumberEditor
Format the Number as String, using the specified NumberFormat.
getAsText() - Method in class org.springframework.beans.propertyeditors.FileEditor
getAsText() - Method in class org.springframework.beans.propertyeditors.InputStreamEditor
This implementation returns null to indicate that there is no appropriate text representation.
getAsText() - Method in class org.springframework.beans.propertyeditors.LocaleEditor
getAsText() - Method in class org.springframework.beans.propertyeditors.PatternEditor
getAsText() - Method in class org.springframework.beans.propertyeditors.StringArrayPropertyEditor
getAsText() - Method in class org.springframework.beans.propertyeditors.StringTrimmerEditor
getAsText() - Method in class org.springframework.beans.propertyeditors.TimeZoneEditor
This implementation returns null to indicate that there is no appropriate text representation.
getAsText() - Method in class org.springframework.beans.propertyeditors.URIEditor
getAsText() - Method in class org.springframework.beans.propertyeditors.URLEditor
getAsText() - Method in class org.springframework.beans.propertyeditors.UUIDEditor
getAsText() - Method in class org.springframework.core.convert.support.ConvertingPropertyEditorAdapter
getAsText() - Method in class org.springframework.core.io.ResourceEditor
getAsText() - Method in class org.springframework.http.MediaTypeEditor
getAsText() - Method in class org.springframework.mail.javamail.InternetAddressEditor
getAsText() - Method in class org.springframework.web.multipart.support.ByteArrayMultipartFileEditor
getAttachment(String) - Method in interface org.springframework.oxm.mime.MimeContainer
Return the attachment with the given content id, or null if not found.
getAttribute(String) - Method in class org.springframework.beans.BeanMetadataAttributeAccessor
getAttribute(String) - Method in interface org.springframework.core.AttributeAccessor
Get the value of the attribute identified by name.
getAttribute(String) - Method in class org.springframework.core.AttributeAccessorSupport
getAttribute(String) - Method in class org.springframework.jmx.export.SpringModelMBean
Switches the context ClassLoader for the managed resources ClassLoader before allowing the invocation to occur.
getAttribute(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
getAttribute(String) - Method in class org.springframework.mock.web.MockHttpSession
getAttribute(String) - Method in class org.springframework.mock.web.MockPageContext
getAttribute(String, int) - Method in class org.springframework.mock.web.MockPageContext
getAttribute(String) - Method in class org.springframework.mock.web.MockServletContext
getAttribute(String) - Method in class org.springframework.mock.web.portlet.MockPortletContext
getAttribute(String) - Method in class org.springframework.mock.web.portlet.MockPortletRequest
getAttribute(String) - Method in class org.springframework.mock.web.portlet.MockPortletSession
getAttribute(String, int) - Method in class org.springframework.mock.web.portlet.MockPortletSession
getAttribute(String) - Method in class org.springframework.mock.web.portlet.ServletWrappingPortletContext
getAttribute(String) - Method in class org.springframework.remoting.support.RemoteInvocation
Retrieve the attribute for the given key, if any.
getAttribute(String, int) - Method in class org.springframework.web.context.request.FacesRequestAttributes
getAttribute(String, int) - Method in interface org.springframework.web.context.request.RequestAttributes
Return the value for the scoped attribute of the given name, if any.
getAttribute(String, int) - Method in class org.springframework.web.context.request.ServletRequestAttributes
getAttribute(String) - Method in class org.springframework.web.context.support.ContextExposingHttpServletRequest
getAttribute(String, int) - Method in class org.springframework.web.portlet.context.PortletRequestAttributes
getAttributeDescription(PropertyDescriptor, String) - Method in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Get the description for a particular attribute.
getAttributeDescription(PropertyDescriptor, String) - Method in class org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler
Creates a description for the attribute corresponding to this property descriptor.
getAttributeDescription() - Method in class org.springframework.transaction.interceptor.DefaultTransactionAttribute
Return an identifying description for this transaction attribute.
getAttributeInfo(Object, String) - Method in class org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler
Get the attribute metadata for the MBean resource.
getAttributeInfo(Object, String) - Method in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Iterate through all properties on the MBean class and gives subclasses the chance to vote on the inclusion of both the accessor and mutator.
getAttributeMap() - Method in class org.springframework.mock.web.portlet.MockPortletSession
getAttributeMap(int) - Method in class org.springframework.mock.web.portlet.MockPortletSession
getAttributeMap(int) - Method in class org.springframework.web.context.request.FacesRequestAttributes
Return the JSF attribute Map for the specified scope
getAttributeName(PropertyDescriptor, boolean) - Static method in class org.springframework.jmx.support.JmxUtils
Return the JMX attribute name to use for the given JavaBeans property.
getAttributeNameInSession(WebRequest, String) - Method in class org.springframework.web.bind.support.DefaultSessionAttributeStore
Calculate the attribute name in the backend session.
getAttributeNames() - Method in class org.springframework.mock.web.MockHttpServletRequest
getAttributeNames() - Method in class org.springframework.mock.web.MockHttpSession
getAttributeNames() - Method in class org.springframework.mock.web.MockPageContext
getAttributeNames() - Method in class org.springframework.mock.web.MockServletContext
getAttributeNames() - Method in class org.springframework.mock.web.portlet.MockPortletContext
getAttributeNames() - Method in class org.springframework.mock.web.portlet.MockPortletRequest
getAttributeNames() - Method in class org.springframework.mock.web.portlet.MockPortletSession
getAttributeNames(int) - Method in class org.springframework.mock.web.portlet.MockPortletSession
getAttributeNames() - Method in class org.springframework.mock.web.portlet.ServletWrappingPortletContext
getAttributeNames(int) - Method in class org.springframework.web.context.request.FacesRequestAttributes
getAttributeNames(int) - Method in interface org.springframework.web.context.request.RequestAttributes
Retrieve the names of all attributes in the scope.
getAttributeNames(int) - Method in class org.springframework.web.context.request.ServletRequestAttributes
getAttributeNames(int) - Method in class org.springframework.web.portlet.context.PortletRequestAttributes
getAttributeNamesInScope(int) - Method in class org.springframework.mock.web.MockPageContext
getAttributes(String[]) - Method in class org.springframework.jmx.export.SpringModelMBean
Switches the context ClassLoader for the managed resources ClassLoader before allowing the invocation to occur.
getAttributes() - Method in class org.springframework.remoting.support.RemoteInvocation
Return the attributes Map.
getAttributesMap() - Method in class org.springframework.web.servlet.view.AbstractView
Allow Map access to the static attributes of this view, with the option to add or override specific entries.
getAttributesMap() - Method in class org.springframework.web.servlet.view.UrlBasedViewResolver
Allow Map access to the static attributes for views returned by this resolver, with the option to add or override specific entries.
getAttributesScope(String) - Method in class org.springframework.mock.web.MockPageContext
getAuthType() - Method in class org.springframework.mock.web.MockHttpServletRequest
getAuthType() - Method in class org.springframework.mock.web.portlet.MockPortletRequest
getAutoCommitValue() - Method in class org.springframework.jdbc.datasource.SingleConnectionDataSource
Return whether the returned Connection's "autoCommit" setting should be overridden.
getAutocomplete() - Method in class org.springframework.web.servlet.tags.form.FormTag
Get the value of the 'autocomplete' attribute.
getAutocomplete() - Method in class org.springframework.web.servlet.tags.form.InputTag
Get the value of the 'autocomplete' attribute.
getAutowire() - Method in class org.springframework.beans.factory.xml.DocumentDefaultsDefinition
Return the default autowire setting for the document that's currently parsed.
getAutowireCandidatePatterns() - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Return any patterns provided in the 'default-autowire-candidates' attribute of the top-level <beans/> element.
getAutowireCandidateResolver() - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
Return the autowire candidate resolver for this BeanFactory (never null).
getAutowireCandidates() - Method in class org.springframework.beans.factory.xml.DocumentDefaultsDefinition
Return the default autowire-candidate pattern for the document that's currently parsed.
getAutowireCapableBeanFactory() - Method in interface org.springframework.context.ApplicationContext
Expose AutowireCapableBeanFactory functionality for this context.
getAutowireCapableBeanFactory() - Method in class org.springframework.context.support.AbstractApplicationContext
Return this context's internal bean factory as AutowireCapableBeanFactory, if already available.
getAutowireMode() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Return the autowire mode as specified in the bean definition.
getAutowireMode() - Method in class org.springframework.beans.factory.support.BeanDefinitionDefaults
getAutowireMode() - Method in class org.springframework.beans.factory.wiring.BeanWiringInfo
Return one of the constants BeanWiringInfo.AUTOWIRE_BY_NAME / BeanWiringInfo.AUTOWIRE_BY_TYPE, if autowiring is indicated.
getAutowireMode(String) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
getAutowireMode() - Method in class org.springframework.test.AbstractDependencyInjectionSpringContextTests
Deprecated. Return the autowire mode for test properties set by Dependency Injection.
getAutowireMode() - Method in class org.springframework.web.struts.AutowiringRequestProcessor
Deprecated. Return the autowire mode to use for wiring Struts Actions.
getAutowireMode() - Method in class org.springframework.web.struts.AutowiringTilesRequestProcessor
Deprecated. Return the autowire mode to use for wiring Struts Actions.
getAutowireMode(ActionServlet) - Static method in class org.springframework.web.struts.DelegatingActionUtils
Deprecated. Determine the autowire mode from the "autowire" init-param of the Struts ActionServlet, falling back to "AUTOWIRE_BY_TYPE" as default.
getBadSqlGrammarCodes() - Method in class org.springframework.jdbc.support.SQLErrorCodes
getBatchSize() - Method in interface org.springframework.jdbc.core.BatchPreparedStatementSetter
Return the size of the batch.
getBatchSize() - Method in class org.springframework.jdbc.core.support.AbstractInterruptibleBatchPreparedStatementSetter
This implementation returns Integer.MAX_VALUE.
getBcc() - Method in class org.springframework.mail.SimpleMailMessage
getBean(String) - Method in interface org.springframework.beans.factory.BeanFactory
Return an instance, which may be shared or independent, of the specified bean.
getBean(String, Class<T>) - Method in interface org.springframework.beans.factory.BeanFactory
Return an instance, which may be shared or independent, of the specified bean.
getBean(Class<T>) - Method in interface org.springframework.beans.factory.BeanFactory
Return the bean instance that uniquely matches the given object type, if any.
getBean(String, Object...) - Method in interface org.springframework.beans.factory.BeanFactory
Return an instance, which may be shared or independent, of the specified bean.
getBean(String) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
getBean(String, Class<T>) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
getBean(String, Object...) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
getBean(String, Class<T>, Object...) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Return an instance, which may be shared or independent, of the specified bean.
getBean(Class<T>) - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
getBean(String) - Method in class org.springframework.beans.factory.support.StaticListableBeanFactory
getBean(String, Class<T>) - Method in class org.springframework.beans.factory.support.StaticListableBeanFactory
getBean(Class<T>) - Method in class org.springframework.beans.factory.support.StaticListableBeanFactory
getBean(String, Object...) - Method in class org.springframework.beans.factory.support.StaticListableBeanFactory
getBean(String) - Method in class org.springframework.context.support.AbstractApplicationContext
getBean(String, Class<T>) - Method in class org.springframework.context.support.AbstractApplicationContext
getBean(Class<T>) - Method in class org.springframework.context.support.AbstractApplicationContext
getBean(String, Object...) - Method in class org.springframework.context.support.AbstractApplicationContext
getBean(String) - Method in class org.springframework.jndi.support.SimpleJndiBeanFactory
getBean(String, Class<T>) - Method in class org.springframework.jndi.support.SimpleJndiBeanFactory
getBean(Class<T>) - Method in class org.springframework.jndi.support.SimpleJndiBeanFactory
getBean(String, Object...) - Method in class org.springframework.jndi.support.SimpleJndiBeanFactory
getBeanClass() - Method in exception org.springframework.beans.BeanInstantiationException
Return the offending bean class.
getBeanClass() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Return the class of the wrapped bean, if already resolved.
getBeanClass(Element) - Method in class org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
Determine the bean class corresponding to the supplied Element.
getBeanClass() - Method in exception org.springframework.beans.InvalidPropertyException
Return the offending bean class.
getBeanClassLoader() - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Return this factory's class loader for loading bean classes.
getBeanClassLoader() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinitionReader
getBeanClassLoader() - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
getBeanClassLoader() - Method in interface org.springframework.beans.factory.support.BeanDefinitionReader
Return the class loader to use for bean classes.
getBeanClassLoader() - Method in class org.springframework.beans.factory.xml.XmlReaderContext
getBeanClassLoader() - Method in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
getBeanClassLoader() - Method in interface org.springframework.orm.jpa.EntityManagerFactoryInfo
Return the ClassLoader that the application's beans are loaded with.
getBeanClassLoader() - Method in class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
Return the bean ClassLoader that this executor is supposed to use.
getBeanClassLoader() - Method in class org.springframework.remoting.support.RemotingSupport
Return the ClassLoader that this accessor operates in, to be used for deserializing and for generating proxies.
getBeanClassName() - Method in exception org.springframework.beans.factory.CannotLoadBeanClassException
Return the name of the class we were trying to load.
getBeanClassName() - Method in interface org.springframework.beans.factory.config.BeanDefinition
Return the current bean class name of this bean definition.
getBeanClassName() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
getBeanClassName(Element) - Method in class org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
Determine the bean class name corresponding to the supplied Element.
getBeanClassName(Element) - Method in class org.springframework.scheduling.config.ExecutorBeanDefinitionParser
getBeanClassName(Element) - Method in class org.springframework.scheduling.config.ScheduledTasksBeanDefinitionParser
getBeanClassName(Element) - Method in class org.springframework.scheduling.config.SchedulerBeanDefinitionParser
getBeanClassName(Element) - Method in class org.springframework.transaction.config.JtaTransactionManagerBeanDefinitionParser
getBeanDefinition() - Method in class org.springframework.beans.factory.config.BeanDefinitionHolder
Return the wrapped BeanDefinition.
getBeanDefinition(String) - Method in interface org.springframework.beans.factory.config.ConfigurableListableBeanFactory
Return the registered BeanDefinition for the specified bean, allowing access to its property values and constructor argument value (which can be modified during bean factory post-processing).
getBeanDefinition(String) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Return the bean definition for the given bean name.
getBeanDefinition() - Method in class org.springframework.beans.factory.support.BeanDefinitionBuilder
Validate and return the created BeanDefinition object.
getBeanDefinition(String) - Method in interface org.springframework.beans.factory.support.BeanDefinitionRegistry
Return the BeanDefinition for the given bean name.
getBeanDefinition(String) - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
getBeanDefinition(String) - Method in class org.springframework.beans.factory.support.SimpleBeanDefinitionRegistry
getBeanDefinition(String) - Method in class org.springframework.context.support.GenericApplicationContext
getBeanDefinitionCount() - Method in interface org.springframework.beans.factory.ListableBeanFactory
Return the number of beans defined in the factory.
getBeanDefinitionCount() - Method in interface org.springframework.beans.factory.support.BeanDefinitionRegistry
Return the number of beans defined in the registry.
getBeanDefinitionCount() - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
getBeanDefinitionCount() - Method in class org.springframework.beans.factory.support.SimpleBeanDefinitionRegistry
getBeanDefinitionCount() - Method in class org.springframework.beans.factory.support.StaticListableBeanFactory
getBeanDefinitionCount() - Method in class org.springframework.context.support.AbstractApplicationContext
getBeanDefinitionDefaults() - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Return the default settings for bean definitions as indicated within the attributes of the top-level <beans/> element.
getBeanDefinitionNames() - Method in interface org.springframework.beans.factory.ListableBeanFactory
Return the names of all beans defined in this factory.
getBeanDefinitionNames() - Method in interface org.springframework.beans.factory.support.BeanDefinitionRegistry
Return the names of all beans defined in this registry.
getBeanDefinitionNames() - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
getBeanDefinitionNames() - Method in class org.springframework.beans.factory.support.SimpleBeanDefinitionRegistry
getBeanDefinitionNames() - Method in class org.springframework.beans.factory.support.StaticListableBeanFactory
getBeanDefinitionNames() - Method in class org.springframework.context.support.AbstractApplicationContext
getBeanDefinitions() - Method in class org.springframework.aop.config.AdvisorComponentDefinition
getBeanDefinitions() - Method in class org.springframework.aop.config.AspectComponentDefinition
getBeanDefinitions() - Method in class org.springframework.aop.config.PointcutComponentDefinition
getBeanDefinitions() - Method in class org.springframework.beans.factory.parsing.AbstractComponentDefinition
Returns an empty array.
getBeanDefinitions() - Method in class org.springframework.beans.factory.parsing.BeanComponentDefinition
getBeanDefinitions() - Method in interface org.springframework.beans.factory.parsing.ComponentDefinition
Return the BeanDefinitions that were registered to form this ComponentDefinition.
getBeanExpressionResolver() - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Return the resolution strategy for expressions in bean definition values.
getBeanExpressionResolver() - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
getBeanFactory() - Method in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
Return the owning BeanFactory.
getBeanFactory() - Method in class org.springframework.aop.framework.autoproxy.target.AbstractBeanFactoryBasedTargetSourceCreator
Return the BeanFactory that this TargetSourceCreators runs in.
getBeanFactory() - Method in class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
Return the owning BeanFactory.
getBeanFactory(ELContext) - Method in class org.springframework.beans.factory.access.el.SimpleSpringBeanELResolver
getBeanFactory(ELContext) - Method in class org.springframework.beans.factory.access.el.SpringBeanELResolver
Retrieve the Spring BeanFactory to delegate bean name resolution to.
getBeanFactory() - Method in class org.springframework.beans.factory.config.AbstractFactoryBean
Return the BeanFactory that this bean runs in.
getBeanFactory() - Method in class org.springframework.beans.factory.config.BeanExpressionContext
getBeanFactory() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinitionReader
getBeanFactory() - Method in interface org.springframework.context.ConfigurableApplicationContext
Return the internal bean factory of this application context.
getBeanFactory() - Method in class org.springframework.context.support.AbstractApplicationContext
Subclasses must return their internal bean factory here.
getBeanFactory() - Method in class org.springframework.context.support.AbstractRefreshableApplicationContext
getBeanFactory() - Method in class org.springframework.context.support.GenericApplicationContext
Return the single internal BeanFactory held by this context (as ConfigurableListableBeanFactory).
getBeanFactory(Object) - Method in class org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor
Determine the BeanFactory for autowiring the given target bean.
getBeanFactory() - Method in class org.springframework.ejb.support.AbstractEnterpriseBean
May be called after ejbCreate().
getBeanFactory() - Method in class org.springframework.transaction.interceptor.TransactionAspectSupport
Return the BeanFactory to use for retrieving PlatformTransactionManager beans.
getBeanFactory(FacesContext) - Method in class org.springframework.web.jsf.DelegatingNavigationHandlerProxy
Retrieve the Spring BeanFactory to delegate bean name resolution to.
getBeanFactory(FacesContext) - Method in class org.springframework.web.jsf.DelegatingPhaseListenerMulticaster
Retrieve the Spring BeanFactory to delegate bean name resolution to.
getBeanFactory(FacesContext) - Method in class org.springframework.web.jsf.DelegatingVariableResolver
Retrieve the Spring BeanFactory to delegate bean name resolution to.
getBeanFactory(ELContext) - Method in class org.springframework.web.jsf.el.SpringBeanFacesELResolver
This implementation delegates to SpringBeanFacesELResolver.getWebApplicationContext(javax.el.ELContext).
getBeanFactoryLocator(Object) - Method in class org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor
Determine the BeanFactoryLocator to obtain the BeanFactoryReference from.
getBeanFactoryLocatorKey(Object) - Method in class org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor
Determine the BeanFactoryLocator key to use.
getBeanFactoryPostProcessors() - Method in class org.springframework.context.support.AbstractApplicationContext
Return the list of BeanFactoryPostProcessors that will get applied to the internal BeanFactory.
getBeanFactoryReference(Object) - Method in class org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor
Determine the BeanFactoryReference for the given target bean.
getBeanName() - Static method in class org.springframework.aop.interceptor.ExposeBeanNameAdvisors
Find the bean name for the current invocation.
getBeanName(MethodInvocation) - Static method in class org.springframework.aop.interceptor.ExposeBeanNameAdvisors
Find the bean name for the given invocation.
getBeanName() - Method in exception org.springframework.beans.factory.BeanCreationException
Return the name of the bean requested, if any.
getBeanName() - Method in exception org.springframework.beans.factory.BeanDefinitionStoreException
Return the name of the bean requested, if any.
getBeanName() - Method in exception org.springframework.beans.factory.BeanNotOfRequiredTypeException
Return the name of the instance that was of the wrong type.
getBeanName() - Method in exception org.springframework.beans.factory.CannotLoadBeanClassException
Return the name of the bean requested.
getBeanName() - Method in class org.springframework.beans.factory.config.BeanDefinitionHolder
Return the primary name of the bean, as specified for the bean definition.
getBeanName() - Method in interface org.springframework.beans.factory.config.BeanReference
Return the target bean name that this reference points to (never null).
getBeanName() - Method in class org.springframework.beans.factory.config.RuntimeBeanNameReference
getBeanName() - Method in class org.springframework.beans.factory.config.RuntimeBeanReference
getBeanName() - Method in interface org.springframework.beans.factory.NamedBean
Return the name of this bean in a Spring bean factory.
getBeanName() - Method in exception org.springframework.beans.factory.NoSuchBeanDefinitionException
Return the name of the missing bean, if it was a lookup by name that failed.
getBeanName() - Method in class org.springframework.beans.factory.parsing.AliasDefinition
Return the canonical name of the bean.
getBeanName() - Method in class org.springframework.beans.factory.support.LookupOverride
Return the name of the bean that should be returned by this method.
getBeanName() - Method in class org.springframework.beans.factory.wiring.BeanWiringInfo
Return the specific bean name that this BeanWiringInfo points to, if any.
getBeanName() - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Return the bean name that this listener container has been assigned in its containing bean factory, if any.
getBeanName() - Method in class org.springframework.web.servlet.view.AbstractView
Return the view's name.
getBeanNameGenerator() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinitionReader
getBeanNameGenerator() - Method in interface org.springframework.beans.factory.support.BeanDefinitionReader
Return the BeanNameGenerator to use for anonymous beans (without explicit bean name specified).
getBeanNameGenerator() - Method in class org.springframework.web.context.support.AnnotationConfigWebApplicationContext
Provide a custom BeanNameGenerator for use with AnnotatedBeanDefinitionReader and/or ClassPathBeanDefinitionScanner, if any.
getBeanNamesForType(Class) - Method in interface org.springframework.beans.factory.ListableBeanFactory
Return the names of beans matching the given type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.
getBeanNamesForType(Class, boolean, boolean) - Method in interface org.springframework.beans.factory.ListableBeanFactory
Return the names of beans matching the given type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.
getBeanNamesForType(Class) - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
getBeanNamesForType(Class, boolean, boolean) - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
getBeanNamesForType(Class) - Method in class org.springframework.beans.factory.support.StaticListableBeanFactory
getBeanNamesForType(Class, boolean, boolean) - Method in class org.springframework.beans.factory.support.StaticListableBeanFactory
getBeanNamesForType(Class) - Method in class org.springframework.context.support.AbstractApplicationContext
getBeanNamesForType(Class, boolean, boolean) - Method in class org.springframework.context.support.AbstractApplicationContext
getBeanPostProcessorCount() - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Return the current number of registered BeanPostProcessors, if any.
getBeanPostProcessorCount() - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
getBeanPostProcessors() - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Return the list of BeanPostProcessors that will get applied to beans created with this factory.
getBeanReferences() - Method in class org.springframework.aop.config.AdvisorComponentDefinition
getBeanReferences() - Method in class org.springframework.aop.config.AspectComponentDefinition
getBeanReferences() - Method in class org.springframework.beans.factory.parsing.AbstractComponentDefinition
Returns an empty array.
getBeanReferences() - Method in class org.springframework.beans.factory.parsing.BeanComponentDefinition
getBeanReferences() - Method in interface org.springframework.beans.factory.parsing.ComponentDefinition
Return the set of BeanReferences that are considered to be important to this ComponentDefinition.
getBeansOfType(Class<T>) - Method in interface org.springframework.beans.factory.ListableBeanFactory
Return the bean instances that match the given object type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.
getBeansOfType(Class<T>, boolean, boolean) - Method in interface org.springframework.beans.factory.ListableBeanFactory
Return the bean instances that match the given object type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.
getBeansOfType(Class<T>) - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
getBeansOfType(Class<T>, boolean, boolean) - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
getBeansOfType(Class<T>) - Method in class org.springframework.beans.factory.support.StaticListableBeanFactory
getBeansOfType(Class<T>, boolean, boolean) - Method in class org.springframework.beans.factory.support.StaticListableBeanFactory
getBeansOfType(Class<T>) - Method in class org.springframework.context.support.AbstractApplicationContext
getBeansOfType(Class<T>, boolean, boolean) - Method in class org.springframework.context.support.AbstractApplicationContext
getBeansWithAnnotation(Class<? extends Annotation>) - Method in interface org.springframework.beans.factory.ListableBeanFactory
Find all beans whose Class has the supplied Annotation type.
getBeansWithAnnotation(Class<? extends Annotation>) - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
getBeansWithAnnotation(Class<? extends Annotation>) - Method in class org.springframework.beans.factory.support.StaticListableBeanFactory
getBeansWithAnnotation(Class<? extends Annotation>) - Method in class org.springframework.context.support.AbstractApplicationContext
getBeanType() - Method in exception org.springframework.beans.factory.NoSuchBeanDefinitionException
Return the required type of bean, if it was a lookup by type that failed.
getBeanTypeConverter() - Method in class org.springframework.beans.factory.config.AbstractFactoryBean
Obtain a bean type converter from the BeanFactory that this bean runs in.
getBeanWrapperForPropertyPath(String) - Method in class org.springframework.beans.BeanWrapperImpl
Recursively navigate to return a BeanWrapper for the nested property path.
getBigDecimal(int) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getBigDecimal(String) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getBigDecimal(int) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as an BigDecimal object.
getBigDecimal(String) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as an BigDecimal object.
getBindingErrorProcessor() - Method in class org.springframework.validation.DataBinder
Return the strategy for processing binding errors.
getBindingErrorProcessor() - Method in class org.springframework.web.bind.support.ConfigurableWebBindingInitializer
Return the strategy to use for processing binding errors.
getBindingErrorProcessor() - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Return the strategy to use for processing binding errors (if any).
getBindingErrorProcessor() - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Return the strategy to use for processing binding errors (if any).
getBindingResult() - Method in exception org.springframework.validation.BindException
Return the BindingResult that this BindException wraps.
getBindingResult(Map, String) - Static method in class org.springframework.validation.BindingResultUtils
Find the BindingResult for the given name in the given model.
getBindingResult() - Method in class org.springframework.validation.DataBinder
Return the BindingResult instance created by this DataBinder.
getBindStatus(String) - Method in class org.springframework.web.servlet.support.RequestContext
Create a BindStatus for the given bind object, using the "defaultHtmlEscape" setting.
getBindStatus(String, boolean) - Method in class org.springframework.web.servlet.support.RequestContext
Create a BindStatus for the given bind object, using the "defaultHtmlEscape" setting.
getBindStatus() - Method in class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
Get the BindStatus for this tag.
getBindStatus() - Method in class org.springframework.web.servlet.tags.form.OptionsTag
getBindStatus() - Method in class org.springframework.web.servlet.tags.form.OptionTag
getBlobAsBinaryStream(ResultSet, String) - Method in class org.springframework.jdbc.support.lob.AbstractLobHandler
getBlobAsBinaryStream(ResultSet, int) - Method in class org.springframework.jdbc.support.lob.DefaultLobHandler
getBlobAsBinaryStream(ResultSet, String) - Method in interface org.springframework.jdbc.support.lob.LobHandler
Retrieve the given column as binary stream from the given ResultSet.
getBlobAsBinaryStream(ResultSet, int) - Method in interface org.springframework.jdbc.support.lob.LobHandler
Retrieve the given column as binary stream from the given ResultSet.
getBlobAsBinaryStream(ResultSet, int) - Method in class org.springframework.jdbc.support.lob.OracleLobHandler
getBlobAsBytes(ResultSet, String) - Method in class org.springframework.jdbc.support.lob.AbstractLobHandler
getBlobAsBytes(ResultSet, int) - Method in class org.springframework.jdbc.support.lob.DefaultLobHandler
getBlobAsBytes(ResultSet, String) - Method in interface org.springframework.jdbc.support.lob.LobHandler
Retrieve the given column as bytes from the given ResultSet.
getBlobAsBytes(ResultSet, int) - Method in interface org.springframework.jdbc.support.lob.LobHandler
Retrieve the given column as bytes from the given ResultSet.
getBlobAsBytes(ResultSet, int) - Method in class org.springframework.jdbc.support.lob.OracleLobHandler
getBody() - Method in class org.springframework.http.client.AbstractClientHttpRequest
getBody() - Method in class org.springframework.http.HttpEntity
Returns the body of this entity.
getBody() - Method in interface org.springframework.http.HttpInputMessage
Return the body of the message as an input stream.
getBody() - Method in interface org.springframework.http.HttpOutputMessage
Return the body of the message as an output stream.
getBody() - Method in class org.springframework.http.server.ServletServerHttpRequest
getBody() - Method in class org.springframework.http.server.ServletServerHttpResponse
getBoolean(int) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getBoolean(String) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getBoolean(int) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as a boolean.
getBoolean(String) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as a boolean.
getBooleanParameter(ServletRequest, String) - Static method in class org.springframework.web.bind.ServletRequestUtils
Get a Boolean parameter, or null if not present.
getBooleanParameter(ServletRequest, String, boolean) - Static method in class org.springframework.web.bind.ServletRequestUtils
Get a boolean parameter, with a fallback value.
getBooleanParameter(PortletRequest, String) - Static method in class org.springframework.web.portlet.bind.PortletRequestUtils
Get a Boolean parameter, or null if not present.
getBooleanParameter(PortletRequest, String, boolean) - Static method in class org.springframework.web.portlet.bind.PortletRequestUtils
Get a boolean parameter, with a fallback value.
getBooleanParameters(ServletRequest, String) - Static method in class org.springframework.web.bind.ServletRequestUtils
Get an array of boolean parameters, return an empty array if not found.
getBooleanParameters(PortletRequest, String) - Static method in class org.springframework.web.portlet.bind.PortletRequestUtils
Get an array of boolean parameters, return an empty array if not found.
getBoundPrefixes() - Method in class org.springframework.util.xml.SimpleNamespaceContext
Returns all declared prefixes.
getBoundValue() - Method in class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
Get the bound value.
getBufferSize() - Method in class org.springframework.mock.web.MockHttpServletResponse
getBufferSize() - Method in class org.springframework.mock.web.portlet.MockMimeResponse
getBundle(String, Locale) - Method in class org.springframework.web.servlet.view.ResourceBundleViewResolver
Obtain the resource bundle for the given basename and Locale.
getBundleClassLoader() - Method in class org.springframework.context.support.ResourceBundleMessageSource
Return the ClassLoader to load resource bundles with.
getBundleClassLoader() - Method in class org.springframework.web.servlet.view.ResourceBundleViewResolver
Return the ClassLoader to load resource bundles with.
getBusinessInterface() - Method in class org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean
Return the business interface of the EJB we're proxying.
getBusinessInterface() - Method in class org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean
Return the business interface of the EJB we're proxying.
getByte(int) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getByte(String) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getByte(int) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as a byte.
getByte(String) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as a byte.
getByteArray() - Method in class org.springframework.core.io.ByteArrayResource
Return the underlying byte array.
getByteArrayOutputStream(RemoteInvocation) - Method in class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
Serialize the given RemoteInvocation into a ByteArrayOutputStream.
getBytes() - Method in class org.springframework.mock.web.MockMultipartFile
getBytes() - Method in class org.springframework.web.multipart.commons.CommonsMultipartFile
getBytes() - Method in interface org.springframework.web.multipart.MultipartFile
Return the contents of the file as an array of bytes.
getCacheability() - Method in class org.springframework.mock.web.portlet.MockResourceRequest
getCacheability() - Method in class org.springframework.mock.web.portlet.MockResourceURL
getCacheControl() - Method in class org.springframework.http.HttpHeaders
Returns the value of the Cache-Control header.
getCacheControl() - Method in class org.springframework.mock.web.portlet.MockMimeResponse
getCachedObjectForFactoryBean(String) - Method in class org.springframework.beans.factory.support.FactoryBeanRegistrySupport
Obtain an object to expose from the given FactoryBean, if available in cached form.
getCachedSessionProxy(Session, LinkedList<Session>) - Method in class org.springframework.jms.connection.CachingConnectionFactory
Wrap the given Session with a proxy that delegates every method call to it but adapts close calls.
getCacheKey(Class<?>, String) - Method in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
Build a cache key for the given bean class and bean name.
getCacheKey(Method, Class) - Method in class org.springframework.transaction.interceptor.AbstractFallbackTransactionAttributeSource
Determine a cache key for the given method and target class.
getCacheKey(String, Locale) - Method in class org.springframework.web.servlet.view.AbstractCachingViewResolver
Return the cache key for the given view name and the given locale.
getCacheKey(String, Locale) - Method in class org.springframework.web.servlet.view.UrlBasedViewResolver
This implementation returns just the view name, as this ViewResolver doesn't support localized resolution.
getCacheKey(String, Locale) - Method in class org.springframework.web.servlet.view.XmlViewResolver
This implementation returns just the view name, as XmlViewResolver doesn't support localized resolution.
getCacheLevel() - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Return the level of caching that this listener container is allowed to apply.
getCacheSeconds() - Method in class org.springframework.web.portlet.handler.PortletContentGenerator
Return the number of seconds that content is cached.
getCacheSeconds() - Method in class org.springframework.web.servlet.support.WebContentGenerator
Return the number of seconds that content is cached.
getCacheSize() - Method in class org.springframework.jdbc.support.incrementer.AbstractColumnMaxValueIncrementer
Return the number of buffered keys.
getCallableStatementFactory() - Method in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Get the CallableStatementCreatorFactory being used
getCallParameterMetaData() - Method in interface org.springframework.jdbc.core.metadata.CallMetaDataProvider
Get the call parameter metadata that is currently used.
getCallParameterMetaData() - Method in class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
getCallParameters() - Method in class org.springframework.jdbc.core.metadata.CallMetaDataContext
Get the List of SqlParameter objects to be used in call execution
getCallParameters() - Method in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Get a List of all the call parameters to be used for call.
getCallString() - Method in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Get the call string that should be used based on parameters and meta data
getCallString() - Method in class org.springframework.jdbc.object.SqlCall
Get the call string.
getCancelParamKey() - Method in class org.springframework.web.servlet.mvc.CancellableFormController
Deprecated. Return the key of the request parameter used to identify a cancel request.
getCancelView() - Method in class org.springframework.web.servlet.mvc.CancellableFormController
Deprecated. Gets the name of the cancel view.
getCannotAcquireLockCodes() - Method in class org.springframework.jdbc.support.SQLErrorCodes
getCannotSerializeTransactionCodes() - Method in class org.springframework.jdbc.support.SQLErrorCodes
getCatalogName() - Method in class org.springframework.jdbc.core.metadata.CallMetaDataContext
Get the name of the catalog.
getCatalogName() - Method in class org.springframework.jdbc.core.metadata.TableMetaDataContext
Get the name of the catalog for this context.
getCatalogName() - Method in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Get the catalog name used.
getCatalogName() - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Get the name of the catalog for this insert
getCatalogName(int) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSetMetaData
getCatalogName(int) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSetMetaData
Retrieves the catalog name of the table that served as the source for the specified column.
getCategory() - Method in class org.springframework.jmx.export.metadata.ManagedMetric
The category of this metric (ex.
getCause() - Method in exception org.springframework.expression.spel.InternalParseException
getCc() - Method in class org.springframework.mail.SimpleMailMessage
getCciTemplate() - Method in class org.springframework.jca.cci.core.support.CciDaoSupport
Return the CciTemplate for this DAO, pre-initialized with the ConnectionFactory or set explicitly.
getCciTemplate(ConnectionSpec) - Method in class org.springframework.jca.cci.core.support.CciDaoSupport
Obtain a CciTemplate derived from the main template instance, inheriting the ConnectionFactory and other settings but overriding the ConnectionSpec used for obtaining Connections.
getCciTemplate() - Method in class org.springframework.jca.cci.object.EisOperation
Return the CciTemplate used by this operation.
getCell(HSSFSheet, int, int) - Method in class org.springframework.web.servlet.view.document.AbstractExcelView
Convenient method to obtain the cell in the given sheet, row and column.
getCharacterEncoding() - Method in class org.springframework.mock.web.MockHttpServletRequest
getCharacterEncoding() - Method in class org.springframework.mock.web.MockHttpServletResponse
getCharacterEncoding() - Method in class org.springframework.mock.web.portlet.MockClientDataRequest
getCharacterEncoding() - Method in class org.springframework.mock.web.portlet.MockMimeResponse
getCharacterEncoding() - Method in class org.springframework.orm.hibernate3.support.BlobStringType
Determine the character encoding to apply to the BLOB's bytes to turn them into a String.
getCharSet() - Method in class org.springframework.http.MediaType
Return the character set, as indicated by a charset parameter, if any.
getChild(int) - Method in class org.springframework.expression.spel.ast.SpelNodeImpl
getChild(int) - Method in interface org.springframework.expression.spel.SpelNode
Helper method that returns a SpelNode rather than an Antlr Tree node.
getChildCount() - Method in class org.springframework.expression.spel.ast.SpelNodeImpl
getChildCount() - Method in interface org.springframework.expression.spel.SpelNode
getChildElementByTagName(Element, String) - Static method in class org.springframework.util.xml.DomUtils
Utility method that returns the first child element identified by its name.
getChildElementsByTagName(Element, String[]) - Static method in class org.springframework.util.xml.DomUtils
Retrieve all child elements of the given DOM element that match any of the given element names.
getChildElementsByTagName(Element, String) - Static method in class org.springframework.util.xml.DomUtils
Retrieve all child elements of the given DOM element that match the given element name.
getChildElementValueByTagName(Element, String) - Static method in class org.springframework.util.xml.DomUtils
Utility method that returns the first child element value identified by its name.
getChronology() - Method in class org.springframework.format.datetime.joda.JodaTimeContext
The user's chronology (calendar system).
getClassesToBeBound() - Method in class org.springframework.oxm.jaxb.Jaxb2Marshaller
Returns the list of Java classes to be recognized by a newly created JAXBContext.
getClassFileName(Class<?>) - Static method in class org.springframework.util.ClassUtils
Determine the name of the class file, relative to the containing package: e.g.
getClassFilter() - Method in class org.springframework.aop.aspectj.AspectJExpressionPointcut
getClassFilter() - Method in class org.springframework.aop.aspectj.DeclareParentsAdvisor
getClassFilter() - Method in interface org.springframework.aop.IntroductionAdvisor
Return the filter determining which target classes this introduction should apply to.
getClassFilter() - Method in interface org.springframework.aop.Pointcut
Return the ClassFilter for this pointcut.
getClassFilter() - Method in class org.springframework.aop.support.annotation.AnnotationMatchingPointcut
getClassFilter() - Method in class org.springframework.aop.support.ComposablePointcut
getClassFilter() - Method in class org.springframework.aop.support.ControlFlowPointcut
getClassFilter() - Method in class org.springframework.aop.support.DefaultIntroductionAdvisor
getClassFilter() - Method in class org.springframework.aop.support.DynamicMethodMatcherPointcut
getClassFilter() - Method in class org.springframework.aop.support.StaticMethodMatcherPointcut
getClassForDescriptor(Object) - Method in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Return the class to be used for the JMX descriptor field "class".
getClassForLogging(Object) - Method in class org.springframework.aop.interceptor.AbstractTraceInterceptor
Determine the class to use for logging purposes.
getClassLoader() - Method in class org.springframework.core.io.ClassPathResource
Return the ClassLoader that this resource will be obtained from.
getClassLoader() - Method in class org.springframework.core.io.DefaultResourceLoader
Return the ClassLoader to load class path resources with.
getClassLoader() - Method in interface org.springframework.core.io.ResourceLoader
Expose the ClassLoader used by this ResourceLoader.
getClassLoader() - Method in class org.springframework.core.io.support.PathMatchingResourcePatternResolver
Return the ClassLoader that this pattern resolver works with (never null).
getClassLoader() - Method in class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo
This implementation returns the default ClassLoader.
getClassLoader() - Method in class org.springframework.scheduling.quartz.ResourceLoaderClassLoadHelper
getClassMetadata() - Method in interface org.springframework.core.type.classreading.MetadataReader
Read basic class metadata for the underlying class.
getClassName() - Method in class org.springframework.core.Constants
Return the name of the analyzed class.
getClassName() - Method in interface org.springframework.core.type.ClassMetadata
Return the name of the underlying class.
getClassName() - Method in class org.springframework.core.type.StandardClassMetadata
getClassName(Object, String) - Method in class org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler
Get the class name of the MBean resource.
getClassToExpose(Object) - Method in class org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler
Return the class or interface to expose for the given bean.
getClassToExpose(Class) - Method in class org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler
Return the class or interface to expose for the given bean class.
getClassToExpose(Object) - Static method in class org.springframework.jmx.support.JmxUtils
Return the class or interface to expose for the given bean.
getClassToExpose(Class<?>) - Static method in class org.springframework.jmx.support.JmxUtils
Return the class or interface to expose for the given bean class.
getClientAddress() - Method in class org.springframework.web.context.support.ServletRequestHandledEvent
Return the IP address that the request came from.
getClientId() - Method in class org.springframework.jms.connection.SingleConnectionFactory
Return a JMS client ID for the single Connection created and exposed by this ConnectionFactory, if any.
getClientId() - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Return the JMS client ID for the shared Connection created and used by this container, if any.
getClientId() - Method in class org.springframework.jms.listener.endpoint.JmsActivationSpecConfig
getClobAsAsciiStream(ResultSet, String) - Method in class org.springframework.jdbc.support.lob.AbstractLobHandler
getClobAsAsciiStream(ResultSet, int) - Method in class org.springframework.jdbc.support.lob.DefaultLobHandler
getClobAsAsciiStream(ResultSet, String) - Method in interface org.springframework.jdbc.support.lob.LobHandler
Retrieve the given column as ASCII stream from the given ResultSet.
getClobAsAsciiStream(ResultSet, int) - Method in interface org.springframework.jdbc.support.lob.LobHandler
Retrieve the given column as ASCII stream from the given ResultSet.
getClobAsAsciiStream(ResultSet, int) - Method in class org.springframework.jdbc.support.lob.OracleLobHandler
getClobAsCharacterStream(ResultSet, String) - Method in class org.springframework.jdbc.support.lob.AbstractLobHandler
getClobAsCharacterStream(ResultSet, int) - Method in class org.springframework.jdbc.support.lob.DefaultLobHandler
getClobAsCharacterStream(ResultSet, String) - Method in interface org.springframework.jdbc.support.lob.LobHandler
Retrieve the given column as character stream from the given ResultSet.
getClobAsCharacterStream(ResultSet, int) - Method in interface org.springframework.jdbc.support.lob.LobHandler
Retrieve the given column as character stream from the given ResultSet.
getClobAsCharacterStream(ResultSet, int) - Method in class org.springframework.jdbc.support.lob.OracleLobHandler
getClobAsString(ResultSet, String) - Method in class org.springframework.jdbc.support.lob.AbstractLobHandler
getClobAsString(ResultSet, int) - Method in class org.springframework.jdbc.support.lob.DefaultLobHandler
getClobAsString(ResultSet, String) - Method in interface org.springframework.jdbc.support.lob.LobHandler
Retrieve the given column as String from the given ResultSet.
getClobAsString(ResultSet, int) - Method in interface org.springframework.jdbc.support.lob.LobHandler
Retrieve the given column as String from the given ResultSet.
getClobAsString(ResultSet, int) - Method in class org.springframework.jdbc.support.lob.OracleLobHandler
getCloseSuppressingConnectionProxy(Connection) - Method in class org.springframework.jca.cci.connection.SingleConnectionFactory
Wrap the given Connection with a proxy that delegates every method call to it but suppresses close calls.
getCloseSuppressingConnectionProxy(Connection) - Method in class org.springframework.jdbc.datasource.SingleConnectionDataSource
Wrap the given Connection with a proxy that delegates every method call to it but suppresses close calls.
getCode() - Method in class org.springframework.context.support.DefaultMessageSourceResolvable
Return the default code of this resolvable, that is, the last one in the codes array.
getCode() - Method in interface org.springframework.core.enums.LabeledEnum
Deprecated. Return this enumeration's code.
getCode() - Method in class org.springframework.core.enums.LetterCodedLabeledEnum
Deprecated.
getCode() - Method in class org.springframework.core.enums.ShortCodedLabeledEnum
Deprecated.
getCode() - Method in class org.springframework.core.enums.StaticLabeledEnum
Deprecated.
getCode() - Method in class org.springframework.core.enums.StringCodedLabeledEnum
Deprecated.
getCodebaseUrl() - Method in interface org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration
Return the codebase URL to download classes from if not found locally.
getCodebaseUrl() - Method in class org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor
Return the codebase URL to download classes from if not found locally.
getCodes() - Method in interface org.springframework.context.MessageSourceResolvable
Return the codes to be used to resolve this message, in the order that they should get tried.
getCodes() - Method in class org.springframework.context.support.DefaultMessageSourceResolvable
getCollectionFieldType(Field) - Static method in class org.springframework.core.GenericCollectionTypeResolver
Determine the generic element type of the given Collection field.
getCollectionFieldType(Field, int) - Static method in class org.springframework.core.GenericCollectionTypeResolver
Determine the generic element type of the given Collection field.
getCollectionParameterType(MethodParameter) - Static method in class org.springframework.core.GenericCollectionTypeResolver
Determine the generic element type of the given Collection parameter.
getCollectionReturnType(Method) - Static method in class org.springframework.core.GenericCollectionTypeResolver
Determine the generic element type of the given Collection return type.
getCollectionReturnType(Method, int) - Static method in class org.springframework.core.GenericCollectionTypeResolver
Determine the generic element type of the given Collection return type.
getCollectionType() - Method in class org.springframework.beans.factory.config.DependencyDescriptor
Determine the generic element type of the wrapped Collection parameter/field, if any.
getCollectionType(Class<? extends Collection>) - Static method in class org.springframework.core.GenericCollectionTypeResolver
Determine the generic element type of the given Collection class (if it declares one through a generic superclass or generic interface).
getCols() - Method in class org.springframework.web.servlet.tags.form.TextareaTag
Get the value of the 'cols' attribute.
getColumnClassName(int) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSetMetaData
getColumnClassName(int) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSetMetaData
Retrieves the fully qualified class that the specified column will be mapped to.
getColumnCount() - Method in class org.springframework.jdbc.core.RowCountCallbackHandler
Return the number of columns in this result set.
getColumnCount() - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSetMetaData
getColumnCount() - Method in interface org.springframework.jdbc.support.rowset.SqlRowSetMetaData
Retrives the number of columns in the RowSet.
getColumnDisplaySize(int) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSetMetaData
getColumnDisplaySize(int) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSetMetaData
Retrieves the maximum width of the designated column.
getColumnKey(String) - Method in class org.springframework.jdbc.core.ColumnMapRowMapper
Determine the key to use for the given column in the column Map.
getColumnLabel(int) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSetMetaData
getColumnLabel(int) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSetMetaData
Retrieve the suggested column title for the column specified.
getColumnMapRowMapper() - Method in class org.springframework.jdbc.core.JdbcTemplate
Create a new RowMapper for reading columns as key-value pairs.
getColumnName() - Method in class org.springframework.jdbc.support.incrementer.AbstractColumnMaxValueIncrementer
Return the name of the column in the sequence table.
getColumnName(int) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSetMetaData
getColumnName(int) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSetMetaData
Retrieve the column name for the indicated column.
getColumnNames() - Method in class org.springframework.jdbc.core.RowCountCallbackHandler
Return the names of the columns.
getColumnNames() - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Get the names of the columns used
getColumnNames() - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSetMetaData
getColumnNames() - Method in interface org.springframework.jdbc.support.rowset.SqlRowSetMetaData
Return the column names of the table that the result set represents.
getColumnType(int) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSetMetaData
getColumnType(int) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSetMetaData
Retrieve the SQL type code for the indicated column.
getColumnTypeName(int) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSetMetaData
getColumnTypeName(int) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSetMetaData
Retrieves the DBMS-specific type name for the indicated column.
getColumnTypes() - Method in class org.springframework.jdbc.core.RowCountCallbackHandler
Return the types of the columns as java.sql.Types constants Valid after processRow is invoked the first time.
getColumnValue(ResultSet, int, PropertyDescriptor) - Method in class org.springframework.jdbc.core.BeanPropertyRowMapper
Retrieve a JDBC object value for the specified column.
getColumnValue(ResultSet, int) - Method in class org.springframework.jdbc.core.ColumnMapRowMapper
Retrieve a JDBC object value for the specified column.
getColumnValue(ResultSet, int, Class) - Method in class org.springframework.jdbc.core.SingleColumnRowMapper
Retrieve a JDBC object value for the specified column.
getColumnValue(ResultSet, int) - Method in class org.springframework.jdbc.core.SingleColumnRowMapper
Retrieve a JDBC object value for the specified column, using the most appropriate value type.
getCommand(PortletRequest) - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Return the form object for the given request.
getCommand(PortletRequest) - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Retrieve a command object for the given request.
getCommand(HttpServletRequest) - Method in class org.springframework.web.servlet.mvc.AbstractFormController
Deprecated. Return the form object for the given request.
getCommand(HttpServletRequest) - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Retrieve a command object for the given request.
getCommandClass() - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Return the command class for this controller.
getCommandClass() - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Return the command class for this controller.
getCommandInSessionParameterName() - Method in class org.springframework.web.portlet.mvc.AbstractCommandController
Deprecated. Return the name of the render parameter that indicates there is a valid command (and errors) object in the session.
getCommandName() - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Return the name of the command in the model.
getCommandName() - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Return the name of the command in the model.
getCommandName(Object) - Method in class org.springframework.web.servlet.mvc.multiaction.MultiActionController
Return the command name to use for the given command object.
getCommandName() - Method in class org.springframework.web.servlet.tags.form.FormTag
Get the name of the form attribute in the model.
getCommonPropertyType(ELContext, Object) - Method in class org.springframework.beans.factory.access.el.SpringBeanELResolver
getCommonPropertyType(ELContext, Object) - Method in class org.springframework.web.jsf.el.WebApplicationContextFacesELResolver
getComparatorCount() - Method in class org.springframework.util.comparator.CompoundComparator
Returns the number of aggregated comparators.
getComponentContext(ComponentDefinition, HttpServletRequest) - Method in class org.springframework.web.servlet.view.tiles.TilesView
Deprecated. Determine the Tiles component context for the given Tiles definition.
getComponentDefinition(DefinitionsFactory, HttpServletRequest) - Method in class org.springframework.web.servlet.view.tiles.TilesView
Deprecated. Determine the Tiles component definition for the given Tiles definitions factory.
getConcurrencyLimit() - Method in class org.springframework.core.task.SimpleAsyncTaskExecutor
Return the maximum number of parallel accesses allowed.
getConcurrencyLimit() - Method in class org.springframework.util.ConcurrencyThrottleSupport
Return the maximum number of concurrent access attempts allowed.
getConcurrentConsumers() - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Return the "concurrentConsumer" setting.
getConcurrentExecutor() - Method in class org.springframework.scheduling.backportconcurrent.ConcurrentTaskExecutor
Return the JSR-166 backport concurrent executor that this adapter delegates to.
getConcurrentExecutor() - Method in class org.springframework.scheduling.concurrent.ConcurrentTaskExecutor
Return the JDK 1.5 concurrent executor that this adapter delegates to.
getConfigLocations() - Method in class org.springframework.context.support.AbstractRefreshableConfigApplicationContext
Return an array of resource locations, referring to the XML bean definition files that this context should be built with.
getConfigLocations() - Method in class org.springframework.test.AbstractSingleSpringContextTests
Deprecated. Subclasses can override this method to return the locations of their config files, unless they override AbstractSingleSpringContextTests.contextKey() and AbstractSingleSpringContextTests.loadContext(Object) instead.
getConfigLocations() - Method in interface org.springframework.web.context.ConfigurableWebApplicationContext
Return the config locations for this web application context, or null if none specified.
getConfigLocations() - Method in class org.springframework.web.context.support.AbstractRefreshableWebApplicationContext
getConfigLocations() - Method in class org.springframework.web.context.support.StaticWebApplicationContext
getConfigLocations() - Method in class org.springframework.web.portlet.context.AbstractRefreshablePortletApplicationContext
getConfigLocations() - Method in interface org.springframework.web.portlet.context.ConfigurablePortletApplicationContext
Return the config locations for this web application context, or null if none specified.
getConfigLocations() - Method in class org.springframework.web.portlet.context.StaticPortletApplicationContext
getConfigPath() - Method in class org.springframework.test.AbstractSingleSpringContextTests
Deprecated. Subclasses can override this method to return a single path to a config file, relative to the concrete test class.
getConfigPaths() - Method in class org.springframework.test.AbstractSingleSpringContextTests
Deprecated. Subclasses can override this method to return paths to their config files, relative to the concrete test class.
getConfigResources() - Method in class org.springframework.context.support.AbstractXmlApplicationContext
Return an array of Resource objects, referring to the XML bean definition files that this context should be built with.
getConfigResources() - Method in class org.springframework.context.support.ClassPathXmlApplicationContext
getConfigTimeCacheProvider() - Static method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Return the CacheProvider for the currently configured Hibernate SessionFactory, to be used by LocalCacheProviderProxy.
getConfigTimeDataSource() - Static method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Return the DataSource for the currently configured Hibernate SessionFactory, to be used by LocalDataSourceConnectionProvoder.
getConfigTimeDataSource() - Static method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
Return the DataSource for the currently configured Quartz Scheduler, to be used by LocalDataSourceJobStore.
getConfigTimeLobHandler() - Static method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Return the LobHandler for the currently configured Hibernate SessionFactory, to be used by UserType implementations like ClobStringType.
getConfigTimeLobHandler() - Static method in class org.springframework.orm.ibatis.SqlMapClientFactoryBean
Return the LobHandler for the currently configured iBATIS SqlMapClient, to be used by TypeHandler implementations like ClobStringTypeHandler.
getConfigTimeNonTransactionalDataSource() - Static method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
Return the non-transactional DataSource for the currently configured Quartz Scheduler, to be used by LocalDataSourceJobStore.
getConfigTimeResourceLoader() - Static method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
Return the ResourceLoader for the currently configured Quartz Scheduler, to be used by ResourceLoaderClassLoadHelper.
getConfigTimeTaskExecutor() - Static method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
Return the TaskExecutor for the currently configured Quartz Scheduler, to be used by LocalTaskExecutorThreadPool.
getConfigTimeTransactionManager() - Static method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Return the JTA TransactionManager for the currently configured Hibernate SessionFactory, to be used by LocalTransactionManagerLookup.
getConfiguration() - Method in class org.springframework.expression.spel.ExpressionState
getConfiguration() - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Return the Configuration object used to build the SessionFactory.
getConfiguration() - Method in interface org.springframework.web.servlet.view.freemarker.FreeMarkerConfig
Return the FreeMarker Configuration object for the current web application context.
getConfiguration() - Method in class org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer
Return the Configuration object wrapped by this bean.
getConfiguration() - Method in class org.springframework.web.servlet.view.freemarker.FreeMarkerView
Return the FreeMarker configuration used by this view.
getConnection(ConnectionFactory) - Static method in class org.springframework.jca.cci.connection.ConnectionFactoryUtils
Obtain a Connection from the given ConnectionFactory.
getConnection(ConnectionFactory, ConnectionSpec) - Static method in class org.springframework.jca.cci.connection.ConnectionFactoryUtils
Obtain a Connection from the given ConnectionFactory.
getConnection() - Method in class org.springframework.jca.cci.connection.ConnectionHolder
getConnection() - Method in class org.springframework.jca.cci.connection.ConnectionSpecConnectionFactoryAdapter
Determine whether there is currently a thread-bound ConnectionSpec, using it if available, falling back to the statically specified "connectionSpec" property else.
getConnection() - Method in class org.springframework.jca.cci.connection.DelegatingConnectionFactory
getConnection(ConnectionSpec) - Method in class org.springframework.jca.cci.connection.DelegatingConnectionFactory
getConnection() - Method in class org.springframework.jca.cci.connection.SingleConnectionFactory
getConnection(ConnectionSpec) - Method in class org.springframework.jca.cci.connection.SingleConnectionFactory
getConnection() - Method in class org.springframework.jca.cci.connection.TransactionAwareConnectionFactoryProxy
Delegate to ConnectionFactoryUtils for automatically participating in Spring-managed transactions.
getConnection() - Method in class org.springframework.jca.cci.core.support.CciDaoSupport
Get a CCI Connection, either from the current transaction or a new one.
getConnection() - Method in class org.springframework.jdbc.core.support.JdbcDaoSupport
Get a JDBC Connection, either from the current transaction or a new one.
getConnection() - Method in class org.springframework.jdbc.datasource.AbstractDriverBasedDataSource
This implementation delegates to getConnectionFromDriver, using the default username and password of this DataSource.
getConnection(String, String) - Method in class org.springframework.jdbc.datasource.AbstractDriverBasedDataSource
This implementation delegates to getConnectionFromDriver, using the given username and password.
getConnection() - Method in interface org.springframework.jdbc.datasource.ConnectionHandle
Fetch the JDBC Connection that this handle refers to.
getConnection() - Method in class org.springframework.jdbc.datasource.ConnectionHolder
Return the current Connection held by this ConnectionHolder.
getConnection(DataSource) - Static method in class org.springframework.jdbc.datasource.DataSourceUtils
Obtain a Connection from the given DataSource.
getConnection() - Method in class org.springframework.jdbc.datasource.DelegatingDataSource
getConnection(String, String) - Method in class org.springframework.jdbc.datasource.DelegatingDataSource
getConnection() - Method in class org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy
Return a Connection handle that lazily fetches an actual JDBC Connection when asked for a Statement (or PreparedStatement or CallableStatement).
getConnection(String, String) - Method in class org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy
Return a Connection handle that lazily fetches an actual JDBC Connection when asked for a Statement (or PreparedStatement or CallableStatement).
getConnection() - Method in class org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
getConnection(String, String) - Method in class org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
getConnection() - Method in class org.springframework.jdbc.datasource.SimpleConnectionHandle
Return the specified Connection as-is.
getConnection() - Method in class org.springframework.jdbc.datasource.SingleConnectionDataSource
getConnection(String, String) - Method in class org.springframework.jdbc.datasource.SingleConnectionDataSource
Specifying a custom username and password doesn't make sense with a single Connection.
getConnection() - Method in class org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy
Delegates to DataSourceUtils for automatically participating in Spring-managed transactions.
getConnection() - Method in class org.springframework.jdbc.datasource.UserCredentialsDataSourceAdapter
Determine whether there are currently thread-bound credentials, using them if available, falling back to the statically specified username and password (i.e.
getConnection(String, String) - Method in class org.springframework.jdbc.datasource.UserCredentialsDataSourceAdapter
Simply delegates to UserCredentialsDataSourceAdapter.doGetConnection(String, String), keeping the given user credentials as-is.
getConnection(JmsResourceHolder) - Method in interface org.springframework.jms.connection.ConnectionFactoryUtils.ResourceFactory
Fetch an appropriate Connection from the given JmsResourceHolder.
getConnection() - Method in class org.springframework.jms.connection.JmsResourceHolder
getConnection(Class<? extends Connection>) - Method in class org.springframework.jms.connection.JmsResourceHolder
getConnection(JmsResourceHolder) - Method in class org.springframework.jms.core.JmsTemplate
Fetch an appropriate Connection from the given JmsResourceHolder.
getConnection(JmsResourceHolder) - Method in class org.springframework.jms.core.JmsTemplate102
Deprecated. This implementation overrides the superclass method to accept either a QueueConnection or a TopicConnection, depending on the domain.
getConnection(JmsResourceHolder) - Method in class org.springframework.jms.listener.AbstractPollingMessageListenerContainer
Fetch an appropriate Connection from the given JmsResourceHolder.
getConnection(JmsResourceHolder) - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer102
Deprecated. This implementation overrides the superclass method to accept either a QueueConnection or a TopicConnection, depending on the domain.
getConnection() - Method in class org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
This implementation delegates to the underlying DataSource.
getConnectionFactory() - Method in class org.springframework.jca.cci.connection.CciLocalTransactionManager
Return the CCI ConnectionFactory that this instance manages local transactions for.
getConnectionFactory() - Method in class org.springframework.jca.cci.core.CciTemplate
Return the CCI ConnectionFactory used by this template.
getConnectionFactory() - Method in class org.springframework.jca.cci.core.support.CciDaoSupport
Return the ConnectionFactory used by this DAO.
getConnectionFactory() - Method in class org.springframework.jms.connection.JmsTransactionManager
Return the JMS ConnectionFactory that this instance should manage transactions for.
getConnectionFactory() - Method in class org.springframework.jms.core.support.JmsGatewaySupport
Return the JMS ConnectionFactory used by the gateway.
getConnectionFactory() - Method in class org.springframework.jms.remoting.JmsInvokerClientInterceptor
Return the QueueConnectionFactory to use for obtaining JMS QueueConnections.
getConnectionFactory() - Method in class org.springframework.jms.support.JmsAccessor
Return the ConnectionFactory that this accessor uses for obtaining JMS Connections.
getConnectionFromDriver(String, String) - Method in class org.springframework.jdbc.datasource.AbstractDriverBasedDataSource
Build properties for the Driver, including the given username and password (if any), and obtain a corresponding Connection.
getConnectionFromDriver(Properties) - Method in class org.springframework.jdbc.datasource.AbstractDriverBasedDataSource
Obtain a Connection using the given properties.
getConnectionFromDriver(Properties) - Method in class org.springframework.jdbc.datasource.DriverManagerDataSource
getConnectionFromDriver(Properties) - Method in class org.springframework.jdbc.datasource.SimpleDriverDataSource
getConnectionFromDriverManager(String, Properties) - Method in class org.springframework.jdbc.datasource.DriverManagerDataSource
Getting a Connection using the nasty static from DriverManager is extracted into a protected method to allow for easy unit testing.
getConnectionHandle() - Method in class org.springframework.jdbc.datasource.ConnectionHolder
Return the ConnectionHandle held by this ConnectionHolder.
getConnectionHolder() - Method in class org.springframework.jdbc.datasource.JdbcTransactionObjectSupport
getConnectionHolderForSavepoint() - Method in class org.springframework.jdbc.datasource.JdbcTransactionObjectSupport
getConnectionProperties() - Method in class org.springframework.jdbc.datasource.AbstractDriverBasedDataSource
Return the connection properties to be passed to the Driver, if any.
getConnectionProperties() - Method in interface org.springframework.jdbc.datasource.embedded.DataSourceFactory
Allows properties of the DataSource to be configured.
getConnectionSpec() - Method in class org.springframework.jca.cci.core.CciTemplate
Return the CCI ConnectionSpec used by this template, if any.
getConstraintsForClass(Class<?>) - Method in class org.springframework.validation.beanvalidation.SpringValidatorAdapter
getConstraintValidatorFactory() - Method in class org.springframework.validation.beanvalidation.LocalValidatorFactoryBean
getConstructor() - Method in class org.springframework.core.MethodParameter
Return the wrapped Constructor, if any.
getConstructorArgumentValues() - Method in interface org.springframework.beans.factory.config.BeanDefinition
Return the constructor argument values for this bean.
getConstructorArgumentValues() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Return constructor argument values for this bean (never null).
getConstructorIfAvailable(Class<T>, Class<?>...) - Static method in class org.springframework.util.ClassUtils
Determine whether the given class has a public constructor with the given signature, and return it if available (else return null).
getConstructorInfo(Object, String) - Method in class org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler
Get the constructor metadata for the MBean resource.
getConstructorResolvers() - Method in interface org.springframework.expression.EvaluationContext
getConstructorResolvers() - Method in class org.springframework.expression.spel.support.StandardEvaluationContext
getContainerRuntimeOptions() - Method in class org.springframework.mock.web.portlet.MockPortletConfig
getContainerRuntimeOptions() - Method in class org.springframework.mock.web.portlet.MockPortletContext
getContainerRuntimeOptions() - Method in class org.springframework.mock.web.portlet.ServletWrappingPortletContext
getContainingBeanDefinition() - Method in class org.springframework.beans.factory.xml.ParserContext
getContainingComponent() - Method in class org.springframework.beans.factory.xml.ParserContext
getContent() - Method in class org.springframework.oxm.support.MarshallingSource
Return the object to be marshalled.
getContentAsByteArray() - Method in class org.springframework.mock.web.MockHttpServletResponse
getContentAsByteArray() - Method in class org.springframework.mock.web.portlet.MockMimeResponse
getContentAsString() - Method in class org.springframework.mock.web.MockHttpServletResponse
getContentAsString() - Method in class org.springframework.mock.web.portlet.MockMimeResponse
getContentDispositionMappings() - Method in class org.springframework.web.servlet.view.jasperreports.JasperReportsMultiFormatView
Return the mappings of Content-Disposition header values to mapping keys.
getContentLength(T, MediaType) - Method in class org.springframework.http.converter.AbstractHttpMessageConverter
Returns the content length for the given type.
getContentLength(byte[], MediaType) - Method in class org.springframework.http.converter.ByteArrayHttpMessageConverter
getContentLength(Resource, MediaType) - Method in class org.springframework.http.converter.ResourceHttpMessageConverter
getContentLength(String, MediaType) - Method in class org.springframework.http.converter.StringHttpMessageConverter
getContentLength() - Method in class org.springframework.http.HttpHeaders
Return the length of the body in bytes, as specified by the Content-Length header.
getContentLength() - Method in class org.springframework.mock.web.MockHttpServletRequest
getContentLength() - Method in class org.springframework.mock.web.MockHttpServletResponse
getContentLength() - Method in class org.springframework.mock.web.portlet.MockClientDataRequest
getContentLength() - Method in class org.springframework.mock.web.portlet.MockResourceResponse
getContentType() - Method in class org.springframework.http.HttpHeaders
Return the media type of the body, as specified by the Content-Type header.
getContentType(File) - Method in class org.springframework.mail.javamail.ConfigurableMimeFileTypeMap
Delegates to the underlying FileTypeMap.
getContentType(String) - Method in class org.springframework.mail.javamail.ConfigurableMimeFileTypeMap
Delegates to the underlying FileTypeMap.
getContentType() - Method in class org.springframework.mock.web.MockHttpServletRequest
getContentType() - Method in class org.springframework.mock.web.MockHttpServletResponse
getContentType() - Method in class org.springframework.mock.web.MockMultipartFile
getContentType() - Method in class org.springframework.mock.web.portlet.MockClientDataRequest
getContentType() - Method in class org.springframework.mock.web.portlet.MockMimeResponse
getContentType() - Method in class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
Return the content type to use for sending HTTP invoker requests.
getContentType() - Method in class org.springframework.remoting.rmi.RemoteInvocationSerializingExporter
Return the content type to use for sending remote invocation responses.
getContentType() - Method in exception org.springframework.web.HttpMediaTypeNotSupportedException
Return the HTTP request content type method that caused the failure.
getContentType() - Method in class org.springframework.web.multipart.commons.CommonsMultipartFile
getContentType() - Method in interface org.springframework.web.multipart.MultipartFile
Return the content type of the file.
getContentType() - Method in class org.springframework.web.servlet.view.AbstractView
Return the content type for this view.
getContentType() - Method in interface org.springframework.web.servlet.View
Return the content type of the view, if predetermined.
getContentType() - Method in class org.springframework.web.servlet.view.UrlBasedViewResolver
Return the content type for all views, if any.
getContext() - Method in class org.springframework.jndi.JndiTemplate
Obtain a JNDI context corresponding to this template's configuration.
getContext(String) - Method in class org.springframework.mock.web.MockServletContext
getContext(Object) - Method in class org.springframework.test.AbstractSpringContextTests
Deprecated. Obtain an ApplicationContext for the given key, potentially cached.
getContextAttribute() - Method in class org.springframework.web.filter.DelegatingFilterProxy
Return the name of the ServletContext attribute which should be used to retrieve the WebApplicationContext from which to load the delegate Filter bean.
getContextAttribute() - Method in class org.springframework.web.servlet.FrameworkServlet
Return the name of the ServletContext attribute which should be used to retrieve the WebApplicationContext that this servlet is supposed to use.
getContextClass() - Method in class org.springframework.web.portlet.FrameworkPortlet
Return the custom context class.
getContextClass() - Method in class org.springframework.web.servlet.FrameworkServlet
Return the custom context class.
getContextClass() - Method in class org.springframework.web.struts.ContextLoaderPlugIn
Deprecated. Return the custom context class.
getContextConfigLocation() - Method in class org.springframework.jca.context.SpringContextResourceAdapter
Return the specified context configuration files.
getContextConfigLocation() - Method in class org.springframework.web.portlet.FrameworkPortlet
Return the explicit context config location, if any.
getContextConfigLocation() - Method in class org.springframework.web.servlet.FrameworkServlet
Return the explicit context config location, if any.
getContextConfigLocation() - Method in class org.springframework.web.struts.ContextLoaderPlugIn
Deprecated. Return the explicit context config location, if any.
getContextLoader() - Method in class org.springframework.web.context.ContextLoaderListener
Deprecated. in favor of simply subclassing ContextLoaderListener itself (which extends ContextLoader, as of Spring 3.0)
getContextPath() - Method in class org.springframework.mock.web.MockHttpServletRequest
getContextPath() - Method in class org.springframework.mock.web.MockServletContext
getContextPath() - Method in class org.springframework.mock.web.portlet.MockPortletRequest
getContextPath() - Method in class org.springframework.oxm.jaxb.Jaxb2Marshaller
Returns the JAXB context path.
getContextPath() - Method in class org.springframework.web.context.request.FacesWebRequest
getContextPath() - Method in class org.springframework.web.context.request.ServletWebRequest
getContextPath() - Method in interface org.springframework.web.context.request.WebRequest
Return the context path for this request (usually the base path that the current web application is mapped to).
getContextPath() - Method in class org.springframework.web.portlet.context.PortletWebRequest
getContextPath() - Method in class org.springframework.web.servlet.support.RequestContext
Return the context path of the original request, that is, the path that indicates the current web application.
getContextPath(HttpServletRequest) - Method in class org.springframework.web.util.UrlPathHelper
Return the context path for the given request, detecting an include request URL if called within a RequestDispatcher include.
getContextUrl(String) - Method in class org.springframework.web.servlet.support.RequestContext
Return a context-aware URl for the given relative URL.
getController(ComponentDefinition, HttpServletRequest) - Method in class org.springframework.web.servlet.view.tiles.TilesView
Deprecated. Determine and initialize the Tiles component controller for the given Tiles definition, if any.
getConversationId() - Method in interface org.springframework.beans.factory.config.Scope
Return the conversation ID for the current underlying scope, if any.
getConversationId() - Method in class org.springframework.context.support.SimpleThreadScope
getConversationId() - Method in class org.springframework.web.context.request.RequestScope
There is no conversation id concept for a request, so this method returns null.
getConversationId() - Method in class org.springframework.web.context.request.SessionScope
getConversationId() - Method in class org.springframework.web.context.support.ServletContextScope
getConversationId() - Method in class org.springframework.web.portlet.context.PortletContextScope
getConversionService() - Method in interface org.springframework.beans.ConfigurablePropertyAccessor
Return the associated ConversionService, if any.
getConversionService() - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Return the associated ConversionService, if any.
getConversionService() - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
getConversionService() - Method in class org.springframework.beans.PropertyEditorRegistrySupport
Return the associated ConversionService, if any.
getConversionService() - Method in class org.springframework.validation.DataBinder
Return the associated ConversionService, if any.
getConversionService() - Method in class org.springframework.web.bind.support.ConfigurableWebBindingInitializer
Return the ConversionService which will apply to every DataBinder.
getConvertedExporterParameters() - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
Allows subclasses to retrieve the converted exporter parameters.
getConvertedValue() - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues.ValueHolder
Return the converted value of the constructor argument, after processed type conversion.
getConvertedValue() - Method in class org.springframework.beans.PropertyValue
Return the converted value of the constructor argument, after processed type conversion.
getConverter(Class<T>) - Method in interface org.springframework.core.convert.converter.ConverterFactory
Get the converter to convert from S to target type T, where T is also an instance of R.
getConverter(TypeDescriptor, TypeDescriptor) - Method in class org.springframework.core.convert.support.GenericConversionService
Hook method to lookup the converter for a given sourceType/targetType pair.
getConvertibleTypes() - Method in interface org.springframework.core.convert.converter.GenericConverter
Return the source and target types which this converter can convert between.
getCookie(String) - Method in class org.springframework.mock.web.MockHttpServletResponse
getCookie(String) - Method in class org.springframework.mock.web.portlet.MockPortletResponse
getCookie(PortletRequest, String) - Static method in class org.springframework.web.portlet.util.PortletUtils
Retrieve the first cookie with the given name.
getCookie(HttpServletRequest, String) - Static method in class org.springframework.web.util.WebUtils
Retrieve the first cookie with the given name.
getCookieDomain() - Method in class org.springframework.web.util.CookieGenerator
Return the domain for cookies created by this generator, if any.
getCookieMaxAge() - Method in class org.springframework.web.util.CookieGenerator
Return the maximum age for cookies created by this generator.
getCookieName() - Method in class org.springframework.web.util.CookieGenerator
Return the given name for cookies created by this generator.
getCookiePath() - Method in class org.springframework.web.util.CookieGenerator
Return the path for cookies created by this generator.
getCookies() - Method in class org.springframework.mock.web.MockHttpServletRequest
getCookies() - Method in class org.springframework.mock.web.MockHttpServletResponse
getCookies() - Method in class org.springframework.mock.web.portlet.MockPortletRequest
getCookies() - Method in class org.springframework.mock.web.portlet.MockPortletResponse
getCorePoolSize() - Method in class org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor
Return the ThreadPoolExecutor's core pool size.
getCorePoolSize() - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
Return the ThreadPoolExecutor's core pool size.
getCount() - Method in class org.springframework.aop.interceptor.DebugInterceptor
Return the number of times this interceptor has been invoked.
getCreateMethod(Object) - Method in class org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor
Check for EJB3-style home object that serves as EJB component directly.
getCreateMethod(Object) - Method in class org.springframework.ejb.access.AbstractSlsbInvokerInterceptor
Determine the create method of the given EJB home object.
getCreateMethod(Object) - Method in class org.springframework.ejb.access.LocalSlsbInvokerInterceptor
Check for EJB3-style home object that serves as EJB component directly.
getCreationTime() - Method in class org.springframework.mock.web.MockHttpSession
getCreationTime() - Method in class org.springframework.mock.web.portlet.MockPortletSession
getCssClass() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Get the value of the 'class' attribute.
getCssErrorClass() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
The CSS class to use when the field bound to a particular tag has errors.
getCssStyle() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Get the value of the 'style' attribute.
getCurrencyTimeLimit() - Method in class org.springframework.jmx.export.metadata.AbstractJmxAttribute
Return a currency time limit for this attribute.
getCurrentContextBuilder() - Static method in class org.springframework.mock.jndi.SimpleNamingContextBuilder
Checks if a SimpleNamingContextBuilder is active.
getCurrentIsolationLevel() - Method in class org.springframework.jdbc.datasource.IsolationLevelDataSourceAdapter
Determine the current isolation level: either the transaction's isolation level or a statically defined isolation level.
getCurrentPage(PortletRequest) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Return the current page number.
getCurrentPage(HttpServletRequest) - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Return the current page number.
getCurrentProxiedBeanName() - Method in class org.springframework.aop.aspectj.AspectJExpressionPointcut
getCurrentProxiedBeanName() - Static method in class org.springframework.aop.framework.autoproxy.ProxyCreationContext
Return the name of the currently proxied bean instance.
getCurrentReadOnlyFlag() - Method in class org.springframework.jdbc.datasource.IsolationLevelDataSourceAdapter
Determine the current read-only flag: by default, the transaction's read-only hint.
getCurrentTransactionIsolationLevel() - Static method in class org.springframework.transaction.support.TransactionSynchronizationManager
Return the isolation level for the current transaction, if any.
getCurrentTransactionName() - Static method in class org.springframework.transaction.support.TransactionSynchronizationManager
Return the name of the current transaction, or null if none set.
getCurrentWebApplicationContext() - Static method in class org.springframework.web.context.ContextLoader
Obtain the Spring root web application context for the current thread (i.e.
getCustomEditor(String) - Method in class org.springframework.validation.AbstractPropertyBindingResult
Retrieve the custom PropertyEditor for the given field, if any.
getCustomEditors() - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Return the map of custom editors, with Classes as keys and PropertyEditor classes as values.
getCustomProperties() - Method in class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
Allow Map access to the custom properties to be set on the stub, with the option to add or override specific entries.
getCustomPropertyMap() - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Allow Map access to the custom properties to be set on the stub or call, with the option to add or override specific entries.
getCustomSqlExceptionTranslator() - Method in class org.springframework.jdbc.support.SQLErrorCodes
getCustomTargetSource(Class<?>, String) - Method in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
Create a target source for bean instances.
getCustomTranslations() - Method in class org.springframework.jdbc.support.SQLErrorCodes
getCustomTypeConverter() - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Return the custom TypeConverter to use, if any.
getDataAccessResourceFailureCodes() - Method in class org.springframework.jdbc.support.SQLErrorCodes
getDatabase() - Method in class org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory
Factory method that returns the embedded database instance.
getDatabase() - Method in class org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter
Return the target database to operate on.
getDatabasePlatform() - Method in class org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter
Return the name of the target database to operate on.
getDatabaseProductName() - Method in class org.springframework.jdbc.support.SQLErrorCodes
getDatabaseProductNames() - Method in class org.springframework.jdbc.support.SQLErrorCodes
getDatabaseVersion() - Method in class org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
Provide access to version info for subclasses
getDataIntegrityViolationCodes() - Method in class org.springframework.jdbc.support.SQLErrorCodes
getDataSource() - Method in class org.springframework.jdbc.core.support.JdbcDaoSupport
Return the JDBC DataSource used by this DAO.
getDataSource() - Method in class org.springframework.jdbc.datasource.DataSourceTransactionManager
Return the JDBC DataSource that this instance manages transactions for.
getDataSource() - Method in interface org.springframework.jdbc.datasource.embedded.DataSourceFactory
Returns the DataSource with the connection properties applied.
getDataSource() - Method in class org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory
Hook that gets the DataSource that provides the connectivity to the embedded database.
getDataSource(String) - Method in class org.springframework.jdbc.datasource.lookup.BeanFactoryDataSourceLookup
getDataSource(String) - Method in interface org.springframework.jdbc.datasource.lookup.DataSourceLookup
Retrieve the DataSource identified by the given name.
getDataSource(String) - Method in class org.springframework.jdbc.datasource.lookup.JndiDataSourceLookup
getDataSource(String) - Method in class org.springframework.jdbc.datasource.lookup.MapDataSourceLookup
getDataSource(String) - Method in class org.springframework.jdbc.datasource.lookup.SingleDataSourceLookup
getDataSource() - Method in class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
Return the data source to retrieve the value from.
getDataSource() - Method in class org.springframework.jdbc.support.JdbcAccessor
Return the DataSource used by this template.
getDataSource() - Method in class org.springframework.orm.hibernate3.AbstractSessionFactoryBean
Return the DataSource to be used by the SessionFactory.
getDataSource() - Method in class org.springframework.orm.hibernate3.HibernateTransactionManager
Return the JDBC DataSource that this instance manages transactions for.
getDataSource() - Method in class org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
Return the DataSource that this ConnectionProvider wraps.
getDataSource(SessionFactory) - Static method in class org.springframework.orm.hibernate3.SessionFactoryUtils
Determine the DataSource of the given SessionFactory.
getDataSource() - Method in class org.springframework.orm.ibatis.SqlMapClientTemplate
If no DataSource specified, use SqlMapClient's DataSource.
getDataSource() - Method in class org.springframework.orm.ibatis.support.SqlMapClientDaoSupport
Return the JDBC DataSource used by this DAO.
getDataSource() - Method in class org.springframework.orm.jdo.JdoTransactionManager
Return the JDBC DataSource that this instance manages transactions for.
getDataSource() - Method in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
getDataSource() - Method in interface org.springframework.orm.jpa.EntityManagerFactoryInfo
Return the JDBC DataSource that this EntityManagerFactory obtains its JDBC Connections from.
getDataSource() - Method in class org.springframework.orm.jpa.JpaTransactionManager
Return the JDBC DataSource that this instance manages transactions for.
getDataSource() - Method in class org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean
getDataSourceLookup() - Method in class org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager
Return the JDBC DataSourceLookup that provides DataSources for the persistence provider, resolving data source names in persistence.xml against Spring-managed DataSource instances.
getDataSources() - Method in class org.springframework.jdbc.datasource.lookup.MapDataSourceLookup
Get the Map of DataSources maintained by this object.
getDataSourceToUse(DataSource) - Method in class org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
Return the DataSource to use for retrieving Connections.
getDataSourceToUse(DataSource) - Method in class org.springframework.orm.hibernate3.TransactionAwareDataSourceConnectionProvider
Return a TransactionAwareDataSourceProxy for the given DataSource, provided that it isn't a TransactionAwareDataSourceProxy already.
getDate() - Method in class org.springframework.http.HttpHeaders
Returns the date and time at which the message was created, as specified by the Date header.
getDate(int, Calendar) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getDate(int) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getDate(String, Calendar) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getDate(String) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getDate(int, Calendar) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as a Date object.
getDate(int) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as a Date object.
getDate(String, Calendar) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as a Date object.
getDate(String) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as a Date object.
getDateFormat(Locale) - Method in class org.springframework.format.datetime.DateFormatter
getDateHeader(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
getDeadline() - Method in class org.springframework.transaction.support.ResourceHolderSupport
Return the expiration deadline of this object.
getDeadlockLoserCodes() - Method in class org.springframework.jdbc.support.SQLErrorCodes
getDeclarationOrder() - Method in class org.springframework.aop.aspectj.AbstractAspectJAdvice
getDeclarationOrder() - Method in interface org.springframework.aop.aspectj.AspectJPrecedenceInformation
The declaration order of the advice member within the aspect.
getDeclaredParameters() - Method in class org.springframework.jdbc.object.RdbmsOperation
Return a list of the declared SqlParameter objects.
getDeclaringClass() - Method in class org.springframework.core.MethodParameter
Return the class that declares the underlying Method or Constructor.
getDeclaringClassName() - Method in interface org.springframework.core.type.MethodMetadata
Return the fully-qualified name of the class that declares this method.
getDeclaringClassName() - Method in class org.springframework.core.type.StandardMethodMetadata
getDecoratedDefinition() - Method in class org.springframework.beans.factory.support.RootBeanDefinition
getDecoratedNavigationHandler() - Method in class org.springframework.web.jsf.DecoratingNavigationHandler
Return the fixed original NavigationHandler decorated by this handler, if any (that is, if passed in through the constructor).
getDefaultAccessType() - Method in class org.springframework.orm.hibernate3.LocalRegionFactoryProxy
getDefaultBeanName(Object) - Method in class org.springframework.beans.factory.annotation.AnnotationBeanWiringInfoResolver
Determine the default bean name for the specified bean instance.
getDefaultClassLoader() - Static method in class org.springframework.util.ClassUtils
Return the default ClassLoader to use: typically the thread context ClassLoader, if available; the ClassLoader that loaded the ClassUtils class will be used as fallback.
getDefaultConfigLocations() - Method in class org.springframework.context.support.AbstractRefreshableConfigApplicationContext
Return the default config locations to use, for the case where no explicit config locations have been specified.
getDefaultConfigLocations() - Method in class org.springframework.web.context.support.XmlWebApplicationContext
The default location for the root context is "/WEB-INF/applicationContext.xml", and "/WEB-INF/test-servlet.xml" for a context with the namespace "test-servlet" (like for a DispatcherServlet instance with the servlet-name "test").
getDefaultConfigLocations() - Method in class org.springframework.web.portlet.context.XmlPortletApplicationContext
The default location for the root context is "/WEB-INF/applicationContext.xml", and "/WEB-INF/test-portlet.xml" for a context with the namespace "test-portlet" (like for a DispatcherPortlet instance with the portlet-name "test").
getDefaultContentType(T) - Method in class org.springframework.http.converter.AbstractHttpMessageConverter
Returns the default content type for the given type.
getDefaultContentType() - Method in class org.springframework.http.converter.BufferedImageHttpMessageConverter
Returns the default Content-Type to be used for writing.
getDefaultContextLoaderClassName(Class<?>) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
Get the name of the default ContextLoader class to use for the supplied test class.
getDefaultConverter(TypeDescriptor, TypeDescriptor) - Method in class org.springframework.core.convert.support.GenericConversionService
Return the default converter if no converter is found for the given sourceType/targetType pair.
getDefaultCurrencyTimeLimit() - Method in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Return default value for the JMX field "currencyTimeLimit", if any.
getDefaultDataSource() - Method in class org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager
Return the JDBC DataSource that the JPA persistence provider is supposed to use for accessing the database if none has been specified in persistence.xml.
getDefaultDestination() - Method in class org.springframework.jms.core.JmsTemplate
Return the destination to be used on send/receive operations that do not have a destination parameter.
getDefaultDestinationName() - Method in class org.springframework.jms.core.JmsTemplate
Return the destination name to be used on send/receive operations that do not have a destination parameter.
getDefaultEditor(Class) - Method in class org.springframework.beans.PropertyEditorRegistrySupport
Retrieve the default editor for the given property type, if any.
getDefaultEncoding() - Method in class org.springframework.mail.javamail.JavaMailSenderImpl
Return the default encoding for MimeMessages, or null if none.
getDefaultEncoding(MimeMessage) - Method in class org.springframework.mail.javamail.MimeMessageHelper
Determine the default encoding for the given MimeMessage.
getDefaultEncoding() - Method in class org.springframework.web.multipart.commons.CommonsFileUploadSupport
getDefaultEncoding() - Method in class org.springframework.web.util.UrlPathHelper
Return the default character encoding to use for URL decoding.
getDefaultErrorHandler(boolean) - Static method in class org.springframework.scheduling.support.TaskUtils
Return the default ErrorHandler implementation based on the boolean value indicating whether the task will be repeating or not.
getDefaultFileTypeMap() - Method in class org.springframework.mail.javamail.JavaMailSenderImpl
Return the default Java Activation FileTypeMap for MimeMessages, or null if none.
getDefaultFileTypeMap(MimeMessage) - Method in class org.springframework.mail.javamail.MimeMessageHelper
Determine the default Java Activation FileTypeMap for the given MimeMessage.
getDefaultHandler() - Method in class org.springframework.web.portlet.handler.AbstractHandlerMapping
Return the default handler for this handler mapping, or null if none.
getDefaultHandler() - Method in class org.springframework.web.servlet.handler.AbstractHandlerMapping
Return the default handler for this handler mapping, or null if none.
getDefaultHtmlEscape() - Method in class org.springframework.web.servlet.support.RequestContext
Return the default HTML escape setting, differentiating between no default specified and an explicit value.
getDefaultHtmlEscape(ServletContext) - Static method in class org.springframework.web.util.WebUtils
Return whether default HTML escaping is enabled for the web application, i.e.
getDefaultJdbcExceptionTranslator() - Method in class org.springframework.orm.hibernate3.HibernateAccessor
Obtain a default SQLExceptionTranslator, lazily creating it if necessary.
getDefaultJdbcExceptionTranslator() - Method in class org.springframework.orm.hibernate3.HibernateTransactionManager
Obtain a default SQLExceptionTranslator, lazily creating it if necessary.
getDefaultListableBeanFactory() - Method in class org.springframework.context.support.GenericApplicationContext
Return the underlying bean factory of this context, available for registering bean definitions.
getDefaultListenerMethod() - Method in class org.springframework.jms.listener.adapter.MessageListenerAdapter
Return the name of the default listener method to delegate to.
getDefaultLocale() - Method in class org.springframework.context.support.MessageSourceAccessor
Return the default locale to use if no explicit locale has been given.
getDefaultLocale() - Method in class org.springframework.web.servlet.i18n.AbstractLocaleResolver
Return the default Locale that this resolver is supposed to fall back to, if any.
getDefaultLocale() - Method in class org.springframework.web.servlet.i18n.CookieLocaleResolver
Return the fixed Locale that this resolver will return if no cookie found, if any.
getDefaultMessage() - Method in interface org.springframework.context.MessageSourceResolvable
Return the default message to be used to resolve this message.
getDefaultMessage(String) - Method in class org.springframework.context.support.AbstractMessageSource
Return a fallback default message for the given code, if any.
getDefaultMessage() - Method in class org.springframework.context.support.DefaultMessageSourceResolvable
getDefaultNamespace() - Method in class org.springframework.mock.web.portlet.MockPortletConfig
getDefaultParentBean() - Method in class org.springframework.beans.factory.support.PropertiesBeanDefinitionReader
Return the default parent bean for this bean factory.
getDefaultReleaseMode() - Method in class org.springframework.orm.hibernate3.SpringTransactionFactory
Sets connection release mode "on_close" as default.
getDefaults() - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Return the defaults definition object, or null if the defaults have been initialized yet.
getDefaultStrategies(ApplicationContext, Class<T>) - Method in class org.springframework.web.portlet.DispatcherPortlet
Create a List of default strategy objects for the given strategy interface.
getDefaultStrategies(ApplicationContext, Class<T>) - Method in class org.springframework.web.servlet.DispatcherServlet
Create a List of default strategy objects for the given strategy interface.
getDefaultStrategy(ApplicationContext, Class<T>) - Method in class org.springframework.web.portlet.DispatcherPortlet
Return the default strategy object for the given strategy interface.
getDefaultStrategy(ApplicationContext, Class<T>) - Method in class org.springframework.web.servlet.DispatcherServlet
Return the default strategy object for the given strategy interface.
getDefaultSubscriptionName(Object) - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Determine the default subscription name for the given message listener.
getDefaultTestExecutionListenerClasses() - Method in class org.springframework.test.context.TestContextManager
Determine the default TestExecutionListener classes.
getDefaultThemeName() - Method in class org.springframework.web.servlet.theme.AbstractThemeResolver
Return the name of the default theme.
getDefaultThemeName() - Method in class org.springframework.web.servlet.theme.CookieThemeResolver
Return the name of the default theme.
getDefaultThreadNamePrefix() - Method in class org.springframework.util.CustomizableThreadCreator
Build the default thread name prefix for this factory.
getDefaultTimeout() - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Return the default timeout that this transaction manager should apply if there is no timeout specified at the transaction level, in seconds.
getDefaultTypeConverter() - Method in class org.springframework.beans.factory.config.MethodInvokingFactoryBean
Obtain the TypeConverter from the BeanFactory that this bean runs in, if possible.
getDefaultTypeConverter() - Method in class org.springframework.beans.support.ArgumentConvertingMethodInvoker
Obtain the default TypeConverter for this method invoker.
getDefaultValue(Annotation) - Static method in class org.springframework.core.annotation.AnnotationUtils
Retrieve the default value of the "value" attribute of a single-element Annotation, given an annotation instance.
getDefaultValue(Annotation, String) - Static method in class org.springframework.core.annotation.AnnotationUtils
Retrieve the default value of a named Annotation attribute, given an annotation instance.
getDefaultValue(Class<? extends Annotation>) - Static method in class org.springframework.core.annotation.AnnotationUtils
Retrieve the default value of the "value" attribute of a single-element Annotation, given the annotation type.
getDefaultValue(Class<? extends Annotation>, String) - Static method in class org.springframework.core.annotation.AnnotationUtils
Retrieve the default value of a named Annotation attribute, given the annotation type.
getDefaultValue() - Method in class org.springframework.jmx.export.metadata.ManagedAttribute
Return the default value of this attribute.
getDefaultViewName(HttpServletRequest) - Method in class org.springframework.web.servlet.DispatcherServlet
Translate the supplied request into a default view name.
getDefaultWorkManager() - Method in class org.springframework.jca.work.glassfish.GlassFishWorkManagerTaskExecutor
Obtains GlassFish's default thread pool.
getDefaultWorkManager() - Method in class org.springframework.jca.work.jboss.JBossWorkManagerTaskExecutor
Obtains the default JBoss JCA WorkManager through a JMX lookup for the JBossWorkManagerMBean.
getDefaultWorkManager() - Method in class org.springframework.jca.work.WorkManagerTaskExecutor
Obtain a default WorkManager to delegate to.
getDefinitionDescription() - Method in class org.springframework.transaction.support.DefaultTransactionDefinition
Return an identifying description for this transaction definition.
getDelay() - Method in class org.springframework.scheduling.commonj.ScheduledTimerListener
Return the delay before starting the job for the first time.
getDelay() - Method in class org.springframework.scheduling.concurrent.ScheduledExecutorTask
Return the delay before starting the job for the first time.
getDelay() - Method in class org.springframework.scheduling.timer.ScheduledTimerTask
Deprecated. Return the delay before starting the job for the first time.
getDelegate() - Method in class org.springframework.beans.factory.xml.ParserContext
getDelegate() - Method in class org.springframework.jca.work.DelegatingWork
Return the wrapped Runnable implementation.
getDelegate() - Method in class org.springframework.jms.listener.adapter.MessageListenerAdapter
Return the target object to delegate message listening to.
getDelegate() - Method in class org.springframework.scheduling.commonj.DelegatingWork
Return the wrapped Runnable implementation.
getDelegate() - Method in class org.springframework.scheduling.quartz.DelegatingJob
Return the wrapped Runnable implementation.
getDelegate() - Method in class org.springframework.scheduling.timer.DelegatingTimerTask
Deprecated. Return the wrapped Runnable implementation.
getDelegate(FacesContext) - Method in class org.springframework.web.jsf.DelegatingNavigationHandlerProxy
Return the target NavigationHandler to delegate to.
getDelegateAction(ActionMapping) - Method in class org.springframework.web.struts.DelegatingActionProxy
Deprecated. Return the delegate Action for the given mapping.
getDelegateAction(ActionMapping) - Method in class org.springframework.web.struts.DelegatingRequestProcessor
Deprecated. Return the delegate Action for the given mapping.
getDelegateAction(ActionMapping) - Method in class org.springframework.web.struts.DelegatingTilesRequestProcessor
Deprecated. Return the delegate Action for the given mapping.
getDelegates() - Method in class org.springframework.dao.support.ChainedPersistenceExceptionTranslator
Return all registered PersistenceExceptionTranslator delegates (as array).
getDelegates() - Method in class org.springframework.jms.connection.ChainedExceptionListener
Return all registered ExceptionListener delegates (as array).
getDelegates(FacesContext) - Method in class org.springframework.web.jsf.DelegatingPhaseListenerMulticaster
Obtain the delegate PhaseListener beans from the Spring root WebApplicationContext.
getDelimiter() - Method in class org.springframework.web.servlet.tags.form.AbstractMultiCheckedElementTag
Return the delimiter to be used between each 'input type="radio"' tag.
getDelimiter() - Method in class org.springframework.web.servlet.tags.form.ErrorsTag
Return the delimiter to be used between error messages.
getDeliveryMode() - Method in class org.springframework.jms.core.JmsTemplate
Return the delivery mode to use when sending a message.
getDependenciesForBean(String) - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Return the names of all beans that the specified bean depends on, if any.
getDependenciesForBean(String) - Method in class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
Return the names of all beans that the specified bean depends on, if any.
getDependencyCheck() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Return the dependency check code.
getDependencyCheck() - Method in class org.springframework.beans.factory.support.BeanDefinitionDefaults
getDependencyCheck() - Method in class org.springframework.beans.factory.wiring.BeanWiringInfo
Return whether to perform a dependency check for object references in the bean instance (after autowiring).
getDependencyCheck(String) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
getDependencyCheck() - Method in class org.springframework.beans.factory.xml.DocumentDefaultsDefinition
Return the default dependency-check setting for the document that's currently parsed.
getDependencyCheck() - Method in class org.springframework.web.struts.AutowiringRequestProcessor
Deprecated. Return whether to apply a dependency check after wiring Struts Actions.
getDependencyCheck() - Method in class org.springframework.web.struts.AutowiringTilesRequestProcessor
Deprecated. Return whether to apply a dependency check after wiring Struts Actions.
getDependencyCheck(ActionServlet) - Static method in class org.springframework.web.struts.DelegatingActionUtils
Deprecated. Determine the dependency check to use from the "dependencyCheck" init-param of the Struts ActionServlet, falling back to no dependency check as default.
getDependencyDescriptor() - Method in class org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.LookupElement
Build a DependencyDescriptor for the underlying field/method.
getDependencyName() - Method in class org.springframework.beans.factory.config.DependencyDescriptor
Determine the name of the wrapped parameter/field.
getDependencyType() - Method in class org.springframework.beans.factory.config.DependencyDescriptor
Determine the declared (non-generic) type of the wrapped parameter/field.
getDependentBeans(String) - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Return the names of all beans which depend on the specified bean, if any.
getDependentBeans(String) - Method in class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
Return the names of all beans which depend on the specified bean, if any.
getDependsOn() - Method in interface org.springframework.beans.factory.config.BeanDefinition
Return the bean names that this bean depends on.
getDependsOn() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Return the bean names that this bean depends on.
getDepth(Throwable) - Method in class org.springframework.transaction.interceptor.RollbackRuleAttribute
Return the depth of the superclass matching.
getDepth(String, Exception) - Method in class org.springframework.web.portlet.handler.SimpleMappingExceptionResolver
Return the depth to the superclass matching.
getDepth(String, Exception) - Method in class org.springframework.web.servlet.handler.SimpleMappingExceptionResolver
Return the depth to the superclass matching.
getDerivedTemplate(ConnectionSpec) - Method in class org.springframework.jca.cci.core.CciTemplate
Create a template derived from this template instance, inheriting the ConnectionFactory and other settings but overriding the ConnectionSpec used for obtaining Connections.
getDescription() - Method in class org.springframework.aop.config.AdvisorComponentDefinition
getDescription() - Method in class org.springframework.aop.config.PointcutComponentDefinition
getDescription() - Method in interface org.springframework.beans.factory.config.BeanDefinition
Return a human-readable description of this bean definition.
getDescription() - Method in class org.springframework.beans.factory.parsing.AbstractComponentDefinition
Delegates to ComponentDefinition.getName().
getDescription() - Method in class org.springframework.beans.factory.parsing.BeanComponentDefinition
getDescription() - Method in interface org.springframework.beans.factory.parsing.ComponentDefinition
Return a friendly description of the described component.
getDescription() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
getDescription() - Method in class org.springframework.core.io.ByteArrayResource
This implementation returns the passed-in description, if any.
getDescription() - Method in class org.springframework.core.io.ClassPathResource
This implementation returns a description that includes the class path location.
getDescription() - Method in class org.springframework.core.io.DescriptiveResource
getDescription() - Method in class org.springframework.core.io.FileSystemResource
This implementation returns a description that includes the absolute path of the file.
getDescription() - Method in class org.springframework.core.io.InputStreamResource
This implementation returns the passed-in description, if any.
getDescription() - Method in interface org.springframework.core.io.Resource
Return a description for this resource, to be used for error output when working with the resource.
getDescription() - Method in class org.springframework.core.io.UrlResource
This implementation returns a description that includes the URL.
getDescription() - Method in class org.springframework.core.io.VfsResource
getDescription(Object, String) - Method in class org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler
Get the description of the MBean resource.
getDescription(Object, String) - Method in class org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler
Reads managed resource description from the source level metadata.
getDescription() - Method in class org.springframework.jmx.export.metadata.AbstractJmxAttribute
Return a description for this attribute.
getDescription() - Method in class org.springframework.jmx.export.metadata.ManagedNotification
Return a description for this notification.
getDescription() - Method in class org.springframework.jmx.export.metadata.ManagedOperationParameter
Return a description for this parameter.
getDescription() - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
Returns a description suitable for an ignored test class if the test is disabled via @IfProfileValue at the class-level, and otherwise delegates to the parent implementation.
getDescription(boolean) - Method in class org.springframework.web.context.request.FacesWebRequest
getDescription(boolean) - Method in class org.springframework.web.context.request.ServletWebRequest
getDescription(boolean) - Method in interface org.springframework.web.context.request.WebRequest
Get a short description of this request, typically containing request URI and session id.
getDescription() - Method in class org.springframework.web.context.support.RequestHandledEvent
Return a full description of this event, involving all available context data.
getDescription() - Method in class org.springframework.web.context.support.ServletContextResource
This implementation returns a description that includes the ServletContext resource location.
getDescription() - Method in class org.springframework.web.context.support.ServletRequestHandledEvent
getDescription() - Method in class org.springframework.web.portlet.context.PortletContextResource
getDescription() - Method in class org.springframework.web.portlet.context.PortletRequestHandledEvent
getDescription(boolean) - Method in class org.springframework.web.portlet.context.PortletWebRequest
getDescriptiveType(Object) - Static method in class org.springframework.util.ClassUtils
Return a descriptive name for the given object's type: usually simply the class name, but component type class name + "[]" for arrays, and an appended list of implemented interfaces for JDK proxies.
getDestination() - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Return the destination to receive messages from.
getDestinationDescription() - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Return a descriptive String for this container's JMS destination (never null).
getDestinationName() - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Return the name of the destination to receive messages from.
getDestinationName() - Method in class org.springframework.jms.listener.endpoint.JmsActivationSpecConfig
getDestinationResolver() - Method in class org.springframework.jms.listener.adapter.MessageListenerAdapter
Return the DestinationResolver for this adapter.
getDestinationResolver() - Method in class org.springframework.jms.support.destination.JmsDestinationAccessor
Return the DestinationResolver for this accessor (never null).
getDestroyMethod() - Method in class org.springframework.beans.factory.xml.DocumentDefaultsDefinition
Return the default destroy-method setting for the document that's currently parsed.
getDestroyMethodName() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Return the name of the destroy method.
getDestroyMethodName() - Method in class org.springframework.beans.factory.support.BeanDefinitionDefaults
getDir() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Get the value of the 'dir' attribute.
getDisabled() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
Get the value of the 'disabled' attribute.
getDisabled() - Method in class org.springframework.web.servlet.tags.form.OptionsTag
Get the value of the 'disabled' attribute.
getDisabled() - Method in class org.springframework.web.servlet.tags.form.OptionTag
Get the value of the 'disabled' attribute.
getDisabledTestCount() - Static method in class org.springframework.test.ConditionalTestCase
Deprecated. Return the number of tests disabled in this environment.
getDisabledTestCount() - Static method in class org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests
Return the number of tests disabled in this environment.
getDisallowedFields() - Method in class org.springframework.validation.DataBinder
Return the fields that should not be allowed for binding.
getDiscoveredReturningGenericType() - Method in class org.springframework.aop.aspectj.AbstractAspectJAdvice
getDiscoveredReturningType() - Method in class org.springframework.aop.aspectj.AbstractAspectJAdvice
getDiscoveredThrowingType() - Method in class org.springframework.aop.aspectj.AbstractAspectJAdvice
getDispatcherPath(ComponentDefinition, HttpServletRequest) - Method in class org.springframework.web.servlet.view.tiles.TilesView
Deprecated. Determine the dispatcher path for the given Tiles definition, i.e.
getDisplayName() - Method in interface org.springframework.context.ApplicationContext
Return a friendly name for this context.
getDisplayName() - Method in class org.springframework.context.support.AbstractApplicationContext
Return a friendly name for this context.
getDisplayName() - Method in class org.springframework.jmx.export.metadata.ManagedMetric
A display name for this metric.
getDisplayString(Object) - Static method in class org.springframework.util.ObjectUtils
Return a content-based String representation if obj is not null; otherwise returns an empty String.
getDisplayString(Object) - Method in class org.springframework.web.servlet.tags.form.AbstractFormTag
Get the display value of the supplied Object, HTML escaped as required.
getDisplayString(Object, PropertyEditor) - Method in class org.springframework.web.servlet.tags.form.AbstractFormTag
Get the display value of the supplied Object, HTML escaped as required.
getDisplayValue() - Method in class org.springframework.web.servlet.support.BindStatus
Return a suitable display value for the field, i.e.
getDouble(int) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getDouble(String) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getDouble(int) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as a Double object.
getDouble(String) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as a Double object.
getDoubleParameter(ServletRequest, String) - Static method in class org.springframework.web.bind.ServletRequestUtils
Get a Double parameter, or null if not present.
getDoubleParameter(ServletRequest, String, double) - Static method in class org.springframework.web.bind.ServletRequestUtils
Get a double parameter, with a fallback value.
getDoubleParameter(PortletRequest, String) - Static method in class org.springframework.web.portlet.bind.PortletRequestUtils
Get a Double parameter, or null if not present.
getDoubleParameter(PortletRequest, String, double) - Static method in class org.springframework.web.portlet.bind.PortletRequestUtils
Get a double parameter, with a fallback value.
getDoubleParameters(ServletRequest, String) - Static method in class org.springframework.web.bind.ServletRequestUtils
Get an array of double parameters, return an empty array if not found.
getDoubleParameters(PortletRequest, String) - Static method in class org.springframework.web.portlet.bind.PortletRequestUtils
Get an array of double parameters, return an empty array if not found.
getDriver() - Method in class org.springframework.jdbc.datasource.SimpleDriverDataSource
Return the JDBC Driver instance to use.
getDummyName() - Method in class org.springframework.jdbc.support.incrementer.DerbyMaxValueIncrementer
Return the name of the dummy column.
getDuplicateKeyCodes() - Method in class org.springframework.jdbc.support.SQLErrorCodes
getDurableSubscriptionName() - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Return the name of a durable subscription to create, if any.
getDurableSubscriptionName() - Method in class org.springframework.jms.listener.endpoint.JmsActivationSpecConfig
getDynamicAttributes() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Get the map of dynamic attributes.
getEarlyBeanReference(Object, String) - Method in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
getEarlyBeanReference(Object, String) - Method in class org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter
getEarlyBeanReference(Object, String) - Method in interface org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor
Obtain a reference for early access to the specified bean, typically for the purpose of resolving a circular reference.
getEarlyBeanReference(String, RootBeanDefinition, Object) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Obtain a reference for early access to the specified bean, typically for the purpose of resolving a circular reference.
getEarlySingletonInterfaces() - Method in class org.springframework.beans.factory.config.AbstractFactoryBean
Return an array of interfaces that a singleton object exposed by this FactoryBean is supposed to implement, for use with an 'early singleton proxy' that will be exposed in case of a circular reference.
getEditor() - Method in class org.springframework.web.servlet.support.BindStatus
Return the PropertyEditor for the property that this bind status is currently bound to.
getEditor() - Method in class org.springframework.web.servlet.tags.BindTag
getEditor() - Method in interface org.springframework.web.servlet.tags.EditorAwareTag
Retrieve the PropertyEditor for the property that this tag is currently bound to.
getEditor() - Method in class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
Exposes the PropertyEditor for EditorAwareTag.
getELContext() - Method in class org.springframework.mock.web.MockPageContext
getElement() - Method in class org.springframework.web.servlet.tags.form.AbstractMultiCheckedElementTag
Get the HTML element used to enclose 'input type="checkbox/radio"' tag.
getElement() - Method in class org.springframework.web.servlet.tags.form.ErrorsTag
Get the HTML element must be used to render the error messages.
getElementType() - Method in class org.springframework.core.convert.TypeDescriptor
If this type is an array type or Collection type, returns the underlying element type.
getElementTypeDescriptor() - Method in class org.springframework.core.convert.TypeDescriptor
Return the element type as a type descriptor.
getElementTypeName() - Method in class org.springframework.beans.factory.support.ManagedList
Return the default element type name (class name) to be used for this list.
getElementTypeName() - Method in class org.springframework.beans.factory.support.ManagedSet
Return the default element type name (class name) to be used for this set.
getEmptyValue(String, Class) - Method in class org.springframework.web.bind.WebDataBinder
Determine an empty value for the specified field.
getEnclosingClassName() - Method in interface org.springframework.core.type.ClassMetadata
Return the name of the enclosing class of the underlying class, or null if the underlying class is a top-level class.
getEnclosingClassName() - Method in class org.springframework.core.type.StandardClassMetadata
getEncoding() - Method in class org.springframework.core.io.support.EncodedResource
Return the encoding to use for reading from the resource, or null if none specified.
getEncoding() - Method in class org.springframework.mail.javamail.MimeMessageHelper
Return the specific character encoding used for this message, if any.
getEncoding() - Method in class org.springframework.web.servlet.view.freemarker.FreeMarkerView
Return the encoding for the FreeMarker template.
getEncoding() - Method in class org.springframework.web.servlet.view.velocity.VelocityView
Return the encoding for the Velocity template.
getEnctype() - Method in class org.springframework.web.servlet.tags.form.FormTag
Get the value of the 'enctype' attribute.
getEndpointAddress() - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Return the endpoint address to specify on the stub or call.
getEndpointAddress() - Method in class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
Return the endpoint address to specify on the stub.
getEndpointClassLoader() - Method in class org.springframework.jca.endpoint.AbstractMessageEndpointFactory.AbstractMessageEndpoint
Template method for exposing the endpoint's ClassLoader (typically the ClassLoader that the message listener class has been loaded with).
getEndPosition() - Method in class org.springframework.expression.spel.ast.SpelNodeImpl
getEndPosition() - Method in interface org.springframework.expression.spel.SpelNode
getEntityInterceptor() - Method in class org.springframework.orm.hibernate3.HibernateAccessor
Return the current Hibernate entity interceptor, or null if none.
getEntityInterceptor() - Method in class org.springframework.orm.hibernate3.HibernateTransactionManager
Return the current Hibernate entity interceptor, or null if none.
getEntityManager() - Method in class org.springframework.orm.jpa.EntityManagerHolder
getEntityManager() - Method in class org.springframework.orm.jpa.JpaAccessor
Return the JPA EntityManager to use.
getEntityManagerFactory() - Method in class org.springframework.orm.jpa.EntityManagerFactoryAccessor
Return the JPA EntityManagerFactory that should be used to create EntityManagers.
getEntityManagerFactory() - Method in class org.springframework.orm.jpa.JpaTransactionManager
Return the EntityManagerFactory that this instance should manage transactions for.
getEntityManagerFactoryBeanName() - Method in class org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter
Return the bean name of the EntityManagerFactory to fetch from Spring's root application context.
getEntityManagerFactoryInterface() - Method in interface org.springframework.orm.jpa.JpaVendorAdapter
Return the vendor-specific EntityManagerFactory interface that the EntityManagerFactory proxy is supposed to implement.
getEntityManagerFactoryInterface() - Method in class org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter
getEntityManagerFactoryInterface() - Method in class org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter
getEntityManagerFactoryInterface() - Method in class org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter
getEntityManagerFactoryPlusOperations(EntityManagerFactory) - Method in class org.springframework.orm.jpa.DefaultJpaDialect
getEntityManagerFactoryPlusOperations(EntityManagerFactory) - Method in interface org.springframework.orm.jpa.JpaDialect
Return an EntityManagerFactoryPlusOperations implementation for the given raw EntityManagerFactory.
getEntityManagerInterface() - Method in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
getEntityManagerInterface() - Method in interface org.springframework.orm.jpa.EntityManagerFactoryInfo
Return the (potentially vendor-specific) EntityManager interface that this factory's EntityManagers will implement.
getEntityManagerInterface() - Method in interface org.springframework.orm.jpa.JpaVendorAdapter
Return the vendor-specific EntityManager interface that this provider's EntityManagers will implement.
getEntityManagerInterface() - Method in class org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter
getEntityManagerInterface() - Method in class org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter
getEntityManagerInterface() - Method in class org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter
getEntityManagerInterface() - Method in class org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter
getEntityManagerInterface() - Method in class org.springframework.orm.jpa.vendor.TopLinkJpaVendorAdapter
getEntityManagerPlusOperations(EntityManager) - Method in class org.springframework.orm.jpa.DefaultJpaDialect
getEntityManagerPlusOperations(EntityManager) - Method in interface org.springframework.orm.jpa.JpaDialect
Return an EntityManagerPlusOperations implementation for the given raw EntityManager.
getEntityName(Object) - Method in class org.springframework.orm.hibernate3.support.ScopedBeanInterceptor
getEntityResolver() - Method in class org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Return the EntityResolver to use, building a default resolver if none specified.
getEnvironment() - Method in class org.springframework.jmx.access.MBeanClientInterceptor
Allow Map access to the environment to be set for the connector, with the option to add or override specific entries.
getEnvironment() - Method in class org.springframework.jmx.access.NotificationListenerRegistrar
Allow Map access to the environment to be set for the connector, with the option to add or override specific entries.
getEnvironment() - Method in class org.springframework.jndi.JndiTemplate
Return the environment for the JNDI InitialContext, if any.
getEnvironment() - Method in class org.springframework.mock.jndi.SimpleNamingContext
getErrorCode() - Method in exception org.springframework.beans.MethodInvocationException
getErrorCode() - Method in exception org.springframework.beans.TypeMismatchException
getErrorCode() - Method in interface org.springframework.core.ErrorCoded
Return the error code associated with this failure.
getErrorCode() - Method in exception org.springframework.jms.JmsException
Convenience method to get the vendor specific error code if the root cause was an instance of JMSException.
getErrorCode() - Method in class org.springframework.web.servlet.support.BindStatus
Return the first error codes for the field or object, if any.
getErrorCodes() - Method in class org.springframework.jdbc.support.CustomSQLErrorCodesTranslation
Return the SQL error codes to match.
getErrorCodes(String) - Method in class org.springframework.jdbc.support.SQLErrorCodesFactory
Return the SQLErrorCodes instance for the given database.
getErrorCodes(DataSource) - Method in class org.springframework.jdbc.support.SQLErrorCodesFactory
Return SQLErrorCodes for the given DataSource, evaluating "databaseProductName" from the DatabaseMetaData, or an empty error codes instance if no SQLErrorCodes were found.
getErrorCodes() - Method in class org.springframework.web.servlet.support.BindStatus
Return the error codes for the field or object, if any.
getErrorCount() - Method in class org.springframework.validation.AbstractBindingResult
getErrorCount() - Method in class org.springframework.validation.AbstractErrors
getErrorCount() - Method in exception org.springframework.validation.BindException
getErrorCount() - Method in interface org.springframework.validation.Errors
Return the total number of errors.
getErrorCount() - Method in class org.springframework.web.bind.EscapedErrors
getErrorHandler() - Method in class org.springframework.web.client.RestTemplate
Return the error handler.
getErrorMessage() - Method in class org.springframework.mock.web.MockHttpServletResponse
getErrorMessage() - Method in class org.springframework.web.servlet.support.BindStatus
Return the first error message for the field or object, if any.
getErrorMessages() - Method in class org.springframework.web.servlet.support.BindStatus
Return the resolved error messages for the field or object, if any.
getErrorMessagesAsString(String) - Method in class org.springframework.web.servlet.support.BindStatus
Return an error message string, concatenating all messages separated by the given delimiter.
getErrors() - Method in class org.springframework.validation.DataBinder
Deprecated. in favor of DataBinder.getBindingResult(). Use the BindException.BindException(BindingResult) constructor to create a BindException instance if still needed.
getErrors() - Method in class org.springframework.web.servlet.support.BindStatus
Return the Errors instance (typically a BindingResult) that this bind status is currently associated with.
getErrors(String) - Method in class org.springframework.web.servlet.support.RequestContext
Retrieve the Errors instance for the given bind object, using the "defaultHtmlEscape" setting.
getErrors(String, boolean) - Method in class org.springframework.web.servlet.support.RequestContext
Retrieve the Errors instance for the given bind object.
getErrors() - Method in class org.springframework.web.servlet.tags.BindErrorsTag
Retrieve the Errors instance that this tag is currently bound to.
getErrors() - Method in class org.springframework.web.servlet.tags.BindTag
Retrieve the Errors instance that this tag is currently bound to.
getErrorsForNewForm(RenderRequest) - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Create a BindException instance for a new form.
getErrorsForNewForm(HttpServletRequest) - Method in class org.springframework.web.servlet.mvc.AbstractFormController
Deprecated. Create a BindException instance for a new form.
getETag() - Method in class org.springframework.http.HttpHeaders
Returns the entity tag of the body, as specified by the ETag header.
getETag() - Method in class org.springframework.mock.web.portlet.MockCacheControl
getETag() - Method in class org.springframework.mock.web.portlet.MockRenderRequest
getETag() - Method in class org.springframework.mock.web.portlet.MockResourceRequest
getEvaluationContext() - Method in class org.springframework.expression.spel.ExpressionState
getEvaluationContext() - Method in class org.springframework.expression.spel.standard.SpelExpression
Return the default evaluation context that will be used if none is supplied on an evaluation call
getEvaluations() - Method in class org.springframework.aop.support.ControlFlowPointcut
It's useful to know how many times we've fired, for optimization.
getEvent() - Method in class org.springframework.mock.web.portlet.MockEventRequest
getEvent(QName) - Method in class org.springframework.mock.web.portlet.MockStateAwareResponse
getEvent(String) - Method in class org.springframework.mock.web.portlet.MockStateAwareResponse
getEventNames() - Method in class org.springframework.mock.web.portlet.MockStateAwareResponse
getException() - Method in class org.springframework.mock.web.MockPageContext
getException() - Method in class org.springframework.remoting.support.RemoteInvocationResult
Return the exception thrown by an unsuccessful invocation of the target method, if any.
getExceptionClass() - Method in class org.springframework.jdbc.support.CustomSQLErrorCodesTranslation
Return the exception class for the specified error codes.
getExceptionCount() - Method in exception org.springframework.beans.PropertyBatchUpdateException
If this returns 0, no errors were encountered during binding.
getExceptionHandler(Throwable) - Method in class org.springframework.web.servlet.mvc.multiaction.MultiActionController
Determine the exception handler method for the given exception.
getExceptionListener() - Method in class org.springframework.jms.connection.SingleConnectionFactory
Return the JMS ExceptionListener implementation that should be registered with with the single Connection created by this factory, if any.
getExceptionListener() - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Return the JMS ExceptionListener to notify in case of a JMSException thrown by the registered message listener or the invocation infrastructure, if any.
getExceptionName() - Method in class org.springframework.transaction.interceptor.RollbackRuleAttribute
Return the pattern for the exception name.
getExceptionTranslator() - Method in class org.springframework.jdbc.core.support.JdbcDaoSupport
Return the SQLExceptionTranslator of this DAO's JdbcTemplate, for translating SQLExceptions in custom JDBC access code.
getExceptionTranslator() - Method in class org.springframework.jdbc.support.JdbcAccessor
Return the exception translator for this instance.
getExcludedPatterns() - Method in class org.springframework.aop.support.AbstractRegexpMethodPointcut
Returns the regular expressions for exclusion matching.
getExecutionCount() - Method in class org.springframework.jdbc.object.BatchSqlUpdate
Return the number of already executed statements.
getExpectedCount() - Method in exception org.springframework.jdbc.IncorrectResultSetColumnCountException
Return the expected column count.
getExpectedException() - Method in class org.springframework.test.AssertThrows
Deprecated. Return the Exception expected to be thrown during the execution of the surrounding test.
getExpectedException(FrameworkMethod) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
Get the exception that the supplied test method is expected to throw.
getExpectedRowsAffected() - Method in exception org.springframework.jdbc.JdbcUpdateAffectedIncorrectNumberOfRowsException
Return the number of rows that should have been affected.
getExpectedSize() - Method in exception org.springframework.dao.IncorrectResultSizeDataAccessException
Return the expected result size.
getExpectedType() - Method in class org.springframework.jndi.JndiObjectLocator
Return the type that the located JNDI object is supposed to be assignable to, if any.
getExpirationTime() - Method in class org.springframework.mock.web.portlet.MockCacheControl
getExpires() - Method in class org.springframework.http.HttpHeaders
Returns the date and time at which the message is no longer valid, as specified by the Expires header.
getExporterName() - Method in class org.springframework.remoting.support.RemoteExporter
Return a short name for this exporter.
getExporterParameter(Object) - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
Return a JRExporterParameter for the given parameter object, converting it from a String if necessary.
getExporterParameters() - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
Return the exporter parameters that this view uses, if any.
getExpression() - Method in class org.springframework.aop.aspectj.AspectJExpressionPointcutAdvisor
getExpression() - Method in class org.springframework.aop.support.AbstractExpressionPointcut
Return this pointcut's expression.
getExpression() - Method in interface org.springframework.aop.support.ExpressionPointcut
Return the String expression for this pointcut.
getExpression() - Method in class org.springframework.web.servlet.support.BindStatus
Return a bind expression that can be used in HTML forms as input name for the respective field, or null if not field-specific.
getExpressionEvaluator() - Method in class org.springframework.mock.web.MockPageContext
getExpressionPrefix() - Method in class org.springframework.expression.common.TemplateParserContext
getExpressionPrefix() - Method in interface org.springframework.expression.ParserContext
For template expressions, returns the prefix that identifies the start of an expression block within a string.
getExpressions() - Method in class org.springframework.expression.common.CompositeStringExpression
getExpressionString() - Method in class org.springframework.expression.common.CompositeStringExpression
getExpressionString() - Method in class org.springframework.expression.common.LiteralExpression
getExpressionString() - Method in interface org.springframework.expression.Expression
Returns the original string used to create this expression, unmodified.
getExpressionString() - Method in exception org.springframework.expression.ExpressionException
getExpressionString() - Method in class org.springframework.expression.spel.standard.SpelExpression
getExpressionSuffix() - Method in class org.springframework.expression.common.TemplateParserContext
getExpressionSuffix() - Method in interface org.springframework.expression.ParserContext
For template expressions, return the prefix that identifies the end of an expression block within a string.
getExternalContext() - Method in class org.springframework.web.context.request.FacesRequestAttributes
Return the JSF ExternalContext that this adapter operates on.
getFacesContext() - Method in class org.springframework.web.context.request.FacesRequestAttributes
Return the JSF FacesContext that this adapter operates on.
getFactory() - Method in interface org.springframework.beans.factory.access.BeanFactoryReference
Return the BeanFactory instance held by this reference.
getFactory() - Method in class org.springframework.context.access.ContextBeanFactoryReference
getFactoryBean(String, Object) - Method in class org.springframework.beans.factory.support.FactoryBeanRegistrySupport
Get a FactoryBean for the given bean if possible.
getFactoryBeanName() - Method in interface org.springframework.beans.factory.config.BeanDefinition
Return the factory bean name, if any.
getFactoryBeanName() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
getFactoryMethodName() - Method in interface org.springframework.beans.factory.config.BeanDefinition
Return a factory method, if any.
getFactoryMethodName() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
getFailedMessages() - Method in exception org.springframework.mail.MailSendException
Return a Map with the failed messages as keys, and the thrown exceptions as values.
getFailureCause() - Method in class org.springframework.web.context.support.RequestHandledEvent
Return the cause of failure, if any.
getFailureMessage() - Method in class org.springframework.test.AssertThrows
Deprecated. Return the extra, contextual failure message that will be included in the failure text if the text fails.
getFallbackClassLoader() - Method in class org.springframework.core.ConfigurableObjectInputStream
Return the fallback ClassLoader to use when no ClassLoader was specified and ObjectInputStream's own default ClassLoader failed.
getFallbackClassLoader() - Method in class org.springframework.remoting.rmi.CodebaseAwareObjectInputStream
getFallbackLocale() - Method in class org.springframework.web.servlet.support.JspAwareRequestContext
This implementation checks for a JSTL locale attribute in page, request, session or application scope; if not found, returns the HttpServletRequest.getLocale().
getFallbackLocale() - Method in class org.springframework.web.servlet.support.RequestContext
Determine the fallback locale for this context.
getFallbackTheme() - Method in class org.springframework.web.servlet.support.RequestContext
Determine the fallback theme for this context.
getFallbackTranslator() - Method in class org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator
Return the fallback exception translator, if any.
getFault() - Method in exception org.springframework.remoting.jaxws.JaxWsSoapFaultException
Return the wrapped JAX-WS SOAPFault.
getFaultActor() - Method in exception org.springframework.remoting.jaxrpc.JaxRpcSoapFaultException
Deprecated.
getFaultActor() - Method in exception org.springframework.remoting.jaxws.JaxWsSoapFaultException
getFaultActor() - Method in exception org.springframework.remoting.soap.SoapFaultException
Return the actor that caused this fault.
getFaultCode() - Method in exception org.springframework.remoting.jaxrpc.JaxRpcSoapFaultException
Deprecated.
getFaultCode() - Method in exception org.springframework.remoting.jaxws.JaxWsSoapFaultException
getFaultCode() - Method in exception org.springframework.remoting.soap.SoapFaultException
Return the SOAP fault code.
getFaultCodeAsQName() - Method in exception org.springframework.remoting.jaxrpc.JaxRpcSoapFaultException
Deprecated.
getFaultCodeAsQName() - Method in exception org.springframework.remoting.jaxws.JaxWsSoapFaultException
getFaultCodeAsQName() - Method in exception org.springframework.remoting.soap.SoapFaultException
Return the SOAP fault code as a QName object.
getFaultString() - Method in exception org.springframework.remoting.jaxrpc.JaxRpcSoapFaultException
Deprecated.
getFaultString() - Method in exception org.springframework.remoting.jaxws.JaxWsSoapFaultException
getFaultString() - Method in exception org.springframework.remoting.soap.SoapFaultException
Return the descriptive SOAP fault string.
getFeatureDescriptors(ELContext, Object) - Method in class org.springframework.beans.factory.access.el.SpringBeanELResolver
getFeatureDescriptors(ELContext, Object) - Method in class org.springframework.web.jsf.el.WebApplicationContextFacesELResolver
getFetchSize() - Method in class org.springframework.jdbc.core.JdbcTemplate
Return the fetch size specified for this JdbcTemplate.
getFetchSize() - Method in class org.springframework.orm.hibernate3.HibernateTemplate
Return the fetch size specified for this HibernateTemplate.
getField() - Method in class org.springframework.beans.factory.config.DependencyDescriptor
Return the wrapped Field, if any.
getField() - Method in class org.springframework.core.convert.TypeDescriptor
Return the wrapped Field, if any.
getField(Object, String) - Static method in class org.springframework.test.util.ReflectionTestUtils
Get the field with the given name from the provided target object.
getField(Field, Object) - Static method in class org.springframework.util.ReflectionUtils
Get the field represented by the supplied field object on the specified target object.
getField() - Method in class org.springframework.validation.FieldError
Return the affected field of the object.
getFieldCache() - Method in class org.springframework.core.Constants
Exposes the field cache to subclasses: a Map from String field name to object value.
getFieldDefaultPrefix() - Method in class org.springframework.web.bind.WebDataBinder
Return the prefix for parameters that mark default fields.
getFieldError() - Method in class org.springframework.validation.AbstractBindingResult
getFieldError(String) - Method in class org.springframework.validation.AbstractBindingResult
getFieldError() - Method in class org.springframework.validation.AbstractErrors
getFieldError(String) - Method in class org.springframework.validation.AbstractErrors
getFieldError() - Method in exception org.springframework.validation.BindException
getFieldError(String) - Method in exception org.springframework.validation.BindException
getFieldError() - Method in interface org.springframework.validation.Errors
Get the first error associated with a field, if any.
getFieldError(String) - Method in interface org.springframework.validation.Errors
Get the first error associated with the given field, if any.
getFieldError() - Method in class org.springframework.web.bind.EscapedErrors
getFieldError(String) - Method in class org.springframework.web.bind.EscapedErrors
getFieldErrorCount() - Method in class org.springframework.validation.AbstractErrors
getFieldErrorCount(String) - Method in class org.springframework.validation.AbstractErrors
getFieldErrorCount() - Method in exception org.springframework.validation.BindException
getFieldErrorCount(String) - Method in exception org.springframework.validation.BindException
getFieldErrorCount() - Method in interface org.springframework.validation.Errors
Return the number of errors associated with a field.
getFieldErrorCount(String) - Method in interface org.springframework.validation.Errors
Return the number of errors associated with the given field.
getFieldErrorCount() - Method in class org.springframework.web.bind.EscapedErrors
getFieldErrorCount(String) - Method in class org.springframework.web.bind.EscapedErrors
getFieldErrors() - Method in class org.springframework.validation.AbstractBindingResult
getFieldErrors(String) - Method in class org.springframework.validation.AbstractBindingResult
getFieldErrors(String) - Method in class org.springframework.validation.AbstractErrors
getFieldErrors() - Method in exception org.springframework.validation.BindException
getFieldErrors(String) - Method in exception org.springframework.validation.BindException
getFieldErrors() - Method in interface org.springframework.validation.Errors
Get all errors associated with a field.
getFieldErrors(String) - Method in interface org.springframework.validation.Errors
Get all errors associated with the given field.
getFieldErrors() - Method in class org.springframework.web.bind.EscapedErrors
getFieldErrors(String) - Method in class org.springframework.web.bind.EscapedErrors
getFieldMarkerPrefix() - Method in class org.springframework.web.bind.WebDataBinder
Return the prefix for parameters that mark potentially empty fields.
getFieldType(String) - Method in class org.springframework.validation.AbstractBindingResult
This default implementation determines the type based on the actual field value, if any.
getFieldType(String) - Method in class org.springframework.validation.AbstractErrors
getFieldType(String) - Method in class org.springframework.validation.AbstractPropertyBindingResult
Determines the field type from the property type.
getFieldType(String) - Method in exception org.springframework.validation.BindException
getFieldType(String) - Method in interface org.springframework.validation.Errors
Return the type of a given field.
getFieldType(String) - Method in class org.springframework.web.bind.EscapedErrors
getFieldTypes() - Method in interface org.springframework.format.AnnotationFormatterFactory
The types of fields that may be annotated with the <A> annotation.
getFieldTypes() - Method in class org.springframework.format.datetime.joda.JodaDateTimeFormatAnnotationFormatterFactory
getFieldTypes() - Method in class org.springframework.format.number.NumberFormatAnnotationFormatterFactory
getFieldValue(String) - Method in class org.springframework.validation.AbstractBindingResult
getFieldValue(String) - Method in exception org.springframework.validation.BindException
getFieldValue(String) - Method in interface org.springframework.validation.Errors
Return the current value of the given field, either the current bean property value or a rejected update from the last binding.
getFieldValue(String) - Method in class org.springframework.web.bind.EscapedErrors
getFile() - Method in class org.springframework.core.io.AbstractFileResolvingResource
This implementation returns a File reference for the underlying class path resource, provided that it refers to a file in the file system.
getFile(URI) - Method in class org.springframework.core.io.AbstractFileResolvingResource
This implementation returns a File reference for the underlying class path resource, provided that it refers to a file in the file system.
getFile() - Method in class org.springframework.core.io.AbstractResource
This implementation throws a FileNotFoundException, assuming that the resource cannot be resolved to an absolute file path.
getFile() - Method in class org.springframework.core.io.FileSystemResource
This implementation returns the underlying File reference.
getFile() - Method in interface org.springframework.core.io.Resource
Return a File handle for this resource.
getFile() - Method in class org.springframework.core.io.UrlResource
This implementation returns a File reference for the underlying URL/URI, provided that it refers to a file in the file system.
getFile() - Method in class org.springframework.core.io.VfsResource
getFile(String) - Method in class org.springframework.mock.web.MockMultipartHttpServletRequest
getFile(String) - Method in class org.springframework.mock.web.portlet.MockMultipartActionRequest
getFile(String) - Static method in class org.springframework.util.ResourceUtils
Resolve the given resource location to a java.io.File, i.e.
getFile(URL) - Static method in class org.springframework.util.ResourceUtils
Resolve the given resource URL to a java.io.File, i.e.
getFile(URL, String) - Static method in class org.springframework.util.ResourceUtils
Resolve the given resource URL to a java.io.File, i.e.
getFile(URI) - Static method in class org.springframework.util.ResourceUtils
Resolve the given resource URI to a java.io.File, i.e.
getFile(URI, String) - Static method in class org.springframework.util.ResourceUtils
Resolve the given resource URI to a java.io.File, i.e.
getFile() - Method in class org.springframework.web.context.support.ServletContextResource
This implementation delegates to ServletContext.getRealPath, but throws a FileNotFoundException if not found or not resolvable.
getFile(String) - Method in interface org.springframework.web.multipart.MultipartRequest
Return the contents plus description of an uploaded file in this request, or null if it does not exist.
getFile(String) - Method in class org.springframework.web.multipart.support.AbstractMultipartHttpServletRequest
getFile() - Method in class org.springframework.web.portlet.context.PortletContextResource
This implementation delegates to PortletContext.getRealPath, but throws a FileNotFoundException if not found or not resolvable.
getFile(String) - Method in class org.springframework.web.portlet.multipart.DefaultMultipartActionRequest
getFileForLastModifiedCheck() - Method in class org.springframework.core.io.AbstractFileResolvingResource
This implementation determines the underlying File (or jar file, in case of a resource in a jar/zip).
getFileForLastModifiedCheck() - Method in class org.springframework.core.io.AbstractResource
Determine the File to use for timestamp checking.
getFileItem() - Method in class org.springframework.web.multipart.commons.CommonsMultipartFile
Return the underlying org.apache.commons.fileupload.FileItem instance.
getFileItemFactory() - Method in class org.springframework.web.multipart.commons.CommonsFileUploadSupport
Return the underlying org.apache.commons.fileupload.disk.DiskFileItemFactory instance.
getFileMap() - Method in class org.springframework.mock.web.MockMultipartHttpServletRequest
getFileMap() - Method in class org.springframework.mock.web.portlet.MockMultipartActionRequest
getFileMap() - Method in interface org.springframework.web.multipart.MultipartRequest
Return a Map of the multipart files contained in this request.
getFileMap() - Method in class org.springframework.web.multipart.support.AbstractMultipartHttpServletRequest
getFileMap() - Method in class org.springframework.web.portlet.multipart.DefaultMultipartActionRequest
getFilename() - Method in class org.springframework.core.io.AbstractResource
This implementation always throws IllegalStateException, assuming that the resource does not carry a filename.
getFilename() - Method in class org.springframework.core.io.ClassPathResource
This implementation returns the name of the file that this class path resource refers to.
getFilename() - Method in class org.springframework.core.io.FileSystemResource
This implementation returns the name of the file.
getFilename() - Method in interface org.springframework.core.io.Resource
Return a filename for this resource, i.e.
getFilename() - Method in class org.springframework.core.io.UrlResource
This implementation returns the name of the file that this URL refers to.
getFilename() - Method in class org.springframework.core.io.VfsResource
getFilename(Object) - Method in class org.springframework.http.converter.FormHttpMessageConverter
Returns the filename of the given multipart part.
getFilename(String) - Static method in class org.springframework.util.StringUtils
Extract the filename from the given path, e.g.
getFilename() - Method in class org.springframework.web.context.support.ServletContextResource
This implementation returns the name of the file that this ServletContext resource refers to.
getFilename() - Method in class org.springframework.web.portlet.context.PortletContextResource
getFilenameExtension(String) - Static method in class org.springframework.util.StringUtils
Extract the filename extension from the given path, e.g.
getFileNames() - Method in class org.springframework.mock.web.MockMultipartHttpServletRequest
getFileNames() - Method in class org.springframework.mock.web.portlet.MockMultipartActionRequest
getFileNames() - Method in interface org.springframework.web.multipart.MultipartRequest
Return an Iterator of String objects containing the parameter names of the multipart files contained in this request.
getFileNames() - Method in class org.springframework.web.multipart.support.AbstractMultipartHttpServletRequest
getFileNames() - Method in class org.springframework.web.portlet.multipart.DefaultMultipartActionRequest
getFiles(String) - Method in class org.springframework.mock.web.MockMultipartHttpServletRequest
getFiles(String) - Method in class org.springframework.mock.web.portlet.MockMultipartActionRequest
getFiles(String) - Method in interface org.springframework.web.multipart.MultipartRequest
Return the contents plus description of uploaded files in this request, or an empty list if it does not exist.
getFiles(String) - Method in class org.springframework.web.multipart.support.AbstractMultipartHttpServletRequest
getFiles(String) - Method in class org.springframework.web.portlet.multipart.DefaultMultipartActionRequest
getFileTimestamp() - Method in class org.springframework.context.support.ReloadableResourceBundleMessageSource.PropertiesHolder
getFileTimestamp(String) - Method in class org.springframework.web.servlet.ResourceServlet
Return the file timestamp for the given resource.
getFileTypeMap() - Method in class org.springframework.mail.javamail.ConfigurableMimeFileTypeMap
Return the delegate FileTypeMap, compiled from the mappings in the mapping file and the entries in the mappings property.
getFileTypeMap() - Method in class org.springframework.mail.javamail.MimeMessageHelper
Return the FileTypeMap used by this MimeMessageHelper.
getFileUpload() - Method in class org.springframework.web.multipart.commons.CommonsFileUploadSupport
Return the underlying org.apache.commons.fileupload.FileUpload instance.
getFilterConfig() - Method in class org.springframework.web.filter.GenericFilterBean
Make the FilterConfig of this filter available, if any.
getFilterName() - Method in class org.springframework.mock.web.MockFilterConfig
getFilterName() - Method in class org.springframework.web.filter.GenericFilterBean
Make the name of this filter available to subclasses.
getFilterNames() - Method in class org.springframework.orm.hibernate3.HibernateAccessor
Return the names of Hibernate filters to be activated, if any.
getFirst(String) - Method in class org.springframework.http.HttpHeaders
Return the first header value for the given header name, if any.
getFirst(K) - Method in class org.springframework.util.LinkedMultiValueMap
getFirst(K) - Method in interface org.springframework.util.MultiValueMap
Return the first value for the given key.
getFirstElementOnPage() - Method in class org.springframework.beans.support.PagedListHolder
Return the element index of the first element on the current page.
getFirstLinkedPage() - Method in class org.springframework.beans.support.PagedListHolder
Return the first page to which create a link around the current page.
getFirstNestedPropertySeparatorIndex(String) - Static method in class org.springframework.beans.PropertyAccessorUtils
Determine the first nested property separator in the given property path, ignoring dots in keys (like "map[my.key]").
getFloat(int) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getFloat(String) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getFloat(int) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as a float.
getFloat(String) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as a float.
getFloatParameter(ServletRequest, String) - Static method in class org.springframework.web.bind.ServletRequestUtils
Get a Float parameter, or null if not present.
getFloatParameter(ServletRequest, String, float) - Static method in class org.springframework.web.bind.ServletRequestUtils
Get a float parameter, with a fallback value.
getFloatParameter(PortletRequest, String) - Static method in class org.springframework.web.portlet.bind.PortletRequestUtils
Get a Float parameter, or null if not present.
getFloatParameter(PortletRequest, String, float) - Static method in class org.springframework.web.portlet.bind.PortletRequestUtils
Get a float parameter, with a fallback value.
getFloatParameters(ServletRequest, String) - Static method in class org.springframework.web.bind.ServletRequestUtils
Get an array of float parameters, return an empty array if not found.
getFloatParameters(PortletRequest, String) - Static method in class org.springframework.web.portlet.bind.PortletRequestUtils
Get an array of float parameters, return an empty array if not found.
getFlushMode() - Method in class org.springframework.orm.hibernate3.HibernateAccessor
Return if a flush should be forced after executing the callback code.
getFlushMode() - Method in class org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
Return the Hibernate FlushMode that this filter applies to its Session (in single session mode).
getFor() - Method in class org.springframework.web.servlet.tags.form.LabelTag
Get the value of the 'id' attribute.
getForEntity(String, Class<T>, Object...) - Method in interface org.springframework.web.client.RestOperations
Retrieve an entity by doing a GET on the specified URL.
getForEntity(String, Class<T>, Map<String, ?>) - Method in interface org.springframework.web.client.RestOperations
Retrieve a representation by doing a GET on the URI template.
getForEntity(URI, Class<T>) - Method in interface org.springframework.web.client.RestOperations
Retrieve a representation by doing a GET on the URL .
getForEntity(String, Class<T>, Object...) - Method in class org.springframework.web.client.RestTemplate
getForEntity(String, Class<T>, Map<String, ?>) - Method in class org.springframework.web.client.RestTemplate
getForEntity(URI, Class<T>) - Method in class org.springframework.web.client.RestTemplate
getFormatter(DateTimeFormatter) - Method in class org.springframework.format.datetime.joda.JodaTimeContext
Gets the Formatter with the this context's settings applied to the base formatter.
getFormatter(DateTimeFormatter, Locale) - Static method in class org.springframework.format.datetime.joda.JodaTimeContextHolder
Gets the Formatter with the user-specific settings applied to thefrom the base formatter.
getFormSessionAttributeName(PortletRequest) - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Return the name of the PortletSession attribute that holds the form object for this form controller.
getFormSessionAttributeName() - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Return the name of the PortletSession attribute that holds the form object for this form controller.
getFormSessionAttributeName(HttpServletRequest) - Method in class org.springframework.web.servlet.mvc.AbstractFormController
Deprecated. Return the name of the HttpSession attribute that holds the form object for this form controller.
getFormSessionAttributeName() - Method in class org.springframework.web.servlet.mvc.AbstractFormController
Deprecated. Return the name of the HttpSession attribute that holds the form object for this form controller.
getFormSubmitParameterName() - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Return the name of the render parameter that indicates this was a form submission.
getFormView() - Method in class org.springframework.web.portlet.mvc.SimpleFormController
Deprecated. Return the name of the view that should be used for form display.
getFormView() - Method in class org.springframework.web.servlet.mvc.SimpleFormController
Deprecated. Return the name of the view that should be used for form display.
getForObject(String, Class<T>, Object...) - Method in interface org.springframework.web.client.RestOperations
Retrieve a representation by doing a GET on the specified URL.
getForObject(String, Class<T>, Map<String, ?>) - Method in interface org.springframework.web.client.RestOperations
Retrieve a representation by doing a GET on the URI template.
getForObject(URI, Class<T>) - Method in interface org.springframework.web.client.RestOperations
Retrieve a representation by doing a GET on the URL .
getForObject(String, Class<T>, Object...) - Method in class org.springframework.web.client.RestTemplate
getForObject(String, Class<T>, Map<String, ?>) - Method in class org.springframework.web.client.RestTemplate
getForObject(URI, Class<T>) - Method in class org.springframework.web.client.RestTemplate
getForwardedUrl() - Method in class org.springframework.mock.web.MockHttpServletResponse
getForwardedUrl() - Method in class org.springframework.mock.web.portlet.MockMimeResponse
getFrom() - Method in class org.springframework.mail.SimpleMailMessage
getFunctionReturnName() - Method in class org.springframework.jdbc.core.metadata.CallMetaDataContext
Get the name used for the return value of the function.
getGeneratedKeyNames() - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Get the names of any generated keys
getGeneratedKeysColumnNames() - Method in class org.springframework.jdbc.object.RdbmsOperation
Return the column names of the auto generated keys.
getGenericArgumentValue(Class) - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues
Look for a generic argument value that matches the given type.
getGenericArgumentValue(Class, String) - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues
Look for a generic argument value that matches the given type.
getGenericArgumentValue(Class, String, Set<ConstructorArgumentValues.ValueHolder>) - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues
Look for the next generic argument value that matches the given type, ignoring argument values that have already been used in the current resolution process.
getGenericArgumentValues() - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues
Return the list of generic argument values.
getGenericDependencyType() - Method in class org.springframework.beans.factory.config.DependencyDescriptor
Determine the generic type of the wrapped parameter/field.
getGenericParameterType() - Method in class org.springframework.core.MethodParameter
Return the generic type of the method/constructor parameter.
getGlobalError() - Method in class org.springframework.validation.AbstractBindingResult
getGlobalError() - Method in class org.springframework.validation.AbstractErrors
getGlobalError() - Method in exception org.springframework.validation.BindException
getGlobalError() - Method in interface org.springframework.validation.Errors
Get the first global error, if any.
getGlobalError() - Method in class org.springframework.web.bind.EscapedErrors
getGlobalErrorCount() - Method in class org.springframework.validation.AbstractErrors
getGlobalErrorCount() - Method in exception org.springframework.validation.BindException
getGlobalErrorCount() - Method in interface org.springframework.validation.Errors
Return the number of global errors.
getGlobalErrorCount() - Method in class org.springframework.web.bind.EscapedErrors
getGlobalErrors() - Method in class org.springframework.validation.AbstractBindingResult
getGlobalErrors() - Method in exception org.springframework.validation.BindException
getGlobalErrors() - Method in interface org.springframework.validation.Errors
Get all global errors.
getGlobalErrors() - Method in class org.springframework.web.bind.EscapedErrors
getGroovyClassLoader() - Method in class org.springframework.scripting.groovy.GroovyScriptFactory
Return the GroovyClassLoader used by this script factory.
getHandback() - Method in class org.springframework.jmx.support.NotificationListenerHolder
Return the (arbitrary) object that will be 'handed back' as-is by an NotificationBroadcaster when notifying any NotificationListener.
getHandledExceptions(Method) - Method in class org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver
Returns all the exception classes handled by the given method.
getHandledExceptions(Method) - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver
Returns all the exception classes handled by the given method.
getHandler(PortletRequest, boolean) - Method in class org.springframework.web.portlet.DispatcherPortlet
Return the HandlerExecutionChain for this request.
getHandler(PortletRequest) - Method in class org.springframework.web.portlet.handler.AbstractHandlerMapping
Look up a handler for the given request, falling back to the default handler if no specific one is found.
getHandler() - Method in class org.springframework.web.portlet.HandlerExecutionChain
Return the handler object to execute.
getHandler(PortletRequest) - Method in interface org.springframework.web.portlet.HandlerMapping
Return a handler and any interceptors for this request.
getHandler(HttpServletRequest, boolean) - Method in class org.springframework.web.servlet.DispatcherServlet
Return the HandlerExecutionChain for this request.
getHandler(HttpServletRequest) - Method in class org.springframework.web.servlet.handler.AbstractHandlerMapping
Look up a handler for the given request, falling back to the default handler if no specific one is found.
getHandler() - Method in class org.springframework.web.servlet.HandlerExecutionChain
Return the handler object to execute.
getHandler(HttpServletRequest) - Method in interface org.springframework.web.servlet.HandlerMapping
Return a handler and any interceptors for this request.
getHandlerAdapter(Object) - Method in class org.springframework.web.portlet.DispatcherPortlet
Return the HandlerAdapter for this handler object.
getHandlerAdapter(Object) - Method in class org.springframework.web.servlet.DispatcherServlet
Return the HandlerAdapter for this handler object.
getHandlerExecutionChain(Object, PortletRequest) - Method in class org.springframework.web.portlet.handler.AbstractHandlerMapping
Build a HandlerExecutionChain for the given handler, including applicable interceptors.
getHandlerExecutionChain(Object, HttpServletRequest) - Method in class org.springframework.web.servlet.handler.AbstractHandlerMapping
Build a HandlerExecutionChain for the given handler, including applicable interceptors.
getHandlerInternal(PortletRequest) - Method in class org.springframework.web.portlet.handler.AbstractHandlerMapping
Look up a handler for the given request, returning null if no specific one is found.
getHandlerInternal(PortletRequest) - Method in class org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping
Determines a handler for the computed lookup key for the given request.
getHandlerInternal(HttpServletRequest) - Method in class org.springframework.web.servlet.handler.AbstractHandlerMapping
Look up a handler for the given request, returning null if no specific one is found.
getHandlerInternal(HttpServletRequest) - Method in class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
Look up a handler for the URL path of the given request.
getHandlerMap() - Method in class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
Return the registered handlers as an unmodifiable Map, with the registered path as key and the handler object (or handler bean name in case of a lazy-init handler) as value.
getHandlerMethodCount() - Method in class org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor
getHandlerMethodName(HttpServletRequest) - Method in class org.springframework.web.servlet.mvc.multiaction.AbstractUrlMethodNameResolver
Retrieves the URL path to use for lookup and delegates to getHandlerMethodNameForUrlPath.
getHandlerMethodName(HttpServletRequest) - Method in interface org.springframework.web.servlet.mvc.multiaction.MethodNameResolver
Return a method name that can handle this request.
getHandlerMethodName(HttpServletRequest) - Method in class org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver
getHandlerMethodNameForUrlPath(String) - Method in class org.springframework.web.servlet.mvc.multiaction.AbstractUrlMethodNameResolver
Return a method name that can handle this request, based on the given lookup path.
getHandlerMethodNameForUrlPath(String) - Method in class org.springframework.web.servlet.mvc.multiaction.InternalPathMethodNameResolver
Extracts the method name indicated by the URL path.
getHandlerMethodNameForUrlPath(String) - Method in class org.springframework.web.servlet.mvc.multiaction.PropertiesMethodNameResolver
getHandlerMethods() - Method in class org.springframework.web.bind.annotation.support.HandlerMethodResolver
getHeader(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
getHeader(String) - Method in class org.springframework.mock.web.MockHttpServletResponse
Return the primary value for the given header, if any.
getHeader(String) - Method in class org.springframework.web.context.request.FacesWebRequest
getHeader(String) - Method in class org.springframework.web.context.request.ServletWebRequest
getHeader(String) - Method in interface org.springframework.web.context.request.WebRequest
Return the request header of the given name, or null if none.
getHeader(String) - Method in class org.springframework.web.portlet.context.PortletWebRequest
getHeaderNames() - Method in class org.springframework.mock.web.MockHttpServletRequest
getHeaderNames() - Method in class org.springframework.mock.web.MockHttpServletResponse
Return the names of all specified headers as a Set of Strings.
getHeaderNames() - Method in class org.springframework.web.context.request.FacesWebRequest
getHeaderNames() - Method in class org.springframework.web.context.request.ServletWebRequest
getHeaderNames() - Method in interface org.springframework.web.context.request.WebRequest
Return a Iterator over request header names.
getHeaderNames() - Method in class org.springframework.web.portlet.context.PortletWebRequest
getHeaders() - Method in class org.springframework.http.client.AbstractClientHttpRequest
getHeaders() - Method in class org.springframework.http.HttpEntity
Returns the headers of this entity.
getHeaders() - Method in interface org.springframework.http.HttpMessage
Return the headers of this message.
getHeaders() - Method in class org.springframework.http.server.ServletServerHttpRequest
getHeaders() - Method in class org.springframework.http.server.ServletServerHttpResponse
getHeaders(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
getHeaders(String) - Method in class org.springframework.mock.web.MockHttpServletResponse
Return all values for the given header as a List of value objects.
getHeaderValues(String) - Method in class org.springframework.web.context.request.FacesWebRequest
getHeaderValues(String) - Method in class org.springframework.web.context.request.ServletWebRequest
getHeaderValues(String) - Method in interface org.springframework.web.context.request.WebRequest
Return the request header values for the given header name, or null if none.
getHeaderValues(String) - Method in class org.springframework.web.portlet.context.PortletWebRequest
getHibernateProperties() - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Return the Hibernate properties, if any.
getHibernateTemplate() - Method in class org.springframework.orm.hibernate3.support.HibernateDaoSupport
Return the HibernateTemplate for this DAO, pre-initialized with the SessionFactory or set explicitly.
getHitCount() - Method in class org.springframework.aop.target.ThreadLocalTargetSource
getHitCount() - Method in interface org.springframework.aop.target.ThreadLocalTargetSourceStats
Return the number of hits that were satisfied by a thread-bound object.
getHome() - Method in class org.springframework.ejb.access.AbstractSlsbInvokerInterceptor
Return the EJB home object to use.
getHost() - Method in class org.springframework.mail.javamail.JavaMailSenderImpl
Return the mail server host.
getHost() - Method in class org.springframework.remoting.rmi.RmiRegistryFactoryBean
Return the host of the registry for the exported RMI service.
getHttp11StatusCode(HttpServletRequest, HttpServletResponse, String) - Method in class org.springframework.web.servlet.view.RedirectView
Determines the status code to use for HTTP 1.1 compatible requests.
getHttpClient() - Method in class org.springframework.http.client.CommonsClientHttpRequestFactory
Return the HttpClient used by this factory.
getHttpClient() - Method in class org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor
Return the HttpClient instance that this request executor uses.
getHttpInvokerRequestExecutor() - Method in class org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor
Return the HttpInvokerRequestExecutor used by this remote accessor.
getId() - Method in class org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint
getId() - Method in interface org.springframework.context.ApplicationContext
Return the unique id of this application context.
getId() - Method in class org.springframework.context.support.AbstractApplicationContext
Return the unique id of this application context.
getId() - Method in class org.springframework.mock.web.MockHttpSession
getId() - Method in class org.springframework.mock.web.portlet.MockPortletSession
getId() - Method in class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
Get the value of the 'id' attribute.
getIdentifier() - Method in exception org.springframework.orm.ObjectOptimisticLockingFailureException
Return the identifier of the object for which the locking failed.
getIdentifier() - Method in exception org.springframework.orm.ObjectRetrievalFailureException
Return the identifier of the object that was not found.
getIdentityHexString(Object) - Static method in class org.springframework.util.ObjectUtils
Return a hex String form of an object's identity hash code.
getIdleCount() - Method in class org.springframework.aop.target.CommonsPoolTargetSource
getIdleCount() - Method in interface org.springframework.aop.target.PoolingConfig
Return the number of idle objects in the pool.
getIdleTaskExecutionLimit() - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Return the limit for idle executions of a receive task.
getIfNoneMatch() - Method in class org.springframework.http.HttpHeaders
Returns the value of the If-None-Match header.
getIfNotModifiedSince() - Method in class org.springframework.http.HttpHeaders
Returns the value of the IfModifiedSince header.
getImportedResource() - Method in class org.springframework.beans.factory.parsing.ImportDefinition
Return the location of the imported resource.
getImportPrefixes() - Method in class org.springframework.expression.spel.support.StandardTypeLocator
Return a list of all the import prefixes registered with this StandardTypeLocator.
getIncludedUrl() - Method in class org.springframework.mock.web.MockHttpServletResponse
getIncludedUrl() - Method in class org.springframework.mock.web.portlet.MockMimeResponse
getIncrementerName() - Method in class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
Return the name of the sequence/table.
getIndex() - Method in class org.springframework.jmx.export.metadata.ManagedOperationParameter
Return the index of this parameter in the operation signature.
getIndexedArgumentValue(int, Class) - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues
Get argument value for the given index in the constructor argument list.
getIndexedArgumentValue(int, Class, String) - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues
Get argument value for the given index in the constructor argument list.
getIndexedArgumentValues() - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues
Return the map of indexed argument values.
getInitBinderMethods() - Method in class org.springframework.web.bind.annotation.support.HandlerMethodResolver
getInitialPage(PortletRequest, Object) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Return the initial page of the wizard, i.e.
getInitialPage(PortletRequest) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Return the initial page of the wizard, i.e.
getInitialPage(HttpServletRequest, Object) - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Return the initial page of the wizard, that is, the page shown at wizard startup.
getInitialPage(HttpServletRequest) - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Return the initial page of the wizard, that is, the page shown at wizard startup.
getInitMethod() - Method in class org.springframework.beans.factory.xml.DocumentDefaultsDefinition
Return the default init-method setting for the document that's currently parsed.
getInitMethodName() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Return the name of the initializer method.
getInitMethodName() - Method in class org.springframework.beans.factory.support.BeanDefinitionDefaults
getInitParameter(String) - Method in class org.springframework.mock.web.MockFilterConfig
getInitParameter(String) - Method in class org.springframework.mock.web.MockServletConfig
getInitParameter(String) - Method in class org.springframework.mock.web.MockServletContext
getInitParameter(String) - Method in class org.springframework.mock.web.portlet.MockPortletConfig
getInitParameter(String) - Method in class org.springframework.mock.web.portlet.MockPortletContext
getInitParameter(String) - Method in class org.springframework.mock.web.portlet.ServletWrappingPortletContext
getInitParameterNames() - Method in class org.springframework.mock.web.MockFilterConfig
getInitParameterNames() - Method in class org.springframework.mock.web.MockServletConfig
getInitParameterNames() - Method in class org.springframework.mock.web.MockServletContext
getInitParameterNames() - Method in class org.springframework.mock.web.portlet.MockPortletConfig
getInitParameterNames() - Method in class org.springframework.mock.web.portlet.MockPortletContext
getInitParameterNames() - Method in class org.springframework.mock.web.portlet.ServletWrappingPortletContext
getInnerBeanDefinitions() - Method in class org.springframework.beans.factory.parsing.AbstractComponentDefinition
Returns an empty array.
getInnerBeanDefinitions() - Method in class org.springframework.beans.factory.parsing.BeanComponentDefinition
getInnerBeanDefinitions() - Method in interface org.springframework.beans.factory.parsing.ComponentDefinition
Return the BeanDefinitions that represent all relevant inner beans within this component.
getInParameterNames() - Method in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Get the names of in parameters to be used.
getInputStream() - Method in class org.springframework.core.io.ByteArrayResource
This implementation returns a ByteArrayInputStream for the underlying byte array.
getInputStream() - Method in class org.springframework.core.io.ClassPathResource
This implementation opens an InputStream for the given class path resource.
getInputStream() - Method in class org.springframework.core.io.DescriptiveResource
getInputStream() - Method in class org.springframework.core.io.FileSystemResource
This implementation opens a FileInputStream for the underlying file.
getInputStream() - Method in class org.springframework.core.io.InputStreamResource
This implementation throws IllegalStateException if attempting to read the underlying stream multiple times.
getInputStream() - Method in interface org.springframework.core.io.InputStreamSource
Return an InputStream.
getInputStream() - Method in class org.springframework.core.io.UrlResource
This implementation opens an InputStream for the given URL.
getInputStream() - Method in class org.springframework.core.io.VfsResource
getInputStream() - Method in class org.springframework.mock.web.MockHttpServletRequest
getInputStream() - Method in class org.springframework.mock.web.MockMultipartFile
getInputStream() - Method in class org.springframework.web.context.support.ServletContextResource
This implementation delegates to ServletContext.getResourceAsStream, but throws a FileNotFoundException if no resource found.
getInputStream() - Method in class org.springframework.web.multipart.commons.CommonsMultipartFile
getInputStream() - Method in interface org.springframework.web.multipart.MultipartFile
Return an InputStream to read the contents of the file from.
getInputStream() - Method in class org.springframework.web.portlet.context.PortletContextResource
This implementation delegates to PortletContext.getResourceAsStream, but throws a FileNotFoundException if not found.
getInputType() - Method in class org.springframework.web.servlet.tags.form.AbstractMultiCheckedElementTag
Return the type of the HTML input element to generate: "checkbox" or "radio".
getInputType() - Method in class org.springframework.web.servlet.tags.form.CheckboxesTag
getInputType() - Method in class org.springframework.web.servlet.tags.form.RadioButtonsTag
getInserts() - Method in exception org.springframework.expression.spel.SpelEvaluationException
getInserts() - Method in exception org.springframework.expression.spel.SpelParseException
getInsertString() - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Get the insert string to be used
getInsertTypes() - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Get the array of Types to be used for insert
getInstance() - Static method in class org.springframework.aop.framework.adapter.GlobalAdvisorAdapterRegistry
Return the singleton DefaultAdvisorAdapterRegistry instance.
getInstance() - Static method in class org.springframework.beans.factory.access.SingletonBeanFactoryLocator
Returns an instance which uses the default "classpath*:beanRefFactory.xml", as the name of the definition file(s).
getInstance(String) - Static method in class org.springframework.beans.factory.access.SingletonBeanFactoryLocator
Returns an instance which uses the the specified selector, as the name of the definition file(s).
getInstance() - Static method in class org.springframework.context.access.ContextSingletonBeanFactoryLocator
Returns an instance which uses the default "classpath*:beanRefContext.xml", as the name of the definition file(s).
getInstance(String) - Static method in class org.springframework.context.access.ContextSingletonBeanFactoryLocator
Returns an instance which uses the the specified selector, as the name of the definition file(s).
getInstance() - Static method in class org.springframework.context.access.DefaultLocatorFactory
Return an instance object implementing BeanFactoryLocator.
getInstance(String) - Static method in class org.springframework.context.access.DefaultLocatorFactory
Return an instance object implementing BeanFactoryLocator.
getInstance() - Static method in class org.springframework.jdbc.support.SQLErrorCodesFactory
Return the singleton instance.
getInstance(Object) - Static method in class org.springframework.jmx.support.ObjectNameManager
Retrieve the ObjectName instance corresponding to the supplied name.
getInstance(String) - Static method in class org.springframework.jmx.support.ObjectNameManager
Retrieve the ObjectName instance corresponding to the supplied name.
getInstance(String, String, String) - Static method in class org.springframework.jmx.support.ObjectNameManager
Retrieve an ObjectName instance for the specified domain and a single property with the supplied key and value.
getInstance(String, Hashtable<String, String>) - Static method in class org.springframework.jmx.support.ObjectNameManager
Retrieve an ObjectName instance with the specified domain name and the supplied key/name properties.
getInstance() - Static method in class org.springframework.test.annotation.SystemProfileValueSource
Obtain the canonical instance of this ProfileValueSource.
getInstance(Class<T>) - Method in class org.springframework.validation.beanvalidation.SpringConstraintValidatorFactory
getInstantiationStrategy() - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Return the instantiation strategy to use for creating bean instances.
getInstrumentableClassLoader() - Method in class org.springframework.context.weaving.DefaultContextLoadTimeWeaver
getInstrumentableClassLoader() - Method in class org.springframework.instrument.classloading.glassfish.GlassFishLoadTimeWeaver
getInstrumentableClassLoader() - Method in class org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver
We have the ability to weave the current class loader when starting the JVM in this way, so the instrumentable class loader will always be the current loader.
getInstrumentableClassLoader() - Method in class org.springframework.instrument.classloading.jboss.JBossLoadTimeWeaver
getInstrumentableClassLoader() - Method in interface org.springframework.instrument.classloading.LoadTimeWeaver
Return a ClassLoader that supports instrumentation through AspectJ-style load-time weaving based on user-defined ClassFileTransformers.
getInstrumentableClassLoader() - Method in class org.springframework.instrument.classloading.oc4j.OC4JLoadTimeWeaver
getInstrumentableClassLoader() - Method in class org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver
getInstrumentableClassLoader() - Method in class org.springframework.instrument.classloading.SimpleLoadTimeWeaver
getInstrumentableClassLoader() - Method in class org.springframework.instrument.classloading.weblogic.WebLogicLoadTimeWeaver
getInstrumentation() - Static method in class org.springframework.instrument.InstrumentationSavingAgent
Return the Instrumentation interface exposed by the JVM.
getInt(int) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getInt(String) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getInt(int) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as an int.
getInt(String) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as an int.
getInteractionSpec() - Method in class org.springframework.jca.cci.object.EisOperation
Return the CCI InteractionSpec for this operation.
getInterceptor(Advisor) - Method in interface org.springframework.aop.framework.adapter.AdvisorAdapter
Return an AOP Alliance MethodInterceptor exposing the behavior of the given advice to an interception-based AOP framework.
getInterceptor() - Method in class org.springframework.web.servlet.handler.MappedInterceptor
The actual Interceptor reference.
getInterceptorNameSuffix(BeanDefinition) - Method in class org.springframework.aop.config.AbstractInterceptorDrivenBeanDefinitionDecorator
getInterceptors(Advisor) - Method in interface org.springframework.aop.framework.adapter.AdvisorAdapterRegistry
Return an array of AOP Alliance MethodInterceptors to allow use of the given Advisor in an interception-based framework.
getInterceptors(Advisor) - Method in class org.springframework.aop.framework.adapter.DefaultAdvisorAdapterRegistry
getInterceptors() - Method in class org.springframework.web.portlet.HandlerExecutionChain
Return the array of interceptors to apply (in the given order).
getInterceptors() - Method in class org.springframework.web.servlet.HandlerExecutionChain
Return the array of interceptors to apply (in the given order).
getInterceptorsAndDynamicInterceptionAdvice(Method, Class) - Method in class org.springframework.aop.framework.AdvisedSupport
Determine a list of MethodInterceptor objects for the given method, based on this configuration.
getInterceptorsAndDynamicInterceptionAdvice(Advised, Method, Class) - Method in interface org.springframework.aop.framework.AdvisorChainFactory
Determine a list of MethodInterceptor objects for the given advisor chain configuration.
getInterceptorsAndDynamicInterceptionAdvice(Advised, Method, Class) - Method in class org.springframework.aop.framework.DefaultAdvisorChainFactory
getInterfaceNames() - Method in interface org.springframework.core.type.ClassMetadata
Return the name of all interfaces that the underlying class implements, or an empty array if there are none.
getInterfaceNames() - Method in class org.springframework.core.type.StandardClassMetadata
getInterfaces() - Method in class org.springframework.aop.aspectj.DeclareParentsAdvisor
getInterfaces() - Method in interface org.springframework.aop.IntroductionInfo
Return the additional interfaces introduced by this Advisor or Advice.
getInterfaces() - Method in class org.springframework.aop.support.DefaultIntroductionAdvisor
getInterfaces() - Method in class org.springframework.aop.support.IntroductionInfoSupport
getInternalBeanFactoryForBean(String) - Method in class org.springframework.aop.framework.autoproxy.target.AbstractBeanFactoryBasedTargetSourceCreator
Return the internal BeanFactory to be used for the specified bean.
getInternalBindingResult() - Method in class org.springframework.validation.DataBinder
Return the internal BindingResult held by this DataBinder, as AbstractPropertyBindingResult.
getInternalParentBeanFactory() - Method in class org.springframework.context.support.AbstractApplicationContext
Return the internal bean factory of the parent context if it implements ConfigurableApplicationContext; else, return the parent context itself.
getInternalParentMessageSource() - Method in class org.springframework.context.support.AbstractApplicationContext
Return the internal message source of the parent context if it is an AbstractApplicationContext too; else, return the parent context itself.
getIntHeader(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
getIntLiteral(String, int, int) - Static method in class org.springframework.expression.spel.ast.Literal
Process the string form of a number, using the specified base if supplied and return an appropriate literal to hold it.
getIntParameter(ServletRequest, String) - Static method in class org.springframework.web.bind.ServletRequestUtils
Get an Integer parameter, or null if not present.
getIntParameter(ServletRequest, String, int) - Static method in class org.springframework.web.bind.ServletRequestUtils
Get an int parameter, with a fallback value.
getIntParameter(PortletRequest, String) - Static method in class org.springframework.web.portlet.bind.PortletRequestUtils
Get an Integer parameter, or null if not present.
getIntParameter(PortletRequest, String, int) - Static method in class org.springframework.web.portlet.bind.PortletRequestUtils
Get an int parameter, with a fallback value.
getIntParameters(ServletRequest, String) - Static method in class org.springframework.web.bind.ServletRequestUtils
Get an array of int parameters, return an empty array if not found.
getIntParameters(PortletRequest, String) - Static method in class org.springframework.web.portlet.bind.PortletRequestUtils
Get an array of int parameters, return an empty array if not found.
getIntrospectedClass() - Method in class org.springframework.core.type.StandardClassMetadata
Return the underlying Class.
getIntrospectedMethod() - Method in class org.springframework.core.type.StandardMethodMetadata
Return the underlying Method.
getInvalidResultSetAccessCodes() - Method in class org.springframework.jdbc.support.SQLErrorCodes
getInvalidSubmitParameterName() - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Return the name of the render parameter that indicates this was an invalid form submission.
getInvocationCount() - Method in class org.springframework.aop.target.ThreadLocalTargetSource
getInvocationCount() - Method in interface org.springframework.aop.target.ThreadLocalTargetSourceStats
Return the number of client invocations.
getInvocationDescription(MethodInvocation) - Method in class org.springframework.aop.interceptor.DebugInterceptor
getInvocationDescription(MethodInvocation) - Method in class org.springframework.aop.interceptor.SimpleTraceInterceptor
Return a description for the given method invocation.
getInvocationFailureMessage() - Method in class org.springframework.scheduling.support.MethodInvokingRunnable
Build a message for an invocation failure exception.
getIsolationLevel() - Method in class org.springframework.jdbc.datasource.IsolationLevelDataSourceAdapter
Return the statically specified isolation level, or null if none.
getIsolationLevel() - Method in class org.springframework.transaction.support.DefaultTransactionDefinition
getIsolationLevel() - Method in class org.springframework.transaction.support.DelegatingTransactionDefinition
getIsolationLevel() - Method in interface org.springframework.transaction.TransactionDefinition
Return the isolation level.
getItemLabel() - Method in class org.springframework.web.servlet.tags.form.AbstractMultiCheckedElementTag
Get the value to be displayed as part of the 'input type="checkbox/radio"' tag.
getItemLabel() - Method in class org.springframework.web.servlet.tags.form.OptionsTag
Get the name of the property mapped to the label (inner text) of the 'option' tag.
getItemLabel() - Method in class org.springframework.web.servlet.tags.form.SelectTag
Get the value of the 'itemLabel' attribute.
getItems() - Method in class org.springframework.web.servlet.tags.form.AbstractMultiCheckedElementTag
Get the Collection, Map or array of objects used to generate the 'input type="checkbox/radio"' tags.
getItems() - Method in class org.springframework.web.servlet.tags.form.OptionsTag
Get the Collection, Map or array of objects used to generate the inner 'option' tags.
getItems() - Method in class org.springframework.web.servlet.tags.form.SelectTag
Get the value of the 'items' attribute.
getItemValue() - Method in class org.springframework.web.servlet.tags.form.AbstractMultiCheckedElementTag
Get the name of the property mapped to the 'value' attribute of the 'input type="checkbox/radio"' tag.
getItemValue() - Method in class org.springframework.web.servlet.tags.form.OptionsTag
Return the name of the property mapped to the 'value' attribute of the 'option' tag.
getItemValue() - Method in class org.springframework.web.servlet.tags.form.SelectTag
Get the value of the 'itemValue' attribute.
getJarFile(String) - Method in class org.springframework.core.io.support.PathMatchingResourcePatternResolver
Resolve the given jar file URL into a JarFile object.
getJarFileUrls() - Method in class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo
getJavaMailProperties() - Method in class org.springframework.mail.javamail.JavaMailSenderImpl
Allow Map access to the JavaMail properties of this sender, with the option to add or override specific entries.
getJavaType(Class<?>) - Method in class org.springframework.http.converter.json.MappingJacksonHttpMessageConverter
Returns the Jackson JavaType for the specific class.
getJavaVersion() - Static method in class org.springframework.core.JdkVersion
Return the full Java version string, as returned by System.getProperty("java.version").
getJaxbContext(Class) - Method in class org.springframework.http.converter.xml.AbstractJaxb2HttpMessageConverter
Returns a JAXBContext for the given class.
getJaxbContext() - Method in class org.springframework.oxm.jaxb.Jaxb2Marshaller
getJaxRpcService() - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Return a reference to an existing JAX-RPC Service instance, if any.
getJaxRpcServiceInterface() - Method in class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
Deprecated. Return the JAX-RPC service interface to use for looking up the service.
getJaxRpcServiceProperties() - Method in class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
Deprecated. Return JAX-RPC service properties to be passed to the ServiceFactory, if any.
getJaxWsService() - Method in class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
Return a reference to an existing JAX-WS Service instance, if any.
getJdbcConnection(PersistenceManager, boolean) - Method in class org.springframework.orm.jdo.DefaultJdoDialect
This implementation returns a DataStoreConnectionHandle for JDO2, which will also work on JDO1 until actually accessing the JDBC Connection.
getJdbcConnection(PersistenceManager, boolean) - Method in interface org.springframework.orm.jdo.JdoDialect
Retrieve the JDBC Connection that the given JDO PersistenceManager uses underneath, if accessing a relational database.
getJdbcConnection(EntityManager, boolean) - Method in class org.springframework.orm.jpa.DefaultJpaDialect
This implementation always returns null, indicating that no JDBC Connection can be provided.
getJdbcConnection(EntityManager, boolean) - Method in interface org.springframework.orm.jpa.JpaDialect
Retrieve the JDBC Connection that the given JPA EntityManager uses underneath, if accessing a relational database.
getJdbcConnection(EntityManager, boolean) - Method in class org.springframework.orm.jpa.vendor.EclipseLinkJpaDialect
getJdbcConnection(EntityManager, boolean) - Method in class org.springframework.orm.jpa.vendor.HibernateJpaDialect
getJdbcConnection(EntityManager, boolean) - Method in class org.springframework.orm.jpa.vendor.OpenJpaDialect
getJdbcConnection(EntityManager, boolean) - Method in class org.springframework.orm.jpa.vendor.TopLinkJpaDialect
getJdbcDataSource() - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
Return the javax.sql.DataSource that this view uses, if any.
getJdbcExceptionTranslator() - Method in class org.springframework.orm.hibernate3.HibernateAccessor
Return the JDBC exception translator for this instance, if any.
getJdbcExceptionTranslator() - Method in class org.springframework.orm.hibernate3.HibernateTransactionManager
Return the JDBC exception translator for this transaction manager, if any.
getJdbcExceptionTranslator() - Method in class org.springframework.orm.jdo.DefaultJdoDialect
Return the JDBC exception translator for this dialect, if any.
getJdbcOperations() - Method in interface org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
Expose the classic Spring JdbcTemplate to allow invocation of classic JDBC operations.
getJdbcOperations() - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
Expose the classic Spring JdbcTemplate to allow invocation of less commonly used methods.
getJdbcOperations() - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Expose the classic Spring JdbcTemplate to allow invocation of less commonly used methods.
getJdbcOperations() - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
Expose the classic Spring JdbcTemplate to allow invocation of less commonly used methods.
getJdbcTemplate() - Method in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Get the configured JdbcTemplate
getJdbcTemplate() - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Get the JdbcTemplate that is configured to be used
getJdbcTemplate() - Method in class org.springframework.jdbc.core.support.JdbcDaoSupport
Return the JdbcTemplate for this DAO, pre-initialized with the DataSource or set explicitly.
getJdbcTemplate() - Method in class org.springframework.jdbc.object.RdbmsOperation
Return the JdbcTemplate object used by this object.
getJdbcTemplate() - Method in class org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
Deprecated. Return the JdbcTemplate that this base class manages.
getJdoDialect() - Method in class org.springframework.orm.jdo.JdoAccessor
Return the JDO dialect to use for this accessor.
getJdoDialect() - Method in class org.springframework.orm.jdo.JdoTransactionManager
Return the JDO dialect to use for this transaction manager.
getJdoPropertyMap() - Method in class org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean
Allow Map access to the JDO properties to be passed to the JDOHelper, with the option to add or override specific entries.
getJdoTemplate() - Method in class org.springframework.orm.jdo.support.JdoDaoSupport
Return the JdoTemplate for this DAO, pre-initialized with the PersistenceManagerFactory or set explicitly.
getJmsTemplate() - Method in class org.springframework.jms.core.support.JmsGatewaySupport
Return the JmsTemplate for the gateway.
getJndiEnvironment() - Method in class org.springframework.jndi.JndiAccessor
Return the JNDI environment to use for JNDI lookups.
getJndiEnvironment() - Method in class org.springframework.transaction.jta.JtaTransactionManager
Return the JNDI environment to use for JNDI lookups.
getJndiName() - Method in class org.springframework.jndi.JndiObjectLocator
Return the JNDI name to look up.
getJndiTemplate() - Method in class org.springframework.jndi.JndiAccessor
Return the JNDI template to use for JNDI lookups.
getJndiTemplate() - Method in class org.springframework.transaction.jta.JtaTransactionManager
Return the JndiTemplate used for JNDI lookups.
getJobClass() - Method in class org.springframework.scheduling.quartz.JobDetailBean
Overridden to support any job class, to allow a custom JobFactory to adapt the given job class to the Quartz Job interface.
getJobDetail() - Method in class org.springframework.scheduling.quartz.CronTriggerBean
getJobDetail() - Method in interface org.springframework.scheduling.quartz.JobDetailAwareTrigger
Return the JobDetail that this Trigger is associated with.
getJobDetail() - Method in class org.springframework.scheduling.quartz.SimpleTriggerBean
getJodaTimeContext() - Static method in class org.springframework.format.datetime.joda.JodaTimeContextHolder
Return the JodaTimeContext associated with the current thread, if any.
getJoinPoint() - Method in class org.springframework.aop.aspectj.AbstractAspectJAdvice
Overridden in around advice to return proceeding join point.
getJoinpointIdentification() - Method in class org.springframework.transaction.interceptor.TransactionAspectSupport.TransactionInfo
Return a String representation of this joinpoint (usually a Method call) for use in logging.
getJoinPointMatch() - Method in class org.springframework.aop.aspectj.AbstractAspectJAdvice
Get the current join point match at the join point we are being dispatched on.
getJoinPointMatch(ProxyMethodInvocation) - Method in class org.springframework.aop.aspectj.AbstractAspectJAdvice
getJpaDialect() - Method in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
getJpaDialect() - Method in interface org.springframework.orm.jpa.EntityManagerFactoryInfo
Return the vendor-specific JpaDialect implementation for this EntityManagerFactory, or null if not known.
getJpaDialect() - Method in class org.springframework.orm.jpa.JpaAccessor
Return the JPA dialect to use for this accessor.
getJpaDialect() - Method in class org.springframework.orm.jpa.JpaTransactionManager
Return the JPA dialect to use for this transaction manager.
getJpaDialect() - Method in interface org.springframework.orm.jpa.JpaVendorAdapter
Return the vendor-specific JpaDialect implementation for this provider, or null if there is none.
getJpaDialect() - Method in class org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter
getJpaDialect() - Method in class org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter
getJpaDialect() - Method in class org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter
getJpaDialect() - Method in class org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter
getJpaDialect() - Method in class org.springframework.orm.jpa.vendor.TopLinkJpaVendorAdapter
getJpaPropertyMap() - Method in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
Allow Map access to the JPA properties to be passed to the persistence provider, with the option to add or override specific entries.
getJpaPropertyMap() - Method in class org.springframework.orm.jpa.EntityManagerFactoryAccessor
Allow Map access to the JPA properties to be passed to the persistence provider, with the option to add or override specific entries.
getJpaPropertyMap() - Method in class org.springframework.orm.jpa.JpaTransactionManager
Allow Map access to the JPA properties to be passed to the persistence provider, with the option to add or override specific entries.
getJpaPropertyMap() - Method in interface org.springframework.orm.jpa.JpaVendorAdapter
Return a Map of vendor-specific JPA properties, typically based on settings in this JpaVendorAdapter instance.
getJpaPropertyMap() - Method in class org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter
getJpaPropertyMap() - Method in class org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter
getJpaPropertyMap() - Method in class org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter
getJpaPropertyMap() - Method in class org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter
getJpaPropertyMap() - Method in class org.springframework.orm.jpa.vendor.TopLinkJpaVendorAdapter
getJpaTemplate() - Method in class org.springframework.orm.jpa.support.JpaDaoSupport
Return the JpaTemplate for this DAO, pre-initialized with the EntityManagerFactory or set explicitly.
getJpaVendorAdapter() - Method in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
Return the JpaVendorAdapter implementation for this EntityManagerFactory, or null if not known.
getJstlAwareMessageSource(ServletContext, MessageSource) - Static method in class org.springframework.web.servlet.support.JstlUtils
Checks JSTL's "javax.servlet.jsp.jstl.fmt.localizationContext" context-param and creates a corresponding child message source, with the provided Spring-defined MessageSource as parent.
getJtaDataSource() - Method in class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo
getJtaTransactionManager(SessionFactory, Session) - Static method in class org.springframework.orm.hibernate3.SessionFactoryUtils
Try to retrieve the JTA TransactionManager from the given SessionFactory and/or Session.
getJUnitTimeout(FrameworkMethod) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
Retrieves the configured JUnit timeout from the @Test annotation on the supplied test method.
getKeepAliveSeconds() - Method in class org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor
Return the ThreadPoolExecutor's keep-alive seconds.
getKeepAliveSeconds() - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
Return the ThreadPoolExecutor's keep-alive seconds.
getKey() - Method in class org.springframework.jdbc.support.GeneratedKeyHolder
getKey() - Method in interface org.springframework.jdbc.support.KeyHolder
Retrieve the first item from the first map, assuming that there is just one item and just one map, and that the item is a number.
getKeyList() - Method in class org.springframework.jdbc.support.GeneratedKeyHolder
getKeyList() - Method in interface org.springframework.jdbc.support.KeyHolder
Return a reference to the List that contains the keys.
getKeys() - Method in class org.springframework.context.support.MessageSourceResourceBundle
This implementation returns null, as a MessageSource does not allow for enumerating the defined message codes.
getKeys() - Method in class org.springframework.jdbc.support.GeneratedKeyHolder
getKeys() - Method in interface org.springframework.jdbc.support.KeyHolder
Retrieve the first map of keys.
getKeyTypeName() - Method in class org.springframework.beans.factory.support.ManagedMap
Return the default key type name (class name) to be used for this map.
getKind() - Method in class org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint
getLabel() - Method in class org.springframework.core.enums.AbstractGenericLabeledEnum
Deprecated.
getLabel() - Method in interface org.springframework.core.enums.LabeledEnum
Deprecated. Return a descriptive, optional label.
getLabel() - Method in class org.springframework.core.enums.StaticLabeledEnum
Deprecated.
getLabel() - Method in class org.springframework.web.servlet.tags.form.AbstractSingleCheckedElementTag
Get the value of the 'label' attribute.
getLabel() - Method in class org.springframework.web.servlet.tags.form.OptionTag
Get the text body of the rendered HTML <option> tag.
getLabeledEnumByCode(Class, Comparable) - Method in class org.springframework.core.enums.AbstractCachingLabeledEnumResolver
Deprecated.
getLabeledEnumByCode(Class, Comparable) - Method in interface org.springframework.core.enums.LabeledEnumResolver
Deprecated. Resolve a single LabeledEnum by its identifying code.
getLabeledEnumByLabel(Class, String) - Method in class org.springframework.core.enums.AbstractCachingLabeledEnumResolver
Deprecated.
getLabeledEnumByLabel(Class, String) - Method in interface org.springframework.core.enums.LabeledEnumResolver
Deprecated. Resolve a single LabeledEnum by its identifying code.
getLabeledEnumMap(Class) - Method in class org.springframework.core.enums.AbstractCachingLabeledEnumResolver
Deprecated.
getLabeledEnumMap(Class) - Method in interface org.springframework.core.enums.LabeledEnumResolver
Deprecated. Return a map of enumerations of a particular type.
getLabeledEnumSet(Class) - Method in class org.springframework.core.enums.AbstractCachingLabeledEnumResolver
Deprecated.
getLabeledEnumSet(Class) - Method in interface org.springframework.core.enums.LabeledEnumResolver
Deprecated. Return a set of enumerations of a particular type.
getLang() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Get the value of the 'lang' attribute.
getLastAccessedTime() - Method in class org.springframework.mock.web.MockHttpSession
getLastAccessedTime() - Method in class org.springframework.mock.web.portlet.MockPortletSession
getLastElementOnPage() - Method in class org.springframework.beans.support.PagedListHolder
Return the element index of the last element on the current page.
getLastLinkedPage() - Method in class org.springframework.beans.support.PagedListHolder
Return the last page to which create a link around the current page.
getLastModified() - Method in class org.springframework.http.HttpHeaders
Returns the time the resource was last changed, as specified by the Last-Modified header.
getLastModified(Object) - Method in class org.springframework.ui.freemarker.SpringTemplateLoader
getLastModified(Resource) - Method in class org.springframework.ui.velocity.SpringResourceLoader
getLastModified(HttpServletRequest) - Method in class org.springframework.web.servlet.DispatcherServlet
Override HttpServlet's getLastModified method to evaluate the Last-Modified value of the mapped handler.
getLastModified(HttpServletRequest, Object) - Method in class org.springframework.web.servlet.handler.SimpleServletHandlerAdapter
getLastModified(HttpServletRequest, Object) - Method in interface org.springframework.web.servlet.HandlerAdapter
Same contract as for HttpServlet's getLastModified method.
getLastModified(HttpServletRequest, Object) - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
getLastModified(HttpServletRequest, Object) - Method in class org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter
getLastModified(HttpServletRequest) - Method in interface org.springframework.web.servlet.mvc.LastModified
Same contract as for HttpServlet's getLastModified method.
getLastModified(HttpServletRequest) - Method in class org.springframework.web.servlet.mvc.multiaction.MultiActionController
Try to find an XXXXLastModified method, where XXXX is the name of a handler.
getLastModified(HttpServletRequest, Object) - Method in class org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter
getLastModified(HttpServletRequest) - Method in class org.springframework.web.servlet.ResourceServlet
Return the last-modified timestamp of the file that corresponds to the target resource URL (i.e.
getLastNestedPropertySeparatorIndex(String) - Static method in class org.springframework.beans.PropertyAccessorUtils
Determine the first nested property separator in the given property path, ignoring dots in keys (like "map[my.key]").
getLastRefreshTime() - Method in class org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource
getLastRefreshTime() - Method in interface org.springframework.aop.target.dynamic.Refreshable
Return the last time an actual refresh happened (as timestamp).
getLastTaskName() - Method in class org.springframework.util.StopWatch
Return the name of the last task.
getLastTaskTimeMillis() - Method in class org.springframework.util.StopWatch
Return the time taken by the last task.
getLazyInit() - Method in class org.springframework.beans.factory.xml.DocumentDefaultsDefinition
Return the default lazy-init flag for the document that's currently parsed.
getLeftOperand() - Method in class org.springframework.expression.spel.ast.Operator
getLetterCode() - Method in class org.springframework.core.enums.LetterCodedLabeledEnum
Deprecated. Return the letter code of this LabeledEnum instance.
getLifecycleBeans() - Method in class org.springframework.context.support.DefaultLifecycleProcessor
Retrieve all applicable Lifecycle beans: all singletons that have already been created, as well as all SmartLifecycle beans (even if they are marked as lazy-init).
getLifecyclePhase() - Method in class org.springframework.mock.web.portlet.MockActionRequest
getLifecyclePhase() - Method in class org.springframework.mock.web.portlet.MockEventRequest
getLifecyclePhase() - Method in class org.springframework.mock.web.portlet.MockPortletRequest
Return the Portlet 2.0 lifecycle id for the current phase.
getLifecyclePhase() - Method in class org.springframework.mock.web.portlet.MockRenderRequest
getLifecyclePhase() - Method in class org.springframework.mock.web.portlet.MockResourceRequest
getLimitedInParameterNames() - Method in class org.springframework.jdbc.core.metadata.CallMetaDataContext
Get a limited set of in parameters to be used.
getLineNumber() - Method in exception org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException
Return the line number in the XML resource that failed.
getListenerMethodName(Message, Object) - Method in class org.springframework.jms.listener.adapter.MessageListenerAdapter
Determine the name of the listener method that is supposed to handle the given message.
getLiteralValue() - Method in class org.springframework.expression.spel.ast.BooleanLiteral
getLiteralValue() - Method in class org.springframework.expression.spel.ast.IntLiteral
getLiteralValue() - Method in class org.springframework.expression.spel.ast.Literal
getLiteralValue() - Method in class org.springframework.expression.spel.ast.LongLiteral
getLiteralValue() - Method in class org.springframework.expression.spel.ast.NullLiteral
getLiteralValue() - Method in class org.springframework.expression.spel.ast.RealLiteral
getLiteralValue() - Method in class org.springframework.expression.spel.ast.StringLiteral
getLoadCount() - Method in class org.springframework.test.AbstractSingleSpringContextTests
Deprecated. Return the current number of context load attempts.
getLoadTimeWeaver() - Method in class org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager
Return the Spring LoadTimeWeaver to use for class instrumentation according to the JPA class transformer contract.
getLobCreator() - Method in class org.springframework.jdbc.support.lob.DefaultLobHandler
getLobCreator() - Method in interface org.springframework.jdbc.support.lob.LobHandler
Create a new LobCreator instance, i.e.
getLobCreator() - Method in class org.springframework.jdbc.support.lob.OracleLobHandler
getLocalAddr() - Method in class org.springframework.mock.web.MockHttpServletRequest
getLocale() - Method in interface org.springframework.context.i18n.LocaleContext
Return the current Locale, which can be fixed or determined dynamically, depending on the implementation strategy.
getLocale() - Static method in class org.springframework.context.i18n.LocaleContextHolder
Return the Locale associated with the current thread, if any, or the system default Locale else.
getLocale() - Method in class org.springframework.context.i18n.SimpleLocaleContext
getLocale() - Method in class org.springframework.context.support.MessageSourceResourceBundle
This implementation exposes the specified Locale for introspection through the standard ResourceBundle.getLocale() method.
getLocale() - Method in class org.springframework.mock.web.MockHttpServletRequest
getLocale() - Method in class org.springframework.mock.web.MockHttpServletResponse
getLocale() - Method in class org.springframework.mock.web.portlet.MockMimeResponse
getLocale() - Method in class org.springframework.mock.web.portlet.MockPortletRequest
getLocale() - Method in class org.springframework.web.context.request.FacesWebRequest
getLocale() - Method in class org.springframework.web.context.request.ServletWebRequest
getLocale() - Method in interface org.springframework.web.context.request.WebRequest
Return the primary Locale for this request.
getLocale() - Method in class org.springframework.web.portlet.context.PortletWebRequest
getLocale() - Method in class org.springframework.web.servlet.handler.DispatcherServletWebRequest
getLocale() - Method in class org.springframework.web.servlet.support.RequestContext
Return the current Locale (never null).
getLocale(HttpServletRequest) - Static method in class org.springframework.web.servlet.support.RequestContextUtils
Retrieves the current locale from the given request, using the LocaleResolver bound to the request by the DispatcherServlet (if available), falling back to the request's accept-header Locale.
getLocaleContext() - Static method in class org.springframework.context.i18n.LocaleContextHolder
Return the LocaleContext associated with the current thread, if any.
getLocaleResolver(HttpServletRequest) - Static method in class org.springframework.web.servlet.support.RequestContextUtils
Return the LocaleResolver that has been bound to the request by the DispatcherServlet.
getLocales() - Method in class org.springframework.mock.web.MockHttpServletRequest
getLocales() - Method in class org.springframework.mock.web.portlet.MockPortletRequest
getLocalName(Node) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Gets the local name for the supplied Node.
getLocalName() - Method in class org.springframework.mock.web.MockHttpServletRequest
getLocalPort() - Method in class org.springframework.mock.web.MockHttpServletRequest
getLocation() - Method in class org.springframework.aop.aspectj.AspectJExpressionPointcutAdvisor
getLocation() - Method in class org.springframework.aop.support.AbstractExpressionPointcut
Return location information about the pointcut expression if available.
getLocation() - Method in class org.springframework.beans.factory.parsing.Problem
Get the location within a bean configuration source that triggered the error.
getLocation() - Method in class org.springframework.http.HttpHeaders
Return the (new) location of a resource, as specified by the Location header.
getLogFile() - Method in class org.springframework.jmx.export.metadata.ManagedResource
getLoggerForInvocation(MethodInvocation) - Method in class org.springframework.aop.interceptor.AbstractTraceInterceptor
Return the appropriate Log instance to use for the given MethodInvocation.
getLoginTimeout() - Method in class org.springframework.jdbc.datasource.AbstractDataSource
Returns 0, indicating the default system timeout is to be used.
getLoginTimeout() - Method in class org.springframework.jdbc.datasource.DelegatingDataSource
getLogWriter() - Method in class org.springframework.jdbc.datasource.AbstractDataSource
LogWriter methods are not supported.
getLogWriter() - Method in class org.springframework.jdbc.datasource.DelegatingDataSource
getLong(int) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getLong(String) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getLong(int) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as a long.
getLong(String) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as a long.
getLongDescription() - Method in class org.springframework.beans.factory.config.BeanDefinitionHolder
Return a long description for the bean, including name and aliases as well as a description of the contained BeanDefinition.
getLongLiteral(String, int, int) - Static method in class org.springframework.expression.spel.ast.Literal
getLongParameter(ServletRequest, String) - Static method in class org.springframework.web.bind.ServletRequestUtils
Get a Long parameter, or null if not present.
getLongParameter(ServletRequest, String, long) - Static method in class org.springframework.web.bind.ServletRequestUtils
Get a long parameter, with a fallback value.
getLongParameter(PortletRequest, String) - Static method in class org.springframework.web.portlet.bind.PortletRequestUtils
Get a Long parameter, or null if not present.
getLongParameter(PortletRequest, String, long) - Static method in class org.springframework.web.portlet.bind.PortletRequestUtils
Get a long parameter, with a fallback value.
getLongParameters(ServletRequest, String) - Static method in class org.springframework.web.bind.ServletRequestUtils
Get an array of long parameters, return an empty array if not found.
getLongParameters(PortletRequest, String) - Static method in class org.springframework.web.portlet.bind.PortletRequestUtils
Get an array of long parameters, return an empty array if not found.
getLookupKey(PortletRequest) - Method in class org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping
Build a lookup key for the given request.
getLookupKey(PortletRequest) - Method in class org.springframework.web.portlet.handler.ParameterHandlerMapping
Uses the value of the specified parameter as lookup key.
getLookupKey(PortletRequest) - Method in class org.springframework.web.portlet.handler.PortletModeHandlerMapping
Uses the current PortletMode as lookup key.
getLookupKey(PortletRequest) - Method in class org.springframework.web.portlet.handler.PortletModeParameterHandlerMapping
Returns a lookup key that combines the current PortletMode and the current value of the specified parameter.
getLookupKey(PortletRequest) - Method in class org.springframework.web.portlet.mvc.annotation.DefaultAnnotationHandlerMapping
Uses the current PortletMode as lookup key.
getLookupPathForRequest(HttpServletRequest) - Method in class org.springframework.web.util.UrlPathHelper
Return the mapping lookup path for the given request, within the current servlet mapping if applicable, else within the web application.
getLookupType() - Method in class org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.LookupElement
Return the desired type for the lookup.
getMajorJavaVersion() - Static method in class org.springframework.core.JdkVersion
Get the major version code.
getMajorVersion() - Method in class org.springframework.mock.web.MockServletContext
getMajorVersion() - Method in class org.springframework.mock.web.portlet.MockPortletContext
getMajorVersion() - Method in class org.springframework.mock.web.portlet.ServletWrappingPortletContext
getManagedAttribute(Method) - Method in class org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource
getManagedAttribute(Method) - Method in interface org.springframework.jmx.export.metadata.JmxAttributeSource
Implementations should return an instance of ManagedAttribute if the supplied Method has the corresponding metadata.
getManagedClassNames() - Method in class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo
getManagedMetric(Method) - Method in class org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource
getManagedMetric(Method) - Method in interface org.springframework.jmx.export.metadata.JmxAttributeSource
Implementations should return an instance of ManagedMetric if the supplied Method has the corresponding metadata.
getManagedNotifications(Class<?>) - Method in class org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource
getManagedNotifications(Class<?>) - Method in interface org.springframework.jmx.export.metadata.JmxAttributeSource
Implementations should return an array of ManagedNotifications if the supplied the Class has the corresponding metadata.
getManagedOperation(Method) - Method in class org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource
getManagedOperation(Method) - Method in interface org.springframework.jmx.export.metadata.JmxAttributeSource
Implementations should return an instance of ManagedOperation if the supplied Method has the corresponding metadata.
getManagedOperationParameters(Method) - Method in class org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource
getManagedOperationParameters(Method) - Method in interface org.springframework.jmx.export.metadata.JmxAttributeSource
Implementations should return an array of ManagedOperationParameter if the supplied Method has the corresponding metadata.
getManagedResource(Class<?>) - Method in class org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource
getManagedResource(Class<?>) - Method in interface org.springframework.jmx.export.metadata.JmxAttributeSource
Implementations should return an instance of ManagedResource if the supplied Class has the appropriate metadata.
getManagementInterface() - Method in class org.springframework.jmx.access.MBeanClientInterceptor
Return the management interface of the target MBean, or null if none specified.
getMap() - Method in class org.springframework.mock.web.portlet.MockPortletPreferences
getMapKeyFieldType(Field) - Static method in class org.springframework.core.GenericCollectionTypeResolver
Determine the generic key type of the given Map field.
getMapKeyFieldType(Field, int) - Static method in class org.springframework.core.GenericCollectionTypeResolver
Determine the generic key type of the given Map field.
getMapKeyParameterType(MethodParameter) - Static method in class org.springframework.core.GenericCollectionTypeResolver
Determine the generic key type of the given Map parameter.
getMapKeyReturnType(Method) - Static method in class org.springframework.core.GenericCollectionTypeResolver
Determine the generic key type of the given Map return type.
getMapKeyReturnType(Method, int) - Static method in class org.springframework.core.GenericCollectionTypeResolver
Determine the generic key type of the given Map return type.
getMapKeyType() - Method in class org.springframework.beans.factory.config.DependencyDescriptor
Determine the generic key type of the wrapped Map parameter/field, if any.
getMapKeyType() - Method in class org.springframework.core.convert.TypeDescriptor
Determine the generic key type of the wrapped Map parameter/field, if any.
getMapKeyType(Class<? extends Map>) - Static method in class org.springframework.core.GenericCollectionTypeResolver
Determine the generic key type of the given Map class (if it declares one through a generic superclass or generic interface).
getMapKeyTypeDescriptor() - Method in class org.springframework.core.convert.TypeDescriptor
Returns map key type as a type descriptor.
getMappedClass() - Method in class org.springframework.jdbc.core.BeanPropertyRowMapper
Get the class that we are mapping to.
getMappingFileNames() - Method in class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo
getMapValueFieldType(Field) - Static method in class org.springframework.core.GenericCollectionTypeResolver
Determine the generic value type of the given Map field.
getMapValueFieldType(Field, int) - Static method in class org.springframework.core.GenericCollectionTypeResolver
Determine the generic value type of the given Map field.
getMapValueParameterType(MethodParameter) - Static method in class org.springframework.core.GenericCollectionTypeResolver
Determine the generic value type of the given Map parameter.
getMapValueReturnType(Method) - Static method in class org.springframework.core.GenericCollectionTypeResolver
Determine the generic value type of the given Map return type.
getMapValueReturnType(Method, int) - Static method in class org.springframework.core.GenericCollectionTypeResolver
Determine the generic value type of the given Map return type.
getMapValueType() - Method in class org.springframework.beans.factory.config.DependencyDescriptor
Determine the generic value type of the wrapped Map parameter/field, if any.
getMapValueType() - Method in class org.springframework.core.convert.TypeDescriptor
Determine the generic value type of the wrapped Map parameter/field, if any.
getMapValueType(Class<? extends Map>) - Static method in class org.springframework.core.GenericCollectionTypeResolver
Determine the generic value type of the given Map class (if it declares one through a generic superclass or generic interface).
getMapValueTypeDescriptor() - Method in class org.springframework.core.convert.TypeDescriptor
Returns map value type as a type descriptor.
getMarshaller() - Method in class org.springframework.oxm.support.MarshallingSource
Return the Marshaller used by this MarshallingSource.
getMaxConcurrency() - Method in class org.springframework.jms.listener.endpoint.JmsActivationSpecConfig
Return the maximum number of consumers/sessions to use.
getMaxConcurrentConsumers() - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Return the "maxConcurrentConsumer" setting.
getMaxIdle() - Method in class org.springframework.aop.target.CommonsPoolTargetSource
Return the maximum number of idle objects in the pool.
getMaxInactiveInterval() - Method in class org.springframework.mock.web.MockHttpSession
getMaxInactiveInterval() - Method in class org.springframework.mock.web.portlet.MockPortletSession
getMaxlength() - Method in class org.springframework.web.servlet.tags.form.InputTag
Get the value of the 'maxlength' attribute.
getMaxLinkedPages() - Method in class org.springframework.beans.support.PagedListHolder
Return the maximum number of page links to a few pages around the current one.
getMaxMessagesPerTask() - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Return the maximum number of messages to process in one task.
getMaxPayloadLength() - Method in class org.springframework.web.filter.AbstractRequestLoggingFilter
Return the maximum length of the payload body to be included in the log message.
getMaxPoolSize() - Method in class org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor
Return the ThreadPoolExecutor's maximum pool size.
getMaxPoolSize() - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
Return the ThreadPoolExecutor's maximum pool size.
getMaxResults() - Method in class org.springframework.orm.hibernate3.HibernateTemplate
Return the maximum number of rows specified for this HibernateTemplate.
getMaxRows() - Method in class org.springframework.jdbc.core.JdbcTemplate
Return the maximum number of rows specified for this JdbcTemplate.
getMaxSize() - Method in class org.springframework.aop.target.AbstractPoolingTargetSource
Return the maximum size of the pool.
getMaxSize() - Method in interface org.springframework.aop.target.PoolingConfig
Return the maximum size of the pool.
getMaxUploadSize() - Method in exception org.springframework.web.multipart.MaxUploadSizeExceededException
Return the maximum upload size allowed.
getMaxWait() - Method in class org.springframework.aop.target.CommonsPoolTargetSource
Return the maximum waiting time for fetching an object from the pool.
getMBeanInfo(Object, String) - Method in class org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler
Create an instance of the ModelMBeanInfoSupport class supplied with all JMX implementations and populates the metadata through calls to the subclass.
getMBeanInfo(Object, String) - Method in interface org.springframework.jmx.export.assembler.MBeanInfoAssembler
Create the ModelMBeanInfo for the given managed resource.
getMBeanInterface(Class<?>) - Static method in class org.springframework.jmx.support.JmxUtils
Return the Standard MBean interface for the given class, if any (that is, an interface whose name matches the class name of the given class but with suffix "MBean").
getMediaTypeFromFilename(String) - Method in class org.springframework.web.servlet.view.ContentNegotiatingViewResolver
Determines the MediaType for the given filename.
getMediaTypeFromParameter(String) - Method in class org.springframework.web.servlet.view.ContentNegotiatingViewResolver
Determines the MediaType for the given parameter value.
getMediaTypes(HttpServletRequest) - Method in class org.springframework.web.servlet.view.ContentNegotiatingViewResolver
Determines the list of MediaType for the given HttpServletRequest.
getMember() - Method in class org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement
getMerge() - Method in class org.springframework.beans.factory.xml.DocumentDefaultsDefinition
Return the default merge setting for the document that's currently parsed.
getMergedBeanDefinition(String) - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Return a merged BeanDefinition for the given bean name, merging a child bean definition with its parent if necessary.
getMergedBeanDefinition(String) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Return a 'merged' BeanDefinition for the given bean name, merging a child bean definition with its parent if necessary.
getMergedBeanDefinition(String, BeanDefinition) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Return a RootBeanDefinition for the given top-level bean, by merging with the parent if the given bean's definition is a child bean definition.
getMergedBeanDefinition(String, BeanDefinition, BeanDefinition) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Return a RootBeanDefinition for the given bean, by merging with the parent if the given bean's definition is a child bean definition.
getMergedLocalBeanDefinition(String) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Return a merged RootBeanDefinition, traversing the parent bean definition if the specified bean corresponds to a child bean definition.
getMergedProperties(Locale) - Method in class org.springframework.context.support.ReloadableResourceBundleMessageSource
Get a PropertiesHolder that contains the actually visible properties for a Locale, after merging all specified resource bundles.
getMessage() - Method in class org.springframework.beans.factory.parsing.Problem
Get the message detailing the problem.
getMessage() - Method in exception org.springframework.beans.PropertyBatchUpdateException
getMessage(String, Object[], String, Locale) - Method in interface org.springframework.context.MessageSource
Try to resolve the message.
getMessage(String, Object[], Locale) - Method in interface org.springframework.context.MessageSource
Try to resolve the message.
getMessage(MessageSourceResolvable, Locale) - Method in interface org.springframework.context.MessageSource
Try to resolve the message using all the attributes contained within the MessageSourceResolvable argument that was passed in.
getMessage(String, Object[], String, Locale) - Method in class org.springframework.context.support.AbstractApplicationContext
getMessage(String, Object[], Locale) - Method in class org.springframework.context.support.AbstractApplicationContext
getMessage(MessageSourceResolvable, Locale) - Method in class org.springframework.context.support.AbstractApplicationContext
getMessage(String, Object[], String, Locale) - Method in class org.springframework.context.support.AbstractMessageSource
getMessage(String, Object[], Locale) - Method in class org.springframework.context.support.AbstractMessageSource
getMessage(MessageSourceResolvable, Locale) - Method in class org.springframework.context.support.AbstractMessageSource
getMessage(String, Object[], String, Locale) - Method in class org.springframework.context.support.DelegatingMessageSource
getMessage(String, Object[], Locale) - Method in class org.springframework.context.support.DelegatingMessageSource
getMessage(MessageSourceResolvable, Locale) - Method in class org.springframework.context.support.DelegatingMessageSource
getMessage(String, String) - Method in class org.springframework.context.support.MessageSourceAccessor
Retrieve the message for the given code and the default Locale.
getMessage(String, String, Locale) - Method in class org.springframework.context.support.MessageSourceAccessor
Retrieve the message for the given code and the given Locale.
getMessage(String, Object[], String) - Method in class org.springframework.context.support.MessageSourceAccessor
Retrieve the message for the given code and the default Locale.
getMessage(String, Object[], String, Locale) - Method in class org.springframework.context.support.MessageSourceAccessor
Retrieve the message for the given code and the given Locale.
getMessage(String) - Method in class org.springframework.context.support.MessageSourceAccessor
Retrieve the message for the given code and the default Locale.
getMessage(String, Locale) - Method in class org.springframework.context.support.MessageSourceAccessor
Retrieve the message for the given code and the given Locale.
getMessage(String, Object[]) - Method in class org.springframework.context.support.MessageSourceAccessor
Retrieve the message for the given code and the default Locale.
getMessage(String, Object[], Locale) - Method in class org.springframework.context.support.MessageSourceAccessor
Retrieve the message for the given code and the given Locale.
getMessage(MessageSourceResolvable) - Method in class org.springframework.context.support.MessageSourceAccessor
Retrieve the given MessageSourceResolvable (e.g.
getMessage(MessageSourceResolvable, Locale) - Method in class org.springframework.context.support.MessageSourceAccessor
Retrieve the given MessageSourceResolvable (e.g.
getMessage() - Method in exception org.springframework.core.NestedCheckedException
Return the detail message, including the message from the nested exception if there is one.
getMessage() - Method in exception org.springframework.core.NestedIOException
Return the detail message, including the message from the nested exception if there is one.
getMessage() - Method in exception org.springframework.core.NestedRuntimeException
Return the detail message, including the message from the nested exception if there is one.
getMessage() - Method in exception org.springframework.expression.spel.SpelEvaluationException
getMessage() - Method in exception org.springframework.expression.spel.SpelParseException
getMessage() - Method in exception org.springframework.jms.JmsException
Return the detail message, including the message from the linked exception if there is one.
getMessage() - Method in exception org.springframework.mail.MailSendException
getMessage() - Method in exception org.springframework.validation.BindException
Returns diagnostic information about the errors held in this object.
getMessage() - Method in exception org.springframework.web.bind.MissingServletRequestParameterException
getMessage() - Method in exception org.springframework.web.bind.UnsatisfiedServletRequestParameterException
getMessage() - Method in exception org.springframework.web.portlet.bind.MissingPortletRequestParameterException
getMessage(String, String) - Method in class org.springframework.web.servlet.support.RequestContext
Retrieve the message for the given code, using the "defaultHtmlEscape" setting.
getMessage(String, Object[], String) - Method in class org.springframework.web.servlet.support.RequestContext
Retrieve the message for the given code, using the "defaultHtmlEscape" setting.
getMessage(String, List, String) - Method in class org.springframework.web.servlet.support.RequestContext
Retrieve the message for the given code, using the "defaultHtmlEscape" setting.
getMessage(String, Object[], String, boolean) - Method in class org.springframework.web.servlet.support.RequestContext
Retrieve the message for the given code.
getMessage(String) - Method in class org.springframework.web.servlet.support.RequestContext
Retrieve the message for the given code, using the "defaultHtmlEscape" setting.
getMessage(String, Object[]) - Method in class org.springframework.web.servlet.support.RequestContext
Retrieve the message for the given code, using the "defaultHtmlEscape" setting.
getMessage(String, List) - Method in class org.springframework.web.servlet.support.RequestContext
Retrieve the message for the given code, using the "defaultHtmlEscape" setting.
getMessage(String, Object[], boolean) - Method in class org.springframework.web.servlet.support.RequestContext
Retrieve the message for the given code.
getMessage(MessageSourceResolvable) - Method in class org.springframework.web.servlet.support.RequestContext
Retrieve the given MessageSourceResolvable (e.g.
getMessage(MessageSourceResolvable, boolean) - Method in class org.springframework.web.servlet.support.RequestContext
Retrieve the given MessageSourceResolvable (e.g.
getMessage() - Method in exception org.springframework.web.util.NestedServletException
Return the detail message, including the message from the nested exception if there is one.
getMessageCode() - Method in exception org.springframework.expression.spel.SpelEvaluationException
getMessageCode() - Method in exception org.springframework.expression.spel.SpelParseException
getMessageCodesResolver() - Method in class org.springframework.validation.AbstractBindingResult
Return the strategy to use for resolving errors into message codes.
getMessageCodesResolver() - Method in class org.springframework.web.bind.support.ConfigurableWebBindingInitializer
Return the strategy to use for resolving errors into message codes.
getMessageCodesResolver() - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Return the strategy to use for resolving errors into message codes (if any).
getMessageCodesResolver() - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Return the strategy to use for resolving errors into message codes (if any).
getMessageConverter() - Method in class org.springframework.jms.core.JmsTemplate
Return the message converter for this template.
getMessageConverter() - Method in class org.springframework.jms.listener.adapter.MessageListenerAdapter
Return the converter that will convert incoming JMS messages to listener method arguments, and objects returned from listener methods back to JMS messages.
getMessageConverters() - Method in class org.springframework.web.client.RestTemplate
Returns the message body converters.
getMessageConverters() - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
Return the message body converters that this adapter has been configured with.
getMessageDrivenContext() - Method in class org.springframework.ejb.support.AbstractMessageDrivenBean
Convenience method for subclasses to use.
getMessageEndpointFactory() - Method in class org.springframework.jca.endpoint.GenericMessageEndpointManager
Return the JCA MessageEndpointFactory to activate.
getMessageExceptions() - Method in exception org.springframework.mail.MailSendException
Return an array with thrown message exceptions.
getMessageFormat(String, Locale) - Method in class org.springframework.context.support.ReloadableResourceBundleMessageSource.PropertiesHolder
getMessageFormat(ResourceBundle, String, Locale) - Method in class org.springframework.context.support.ResourceBundleMessageSource
Return a MessageFormat for the given bundle and code, fetching already generated MessageFormats from the cache.
getMessageFromParent(String, Object[], Locale) - Method in class org.springframework.context.support.AbstractMessageSource
Try to retrieve the given message from the parent MessageSource, if any.
getMessageInternal(String, Object[], Locale) - Method in class org.springframework.context.support.AbstractMessageSource
Resolve the given code and arguments as message in the given Locale, returning null if not found.
getMessageInterpolator() - Method in class org.springframework.validation.beanvalidation.LocalValidatorFactoryBean
getMessageListener() - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Return the message listener object to register.
getMessageSelector() - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Return the JMS message selector expression (or null if none).
getMessageSelector() - Method in class org.springframework.jms.listener.endpoint.JmsActivationSpecConfig
getMessageSource() - Method in class org.springframework.ui.context.support.SimpleTheme
getMessageSource() - Method in interface org.springframework.ui.context.Theme
Return the specific MessageSource that resolves messages with respect to this theme.
getMessageSource() - Method in class org.springframework.web.servlet.support.RequestContext
Return the current WebApplicationContext as MessageSource.
getMessageSource() - Method in class org.springframework.web.servlet.tags.MessageTag
Use the current RequestContext's application context as MessageSource.
getMessageSource() - Method in class org.springframework.web.servlet.tags.ThemeTag
Use the theme MessageSource for theme message resolution.
getMessageSourceAccessor() - Method in class org.springframework.context.support.ApplicationObjectSupport
Return a MessageSourceAccessor for the application context used by this object, for easy message access.
getMessageSourceAccessor() - Method in class org.springframework.remoting.jaxrpc.ServletEndpointSupport
Deprecated. Return a MessageSourceAccessor for the application context used by this object, for easy message access.
getMessageSourceAccessor() - Method in class org.springframework.web.servlet.view.tiles.ComponentControllerSupport
Deprecated. Return a MessageSourceAccessor for the application context used by this object, for easy message access.
getMessageSourceAccessor() - Method in class org.springframework.web.struts.ActionSupport
Deprecated. Return a MessageSourceAccessor for the application context used by this object, for easy message access.
getMessageSourceAccessor() - Method in class org.springframework.web.struts.DispatchActionSupport
Deprecated. Return a MessageSourceAccessor for the application context used by this object, for easy message access.
getMessageSourceAccessor() - Method in class org.springframework.web.struts.LookupDispatchActionSupport
Deprecated. Return a MessageSourceAccessor for the application context used by this object, for easy message access.
getMessageSourceAccessor() - Method in class org.springframework.web.struts.MappingDispatchActionSupport
Deprecated. Return a MessageSourceAccessor for the application context used by this object, for easy message access.
getMetaAnnotationTypes(String) - Method in interface org.springframework.core.type.AnnotationMetadata
Return the names of all meta-annotation types defined on the given annotation type of the underlying class.
getMetaAnnotationTypes(String) - Method in class org.springframework.core.type.StandardAnnotationMetadata
getMetadata() - Method in interface org.springframework.beans.factory.annotation.AnnotatedBeanDefinition
Obtain the annotation metadata (as well as basic class metadata) for this bean definition's bean class.
getMetadata() - Method in class org.springframework.beans.factory.annotation.AnnotatedGenericBeanDefinition
getMetadata() - Method in class org.springframework.context.annotation.ScannedGenericBeanDefinition
getMetaData() - Method in class org.springframework.jca.cci.connection.DelegatingConnectionFactory
getMetaData() - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getMetaData() - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the meta data (number, types and properties for the columns) of this row set.
getMetadataAttribute(String) - Method in class org.springframework.beans.BeanMetadataAttributeAccessor
Look up the given BeanMetadataAttribute in this accessor's set of attributes.
getMetadataReader(Resource) - Method in class org.springframework.core.type.classreading.CachingMetadataReaderFactory
getMetadataReader(String) - Method in interface org.springframework.core.type.classreading.MetadataReaderFactory
Obtain a MetadataReader for the given class name.
getMetadataReader(Resource) - Method in interface org.springframework.core.type.classreading.MetadataReaderFactory
Obtain a MetadataReader for the given resource.
getMetadataReader(String) - Method in class org.springframework.core.type.classreading.SimpleMetadataReaderFactory
getMetadataReader(Resource) - Method in class org.springframework.core.type.classreading.SimpleMetadataReaderFactory
getMethod() - Method in class org.springframework.aop.framework.ReflectiveMethodInvocation
Return the method invoked on the proxied interface.
getMethod() - Method in class org.springframework.core.MethodParameter
Return the wrapped Method, if any.
getMethod() - Method in interface org.springframework.http.client.ClientHttpRequest
Return the HTTP method of the request.
getMethod() - Method in interface org.springframework.http.server.ServerHttpRequest
Return the HTTP method of the request.
getMethod() - Method in class org.springframework.http.server.ServletServerHttpRequest
getMethod() - Method in class org.springframework.mock.web.MockHttpServletRequest
getMethod() - Method in class org.springframework.mock.web.portlet.MockClientDataRequest
getMethod() - Method in class org.springframework.mock.web.portlet.MockEventRequest
getMethod() - Method in class org.springframework.web.context.support.ServletRequestHandledEvent
Return the HTTP method of the request (usually GET or POST).
getMethod() - Method in exception org.springframework.web.HttpRequestMethodNotSupportedException
Return the HTTP request method that caused the failure.
getMethod() - Method in exception org.springframework.web.portlet.handler.PortletRequestMethodNotSupportedException
Return the HTTP request method that caused the failure.
getMethod() - Method in class org.springframework.web.servlet.tags.form.FormTag
Get the value of the 'method' attribute.
getMethodAnnotation(Class<T>) - Method in class org.springframework.core.MethodParameter
Return the method/constructor annotation of the given type, if available.
getMethodAnnotations() - Method in class org.springframework.core.MethodParameter
Return the annotations associated with the target method/constructor itself.
getMethodCountForName(Class<?>, String) - Static method in class org.springframework.util.ClassUtils
Return the number of methods with a given name (with any argument types), for the given class and/or its superclasses.
getMethodIfAvailable(Class<?>, String, Class<?>...) - Static method in class org.springframework.util.ClassUtils
Determine whether the given class has a method with the given signature, and return it if available (else return null).
getMethodMatcher() - Method in class org.springframework.aop.aspectj.AspectJExpressionPointcut
getMethodMatcher() - Method in interface org.springframework.aop.Pointcut
Return the MethodMatcher for this pointcut.
getMethodMatcher() - Method in class org.springframework.aop.support.annotation.AnnotationMatchingPointcut
getMethodMatcher() - Method in class org.springframework.aop.support.ComposablePointcut
getMethodMatcher() - Method in class org.springframework.aop.support.ControlFlowPointcut
getMethodMatcher() - Method in class org.springframework.aop.support.DynamicMethodMatcherPointcut
getMethodMatcher() - Method in class org.springframework.aop.support.StaticMethodMatcherPointcut
getMethodName() - Method in class org.springframework.beans.factory.support.MethodOverride
Return the name of the method to be overridden.
getMethodName() - Method in interface org.springframework.core.type.MethodMetadata
Return the name of the method.
getMethodName() - Method in class org.springframework.core.type.StandardMethodMetadata
getMethodName() - Method in class org.springframework.remoting.support.RemoteInvocation
Return the name of the target method.
getMethodName() - Method in exception org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException
Return the name of the offending method, if known.
getMethodNameResolver() - Method in class org.springframework.web.servlet.mvc.multiaction.MultiActionController
Return the MethodNameResolver used by this class.
getMethodOverrides() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Return information about methods to be overridden by the IoC container.
getMethodParameter() - Method in class org.springframework.beans.factory.config.DependencyDescriptor
Return the wrapped MethodParameter, if any.
getMethodParameter() - Method in class org.springframework.core.convert.TypeDescriptor
Return the wrapped MethodParameter, if any.
getMethodParameter() - Method in class org.springframework.web.servlet.tags.form.FormTag
Get the name of the request param for non-browser supported HTTP methods.
getMethodReplacerBeanName() - Method in class org.springframework.beans.factory.support.ReplaceOverride
Return the name of the bean implementing MethodReplacer.
getMethodResolvers() - Method in interface org.springframework.expression.EvaluationContext
getMethodResolvers() - Method in class org.springframework.expression.spel.support.StandardEvaluationContext
getMethodSignature(Method) - Static method in class org.springframework.jmx.support.JmxUtils
Create a String[] representing the argument signature of a method.
getMetricType() - Method in class org.springframework.jmx.export.metadata.ManagedMetric
A description of how this metric's values change over time.
getMimeMessage() - Method in class org.springframework.mail.javamail.MimeMailMessage
Return the JavaMail MimeMessage that this MimeMailMessage is based on.
getMimeMessage() - Method in class org.springframework.mail.javamail.MimeMessageHelper
Return the underlying MimeMessage object.
getMimeMessageHelper() - Method in class org.springframework.mail.javamail.MimeMailMessage
Return the MimeMessageHelper that this MimeMailMessage is based on.
getMimeMultipart() - Method in class org.springframework.mail.javamail.MimeMessageHelper
Return the underlying MIME "multipart/related" object, if any.
getMimeType(String) - Method in class org.springframework.mock.web.MockServletContext
getMimeType(String) - Method in class org.springframework.mock.web.portlet.MockPortletContext
getMimeType(String) - Method in class org.springframework.mock.web.portlet.ServletWrappingPortletContext
getMinEvictableIdleTimeMillis() - Method in class org.springframework.aop.target.CommonsPoolTargetSource
Return the minimum time that an idle object can sit in the pool.
getMinIdle() - Method in class org.springframework.aop.target.CommonsPoolTargetSource
Return the minimum number of idle objects in the pool.
getMinorVersion() - Method in class org.springframework.mock.web.MockServletContext
getMinorVersion() - Method in class org.springframework.mock.web.portlet.MockPortletContext
getMinorVersion() - Method in class org.springframework.mock.web.portlet.ServletWrappingPortletContext
getMockHttpServletResponse(ServletResponse) - Method in class org.springframework.mock.web.MockRequestDispatcher
Obtain the underlying MockHttpServletResponse, unwrapping HttpServletResponseWrapper decorators if necessary.
getModel() - Method in class org.springframework.validation.AbstractBindingResult
Return a model Map for the obtained state, exposing an Errors instance as 'MODEL_KEY_PREFIX + objectName' and the object itself.
getModel() - Method in exception org.springframework.validation.BindException
getModel() - Method in interface org.springframework.validation.BindingResult
Return a model Map for the obtained state, exposing a BindingResult instance as 'MODEL_KEY_PREFIX + objectName' and the object itself as 'objectName'.
getModel() - Method in class org.springframework.web.portlet.ModelAndView
Return the model map.
getModel() - Method in class org.springframework.web.servlet.ModelAndView
Return the model map.
getModel() - Method in class org.springframework.web.servlet.support.RequestContext
Return the model Map that this RequestContext encapsulates, if any.
getModelAndView(String, Exception, PortletRequest) - Method in class org.springframework.web.portlet.handler.SimpleMappingExceptionResolver
Return a ModelAndView for the given request, view name and exception.
getModelAndView(String, Exception) - Method in class org.springframework.web.portlet.handler.SimpleMappingExceptionResolver
Return a ModelAndView for the given view name and exception.
getModelAndView() - Method in exception org.springframework.web.portlet.ModelAndViewDefiningException
Return the ModelAndView that this exception contains for forwarding to.
getModelAndView(String, Exception, HttpServletRequest) - Method in class org.springframework.web.servlet.handler.SimpleMappingExceptionResolver
Return a ModelAndView for the given request, view name and exception.
getModelAndView(String, Exception) - Method in class org.springframework.web.servlet.handler.SimpleMappingExceptionResolver
Return a ModelAndView for the given view name and exception.
getModelAndView() - Method in exception org.springframework.web.servlet.ModelAndViewDefiningException
Return the ModelAndView that this exception contains for forwarding to.
getModelAttribute() - Method in class org.springframework.web.servlet.tags.form.FormTag
Get the name of the form attribute in the model.
getModelAttributeMethods() - Method in class org.springframework.web.bind.annotation.support.HandlerMethodResolver
getModelInternal() - Method in class org.springframework.web.portlet.ModelAndView
Return the model map.
getModelInternal() - Method in class org.springframework.web.servlet.ModelAndView
Return the model map.
getModelMap() - Method in class org.springframework.web.portlet.ModelAndView
Return the underlying ModelMap instance (never null).
getModelMap() - Method in class org.springframework.web.servlet.ModelAndView
Return the underlying ModelMap instance (never null).
getModelObject(String) - Method in class org.springframework.web.servlet.support.RequestContext
Retrieve the model object for the given model name, either from the model or from the request attributes.
getModuleConfig() - Method in class org.springframework.web.struts.ContextLoaderPlugIn
Deprecated. Return the Struts ModuleConfig that this PlugIn is associated with.
getModulePrefix() - Method in class org.springframework.web.struts.ContextLoaderPlugIn
Deprecated. Return the prefix of the ModuleConfig that this PlugIn is associated with.
getMostSpecificCause() - Method in exception org.springframework.core.NestedCheckedException
Retrieve the most specific cause of this exception, that is, either the innermost cause (root cause) or this exception itself.
getMostSpecificCause() - Method in exception org.springframework.core.NestedRuntimeException
Retrieve the most specific cause of this exception, that is, either the innermost cause (root cause) or this exception itself.
getMostSpecificMethod(Method, Class<?>) - Static method in class org.springframework.aop.support.AopUtils
Given a method, which may come from an interface, and a target class used in the current AOP invocation, find the corresponding target method if there is one.
getMostSpecificMethod(Method, Class<?>) - Static method in class org.springframework.util.ClassUtils
Given a method, which may come from an interface, and a target class used in the current reflective invocation, find the corresponding target method if there is one.
getMultiFileMap() - Method in class org.springframework.mock.web.MockMultipartHttpServletRequest
getMultiFileMap() - Method in class org.springframework.mock.web.portlet.MockMultipartActionRequest
getMultiFileMap() - Method in interface org.springframework.web.multipart.MultipartRequest
Return a MultiValueMap of the multipart files contained in this request.
getMultiFileMap() - Method in class org.springframework.web.multipart.support.AbstractMultipartHttpServletRequest
getMultiFileMap() - Method in class org.springframework.web.portlet.multipart.DefaultMultipartActionRequest
getMultipartFiles() - Method in class org.springframework.web.multipart.commons.CommonsFileUploadSupport.MultipartParsingResult
Return the multipart files as Map of field name to MultipartFile instance.
getMultipartFiles() - Method in class org.springframework.web.multipart.support.AbstractMultipartHttpServletRequest
Obtain the MultipartFile Map for retrieval, lazily initializing it if necessary.
getMultipartFiles() - Method in class org.springframework.web.portlet.multipart.DefaultMultipartActionRequest
Obtain the MultipartFile Map for retrieval, lazily initializing it if necessary.
getMultipartParameters() - Method in class org.springframework.web.multipart.commons.CommonsFileUploadSupport.MultipartParsingResult
Return the multipart parameters as Map of field name to form field String value.
getMultipartParameters() - Method in class org.springframework.web.multipart.support.DefaultMultipartHttpServletRequest
Obtain the multipart parameter Map for retrieval, lazily initializing it if necessary.
getMultipartParameters() - Method in class org.springframework.web.portlet.multipart.DefaultMultipartActionRequest
Obtain the multipart parameter Map for retrieval, lazily initializing it if necessary.
getMultipartResolver() - Method in class org.springframework.web.portlet.DispatcherPortlet
Obtain this portlet's PortletMultipartResolver, if any.
getMultipartResolver() - Method in class org.springframework.web.servlet.DispatcherServlet
Obtain this servlet's MultipartResolver, if any.
getMultipartResolverBeanName() - Method in class org.springframework.web.multipart.support.MultipartFilter
Return the bean name of the MultipartResolver to fetch from Spring's root application context.
getMultiple() - Method in class org.springframework.web.servlet.tags.form.SelectTag
Get the value of the HTML 'multiple' attribute rendered on the final 'select' element.
getMXBeanInterface(Class<?>) - Static method in class org.springframework.jmx.support.JmxUtils
Return the Java 6 MXBean interface exists for the given class, if any (that is, an interface whose name ends with "MXBean" and/or carries an appropriate MXBean annotation).
getName() - Method in class org.springframework.aop.config.AdvisorComponentDefinition
getName() - Method in class org.springframework.aop.config.PointcutComponentDefinition
getName() - Method in class org.springframework.beans.BeanMetadataAttribute
Return the name of the attribute.
getName() - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues.ValueHolder
Return the name of the constructor argument.
getName() - Method in class org.springframework.beans.factory.parsing.BeanComponentDefinition
getName() - Method in interface org.springframework.beans.factory.parsing.ComponentDefinition
Get the user-visible name of this ComponentDefinition.
getName() - Method in class org.springframework.beans.factory.parsing.CompositeComponentDefinition
getName() - Method in class org.springframework.beans.PropertyValue
Return the name of the property.
getName() - Method in class org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.LookupElement
Return the resource name for the lookup.
getName() - Method in class org.springframework.core.convert.TypeDescriptor
Returns the name of this type: the fully qualified class name.
getName() - Method in class org.springframework.expression.spel.ast.PropertyOrFieldReference
getName() - Method in class org.springframework.jdbc.core.SqlParameter
Return the name of the parameter.
getName() - Method in class org.springframework.jmx.export.metadata.ManagedNotification
Return the name of this notification.
getName() - Method in class org.springframework.jmx.export.metadata.ManagedOperationParameter
Return the name of this parameter in the operation signature.
getName() - Method in class org.springframework.mock.web.MockMultipartFile
getName() - Method in class org.springframework.mock.web.portlet.MockEvent
getName() - Method in class org.springframework.transaction.support.DefaultTransactionDefinition
getName() - Method in class org.springframework.transaction.support.DelegatingTransactionDefinition
getName() - Method in interface org.springframework.transaction.TransactionDefinition
Return the name of this transaction.
getName() - Method in class org.springframework.ui.context.support.SimpleTheme
getName() - Method in interface org.springframework.ui.context.Theme
Return the name of the theme.
getName() - Method in class org.springframework.web.multipart.commons.CommonsMultipartFile
getName() - Method in interface org.springframework.web.multipart.MultipartFile
Return the name of the parameter in the multipart form.
getName() - Method in class org.springframework.web.servlet.tags.BindErrorsTag
Return the name of the bean that this tag checks.
getName() - Method in class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
Get the value for the HTML 'name' attribute.
getName() - Method in class org.springframework.web.servlet.tags.form.ErrorsTag
Get the value for the HTML 'name' attribute.
getName() - Method in class org.springframework.web.servlet.tags.form.FormTag
Get the value of the 'name' attribute.
getName() - Method in class org.springframework.web.servlet.tags.form.LabelTag
Overrides LabelTag.getName() to always return null, because the 'name' attribute is not supported by the 'label' tag.
getName() - Method in class org.springframework.web.servlet.tags.Param
getNamedDispatcher(String) - Method in class org.springframework.mock.web.MockServletContext
getNamedDispatcher(String) - Method in class org.springframework.mock.web.portlet.MockPortletContext
getNamedDispatcher(String) - Method in class org.springframework.mock.web.portlet.ServletWrappingPortletContext
getNamedParameterJdbcOperations() - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Expose the Spring NamedParameterJdbcTemplate to allow invocation of less commonly used methods.
getNamedParameterJdbcOperations() - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
Expose the Spring NamedParameterJdbcTemplate to allow invocation of less commonly used methods.
getNamedParameterJdbcTemplate() - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcDaoSupport
Return a NamedParameterJdbcTemplate wrapping the configured JdbcTemplate.
getNameInNamespace() - Method in class org.springframework.mock.jndi.SimpleNamingContext
getNameParser(Name) - Method in class org.springframework.mock.jndi.SimpleNamingContext
getNameParser(String) - Method in class org.springframework.mock.jndi.SimpleNamingContext
getNames(String) - Method in class org.springframework.core.Constants
Return all names of the given group of constants.
getNames() - Method in class org.springframework.mock.web.portlet.MockPortletPreferences
getNamesForProperty(String) - Method in class org.springframework.core.Constants
Return all names of the group of constants for the given bean property name.
getNamesForSuffix(String) - Method in class org.springframework.core.Constants
Return all names of the given group of constants.
getNamespace() - Method in class org.springframework.mock.web.portlet.MockPortletResponse
getNamespace() - Method in interface org.springframework.web.context.ConfigurableWebApplicationContext
Return the namespace for this web application context, if any.
getNamespace() - Method in class org.springframework.web.context.support.AbstractRefreshableWebApplicationContext
getNamespace() - Method in class org.springframework.web.context.support.StaticWebApplicationContext
getNamespace() - Method in class org.springframework.web.portlet.context.AbstractRefreshablePortletApplicationContext
getNamespace() - Method in interface org.springframework.web.portlet.context.ConfigurablePortletApplicationContext
Return the namespace for this web application context, if any.
getNamespace() - Method in class org.springframework.web.portlet.context.StaticPortletApplicationContext
getNamespace() - Method in class org.springframework.web.portlet.FrameworkPortlet
Return the namespace for this portlet, falling back to default scheme if no custom namespace was set.
getNamespace() - Method in class org.springframework.web.servlet.FrameworkServlet
Return the namespace for this servlet, falling back to default scheme if no custom namespace was set: e.g.
getNamespace() - Method in class org.springframework.web.struts.ContextLoaderPlugIn
Deprecated. Return the namespace for the ActionServlet, falling back to default scheme if no custom namespace was set: e.g.
getNamespaceHandlerResolver() - Method in class org.springframework.beans.factory.xml.XmlReaderContext
getNamespaceURI(Node) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Gets the namespace URI for the supplied node.
getNamespaceUri() - Method in class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
Deprecated. Return the namespace URI of the service.
getNamespaceUri() - Method in class org.springframework.remoting.jaxws.LocalJaxWsServiceFactory
Return the namespace URI of the service.
getNamespaceURI(String) - Method in class org.springframework.util.xml.SimpleNamespaceContext
getNativeCallableStatement(CallableStatement) - Method in class org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor
getNativeCallableStatement(CallableStatement) - Method in class org.springframework.jdbc.support.nativejdbc.JBossNativeJdbcExtractor
Retrieve the Connection via JBoss' getUnderlyingStatement method.
getNativeCallableStatement(CallableStatement) - Method in class org.springframework.jdbc.support.nativejdbc.Jdbc4NativeJdbcExtractor
getNativeCallableStatement(CallableStatement) - Method in interface org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor
Retrieve the underlying native JDBC CallableStatement for the given statement.
getNativeCallableStatement(CallableStatement) - Method in class org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
Not able to unwrap: return passed-in CallableStatement.
getNativeConnection(Connection) - Method in interface org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor
Retrieve the underlying native JDBC Connection for the given Connection.
getNativeConnection(Connection) - Method in class org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
Check for a ConnectionProxy chain, then delegate to doGetNativeConnection.
getNativeConnectionFromStatement(Statement) - Method in interface org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor
Retrieve the underlying native JDBC Connection for the given Statement.
getNativeConnectionFromStatement(Statement) - Method in class org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
Retrieve the Connection via the Statement's Connection.
getNativeEntityManagerFactory() - Method in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
getNativeEntityManagerFactory() - Method in interface org.springframework.orm.jpa.EntityManagerFactoryInfo
Return the raw underlying EntityManagerFactory.
getNativeJdbcExtractor() - Method in class org.springframework.jdbc.core.JdbcTemplate
Return the current NativeJdbcExtractor implementation.
getNativePreparedStatement(PreparedStatement) - Method in class org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor
getNativePreparedStatement(PreparedStatement) - Method in class org.springframework.jdbc.support.nativejdbc.JBossNativeJdbcExtractor
Retrieve the Connection via JBoss' getUnderlyingStatement method.
getNativePreparedStatement(PreparedStatement) - Method in class org.springframework.jdbc.support.nativejdbc.Jdbc4NativeJdbcExtractor
getNativePreparedStatement(PreparedStatement) - Method in interface org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor
Retrieve the underlying native JDBC PreparedStatement for the given statement.
getNativePreparedStatement(PreparedStatement) - Method in class org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
Not able to unwrap: return passed-in PreparedStatement.
getNativeRequest() - Method in class org.springframework.web.context.request.FacesWebRequest
getNativeRequest(Class<T>) - Method in class org.springframework.web.context.request.FacesWebRequest
getNativeRequest() - Method in interface org.springframework.web.context.request.NativeWebRequest
Return the underlying native request object, if available.
getNativeRequest(Class<T>) - Method in interface org.springframework.web.context.request.NativeWebRequest
Return the underlying native request object, if available.
getNativeRequest() - Method in class org.springframework.web.context.request.ServletWebRequest
getNativeRequest(Class<T>) - Method in class org.springframework.web.context.request.ServletWebRequest
getNativeRequest() - Method in class org.springframework.web.portlet.context.PortletWebRequest
getNativeRequest(Class<T>) - Method in class org.springframework.web.portlet.context.PortletWebRequest
getNativeResponse() - Method in class org.springframework.web.context.request.FacesWebRequest
getNativeResponse(Class<T>) - Method in class org.springframework.web.context.request.FacesWebRequest
getNativeResponse() - Method in interface org.springframework.web.context.request.NativeWebRequest
Return the underlying native response object, if available.
getNativeResponse(Class<T>) - Method in interface org.springframework.web.context.request.NativeWebRequest
Return the underlying native request object, if available.
getNativeResponse() - Method in class org.springframework.web.context.request.ServletWebRequest
getNativeResponse(Class<T>) - Method in class org.springframework.web.context.request.ServletWebRequest
getNativeResponse() - Method in class org.springframework.web.portlet.context.PortletWebRequest
getNativeResponse(Class<T>) - Method in class org.springframework.web.portlet.context.PortletWebRequest
getNativeResultSet(ResultSet) - Method in class org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor
getNativeResultSet(ResultSet) - Method in class org.springframework.jdbc.support.nativejdbc.JBossNativeJdbcExtractor
Retrieve the Connection via JBoss' getUnderlyingResultSet method.
getNativeResultSet(ResultSet) - Method in class org.springframework.jdbc.support.nativejdbc.Jdbc4NativeJdbcExtractor
getNativeResultSet(ResultSet) - Method in interface org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor
Retrieve the underlying native JDBC ResultSet for the given statement.
getNativeResultSet(ResultSet) - Method in class org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
Not able to unwrap: return passed-in ResultSet.
getNativeStatement(Statement) - Method in class org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor
getNativeStatement(Statement) - Method in class org.springframework.jdbc.support.nativejdbc.JBossNativeJdbcExtractor
Retrieve the Connection via JBoss' getUnderlyingStatement method.
getNativeStatement(Statement) - Method in class org.springframework.jdbc.support.nativejdbc.Jdbc4NativeJdbcExtractor
getNativeStatement(Statement) - Method in interface org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor
Retrieve the underlying native JDBC Statement for the given Statement.
getNativeStatement(Statement) - Method in class org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
Not able to unwrap: return passed-in Statement.
getNestedComponents() - Method in class org.springframework.beans.factory.parsing.CompositeComponentDefinition
Return the nested components that this composite component holds.
getNestedDiagnosticContextMessage(WebRequest) - Method in class org.springframework.web.context.request.Log4jNestedDiagnosticContextInterceptor
Determine the message to be pushed onto the Log4J nested diagnostic context.
getNestedDiagnosticContextMessage(HttpServletRequest) - Method in class org.springframework.web.filter.Log4jNestedDiagnosticContextFilter
Determine the message to be pushed onto the Log4J nested diagnostic context.
getNestedPath() - Method in class org.springframework.beans.BeanWrapperImpl
Return the nested path of the object wrapped by this BeanWrapper.
getNestedPath() - Method in class org.springframework.validation.AbstractErrors
getNestedPath() - Method in exception org.springframework.validation.BindException
getNestedPath() - Method in interface org.springframework.validation.Errors
Return the current nested path of this Errors object.
getNestedPath() - Method in class org.springframework.web.bind.EscapedErrors
getNestedPath() - Method in class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
Get the value of the nested path that may have been exposed by the NestedPathTag.
getNestingLevel() - Method in class org.springframework.core.MethodParameter
Return the nesting level of the target type (typically 1; e.g.
getNewSession(SessionFactory) - Static method in class org.springframework.orm.hibernate3.SessionFactoryUtils
Get a new Hibernate Session from the given SessionFactory.
getNewSession(SessionFactory, Interceptor) - Static method in class org.springframework.orm.hibernate3.SessionFactoryUtils
Get a new Hibernate Session from the given SessionFactory.
getNewTempClassLoader() - Method in class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo
This implementation throws an UnsupportedOperationException.
getNextKey() - Method in class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
Determine the next key to use, as a long.
getNextKey() - Method in class org.springframework.jdbc.support.incrementer.AbstractSequenceMaxValueIncrementer
Executes the SQL as specified by AbstractSequenceMaxValueIncrementer.getSequenceQuery().
getNextKey() - Method in class org.springframework.jdbc.support.incrementer.DerbyMaxValueIncrementer
getNextKey() - Method in class org.springframework.jdbc.support.incrementer.HsqlMaxValueIncrementer
getNextKey() - Method in class org.springframework.jdbc.support.incrementer.MySQLMaxValueIncrementer
getNextKey() - Method in class org.springframework.jdbc.support.incrementer.SqlServerMaxValueIncrementer
getNextKey() - Method in class org.springframework.jdbc.support.incrementer.SybaseMaxValueIncrementer
getNextPossiblePortletModes() - Method in class org.springframework.mock.web.portlet.MockRenderResponse
getNonAspectClass() - Method in exception org.springframework.aop.aspectj.annotation.NotAnAtAspectException
Returns the offending class.
getNonJtaDataSource() - Method in class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo
getNoopOutputStream() - Static method in class org.springframework.jdbc.datasource.embedded.OutputStreamFactory
Returns an OutputStream that ignores all data given to it.
getNoSuchMessageExceptionDescription(NoSuchMessageException) - Method in class org.springframework.web.servlet.tags.MessageTag
Return default exception message.
getNoSuchMessageExceptionDescription(NoSuchMessageException) - Method in class org.springframework.web.servlet.tags.ThemeTag
Return exception message that indicates the current theme.
getNotificationFilter() - Method in class org.springframework.jmx.support.NotificationListenerHolder
Return the NotificationFilter associated with the encapsulated NotificationFilter.
getNotificationInfo(Object, String) - Method in class org.springframework.jmx.export.assembler.AbstractConfigurableMBeanInfoAssembler
getNotificationInfo(Object, String) - Method in class org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler
Get the notification metadata for the MBean resource.
getNotificationInfo(Object, String) - Method in class org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler
Reads the ManagedNotification metadata from the Class of the managed resource and generates and returns the corresponding ModelMBeanNotificationInfo metadata.
getNotificationListener() - Method in class org.springframework.jmx.support.NotificationListenerHolder
Get the NotificationListener.
getNotificationTypes() - Method in class org.springframework.jmx.export.metadata.ManagedNotification
Return the list of notification types.
getNrOfElements() - Method in class org.springframework.beans.support.PagedListHolder
Return the total number of elements in the source list.
getNumberFormat(Locale) - Method in class org.springframework.format.number.AbstractNumberFormatter
Obtain a concrete NumberFormat for the specified locale.
getNumberFormat(Locale) - Method in class org.springframework.format.number.CurrencyFormatter
getNumberFormat(Locale) - Method in class org.springframework.format.number.NumberFormatter
getNumberFormat(Locale) - Method in class org.springframework.format.number.PercentFormatter
getObject() - Method in class org.springframework.aop.config.MethodLocatingFactoryBean
getObject() - Method in class org.springframework.aop.framework.AbstractSingletonProxyFactoryBean
getObject() - Method in class org.springframework.aop.framework.ProxyFactoryBean
Return a proxy.
getObject() - Method in class org.springframework.aop.scope.ScopedProxyFactoryBean
getObject() - Method in class org.springframework.beans.factory.config.AbstractFactoryBean
Expose the singleton instance or create a new prototype instance.
getObject(String) - Method in class org.springframework.beans.factory.config.BeanExpressionContext
getObject() - Method in class org.springframework.beans.factory.config.BeanReferenceFactoryBean
getObject() - Method in class org.springframework.beans.factory.config.CommonsLogFactoryBean
getObject() - Method in class org.springframework.beans.factory.config.FieldRetrievingFactoryBean
getObject() - Method in class org.springframework.beans.factory.config.MethodInvokingFactoryBean
Returns the same value each time if the singleton property is set to "true", otherwise returns the value returned from invoking the specified method on the fly.
getObject() - Method in class org.springframework.beans.factory.config.PropertiesFactoryBean
getObject() - Method in class org.springframework.beans.factory.config.PropertyPathFactoryBean
getObject() - Method in class org.springframework.beans.factory.config.ServiceLocatorFactoryBean
getObject() - Method in interface org.springframework.beans.factory.FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory.
getObject() - Method in interface org.springframework.beans.factory.ObjectFactory
Return an instance (possibly shared or independent) of the object managed by this factory.
getObject() - Method in class org.springframework.cache.ehcache.EhCacheFactoryBean
getObject() - Method in class org.springframework.cache.ehcache.EhCacheManagerFactoryBean
getObject() - Method in class org.springframework.context.support.ConversionServiceFactoryBean
getObject() - Method in class org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean
getObject() - Method in class org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean
getObject() - Method in class org.springframework.format.support.FormattingConversionServiceFactoryBean
getObject() - Method in class org.springframework.jca.support.LocalConnectionFactoryBean
getObject() - Method in class org.springframework.jca.support.ResourceAdapterFactoryBean
getObject() - Method in class org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactoryBean
getObject(int, Map) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getObject(int) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getObject(String, Map) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getObject(String) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getObject(int, Map) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as an Object.
getObject(int) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as an Object.
getObject(String, Map) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as an Object.
getObject(String) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as an Object.
getObject() - Method in class org.springframework.jms.remoting.JmsInvokerProxyFactoryBean
getObject() - Method in class org.springframework.jmx.access.MBeanProxyFactoryBean
getObject() - Method in class org.springframework.jmx.support.ConnectorServerFactoryBean
getObject() - Method in class org.springframework.jmx.support.MBeanServerConnectionFactoryBean
getObject() - Method in class org.springframework.jmx.support.MBeanServerFactoryBean
getObject() - Method in class org.springframework.jmx.support.WebSphereMBeanServerFactoryBean
getObject() - Method in class org.springframework.jndi.JndiObjectFactoryBean
Return the singleton JNDI object.
getObject() - Method in class org.springframework.orm.hibernate3.AbstractSessionFactoryBean
Return the singleton SessionFactory.
getObject() - Method in class org.springframework.orm.hibernate3.FilterDefinitionFactoryBean
getObject() - Method in class org.springframework.orm.ibatis.SqlMapClientFactoryBean
getObject() - Method in class org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean
Return the singleton PersistenceManagerFactory.
getObject() - Method in class org.springframework.orm.jdo.support.SpringPersistenceManagerProxyBean
getObject() - Method in class org.springframework.orm.jdo.support.StandardPersistenceManagerProxyBean
getObject() - Method in class org.springframework.orm.jdo.TransactionAwarePersistenceManagerFactoryProxy
getObject() - Method in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
Return the singleton EntityManagerFactory.
getObject() - Method in class org.springframework.orm.jpa.support.SharedEntityManagerBean
getObject() - Method in class org.springframework.oxm.xmlbeans.XmlOptionsFactoryBean
getObject() - Method in class org.springframework.remoting.caucho.BurlapProxyFactoryBean
getObject() - Method in class org.springframework.remoting.caucho.HessianProxyFactoryBean
getObject() - Method in class org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean
getObject() - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortProxyFactoryBean
Deprecated.
getObject() - Method in class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactoryBean
Deprecated.
getObject() - Method in class org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean
getObject() - Method in class org.springframework.remoting.jaxws.LocalJaxWsServiceFactoryBean
getObject() - Method in class org.springframework.remoting.rmi.JndiRmiProxyFactoryBean
getObject() - Method in class org.springframework.remoting.rmi.RmiProxyFactoryBean
getObject() - Method in class org.springframework.remoting.rmi.RmiRegistryFactoryBean
getObject() - Method in class org.springframework.remoting.support.SimpleHttpServerFactoryBean
getObject() - Method in class org.springframework.scheduling.commonj.TimerManagerFactoryBean
getObject() - Method in class org.springframework.scheduling.concurrent.ScheduledExecutorFactoryBean
getObject() - Method in class org.springframework.scheduling.concurrent.ThreadPoolExecutorFactoryBean
getObject() - Method in class org.springframework.scheduling.config.TaskExecutorFactoryBean
getObject() - Method in class org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean
getObject() - Method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
getObject() - Method in class org.springframework.scheduling.timer.MethodInvokingTimerTaskFactoryBean
Deprecated.
getObject() - Method in class org.springframework.scheduling.timer.TimerFactoryBean
Deprecated.
getObject() - Method in class org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean
getObject() - Method in class org.springframework.ui.velocity.VelocityEngineFactoryBean
getObject() - Method in class org.springframework.web.context.support.ServletContextAttributeFactoryBean
getObject() - Method in class org.springframework.web.context.support.ServletContextFactoryBean
Deprecated.
getObject() - Method in class org.springframework.web.context.support.ServletContextParameterFactoryBean
getObjectById(Object) - Method in interface org.springframework.orm.jdo.JdoOperations
Return the persistent instance with the given JDO object id, throwing an exception if not found.
getObjectById(Class<T>, Object) - Method in interface org.springframework.orm.jdo.JdoOperations
Return the persistent instance of the given entity class with the given id value, throwing an exception if not found.
getObjectById(Object) - Method in class org.springframework.orm.jdo.JdoTemplate
getObjectById(Class<T>, Object) - Method in class org.springframework.orm.jdo.JdoTemplate
getObjectClass(Object) - Method in class org.springframework.expression.spel.ast.SpelNodeImpl
getObjectClass(Object) - Method in interface org.springframework.expression.spel.SpelNode
Determine the class of the object passed in, unless it is already a class object.
getObjectCount() - Method in class org.springframework.aop.target.ThreadLocalTargetSource
getObjectCount() - Method in interface org.springframework.aop.target.ThreadLocalTargetSourceStats
Return the number of thread-bound objects created.
getObjectForBeanInstance(Object, String, String, RootBeanDefinition) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Get the object for the given bean instance, either the bean instance itself or its created object in case of a FactoryBean.
getObjectFromFactoryBean(FactoryBean, String, boolean) - Method in class org.springframework.beans.factory.support.FactoryBeanRegistrySupport
Obtain an object to expose from the given FactoryBean.
getObjectName(Object, String) - Method in class org.springframework.jmx.export.MBeanExporter
Retrieve the ObjectName for a bean.
getObjectName() - Method in class org.springframework.jmx.export.metadata.ManagedResource
Return the JMX ObjectName of this managed resource.
getObjectName(Object, String) - Method in class org.springframework.jmx.export.naming.IdentityNamingStrategy
Returns an instance of ObjectName based on the identity of the managed resource.
getObjectName(Object, String) - Method in class org.springframework.jmx.export.naming.KeyNamingStrategy
Attempts to retrieve the ObjectName via the given key, trying to find a mapped value in the mappings first.
getObjectName(Object, String) - Method in class org.springframework.jmx.export.naming.MetadataNamingStrategy
Reads the ObjectName from the source-level metadata associated with the managed resource's Class.
getObjectName(Object, String) - Method in interface org.springframework.jmx.export.naming.ObjectNamingStrategy
Obtain an ObjectName for the supplied bean.
getObjectName() - Method in interface org.springframework.jmx.export.naming.SelfNaming
Return the ObjectName for the implementing object.
getObjectName() - Method in class org.springframework.validation.AbstractBindingResult
getObjectName() - Method in exception org.springframework.validation.BindException
getObjectName() - Method in class org.springframework.validation.DataBinder
Return the name of the bound object.
getObjectName() - Method in interface org.springframework.validation.Errors
Return the name of the bound root object.
getObjectName() - Method in class org.springframework.validation.ObjectError
Return the name of the affected object.
getObjectName() - Method in class org.springframework.web.bind.EscapedErrors
getObjectToExport() - Method in class org.springframework.remoting.rmi.RmiBasedExporter
Determine the object to export: either the service object itself or a RmiInvocationWrapper in case of a non-RMI service object.
getObjectToExpose(ServiceLoader) - Method in class org.springframework.beans.factory.serviceloader.AbstractServiceLoaderBasedFactoryBean
Determine the actual object to expose for the given ServiceLoader.
getObjectToExpose(ServiceLoader) - Method in class org.springframework.beans.factory.serviceloader.ServiceFactoryBean
getObjectToExpose(ServiceLoader) - Method in class org.springframework.beans.factory.serviceloader.ServiceListFactoryBean
getObjectToExpose(ServiceLoader) - Method in class org.springframework.beans.factory.serviceloader.ServiceLoaderFactoryBean
getObjectType() - Method in class org.springframework.aop.config.MethodLocatingFactoryBean
getObjectType() - Method in class org.springframework.aop.framework.AbstractSingletonProxyFactoryBean
getObjectType() - Method in class org.springframework.aop.framework.ProxyFactoryBean
Return the type of the proxy.
getObjectType() - Method in class org.springframework.aop.scope.ScopedProxyFactoryBean
getObjectType() - Method in class org.springframework.beans.factory.config.AbstractFactoryBean
This abstract method declaration mirrors the method in the FactoryBean interface, for a consistent offering of abstract template methods.
getObjectType() - Method in class org.springframework.beans.factory.config.BeanReferenceFactoryBean
getObjectType() - Method in class org.springframework.beans.factory.config.CommonsLogFactoryBean
getObjectType() - Method in class org.springframework.beans.factory.config.FieldRetrievingFactoryBean
getObjectType() - Method in class org.springframework.beans.factory.config.ListFactoryBean
getObjectType() - Method in class org.springframework.beans.factory.config.MapFactoryBean
getObjectType() - Method in class org.springframework.beans.factory.config.MethodInvokingFactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.
getObjectType() - Method in class org.springframework.beans.factory.config.ObjectFactoryCreatingFactoryBean
getObjectType() - Method in class org.springframework.beans.factory.config.PropertiesFactoryBean
getObjectType() - Method in class org.springframework.beans.factory.config.PropertyPathFactoryBean
getObjectType() - Method in class org.springframework.beans.factory.config.ProviderCreatingFactoryBean
getObjectType() - Method in class org.springframework.beans.factory.config.ServiceLocatorFactoryBean
getObjectType() - Method in class org.springframework.beans.factory.config.SetFactoryBean
getObjectType() - Method in interface org.springframework.beans.factory.FactoryBean
Return the type of object that this FactoryBean creates, or null if not known in advance.
getObjectType() - Method in class org.springframework.beans.factory.serviceloader.ServiceFactoryBean
getObjectType() - Method in class org.springframework.beans.factory.serviceloader.ServiceListFactoryBean
getObjectType() - Method in class org.springframework.beans.factory.serviceloader.ServiceLoaderFactoryBean
getObjectType() - Method in class org.springframework.cache.ehcache.EhCacheFactoryBean
getObjectType() - Method in class org.springframework.cache.ehcache.EhCacheManagerFactoryBean
getObjectType() - Method in class org.springframework.context.support.ConversionServiceFactoryBean
getObjectType() - Method in class org.springframework.core.convert.TypeDescriptor
Determine the declared type of the wrapped parameter/field.
getObjectType() - Method in class org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean
getObjectType() - Method in class org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean
getObjectType() - Method in class org.springframework.format.support.FormattingConversionServiceFactoryBean
getObjectType() - Method in class org.springframework.jca.support.LocalConnectionFactoryBean
getObjectType() - Method in class org.springframework.jca.support.ResourceAdapterFactoryBean
getObjectType() - Method in class org.springframework.jdbc.config.SortedResourcesFactoryBean
getObjectType() - Method in class org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactoryBean
getObjectType() - Method in class org.springframework.jms.remoting.JmsInvokerProxyFactoryBean
getObjectType() - Method in class org.springframework.jmx.access.MBeanProxyFactoryBean
getObjectType() - Method in class org.springframework.jmx.support.ConnectorServerFactoryBean
getObjectType() - Method in class org.springframework.jmx.support.MBeanServerConnectionFactoryBean
getObjectType() - Method in class org.springframework.jmx.support.MBeanServerFactoryBean
getObjectType() - Method in class org.springframework.jmx.support.WebSphereMBeanServerFactoryBean
getObjectType() - Method in class org.springframework.jndi.JndiObjectFactoryBean
getObjectType() - Method in class org.springframework.orm.hibernate3.AbstractSessionFactoryBean
getObjectType() - Method in class org.springframework.orm.hibernate3.FilterDefinitionFactoryBean
getObjectType() - Method in class org.springframework.orm.ibatis.SqlMapClientFactoryBean
getObjectType() - Method in class org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean
getObjectType() - Method in class org.springframework.orm.jdo.support.SpringPersistenceManagerProxyBean
getObjectType() - Method in class org.springframework.orm.jdo.support.StandardPersistenceManagerProxyBean
getObjectType() - Method in class org.springframework.orm.jdo.TransactionAwarePersistenceManagerFactoryProxy
getObjectType() - Method in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
getObjectType() - Method in class org.springframework.orm.jpa.support.SharedEntityManagerBean
getObjectType() - Method in class org.springframework.oxm.xmlbeans.XmlOptionsFactoryBean
getObjectType() - Method in class org.springframework.remoting.caucho.BurlapProxyFactoryBean
getObjectType() - Method in class org.springframework.remoting.caucho.HessianProxyFactoryBean
getObjectType() - Method in class org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean
getObjectType() - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortProxyFactoryBean
Deprecated.
getObjectType() - Method in class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactoryBean
Deprecated.
getObjectType() - Method in class org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean
getObjectType() - Method in class org.springframework.remoting.jaxws.LocalJaxWsServiceFactoryBean
getObjectType() - Method in class org.springframework.remoting.rmi.JndiRmiProxyFactoryBean
getObjectType() - Method in class org.springframework.remoting.rmi.RmiProxyFactoryBean
getObjectType() - Method in class org.springframework.remoting.rmi.RmiRegistryFactoryBean
getObjectType() - Method in class org.springframework.remoting.support.SimpleHttpServerFactoryBean
getObjectType() - Method in class org.springframework.scheduling.commonj.TimerManagerFactoryBean
getObjectType() - Method in class org.springframework.scheduling.concurrent.ScheduledExecutorFactoryBean
getObjectType() - Method in class org.springframework.scheduling.concurrent.ThreadPoolExecutorFactoryBean
getObjectType() - Method in class org.springframework.scheduling.config.TaskExecutorFactoryBean
getObjectType() - Method in class org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean
getObjectType() - Method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
getObjectType() - Method in class org.springframework.scheduling.timer.MethodInvokingTimerTaskFactoryBean
Deprecated.
getObjectType() - Method in class org.springframework.scheduling.timer.TimerFactoryBean
Deprecated.
getObjectType() - Method in class org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean
getObjectType() - Method in class org.springframework.ui.velocity.VelocityEngineFactoryBean
getObjectType() - Method in class org.springframework.web.context.support.ServletContextAttributeFactoryBean
getObjectType() - Method in class org.springframework.web.context.support.ServletContextFactoryBean
Deprecated.
getObjectType() - Method in class org.springframework.web.context.support.ServletContextParameterFactoryBean
getObjectWrapper() - Method in class org.springframework.web.servlet.view.freemarker.FreeMarkerView
Return the configured FreeMarker ObjectWrapper, or the default wrapper if none specified.
getOnblur() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
Get the value of the 'onblur' attribute.
getOnchange() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
Get the value of the 'onchange' attribute.
getOnclick() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Get the value of the 'onclick' attribute.
getOndblclick() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Get the value of the 'ondblclick' attribute.
getOnfocus() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
Get the value of the 'onfocus' attribute.
getOnkeydown() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Get the value of the 'onkeydown' attribute.
getOnkeypress() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Get the value of the 'onkeypress' attribute.
getOnkeyup() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Get the value of the 'onkeyup' attribute.
getOnmousedown() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Get the value of the 'onmousedown' attribute.
getOnmousemove() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Get the value of the 'onmousemove' attribute.
getOnmouseout() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Get the value of the 'onmouseout' attribute.
getOnmouseover() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Get the value of the 'onmouseover' attribute.
getOnmouseup() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Get the value of the 'onmouseup' attribute.
getOnreset() - Method in class org.springframework.web.servlet.tags.form.FormTag
Get the value of the 'onreset' attribute.
getOnselect() - Method in class org.springframework.web.servlet.tags.form.InputTag
Get the value of the 'onselect' attribute.
getOnselect() - Method in class org.springframework.web.servlet.tags.form.TextareaTag
Get the value of the 'onselect' attribute.
getOnsubmit() - Method in class org.springframework.web.servlet.tags.form.FormTag
Get the value of the 'onsubmit' attribute.
getOpenJPAEntityManager(EntityManager) - Method in class org.springframework.orm.jpa.vendor.OpenJpaDialect
Return the OpenJPA-specific interface of EntityManager.
getOperationDescription(Method, String) - Method in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Get the description for a particular operation.
getOperationDescription(Method, String) - Method in class org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler
Retrieves the description for the supplied Method from the metadata.
getOperationInfo(Object, String) - Method in class org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler
Get the operation metadata for the MBean resource.
getOperationInfo(Object, String) - Method in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Iterate through all methods on the MBean class and gives subclasses the chance to vote on their inclusion.
getOperationParameters(Method, String) - Method in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Create parameter info for the given method.
getOperationParameters(Method, String) - Method in class org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler
Reads MBeanParameterInfo from the ManagedOperationParameter attributes attached to a method.
getOperatorName() - Method in class org.springframework.expression.spel.ast.Operator
getOperatorOverloader() - Method in interface org.springframework.expression.EvaluationContext
getOperatorOverloader() - Method in class org.springframework.expression.spel.support.StandardEvaluationContext
getOracleConnection(PreparedStatement) - Method in class org.springframework.jdbc.support.lob.OracleLobHandler.OracleLobCreator
Retrieve the underlying OracleConnection, using a NativeJdbcExtractor if set.
getOrCreateSessionAttribute(PortletSession, String, Class) - Static method in class org.springframework.web.portlet.util.PortletUtils
Get the specified session attribute under the PortletSession.PORTLET_SCOPE, creating and setting a new attribute if no existing found.
getOrCreateSessionAttribute(PortletSession, String, Class, int) - Static method in class org.springframework.web.portlet.util.PortletUtils
Get the specified session attribute in the given scope, creating and setting a new attribute if no existing found.
getOrCreateSessionAttribute(HttpSession, String, Class) - Static method in class org.springframework.web.util.WebUtils
Get the specified session attribute, creating and setting a new attribute if no existing found.
getOrder() - Method in class org.springframework.aop.aspectj.AbstractAspectJAdvice
getOrder() - Method in class org.springframework.aop.aspectj.annotation.BeanFactoryAspectInstanceFactory
Determine the order for this factory's target aspect, either an instance-specific order expressed through implementing the Ordered interface (only checked for singleton beans), or an order expressed through the Order annotation at the class level.
getOrder() - Method in class org.springframework.aop.aspectj.annotation.LazySingletonAspectInstanceFactoryDecorator
getOrder() - Method in class org.springframework.aop.aspectj.AspectJPointcutAdvisor
getOrder() - Method in class org.springframework.aop.aspectj.SimpleAspectInstanceFactory
Determine the order for this factory's aspect instance, either an instance-specific order expressed through implementing the Ordered interface, or a fallback order.
getOrder() - Method in class org.springframework.aop.aspectj.SingletonAspectInstanceFactory
Determine the order for this factory's aspect instance, either an instance-specific order expressed through implementing the Ordered interface, or a fallback order.
getOrder() - Method in class org.springframework.aop.config.SimpleBeanFactoryAwareAspectInstanceFactory
getOrder() - Method in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
getOrder() - Method in class org.springframework.aop.interceptor.AsyncExecutionInterceptor
getOrder() - Method in class org.springframework.aop.interceptor.ExposeInvocationInterceptor
getOrder() - Method in class org.springframework.aop.support.AbstractPointcutAdvisor
getOrder() - Method in class org.springframework.aop.support.DefaultIntroductionAdvisor
getOrder() - Method in class org.springframework.aop.support.StaticMethodMatcherPointcutAdvisor
getOrder() - Method in class org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor
getOrder() - Method in class org.springframework.beans.factory.annotation.CustomAutowireConfigurer
getOrder() - Method in class org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor
getOrder() - Method in class org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor
getOrder() - Method in class org.springframework.beans.factory.config.CustomEditorConfigurer
getOrder() - Method in class org.springframework.beans.factory.config.CustomScopeConfigurer
getOrder() - Method in class org.springframework.beans.factory.config.PropertyResourceConfigurer
getOrder() - Method in class org.springframework.context.annotation.ConfigurationClassPostProcessor
getOrder() - Method in class org.springframework.context.event.GenericApplicationListenerAdapter
getOrder() - Method in class org.springframework.context.event.SourceFilteringListener
getOrder() - Method in class org.springframework.context.weaving.AspectJWeavingEnabler
getOrder(Object) - Method in class org.springframework.core.annotation.AnnotationAwareOrderComparator
getOrder(Object) - Method in class org.springframework.core.OrderComparator
Determine the order value for the given object.
getOrder() - Method in interface org.springframework.core.Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.
getOrder() - Method in class org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor
getOrder() - Method in class org.springframework.jdbc.support.lob.SpringLobCreatorSynchronization
getOrder() - Method in class org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
getOrder() - Method in class org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcessor
getOrder() - Method in class org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor
getOrder() - Method in class org.springframework.scripting.support.ScriptFactoryPostProcessor
getOrder() - Method in class org.springframework.transaction.support.TransactionSynchronizationAdapter
getOrder() - Method in class org.springframework.web.portlet.handler.AbstractHandlerExceptionResolver
getOrder() - Method in class org.springframework.web.portlet.handler.AbstractHandlerMapping
getOrder() - Method in class org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter
getOrder() - Method in class org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
getOrder() - Method in class org.springframework.web.servlet.handler.AbstractHandlerMapping
getOrder() - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
getOrder() - Method in class org.springframework.web.servlet.view.BeanNameViewResolver
getOrder() - Method in class org.springframework.web.servlet.view.ContentNegotiatingViewResolver
getOrder() - Method in class org.springframework.web.servlet.view.ResourceBundleViewResolver
getOrder() - Method in class org.springframework.web.servlet.view.UrlBasedViewResolver
Return the order in which this ViewResolver is evaluated.
getOrder() - Method in class org.springframework.web.servlet.view.XmlViewResolver
getOrderForAspectClass(Class<?>) - Method in class org.springframework.aop.aspectj.annotation.SimpleMetadataAwareAspectInstanceFactory
Determine a fallback order for the case that the aspect instance does not express an instance-specific order through implementing the Ordered interface.
getOrderForAspectClass(Class<?>) - Method in class org.springframework.aop.aspectj.annotation.SingletonMetadataAwareAspectInstanceFactory
Check whether the aspect class carries an Order annotation, falling back to Ordered.LOWEST_PRECEDENCE.
getOrderForAspectClass(Class<?>) - Method in class org.springframework.aop.aspectj.SimpleAspectInstanceFactory
Determine a fallback order for the case that the aspect instance does not express an instance-specific order through implementing the Ordered interface.
getOrderForAspectClass(Class<?>) - Method in class org.springframework.aop.aspectj.SingletonAspectInstanceFactory
Determine a fallback order for the case that the aspect instance does not express an instance-specific order through implementing the Ordered interface.
getOriginalException() - Method in exception org.springframework.remoting.jaxrpc.JaxRpcSoapFaultException
Deprecated. Return the wrapped JAX-RPC SOAPFaultException.
getOriginalException() - Method in exception org.springframework.transaction.TransactionSystemException
Return the exception that was the first to be thrown within the failed transaction: i.e.
getOriginalFilename() - Method in class org.springframework.mock.web.MockMultipartFile
getOriginalFilename() - Method in class org.springframework.web.multipart.commons.CommonsMultipartFile
getOriginalFilename() - Method in interface org.springframework.web.multipart.MultipartFile
Return the original filename in the client's filesystem.
getOriginalPropertyValue() - Method in class org.springframework.beans.PropertyValue
Return the original PropertyValue instance for this value holder.
getOriginalVariableResolver() - Method in class org.springframework.web.jsf.DelegatingVariableResolver
Return the original JSF VariableResolver that this resolver delegates to.
getOriginalVariableResolver() - Method in class org.springframework.web.jsf.WebApplicationContextVariableResolver
Return the original JSF VariableResolver that this resolver delegates to.
getOriginatingBeanDefinition() - Method in interface org.springframework.beans.factory.config.BeanDefinition
Return the originating BeanDefinition, or null if none.
getOriginatingBeanDefinition() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
getOriginatingContextPath(HttpServletRequest) - Method in class org.springframework.web.util.UrlPathHelper
Return the context path for the given request, detecting an include request URL if called within a RequestDispatcher include.
getOriginatingQueryString(HttpServletRequest) - Method in class org.springframework.web.util.UrlPathHelper
Return the request URI for root of the given request.
getOriginatingRequestUri(HttpServletRequest) - Method in class org.springframework.web.util.UrlPathHelper
Return the request URI for root of the given request.
getOut() - Method in class org.springframework.mock.web.MockPageContext
getOutcomeState() - Method in exception org.springframework.transaction.HeuristicCompletionException
Return the outcome state of the transaction state, as one of the constants in this class.
getOutParameterNames() - Method in class org.springframework.jdbc.core.metadata.CallMetaDataContext
Get a list of the out parameter names.
getOutputRecordCreator() - Method in class org.springframework.jca.cci.core.CciTemplate
Return a RecordCreator that should be used for creating default output Records.
getOutputStream() - Method in class org.springframework.mock.web.MockHttpServletResponse
getOverride(Method) - Method in class org.springframework.beans.factory.support.MethodOverrides
Return the override for the given method, if any.
getOverrides() - Method in class org.springframework.beans.factory.support.MethodOverrides
Return all method overrides contained by this object.
getPackageName(Class<?>) - Static method in class org.springframework.util.ClassUtils
Determine the name of the package of the given class: e.g.
getPaddingLength() - Method in class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
Return the padding length for String values.
getPage() - Method in class org.springframework.beans.support.PagedListHolder
Return the current page number.
getPage() - Method in class org.springframework.mock.web.MockPageContext
getPageAttribute() - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Return the name of the page attribute in the model.
getPageAttribute() - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Return the name of the page attribute in the model.
getPageContext() - Method in class org.springframework.web.servlet.support.JspAwareRequestContext
Return the underlying PageContext.
getPageCount() - Method in class org.springframework.beans.support.PagedListHolder
Return the number of pages for the current source list.
getPageCount() - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Return the number of wizard pages.
getPageCount(PortletRequest, Object) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Return the page count for this wizard form controller.
getPageCount() - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Return the number of wizard pages.
getPageCount(HttpServletRequest, Object) - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Return the page count for this wizard form controller.
getPageList() - Method in class org.springframework.beans.support.PagedListHolder
Return a sub-list representing the current page.
getPages() - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Return the wizard pages, i.e.
getPages() - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Return the wizard pages, i.e.
getPageSessionAttributeName(PortletRequest) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Return the name of the PortletSession attribute that holds the page object for this wizard form controller.
getPageSessionAttributeName() - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Return the name of the PortletSession attribute that holds the page object for this wizard form controller.
getPageSessionAttributeName(HttpServletRequest) - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Return the name of the HttpSession attribute that holds the page object for this wizard form controller.
getPageSessionAttributeName() - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Return the name of the HttpSession attribute that holds the page object for this wizard form controller.
getPageSize() - Method in class org.springframework.beans.support.PagedListHolder
Return the current page size.
getParamConditions() - Method in exception org.springframework.web.bind.UnsatisfiedServletRequestParameterException
Return the parameter conditions that have been violated.
getParameter(String) - Method in class org.springframework.http.MediaType
Return a generic parameter value, given a parameter name.
getParameter(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
getParameter(String) - Method in class org.springframework.mock.web.portlet.MockBaseURL
getParameter(String) - Method in class org.springframework.mock.web.portlet.MockPortletRequest
getParameter(String) - Method in class org.springframework.web.context.request.FacesWebRequest
getParameter(String) - Method in class org.springframework.web.context.request.ServletWebRequest
getParameter(String) - Method in interface org.springframework.web.context.request.WebRequest
Return the request parameter of the given name, or null if none.
getParameter(String) - Method in class org.springframework.web.multipart.support.DefaultMultipartHttpServletRequest
getParameter(String) - Method in class org.springframework.web.portlet.context.PortletWebRequest
getParameter(String) - Method in class org.springframework.web.portlet.multipart.DefaultMultipartActionRequest
getParameterAnnotation(Class<T>) - Method in class org.springframework.core.MethodParameter
Return the parameter annotation of the given type, if available.
getParameterAnnotations() - Method in class org.springframework.core.MethodParameter
Return the annotations associated with the specific method/constructor parameter.
getParameterIndex() - Method in class org.springframework.core.MethodParameter
Return the index of the method/constructor parameter.
getParameterMap() - Method in class org.springframework.mock.web.MockHttpServletRequest
getParameterMap() - Method in class org.springframework.mock.web.portlet.MockBaseURL
getParameterMap() - Method in class org.springframework.mock.web.portlet.MockPortletRequest
getParameterMap() - Method in class org.springframework.web.context.request.FacesWebRequest
getParameterMap() - Method in class org.springframework.web.context.request.ServletWebRequest
getParameterMap() - Method in interface org.springframework.web.context.request.WebRequest
Return a immutable Map of the request parameters, with parameter names as map keys and parameter values as map values.
getParameterMap() - Method in class org.springframework.web.multipart.support.DefaultMultipartHttpServletRequest
getParameterMap() - Method in class org.springframework.web.portlet.context.PortletWebRequest
getParameterMap() - Method in class org.springframework.web.portlet.multipart.DefaultMultipartActionRequest
getParameterName() - Method in class org.springframework.core.MethodParameter
Return the name of the method/constructor parameter.
getParameterName() - Method in class org.springframework.jdbc.core.metadata.CallParameterMetaData
Get the parameter name.
getParameterName() - Method in class org.springframework.jdbc.core.metadata.TableParameterMetaData
Get the parameter name.
getParameterName() - Method in exception org.springframework.web.bind.MissingServletRequestParameterException
Return the name of the offending parameter.
getParameterName() - Method in exception org.springframework.web.portlet.bind.MissingPortletRequestParameterException
Return the name of the offending parameter.
getParameterNameDiscoverer() - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Return the ParameterNameDiscoverer to use for resolving method parameter names if needed.
getParameterNames(Method) - Method in class org.springframework.aop.aspectj.AspectJAdviceParameterNameDiscoverer
Deduce the parameter names for an advice method.
getParameterNames(Constructor) - Method in class org.springframework.aop.aspectj.AspectJAdviceParameterNameDiscoverer
An advice method can never be a constructor in Spring.
getParameterNames(Method) - Method in class org.springframework.core.LocalVariableTableParameterNameDiscoverer
getParameterNames(Constructor) - Method in class org.springframework.core.LocalVariableTableParameterNameDiscoverer
getParameterNames(Method) - Method in interface org.springframework.core.ParameterNameDiscoverer
Return parameter names for this method, or null if they cannot be determined.
getParameterNames(Constructor) - Method in interface org.springframework.core.ParameterNameDiscoverer
Return parameter names for this constructor, or null if they cannot be determined.
getParameterNames(Method) - Method in class org.springframework.core.PrioritizedParameterNameDiscoverer
getParameterNames(Constructor) - Method in class org.springframework.core.PrioritizedParameterNameDiscoverer
getParameterNames() - Method in class org.springframework.mock.web.MockHttpServletRequest
getParameterNames() - Method in class org.springframework.mock.web.portlet.MockBaseURL
getParameterNames() - Method in class org.springframework.mock.web.portlet.MockPortletRequest
getParameterNames() - Method in class org.springframework.web.context.request.FacesWebRequest
getParameterNames() - Method in class org.springframework.web.context.request.ServletWebRequest
getParameterNames() - Method in interface org.springframework.web.context.request.WebRequest
Return a Iterator over request parameter names.
getParameterNames() - Method in class org.springframework.web.multipart.support.DefaultMultipartHttpServletRequest
getParameterNames() - Method in class org.springframework.web.portlet.context.PortletWebRequest
getParameterNames() - Method in class org.springframework.web.portlet.multipart.DefaultMultipartActionRequest
getParameters() - Method in class org.springframework.orm.hibernate3.TypeDefinitionBean
Return the default parameters for the type.
getParameters(Map<String, Object>, HttpServletRequest) - Method in class org.springframework.web.servlet.view.xslt.AbstractXsltView
Deprecated. Return a Map of transformer parameters to be applied to the stylesheet.
getParameters(HttpServletRequest) - Method in class org.springframework.web.servlet.view.xslt.AbstractXsltView
Deprecated. Return a Map of transformer parameters to be applied to the stylesheet.
getParametersStartingWith(PortletRequest, String) - Static method in class org.springframework.web.portlet.util.PortletUtils
Return a map containing all parameters with the given prefix.
getParametersStartingWith(ServletRequest, String) - Static method in class org.springframework.web.util.WebUtils
Return a map containing all parameters with the given prefix.
getParameterType() - Method in class org.springframework.core.MethodParameter
Return the type of the method/constructor parameter.
getParameterType() - Method in class org.springframework.jdbc.core.metadata.CallParameterMetaData
Get the parameter type.
getParameterType() - Method in exception org.springframework.web.bind.MissingServletRequestParameterException
Return the expected type of the offending parameter.
getParameterType() - Method in exception org.springframework.web.portlet.bind.MissingPortletRequestParameterException
Return the expected type of the offending parameter.
getParameterTypes() - Method in class org.springframework.remoting.support.RemoteInvocation
Return the parameter types of the target method.
getParameterValues(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
getParameterValues(String) - Method in class org.springframework.mock.web.portlet.MockBaseURL
getParameterValues(String) - Method in class org.springframework.mock.web.portlet.MockPortletRequest
getParameterValues(String) - Method in class org.springframework.web.context.request.FacesWebRequest
getParameterValues(String) - Method in class org.springframework.web.context.request.ServletWebRequest
getParameterValues(String) - Method in interface org.springframework.web.context.request.WebRequest
Return the request parameter values for the given parameter name, or null if none.
getParameterValues(String) - Method in class org.springframework.web.multipart.support.DefaultMultipartHttpServletRequest
getParameterValues(String) - Method in class org.springframework.web.portlet.context.PortletWebRequest
getParameterValues(String) - Method in class org.springframework.web.portlet.multipart.DefaultMultipartActionRequest
getParamName() - Method in class org.springframework.web.servlet.i18n.LocaleChangeInterceptor
Return the name of the parameter that contains a locale specification in a locale change request.
getParamName() - Method in class org.springframework.web.servlet.theme.ThemeChangeInterceptor
Return the name of the parameter that contains a theme specification in a theme change request.
getParent() - Method in interface org.springframework.context.ApplicationContext
Return the parent context, or null if there is no parent and this is the root of the context hierarchy.
getParent() - Method in class org.springframework.context.support.AbstractApplicationContext
Return the parent context, or null if there is no parent (that is, this context is the root of the context hierarchy).
getParentBeanFactory() - Method in interface org.springframework.beans.factory.HierarchicalBeanFactory
Return the parent bean factory, or null if there is none.
getParentBeanFactory() - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
getParentBeanFactory() - Method in class org.springframework.context.support.AbstractApplicationContext
getParentMessageSource() - Method in interface org.springframework.context.HierarchicalMessageSource
Return the parent of this MessageSource, or null if none.
getParentMessageSource() - Method in class org.springframework.context.support.AbstractMessageSource
getParentMessageSource() - Method in class org.springframework.context.support.DelegatingMessageSource
getParentName() - Method in interface org.springframework.beans.factory.config.BeanDefinition
Return the name of the parent definition of this bean definition, if any.
getParentName() - Method in class org.springframework.beans.factory.support.ChildBeanDefinition
getParentName() - Method in class org.springframework.beans.factory.support.GenericBeanDefinition
getParentName() - Method in class org.springframework.beans.factory.support.RootBeanDefinition
getParentName(Element) - Method in class org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
Determine the name for the parent of the currently parsed bean, in case of the current bean being defined as a child bean.
getParentThemeSource() - Method in interface org.springframework.ui.context.HierarchicalThemeSource
Return the parent of this ThemeSource, or null if none.
getParentThemeSource() - Method in class org.springframework.ui.context.support.DelegatingThemeSource
getParentThemeSource() - Method in class org.springframework.ui.context.support.ResourceBundleThemeSource
getParsedSql(String) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
Obtain a parsed representation of the given SQL statement.
getParsedSql() - Method in class org.springframework.jdbc.object.SqlOperation
Obtain a parsed representation of this operation's SQL statement.
getParser(A, Class<?>) - Method in interface org.springframework.format.AnnotationFormatterFactory
Get the Parser to parse a submitted value for a field of fieldType annotated with annotation.
getParser(DateTimeFormat, Class<?>) - Method in class org.springframework.format.datetime.joda.JodaDateTimeFormatAnnotationFormatterFactory
getParser(NumberFormat, Class<?>) - Method in class org.springframework.format.number.NumberFormatAnnotationFormatterFactory
getParseState() - Method in class org.springframework.beans.factory.parsing.Problem
Get the ParseState at the time of the error (may be null).
getParticipateAttributeName() - Method in class org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor
Return the name of the request attribute that identifies that a request is already intercepted.
getParticipateAttributeName() - Method in class org.springframework.orm.jdo.support.OpenPersistenceManagerInViewInterceptor
Return the name of the request attribute that identifies that a request is already filtered.
getParticipateAttributeName() - Method in class org.springframework.orm.jpa.support.OpenEntityManagerInViewInterceptor
Return the name of the request attribute that identifies that a request is already filtered.
getPassword() - Method in class org.springframework.jdbc.datasource.AbstractDriverBasedDataSource
Return the JDBC password to use for connecting through the Driver.
getPassword() - Method in class org.springframework.mail.javamail.JavaMailSenderImpl
Return the password for the account at the mail host.
getPassword() - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Return the password to specify on the stub or call.
getPassword() - Method in class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
Return the password to specify on the stub.
getPath() - Method in class org.springframework.core.io.ClassPathResource
Return the path for this resource (as resource path within the class path).
getPath() - Method in class org.springframework.core.io.FileSystemResource
Return the file path for this resource.
getPath() - Method in class org.springframework.web.context.support.ServletContextResource
Return the path for this resource.
getPath() - Method in class org.springframework.web.portlet.context.PortletContextResource
Return the path for this resource.
getPath() - Method in class org.springframework.web.servlet.support.BindStatus
Return the bean and property path for which values and errors will be resolved (e.g.
getPath() - Method in class org.springframework.web.servlet.tags.BindTag
Return the path that this tag applies to.
getPath() - Method in class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
Get the resolved property path for the form object.
getPath() - Method in class org.springframework.web.servlet.tags.NestedPathTag
Return the path that this tag applies to.
getPathInfo() - Method in class org.springframework.mock.web.MockHttpServletRequest
getPathMatcher() - Method in class org.springframework.core.io.support.PathMatchingResourcePatternResolver
Return the PathMatcher that this resource pattern resolver uses.
getPathMatcher() - Method in class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
Return the PathMatcher implementation to use for matching URL paths against registered URL patterns.
getPathMatcher() - Method in class org.springframework.web.servlet.ResourceServlet
Return a PathMatcher to use for matching the "allowedResources" URL pattern.
getPathPatterns() - Method in class org.springframework.web.servlet.handler.MappedInterceptor
The path into the application the interceptor is mapped to.
getPathTranslated() - Method in class org.springframework.mock.web.MockHttpServletRequest
getPathWithinApplication(HttpServletRequest) - Method in class org.springframework.web.util.UrlPathHelper
Return the path within the web application for the given request.
getPathWithinContext() - Method in interface org.springframework.core.io.ContextResource
Return the path within the enclosing 'context'.
getPathWithinContext() - Method in class org.springframework.web.context.support.ServletContextResource
getPathWithinContext() - Method in class org.springframework.web.portlet.context.PortletContextResource
getPathWithinServletMapping(HttpServletRequest) - Method in class org.springframework.web.util.UrlPathHelper
Return the path within the servlet mapping for the given request, i.e.
getPatternComparator(String) - Method in class org.springframework.util.AntPathMatcher
Given a full path, returns a Comparator suitable for sorting patterns in order of explicitness.
getPatternComparator(String) - Method in interface org.springframework.util.PathMatcher
Given a full path, returns a Comparator suitable for sorting patterns in order of explicitness for that path.
getPatterns() - Method in class org.springframework.aop.support.AbstractRegexpMethodPointcut
Return the regular expressions for method matching.
getPausedTaskCount() - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
getPerClausePointcut() - Method in class org.springframework.aop.aspectj.annotation.AspectMetadata
Return a Spring pointcut expression for a singleton aspect.
getPeriod() - Method in class org.springframework.scheduling.commonj.ScheduledTimerListener
Return the period between repeated task executions.
getPeriod() - Method in class org.springframework.scheduling.concurrent.ScheduledExecutorTask
Return the period between repeated task executions.
getPeriod() - Method in class org.springframework.scheduling.timer.ScheduledTimerTask
Deprecated. Return the period between repeated task executions.
getPermissionDeniedCodes() - Method in class org.springframework.jdbc.support.SQLErrorCodes
getPersistenceContext(String, boolean) - Method in class org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
Return a specified persistence context for the given unit name, as defined through the "persistenceContexts" (or "extendedPersistenceContexts") map.
getPersistenceManager(PersistenceManagerFactory, boolean) - Static method in class org.springframework.orm.jdo.PersistenceManagerFactoryUtils
Obtain a JDO PersistenceManager via the given factory.
getPersistenceManager() - Method in class org.springframework.orm.jdo.PersistenceManagerHolder
getPersistenceManager() - Method in class org.springframework.orm.jdo.support.JdoDaoSupport
Get a JDO PersistenceManager, either from the current transaction or a new one.
getPersistenceManager(boolean) - Method in class org.springframework.orm.jdo.support.JdoDaoSupport
Get a JDO PersistenceManager, either from the current transaction or a new one.
getPersistenceManagerFactory() - Method in class org.springframework.orm.jdo.JdoAccessor
Return the JDO PersistenceManagerFactory that should be used to create PersistenceManagers.
getPersistenceManagerFactory() - Method in class org.springframework.orm.jdo.JdoTransactionManager
Return the PersistenceManagerFactory that this instance should manage transactions for.
getPersistenceManagerFactory() - Method in class org.springframework.orm.jdo.support.JdoDaoSupport
Return the JDO PersistenceManagerFactory used by this DAO.
getPersistenceManagerFactory() - Method in class org.springframework.orm.jdo.support.OpenPersistenceManagerInViewInterceptor
Return the JDO PersistenceManagerFactory that should be used to create PersistenceManagers.
getPersistenceManagerFactoryBeanName() - Method in class org.springframework.orm.jdo.support.OpenPersistenceManagerInViewFilter
Return the bean name of the PersistenceManagerFactory to fetch from Spring's root application context.
getPersistenceManagerInterface() - Method in class org.springframework.orm.jdo.support.SpringPersistenceManagerProxyBean
Return the PersistenceManager interface to expose.
getPersistenceProvider() - Method in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
getPersistenceProvider() - Method in interface org.springframework.orm.jpa.EntityManagerFactoryInfo
Return the underlying PersistenceProvider that the underlying EntityManagerFactory was created with.
getPersistenceProvider() - Method in interface org.springframework.orm.jpa.JpaVendorAdapter
Return the vendor-specific persistence provider.
getPersistenceProvider() - Method in class org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter
getPersistenceProvider() - Method in class org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter
getPersistenceProvider() - Method in class org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter
getPersistenceProvider() - Method in class org.springframework.orm.jpa.vendor.TopLinkJpaVendorAdapter
getPersistenceProviderClassName() - Method in class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo
getPersistenceProviderPackageName() - Method in class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo
getPersistenceProviderRootPackage() - Method in interface org.springframework.orm.jpa.JpaVendorAdapter
Return the name of the persistence provider's root package (e.g.
getPersistenceProviderRootPackage() - Method in class org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter
getPersistenceProviderRootPackage() - Method in class org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter
getPersistenceProviderRootPackage() - Method in class org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter
getPersistenceProviderRootPackage() - Method in class org.springframework.orm.jpa.vendor.TopLinkJpaVendorAdapter
getPersistenceUnit(String) - Method in class org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
Return a specified persistence unit for the given unit name, as defined through the "persistenceUnits" map.
getPersistenceUnitInfo() - Method in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
getPersistenceUnitInfo() - Method in interface org.springframework.orm.jpa.EntityManagerFactoryInfo
Return the PersistenceUnitInfo used to create this EntityManagerFactory, if the in-container API was used.
getPersistenceUnitInfo() - Method in class org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean
getPersistenceUnitInfo(String) - Method in class org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager
Return the specified PersistenceUnitInfo from this manager's cache of processed persistence units, keeping it in the cache (i.e.
getPersistenceUnitName() - Method in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
getPersistenceUnitName() - Method in interface org.springframework.orm.jpa.EntityManagerFactoryInfo
Return the name of the persistence unit used to create this EntityManagerFactory, or null if it is an unnamed default.
getPersistenceUnitName() - Method in class org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean
getPersistenceUnitName() - Method in class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo
getPersistenceUnitPostProcessors() - Method in class org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager
Return the PersistenceUnitPostProcessors to be applied to each PersistenceUnitInfo that has been parsed by this manager.
getPersistenceUnitRootUrl() - Method in class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo
getPersistenceXMLSchemaVersion() - Method in class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo
getPersistentClass() - Method in exception org.springframework.orm.ObjectOptimisticLockingFailureException
Return the persistent class of the object for which the locking failed.
getPersistentClass() - Method in exception org.springframework.orm.ObjectRetrievalFailureException
Return the persistent class of the object that was not found.
getPersistentClassName() - Method in exception org.springframework.orm.ObjectOptimisticLockingFailureException
Return the name of the persistent class of the object for which the locking failed.
getPersistentClassName() - Method in exception org.springframework.orm.ObjectRetrievalFailureException
Return the name of the persistent class of the object that was not found.
getPersistLocation() - Method in class org.springframework.jmx.export.metadata.ManagedResource
getPersistName() - Method in class org.springframework.jmx.export.metadata.ManagedResource
getPersistPeriod() - Method in class org.springframework.jmx.export.metadata.ManagedAttribute
getPersistPeriod() - Method in class org.springframework.jmx.export.metadata.ManagedMetric
The persist period for this metric.
getPersistPeriod() - Method in class org.springframework.jmx.export.metadata.ManagedResource
getPersistPolicy() - Method in class org.springframework.jmx.export.metadata.ManagedAttribute
getPersistPolicy() - Method in class org.springframework.jmx.export.metadata.ManagedMetric
The persist policy for this metric.
getPersistPolicy() - Method in class org.springframework.jmx.export.metadata.ManagedResource
getPhase() - Method in interface org.springframework.context.Phased
Return the phase value of this object.
getPhase(Lifecycle) - Method in class org.springframework.context.support.DefaultLifecycleProcessor
Determine the lifecycle phase of the given bean.
getPhase() - Method in class org.springframework.jca.endpoint.GenericMessageEndpointManager
Return the phase in which this endpoint manager will be started and stopped.
getPhase() - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Return the phase in which this container will be started and stopped.
getPhase() - Method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
Return the phase in which this scheduler will be started and stopped.
getPhaseId() - Method in class org.springframework.web.jsf.DelegatingPhaseListenerMulticaster
getPointcut() - Method in class org.springframework.aop.aspectj.AbstractAspectJAdvice
Return the AspectJ expression pointcut.
getPointcut() - Method in class org.springframework.aop.aspectj.AspectJExpressionPointcutAdvisor
getPointcut() - Method in class org.springframework.aop.aspectj.AspectJPointcutAdvisor
getPointcut() - Method in interface org.springframework.aop.PointcutAdvisor
Get the Pointcut that drives this advisor.
getPointcut() - Method in class org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor
getPointcut() - Method in class org.springframework.aop.support.DefaultPointcutAdvisor
getPointcut() - Method in class org.springframework.aop.support.NameMatchMethodPointcutAdvisor
getPointcut() - Method in class org.springframework.aop.support.RegexpMethodPointcutAdvisor
Initialize the singleton Pointcut held within this Advisor.
getPointcut() - Method in class org.springframework.aop.support.StaticMethodMatcherPointcutAdvisor
getPointcut() - Method in class org.springframework.dao.annotation.PersistenceExceptionTranslationAdvisor
getPointcut() - Method in class org.springframework.scheduling.annotation.AsyncAnnotationAdvisor
getPointcut() - Method in class org.springframework.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor
getPointcut() - Method in class org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor
getPointcutExpression() - Method in class org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory.AspectJAnnotation
getPointcutExpression() - Method in class org.springframework.aop.aspectj.AspectJExpressionPointcut
Return the underlying AspectJ pointcut expression.
getPoolingConfigMixin() - Method in class org.springframework.aop.target.AbstractPoolingTargetSource
Return an IntroductionAdvisor that providing a mixin exposing statistics about the pool maintained by this object.
getPoolSize() - Method in class org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor
Return the current pool size.
getPoolSize() - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
Return the current pool size.
getPoolSize() - Method in class org.springframework.scheduling.quartz.LocalTaskExecutorThreadPool
getPort() - Method in class org.springframework.mail.javamail.JavaMailSenderImpl
Return the mail server port.
getPort() - Method in class org.springframework.remoting.rmi.RmiRegistryFactoryBean
Return the port of the registry for the exported RMI service.
getPortalContext() - Method in class org.springframework.mock.web.portlet.MockPortletRequest
getPortalContext() - Method in class org.springframework.mock.web.portlet.MockPortletResponse
Return the PortalContext that this MockPortletResponse runs in, defining the supported PortletModes and WindowStates.
getPortalInfo() - Method in class org.springframework.mock.web.portlet.MockPortalContext
getPortInterface() - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Return the JAX-RPC port interface to use.
getPortletApplicationContext() - Method in class org.springframework.web.portlet.FrameworkPortlet
Return this portlet's ApplicationContext.
getPortletConfig() - Method in class org.springframework.web.portlet.context.AbstractRefreshablePortletApplicationContext
getPortletConfig() - Method in interface org.springframework.web.portlet.context.ConfigurablePortletApplicationContext
Return the PortletConfig for this portlet application context, if any.
getPortletConfig() - Method in class org.springframework.web.portlet.context.StaticPortletApplicationContext
getPortletContext() - Method in class org.springframework.mock.web.portlet.MockPortletConfig
getPortletContext() - Method in class org.springframework.mock.web.portlet.MockPortletSession
getPortletContext() - Method in class org.springframework.web.portlet.context.AbstractRefreshablePortletApplicationContext
getPortletContext() - Method in interface org.springframework.web.portlet.context.ConfigurablePortletApplicationContext
Return the standard Portlet API PortletContext for this application.
getPortletContext() - Method in class org.springframework.web.portlet.context.PortletApplicationObjectSupport
Return the current PortletContext.
getPortletContext() - Method in class org.springframework.web.portlet.context.PortletContextResource
Return the PortletContext for this resource.
getPortletContext() - Method in class org.springframework.web.portlet.context.StaticPortletApplicationContext
getPortletContext() - Method in class org.springframework.web.portlet.GenericPortletBean
Overridden method that simply returns null when no PortletConfig set yet.
getPortletContextAttributeName() - Method in class org.springframework.web.portlet.FrameworkPortlet
Return the PortletContext attribute name for this portlets's ApplicationContext.
getPortletContextName() - Method in class org.springframework.mock.web.portlet.MockPortletContext
getPortletContextName() - Method in class org.springframework.mock.web.portlet.ServletWrappingPortletContext
getPortletInputStream() - Method in class org.springframework.mock.web.portlet.MockClientDataRequest
getPortletMode() - Method in class org.springframework.mock.web.portlet.MockPortletRequest
getPortletMode() - Method in class org.springframework.mock.web.portlet.MockPortletURL
getPortletMode() - Method in class org.springframework.mock.web.portlet.MockStateAwareResponse
getPortletMode() - Method in class org.springframework.web.portlet.context.PortletRequestHandledEvent
Return the mode of the portlet request (usually 'view', 'edit', or 'help').
getPortletName() - Method in class org.springframework.mock.web.portlet.MockPortletConfig
getPortletName() - Method in class org.springframework.web.portlet.context.PortletRequestHandledEvent
Return the name of the portlet that handled the request.
getPortletName() - Method in class org.springframework.web.portlet.GenericPortletBean
Overridden method that simply returns null when no PortletConfig set yet.
getPortletOutputStream() - Method in class org.springframework.mock.web.portlet.MockMimeResponse
getPortletSession() - Method in class org.springframework.mock.web.portlet.MockPortletRequest
getPortletSession(boolean) - Method in class org.springframework.mock.web.portlet.MockPortletRequest
getPortName() - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Return the name of the port.
getPortName() - Method in class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
Return the name of the port.
getPortQName() - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Return the prepared QName for the port.
getPortQName() - Method in class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
Return the prepared QName for the port.
getPortStub() - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Return the underlying JAX-RPC port stub that this interceptor delegates to for each method invocation on the proxy.
getPortStub() - Method in class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
Return the underlying JAX-WS port stub that this interceptor delegates to for each method invocation on the proxy.
getPosition() - Method in exception org.springframework.expression.ExpressionException
getPossibleMatches() - Method in exception org.springframework.beans.NotWritablePropertyException
Return suggestions for actual bean property names that closely match the invalid property name, if any.
getPragma() - Method in class org.springframework.http.HttpHeaders
Returns the value of the Pragma header.
getPrecision(int) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSetMetaData
getPrecision(int) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSetMetaData
Retrieves the precision for the indicated column.
getPreferences() - Method in class org.springframework.mock.web.portlet.MockPortletRequest
getPrefetchSize() - Method in class org.springframework.jms.listener.endpoint.JmsActivationSpecConfig
Return the maximum number of messages to load into a session.
getPrefix() - Method in class org.springframework.aop.interceptor.AbstractMonitoringInterceptor
Return the text that will get appended to the trace data.
getPrefix(String) - Method in class org.springframework.util.xml.SimpleNamespaceContext
getPrefix() - Method in class org.springframework.validation.DefaultMessageCodesResolver
Return the prefix to be applied to any code built by this resolver.
getPrefix() - Method in class org.springframework.web.servlet.mvc.multiaction.InternalPathMethodNameResolver
Return the common prefix for handler method names.
getPrefix() - Method in class org.springframework.web.servlet.mvc.UrlFilenameViewController
Return the prefix to prepend to the request URL filename.
getPrefix() - Method in class org.springframework.web.servlet.view.UrlBasedViewResolver
Return the prefix that gets prepended to view names when building a URL.
getPrefixes(String) - Method in class org.springframework.util.xml.SimpleNamespaceContext
getPreparedMethod() - Method in class org.springframework.util.MethodInvoker
Return the prepared Method object that will be invoked.
getPreparedStatementCreator(String, SqlParameterSource) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
Build a PreparedStatementCreator based on the given SQL and named parameters.
getPreparer(String, TilesRequestContext) - Method in class org.springframework.web.servlet.view.tiles2.AbstractSpringPreparerFactory
getPreparer(String, WebApplicationContext) - Method in class org.springframework.web.servlet.view.tiles2.AbstractSpringPreparerFactory
Obtain a preparer instance for the given preparer name, based on the given Spring WebApplicationContext.
getPreparer(String, WebApplicationContext) - Method in class org.springframework.web.servlet.view.tiles2.SimpleSpringPreparerFactory
getPreparer(String, WebApplicationContext) - Method in class org.springframework.web.servlet.view.tiles2.SpringBeanPreparerFactory
getPreviousChild() - Method in class org.springframework.expression.spel.ast.SpelNodeImpl
getPreviousFlushMode() - Method in class org.springframework.orm.hibernate3.SessionHolder
getPreviousIsolationLevel() - Method in class org.springframework.jdbc.datasource.JdbcTransactionObjectSupport
getPrinter(A, Class<?>) - Method in interface org.springframework.format.AnnotationFormatterFactory
Get the Printer to print the value of a field of fieldType annotated with annotation.
getPrinter(DateTimeFormat, Class<?>) - Method in class org.springframework.format.datetime.joda.JodaDateTimeFormatAnnotationFormatterFactory
getPrinter(NumberFormat, Class<?>) - Method in class org.springframework.format.number.NumberFormatAnnotationFormatterFactory
getPriority() - Method in class org.springframework.jms.core.JmsTemplate
Return the priority of a message when sending.
getPrivateParameterMap() - Method in class org.springframework.mock.web.portlet.MockPortletRequest
getPrivateRenderParameterMap() - Method in class org.springframework.mock.web.portlet.MockResourceRequest
getProcedureName() - Method in class org.springframework.jdbc.core.metadata.CallMetaDataContext
Get the name of the procedure.
getProcedureName() - Method in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Get the name of the stored procedure.
getProcessingEventQNames() - Method in class org.springframework.mock.web.portlet.MockPortletConfig
getProcessingTimeMillis() - Method in class org.springframework.web.context.support.RequestHandledEvent
Return the processing time of the request in milliseconds.
getPropagationBehavior() - Method in class org.springframework.transaction.support.DefaultTransactionDefinition
getPropagationBehavior() - Method in class org.springframework.transaction.support.DelegatingTransactionDefinition
getPropagationBehavior() - Method in interface org.springframework.transaction.TransactionDefinition
Return the propagation behavior.
getProperties(String) - Method in class org.springframework.context.support.ReloadableResourceBundleMessageSource
Get a PropertiesHolder for the given filename, either from the cache or freshly loaded.
getProperties() - Method in class org.springframework.context.support.ReloadableResourceBundleMessageSource.PropertiesHolder
getProperties() - Method in class org.springframework.mock.web.portlet.MockBaseURL
getProperties(String) - Method in class org.springframework.mock.web.portlet.MockPortletRequest
getProperties(String) - Method in class org.springframework.mock.web.portlet.MockPortletResponse
getProperties() - Method in class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo
getPropertiesPersister() - Method in class org.springframework.beans.factory.support.PropertiesBeanDefinitionReader
Return the PropertiesPersister to use for parsing properties files.
getProperty() - Method in class org.springframework.beans.support.MutableSortDefinition
getProperty() - Method in interface org.springframework.beans.support.SortDefinition
Return the name of the bean property to compare.
getProperty(String) - Method in class org.springframework.context.support.ReloadableResourceBundleMessageSource.PropertiesHolder
getProperty(String) - Method in class org.springframework.mock.web.portlet.MockPortalContext
getProperty(String) - Method in class org.springframework.mock.web.portlet.MockPortletRequest
getProperty(String) - Method in class org.springframework.mock.web.portlet.MockPortletResponse
getProperty() - Method in class org.springframework.web.servlet.tags.BindTag
Retrieve the property that this tag is currently bound to, or null if bound to an object rather than a specific property.
getPropertyAccessException(String) - Method in exception org.springframework.beans.PropertyBatchUpdateException
Return the exception for this field, or null if there isn't any.
getPropertyAccessExceptions() - Method in exception org.springframework.beans.PropertyBatchUpdateException
Return an array of the propertyAccessExceptions stored in this object.
getPropertyAccessor() - Method in class org.springframework.validation.AbstractPropertyBindingResult
Provide the PropertyAccessor to work with, according to the concrete strategy of access.
getPropertyAccessor() - Method in class org.springframework.validation.BeanPropertyBindingResult
Returns the BeanWrapper that this instance uses.
getPropertyAccessor() - Method in class org.springframework.validation.DataBinder
Return the underlying PropertyAccessor of this binder's BindingResult.
getPropertyAccessor() - Method in class org.springframework.validation.DirectFieldBindingResult
Returns the DirectFieldAccessor that this instance uses.
getPropertyAccessors() - Method in interface org.springframework.expression.EvaluationContext
getPropertyAccessors() - Method in class org.springframework.expression.spel.ExpressionState
getPropertyAccessors() - Method in class org.springframework.expression.spel.support.StandardEvaluationContext
getPropertyAccessorsToTry(Class<?>, ExpressionState) - Static method in class org.springframework.expression.spel.ast.AstUtils
Determines the set of property resolvers that should be used to try and access a property on the specified target type.
getPropertyChangeEvent() - Method in exception org.springframework.beans.PropertyAccessException
Return the PropertyChangeEvent that resulted in the problem.
getPropertyDescriptor(Class<?>, String) - Static method in class org.springframework.beans.BeanUtils
Retrieve the JavaBeans PropertyDescriptors for the given property.
getPropertyDescriptor(String) - Method in interface org.springframework.beans.BeanWrapper
Obtain the property descriptor for a specific property of the wrapped object.
getPropertyDescriptor(String) - Method in class org.springframework.beans.BeanWrapperImpl
getPropertyDescriptor() - Method in class org.springframework.core.convert.support.PropertyTypeDescriptor
Return the underlying PropertyDescriptor.
getPropertyDescriptorInternal(String) - Method in class org.springframework.beans.BeanWrapperImpl
Internal version of BeanWrapperImpl.getPropertyDescriptor(java.lang.String): Returns null if not found rather than throwing an exception.
getPropertyDescriptors(Class<?>) - Static method in class org.springframework.beans.BeanUtils
Retrieve the JavaBeans PropertyDescriptors of a given class.
getPropertyDescriptors() - Method in interface org.springframework.beans.BeanWrapper
Obtain the PropertyDescriptors for the wrapped object (as determined by standard JavaBeans introspection).
getPropertyDescriptors() - Method in class org.springframework.beans.BeanWrapperImpl
getPropertyEditor() - Method in class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
Get the PropertyEditor, if any, in use for value bound to this tag.
getPropertyEditorRegistrars() - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Return the set of PropertyEditorRegistrars.
getPropertyEditorRegistrars() - Method in class org.springframework.web.bind.support.ConfigurableWebBindingInitializer
Return the PropertyEditorRegistrars to be applied to every DataBinder.
getPropertyEditorRegistrars() - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Return the PropertyEditorRegistrars (if any) to be applied to every DataBinder that this controller uses.
getPropertyEditorRegistrars() - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Return the PropertyEditorRegistrars (if any) to be applied to every DataBinder that this controller uses.
getPropertyEditorRegistry() - Method in class org.springframework.validation.AbstractBindingResult
This implementation returns null.
getPropertyEditorRegistry() - Method in class org.springframework.validation.AbstractPropertyBindingResult
Returns the underlying PropertyAccessor.
getPropertyEditorRegistry() - Method in exception org.springframework.validation.BindException
getPropertyEditorRegistry() - Method in interface org.springframework.validation.BindingResult
Return the underlying PropertyEditorRegistry.
getPropertyEditorRegistry() - Method in class org.springframework.validation.DataBinder
Return the underlying TypeConverter of this binder's BindingResult.
getPropertyName() - Method in exception org.springframework.beans.InvalidPropertyException
Return the name of the offending property.
getPropertyName() - Method in exception org.springframework.beans.PropertyAccessException
Return the name of the affected property, if available.
getPropertyName(String) - Static method in class org.springframework.beans.PropertyAccessorUtils
Return the actual property name for the given property path.
getPropertyNames() - Method in class org.springframework.mock.web.portlet.MockPortalContext
getPropertyNames() - Method in class org.springframework.mock.web.portlet.MockPortletRequest
getPropertyNames() - Method in class org.springframework.mock.web.portlet.MockPortletResponse
getPropertyPath() - Method in class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
Build the property path for this tag, including the nested path but not prefixed with the name of the form attribute.
getPropertyType(String) - Method in class org.springframework.beans.AbstractPropertyAccessor
getPropertyType(String) - Method in class org.springframework.beans.BeanWrapperImpl
getPropertyType(String) - Method in class org.springframework.beans.DirectFieldAccessor
getPropertyType(String) - Method in interface org.springframework.beans.PropertyAccessor
Determine the property type for the specified property, either checking the property descriptor or checking the value in case of an indexed or mapped element.
getPropertyType(String) - Method in class org.springframework.beans.PropertyEditorRegistrySupport
Determine the property type for the given property path.
getPropertyTypeDescriptor(String) - Method in class org.springframework.beans.BeanWrapperImpl
getPropertyTypeDescriptor(String) - Method in class org.springframework.beans.DirectFieldAccessor
getPropertyTypeDescriptor(String) - Method in interface org.springframework.beans.PropertyAccessor
Return a type descriptor for the specified property: preferably from the read method, falling back to the write method.
getPropertyValue(String) - Method in class org.springframework.beans.AbstractPropertyAccessor
Actually get the value of a property.
getPropertyValue(String) - Method in class org.springframework.beans.BeanWrapperImpl
getPropertyValue(String) - Method in class org.springframework.beans.DirectFieldAccessor
getPropertyValue(String) - Method in class org.springframework.beans.MutablePropertyValues
getPropertyValue(String) - Method in interface org.springframework.beans.PropertyAccessor
Get the current value of the specified property.
getPropertyValue(String) - Method in interface org.springframework.beans.PropertyValues
Return the property value with the given name, if any.
getPropertyValueList() - Method in class org.springframework.beans.MutablePropertyValues
Return the underlying List of PropertyValue objects in its raw form.
getPropertyValues() - Method in interface org.springframework.beans.factory.config.BeanDefinition
Return the property values to be applied to a new instance of the bean.
getPropertyValues() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Return property values for this bean (never null).
getPropertyValues() - Method in class org.springframework.beans.MutablePropertyValues
getPropertyValues() - Method in interface org.springframework.beans.PropertyValues
Return an array of the PropertyValue objects held in this object.
getProtocol() - Method in class org.springframework.mail.javamail.JavaMailSenderImpl
Return the mail protocol.
getProtocol() - Method in class org.springframework.mock.web.MockHttpServletRequest
getProxiedInterfaces() - Method in interface org.springframework.aop.framework.Advised
Return the interfaces proxied by the AOP proxy.
getProxiedInterfaces() - Method in class org.springframework.aop.framework.AdvisedSupport
getProxy() - Method in class org.springframework.aop.aspectj.annotation.AspectJProxyFactory
Create a new proxy according to the settings in this factory.
getProxy(ClassLoader) - Method in class org.springframework.aop.aspectj.annotation.AspectJProxyFactory
Create a new proxy according to the settings in this factory.
getProxy() - Method in interface org.springframework.aop.framework.AopProxy
Create a new proxy object.
getProxy(ClassLoader) - Method in interface org.springframework.aop.framework.AopProxy
Create a new proxy object.
getProxy() - Method in class org.springframework.aop.framework.ProxyFactory
Create a new proxy according to the settings in this factory.
getProxy(ClassLoader) - Method in class org.springframework.aop.framework.ProxyFactory
Create a new proxy according to the settings in this factory.
getProxy(Class<T>, Interceptor) - Static method in class org.springframework.aop.framework.ProxyFactory
Create a new proxy for the given interface and interceptor.
getProxy(Class<T>, TargetSource) - Static method in class org.springframework.aop.framework.ProxyFactory
Create a proxy for the specified TargetSource, implementing the specified interface.
getProxy(TargetSource) - Static method in class org.springframework.aop.framework.ProxyFactory
Create a proxy for the specified TargetSource that extends the target class of the TargetSource.
getProxy(AopProxy) - Method in class org.springframework.aop.framework.ProxyFactoryBean
Return the proxy object to expose.
getProxy() - Method in class org.springframework.aop.framework.ReflectiveMethodInvocation
getProxy() - Method in interface org.springframework.aop.ProxyMethodInvocation
Return the proxy that this method invocation was made through.
getProxy() - Method in class org.springframework.remoting.rmi.RemoteInvocationSerializingExporter
getProxyForService() - Method in class org.springframework.remoting.support.RemoteExporter
Get a proxy for the given service object, implementing the specified service interface.
getPublicParameterMap() - Method in class org.springframework.mock.web.portlet.MockPortletRequest
getPublicRenderParameterNames() - Method in class org.springframework.mock.web.portlet.MockPortletConfig
getPublishingEventQNames() - Method in class org.springframework.mock.web.portlet.MockPortletConfig
getQName() - Method in class org.springframework.mock.web.portlet.MockEvent
getQName(String) - Method in class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
Deprecated. Return a QName for the given name, relative to the namespace URI of this factory, if given.
getQName(String) - Method in class org.springframework.remoting.jaxws.LocalJaxWsServiceFactory
Return a QName for the given name, relative to the namespace URI of this factory, if given.
getQualifiedAttributeName(Class, String) - Static method in class org.springframework.core.Conventions
Return an attribute name qualified by the supplied enclosing Class.
getQualifiedMethodName(Method) - Static method in class org.springframework.util.ClassUtils
Return the qualified name of the given method, consisting of fully qualified interface/class name + "." + method name.
getQualifiedName(Class<?>) - Static method in class org.springframework.util.ClassUtils
Return the qualified name of the given class: usually simply the class name, but component type class name + "[]" for arrays.
getQualifier(String) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Return the qualifier mapped to the provided type name.
getQualifier() - Method in class org.springframework.transaction.interceptor.DefaultTransactionAttribute
Return a qualifier value associated with this transaction attribute.
getQualifier() - Method in class org.springframework.transaction.interceptor.DelegatingTransactionAttribute
getQualifier() - Method in interface org.springframework.transaction.interceptor.TransactionAttribute
Return a qualifier value associated with this transaction attribute.
getQualifiers() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Return all registered qualifiers.
getQualityValue() - Method in class org.springframework.http.MediaType
Return the quality value, as indicated by a q parameter, if any.
getQueryCacheRegion() - Method in class org.springframework.orm.hibernate3.HibernateTemplate
Return the name of the cache region for queries executed by this template.
getQueryString() - Method in class org.springframework.mock.web.MockHttpServletRequest
getQueryString() - Method in exception org.springframework.orm.hibernate3.HibernateQueryException
Return the HQL query string that was invalid.
getQueryString() - Method in class org.springframework.web.servlet.support.RequestContext
Return the query string of the current request, that is, the part after the request path.
getQueryTimeout() - Method in class org.springframework.jdbc.core.JdbcTemplate
Return the query timeout for statements that this JdbcTemplate executes.
getQueueCount() - Method in class org.springframework.jdbc.object.BatchSqlUpdate
Return the current number of statements or statement parameters in the queue.
getRawBeanDefinition() - Method in class org.springframework.beans.factory.support.BeanDefinitionBuilder
Return the current BeanDefinition object in its raw (unvalidated) form.
getRawConnection(Connection) - Static method in class org.springframework.jdbc.support.nativejdbc.C3P0NativeJdbcExtractor
This method is not meant to be used directly; it rather serves as callback method for C3P0's "rawConnectionOperation" API.
getRawFieldValue(String) - Method in class org.springframework.validation.AbstractBindingResult
getRawFieldValue(String) - Method in exception org.springframework.validation.BindException
getRawFieldValue(String) - Method in interface org.springframework.validation.BindingResult
Extract the raw field value for the given field.
getReadablePropertyNames() - Method in class org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource
Provide access to the property names of the wrapped bean.
getReader() - Method in class org.springframework.beans.factory.xml.XmlReaderContext
getReader() - Method in class org.springframework.core.io.support.EncodedResource
Open a java.io.Reader for the specified resource, using the specified encoding (if any).
getReader() - Method in class org.springframework.mock.web.MockBodyContent
getReader() - Method in class org.springframework.mock.web.MockHttpServletRequest
getReader() - Method in class org.springframework.mock.web.portlet.MockClientDataRequest
getReader(Object, String) - Method in class org.springframework.ui.freemarker.SpringTemplateLoader
getReaderContext() - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Get the XmlReaderContext associated with this helper instance.
getReaderContext() - Method in class org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader
Return the descriptor for the XML resource that this parser works on.
getReaderContext() - Method in class org.springframework.beans.factory.xml.ParserContext
getReadonly() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
Gets the value of the 'readonly' attribute.
getRealLiteral(String, int, boolean) - Static method in class org.springframework.expression.spel.ast.Literal
getRealPath(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
getRealPath(String) - Method in class org.springframework.mock.web.MockServletContext
getRealPath(String) - Method in class org.springframework.mock.web.portlet.MockPortletContext
getRealPath(String) - Method in class org.springframework.mock.web.portlet.ServletWrappingPortletContext
getRealPath(PortletContext, String) - Static method in class org.springframework.web.portlet.util.PortletUtils
Return the real path of the given path within the web application, as provided by the portlet container.
getRealPath(ServletContext, String) - Static method in class org.springframework.web.util.WebUtils
Return the real path of the given path within the web application, as provided by the servlet container.
getReceiveTimeout() - Method in class org.springframework.jms.core.JmsTemplate
Return the timeout to use for receive calls (in milliseconds).
getReceiveTimeout() - Method in class org.springframework.jms.remoting.JmsInvokerClientInterceptor
Return the timeout to use for receiving the response message for a request (in milliseconds).
getRecordFactory() - Method in class org.springframework.jca.cci.connection.DelegatingConnectionFactory
getRecordFactory(ConnectionFactory) - Method in class org.springframework.jca.cci.core.CciTemplate
Return a RecordFactory for the given ConnectionFactory.
getRecordName() - Method in class org.springframework.jca.cci.core.support.CommAreaRecord
getRecordShortDescription() - Method in class org.springframework.jca.cci.core.support.CommAreaRecord
getRedirectedUrl() - Method in class org.springframework.mock.web.MockHttpServletResponse
getRedirectedUrl() - Method in class org.springframework.mock.web.portlet.MockActionResponse
getRefCursorSqlType() - Method in interface org.springframework.jdbc.core.metadata.CallMetaDataProvider
Get the Types type for columns that return resultsets as ref cursors if this feature is supported.
getRefCursorSqlType() - Method in class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
getRefCursorSqlType() - Method in class org.springframework.jdbc.core.metadata.OracleCallMetaDataProvider
getRefCursorSqlType() - Method in class org.springframework.jdbc.core.metadata.PostgresCallMetaDataProvider
getReference() - Method in class org.springframework.jca.cci.connection.DelegatingConnectionFactory
getReference(Class<T>, Object) - Method in interface org.springframework.orm.jpa.JpaOperations
getReference(Class<T>, Object) - Method in class org.springframework.orm.jpa.JpaTemplate
getRefreshCount() - Method in class org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource
getRefreshCount() - Method in interface org.springframework.aop.target.dynamic.Refreshable
Return the number of actual refreshes since startup.
getRefreshDate() - Method in class org.springframework.beans.support.PagedListHolder
Return the last time the list has been fetched from the source provider.
getRefreshTimestamp() - Method in class org.springframework.context.support.ReloadableResourceBundleMessageSource.PropertiesHolder
getRegisteredObjectNames() - Method in class org.springframework.jmx.support.MBeanRegistrationSupport
Return the ObjectNames of all registered beans.
getRegisteredScope(String) - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Return the Scope implementation for the given scope name, if any.
getRegisteredScope(String) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
getRegisteredScopeNames() - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Return the names of all currently registered scopes.
getRegisteredScopeNames() - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
getRegistry() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinitionReader
getRegistry() - Method in interface org.springframework.beans.factory.support.BeanDefinitionReader
Return the bean factory to register the bean definitions with.
getRegistry() - Method in class org.springframework.beans.factory.xml.ParserContext
getRegistry() - Method in class org.springframework.beans.factory.xml.XmlReaderContext
getRegistry() - Method in class org.springframework.context.annotation.AnnotatedBeanDefinitionReader
Return the BeanDefinitionRegistry that this scanner operates on.
getRegistry() - Method in class org.springframework.context.annotation.ClassPathBeanDefinitionScanner
Return the BeanDefinitionRegistry that this scanner operates on.
getRegistry(String, int, RMIClientSocketFactory, RMIServerSocketFactory) - Method in class org.springframework.remoting.rmi.RmiRegistryFactoryBean
Locate or create the RMI registry.
getRegistry(int, RMIClientSocketFactory, RMIServerSocketFactory) - Method in class org.springframework.remoting.rmi.RmiRegistryFactoryBean
Locate or create the RMI registry.
getRegistry(int) - Method in class org.springframework.remoting.rmi.RmiRegistryFactoryBean
Locate or create the RMI registry.
getRegistry(String, int, RMIClientSocketFactory, RMIServerSocketFactory) - Method in class org.springframework.remoting.rmi.RmiServiceExporter
Locate or create the RMI registry for this exporter.
getRegistry(int, RMIClientSocketFactory, RMIServerSocketFactory) - Method in class org.springframework.remoting.rmi.RmiServiceExporter
Locate or create the RMI registry for this exporter.
getRegistry(int) - Method in class org.springframework.remoting.rmi.RmiServiceExporter
Locate or create the RMI registry for this exporter.
getRejectedValue() - Method in class org.springframework.validation.FieldError
Return the rejected field value.
getRelatedCauses() - Method in exception org.springframework.beans.factory.BeanCreationException
Return the related causes, if any.
getRemaining() - Method in class org.springframework.mock.web.MockBodyContent
getRemaining() - Method in class org.springframework.mock.web.MockJspWriter
getRemoteAddr() - Method in class org.springframework.mock.web.MockHttpServletRequest
getRemoteHost() - Method in class org.springframework.mock.web.MockHttpServletRequest
getRemoteInvocationExecutor() - Method in class org.springframework.remoting.support.RemoteInvocationBasedExporter
Return the RemoteInvocationExecutor used by this exporter.
getRemoteInvocationFactory() - Method in class org.springframework.remoting.rmi.JndiRmiClientInterceptor
Return the RemoteInvocationFactory used by this accessor.
getRemoteInvocationFactory() - Method in class org.springframework.remoting.support.RemoteInvocationBasedAccessor
Return the RemoteInvocationFactory used by this accessor.
getRemotePort() - Method in class org.springframework.mock.web.MockHttpServletRequest
getRemoteUser() - Method in class org.springframework.mock.web.MockHttpServletRequest
getRemoteUser() - Method in class org.springframework.mock.web.portlet.MockPortletRequest
getRemoteUser() - Method in class org.springframework.web.context.request.FacesWebRequest
getRemoteUser() - Method in class org.springframework.web.context.request.ServletWebRequest
getRemoteUser() - Method in interface org.springframework.web.context.request.WebRequest
Return the remote user for this request, if any.
getRemoteUser() - Method in class org.springframework.web.portlet.context.PortletWebRequest
getRenderCommand(RenderRequest) - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Get the command object cached for the render phase.
getRenderCommandSessionAttributeName() - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Return the name of the session attribute that holds the render phase command object for this form controller.
getRenderErrors(RenderRequest) - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Get the bind and validation errors cached for the render phase.
getRenderErrorsSessionAttributeName() - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Return the name of the session attribute that holds the render phase command object for this form controller.
getRenderParameter(String) - Method in class org.springframework.mock.web.portlet.MockStateAwareResponse
getRenderParameterMap() - Method in class org.springframework.mock.web.portlet.MockStateAwareResponse
getRenderParameterNames() - Method in class org.springframework.mock.web.portlet.MockStateAwareResponse
getRenderParameters() - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Returns the list of parameters that will be passed forward from the action phase to the render phase whenever the form is rerendered or when AbstractFormController.passRenderParameters(javax.portlet.ActionRequest, javax.portlet.ActionResponse) is called.
getRenderParameterValues(String) - Method in class org.springframework.mock.web.portlet.MockStateAwareResponse
getReplyTo() - Method in class org.springframework.mail.SimpleMailMessage
getReport() - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
Determine the JasperReport to fill.
getReportData(Map<String, Object>) - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
Create an appropriate JRDataSource for passed-in report data.
getReportDataTypes() - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
Return the value types that can be converted to a JRDataSource, in prioritized order.
getRequest() - Method in class org.springframework.mock.web.MockFilterChain
Return the request that MockFilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) has been called with.
getRequest() - Method in class org.springframework.mock.web.MockPageContext
getRequest() - Method in class org.springframework.web.context.request.ServletRequestAttributes
Exposes the native HttpServletRequest that we're wrapping.
getRequest() - Method in class org.springframework.web.portlet.context.PortletRequestAttributes
Exposes the native PortletRequest that we're wrapping.
getRequest() - Method in class org.springframework.web.servlet.support.RequestContext
Return the underlying HttpServletRequest.
getRequestAttributes() - Static method in class org.springframework.web.context.request.RequestContextHolder
Return the RequestAttributes currently bound to the thread.
getRequestContext() - Method in class org.springframework.web.servlet.tags.RequestContextAwareTag
Return the current RequestContext.
getRequestContextAttribute() - Method in class org.springframework.web.servlet.view.AbstractView
Return the name of the RequestContext attribute, if any.
getRequestContextAttribute() - Method in class org.springframework.web.servlet.view.UrlBasedViewResolver
Return the name of the RequestContext attribute for all views, if any.
getRequestDispatcher(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
getRequestDispatcher(String) - Method in class org.springframework.mock.web.MockServletContext
getRequestDispatcher(String) - Method in class org.springframework.mock.web.portlet.MockPortletContext
getRequestDispatcher(String) - Method in class org.springframework.mock.web.portlet.ServletWrappingPortletContext
getRequestedSessionId() - Method in class org.springframework.mock.web.MockHttpServletRequest
getRequestedSessionId() - Method in class org.springframework.mock.web.portlet.MockPortletRequest
getRequestFactory() - Method in class org.springframework.http.client.support.HttpAccessor
Return the request factory that this accessor uses for obtaining HttpRequests.
getRequestToExpose(HttpServletRequest) - Method in class org.springframework.web.servlet.view.InternalResourceView
Get the request handle to expose to the RequestDispatcher, i.e.
getRequestType() - Method in class org.springframework.web.portlet.context.PortletRequestHandledEvent
Return the the type of Portlet Request ('action' or 'render').
getRequestURI() - Method in class org.springframework.mock.web.MockHttpServletRequest
getRequestUri() - Method in class org.springframework.web.servlet.support.RequestContext
Return the request URI of the original request, that is, the invoked URL without parameters.
getRequestUri(HttpServletRequest) - Method in class org.springframework.web.util.UrlPathHelper
Return the request URI for the given request, detecting an include request URL if called within a RequestDispatcher include.
getRequestURL() - Method in class org.springframework.mock.web.MockHttpServletRequest
getRequestUrl() - Method in class org.springframework.web.context.support.ServletRequestHandledEvent
Return the URL of the request.
getRequiredAnnotationType() - Method in class org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor
Return the 'required' annotation type.
getRequiredBindingResult(Map, String) - Static method in class org.springframework.validation.BindingResultUtils
Find a required BindingResult for the given name in the given model.
getRequiredBooleanParameter(ServletRequest, String) - Static method in class org.springframework.web.bind.ServletRequestUtils
Get a boolean parameter, throwing an exception if it isn't found or isn't a boolean.
getRequiredBooleanParameter(PortletRequest, String) - Static method in class org.springframework.web.portlet.bind.PortletRequestUtils
Get a boolean parameter, throwing an exception if it isn't found or isn't a boolean.
getRequiredBooleanParameters(ServletRequest, String) - Static method in class org.springframework.web.bind.ServletRequestUtils
Get an array of boolean parameters, throwing an exception if not found or one isn't a boolean.
getRequiredBooleanParameters(PortletRequest, String) - Static method in class org.springframework.web.portlet.bind.PortletRequestUtils
Get an array of boolean parameters, throwing an exception if not found or one isn't a boolean.
getRequiredDoubleParameter(ServletRequest, String) - Static method in class org.springframework.web.bind.ServletRequestUtils
Get a double parameter, throwing an exception if it isn't found or isn't a number.
getRequiredDoubleParameter(PortletRequest, String) - Static method in class org.springframework.web.portlet.bind.PortletRequestUtils
Get a double parameter, throwing an exception if it isn't found or isn't a number.
getRequiredDoubleParameters(ServletRequest, String) - Static method in class org.springframework.web.bind.ServletRequestUtils
Get an array of double parameters, throwing an exception if not found or one is not a number.
getRequiredDoubleParameters(PortletRequest, String) - Static method in class org.springframework.web.portlet.bind.PortletRequestUtils
Get an array of double parameters, throwing an exception if not found or one is not a number.
getRequiredFields() - Method in class org.springframework.validation.DataBinder
Return the fields that are required for each binding process.
getRequiredFloatParameter(ServletRequest, String) - Static method in class org.springframework.web.bind.ServletRequestUtils
Get a float parameter, throwing an exception if it isn't found or isn't a number.
getRequiredFloatParameter(PortletRequest, String) - Static method in class org.springframework.web.portlet.bind.PortletRequestUtils
Get a float parameter, throwing an exception if it isn't found or isn't a number.
getRequiredFloatParameters(ServletRequest, String) - Static method in class org.springframework.web.bind.ServletRequestUtils
Get an array of float parameters, throwing an exception if not found or one is not a number.
getRequiredFloatParameters(PortletRequest, String) - Static method in class org.springframework.web.portlet.bind.PortletRequestUtils
Get an array of float parameters, throwing an exception if not found or one is not a number.
getRequiredIntParameter(ServletRequest, String) - Static method in class org.springframework.web.bind.ServletRequestUtils
Get an int parameter, throwing an exception if it isn't found or isn't a number.
getRequiredIntParameter(PortletRequest, String) - Static method in class org.springframework.web.portlet.bind.PortletRequestUtils
Get an int parameter, throwing an exception if it isn't found or isn't a number.
getRequiredIntParameters(ServletRequest, String) - Static method in class org.springframework.web.bind.ServletRequestUtils
Get an array of int parameters, throwing an exception if not found or one is not a number..
getRequiredIntParameters(PortletRequest, String) - Static method in class org.springframework.web.portlet.bind.PortletRequestUtils
Get an array of int parameters, throwing an exception if not found or one is not a number..
getRequiredLongParameter(ServletRequest, String) - Static method in class org.springframework.web.bind.ServletRequestUtils
Get a long parameter, throwing an exception if it isn't found or isn't a number.
getRequiredLongParameter(PortletRequest, String) - Static method in class org.springframework.web.portlet.bind.PortletRequestUtils
Get a long parameter, throwing an exception if it isn't found or isn't a number.
getRequiredLongParameters(ServletRequest, String) - Static method in class org.springframework.web.bind.ServletRequestUtils
Get an array of long parameters, throwing an exception if not found or one is not a number.
getRequiredLongParameters(PortletRequest, String) - Static method in class org.springframework.web.portlet.bind.PortletRequestUtils
Get an array of long parameters, throwing an exception if not found or one is not a number.
getRequiredSessionAttribute(PortletRequest, String) - Static method in class org.springframework.web.portlet.util.PortletUtils
Check the given request for a session attribute of the given name under the PortletSession.PORTLET_SCOPE.
getRequiredSessionAttribute(PortletRequest, String, int) - Static method in class org.springframework.web.portlet.util.PortletUtils
Check the given request for a session attribute of the given name in the given scope.
getRequiredSessionAttribute(HttpServletRequest, String) - Static method in class org.springframework.web.util.WebUtils
Check the given request for a session attribute of the given name.
getRequiredStringParameter(ServletRequest, String) - Static method in class org.springframework.web.bind.ServletRequestUtils
Get a String parameter, throwing an exception if it isn't found.
getRequiredStringParameter(PortletRequest, String) - Static method in class org.springframework.web.portlet.bind.PortletRequestUtils
Get a String parameter, throwing an exception if it isn't found or is empty.
getRequiredStringParameters(ServletRequest, String) - Static method in class org.springframework.web.bind.ServletRequestUtils
Get an array of String parameters, throwing an exception if not found.
getRequiredStringParameters(PortletRequest, String) - Static method in class org.springframework.web.portlet.bind.PortletRequestUtils
Get an array of String parameters, throwing an exception if not found or one is empty.
getRequiredType() - Method in exception org.springframework.beans.factory.BeanNotOfRequiredTypeException
Return the expected type for the bean.
getRequiredType() - Method in exception org.springframework.beans.TypeMismatchException
Return the required target type, if any.
getRequiredType() - Method in exception org.springframework.jndi.TypeMismatchNamingException
Return the required type for the lookup, if available.
getRequiredWebApplicationContext(ServletContext) - Static method in class org.springframework.web.context.support.WebApplicationContextUtils
Find the root WebApplicationContext for this web application, which is typically loaded via ContextLoaderListener.
getRequiredWebApplicationContext(FacesContext) - Static method in class org.springframework.web.jsf.FacesContextUtils
Find the root WebApplicationContext for this web app, which is typically loaded via ContextLoaderListener or ContextLoaderServlet.
getRequiredWebApplicationContext(PortletContext) - Static method in class org.springframework.web.portlet.context.PortletApplicationContextUtils
Find the root WebApplicationContext for this portlet application, which is typically loaded via ContextLoaderListener or ContextLoaderServlet.
getRequiredWebApplicationContext(ActionServlet, ModuleConfig) - Static method in class org.springframework.web.struts.DelegatingActionUtils
Deprecated. Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext.
getResolvedAutowireMode() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Return the resolved autowire code, (resolving AUTOWIRE_AUTODETECT to AUTOWIRE_CONSTRUCTOR or AUTOWIRE_BY_TYPE).
getResolvedFactoryMethod() - Method in class org.springframework.beans.factory.support.RootBeanDefinition
Return the resolved factory method as a Java Method object, if available.
getResolvedObjectNames() - Method in class org.springframework.jmx.support.NotificationListenerHolder
Return the list of ObjectName String representations for which the encapsulated NotificationFilter will be registered as a listener for Notifications.
getResource() - Method in class org.springframework.beans.factory.parsing.Location
Get the resource with which this location is associated.
getResource() - Method in class org.springframework.beans.factory.parsing.ReaderContext
getResource() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Return the resource that this bean definition came from.
getResource(CommonAnnotationBeanPostProcessor.LookupElement, String) - Method in class org.springframework.context.annotation.CommonAnnotationBeanPostProcessor
Obtain the resource object for the given name and type.
getResource(String) - Method in class org.springframework.context.support.GenericApplicationContext
This implementation delegates to this context's ResourceLoader if set, falling back to the default superclass behavior else.
getResource(String) - Method in class org.springframework.core.io.DefaultResourceLoader
getResource(String) - Method in interface org.springframework.core.io.ResourceLoader
Return a Resource handle for the specified resource.
getResource() - Method in class org.springframework.core.io.support.EncodedResource
Return the Resource held.
getResource(String) - Method in class org.springframework.core.io.support.PathMatchingResourcePatternResolver
getResource() - Method in interface org.springframework.core.type.classreading.MetadataReader
Return the resource reference for the class file.
getResource(String) - Method in class org.springframework.instrument.classloading.ResourceOverridingShadowingClassLoader
getResource(String) - Method in class org.springframework.instrument.classloading.ShadowingClassLoader
getResource(String) - Method in class org.springframework.mock.web.MockServletContext
getResource(String) - Method in class org.springframework.mock.web.portlet.MockPortletContext
getResource(String) - Method in class org.springframework.mock.web.portlet.ServletWrappingPortletContext
getResource(String) - Method in class org.springframework.scheduling.quartz.ResourceLoaderClassLoadHelper
getResource() - Method in class org.springframework.scripting.support.ResourceScriptSource
Return the Resource to load the script from.
getResource(Object) - Static method in class org.springframework.transaction.support.TransactionSynchronizationManager
Retrieve a resource for the given key that is bound to the current thread.
getResourceAdapter() - Method in class org.springframework.jca.endpoint.GenericMessageEndpointManager
Return the JCA ResourceAdapter to manage endpoints for.
getResourceAsStream(String) - Method in class org.springframework.instrument.classloading.ResourceOverridingShadowingClassLoader
getResourceAsStream(String) - Method in class org.springframework.instrument.classloading.ShadowingClassLoader
getResourceAsStream(String) - Method in class org.springframework.mock.web.MockServletContext
getResourceAsStream(String) - Method in class org.springframework.mock.web.portlet.MockPortletContext
getResourceAsStream(String) - Method in class org.springframework.mock.web.portlet.ServletWrappingPortletContext
getResourceAsStream(String) - Method in class org.springframework.scheduling.quartz.ResourceLoaderClassLoadHelper
getResourceBundle(String, Locale) - Method in class org.springframework.context.support.ResourceBundleMessageSource
Return a ResourceBundle for the given basename and code, fetching already generated MessageFormats from the cache.
getResourceBundle(Locale) - Method in class org.springframework.mock.web.portlet.MockPortletConfig
getResourceByPath(String) - Method in class org.springframework.context.support.FileSystemXmlApplicationContext
Resolve resource paths as file system paths.
getResourceByPath(String) - Method in class org.springframework.core.io.ClassRelativeResourceLoader
getResourceByPath(String) - Method in class org.springframework.core.io.DefaultResourceLoader
Return a Resource handle for the resource at the given path.
getResourceByPath(String) - Method in class org.springframework.core.io.FileSystemResourceLoader
Resolve resource paths as file system paths.
getResourceByPath(String) - Method in class org.springframework.web.context.support.AbstractRefreshableWebApplicationContext
This implementation supports file paths beneath the root of the ServletContext.
getResourceByPath(String) - Method in class org.springframework.web.context.support.GenericWebApplicationContext
This implementation supports file paths beneath the root of the ServletContext.
getResourceByPath(String) - Method in class org.springframework.web.context.support.ServletContextResourceLoader
This implementation supports file paths beneath the root of the web application.
getResourceByPath(String) - Method in class org.springframework.web.context.support.StaticWebApplicationContext
This implementation supports file paths beneath the root of the ServletContext.
getResourceByPath(String) - Method in class org.springframework.web.portlet.context.AbstractRefreshablePortletApplicationContext
This implementation supports file paths beneath the root of the PortletContext.
getResourceByPath(String) - Method in class org.springframework.web.portlet.context.PortletContextResourceLoader
This implementation supports file paths beneath the root of the web application.
getResourceByPath(String) - Method in class org.springframework.web.portlet.context.StaticPortletApplicationContext
This implementation supports file paths beneath the root of the PortletContext.
getResourceDescription() - Method in exception org.springframework.beans.factory.BeanCreationException
Return the description of the resource that the bean definition came from, if any.
getResourceDescription() - Method in exception org.springframework.beans.factory.BeanDefinitionStoreException
Return the description of the resource that the bean definition came from, if any.
getResourceDescription() - Method in exception org.springframework.beans.factory.CannotLoadBeanClassException
Return the description of the resource that the bean definition came from.
getResourceDescription() - Method in interface org.springframework.beans.factory.config.BeanDefinition
Return a description of the resource that this bean definition came from (for the purpose of showing context in case of errors).
getResourceDescription() - Method in class org.springframework.beans.factory.parsing.Problem
Get the description of the bean configuration source that triggered the error, as contained within this Problem's Location object.
getResourceDescription() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
getResourceFactory() - Method in class org.springframework.jca.cci.connection.CciLocalTransactionManager
getResourceFactory() - Method in class org.springframework.jdbc.datasource.DataSourceTransactionManager
getResourceFactory() - Method in class org.springframework.jms.connection.JmsTransactionManager
getResourceFactory() - Method in class org.springframework.orm.hibernate3.HibernateTransactionManager
getResourceFactory() - Method in class org.springframework.orm.jdo.JdoTransactionManager
getResourceFactory() - Method in class org.springframework.orm.jpa.JpaTransactionManager
getResourceFactory() - Method in interface org.springframework.transaction.support.ResourceTransactionManager
Return the resource factory that this transaction manager operates on, e.g.
getResourceID() - Method in class org.springframework.mock.web.portlet.MockResourceRequest
getResourceID() - Method in class org.springframework.mock.web.portlet.MockResourceURL
getResourceLoader() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinitionReader
getResourceLoader() - Method in interface org.springframework.beans.factory.support.BeanDefinitionReader
Return the resource loader to use for resource locations.
getResourceLoader() - Method in class org.springframework.beans.factory.xml.XmlReaderContext
getResourceLoader() - Method in class org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider
Return the ResourceLoader that this component provider uses.
getResourceLoader() - Method in class org.springframework.core.io.support.PathMatchingResourcePatternResolver
Return the ResourceLoader that this pattern resolver works with.
getResourceLoader() - Method in class org.springframework.core.type.classreading.SimpleMetadataReaderFactory
Return the ResourceLoader that this MetadataReaderFactory has been constructed with.
getResourceLoader() - Method in class org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
Return the Spring ResourceLoader to use for loading FreeMarker template files.
getResourceLoader() - Method in class org.springframework.ui.velocity.VelocityEngineFactory
Return the Spring ResourceLoader to use for loading Velocity template files.
getResourceLocation(String) - Method in class org.springframework.mock.web.MockServletContext
Build a full resource location for the given path, prepending the resource base path of this MockServletContext.
getResourceLocation(String) - Method in class org.springframework.mock.web.portlet.MockPortletContext
Build a full resource location for the given path, prepending the resource base path of this MockPortletContext.
getResourceMap() - Static method in class org.springframework.transaction.support.TransactionSynchronizationManager
Return all resources that are bound to the current thread.
getResourcePaths(String) - Method in class org.springframework.mock.web.MockServletContext
getResourcePaths(String) - Method in class org.springframework.mock.web.portlet.MockPortletContext
getResourcePaths(String) - Method in class org.springframework.mock.web.portlet.ServletWrappingPortletContext
getResourcePatternResolver() - Method in class org.springframework.context.support.AbstractApplicationContext
Return the ResourcePatternResolver to use for resolving location patterns into Resource instances.
getResourcePatternResolver(ResourceLoader) - Static method in class org.springframework.core.io.support.ResourcePatternUtils
Return a default ResourcePatternResolver for the given ResourceLoader.
getResourcePatternResolver() - Method in class org.springframework.web.context.support.AbstractRefreshableWebApplicationContext
This implementation supports pattern matching in unexpanded WARs too.
getResourcePatternResolver() - Method in class org.springframework.web.context.support.GenericWebApplicationContext
This implementation supports pattern matching in unexpanded WARs too.
getResourcePatternResolver() - Method in class org.springframework.web.context.support.StaticWebApplicationContext
This implementation supports pattern matching in unexpanded WARs too.
getResourcePatternResolver() - Method in class org.springframework.web.portlet.context.AbstractRefreshablePortletApplicationContext
This implementation supports pattern matching in unexpanded WARs too.
getResourcePatternResolver() - Method in class org.springframework.web.portlet.context.StaticPortletApplicationContext
This implementation supports pattern matching in unexpanded WARs too.
getResources(String) - Method in class org.springframework.context.support.AbstractApplicationContext
getResources(String) - Method in class org.springframework.context.support.GenericApplicationContext
This implementation delegates to this context's ResourceLoader if it implements the ResourcePatternResolver interface, falling back to the default superclass behavior else.
getResources(String) - Method in class org.springframework.core.io.support.PathMatchingResourcePatternResolver
getResources(String) - Method in interface org.springframework.core.io.support.ResourcePatternResolver
Resolve the given location pattern into Resource objects.
getResources(String) - Method in class org.springframework.instrument.classloading.ResourceOverridingShadowingClassLoader
getResources(String) - Method in class org.springframework.instrument.classloading.ShadowingClassLoader
getResourceStream(String) - Method in class org.springframework.ui.velocity.SpringResourceLoader
getResourceSuffix() - Method in class org.springframework.test.context.support.AbstractContextLoader
Get the suffix to append to ApplicationContext resource locations when generating default locations.
getResourceSuffix() - Method in class org.springframework.test.context.support.GenericPropertiesContextLoader
Returns "-context.properties".
getResourceSuffix() - Method in class org.springframework.test.context.support.GenericXmlContextLoader
Returns "-context.xml".
getResourceToInject(Object, String) - Method in class org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement
Either this or InjectionMetadata.InjectedElement.inject(java.lang.Object, java.lang.String, org.springframework.beans.PropertyValues) needs to be overridden.
getResourceType() - Method in class org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement
getResponse() - Method in class org.springframework.mock.web.MockFilterChain
Return the response that MockFilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) has been called with.
getResponse() - Method in class org.springframework.mock.web.MockPageContext
getResponse() - Method in class org.springframework.web.context.request.ServletWebRequest
Exposes the native HttpServletRequest that we're wrapping (if any).
getResponse() - Method in class org.springframework.web.portlet.context.PortletWebRequest
Exposes the native PortletResponse that we're wrapping (if any).
getResponseBody(HttpInvokerClientConfiguration, PostMethod) - Method in class org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor
Extract the response body from the given executed remote invocation request.
getResponseContentType() - Method in class org.springframework.mock.web.portlet.MockPortletRequest
getResponseContentTypes() - Method in class org.springframework.mock.web.portlet.MockPortletRequest
getResponseDestination(Message, Message, Session) - Method in class org.springframework.jms.listener.adapter.MessageListenerAdapter
Determine a response destination for the given message.
getRestTemplate() - Method in class org.springframework.web.client.support.RestGatewaySupport
Returns the RestTemplate for the gateway.
getResult(ResultSet, String) - Method in class org.springframework.orm.ibatis.support.AbstractLobTypeHandler
This implementation delegates to the getResult version that takes a column index.
getResult(ResultSet, int) - Method in class org.springframework.orm.ibatis.support.AbstractLobTypeHandler
This implementation delegates to getResultInternal, passing in the LobHandler of this type.
getResult(CallableStatement, int) - Method in class org.springframework.orm.ibatis.support.AbstractLobTypeHandler
This implementation always throws a SQLException: retrieving LOBs from a CallableStatement is not supported.
getResultInternal(ResultSet, int, LobHandler) - Method in class org.springframework.orm.ibatis.support.AbstractLobTypeHandler
Template method to extract a value from the given result set.
getResultInternal(ResultSet, int, LobHandler) - Method in class org.springframework.orm.ibatis.support.BlobByteArrayTypeHandler
getResultInternal(ResultSet, int, LobHandler) - Method in class org.springframework.orm.ibatis.support.BlobSerializableTypeHandler
getResultInternal(ResultSet, int, LobHandler) - Method in class org.springframework.orm.ibatis.support.ClobStringTypeHandler
getResultSet() - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
Return the underlying ResultSet (usually a javax.sql.rowset.CachedRowSet).
getResultSetExtractor() - Method in class org.springframework.jdbc.core.ResultSetSupportingSqlParameter
Return the ResultSetExtractor held by this parameter, if any.
getResultSetType() - Method in class org.springframework.jdbc.object.RdbmsOperation
Return whether statements will return a specific type of ResultSet.
getResultSetValue(ResultSet, int, Class) - Static method in class org.springframework.jdbc.support.JdbcUtils
Retrieve a JDBC column value from a ResultSet, using the specified value type.
getResultSetValue(ResultSet, int) - Static method in class org.springframework.jdbc.support.JdbcUtils
Retrieve a JDBC column value from a ResultSet, using the most appropriate value type.
getRightOperand() - Method in class org.springframework.expression.spel.ast.Operator
getRightOperand() - Method in class org.springframework.expression.spel.ast.OpMinus
getRightOperand() - Method in class org.springframework.expression.spel.ast.OpPlus
getRole() - Method in interface org.springframework.beans.factory.config.BeanDefinition
Get the role hint for this BeanDefinition.
getRole() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Return the role hint for this BeanDefinition.
getRollbackRules() - Method in class org.springframework.transaction.interceptor.RuleBasedTransactionAttribute
Return the list of RollbackRuleAttribute objects (never null).
getRootCause() - Method in class org.springframework.beans.factory.parsing.Problem
Get the underlying expection that caused the error (may be null).
getRootCause() - Method in exception org.springframework.core.NestedCheckedException
Retrieve the innermost cause of this exception, if any.
getRootCause() - Method in exception org.springframework.core.NestedRuntimeException
Retrieve the innermost cause of this exception, if any.
getRootClass() - Method in class org.springframework.beans.BeanWrapperImpl
Return the class of the root object at the top of the path of this BeanWrapper.
getRootContextObject() - Method in class org.springframework.expression.spel.ExpressionState
getRootHandler() - Method in class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
Return the root handler for this handler mapping (registered for "/"), or null if none.
getRootInstance() - Method in class org.springframework.beans.BeanWrapperImpl
Return the root object at the top of the path of this BeanWrapper.
getRootMimeMultipart() - Method in class org.springframework.mail.javamail.MimeMessageHelper
Return the root MIME "multipart/mixed" object, if any.
getRootObject() - Method in interface org.springframework.expression.EvaluationContext
getRootObject() - Method in class org.springframework.expression.spel.support.StandardEvaluationContext
getRow() - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getRow() - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the current row number.
getRowCallbackHandler() - Method in class org.springframework.jdbc.core.ResultSetSupportingSqlParameter
Return the RowCallbackHandler held by this parameter, if any.
getRowCount() - Method in class org.springframework.jdbc.core.RowCountCallbackHandler
Return the row count of this ResultSet Only valid after processing is complete
getRowMapper() - Method in class org.springframework.jdbc.core.ResultSetSupportingSqlParameter
Return the RowMapper held by this parameter, if any.
getRows() - Method in class org.springframework.web.servlet.tags.form.TextareaTag
Get the value of the 'rows' attribute.
getRowsAffected() - Method in class org.springframework.jdbc.object.BatchSqlUpdate
Return the number of affected rows for all already executed statements.
getRowsExpected() - Method in class org.springframework.jdbc.object.SqlQuery
Get the number of rows expected.
getRunnable() - Method in class org.springframework.scheduling.concurrent.ScheduledExecutorTask
Return the Runnable to schedule as executor task.
getRunnableToSchedule(ScheduledExecutorTask) - Method in class org.springframework.scheduling.concurrent.ScheduledExecutorFactoryBean
Determine the actual Runnable to schedule for the given task.
getSavepoint() - Method in class org.springframework.transaction.support.AbstractTransactionStatus
Get the savepoint for this transaction, if any.
getSavepointManager() - Method in class org.springframework.orm.jpa.EntityManagerHolder
getSavepointManager() - Method in class org.springframework.transaction.support.AbstractTransactionStatus
Return a SavepointManager for the underlying transaction, if possible.
getSavepointManager() - Method in class org.springframework.transaction.support.DefaultTransactionStatus
This implementation exposes the SavepointManager interface of the underlying transaction object, if any.
getScalarOutParameterName() - Method in class org.springframework.jdbc.core.metadata.CallMetaDataContext
Get the name of the single out parameter for this call.
getScalarOutParameterName() - Method in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Get the name of a single out parameter or return value.
getScale() - Method in class org.springframework.jdbc.core.SqlParameter
Return the scale of the parameter, if any.
getScale(int) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSetMetaData
getScale(int) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSetMetaData
Retrieves the scale of the indicated column.
getScheduledConsumerCount() - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Return the number of currently scheduled consumers.
getScheduledExecutor() - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
Return the underlying ScheduledExecutorService for native access.
getScheduler() - Method in class org.springframework.scheduling.quartz.SchedulerAccessor
Template method that determines the Scheduler to operate on.
getScheduler() - Method in class org.springframework.scheduling.quartz.SchedulerAccessorBean
Return the Quartz Scheduler instance that this accessor operates on.
getScheduler() - Method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
getSchemaName() - Method in class org.springframework.jdbc.core.metadata.CallMetaDataContext
Get the name of the schema.
getSchemaName() - Method in class org.springframework.jdbc.core.metadata.TableMetaDataContext
Get the name of the schema for this context.
getSchemaName() - Method in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Get the schema name used.
getSchemaName() - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Get the name of the schema for this insert
getSchemaName(int) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSetMetaData
getSchemaName(int) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSetMetaData
Retrieves the schema name of the table that served as the source for the specified column.
getScheme() - Method in class org.springframework.mock.web.MockHttpServletRequest
getScheme() - Method in class org.springframework.mock.web.portlet.MockPortletRequest
getScope() - Method in interface org.springframework.beans.factory.config.BeanDefinition
Return the name of the current target scope for this bean, or null if not known yet.
getScope() - Method in class org.springframework.beans.factory.config.BeanExpressionContext
getScope() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Return the name of the target scope for the bean.
getScope() - Method in class org.springframework.web.context.request.AbstractRequestAttributesScope
Template method that determines the actual target scope.
getScope() - Method in class org.springframework.web.context.request.RequestScope
getScope() - Method in class org.springframework.web.context.request.SessionScope
getScope(String) - Static method in class org.springframework.web.util.TagUtils
Determines the scope for a given input String.
getScopedProxyMode() - Method in class org.springframework.context.annotation.ScopeMetadata
Get the proxy-mode to be applied to the scoped instance.
getScopeMetadataResolver() - Method in class org.springframework.web.context.support.AnnotationConfigWebApplicationContext
Provide a custom ScopeMetadataResolver for use with AnnotatedBeanDefinitionReader and/or ClassPathBeanDefinitionScanner, if any.
getScopeName() - Method in class org.springframework.context.annotation.ScopeMetadata
Get the name of the scope.
getScriptAsString() - Method in interface org.springframework.scripting.ScriptSource
Retrieve the current script source text as String.
getScriptAsString() - Method in class org.springframework.scripting.support.ResourceScriptSource
getScriptAsString() - Method in class org.springframework.scripting.support.StaticScriptSource
getScriptedObject(ScriptSource, Class[]) - Method in class org.springframework.scripting.bsh.BshScriptFactory
Load and parse the BeanShell script via BshScriptUtils.
getScriptedObject(ScriptSource, Class[]) - Method in class org.springframework.scripting.groovy.GroovyScriptFactory
Loads and parses the Groovy script via the GroovyClassLoader.
getScriptedObject(ScriptSource, Class[]) - Method in class org.springframework.scripting.jruby.JRubyScriptFactory
Load and parse the JRuby script via JRubyScriptUtils.
getScriptedObject(ScriptSource, Class[]) - Method in interface org.springframework.scripting.ScriptFactory
Factory method for creating the scripted Java object.
getScriptedObjectType(ScriptSource) - Method in class org.springframework.scripting.bsh.BshScriptFactory
getScriptedObjectType(ScriptSource) - Method in class org.springframework.scripting.groovy.GroovyScriptFactory
getScriptedObjectType(ScriptSource) - Method in class org.springframework.scripting.jruby.JRubyScriptFactory
getScriptedObjectType(ScriptSource) - Method in interface org.springframework.scripting.ScriptFactory
Determine the type of the scripted Java object.
getScriptInterfaces() - Method in class org.springframework.scripting.bsh.BshScriptFactory
getScriptInterfaces() - Method in class org.springframework.scripting.groovy.GroovyScriptFactory
Groovy scripts determine their interfaces themselves, hence we don't need to explicitly expose interfaces here.
getScriptInterfaces() - Method in class org.springframework.scripting.jruby.JRubyScriptFactory
getScriptInterfaces() - Method in interface org.springframework.scripting.ScriptFactory
Return the business interfaces that the script is supposed to implement.
getScriptSource() - Method in exception org.springframework.scripting.ScriptCompilationException
Return the source for the offending script.
getScriptSource(String, String) - Method in class org.springframework.scripting.support.ScriptFactoryPostProcessor
Obtain a ScriptSource for the given bean, lazily creating it if not cached already.
getScriptSourceLocator() - Method in class org.springframework.scripting.bsh.BshScriptFactory
getScriptSourceLocator() - Method in class org.springframework.scripting.groovy.GroovyScriptFactory
getScriptSourceLocator() - Method in class org.springframework.scripting.jruby.JRubyScriptFactory
getScriptSourceLocator() - Method in interface org.springframework.scripting.ScriptFactory
Return a locator that points to the source of the script.
getSecurityContext() - Method in class org.springframework.beans.BeanWrapperImpl
Return the security context used during the invocation of the wrapped instance methods.
getSentDate() - Method in class org.springframework.mail.SimpleMailMessage
getSequenceQuery() - Method in class org.springframework.jdbc.support.incrementer.AbstractSequenceMaxValueIncrementer
Return the database-specific query to use for retrieving a sequence value.
getSequenceQuery() - Method in class org.springframework.jdbc.support.incrementer.DB2MainframeSequenceMaxValueIncrementer
getSequenceQuery() - Method in class org.springframework.jdbc.support.incrementer.DB2SequenceMaxValueIncrementer
getSequenceQuery() - Method in class org.springframework.jdbc.support.incrementer.H2SequenceMaxValueIncrementer
getSequenceQuery() - Method in class org.springframework.jdbc.support.incrementer.HsqlSequenceMaxValueIncrementer
getSequenceQuery() - Method in class org.springframework.jdbc.support.incrementer.OracleSequenceMaxValueIncrementer
getSequenceQuery() - Method in class org.springframework.jdbc.support.incrementer.PostgreSQLSequenceMaxValueIncrementer
getServer() - Method in class org.springframework.jmx.support.MBeanRegistrationSupport
Return the MBeanServer that the beans will be registered with.
getServerInfo() - Method in class org.springframework.mock.web.MockServletContext
getServerInfo() - Method in class org.springframework.mock.web.portlet.MockPortletContext
getServerInfo() - Method in class org.springframework.mock.web.portlet.ServletWrappingPortletContext
getServerName() - Method in class org.springframework.mock.web.MockHttpServletRequest
getServerName() - Method in class org.springframework.mock.web.portlet.MockPortletRequest
getServerPort() - Method in class org.springframework.mock.web.MockHttpServletRequest
getServerPort() - Method in class org.springframework.mock.web.portlet.MockPortletRequest
getService() - Method in class org.springframework.remoting.support.RemoteExporter
Return the service to export.
getServiceFactory() - Method in class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
Deprecated. Return the specified ServiceFactory instance, if any.
getServiceFactoryClass() - Method in class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
Deprecated. Return the ServiceFactory class to use, or null if default.
getServiceInterface() - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Return the interface of the service that this factory should create a proxy for.
getServiceInterface() - Method in class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
Return the interface of the service that this factory should create a proxy for.
getServiceInterface() - Method in class org.springframework.remoting.rmi.JndiRmiClientInterceptor
Return the interface of the service to access.
getServiceInterface() - Method in class org.springframework.remoting.support.RemoteAccessor
Return the interface of the service to access.
getServiceInterface() - Method in class org.springframework.remoting.support.RemoteExporter
Return the interface of the service to export.
getServiceName() - Method in class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
Deprecated. Return the name of the service.
getServiceName() - Method in class org.springframework.remoting.jaxws.LocalJaxWsServiceFactory
Return the name of the service.
getServicePostProcessors() - Method in class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
Deprecated. Return the JaxRpcServicePostProcessors to be applied to JAX-RPC Service instances created by this factory.
getServiceType() - Method in class org.springframework.beans.factory.serviceloader.AbstractServiceLoaderBasedFactoryBean
Return the desired service type.
getServiceUrl() - Method in interface org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration
Return the HTTP URL of the target service.
getServiceUrl() - Method in class org.springframework.remoting.support.UrlBasedRemoteAccessor
Return the URL of this remote accessor's target service.
getServlet(String) - Method in class org.springframework.mock.web.MockServletContext
getServletConfig() - Method in class org.springframework.mock.web.MockPageContext
getServletConfig() - Method in interface org.springframework.web.context.ConfigurableWebApplicationContext
Return the ServletConfig for this web application context, if any.
getServletConfig() - Method in class org.springframework.web.context.support.AbstractRefreshableWebApplicationContext
getServletConfig() - Method in class org.springframework.web.context.support.StaticWebApplicationContext
getServletContext() - Method in class org.springframework.mock.web.MockFilterConfig
getServletContext() - Method in class org.springframework.mock.web.MockHttpServletRequest
Return the ServletContext that this request is associated with.
getServletContext() - Method in class org.springframework.mock.web.MockHttpSession
getServletContext() - Method in class org.springframework.mock.web.MockPageContext
getServletContext() - Method in class org.springframework.mock.web.MockServletConfig
getServletContext() - Method in class org.springframework.mock.web.portlet.ServletWrappingPortletContext
Return the underlying ServletContext that this PortletContext wraps.
getServletContext() - Method in class org.springframework.remoting.jaxrpc.ServletEndpointSupport
Deprecated. Return the current ServletContext.
getServletContext() - Method in class org.springframework.web.context.support.AbstractRefreshableWebApplicationContext
getServletContext() - Method in class org.springframework.web.context.support.GenericWebApplicationContext
getServletContext() - Method in class org.springframework.web.context.support.ServletContextResource
Return the ServletContext for this resource.
getServletContext() - Method in class org.springframework.web.context.support.StaticWebApplicationContext
getServletContext() - Method in class org.springframework.web.context.support.WebApplicationObjectSupport
Return the current ServletContext.
getServletContext() - Method in interface org.springframework.web.context.WebApplicationContext
Return the standard Servlet API ServletContext for this application.
getServletContext() - Method in class org.springframework.web.filter.GenericFilterBean
Make the ServletContext of this filter available to subclasses.
getServletContext() - Method in class org.springframework.web.portlet.context.AbstractRefreshablePortletApplicationContext
getServletContext() - Method in class org.springframework.web.portlet.context.StaticPortletApplicationContext
getServletContext() - Method in class org.springframework.web.servlet.HttpServletBean
Overridden method that simply returns null when no ServletConfig set yet.
getServletContext() - Method in class org.springframework.web.servlet.support.RequestContext
Return the underlying ServletContext.
getServletContext() - Method in class org.springframework.web.servlet.view.tiles.ComponentControllerSupport
Deprecated. Return the current ServletContext.
getServletContext() - Method in class org.springframework.web.struts.ActionSupport
Deprecated. Return the current ServletContext.
getServletContext() - Method in class org.springframework.web.struts.ContextLoaderPlugIn
Deprecated. Return the ServletContext that this PlugIn is associated with.
getServletContext() - Method in class org.springframework.web.struts.DispatchActionSupport
Deprecated. Return the current ServletContext.
getServletContext() - Method in class org.springframework.web.struts.LookupDispatchActionSupport
Deprecated. Return the current ServletContext.
getServletContext() - Method in class org.springframework.web.struts.MappingDispatchActionSupport
Deprecated. Return the current ServletContext.
getServletContextAttributeName() - Method in class org.springframework.web.servlet.FrameworkServlet
Return the ServletContext attribute name for this servlet's WebApplicationContext.
getServletContextAttributeName() - Method in class org.springframework.web.struts.ContextLoaderPlugIn
Deprecated. Return the ServletContext attribute name for this PlugIn's WebApplicationContext.
getServletContextName() - Method in class org.springframework.mock.web.MockServletContext
getServletEndpointContext() - Method in class org.springframework.remoting.jaxrpc.ServletEndpointSupport
Deprecated. Return the current JAX-RPC ServletEndpointContext.
getServletName() - Method in class org.springframework.mock.web.MockServletConfig
getServletName() - Method in class org.springframework.web.context.support.ServletRequestHandledEvent
Return the name of the servlet that handled the request.
getServletName() - Method in class org.springframework.web.servlet.HttpServletBean
Overridden method that simply returns null when no ServletConfig set yet.
getServletName() - Method in class org.springframework.web.struts.ContextLoaderPlugIn
Deprecated. Return the name of the ActionServlet that this PlugIn is associated with.
getServletNames() - Method in class org.springframework.mock.web.MockServletContext
getServletPath() - Method in class org.springframework.mock.web.MockHttpServletRequest
getServletPath(HttpServletRequest) - Method in class org.springframework.web.util.UrlPathHelper
Return the servlet path for the given request, regarding an include request URL if called within a RequestDispatcher include.
getServlets() - Method in class org.springframework.mock.web.MockServletContext
getSession(Connection, Integer) - Method in class org.springframework.jms.connection.CachingConnectionFactory
Checks for a cached Session for the given mode.
getSession(JmsResourceHolder) - Method in interface org.springframework.jms.connection.ConnectionFactoryUtils.ResourceFactory
Fetch an appropriate Session from the given JmsResourceHolder.
getSession() - Method in class org.springframework.jms.connection.JmsResourceHolder
getSession(Class<? extends Session>) - Method in class org.springframework.jms.connection.JmsResourceHolder
getSession(Class<? extends Session>, Connection) - Method in class org.springframework.jms.connection.JmsResourceHolder
getSession(Connection, Integer) - Method in class org.springframework.jms.connection.SingleConnectionFactory
Template method for obtaining a (potentially cached) Session.
getSession(JmsResourceHolder) - Method in class org.springframework.jms.core.JmsTemplate
Fetch an appropriate Session from the given JmsResourceHolder.
getSession(JmsResourceHolder) - Method in class org.springframework.jms.core.JmsTemplate102
Deprecated. This implementation overrides the superclass method to accept either a QueueSession or a TopicSession, depending on the domain.
getSession(JmsResourceHolder) - Method in class org.springframework.jms.listener.AbstractPollingMessageListenerContainer
Fetch an appropriate Session from the given JmsResourceHolder.
getSession(JmsResourceHolder) - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer102
Deprecated. This implementation overrides the superclass method to accept either a QueueSession or a TopicSession, depending on the domain.
getSession() - Method in class org.springframework.mail.javamail.JavaMailSenderImpl
Return the JavaMail Session, lazily initializing it if hasn't been specified explicitly.
getSession(boolean) - Method in class org.springframework.mock.web.MockHttpServletRequest
getSession() - Method in class org.springframework.mock.web.MockHttpServletRequest
getSession() - Method in class org.springframework.mock.web.MockPageContext
getSession() - Method in class org.springframework.orm.hibernate3.HibernateInterceptor
Return a Session for use by this interceptor.
getSession() - Method in class org.springframework.orm.hibernate3.HibernateTemplate
Return a Session for use by this template.
getSession(SessionFactory, boolean) - Static method in class org.springframework.orm.hibernate3.SessionFactoryUtils
Get a Hibernate Session for the given SessionFactory.
getSession(SessionFactory, Interceptor, SQLExceptionTranslator) - Static method in class org.springframework.orm.hibernate3.SessionFactoryUtils
Get a Hibernate Session for the given SessionFactory.
getSession() - Method in class org.springframework.orm.hibernate3.SessionHolder
getSession(Object) - Method in class org.springframework.orm.hibernate3.SessionHolder
getSession() - Method in class org.springframework.orm.hibernate3.support.HibernateDaoSupport
Obtain a Hibernate Session, either from the current transaction or a new one.
getSession(boolean) - Method in class org.springframework.orm.hibernate3.support.HibernateDaoSupport
Obtain a Hibernate Session, either from the current transaction or a new one.
getSession(SessionFactory) - Method in class org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
Get a Session for the SessionFactory that this filter uses.
getSession(EntityManager) - Method in class org.springframework.orm.jpa.vendor.EclipseLinkJpaDialect
Get a traditional EclipseLink Session from the given EntityManager.
getSession(EntityManager) - Method in class org.springframework.orm.jpa.vendor.HibernateJpaDialect
getSession(EntityManager) - Method in class org.springframework.orm.jpa.vendor.TopLinkJpaDialect
Get a traditional TopLink Session from the given EntityManager.
getSession(boolean) - Method in class org.springframework.web.context.request.ServletRequestAttributes
Exposes the HttpSession that we're wrapping.
getSession(boolean) - Method in class org.springframework.web.portlet.context.PortletRequestAttributes
Exposes the PortletSession that we're wrapping.
getSessionAcknowledgeMode() - Method in class org.springframework.jms.support.JmsAccessor
Return the acknowledgement mode for JMS sessions.
getSessionAttribute(PortletRequest, String) - Static method in class org.springframework.web.portlet.util.PortletUtils
Check the given request for a session attribute of the given name under the PortletSession.PORTLET_SCOPE.
getSessionAttribute(PortletRequest, String, int) - Static method in class org.springframework.web.portlet.util.PortletUtils
Check the given request for a session attribute of the given name in the given scope.
getSessionAttribute(HttpServletRequest, String) - Static method in class org.springframework.web.util.WebUtils
Check the given request for a session attribute of the given name.
getSessionBeanInstance() - Method in class org.springframework.ejb.access.LocalSlsbInvokerInterceptor
Return an EJB instance to delegate the call to.
getSessionBeanInstance() - Method in class org.springframework.ejb.access.SimpleRemoteSlsbInvokerInterceptor
Return an EJB component instance to delegate the call to.
getSessionCacheSize() - Method in class org.springframework.jms.connection.CachingConnectionFactory
Return the desired size for the JMS Session cache (per JMS Session type).
getSessionContext() - Method in class org.springframework.ejb.support.AbstractSessionBean
Convenience method for subclasses, returning the EJB session context saved on initialization (AbstractSessionBean.setSessionContext(javax.ejb.SessionContext)).
getSessionContext() - Method in interface org.springframework.ejb.support.SmartSessionBean
Return the SessionContext that was passed to the Session Bean by the EJB container.
getSessionContext() - Method in class org.springframework.mock.web.MockHttpSession
getSessionFactory() - Method in class org.springframework.orm.hibernate3.AbstractSessionFactoryBean
Return the exposed SessionFactory.
getSessionFactory() - Method in class org.springframework.orm.hibernate3.HibernateAccessor
Return the Hibernate SessionFactory that should be used to create Hibernate Sessions.
getSessionFactory() - Method in class org.springframework.orm.hibernate3.HibernateTransactionManager
Return the SessionFactory that this instance should manage transactions for.
getSessionFactory() - Method in class org.springframework.orm.hibernate3.support.HibernateDaoSupport
Return the Hibernate SessionFactory used by this DAO.
getSessionFactoryBeanName() - Method in class org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
Return the bean name of the SessionFactory to fetch from Spring's root application context.
getSessionId() - Method in class org.springframework.web.context.request.FacesRequestAttributes
getSessionId() - Method in interface org.springframework.web.context.request.RequestAttributes
Return an id for the current underlying session.
getSessionId() - Method in class org.springframework.web.context.request.ServletRequestAttributes
getSessionId() - Method in class org.springframework.web.context.support.RequestHandledEvent
Return the id of the HTTP session, if any.
getSessionId() - Method in class org.springframework.web.portlet.context.PortletRequestAttributes
getSessionId(HttpServletRequest) - Static method in class org.springframework.web.util.WebUtils
Determine the session id of the given request, if any.
getSessionMutex() - Method in class org.springframework.web.context.request.FacesRequestAttributes
getSessionMutex() - Method in interface org.springframework.web.context.request.RequestAttributes
Expose the best available mutex for the underlying session: that is, an object to synchronize on for the underlying session.
getSessionMutex() - Method in class org.springframework.web.context.request.ServletRequestAttributes
getSessionMutex(FacesContext) - Static method in class org.springframework.web.jsf.FacesContextUtils
Return the best available mutex for the given session: that is, an object to synchronize on for the given session.
getSessionMutex() - Method in class org.springframework.web.portlet.context.PortletRequestAttributes
getSessionMutex(PortletSession) - Static method in class org.springframework.web.portlet.util.PortletUtils
Return the best available mutex for the given session: that is, an object to synchronize on for the given session.
getSessionMutex(HttpSession) - Static method in class org.springframework.web.util.WebUtils
Return the best available mutex for the given session: that is, an object to synchronize on for the given session.
getSharedConnection() - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Return the shared JMS Connection maintained by this container.
getSharedConnectionProxy(Connection) - Method in class org.springframework.jms.connection.SingleConnectionFactory
Wrap the given Connection with a proxy that delegates every method call to it but suppresses close calls.
getShort(int) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getShort(String) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getShort(int) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as a short.
getShort(String) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as a short.
getShortCode() - Method in class org.springframework.core.enums.ShortCodedLabeledEnum
Deprecated. Return the short code of this LabeledEnum instance.
getShortDescription() - Method in class org.springframework.beans.factory.config.BeanDefinitionHolder
Return a friendly, short description for the bean, stating name and aliases.
getShortDescription() - Method in class org.springframework.web.context.support.RequestHandledEvent
Return a short description of this event, only involving the most important context data.
getShortDescription() - Method in class org.springframework.web.context.support.ServletRequestHandledEvent
getShortDescription() - Method in class org.springframework.web.portlet.context.PortletRequestHandledEvent
getShortName(String) - Static method in class org.springframework.util.ClassUtils
Get the class name without the qualified package name.
getShortName(Class<?>) - Static method in class org.springframework.util.ClassUtils
Get the class name without the qualified package name.
getShortNameAsProperty(Class<?>) - Static method in class org.springframework.util.ClassUtils
Return the short string name of a Java class in uncapitalized JavaBeans property format.
getSignature() - Method in class org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint
getSimpleJdbcTemplate() - Method in class org.springframework.jdbc.core.simple.SimpleJdbcDaoSupport
Return a SimpleJdbcTemplate wrapping the configured JdbcTemplate.
getSimpleQueryForGetGeneratedKey(String, String) - Method in class org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
getSimpleQueryForGetGeneratedKey(String, String) - Method in class org.springframework.jdbc.core.metadata.HsqlTableMetaDataProvider
getSimpleQueryForGetGeneratedKey(String, String) - Method in class org.springframework.jdbc.core.metadata.PostgresTableMetaDataProvider
getSimpleQueryForGetGeneratedKey(String, String) - Method in interface org.springframework.jdbc.core.metadata.TableMetaDataProvider
Get the simple query to retrieve a generated key
getSimpleTypeConverter() - Method in class org.springframework.validation.DataBinder
Return this binder's underlying SimpleTypeConverter.
getSimulationQueryForGetGeneratedKey(String, String) - Method in class org.springframework.jdbc.core.metadata.TableMetaDataContext
Does this database support simple query to retrieve generated keys when the JDBC 3.0 feature is not supported DatabaseMetaData.supportsGetGeneratedKeys()?
getSingleColumnRowMapper(Class<T>) - Method in class org.springframework.jdbc.core.JdbcTemplate
Create a new RowMapper for reading result objects from a single column.
getSingleton(String) - Method in interface org.springframework.beans.factory.config.SingletonBeanRegistry
Return the (raw) singleton object registered under the given name.
getSingleton(String) - Method in class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
getSingleton(String, boolean) - Method in class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
Return the (raw) singleton object registered under the given name.
getSingleton(String, ObjectFactory) - Method in class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
Return the (raw) singleton object registered under the given name, creating and registering a new one if none registered yet.
getSingletonCount() - Method in interface org.springframework.beans.factory.config.SingletonBeanRegistry
Return the number of singleton beans registered in this registry.
getSingletonCount() - Method in class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
getSingletonMutex() - Method in class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
Expose the singleton mutex to subclasses.
getSingletonNames() - Method in interface org.springframework.beans.factory.config.SingletonBeanRegistry
Return the names of singleton beans registered in this registry.
getSingletonNames() - Method in class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
getSize() - Method in class org.springframework.core.Constants
Return the number of constants exposed.
getSize() - Method in class org.springframework.mock.web.MockMultipartFile
getSize() - Method in class org.springframework.web.multipart.commons.CommonsMultipartFile
getSize() - Method in interface org.springframework.web.multipart.MultipartFile
Return the size of the file in bytes.
getSize() - Method in class org.springframework.web.servlet.tags.form.InputTag
Get the value of the 'size' attribute.
getSize() - Method in class org.springframework.web.servlet.tags.form.SelectTag
Get the value of the 'size' attribute.
getSoapActionUri() - Method in class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
Return the SOAP action URI to specify on the stub.
getSort() - Method in class org.springframework.beans.support.PagedListHolder
Return the sort definition for this holder.
getSortDefinition() - Method in class org.springframework.beans.support.PropertyComparator
Return the SortDefinition that this comparator uses.
getSource() - Method in class org.springframework.aop.config.AdvisorComponentDefinition
getSource() - Method in class org.springframework.aop.config.PointcutComponentDefinition
getSource() - Method in class org.springframework.beans.BeanMetadataAttribute
getSource() - Method in class org.springframework.beans.BeanMetadataAttributeAccessor
getSource() - Method in interface org.springframework.beans.BeanMetadataElement
Return the configuration source Object for this metadata element (may be null).
getSource() - Method in class org.springframework.beans.factory.config.BeanDefinitionHolder
Expose the bean definition's source object.
getSource() - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues.ValueHolder
getSource() - Method in class org.springframework.beans.factory.config.RuntimeBeanNameReference
getSource() - Method in class org.springframework.beans.factory.config.RuntimeBeanReference
getSource() - Method in class org.springframework.beans.factory.config.TypedStringValue
getSource() - Method in class org.springframework.beans.factory.parsing.AliasDefinition
getSource() - Method in class org.springframework.beans.factory.parsing.CompositeComponentDefinition
getSource() - Method in class org.springframework.beans.factory.parsing.ImportDefinition
getSource() - Method in class org.springframework.beans.factory.parsing.Location
Get the actual location within the associated resource (may be null).
getSource() - Method in class org.springframework.beans.factory.support.ManagedList
getSource() - Method in class org.springframework.beans.factory.support.ManagedMap
getSource() - Method in class org.springframework.beans.factory.support.ManagedProperties
getSource() - Method in class org.springframework.beans.factory.support.ManagedSet
getSource() - Method in class org.springframework.beans.factory.support.MethodOverride
getSource() - Method in class org.springframework.beans.factory.xml.DocumentDefaultsDefinition
getSource() - Method in class org.springframework.beans.support.PagedListHolder
Return the source list for this holder.
getSource() - Method in class org.springframework.web.bind.EscapedErrors
getSourceExtractor() - Method in class org.springframework.beans.factory.parsing.ReaderContext
getSourceLocation() - Method in class org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint
getSourceStream() - Method in class org.springframework.mock.web.DelegatingServletInputStream
Return the underlying source stream (never null).
getSourceType() - Method in exception org.springframework.core.convert.ConversionFailedException
Return the source type we tried to convert the value from.
getSourceType() - Method in class org.springframework.core.convert.converter.GenericConverter.ConvertiblePair
getSourceType() - Method in exception org.springframework.core.convert.ConverterNotFoundException
Returns the source type that was requested to convert from.
getSourceTypes() - Method in class org.springframework.web.servlet.view.xslt.XsltView
Return the array of Classes that are supported when converting to an XSLT Source.
getSpecificTargetClasses() - Method in class org.springframework.context.expression.BeanExpressionContextAccessor
getSpecificTargetClasses() - Method in class org.springframework.context.expression.BeanFactoryAccessor
getSpecificTargetClasses() - Method in class org.springframework.context.expression.MapAccessor
getSpecificTargetClasses() - Method in interface org.springframework.expression.PropertyAccessor
Return an array of classes for which this resolver should be called.
getSpecificTargetClasses() - Method in class org.springframework.expression.spel.support.ReflectivePropertyAccessor
getSpecifiedTypeName() - Method in class org.springframework.beans.factory.config.TypedStringValue
Return the type name as actually specified for this particular value, if any.
getSpringTimeout(FrameworkMethod) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
Retrieves the configured Spring-specific timeout from the @Timed annotation on the supplied test method.
getSql() - Method in exception org.springframework.jdbc.BadSqlGrammarException
Return the SQL that caused the problem.
getSql() - Method in interface org.springframework.jdbc.core.SqlProvider
Return the SQL string for this object, i.e.
getSql() - Method in exception org.springframework.jdbc.InvalidResultSetAccessException
Return the SQL that caused the problem.
getSql() - Method in class org.springframework.jdbc.object.RdbmsOperation
Subclasses can override this to supply dynamic SQL if they wish, but SQL is normally set by calling the setSql() method or in a subclass constructor.
getSql() - Method in exception org.springframework.jdbc.UncategorizedSQLException
Return the SQL that led to the problem.
getSql() - Method in exception org.springframework.orm.hibernate3.HibernateJdbcException
Return the SQL that led to the problem.
getSqlErrorCodes() - Method in class org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator
Return the error codes used by this translator.
getSQLException() - Method in exception org.springframework.jdbc.BadSqlGrammarException
Return the wrapped SQLException.
getSQLException() - Method in exception org.springframework.jdbc.InvalidResultSetAccessException
Return the wrapped SQLException.
getSQLException() - Method in exception org.springframework.jdbc.UncategorizedSQLException
Return the underlying SQLException.
getSQLException() - Method in exception org.springframework.orm.hibernate3.HibernateJdbcException
Return the underlying SQLException.
getSqlMapClient() - Method in class org.springframework.orm.ibatis.SqlMapClientTemplate
Return the iBATIS Database Layer SqlMapClient that this template works with.
getSqlMapClient() - Method in class org.springframework.orm.ibatis.support.SqlMapClientDaoSupport
Return the iBATIS Database Layer SqlMapClient that this template works with.
getSqlMapClientTemplate() - Method in class org.springframework.orm.ibatis.support.SqlMapClientDaoSupport
Return the SqlMapClientTemplate for this DAO, pre-initialized with the SqlMapClient or set explicitly.
getSqlReturnType() - Method in class org.springframework.jdbc.core.SqlOutParameter
Return the custom return type, if any.
getSqlType() - Method in class org.springframework.jdbc.core.metadata.CallParameterMetaData
Get the parameter SQL type.
getSqlType() - Method in class org.springframework.jdbc.core.metadata.TableParameterMetaData
Get the parameter SQL type.
getSqlType(String) - Method in class org.springframework.jdbc.core.namedparam.AbstractSqlParameterSource
Return the SQL type for the given parameter, if registered.
getSqlType(String) - Method in class org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource
Derives a default SQL type from the corresponding property type.
getSqlType(String) - Method in interface org.springframework.jdbc.core.namedparam.SqlParameterSource
Determine the SQL type for the specified named parameter.
getSqlType() - Method in class org.springframework.jdbc.core.SqlParameter
Return the SQL type of the parameter.
getStartPosition() - Method in class org.springframework.expression.spel.ast.SpelNodeImpl
getStartPosition() - Method in interface org.springframework.expression.spel.SpelNode
getStartupDate() - Method in interface org.springframework.context.ApplicationContext
Return the timestamp when this context was first loaded.
getStartupDate() - Method in class org.springframework.context.support.AbstractApplicationContext
Return the timestamp (ms) when this context was first loaded.
getStateString(int) - Static method in exception org.springframework.transaction.HeuristicCompletionException
getStaticAttributes() - Method in class org.springframework.web.servlet.view.AbstractView
Return the static attributes for this view.
getStaticMessageSource() - Method in class org.springframework.context.support.StaticApplicationContext
Return the internal StaticMessageSource used by this context.
getStaticMethod(Class<?>, String, Class<?>...) - Static method in class org.springframework.util.ClassUtils
Return a public static method of a class.
getStaticPart() - Method in class org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint
getStaticPart() - Method in class org.springframework.aop.framework.ReflectiveMethodInvocation
getStatsMixin() - Method in class org.springframework.aop.target.ThreadLocalTargetSource
Return an introduction advisor mixin that allows the AOP proxy to be cast to ThreadLocalInvokerStats.
getStatus() - Method in class org.springframework.mock.web.MockHttpServletResponse
getStatus() - Method in class org.springframework.transaction.jta.ManagedTransactionAdapter
getStatus() - Method in class org.springframework.transaction.jta.UserTransactionAdapter
getStatusCode() - Method in interface org.springframework.http.client.ClientHttpResponse
Return the HTTP status code of the response.
getStatusCode() - Method in class org.springframework.http.ResponseEntity
Return the HTTP status code of the response.
getStatusCode() - Method in exception org.springframework.web.client.HttpStatusCodeException
Returns the HTTP status code.
getStatusText() - Method in interface org.springframework.http.client.ClientHttpResponse
Return the HTTP status text of the response.
getStatusText() - Method in exception org.springframework.web.client.HttpStatusCodeException
Returns the HTTP status text.
getStorageDescription() - Method in class org.springframework.web.multipart.commons.CommonsMultipartFile
Return a description for the storage location of the multipart content.
getString(int) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getString(String) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getString(int) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as a String.
getString(String) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as a String.
getString() - Method in class org.springframework.mock.web.MockBodyContent
getStringCode() - Method in class org.springframework.core.enums.StringCodedLabeledEnum
Deprecated. Return the String code of this LabeledEnum instance.
getStringParameter(ServletRequest, String) - Static method in class org.springframework.web.bind.ServletRequestUtils
Get a String parameter, or null if not present.
getStringParameter(ServletRequest, String, String) - Static method in class org.springframework.web.bind.ServletRequestUtils
Get a String parameter, with a fallback value.
getStringParameter(PortletRequest, String) - Static method in class org.springframework.web.portlet.bind.PortletRequestUtils
Get a String parameter, or null if not present.
getStringParameter(PortletRequest, String, String) - Static method in class org.springframework.web.portlet.bind.PortletRequestUtils
Get a String parameter, with a fallback value.
getStringParameters(ServletRequest, String) - Static method in class org.springframework.web.bind.ServletRequestUtils
Get an array of String parameters, return an empty array if not found.
getStringParameters(PortletRequest, String) - Static method in class org.springframework.web.portlet.bind.PortletRequestUtils
Get an array of String parameters, return an empty array if not found.
getStub() - Method in class org.springframework.remoting.rmi.JndiRmiClientInterceptor
Return the RMI stub to use.
getStub() - Method in class org.springframework.remoting.rmi.RmiClientInterceptor
Return the RMI stub to use.
getStylesheetLocation() - Method in class org.springframework.web.servlet.view.xslt.AbstractXsltView
Deprecated. Return the location of the XSLT stylesheet, if any.
getStylesheetSource(Resource) - Method in class org.springframework.web.servlet.view.xslt.AbstractXsltView
Deprecated. Load the stylesheet from the specified location.
getStylesheetSource() - Method in class org.springframework.web.servlet.view.xslt.XsltView
Get the XSLT Source for the XSLT template under the configured URL.
getSubject() - Method in class org.springframework.mail.SimpleMailMessage
getSubmitParameter(PortletRequest, String) - Static method in class org.springframework.web.portlet.util.PortletUtils
Return the full name of a specific input type="submit" parameter if it was sent in the request, either via a button (directly with name) or via an image (name + ".x" or name + ".y").
getSubscriptionName() - Method in class org.springframework.jms.listener.adapter.MessageListenerAdapter
getSubscriptionName() - Method in interface org.springframework.jms.listener.SubscriptionNameProvider
Determine the subscription name for this message listener object.
getSubtype() - Method in class org.springframework.http.MediaType
Return the subtype.
getSuccessView() - Method in class org.springframework.web.portlet.mvc.SimpleFormController
Deprecated. Return the name of the view that should be shown on successful submit.
getSuccessView() - Method in class org.springframework.web.servlet.mvc.SimpleFormController
Deprecated. Return the name of the view that should be shown on successful submit.
getSuffix() - Method in class org.springframework.aop.interceptor.AbstractMonitoringInterceptor
Return the text that will get prepended to the trace data.
getSuffix() - Method in class org.springframework.web.servlet.mvc.multiaction.InternalPathMethodNameResolver
Return the common suffix for handler method names.
getSuffix() - Method in class org.springframework.web.servlet.mvc.UrlFilenameViewController
Return the suffix to append to the request URL filename.
getSuffix() - Method in class org.springframework.web.servlet.view.UrlBasedViewResolver
Return the suffix that gets appended to view names when building a URL.
getSuggestedValue(DependencyDescriptor) - Method in class org.springframework.beans.factory.annotation.QualifierAnnotationAutowireCandidateResolver
Determine whether the given dependency carries a value annotation.
getSuggestedValue(DependencyDescriptor) - Method in interface org.springframework.beans.factory.support.AutowireCandidateResolver
Determine whether a default value is suggested for the given dependency.
getSuggestedValue(DependencyDescriptor) - Method in class org.springframework.beans.factory.support.SimpleAutowireCandidateResolver
getSuperClassName() - Method in interface org.springframework.core.type.ClassMetadata
Return the name of the super class of the underlying class, or null if there is no super class defined.
getSuperClassName() - Method in class org.springframework.core.type.StandardClassMetadata
getSupportedLocales() - Method in class org.springframework.mock.web.portlet.MockPortletConfig
getSupportedMediaTypes() - Method in class org.springframework.http.converter.AbstractHttpMessageConverter
getSupportedMediaTypes() - Method in class org.springframework.http.converter.BufferedImageHttpMessageConverter
getSupportedMediaTypes() - Method in class org.springframework.http.converter.FormHttpMessageConverter
getSupportedMediaTypes() - Method in interface org.springframework.http.converter.HttpMessageConverter
Return the list of MediaType objects supported by this converter.
getSupportedMediaTypes() - Method in class org.springframework.http.converter.ResourceHttpMessageConverter
getSupportedMediaTypes() - Method in exception org.springframework.web.HttpMediaTypeException
Return the list of supported media types.
getSupportedMethods() - Method in exception org.springframework.web.HttpRequestMethodNotSupportedException
Return the actually supported HTTP methods, if known.
getSupportedMethods() - Method in exception org.springframework.web.portlet.handler.PortletRequestMethodNotSupportedException
Return the actually supported HTTP methods, if known.
getSupportedMethods() - Method in class org.springframework.web.servlet.support.WebContentGenerator
Return the HTTP methods that this content generator supports.
getSupportedPortletModes() - Method in class org.springframework.mock.web.portlet.MockPortalContext
getSupportedWindowStates() - Method in class org.springframework.mock.web.portlet.MockPortalContext
getSuppressedFields() - Method in class org.springframework.validation.AbstractBindingResult
Return the list of fields that were suppressed during the bind process.
getSuppressedFields() - Method in exception org.springframework.validation.BindException
getSuppressedFields() - Method in interface org.springframework.validation.BindingResult
Return the list of fields that were suppressed during the bind process.
getSuspendedResources() - Method in class org.springframework.transaction.support.DefaultTransactionStatus
Return the holder for resources that have been suspended for this transaction, if any.
getSynchronizations() - Static method in class org.springframework.transaction.support.TransactionSynchronizationManager
Return an unmodifiable snapshot list of all registered synchronizations for the current thread.
getTabindex() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Get the value of the 'tabindex' attribute.
getTableColumns() - Method in class org.springframework.jdbc.core.metadata.TableMetaDataContext
Get a List of the table column names.
getTableName() - Method in class org.springframework.jdbc.core.metadata.TableMetaDataContext
Get the name of the table for this context.
getTableName() - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Get the name of the table for this insert
getTableName(int) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSetMetaData
getTableName(int) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSetMetaData
Retrieves the name of the table that served as the source for the specified column.
getTableParameterMetaData() - Method in class org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
getTableParameterMetaData() - Method in interface org.springframework.jdbc.core.metadata.TableMetaDataProvider
Get the table parameter metadata that is currently used.
getTaglibFactory() - Method in interface org.springframework.web.servlet.view.freemarker.FreeMarkerConfig
Returns the TaglibFactory used to enable JSP tags to be accessed from FreeMarker templates.
getTaglibFactory() - Method in class org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer
Return the TaglibFactory object wrapped by this bean.
getTarget() - Method in class org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint
Returns the Spring AOP target.
getTarget() - Method in class org.springframework.aop.target.AbstractLazyCreationTargetSource
Returns the lazy-initialized target object, creating it on-the-fly if it doesn't exist already.
getTarget() - Method in class org.springframework.aop.target.AbstractPoolingTargetSource
Acquire an object from the pool.
getTarget() - Method in class org.springframework.aop.target.CommonsPoolTargetSource
Borrow an object from the ObjectPool.
getTarget() - Method in class org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource
getTarget() - Method in class org.springframework.aop.target.EmptyTargetSource
Always returns null.
getTarget() - Method in class org.springframework.aop.target.HotSwappableTargetSource
getTarget() - Method in class org.springframework.aop.target.LazyInitTargetSource
getTarget() - Method in class org.springframework.aop.target.PrototypeTargetSource
Obtain a new prototype instance for every call.
getTarget() - Method in class org.springframework.aop.target.SimpleBeanTargetSource
getTarget() - Method in class org.springframework.aop.target.SingletonTargetSource
getTarget() - Method in class org.springframework.aop.target.ThreadLocalTargetSource
Implementation of abstract getTarget() method.
getTarget() - Method in interface org.springframework.aop.TargetSource
Return a target instance.
getTarget() - Method in class org.springframework.jndi.JndiObjectTargetSource
getTarget() - Method in class org.springframework.validation.AbstractBindingResult
Return the wrapped target object.
getTarget() - Method in class org.springframework.validation.BeanPropertyBindingResult
getTarget() - Method in exception org.springframework.validation.BindException
getTarget() - Method in interface org.springframework.validation.BindingResult
Return the wrapped target object, which may be a bean, an object with public fields, a Map - depending on the concrete binding strategy.
getTarget() - Method in class org.springframework.validation.DataBinder
Return the wrapped target object.
getTarget() - Method in class org.springframework.validation.DirectFieldBindingResult
getTarget() - Method in class org.springframework.validation.MapBindingResult
getTarget() - Method in class org.springframework.web.servlet.tags.form.FormTag
Get the value of the 'target' attribute.
getTargetBeanName(String) - Static method in class org.springframework.aop.scope.ScopedProxyUtils
Generates the bean name that is used within the scoped proxy to reference the target bean.
getTargetBeanName() - Method in class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
Return the name of the target bean in the factory.
getTargetBeanName() - Method in class org.springframework.web.filter.DelegatingFilterProxy
Return the name of the target bean in the Spring application context.
getTargetBeanName(FacesContext) - Method in class org.springframework.web.jsf.DelegatingNavigationHandlerProxy
Return the name of the target NavigationHandler bean in the BeanFactory.
getTargetClass() - Method in class org.springframework.aop.framework.AdvisedSupport
getTargetClass(Object) - Static method in class org.springframework.aop.support.AopUtils
Determine the target class of the given bean instance, which might be an AOP proxy.
getTargetClass() - Method in class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
getTargetClass() - Method in class org.springframework.aop.target.AbstractLazyCreationTargetSource
This default implementation returns null if the target is null (it is hasn't yet been initialized), or the target class if the target has already been initialized.
getTargetClass() - Method in class org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource
getTargetClass() - Method in class org.springframework.aop.target.EmptyTargetSource
Always returns the specified target Class, or null if none.
getTargetClass() - Method in class org.springframework.aop.target.HotSwappableTargetSource
Return the type of the current target object.
getTargetClass() - Method in class org.springframework.aop.target.SingletonTargetSource
getTargetClass() - Method in interface org.springframework.aop.TargetClassAware
Return the target class behind the implementing object (typically a proxy configuration or an actual proxy).
getTargetClass() - Method in interface org.springframework.aop.TargetSource
Return the type of targets returned by this TargetSource.
getTargetClass() - Method in class org.springframework.beans.factory.config.FieldRetrievingFactoryBean
Return the target class on which the field is defined.
getTargetClass(Object) - Method in class org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler
Return the actual bean class of the given bean instance.
getTargetClass() - Method in class org.springframework.jndi.JndiObjectTargetSource
getTargetClass() - Method in class org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean
Overridden to support the "targetBeanName" feature.
getTargetClass() - Method in class org.springframework.util.MethodInvoker
Return the target class on which to call the target method.
getTargetConnection() - Method in interface org.springframework.jdbc.datasource.ConnectionProxy
Return the target Connection of this proxy.
getTargetConnection(Connection) - Static method in class org.springframework.jdbc.datasource.DataSourceUtils
Return the innermost target Connection of the given Connection.
getTargetConnectionFactory() - Method in class org.springframework.jca.cci.connection.DelegatingConnectionFactory
Return the target ConnectionFactory that this ConnectionFactory should delegate to.
getTargetConnectionFactory() - Method in class org.springframework.jms.connection.DelegatingConnectionFactory
Return the target ConnectionFactory that this ConnectionFactory delegates to.
getTargetConnectionFactory() - Method in class org.springframework.jms.connection.SingleConnectionFactory
Return the target ConnectionFactory which will be used to lazily create a single Connection, if any.
getTargetConnectionFactory() - Method in class org.springframework.jms.connection.TransactionAwareConnectionFactoryProxy
Return the target ConnectionFactory that this ConnectionFactory should delegate to.
getTargetDataSource() - Method in class org.springframework.jdbc.datasource.DelegatingDataSource
Return the target DataSource that this DataSource should delegate to.
getTargetEntityManager() - Method in interface org.springframework.orm.jpa.EntityManagerProxy
Return the underlying EntityManager that this proxy will delegate to.
getTargetField() - Method in class org.springframework.beans.factory.config.FieldRetrievingFactoryBean
Return the name of the field to be retrieved.
getTargetInterfaceName() - Method in interface org.springframework.remoting.rmi.RmiInvocationHandler
Return the name of the target interface that this invoker operates on.
getTargetMap() - Method in class org.springframework.validation.MapBindingResult
getTargetMethod() - Method in class org.springframework.util.MethodInvoker
Return the name of the method to be invoked.
getTargetObject() - Method in class org.springframework.aop.scope.DefaultScopedObject
getTargetObject() - Method in interface org.springframework.aop.scope.ScopedObject
Return the current target object behind this scoped object proxy, in its raw form (as stored in the target scope).
getTargetObject() - Method in class org.springframework.beans.factory.config.FieldRetrievingFactoryBean
Return the target object on which the field is defined.
getTargetObject() - Method in class org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean
Overridden to support the "targetBeanName" feature.
getTargetObject() - Method in class org.springframework.util.MethodInvoker
Return the target object on which to call the target method.
getTargetPage(PortletRequest, Object, Errors, int) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Return the target page specified in the request.
getTargetPage(PortletRequest, int) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Return the target page specified in the request.
getTargetPage(PortletRequest, String, int) - Static method in class org.springframework.web.portlet.util.PortletUtils
Return the target page specified in the request.
getTargetPage(HttpServletRequest, Object, Errors, int) - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Return the target page specified in the request.
getTargetPage(HttpServletRequest, int) - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Return the target page specified in the request.
getTargetPage(ServletRequest, String, int) - Static method in class org.springframework.web.util.WebUtils
Return the target page specified in the request.
getTargetPersistenceManagerFactory() - Method in class org.springframework.orm.jdo.TransactionAwarePersistenceManagerFactoryProxy
Return the target JDO PersistenceManagerFactory that this proxy delegates to.
getTargetSession(Session) - Static method in class org.springframework.jms.connection.ConnectionFactoryUtils
Return the innermost target Session of the given Session.
getTargetSession() - Method in interface org.springframework.jms.connection.SessionProxy
Return the target Session of this proxy.
getTargetSource() - Method in interface org.springframework.aop.framework.Advised
Return the TargetSource used by this Advised object.
getTargetSource() - Method in class org.springframework.aop.framework.AdvisedSupport
getTargetSource(Class<?>, String) - Method in class org.springframework.aop.framework.autoproxy.target.AbstractBeanFactoryBasedTargetSourceCreator
getTargetSource(Class<?>, String) - Method in interface org.springframework.aop.framework.autoproxy.TargetSourceCreator
Create a special TargetSource for the given bean, if any.
getTargetStream() - Method in class org.springframework.mock.web.DelegatingServletOutputStream
Return the underlying target stream (never null).
getTargetType() - Method in class org.springframework.beans.factory.config.TypedStringValue
Return the type to convert to.
getTargetType() - Method in exception org.springframework.core.convert.ConversionFailedException
Return the target type we tried to convert the value to.
getTargetType() - Method in class org.springframework.core.convert.converter.GenericConverter.ConvertiblePair
getTargetType() - Method in exception org.springframework.core.convert.ConverterNotFoundException
Returns the target type that was requested to convert to.
getTargetType(MethodParameter) - Static method in class org.springframework.core.GenericTypeResolver
Determine the target type for the given parameter specification.
getTargetTypeName() - Method in class org.springframework.beans.factory.config.TypedStringValue
Return the type to convert to.
getTargetWriter() - Method in class org.springframework.mock.web.MockJspWriter
Lazily initialize the target Writer.
getTaskCount() - Method in class org.springframework.util.StopWatch
Return the number of tasks timed.
getTaskExecutor() - Method in class org.springframework.context.event.SimpleApplicationEventMulticaster
Return the current TaskExecutor for this multicaster.
getTaskInfo() - Method in class org.springframework.util.StopWatch
Return an array of the data for tasks performed.
getTaskName() - Method in class org.springframework.util.StopWatch.TaskInfo
Return the name of this task.
getTempClassLoader() - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Return the temporary ClassLoader to use for type matching purposes, if any.
getTempClassLoader() - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
getTempDir() - Method in class org.springframework.remoting.jaxrpc.ServletEndpointSupport
Deprecated. Return the temporary directory for the current web application, as provided by the servlet container.
getTempDir() - Method in class org.springframework.web.context.support.WebApplicationObjectSupport
Return the temporary directory for the current web application, as provided by the servlet container.
getTempDir() - Method in class org.springframework.web.portlet.context.PortletApplicationObjectSupport
Return the temporary directory for the current web application, as provided by the servlet container.
getTempDir(PortletContext) - Static method in class org.springframework.web.portlet.util.PortletUtils
Return the temporary directory for the current web application, as provided by the portlet container.
getTempDir() - Method in class org.springframework.web.servlet.view.tiles.ComponentControllerSupport
Deprecated. Return the temporary directory for the current web application, as provided by the servlet container.
getTempDir() - Method in class org.springframework.web.struts.ActionSupport
Deprecated. Return the temporary directory for the current web application, as provided by the servlet container.
getTempDir() - Method in class org.springframework.web.struts.DispatchActionSupport
Deprecated. Return the temporary directory for the current web application, as provided by the servlet container.
getTempDir() - Method in class org.springframework.web.struts.LookupDispatchActionSupport
Deprecated. Return the temporary directory for the current web application, as provided by the servlet container.
getTempDir() - Method in class org.springframework.web.struts.MappingDispatchActionSupport
Deprecated. Return the temporary directory for the current web application, as provided by the servlet container.
getTempDir(ServletContext) - Static method in class org.springframework.web.util.WebUtils
Return the temporary directory for the current web application, as provided by the servlet container.
getTemplate(Locale) - Method in class org.springframework.web.servlet.view.freemarker.FreeMarkerView
Retrieve the FreeMarker template for the given locale, to be rendering by this view.
getTemplate(String, Locale) - Method in class org.springframework.web.servlet.view.freemarker.FreeMarkerView
Retrieve the FreeMarker template specified by the given name, using the encoding specified by the "encoding" bean property.
getTemplate() - Method in class org.springframework.web.servlet.view.velocity.VelocityView
Retrieve the Velocity template to be rendered by this view.
getTemplate(String) - Method in class org.springframework.web.servlet.view.velocity.VelocityView
Retrieve the Velocity template specified by the given name, using the encoding specified by the "encoding" bean property.
getTemplateLoaderForPath(String) - Method in class org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
Determine a FreeMarker TemplateLoader for the given path.
getTemplates() - Method in class org.springframework.web.servlet.view.xslt.AbstractXsltView
Deprecated. Obtain the Templates object to use, based on the configured stylesheet, either a cached one or a freshly built one.
getTemplateSource(String, HttpServletRequest) - Method in class org.springframework.web.servlet.view.document.AbstractExcelView
Creates the workbook from an existing XLS document.
getTemplateSource(String, HttpServletRequest) - Method in class org.springframework.web.servlet.view.document.AbstractJExcelView
Create the workbook from an existing XLS document.
GETTERS - Static variable in class org.springframework.aop.support.Pointcuts
Pointcut matching all bean property getters, in any class
getTestClass() - Method in class org.springframework.test.context.TestContext
Get the test class for this test context.
getTestContext() - Method in class org.springframework.test.context.TestContextManager
Returns the TestContext managed by this TestContextManager.
getTestContextManager() - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
Get the TestContextManager associated with this runner.
getTestException() - Method in class org.springframework.test.context.TestContext
Get the exception that was thrown during execution of the test method.
getTestExecutionListeners() - Method in class org.springframework.test.context.TestContextManager
Gets an unmodifiable copy of the TestExecutionListeners registered for this TestContextManager.
getTestInstance() - Method in class org.springframework.test.context.TestContext
Get the current test instance for this test context.
getTestMethod() - Method in class org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests
Deprecated. Get the current test method.
getTestMethod() - Method in class org.springframework.test.context.TestContext
Get the current test method for this test context.
getText() - Method in class org.springframework.mail.SimpleMailMessage
getTextValue(Element) - Static method in class org.springframework.util.xml.DomUtils
Extract the text value from the given DOM element, ignoring XML comments.
getTheme(String) - Method in class org.springframework.ui.context.support.DelegatingThemeSource
getTheme(String) - Method in class org.springframework.ui.context.support.ResourceBundleThemeSource
This implementation returns a SimpleTheme instance, holding a ResourceBundle-based MessageSource whose basename corresponds to the given theme name (prefixed by the configured "basenamePrefix").
getTheme(String) - Method in interface org.springframework.ui.context.ThemeSource
Return the Theme instance for the given theme name.
getTheme(String) - Method in class org.springframework.web.context.support.AbstractRefreshableWebApplicationContext
getTheme(String) - Method in class org.springframework.web.context.support.GenericWebApplicationContext
getTheme(String) - Method in class org.springframework.web.context.support.StaticWebApplicationContext
getTheme() - Method in class org.springframework.web.servlet.support.RequestContext
Return the current theme (never null).
getTheme(HttpServletRequest) - Static method in class org.springframework.web.servlet.support.RequestContextUtils
Retrieves the current theme from the given request, using the ThemeResolver and ThemeSource bound to the request by the DispatcherServlet.
getThemeMessage(String, String) - Method in class org.springframework.web.servlet.support.RequestContext
Retrieve the theme message for the given code.
getThemeMessage(String, Object[], String) - Method in class org.springframework.web.servlet.support.RequestContext
Retrieve the theme message for the given code.
getThemeMessage(String, List, String) - Method in class org.springframework.web.servlet.support.RequestContext
Retrieve the theme message for the given code.
getThemeMessage(String) - Method in class org.springframework.web.servlet.support.RequestContext
Retrieve the theme message for the given code.
getThemeMessage(String, Object[]) - Method in class org.springframework.web.servlet.support.RequestContext
Retrieve the theme message for the given code.
getThemeMessage(String, List) - Method in class org.springframework.web.servlet.support.RequestContext
Retrieve the theme message for the given code.
getThemeMessage(MessageSourceResolvable) - Method in class org.springframework.web.servlet.support.RequestContext
Retrieve the given MessageSourceResolvable in the current theme.
getThemeResolver(HttpServletRequest) - Static method in class org.springframework.web.servlet.support.RequestContextUtils
Return the ThemeResolver that has been bound to the request by the DispatcherServlet.
getThemeSource() - Method in class org.springframework.web.servlet.DispatcherServlet
Return this servlet's ThemeSource, if any; else return null.
getThemeSource(HttpServletRequest) - Static method in class org.springframework.web.servlet.support.RequestContextUtils
Return the ThemeSource that has been bound to the request by the DispatcherServlet.
getThis() - Method in class org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint
Returns the Spring AOP proxy.
getThis() - Method in class org.springframework.aop.framework.ReflectiveMethodInvocation
getThreadFactory() - Method in class org.springframework.core.task.SimpleAsyncTaskExecutor
Return the external factory to use for creating new Threads, if any.
getThreadGroup() - Method in class org.springframework.util.CustomizableThreadCreator
Return the thread group that threads should be created in (or null) for the default group.
getThreadNamePrefix() - Method in class org.springframework.util.CustomizableThreadCreator
Return the thread name prefix to use for the names of newly created threads.
getThreadPoolExecutor() - Method in class org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor
Return the underlying ThreadPoolExecutor for native access.
getThreadPoolExecutor() - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
Return the underlying ThreadPoolExecutor for native access.
getThreadPriority() - Method in class org.springframework.util.CustomizableThreadCreator
Return the priority of the threads that this factory creates.
getThrowawayClassLoader() - Method in class org.springframework.context.weaving.DefaultContextLoadTimeWeaver
getThrowawayClassLoader() - Method in class org.springframework.instrument.classloading.glassfish.GlassFishLoadTimeWeaver
getThrowawayClassLoader() - Method in class org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver
This implementation always returns a SimpleThrowawayClassLoader.
getThrowawayClassLoader() - Method in class org.springframework.instrument.classloading.jboss.JBossLoadTimeWeaver
getThrowawayClassLoader() - Method in interface org.springframework.instrument.classloading.LoadTimeWeaver
Return a throwaway ClassLoader, enabling classes to be loaded and inspected without affecting the parent ClassLoader.
getThrowawayClassLoader() - Method in class org.springframework.instrument.classloading.oc4j.OC4JLoadTimeWeaver
getThrowawayClassLoader() - Method in class org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver
getThrowawayClassLoader() - Method in class org.springframework.instrument.classloading.SimpleLoadTimeWeaver
This implementation builds a SimpleThrowawayClassLoader.
getThrowawayClassLoader() - Method in class org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader
Delegate for LoadTimeWeaver's getThrowawayClassLoader method.
getThrowawayClassLoader() - Method in class org.springframework.instrument.classloading.weblogic.WebLogicLoadTimeWeaver
getTime(int, Calendar) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getTime(int) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getTime(String, Calendar) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getTime(String) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getTime(int, Calendar) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as a Time object.
getTime(int) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as a Time object.
getTime(String, Calendar) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as a Time object.
getTime(String) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as a Time object.
getTimeBetweenEvictionRunsMillis() - Method in class org.springframework.aop.target.CommonsPoolTargetSource
Return the time between eviction runs that check idle objects.
getTimeMillis() - Method in class org.springframework.util.StopWatch.TaskInfo
Return the time in milliseconds this task took.
getTimeout() - Method in exception org.springframework.transaction.InvalidTimeoutException
Return the invalid timeout value.
getTimeout() - Method in class org.springframework.transaction.support.DefaultTransactionDefinition
getTimeout() - Method in class org.springframework.transaction.support.DelegatingTransactionDefinition
getTimeout() - Method in interface org.springframework.transaction.TransactionDefinition
Return the transaction timeout.
getTimer() - Method in class org.springframework.scheduling.timer.TimerTaskExecutor
Deprecated. Return the underlying Timer behind this TimerTaskExecutor.
getTimerListener() - Method in class org.springframework.scheduling.commonj.ScheduledTimerListener
Return the TimerListener to schedule.
getTimerManager() - Method in class org.springframework.scheduling.commonj.TimerManagerAccessor
getTimerTask() - Method in class org.springframework.scheduling.timer.ScheduledTimerTask
Deprecated. Return the TimerTask to schedule.
getTimeSeconds() - Method in class org.springframework.util.StopWatch.TaskInfo
Return the time in seconds this task took.
getTimestamp() - Method in class org.springframework.context.ApplicationEvent
Return the system time in milliseconds when the event happened.
getTimestamp(int, Calendar) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getTimestamp(int) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getTimestamp(String, Calendar) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getTimestamp(String) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
getTimestamp(int, Calendar) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as a Timestamp object.
getTimestamp(int) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as a Timestamp object.
getTimestamp(String, Calendar) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as a Timestamp object.
getTimestamp(String) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves the value of the indicated column in the current row as a Timestamp object.
getTimeToLive() - Method in class org.springframework.jms.core.JmsTemplate
Return the time-to-live of the message when sending.
getTimeToLiveInMillis() - Method in class org.springframework.transaction.support.ResourceHolderSupport
Return the time to live for this object in milliseconds.
getTimeToLiveInSeconds() - Method in class org.springframework.transaction.support.ResourceHolderSupport
Return the time to live for this object in seconds.
getTimeUnit() - Method in class org.springframework.scheduling.concurrent.ScheduledExecutorTask
Return the time unit for the delay and period values.
getTimeZone() - Method in class org.springframework.format.datetime.joda.JodaTimeContext
The user's timezone.
getTitle() - Method in class org.springframework.mock.web.portlet.MockRenderResponse
getTitle(RenderRequest) - Method in class org.springframework.web.portlet.FrameworkPortlet
Overridden for friendlier behavior in unit tests.
getTitle() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Get the value of the 'title' attribute.
getTo() - Method in class org.springframework.mail.SimpleMailMessage
getToolboxConfigLocation() - Method in class org.springframework.web.servlet.view.velocity.VelocityToolboxView
Return the Velocity Toolbox config location, if any.
getTotalTimeMillis() - Method in class org.springframework.util.StopWatch
Return the total time in milliseconds for all tasks.
getTotalTimeSeconds() - Method in class org.springframework.util.StopWatch
Return the total time in seconds for all tasks.
getTransaction() - Method in class org.springframework.orm.hibernate3.SessionHolder
getTransaction(TransactionDefinition) - Method in interface org.springframework.transaction.PlatformTransactionManager
Return a currently active transaction or create a new one, according to the specified propagation behavior.
getTransaction(TransactionDefinition) - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
This implementation handles propagation behavior.
getTransaction() - Method in class org.springframework.transaction.support.DefaultTransactionStatus
Return the underlying transaction object.
getTransactionalEntityManager() - Method in class org.springframework.orm.jpa.EntityManagerFactoryAccessor
Obtain the transactional EntityManager for this accessor's EntityManagerFactory, if any.
getTransactionalEntityManager(EntityManagerFactory) - Static method in class org.springframework.orm.jpa.EntityManagerFactoryUtils
Obtain a JPA EntityManager from the given factory.
getTransactionalEntityManager(EntityManagerFactory, Map) - Static method in class org.springframework.orm.jpa.EntityManagerFactoryUtils
Obtain a JPA EntityManager from the given factory.
getTransactionalQueueSession(QueueConnectionFactory, QueueConnection, boolean) - Static method in class org.springframework.jms.connection.ConnectionFactoryUtils
Obtain a JMS QueueSession that is synchronized with the current transaction, if any.
getTransactionalSession(ConnectionFactory, Connection, boolean) - Static method in class org.springframework.jms.connection.ConnectionFactoryUtils
Obtain a JMS Session that is synchronized with the current transaction, if any.
getTransactionalTopicSession(TopicConnectionFactory, TopicConnection, boolean) - Static method in class org.springframework.jms.connection.ConnectionFactoryUtils
Obtain a JMS TopicSession that is synchronized with the current transaction, if any.
getTransactionAttribute(Method, Class) - Method in class org.springframework.transaction.interceptor.AbstractFallbackTransactionAttributeSource
Determine the transaction attribute for this method invocation.
getTransactionAttribute(Method, Class) - Method in class org.springframework.transaction.interceptor.CompositeTransactionAttributeSource
getTransactionAttribute(Method, Class) - Method in class org.springframework.transaction.interceptor.MatchAlwaysTransactionAttributeSource
getTransactionAttribute(Method, Class) - Method in class org.springframework.transaction.interceptor.MethodMapTransactionAttributeSource
getTransactionAttribute(Method, Class) - Method in class org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource
getTransactionAttribute() - Method in class org.springframework.transaction.interceptor.TransactionAspectSupport.TransactionInfo
getTransactionAttribute(Method, Class) - Method in interface org.springframework.transaction.interceptor.TransactionAttributeSource
Return the transaction attribute for this method.
getTransactionAttributeSource() - Method in class org.springframework.transaction.interceptor.TransactionAspectSupport
Return the transaction attribute source.
getTransactionAttributeSources() - Method in class org.springframework.transaction.interceptor.CompositeTransactionAttributeSource
Return the TransactionAttributeSource instances that this CompositeTransactionAttributeSource combines.
getTransactionAwareConnectionProxy(Connection, ConnectionFactory) - Method in class org.springframework.jca.cci.connection.TransactionAwareConnectionFactoryProxy
Wrap the given Connection with a proxy that delegates every method call to it but delegates close calls to ConnectionFactoryUtils.
getTransactionAwareConnectionProxy(DataSource) - Method in class org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy
Wraps the given Connection with a proxy that delegates every method call to it but delegates close() calls to DataSourceUtils.
getTransactionAwareConnectionProxy(Connection) - Method in class org.springframework.jms.connection.TransactionAwareConnectionFactoryProxy
Wrap the given Connection with a proxy that delegates every method call to it but handles Session lookup in a transaction-aware fashion.
getTransactionIdentifier(Transaction) - Method in class org.springframework.orm.hibernate3.LocalTransactionManagerLookup
getTransactionManager() - Method in class org.springframework.jms.listener.AbstractPollingMessageListenerContainer
Return the Spring PlatformTransactionManager to use for transactional wrapping of message reception plus listener execution.
getTransactionManager(Properties) - Method in class org.springframework.orm.hibernate3.LocalTransactionManagerLookup
getTransactionManager(TestContext) - Method in class org.springframework.test.context.transaction.TransactionalTestExecutionListener
Get the transaction manager to use for the supplied test context.
getTransactionManager() - Method in class org.springframework.transaction.interceptor.TransactionAspectSupport
Return the transaction manager, if specified.
getTransactionManager() - Method in class org.springframework.transaction.interceptor.TransactionAspectSupport.TransactionInfo
getTransactionManager(BeanFactory, String) - Static method in class org.springframework.transaction.interceptor.TransactionAspectUtils
Obtain a PlatformTransactionManager from the given BeanFactory, matching the given qualifier.
getTransactionManager(ConfigurableListableBeanFactory, String) - Static method in class org.springframework.transaction.interceptor.TransactionAspectUtils
Obtain a PlatformTransactionManager from the given BeanFactory, matching the given qualifier.
getTransactionManager() - Method in class org.springframework.transaction.jta.JtaTransactionManager
Return the JTA TransactionManager that this transaction manager uses.
getTransactionManager() - Method in class org.springframework.transaction.jta.ManagedTransactionAdapter
Return the JTA TransactionManager that this adapter delegates to.
getTransactionManager() - Method in class org.springframework.transaction.jta.UserTransactionAdapter
Return the JTA TransactionManager that this adapter delegates to.
getTransactionManager() - Method in class org.springframework.transaction.support.TransactionTemplate
Return the transaction management strategy to be used.
getTransactionManagerBeanName() - Method in class org.springframework.transaction.interceptor.TransactionAspectSupport
Return the name of the default transaction manager bean.
getTransactionManagerName() - Method in class org.springframework.test.context.transaction.TransactionConfigurationAttributes
Get the bean name of the PlatformTransactionManager that is to be used to drive transactions.
getTransactionStatus() - Method in class org.springframework.transaction.interceptor.TransactionAspectSupport.TransactionInfo
getTransactionSynchronization() - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Return if this transaction manager should activate the thread-bound transaction synchronization support.
getTransactionType() - Method in class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo
getTransformerFactory() - Method in class org.springframework.web.servlet.view.xslt.AbstractXsltView
Deprecated. Return the TransformerFactory used by this view.
getTransformerFactory() - Method in class org.springframework.web.servlet.view.xslt.XsltView
Return the TransformerFactory that this XsltView uses.
getTransientDataAccessResourceCodes() - Method in class org.springframework.jdbc.support.SQLErrorCodes
getTransport(Session) - Method in class org.springframework.mail.javamail.JavaMailSenderImpl
Obtain a Transport object from the given JavaMail Session, using the configured protocol.
getTraversableResolver() - Method in class org.springframework.validation.beanvalidation.LocalValidatorFactoryBean
getType(ELContext, Object, Object) - Method in class org.springframework.beans.factory.access.el.SpringBeanELResolver
getType(String) - Method in interface org.springframework.beans.factory.BeanFactory
Determine the type of the bean with the given name.
getType() - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues.ValueHolder
Return the type of the constructor argument.
getType(String) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
getType(String) - Method in class org.springframework.beans.factory.support.StaticListableBeanFactory
getType(String) - Method in class org.springframework.context.support.AbstractApplicationContext
getType() - Method in class org.springframework.core.convert.TypeDescriptor
Determine the declared (non-generic) type of the wrapped parameter/field.
getType() - Method in class org.springframework.core.enums.AbstractLabeledEnum
Deprecated.
getType() - Method in interface org.springframework.core.enums.LabeledEnum
Deprecated. Return this enumeration's type.
getType() - Method in enum org.springframework.expression.spel.ast.TypeCode
getType() - Method in class org.springframework.http.MediaType
Return the primary type.
getType(String) - Method in class org.springframework.jndi.support.SimpleJndiBeanFactory
getType(ELContext, Object, Object) - Method in class org.springframework.web.jsf.el.WebApplicationContextFacesELResolver
getType() - Method in class org.springframework.web.servlet.tags.form.InputTag
Get the value of the 'type' attribute.
getType() - Method in class org.springframework.web.servlet.tags.form.PasswordInputTag
Return 'password' causing the rendered HTML 'input' element to have a 'type' of 'password'.
getTypeClass() - Method in class org.springframework.orm.hibernate3.TypeDefinitionBean
Return the type implementation class.
getTypeComparator() - Method in interface org.springframework.expression.EvaluationContext
getTypeComparator() - Method in class org.springframework.expression.spel.ExpressionState
getTypeComparator() - Method in class org.springframework.expression.spel.support.StandardEvaluationContext
getTypeConverter() - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Obtain a type converter as used by this BeanFactory.
getTypeConverter() - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
getTypeConverter() - Method in class org.springframework.beans.support.ArgumentConvertingMethodInvoker
Return the TypeConverter used for argument type conversion.
getTypeConverter() - Method in interface org.springframework.expression.EvaluationContext
getTypeConverter() - Method in class org.springframework.expression.spel.support.StandardEvaluationContext
getTypeConverter() - Method in class org.springframework.validation.DataBinder
Return the underlying TypeConverter of this binder's BindingResult.
getTypeDescriptor() - Method in class org.springframework.expression.TypedValue
getTypeDifferenceWeight(Class[], Object[]) - Static method in class org.springframework.util.MethodInvoker
Algorithm that judges the match between the declared parameter types of a candidate method and a specific list of arguments that this method is supposed to be invoked with.
getTypedValue(ExpressionState) - Method in class org.springframework.expression.spel.ast.SpelNodeImpl
getTypedValue(ExpressionState) - Method in interface org.springframework.expression.spel.SpelNode
Evaluate the expression node in the context of the supplied expression state and return the typed value.
getTypedValue(SqlParameterSource, String) - Static method in class org.springframework.jdbc.core.namedparam.SqlParameterSourceUtils
Create a wrapped value if parameter has type information, plain object if not.
getTypeForFactoryBean(String, RootBeanDefinition) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
This implementation checks the FactoryBean's getObjectType method on a plain instance of the FactoryBean, without bean properties applied yet.
getTypeForFactoryBean(String, RootBeanDefinition) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Determine the bean type for the given FactoryBean definition, as far as possible.
getTypeForFactoryBean(FactoryBean) - Method in class org.springframework.beans.factory.support.FactoryBeanRegistrySupport
Determine the type for the given FactoryBean.
getTypeForFactoryMethod(String, RootBeanDefinition, Class[]) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Determine the bean type for the given bean definition which is based on a factory method.
getTypeIndexForCurrentLevel() - Method in class org.springframework.core.MethodParameter
Return the type index for the current nesting level.
getTypeIndexForLevel(int) - Method in class org.springframework.core.MethodParameter
Return the type index for the specified nesting level.
getTypeLevelMapping() - Method in class org.springframework.web.bind.annotation.support.HandlerMethodResolver
getTypeLocator() - Method in interface org.springframework.expression.EvaluationContext
getTypeLocator() - Method in class org.springframework.expression.spel.support.StandardEvaluationContext
getTypeName() - Method in class org.springframework.beans.factory.support.AutowireCandidateQualifier
Retrieve the type name.
getTypeName() - Method in class org.springframework.jdbc.core.metadata.CallParameterMetaData
Get the parameter type name.
getTypeName(String) - Method in class org.springframework.jdbc.core.namedparam.AbstractSqlParameterSource
Return the type name for the given parameter, if registered.
getTypeName(String) - Method in interface org.springframework.jdbc.core.namedparam.SqlParameterSource
Determine the type name for the specified named parameter.
getTypeName() - Method in class org.springframework.jdbc.core.SqlParameter
Return the type name of the parameter, if any.
getTypeName() - Method in class org.springframework.orm.hibernate3.TypeDefinitionBean
Return the name of the type.
getTypePattern() - Method in class org.springframework.aop.aspectj.TypePatternClassFilter
getTypeValue(CallableStatement, int, int, String) - Method in interface org.springframework.jdbc.core.SqlReturnType
Get the type value from the specific object.
getUnit() - Method in class org.springframework.jmx.export.metadata.ManagedMetric
The expected unit of measurement values.
getURI() - Method in class org.springframework.core.io.AbstractResource
This implementation builds a URI based on the URL returned by AbstractResource.getURL().
getURI() - Method in class org.springframework.core.io.FileSystemResource
This implementation returns a URI for the underlying file.
getURI() - Method in interface org.springframework.core.io.Resource
Return a URI handle for this resource.
getURI() - Method in class org.springframework.core.io.UrlResource
This implementation returns the underlying URI directly, if possible.
getURI() - Method in class org.springframework.core.io.VfsResource
getURL() - Method in class org.springframework.core.io.AbstractResource
This implementation throws a FileNotFoundException, assuming that the resource cannot be resolved to a URL.
getURL() - Method in class org.springframework.core.io.ClassPathResource
This implementation returns a URL for the underlying class path resource.
getURL() - Method in class org.springframework.core.io.FileSystemResource
This implementation returns a URL for the underlying file.
getURL() - Method in interface org.springframework.core.io.Resource
Return a URL handle for this resource.
getURL() - Method in class org.springframework.core.io.UrlResource
This implementation returns the underlying URL reference.
getURL() - Method in class org.springframework.core.io.VfsResource
getUrl() - Method in class org.springframework.jdbc.datasource.AbstractDriverBasedDataSource
Return the JDBC URL to use for connecting through the Driver.
getURL(String) - Static method in class org.springframework.util.ResourceUtils
Resolve the given resource location to a java.net.URL.
getURL() - Method in class org.springframework.web.context.support.ServletContextResource
This implementation delegates to ServletContext.getResource, but throws a FileNotFoundException if no resource found.
getURL() - Method in class org.springframework.web.portlet.context.PortletContextResource
This implementation delegates to PortletContext.getResource, but throws a FileNotFoundException if no resource found.
getUrl() - Method in class org.springframework.web.servlet.view.AbstractUrlBasedView
Return the URL of the resource that this view wraps.
getUrlMap() - Method in class org.springframework.web.servlet.handler.SimpleUrlHandlerMapping
Allow Map access to the URL path mappings, with the option to add or override specific entries.
getUrlPathHelper() - Method in class org.springframework.web.servlet.mvc.AbstractUrlViewController
Return the UrlPathHelper to use for the resolution of lookup paths.
getUrlPathHelper() - Method in class org.springframework.web.servlet.support.RequestContext
Return the UrlPathHelper used for context path and request URI decoding.
getUserAttribute(String) - Method in class org.springframework.aop.framework.ReflectiveMethodInvocation
getUserAttribute(String) - Method in interface org.springframework.aop.ProxyMethodInvocation
Return the value of the specified user attribute.
getUserAttributes() - Method in class org.springframework.aop.framework.ReflectiveMethodInvocation
Return user attributes associated with this invocation.
getUserClass(Object) - Static method in class org.springframework.util.ClassUtils
Return the user-defined class for the given instance: usually simply the class of the given instance, but the original class in case of a CGLIB-generated subclass.
getUserClass(Class<?>) - Static method in class org.springframework.util.ClassUtils
Return the user-defined class for the given class: usually simply the given class, but the original class in case of a CGLIB-generated subclass.
getUserName() - Method in interface org.springframework.jdbc.core.metadata.CallMetaDataProvider
Get the name of the current user.
getUserName() - Method in class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
getUsername() - Method in class org.springframework.jdbc.datasource.AbstractDriverBasedDataSource
Return the JDBC username to use for connecting through the Driver.
getUsername() - Method in class org.springframework.mail.javamail.JavaMailSenderImpl
Return the username for the account at the mail host.
getUsername() - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Return the username to specify on the stub or call.
getUsername() - Method in class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
Return the username to specify on the stub.
getUserName() - Method in class org.springframework.web.context.support.RequestHandledEvent
Return the name of the user that was associated with the request (usually the UserPrincipal).
getUsernameForRequest(PortletRequest) - Method in class org.springframework.web.portlet.FrameworkPortlet
Determine the username for the given request.
getUsernameForRequest(HttpServletRequest) - Method in class org.springframework.web.servlet.FrameworkServlet
Determine the username for the given request.
getUserPrincipal() - Method in class org.springframework.mock.web.MockHttpServletRequest
getUserPrincipal() - Method in class org.springframework.mock.web.portlet.MockPortletRequest
getUserPrincipal() - Method in class org.springframework.web.context.request.FacesWebRequest
getUserPrincipal() - Method in class org.springframework.web.context.request.ServletWebRequest
getUserPrincipal() - Method in interface org.springframework.web.context.request.WebRequest
Return the user principal for this request, if any.
getUserPrincipal() - Method in class org.springframework.web.portlet.context.PortletWebRequest
getUserTransaction() - Method in class org.springframework.transaction.jta.JtaTransactionManager
Return the JTA UserTransaction that this transaction manager uses.
getUserTransaction() - Method in class org.springframework.transaction.jta.JtaTransactionObject
Return the JTA UserTransaction object for the current transaction.
getUserTransactionName() - Method in class org.springframework.orm.hibernate3.LocalTransactionManagerLookup
getValidatedSession() - Method in class org.springframework.orm.hibernate3.SessionHolder
getValidatedSession(Object) - Method in class org.springframework.orm.hibernate3.SessionHolder
getValidationMode() - Method in class org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Return the validation mode to use.
getValidationModeForResource(Resource) - Method in class org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Gets the validation mode for the specified Resource.
getValidationPropertyMap() - Method in class org.springframework.validation.beanvalidation.LocalValidatorFactoryBean
Allow Map access to the bean validation properties to be passed to the validation provider, with the option to add or override specific entries.
getValidator() - Method in class org.springframework.validation.beanvalidation.LocalValidatorFactoryBean
getValidator() - Method in class org.springframework.validation.DataBinder
Return the Validator to apply after each binding step, if any.
getValidator() - Method in class org.springframework.web.bind.support.ConfigurableWebBindingInitializer
Return the Validator to apply after each binding step, if any.
getValidator() - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated.
getValidator() - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Return the primary Validator for this controller.
getValidators() - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Return the Validators for this controller.
getValidators() - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Return the Validators for this controller.
getValidators() - Method in class org.springframework.web.servlet.mvc.multiaction.MultiActionController
Return the Validators for this controller.
getValue() - Method in class org.springframework.beans.BeanMetadataAttribute
Return the value of the attribute.
getValue(ELContext, Object, Object) - Method in class org.springframework.beans.factory.access.el.SpringBeanELResolver
getValue() - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues.ValueHolder
Return the value for the constructor argument.
getValue() - Method in class org.springframework.beans.factory.config.TypedStringValue
Return the String value.
getValue() - Method in exception org.springframework.beans.PropertyAccessException
Return the affected value that was about to be set, if any.
getValue() - Method in class org.springframework.beans.PropertyValue
Return the value of the property.
getValue() - Method in exception org.springframework.beans.TypeMismatchException
Return the offending value (may be null)
getValue(Annotation) - Static method in class org.springframework.core.annotation.AnnotationUtils
Retrieve the value of the "value" attribute of a single-element Annotation, given an annotation instance.
getValue(Annotation, String) - Static method in class org.springframework.core.annotation.AnnotationUtils
Retrieve the value of a named Annotation attribute, given an annotation instance.
getValue() - Method in exception org.springframework.core.convert.ConversionFailedException
Return the offending value.
getValue() - Method in class org.springframework.expression.common.CompositeStringExpression
getValue(Object) - Method in class org.springframework.expression.common.CompositeStringExpression
getValue(EvaluationContext) - Method in class org.springframework.expression.common.CompositeStringExpression
getValue(EvaluationContext, Object) - Method in class org.springframework.expression.common.CompositeStringExpression
getValue(EvaluationContext, Class<T>) - Method in class org.springframework.expression.common.CompositeStringExpression
getValue(Class<T>) - Method in class org.springframework.expression.common.CompositeStringExpression
getValue(Object, Class<T>) - Method in class org.springframework.expression.common.CompositeStringExpression
getValue(EvaluationContext, Object, Class<T>) - Method in class org.springframework.expression.common.CompositeStringExpression
getValue() - Method in class org.springframework.expression.common.LiteralExpression
getValue(EvaluationContext) - Method in class org.springframework.expression.common.LiteralExpression
getValue(Object) - Method in class org.springframework.expression.common.LiteralExpression
getValue(EvaluationContext, Class<T>) - Method in class org.springframework.expression.common.LiteralExpression
getValue(Class<T>) - Method in class org.springframework.expression.common.LiteralExpression
getValue(Object, Class<T>) - Method in class org.springframework.expression.common.LiteralExpression
getValue(EvaluationContext, Object) - Method in class org.springframework.expression.common.LiteralExpression
getValue(EvaluationContext, Object, Class<T>) - Method in class org.springframework.expression.common.LiteralExpression
getValue() - Method in interface org.springframework.expression.Expression
Evaluate this expression in the default standard context.
getValue(Object) - Method in interface org.springframework.expression.Expression
Evaluate this expression against the specified root object
getValue(Class<T>) - Method in interface org.springframework.expression.Expression
Evaluate the expression in the default context.
getValue(Object, Class<T>) - Method in interface org.springframework.expression.Expression
Evaluate the expression in the default context against the specified root object.
getValue(EvaluationContext) - Method in interface org.springframework.expression.Expression
Evaluate this expression in the provided context and return the result of evaluation.
getValue(EvaluationContext, Object) - Method in interface org.springframework.expression.Expression
Evaluate this expression in the provided context and return the result of evaluation, but use the supplied root context as an override for any default root object specified in the context.
getValue(EvaluationContext, Class<T>) - Method in interface org.springframework.expression.Expression
Evaluate the expression in a specified context which can resolve references to properties, methods, types, etc - the type of the evaluation result is expected to be of a particular class and an exception will be thrown if it is not and cannot be converted to that type.
getValue(EvaluationContext, Object, Class<T>) - Method in interface org.springframework.expression.Expression
Evaluate the expression in a specified context which can resolve references to properties, methods, types, etc - the type of the evaluation result is expected to be of a particular class and an exception will be thrown if it is not and cannot be converted to that type.
getValue(ExpressionState) - Method in class org.springframework.expression.spel.ast.SpelNodeImpl
getValue(ExpressionState, Class<T>) - Method in class org.springframework.expression.spel.ast.SpelNodeImpl
getValue(ExpressionState) - Method in interface org.springframework.expression.spel.SpelNode
Evaluate the expression node in the context of the supplied expression state and return the value.
getValue() - Method in class org.springframework.expression.spel.standard.SpelExpression
getValue(Object) - Method in class org.springframework.expression.spel.standard.SpelExpression
getValue(Class<T>) - Method in class org.springframework.expression.spel.standard.SpelExpression
getValue(Object, Class<T>) - Method in class org.springframework.expression.spel.standard.SpelExpression
getValue(EvaluationContext) - Method in class org.springframework.expression.spel.standard.SpelExpression
getValue(EvaluationContext, Object) - Method in class org.springframework.expression.spel.standard.SpelExpression
getValue(EvaluationContext, Class<T>) - Method in class org.springframework.expression.spel.standard.SpelExpression
getValue(EvaluationContext, Object, Class<T>) - Method in class org.springframework.expression.spel.standard.SpelExpression
getValue() - Method in class org.springframework.expression.TypedValue
getValue(String) - Method in class org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource
getValue(String) - Method in class org.springframework.jdbc.core.namedparam.MapSqlParameterSource
getValue(String) - Method in interface org.springframework.jdbc.core.namedparam.SqlParameterSource
Return the parameter value for the requested named parameter.
getValue() - Method in class org.springframework.jdbc.core.SqlParameterValue
Return the value object that this parameter value holds.
getValue(String) - Method in class org.springframework.mock.web.MockHttpSession
getValue() - Method in class org.springframework.mock.web.portlet.MockEvent
getValue(String, String) - Method in class org.springframework.mock.web.portlet.MockPortletPreferences
getValue() - Method in class org.springframework.remoting.support.RemoteInvocationResult
Return the result value returned by a successful invocation of the target method, if any.
getValue(ELContext, Object, Object) - Method in class org.springframework.web.jsf.el.WebApplicationContextFacesELResolver
getValue() - Method in class org.springframework.web.servlet.support.BindStatus
Return the current value of the field, i.e.
getValue() - Method in class org.springframework.web.servlet.tags.form.AbstractSingleCheckedElementTag
Get the value of the 'value' attribute.
getValue() - Method in class org.springframework.web.servlet.tags.form.OptionTag
Get the 'value' attribute of the rendered HTML <option> tag.
getValue() - Method in class org.springframework.web.servlet.tags.Param
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.Assign
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.CompoundExpression
Evalutes a compound expression.
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.ConstructorReference
Implements getValue() - delegating to the code for building an array or a simple type.
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.Elvis
Evaluate the condition and if not null, return it.
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.FunctionReference
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.Identifier
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.Indexer
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.Literal
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.MethodReference
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.OpAnd
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.OpDivide
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.OpEQ
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.OperatorBetween
Returns a boolean based on whether a value is in the range expressed.
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.OperatorInstanceof
Compare the left operand to see it is an instance of the type specified as the right operand.
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.OperatorMatches
Check the first operand matches the regex specified as the second operand.
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.OperatorNot
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.OperatorPower
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.OpGE
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.OpGT
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.OpLE
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.OpLT
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.OpMinus
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.OpModulus
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.OpMultiply
Implements multiply directly here for some types of operand, otherwise delegates to any registered overloader for types it does not recognize.
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.OpNE
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.OpOr
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.OpPlus
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.Projection
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.PropertyOrFieldReference
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.QualifiedIdentifier
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.Selection
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.SpelNodeImpl
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.Ternary
Evaluate the condition and if true evaluate the first alternative, otherwise evaluate the second alternative.
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.TypeReference
getValueInternal(ExpressionState) - Method in class org.springframework.expression.spel.ast.VariableReference
getValueNames() - Method in class org.springframework.mock.web.MockHttpSession
getValues(String) - Method in class org.springframework.core.Constants
Return all values of the given group of constants.
getValues() - Method in class org.springframework.jdbc.core.namedparam.MapSqlParameterSource
Expose the current parameter values as read-only Map.
getValues(String, String[]) - Method in class org.springframework.mock.web.portlet.MockPortletPreferences
getValuesForProperty(String) - Method in class org.springframework.core.Constants
Return all values of the group of constants for the given bean property name.
getValuesForSuffix(String) - Method in class org.springframework.core.Constants
Return all values of the given group of constants.
getValueStyler() - Method in class org.springframework.core.style.DefaultToStringStyler
Return the ValueStyler used by this ToStringStyler.
getValueType(EvaluationContext) - Method in class org.springframework.expression.common.CompositeStringExpression
getValueType() - Method in class org.springframework.expression.common.CompositeStringExpression
getValueType(Object) - Method in class org.springframework.expression.common.CompositeStringExpression
getValueType(EvaluationContext, Object) - Method in class org.springframework.expression.common.CompositeStringExpression
getValueType(EvaluationContext) - Method in class org.springframework.expression.common.LiteralExpression
getValueType() - Method in class org.springframework.expression.common.LiteralExpression
getValueType(Object) - Method in class org.springframework.expression.common.LiteralExpression
getValueType(EvaluationContext, Object) - Method in class org.springframework.expression.common.LiteralExpression
getValueType() - Method in interface org.springframework.expression.Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method using the default context.
getValueType(Object) - Method in interface org.springframework.expression.Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method using the default context.
getValueType(EvaluationContext) - Method in interface org.springframework.expression.Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method for the given context.
getValueType(EvaluationContext, Object) - Method in interface org.springframework.expression.Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method for the given context.
getValueType() - Method in class org.springframework.expression.spel.standard.SpelExpression
getValueType(EvaluationContext) - Method in class org.springframework.expression.spel.standard.SpelExpression
getValueType(EvaluationContext, Object) - Method in class org.springframework.expression.spel.standard.SpelExpression
getValueType(Object) - Method in class org.springframework.expression.spel.standard.SpelExpression
getValueType() - Method in class org.springframework.web.servlet.support.BindStatus
Get the 'Class' type of the field.
getValueTypeDescriptor(EvaluationContext) - Method in class org.springframework.expression.common.CompositeStringExpression
getValueTypeDescriptor() - Method in class org.springframework.expression.common.CompositeStringExpression
getValueTypeDescriptor(Object) - Method in class org.springframework.expression.common.CompositeStringExpression
getValueTypeDescriptor(EvaluationContext, Object) - Method in class org.springframework.expression.common.CompositeStringExpression
getValueTypeDescriptor(EvaluationContext) - Method in class org.springframework.expression.common.LiteralExpression
getValueTypeDescriptor() - Method in class org.springframework.expression.common.LiteralExpression
getValueTypeDescriptor(Object) - Method in class org.springframework.expression.common.LiteralExpression
getValueTypeDescriptor(EvaluationContext, Object) - Method in class org.springframework.expression.common.LiteralExpression
getValueTypeDescriptor() - Method in interface org.springframework.expression.Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method using the default context.
getValueTypeDescriptor(Object) - Method in interface org.springframework.expression.Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method using the default context.
getValueTypeDescriptor(EvaluationContext) - Method in interface org.springframework.expression.Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method for the given context.
getValueTypeDescriptor(EvaluationContext, Object) - Method in interface org.springframework.expression.Expression
Returns the most general type that can be passed to the Expression.setValue(EvaluationContext, Object) method for the given context.
getValueTypeDescriptor() - Method in class org.springframework.expression.spel.standard.SpelExpression
getValueTypeDescriptor(Object) - Method in class org.springframework.expression.spel.standard.SpelExpression
getValueTypeDescriptor(EvaluationContext) - Method in class org.springframework.expression.spel.standard.SpelExpression
getValueTypeDescriptor(EvaluationContext, Object) - Method in class org.springframework.expression.spel.standard.SpelExpression
getValueTypeName() - Method in class org.springframework.beans.factory.support.ManagedMap
Return the default value type name (class name) to be used for this map.
getVariableName(Object) - Static method in class org.springframework.core.Conventions
Determine the conventional variable name for the supplied Object based on its concrete type.
getVariableNameForParameter(MethodParameter) - Static method in class org.springframework.core.Conventions
Determine the conventional variable name for the supplied parameter, taking the generic collection type (if any) into account.
getVariableNameForReturnType(Method) - Static method in class org.springframework.core.Conventions
Determine the conventional variable name for the return type of the supplied method, taking the generic collection type (if any) into account.
getVariableNameForReturnType(Method, Object) - Static method in class org.springframework.core.Conventions
Determine the conventional variable name for the return type of the supplied method, taking the generic collection type (if any) into account, falling back to the given return value if the method declaration is not specific enough (i.e.
getVariableNameForReturnType(Method, Class, Object) - Static method in class org.springframework.core.Conventions
Determine the conventional variable name for the return type of the supplied method, taking the generic collection type (if any) into account, falling back to the given return value if the method declaration is not specific enough (i.e.
getVariableNames() - Method in class org.springframework.web.util.UriTemplate
Return the names of the variables in the template, in order.
getVariableResolver() - Method in class org.springframework.mock.web.MockPageContext
getVelocityEngine() - Method in interface org.springframework.web.servlet.view.velocity.VelocityConfig
Return the VelocityEngine for the current web application context.
getVelocityEngine() - Method in class org.springframework.web.servlet.view.velocity.VelocityConfigurer
getVelocityEngine() - Method in class org.springframework.web.servlet.view.velocity.VelocityView
Return the VelocityEngine used by this view.
getVersion() - Static method in class org.springframework.core.SpringVersion
Return the full version string of the present Spring codebase, or null if it cannot be determined.
getView() - Method in class org.springframework.web.portlet.ModelAndView
Return the View object, or null if we are using a view name to be resolved by the DispatcherPortlet via a ViewResolver.
getView() - Method in class org.springframework.web.servlet.ModelAndView
Return the View object, or null if we are using a view name to be resolved by the DispatcherServlet via a ViewResolver.
getViewClass() - Method in class org.springframework.web.servlet.view.UrlBasedViewResolver
Return the view class to be used to create views.
getViewerPreferences() - Method in class org.springframework.web.servlet.view.document.AbstractPdfView
Return the viewer preferences for the PDF file.
getViewName() - Method in class org.springframework.web.portlet.ModelAndView
Return the view name to be resolved by the DispatcherPortlet via a ViewResolver, or null if we are using a view object.
getViewName(PortletRequest, Object, int) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Return the name of the view for the specified page of this wizard form controller.
getViewName() - Method in class org.springframework.web.portlet.mvc.ParameterizableViewController
Return the name of the view to delegate to.
getViewName() - Method in class org.springframework.web.servlet.ModelAndView
Return the view name to be resolved by the DispatcherServlet via a ViewResolver, or null if we are using a View object.
getViewName(HttpServletRequest, Object, int) - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Return the name of the view for the specified page of this wizard form controller.
getViewName() - Method in class org.springframework.web.servlet.mvc.ParameterizableViewController
Return the name of the view to delegate to.
getViewName(HttpServletRequest) - Method in interface org.springframework.web.servlet.RequestToViewNameTranslator
Translate the given HttpServletRequest into a view name.
getViewName(HttpServletRequest) - Method in class org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator
Translates the request URI of the incoming HttpServletRequest into the view name based on the configured parameters.
getViewNameForRequest(HttpServletRequest) - Method in class org.springframework.web.servlet.mvc.AbstractUrlViewController
Return the name of the view to render for this request, based on the given lookup path.
getViewNameForRequest(HttpServletRequest) - Method in class org.springframework.web.servlet.mvc.UrlFilenameViewController
Returns view name based on the URL filename, with prefix/suffix applied when appropriate.
getViewNameForUrlPath(String) - Method in class org.springframework.web.servlet.mvc.UrlFilenameViewController
Returns view name based on the URL filename, with prefix/suffix applied when appropriate.
getViewNames() - Method in class org.springframework.web.servlet.view.UrlBasedViewResolver
Return the view names (or name patterns) that can be handled by this ViewResolver.
getWebApplicationContext() - Method in class org.springframework.remoting.jaxrpc.ServletEndpointSupport
Deprecated. Return the current Spring WebApplicationContext.
getWebApplicationContext() - Method in class org.springframework.web.context.support.ContextExposingHttpServletRequest
Return the WebApplicationContext that this request runs in.
getWebApplicationContext(ServletContext) - Static method in class org.springframework.web.context.support.WebApplicationContextUtils
Find the root WebApplicationContext for this web application, which is typically loaded via ContextLoaderListener.
getWebApplicationContext(ServletContext, String) - Static method in class org.springframework.web.context.support.WebApplicationContextUtils
Find a custom WebApplicationContext for this web application.
getWebApplicationContext() - Method in class org.springframework.web.context.support.WebApplicationObjectSupport
Return the current application context as WebApplicationContext.
getWebApplicationContext(FacesContext) - Method in class org.springframework.web.jsf.DelegatingNavigationHandlerProxy
Retrieve the web application context to delegate bean name resolution to.
getWebApplicationContext(FacesContext) - Method in class org.springframework.web.jsf.DelegatingPhaseListenerMulticaster
Retrieve the web application context to delegate bean name resolution to.
getWebApplicationContext(FacesContext) - Method in class org.springframework.web.jsf.DelegatingVariableResolver
Retrieve the web application context to delegate bean name resolution to.
getWebApplicationContext(ELContext) - Method in class org.springframework.web.jsf.el.SpringBeanFacesELResolver
Retrieve the web application context to delegate bean name resolution to.
getWebApplicationContext(ELContext) - Method in class org.springframework.web.jsf.el.WebApplicationContextFacesELResolver
Retrieve the WebApplicationContext reference to expose.
getWebApplicationContext(FacesContext) - Static method in class org.springframework.web.jsf.FacesContextUtils
Find the root WebApplicationContext for this web app, which is typically loaded via ContextLoaderListener or ContextLoaderServlet.
getWebApplicationContext(FacesContext) - Method in class org.springframework.web.jsf.WebApplicationContextVariableResolver
Retrieve the WebApplicationContext reference to expose.
getWebApplicationContext(PortletContext) - Static method in class org.springframework.web.portlet.context.PortletApplicationContextUtils
Find the root WebApplicationContext for this portlet application, which is typically loaded via ContextLoaderListener or ContextLoaderServlet.
getWebApplicationContext() - Method in class org.springframework.web.servlet.FrameworkServlet
Return this servlet's WebApplicationContext.
getWebApplicationContext() - Method in class org.springframework.web.servlet.support.RequestContext
Return the current WebApplicationContext.
getWebApplicationContext(ServletRequest) - Static method in class org.springframework.web.servlet.support.RequestContextUtils
Look for the WebApplicationContext associated with the DispatcherServlet that has initiated request processing.
getWebApplicationContext(ServletRequest, ServletContext) - Static method in class org.springframework.web.servlet.support.RequestContextUtils
Look for the WebApplicationContext associated with the DispatcherServlet that has initiated request processing, and for the global context if none was found associated with the current request.
getWebApplicationContext() - Method in class org.springframework.web.servlet.view.tiles.ComponentControllerSupport
Deprecated. Return the current Spring WebApplicationContext.
getWebApplicationContext() - Method in class org.springframework.web.struts.ActionSupport
Deprecated. Return the current Spring WebApplicationContext.
getWebApplicationContext() - Method in class org.springframework.web.struts.AutowiringRequestProcessor
Deprecated. Return the current Spring WebApplicationContext.
getWebApplicationContext() - Method in class org.springframework.web.struts.AutowiringTilesRequestProcessor
Deprecated. Return the current Spring WebApplicationContext.
getWebApplicationContext() - Method in class org.springframework.web.struts.ContextLoaderPlugIn
Deprecated. Return this PlugIn's WebApplicationContext.
getWebApplicationContext(ActionServlet, ModuleConfig) - Method in class org.springframework.web.struts.DelegatingActionProxy
Deprecated. Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, falling back to the root WebApplicationContext.
getWebApplicationContext(ActionServlet, ModuleConfig) - Static method in class org.springframework.web.struts.DelegatingActionUtils
Deprecated. Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext.
getWebApplicationContext() - Method in class org.springframework.web.struts.DelegatingRequestProcessor
Deprecated. Return the WebApplicationContext that this processor delegates to.
getWebApplicationContext() - Method in class org.springframework.web.struts.DelegatingTilesRequestProcessor
Deprecated. Return the WebApplicationContext that this processor delegates to.
getWebApplicationContext() - Method in class org.springframework.web.struts.DispatchActionSupport
Deprecated. Return the current Spring WebApplicationContext.
getWebApplicationContext() - Method in class org.springframework.web.struts.LookupDispatchActionSupport
Deprecated. Return the current Spring WebApplicationContext.
getWebApplicationContext() - Method in class org.springframework.web.struts.MappingDispatchActionSupport
Deprecated. Return the current Spring WebApplicationContext.
getWebBindingInitializer() - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Return the WebBindingInitializer (if any) which will apply pre-configured configuration to every DataBinder that this controller uses.
getWebBindingInitializer() - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Return the WebBindingInitializer (if any) which will apply pre-configured configuration to every DataBinder that this controller uses.
getWebBindingInitializer() - Method in class org.springframework.web.servlet.mvc.multiaction.MultiActionController
Return the WebBindingInitializer (if any) which will apply pre-configured configuration to every DataBinder that this controller uses.
getWhenExhaustedAction() - Method in class org.springframework.aop.target.CommonsPoolTargetSource
Return the action to take when the pool is exhausted.
getWindowID() - Method in class org.springframework.mock.web.portlet.MockPortletRequest
getWindowState() - Method in class org.springframework.mock.web.portlet.MockPortletRequest
getWindowState() - Method in class org.springframework.mock.web.portlet.MockPortletURL
getWindowState() - Method in class org.springframework.mock.web.portlet.MockStateAwareResponse
getWorkManager() - Method in class org.springframework.jca.support.SimpleBootstrapContext
getWorkManager() - Static method in class org.springframework.jca.work.jboss.JBossWorkManagerUtils
Obtain the default JBoss JCA WorkManager through a JMX lookup for the default JBossWorkManagerMBean.
getWorkManager(String) - Static method in class org.springframework.jca.work.jboss.JBossWorkManagerUtils
Obtain the default JBoss JCA WorkManager through a JMX lookup for the JBossWorkManagerMBean.
getWrappedClass() - Method in interface org.springframework.beans.BeanWrapper
Return the type of the wrapped JavaBean object.
getWrappedClass() - Method in class org.springframework.beans.BeanWrapperImpl
getWrappedInstance() - Method in interface org.springframework.beans.BeanWrapper
Return the bean instance wrapped by this object, if any.
getWrappedInstance() - Method in class org.springframework.beans.BeanWrapperImpl
getWrappedObject() - Method in interface org.springframework.core.InfrastructureProxy
Return the underlying resource (never null).
getWriteMethodParameter(PropertyDescriptor) - Static method in class org.springframework.beans.BeanUtils
Obtain a new MethodParameter object for the write method of the specified property.
getWriter() - Method in class org.springframework.mock.web.MockHttpServletResponse
getWriter() - Method in class org.springframework.mock.web.portlet.MockMimeResponse
getWsdlDocumentUrl() - Method in class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
Deprecated. Return the URL of the WSDL document that describes the service.
getWsdlDocumentUrl() - Method in class org.springframework.remoting.jaxws.LocalJaxWsServiceFactory
Return the URL of the WSDL document that describes the service.
getXAResources(ActivationSpec[]) - Method in class org.springframework.jca.context.SpringContextResourceAdapter
This implementation always returns null.
getXATerminator() - Method in class org.springframework.jca.support.SimpleBootstrapContext
getXmlAsBinaryStream(ResultSet, String) - Method in class org.springframework.jdbc.support.xml.Jdbc4SqlXmlHandler
getXmlAsBinaryStream(ResultSet, int) - Method in class org.springframework.jdbc.support.xml.Jdbc4SqlXmlHandler
getXmlAsBinaryStream(ResultSet, String) - Method in interface org.springframework.jdbc.support.xml.SqlXmlHandler
Retrieve the given column as binary stream from the given ResultSet.
getXmlAsBinaryStream(ResultSet, int) - Method in interface org.springframework.jdbc.support.xml.SqlXmlHandler
Retrieve the given column as binary stream from the given ResultSet.
getXmlAsCharacterStream(ResultSet, String) - Method in class org.springframework.jdbc.support.xml.Jdbc4SqlXmlHandler
getXmlAsCharacterStream(ResultSet, int) - Method in class org.springframework.jdbc.support.xml.Jdbc4SqlXmlHandler
getXmlAsCharacterStream(ResultSet, String) - Method in interface org.springframework.jdbc.support.xml.SqlXmlHandler
Retrieve the given column as character stream from the given ResultSet.
getXmlAsCharacterStream(ResultSet, int) - Method in interface org.springframework.jdbc.support.xml.SqlXmlHandler
Retrieve the given column as character stream from the given ResultSet.
getXmlAsObject(ResultSet, String) - Method in interface org.springframework.jdbc.support.xml.SqlXmlObjectMappingHandler
Retrieve the given column as an object marshalled from the XML data retrieved from the given ResultSet.
getXmlAsObject(ResultSet, int) - Method in interface org.springframework.jdbc.support.xml.SqlXmlObjectMappingHandler
Retrieve the given column as an object marshalled from the XML data retrieved from the given ResultSet.
getXmlAsSource(ResultSet, String, Class) - Method in class org.springframework.jdbc.support.xml.Jdbc4SqlXmlHandler
getXmlAsSource(ResultSet, int, Class) - Method in class org.springframework.jdbc.support.xml.Jdbc4SqlXmlHandler
getXmlAsSource(ResultSet, String, Class) - Method in interface org.springframework.jdbc.support.xml.SqlXmlHandler
Retrieve the given column as Source implemented using the specified source class from the given ResultSet.
getXmlAsSource(ResultSet, int, Class) - Method in interface org.springframework.jdbc.support.xml.SqlXmlHandler
Retrieve the given column as Source implemented using the specified source class from the given ResultSet.
getXmlAsString(ResultSet, String) - Method in class org.springframework.jdbc.support.xml.Jdbc4SqlXmlHandler
getXmlAsString(ResultSet, int) - Method in class org.springframework.jdbc.support.xml.Jdbc4SqlXmlHandler
getXmlAsString(ResultSet, String) - Method in interface org.springframework.jdbc.support.xml.SqlXmlHandler
Retrieve the given column as String from the given ResultSet.
getXmlAsString(ResultSet, int) - Method in interface org.springframework.jdbc.support.xml.SqlXmlHandler
Retrieve the given column as String from the given ResultSet.
getXMLEventReader(Source) - Static method in class org.springframework.util.xml.StaxUtils
Return the XMLEventReader for the given StAX Source.
getXMLEventWriter(Result) - Static method in class org.springframework.util.xml.StaxUtils
Return the XMLEventWriter for the given StAX Result.
getXmlOptions() - Method in class org.springframework.oxm.xmlbeans.XmlBeansMarshaller
Return the XmlOptions.
getXmlProperties(String) - Method in class org.springframework.mock.web.portlet.MockPortletResponse
getXmlProperty(String) - Method in class org.springframework.mock.web.portlet.MockPortletResponse
getXmlPropertyNames() - Method in class org.springframework.mock.web.portlet.MockPortletResponse
getXMLStreamReader(Source) - Static method in class org.springframework.util.xml.StaxUtils
Return the XMLStreamReader for the given StAX Source.
getXMLStreamWriter(Result) - Static method in class org.springframework.util.xml.StaxUtils
Return the XMLStreamWriter for the given StAX Result.
getXStream() - Method in class org.springframework.oxm.xstream.XStreamMarshaller
Returns the XStream instance used by this marshaller.
GlassFishLoadTimeWeaver - Class in org.springframework.instrument.classloading.glassfish
LoadTimeWeaver implementation for GlassFish's InstrumentableClassLoader.
GlassFishLoadTimeWeaver() - Constructor for class org.springframework.instrument.classloading.glassfish.GlassFishLoadTimeWeaver
Creates a new instance of the GlassFishLoadTimeWeaver class using the default ClassLoader.
GlassFishLoadTimeWeaver(ClassLoader) - Constructor for class org.springframework.instrument.classloading.glassfish.GlassFishLoadTimeWeaver
Creates a new instance of the GlassFishLoadTimeWeaver class.
GlassFishWorkManagerTaskExecutor - Class in org.springframework.jca.work.glassfish
Spring TaskExecutor adapter for the GlassFish JCA WorkManager.
GlassFishWorkManagerTaskExecutor() - Constructor for class org.springframework.jca.work.glassfish.GlassFishWorkManagerTaskExecutor
GLOBAL_SUFFIX - Static variable in class org.springframework.aop.framework.ProxyFactoryBean
This suffix in a value in an interceptor list indicates to expand globals.
GlobalAdvisorAdapterRegistry - Class in org.springframework.aop.framework.adapter
Singleton to publish a shared DefaultAdvisorAdapterRegistry instance.
GlobalAdvisorAdapterRegistry() - Constructor for class org.springframework.aop.framework.adapter.GlobalAdvisorAdapterRegistry
GroovyObjectCustomizer - Interface in org.springframework.scripting.groovy
Strategy used by GroovyScriptFactory to allow the customization of a created GroovyObject.
GroovyScriptFactory - Class in org.springframework.scripting.groovy
ScriptFactory implementation for a Groovy script.
GroovyScriptFactory(String) - Constructor for class org.springframework.scripting.groovy.GroovyScriptFactory
Create a new GroovyScriptFactory for the given script source.
GroovyScriptFactory(String, GroovyObjectCustomizer) - Constructor for class org.springframework.scripting.groovy.GroovyScriptFactory
Create a new GroovyScriptFactory for the given script source, specifying a strategy interface that can create a custom MetaClass to supply missing methods and otherwise change the behavior of the object.
guessPropertyTypeFromEditors(String) - Method in class org.springframework.beans.PropertyEditorRegistrySupport
Guess the property type of the specified property from the registered custom editors (provided that they were registered for a specific type).
Overview Package Class Tree Deprecated Index Help
A B C D E F G H I J K L M N O P Q R S T U V W X


H-Index

PREV LETTER NEXT LETTER FRAMES NO FRAMES
A B C D E F G H I J K L M N O P Q R S T U V W X

H

H2SequenceMaxValueIncrementer - Class in org.springframework.jdbc.support.incrementer
DataFieldMaxValueIncrementer that retrieves the next value of a given H2 Database sequence.
H2SequenceMaxValueIncrementer() - Constructor for class org.springframework.jdbc.support.incrementer.H2SequenceMaxValueIncrementer
Default constructor for bean property style usage.
H2SequenceMaxValueIncrementer(DataSource, String) - Constructor for class org.springframework.jdbc.support.incrementer.H2SequenceMaxValueIncrementer
Convenience constructor.
handle(HttpExchange) - Method in class org.springframework.remoting.caucho.SimpleBurlapServiceExporter
Processes the incoming Burlap request and creates a Burlap response.
handle(HttpExchange) - Method in class org.springframework.remoting.caucho.SimpleHessianServiceExporter
Processes the incoming Hessian request and creates a Hessian response.
handle(HttpExchange) - Method in class org.springframework.remoting.httpinvoker.SimpleHttpInvokerServiceExporter
Reads a remote invocation from the request, executes it, and writes the remote invocation result to the response.
handle(HttpServletRequest, HttpServletResponse, Object) - Method in class org.springframework.web.servlet.handler.SimpleServletHandlerAdapter
handle(HttpServletRequest, HttpServletResponse, Object) - Method in interface org.springframework.web.servlet.HandlerAdapter
Use the given handler to handle this request.
handle(HttpServletRequest, HttpServletResponse, Object, BindException) - Method in class org.springframework.web.servlet.mvc.AbstractCommandController
Deprecated. Template method for request handling, providing a populated and validated instance of the command class, and an Errors object containing binding and validation errors.
handle(HttpServletRequest, HttpServletResponse, Object) - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
handle(HttpServletRequest, HttpServletResponse, Object) - Method in class org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter
handle(HttpServletRequest, HttpServletResponse, Object) - Method in class org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter
handleAction(ActionRequest, ActionResponse, Object) - Method in class org.springframework.web.portlet.handler.SimplePortletHandlerAdapter
handleAction(ActionRequest, ActionResponse, Object) - Method in interface org.springframework.web.portlet.HandlerAdapter
Use the given handler to handle this action request.
handleAction(ActionRequest, ActionResponse, Object, BindException) - Method in class org.springframework.web.portlet.mvc.AbstractCommandController
Deprecated. Template method for request handling, providing a populated and validated instance of the command class, and an Errors object containing binding and validation errors.
handleAction(ActionRequest, ActionResponse, Object) - Method in class org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter
handleAction(ActionRequest, ActionResponse, Object) - Method in class org.springframework.web.portlet.mvc.SimpleControllerHandlerAdapter
handleActionRequest(ActionRequest, ActionResponse) - Method in class org.springframework.web.portlet.mvc.AbstractController
handleActionRequest(ActionRequest, ActionResponse) - Method in interface org.springframework.web.portlet.mvc.Controller
Process the action request.
handleActionRequest(ActionRequest, ActionResponse) - Method in class org.springframework.web.portlet.mvc.PortletModeNameViewController
handleActionRequestInternal(ActionRequest, ActionResponse) - Method in class org.springframework.web.portlet.mvc.AbstractCommandController
Deprecated.
handleActionRequestInternal(ActionRequest, ActionResponse) - Method in class org.springframework.web.portlet.mvc.AbstractController
Subclasses are meant to override this method if the controller is expected to handle action requests.
handleActionRequestInternal(ActionRequest, ActionResponse) - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Handles action phase of two cases: form submissions and showing a new form.
handleActionRequestInternal(ActionRequest, ActionResponse) - Method in class org.springframework.web.portlet.mvc.PortletWrappingController
handleConnectFailure(MethodInvocation, Exception) - Method in class org.springframework.jmx.access.MBeanClientInterceptor
Refresh the connection and retry the MBean invocation if possible.
handleConversionNotSupported(ConversionNotSupportedException, HttpServletRequest, HttpServletResponse, Object) - Method in class org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver
Handle the case when a WebDataBinder conversion cannot occur.
handleError(Throwable) - Method in interface org.springframework.util.ErrorHandler
handleError(ClientHttpResponse) - Method in class org.springframework.web.client.DefaultResponseErrorHandler
Handles the error in the given response.
handleError(ClientHttpResponse) - Method in interface org.springframework.web.client.ResponseErrorHandler
Handles the error in the given response.
handleEvent(EventRequest, EventResponse, Object) - Method in class org.springframework.web.portlet.handler.SimplePortletHandlerAdapter
handleEvent(EventRequest, EventResponse, Object) - Method in interface org.springframework.web.portlet.HandlerAdapter
Use the given handler to handle this event request.
handleEvent(EventRequest, EventResponse, Object) - Method in class org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter
handleEvent(EventRequest, EventResponse, Object) - Method in class org.springframework.web.portlet.mvc.SimpleControllerHandlerAdapter
handleEventRequest(EventRequest, EventResponse) - Method in interface org.springframework.web.portlet.mvc.EventAwareController
Process the event request.
handleGetObject(String) - Method in class org.springframework.context.support.MessageSourceResourceBundle
This implementation resolves the code in the MessageSource.
handleHttpMediaTypeNotAcceptable(HttpMediaTypeNotAcceptableException, HttpServletRequest, HttpServletResponse, Object) - Method in class org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver
Handle the case where no message converters were found that were acceptable for the client (expressed via the Accept header.
handleHttpMediaTypeNotSupported(HttpMediaTypeNotSupportedException, HttpServletRequest, HttpServletResponse, Object) - Method in class org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver
Handle the case where no message converters were found for the PUT or POSTed content.
handleHttpMessageNotReadable(HttpMessageNotReadableException, HttpServletRequest, HttpServletResponse, Object) - Method in class org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver
Handle the case where a message converter can not read from a HTTP request.
handleHttpMessageNotWritable(HttpMessageNotWritableException, HttpServletRequest, HttpServletResponse, Object) - Method in class org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver
Handle the case where a message converter can not write to a HTTP request.
handleHttpRequestMethodNotSupported(HttpRequestMethodNotSupportedException, HttpServletRequest, HttpServletResponse, Object) - Method in class org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver
Handle the case where no request handler method was found for the particular HTTP request method.
handleInvalidSubmit(ActionRequest, ActionResponse) - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Handle an invalid submit request, e.g.
handleInvalidSubmit(ActionRequest, ActionResponse) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Handle an invalid submit request, e.g.
handleInvalidSubmit(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.mvc.AbstractFormController
Deprecated. Handle an invalid submit request, e.g.
handleInvalidSubmit(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Handle an invalid submit request, e.g.
handleInvocationTargetException(InvocationTargetException) - Static method in class org.springframework.util.ReflectionUtils
Handle the given invocation target exception.
handleListenerException(Throwable) - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Handle the given exception that arose during listener execution.
handleListenerException(Throwable) - Method in class org.springframework.jms.listener.adapter.MessageListenerAdapter
Handle the given exception that arose during listener execution.
handleListenerSetupFailure(Throwable, boolean) - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Handle the given exception that arose during setup of a listener.
handleMessage(IMessage) - Method in class org.springframework.aop.aspectj.AspectJWeaverMessageHandler
handleMissingServletRequestParameter(MissingServletRequestParameterException, HttpServletRequest, HttpServletResponse, Object) - Method in class org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver
Handle the case when a required parameter is missing.
handleMultipleRowsFound() - Method in class org.springframework.jdbc.core.support.AbstractLobStreamingResultSetExtractor
Handle the case where the ResultSet contains multiple rows.
handleNavigation(FacesContext, String, String) - Method in class org.springframework.web.jsf.DecoratingNavigationHandler
This implementation of the standard JSF handleNavigation method delegates to the overloaded variant, passing in constructor-injected NavigationHandler as argument.
handleNavigation(FacesContext, String, String, NavigationHandler) - Method in class org.springframework.web.jsf.DecoratingNavigationHandler
Special handleNavigation variant with explicit NavigationHandler argument.
handleNavigation(FacesContext, String, String) - Method in class org.springframework.web.jsf.DelegatingNavigationHandlerProxy
Handle the navigation request implied by the specified parameters, through delegating to the target bean in the Spring application context.
handleNoRowFound() - Method in class org.springframework.jdbc.core.support.AbstractLobStreamingResultSetExtractor
Handle the case where the ResultSet does not contain a row.
handleNoSuchRequestHandlingMethod(NoSuchRequestHandlingMethodException, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.mvc.multiaction.MultiActionController
Handle the case where no request handler method was found.
handleNoSuchRequestHandlingMethod(NoSuchRequestHandlingMethodException, HttpServletRequest, HttpServletResponse, Object) - Method in class org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver
Handle the case where no request handler method was found.
handleNotAuthorized(PortletRequest, PortletResponse, Object) - Method in class org.springframework.web.portlet.handler.UserRoleAuthorizationInterceptor
Handle a request that is not authorized according to this interceptor.
handleNotAuthorized(HttpServletRequest, HttpServletResponse, Object) - Method in class org.springframework.web.servlet.handler.UserRoleAuthorizationInterceptor
Handle a request that is not authorized according to this interceptor.
handlePageException(Exception) - Method in class org.springframework.mock.web.MockPageContext
handlePageException(Throwable) - Method in class org.springframework.mock.web.MockPageContext
HANDLER_ADAPTER_BEAN_NAME - Static variable in class org.springframework.web.portlet.DispatcherPortlet
Well-known name for the HandlerAdapter object in the bean factory for this namespace.
HANDLER_ADAPTER_BEAN_NAME - Static variable in class org.springframework.web.servlet.DispatcherServlet
Well-known name for the HandlerAdapter object in the bean factory for this namespace.
HANDLER_EXCEPTION_RESOLVER_BEAN_NAME - Static variable in class org.springframework.web.portlet.DispatcherPortlet
Well-known name for the HandlerExceptionResolver object in the bean factory for this namespace.
HANDLER_EXCEPTION_RESOLVER_BEAN_NAME - Static variable in class org.springframework.web.servlet.DispatcherServlet
Well-known name for the HandlerExceptionResolver object in the bean factory for this namespace.
HANDLER_EXECUTION_CHAIN_ATTRIBUTE - Static variable in class org.springframework.web.portlet.DispatcherPortlet
Request attribute to hold the currently chosen HandlerExecutionChain.
HANDLER_EXECUTION_CHAIN_ATTRIBUTE - Static variable in class org.springframework.web.servlet.DispatcherServlet
Request attribute to hold the currently chosen HandlerExecutionChain.
HANDLER_MAPPING_BEAN_NAME - Static variable in class org.springframework.web.portlet.DispatcherPortlet
Well-known name for the HandlerMapping object in the bean factory for this namespace.
HANDLER_MAPPING_BEAN_NAME - Static variable in class org.springframework.web.servlet.DispatcherServlet
Well-known name for the HandlerMapping object in the bean factory for this namespace.
HandlerAdapter - Interface in org.springframework.web.portlet
Portlet MVC framework SPI interface, allowing parameterization of core MVC workflow.
HandlerAdapter - Interface in org.springframework.web.servlet
MVC framework SPI interface, allowing parameterization of core MVC workflow.
handleReflectionException(Exception) - Static method in class org.springframework.util.ReflectionUtils
Handle the given reflection exception.
handleRemoteException(Method, RemoteException) - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Handle the given RemoteException that was thrown from a JAX-RPC port stub or JAX-RPC call invocation.
handleRender(RenderRequest, RenderResponse, Object) - Method in class org.springframework.web.portlet.handler.SimplePortletHandlerAdapter
handleRender(RenderRequest, RenderResponse, Object) - Method in interface org.springframework.web.portlet.HandlerAdapter
Use the given handler to handle this render request.
handleRender(RenderRequest, RenderResponse, Object, BindException) - Method in class org.springframework.web.portlet.mvc.AbstractCommandController
Deprecated. Template method for render request handling, providing a populated and validated instance of the command class, and an Errors object containing binding and validation errors.
handleRender(RenderRequest, RenderResponse, Object) - Method in class org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter
handleRender(RenderRequest, RenderResponse, Object) - Method in class org.springframework.web.portlet.mvc.SimpleControllerHandlerAdapter
handleRenderRequest(RenderRequest, RenderResponse) - Method in class org.springframework.web.portlet.mvc.AbstractController
handleRenderRequest(RenderRequest, RenderResponse) - Method in interface org.springframework.web.portlet.mvc.Controller
Process the render request and return a ModelAndView object which the DispatcherPortlet will render.
handleRenderRequest(RenderRequest, RenderResponse) - Method in class org.springframework.web.portlet.mvc.PortletModeNameViewController
handleRenderRequestInternal(RenderRequest, RenderResponse) - Method in class org.springframework.web.portlet.mvc.AbstractCommandController
Deprecated.
handleRenderRequestInternal(RenderRequest, RenderResponse) - Method in class org.springframework.web.portlet.mvc.AbstractController
Subclasses are meant to override this method if the controller is expected to handle render requests.
handleRenderRequestInternal(RenderRequest, RenderResponse) - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Handles render phase of two cases: form submissions and showing a new form.
handleRenderRequestInternal(RenderRequest, RenderResponse) - Method in class org.springframework.web.portlet.mvc.ParameterizableViewController
Return a ModelAndView object with the specified view name.
handleRenderRequestInternal(RenderRequest, RenderResponse) - Method in class org.springframework.web.portlet.mvc.PortletWrappingController
handleRequest(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.remoting.caucho.BurlapServiceExporter
Processes the incoming Burlap request and creates a Burlap response.
handleRequest(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.remoting.caucho.HessianServiceExporter
Processes the incoming Hessian request and creates a Hessian response.
handleRequest(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter
Reads a remote invocation from the request, executes it, and writes the remote invocation result to the response.
handleRequest(HttpServletRequest, HttpServletResponse) - Method in interface org.springframework.web.HttpRequestHandler
Process the given request, generating a response.
handleRequest(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.mvc.AbstractController
handleRequest(HttpServletRequest, HttpServletResponse) - Method in interface org.springframework.web.servlet.mvc.Controller
Process the request and return a ModelAndView object which the DispatcherServlet will render.
handleRequestInternal(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.mvc.AbstractCommandController
Deprecated.
handleRequestInternal(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.mvc.AbstractController
Template method.
handleRequestInternal(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.mvc.AbstractFormController
Deprecated. Handles two cases: form submissions and showing a new form.
handleRequestInternal(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.mvc.AbstractUrlViewController
Retrieves the URL path to use for lookup and delegates to AbstractUrlViewController.getViewNameForRequest(javax.servlet.http.HttpServletRequest).
handleRequestInternal(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.mvc.multiaction.MultiActionController
Determine a handler method and invoke it.
handleRequestInternal(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.mvc.ParameterizableViewController
Return a ModelAndView object with the specified view name.
handleRequestInternal(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.mvc.ServletForwardingController
handleRequestInternal(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.mvc.ServletWrappingController
Invoke the the wrapped Servlet instance.
handleResource(ResourceRequest, ResourceResponse, Object) - Method in class org.springframework.web.portlet.handler.SimplePortletHandlerAdapter
handleResource(ResourceRequest, ResourceResponse, Object) - Method in interface org.springframework.web.portlet.HandlerAdapter
Use the given handler to handle this resource request.
handleResource(ResourceRequest, ResourceResponse, Object) - Method in class org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter
handleResource(ResourceRequest, ResourceResponse, Object) - Method in class org.springframework.web.portlet.mvc.SimpleControllerHandlerAdapter
handleResourceRequest(ResourceRequest, ResourceResponse) - Method in interface org.springframework.web.portlet.mvc.ResourceAwareController
Process the resource request and return a ModelAndView object which the DispatcherPortlet will render.
handleResult(Object, Message, Session) - Method in class org.springframework.jms.listener.adapter.MessageListenerAdapter
Handle the given result object returned from the listener method, sending a response message back.
HandlerExceptionResolver - Interface in org.springframework.web.portlet
Interface to be implemented by objects than can resolve exceptions thrown during handler mapping or execution, in the typical case to error views.
HandlerExceptionResolver - Interface in org.springframework.web.servlet
Interface to be implemented by objects than can resolve exceptions thrown during handler mapping or execution, in the typical case to error views.
HandlerExecutionChain - Class in org.springframework.web.portlet
Handler execution chain, consisting of handler object and any handler interceptors.
HandlerExecutionChain(Object) - Constructor for class org.springframework.web.portlet.HandlerExecutionChain
Create a new HandlerExecutionChain.
HandlerExecutionChain(Object, HandlerInterceptor[]) - Constructor for class org.springframework.web.portlet.HandlerExecutionChain
Create a new HandlerExecutionChain.
HandlerExecutionChain - Class in org.springframework.web.servlet
Handler execution chain, consisting of handler object and any handler interceptors.
HandlerExecutionChain(Object) - Constructor for class org.springframework.web.servlet.HandlerExecutionChain
Create a new HandlerExecutionChain.
HandlerExecutionChain(Object, HandlerInterceptor[]) - Constructor for class org.springframework.web.servlet.HandlerExecutionChain
Create a new HandlerExecutionChain.
HandlerInterceptor - Interface in org.springframework.web.portlet
Workflow interface that allows for customized handler execution chains.
HandlerInterceptor - Interface in org.springframework.web.servlet
Workflow interface that allows for customized handler execution chains.
HandlerInterceptorAdapter - Class in org.springframework.web.portlet.handler
Abstract adapter class for the HandlerInterceptor interface, for simplified implementation of pre-only/post-only interceptors.
HandlerInterceptorAdapter() - Constructor for class org.springframework.web.portlet.handler.HandlerInterceptorAdapter
HandlerInterceptorAdapter - Class in org.springframework.web.servlet.handler
Abstract adapter class for the HandlerInterceptor interface, for simplified implementation of pre-only/post-only interceptors.
HandlerInterceptorAdapter() - Constructor for class org.springframework.web.servlet.handler.HandlerInterceptorAdapter
HandlerMapping - Interface in org.springframework.web.portlet
Interface to be implemented by objects that define a mapping between requests and handler objects.
HandlerMapping - Interface in org.springframework.web.servlet
Interface to be implemented by objects that define a mapping between requests and handler objects.
HandlerMethodInvocationException - Exception in org.springframework.web.bind.annotation.support
Exception indicating that the execution of an annotated MVC handler method failed.
HandlerMethodInvocationException(Method, Throwable) - Constructor for exception org.springframework.web.bind.annotation.support.HandlerMethodInvocationException
Create a new HandlerMethodInvocationException for the given Method handle and cause.
HandlerMethodInvoker - Class in org.springframework.web.bind.annotation.support
Support class for invoking an annotated handler method.
HandlerMethodInvoker(HandlerMethodResolver) - Constructor for class org.springframework.web.bind.annotation.support.HandlerMethodInvoker
HandlerMethodInvoker(HandlerMethodResolver, WebBindingInitializer) - Constructor for class org.springframework.web.bind.annotation.support.HandlerMethodInvoker
HandlerMethodInvoker(HandlerMethodResolver, WebBindingInitializer, SessionAttributeStore, ParameterNameDiscoverer, WebArgumentResolver[], HttpMessageConverter[]) - Constructor for class org.springframework.web.bind.annotation.support.HandlerMethodInvoker
HandlerMethodResolver - Class in org.springframework.web.bind.annotation.support
Support class for resolving web method annotations in a handler type.
HandlerMethodResolver() - Constructor for class org.springframework.web.bind.annotation.support.HandlerMethodResolver
handleTypeMismatch(TypeMismatchException, HttpServletRequest, HttpServletResponse, Object) - Method in class org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver
Handle the case when a WebDataBinder conversion error occurs.
handleWarnings(Statement) - Method in class org.springframework.jdbc.core.JdbcTemplate
Throw an SQLWarningException if we're not ignoring warnings, else log the warnings (at debug level).
handleWarnings(SQLWarning) - Method in class org.springframework.jdbc.core.JdbcTemplate
Throw an SQLWarningException if encountering an actual warning.
hasAncestorOfType(Tag, Class) - Static method in class org.springframework.web.util.TagUtils
Determine whether the supplied Tag has any ancestor tag of the supplied type.
hasAnnotatedMethods(String) - Method in interface org.springframework.core.type.AnnotationMetadata
Determine whether the underlying class has any methods that are annotated (or meta-annotated) with the given annotation type.
hasAnnotatedMethods(String) - Method in class org.springframework.core.type.StandardAnnotationMetadata
hasAnnotation(String) - Method in interface org.springframework.core.type.AnnotationMetadata
Determine whether the underlying class has an annotation of the given type defined.
hasAnnotation(String) - Method in class org.springframework.core.type.StandardAnnotationMetadata
hasAtLeastOneMethodWithName(Class<?>, String) - Static method in class org.springframework.util.ClassUtils
Does the given class or one of its superclasses at least have one or more methods with the supplied name (with any argument types)? Includes non-public methods.
hasAttribute(String) - Method in interface org.springframework.core.AttributeAccessor
Return true if the attribute identified by name exists.
hasAttribute(String) - Method in class org.springframework.core.AttributeAccessorSupport
hasBeanClass() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Return whether this definition specifies a bean class.
hasBeanFactory() - Method in class org.springframework.context.support.AbstractRefreshableApplicationContext
Determine whether this context currently holds a bean factory, i.e.
hasBeforeDeliveryBeenCalled() - Method in class org.springframework.jca.endpoint.AbstractMessageEndpointFactory.AbstractMessageEndpoint
Return whether the AbstractMessageEndpointFactory.AbstractMessageEndpoint.beforeDelivery(java.lang.reflect.Method) method of this endpoint has already been called.
hasBody() - Method in class org.springframework.http.HttpEntity
Indicates whether this entity has a body.
hasCachedContext(Object) - Method in class org.springframework.test.AbstractSpringContextTests
Deprecated. Return whether there is a cached context for the given key.
hasConnection() - Method in class org.springframework.jdbc.datasource.ConnectionHolder
Return whether this holder currently has a Connection.
hasConnectionHolder() - Method in class org.springframework.jdbc.datasource.JdbcTransactionObjectSupport
hasConstructor(Class<?>, Class<?>...) - Static method in class org.springframework.util.ClassUtils
Determine whether the given class has a public constructor with the given signature.
hasConstructorArgumentValues() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Return if there are constructor argument values defined for this bean.
hasCustomEditorForElement(Class, String) - Method in class org.springframework.beans.PropertyEditorRegistrySupport
Determine whether this registry contains a custom editor for the specified array/collection element.
hasDependentBean(String) - Method in class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
Determine whether a dependent bean has been registered for the given name.
hasDestructionAwareBeanPostProcessors() - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Return whether this factory holds a DestructionAwareBeanPostProcessor that will get applied to singleton beans on shutdown.
hasEnclosingClass() - Method in interface org.springframework.core.type.ClassMetadata
Return whether the underlying class has an enclosing class (i.e.
hasEnclosingClass() - Method in class org.springframework.core.type.StandardClassMetadata
hasError(ClientHttpResponse) - Method in class org.springframework.web.client.DefaultResponseErrorHandler
Delegates to DefaultResponseErrorHandler.hasError(HttpStatus) with the response status code.
hasError(HttpStatus) - Method in class org.springframework.web.client.DefaultResponseErrorHandler
Template method called from DefaultResponseErrorHandler.hasError(ClientHttpResponse).
hasError(ClientHttpResponse) - Method in interface org.springframework.web.client.ResponseErrorHandler
Indicates whether the given response has any errors.
hasErrors() - Method in class org.springframework.validation.AbstractBindingResult
hasErrors() - Method in class org.springframework.validation.AbstractErrors
hasErrors() - Method in exception org.springframework.validation.BindException
hasErrors() - Method in interface org.springframework.validation.Errors
Return if there were any errors.
hasErrors() - Method in class org.springframework.web.bind.EscapedErrors
hasException() - Method in class org.springframework.remoting.support.RemoteInvocationResult
Return whether this invocation result holds an exception.
hasFieldErrors() - Method in class org.springframework.validation.AbstractErrors
hasFieldErrors(String) - Method in class org.springframework.validation.AbstractErrors
hasFieldErrors() - Method in exception org.springframework.validation.BindException
hasFieldErrors(String) - Method in exception org.springframework.validation.BindException
hasFieldErrors() - Method in interface org.springframework.validation.Errors
Are there any field errors?
hasFieldErrors(String) - Method in interface org.springframework.validation.Errors
Are there any errors associated with the given field?
hasFieldErrors() - Method in class org.springframework.web.bind.EscapedErrors
hasFieldErrors(String) - Method in class org.springframework.web.bind.EscapedErrors
hasGlobalErrors() - Method in class org.springframework.validation.AbstractErrors
hasGlobalErrors() - Method in exception org.springframework.validation.BindException
hasGlobalErrors() - Method in interface org.springframework.validation.Errors
Are there any global errors?
hasGlobalErrors() - Method in class org.springframework.web.bind.EscapedErrors
HASH_CODE_KEY - Static variable in class org.springframework.jmx.export.naming.IdentityNamingStrategy
hasHandlerMethods() - Method in class org.springframework.web.bind.annotation.support.HandlerMethodResolver
hashCode() - Method in class org.springframework.aop.aspectj.AspectJExpressionPointcut
hashCode() - Method in class org.springframework.aop.aspectj.AspectJPointcutAdvisor
hashCode() - Method in class org.springframework.aop.support.AbstractPointcutAdvisor
hashCode() - Method in class org.springframework.aop.support.AbstractRegexpMethodPointcut
hashCode() - Method in class org.springframework.aop.support.ComposablePointcut
hashCode() - Method in class org.springframework.aop.support.ControlFlowPointcut
hashCode() - Method in class org.springframework.aop.support.DefaultIntroductionAdvisor
hashCode() - Method in class org.springframework.aop.support.NameMatchMethodPointcut
hashCode() - Method in class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
hashCode() - Method in class org.springframework.aop.target.EmptyTargetSource
hashCode() - Method in class org.springframework.aop.target.HotSwappableTargetSource
hashCode() - Method in class org.springframework.aop.target.SingletonTargetSource
SingletonTargetSource uses the hash code of the target object.
hashCode() - Method in class org.springframework.beans.BeanMetadataAttribute
hashCode() - Method in exception org.springframework.beans.BeansException
hashCode() - Method in class org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement
hashCode() - Method in class org.springframework.beans.factory.config.BeanDefinitionHolder
hashCode() - Method in class org.springframework.beans.factory.config.BeanExpressionContext
hashCode() - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues
hashCode() - Method in class org.springframework.beans.factory.config.RuntimeBeanNameReference
hashCode() - Method in class org.springframework.beans.factory.config.RuntimeBeanReference
hashCode() - Method in class org.springframework.beans.factory.config.TypedStringValue
hashCode() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
hashCode() - Method in class org.springframework.beans.factory.support.ChildBeanDefinition
hashCode() - Method in class org.springframework.beans.factory.support.LookupOverride
hashCode() - Method in class org.springframework.beans.factory.support.MethodOverride
hashCode() - Method in class org.springframework.beans.factory.support.MethodOverrides
hashCode() - Method in class org.springframework.beans.factory.support.ReplaceOverride
hashCode() - Method in class org.springframework.beans.MutablePropertyValues
hashCode() - Method in class org.springframework.beans.PropertyValue
hashCode() - Method in class org.springframework.beans.support.MutableSortDefinition
hashCode() - Method in class org.springframework.context.support.DefaultMessageSourceResolvable
hashCode() - Method in class org.springframework.core.AttributeAccessorSupport
hashCode() - Method in class org.springframework.core.enums.AbstractLabeledEnum
Deprecated.
hashCode() - Method in class org.springframework.core.io.AbstractResource
This implementation returns the description's hash code.
hashCode() - Method in class org.springframework.core.io.ByteArrayResource
This implementation returns the hash code based on the underlying byte array.
hashCode() - Method in class org.springframework.core.io.ClassPathResource
This implementation returns the hash code of the underlying class path location.
hashCode() - Method in class org.springframework.core.io.DescriptiveResource
This implementation returns the hash code of the underlying description String.
hashCode() - Method in class org.springframework.core.io.FileSystemResource
This implementation returns the hash code of the underlying File reference.
hashCode() - Method in class org.springframework.core.io.InputStreamResource
This implementation returns the hash code of the underlying InputStream.
hashCode() - Method in class org.springframework.core.io.support.EncodedResource
hashCode() - Method in class org.springframework.core.io.UrlResource
This implementation returns the hash code of the underlying URL reference.
hashCode() - Method in class org.springframework.core.io.VfsResource
hashCode() - Method in class org.springframework.http.HttpHeaders
hashCode() - Method in class org.springframework.http.MediaType
hashCode() - Method in class org.springframework.jmx.support.NotificationListenerHolder
hashCode() - Method in class org.springframework.mail.SimpleMailMessage
hashCode(Object) - Method in class org.springframework.orm.hibernate3.support.AbstractLobType
This implementation returns the hashCode of the given objectz.
hashCode() - Method in class org.springframework.scheduling.support.CronSequenceGenerator
hashCode() - Method in class org.springframework.scheduling.support.CronTrigger
hashCode() - Method in class org.springframework.scheduling.support.PeriodicTrigger
hashCode() - Method in class org.springframework.transaction.interceptor.MatchAlwaysTransactionAttributeSource
hashCode() - Method in class org.springframework.transaction.interceptor.MethodMapTransactionAttributeSource
hashCode() - Method in class org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource
hashCode() - Method in class org.springframework.transaction.interceptor.RollbackRuleAttribute
hashCode() - Method in class org.springframework.transaction.support.DefaultTransactionDefinition
This implementation returns toString()'s hash code.
hashCode() - Method in class org.springframework.transaction.support.DelegatingTransactionDefinition
hashCode() - Method in class org.springframework.util.AutoPopulatingList
hashCode() - Method in class org.springframework.util.comparator.BooleanComparator
hashCode() - Method in class org.springframework.util.comparator.CompoundComparator
hashCode() - Method in class org.springframework.util.comparator.InvertibleComparator
hashCode() - Method in class org.springframework.util.comparator.NullSafeComparator
hashCode() - Method in class org.springframework.util.LinkedMultiValueMap
hashCode(boolean) - Static method in class org.springframework.util.ObjectUtils
Return the same value as Boolean.hashCode().
hashCode(double) - Static method in class org.springframework.util.ObjectUtils
Return the same value as Double.hashCode().
hashCode(float) - Static method in class org.springframework.util.ObjectUtils
Return the same value as Float.hashCode().
hashCode(long) - Static method in class org.springframework.util.ObjectUtils
Return the same value as Long.hashCode().
hashCode() - Method in class org.springframework.validation.AbstractBindingResult
hashCode() - Method in exception org.springframework.validation.BindException
hashCode() - Method in class org.springframework.validation.FieldError
hashCode() - Method in class org.springframework.validation.ObjectError
hashCode() - Method in class org.springframework.web.context.support.ServletContextResource
This implementation returns the hash code of the underlying ServletContext resource location.
hashCode() - Method in class org.springframework.web.portlet.context.PortletContextResource
hasIndexedArgumentValue(int) - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues
Check whether an argument value has been registered for the given index.
hasInstantiationAwareBeanPostProcessors() - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Return whether this factory holds a InstantiationAwareBeanPostProcessor that will get applied to singleton beans on shutdown.
hasInvocationTargetException() - Method in class org.springframework.remoting.support.RemoteInvocationResult
Return whether this invocation result holds an InvocationTargetException, thrown by an invocation of the target method itself.
hasLength(String, String) - Static method in class org.springframework.util.Assert
Assert that the given String is not empty; that is, it must not be null and not the empty String.
hasLength(String) - Static method in class org.springframework.util.Assert
Assert that the given String is not empty; that is, it must not be null and not the empty String.
hasLength(CharSequence) - Static method in class org.springframework.util.StringUtils
Check that the given CharSequence is neither null nor of length 0.
hasLength(String) - Static method in class org.springframework.util.StringUtils
Check that the given String is neither null nor of length 0.
hasMetaAnnotation(String) - Method in interface org.springframework.core.type.AnnotationMetadata
Determine whether the underlying class has an annotation that is itself annotated with the meta-annotation of the given type.
hasMetaAnnotation(String) - Method in class org.springframework.core.type.StandardAnnotationMetadata
hasMethod(Class<?>, String, Class<?>...) - Static method in class org.springframework.util.ClassUtils
Determine whether the given class has a method with the given signature.
hasNext() - Method in class org.springframework.util.CompositeIterator
hasPropertyOverridesFor(String) - Method in class org.springframework.beans.factory.config.PropertyOverrideConfigurer
Were there overrides for this bean? Only valid after processing has occurred at least once.
hasQualifier(String) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Return whether this bean has the specified qualifier.
hasResource(Object) - Static method in class org.springframework.transaction.support.TransactionSynchronizationManager
Check if there is a resource for the given key bound to the current thread.
hasSavepoint() - Method in class org.springframework.transaction.support.AbstractTransactionStatus
hasSavepoint() - Method in interface org.springframework.transaction.TransactionStatus
Return whether this transaction internally carries a savepoint, that is, has been created as nested transaction based on a savepoint.
hasSessionAttributes() - Method in class org.springframework.web.bind.annotation.support.HandlerMethodResolver
hasSubmitParameter(PortletRequest, String) - Static method in class org.springframework.web.portlet.util.PortletUtils
Check if a specific input type="submit" parameter was sent in the request, either via a button (directly with name) or via an image (name + ".x" or name + ".y").
hasSubmitParameter(ServletRequest, String) - Static method in class org.springframework.web.util.WebUtils
Check if a specific input type="submit" parameter was sent in the request, either via a button (directly with name) or via an image (name + ".x" or name + ".y").
hasSuperClass() - Method in interface org.springframework.core.type.ClassMetadata
Return whether the underlying class has a super class.
hasSuperClass() - Method in class org.springframework.core.type.StandardClassMetadata
hasTargetType() - Method in class org.springframework.beans.factory.config.TypedStringValue
Return whether this typed String value carries a target type .
hasText(String, String) - Static method in class org.springframework.util.Assert
Assert that the given String has valid text content; that is, it must not be null and must contain at least one non-whitespace character.
hasText(String) - Static method in class org.springframework.util.Assert
Assert that the given String has valid text content; that is, it must not be null and must contain at least one non-whitespace character.
hasText(CharSequence) - Static method in class org.springframework.util.StringUtils
Check whether the given CharSequence has actual text.
hasText(String) - Static method in class org.springframework.util.StringUtils
Check whether the given String has actual text.
hasTimeout() - Method in class org.springframework.transaction.support.ResourceHolderSupport
Return whether this object has an associated timeout.
hasTransaction() - Method in class org.springframework.transaction.interceptor.TransactionAspectSupport.TransactionInfo
Return whether a transaction was created by this aspect, or whether we just have a placeholder to keep ThreadLocal stack integrity.
hasTransaction() - Method in class org.springframework.transaction.support.DefaultTransactionStatus
Return whether there is an actual transaction active.
hasTransactionalSession(SessionFactory) - Static method in class org.springframework.orm.hibernate3.SessionFactoryUtils
Return whether there is a transactional Hibernate Session for the current thread, that is, a Session bound to the current thread by Spring's transaction facilities.
hasTypeLevelMapping() - Method in class org.springframework.web.bind.annotation.support.HandlerMethodResolver
hasUniqueObject(Collection) - Static method in class org.springframework.util.CollectionUtils
Determine whether the given Collection only contains a single unique object.
hasValue(String) - Method in class org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource
hasValue(String) - Method in class org.springframework.jdbc.core.namedparam.MapSqlParameterSource
hasValue(String) - Method in interface org.springframework.jdbc.core.namedparam.SqlParameterSource
Determine whether there is a value for the specified named parameter.
hasView() - Method in class org.springframework.web.portlet.ModelAndView
Indicate whether or not this ModelAndView has a view, either as a view name or as a direct view instance.
hasView() - Method in class org.springframework.web.servlet.ModelAndView
Indicate whether or not this ModelAndView has a view, either as a view name or as a direct View instance.
HEADER_CONTENT_DISPOSITION - Static variable in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
Constant that defines "Content-Disposition" header.
headForHeaders(String, Object...) - Method in interface org.springframework.web.client.RestOperations
Retrieve all headers of the resource specified by the URI template.
headForHeaders(String, Map<String, ?>) - Method in interface org.springframework.web.client.RestOperations
Retrieve all headers of the resource specified by the URI template.
headForHeaders(URI) - Method in interface org.springframework.web.client.RestOperations
Retrieve all headers of the resource specified by the URL.
headForHeaders(String, Object...) - Method in class org.springframework.web.client.RestTemplate
headForHeaders(String, Map<String, ?>) - Method in class org.springframework.web.client.RestTemplate
headForHeaders(URI) - Method in class org.springframework.web.client.RestTemplate
HessianClientInterceptor - Class in org.springframework.remoting.caucho
MethodInterceptor for accessing a Hessian service.
HessianClientInterceptor() - Constructor for class org.springframework.remoting.caucho.HessianClientInterceptor
HessianExporter - Class in org.springframework.remoting.caucho
General stream-based protocol exporter for a Hessian endpoint.
HessianExporter() - Constructor for class org.springframework.remoting.caucho.HessianExporter
HessianProxyFactoryBean - Class in org.springframework.remoting.caucho
FactoryBean for Hessian proxies.
HessianProxyFactoryBean() - Constructor for class org.springframework.remoting.caucho.HessianProxyFactoryBean
HessianServiceExporter - Class in org.springframework.remoting.caucho
Servlet-API-based HTTP request handler that exports the specified service bean as Hessian service endpoint, accessible via a Hessian proxy.
HessianServiceExporter() - Constructor for class org.springframework.remoting.caucho.HessianServiceExporter
HeuristicCompletionException - Exception in org.springframework.transaction
Exception that represents a transaction failure caused by a heuristic decision on the side of the transaction coordinator.
HeuristicCompletionException(int, Throwable) - Constructor for exception org.springframework.transaction.HeuristicCompletionException
Constructor for HeuristicCompletionException.
HibernateAccessor - Class in org.springframework.orm.hibernate3
Base class for HibernateTemplate and HibernateInterceptor, defining common properties such as SessionFactory and flushing behavior.
HibernateAccessor() - Constructor for class org.springframework.orm.hibernate3.HibernateAccessor
HibernateCallback<T> - Interface in org.springframework.orm.hibernate3
Callback interface for Hibernate code.
HibernateDaoSupport - Class in org.springframework.orm.hibernate3.support
Convenient super class for Hibernate-based data access objects.
HibernateDaoSupport() - Constructor for class org.springframework.orm.hibernate3.support.HibernateDaoSupport
HibernateInterceptor - Class in org.springframework.orm.hibernate3
This interceptor binds a new Hibernate Session to the thread before a method call, closing and removing it afterwards in case of any method outcome.
HibernateInterceptor() - Constructor for class org.springframework.orm.hibernate3.HibernateInterceptor
HibernateJdbcException - Exception in org.springframework.orm.hibernate3
Hibernate-specific subclass of UncategorizedDataAccessException, for JDBC exceptions that Hibernate wrapped.
HibernateJdbcException(JDBCException) - Constructor for exception org.springframework.orm.hibernate3.HibernateJdbcException
HibernateJpaDialect - Class in org.springframework.orm.jpa.vendor
JpaDialect implementation for Hibernate EntityManager.
HibernateJpaDialect() - Constructor for class org.springframework.orm.jpa.vendor.HibernateJpaDialect
HibernateJpaVendorAdapter - Class in org.springframework.orm.jpa.vendor
JpaVendorAdapter implementation for Hibernate EntityManager.
HibernateJpaVendorAdapter() - Constructor for class org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter
HibernateObjectRetrievalFailureException - Exception in org.springframework.orm.hibernate3
Hibernate-specific subclass of ObjectRetrievalFailureException.
HibernateObjectRetrievalFailureException(UnresolvableObjectException) - Constructor for exception org.springframework.orm.hibernate3.HibernateObjectRetrievalFailureException
HibernateObjectRetrievalFailureException(WrongClassException) - Constructor for exception org.springframework.orm.hibernate3.HibernateObjectRetrievalFailureException
HibernateOperations - Interface in org.springframework.orm.hibernate3
Interface that specifies a basic set of Hibernate operations, implemented by HibernateTemplate.
HibernateOptimisticLockingFailureException - Exception in org.springframework.orm.hibernate3
Hibernate-specific subclass of ObjectOptimisticLockingFailureException.
HibernateOptimisticLockingFailureException(StaleObjectStateException) - Constructor for exception org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException
HibernateOptimisticLockingFailureException(StaleStateException) - Constructor for exception org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException
HibernateQueryException - Exception in org.springframework.orm.hibernate3
Hibernate-specific subclass of InvalidDataAccessResourceUsageException, thrown on invalid HQL query syntax.
HibernateQueryException(QueryException) - Constructor for exception org.springframework.orm.hibernate3.HibernateQueryException
HibernateSystemException - Exception in org.springframework.orm.hibernate3
Hibernate-specific subclass of UncategorizedDataAccessException, for Hibernate system errors that do not match any concrete org.springframework.dao exceptions.
HibernateSystemException(HibernateException) - Constructor for exception org.springframework.orm.hibernate3.HibernateSystemException
Create a new HibernateSystemException, wrapping an arbitrary HibernateException.
HibernateTemplate - Class in org.springframework.orm.hibernate3
Helper class that simplifies Hibernate data access code.
HibernateTemplate() - Constructor for class org.springframework.orm.hibernate3.HibernateTemplate
Create a new HibernateTemplate instance.
HibernateTemplate(SessionFactory) - Constructor for class org.springframework.orm.hibernate3.HibernateTemplate
Create a new HibernateTemplate instance.
HibernateTemplate(SessionFactory, boolean) - Constructor for class org.springframework.orm.hibernate3.HibernateTemplate
Create a new HibernateTemplate instance.
HibernateTransactionManager - Class in org.springframework.orm.hibernate3
PlatformTransactionManager implementation for a single Hibernate SessionFactory.
HibernateTransactionManager() - Constructor for class org.springframework.orm.hibernate3.HibernateTransactionManager
Create a new HibernateTransactionManager instance.
HibernateTransactionManager(SessionFactory) - Constructor for class org.springframework.orm.hibernate3.HibernateTransactionManager
Create a new HibernateTransactionManager instance.
HiddenHttpMethodFilter - Class in org.springframework.web.filter
Filter that converts posted method parameters into HTTP methods, retrievable via HttpServletRequest.getMethod().
HiddenHttpMethodFilter() - Constructor for class org.springframework.web.filter.HiddenHttpMethodFilter
HiddenInputTag - Class in org.springframework.web.servlet.tags.form
Data-binding aware JSP tag for rendering a hidden HTML 'input' field containing the databound value.
HiddenInputTag() - Constructor for class org.springframework.web.servlet.tags.form.HiddenInputTag
HierarchicalBeanFactory - Interface in org.springframework.beans.factory
Sub-interface implemented by bean factories that can be part of a hierarchy.
HierarchicalMessageSource - Interface in org.springframework.context
Sub-interface of MessageSource to be implemented by objects that can resolve messages hierarchically.
HierarchicalThemeSource - Interface in org.springframework.ui.context
Sub-interface of ThemeSource to be implemented by objects that can resolve theme messages hierarchically.
HIGHEST_PRECEDENCE - Static variable in interface org.springframework.core.Ordered
Useful constant for the highest precedence value.
HotSwappableTargetSource - Class in org.springframework.aop.target
TargetSource implementation that caches a local target object, but allows the target to be swapped while the application is running.
HotSwappableTargetSource(Object) - Constructor for class org.springframework.aop.target.HotSwappableTargetSource
Create a new HotSwappableTargetSource with the given initial target object.
HsqlMaxValueIncrementer - Class in org.springframework.jdbc.support.incrementer
DataFieldMaxValueIncrementer that increments the maximum value of a given HSQL table with the equivalent of an auto-increment column.
HsqlMaxValueIncrementer() - Constructor for class org.springframework.jdbc.support.incrementer.HsqlMaxValueIncrementer
Default constructor for bean property style usage.
HsqlMaxValueIncrementer(DataSource, String, String) - Constructor for class org.springframework.jdbc.support.incrementer.HsqlMaxValueIncrementer
Convenience constructor.
HsqlSequenceMaxValueIncrementer - Class in org.springframework.jdbc.support.incrementer
DataFieldMaxValueIncrementer that retrieves the next value of a given HSQL sequence.
HsqlSequenceMaxValueIncrementer() - Constructor for class org.springframework.jdbc.support.incrementer.HsqlSequenceMaxValueIncrementer
Default constructor for bean property style usage.
HsqlSequenceMaxValueIncrementer(DataSource, String) - Constructor for class org.springframework.jdbc.support.incrementer.HsqlSequenceMaxValueIncrementer
Convenience constructor.
HsqlTableMetaDataProvider - Class in org.springframework.jdbc.core.metadata
The HSQL specific implementation of the TableMetaDataProvider.
HsqlTableMetaDataProvider(DatabaseMetaData) - Constructor for class org.springframework.jdbc.core.metadata.HsqlTableMetaDataProvider
HTML_ESCAPE_CONTEXT_PARAM - Static variable in class org.springframework.web.util.WebUtils
HTML escape parameter at the servlet context level (i.e.
htmlEscape(String) - Static method in class org.springframework.web.util.HtmlUtils
Turn special characters into HTML character references.
htmlEscapeDecimal(String) - Static method in class org.springframework.web.util.HtmlUtils
Turn special characters into HTML character references.
htmlEscapeHex(String) - Static method in class org.springframework.web.util.HtmlUtils
Turn special characters into HTML character references.
HtmlEscapeTag - Class in org.springframework.web.servlet.tags
Sets default HTML escape value for the current page.
HtmlEscapeTag() - Constructor for class org.springframework.web.servlet.tags.HtmlEscapeTag
HtmlEscapingAwareTag - Class in org.springframework.web.servlet.tags
Superclass for tags that output content that might get HTML-escaped.
HtmlEscapingAwareTag() - Constructor for class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
htmlUnescape(String) - Static method in class org.springframework.web.util.HtmlUtils
Turn HTML character references into their plain text UNICODE equivalent.
HtmlUtils - Class in org.springframework.web.util
Utility class for HTML escaping.
HtmlUtils() - Constructor for class org.springframework.web.util.HtmlUtils
HTTP_HEADER_ACCEPT_ENCODING - Static variable in class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
HTTP_HEADER_ACCEPT_LANGUAGE - Static variable in class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
HTTP_HEADER_CONTENT_ENCODING - Static variable in class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
HTTP_HEADER_CONTENT_LENGTH - Static variable in class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
HTTP_HEADER_CONTENT_TYPE - Static variable in class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
HTTP_METHOD_POST - Static variable in class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
HttpAccessor - Class in org.springframework.http.client.support
Base class for RestTemplate and other HTTP accessing gateway helpers, defining common properties such as the ClientHttpRequestFactory to operate on.
HttpAccessor() - Constructor for class org.springframework.http.client.support.HttpAccessor
HttpClientErrorException - Exception in org.springframework.web.client
Exception thrown when an HTTP 4xx is received.
HttpClientErrorException(HttpStatus) - Constructor for exception org.springframework.web.client.HttpClientErrorException
Construct a new instance of HttpClientErrorException based on a HttpStatus.
HttpClientErrorException(HttpStatus, String) - Constructor for exception org.springframework.web.client.HttpClientErrorException
Construct a new instance of HttpClientErrorException based on a HttpStatus and status text.
HttpEntity<T> - Class in org.springframework.http
Represents an HTTP request or response entity, consisting of headers and body.
HttpEntity(T) - Constructor for class org.springframework.http.HttpEntity
Create a new HttpEntity with the given body and no headers.
HttpEntity(MultiValueMap<String, String>) - Constructor for class org.springframework.http.HttpEntity
Create a new HttpEntity with the given headers and no body.
HttpEntity(T, MultiValueMap<String, String>) - Constructor for class org.springframework.http.HttpEntity
Create a new HttpEntity with the given body and headers.
HttpHeaders - Class in org.springframework.http
Represents HTTP request and response headers, mapping string header names to list of string values.
HttpHeaders() - Constructor for class org.springframework.http.HttpHeaders
Constructs a new, empty instance of the HttpHeaders object.
HttpInputMessage - Interface in org.springframework.http
Represents an HTTP output message, consisting of headers and a readable body.
HttpInvokerClientConfiguration - Interface in org.springframework.remoting.httpinvoker
Configuration interface for executing HTTP invoker requests.
HttpInvokerClientInterceptor - Class in org.springframework.remoting.httpinvoker
MethodInterceptor for accessing an HTTP invoker service.
HttpInvokerClientInterceptor() - Constructor for class org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor
HttpInvokerProxyFactoryBean - Class in org.springframework.remoting.httpinvoker
FactoryBean for HTTP invoker proxies.
HttpInvokerProxyFactoryBean() - Constructor for class org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean
HttpInvokerRequestExecutor - Interface in org.springframework.remoting.httpinvoker
Strategy interface for actual execution of an HTTP invoker request.
HttpInvokerServiceExporter - Class in org.springframework.remoting.httpinvoker
Servlet-API-based HTTP request handler that exports the specified service bean as HTTP invoker service endpoint, accessible via an HTTP invoker proxy.
HttpInvokerServiceExporter() - Constructor for class org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter
HttpMediaTypeException - Exception in org.springframework.web
Abstract base for exceptions related to media types.
HttpMediaTypeException(String) - Constructor for exception org.springframework.web.HttpMediaTypeException
Create a new MediaTypeException.
HttpMediaTypeException(String, List<MediaType>) - Constructor for exception org.springframework.web.HttpMediaTypeException
Create a new HttpMediaTypeNotSupportedException.
HttpMediaTypeNotAcceptableException - Exception in org.springframework.web
Exception thrown when the request handler cannot generate a response that is acceptable by the client.
HttpMediaTypeNotAcceptableException(String) - Constructor for exception org.springframework.web.HttpMediaTypeNotAcceptableException
Create a new HttpMediaTypeNotAcceptableException.
HttpMediaTypeNotAcceptableException(List<MediaType>) - Constructor for exception org.springframework.web.HttpMediaTypeNotAcceptableException
Create a new HttpMediaTypeNotSupportedException.
HttpMediaTypeNotSupportedException - Exception in org.springframework.web
Exception thrown when a client POSTs or PUTs content not supported by request handler.
HttpMediaTypeNotSupportedException(String) - Constructor for exception org.springframework.web.HttpMediaTypeNotSupportedException
Create a new HttpMediaTypeNotSupportedException.
HttpMediaTypeNotSupportedException(MediaType, List<MediaType>) - Constructor for exception org.springframework.web.HttpMediaTypeNotSupportedException
Create a new HttpMediaTypeNotSupportedException.
HttpMediaTypeNotSupportedException(MediaType, List<MediaType>, String) - Constructor for exception org.springframework.web.HttpMediaTypeNotSupportedException
Create a new HttpMediaTypeNotSupportedException.
HttpMessage - Interface in org.springframework.http
Represents the base interface for HTTP request and response messages.
HttpMessageConversionException - Exception in org.springframework.http.converter
Thrown by HttpMessageConverter implementations when the conversion fails.
HttpMessageConversionException(String) - Constructor for exception org.springframework.http.converter.HttpMessageConversionException
Create a new HttpMessageConversionException.
HttpMessageConversionException(String, Throwable) - Constructor for exception org.springframework.http.converter.HttpMessageConversionException
Create a new HttpMessageConversionException.
HttpMessageConverter<T> - Interface in org.springframework.http.converter
Strategy interface that specifies a converter that can convert from and to HTTP requests and responses.
HttpMessageConverterExtractor<T> - Class in org.springframework.web.client
Response extractor that uses the given entity converters to convert the response into a type T.
HttpMessageConverterExtractor(Class<T>, List<HttpMessageConverter<?>>) - Constructor for class org.springframework.web.client.HttpMessageConverterExtractor
Creates a new instance of the HttpMessageConverterExtractor with the given response type and message converters.
HttpMessageNotReadableException - Exception in org.springframework.http.converter
Thrown by HttpMessageConverter implementations when the read method fails.
HttpMessageNotReadableException(String) - Constructor for exception org.springframework.http.converter.HttpMessageNotReadableException
Create a new HttpMessageNotReadableException.
HttpMessageNotReadableException(String, Throwable) - Constructor for exception org.springframework.http.converter.HttpMessageNotReadableException
Create a new HttpMessageNotReadableException.
HttpMessageNotWritableException - Exception in org.springframework.http.converter
Thrown by HttpMessageConverter implementations when the write method fails.
HttpMessageNotWritableException(String) - Constructor for exception org.springframework.http.converter.HttpMessageNotWritableException
Create a new HttpMessageNotWritableException.
HttpMessageNotWritableException(String, Throwable) - Constructor for exception org.springframework.http.converter.HttpMessageNotWritableException
Create a new HttpMessageNotWritableException.
HttpMethod - Enum in org.springframework.http
Java 5 enumeration of HTTP request methods.
HttpOutputMessage - Interface in org.springframework.http
Represents an HTTP output message, consisting of headers and a writable body.
HttpRequestHandler - Interface in org.springframework.web
Plain handler interface for components that process HTTP requests, analogous to a Servlet.
HttpRequestHandlerAdapter - Class in org.springframework.web.servlet.mvc
Adapter to use the plain HttpRequestHandler interface with the generic DispatcherServlet.
HttpRequestHandlerAdapter() - Constructor for class org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter
HttpRequestHandlerServlet - Class in org.springframework.web.context.support
Simple HttpServlet that delegates to an HttpRequestHandler bean defined in Spring's root web application context.
HttpRequestHandlerServlet() - Constructor for class org.springframework.web.context.support.HttpRequestHandlerServlet
HttpRequestMethodNotSupportedException - Exception in org.springframework.web
Exception thrown when a request handler does not support a specific request method.
HttpRequestMethodNotSupportedException(String) - Constructor for exception org.springframework.web.HttpRequestMethodNotSupportedException
Create a new HttpRequestMethodNotSupportedException.
HttpRequestMethodNotSupportedException(String, String[]) - Constructor for exception org.springframework.web.HttpRequestMethodNotSupportedException
Create a new HttpRequestMethodNotSupportedException.
HttpRequestMethodNotSupportedException(String, String) - Constructor for exception org.springframework.web.HttpRequestMethodNotSupportedException
Create a new HttpRequestMethodNotSupportedException.
HttpRequestMethodNotSupportedException(String, String[], String) - Constructor for exception org.springframework.web.HttpRequestMethodNotSupportedException
Create a new HttpRequestMethodNotSupportedException.
HttpServerErrorException - Exception in org.springframework.web.client
Exception thrown when an HTTP 5xx is received.
HttpServerErrorException(HttpStatus) - Constructor for exception org.springframework.web.client.HttpServerErrorException
Construct a new instance of HttpServerErrorException based on a HttpStatus.
HttpServerErrorException(HttpStatus, String) - Constructor for exception org.springframework.web.client.HttpServerErrorException
Construct a new instance of HttpServerErrorException based on a HttpStatus and status text.
HttpServletBean - Class in org.springframework.web.servlet
Simple extension of HttpServlet which treats its config parameters (init-param entries within the servlet tag in web.xml) as bean properties.
HttpServletBean() - Constructor for class org.springframework.web.servlet.HttpServletBean
HttpSessionMutexListener - Class in org.springframework.web.util
Servlet 2.3 HttpSessionListener that automatically exposes the session mutex when an HttpSession gets created.
HttpSessionMutexListener() - Constructor for class org.springframework.web.util.HttpSessionMutexListener
HttpSessionRequiredException - Exception in org.springframework.web
Exception thrown when an HTTP request handler requires a pre-existing session.
HttpSessionRequiredException(String) - Constructor for exception org.springframework.web.HttpSessionRequiredException
Create a new HttpSessionRequiredException.
HttpStatus - Enum in org.springframework.http
Java 5 enumeration of HTTP status codes.
HttpStatus.Series - Enum in org.springframework.http
Java 5 enumeration of HTTP status series.
HttpStatusCodeException - Exception in org.springframework.web.client
Abstract base class for exceptions based on an HttpStatus.
HttpStatusCodeException(HttpStatus) - Constructor for exception org.springframework.web.client.HttpStatusCodeException
Construct a new instance of HttpStatusCodeException based on a HttpStatus.
HttpStatusCodeException(HttpStatus, String) - Constructor for exception org.springframework.web.client.HttpStatusCodeException
Construct a new instance of HttpStatusCodeException based on a HttpStatus and status text.
Overview Package Class Tree Deprecated Index Help
A B C D E F G H I J K L M N O P Q R S T U V W X


I-Index

PREV LETTER NEXT LETTER FRAMES NO FRAMES
A B C D E F G H I J K L M N O P Q R S T U V W X

I

ID_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
Constant for the id attribute
ID_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Identifier - Class in org.springframework.expression.spel.ast
Identifier(String, int) - Constructor for class org.springframework.expression.spel.ast.Identifier
IDENTITY_OBJECT_NAME_KEY - Static variable in class org.springframework.jmx.support.JmxUtils
The key used when extending an existing ObjectName with the identity hash code of its corresponding managed resource.
IdentityNamingStrategy - Class in org.springframework.jmx.export.naming
An implementation of the ObjectNamingStrategy interface that creates a name based on the the identity of a given instance.
IdentityNamingStrategy() - Constructor for class org.springframework.jmx.export.naming.IdentityNamingStrategy
identityToString(Object) - Static method in class org.springframework.util.ObjectUtils
Return a String representation of an object's overall identity.
IDREF_ELEMENT - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
IdTransferringMergeEventListener - Class in org.springframework.orm.hibernate3.support
Extension of Hibernate's DefaultMergeEventListener, transferring the ids of newly saved objects to the corresponding original objects (that are part of the detached object graph passed into the merge method).
IdTransferringMergeEventListener() - Constructor for class org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener
IfProfileValue - Annotation Type in org.springframework.test.annotation
Test annotation to indicate that a test is enabled for a specific testing profile or environment.
ignore(IMessage.Kind) - Method in class org.springframework.aop.aspectj.AspectJWeaverMessageHandler
ignoreDependencyInterface(Class) - Method in interface org.springframework.beans.factory.config.ConfigurableListableBeanFactory
Ignore the given dependency interface for autowiring.
ignoreDependencyInterface(Class) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Ignore the given dependency interface for autowiring.
ignoreDependencyType(Class) - Method in interface org.springframework.beans.factory.config.ConfigurableListableBeanFactory
Ignore the given dependency type for autowiring: for example, String.
ignoreDependencyType(Class) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Ignore the given dependency type for autowiring: for example, String.
ignoreResourceType(String) - Method in class org.springframework.context.annotation.CommonAnnotationBeanPostProcessor
Ignore the given resource type when resolving @Resource annotations.
IllegalStateException - Exception in org.springframework.jms
Runtime exception mirroring the JMS IllegalStateException.
IllegalStateException(IllegalStateException) - Constructor for exception org.springframework.jms.IllegalStateException
IllegalTransactionStateException - Exception in org.springframework.transaction
Exception thrown when the existence or non-existence of a transaction amounts to an illegal state according to the transaction propagation behavior that applies.
IllegalTransactionStateException(String) - Constructor for exception org.springframework.transaction.IllegalTransactionStateException
Constructor for IllegalTransactionStateException.
IllegalTransactionStateException(String, Throwable) - Constructor for exception org.springframework.transaction.IllegalTransactionStateException
Constructor for IllegalTransactionStateException.
IMAGE_GIF - Static variable in class org.springframework.http.MediaType
Public constant media type for image/gif.
IMAGE_JPEG - Static variable in class org.springframework.http.MediaType
Public constant media type for image/jpeg.
IMAGE_PNG - Static variable in class org.springframework.http.MediaType
Public constant media type for image/png.
implementInterfacesOnObject(Object) - Method in class org.springframework.aop.support.IntroductionInfoSupport
Publish all interfaces that the given delegate implements at the proxy level.
implementsInterface(Class<?>) - Method in interface org.springframework.aop.DynamicIntroductionAdvice
Does this introduction advice implement the given interface?
implementsInterface(Class) - Method in class org.springframework.aop.support.IntroductionInfoSupport
Check whether the specified interfaces is a published introduction interface.
Import - Annotation Type in org.springframework.context.annotation
Indicates one or more Configuration classes to import.
IMPORT_ELEMENT - Static variable in class org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader
importBeanDefinitionResource(Element) - Method in class org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader
Parse an "import" element and load the bean definitions from the given resource into the bean factory.
ImportDefinition - Class in org.springframework.beans.factory.parsing
Representation of an import that has been processed during the parsing process.
ImportDefinition(String) - Constructor for class org.springframework.beans.factory.parsing.ImportDefinition
Create a new ImportDefinition.
ImportDefinition(String, Object) - Constructor for class org.springframework.beans.factory.parsing.ImportDefinition
Create a new ImportDefinition.
ImportDefinition(String, Resource[], Object) - Constructor for class org.springframework.beans.factory.parsing.ImportDefinition
Create a new ImportDefinition.
importProcessed(ImportDefinition) - Method in class org.springframework.beans.factory.parsing.EmptyReaderEventListener
importProcessed(ImportDefinition) - Method in interface org.springframework.beans.factory.parsing.ReaderEventListener
Notification that the given import has been processed.
ImportResource - Annotation Type in org.springframework.context.annotation
Indicates one or more resources containing bean definitions to import.
include(String) - Method in class org.springframework.mock.web.MockPageContext
include(String, boolean) - Method in class org.springframework.mock.web.MockPageContext
include(ServletRequest, ServletResponse) - Method in class org.springframework.mock.web.MockRequestDispatcher
include(RenderRequest, RenderResponse) - Method in class org.springframework.mock.web.portlet.MockPortletRequestDispatcher
include(PortletRequest, PortletResponse) - Method in class org.springframework.mock.web.portlet.MockPortletRequestDispatcher
INCLUDE_CONTEXT_PATH_ATTRIBUTE - Static variable in class org.springframework.web.util.WebUtils
INCLUDE_PATH_INFO_ATTRIBUTE - Static variable in class org.springframework.web.util.WebUtils
INCLUDE_QUERY_STRING_ATTRIBUTE - Static variable in class org.springframework.web.util.WebUtils
INCLUDE_REQUEST_URI_ATTRIBUTE - Static variable in class org.springframework.web.util.WebUtils
Standard Servlet 2.3+ spec request attributes for include URI and paths.
INCLUDE_SERVLET_PATH_ATTRIBUTE - Static variable in class org.springframework.web.util.WebUtils
includeBean(Class, String) - Method in interface org.springframework.jmx.export.assembler.AutodetectCapableMBeanInfoAssembler
Indicate whether a particular bean should be included in the registration process, if it is not specified in the beans map of the MBeanExporter.
includeBean(Class, String) - Method in class org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler
Used for autodetection of beans.
includeOperation(Method, String) - Method in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Allows subclasses to vote on the inclusion of a particular operation.
includeOperation(Method, String) - Method in class org.springframework.jmx.export.assembler.InterfaceBasedMBeanInfoAssembler
Check to see if the Method is declared in one of the configured interfaces and that it is public.
includeOperation(Method, String) - Method in class org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler
Votes on the inclusion of an operation.
includeOperation(Method, String) - Method in class org.springframework.jmx.export.assembler.MethodExclusionMBeanInfoAssembler
includeOperation(Method, String) - Method in class org.springframework.jmx.export.assembler.MethodNameBasedMBeanInfoAssembler
includeOperation(Method, String) - Method in class org.springframework.jmx.export.assembler.SimpleReflectiveMBeanInfoAssembler
Always returns true.
includeReadAttribute(Method, String) - Method in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Allows subclasses to vote on the inclusion of a particular attribute accessor.
includeReadAttribute(Method, String) - Method in class org.springframework.jmx.export.assembler.InterfaceBasedMBeanInfoAssembler
Check to see if the Method is declared in one of the configured interfaces and that it is public.
includeReadAttribute(Method, String) - Method in class org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler
Vote on the inclusion of an attribute accessor.
includeReadAttribute(Method, String) - Method in class org.springframework.jmx.export.assembler.MethodExclusionMBeanInfoAssembler
includeReadAttribute(Method, String) - Method in class org.springframework.jmx.export.assembler.MethodNameBasedMBeanInfoAssembler
includeReadAttribute(Method, String) - Method in class org.springframework.jmx.export.assembler.SimpleReflectiveMBeanInfoAssembler
Always returns true.
includes(MediaType) - Method in class org.springframework.http.MediaType
Indicate whether this MediaType includes the given media type.
includeSynonymsForTableColumnMetaData() - Method in class org.springframework.jdbc.core.simple.SimpleJdbcInsert
includeSynonymsForTableColumnMetaData() - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcInsertOperations
Include synonyms for the column meta data lookups via JDBC.
includeWriteAttribute(Method, String) - Method in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Allows subclasses to vote on the inclusion of a particular attribute mutator.
includeWriteAttribute(Method, String) - Method in class org.springframework.jmx.export.assembler.InterfaceBasedMBeanInfoAssembler
Check to see if the Method is declared in one of the configured interfaces and that it is public.
includeWriteAttribute(Method, String) - Method in class org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler
Votes on the inclusion of an attribute mutator.
includeWriteAttribute(Method, String) - Method in class org.springframework.jmx.export.assembler.MethodExclusionMBeanInfoAssembler
includeWriteAttribute(Method, String) - Method in class org.springframework.jmx.export.assembler.MethodNameBasedMBeanInfoAssembler
includeWriteAttribute(Method, String) - Method in class org.springframework.jmx.export.assembler.SimpleReflectiveMBeanInfoAssembler
Always returns true.
IncorrectResultSetColumnCountException - Exception in org.springframework.jdbc
Data access exception thrown when a result set did not have the correct column count, for example when expecting a single column but getting 0 or more than 1 columns.
IncorrectResultSetColumnCountException(int, int) - Constructor for exception org.springframework.jdbc.IncorrectResultSetColumnCountException
Constructor for IncorrectResultSetColumnCountException.
IncorrectResultSetColumnCountException(String, int, int) - Constructor for exception org.springframework.jdbc.IncorrectResultSetColumnCountException
Constructor for IncorrectResultCountDataAccessException.
IncorrectResultSizeDataAccessException - Exception in org.springframework.dao
Data access exception thrown when a result was not of the expected size, for example when expecting a single row but getting 0 or more than 1 rows.
IncorrectResultSizeDataAccessException(int) - Constructor for exception org.springframework.dao.IncorrectResultSizeDataAccessException
Constructor for IncorrectResultSizeDataAccessException.
IncorrectResultSizeDataAccessException(int, int) - Constructor for exception org.springframework.dao.IncorrectResultSizeDataAccessException
Constructor for IncorrectResultSizeDataAccessException.
IncorrectResultSizeDataAccessException(String, int) - Constructor for exception org.springframework.dao.IncorrectResultSizeDataAccessException
Constructor for IncorrectResultSizeDataAccessException.
IncorrectResultSizeDataAccessException(String, int, int) - Constructor for exception org.springframework.dao.IncorrectResultSizeDataAccessException
Constructor for IncorrectResultSizeDataAccessException.
IncorrectUpdateSemanticsDataAccessException - Exception in org.springframework.dao
Data access exception thrown when something unintended appears to have happened with an update, but the transaction hasn't already been rolled back.
IncorrectUpdateSemanticsDataAccessException(String) - Constructor for exception org.springframework.dao.IncorrectUpdateSemanticsDataAccessException
Constructor for IncorrectUpdateSemanticsDataAccessException.
IncorrectUpdateSemanticsDataAccessException(String, Throwable) - Constructor for exception org.springframework.dao.IncorrectUpdateSemanticsDataAccessException
Constructor for IncorrectUpdateSemanticsDataAccessException.
increaseNestingLevel() - Method in class org.springframework.core.MethodParameter
Increase this parameter's nesting level.
INDEX_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Indexer - Class in org.springframework.expression.spel.ast
An Indexer can index into some proceeding structure to access a particular piece of it.
Indexer(int, SpelNodeImpl) - Constructor for class org.springframework.expression.spel.ast.Indexer
indexOf(Advisor) - Method in interface org.springframework.aop.framework.Advised
Return the index (from 0) of the given advisor, or -1 if no such advisor applies to this proxy.
indexOf(Advice) - Method in interface org.springframework.aop.framework.Advised
Return the index (from 0) of the given AOP Alliance Advice, or -1 if no such advice is an advice for this proxy.
indexOf(Advisor) - Method in class org.springframework.aop.framework.AdvisedSupport
indexOf(Advice) - Method in class org.springframework.aop.framework.AdvisedSupport
indexOf(Object) - Method in class org.springframework.util.AutoPopulatingList
indicatesAutowiring() - Method in class org.springframework.beans.factory.wiring.BeanWiringInfo
Return whether this BeanWiringInfo indicates autowiring.
InfrastructureAdvisorAutoProxyCreator - Class in org.springframework.aop.framework.autoproxy
Auto-proxy creator that considers infrastructure Advisor beans only, ignoring any application-defined Advisors.
InfrastructureAdvisorAutoProxyCreator() - Constructor for class org.springframework.aop.framework.autoproxy.InfrastructureAdvisorAutoProxyCreator
InfrastructureProxy - Interface in org.springframework.core
Interface to be implemented by transparent resource proxies that need to be considered as equal to the underlying resource, for example for consistent lookup key comparisons.
init() - Method in class org.springframework.aop.config.AopNamespaceHandler
Register the BeanDefinitionParsers for the 'config', 'spring-configured', 'aspectj-autoproxy' and 'scoped-proxy' tags.
init() - Method in interface org.springframework.beans.factory.xml.NamespaceHandler
Invoked by the DefaultBeanDefinitionDocumentReader after construction but before any custom elements are parsed.
init() - Method in class org.springframework.beans.factory.xml.SimplePropertyNamespaceHandler
init() - Method in class org.springframework.beans.factory.xml.UtilNamespaceHandler
init() - Method in class org.springframework.context.config.ContextNamespaceHandler
init() - Method in class org.springframework.ejb.config.JeeNamespaceHandler
init() - Method in class org.springframework.jdbc.config.JdbcNamespaceHandler
init() - Method in class org.springframework.jms.config.JmsNamespaceHandler
init() - Method in class org.springframework.oxm.config.OxmNamespaceHandler
init(Object) - Method in class org.springframework.remoting.jaxrpc.ServletEndpointSupport
Deprecated. Initialize this JAX-RPC servlet endpoint.
init() - Method in class org.springframework.scheduling.config.TaskNamespaceHandler
init() - Method in class org.springframework.scripting.config.LangNamespaceHandler
init() - Method in class org.springframework.transaction.config.TxNamespaceHandler
init(RuntimeServices) - Method in class org.springframework.ui.velocity.CommonsLoggingLogSystem
init(ExtendedProperties) - Method in class org.springframework.ui.velocity.SpringResourceLoader
init(Class<?>) - Method in class org.springframework.web.bind.annotation.support.HandlerMethodResolver
Initialize a new HandlerMethodResolver for the specified handler type.
init() - Method in class org.springframework.web.context.support.HttpRequestHandlerServlet
init(FilterConfig) - Method in class org.springframework.web.filter.GenericFilterBean
Standard way of initializing this filter.
init() - Method in class org.springframework.web.portlet.GenericPortletBean
Map config parameters onto bean properties of this portlet, and invoke subclass initialization.
init() - Method in class org.springframework.web.servlet.config.MvcNamespaceHandler
init() - Method in class org.springframework.web.servlet.HttpServletBean
Map config parameters onto bean properties of this servlet, and invoke subclass initialization.
init(Map<String, String>) - Method in class org.springframework.web.servlet.view.tiles2.SpringTilesApplicationContextFactory
init(ActionServlet, ModuleConfig) - Method in class org.springframework.web.struts.AutowiringRequestProcessor
Deprecated.
init(ActionServlet, ModuleConfig) - Method in class org.springframework.web.struts.AutowiringTilesRequestProcessor
Deprecated.
init(ActionServlet, ModuleConfig) - Method in class org.springframework.web.struts.ContextLoaderPlugIn
Deprecated. Create the ActionServlet's WebApplicationContext.
init(ActionServlet, ModuleConfig) - Method in class org.springframework.web.struts.DelegatingRequestProcessor
Deprecated.
init(ActionServlet, ModuleConfig) - Method in class org.springframework.web.struts.DelegatingTilesRequestProcessor
Deprecated.
INIT_METHOD_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
initAnnotation(AnnotatedElement) - Method in class org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.LookupElement
initApplicationContext(ApplicationContext) - Method in class org.springframework.context.support.ApplicationObjectSupport
Subclasses can override this for custom initialization behavior.
initApplicationContext() - Method in class org.springframework.context.support.ApplicationObjectSupport
Subclasses can override this for custom initialization behavior.
initApplicationContext(ApplicationContext) - Method in class org.springframework.web.context.support.WebApplicationObjectSupport
Calls WebApplicationObjectSupport.initServletContext(javax.servlet.ServletContext) if the given ApplicationContext is a WebApplicationContext.
initApplicationContext() - Method in class org.springframework.web.portlet.handler.AbstractHandlerMapping
Initializes the interceptors.
initApplicationContext() - Method in class org.springframework.web.portlet.handler.ParameterHandlerMapping
Calls the registerHandlers method in addition to the superclass's initialization.
initApplicationContext() - Method in class org.springframework.web.portlet.handler.PortletModeHandlerMapping
Calls the registerHandlers method in addition to the superclass's initialization.
initApplicationContext() - Method in class org.springframework.web.portlet.handler.PortletModeParameterHandlerMapping
Calls the registerHandlers method in addition to the superclass's initialization.
initApplicationContext() - Method in class org.springframework.web.portlet.mvc.annotation.DefaultAnnotationHandlerMapping
Calls the registerHandlers method in addition to the superclass's initialization.
initApplicationContext() - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated.
initApplicationContext() - Method in class org.springframework.web.portlet.mvc.ParameterizableViewController
initApplicationContext() - Method in class org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping
Calls the AbstractDetectingUrlHandlerMapping.detectHandlers() method in addition to the superclass's initialization.
initApplicationContext() - Method in class org.springframework.web.servlet.handler.AbstractHandlerMapping
Initializes the interceptors.
initApplicationContext() - Method in class org.springframework.web.servlet.handler.SimpleUrlHandlerMapping
Calls the SimpleUrlHandlerMapping.registerHandlers(java.util.Map) method in addition to the superclass's initialization.
initApplicationContext() - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated.
initApplicationContext() - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
Checks to see that a valid report file URL is supplied in the configuration.
initApplicationContext() - Method in class org.springframework.web.servlet.view.tiles.ComponentControllerSupport
Deprecated. Subclasses can override this for custom initialization behavior.
initApplicationContext() - Method in class org.springframework.web.servlet.view.tiles.TilesView
Deprecated.
initApplicationContext() - Method in class org.springframework.web.servlet.view.UrlBasedViewResolver
initApplicationContext() - Method in class org.springframework.web.servlet.view.velocity.VelocityView
Invoked on startup.
initApplicationContext() - Method in class org.springframework.web.servlet.view.velocity.VelocityViewResolver
initApplicationContext() - Method in class org.springframework.web.servlet.view.xml.MarshallingView
initApplicationContext() - Method in class org.springframework.web.servlet.view.xslt.AbstractXsltView
Deprecated. Here we load our template, as we need the ApplicationContext to do it.
initApplicationContext() - Method in class org.springframework.web.servlet.view.xslt.XsltView
Initialize this XsltView's TransformerFactory.
initApplicationEventMulticaster() - Method in class org.springframework.context.support.AbstractApplicationContext
Initialize the ApplicationEventMulticaster.
initApplicationException(Throwable) - Method in exception org.springframework.transaction.TransactionSystemException
Set an application exception that was thrown before this transaction exception, preserving the original exception despite the overriding TransactionSystemException.
initAutowireMode(ActionServlet, ModuleConfig) - Method in class org.springframework.web.struts.AutowiringRequestProcessor
Deprecated. Determine the autowire mode to use for wiring Struts Actions.
initAutowireMode(ActionServlet, ModuleConfig) - Method in class org.springframework.web.struts.AutowiringTilesRequestProcessor
Deprecated. Determine the autowire mode to use for wiring Struts Actions.
initBeanDefinitionReader(XmlBeanDefinitionReader) - Method in class org.springframework.context.support.AbstractXmlApplicationContext
Initialize the bean definition reader used for loading the bean definitions of this context.
initBeanDefinitionReader(XmlBeanDefinitionReader) - Method in class org.springframework.web.context.support.XmlWebApplicationContext
Initialize the bean definition reader used for loading the bean definitions of this context.
initBeanDefinitionReader(XmlBeanDefinitionReader) - Method in class org.springframework.web.portlet.context.XmlPortletApplicationContext
Initialize the bean definition reader used for loading the bean definitions of this context.
initBeanFactory(ConfigurableListableBeanFactory) - Method in class org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator
initBeanFactory(ConfigurableListableBeanFactory) - Method in class org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
initBeanFactory(ConfigurableListableBeanFactory) - Method in class org.springframework.aop.framework.autoproxy.InfrastructureAdvisorAutoProxyCreator
initBeanPropertyAccess() - Method in class org.springframework.validation.DataBinder
Initialize standard JavaBean property access for this DataBinder.
initBeanWrapper(BeanWrapper) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Initialize the given BeanWrapper with the custom editors registered with this factory.
initBeanWrapper(BeanWrapper) - Method in class org.springframework.jdbc.core.BeanPropertyRowMapper
Initialize the given BeanWrapper to be used for row mapping.
initBeanWrapper(BeanWrapper) - Method in class org.springframework.web.filter.GenericFilterBean
Initialize the BeanWrapper for this GenericFilterBean, possibly with custom editors.
initBeanWrapper(BeanWrapper) - Method in class org.springframework.web.portlet.GenericPortletBean
Initialize the BeanWrapper for this GenericPortletBean, possibly with custom editors.
initBeanWrapper(BeanWrapper) - Method in class org.springframework.web.servlet.HttpServletBean
Initialize the BeanWrapper for this HttpServletBean, possibly with custom editors.
InitBinder - Annotation Type in org.springframework.web.bind.annotation
Annotation that identifies methods which initialize the WebDataBinder which will be used for populating command and form object arguments of annotated handler methods.
initBinder(Object, String, WebDataBinder, NativeWebRequest) - Method in class org.springframework.web.bind.annotation.support.HandlerMethodInvoker
initBinder(WebDataBinder, WebRequest) - Method in class org.springframework.web.bind.support.ConfigurableWebBindingInitializer
initBinder(WebDataBinder, WebRequest) - Method in interface org.springframework.web.bind.support.WebBindingInitializer
Initialize the given DataBinder for the given request.
initBinder(PortletRequest, PortletRequestDataBinder) - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Initialize the given binder instance, for example with custom editors.
initBinder(HttpServletRequest, ServletRequestDataBinder) - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Initialize the given binder instance, for example with custom editors.
initBinder(HttpServletRequest, ServletRequestDataBinder) - Method in class org.springframework.web.servlet.mvc.multiaction.MultiActionController
Initialize the given binder instance, for example with custom editors.
initConnection() - Method in class org.springframework.jca.cci.connection.SingleConnectionFactory
Initialize the single underlying Connection.
initConnection() - Method in class org.springframework.jdbc.datasource.SingleConnectionDataSource
Initialize the underlying Connection via the DriverManager.
initConnection() - Method in class org.springframework.jms.connection.SingleConnectionFactory
Initialize the underlying shared Connection.
initContext(PageContext, Map<String, Object>) - Method in class org.springframework.web.servlet.support.JspAwareRequestContext
Initialize this context with the given page context, using the given model attributes for Errors retrieval.
initContext(HttpServletRequest, HttpServletResponse, ServletContext, Map<String, Object>) - Method in class org.springframework.web.servlet.support.RequestContext
Initialize this context with the given request, using the given model attributes for Errors retrieval.
initConversion(ConversionService) - Method in class org.springframework.validation.AbstractPropertyBindingResult
initDao() - Method in class org.springframework.dao.support.DaoSupport
Concrete subclasses can override this for custom initialization behavior.
initDatabase() - Method in class org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory
Hook to initialize the embedded database.
initDefaults(Element) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Initialize the default lazy-init, autowire, dependency check settings, init-method, destroy-method and merge settings.
initDefaultStrategies() - Method in class org.springframework.jms.core.JmsTemplate
Initialize the default implementations for the template's strategies: DynamicDestinationResolver and SimpleMessageConverter.
initDefaultStrategies() - Method in class org.springframework.jms.core.JmsTemplate102
Deprecated. Initialize the default implementations for the template's strategies: DynamicDestinationResolver and SimpleMessageConverter102.
initDefaultStrategies() - Method in class org.springframework.jms.listener.adapter.MessageListenerAdapter
Initialize the default implementations for the adapter's strategies.
initDefaultStrategies() - Method in class org.springframework.jms.listener.adapter.MessageListenerAdapter102
Deprecated. Initialize the default implementations for the adapter's strategies: SimpleMessageConverter102.
initDeferredClose(SessionFactory) - Static method in class org.springframework.orm.hibernate3.SessionFactoryUtils
Initialize deferred close for the current thread and the given SessionFactory.
initDelegate(WebApplicationContext) - Method in class org.springframework.web.filter.DelegatingFilterProxy
Initialize the Filter delegate, defined as bean the given Spring application context.
initDependencyCheck(ActionServlet, ModuleConfig) - Method in class org.springframework.web.struts.AutowiringRequestProcessor
Deprecated. Determine whether to apply a dependency check after wiring Struts Actions.
initDependencyCheck(ActionServlet, ModuleConfig) - Method in class org.springframework.web.struts.AutowiringTilesRequestProcessor
Deprecated. Determine whether to apply a dependency check after wiring Struts Actions.
InitDestroyAnnotationBeanPostProcessor - Class in org.springframework.beans.factory.annotation
BeanPostProcessor implementation that invokes annotated init and destroy methods.
InitDestroyAnnotationBeanPostProcessor() - Constructor for class org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor
initDirectFieldAccess() - Method in class org.springframework.validation.DataBinder
Initialize direct field access for this DataBinder, as alternative to the default bean property access.
initExcludedPatternRepresentation(String[]) - Method in class org.springframework.aop.support.AbstractRegexpMethodPointcut
Subclasses must implement this to initialize regexp pointcuts.
initExcludedPatternRepresentation(String[]) - Method in class org.springframework.aop.support.JdkRegexpMethodPointcut
Initialize exclusion Patterns from the supplied String[].
initFactory(Locale) - Method in class org.springframework.web.servlet.view.ResourceBundleViewResolver
Initialize the View BeanFactory from the ResourceBundle, for the given locale.
initFactory() - Method in class org.springframework.web.servlet.view.XmlViewResolver
Initialize the view bean factory from the XML file.
initFilterBean() - Method in class org.springframework.web.filter.DelegatingFilterProxy
initFilterBean() - Method in class org.springframework.web.filter.GenericFilterBean
Subclasses may override this to perform custom initialization.
initFrameworkPortlet() - Method in class org.springframework.web.portlet.FrameworkPortlet
This method will be invoked after any bean properties have been set and the ApplicationContext has been loaded.
initFrameworkServlet() - Method in class org.springframework.web.servlet.FrameworkServlet
This method will be invoked after any bean properties have been set and the WebApplicationContext has been loaded.
initGateway() - Method in class org.springframework.jms.core.support.JmsGatewaySupport
Subclasses can override this for custom initialization behavior.
initialize(Class<T>) - Method in class org.springframework.jdbc.core.BeanPropertyRowMapper
Initialize the mapping metadata for the given class.
initialize() - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Initialize this container.
initialize() - Method in class org.springframework.jms.listener.AbstractPollingMessageListenerContainer
initialize() - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
initialize(Servlet, ServletRequest, ServletResponse, String, boolean, int, boolean) - Method in class org.springframework.mock.web.MockPageContext
initialize(Object) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Force initialization of a Hibernate proxy or persistent collection.
initialize(Object) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
initialize() - Method in class org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor
Creates the BlockingQueue and the ThreadPoolExecutor.
initialize() - Method in class org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
Set up the ExecutorService.
initialize(ClassLoadHelper, SchedulerSignaler) - Method in class org.springframework.scheduling.quartz.LocalDataSourceJobStore
initialize() - Method in class org.springframework.scheduling.quartz.LocalTaskExecutorThreadPool
initialize() - Method in class org.springframework.scheduling.quartz.ResourceLoaderClassLoadHelper
initializeBean(Object, String) - Method in interface org.springframework.beans.factory.config.AutowireCapableBeanFactory
Initialize the given raw bean, applying factory callbacks such as setBeanName and setBeanFactory, also applying all bean post processors (including ones which might wrap the given raw bean).
initializeBean(Object, String) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
initializeBean(String, Object, RootBeanDefinition) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Initialize the given bean instance, applying factory callbacks as well as init methods and bean post processors.
initializeConsumers() - Method in class org.springframework.jms.listener.SimpleMessageListenerContainer
Initialize the JMS Sessions and MessageConsumers for this container.
InitializeDatabaseBeanDefinitionParser - Class in org.springframework.jdbc.config
BeanDefinitionParser that parses an initialize-database element and creates a BeanDefinition of type DataSourceInitializer.
InitializeDatabaseBeanDefinitionParser() - Constructor for class org.springframework.jdbc.config.InitializeDatabaseBeanDefinitionParser
initializeDefinition(BeanFactory) - Method in class org.springframework.beans.factory.access.SingletonBeanFactoryLocator
Instantiate singletons and do any other normal initialization of the factory.
initializeDefinition(BeanFactory) - Method in class org.springframework.context.access.ContextSingletonBeanFactoryLocator
Overrides the default method to refresh the ApplicationContext, invoking ConfigurableApplicationContext.refresh().
initializeExecutor(ThreadFactory, RejectedExecutionHandler) - Method in class org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
Create the target ExecutorService instance.
initializeExecutor(ThreadFactory, RejectedExecutionHandler) - Method in class org.springframework.scheduling.concurrent.ScheduledExecutorFactoryBean
initializeExecutor(ThreadFactory, RejectedExecutionHandler) - Method in class org.springframework.scheduling.concurrent.ThreadPoolExecutorFactoryBean
initializeExecutor(ThreadFactory, RejectedExecutionHandler) - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
initializeExecutor(ThreadFactory, RejectedExecutionHandler) - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
initializeMetaData(DataSource) - Method in class org.springframework.jdbc.core.metadata.CallMetaDataContext
Initialize this class with metadata from the database
initializeMultipart() - Method in class org.springframework.web.multipart.support.AbstractMultipartHttpServletRequest
Lazily initialize the multipart request, if possible.
initializeMultipart() - Method in class org.springframework.web.portlet.multipart.DefaultMultipartActionRequest
Lazily initialize the multipart request, if possible.
initializeResourcesBeforeRead(Connection, Object) - Method in class org.springframework.jdbc.support.lob.OracleLobHandler
Initialize any LOB resources before a read is done.
initializeWithMetaData(DatabaseMetaData) - Method in interface org.springframework.jdbc.core.metadata.CallMetaDataProvider
Initialize using the provided DatabaseMetData.
initializeWithMetaData(DatabaseMetaData) - Method in class org.springframework.jdbc.core.metadata.Db2CallMetaDataProvider
initializeWithMetaData(DatabaseMetaData) - Method in class org.springframework.jdbc.core.metadata.DerbyTableMetaDataProvider
initializeWithMetaData(DatabaseMetaData) - Method in class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
initializeWithMetaData(DatabaseMetaData) - Method in class org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
initializeWithMetaData(DatabaseMetaData) - Method in interface org.springframework.jdbc.core.metadata.TableMetaDataProvider
Initialize using the database metedata provided
initializeWithProcedureColumnMetaData(DatabaseMetaData, String, String, String) - Method in interface org.springframework.jdbc.core.metadata.CallMetaDataProvider
Initialize the database specific management of procedure column meta data.
initializeWithProcedureColumnMetaData(DatabaseMetaData, String, String, String) - Method in class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
initializeWithTableColumnMetaData(DatabaseMetaData, String, String, String) - Method in class org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
initializeWithTableColumnMetaData(DatabaseMetaData, String, String, String) - Method in class org.springframework.jdbc.core.metadata.OracleTableMetaDataProvider
initializeWithTableColumnMetaData(DatabaseMetaData, String, String, String) - Method in interface org.springframework.jdbc.core.metadata.TableMetaDataProvider
Initialize using provided database metadata, table and column information.
InitializingBean - Interface in org.springframework.beans.factory
Interface to be implemented by beans that need to react once all their properties have been set by a BeanFactory: for example, to perform custom initialization, or merely to check that all mandatory properties have been set.
initInterceptors() - Method in class org.springframework.web.portlet.handler.AbstractHandlerMapping
Initialize the specified interceptors, adapting them where necessary.
initInterceptors() - Method in class org.springframework.web.servlet.handler.AbstractHandlerMapping
Initialize the specified interceptors, adapting them where necessary.
initInterceptors() - Method in class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
initJaxbMarshaller(Marshaller) - Method in class org.springframework.oxm.jaxb.Jaxb2Marshaller
Template method that can be overridden by concrete JAXB marshallers for custom initialization behavior.
initJaxbUnmarshaller(Unmarshaller) - Method in class org.springframework.oxm.jaxb.Jaxb2Marshaller
Template method that can be overridden by concrete JAXB marshallers for custom initialization behavior.
initLifecycleProcessor() - Method in class org.springframework.context.support.AbstractApplicationContext
Initialize the LifecycleProcessor.
initLogging(String) - Static method in class org.springframework.util.Log4jConfigurer
Initialize log4j from the given file location, with no config file refreshing.
initLogging(String, long) - Static method in class org.springframework.util.Log4jConfigurer
Initialize log4j from the given location, with the given refresh interval for the config file.
initLogging(ServletContext) - Static method in class org.springframework.web.util.Log4jWebConfigurer
Initialize log4j, including setting the web app root system property.
initMessageSource() - Method in class org.springframework.context.support.AbstractApplicationContext
Initialize the MessageSource.
initMethodMap(Map<String, TransactionAttribute>) - Method in class org.springframework.transaction.interceptor.MethodMapTransactionAttributeSource
Initialize the specified "methodMap", if any.
initOracleDriverClasses(Connection) - Method in class org.springframework.jdbc.support.lob.OracleLobHandler
Retrieve the oracle.sql.BLOB and oracle.sql.CLOB classes via reflection, and initialize the values for the DURATION_SESSION, MODE_READWRITE and MODE_READONLY constants defined there.
initParameterNameDiscovery(ParameterNameDiscoverer) - Method in class org.springframework.beans.factory.config.DependencyDescriptor
Initialize parameter name discovery for the underlying method parameter, if any.
initParameterNameDiscovery(ParameterNameDiscoverer) - Method in class org.springframework.core.MethodParameter
Initialize parameter name discovery for this method parameter.
initParent(Theme) - Method in class org.springframework.ui.context.support.ResourceBundleThemeSource
Initialize the MessageSource of the given theme with the one from the corresponding parent of this ThemeSource.
initPatternRepresentation(String[]) - Method in class org.springframework.aop.support.AbstractRegexpMethodPointcut
Subclasses must implement this to initialize regexp pointcuts.
initPatternRepresentation(String[]) - Method in class org.springframework.aop.support.JdkRegexpMethodPointcut
Initialize Patterns from the supplied String[].
initPortletApplicationContext() - Method in class org.springframework.web.portlet.FrameworkPortlet
Initialize and publish the Portlet ApplicationContext for this portlet.
initPortletBean() - Method in class org.springframework.web.portlet.FrameworkPortlet
Overridden method of GenericPortletBean, invoked after any bean properties have been set.
initPortletBean() - Method in class org.springframework.web.portlet.GenericPortletBean
Subclasses may override this to perform custom initialization.
initServletBean() - Method in class org.springframework.web.servlet.FrameworkServlet
Overridden method of HttpServletBean, invoked after any bean properties have been set.
initServletBean() - Method in class org.springframework.web.servlet.HttpServletBean
Subclasses may override this to perform custom initialization.
initServletBean() - Method in class org.springframework.web.servlet.ResourceServlet
Remember the startup time, using no last-modified time before it.
initServletContext(ServletContext) - Method in class org.springframework.web.context.support.WebApplicationObjectSupport
Subclasses may override this for custom initialization based on the ServletContext that this application object runs in.
initServletContext(ServletContext) - Method in class org.springframework.web.servlet.view.ContentNegotiatingViewResolver
initServletContext(ServletContext) - Method in class org.springframework.web.servlet.view.freemarker.FreeMarkerView
Invoked on startup.
initServletContext(ServletContext) - Method in class org.springframework.web.servlet.view.InternalResourceView
Checks whether we need to explicitly expose the Servlet 2.4 request attributes by default.
initServletContext(ServletContext) - Method in class org.springframework.web.servlet.view.JstlView
Wraps the MessageSource with a JSTL-aware MessageSource that is aware of JSTL's javax.servlet.jsp.jstl.fmt.localizationContext context-param.
initServletContext(ServletContext) - Method in class org.springframework.web.servlet.view.tiles2.TilesView
Checks whether we need to explicitly expose the Servlet 2.4 request attributes by default.
initSpringResourceLoader(VelocityEngine, String) - Method in class org.springframework.ui.velocity.VelocityEngineFactory
Initialize a SpringResourceLoader for the given VelocityEngine.
initStrategies(ApplicationContext) - Method in class org.springframework.web.portlet.DispatcherPortlet
Refresh the strategy objects that this portlet uses.
initStrategies(ApplicationContext) - Method in class org.springframework.web.servlet.DispatcherServlet
Initialize the strategy objects that this servlet uses.
initSynchronization() - Static method in class org.springframework.transaction.support.TransactionSynchronizationManager
Activate transaction synchronization for the current thread.
initTemplateConfig() - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcDaoSupport
Create a NamedParameterJdbcTemplate based on the configured JdbcTemplate.
initTemplateConfig() - Method in class org.springframework.jdbc.core.simple.SimpleJdbcDaoSupport
Create a SimpleJdbcTemplate based on the configured JdbcTemplate.
initTemplateConfig() - Method in class org.springframework.jdbc.core.support.JdbcDaoSupport
Initialize the template-based configuration of this DAO.
initThemeSource(ApplicationContext) - Static method in class org.springframework.ui.context.support.UiApplicationContextUtils
Initialize the ThemeSource for the given application context, autodetecting a bean with the name "themeSource".
initTool(Object, Context) - Method in class org.springframework.web.servlet.view.velocity.VelocityToolboxView
Overridden to check for the ViewContext interface which is part of the view package of Velocity Tools.
initTool(Object, Context) - Method in class org.springframework.web.servlet.view.velocity.VelocityView
Initialize the given tool instance.
initTransactionSynchronizationRegistry() - Method in class org.springframework.transaction.jta.JtaTransactionManager
Initialize the JTA 1.1 TransactionSynchronizationRegistry, if available.
initUserTransactionAndTransactionManager() - Method in class org.springframework.transaction.jta.JtaTransactionManager
Initialize the UserTransaction as well as the TransactionManager handle.
initVelocityResourceLoader(VelocityEngine, String) - Method in class org.springframework.ui.velocity.VelocityEngineFactory
Initialize a Velocity resource loader for the given VelocityEngine: either a standard Velocity FileResourceLoader or a SpringResourceLoader.
initWebApplicationContext(ServletContext) - Method in class org.springframework.web.context.ContextLoader
Initialize Spring's web application context for the given servlet context, according to the "contextClass" and "contextConfigLocation" context-params.
initWebApplicationContext() - Method in class org.springframework.web.servlet.FrameworkServlet
Initialize and publish the WebApplicationContext for this servlet.
initWebApplicationContext(ActionServlet) - Method in class org.springframework.web.struts.ActionSupport
Deprecated. Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, falling back to the root WebApplicationContext (the usual case).
initWebApplicationContext(ActionServlet, ModuleConfig) - Method in class org.springframework.web.struts.AutowiringRequestProcessor
Deprecated. Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, falling back to the root WebApplicationContext.
initWebApplicationContext(ActionServlet, ModuleConfig) - Method in class org.springframework.web.struts.AutowiringTilesRequestProcessor
Deprecated. Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, falling back to the root WebApplicationContext.
initWebApplicationContext() - Method in class org.springframework.web.struts.ContextLoaderPlugIn
Deprecated. Initialize and publish the WebApplicationContext for the ActionServlet.
initWebApplicationContext(ActionServlet, ModuleConfig) - Method in class org.springframework.web.struts.DelegatingRequestProcessor
Deprecated. Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, falling back to the root WebApplicationContext.
initWebApplicationContext(ActionServlet, ModuleConfig) - Method in class org.springframework.web.struts.DelegatingTilesRequestProcessor
Deprecated. Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, falling back to the root WebApplicationContext.
initWebApplicationContext(ActionServlet) - Method in class org.springframework.web.struts.DispatchActionSupport
Deprecated. Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, falling back to the root WebApplicationContext (the usual case).
initWebApplicationContext(ActionServlet) - Method in class org.springframework.web.struts.LookupDispatchActionSupport
Deprecated. Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, falling back to the root WebApplicationContext (the usual case).
initWebApplicationContext(ActionServlet) - Method in class org.springframework.web.struts.MappingDispatchActionSupport
Deprecated. Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, falling back to the root WebApplicationContext (the usual case).
inject(Object, String, PropertyValues) - Method in class org.springframework.beans.factory.annotation.InjectionMetadata
inject(Object, String, PropertyValues) - Method in class org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement
Either this or InjectionMetadata.InjectedElement.getResourceToInject(java.lang.Object, java.lang.String) needs to be overridden.
injectDependencies() - Method in class org.springframework.test.AbstractDependencyInjectionSpringContextTests
Deprecated. Inject dependencies into 'this' instance (that is, this test instance).
injectDependencies(TestContext) - Method in class org.springframework.test.context.support.DependencyInjectionTestExecutionListener
Performs dependency injection and bean initialization for the supplied TestContext as described in prepareTestInstance().
InjectionMetadata - Class in org.springframework.beans.factory.annotation
Internal class for managing injection metadata.
InjectionMetadata(Class, Collection<InjectionMetadata.InjectedElement>) - Constructor for class org.springframework.beans.factory.annotation.InjectionMetadata
InjectionMetadata.InjectedElement - Class in org.springframework.beans.factory.annotation
InjectionMetadata.InjectedElement(Member, PropertyDescriptor) - Constructor for class org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement
INLINE_SCRIPT_PREFIX - Static variable in class org.springframework.scripting.support.ScriptFactoryPostProcessor
The Resource-style prefix that denotes an inline script.
InputStreamEditor - Class in org.springframework.beans.propertyeditors
One-way PropertyEditor, which can convert from a text string to a java.io.InputStream, allowing InputStream properties to be set directly as a text string.
InputStreamEditor() - Constructor for class org.springframework.beans.propertyeditors.InputStreamEditor
Create a new InputStreamEditor, using the default ResourceEditor underneath.
InputStreamEditor(ResourceEditor) - Constructor for class org.springframework.beans.propertyeditors.InputStreamEditor
Create a new InputStreamEditor, using the given ResourceEditor underneath.
InputStreamResource - Class in org.springframework.core.io
Resource implementation for a given InputStream.
InputStreamResource(InputStream) - Constructor for class org.springframework.core.io.InputStreamResource
Create a new InputStreamResource.
InputStreamResource(InputStream, String) - Constructor for class org.springframework.core.io.InputStreamResource
Create a new InputStreamResource.
InputStreamSource - Interface in org.springframework.core.io
Simple interface for objects that are sources for an InputStream.
InputTag - Class in org.springframework.web.servlet.tags.form
Data-binding-aware JSP tag for rendering an HTML 'input' element with a 'type' of 'text'.
InputTag() - Constructor for class org.springframework.web.servlet.tags.form.InputTag
insert(String) - Method in interface org.springframework.orm.ibatis.SqlMapClientOperations
insert(String, Object) - Method in interface org.springframework.orm.ibatis.SqlMapClientOperations
insert(String) - Method in class org.springframework.orm.ibatis.SqlMapClientTemplate
insert(String, Object) - Method in class org.springframework.orm.ibatis.SqlMapClientTemplate
installFormatters(FormatterRegistry) - Method in class org.springframework.format.support.FormattingConversionServiceFactoryBean
Install Formatters and Converters into the new FormattingConversionService using the FormatterRegistry SPI.
installJodaTimeFormatting(FormatterRegistry) - Method in class org.springframework.format.datetime.joda.JodaTimeFormattingConfigurer
Install Joda Time formatters given the current configuration of this JodaTimeFormattingConfigurer.
INSTANCE - Static variable in class org.springframework.aop.interceptor.ExposeInvocationInterceptor
Singleton instance of this class
INSTANCE - Static variable in class org.springframework.aop.target.EmptyTargetSource
The canonical (Singleton) instance of this EmptyTargetSource.
instance() - Static method in class org.springframework.core.enums.StaticLabeledEnumResolver
Deprecated. Return the shared StaticLabeledEnumResolver singleton instance.
INSTANCE - Static variable in class org.springframework.core.OrderComparator
Shared default instance of OrderComparator.
instantiate(Class<T>) - Static method in class org.springframework.beans.BeanUtils
Convenience method to instantiate a class using its no-arg constructor.
instantiate(RootBeanDefinition, String, BeanFactory) - Method in interface org.springframework.beans.factory.support.InstantiationStrategy
Return an instance of the bean with the given name in this factory.
instantiate(RootBeanDefinition, String, BeanFactory, Constructor, Object[]) - Method in interface org.springframework.beans.factory.support.InstantiationStrategy
Return an instance of the bean with the given name in this factory, creating it via the given constructor.
instantiate(RootBeanDefinition, String, BeanFactory, Object, Method, Object[]) - Method in interface org.springframework.beans.factory.support.InstantiationStrategy
Return an instance of the bean with the given name in this factory, creating it via the given factory method.
instantiate(RootBeanDefinition, String, BeanFactory) - Method in class org.springframework.beans.factory.support.SimpleInstantiationStrategy
instantiate(RootBeanDefinition, String, BeanFactory, Constructor, Object[]) - Method in class org.springframework.beans.factory.support.SimpleInstantiationStrategy
instantiate(RootBeanDefinition, String, BeanFactory, Object, Method, Object[]) - Method in class org.springframework.beans.factory.support.SimpleInstantiationStrategy
instantiateBean(String, RootBeanDefinition) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Instantiate the given bean using its default constructor.
instantiateClass(Class<T>) - Static method in class org.springframework.beans.BeanUtils
Convenience method to instantiate a class using its no-arg constructor.
instantiateClass(Constructor<T>, Object...) - Static method in class org.springframework.beans.BeanUtils
Convenience method to instantiate a class using the given constructor.
instantiateUsingFactoryMethod(String, RootBeanDefinition, Object[]) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Instantiate the bean using a named factory method.
instantiateWithMethodInjection(RootBeanDefinition, String, BeanFactory) - Method in class org.springframework.beans.factory.support.CglibSubclassingInstantiationStrategy
instantiateWithMethodInjection(RootBeanDefinition, String, BeanFactory, Constructor, Object[]) - Method in class org.springframework.beans.factory.support.CglibSubclassingInstantiationStrategy
instantiateWithMethodInjection(RootBeanDefinition, String, BeanFactory) - Method in class org.springframework.beans.factory.support.SimpleInstantiationStrategy
Subclasses can override this method, which is implemented to throw UnsupportedOperationException, if they can instantiate an object with the Method Injection specified in the given RootBeanDefinition.
instantiateWithMethodInjection(RootBeanDefinition, String, BeanFactory, Constructor, Object[]) - Method in class org.springframework.beans.factory.support.SimpleInstantiationStrategy
Subclasses can override this method, which is implemented to throw UnsupportedOperationException, if they can instantiate an object with the Method Injection specified in the given RootBeanDefinition.
InstantiationAwareBeanPostProcessor - Interface in org.springframework.beans.factory.config
Subinterface of BeanPostProcessor that adds a before-instantiation callback, and a callback after instantiation but before explicit properties are set or autowiring occurs.
InstantiationAwareBeanPostProcessorAdapter - Class in org.springframework.beans.factory.config
Adapter that implements all methods on SmartInstantiationAwareBeanPostProcessor as no-ops, which will not change normal processing of each bean instantiated by the container.
InstantiationAwareBeanPostProcessorAdapter() - Constructor for class org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter
InstantiationModelAwarePointcutAdvisor - Interface in org.springframework.aop.aspectj
Interface to be implemented by Spring AOP Advisors wrapping AspectJ aspects that may have a lazy initialization strategy.
InstantiationStrategy - Interface in org.springframework.beans.factory.support
Interface responsible for creating instances corresponding to a root bean definition.
InstrumentationLoadTimeWeaver - Class in org.springframework.instrument.classloading
LoadTimeWeaver relying on VM Instrumentation.
InstrumentationLoadTimeWeaver() - Constructor for class org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver
Create a new InstrumentationLoadTimeWeaver for the default ClassLoader.
InstrumentationLoadTimeWeaver(ClassLoader) - Constructor for class org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver
Create a new InstrumentationLoadTimeWeaver for the given ClassLoader.
InstrumentationSavingAgent - Class in org.springframework.instrument
Java agent that saves the Instrumentation interface from the JVM for later use.
InstrumentationSavingAgent() - Constructor for class org.springframework.instrument.InstrumentationSavingAgent
InteractionCallback<T> - Interface in org.springframework.jca.cci.core
Generic callback interface for code that operates on a CCI Interaction.
interceptorsAndDynamicMethodMatchers - Variable in class org.springframework.aop.framework.ReflectiveMethodInvocation
List of MethodInterceptor and InterceptorAndDynamicMethodMatcher that need dynamic checks.
InterfaceBasedMBeanInfoAssembler - Class in org.springframework.jmx.export.assembler
Subclass of AbstractReflectiveMBeanInfoAssembler that allows for the management interface of a bean to be defined using arbitrary interfaces.
InterfaceBasedMBeanInfoAssembler() - Constructor for class org.springframework.jmx.export.assembler.InterfaceBasedMBeanInfoAssembler
InternalParseException - Exception in org.springframework.expression.spel
Wraps a real parse exception.
InternalParseException(SpelParseException) - Constructor for exception org.springframework.expression.spel.InternalParseException
InternalPathMethodNameResolver - Class in org.springframework.web.servlet.mvc.multiaction
Simple implementation of MethodNameResolver that maps URL to method name.
InternalPathMethodNameResolver() - Constructor for class org.springframework.web.servlet.mvc.multiaction.InternalPathMethodNameResolver
InternalResourceView - Class in org.springframework.web.servlet.view
Wrapper for a JSP or other resource within the same web application.
InternalResourceView() - Constructor for class org.springframework.web.servlet.view.InternalResourceView
Constructor for use as a bean.
InternalResourceView(String) - Constructor for class org.springframework.web.servlet.view.InternalResourceView
Create a new InternalResourceView with the given URL.
InternalResourceView(String, boolean) - Constructor for class org.springframework.web.servlet.view.InternalResourceView
Create a new InternalResourceView with the given URL.
InternalResourceViewResolver - Class in org.springframework.web.servlet.view
Convenient subclass of UrlBasedViewResolver that supports InternalResourceView (i.e.
InternalResourceViewResolver() - Constructor for class org.springframework.web.servlet.view.InternalResourceViewResolver
Sets the default view class to InternalResourceViewResolver.requiredViewClass(): by default InternalResourceView, or JstlView if the JSTL API is present.
InternetAddressEditor - Class in org.springframework.mail.javamail
Editor for java.mail.internet.InternetAddress, to directly populate an InternetAddress property.
InternetAddressEditor() - Constructor for class org.springframework.mail.javamail.InternetAddressEditor
interpolate(String, MessageInterpolator.Context) - Method in class org.springframework.validation.beanvalidation.LocaleContextMessageInterpolator
interpolate(String, MessageInterpolator.Context, Locale) - Method in class org.springframework.validation.beanvalidation.LocaleContextMessageInterpolator
InterruptibleBatchPreparedStatementSetter - Interface in org.springframework.jdbc.core
Extension of the BatchPreparedStatementSetter interface, adding a batch exhaustion check.
intersection(ClassFilter, ClassFilter) - Static method in class org.springframework.aop.support.ClassFilters
Match all classes that both of the given ClassFilters match.
intersection(ClassFilter[]) - Static method in class org.springframework.aop.support.ClassFilters
Match all classes that all of the given ClassFilters match.
intersection(ClassFilter) - Method in class org.springframework.aop.support.ComposablePointcut
Apply an intersection with the given ClassFilter.
intersection(MethodMatcher) - Method in class org.springframework.aop.support.ComposablePointcut
Apply an intersection with the given MethodMatcher.
intersection(Pointcut) - Method in class org.springframework.aop.support.ComposablePointcut
Apply an intersection with the given Pointcut.
intersection(MethodMatcher, MethodMatcher) - Static method in class org.springframework.aop.support.MethodMatchers
Match all methods that both of the given MethodMatchers match.
intersection(Pointcut, Pointcut) - Static method in class org.springframework.aop.support.Pointcuts
Match all methods that both the given pointcuts match.
IntLiteral - Class in org.springframework.expression.spel.ast
Expression language AST node that represents an integer literal.
intResult(Collection) - Static method in class org.springframework.dao.support.DataAccessUtils
Return a unique int result from the given Collection.
IntroductionAdvisor - Interface in org.springframework.aop
Superinterface for advisors that perform one or more AOP introductions.
IntroductionAwareMethodMatcher - Interface in org.springframework.aop
A specialized type of MethodMatcher that takes into account introductions when matching methods.
IntroductionInfo - Interface in org.springframework.aop
Interface supplying the information necessary to describe an introduction.
IntroductionInfoSupport - Class in org.springframework.aop.support
Support for implementations of IntroductionInfo.
IntroductionInfoSupport() - Constructor for class org.springframework.aop.support.IntroductionInfoSupport
IntroductionInterceptor - Interface in org.springframework.aop
Subinterface of AOP Alliance MethodInterceptor that allows additional interfaces to be implemented by the interceptor, and available via a proxy using that interceptor.
IntrospectorCleanupListener - Class in org.springframework.web.util
Listener that flushes the JDK's JavaBeans Introspector cache on web app shutdown.
IntrospectorCleanupListener() - Constructor for class org.springframework.web.util.IntrospectorCleanupListener
invalidate() - Method in class org.springframework.mock.web.MockHttpServletRequest
Invalidate this request, clearing its state.
invalidate() - Method in class org.springframework.mock.web.MockHttpSession
invalidate() - Method in class org.springframework.mock.web.portlet.MockPortletSession
InvalidClientIDException - Exception in org.springframework.jms
Runtime exception mirroring the JMS InvalidClientIDException.
InvalidClientIDException(InvalidClientIDException) - Constructor for exception org.springframework.jms.InvalidClientIDException
InvalidDataAccessApiUsageException - Exception in org.springframework.dao
Exception thrown on incorrect usage of the API, such as failing to "compile" a query object that needed compilation before execution.
InvalidDataAccessApiUsageException(String) - Constructor for exception org.springframework.dao.InvalidDataAccessApiUsageException
Constructor for InvalidDataAccessApiUsageException.
InvalidDataAccessApiUsageException(String, Throwable) - Constructor for exception org.springframework.dao.InvalidDataAccessApiUsageException
Constructor for InvalidDataAccessApiUsageException.
InvalidDataAccessResourceUsageException - Exception in org.springframework.dao
Root for exceptions thrown when we use a data access resource incorrectly.
InvalidDataAccessResourceUsageException(String) - Constructor for exception org.springframework.dao.InvalidDataAccessResourceUsageException
Constructor for InvalidDataAccessResourceUsageException.
InvalidDataAccessResourceUsageException(String, Throwable) - Constructor for exception org.springframework.dao.InvalidDataAccessResourceUsageException
Constructor for InvalidDataAccessResourceUsageException.
InvalidDestinationException - Exception in org.springframework.jms
Runtime exception mirroring the JMS InvalidDestinationException.
InvalidDestinationException(InvalidDestinationException) - Constructor for exception org.springframework.jms.InvalidDestinationException
InvalidInvocationException - Exception in org.springframework.jmx.access
Thrown when trying to invoke an operation on a proxy that is not exposed by the proxied MBean resource's management interface.
InvalidInvocationException(String) - Constructor for exception org.springframework.jmx.access.InvalidInvocationException
Create a new InvalidInvocationException with the supplied error message.
InvalidIsolationLevelException - Exception in org.springframework.transaction
Exception that gets thrown when an invalid isolation level is specified, i.e.
InvalidIsolationLevelException(String) - Constructor for exception org.springframework.transaction.InvalidIsolationLevelException
Constructor for InvalidIsolationLevelException.
InvalidMetadataException - Exception in org.springframework.jmx.export.metadata
Thrown by the JmxAttributeSource when it encounters incorrect metadata on a managed resource or one of its methods.
InvalidMetadataException(String) - Constructor for exception org.springframework.jmx.export.metadata.InvalidMetadataException
Create a new InvalidMetadataException with the supplied error message.
InvalidPropertyException - Exception in org.springframework.beans
Exception thrown when referring to an invalid bean property.
InvalidPropertyException(Class, String, String) - Constructor for exception org.springframework.beans.InvalidPropertyException
Create a new InvalidPropertyException.
InvalidPropertyException(Class, String, String, Throwable) - Constructor for exception org.springframework.beans.InvalidPropertyException
Create a new InvalidPropertyException.
InvalidResultSetAccessException - Exception in org.springframework.jca.cci
Exception thrown when a ResultSet has been accessed in an invalid fashion.
InvalidResultSetAccessException(String, SQLException) - Constructor for exception org.springframework.jca.cci.InvalidResultSetAccessException
Constructor for InvalidResultSetAccessException.
InvalidResultSetAccessException - Exception in org.springframework.jdbc
Exception thrown when a ResultSet has been accessed in an invalid fashion.
InvalidResultSetAccessException(String, String, SQLException) - Constructor for exception org.springframework.jdbc.InvalidResultSetAccessException
Constructor for InvalidResultSetAccessException.
InvalidResultSetAccessException(SQLException) - Constructor for exception org.springframework.jdbc.InvalidResultSetAccessException
Constructor for InvalidResultSetAccessException.
InvalidSelectorException - Exception in org.springframework.jms
Runtime exception mirroring the JMS InvalidSelectorException.
InvalidSelectorException(InvalidSelectorException) - Constructor for exception org.springframework.jms.InvalidSelectorException
InvalidTimeoutException - Exception in org.springframework.transaction
Exception that gets thrown when an invalid timeout is specified, that is, the specified timeout valid is out of range or the transaction manager implementation doesn't support timeouts.
InvalidTimeoutException(String, int) - Constructor for exception org.springframework.transaction.InvalidTimeoutException
Constructor for InvalidTimeoutException.
InvertibleComparator<T> - Class in org.springframework.util.comparator
A decorator for a comparator, with an "ascending" flag denoting whether comparison results should be treated in forward (standard ascending) order or flipped for reverse (descending) order.
InvertibleComparator(Comparator<T>) - Constructor for class org.springframework.util.comparator.InvertibleComparator
Create an InvertibleComparator that sorts ascending by default.
InvertibleComparator(Comparator<T>, boolean) - Constructor for class org.springframework.util.comparator.InvertibleComparator
Create an InvertibleComparator that sorts based on the provided order.
invertOrder() - Method in class org.springframework.util.comparator.CompoundComparator
Invert the sort order of each sort definition contained by this compound comparator.
invertOrder(int) - Method in class org.springframework.util.comparator.CompoundComparator
Invert the sort order of the sort definition at the specified index.
invertOrder() - Method in class org.springframework.util.comparator.InvertibleComparator
Invert the sort order: ascending -> descending or descending -> ascending.
invocableClone() - Method in class org.springframework.aop.framework.ReflectiveMethodInvocation
This implementation returns a shallow copy of this invocation object, including an independent copy of the original arguments array.
invocableClone(Object[]) - Method in class org.springframework.aop.framework.ReflectiveMethodInvocation
This implementation returns a shallow copy of this invocation object, using the given arguments array for the clone.
invocableClone() - Method in interface org.springframework.aop.ProxyMethodInvocation
Create a clone of this object.
invocableClone(Object[]) - Method in interface org.springframework.aop.ProxyMethodInvocation
Create a clone of this object.
InvocationFailureException - Exception in org.springframework.jmx.access
Thrown when an invocation on an MBean resource failed with an exception (either a reflection exception or an exception thrown by the target method itself).
InvocationFailureException(String) - Constructor for exception org.springframework.jmx.access.InvocationFailureException
Create a new InvocationFailureException with the supplied error message.
InvocationFailureException(String, Throwable) - Constructor for exception org.springframework.jmx.access.InvocationFailureException
Create a new InvocationFailureException with the specified error message and root cause.
invoke(MethodInvocation) - Method in class org.springframework.aop.aspectj.AspectJAfterAdvice
invoke(MethodInvocation) - Method in class org.springframework.aop.aspectj.AspectJAfterThrowingAdvice
invoke(MethodInvocation) - Method in class org.springframework.aop.aspectj.AspectJAroundAdvice
invoke(MethodInvocation) - Method in class org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor
invoke(MethodInvocation) - Method in class org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor
invoke(MethodInvocation) - Method in class org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor
invoke(MethodInvocation) - Method in class org.springframework.aop.interceptor.AbstractTraceInterceptor
Determines whether or not logging is enabled for the particular MethodInvocation.
invoke(MethodInvocation) - Method in class org.springframework.aop.interceptor.AsyncExecutionInterceptor
invoke(MethodInvocation) - Method in class org.springframework.aop.interceptor.ConcurrencyThrottleInterceptor
invoke(MethodInvocation) - Method in class org.springframework.aop.interceptor.DebugInterceptor
invoke(MethodInvocation) - Method in class org.springframework.aop.interceptor.ExposeInvocationInterceptor
invoke(MethodInvocation) - Method in class org.springframework.aop.support.DelegatePerTargetObjectIntroductionInterceptor
Subclasses may need to override this if they want to perform custom behaviour in around advice.
invoke(MethodInvocation) - Method in class org.springframework.aop.support.DelegatingIntroductionInterceptor
Subclasses may need to override this if they want to perform custom behaviour in around advice.
invoke(MethodInvocation) - Method in class org.springframework.context.event.EventPublicationInterceptor
invoke(MethodInvocation) - Method in class org.springframework.dao.support.PersistenceExceptionTranslationInterceptor
invoke(MethodInvocation) - Method in class org.springframework.ejb.access.AbstractSlsbInvokerInterceptor
Prepares the thread context if necessar, and delegates to AbstractSlsbInvokerInterceptor.invokeInContext(org.aopalliance.intercept.MethodInvocation).
invoke(MethodInvocation) - Method in class org.springframework.jms.remoting.JmsInvokerClientInterceptor
invoke(MethodInvocation) - Method in class org.springframework.jmx.access.MBeanClientInterceptor
Route the invocation to the configured managed resource..
invoke(String, Object[], String[]) - Method in class org.springframework.jmx.export.SpringModelMBean
Switches the context ClassLoader for the managed resources ClassLoader before allowing the invocation to occur.
invoke(MethodInvocation) - Method in class org.springframework.orm.hibernate3.HibernateInterceptor
invoke(MethodInvocation) - Method in class org.springframework.orm.jdo.JdoInterceptor
invoke(MethodInvocation) - Method in class org.springframework.orm.jpa.JpaInterceptor
invoke(MethodInvocation) - Method in class org.springframework.remoting.caucho.BurlapClientInterceptor
invoke(InputStream, OutputStream) - Method in class org.springframework.remoting.caucho.BurlapExporter
Perform an invocation on the exported object.
invoke(MethodInvocation) - Method in class org.springframework.remoting.caucho.HessianClientInterceptor
invoke(InputStream, OutputStream) - Method in class org.springframework.remoting.caucho.HessianExporter
Perform an invocation on the exported object.
invoke(MethodInvocation) - Method in class org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor
invoke(MethodInvocation) - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Translates the method invocation into a JAX-RPC service invocation.
invoke(MethodInvocation) - Method in class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
invoke(MethodInvocation) - Method in class org.springframework.remoting.rmi.JndiRmiClientInterceptor
Fetches an RMI stub and delegates to JndiRmiClientInterceptor.doInvoke(org.aopalliance.intercept.MethodInvocation, java.lang.Object).
invoke(RemoteInvocation, Object) - Method in class org.springframework.remoting.rmi.RmiBasedExporter
Redefined here to be visible to RmiInvocationWrapper.
invoke(MethodInvocation) - Method in class org.springframework.remoting.rmi.RmiClientInterceptor
Fetches an RMI stub and delegates to doInvoke.
invoke(MethodInvocation, Remote, String) - Static method in class org.springframework.remoting.rmi.RmiClientInterceptorUtils
Deprecated. as of Spring 2.5, in favor of RmiClientInterceptorUtils.invokeRemoteMethod(org.aopalliance.intercept.MethodInvocation, java.lang.Object)
invoke(RemoteInvocation) - Method in interface org.springframework.remoting.rmi.RmiInvocationHandler
Apply the given invocation to the target object.
invoke(RemoteInvocation, Object) - Method in class org.springframework.remoting.support.DefaultRemoteInvocationExecutor
invoke(Object) - Method in class org.springframework.remoting.support.RemoteInvocation
Perform this invocation on the given target object.
invoke(RemoteInvocation, Object) - Method in class org.springframework.remoting.support.RemoteInvocationBasedExporter
Apply the given remote invocation to the given target object.
invoke(RemoteInvocation, Object) - Method in interface org.springframework.remoting.support.RemoteInvocationExecutor
Perform this invocation on the given target object.
invoke(MethodInvocation) - Method in class org.springframework.remoting.support.RemoteInvocationTraceInterceptor
invoke(MethodInvocation) - Method in class org.springframework.transaction.interceptor.TransactionInterceptor
invoke() - Method in class org.springframework.util.MethodInvoker
Invoke the specified method.
invokeAdviceMethod(JoinPointMatch, Object, Throwable) - Method in class org.springframework.aop.aspectj.AbstractAspectJAdvice
Invoke the advice method.
invokeAdviceMethod(JoinPoint, JoinPointMatch, Object, Throwable) - Method in class org.springframework.aop.aspectj.AbstractAspectJAdvice
invokeAdviceMethodWithGivenArgs(Object[]) - Method in class org.springframework.aop.aspectj.AbstractAspectJAdvice
invokeAfterCommit(List<TransactionSynchronization>) - Static method in class org.springframework.transaction.support.TransactionSynchronizationUtils
Actually invoke the afterCommit methods of the given Spring TransactionSynchronization objects.
invokeAfterCompletion(List<TransactionSynchronization>, int) - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Actually invoke the afterCompletion methods of the given Spring TransactionSynchronization objects.
invokeAfterCompletion(List<TransactionSynchronization>, int) - Static method in class org.springframework.transaction.support.TransactionSynchronizationUtils
Actually invoke the afterCompletion methods of the given Spring TransactionSynchronization objects.
invokeAndCreateResult(RemoteInvocation, Object) - Method in class org.springframework.remoting.support.RemoteInvocationBasedExporter
Apply the given remote invocation to the given target object, wrapping the invocation result in a serializable RemoteInvocationResult object.
invokeBeanFactoryPostProcessors(ConfigurableListableBeanFactory) - Method in class org.springframework.context.support.AbstractApplicationContext
Instantiate and invoke all registered BeanFactoryPostProcessor beans, respecting explicit order if given.
invokeCustomInitMethod(String, Object, RootBeanDefinition) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Invoke the specified custom init method on the given bean.
invokeDelegate(Filter, ServletRequest, ServletResponse, FilterChain) - Method in class org.springframework.web.filter.DelegatingFilterProxy
Actually invoke the delegate Filter with the given request and response.
invokeErrorHandler(Throwable) - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Invoke the registered ErrorHandler, if any.
invokeExceptionListener(JMSException) - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Invoke the registered JMS ExceptionListener, if any.
invokeGetterMethod(Object, String) - Static method in class org.springframework.test.util.ReflectionTestUtils
Invoke the getter method with the given name on the supplied target object with the supplied value.
invokeHandlerMethod(Method, Object, NativeWebRequest, ExtendedModelMap) - Method in class org.springframework.web.bind.annotation.support.HandlerMethodInvoker
invokeHandlerMethod(HttpServletRequest, HttpServletResponse, Object) - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
invokeInContext(MethodInvocation) - Method in class org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor
Fetches an EJB home object and delegates to doInvoke.
invokeInContext(MethodInvocation) - Method in class org.springframework.ejb.access.AbstractSlsbInvokerInterceptor
Perform the given invocation on the current EJB home, within the thread context being prepared accordingly.
invokeInContext(MethodInvocation) - Method in class org.springframework.ejb.access.LocalSlsbInvokerInterceptor
This implementation "creates" a new EJB instance for each invocation.
invokeInitMethods(String, Object, RootBeanDefinition) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Give a bean a chance to react now all its properties are set, and a chance to know about its owning bean factory (this object).
invokeJdbcMethod(Method, Object) - Static method in class org.springframework.util.ReflectionUtils
Invoke the specified JDBC API Method against the supplied target object with no arguments.
invokeJdbcMethod(Method, Object, Object...) - Static method in class org.springframework.util.ReflectionUtils
Invoke the specified JDBC API Method against the supplied target object with the supplied arguments.
invokeJoinpoint() - Method in class org.springframework.aop.framework.ReflectiveMethodInvocation
Invoke the joinpoint using reflection.
invokeJoinpointUsingReflection(Object, Method, Object[]) - Static method in class org.springframework.aop.support.AopUtils
Invoke the given target via reflection, as part of an AOP method invocation.
invokeListener(Session, Message) - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Invoke the specified listener: either as standard JMS MessageListener or (preferably) as Spring SessionAwareMessageListener.
invokeListenerMethod(String, Object[]) - Method in class org.springframework.jms.listener.adapter.MessageListenerAdapter
Invoke the specified listener method.
invokeMethod(Method, Object) - Static method in class org.springframework.util.ReflectionUtils
Invoke the specified Method against the supplied target object with no arguments.
invokeMethod(Method, Object, Object...) - Static method in class org.springframework.util.ReflectionUtils
Invoke the specified Method against the supplied target object with the supplied arguments.
invokeNamedMethod(String, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.mvc.multiaction.MultiActionController
Invokes the named method.
invokeRemoteMethod(MethodInvocation, Object) - Static method in class org.springframework.remoting.rmi.RmiClientInterceptorUtils
Perform a raw method invocation on the given RMI stub, letting reflection exceptions through as-is.
invokeSetterMethod(Object, String, Object) - Static method in class org.springframework.test.util.ReflectionTestUtils
Invoke the setter method with the given name on the supplied target object with the supplied value.
invokeSetterMethod(Object, String, Object, Class<?>) - Static method in class org.springframework.test.util.ReflectionTestUtils
Invoke the setter method with the given name on the supplied target object with the supplied value.
invokeUnderTrace(MethodInvocation, Log) - Method in class org.springframework.aop.interceptor.AbstractTraceInterceptor
Subclasses must override this method to perform any tracing around the supplied MethodInvocation.
invokeUnderTrace(MethodInvocation, Log) - Method in class org.springframework.aop.interceptor.CustomizableTraceInterceptor
Writes a log message before the invocation based on the value of enterMessage.
invokeUnderTrace(MethodInvocation, Log) - Method in class org.springframework.aop.interceptor.JamonPerformanceMonitorInterceptor
Wraps the invocation with a JAMon Monitor and writes the current performance statistics to the log (if enabled).
invokeUnderTrace(MethodInvocation, Log) - Method in class org.springframework.aop.interceptor.PerformanceMonitorInterceptor
invokeUnderTrace(MethodInvocation, Log) - Method in class org.springframework.aop.interceptor.SimpleTraceInterceptor
invokeValidator(Validator, Object, Errors) - Static method in class org.springframework.validation.ValidationUtils
Invoke the given Validator for the supplied object and Errors instance.
isAbstract() - Method in interface org.springframework.beans.factory.config.BeanDefinition
Return whether this bean is "abstract", that is, not meant to be instantiated.
isAbstract() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Return whether this bean is "abstract", i.e.
isAbstract() - Method in interface org.springframework.core.type.ClassMetadata
Return whether the underlying class is marked as abstract.
isAbstract() - Method in class org.springframework.core.type.StandardClassMetadata
isAcceptGzipEncoding() - Method in class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
Return whether to accept GZIP encoding, that is, whether to send the HTTP "Accept-Encoding" header with "gzip" as value.
isAcceptMessagesWhileStopping() - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Return whether to accept received messages while the listener container in the process of stopping.
isAccessCallParameterMetaData() - Method in class org.springframework.jdbc.core.metadata.CallMetaDataContext
Check whether call parameter metadata should be accessed.
isAccessTableColumnMetaData() - Method in class org.springframework.jdbc.core.metadata.TableMetaDataContext
Are we accessing table meta data?
isActive() - Method in class org.springframework.aop.framework.ProxyCreatorSupport
Subclasses can call this to check whether any AOP proxies have been created yet.
isActive() - Method in interface org.springframework.context.ConfigurableApplicationContext
Determine whether this application context is active, that is, whether it has been refreshed at least once and has not been closed yet.
isActive() - Method in class org.springframework.context.support.AbstractApplicationContext
isActive() - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Return whether this container is currently active, that is, whether it has been set up but not shut down yet.
isActive() - Method in class org.springframework.mock.web.MockHttpServletRequest
Return whether this request is still active (that is, not completed yet).
isActive() - Method in class org.springframework.mock.web.portlet.MockPortletRequest
Return whether this request is still active (that is, not completed yet).
isActualTransactionActive() - Static method in class org.springframework.transaction.support.TransactionSynchronizationManager
Return whether there currently is an actual transaction active.
isAdviceInstantiated() - Method in interface org.springframework.aop.aspectj.InstantiationModelAwarePointcutAdvisor
Return whether this advisor has already instantiated its advice.
isAfterAdvice() - Method in class org.springframework.aop.aspectj.AspectJAfterAdvice
isAfterAdvice() - Method in class org.springframework.aop.aspectj.AspectJAfterReturningAdvice
isAfterAdvice() - Method in class org.springframework.aop.aspectj.AspectJAfterThrowingAdvice
isAfterAdvice(Advisor) - Static method in class org.springframework.aop.aspectj.AspectJAopUtils
Return true if the advisor is a form of after advice.
isAfterAdvice() - Method in class org.springframework.aop.aspectj.AspectJAroundAdvice
isAfterAdvice() - Method in class org.springframework.aop.aspectj.AspectJMethodBeforeAdvice
isAfterAdvice() - Method in interface org.springframework.aop.aspectj.AspectJPrecedenceInformation
Return whether this is an after advice.
isAfterLast() - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
isAfterLast() - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves whether the cursor is after the last row of this RowSet.
isAlias(String) - Method in class org.springframework.context.support.GenericApplicationContext
isAlias(String) - Method in interface org.springframework.core.AliasRegistry
Determine whether this given name is defines as an alias (as opposed to the name of an actually registered component).
isAlias(String) - Method in class org.springframework.core.SimpleAliasRegistry
isAllowCreate() - Method in class org.springframework.orm.hibernate3.HibernateTemplate
Return if a new Session should be created if no thread-bound found.
isAllowCreate() - Method in class org.springframework.orm.jdo.JdoTemplate
Return if a new PersistenceManager should be created if no thread-bound found.
isAllowCreate() - Method in class org.springframework.orm.jdo.support.SpringPersistenceManagerProxyBean
Return whether the PersistenceManagerFactory proxy is allowed to create a non-transactional PersistenceManager when no transactional PersistenceManager can be found for the current thread.
isAllowCreate() - Method in class org.springframework.orm.jdo.TransactionAwarePersistenceManagerFactoryProxy
Return whether the PersistenceManagerFactory proxy is allowed to create a non-transactional PersistenceManager when no transactional PersistenceManager can be found for the current thread.
isAllowDirtyBack() - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Return whether "dirty back" is allowed.
isAllowDirtyBack() - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Return whether "dirty back" is allowed.
isAllowDirtyForward() - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Return whether "dirty forward" is allowed.
isAllowDirtyForward() - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Return whether "dirty forward" is allowed.
isAllowed(String) - Method in class org.springframework.validation.DataBinder
Return if the given field is allowed for binding.
isAlwaysUseMessageFormat() - Method in class org.springframework.context.support.MessageSourceSupport
Return whether to always apply the MessageFormat rules, parsing even messages without arguments.
isAlwaysUseNewSession() - Method in class org.springframework.orm.hibernate3.HibernateTemplate
Return whether to always use a new Hibernate Session for this template.
isAnnotated(String) - Method in interface org.springframework.core.type.AnnotationMetadata
Determine whether the underlying class has an annotation or meta-annotation of the given type defined.
isAnnotated(String) - Method in interface org.springframework.core.type.MethodMetadata
Determine whether the underlying method has an annotation or meta-annotation of the given type defined.
isAnnotated(String) - Method in class org.springframework.core.type.StandardAnnotationMetadata
isAnnotated(String) - Method in class org.springframework.core.type.StandardMethodMetadata
isAnnotationDeclaredLocally(Class<? extends Annotation>, Class<?>) - Static method in class org.springframework.core.annotation.AnnotationUtils
Determine whether an annotation for the specified annotationType is declared locally on the supplied clazz.
isAnnotationInherited(Class<? extends Annotation>, Class<?>) - Static method in class org.springframework.core.annotation.AnnotationUtils
Determine whether an annotation for the specified annotationType is present on the supplied clazz and is inherited i.e., not declared locally for the class).
isAopProxy(Object) - Static method in class org.springframework.aop.support.AopUtils
Check whether the given object is a JDK dynamic proxy or a CGLIB proxy.
isApproximableCollectionType(Class<?>) - Static method in class org.springframework.core.CollectionFactory
Determine whether the given collection type is an approximable type, i.e.
isApproximableMapType(Class<?>) - Static method in class org.springframework.core.CollectionFactory
Determine whether the given map type is an approximable type, i.e.
isArray() - Method in class org.springframework.core.convert.TypeDescriptor
Is this type an array type?
isArray(Object) - Static method in class org.springframework.util.ObjectUtils
Determine whether the given object is an array: either an Object array or a primitive array.
isAscending() - Method in class org.springframework.beans.support.MutableSortDefinition
isAscending() - Method in interface org.springframework.beans.support.SortDefinition
Return whether to sort ascending (true) or descending (false).
isAscending() - Method in class org.springframework.util.comparator.InvertibleComparator
Return the sort order: ascending (true) or descending (false).
isAspect(Class<?>) - Method in class org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory
We consider something to be an AspectJ aspect suitable for use by the Spring AOP system if it has the @Aspect annotation, and was not compiled by ajc.
isAspect(Class<?>) - Method in interface org.springframework.aop.aspectj.annotation.AspectJAdvisorFactory
Determine whether or not the given class is an aspect, as reported by AspectJ's AjTypeSystem.
isAssignable(Class, Class) - Static method in class org.springframework.util.Assert
Assert that superType.isAssignableFrom(subType) is true.
isAssignable(Class, Class, String) - Static method in class org.springframework.util.Assert
Assert that superType.isAssignableFrom(subType) is true.
isAssignable(Class<?>, Class<?>) - Static method in class org.springframework.util.ClassUtils
Check if the right-hand side type may be assigned to the left-hand side type, assuming setting by reflection.
isAssignable(Type, Type) - Static method in class org.springframework.util.TypeUtils
Check if the right-hand side type may be assigned to the left-hand side type following the Java generics rules.
isAssignableBound(Type, Type) - Static method in class org.springframework.util.TypeUtils
isAssignableTo(TypeDescriptor) - Method in class org.springframework.core.convert.TypeDescriptor
Returns true if an object this type can be assigned to a reference of given targetType.
isAssignableValue(Class<?>, Object) - Static method in class org.springframework.util.ClassUtils
Determine if the given type is assignable from the given value, assuming setting by reflection.
isAtLeastJava14() - Static method in class org.springframework.core.JdkVersion
Deprecated. as of Spring 3.0 which requires Java 1.5+
isAtLeastJava15() - Static method in class org.springframework.core.JdkVersion
Deprecated. as of Spring 3.0 which requires Java 1.5+
isAtLeastJava16() - Static method in class org.springframework.core.JdkVersion
Deprecated. as of Spring 3.0, in favor of reflective checks for the specific Java 1.6 classes of interest
isAutoGrowCollections() - Method in class org.springframework.expression.spel.SpelParserConfiguration
isAutoGrowNestedPaths() - Method in interface org.springframework.beans.BeanWrapper
Return whether "auto-growing" of nested paths has been activated.
isAutoGrowNestedPaths() - Method in class org.springframework.beans.BeanWrapperImpl
If this BeanWrapper should "auto grow" nested paths.
isAutoGrowNestedPaths() - Method in class org.springframework.validation.DataBinder
Return whether "auto-growing" of nested paths has been activated.
isAutoGrowNullReferences() - Method in class org.springframework.expression.spel.SpelParserConfiguration
isAutoStartup() - Method in interface org.springframework.context.SmartLifecycle
Return whether this Lifecycle component should be started automatically by the container when the ApplicationContext is refreshed.
isAutoStartup() - Method in class org.springframework.jca.endpoint.GenericMessageEndpointManager
Return the value for the 'autoStartup' property.
isAutoStartup() - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
isAutoStartup() - Method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
Return whether this scheduler is configured for auto-startup.
isAutowire() - Method in enum org.springframework.beans.factory.annotation.Autowire
Return whether this represents an actual autowiring value.
isAutowireCandidate(BeanDefinitionHolder, DependencyDescriptor) - Method in class org.springframework.beans.factory.annotation.QualifierAnnotationAutowireCandidateResolver
Determine whether the provided bean definition is an autowire candidate.
isAutowireCandidate() - Method in interface org.springframework.beans.factory.config.BeanDefinition
Return whether this bean is a candidate for getting autowired into some other bean.
isAutowireCandidate(String, DependencyDescriptor) - Method in interface org.springframework.beans.factory.config.ConfigurableListableBeanFactory
Determine whether the specified bean qualifies as an autowire candidate, to be injected into other beans which declare a dependency of matching type.
isAutowireCandidate() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Return whether this bean is a candidate for getting autowired into some other bean.
isAutowireCandidate(BeanDefinitionHolder, DependencyDescriptor) - Method in interface org.springframework.beans.factory.support.AutowireCandidateResolver
Determine whether the given bean definition qualifies as an autowire candidate for the given dependency.
isAutowireCandidate(String, DependencyDescriptor) - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
isAutowireCandidate(String, RootBeanDefinition, DependencyDescriptor) - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
Determine whether the specified bean definition qualifies as an autowire candidate, to be injected into other beans which declare a dependency of matching type.
isAutowireCandidate(BeanDefinitionHolder, DependencyDescriptor) - Method in class org.springframework.beans.factory.support.SimpleAutowireCandidateResolver
Determine if the provided bean definition is an autowire candidate.
isAvailable() - Method in class org.springframework.web.multipart.commons.CommonsMultipartFile
Determine whether the multipart content is still available.
isBatchExhausted(int) - Method in interface org.springframework.jdbc.core.InterruptibleBatchPreparedStatementSetter
Return whether the batch is complete, that is, whether there were no additional values added during the last setValues call.
isBatchExhausted(int) - Method in class org.springframework.jdbc.core.support.AbstractInterruptibleBatchPreparedStatementSetter
This implementation return this instance's current exhaustion flag.
isBeanDefinitionLazyInit(ListableBeanFactory, String) - Method in class org.springframework.jmx.export.MBeanExporter
Return whether the specified bean definition should be considered as lazy-init.
isBeanEligibleForMetadataCaching(String) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Determine whether the specified bean is eligible for having its bean definition metadata cached.
isBeanEligibleForMetadataCaching(String) - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
Considers all beans as eligible for metdata caching if the factory's configuration has been marked as frozen.
isBeanNameInUse(String) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Determine whether the given bean name is already in use within this factory, i.e.
isBeanNameInUse(String) - Method in interface org.springframework.beans.factory.support.BeanDefinitionRegistry
Determine whether the given bean name is already in use within this registry, i.e.
isBeanNameInUse(String) - Method in class org.springframework.beans.factory.support.SimpleBeanDefinitionRegistry
isBeanNameInUse(String) - Method in class org.springframework.context.support.GenericApplicationContext
isBeforeAdvice() - Method in class org.springframework.aop.aspectj.AspectJAfterAdvice
isBeforeAdvice() - Method in class org.springframework.aop.aspectj.AspectJAfterReturningAdvice
isBeforeAdvice() - Method in class org.springframework.aop.aspectj.AspectJAfterThrowingAdvice
isBeforeAdvice(Advisor) - Static method in class org.springframework.aop.aspectj.AspectJAopUtils
Return true if the advisor is a form of before advice.
isBeforeAdvice() - Method in class org.springframework.aop.aspectj.AspectJAroundAdvice
isBeforeAdvice() - Method in class org.springframework.aop.aspectj.AspectJMethodBeforeAdvice
isBeforeAdvice() - Method in interface org.springframework.aop.aspectj.AspectJPrecedenceInformation
Return whether this is a before advice.
isBeforeFirst() - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
isBeforeFirst() - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves whether the cursor is after the first row of this RowSet.
isBindEmptyMultipartFiles() - Method in class org.springframework.web.bind.WebDataBinder
Return whether to bind empty MultipartFile parameters.
isBindingCandidate(Object) - Method in class org.springframework.web.bind.annotation.support.HandlerMethodInvoker
Determine whether the given value qualifies as a "binding candidate", i.e.
isBindingFailure() - Method in class org.springframework.validation.FieldError
Return whether this error represents a binding failure (like a type mismatch); otherwise it is a validation failure.
isBindOnNewForm() - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Return if request parameters should be bound in case of a new form.
isBindOnNewForm() - Method in class org.springframework.web.servlet.mvc.AbstractFormController
Deprecated. Return true if request parameters should be bound in case of a new form.
isCache() - Method in class org.springframework.web.servlet.view.AbstractCachingViewResolver
Return if caching is enabled.
isCacheBeanMetadata() - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Return whether to cache bean metadata such as given bean definitions (in merged fashion) and resolved bean classes.
isCacheBeanMetadata() - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
isCacheConsumers() - Method in class org.springframework.jms.connection.CachingConnectionFactory
Return whether to cache JMS MessageConsumers per JMS Session instance.
isCacheProducers() - Method in class org.springframework.jms.connection.CachingConnectionFactory
Return whether to cache JMS MessageProducers per JMS Session instance.
isCacheQueries() - Method in class org.springframework.orm.hibernate3.HibernateTemplate
Return whether to cache all queries executed by this template.
isCacheSafe(Class<?>, ClassLoader) - Static method in class org.springframework.util.ClassUtils
Check whether the given class is cache-safe in the given context, i.e.
isCacheTemplate() - Method in class org.springframework.web.servlet.view.velocity.VelocityView
Return whether the Velocity template should be cached.
isCancelled() - Method in class org.springframework.scheduling.annotation.AsyncResult
isCancelRequest(PortletRequest) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Determine whether the incoming request is a request to cancel the processing of the current form.
isCancelRequest(HttpServletRequest) - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Determine whether the incoming request is a request to cancel the processing of the current form.
isCancelRequest(HttpServletRequest) - Method in class org.springframework.web.servlet.mvc.CancellableFormController
Deprecated. Determine whether the incoming request is a request to cancel the processing of the current form.
isCandidateComponent(MetadataReader) - Method in class org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider
Determine whether the given class does not match any exclude filter and does match at least one include filter.
isCandidateComponent(AnnotatedBeanDefinition) - Method in class org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider
Determine whether the given bean definition qualifies as candidate.
isCaseSensitive(int) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSetMetaData
isCaseSensitive(int) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSetMetaData
Indicates whether the case of the designated column is significant.
isCglibProxy(Object) - Static method in class org.springframework.aop.support.AopUtils
Check whether the given object is a CGLIB proxy.
isCglibProxyClass(Class<?>) - Static method in class org.springframework.aop.support.AopUtils
Check whether the specified class is a CGLIB-generated class.
isCglibProxyClassName(String) - Static method in class org.springframework.aop.support.AopUtils
Check whether the specified class name is a CGLIB-generated class.
isCheckedException(Throwable) - Static method in class org.springframework.util.ObjectUtils
Return whether the given throwable is a checked exception: that is, neither a RuntimeException nor an Error.
isCheckFullyPopulated() - Method in class org.springframework.jdbc.core.BeanPropertyRowMapper
Return whether we're strictly validating that all bean properties have been mapped from corresponding database fields.
isCheckWriteOperations() - Method in class org.springframework.orm.hibernate3.HibernateTemplate
Return whether to check that the Hibernate Session is not in read-only mode in case of write operations (save/update/delete).
isClassReloadable(Class) - Method in interface org.springframework.core.SmartClassLoader
Determine whether the given class is reloadable (in this ClassLoader).
isClientAcknowledge(Session) - Method in class org.springframework.jms.core.JmsTemplate102
Deprecated. This implementation overrides the superclass method to avoid using JMS 1.1's Session getAcknowledgeMode() method.
isClientAcknowledge(Session) - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer102
Deprecated. This implementation overrides the superclass method to avoid using JMS 1.1's Session getAcknowledgeMode() method.
isClientAcknowledge(Session) - Method in class org.springframework.jms.listener.SimpleMessageListenerContainer102
Deprecated. This implementation overrides the superclass method to avoid using JMS 1.1's Session getAcknowledgeMode() method.
isClientAcknowledge(Session) - Method in class org.springframework.jms.support.JmsAccessor
Determine whether the given Session is in client acknowledge mode.
isCloseMatch() - Method in class org.springframework.expression.spel.support.ReflectionHelper.ArgumentsMatchInfo
isCollection() - Method in class org.springframework.core.convert.TypeDescriptor
Is this type a Collection type?
isCommandInSession(RenderRequest) - Method in class org.springframework.web.portlet.mvc.AbstractCommandController
Deprecated. Determine if there is a valid command (and errors) object in the session for this render request.
isCommitted() - Method in class org.springframework.mock.web.MockHttpServletResponse
isCommitted() - Method in class org.springframework.mock.web.portlet.MockMimeResponse
isCompatible(BeanDefinition, BeanDefinition) - Method in class org.springframework.context.annotation.ClassPathBeanDefinitionScanner
Determine whether the given new bean definition is compatible with the given existing bean definition.
isCompatibleWith(MediaType) - Method in class org.springframework.http.MediaType
Indicate whether this MediaType is compatible with the given media type.
isCompatibleWithThrowsClause(Throwable, Class[]) - Static method in class org.springframework.util.ObjectUtils
Check whether the given exception is compatible with the exceptions declared in a throws clause.
isCompiled() - Method in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Is this operation "compiled"?
isCompiled() - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Is this operation "compiled"?
isCompiled() - Method in class org.springframework.jdbc.object.RdbmsOperation
Is this operation "compiled"? Compilation, as in JDO, means that the operation is fully configured, and ready to use.
isComplete() - Method in interface org.springframework.web.bind.support.SessionStatus
Return whether the current handler's session processing has been marked as complete.
isComplete() - Method in class org.springframework.web.bind.support.SimpleSessionStatus
isCompleted() - Method in class org.springframework.transaction.support.AbstractTransactionStatus
isCompleted() - Method in interface org.springframework.transaction.TransactionStatus
Return whether this transaction is completed, that is, whether it has already been committed or rolled back.
isConcrete() - Method in interface org.springframework.core.type.ClassMetadata
Return whether the underlying class represents a concrete class, i.e.
isConcrete() - Method in class org.springframework.core.type.StandardClassMetadata
isConfigurationFrozen() - Method in interface org.springframework.beans.factory.config.ConfigurableListableBeanFactory
Return whether this factory's bean definitions are frozen, i.e.
isConfigurationFrozen() - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
isConnectFailure(RemoteException) - Method in class org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor
Determine whether the given RMI exception indicates a connect failure.
isConnectFailure(RemoteException) - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Determine whether the given RMI exception indicates a connect failure.
isConnectFailure(RemoteException) - Method in class org.springframework.remoting.rmi.JndiRmiClientInterceptor
Determine whether the given RMI exception indicates a connect failure.
isConnectFailure(SystemException) - Method in class org.springframework.remoting.rmi.JndiRmiClientInterceptor
Determine whether the given CORBA exception indicates a connect failure.
isConnectFailure(RemoteException) - Method in class org.springframework.remoting.rmi.RmiClientInterceptor
Determine whether the given RMI exception indicates a connect failure.
isConnectFailure(RemoteException) - Static method in class org.springframework.remoting.rmi.RmiClientInterceptorUtils
Determine whether the given RMI exception indicates a connect failure.
isConnectionTransactional(Connection, ConnectionFactory) - Static method in class org.springframework.jca.cci.connection.ConnectionFactoryUtils
Determine whether the given JCA CCI Connection is transactional, that is, bound to the current thread by Spring's transaction facilities.
isConnectionTransactional(Connection, DataSource) - Static method in class org.springframework.jdbc.datasource.DataSourceUtils
Determine whether the given JDBC Connection is transactional, that is, bound to the current thread by Spring's transaction facilities.
isContextKeyEmpty(Object) - Method in class org.springframework.test.AbstractSpringContextTests
Deprecated. Determine if the supplied context key is empty.
isContextRequired() - Method in class org.springframework.context.support.ApplicationObjectSupport
Determine whether this application object needs to run in an ApplicationContext.
isContextRequired() - Method in class org.springframework.web.context.support.WebApplicationObjectSupport
Overrides the base class behavior to enforce running in an ApplicationContext.
isContextRequired() - Method in class org.springframework.web.portlet.context.PortletApplicationObjectSupport
Overrides the base class behavior to enforce running in an ApplicationContext.
isContextRequired() - Method in class org.springframework.web.servlet.view.InternalResourceView
An ApplicationContext is not strictly required for InternalResourceView.
isControllerType(Class) - Method in class org.springframework.web.servlet.mvc.support.AbstractControllerUrlHandlerMapping
Determine whether the given bean class indicates a controller type that is supported by this mapping strategy.
isConverted() - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues.ValueHolder
Return whether this holder contains a converted value already (true), or whether the value still needs to be converted (false).
isConverted() - Method in class org.springframework.beans.MutablePropertyValues
Return whether this holder contains converted values only (true), or whether the values still need to be converted (false).
isConverted() - Method in class org.springframework.beans.PropertyValue
Return whether this holder contains a converted value already (true), or whether the value still needs to be converted (false).
isCookieSecure() - Method in class org.springframework.web.util.CookieGenerator
Return whether the cookie should only be sent using a secure protocol, such as HTTPS (SSL).
isCurrency(int) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSetMetaData
isCurrency(int) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSetMetaData
Indicates whether the designated column contains a currency value.
isCurrentlyInCreation(String) - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Determine whether the specified bean is currently in creation.
isCurrentlyInCreation(String) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
isCurrentTransactionReadOnly() - Static method in class org.springframework.transaction.support.TransactionSynchronizationManager
Return whether the current transaction is marked as read-only.
isDaemon() - Method in class org.springframework.scheduling.commonj.DelegatingWork
This implementation delegates to SchedulingAwareRunnable.isLongLived(), if available.
isDaemon() - Method in class org.springframework.util.CustomizableThreadCreator
Return whether this factory should create daemon threads.
isDebug() - Method in class org.springframework.transaction.support.DefaultTransactionStatus
Return whether the progress of this transaction is debugged.
isDefaultBeanName() - Method in class org.springframework.beans.factory.wiring.BeanWiringInfo
Return whether the specific bean name is a suggested default bean name, not necessarily matching an actual bean definition in the factory.
isDefaultHtmlEscape() - Method in class org.springframework.web.servlet.support.RequestContext
Is default HTML escaping active? Falls back to false in case of no explicit default given.
isDefaultHtmlEscape() - Method in class org.springframework.web.servlet.tags.form.AbstractFormTag
Overridden to default to true in case of no explicit default given.
isDefaultHtmlEscape() - Method in class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
Return the applicable default HTML escape setting for this tag.
isDefaultHtmlEscape(ServletContext) - Static method in class org.springframework.web.util.WebUtils
Return whether default HTML escaping is enabled for the web application, i.e.
isDefaultLazyInit() - Method in class org.springframework.beans.factory.xml.ParserContext
isDefaultName - Variable in class org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.LookupElement
isDefaultNamespace(String) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
isDefaultRollback() - Method in class org.springframework.test.AbstractTransactionalSpringContextTests
Deprecated. Get the default rollback flag for this test.
isDefaultRollback(TestContext) - Method in class org.springframework.test.context.transaction.TransactionalTestExecutionListener
Determine whether or not to rollback transactions by default for the supplied test context.
isDefaultRollback() - Method in class org.springframework.test.context.transaction.TransactionConfigurationAttributes
Whether or not transactions should be rolled back by default.
isDeferredCloseActive(SessionFactory) - Static method in class org.springframework.orm.hibernate3.SessionFactoryUtils
Determine whether deferred close is active for the current thread and the given SessionFactory.
isDeliveryTransacted(Method) - Method in class org.springframework.jca.endpoint.AbstractMessageEndpointFactory
This implementation returns true if a transaction manager has been specified; false otherwise.
isDependencyCheck() - Method in class org.springframework.test.AbstractDependencyInjectionSpringContextTests
Deprecated. Return whether or not dependency checking should be performed for test properties set by Dependency Injection.
isDisabled() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
Is the current HTML tag disabled?
isDisabled() - Method in class org.springframework.web.servlet.tags.form.OptionsTag
Is the current HTML tag disabled?
isDisabled() - Method in class org.springframework.web.servlet.tags.form.OptionTag
Is the current HTML tag disabled?
isDisabledInThisEnvironment(Method) - Method in class org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests
Deprecated. Determine if the test for the supplied testMethod should run in the current environment.
isDisabledInThisEnvironment(String) - Method in class org.springframework.test.ConditionalTestCase
Deprecated. Should this test run?
isDone() - Method in class org.springframework.scheduling.annotation.AsyncResult
isDynamic() - Method in class org.springframework.beans.factory.config.TypedStringValue
Return whether this value has been marked as dynamic.
isEager() - Method in class org.springframework.beans.factory.config.DependencyDescriptor
Return whether this dependency is 'eager' in the sense of eagerly resolving potential target beans for type matching.
isEagerInit() - Method in class org.springframework.beans.factory.config.BeanReferenceFactoryBean
isEagerInit() - Method in interface org.springframework.beans.factory.SmartFactoryBean
Does this FactoryBean expect eager initialization, that is, eagerly initialize itself as well as expect eager initialization of its singleton object (if any)?
isEligibleAdvisorBean(String) - Method in class org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
Return whether the Advisor bean with the given name is eligible for proxying in the first place.
isEligibleAdvisorBean(String) - Method in class org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator
Consider Advisor beans with the specified prefix as eligible, if activated.
isEligibleAdvisorBean(String) - Method in class org.springframework.aop.framework.autoproxy.InfrastructureAdvisorAutoProxyCreator
isEligibleAspectBean(String) - Method in class org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator
Check whether the given aspect bean is eligible for auto-proxying.
isEligibleAttribute(Attr, ParserContext) - Method in class org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser
Determine whether the given attribute is eligible for being turned into a corresponding bean property value.
isEligibleAttribute(Attr) - Method in class org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser
Deprecated. in favour of AbstractSimpleBeanDefinitionParser.isEligibleAttribute(org.w3c.dom.Attr, ParserContext)
isEligibleAttribute(String) - Method in class org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser
Determine whether the given attribute is eligible for being turned into a corresponding bean property value.
isEligibleBean(String) - Method in class org.springframework.aop.aspectj.annotation.BeanFactoryAspectJAdvisorsBuilder
Return whether the aspect bean with the given name is eligible.
isEligibleBean(String) - Method in class org.springframework.aop.framework.autoproxy.BeanFactoryAdvisorRetrievalHelper
Determine whether the aspect bean with the given name is eligible.
isEligibleForEtag(HttpServletRequest, HttpServletResponse, int, byte[]) - Method in class org.springframework.web.filter.ShallowEtagHeaderFilter
Indicates whether the given request and response are eligible for ETag generation.
isEligibleForMapping(String, Class) - Method in class org.springframework.web.servlet.mvc.support.AbstractControllerUrlHandlerMapping
Determine whether the specified controller is excluded from this mapping.
isEligibleForOverriding(String) - Method in class org.springframework.core.OverridingClassLoader
Determine whether the specified class is eligible for overriding by this class loader.
isEligibleForPropertyPopulation(Object) - Method in class org.springframework.scheduling.quartz.SpringBeanJobFactory
Return whether the given job object is eligible for having its bean properties populated.
isEligibleForShadowing(String) - Method in class org.springframework.instrument.classloading.ShadowingClassLoader
Determine whether the specified class is eligible for shadowing by this class loader.
isEligibleProperty(String, Object) - Method in class org.springframework.web.servlet.view.RedirectView
Determine whether the given model element should be exposed as a query property.
isEligibleValue(Object) - Method in class org.springframework.web.servlet.view.RedirectView
Determine whether the given model element value is eligible for exposure.
isEmpty() - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues
Return if this holder does not contain any argument values, neither indexed ones nor generic ones.
isEmpty() - Method in class org.springframework.beans.factory.support.MethodOverrides
Return whether the set of method overrides is empty.
isEmpty() - Method in class org.springframework.beans.MutablePropertyValues
isEmpty() - Method in interface org.springframework.beans.PropertyValues
Does this holder not contain any PropertyValue objects at all?
isEmpty() - Method in class org.springframework.http.HttpHeaders
isEmpty() - Method in class org.springframework.mock.web.MockMultipartFile
isEmpty() - Method in class org.springframework.orm.hibernate3.SessionHolder
isEmpty() - Method in class org.springframework.util.AutoPopulatingList
isEmpty() - Method in class org.springframework.util.CachingMapDecorator
isEmpty(Collection) - Static method in class org.springframework.util.CollectionUtils
Return true if the supplied Collection is null or empty.
isEmpty(Map) - Static method in class org.springframework.util.CollectionUtils
Return true if the supplied Map is null or empty.
isEmpty() - Method in class org.springframework.util.LinkedMultiValueMap
isEmpty(Object[]) - Static method in class org.springframework.util.ObjectUtils
Determine whether the given array is empty: i.e.
isEmpty() - Method in class org.springframework.web.multipart.commons.CommonsMultipartFile
isEmpty() - Method in interface org.springframework.web.multipart.MultipartFile
Return whether the uploaded file is empty, that is, either no file has been chosen in the multipart form or the chosen file has no content.
isEmpty() - Method in class org.springframework.web.portlet.ModelAndView
Return whether this ModelAndView object is empty, i.e.
isEmpty() - Method in class org.springframework.web.servlet.ModelAndView
Return whether this ModelAndView object is empty, i.e.
isEnforceDestroyMethod() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Indicate whether the configured destroy method is the default.
isEnforceInitMethod() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Indicate whether the configured init method is the default.
isEqualsMethod(Method) - Static method in class org.springframework.aop.support.AopUtils
Determine whether the given method is an "equals" method.
isEqualsMethod(Method) - Static method in class org.springframework.util.ReflectionUtils
Determine whether the given method is an "equals" method.
isError() - Method in class org.springframework.web.servlet.support.BindStatus
Return if this status represents a field or object error.
isExactMatch() - Method in class org.springframework.expression.spel.support.ReflectionHelper.ArgumentsMatchInfo
isExcluded(String) - Method in class org.springframework.core.DecoratingClassLoader
Determine whether the specified class is excluded from decoration by this class loader.
isExcludedFromDependencyCheck(PropertyDescriptor) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Determine whether the given bean property is excluded from dependency checks.
isExistingTransaction(Object) - Method in class org.springframework.jca.cci.connection.CciLocalTransactionManager
isExistingTransaction(Object) - Method in class org.springframework.jdbc.datasource.DataSourceTransactionManager
isExistingTransaction(Object) - Method in class org.springframework.jms.connection.JmsTransactionManager
isExistingTransaction(Object) - Method in class org.springframework.orm.hibernate3.HibernateTransactionManager
isExistingTransaction(Object) - Method in class org.springframework.orm.jdo.JdoTransactionManager
isExistingTransaction(Object) - Method in class org.springframework.orm.jpa.JpaTransactionManager
isExistingTransaction(Object) - Method in class org.springframework.transaction.jta.JtaTransactionManager
isExistingTransaction(Object) - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Check if the given transaction object indicates an existing transaction (that is, a transaction which has already started).
isExplicitQosEnabled() - Method in class org.springframework.jms.core.JmsTemplate
If "true", then the values of deliveryMode, priority, and timeToLive will be used when sending a message.
isExposeClassDescriptor() - Method in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Return whether to expose the JMX descriptor field "class" for managed operations.
isExposeListenerSession() - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Return whether to expose the listener JMS Session to a registered SessionAwareMessageListener.
isExposeNativeEntityManager() - Method in class org.springframework.orm.jpa.JpaTemplate
Return whether to expose the native JPA EntityManager to JpaCallback code, or rather an EntityManager proxy.
isExposeNativePersistenceManager() - Method in class org.springframework.orm.jdo.JdoTemplate
Return whether to expose the native JDO PersistenceManager to JdoCallback code, or rather a PersistenceManager proxy.
isExposeNativeSession() - Method in class org.springframework.orm.hibernate3.HibernateTemplate
Return whether to expose the native Hibernate Session to HibernateCallback code, or rather a Session proxy.
isExposeProxy() - Method in interface org.springframework.aop.framework.Advised
Return whether the factory should expose the proxy as a ThreadLocal.
isExposeProxy() - Method in class org.springframework.aop.framework.ProxyConfig
Return whether the AOP proxy will expose the AOP proxy for each invocation.
isExposeTransactionAwareSessionFactory() - Method in class org.springframework.orm.hibernate3.AbstractSessionFactoryBean
Return whether to expose a transaction-aware proxy for the SessionFactory.
isExpressionLanguage(String) - Static method in class org.springframework.web.util.ExpressionEvaluationUtils
Check if the given expression value is an EL expression.
isExternallyManagedConfigMember(Member) - Method in class org.springframework.beans.factory.support.RootBeanDefinition
isExternallyManagedDestroyMethod(String) - Method in class org.springframework.beans.factory.support.RootBeanDefinition
isExternallyManagedInitMethod(String) - Method in class org.springframework.beans.factory.support.RootBeanDefinition
isExtractOldValueForEditor() - Method in class org.springframework.beans.AbstractPropertyAccessor
isExtractOldValueForEditor() - Method in interface org.springframework.beans.ConfigurablePropertyAccessor
Return whether to extract the old property value when applying a property editor to a new value for a property.
isFactoryBean(String) - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Determine whether the bean with the given name is a FactoryBean.
isFactoryBean(String) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
isFactoryBean(String, RootBeanDefinition) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Check whether the given bean is defined as a FactoryBean.
isFactoryDereference(String) - Static method in class org.springframework.beans.factory.BeanFactoryUtils
Return whether the given name is a factory dereference (beginning with the factory dereference prefix).
isFactoryMethod(Method) - Method in class org.springframework.beans.factory.support.RootBeanDefinition
Check whether the given candidate qualifies as a factory method.
isFailEarlyOnGlobalRollbackOnly() - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Return whether to fail early in case of the transaction being globally marked as rollback-only.
isField - Variable in class org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement
isFinal() - Method in interface org.springframework.core.type.ClassMetadata
Return whether the underlying class is marked as 'final'.
isFinal() - Method in interface org.springframework.core.type.MethodMetadata
Return whether the underlying method is marked as 'final'.
isFinal() - Method in class org.springframework.core.type.StandardClassMetadata
isFinal() - Method in class org.springframework.core.type.StandardMethodMetadata
isFinalizeMethod(Method) - Static method in class org.springframework.aop.support.AopUtils
Determine whether the given method is a "finalize" method.
isFinishRequest(PortletRequest) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Determine whether the incoming request is a request to finish the processing of the current form.
isFinishRequest(HttpServletRequest) - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Determine whether the incoming request is a request to finish the processing of the current form.
isFirst() - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
isFirst() - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves whether the cursor is on the first row of this RowSet.
isFirstPage() - Method in class org.springframework.beans.support.PagedListHolder
Return if the current page is the first one.
isFixedRate() - Method in class org.springframework.scheduling.commonj.ScheduledTimerListener
Return whether to schedule as fixed-rate execution.
isFixedRate() - Method in class org.springframework.scheduling.concurrent.ScheduledExecutorTask
Return whether to schedule as fixed-rate execution.
isFixedRate() - Method in class org.springframework.scheduling.timer.ScheduledTimerTask
Deprecated. Return whether to schedule as fixed-rate execution.
isFlushEager() - Method in class org.springframework.orm.jdo.JdoAccessor
Return if this accessor should flush changes to the database eagerly.
isFlushEager() - Method in class org.springframework.orm.jpa.JpaAccessor
Return if this accessor should flush changes to the database eagerly.
isFormChangeRequest(PortletRequest) - Method in class org.springframework.web.portlet.mvc.SimpleFormController
Deprecated. Determine whether the given request is a form change request.
isFormChangeRequest(HttpServletRequest, Object) - Method in class org.springframework.web.servlet.mvc.SimpleFormController
Deprecated. Determine whether the given request is a form change request.
isFormChangeRequest(HttpServletRequest) - Method in class org.springframework.web.servlet.mvc.SimpleFormController
Deprecated. Simpler isFormChangeRequest variant, called by the full variant SimpleFormController.isFormChangeRequest(HttpServletRequest, Object).
isFormSubmission(PortletRequest) - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Determine if the given request represents a form submission.
isFormSubmission(PortletRequest) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Consider an explicit finish or cancel request as a form submission too.
isFormSubmission(HttpServletRequest) - Method in class org.springframework.web.servlet.mvc.AbstractFormController
Deprecated. Determine if the given request represents a form submission.
isFormSubmission(HttpServletRequest) - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Consider an explicit finish or cancel request as a form submission too.
isFormSubmission(HttpServletRequest) - Method in class org.springframework.web.servlet.mvc.CancellableFormController
Deprecated. Consider an explicit cancel request as a form submission too.
isFrozen() - Method in interface org.springframework.aop.framework.Advised
Return whether the Advised configuration is frozen, in which case no advice changes can be made.
isFrozen() - Method in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
isFrozen() - Method in class org.springframework.aop.framework.ProxyConfig
Return whether the config is frozen, and no advice changes can be made.
isFrozen() - Method in class org.springframework.jms.connection.JmsResourceHolder
isFunction() - Method in class org.springframework.jdbc.core.metadata.CallMetaDataContext
Check whether this call is a function call.
isFunction() - Method in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Is this call a function call?
isFunction() - Method in class org.springframework.jdbc.object.SqlCall
Return whether this call is for a function.
isGeneratedBeanName(String) - Static method in class org.springframework.beans.factory.BeanFactoryUtils
Return whether the given name is a bean name which has been generated by the default naming strategy (containing a "#..." part).
isGenerateDdl() - Method in class org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter
Return whether to generate DDL after the EntityManagerFactory has been initialized creating/updating all relevant tables.
isGenerateDefaultLocations() - Method in class org.springframework.test.context.support.AbstractContextLoader
Determine whether or not default resource locations should be generated if the locations provided to processLocations() are null or empty.
isGeneratedKeysColumnNameArraySupported() - Method in class org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
isGeneratedKeysColumnNameArraySupported() - Method in class org.springframework.jdbc.core.metadata.TableMetaDataContext
Is a column name String array for retreiving generated keys supported Connection.createStruct(String, Object[])?
isGeneratedKeysColumnNameArraySupported() - Method in interface org.springframework.jdbc.core.metadata.TableMetaDataProvider
Does this database support a column name String array for retreiving generated keys Connection.createStruct(String, Object[])
isGetGeneratedKeysSimulated() - Method in class org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
isGetGeneratedKeysSimulated() - Method in class org.springframework.jdbc.core.metadata.HsqlTableMetaDataProvider
isGetGeneratedKeysSimulated() - Method in class org.springframework.jdbc.core.metadata.PostgresTableMetaDataProvider
isGetGeneratedKeysSimulated() - Method in class org.springframework.jdbc.core.metadata.TableMetaDataContext
Does this database support simple query to retrieve generated keys when the JDBC 3.0 feature is not supported DatabaseMetaData.supportsGetGeneratedKeys()?
isGetGeneratedKeysSimulated() - Method in interface org.springframework.jdbc.core.metadata.TableMetaDataProvider
Does this database support a simple quey to retrieve the generated key whe the JDBC 3.0 feature of retreiving generated keys is not supported DatabaseMetaData.supportsGetGeneratedKeys()
isGetGeneratedKeysSupported() - Method in class org.springframework.jdbc.core.metadata.DerbyTableMetaDataProvider
isGetGeneratedKeysSupported() - Method in class org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
isGetGeneratedKeysSupported() - Method in class org.springframework.jdbc.core.metadata.TableMetaDataContext
Does this database support the JDBC 3.0 feature of retreiving generated keys DatabaseMetaData.supportsGetGeneratedKeys()?
isGetGeneratedKeysSupported() - Method in interface org.springframework.jdbc.core.metadata.TableMetaDataProvider
Does this database support the JDBC 3.0 feature of retreiving generated keys DatabaseMetaData.supportsGetGeneratedKeys()
isGlobalRollbackOnly() - Method in class org.springframework.transaction.support.AbstractTransactionStatus
Template method for determining the global rollback-only flag of the underlying transaction, if any.
isGlobalRollbackOnly() - Method in class org.springframework.transaction.support.DefaultTransactionStatus
Determine the rollback-only flag via checking both the transaction object, provided that the latter implements the SmartTransactionObject interface.
isGlobalRollbackOnParticipationFailure() - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Return whether to globally mark an existing transaction as rollback-only after a participating transaction failed.
isGzipResponse(PostMethod) - Method in class org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor
Determine whether the given response indicates a GZIP response.
isGzipResponse(HttpURLConnection) - Method in class org.springframework.remoting.httpinvoker.SimpleHttpInvokerRequestExecutor
Determine whether the given response is a GZIP response.
isHandlerMethod(Method) - Method in class org.springframework.web.bind.annotation.support.HandlerMethodResolver
isHashCodeMethod(Method) - Static method in class org.springframework.aop.support.AopUtils
Determine whether the given method is a "hashCode" method.
isHashCodeMethod(Method) - Static method in class org.springframework.util.ReflectionUtils
Determine whether the given method is a "hashCode" method.
isHomeRefreshable() - Method in class org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor
isHomeRefreshable() - Method in class org.springframework.ejb.access.AbstractSlsbInvokerInterceptor
Return whether the cached EJB home object is potentially subject to on-demand refreshing.
isHtmlEscape() - Method in class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
Return the HTML escaping setting for this tag, or the default setting if not overridden.
isIgnoreCase() - Method in class org.springframework.beans.support.MutableSortDefinition
isIgnoreCase() - Method in interface org.springframework.beans.support.SortDefinition
Return whether upper and lower case in String values should be ignored.
isIgnoreInvalidFields() - Method in class org.springframework.validation.DataBinder
Return whether to ignore invalid fields when binding.
isIgnoreNestedPath() - Method in class org.springframework.web.servlet.tags.BindTag
Return whether to ignore a nested path, if any.
isIgnoreUnknownFields() - Method in class org.springframework.validation.DataBinder
Return whether to ignore unknown fields when binding.
isIgnoreWarnings() - Method in class org.springframework.jdbc.core.JdbcTemplate
Return whether or not we ignore SQLWarnings.
isIgnoring(IMessage.Kind) - Method in class org.springframework.aop.aspectj.AspectJWeaverMessageHandler
isIncludeClientInfo() - Method in class org.springframework.web.context.request.Log4jNestedDiagnosticContextInterceptor
Return whether or not the session id and user name should be included in the log message.
isIncludeClientInfo() - Method in class org.springframework.web.filter.AbstractRequestLoggingFilter
Return whether or not the client address and session id should be included in the log message.
isIncludePayload() - Method in class org.springframework.web.filter.AbstractRequestLoggingFilter
Return whether or not the request payload (body) should be included in the log message.
isIncludeQueryString() - Method in class org.springframework.web.filter.AbstractRequestLoggingFilter
Return whether or not the query string should be included in the log message.
isIncludeRequest(ServletRequest) - Static method in class org.springframework.web.util.WebUtils
Determine whether the given request is an include request, that is, not a top-level HTTP request coming in from the outside.
isIndependent() - Method in interface org.springframework.core.type.ClassMetadata
Determine whether the underlying class is independent, i.e.
isIndependent() - Method in class org.springframework.core.type.StandardClassMetadata
isInfrastructureClass(Class) - Method in class org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator
isInfrastructureClass(Class<?>) - Method in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
Return whether the given bean class represents an infrastructure class that should never be proxied.
isInitialized() - Method in class org.springframework.aop.target.AbstractLazyCreationTargetSource
Return whether the lazy target object of this TargetSource has already been fetched.
isInputValueProvided() - Method in class org.springframework.jdbc.core.ResultSetSupportingSqlParameter
This implementation always returns false.
isInputValueProvided() - Method in class org.springframework.jdbc.core.SqlInOutParameter
This implementation always returns true.
isInputValueProvided() - Method in class org.springframework.jdbc.core.SqlParameter
Return whether this parameter holds input values that should be set before execution even if they are null.
isInputValueProvided() - Method in class org.springframework.jdbc.core.SqlReturnUpdateCount
Return whether this parameter holds input values that should be set before execution even if they are null.
isInstanceOf(Class, Object) - Static method in class org.springframework.util.Assert
Assert that the provided object is an instance of the provided class.
isInstanceOf(Class, Object, String) - Static method in class org.springframework.util.Assert
Assert that the provided object is an instance of the provided class.
isInstrumentationAvailable() - Static method in class org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver
Check whether an Instrumentation instance is available for the current VM.
isInterceptorEnabled(MethodInvocation, Log) - Method in class org.springframework.aop.interceptor.AbstractTraceInterceptor
Determine whether the interceptor should kick in, that is, whether the invokeUnderTrace method should be called.
isInterceptorEnabled(MethodInvocation, Log) - Method in class org.springframework.aop.interceptor.JamonPerformanceMonitorInterceptor
Always applies the interceptor if the "trackAllInvocations" flag has been set; else just kicks in if the log is enabled.
isInterface() - Method in interface org.springframework.core.type.ClassMetadata
Return whether the underlying class represents an interface.
isInterface() - Method in class org.springframework.core.type.StandardClassMetadata
isInterfaceProxied(Class) - Method in interface org.springframework.aop.framework.Advised
Determine whether the given interface is proxied.
isInterfaceProxied(Class) - Method in class org.springframework.aop.framework.AdvisedSupport
isInvalid() - Method in class org.springframework.mock.web.MockHttpSession
isInvalid() - Method in class org.springframework.mock.web.portlet.MockPortletSession
isInvalidSubmission(PortletRequest) - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Determine if the given request represents an invalid form submission.
isJarResource(Resource) - Method in class org.springframework.core.io.support.PathMatchingResourcePatternResolver
Return whether the given resource handle indicates a jar resource that the doFindPathMatchingJarResources method can handle.
isJarURL(URL) - Static method in class org.springframework.util.ResourceUtils
Determine whether the given URL points to a resource in a jar file, that is, has protocol "jar", "zip", "wsjar" or "code-source".
isJdkDynamicProxy(Object) - Static method in class org.springframework.aop.support.AopUtils
Check whether the given object is a JDK dynamic proxy.
isLast() - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
isLast() - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Retrieves whether the cursor is on the last row of this RowSet.
isLastPage() - Method in class org.springframework.beans.support.PagedListHolder
Return if the current page is the last one.
isLazilyInstantiated() - Method in class org.springframework.aop.aspectj.annotation.AspectMetadata
Return whether the aspect needs to be lazily instantiated.
isLazy() - Method in interface org.springframework.aop.aspectj.InstantiationModelAwarePointcutAdvisor
Return whether this advisor is lazily initializing its underlying advice.
isLazyInit() - Method in interface org.springframework.beans.factory.config.BeanDefinition
Return whether this bean should be lazily initialized, i.e.
isLazyInit() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Return whether this bean should be lazily initialized, i.e.
isLazyInit() - Method in class org.springframework.beans.factory.support.BeanDefinitionDefaults
isLazyInit() - Method in class org.springframework.jdbc.support.JdbcAccessor
Return whether to lazily initialize the SQLExceptionTranslator for this accessor.
isLenientConstructorResolution() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Return whether to resolve constructors in lenient mode or in strict mode.
isLocalRollbackOnly() - Method in class org.springframework.transaction.support.AbstractTransactionStatus
Determine the rollback-only flag via checking this TransactionStatus.
isLog() - Method in class org.springframework.jmx.export.metadata.ManagedResource
isLogEnabled(Log) - Method in class org.springframework.aop.interceptor.AbstractTraceInterceptor
Determine whether the given Log instance is enabled.
isLongLived() - Method in interface org.springframework.scheduling.SchedulingAwareRunnable
Return whether the Runnable's operation is long-lived (true) versus short-lived (false).
isMaintainSession() - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Return the maintain session flag to specify on the stub or call.
isMaintainSession() - Method in class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
Return the "session.maintain" flag to specify on the stub.
isMap() - Method in class org.springframework.core.convert.TypeDescriptor
Is this type a Map type?
isMapEntryTypeKnown() - Method in class org.springframework.core.convert.TypeDescriptor
Is this descriptor for a map where the key type and value type are known?
isMatch(String, String) - Method in class org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator
Return if the given bean name matches the mapped name.
isMatch(String, String) - Method in class org.springframework.aop.support.NameMatchMethodPointcut
Return if the given method name matches the mapped name.
isMatch(Method, String) - Method in class org.springframework.jmx.export.assembler.MethodNameBasedMBeanInfoAssembler
isMatch(String, String) - Method in class org.springframework.transaction.interceptor.MethodMapTransactionAttributeSource
Return if the given method name matches the mapped name.
isMatch(String, String) - Method in class org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource
Return if the given method name matches the mapped name.
isMatchingFieldError(String, FieldError) - Method in class org.springframework.validation.AbstractErrors
Check whether the given FieldError matches the given field.
isMatchRequiringConversion() - Method in class org.springframework.expression.spel.support.ReflectionHelper.ArgumentsMatchInfo
isMaterialized() - Method in class org.springframework.aop.aspectj.annotation.LazySingletonAspectInstanceFactoryDecorator
isMBean(Class) - Method in class org.springframework.jmx.export.MBeanExporter
Determine whether the given bean class qualifies as an MBean as-is.
isMBean(Class<?>) - Static method in class org.springframework.jmx.support.JmxUtils
Determine whether the given bean class qualifies as an MBean as-is.
isMergeEnabled() - Method in class org.springframework.beans.factory.support.ManagedList
isMergeEnabled() - Method in class org.springframework.beans.factory.support.ManagedMap
isMergeEnabled() - Method in class org.springframework.beans.factory.support.ManagedProperties
isMergeEnabled() - Method in class org.springframework.beans.factory.support.ManagedSet
isMergeEnabled() - Method in interface org.springframework.beans.Mergeable
Is merging enabled for this particular instance?
isMessageIdEnabled() - Method in class org.springframework.jms.core.JmsTemplate
Return whether message IDs are enabled.
isMessageTimestampEnabled() - Method in class org.springframework.jms.core.JmsTemplate
Return whether message timestamps are enabled.
isMethodBrowserSupported(String) - Method in class org.springframework.web.servlet.tags.form.FormTag
Determine if the HTTP method is supported by browsers (i.e.
isMethodOnIntroducedInterface(MethodInvocation) - Method in class org.springframework.aop.support.IntroductionInfoSupport
Is this method on an introduced interface?
isMinimalPutsEnabledByDefault() - Method in class org.springframework.orm.hibernate3.LocalCacheProviderProxy
isMinimalPutsEnabledByDefault() - Method in class org.springframework.orm.hibernate3.LocalRegionFactoryProxy
isModified() - Method in interface org.springframework.scripting.ScriptSource
Indicate whether the underlying script data has been modified since the last time ScriptSource.getScriptAsString() was called.
isModified() - Method in class org.springframework.scripting.support.ResourceScriptSource
isModified() - Method in class org.springframework.scripting.support.StaticScriptSource
isMultiActionControllerType(Class) - Method in class org.springframework.web.servlet.mvc.support.AbstractControllerUrlHandlerMapping
Determine whether the given bean class indicates a controller type that dispatches to multiple action methods.
isMultipart() - Method in class org.springframework.mail.javamail.MimeMessageHelper
Return whether this helper is in multipart mode, i.e.
isMultipart(HttpServletRequest) - Method in class org.springframework.web.multipart.commons.CommonsMultipartResolver
isMultipart(HttpServletRequest) - Method in interface org.springframework.web.multipart.MultipartResolver
Determine if the given request contains multipart content.
isMultipart(ActionRequest) - Method in class org.springframework.web.portlet.multipart.CommonsPortletMultipartResolver
isMultipart(ActionRequest) - Method in interface org.springframework.web.portlet.multipart.PortletMultipartResolver
Determine if the given request contains multipart content.
isMutable() - Method in class org.springframework.orm.hibernate3.support.AbstractLobType
This implementation returns false.
isMutable() - Method in class org.springframework.orm.hibernate3.support.BlobByteArrayType
isMutable() - Method in class org.springframework.orm.hibernate3.support.BlobSerializableType
isMXBeanSupportAvailable() - Static method in class org.springframework.jmx.support.JmxUtils
Check whether MXBean support is available, i.e.
isNamespaceAware() - Method in class org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Return whether or not the XML parser should be XML namespace aware.
isNativeConnectionNecessaryForNativeCallableStatements() - Method in class org.springframework.jdbc.support.nativejdbc.C3P0NativeJdbcExtractor
isNativeConnectionNecessaryForNativeCallableStatements() - Method in interface org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor
Return whether it is necessary to work on the native Connection to receive native CallableStatements.
isNativeConnectionNecessaryForNativeCallableStatements() - Method in class org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
Return false by default.
isNativeConnectionNecessaryForNativeCallableStatements() - Method in class org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor
isNativeConnectionNecessaryForNativeCallableStatements() - Method in class org.springframework.jdbc.support.nativejdbc.WebLogicNativeJdbcExtractor
Return true, as WebLogic returns wrapped CallableStatements.
isNativeConnectionNecessaryForNativeCallableStatements() - Method in class org.springframework.jdbc.support.nativejdbc.WebSphereNativeJdbcExtractor
Return true, as WebSphere returns wrapped CallableStatements.
isNativeConnectionNecessaryForNativePreparedStatements() - Method in class org.springframework.jdbc.support.nativejdbc.C3P0NativeJdbcExtractor
isNativeConnectionNecessaryForNativePreparedStatements() - Method in interface org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor
Return whether it is necessary to work on the native Connection to receive native PreparedStatements.
isNativeConnectionNecessaryForNativePreparedStatements() - Method in class org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
Return false by default.
isNativeConnectionNecessaryForNativePreparedStatements() - Method in class org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor
isNativeConnectionNecessaryForNativePreparedStatements() - Method in class org.springframework.jdbc.support.nativejdbc.WebLogicNativeJdbcExtractor
Return true, as WebLogic returns wrapped PreparedStatements.
isNativeConnectionNecessaryForNativePreparedStatements() - Method in class org.springframework.jdbc.support.nativejdbc.WebSphereNativeJdbcExtractor
Return true, as WebSphere returns wrapped PreparedStatements.
isNativeConnectionNecessaryForNativeStatements() - Method in class org.springframework.jdbc.support.nativejdbc.C3P0NativeJdbcExtractor
isNativeConnectionNecessaryForNativeStatements() - Method in interface org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor
Return whether it is necessary to work on the native Connection to receive native Statements.
isNativeConnectionNecessaryForNativeStatements() - Method in class org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
Return false by default.
isNativeConnectionNecessaryForNativeStatements() - Method in class org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor
isNativeConnectionNecessaryForNativeStatements() - Method in class org.springframework.jdbc.support.nativejdbc.WebLogicNativeJdbcExtractor
Return true, as WebLogic returns wrapped Statements.
isNativeConnectionNecessaryForNativeStatements() - Method in class org.springframework.jdbc.support.nativejdbc.WebSphereNativeJdbcExtractor
Return true, as WebSphere returns wrapped Statements.
isNested() - Method in class org.springframework.beans.factory.xml.ParserContext
isNestedOrIndexedProperty(String) - Static method in class org.springframework.beans.PropertyAccessorUtils
Check whether the given property path indicates an indexed or nested property.
isNestedTransactionAllowed() - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Return whether nested transactions are allowed.
isNew() - Method in class org.springframework.mock.web.MockHttpSession
isNew() - Method in class org.springframework.mock.web.portlet.MockPortletSession
isNewSynchronization() - Method in class org.springframework.transaction.support.DefaultTransactionStatus
Return if a new transaction synchronization has been opened for this transaction.
isNewTransaction() - Method in class org.springframework.transaction.support.DefaultTransactionStatus
isNewTransaction() - Method in class org.springframework.transaction.support.SimpleTransactionStatus
isNewTransaction() - Method in interface org.springframework.transaction.TransactionStatus
Return whether the present transaction is new (else participating in an existing transaction, or potentially not running in an actual transaction in the first place).
isNonPublicAccessAllowed() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Return whether to allow access to non-public constructors and methods.
isNotIgnored(Method, String) - Method in class org.springframework.jmx.export.assembler.MethodExclusionMBeanInfoAssembler
Determine whether the given method is supposed to be included, that is, not configured as to be ignored.
isNotModified() - Method in class org.springframework.web.context.request.ServletWebRequest
isNull(Object, String) - Static method in class org.springframework.util.Assert
Assert that an object is null .
isNull(Object) - Static method in class org.springframework.util.Assert
Assert that an object is null .
isNullable() - Method in class org.springframework.jdbc.core.metadata.CallParameterMetaData
Get whether the parameter is nullable.
isNullable() - Method in class org.springframework.jdbc.core.metadata.TableParameterMetaData
Get whether the parameter/column is nullable.
isNullSafe() - Method in class org.springframework.expression.spel.ast.PropertyOrFieldReference
isNumeric(int) - Static method in class org.springframework.jdbc.support.JdbcUtils
Check whether the given SQL type is numeric.
Isolation - Enum in org.springframework.transaction.annotation
Enumeration that represents transaction isolation levels for use with the Transactional annotation, corresponding to the TransactionDefinition interface.
ISOLATION_DEFAULT - Static variable in interface org.springframework.transaction.TransactionDefinition
Use the default isolation level of the underlying datastore.
ISOLATION_READ_COMMITTED - Static variable in interface org.springframework.transaction.TransactionDefinition
Indicates that dirty reads are prevented; non-repeatable reads and phantom reads can occur.
ISOLATION_READ_UNCOMMITTED - Static variable in interface org.springframework.transaction.TransactionDefinition
Indicates that dirty reads, non-repeatable reads and phantom reads can occur.
ISOLATION_REPEATABLE_READ - Static variable in interface org.springframework.transaction.TransactionDefinition
Indicates that dirty reads and non-repeatable reads are prevented; phantom reads can occur.
ISOLATION_SERIALIZABLE - Static variable in interface org.springframework.transaction.TransactionDefinition
Indicates that dirty reads, non-repeatable reads and phantom reads are prevented.
IsolationLevelDataSourceAdapter - Class in org.springframework.jdbc.datasource
An adapter for a target DataSource, applying the current Spring transaction's isolation level (and potentially specified user credentials) to every getConnection call.
IsolationLevelDataSourceAdapter() - Constructor for class org.springframework.jdbc.datasource.IsolationLevelDataSourceAdapter
IsolationLevelDataSourceRouter - Class in org.springframework.jdbc.datasource.lookup
DataSource that routes to one of various target DataSources based on the current transaction isolation level.
IsolationLevelDataSourceRouter() - Constructor for class org.springframework.jdbc.datasource.lookup.IsolationLevelDataSourceRouter
isOneTimeTask() - Method in class org.springframework.scheduling.commonj.ScheduledTimerListener
Is this task only ever going to execute once?
isOneTimeTask() - Method in class org.springframework.scheduling.concurrent.ScheduledExecutorTask
Is this task only ever going to execute once?
isOneTimeTask() - Method in class org.springframework.scheduling.timer.ScheduledTimerTask
Deprecated. Is this task only ever going to execute once?
isOpaque() - Method in class org.springframework.aop.framework.ProxyConfig
Return whether proxies created by this configuration should be prevented from being cast to Advised.
isOpen() - Method in class org.springframework.core.io.AbstractResource
This implementation always returns false.
isOpen() - Method in class org.springframework.core.io.InputStreamResource
This implementation always returns true.
isOpen() - Method in interface org.springframework.core.io.Resource
Return whether this resource represents a handle with an open stream.
isOpen() - Method in class org.springframework.transaction.support.ResourceHolderSupport
Return whether there are still open references to this holder.
isOptimize() - Method in class org.springframework.aop.framework.ProxyConfig
Return whether proxies should perform aggressive optimizations.
isOptional() - Method in class org.springframework.beans.PropertyValue
isOutputStreamAccessAllowed() - Method in class org.springframework.mock.web.MockHttpServletResponse
Return whether MockHttpServletResponse.getOutputStream() access is allowed.
isOverloaded() - Method in class org.springframework.beans.factory.support.MethodOverride
Return whether the overridden method has to be considered as overloaded (that is, whether arg type matching has to happen).
isOverridable() - Method in interface org.springframework.core.type.MethodMetadata
Return whether the underlying method is overridable, i.e.
isOverridable() - Method in class org.springframework.core.type.StandardMethodMetadata
isOverrideIncludeSynonymsDefault() - Method in class org.springframework.jdbc.core.metadata.TableMetaDataContext
Are we overrding include synonyms default?
isPattern(String) - Method in class org.springframework.util.AntPathMatcher
isPattern(String) - Method in interface org.springframework.util.PathMatcher
Does the given path represent a pattern that can be matched by an implementation of this interface?
isPerInstance() - Method in interface org.springframework.aop.Advisor
Return whether this advice is associated with a particular instance (for example, creating a mixin) or shared with all instances of the advised class obtained from the same Spring bean factory.
isPerInstance() - Method in class org.springframework.aop.aspectj.AspectJPointcutAdvisor
isPerInstance() - Method in class org.springframework.aop.aspectj.DeclareParentsAdvisor
isPerInstance() - Method in class org.springframework.aop.support.AbstractPointcutAdvisor
isPerInstance() - Method in class org.springframework.aop.support.DefaultIntroductionAdvisor
isPerInstance() - Method in class org.springframework.aop.support.StaticMethodMatcherPointcutAdvisor
isPersistenceManagerTransactional(PersistenceManager, PersistenceManagerFactory) - Static method in class org.springframework.orm.jdo.PersistenceManagerFactoryUtils
Return whether the given JDO PersistenceManager is transactional, that is, bound to the current thread by Spring's transaction facilities.
isPerThisOrPerTarget() - Method in class org.springframework.aop.aspectj.annotation.AspectMetadata
Return whether the aspect is defined as "perthis" or "pertarget".
isPerTypeWithin() - Method in class org.springframework.aop.aspectj.annotation.AspectMetadata
Return whether the aspect is defined as "pertypewithin".
isPopulateProtectedVariables() - Method in class org.springframework.test.AbstractDependencyInjectionSpringContextTests
Deprecated. Return whether to populate protected variables of this test case.
isPortletModeAllowed(PortletMode) - Method in class org.springframework.mock.web.portlet.MockPortletRequest
isPreferFileSystemAccess() - Method in class org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
Return whether to prefer file system access for template loading.
isPreferFileSystemAccess() - Method in class org.springframework.ui.velocity.VelocityEngineFactory
Return whether to prefer file system access for template loading.
isPreFiltered() - Method in interface org.springframework.aop.framework.Advised
Return whether this proxy configuration is pre-filtered so that it only contains applicable advisors (matching this proxy's target class).
isPreFiltered() - Method in class org.springframework.aop.framework.AdvisedSupport
isPrepared() - Method in class org.springframework.jmx.access.MBeanClientInterceptor
Return whether this client interceptor has already been prepared, i.e.
isPrepared() - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Return whether this client interceptor has already been prepared, i.e.
isPrepared() - Method in class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
Return whether this client interceptor has already been prepared, i.e.
isPrepared() - Method in class org.springframework.util.MethodInvoker
Return whether this invoker has been prepared already, i.e.
isPresent(String) - Static method in class org.springframework.util.ClassUtils
Deprecated. as of Spring 2.5, in favor of ClassUtils.isPresent(String, ClassLoader)
isPresent(String, ClassLoader) - Static method in class org.springframework.util.ClassUtils
Determine whether the Class identified by the supplied name is present and can be loaded.
isPrimary() - Method in interface org.springframework.beans.factory.config.BeanDefinition
Return whether this bean is a primary autowire candidate.
isPrimary() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Return whether this bean is a primary autowire candidate.
isPrimary(String, Object) - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
Return whether the bean definition for the given bean name has been marked as a primary bean.
isPrimitive() - Method in class org.springframework.core.convert.TypeDescriptor
Is this type a primitive type?
isPrimitiveArray(Class<?>) - Static method in class org.springframework.util.ClassUtils
Check if the given class represents an array of primitives, i.e.
isPrimitiveOrWrapper(Class<?>) - Static method in class org.springframework.util.ClassUtils
Check if the given class represents a primitive (i.e.
isPrimitivesDefaultedForNullValue() - Method in class org.springframework.jdbc.core.BeanPropertyRowMapper
Return whether we're defaulting Java primitives in the case of mapping a null value from corresponding database fields.
isPrimitiveWrapper(Class<?>) - Static method in class org.springframework.util.ClassUtils
Check if the given class represents a primitive wrapper, i.e.
isPrimitiveWrapperArray(Class<?>) - Static method in class org.springframework.util.ClassUtils
Check if the given class represents an array of primitive wrappers, i.e.
isProcedureColumnMetaDataUsed() - Method in interface org.springframework.jdbc.core.metadata.CallMetaDataProvider
Are we using the meta data for the procedure columns?
isProcedureColumnMetaDataUsed() - Method in class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
isPrototype(String) - Method in interface org.springframework.beans.factory.BeanFactory
Is this bean a prototype? That is, will BeanFactory.getBean(java.lang.String) always return independent instances?
isPrototype() - Method in interface org.springframework.beans.factory.config.BeanDefinition
Return whether this a Prototype, with an independent instance returned for each call.
isPrototype() - Method in class org.springframework.beans.factory.config.BeanReferenceFactoryBean
isPrototype() - Method in interface org.springframework.beans.factory.SmartFactoryBean
Is the object managed by this factory a prototype? That is, will FactoryBean.getObject() always return an independent instance?
isPrototype() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Return whether this a Prototype, with an independent instance returned for each call.
isPrototype(String) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
isPrototype(String) - Method in class org.springframework.beans.factory.support.StaticListableBeanFactory
isPrototype(String) - Method in class org.springframework.context.support.AbstractApplicationContext
isPrototype(String) - Method in class org.springframework.jndi.support.SimpleJndiBeanFactory
isPrototypeBased() - Method in class org.springframework.aop.framework.autoproxy.target.AbstractBeanFactoryBasedTargetSourceCreator
Return whether this TargetSourceCreator is prototype-based.
isPrototypeBased() - Method in class org.springframework.aop.framework.autoproxy.target.LazyInitTargetSourceCreator
isPrototypeCurrentlyInCreation(String) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Return whether the specified prototype bean is currently in creation (within the current thread).
isProxyTargetClass() - Method in interface org.springframework.aop.framework.Advised
Are we proxying the full target class instead of specified interfaces?
isProxyTargetClass() - Method in class org.springframework.aop.framework.ProxyConfig
Return whether to proxy the target class directly as well as any interfaces.
isPublicScope() - Method in class org.springframework.mock.web.portlet.MockCacheControl
isPublicStaticFinal(Field) - Static method in class org.springframework.util.ReflectionUtils
Determine whether the given field is a "public static final" constant.
isPubSubDomain() - Method in class org.springframework.jms.connection.JmsTransactionManager102
Deprecated. Return whether the Publish/Subscribe domain (Topics) is used.
isPubSubDomain() - Method in class org.springframework.jms.connection.SingleConnectionFactory102
Deprecated. Return whether the Publish/Subscribe domain (Topics) is used.
isPubSubDomain() - Method in class org.springframework.jms.listener.endpoint.JmsActivationSpecConfig
isPubSubDomain() - Method in class org.springframework.jms.support.destination.JmsDestinationAccessor
Return whether the Publish/Subscribe domain (Topics) is used.
isPubSubNoLocal() - Method in class org.springframework.jms.core.JmsTemplate
Return whether to inhibit the delivery of messages published by its own connection.
isPubSubNoLocal() - Method in class org.springframework.jms.listener.AbstractPollingMessageListenerContainer
Return whether to inhibit the delivery of messages published by its own connection.
isPubSubNoLocal() - Method in class org.springframework.jms.listener.SimpleMessageListenerContainer
Return whether to inhibit the delivery of messages published by its own connection.
isQualifier(Class<? extends Annotation>) - Method in class org.springframework.beans.factory.annotation.QualifierAnnotationAutowireCandidateResolver
Checks whether the given annotation type is a recognized qualifier type.
isReadable() - Method in class org.springframework.core.io.AbstractResource
This implementation always returns true.
isReadable() - Method in class org.springframework.core.io.DescriptiveResource
isReadable() - Method in class org.springframework.core.io.FileSystemResource
This implementation checks whether the underlying file is marked as readable (and corresponds to an actual file with content, not to a directory).
isReadable() - Method in interface org.springframework.core.io.Resource
Return whether the contents of this resource can be read, e.g.
isReadable() - Method in class org.springframework.core.io.VfsResource
isReadableProperty(String) - Method in class org.springframework.beans.BeanWrapperImpl
isReadableProperty(String) - Method in class org.springframework.beans.DirectFieldAccessor
isReadableProperty(String) - Method in interface org.springframework.beans.PropertyAccessor
Determine whether the specified property is readable.
isReadOnly(ELContext, Object, Object) - Method in class org.springframework.beans.factory.access.el.SpringBeanELResolver
isReadOnly(String) - Method in class org.springframework.mock.web.portlet.MockPortletPreferences
isReadOnly() - Method in class org.springframework.transaction.support.DefaultTransactionDefinition
isReadOnly() - Method in class org.springframework.transaction.support.DefaultTransactionStatus
Return if this transaction is defined as read-only transaction.
isReadOnly() - Method in class org.springframework.transaction.support.DelegatingTransactionDefinition
isReadOnly() - Method in interface org.springframework.transaction.TransactionDefinition
Return whether to optimize as a read-only transaction.
isReadOnly(ELContext, Object, Object) - Method in class org.springframework.web.jsf.el.WebApplicationContextFacesELResolver
isReadonly() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
Is the current HTML tag readonly?
isReconnectOnException() - Method in class org.springframework.jms.connection.SingleConnectionFactory
Return whether the single Connection should be renewed when a JMSException is reported by the underlying Connection.
isRedirectAction() - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Return if ActionResponse.sendRedirect(java.lang.String) is expected to be called in the action phase.
isRedirectContextRelative() - Method in class org.springframework.web.servlet.view.UrlBasedViewResolver
Return whether to interpret a given redirect URL that starts with a slash ("/") as relative to the current ServletContext, i.e.
isRedirectHttp10Compatible() - Method in class org.springframework.web.servlet.view.UrlBasedViewResolver
Return whether redirects should stay compatible with HTTP 1.0 clients.
isRefCursorSupported() - Method in interface org.springframework.jdbc.core.metadata.CallMetaDataProvider
Does this database support returning resultsets as ref cursors to be retrieved with CallableStatement.getObject(int) for the specified column.
isRefCursorSupported() - Method in class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
isRefCursorSupported() - Method in class org.springframework.jdbc.core.metadata.OracleCallMetaDataProvider
isRefCursorSupported() - Method in class org.springframework.jdbc.core.metadata.PostgresCallMetaDataProvider
isReference() - Method in class org.springframework.web.portlet.ModelAndView
Return whether we use a view reference, i.e.
isReference() - Method in class org.springframework.web.servlet.ModelAndView
Return whether we use a view reference, i.e.
isRenderWhenMinimized() - Method in class org.springframework.web.portlet.mvc.AbstractController
Return whether controller will render when portlet is minimized.
isRequestActive() - Method in class org.springframework.web.context.request.AbstractRequestAttributes
Determine whether the original request is still active.
isRequestedSessionIdFromCookie() - Method in class org.springframework.mock.web.MockHttpServletRequest
isRequestedSessionIdFromURL() - Method in class org.springframework.mock.web.MockHttpServletRequest
isRequestedSessionIdFromUrl() - Method in class org.springframework.mock.web.MockHttpServletRequest
isRequestedSessionIdValid() - Method in class org.springframework.mock.web.MockHttpServletRequest
isRequestedSessionIdValid() - Method in class org.springframework.mock.web.portlet.MockPortletRequest
isRequired() - Method in class org.springframework.beans.factory.config.DependencyDescriptor
Return whether this dependency is required.
isRequiredProperty(PropertyDescriptor) - Method in class org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor
Is the supplied property required to have a value (that is, to be dependency-injected)?
isRequireSession() - Method in class org.springframework.web.portlet.handler.PortletContentGenerator
Return whether a session is required to handle requests.
isRequireSession() - Method in class org.springframework.web.servlet.support.WebContentGenerator
Return whether a session is required to handle requests.
isResourceRef() - Method in class org.springframework.jndi.JndiLocatorSupport
Return whether the lookup occurs in a J2EE container.
isResultSetSupported() - Method in class org.springframework.jdbc.core.ResultSetSupportingSqlParameter
Does this parameter support a ResultSet, i.e.
isResultsMapCaseInsensitive() - Method in class org.springframework.jdbc.core.JdbcTemplate
Return whether execution of a CallableStatement will return the results in a Map that uses case insensitive names for the parameters.
isResultsParameter() - Method in class org.springframework.jdbc.core.SqlParameter
Return whether this parameter is an implicit return parameter used during the results preocessing of the CallableStatement.getMoreResults/getUpdateCount.
isResultsParameter() - Method in class org.springframework.jdbc.core.SqlReturnResultSet
Return whether this parameter is an implicit return parameter used during the results preocessing of the CallableStatement.getMoreResults/getUpdateCount.
isResultsParameter() - Method in class org.springframework.jdbc.core.SqlReturnUpdateCount
Return whether this parameter is an implicit return parameter used during the results preocessing of the CallableStatement.getMoreResults/getUpdateCount.
isReturnGeneratedKeys() - Method in class org.springframework.jdbc.object.RdbmsOperation
Return whether statements should be capable of returning auto-generated keys.
isReturnResultSetSupported() - Method in interface org.springframework.jdbc.core.metadata.CallMetaDataProvider
Does this database support returning resultsets that should be retrieved with the JDBC call Statement.getResultSet()
isReturnResultSetSupported() - Method in class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
isReturnResultSetSupported() - Method in class org.springframework.jdbc.core.metadata.OracleCallMetaDataProvider
isReturnResultSetSupported() - Method in class org.springframework.jdbc.core.metadata.PostgresCallMetaDataProvider
isReturnTypeSupported() - Method in class org.springframework.jdbc.core.SqlOutParameter
Return whether this parameter holds a custom return type.
isReturnValueRequired() - Method in class org.springframework.jdbc.core.metadata.CallMetaDataContext
Check whether a return value is required.
isReturnValueRequired() - Method in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Does the call require a return value?
isRollback() - Method in class org.springframework.test.AbstractTransactionalSpringContextTests
Deprecated. Determines whether or not to rollback transactions for the current test.
isRollback() - Method in class org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests
Deprecated. Determine whether or not to rollback transactions for the current test by taking into consideration the default rollback flag and a possible method-level override via the @Rollback annotation.
isRollback(TestContext) - Method in class org.springframework.test.context.transaction.TransactionalTestExecutionListener
Determine whether or not to rollback transactions for the supplied test context by taking into consideration the default rollback flag and a possible method-level override via the Rollback annotation.
isRollbackOnCommitFailure() - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Return whether doRollback should be performed on failure of the doCommit call.
isRollbackOnly(Object) - Method in class org.springframework.jca.cci.connection.CciLocalTransactionManager
isRollbackOnly() - Method in class org.springframework.transaction.jta.JtaTransactionObject
This implementation checks the UserTransaction's rollback-only flag.
isRollbackOnly() - Method in class org.springframework.transaction.support.AbstractTransactionStatus
Determine the rollback-only flag via checking both the local rollback-only flag of this TransactionStatus and the global rollback-only flag of the underlying transaction, if any.
isRollbackOnly() - Method in class org.springframework.transaction.support.ResourceHolderSupport
Return whether the resource transaction is marked as rollback-only.
isRollbackOnly() - Method in interface org.springframework.transaction.support.SmartTransactionObject
Return whether the transaction is internally marked as rollback-only.
isRollbackOnly() - Method in interface org.springframework.transaction.TransactionStatus
Return whether the transaction has been marked as rollback-only (either by the application or by the transaction infrastructure).
isRunning() - Method in interface org.springframework.context.Lifecycle
Check whether this component is currently running.
isRunning() - Method in class org.springframework.context.support.AbstractApplicationContext
isRunning() - Method in class org.springframework.context.support.DefaultLifecycleProcessor
isRunning() - Method in class org.springframework.jca.endpoint.GenericMessageEndpointManager
Return whether the configured message endpoint is currently active.
isRunning() - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Determine whether this container is currently running, that is, whether it has been started and not stopped yet.
isRunning() - Method in class org.springframework.scheduling.commonj.TimerManagerAccessor
Considers the underlying TimerManager as running if it is neither suspending nor stopping.
isRunning() - Method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
isRunning() - Method in class org.springframework.util.StopWatch
Return whether the stop watch is currently running.
isRuntime() - Method in class org.springframework.aop.aspectj.AspectJExpressionPointcut
isRuntime() - Method in interface org.springframework.aop.MethodMatcher
Is this MethodMatcher dynamic, that is, must a final call be made on the MethodMatcher.matches(java.lang.reflect.Method, Class, Object[]) method at runtime even if the 2-arg matches method returns true?
isRuntime() - Method in class org.springframework.aop.support.ControlFlowPointcut
isRuntime() - Method in class org.springframework.aop.support.DynamicMethodMatcher
isRuntime() - Method in class org.springframework.aop.support.StaticMethodMatcher
isSameConnectionForEntireSession(Session) - Method in class org.springframework.orm.hibernate3.HibernateTransactionManager
Return whether the given Hibernate Session will always hold the same JDBC Connection.
isSavepointAllowed() - Method in class org.springframework.jdbc.datasource.JdbcTransactionObjectSupport
isSecure() - Method in class org.springframework.mock.web.MockHttpServletRequest
isSecure() - Method in class org.springframework.mock.web.portlet.MockBaseURL
isSecure() - Method in class org.springframework.mock.web.portlet.MockPortletRequest
isSecure() - Method in class org.springframework.web.context.request.FacesWebRequest
isSecure() - Method in class org.springframework.web.context.request.ServletWebRequest
isSecure() - Method in interface org.springframework.web.context.request.WebRequest
Return whether this request has been sent over a secure transport mechanism (such as SSL).
isSecure() - Method in class org.springframework.web.portlet.context.PortletWebRequest
isSessionAttribute(String, Class) - Method in class org.springframework.web.bind.annotation.support.HandlerMethodResolver
isSessionForm() - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Return if session form mode is activated.
isSessionForm() - Method in class org.springframework.web.servlet.mvc.AbstractFormController
Deprecated. Return true if session form mode is activated.
isSessionLocallyTransacted(Session) - Method in class org.springframework.jms.core.JmsTemplate
Check whether the given Session is locally transacted, that is, whether its transaction is managed by this listener container's Session handling and not by an external transaction coordinator.
isSessionLocallyTransacted(Session) - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Check whether the given Session is locally transacted, that is, whether its transaction is managed by this listener container's Session handling and not by an external transaction coordinator.
isSessionLocallyTransacted(Session) - Method in class org.springframework.jms.listener.AbstractPollingMessageListenerContainer
This implementation checks whether the Session is externally synchronized.
isSessionTransacted() - Method in class org.springframework.jms.support.JmsAccessor
Return whether the JMS sessions used by this accessor are supposed to be transacted.
isSessionTransactional(Session, ConnectionFactory) - Static method in class org.springframework.jms.connection.ConnectionFactoryUtils
Determine whether the given JMS Session is transactional, that is, bound to the current thread by Spring's transaction facilities.
isSessionTransactional(Session, SessionFactory) - Static method in class org.springframework.orm.hibernate3.SessionFactoryUtils
Return whether the given Hibernate Session is transactional, that is, bound to the current thread by Spring's transaction facilities.
isSharedEditor(PropertyEditor) - Method in class org.springframework.beans.PropertyEditorRegistrySupport
Check whether the given editor instance is a shared editor, that is, whether the given editor instance might be used concurrently.
isShowPassword() - Method in class org.springframework.web.servlet.tags.form.PasswordInputTag
Is the password value to be rendered?
isShowSql() - Method in class org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter
Return whether to show SQL in the log (or in the console).
isShutdown() - Method in class org.springframework.core.task.support.ExecutorServiceAdapter
isSigned(int) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSetMetaData
isSigned(int) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSetMetaData
Indicates whether the designated column contains a signed number.
isSimpleProperty(Class<?>) - Static method in class org.springframework.beans.BeanUtils
Check if the given type represents a "simple" property: a primitive, a String or other CharSequence, a Number, a Date, a URI, a URL, a Locale, a Class, or a corresponding array.
isSimpleValueType(Class<?>) - Static method in class org.springframework.beans.BeanUtils
Check if the given type represents a "simple" value type: a primitive, a String or other CharSequence, a Number, a Date, a URI, a URL, a Locale or a Class.
isSingleSession() - Method in class org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
Return whether to use a single session for each request.
isSingleSession() - Method in class org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor
Return whether to use a single session for each request.
isSingleton() - Method in class org.springframework.aop.config.MethodLocatingFactoryBean
isSingleton() - Method in class org.springframework.aop.framework.AbstractSingletonProxyFactoryBean
isSingleton() - Method in class org.springframework.aop.framework.ProxyFactoryBean
isSingleton() - Method in class org.springframework.aop.scope.ScopedProxyFactoryBean
isSingleton(String) - Method in interface org.springframework.beans.factory.BeanFactory
Is this bean a shared singleton? That is, will BeanFactory.getBean(java.lang.String) always return the same instance?
isSingleton() - Method in class org.springframework.beans.factory.config.AbstractFactoryBean
isSingleton() - Method in interface org.springframework.beans.factory.config.BeanDefinition
Return whether this a Singleton, with a single, shared instance returned on all calls.
isSingleton() - Method in class org.springframework.beans.factory.config.BeanReferenceFactoryBean
isSingleton() - Method in class org.springframework.beans.factory.config.CommonsLogFactoryBean
isSingleton() - Method in class org.springframework.beans.factory.config.FieldRetrievingFactoryBean
isSingleton() - Method in class org.springframework.beans.factory.config.MethodInvokingFactoryBean
isSingleton() - Method in class org.springframework.beans.factory.config.PropertiesFactoryBean
isSingleton() - Method in class org.springframework.beans.factory.config.PropertyPathFactoryBean
While this FactoryBean will often be used for singleton targets, the invoked getters for the property path might return a new object for each call, so we have to assume that we're not returning the same object for each PropertyPathFactoryBean.getObject() call.
isSingleton() - Method in class org.springframework.beans.factory.config.ServiceLocatorFactoryBean
isSingleton() - Method in interface org.springframework.beans.factory.FactoryBean
Is the object managed by this factory a singleton? That is, will FactoryBean.getObject() always return the same object (a reference that can be cached)?
isSingleton() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Return whether this a Singleton, with a single shared instance returned from all calls.
isSingleton(String) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
isSingleton(String) - Method in class org.springframework.beans.factory.support.StaticListableBeanFactory
isSingleton() - Method in class org.springframework.cache.ehcache.EhCacheFactoryBean
isSingleton() - Method in class org.springframework.cache.ehcache.EhCacheManagerFactoryBean
isSingleton(String) - Method in class org.springframework.context.support.AbstractApplicationContext
isSingleton() - Method in class org.springframework.context.support.ConversionServiceFactoryBean
isSingleton() - Method in class org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean
isSingleton() - Method in class org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean
isSingleton() - Method in class org.springframework.format.support.FormattingConversionServiceFactoryBean
isSingleton() - Method in class org.springframework.jca.support.LocalConnectionFactoryBean
isSingleton() - Method in class org.springframework.jca.support.ResourceAdapterFactoryBean
isSingleton() - Method in class org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactoryBean
isSingleton() - Method in class org.springframework.jms.remoting.JmsInvokerProxyFactoryBean
isSingleton() - Method in class org.springframework.jmx.access.MBeanProxyFactoryBean
isSingleton() - Method in class org.springframework.jmx.support.ConnectorServerFactoryBean
isSingleton() - Method in class org.springframework.jmx.support.MBeanServerConnectionFactoryBean
isSingleton() - Method in class org.springframework.jmx.support.MBeanServerFactoryBean
isSingleton() - Method in class org.springframework.jmx.support.WebSphereMBeanServerFactoryBean
isSingleton() - Method in class org.springframework.jndi.JndiObjectFactoryBean
isSingleton(String) - Method in class org.springframework.jndi.support.SimpleJndiBeanFactory
isSingleton() - Method in class org.springframework.orm.hibernate3.AbstractSessionFactoryBean
isSingleton() - Method in class org.springframework.orm.hibernate3.FilterDefinitionFactoryBean
isSingleton() - Method in class org.springframework.orm.ibatis.SqlMapClientFactoryBean
isSingleton() - Method in class org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean
isSingleton() - Method in class org.springframework.orm.jdo.support.SpringPersistenceManagerProxyBean
isSingleton() - Method in class org.springframework.orm.jdo.support.StandardPersistenceManagerProxyBean
isSingleton() - Method in class org.springframework.orm.jdo.TransactionAwarePersistenceManagerFactoryProxy
isSingleton() - Method in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
isSingleton() - Method in class org.springframework.orm.jpa.support.SharedEntityManagerBean
isSingleton() - Method in class org.springframework.oxm.xmlbeans.XmlOptionsFactoryBean
isSingleton() - Method in class org.springframework.remoting.caucho.BurlapProxyFactoryBean
isSingleton() - Method in class org.springframework.remoting.caucho.HessianProxyFactoryBean
isSingleton() - Method in class org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean
isSingleton() - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortProxyFactoryBean
Deprecated.
isSingleton() - Method in class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactoryBean
Deprecated.
isSingleton() - Method in class org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean
isSingleton() - Method in class org.springframework.remoting.jaxws.LocalJaxWsServiceFactoryBean
isSingleton() - Method in class org.springframework.remoting.rmi.JndiRmiProxyFactoryBean
isSingleton() - Method in class org.springframework.remoting.rmi.RmiProxyFactoryBean
isSingleton() - Method in class org.springframework.remoting.rmi.RmiRegistryFactoryBean
isSingleton() - Method in class org.springframework.remoting.support.SimpleHttpServerFactoryBean
isSingleton() - Method in class org.springframework.scheduling.commonj.TimerManagerFactoryBean
isSingleton() - Method in class org.springframework.scheduling.concurrent.ScheduledExecutorFactoryBean
isSingleton() - Method in class org.springframework.scheduling.concurrent.ThreadPoolExecutorFactoryBean
isSingleton() - Method in class org.springframework.scheduling.config.TaskExecutorFactoryBean
isSingleton() - Method in class org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean
isSingleton() - Method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
isSingleton() - Method in class org.springframework.scheduling.timer.MethodInvokingTimerTaskFactoryBean
Deprecated.
isSingleton() - Method in class org.springframework.scheduling.timer.TimerFactoryBean
Deprecated.
isSingleton() - Method in class org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean
isSingleton() - Method in class org.springframework.ui.velocity.VelocityEngineFactoryBean
isSingleton() - Method in class org.springframework.web.context.support.ServletContextAttributeFactoryBean
isSingleton() - Method in class org.springframework.web.context.support.ServletContextFactoryBean
Deprecated.
isSingleton() - Method in class org.springframework.web.context.support.ServletContextParameterFactoryBean
isSingletonCurrentlyInCreation(String) - Method in class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
Return whether the specified singleton bean is currently in creation (within the entire factory).
isSkipResultsProcessing() - Method in class org.springframework.jdbc.core.JdbcTemplate
Return whether results processing should be skipped.
isSkipUndeclaredResults() - Method in class org.springframework.jdbc.core.JdbcTemplate
Return whether undeclared results should be skipped.
isSourceModified(Resource) - Method in class org.springframework.ui.velocity.SpringResourceLoader
isSqlReadyForUse() - Method in class org.springframework.jdbc.object.SqlCall
Return whether the SQL can be used as is.
isStatic() - Method in class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
isStatic() - Method in class org.springframework.aop.target.AbstractLazyCreationTargetSource
isStatic() - Method in class org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource
Not static.
isStatic() - Method in class org.springframework.aop.target.EmptyTargetSource
Always returns true.
isStatic() - Method in class org.springframework.aop.target.HotSwappableTargetSource
isStatic() - Method in class org.springframework.aop.target.SingletonTargetSource
isStatic() - Method in interface org.springframework.aop.TargetSource
Will all calls to TargetSource.getTarget() return the same object?
isStatic() - Method in interface org.springframework.core.type.MethodMetadata
Return whether the underlying method is declared as 'static'.
isStatic() - Method in class org.springframework.core.type.StandardMethodMetadata
isStatic() - Method in class org.springframework.jndi.JndiObjectTargetSource
isStaxResult(Result) - Static method in class org.springframework.util.xml.StaxUtils
Indicate whether the given Result is a StAX Result.
isStaxSource(Source) - Static method in class org.springframework.util.xml.StaxUtils
Indicate whether the given Source is a StAX Source.
isStereotypeWithNameValue(String, Set<String>, Map<String, Object>) - Method in class org.springframework.context.annotation.AnnotationBeanNameGenerator
Check whether the given annotation is a stereotype that is allowed to suggest a component name through its annotation value().
isStoresLowerCaseIdentifiers() - Method in class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
Does the database use lower case for identifiers
isStoresLowerCaseIdentifiers() - Method in class org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
Get whether identifiers use lower case
isStoresUpperCaseIdentifiers() - Method in class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
Does the database use upper case for identifiers
isStoresUpperCaseIdentifiers() - Method in class org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
Get whether identifiers use upper case
isSubscriptionDurable() - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Return whether to make the subscription durable.
isSubscriptionDurable() - Method in class org.springframework.jms.listener.endpoint.JmsActivationSpecConfig
isSupportsCatalogsInProcedureCalls() - Method in interface org.springframework.jdbc.core.metadata.CallMetaDataProvider
Does the database support the use of catalog name in procedure calls
isSupportsCatalogsInProcedureCalls() - Method in class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
Does the database support the use of catalog name in procedure calls
isSupportsSchemasInProcedureCalls() - Method in interface org.springframework.jdbc.core.metadata.CallMetaDataProvider
Does the database support the use of schema name in procedure calls
isSupportsSchemasInProcedureCalls() - Method in class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
Does the database support the use of schema name in procedure calls
isSuppressClose() - Method in class org.springframework.jdbc.datasource.SingleConnectionDataSource
Return whether the returned Connection will be a close-suppressing proxy or the physical Connection.
isSuppressNamespaces() - Method in class org.springframework.oxm.castor.CastorMarshaller
Returns whether this marshaller should output namespaces.
isSuppressXsiType() - Method in class org.springframework.oxm.castor.CastorMarshaller
Sets whether this marshaller should output the xsi:type attribute.
isSynchedLocalTransactionAllowed() - Method in interface org.springframework.jms.connection.ConnectionFactoryUtils.ResourceFactory
Return whether to allow for a local JMS transaction that is synchronized with a Spring-managed transaction (where the main transaction might be a JDBC-based one for a specific DataSource, for example), with the JMS transaction committing right after the main transaction.
isSynchedLocalTransactionAllowed() - Method in class org.springframework.jms.connection.TransactionAwareConnectionFactoryProxy
Return whether to allow for a local JMS transaction that is synchronized with a Spring-managed transaction.
isSynchronizationActive() - Static method in class org.springframework.transaction.support.TransactionSynchronizationManager
Return if transaction synchronization is active for the current thread.
isSynchronizedWithTransaction() - Method in class org.springframework.transaction.support.ResourceHolderSupport
Return whether the resource is synchronized with a transaction.
isSynchronizeOnSession() - Method in class org.springframework.web.portlet.mvc.AbstractController
Return whether controller execution should be synchronized on the session.
isSynchronizeOnSession() - Method in class org.springframework.web.servlet.mvc.AbstractController
Return whether controller execution should be synchronized on the session.
isSynthetic() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Return whether this bean definition is 'synthetic', that is, not defined by the application itself.
isTableColumnMetaDataUsed() - Method in class org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
isTableColumnMetaDataUsed() - Method in interface org.springframework.jdbc.core.metadata.TableMetaDataProvider
Are we using the meta data for the table columns?
isTargetFilterLifecycle() - Method in class org.springframework.web.filter.DelegatingFilterProxy
Return whether to invoke the Filter.init and Filter.destroy lifecycle methods on the target bean.
isTemplate() - Method in class org.springframework.expression.common.TemplateParserContext
isTemplate() - Method in interface org.springframework.expression.ParserContext
Whether or not the expression being parsed is a template.
isTerminated() - Method in class org.springframework.core.task.support.ExecutorServiceAdapter
isTestEnabledInThisEnvironment(Class<?>) - Static method in class org.springframework.test.annotation.ProfileValueUtils
Determine if the supplied testClass is enabled in the current environment, as specified by the @IfProfileValue annotation at the class level.
isTestEnabledInThisEnvironment(Method, Class<?>) - Static method in class org.springframework.test.annotation.ProfileValueUtils
Determine if the supplied testMethod is enabled in the current environment, as specified by the @IfProfileValue annotation, which may be declared on the test method itself or at the class level.
isTestEnabledInThisEnvironment(ProfileValueSource, Method, Class<?>) - Static method in class org.springframework.test.annotation.ProfileValueUtils
Determine if the supplied testMethod is enabled in the current environment, as specified by the @IfProfileValue annotation, which may be declared on the test method itself or at the class level.
isTestMethodIgnored(FrameworkMethod) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
Returns true if @Ignore is present for the supplied test method or if the test method is disabled via @IfProfileValue.
isThrottleActive() - Method in class org.springframework.core.task.SimpleAsyncTaskExecutor
Return whether this throttle is currently active.
isThrottleActive() - Method in class org.springframework.util.ConcurrencyThrottleSupport
Return whether this throttle is currently active.
isToggleAscendingOnProperty() - Method in class org.springframework.beans.support.MutableSortDefinition
Return whether to toggle the ascending flag if the same property gets set again (that is, MutableSortDefinition.setProperty(java.lang.String) gets called with already set property name again).
isToParent() - Method in class org.springframework.beans.factory.config.RuntimeBeanReference
Return whether this is an explicit reference to a bean in the parent factory.
isToStringMethod(Method) - Static method in class org.springframework.aop.support.AopUtils
Determine whether the given method is a "toString" method.
isToStringMethod(Method) - Static method in class org.springframework.util.ReflectionUtils
Determine whether the given method is a "toString" method.
isTransactionActive() - Method in class org.springframework.jdbc.datasource.ConnectionHolder
Return whether this holder represents an active, JDBC-managed transaction.
isTransactionActive() - Method in class org.springframework.orm.jdo.PersistenceManagerHolder
isTransactionActive() - Method in class org.springframework.orm.jpa.EntityManagerHolder
isTransactionInProgress(JDBCContext, TransactionFactory.Context, Transaction) - Method in class org.springframework.orm.hibernate3.SpringTransactionFactory
isTransactionManagerRequired() - Method in class org.springframework.orm.hibernate3.SpringTransactionFactory
isTransactionSavepointManager() - Method in class org.springframework.transaction.support.DefaultTransactionStatus
Return whether the underlying transaction implements the SavepointManager interface.
isTrue(boolean, String) - Static method in class org.springframework.util.Assert
Assert a boolean expression, throwing IllegalArgumentException if the test result is false.
isTrue(boolean) - Static method in class org.springframework.util.Assert
Assert a boolean expression, throwing IllegalArgumentException if the test result is false.
isTypeMatch(String, Class) - Method in interface org.springframework.beans.factory.BeanFactory
Check whether the bean with the given name matches the specified type.
isTypeMatch(String, Class) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
isTypeMatch(String, Class) - Method in class org.springframework.beans.factory.support.StaticListableBeanFactory
isTypeMatch(String, Class) - Method in class org.springframework.context.support.AbstractApplicationContext
isTypeMatch(String, Class) - Method in class org.springframework.jndi.support.SimpleJndiBeanFactory
isUpdatableResults() - Method in class org.springframework.jdbc.object.RdbmsOperation
Return whether statements will return updatable ResultSets.
isUploadTempDirSpecified() - Method in class org.springframework.web.multipart.commons.CommonsFileUploadSupport
isUrl(String) - Static method in class org.springframework.core.io.support.ResourcePatternUtils
Return whether the given resource location is a URL: either a special "classpath" or "classpath*" pseudo URL or a standard URL.
isUrl(String) - Static method in class org.springframework.util.ResourceUtils
Return whether the given resource location is a URL: either a special "classpath" pseudo URL or a standard URL.
isUrlRequired() - Method in class org.springframework.web.servlet.view.AbstractUrlBasedView
Return whether the 'url' property is required.
isUrlRequired() - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
JasperReports views do not strictly required a 'url' value.
isUseCacheControlHeader() - Method in class org.springframework.web.servlet.support.WebContentGenerator
Return whether the HTTP 1.1 cache-control header is used.
isUseCacheControlNoStore() - Method in class org.springframework.web.servlet.support.WebContentGenerator
Return whether the HTTP 1.1 cache-control header value "no-store" is used.
isUseCodeAsDefaultMessage() - Method in class org.springframework.context.support.AbstractMessageSource
Return whether to use the message code as default message instead of throwing a NoSuchMessageException.
isUseExpiresHeader() - Method in class org.springframework.web.servlet.support.WebContentGenerator
Return whether the HTTP 1.0 expires header is used.
isUsePrefix() - Method in class org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator
Return whether to exclude advisors with a certain prefix in the bean name.
isUserInRole(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
isUserInRole(String) - Method in class org.springframework.mock.web.portlet.MockPortletRequest
isUserInRole(String) - Method in class org.springframework.web.context.request.FacesWebRequest
isUserInRole(String) - Method in class org.springframework.web.context.request.ServletWebRequest
isUserInRole(String) - Method in interface org.springframework.web.context.request.WebRequest
Determine whether the user is in the given role for this request.
isUserInRole(String) - Method in class org.springframework.web.portlet.context.PortletWebRequest
isUseSoapAction() - Method in class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
Return the "soapaction.use" flag to specify on the stub.
isUseSqlStateForTranslation() - Method in class org.springframework.jdbc.support.SQLErrorCodes
isUseStrictCasing() - Method in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Return whether strict casing for attributes is enabled.
isUseTransactionAwareDataSource() - Method in class org.springframework.orm.hibernate3.AbstractSessionFactoryBean
Return whether to use a transaction-aware DataSource for the SessionFactory.
isValidateAddresses() - Method in class org.springframework.mail.javamail.MimeMessageHelper
Return whether this helper will validate all addresses passed to it.
isValidateExistingTransaction() - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Return whether existing transactions should be validated before participating in them.
isValidateOnBinding() - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Return if the Validator should get applied when binding.
isValidateOnBinding() - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Return if the Validator should get applied when binding.
isValidating() - Method in class org.springframework.oxm.xmlbeans.XmlBeansMarshaller
Return whether this marshaller should validate in- and outgoing documents.
isVisible(Class<?>, ClassLoader) - Static method in class org.springframework.util.ClassUtils
Check whether the given class is visible in the given ClassLoader.
isVoid() - Method in interface org.springframework.transaction.support.ResourceHolder
Determine whether this holder is considere as 'void', i.e.
isVoid() - Method in class org.springframework.transaction.support.ResourceHolderSupport
isWildcardSubtype() - Method in class org.springframework.http.MediaType
Indicate whether the subtype is the wildcard character * or not.
isWildcardType() - Method in class org.springframework.http.MediaType
Indicate whether the type is the wildcard character * or not.
isWindowStateAllowed(WindowState) - Method in class org.springframework.mock.web.portlet.MockPortletRequest
isWrapperFor(Class<?>) - Method in class org.springframework.jdbc.datasource.AbstractDataSource
isWrapperFor(Class<?>) - Method in class org.springframework.jdbc.datasource.DelegatingDataSource
isWritable(EvaluationContext) - Method in class org.springframework.expression.common.CompositeStringExpression
isWritable(EvaluationContext, Object) - Method in class org.springframework.expression.common.CompositeStringExpression
isWritable(Object) - Method in class org.springframework.expression.common.CompositeStringExpression
isWritable(EvaluationContext) - Method in class org.springframework.expression.common.LiteralExpression
isWritable(EvaluationContext, Object) - Method in class org.springframework.expression.common.LiteralExpression
isWritable(Object) - Method in class org.springframework.expression.common.LiteralExpression
isWritable(EvaluationContext) - Method in interface org.springframework.expression.Expression
Determine if an expression can be written to, i.e.
isWritable(EvaluationContext, Object) - Method in interface org.springframework.expression.Expression
Determine if an expression can be written to, i.e.
isWritable(Object) - Method in interface org.springframework.expression.Expression
Determine if an expression can be written to, i.e.
isWritable(ExpressionState) - Method in class org.springframework.expression.spel.ast.CompoundExpression
isWritable(ExpressionState) - Method in class org.springframework.expression.spel.ast.Indexer
isWritable(ExpressionState) - Method in class org.springframework.expression.spel.ast.PropertyOrFieldReference
isWritable(ExpressionState) - Method in class org.springframework.expression.spel.ast.SpelNodeImpl
isWritable(ExpressionState) - Method in class org.springframework.expression.spel.ast.VariableReference
isWritable(ExpressionState) - Method in interface org.springframework.expression.spel.SpelNode
Determine if this expression node will support a setValue() call.
isWritable(EvaluationContext) - Method in class org.springframework.expression.spel.standard.SpelExpression
isWritable(Object) - Method in class org.springframework.expression.spel.standard.SpelExpression
isWritable(EvaluationContext, Object) - Method in class org.springframework.expression.spel.standard.SpelExpression
isWritableProperty(String) - Method in class org.springframework.beans.BeanWrapperImpl
isWritableProperty(String) - Method in class org.springframework.beans.DirectFieldAccessor
isWritableProperty(String) - Method in interface org.springframework.beans.PropertyAccessor
Determine whether the specified property is writable.
isWritableProperty(String, ExpressionState) - Method in class org.springframework.expression.spel.ast.PropertyOrFieldReference
isWriterAccessAllowed() - Method in class org.springframework.mock.web.MockHttpServletResponse
Return whether MockHttpServletResponse.getOutputStream() access is allowed.
isXopPackage() - Method in interface org.springframework.oxm.mime.MimeContainer
Indicate whether this container is a XOP package.
iterate(String) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Execute a query for persistent instances.
iterate(String, Object) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Execute a query for persistent instances, binding one value to a "?" parameter in the query string.
iterate(String, Object...) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Execute a query for persistent instances, binding a number of values to "?" parameters in the query string.
iterate(String) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
iterate(String, Object) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
iterate(String, Object...) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
iterator() - Method in class org.springframework.util.AutoPopulatingList
Overview Package Class Tree Deprecated Index Help
A B C D E F G H I J K L M N O P Q R S T U V W X


J-Index

PREV LETTER NEXT LETTER FRAMES NO FRAMES
A B C D E F G H I J K L M N O P Q R S T U V W X

J

JamonPerformanceMonitorInterceptor - Class in org.springframework.aop.interceptor
Performance monitor interceptor that uses JAMon library to perform the performance measurement on the intercepted method and output the stats.
JamonPerformanceMonitorInterceptor() - Constructor for class org.springframework.aop.interceptor.JamonPerformanceMonitorInterceptor
Create a new JamonPerformanceMonitorInterceptor with a static logger.
JamonPerformanceMonitorInterceptor(boolean) - Constructor for class org.springframework.aop.interceptor.JamonPerformanceMonitorInterceptor
Create a new JamonPerformanceMonitorInterceptor with a dynamic or static logger, according to the given flag.
JamonPerformanceMonitorInterceptor(boolean, boolean) - Constructor for class org.springframework.aop.interceptor.JamonPerformanceMonitorInterceptor
Create a new JamonPerformanceMonitorInterceptor with a dynamic or static logger, according to the given flag.
JAR_URL_SEPARATOR - Static variable in class org.springframework.util.ResourceUtils
Separator between JAR URL and file path within the JAR
JasperReportsCsvView - Class in org.springframework.web.servlet.view.jasperreports
Implementation of AbstractJasperReportsSingleFormatView that renders report results in CSV format.
JasperReportsCsvView() - Constructor for class org.springframework.web.servlet.view.jasperreports.JasperReportsCsvView
JasperReportsHtmlView - Class in org.springframework.web.servlet.view.jasperreports
Implementation of AbstractJasperReportsSingleFormatView that renders report results in HTML format.
JasperReportsHtmlView() - Constructor for class org.springframework.web.servlet.view.jasperreports.JasperReportsHtmlView
JasperReportsMultiFormatView - Class in org.springframework.web.servlet.view.jasperreports
Jasper Reports view class that allows for the actual rendering format to be specified at runtime using a parameter contained in the model.
JasperReportsMultiFormatView() - Constructor for class org.springframework.web.servlet.view.jasperreports.JasperReportsMultiFormatView
Creates a new JasperReportsMultiFormatView instance with a default set of mappings.
JasperReportsPdfView - Class in org.springframework.web.servlet.view.jasperreports
Implementation of AbstractJasperReportsSingleFormatView that renders report results in PDF format.
JasperReportsPdfView() - Constructor for class org.springframework.web.servlet.view.jasperreports.JasperReportsPdfView
JasperReportsUtils - Class in org.springframework.ui.jasperreports
Utility methods for working with JasperReports.
JasperReportsUtils() - Constructor for class org.springframework.ui.jasperreports.JasperReportsUtils
JasperReportsViewResolver - Class in org.springframework.web.servlet.view.jasperreports
ViewResolver implementation that resolves instances of AbstractJasperReportsView by translating the supplied view name into the URL of the report file.
JasperReportsViewResolver() - Constructor for class org.springframework.web.servlet.view.jasperreports.JasperReportsViewResolver
JasperReportsXlsView - Class in org.springframework.web.servlet.view.jasperreports
Implementation of AbstractJasperReportsSingleFormatView that renders report results in XLS format.
JasperReportsXlsView() - Constructor for class org.springframework.web.servlet.view.jasperreports.JasperReportsXlsView
JAVA_13 - Static variable in class org.springframework.core.JdkVersion
Constant identifying the 1.3.x JVM (JDK 1.3).
JAVA_14 - Static variable in class org.springframework.core.JdkVersion
Constant identifying the 1.4.x JVM (J2SE 1.4).
JAVA_15 - Static variable in class org.springframework.core.JdkVersion
Constant identifying the 1.5 JVM (Java 5).
JAVA_16 - Static variable in class org.springframework.core.JdkVersion
Constant identifying the 1.6 JVM (Java 6).
JAVA_17 - Static variable in class org.springframework.core.JdkVersion
Constant identifying the 1.7 JVM (Java 7).
JavaMailSender - Interface in org.springframework.mail.javamail
Extended MailSender interface for JavaMail, supporting MIME messages both as direct arguments and through preparation callbacks.
JavaMailSenderImpl - Class in org.springframework.mail.javamail
Production implementation of the JavaMailSender interface, supporting both JavaMail MimeMessages and Spring SimpleMailMessages.
JavaMailSenderImpl() - Constructor for class org.springframework.mail.javamail.JavaMailSenderImpl
Create a new instance of the JavaMailSenderImpl class.
javaScriptEscape(String) - Static method in class org.springframework.web.util.JavaScriptUtils
Turn special characters into escaped characters conforming to JavaScript.
JavaScriptUtils - Class in org.springframework.web.util
Utility class for JavaScript escaping.
JavaScriptUtils() - Constructor for class org.springframework.web.util.JavaScriptUtils
javaTypeToSqlParameterType(Class) - Static method in class org.springframework.jdbc.core.StatementCreatorUtils
Derive a default SQL type from the given Java type.
Jaxb2Marshaller - Class in org.springframework.oxm.jaxb
Implementation of the Marshaller interface for JAXB 2.0.
Jaxb2Marshaller() - Constructor for class org.springframework.oxm.jaxb.Jaxb2Marshaller
Jaxb2RootElementHttpMessageConverter - Class in org.springframework.http.converter.xml
Implementation of HttpMessageConverter that can read and write XML using JAXB2.
Jaxb2RootElementHttpMessageConverter() - Constructor for class org.springframework.http.converter.xml.Jaxb2RootElementHttpMessageConverter
JaxRpcPortClientInterceptor - Class in org.springframework.remoting.jaxrpc
Deprecated. in favor of JAX-WS support in org.springframework.remoting.jaxws
JaxRpcPortClientInterceptor() - Constructor for class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated.
JaxRpcPortProxyFactoryBean - Class in org.springframework.remoting.jaxrpc
Deprecated. in favor of JAX-WS support in org.springframework.remoting.jaxws
JaxRpcPortProxyFactoryBean() - Constructor for class org.springframework.remoting.jaxrpc.JaxRpcPortProxyFactoryBean
Deprecated.
JaxRpcServicePostProcessor - Interface in org.springframework.remoting.jaxrpc
Deprecated. in favor of JAX-WS support in org.springframework.remoting.jaxws
JaxRpcSoapFaultException - Exception in org.springframework.remoting.jaxrpc
Deprecated. in favor of JAX-WS support in org.springframework.remoting.jaxws
JaxRpcSoapFaultException(SOAPFaultException) - Constructor for exception org.springframework.remoting.jaxrpc.JaxRpcSoapFaultException
Deprecated. Constructor for JaxRpcSoapFaultException.
JaxWsPortClientInterceptor - Class in org.springframework.remoting.jaxws
MethodInterceptor for accessing a specific port of a JAX-WS service.
JaxWsPortClientInterceptor() - Constructor for class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
JaxWsPortProxyFactoryBean - Class in org.springframework.remoting.jaxws
FactoryBean for a specific port of a JAX-WS service.
JaxWsPortProxyFactoryBean() - Constructor for class org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean
JaxWsSoapFaultException - Exception in org.springframework.remoting.jaxws
Spring SoapFaultException adapter for the JAX-WS SOAPFaultException class.
JaxWsSoapFaultException(SOAPFaultException) - Constructor for exception org.springframework.remoting.jaxws.JaxWsSoapFaultException
Constructor for JaxWsSoapFaultException.
JBossLoadTimeWeaver - Class in org.springframework.instrument.classloading.jboss
LoadTimeWeaver implementation for JBoss's instrumentable ClassLoader.
JBossLoadTimeWeaver() - Constructor for class org.springframework.instrument.classloading.jboss.JBossLoadTimeWeaver
Create a new instance of the JBossLoadTimeWeaver class using the default class loader.
JBossLoadTimeWeaver(ClassLoader) - Constructor for class org.springframework.instrument.classloading.jboss.JBossLoadTimeWeaver
Create a new instance of the JBossLoadTimeWeaver class using the supplied ClassLoader.
JBossNativeJdbcExtractor - Class in org.springframework.jdbc.support.nativejdbc
Implementation of the NativeJdbcExtractor interface for JBoss, supporting JBoss Application Server 3.2.4+.
JBossNativeJdbcExtractor() - Constructor for class org.springframework.jdbc.support.nativejdbc.JBossNativeJdbcExtractor
This constructor retrieves JBoss JDBC wrapper classes, so we can get the underlying vendor connection using reflection.
JBossWorkManagerTaskExecutor - Class in org.springframework.jca.work.jboss
Spring TaskExecutor adapter for the JBoss JCA WorkManager.
JBossWorkManagerTaskExecutor() - Constructor for class org.springframework.jca.work.jboss.JBossWorkManagerTaskExecutor
JBossWorkManagerUtils - Class in org.springframework.jca.work.jboss
Utility class for obtaining the JBoss JCA WorkManager, typically for use in web applications.
JBossWorkManagerUtils() - Constructor for class org.springframework.jca.work.jboss.JBossWorkManagerUtils
Jdbc4NativeJdbcExtractor - Class in org.springframework.jdbc.support.nativejdbc
NativeJdbcExtractor implementation that delegates to JDBC 4.0's unwrap method, as defined by Wrapper.
Jdbc4NativeJdbcExtractor() - Constructor for class org.springframework.jdbc.support.nativejdbc.Jdbc4NativeJdbcExtractor
Jdbc4SqlXmlHandler - Class in org.springframework.jdbc.support.xml
Default implementation of the SqlXmlHandler interface.
Jdbc4SqlXmlHandler() - Constructor for class org.springframework.jdbc.support.xml.Jdbc4SqlXmlHandler
JdbcAccessor - Class in org.springframework.jdbc.support
Base class for JdbcTemplate and other JDBC-accessing DAO helpers, defining common properties such as DataSource and exception translator.
JdbcAccessor() - Constructor for class org.springframework.jdbc.support.JdbcAccessor
JdbcBeanDefinitionReader - Class in org.springframework.jdbc.core.support
Bean definition reader that reads values from a database table, based on a given SQL statement.
JdbcBeanDefinitionReader(BeanDefinitionRegistry) - Constructor for class org.springframework.jdbc.core.support.JdbcBeanDefinitionReader
Create a new JdbcBeanDefinitionReader for the given bean factory, using a default PropertiesBeanDefinitionReader underneath.
JdbcBeanDefinitionReader(PropertiesBeanDefinitionReader) - Constructor for class org.springframework.jdbc.core.support.JdbcBeanDefinitionReader
Create a new JdbcBeanDefinitionReader that delegates to the given PropertiesBeanDefinitionReader underneath.
JdbcDaoSupport - Class in org.springframework.jdbc.core.support
Convenient super class for JDBC-based data access objects.
JdbcDaoSupport() - Constructor for class org.springframework.jdbc.core.support.JdbcDaoSupport
JdbcNamespaceHandler - Class in org.springframework.jdbc.config
NamespaceHandler for JDBC configuration namespace.
JdbcNamespaceHandler() - Constructor for class org.springframework.jdbc.config.JdbcNamespaceHandler
JdbcOperations - Interface in org.springframework.jdbc.core
Interface specifying a basic set of JDBC operations.
JdbcTemplate - Class in org.springframework.jdbc.core
This is the central class in the JDBC core package. It simplifies the use of JDBC and helps to avoid common errors.
JdbcTemplate() - Constructor for class org.springframework.jdbc.core.JdbcTemplate
Construct a new JdbcTemplate for bean usage.
JdbcTemplate(DataSource) - Constructor for class org.springframework.jdbc.core.JdbcTemplate
Construct a new JdbcTemplate, given a DataSource to obtain connections from.
JdbcTemplate(DataSource, boolean) - Constructor for class org.springframework.jdbc.core.JdbcTemplate
Construct a new JdbcTemplate, given a DataSource to obtain connections from.
jdbcTemplate - Variable in class org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
Deprecated.
JdbcTestUtils - Class in org.springframework.test.jdbc
JdbcTestUtils is a collection of JDBC related utility methods for use in unit and integration testing scenarios.
JdbcTestUtils() - Constructor for class org.springframework.test.jdbc.JdbcTestUtils
JdbcTransactionObjectSupport - Class in org.springframework.jdbc.datasource
Convenient base class for JDBC-aware transaction objects.
JdbcTransactionObjectSupport() - Constructor for class org.springframework.jdbc.datasource.JdbcTransactionObjectSupport
JdbcUpdateAffectedIncorrectNumberOfRowsException - Exception in org.springframework.jdbc
Exception thrown when a JDBC update affects an unexpected number of rows.
JdbcUpdateAffectedIncorrectNumberOfRowsException(String, int, int) - Constructor for exception org.springframework.jdbc.JdbcUpdateAffectedIncorrectNumberOfRowsException
Constructor for JdbcUpdateAffectedIncorrectNumberOfRowsException.
JdbcUtils - Class in org.springframework.jdbc.support
Generic utility methods for working with JDBC.
JdbcUtils() - Constructor for class org.springframework.jdbc.support.JdbcUtils
JdkRegexpMethodPointcut - Class in org.springframework.aop.support
Regular expression pointcut based on the java.util.regex package.
JdkRegexpMethodPointcut() - Constructor for class org.springframework.aop.support.JdkRegexpMethodPointcut
JdkVersion - Class in org.springframework.core
Internal helper class used to find the Java/JVM version that Spring is operating on, to allow for automatically adapting to the present platform's capabilities.
JdkVersion() - Constructor for class org.springframework.core.JdkVersion
JdoAccessor - Class in org.springframework.orm.jdo
Base class for JdoTemplate and JdoInterceptor, defining common properties such as PersistenceManagerFactory and flushing behavior.
JdoAccessor() - Constructor for class org.springframework.orm.jdo.JdoAccessor
JdoCallback<T> - Interface in org.springframework.orm.jdo
Callback interface for JDO code.
JdoDaoSupport - Class in org.springframework.orm.jdo.support
Convenient super class for JDO data access objects.
JdoDaoSupport() - Constructor for class org.springframework.orm.jdo.support.JdoDaoSupport
JdoDialect - Interface in org.springframework.orm.jdo
SPI strategy that allows for customizing integration with a specific JDO provider, in particular regarding transaction management and exception translation.
JdoInterceptor - Class in org.springframework.orm.jdo
This interceptor binds a new JDO PersistenceManager to the thread before a method call, closing and removing it afterwards in case of any method outcome.
JdoInterceptor() - Constructor for class org.springframework.orm.jdo.JdoInterceptor
JdoObjectRetrievalFailureException - Exception in org.springframework.orm.jdo
JDO-specific subclass of ObjectRetrievalFailureException.
JdoObjectRetrievalFailureException(JDOObjectNotFoundException) - Constructor for exception org.springframework.orm.jdo.JdoObjectRetrievalFailureException
JdoOperations - Interface in org.springframework.orm.jdo
Interface that specifies a basic set of JDO operations, implemented by JdoTemplate.
JdoOptimisticLockingFailureException - Exception in org.springframework.orm.jdo
JDO-specific subclass of ObjectOptimisticLockingFailureException.
JdoOptimisticLockingFailureException(JDOOptimisticVerificationException) - Constructor for exception org.springframework.orm.jdo.JdoOptimisticLockingFailureException
JdoResourceFailureException - Exception in org.springframework.orm.jdo
JDO-specific subclass of DataAccessResourceFailureException.
JdoResourceFailureException(JDODataStoreException) - Constructor for exception org.springframework.orm.jdo.JdoResourceFailureException
JdoResourceFailureException(JDOFatalDataStoreException) - Constructor for exception org.springframework.orm.jdo.JdoResourceFailureException
JdoSystemException - Exception in org.springframework.orm.jdo
JDO-specific subclass of UncategorizedDataAccessException, for JDO system errors that do not match any concrete org.springframework.dao exceptions.
JdoSystemException(JDOException) - Constructor for exception org.springframework.orm.jdo.JdoSystemException
JdoTemplate - Class in org.springframework.orm.jdo
Helper class that simplifies JDO data access code, and converts JDOExceptions into Spring DataAccessExceptions, following the org.springframework.dao exception hierarchy.
JdoTemplate() - Constructor for class org.springframework.orm.jdo.JdoTemplate
Create a new JdoTemplate instance.
JdoTemplate(PersistenceManagerFactory) - Constructor for class org.springframework.orm.jdo.JdoTemplate
Create a new JdoTemplate instance.
JdoTemplate(PersistenceManagerFactory, boolean) - Constructor for class org.springframework.orm.jdo.JdoTemplate
Create a new JdoTemplate instance.
JdoTransactionManager - Class in org.springframework.orm.jdo
PlatformTransactionManager implementation for a single JDO PersistenceManagerFactory.
JdoTransactionManager() - Constructor for class org.springframework.orm.jdo.JdoTransactionManager
Create a new JdoTransactionManager instance.
JdoTransactionManager(PersistenceManagerFactory) - Constructor for class org.springframework.orm.jdo.JdoTransactionManager
Create a new JdoTransactionManager instance.
JdoUsageException - Exception in org.springframework.orm.jdo
JDO-specific subclass of InvalidDataAccessApiUsageException.
JdoUsageException(JDOUserException) - Constructor for exception org.springframework.orm.jdo.JdoUsageException
JdoUsageException(JDOFatalUserException) - Constructor for exception org.springframework.orm.jdo.JdoUsageException
JeeNamespaceHandler - Class in org.springframework.ejb.config
NamespaceHandler for the 'jee' namespace.
JeeNamespaceHandler() - Constructor for class org.springframework.ejb.config.JeeNamespaceHandler
JibxMarshaller - Class in org.springframework.oxm.jibx
Implementation of the Marshaller and Unmarshaller interfaces for JiBX.
JibxMarshaller() - Constructor for class org.springframework.oxm.jibx.JibxMarshaller
JmsAccessor - Class in org.springframework.jms.support
Base class for JmsTemplate and other JMS-accessing gateway helpers, defining common properties such as the JMS ConnectionFactory to operate on.
JmsAccessor() - Constructor for class org.springframework.jms.support.JmsAccessor
JmsActivationSpecConfig - Class in org.springframework.jms.listener.endpoint
Common configuration object for activating a JMS message endpoint.
JmsActivationSpecConfig() - Constructor for class org.springframework.jms.listener.endpoint.JmsActivationSpecConfig
JmsActivationSpecFactory - Interface in org.springframework.jms.listener.endpoint
Strategy interface for creating JCA 1.5 ActivationSpec objects based on a configured JmsActivationSpecConfig object.
JmsDestinationAccessor - Class in org.springframework.jms.support.destination
Base class for JmsTemplate and other JMS-accessing gateway helpers, adding destination-related properties to JmsAccessor's common properties.
JmsDestinationAccessor() - Constructor for class org.springframework.jms.support.destination.JmsDestinationAccessor
JmsException - Exception in org.springframework.jms
Base class for exception thrown by the framework whenever it encounters a problem related to JMS.
JmsException(String) - Constructor for exception org.springframework.jms.JmsException
Constructor that takes a message.
JmsException(String, Throwable) - Constructor for exception org.springframework.jms.JmsException
Constructor that takes a message and a root cause.
JmsException(Throwable) - Constructor for exception org.springframework.jms.JmsException
Constructor that takes a plain root cause, intended for subclasses mirroring corresponding javax.jms exceptions.
JmsGatewaySupport - Class in org.springframework.jms.core.support
Convenient super class for application classes that need JMS access.
JmsGatewaySupport() - Constructor for class org.springframework.jms.core.support.JmsGatewaySupport
JmsInvokerClientInterceptor - Class in org.springframework.jms.remoting
MethodInterceptor for accessing a JMS-based remote service.
JmsInvokerClientInterceptor() - Constructor for class org.springframework.jms.remoting.JmsInvokerClientInterceptor
JmsInvokerProxyFactoryBean - Class in org.springframework.jms.remoting
FactoryBean for JMS invoker proxies.
JmsInvokerProxyFactoryBean() - Constructor for class org.springframework.jms.remoting.JmsInvokerProxyFactoryBean
JmsInvokerServiceExporter - Class in org.springframework.jms.remoting
JMS message listener that exports the specified service bean as a JMS service endpoint, accessible via a JMS invoker proxy.
JmsInvokerServiceExporter() - Constructor for class org.springframework.jms.remoting.JmsInvokerServiceExporter
JmsMessageEndpointFactory - Class in org.springframework.jms.listener.endpoint
JMS-specific implementation of the JCA 1.5 MessageEndpointFactory interface, providing transaction management capabilities for a JMS listener object (e.g.
JmsMessageEndpointFactory() - Constructor for class org.springframework.jms.listener.endpoint.JmsMessageEndpointFactory
JmsMessageEndpointFactory.JmsResourceException - Exception in org.springframework.jms.listener.endpoint
Internal exception thrown when a ResourceExeption has been encountered during the endpoint invocation.
JmsMessageEndpointFactory.JmsResourceException(ResourceException) - Constructor for exception org.springframework.jms.listener.endpoint.JmsMessageEndpointFactory.JmsResourceException
JmsMessageEndpointManager - Class in org.springframework.jms.listener.endpoint
Extension of the generic JCA 1.5 GenericMessageEndpointManager, adding JMS-specific support for ActivationSpec configuration.
JmsMessageEndpointManager() - Constructor for class org.springframework.jms.listener.endpoint.JmsMessageEndpointManager
JmsNamespaceHandler - Class in org.springframework.jms.config
A NamespaceHandler for the JMS namespace.
JmsNamespaceHandler() - Constructor for class org.springframework.jms.config.JmsNamespaceHandler
JmsOperations - Interface in org.springframework.jms.core
Specifies a basic set of JMS operations.
JmsResourceHolder - Class in org.springframework.jms.connection
JMS resource holder, wrapping a JMS Connection and a JMS Session.
JmsResourceHolder() - Constructor for class org.springframework.jms.connection.JmsResourceHolder
Create a new JmsResourceHolder that is open for resources to be added.
JmsResourceHolder(ConnectionFactory) - Constructor for class org.springframework.jms.connection.JmsResourceHolder
Create a new JmsResourceHolder that is open for resources to be added.
JmsResourceHolder(Session) - Constructor for class org.springframework.jms.connection.JmsResourceHolder
Create a new JmsResourceHolder for the given JMS Session.
JmsResourceHolder(Connection, Session) - Constructor for class org.springframework.jms.connection.JmsResourceHolder
Create a new JmsResourceHolder for the given JMS resources.
JmsResourceHolder(ConnectionFactory, Connection, Session) - Constructor for class org.springframework.jms.connection.JmsResourceHolder
Create a new JmsResourceHolder for the given JMS resources.
JmsSecurityException - Exception in org.springframework.jms
Runtime exception mirroring the JMS JMSSecurityException.
JmsSecurityException(JMSSecurityException) - Constructor for exception org.springframework.jms.JmsSecurityException
JmsTemplate - Class in org.springframework.jms.core
Helper class that simplifies synchronous JMS access code.
JmsTemplate() - Constructor for class org.springframework.jms.core.JmsTemplate
Create a new JmsTemplate for bean-style usage.
JmsTemplate(ConnectionFactory) - Constructor for class org.springframework.jms.core.JmsTemplate
Create a new JmsTemplate, given a ConnectionFactory.
JmsTemplate102 - Class in org.springframework.jms.core
Deprecated. as of Spring 3.0, in favor of the JMS 1.1 based JmsTemplate
JmsTemplate102() - Constructor for class org.springframework.jms.core.JmsTemplate102
Deprecated. Create a new JmsTemplate102 for bean-style usage.
JmsTemplate102(ConnectionFactory, boolean) - Constructor for class org.springframework.jms.core.JmsTemplate102
Deprecated. Create a new JmsTemplate102, given a ConnectionFactory.
JmsTransactionManager - Class in org.springframework.jms.connection
PlatformTransactionManager implementation for a single JMS ConnectionFactory.
JmsTransactionManager() - Constructor for class org.springframework.jms.connection.JmsTransactionManager
Create a new JmsTransactionManager for bean-style usage.
JmsTransactionManager(ConnectionFactory) - Constructor for class org.springframework.jms.connection.JmsTransactionManager
Create a new JmsTransactionManager, given a ConnectionFactory.
JmsTransactionManager102 - Class in org.springframework.jms.connection
Deprecated. as of Spring 3.0, in favor of the JMS 1.1 based JmsTransactionManager
JmsTransactionManager102() - Constructor for class org.springframework.jms.connection.JmsTransactionManager102
Deprecated. Create a new JmsTransactionManager102 for bean-style usage.
JmsTransactionManager102(ConnectionFactory, boolean) - Constructor for class org.springframework.jms.connection.JmsTransactionManager102
Deprecated. Create a new JmsTransactionManager102, given a ConnectionFactory.
JmsUtils - Class in org.springframework.jms.support
Generic utility methods for working with JMS.
JmsUtils() - Constructor for class org.springframework.jms.support.JmsUtils
JmxAttributeSource - Interface in org.springframework.jmx.export.metadata
Interface used by the MetadataMBeanInfoAssembler to read source-level metadata from a managed resource's class.
JmxException - Exception in org.springframework.jmx
General base exception to be thrown on JMX errors.
JmxException(String) - Constructor for exception org.springframework.jmx.JmxException
Constructor for JmxException.
JmxException(String, Throwable) - Constructor for exception org.springframework.jmx.JmxException
Constructor for JmxException.
JmxMetadataUtils - Class in org.springframework.jmx.export.metadata
Utility methods for converting Spring JMX metadata into their plain JMX equivalents.
JmxMetadataUtils() - Constructor for class org.springframework.jmx.export.metadata.JmxMetadataUtils
JmxUtils - Class in org.springframework.jmx.support
Collection of generic utility methods to support Spring JMX.
JmxUtils() - Constructor for class org.springframework.jmx.support.JmxUtils
JndiAccessor - Class in org.springframework.jndi
Convenient superclass for JNDI accessors, providing "jndiTemplate" and "jndiEnvironment" bean properties.
JndiAccessor() - Constructor for class org.springframework.jndi.JndiAccessor
JndiCallback<T> - Interface in org.springframework.jndi
Callback interface to be implemented by classes that need to perform an operation (such as a lookup) in a JNDI context.
JndiDataSourceLookup - Class in org.springframework.jdbc.datasource.lookup
JNDI-based DataSourceLookup implementation.
JndiDataSourceLookup() - Constructor for class org.springframework.jdbc.datasource.lookup.JndiDataSourceLookup
JndiDestinationResolver - Class in org.springframework.jms.support.destination
DestinationResolver implementation which interprets destination names as JNDI locations (with a configurable fallback strategy).
JndiDestinationResolver() - Constructor for class org.springframework.jms.support.destination.JndiDestinationResolver
JndiLocatorDelegate - Class in org.springframework.jndi
JndiLocatorSupport subclass with public lookup methods, for convenient use as a delegate.
JndiLocatorDelegate() - Constructor for class org.springframework.jndi.JndiLocatorDelegate
JndiLocatorSupport - Class in org.springframework.jndi
Convenient superclass for classes that can locate any number of JNDI objects.
JndiLocatorSupport() - Constructor for class org.springframework.jndi.JndiLocatorSupport
JndiLookupFailureException - Exception in org.springframework.jndi
RuntimeException to be thrown in case of JNDI lookup failures, in particular from code that does not declare JNDI's checked NamingException: for example, from Spring's JndiObjectTargetSource.
JndiLookupFailureException(String, NamingException) - Constructor for exception org.springframework.jndi.JndiLookupFailureException
Construct a new JndiLookupFailureException, wrapping the given JNDI NamingException.
JndiObjectFactoryBean - Class in org.springframework.jndi
FactoryBean that looks up a JNDI object.
JndiObjectFactoryBean() - Constructor for class org.springframework.jndi.JndiObjectFactoryBean
JndiObjectLocator - Class in org.springframework.jndi
Convenient superclass for JNDI-based service locators, providing configurable lookup of a specific JNDI resource.
JndiObjectLocator() - Constructor for class org.springframework.jndi.JndiObjectLocator
JndiObjectTargetSource - Class in org.springframework.jndi
AOP TargetSource that provides configurable JNDI lookups for getTarget() calls.
JndiObjectTargetSource() - Constructor for class org.springframework.jndi.JndiObjectTargetSource
JndiRmiClientInterceptor - Class in org.springframework.remoting.rmi
MethodInterceptor for accessing RMI services from JNDI.
JndiRmiClientInterceptor() - Constructor for class org.springframework.remoting.rmi.JndiRmiClientInterceptor
JndiRmiProxyFactoryBean - Class in org.springframework.remoting.rmi
FactoryBean for RMI proxies from JNDI.
JndiRmiProxyFactoryBean() - Constructor for class org.springframework.remoting.rmi.JndiRmiProxyFactoryBean
JndiRmiServiceExporter - Class in org.springframework.remoting.rmi
Service exporter which binds RMI services to JNDI.
JndiRmiServiceExporter() - Constructor for class org.springframework.remoting.rmi.JndiRmiServiceExporter
JndiTemplate - Class in org.springframework.jndi
Helper class that simplifies JNDI operations.
JndiTemplate() - Constructor for class org.springframework.jndi.JndiTemplate
Create a new JndiTemplate instance.
JndiTemplate(Properties) - Constructor for class org.springframework.jndi.JndiTemplate
Create a new JndiTemplate instance, using the given environment.
JndiTemplateEditor - Class in org.springframework.jndi
Properties editor for JndiTemplate objects.
JndiTemplateEditor() - Constructor for class org.springframework.jndi.JndiTemplateEditor
JobDetailAwareTrigger - Interface in org.springframework.scheduling.quartz
Interface to be implemented by Quartz Triggers that are aware of the JobDetail object that they are associated with.
JobDetailBean - Class in org.springframework.scheduling.quartz
Convenience subclass of Quartz's JobDetail class, making bean-style usage easier.
JobDetailBean() - Constructor for class org.springframework.scheduling.quartz.JobDetailBean
JobMethodInvocationFailedException - Exception in org.springframework.scheduling.quartz
Unchecked exception that wraps an exception thrown from a target method.
JobMethodInvocationFailedException(MethodInvoker, Throwable) - Constructor for exception org.springframework.scheduling.quartz.JobMethodInvocationFailedException
Constructor for JobMethodInvocationFailedException.
JodaDateTimeFormatAnnotationFormatterFactory - Class in org.springframework.format.datetime.joda
Formats fields annotated with the DateTimeFormat annotation.
JodaDateTimeFormatAnnotationFormatterFactory() - Constructor for class org.springframework.format.datetime.joda.JodaDateTimeFormatAnnotationFormatterFactory
JodaTimeContext - Class in org.springframework.format.datetime.joda
A context that holds user-specific Joda Time settings such as the user's Chronology (calendar system) and time zone.
JodaTimeContext() - Constructor for class org.springframework.format.datetime.joda.JodaTimeContext
JodaTimeContextHolder - Class in org.springframework.format.datetime.joda
A holder for a thread-local user JodaTimeContext.
JodaTimeContextHolder() - Constructor for class org.springframework.format.datetime.joda.JodaTimeContextHolder
JodaTimeFormattingConfigurer - Class in org.springframework.format.datetime.joda
Configures Joda Time's Formatting system for use with Spring.
JodaTimeFormattingConfigurer() - Constructor for class org.springframework.format.datetime.joda.JodaTimeFormattingConfigurer
JOIN_POINT_KEY - Static variable in class org.springframework.aop.aspectj.AbstractAspectJAdvice
Key used in ReflectiveMethodInvocation userAtributes map for the current joinpoint.
JpaAccessor - Class in org.springframework.orm.jpa
Base class for JpaTemplate and JpaInterceptor, defining common properties such as EntityManagerFactory and flushing behavior.
JpaAccessor() - Constructor for class org.springframework.orm.jpa.JpaAccessor
JpaCallback<T> - Interface in org.springframework.orm.jpa
Callback interface for JPA code.
JpaDaoSupport - Class in org.springframework.orm.jpa.support
Convenient super class for JPA data access objects.
JpaDaoSupport() - Constructor for class org.springframework.orm.jpa.support.JpaDaoSupport
JpaDialect - Interface in org.springframework.orm.jpa
SPI strategy that encapsulates certain functionality that standard JPA 1.0 does not offer, such as access to the underlying JDBC Connection.
JpaInterceptor - Class in org.springframework.orm.jpa
This interceptor binds a new JPA EntityManager to the thread before a method call, closing and removing it afterwards in case of any method outcome.
JpaInterceptor() - Constructor for class org.springframework.orm.jpa.JpaInterceptor
JpaObjectRetrievalFailureException - Exception in org.springframework.orm.jpa
JPA-specific subclass of ObjectRetrievalFailureException.
JpaObjectRetrievalFailureException(EntityNotFoundException) - Constructor for exception org.springframework.orm.jpa.JpaObjectRetrievalFailureException
JpaOperations - Interface in org.springframework.orm.jpa
Interface that specifies a basic set of JPA operations, implemented by JpaTemplate.
JpaOptimisticLockingFailureException - Exception in org.springframework.orm.jpa
JPA-specific subclass of ObjectOptimisticLockingFailureException.
JpaOptimisticLockingFailureException(OptimisticLockException) - Constructor for exception org.springframework.orm.jpa.JpaOptimisticLockingFailureException
JpaSystemException - Exception in org.springframework.orm.jpa
JPA-specific subclass of UncategorizedDataAccessException, for JPA system errors that do not match any concrete org.springframework.dao exceptions.
JpaSystemException(PersistenceException) - Constructor for exception org.springframework.orm.jpa.JpaSystemException
JpaTemplate - Class in org.springframework.orm.jpa
Helper class that allows for writing JPA data access code in the same style as with Spring's well-known JdoTemplate and HibernateTemplate classes.
JpaTemplate() - Constructor for class org.springframework.orm.jpa.JpaTemplate
Create a new JpaTemplate instance.
JpaTemplate(EntityManagerFactory) - Constructor for class org.springframework.orm.jpa.JpaTemplate
Create a new JpaTemplate instance.
JpaTemplate(EntityManager) - Constructor for class org.springframework.orm.jpa.JpaTemplate
Create a new JpaTemplate instance.
JpaTransactionManager - Class in org.springframework.orm.jpa
PlatformTransactionManager implementation for a single JPA EntityManagerFactory.
JpaTransactionManager() - Constructor for class org.springframework.orm.jpa.JpaTransactionManager
Create a new JpaTransactionManager instance.
JpaTransactionManager(EntityManagerFactory) - Constructor for class org.springframework.orm.jpa.JpaTransactionManager
Create a new JpaTransactionManager instance.
JpaVendorAdapter - Interface in org.springframework.orm.jpa
SPI interface that allows to plug in vendor-specific behavior into Spring's EntityManagerFactory creators.
JRubyScriptFactory - Class in org.springframework.scripting.jruby
ScriptFactory implementation for a JRuby script.
JRubyScriptFactory(String, Class[]) - Constructor for class org.springframework.scripting.jruby.JRubyScriptFactory
Create a new JRubyScriptFactory for the given script source.
JRubyScriptUtils - Class in org.springframework.scripting.jruby
Utility methods for handling JRuby-scripted objects.
JRubyScriptUtils() - Constructor for class org.springframework.scripting.jruby.JRubyScriptUtils
JRubyScriptUtils.JRubyExecutionException - Exception in org.springframework.scripting.jruby
Exception thrown in response to a JRuby RaiseException being thrown from a JRuby method invocation.
JRubyScriptUtils.JRubyExecutionException(RaiseException) - Constructor for exception org.springframework.scripting.jruby.JRubyScriptUtils.JRubyExecutionException
Create a new JRubyException, wrapping the given JRuby RaiseException.
JspAwareRequestContext - Class in org.springframework.web.servlet.support
JSP-aware (and JSTL-aware) subclass of RequestContext, allowing for population of the context from a javax.servlet.jsp.PageContext.
JspAwareRequestContext(PageContext) - Constructor for class org.springframework.web.servlet.support.JspAwareRequestContext
Create a new JspAwareRequestContext for the given page context, using the request attributes for Errors retrieval.
JspAwareRequestContext(PageContext, Map<String, Object>) - Constructor for class org.springframework.web.servlet.support.JspAwareRequestContext
Create a new JspAwareRequestContext for the given page context, using the given model attributes for Errors retrieval.
Jsr330ScopeMetadataResolver - Class in org.springframework.context.annotation
Simple ScopeMetadataResolver implementation that follows JSR-330 scoping rules: defaulting to prototype scope unless Singleton is present.
Jsr330ScopeMetadataResolver() - Constructor for class org.springframework.context.annotation.Jsr330ScopeMetadataResolver
jstlPresent - Static variable in class org.springframework.web.servlet.support.RequestContext
JstlUtils - Class in org.springframework.web.servlet.support
Helper class for preparing JSTL views, in particular for exposing a JSTL localization context.
JstlUtils() - Constructor for class org.springframework.web.servlet.support.JstlUtils
JstlView - Class in org.springframework.web.servlet.view
Specialization of InternalResourceView for JSTL pages, i.e.
JstlView() - Constructor for class org.springframework.web.servlet.view.JstlView
Constructor for use as a bean.
JstlView(String) - Constructor for class org.springframework.web.servlet.view.JstlView
Create a new JstlView with the given URL.
JstlView(String, MessageSource) - Constructor for class org.springframework.web.servlet.view.JstlView
Create a new JstlView with the given URL.
JtaAfterCompletionSynchronization - Class in org.springframework.transaction.jta
Adapter for a JTA Synchronization, invoking the afterCommit / afterCompletion callbacks of Spring TransactionSynchronization objects callbacks after the outer JTA transaction has completed.
JtaAfterCompletionSynchronization(List<TransactionSynchronization>) - Constructor for class org.springframework.transaction.jta.JtaAfterCompletionSynchronization
Create a new JtaAfterCompletionSynchronization for the given synchronization objects.
JtaLobCreatorSynchronization - Class in org.springframework.jdbc.support.lob
Callback for resource cleanup at the end of a JTA transaction.
JtaLobCreatorSynchronization(LobCreator) - Constructor for class org.springframework.jdbc.support.lob.JtaLobCreatorSynchronization
Create a JtaLobCreatorSynchronization for the given LobCreator.
JtaTransactionManager - Class in org.springframework.transaction.jta
PlatformTransactionManager implementation for JTA, delegating to a backend JTA provider.
JtaTransactionManager() - Constructor for class org.springframework.transaction.jta.JtaTransactionManager
Create a new JtaTransactionManager instance, to be configured as bean.
JtaTransactionManager(UserTransaction) - Constructor for class org.springframework.transaction.jta.JtaTransactionManager
Create a new JtaTransactionManager instance.
JtaTransactionManager(UserTransaction, TransactionManager) - Constructor for class org.springframework.transaction.jta.JtaTransactionManager
Create a new JtaTransactionManager instance.
JtaTransactionManager(TransactionManager) - Constructor for class org.springframework.transaction.jta.JtaTransactionManager
Create a new JtaTransactionManager instance.
JtaTransactionManagerBeanDefinitionParser - Class in org.springframework.transaction.config
Parser for the <tx:jta-transaction-manager/> element, autodetecting BEA WebLogic, IBM WebSphere and Oracle OC4J.
JtaTransactionManagerBeanDefinitionParser() - Constructor for class org.springframework.transaction.config.JtaTransactionManagerBeanDefinitionParser
JtaTransactionObject - Class in org.springframework.transaction.jta
JTA transaction object, representing a UserTransaction.
JtaTransactionObject(UserTransaction) - Constructor for class org.springframework.transaction.jta.JtaTransactionObject
Create a new JtaTransactionObject for the given JTA UserTransaction.
Overview Package Class Tree Deprecated Index Help
A B C D E F G H I J K L M N O P Q R S T U V W X


K-Index

PREV LETTER NEXT LETTER FRAMES NO FRAMES
A B C D E F G H I J K L M N O P Q R S T U V W X

K

KEY_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
KEY_ELEMENT - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
KEY_REF_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
KEY_TYPE_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
KeyHolder - Interface in org.springframework.jdbc.support
Interface for retrieving keys, typically used for auto-generated keys as potentially returned by JDBC insert statements.
KeyNamingStrategy - Class in org.springframework.jmx.export.naming
ObjectNamingStrategy implementation that builds ObjectName instances from the key used in the "beans" map passed to MBeanExporter.
KeyNamingStrategy() - Constructor for class org.springframework.jmx.export.naming.KeyNamingStrategy
keySet() - Method in class org.springframework.http.HttpHeaders
keySet() - Method in class org.springframework.util.CachingMapDecorator
keySet() - Method in class org.springframework.util.LinkedMultiValueMap
kind - Variable in class org.springframework.expression.spel.support.ReflectionHelper.ArgumentsMatchInfo
Overview Package Class Tree Deprecated Index Help
A B C D E F G H I J K L M N O P Q R S T U V W X


L-Index

PREV LETTER NEXT LETTER FRAMES NO FRAMES
A B C D E F G H I J K L M N O P Q R S T U V W X

L

LABEL_ORDER - Static variable in interface org.springframework.core.enums.LabeledEnum
Deprecated. Shared Comparator instance that sorts enumerations by LABEL_ORDER.
LabeledEnum - Interface in org.springframework.core.enums
Deprecated. as of Spring 3.0, in favor of Java 5 enums.
LabeledEnumResolver - Interface in org.springframework.core.enums
Deprecated. as of Spring 3.0, in favor of Java 5 enums.
LabelTag - Class in org.springframework.web.servlet.tags.form
Databinding-aware JSP tag for rendering an HTML 'label' element that defines text that is associated with a single form element.
LabelTag() - Constructor for class org.springframework.web.servlet.tags.form.LabelTag
LANG_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
LangNamespaceHandler - Class in org.springframework.scripting.config
NamespaceHandler that supports the wiring of objects backed by dynamic languages such as Groovy, JRuby and BeanShell.
LangNamespaceHandler() - Constructor for class org.springframework.scripting.config.LangNamespaceHandler
LangNamespaceUtils - Class in org.springframework.scripting.config
LangNamespaceUtils() - Constructor for class org.springframework.scripting.config.LangNamespaceUtils
LAST - Static variable in class org.springframework.expression.spel.ast.Selection
last() - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
last() - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Moves the cursor to the last row of this RowSet.
LAST_MODIFIED_METHOD_SUFFIX - Static variable in class org.springframework.web.servlet.mvc.multiaction.MultiActionController
Suffix for last-modified methods
lastActualExecutionTime() - Method in class org.springframework.scheduling.support.SimpleTriggerContext
lastActualExecutionTime() - Method in interface org.springframework.scheduling.TriggerContext
Return the last actual execution time of the task, or null if not scheduled before.
lastCompletionTime() - Method in class org.springframework.scheduling.support.SimpleTriggerContext
lastCompletionTime() - Method in interface org.springframework.scheduling.TriggerContext
Return the last completion time of the task, or null if not scheduled before.
lastIndexOf(Object) - Method in class org.springframework.util.AutoPopulatingList
lastModified() - Method in class org.springframework.core.io.AbstractResource
This implementation checks the timestamp of the underlying File, if available.
lastModified() - Method in interface org.springframework.core.io.Resource
Determine the last-modified timestamp for this resource.
lastModified() - Method in class org.springframework.core.io.VfsResource
LastModified - Interface in org.springframework.web.servlet.mvc
Supports last-modified HTTP requests to facilitate content caching.
lastScheduledExecutionTime() - Method in class org.springframework.scheduling.support.SimpleTriggerContext
lastScheduledExecutionTime() - Method in interface org.springframework.scheduling.TriggerContext
Return the last scheduled execution time of the task, or null if not scheduled before.
Lazy - Annotation Type in org.springframework.context.annotation
Indicates whether a bean is to be lazily initialized.
LAZY_INIT_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
LAZY_INIT_KEY - Static variable in class org.springframework.beans.factory.support.PropertiesBeanDefinitionReader
Special key to distinguish owner.(lazy-init)=true Default is "false".
LazyConnectionDataSourceProxy - Class in org.springframework.jdbc.datasource
Proxy for a target DataSource, fetching actual JDBC Connections lazily, i.e.
LazyConnectionDataSourceProxy() - Constructor for class org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy
Create a new LazyConnectionDataSourceProxy.
LazyConnectionDataSourceProxy(DataSource) - Constructor for class org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy
Create a new LazyConnectionDataSourceProxy.
lazyGetProceedingJoinPoint(ProxyMethodInvocation) - Method in class org.springframework.aop.aspectj.AspectJAroundAdvice
Return the ProceedingJoinPoint for the current invocation, instantiating it lazily if it hasn't been bound to the thread already.
LazyInitTargetSource - Class in org.springframework.aop.target
TargetSource that lazily accesses a singleton bean from a BeanFactory.
LazyInitTargetSource() - Constructor for class org.springframework.aop.target.LazyInitTargetSource
LazyInitTargetSourceCreator - Class in org.springframework.aop.framework.autoproxy.target
TargetSourceCreator that enforces a LazyInitTargetSource for each bean that is defined as "lazy-init".
LazyInitTargetSourceCreator() - Constructor for class org.springframework.aop.framework.autoproxy.target.LazyInitTargetSourceCreator
LazySingletonAspectInstanceFactoryDecorator - Class in org.springframework.aop.aspectj.annotation
Decorator to cause a MetadataAwareAspectInstanceFactory to instantiate only once.
LazySingletonAspectInstanceFactoryDecorator(MetadataAwareAspectInstanceFactory) - Constructor for class org.springframework.aop.aspectj.annotation.LazySingletonAspectInstanceFactoryDecorator
Create a new lazily initializing decorator for the given AspectInstanceFactory.
LetterCodedLabeledEnum - Class in org.springframework.core.enums
Deprecated. as of Spring 3.0, in favor of Java 5 enums.
LetterCodedLabeledEnum(char, String) - Constructor for class org.springframework.core.enums.LetterCodedLabeledEnum
Deprecated. Create a new LetterCodedLabeledEnum instance.
Lifecycle - Interface in org.springframework.context
Interface defining methods for start/stop lifecycle control.
LIFECYCLE_PROCESSOR_BEAN_NAME - Static variable in class org.springframework.context.support.AbstractApplicationContext
Name of the LifecycleProcessor bean in the factory.
lifecycleMonitor - Variable in class org.springframework.jms.listener.AbstractJmsListeningContainer
LifecycleProcessor - Interface in org.springframework.context
Strategy interface for processing Lifecycle beans within the ApplicationContext.
LinkedCaseInsensitiveMap<V> - Class in org.springframework.util
LinkedHashMap variant that stores String keys in a case-insensitive manner, for example for key-based access in a results table.
LinkedCaseInsensitiveMap() - Constructor for class org.springframework.util.LinkedCaseInsensitiveMap
Create a new LinkedCaseInsensitiveMap for the default Locale.
LinkedCaseInsensitiveMap(Locale) - Constructor for class org.springframework.util.LinkedCaseInsensitiveMap
Create a new LinkedCaseInsensitiveMap that stores lower-case keys according to the given Locale.
LinkedCaseInsensitiveMap(int) - Constructor for class org.springframework.util.LinkedCaseInsensitiveMap
Create a new LinkedCaseInsensitiveMap that wraps a LinkedHashMap with the given initial capacity and stores lower-case keys according to the default Locale.
LinkedCaseInsensitiveMap(int, Locale) - Constructor for class org.springframework.util.LinkedCaseInsensitiveMap
Create a new LinkedCaseInsensitiveMap that wraps a LinkedHashMap with the given initial capacity and stores lower-case keys according to the given Locale.
LinkedMultiValueMap<K,V> - Class in org.springframework.util
Simple implementation of MultiValueMap that wraps a LinkedHashMap, storing multiple values in a LinkedList.
LinkedMultiValueMap() - Constructor for class org.springframework.util.LinkedMultiValueMap
Create a new LinkedMultiValueMap that wraps a LinkedHashMap.
LinkedMultiValueMap(int) - Constructor for class org.springframework.util.LinkedMultiValueMap
Create a new LinkedMultiValueMap that wraps a LinkedHashMap with the given initial capacity.
LinkedMultiValueMap(Map<K, List<V>>) - Constructor for class org.springframework.util.LinkedMultiValueMap
Copy constructor: Create a new LinkedMultiValueMap with the same mappings as the specified Map.
list(String) - Method in class org.springframework.mock.jndi.SimpleNamingContext
list(Name) - Method in class org.springframework.mock.jndi.SimpleNamingContext
LIST_ELEMENT - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
LIST_VALUE_PAGE_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.SelectTag
The PageContext attribute under which the bound value is exposed to inner OptionTags.
ListableBeanFactory - Interface in org.springframework.beans.factory
Extension of the BeanFactory interface to be implemented by bean factories that can enumerate all their bean instances, rather than attempting bean lookup by name one by one as requested by clients.
listBindings(String) - Method in class org.springframework.mock.jndi.SimpleNamingContext
listBindings(Name) - Method in class org.springframework.mock.jndi.SimpleNamingContext
ListenerExecutionFailedException - Exception in org.springframework.jms.listener.adapter
Exception to be thrown when the execution of a listener method failed.
ListenerExecutionFailedException(String, Throwable) - Constructor for exception org.springframework.jms.listener.adapter.ListenerExecutionFailedException
Constructor for ListenerExecutionFailedException.
ListFactoryBean - Class in org.springframework.beans.factory.config
Simple factory for shared List instances.
ListFactoryBean() - Constructor for class org.springframework.beans.factory.config.ListFactoryBean
listIterator() - Method in class org.springframework.util.AutoPopulatingList
listIterator(int) - Method in class org.springframework.util.AutoPopulatingList
Literal - Class in org.springframework.expression.spel.ast
Common superclass for nodes representing literals (boolean, string, number, etc).
Literal(String, int) - Constructor for class org.springframework.expression.spel.ast.Literal
LiteralExpression - Class in org.springframework.expression.common
A very simple hardcoded implementation of the Expression interface that represents a string literal.
LiteralExpression(String) - Constructor for class org.springframework.expression.common.LiteralExpression
literalValue - Variable in class org.springframework.expression.spel.ast.Literal
load(Resource...) - Method in class org.springframework.context.support.GenericXmlApplicationContext
Load bean definitions from the given XML resources.
load(String...) - Method in class org.springframework.context.support.GenericXmlApplicationContext
Load bean definitions from the given XML resources.
load(Class<T>, Serializable) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Return the persistent instance of the given entity class with the given identifier, throwing an exception if not found.
load(Class<T>, Serializable, LockMode) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Return the persistent instance of the given entity class with the given identifier, throwing an exception if not found.
load(String, Serializable) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Return the persistent instance of the given entity class with the given identifier, throwing an exception if not found.
load(String, Serializable, LockMode) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Return the persistent instance of the given entity class with the given identifier, throwing an exception if not found.
load(Object, Serializable) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Load the persistent instance with the given identifier into the given object, throwing an exception if not found.
load(Class<T>, Serializable) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
load(Class<T>, Serializable, LockMode) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
load(String, Serializable) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
load(String, Serializable, LockMode) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
load(Object, Serializable) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
load(Properties, InputStream) - Method in class org.springframework.util.DefaultPropertiesPersister
load(Properties, Reader) - Method in class org.springframework.util.DefaultPropertiesPersister
load(Properties, InputStream) - Method in interface org.springframework.util.PropertiesPersister
Load properties from the given InputStream into the given Properties object.
load(Properties, Reader) - Method in interface org.springframework.util.PropertiesPersister
Load properties from the given Reader into the given Properties object.
LOAD_TIME_WEAVER_BEAN_NAME - Static variable in interface org.springframework.context.ConfigurableApplicationContext
Name of the LoadTimeWeaver bean in the factory.
loadAll(Class<T>) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Return all persistent instances of the given entity class.
loadAll(Class<T>) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
loadAllProperties(String) - Static method in class org.springframework.core.io.support.PropertiesLoaderUtils
Load all properties from the given class path resource, using the default class loader.
loadAllProperties(String, ClassLoader) - Static method in class org.springframework.core.io.support.PropertiesLoaderUtils
Load all properties from the given class path resource, using the given class loader.
loadBeanDefinitions(Resource...) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinitionReader
loadBeanDefinitions(String) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinitionReader
loadBeanDefinitions(String, Set<Resource>) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinitionReader
Load bean definitions from the specified resource location.
loadBeanDefinitions(String...) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinitionReader
loadBeanDefinitions(Resource) - Method in interface org.springframework.beans.factory.support.BeanDefinitionReader
Load bean definitions from the specified resource.
loadBeanDefinitions(Resource...) - Method in interface org.springframework.beans.factory.support.BeanDefinitionReader
Load bean definitions from the specified resources.
loadBeanDefinitions(String) - Method in interface org.springframework.beans.factory.support.BeanDefinitionReader
Load bean definitions from the specified resource location.
loadBeanDefinitions(String...) - Method in interface org.springframework.beans.factory.support.BeanDefinitionReader
Load bean definitions from the specified resource locations.
loadBeanDefinitions(Resource) - Method in class org.springframework.beans.factory.support.PropertiesBeanDefinitionReader
Load bean definitions from the specified properties file, using all property keys (i.e.
loadBeanDefinitions(Resource, String) - Method in class org.springframework.beans.factory.support.PropertiesBeanDefinitionReader
Load bean definitions from the specified properties file.
loadBeanDefinitions(EncodedResource) - Method in class org.springframework.beans.factory.support.PropertiesBeanDefinitionReader
Load bean definitions from the specified properties file.
loadBeanDefinitions(EncodedResource, String) - Method in class org.springframework.beans.factory.support.PropertiesBeanDefinitionReader
Load bean definitions from the specified properties file.
loadBeanDefinitions(Resource) - Method in class org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Load bean definitions from the specified XML file.
loadBeanDefinitions(EncodedResource) - Method in class org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Load bean definitions from the specified XML file.
loadBeanDefinitions(InputSource) - Method in class org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Load bean definitions from the specified XML file.
loadBeanDefinitions(InputSource, String) - Method in class org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Load bean definitions from the specified XML file.
loadBeanDefinitions(DefaultListableBeanFactory) - Method in class org.springframework.context.support.AbstractRefreshableApplicationContext
Load bean definitions into the given bean factory, typically through delegating to one or more bean definition readers.
loadBeanDefinitions(DefaultListableBeanFactory) - Method in class org.springframework.context.support.AbstractXmlApplicationContext
Loads the bean definitions via an XmlBeanDefinitionReader.
loadBeanDefinitions(XmlBeanDefinitionReader) - Method in class org.springframework.context.support.AbstractXmlApplicationContext
Load the bean definitions with the given XmlBeanDefinitionReader.
loadBeanDefinitions(BeanDefinitionRegistry, String[]) - Method in class org.springframework.jca.context.SpringContextResourceAdapter
Load the bean definitions into the given registry, based on the specified configuration files.
loadBeanDefinitions(String) - Method in class org.springframework.jdbc.core.support.JdbcBeanDefinitionReader
Load bean definitions from the database via the given SQL string.
loadBeanDefinitions(DefaultListableBeanFactory) - Method in class org.springframework.web.context.support.AnnotationConfigWebApplicationContext
Register a BeanDefinition for each class specified by AbstractRefreshableWebApplicationContext.getConfigLocations(), or scan each specified package for annotated classes.
loadBeanDefinitions(DefaultListableBeanFactory) - Method in class org.springframework.web.context.support.XmlWebApplicationContext
Loads the bean definitions via an XmlBeanDefinitionReader.
loadBeanDefinitions(XmlBeanDefinitionReader) - Method in class org.springframework.web.context.support.XmlWebApplicationContext
Load the bean definitions with the given XmlBeanDefinitionReader.
loadBeanDefinitions(DefaultListableBeanFactory) - Method in class org.springframework.web.portlet.context.XmlPortletApplicationContext
Loads the bean definitions via an XmlBeanDefinitionReader.
loadBeanDefinitions(XmlBeanDefinitionReader) - Method in class org.springframework.web.portlet.context.XmlPortletApplicationContext
Load the bean definitions with the given XmlBeanDefinitionReader.
loadBeanFactory() - Method in class org.springframework.ejb.support.AbstractStatefulSessionBean
Load a Spring BeanFactory namespace.
loadBytesForClass(String) - Method in class org.springframework.core.OverridingClassLoader
Load the defining bytes for the given class, to be turned into a Class object through a ClassLoader.defineClass(byte[], int, int) call.
loadClass(String, boolean) - Method in class org.springframework.core.OverridingClassLoader
loadClass(String) - Method in class org.springframework.instrument.classloading.ShadowingClassLoader
loadClass(String) - Method in class org.springframework.scheduling.quartz.ResourceLoaderClassLoadHelper
loadClassForOverriding(String) - Method in class org.springframework.core.OverridingClassLoader
Load the specified class for overriding purposes in this ClassLoader.
loadContext(Object) - Method in class org.springframework.test.AbstractSingleSpringContextTests
Deprecated. This implementation assumes a key of type String array and loads a context from the given locations.
loadContext(Object) - Method in class org.springframework.test.AbstractSpringContextTests
Deprecated. Load a new ApplicationContext for the given key.
loadContext(String...) - Method in interface org.springframework.test.context.ContextLoader
Loads a new context based on the supplied locations, configures the context, and finally returns the context in fully refreshed state.
loadContext(String...) - Method in class org.springframework.test.context.support.AbstractGenericContextLoader
Loads a Spring ApplicationContext from the supplied locations.
loadContextLocations(String[]) - Method in class org.springframework.test.AbstractSingleSpringContextTests
Deprecated. Load a Spring ApplicationContext from the given config locations.
loadDocument(InputSource, EntityResolver, ErrorHandler, int, boolean) - Method in class org.springframework.beans.factory.xml.DefaultDocumentLoader
Load the Document at the supplied InputSource using the standard JAXP-configured XML parser.
loadDocument(InputSource, EntityResolver, ErrorHandler, int, boolean) - Method in interface org.springframework.beans.factory.xml.DocumentLoader
Load a document from the supplied source.
loadFromXml(Properties, InputStream) - Method in class org.springframework.util.DefaultPropertiesPersister
loadFromXml(Properties, InputStream) - Method in interface org.springframework.util.PropertiesPersister
Load properties from the given XML InputStream into the given Properties object.
loadParentContext(ServletContext) - Method in class org.springframework.web.context.ContextLoader
Template method with default implementation (which may be overridden by a subclass), to load or obtain an ApplicationContext instance which will be used as the parent context of the root WebApplicationContext.
loadProperties(Resource, String) - Method in class org.springframework.context.support.ReloadableResourceBundleMessageSource
Load the properties from the given resource.
loadProperties(Properties) - Method in class org.springframework.core.io.support.PropertiesLoaderSupport
Load properties into the given instance.
loadProperties(Resource) - Static method in class org.springframework.core.io.support.PropertiesLoaderUtils
Load properties from the given resource.
loadReport() - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
Load the main JasperReport from the specified Resource.
loadReport(Resource) - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
Loads a JasperReport from the specified Resource.
loadResource(String) - Method in class org.springframework.jdbc.support.SQLErrorCodesFactory
Load the given resource from the class path.
LoadTimeWeaver - Interface in org.springframework.instrument.classloading
Defines the contract for adding one or more ClassFileTransformers to a ClassLoader.
LoadTimeWeaverAware - Interface in org.springframework.context.weaving
Interface to be implemented by any object that wishes to be notified of the application context's default LoadTimeWeaver.
LoadTimeWeaverAwareProcessor - Class in org.springframework.context.weaving
BeanPostProcessor implementation that passes the context's default LoadTimeWeaver to beans that implement the LoadTimeWeaverAware interface.
LoadTimeWeaverAwareProcessor() - Constructor for class org.springframework.context.weaving.LoadTimeWeaverAwareProcessor
Create a new LoadTimeWeaverAwareProcessor that will auto-retrieve the LoadTimeWeaver from the containing BeanFactory, expecting a bean named "loadTimeWeaver".
LoadTimeWeaverAwareProcessor(LoadTimeWeaver) - Constructor for class org.springframework.context.weaving.LoadTimeWeaverAwareProcessor
Create a new LoadTimeWeaverAwareProcessor for the given LoadTimeWeaver.
LoadTimeWeaverAwareProcessor(BeanFactory) - Constructor for class org.springframework.context.weaving.LoadTimeWeaverAwareProcessor
Create a new LoadTimeWeaverAwareProcessor.
loadView(String, Locale) - Method in class org.springframework.web.servlet.view.AbstractCachingViewResolver
Subclasses must implement this method, building a View object for the specified view.
loadView(String, Locale) - Method in class org.springframework.web.servlet.view.ResourceBundleViewResolver
loadView(String, Locale) - Method in class org.springframework.web.servlet.view.UrlBasedViewResolver
Delegates to buildView for creating a new instance of the specified view class, and applies the following Spring lifecycle methods (as supported by the generic Spring bean factory): ApplicationContextAware's setApplicationContext InitializingBean's afterPropertiesSet
loadView(String, Locale) - Method in class org.springframework.web.servlet.view.XmlViewResolver
LOB_CREATOR_SYNCHRONIZATION_ORDER - Static variable in class org.springframework.jdbc.support.lob.SpringLobCreatorSynchronization
Order value for TransactionSynchronization objects that clean up LobCreators.
LOB_CREATOR_SYNCHRONIZATION_ORDER - Static variable in class org.springframework.orm.ibatis.support.AbstractLobTypeHandler
Order value for TransactionSynchronization objects that clean up LobCreators.
LobCreator - Interface in org.springframework.jdbc.support.lob
Interface that abstracts potentially database-specific creation of large binary fields and large text fields.
LobCreatorUtils - Class in org.springframework.jdbc.support.lob
Helper class for registering a transaction synchronization for closing a LobCreator, preferring Spring transaction synchronization and falling back to plain JTA transaction synchronization.
LobCreatorUtils() - Constructor for class org.springframework.jdbc.support.lob.LobCreatorUtils
LobHandler - Interface in org.springframework.jdbc.support.lob
Abstraction for handling large binary fields and large text fields in specific databases, no matter if represented as simple types or Large OBjects.
LobRetrievalFailureException - Exception in org.springframework.jdbc
Exception to be thrown when a LOB could not be retrieved.
LobRetrievalFailureException(String) - Constructor for exception org.springframework.jdbc.LobRetrievalFailureException
Constructor for LobRetrievalFailureException.
LobRetrievalFailureException(String, IOException) - Constructor for exception org.springframework.jdbc.LobRetrievalFailureException
Constructor for LobRetrievalFailureException.
LOCAL_REF_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
LocalCacheProviderProxy - Class in org.springframework.orm.hibernate3
Proxy for a Hibernate CacheProvider, delegating to a Spring-managed CacheProvider instance, determined by LocalSessionFactoryBean's "cacheProvider" property.
LocalCacheProviderProxy() - Constructor for class org.springframework.orm.hibernate3.LocalCacheProviderProxy
LocalConnectionFactoryBean - Class in org.springframework.jca.support
FactoryBean that creates a local JCA connection factory in "non-managed" mode (as defined by the Java Connector Architecture specification).
LocalConnectionFactoryBean() - Constructor for class org.springframework.jca.support.LocalConnectionFactoryBean
LocalContainerEntityManagerFactoryBean - Class in org.springframework.orm.jpa
FactoryBean that creates a JPA EntityManagerFactory according to JPA's standard container bootstrap contract.
LocalContainerEntityManagerFactoryBean() - Constructor for class org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean
LocalDataSourceConnectionProvider - Class in org.springframework.orm.hibernate3
Hibernate connection provider for local DataSource instances in an application context.
LocalDataSourceConnectionProvider() - Constructor for class org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
LocalDataSourceJobStore - Class in org.springframework.scheduling.quartz
Subclass of Quartz's JobStoreCMT class that delegates to a Spring-managed DataSource instead of using a Quartz-managed connection pool.
LocalDataSourceJobStore() - Constructor for class org.springframework.scheduling.quartz.LocalDataSourceJobStore
LOCALE_REQUEST_ATTRIBUTE_NAME - Static variable in class org.springframework.web.servlet.i18n.CookieLocaleResolver
The name of the request attribute that holds the locale.
LOCALE_RESOLVER_ATTRIBUTE - Static variable in class org.springframework.web.servlet.DispatcherServlet
Request attribute to hold the current LocaleResolver, retrievable by views.
LOCALE_RESOLVER_BEAN_NAME - Static variable in class org.springframework.web.servlet.DispatcherServlet
Well-known name for the LocaleResolver object in the bean factory for this namespace.
LOCALE_SESSION_ATTRIBUTE_NAME - Static variable in class org.springframework.web.servlet.i18n.SessionLocaleResolver
Name of the session attribute that holds the locale.
LocaleChangeInterceptor - Class in org.springframework.web.servlet.i18n
Interceptor that allows for changing the current locale on every request, via a configurable request parameter.
LocaleChangeInterceptor() - Constructor for class org.springframework.web.servlet.i18n.LocaleChangeInterceptor
LocaleContext - Interface in org.springframework.context.i18n
Strategy interface for determining the current Locale.
LocaleContextHolder - Class in org.springframework.context.i18n
Simple holder class that associates a LocaleContext instance with the current thread.
LocaleContextHolder() - Constructor for class org.springframework.context.i18n.LocaleContextHolder
LocaleContextMessageInterpolator - Class in org.springframework.validation.beanvalidation
Delegates to a target MessageInterpolator implementation but enforces Spring's managed Locale.
LocaleContextMessageInterpolator(MessageInterpolator) - Constructor for class org.springframework.validation.beanvalidation.LocaleContextMessageInterpolator
Create a new LocaleContextMessageInterpolator, wrapping the given target interpolator.
LocaleEditor - Class in org.springframework.beans.propertyeditors
Editor for java.util.Locale, to directly populate a Locale property.
LocaleEditor() - Constructor for class org.springframework.beans.propertyeditors.LocaleEditor
LocalEntityManagerFactoryBean - Class in org.springframework.orm.jpa
FactoryBean that creates a JPA EntityManagerFactory according to JPA's standard standalone bootstrap contract.
LocalEntityManagerFactoryBean() - Constructor for class org.springframework.orm.jpa.LocalEntityManagerFactoryBean
LocaleResolver - Interface in org.springframework.web.servlet
Interface for web-based locale resolution strategies that allows for both locale resolution via the request and locale modification via request and response.
LocalizedResourceHelper - Class in org.springframework.core.io.support
Helper class for loading a localized resource, specified through name, extension and current locale.
LocalizedResourceHelper() - Constructor for class org.springframework.core.io.support.LocalizedResourceHelper
Create a new LocalizedResourceHelper with a DefaultResourceLoader.
LocalizedResourceHelper(ResourceLoader) - Constructor for class org.springframework.core.io.support.LocalizedResourceHelper
Create a new LocalizedResourceHelper with the given ResourceLoader.
LocalJaxRpcServiceFactory - Class in org.springframework.remoting.jaxrpc
Deprecated. in favor of JAX-WS support in org.springframework.remoting.jaxws
LocalJaxRpcServiceFactory() - Constructor for class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
Deprecated.
LocalJaxRpcServiceFactoryBean - Class in org.springframework.remoting.jaxrpc
Deprecated. in favor of JAX-WS support in org.springframework.remoting.jaxws
LocalJaxRpcServiceFactoryBean() - Constructor for class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactoryBean
Deprecated.
LocalJaxWsServiceFactory - Class in org.springframework.remoting.jaxws
Factory for locally defined JAX-WS Service references.
LocalJaxWsServiceFactory() - Constructor for class org.springframework.remoting.jaxws.LocalJaxWsServiceFactory
LocalJaxWsServiceFactoryBean - Class in org.springframework.remoting.jaxws
FactoryBean for locally defined JAX-WS Service references.
LocalJaxWsServiceFactoryBean() - Constructor for class org.springframework.remoting.jaxws.LocalJaxWsServiceFactoryBean
LocalJtaDataSourceConnectionProvider - Class in org.springframework.orm.hibernate3
Subclass of LocalDataSourceConnectionProvider that will be used if LocalSessionFactoryBean's "dataSource" property is set in combination with a Hibernate TransactionManagerLookup.
LocalJtaDataSourceConnectionProvider() - Constructor for class org.springframework.orm.hibernate3.LocalJtaDataSourceConnectionProvider
LocalPersistenceManagerFactoryBean - Class in org.springframework.orm.jdo
FactoryBean that creates a JDO PersistenceManagerFactory.
LocalPersistenceManagerFactoryBean() - Constructor for class org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean
LocalRegionFactoryProxy - Class in org.springframework.orm.hibernate3
Proxy for a Hibernate RegionFactory, delegating to a Spring-managed RegionFactory instance, determined by LocalSessionFactoryBean's "cacheRegionFactory" property.
LocalRegionFactoryProxy() - Constructor for class org.springframework.orm.hibernate3.LocalRegionFactoryProxy
Standard constructor.
LocalRegionFactoryProxy(Properties) - Constructor for class org.springframework.orm.hibernate3.LocalRegionFactoryProxy
Properties constructor: not used by this class or formally required, but enforced by Hibernate when reflectively instantiating a RegionFactory.
LocalSessionFactoryBean - Class in org.springframework.orm.hibernate3
FactoryBean that creates a Hibernate SessionFactory.
LocalSessionFactoryBean() - Constructor for class org.springframework.orm.hibernate3.LocalSessionFactoryBean
LocalSlsbInvokerInterceptor - Class in org.springframework.ejb.access
Invoker for a local Stateless Session Bean.
LocalSlsbInvokerInterceptor() - Constructor for class org.springframework.ejb.access.LocalSlsbInvokerInterceptor
LocalStatelessSessionProxyFactoryBean - Class in org.springframework.ejb.access
Convenient FactoryBean for local Stateless Session Bean (SLSB) proxies.
LocalStatelessSessionProxyFactoryBean() - Constructor for class org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean
LocalTaskExecutorThreadPool - Class in org.springframework.scheduling.quartz
Quartz ThreadPool adapter that delegates to a Spring-managed TaskExecutor instance, specified on SchedulerFactoryBean.
LocalTaskExecutorThreadPool() - Constructor for class org.springframework.scheduling.quartz.LocalTaskExecutorThreadPool
LocalTransactionManagerLookup - Class in org.springframework.orm.hibernate3
Implementation of Hibernate's TransactionManagerLookup interface that returns a Spring-managed JTA TransactionManager, determined by LocalSessionFactoryBean's "jtaTransactionManager" property.
LocalTransactionManagerLookup() - Constructor for class org.springframework.orm.hibernate3.LocalTransactionManagerLookup
LocalValidatorFactoryBean - Class in org.springframework.validation.beanvalidation
This is the central class for javax.validation (JSR-303) setup in a Spring application context: It bootstraps a javax.validation.ValidationFactory and exposes it through the Spring Validator interface as well as through the JSR-303 Validator interface and the ValidatorFactory interface itself.
LocalValidatorFactoryBean() - Constructor for class org.springframework.validation.beanvalidation.LocalValidatorFactoryBean
LocalVariableTableParameterNameDiscoverer - Class in org.springframework.core
Implementation of ParameterNameDiscoverer that uses the LocalVariableTable information in the method attributes to discover parameter names.
LocalVariableTableParameterNameDiscoverer() - Constructor for class org.springframework.core.LocalVariableTableParameterNameDiscoverer
locateMBeanServer() - Static method in class org.springframework.jmx.support.JmxUtils
Attempt to find a locally running MBeanServer.
locateMBeanServer(String) - Static method in class org.springframework.jmx.support.JmxUtils
Attempt to find a locally running MBeanServer.
locateMBeanServer(String) - Method in class org.springframework.jmx.support.MBeanServerFactoryBean
Attempt to locate an existing MBeanServer.
locateSource(Map<String, Object>) - Method in class org.springframework.web.servlet.view.xslt.XsltView
Locate the Source object in the supplied model, converting objects as required.
locateToBeMarshalled(Map) - Method in class org.springframework.web.servlet.view.xml.MarshallingView
Locates the object to be marshalled.
Location - Class in org.springframework.beans.factory.parsing
Class that models an arbitrary location in a resource.
Location(Resource) - Constructor for class org.springframework.beans.factory.parsing.Location
Create a new instance of the Location class.
Location(Resource, Object) - Constructor for class org.springframework.beans.factory.parsing.Location
Create a new instance of the Location class.
LOCATOR_FACTORY_KEY_PARAM - Static variable in class org.springframework.web.context.ContextLoader
Optional servlet context parameter (i.e., "parentContextKey") used only when obtaining a parent context using the default implementation of ContextLoader.loadParentContext(ServletContext servletContext).
LOCATOR_FACTORY_SELECTOR_PARAM - Static variable in class org.springframework.web.context.ContextLoader
Optional servlet context parameter (i.e., "locatorFactorySelector") used only when obtaining a parent context using the default implementation of ContextLoader.loadParentContext(ServletContext servletContext).
lock(Object, LockMode) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Obtain the specified lock level upon the given object, implicitly checking whether the corresponding database entry still exists.
lock(String, Object, LockMode) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Obtain the specified lock level upon the given object, implicitly checking whether the corresponding database entry still exists.
lock(Object, LockMode) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
lock(String, Object, LockMode) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
log(String) - Method in class org.springframework.mock.web.MockServletContext
log(Exception, String) - Method in class org.springframework.mock.web.MockServletContext
log(String, Throwable) - Method in class org.springframework.mock.web.MockServletContext
log(String) - Method in class org.springframework.mock.web.portlet.MockPortletContext
log(String, Throwable) - Method in class org.springframework.mock.web.portlet.MockPortletContext
log(String) - Method in class org.springframework.mock.web.portlet.ServletWrappingPortletContext
log(String, Throwable) - Method in class org.springframework.mock.web.portlet.ServletWrappingPortletContext
Log4jConfigListener - Class in org.springframework.web.util
Bootstrap listener for custom log4j initialization in a web environment.
Log4jConfigListener() - Constructor for class org.springframework.web.util.Log4jConfigListener
Log4jConfigurer - Class in org.springframework.util
Convenience class that features simple methods for custom log4j configuration.
Log4jConfigurer() - Constructor for class org.springframework.util.Log4jConfigurer
log4jLogger - Variable in class org.springframework.web.context.request.Log4jNestedDiagnosticContextInterceptor
Logger available to subclasses
log4jLogger - Variable in class org.springframework.web.filter.Log4jNestedDiagnosticContextFilter
Logger available to subclasses
Log4jNestedDiagnosticContextFilter - Class in org.springframework.web.filter
Request logging filter that adds the request log message to the Log4J nested diagnostic context (NDC) before the request is processed, removing it again after the request is processed.
Log4jNestedDiagnosticContextFilter() - Constructor for class org.springframework.web.filter.Log4jNestedDiagnosticContextFilter
Log4jNestedDiagnosticContextInterceptor - Class in org.springframework.web.context.request
Request logging interceptor that adds a request context message to the Log4J nested diagnostic context (NDC) before the request is processed, removing it again after the request is processed.
Log4jNestedDiagnosticContextInterceptor() - Constructor for class org.springframework.web.context.request.Log4jNestedDiagnosticContextInterceptor
Log4jWebConfigurer - Class in org.springframework.web.util
Convenience class that performs custom log4j initialization for web environments, allowing for log file paths within the web application, with the option to perform automatic refresh checks (for runtime changes in logging configuration).
Log4jWebConfigurer() - Constructor for class org.springframework.web.util.Log4jWebConfigurer
LOG_AND_PROPAGATE_ERROR_HANDLER - Static variable in class org.springframework.scheduling.support.TaskUtils
An ErrorHandler strategy that will log at error level and then re-throw the Exception.
LOG_AND_SUPPRESS_ERROR_HANDLER - Static variable in class org.springframework.scheduling.support.TaskUtils
An ErrorHandler strategy that will log the Exception but perform no further handling.
logException(Exception, PortletRequest) - Method in class org.springframework.web.portlet.handler.AbstractHandlerExceptionResolver
Log the given exception at warn level, provided that warn logging has been activated through the "warnLogCategory" property.
logException(Exception, HttpServletRequest) - Method in class org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
Log the given exception at warn level, provided that warn logging has been activated through the "warnLogCategory" property.
logger - Variable in class org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory
Logger available to subclasses
logger - Variable in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
Logger available to subclasses
logger - Variable in class org.springframework.aop.framework.autoproxy.target.AbstractBeanFactoryBasedTargetSourceCreator
logger - Variable in class org.springframework.aop.framework.ProxyFactoryBean
logger - Variable in class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
Logger available to subclasses
logger - Variable in class org.springframework.aop.target.AbstractLazyCreationTargetSource
Logger available to subclasses
logger - Variable in class org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource
Logger available to subclasses
logger - Variable in class org.springframework.beans.factory.access.el.SpringBeanELResolver
Logger available to subclasses
logger - Static variable in class org.springframework.beans.factory.access.SingletonBeanFactoryLocator
logger - Variable in class org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor
logger - Variable in class org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor
logger - Variable in class org.springframework.beans.factory.config.AbstractFactoryBean
Logger available to subclasses
logger - Variable in class org.springframework.beans.factory.config.CustomEditorConfigurer
logger - Variable in class org.springframework.beans.factory.support.AbstractBeanDefinitionReader
Logger available to subclasses
logger - Variable in class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
Logger available to subclasses
logger - Variable in class org.springframework.beans.factory.wiring.BeanConfigurerSupport
Logger available to subclasses
logger - Variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
logger - Variable in class org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader
logger - Variable in class org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver
Logger available to subclasses
logger - Variable in class org.springframework.beans.support.PropertyComparator
logger - Variable in class org.springframework.cache.ehcache.EhCacheFactoryBean
logger - Variable in class org.springframework.cache.ehcache.EhCacheManagerFactoryBean
logger - Variable in class org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider
logger - Variable in class org.springframework.context.support.AbstractApplicationContext
Logger used by this class.
logger - Variable in class org.springframework.context.support.ApplicationObjectSupport
Logger that is available to subclasses
logger - Variable in class org.springframework.context.support.MessageSourceSupport
Logger available to subclasses
logger - Variable in class org.springframework.context.weaving.DefaultContextLoadTimeWeaver
logger - Variable in class org.springframework.core.enums.AbstractCachingLabeledEnumResolver
Deprecated.
logger - Variable in class org.springframework.core.io.support.PropertiesLoaderSupport
Logger available to subclasses
logger - Variable in class org.springframework.dao.support.DaoSupport
Logger available to subclasses
logger - Variable in class org.springframework.ejb.support.AbstractMessageDrivenBean
Logger available to subclasses
logger - Variable in class org.springframework.ejb.support.AbstractStatelessSessionBean
Logger available to subclasses
logger - Variable in class org.springframework.http.client.support.HttpAccessor
Logger available to subclasses.
logger - Variable in class org.springframework.http.converter.AbstractHttpMessageConverter
Logger available to subclasses
logger - Variable in class org.springframework.jca.cci.connection.SingleConnectionFactory
logger - Variable in class org.springframework.jca.context.SpringContextResourceAdapter
logger - Variable in class org.springframework.jca.endpoint.AbstractMessageEndpointFactory
Logger available to subclasses
logger - Variable in class org.springframework.jdbc.core.BeanPropertyRowMapper
Logger available to subclasses
logger - Variable in class org.springframework.jdbc.core.metadata.CallMetaDataContext
Logger available to subclasses
logger - Static variable in class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
Logger available to subclasses
logger - Static variable in class org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
Logger available to subclasses
logger - Variable in class org.springframework.jdbc.core.metadata.TableMetaDataContext
Logger available to subclasses
logger - Variable in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Logger available to subclasses
logger - Variable in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Logger available to subclasses
logger - Variable in class org.springframework.jdbc.datasource.AbstractDataSource
Logger available to subclasses
logger - Variable in class org.springframework.jdbc.datasource.WebSphereDataSourceAdapter
logger - Variable in class org.springframework.jdbc.object.RdbmsOperation
Logger available to subclasses
logger - Variable in class org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator
Logger available to subclasses
logger - Variable in class org.springframework.jdbc.support.DatabaseStartupValidator
logger - Variable in class org.springframework.jdbc.support.JdbcAccessor
Logger available to subclasses
logger - Variable in class org.springframework.jdbc.support.lob.DefaultLobHandler
logger - Variable in class org.springframework.jdbc.support.lob.OracleLobHandler
logger - Variable in class org.springframework.jms.connection.SingleConnectionFactory
logger - Variable in class org.springframework.jms.core.support.JmsGatewaySupport
Logger available to subclasses
logger - Variable in class org.springframework.jms.listener.adapter.MessageListenerAdapter
Logger available to subclasses
logger - Variable in class org.springframework.jms.listener.endpoint.DefaultJmsActivationSpecFactory
Logger available to subclasses
logger - Variable in class org.springframework.jms.support.JmsAccessor
Logger available to subclasses
logger - Variable in class org.springframework.jmx.access.MBeanClientInterceptor
Logger available to subclasses
logger - Variable in class org.springframework.jmx.access.NotificationListenerRegistrar
Logger available to subclasses
logger - Variable in class org.springframework.jmx.export.naming.KeyNamingStrategy
Log instance for this class.
logger - Variable in class org.springframework.jmx.support.MBeanRegistrationSupport
Log instance for this class.
logger - Variable in class org.springframework.jmx.support.MBeanServerFactoryBean
logger - Variable in class org.springframework.jndi.JndiAccessor
Logger, available to subclasses.
logger - Variable in class org.springframework.jndi.JndiTemplate
logger - Variable in class org.springframework.orm.hibernate3.AbstractSessionFactoryBean
Logger available to subclasses
logger - Variable in class org.springframework.orm.hibernate3.HibernateAccessor
Logger available to subclasses
logger - Variable in class org.springframework.orm.hibernate3.support.AbstractLobType
logger - Variable in class org.springframework.orm.jdo.DefaultJdoDialect
logger - Variable in class org.springframework.orm.jdo.JdoAccessor
Logger available to subclasses
logger - Variable in class org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean
logger - Variable in class org.springframework.orm.jdo.support.OpenPersistenceManagerInViewInterceptor
logger - Variable in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
Logger available to subclasses
logger - Variable in class org.springframework.orm.jpa.EntityManagerFactoryAccessor
Logger available to subclasses
logger - Variable in class org.springframework.oxm.jaxb.Jaxb2Marshaller
Logger available to subclasses.
logger - Variable in class org.springframework.oxm.support.AbstractMarshaller
Logger available to subclasses.
logger - Variable in class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
logger - Variable in class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
Deprecated. Logger available to subclasses
logger - Variable in class org.springframework.remoting.jaxrpc.ServletEndpointSupport
Deprecated.
logger - Variable in class org.springframework.remoting.jaxws.SimpleHttpServerJaxWsServiceExporter
logger - Variable in class org.springframework.remoting.rmi.RmiRegistryFactoryBean
logger - Static variable in class org.springframework.remoting.support.RemoteInvocationTraceInterceptor
logger - Variable in class org.springframework.remoting.support.RemotingSupport
Logger available to subclasses
logger - Variable in class org.springframework.remoting.support.SimpleHttpServerFactoryBean
logger - Variable in class org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor
logger - Variable in class org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
logger - Variable in class org.springframework.scheduling.quartz.LocalTaskExecutorThreadPool
Logger available to subclasses
logger - Static variable in class org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean.MethodInvokingJob
logger - Static variable in class org.springframework.scheduling.quartz.ResourceLoaderClassLoadHelper
logger - Variable in class org.springframework.scheduling.quartz.SchedulerAccessor
logger - Variable in class org.springframework.scheduling.support.MethodInvokingRunnable
logger - Variable in class org.springframework.scheduling.timer.TimerFactoryBean
Deprecated.
logger - Variable in class org.springframework.scheduling.timer.TimerTaskExecutor
Deprecated.
logger - Variable in class org.springframework.scripting.support.ResourceScriptSource
Logger available to subclasses
logger - Variable in class org.springframework.scripting.support.ScriptFactoryPostProcessor
Logger available to subclasses
logger - Variable in class org.springframework.test.ConditionalTestCase
Deprecated. Logger available to subclasses
logger - Variable in class org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests
Logger available to subclasses.
logger - Variable in class org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests
Logger available to subclasses.
logger - Static variable in class org.springframework.test.context.junit4.statements.SpringRepeat
logger - Static variable in class org.springframework.test.context.support.AbstractGenericContextLoader
logger - Variable in class org.springframework.test.context.testng.AbstractTestNGSpringContextTests
Logger available to subclasses
logger - Variable in class org.springframework.transaction.interceptor.AbstractFallbackTransactionAttributeSource
Logger available to subclasses.
logger - Variable in class org.springframework.transaction.interceptor.MethodMapTransactionAttributeSource
Logger available to subclasses
logger - Static variable in class org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource
Logger available to subclasses.
logger - Variable in class org.springframework.transaction.interceptor.TransactionAspectSupport
logger - Static variable in class org.springframework.transaction.jta.SpringJtaSynchronizationAdapter
logger - Variable in class org.springframework.transaction.support.AbstractPlatformTransactionManager
logger - Variable in class org.springframework.transaction.support.TransactionTemplate
Logger available to subclasses
logger - Variable in class org.springframework.ui.context.support.ResourceBundleThemeSource
logger - Variable in class org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
logger - Variable in class org.springframework.ui.freemarker.SpringTemplateLoader
logger - Variable in class org.springframework.ui.velocity.SpringResourceLoader
logger - Variable in class org.springframework.ui.velocity.VelocityEngineFactory
logger - Variable in class org.springframework.util.ConcurrencyThrottleSupport
Transient to optimize serialization
logger - Static variable in class org.springframework.validation.DataBinder
We'll create a lot of DataBinder instances: Let's use a static logger.
logger - Variable in class org.springframework.web.client.support.RestGatewaySupport
Logger available to subclasses
logger - Variable in class org.springframework.web.context.support.ServletContextAttributeExporter
logger - Variable in class org.springframework.web.filter.GenericFilterBean
Logger available to subclasses
logger - Variable in class org.springframework.web.jsf.DelegatingVariableResolver
Logger available to subclasses
logger - Variable in class org.springframework.web.jsf.el.WebApplicationContextFacesELResolver
Logger available to subclasses
logger - Variable in class org.springframework.web.multipart.commons.CommonsFileUploadSupport
logger - Static variable in class org.springframework.web.multipart.commons.CommonsMultipartFile
logger - Variable in class org.springframework.web.portlet.GenericPortletBean
Logger available to subclasses
logger - Variable in class org.springframework.web.portlet.handler.AbstractHandlerExceptionResolver
Logger available to subclasses
logger - Variable in class org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
Logger available to subclasses
logger - Variable in class org.springframework.web.servlet.HttpServletBean
Logger available to subclasses
logger - Variable in class org.springframework.web.servlet.mvc.multiaction.AbstractUrlMethodNameResolver
Logger available to subclasses
logger - Variable in class org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver
logger - Variable in class org.springframework.web.servlet.tags.RequestContextAwareTag
Logger available to subclasses
logger - Variable in class org.springframework.web.servlet.view.tiles2.TilesConfigurer
logger - Variable in class org.springframework.web.struts.ContextLoaderPlugIn
Deprecated.
logger - Variable in class org.springframework.web.util.CookieGenerator
logRejectedTask(Object, RuntimeException) - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Log a task that has been rejected by AbstractJmsListeningContainer.doRescheduleTask(java.lang.Object).
logVelocityMessage(int, String) - Method in class org.springframework.ui.velocity.CommonsLoggingLogSystem
LongLiteral - Class in org.springframework.expression.spel.ast
Expression language AST node that represents a long integer literal.
longResult(Collection) - Static method in class org.springframework.dao.support.DataAccessUtils
Return a unique long result from the given Collection.
lookup() - Method in class org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor
This overridden lookup implementation performs a narrow operation after the JNDI lookup, provided that a home interface is specified.
lookup(String) - Method in class org.springframework.jndi.JndiLocatorDelegate
lookup(String, Class<T>) - Method in class org.springframework.jndi.JndiLocatorDelegate
lookup(String) - Method in class org.springframework.jndi.JndiLocatorSupport
Perform an actual JNDI lookup for the given name via the JndiTemplate.
lookup(String, Class<T>) - Method in class org.springframework.jndi.JndiLocatorSupport
Perform an actual JNDI lookup for the given name via the JndiTemplate.
lookup() - Method in class org.springframework.jndi.JndiObjectLocator
Perform the actual JNDI lookup for this locator's target resource.
lookup(String) - Method in class org.springframework.jndi.JndiTemplate
Look up the object with the given name in the current JNDI context.
lookup(String, Class<T>) - Method in class org.springframework.jndi.JndiTemplate
Look up the object with the given name in the current JNDI context.
lookup(String) - Method in class org.springframework.mock.jndi.ExpectedLookupTemplate
If the name is the expected name specified in the constructor, return the object provided in the constructor.
lookup(String) - Method in class org.springframework.mock.jndi.SimpleNamingContext
Look up the object with the given name.
lookup(Name) - Method in class org.springframework.mock.jndi.SimpleNamingContext
lookup(String, Class<T>) - Method in class org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
Perform a JNDI lookup for the given resource by name.
LOOKUP_METHOD_ELEMENT - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
lookupCacheSeconds(String) - Method in class org.springframework.web.servlet.mvc.WebContentInterceptor
Look up a cache seconds value for the given URL path.
lookupColumnName(ResultSetMetaData, int) - Static method in class org.springframework.jdbc.support.JdbcUtils
Determine the column name to use.
lookupDefaultUowManager() - Method in class org.springframework.transaction.jta.WebSphereUowTransactionManager
Obtain the WebSphere UOWManager from the default JNDI location "java:comp/websphere/UOWManager".
LookupDispatchActionSupport - Class in org.springframework.web.struts
Deprecated. as of Spring 3.0
LookupDispatchActionSupport() - Constructor for class org.springframework.web.struts.LookupDispatchActionSupport
Deprecated.
lookupEntityManagerFactory(HttpServletRequest) - Method in class org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter
Look up the EntityManagerFactory that this filter should use, taking the current HTTP request as argument.
lookupEntityManagerFactory() - Method in class org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter
Look up the EntityManagerFactory that this filter should use.
lookupHandler(String, HttpServletRequest) - Method in class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
Look up a handler instance for the given URL path.
lookupLink(String) - Method in class org.springframework.mock.jndi.SimpleNamingContext
lookupLink(Name) - Method in class org.springframework.mock.jndi.SimpleNamingContext
lookupLocalVariable(String) - Method in class org.springframework.expression.spel.ExpressionState
lookupMultipartResolver(HttpServletRequest) - Method in class org.springframework.web.multipart.support.MultipartFilter
Look up the MultipartResolver that this filter should use, taking the current HTTP request as argument.
lookupMultipartResolver() - Method in class org.springframework.web.multipart.support.MultipartFilter
Look for a MultipartResolver bean in the root web application context.
LookupOverride - Class in org.springframework.beans.factory.support
Represents an override of a method that looks up an object in the same IoC context.
LookupOverride(String, String) - Constructor for class org.springframework.beans.factory.support.LookupOverride
Construct a new LookupOverride.
lookupPersistenceManagerFactory(HttpServletRequest) - Method in class org.springframework.orm.jdo.support.OpenPersistenceManagerInViewFilter
Look up the PersistenceManagerFactory that this filter should use, taking the current HTTP request as argument.
lookupPersistenceManagerFactory() - Method in class org.springframework.orm.jdo.support.OpenPersistenceManagerInViewFilter
Look up the PersistenceManagerFactory that this filter should use.
lookupSessionFactory(HttpServletRequest) - Method in class org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
Look up the SessionFactory that this filter should use, taking the current HTTP request as argument.
lookupSessionFactory() - Method in class org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
Look up the SessionFactory that this filter should use.
lookupStub() - Method in class org.springframework.remoting.rmi.JndiRmiClientInterceptor
Create the RMI stub, typically by looking it up.
lookupStub() - Method in class org.springframework.remoting.rmi.RmiClientInterceptor
Create the RMI stub, typically by looking it up.
lookupTransactionManager(String) - Method in class org.springframework.transaction.jta.JtaTransactionManager
Look up the JTA TransactionManager in JNDI via the configured name.
lookupTransactionSynchronizationRegistry(String) - Method in class org.springframework.transaction.jta.JtaTransactionManager
Look up the JTA 1.1 TransactionSynchronizationRegistry in JNDI via the configured name.
lookupType - Variable in class org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.LookupElement
lookupUowManager(String) - Method in class org.springframework.transaction.jta.WebSphereUowTransactionManager
Look up the WebSphere UOWManager in JNDI via the configured name.
lookupUserTransaction(String) - Method in class org.springframework.transaction.jta.JtaTransactionManager
Look up the JTA UserTransaction in JNDI via the configured name.
lookupVariable(String) - Method in interface org.springframework.expression.EvaluationContext
Look up a named variable within this evaluation context.
lookupVariable(String) - Method in class org.springframework.expression.spel.ExpressionState
lookupVariable(String) - Method in class org.springframework.expression.spel.support.StandardEvaluationContext
lookupWithFallback() - Method in class org.springframework.jndi.JndiObjectFactoryBean
Lookup variant that that returns the specified "defaultObject" (if any) in case of lookup failure.
LOWEST_PRECEDENCE - Static variable in interface org.springframework.core.Ordered
Useful constant for the lowest precedence value.
Overview Package Class Tree Deprecated Index Help
A B C D E F G H I J K L M N O P Q R S T U V W X


M-Index

PREV LETTER NEXT LETTER FRAMES NO FRAMES
A B C D E F G H I J K L M N O P Q R S T U V W X

M

MailAuthenticationException - Exception in org.springframework.mail
Exception thrown on failed authentication.
MailAuthenticationException(String) - Constructor for exception org.springframework.mail.MailAuthenticationException
Constructor for MailAuthenticationException.
MailAuthenticationException(String, Throwable) - Constructor for exception org.springframework.mail.MailAuthenticationException
Constructor for MailAuthenticationException.
MailAuthenticationException(Throwable) - Constructor for exception org.springframework.mail.MailAuthenticationException
Constructor for MailAuthenticationException.
MailException - Exception in org.springframework.mail
Base class for all mail exceptions.
MailException(String) - Constructor for exception org.springframework.mail.MailException
Constructor for MailException.
MailException(String, Throwable) - Constructor for exception org.springframework.mail.MailException
Constructor for MailException.
MailMessage - Interface in org.springframework.mail
This is a common interface for mail messages, allowing a user to set key values required in assembling a mail message, without needing to know if the underlying message is a simple text message or a more sophisticated MIME message.
MailParseException - Exception in org.springframework.mail
Exception thrown if illegal message properties are encountered.
MailParseException(String) - Constructor for exception org.springframework.mail.MailParseException
Constructor for MailParseException.
MailParseException(String, Throwable) - Constructor for exception org.springframework.mail.MailParseException
Constructor for MailParseException.
MailParseException(Throwable) - Constructor for exception org.springframework.mail.MailParseException
Constructor for MailParseException.
MailPreparationException - Exception in org.springframework.mail
Exception to be thrown by user code if a mail cannot be prepared properly, for example when a Velocity template cannot be rendered for the mail text.
MailPreparationException(String) - Constructor for exception org.springframework.mail.MailPreparationException
Constructor for MailPreparationException.
MailPreparationException(String, Throwable) - Constructor for exception org.springframework.mail.MailPreparationException
Constructor for MailPreparationException.
MailPreparationException(Throwable) - Constructor for exception org.springframework.mail.MailPreparationException
MailSender - Interface in org.springframework.mail
This interface defines a strategy for sending simple mails.
MailSendException - Exception in org.springframework.mail
Exception thrown when a mail sending error is encountered.
MailSendException(String) - Constructor for exception org.springframework.mail.MailSendException
Constructor for MailSendException.
MailSendException(String, Throwable) - Constructor for exception org.springframework.mail.MailSendException
Constructor for MailSendException.
MailSendException(Map<Object, Exception>) - Constructor for exception org.springframework.mail.MailSendException
Constructor for registration of failed messages, with the messages that failed as keys, and the thrown exceptions as values.
makeAccessible(Field) - Static method in class org.springframework.util.ReflectionUtils
Make the given field accessible, explicitly setting it accessible if necessary.
makeAccessible(Method) - Static method in class org.springframework.util.ReflectionUtils
Make the given method accessible, explicitly setting it accessible if necessary.
makeAccessible(Constructor<?>) - Static method in class org.springframework.util.ReflectionUtils
Make the given constructor accessible, explicitly setting it accessible if necessary.
makeAdvisorChainAspectJCapableIfNecessary(List<Advisor>) - Static method in class org.springframework.aop.aspectj.AspectJProxyUtils
Add special advisors if necessary to work with a proxy chain that contains AspectJ advisors.
makeObject() - Method in class org.springframework.aop.target.CommonsPoolTargetSource
makePersistent(T) - Method in interface org.springframework.orm.jdo.JdoOperations
Make the given transient instance persistent.
makePersistent(T) - Method in class org.springframework.orm.jdo.JdoTemplate
makePersistentAll(Collection<T>) - Method in interface org.springframework.orm.jdo.JdoOperations
Make the given transient instances persistent.
makePersistentAll(Collection<T>) - Method in class org.springframework.orm.jdo.JdoTemplate
ManagedArray - Class in org.springframework.beans.factory.support
Tag collection class used to hold managed array elements, which may include runtime bean references (to be resolved into bean objects).
ManagedArray(String, int) - Constructor for class org.springframework.beans.factory.support.ManagedArray
Create a new managed array placeholder.
ManagedAttribute - Annotation Type in org.springframework.jmx.export.annotation
JDK 1.5+ method-level annotation that indicates to expose a given bean property as JMX attribute, corresponding to the ManagedAttribute attribute.
ManagedAttribute - Class in org.springframework.jmx.export.metadata
Metadata that indicates to expose a given bean property as JMX attribute.
ManagedAttribute() - Constructor for class org.springframework.jmx.export.metadata.ManagedAttribute
ManagedList<E> - Class in org.springframework.beans.factory.support
Tag collection class used to hold managed List elements, which may include runtime bean references (to be resolved into bean objects).
ManagedList() - Constructor for class org.springframework.beans.factory.support.ManagedList
ManagedList(int) - Constructor for class org.springframework.beans.factory.support.ManagedList
ManagedMap<K,V> - Class in org.springframework.beans.factory.support
Tag collection class used to hold managed Map values, which may include runtime bean references (to be resolved into bean objects).
ManagedMap() - Constructor for class org.springframework.beans.factory.support.ManagedMap
ManagedMap(int) - Constructor for class org.springframework.beans.factory.support.ManagedMap
ManagedMetric - Annotation Type in org.springframework.jmx.export.annotation
JDK 1.5+ method-level annotation that indicates to expose a given bean property as JMX attribute, with added Descriptor properties to indicate that it is a metric.
ManagedMetric - Class in org.springframework.jmx.export.metadata
Metadata that indicates to expose a given bean property as a JMX attribute, with additional descriptor properties that indicate that the attribute is a metric.
ManagedMetric() - Constructor for class org.springframework.jmx.export.metadata.ManagedMetric
ManagedNotification - Annotation Type in org.springframework.jmx.export.annotation
JDK 1.5+ method-level annotation that indicates a JMX notification emitted by a bean.
ManagedNotification - Class in org.springframework.jmx.export.metadata
Metadata that indicates a JMX notification emitted by a bean.
ManagedNotification() - Constructor for class org.springframework.jmx.export.metadata.ManagedNotification
ManagedNotifications - Annotation Type in org.springframework.jmx.export.annotation
JDK 1.5+ method-level annotation that indicates JMX notifications emitted by a bean, containing multiple ManagedNotifications
ManagedOperation - Annotation Type in org.springframework.jmx.export.annotation
JDK 1.5+ method-level annotation that indicates to expose a given method as JMX operation, corresponding to the ManagedOperation attribute.
ManagedOperation - Class in org.springframework.jmx.export.metadata
Metadata that indicates to expose a given method as JMX operation.
ManagedOperation() - Constructor for class org.springframework.jmx.export.metadata.ManagedOperation
ManagedOperationParameter - Annotation Type in org.springframework.jmx.export.annotation
JDK 1.5+ method-level annotation used to provide metadata about operation parameters, corresponding to a ManagedOperationParameter attribute.
ManagedOperationParameter - Class in org.springframework.jmx.export.metadata
Metadata about JMX operation parameters.
ManagedOperationParameter() - Constructor for class org.springframework.jmx.export.metadata.ManagedOperationParameter
ManagedOperationParameters - Annotation Type in org.springframework.jmx.export.annotation
JDK 1.5+ method-level annotation used to provide metadata about operation parameters, corresponding to an array of ManagedOperationParameter attributes.
ManagedProperties - Class in org.springframework.beans.factory.support
Tag class which represents a Spring-managed Properties instance that supports merging of parent/child definitions.
ManagedProperties() - Constructor for class org.springframework.beans.factory.support.ManagedProperties
ManagedResource - Annotation Type in org.springframework.jmx.export.annotation
JDK 1.5+ class-level annotation that indicates to register instances of a class with a JMX server, corresponding to the ManagedResource attribute.
ManagedResource - Class in org.springframework.jmx.export.metadata
Metadata indicating that instances of an annotated class are to be registered with a JMX server.
ManagedResource() - Constructor for class org.springframework.jmx.export.metadata.ManagedResource
ManagedSet<E> - Class in org.springframework.beans.factory.support
Tag collection class used to hold managed Set values, which may include runtime bean references (to be resolved into bean objects).
ManagedSet() - Constructor for class org.springframework.beans.factory.support.ManagedSet
ManagedSet(int) - Constructor for class org.springframework.beans.factory.support.ManagedSet
ManagedTransactionAdapter - Class in org.springframework.transaction.jta
Adapter for a managed JTA Transaction handle, taking a JTA TransactionManager reference and creating a JTA Transaction handle for it.
ManagedTransactionAdapter(TransactionManager) - Constructor for class org.springframework.transaction.jta.ManagedTransactionAdapter
Create a new ManagedTransactionAdapter for the given TransactionManager.
MAP_ELEMENT - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
MapAccessor - Class in org.springframework.context.expression
EL property accessor that knows how to traverse the keys of a standard Map.
MapAccessor() - Constructor for class org.springframework.context.expression.MapAccessor
MapBindingResult - Class in org.springframework.validation
Map-based implementation of the BindingResult interface, supporting registration and evaluation of binding errors on Map attributes.
MapBindingResult(Map, String) - Constructor for class org.springframework.validation.MapBindingResult
Create a new MapBindingResult instance.
MapDataSourceLookup - Class in org.springframework.jdbc.datasource.lookup
Simple DataSourceLookup implementation that relies on a map for doing lookups.
MapDataSourceLookup() - Constructor for class org.springframework.jdbc.datasource.lookup.MapDataSourceLookup
Create a new instance of the MapDataSourceLookup class.
MapDataSourceLookup(Map<String, DataSource>) - Constructor for class org.springframework.jdbc.datasource.lookup.MapDataSourceLookup
Create a new instance of the MapDataSourceLookup class.
MapDataSourceLookup(String, DataSource) - Constructor for class org.springframework.jdbc.datasource.lookup.MapDataSourceLookup
Create a new instance of the MapDataSourceLookup class.
MapFactoryBean - Class in org.springframework.beans.factory.config
Simple factory for shared Map instances.
MapFactoryBean() - Constructor for class org.springframework.beans.factory.config.MapFactoryBean
MappedInterceptor - Class in org.springframework.web.servlet.handler
Holds information about a HandlerInterceptor mapped to a path into the application.
MappedInterceptor(String[], HandlerInterceptor) - Constructor for class org.springframework.web.servlet.handler.MappedInterceptor
Create a new mapped interceptor.
MappedInterceptor(String[], WebRequestInterceptor) - Constructor for class org.springframework.web.servlet.handler.MappedInterceptor
Create a new mapped interceptor.
mappedName - Variable in class org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.LookupElement
mappedObjectNames - Variable in class org.springframework.jmx.support.NotificationListenerHolder
Mapping - Annotation Type in org.springframework.web.bind.annotation
Meta annotation that indicates a web mapping annotation.
MappingCommAreaOperation - Class in org.springframework.jca.cci.object
EIS operation object for access to COMMAREA records.
MappingCommAreaOperation() - Constructor for class org.springframework.jca.cci.object.MappingCommAreaOperation
Create a new MappingCommAreaQuery.
MappingCommAreaOperation(ConnectionFactory, InteractionSpec) - Constructor for class org.springframework.jca.cci.object.MappingCommAreaOperation
Create a new MappingCommAreaQuery.
MappingDispatchActionSupport - Class in org.springframework.web.struts
Deprecated. as of Spring 3.0
MappingDispatchActionSupport() - Constructor for class org.springframework.web.struts.MappingDispatchActionSupport
Deprecated.
MappingJacksonHttpMessageConverter - Class in org.springframework.http.converter.json
Implementation of HttpMessageConverter that can read and write JSON using Jackson's ObjectMapper.
MappingJacksonHttpMessageConverter() - Constructor for class org.springframework.http.converter.json.MappingJacksonHttpMessageConverter
Construct a new BindingJacksonHttpMessageConverter.
MappingJacksonJsonView - Class in org.springframework.web.servlet.view.json
Spring-MVC View that renders JSON content by serializing the model for the current request using Jackson's ObjectMapper.
MappingJacksonJsonView() - Constructor for class org.springframework.web.servlet.view.json.MappingJacksonJsonView
Construct a new JacksonJsonView, setting the content type to application/json.
MappingRecordOperation - Class in org.springframework.jca.cci.object
EIS operation object that expects mapped input and output objects, converting to and from CCI Records.
MappingRecordOperation() - Constructor for class org.springframework.jca.cci.object.MappingRecordOperation
Constructor that allows use as a JavaBean.
MappingRecordOperation(ConnectionFactory, InteractionSpec) - Constructor for class org.springframework.jca.cci.object.MappingRecordOperation
Convenient constructor with ConnectionFactory and specifications (connection and interaction).
MappingRecordOperation.RecordCreatorImpl - Class in org.springframework.jca.cci.object
Implementation of RecordCreator that calls the enclosing class's createInputRecord method.
MappingRecordOperation.RecordCreatorImpl(Object) - Constructor for class org.springframework.jca.cci.object.MappingRecordOperation.RecordCreatorImpl
MappingRecordOperation.RecordExtractorImpl - Class in org.springframework.jca.cci.object
Implementation of RecordExtractor that calls the enclosing class's extractOutputData method.
MappingRecordOperation.RecordExtractorImpl() - Constructor for class org.springframework.jca.cci.object.MappingRecordOperation.RecordExtractorImpl
MappingSqlQuery<T> - Class in org.springframework.jdbc.object
Reusable query in which concrete subclasses must implement the abstract mapRow(ResultSet, int) method to convert each row of the JDBC ResultSet into an object.
MappingSqlQuery() - Constructor for class org.springframework.jdbc.object.MappingSqlQuery
Constructor that allows use as a JavaBean.
MappingSqlQuery(DataSource, String) - Constructor for class org.springframework.jdbc.object.MappingSqlQuery
Convenient constructor with DataSource and SQL string.
MappingSqlQueryWithParameters<T> - Class in org.springframework.jdbc.object
Reusable RDBMS query in which concrete subclasses must implement the abstract mapRow(ResultSet, int) method to map each row of the JDBC ResultSet into an object.
MappingSqlQueryWithParameters() - Constructor for class org.springframework.jdbc.object.MappingSqlQueryWithParameters
Constructor to allow use as a JavaBean
MappingSqlQueryWithParameters(DataSource, String) - Constructor for class org.springframework.jdbc.object.MappingSqlQueryWithParameters
Convenient constructor with DataSource and SQL string.
MappingSqlQueryWithParameters.RowMapperImpl - Class in org.springframework.jdbc.object
Implementation of RowMapper that calls the enclosing class's mapRow method for each row.
MappingSqlQueryWithParameters.RowMapperImpl(Object[], Map) - Constructor for class org.springframework.jdbc.object.MappingSqlQueryWithParameters.RowMapperImpl
Use an array results.
mapRow(ResultSet, int) - Method in class org.springframework.jdbc.core.BeanPropertyRowMapper
Extract the values for all columns in the current row.
mapRow(ResultSet, int) - Method in class org.springframework.jdbc.core.ColumnMapRowMapper
mapRow(ResultSet, int) - Method in interface org.springframework.jdbc.core.RowMapper
Implementations must implement this method to map each row of data in the ResultSet.
mapRow(ResultSet, int) - Method in class org.springframework.jdbc.core.SingleColumnRowMapper
Extract a value for the single column in the current row.
mapRow(ResultSet, int, Object[], Map) - Method in class org.springframework.jdbc.object.MappingSqlQuery
This method is implemented to invoke the simpler mapRow template method, ignoring parameters.
mapRow(ResultSet, int) - Method in class org.springframework.jdbc.object.MappingSqlQuery
Subclasses must implement this method to convert each row of the ResultSet into an object of the result type.
mapRow(ResultSet, int, Object[], Map) - Method in class org.springframework.jdbc.object.MappingSqlQueryWithParameters
Subclasses must implement this method to convert each row of the ResultSet into an object of the result type.
mapRow(ResultSet, int) - Method in class org.springframework.jdbc.object.MappingSqlQueryWithParameters.RowMapperImpl
mapRow(ResultSet, int) - Method in class org.springframework.jdbc.object.SqlFunction
This implementation of this method extracts a single value from the single row returned by the function.
mapRow(ResultSet, int) - Method in class org.springframework.jdbc.object.UpdatableSqlQuery.RowMapperImpl
MapSqlParameterSource - Class in org.springframework.jdbc.core.namedparam
SqlParameterSource implementation that holds a given Map of parameters.
MapSqlParameterSource() - Constructor for class org.springframework.jdbc.core.namedparam.MapSqlParameterSource
Create an empty MapSqlParameterSource, with values to be added via addValue.
MapSqlParameterSource(String, Object) - Constructor for class org.springframework.jdbc.core.namedparam.MapSqlParameterSource
Create a new MapSqlParameterSource, with one value comprised of the supplied arguments.
MapSqlParameterSource(Map<String, ?>) - Constructor for class org.springframework.jdbc.core.namedparam.MapSqlParameterSource
Create a new MapSqlParameterSource based on a Map.
markApplicationContextDirty() - Method in class org.springframework.test.context.TestContext
Call this method to signal that the application context associated with this test context is dirty and should be reloaded.
markBeanAsCreated(String) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Mark the specified bean as already created (or about to be created).
marshal(Object, Result) - Method in class org.springframework.oxm.jaxb.Jaxb2Marshaller
marshal(Object, Result, MimeContainer) - Method in class org.springframework.oxm.jaxb.Jaxb2Marshaller
marshal(Object, Result) - Method in interface org.springframework.oxm.Marshaller
Marshals the object graph with the given root into the provided Result.
marshal(Object, Result, MimeContainer) - Method in interface org.springframework.oxm.mime.MimeMarshaller
Marshals the object graph with the given root into the provided Result, writing binary data to a MimeContainer.
marshal(Object, Result) - Method in class org.springframework.oxm.support.AbstractMarshaller
Marshals the object graph with the given root into the provided javax.xml.transform.Result.
marshalDomNode(Object, Node) - Method in class org.springframework.oxm.castor.CastorMarshaller
marshalDomNode(Object, Node) - Method in class org.springframework.oxm.jibx.JibxMarshaller
marshalDomNode(Object, Node) - Method in class org.springframework.oxm.support.AbstractMarshaller
Abstract template method for marshalling the given object graph to a DOM Node.
marshalDomNode(Object, Node) - Method in class org.springframework.oxm.xmlbeans.XmlBeansMarshaller
marshalDomNode(Object, Node) - Method in class org.springframework.oxm.xstream.XStreamMarshaller
marshalDomResult(Object, DOMResult) - Method in class org.springframework.oxm.support.AbstractMarshaller
Template method for handling DOMResults.
Marshaller - Interface in org.springframework.oxm
Defines the contract for Object XML Mapping Marshallers.
MarshallingException - Exception in org.springframework.oxm
Base class for exception thrown when a marshalling or unmarshalling error occurs.
MarshallingException(String) - Constructor for exception org.springframework.oxm.MarshallingException
Construct a MarshallingException with the specified detail message.
MarshallingException(String, Throwable) - Constructor for exception org.springframework.oxm.MarshallingException
Construct a MarshallingException with the specified detail message and nested exception.
MarshallingFailureException - Exception in org.springframework.oxm
Exception thrown on marshalling failure.
MarshallingFailureException(String) - Constructor for exception org.springframework.oxm.MarshallingFailureException
Construct a MarshallingFailureException with the specified detail message.
MarshallingFailureException(String, Throwable) - Constructor for exception org.springframework.oxm.MarshallingFailureException
Construct a MarshallingFailureException with the specified detail message and nested exception.
MarshallingHttpMessageConverter - Class in org.springframework.http.converter.xml
Implementation of HttpMessageConverter that can read and write XML using Spring's Marshaller and Unmarshaller abstractions.
MarshallingHttpMessageConverter() - Constructor for class org.springframework.http.converter.xml.MarshallingHttpMessageConverter
Construct a new MarshallingHttpMessageConverter with no Marshaller or Unmarshaller set.
MarshallingHttpMessageConverter(Marshaller) - Constructor for class org.springframework.http.converter.xml.MarshallingHttpMessageConverter
Construct a new MarshallingMessageConverter with the given Marshaller set.
MarshallingHttpMessageConverter(Marshaller, Unmarshaller) - Constructor for class org.springframework.http.converter.xml.MarshallingHttpMessageConverter
Construct a new MarshallingMessageConverter with the given Marshaller and Unmarshaller.
MarshallingMessageConverter - Class in org.springframework.jms.support.converter
Spring JMS MessageConverter that uses a Marshaller and Unmarshaller.
MarshallingMessageConverter() - Constructor for class org.springframework.jms.support.converter.MarshallingMessageConverter
Construct a new MarshallingMessageConverter with no Marshaller or Unmarshaller set.
MarshallingMessageConverter(Marshaller) - Constructor for class org.springframework.jms.support.converter.MarshallingMessageConverter
Construct a new MarshallingMessageConverter with the given Marshaller set.
MarshallingMessageConverter(Marshaller, Unmarshaller) - Constructor for class org.springframework.jms.support.converter.MarshallingMessageConverter
Construct a new MarshallingMessageConverter with the given Marshaller and Unmarshaller.
MarshallingSource - Class in org.springframework.oxm.support
Source implementation that uses a Marshaller.Can be constructed with a Marshaller and an object to be marshalled.
MarshallingSource(Marshaller, Object) - Constructor for class org.springframework.oxm.support.MarshallingSource
Create a new MarshallingSource with the given marshaller and content.
MarshallingView - Class in org.springframework.web.servlet.view.xml
Spring-MVC View that allows for response context to be rendered as the result of marshalling by a Marshaller.
MarshallingView() - Constructor for class org.springframework.web.servlet.view.xml.MarshallingView
Constructs a new MarshallingView with no Marshaller set.
MarshallingView(Marshaller) - Constructor for class org.springframework.web.servlet.view.xml.MarshallingView
Constructs a new MarshallingView with the given Marshaller set.
marshalOutputStream(Object, OutputStream) - Method in class org.springframework.oxm.castor.CastorMarshaller
marshalOutputStream(Object, OutputStream) - Method in class org.springframework.oxm.jibx.JibxMarshaller
marshalOutputStream(Object, OutputStream) - Method in class org.springframework.oxm.support.AbstractMarshaller
Abstract template method for marshalling the given object graph to a OutputStream.
marshalOutputStream(Object, OutputStream) - Method in class org.springframework.oxm.xmlbeans.XmlBeansMarshaller
marshalOutputStream(Object, OutputStream) - Method in class org.springframework.oxm.xstream.XStreamMarshaller
marshalSaxHandlers(Object, ContentHandler, LexicalHandler) - Method in class org.springframework.oxm.castor.CastorMarshaller
marshalSaxHandlers(Object, ContentHandler, LexicalHandler) - Method in class org.springframework.oxm.jibx.JibxMarshaller
marshalSaxHandlers(Object, ContentHandler, LexicalHandler) - Method in class org.springframework.oxm.support.AbstractMarshaller
Abstract template method for marshalling the given object graph to a SAX ContentHandler.
marshalSaxHandlers(Object, ContentHandler, LexicalHandler) - Method in class org.springframework.oxm.xmlbeans.XmlBeansMarshaller
marshalSaxHandlers(Object, ContentHandler, LexicalHandler) - Method in class org.springframework.oxm.xstream.XStreamMarshaller
marshalSaxResult(Object, SAXResult) - Method in class org.springframework.oxm.support.AbstractMarshaller
Template method for handling SAXResults.
marshalStaxResult(Object, Result) - Method in class org.springframework.oxm.support.AbstractMarshaller
Template method for handling StaxResults.
marshalStreamResult(Object, StreamResult) - Method in class org.springframework.oxm.support.AbstractMarshaller
Template method for handling StreamResults.
marshalToBytesMessage(Object, Session, Marshaller) - Method in class org.springframework.jms.support.converter.MarshallingMessageConverter
Marshal the given object to a BytesMessage.
marshalToMessage(Object, Session, Marshaller, MessageType) - Method in class org.springframework.jms.support.converter.MarshallingMessageConverter
Template method that allows for custom message marshalling.
marshalToTextMessage(Object, Session, Marshaller) - Method in class org.springframework.jms.support.converter.MarshallingMessageConverter
Marshal the given object to a TextMessage.
marshalWriter(Object, Writer) - Method in class org.springframework.oxm.castor.CastorMarshaller
marshalWriter(Object, Writer) - Method in class org.springframework.oxm.jibx.JibxMarshaller
marshalWriter(Object, Writer) - Method in class org.springframework.oxm.support.AbstractMarshaller
Abstract template method for marshalling the given object graph to a Writer.
marshalWriter(Object, Writer) - Method in class org.springframework.oxm.xmlbeans.XmlBeansMarshaller
marshalWriter(Object, Writer) - Method in class org.springframework.oxm.xstream.XStreamMarshaller
marshalXmlEventWriter(Object, XMLEventWriter) - Method in class org.springframework.oxm.castor.CastorMarshaller
marshalXmlEventWriter(Object, XMLEventWriter) - Method in class org.springframework.oxm.jibx.JibxMarshaller
marshalXmlEventWriter(Object, XMLEventWriter) - Method in class org.springframework.oxm.support.AbstractMarshaller
Abstract template method for marshalling the given object to a StAX XMLEventWriter.
marshalXmlEventWriter(Object, XMLEventWriter) - Method in class org.springframework.oxm.xmlbeans.XmlBeansMarshaller
marshalXmlEventWriter(Object, XMLEventWriter) - Method in class org.springframework.oxm.xstream.XStreamMarshaller
marshalXmlStreamWriter(Object, XMLStreamWriter) - Method in class org.springframework.oxm.castor.CastorMarshaller
marshalXmlStreamWriter(Object, XMLStreamWriter) - Method in class org.springframework.oxm.jibx.JibxMarshaller
marshalXmlStreamWriter(Object, XMLStreamWriter) - Method in class org.springframework.oxm.support.AbstractMarshaller
Abstract template method for marshalling the given object to a StAX XMLStreamWriter.
marshalXmlStreamWriter(Object, XMLStreamWriter) - Method in class org.springframework.oxm.xmlbeans.XmlBeansMarshaller
marshalXmlStreamWriter(Object, XMLStreamWriter) - Method in class org.springframework.oxm.xstream.XStreamMarshaller
match(MetadataReader, MetadataReaderFactory) - Method in class org.springframework.core.type.filter.AbstractClassTestingTypeFilter
match(ClassMetadata) - Method in class org.springframework.core.type.filter.AbstractClassTestingTypeFilter
Determine a match based on the given ClassMetadata object.
match(MetadataReader, MetadataReaderFactory) - Method in class org.springframework.core.type.filter.AbstractTypeHierarchyTraversingFilter
match(MetadataReader, MetadataReaderFactory) - Method in class org.springframework.core.type.filter.AspectJTypeFilter
match(ClassMetadata) - Method in class org.springframework.core.type.filter.RegexPatternTypeFilter
match(MetadataReader, MetadataReaderFactory) - Method in interface org.springframework.core.type.filter.TypeFilter
Determine whether this filter matches for the class described by the given metadata.
match(String, String) - Method in class org.springframework.util.AntPathMatcher
match(String, String) - Method in interface org.springframework.util.PathMatcher
Match the given path against the given pattern, according to this PathMatcher's matching strategy.
match(PortletRequest) - Method in interface org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping.PortletRequestMappingPredicate
Determine whether the given request matches this predicate.
match(String) - Method in class org.springframework.web.util.UriTemplate
Match the given URI to a map of variable values.
MatchAlwaysTransactionAttributeSource - Class in org.springframework.transaction.interceptor
Very simple implementation of TransactionAttributeSource which will always return the same TransactionAttribute for all methods fed to it.
MatchAlwaysTransactionAttributeSource() - Constructor for class org.springframework.transaction.interceptor.MatchAlwaysTransactionAttributeSource
matchClassName(String) - Method in class org.springframework.core.type.filter.AbstractTypeHierarchyTraversingFilter
Override this to match on type name.
matchClassName(String) - Method in class org.springframework.core.type.filter.AssignableTypeFilter
matches(Class) - Method in class org.springframework.aop.aspectj.AspectJExpressionPointcut
matches(Method, Class, boolean) - Method in class org.springframework.aop.aspectj.AspectJExpressionPointcut
matches(Method, Class) - Method in class org.springframework.aop.aspectj.AspectJExpressionPointcut
matches(Method, Class, Object[]) - Method in class org.springframework.aop.aspectj.AspectJExpressionPointcut
matches(Class) - Method in class org.springframework.aop.aspectj.TypePatternClassFilter
Should the pointcut apply to the given interface or target class?
matches(Class<?>) - Method in interface org.springframework.aop.ClassFilter
Should the pointcut apply to the given interface or target class?
matches(Method, Class, boolean) - Method in interface org.springframework.aop.IntroductionAwareMethodMatcher
Perform static checking whether the given method matches.
matches(Method, Class<?>) - Method in interface org.springframework.aop.MethodMatcher
Perform static checking whether the given method matches.
matches(Method, Class<?>, Object[]) - Method in interface org.springframework.aop.MethodMatcher
Check whether there a runtime (dynamic) match for this method, which must have matched statically.
matches(Method, Class) - Method in class org.springframework.aop.support.AbstractRegexpMethodPointcut
Try to match the regular expression against the fully qualified name of the target class as well as against the method's declaring class, plus the name of the method.
matches(String, int) - Method in class org.springframework.aop.support.AbstractRegexpMethodPointcut
Does the pattern at the given index match this string?
matches(Class) - Method in class org.springframework.aop.support.annotation.AnnotationClassFilter
matches(Method, Class) - Method in class org.springframework.aop.support.annotation.AnnotationMethodMatcher
matches(Class) - Method in class org.springframework.aop.support.ControlFlowPointcut
Subclasses can override this for greater filtering (and performance).
matches(Method, Class) - Method in class org.springframework.aop.support.ControlFlowPointcut
Subclasses can override this if it's possible to filter out some candidate classes.
matches(Method, Class, Object[]) - Method in class org.springframework.aop.support.ControlFlowPointcut
matches(Class) - Method in class org.springframework.aop.support.DefaultIntroductionAdvisor
matches(Method, Class<?>) - Method in class org.springframework.aop.support.DynamicMethodMatcher
Can override to add preconditions for dynamic matching.
matches(String, int) - Method in class org.springframework.aop.support.JdkRegexpMethodPointcut
Returns true if the Pattern at index patternIndex matches the supplied candidate String.
matches(MethodMatcher, Method, Class, boolean) - Static method in class org.springframework.aop.support.MethodMatchers
Apply the given MethodMatcher to the given Method, supporting an IntroductionAwareMethodMatcher (if applicable).
matches(Method, Class) - Method in class org.springframework.aop.support.NameMatchMethodPointcut
matches(Pointcut, Method, Class, Object[]) - Static method in class org.springframework.aop.support.Pointcuts
Perform the least expensive check for a pointcut match.
matches(Class) - Method in class org.springframework.aop.support.RootClassFilter
matches(Method, Class<?>, Object[]) - Method in class org.springframework.aop.support.StaticMethodMatcher
matches(Method) - Method in class org.springframework.beans.factory.support.LookupOverride
Match method of the given name, with no parameters.
matches(Method) - Method in class org.springframework.beans.factory.support.MethodOverride
Subclasses must override this to indicate whether they match the given method.
matches(Method) - Method in class org.springframework.beans.factory.support.ReplaceOverride
matches(TypeDescriptor, TypeDescriptor) - Method in interface org.springframework.core.convert.converter.ConditionalGenericConverter
Should the converter from sourceType to targetType currently under consideration be selected?
matches(Field) - Method in interface org.springframework.util.ReflectionUtils.FieldFilter
Determine whether the given field matches.
matches(Method) - Method in interface org.springframework.util.ReflectionUtils.MethodFilter
Determine whether the given method matches.
matches(String) - Method in class org.springframework.web.util.UriTemplate
Indicate whether the given URI matches this template.
matchesBeanName(String, String) - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
Determine whether the given candidate name matches the bean name or the aliases stored in this bean definition.
matchesExclusion(String, int) - Method in class org.springframework.aop.support.AbstractRegexpMethodPointcut
Does the exclusion pattern at the given index match this string?
matchesExclusion(String, int) - Method in class org.springframework.aop.support.JdkRegexpMethodPointcut
Returns true if the exclusion Pattern at index patternIndex matches the supplied candidate String.
matchesName(String) - Method in class org.springframework.beans.factory.config.BeanDefinitionHolder
Determine whether the given candidate name matches the bean name or the aliases stored in this bean definition.
matchesPattern(String) - Method in class org.springframework.aop.support.AbstractRegexpMethodPointcut
Match the specified candidate against the configured patterns.
matchesProperty(String, String) - Static method in class org.springframework.beans.PropertyAccessorUtils
Determine whether the given registered path matches the given property path, either indicating the property itself or an indexed element of the property.
matchesTypeName(Class<?>, String) - Static method in class org.springframework.util.ClassUtils
Check whether the given class matches the user-specified type name.
matchInParameterValuesWithCallParameters(SqlParameterSource) - Method in class org.springframework.jdbc.core.metadata.CallMetaDataContext
Match input parameter values with the parameters declared to be used in the call.
matchInParameterValuesWithCallParameters(Map<String, ?>) - Method in class org.springframework.jdbc.core.metadata.CallMetaDataContext
Match input parameter values with the parameters declared to be used in the call.
matchInParameterValuesWithCallParameters(Object[]) - Method in class org.springframework.jdbc.core.metadata.CallMetaDataContext
matchInParameterValuesWithCallParameters(SqlParameterSource) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Match the provided in parameter values with registered parameters and parameters defined via metadata processing.
matchInParameterValuesWithCallParameters(Map<String, ?>) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Match the provided in parameter values with registered parameters and parameters defined via metadata processing.
matchInParameterValuesWithInsertColumns(SqlParameterSource) - Method in class org.springframework.jdbc.core.metadata.TableMetaDataContext
Match the provided column names and values with the list of columns used.
matchInParameterValuesWithInsertColumns(Map<String, Object>) - Method in class org.springframework.jdbc.core.metadata.TableMetaDataContext
Match the provided column names and values with the list of columns used.
matchInParameterValuesWithInsertColumns(SqlParameterSource) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Match the provided in parameter values with regitered parameters and parameters defined via metedata processing.
matchInParameterValuesWithInsertColumns(Map<String, Object>) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Match the provided in parameter values with regitered parameters and parameters defined via metedata processing.
matchInterface(String) - Method in class org.springframework.core.type.filter.AbstractTypeHierarchyTraversingFilter
Override this to match on interface type name.
matchInterface(String) - Method in class org.springframework.core.type.filter.AssignableTypeFilter
matchSelf(MetadataReader) - Method in class org.springframework.core.type.filter.AbstractTypeHierarchyTraversingFilter
Override this to match self characteristics alone.
matchSelf(MetadataReader) - Method in class org.springframework.core.type.filter.AnnotationTypeFilter
matchStart(String, String) - Method in class org.springframework.util.AntPathMatcher
matchStart(String, String) - Method in interface org.springframework.util.PathMatcher
Match the given path against the corresponding part of the given pattern, according to this PathMatcher's matching strategy.
matchSuperClass(String) - Method in class org.springframework.core.type.filter.AbstractTypeHierarchyTraversingFilter
Override this to match on super type name.
matchSuperClass(String) - Method in class org.springframework.core.type.filter.AnnotationTypeFilter
matchSuperClass(String) - Method in class org.springframework.core.type.filter.AssignableTypeFilter
matchTargetType(String) - Method in class org.springframework.core.type.filter.AssignableTypeFilter
MAXLENGTH_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.InputTag
MaxUploadSizeExceededException - Exception in org.springframework.web.multipart
MultipartException subclass thrown when an upload exceeds the maximum upload size allowed.
MaxUploadSizeExceededException(long) - Constructor for exception org.springframework.web.multipart.MaxUploadSizeExceededException
Constructor for MaxUploadSizeExceededException.
MaxUploadSizeExceededException(long, Throwable) - Constructor for exception org.springframework.web.multipart.MaxUploadSizeExceededException
Constructor for MaxUploadSizeExceededException.
MBeanClientInterceptor - Class in org.springframework.jmx.access
MethodInterceptor that routes calls to an MBean running on the supplied MBeanServerConnection.
MBeanClientInterceptor() - Constructor for class org.springframework.jmx.access.MBeanClientInterceptor
MBeanConnectFailureException - Exception in org.springframework.jmx.access
Thrown when an invocation failed because of an I/O problem on the MBeanServerConnection.
MBeanConnectFailureException(String, Throwable) - Constructor for exception org.springframework.jmx.access.MBeanConnectFailureException
Create a new MBeanConnectFailureException with the specified error message and root cause.
MBeanExporter - Class in org.springframework.jmx.export
JMX exporter that allows for exposing any Spring-managed bean to a JMX MBeanServer, without the need to define any JMX-specific information in the bean classes.
MBeanExporter() - Constructor for class org.springframework.jmx.export.MBeanExporter
MBeanExporterListener - Interface in org.springframework.jmx.export
A listener that allows application code to be notified when an MBean is registered and unregistered via an MBeanExporter.
MBeanExportException - Exception in org.springframework.jmx.export
Exception thrown in case of failure when exporting an MBean.
MBeanExportException(String) - Constructor for exception org.springframework.jmx.export.MBeanExportException
Create a new MBeanExportException with the specified error message.
MBeanExportException(String, Throwable) - Constructor for exception org.springframework.jmx.export.MBeanExportException
Create a new MBeanExportException with the specified error message and root cause.
MBeanExportOperations - Interface in org.springframework.jmx.export
Interface that defines the set of MBean export operations that are intended to be accessed by application developers during application runtime.
MBeanInfoAssembler - Interface in org.springframework.jmx.export.assembler
Interface to be implemented by all classes that can create management interface metadata for a managed resource.
MBeanInfoRetrievalException - Exception in org.springframework.jmx.access
Thrown if an exception is encountered when trying to retrieve MBean metadata.
MBeanInfoRetrievalException(String) - Constructor for exception org.springframework.jmx.access.MBeanInfoRetrievalException
Create a new MBeanInfoRetrievalException with the specified error message.
MBeanInfoRetrievalException(String, Throwable) - Constructor for exception org.springframework.jmx.access.MBeanInfoRetrievalException
Create a new MBeanInfoRetrievalException with the specified error message and root cause.
MBeanProxyFactoryBean - Class in org.springframework.jmx.access
Creates a proxy to a managed resource running either locally or remotely.
MBeanProxyFactoryBean() - Constructor for class org.springframework.jmx.access.MBeanProxyFactoryBean
mbeanRegistered(ObjectName) - Method in interface org.springframework.jmx.export.MBeanExporterListener
Called by MBeanExporter after an MBean has been successfully registered with an MBeanServer.
MBeanRegistrationSupport - Class in org.springframework.jmx.support
Provides supporting infrastructure for registering MBeans with an MBeanServer.
MBeanRegistrationSupport() - Constructor for class org.springframework.jmx.support.MBeanRegistrationSupport
MBeanServerConnectionFactoryBean - Class in org.springframework.jmx.support
FactoryBean that creates a JMX 1.2 MBeanServerConnection to a remote MBeanServer exposed via a JMXServerConnector.
MBeanServerConnectionFactoryBean() - Constructor for class org.springframework.jmx.support.MBeanServerConnectionFactoryBean
MBeanServerFactoryBean - Class in org.springframework.jmx.support
FactoryBean that obtains an MBeanServer reference through the standard JMX 1.2 MBeanServerFactory API (which is available on JDK 1.5 or as part of a JMX 1.2 provider).
MBeanServerFactoryBean() - Constructor for class org.springframework.jmx.support.MBeanServerFactoryBean
MBeanServerNotFoundException - Exception in org.springframework.jmx
Exception thrown when we cannot locate an instance of an MBeanServer, or when more than one instance is found.
MBeanServerNotFoundException(String) - Constructor for exception org.springframework.jmx.MBeanServerNotFoundException
Create a new MBeanServerNotFoundException with the supplied error message.
MBeanServerNotFoundException(String, Throwable) - Constructor for exception org.springframework.jmx.MBeanServerNotFoundException
Create a new MBeanServerNotFoundException with the specified error message and root cause.
mbeanUnregistered(ObjectName) - Method in interface org.springframework.jmx.export.MBeanExporterListener
Called by MBeanExporter after an MBean has been successfully unregistered from an MBeanServer.
md5Digest(byte[]) - Static method in class org.springframework.util.DigestUtils
Calculate the MD5 digest of the given bytes.
md5DigestAsHex(byte[]) - Static method in class org.springframework.util.DigestUtils
Return a hexadecimal string representation of the MD5 digest of the given bytes.
MediaType - Class in org.springframework.http
Represents an Internet Media Type, as defined in the HTTP specification.
MediaType(String) - Constructor for class org.springframework.http.MediaType
Create a new MediaType for the given primary type.
MediaType(String, String) - Constructor for class org.springframework.http.MediaType
Create a new MediaType for the given primary type and subtype.
MediaType(String, String, Charset) - Constructor for class org.springframework.http.MediaType
Create a new MediaType for the given type, subtype, and character set.
MediaType(String, String, double) - Constructor for class org.springframework.http.MediaType
Create a new MediaType for the given type, subtype, and quality value.
MediaType(MediaType, Map<String, String>) - Constructor for class org.springframework.http.MediaType
Copy-constructor that copies the type and subtype of the given MediaType, and allows for different parameter.
MediaType(String, String, Map<String, String>) - Constructor for class org.springframework.http.MediaType
Create a new MediaType for the given type, subtype, and parameters.
MediaTypeEditor - Class in org.springframework.http
Editor for MediaType descriptors, to automatically convert String specifications (e.g.
MediaTypeEditor() - Constructor for class org.springframework.http.MediaTypeEditor
member - Variable in class org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement
merge(Object) - Method in class org.springframework.beans.factory.support.ManagedList
merge(Object) - Method in class org.springframework.beans.factory.support.ManagedMap
merge(Object) - Method in class org.springframework.beans.factory.support.ManagedProperties
merge(Object) - Method in class org.springframework.beans.factory.support.ManagedSet
merge(Object) - Method in interface org.springframework.beans.Mergeable
Merge the current value set with that of the supplied object.
merge(T) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Copy the state of the given object onto the persistent object with the same identifier.
merge(String, T) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Copy the state of the given object onto the persistent object with the same identifier.
merge(T) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
merge(String, T) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
merge(T) - Method in interface org.springframework.orm.jpa.JpaOperations
merge(T) - Method in class org.springframework.orm.jpa.JpaTemplate
MERGE_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Mergeable - Interface in org.springframework.beans
Interface representing an object whose value set can be merged with that of a parent object.
mergeArrayIntoCollection(Object, Collection) - Static method in class org.springframework.util.CollectionUtils
Merge the given array into the given Collection.
mergeAttributes(Map<String, ?>) - Method in class org.springframework.ui.ExtendedModelMap
mergeAttributes(Map<String, ?>) - Method in interface org.springframework.ui.Model
Copy all attributes in the supplied Map into this Map, with existing objects of the same name taking precedence (i.e.
mergeAttributes(Map<String, ?>) - Method in class org.springframework.ui.ModelMap
Copy all attributes in the supplied Map into this Map, with existing objects of the same name taking precedence (i.e.
MergedBeanDefinitionPostProcessor - Interface in org.springframework.beans.factory.support
Post-processor callback interface for merged bean definitions at runtime.
mergePdfDocument(Map<String, Object>, PdfStamper, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.document.AbstractPdfStamperView
Subclasses must implement this method to merge the PDF form with the given model data.
mergeProperties() - Method in class org.springframework.core.io.support.PropertiesLoaderSupport
Return a merged Properties instance containing both the loaded properties and properties set on this FactoryBean.
mergePropertiesIntoMap(Properties, Map) - Static method in class org.springframework.util.CollectionUtils
Merge the given Properties instance into the given Map, copying all properties (key-value pairs) over.
mergeStringArrays(String[], String[]) - Static method in class org.springframework.util.StringUtils
Merge the given String arrays into one, with overlapping array elements only included once.
mergeTemplate(VelocityEngine, String, Map, Writer) - Static method in class org.springframework.ui.velocity.VelocityEngineUtils
Merge the specified Velocity template with the given model and write the result to the given Writer.
mergeTemplate(VelocityEngine, String, String, Map, Writer) - Static method in class org.springframework.ui.velocity.VelocityEngineUtils
Merge the specified Velocity template with the given model and write the result to the given Writer.
mergeTemplate(Template, Context, HttpServletResponse) - Method in class org.springframework.web.servlet.view.velocity.VelocityView
Merge the template with the context.
mergeTemplateIntoString(VelocityEngine, String, Map) - Static method in class org.springframework.ui.velocity.VelocityEngineUtils
Merge the specified Velocity template with the given model into a String.
mergeTemplateIntoString(VelocityEngine, String, String, Map) - Static method in class org.springframework.ui.velocity.VelocityEngineUtils
Merge the specified Velocity template with the given model into a String.
MESSAGE_SOURCE_BEAN_NAME - Static variable in class org.springframework.context.support.AbstractApplicationContext
Name of the MessageSource bean in the factory.
MessageCodesResolver - Interface in org.springframework.validation
Strategy interface for building message codes from validation error codes.
MessageConversionException - Exception in org.springframework.jms.support.converter
Thrown by MessageConverter implementations when the conversion of an object to/from a Message fails.
MessageConversionException(String) - Constructor for exception org.springframework.jms.support.converter.MessageConversionException
Create a new MessageConversionException.
MessageConversionException(String, Throwable) - Constructor for exception org.springframework.jms.support.converter.MessageConversionException
Create a new MessageConversionException.
MessageConverter - Interface in org.springframework.jms.support.converter
Strategy interface that specifies a converter between Java objects and JMS messages.
MessageCreator - Interface in org.springframework.jms.core
Creates a JMS message given a Session.
MessageEOFException - Exception in org.springframework.jms
Runtime exception mirroring the JMS MessageEOFException.
MessageEOFException(MessageEOFException) - Constructor for exception org.springframework.jms.MessageEOFException
MessageFormatException - Exception in org.springframework.jms
Runtime exception mirroring the JMS MessageFormatException.
MessageFormatException(MessageFormatException) - Constructor for exception org.springframework.jms.MessageFormatException
MessageListenerAdapter - Class in org.springframework.jms.listener.adapter
Message listener adapter that delegates the handling of messages to target listener methods via reflection, with flexible message type conversion.
MessageListenerAdapter() - Constructor for class org.springframework.jms.listener.adapter.MessageListenerAdapter
Create a new MessageListenerAdapter with default settings.
MessageListenerAdapter(Object) - Constructor for class org.springframework.jms.listener.adapter.MessageListenerAdapter
Create a new MessageListenerAdapter for the given delegate.
MessageListenerAdapter102 - Class in org.springframework.jms.listener.adapter
Deprecated. as of Spring 3.0, in favor of the JMS 1.1 based MessageListenerAdapter
MessageListenerAdapter102() - Constructor for class org.springframework.jms.listener.adapter.MessageListenerAdapter102
Deprecated. Create a new instance of the MessageListenerAdapter102 class with the default settings.
MessageListenerAdapter102(Object) - Constructor for class org.springframework.jms.listener.adapter.MessageListenerAdapter102
Deprecated. Create a new instance of the MessageListenerAdapter102 class for the given delegate.
MessageNotReadableException - Exception in org.springframework.jms
Runtime exception mirroring the JMS MessageNotReadableException.
MessageNotReadableException(MessageNotReadableException) - Constructor for exception org.springframework.jms.MessageNotReadableException
MessageNotWriteableException - Exception in org.springframework.jms
Runtime exception mirroring the JMS MessageNotWriteableException.
MessageNotWriteableException(MessageNotWriteableException) - Constructor for exception org.springframework.jms.MessageNotWriteableException
MessagePostProcessor - Interface in org.springframework.jms.core
To be used with JmsTemplate's send method that convert an object to a message.
messageReceived(Object, Session) - Method in class org.springframework.jms.listener.AbstractPollingMessageListenerContainer
Template method that gets called right when a new message has been received, before attempting to process it.
messageReceived(Object, Session) - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Tries scheduling a new invoker, since we know messages are coming in...
MESSAGES_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.ErrorsTag
The key under which this tag exposes error messages in the page context scope.
MessageSource - Interface in org.springframework.context
Strategy interface for resolving messages, with support for the parameterization and internationalization of such messages.
MessageSourceAccessor - Class in org.springframework.context.support
Helper class for easy access to messages from a MessageSource, providing various overloaded getMessage methods.
MessageSourceAccessor(MessageSource) - Constructor for class org.springframework.context.support.MessageSourceAccessor
Create a new MessageSourceAccessor, using LocaleContextHolder's locale as default locale.
MessageSourceAccessor(MessageSource, Locale) - Constructor for class org.springframework.context.support.MessageSourceAccessor
Create a new MessageSourceAccessor, using the given default locale.
MessageSourceAware - Interface in org.springframework.context
Interface to be implemented by any object that wishes to be notified of the MessageSource (typically the ApplicationContext) that it runs in.
MessageSourceResolvable - Interface in org.springframework.context
Interface for objects that are suitable for message resolution in a MessageSource.
MessageSourceResourceBundle - Class in org.springframework.context.support
Helper class that allows for accessing a Spring MessageSource as a ResourceBundle.
MessageSourceResourceBundle(MessageSource, Locale) - Constructor for class org.springframework.context.support.MessageSourceResourceBundle
Create a new MessageSourceResourceBundle for the given MessageSource and Locale.
MessageSourceResourceBundle(MessageSource, Locale, ResourceBundle) - Constructor for class org.springframework.context.support.MessageSourceResourceBundle
Create a new MessageSourceResourceBundle for the given MessageSource and Locale.
MessageSourceSupport - Class in org.springframework.context.support
Base class for message source implementations, providing support infrastructure such as MessageFormat handling but not implementing concrete methods defined in the MessageSource.
MessageSourceSupport() - Constructor for class org.springframework.context.support.MessageSourceSupport
MessageTag - Class in org.springframework.web.servlet.tags
Custom JSP tag to look up a message in the scope of this page.
MessageTag() - Constructor for class org.springframework.web.servlet.tags.MessageTag
MessageType - Enum in org.springframework.jms.support.converter
Constants that indicate a target message type to convert to: a TextMessage, a BytesMessage, a MapMessage or an ObjectMessage.
META_ELEMENT - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
MetaDataAccessException - Exception in org.springframework.jdbc.support
Exception indicating that something went wrong during JDBC metadata lookup.
MetaDataAccessException(String) - Constructor for exception org.springframework.jdbc.support.MetaDataAccessException
Constructor for MetaDataAccessException.
MetaDataAccessException(String, Throwable) - Constructor for exception org.springframework.jdbc.support.MetaDataAccessException
Constructor for MetaDataAccessException.
MetadataAwareAspectInstanceFactory - Interface in org.springframework.aop.aspectj.annotation
Subinterface of AspectInstanceFactory that returns AspectMetadata associated with AspectJ-annotated classes.
metaDataCatalogNameToUse(String) - Method in interface org.springframework.jdbc.core.metadata.CallMetaDataProvider
Provide any modification of the catalog name passed in to match the meta data currently used.
metaDataCatalogNameToUse(String) - Method in class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
metaDataCatalogNameToUse(String) - Method in class org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
metaDataCatalogNameToUse(String) - Method in class org.springframework.jdbc.core.metadata.OracleCallMetaDataProvider
metaDataCatalogNameToUse(String) - Method in interface org.springframework.jdbc.core.metadata.TableMetaDataProvider
Provide any modification of the catalog name passed in to match the meta data currently used.
MetadataMBeanInfoAssembler - Class in org.springframework.jmx.export.assembler
Implementation of the MBeanInfoAssembler interface that reads the management interface information from source level metadata.
MetadataMBeanInfoAssembler() - Constructor for class org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler
Create a new MetadataMBeanInfoAssembler which needs to be configured through the MetadataMBeanInfoAssembler.setAttributeSource(org.springframework.jmx.export.metadata.JmxAttributeSource) method.
MetadataMBeanInfoAssembler(JmxAttributeSource) - Constructor for class org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler
Create a new MetadataMBeanInfoAssembler for the given JmxAttributeSource.
MetadataNamingStrategy - Class in org.springframework.jmx.export.naming
An implementation of the ObjectNamingStrategy interface that reads the ObjectName from the source-level metadata.
MetadataNamingStrategy() - Constructor for class org.springframework.jmx.export.naming.MetadataNamingStrategy
Create a new MetadataNamingStrategy which needs to be configured through the MetadataNamingStrategy.setAttributeSource(org.springframework.jmx.export.metadata.JmxAttributeSource) method.
MetadataNamingStrategy(JmxAttributeSource) - Constructor for class org.springframework.jmx.export.naming.MetadataNamingStrategy
Create a new MetadataNamingStrategy for the given JmxAttributeSource.
MetadataReader - Interface in org.springframework.core.type.classreading
Simple facade for accessing class metadata, as read by an ASM org.springframework.asm.ClassReader.
MetadataReaderFactory - Interface in org.springframework.core.type.classreading
Factory interface for MetadataReader instances.
metaDataSchemaNameToUse(String) - Method in interface org.springframework.jdbc.core.metadata.CallMetaDataProvider
Provide any modification of the schema name passed in to match the meta data currently used.
metaDataSchemaNameToUse(String) - Method in class org.springframework.jdbc.core.metadata.Db2CallMetaDataProvider

metaDataSchemaNameToUse(String) - Method in class org.springframework.jdbc.core.metadata.DerbyCallMetaDataProvider

metaDataSchemaNameToUse(String) - Method in class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider

metaDataSchemaNameToUse(String) - Method in class org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider

metaDataSchemaNameToUse(String) - Method in class org.springframework.jdbc.core.metadata.OracleCallMetaDataProvider

metaDataSchemaNameToUse(String) - Method in class org.springframework.jdbc.core.metadata.PostgresCallMetaDataProvider

metaDataSchemaNameToUse(String) - Method in interface org.springframework.jdbc.core.metadata.TableMetaDataProvider
Provide any modification of the schema name passed in to match the meta data currently used.
method - Variable in class org.springframework.aop.framework.ReflectiveMethodInvocation

METHOD_GET - Static variable in class org.springframework.web.servlet.support.WebContentGenerator
HTTP method "GET"
METHOD_HEAD - Static variable in class org.springframework.web.servlet.support.WebContentGenerator
HTTP method "HEAD"
METHOD_POST - Static variable in class org.springframework.web.servlet.support.WebContentGenerator
HTTP method "POST"
MethodBeforeAdvice - Interface in org.springframework.aop
Advice invoked before a method is invoked.
MethodBeforeAdviceInterceptor - Class in org.springframework.aop.framework.adapter
Interceptor to wrap am MethodBeforeAdvice.
MethodBeforeAdviceInterceptor(MethodBeforeAdvice) - Constructor for class org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor
Create a new MethodBeforeAdviceInterceptor for the given advice.
methodBlock(FrameworkMethod) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
Augments the default JUnit behavior with potential repeats of the entire execution chain.
MethodExclusionMBeanInfoAssembler - Class in org.springframework.jmx.export.assembler
AbstractReflectiveMBeanInfoAssembler subclass that allows method names to be explicitly excluded as MBean operations and attributes.
MethodExclusionMBeanInfoAssembler() - Constructor for class org.springframework.jmx.export.assembler.MethodExclusionMBeanInfoAssembler

MethodExecutor - Interface in org.springframework.expression
MethodExecutors are built by the resolvers and can be cached by the infrastructure to repeat an operation quickly without going back to the resolvers.
MethodFilter - Interface in org.springframework.expression
MethodFilter instances allow SpEL users to fine tune the behaviour of the method resolution process.
methodIdentification(Method) - Method in class org.springframework.transaction.interceptor.TransactionAspectSupport
Convenience method to return a String representation of this Method for use in logging.
MethodInvocationException - Exception in org.springframework.beans
Thrown when a bean property getter or setter method throws an exception, analogous to an InvocationTargetException.
MethodInvocationException(PropertyChangeEvent, Throwable) - Constructor for exception org.springframework.beans.MethodInvocationException
Create a new MethodInvocationException.
MethodInvocationProceedingJoinPoint - Class in org.springframework.aop.aspectj
Implementation of AspectJ ProceedingJoinPoint interface wrapping an AOP Alliance MethodInvocation.
MethodInvocationProceedingJoinPoint(ProxyMethodInvocation) - Constructor for class org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint
Create a new MethodInvocationProceedingJoinPoint, wrapping the given Spring ProxyMethodInvocation object.
MethodInvoker - Class in org.springframework.util
Helper class that allows for specifying a method to invoke in a declarative fashion, be it static or non-static.
MethodInvoker() - Constructor for class org.springframework.util.MethodInvoker

MethodInvokingFactoryBean - Class in org.springframework.beans.factory.config
FactoryBean which returns a value which is the result of a static or instance method invocation.
MethodInvokingFactoryBean() - Constructor for class org.springframework.beans.factory.config.MethodInvokingFactoryBean

MethodInvokingJobDetailFactoryBean - Class in org.springframework.scheduling.quartz
FactoryBean that exposes a JobDetail object which delegates job execution to a specified (static or non-static) method.
MethodInvokingJobDetailFactoryBean() - Constructor for class org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean

MethodInvokingJobDetailFactoryBean.MethodInvokingJob - Class in org.springframework.scheduling.quartz
Quartz Job implementation that invokes a specified method.
MethodInvokingJobDetailFactoryBean.MethodInvokingJob() - Constructor for class org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean.MethodInvokingJob

MethodInvokingJobDetailFactoryBean.StatefulMethodInvokingJob - Class in org.springframework.scheduling.quartz
Extension of the MethodInvokingJob, implementing the StatefulJob interface.
MethodInvokingJobDetailFactoryBean.StatefulMethodInvokingJob() - Constructor for class org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean.StatefulMethodInvokingJob

MethodInvokingRunnable - Class in org.springframework.scheduling.support
Adapter that implements the Runnable interface as a configurable method invocation based on Spring's MethodInvoker.
MethodInvokingRunnable() - Constructor for class org.springframework.scheduling.support.MethodInvokingRunnable

MethodInvokingTimerTaskFactoryBean - Class in org.springframework.scheduling.timer
Deprecated. as of Spring 3.0, in favor of the scheduling.concurrent package which is based on Java 5's java.util.concurrent.ExecutorService
MethodInvokingTimerTaskFactoryBean() - Constructor for class org.springframework.scheduling.timer.MethodInvokingTimerTaskFactoryBean
Deprecated.
MethodLocatingFactoryBean - Class in org.springframework.aop.config
FactoryBean implementation that locates a Method on a specified bean.
MethodLocatingFactoryBean() - Constructor for class org.springframework.aop.config.MethodLocatingFactoryBean

MethodMapTransactionAttributeSource - Class in org.springframework.transaction.interceptor
Simple TransactionAttributeSource implementation that allows attributes to be stored per method in a Map.
MethodMapTransactionAttributeSource() - Constructor for class org.springframework.transaction.interceptor.MethodMapTransactionAttributeSource

MethodMatcher - Interface in org.springframework.aop
Part of a Pointcut: Checks whether the target method is eligible for advice.
MethodMatchers - Class in org.springframework.aop.support
Static utility methods for composing MethodMatchers.
MethodMatchers() - Constructor for class org.springframework.aop.support.MethodMatchers

MethodMetadata - Interface in org.springframework.core.type
Interface that defines abstract access to the annotations of a specific class, in a form that does not require that class to be loaded yet.
MethodNameBasedMBeanInfoAssembler - Class in org.springframework.jmx.export.assembler
Subclass of AbstractReflectiveMBeanInfoAssembler that allows to specify method names to be exposed as MBean operations and attributes.
MethodNameBasedMBeanInfoAssembler() - Constructor for class org.springframework.jmx.export.assembler.MethodNameBasedMBeanInfoAssembler

MethodNameResolver - Interface in org.springframework.web.servlet.mvc.multiaction
Interface that parameterizes the MultiActionController class using the Strategy GoF Design pattern, allowing the mapping from incoming request to handler method name to be varied without affecting other application code.
MethodOverride - Class in org.springframework.beans.factory.support
Object representing the override of a method on a managed object by the IoC container.
MethodOverride(String) - Constructor for class org.springframework.beans.factory.support.MethodOverride
Construct a new override for the given method.
MethodOverrides - Class in org.springframework.beans.factory.support
Set of method overrides, determining which, if any, methods on a managed object the Spring IoC container will override at runtime.
MethodOverrides() - Constructor for class org.springframework.beans.factory.support.MethodOverrides
Create new MethodOverrides.
MethodOverrides(MethodOverrides) - Constructor for class org.springframework.beans.factory.support.MethodOverrides
Deep copy constructor.
MethodParameter - Class in org.springframework.core
Helper class that encapsulates the specification of a method parameter, i.e.
MethodParameter(Method, int) - Constructor for class org.springframework.core.MethodParameter
Create a new MethodParameter for the given method, with nesting level 1.
MethodParameter(Method, int, int) - Constructor for class org.springframework.core.MethodParameter
Create a new MethodParameter for the given method.
MethodParameter(Constructor, int) - Constructor for class org.springframework.core.MethodParameter
Create a new MethodParameter for the given constructor, with nesting level 1.
MethodParameter(Constructor, int, int) - Constructor for class org.springframework.core.MethodParameter
Create a new MethodParameter for the given constructor.
MethodParameter(MethodParameter) - Constructor for class org.springframework.core.MethodParameter
Copy constructor, resulting in an independent MethodParameter object based on the same metadata and cache state that the original object was in.
MethodReference - Class in org.springframework.expression.spel.ast

MethodReference(boolean, String, int, SpelNodeImpl...) - Constructor for class org.springframework.expression.spel.ast.MethodReference

MethodReplacer - Interface in org.springframework.beans.factory.support
Interface to be implemented by classes that can reimplement any method on an IoC-managed object: the Method Injection form of Dependency Injection.
MethodResolver - Interface in org.springframework.expression
A method resolver attempts locate a method and returns a command executor that can be used to invoke that method.
MetricType - Enum in org.springframework.jmx.support
Represents how the measurement values of a ManagedMetric will change over time
MillisecondInstantPrinter - Class in org.springframework.format.datetime.joda
Prints Long instances using a DateTimeFormatter.
MillisecondInstantPrinter(DateTimeFormatter) - Constructor for class org.springframework.format.datetime.joda.MillisecondInstantPrinter
Create a new ReadableInstantPrinter.
MimeContainer - Interface in org.springframework.oxm.mime
Represents a container for MIME attachments Concrete implementations might adapt a SOAPMessage or an email message.
MimeMailMessage - Class in org.springframework.mail.javamail
Implementation of the MailMessage interface for a JavaMail MIME message, to let message population code interact with a simple message or a MIME message through a common interface.
MimeMailMessage(MimeMessageHelper) - Constructor for class org.springframework.mail.javamail.MimeMailMessage
Create a new MimeMailMessage based on the given MimeMessageHelper.
MimeMailMessage(MimeMessage) - Constructor for class org.springframework.mail.javamail.MimeMailMessage
Create a new MimeMailMessage based on the given JavaMail MimeMessage.
MimeMarshaller - Interface in org.springframework.oxm.mime
Subinterface of Marshaller that can use MIME attachments to optimize storage of binary data.
MimeMessageHelper - Class in org.springframework.mail.javamail
Helper class for populating a MimeMessage.
MimeMessageHelper(MimeMessage) - Constructor for class org.springframework.mail.javamail.MimeMessageHelper
Create a new MimeMessageHelper for the given MimeMessage, assuming a simple text message (no multipart content, i.e.
MimeMessageHelper(MimeMessage, String) - Constructor for class org.springframework.mail.javamail.MimeMessageHelper
Create a new MimeMessageHelper for the given MimeMessage, assuming a simple text message (no multipart content, i.e.
MimeMessageHelper(MimeMessage, boolean) - Constructor for class org.springframework.mail.javamail.MimeMessageHelper
Create a new MimeMessageHelper for the given MimeMessage, in multipart mode (supporting alternative texts, inline elements and attachments) if requested.
MimeMessageHelper(MimeMessage, boolean, String) - Constructor for class org.springframework.mail.javamail.MimeMessageHelper
Create a new MimeMessageHelper for the given MimeMessage, in multipart mode (supporting alternative texts, inline elements and attachments) if requested.
MimeMessageHelper(MimeMessage, int) - Constructor for class org.springframework.mail.javamail.MimeMessageHelper
Create a new MimeMessageHelper for the given MimeMessage, in multipart mode (supporting alternative texts, inline elements and attachments) if requested.
MimeMessageHelper(MimeMessage, int, String) - Constructor for class org.springframework.mail.javamail.MimeMessageHelper
Create a new MimeMessageHelper for the given MimeMessage, in multipart mode (supporting alternative texts, inline elements and attachments) if requested.
MimeMessagePreparator - Interface in org.springframework.mail.javamail
Callback interface for the preparation of JavaMail MIME messages.
MimeUnmarshaller - Interface in org.springframework.oxm.mime
Subinterface of Unmarshaller that can use MIME attachments to optimize storage of binary data.
MISSING_FIELD_ERROR_CODE - Static variable in class org.springframework.validation.DefaultBindingErrorProcessor
Error code that a missing field error (i.e.
MissingPortletRequestParameterException - Exception in org.springframework.web.portlet.bind
PortletRequestBindingException subclass that indicates a missing parameter.
MissingPortletRequestParameterException(String, String) - Constructor for exception org.springframework.web.portlet.bind.MissingPortletRequestParameterException
Constructor for MissingPortletRequestParameterException.
MissingServletRequestParameterException - Exception in org.springframework.web.bind
ServletRequestBindingException subclass that indicates a missing parameter.
MissingServletRequestParameterException(String, String) - Constructor for exception org.springframework.web.bind.MissingServletRequestParameterException
Constructor for MissingServletRequestParameterException.
MockActionRequest - Class in org.springframework.mock.web.portlet
Mock implementation of the ActionRequest interface.
MockActionRequest() - Constructor for class org.springframework.mock.web.portlet.MockActionRequest
Create a new MockActionRequest with a default MockPortalContext and a default MockPortletContext.
MockActionRequest(String) - Constructor for class org.springframework.mock.web.portlet.MockActionRequest
Create a new MockActionRequest with a default MockPortalContext and a default MockPortletContext.
MockActionRequest(PortletMode) - Constructor for class org.springframework.mock.web.portlet.MockActionRequest
Create a new MockActionRequest with a default MockPortalContext and a default MockPortletContext.
MockActionRequest(PortletContext) - Constructor for class org.springframework.mock.web.portlet.MockActionRequest
Create a new MockActionRequest with a default MockPortalContext.
MockActionRequest(PortalContext, PortletContext) - Constructor for class org.springframework.mock.web.portlet.MockActionRequest
Create a new MockActionRequest.
MockActionResponse - Class in org.springframework.mock.web.portlet
Mock implementation of the ActionResponse interface.
MockActionResponse() - Constructor for class org.springframework.mock.web.portlet.MockActionResponse
Create a new MockActionResponse with a default MockPortalContext.
MockActionResponse(PortalContext) - Constructor for class org.springframework.mock.web.portlet.MockActionResponse
Create a new MockActionResponse.
MockBaseURL - Class in org.springframework.mock.web.portlet
Mock implementation of the BaseURL interface.
MockBaseURL() - Constructor for class org.springframework.mock.web.portlet.MockBaseURL

MockBodyContent - Class in org.springframework.mock.web
Mock implementation of the BodyContent class.
MockBodyContent(String, HttpServletResponse) - Constructor for class org.springframework.mock.web.MockBodyContent
Create a MockBodyContent for the given response.
MockBodyContent(String, Writer) - Constructor for class org.springframework.mock.web.MockBodyContent
Create a MockBodyContent for the given response.
MockBodyContent(String, HttpServletResponse, Writer) - Constructor for class org.springframework.mock.web.MockBodyContent
Create a MockBodyContent for the given response.
MockCacheControl - Class in org.springframework.mock.web.portlet
Mock implementation of the CacheControl interface.
MockCacheControl() - Constructor for class org.springframework.mock.web.portlet.MockCacheControl

MockClientDataRequest - Class in org.springframework.mock.web.portlet
Mock implementation of the ClientDataRequest interface.
MockClientDataRequest() - Constructor for class org.springframework.mock.web.portlet.MockClientDataRequest
Create a new MockClientDataRequest with a default MockPortalContext and a default MockPortletContext.
MockClientDataRequest(PortletContext) - Constructor for class org.springframework.mock.web.portlet.MockClientDataRequest
Create a new MockClientDataRequest with a default MockPortalContext.
MockClientDataRequest(PortalContext, PortletContext) - Constructor for class org.springframework.mock.web.portlet.MockClientDataRequest
Create a new MockClientDataRequest.
MockEvent - Class in org.springframework.mock.web.portlet
Mock implementation of the Event interface.
MockEvent(QName) - Constructor for class org.springframework.mock.web.portlet.MockEvent
Create a new MockEvent with the given name.
MockEvent(QName, Serializable) - Constructor for class org.springframework.mock.web.portlet.MockEvent
Create a new MockEvent with the given name and value.
MockEvent(String) - Constructor for class org.springframework.mock.web.portlet.MockEvent
Create a new MockEvent with the given name.
MockEvent(String, Serializable) - Constructor for class org.springframework.mock.web.portlet.MockEvent
Create a new MockEvent with the given name and value.
MockEventRequest - Class in org.springframework.mock.web.portlet
Mock implementation of the EventRequest interface.
MockEventRequest(Event) - Constructor for class org.springframework.mock.web.portlet.MockEventRequest
Create a new MockEventRequest with a default MockPortalContext and a default MockPortletContext.
MockEventRequest(Event, PortletContext) - Constructor for class org.springframework.mock.web.portlet.MockEventRequest
Create a new MockEventRequest with a default MockPortalContext.
MockEventRequest(Event, PortalContext, PortletContext) - Constructor for class org.springframework.mock.web.portlet.MockEventRequest
Create a new MockEventRequest.
MockEventResponse - Class in org.springframework.mock.web.portlet
Mock implementation of the EventResponse interface.
MockEventResponse() - Constructor for class org.springframework.mock.web.portlet.MockEventResponse

MockExpressionEvaluator - Class in org.springframework.mock.web
Mock implementation of the JSP 2.0 ExpressionEvaluator interface, delegating to the Jakarta JSTL ExpressionEvaluatorManager.
MockExpressionEvaluator(PageContext) - Constructor for class org.springframework.mock.web.MockExpressionEvaluator
Create a new MockExpressionEvaluator for the given PageContext.
MockFilterChain - Class in org.springframework.mock.web
Mock implementation of the FilterConfig interface.
MockFilterChain() - Constructor for class org.springframework.mock.web.MockFilterChain

MockFilterConfig - Class in org.springframework.mock.web
Mock implementation of the FilterConfig interface.
MockFilterConfig() - Constructor for class org.springframework.mock.web.MockFilterConfig
Create a new MockFilterConfig with a default MockServletContext.
MockFilterConfig(String) - Constructor for class org.springframework.mock.web.MockFilterConfig
Create a new MockFilterConfig with a default MockServletContext.
MockFilterConfig(ServletContext) - Constructor for class org.springframework.mock.web.MockFilterConfig
Create a new MockFilterConfig.
MockFilterConfig(ServletContext, String) - Constructor for class org.springframework.mock.web.MockFilterConfig
Create a new MockFilterConfig.
MockHttpServletRequest - Class in org.springframework.mock.web
Mock implementation of the HttpServletRequest interface.
MockHttpServletRequest() - Constructor for class org.springframework.mock.web.MockHttpServletRequest
Create a new MockHttpServletRequest with a default MockServletContext.
MockHttpServletRequest(String, String) - Constructor for class org.springframework.mock.web.MockHttpServletRequest
Create a new MockHttpServletRequest with a default MockServletContext.
MockHttpServletRequest(ServletContext) - Constructor for class org.springframework.mock.web.MockHttpServletRequest
Create a new MockHttpServletRequest.
MockHttpServletRequest(ServletContext, String, String) - Constructor for class org.springframework.mock.web.MockHttpServletRequest
Create a new MockHttpServletRequest.
MockHttpServletResponse - Class in org.springframework.mock.web
Mock implementation of the HttpServletResponse interface.
MockHttpServletResponse() - Constructor for class org.springframework.mock.web.MockHttpServletResponse

MockHttpSession - Class in org.springframework.mock.web
Mock implementation of the HttpSession interface.
MockHttpSession() - Constructor for class org.springframework.mock.web.MockHttpSession
Create a new MockHttpSession with a default MockServletContext.
MockHttpSession(ServletContext) - Constructor for class org.springframework.mock.web.MockHttpSession
Create a new MockHttpSession.
MockHttpSession(ServletContext, String) - Constructor for class org.springframework.mock.web.MockHttpSession
Create a new MockHttpSession.
MockJspWriter - Class in org.springframework.mock.web
Mock implementation of the JspWriter class.
MockJspWriter(HttpServletResponse) - Constructor for class org.springframework.mock.web.MockJspWriter
Create a MockJspWriter for the given response, using the response's default Writer.
MockJspWriter(Writer) - Constructor for class org.springframework.mock.web.MockJspWriter
Create a MockJspWriter for the given plain Writer.
MockJspWriter(HttpServletResponse, Writer) - Constructor for class org.springframework.mock.web.MockJspWriter
Create a MockJspWriter for the given response.
MockMimeResponse - Class in org.springframework.mock.web.portlet
Mock implementation of the MimeResponse interface.
MockMimeResponse() - Constructor for class org.springframework.mock.web.portlet.MockMimeResponse
Create a new MockMimeResponse with a default MockPortalContext.
MockMimeResponse(PortalContext) - Constructor for class org.springframework.mock.web.portlet.MockMimeResponse
Create a new MockMimeResponse.
MockMimeResponse(PortalContext, PortletRequest) - Constructor for class org.springframework.mock.web.portlet.MockMimeResponse
Create a new MockMimeResponse.
MockMultipartActionRequest - Class in org.springframework.mock.web.portlet
Mock implementation of the MultipartActionRequest interface.
MockMultipartActionRequest() - Constructor for class org.springframework.mock.web.portlet.MockMultipartActionRequest

MockMultipartFile - Class in org.springframework.mock.web
Mock implementation of the MultipartFile interface.
MockMultipartFile(String, byte[]) - Constructor for class org.springframework.mock.web.MockMultipartFile
Create a new MockMultipartFile with the given content.
MockMultipartFile(String, InputStream) - Constructor for class org.springframework.mock.web.MockMultipartFile
Create a new MockMultipartFile with the given content.
MockMultipartFile(String, String, String, byte[]) - Constructor for class org.springframework.mock.web.MockMultipartFile
Create a new MockMultipartFile with the given content.
MockMultipartFile(String, String, String, InputStream) - Constructor for class org.springframework.mock.web.MockMultipartFile
Create a new MockMultipartFile with the given content.
MockMultipartHttpServletRequest - Class in org.springframework.mock.web
Mock implementation of the MultipartHttpServletRequest interface.
MockMultipartHttpServletRequest() - Constructor for class org.springframework.mock.web.MockMultipartHttpServletRequest

MockPageContext - Class in org.springframework.mock.web
Mock implementation of the PageContext interface.
MockPageContext() - Constructor for class org.springframework.mock.web.MockPageContext
Create new MockPageContext with a default MockServletContext, MockHttpServletRequest, MockHttpServletResponse, MockServletConfig.
MockPageContext(ServletContext) - Constructor for class org.springframework.mock.web.MockPageContext
Create new MockPageContext with a default MockHttpServletRequest, MockHttpServletResponse, MockServletConfig.
MockPageContext(ServletContext, HttpServletRequest) - Constructor for class org.springframework.mock.web.MockPageContext
Create new MockPageContext with a MockHttpServletResponse, MockServletConfig.
MockPageContext(ServletContext, HttpServletRequest, HttpServletResponse) - Constructor for class org.springframework.mock.web.MockPageContext
Create new MockPageContext with a MockServletConfig.
MockPageContext(ServletContext, HttpServletRequest, HttpServletResponse, ServletConfig) - Constructor for class org.springframework.mock.web.MockPageContext
Create new MockServletConfig.
MockPortalContext - Class in org.springframework.mock.web.portlet
Mock implementation of the PortalContext interface.
MockPortalContext() - Constructor for class org.springframework.mock.web.portlet.MockPortalContext
Create a new MockPortalContext with default PortletModes (VIEW, EDIT, HELP) and default WindowStates (NORMAL, MAXIMIZED, MINIMIZED).
MockPortalContext(List<PortletMode>, List<WindowState>) - Constructor for class org.springframework.mock.web.portlet.MockPortalContext
Create a new MockPortalContext with the given PortletModes and WindowStates.
MockPortletConfig - Class in org.springframework.mock.web.portlet
Mock implementation of the PortletConfig interface.
MockPortletConfig() - Constructor for class org.springframework.mock.web.portlet.MockPortletConfig
Create a new MockPortletConfig with a default MockPortletContext.
MockPortletConfig(String) - Constructor for class org.springframework.mock.web.portlet.MockPortletConfig
Create a new MockPortletConfig with a default MockPortletContext.
MockPortletConfig(PortletContext) - Constructor for class org.springframework.mock.web.portlet.MockPortletConfig
Create a new MockPortletConfig.
MockPortletConfig(PortletContext, String) - Constructor for class org.springframework.mock.web.portlet.MockPortletConfig
Create a new MockPortletConfig.
MockPortletContext - Class in org.springframework.mock.web.portlet
Mock implementation of the PortletContext interface.
MockPortletContext() - Constructor for class org.springframework.mock.web.portlet.MockPortletContext
Create a new MockPortletContext with no base path and a DefaultResourceLoader (i.e.
MockPortletContext(String) - Constructor for class org.springframework.mock.web.portlet.MockPortletContext
Create a new MockPortletContext using a DefaultResourceLoader.
MockPortletContext(ResourceLoader) - Constructor for class org.springframework.mock.web.portlet.MockPortletContext
Create a new MockPortletContext, using the specified ResourceLoader and no base path.
MockPortletContext(String, ResourceLoader) - Constructor for class org.springframework.mock.web.portlet.MockPortletContext
Create a new MockPortletContext.
MockPortletPreferences - Class in org.springframework.mock.web.portlet
Mock implementation of the PortletPreferences interface.
MockPortletPreferences() - Constructor for class org.springframework.mock.web.portlet.MockPortletPreferences

MockPortletRequest - Class in org.springframework.mock.web.portlet
Mock implementation of the PortletRequest interface.
MockPortletRequest() - Constructor for class org.springframework.mock.web.portlet.MockPortletRequest
Create a new MockPortletRequest with a default MockPortalContext and a default MockPortletContext.
MockPortletRequest(PortletContext) - Constructor for class org.springframework.mock.web.portlet.MockPortletRequest
Create a new MockPortletRequest with a default MockPortalContext.
MockPortletRequest(PortalContext, PortletContext) - Constructor for class org.springframework.mock.web.portlet.MockPortletRequest
Create a new MockPortletRequest.
MockPortletRequestDispatcher - Class in org.springframework.mock.web.portlet
Mock implementation of the PortletRequestDispatcher interface.
MockPortletRequestDispatcher(String) - Constructor for class org.springframework.mock.web.portlet.MockPortletRequestDispatcher
Create a new MockPortletRequestDispatcher for the given URL.
MockPortletResponse - Class in org.springframework.mock.web.portlet
Mock implementation of the PortletResponse interface.
MockPortletResponse() - Constructor for class org.springframework.mock.web.portlet.MockPortletResponse
Create a new MockPortletResponse with a default MockPortalContext.
MockPortletResponse(PortalContext) - Constructor for class org.springframework.mock.web.portlet.MockPortletResponse
Create a new MockPortletResponse.
MockPortletSession - Class in org.springframework.mock.web.portlet
Mock implementation of the PortletSession interface.
MockPortletSession() - Constructor for class org.springframework.mock.web.portlet.MockPortletSession
Create a new MockPortletSession with a default MockPortletContext.
MockPortletSession(PortletContext) - Constructor for class org.springframework.mock.web.portlet.MockPortletSession
Create a new MockPortletSession.
MockPortletURL - Class in org.springframework.mock.web.portlet
Mock implementation of the PortletURL interface.
MockPortletURL(PortalContext, String) - Constructor for class org.springframework.mock.web.portlet.MockPortletURL
Create a new MockPortletURL for the given URL type.
MockRenderRequest - Class in org.springframework.mock.web.portlet
Mock implementation of the RenderRequest interface.
MockRenderRequest() - Constructor for class org.springframework.mock.web.portlet.MockRenderRequest
Create a new MockRenderRequest with a default MockPortalContext and a default MockPortletContext.
MockRenderRequest(PortletMode) - Constructor for class org.springframework.mock.web.portlet.MockRenderRequest
Create a new MockRenderRequest with a default MockPortalContext and a default MockPortletContext.
MockRenderRequest(PortletMode, WindowState) - Constructor for class org.springframework.mock.web.portlet.MockRenderRequest
Create a new MockRenderRequest with a default MockPortalContext and a default MockPortletContext.
MockRenderRequest(PortletContext) - Constructor for class org.springframework.mock.web.portlet.MockRenderRequest
Create a new MockRenderRequest with a default MockPortalContext.
MockRenderRequest(PortalContext, PortletContext) - Constructor for class org.springframework.mock.web.portlet.MockRenderRequest
Create a new MockRenderRequest.
MockRenderResponse - Class in org.springframework.mock.web.portlet
Mock implementation of the RenderResponse interface.
MockRenderResponse() - Constructor for class org.springframework.mock.web.portlet.MockRenderResponse
Create a new MockRenderResponse with a default MockPortalContext.
MockRenderResponse(PortalContext) - Constructor for class org.springframework.mock.web.portlet.MockRenderResponse
Create a new MockRenderResponse.
MockRenderResponse(PortalContext, RenderRequest) - Constructor for class org.springframework.mock.web.portlet.MockRenderResponse
Create a new MockRenderResponse.
MockRequestDispatcher - Class in org.springframework.mock.web
Mock implementation of the RequestDispatcher interface.
MockRequestDispatcher(String) - Constructor for class org.springframework.mock.web.MockRequestDispatcher
Create a new MockRequestDispatcher for the given URL.
MockResourceRequest - Class in org.springframework.mock.web.portlet
Mock implementation of the ResourceRequest interface.
MockResourceRequest() - Constructor for class org.springframework.mock.web.portlet.MockResourceRequest
Create a new MockResourceRequest with a default MockPortalContext and a default MockPortletContext.
MockResourceRequest(String) - Constructor for class org.springframework.mock.web.portlet.MockResourceRequest
Create a new MockResourceRequest with a default MockPortalContext and a default MockPortletContext.
MockResourceRequest(MockResourceURL) - Constructor for class org.springframework.mock.web.portlet.MockResourceRequest
Create a new MockResourceRequest with a default MockPortalContext and a default MockPortletContext.
MockResourceRequest(PortletContext) - Constructor for class org.springframework.mock.web.portlet.MockResourceRequest
Create a new MockResourceRequest with a default MockPortalContext.
MockResourceRequest(PortalContext, PortletContext) - Constructor for class org.springframework.mock.web.portlet.MockResourceRequest
Create a new MockResourceRequest.
MockResourceResponse - Class in org.springframework.mock.web.portlet
Mock implementation of the ResourceResponse interface.
MockResourceResponse() - Constructor for class org.springframework.mock.web.portlet.MockResourceResponse

MockResourceURL - Class in org.springframework.mock.web.portlet
Mock implementation of the ResourceURL interface.
MockResourceURL() - Constructor for class org.springframework.mock.web.portlet.MockResourceURL

MockServletConfig - Class in org.springframework.mock.web
Mock implementation of the ServletConfig interface.
MockServletConfig() - Constructor for class org.springframework.mock.web.MockServletConfig
Create a new MockServletConfig with a default MockServletContext.
MockServletConfig(String) - Constructor for class org.springframework.mock.web.MockServletConfig
Create a new MockServletConfig with a default MockServletContext.
MockServletConfig(ServletContext) - Constructor for class org.springframework.mock.web.MockServletConfig
Create a new MockServletConfig.
MockServletConfig(ServletContext, String) - Constructor for class org.springframework.mock.web.MockServletConfig
Create a new MockServletConfig.
MockServletContext - Class in org.springframework.mock.web
Mock implementation of the ServletContext interface.
MockServletContext() - Constructor for class org.springframework.mock.web.MockServletContext
Create a new MockServletContext, using no base path and a DefaultResourceLoader (i.e.
MockServletContext(String) - Constructor for class org.springframework.mock.web.MockServletContext
Create a new MockServletContext, using a DefaultResourceLoader.
MockServletContext(ResourceLoader) - Constructor for class org.springframework.mock.web.MockServletContext
Create a new MockServletContext, using the specified ResourceLoader and no base path.
MockServletContext(String, ResourceLoader) - Constructor for class org.springframework.mock.web.MockServletContext
Create a new MockServletContext.
MockStateAwareResponse - Class in org.springframework.mock.web.portlet
Mock implementation of the StateAwareResponse interface.
MockStateAwareResponse() - Constructor for class org.springframework.mock.web.portlet.MockStateAwareResponse
Create a new MockActionResponse with a default MockPortalContext.
MockStateAwareResponse(PortalContext) - Constructor for class org.springframework.mock.web.portlet.MockStateAwareResponse
Create a new MockActionResponse.
MockStaticEntityMethods - Annotation Type in org.springframework.mock.staticmock
Annotation to indicate a test class for whose @Test methods static methods on Entity classes should be mocked.
Model - Interface in org.springframework.ui
Java-5-specific interface that defines a holder for model attributes.
MODEL_ATTRIBUTE - Static variable in class org.springframework.web.servlet.ViewRendererServlet
Name of request attribute that holds the model Map
MODEL_ATTRIBUTE_VARIABLE_NAME - Static variable in class org.springframework.web.servlet.tags.form.FormTag
The name of the PageContext attribute under which the form object name is exposed.
MODEL_KEY_PREFIX - Static variable in interface org.springframework.validation.BindingResult
Prefix for the name of the BindingResult instance in a model, followed by the object name.
ModelAndView - Class in org.springframework.web.portlet
Holder for both Model and View in the web MVC framework.
ModelAndView() - Constructor for class org.springframework.web.portlet.ModelAndView
Default constructor for bean-style usage: populating bean properties instead of passing in constructor arguments.
ModelAndView(String) - Constructor for class org.springframework.web.portlet.ModelAndView
Convenient constructor when there is no model data to expose.
ModelAndView(Object) - Constructor for class org.springframework.web.portlet.ModelAndView
Convenient constructor when there is no model data to expose.
ModelAndView(String, Map<String, ?>) - Constructor for class org.springframework.web.portlet.ModelAndView
Create a new ModelAndView given a view name and a model.
ModelAndView(Object, Map<String, ?>) - Constructor for class org.springframework.web.portlet.ModelAndView
Create a new ModelAndView given a View object and a model.
ModelAndView(String, String, Object) - Constructor for class org.springframework.web.portlet.ModelAndView
Convenient constructor to take a single model object.
ModelAndView(Object, String, Object) - Constructor for class org.springframework.web.portlet.ModelAndView
Convenient constructor to take a single model object.
ModelAndView - Class in org.springframework.web.servlet
Holder for both Model and View in the web MVC framework.
ModelAndView() - Constructor for class org.springframework.web.servlet.ModelAndView
Default constructor for bean-style usage: populating bean properties instead of passing in constructor arguments.
ModelAndView(String) - Constructor for class org.springframework.web.servlet.ModelAndView
Convenient constructor when there is no model data to expose.
ModelAndView(View) - Constructor for class org.springframework.web.servlet.ModelAndView
Convenient constructor when there is no model data to expose.
ModelAndView(String, Map<String, ?>) - Constructor for class org.springframework.web.servlet.ModelAndView
Creates new ModelAndView given a view name and a model.
ModelAndView(View, Map<String, ?>) - Constructor for class org.springframework.web.servlet.ModelAndView
Creates new ModelAndView given a View object and a model.
ModelAndView(String, String, Object) - Constructor for class org.springframework.web.servlet.ModelAndView
Convenient constructor to take a single model object.
ModelAndView(View, String, Object) - Constructor for class org.springframework.web.servlet.ModelAndView
Convenient constructor to take a single model object.
ModelAndViewAssert - Class in org.springframework.test.web
A collection of assertions intended to simplify testing scenarios dealing with Spring Web MVC ModelAndView objects.
ModelAndViewAssert() - Constructor for class org.springframework.test.web.ModelAndViewAssert

ModelAndViewDefiningException - Exception in org.springframework.web.portlet
Exception to be thrown on error conditions that should forward to a specific view with a specific model.
ModelAndViewDefiningException(ModelAndView) - Constructor for exception org.springframework.web.portlet.ModelAndViewDefiningException
Create new ModelAndViewDefiningException with the given ModelAndView, typically representing a specific error page.
ModelAndViewDefiningException - Exception in org.springframework.web.servlet
Exception to be thrown on error conditions that should forward to a specific view with a specific model.
ModelAndViewDefiningException(ModelAndView) - Constructor for exception org.springframework.web.servlet.ModelAndViewDefiningException
Create new ModelAndViewDefiningException with the given ModelAndView, typically representing a specific error page.
ModelAndViewResolver - Interface in org.springframework.web.servlet.mvc.annotation
SPI for resolving custom return values from a specific handler method.
ModelAttribute - Annotation Type in org.springframework.web.bind.annotation
Annotation that binds a method parameter or method return value to a named model attribute, exposed to a web view.
ModelMap - Class in org.springframework.ui
Implementation of Map for use when building model data for use with UI tools.
ModelMap() - Constructor for class org.springframework.ui.ModelMap
Construct a new, empty ModelMap.
ModelMap(String, Object) - Constructor for class org.springframework.ui.ModelMap
Construct a new ModelMap containing the supplied attribute under the supplied name.
ModelMap(Object) - Constructor for class org.springframework.ui.ModelMap
Construct a new ModelMap containing the supplied attribute.
ModelMBeanNotificationPublisher - Class in org.springframework.jmx.export.notification
NotificationPublisher implementation that uses the infrastructure provided by the ModelMBean interface to track javax.management.NotificationListeners and send Notifications to those listeners.
ModelMBeanNotificationPublisher(ModelMBeanNotificationBroadcaster, ObjectName, Object) - Constructor for class org.springframework.jmx.export.notification.ModelMBeanNotificationPublisher
Create a new instance of the ModelMBeanNotificationPublisher class that will publish all Notifications to the supplied ModelMBean.
modifyLocations(Class<?>, String...) - Method in class org.springframework.test.context.support.AbstractContextLoader
Generate a modified version of the supplied locations array and returns it.
monitor(Object, WeakReferenceMonitor.ReleaseListener) - Static method in class org.springframework.util.WeakReferenceMonitor
Start to monitor given handle object for becoming weakly reachable.
MultiActionController - Class in org.springframework.web.servlet.mvc.multiaction
Controller implementation that allows multiple request types to be handled by the same class.
MultiActionController() - Constructor for class org.springframework.web.servlet.mvc.multiaction.MultiActionController
Constructor for MultiActionController that looks for handler methods in the present subclass.
MultiActionController(Object) - Constructor for class org.springframework.web.servlet.mvc.multiaction.MultiActionController
Constructor for MultiActionController that looks for handler methods in delegate, rather than a subclass of this class.
multicastEvent(ApplicationEvent) - Method in interface org.springframework.context.event.ApplicationEventMulticaster
Multicast the given application event to appropriate listeners.
multicastEvent(ApplicationEvent) - Method in class org.springframework.context.event.SimpleApplicationEventMulticaster

MULTIPART_FORM_DATA - Static variable in class org.springframework.http.MediaType
Public constant media type for multipart/form-data.
MULTIPART_MODE_MIXED - Static variable in class org.springframework.mail.javamail.MimeMessageHelper
Constant indicating a multipart message with a single root multipart element of type "mixed".
MULTIPART_MODE_MIXED_RELATED - Static variable in class org.springframework.mail.javamail.MimeMessageHelper
Constant indicating a multipart message with a root multipart element "mixed" plus a nested multipart element of type "related".
MULTIPART_MODE_NO - Static variable in class org.springframework.mail.javamail.MimeMessageHelper
Constant indicating a non-multipart message.
MULTIPART_MODE_RELATED - Static variable in class org.springframework.mail.javamail.MimeMessageHelper
Constant indicating a multipart message with a single root multipart element of type "related".
MULTIPART_RESOLVER_BEAN_NAME - Static variable in class org.springframework.web.portlet.DispatcherPortlet
Well-known name for the PortletMultipartResolver object in the bean factory for this namespace.
MULTIPART_RESOLVER_BEAN_NAME - Static variable in class org.springframework.web.servlet.DispatcherServlet
Well-known name for the MultipartResolver object in the bean factory for this namespace.
MultipartActionRequest - Interface in org.springframework.web.portlet.multipart
Interface which provides additional methods for dealing with multipart content within a portlet request, allowing to access uploaded files.
MultipartException - Exception in org.springframework.web.multipart
Exception thrown when multipart resolution fails.
MultipartException(String) - Constructor for exception org.springframework.web.multipart.MultipartException
Constructor for MultipartException.
MultipartException(String, Throwable) - Constructor for exception org.springframework.web.multipart.MultipartException
Constructor for MultipartException.
MultipartFile - Interface in org.springframework.web.multipart
A representation of an uploaded file received in a multipart request.
MultipartFilter - Class in org.springframework.web.multipart.support
Servlet 2.3 Filter that resolves multipart requests via a MultipartResolver.
MultipartFilter() - Constructor for class org.springframework.web.multipart.support.MultipartFilter

MultipartHttpServletRequest - Interface in org.springframework.web.multipart
Provides additional methods for dealing with multipart content within a servlet request, allowing to access uploaded files.
MultipartRequest - Interface in org.springframework.web.multipart
This interface defines the multipart request access operations that are exposed for actual multipart requests.
MultipartResolver - Interface in org.springframework.web.multipart
A strategy interface for multipart file upload resolution in accordance with RFC 1867.
MultiValueMap<K,V> - Interface in org.springframework.util
Extension of the Map interface that stores multiple values.
MutablePersistenceUnitInfo - Class in org.springframework.orm.jpa.persistenceunit
Spring's base implementation of the JPA PersistenceUnitInfo interface, used to bootstrap an EntityManagerFactory in a container.
MutablePersistenceUnitInfo() - Constructor for class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo

MutablePropertyValues - Class in org.springframework.beans
Default implementation of the PropertyValues interface.
MutablePropertyValues() - Constructor for class org.springframework.beans.MutablePropertyValues
Creates a new empty MutablePropertyValues object.
MutablePropertyValues(PropertyValues) - Constructor for class org.springframework.beans.MutablePropertyValues
Deep copy constructor.
MutablePropertyValues(Map<?, ?>) - Constructor for class org.springframework.beans.MutablePropertyValues
Construct a new MutablePropertyValues object from a Map.
MutablePropertyValues(List<PropertyValue>) - Constructor for class org.springframework.beans.MutablePropertyValues
Construct a new MutablePropertyValues object using the given List of PropertyValue objects as-is.
MutableSortDefinition - Class in org.springframework.beans.support
Mutable implementation of the SortDefinition interface.
MutableSortDefinition() - Constructor for class org.springframework.beans.support.MutableSortDefinition
Create an empty MutableSortDefinition, to be populated via its bean properties.
MutableSortDefinition(SortDefinition) - Constructor for class org.springframework.beans.support.MutableSortDefinition
Copy constructor: create a new MutableSortDefinition that mirrors the given sort definition.
MutableSortDefinition(String, boolean, boolean) - Constructor for class org.springframework.beans.support.MutableSortDefinition
Create a MutableSortDefinition for the given settings.
MutableSortDefinition(boolean) - Constructor for class org.springframework.beans.support.MutableSortDefinition
Create a new MutableSortDefinition.
MvcNamespaceHandler - Class in org.springframework.web.servlet.config
NamespaceHandler for Spring MVC configuration namespace.
MvcNamespaceHandler() - Constructor for class org.springframework.web.servlet.config.MvcNamespaceHandler

MySQLMaxValueIncrementer - Class in org.springframework.jdbc.support.incrementer
DataFieldMaxValueIncrementer that increments the maximum value of a given MySQL table with the equivalent of an auto-increment column.
MySQLMaxValueIncrementer() - Constructor for class org.springframework.jdbc.support.incrementer.MySQLMaxValueIncrementer
Default constructor for bean property style usage.
MySQLMaxValueIncrementer(DataSource, String, String) - Constructor for class org.springframework.jdbc.support.incrementer.MySQLMaxValueIncrementer
Convenience constructor.
Overview  Package  Class  Tree  Deprecated   Index  Help
A B C D E F G H I J K L M N O P Q R S T U V W X


N-Index

PREV LETTER NEXT LETTER FRAMES NO FRAMES
A B C D E F G H I J K L M N O P Q R S T U V W X

N

name - Variable in class org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.LookupElement
NAME - Static variable in class org.springframework.ui.velocity.SpringResourceLoader
NAME_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
Constant for the name attribute
NAME_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
NAME_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader
NamedBean - Interface in org.springframework.beans.factory
Counterpart of BeanNameAware.
NamedInheritableThreadLocal<T> - Class in org.springframework.core
InheritableThreadLocal subclass that exposes a specified name as NamedInheritableThreadLocal.toString() result (allowing for introspection).
NamedInheritableThreadLocal(String) - Constructor for class org.springframework.core.NamedInheritableThreadLocal
Create a new NamedInheritableThreadLocal with the given name.
NamedParameterBatchUpdateUtils - Class in org.springframework.jdbc.core.namedparam
Generic utility methods for working with JDBC batch statements using named parameters.
NamedParameterBatchUpdateUtils() - Constructor for class org.springframework.jdbc.core.namedparam.NamedParameterBatchUpdateUtils
NamedParameterJdbcDaoSupport - Class in org.springframework.jdbc.core.namedparam
Extension of JdbcDaoSupport that exposes a NamedParameterJdbcTemplate as well.
NamedParameterJdbcDaoSupport() - Constructor for class org.springframework.jdbc.core.namedparam.NamedParameterJdbcDaoSupport
NamedParameterJdbcOperations - Interface in org.springframework.jdbc.core.namedparam
Interface specifying a basic set of JDBC operations allowing the use of named parameters rather than the traditional '?' placeholders.
NamedParameterJdbcTemplate - Class in org.springframework.jdbc.core.namedparam
Template class with a basic set of JDBC operations, allowing the use of named parameters rather than traditional '?' placeholders.
NamedParameterJdbcTemplate(DataSource) - Constructor for class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
Create a new NamedParameterJdbcTemplate for the given DataSource.
NamedParameterJdbcTemplate(JdbcOperations) - Constructor for class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
Create a new NamedParameterJdbcTemplate for the given classic Spring JdbcTemplate.
NamedParameterUtils - Class in org.springframework.jdbc.core.namedparam
Helper methods for named parameter parsing.
NamedParameterUtils() - Constructor for class org.springframework.jdbc.core.namedparam.NamedParameterUtils
NamedThreadLocal<T> - Class in org.springframework.core
ThreadLocal subclass that exposes a specified name as NamedThreadLocal.toString() result (allowing for introspection).
NamedThreadLocal(String) - Constructor for class org.springframework.core.NamedThreadLocal
Create a new NamedThreadLocal with the given name.
NameMatchMethodPointcut - Class in org.springframework.aop.support
Pointcut bean for simple method name matches, as alternative to regexp patterns.
NameMatchMethodPointcut() - Constructor for class org.springframework.aop.support.NameMatchMethodPointcut
NameMatchMethodPointcutAdvisor - Class in org.springframework.aop.support
Convenient class for name-match method pointcuts that hold an Advice, making them an Advisor.
NameMatchMethodPointcutAdvisor() - Constructor for class org.springframework.aop.support.NameMatchMethodPointcutAdvisor
NameMatchMethodPointcutAdvisor(Advice) - Constructor for class org.springframework.aop.support.NameMatchMethodPointcutAdvisor
NameMatchTransactionAttributeSource - Class in org.springframework.transaction.interceptor
Simple TransactionAttributeSource implementation that allows attributes to be matched by registered name.
NameMatchTransactionAttributeSource() - Constructor for class org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource
NamespaceHandler - Interface in org.springframework.beans.factory.xml
Base interface used by the DefaultBeanDefinitionDocumentReader for handling custom namespaces in a Spring XML configuration file.
NamespaceHandlerResolver - Interface in org.springframework.beans.factory.xml
Used by the DefaultBeanDefinitionDocumentReader to locate a NamespaceHandler implementation for a particular namespace URI.
NamespaceHandlerSupport - Class in org.springframework.beans.factory.xml
Support class for implementing custom NamespaceHandlers.
NamespaceHandlerSupport() - Constructor for class org.springframework.beans.factory.xml.NamespaceHandlerSupport
nativeEntityManagerFactory - Variable in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
Raw EntityManagerFactory as returned by the PersistenceProvider
NativeJdbcExtractor - Interface in org.springframework.jdbc.support.nativejdbc
Interface for extracting native JDBC objects from wrapped objects coming from connection pools.
NativeJdbcExtractorAdapter - Class in org.springframework.jdbc.support.nativejdbc
Abstract adapter class for the NativeJdbcExtractor interface, for simplified implementation of basic extractors.
NativeJdbcExtractorAdapter() - Constructor for class org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter
NativeWebRequest - Interface in org.springframework.web.context.request
Extension of the WebRequest interface, exposing the native request and response objects in a generic fashion.
NESTED_PATH_SEPARATOR - Static variable in interface org.springframework.validation.Errors
The separator between path elements in a nested path, for example in "customer.name" or "customer.address.street".
NESTED_PATH_VARIABLE_NAME - Static variable in class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
Name of the exposed path variable within the scope of this tag: "nestedPath".
NESTED_PATH_VARIABLE_NAME - Static variable in class org.springframework.web.servlet.tags.NestedPathTag
Name of the exposed variable within the scope of this tag: "nestedPath".
NESTED_PROPERTY_SEPARATOR - Static variable in interface org.springframework.beans.PropertyAccessor
Path separator for nested properties.
NESTED_PROPERTY_SEPARATOR_CHAR - Static variable in interface org.springframework.beans.PropertyAccessor
NestedCheckedException - Exception in org.springframework.core
Handy class for wrapping checked Exceptions with a root cause.
NestedCheckedException(String) - Constructor for exception org.springframework.core.NestedCheckedException
Construct a NestedCheckedException with the specified detail message.
NestedCheckedException(String, Throwable) - Constructor for exception org.springframework.core.NestedCheckedException
Construct a NestedCheckedException with the specified detail message and nested exception.
NestedExceptionUtils - Class in org.springframework.core
Helper class for implementing exception classes which are capable of holding nested exceptions.
NestedExceptionUtils() - Constructor for class org.springframework.core.NestedExceptionUtils
NestedIOException - Exception in org.springframework.core
Subclass of IOException that properly handles a root cause, exposing the root cause just like NestedChecked/RuntimeException does.
NestedIOException(String) - Constructor for exception org.springframework.core.NestedIOException
Construct a NestedIOException with the specified detail message.
NestedIOException(String, Throwable) - Constructor for exception org.springframework.core.NestedIOException
Construct a NestedIOException with the specified detail message and nested exception.
NestedPathTag - Class in org.springframework.web.servlet.tags
Nested-path tag, to support and assist with nested beans or bean properties in the model.
NestedPathTag() - Constructor for class org.springframework.web.servlet.tags.NestedPathTag
NestedRuntimeException - Exception in org.springframework.core
Handy class for wrapping runtime Exceptions with a root cause.
NestedRuntimeException(String) - Constructor for exception org.springframework.core.NestedRuntimeException
Construct a NestedRuntimeException with the specified detail message.
NestedRuntimeException(String, Throwable) - Constructor for exception org.springframework.core.NestedRuntimeException
Construct a NestedRuntimeException with the specified detail message and nested exception.
NestedServletException - Exception in org.springframework.web.util
Subclass of ServletException that properly handles a root cause in terms of message and stacktrace, just like NestedChecked/RuntimeException does.
NestedServletException(String) - Constructor for exception org.springframework.web.util.NestedServletException
Construct a NestedServletException with the specified detail message.
NestedServletException(String, Throwable) - Constructor for exception org.springframework.web.util.NestedServletException
Construct a NestedServletException with the specified detail message and nested exception.
NestedTransactionNotSupportedException - Exception in org.springframework.transaction
Exception thrown when attempting to work with a nested transaction but nested transactions are not supported by the underlying backend.
NestedTransactionNotSupportedException(String) - Constructor for exception org.springframework.transaction.NestedTransactionNotSupportedException
Constructor for NestedTransactionNotSupportedException.
NestedTransactionNotSupportedException(String, Throwable) - Constructor for exception org.springframework.transaction.NestedTransactionNotSupportedException
Constructor for NestedTransactionNotSupportedException.
newArgPreparedStatementSetter(Object[]) - Method in class org.springframework.jdbc.core.JdbcTemplate
Create a new ArgPreparedStatementSetter using the args passed in.
newArgTypePreparedStatementSetter(Object[], int[]) - Method in class org.springframework.jdbc.core.JdbcTemplate
Create a new ArgTypePreparedStatementSetter using the args and argTypes passed in.
newCachedRowSet() - Method in class org.springframework.jdbc.core.SqlRowSetResultSetExtractor
Create a new CachedRowSet instance, to be populated by the createSqlRowSet implementation.
newCallableStatementCreator(Map<String, ?>) - Method in class org.springframework.jdbc.core.CallableStatementCreatorFactory
Return a new CallableStatementCreator instance given this parameters.
newCallableStatementCreator(ParameterMapper) - Method in class org.springframework.jdbc.core.CallableStatementCreatorFactory
Return a new CallableStatementCreator instance given this parameter mapper.
newCallableStatementCreator(Map<String, ?>) - Method in class org.springframework.jdbc.object.SqlCall
Return a CallableStatementCreator to perform an operation with this parameters.
newCallableStatementCreator(ParameterMapper) - Method in class org.springframework.jdbc.object.SqlCall
Return a CallableStatementCreator to perform an operation with the parameters returned from this ParameterMapper.
newCommandObject(Class) - Method in class org.springframework.web.servlet.mvc.multiaction.MultiActionController
Create a new command object of the given class.
newConfiguration() - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Subclasses can override this method to perform custom initialization of the Configuration instance used for SessionFactory creation.
newConfiguration() - Method in class org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
Return a new Configuration object.
newDocument() - Method in class org.springframework.web.servlet.view.document.AbstractPdfView
Create a new document to hold the PDF contents.
newFeed() - Method in class org.springframework.web.servlet.view.feed.AbstractAtomFeedView
Create a new Feed instance to hold the entries.
newFeed() - Method in class org.springframework.web.servlet.view.feed.AbstractFeedView
Create a new feed to hold the entries.
newFeed() - Method in class org.springframework.web.servlet.view.feed.AbstractRssFeedView
Create a new Channel instance to hold the entries.
newFileItemFactory() - Method in class org.springframework.web.multipart.commons.CommonsFileUploadSupport
Factory method for a Commons DiskFileItemFactory instance.
newFileUpload(FileItemFactory) - Method in class org.springframework.web.multipart.commons.CommonsFileUploadSupport
Factory method for a Commons FileUpload instance.
newFileUpload(FileItemFactory) - Method in class org.springframework.web.multipart.commons.CommonsMultipartResolver
Initialize the underlying org.apache.commons.fileupload.servlet.ServletFileUpload instance.
newFileUpload(FileItemFactory) - Method in class org.springframework.web.portlet.multipart.CommonsPortletMultipartResolver
Initialize the underlying org.apache.commons.fileupload.portlet.PortletFileUpload instance.
newInstance(Class<T>) - Static method in class org.springframework.jdbc.core.BeanPropertyRowMapper
Static factory method to create a new BeanPropertyRowMapper (with the mapped class specified only once).
newInstance(Class<T>) - Static method in class org.springframework.jdbc.core.simple.ParameterizedBeanPropertyRowMapper
Static factory method to create a new ParameterizedBeanPropertyRowMapper (with the mapped class specified only once).
newInstance(Class<T>) - Static method in class org.springframework.jdbc.core.simple.ParameterizedSingleColumnRowMapper
Static factory method to create a new ParameterizedSingleColumnRowMapper (with the required type specified only once).
newJdbcExceptionTranslator(SessionFactory) - Static method in class org.springframework.orm.hibernate3.SessionFactoryUtils
Create an appropriate SQLExceptionTranslator for the given SessionFactory.
newJob(TriggerFiredBundle) - Method in class org.springframework.scheduling.quartz.AdaptableJobFactory
newLine() - Method in class org.springframework.mock.web.MockBodyContent
newLine() - Method in class org.springframework.mock.web.MockJspWriter
newMarshallingSqlXmlValue(Object) - Method in interface org.springframework.jdbc.support.xml.SqlXmlObjectMappingHandler
Get an instance of an SqlXmlValue implementation to be used together with the database specific implementation of this SqlXmlObjectMappingHandler.
newNestedBeanWrapper(Object, String) - Method in class org.springframework.beans.BeanWrapperImpl
Create a new nested BeanWrapper instance.
newPersistenceManagerFactory(String) - Method in class org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean
Subclasses can override this to perform custom initialization of the PersistenceManagerFactory instance, creating it for the specified name.
newPersistenceManagerFactory(Map) - Method in class org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean
Subclasses can override this to perform custom initialization of the PersistenceManagerFactory instance, creating it via the given Properties that got prepared by this LocalPersistenceManagerFactoryBean.
newPreparedStatementCreator(List<?>) - Method in class org.springframework.jdbc.core.PreparedStatementCreatorFactory
Return a new PreparedStatementCreator for the given parameters.
newPreparedStatementCreator(Object[]) - Method in class org.springframework.jdbc.core.PreparedStatementCreatorFactory
Return a new PreparedStatementCreator for the given parameters.
newPreparedStatementCreator(String, Object[]) - Method in class org.springframework.jdbc.core.PreparedStatementCreatorFactory
Return a new PreparedStatementCreator for the given parameters.
newPreparedStatementCreator(Object[]) - Method in class org.springframework.jdbc.object.SqlOperation
Return a PreparedStatementCreator to perform an operation with the given parameters.
newPreparedStatementCreator(String, Object[]) - Method in class org.springframework.jdbc.object.SqlOperation
Return a PreparedStatementCreator to perform an operation with the given parameters.
newPreparedStatementSetter(List) - Method in class org.springframework.jdbc.core.PreparedStatementCreatorFactory
Return a new PreparedStatementSetter for the given parameters.
newPreparedStatementSetter(Object[]) - Method in class org.springframework.jdbc.core.PreparedStatementCreatorFactory
Return a new PreparedStatementSetter for the given parameters.
newPreparedStatementSetter(Object[]) - Method in class org.springframework.jdbc.object.SqlOperation
Return a PreparedStatementSetter to perform an operation with the given parameters.
newPrototypeInstance() - Method in class org.springframework.aop.target.AbstractPrototypeBasedTargetSource
Subclasses should call this method to create a new prototype instance.
newRowMapper(Object[], Map) - Method in class org.springframework.jdbc.object.GenericSqlQuery
newRowMapper(Object[], Map) - Method in class org.springframework.jdbc.object.MappingSqlQueryWithParameters
Implementation of protected abstract method.
newRowMapper(Object[], Map) - Method in class org.springframework.jdbc.object.SqlQuery
Subclasses must implement this method to extract an object per row, to be returned by the execute method as an aggregated List.
newRowMapper(Object[], Map) - Method in class org.springframework.jdbc.object.UpdatableSqlQuery
Implementation of the superclass template method.
newSessionBeanInstance() - Method in class org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor
Return a new instance of the stateless session bean.
newSessionBeanInstance() - Method in class org.springframework.ejb.access.LocalSlsbInvokerInterceptor
Return a new instance of the stateless session bean.
newSessionFactory(Configuration) - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Subclasses can override this method to perform custom initialization of the SessionFactory instance, creating it via the given Configuration object that got prepared by this LocalSessionFactoryBean.
newSqlXmlValue(String) - Method in class org.springframework.jdbc.support.xml.Jdbc4SqlXmlHandler
newSqlXmlValue(XmlBinaryStreamProvider) - Method in class org.springframework.jdbc.support.xml.Jdbc4SqlXmlHandler
newSqlXmlValue(XmlCharacterStreamProvider) - Method in class org.springframework.jdbc.support.xml.Jdbc4SqlXmlHandler
newSqlXmlValue(Class, XmlResultProvider) - Method in class org.springframework.jdbc.support.xml.Jdbc4SqlXmlHandler
newSqlXmlValue(Document) - Method in class org.springframework.jdbc.support.xml.Jdbc4SqlXmlHandler
newSqlXmlValue(String) - Method in interface org.springframework.jdbc.support.xml.SqlXmlHandler
Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.
newSqlXmlValue(XmlBinaryStreamProvider) - Method in interface org.springframework.jdbc.support.xml.SqlXmlHandler
Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.
newSqlXmlValue(XmlCharacterStreamProvider) - Method in interface org.springframework.jdbc.support.xml.SqlXmlHandler
Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.
newSqlXmlValue(Class, XmlResultProvider) - Method in interface org.springframework.jdbc.support.xml.SqlXmlHandler
Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.
newSqlXmlValue(Document) - Method in interface org.springframework.jdbc.support.xml.SqlXmlHandler
Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.
newThread(Runnable) - Method in class org.springframework.scheduling.backportconcurrent.CustomizableThreadFactory
newThread(Runnable) - Method in class org.springframework.scheduling.concurrent.CustomizableThreadFactory
newTransactionStatus(TransactionStatus) - Method in class org.springframework.transaction.interceptor.TransactionAspectSupport.TransactionInfo
newTransactionStatus(TransactionDefinition, Object, boolean, boolean, boolean, Object) - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Create a rae TransactionStatus instance for the given arguments.
newTransformerFactory(Class) - Method in class org.springframework.web.servlet.view.xslt.AbstractXsltView
Deprecated. Instantiate a new TransformerFactory for this view.
newTransformerFactory(Class) - Method in class org.springframework.web.servlet.view.xslt.XsltView
Instantiate a new TransformerFactory for this view.
newVelocityEngine() - Method in class org.springframework.ui.velocity.VelocityEngineFactory
Return a new VelocityEngine.
newWriter(Document, OutputStream) - Method in class org.springframework.web.servlet.view.document.AbstractPdfView
Create a new PdfWriter for the given iText Document.
next() - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
next() - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Moves the cursor to the next row.
next(Date) - Method in class org.springframework.scheduling.support.CronSequenceGenerator
Get the next Date in the sequence matching the Cron pattern and after the value provided.
next() - Method in class org.springframework.util.CompositeIterator
nextChildIs(Class...) - Method in class org.springframework.expression.spel.ast.SpelNodeImpl
nextExecutionTime(TriggerContext) - Method in class org.springframework.scheduling.support.CronTrigger
nextExecutionTime(TriggerContext) - Method in class org.springframework.scheduling.support.PeriodicTrigger
Returns the time after which a task should run again.
nextExecutionTime(TriggerContext) - Method in interface org.springframework.scheduling.Trigger
Determine the next execution time according to the given trigger context.
nextIntValue() - Method in class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
nextIntValue() - Method in interface org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer
Increment the data store field's max value as int.
nextLongValue() - Method in class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
nextLongValue() - Method in interface org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer
Increment the data store field's max value as long.
nextPage() - Method in class org.springframework.beans.support.PagedListHolder
Switch to next page.
nextStringValue() - Method in class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
nextStringValue() - Method in interface org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer
Increment the data store field's max value as String.
nextThreadName() - Method in class org.springframework.util.CustomizableThreadCreator
Return the thread name to use for a newly created thread.
nextTimestamp() - Method in class org.springframework.orm.hibernate3.LocalCacheProviderProxy
nextTimestamp() - Method in class org.springframework.orm.hibernate3.LocalRegionFactoryProxy
NO_CONCURRENCY - Static variable in class org.springframework.core.task.SimpleAsyncTaskExecutor
Switch concurrency 'off': that is, don't allow any concurrent invocations.
NO_CONCURRENCY - Static variable in class org.springframework.util.ConcurrencyThrottleSupport
Switch concurrency 'off': that is, don't allow any concurrent invocations.
nodeNameEquals(Node, String) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Determines whether the name of the supplied node is equal to the supplied name.
nodeNameEquals(Node, String) - Static method in class org.springframework.util.xml.DomUtils
Namespace-aware equals comparison.
noHandlerFound(PortletRequest, PortletResponse) - Method in class org.springframework.web.portlet.DispatcherPortlet
No handler found -> throw appropriate exception.
noHandlerFound(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.DispatcherServlet
No handler found -> set appropriate HTTP response status.
noMessageReceived(Object, Session) - Method in class org.springframework.jms.listener.AbstractPollingMessageListenerContainer
Template method that gets called right no message has been received, before attempting to process it.
noMessageReceived(Object, Session) - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Marks the affected invoker as idle.
NON_BRIDGED_METHODS - Static variable in class org.springframework.util.ReflectionUtils
Pre-built MethodFilter that matches all non-bridge methods.
NON_TX_DATA_SOURCE_PREFIX - Static variable in class org.springframework.scheduling.quartz.LocalDataSourceJobStore
Name used for the non-transactional ConnectionProvider for Quartz.
NonTransientDataAccessException - Exception in org.springframework.dao
Root of the hierarchy of data access exceptions that are considered non-transient - where a retry of the same operation would fail unless the cause of the Exception is corrected.
NonTransientDataAccessException(String) - Constructor for exception org.springframework.dao.NonTransientDataAccessException
Constructor for NonTransientDataAccessException.
NonTransientDataAccessException(String, Throwable) - Constructor for exception org.springframework.dao.NonTransientDataAccessException
Constructor for NonTransientDataAccessException.
NonTransientDataAccessResourceException - Exception in org.springframework.dao
Data access exception thrown when a resource fails completely and the failure is permanent.
NonTransientDataAccessResourceException(String) - Constructor for exception org.springframework.dao.NonTransientDataAccessResourceException
Constructor for NonTransientDataAccessResourceException.
NonTransientDataAccessResourceException(String, Throwable) - Constructor for exception org.springframework.dao.NonTransientDataAccessResourceException
Constructor for NonTransientDataAccessResourceException.
noNullElements(Object[], String) - Static method in class org.springframework.util.Assert
Assert that an array has no null elements.
noNullElements(Object[]) - Static method in class org.springframework.util.Assert
Assert that an array has no null elements.
NoRollbackRuleAttribute - Class in org.springframework.transaction.interceptor
Tag subclass of RollbackRuleAttribute that has the opposite behavior to the RollbackRuleAttribute superclass.
NoRollbackRuleAttribute(Class) - Constructor for class org.springframework.transaction.interceptor.NoRollbackRuleAttribute
Create a new instance of the NoRollbackRuleAttribute class for the supplied Throwable class.
NoRollbackRuleAttribute(String) - Constructor for class org.springframework.transaction.interceptor.NoRollbackRuleAttribute
Create a new instance of the NoRollbackRuleAttribute class for the supplied exceptionName.
NoSuchBeanDefinitionException - Exception in org.springframework.beans.factory
Exception thrown when a BeanFactory is asked for a bean instance name for which it cannot find a definition.
NoSuchBeanDefinitionException(String) - Constructor for exception org.springframework.beans.factory.NoSuchBeanDefinitionException
Create a new NoSuchBeanDefinitionException.
NoSuchBeanDefinitionException(String, String) - Constructor for exception org.springframework.beans.factory.NoSuchBeanDefinitionException
Create a new NoSuchBeanDefinitionException.
NoSuchBeanDefinitionException(Class) - Constructor for exception org.springframework.beans.factory.NoSuchBeanDefinitionException
Create a new NoSuchBeanDefinitionException.
NoSuchBeanDefinitionException(Class, String) - Constructor for exception org.springframework.beans.factory.NoSuchBeanDefinitionException
Create a new NoSuchBeanDefinitionException.
NoSuchBeanDefinitionException(Class, String, String) - Constructor for exception org.springframework.beans.factory.NoSuchBeanDefinitionException
Create a new NoSuchBeanDefinitionException.
NoSuchMessageException - Exception in org.springframework.context
Exception thrown when a message can't be resolved.
NoSuchMessageException(String, Locale) - Constructor for exception org.springframework.context.NoSuchMessageException
Create a new exception.
NoSuchMessageException(String) - Constructor for exception org.springframework.context.NoSuchMessageException
Create a new exception.
NoSuchRequestHandlingMethodException - Exception in org.springframework.web.servlet.mvc.multiaction
Exception thrown when there is no handler method ("action" method) for a specific HTTP request.
NoSuchRequestHandlingMethodException(HttpServletRequest) - Constructor for exception org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException
Create a new NoSuchRequestHandlingMethodException for the given request.
NoSuchRequestHandlingMethodException(String, String, Map) - Constructor for exception org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException
Create a new NoSuchRequestHandlingMethodException.
NoSuchRequestHandlingMethodException(String, Class) - Constructor for exception org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException
Create a new NoSuchRequestHandlingMethodException for the given request.
NotAnAtAspectException - Exception in org.springframework.aop.aspectj.annotation
Extension of AopConfigException thrown when trying to perform an advisor generation operation on a class that is not an AspectJ annotation-style aspect.
NotAnAtAspectException(Class<?>) - Constructor for exception org.springframework.aop.aspectj.annotation.NotAnAtAspectException
Create a new NotAnAtAspectException for the given class.
notEmpty(Object[], String) - Static method in class org.springframework.util.Assert
Assert that an array has elements; that is, it must not be null and must have at least one element.
notEmpty(Object[]) - Static method in class org.springframework.util.Assert
Assert that an array has elements; that is, it must not be null and must have at least one element.
notEmpty(Collection, String) - Static method in class org.springframework.util.Assert
Assert that a collection has elements; that is, it must not be null and must have at least one element.
notEmpty(Collection) - Static method in class org.springframework.util.Assert
Assert that a collection has elements; that is, it must not be null and must have at least one element.
notEmpty(Map, String) - Static method in class org.springframework.util.Assert
Assert that a Map has entries; that is, it must not be null and must have at least one entry.
notEmpty(Map) - Static method in class org.springframework.util.Assert
Assert that a Map has entries; that is, it must not be null and must have at least one entry.
NotificationListenerBean - Class in org.springframework.jmx.export
Helper class that aggregates a NotificationListener, a NotificationFilter, and an arbitrary handback object.
NotificationListenerBean() - Constructor for class org.springframework.jmx.export.NotificationListenerBean
Create a new instance of the NotificationListenerBean class.
NotificationListenerBean(NotificationListener) - Constructor for class org.springframework.jmx.export.NotificationListenerBean
Create a new instance of the NotificationListenerBean class.
NotificationListenerHolder - Class in org.springframework.jmx.support
Helper class that aggregates a NotificationListener, a NotificationFilter, and an arbitrary handback object, as well as the names of MBeans from which the listener wishes to receive Notifications.
NotificationListenerHolder() - Constructor for class org.springframework.jmx.support.NotificationListenerHolder
NotificationListenerRegistrar - Class in org.springframework.jmx.access
Registrar object that associates a specific NotificationListener with one or more MBeans in an MBeanServer (typically via a MBeanServerConnection).
NotificationListenerRegistrar() - Constructor for class org.springframework.jmx.access.NotificationListenerRegistrar
NotificationPublisher - Interface in org.springframework.jmx.export.notification
Simple interface allowing Spring-managed MBeans to publish JMX notifications without being aware of how those notifications are being transmitted to the MBeanServer.
NotificationPublisherAware - Interface in org.springframework.jmx.export.notification
Interface to be implemented by any Spring-managed resource that is to be registered with an MBeanServer and wishes to send JMX javax.management.Notifications.
notNull(Object, String) - Static method in class org.springframework.util.Assert
Assert that an object is not null .
notNull(Object) - Static method in class org.springframework.util.Assert
Assert that an object is not null .
NoTransactionException - Exception in org.springframework.transaction
Exception thrown when an operation is attempted that relies on an existing transaction (such as setting rollback status) and there is no existing transaction.
NoTransactionException(String) - Constructor for exception org.springframework.transaction.NoTransactionException
Constructor for NoTransactionException.
NoTransactionException(String, Throwable) - Constructor for exception org.springframework.transaction.NoTransactionException
Constructor for NoTransactionException.
NotReadablePropertyException - Exception in org.springframework.beans
Exception thrown on an attempt to get the value of a property that isn't readable, because there's no getter method.
NotReadablePropertyException(Class, String) - Constructor for exception org.springframework.beans.NotReadablePropertyException
Create a new NotReadablePropertyException.
NotReadablePropertyException(Class, String, String) - Constructor for exception org.springframework.beans.NotReadablePropertyException
Create a new NotReadablePropertyException.
NotSupportedRecordFactory - Class in org.springframework.jca.cci.connection
Implementation of the CCI RecordFactory interface that always throws NotSupportedException.
NotSupportedRecordFactory() - Constructor for class org.springframework.jca.cci.connection.NotSupportedRecordFactory
NotTransactional - Annotation Type in org.springframework.test.annotation
Deprecated. as of Spring 3.0, in favor of moving the non-transactional test method to a separate (non-transactional) test class or to a @BeforeTransaction or @AfterTransaction method.
NotWritablePropertyException - Exception in org.springframework.beans
Exception thrown on an attempt to set the value of a property that is not writable (typically because there is no setter method).
NotWritablePropertyException(Class, String) - Constructor for exception org.springframework.beans.NotWritablePropertyException
Create a new NotWritablePropertyException.
NotWritablePropertyException(Class, String, String) - Constructor for exception org.springframework.beans.NotWritablePropertyException
Create a new NotWritablePropertyException.
NotWritablePropertyException(Class, String, String, Throwable) - Constructor for exception org.springframework.beans.NotWritablePropertyException
Create a new NotWritablePropertyException.
NotWritablePropertyException(Class, String, String, String[]) - Constructor for exception org.springframework.beans.NotWritablePropertyException
Create a new NotWritablePropertyException.
NULL - Static variable in class org.springframework.core.convert.TypeDescriptor
Constant defining an 'unknown' TypeDescriptor
NULL - Static variable in class org.springframework.expression.TypedValue
NULL_ELEMENT - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
NULL_OBJECT - Static variable in class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
Internal marker for a null singleton object: used as marker value for concurrent Maps (which don't support null values).
NullLiteral - Class in org.springframework.expression.spel.ast
NullLiteral(int) - Constructor for class org.springframework.expression.spel.ast.NullLiteral
NULLS_HIGH - Static variable in class org.springframework.util.comparator.NullSafeComparator
A shared default instance of this comparator, treating nulls higher than non-null objects.
NULLS_LOW - Static variable in class org.springframework.util.comparator.NullSafeComparator
A shared default instance of this comparator, treating nulls lower than non-null objects.
nullSafeClassName(Object) - Static method in class org.springframework.util.ObjectUtils
Determine the class name for the given object.
NullSafeComparator<T> - Class in org.springframework.util.comparator
A Comparator that will safely compare nulls to be lower or higher than other objects.
NullSafeComparator(Comparator<T>, boolean) - Constructor for class org.springframework.util.comparator.NullSafeComparator
Create a NullSafeComparator that sorts null based on the provided flag, decorating the given Comparator.
nullSafeEquals(Object, Object) - Static method in class org.springframework.util.ObjectUtils
Determine if the given objects are equal, returning true if both are null or false if only one is null.
nullSafeGet(ResultSet, String[], Object) - Method in class org.springframework.orm.hibernate3.support.AbstractLobType
This implementation delegates to nullSafeGetInternal, passing in the LobHandler of this type.
nullSafeGetInternal(ResultSet, String[], Object, LobHandler) - Method in class org.springframework.orm.hibernate3.support.AbstractLobType
Template method to extract a value from the given result set.
nullSafeGetInternal(ResultSet, String[], Object, LobHandler) - Method in class org.springframework.orm.hibernate3.support.BlobByteArrayType
nullSafeGetInternal(ResultSet, String[], Object, LobHandler) - Method in class org.springframework.orm.hibernate3.support.BlobSerializableType
nullSafeGetInternal(ResultSet, String[], Object, LobHandler) - Method in class org.springframework.orm.hibernate3.support.BlobStringType
nullSafeGetInternal(ResultSet, String[], Object, LobHandler) - Method in class org.springframework.orm.hibernate3.support.ClobStringType
nullSafeHashCode(Object) - Static method in class org.springframework.util.ObjectUtils
Return as hash code for the given object; typically the value of Object.hashCode().
nullSafeHashCode(Object[]) - Static method in class org.springframework.util.ObjectUtils
Return a hash code based on the contents of the specified array.
nullSafeHashCode(boolean[]) - Static method in class org.springframework.util.ObjectUtils
Return a hash code based on the contents of the specified array.
nullSafeHashCode(byte[]) - Static method in class org.springframework.util.ObjectUtils
Return a hash code based on the contents of the specified array.
nullSafeHashCode(char[]) - Static method in class org.springframework.util.ObjectUtils
Return a hash code based on the contents of the specified array.
nullSafeHashCode(double[]) - Static method in class org.springframework.util.ObjectUtils
Return a hash code based on the contents of the specified array.
nullSafeHashCode(float[]) - Static method in class org.springframework.util.ObjectUtils
Return a hash code based on the contents of the specified array.
nullSafeHashCode(int[]) - Static method in class org.springframework.util.ObjectUtils
Return a hash code based on the contents of the specified array.
nullSafeHashCode(long[]) - Static method in class org.springframework.util.ObjectUtils
Return a hash code based on the contents of the specified array.
nullSafeHashCode(short[]) - Static method in class org.springframework.util.ObjectUtils
Return a hash code based on the contents of the specified array.
nullSafeSet(PreparedStatement, Object, int) - Method in class org.springframework.orm.hibernate3.support.AbstractLobType
This implementation delegates to nullSafeSetInternal, passing in a transaction-synchronized LobCreator for the LobHandler of this type.
nullSafeSetInternal(PreparedStatement, int, Object, LobCreator) - Method in class org.springframework.orm.hibernate3.support.AbstractLobType
Template method to set the given parameter value on the given statement.
nullSafeSetInternal(PreparedStatement, int, Object, LobCreator) - Method in class org.springframework.orm.hibernate3.support.BlobByteArrayType
nullSafeSetInternal(PreparedStatement, int, Object, LobCreator) - Method in class org.springframework.orm.hibernate3.support.BlobSerializableType
nullSafeSetInternal(PreparedStatement, int, Object, LobCreator) - Method in class org.springframework.orm.hibernate3.support.BlobStringType
nullSafeSetInternal(PreparedStatement, int, Object, LobCreator) - Method in class org.springframework.orm.hibernate3.support.ClobStringType
nullSafeToString(Object) - Static method in class org.springframework.util.ObjectUtils
Return a String representation of the specified Object.
nullSafeToString(Object[]) - Static method in class org.springframework.util.ObjectUtils
Return a String representation of the contents of the specified array.
nullSafeToString(boolean[]) - Static method in class org.springframework.util.ObjectUtils
Return a String representation of the contents of the specified array.
nullSafeToString(byte[]) - Static method in class org.springframework.util.ObjectUtils
Return a String representation of the contents of the specified array.
nullSafeToString(char[]) - Static method in class org.springframework.util.ObjectUtils
Return a String representation of the contents of the specified array.
nullSafeToString(double[]) - Static method in class org.springframework.util.ObjectUtils
Return a String representation of the contents of the specified array.
nullSafeToString(float[]) - Static method in class org.springframework.util.ObjectUtils
Return a String representation of the contents of the specified array.
nullSafeToString(int[]) - Static method in class org.springframework.util.ObjectUtils
Return a String representation of the contents of the specified array.
nullSafeToString(long[]) - Static method in class org.springframework.util.ObjectUtils
Return a String representation of the contents of the specified array.
nullSafeToString(short[]) - Static method in class org.springframework.util.ObjectUtils
Return a String representation of the contents of the specified array.
NullSourceExtractor - Class in org.springframework.beans.factory.parsing
Simple implementation of SourceExtractor that returns null as the source metadata.
NullSourceExtractor() - Constructor for class org.springframework.beans.factory.parsing.NullSourceExtractor
NullValueInNestedPathException - Exception in org.springframework.beans
Exception thrown when navigation of a valid nested property path encounters a NullPointerException.
NullValueInNestedPathException(Class, String) - Constructor for exception org.springframework.beans.NullValueInNestedPathException
Create a new NullValueInNestedPathException.
NullValueInNestedPathException(Class, String, String) - Constructor for exception org.springframework.beans.NullValueInNestedPathException
Create a new NullValueInNestedPathException.
NumberFormat - Annotation Type in org.springframework.format.annotation
Declares that a field should be formatted as a number.
NumberFormat.Style - Enum in org.springframework.format.annotation
Common number format styles.
NumberFormatAnnotationFormatterFactory - Class in org.springframework.format.number
Formats fields annotated with the NumberFormat annotation.
NumberFormatAnnotationFormatterFactory() - Constructor for class org.springframework.format.number.NumberFormatAnnotationFormatterFactory
NumberFormatter - Class in org.springframework.format.number
A general-purpose Number formatter.
NumberFormatter() - Constructor for class org.springframework.format.number.NumberFormatter
Create a new NumberFormatter without a pattern.
NumberFormatter(String) - Constructor for class org.springframework.format.number.NumberFormatter
Create a new NumberFormatter with the specified pattern.
NumberUtils - Class in org.springframework.util
Miscellaneous utility methods for number conversion and parsing.
NumberUtils() - Constructor for class org.springframework.util.NumberUtils
Overview Package Class Tree Deprecated Index Help
A B C D E F G H I J K L M N O P Q R S T U V W X


O-Index

PREV LETTER NEXT LETTER FRAMES NO FRAMES
A B C D E F G H I J K L M N O P Q R S T U V W X

O

ObjectError - Class in org.springframework.validation
Encapsulates an object error, that is, a global reason for rejecting an object.
ObjectError(String, String) - Constructor for class org.springframework.validation.ObjectError
Create a new instance of the ObjectError class.
ObjectError(String, String[], Object[], String) - Constructor for class org.springframework.validation.ObjectError
Create a new instance of the ObjectError class.
ObjectFactory<T> - Interface in org.springframework.beans.factory
Defines a factory which can return an Object instance (possibly shared or independent) when invoked.
ObjectFactoryCreatingFactoryBean - Class in org.springframework.beans.factory.config
A FactoryBean implementation that returns a value which is an ObjectFactory that in turn returns a bean sourced from a BeanFactory.
ObjectFactoryCreatingFactoryBean() - Constructor for class org.springframework.beans.factory.config.ObjectFactoryCreatingFactoryBean
ObjectNameManager - Class in org.springframework.jmx.support
Helper class for the creation of ObjectName instances.
ObjectNameManager() - Constructor for class org.springframework.jmx.support.ObjectNameManager
ObjectNamingStrategy - Interface in org.springframework.jmx.export.naming
Strategy interface that encapsulates the creation of ObjectName instances.
ObjectOptimisticLockingFailureException - Exception in org.springframework.orm
Exception thrown on an optimistic locking violation for a mapped object.
ObjectOptimisticLockingFailureException(String, Throwable) - Constructor for exception org.springframework.orm.ObjectOptimisticLockingFailureException
Create a general ObjectOptimisticLockingFailureException with the given message, without any information on the affected object.
ObjectOptimisticLockingFailureException(Class, Object) - Constructor for exception org.springframework.orm.ObjectOptimisticLockingFailureException
Create a new ObjectOptimisticLockingFailureException for the given object, with the default "optimistic locking failed" message.
ObjectOptimisticLockingFailureException(Class, Object, Throwable) - Constructor for exception org.springframework.orm.ObjectOptimisticLockingFailureException
Create a new ObjectOptimisticLockingFailureException for the given object, with the default "optimistic locking failed" message.
ObjectOptimisticLockingFailureException(Class, Object, String, Throwable) - Constructor for exception org.springframework.orm.ObjectOptimisticLockingFailureException
Create a new ObjectOptimisticLockingFailureException for the given object, with the given explicit message.
ObjectOptimisticLockingFailureException(String, Object) - Constructor for exception org.springframework.orm.ObjectOptimisticLockingFailureException
Create a new ObjectOptimisticLockingFailureException for the given object, with the default "optimistic locking failed" message.
ObjectOptimisticLockingFailureException(String, Object, Throwable) - Constructor for exception org.springframework.orm.ObjectOptimisticLockingFailureException
Create a new ObjectOptimisticLockingFailureException for the given object, with the default "optimistic locking failed" message.
ObjectOptimisticLockingFailureException(String, Object, String, Throwable) - Constructor for exception org.springframework.orm.ObjectOptimisticLockingFailureException
Create a new ObjectOptimisticLockingFailureException for the given object, with the given explicit message.
objectResult(Collection<?>, Class<T>) - Static method in class org.springframework.dao.support.DataAccessUtils
Return a unique result object from the given Collection.
ObjectRetrievalFailureException - Exception in org.springframework.orm
Exception thrown if a mapped object could not be retrieved via its identifier.
ObjectRetrievalFailureException(String, Throwable) - Constructor for exception org.springframework.orm.ObjectRetrievalFailureException
Create a general ObjectRetrievalFailureException with the given message, without any information on the affected object.
ObjectRetrievalFailureException(Class, Object) - Constructor for exception org.springframework.orm.ObjectRetrievalFailureException
Create a new ObjectRetrievalFailureException for the given object, with the default "not found" message.
ObjectRetrievalFailureException(Class, Object, String, Throwable) - Constructor for exception org.springframework.orm.ObjectRetrievalFailureException
Create a new ObjectRetrievalFailureException for the given object, with the given explicit message and exception.
ObjectRetrievalFailureException(String, Object) - Constructor for exception org.springframework.orm.ObjectRetrievalFailureException
Create a new ObjectRetrievalFailureException for the given object, with the default "not found" message.
ObjectRetrievalFailureException(String, Object, String, Throwable) - Constructor for exception org.springframework.orm.ObjectRetrievalFailureException
Create a new ObjectRetrievalFailureException for the given object, with the given explicit message and exception.
objectToBytes(Object) - Method in class org.springframework.jca.cci.object.MappingCommAreaOperation
Method used to convert an object into COMMAREA bytes.
ObjectUtils - Class in org.springframework.util
Miscellaneous object utility methods.
ObjectUtils() - Constructor for class org.springframework.util.ObjectUtils
obtainDefaultPersistenceUnitInfo() - Method in class org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager
obtainDefaultPersistenceUnitInfo() - Method in interface org.springframework.orm.jpa.persistenceunit.PersistenceUnitManager
Obtain the default PersistenceUnitInfo from this manager.
obtainFreshBean(BeanFactory, String) - Method in class org.springframework.aop.target.dynamic.BeanFactoryRefreshableTargetSource
A template method that subclasses may override to provide a fresh target object for the given bean factory and bean name.
obtainFreshBean(BeanFactory, String) - Method in class org.springframework.scripting.support.RefreshableScriptTargetSource
Obtain a fresh target object, retrieving a FactoryBean if necessary.
obtainFreshBeanFactory() - Method in class org.springframework.context.support.AbstractApplicationContext
Tell the subclass to refresh the internal bean factory.
obtainPersistenceUnitInfo(String) - Method in class org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager
obtainPersistenceUnitInfo(String) - Method in interface org.springframework.orm.jpa.persistenceunit.PersistenceUnitManager
Obtain the specified PersistenceUnitInfo from this manager.
OC4JJtaTransactionManager - Class in org.springframework.transaction.jta
Special JtaTransactionManager variant for Oracle OC4J (10.1.3 and higher).
OC4JJtaTransactionManager() - Constructor for class org.springframework.transaction.jta.OC4JJtaTransactionManager
OC4JLoadTimeWeaver - Class in org.springframework.instrument.classloading.oc4j
LoadTimeWeaver implementation for OC4J's instrumentable ClassLoader.
OC4JLoadTimeWeaver() - Constructor for class org.springframework.instrument.classloading.oc4j.OC4JLoadTimeWeaver
Creates a new instance of thie OC4JLoadTimeWeaver class using the default class loader.
OC4JLoadTimeWeaver(ClassLoader) - Constructor for class org.springframework.instrument.classloading.oc4j.OC4JLoadTimeWeaver
Creates a new instance of the OC4JLoadTimeWeaver class using the supplied ClassLoader.
onApplicationEvent(E) - Method in interface org.springframework.context.ApplicationListener
Handle an application event.
onApplicationEvent(ApplicationEvent) - Method in class org.springframework.context.event.GenericApplicationListenerAdapter
onApplicationEvent(ApplicationEvent) - Method in class org.springframework.context.event.SourceFilteringListener
onApplicationEvent(ContextRefreshedEvent) - Method in class org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor
onApplicationEvent(ContextRefreshedEvent) - Method in class org.springframework.web.portlet.FrameworkPortlet
ApplicationListener endpoint that receives events from this servlet's WebApplicationContext.
onApplicationEvent(ContextRefreshedEvent) - Method in class org.springframework.web.servlet.FrameworkServlet
Callback that receives refresh events from this servlet's WebApplicationContext.
onApplicationEventInternal(ApplicationEvent) - Method in class org.springframework.context.event.SourceFilteringListener
Actually process the event, after having filtered according to the desired event source already.
onBind(PortletRequest, Object, BindException) - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Callback for custom post-processing in terms of binding.
onBind(PortletRequest, Object) - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Callback for custom post-processing in terms of binding.
onBind(HttpServletRequest, Object, BindException) - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Callback for custom post-processing in terms of binding.
onBind(HttpServletRequest, Object) - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Callback for custom post-processing in terms of binding.
onBindAndValidate(PortletRequest, Object, BindException) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Calls page-specific onBindAndValidate method.
onBindAndValidate(PortletRequest, Object, BindException, int) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Callback for custom post-processing in terms of binding and validation.
onBindAndValidate(PortletRequest, Object, BindException) - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Callback for custom post-processing in terms of binding and validation.
onBindAndValidate(HttpServletRequest, Object, BindException) - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Calls page-specific onBindAndValidate method.
onBindAndValidate(HttpServletRequest, Object, BindException, int) - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Callback for custom post-processing in terms of binding and validation.
onBindAndValidate(HttpServletRequest, Object, BindException) - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Callback for custom post-processing in terms of binding and validation.
onBindOnNewForm(RenderRequest, Object, BindException) - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Callback for custom post-processing in terms of binding for a new form.
onBindOnNewForm(RenderRequest, Object) - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Callback for custom post-processing in terms of binding for a new form.
onBindOnNewForm(HttpServletRequest, Object, BindException) - Method in class org.springframework.web.servlet.mvc.AbstractFormController
Deprecated. Callback for custom post-processing in terms of binding for a new form.
onBindOnNewForm(HttpServletRequest, Object) - Method in class org.springframework.web.servlet.mvc.AbstractFormController
Deprecated. Callback for custom post-processing in terms of binding for a new form.
ONBLUR_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
The name of the 'onblur' attribute.
onCancel(HttpServletRequest, HttpServletResponse, Object) - Method in class org.springframework.web.servlet.mvc.CancellableFormController
Deprecated. Callback method for handling a cancel request.
onCancel(Object) - Method in class org.springframework.web.servlet.mvc.CancellableFormController
Deprecated. Simple onCancel version.
OncePerRequestFilter - Class in org.springframework.web.filter
Filter base class that guarantees to be just executed once per request, on any servlet container.
OncePerRequestFilter() - Constructor for class org.springframework.web.filter.OncePerRequestFilter
ONCHANGE_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
The name of the 'onchange' attribute.
ONCLICK_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
onClose() - Method in interface org.springframework.context.LifecycleProcessor
Notification of context close phase, e.g.
onClose() - Method in class org.springframework.context.support.AbstractApplicationContext
Template method which can be overridden to add context-specific shutdown work.
onClose() - Method in class org.springframework.context.support.DefaultLifecycleProcessor
onCompileInternal() - Method in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Hook method that subclasses may override to react to compilation.
onCompileInternal() - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Hook method that subclasses may override to react to compilation.
onCompileInternal() - Method in class org.springframework.jdbc.object.SqlCall
Hook method that subclasses may override to react to compilation.
onCompileInternal() - Method in class org.springframework.jdbc.object.SqlOperation
Hook method that subclasses may override to post-process compilation.
ONDBLCLICK_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
onDestroy() - Method in class org.springframework.web.struts.ActionSupport
Deprecated. Callback for custom destruction when the ActionServlet shuts down.
onDestroy() - Method in class org.springframework.web.struts.DispatchActionSupport
Deprecated. Callback for custom destruction when the ActionServlet shuts down.
onDestroy() - Method in class org.springframework.web.struts.LookupDispatchActionSupport
Deprecated. Callback for custom destruction when the ActionServlet shuts down.
onDestroy() - Method in class org.springframework.web.struts.MappingDispatchActionSupport
Deprecated. Callback for custom destruction when the ActionServlet shuts down.
onEjbCreate() - Method in class org.springframework.ejb.support.AbstractMessageDrivenBean
Subclasses must implement this method to do any initialization they would otherwise have done in an ejbCreate() method.
onEjbCreate() - Method in class org.springframework.ejb.support.AbstractStatelessSessionBean
Subclasses must implement this method to do any initialization they would otherwise have done in an ejbCreate() method.
onEjbRemove() - Method in class org.springframework.ejb.support.AbstractEnterpriseBean
Subclasses must implement this method to do any initialization they would otherwise have done in an ejbRemove() method.
onEndpointException(Throwable) - Method in class org.springframework.jca.endpoint.AbstractMessageEndpointFactory.AbstractMessageEndpoint
Callback method for notifying the endpoint base class that the concrete endpoint invocation led to an exception.
onException(JMSException) - Method in class org.springframework.jms.connection.ChainedExceptionListener
onException(JMSException) - Method in class org.springframework.jms.connection.SingleConnectionFactory
Exception listener callback that renews the underlying single Connection.
onException(JMSException) - Method in class org.springframework.jms.listener.SimpleMessageListenerContainer
JMS ExceptionListener implementation, invoked by the JMS provider in case of connection failures.
ONFOCUS_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
The name of the 'onfocus' attribute.
onFormChange(ActionRequest, ActionResponse, Object, BindException) - Method in class org.springframework.web.portlet.mvc.SimpleFormController
Deprecated. Called during form submission if SimpleFormController.isFormChangeRequest(PortletRequest) returns true.
onFormChange(ActionRequest, ActionResponse, Object) - Method in class org.springframework.web.portlet.mvc.SimpleFormController
Deprecated. Simpler onFormChange variant, called by the full version onFormChange(request, response, command, errors).
onFormChange(HttpServletRequest, HttpServletResponse, Object, BindException) - Method in class org.springframework.web.servlet.mvc.SimpleFormController
Deprecated. Called during form submission if SimpleFormController.isFormChangeRequest(javax.servlet.http.HttpServletRequest) returns true.
onFormChange(HttpServletRequest, HttpServletResponse, Object) - Method in class org.springframework.web.servlet.mvc.SimpleFormController
Deprecated. Simpler onFormChange variant, called by the full variant SimpleFormController.onFormChange(HttpServletRequest, HttpServletResponse, Object, BindException).
onInit() - Method in class org.springframework.remoting.jaxrpc.ServletEndpointSupport
Deprecated. Callback for custom initialization after the context has been set up.
onInit() - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
Subclasses can override this to add some custom initialization logic.
onInit() - Method in class org.springframework.web.servlet.view.jasperreports.ConfigurableJasperReportsView
Checks that the exporterClass property is specified.
onInit() - Method in class org.springframework.web.struts.ActionSupport
Deprecated. Callback for custom initialization after the context has been set up.
onInit() - Method in class org.springframework.web.struts.ContextLoaderPlugIn
Deprecated. Callback for custom initialization after the context has been set up.
onInit() - Method in class org.springframework.web.struts.DispatchActionSupport
Deprecated. Callback for custom initialization after the context has been set up.
onInit() - Method in class org.springframework.web.struts.LookupDispatchActionSupport
Deprecated. Callback for custom initialization after the context has been set up.
onInit() - Method in class org.springframework.web.struts.MappingDispatchActionSupport
Deprecated. Callback for custom initialization after the context has been set up.
onInvalidRequest(Message) - Method in class org.springframework.jms.remoting.JmsInvokerServiceExporter
Callback that is invoked by JmsInvokerServiceExporter.readRemoteInvocation(javax.jms.Message) when it encounters an invalid request message.
onInvalidResponse(Message) - Method in class org.springframework.jms.remoting.JmsInvokerClientInterceptor
Callback that is invoked by extractInvocationResult when it encounters an invalid response message.
ONKEYDOWN_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
ONKEYPRESS_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
ONKEYUP_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
onMessage(Message) - Method in class org.springframework.jms.listener.adapter.MessageListenerAdapter
Standard JMS MessageListener entry point.
onMessage(Message, Session) - Method in class org.springframework.jms.listener.adapter.MessageListenerAdapter
Spring SessionAwareMessageListener entry point.
onMessage(M, Session) - Method in interface org.springframework.jms.listener.SessionAwareMessageListener
Callback for processing a received JMS message.
onMessage(Message, Session) - Method in class org.springframework.jms.remoting.JmsInvokerServiceExporter
ONMOUSEDOWN_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
ONMOUSEMOVE_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
ONMOUSEOUT_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
ONMOUSEOVER_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
ONMOUSEUP_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
onRefresh() - Method in interface org.springframework.context.LifecycleProcessor
Notification of context refresh, e.g.
onRefresh() - Method in class org.springframework.context.support.AbstractApplicationContext
Template method which can be overridden to add context-specific refresh work.
onRefresh() - Method in class org.springframework.context.support.DefaultLifecycleProcessor
onRefresh() - Method in class org.springframework.web.context.support.AbstractRefreshableWebApplicationContext
Initialize the theme capability.
onRefresh() - Method in class org.springframework.web.context.support.GenericWebApplicationContext
Initialize the theme capability.
onRefresh() - Method in class org.springframework.web.context.support.StaticWebApplicationContext
Initialize the theme capability.
onRefresh(ApplicationContext) - Method in class org.springframework.web.portlet.DispatcherPortlet
This implementation calls DispatcherPortlet.initStrategies(org.springframework.context.ApplicationContext).
onRefresh(ApplicationContext) - Method in class org.springframework.web.portlet.FrameworkPortlet
Template method which can be overridden to add portlet-specific refresh work.
onRefresh(ApplicationContext) - Method in class org.springframework.web.servlet.DispatcherServlet
This implementation calls DispatcherServlet.initStrategies(org.springframework.context.ApplicationContext).
onRefresh(ApplicationContext) - Method in class org.springframework.web.servlet.FrameworkServlet
Template method which can be overridden to add servlet-specific refresh work.
onRegister(ObjectName) - Method in class org.springframework.jmx.export.MBeanExporter
Called when an MBean is registered.
onRegister(ObjectName, Object) - Method in class org.springframework.jmx.support.MBeanRegistrationSupport
Called when an MBean is registered under the given ObjectName.
onRegister(ObjectName) - Method in class org.springframework.jmx.support.MBeanRegistrationSupport
Called when an MBean is registered under the given ObjectName.
ONSELECT_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.InputTag
ONSELECT_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.TextareaTag
onSetExpression(String) - Method in class org.springframework.aop.support.AbstractExpressionPointcut
Called when a new pointcut expression is set.
onSetUp() - Method in class org.springframework.test.AbstractSingleSpringContextTests
Deprecated. Subclasses can override this method in place of the setUp() method, which is final in this class.
onSetUp() - Method in class org.springframework.test.AbstractTransactionalSpringContextTests
Deprecated. This implementation creates a transaction before test execution.
onSetUpBeforeTransaction() - Method in class org.springframework.test.AbstractTransactionalSpringContextTests
Deprecated. Subclasses can override this method to perform any setup operations, such as populating a database table, before the transaction created by this class.
onSetUpInTransaction() - Method in class org.springframework.test.AbstractTransactionalSpringContextTests
Deprecated. Subclasses can override this method to perform any setup operations, such as populating a database table, within the transaction created by this class.
onSubmit(HttpServletRequest, HttpServletResponse, Object, BindException) - Method in class org.springframework.web.servlet.mvc.SimpleFormController
Deprecated. Submit callback with all parameters.
onSubmit(Object, BindException) - Method in class org.springframework.web.servlet.mvc.SimpleFormController
Deprecated. Simpler onSubmit variant.
onSubmit(Object) - Method in class org.springframework.web.servlet.mvc.SimpleFormController
Deprecated. Simplest onSubmit variant.
onSubmitAction(ActionRequest, ActionResponse, Object, BindException) - Method in class org.springframework.web.portlet.mvc.SimpleFormController
Deprecated. Submit action phase callback with all parameters.
onSubmitAction(Object, BindException) - Method in class org.springframework.web.portlet.mvc.SimpleFormController
Deprecated. Simpler onSubmitAction version.
onSubmitAction(Object) - Method in class org.springframework.web.portlet.mvc.SimpleFormController
Deprecated. Simplest onSubmitAction version.
onSubmitRender(RenderRequest, RenderResponse, Object, BindException) - Method in class org.springframework.web.portlet.mvc.SimpleFormController
Deprecated. Submit render phase callback with all parameters.
onSubmitRender(Object, BindException) - Method in class org.springframework.web.portlet.mvc.SimpleFormController
Deprecated. Simpler onSubmitRender version.
onSubmitRender(Object) - Method in class org.springframework.web.portlet.mvc.SimpleFormController
Deprecated. Simplest onSubmitRender version.
onSuppressedException(Exception) - Method in class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
Register an Exception that happened to get suppressed during the creation of a singleton bean instance, e.g.
onTearDown() - Method in class org.springframework.test.AbstractSingleSpringContextTests
Deprecated. Subclasses can override this to add custom behavior on teardown.
onTearDown() - Method in class org.springframework.test.AbstractTransactionalSpringContextTests
Deprecated. This implementation ends the transaction after test execution.
onTearDownAfterTransaction() - Method in class org.springframework.test.AbstractTransactionalSpringContextTests
Deprecated. Subclasses can override this method to perform cleanup after a transaction here.
onTearDownInTransaction() - Method in class org.springframework.test.AbstractTransactionalSpringContextTests
Deprecated. Subclasses can override this method to run invariant tests here.
onUnregister(ObjectName) - Method in class org.springframework.jmx.export.MBeanExporter
Called when an MBean is unregistered.
onUnregister(ObjectName) - Method in class org.springframework.jmx.support.MBeanRegistrationSupport
Called when an MBean is unregistered under the given ObjectName.
onWriteTagContent() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementBodyTag
Called at the start of AbstractHtmlElementBodyTag.writeTagContent(org.springframework.web.servlet.tags.form.TagWriter) allowing subclasses to perform any precondition checks or setup tasks that might be necessary.
onWriteTagContent() - Method in class org.springframework.web.servlet.tags.form.OptionTag
Make sure we are under a 'select' tag before proceeding.
OpAnd - Class in org.springframework.expression.spel.ast
Represents the boolean AND operation.
OpAnd(int, SpelNodeImpl...) - Constructor for class org.springframework.expression.spel.ast.OpAnd
OpDivide - Class in org.springframework.expression.spel.ast
Implements division operator.
OpDivide(int, SpelNodeImpl...) - Constructor for class org.springframework.expression.spel.ast.OpDivide
openConnection(HttpInvokerClientConfiguration) - Method in class org.springframework.remoting.httpinvoker.SimpleHttpInvokerRequestExecutor
Open an HttpURLConnection for the given remote invocation request.
OpenEntityManagerInViewFilter - Class in org.springframework.orm.jpa.support
Servlet 2.3 Filter that binds a JPA EntityManager to the thread for the entire processing of the request.
OpenEntityManagerInViewFilter() - Constructor for class org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter
OpenEntityManagerInViewInterceptor - Class in org.springframework.orm.jpa.support
Spring web request interceptor that binds a JPA EntityManager to the thread for the entire processing of the request.
OpenEntityManagerInViewInterceptor() - Constructor for class org.springframework.orm.jpa.support.OpenEntityManagerInViewInterceptor
OpenJpaDialect - Class in org.springframework.orm.jpa.vendor
JpaDialect implementation for Apache OpenJPA.
OpenJpaDialect() - Constructor for class org.springframework.orm.jpa.vendor.OpenJpaDialect
OpenJpaVendorAdapter - Class in org.springframework.orm.jpa.vendor
JpaVendorAdapter implementation for Apache OpenJPA.
OpenJpaVendorAdapter() - Constructor for class org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter
OpenPersistenceManagerInViewFilter - Class in org.springframework.orm.jdo.support
Servlet 2.3 Filter that binds a JDO PersistenceManager to the thread for the entire processing of the request.
OpenPersistenceManagerInViewFilter() - Constructor for class org.springframework.orm.jdo.support.OpenPersistenceManagerInViewFilter
OpenPersistenceManagerInViewInterceptor - Class in org.springframework.orm.jdo.support
Spring web request interceptor that binds a JDO PersistenceManager to the thread for the entire processing of the request.
OpenPersistenceManagerInViewInterceptor() - Constructor for class org.springframework.orm.jdo.support.OpenPersistenceManagerInViewInterceptor
OpenSessionInViewFilter - Class in org.springframework.orm.hibernate3.support
Servlet 2.3 Filter that binds a Hibernate Session to the thread for the entire processing of the request.
OpenSessionInViewFilter() - Constructor for class org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
OpenSessionInViewInterceptor - Class in org.springframework.orm.hibernate3.support
Spring web request interceptor that binds a Hibernate Session to the thread for the entire processing of the request.
OpenSessionInViewInterceptor() - Constructor for class org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor
Create a new OpenSessionInViewInterceptor, turning the default flushMode to FLUSH_NEVER.
openStreamForClass(String) - Method in class org.springframework.core.OverridingClassLoader
Open an InputStream for the specified class.
OpEQ - Class in org.springframework.expression.spel.ast
Implements equality operator.
OpEQ(int, SpelNodeImpl...) - Constructor for class org.springframework.expression.spel.ast.OpEQ
operate(Operation, Object, Object) - Method in interface org.springframework.expression.OperatorOverloader
Execute the specified operation on two operands, returning a result.
operate(Operation, Object, Object) - Method in class org.springframework.expression.spel.ExpressionState
operate(Operation, Object, Object) - Method in class org.springframework.expression.spel.support.StandardOperatorOverloader
Operation - Enum in org.springframework.expression
Supported operations that an OperatorOverloader can implement for any pair of operands.
Operator - Class in org.springframework.expression.spel.ast
Common supertype for operators that operate on either one or two operands.
Operator(String, int, SpelNodeImpl...) - Constructor for class org.springframework.expression.spel.ast.Operator
OperatorBetween - Class in org.springframework.expression.spel.ast
Represents the between operator.
OperatorBetween(int, SpelNodeImpl...) - Constructor for class org.springframework.expression.spel.ast.OperatorBetween
OperatorInstanceof - Class in org.springframework.expression.spel.ast
The operator 'instanceof' checks if an object is of the class specified in the right hand operand, in the same way that instanceof does in Java.
OperatorInstanceof(int, SpelNodeImpl...) - Constructor for class org.springframework.expression.spel.ast.OperatorInstanceof
OperatorMatches - Class in org.springframework.expression.spel.ast
Implements the matches operator.
OperatorMatches(int, SpelNodeImpl...) - Constructor for class org.springframework.expression.spel.ast.OperatorMatches
OperatorNot - Class in org.springframework.expression.spel.ast
Represents a NOT operation.
OperatorNot(int, SpelNodeImpl) - Constructor for class org.springframework.expression.spel.ast.OperatorNot
OperatorOverloader - Interface in org.springframework.expression
By default the mathematical operators Operation support simple types like numbers.
OperatorPower - Class in org.springframework.expression.spel.ast
The power operator.
OperatorPower(int, SpelNodeImpl...) - Constructor for class org.springframework.expression.spel.ast.OperatorPower
OpGE - Class in org.springframework.expression.spel.ast
Implements greater-than-or-equal operator.
OpGE(int, SpelNodeImpl...) - Constructor for class org.springframework.expression.spel.ast.OpGE
OpGT - Class in org.springframework.expression.spel.ast
Implements greater-than operator.
OpGT(int, SpelNodeImpl...) - Constructor for class org.springframework.expression.spel.ast.OpGT
OpLE - Class in org.springframework.expression.spel.ast
Implements the less-than-or-equal operator.
OpLE(int, SpelNodeImpl...) - Constructor for class org.springframework.expression.spel.ast.OpLE
OpLT - Class in org.springframework.expression.spel.ast
Implements the less-than operator.
OpLT(int, SpelNodeImpl...) - Constructor for class org.springframework.expression.spel.ast.OpLT
OpMinus - Class in org.springframework.expression.spel.ast
The minus operator supports: subtraction of doubles (floats are represented as doubles) subtraction of longs subtraction of integers subtraction of an int from a string of one character (effectively decreasing that character), so 'd'-3='a' It can be used as a unary operator for numbers (double/long/int).
OpMinus(int, SpelNodeImpl...) - Constructor for class org.springframework.expression.spel.ast.OpMinus
OpModulus - Class in org.springframework.expression.spel.ast
Implements the modulus operator.
OpModulus(int, SpelNodeImpl...) - Constructor for class org.springframework.expression.spel.ast.OpModulus
OpMultiply - Class in org.springframework.expression.spel.ast
Implements the multiply operator.
OpMultiply(int, SpelNodeImpl...) - Constructor for class org.springframework.expression.spel.ast.OpMultiply
OpNE - Class in org.springframework.expression.spel.ast
Implements the not-equal operator.
OpNE(int, SpelNodeImpl...) - Constructor for class org.springframework.expression.spel.ast.OpNE
OpOr - Class in org.springframework.expression.spel.ast
Represents the boolean OR operation.
OpOr(int, SpelNodeImpl...) - Constructor for class org.springframework.expression.spel.ast.OpOr
OpPlus - Class in org.springframework.expression.spel.ast
The plus operator will: add doubles (floats are represented as doubles) add longs add integers concatenate strings It can be used as a unary operator for numbers (double/long/int).
OpPlus(int, SpelNodeImpl...) - Constructor for class org.springframework.expression.spel.ast.OpPlus
OptimisticLockingFailureException - Exception in org.springframework.dao
Exception thrown on an optimistic locking violation.
OptimisticLockingFailureException(String) - Constructor for exception org.springframework.dao.OptimisticLockingFailureException
Constructor for OptimisticLockingFailureException.
OptimisticLockingFailureException(String, Throwable) - Constructor for exception org.springframework.dao.OptimisticLockingFailureException
Constructor for OptimisticLockingFailureException.
optionsForAllow(String, Object...) - Method in interface org.springframework.web.client.RestOperations
Return the value of the Allow header for the given URI.
optionsForAllow(String, Map<String, ?>) - Method in interface org.springframework.web.client.RestOperations
Return the value of the Allow header for the given URI.
optionsForAllow(URI) - Method in interface org.springframework.web.client.RestOperations
Return the value of the Allow header for the given URL.
optionsForAllow(String, Object...) - Method in class org.springframework.web.client.RestTemplate
optionsForAllow(String, Map<String, ?>) - Method in class org.springframework.web.client.RestTemplate
optionsForAllow(URI) - Method in class org.springframework.web.client.RestTemplate
OptionsTag - Class in org.springframework.web.servlet.tags.form
Convenient tag that allows one to supply a collection of objects that are to be rendered as 'option' tags within a 'select' tag.
OptionsTag() - Constructor for class org.springframework.web.servlet.tags.form.OptionsTag
OptionTag - Class in org.springframework.web.servlet.tags.form
JSP tag for rendering an HTML 'option' tag.
OptionTag() - Constructor for class org.springframework.web.servlet.tags.form.OptionTag
OracleCallMetaDataProvider - Class in org.springframework.jdbc.core.metadata
Oracle specific implementation for the CallMetaDataProvider interface.
OracleCallMetaDataProvider(DatabaseMetaData) - Constructor for class org.springframework.jdbc.core.metadata.OracleCallMetaDataProvider
OracleLobHandler - Class in org.springframework.jdbc.support.lob
LobHandler implementation for Oracle databases.
OracleLobHandler() - Constructor for class org.springframework.jdbc.support.lob.OracleLobHandler
OracleLobHandler.LobCallback - Interface in org.springframework.jdbc.support.lob
Internal callback interface for use with createLob.
OracleLobHandler.OracleLobCreator - Class in org.springframework.jdbc.support.lob
LobCreator implementation for Oracle databases.
OracleLobHandler.OracleLobCreator() - Constructor for class org.springframework.jdbc.support.lob.OracleLobHandler.OracleLobCreator
OracleSequenceMaxValueIncrementer - Class in org.springframework.jdbc.support.incrementer
DataFieldMaxValueIncrementer that retrieves the next value of a given Oracle sequence.
OracleSequenceMaxValueIncrementer() - Constructor for class org.springframework.jdbc.support.incrementer.OracleSequenceMaxValueIncrementer
Default constructor for bean property style usage.
OracleSequenceMaxValueIncrementer(DataSource, String) - Constructor for class org.springframework.jdbc.support.incrementer.OracleSequenceMaxValueIncrementer
Convenience constructor.
OracleTableMetaDataProvider - Class in org.springframework.jdbc.core.metadata
The Oracle specific implementation of the TableMetaDataProvider.
OracleTableMetaDataProvider(DatabaseMetaData) - Constructor for class org.springframework.jdbc.core.metadata.OracleTableMetaDataProvider
OracleTableMetaDataProvider(DatabaseMetaData, boolean) - Constructor for class org.springframework.jdbc.core.metadata.OracleTableMetaDataProvider
Order - Annotation Type in org.springframework.core.annotation
Annotation that defines ordering.
OrderComparator - Class in org.springframework.core
Comparator implementation for Ordered objects, sorting by order value ascending (resp.
OrderComparator() - Constructor for class org.springframework.core.OrderComparator
Ordered - Interface in org.springframework.core
Interface that can be implemented by objects that should be orderable, for example in a Collection.
org.springframework.aop - package org.springframework.aop
Core Spring AOP interfaces, built on AOP Alliance AOP interoperability interfaces.
org.springframework.aop.aspectj - package org.springframework.aop.aspectj
AspectJ integration package.
org.springframework.aop.aspectj.annotation - package org.springframework.aop.aspectj.annotation
Classes enabling AspectJ 5 @Annotated classes to be used in Spring AOP.
org.springframework.aop.aspectj.autoproxy - package org.springframework.aop.aspectj.autoproxy
Base classes enabling auto-proxying based on AspectJ.
org.springframework.aop.config - package org.springframework.aop.config
Support package for declarative AOP configuration, with XML schema being the primary configuration format.
org.springframework.aop.framework - package org.springframework.aop.framework
Package containing Spring's basic AOP infrastructure, compliant with the AOP Alliance interfaces.
org.springframework.aop.framework.adapter - package org.springframework.aop.framework.adapter
SPI package allowing Spring AOP framework to handle arbitrary advice types.
org.springframework.aop.framework.autoproxy - package org.springframework.aop.framework.autoproxy
Bean post-processors for use in ApplicationContexts to simplify AOP usage by automatically creating AOP proxies without the need to use a ProxyFactoryBean.
org.springframework.aop.framework.autoproxy.target - package org.springframework.aop.framework.autoproxy.target
Generic support classes for target source creation.
org.springframework.aop.interceptor - package org.springframework.aop.interceptor
Provides miscellaneous interceptor implementations.
org.springframework.aop.scope - package org.springframework.aop.scope
Support for AOP-based scoping of target objects, with configurable backend.
org.springframework.aop.support - package org.springframework.aop.support
Convenience classes for using Spring's AOP API.
org.springframework.aop.support.annotation - package org.springframework.aop.support.annotation
Annotation support for AOP pointcuts.
org.springframework.aop.target - package org.springframework.aop.target
This package contains implementations of the org.springframework.aop.TargetSource interface.
org.springframework.aop.target.dynamic - package org.springframework.aop.target.dynamic
Support for AOP-based refreshing of target objects.
org.springframework.beans - package org.springframework.beans
This package contains interfaces and classes for manipulating Java beans.
org.springframework.beans.annotation - package org.springframework.beans.annotation
Support package for beans-style handling of Java 5 annotations.
org.springframework.beans.factory - package org.springframework.beans.factory
The core package implementing Spring's lightweight Inversion of Control (IoC) container.
org.springframework.beans.factory.access - package org.springframework.beans.factory.access
Helper infrastructure to locate and access bean factories.
org.springframework.beans.factory.access.el - package org.springframework.beans.factory.access.el
Support classes for accessing a Spring BeanFactory from Unified EL.
org.springframework.beans.factory.annotation - package org.springframework.beans.factory.annotation
Support package for annotation-driven bean configuration.
org.springframework.beans.factory.aspectj - package org.springframework.beans.factory.aspectj
org.springframework.beans.factory.config - package org.springframework.beans.factory.config
SPI interfaces and configuration-related convenience classes for bean factories.
org.springframework.beans.factory.parsing - package org.springframework.beans.factory.parsing
Support infrastructure for bean definition parsing.
org.springframework.beans.factory.serviceloader - package org.springframework.beans.factory.serviceloader
Support package for the JDK 1.6 ServiceLoader facility.
org.springframework.beans.factory.support - package org.springframework.beans.factory.support
Classes supporting the org.springframework.beans.factory package.
org.springframework.beans.factory.wiring - package org.springframework.beans.factory.wiring
Mechanism to determine bean wiring metadata from a bean instance.
org.springframework.beans.factory.xml - package org.springframework.beans.factory.xml
Contains an abstract XML-based BeanFactory implementation, including a standard "spring-beans" DTD.
org.springframework.beans.propertyeditors - package org.springframework.beans.propertyeditors
Properties editors used to convert from String values to object types such as java.util.Properties.
org.springframework.beans.support - package org.springframework.beans.support
Classes supporting the org.springframework.beans package, such as utility classes for sorting and holding lists of beans.
org.springframework.cache.ehcache - package org.springframework.cache.ehcache
Support classes for the open source cache EHCache, allowing to set up an EHCache CacheManager and Caches as beans in a Spring context.
org.springframework.context - package org.springframework.context
This package builds on the beans package to add support for message sources and for the Observer design pattern, and the ability for application objects to obtain resources using a consistent API.
org.springframework.context.access - package org.springframework.context.access
Helper infrastructure to locate and access shared application contexts.
org.springframework.context.annotation - package org.springframework.context.annotation
Annotation support for the Application Context, including JSR-250 "common" annotations, component-scanning, and Java-based metadata for creating Spring-managed objects.
org.springframework.context.config - package org.springframework.context.config
Support package for advanced application context configuration, with XML schema being the primary configuration format.
org.springframework.context.event - package org.springframework.context.event
Support classes for application events, like standard context events.
org.springframework.context.expression - package org.springframework.context.expression
Expression parsing support within a Spring application context.
org.springframework.context.i18n - package org.springframework.context.i18n
Abstraction for determining the current Locale, plus global holder that exposes a thread-bound Locale.
org.springframework.context.support - package org.springframework.context.support
Classes supporting the org.springframework.context package, such as abstract base classes for ApplicationContext implementations and a MessageSource implementation.
org.springframework.context.weaving - package org.springframework.context.weaving
Load-time weaving support for a Spring application context, building on Spring's LoadTimeWeaver abstraction.
org.springframework.core - package org.springframework.core
Provides basic classes for exception handling and version detection, and other core helpers that are not specific to any part of the framework.
org.springframework.core.annotation - package org.springframework.core.annotation
Core support package for Java 5 annotations.
org.springframework.core.convert - package org.springframework.core.convert
Type conversion system API.
org.springframework.core.convert.converter - package org.springframework.core.convert.converter
SPI to implement Converters.
org.springframework.core.convert.support - package org.springframework.core.convert.support
TypeConverter system implementation.
org.springframework.core.enums - package org.springframework.core.enums
Interfaces and classes for type-safe enum support on JDK >= 1.3.
org.springframework.core.io - package org.springframework.core.io
Generic abstraction for (file-based) resources, used throughout the framework.
org.springframework.core.io.support - package org.springframework.core.io.support
Support classes for Spring's resource abstraction.
org.springframework.core.style - package org.springframework.core.style
Support for styling values as Strings, with ToStringCreator as central class.
org.springframework.core.task - package org.springframework.core.task
This package defines Spring's core TaskExecutor abstraction, and provides SyncTaskExecutor and SimpleAsyncTaskExecutor implementations.
org.springframework.core.task.support - package org.springframework.core.task.support
Support classes for Spring's TaskExecutor abstraction.
org.springframework.core.type - package org.springframework.core.type
Core support package for type introspection.
org.springframework.core.type.classreading - package org.springframework.core.type.classreading
Support classes for reading annotation and class-level metadata.
org.springframework.core.type.filter - package org.springframework.core.type.filter
Core support package for type filtering (e.g.
org.springframework.dao - package org.springframework.dao
Exception hierarchy enabling sophisticated error handling independent of the data access approach in use.
org.springframework.dao.annotation - package org.springframework.dao.annotation
Annotation support for DAOs.
org.springframework.dao.support - package org.springframework.dao.support
Support classes for DAO implementations, providing miscellaneous utility methods.
org.springframework.ejb.access - package org.springframework.ejb.access
This package contains classes that allow easy access to EJBs.
org.springframework.ejb.config - package org.springframework.ejb.config
Support package for EJB/J2EE-related configuration, with XML schema being the primary configuration format.
org.springframework.ejb.interceptor - package org.springframework.ejb.interceptor
Support classes for EJB 3 Session Beans and Message-Driven Beans, performing injection of Spring beans through an EJB 3 interceptor that processes Spring's @Autowired annotation.
org.springframework.ejb.support - package org.springframework.ejb.support
Base classes to make implementing EJB 2.x beans simpler and less error-prone, as well as guaranteeing a Spring BeanFactory is available to such EJBs.
org.springframework.expression - package org.springframework.expression
org.springframework.expression.common - package org.springframework.expression.common
org.springframework.expression.spel - package org.springframework.expression.spel
org.springframework.expression.spel.ast - package org.springframework.expression.spel.ast
org.springframework.expression.spel.standard - package org.springframework.expression.spel.standard
org.springframework.expression.spel.support - package org.springframework.expression.spel.support
org.springframework.format - package org.springframework.format
An API for defining Formatters to format field model values for display in a UI.
org.springframework.format.annotation - package org.springframework.format.annotation
Annotations for declaratively configuring field formatting rules.
org.springframework.format.datetime - package org.springframework.format.datetime
Formatters for java.util.Date properties.
org.springframework.format.datetime.joda - package org.springframework.format.datetime.joda
Integration with the Joda Time for formatting Joda types as well as standard JDK Date types.
org.springframework.format.number - package org.springframework.format.number
Formatters for java.lang.Number properties.
org.springframework.format.support - package org.springframework.format.support
Support classes for the formatting package, providing common implementations as well as adapters.
org.springframework.http - package org.springframework.http
Contains a basic abstraction over client/server-side HTTP.
org.springframework.http.client - package org.springframework.http.client
Contains an abstraction over client-side HTTP.
org.springframework.http.client.support - package org.springframework.http.client.support
This package provides generic HTTP support classes, to be used by higher-level classes like RestTemplate.
org.springframework.http.converter - package org.springframework.http.converter
Provides an HttpMessageConverter abstraction to convert between Java objects and HTTP input/output messages.
org.springframework.http.converter.feed - package org.springframework.http.converter.feed
Provides HttpMessageConverter implementations for handling Atom and RSS feeds.
org.springframework.http.converter.json - package org.springframework.http.converter.json
Provides an HttpMessageConverter implementations for handling JSON.
org.springframework.http.converter.xml - package org.springframework.http.converter.xml
Provides an HttpMessageConverter implementations for handling XML.
org.springframework.http.server - package org.springframework.http.server
Contains an abstraction over server-side HTTP.
org.springframework.instrument - package org.springframework.instrument
org.springframework.instrument.classloading - package org.springframework.instrument.classloading
Support package for load time weaving based on class loaders, as required by JPA providers (but not JPA-specific).
org.springframework.instrument.classloading.glassfish - package org.springframework.instrument.classloading.glassfish
Support for class instrumentation on GlassFish / Sun Application Server.
org.springframework.instrument.classloading.jboss - package org.springframework.instrument.classloading.jboss
Support for class instrumentation on JBoss AS 5.x / JBoss MC 2.0.x.
org.springframework.instrument.classloading.oc4j - package org.springframework.instrument.classloading.oc4j
Support for class instrumentation on Oracle OC4J.
org.springframework.instrument.classloading.tomcat - package org.springframework.instrument.classloading.tomcat
Support for class instrumentation on Apache Tomcat.
org.springframework.instrument.classloading.weblogic - package org.springframework.instrument.classloading.weblogic
Support for class instrumentation on BEA WebLogic 10.
org.springframework.jca.cci - package org.springframework.jca.cci
This package contains Spring's support for the Common Client Interface (CCI), as defined by the J2EE Connector Architecture.
org.springframework.jca.cci.connection - package org.springframework.jca.cci.connection
Provides a utility class for easy ConnectionFactory access, a PlatformTransactionManager for local CCI transactions, and various simple ConnectionFactory proxies/adapters.
org.springframework.jca.cci.core - package org.springframework.jca.cci.core
Provides the core JCA CCI support, based on CciTemplate and its associated callback interfaces.
org.springframework.jca.cci.core.support - package org.springframework.jca.cci.core.support
Classes supporting the org.springframework.jca.cci.core package.
org.springframework.jca.cci.object - package org.springframework.jca.cci.object
The classes in this package represent EIS operations as threadsafe, reusable objects.
org.springframework.jca.context - package org.springframework.jca.context
Integration package that allows for deploying a Spring application context as a JCA 1.5 compliant RAR file.
org.springframework.jca.endpoint - package org.springframework.jca.endpoint
This package provides a facility for generic JCA message endpoint management.
org.springframework.jca.support - package org.springframework.jca.support
Provides generic support classes for JCA usage within Spring, mainly for local setup of a JCA ResourceAdapter and/or ConnectionFactory.
org.springframework.jca.work - package org.springframework.jca.work
Convenience classes for scheduling based on the JCA 1.5 WorkManager facility, as supported within JCA 1.5 ResourceAdapters.
org.springframework.jca.work.glassfish - package org.springframework.jca.work.glassfish
Convenience package for obtaining a GlassFish JCA WorkManager for use in web applications.
org.springframework.jca.work.jboss - package org.springframework.jca.work.jboss
Convenience package for obtaining a JBoss JCA WorkManager for use in web applications.
org.springframework.jdbc - package org.springframework.jdbc
The classes in this package make JDBC easier to use and reduce the likelihood of common errors.
org.springframework.jdbc.config - package org.springframework.jdbc.config
Defines the Spring JDBC configuration namespace.
org.springframework.jdbc.core - package org.springframework.jdbc.core
Provides the core JDBC framework, based on JdbcTemplate and its associated callback interfaces and helper objects.
org.springframework.jdbc.core.metadata - package org.springframework.jdbc.core.metadata
Context metadata abstraction for the configuration and execution of a stored procedure call.
org.springframework.jdbc.core.namedparam - package org.springframework.jdbc.core.namedparam
JdbcTemplate variant with named parameter support.
org.springframework.jdbc.core.simple - package org.springframework.jdbc.core.simple
Simplification layer over JdbcTemplate for Java 5 and above.
org.springframework.jdbc.core.support - package org.springframework.jdbc.core.support
Classes supporting the org.springframework.jdbc.core package.
org.springframework.jdbc.datasource - package org.springframework.jdbc.datasource
Provides a utility class for easy DataSource access, a PlatformTransactionManager for a single DataSource, and various simple DataSource implementations.
org.springframework.jdbc.datasource.embedded - package org.springframework.jdbc.datasource.embedded
Provides extensible support for creating embedded database instances.
org.springframework.jdbc.datasource.init - package org.springframework.jdbc.datasource.init
org.springframework.jdbc.datasource.lookup - package org.springframework.jdbc.datasource.lookup
Provides a strategy for looking up JDBC DataSources by name.
org.springframework.jdbc.object - package org.springframework.jdbc.object
The classes in this package represent RDBMS queries, updates, and stored procedures as threadsafe, reusable objects.
org.springframework.jdbc.support - package org.springframework.jdbc.support
Support classes for the JDBC framework, used by the classes in the jdbc.core and jdbc.object packages.
org.springframework.jdbc.support.incrementer - package org.springframework.jdbc.support.incrementer
Provides a support framework for incrementing database table values via sequences, with implementations for various databases.
org.springframework.jdbc.support.lob - package org.springframework.jdbc.support.lob
Provides a stategy interface for Large OBject handling, with implementations for various databases.
org.springframework.jdbc.support.nativejdbc - package org.springframework.jdbc.support.nativejdbc
Provides a mechanism for extracting native implementations of JDBC interfaces from wrapper objects that got returned from connection pools.
org.springframework.jdbc.support.rowset - package org.springframework.jdbc.support.rowset
Provides a convenient holder for disconnected result sets.
org.springframework.jdbc.support.xml - package org.springframework.jdbc.support.xml
Abstraction for handling fields of SQLXML data type.
org.springframework.jms - package org.springframework.jms
This package contains integration classes for JMS, allowing for Spring-style JMS access.
org.springframework.jms.config - package org.springframework.jms.config
Support package for declarative messaging configuration, with XML schema being the primary configuration format.
org.springframework.jms.connection - package org.springframework.jms.connection
Provides a PlatformTransactionManager implementation for a single JMS ConnectionFactory, and a SingleConnectionFactory adapter.
org.springframework.jms.core - package org.springframework.jms.core
Core package of the JMS support.
org.springframework.jms.core.support - package org.springframework.jms.core.support
Classes supporting the org.springframework.jms.core package.
org.springframework.jms.listener - package org.springframework.jms.listener
This package contains the base message listener container facility.
org.springframework.jms.listener.adapter - package org.springframework.jms.listener.adapter
Message listener adapter mechanism that delegates to target listener methods, converting messages to appropriate message content types (such as String or byte array) that get passed into listener methods.
org.springframework.jms.listener.endpoint - package org.springframework.jms.listener.endpoint
This package provides JCA-based endpoint management for JMS message listeners.
org.springframework.jms.remoting - package org.springframework.jms.remoting
Remoting classes for transparent Java-to-Java remoting via a JMS provider.
org.springframework.jms.support - package org.springframework.jms.support
This package provides generic JMS support classes, to be used by higher-level classes like JmsTemplate.
org.springframework.jms.support.converter - package org.springframework.jms.support.converter
Provides a MessageConverter abstraction to convert between Java objects and JMS messages.
org.springframework.jms.support.destination - package org.springframework.jms.support.destination
Support classes for Spring's JMS framework.
org.springframework.jmx - package org.springframework.jmx
This package contains Spring's JMX support, which includes registration of Spring-managed beans as JMX MBeans as well as access to remote JMX MBeans.
org.springframework.jmx.access - package org.springframework.jmx.access
Provides support for accessing remote MBean resources.
org.springframework.jmx.export - package org.springframework.jmx.export
This package provides declarative creation and registration of Spring-managed beans as JMX MBeans.
org.springframework.jmx.export.annotation - package org.springframework.jmx.export.annotation
JDK 1.5+ annotations for MBean exposure.
org.springframework.jmx.export.assembler - package org.springframework.jmx.export.assembler
Provides a strategy for MBeanInfo assembly.
org.springframework.jmx.export.metadata - package org.springframework.jmx.export.metadata
Provides generic JMX metadata classes and basic support for reading JMX metadata in a provider-agnostic manner.
org.springframework.jmx.export.naming - package org.springframework.jmx.export.naming
Provides a strategy for ObjectName creation.
org.springframework.jmx.export.notification - package org.springframework.jmx.export.notification
Provides supporting infrastructure to allow Spring-created MBeans to send JMX notifications.
org.springframework.jmx.support - package org.springframework.jmx.support
Contains support classes for connecting to local and remote MBeanServers and for exposing an MBeanServer to remote clients.
org.springframework.jndi - package org.springframework.jndi
The classes in this package make JNDI easier to use, facilitating the accessing of configuration stored in JNDI, and provide useful superclasses for JNDI access classes.
org.springframework.jndi.support - package org.springframework.jndi.support
Support classes for JNDI usage, including a JNDI-based BeanFactory implementation.
org.springframework.mail - package org.springframework.mail
Spring's generic mail infrastructure.
org.springframework.mail.javamail - package org.springframework.mail.javamail
JavaMail support for Spring's mail infrastructure.
org.springframework.mock.jndi - package org.springframework.mock.jndi
The simplest implementation of the JNDI SPI that could possibly work.
org.springframework.mock.staticmock - package org.springframework.mock.staticmock
org.springframework.mock.web - package org.springframework.mock.web
A comprehensive set of Servlet API 2.5 mock objects, targeted at usage with Spring's web MVC framework.
org.springframework.mock.web.portlet - package org.springframework.mock.web.portlet
A comprehensive set of Portlet API 2.0 mock objects, targeted at usage with Spring's web MVC framework.
org.springframework.orm - package org.springframework.orm
Root package for Spring's O/R Mapping integration classes.
org.springframework.orm.hibernate3 - package org.springframework.orm.hibernate3
Package providing integration of Hibernate3 with Spring concepts.
org.springframework.orm.hibernate3.annotation - package org.springframework.orm.hibernate3.annotation
Support package for the Hibernate3 Annotation add-on, which supports EJB3-compliant JDK 1.5+ annotations for mappings.
org.springframework.orm.hibernate3.support - package org.springframework.orm.hibernate3.support
Classes supporting the org.springframework.orm.hibernate3 package.
org.springframework.orm.ibatis - package org.springframework.orm.ibatis
Package providing integration of iBATIS Database Layer with Spring concepts.
org.springframework.orm.ibatis.support - package org.springframework.orm.ibatis.support
Classes supporting the org.springframework.orm.ibatis package.
org.springframework.orm.jdo - package org.springframework.orm.jdo
Package providing integration of JDO (Java Date Objects) with Spring concepts.
org.springframework.orm.jdo.support - package org.springframework.orm.jdo.support
Classes supporting the org.springframework.orm.jdo package.
org.springframework.orm.jpa - package org.springframework.orm.jpa
Package providing integration of JPA (Java Persistence API) with Spring concepts.
org.springframework.orm.jpa.persistenceunit - package org.springframework.orm.jpa.persistenceunit
Internal support for managing JPA persistence units.
org.springframework.orm.jpa.support - package org.springframework.orm.jpa.support
Classes supporting the org.springframework.orm.jpa package.
org.springframework.orm.jpa.vendor - package org.springframework.orm.jpa.vendor
Support classes for adapting to specific JPA vendors.
org.springframework.oxm - package org.springframework.oxm
Root package for Spring's O/X Mapping integration classes.
org.springframework.oxm.castor - package org.springframework.oxm.castor
Package providing integration of Castor within Springs O/X Mapping support
org.springframework.oxm.config - package org.springframework.oxm.config
Provides an namespace handler for the Spring Object/XML namespace
org.springframework.oxm.jaxb - package org.springframework.oxm.jaxb
Package providing integration of JAXB with Springs O/X Mapping support
org.springframework.oxm.jibx - package org.springframework.oxm.jibx
Package providing integration of JiBX with Springs O/X Mapping support
org.springframework.oxm.mime - package org.springframework.oxm.mime
Contains (un)marshallers optimized to store binary data in MIME attachments.
org.springframework.oxm.support - package org.springframework.oxm.support
Provides generic support classes for using Spring's O/X Mapping integration within various scenario's.
org.springframework.oxm.xmlbeans - package org.springframework.oxm.xmlbeans
Package providing integration of XMLBeans with Springs O/X Mapping support
org.springframework.oxm.xstream - package org.springframework.oxm.xstream
Package providing integration of XStream with Springs O/X Mapping support
org.springframework.remoting - package org.springframework.remoting
Exception hierarchy for Spring's remoting infrastructure, independent of any specific remote method invocation system.
org.springframework.remoting.caucho - package org.springframework.remoting.caucho
This package provides remoting classes for Caucho's Hessian and Burlap protocols: a proxy factory for accessing Hessian/Burlap services, and an exporter for making beans available to Hessian/Burlap clients.
org.springframework.remoting.httpinvoker - package org.springframework.remoting.httpinvoker
Remoting classes for transparent Java-to-Java remoting via HTTP invokers.
org.springframework.remoting.jaxrpc - package org.springframework.remoting.jaxrpc
Remoting classes for Web Services via JAX-RPC.
org.springframework.remoting.jaxws - package org.springframework.remoting.jaxws
Remoting classes for Web Services via JAX-WS (the successor of JAX-RPC), as included in Java 6 and Java EE 5.
org.springframework.remoting.rmi - package org.springframework.remoting.rmi
Remoting classes for conventional RMI and transparent remoting via RMI invokers.
org.springframework.remoting.soap - package org.springframework.remoting.soap
SOAP-specific exceptions and support classes for Spring's remoting subsystem.
org.springframework.remoting.support - package org.springframework.remoting.support
Generic support classes for remoting implementations.
org.springframework.scheduling - package org.springframework.scheduling
General exceptions for Spring's scheduling support, independent of any specific scheduling system.
org.springframework.scheduling.annotation - package org.springframework.scheduling.annotation
JDK 1.5+ annotation for asynchronous method execution.
org.springframework.scheduling.backportconcurrent - package org.springframework.scheduling.backportconcurrent
Scheduling convenience classes for the JSR-166 backport Executor mechanism, allowing to set up a ThreadPoolExecutor as a TaskExecutor-compliant bean in a Spring context.
org.springframework.scheduling.commonj - package org.springframework.scheduling.commonj
Convenience classes for scheduling based on the CommonJ WorkManager/TimerManager facility, as supported by IBM WebSphere 6.0+ and BEA WebLogic 9.0+.
org.springframework.scheduling.concurrent - package org.springframework.scheduling.concurrent
Scheduling convenience classes for the JDK 1.5+ Executor mechanism in the java.util.concurrent package, allowing to set up a ThreadPoolExecutor or ScheduledThreadPoolExecutor as a bean in a Spring context.
org.springframework.scheduling.config - package org.springframework.scheduling.config
org.springframework.scheduling.quartz - package org.springframework.scheduling.quartz
Support classes for the open source scheduler Quartz, allowing to set up Quartz Schedulers, JobDetails and Triggers as beans in a Spring context.
org.springframework.scheduling.support - package org.springframework.scheduling.support
Generic support classes for scheduling.
org.springframework.scheduling.timer - package org.springframework.scheduling.timer
Scheduling convenience classes for the JDK Timer, allowing to set up Timers and ScheduledTimerTasks as beans in a Spring context.
org.springframework.scripting - package org.springframework.scripting
Core interfaces for Spring's scripting support.
org.springframework.scripting.bsh - package org.springframework.scripting.bsh
Package providing integration of BeanShell into Spring's scripting infrastructure.
org.springframework.scripting.config - package org.springframework.scripting.config
Support package for Spring's dynamic language machinery, with XML schema being the primary configuration format.
org.springframework.scripting.groovy - package org.springframework.scripting.groovy
Package providing integration of Groovy into Spring's scripting infrastructure.
org.springframework.scripting.jruby - package org.springframework.scripting.jruby
Package providing integration of JRuby into Spring's scripting infrastructure.
org.springframework.scripting.support - package org.springframework.scripting.support
Support classes for Spring's scripting package.
org.springframework.stereotype - package org.springframework.stereotype
Annotations denoting the roles of types or methods in the overall architecture (at a conceptual, rather than implementation, level).
org.springframework.test - package org.springframework.test
This package contains the legacy JUnit 3.8 class hierarchy, which as of Spring 3.0 has been deprecated in favor of using the listener-based Spring TestContext Framework.
org.springframework.test.annotation - package org.springframework.test.annotation
Support classes for annotation-driven tests.
org.springframework.test.context - package org.springframework.test.context
This package contains the Spring TestContext Framework which provides annotation-driven unit and integration testing support that is agnostic of the actual testing framework in use.
org.springframework.test.context.junit38 - package org.springframework.test.context.junit38
Support classes for ApplicationContext-based and transactional tests run with JUnit 3.8 and the Spring TestContext Framework.
org.springframework.test.context.junit4 - package org.springframework.test.context.junit4
Support classes for ApplicationContext-based and transactional tests run with JUnit 4.5+ and the Spring TestContext Framework.
org.springframework.test.context.junit4.statements - package org.springframework.test.context.junit4.statements
JUnit 4.5 based statements used in the Spring TestContext Framework.
org.springframework.test.context.support - package org.springframework.test.context.support
Support classes for the Spring TestContext Framework.
org.springframework.test.context.testng - package org.springframework.test.context.testng
Support classes for ApplicationContext-based and transactional tests run with TestNG and the Spring TestContext Framework.
org.springframework.test.context.transaction - package org.springframework.test.context.transaction
Transactional support classes for the Spring TestContext Framework.
org.springframework.test.jdbc - package org.springframework.test.jdbc
Support classes for tests based on JDBC.
org.springframework.test.jpa - package org.springframework.test.jpa
As of Spring 3.0, this package has been deprecated in favor of using the listener-based Spring TestContext Framework.
org.springframework.test.util - package org.springframework.test.util
Helper classes for unit tests with reflective needs.
org.springframework.test.web - package org.springframework.test.web
Helper classes for unit tests based on Spring's web support.
org.springframework.transaction - package org.springframework.transaction
Exception hierarchy for Spring's transaction infrastructure, independent of any specific transaction management system.
org.springframework.transaction.annotation - package org.springframework.transaction.annotation
JDK 1.5+ annotation for transaction demarcation.
org.springframework.transaction.config - package org.springframework.transaction.config
Support package for declarative transaction configuration, with XML schema being the primary configuration format.
org.springframework.transaction.interceptor - package org.springframework.transaction.interceptor
AOP-based solution for declarative transaction demarcation.
org.springframework.transaction.jta - package org.springframework.transaction.jta
Transaction SPI implementation for JTA.
org.springframework.transaction.support - package org.springframework.transaction.support
Support classes for the org.springframework.transaction package.
org.springframework.ui - package org.springframework.ui
Generic support for UI layer concepts.
org.springframework.ui.context - package org.springframework.ui.context
Contains classes defining the application context subinterface for UI applications.
org.springframework.ui.context.support - package org.springframework.ui.context.support
Classes supporting the org.springframework.ui.context package.
org.springframework.ui.freemarker - package org.springframework.ui.freemarker
Support classes for setting up FreeMarker within a Spring application context.
org.springframework.ui.jasperreports - package org.springframework.ui.jasperreports
Support classes for JasperReports.
org.springframework.ui.velocity - package org.springframework.ui.velocity
Support classes for setting up Velocity within a Spring application context.
org.springframework.util - package org.springframework.util
Miscellaneous utility classes, such as String manipulation utilities, a Log4J configurer, and a state holder for paged lists of objects.
org.springframework.util.comparator - package org.springframework.util.comparator
Useful generic java.util.Comparator implementations, such as an invertible comparator and a compound comparator.
org.springframework.util.xml - package org.springframework.util.xml
Miscellaneous utility classes for XML parsing and transformation, such as error handlers that log warnings via Commons Logging.
org.springframework.validation - package org.springframework.validation
Provides data binding and validation functionality, for usage in business and/or UI layers.
org.springframework.validation.beanvalidation - package org.springframework.validation.beanvalidation
Support classes for integrating a JSR-303 Bean Validation provider (such as Hibernate Validator 4.0) into a Spring ApplicationContext and in particular with Spring's data binding and validation APIs.
org.springframework.validation.support - package org.springframework.validation.support
Support classes for handling validation results.
org.springframework.web - package org.springframework.web
Common, generic interfaces that define minimal boundary points between Spring's web infrastructure and other framework modules.
org.springframework.web.bind - package org.springframework.web.bind
Provides web-specific data binding functionality.
org.springframework.web.bind.annotation - package org.springframework.web.bind.annotation
Annotations for binding requests to controllers and handler methods as well as for binding request parameters to method arguments.
org.springframework.web.bind.annotation.support - package org.springframework.web.bind.annotation.support
Support classes for web annotation processing.
org.springframework.web.bind.support - package org.springframework.web.bind.support
Support classes for web data binding.
org.springframework.web.client - package org.springframework.web.client
Core package of the client-side web support.
org.springframework.web.client.support - package org.springframework.web.client.support
Classes supporting the org.springframework.web.client package.
org.springframework.web.context - package org.springframework.web.context
Contains a variant of the application context interface for web applications, and the ContextLoaderListener that bootstraps a root web application context.
org.springframework.web.context.request - package org.springframework.web.context.request
Support for generic request context holding, in particular for scoping of application objects per HTTP request or HTTP session.
org.springframework.web.context.support - package org.springframework.web.context.support
Classes supporting the org.springframework.web.context package, such as WebApplicationContext implementations and various utility classes.
org.springframework.web.filter - package org.springframework.web.filter
Provides generic filter base classes allowing for bean-style configuration.
org.springframework.web.jsf - package org.springframework.web.jsf
Support classes for integrating a JSF web tier with a Spring middle tier which is hosted in a Spring root WebApplicationContext.
org.springframework.web.jsf.el - package org.springframework.web.jsf.el
Support classes for integrating a JSF 1.2 web tier with a Spring middle tier which is hosted in a Spring root WebApplicationContext.
org.springframework.web.multipart - package org.springframework.web.multipart
Multipart resolution framework for handling file uploads.
org.springframework.web.multipart.commons - package org.springframework.web.multipart.commons
MultipartResolver implementation for Jakarta Commons FileUpload.
org.springframework.web.multipart.support - package org.springframework.web.multipart.support
Support classes for the multipart resolution framework.
org.springframework.web.portlet - package org.springframework.web.portlet
Provides JSR-168 portlets that integrate with the application context infrastructure, and the core interfaces and classes for the Portlet variant of Spring's web MVC framework.
org.springframework.web.portlet.bind - package org.springframework.web.portlet.bind
Provides portlet-specific data binding functionality.
org.springframework.web.portlet.bind.annotation - package org.springframework.web.portlet.bind.annotation
Annotations for binding portlet requests to handler methods.
org.springframework.web.portlet.context - package org.springframework.web.portlet.context
Support for Spring's application context concept in a portlet environment, including ApplicationContext implementations and various utility classes.
org.springframework.web.portlet.handler - package org.springframework.web.portlet.handler
Provides standard HandlerMapping implementations, including abstract base classes for custom implementations.
org.springframework.web.portlet.multipart - package org.springframework.web.portlet.multipart
Multipart resolution framework for handling file uploads.
org.springframework.web.portlet.mvc - package org.springframework.web.portlet.mvc
Standard controller implementations for the portlet MVC framework that comes with Spring.
org.springframework.web.portlet.mvc.annotation - package org.springframework.web.portlet.mvc.annotation
Support package for annotation-based Portlet MVC controllers.
org.springframework.web.portlet.util - package org.springframework.web.portlet.util
Miscellaneous portlet utility classes.
org.springframework.web.servlet - package org.springframework.web.servlet
Provides servlets that integrate with the application context infrastructure, and the core interfaces and classes for the Spring web MVC framework.
org.springframework.web.servlet.config - package org.springframework.web.servlet.config
Defines the Spring MVC configuration namespace.
org.springframework.web.servlet.handler - package org.springframework.web.servlet.handler
Provides standard HandlerMapping implementations, including abstract base classes for custom implementations.
org.springframework.web.servlet.i18n - package org.springframework.web.servlet.i18n
Locale support classes for Spring's web MVC framework.
org.springframework.web.servlet.mvc - package org.springframework.web.servlet.mvc
Standard controller implementations for the servlet MVC framework that comes with Spring.
org.springframework.web.servlet.mvc.annotation - package org.springframework.web.servlet.mvc.annotation
Support package for annotation-based Servlet MVC controllers.
org.springframework.web.servlet.mvc.multiaction - package org.springframework.web.servlet.mvc.multiaction
Package allowing MVC Controller implementations to handle requests at method rather than class level.
org.springframework.web.servlet.mvc.support - package org.springframework.web.servlet.mvc.support
Support package for MVC controllers.
org.springframework.web.servlet.support - package org.springframework.web.servlet.support
Support classes for Spring's web MVC framework.
org.springframework.web.servlet.tags - package org.springframework.web.servlet.tags
Spring's JSP standard tag library for JSP 2.0+.
org.springframework.web.servlet.tags.form - package org.springframework.web.servlet.tags.form
Spring's form tag library for JSP 2.0+.
org.springframework.web.servlet.theme - package org.springframework.web.servlet.theme
Theme support classes for Spring's web MVC framework.
org.springframework.web.servlet.view - package org.springframework.web.servlet.view
Provides standard View and ViewResolver implementations, including abstract base classes for custom implementations.
org.springframework.web.servlet.view.document - package org.springframework.web.servlet.view.document
Support classes for document generation, providing View implementations for PDF and Excel.
org.springframework.web.servlet.view.feed - package org.springframework.web.servlet.view.feed
Support classes for feed generation, providing View implementations for Atom and RSS
org.springframework.web.servlet.view.freemarker - package org.springframework.web.servlet.view.freemarker
Support classes for the integration of FreeMarker as Spring web view technology.
org.springframework.web.servlet.view.jasperreports - package org.springframework.web.servlet.view.jasperreports
Support classes for the integration of JasperReports as Spring web view technology.
org.springframework.web.servlet.view.json - package org.springframework.web.servlet.view.json
Support classes for providing a View implementation based on JSON serialization.
org.springframework.web.servlet.view.tiles - package org.springframework.web.servlet.view.tiles
Support classes for the integration of Tiles (included in Struts) as Spring web view technology.
org.springframework.web.servlet.view.tiles2 - package org.springframework.web.servlet.view.tiles2
Support classes for the integration of Tiles2 (the standalone version of Tiles) as Spring web view technology.
org.springframework.web.servlet.view.velocity - package org.springframework.web.servlet.view.velocity
Support classes for the integration of Velocity as Spring web view technology.
org.springframework.web.servlet.view.xml - package org.springframework.web.servlet.view.xml
Support classes for providing a View implementation based on XML Marshalling.
org.springframework.web.servlet.view.xslt - package org.springframework.web.servlet.view.xslt
Support classes for XSLT, providing a View implementation for XSLT stylesheets.
org.springframework.web.struts - package org.springframework.web.struts
Support classes for integrating a Struts web tier with a Spring middle tier which is typically hosted in a Spring root WebApplicationContext.
org.springframework.web.util - package org.springframework.web.util
Miscellaneous web utility classes, such as HTML escaping, log4j initialization, and cookie handling.
ORIGINAL_DEFAULT_LISTENER_METHOD - Static variable in class org.springframework.jms.listener.adapter.MessageListenerAdapter
Out-of-the-box value for the default listener method: "handleMessage".
ORIGINAL_DEFAULT_PERSISTENCE_UNIT_ROOT_LOCATION - Static variable in class org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager
Default location for the persistence unit root URL: "classpath:", indicating the root of the class path.
ORIGINAL_DEFAULT_THEME_NAME - Static variable in class org.springframework.web.servlet.theme.AbstractThemeResolver
Out-of-the-box value for the default theme name: "theme".
ORIGINAL_DEFAULT_THEME_NAME - Static variable in class org.springframework.web.servlet.theme.CookieThemeResolver
originalBeanName(String) - Static method in class org.springframework.beans.factory.BeanFactoryUtils
Extract the "raw" bean name from the given (potentially generated) bean name, excluding any "#..." suffixes which might have been added for uniqueness.
originalBeanName(String) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Determine the original bean name, resolving locally defined aliases to canonical names.
originalVariableResolver - Variable in class org.springframework.web.jsf.DelegatingVariableResolver
originalVariableResolver - Variable in class org.springframework.web.jsf.WebApplicationContextVariableResolver
OutputStreamFactory - Class in org.springframework.jdbc.datasource.embedded
Internal helper for exposing dummy OutputStreams to embedded databases such as Derby, preventing the creation of a log file.
OutputStreamFactory() - Constructor for class org.springframework.jdbc.datasource.embedded.OutputStreamFactory
override(String, String) - Method in class org.springframework.instrument.classloading.ResourceOverridingShadowingClassLoader
Return the resource (if any) at the new path on an attempt to locate a resource at the old path.
overrideFrom(AbstractBeanDefinition) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Deprecated. since Spring 2.5, in favor of AbstractBeanDefinition.overrideFrom(BeanDefinition)
overrideFrom(BeanDefinition) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Override settings in this bean definition (assumably a copied parent from a parent-child inheritance relationship) from the given bean definition (assumably the child).
overridesOperation(Operation, Object, Object) - Method in interface org.springframework.expression.OperatorOverloader
Return true if the operator overloader supports the specified operation between the two operands and so should be invoked to handle it.
overridesOperation(Operation, Object, Object) - Method in class org.springframework.expression.spel.support.StandardOperatorOverloader
overrideThreadContextClassLoader() - Method in class org.springframework.remoting.support.RemotingSupport
Override the thread context ClassLoader with the environment's bean ClassLoader if necessary, i.e.
overrideThreadContextClassLoader(ClassLoader) - Static method in class org.springframework.util.ClassUtils
Override the thread context ClassLoader with the environment's bean ClassLoader if necessary, i.e.
OverridingClassLoader - Class in org.springframework.core
ClassLoader that does not always delegate to the parent loader, as normal class loaders do.
OverridingClassLoader(ClassLoader) - Constructor for class org.springframework.core.OverridingClassLoader
Create a new OverridingClassLoader for the given class loader.
OxmNamespaceHandler - Class in org.springframework.oxm.config
NamespaceHandler for the 'oxm' namespace.
OxmNamespaceHandler() - Constructor for class org.springframework.oxm.config.OxmNamespaceHandler
Overview Package Class Tree Deprecated Index Help
A B C D E F G H I J K L M N O P Q R S T U V W X


P-Index

PREV LETTER NEXT LETTER FRAMES NO FRAMES
A B C D E F G H I J K L M N O P Q R S T U V W X

P

paddingLength - Variable in class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
The length to which a string result should be pre-pended with zeroes
PAGE_NOT_FOUND_LOG_CATEGORY - Static variable in class org.springframework.web.portlet.DispatcherPortlet
Log category to use when no mapped handler is found for a request.
PAGE_NOT_FOUND_LOG_CATEGORY - Static variable in class org.springframework.web.servlet.DispatcherServlet
Log category to use when no mapped handler is found for a request.
PAGE_NOT_FOUND_LOG_CATEGORY - Static variable in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
Log category to use when no mapped handler is found for a request.
PAGE_NOT_FOUND_LOG_CATEGORY - Static variable in class org.springframework.web.servlet.mvc.multiaction.MultiActionController
Log category to use when no mapped handler is found for a request.
PAGE_NOT_FOUND_LOG_CATEGORY - Static variable in class org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver
Log category to use when no mapped handler is found for a request.
PagedListHolder<E> - Class in org.springframework.beans.support
PagedListHolder is a simple state holder for handling lists of objects, separating them into pages.
PagedListHolder() - Constructor for class org.springframework.beans.support.PagedListHolder
Create a new holder instance.
PagedListHolder(List<E>) - Constructor for class org.springframework.beans.support.PagedListHolder
Create a new holder instance with the given source list, starting with a default sort definition (with "toggleAscendingOnProperty" activated).
PagedListHolder(List<E>, SortDefinition) - Constructor for class org.springframework.beans.support.PagedListHolder
Create a new holder instance with the given source list.
pageNotFoundLogger - Static variable in class org.springframework.web.portlet.DispatcherPortlet
Additional logger to use when no mapped handler is found for a request.
pageNotFoundLogger - Static variable in class org.springframework.web.servlet.DispatcherServlet
Additional logger to use when no mapped handler is found for a request.
pageNotFoundLogger - Static variable in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
Additional logger to use when no mapped handler is found for a request.
pageNotFoundLogger - Static variable in class org.springframework.web.servlet.mvc.multiaction.MultiActionController
Additional logger to use when no mapped handler is found for a request.
pageNotFoundLogger - Static variable in class org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver
Additional logger to use when no mapped handler is found for a request.
Param - Class in org.springframework.web.servlet.tags
Bean used to pass name-value pair parameters from a ParamTag to a ParamAware tag.
Param() - Constructor for class org.springframework.web.servlet.tags.Param
PARAM_AUTOWIRE - Static variable in class org.springframework.web.struts.DelegatingActionUtils
Deprecated. The name of the autowire init-param specified on the Struts ActionServlet: "spring.autowire"
PARAM_CANCEL - Static variable in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Parameter triggering the cancel action.
PARAM_CANCEL - Static variable in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Parameter triggering the cancel action.
PARAM_DEPENDENCY_CHECK - Static variable in class org.springframework.web.struts.DelegatingActionUtils
Deprecated. The name of the dependency check init-param specified on the Struts ActionServlet: "spring.dependencyCheck"
PARAM_FINISH - Static variable in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Parameter triggering the finish action.
PARAM_FINISH - Static variable in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Parameter triggering the finish action.
PARAM_PAGE - Static variable in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Parameter specifying the current page as value.
PARAM_PAGE - Static variable in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Parameter specifying the current page as value.
PARAM_TARGET - Static variable in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Parameter specifying the target page, appending the page number to the name.
PARAM_TARGET - Static variable in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Parameter specifying the target page, appending the page number to the name.
ParamAware - Interface in org.springframework.web.servlet.tags
Allows implementing tag to utilize nested spring:param tags.
ParameterDisposer - Interface in org.springframework.jdbc.core
Interface to be implemented by objects that can close resources allocated by parameters like SqlLobValues.
ParameterHandlerMapping - Class in org.springframework.web.portlet.handler
Implementation of the HandlerMapping to map from a request parameter to request handler beans.
ParameterHandlerMapping() - Constructor for class org.springframework.web.portlet.handler.ParameterHandlerMapping
parameterInfoToTypes(MBeanParameterInfo[]) - Static method in class org.springframework.jmx.support.JmxUtils
Convert an array of MBeanParameterInfo into an array of Class instances corresponding to the parameters.
parameterInfoToTypes(MBeanParameterInfo[], ClassLoader) - Static method in class org.springframework.jmx.support.JmxUtils
Convert an array of MBeanParameterInfo into an array of Class instances corresponding to the parameters.
ParameterizableViewController - Class in org.springframework.web.portlet.mvc
Trivial controller that always returns a named view.
ParameterizableViewController() - Constructor for class org.springframework.web.portlet.mvc.ParameterizableViewController
ParameterizableViewController - Class in org.springframework.web.servlet.mvc
Trivial controller that always returns a named view.
ParameterizableViewController() - Constructor for class org.springframework.web.servlet.mvc.ParameterizableViewController
ParameterizedBeanPropertyRowMapper<T> - Class in org.springframework.jdbc.core.simple
ParameterizedRowMapper implementation that converts a row into a new instance of the specified mapped target class.
ParameterizedBeanPropertyRowMapper() - Constructor for class org.springframework.jdbc.core.simple.ParameterizedBeanPropertyRowMapper
ParameterizedRowMapper<T> - Interface in org.springframework.jdbc.core.simple
Extension of the RowMapper interface, adding type parameterization.
ParameterizedSingleColumnRowMapper<T> - Class in org.springframework.jdbc.core.simple
ParameterizedRowMapper implementation that converts a single column into a single result value per row.
ParameterizedSingleColumnRowMapper() - Constructor for class org.springframework.jdbc.core.simple.ParameterizedSingleColumnRowMapper
ParameterMapper - Interface in org.springframework.jdbc.core
Implement this interface when parameters need to be customized based on the connection.
ParameterMappingInterceptor - Class in org.springframework.web.portlet.handler
Interceptor to forward a request parameter from the ActionRequest to the RenderRequest.
ParameterMappingInterceptor() - Constructor for class org.springframework.web.portlet.handler.ParameterMappingInterceptor
ParameterMethodNameResolver - Class in org.springframework.web.servlet.mvc.multiaction
Implementation of MethodNameResolver which supports several strategies for mapping parameter values to the names of methods to invoke.
ParameterMethodNameResolver() - Constructor for class org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver
parameterNameDiscoverer - Variable in class org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory
ParameterNameDiscoverer - Interface in org.springframework.core
Interface to discover parameter names for methods and constructors.
parameterNameToUse(String) - Method in interface org.springframework.jdbc.core.metadata.CallMetaDataProvider
Provide any modification of the column name passed in to match the meta data currently used.
parameterNameToUse(String) - Method in class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
parameterNameToUse(String) - Method in class org.springframework.jdbc.core.metadata.SqlServerCallMetaDataProvider
parameterNameToUse(String) - Method in class org.springframework.jdbc.core.metadata.SybaseCallMetaDataProvider
parameters - Variable in class org.springframework.mock.web.portlet.MockBaseURL
ParamTag - Class in org.springframework.web.servlet.tags
JSP tag for collecting name-value parameters and passing them to a ParamAware ancestor in the tag hierarchy.
ParamTag() - Constructor for class org.springframework.web.servlet.tags.ParamTag
PARENT_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
PARENT_KEY - Static variable in class org.springframework.beans.factory.support.PropertiesBeanDefinitionReader
Special key to distinguish owner.(parent)=parentBeanName.
PARENT_REF_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
parse(Element, ParserContext) - Method in class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
parse(Element, ParserContext) - Method in interface org.springframework.beans.factory.xml.BeanDefinitionParser
Parse the specified Element and register the resulting BeanDefinition(s) with the ParserContext.getRegistry() BeanDefinitionRegistry} embedded in the supplied ParserContext.
parse(Element, ParserContext) - Method in interface org.springframework.beans.factory.xml.NamespaceHandler
Parse the specified Element and register any resulting BeanDefinitions with the BeanDefinitionRegistry that is embedded in the supplied ParserContext.
parse(Element, ParserContext) - Method in class org.springframework.beans.factory.xml.NamespaceHandlerSupport
Parses the supplied Element by delegating to the BeanDefinitionParser that is registered for that Element.
parse(Element, ParserContext) - Method in class org.springframework.beans.factory.xml.SimplePropertyNamespaceHandler
parse(Element, ParserContext) - Method in class org.springframework.context.annotation.AnnotationConfigBeanDefinitionParser
parse(Element, ParserContext) - Method in class org.springframework.context.annotation.ComponentScanBeanDefinitionParser
parse(String, Locale) - Method in class org.springframework.format.datetime.DateFormatter
parse(String, Locale) - Method in class org.springframework.format.datetime.joda.DateTimeParser
parse(String, Locale) - Method in class org.springframework.format.number.AbstractNumberFormatter
parse(String, Locale) - Method in class org.springframework.format.number.CurrencyFormatter
parse(String, Locale) - Method in interface org.springframework.format.Parser
Parse a text String to produce a T.
parse(Element, ParserContext) - Method in class org.springframework.scheduling.config.AnnotationDrivenBeanDefinitionParser
parse(Element, ParserContext) - Method in class org.springframework.scripting.config.ScriptingDefaultsParser
parseArrayElement(Element, BeanDefinition) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Parse an array element.
parseBeanDefinitionAttributes(Element, String, BeanDefinition, AbstractBeanDefinition) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Apply the attributes of the given bean element to the given bean * definition.
parseBeanDefinitionElement(Element) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Parses the supplied <bean> element.
parseBeanDefinitionElement(Element, BeanDefinition) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Parses the supplied <bean> element.
parseBeanDefinitionElement(Element, String, BeanDefinition) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Parse the bean definition itself, without regard to name or aliases.
parseBeanDefinitions(Element, BeanDefinitionParserDelegate) - Method in class org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader
Parse the elements at the root level in the document: "import", "alias", "bean".
parseBeanNameGenerator(Element, ClassPathBeanDefinitionScanner) - Method in class org.springframework.context.annotation.ComponentScanBeanDefinitionParser
parseCollectionElements(NodeList, Collection<Object>, BeanDefinition, String) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
parseConstructorArgElement(Element, BeanDefinition) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Parse a constructor-arg element.
parseConstructorArgElements(Element, BeanDefinition) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Parse constructor-arg sub-elements of the given bean element.
parseCustomElement(Element) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
parseCustomElement(Element, BeanDefinition) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
parseDefaultValueAttribute(String) - Method in class org.springframework.web.bind.annotation.support.HandlerMethodInvoker
ParsedSql - Class in org.springframework.jdbc.core.namedparam
Holds information about a parsed SQL statement.
ParseException - Exception in org.springframework.expression
Represent an exception that occurs during expression parsing.
ParseException(String, int, String) - Constructor for exception org.springframework.expression.ParseException
Creates a new expression parsing exception.
ParseException(int, String, Throwable) - Constructor for exception org.springframework.expression.ParseException
Creates a new expression parsing exception.
ParseException(int, String) - Constructor for exception org.springframework.expression.ParseException
Creates a new expression parsing exception.
parseExpression(String) - Method in class org.springframework.expression.common.TemplateAwareExpressionParser
parseExpression(String, ParserContext) - Method in class org.springframework.expression.common.TemplateAwareExpressionParser
parseExpression(String) - Method in interface org.springframework.expression.ExpressionParser
Parse the expression string and return an Expression object you can use for repeated evaluation.
parseExpression(String, ParserContext) - Method in interface org.springframework.expression.ExpressionParser
Parse the expression string and return an Expression object you can use for repeated evaluation.
parseExpression(String, Class, FunctionMapper) - Method in class org.springframework.mock.web.MockExpressionEvaluator
parseFileItems(List<FileItem>, String) - Method in class org.springframework.web.multipart.commons.CommonsFileUploadSupport
Parse the given List of Commons FileItems into a Spring MultipartParsingResult, containing Spring MultipartFile instances and a Map of multipart parameter.
parseIdRefElement(Element) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Return a typed String value Object for the given 'idref' element.
parseInternal(Element, ParserContext) - Method in class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
Central template method to actually parse the supplied Element into one or more BeanDefinitions.
parseInternal(Element, ParserContext) - Method in class org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
Creates a BeanDefinitionBuilder instance for the bean Class and passes it to the AbstractSingleBeanDefinitionParser.doParse(org.w3c.dom.Element, org.springframework.beans.factory.xml.ParserContext, org.springframework.beans.factory.support.BeanDefinitionBuilder) strategy method.
parseInternal(Element, ParserContext) - Method in class org.springframework.jdbc.config.EmbeddedDatabaseBeanDefinitionParser
parseInternal(Element, ParserContext) - Method in class org.springframework.jdbc.config.InitializeDatabaseBeanDefinitionParser
parseKeyElement(Element, BeanDefinition, String) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Parse a key sub-element of a map element.
parseListElement(Element, BeanDefinition) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Parse a list element.
parseLocaleString(String) - Static method in class org.springframework.util.StringUtils
Parse the given localeString into a Locale.
parseLookupOverrideSubElements(Element, MethodOverrides) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Parse lookup-override sub-elements of the given bean element.
parseMapElement(Element, BeanDefinition) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Parse a map element.
parseMediaType(String) - Static method in class org.springframework.http.MediaType
Parse the given String into a single MediaType.
parseMediaTypes(String) - Static method in class org.springframework.http.MediaType
Parse the given, comma-seperated string into a list of MediaType objects.
parseMergeAttribute(Element) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Parse the merge attribute of a collection element, if any.
parseMetaElements(Element, BeanMetadataAttributeAccessor) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
parseNumber(String, Class<T>) - Static method in class org.springframework.util.NumberUtils
Parse the given text into a number instance of the given target class, using the corresponding decode / valueOf methods.
parseNumber(String, Class<T>, NumberFormat) - Static method in class org.springframework.util.NumberUtils
Parse the given text into a number instance of the given target class, using the given NumberFormat.
parsePropertyElement(Element, BeanDefinition) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Parse a property element.
parsePropertyElements(Element, BeanDefinition) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Parse property sub-elements of the given bean element.
parsePropertySubElement(Element, BeanDefinition) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
parsePropertySubElement(Element, BeanDefinition, String) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Parse a value, ref or collection sub-element of a property or constructor-arg element.
parsePropertyValue(Element, BeanDefinition, String) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Get the value of a property element.
parsePropsElement(Element) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Parse a props element.
parseQualifierElement(Element, AbstractBeanDefinition) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Parse a qualifier element.
parseQualifierElements(Element, AbstractBeanDefinition) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Parse qualifier sub-elements of the given bean element.
Parser<T> - Interface in org.springframework.format
Parses text strings to produce instances of T.
parseRaw(String) - Method in class org.springframework.expression.spel.standard.SpelExpressionParser
ParserContext - Class in org.springframework.beans.factory.xml
Context that gets passed along a bean definition parsing process, encapsulating all relevant configuration as well as state.
ParserContext(XmlReaderContext, BeanDefinitionParserDelegate) - Constructor for class org.springframework.beans.factory.xml.ParserContext
ParserContext(XmlReaderContext, BeanDefinitionParserDelegate, BeanDefinition) - Constructor for class org.springframework.beans.factory.xml.ParserContext
ParserContext - Interface in org.springframework.expression
Input provided to an expression parser that can influence an expression parsing/compilation routine.
parseReplacedMethodSubElements(Element, MethodOverrides) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Parse replaced-method sub-elements of the given bean element.
parseRequest(HttpServletRequest) - Method in class org.springframework.web.multipart.commons.CommonsMultipartResolver
Parse the given servlet request, resolving its multipart elements.
parseRequest(ActionRequest) - Method in class org.springframework.web.portlet.multipart.CommonsPortletMultipartResolver
Parse the given portlet request, resolving its multipart elements.
parseScope(Element, ClassPathBeanDefinitionScanner) - Method in class org.springframework.context.annotation.ComponentScanBeanDefinitionParser
parseSetElement(Element, BeanDefinition) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Parse a set element.
parseSqlStatement(String) - Static method in class org.springframework.jdbc.core.namedparam.NamedParameterUtils
Parse the SQL statement and locate any placeholders or named parameters.
parseSqlStatementIntoString(String) - Static method in class org.springframework.jdbc.core.namedparam.NamedParameterUtils
Parse the SQL statement and locate any placeholders or named parameters.
ParseState - Class in org.springframework.beans.factory.parsing
Simple Stack-based structure for tracking the logical position during a parsing process.
ParseState() - Constructor for class org.springframework.beans.factory.parsing.ParseState
Create a new ParseState with an empty Stack.
ParseState.Entry - Interface in org.springframework.beans.factory.parsing
Marker interface for entries into the ParseState.
parseStringValue(String, Properties, Set) - Method in class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
Deprecated. as of Spring 3.0, in favor of using PropertyPlaceholderConfigurer.resolvePlaceholder(java.lang.String, java.util.Properties, int) with PropertyPlaceholderHelper. Only retained for compatibility with Spring 2.5 extensions.
parseStringValue(String, PropertyPlaceholderHelper.PlaceholderResolver, Set<String>) - Method in class org.springframework.util.PropertyPlaceholderHelper
parseTransactionAnnotation(AnnotatedElement) - Method in class org.springframework.transaction.annotation.Ejb3TransactionAnnotationParser
parseTransactionAnnotation(TransactionAttribute) - Method in class org.springframework.transaction.annotation.Ejb3TransactionAnnotationParser
parseTransactionAnnotation(AnnotatedElement) - Method in class org.springframework.transaction.annotation.SpringTransactionAnnotationParser
parseTransactionAnnotation(Transactional) - Method in class org.springframework.transaction.annotation.SpringTransactionAnnotationParser
parseTransactionAnnotation(AnnotatedElement) - Method in interface org.springframework.transaction.annotation.TransactionAnnotationParser
Parse the transaction attribute for the given method or class, based on a known annotation type.
parseTypeFilters(Element, ClassPathBeanDefinitionScanner, XmlReaderContext, ParserContext) - Method in class org.springframework.context.annotation.ComponentScanBeanDefinitionParser
parseValueElement(Element, String) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Return a typed String value Object for the given value element.
PARTICIPATE_SUFFIX - Static variable in class org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor
Suffix that gets appended to the SessionFactory toString() representation for the "participate in existing session handling" request attribute.
PARTICIPATE_SUFFIX - Static variable in class org.springframework.orm.jdo.support.OpenPersistenceManagerInViewInterceptor
Suffix that gets appended to the PersistenceManagerFactory toString representation for the "participate in existing persistence manager handling" request attribute.
PARTICIPATE_SUFFIX - Static variable in class org.springframework.orm.jpa.support.OpenEntityManagerInViewInterceptor
Suffix that gets appended to the EntityManagerFactory toString representation for the "participate in existing entity manager handling" request attribute.
passAllParametersToRenderPhase(ActionRequest, ActionResponse) - Static method in class org.springframework.web.portlet.util.PortletUtils
Pass all the action request parameters to the render phase by putting them into the action response object.
passivateObject(Object) - Method in class org.springframework.aop.target.CommonsPoolTargetSource
passRenderParameters(ActionRequest, ActionResponse) - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Pass the specified list of action request parameters to the render phase by putting them into the action response object.
PassThroughFilterChain - Class in org.springframework.mock.web
Implementation of the FilterConfig interface which simply passes the call through to a given Filter/FilterChain combination (indicating the next Filter in the chain along with the FilterChain that it is supposed to work on) or to a given Servlet (indicating the end of the chain).
PassThroughFilterChain(Filter, FilterChain) - Constructor for class org.springframework.mock.web.PassThroughFilterChain
Create a new PassThroughFilterChain that delegates to the given Filter, calling it with the given FilterChain.
PassThroughFilterChain(Servlet) - Constructor for class org.springframework.mock.web.PassThroughFilterChain
Create a new PassThroughFilterChain that delegates to the given Servlet.
PassThroughSourceExtractor - Class in org.springframework.beans.factory.parsing
Simple SourceExtractor implementation that just passes the candidate source metadata object through for attachment.
PassThroughSourceExtractor() - Constructor for class org.springframework.beans.factory.parsing.PassThroughSourceExtractor
PasswordInputTag - Class in org.springframework.web.servlet.tags.form
Databinding-aware JSP tag for rendering an HTML 'input' element with a 'type' of 'password'.
PasswordInputTag() - Constructor for class org.springframework.web.servlet.tags.form.PasswordInputTag
PATH_ATTRIBUTE - Static variable in class org.springframework.web.servlet.view.tiles.TilesView
Deprecated. Name of the attribute that will override the path of the layout page to render.
PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE - Static variable in interface org.springframework.web.servlet.HandlerMapping
Name of the HttpServletRequest attribute that contains the path within the handler mapping, in case of a pattern match, or the full relevant URI (typically within the DispatcherServlet's mapping) else.
pathEquals(String, String) - Static method in class org.springframework.util.StringUtils
Compare two paths after normalization of them.
PathMatcher - Interface in org.springframework.util
Strategy interface for String-based path matching.
PathMatchingResourcePatternResolver - Class in org.springframework.core.io.support
A ResourcePatternResolver implementation that is able to resolve a specified resource location path into one or more matching Resources.
PathMatchingResourcePatternResolver() - Constructor for class org.springframework.core.io.support.PathMatchingResourcePatternResolver
Create a new PathMatchingResourcePatternResolver with a DefaultResourceLoader.
PathMatchingResourcePatternResolver(ClassLoader) - Constructor for class org.springframework.core.io.support.PathMatchingResourcePatternResolver
Create a new PathMatchingResourcePatternResolver with a DefaultResourceLoader.
PathMatchingResourcePatternResolver(ResourceLoader) - Constructor for class org.springframework.core.io.support.PathMatchingResourcePatternResolver
Create a new PathMatchingResourcePatternResolver.
PathVariable - Annotation Type in org.springframework.web.bind.annotation
Annotation which indicates that a method parameter should be bound to a URI template variable.
PatternEditor - Class in org.springframework.beans.propertyeditors
Editor for java.util.regex.Pattern, to directly populate a Pattern property.
PatternEditor() - Constructor for class org.springframework.beans.propertyeditors.PatternEditor
Create a new PatternEditor with default settings.
PatternEditor(int) - Constructor for class org.springframework.beans.propertyeditors.PatternEditor
Create a new PatternEditor with the given settings.
PatternMatchUtils - Class in org.springframework.util
Utility methods for simple pattern matching, in particular for Spring's typical "xxx*", "*xxx" and "*xxx*" pattern styles.
PatternMatchUtils() - Constructor for class org.springframework.util.PatternMatchUtils
pd - Variable in class org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement
peek() - Method in class org.springframework.beans.factory.parsing.ParseState
Return the ParseState.Entry currently at the top of the Stack or null if the Stack is empty.
PercentFormatter - Class in org.springframework.format.number
A Number formatter for percent values.
PercentFormatter() - Constructor for class org.springframework.format.number.PercentFormatter
perform(ComponentContext, HttpServletRequest, HttpServletResponse, ServletContext) - Method in class org.springframework.web.servlet.view.tiles.ComponentControllerSupport
Deprecated. This implementation delegates to execute, converting non-Servlet/IO Exceptions to ServletException.
PerformanceMonitorInterceptor - Class in org.springframework.aop.interceptor
Simple AOP Alliance MethodInterceptor for performance monitoring.
PerformanceMonitorInterceptor() - Constructor for class org.springframework.aop.interceptor.PerformanceMonitorInterceptor
Create a new PerformanceMonitorInterceptor with a static logger.
PerformanceMonitorInterceptor(boolean) - Constructor for class org.springframework.aop.interceptor.PerformanceMonitorInterceptor
Create a new PerformanceMonitorInterceptor with a dynamic or static logger, according to the given flag.
performJaxRpcCall(MethodInvocation, Service) - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Perform a JAX-RPC dynamic call for the given AOP method invocation.
PeriodicTrigger - Class in org.springframework.scheduling.support
A trigger for periodic task execution.
PeriodicTrigger(long) - Constructor for class org.springframework.scheduling.support.PeriodicTrigger
Create a trigger with the given period in milliseconds.
PeriodicTrigger(long, TimeUnit) - Constructor for class org.springframework.scheduling.support.PeriodicTrigger
Create a trigger with the given period and time unit.
PermissionDeniedDataAccessException - Exception in org.springframework.dao
Exception thrown when the underlying resource denied a permission to access a specific element, such as a specific database table.
PermissionDeniedDataAccessException(String, Throwable) - Constructor for exception org.springframework.dao.PermissionDeniedDataAccessException
Constructor for PermissionDeniedDataAccessException.
persist(Object) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Persist the given transient instance.
persist(String, Object) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Persist the given transient instance.
persist(Object) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
persist(String, Object) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
persist(Object) - Method in interface org.springframework.orm.jpa.JpaOperations
persist(Object) - Method in class org.springframework.orm.jpa.JpaTemplate
PERSISTENCE_ANNOTATION_PROCESSOR_BEAN_NAME - Static variable in class org.springframework.context.annotation.AnnotationConfigUtils
The bean name of the internally managed JPA annotation processor.
PERSISTENCE_MANAGER_SYNCHRONIZATION_ORDER - Static variable in class org.springframework.orm.jdo.PersistenceManagerFactoryUtils
Order value for TransactionSynchronization objects that clean up JDO PersistenceManagers.
PersistenceAnnotationBeanPostProcessor - Class in org.springframework.orm.jpa.support
BeanPostProcessor that processes PersistenceUnit and PersistenceContext annotations, for injection of the corresponding JPA resources EntityManagerFactory and EntityManager.
PersistenceAnnotationBeanPostProcessor() - Constructor for class org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
PersistenceExceptionTranslationAdvisor - Class in org.springframework.dao.annotation
Spring AOP exception translation aspect for use at Repository or DAO layer level.
PersistenceExceptionTranslationAdvisor(PersistenceExceptionTranslator, Class<? extends Annotation>) - Constructor for class org.springframework.dao.annotation.PersistenceExceptionTranslationAdvisor
Create a new PersistenceExceptionTranslationAdvisor.
PersistenceExceptionTranslationInterceptor - Class in org.springframework.dao.support
AOP Alliance MethodInterceptor that provides persistence exception translation based on a given PersistenceExceptionTranslator.
PersistenceExceptionTranslationInterceptor() - Constructor for class org.springframework.dao.support.PersistenceExceptionTranslationInterceptor
Create a new PersistenceExceptionTranslationInterceptor.
PersistenceExceptionTranslationInterceptor(PersistenceExceptionTranslator) - Constructor for class org.springframework.dao.support.PersistenceExceptionTranslationInterceptor
Create a new PersistenceExceptionTranslationInterceptor for the given PersistenceExceptionTranslator.
PersistenceExceptionTranslationInterceptor(ListableBeanFactory) - Constructor for class org.springframework.dao.support.PersistenceExceptionTranslationInterceptor
Create a new PersistenceExceptionTranslationInterceptor, autodetecting PersistenceExceptionTranslators in the given BeanFactory.
PersistenceExceptionTranslationPostProcessor - Class in org.springframework.dao.annotation
Bean post-processor that automatically applies persistence exception translation to any bean that carries the Repository annotation, adding a corresponding PersistenceExceptionTranslationAdvisor to the exposed proxy (either an existing AOP proxy or a newly generated proxy that implements all of the target's interfaces).
PersistenceExceptionTranslationPostProcessor() - Constructor for class org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor
PersistenceExceptionTranslator - Interface in org.springframework.dao.support
Interface implemented by Spring integrations with data access technologies that throw runtime exceptions, such as JPA, TopLink, JDO and Hibernate.
PersistenceManagerFactoryUtils - Class in org.springframework.orm.jdo
Helper class featuring methods for JDO PersistenceManager handling, allowing for reuse of PersistenceManager instances within transactions.
PersistenceManagerFactoryUtils() - Constructor for class org.springframework.orm.jdo.PersistenceManagerFactoryUtils
PersistenceManagerHolder - Class in org.springframework.orm.jdo
Holder wrapping a JDO PersistenceManager.
PersistenceManagerHolder(PersistenceManager) - Constructor for class org.springframework.orm.jdo.PersistenceManagerHolder
PersistenceUnitManager - Interface in org.springframework.orm.jpa.persistenceunit
Interface that defines an abstraction for finding and managing JPA PersistenceUnitInfos.
PersistenceUnitPostProcessor - Interface in org.springframework.orm.jpa.persistenceunit
Callback interface for post-processing a JPA PersistenceUnitInfo.
PessimisticLockingFailureException - Exception in org.springframework.dao
Exception thrown on a pessimistic locking violation.
PessimisticLockingFailureException(String) - Constructor for exception org.springframework.dao.PessimisticLockingFailureException
Constructor for PessimisticLockingFailureException.
PessimisticLockingFailureException(String, Throwable) - Constructor for exception org.springframework.dao.PessimisticLockingFailureException
Constructor for PessimisticLockingFailureException.
Phased - Interface in org.springframework.context
Interface for objects that may participate in a phased process such as lifecycle management.
PLACEHOLDER_ARGUMENT_TYPES - Static variable in class org.springframework.aop.interceptor.CustomizableTraceInterceptor
The $[argumentTypes] placeholder.
PLACEHOLDER_ARGUMENTS - Static variable in class org.springframework.aop.interceptor.CustomizableTraceInterceptor
The $[arguments] placeholder.
PLACEHOLDER_EXCEPTION - Static variable in class org.springframework.aop.interceptor.CustomizableTraceInterceptor
The $[exception] placeholder.
PLACEHOLDER_INVOCATION_TIME - Static variable in class org.springframework.aop.interceptor.CustomizableTraceInterceptor
The $[invocationTime] placeholder.
PLACEHOLDER_METHOD_NAME - Static variable in class org.springframework.aop.interceptor.CustomizableTraceInterceptor
The $[methodName] placeholder.
PLACEHOLDER_PREFIX - Static variable in class org.springframework.util.SystemPropertyUtils
Prefix for system property placeholders: "${"
PLACEHOLDER_RETURN_VALUE - Static variable in class org.springframework.aop.interceptor.CustomizableTraceInterceptor
The $[returnValue] placeholder.
PLACEHOLDER_SUFFIX - Static variable in class org.springframework.util.SystemPropertyUtils
Suffix for system property placeholders: "}"
PLACEHOLDER_TARGET_CLASS_NAME - Static variable in class org.springframework.aop.interceptor.CustomizableTraceInterceptor
The $[targetClassName] placeholder.
PLACEHOLDER_TARGET_CLASS_SHORT_NAME - Static variable in class org.springframework.aop.interceptor.CustomizableTraceInterceptor
The $[targetClassShortName] placeholder.
PlatformTransactionManager - Interface in org.springframework.transaction
This is the central interface in Spring's transaction infrastructure.
PluggableSchemaResolver - Class in org.springframework.beans.factory.xml
EntityResolver implementation that attempts to resolve schema URLs into local classpath resources using a set of mappings files.
PluggableSchemaResolver(ClassLoader) - Constructor for class org.springframework.beans.factory.xml.PluggableSchemaResolver
Loads the schema URL -> schema file location mappings using the default mapping file pattern "META-INF/spring.schemas".
PluggableSchemaResolver(ClassLoader, String) - Constructor for class org.springframework.beans.factory.xml.PluggableSchemaResolver
Loads the schema URL -> schema file location mappings using the given mapping file pattern.
Pointcut - Interface in org.springframework.aop
Core Spring pointcut abstraction.
PointcutAdvisor - Interface in org.springframework.aop
Superinterface for all Advisors that are driven by a pointcut.
PointcutComponentDefinition - Class in org.springframework.aop.config
ComponentDefinition implementation that holds a pointcut definition.
PointcutComponentDefinition(String, BeanDefinition, String) - Constructor for class org.springframework.aop.config.PointcutComponentDefinition
PointcutEntry - Class in org.springframework.aop.config
ParseState entry representing a pointcut.
PointcutEntry(String) - Constructor for class org.springframework.aop.config.PointcutEntry
Creates a new instance of the PointcutEntry class.
Pointcuts - Class in org.springframework.aop.support
Pointcut constants for matching getters and setters, and static methods useful for manipulating and evaluating pointcuts.
Pointcuts() - Constructor for class org.springframework.aop.support.Pointcuts
PoolingConfig - Interface in org.springframework.aop.target
Config interface for a pooling target source.
pop() - Method in class org.springframework.beans.factory.parsing.ParseState
Remove an ParseState.Entry from the Stack.
popActiveContextObject() - Method in class org.springframework.expression.spel.ExpressionState
popAndRegisterContainingComponent() - Method in class org.springframework.beans.factory.xml.ParserContext
popContainingComponent() - Method in class org.springframework.beans.factory.xml.ParserContext
popNestedPath() - Method in class org.springframework.validation.AbstractErrors
popNestedPath() - Method in exception org.springframework.validation.BindException
popNestedPath() - Method in interface org.springframework.validation.Errors
Pop the former nested path from the nested path stack.
popNestedPath() - Method in class org.springframework.web.bind.EscapedErrors
populate(Connection) - Method in interface org.springframework.jdbc.datasource.init.DatabasePopulator
Populate the database using the JDBC connection provided.
populate(Connection) - Method in class org.springframework.jdbc.datasource.init.ResourceDatabasePopulator
populateActivationSpecProperties(BeanWrapper, JmsActivationSpecConfig) - Method in class org.springframework.jms.listener.endpoint.DefaultJmsActivationSpecFactory
This implementation supports Spring's extended "maxConcurrency" and "prefetchSize" settings through detecting corresponding ActivationSpec properties: "maxSessions"/"maxNumberOfWorks" and "maxMessagesPerSessions"/"maxMessages", respectively (following ActiveMQ's and JORAM's naming conventions).
populateActivationSpecProperties(BeanWrapper, JmsActivationSpecConfig) - Method in class org.springframework.jms.listener.endpoint.StandardJmsActivationSpecFactory
Populate the given ApplicationSpec object with the settings defined in the given configuration object.
populateAttributeDescriptor(Descriptor, Method, Method, String) - Method in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Allows subclasses to add extra fields to the Descriptor for a particular attribute.
populateAttributeDescriptor(Descriptor, Method, Method, String) - Method in class org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler
Adds descriptor fields from the ManagedAttribute attribute or the ManagedMetric attribute to the attribute descriptor.
populateBean(String, AbstractBeanDefinition, BeanWrapper) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Populate the bean instance in the given BeanWrapper with the property values from the bean definition.
populateDefaults(DocumentDefaultsDefinition, Element) - Method in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Populate the given DocumentDefaultsDefinition instance with the default lazy-init, autowire, dependency check settings, init-method, destroy-method and merge settings.
populateLob(Object) - Method in interface org.springframework.jdbc.support.lob.OracleLobHandler.LobCallback
Populate the given BLOB or CLOB instance with content.
populateMBeanDescriptor(Descriptor, Object, String) - Method in class org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler
Called after the ModelMBeanInfo instance has been constructed but before it is passed to the MBeanExporter.
populateMBeanDescriptor(Descriptor, Object, String) - Method in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Allows subclasses to add extra fields to the Descriptor for an MBean.
populateMBeanDescriptor(Descriptor, Object, String) - Method in class org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler
Adds descriptor fields from the ManagedResource attribute to the MBean descriptor.
populateOperationDescriptor(Descriptor, Method, String) - Method in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Allows subclasses to add extra fields to the Descriptor for a particular operation.
populateOperationDescriptor(Descriptor, Method, String) - Method in class org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler
Adds descriptor fields from the ManagedAttribute attribute to the attribute descriptor.
PORTLET_CONFIG_BEAN_NAME - Static variable in interface org.springframework.web.portlet.context.ConfigurablePortletApplicationContext
Name of the PortletConfig environment bean in the factory.
PORTLET_CONTEXT_BEAN_NAME - Static variable in interface org.springframework.web.portlet.context.ConfigurablePortletApplicationContext
Name of the PortletContext environment bean in the factory.
PORTLET_CONTEXT_PREFIX - Static variable in class org.springframework.web.portlet.FrameworkPortlet
Prefix for the PortletContext attribute for the Portlet ApplicationContext.
PortletApplicationContextUtils - Class in org.springframework.web.portlet.context
Convenience methods for retrieving the root WebApplicationContext for a given PortletContext.
PortletApplicationContextUtils() - Constructor for class org.springframework.web.portlet.context.PortletApplicationContextUtils
PortletApplicationObjectSupport - Class in org.springframework.web.portlet.context
Convenient superclass for application objects running in a Portlet ApplicationContext.
PortletApplicationObjectSupport() - Constructor for class org.springframework.web.portlet.context.PortletApplicationObjectSupport
PortletConfigAware - Interface in org.springframework.web.portlet.context
Interface to be implemented by any object that wishes to be notified of the PortletConfig (typically determined by the PortletApplicationContext) that it runs in.
PortletContentGenerator - Class in org.springframework.web.portlet.handler
Convenient superclass for any kind of web content generator, like AbstractController.
PortletContentGenerator() - Constructor for class org.springframework.web.portlet.handler.PortletContentGenerator
PortletContextAware - Interface in org.springframework.web.portlet.context
Interface to be implemented by any object that wishes to be notified of the PortletContext (typically determined by the PortletApplicationContext) that it runs in.
PortletContextAwareProcessor - Class in org.springframework.web.portlet.context
BeanPostProcessor implementation that passes the PortletContext to beans that implement the PortletContextAware interface.
PortletContextAwareProcessor(PortletContext) - Constructor for class org.springframework.web.portlet.context.PortletContextAwareProcessor
Create a new PortletContextAwareProcessor for the given context.
PortletContextAwareProcessor(PortletConfig) - Constructor for class org.springframework.web.portlet.context.PortletContextAwareProcessor
Create a new PortletContextAwareProcessor for the given config.
PortletContextAwareProcessor(PortletContext, PortletConfig) - Constructor for class org.springframework.web.portlet.context.PortletContextAwareProcessor
Create a new PortletContextAwareProcessor for the given context and config.
PortletContextResource - Class in org.springframework.web.portlet.context
Resource implementation for PortletContext resources, interpreting relative paths within the portlet application root directory.
PortletContextResource(PortletContext, String) - Constructor for class org.springframework.web.portlet.context.PortletContextResource
Create a new PortletContextResource.
PortletContextResourceLoader - Class in org.springframework.web.portlet.context
ResourceLoader implementation that resolves paths as PortletContext resources, for use outside a Portlet ApplicationContext (for example, in a GenericPortletBean subclass).
PortletContextResourceLoader(PortletContext) - Constructor for class org.springframework.web.portlet.context.PortletContextResourceLoader
Create a new PortletContextResourceLoader.
PortletContextResourcePatternResolver - Class in org.springframework.web.portlet.context
PortletContext-aware subclass of PathMatchingResourcePatternResolver, able to find matching resources below the web application root directory via Portlet API's PortletContext.getResourcePaths.
PortletContextResourcePatternResolver(PortletContext) - Constructor for class org.springframework.web.portlet.context.PortletContextResourcePatternResolver
Create a new PortletContextResourcePatternResolver.
PortletContextResourcePatternResolver(ResourceLoader) - Constructor for class org.springframework.web.portlet.context.PortletContextResourcePatternResolver
Create a new PortletContextResourcePatternResolver.
PortletContextScope - Class in org.springframework.web.portlet.context
Scope wrapper for a PortletContext, i.e.
PortletContextScope(PortletContext) - Constructor for class org.springframework.web.portlet.context.PortletContextScope
Create a new Scope wrapper for the given PortletContext.
PortletModeHandlerMapping - Class in org.springframework.web.portlet.handler
Implementation of the HandlerMapping interface to map from the current PortletMode to request handler beans.
PortletModeHandlerMapping() - Constructor for class org.springframework.web.portlet.handler.PortletModeHandlerMapping
PortletModeNameViewController - Class in org.springframework.web.portlet.mvc
Trivial controller that transforms the PortletMode to a view name.
PortletModeNameViewController() - Constructor for class org.springframework.web.portlet.mvc.PortletModeNameViewController
PortletModeParameterHandlerMapping - Class in org.springframework.web.portlet.handler
Implementation of the HandlerMapping interface to map from the current PortletMode and a request parameter to request handler beans.
PortletModeParameterHandlerMapping() - Constructor for class org.springframework.web.portlet.handler.PortletModeParameterHandlerMapping
PortletMultipartResolver - Interface in org.springframework.web.portlet.multipart
Portlet version of Spring's multipart resolution strategy for file uploads as defined in RFC 1867.
PortletRequestAttributes - Class in org.springframework.web.portlet.context
Portlet-based implementation of the RequestAttributes interface.
PortletRequestAttributes(PortletRequest) - Constructor for class org.springframework.web.portlet.context.PortletRequestAttributes
Create a new PortletRequestAttributes instance for the given request.
PortletRequestBindingException - Exception in org.springframework.web.portlet.bind
Fatal binding exception, thrown when we want to treat binding exceptions as unrecoverable.
PortletRequestBindingException(String) - Constructor for exception org.springframework.web.portlet.bind.PortletRequestBindingException
Constructor for PortletRequestBindingException.
PortletRequestBindingException(String, Throwable) - Constructor for exception org.springframework.web.portlet.bind.PortletRequestBindingException
Constructor for PortletRequestBindingException.
PortletRequestDataBinder - Class in org.springframework.web.portlet.bind
Special DataBinder to perform data binding from portlet request parameters to JavaBeans, including support for multipart files.
PortletRequestDataBinder(Object) - Constructor for class org.springframework.web.portlet.bind.PortletRequestDataBinder
Create a new PortletRequestDataBinder instance, with default object name.
PortletRequestDataBinder(Object, String) - Constructor for class org.springframework.web.portlet.bind.PortletRequestDataBinder
Create a new PortletRequestDataBinder instance.
PortletRequestHandledEvent - Class in org.springframework.web.portlet.context
Portlet-specific subclass of RequestHandledEvent, adding portlet-specific context information.
PortletRequestHandledEvent(Object, String, String, String, String, String, long) - Constructor for class org.springframework.web.portlet.context.PortletRequestHandledEvent
Create a new PortletRequestHandledEvent.
PortletRequestHandledEvent(Object, String, String, String, String, String, long, Throwable) - Constructor for class org.springframework.web.portlet.context.PortletRequestHandledEvent
Create a new PortletRequestHandledEvent.
PortletRequestMethodNotSupportedException - Exception in org.springframework.web.portlet.handler
Exception thrown when a request handler does not support a specific request method.
PortletRequestMethodNotSupportedException(String) - Constructor for exception org.springframework.web.portlet.handler.PortletRequestMethodNotSupportedException
Create a new PortletRequestMethodNotSupportedException.
PortletRequestMethodNotSupportedException(String, String[]) - Constructor for exception org.springframework.web.portlet.handler.PortletRequestMethodNotSupportedException
Create a new PortletRequestMethodNotSupportedException.
PortletRequestMethodNotSupportedException(String[]) - Constructor for exception org.springframework.web.portlet.handler.PortletRequestMethodNotSupportedException
Create a new PortletRequestMethodNotSupportedException.
PortletRequestParameterPropertyValues - Class in org.springframework.web.portlet.bind
PropertyValues implementation created from parameters in a PortletRequest.
PortletRequestParameterPropertyValues(PortletRequest) - Constructor for class org.springframework.web.portlet.bind.PortletRequestParameterPropertyValues
Create new PortletRequestPropertyValues using no prefix (and hence, no prefix separator).
PortletRequestParameterPropertyValues(PortletRequest, String) - Constructor for class org.springframework.web.portlet.bind.PortletRequestParameterPropertyValues
Create new PortletRequestPropertyValues using the given prefix and the default prefix separator (the underscore character "_").
PortletRequestParameterPropertyValues(PortletRequest, String, String) - Constructor for class org.springframework.web.portlet.bind.PortletRequestParameterPropertyValues
Create new PortletRequestPropertyValues supplying both prefix and prefix separator.
PortletRequestUtils - Class in org.springframework.web.portlet.bind
Parameter extraction methods, for an approach distinct from data binding, in which parameters of specific types are required.
PortletRequestUtils() - Constructor for class org.springframework.web.portlet.bind.PortletRequestUtils
PortletSessionRequiredException - Exception in org.springframework.web.portlet.handler
Exception thrown when a portlet content generator requires a pre-existing session.
PortletSessionRequiredException(String) - Constructor for exception org.springframework.web.portlet.handler.PortletSessionRequiredException
Create a new PortletSessionRequiredException.
PortletUtils - Class in org.springframework.web.portlet.util
Miscellaneous utilities for portlet applications.
PortletUtils() - Constructor for class org.springframework.web.portlet.util.PortletUtils
PortletWebRequest - Class in org.springframework.web.portlet.context
WebRequest adapter for a PortletRequest.
PortletWebRequest(PortletRequest) - Constructor for class org.springframework.web.portlet.context.PortletWebRequest
Create a new PortletWebRequest instance for the given request.
PortletWebRequest(PortletRequest, PortletResponse) - Constructor for class org.springframework.web.portlet.context.PortletWebRequest
Create a new PortletWebRequest instance for the given request/response pair.
PortletWrappingController - Class in org.springframework.web.portlet.mvc
Controller implementation that wraps a portlet instance which it manages internally.
PortletWrappingController() - Constructor for class org.springframework.web.portlet.mvc.PortletWrappingController
pos - Variable in class org.springframework.expression.spel.ast.SpelNodeImpl
position - Variable in exception org.springframework.expression.ExpressionException
possiblyExpectingExceptions(FrameworkMethod, Object, Statement) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
Performs the same logic as BlockJUnit4ClassRunner.possiblyExpectingExceptions(FrameworkMethod, Object, Statement) except that the expected exception is retrieved using SpringJUnit4ClassRunner.getExpectedException(FrameworkMethod).
postForEntity(String, Object, Class<T>, Object...) - Method in interface org.springframework.web.client.RestOperations
Create a new resource by POSTing the given object to the URI template, and returns the response as ResponseEntity.
postForEntity(String, Object, Class<T>, Map<String, ?>) - Method in interface org.springframework.web.client.RestOperations
Create a new resource by POSTing the given object to the URI template, and returns the response as HttpEntity.
postForEntity(URI, Object, Class<T>) - Method in interface org.springframework.web.client.RestOperations
Create a new resource by POSTing the given object to the URL, and returns the response as ResponseEntity.
postForEntity(String, Object, Class<T>, Object...) - Method in class org.springframework.web.client.RestTemplate
postForEntity(String, Object, Class<T>, Map<String, ?>) - Method in class org.springframework.web.client.RestTemplate
postForEntity(URI, Object, Class<T>) - Method in class org.springframework.web.client.RestTemplate
postForLocation(String, Object, Object...) - Method in interface org.springframework.web.client.RestOperations
Create a new resource by POSTing the given object to the URI template, and returns the value of the Location header.
postForLocation(String, Object, Map<String, ?>) - Method in interface org.springframework.web.client.RestOperations
Create a new resource by POSTing the given object to the URI template, and returns the value of the Location header.
postForLocation(URI, Object) - Method in interface org.springframework.web.client.RestOperations
Create a new resource by POSTing the given object to the URL, and returns the value of the Location header.
postForLocation(String, Object, Object...) - Method in class org.springframework.web.client.RestTemplate
postForLocation(String, Object, Map<String, ?>) - Method in class org.springframework.web.client.RestTemplate
postForLocation(URI, Object) - Method in class org.springframework.web.client.RestTemplate
postForObject(String, Object, Class<T>, Object...) - Method in interface org.springframework.web.client.RestOperations
Create a new resource by POSTing the given object to the URI template, and returns the representation found in the response.
postForObject(String, Object, Class<T>, Map<String, ?>) - Method in interface org.springframework.web.client.RestOperations
Create a new resource by POSTing the given object to the URI template, and returns the representation found in the response.
postForObject(URI, Object, Class<T>) - Method in interface org.springframework.web.client.RestOperations
Create a new resource by POSTing the given object to the URL, and returns the representation found in the response.
postForObject(String, Object, Class<T>, Object...) - Method in class org.springframework.web.client.RestTemplate
postForObject(String, Object, Class<T>, Map<String, ?>) - Method in class org.springframework.web.client.RestTemplate
postForObject(URI, Object, Class<T>) - Method in class org.springframework.web.client.RestTemplate
PostgresCallMetaDataProvider - Class in org.springframework.jdbc.core.metadata
Oracle specific implementation for the CallMetaDataProvider interface.
PostgresCallMetaDataProvider(DatabaseMetaData) - Constructor for class org.springframework.jdbc.core.metadata.PostgresCallMetaDataProvider
PostgreSQLSequenceMaxValueIncrementer - Class in org.springframework.jdbc.support.incrementer
DataFieldMaxValueIncrementer that retrieves the next value of a given PostgreSQL sequence.
PostgreSQLSequenceMaxValueIncrementer() - Constructor for class org.springframework.jdbc.support.incrementer.PostgreSQLSequenceMaxValueIncrementer
Default constructor for bean property style usage.
PostgreSQLSequenceMaxValueIncrementer(DataSource, String) - Constructor for class org.springframework.jdbc.support.incrementer.PostgreSQLSequenceMaxValueIncrementer
Convenience constructor.
PostgresTableMetaDataProvider - Class in org.springframework.jdbc.core.metadata
The PostgreSQL specific implementation of the TableMetaDataProvider.
PostgresTableMetaDataProvider(DatabaseMetaData) - Constructor for class org.springframework.jdbc.core.metadata.PostgresTableMetaDataProvider
postHandle(WebRequest, ModelMap) - Method in class org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor
Flush the Hibernate Session before view rendering, if necessary.
postHandle(WebRequest, ModelMap) - Method in class org.springframework.orm.jdo.support.OpenPersistenceManagerInViewInterceptor
postHandle(WebRequest, ModelMap) - Method in class org.springframework.orm.jpa.support.OpenEntityManagerInViewInterceptor
postHandle(WebRequest, ModelMap) - Method in class org.springframework.web.context.request.Log4jNestedDiagnosticContextInterceptor
postHandle(WebRequest, ModelMap) - Method in interface org.springframework.web.context.request.WebRequestInterceptor
Intercept the execution of a request handler after its successful invocation, right before view rendering (if any).
postHandle(HttpServletRequest, HttpServletResponse, Object, ModelAndView) - Method in class org.springframework.web.servlet.handler.HandlerInterceptorAdapter
This implementation is empty.
postHandle(HttpServletRequest, HttpServletResponse, Object, ModelAndView) - Method in class org.springframework.web.servlet.handler.WebRequestHandlerInterceptorAdapter
postHandle(HttpServletRequest, HttpServletResponse, Object, ModelAndView) - Method in interface org.springframework.web.servlet.HandlerInterceptor
Intercept the execution of a handler.
postHandle(HttpServletRequest, HttpServletResponse, Object, ModelAndView) - Method in class org.springframework.web.servlet.mvc.WebContentInterceptor
This implementation is empty.
postHandleRender(RenderRequest, RenderResponse, Object, ModelAndView) - Method in class org.springframework.web.portlet.handler.HandlerInterceptorAdapter
This implementation is empty.
postHandleRender(RenderRequest, RenderResponse, Object, ModelAndView) - Method in class org.springframework.web.portlet.handler.WebRequestHandlerInterceptorAdapter
postHandleRender(RenderRequest, RenderResponse, Object, ModelAndView) - Method in interface org.springframework.web.portlet.HandlerInterceptor
Intercept the execution of a handler in the render phase.
postHandleResource(ResourceRequest, ResourceResponse, Object, ModelAndView) - Method in class org.springframework.web.portlet.handler.HandlerInterceptorAdapter
This implementation is empty.
postHandleResource(ResourceRequest, ResourceResponse, Object, ModelAndView) - Method in class org.springframework.web.portlet.handler.WebRequestHandlerInterceptorAdapter
postHandleResource(ResourceRequest, ResourceResponse, Object, ModelAndView) - Method in interface org.springframework.web.portlet.HandlerInterceptor
Intercept the execution of a handler in the render phase.
postProcess(BeanDefinitionBuilder, Element) - Method in class org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser
Hook method that derived classes can implement to inspect/change a bean definition after parsing is complete.
postProcessAfterInitialization(Object, String) - Method in class org.springframework.aop.framework.adapter.AdvisorAdapterRegistrationManager
postProcessAfterInitialization(Object, String) - Method in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
Create a proxy with the configured interceptors if the bean is identified as one to proxy by the subclass.
postProcessAfterInitialization(Object, String) - Method in class org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor
postProcessAfterInitialization(Object, String) - Method in interface org.springframework.beans.factory.config.BeanPostProcessor
Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).
postProcessAfterInitialization(Object, String) - Method in class org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter
postProcessAfterInitialization(Object, String) - Method in class org.springframework.context.weaving.LoadTimeWeaverAwareProcessor
postProcessAfterInitialization(Object, String) - Method in class org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor
postProcessAfterInitialization(Object, String) - Method in class org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
postProcessAfterInitialization(Object, String) - Method in class org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcessor
postProcessAfterInitialization(Object, String) - Method in class org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor
postProcessAfterInitialization(Object, String) - Method in class org.springframework.validation.beanvalidation.BeanValidationPostProcessor
postProcessAfterInitialization(Object, String) - Method in class org.springframework.web.context.support.ServletContextAwareProcessor
postProcessAfterInitialization(Object, String) - Method in class org.springframework.web.portlet.context.PortletContextAwareProcessor
postProcessAfterInitialization(Object, String) - Method in class org.springframework.web.portlet.handler.SimplePortletPostProcessor
postProcessAfterInitialization(Object, String) - Method in class org.springframework.web.servlet.handler.SimpleServletPostProcessor
postProcessAfterInstantiation(Object, String) - Method in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
postProcessAfterInstantiation(Object, String) - Method in interface org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor
Perform operations after the bean has been instantiated, via a constructor or factory method, but before Spring property population (from explicit properties or autowiring) occurs.
postProcessAfterInstantiation(Object, String) - Method in class org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter
postProcessAfterInstantiation(Object, String) - Method in class org.springframework.context.annotation.CommonAnnotationBeanPostProcessor
postProcessAfterInstantiation(Object, String) - Method in class org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
postProcessAnnotationConfiguration(AnnotationConfiguration) - Method in class org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean
To be implemented by subclasses that want to to perform custom post-processing of the AnnotationConfiguration object after this FactoryBean performed its default initialization.
postProcessBeanDefinition(AbstractBeanDefinition, String) - Method in class org.springframework.context.annotation.ClassPathBeanDefinitionScanner
Apply further settings to the given bean definition, beyond the contents retrieved from scanning the component class.
postProcessBeanDefinitionRegistry(BeanDefinitionRegistry) - Method in interface org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor
Modify the application context's internal bean definition registry after its standard initialization.
postProcessBeanDefinitionRegistry(BeanDefinitionRegistry) - Method in class org.springframework.context.annotation.ConfigurationClassPostProcessor
Derive further bean definitions from the configuration classes in the registry.
postProcessBeanFactory(ConfigurableListableBeanFactory) - Method in class org.springframework.beans.factory.annotation.CustomAutowireConfigurer
postProcessBeanFactory(ConfigurableListableBeanFactory) - Method in interface org.springframework.beans.factory.config.BeanFactoryPostProcessor
Modify the application context's internal bean factory after its standard initialization.
postProcessBeanFactory(ConfigurableListableBeanFactory) - Method in class org.springframework.beans.factory.config.CustomEditorConfigurer
postProcessBeanFactory(ConfigurableListableBeanFactory) - Method in class org.springframework.beans.factory.config.CustomScopeConfigurer
postProcessBeanFactory(ConfigurableListableBeanFactory) - Method in class org.springframework.beans.factory.config.PropertyResourceConfigurer
postProcessBeanFactory(ConfigurableListableBeanFactory) - Method in class org.springframework.context.annotation.ConfigurationClassPostProcessor
Prepare the Configuration classes for servicing bean requests at runtime by replacing them with CGLIB-enhanced subclasses.
postProcessBeanFactory(ConfigurableListableBeanFactory) - Method in class org.springframework.context.support.AbstractApplicationContext
Modify the application context's internal bean factory after its standard initialization.
postProcessBeanFactory(ConfigurableListableBeanFactory) - Method in class org.springframework.context.weaving.AspectJWeavingEnabler
postProcessBeanFactory(ConfigurableListableBeanFactory) - Method in class org.springframework.jca.context.ResourceAdapterApplicationContext
postProcessBeanFactory(ConfigurableListableBeanFactory) - Method in class org.springframework.web.context.support.AbstractRefreshableWebApplicationContext
Register request/session scopes, a ServletContextAwareProcessor, etc.
postProcessBeanFactory(ConfigurableListableBeanFactory) - Method in class org.springframework.web.context.support.GenericWebApplicationContext
Register ServletContextAwareProcessor.
postProcessBeanFactory(ConfigurableListableBeanFactory) - Method in class org.springframework.web.context.support.StaticWebApplicationContext
Register request/session scopes, a ServletContextAwareProcessor, etc.
postProcessBeanFactory(ConfigurableListableBeanFactory) - Method in class org.springframework.web.portlet.context.AbstractRefreshablePortletApplicationContext
Register request/session scopes, a PortletContextAwareProcessor, etc.
postProcessBeanFactory(ConfigurableListableBeanFactory) - Method in class org.springframework.web.portlet.context.StaticPortletApplicationContext
Register request/session scopes, a PortletContextAwareProcessor, etc.
postProcessBeforeDestruction(Object, String) - Method in class org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor
postProcessBeforeDestruction(Object, String) - Method in interface org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor
Apply this BeanPostProcessor to the given bean instance before its destruction.
postProcessBeforeDestruction(Object, String) - Method in class org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
postProcessBeforeDestruction(Object, String) - Method in class org.springframework.web.portlet.handler.SimplePortletPostProcessor
postProcessBeforeDestruction(Object, String) - Method in class org.springframework.web.servlet.handler.SimpleServletPostProcessor
postProcessBeforeInitialization(Object, String) - Method in class org.springframework.aop.framework.adapter.AdvisorAdapterRegistrationManager
postProcessBeforeInitialization(Object, String) - Method in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
postProcessBeforeInitialization(Object, String) - Method in class org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor
postProcessBeforeInitialization(Object, String) - Method in interface org.springframework.beans.factory.config.BeanPostProcessor
Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).
postProcessBeforeInitialization(Object, String) - Method in class org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter
postProcessBeforeInitialization(Object, String) - Method in class org.springframework.context.weaving.LoadTimeWeaverAwareProcessor
postProcessBeforeInitialization(Object, String) - Method in class org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor
postProcessBeforeInitialization(Object, String) - Method in class org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
postProcessBeforeInitialization(Object, String) - Method in class org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcessor
postProcessBeforeInitialization(Object, String) - Method in class org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor
postProcessBeforeInitialization(Object, String) - Method in class org.springframework.validation.beanvalidation.BeanValidationPostProcessor
postProcessBeforeInitialization(Object, String) - Method in class org.springframework.web.context.support.ServletContextAwareProcessor
postProcessBeforeInitialization(Object, String) - Method in class org.springframework.web.portlet.context.PortletContextAwareProcessor
postProcessBeforeInitialization(Object, String) - Method in class org.springframework.web.portlet.handler.SimplePortletPostProcessor
postProcessBeforeInitialization(Object, String) - Method in class org.springframework.web.servlet.handler.SimpleServletPostProcessor
postProcessBeforeInstantiation(Class<?>, String) - Method in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
postProcessBeforeInstantiation(Class<?>, String) - Method in interface org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor
Apply this BeanPostProcessor before the target bean gets instantiated.
postProcessBeforeInstantiation(Class, String) - Method in class org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter
postProcessBeforeInstantiation(Class, String) - Method in class org.springframework.context.annotation.CommonAnnotationBeanPostProcessor
postProcessBeforeInstantiation(Class, String) - Method in class org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
postProcessBeforeInstantiation(Class, String) - Method in class org.springframework.scripting.support.ScriptFactoryPostProcessor
postProcessCommonsHttpMethod(HttpMethodBase) - Method in class org.springframework.http.client.CommonsClientHttpRequestFactory
Template method that allows for manipulating the HttpMethodBase before it is returned as part of a CommonsClientHttpRequest.
postProcessComponentDefinition(BeanComponentDefinition) - Method in class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
Hook method called after the primary parsing of a BeanComponentDefinition but before the BeanComponentDefinition has been registered with a BeanDefinitionRegistry.
postProcessConfiguration(Configuration) - Method in class org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean
Delegates to AnnotationSessionFactoryBean.postProcessAnnotationConfiguration(org.hibernate.cfg.AnnotationConfiguration).
postProcessConfiguration(Configuration) - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
To be implemented by subclasses that want to to perform custom post-processing of the Configuration object after this FactoryBean performed its default initialization.
postProcessConfiguration(Configuration) - Method in class org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
To be overridden by subclasses that want to to perform custom post-processing of the Configuration object after this factory performed its default initialization.
postProcessEntityManagerFactory(EntityManagerFactory) - Method in interface org.springframework.orm.jpa.JpaVendorAdapter
Optional callback for post-processing the native EntityManagerFactory before active use.
postProcessEntityManagerFactory(EntityManagerFactory, PersistenceUnitInfo) - Method in class org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean
Hook method allowing subclasses to customize the EntityManagerFactory after its creation via the PersistenceProvider.
postProcessEntityManagerFactory(EntityManagerFactory) - Method in class org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter
Post-process the EntityManagerFactory after it has been initialized.
postProcessHandlerMethodName(String) - Method in class org.springframework.web.servlet.mvc.multiaction.InternalPathMethodNameResolver
Build the full handler method name based on the given method name as indicated by the URL path.
postProcessJaxRpcCall(Call, MethodInvocation) - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Post-process the given JAX-RPC call.
postProcessJaxRpcService(Service) - Method in interface org.springframework.remoting.jaxrpc.JaxRpcServicePostProcessor
Deprecated. Post-process the given JAX-RPC Service.
postProcessJaxRpcService(Service) - Method in class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
Deprecated. Post-process the given JAX-RPC Service.
postProcessJobDetail(JobDetail) - Method in class org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean
Callback for post-processing the JobDetail to be exposed by this FactoryBean.
postProcessMappings(Configuration) - Method in class org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean
Reads metadata from annotated classes and packages into the AnnotationConfiguration instance.
postProcessMappings(Configuration) - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
To be implemented by subclasses that want to to register further mappings on the Configuration object after this FactoryBean registered its specified mappings.
postProcessMergedBeanDefinition(RootBeanDefinition, Class, String) - Method in class org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor
postProcessMergedBeanDefinition(RootBeanDefinition, Class, String) - Method in class org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor
postProcessMergedBeanDefinition(RootBeanDefinition, Class, String) - Method in class org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor
postProcessMergedBeanDefinition(RootBeanDefinition, Class, String) - Method in interface org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor
Post-process the given merged bean definition for the specified bean.
postProcessMergedBeanDefinition(RootBeanDefinition, Class, String) - Method in class org.springframework.context.annotation.CommonAnnotationBeanPostProcessor
postProcessMergedBeanDefinition(RootBeanDefinition, Class, String) - Method in class org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
postProcessMessage(Message) - Method in interface org.springframework.jms.core.MessagePostProcessor
Apply a MessagePostProcessor to the message.
postProcessMessageCode(String) - Method in class org.springframework.validation.DefaultMessageCodesResolver
Post-process the given message code, built by this resolver.
postProcessObjectFromFactoryBean(Object, String) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Applies the postProcessAfterInitialization callback of all registered BeanPostProcessors, giving them a chance to post-process the object obtained from FactoryBeans (for example, to auto-proxy them).
postProcessObjectFromFactoryBean(Object, String) - Method in class org.springframework.beans.factory.support.FactoryBeanRegistrySupport
Post-process the given object that has been obtained from the FactoryBean.
postProcessPage(ActionRequest, Object, Errors, int) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Post-process the given page after binding and validation, potentially updating its command object.
postProcessPage(HttpServletRequest, Object, Errors, int) - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Post-process the given page after binding and validation, potentially updating its command object.
postProcessPersistenceUnitInfo(MutablePersistenceUnitInfo) - Method in class org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager
Hook method allowing subclasses to customize each PersistenceUnitInfo.
postProcessPersistenceUnitInfo(MutablePersistenceUnitInfo) - Method in interface org.springframework.orm.jpa.persistenceunit.PersistenceUnitPostProcessor
Post-process the given PersistenceUnitInfo, for example registering further entity classes and jar files.
postProcessPortletApplicationContext(ConfigurableApplicationContext) - Method in class org.springframework.web.portlet.FrameworkPortlet
Post-process the given Portlet ApplicationContext before it is refreshed and activated as context for this portlet.
postProcessPortStub(Stub) - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Post-process the given JAX-RPC port stub.
postProcessProducer(MessageProducer, Message) - Method in class org.springframework.jms.listener.adapter.MessageListenerAdapter
Post-process the given message producer before using it to send the response.
postProcessPropertyValues(PropertyValues, PropertyDescriptor[], Object, String) - Method in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
postProcessPropertyValues(PropertyValues, PropertyDescriptor[], Object, String) - Method in class org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor
postProcessPropertyValues(PropertyValues, PropertyDescriptor[], Object, String) - Method in class org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor
postProcessPropertyValues(PropertyValues, PropertyDescriptor[], Object, String) - Method in interface org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor
Post-process the given property values before the factory applies them to the given bean.
postProcessPropertyValues(PropertyValues, PropertyDescriptor[], Object, String) - Method in class org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter
postProcessPropertyValues(PropertyValues, PropertyDescriptor[], Object, String) - Method in class org.springframework.context.annotation.CommonAnnotationBeanPostProcessor
postProcessPropertyValues(PropertyValues, PropertyDescriptor[], Object, String) - Method in class org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
postProcessReport(JasperPrint, Map<String, Object>) - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
Template method to be overridden for custom post-processing of the populated report.
postProcessResponse(Message, Message) - Method in class org.springframework.jms.listener.adapter.MessageListenerAdapter
Post-process the given response message before it will be sent.
postProcessResult(T, PersistenceManager, boolean) - Method in class org.springframework.orm.jdo.JdoTemplate
Post-process the given result object, which might be a Collection.
postProcessTargetObject(Object) - Method in class org.springframework.aop.target.LazyInitTargetSource
Subclasses may override this method to perform additional processing on the target object when it is first loaded.
postProcessTemplateLoaders(List<TemplateLoader>) - Method in class org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
To be overridden by subclasses that want to to register custom TemplateLoader instances after this factory created its default template loaders.
postProcessTemplateLoaders(List<TemplateLoader>) - Method in class org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer
This implementation registers an additional ClassTemplateLoader for the Spring-provided macros, added to the end of the list.
postProcessVelocityEngine(VelocityEngine) - Method in class org.springframework.ui.velocity.VelocityEngineFactory
To be implemented by subclasses that want to to perform custom post-processing of the VelocityEngine after this FactoryBean performed its default configuration (but before VelocityEngine.init).
postProcessVelocityEngine(VelocityEngine) - Method in class org.springframework.web.servlet.view.velocity.VelocityConfigurer
Provides a ClasspathResourceLoader in addition to any default or user-defined loader in order to load the spring Velocity macros from the class path.
postProcessViewName(String) - Method in class org.springframework.web.servlet.mvc.UrlFilenameViewController
Build the full view name based on the given view name as indicated by the URL path.
postProcessWebApplicationContext(ConfigurableWebApplicationContext) - Method in class org.springframework.web.servlet.FrameworkServlet
Post-process the given WebApplicationContext before it is refreshed and activated as context for this servlet.
postProcessXml(Element) - Method in class org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader
Allow the XML to be extensible by processing any custom element types last, after we finished processing the bean definitions.
predictBeanType(Class<?>, String) - Method in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
predictBeanType(Class<?>, String) - Method in class org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter
predictBeanType(Class<?>, String) - Method in interface org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor
Predict the type of the bean to be eventually returned from this processor's InstantiationAwareBeanPostProcessor.postProcessBeforeInstantiation(java.lang.Class, java.lang.String) callback.
predictBeanType(String, RootBeanDefinition, Class[]) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
predictBeanType(String, RootBeanDefinition, Class...) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Predict the eventual bean type (of the processed bean instance) for the specified bean.
predictBeanType(Class, String) - Method in class org.springframework.scripting.support.ScriptFactoryPostProcessor
PreferencesPlaceholderConfigurer - Class in org.springframework.beans.factory.config
Subclass of PropertyPlaceholderConfigurer that supports JDK 1.4's Preferences API (java.util.prefs).
PreferencesPlaceholderConfigurer() - Constructor for class org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer
prefersShortLivedTasks() - Method in class org.springframework.jca.work.WorkManagerTaskExecutor
This task executor prefers short-lived work units.
prefersShortLivedTasks() - Method in class org.springframework.scheduling.backportconcurrent.ConcurrentTaskExecutor
This task executor prefers short-lived work units.
prefersShortLivedTasks() - Method in class org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor
This task executor prefers short-lived work units.
prefersShortLivedTasks() - Method in class org.springframework.scheduling.commonj.WorkManagerTaskExecutor
This task executor prefers short-lived work units.
prefersShortLivedTasks() - Method in class org.springframework.scheduling.concurrent.ConcurrentTaskExecutor
This task executor prefers short-lived work units.
prefersShortLivedTasks() - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
This task executor prefers short-lived work units.
prefersShortLivedTasks() - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
prefersShortLivedTasks() - Method in class org.springframework.scheduling.quartz.SimpleThreadPoolTaskExecutor
This task executor prefers short-lived work units.
prefersShortLivedTasks() - Method in interface org.springframework.scheduling.SchedulingTaskExecutor
Does this TaskExecutor prefer short-lived tasks over long-lived tasks?
prefersShortLivedTasks() - Method in class org.springframework.scheduling.timer.TimerTaskExecutor
Deprecated. This task executor prefers short-lived work units.
PREFIX_COMMIT_RULE - Static variable in class org.springframework.transaction.interceptor.RuleBasedTransactionAttribute
Prefix for commit-on-exception rules in description strings
PREFIX_COMMONS_POOL - Static variable in class org.springframework.aop.framework.autoproxy.target.QuickTargetSourceCreator
PREFIX_ISOLATION - Static variable in class org.springframework.transaction.support.DefaultTransactionDefinition
Prefix for the isolation constants defined in TransactionDefinition
PREFIX_PROPAGATION - Static variable in class org.springframework.transaction.support.DefaultTransactionDefinition
Prefix for the propagation constants defined in TransactionDefinition
PREFIX_PROTOTYPE - Static variable in class org.springframework.aop.framework.autoproxy.target.QuickTargetSourceCreator
PREFIX_ROLLBACK_RULE - Static variable in class org.springframework.transaction.interceptor.RuleBasedTransactionAttribute
Prefix for rollback-on-exception rules in description strings
PREFIX_THREAD_LOCAL - Static variable in class org.springframework.aop.framework.autoproxy.target.QuickTargetSourceCreator
PREFIX_TIMEOUT - Static variable in class org.springframework.transaction.support.DefaultTransactionDefinition
Prefix for transaction timeout values in description strings
preHandle(WebRequest) - Method in class org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor
Open a new Hibernate Session according to the settings of this HibernateAccessor and bind it to the thread via the TransactionSynchronizationManager.
preHandle(WebRequest) - Method in class org.springframework.orm.jdo.support.OpenPersistenceManagerInViewInterceptor
preHandle(WebRequest) - Method in class org.springframework.orm.jpa.support.OpenEntityManagerInViewInterceptor
preHandle(WebRequest) - Method in class org.springframework.web.context.request.Log4jNestedDiagnosticContextInterceptor
Adds a message the Log4J NDC before the request is processed.
preHandle(WebRequest) - Method in interface org.springframework.web.context.request.WebRequestInterceptor
Intercept the execution of a request handler before its invocation.
preHandle(PortletRequest, PortletResponse, Object) - Method in class org.springframework.web.portlet.handler.HandlerInterceptorAdapter
Default callback that all "pre*" methods delegate to.
preHandle(PortletRequest, PortletResponse, Object) - Method in class org.springframework.web.portlet.handler.UserRoleAuthorizationInterceptor
preHandle(HttpServletRequest, HttpServletResponse, Object) - Method in class org.springframework.web.servlet.handler.ConversionServiceExposingInterceptor
preHandle(HttpServletRequest, HttpServletResponse, Object) - Method in class org.springframework.web.servlet.handler.HandlerInterceptorAdapter
This implementation always returns true.
preHandle(HttpServletRequest, HttpServletResponse, Object) - Method in class org.springframework.web.servlet.handler.UserRoleAuthorizationInterceptor
preHandle(HttpServletRequest, HttpServletResponse, Object) - Method in class org.springframework.web.servlet.handler.WebRequestHandlerInterceptorAdapter
preHandle(HttpServletRequest, HttpServletResponse, Object) - Method in interface org.springframework.web.servlet.HandlerInterceptor
Intercept the execution of a handler.
preHandle(HttpServletRequest, HttpServletResponse, Object) - Method in class org.springframework.web.servlet.i18n.LocaleChangeInterceptor
preHandle(HttpServletRequest, HttpServletResponse, Object) - Method in class org.springframework.web.servlet.mvc.WebContentInterceptor
preHandle(HttpServletRequest, HttpServletResponse, Object) - Method in class org.springframework.web.servlet.theme.ThemeChangeInterceptor
preHandleAction(ActionRequest, ActionResponse, Object) - Method in class org.springframework.web.portlet.handler.HandlerInterceptorAdapter
This implementation delegates to HandlerInterceptorAdapter.preHandle(javax.portlet.PortletRequest, javax.portlet.PortletResponse, java.lang.Object).
preHandleAction(ActionRequest, ActionResponse, Object) - Method in class org.springframework.web.portlet.handler.ParameterMappingInterceptor
If request is an ActionRequest, get handler mapping parameter and add it to the ActionResponse.
preHandleAction(ActionRequest, ActionResponse, Object) - Method in class org.springframework.web.portlet.handler.WebRequestHandlerInterceptorAdapter
preHandleAction(ActionRequest, ActionResponse, Object) - Method in interface org.springframework.web.portlet.HandlerInterceptor
Intercept the execution of a handler in the action phase.
preHandleEvent(EventRequest, EventResponse, Object) - Method in class org.springframework.web.portlet.handler.HandlerInterceptorAdapter
This implementation delegates to HandlerInterceptorAdapter.preHandle(javax.portlet.PortletRequest, javax.portlet.PortletResponse, java.lang.Object).
preHandleEvent(EventRequest, EventResponse, Object) - Method in class org.springframework.web.portlet.handler.WebRequestHandlerInterceptorAdapter
preHandleEvent(EventRequest, EventResponse, Object) - Method in interface org.springframework.web.portlet.HandlerInterceptor
Intercept the execution of a handler in the action phase.
preHandleRender(RenderRequest, RenderResponse, Object) - Method in class org.springframework.web.portlet.handler.HandlerInterceptorAdapter
This implementation delegates to HandlerInterceptorAdapter.preHandle(javax.portlet.PortletRequest, javax.portlet.PortletResponse, java.lang.Object).
preHandleRender(RenderRequest, RenderResponse, Object) - Method in class org.springframework.web.portlet.handler.WebRequestHandlerInterceptorAdapter
preHandleRender(RenderRequest, RenderResponse, Object) - Method in interface org.springframework.web.portlet.HandlerInterceptor
Intercept the execution of a handler in the render phase.
preHandleResource(ResourceRequest, ResourceResponse, Object) - Method in class org.springframework.web.portlet.handler.HandlerInterceptorAdapter
This implementation delegates to HandlerInterceptorAdapter.preHandle(javax.portlet.PortletRequest, javax.portlet.PortletResponse, java.lang.Object).
preHandleResource(ResourceRequest, ResourceResponse, Object) - Method in class org.springframework.web.portlet.handler.WebRequestHandlerInterceptorAdapter
preHandleResource(ResourceRequest, ResourceResponse, Object) - Method in interface org.springframework.web.portlet.HandlerInterceptor
Intercept the execution of a handler in the render phase.
preInstantiateSingletons() - Method in interface org.springframework.beans.factory.config.ConfigurableListableBeanFactory
Ensure that all non-lazy-init singletons are instantiated, also considering FactoryBeans.
preInstantiateSingletons() - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
premain(String, Instrumentation) - Static method in class org.springframework.instrument.InstrumentationSavingAgent
Save the Instrumentation interface exposed by the JVM.
prepare() - Method in class org.springframework.jmx.access.MBeanClientInterceptor
Ensures that an MBeanServerConnection is configured and attempts to detect a local connection if one is not supplied.
prepare() - Method in class org.springframework.jmx.access.NotificationListenerRegistrar
Registers the specified NotificationListener.
prepare(MimeMessage) - Method in interface org.springframework.mail.javamail.MimeMessagePreparator
Prepare the given new MimeMessage instance.
prepare() - Method in class org.springframework.remoting.caucho.BurlapClientInterceptor
Initialize the Burlap proxy for this interceptor.
prepare() - Method in class org.springframework.remoting.caucho.BurlapExporter
Initialize this service exporter.
prepare() - Method in class org.springframework.remoting.caucho.HessianClientInterceptor
Initialize the Hessian proxy for this interceptor.
prepare() - Method in class org.springframework.remoting.caucho.HessianExporter
Initialize this exporter.
prepare() - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Create and initialize the JAX-RPC service for the specified port.
prepare() - Method in class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
prepare() - Method in class org.springframework.remoting.rmi.JndiRmiClientInterceptor
Fetches the RMI stub on startup, if necessary.
prepare() - Method in class org.springframework.remoting.rmi.JndiRmiServiceExporter
Initialize this service exporter, binding the specified service to JNDI.
prepare() - Method in class org.springframework.remoting.rmi.RemoteInvocationSerializingExporter
Initialize this service exporter.
prepare() - Method in class org.springframework.remoting.rmi.RmiClientInterceptor
Fetches RMI stub on startup, if necessary.
prepare() - Method in class org.springframework.remoting.rmi.RmiServiceExporter
Initialize this service exporter, registering the service as RMI object.
prepare() - Method in class org.springframework.util.MethodInvoker
Prepare the specified method.
prepareApplicationContext(GenericApplicationContext) - Method in class org.springframework.test.AbstractSingleSpringContextTests
Deprecated. Prepare the GenericApplicationContext used by this test.
prepareBeanFactory(ConfigurableListableBeanFactory) - Method in class org.springframework.context.support.AbstractApplicationContext
Configure the factory's standard context characteristics, such as the context's ClassLoader and post-processors.
prepareBinder(PortletRequestDataBinder) - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Prepare the given binder, applying the specified MessageCodesResolver, BindingErrorProcessor and PropertyEditorRegistrars (if any).
prepareBinder(ServletRequestDataBinder) - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Prepare the given binder, applying the specified MessageCodesResolver, BindingErrorProcessor and PropertyEditorRegistrars (if any).
prepareConnection(HttpURLConnection, String) - Method in class org.springframework.http.client.SimpleClientHttpRequestFactory
Template method for preparing the given HttpURLConnection.
prepareConnection(Connection) - Method in class org.springframework.jca.cci.connection.SingleConnectionFactory
Prepare the given Connection before it is exposed.
prepareConnection(Connection) - Method in class org.springframework.jdbc.datasource.SingleConnectionDataSource
Prepare the given Connection before it is exposed.
prepareConnection(Connection) - Method in class org.springframework.jms.connection.SingleConnectionFactory
Prepare the given Connection before it is exposed.
prepareConnection(HttpURLConnection, int) - Method in class org.springframework.remoting.httpinvoker.SimpleHttpInvokerRequestExecutor
Prepare the given HTTP connection.
prepareConnectionForTransaction(Connection, TransactionDefinition) - Static method in class org.springframework.jdbc.datasource.DataSourceUtils
Prepare the given Connection with the given transaction semantics.
prepareContext(GenericApplicationContext) - Method in class org.springframework.test.context.support.AbstractGenericContextLoader
Prepare the GenericApplicationContext created by this ContextLoader.
prepareCriteria(Criteria) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
Prepare the given Criteria object, applying cache settings and/or a transaction timeout.
PreparedStatementCallback<T> - Interface in org.springframework.jdbc.core
Generic callback interface for code that operates on a PreparedStatement.
PreparedStatementCreator - Interface in org.springframework.jdbc.core
One of the two central callback interfaces used by the JdbcTemplate class.
PreparedStatementCreatorFactory - Class in org.springframework.jdbc.core
Helper class that efficiently creates multiple PreparedStatementCreator objects with different parameters based on a SQL statement and a single set of parameter declarations.
PreparedStatementCreatorFactory(String) - Constructor for class org.springframework.jdbc.core.PreparedStatementCreatorFactory
Create a new factory.
PreparedStatementCreatorFactory(String, int[]) - Constructor for class org.springframework.jdbc.core.PreparedStatementCreatorFactory
Create a new factory with the given SQL and JDBC types.
PreparedStatementCreatorFactory(String, List<SqlParameter>) - Constructor for class org.springframework.jdbc.core.PreparedStatementCreatorFactory
Create a new factory with the given SQL and parameters.
PreparedStatementSetter - Interface in org.springframework.jdbc.core
General callback interface used by the JdbcTemplate class.
prepareFileUpload(String) - Method in class org.springframework.web.multipart.commons.CommonsFileUploadSupport
Determine an appropriate FileUpload instance for the given encoding.
prepareForCommit(DefaultTransactionStatus) - Method in class org.springframework.orm.hibernate3.HibernateTransactionManager
prepareForCommit(DefaultTransactionStatus) - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Make preparations for commit, to be performed before the beforeCommit synchronization callbacks occur.
prepareForRendering(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.InternalResourceView
Prepare for rendering, and determine the request dispatcher path to forward to (or to include).
prepareForRendering(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.tiles.TilesView
Deprecated. Prepare for rendering the Tiles definition: Execute the associated component controller if any, and determine the request dispatcher path.
prepareJaxRpcCall(Call) - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Prepare the given JAX-RPC call, applying properties to it.
prepareLob(Connection, Class) - Method in class org.springframework.jdbc.support.lob.OracleLobHandler.OracleLobCreator
Create and open an oracle.sql.BLOB/CLOB instance via reflection.
prepareMethodOverride(MethodOverride) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Validate and prepare the given method override.
prepareMethodOverrides() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Validate and prepare the method overrides defined for this bean.
preparePersistenceUnitInfos() - Method in class org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager
Prepare the PersistenceUnitInfos according to the configuration of this manager: scanning for persistence.xml files, parsing all matching files, configurating and post-processing them.
preparePortStub(Stub) - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Prepare the given JAX-RPC port stub, applying properties to it.
preparePortStub(Object) - Method in class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
Prepare the given JAX-WS port stub, applying properties to it.
prepareQuery(Query) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
Prepare the given Query object, applying cache settings and/or a transaction timeout.
prepareQuery(Query) - Method in class org.springframework.orm.jdo.JdoTemplate
Prepare the given JDO query object.
prepareQuery(Query) - Method in class org.springframework.orm.jpa.JpaTemplate
Prepare the given JPA query object.
prepareRefresh() - Method in class org.springframework.context.support.AbstractApplicationContext
Prepare this context for refreshing, setting its startup date and active flag.
prepareResponse(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.AbstractView
Prepare the given response for rendering.
prepareResponse(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.json.MappingJacksonJsonView
prepareScriptBeans(BeanDefinition, String, String) - Method in class org.springframework.scripting.support.ScriptFactoryPostProcessor
Prepare the script beans in the internal BeanFactory that this post-processor uses.
prepareSharedConnection(Connection) - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Prepare the given Connection, which is about to be registered as shared Connection for this container.
prepareSharedConnection(Connection) - Method in class org.springframework.jms.listener.SimpleMessageListenerContainer
Registers this listener container as JMS ExceptionListener on the shared connection.
prepareSynchronization(DefaultTransactionStatus, TransactionDefinition) - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Initialize transaction synchronization as appropriate.
prepareTestInstance() - Method in class org.springframework.test.AbstractDependencyInjectionSpringContextTests
Deprecated. Prepare this test instance, injecting dependencies into its protected fields and its bean properties.
prepareTestInstance() - Method in class org.springframework.test.AbstractSingleSpringContextTests
Deprecated. Prepare this test instance, for example populating its fields.
prepareTestInstance(TestContext) - Method in class org.springframework.test.context.support.AbstractTestExecutionListener
The default implementation is empty.
prepareTestInstance(TestContext) - Method in class org.springframework.test.context.support.DependencyInjectionTestExecutionListener
Performs dependency injection on the test instance of the supplied test context by autowiring and initializing the test instance via its own application context (without checking dependencies).
prepareTestInstance(Object) - Method in class org.springframework.test.context.TestContextManager
Hook for preparing a test instance prior to execution of any individual test methods, for example for injecting dependencies, etc.
prepareTestInstance(TestContext) - Method in interface org.springframework.test.context.TestExecutionListener
Prepares the test instance of the supplied test context, for example by injecting dependencies.
prepareTransaction(EntityManager, boolean, String) - Method in class org.springframework.orm.jpa.DefaultJpaDialect
prepareTransaction(EntityManager, boolean, String) - Method in interface org.springframework.orm.jpa.JpaDialect
Prepare a JPA transaction, applying the specified semantics.
prepareTransaction(EntityManager, boolean, String) - Method in class org.springframework.orm.jpa.vendor.HibernateJpaDialect
prepareTransactionInfo(PlatformTransactionManager, TransactionAttribute, String, TransactionStatus) - Method in class org.springframework.transaction.interceptor.TransactionAspectSupport
Prepare a TransactionInfo for the given attribute and status object.
prepareTransactionStatus(TransactionDefinition, Object, boolean, boolean, boolean, Object) - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Create a new TransactionStatus for the given arguments, also initializing transaction synchronization as appropriate.
prepareWriter(Map<String, Object>, PdfWriter, HttpServletRequest) - Method in class org.springframework.web.servlet.view.document.AbstractPdfView
Prepare the given PdfWriter.
preProcessXml(Element) - Method in class org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader
Allow the XML to be extensible by processing any custom element types first, before we start to process the bean definitions.
PRESERVE_TARGET_CLASS_ATTRIBUTE - Static variable in class org.springframework.aop.framework.autoproxy.AutoProxyUtils
Bean definition attribute that may indicate whether a given bean is supposed to be proxied with its target class (in case of it getting proxied in the first place).
prettyPrint() - Method in class org.springframework.util.StopWatch
Return a string with a table describing all tasks performed.
preventCaching(MimeResponse) - Method in class org.springframework.web.portlet.handler.PortletContentGenerator
Prevent the render response from being cached.
preventCaching(HttpServletResponse) - Method in class org.springframework.web.servlet.support.WebContentGenerator
Prevent the response from being cached.
preventTransaction() - Method in class org.springframework.test.AbstractTransactionalSpringContextTests
Deprecated. Call this method in an overridden ConditionalTestCase.runBare() method to prevent transactional execution.
previous() - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
previous() - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Moves the cursor to the previous row.
previousPage() - Method in class org.springframework.beans.support.PagedListHolder
Switch to previous page.
Primary - Annotation Type in org.springframework.context.annotation
Indicates that a bean should be given preference when multiple candidates are qualified to autowire a single-valued dependency.
PRIMARY_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
print(Date, Locale) - Method in class org.springframework.format.datetime.DateFormatter
print(Long, Locale) - Method in class org.springframework.format.datetime.joda.MillisecondInstantPrinter
print(ReadableInstant, Locale) - Method in class org.springframework.format.datetime.joda.ReadableInstantPrinter
print(ReadablePartial, Locale) - Method in class org.springframework.format.datetime.joda.ReadablePartialPrinter
print(Number, Locale) - Method in class org.springframework.format.number.AbstractNumberFormatter
print(T, Locale) - Method in interface org.springframework.format.Printer
Print the object of type T for display.
print(boolean) - Method in class org.springframework.mock.web.MockBodyContent
print(char) - Method in class org.springframework.mock.web.MockBodyContent
print(char[]) - Method in class org.springframework.mock.web.MockBodyContent
print(double) - Method in class org.springframework.mock.web.MockBodyContent
print(float) - Method in class org.springframework.mock.web.MockBodyContent
print(int) - Method in class org.springframework.mock.web.MockBodyContent
print(long) - Method in class org.springframework.mock.web.MockBodyContent
print(Object) - Method in class org.springframework.mock.web.MockBodyContent
print(String) - Method in class org.springframework.mock.web.MockBodyContent
print(boolean) - Method in class org.springframework.mock.web.MockJspWriter
print(char) - Method in class org.springframework.mock.web.MockJspWriter
print(char[]) - Method in class org.springframework.mock.web.MockJspWriter
print(double) - Method in class org.springframework.mock.web.MockJspWriter
print(float) - Method in class org.springframework.mock.web.MockJspWriter
print(int) - Method in class org.springframework.mock.web.MockJspWriter
print(long) - Method in class org.springframework.mock.web.MockJspWriter
print(Object) - Method in class org.springframework.mock.web.MockJspWriter
print(String) - Method in class org.springframework.mock.web.MockJspWriter
Printer<T> - Interface in org.springframework.format
Prints objects of type T for display.
println() - Method in class org.springframework.mock.web.MockBodyContent
println(boolean) - Method in class org.springframework.mock.web.MockBodyContent
println(char) - Method in class org.springframework.mock.web.MockBodyContent
println(char[]) - Method in class org.springframework.mock.web.MockBodyContent
println(double) - Method in class org.springframework.mock.web.MockBodyContent
println(float) - Method in class org.springframework.mock.web.MockBodyContent
println(int) - Method in class org.springframework.mock.web.MockBodyContent
println(long) - Method in class org.springframework.mock.web.MockBodyContent
println(Object) - Method in class org.springframework.mock.web.MockBodyContent
println(String) - Method in class org.springframework.mock.web.MockBodyContent
println() - Method in class org.springframework.mock.web.MockJspWriter
println(boolean) - Method in class org.springframework.mock.web.MockJspWriter
println(char) - Method in class org.springframework.mock.web.MockJspWriter
println(char[]) - Method in class org.springframework.mock.web.MockJspWriter
println(double) - Method in class org.springframework.mock.web.MockJspWriter
println(float) - Method in class org.springframework.mock.web.MockJspWriter
println(int) - Method in class org.springframework.mock.web.MockJspWriter
println(long) - Method in class org.springframework.mock.web.MockJspWriter
println(Object) - Method in class org.springframework.mock.web.MockJspWriter
println(String) - Method in class org.springframework.mock.web.MockJspWriter
printStackTrace(PrintStream) - Method in exception org.springframework.beans.factory.BeanCreationException
printStackTrace(PrintWriter) - Method in exception org.springframework.beans.factory.BeanCreationException
printStackTrace(PrintStream) - Method in exception org.springframework.beans.PropertyBatchUpdateException
printStackTrace(PrintWriter) - Method in exception org.springframework.beans.PropertyBatchUpdateException
printStackTrace(PrintStream) - Method in exception org.springframework.mail.MailSendException
printStackTrace(PrintWriter) - Method in exception org.springframework.mail.MailSendException
PrioritizedParameterNameDiscoverer - Class in org.springframework.core
ParameterNameDiscoverer implementation that tries several ParameterNameDiscoverers in succession.
PrioritizedParameterNameDiscoverer() - Constructor for class org.springframework.core.PrioritizedParameterNameDiscoverer
PriorityOrdered - Interface in org.springframework.core
Extension of the Ordered interface, expressing a 'priority' ordering: Order values expressed by PriorityOrdered objects always apply before order values of 'plain' Ordered values.
Problem - Class in org.springframework.beans.factory.parsing
Represents a problem with a bean definition configuration.
Problem(String, Location) - Constructor for class org.springframework.beans.factory.parsing.Problem
Create a new instance of the Problem class.
Problem(String, Location, ParseState) - Constructor for class org.springframework.beans.factory.parsing.Problem
Create a new instance of the Problem class.
Problem(String, Location, ParseState, Throwable) - Constructor for class org.springframework.beans.factory.parsing.Problem
Create a new instance of the Problem class.
ProblemReporter - Interface in org.springframework.beans.factory.parsing
SPI interface allowing tools and other external processes to handle errors and warnings reported during bean definition parsing.
procedureNameToUse(String) - Method in interface org.springframework.jdbc.core.metadata.CallMetaDataProvider
Provide any modification of the procedure name passed in to match the meta data currently used.
procedureNameToUse(String) - Method in class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
proceed() - Method in class org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint
proceed(Object[]) - Method in class org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint
proceed() - Method in class org.springframework.aop.framework.ReflectiveMethodInvocation
process(ImageReadParam) - Method in class org.springframework.http.converter.BufferedImageHttpMessageConverter
Template method that allows for manipulating the ImageReadParam before it is used to read an image.
process(ImageWriteParam) - Method in class org.springframework.http.converter.BufferedImageHttpMessageConverter
Template method that allows for manipulating the ImageWriteParam before it is used to write an image.
processAction(ActionRequest, ActionResponse) - Method in class org.springframework.web.portlet.FrameworkPortlet
Delegate action requests to processRequest/doActionService.
processActionCreate(HttpServletRequest, HttpServletResponse, ActionMapping) - Method in class org.springframework.web.struts.AutowiringRequestProcessor
Deprecated. Extend the base class method to autowire each created Action instance.
processActionCreate(HttpServletRequest, HttpServletResponse, ActionMapping) - Method in class org.springframework.web.struts.AutowiringTilesRequestProcessor
Deprecated. Extend the base class method to autowire each created Action instance.
processActionCreate(HttpServletRequest, HttpServletResponse, ActionMapping) - Method in class org.springframework.web.struts.DelegatingRequestProcessor
Deprecated. Override the base class method to return the delegate action.
processActionCreate(HttpServletRequest, HttpServletResponse, ActionMapping) - Method in class org.springframework.web.struts.DelegatingTilesRequestProcessor
Deprecated. Override the base class method to return the delegate action.
processAliasRegistration(Element) - Method in class org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader
Process the given alias element, registering the alias with the registry.
processBeanDefinition(Element, BeanDefinitionParserDelegate) - Method in class org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader
Process the given bean element, parsing the bean definition and registering it with the registry.
processCancel(ActionRequest, ActionResponse, Object, BindException) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Template method for the action phase of the cancel action of this wizard.
processCancel(HttpServletRequest, HttpServletResponse, Object, BindException) - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Template method for processing the cancel action of this wizard.
processConfigBeanDefinitions(BeanDefinitionRegistry) - Method in class org.springframework.context.annotation.ConfigurationClassPostProcessor
Build and validate a configuration model based on the registry of Configuration classes.
processDeferredClose(SessionFactory) - Static method in class org.springframework.orm.hibernate3.SessionFactoryUtils
Process all Hibernate Sessions that have been registered for deferred close for the given SessionFactory.
processEvent(EventRequest, EventResponse) - Method in class org.springframework.web.portlet.FrameworkPortlet
processFinish(ActionRequest, ActionResponse, Object, BindException) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Template method for the action phase of the finish action of this wizard.
processFinish(HttpServletRequest, HttpServletResponse, Object, BindException) - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Template method for processing the final action of this wizard.
processFormSubmission(ActionRequest, ActionResponse, Object, BindException) - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Process action phase of form submission request.
processFormSubmission(ActionRequest, ActionResponse, Object, BindException) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Apply wizard workflow: finish, cancel, page change.
processFormSubmission(ActionRequest, ActionResponse, Object, BindException) - Method in class org.springframework.web.portlet.mvc.SimpleFormController
Deprecated. This implementation does nothing in case of errors, and delegates to onSubmitAction's full version else.
processFormSubmission(HttpServletRequest, HttpServletResponse, Object, BindException) - Method in class org.springframework.web.servlet.mvc.AbstractFormController
Deprecated. Process form submission request.
processFormSubmission(HttpServletRequest, HttpServletResponse, Object, BindException) - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Apply wizard workflow: finish, cancel, page change.
processFormSubmission(HttpServletRequest, HttpServletResponse, Object, BindException) - Method in class org.springframework.web.servlet.mvc.CancellableFormController
Deprecated. This implementation first checks to see if the incoming is a cancel request, through a call to CancellableFormController.isCancelRequest(javax.servlet.http.HttpServletRequest).
processFormSubmission(HttpServletRequest, HttpServletResponse, Object, BindException) - Method in class org.springframework.web.servlet.mvc.SimpleFormController
Deprecated. This implementation calls SimpleFormController.showForm(HttpServletRequest, HttpServletResponse, BindException) in case of errors, and delegates to the full SimpleFormController.onSubmit(HttpServletRequest, HttpServletResponse, Object, BindException)'s variant else.
processHandlerException(RenderRequest, RenderResponse, Object, Exception) - Method in class org.springframework.web.portlet.DispatcherPortlet
Determine an error ModelAndView via the registered HandlerExceptionResolvers.
processHandlerException(ResourceRequest, ResourceResponse, Object, Exception) - Method in class org.springframework.web.portlet.DispatcherPortlet
Determine an error ModelAndView via the registered HandlerExceptionResolvers.
processHandlerException(HttpServletRequest, HttpServletResponse, Object, Exception) - Method in class org.springframework.web.servlet.DispatcherServlet
Determine an error ModelAndView via the registered HandlerExceptionResolvers.
processInjection(Object) - Method in class org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor
'Native' processing method for direct calls with an arbitrary target instance, resolving all of its fields and methods which are annotated with @Autowired.
processInjectionBasedOnCurrentContext(Object) - Static method in class org.springframework.web.context.support.SpringBeanAutowiringSupport
Process @Autowired injection for the given target object, based on the current web application context.
processInjectionBasedOnServletContext(Object, ServletContext) - Static method in class org.springframework.web.context.support.SpringBeanAutowiringSupport
Process @Autowired injection for the given target object, based on the current root web application context as stored in the ServletContext.
processKey(ConfigurableListableBeanFactory, String, String) - Method in class org.springframework.beans.factory.config.PropertyOverrideConfigurer
Process the given key as 'beanName.property' entry.
processLocations(Class<?>, String...) - Method in interface org.springframework.test.context.ContextLoader
Processes application context resource locations for a specified class.
processLocations(Class<?>, String...) - Method in class org.springframework.test.context.support.AbstractContextLoader
If the supplied locations are null or empty and AbstractContextLoader.isGenerateDefaultLocations() is true, default locations will be generated for the specified class and the configured resource suffix; otherwise, the supplied locations will be modified if necessary and returned.
processMessage(Message, Session) - Method in class org.springframework.jms.listener.SimpleMessageListenerContainer
Process a message received from the provider.
processMetaData(DataSource, List<String>, String[]) - Method in class org.springframework.jdbc.core.metadata.TableMetaDataContext
Process the current meta data with the provided configuration options
processMetaData(DatabaseMetaData) - Method in interface org.springframework.jdbc.support.DatabaseMetaDataCallback
Implementations must implement this method to process the meta data passed in.
processMissingFieldError(String, BindingResult) - Method in interface org.springframework.validation.BindingErrorProcessor
Apply the missing field error to the given BindException.
processMissingFieldError(String, BindingResult) - Method in class org.springframework.validation.DefaultBindingErrorProcessor
processParameters(List<SqlParameter>) - Method in class org.springframework.jdbc.core.metadata.CallMetaDataContext
Process the list of parameters provided and if procedure column metedata is used the parameters will be matched against the metadata information and any missing ones will be automatically included
processProperties(ConfigurableListableBeanFactory, Properties) - Method in class org.springframework.beans.factory.config.PropertyOverrideConfigurer
processProperties(ConfigurableListableBeanFactory, Properties) - Method in class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
processProperties(ConfigurableListableBeanFactory, Properties) - Method in class org.springframework.beans.factory.config.PropertyResourceConfigurer
Apply the given Properties to the given BeanFactory.
processPropertyAccessException(PropertyAccessException, BindingResult) - Method in interface org.springframework.validation.BindingErrorProcessor
Translate the given PropertyAccessException to an appropriate error registered on the given Errors instance.
processPropertyAccessException(PropertyAccessException, BindingResult) - Method in class org.springframework.validation.DefaultBindingErrorProcessor
processRequest(PortletRequest, PortletResponse) - Method in class org.springframework.web.portlet.FrameworkPortlet
Process this request, publishing an event regardless of the outcome.
processRequest(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.FrameworkServlet
Process this request, publishing an event regardless of the outcome.
processRequest(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.ViewRendererServlet
Process this request, handling exceptions.
processResourceAfterCommit(H) - Method in class org.springframework.transaction.support.ResourceHolderSynchronization
After-commit callback for the given resource holder.
processResultSet(ResultSet, ResultSetSupportingSqlParameter) - Method in class org.springframework.jdbc.core.JdbcTemplate
Process the given ResultSet from a stored procedure.
processRow(ResultSet) - Method in interface org.springframework.jdbc.core.RowCallbackHandler
Implementations must implement this method to process each row of data in the ResultSet.
processRow(ResultSet) - Method in class org.springframework.jdbc.core.RowCountCallbackHandler
Implementation of ResultSetCallbackHandler.
processRow(ResultSet, int) - Method in class org.springframework.jdbc.core.RowCountCallbackHandler
Subclasses may override this to perform custom extraction or processing.
processTemplate(Template, SimpleHash, HttpServletResponse) - Method in class org.springframework.web.servlet.view.freemarker.FreeMarkerView
Process the FreeMarker template to the servlet response.
processTemplateIntoString(Template, Object) - Static method in class org.springframework.ui.freemarker.FreeMarkerTemplateUtils
Process the specified FreeMarker template with the given model and write the result to the given Writer.
ProducerCallback<T> - Interface in org.springframework.jms.core
Callback for sending a message to a JMS destination.
profileValueSource - Variable in class org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests
Deprecated. ProfileValueSource available to subclasses but primarily intended for use in AbstractAnnotationAwareTransactionalTests.isDisabledInThisEnvironment(Method).
ProfileValueSource - Interface in org.springframework.test.annotation
Strategy interface for retrieving profile values for a given testing environment.
profileValueSource - Variable in class org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests
ProfileValueSource available to subclasses but primarily intended for internal use to provide support for @IfProfileValue.
ProfileValueSourceConfiguration - Annotation Type in org.springframework.test.annotation
ProfileValueSourceConfiguration is a class-level annotation which is used to specify what type of ProfileValueSource to use when retrieving profile values configured via the @IfProfileValue annotation.
ProfileValueUtils - Class in org.springframework.test.annotation
General utility methods for working with profile values.
ProfileValueUtils() - Constructor for class org.springframework.test.annotation.ProfileValueUtils
Projection - Class in org.springframework.expression.spel.ast
Represents projection, where a given operation is performed on all elements in some input sequence, returning a new sequence of the same size.
Projection(boolean, int, SpelNodeImpl) - Constructor for class org.springframework.expression.spel.ast.Projection
PROP_ELEMENT - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
PROP_THREAD_COUNT - Static variable in class org.springframework.scheduling.quartz.SchedulerFactoryBean
Propagation - Enum in org.springframework.transaction.annotation
Enumeration that represents transaction propagation behaviors for use with the Transactional annotation, corresponding to the TransactionDefinition interface.
PROPAGATION_MANDATORY - Static variable in interface org.springframework.transaction.TransactionDefinition
Support a current transaction; throw an exception if no current transaction exists.
PROPAGATION_NESTED - Static variable in interface org.springframework.transaction.TransactionDefinition
Execute within a nested transaction if a current transaction exists, behave like TransactionDefinition.PROPAGATION_REQUIRED else.
PROPAGATION_NEVER - Static variable in interface org.springframework.transaction.TransactionDefinition
Do not support a current transaction; throw an exception if a current transaction exists.
PROPAGATION_NOT_SUPPORTED - Static variable in interface org.springframework.transaction.TransactionDefinition
Do not support a current transaction; rather always execute non-transactionally.
PROPAGATION_REQUIRED - Static variable in interface org.springframework.transaction.TransactionDefinition
Support a current transaction; create a new one if none exists.
PROPAGATION_REQUIRES_NEW - Static variable in interface org.springframework.transaction.TransactionDefinition
Create a new transaction, suspending the current transaction if one exists.
PROPAGATION_SUPPORTS - Static variable in interface org.springframework.transaction.TransactionDefinition
Support a current transaction; execute non-transactionally if none exists.
PropertiesBeanDefinitionReader - Class in org.springframework.beans.factory.support
Bean definition reader for a simple properties format.
PropertiesBeanDefinitionReader(BeanDefinitionRegistry) - Constructor for class org.springframework.beans.factory.support.PropertiesBeanDefinitionReader
Create new PropertiesBeanDefinitionReader for the given bean factory.
PropertiesEditor - Class in org.springframework.beans.propertyeditors
Custom PropertyEditor for Properties objects.
PropertiesEditor() - Constructor for class org.springframework.beans.propertyeditors.PropertiesEditor
PropertiesFactoryBean - Class in org.springframework.beans.factory.config
Allows for making a properties file from a classpath location available as Properties instance in a bean factory.
PropertiesFactoryBean() - Constructor for class org.springframework.beans.factory.config.PropertiesFactoryBean
PropertiesLoaderSupport - Class in org.springframework.core.io.support
Base class for JavaBean-style components that need to load properties from one or more resources.
PropertiesLoaderSupport() - Constructor for class org.springframework.core.io.support.PropertiesLoaderSupport
PropertiesLoaderUtils - Class in org.springframework.core.io.support
Convenient utility methods for loading of java.util.Properties, performing standard handling of input streams.
PropertiesLoaderUtils() - Constructor for class org.springframework.core.io.support.PropertiesLoaderUtils
PropertiesMethodNameResolver - Class in org.springframework.web.servlet.mvc.multiaction
The most flexible out-of-the-box implementation of the MethodNameResolver interface.
PropertiesMethodNameResolver() - Constructor for class org.springframework.web.servlet.mvc.multiaction.PropertiesMethodNameResolver
PropertiesPersister - Interface in org.springframework.util
Strategy interface for persisting java.util.Properties, allowing for pluggable parsing strategies.
PROPERTY_ELEMENT - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
PROPERTY_KEY_PREFIX - Static variable in interface org.springframework.beans.PropertyAccessor
Marker that indicates the start of a property key for an indexed or mapped property like "person.addresses[0]".
PROPERTY_KEY_PREFIX_CHAR - Static variable in interface org.springframework.beans.PropertyAccessor
PROPERTY_KEY_SUFFIX - Static variable in interface org.springframework.beans.PropertyAccessor
Marker that indicates the end of a property key for an indexed or mapped property like "person.addresses[0]".
PROPERTY_KEY_SUFFIX_CHAR - Static variable in interface org.springframework.beans.PropertyAccessor
PropertyAccessException - Exception in org.springframework.beans
Superclass for exceptions related to a property access, such as type mismatch or invocation target exception.
PropertyAccessException(PropertyChangeEvent, String, Throwable) - Constructor for exception org.springframework.beans.PropertyAccessException
Create a new PropertyAccessException.
PropertyAccessException(String, Throwable) - Constructor for exception org.springframework.beans.PropertyAccessException
Create a new PropertyAccessException without PropertyChangeEvent.
PropertyAccessor - Interface in org.springframework.beans
Common interface for classes that can access named properties (such as bean properties of an object or fields in an object) Serves as base interface for BeanWrapper.
PropertyAccessor - Interface in org.springframework.expression
A property accessor is able to read (and possibly write) to object properties.
PropertyAccessorFactory - Class in org.springframework.beans
Simple factory facade for obtaining PropertyAccessor instances, in particular for BeanWrapper instances.
PropertyAccessorFactory() - Constructor for class org.springframework.beans.PropertyAccessorFactory
PropertyAccessorUtils - Class in org.springframework.beans
Utility methods for classes that perform bean property access according to the PropertyAccessor interface.
PropertyAccessorUtils() - Constructor for class org.springframework.beans.PropertyAccessorUtils
PropertyBatchUpdateException - Exception in org.springframework.beans
Combined exception, composed of individual PropertyAccessException instances.
PropertyBatchUpdateException(PropertyAccessException[]) - Constructor for exception org.springframework.beans.PropertyBatchUpdateException
Create a new PropertyBatchUpdateException.
PropertyComparator - Class in org.springframework.beans.support
PropertyComparator performs a comparison of two beans, evaluating the specified bean property via a BeanWrapper.
PropertyComparator(SortDefinition) - Constructor for class org.springframework.beans.support.PropertyComparator
Create a new PropertyComparator for the given SortDefinition.
PropertyComparator(String, boolean, boolean) - Constructor for class org.springframework.beans.support.PropertyComparator
Create a PropertyComparator for the given settings.
PropertyEditorRegistrar - Interface in org.springframework.beans
Interface for strategies that register custom property editors with a property editor registry.
PropertyEditorRegistry - Interface in org.springframework.beans
Encapsulates methods for registering JavaBeans PropertyEditors.
PropertyEditorRegistrySupport - Class in org.springframework.beans
Base implementation of the PropertyEditorRegistry interface.
PropertyEditorRegistrySupport() - Constructor for class org.springframework.beans.PropertyEditorRegistrySupport
PropertyEntry - Class in org.springframework.beans.factory.parsing
ParseState entry representing a JavaBean property.
PropertyEntry(String) - Constructor for class org.springframework.beans.factory.parsing.PropertyEntry
Creates a new instance of the PropertyEntry class.
PropertyOrFieldReference - Class in org.springframework.expression.spel.ast
Represents a simple property or field reference.
PropertyOrFieldReference(boolean, String, int) - Constructor for class org.springframework.expression.spel.ast.PropertyOrFieldReference
PropertyOverrideConfigurer - Class in org.springframework.beans.factory.config
Property resource configurer that overrides bean property values in an application context definition.
PropertyOverrideConfigurer() - Constructor for class org.springframework.beans.factory.config.PropertyOverrideConfigurer
PropertyPathFactoryBean - Class in org.springframework.beans.factory.config
FactoryBean that evaluates a property path on a given target object.
PropertyPathFactoryBean() - Constructor for class org.springframework.beans.factory.config.PropertyPathFactoryBean
PropertyPlaceholderConfigurer - Class in org.springframework.beans.factory.config
A property resource configurer that resolves placeholders in bean property values of context definitions.
PropertyPlaceholderConfigurer() - Constructor for class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
PropertyPlaceholderHelper - Class in org.springframework.util
Utility class for working with Strings that have placeholder values in them.
PropertyPlaceholderHelper(String, String) - Constructor for class org.springframework.util.PropertyPlaceholderHelper
Creates a new PropertyPlaceholderHelper that uses the supplied prefix and suffix.
PropertyPlaceholderHelper(String, String, String, boolean) - Constructor for class org.springframework.util.PropertyPlaceholderHelper
Creates a new PropertyPlaceholderHelper that uses the supplied prefix and suffix.
PropertyPlaceholderHelper.PlaceholderResolver - Interface in org.springframework.util
Strategy interface used to resolve replacement values for placeholders contained in Strings.
PropertyResourceConfigurer - Class in org.springframework.beans.factory.config
Allows for configuration of individual bean property values from a property resource, i.e.
PropertyResourceConfigurer() - Constructor for class org.springframework.beans.factory.config.PropertyResourceConfigurer
propertyToConstantNamePrefix(String) - Method in class org.springframework.core.Constants
Convert the given bean property name to a constant name prefix.
PropertyTypeDescriptor - Class in org.springframework.core.convert.support
TypeDescriptor extension that exposes additional annotations as conversion metadata: namely, annotations on other accessor methods (getter/setter) and on the underlying field, if found.
PropertyTypeDescriptor(PropertyDescriptor, MethodParameter) - Constructor for class org.springframework.core.convert.support.PropertyTypeDescriptor
Create a new BeanTypeDescriptor for the given bean property.
PropertyTypeDescriptor(PropertyDescriptor, MethodParameter, Class<?>) - Constructor for class org.springframework.core.convert.support.PropertyTypeDescriptor
Create a new BeanTypeDescriptor for the given bean property.
PropertyValue - Class in org.springframework.beans
Object to hold information and value for an individual bean property.
PropertyValue(String, Object) - Constructor for class org.springframework.beans.PropertyValue
Create a new PropertyValue instance.
PropertyValue(PropertyValue) - Constructor for class org.springframework.beans.PropertyValue
Copy constructor.
PropertyValue(PropertyValue, Object) - Constructor for class org.springframework.beans.PropertyValue
Constructor that exposes a new value for an original value holder.
PropertyValues - Interface in org.springframework.beans
Holder containing one or more PropertyValue objects, typically comprising one update for a specific target bean.
PropertyValuesEditor - Class in org.springframework.beans
Editor for a PropertyValues object.
PropertyValuesEditor() - Constructor for class org.springframework.beans.PropertyValuesEditor
PROPS_ELEMENT - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
PrototypeAspectInstanceFactory - Class in org.springframework.aop.aspectj.annotation
AspectInstanceFactory backed by a BeanFactory-provided prototype, enforcing prototype semantics.
PrototypeAspectInstanceFactory(BeanFactory, String) - Constructor for class org.springframework.aop.aspectj.annotation.PrototypeAspectInstanceFactory
Create a PrototypeAspectInstanceFactory.
PrototypeTargetSource - Class in org.springframework.aop.target
TargetSource that creates a new instance of the target bean for each request, destroying each instance on release (after each request).
PrototypeTargetSource() - Constructor for class org.springframework.aop.target.PrototypeTargetSource
ProviderCreatingFactoryBean - Class in org.springframework.beans.factory.config
A FactoryBean implementation that returns a value which is a JSR-330 Provider that in turn returns a bean sourced from a BeanFactory.
ProviderCreatingFactoryBean() - Constructor for class org.springframework.beans.factory.config.ProviderCreatingFactoryBean
provideXml(OutputStream) - Method in interface org.springframework.jdbc.support.xml.XmlBinaryStreamProvider
Implementations must implement this method to provide the XML content for the OutputStream.
provideXml(Writer) - Method in interface org.springframework.jdbc.support.xml.XmlCharacterStreamProvider
Implementations must implement this method to provide the XML content for the Writer.
provideXml(Result) - Method in interface org.springframework.jdbc.support.xml.XmlResultProvider
Implementations must implement this method to provide the XML content for the Result.
proxiedUserInterfaces(Object) - Static method in class org.springframework.aop.framework.AopProxyUtils
Extract the user-specified interfaces that the given proxy implements, i.e.
proxy - Variable in class org.springframework.aop.framework.ReflectiveMethodInvocation
PROXY_TARGET_CLASS_ATTRIBUTE - Static variable in class org.springframework.aop.config.AopNamespaceUtils
The proxy-target-class attribute as found on AOP-related XML tags.
PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS - Static variable in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
Convenience constant for subclasses: Return value for "proxy without additional interceptors, just the common ones".
ProxyConfig - Class in org.springframework.aop.framework
Convenience superclass for configuration used in creating proxies, to ensure that all proxy creators have consistent properties.
ProxyConfig() - Constructor for class org.springframework.aop.framework.ProxyConfig
ProxyCreationContext - Class in org.springframework.aop.framework.autoproxy
Holder for the current proxy creation context, as exposed by auto-proxy creators such as AbstractAdvisorAutoProxyCreator.
ProxyCreationContext() - Constructor for class org.springframework.aop.framework.autoproxy.ProxyCreationContext
ProxyCreatorSupport - Class in org.springframework.aop.framework
Base class for proxy factories.
ProxyCreatorSupport() - Constructor for class org.springframework.aop.framework.ProxyCreatorSupport
Create a new ProxyCreatorSupport instance.
ProxyCreatorSupport(AopProxyFactory) - Constructor for class org.springframework.aop.framework.ProxyCreatorSupport
Create a new ProxyCreatorSupport instance.
ProxyFactory - Class in org.springframework.aop.framework
Factory for AOP proxies for programmatic use, rather than via a bean factory.
ProxyFactory() - Constructor for class org.springframework.aop.framework.ProxyFactory
Create a new ProxyFactory.
ProxyFactory(Object) - Constructor for class org.springframework.aop.framework.ProxyFactory
Create a new ProxyFactory.
ProxyFactory(Class[]) - Constructor for class org.springframework.aop.framework.ProxyFactory
Create a new ProxyFactory.
ProxyFactory(Class, Interceptor) - Constructor for class org.springframework.aop.framework.ProxyFactory
Create a new ProxyFactory for the given interface and interceptor.
ProxyFactory(Class, TargetSource) - Constructor for class org.springframework.aop.framework.ProxyFactory
Create a ProxyFactory for the specified TargetSource, making the proxy implement the specified interface.
ProxyFactoryBean - Class in org.springframework.aop.framework
FactoryBean implementation that builds an AOP proxy based on beans in Spring BeanFactory.
ProxyFactoryBean() - Constructor for class org.springframework.aop.framework.ProxyFactoryBean
ProxyMethodInvocation - Interface in org.springframework.aop
Extension of the AOP Alliance MethodInvocation interface, allowing access to the proxy that the method invocation was made through.
publishedInterfaces - Variable in class org.springframework.aop.support.IntroductionInfoSupport
publishEndpoint(Endpoint, WebService) - Method in class org.springframework.remoting.jaxws.AbstractJaxWsServiceExporter
Actually publish the given endpoint.
publishEndpoint(Endpoint, WebServiceProvider) - Method in class org.springframework.remoting.jaxws.AbstractJaxWsServiceExporter
Actually publish the given provider endpoint.
publishEndpoint(Endpoint, WebService) - Method in class org.springframework.remoting.jaxws.SimpleHttpServerJaxWsServiceExporter
publishEndpoint(Endpoint, WebServiceProvider) - Method in class org.springframework.remoting.jaxws.SimpleHttpServerJaxWsServiceExporter
publishEndpoint(Endpoint, WebService) - Method in class org.springframework.remoting.jaxws.SimpleJaxWsServiceExporter
publishEndpoint(Endpoint, WebServiceProvider) - Method in class org.springframework.remoting.jaxws.SimpleJaxWsServiceExporter
publishEndpoints() - Method in class org.springframework.remoting.jaxws.AbstractJaxWsServiceExporter
Publish all WebService annotated beans in the containing BeanFactory.
publishEvent(ApplicationEvent) - Method in interface org.springframework.context.ApplicationEventPublisher
Notify all listeners registered with this application of an application event.
publishEvent(ApplicationEvent) - Method in class org.springframework.context.support.AbstractApplicationContext
Publish the given event to all listeners.
push(ParseState.Entry) - Method in class org.springframework.beans.factory.parsing.ParseState
Add a new ParseState.Entry to the Stack.
pushActiveContextObject(TypedValue) - Method in class org.springframework.expression.spel.ExpressionState
pushContainingComponent(CompositeComponentDefinition) - Method in class org.springframework.beans.factory.xml.ParserContext
pushNestedPath(String) - Method in class org.springframework.validation.AbstractErrors
pushNestedPath(String) - Method in exception org.springframework.validation.BindException
pushNestedPath(String) - Method in interface org.springframework.validation.Errors
Push the given sub path onto the nested path stack.
pushNestedPath(String) - Method in class org.springframework.web.bind.EscapedErrors
put(String, List<String>) - Method in class org.springframework.http.HttpHeaders
put(K, V) - Method in class org.springframework.util.CachingMapDecorator
Put an object into the cache, possibly wrapping it with a weak reference.
put(String, V) - Method in class org.springframework.util.LinkedCaseInsensitiveMap
put(K, List<V>) - Method in class org.springframework.util.LinkedMultiValueMap
put(String, Object) - Method in class org.springframework.validation.support.BindingAwareModelMap
put(String, Object, Object...) - Method in interface org.springframework.web.client.RestOperations
Create or update a resource by PUTting the given object to the URI.
put(String, Object, Map<String, ?>) - Method in interface org.springframework.web.client.RestOperations
Creates a new resource by PUTting the given object to URI template.
put(URI, Object) - Method in interface org.springframework.web.client.RestOperations
Creates a new resource by PUTting the given object to URL.
put(String, Object, Object...) - Method in class org.springframework.web.client.RestTemplate
put(String, Object, Map<String, ?>) - Method in class org.springframework.web.client.RestTemplate
put(URI, Object) - Method in class org.springframework.web.client.RestTemplate
putAll(Map<? extends String, ? extends List<String>>) - Method in class org.springframework.http.HttpHeaders
putAll(Map<? extends K, ? extends V>) - Method in class org.springframework.util.CachingMapDecorator
putAll(Map<? extends K, ? extends List<V>>) - Method in class org.springframework.util.LinkedMultiValueMap
putAll(Map<? extends String, ?>) - Method in class org.springframework.validation.support.BindingAwareModelMap
putIfAbsent(Object, Object) - Method in interface org.springframework.core.ConcurrentMap
Deprecated.
putValue(String, Object) - Method in class org.springframework.mock.web.MockHttpSession
Overview Package Class Tree Deprecated Index Help
A B C D E F G H I J K L M N O P Q R S T U V W X


Q-Index

PREV LETTER NEXT LETTER FRAMES NO FRAMES
A B C D E F G H I J K L M N O P Q R S T U V W X

Q

QualifiedIdentifier - Class in org.springframework.expression.spel.ast
Represents a dot separated sequence of strings that indicate a package qualified type reference.
QualifiedIdentifier(int, SpelNodeImpl...) - Constructor for class org.springframework.expression.spel.ast.QualifiedIdentifier
Qualifier - Annotation Type in org.springframework.beans.factory.annotation
This annotation may be used on a field or parameter as a qualifier for candidate beans when autowiring.
QUALIFIER_ATTRIBUTE_ELEMENT - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
QUALIFIER_ELEMENT - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
QualifierAnnotationAutowireCandidateResolver - Class in org.springframework.beans.factory.annotation
AutowireCandidateResolver implementation that matches bean definition qualifiers against qualifier annotations on the field or parameter to be autowired.
QualifierAnnotationAutowireCandidateResolver() - Constructor for class org.springframework.beans.factory.annotation.QualifierAnnotationAutowireCandidateResolver
Create a new QualifierAnnotationAutowireCandidateResolver for Spring's standard Qualifier annotation.
QualifierAnnotationAutowireCandidateResolver(Class<? extends Annotation>) - Constructor for class org.springframework.beans.factory.annotation.QualifierAnnotationAutowireCandidateResolver
Create a new QualifierAnnotationAutowireCandidateResolver for the given qualifier annotation type.
QualifierAnnotationAutowireCandidateResolver(Set<Class<? extends Annotation>>) - Constructor for class org.springframework.beans.factory.annotation.QualifierAnnotationAutowireCandidateResolver
Create a new QualifierAnnotationAutowireCandidateResolver for the given qualifier annotation types.
QualifierEntry - Class in org.springframework.beans.factory.parsing
ParseState entry representing an autowire candidate qualifier.
QualifierEntry(String) - Constructor for class org.springframework.beans.factory.parsing.QualifierEntry
QuartzJobBean - Class in org.springframework.scheduling.quartz
Simple implementation of the Quartz Job interface, applying the passed-in JobDataMap and also the SchedulerContext as bean property values.
QuartzJobBean() - Constructor for class org.springframework.scheduling.quartz.QuartzJobBean
query(String, ResultSetExtractor<T>) - Method in interface org.springframework.jdbc.core.JdbcOperations
Execute a query given static SQL, reading the ResultSet with a ResultSetExtractor.
query(String, RowCallbackHandler) - Method in interface org.springframework.jdbc.core.JdbcOperations
Execute a query given static SQL, reading the ResultSet on a per-row basis with a RowCallbackHandler.
query(String, RowMapper<T>) - Method in interface org.springframework.jdbc.core.JdbcOperations
Execute a query given static SQL, mapping each row to a Java object via a RowMapper.
query(PreparedStatementCreator, ResultSetExtractor<T>) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query using a prepared statement, reading the ResultSet with a ResultSetExtractor.
query(String, PreparedStatementSetter, ResultSetExtractor<T>) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query using a prepared statement, reading the ResultSet with a ResultSetExtractor.
query(String, Object[], int[], ResultSetExtractor<T>) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.
query(String, Object[], ResultSetExtractor<T>) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.
query(String, ResultSetExtractor<T>, Object...) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.
query(PreparedStatementCreator, RowCallbackHandler) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query using a prepared statement, reading the ResultSet on a per-row basis with a RowCallbackHandler.
query(String, PreparedStatementSetter, RowCallbackHandler) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query given SQL to create a prepared statement from SQL and a PreparedStatementSetter implementation that knows how to bind values to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.
query(String, Object[], int[], RowCallbackHandler) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.
query(String, Object[], RowCallbackHandler) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.
query(String, RowCallbackHandler, Object...) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.
query(PreparedStatementCreator, RowMapper<T>) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query using a prepared statement, mapping each row to a Java object via a RowMapper.
query(String, PreparedStatementSetter, RowMapper<T>) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query given SQL to create a prepared statement from SQL and a PreparedStatementSetter implementation that knows how to bind values to the query, mapping each row to a Java object via a RowMapper.
query(String, Object[], int[], RowMapper<T>) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.
query(String, Object[], RowMapper<T>) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.
query(String, RowMapper<T>, Object...) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.
query(String, ResultSetExtractor<T>) - Method in class org.springframework.jdbc.core.JdbcTemplate
query(String, RowCallbackHandler) - Method in class org.springframework.jdbc.core.JdbcTemplate
query(String, RowMapper<T>) - Method in class org.springframework.jdbc.core.JdbcTemplate
query(PreparedStatementCreator, PreparedStatementSetter, ResultSetExtractor<T>) - Method in class org.springframework.jdbc.core.JdbcTemplate
Query using a prepared statement, allowing for a PreparedStatementCreator and a PreparedStatementSetter.
query(PreparedStatementCreator, ResultSetExtractor<T>) - Method in class org.springframework.jdbc.core.JdbcTemplate
query(String, PreparedStatementSetter, ResultSetExtractor<T>) - Method in class org.springframework.jdbc.core.JdbcTemplate
query(String, Object[], int[], ResultSetExtractor<T>) - Method in class org.springframework.jdbc.core.JdbcTemplate
query(String, Object[], ResultSetExtractor<T>) - Method in class org.springframework.jdbc.core.JdbcTemplate
query(String, ResultSetExtractor<T>, Object...) - Method in class org.springframework.jdbc.core.JdbcTemplate
query(PreparedStatementCreator, RowCallbackHandler) - Method in class org.springframework.jdbc.core.JdbcTemplate
query(String, PreparedStatementSetter, RowCallbackHandler) - Method in class org.springframework.jdbc.core.JdbcTemplate
query(String, Object[], int[], RowCallbackHandler) - Method in class org.springframework.jdbc.core.JdbcTemplate
query(String, Object[], RowCallbackHandler) - Method in class org.springframework.jdbc.core.JdbcTemplate
query(String, RowCallbackHandler, Object...) - Method in class org.springframework.jdbc.core.JdbcTemplate
query(PreparedStatementCreator, RowMapper<T>) - Method in class org.springframework.jdbc.core.JdbcTemplate
query(String, PreparedStatementSetter, RowMapper<T>) - Method in class org.springframework.jdbc.core.JdbcTemplate
query(String, Object[], int[], RowMapper<T>) - Method in class org.springframework.jdbc.core.JdbcTemplate
query(String, Object[], RowMapper<T>) - Method in class org.springframework.jdbc.core.JdbcTemplate
query(String, RowMapper<T>, Object...) - Method in class org.springframework.jdbc.core.JdbcTemplate
query(String, SqlParameterSource, ResultSetExtractor<T>) - Method in interface org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.
query(String, Map<String, ?>, ResultSetExtractor<T>) - Method in interface org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.
query(String, SqlParameterSource, RowCallbackHandler) - Method in interface org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.
query(String, Map<String, ?>, RowCallbackHandler) - Method in interface org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.
query(String, SqlParameterSource, RowMapper<T>) - Method in interface org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.
query(String, Map<String, ?>, RowMapper<T>) - Method in interface org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.
query(String, SqlParameterSource, ResultSetExtractor<T>) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
query(String, Map<String, ?>, ResultSetExtractor<T>) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
query(String, SqlParameterSource, RowCallbackHandler) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
query(String, Map<String, ?>, RowCallbackHandler) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
query(String, SqlParameterSource, RowMapper<T>) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
query(String, Map<String, ?>, RowMapper<T>) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
query(String, RowMapper<T>, Map<String, ?>) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Query for a List of Objects of type T using the supplied RowMapper to the query results to the object.
query(String, ParameterizedRowMapper<T>, Map<String, ?>) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Deprecated. as of Spring 3.0: Use the method using the newly genericized RowMapper interface instead since the RowMapper and ParameterizedRowMapper interfaces are equivalent now.
query(String, RowMapper<T>, SqlParameterSource) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Query for a List of Objects of type T using the supplied RowMapper to the query results to the object.
query(String, ParameterizedRowMapper<T>, SqlParameterSource) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Deprecated. as of Spring 3.0: Use the method using the newly genericized RowMapper interface instead since the RowMapper and ParameterizedRowMapper interfaces are equivalent now.
query(String, RowMapper<T>, Object...) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Query for a List of Objects of type T using the supplied RowMapper to the query results to the object.
query(String, ParameterizedRowMapper<T>, Object...) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Deprecated. as of Spring 3.0: Use the method using the newly genericized RowMapper interface instead since the RowMapper and ParameterizedRowMapper interfaces are equivalent now.
query(String, RowMapper<T>, Map<String, ?>) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
query(String, ParameterizedRowMapper<T>, Map<String, ?>) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
Deprecated.
query(String, RowMapper<T>, SqlParameterSource) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
query(String, ParameterizedRowMapper<T>, SqlParameterSource) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
Deprecated.
query(String, RowMapper<T>, Object...) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
query(String, ParameterizedRowMapper<T>, Object...) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
Deprecated.
queryForInt(String) - Method in interface org.springframework.jdbc.core.JdbcOperations
Execute a query that results in an int value, given static SQL.
queryForInt(String, Object[], int[]) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in an int value.
queryForInt(String, Object...) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in an int value.
queryForInt(String) - Method in class org.springframework.jdbc.core.JdbcTemplate
queryForInt(String, Object[], int[]) - Method in class org.springframework.jdbc.core.JdbcTemplate
queryForInt(String, Object...) - Method in class org.springframework.jdbc.core.JdbcTemplate
queryForInt(String, SqlParameterSource) - Method in interface org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in an int value.
queryForInt(String, Map<String, ?>) - Method in interface org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in an int value.
queryForInt(String, SqlParameterSource) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
queryForInt(String, Map<String, ?>) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
queryForInt(String, Map<String, ?>) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Query for an int passing in a SQL query using the named parameter support provided by the NamedParameterJdbcTemplate and a map containing the arguments.
queryForInt(String, SqlParameterSource) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Query for an int passing in a SQL query using the named parameter support provided by the NamedParameterJdbcTemplate and a SqlParameterSource containing the arguments.
queryForInt(String, Object...) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Query for an int passing in a SQL query using the standard '?' placeholders for parameters and a variable number of arguments.
queryForInt(String, Map<String, ?>) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
queryForInt(String, SqlParameterSource) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
queryForInt(String, Object...) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
queryForList(String, Class<T>) - Method in interface org.springframework.jdbc.core.JdbcOperations
Execute a query for a result list, given static SQL.
queryForList(String) - Method in interface org.springframework.jdbc.core.JdbcOperations
Execute a query for a result list, given static SQL.
queryForList(String, Object[], int[], Class<T>) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
queryForList(String, Object[], Class<T>) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
queryForList(String, Class<T>, Object...) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
queryForList(String, Object[], int[]) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
queryForList(String, Object...) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
queryForList(String, Class<T>) - Method in class org.springframework.jdbc.core.JdbcTemplate
queryForList(String) - Method in class org.springframework.jdbc.core.JdbcTemplate
queryForList(String, Object[], int[], Class<T>) - Method in class org.springframework.jdbc.core.JdbcTemplate
queryForList(String, Object[], Class<T>) - Method in class org.springframework.jdbc.core.JdbcTemplate
queryForList(String, Class<T>, Object...) - Method in class org.springframework.jdbc.core.JdbcTemplate
queryForList(String, Object[], int[]) - Method in class org.springframework.jdbc.core.JdbcTemplate
queryForList(String, Object...) - Method in class org.springframework.jdbc.core.JdbcTemplate
queryForList(String, SqlParameterSource, Class<T>) - Method in interface org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
queryForList(String, Map<String, ?>, Class<T>) - Method in interface org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
queryForList(String, SqlParameterSource) - Method in interface org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
queryForList(String, Map<String, ?>) - Method in interface org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
queryForList(String, SqlParameterSource, Class<T>) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
queryForList(String, Map<String, ?>, Class<T>) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
queryForList(String, SqlParameterSource) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
queryForList(String, Map<String, ?>) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
queryForList(String, Map<String, ?>) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Execute the supplied query with the supplied arguments.
queryForList(String, SqlParameterSource) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Execute the supplied query with the supplied arguments.
queryForList(String, Object...) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Execute the supplied query with the (optional) supplied arguments.
queryForList(String, Map<String, ?>) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
queryForList(String, SqlParameterSource) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
queryForList(String, Object...) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
queryForList(String) - Method in interface org.springframework.orm.ibatis.SqlMapClientOperations
queryForList(String, Object) - Method in interface org.springframework.orm.ibatis.SqlMapClientOperations
queryForList(String, int, int) - Method in interface org.springframework.orm.ibatis.SqlMapClientOperations
queryForList(String, Object, int, int) - Method in interface org.springframework.orm.ibatis.SqlMapClientOperations
queryForList(String) - Method in class org.springframework.orm.ibatis.SqlMapClientTemplate
queryForList(String, Object) - Method in class org.springframework.orm.ibatis.SqlMapClientTemplate
queryForList(String, int, int) - Method in class org.springframework.orm.ibatis.SqlMapClientTemplate
queryForList(String, Object, int, int) - Method in class org.springframework.orm.ibatis.SqlMapClientTemplate
queryForLong(String) - Method in interface org.springframework.jdbc.core.JdbcOperations
Execute a query that results in a long value, given static SQL.
queryForLong(String, Object[], int[]) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in a long value.
queryForLong(String, Object...) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in a long value.
queryForLong(String) - Method in class org.springframework.jdbc.core.JdbcTemplate
queryForLong(String, Object[], int[]) - Method in class org.springframework.jdbc.core.JdbcTemplate
queryForLong(String, Object...) - Method in class org.springframework.jdbc.core.JdbcTemplate
queryForLong(String, SqlParameterSource) - Method in interface org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in a long value.
queryForLong(String, Map<String, ?>) - Method in interface org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in a long value.
queryForLong(String, SqlParameterSource) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
queryForLong(String, Map<String, ?>) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
queryForLong(String, Map<String, ?>) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Query for an long passing in a SQL query using the named parameter support provided by the NamedParameterJdbcTemplate and a map containing the arguments.
queryForLong(String, SqlParameterSource) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Query for an long passing in a SQL query using the named parameter support provided by the NamedParameterJdbcTemplate and a SqlParameterSource containing the arguments.
queryForLong(String, Object...) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Query for an long passing in a SQL query using the standard '?' placeholders for parameters and a variable number of arguments.
queryForLong(String, Map<String, ?>) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
queryForLong(String, SqlParameterSource) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
queryForLong(String, Object...) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
queryForMap(String) - Method in interface org.springframework.jdbc.core.JdbcOperations
Execute a query for a result Map, given static SQL.
queryForMap(String, Object[], int[]) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result Map.
queryForMap(String, Object...) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result Map.
queryForMap(String) - Method in class org.springframework.jdbc.core.JdbcTemplate
queryForMap(String, Object[], int[]) - Method in class org.springframework.jdbc.core.JdbcTemplate
queryForMap(String, Object...) - Method in class org.springframework.jdbc.core.JdbcTemplate
queryForMap(String, SqlParameterSource) - Method in interface org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result Map.
queryForMap(String, Map<String, ?>) - Method in interface org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result Map.
queryForMap(String, SqlParameterSource) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
queryForMap(String, Map<String, ?>) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
queryForMap(String, Map<String, ?>) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Execute the supplied query with the supplied arguments.
queryForMap(String, SqlParameterSource) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Execute the supplied query with the supplied arguments.
queryForMap(String, Object...) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Execute the supplied query with the (optional) supplied arguments.
queryForMap(String, Map<String, ?>) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
queryForMap(String, SqlParameterSource) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
queryForMap(String, Object...) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
queryForMap(String, Object, String) - Method in interface org.springframework.orm.ibatis.SqlMapClientOperations
queryForMap(String, Object, String, String) - Method in interface org.springframework.orm.ibatis.SqlMapClientOperations
queryForMap(String, Object, String) - Method in class org.springframework.orm.ibatis.SqlMapClientTemplate
queryForMap(String, Object, String, String) - Method in class org.springframework.orm.ibatis.SqlMapClientTemplate
queryForObject(String, RowMapper<T>) - Method in interface org.springframework.jdbc.core.JdbcOperations
Execute a query given static SQL, mapping a single result row to a Java object via a RowMapper.
queryForObject(String, Class<T>) - Method in interface org.springframework.jdbc.core.JdbcOperations
Execute a query for a result object, given static SQL.
queryForObject(String, Object[], int[], RowMapper<T>) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.
queryForObject(String, Object[], RowMapper<T>) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.
queryForObject(String, RowMapper<T>, Object...) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.
queryForObject(String, Object[], int[], Class<T>) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.
queryForObject(String, Object[], Class<T>) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.
queryForObject(String, Class<T>, Object...) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.
queryForObject(String, RowMapper<T>) - Method in class org.springframework.jdbc.core.JdbcTemplate
queryForObject(String, Class<T>) - Method in class org.springframework.jdbc.core.JdbcTemplate
queryForObject(String, Object[], int[], RowMapper<T>) - Method in class org.springframework.jdbc.core.JdbcTemplate
queryForObject(String, Object[], RowMapper<T>) - Method in class org.springframework.jdbc.core.JdbcTemplate
queryForObject(String, RowMapper<T>, Object...) - Method in class org.springframework.jdbc.core.JdbcTemplate
queryForObject(String, Object[], int[], Class<T>) - Method in class org.springframework.jdbc.core.JdbcTemplate
queryForObject(String, Object[], Class<T>) - Method in class org.springframework.jdbc.core.JdbcTemplate
queryForObject(String, Class<T>, Object...) - Method in class org.springframework.jdbc.core.JdbcTemplate
queryForObject(String, SqlParameterSource, RowMapper<T>) - Method in interface org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.
queryForObject(String, Map<String, ?>, RowMapper<T>) - Method in interface org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.
queryForObject(String, SqlParameterSource, Class<T>) - Method in interface org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.
queryForObject(String, Map<String, ?>, Class<T>) - Method in interface org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.
queryForObject(String, SqlParameterSource, RowMapper<T>) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
queryForObject(String, Map<String, ?>, RowMapper<T>) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
queryForObject(String, SqlParameterSource, Class<T>) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
queryForObject(String, Map<String, ?>, Class<T>) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
queryForObject(String, Class<T>, Map<String, ?>) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Query for an object of type T identified by the supplied @Class.
queryForObject(String, Class<T>, SqlParameterSource) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Query for an object of type T identified by the supplied @Class.
queryForObject(String, Class<T>, Object...) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Query for an object of type T identified by the supplied @Class.
queryForObject(String, RowMapper<T>, Map<String, ?>) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Query for an object of type T using the supplied RowMapper to the query results to the object.
queryForObject(String, ParameterizedRowMapper<T>, Map<String, ?>) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Deprecated. as of Spring 3.0: Use the method using the newly genericized RowMapper interface instead since the RowMapper and ParameterizedRowMapper interfaces are equivalent now.
queryForObject(String, RowMapper<T>, SqlParameterSource) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Query for an object of type T using the supplied RowMapper to the query results to the object.
queryForObject(String, ParameterizedRowMapper<T>, SqlParameterSource) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Deprecated. as of Spring 3.0: Use the method using the newly genericized RowMapper interface instead since the RowMapper and ParameterizedRowMapper interfaces are equivalent now.
queryForObject(String, RowMapper<T>, Object...) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Query for an object of type T using the supplied RowMapper to the query results to the object.
queryForObject(String, ParameterizedRowMapper<T>, Object...) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Deprecated. as of Spring 3.0: Use the method using the newly genericized RowMapper interface instead since the RowMapper and ParameterizedRowMapper interfaces are equivalent now.
queryForObject(String, Class<T>, Map<String, ?>) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
queryForObject(String, Class<T>, SqlParameterSource) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
queryForObject(String, Class<T>, Object...) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
queryForObject(String, RowMapper<T>, Map<String, ?>) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
queryForObject(String, ParameterizedRowMapper<T>, Map<String, ?>) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
Deprecated.
queryForObject(String, RowMapper<T>, SqlParameterSource) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
queryForObject(String, ParameterizedRowMapper<T>, SqlParameterSource) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
Deprecated.
queryForObject(String, RowMapper<T>, Object...) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
queryForObject(String, ParameterizedRowMapper<T>, Object...) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
Deprecated.
queryForObject(String) - Method in interface org.springframework.orm.ibatis.SqlMapClientOperations
queryForObject(String, Object) - Method in interface org.springframework.orm.ibatis.SqlMapClientOperations
queryForObject(String, Object, Object) - Method in interface org.springframework.orm.ibatis.SqlMapClientOperations
queryForObject(String) - Method in class org.springframework.orm.ibatis.SqlMapClientTemplate
queryForObject(String, Object) - Method in class org.springframework.orm.ibatis.SqlMapClientTemplate
queryForObject(String, Object, Object) - Method in class org.springframework.orm.ibatis.SqlMapClientTemplate
queryForRowSet(String) - Method in interface org.springframework.jdbc.core.JdbcOperations
Execute a query for a SqlRowSet, given static SQL.
queryForRowSet(String, Object[], int[]) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a SqlRowSet.
queryForRowSet(String, Object...) - Method in interface org.springframework.jdbc.core.JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a SqlRowSet.
queryForRowSet(String) - Method in class org.springframework.jdbc.core.JdbcTemplate
queryForRowSet(String, Object[], int[]) - Method in class org.springframework.jdbc.core.JdbcTemplate
queryForRowSet(String, Object...) - Method in class org.springframework.jdbc.core.JdbcTemplate
queryForRowSet(String, SqlParameterSource) - Method in interface org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a SqlRowSet.
queryForRowSet(String, Map<String, ?>) - Method in interface org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a SqlRowSet.
queryForRowSet(String, SqlParameterSource) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
queryForRowSet(String, Map<String, ?>) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
queryProperties(Map<String, Object>) - Method in class org.springframework.web.servlet.view.RedirectView
Determine name-value pairs for query strings, which will be stringified, URL-encoded and formatted by RedirectView.appendQueryProperties(java.lang.StringBuilder, java.util.Map, java.lang.String).
queryWithRowHandler(String, RowHandler) - Method in interface org.springframework.orm.ibatis.SqlMapClientOperations
queryWithRowHandler(String, Object, RowHandler) - Method in interface org.springframework.orm.ibatis.SqlMapClientOperations
queryWithRowHandler(String, RowHandler) - Method in class org.springframework.orm.ibatis.SqlMapClientTemplate
queryWithRowHandler(String, Object, RowHandler) - Method in class org.springframework.orm.ibatis.SqlMapClientTemplate
QuickTargetSourceCreator - Class in org.springframework.aop.framework.autoproxy.target
Convenient TargetSourceCreator using bean name prefixes to create one of three well-known TargetSource types: : CommonsPoolTargetSource % ThreadLocalTargetSource ! PrototypeTargetSource
QuickTargetSourceCreator() - Constructor for class org.springframework.aop.framework.autoproxy.target.QuickTargetSourceCreator
quote(String) - Static method in class org.springframework.util.StringUtils
Quote the given String with single quotes.
quoteIfString(Object) - Static method in class org.springframework.util.StringUtils
Turn the given Object into a String with single quotes if it is a String; keeping the Object as-is else.
Overview Package Class Tree Deprecated Index Help
A B C D E F G H I J K L M N O P Q R S T U V W X


R-Index

PREV LETTER NEXT LETTER FRAMES NO FRAMES
A B C D E F G H I J K L M N O P Q R S T U V W X

R

RadioButtonsTag - Class in org.springframework.web.servlet.tags.form
Databinding-aware JSP tag for rendering multiple HTML 'input' elements with a 'type' of 'radio'.
RadioButtonsTag() - Constructor for class org.springframework.web.servlet.tags.form.RadioButtonsTag
RadioButtonTag - Class in org.springframework.web.servlet.tags.form
Databinding-aware JSP tag for rendering an HTML 'input' element with a 'type' of 'radio'.
RadioButtonTag() - Constructor for class org.springframework.web.servlet.tags.form.RadioButtonTag
raiseMissingCookieException(String, Class) - Method in class org.springframework.web.bind.annotation.support.HandlerMethodInvoker
raiseMissingHeaderException(String, Class) - Method in class org.springframework.web.bind.annotation.support.HandlerMethodInvoker
raiseMissingParameterException(String, Class) - Method in class org.springframework.web.bind.annotation.support.HandlerMethodInvoker
raiseSessionRequiredException(String) - Method in class org.springframework.web.bind.annotation.support.HandlerMethodInvoker
RawTargetAccess - Interface in org.springframework.aop
Marker for AOP proxy interfaces (in particular: introduction interfaces) that explicitly intend to return the raw target object (which would normally get replaced with the proxy object when returned from a method invocation).
RdbmsOperation - Class in org.springframework.jdbc.object
An "RDBMS operation" is a multi-threaded, reusable object representing a query, update, or stored procedure call.
RdbmsOperation() - Constructor for class org.springframework.jdbc.object.RdbmsOperation
read(EvaluationContext, Object, String) - Method in class org.springframework.context.expression.BeanExpressionContextAccessor
read(EvaluationContext, Object, String) - Method in class org.springframework.context.expression.BeanFactoryAccessor
read(EvaluationContext, Object, String) - Method in class org.springframework.context.expression.MapAccessor
read(EvaluationContext, Object, String) - Method in interface org.springframework.expression.PropertyAccessor
Called to read a property from a specified target object
read(EvaluationContext, Object, String) - Method in class org.springframework.expression.spel.support.ReflectivePropertyAccessor
read(Class<? extends T>, HttpInputMessage) - Method in class org.springframework.http.converter.AbstractHttpMessageConverter
Read an object of the given type form the given input message, and returns it.
read(Class<? extends BufferedImage>, HttpInputMessage) - Method in class org.springframework.http.converter.BufferedImageHttpMessageConverter
read(Class<? extends MultiValueMap<String, ?>>, HttpInputMessage) - Method in class org.springframework.http.converter.FormHttpMessageConverter
read(Class<? extends T>, HttpInputMessage) - Method in interface org.springframework.http.converter.HttpMessageConverter
Read an object of the given type form the given input message, and returns it.
read(Class<? extends Resource>, HttpInputMessage) - Method in class org.springframework.http.converter.ResourceHttpMessageConverter
read(InputStream) - Method in class org.springframework.jca.cci.core.support.CommAreaRecord
read() - Method in class org.springframework.mock.web.DelegatingServletInputStream
READ_ONLY_MARKER - Static variable in class org.springframework.transaction.support.DefaultTransactionDefinition
Marker for read-only transactions in description strings
ReadableInstantPrinter - Class in org.springframework.format.datetime.joda
Prints JodaTime ReadableInstant instances using a DateTimeFormatter.
ReadableInstantPrinter(DateTimeFormatter) - Constructor for class org.springframework.format.datetime.joda.ReadableInstantPrinter
Create a new ReadableInstantPrinter.
ReadablePartialPrinter - Class in org.springframework.format.datetime.joda
Prints JodaTime ReadablePartial instances using a DateTimeFormatter.
ReadablePartialPrinter(DateTimeFormatter) - Constructor for class org.springframework.format.datetime.joda.ReadablePartialPrinter
Create a new ReadableInstantPrinter.
readBodyContent() - Method in class org.springframework.web.servlet.tags.EscapeBodyTag
Read the unescaped body content from the page.
readerCache - Variable in class org.springframework.expression.spel.support.ReflectivePropertyAccessor
ReaderContext - Class in org.springframework.beans.factory.parsing
Context that gets passed along a bean definition reading process, encapsulating all relevant configuration as well as state.
ReaderContext(Resource, ProblemReporter, ReaderEventListener, SourceExtractor) - Constructor for class org.springframework.beans.factory.parsing.ReaderContext
ReaderEventListener - Interface in org.springframework.beans.factory.parsing
Interface that receives callbacks for component, alias and import registrations during a bean definition reading process.
readFromSource(Class<? extends T>, HttpHeaders, Source) - Method in class org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter
Abstract template method called from AbstractHttpMessageConverter.read(Class, HttpInputMessage).
readFromSource(Class<?>, HttpHeaders, Source) - Method in class org.springframework.http.converter.xml.Jaxb2RootElementHttpMessageConverter
readFromSource(Class<?>, HttpHeaders, Source) - Method in class org.springframework.http.converter.xml.MarshallingHttpMessageConverter
readFromSource(Class, HttpHeaders, Source) - Method in class org.springframework.http.converter.xml.SourceHttpMessageConverter
readInternal(Class<? extends T>, HttpInputMessage) - Method in class org.springframework.http.converter.AbstractHttpMessageConverter
Abstract template method that reads the actualy object.
readInternal(Class, HttpInputMessage) - Method in class org.springframework.http.converter.ByteArrayHttpMessageConverter
readInternal(Class<? extends T>, HttpInputMessage) - Method in class org.springframework.http.converter.feed.AbstractWireFeedHttpMessageConverter
readInternal(Class<?>, HttpInputMessage) - Method in class org.springframework.http.converter.json.MappingJacksonHttpMessageConverter
readInternal(Class, HttpInputMessage) - Method in class org.springframework.http.converter.StringHttpMessageConverter
readInternal(Class<? extends T>, HttpInputMessage) - Method in class org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter
READONLY_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
The name of the 'readonly' attribute.
READONLY_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.InputTag
READONLY_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.TextareaTag
readOnlyHttpHeaders(HttpHeaders) - Static method in class org.springframework.http.HttpHeaders
Returns HttpHeaders object that can only be read, not written to.
readPdfResource() - Method in class org.springframework.web.servlet.view.document.AbstractPdfStamperView
Read the raw PDF resource into an iText PdfReader.
readRemoteInvocation(Message) - Method in class org.springframework.jms.remoting.JmsInvokerServiceExporter
Read a RemoteInvocation from the given JMS message.
readRemoteInvocation(HttpServletRequest) - Method in class org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter
Read a RemoteInvocation from the given HTTP request.
readRemoteInvocation(HttpServletRequest, InputStream) - Method in class org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter
Deserialize a RemoteInvocation object from the given InputStream.
readRemoteInvocation(HttpExchange) - Method in class org.springframework.remoting.httpinvoker.SimpleHttpInvokerServiceExporter
Read a RemoteInvocation from the given HTTP request.
readRemoteInvocation(HttpExchange, InputStream) - Method in class org.springframework.remoting.httpinvoker.SimpleHttpInvokerServiceExporter
Deserialize a RemoteInvocation object from the given InputStream.
readRemoteInvocationResult(InputStream, String) - Method in class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
Deserialize a RemoteInvocationResult object from the given InputStream.
readResolve() - Method in class org.springframework.core.enums.StaticLabeledEnum
Deprecated. Return the resolved type safe static enum instance.
readResponseBody(HttpInvokerClientConfiguration, HttpURLConnection) - Method in class org.springframework.remoting.httpinvoker.SimpleHttpInvokerRequestExecutor
Extract the response body from the given executed remote invocation request.
readScript(LineNumberReader) - Static method in class org.springframework.test.jdbc.JdbcTestUtils
Read a script from the LineNumberReader and build a String containing the lines.
RealLiteral - Class in org.springframework.expression.spel.ast
RealLiteral(String, int, double) - Constructor for class org.springframework.expression.spel.ast.RealLiteral
rebind(String, Object) - Method in class org.springframework.jndi.JndiTemplate
Rebind the given object to the current JNDI context, using the given name.
rebind(String, Object) - Method in class org.springframework.mock.jndi.SimpleNamingContext
rebind(Name, Object) - Method in class org.springframework.mock.jndi.SimpleNamingContext
rebind() - Method in class org.springframework.remoting.rmi.JndiRmiServiceExporter
Rebind the specified service to JNDI, for recovering in case of the target registry having been restarted.
receive() - Method in interface org.springframework.jms.core.JmsOperations
Receive a message synchronously from the default destination, but only wait up to a specified time for delivery.
receive(Destination) - Method in interface org.springframework.jms.core.JmsOperations
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.
receive(String) - Method in interface org.springframework.jms.core.JmsOperations
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.
receive() - Method in class org.springframework.jms.core.JmsTemplate
receive(Destination) - Method in class org.springframework.jms.core.JmsTemplate
receive(String) - Method in class org.springframework.jms.core.JmsTemplate
RECEIVE_TIMEOUT_INDEFINITE_WAIT - Static variable in class org.springframework.jms.core.JmsTemplate
Timeout value indicating a blocking receive without timeout.
RECEIVE_TIMEOUT_NO_WAIT - Static variable in class org.springframework.jms.core.JmsTemplate
Timeout value indicating that a receive operation should check if a message is immediately available without blocking.
receiveAndConvert() - Method in interface org.springframework.jms.core.JmsOperations
Receive a message synchronously from the default destination, but only wait up to a specified time for delivery.
receiveAndConvert(Destination) - Method in interface org.springframework.jms.core.JmsOperations
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.
receiveAndConvert(String) - Method in interface org.springframework.jms.core.JmsOperations
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.
receiveAndConvert() - Method in class org.springframework.jms.core.JmsTemplate
receiveAndConvert(Destination) - Method in class org.springframework.jms.core.JmsTemplate
receiveAndConvert(String) - Method in class org.springframework.jms.core.JmsTemplate
receiveAndExecute(Object, Session, MessageConsumer) - Method in class org.springframework.jms.listener.AbstractPollingMessageListenerContainer
Execute the listener for a message received from the given consumer, wrapping the entire operation in an external transaction if demanded.
receiveMessage(MessageConsumer) - Method in class org.springframework.jms.listener.AbstractPollingMessageListenerContainer
Receive a message from the given consumer.
receiveSelected(String) - Method in interface org.springframework.jms.core.JmsOperations
Receive a message synchronously from the default destination, but only wait up to a specified time for delivery.
receiveSelected(Destination, String) - Method in interface org.springframework.jms.core.JmsOperations
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.
receiveSelected(String, String) - Method in interface org.springframework.jms.core.JmsOperations
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.
receiveSelected(String) - Method in class org.springframework.jms.core.JmsTemplate
receiveSelected(Destination, String) - Method in class org.springframework.jms.core.JmsTemplate
receiveSelected(String, String) - Method in class org.springframework.jms.core.JmsTemplate
receiveSelectedAndConvert(String) - Method in interface org.springframework.jms.core.JmsOperations
Receive a message synchronously from the default destination, but only wait up to a specified time for delivery.
receiveSelectedAndConvert(Destination, String) - Method in interface org.springframework.jms.core.JmsOperations
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.
receiveSelectedAndConvert(String, String) - Method in interface org.springframework.jms.core.JmsOperations
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.
receiveSelectedAndConvert(String) - Method in class org.springframework.jms.core.JmsTemplate
receiveSelectedAndConvert(Destination, String) - Method in class org.springframework.jms.core.JmsTemplate
receiveSelectedAndConvert(String, String) - Method in class org.springframework.jms.core.JmsTemplate
RecordCreator - Interface in org.springframework.jca.cci.core
Callback interface for creating a CCI Record instance, usually based on the passed-in CCI RecordFactory.
recordDisabled() - Method in class org.springframework.test.ConditionalTestCase
Deprecated. Record a disabled test.
recordDisabled(Method) - Method in class org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests
Records the supplied test method as disabled in the current environment by incrementing the total number of disabled tests and logging a debug message.
RecordExtractor<T> - Interface in org.springframework.jca.cci.core
Callback interface for extracting a result object from a CCI Record instance.
recordSuppressedField(String) - Method in class org.springframework.validation.AbstractBindingResult
Mark the specified disallowed field as suppressed.
recordSuppressedField(String) - Method in exception org.springframework.validation.BindException
recordSuppressedField(String) - Method in interface org.springframework.validation.BindingResult
Mark the specified disallowed field as suppressed.
RecordTypeNotSupportedException - Exception in org.springframework.jca.cci
Exception thrown when the creating of a CCI Record failed because the connector doesn't support the desired CCI Record type.
RecordTypeNotSupportedException(String, ResourceException) - Constructor for exception org.springframework.jca.cci.RecordTypeNotSupportedException
Constructor for RecordTypeNotSupportedException.
RecoverableDataAccessException - Exception in org.springframework.dao
Data access exception thrown when a previously failed operation might be able to succeed if the application performs some recovery steps and retries the entire transaction or in the case of a distributed transaction, the transaction branch.
RecoverableDataAccessException(String) - Constructor for exception org.springframework.dao.RecoverableDataAccessException
Constructor for RecoverableDataAccessException.
RecoverableDataAccessException(String, Throwable) - Constructor for exception org.springframework.dao.RecoverableDataAccessException
Constructor for RecoverableDataAccessException.
recoverAfterListenerSetupFailure() - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Recover this listener container after a listener failed to set itself up, for example reestablishing the underlying Connection.
recreate() - Method in class org.springframework.remoting.support.RemoteInvocationResult
Recreate the invocation result, either returning the result value in case of a successful invocation of the target method, or rethrowing the exception thrown by the target method.
recreateRemoteInvocationResult(RemoteInvocationResult) - Method in class org.springframework.jms.remoting.JmsInvokerClientInterceptor
Recreate the invocation result contained in the given RemoteInvocationResult object.
recreateRemoteInvocationResult(RemoteInvocationResult) - Method in class org.springframework.remoting.support.RemoteInvocationBasedAccessor
Recreate the invocation result contained in the given RemoteInvocationResult object.
REDIRECT_URL_PREFIX - Static variable in class org.springframework.web.servlet.view.UrlBasedViewResolver
Prefix for special view names that specify a redirect URL (usually to a controller after a form has been submitted and processed).
RedirectView - Class in org.springframework.web.servlet.view
View that redirects to an absolute, context relative, or current request relative URL.
RedirectView() - Constructor for class org.springframework.web.servlet.view.RedirectView
Constructor for use as a bean.
RedirectView(String) - Constructor for class org.springframework.web.servlet.view.RedirectView
Create a new RedirectView with the given URL.
RedirectView(String, boolean) - Constructor for class org.springframework.web.servlet.view.RedirectView
Create a new RedirectView with the given URL.
RedirectView(String, boolean, boolean) - Constructor for class org.springframework.web.servlet.view.RedirectView
Create a new RedirectView with the given URL.
RedirectView(String, boolean, boolean, boolean) - Constructor for class org.springframework.web.servlet.view.RedirectView
Create a new RedirectView with the given URL.
REF_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
REF_ELEMENT - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
REF_PREFIX - Static variable in class org.springframework.beans.factory.support.PropertiesBeanDefinitionReader
Prefix before values referencing other beans.
REF_SUFFIX - Static variable in class org.springframework.beans.factory.support.PropertiesBeanDefinitionReader
Property suffix for references to other beans in the current BeanFactory: e.g.
REFERENCE_REQUEST - Static variable in interface org.springframework.web.context.request.RequestAttributes
Name of the standard reference to the request object: "request".
REFERENCE_SESSION - Static variable in interface org.springframework.web.context.request.RequestAttributes
Name of the standard reference to the session object: "session".
referenceData(PortletRequest, Object, Errors) - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Create a reference data map for the given request, consisting of bean name/bean instance pairs as expected by ModelAndView.
referenceData(PortletRequest, Object, Errors) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Calls page-specific referenceData method.
referenceData(PortletRequest, Object, Errors, int) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Create a reference data map for the given request, consisting of bean name/bean instance pairs as expected by ModelAndView.
referenceData(PortletRequest, int) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Create a reference data map for the given request, consisting of bean name/bean instance pairs as expected by ModelAndView.
referenceData(PortletRequest, Object, Errors) - Method in class org.springframework.web.portlet.mvc.SimpleFormController
Deprecated. Create a reference data map for the given request and command, consisting of bean name/bean instance pairs as expected by ModelAndView.
referenceData(PortletRequest) - Method in class org.springframework.web.portlet.mvc.SimpleFormController
Deprecated. Create a reference data map for the given request.
referenceData(HttpServletRequest, Object, Errors) - Method in class org.springframework.web.servlet.mvc.AbstractFormController
Deprecated. Create a reference data map for the given request, consisting of bean name/bean instance pairs as expected by ModelAndView.
referenceData(HttpServletRequest, Object, Errors) - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Calls page-specific referenceData method.
referenceData(HttpServletRequest, Object, Errors, int) - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Create a reference data map for the given request, consisting of bean name/bean instance pairs as expected by ModelAndView.
referenceData(HttpServletRequest, int) - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Create a reference data map for the given request, consisting of bean name/bean instance pairs as expected by ModelAndView.
referenceData(HttpServletRequest, Object, Errors) - Method in class org.springframework.web.servlet.mvc.SimpleFormController
Deprecated. Create a reference data map for the given request and command, consisting of bean name/bean instance pairs as expected by ModelAndView.
referenceData(HttpServletRequest) - Method in class org.springframework.web.servlet.mvc.SimpleFormController
Deprecated. Create a reference data map for the given request.
ReflectionHelper - Class in org.springframework.expression.spel.support
Utility methods used by the reflection resolver code to discover the appropriae methods/constructors and fields that should be used in expressions.
ReflectionHelper() - Constructor for class org.springframework.expression.spel.support.ReflectionHelper
ReflectionHelper.ArgsMatchKind - Enum in org.springframework.expression.spel.support
ReflectionHelper.ArgumentsMatchInfo - Class in org.springframework.expression.spel.support
An instance of ArgumentsMatchInfo describes what kind of match was achieved between two sets of arguments - the set that a method/constructor is expecting and the set that are being supplied at the point of invocation.
ReflectionTestUtils - Class in org.springframework.test.util
ReflectionTestUtils is a collection of reflection-based utility methods for use in unit and integration testing scenarios.
ReflectionTestUtils() - Constructor for class org.springframework.test.util.ReflectionTestUtils
ReflectionUtils - Class in org.springframework.util
Simple utility class for working with the reflection API and handling reflection exceptions.
ReflectionUtils() - Constructor for class org.springframework.util.ReflectionUtils
ReflectionUtils.FieldCallback - Interface in org.springframework.util
Callback interface invoked on each field in the hierarchy.
ReflectionUtils.FieldFilter - Interface in org.springframework.util
Callback optionally used to filter fields to be operated on by a field callback.
ReflectionUtils.MethodCallback - Interface in org.springframework.util
Action to take on each method.
ReflectionUtils.MethodFilter - Interface in org.springframework.util
Callback optionally used to method fields to be operated on by a method callback.
ReflectiveAspectJAdvisorFactory - Class in org.springframework.aop.aspectj.annotation
Factory that can create Spring AOP Advisors given AspectJ classes from classes honoring the AspectJ 5 annotation syntax, using reflection to invoke the corresponding advice methods.
ReflectiveAspectJAdvisorFactory() - Constructor for class org.springframework.aop.aspectj.annotation.ReflectiveAspectJAdvisorFactory
ReflectiveAspectJAdvisorFactory.SyntheticInstantiationAdvisor - Class in org.springframework.aop.aspectj.annotation
Synthetic advisor that instantiates the aspect.
ReflectiveAspectJAdvisorFactory.SyntheticInstantiationAdvisor(MetadataAwareAspectInstanceFactory) - Constructor for class org.springframework.aop.aspectj.annotation.ReflectiveAspectJAdvisorFactory.SyntheticInstantiationAdvisor
ReflectiveConstructorResolver - Class in org.springframework.expression.spel.support
A constructor resolver that uses reflection to locate the constructor that should be invoked
ReflectiveConstructorResolver() - Constructor for class org.springframework.expression.spel.support.ReflectiveConstructorResolver
ReflectiveLoadTimeWeaver - Class in org.springframework.instrument.classloading
LoadTimeWeaver which uses reflection to delegate to an underlying ClassLoader with well-known transformation hooks.
ReflectiveLoadTimeWeaver() - Constructor for class org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver
Create a new ReflectiveLoadTimeWeaver for the current context class loader, which needs to support the required weaving methods.
ReflectiveLoadTimeWeaver(ClassLoader) - Constructor for class org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver
Create a new SimpleLoadTimeWeaver for the given class loader.
ReflectiveMethodInvocation - Class in org.springframework.aop.framework
Spring's implementation of the AOP Alliance MethodInvocation interface, implementing the extended ProxyMethodInvocation interface.
ReflectiveMethodInvocation(Object, Object, Method, Object[], Class, List<Object>) - Constructor for class org.springframework.aop.framework.ReflectiveMethodInvocation
Construct a new ReflectiveMethodInvocation with the given arguments.
ReflectiveMethodResolver - Class in org.springframework.expression.spel.support
A method resolver that uses reflection to locate the method that should be invoked
ReflectiveMethodResolver() - Constructor for class org.springframework.expression.spel.support.ReflectiveMethodResolver
ReflectivePropertyAccessor - Class in org.springframework.expression.spel.support
Simple PropertyAccessor that uses reflection to access properties for reading and writing.
ReflectivePropertyAccessor() - Constructor for class org.springframework.expression.spel.support.ReflectivePropertyAccessor
refresh() - Method in class org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource
refresh() - Method in interface org.springframework.aop.target.dynamic.Refreshable
Refresh the underlying target object.
refresh() - Method in interface org.springframework.context.ConfigurableApplicationContext
Load or refresh the persistent representation of the configuration, which might an XML file, properties file, or relational database schema.
refresh() - Method in class org.springframework.context.support.AbstractApplicationContext
refresh(Object) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Re-read the state of the given persistent instance.
refresh(Object, LockMode) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Re-read the state of the given persistent instance.
refresh(Object) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
refresh(Object, LockMode) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
refresh(Object) - Method in interface org.springframework.orm.jdo.JdoOperations
Re-read the state of the given persistent instance.
refresh(Object) - Method in class org.springframework.orm.jdo.JdoTemplate
refresh(Object) - Method in interface org.springframework.orm.jpa.JpaOperations
refresh(Object) - Method in class org.springframework.orm.jpa.JpaTemplate
refresh() - Method in class org.springframework.web.portlet.FrameworkPortlet
Refresh this portlet's application context, as well as the dependent state of the portlet.
refresh() - Method in class org.springframework.web.servlet.FrameworkServlet
Refresh this servlet's application context, as well as the dependent state of the servlet.
REFRESH_CHECK_DELAY_ATTRIBUTE - Static variable in class org.springframework.scripting.support.ScriptFactoryPostProcessor
REFRESH_INTERVAL_PARAM - Static variable in class org.springframework.web.util.Log4jWebConfigurer
Parameter specifying the refresh interval for checking the log4j config file
Refreshable - Interface in org.springframework.aop.target.dynamic
Interface to be implemented by dynamic target objects, which support reloading and optionally polling for updates.
RefreshableScriptTargetSource - Class in org.springframework.scripting.support
Subclass of BeanFactoryRefreshableTargetSource that determines whether a refresh is required through the given ScriptFactory.
RefreshableScriptTargetSource(BeanFactory, String, ScriptFactory, ScriptSource, boolean) - Constructor for class org.springframework.scripting.support.RefreshableScriptTargetSource
Create a new RefreshableScriptTargetSource.
refreshAll(Collection) - Method in interface org.springframework.orm.jdo.JdoOperations
Re-read the state of all given persistent instances.
refreshAll() - Method in interface org.springframework.orm.jdo.JdoOperations
Re-read the state of all persistent instances.
refreshAll(Collection) - Method in class org.springframework.orm.jdo.JdoTemplate
refreshAll() - Method in class org.springframework.orm.jdo.JdoTemplate
refreshAndRetry(MethodInvocation) - Method in class org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor
Refresh the EJB home object and retry the given invocation.
refreshAndRetry(MethodInvocation) - Method in class org.springframework.remoting.rmi.JndiRmiClientInterceptor
Refresh the RMI stub and retry the given invocation.
refreshAndRetry(MethodInvocation) - Method in class org.springframework.remoting.rmi.RmiClientInterceptor
Refresh the RMI stub and retry the given invocation.
refreshBeanFactory() - Method in class org.springframework.context.support.AbstractApplicationContext
Subclasses must implement this method to perform the actual configuration load.
refreshBeanFactory() - Method in class org.springframework.context.support.AbstractRefreshableApplicationContext
This implementation performs an actual refresh of this context's underlying bean factory, shutting down the previous bean factory (if any) and initializing a fresh bean factory for the next phase of the context's lifecycle.
refreshBeanFactory() - Method in class org.springframework.context.support.GenericApplicationContext
Do nothing: We hold a single internal BeanFactory and rely on callers to register beans through our public methods (or the BeanFactory's).
refreshConnectionUntilSuccessful() - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Refresh the underlying Connection, not returning before an attempt has been successful.
refreshDestination() - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Refresh the JMS destination that this listener container operates on.
refreshHome() - Method in class org.springframework.ejb.access.AbstractSlsbInvokerInterceptor
Refresh the cached home object, if applicable.
refreshHome() - Method in class org.springframework.ejb.access.SimpleRemoteSlsbInvokerInterceptor
Reset the cached session bean instance, if necessary.
refreshProperties(String, ReloadableResourceBundleMessageSource.PropertiesHolder) - Method in class org.springframework.context.support.ReloadableResourceBundleMessageSource
Refresh the PropertiesHolder for the given bundle filename.
refreshSharedConnection() - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Refresh the shared Connection that this container holds.
RegexPatternTypeFilter - Class in org.springframework.core.type.filter
A simple filter for matching a fully-qualified class name with a regex Pattern.
RegexPatternTypeFilter(Pattern) - Constructor for class org.springframework.core.type.filter.RegexPatternTypeFilter
RegexpMethodPointcutAdvisor - Class in org.springframework.aop.support
Convenient class for regexp method pointcuts that hold an Advice, making them an Advisor.
RegexpMethodPointcutAdvisor() - Constructor for class org.springframework.aop.support.RegexpMethodPointcutAdvisor
Create an empty RegexpMethodPointcutAdvisor.
RegexpMethodPointcutAdvisor(Advice) - Constructor for class org.springframework.aop.support.RegexpMethodPointcutAdvisor
Create a RegexpMethodPointcutAdvisor for the given advice.
RegexpMethodPointcutAdvisor(String, Advice) - Constructor for class org.springframework.aop.support.RegexpMethodPointcutAdvisor
Create a RegexpMethodPointcutAdvisor for the given advice.
RegexpMethodPointcutAdvisor(String[], Advice) - Constructor for class org.springframework.aop.support.RegexpMethodPointcutAdvisor
Create a RegexpMethodPointcutAdvisor for the given advice.
register(Class<?>...) - Method in class org.springframework.context.annotation.AnnotatedBeanDefinitionReader
register(Class<?>...) - Method in class org.springframework.context.annotation.AnnotationConfigApplicationContext
Register an annotated class to be processed.
registerAdvisorAdapter(AdvisorAdapter) - Method in interface org.springframework.aop.framework.adapter.AdvisorAdapterRegistry
Register the given AdvisorAdapter.
registerAdvisorAdapter(AdvisorAdapter) - Method in class org.springframework.aop.framework.adapter.DefaultAdvisorAdapterRegistry
registerAfterCompletionWithExistingTransaction(Object, List<TransactionSynchronization>) - Method in class org.springframework.transaction.jta.JtaTransactionManager
registerAfterCompletionWithExistingTransaction(Object, List<TransactionSynchronization>) - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Register the given list of transaction synchronizations with the existing transaction.
registerAlias(String, String) - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Given a bean name, create an alias.
registerAlias(String, String) - Method in class org.springframework.context.support.GenericApplicationContext
registerAlias(String, String) - Method in interface org.springframework.core.AliasRegistry
Given a name, register an alias for it.
registerAlias(String, String) - Method in class org.springframework.core.SimpleAliasRegistry
registerAnnotationConfigProcessors(BeanDefinitionRegistry) - Static method in class org.springframework.context.annotation.AnnotationConfigUtils
Register all relevant annotation post processors in the given registry.
registerAnnotationConfigProcessors(BeanDefinitionRegistry, Object) - Static method in class org.springframework.context.annotation.AnnotationConfigUtils
Register all relevant annotation post processors in the given registry.
registerAspectJAnnotationAutoProxyCreatorIfNecessary(BeanDefinitionRegistry) - Static method in class org.springframework.aop.config.AopConfigUtils
registerAspectJAnnotationAutoProxyCreatorIfNecessary(BeanDefinitionRegistry, Object) - Static method in class org.springframework.aop.config.AopConfigUtils
registerAspectJAnnotationAutoProxyCreatorIfNecessary(ParserContext, Element) - Static method in class org.springframework.aop.config.AopNamespaceUtils
registerAspectJAutoProxyCreatorIfNecessary(BeanDefinitionRegistry) - Static method in class org.springframework.aop.config.AopConfigUtils
registerAspectJAutoProxyCreatorIfNecessary(BeanDefinitionRegistry, Object) - Static method in class org.springframework.aop.config.AopConfigUtils
registerAspectJAutoProxyCreatorIfNecessary(ParserContext, Element) - Static method in class org.springframework.aop.config.AopNamespaceUtils
registerAutoProxyCreatorIfNecessary(BeanDefinitionRegistry) - Static method in class org.springframework.aop.config.AopConfigUtils
registerAutoProxyCreatorIfNecessary(BeanDefinitionRegistry, Object) - Static method in class org.springframework.aop.config.AopConfigUtils
registerAutoProxyCreatorIfNecessary(ParserContext, Element) - Static method in class org.springframework.aop.config.AopNamespaceUtils
registerAutoProxyCreatorIfNecessary(ParserContext, Object) - Static method in class org.springframework.aop.config.AopNamespaceUtils
Deprecated. since Spring 2.5, in favor of AopNamespaceUtils.registerAutoProxyCreatorIfNecessary(ParserContext, Element) and AopConfigUtils.registerAutoProxyCreatorIfNecessary(BeanDefinitionRegistry, Object)
registerBean(Class<?>) - Method in class org.springframework.context.annotation.AnnotatedBeanDefinitionReader
registerBean(Class<?>, Class<? extends Annotation>...) - Method in class org.springframework.context.annotation.AnnotatedBeanDefinitionReader
registerBean(Class<?>, String, Class<? extends Annotation>...) - Method in class org.springframework.context.annotation.AnnotatedBeanDefinitionReader
registerBeanComponent(BeanComponentDefinition) - Method in class org.springframework.beans.factory.xml.ParserContext
registerBeanDefinition(BeanDefinitionHolder, BeanDefinitionRegistry) - Static method in class org.springframework.beans.factory.support.BeanDefinitionReaderUtils
Register the given bean definition with the given bean factory.
registerBeanDefinition(String, BeanDefinition) - Method in interface org.springframework.beans.factory.support.BeanDefinitionRegistry
Register a new bean definition with this registry.
registerBeanDefinition(String, BeanDefinition) - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
registerBeanDefinition(String, Map<?, ?>, String, String) - Method in class org.springframework.beans.factory.support.PropertiesBeanDefinitionReader
Get all property values, given a prefix (which will be stripped) and add the bean they define to the factory with the given name
registerBeanDefinition(String, BeanDefinition) - Method in class org.springframework.beans.factory.support.SimpleBeanDefinitionRegistry
registerBeanDefinition(BeanDefinitionHolder, BeanDefinitionRegistry) - Method in class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
Register the supplied bean with the supplied registry.
registerBeanDefinition(BeanDefinitionHolder, BeanDefinitionRegistry) - Method in class org.springframework.context.annotation.ClassPathBeanDefinitionScanner
Register the specified bean with the given registry.
registerBeanDefinition(String, BeanDefinition) - Method in class org.springframework.context.support.GenericApplicationContext
registerBeanDefinitionDecorator(String, BeanDefinitionDecorator) - Method in class org.springframework.beans.factory.xml.NamespaceHandlerSupport
Subclasses can call this to register the supplied BeanDefinitionDecorator to handle the specified element.
registerBeanDefinitionDecoratorForAttribute(String, BeanDefinitionDecorator) - Method in class org.springframework.beans.factory.xml.NamespaceHandlerSupport
Subclasses can call this to register the supplied BeanDefinitionDecorator to handle the specified attribute.
registerBeanDefinitionParser(String, BeanDefinitionParser) - Method in class org.springframework.beans.factory.xml.NamespaceHandlerSupport
Subclasses can call this to register the supplied BeanDefinitionParser to handle the specified element.
registerBeanDefinitions(ResourceBundle) - Method in class org.springframework.beans.factory.support.PropertiesBeanDefinitionReader
Register bean definitions contained in a resource bundle, using all property keys (i.e.
registerBeanDefinitions(ResourceBundle, String) - Method in class org.springframework.beans.factory.support.PropertiesBeanDefinitionReader
Register bean definitions contained in a ResourceBundle.
registerBeanDefinitions(Map) - Method in class org.springframework.beans.factory.support.PropertiesBeanDefinitionReader
Register bean definitions contained in a Map, using all property keys (i.e.
registerBeanDefinitions(Map, String) - Method in class org.springframework.beans.factory.support.PropertiesBeanDefinitionReader
Register bean definitions contained in a Map.
registerBeanDefinitions(Map, String, String) - Method in class org.springframework.beans.factory.support.PropertiesBeanDefinitionReader
Register bean definitions contained in a Map.
registerBeanDefinitions(Document, XmlReaderContext) - Method in interface org.springframework.beans.factory.xml.BeanDefinitionDocumentReader
Read bean definitions from the given DOM document, and register them with the given bean factory.
registerBeanDefinitions(Document, XmlReaderContext) - Method in class org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader
Parses bean definitions according to the "spring-beans" DTD.
registerBeanDefinitions(Document, Resource) - Method in class org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Register the bean definitions contained in the given DOM document.
registerBeanNameOrInstance(Object, String) - Method in class org.springframework.jmx.export.MBeanExporter
Registers an individual bean with the MBeanServer.
registerBeanPostProcessors(ConfigurableListableBeanFactory) - Method in class org.springframework.context.support.AbstractApplicationContext
Instantiate and invoke all registered BeanPostProcessor beans, respecting explicit order if given.
registerBeans() - Method in class org.springframework.jmx.export.MBeanExporter
Registers the defined beans with the MBeanServer.
registerComponent(ComponentDefinition) - Method in class org.springframework.beans.factory.xml.ParserContext
registerComponents(XmlReaderContext, Set<BeanDefinitionHolder>, Element) - Method in class org.springframework.context.annotation.ComponentScanBeanDefinitionParser
registerContainedBean(String, String) - Method in class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
Register a containment relationship between two beans, e.g.
registerContext(String, ServletContext) - Method in class org.springframework.mock.web.MockServletContext
registerConverters(Set<?>, ConverterRegistry) - Static method in class org.springframework.core.convert.support.ConversionServiceFactory
Register the given converter objects with the given target registry.
registerCustomEditor(Class, Class<? extends PropertyEditor>) - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Register the given custom property editor for all properties of the given type.
registerCustomEditor(Class, Class<? extends PropertyEditor>) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
registerCustomEditor(Class, PropertyEditor) - Method in interface org.springframework.beans.PropertyEditorRegistry
Register the given custom property editor for all properties of the given type.
registerCustomEditor(Class, String, PropertyEditor) - Method in interface org.springframework.beans.PropertyEditorRegistry
Register the given custom property editor for the given type and property, or for all properties of the given type.
registerCustomEditor(Class, PropertyEditor) - Method in class org.springframework.beans.PropertyEditorRegistrySupport
registerCustomEditor(Class, String, PropertyEditor) - Method in class org.springframework.beans.PropertyEditorRegistrySupport
registerCustomEditor(Class, PropertyEditor) - Method in class org.springframework.beans.support.ArgumentConvertingMethodInvoker
Register the given custom property editor for all properties of the given type.
registerCustomEditor(Class, PropertyEditor) - Method in class org.springframework.validation.DataBinder
registerCustomEditor(Class, String, PropertyEditor) - Method in class org.springframework.validation.DataBinder
registerCustomEditors(PropertyEditorRegistry) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Initialize the given PropertyEditorRegistry with the custom editors that have been registered with this BeanFactory.
registerCustomEditors(PropertyEditorRegistry) - Method in interface org.springframework.beans.PropertyEditorRegistrar
Register custom PropertyEditors with the given PropertyEditorRegistry.
registerCustomEditors(PropertyEditorRegistry) - Method in class org.springframework.beans.support.ResourceEditorRegistrar
Populate the given bean factory with the following resource editors: ResourceEditor, InputStreamEditor, FileEditor, URLEditor, ClassEditor, URIEditor.
registerDatabase(DataSource, String) - Method in class org.springframework.jdbc.support.SQLErrorCodesFactory
Associate the specified database name with the given DataSource.
registerDefaultEditors() - Method in class org.springframework.beans.PropertyEditorRegistrySupport
Activate the default editors for this registry instance, allowing for lazily registering default editors when needed.
registerDefaultFilters() - Method in class org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider
Register the default filter for @Component.
registerDependentBean(String, String) - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Register a dependent bean for the given bean, to be destroyed before the given bean is destroyed.
registerDependentBean(String, String) - Method in class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
Register a dependent bean for the given bean, to be destroyed before the given bean is destroyed.
registerDestructionCallback(String, Runnable) - Method in interface org.springframework.beans.factory.config.Scope
Register a callback to be executed on destruction of the specified object in the scope (or at destruction of the entire scope, if the scope does not destroy individual objects but rather only terminates in its entirety).
registerDestructionCallback(String, Runnable) - Method in class org.springframework.context.support.SimpleThreadScope
registerDestructionCallback(String, Runnable) - Method in class org.springframework.web.context.request.AbstractRequestAttributesScope
registerDestructionCallback(String, Runnable, int) - Method in class org.springframework.web.context.request.FacesRequestAttributes
registerDestructionCallback(String, Runnable, int) - Method in interface org.springframework.web.context.request.RequestAttributes
Register a callback to be executed on destruction of the specified attribute in the given scope.
registerDestructionCallback(String, Runnable, int) - Method in class org.springframework.web.context.request.ServletRequestAttributes
registerDestructionCallback(String, Runnable) - Method in class org.springframework.web.context.support.ServletContextScope
registerDestructionCallback(String, Runnable) - Method in class org.springframework.web.portlet.context.PortletContextScope
registerDestructionCallback(String, Runnable, int) - Method in class org.springframework.web.portlet.context.PortletRequestAttributes
registerDisposableBean(String, DisposableBean) - Method in class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
Add the given bean to the list of disposable beans in this registry.
registerDisposableBeanIfNecessary(String, Object, RootBeanDefinition) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Add the given bean to the list of disposable beans in this factory, registering its DisposableBean interface and/or the given destroy method to be called on factory shutdown (if applicable).
registeredBeans - Variable in class org.springframework.jmx.support.MBeanRegistrationSupport
The beans that have been registered by this exporter.
registerEnvironmentBeans(ConfigurableListableBeanFactory, ServletContext) - Static method in class org.springframework.web.context.support.WebApplicationContextUtils
Register web-specific environment beans ("contextParameters", "contextAttributes") with the given BeanFactory, as used by the WebApplicationContext.
registerEnvironmentBeans(ConfigurableListableBeanFactory, ServletContext, ServletConfig) - Static method in class org.springframework.web.context.support.WebApplicationContextUtils
Register web-specific environment beans ("contextParameters", "contextAttributes") with the given BeanFactory, as used by the WebApplicationContext.
registerExternallyManagedConfigMember(Member) - Method in class org.springframework.beans.factory.support.RootBeanDefinition
registerExternallyManagedDestroyMethod(String) - Method in class org.springframework.beans.factory.support.RootBeanDefinition
registerExternallyManagedInitMethod(String) - Method in class org.springframework.beans.factory.support.RootBeanDefinition
registerFunction(String, Method) - Method in class org.springframework.expression.spel.support.StandardEvaluationContext
registerHandler(K, Object) - Method in class org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping
Register the given handler instance for the given parameter value.
registerHandler(K, Object, AbstractMapBasedHandlerMapping.PortletRequestMappingPredicate) - Method in class org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping
Register the given handler instance for the given parameter value.
registerHandler(PortletMode, Map<String, ?>) - Method in class org.springframework.web.portlet.handler.PortletModeParameterHandlerMapping
Register all handlers specified in the given parameter map.
registerHandler(PortletMode, String, Object) - Method in class org.springframework.web.portlet.handler.PortletModeParameterHandlerMapping
Register the given handler instance for the given PortletMode and parameter value, under an appropriate lookup key.
registerHandler(String[], String) - Method in class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
Register the specified handler for the given URL paths.
registerHandler(String, Object) - Method in class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
Register the specified handler for the given URL path.
registerHandlers(Map<K, ?>) - Method in class org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping
Register all handlers specified in the Portlet mode map for the corresponding modes.
registerHandlers(Map<String, Object>) - Method in class org.springframework.web.servlet.handler.SimpleUrlHandlerMapping
Register all handlers specified in the URL map for the corresponding paths.
registerHandlersByMode(Map<String, Object>) - Method in class org.springframework.web.portlet.handler.PortletModeHandlerMapping
Register all handlers specified in the Portlet mode map for the corresponding modes.
registerHandlersByModeAndParameter(Map<String, Map<String, ?>>) - Method in class org.springframework.web.portlet.handler.PortletModeParameterHandlerMapping
Register all handlers specified in the Portlet mode map for the corresponding modes.
registerImport(String) - Method in class org.springframework.expression.spel.support.StandardTypeLocator
Register a new import prefix that will be used when searching for unqualified types.
registerJobsAndTriggers() - Method in class org.springframework.scheduling.quartz.SchedulerAccessor
Register jobs and triggers (within a transaction, if possible).
registerListeners() - Method in class org.springframework.context.support.AbstractApplicationContext
Add beans that implement ApplicationListener as listeners.
registerListeners() - Method in class org.springframework.scheduling.quartz.SchedulerAccessor
Register all specified listeners with the Scheduler.
registerManagedResource(Object) - Method in class org.springframework.jmx.export.MBeanExporter
registerManagedResource(Object, ObjectName) - Method in class org.springframework.jmx.export.MBeanExporter
registerManagedResource(Object) - Method in interface org.springframework.jmx.export.MBeanExportOperations
Register the supplied resource with JMX.
registerManagedResource(Object, ObjectName) - Method in interface org.springframework.jmx.export.MBeanExportOperations
Register the supplied resource with JMX.
registerMethodFilter(Class<?>, MethodFilter) - Method in class org.springframework.expression.spel.support.ReflectiveMethodResolver
registerMethodFilter(Class<?>, MethodFilter) - Method in class org.springframework.expression.spel.support.StandardEvaluationContext
Register a MethodFilter which will be called during method resolution for the specified type.
registerProcessedProperty(String) - Method in class org.springframework.beans.MutablePropertyValues
Register the specified property as "processed" in the sense of some processor calling the corresponding setter method outside of the PropertyValue(s) mechanism.
registerPrototype(String, Class) - Method in class org.springframework.context.support.StaticApplicationContext
Register a prototype bean with the underlying bean factory.
registerPrototype(String, Class, MutablePropertyValues) - Method in class org.springframework.context.support.StaticApplicationContext
Register a prototype bean with the underlying bean factory.
registerPublicParameter(String) - Method in class org.springframework.mock.web.portlet.MockPortletRequest
registerRequestDestructionCallback(String, Runnable) - Method in class org.springframework.web.context.request.AbstractRequestAttributes
Register the given callback as to be executed after request completion.
registerResolvableDependency(Class, Object) - Method in interface org.springframework.beans.factory.config.ConfigurableListableBeanFactory
Register a special dependency type with corresponding autowired value.
registerResolvableDependency(Class, Object) - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
registerScope(String, Scope) - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Register the given scope, backed by the given Scope implementation.
registerScope(String, Scope) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
registerScope(Class, String) - Method in class org.springframework.context.annotation.Jsr330ScopeMetadataResolver
Register an extended JSR-330 scope annotation, mapping it onto a specific Spring scope by name.
registerScope(String, String) - Method in class org.springframework.context.annotation.Jsr330ScopeMetadataResolver
Register an extended JSR-330 scope annotation, mapping it onto a specific Spring scope by name.
registerScriptFactoryPostProcessorIfNecessary(BeanDefinitionRegistry) - Static method in class org.springframework.scripting.config.LangNamespaceUtils
Register a ScriptFactoryPostProcessor bean definition in the supplied BeanDefinitionRegistry if the ScriptFactoryPostProcessor hasn't already been registered.
registerSessionDestructionCallback(String, Runnable) - Method in class org.springframework.web.context.request.ServletRequestAttributes
Register the given callback as to be executed after session termination.
registerSessionDestructionCallback(String, Runnable) - Method in class org.springframework.web.portlet.context.PortletRequestAttributes
Register the given callback as to be executed after session termination.
registerSharedEditor(Class, PropertyEditor) - Method in class org.springframework.beans.PropertyEditorRegistrySupport
Deprecated. as of Spring 3.0, in favor of PropertyEditorRegistrars or ConversionService usage
registerShutdownHook() - Method in interface org.springframework.context.ConfigurableApplicationContext
Register a shutdown hook with the JVM runtime, closing this context on JVM shutdown unless it has already been closed at that time.
registerShutdownHook() - Method in class org.springframework.context.support.AbstractApplicationContext
Register a shutdown hook with the JVM runtime, closing this context on JVM shutdown unless it has already been closed at that time.
registerSingleton(String, Object) - Method in interface org.springframework.beans.factory.config.SingletonBeanRegistry
Register the given existing object as singleton in the bean registry, under the given bean name.
registerSingleton(String, Object) - Method in class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
registerSingleton(String, Class) - Method in class org.springframework.context.support.StaticApplicationContext
Register a singleton bean with the underlying bean factory.
registerSingleton(String, Class, MutablePropertyValues) - Method in class org.springframework.context.support.StaticApplicationContext
Register a singleton bean with the underlying bean factory.
registerSqlType(String, int) - Method in class org.springframework.jdbc.core.namedparam.AbstractSqlParameterSource
Register a SQL type for the given parameter.
registerSynchronization(Synchronization) - Method in class org.springframework.transaction.jta.ManagedTransactionAdapter
registerSynchronization(TransactionSynchronization) - Static method in class org.springframework.transaction.support.TransactionSynchronizationManager
Register a new transaction synchronization for the current thread.
registerTasks(ScheduledExecutorTask[], ScheduledExecutorService) - Method in class org.springframework.scheduling.concurrent.ScheduledExecutorFactoryBean
Register the specified ScheduledExecutorTasks on the given ScheduledExecutorService.
registerTasks(ScheduledTimerTask[], Timer) - Method in class org.springframework.scheduling.timer.TimerFactoryBean
Deprecated. Register the specified ScheduledTimerTasks on the given Timer.
registerTestExecutionListeners(TestExecutionListener...) - Method in class org.springframework.test.context.TestContextManager
Register the supplied TestExecutionListeners by appending them to the set of listeners used by this TestContextManager.
registerTransactionSynchronization(LobCreator, TransactionManager) - Static method in class org.springframework.jdbc.support.lob.LobCreatorUtils
Register a transaction synchronization for closing the given LobCreator, preferring Spring transaction synchronization and falling back to plain JTA transaction synchronization.
registerTypeName(String, String) - Method in class org.springframework.jdbc.core.namedparam.AbstractSqlParameterSource
Register a SQL type for the given parameter.
registerWebApplicationScopes(ConfigurableListableBeanFactory) - Static method in class org.springframework.web.context.support.WebApplicationContextUtils
Register web-specific scopes ("request", "session", "globalSession") with the given BeanFactory, as used by the WebApplicationContext.
registerWebApplicationScopes(ConfigurableListableBeanFactory, ServletContext) - Static method in class org.springframework.web.context.support.WebApplicationContextUtils
Register web-specific scopes ("request", "session", "globalSession", "application") with the given BeanFactory, as used by the WebApplicationContext.
registerWithGeneratedName(AbstractBeanDefinition, BeanDefinitionRegistry) - Static method in class org.springframework.beans.factory.support.BeanDefinitionReaderUtils
Register the given bean definition with a generated name, unique within the given bean factory.
registerWithGeneratedName(BeanDefinition) - Method in class org.springframework.beans.factory.xml.XmlReaderContext
REGISTRATION_FAIL_ON_EXISTING - Static variable in class org.springframework.jmx.support.MBeanRegistrationSupport
Constant indicating that registration should fail when attempting to register an MBean under a name that already exists.
REGISTRATION_IGNORE_EXISTING - Static variable in class org.springframework.jmx.support.MBeanRegistrationSupport
Constant indicating that registration should ignore the affected MBean when attempting to register an MBean under a name that already exists.
REGISTRATION_REPLACE_EXISTING - Static variable in class org.springframework.jmx.support.MBeanRegistrationSupport
Constant indicating that registration should replace the affected MBean when attempting to register an MBean under a name that already exists.
reimplement(Object, Method, Object[]) - Method in interface org.springframework.beans.factory.support.MethodReplacer
Reimplement the given method.
REINJECT_DEPENDENCIES_ATTRIBUTE - Static variable in class org.springframework.test.context.support.DependencyInjectionTestExecutionListener
Attribute name for a TestContext attribute which indicates whether or not the dependencies of a test instance should be reinjected in beforeTestMethod().
reject(String, Object[], String) - Method in class org.springframework.validation.AbstractBindingResult
reject(String) - Method in class org.springframework.validation.AbstractErrors
reject(String, String) - Method in class org.springframework.validation.AbstractErrors
reject(String) - Method in exception org.springframework.validation.BindException
reject(String, String) - Method in exception org.springframework.validation.BindException
reject(String, Object[], String) - Method in exception org.springframework.validation.BindException
reject(String) - Method in interface org.springframework.validation.Errors
Register a global error for the entire target object, using the given error description.
reject(String, String) - Method in interface org.springframework.validation.Errors
Register a global error for the entire target object, using the given error description.
reject(String, Object[], String) - Method in interface org.springframework.validation.Errors
Register a global error for the entire target object, using the given error description.
reject(String) - Method in class org.springframework.web.bind.EscapedErrors
reject(String, String) - Method in class org.springframework.web.bind.EscapedErrors
reject(String, Object[], String) - Method in class org.springframework.web.bind.EscapedErrors
rejectIfEmpty(Errors, String, String) - Static method in class org.springframework.validation.ValidationUtils
Reject the given field with the given error code if the value is empty.
rejectIfEmpty(Errors, String, String, String) - Static method in class org.springframework.validation.ValidationUtils
Reject the given field with the given error code and default message if the value is empty.
rejectIfEmpty(Errors, String, String, Object[]) - Static method in class org.springframework.validation.ValidationUtils
Reject the given field with the given error codea nd error arguments if the value is empty.
rejectIfEmpty(Errors, String, String, Object[], String) - Static method in class org.springframework.validation.ValidationUtils
Reject the given field with the given error code, error arguments and default message if the value is empty.
rejectIfEmptyOrWhitespace(Errors, String, String) - Static method in class org.springframework.validation.ValidationUtils
Reject the given field with the given error code if the value is empty or just contains whitespace.
rejectIfEmptyOrWhitespace(Errors, String, String, String) - Static method in class org.springframework.validation.ValidationUtils
Reject the given field with the given error code and default message if the value is empty or just contains whitespace.
rejectIfEmptyOrWhitespace(Errors, String, String, Object[]) - Static method in class org.springframework.validation.ValidationUtils
Reject the given field with the given error code and error arguments if the value is empty or just contains whitespace.
rejectIfEmptyOrWhitespace(Errors, String, String, Object[], String) - Static method in class org.springframework.validation.ValidationUtils
Reject the given field with the given error code, error arguments and default message if the value is empty or just contains whitespace.
rejectValue(String, String, Object[], String) - Method in class org.springframework.validation.AbstractBindingResult
rejectValue(String, String) - Method in class org.springframework.validation.AbstractErrors
rejectValue(String, String, String) - Method in class org.springframework.validation.AbstractErrors
rejectValue(String, String) - Method in exception org.springframework.validation.BindException
rejectValue(String, String, String) - Method in exception org.springframework.validation.BindException
rejectValue(String, String, Object[], String) - Method in exception org.springframework.validation.BindException
rejectValue(String, String) - Method in interface org.springframework.validation.Errors
Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description.
rejectValue(String, String, String) - Method in interface org.springframework.validation.Errors
Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description.
rejectValue(String, String, Object[], String) - Method in interface org.springframework.validation.Errors
Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description.
rejectValue(String, String) - Method in class org.springframework.web.bind.EscapedErrors
rejectValue(String, String, String) - Method in class org.springframework.web.bind.EscapedErrors
rejectValue(String, String, Object[], String) - Method in class org.springframework.web.bind.EscapedErrors
relative(int) - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
relative(int) - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Moves the cursor a relative number f rows, either positive or negative.
release() - Method in interface org.springframework.beans.factory.access.BeanFactoryReference
Indicate that the BeanFactory instance referred to by this object is not needed any longer by the client code which obtained the BeanFactoryReference.
release() - Method in class org.springframework.context.access.ContextBeanFactoryReference
release() - Method in class org.springframework.jca.endpoint.AbstractMessageEndpointFactory.AbstractMessageEndpoint
release() - Method in class org.springframework.jca.work.DelegatingWork
This implementation is empty, since we expect the Runnable to terminate based on some specific shutdown signal.
release() - Method in class org.springframework.mock.web.MockPageContext
release() - Method in class org.springframework.scheduling.commonj.DelegatingWork
This implementation is empty, since we expect the Runnable to terminate based on some specific shutdown signal.
releaseBean(InvocationContext) - Method in class org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor
Release the factory which has been used for autowiring the target bean.
releaseConnection(Connection, ConnectionFactory) - Static method in class org.springframework.jca.cci.connection.ConnectionFactoryUtils
Close the given Connection, obtained from the given ConnectionFactory, if it is not managed externally (that is, not bound to the thread).
releaseConnection(Connection) - Method in class org.springframework.jca.cci.core.support.CciDaoSupport
Close the given CCI Connection, created via this bean's ConnectionFactory, if it isn't bound to the thread.
releaseConnection(Connection) - Method in class org.springframework.jdbc.core.support.JdbcDaoSupport
Close the given JDBC Connection, created via this DAO's DataSource, if it isn't bound to the thread.
releaseConnection(Connection) - Method in interface org.springframework.jdbc.datasource.ConnectionHandle
Release the JDBC Connection that this handle refers to.
releaseConnection(Connection, DataSource) - Static method in class org.springframework.jdbc.datasource.DataSourceUtils
Close the given Connection, obtained from the given DataSource, if it is not managed externally (that is, not bound to the thread).
releaseConnection(Connection) - Method in class org.springframework.jdbc.datasource.SimpleConnectionHandle
This implementation is empty, as we're using a standard Connection handle that does not have to be released.
releaseConnection(Connection, ConnectionFactory, boolean) - Static method in class org.springframework.jms.connection.ConnectionFactoryUtils
Release the given Connection, stopping it (if necessary) and eventually closing it.
releaseContext(Context) - Method in class org.springframework.jndi.JndiTemplate
Release a JNDI context as obtained from JndiTemplate.getContext().
released() - Method in class org.springframework.jdbc.datasource.ConnectionHolder
Releases the current Connection held by this ConnectionHolder.
released() - Method in class org.springframework.transaction.support.ResourceHolderSupport
Decrease the reference count by one because the holder has been released (i.e.
released() - Method in interface org.springframework.util.WeakReferenceMonitor.ReleaseListener
This callback method is invoked once the associated handle has been released, i.e.
releaseHeldSavepoint() - Method in class org.springframework.transaction.support.AbstractTransactionStatus
Release the savepoint that is held for the transaction.
releaseJdbcConnection(ConnectionHandle, PersistenceManager) - Method in class org.springframework.orm.jdo.DefaultJdoDialect
This implementation does nothing, assuming that the Connection will implicitly be closed with the PersistenceManager.
releaseJdbcConnection(ConnectionHandle, PersistenceManager) - Method in interface org.springframework.orm.jdo.JdoDialect
Release the given JDBC Connection, which has originally been retrieved via getJdbcConnection.
releaseJdbcConnection(ConnectionHandle, EntityManager) - Method in class org.springframework.orm.jpa.DefaultJpaDialect
This implementation does nothing, assuming that the Connection will implicitly be closed with the EntityManager.
releaseJdbcConnection(ConnectionHandle, EntityManager) - Method in interface org.springframework.orm.jpa.JpaDialect
Release the given JDBC Connection, which has originally been retrieved via getJdbcConnection.
releasePersistenceManager(PersistenceManager, PersistenceManagerFactory) - Static method in class org.springframework.orm.jdo.PersistenceManagerFactoryUtils
Close the given PersistenceManager, created via the given factory, if it is not managed externally (i.e.
releasePersistenceManager(PersistenceManager) - Method in class org.springframework.orm.jdo.support.JdoDaoSupport
Close the given JDO PersistenceManager, created via this DAO's PersistenceManagerFactory, if it isn't bound to the thread.
releaseResource(H, K) - Method in class org.springframework.transaction.support.ResourceHolderSynchronization
Release the given resource (after it has been unbound from the thread).
releaseResourcesAfterRead(Connection, Object) - Method in class org.springframework.jdbc.support.lob.OracleLobHandler
Release any LOB resources after read is complete.
releaseSavepoint(Object) - Method in class org.springframework.jdbc.datasource.JdbcTransactionObjectSupport
This implementation releases the given JDBC 3.0 Savepoint.
releaseSavepoint(Object) - Method in interface org.springframework.transaction.SavepointManager
Explicitly release the given savepoint.
releaseSavepoint(Object) - Method in class org.springframework.transaction.support.AbstractTransactionStatus
This implementation delegates to a SavepointManager for the underlying transaction, if possible.
releaseSession(Session, SessionFactory) - Static method in class org.springframework.orm.hibernate3.SessionFactoryUtils
Close the given Session, created via the given factory, if it is not managed externally (i.e.
releaseSession(Session) - Method in class org.springframework.orm.hibernate3.support.HibernateDaoSupport
Close the given Hibernate Session, created via this DAO's SessionFactory, if it isn't bound to the thread (i.e.
releaseSessionBeanInstance(EJBLocalObject) - Method in class org.springframework.ejb.access.LocalSlsbInvokerInterceptor
Release the given EJB instance.
releaseSessionBeanInstance(EJBObject) - Method in class org.springframework.ejb.access.SimpleRemoteSlsbInvokerInterceptor
Release the given EJB instance.
releaseTarget(Object) - Method in class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
releaseTarget(Object) - Method in class org.springframework.aop.target.AbstractLazyCreationTargetSource
releaseTarget(Object) - Method in class org.springframework.aop.target.AbstractPoolingTargetSource
Return the given object to the pool.
releaseTarget(Object) - Method in class org.springframework.aop.target.CommonsPoolTargetSource
Returns the specified object to the underlying ObjectPool.
releaseTarget(Object) - Method in class org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource
No need to release target.
releaseTarget(Object) - Method in class org.springframework.aop.target.EmptyTargetSource
Nothing to release.
releaseTarget(Object) - Method in class org.springframework.aop.target.HotSwappableTargetSource
releaseTarget(Object) - Method in class org.springframework.aop.target.PrototypeTargetSource
Destroy the given independent instance.
releaseTarget(Object) - Method in class org.springframework.aop.target.SingletonTargetSource
releaseTarget(Object) - Method in interface org.springframework.aop.TargetSource
Release the given target object obtained from the TargetSource.getTarget() method.
releaseTarget(Object) - Method in class org.springframework.jndi.JndiObjectTargetSource
ReloadableResourceBundleMessageSource - Class in org.springframework.context.support
MessageSource implementation that accesses resource bundles using specified basenames.
ReloadableResourceBundleMessageSource() - Constructor for class org.springframework.context.support.ReloadableResourceBundleMessageSource
ReloadableResourceBundleMessageSource.PropertiesHolder - Class in org.springframework.context.support
PropertiesHolder for caching.
ReloadableResourceBundleMessageSource.PropertiesHolder(Properties, long) - Constructor for class org.springframework.context.support.ReloadableResourceBundleMessageSource.PropertiesHolder
ReloadableResourceBundleMessageSource.PropertiesHolder() - Constructor for class org.springframework.context.support.ReloadableResourceBundleMessageSource.PropertiesHolder
RemoteAccessException - Exception in org.springframework.remoting
Generic remote access exception.
RemoteAccessException(String) - Constructor for exception org.springframework.remoting.RemoteAccessException
Constructor for RemoteAccessException.
RemoteAccessException(String, Throwable) - Constructor for exception org.springframework.remoting.RemoteAccessException
Constructor for RemoteAccessException.
RemoteAccessor - Class in org.springframework.remoting.support
Abstract base class for classes that access a remote service.
RemoteAccessor() - Constructor for class org.springframework.remoting.support.RemoteAccessor
RemoteConnectFailureException - Exception in org.springframework.remoting
RemoteAccessException subclass to be thrown when no connection could be established with a remote service.
RemoteConnectFailureException(String, Throwable) - Constructor for exception org.springframework.remoting.RemoteConnectFailureException
Constructor for RemoteConnectFailureException.
RemoteExporter - Class in org.springframework.remoting.support
Abstract base class for classes that export a remote service.
RemoteExporter() - Constructor for class org.springframework.remoting.support.RemoteExporter
RemoteInvocation - Class in org.springframework.remoting.support
Encapsulates a remote invocation, providing core method invocation properties in a serializable fashion.
RemoteInvocation() - Constructor for class org.springframework.remoting.support.RemoteInvocation
Create a new RemoteInvocation for use as JavaBean.
RemoteInvocation(String, Class[], Object[]) - Constructor for class org.springframework.remoting.support.RemoteInvocation
Create a new RemoteInvocation for the given parameters.
RemoteInvocation(MethodInvocation) - Constructor for class org.springframework.remoting.support.RemoteInvocation
Create a new RemoteInvocation for the given AOP method invocation.
RemoteInvocationBasedAccessor - Class in org.springframework.remoting.support
Abstract base class for remote service accessors that are based on serialization of RemoteInvocation objects.
RemoteInvocationBasedAccessor() - Constructor for class org.springframework.remoting.support.RemoteInvocationBasedAccessor
RemoteInvocationBasedExporter - Class in org.springframework.remoting.support
Abstract base class for remote service exporters that are based on deserialization of RemoteInvocation objects.
RemoteInvocationBasedExporter() - Constructor for class org.springframework.remoting.support.RemoteInvocationBasedExporter
RemoteInvocationExecutor - Interface in org.springframework.remoting.support
Strategy interface for executing a RemoteInvocation on a target object.
RemoteInvocationFactory - Interface in org.springframework.remoting.support
Strategy interface for creating a RemoteInvocation from an AOP Alliance MethodInvocation.
RemoteInvocationFailureException - Exception in org.springframework.remoting
RemoteAccessException subclass to be thrown when the execution of the target method failed on the server side, for example when a method was not found on the target object.
RemoteInvocationFailureException(String, Throwable) - Constructor for exception org.springframework.remoting.RemoteInvocationFailureException
Constructor for RemoteInvocationFailureException.
RemoteInvocationResult - Class in org.springframework.remoting.support
Encapsulates a remote invocation result, holding a result value or an exception.
RemoteInvocationResult(Object) - Constructor for class org.springframework.remoting.support.RemoteInvocationResult
Create a new RemoteInvocationResult for the given result value.
RemoteInvocationResult(Throwable) - Constructor for class org.springframework.remoting.support.RemoteInvocationResult
Create a new RemoteInvocationResult for the given exception.
RemoteInvocationSerializingExporter - Class in org.springframework.remoting.rmi
Abstract base class for remote service exporters that explicitly deserialize RemoteInvocation objects and serialize RemoteInvocationResult objects, for example Spring's HTTP invoker.
RemoteInvocationSerializingExporter() - Constructor for class org.springframework.remoting.rmi.RemoteInvocationSerializingExporter
RemoteInvocationTraceInterceptor - Class in org.springframework.remoting.support
AOP Alliance MethodInterceptor for tracing remote invocations.
RemoteInvocationTraceInterceptor() - Constructor for class org.springframework.remoting.support.RemoteInvocationTraceInterceptor
Create a new RemoteInvocationTraceInterceptor.
RemoteInvocationTraceInterceptor(String) - Constructor for class org.springframework.remoting.support.RemoteInvocationTraceInterceptor
Create a new RemoteInvocationTraceInterceptor.
RemoteInvocationUtils - Class in org.springframework.remoting.support
General utilities for handling remote invocations.
RemoteInvocationUtils() - Constructor for class org.springframework.remoting.support.RemoteInvocationUtils
RemoteLookupFailureException - Exception in org.springframework.remoting
RemoteAccessException subclass to be thrown in case of a lookup failure, typically if the lookup happens on demand for each method invocation.
RemoteLookupFailureException(String) - Constructor for exception org.springframework.remoting.RemoteLookupFailureException
Constructor for RemoteLookupFailureException.
RemoteLookupFailureException(String, Throwable) - Constructor for exception org.springframework.remoting.RemoteLookupFailureException
Constructor for RemoteLookupFailureException.
RemoteProxyFailureException - Exception in org.springframework.remoting
RemoteAccessException subclass to be thrown in case of a failure within the client-side proxy for a remote service, for example when a method was not found on the underlying RMI stub.
RemoteProxyFailureException(String, Throwable) - Constructor for exception org.springframework.remoting.RemoteProxyFailureException
Constructor for RemoteProxyFailureException.
RemotingSupport - Class in org.springframework.remoting.support
Generic support base class for remote accessor and exporters, providing common bean ClassLoader handling.
RemotingSupport() - Constructor for class org.springframework.remoting.support.RemotingSupport
remove(String) - Method in interface org.springframework.beans.factory.config.Scope
Remove the object with the given name from the underlying scope.
remove(String) - Method in class org.springframework.context.support.SimpleThreadScope
remove(Object, Object) - Method in interface org.springframework.core.ConcurrentMap
Deprecated.
remove(Object) - Method in class org.springframework.http.HttpHeaders
remove(Object) - Method in interface org.springframework.orm.jpa.JpaOperations
remove(Object) - Method in class org.springframework.orm.jpa.JpaTemplate
remove(int) - Method in class org.springframework.util.AutoPopulatingList
remove(Object) - Method in class org.springframework.util.AutoPopulatingList
remove(Object) - Method in class org.springframework.util.CachingMapDecorator
remove() - Method in class org.springframework.util.CompositeIterator
remove(Object) - Method in class org.springframework.util.LinkedCaseInsensitiveMap
remove(Object) - Method in class org.springframework.util.LinkedMultiValueMap
remove(String) - Method in class org.springframework.web.context.request.AbstractRequestAttributesScope
remove(String) - Method in class org.springframework.web.context.request.SessionScope
remove(String) - Method in class org.springframework.web.context.support.ServletContextScope
remove(String) - Method in class org.springframework.web.portlet.context.PortletContextScope
removeAdvice(Advice) - Method in interface org.springframework.aop.framework.Advised
Remove the Advisor containing the given advice.
removeAdvice(Advice) - Method in class org.springframework.aop.framework.AdvisedSupport
removeAdvisor(Advisor) - Method in interface org.springframework.aop.framework.Advised
Remove the given advisor.
removeAdvisor(int) - Method in interface org.springframework.aop.framework.Advised
Remove the advisor at the given index.
removeAdvisor(Advisor) - Method in class org.springframework.aop.framework.AdvisedSupport
removeAdvisor(int) - Method in class org.springframework.aop.framework.AdvisedSupport
removeAlias(String) - Method in class org.springframework.context.support.GenericApplicationContext
removeAlias(String) - Method in interface org.springframework.core.AliasRegistry
Remove the specified alias from this registry.
removeAlias(String) - Method in class org.springframework.core.SimpleAliasRegistry
removeAll(Collection<?>) - Method in class org.springframework.util.AutoPopulatingList
removeAllListeners() - Method in class org.springframework.context.event.AbstractApplicationEventMulticaster
removeAllListeners() - Method in interface org.springframework.context.event.ApplicationEventMulticaster
Remove all listeners registered with this multicaster.
removeAllParameters() - Method in class org.springframework.mock.web.MockHttpServletRequest
Removes all existing parameters.
removeApplicationListener(ApplicationListener) - Method in class org.springframework.context.event.AbstractApplicationEventMulticaster
removeApplicationListener(ApplicationListener) - Method in interface org.springframework.context.event.ApplicationEventMulticaster
Remove a listener from the notification list.
removeApplicationListenerBean(String) - Method in class org.springframework.context.event.AbstractApplicationEventMulticaster
removeApplicationListenerBean(String) - Method in interface org.springframework.context.event.ApplicationEventMulticaster
Remove a listener bean from the notification list.
removeAttribute(String) - Method in class org.springframework.beans.BeanMetadataAttributeAccessor
removeAttribute(String) - Method in interface org.springframework.core.AttributeAccessor
Remove the attribute identified by name and return its value.
removeAttribute(String) - Method in class org.springframework.core.AttributeAccessorSupport
removeAttribute(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
removeAttribute(String) - Method in class org.springframework.mock.web.MockHttpSession
removeAttribute(String) - Method in class org.springframework.mock.web.MockPageContext
removeAttribute(String, int) - Method in class org.springframework.mock.web.MockPageContext
removeAttribute(String) - Method in class org.springframework.mock.web.MockServletContext
removeAttribute(String) - Method in class org.springframework.mock.web.portlet.MockPortletContext
removeAttribute(String) - Method in class org.springframework.mock.web.portlet.MockPortletRequest
removeAttribute(String) - Method in class org.springframework.mock.web.portlet.MockPortletSession
removeAttribute(String, int) - Method in class org.springframework.mock.web.portlet.MockPortletSession
removeAttribute(String) - Method in class org.springframework.mock.web.portlet.ServletWrappingPortletContext
removeAttribute(String, int) - Method in class org.springframework.web.context.request.FacesRequestAttributes
removeAttribute(String, int) - Method in interface org.springframework.web.context.request.RequestAttributes
Remove the scoped attribute of the given name, if it exists.
removeAttribute(String, int) - Method in class org.springframework.web.context.request.ServletRequestAttributes
removeAttribute(String, int) - Method in class org.springframework.web.portlet.context.PortletRequestAttributes
removeAttributes() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementBodyTag
Called by AbstractHtmlElementBodyTag.doFinally() allowing subclasses to remove any attributes from the PageContext as needed.
removeAttributes() - Method in class org.springframework.web.servlet.tags.form.ErrorsTag
Removes any bind status error messages that were previously stored under this key in the PageContext.PAGE_SCOPE.
removeAttributes() - Method in class org.springframework.web.servlet.tags.form.OptionTag
removeBeanDefinition(String) - Method in interface org.springframework.beans.factory.support.BeanDefinitionRegistry
Remove the BeanDefinition for the given name.
removeBeanDefinition(String) - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
removeBeanDefinition(String) - Method in class org.springframework.beans.factory.support.SimpleBeanDefinitionRegistry
removeBeanDefinition(String) - Method in class org.springframework.context.support.GenericApplicationContext
removeBinding(String) - Method in class org.springframework.util.xml.SimpleNamespaceContext
Removes the given prefix from this context.
removeConnectionSpecFromCurrentThread() - Method in class org.springframework.jca.cci.connection.ConnectionSpecConnectionFactoryAdapter
Remove any ConnectionSpec for this proxy from the current thread.
removeConstructorResolver(ConstructorResolver) - Method in class org.springframework.expression.spel.support.StandardEvaluationContext
removeConvertible(Class<?>, Class<?>) - Method in interface org.springframework.core.convert.converter.ConverterRegistry
Remove any converters from sourceType to targetType.
removeConvertible(Class<?>, Class<?>) - Method in class org.springframework.core.convert.support.GenericConversionService
removeCookie(HttpServletResponse) - Method in class org.springframework.web.util.CookieGenerator
Remove the cookie that this generator describes from the response.
removeCredentialsFromCurrentThread() - Method in class org.springframework.jdbc.datasource.UserCredentialsDataSourceAdapter
Remove any user credentials for this proxy from the current thread.
removeCredentialsFromCurrentThread() - Method in class org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter
Remove any user credentials for this proxy from the current thread.
removeDuplicateStrings(String[]) - Static method in class org.springframework.util.StringUtils
Remove duplicate Strings from the given array.
removeFromCache(String) - Method in interface org.springframework.jms.support.destination.CachingDestinationResolver
Remove the destination with the given name from the cache (if cached by this resolver in the first place).
removeFromCache(String) - Method in class org.springframework.jms.support.destination.JndiDestinationResolver
removeFromCache(String, Locale) - Method in class org.springframework.web.servlet.view.AbstractCachingViewResolver
Provides functionality to clear the cache for a certain view.
removeFromEnvironment(String) - Method in class org.springframework.mock.jndi.SimpleNamingContext
removeFromScope() - Method in class org.springframework.aop.scope.DefaultScopedObject
removeFromScope() - Method in interface org.springframework.aop.scope.ScopedObject
Remove this object from its target scope, for example from the backing session.
removeImport(String) - Method in class org.springframework.expression.spel.support.StandardTypeLocator
removeInterface(Class) - Method in class org.springframework.aop.framework.AdvisedSupport
Remove a proxied interface.
removeListener(AdvisedSupportListener) - Method in class org.springframework.aop.framework.ProxyCreatorSupport
Remove the given AdvisedSupportListener from this proxy configuration.
removeMethodResolver(MethodResolver) - Method in class org.springframework.expression.spel.support.StandardEvaluationContext
removeParameter(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
Remove already registered values for the specified HTTP parameter, if any.
removePropertyAccessor(PropertyAccessor) - Method in class org.springframework.expression.spel.support.StandardEvaluationContext
removePropertyValue(PropertyValue) - Method in class org.springframework.beans.MutablePropertyValues
Remove the given PropertyValue, if contained.
removePropertyValue(String) - Method in class org.springframework.beans.MutablePropertyValues
Overloaded version of removePropertyValue that takes a property name.
removePublicRenderParameter(String) - Method in class org.springframework.mock.web.portlet.MockPortletURL
removePublicRenderParameter(String) - Method in class org.springframework.mock.web.portlet.MockStateAwareResponse
removeRequestDestructionCallback(String) - Method in class org.springframework.web.context.request.AbstractRequestAttributes
Remove the request destruction callback for the specified attribute, if any.
removeSession(Object) - Method in class org.springframework.orm.hibernate3.SessionHolder
removeSessionBeanInstance(EJBObject) - Method in class org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor
Remove the given EJB instance.
removeSessionBeanInstance(EJBLocalObject) - Method in class org.springframework.ejb.access.LocalSlsbInvokerInterceptor
Remove the given EJB instance.
removeSingleton(String) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Overridden to clear FactoryBean instance cache as well.
removeSingleton(String) - Method in class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
Remove the bean with the given name from the singleton cache of this factory, to be able to clean up eager registration of a singleton if creation failed.
removeSingleton(String) - Method in class org.springframework.beans.factory.support.FactoryBeanRegistrySupport
Overridden to clear the FactoryBean object cache as well.
removeSingletonIfCreatedForTypeCheckOnly(String) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Remove the singleton instance (if any) for the given bean name, but only if it hasn't been used for other purposes than type checking.
removeTransformers() - Method in class org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver
Remove all registered transformers, in inverse order of registration.
removeValue(String) - Method in class org.springframework.mock.web.MockHttpSession
removeWebAppRootSystemProperty(ServletContext) - Static method in class org.springframework.web.util.WebUtils
Remove the system property that points to the web app root directory.
rename(String, String) - Method in class org.springframework.mock.jndi.SimpleNamingContext
rename(Name, Name) - Method in class org.springframework.mock.jndi.SimpleNamingContext
render(JRExporter, JasperPrint, Writer) - Static method in class org.springframework.ui.jasperreports.JasperReportsUtils
Render the supplied JasperPrint instance using the supplied JRAbstractExporter instance and write the results to the supplied Writer.
render(JRExporter, JasperPrint, OutputStream) - Static method in class org.springframework.ui.jasperreports.JasperReportsUtils
Render the supplied JasperPrint instance using the supplied JRAbstractExporter instance and write the results to the supplied OutputStream.
render(ModelAndView, PortletRequest, MimeResponse) - Method in class org.springframework.web.portlet.DispatcherPortlet
Render the given ModelAndView.
render(ModelAndView, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.DispatcherServlet
Render the given ModelAndView.
render(Map<String, ?>, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.AbstractView
Prepares the view given the specified model, merging it with static attributes and a RequestContext attribute, if necessary.
render(Map<String, ?>, HttpServletRequest, HttpServletResponse) - Method in interface org.springframework.web.servlet.View
Render the view given the specified model.
renderAsCsv(JasperReport, Map, Object, Writer) - Static method in class org.springframework.ui.jasperreports.JasperReportsUtils
Render a report in CSV format using the supplied report data.
renderAsCsv(JasperReport, Map, Object, Writer, Map) - Static method in class org.springframework.ui.jasperreports.JasperReportsUtils
Render a report in CSV format using the supplied report data.
renderAsHtml(JasperReport, Map, Object, Writer) - Static method in class org.springframework.ui.jasperreports.JasperReportsUtils
Render a report in HTML format using the supplied report data.
renderAsHtml(JasperReport, Map, Object, Writer, Map) - Static method in class org.springframework.ui.jasperreports.JasperReportsUtils
Render a report in HTML format using the supplied report data.
renderAsPdf(JasperReport, Map, Object, OutputStream) - Static method in class org.springframework.ui.jasperreports.JasperReportsUtils
Render a report in PDF format using the supplied report data.
renderAsPdf(JasperReport, Map, Object, OutputStream, Map) - Static method in class org.springframework.ui.jasperreports.JasperReportsUtils
Render a report in PDF format using the supplied report data.
renderAsXls(JasperReport, Map, Object, OutputStream) - Static method in class org.springframework.ui.jasperreports.JasperReportsUtils
Render a report in XLS format using the supplied report data.
renderAsXls(JasperReport, Map, Object, OutputStream, Map) - Static method in class org.springframework.ui.jasperreports.JasperReportsUtils
Render a report in XLS format using the supplied report data.
renderCancel(RenderRequest, RenderResponse, Object, BindException) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Template method for the render phase of the cancel action of this wizard.
renderDefaultContent(TagWriter) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementBodyTag
renderDefaultContent(TagWriter) - Method in class org.springframework.web.servlet.tags.form.ErrorsTag
renderDefaultContent(TagWriter) - Method in class org.springframework.web.servlet.tags.form.OptionTag
renderDefaultMessage(String, Object[], Locale) - Method in class org.springframework.context.support.AbstractMessageSource
Render the given default message String.
renderDefaultMessage(String, Object[], Locale) - Method in class org.springframework.context.support.MessageSourceSupport
Render the given default message String.
renderFinish(RenderRequest, RenderResponse, Object, BindException) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Template method for the render phase of the finish action of this wizard.
renderFormSubmission(RenderRequest, RenderResponse, Object, BindException) - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Process render phase of form submission request.
renderFormSubmission(RenderRequest, RenderResponse, Object, BindException) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Apply wizard workflow: finish, cancel, page change.
renderFormSubmission(RenderRequest, RenderResponse, Object, BindException) - Method in class org.springframework.web.portlet.mvc.SimpleFormController
Deprecated. This implementation calls showForm in case of errors, and delegates to onSubmitRender's full version else.
renderFromBodyContent(BodyContent, TagWriter) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementBodyTag
Render the tag contents based on the supplied BodyContent.
renderFromBodyContent(BodyContent, TagWriter) - Method in class org.springframework.web.servlet.tags.form.OptionTag

renderFromBoolean(Boolean, TagWriter) - Method in class org.springframework.web.servlet.tags.form.AbstractCheckedElementTag
Render the 'input(checkbox)' with the supplied value, marking the 'input' element as 'checked' if the supplied Boolean is true.
renderFromValue(Object, TagWriter) - Method in class org.springframework.web.servlet.tags.form.AbstractCheckedElementTag
Render the 'input(checkbox)' with the supplied value, marking the 'input' element as 'checked' if the supplied value matches the bound value.
renderFromValue(Object, Object, TagWriter) - Method in class org.springframework.web.servlet.tags.form.AbstractCheckedElementTag
Render the 'input(checkbox)' with the supplied value, marking the 'input' element as 'checked' if the supplied value matches the bound value.
renderInvalidSubmit(RenderRequest, RenderResponse) - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Handle an invalid submit request, e.g.
renderInvalidSubmit(RenderRequest, RenderResponse) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Handle an invalid submit request, e.g.
RenderMapping - Annotation Type in org.springframework.web.portlet.bind.annotation
Annotation for mapping Portlet render requests onto handler methods.
renderMergedOutputModel(Map<String, Object>, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.AbstractTemplateView

renderMergedOutputModel(Map<String, Object>, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.AbstractView
Subclasses must implement this method to actually render the view.
renderMergedOutputModel(Map<String, Object>, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.document.AbstractExcelView
Renders the Excel view, given the specified model.
renderMergedOutputModel(Map<String, Object>, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.document.AbstractJExcelView
Renders the Excel view, given the specified model.
renderMergedOutputModel(Map<String, Object>, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.document.AbstractPdfStamperView

renderMergedOutputModel(Map<String, Object>, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.document.AbstractPdfView

renderMergedOutputModel(Map<String, Object>, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.feed.AbstractFeedView

renderMergedOutputModel(Map<String, Object>, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.InternalResourceView
Render the internal resource given the specified model.
renderMergedOutputModel(Map<String, Object>, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
Finds the report data to use for rendering the report and then invokes the AbstractJasperReportsView.renderReport(net.sf.jasperreports.engine.JasperPrint, java.util.Map, javax.servlet.http.HttpServletResponse) method that should be implemented by the subclass.
renderMergedOutputModel(Map<String, Object>, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.json.MappingJacksonJsonView

renderMergedOutputModel(Map<String, Object>, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.RedirectView
Convert model to request parameters and redirect to the given URL.
renderMergedOutputModel(Map<String, Object>, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.tiles2.TilesView

renderMergedOutputModel(Map, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.xml.MarshallingView

renderMergedOutputModel(Map<String, Object>, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.xslt.AbstractXsltView
Deprecated.
renderMergedOutputModel(Map<String, Object>, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.xslt.XsltView

renderMergedTemplateModel(Map<String, Object>, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.AbstractTemplateView
Subclasses must implement this method to actually render the view.
renderMergedTemplateModel(Map<String, Object>, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.freemarker.FreeMarkerView
Process the model map by merging it with the FreeMarker template.
renderMergedTemplateModel(Map<String, Object>, HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.velocity.VelocityView
Process the model map by merging it with the Velocity template.
renderReport(JasperPrint, Map<String, Object>, HttpServletResponse) - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsSingleFormatView
Perform rendering for a single Jasper Reports exporter, that is, for a pre-defined output format.
renderReport(JasperPrint, Map<String, Object>, HttpServletResponse) - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
Subclasses should implement this method to perform the actual rendering process.
renderReport(JasperPrint, Map<String, Object>, HttpServletResponse) - Method in class org.springframework.web.servlet.view.jasperreports.JasperReportsMultiFormatView
Locates the format key in the model using the configured discriminator key and uses this key to lookup the appropriate view class from the mappings.
renderReportUsingOutputStream(JRExporter, JasperPrint, HttpServletResponse) - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsSingleFormatView
We need to write binary output to the response OutputStream.
renderReportUsingWriter(JRExporter, JasperPrint, HttpServletResponse) - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsSingleFormatView
We need to write text to the response Writer.
renderView(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.ViewRendererServlet
Retrieve the View instance and model Map to render and trigger actual rendering.
Repeat - Annotation Type in org.springframework.test.annotation
Test annotation to indicate that a test method should be invoked repeatedly.
replace(Object, Object, Object) - Method in interface org.springframework.core.ConcurrentMap
Deprecated.
replace(Object, Object) - Method in interface org.springframework.core.ConcurrentMap
Deprecated.
replace(Object, Object, Object) - Method in class org.springframework.orm.hibernate3.support.AbstractLobType
This implementation returns the passed-in original as-is.
replace(String, String, String) - Static method in class org.springframework.util.StringUtils
Replace all occurences of a substring within a string with another string.
replaceAdvisor(Advisor, Advisor) - Method in interface org.springframework.aop.framework.Advised
Replace the given advisor.
replaceAdvisor(Advisor, Advisor) - Method in class org.springframework.aop.framework.AdvisedSupport

REPLACED_METHOD_ELEMENT - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate

ReplaceOverride - Class in org.springframework.beans.factory.support
Extension of MethodOverride that represents an arbitrary override of a method by the IoC container.
ReplaceOverride(String, String) - Constructor for class org.springframework.beans.factory.support.ReplaceOverride
Construct a new ReplaceOverride.
replacePlaceholders(String, MethodInvocation, Object, Throwable, long) - Method in class org.springframework.aop.interceptor.CustomizableTraceInterceptor
Replace the placeholders in the given message with the supplied values, or values derived from those supplied.
replacePlaceholders(String, Properties) - Method in class org.springframework.util.PropertyPlaceholderHelper
Replaces all placeholders of format ${name} with the corresponding property from the supplied Properties.
replacePlaceholders(String, PropertyPlaceholderHelper.PlaceholderResolver) - Method in class org.springframework.util.PropertyPlaceholderHelper
Replaces all placeholders of format ${name} with the value returned from the supplied PropertyPlaceholderHelper.PlaceholderResolver.
REPLACER_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate

replaceUriTemplateParams(String, List<Param>, Set<String>) - Method in class org.springframework.web.servlet.tags.UrlTag
Replace template markers in the URL matching available parameters.
replicate(Object, ReplicationMode) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Persist the state of the given detached instance according to the given replication mode, reusing the current identifier value.
replicate(String, Object, ReplicationMode) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Persist the state of the given detached instance according to the given replication mode, reusing the current identifier value.
replicate(Object, ReplicationMode) - Method in class org.springframework.orm.hibernate3.HibernateTemplate

replicate(String, Object, ReplicationMode) - Method in class org.springframework.orm.hibernate3.HibernateTemplate

Repository - Annotation Type in org.springframework.stereotype
Indicates that an annotated class is a "Repository" (or "DAO").
REQUEST_CONTEXT_PAGE_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.RequestContextAwareTag
PageContext attribute for page-level RequestContext instance.
REQUEST_TO_VIEW_NAME_TRANSLATOR_BEAN_NAME - Static variable in class org.springframework.web.servlet.DispatcherServlet
Well-known name for the RequestToViewNameTranslator object in the bean factory for this namespace.
RequestAttributes - Interface in org.springframework.web.context.request
Abstraction for accessing attribute objects associated with a request.
RequestBody - Annotation Type in org.springframework.web.bind.annotation
Annotation which indicates that a method parameter should be bound to the web request body.
RequestCallback - Interface in org.springframework.web.client
Callback interface for code that operates on a ClientHttpRequest.
requestCompleted() - Method in class org.springframework.web.context.request.AbstractRequestAttributes
Signal that the request has been completed.
RequestContext - Class in org.springframework.web.servlet.support
Context holder for request-specific state, like current web application context, current locale, current theme, and potential binding errors.
RequestContext(HttpServletRequest) - Constructor for class org.springframework.web.servlet.support.RequestContext
Create a new RequestContext for the given request, using the request attributes for Errors retrieval.
RequestContext(HttpServletRequest, ServletContext) - Constructor for class org.springframework.web.servlet.support.RequestContext
Create a new RequestContext for the given request, using the request attributes for Errors retrieval.
RequestContext(HttpServletRequest, Map<String, Object>) - Constructor for class org.springframework.web.servlet.support.RequestContext
Create a new RequestContext for the given request, using the given model attributes for Errors retrieval.
RequestContext(HttpServletRequest, HttpServletResponse, ServletContext, Map<String, Object>) - Constructor for class org.springframework.web.servlet.support.RequestContext
Create a new RequestContext for the given request, using the given model attributes for Errors retrieval.
RequestContext() - Constructor for class org.springframework.web.servlet.support.RequestContext
Default constructor for subclasses.
RequestContextAwareTag - Class in org.springframework.web.servlet.tags
Superclass for all tags that require a RequestContext.
RequestContextAwareTag() - Constructor for class org.springframework.web.servlet.tags.RequestContextAwareTag

RequestContextFilter - Class in org.springframework.web.filter
Servlet 2.3 Filter that exposes the request to the current thread, through both LocaleContextHolder and RequestContextHolder.
RequestContextFilter() - Constructor for class org.springframework.web.filter.RequestContextFilter

RequestContextHolder - Class in org.springframework.web.context.request
Holder class to expose the web request in the form of a thread-bound RequestAttributes object.
RequestContextHolder() - Constructor for class org.springframework.web.context.request.RequestContextHolder

RequestContextListener - Class in org.springframework.web.context.request
Servlet 2.4+ listener that exposes the request to the current thread, through both LocaleContextHolder and RequestContextHolder.
RequestContextListener() - Constructor for class org.springframework.web.context.request.RequestContextListener

RequestContextUtils - Class in org.springframework.web.servlet.support
Utility class for easy access to request-specific state which has been set by the DispatcherServlet.
RequestContextUtils() - Constructor for class org.springframework.web.servlet.support.RequestContextUtils

requestDestroyed(ServletRequestEvent) - Method in class org.springframework.web.context.request.RequestContextListener

requestDestructionCallbacks - Variable in class org.springframework.web.context.request.AbstractRequestAttributes
Map from attribute name String to destruction callback Runnable
requested() - Method in class org.springframework.transaction.support.ResourceHolderSupport
Increase the reference count by one because the holder has been requested (i.e.
RequestHandledEvent - Class in org.springframework.web.context.support
Event raised when a request is handled within an ApplicationContext.
RequestHandledEvent(Object, String, String, long) - Constructor for class org.springframework.web.context.support.RequestHandledEvent
Create a new RequestHandledEvent with session information.
RequestHandledEvent(Object, String, String, long, Throwable) - Constructor for class org.springframework.web.context.support.RequestHandledEvent
Create a new RequestHandledEvent with session information.
RequestHeader - Annotation Type in org.springframework.web.bind.annotation
Annotation which indicates that a method parameter should be bound to a web request header.
requestInitialized(ServletRequestEvent) - Method in class org.springframework.web.context.request.RequestContextListener

RequestMapping - Annotation Type in org.springframework.web.bind.annotation
Annotation for mapping web requests onto specific handler classes and/or handler methods.
RequestMethod - Enum in org.springframework.web.bind.annotation
Java 5 enumeration of HTTP request methods.
RequestParam - Annotation Type in org.springframework.web.bind.annotation
Annotation which indicates that a method parameter should be bound to a web request parameter.
RequestScope - Class in org.springframework.web.context.request
Request-backed Scope implementation.
RequestScope() - Constructor for class org.springframework.web.context.request.RequestScope

RequestToViewNameTranslator - Interface in org.springframework.web.servlet
Strategy interface for translating an incoming HttpServletRequest into a logical view name when no view name is explicitly supplied.
Required - Annotation Type in org.springframework.beans.factory.annotation
Marks a method (typically a JavaBean setter method) as being 'required': that is, the setter method must be configured to be dependency-injected with a value.
REQUIRED_ANNOTATION_PROCESSOR_BEAN_NAME - Static variable in class org.springframework.context.annotation.AnnotationConfigUtils
The bean name of the internally managed Required annotation processor.
RequiredAnnotationBeanPostProcessor - Class in org.springframework.beans.factory.annotation
BeanPostProcessor implementation that enforces required JavaBean properties to have been configured.
RequiredAnnotationBeanPostProcessor() - Constructor for class org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor

requiredContextClass() - Method in class org.springframework.context.support.ApplicationObjectSupport
Determine the context class that any context passed to setApplicationContext must be an instance of.
requiredSingleResult(Collection<T>) - Static method in class org.springframework.dao.support.DataAccessUtils
Return a single result object from the given Collection.
requiredUniqueResult(Collection<T>) - Static method in class org.springframework.dao.support.DataAccessUtils
Return a unique result object from the given Collection.
requiredViewClass() - Method in class org.springframework.web.servlet.view.AbstractTemplateViewResolver

requiredViewClass() - Method in class org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver
Requires FreeMarkerView.
requiredViewClass() - Method in class org.springframework.web.servlet.view.InternalResourceViewResolver
This resolver requires InternalResourceView.
requiredViewClass() - Method in class org.springframework.web.servlet.view.jasperreports.JasperReportsViewResolver
Requires the view class to be a subclass of AbstractJasperReportsView.
requiredViewClass() - Method in class org.springframework.web.servlet.view.tiles2.TilesViewResolver
Requires TilesView.
requiredViewClass() - Method in class org.springframework.web.servlet.view.UrlBasedViewResolver
Return the required type of view for this resolver.
requiredViewClass() - Method in class org.springframework.web.servlet.view.velocity.VelocityLayoutViewResolver
Requires VelocityLayoutView.
requiredViewClass() - Method in class org.springframework.web.servlet.view.velocity.VelocityViewResolver
Requires VelocityView.
requiredViewClass() - Method in class org.springframework.web.servlet.view.xslt.XsltViewResolver

requiresConfigInterface() - Method in class org.springframework.scripting.bsh.BshScriptFactory
BeanShell scripts do require a config interface.
requiresConfigInterface() - Method in class org.springframework.scripting.groovy.GroovyScriptFactory
Groovy scripts do not need a config interface, since they expose their setters as public methods.
requiresConfigInterface() - Method in class org.springframework.scripting.jruby.JRubyScriptFactory
JRuby scripts do require a config interface.
requiresConfigInterface() - Method in interface org.springframework.scripting.ScriptFactory
Return whether the script requires a config interface to be generated for it.
requiresDestruction(Object, RootBeanDefinition) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Determine whether the given bean requires destruction on shutdown.
requiresRefresh() - Method in class org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource
Determine whether a refresh is required.
requiresRefresh() - Method in class org.springframework.scripting.support.RefreshableScriptTargetSource
Determine whether a refresh is required through calling ScriptFactory's requiresScriptedObjectRefresh method.
requiresScriptedObjectRefresh(ScriptSource) - Method in class org.springframework.scripting.bsh.BshScriptFactory

requiresScriptedObjectRefresh(ScriptSource) - Method in class org.springframework.scripting.groovy.GroovyScriptFactory

requiresScriptedObjectRefresh(ScriptSource) - Method in class org.springframework.scripting.jruby.JRubyScriptFactory

requiresScriptedObjectRefresh(ScriptSource) - Method in interface org.springframework.scripting.ScriptFactory
Determine whether a refresh is required (e.g.
rescheduleTaskIfNecessary(Object) - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Take the given task object and reschedule it, either immediately if this container is currently running, or later once this container has been restarted.
reset() - Method in class org.springframework.jdbc.object.BatchSqlUpdate
Reset the statement parameter queue, the rows affected cache, and the execution count.
reset() - Method in class org.springframework.mock.web.MockHttpServletResponse

reset() - Method in class org.springframework.mock.web.portlet.MockMimeResponse

reset(String) - Method in class org.springframework.mock.web.portlet.MockPortletPreferences

reset() - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Reset the prepared service of this interceptor, allowing for reinitialization on next access.
reset() - Method in interface org.springframework.transaction.support.ResourceHolder
Reset the transactional state of this holder.
reset() - Method in class org.springframework.transaction.support.ResourceHolderSupport
Reset this resource holder - transactional state as well as reference count.
resetBeanDefinition(String) - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
Reset all bean definition caches for the given bean, including the caches of beans that are derived from it.
resetBuffer() - Method in class org.springframework.mock.web.MockHttpServletResponse

resetBuffer() - Method in class org.springframework.mock.web.portlet.MockMimeResponse

resetCachedTemplates() - Method in class org.springframework.web.servlet.view.xslt.AbstractXsltView
Deprecated. Reset the cached Templates object, if any.
resetConnection() - Method in class org.springframework.jca.cci.connection.SingleConnectionFactory
Reset the underlying shared Connection, to be reinitialized on next access.
resetConnection() - Method in class org.springframework.jdbc.datasource.SingleConnectionDataSource
Reset the underlying shared Connection, to be reinitialized on next access.
resetConnection() - Method in class org.springframework.jms.connection.CachingConnectionFactory
Resets the Session cache as well.
resetConnection() - Method in class org.springframework.jms.connection.SingleConnectionFactory
Reset the underlying shared Connection, to be reinitialized on next access.
resetConnectionAfterTransaction(Connection, Integer) - Static method in class org.springframework.jdbc.datasource.DataSourceUtils
Reset the given Connection after a transaction, regarding read-only flag and isolation level.
resetCount() - Method in class org.springframework.aop.interceptor.DebugInterceptor
Reset the invocation count to zero.
resetFilters(boolean) - Method in class org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider
Reset the configured type filters.
resetLocaleContext() - Static method in class org.springframework.context.i18n.LocaleContextHolder
Reset the LocaleContext for the current thread.
resetRequestAttributes() - Static method in class org.springframework.web.context.request.RequestContextHolder
Reset the RequestAttributes for the current thread.
resetThreadContextClassLoader(ClassLoader) - Method in class org.springframework.remoting.support.RemotingSupport
Reset the original thread context ClassLoader if necessary.
resolvableToString() - Method in class org.springframework.context.support.DefaultMessageSourceResolvable
Build a default String representation for this MessageSourceResolvable: including codes, arguments, and default message.
resolve(String) - Method in class org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver
Locate the NamespaceHandler for the supplied namespace URI from the configured mappings.
resolve(String) - Method in interface org.springframework.beans.factory.xml.NamespaceHandlerResolver
Resolve the namespace URI and return the located NamespaceHandler implementation.
resolve(EvaluationContext, String, Class<?>[]) - Method in interface org.springframework.expression.ConstructorResolver
Within the supplied context determine a suitable constructor on the supplied type that can handle the specified arguments.
resolve(EvaluationContext, Object, String, Class<?>[]) - Method in interface org.springframework.expression.MethodResolver
Within the supplied context determine a suitable method on the supplied object that can handle the specified arguments.
resolve(EvaluationContext, String, Class<?>[]) - Method in class org.springframework.expression.spel.support.ReflectiveConstructorResolver
Locate a constructor on the type.
resolve(EvaluationContext, Object, String, Class<?>[]) - Method in class org.springframework.expression.spel.support.ReflectiveMethodResolver
Locate a method on a type.
resolveAction() - Method in class org.springframework.web.servlet.tags.form.FormTag
Resolve the value of the 'action' attribute.
resolveAliases(StringValueResolver) - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Resolve all alias target names and aliases registered in this factory, applying the given StringValueResolver to them.
resolveAliases(StringValueResolver) - Method in class org.springframework.core.SimpleAliasRegistry
Resolve all alias target names and aliases registered in this factory, applying the given StringValueResolver to them.
resolveArgument(MethodParameter, NativeWebRequest) - Method in interface org.springframework.web.bind.support.WebArgumentResolver
Resolve an argument for the given handler method parameter within the given web request.
resolveArguments(Object[], Locale) - Method in class org.springframework.context.support.AbstractMessageSource
Searches through the given array of objects, finds any MessageSourceResolvable objects and resolves them.
resolveArguments(Object[], Locale) - Method in class org.springframework.context.support.MessageSourceSupport
Template method for resolving argument objects.
resolveArguments(Object) - Method in class org.springframework.web.servlet.tags.MessageTag
Resolve the given arguments Object into an arguments array.
resolveBasePackage(String) - Method in class org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider
Resolve the specified base package into a pattern specification for the package search path.
resolveBeanClass(ClassLoader) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Determine the class of the wrapped bean, resolving it from a specified class name if necessary.
resolveBeanClass(RootBeanDefinition, String, Class...) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Resolve the bean class for the specified bean definition, resolving a bean class name into a Class reference (if necessary) and storing the resolved Class in the bean definition for further use.
resolveBeforeInstantiation(String, RootBeanDefinition) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Apply before-instantiation post-processors, resolving whether there is a before-instantiation shortcut for the specified bean.
resolveClass(ObjectStreamClass) - Method in class org.springframework.core.ConfigurableObjectInputStream

resolveClassName(String) - Method in class org.springframework.beans.factory.config.MethodInvokingFactoryBean

resolveClassName(String) - Method in class org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean

resolveClassName(String) - Method in class org.springframework.scheduling.support.MethodInvokingRunnable

resolveClassName(String, ClassLoader) - Static method in class org.springframework.util.ClassUtils
Resolve the given class name into a Class instance.
resolveClassName(String) - Method in class org.springframework.util.MethodInvoker
Resolve the given class name into a Class.
resolveCode(String, Locale) - Method in class org.springframework.context.support.AbstractMessageSource
Subclasses must implement this method to resolve a message.
resolveCode(String, Locale) - Method in class org.springframework.context.support.ReloadableResourceBundleMessageSource
Resolves the given message code as key in the retrieved bundle files, using a cached MessageFormat instance per message code.
resolveCode(String, Locale) - Method in class org.springframework.context.support.ResourceBundleMessageSource
Resolves the given message code as key in the registered resource bundles, using a cached MessageFormat instance per message code.
resolveCode(String, Locale) - Method in class org.springframework.context.support.StaticMessageSource

resolveCodeWithoutArguments(String, Locale) - Method in class org.springframework.context.support.AbstractMessageSource
Subclasses can override this method to resolve a message without arguments in an optimized fashion, i.e.
resolveCodeWithoutArguments(String, Locale) - Method in class org.springframework.context.support.ReloadableResourceBundleMessageSource
Resolves the given message code as key in the retrieved bundle files, returning the value found in the bundle as-is (without MessageFormat parsing).
resolveCodeWithoutArguments(String, Locale) - Method in class org.springframework.context.support.ResourceBundleMessageSource
Resolves the given message code as key in the registered resource bundles, returning the value found in the bundle as-is (without MessageFormat parsing).
resolveCommonArgument(MethodParameter, NativeWebRequest) - Method in class org.springframework.web.bind.annotation.support.HandlerMethodInvoker

resolveCommonArgument(MethodParameter, NativeWebRequest, Exception) - Method in class org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver
Resolves common method arguments.
resolveCommonArgument(MethodParameter, NativeWebRequest, Exception) - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver
Resolves common method arguments.
resolveContextualObject(String) - Method in interface org.springframework.beans.factory.config.Scope
Resolve the contextual object for the given key, if any.
resolveContextualObject(String) - Method in class org.springframework.context.support.SimpleThreadScope

resolveContextualObject(String) - Method in class org.springframework.web.context.request.AbstractRequestAttributesScope

resolveContextualObject(String) - Method in class org.springframework.web.context.support.ServletContextScope

resolveContextualObject(String) - Method in class org.springframework.web.portlet.context.PortletContextScope

resolveCookieValue(String, Class, NativeWebRequest) - Method in class org.springframework.web.bind.annotation.support.HandlerMethodInvoker
Resolves the given @CookieValue annotation.
resolveCssClass() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Gets the appropriate CSS class to use based on the state of the current BindStatus object.
resolveCssClass() - Method in class org.springframework.web.servlet.tags.form.FormTag
Override resolve CSS class since error class is not supported.
resolveDefaultResponseDestination(Session) - Method in class org.springframework.jms.listener.adapter.MessageListenerAdapter
Resolve the default response destination into a JMS Destination, using this accessor's DestinationResolver in case of a destination name.
resolveDefaultValue(String) - Method in class org.springframework.web.bind.annotation.support.HandlerMethodInvoker

resolveDependency(DependencyDescriptor, String) - Method in interface org.springframework.beans.factory.config.AutowireCapableBeanFactory
Resolve the specified dependency against the beans defined in this factory.
resolveDependency(DependencyDescriptor, String, Set<String>, TypeConverter) - Method in interface org.springframework.beans.factory.config.AutowireCapableBeanFactory
Resolve the specified dependency against the beans defined in this factory.
resolveDependency(DependencyDescriptor, String) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory

resolveDependency(DependencyDescriptor, String, Set<String>, TypeConverter) - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory

resolveDestinationName(Session, String, boolean) - Method in class org.springframework.jms.support.destination.BeanFactoryDestinationResolver

resolveDestinationName(Session, String, boolean) - Method in interface org.springframework.jms.support.destination.DestinationResolver
Resolve the given destination name, either as located resource or as dynamic destination.
resolveDestinationName(Session, String, boolean) - Method in class org.springframework.jms.support.destination.DynamicDestinationResolver
Resolve the specified destination name as a dynamic destination.
resolveDestinationName(Session, String) - Method in class org.springframework.jms.support.destination.JmsDestinationAccessor
Resolve the given destination name into a JMS Destination, via this accessor's DestinationResolver.
resolveDestinationName(Session, String, boolean) - Method in class org.springframework.jms.support.destination.JndiDestinationResolver

resolveEmbeddedValue(String) - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Resolve the given embedded value, e.g.
resolveEmbeddedValue(String) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory

resolveEntity(String, String) - Method in class org.springframework.beans.factory.xml.BeansDtdResolver

resolveEntity(String, String) - Method in class org.springframework.beans.factory.xml.DelegatingEntityResolver

resolveEntity(String, String) - Method in class org.springframework.beans.factory.xml.PluggableSchemaResolver

resolveEntity(String, String) - Method in class org.springframework.beans.factory.xml.ResourceEntityResolver

resolveException(RenderRequest, RenderResponse, Object, Exception) - Method in class org.springframework.web.portlet.handler.AbstractHandlerExceptionResolver
Checks whether this resolver is supposed to apply (i.e.
resolveException(ResourceRequest, ResourceResponse, Object, Exception) - Method in class org.springframework.web.portlet.handler.AbstractHandlerExceptionResolver

resolveException(RenderRequest, RenderResponse, Object, Exception) - Method in interface org.springframework.web.portlet.HandlerExceptionResolver
Try to resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.
resolveException(ResourceRequest, ResourceResponse, Object, Exception) - Method in interface org.springframework.web.portlet.HandlerExceptionResolver
Try to resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.
resolveException(HttpServletRequest, HttpServletResponse, Object, Exception) - Method in class org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
Checks whether this resolver is supposed to apply (i.e.
resolveException(HttpServletRequest, HttpServletResponse, Object, Exception) - Method in interface org.springframework.web.servlet.HandlerExceptionResolver
Try to resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.
resolveFallbackIfPossible(String, ClassNotFoundException) - Method in class org.springframework.core.ConfigurableObjectInputStream
Resolve the given class name against a fallback class loader.
resolveFallbackIfPossible(String, ClassNotFoundException) - Method in class org.springframework.remoting.rmi.CodebaseAwareObjectInputStream

resolveFor() - Method in class org.springframework.web.servlet.tags.form.LabelTag
Determine the 'for' attribute value for this tag, autogenerating one if none specified.
resolveId(Element, AbstractBeanDefinition, ParserContext) - Method in class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
Resolve the ID for the supplied BeanDefinition.
resolveId(Element, AbstractBeanDefinition, ParserContext) - Method in class org.springframework.transaction.config.JtaTransactionManagerBeanDefinitionParser

resolveId() - Method in class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
Determine the 'id' attribute value for this tag, autogenerating one if none specified.
resolveId() - Method in class org.springframework.web.servlet.tags.form.AbstractMultiCheckedElementTag
Appends a counter to a specified id as well, since we're dealing with multiple HTML elements.
resolveId() - Method in class org.springframework.web.servlet.tags.form.OptionsTag
Appends a counter to a specified id, since we're dealing with multiple HTML elements.
resolveLocale(HttpServletRequest) - Method in class org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver

resolveLocale(HttpServletRequest) - Method in class org.springframework.web.servlet.i18n.CookieLocaleResolver

resolveLocale(HttpServletRequest) - Method in class org.springframework.web.servlet.i18n.FixedLocaleResolver

resolveLocale(HttpServletRequest) - Method in class org.springframework.web.servlet.i18n.SessionLocaleResolver

resolveLocale(HttpServletRequest) - Method in interface org.springframework.web.servlet.LocaleResolver
Resolve the current locale via the given request.
resolveLocale(TilesRequestContext) - Method in class org.springframework.web.servlet.view.tiles2.SpringLocaleResolver

resolveMessage() - Method in class org.springframework.web.servlet.tags.MessageTag
Resolve the specified message into a concrete message String.
resolveMessageCodes(String) - Method in class org.springframework.validation.AbstractBindingResult
Resolve the given error code into message codes.
resolveMessageCodes(String, String) - Method in class org.springframework.validation.AbstractBindingResult

resolveMessageCodes(String, String) - Method in exception org.springframework.validation.BindException

resolveMessageCodes(String, String) - Method in interface org.springframework.validation.BindingResult
Resolve the given error code into message codes for the given field.
resolveMessageCodes(String, String) - Method in class org.springframework.validation.DefaultMessageCodesResolver

resolveMessageCodes(String, String, String, Class) - Method in class org.springframework.validation.DefaultMessageCodesResolver
Build the code list for the given code and field: an object/field-specific code, a field-specific code, a plain error code.
resolveMessageCodes(String, String) - Method in interface org.springframework.validation.MessageCodesResolver
Build message codes for the given error code and object name.
resolveMessageCodes(String, String, String, Class) - Method in interface org.springframework.validation.MessageCodesResolver
Build message codes for the given error code and field specification.
resolveModelAndView(Method, Class, Object, ExtendedModelMap, NativeWebRequest) - Method in interface org.springframework.web.servlet.mvc.annotation.ModelAndViewResolver

resolveModelAttribute() - Method in class org.springframework.web.servlet.tags.form.FormTag
Resolves and returns the name of the form object.
resolveMultipart(HttpServletRequest) - Method in class org.springframework.web.multipart.commons.CommonsMultipartResolver

resolveMultipart(HttpServletRequest) - Method in interface org.springframework.web.multipart.MultipartResolver
Parse the given HTTP request into multipart files and parameters, and wrap the request inside a MultipartHttpServletRequest object that provides access to file descriptors and makes contained parameters accessible via the standard ServletRequest methods.
resolveMultipart(ActionRequest) - Method in class org.springframework.web.portlet.multipart.CommonsPortletMultipartResolver

resolveMultipart(ActionRequest) - Method in interface org.springframework.web.portlet.multipart.PortletMultipartResolver
Parse the given portlet request into multipart files and parameters, and wrap the request inside a MultipartActionRequest object that provides access to file descriptors and makes contained parameters accessible via the standard PortletRequest methods.
resolveOriginal(FacesContext, String) - Method in class org.springframework.web.jsf.DelegatingVariableResolver
Resolve the attribute via the original JSF VariableResolver.
resolveParameterType(MethodParameter, Class) - Static method in class org.springframework.core.GenericTypeResolver
Determine the target type for the given generic parameter type.
resolvePath(String) - Method in class org.springframework.context.support.AbstractRefreshableConfigApplicationContext
Resolve the given path, replacing placeholders with corresponding system property values if necessary.
resolvePath(String) - Method in class org.springframework.core.io.ResourceEditor
Resolve the given path, replacing placeholders with corresponding system property values if necessary.
resolvePath(String) - Method in class org.springframework.core.io.support.ResourceArrayPropertyEditor
Resolve the given path, replacing placeholders with corresponding system property values if necessary.
resolvePathVariable(String, Class, NativeWebRequest) - Method in class org.springframework.web.bind.annotation.support.HandlerMethodInvoker
Resolves the given @PathVariable annotation.
resolvePlaceholder(String, Properties) - Method in class org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer
This implementation tries to resolve placeholders as keys first in the user preferences, then in the system preferences, then in the passed-in properties.
resolvePlaceholder(String, String, Preferences) - Method in class org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer
Resolve the given path and key against the given Preferences.
resolvePlaceholder(String, Properties, int) - Method in class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
Resolve the given placeholder using the given properties, performing a system properties check according to the given mode.
resolvePlaceholder(String, Properties) - Method in class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
Resolve the given placeholder using the given properties.
resolvePlaceholder(String) - Method in interface org.springframework.util.PropertyPlaceholderHelper.PlaceholderResolver
Resolves the supplied placeholder name into the replacement value.
resolvePlaceholder(String, Properties) - Method in class org.springframework.web.context.support.ServletContextPropertyPlaceholderConfigurer

resolvePlaceholder(String, ServletContext, boolean) - Method in class org.springframework.web.context.support.ServletContextPropertyPlaceholderConfigurer
Resolves the given placeholder using the init parameters and optionally also the attributes of the given ServletContext.
resolvePlaceholders(String) - Static method in class org.springframework.util.SystemPropertyUtils
Resolve ${...} placeholders in the given text, replacing them with corresponding system property values.
resolvePlaceholders(String, boolean) - Static method in class org.springframework.util.SystemPropertyUtils
Resolve ${...} placeholders in the given text, replacing them with corresponding system property values.
resolvePrimitiveClassName(String) - Static method in class org.springframework.util.ClassUtils
Resolve the given class name as primitive class, if appropriate, according to the JVM's naming rules for primitive classes.
resolvePrimitiveIfNecessary(Class<?>) - Static method in class org.springframework.util.ClassUtils
Resolve the given class if it is a primitive class, returning the corresponding primitive wrapper type instead.
resolveProxyClass(String[]) - Method in class org.springframework.core.ConfigurableObjectInputStream

resolveQueue(Session) - Method in class org.springframework.jms.remoting.JmsInvokerClientInterceptor
Resolve this accessor's target queue.
resolveQueue(Session, String) - Method in class org.springframework.jms.support.destination.DynamicDestinationResolver
Resolve the given destination name to a Queue.
resolveQueueName(Session, String) - Method in class org.springframework.jms.remoting.JmsInvokerClientInterceptor
Resolve the given queue name into a JMS Queue, via this accessor's DestinationResolver.
resolveReference(String) - Method in class org.springframework.web.context.request.FacesRequestAttributes

resolveReference(String) - Method in interface org.springframework.web.context.request.RequestAttributes
Resolve the contextual reference for the given key, if any.
resolveReference(String) - Method in class org.springframework.web.context.request.ServletRequestAttributes

resolveReference(String) - Method in class org.springframework.web.portlet.context.PortletRequestAttributes

resolveRefreshCheckDelay(BeanDefinition) - Method in class org.springframework.scripting.support.ScriptFactoryPostProcessor
Get the refresh check delay for the given ScriptFactory BeanDefinition.
resolveRequestBody(MethodParameter, NativeWebRequest, Object) - Method in class org.springframework.web.bind.annotation.support.HandlerMethodInvoker
Resolves the given @RequestBody annotation.
resolveResponseStatus(ResponseStatus, HttpServletRequest, HttpServletResponse, Object, Exception) - Method in class org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver
Template method that handles @ResponseStatus annotation.
resolveReturnType(Method, Class) - Static method in class org.springframework.core.GenericTypeResolver
Determine the target type for the generic return type of the given method.
resolveRootDirResource(Resource) - Method in class org.springframework.core.io.support.PathMatchingResourcePatternResolver
Resolve the specified resource for path matching.
resolveScopeMetadata(BeanDefinition) - Method in class org.springframework.context.annotation.AnnotationScopeMetadataResolver

resolveScopeMetadata(BeanDefinition) - Method in class org.springframework.context.annotation.Jsr330ScopeMetadataResolver

resolveScopeMetadata(BeanDefinition) - Method in interface org.springframework.context.annotation.ScopeMetadataResolver
Resolve the ScopeMetadata appropriate to the supplied bean definition.
resolveScopeName(String) - Method in class org.springframework.context.annotation.Jsr330ScopeMetadataResolver
Resolve the given annotation type into a named Spring scope.
resolveSignature(String, Class<?>) - Static method in class org.springframework.beans.BeanUtils
Parse a method signature in the form methodName[([arg_list])], where arg_list is an optional, comma-separated list of fully-qualified type names, and attempts to resolve that signature against the supplied Class.
resolveSpecifiedDataSource(Object) - Method in class org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
Resolve the specified data source object into a DataSource instance.
resolveSpecifiedLookupKey(Object) - Method in class org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
Resolve the given lookup key object, as specified in the targetDataSources map, into the actual lookup key to be used for matching with the current lookup key.
resolveSpecifiedLookupKey(Object) - Method in class org.springframework.jdbc.datasource.lookup.IsolationLevelDataSourceRouter
Supports Integer values for the isolation level constants as well as isolation level names as defined on the TransactionDefinition interface.
resolveSpringBean(FacesContext, String) - Method in class org.springframework.web.jsf.DelegatingVariableResolver
Resolve the attribute as a Spring bean in the ApplicationContext.
resolveStandardArgument(Class, NativeWebRequest) - Method in class org.springframework.web.bind.annotation.support.HandlerMethodInvoker

resolveStandardArgument(Class, NativeWebRequest, Exception) - Method in class org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver
Resolves standard method arguments.
resolveStandardArgument(Class, NativeWebRequest, Exception) - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver
Resolves standard method arguments.
resolveStringValue(String) - Method in class org.springframework.beans.factory.config.BeanDefinitionVisitor
Resolve the given String value, for example parsing placeholders.
resolveStringValue(String) - Method in interface org.springframework.util.StringValueResolver
Resolve the given String value, for example parsing placeholders.
resolveSystemProperty(String) - Method in class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
Resolve the given key as JVM system property, and optionally also as system environment variable if no matching system property has been found.
resolveTargetType(ClassLoader) - Method in class org.springframework.beans.factory.config.TypedStringValue
Determine the type to convert to, resolving it from a specified class name if necessary.
resolveThemeName(HttpServletRequest) - Method in class org.springframework.web.servlet.theme.CookieThemeResolver

resolveThemeName(HttpServletRequest) - Method in class org.springframework.web.servlet.theme.FixedThemeResolver

resolveThemeName(HttpServletRequest) - Method in class org.springframework.web.servlet.theme.SessionThemeResolver

resolveThemeName(HttpServletRequest) - Method in interface org.springframework.web.servlet.ThemeResolver
Resolve the current theme name via the given request.
resolveTopic(Session, String) - Method in class org.springframework.jms.support.destination.DynamicDestinationResolver
Resolve the given destination name to a Topic.
resolveTypeArgument(Class, Class) - Static method in class org.springframework.core.GenericTypeResolver
Resolve the single type argument of the given generic interface against the given target class which is assumed to implement the generic interface and possibly declare a concrete type for its type variable.
resolveTypeArguments(Class, Class) - Static method in class org.springframework.core.GenericTypeResolver
Resolve the type arguments of the given generic interface against the given target class which is assumed to implement the generic interface and possibly declare concrete types for its type variables.
resolveValue(Object) - Method in class org.springframework.beans.factory.config.BeanDefinitionVisitor

resolveVariable(FacesContext, String) - Method in class org.springframework.web.jsf.DelegatingVariableResolver
Delegate to the original VariableResolver first, then try to resolve the variable as Spring bean in the root WebApplicationContext.
resolveVariable(FacesContext, String) - Method in class org.springframework.web.jsf.SpringBeanVariableResolver

resolveVariable(FacesContext, String) - Method in class org.springframework.web.jsf.WebApplicationContextVariableResolver
Check for the special "webApplicationContext" variable first, then delegate to the original VariableResolver.
resolveViewName(String, Map, PortletRequest) - Method in class org.springframework.web.portlet.DispatcherPortlet
Resolve the given view name into a View object (to be rendered).
resolveViewName(String, Map<String, Object>, Locale, HttpServletRequest) - Method in class org.springframework.web.servlet.DispatcherServlet
Resolve the given view name into a View object (to be rendered).
resolveViewName(String, Locale) - Method in class org.springframework.web.servlet.view.AbstractCachingViewResolver

resolveViewName(String, Locale) - Method in class org.springframework.web.servlet.view.BeanNameViewResolver

resolveViewName(String, Locale) - Method in class org.springframework.web.servlet.view.ContentNegotiatingViewResolver

resolveViewName(String, Locale) - Method in interface org.springframework.web.servlet.ViewResolver
Resolve the given view by name.
resolveWiringInfo(Object) - Method in class org.springframework.beans.factory.annotation.AnnotationBeanWiringInfoResolver

resolveWiringInfo(Object) - Method in interface org.springframework.beans.factory.wiring.BeanWiringInfoResolver
Resolve the BeanWiringInfo for the given bean instance.
resolveWiringInfo(Object) - Method in class org.springframework.beans.factory.wiring.ClassNameBeanWiringInfoResolver

resort() - Method in class org.springframework.beans.support.PagedListHolder
Resort the list if necessary, i.e.
Resource - Interface in org.springframework.core.io
Interface for a resource descriptor that abstracts from the actual type of underlying resource, such as a file or class path resource.
RESOURCE_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader

RESOURCE_PARAM_NAME - Static variable in class org.springframework.web.servlet.ResourceServlet
Name of the parameter that must contain the actual resource path.
RESOURCE_URL_DELIMITERS - Static variable in class org.springframework.web.servlet.ResourceServlet
Any number of these characters are considered delimiters between multiple resource paths in a single String value.
ResourceAccessException - Exception in org.springframework.web.client
Exception thrown when an I/O error occurs.
ResourceAccessException(String) - Constructor for exception org.springframework.web.client.ResourceAccessException
Construct a new HttpIOException with the given message.
ResourceAccessException(String, IOException) - Constructor for exception org.springframework.web.client.ResourceAccessException
Construct a new HttpIOException with the given message and IOException.
ResourceAdapterApplicationContext - Class in org.springframework.jca.context
ApplicationContext implementation for a JCA ResourceAdapter.
ResourceAdapterApplicationContext(BootstrapContext) - Constructor for class org.springframework.jca.context.ResourceAdapterApplicationContext
Create a new ResourceAdapterApplicationContext for the given BootstrapContext.
ResourceAdapterFactoryBean - Class in org.springframework.jca.support
FactoryBean that bootstraps the specified JCA 1.5 ResourceAdapter, starting it with a local BootstrapContext and exposing it for bean references.
ResourceAdapterFactoryBean() - Constructor for class org.springframework.jca.support.ResourceAdapterFactoryBean

ResourceAllocationException - Exception in org.springframework.jms
Runtime exception mirroring the JMS ResourceAllocationException.
ResourceAllocationException(ResourceAllocationException) - Constructor for exception org.springframework.jms.ResourceAllocationException

ResourceArrayPropertyEditor - Class in org.springframework.core.io.support
Editor for Resource arrays, to automatically convert String location patterns (e.g.
ResourceArrayPropertyEditor() - Constructor for class org.springframework.core.io.support.ResourceArrayPropertyEditor
Create a new ResourceArrayPropertyEditor with a default PathMatchingResourcePatternResolver.
ResourceArrayPropertyEditor(ResourcePatternResolver) - Constructor for class org.springframework.core.io.support.ResourceArrayPropertyEditor
Create a new ResourceArrayPropertyEditor with the given ResourcePatternResolver.
ResourceArrayPropertyEditor(ResourcePatternResolver, boolean) - Constructor for class org.springframework.core.io.support.ResourceArrayPropertyEditor
Create a new ResourceArrayPropertyEditor with the given ResourcePatternResolver.
ResourceAwareController - Interface in org.springframework.web.portlet.mvc
Extension of the Portlet Controller interface that allows for handling Portlet 2.0 resource requests as well.
ResourceBundleEditor - Class in org.springframework.beans.propertyeditors
PropertyEditor implementation for ResourceBundles.
ResourceBundleEditor() - Constructor for class org.springframework.beans.propertyeditors.ResourceBundleEditor

ResourceBundleMessageSource - Class in org.springframework.context.support
MessageSource implementation that accesses resource bundles using specified basenames.
ResourceBundleMessageSource() - Constructor for class org.springframework.context.support.ResourceBundleMessageSource

ResourceBundleThemeSource - Class in org.springframework.ui.context.support
ThemeSource implementation that looks up an individual ResourceBundle per theme.
ResourceBundleThemeSource() - Constructor for class org.springframework.ui.context.support.ResourceBundleThemeSource

ResourceBundleViewResolver - Class in org.springframework.web.servlet.view
ViewResolver implementation that uses bean definitions in a ResourceBundle, specified by the bundle basename.
ResourceBundleViewResolver() - Constructor for class org.springframework.web.servlet.view.ResourceBundleViewResolver

ResourceDatabasePopulator - Class in org.springframework.jdbc.datasource.init
Populates a database from SQL scripts defined in external resources.
ResourceDatabasePopulator() - Constructor for class org.springframework.jdbc.datasource.init.ResourceDatabasePopulator

ResourceEditor - Class in org.springframework.core.io
Editor for Resource descriptors, to automatically convert String locations e.g.
ResourceEditor() - Constructor for class org.springframework.core.io.ResourceEditor
Create a new instance of the ResourceEditor class using a DefaultResourceLoader.
ResourceEditor(ResourceLoader) - Constructor for class org.springframework.core.io.ResourceEditor
Create a new instance of the ResourceEditor class using the given ResourceLoader.
ResourceEditor(ResourceLoader, boolean) - Constructor for class org.springframework.core.io.ResourceEditor
Create a new instance of the ResourceEditor class using the given ResourceLoader.
ResourceEditorRegistrar - Class in org.springframework.beans.support
PropertyEditorRegistrar implementation that populates a given PropertyEditorRegistry (typically a BeanWrapper used for bean creation within an ApplicationContext) with resource editors.
ResourceEditorRegistrar(ResourceLoader) - Constructor for class org.springframework.beans.support.ResourceEditorRegistrar
Create a new ResourceEditorRegistrar for the given ResourceLoader
ResourceEntityResolver - Class in org.springframework.beans.factory.xml
EntityResolver implementation that tries to resolve entity references through a ResourceLoader (usually, relative to the resource base of an ApplicationContext), if applicable.
ResourceEntityResolver(ResourceLoader) - Constructor for class org.springframework.beans.factory.xml.ResourceEntityResolver
Create a ResourceEntityResolver for the specified ResourceLoader (usually, an ApplicationContext).
ResourceHolder - Interface in org.springframework.transaction.support
Generic interface to be implemented by resource holders.
ResourceHolderSupport - Class in org.springframework.transaction.support
Convenient base class for resource holders.
ResourceHolderSupport() - Constructor for class org.springframework.transaction.support.ResourceHolderSupport

ResourceHolderSynchronization<H extends ResourceHolder,K> - Class in org.springframework.transaction.support
TransactionSynchronization implementation that manages a ResourceHolder bound through TransactionSynchronizationManager.
ResourceHolderSynchronization(H, K) - Constructor for class org.springframework.transaction.support.ResourceHolderSynchronization
Create a new ResourceHolderSynchronization for the given holder.
ResourceHttpMessageConverter - Class in org.springframework.http.converter
Implementation of HttpMessageConverter that can read and write Resources.
ResourceHttpMessageConverter() - Constructor for class org.springframework.http.converter.ResourceHttpMessageConverter

ResourceLoader - Interface in org.springframework.core.io
Strategy interface for loading resources (e..
resourceLoader - Variable in class org.springframework.scheduling.quartz.SchedulerAccessor

ResourceLoaderAware - Interface in org.springframework.context
Interface to be implemented by any object that wishes to be notified of the ResourceLoader (typically the ApplicationContext) that it runs in.
ResourceLoaderClassLoadHelper - Class in org.springframework.scheduling.quartz
Wrapper that adapts from the Quartz ClassLoadHelper interface onto Spring's ResourceLoader interface.
ResourceLoaderClassLoadHelper() - Constructor for class org.springframework.scheduling.quartz.ResourceLoaderClassLoadHelper
Create a new ResourceLoaderClassLoadHelper for the default ResourceLoader.
ResourceLoaderClassLoadHelper(ResourceLoader) - Constructor for class org.springframework.scheduling.quartz.ResourceLoaderClassLoadHelper
Create a new ResourceLoaderClassLoadHelper for the given ResourceLoader.
ResourceMapping - Annotation Type in org.springframework.web.portlet.bind.annotation
Annotation for mapping Portlet resource requests onto handler methods.
ResourceOverridingShadowingClassLoader - Class in org.springframework.instrument.classloading
Subclass of ShadowingClassLoader that overrides attempts to locate certain files.
ResourceOverridingShadowingClassLoader(ClassLoader) - Constructor for class org.springframework.instrument.classloading.ResourceOverridingShadowingClassLoader
Create a new ResourceOverridingShadowingClassLoader, decorating the given ClassLoader.
ResourcePatternResolver - Interface in org.springframework.core.io.support
Strategy interface for resolving a location pattern (for example, an Ant-style path pattern) into Resource objects.
ResourcePatternUtils - Class in org.springframework.core.io.support
Utility class for determining whether a given URL is a resource location that can be loaded via a ResourcePatternResolver.
ResourcePatternUtils() - Constructor for class org.springframework.core.io.support.ResourcePatternUtils

ResourceScriptSource - Class in org.springframework.scripting.support
ScriptSource implementation based on Spring's Resource abstraction.
ResourceScriptSource(Resource) - Constructor for class org.springframework.scripting.support.ResourceScriptSource
Create a new ResourceScriptSource for the given resource.
ResourceServlet - Class in org.springframework.web.servlet
Simple servlet that can expose an internal resource, including a default URL if the specified resource is not found.
ResourceServlet() - Constructor for class org.springframework.web.servlet.ResourceServlet

ResourceTransactionManager - Interface in org.springframework.transaction.support
Extension of the PlatformTransactionManager interface, indicating a native resource transaction manager, operating on a single target resource.
ResourceUtils - Class in org.springframework.util
Utility methods for resolving resource locations to files in the file system.
ResourceUtils() - Constructor for class org.springframework.util.ResourceUtils

RESPONSE_STATUS_ATTRIBUTE - Static variable in interface org.springframework.web.servlet.View
Name of the HttpServletRequest attribute that contains the response status code.
ResponseBody - Annotation Type in org.springframework.web.bind.annotation
Annotation which indicates that a method return value should be bound to the web response body.
ResponseEntity<T> - Class in org.springframework.http
Extension of HttpEntity that adds a HttpStatus status code.
ResponseEntity(T, HttpStatus) - Constructor for class org.springframework.http.ResponseEntity
Create a new ResponseEntity with the given body and status code, and no headers.
ResponseEntity(MultiValueMap<String, String>, HttpStatus) - Constructor for class org.springframework.http.ResponseEntity
Create a new HttpEntity with the given headers and status code, and no body.
ResponseEntity(T, MultiValueMap<String, String>, HttpStatus) - Constructor for class org.springframework.http.ResponseEntity
Create a new HttpEntity with the given body, headers, and status code.
ResponseErrorHandler - Interface in org.springframework.web.client
Strategy interface used by the RestTemplate to determine whether a particular response has an error or not.
ResponseExtractor<T> - Interface in org.springframework.web.client
Generic callback interface used by RestTemplate's retrieval methods Implementations of this interface perform the actual work of extracting data from a ClientHttpResponse, but don't need to worry about exception handling or closing resources.
ResponseStatus - Annotation Type in org.springframework.web.bind.annotation
Marks a method or exception class with the status code and reason that should be returned.
ResponseStatusExceptionResolver - Class in org.springframework.web.servlet.mvc.annotation
Implementation of the HandlerExceptionResolver interface that uses the @ResponseStatus annotation to map exceptions to HTTP status codes.
ResponseStatusExceptionResolver() - Constructor for class org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver

RestClientException - Exception in org.springframework.web.client
Base class for exceptions thrown by RestTemplate whenever it encounters client-side HTTP errors.
RestClientException(String) - Constructor for exception org.springframework.web.client.RestClientException
Construct a new instance of HttpClientException with the given message.
RestClientException(String, Throwable) - Constructor for exception org.springframework.web.client.RestClientException
Construct a new instance of HttpClientException with the given message and exception.
RestGatewaySupport - Class in org.springframework.web.client.support
Convenient super class for application classes that need REST access.
RestGatewaySupport() - Constructor for class org.springframework.web.client.support.RestGatewaySupport
Construct a new instance of the RestGatewaySupport, with default parameters.
RestGatewaySupport(ClientHttpRequestFactory) - Constructor for class org.springframework.web.client.support.RestGatewaySupport
Construct a new instance of the RestGatewaySupport, with the given ClientHttpRequestFactory.
RestOperations - Interface in org.springframework.web.client
Interface specifying a basic set of RESTful operations.
RestTemplate - Class in org.springframework.web.client
The central class for client-side HTTP access. It simplifies communication with HTTP servers, and enforces RESTful principles.
RestTemplate() - Constructor for class org.springframework.web.client.RestTemplate
Create a new instance of the RestTemplate using default settings.
RestTemplate(ClientHttpRequestFactory) - Constructor for class org.springframework.web.client.RestTemplate
Create a new instance of the RestTemplate based on the given ClientHttpRequestFactory.
ResultSetExtractor<T> - Interface in org.springframework.jdbc.core
Callback interface used by JdbcTemplate's query methods.
ResultSetSupportingSqlParameter - Class in org.springframework.jdbc.core
Common base class for ResultSet-supporting SqlParameters like SqlOutParameter and SqlReturnResultSet.
ResultSetSupportingSqlParameter(String, int) - Constructor for class org.springframework.jdbc.core.ResultSetSupportingSqlParameter
Create a new ResultSetSupportingSqlParameter.
ResultSetSupportingSqlParameter(String, int, int) - Constructor for class org.springframework.jdbc.core.ResultSetSupportingSqlParameter
Create a new ResultSetSupportingSqlParameter.
ResultSetSupportingSqlParameter(String, int, String) - Constructor for class org.springframework.jdbc.core.ResultSetSupportingSqlParameter
Create a new ResultSetSupportingSqlParameter.
ResultSetSupportingSqlParameter(String, int, ResultSetExtractor) - Constructor for class org.springframework.jdbc.core.ResultSetSupportingSqlParameter
Create a new ResultSetSupportingSqlParameter.
ResultSetSupportingSqlParameter(String, int, RowCallbackHandler) - Constructor for class org.springframework.jdbc.core.ResultSetSupportingSqlParameter
Create a new ResultSetSupportingSqlParameter.
ResultSetSupportingSqlParameter(String, int, RowMapper) - Constructor for class org.springframework.jdbc.core.ResultSetSupportingSqlParameter
Create a new ResultSetSupportingSqlParameter.
ResultSetWrappingSqlRowSet - Class in org.springframework.jdbc.support.rowset
Default implementation of Spring's SqlRowSet interface.
ResultSetWrappingSqlRowSet(ResultSet) - Constructor for class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
Create a new ResultSetWrappingSqlRowSet for the given ResultSet.
ResultSetWrappingSqlRowSetMetaData - Class in org.springframework.jdbc.support.rowset
Default implementation of Spring's SqlRowSetMetaData interface.
ResultSetWrappingSqlRowSetMetaData(ResultSetMetaData) - Constructor for class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSetMetaData
Create a new ResultSetWrappingSqlRowSetMetaData object for the given ResultSetMetaData instance.
resume(Object, AbstractPlatformTransactionManager.SuspendedResourcesHolder) - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Resume the given transaction.
resume() - Method in class org.springframework.transaction.support.ResourceHolderSynchronization

resume() - Method in interface org.springframework.transaction.support.TransactionSynchronization
Resume this synchronization.
resume() - Method in class org.springframework.transaction.support.TransactionSynchronizationAdapter

resumePausedTasks() - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Try to resume all paused tasks.
retainAll(Collection<?>) - Method in class org.springframework.util.AutoPopulatingList

rethrowException(Throwable) - Static method in class org.springframework.util.ReflectionUtils
Rethrow the given exception, which is presumably the target exception of an InvocationTargetException.
rethrowRuntimeException(Throwable) - Static method in class org.springframework.util.ReflectionUtils
Rethrow the given exception, which is presumably the target exception of an InvocationTargetException.
retrieveAttribute(WebRequest, String) - Method in class org.springframework.web.bind.support.DefaultSessionAttributeStore

retrieveAttribute(WebRequest, String) - Method in interface org.springframework.web.bind.support.SessionAttributeStore
Retrieve the specified attribute from the backend session.
retrieveLastModifiedTime() - Method in class org.springframework.scripting.support.ResourceScriptSource
Retrieve the current last-modified timestamp of the underlying resource.
retrieveMatchingFiles(File, String) - Method in class org.springframework.core.io.support.PathMatchingResourcePatternResolver
Retrieve files that match the given path pattern, checking the given directory and its subdirectories.
retrieveProfileValueSource(Class<?>) - Static method in class org.springframework.test.annotation.ProfileValueUtils
Retrieves the ProfileValueSource type for the specified test class as configured via the @ProfileValueSourceConfiguration annotation and instantiates a new instance of that type.
retrieveTransactionManager() - Method in class org.springframework.transaction.jta.JtaTransactionManager
Allows subclasses to retrieve the JTA TransactionManager in a vendor-specific manner.
retrieveTransactionManager() - Method in class org.springframework.transaction.jta.WebLogicJtaTransactionManager

retrieveTransactionSynchronizationRegistry() - Method in class org.springframework.transaction.jta.JtaTransactionManager
Allows subclasses to retrieve the JTA 1.1 TransactionSynchronizationRegistry in a vendor-specific manner.
retrieveUserTransaction() - Method in class org.springframework.transaction.jta.JtaTransactionManager
Allows subclasses to retrieve the JTA UserTransaction in a vendor-specific manner.
retrieveUserTransaction() - Method in class org.springframework.transaction.jta.OC4JJtaTransactionManager

retrieveUserTransaction() - Method in class org.springframework.transaction.jta.WebLogicJtaTransactionManager

returnedClass() - Method in class org.springframework.orm.hibernate3.support.BlobByteArrayType

returnedClass() - Method in class org.springframework.orm.hibernate3.support.BlobSerializableType

returnedClass() - Method in class org.springframework.orm.hibernate3.support.BlobStringType

returnedClass() - Method in class org.springframework.orm.hibernate3.support.ClobStringType

returningResultSet(String, RowMapper) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcCall

returningResultSet(String, ParameterizedRowMapper) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcCall
Deprecated. in favor of SimpleJdbcCall.returningResultSet(String, org.springframework.jdbc.core.RowMapper)
returningResultSet(String, RowMapper) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcCallOperations
Used to specify when a ResultSet is returned by the stored procedure and you want it mapped by a RowMapper.
returningResultSet(String, ParameterizedRowMapper) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcCallOperations
Deprecated. in favor of SimpleJdbcCallOperations.returningResultSet(String, org.springframework.jdbc.core.RowMapper)
RmiBasedExporter - Class in org.springframework.remoting.rmi
Convenient superclass for RMI-based remote exporters.
RmiBasedExporter() - Constructor for class org.springframework.remoting.rmi.RmiBasedExporter

RmiClientInterceptor - Class in org.springframework.remoting.rmi
MethodInterceptor for accessing conventional RMI services or RMI invokers.
RmiClientInterceptor() - Constructor for class org.springframework.remoting.rmi.RmiClientInterceptor

RmiClientInterceptorUtils - Class in org.springframework.remoting.rmi
Factored-out methods for performing invocations within an RMI client.
RmiClientInterceptorUtils() - Constructor for class org.springframework.remoting.rmi.RmiClientInterceptorUtils

RmiInvocationHandler - Interface in org.springframework.remoting.rmi
Interface for RMI invocation handlers instances on the server, wrapping exported services.
RmiProxyFactoryBean - Class in org.springframework.remoting.rmi
FactoryBean for RMI proxies, supporting both conventional RMI services and RMI invokers.
RmiProxyFactoryBean() - Constructor for class org.springframework.remoting.rmi.RmiProxyFactoryBean

RmiRegistryFactoryBean - Class in org.springframework.remoting.rmi
FactoryBean that locates a Registry and exposes it for bean references.
RmiRegistryFactoryBean() - Constructor for class org.springframework.remoting.rmi.RmiRegistryFactoryBean

RmiServiceExporter - Class in org.springframework.remoting.rmi
RMI exporter that exposes the specified service as RMI object with the specified name.
RmiServiceExporter() - Constructor for class org.springframework.remoting.rmi.RmiServiceExporter

ROLE_APPLICATION - Static variable in interface org.springframework.beans.factory.config.BeanDefinition
Role hint indicating that a BeanDefinition is a major part of the application.
ROLE_GETTER - Static variable in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Constant identifier for the getter role field value in a JMX Descriptor.
ROLE_INFRASTRUCTURE - Static variable in interface org.springframework.beans.factory.config.BeanDefinition
Role hint indicating that a BeanDefinition is providing an entirely background role and has no relevance to the end-user.
ROLE_OPERATION - Static variable in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Identifies an operation (method) in a JMX Descriptor.
ROLE_SETTER - Static variable in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Constant identifier for the setter role field value in a JMX Descriptor.
ROLE_SUPPORT - Static variable in interface org.springframework.beans.factory.config.BeanDefinition
Role hint indicating that a BeanDefinition is a supporting part of some larger configuration, typically an outer ComponentDefinition.
Rollback - Annotation Type in org.springframework.test.annotation
Test annotation to indicate whether or not the transaction for the annotated test method should be rolled back after the test method has completed.
rollback() - Method in class org.springframework.transaction.jta.ManagedTransactionAdapter

rollback() - Method in class org.springframework.transaction.jta.UserTransactionAdapter

rollback(TransactionStatus) - Method in interface org.springframework.transaction.PlatformTransactionManager
Perform a rollback of the given transaction.
rollback(TransactionStatus) - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
This implementation of rollback handles participating in existing transactions.
ROLLBACK_ON_RUNTIME_EXCEPTIONS - Static variable in class org.springframework.transaction.interceptor.RollbackRuleAttribute
The rollback rule for RuntimeExceptions.
rollbackIfNecessary(Session) - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Perform a rollback, if appropriate.
rollbackIfNecessary(Session) - Static method in class org.springframework.jms.support.JmsUtils
Rollback the Session if not within a JTA transaction.
rollbackOn(Throwable) - Method in class org.springframework.transaction.interceptor.DefaultTransactionAttribute
The default behavior is as with EJB: rollback on unchecked exception.
rollbackOn(Throwable) - Method in class org.springframework.transaction.interceptor.DelegatingTransactionAttribute

rollbackOn(Throwable) - Method in class org.springframework.transaction.interceptor.RuleBasedTransactionAttribute
Winning rule is the shallowest rule (that is, the closest in the inheritance hierarchy to the exception).
rollbackOn(Throwable) - Method in interface org.springframework.transaction.interceptor.TransactionAttribute
Should we roll back on the given exception?
rollbackOnExceptionIfNecessary(Session, Throwable) - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Perform a rollback, handling rollback exceptions properly.
RollbackRuleAttribute - Class in org.springframework.transaction.interceptor
Rule determining whether or not a given exception (and any subclasses) should cause a rollback.
RollbackRuleAttribute(Class) - Constructor for class org.springframework.transaction.interceptor.RollbackRuleAttribute
Create a new instance of the RollbackRuleAttribute class.
RollbackRuleAttribute(String) - Constructor for class org.springframework.transaction.interceptor.RollbackRuleAttribute
Create a new instance of the RollbackRuleAttribute class for the given exceptionName.
rollbackToHeldSavepoint() - Method in class org.springframework.transaction.support.AbstractTransactionStatus
Roll back to the savepoint that is held for the transaction.
rollbackToSavepoint(Object) - Method in class org.springframework.jdbc.datasource.JdbcTransactionObjectSupport
This implementation rolls back to the given JDBC 3.0 Savepoint.
rollbackToSavepoint(Object) - Method in interface org.springframework.transaction.SavepointManager
Roll back to the given savepoint.
rollbackToSavepoint(Object) - Method in class org.springframework.transaction.support.AbstractTransactionStatus
This implementation delegates to a SavepointManager for the underlying transaction, if possible.
ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE - Static variable in interface org.springframework.web.context.WebApplicationContext
Context attribute to bind root WebApplicationContext to on successful startup.
rootBeanDefinition(Class) - Static method in class org.springframework.beans.factory.support.BeanDefinitionBuilder
Create a new BeanDefinitionBuilder used to construct a RootBeanDefinition.
rootBeanDefinition(Class, String) - Static method in class org.springframework.beans.factory.support.BeanDefinitionBuilder
Create a new BeanDefinitionBuilder used to construct a RootBeanDefinition.
rootBeanDefinition(String) - Static method in class org.springframework.beans.factory.support.BeanDefinitionBuilder
Create a new BeanDefinitionBuilder used to construct a RootBeanDefinition.
rootBeanDefinition(String, String) - Static method in class org.springframework.beans.factory.support.BeanDefinitionBuilder
Create a new BeanDefinitionBuilder used to construct a RootBeanDefinition.
RootBeanDefinition - Class in org.springframework.beans.factory.support
A root bean definition represents the merged bean definition that backs a specific bean in a Spring BeanFactory at runtime.
RootBeanDefinition() - Constructor for class org.springframework.beans.factory.support.RootBeanDefinition
Create a new RootBeanDefinition, to be configured through its bean properties and configuration methods.
RootBeanDefinition(Class) - Constructor for class org.springframework.beans.factory.support.RootBeanDefinition
Create a new RootBeanDefinition for a singleton.
RootBeanDefinition(Class, boolean) - Constructor for class org.springframework.beans.factory.support.RootBeanDefinition
Deprecated. since Spring 2.5, in favor of AbstractBeanDefinition.setScope(java.lang.String)
RootBeanDefinition(Class, int) - Constructor for class org.springframework.beans.factory.support.RootBeanDefinition
Deprecated. as of Spring 3.0, in favor of AbstractBeanDefinition.setAutowireMode(int) usage
RootBeanDefinition(Class, int, boolean) - Constructor for class org.springframework.beans.factory.support.RootBeanDefinition
Create a new RootBeanDefinition for a singleton, using the given autowire mode.
RootBeanDefinition(Class, MutablePropertyValues) - Constructor for class org.springframework.beans.factory.support.RootBeanDefinition
Deprecated. as of Spring 3.0, in favor of AbstractBeanDefinition.getPropertyValues() usage
RootBeanDefinition(Class, MutablePropertyValues, boolean) - Constructor for class org.springframework.beans.factory.support.RootBeanDefinition
Deprecated. since Spring 2.5, in favor of AbstractBeanDefinition.setScope(java.lang.String)
RootBeanDefinition(Class, ConstructorArgumentValues, MutablePropertyValues) - Constructor for class org.springframework.beans.factory.support.RootBeanDefinition
Create a new RootBeanDefinition for a singleton, providing constructor arguments and property values.
RootBeanDefinition(String) - Constructor for class org.springframework.beans.factory.support.RootBeanDefinition
Create a new RootBeanDefinition for a singleton, providing constructor arguments and property values.
RootBeanDefinition(String, ConstructorArgumentValues, MutablePropertyValues) - Constructor for class org.springframework.beans.factory.support.RootBeanDefinition
Create a new RootBeanDefinition for a singleton, providing constructor arguments and property values.
RootBeanDefinition(RootBeanDefinition) - Constructor for class org.springframework.beans.factory.support.RootBeanDefinition
Create a new RootBeanDefinition as deep copy of the given bean definition.
RootClassFilter - Class in org.springframework.aop.support
Simple ClassFilter implementation that passes classes (and optionally subclasses)
RootClassFilter(Class) - Constructor for class org.springframework.aop.support.RootClassFilter

RowCallbackHandler - Interface in org.springframework.jdbc.core
An interface used by JdbcTemplate for processing rows of a ResultSet on a per-row basis.
RowCountCallbackHandler - Class in org.springframework.jdbc.core
Implementation of RowCallbackHandler.
RowCountCallbackHandler() - Constructor for class org.springframework.jdbc.core.RowCountCallbackHandler

RowMapper<T> - Interface in org.springframework.jdbc.core
An interface used by JdbcTemplate for mapping rows of a ResultSet on a per-row basis.
RowMapperResultSetExtractor<T> - Class in org.springframework.jdbc.core
Adapter implementation of the ResultSetExtractor interface that delegates to a RowMapper which is supposed to create an object for each row.
RowMapperResultSetExtractor(RowMapper<T>) - Constructor for class org.springframework.jdbc.core.RowMapperResultSetExtractor
Create a new RowMapperResultSetExtractor.
RowMapperResultSetExtractor(RowMapper<T>, int) - Constructor for class org.springframework.jdbc.core.RowMapperResultSetExtractor
Create a new RowMapperResultSetExtractor.
ROWS_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.TextareaTag

RssChannelHttpMessageConverter - Class in org.springframework.http.converter.feed
Implementation of HttpMessageConverter that can read and write RSS feeds.
RssChannelHttpMessageConverter() - Constructor for class org.springframework.http.converter.feed.RssChannelHttpMessageConverter

RuleBasedTransactionAttribute - Class in org.springframework.transaction.interceptor
TransactionAttribute implementation that works out whether a given exception should cause transaction rollback by applying a number of rollback rules, both positive and negative.
RuleBasedTransactionAttribute() - Constructor for class org.springframework.transaction.interceptor.RuleBasedTransactionAttribute
Create a new RuleBasedTransactionAttribute, with default settings.
RuleBasedTransactionAttribute(RuleBasedTransactionAttribute) - Constructor for class org.springframework.transaction.interceptor.RuleBasedTransactionAttribute
Copy constructor.
RuleBasedTransactionAttribute(int, List<RollbackRuleAttribute>) - Constructor for class org.springframework.transaction.interceptor.RuleBasedTransactionAttribute
Create a new DefaultTransactionAttribute with the the given propagation behavior.
run() - Method in class org.springframework.jca.work.DelegatingWork
Delegates execution to the underlying Runnable.
run() - Method in class org.springframework.jdbc.object.SqlFunction
Convenient method to run the function without arguments.
run(int) - Method in class org.springframework.jdbc.object.SqlFunction
Convenient method to run the function with a single int argument.
run(Object...) - Method in class org.springframework.jdbc.object.SqlFunction
Analogous to the SqlQuery.execute([]) method.
run() - Method in class org.springframework.scheduling.commonj.DelegatingWork
Delegates execution to the underlying Runnable.
run() - Method in class org.springframework.scheduling.support.DelegatingErrorHandlingRunnable

run() - Method in class org.springframework.scheduling.support.MethodInvokingRunnable

run() - Method in class org.springframework.scheduling.timer.DelegatingTimerTask
Deprecated. Delegates execution to the underlying Runnable, catching any exception or error thrown in order to continue scheduled execution.
run(RunNotifier) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
Check whether the test is enabled in the first place.
run(IHookCallBack, ITestResult) - Method in class org.springframework.test.context.testng.AbstractTestNGSpringContextTests
Delegates to the test method in the supplied callback to execute the actual test and then tracks the exception thrown during test execution, if any.
RunAfterTestClassCallbacks - Class in org.springframework.test.context.junit4.statements
RunAfterTestClassCallbacks is a custom JUnit 4.5+ Statement which allows the Spring TestContext Framework to be plugged into the JUnit execution chain by calling afterTestClass() on the supplied TestContextManager.
RunAfterTestClassCallbacks(Statement, TestContextManager) - Constructor for class org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks
Constructs a new RunAfterTestClassCallbacks statement.
RunAfterTestMethodCallbacks - Class in org.springframework.test.context.junit4.statements
RunAfterTestMethodCallbacks is a custom JUnit 4.5+ Statement which allows the Spring TestContext Framework to be plugged into the JUnit execution chain by calling afterTestMethod() on the supplied TestContextManager.
RunAfterTestMethodCallbacks(Statement, Object, Method, TestContextManager) - Constructor for class org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks
Constructs a new RunAfterTestMethodCallbacks statement.
runAfterTransactionMethods(TestContext) - Method in class org.springframework.test.context.transaction.TransactionalTestExecutionListener
Run all @AfterTransaction methods for the specified test context.
runBare() - Method in class org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests
Deprecated. Overridden to populate transaction definition from annotations.
runBare() - Method in class org.springframework.test.ConditionalTestCase
Deprecated.
runBare() - Method in class org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests
Runs the Spring TestContext Framework test sequence.
runBare() - Method in class org.springframework.test.jpa.AbstractJpaTests
Deprecated.
RunBeforeTestClassCallbacks - Class in org.springframework.test.context.junit4.statements
RunBeforeTestClassCallbacks is a custom JUnit 4.5+ Statement which allows the Spring TestContext Framework to be plugged into the JUnit execution chain by calling beforeTestClass() on the supplied TestContextManager.
RunBeforeTestClassCallbacks(Statement, TestContextManager) - Constructor for class org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks
Constructs a new RunBeforeTestClassCallbacks statement.
RunBeforeTestMethodCallbacks - Class in org.springframework.test.context.junit4.statements
RunBeforeTestMethodCallbacks is a custom JUnit 4.5+ Statement which allows the Spring TestContext Framework to be plugged into the JUnit execution chain by calling beforeTestMethod() on the supplied TestContextManager.
RunBeforeTestMethodCallbacks(Statement, Object, Method, TestContextManager) - Constructor for class org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks
Constructs a new RunBeforeTestMethodCallbacks statement.
runBeforeTransactionMethods(TestContext) - Method in class org.springframework.test.context.transaction.TransactionalTestExecutionListener
Run all @BeforeTransaction methods for the specified test context.
runChild(FrameworkMethod, RunNotifier) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
Performs the same logic as BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier), except that tests are determined to be ignored by SpringJUnit4ClassRunner.isTestMethodIgnored(FrameworkMethod).
runGeneric() - Method in class org.springframework.jdbc.object.SqlFunction
Convenient method to run the function without arguments, returning the value as an object.
runGeneric(int) - Method in class org.springframework.jdbc.object.SqlFunction
Convenient method to run the function with a single int argument.
runGeneric(Object[]) - Method in class org.springframework.jdbc.object.SqlFunction
Analogous to the SqlQuery.findObject(Object[]) method.
runInThread(Runnable) - Method in class org.springframework.scheduling.quartz.LocalTaskExecutorThreadPool

runningAllowed() - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Check whether this container's listeners are generally allowed to run.
runTest() - Method in class org.springframework.test.AssertThrows
Deprecated. The main template method that drives the running of the test logic and the checking of the resulting (expected) Exception.
RuntimeBeanNameReference - Class in org.springframework.beans.factory.config
Immutable placeholder class used for a property value object when it's a reference to another bean name in the factory, to be resolved at runtime.
RuntimeBeanNameReference(String) - Constructor for class org.springframework.beans.factory.config.RuntimeBeanNameReference
Create a new RuntimeBeanNameReference to the given bean name.
RuntimeBeanReference - Class in org.springframework.beans.factory.config
Immutable placeholder class used for a property value object when it's a reference to another bean in the factory, to be resolved at runtime.
RuntimeBeanReference(String) - Constructor for class org.springframework.beans.factory.config.RuntimeBeanReference
Create a new RuntimeBeanReference to the given bean name, without explicitly marking it as reference to a bean in the parent factory.
RuntimeBeanReference(String, boolean) - Constructor for class org.springframework.beans.factory.config.RuntimeBeanReference
Create a new RuntimeBeanReference to the given bean name, with the option to mark it as reference to a bean in the parent factory.
Overview  Package  Class  Tree  Deprecated   Index  Help
A B C D E F G H I J K L M N O P Q R S T U V W X


S-Index

PREV LETTER NEXT LETTER FRAMES NO FRAMES
A B C D E F G H I J K L M N O P Q R S T U V W X

S

sameResourceFactory(ResourceTransactionManager, Object) - Static method in class org.springframework.transaction.support.TransactionSynchronizationUtils
Check whether the given resource transaction managers refers to the given (underlying) resource factory.
save(Object) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Persist the given transient instance.
save(String, Object) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Persist the given transient instance.
save(Object) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
save(String, Object) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
saveOrUpdate(Object) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Save or update the given persistent instance, according to its id (matching the configured "unsaved-value"?).
saveOrUpdate(String, Object) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Save or update the given persistent instance, according to its id (matching the configured "unsaved-value"?).
saveOrUpdate(Object) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
saveOrUpdate(String, Object) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
saveOrUpdateAll(Collection) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Deprecated. as of Spring 2.5, in favor of individual saveOrUpdate or merge usage
saveOrUpdateAll(Collection) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
SAVEPOINT_NAME_PREFIX - Static variable in class org.springframework.jdbc.datasource.ConnectionHolder
SavepointManager - Interface in org.springframework.transaction
Interface that specifies an API to programmatically manage transaction savepoints in a generic fashion.
SaxResourceUtils - Class in org.springframework.oxm.support
Convenient utility methods for dealing with SAX.
SaxResourceUtils() - Constructor for class org.springframework.oxm.support.SaxResourceUtils
scan(String...) - Method in class org.springframework.context.annotation.AnnotationConfigApplicationContext
Perform a scan within the specified base packages.
scan(String...) - Method in class org.springframework.context.annotation.ClassPathBeanDefinitionScanner
Perform a scan within the specified base packages.
ScannedGenericBeanDefinition - Class in org.springframework.context.annotation
Extension of the GenericBeanDefinition class, based on an ASM ClassReader, with support for annotation metadata exposed through the AnnotatedBeanDefinition interface.
ScannedGenericBeanDefinition(MetadataReader) - Constructor for class org.springframework.context.annotation.ScannedGenericBeanDefinition
Create a new ScannedGenericBeanDefinition for the class that the given MetadataReader describes.
scanPackages(AnnotationConfiguration) - Method in class org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean
Perform Spring-based scanning for entity classes.
schedule(Runnable, Trigger) - Method in class org.springframework.scheduling.commonj.TimerManagerTaskScheduler
schedule(Runnable, Date) - Method in class org.springframework.scheduling.commonj.TimerManagerTaskScheduler
schedule(Work) - Method in class org.springframework.scheduling.commonj.WorkManagerTaskExecutor
schedule(Work, WorkListener) - Method in class org.springframework.scheduling.commonj.WorkManagerTaskExecutor
schedule(Runnable, Trigger) - Method in class org.springframework.scheduling.concurrent.ConcurrentTaskScheduler
schedule(Runnable, Date) - Method in class org.springframework.scheduling.concurrent.ConcurrentTaskScheduler
schedule(Runnable, Trigger) - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
schedule(Runnable, Date) - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
schedule(Runnable, Trigger) - Method in interface org.springframework.scheduling.TaskScheduler
Schedule the given Runnable, invoking it whenever the trigger indicates a next execution time.
schedule(Runnable, Date) - Method in interface org.springframework.scheduling.TaskScheduler
Schedule the given Runnable, invoking it at the specified execution time.
scheduleAtFixedRate(Runnable, Date, long) - Method in class org.springframework.scheduling.commonj.TimerManagerTaskScheduler
scheduleAtFixedRate(Runnable, long) - Method in class org.springframework.scheduling.commonj.TimerManagerTaskScheduler
scheduleAtFixedRate(Runnable, Date, long) - Method in class org.springframework.scheduling.concurrent.ConcurrentTaskScheduler
scheduleAtFixedRate(Runnable, long) - Method in class org.springframework.scheduling.concurrent.ConcurrentTaskScheduler
scheduleAtFixedRate(Runnable, Date, long) - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
scheduleAtFixedRate(Runnable, long) - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
scheduleAtFixedRate(Runnable, Date, long) - Method in interface org.springframework.scheduling.TaskScheduler
Schedule the given Runnable, invoking it at the specified execution time and subsequently with the given period.
scheduleAtFixedRate(Runnable, long) - Method in interface org.springframework.scheduling.TaskScheduler
Schedule the given Runnable, starting as soon as possible and invoking it with the given period.
Scheduled - Annotation Type in org.springframework.scheduling.annotation
Annotation that marks a method to be scheduled.
SCHEDULED_ANNOTATION_PROCESSOR_BEAN_NAME - Static variable in class org.springframework.scheduling.config.AnnotationDrivenBeanDefinitionParser
The bean name of the internally managed scheduled annotation processor.
ScheduledAnnotationBeanPostProcessor - Class in org.springframework.scheduling.annotation
Bean post-processor that registers methods annotated with @Scheduled to be invoked by a TaskScheduler according to the "fixedRate", "fixedDelay", or "cron" expression provided via the annotation.
ScheduledAnnotationBeanPostProcessor() - Constructor for class org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor
ScheduledExecutorFactoryBean - Class in org.springframework.scheduling.concurrent
FactoryBean that sets up a JDK 1.5 ScheduledExecutorService (by default: a ScheduledThreadPoolExecutor) and exposes it for bean references.
ScheduledExecutorFactoryBean() - Constructor for class org.springframework.scheduling.concurrent.ScheduledExecutorFactoryBean
ScheduledExecutorTask - Class in org.springframework.scheduling.concurrent
JavaBean that describes a scheduled executor task, consisting of the Runnable and a delay plus period.
ScheduledExecutorTask() - Constructor for class org.springframework.scheduling.concurrent.ScheduledExecutorTask
Create a new ScheduledExecutorTask, to be populated via bean properties.
ScheduledExecutorTask(Runnable) - Constructor for class org.springframework.scheduling.concurrent.ScheduledExecutorTask
Create a new ScheduledExecutorTask, with default one-time execution without delay.
ScheduledExecutorTask(Runnable, long) - Constructor for class org.springframework.scheduling.concurrent.ScheduledExecutorTask
Create a new ScheduledExecutorTask, with default one-time execution with the given delay.
ScheduledExecutorTask(Runnable, long, long, boolean) - Constructor for class org.springframework.scheduling.concurrent.ScheduledExecutorTask
Create a new ScheduledExecutorTask.
ScheduledTaskRegistrar - Class in org.springframework.scheduling.config
Helper bean for registering tasks with a TaskScheduler, typically using cron expressions.
ScheduledTaskRegistrar() - Constructor for class org.springframework.scheduling.config.ScheduledTaskRegistrar
ScheduledTasksBeanDefinitionParser - Class in org.springframework.scheduling.config
Parser for the 'scheduled-tasks' element of the scheduling namespace.
ScheduledTasksBeanDefinitionParser() - Constructor for class org.springframework.scheduling.config.ScheduledTasksBeanDefinitionParser
ScheduledTimerListener - Class in org.springframework.scheduling.commonj
JavaBean that describes a scheduled TimerListener, consisting of the TimerListener itself (or a Runnable to create a TimerListener for) and a delay plus period.
ScheduledTimerListener() - Constructor for class org.springframework.scheduling.commonj.ScheduledTimerListener
Create a new ScheduledTimerListener, to be populated via bean properties.
ScheduledTimerListener(TimerListener) - Constructor for class org.springframework.scheduling.commonj.ScheduledTimerListener
Create a new ScheduledTimerListener, with default one-time execution without delay.
ScheduledTimerListener(TimerListener, long) - Constructor for class org.springframework.scheduling.commonj.ScheduledTimerListener
Create a new ScheduledTimerListener, with default one-time execution with the given delay.
ScheduledTimerListener(TimerListener, long, long, boolean) - Constructor for class org.springframework.scheduling.commonj.ScheduledTimerListener
Create a new ScheduledTimerListener.
ScheduledTimerListener(Runnable) - Constructor for class org.springframework.scheduling.commonj.ScheduledTimerListener
Create a new ScheduledTimerListener, with default one-time execution without delay.
ScheduledTimerListener(Runnable, long) - Constructor for class org.springframework.scheduling.commonj.ScheduledTimerListener
Create a new ScheduledTimerListener, with default one-time execution with the given delay.
ScheduledTimerListener(Runnable, long, long, boolean) - Constructor for class org.springframework.scheduling.commonj.ScheduledTimerListener
Create a new ScheduledTimerListener.
ScheduledTimerTask - Class in org.springframework.scheduling.timer
Deprecated. as of Spring 3.0, in favor of the scheduling.concurrent package which is based on Java 5's java.util.concurrent.ExecutorService
ScheduledTimerTask() - Constructor for class org.springframework.scheduling.timer.ScheduledTimerTask
Deprecated. Create a new ScheduledTimerTask, to be populated via bean properties.
ScheduledTimerTask(TimerTask) - Constructor for class org.springframework.scheduling.timer.ScheduledTimerTask
Deprecated. Create a new ScheduledTimerTask, with default one-time execution without delay.
ScheduledTimerTask(TimerTask, long) - Constructor for class org.springframework.scheduling.timer.ScheduledTimerTask
Deprecated. Create a new ScheduledTimerTask, with default one-time execution with the given delay.
ScheduledTimerTask(TimerTask, long, long, boolean) - Constructor for class org.springframework.scheduling.timer.ScheduledTimerTask
Deprecated. Create a new ScheduledTimerTask.
ScheduledTimerTask(Runnable) - Constructor for class org.springframework.scheduling.timer.ScheduledTimerTask
Deprecated. Create a new ScheduledTimerTask, with default one-time execution without delay.
ScheduledTimerTask(Runnable, long) - Constructor for class org.springframework.scheduling.timer.ScheduledTimerTask
Deprecated. Create a new ScheduledTimerTask, with default one-time execution with the given delay.
ScheduledTimerTask(Runnable, long, long, boolean) - Constructor for class org.springframework.scheduling.timer.ScheduledTimerTask
Deprecated. Create a new ScheduledTimerTask.
scheduleNewInvokerIfAppropriate() - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Schedule a new invoker, increasing the total number of scheduled invokers for this listener container, but only if the specified "maxConcurrentConsumers" limit has not been reached yet, and only if this listener container does not currently have idle invokers that are waiting for new messages already.
SchedulerAccessor - Class in org.springframework.scheduling.quartz
Common base class for accessing a Quartz Scheduler, i.e.
SchedulerAccessor() - Constructor for class org.springframework.scheduling.quartz.SchedulerAccessor
SchedulerAccessorBean - Class in org.springframework.scheduling.quartz
Spring bean-style class for accessing a Quartz Scheduler, i.e.
SchedulerAccessorBean() - Constructor for class org.springframework.scheduling.quartz.SchedulerAccessorBean
SchedulerBeanDefinitionParser - Class in org.springframework.scheduling.config
Parser for the 'scheduler' element of the 'task' namespace.
SchedulerBeanDefinitionParser() - Constructor for class org.springframework.scheduling.config.SchedulerBeanDefinitionParser
SchedulerContextAware - Interface in org.springframework.scheduling.quartz
Callback interface to be implemented by Spring-managed Quartz artifacts that need access to the SchedulerContext (without having natural access to it).
SchedulerFactoryBean - Class in org.springframework.scheduling.quartz
FactoryBean that creates and configures a Quartz Scheduler, manages its lifecycle as part of the Spring application context, and exposes the Scheduler as bean reference for dependency injection.
SchedulerFactoryBean() - Constructor for class org.springframework.scheduling.quartz.SchedulerFactoryBean
scheduleWithFixedDelay(Runnable, Date, long) - Method in class org.springframework.scheduling.commonj.TimerManagerTaskScheduler
scheduleWithFixedDelay(Runnable, long) - Method in class org.springframework.scheduling.commonj.TimerManagerTaskScheduler
scheduleWithFixedDelay(Runnable, Date, long) - Method in class org.springframework.scheduling.concurrent.ConcurrentTaskScheduler
scheduleWithFixedDelay(Runnable, long) - Method in class org.springframework.scheduling.concurrent.ConcurrentTaskScheduler
scheduleWithFixedDelay(Runnable, Date, long) - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
scheduleWithFixedDelay(Runnable, long) - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
scheduleWithFixedDelay(Runnable, Date, long) - Method in interface org.springframework.scheduling.TaskScheduler
Schedule the given Runnable, invoking it at the specified execution time and subsequently with the given delay between the completion of one execution and the start of the next.
scheduleWithFixedDelay(Runnable, long) - Method in interface org.springframework.scheduling.TaskScheduler
Schedule the given Runnable, starting as soon as possible and invoking it with the given delay between the completion of one execution and the start of the next.
scheduleWork(Work) - Method in class org.springframework.jca.work.SimpleTaskWorkManager
scheduleWork(Work, long, ExecutionContext, WorkListener) - Method in class org.springframework.jca.work.SimpleTaskWorkManager
scheduleWork(Work) - Method in class org.springframework.jca.work.WorkManagerTaskExecutor
scheduleWork(Work, long, ExecutionContext, WorkListener) - Method in class org.springframework.jca.work.WorkManagerTaskExecutor
SchedulingAwareRunnable - Interface in org.springframework.scheduling
Extension of the Runnable interface, adding special callbacks for long-running operations.
SchedulingException - Exception in org.springframework.scheduling
General exception to be thrown on scheduling failures, such as the scheduler already having shut down.
SchedulingException(String) - Constructor for exception org.springframework.scheduling.SchedulingException
Constructor for SchedulingException.
SchedulingException(String, Throwable) - Constructor for exception org.springframework.scheduling.SchedulingException
Constructor for SchedulingException.
SchedulingTaskExecutor - Interface in org.springframework.scheduling
A TaskExecutor extension exposing scheduling characteristics that are relevant to potential task submitters.
schemaNameToUse(String) - Method in interface org.springframework.jdbc.core.metadata.CallMetaDataProvider
Provide any modification of the schema name passed in to match the meta data currently used.
schemaNameToUse(String) - Method in class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
schemaNameToUse(String) - Method in class org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
schemaNameToUse(String) - Method in interface org.springframework.jdbc.core.metadata.TableMetaDataProvider
Get the schema name formatted based on metadata information.
Scope - Interface in org.springframework.beans.factory.config
Strategy interface used by a ConfigurableBeanFactory, representing a target scope to hold bean instances in.
Scope - Annotation Type in org.springframework.context.annotation
When used as a type-level annotation in conjunction with the Component annotation, indicates the name of a scope to use for instances of the annotated type.
SCOPE_APPLICATION - Static variable in interface org.springframework.web.context.WebApplicationContext
Scope identifier for the global web application scope: "application".
SCOPE_APPLICATION - Static variable in class org.springframework.web.util.TagUtils
Constant identifying the application scope
SCOPE_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
SCOPE_DEFAULT - Static variable in class org.springframework.beans.factory.support.AbstractBeanDefinition
Constant for the default scope name: "", equivalent to singleton status but to be overridden from a parent bean definition (if applicable).
SCOPE_GLOBAL_SESSION - Static variable in interface org.springframework.web.context.request.RequestAttributes
Constant that indicates global session scope.
SCOPE_GLOBAL_SESSION - Static variable in interface org.springframework.web.context.WebApplicationContext
Scope identifier for global session scope: "globalSession".
SCOPE_KEY - Static variable in class org.springframework.beans.factory.support.PropertiesBeanDefinitionReader
Special key to distinguish owner.(scope)=prototype.
SCOPE_PAGE - Static variable in class org.springframework.web.util.TagUtils
Constant identifying the page scope
SCOPE_PROTOTYPE - Static variable in interface org.springframework.beans.factory.config.BeanDefinition
Scope identifier for the standard prototype scope: "prototype".
SCOPE_PROTOTYPE - Static variable in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Scope identifier for the standard prototype scope: "prototype".
SCOPE_REQUEST - Static variable in interface org.springframework.web.context.request.RequestAttributes
Constant that indicates request scope.
SCOPE_REQUEST - Static variable in interface org.springframework.web.context.WebApplicationContext
Scope identifier for request scope: "request".
SCOPE_REQUEST - Static variable in class org.springframework.web.util.TagUtils
Constant identifying the request scope
SCOPE_SESSION - Static variable in interface org.springframework.web.context.request.RequestAttributes
Constant that indicates session scope.
SCOPE_SESSION - Static variable in interface org.springframework.web.context.WebApplicationContext
Scope identifier for session scope: "session".
SCOPE_SESSION - Static variable in class org.springframework.web.util.TagUtils
Constant identifying the session scope
SCOPE_SINGLETON - Static variable in interface org.springframework.beans.factory.config.BeanDefinition
Scope identifier for the standard singleton scope: "singleton".
SCOPE_SINGLETON - Static variable in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Scope identifier for the standard singleton scope: "singleton".
ScopedBeanInterceptor - Class in org.springframework.orm.hibernate3.support
Hibernate3 interceptor used for getting the proper entity name for scoped beans.
ScopedBeanInterceptor() - Constructor for class org.springframework.orm.hibernate3.support.ScopedBeanInterceptor
ScopedObject - Interface in org.springframework.aop.scope
An AOP introduction interface for scoped objects.
ScopedProxyFactoryBean - Class in org.springframework.aop.scope
Convenient proxy factory bean for scoped objects.
ScopedProxyFactoryBean() - Constructor for class org.springframework.aop.scope.ScopedProxyFactoryBean
Create a new ScopedProxyFactoryBean instance.
ScopedProxyMode - Enum in org.springframework.context.annotation
Enumerates the various scoped-proxy options.
ScopedProxyUtils - Class in org.springframework.aop.scope
Utility class for creating a scoped proxy.
ScopedProxyUtils() - Constructor for class org.springframework.aop.scope.ScopedProxyUtils
ScopeMetadata - Class in org.springframework.context.annotation
Describes scope characteristics for a Spring-managed bean including the scope name and the scoped-proxy behavior.
ScopeMetadata() - Constructor for class org.springframework.context.annotation.ScopeMetadata
ScopeMetadataResolver - Interface in org.springframework.context.annotation
Strategy interface for resolving the scope of bean definitions.
ScriptCompilationException - Exception in org.springframework.scripting
Exception to be thrown on script compilation failure.
ScriptCompilationException(String) - Constructor for exception org.springframework.scripting.ScriptCompilationException
Constructor for ScriptCompilationException.
ScriptCompilationException(String, Throwable) - Constructor for exception org.springframework.scripting.ScriptCompilationException
Constructor for ScriptCompilationException.
ScriptCompilationException(ScriptSource, Throwable) - Constructor for exception org.springframework.scripting.ScriptCompilationException
Constructor for ScriptCompilationException.
ScriptCompilationException(ScriptSource, String, Throwable) - Constructor for exception org.springframework.scripting.ScriptCompilationException
Constructor for ScriptCompilationException.
ScriptFactory - Interface in org.springframework.scripting
Script definition interface, encapsulating the configuration of a specific script as well as a factory method for creating the actual scripted Java Object.
ScriptFactoryPostProcessor - Class in org.springframework.scripting.support
BeanPostProcessor that handles ScriptFactory definitions, replacing each factory with the actual scripted Java object generated by it.
ScriptFactoryPostProcessor() - Constructor for class org.springframework.scripting.support.ScriptFactoryPostProcessor
ScriptingDefaultsParser - Class in org.springframework.scripting.config
ScriptingDefaultsParser() - Constructor for class org.springframework.scripting.config.ScriptingDefaultsParser
ScriptSource - Interface in org.springframework.scripting
Interface that defines the source of a script.
SecurityContextProvider - Interface in org.springframework.beans.factory.support
Provider of the security context of the code running inside the bean factory.
Selection - Class in org.springframework.expression.spel.ast
Represents selection over a map or collection.
Selection(boolean, int, int, SpelNodeImpl) - Constructor for class org.springframework.expression.spel.ast.Selection
SelectTag - Class in org.springframework.web.servlet.tags.form
Databinding-aware JSP tag that renders an HTML 'select' element.
SelectTag() - Constructor for class org.springframework.web.servlet.tags.form.SelectTag
SelfNaming - Interface in org.springframework.jmx.export.naming
Interface that allows infrastructure components to provide their own ObjectNames to the MBeanExporter.
send(MessageCreator) - Method in interface org.springframework.jms.core.JmsOperations
Send a message to the default destination.
send(Destination, MessageCreator) - Method in interface org.springframework.jms.core.JmsOperations
Send a message to the specified destination.
send(String, MessageCreator) - Method in interface org.springframework.jms.core.JmsOperations
Send a message to the specified destination.
send(MessageCreator) - Method in class org.springframework.jms.core.JmsTemplate
send(Destination, MessageCreator) - Method in class org.springframework.jms.core.JmsTemplate
send(String, MessageCreator) - Method in class org.springframework.jms.core.JmsTemplate
send(MimeMessage) - Method in interface org.springframework.mail.javamail.JavaMailSender
Send the given JavaMail MIME message.
send(MimeMessage[]) - Method in interface org.springframework.mail.javamail.JavaMailSender
Send the given array of JavaMail MIME messages in batch.
send(MimeMessagePreparator) - Method in interface org.springframework.mail.javamail.JavaMailSender
Send the JavaMail MIME message prepared by the given MimeMessagePreparator.
send(MimeMessagePreparator[]) - Method in interface org.springframework.mail.javamail.JavaMailSender
Send the JavaMail MIME messages prepared by the given MimeMessagePreparators.
send(SimpleMailMessage) - Method in class org.springframework.mail.javamail.JavaMailSenderImpl
send(SimpleMailMessage[]) - Method in class org.springframework.mail.javamail.JavaMailSenderImpl
send(MimeMessage) - Method in class org.springframework.mail.javamail.JavaMailSenderImpl
send(MimeMessage[]) - Method in class org.springframework.mail.javamail.JavaMailSenderImpl
send(MimeMessagePreparator) - Method in class org.springframework.mail.javamail.JavaMailSenderImpl
send(MimeMessagePreparator[]) - Method in class org.springframework.mail.javamail.JavaMailSenderImpl
send(SimpleMailMessage) - Method in interface org.springframework.mail.MailSender
Send the given simple mail message.
send(SimpleMailMessage[]) - Method in interface org.springframework.mail.MailSender
Send the given array of simple mail messages in batch.
sendError(int, String) - Method in class org.springframework.mock.web.MockHttpServletResponse
sendError(int) - Method in class org.springframework.mock.web.MockHttpServletResponse
sendNotification(Notification) - Method in class org.springframework.jmx.export.notification.ModelMBeanNotificationPublisher
Send the supplied Notification using the wrapped ModelMBean instance.
sendNotification(Notification) - Method in interface org.springframework.jmx.export.notification.NotificationPublisher
Send the specified Notification to all registered NotificationListeners.
sendRedirect(String) - Method in class org.springframework.mock.web.MockHttpServletResponse
sendRedirect(String) - Method in class org.springframework.mock.web.portlet.MockActionResponse
sendRedirect(String, String) - Method in class org.springframework.mock.web.portlet.MockActionResponse
sendRedirect(HttpServletRequest, HttpServletResponse, String, boolean) - Method in class org.springframework.web.servlet.view.RedirectView
Send a redirect back to the HTTP client
sendResponse(Session, Destination, Message) - Method in class org.springframework.jms.listener.adapter.MessageListenerAdapter
Send the given response message to the given destination.
sendResponse(Session, Destination, Message) - Method in class org.springframework.jms.listener.adapter.MessageListenerAdapter102
Deprecated. Overrides the superclass method to use the JMS 1.0.2 API to send a response.
SEPARATOR - Static variable in class org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator
Separator between prefix and remainder of bean name
SEPARATOR - Static variable in class org.springframework.beans.factory.support.PropertiesBeanDefinitionReader
Separator between bean name and property name.
serializeState() - Method in class org.springframework.mock.web.MockHttpSession
Serialize the attributes of this session into an object that can be turned into a byte array with standard Java serialization.
series() - Method in enum org.springframework.http.HttpStatus
Returns the HTTP status series of this status code.
server - Variable in class org.springframework.jmx.support.MBeanRegistrationSupport
The MBeanServer instance being used to register beans.
serveResource(ResourceRequest, ResourceResponse) - Method in class org.springframework.web.portlet.FrameworkPortlet
ServerHttpRequest - Interface in org.springframework.http.server
Represents a server-side HTTP request.
ServerHttpResponse - Interface in org.springframework.http.server
Represents a server-side HTTP response.
Service - Annotation Type in org.springframework.stereotype
Indicates that an annotated class is a "Service" (e.g.
service(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.context.support.HttpRequestHandlerServlet
ServiceFactoryBean - Class in org.springframework.beans.factory.serviceloader
FactoryBean that exposes the 'primary' service for the configured service class, obtained through the JDK 1.6 ServiceLoader facility.
ServiceFactoryBean() - Constructor for class org.springframework.beans.factory.serviceloader.ServiceFactoryBean
ServiceListFactoryBean - Class in org.springframework.beans.factory.serviceloader
FactoryBean that exposes all services for the configured service class, represented as a List of service objects, obtained through the JDK 1.6 ServiceLoader facility.
ServiceListFactoryBean() - Constructor for class org.springframework.beans.factory.serviceloader.ServiceListFactoryBean
ServiceLoaderFactoryBean - Class in org.springframework.beans.factory.serviceloader
FactoryBean that exposes the JDK 1.6 ServiceLoader for the configured service class.
ServiceLoaderFactoryBean() - Constructor for class org.springframework.beans.factory.serviceloader.ServiceLoaderFactoryBean
ServiceLocatorFactoryBean - Class in org.springframework.beans.factory.config
A FactoryBean implementation that takes an interface which must have one or more methods with the signatures MyType xxx() or MyType xxx(MyIdType id) (typically, MyService getService() or MyService getService(String id)) and creates a dynamic proxy which implements that interface, delegating to an underlying BeanFactory.
ServiceLocatorFactoryBean() - Constructor for class org.springframework.beans.factory.config.ServiceLocatorFactoryBean
SERVLET_CONFIG_BEAN_NAME - Static variable in interface org.springframework.web.context.ConfigurableWebApplicationContext
Name of the ServletConfig environment bean in the factory.
SERVLET_CONTEXT_BEAN_NAME - Static variable in interface org.springframework.web.context.WebApplicationContext
Name of the ServletContext environment bean in the factory.
SERVLET_CONTEXT_PREFIX - Static variable in class org.springframework.web.servlet.FrameworkServlet
Prefix for the ServletContext attribute for the WebApplicationContext.
SERVLET_CONTEXT_PREFIX - Static variable in class org.springframework.web.struts.ContextLoaderPlugIn
Deprecated. Prefix for the ServletContext attribute for the WebApplicationContext.
ServletConfigAware - Interface in org.springframework.web.context
Interface to be implemented by any object that wishes to be notified of the ServletConfig (typically determined by the WebApplicationContext) that it runs in.
ServletContextAttributeExporter - Class in org.springframework.web.context.support
Exporter that takes Spring-defined objects and exposes them as ServletContext attributes.
ServletContextAttributeExporter() - Constructor for class org.springframework.web.context.support.ServletContextAttributeExporter
ServletContextAttributeFactoryBean - Class in org.springframework.web.context.support
FactoryBean that fetches a specific, existing ServletContext attribute.
ServletContextAttributeFactoryBean() - Constructor for class org.springframework.web.context.support.ServletContextAttributeFactoryBean
ServletContextAware - Interface in org.springframework.web.context
Interface to be implemented by any object that wishes to be notified of the ServletContext (typically determined by the WebApplicationContext) that it runs in.
ServletContextAwareProcessor - Class in org.springframework.web.context.support
BeanPostProcessor implementation that passes the ServletContext to beans that implement the ServletContextAware interface.
ServletContextAwareProcessor(ServletContext) - Constructor for class org.springframework.web.context.support.ServletContextAwareProcessor
Create a new ServletContextAwareProcessor for the given context.
ServletContextAwareProcessor(ServletConfig) - Constructor for class org.springframework.web.context.support.ServletContextAwareProcessor
Create a new ServletContextAwareProcessor for the given config.
ServletContextAwareProcessor(ServletContext, ServletConfig) - Constructor for class org.springframework.web.context.support.ServletContextAwareProcessor
Create a new ServletContextAwareProcessor for the given context and config.
ServletContextFactoryBean - Class in org.springframework.web.context.support
Deprecated. as of Spring 3.0, since "servletContext" is now available as a default bean in every WebApplicationContext
ServletContextFactoryBean() - Constructor for class org.springframework.web.context.support.ServletContextFactoryBean
Deprecated.
ServletContextParameterFactoryBean - Class in org.springframework.web.context.support
FactoryBean that retrieves a specific ServletContext init parameter (that is, a "context-param" defined in web.xml).
ServletContextParameterFactoryBean() - Constructor for class org.springframework.web.context.support.ServletContextParameterFactoryBean
ServletContextPropertyPlaceholderConfigurer - Class in org.springframework.web.context.support
Subclass of PropertyPlaceholderConfigurer that resolves placeholders as ServletContext init parameters (that is, web.xml context-param entries).
ServletContextPropertyPlaceholderConfigurer() - Constructor for class org.springframework.web.context.support.ServletContextPropertyPlaceholderConfigurer
ServletContextRequestLoggingFilter - Class in org.springframework.web.filter
Simple request logging filter that writes the request URI (and optionally the query string) to the ServletContext log.
ServletContextRequestLoggingFilter() - Constructor for class org.springframework.web.filter.ServletContextRequestLoggingFilter
ServletContextResource - Class in org.springframework.web.context.support
Resource implementation for ServletContext resources, interpreting relative paths within the web application root directory.
ServletContextResource(ServletContext, String) - Constructor for class org.springframework.web.context.support.ServletContextResource
Create a new ServletContextResource.
ServletContextResourceLoader - Class in org.springframework.web.context.support
ResourceLoader implementation that resolves paths as ServletContext resources, for use outside a WebApplicationContext (for example, in an HttpServletBean or GenericFilterBean subclass).
ServletContextResourceLoader(ServletContext) - Constructor for class org.springframework.web.context.support.ServletContextResourceLoader
Create a new ServletContextResourceLoader.
ServletContextResourcePatternResolver - Class in org.springframework.web.context.support
ServletContext-aware subclass of PathMatchingResourcePatternResolver, able to find matching resources below the web application root directory via Servlet 2.3's ServletContext.getResourcePaths.
ServletContextResourcePatternResolver(ServletContext) - Constructor for class org.springframework.web.context.support.ServletContextResourcePatternResolver
Create a new ServletContextResourcePatternResolver.
ServletContextResourcePatternResolver(ResourceLoader) - Constructor for class org.springframework.web.context.support.ServletContextResourcePatternResolver
Create a new ServletContextResourcePatternResolver.
ServletContextScope - Class in org.springframework.web.context.support
Scope wrapper for a ServletContext, i.e.
ServletContextScope(ServletContext) - Constructor for class org.springframework.web.context.support.ServletContextScope
Create a new Scope wrapper for the given ServletContext.
ServletEndpointSupport - Class in org.springframework.remoting.jaxrpc
Deprecated. in favor of JAX-WS support in org.springframework.remoting.jaxws
ServletEndpointSupport() - Constructor for class org.springframework.remoting.jaxrpc.ServletEndpointSupport
Deprecated.
ServletForwardingController - Class in org.springframework.web.servlet.mvc
Spring Controller implementation that forwards to a named servlet, i.e.
ServletForwardingController() - Constructor for class org.springframework.web.servlet.mvc.ServletForwardingController
ServletRequestAttributes - Class in org.springframework.web.context.request
Servlet-based implementation of the RequestAttributes interface.
ServletRequestAttributes(HttpServletRequest) - Constructor for class org.springframework.web.context.request.ServletRequestAttributes
Create a new ServletRequestAttributes instance for the given request.
ServletRequestBindingException - Exception in org.springframework.web.bind
Fatal binding exception, thrown when we want to treat binding exceptions as unrecoverable.
ServletRequestBindingException(String) - Constructor for exception org.springframework.web.bind.ServletRequestBindingException
Constructor for ServletRequestBindingException.
ServletRequestBindingException(String, Throwable) - Constructor for exception org.springframework.web.bind.ServletRequestBindingException
Constructor for ServletRequestBindingException.
ServletRequestDataBinder - Class in org.springframework.web.bind
Special DataBinder to perform data binding from servlet request parameters to JavaBeans, including support for multipart files.
ServletRequestDataBinder(Object) - Constructor for class org.springframework.web.bind.ServletRequestDataBinder
Create a new ServletRequestDataBinder instance, with default object name.
ServletRequestDataBinder(Object, String) - Constructor for class org.springframework.web.bind.ServletRequestDataBinder
Create a new ServletRequestDataBinder instance.
ServletRequestHandledEvent - Class in org.springframework.web.context.support
Servlet-specific subclass of RequestHandledEvent, adding servlet-specific context information.
ServletRequestHandledEvent(Object, String, String, String, String, String, String, long) - Constructor for class org.springframework.web.context.support.ServletRequestHandledEvent
Create a new ServletRequestHandledEvent.
ServletRequestHandledEvent(Object, String, String, String, String, String, String, long, Throwable) - Constructor for class org.springframework.web.context.support.ServletRequestHandledEvent
Create a new ServletRequestHandledEvent.
ServletRequestParameterPropertyValues - Class in org.springframework.web.bind
PropertyValues implementation created from parameters in a ServletRequest.
ServletRequestParameterPropertyValues(ServletRequest) - Constructor for class org.springframework.web.bind.ServletRequestParameterPropertyValues
Create new ServletRequestPropertyValues using no prefix (and hence, no prefix separator).
ServletRequestParameterPropertyValues(ServletRequest, String) - Constructor for class org.springframework.web.bind.ServletRequestParameterPropertyValues
Create new ServletRequestPropertyValues using the given prefix and the default prefix separator (the underscore character "_").
ServletRequestParameterPropertyValues(ServletRequest, String, String) - Constructor for class org.springframework.web.bind.ServletRequestParameterPropertyValues
Create new ServletRequestPropertyValues supplying both prefix and prefix separator.
ServletRequestUtils - Class in org.springframework.web.bind
Parameter extraction methods, for an approach distinct from data binding, in which parameters of specific types are required.
ServletRequestUtils() - Constructor for class org.springframework.web.bind.ServletRequestUtils
ServletServerHttpRequest - Class in org.springframework.http.server
ServerHttpRequest implementation that is based on a HttpServletRequest.
ServletServerHttpRequest(HttpServletRequest) - Constructor for class org.springframework.http.server.ServletServerHttpRequest
Construct a new instance of the ServletServerHttpRequest based on the given HttpServletRequest
ServletServerHttpResponse - Class in org.springframework.http.server
ServerHttpResponse implementation that is based on a HttpServletResponse.
ServletServerHttpResponse(HttpServletResponse) - Constructor for class org.springframework.http.server.ServletServerHttpResponse
Construct a new instance of the ServletServerHttpResponse based on the given HttpServletResponse.
ServletWebRequest - Class in org.springframework.web.context.request
WebRequest adapter for an HttpServletRequest.
ServletWebRequest(HttpServletRequest) - Constructor for class org.springframework.web.context.request.ServletWebRequest
Create a new ServletWebRequest instance for the given request.
ServletWebRequest(HttpServletRequest, HttpServletResponse) - Constructor for class org.springframework.web.context.request.ServletWebRequest
Create a new ServletWebRequest instance for the given request/response pair.
ServletWrappingController - Class in org.springframework.web.servlet.mvc
Spring Controller implementation that wraps a servlet instance which it manages internally.
ServletWrappingController() - Constructor for class org.springframework.web.servlet.mvc.ServletWrappingController
ServletWrappingPortletContext - Class in org.springframework.mock.web.portlet
Mock implementation of the PortletContext interface, wrapping an underlying ServletContext.
ServletWrappingPortletContext(ServletContext) - Constructor for class org.springframework.mock.web.portlet.ServletWrappingPortletContext
Create a new PortletContext wrapping the given ServletContext.
SESSION_COOKIE_NAME - Static variable in class org.springframework.mock.web.MockHttpSession
SESSION_MUTEX_ATTRIBUTE - Static variable in class org.springframework.web.util.WebUtils
Key for the mutex session attribute
SESSION_SYNCHRONIZATION_ORDER - Static variable in class org.springframework.orm.hibernate3.SessionFactoryUtils
Order value for TransactionSynchronization objects that clean up Hibernate Sessions.
SessionAttributes - Annotation Type in org.springframework.web.bind.annotation
Annotation that indicates the session attributes that a specific handler uses.
SessionAttributeStore - Interface in org.springframework.web.bind.support
Strategy interface for storing model attributes in a backend session.
SessionAwareMessageListener<M extends Message> - Interface in org.springframework.jms.listener
Variant of the standard JMS MessageListener interface, offering not only the received Message but also the underlying JMS Session object.
SessionCallback<T> - Interface in org.springframework.jms.core
Callback for executing any number of operations on a provided Session.
sessionCreated(HttpSessionEvent) - Method in class org.springframework.web.util.HttpSessionMutexListener
sessionDestroyed(HttpSessionEvent) - Method in class org.springframework.web.util.HttpSessionMutexListener
SessionFactoryUtils - Class in org.springframework.orm.hibernate3
Helper class featuring methods for Hibernate Session handling, allowing for reuse of Hibernate Session instances within transactions.
SessionFactoryUtils() - Constructor for class org.springframework.orm.hibernate3.SessionFactoryUtils
SessionHolder - Class in org.springframework.orm.hibernate3
Session holder, wrapping a Hibernate Session and a Hibernate Transaction.
SessionHolder(Session) - Constructor for class org.springframework.orm.hibernate3.SessionHolder
SessionHolder(Object, Session) - Constructor for class org.springframework.orm.hibernate3.SessionHolder
SessionLocaleResolver - Class in org.springframework.web.servlet.i18n
Implementation of LocaleResolver that uses a locale attribute in the user's session in case of a custom setting, with a fallback to the specified default locale or the request's accept-header locale.
SessionLocaleResolver() - Constructor for class org.springframework.web.servlet.i18n.SessionLocaleResolver
SessionProxy - Interface in org.springframework.jms.connection
Subinterface of Session to be implemented by Session proxies.
SessionScope - Class in org.springframework.web.context.request
Session-backed Scope implementation.
SessionScope() - Constructor for class org.springframework.web.context.request.SessionScope
Create a new SessionScope, storing attributes in a locally isolated session (or default session, if there is no distinction between a global session and a component-specific session).
SessionScope(boolean) - Constructor for class org.springframework.web.context.request.SessionScope
Create a new SessionScope, specifying whether to store attributes in the global session, provided that such a distinction is available.
SessionStatus - Interface in org.springframework.web.bind.support
Simple interface that can be injected into handler methods, allowing them to signal that their session processing is complete.
SessionThemeResolver - Class in org.springframework.web.servlet.theme
Implementation of ThemeResolver that uses a theme attribute in the user's session in case of a custom setting, with a fallback to the default theme.
SessionThemeResolver() - Constructor for class org.springframework.web.servlet.theme.SessionThemeResolver
set(String, String) - Method in class org.springframework.http.HttpHeaders
Set the given, single header value under the given name.
set(int, E) - Method in class org.springframework.util.AutoPopulatingList
set(K, V) - Method in class org.springframework.util.LinkedMultiValueMap
set(K, V) - Method in interface org.springframework.util.MultiValueMap
Set the given single value under the given key.
set$AroundClosure(AroundClosure) - Method in class org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint
SET_ELEMENT - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
setAbstract(boolean) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Set if this bean is "abstract", i.e.
setAbstract(boolean) - Method in class org.springframework.beans.factory.support.BeanDefinitionBuilder
Set whether or not this definition is abstract.
setAccept(List<MediaType>) - Method in class org.springframework.http.HttpHeaders
Set the list of acceptable media types, as specified by the Accept header.
setAcceptCharset(List<Charset>) - Method in class org.springframework.http.HttpHeaders
Set the list of acceptable charsets, as specified by the Accept-Charset header.
setAcceptCharset(String) - Method in class org.springframework.web.servlet.tags.form.FormTag
Set the value of the 'acceptCharset' attribute.
setAcceptGzipEncoding(boolean) - Method in class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
Set whether to accept GZIP encoding, that is, whether to send the HTTP "Accept-Encoding" header with "gzip" as value.
setAcceptMessagesWhileStopping(boolean) - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Set whether to accept received messages while the listener container in the process of stopping.
setAccessCallParameterMetaData(boolean) - Method in class org.springframework.jdbc.core.metadata.CallMetaDataContext
Specify whether call parameter metadata should be accessed.
setAccessCallParameterMetaData(boolean) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Specify whether the parameter metadata for the call should be used.
setAccesskey(String) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
Set the value of the 'accesskey' attribute.
setAccessTableColumnMetaData(boolean) - Method in class org.springframework.jdbc.core.metadata.TableMetaDataContext
Specify whether we should access table column meta data.
setAccessTableColumnMetaData(boolean) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Specify whether the parameter metadata for the call should be used.
setAcknowledgeMode(int) - Method in class org.springframework.jms.listener.endpoint.JmsActivationSpecConfig
Set the JMS acknowledgement mode to use.
setAcknowledgeModeName(String) - Method in class org.springframework.jms.listener.endpoint.JmsActivationSpecConfig
Set the JMS acknowledgement mode by the name of the corresponding constant in the JMS Session interface, e.g.
setAction(String) - Method in class org.springframework.web.servlet.tags.form.FormTag
Set the value of the 'action' attribute.
setActivationSpec(ActivationSpec) - Method in class org.springframework.jca.endpoint.GenericMessageEndpointManager
Set the JCA ActivationSpec to use for activating the endpoint.
setActivationSpecClass(Class) - Method in class org.springframework.jms.listener.endpoint.StandardJmsActivationSpecFactory
Specify the fully-qualified ActivationSpec class name for the target provider (e.g.
setActivationSpecConfig(JmsActivationSpecConfig) - Method in class org.springframework.jms.listener.endpoint.JmsMessageEndpointManager
Specify the JmsActivationSpecConfig object that this endpoint manager should use for activating its listener.
setActivationSpecFactory(JmsActivationSpecFactory) - Method in class org.springframework.jms.listener.endpoint.JmsMessageEndpointManager
Set the factory for concrete JCA 1.5 ActivationSpec objects, creating JCA ActivationSpecs based on JmsActivationSpecConfig objects.
setActualTransactionActive(boolean) - Static method in class org.springframework.transaction.support.TransactionSynchronizationManager
Expose whether there currently is an actual transaction active.
setAdapters(XmlAdapter<?, ?>[]) - Method in class org.springframework.oxm.jaxb.Jaxb2Marshaller
Specify the XmlAdapters to be registered with the JAXB Marshaller and Unmarshaller
setAdvice(Advice) - Method in class org.springframework.aop.support.AbstractGenericPointcutAdvisor
Specify the advice that this advisor should apply.
setAdvice(Advice) - Method in class org.springframework.aop.support.StaticMethodMatcherPointcutAdvisor
setAdviceBeanName(String) - Method in class org.springframework.aop.support.AbstractBeanFactoryPointcutAdvisor
Specify the name of the advice bean that this advisor should refer to.
setAdvisorAdapterRegistry(AdvisorAdapterRegistry) - Method in class org.springframework.aop.framework.AbstractSingletonProxyFactoryBean
Specify the AdvisorAdapterRegistry to use.
setAdvisorAdapterRegistry(AdvisorAdapterRegistry) - Method in class org.springframework.aop.framework.adapter.AdvisorAdapterRegistrationManager
Specify the AdvisorAdapterRegistry to register AdvisorAdapter beans with.
setAdvisorAdapterRegistry(AdvisorAdapterRegistry) - Method in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
Specify the AdvisorAdapterRegistry to use.
setAdvisorAdapterRegistry(AdvisorAdapterRegistry) - Method in class org.springframework.aop.framework.ProxyFactoryBean
Specify the AdvisorAdapterRegistry to use.
setAdvisorBeanNamePrefix(String) - Method in class org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator
Set the prefix for bean names that will cause them to be included for auto-proxying by this object.
setAdvisorChainFactory(AdvisorChainFactory) - Method in class org.springframework.aop.framework.AdvisedSupport
Set the advisor chain factory to use.
setAfterInitialization(boolean) - Method in class org.springframework.validation.beanvalidation.BeanValidationPostProcessor
Choose whether to perform validation after bean initialization (i.e.
setAfterMessagePrefix(String) - Method in class org.springframework.web.filter.AbstractRequestLoggingFilter
Set the value that should be prepended to the log message written after a request is processed.
setAfterMessageSuffix(String) - Method in class org.springframework.web.filter.AbstractRequestLoggingFilter
Set the value that should be appended to the log message written after a request is processed.
setAgentId(String) - Method in class org.springframework.jmx.access.MBeanClientInterceptor
Set the agent id of the MBeanServer to locate.
setAgentId(String) - Method in class org.springframework.jmx.access.NotificationListenerRegistrar
Set the agent id of the MBeanServer to locate.
setAgentId(String) - Method in class org.springframework.jmx.support.MBeanServerFactoryBean
Set the agent id of the MBeanServer to locate.
setAliases(Map<String, ?>) - Method in class org.springframework.oxm.xstream.XStreamMarshaller
Sets an alias/type map, consisting of string aliases mapped to classes.
setAll(Map<String, String>) - Method in class org.springframework.http.HttpHeaders
setAll(Map<K, V>) - Method in class org.springframework.util.LinkedMultiValueMap
setAll(Map<K, V>) - Method in interface org.springframework.util.MultiValueMap
Set the given values under.
setAllow(Set<HttpMethod>) - Method in class org.springframework.http.HttpHeaders
Set the set of allowed HTTP methods, as specified by the Allow header.
setAllowBeanDefinitionOverriding(boolean) - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
Set whether it should be allowed to override bean definitions by registering a different definition with the same name, automatically replacing the former.
setAllowBeanDefinitionOverriding(boolean) - Method in class org.springframework.context.support.AbstractRefreshableApplicationContext
Set whether it should be allowed to override bean definitions by registering a different definition with the same name, automatically replacing the former.
setAllowBeanDefinitionOverriding(boolean) - Method in class org.springframework.context.support.GenericApplicationContext
Set whether it should be allowed to override bean definitions by registering a different definition with the same name, automatically replacing the former.
setAllowCircularReferences(boolean) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Set whether to allow circular references between beans - and automatically try to resolve them.
setAllowCircularReferences(boolean) - Method in class org.springframework.context.support.AbstractRefreshableApplicationContext
Set whether to allow circular references between beans - and automatically try to resolve them.
setAllowCircularReferences(boolean) - Method in class org.springframework.context.support.GenericApplicationContext
Set whether to allow circular references between beans - and automatically try to resolve them.
setAllowCoreThreadTimeOut(boolean) - Method in class org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor
Specify whether to allow core threads to time out.
setAllowCoreThreadTimeOut(boolean) - Method in class org.springframework.scheduling.concurrent.ThreadPoolExecutorFactoryBean
Specify whether to allow core threads to time out.
setAllowCoreThreadTimeOut(boolean) - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
Specify whether to allow core threads to time out.
setAllowCreate(boolean) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
Set if a new Session should be created when no transactional Session can be found for the current thread.
setAllowCreate(boolean) - Method in class org.springframework.orm.jdo.JdoTemplate
Set if a new PersistenceManager should be created when no transactional PersistenceManager can be found for the current thread.
setAllowCreate(boolean) - Method in class org.springframework.orm.jdo.support.SpringPersistenceManagerProxyBean
Set whether the PersistenceManagerFactory proxy is allowed to create a non-transactional PersistenceManager when no transactional PersistenceManager can be found for the current thread.
setAllowCreate(boolean) - Method in class org.springframework.orm.jdo.TransactionAwarePersistenceManagerFactoryProxy
Set whether the PersistenceManagerFactory proxy is allowed to create a non-transactional PersistenceManager when no transactional PersistenceManager can be found for the current thread.
setAllowCustomIsolationLevels(boolean) - Method in class org.springframework.transaction.jta.JtaTransactionManager
Set whether to allow custom isolation levels to be specified.
setAllowDirtyBack(boolean) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Set if "dirty back" is allowed, i.e.
setAllowDirtyBack(boolean) - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Set if "dirty back" is allowed, that is, if moving to a former wizard page is allowed in case of validation errors for the current page.
setAllowDirtyForward(boolean) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Set if "dirty forward" is allowed, i.e.
setAllowDirtyForward(boolean) - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Set if "dirty forward" is allowed, that is, if moving to a later wizard page is allowed in case of validation errors for the current page.
setAllowDuplicateParameters(boolean) - Method in class org.springframework.web.portlet.handler.PortletModeParameterHandlerMapping
Set whether to allow duplicate parameter values across different portlet modes.
setAllowEagerClassLoading(boolean) - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
Set whether the factory is allowed to eagerly load bean classes even for bean definitions that are marked as "lazy-init".
setAllowEagerInit(boolean) - Method in class org.springframework.jmx.export.MBeanExporter
Specify whether to allow eager initialization of candidate beans when autodetecting MBeans in the Spring application context.
setAllowedFields(String...) - Method in class org.springframework.validation.DataBinder
Register fields that should be allowed for binding.
setAllowedResources(String) - Method in class org.springframework.web.servlet.ResourceServlet
Set allowed resources as URL pattern, e.g.
setAllowRawInjectionDespiteWrapping(boolean) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Set whether to allow the raw injection of a bean instance into some other bean's property, despite the injected bean eventually getting wrapped (for example, through AOP auto-proxying).
setAllowRequestOverride(boolean) - Method in class org.springframework.web.servlet.view.AbstractTemplateView
Set whether HttpServletRequest attributes are allowed to override (hide) controller generated model attributes of the same name.
setAllowRequestOverride(boolean) - Method in class org.springframework.web.servlet.view.AbstractTemplateViewResolver
Set whether HttpServletRequest attributes are allowed to override (hide) controller generated model attributes of the same name.
setAllowSessionOverride(boolean) - Method in class org.springframework.web.servlet.view.AbstractTemplateView
Set whether HttpSession attributes are allowed to override (hide) controller generated model attributes of the same name.
setAllowSessionOverride(boolean) - Method in class org.springframework.web.servlet.view.AbstractTemplateViewResolver
Set whether HttpSession attributes are allowed to override (hide) controller generated model attributes of the same name.
setAlt(String) - Method in class org.springframework.web.servlet.tags.form.InputTag
Set the value of the 'alt' attribute.
setAlwaysCreate(boolean) - Method in class org.springframework.remoting.rmi.RmiRegistryFactoryBean
Set whether to always create the registry in-process, not attempting to locate an existing registry at the specified port.
setAlwaysCreateRegistry(boolean) - Method in class org.springframework.remoting.rmi.RmiServiceExporter
Set whether to always create the registry in-process, not attempting to locate an existing registry at the specified port.
setAlwaysInclude(boolean) - Method in class org.springframework.web.servlet.view.InternalResourceView
Specify whether to always include the view rather than forward to it.
setAlwaysInclude(boolean) - Method in class org.springframework.web.servlet.view.InternalResourceViewResolver
Specify whether to always include the view rather than forward to it.
setAlwaysTranslate(boolean) - Method in class org.springframework.dao.support.PersistenceExceptionTranslationInterceptor
Specify whether to always translate the exception ("true"), or whether throw the raw exception when declared, i.e.
setAlwaysUseFullPath(boolean) - Method in class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
Set if URL lookup should always use the full path within the current servlet context.
setAlwaysUseFullPath(boolean) - Method in class org.springframework.web.servlet.mvc.AbstractUrlViewController
Set if URL lookup should always use full path within current servlet context.
setAlwaysUseFullPath(boolean) - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
Set if URL lookup should always use the full path within the current servlet context.
setAlwaysUseFullPath(boolean) - Method in class org.springframework.web.servlet.mvc.multiaction.AbstractUrlMethodNameResolver
Set if URL lookup should always use full path within current servlet context.
setAlwaysUseFullPath(boolean) - Method in class org.springframework.web.servlet.mvc.WebContentInterceptor
Set if URL lookup should always use full path within current servlet context.
setAlwaysUseFullPath(boolean) - Method in class org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator
Set if URL lookup should always use the full path within the current servlet context.
setAlwaysUseFullPath(boolean) - Method in class org.springframework.web.util.UrlPathHelper
Set if URL lookup should always use full path within current servlet context.
setAlwaysUseJndiLookup(boolean) - Method in class org.springframework.context.annotation.CommonAnnotationBeanPostProcessor
Set whether to always use JNDI lookups equivalent to standard Java EE 5 resource injection, even for name attributes and default names.
setAlwaysUseMessageFormat(boolean) - Method in class org.springframework.context.support.MessageSourceSupport
Set whether to always apply the MessageFormat rules, parsing even messages without arguments.
setAlwaysUseNewSession(boolean) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
Set whether to always use a new Hibernate Session for this template.
setAnnotatedClass(Class<?>) - Method in class org.springframework.oxm.xstream.XStreamMarshaller
Set the classes for which mappings will be read from class-level JDK 1.5+ annotation metadata.
setAnnotatedClasses(Class[]) - Method in class org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean
Specify annotated classes, for which mappings will be read from class-level JDK 1.5+ annotation metadata.
setAnnotatedClasses(Class<?>[]) - Method in class org.springframework.oxm.xstream.XStreamMarshaller
Set annotated classes for which aliases will be read from class-level JDK 1.5+ annotation metadata.
setAnnotatedPackages(String[]) - Method in class org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean
Specify the names of annotated packages, for which package-level JDK 1.5+ annotation metadata will be read.
setAopProxyFactory(AopProxyFactory) - Method in class org.springframework.aop.framework.ProxyCreatorSupport
Customize the AopProxyFactory, allowing different strategies to be dropped in without changing the core framework.
setApplicationContext(ApplicationContext) - Method in interface org.springframework.context.ApplicationContextAware
Set the ApplicationContext that this object runs in.
setApplicationContext(ApplicationContext) - Method in class org.springframework.context.support.ApplicationObjectSupport
setApplicationContext(ApplicationContext) - Method in class org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor
setApplicationContext(ApplicationContext) - Method in class org.springframework.scheduling.quartz.JobDetailBean
setApplicationContext(ApplicationContext) - Method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
setApplicationContext(ApplicationContext) - Method in class org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests
Sets the ApplicationContext to be used by this test instance, provided via ApplicationContextAware semantics.
setApplicationContext(ApplicationContext) - Method in class org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests
Set the ApplicationContext to be used by this test instance, provided via ApplicationContextAware semantics.
setApplicationContext(ApplicationContext) - Method in class org.springframework.test.context.testng.AbstractTestNGSpringContextTests
Set the ApplicationContext to be used by this test instance, provided via ApplicationContextAware semantics.
setApplicationContext(ApplicationContext) - Method in class org.springframework.validation.beanvalidation.LocalValidatorFactoryBean
setApplicationContextJobDataKey(String) - Method in class org.springframework.scheduling.quartz.JobDetailBean
Set the key of an ApplicationContext reference to expose in the JobDataMap, for example "applicationContext".
setApplicationContextSchedulerContextKey(String) - Method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
Set the key of an ApplicationContext reference to expose in the SchedulerContext, for example "applicationContext".
setApplicationEventClass(Class) - Method in class org.springframework.context.event.EventPublicationInterceptor
Set the application event class to publish.
setApplicationEventPublisher(ApplicationEventPublisher) - Method in interface org.springframework.context.ApplicationEventPublisherAware
Set the ApplicationEventPublisher that this object runs in.
setApplicationEventPublisher(ApplicationEventPublisher) - Method in class org.springframework.context.event.EventPublicationInterceptor
setApplyCommonInterceptorsFirst(boolean) - Method in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
Set whether the common interceptors should be applied before bean-specific ones.
setApplyLastModified(boolean) - Method in class org.springframework.web.servlet.ResourceServlet
Set whether to apply the file timestamp of the target resource as last-modified value.
setApplyWebRequestInterceptorsToRenderPhaseOnly(boolean) - Method in class org.springframework.web.portlet.handler.AbstractHandlerMapping
Specify whether to apply WebRequestInterceptors to the Portlet render phase only ("true", or whether to apply them to the Portlet action phase as well ("false").
setArgumentNames(String) - Method in class org.springframework.aop.aspectj.AbstractAspectJAdvice
Set by creator of this advice object if the argument names are known.
setArgumentNamesFromStringArray(String[]) - Method in class org.springframework.aop.aspectj.AbstractAspectJAdvice
setArguments(Object[]) - Method in class org.springframework.aop.framework.ReflectiveMethodInvocation
setArguments(Object[]) - Method in interface org.springframework.aop.ProxyMethodInvocation
Set the arguments to be used on subsequent invocations in the any advice in this chain.
setArguments(Object[]) - Method in class org.springframework.remoting.support.RemoteInvocation
Set the arguments for the target method call.
setArguments(Object[]) - Method in class org.springframework.util.MethodInvoker
Set arguments for the method invocation.
setArguments(Object) - Method in class org.springframework.web.servlet.tags.MessageTag
Set optional message arguments for this tag, as a comma-delimited String (each String argument can contain JSP EL), an Object array (used as argument array), or a single Object (used as single argument).
setArgumentSeparator(String) - Method in class org.springframework.web.servlet.tags.MessageTag
Set the separator to use for splitting an arguments String.
setAscending(boolean) - Method in class org.springframework.beans.support.MutableSortDefinition
Set whether to sort ascending (true) or descending (false).
setAscending(boolean) - Method in class org.springframework.util.comparator.InvertibleComparator
Specify the sort order: ascending (true) or descending (false).
setAscendingOrder(int) - Method in class org.springframework.util.comparator.CompoundComparator
Change the sort order at the given index to ascending.
setAspectBeanName(String) - Method in class org.springframework.aop.config.SimpleBeanFactoryAwareAspectInstanceFactory
Set the name of the aspect bean.
setAspectJAdvisorFactory(AspectJAdvisorFactory) - Method in class org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator
setAspectName(String) - Method in class org.springframework.aop.aspectj.AbstractAspectJAdvice
setAssembler(MBeanInfoAssembler) - Method in class org.springframework.jmx.export.MBeanExporter
Set the implementation of the MBeanInfoAssembler interface to use for this exporter.
setAsText(String) - Method in class org.springframework.beans.propertyeditors.ByteArrayPropertyEditor
setAsText(String) - Method in class org.springframework.beans.propertyeditors.CharacterEditor
setAsText(String) - Method in class org.springframework.beans.propertyeditors.CharArrayPropertyEditor
setAsText(String) - Method in class org.springframework.beans.propertyeditors.CharsetEditor
setAsText(String) - Method in class org.springframework.beans.propertyeditors.ClassArrayEditor
setAsText(String) - Method in class org.springframework.beans.propertyeditors.ClassEditor
setAsText(String) - Method in class org.springframework.beans.propertyeditors.CurrencyEditor
setAsText(String) - Method in class org.springframework.beans.propertyeditors.CustomBooleanEditor
setAsText(String) - Method in class org.springframework.beans.propertyeditors.CustomCollectionEditor
Convert the given text value to a Collection with a single element.
setAsText(String) - Method in class org.springframework.beans.propertyeditors.CustomDateEditor
Parse the Date from the given text, using the specified DateFormat.
setAsText(String) - Method in class org.springframework.beans.propertyeditors.CustomMapEditor
Convert the given text value to a Map with a single element.
setAsText(String) - Method in class org.springframework.beans.propertyeditors.CustomNumberEditor
Parse the Number from the given text, using the specified NumberFormat.
setAsText(String) - Method in class org.springframework.beans.propertyeditors.FileEditor
setAsText(String) - Method in class org.springframework.beans.propertyeditors.InputStreamEditor
setAsText(String) - Method in class org.springframework.beans.propertyeditors.LocaleEditor
setAsText(String) - Method in class org.springframework.beans.propertyeditors.PatternEditor
setAsText(String) - Method in class org.springframework.beans.propertyeditors.PropertiesEditor
Convert String into Properties, considering it as properties content.
setAsText(String) - Method in class org.springframework.beans.propertyeditors.ResourceBundleEditor
setAsText(String) - Method in class org.springframework.beans.propertyeditors.StringArrayPropertyEditor
setAsText(String) - Method in class org.springframework.beans.propertyeditors.StringTrimmerEditor
setAsText(String) - Method in class org.springframework.beans.propertyeditors.TimeZoneEditor
setAsText(String) - Method in class org.springframework.beans.propertyeditors.URIEditor
setAsText(String) - Method in class org.springframework.beans.propertyeditors.URLEditor
setAsText(String) - Method in class org.springframework.beans.propertyeditors.UUIDEditor
setAsText(String) - Method in class org.springframework.beans.PropertyValuesEditor
setAsText(String) - Method in class org.springframework.core.convert.support.ConvertingPropertyEditorAdapter
setAsText(String) - Method in class org.springframework.core.io.ResourceEditor
setAsText(String) - Method in class org.springframework.core.io.support.ResourceArrayPropertyEditor
Treat the given text as location pattern and convert it to a Resource array.
setAsText(String) - Method in class org.springframework.http.MediaTypeEditor
setAsText(String) - Method in class org.springframework.jndi.JndiTemplateEditor
setAsText(String) - Method in class org.springframework.mail.javamail.InternetAddressEditor
setAsText(String) - Method in class org.springframework.transaction.interceptor.TransactionAttributeEditor
Format is PROPAGATION_NAME,ISOLATION_NAME,readOnly,timeout_NNNN,+Exception1,-Exception2.
setAsText(String) - Method in class org.springframework.transaction.interceptor.TransactionAttributeSourceEditor
setAsText(String) - Method in class org.springframework.web.multipart.support.StringMultipartFileEditor
setAsyncAnnotationType(Class<? extends Annotation>) - Method in class org.springframework.scheduling.annotation.AsyncAnnotationAdvisor
Set the 'async' annotation type.
setAsyncAnnotationType(Class<? extends Annotation>) - Method in class org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcessor
Set the 'async' annotation type to be detected at either class or method level.
setAsyncTaskExecutor(AsyncTaskExecutor) - Method in class org.springframework.jca.work.SimpleTaskWorkManager
Specify the TaskExecutor to use for asynchronous work execution (i.e.
setAttribute(String, Object) - Method in class org.springframework.beans.BeanMetadataAttributeAccessor
setAttribute(String, Object) - Method in interface org.springframework.core.AttributeAccessor
Set the attribute defined by name to the supplied value.
setAttribute(String, Object) - Method in class org.springframework.core.AttributeAccessorSupport
setAttribute(Attribute) - Method in class org.springframework.jmx.export.SpringModelMBean
Switches the context ClassLoader for the managed resources ClassLoader before allowing the invocation to occur.
setAttribute(String, Object) - Method in class org.springframework.mock.web.MockHttpServletRequest
setAttribute(String, Object) - Method in class org.springframework.mock.web.MockHttpSession
setAttribute(String, Object) - Method in class org.springframework.mock.web.MockPageContext
setAttribute(String, Object, int) - Method in class org.springframework.mock.web.MockPageContext
setAttribute(String, Object) - Method in class org.springframework.mock.web.MockServletContext
setAttribute(String, Object) - Method in class org.springframework.mock.web.portlet.MockPortletContext
setAttribute(String, Object) - Method in class org.springframework.mock.web.portlet.MockPortletRequest
setAttribute(String, Object) - Method in class org.springframework.mock.web.portlet.MockPortletSession
setAttribute(String, Object, int) - Method in class org.springframework.mock.web.portlet.MockPortletSession
setAttribute(String, Object) - Method in class org.springframework.mock.web.portlet.ServletWrappingPortletContext
setAttribute(String, Object, int) - Method in class org.springframework.web.context.request.FacesRequestAttributes
setAttribute(String, Object, int) - Method in interface org.springframework.web.context.request.RequestAttributes
Set the value for the scoped attribute of the given name, replacing an existing value (if any).
setAttribute(String, Object, int) - Method in class org.springframework.web.context.request.ServletRequestAttributes
setAttribute(String, Object) - Method in class org.springframework.web.context.support.ContextExposingHttpServletRequest
setAttribute(String, Object, int) - Method in class org.springframework.web.portlet.context.PortletRequestAttributes
setAttributeName(String) - Method in class org.springframework.web.context.support.ServletContextAttributeFactoryBean
Set the name of the ServletContext attribute to expose.
setAttributeNamePrefix(String) - Method in class org.springframework.web.bind.support.DefaultSessionAttributeStore
Specify a prefix to use for the attribute names in the backend session.
setAttributes(AttributeList) - Method in class org.springframework.jmx.export.SpringModelMBean
Switches the context ClassLoader for the managed resources ClassLoader before allowing the invocation to occur.
setAttributes(Map<String, Serializable>) - Method in class org.springframework.remoting.support.RemoteInvocation
Set the attributes Map.
setAttributes(Map<String, Object>) - Method in class org.springframework.web.context.support.ServletContextAttributeExporter
Set the ServletContext attributes to expose as key-value pairs.
setAttributes(Properties) - Method in class org.springframework.web.servlet.view.AbstractView
Set static attributes for this view from a java.util.Properties object.
setAttributes(Properties) - Method in class org.springframework.web.servlet.view.UrlBasedViewResolver
Set static attributes from a java.util.Properties object, for all views returned by this resolver.
setAttributesCSV(String) - Method in class org.springframework.web.servlet.view.AbstractView
Set static attributes as a CSV string.
setAttributesMap(Map<String, ?>) - Method in class org.springframework.web.servlet.view.AbstractView
Set static attributes for this view from a Map.
setAttributesMap(Map<String, ?>) - Method in class org.springframework.web.servlet.view.UrlBasedViewResolver
Set static attributes from a Map, for all views returned by this resolver.
setAttributeSource(JmxAttributeSource) - Method in class org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler
Set the JmxAttributeSource implementation to use for reading the metadata from the bean class.
setAttributeSource(JmxAttributeSource) - Method in class org.springframework.jmx.export.naming.MetadataNamingStrategy
Set the implementation of the JmxAttributeSource interface to use when reading the source-level metadata.
setAuthenticator(Authenticator) - Method in class org.springframework.remoting.jaxws.SimpleHttpServerJaxWsServiceExporter
Register a common Authenticator to be applied to all detected WebService annotated beans.
setAuthenticator(Authenticator) - Method in class org.springframework.remoting.support.SimpleHttpServerFactoryBean
Register a common Authenticator to be applied to all locally registered contexts.
setAuthorizedRoles(String[]) - Method in class org.springframework.web.portlet.handler.UserRoleAuthorizationInterceptor
Set the roles that this interceptor should treat as authorized.
setAuthorizedRoles(String[]) - Method in class org.springframework.web.servlet.handler.UserRoleAuthorizationInterceptor
Set the roles that this interceptor should treat as authorized.
setAuthType(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
setAuthType(String) - Method in class org.springframework.mock.web.portlet.MockPortletRequest
setAutoCommit(boolean) - Method in class org.springframework.jdbc.datasource.SingleConnectionDataSource
Set whether the returned Connection's "autoCommit" setting should be overridden.
setAutocomplete(String) - Method in class org.springframework.web.servlet.tags.form.FormTag
Set the value of the 'autocomplete' attribute.
setAutocomplete(String) - Method in class org.springframework.web.servlet.tags.form.InputTag
Set the value of the 'autocomplete' attribute.
setAutodetect(boolean) - Method in class org.springframework.jmx.export.MBeanExporter
Set whether to autodetect MBeans in the bean factory that this exporter runs in.
setAutodetectAnnotations(boolean) - Method in class org.springframework.oxm.xstream.XStreamMarshaller
Set the auto-detection mode of XStream.
setAutodetectDataSource(boolean) - Method in class org.springframework.orm.hibernate3.HibernateTransactionManager
Set whether to autodetect a JDBC DataSource used by the Hibernate SessionFactory, if set via LocalSessionFactoryBean's setDataSource.
setAutodetectDataSource(boolean) - Method in class org.springframework.orm.jdo.JdoTransactionManager
Set whether to autodetect a JDBC DataSource used by the JDO PersistenceManagerFactory, as returned by the getConnectionFactory() method.
setAutodetectInterfaces(boolean) - Method in class org.springframework.aop.framework.ProxyFactoryBean
Set whether to autodetect proxy interfaces if none specified.
setAutodetectMode(int) - Method in class org.springframework.jmx.export.MBeanExporter
Set the autodetection mode to use.
setAutodetectModeName(String) - Method in class org.springframework.jmx.export.MBeanExporter
Set the autodetection mode to use by name.
setAutodetectTransactionManager(boolean) - Method in class org.springframework.transaction.jta.JtaTransactionManager
Set whether to autodetect a JTA UserTransaction object that implements the JTA TransactionManager interface too (i.e.
setAutodetectUserTransaction(boolean) - Method in class org.springframework.transaction.jta.JtaTransactionManager
Set whether to autodetect the JTA UserTransaction at its default JNDI location "java:comp/UserTransaction", as specified by Java EE.
setAutoGrowNestedPaths(boolean) - Method in interface org.springframework.beans.BeanWrapper
Set whether this BeanWrapper should attempt to "auto-grow" a nested path that contains a null value.
setAutoGrowNestedPaths(boolean) - Method in class org.springframework.beans.BeanWrapperImpl
If this BeanWrapper should "auto grow" nested paths.
setAutoGrowNestedPaths(boolean) - Method in class org.springframework.validation.DataBinder
Set whether this binder should attempt to "auto-grow" a nested path that contains a null value.
setAutoStartup(boolean) - Method in class org.springframework.jca.endpoint.GenericMessageEndpointManager
Set whether to auto-start the endpoint activation after this endpoint manager has been initialized and the context has been refreshed.
setAutoStartup(boolean) - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Set whether to automatically start the container after initialization.
setAutoStartup(boolean) - Method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
Set whether to automatically start the scheduler after initialization.
setAutowire(String) - Method in class org.springframework.beans.factory.xml.DocumentDefaultsDefinition
Set the default autowire setting for the document that's currently parsed.
setAutowireCandidate(boolean) - Method in interface org.springframework.beans.factory.config.BeanDefinition
Set whether this bean is a candidate for getting autowired into some other bean.
setAutowireCandidate(boolean) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Set whether this bean is a candidate for getting autowired into some other bean.
setAutowireCandidatePatterns(String[]) - Method in class org.springframework.context.annotation.ClassPathBeanDefinitionScanner
Set the name-matching patterns for determining autowire candidates.
setAutowireCandidateResolver(AutowireCandidateResolver) - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
Set a custom autowire candidate resolver for this BeanFactory to use when deciding whether a bean definition should be considered as a candidate for autowiring.
setAutowireCandidates(String) - Method in class org.springframework.beans.factory.xml.DocumentDefaultsDefinition
Set the default autowire-candidate pattern for the document that's currently parsed.
setAutowiredAnnotationType(Class<? extends Annotation>) - Method in class org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor
Set the 'autowired' annotation type, to be used on constructors, fields, setter methods and arbitrary config methods.
setAutowiredAnnotationTypes(Set<Class<? extends Annotation>>) - Method in class org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor
Set the 'autowired' annotation types, to be used on constructors, fields, setter methods and arbitrary config methods.
setAutowireMode(int) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Set the autowire mode.
setAutowireMode(int) - Method in class org.springframework.beans.factory.support.BeanDefinitionBuilder
Set the autowire mode for this definition.
setAutowireMode(int) - Method in class org.springframework.beans.factory.support.BeanDefinitionDefaults
setAutowireMode(int) - Method in class org.springframework.test.AbstractDependencyInjectionSpringContextTests
Deprecated. Set the autowire mode for test properties set by Dependency Injection.
setBacklog(int) - Method in class org.springframework.remoting.jaxws.SimpleHttpServerJaxWsServiceExporter
Specify the HTTP server's TCP backlog.
setBacklog(int) - Method in class org.springframework.remoting.support.SimpleHttpServerFactoryBean
Specify the HTTP server's TCP backlog.
setBadSqlGrammarCodes(String[]) - Method in class org.springframework.jdbc.support.SQLErrorCodes
setBaseAddress(String) - Method in class org.springframework.remoting.jaxws.SimpleJaxWsServiceExporter
Set the base address for exported services.
setBasename(String) - Method in class org.springframework.context.support.ReloadableResourceBundleMessageSource
Set a single basename, following the basic ResourceBundle convention of not specifying file extension or language codes, but in contrast to ResourceBundleMessageSource referring to a Spring resource location: e.g.
setBasename(String) - Method in class org.springframework.context.support.ResourceBundleMessageSource
Set a single basename, following ResourceBundle conventions: essentially, a fully-qualified classpath location.
setBasename(String) - Method in class org.springframework.web.servlet.view.ResourceBundleViewResolver
Set a single basename, following ResourceBundle conventions.
setBasenamePrefix(String) - Method in class org.springframework.ui.context.support.ResourceBundleThemeSource
Set the prefix that gets applied to the ResourceBundle basenames, i.e.
setBasenames(String[]) - Method in class org.springframework.context.support.ReloadableResourceBundleMessageSource
Set an array of basenames, each following the basic ResourceBundle convention of not specifying file extension or language codes, but in contrast to ResourceBundleMessageSource referring to a Spring resource location: e.g.
setBasenames(String[]) - Method in class org.springframework.context.support.ResourceBundleMessageSource
Set an array of basenames, each following ResourceBundle conventions: essentially, a fully-qualified classpath location.
setBasenames(String[]) - Method in class org.springframework.web.servlet.view.ResourceBundleViewResolver
Set an array of basenames, each following ResourceBundle conventions.
setBasePackage(String) - Method in class org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping
Set the base package to be used for generating path mappings, including all subpackages underneath this packages as path elements.
setBasePath(String) - Method in class org.springframework.remoting.jaxws.SimpleHttpServerJaxWsServiceExporter
Set the base path for context publication.
setBatchSize(int) - Method in class org.springframework.jdbc.object.BatchSqlUpdate
Set the number of statements that will trigger an automatic intermediate flush.
setBcc(String) - Method in class org.springframework.mail.javamail.MimeMailMessage
setBcc(String[]) - Method in class org.springframework.mail.javamail.MimeMailMessage
setBcc(InternetAddress) - Method in class org.springframework.mail.javamail.MimeMessageHelper
setBcc(InternetAddress[]) - Method in class org.springframework.mail.javamail.MimeMessageHelper
setBcc(String) - Method in class org.springframework.mail.javamail.MimeMessageHelper
setBcc(String[]) - Method in class org.springframework.mail.javamail.MimeMessageHelper
setBcc(String) - Method in interface org.springframework.mail.MailMessage
setBcc(String[]) - Method in interface org.springframework.mail.MailMessage
setBcc(String) - Method in class org.springframework.mail.SimpleMailMessage
setBcc(String[]) - Method in class org.springframework.mail.SimpleMailMessage
setBeanClass(Class<?>) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Specify the class for this bean.
setBeanClassLoader(ClassLoader) - Method in class org.springframework.aop.framework.AbstractSingletonProxyFactoryBean
setBeanClassLoader(ClassLoader) - Method in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
setBeanClassLoader(ClassLoader) - Method in class org.springframework.aop.framework.ProxyFactoryBean
setBeanClassLoader(ClassLoader) - Method in class org.springframework.beans.factory.annotation.CustomAutowireConfigurer
setBeanClassLoader(ClassLoader) - Method in interface org.springframework.beans.factory.BeanClassLoaderAware
Callback that supplies the bean class loader to a bean instance.
setBeanClassLoader(ClassLoader) - Method in class org.springframework.beans.factory.config.AbstractFactoryBean
setBeanClassLoader(ClassLoader) - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Set the class loader to use for loading bean classes.
setBeanClassLoader(ClassLoader) - Method in class org.springframework.beans.factory.config.CustomEditorConfigurer
setBeanClassLoader(ClassLoader) - Method in class org.springframework.beans.factory.config.CustomScopeConfigurer
setBeanClassLoader(ClassLoader) - Method in class org.springframework.beans.factory.config.FieldRetrievingFactoryBean
setBeanClassLoader(ClassLoader) - Method in class org.springframework.beans.factory.config.MethodInvokingFactoryBean
setBeanClassLoader(ClassLoader) - Method in class org.springframework.beans.factory.serviceloader.AbstractServiceLoaderBasedFactoryBean
setBeanClassLoader(ClassLoader) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinitionReader
Set the ClassLoader to use for bean classes.
setBeanClassLoader(ClassLoader) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
setBeanClassLoader(ClassLoader) - Method in class org.springframework.context.annotation.ConfigurationClassPostProcessor
setBeanClassLoader(ClassLoader) - Method in class org.springframework.context.support.ResourceBundleMessageSource
setBeanClassLoader(ClassLoader) - Method in class org.springframework.context.weaving.AspectJWeavingEnabler
setBeanClassLoader(ClassLoader) - Method in class org.springframework.context.weaving.DefaultContextLoadTimeWeaver
setBeanClassLoader(ClassLoader) - Method in class org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor
setBeanClassLoader(ClassLoader) - Method in class org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean
setBeanClassLoader(ClassLoader) - Method in class org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean
setBeanClassLoader(ClassLoader) - Method in class org.springframework.jms.remoting.JmsInvokerProxyFactoryBean
setBeanClassLoader(ClassLoader) - Method in class org.springframework.jmx.access.MBeanClientInterceptor
setBeanClassLoader(ClassLoader) - Method in class org.springframework.jmx.access.MBeanProxyFactoryBean
setBeanClassLoader(ClassLoader) - Method in class org.springframework.jmx.export.assembler.InterfaceBasedMBeanInfoAssembler
setBeanClassLoader(ClassLoader) - Method in class org.springframework.jmx.export.MBeanExporter
setBeanClassLoader(ClassLoader) - Method in class org.springframework.jmx.support.MBeanServerConnectionFactoryBean
setBeanClassLoader(ClassLoader) - Method in class org.springframework.jndi.JndiObjectFactoryBean
setBeanClassLoader(ClassLoader) - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
setBeanClassLoader(ClassLoader) - Method in class org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean
setBeanClassLoader(ClassLoader) - Method in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
setBeanClassLoader(ClassLoader) - Method in class org.springframework.oxm.jaxb.Jaxb2Marshaller
setBeanClassLoader(ClassLoader) - Method in class org.springframework.oxm.xstream.XStreamMarshaller
setBeanClassLoader(ClassLoader) - Method in class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
setBeanClassLoader(ClassLoader) - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortProxyFactoryBean
Deprecated.
setBeanClassLoader(ClassLoader) - Method in class org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean
setBeanClassLoader(ClassLoader) - Method in class org.springframework.remoting.rmi.JndiRmiProxyFactoryBean
setBeanClassLoader(ClassLoader) - Method in class org.springframework.remoting.support.RemotingSupport
setBeanClassLoader(ClassLoader) - Method in class org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcessor
setBeanClassLoader(ClassLoader) - Method in class org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean
setBeanClassLoader(ClassLoader) - Method in class org.springframework.scheduling.support.MethodInvokingRunnable
setBeanClassLoader(ClassLoader) - Method in class org.springframework.scripting.bsh.BshScriptFactory
setBeanClassLoader(ClassLoader) - Method in class org.springframework.scripting.groovy.GroovyScriptFactory
setBeanClassLoader(ClassLoader) - Method in class org.springframework.scripting.jruby.JRubyScriptFactory
setBeanClassLoader(ClassLoader) - Method in class org.springframework.scripting.support.ScriptFactoryPostProcessor
setBeanClassLoader(ClassLoader) - Method in class org.springframework.transaction.interceptor.MethodMapTransactionAttributeSource
setBeanClassName(String) - Method in interface org.springframework.beans.factory.config.BeanDefinition
Override the bean class name of this bean definition.
setBeanClassName(String) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
setBeanDefinitionDefaults(BeanDefinitionDefaults) - Method in class org.springframework.context.annotation.ClassPathBeanDefinitionScanner
Set the defaults to use for detected beans.
setBeanExpressionResolver(BeanExpressionResolver) - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Specify the resolution strategy for expressions in bean definition values.
setBeanExpressionResolver(BeanExpressionResolver) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
setBeanFactory(BeanFactory) - Method in class org.springframework.aop.aspectj.AspectJExpressionPointcut
setBeanFactory(BeanFactory) - Method in class org.springframework.aop.config.MethodLocatingFactoryBean
setBeanFactory(BeanFactory) - Method in class org.springframework.aop.config.SimpleBeanFactoryAwareAspectInstanceFactory
setBeanFactory(BeanFactory) - Method in class org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
setBeanFactory(BeanFactory) - Method in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
setBeanFactory(BeanFactory) - Method in class org.springframework.aop.framework.autoproxy.target.AbstractBeanFactoryBasedTargetSourceCreator
setBeanFactory(BeanFactory) - Method in class org.springframework.aop.framework.ProxyFactoryBean
setBeanFactory(BeanFactory) - Method in class org.springframework.aop.scope.ScopedProxyFactoryBean
setBeanFactory(BeanFactory) - Method in class org.springframework.aop.support.AbstractBeanFactoryPointcutAdvisor
setBeanFactory(BeanFactory) - Method in class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
Set the owning BeanFactory.
setBeanFactory(BeanFactory) - Method in class org.springframework.aop.target.AbstractPoolingTargetSource
setBeanFactory(BeanFactory) - Method in class org.springframework.aop.target.AbstractPrototypeBasedTargetSource
setBeanFactory(BeanFactory) - Method in class org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor
setBeanFactory(BeanFactory) - Method in class org.springframework.beans.factory.annotation.QualifierAnnotationAutowireCandidateResolver
setBeanFactory(BeanFactory) - Method in class org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor
setBeanFactory(BeanFactory) - Method in interface org.springframework.beans.factory.BeanFactoryAware
Callback that supplies the owning factory to a bean instance.
setBeanFactory(BeanFactory) - Method in class org.springframework.beans.factory.config.AbstractFactoryBean
setBeanFactory(BeanFactory) - Method in class org.springframework.beans.factory.config.BeanReferenceFactoryBean
setBeanFactory(BeanFactory) - Method in class org.springframework.beans.factory.config.MethodInvokingFactoryBean
setBeanFactory(BeanFactory) - Method in class org.springframework.beans.factory.config.PropertyPathFactoryBean
setBeanFactory(BeanFactory) - Method in class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
Only necessary to check that we're not parsing our own bean definition, to avoid failing on unresolvable placeholders in properties file locations.
setBeanFactory(BeanFactory) - Method in class org.springframework.beans.factory.config.ServiceLocatorFactoryBean
setBeanFactory(BeanFactory) - Method in class org.springframework.beans.factory.wiring.BeanConfigurerSupport
Set the BeanFactory in which this aspect must configure beans.
setBeanFactory(BeanFactory) - Method in class org.springframework.context.annotation.CommonAnnotationBeanPostProcessor
setBeanFactory(BeanFactory) - Method in class org.springframework.context.event.AbstractApplicationEventMulticaster
setBeanFactory(BeanFactory) - Method in class org.springframework.context.support.DefaultLifecycleProcessor
setBeanFactory(BeanFactory) - Method in class org.springframework.context.weaving.LoadTimeWeaverAwareProcessor
setBeanFactory(BeanFactory) - Method in class org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor
setBeanFactory(BeanFactory) - Method in class org.springframework.dao.support.PersistenceExceptionTranslationInterceptor
setBeanFactory(BeanFactory) - Method in class org.springframework.jdbc.datasource.lookup.BeanFactoryDataSourceLookup
setBeanFactory(BeanFactory) - Method in class org.springframework.jms.support.destination.BeanFactoryDestinationResolver
setBeanFactory(BeanFactory) - Method in class org.springframework.jmx.export.MBeanExporter
This callback is only required for resolution of bean names in the "beans" Map and for autodetection of MBeans (in the latter case, a ListableBeanFactory is required).
setBeanFactory(BeanFactory) - Method in class org.springframework.orm.hibernate3.HibernateAccessor
The bean factory just needs to be known for resolving entity interceptor bean names.
setBeanFactory(BeanFactory) - Method in class org.springframework.orm.hibernate3.HibernateTransactionManager
The bean factory just needs to be known for resolving entity interceptor bean names.
setBeanFactory(BeanFactory) - Method in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
setBeanFactory(BeanFactory) - Method in class org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
setBeanFactory(BeanFactory) - Method in class org.springframework.remoting.jaxws.AbstractJaxWsServiceExporter
Obtains all web service beans and publishes them as JAX-WS endpoints.
setBeanFactory(BeanFactory) - Method in class org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean
setBeanFactory(BeanFactory) - Method in class org.springframework.scheduling.quartz.SchedulerAccessorBean
setBeanFactory(BeanFactory) - Method in class org.springframework.scripting.groovy.GroovyScriptFactory
setBeanFactory(BeanFactory) - Method in class org.springframework.scripting.support.ScriptFactoryPostProcessor
setBeanFactory(BeanFactory) - Method in class org.springframework.transaction.interceptor.TransactionAspectSupport
Set the BeanFactory to use for retrieving PlatformTransactionManager beans.
setBeanFactory(BeanFactory) - Method in class org.springframework.transaction.interceptor.TransactionProxyFactoryBean
This callback is optional: If running in a BeanFactory and no transaction manager has been set explicitly, a single matching bean of type PlatformTransactionManager will be fetched from the BeanFactory.
setBeanFactory(BeanFactory) - Method in class org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter
setBeanFactory(BeanFactory) - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
setBeanFactoryLocator(BeanFactoryLocator) - Method in class org.springframework.ejb.support.AbstractEnterpriseBean
Set the BeanFactoryLocator to use for this EJB.
setBeanFactoryLocatorKey(String) - Method in class org.springframework.ejb.support.AbstractEnterpriseBean
Set the bean factory locator key.
setBeanName(String) - Method in class org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator
setBeanName(String) - Method in interface org.springframework.beans.factory.BeanNameAware
Set the name of the bean in the bean factory that created this bean.
setBeanName(String) - Method in class org.springframework.beans.factory.config.FieldRetrievingFactoryBean
The bean name of this FieldRetrievingFactoryBean will be interpreted as "staticField" pattern, if neither "targetClass" nor "targetObject" nor "targetField" have been specified.
setBeanName(String) - Method in class org.springframework.beans.factory.config.PropertyPathFactoryBean
The bean name of this PropertyPathFactoryBean will be interpreted as "beanName.property" pattern, if neither "targetObject" nor "targetBeanName" nor "propertyPath" have been specified.
setBeanName(String) - Method in class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
Only necessary to check that we're not parsing our own bean definition, to avoid failing on unresolvable placeholders in properties file locations.
setBeanName(String) - Method in class org.springframework.cache.ehcache.EhCacheFactoryBean
setBeanName(String) - Method in class org.springframework.context.support.AbstractRefreshableConfigApplicationContext
Sets the id of this context to the bean name by default, for cases where the context instance is itself defined as a bean.
setBeanName(String) - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
setBeanName(String) - Method in class org.springframework.orm.hibernate3.FilterDefinitionFactoryBean
If no explicit filter name has been specified, the bean name of the FilterDefinitionFactoryBean will be used.
setBeanName(String) - Method in class org.springframework.orm.hibernate3.TypeDefinitionBean
If no explicit type name has been specified, the bean name of the TypeDefinitionBean will be used.
setBeanName(String) - Method in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
setBeanName(String) - Method in class org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor
setBeanName(String) - Method in class org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
setBeanName(String) - Method in class org.springframework.scheduling.config.TaskExecutorFactoryBean
setBeanName(String) - Method in class org.springframework.scheduling.quartz.CronTriggerBean
setBeanName(String) - Method in class org.springframework.scheduling.quartz.JobDetailBean
setBeanName(String) - Method in class org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean
setBeanName(String) - Method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
setBeanName(String) - Method in class org.springframework.scheduling.quartz.SimpleTriggerBean
setBeanName(String) - Method in class org.springframework.scheduling.timer.TimerFactoryBean
Deprecated.
setBeanName(String) - Method in class org.springframework.scheduling.timer.TimerTaskExecutor
Deprecated.
setBeanName(String) - Method in class org.springframework.web.filter.GenericFilterBean
Stores the bean name as defined in the Spring bean factory.
setBeanName(String) - Method in class org.springframework.web.portlet.mvc.PortletWrappingController
setBeanName(String) - Method in class org.springframework.web.servlet.mvc.ServletForwardingController
setBeanName(String) - Method in class org.springframework.web.servlet.mvc.ServletWrappingController
setBeanName(String) - Method in class org.springframework.web.servlet.view.AbstractView
Set the view's name.
setBeanNameGenerator(BeanNameGenerator) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinitionReader
Set the BeanNameGenerator to use for anonymous beans (without explicit bean name specified).
setBeanNameGenerator(BeanNameGenerator) - Method in class org.springframework.context.annotation.AnnotatedBeanDefinitionReader
Set the BeanNameGenerator to use for detected bean classes.
setBeanNameGenerator(BeanNameGenerator) - Method in class org.springframework.context.annotation.AnnotationConfigApplicationContext
Set the BeanNameGenerator to use for detected bean classes.
setBeanNameGenerator(BeanNameGenerator) - Method in class org.springframework.context.annotation.ClassPathBeanDefinitionScanner
Set the BeanNameGenerator to use for detected bean classes.
setBeanNames(String[]) - Method in class org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator
Set the names of the beans that should automatically get wrapped with proxies.
setBeanNameSeparator(String) - Method in class org.springframework.beans.factory.config.PropertyOverrideConfigurer
Set the separator to expect between bean name and property path.
setBeans(Map<String, Object>) - Method in class org.springframework.jmx.export.MBeanExporter
Supply a Map of beans to be registered with the JMX MBeanServer.
setBeanWiringInfoResolver(BeanWiringInfoResolver) - Method in class org.springframework.beans.factory.wiring.BeanConfigurerSupport
Set the BeanWiringInfoResolver to use.
setBeforeMessagePrefix(String) - Method in class org.springframework.web.filter.AbstractRequestLoggingFilter
Set the value that should be prepended to the log message written before a request is processed.
setBeforeMessageSuffix(String) - Method in class org.springframework.web.filter.AbstractRequestLoggingFilter
Set the value that should be apppended to the log message written before a request is processed.
setBindEmptyMultipartFiles(boolean) - Method in class org.springframework.web.bind.WebDataBinder
Set whether to bind empty MultipartFile parameters.
setBindingErrorProcessor(BindingErrorProcessor) - Method in class org.springframework.validation.DataBinder
Set the strategy to use for processing binding errors, that is, required field errors and PropertyAccessExceptions.
setBindingErrorProcessor(BindingErrorProcessor) - Method in class org.springframework.web.bind.support.ConfigurableWebBindingInitializer
Set the strategy to use for processing binding errors, that is, required field errors and PropertyAccessExceptions.
setBindingErrorProcessor(BindingErrorProcessor) - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Set the strategy to use for processing binding errors, that is, required field errors and PropertyAccessExceptions.
setBindingErrorProcessor(BindingErrorProcessor) - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Set the strategy to use for processing binding errors, that is, required field errors and PropertyAccessExceptions.
setBindingName(String) - Method in class org.springframework.oxm.jibx.JibxMarshaller
Set the optional binding name for this instance.
setBindings(Map<String, String>) - Method in class org.springframework.util.xml.SimpleNamespaceContext
Sets the bindings for this namespace context.
setBindOnNewForm(boolean) - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Set if request parameters should be bound to the form object in case of a non-submitting request, i.e.
setBindOnNewForm(boolean) - Method in class org.springframework.web.servlet.mvc.AbstractFormController
Deprecated. Set whether request parameters should be bound to the form object in case of a non-submitting request, that is, a new form.
setBlobAsBinaryStream(PreparedStatement, int, InputStream, int) - Method in class org.springframework.jdbc.support.lob.DefaultLobHandler.DefaultLobCreator
setBlobAsBinaryStream(PreparedStatement, int, InputStream, int) - Method in interface org.springframework.jdbc.support.lob.LobCreator
Set the given content as binary stream on the given statement, using the given parameter index.
setBlobAsBinaryStream(PreparedStatement, int, InputStream, int) - Method in class org.springframework.jdbc.support.lob.OracleLobHandler.OracleLobCreator
setBlobAsBytes(PreparedStatement, int, byte[]) - Method in class org.springframework.jdbc.support.lob.DefaultLobHandler.DefaultLobCreator
setBlobAsBytes(PreparedStatement, int, byte[]) - Method in interface org.springframework.jdbc.support.lob.LobCreator
Set the given content as bytes on the given statement, using the given parameter index.
setBlobAsBytes(PreparedStatement, int, byte[]) - Method in class org.springframework.jdbc.support.lob.OracleLobHandler.OracleLobCreator
setBlocking(boolean) - Method in class org.springframework.cache.ehcache.EhCacheFactoryBean
Set whether to use a blocking cache that lets read attempts block until the requested element is created.
setBlockUntilCompleted(boolean) - Method in class org.springframework.jca.work.WorkManagerTaskExecutor
Set whether to let WorkManagerTaskExecutor.execute(java.lang.Runnable) block until the work has been completed.
setBlockUntilStarted(boolean) - Method in class org.springframework.jca.work.WorkManagerTaskExecutor
Set whether to let WorkManagerTaskExecutor.execute(java.lang.Runnable) block until the work has been actually started.
setBodyContent(BodyContent) - Method in class org.springframework.web.servlet.tags.EscapeBodyTag
setBodyContent(BodyContent) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementBodyTag
setBootstrapCacheLoader(BootstrapCacheLoader) - Method in class org.springframework.cache.ehcache.EhCacheFactoryBean
Set an EHCache BootstrapCacheLoader for this cache, if any.
setBootstrapContext(BootstrapContext) - Method in interface org.springframework.jca.context.BootstrapContextAware
Set the BootstrapContext that this object runs in.
setBootstrapContext(BootstrapContext) - Method in class org.springframework.jca.support.ResourceAdapterFactoryBean
Specify the JCA BootstrapContext to use for starting the ResourceAdapter.
setBootstrapContext(BootstrapContext) - Method in class org.springframework.jca.work.WorkManagerTaskExecutor
Specify the JCA BootstrapContext that contains the WorkManager to delegate to.
setBufferSize(int) - Method in class org.springframework.mock.web.MockHttpServletResponse
setBufferSize(int) - Method in class org.springframework.mock.web.portlet.MockMimeResponse
setBundleClassLoader(ClassLoader) - Method in class org.springframework.context.support.ResourceBundleMessageSource
Set the ClassLoader to load resource bundles with.
setBundleClassLoader(ClassLoader) - Method in class org.springframework.web.servlet.view.ResourceBundleViewResolver
Set the ClassLoader to load resource bundles with.
setBusinessInterface(Class) - Method in class org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean
Set the business interface of the EJB we're proxying.
setBusinessInterface(Class) - Method in class org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean
Set the business interface of the EJB we're proxying.
setCache(boolean) - Method in class org.springframework.jdbc.support.lob.OracleLobHandler
Set whether to cache the temporary LOB in the buffer cache.
setCache(boolean) - Method in class org.springframework.jms.support.destination.JndiDestinationResolver
Set whether to cache resolved destinations.
setCache(boolean) - Method in class org.springframework.jndi.JndiObjectFactoryBean
Set whether to cache the JNDI object once it has been located.
setCache(boolean) - Method in class org.springframework.jndi.JndiObjectTargetSource
Set whether to cache the JNDI object once it has been located.
setCache(boolean) - Method in class org.springframework.web.servlet.view.AbstractCachingViewResolver
Enable or disable caching.
setCache(boolean) - Method in class org.springframework.web.servlet.view.xslt.AbstractXsltView
Deprecated. Set whether to activate the template cache for this view.
setCacheability(String) - Method in class org.springframework.mock.web.portlet.MockResourceRequest
setCacheability(String) - Method in class org.springframework.mock.web.portlet.MockResourceURL
setCacheableMappingLocations(Resource[]) - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Set locations of cacheable Hibernate mapping files, for example as web app resource "/WEB-INF/mapping/example.hbm.xml".
setCacheBeanMetadata(boolean) - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Set whether to cache bean metadata such as given bean definitions (in merged fashion) and resolved bean classes.
setCacheBeanMetadata(boolean) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
setCacheConsumers(boolean) - Method in class org.springframework.jms.connection.CachingConnectionFactory
Specify whether to cache JMS MessageConsumers per JMS Session instance (more specifically: one MessageConsumer per Destination, selector String and Session).
setCacheControl(String) - Method in class org.springframework.http.HttpHeaders
Sets the (new) value of the Cache-Control header.
setCacheDir(File) - Method in class org.springframework.http.converter.BufferedImageHttpMessageConverter
Sets the cache directory.
setCacheEntryFactory(CacheEntryFactory) - Method in class org.springframework.cache.ehcache.EhCacheFactoryBean
Set an EHCache CacheEntryFactory to use for a self-populating cache.
setCacheEventListeners(Set<CacheEventListener>) - Method in class org.springframework.cache.ehcache.EhCacheFactoryBean
Specify EHCache cache event listeners to registered with this cache.
setCacheHome(boolean) - Method in class org.springframework.ejb.access.AbstractSlsbInvokerInterceptor
Set whether to cache the EJB home object once it has been located.
setCacheLevel(int) - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Specify the level of caching that this listener container is allowed to apply.
setCacheLevelName(String) - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Specify the level of caching that this listener container is allowed to apply, in the form of the name of the corresponding constant: e.g.
setCacheManager(CacheManager) - Method in class org.springframework.cache.ehcache.EhCacheFactoryBean
Set a CacheManager from which to retrieve a named Cache instance.
setCacheManagerName(String) - Method in class org.springframework.cache.ehcache.EhCacheManagerFactoryBean
Set the name of the EHCache CacheManager (if a specific name is desired).
setCacheMappings(Properties) - Method in class org.springframework.web.servlet.mvc.WebContentInterceptor
Map specific URL paths to specific cache seconds.
setCacheName(String) - Method in class org.springframework.cache.ehcache.EhCacheFactoryBean
Set a name for which to retrieve or create a cache instance.
setCacheProducers(boolean) - Method in class org.springframework.jms.connection.CachingConnectionFactory
Specify whether to cache JMS MessageProducers per JMS Session instance (more specifically: one MessageProducer per Destination and Session).
setCacheProvider(CacheProvider) - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Deprecated. as of Spring 3.0, following Hibernate 3.3's deprecation of the CacheProvider SPI
setCacheQueries(boolean) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
Set whether to cache all queries executed by this template.
setCacheRegionFactory(Object) - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Set the Hibernate RegionFactory to use for the SessionFactory.
setCacheSeconds(int) - Method in class org.springframework.context.support.ReloadableResourceBundleMessageSource
Set the number of seconds to cache loaded properties files.
setCacheSeconds(int) - Method in class org.springframework.web.portlet.handler.PortletContentGenerator
Cache content for the given number of seconds.
setCacheSeconds(int) - Method in class org.springframework.web.servlet.support.WebContentGenerator
Cache content for the given number of seconds.
setCacheSecondsForSessionAttributeHandlers(int) - Method in class org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter
Cache content produced by @SessionAttributes annotated handlers for the given number of seconds.
setCacheSecondsForSessionAttributeHandlers(int) - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
Cache content produced by @SessionAttributes annotated handlers for the given number of seconds.
setCacheSessionBean(boolean) - Method in class org.springframework.ejb.access.SimpleRemoteSlsbInvokerInterceptor
Set whether to cache the actual session bean object.
setCacheSize(int) - Method in class org.springframework.jdbc.support.incrementer.AbstractColumnMaxValueIncrementer
Set the number of buffered keys.
setCacheStub(boolean) - Method in class org.springframework.remoting.rmi.JndiRmiClientInterceptor
Set whether to cache the RMI stub once it has been located.
setCacheStub(boolean) - Method in class org.springframework.remoting.rmi.RmiClientInterceptor
Set whether to cache the RMI stub once it has been located.
setCacheTemplate(boolean) - Method in class org.springframework.web.servlet.view.velocity.VelocityView
Set whether the Velocity template should be cached.
setCacheTemplates(boolean) - Method in class org.springframework.web.servlet.view.xslt.XsltView
Turn on/off the caching of the XSLT Templates instance.
setCacheTemplates(boolean) - Method in class org.springframework.web.servlet.view.xslt.XsltViewResolver
Turn on/off the caching of the XSLT templates.
setCacheUserTransaction(boolean) - Method in class org.springframework.transaction.jta.JtaTransactionManager
Set whether to cache the JTA UserTransaction object fetched from JNDI.
setCalendars(Map<String, Calendar>) - Method in class org.springframework.scheduling.quartz.SchedulerAccessor
Register a list of Quartz Calendar objects with the Scheduler that this FactoryBean creates, to be referenced by Triggers.
setCancelParamKey(String) - Method in class org.springframework.web.servlet.mvc.CancellableFormController
Deprecated. Set the key of the request parameter used to identify a cancel request.
setCancelRenderParameter(ActionRequest, ActionResponse) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Pass the the parameter that indicates a cancel request forward to the render phase.
setCancelView(String) - Method in class org.springframework.web.servlet.mvc.CancellableFormController
Deprecated. Sets the name of the cancel view.
setCannotAcquireLockCodes(String[]) - Method in class org.springframework.jdbc.support.SQLErrorCodes
setCannotSerializeTransactionCodes(String[]) - Method in class org.springframework.jdbc.support.SQLErrorCodes
setCaseSensitive(boolean) - Method in class org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping
Set whether to apply case sensitivity to the generated paths, e.g.
setCatalogName(String) - Method in class org.springframework.jdbc.core.metadata.CallMetaDataContext
Specify the name of the catalog.
setCatalogName(String) - Method in class org.springframework.jdbc.core.metadata.TableMetaDataContext
Set the name of the catalog for this context.
setCatalogName(String) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Set the catalog name to use.
setCatalogName(String) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Set the name of the catalog for this insert
setCategory(String) - Method in class org.springframework.jmx.export.metadata.ManagedMetric
The category of this metric (ex.
setCc(String) - Method in class org.springframework.mail.javamail.MimeMailMessage
setCc(String[]) - Method in class org.springframework.mail.javamail.MimeMailMessage
setCc(InternetAddress) - Method in class org.springframework.mail.javamail.MimeMessageHelper
setCc(InternetAddress[]) - Method in class org.springframework.mail.javamail.MimeMessageHelper
setCc(String) - Method in class org.springframework.mail.javamail.MimeMessageHelper
setCc(String[]) - Method in class org.springframework.mail.javamail.MimeMessageHelper
setCc(String) - Method in interface org.springframework.mail.MailMessage
setCc(String[]) - Method in interface org.springframework.mail.MailMessage
setCc(String) - Method in class org.springframework.mail.SimpleMailMessage
setCc(String[]) - Method in class org.springframework.mail.SimpleMailMessage
setCciTemplate(CciTemplate) - Method in class org.springframework.jca.cci.core.support.CciDaoSupport
Set the CciTemplate for this DAO explicitly, as an alternative to specifying a ConnectionFactory.
setCciTemplate(CciTemplate) - Method in class org.springframework.jca.cci.object.EisOperation
Set the CciTemplate to be used by this operation.
setCharacterEncoding(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
setCharacterEncoding(String) - Method in class org.springframework.mock.web.MockHttpServletResponse
setCharacterEncoding(String) - Method in class org.springframework.mock.web.portlet.MockClientDataRequest
setCharacterEncoding(String) - Method in class org.springframework.mock.web.portlet.MockMimeResponse
setCharset(Charset) - Method in class org.springframework.http.converter.FormHttpMessageConverter
Sets the character set used for writing form data.
setCheckFullyPopulated(boolean) - Method in class org.springframework.jdbc.core.BeanPropertyRowMapper
Set whether we're strictly validating that all bean properties have been mapped from corresponding database fields.
setCheckWriteOperations(boolean) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
Set whether to check that the Hibernate Session is not in read-only mode in case of write operations (save/update/delete).
setChronology(Chronology) - Method in class org.springframework.format.datetime.joda.JodaTimeContext
Set the user's chronology.
setChunkedPost(boolean) - Method in class org.springframework.remoting.caucho.HessianClientInterceptor
Set whether to use a chunked post for sending a Hessian request.
setClassesToBeBound(Class<?>[]) - Method in class org.springframework.oxm.jaxb.Jaxb2Marshaller
Set the list of Java classes to be recognized by a newly created JAXBContext.
setClassFilter(ClassFilter) - Method in class org.springframework.aop.support.NameMatchMethodPointcutAdvisor
Set the ClassFilter to use for this pointcut.
setClassFilter(ClassFilter) - Method in class org.springframework.aop.support.StaticMethodMatcherPointcut
Set the ClassFilter to use for this pointcut.
setClassFilter(ClassFilter) - Method in class org.springframework.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor
Set the ClassFilter to use for this pointcut.
setClassFilter(ClassFilter) - Method in class org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor
Set the ClassFilter to use for this pointcut.
setClassLoader(ClassLoader) - Method in class org.springframework.core.io.DefaultResourceLoader
Specify the ClassLoader to load class path resources with, or null for using the thread context class loader at the time of actual resource access.
setCleanupAfterInclude(boolean) - Method in class org.springframework.web.servlet.DispatcherServlet
Set whether to perform cleanup of request attributes after an include request, that is, whether to reset the original state of all request attributes after the DispatcherServlet has processed within an include request.
setClearOnFlush(boolean) - Method in class org.springframework.cache.ehcache.EhCacheFactoryBean
Set whether the memory store should be cleared when flush is called on the cache.
setClientId(String) - Method in class org.springframework.jms.connection.SingleConnectionFactory
Specify a JMS client ID for the single Connection created and exposed by this ConnectionFactory.
setClientId(String) - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Specify the JMS client id for a shared Connection created and used by this container.
setClientId(String) - Method in class org.springframework.jms.listener.endpoint.JmsActivationSpecConfig
setClientSocketFactory(RMIClientSocketFactory) - Method in class org.springframework.remoting.rmi.RmiRegistryFactoryBean
Set a custom RMI client socket factory to use for the RMI registry.
setClientSocketFactory(RMIClientSocketFactory) - Method in class org.springframework.remoting.rmi.RmiServiceExporter
Set a custom RMI client socket factory to use for exporting the service.
setClobAsAsciiStream(PreparedStatement, int, InputStream, int) - Method in class org.springframework.jdbc.support.lob.DefaultLobHandler.DefaultLobCreator
setClobAsAsciiStream(PreparedStatement, int, InputStream, int) - Method in interface org.springframework.jdbc.support.lob.LobCreator
Set the given content as ASCII stream on the given statement, using the given parameter index.
setClobAsAsciiStream(PreparedStatement, int, InputStream, int) - Method in class org.springframework.jdbc.support.lob.OracleLobHandler.OracleLobCreator
setClobAsCharacterStream(PreparedStatement, int, Reader, int) - Method in class org.springframework.jdbc.support.lob.DefaultLobHandler.DefaultLobCreator
setClobAsCharacterStream(PreparedStatement, int, Reader, int) - Method in interface org.springframework.jdbc.support.lob.LobCreator
Set the given content as character stream on the given statement, using the given parameter index.
setClobAsCharacterStream(PreparedStatement, int, Reader, int) - Method in class org.springframework.jdbc.support.lob.OracleLobHandler.OracleLobCreator
setClobAsString(PreparedStatement, int, String) - Method in class org.springframework.jdbc.support.lob.DefaultLobHandler.DefaultLobCreator
setClobAsString(PreparedStatement, int, String) - Method in interface org.springframework.jdbc.support.lob.LobCreator
Set the given content as String on the given statement, using the given parameter index.
setClobAsString(PreparedStatement, int, String) - Method in class org.springframework.jdbc.support.lob.OracleLobHandler.OracleLobCreator
setCode(String) - Method in class org.springframework.web.servlet.tags.MessageTag
Set the message code for this tag.
setCodebaseUrl(String) - Method in class org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor
Set the codebase URL to download classes from if not found locally.
setCollectionCacheStrategies(Properties) - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Specify the cache strategies for persistent collections (with specific roles).
setCols(String) - Method in class org.springframework.web.servlet.tags.form.TextareaTag
Set the value of the 'cols' attribute.
setColumnName(String) - Method in class org.springframework.jdbc.support.incrementer.AbstractColumnMaxValueIncrementer
Set the name of the column in the sequence table.
setColumnNames(List<String>) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Set the names of the columns to be used
setCommandClass(Class) - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Set the command class for this controller.
setCommandClass(Class) - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Set the command class for this controller.
setCommandInSession(ActionResponse) - Method in class org.springframework.web.portlet.mvc.AbstractCommandController
Deprecated. Set the action response parameter that indicates there is a command (and errors) object in the session for the render phase.
setCommandName(String) - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Set the name of the command in the model.
setCommandName(String) - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Set the name of the command in the model.
setCommandName(String) - Method in class org.springframework.web.servlet.tags.form.FormTag
Set the name of the form attribute in the model.
setCommentPrefix(String) - Method in class org.springframework.jdbc.datasource.init.ResourceDatabasePopulator
Set the line prefix that identifies comments in the SQL script.
setCommitted(boolean) - Method in class org.springframework.mock.web.MockHttpServletResponse
setCommitted(boolean) - Method in class org.springframework.mock.web.portlet.MockMimeResponse
setComparator(int, Comparator<T>) - Method in class org.springframework.util.comparator.CompoundComparator
Replace the Comparator at the given index.
setComparator(int, Comparator<T>, boolean) - Method in class org.springframework.util.comparator.CompoundComparator
Replace the Comparator at the given index using the given sort order.
setComplete() - Method in class org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
Deprecated. Overridden to prevent the transaction committing if a number of tables have been cleared, as a defensive measure against accidental permanent wiping of a database.
setComplete() - Method in class org.springframework.test.AbstractTransactionalSpringContextTests
Deprecated. Cause the transaction to commit for this test method, even if the test method is configured to rollback.
setComplete() - Method in interface org.springframework.web.bind.support.SessionStatus
Mark the current handler's session processing as complete, allowing for cleanup of session attributes.
setComplete() - Method in class org.springframework.web.bind.support.SimpleSessionStatus
setCompleteAutoload(boolean) - Method in class org.springframework.web.servlet.view.tiles2.TilesConfigurer
Specify whether to apply Tiles 2.2's "complete-autoload" configuration.
setCompleted() - Method in class org.springframework.transaction.support.AbstractTransactionStatus
Mark this transaction as completed, that is, committed or rolled back.
setConcurrency(String) - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Specify concurrency limits via a "lower-upper" String, e.g.
setConcurrency(String) - Method in class org.springframework.jms.listener.endpoint.JmsActivationSpecConfig
Specify concurrency limits via a "lower-upper" String, e.g.
setConcurrency(String) - Method in class org.springframework.jms.listener.SimpleMessageListenerContainer
Specify concurrency limits via a "lower-upper" String, e.g.
setConcurrencyLimit(int) - Method in class org.springframework.core.task.SimpleAsyncTaskExecutor
Set the maximum number of parallel accesses allowed.
setConcurrencyLimit(int) - Method in class org.springframework.util.ConcurrencyThrottleSupport
Set the maximum number of concurrent access attempts allowed.
setConcurrent(boolean) - Method in class org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean
Specify whether or not multiple jobs should be run in a concurrent fashion.
setConcurrentConsumers(int) - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Specify the number of concurrent consumers to create.
setConcurrentConsumers(int) - Method in class org.springframework.jms.listener.SimpleMessageListenerContainer
Specify the number of concurrent consumers to create.
setConcurrentExecutor(Executor) - Method in class org.springframework.scheduling.backportconcurrent.ConcurrentTaskExecutor
Specify the JSR-166 backport concurrent executor to delegate to.
setConcurrentExecutor(Executor) - Method in class org.springframework.scheduling.concurrent.ConcurrentTaskExecutor
Specify the JDK 1.5 concurrent executor to delegate to.
setConfigLocation(Resource) - Method in class org.springframework.cache.ehcache.EhCacheManagerFactoryBean
Set the location of the EHCache config file.
setConfigLocation(String) - Method in class org.springframework.context.support.AbstractRefreshableConfigApplicationContext
Set the config locations for this application context in init-param style, i.e.
setConfigLocation(Resource) - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Set the location of a single Hibernate XML config file, for example as classpath resource "classpath:hibernate.cfg.xml".
setConfigLocation(Resource) - Method in class org.springframework.orm.ibatis.SqlMapClientFactoryBean
Set the location of the iBATIS SqlMapClient config file.
setConfigLocation(Resource) - Method in class org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean
Set the location of the JDO properties config file, for example as classpath resource "classpath:kodo.properties".
setConfigLocation(Resource) - Method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
Set the location of the Quartz properties config file, for example as classpath resource "classpath:quartz.properties".
setConfigLocation(Resource) - Method in class org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
Set the location of the FreeMarker config file.
setConfigLocation(Resource) - Method in class org.springframework.ui.velocity.VelocityEngineFactory
Set the location of the Velocity config file.
setConfigLocation(String) - Method in interface org.springframework.web.context.ConfigurableWebApplicationContext
Set the config locations for this web application context in init-param style, i.e.
setConfigLocation(String) - Method in class org.springframework.web.context.support.StaticWebApplicationContext
The StaticWebApplicationContext class does not support this method.
setConfigLocation(String) - Method in interface org.springframework.web.portlet.context.ConfigurablePortletApplicationContext
Set the config locations for this portlet application context in init-param style, i.e.
setConfigLocation(String) - Method in class org.springframework.web.portlet.context.StaticPortletApplicationContext
The StaticPortletApplicationContext class does not support this method.
setConfigLocations(String[]) - Method in class org.springframework.context.support.AbstractRefreshableConfigApplicationContext
Set the config locations for this application context.
setConfigLocations(Resource[]) - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Set the locations of multiple Hibernate XML config files, for example as classpath resources "classpath:hibernate.cfg.xml,classpath:extension.cfg.xml".
setConfigLocations(Resource[]) - Method in class org.springframework.orm.ibatis.SqlMapClientFactoryBean
Set multiple locations of iBATIS SqlMapClient config files that are going to be merged into one unified configuration at runtime.
setConfigLocations(String[]) - Method in interface org.springframework.web.context.ConfigurableWebApplicationContext
Set the config locations for this web application context.
setConfigLocations(String[]) - Method in class org.springframework.web.context.support.StaticWebApplicationContext
The StaticWebApplicationContext class does not support this method.
setConfigLocations(String[]) - Method in interface org.springframework.web.portlet.context.ConfigurablePortletApplicationContext
Set the config locations for this portlet application context.
setConfigLocations(String[]) - Method in class org.springframework.web.portlet.context.StaticPortletApplicationContext
The StaticPortletApplicationContext class does not support this method.
setConfiguration(Configuration) - Method in class org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer
Set a preconfigured Configuration to use for the FreeMarker web config, e.g.
setConfiguration(Configuration) - Method in class org.springframework.web.servlet.view.freemarker.FreeMarkerView
Set the FreeMarker Configuration to be used by this view.
setConfigurationClass(Class) - Method in class org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean
setConfigurationClass(Class<?>) - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Specify the Hibernate Configuration class to use.
setConnection(Connection) - Method in class org.springframework.jdbc.datasource.ConnectionHolder
Override the existing Connection handle with the given Connection.
setConnectionFactory(ConnectionFactory) - Method in class org.springframework.jca.cci.connection.CciLocalTransactionManager
Set the CCI ConnectionFactory that this instance should manage local transactions for.
setConnectionFactory(ConnectionFactory) - Method in class org.springframework.jca.cci.core.CciTemplate
Set the CCI ConnectionFactory to obtain Connections from.
setConnectionFactory(ConnectionFactory) - Method in class org.springframework.jca.cci.core.support.CciDaoSupport
Set the ConnectionFactory to be used by this DAO.
setConnectionFactory(ConnectionFactory) - Method in class org.springframework.jca.cci.object.EisOperation
Set the CCI ConnectionFactory to be used by this operation.
setConnectionFactory(ConnectionFactory) - Method in class org.springframework.jms.connection.JmsTransactionManager
Set the JMS ConnectionFactory that this instance should manage transactions for.
setConnectionFactory(ConnectionFactory) - Method in class org.springframework.jms.core.support.JmsGatewaySupport
Set the JMS connection factory to be used by the gateway.
setConnectionFactory(ConnectionFactory) - Method in class org.springframework.jms.remoting.JmsInvokerClientInterceptor
Set the QueueConnectionFactory to use for obtaining JMS QueueConnections.
setConnectionFactory(ConnectionFactory) - Method in class org.springframework.jms.support.JmsAccessor
Set the ConnectionFactory to use for obtaining JMS Connections.
setConnectionHolder(ConnectionHolder) - Method in class org.springframework.jdbc.datasource.JdbcTransactionObjectSupport
setConnectionManager(ConnectionManager) - Method in class org.springframework.jca.support.LocalConnectionFactoryBean
Set the JCA ConnectionManager that should be used to create the desired connection factory.
setConnectionProperties(Properties) - Method in class org.springframework.jdbc.datasource.AbstractDriverBasedDataSource
Specify arbitrary connection properties as key/value pairs, to be passed to the Driver.
setConnectionSpec(ConnectionSpec) - Method in class org.springframework.jca.cci.connection.ConnectionSpecConnectionFactoryAdapter
Set the ConnectionSpec that this adapter should use for retrieving Connections.
setConnectionSpec(ConnectionSpec) - Method in class org.springframework.jca.cci.core.CciTemplate
Set the CCI ConnectionSpec that this template instance is supposed to obtain Connections for.
setConnectionSpecForCurrentThread(ConnectionSpec) - Method in class org.springframework.jca.cci.connection.ConnectionSpecConnectionFactoryAdapter
Set a ConnectionSpec for this proxy and the current thread.
setConnectOnStartup(boolean) - Method in class org.springframework.jmx.access.MBeanClientInterceptor
Set whether or not the proxy should connect to the MBeanServer at creation time ("true") or the first time it is invoked ("false").
setConnectOnStartup(boolean) - Method in class org.springframework.jmx.support.MBeanServerConnectionFactoryBean
Set whether to connect to the server on startup.
setConstraintValidatorFactory(ConstraintValidatorFactory) - Method in class org.springframework.validation.beanvalidation.LocalValidatorFactoryBean
Specify a custom ConstraintValidatorFactory to use for this ValidatorFactory.
setConstructorArgumentValues(ConstructorArgumentValues) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Specify constructor argument values for this bean.
setConstructorResolvers(List<ConstructorResolver>) - Method in class org.springframework.expression.spel.support.StandardEvaluationContext
setContent(byte[]) - Method in class org.springframework.mock.web.MockHttpServletRequest
setContent(byte[]) - Method in class org.springframework.mock.web.portlet.MockClientDataRequest
setContentDispositionFormData(String, String) - Method in class org.springframework.http.HttpHeaders
Sets the (new) value of the Content-Disposition header for form-data.
setContentDispositionMappings(Properties) - Method in class org.springframework.web.servlet.view.jasperreports.JasperReportsMultiFormatView
Set the mappings of Content-Disposition header values to mapping keys.
setContentLength(long) - Method in class org.springframework.http.HttpHeaders
Set the length of the body in bytes, as specified by the Content-Length header.
setContentLength(int) - Method in class org.springframework.mock.web.MockHttpServletResponse
setContentLength(int) - Method in class org.springframework.mock.web.portlet.MockResourceResponse
setContentType(MediaType) - Method in class org.springframework.http.HttpHeaders
Set the media type of the body, as specified by the Content-Type header.
setContentType(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
setContentType(String) - Method in class org.springframework.mock.web.MockHttpServletResponse
setContentType(String) - Method in class org.springframework.mock.web.portlet.MockClientDataRequest
setContentType(String) - Method in class org.springframework.mock.web.portlet.MockMimeResponse
setContentType(String) - Method in class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
Specify the content type to use for sending HTTP invoker requests.
setContentType(String) - Method in class org.springframework.remoting.rmi.RemoteInvocationSerializingExporter
Specify the content type to use for sending remote invocation responses.
setContentType(String) - Method in class org.springframework.web.servlet.ResourceServlet
Set the content type of the target resource (typically a JSP).
setContentType(String) - Method in class org.springframework.web.servlet.view.AbstractView
Set the content type for this view.
setContentType(String) - Method in class org.springframework.web.servlet.view.UrlBasedViewResolver
Set the content type for all views.
setContentType(String) - Method in class org.springframework.web.servlet.view.xslt.AbstractXsltView
Deprecated.
setContext(String) - Method in class org.springframework.web.servlet.tags.UrlTag
Set the context path for the URL.
setContextAttribute(String) - Method in class org.springframework.web.filter.DelegatingFilterProxy
Set the name of the ServletContext attribute which should be used to retrieve the WebApplicationContext from which to load the delegate Filter bean.
setContextAttribute(String) - Method in class org.springframework.web.servlet.FrameworkServlet
Set the name of the ServletContext attribute which should be used to retrieve the WebApplicationContext that this servlet is supposed to use.
setContextClass(Class) - Method in class org.springframework.web.portlet.FrameworkPortlet
Set a custom context class.
setContextClass(Class) - Method in class org.springframework.web.servlet.FrameworkServlet
Set a custom context class.
setContextClass(Class) - Method in class org.springframework.web.struts.ContextLoaderPlugIn
Deprecated. Set a custom context class.
setContextClassName(String) - Method in class org.springframework.web.struts.ContextLoaderPlugIn
Deprecated. Set a custom context class by name.
setContextConfigLocation(String) - Method in class org.springframework.jca.context.SpringContextResourceAdapter
Set the location of the context configuration files, within the resource adapter's deployment unit.
setContextConfigLocation(String) - Method in class org.springframework.web.portlet.FrameworkPortlet
Set the context config location explicitly, instead of relying on the default location built from the namespace.
setContextConfigLocation(String) - Method in class org.springframework.web.servlet.FrameworkServlet
Set the context config location explicitly, instead of relying on the default location built from the namespace.
setContextConfigLocation(String) - Method in class org.springframework.web.struts.ContextLoaderPlugIn
Deprecated. Set the context config location explicitly, instead of relying on the default location built from the namespace.
setContextOverride(boolean) - Method in class org.springframework.web.context.support.ServletContextPropertyPlaceholderConfigurer
Set whether ServletContext init parameters (and optionally also ServletContext attributes) should override local properties within the application.
setContextPath(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
setContextPath(String) - Method in class org.springframework.mock.web.MockServletContext
setContextPath(String) - Method in class org.springframework.mock.web.portlet.MockPortletRequest
setContextPath(String) - Method in class org.springframework.oxm.jaxb.Jaxb2Marshaller
Set a JAXB context path.
setContextPaths(String[]) - Method in class org.springframework.oxm.jaxb.Jaxb2Marshaller
Set multiple JAXB context paths.
setContextRelative(boolean) - Method in class org.springframework.web.servlet.view.RedirectView
Set whether to interpret a given URL that starts with a slash ("/") as relative to the current ServletContext, i.e.
setContexts(Map<String, HttpHandler>) - Method in class org.springframework.remoting.support.SimpleHttpServerFactoryBean
Register HttpHandlers for specific context paths.
setContinueOnError(boolean) - Method in class org.springframework.jdbc.datasource.init.ResourceDatabasePopulator
Flag to indicate that all failures in SQL should be logged but not cause a failure.
setContinueScheduledExecutionAfterException(boolean) - Method in class org.springframework.scheduling.concurrent.ScheduledExecutorFactoryBean
Specify whether to continue the execution of a scheduled task after it threw an exception.
setConversionService(ConversionService) - Method in interface org.springframework.beans.ConfigurablePropertyAccessor
Specify a Spring 3.0 ConversionService to use for converting property values, as an alternative to JavaBeans PropertyEditors.
setConversionService(ConversionService) - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Specify a Spring 3.0 ConversionService to use for converting property values, as an alternative to JavaBeans PropertyEditors.
setConversionService(ConversionService) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
setConversionService(ConversionService) - Method in class org.springframework.beans.PropertyEditorRegistrySupport
Specify a Spring 3.0 ConversionService to use for converting property values, as an alternative to JavaBeans PropertyEditors.
setConversionService(ConversionService) - Method in class org.springframework.validation.DataBinder
Specify a Spring 3.0 ConversionService to use for converting property values, as an alternative to JavaBeans PropertyEditors.
setConversionService(ConversionService) - Method in class org.springframework.web.bind.support.ConfigurableWebBindingInitializer
Specify a ConversionService which will apply to every DataBinder.
setConverted() - Method in class org.springframework.beans.MutablePropertyValues
Mark this holder as containing converted values only (i.e.
setConvertedExporterParameters(Map<JRExporterParameter, Object>) - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
Allows subclasses to populate the converted exporter parameters.
setConvertedValue(Object) - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues.ValueHolder
Set the converted value of the constructor argument, after processed type conversion.
setConvertedValue(Object) - Method in class org.springframework.beans.PropertyValue
Set the converted value of the constructor argument, after processed type conversion.
setConverters(Set<?>) - Method in class org.springframework.context.support.ConversionServiceFactoryBean
Configure the set of custom converter objects that should be added: implementing Converter, ConverterFactory, or GenericConverter.
setConverters(Set<?>) - Method in class org.springframework.format.support.FormattingConversionServiceFactoryBean
Configure the set of custom converter objects that should be added: implementing Converter, ConverterFactory, or GenericConverter.
setConverters(ConverterMatcher[]) - Method in class org.springframework.oxm.xstream.XStreamMarshaller
Set the Converters or SingleValueConverters to be registered with the XStream instance.
setCookieDomain(String) - Method in class org.springframework.web.util.CookieGenerator
Use the given domain for cookies created by this generator.
setCookieMaxAge(Integer) - Method in class org.springframework.web.util.CookieGenerator
Use the given maximum age (in seconds) for cookies created by this generator.
setCookieName(String) - Method in class org.springframework.web.util.CookieGenerator
Use the given name for cookies created by this generator.
setCookiePath(String) - Method in class org.springframework.web.util.CookieGenerator
Use the given path for cookies created by this generator.
setCookies(Cookie...) - Method in class org.springframework.mock.web.MockHttpServletRequest
setCookies(Cookie...) - Method in class org.springframework.mock.web.portlet.MockPortletRequest
setCookieSecure(boolean) - Method in class org.springframework.web.util.CookieGenerator
Set whether the cookie should only be sent using a secure protocol, such as HTTPS (SSL).
setCorePoolSize(int) - Method in class org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor
Set the ThreadPoolExecutor's core pool size.
setCorePoolSize(int) - Method in class org.springframework.scheduling.concurrent.ThreadPoolExecutorFactoryBean
Set the ThreadPoolExecutor's core pool size.
setCorePoolSize(int) - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
Set the ThreadPoolExecutor's core pool size.
setCredentialsForCurrentThread(String, String) - Method in class org.springframework.jdbc.datasource.UserCredentialsDataSourceAdapter
Set user credententials for this proxy and the current thread.
setCredentialsForCurrentThread(String, String) - Method in class org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter
Set user credententials for this proxy and the current thread.
setCronTasks(Map<Runnable, String>) - Method in class org.springframework.scheduling.config.ScheduledTaskRegistrar
setCssClass(String) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Set the value of the 'class' attribute.
setCssErrorClass(String) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
The CSS class to use when the field bound to a particular tag has errors.
setCssErrorClass(String) - Method in class org.springframework.web.servlet.tags.form.FormTag
Unsupported for forms.
setCssStyle(String) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Set the value of the 'style' attribute.
setCurrency(Currency) - Method in class org.springframework.format.number.CurrencyFormatter
Specify the currency, if known.
setCurrencyTimeLimit(int) - Method in class org.springframework.jmx.export.metadata.AbstractJmxAttribute
Set a currency time limit for this attribute.
setCurrentTransactionIsolationLevel(Integer) - Static method in class org.springframework.transaction.support.TransactionSynchronizationManager
Expose an isolation level for the current transaction.
setCurrentTransactionName(String) - Static method in class org.springframework.transaction.support.TransactionSynchronizationManager
Expose the name of the current transaction, if any.
setCurrentTransactionReadOnly(boolean) - Static method in class org.springframework.transaction.support.TransactionSynchronizationManager
Expose a read-only flag for the current transaction.
setCustomArgumentResolver(WebArgumentResolver) - Method in class org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter
Set a custom WebArgumentResolver to use for special method parameter types.
setCustomArgumentResolver(WebArgumentResolver) - Method in class org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver
Set a custom ArgumentResolvers to use for special method parameter types.
setCustomArgumentResolver(WebArgumentResolver) - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
Set a custom WebArgumentResolvers to use for special method parameter types.
setCustomArgumentResolver(WebArgumentResolver) - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver
Set a custom ArgumentResolvers to use for special method parameter types.
setCustomArgumentResolvers(WebArgumentResolver[]) - Method in class org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter
Set one or more custom WebArgumentResolvers to use for special method parameter types.
setCustomArgumentResolvers(WebArgumentResolver[]) - Method in class org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver
Set one or more custom ArgumentResolvers to use for special method parameter types.
setCustomArgumentResolvers(WebArgumentResolver[]) - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
Set one or more custom WebArgumentResolvers to use for special method parameter types.
setCustomArgumentResolvers(WebArgumentResolver[]) - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver
Set one or more custom ArgumentResolvers to use for special method parameter types.
setCustomEditors(Map<String, ?>) - Method in class org.springframework.beans.factory.config.CustomEditorConfigurer
Specify the custom editors to register via a Map, using the class name of the required type as the key and the class name of the associated PropertyEditor as value.
setCustomModelAndViewResolver(ModelAndViewResolver) - Method in class org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter
Set a custom ModelAndViewResolvers to use for special method return types.
setCustomModelAndViewResolver(ModelAndViewResolver) - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
Set a custom ModelAndViewResolvers to use for special method return types.
setCustomModelAndViewResolvers(ModelAndViewResolver[]) - Method in class org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter
Set one or more custom ModelAndViewResolvers to use for special method return types.
setCustomModelAndViewResolvers(ModelAndViewResolver[]) - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
Set one or more custom ModelAndViewResolvers to use for special method return types.
setCustomProperties(Properties) - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Set custom properties to be set on the stub or call.
setCustomProperties(Map<String, Object>) - Method in class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
Set custom properties to be set on the stub.
setCustomPropertyMap(Map<String, Object>) - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Set custom properties to be set on the stub or call.
setCustomQualifierTypes(Set) - Method in class org.springframework.beans.factory.annotation.CustomAutowireConfigurer
Register custom qualifier annotation types to be considered when autowiring beans.
setCustomSqlExceptionTranslatorClass(Class) - Method in class org.springframework.jdbc.support.SQLErrorCodes
setCustomTargetSourceCreators(TargetSourceCreator[]) - Method in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
Set custom TargetSourceCreators to be applied in this order.
setCustomTranslations(CustomSQLErrorCodesTranslation[]) - Method in class org.springframework.jdbc.support.SQLErrorCodes
setDaemon(boolean) - Method in class org.springframework.jmx.support.ConnectorServerFactoryBean
Set whether any threads started for the JMXConnectorServer should be started as daemon threads.
setDaemon(boolean) - Method in class org.springframework.scheduling.timer.TimerFactoryBean
Deprecated. Set whether the timer should use a daemon thread, just executing as long as the application itself is running.
setDaemon(boolean) - Method in class org.springframework.util.CustomizableThreadCreator
Set whether this factory is supposed to create daemon threads, just executing as long as the application itself is running.
setDataAccessResourceFailureCodes(String[]) - Method in class org.springframework.jdbc.support.SQLErrorCodes
setDatabase(Database) - Method in class org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter
Specify the target database to operate on, as a value of the Database enum: DB2, DERBY, H2, HSQL, INFORMIX, MYSQL, ORACLE, POSTGRESQL, SQL_SERVER, SYBASE
setDatabaseConfigurer(EmbeddedDatabaseConfigurer) - Method in class org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory
Set the strategy that will be used to configure the embedded database instance.
setDatabaseName(String) - Method in class org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory
Set the name of the database.
setDatabasePlatform(String) - Method in class org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter
Specify the name of the target database to operate on.
setDatabasePopulator(DatabasePopulator) - Method in class org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory
Set the strategy that will be used to populate the embedded database.
setDatabasePopulator(DatabasePopulator) - Method in class org.springframework.jdbc.datasource.init.DataSourceInitializer
The DatabasePopulator to use to populate the data source.
setDatabaseProductName(String) - Method in class org.springframework.jdbc.support.JdbcAccessor
Specify the database product name for the DataSource that this accessor uses.
setDatabaseProductName(String) - Method in class org.springframework.jdbc.support.SQLErrorCodes
Set this property if the database name contains spaces, in which case we can not use the bean name for lookup.
setDatabaseProductName(String) - Method in class org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator
Set the database product name for this translator.
setDatabaseProductNames(String[]) - Method in class org.springframework.jdbc.support.SQLErrorCodes
Set this property to specify multiple database names that contains spaces, in which case we can not use bean names for lookup.
setDatabaseType(EmbeddedDatabaseType) - Method in class org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory
Set the type of embedded database to use.
setDataIntegrityViolationCodes(String[]) - Method in class org.springframework.jdbc.support.SQLErrorCodes
setDataSource(DataSource) - Method in class org.springframework.jdbc.core.support.JdbcBeanDefinitionReader
Set the DataSource to use to obtain database connections.
setDataSource(DataSource) - Method in class org.springframework.jdbc.core.support.JdbcDaoSupport
Set the JDBC DataSource to be used by this DAO.
setDataSource(DataSource) - Method in class org.springframework.jdbc.datasource.DataSourceTransactionManager
Set the JDBC DataSource that this instance should manage transactions for.
setDataSource(DataSource) - Method in class org.springframework.jdbc.datasource.init.DataSourceInitializer
The DataSource to populate when this component is initialized.
setDataSource(DataSource) - Method in class org.springframework.jdbc.object.RdbmsOperation
Set the JDBC DataSource to obtain connections from.
setDataSource(DataSource) - Method in class org.springframework.jdbc.support.DatabaseStartupValidator
Set the DataSource to validate.
setDataSource(DataSource) - Method in class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
Set the data source to retrieve the value from.
setDataSource(DataSource) - Method in class org.springframework.jdbc.support.JdbcAccessor
Set the JDBC DataSource to obtain connections from.
setDataSource(DataSource) - Method in class org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator
Set the DataSource for this translator.
setDataSource(DataSource) - Method in class org.springframework.orm.hibernate3.AbstractSessionFactoryBean
Set the DataSource to be used by the SessionFactory.
setDataSource(DataSource) - Method in class org.springframework.orm.hibernate3.HibernateTransactionManager
Set the JDBC DataSource that this instance should manage transactions for.
setDataSource(DataSource) - Method in class org.springframework.orm.ibatis.SqlMapClientFactoryBean
Set the DataSource to be used by iBATIS SQL Maps.
setDataSource(DataSource) - Method in class org.springframework.orm.ibatis.support.SqlMapClientDaoSupport
Set the JDBC DataSource to be used by this DAO.
setDataSource(DataSource) - Method in class org.springframework.orm.jdo.JdoTransactionManager
Set the JDBC DataSource that this instance should manage transactions for.
setDataSource(DataSource) - Method in class org.springframework.orm.jpa.JpaTransactionManager
Set the JDBC DataSource that this instance should manage transactions for.
setDataSource(DataSource) - Method in class org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean
Specify the JDBC DataSource that the JPA persistence provider is supposed to use for accessing the database.
setDataSource(DataSource) - Method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
Set the default DataSource to be used by the Scheduler.
setDataSource(DataSource) - Method in class org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
Deprecated. Setter: DataSource is provided by Dependency Injection.
setDataSource(DataSource) - Method in class org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests
Deprecated.
setDataSource(DataSource) - Method in class org.springframework.test.context.junit38.AbstractTransactionalJUnit38SpringContextTests
Set the DataSource, typically provided via Dependency Injection.
setDataSource(DataSource) - Method in class org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests
Set the DataSource, typically provided via Dependency Injection.
setDataSource(DataSource) - Method in class org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests
Set the DataSource, typically provided via Dependency Injection.
setDataSourceFactory(DataSourceFactory) - Method in class org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory
Set the factory to use to create the DataSource instance that connects to the embedded database.
setDataSourceLookup(DataSourceLookup) - Method in class org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
Set the DataSourceLookup implementation to use for resolving data source name Strings in the targetDataSources map.
setDataSourceLookup(DataSourceLookup) - Method in class org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager
Specify the JDBC DataSourceLookup that provides DataSources for the persistence provider, resolving data source names in persistence.xml against Spring-managed DataSource instances.
setDataSources(Map<String, DataSource>) - Method in class org.springframework.jdbc.datasource.lookup.MapDataSourceLookup
Set the Map of DataSources; the keys are Strings, the values are actual DataSource instances.
setDataSources(Map<String, DataSource>) - Method in class org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager
Specify the JDBC DataSources that the JPA persistence provider is supposed to use for accessing the database, resolving data source names in persistence.xml against Spring-managed DataSources.
setDate(long) - Method in class org.springframework.http.HttpHeaders
Sets the date and time at which the message was created, as specified by the Date header.
setDateHeader(String, long) - Method in class org.springframework.mock.web.MockHttpServletResponse
setDateStyle(String) - Method in class org.springframework.format.datetime.joda.JodaTimeFormattingConfigurer
Set the default format style of Joda LocalDate objects.
setDateTimeStyle(String) - Method in class org.springframework.format.datetime.joda.JodaTimeFormattingConfigurer
Set the default format style of Joda LocalDateTime and DateTime objects, as well as JDK Date and Calendar objects.
setDateToolAttribute(String) - Method in class org.springframework.web.servlet.view.velocity.VelocityView
Set the name of the DateTool helper object to expose in the Velocity context of this view, or null if not needed.
setDateToolAttribute(String) - Method in class org.springframework.web.servlet.view.velocity.VelocityViewResolver
Set the name of the DateTool helper object to expose in the Velocity context of this view, or null if not needed.
setDeadlockLoserCodes(String[]) - Method in class org.springframework.jdbc.support.SQLErrorCodes
setDebug(boolean) - Method in class org.springframework.remoting.caucho.HessianClientInterceptor
Set whether Hessian's debug mode should be enabled.
setDebug(boolean) - Method in class org.springframework.remoting.caucho.HessianExporter
Set whether Hessian's debug mode should be enabled, logging to this exporter's Commons Logging log.
setDeclarationOrder(int) - Method in class org.springframework.aop.aspectj.AbstractAspectJAdvice
Sets the declaration order of this advice within the aspect
setDecoratedDefinition(BeanDefinitionHolder) - Method in class org.springframework.beans.factory.support.RootBeanDefinition
setDefaultAutoCommit(boolean) - Method in class org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy
Set the default auto-commit mode to expose when no target Connection has been fetched yet (-> actual JDBC Connection default not known yet).
setDefaultContentType(MediaType) - Method in class org.springframework.http.converter.BufferedImageHttpMessageConverter
Sets the default Content-Type to be used for writing.
setDefaultContentType(MediaType) - Method in class org.springframework.web.servlet.view.ContentNegotiatingViewResolver
Sets the default content type.
setDefaultCurrencyTimeLimit(Integer) - Method in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Set the default for the JMX field "currencyTimeLimit".
setDefaultDataSource(DataSource) - Method in class org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager
Specify the JDBC DataSource that the JPA persistence provider is supposed to use for accessing the database if none has been specified in persistence.xml.
setDefaultDestination(Destination) - Method in class org.springframework.jms.core.JmsTemplate
Set the destination to be used on send/receive operations that do not have a destination parameter.
setDefaultDestinationName(String) - Method in class org.springframework.jms.core.JmsTemplate
Set the destination name to be used on send/receive operations that do not have a destination parameter.
setDefaultDomain(String) - Method in class org.springframework.jmx.export.annotation.AnnotationMBeanExporter
Specify the default domain to be used for generating ObjectNames when no source-level metadata has been specified.
setDefaultDomain(String) - Method in class org.springframework.jmx.export.naming.MetadataNamingStrategy
Specify the default domain to be used for generating ObjectNames when no source-level metadata has been specified.
setDefaultDomain(String) - Method in class org.springframework.jmx.support.MBeanServerFactoryBean
Set the default domain to be used by the MBeanServer, to be passed to MBeanServerFactory.createMBeanServer() or MBeanServerFactory.findMBeanServer().
setDefaultEncoding(String) - Method in class org.springframework.context.support.ReloadableResourceBundleMessageSource
Set the default charset to use for parsing properties files.
setDefaultEncoding(String) - Method in class org.springframework.mail.javamail.JavaMailSenderImpl
Set the default encoding to use for MimeMessages created by this instance.
setDefaultEncoding(String) - Method in class org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
Set the default encoding for the FreeMarker configuration.
setDefaultEncoding(String) - Method in class org.springframework.web.multipart.commons.CommonsFileUploadSupport
Set the default character encoding to use for parsing requests, to be applied to headers of individual parts and to form fields.
setDefaultEncoding(String) - Method in class org.springframework.web.util.UrlPathHelper
Set the default character encoding to use for URL decoding.
setDefaultErrorView(String) - Method in class org.springframework.web.portlet.handler.SimpleMappingExceptionResolver
Set the name of the default error view.
setDefaultErrorView(String) - Method in class org.springframework.web.servlet.handler.SimpleMappingExceptionResolver
Set the name of the default error view.
setDefaultFileTypeMap(FileTypeMap) - Method in class org.springframework.mail.javamail.JavaMailSenderImpl
Set the default Java Activation FileTypeMap to use for MimeMessages created by this instance.
setDefaultFilterCondition(String) - Method in class org.springframework.orm.hibernate3.FilterDefinitionFactoryBean
Specify a default filter condition for the filter, if any.
setDefaultHandler(Object) - Method in class org.springframework.web.portlet.handler.AbstractHandlerMapping
Set the default handler for this handler mapping.
setDefaultHandler(Object) - Method in class org.springframework.web.servlet.handler.AbstractHandlerMapping
Set the default handler for this handler mapping.
setDefaultHtmlEscape(boolean) - Method in class org.springframework.web.servlet.support.RequestContext
(De)activate default HTML escaping for messages and errors, for the scope of this RequestContext.
setDefaultHtmlEscape(String) - Method in class org.springframework.web.servlet.tags.HtmlEscapeTag
Set the default value for HTML escaping, to be put into the current PageContext.
setDefaultListenerMethod(String) - Method in class org.springframework.jms.listener.adapter.MessageListenerAdapter
Specify the name of the default listener method to delegate to, for the case where no specific listener method has been determined.
setDefaultLocale(Locale) - Method in class org.springframework.web.servlet.i18n.AbstractLocaleResolver
Set a default Locale that this resolver will return if no other locale found.
setDefaultLocale(Locale) - Method in class org.springframework.web.servlet.i18n.CookieLocaleResolver
Set a fixed Locale that this resolver will return if no cookie found.
setDefaultMethodName(String) - Method in class org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver
Set the name of the default handler method that should be used when no parameter was found in the request
setDefaultNamespace(String) - Method in class org.springframework.mock.web.portlet.MockPortletConfig

setDefaultObject(Object) - Method in class org.springframework.jndi.JndiObjectFactoryBean
Specify a default object to fall back to if the JNDI lookup fails.
setDefaultParentBean(String) - Method in class org.springframework.beans.factory.support.PropertiesBeanDefinitionReader
Set the default parent bean for this bean factory.
setDefaultParentView(String) - Method in class org.springframework.web.servlet.view.ResourceBundleViewResolver
Set the default parent for views defined in the ResourceBundle.
setDefaultPersistenceUnitName(String) - Method in class org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
Specify the default persistence unit name, to be used in case of no unit name specified in an @PersistenceUnit / @PersistenceContext annotation.
setDefaultPersistenceUnitRootLocation(String) - Method in class org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager
Set the default persistence unit root location, to be applied if no unit-specific persistence unit root could be determined.
setDefaultProperties(Map<String, String>) - Method in class org.springframework.jms.listener.endpoint.StandardJmsActivationSpecFactory
Specify custom default properties, with String keys and String values.
setDefaultRefreshCheckDelay(long) - Method in class org.springframework.scripting.support.ScriptFactoryPostProcessor
Set the delay between refresh checks, in milliseconds.
setDefaultResponseDestination(Destination) - Method in class org.springframework.jms.listener.adapter.MessageListenerAdapter
Set the default destination to send response messages to.
setDefaultResponseQueueName(String) - Method in class org.springframework.jms.listener.adapter.MessageListenerAdapter
Set the name of the default response queue to send response messages to.
setDefaultResponseTopicName(String) - Method in class org.springframework.jms.listener.adapter.MessageListenerAdapter
Set the name of the default response topic to send response messages to.
setDefaultRollback(boolean) - Method in class org.springframework.test.AbstractTransactionalSpringContextTests
Deprecated. Subclasses can set this value in their constructor to change the default, which is always to roll the transaction back.
setDefaultStatusCode(int) - Method in class org.springframework.web.servlet.handler.SimpleMappingExceptionResolver
Set the default HTTP status code that this exception resolver will apply if it resolves an error view and if there is no status code mapping defined.
setDefaultTargetDataSource(Object) - Method in class org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
Specify the default target DataSource, if any.
setDefaultThemeName(String) - Method in class org.springframework.web.servlet.theme.AbstractThemeResolver
Set the name of the default theme.
setDefaultThemeName(String) - Method in class org.springframework.web.servlet.theme.CookieThemeResolver
Set the name of the default theme.
setDefaultTimeout(int) - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Specify the default timeout that this transaction manager should apply if there is no timeout specified at the transaction level, in seconds.
setDefaultTransactionIsolation(int) - Method in class org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy
Set the default transaction isolation level to expose when no target Connection has been fetched yet (-> actual JDBC Connection default not known yet).
setDefaultTransactionIsolationName(String) - Method in class org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy
Set the default transaction isolation level by the name of the corresponding constant in Connection, e.g.
setDefaultUrl(String) - Method in class org.springframework.web.servlet.ResourceServlet
Set the URL within the current web application from which to include content if the requested path isn't found, or if none is specified in the first place.
setDefaultValue(Object) - Method in class org.springframework.jmx.export.metadata.ManagedAttribute
Set the default value of this attribute.
setDefaultViews(List<View>) - Method in class org.springframework.web.servlet.view.ContentNegotiatingViewResolver
Sets the default views to use when a more specific view can not be obtained from the ViewResolver chain.
setDefinitions(String[]) - Method in class org.springframework.web.servlet.view.tiles.TilesConfigurer
Deprecated. Set the Tiles definitions, i.e.
setDefinitions(String[]) - Method in class org.springframework.web.servlet.view.tiles2.TilesConfigurer
Set the Tiles definitions, i.e.
setDefinitionsFactoryClass(Class<? extends DefinitionsFactory>) - Method in class org.springframework.web.servlet.view.tiles2.TilesConfigurer
Set the DefinitionsFactory implementation to use.
setDelay(long) - Method in class org.springframework.scheduling.commonj.ScheduledTimerListener
Set the delay before starting the task for the first time, in milliseconds.
setDelay(long) - Method in class org.springframework.scheduling.concurrent.ScheduledExecutorTask
Set the delay before starting the task for the first time, in milliseconds.
setDelay(long) - Method in class org.springframework.scheduling.timer.ScheduledTimerTask
Deprecated. Set the delay before starting the task for the first time, in milliseconds.
setDelay(long) - Method in class org.springframework.scheduling.timer.TimerTaskExecutor
Deprecated. Set the delay to use for scheduling tasks passed into the plain TimerTaskExecutor.execute(Runnable) method.
setDelegate(Object) - Method in class org.springframework.jms.listener.adapter.MessageListenerAdapter
Set a target object to delegate message listening to.
setDelegate(Object) - Method in class org.springframework.web.servlet.mvc.multiaction.MultiActionController
Set the delegate used by this class; the default is this, assuming that handler methods have been added by a subclass.
setDelimiter(String) - Method in class org.springframework.web.servlet.tags.form.AbstractMultiCheckedElementTag
Set the delimiter to be used between each 'input type="checkbox/radio"' tag.
setDelimiter(String) - Method in class org.springframework.web.servlet.tags.form.ErrorsTag
Set the delimiter to be used between error messages.
setDeliveryMode(int) - Method in class org.springframework.jms.core.JmsTemplate
Set the delivery mode to use when sending a message.
setDeliveryPersistent(boolean) - Method in class org.springframework.jms.core.JmsTemplate
Set whether message delivery should be persistent or non-persistent, specified as boolean value ("true" or "false").
setDependencyCheck(int) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Set the dependency check code.
setDependencyCheck(int) - Method in class org.springframework.beans.factory.support.BeanDefinitionBuilder
Set the depency check mode for this definition.
setDependencyCheck(int) - Method in class org.springframework.beans.factory.support.BeanDefinitionDefaults

setDependencyCheck(String) - Method in class org.springframework.beans.factory.xml.DocumentDefaultsDefinition
Set the default dependency-check setting for the document that's currently parsed.
setDependencyCheck(boolean) - Method in class org.springframework.test.AbstractDependencyInjectionSpringContextTests
Deprecated. Set whether or not dependency checking should be performed for test properties set by Dependency Injection.
setDependsOn(String[]) - Method in interface org.springframework.beans.factory.config.BeanDefinition
Set the names of the beans that this bean depends on being initialized.
setDependsOn(String[]) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Set the names of the beans that this bean depends on being initialized.
setDescendingOrder(int) - Method in class org.springframework.util.comparator.CompoundComparator
Change the sort order at the given index to descending sort.
setDescription(String) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Set a human-readable description of this bean definition.
setDescription(String) - Method in class org.springframework.jmx.export.metadata.AbstractJmxAttribute
Set a description for this attribute.
setDescription(String) - Method in class org.springframework.jmx.export.metadata.ManagedNotification
Set a description for this notification.
setDescription(String) - Method in class org.springframework.jmx.export.metadata.ManagedOperationParameter
Set a description for this parameter.
setDestination(Destination) - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Set the destination to receive messages from.
setDestinationName(String) - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Set the name of the destination to receive messages from.
setDestinationName(String) - Method in class org.springframework.jms.listener.endpoint.JmsActivationSpecConfig

setDestinationResolver(DestinationResolver) - Method in class org.springframework.jms.listener.adapter.MessageListenerAdapter
Set the DestinationResolver that should be used to resolve response destination names for this adapter.
setDestinationResolver(DestinationResolver) - Method in class org.springframework.jms.listener.endpoint.JmsMessageEndpointManager
Set the DestinationResolver to use for resolving destination names into the JCA 1.5 ActivationSpec "destination" property.
setDestinationResolver(DestinationResolver) - Method in class org.springframework.jms.listener.endpoint.StandardJmsActivationSpecFactory
Set the DestinationResolver to use for resolving destination names into the JCA 1.5 ActivationSpec "destination" property.
setDestinationResolver(DestinationResolver) - Method in class org.springframework.jms.remoting.JmsInvokerClientInterceptor
Set the DestinationResolver that is to be used to resolve Queue references for this accessor.
setDestinationResolver(DestinationResolver) - Method in class org.springframework.jms.support.destination.JmsDestinationAccessor
Set the DestinationResolver that is to be used to resolve Destination references for this accessor.
setDestroyAnnotationType(Class<? extends Annotation>) - Method in class org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor
Specify the destroy annotation to check for, indicating destruction methods to call when the context is shutting down.
setDestroyMethod(String) - Method in class org.springframework.beans.factory.xml.DocumentDefaultsDefinition
Set the default destroy-method setting for the document that's currently parsed.
setDestroyMethodName(String) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Set the name of the destroy method.
setDestroyMethodName(String) - Method in class org.springframework.beans.factory.support.BeanDefinitionBuilder
Set the destroy method for this definition.
setDestroyMethodName(String) - Method in class org.springframework.beans.factory.support.BeanDefinitionDefaults

setDetectAllHandlerAdapters(boolean) - Method in class org.springframework.web.portlet.DispatcherPortlet
Set whether to detect all HandlerAdapter beans in this portlet's context.
setDetectAllHandlerAdapters(boolean) - Method in class org.springframework.web.servlet.DispatcherServlet
Set whether to detect all HandlerAdapter beans in this servlet's context.
setDetectAllHandlerExceptionResolvers(boolean) - Method in class org.springframework.web.portlet.DispatcherPortlet
Set whether to detect all HandlerExceptionResolver beans in this portlet's context.
setDetectAllHandlerExceptionResolvers(boolean) - Method in class org.springframework.web.servlet.DispatcherServlet
Set whether to detect all HandlerExceptionResolver beans in this servlet's context.
setDetectAllHandlerMappings(boolean) - Method in class org.springframework.web.portlet.DispatcherPortlet
Set whether to detect all HandlerMapping beans in this portlet's context.
setDetectAllHandlerMappings(boolean) - Method in class org.springframework.web.servlet.DispatcherServlet
Set whether to detect all HandlerMapping beans in this servlet's context.
setDetectAllViewResolvers(boolean) - Method in class org.springframework.web.portlet.DispatcherPortlet
Set whether to detect all ViewResolver beans in this portlet's context.
setDetectAllViewResolvers(boolean) - Method in class org.springframework.web.servlet.DispatcherServlet
Set whether to detect all ViewResolver beans in this servlet's context.
setDetectHandlersInAncestorContexts(boolean) - Method in class org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping
Set whether to detect handler beans in ancestor ApplicationContexts.
setDir(String) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Set the value of the 'dir' attribute.
setDirectFieldAccess(boolean) - Method in class org.springframework.web.bind.support.ConfigurableWebBindingInitializer
Set whether to use direct field access instead of bean property access.
setDirty() - Method in class org.springframework.test.AbstractSingleSpringContextTests
Deprecated. Called to say that the "applicationContext" instance variable is dirty and should be reloaded.
setDirty(Object) - Method in class org.springframework.test.AbstractSpringContextTests
Deprecated. Mark the context with the given key as dirty.
setDirty() - Method in class org.springframework.test.jpa.AbstractJpaTests
Deprecated.
setDisableCaching(boolean) - Method in class org.springframework.web.servlet.view.json.MappingJacksonJsonView
Disables caching of the generated JSON.
setDisabled(String) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
Set the value of the 'disabled' attribute.
setDisabled(String) - Method in class org.springframework.web.servlet.tags.form.OptionsTag
Set the value of the 'disabled' attribute.
setDisabled(String) - Method in class org.springframework.web.servlet.tags.form.OptionTag
Set the value of the 'disabled' attribute.
setDisallowedFields(String...) - Method in class org.springframework.validation.DataBinder
Register fields that should not be allowed for binding.
setDiskExpiryThreadIntervalSeconds(int) - Method in class org.springframework.cache.ehcache.EhCacheFactoryBean
Set the number of seconds between runs of the disk expiry thread.
setDiskPersistent(boolean) - Method in class org.springframework.cache.ehcache.EhCacheFactoryBean
Set whether the disk store persists between restarts of the Virtual Machine.
setDiskSpoolBufferSize(int) - Method in class org.springframework.cache.ehcache.EhCacheFactoryBean
Set the amount of memory to allocate the write buffer for puts to the disk store.
setDispatchOptionsRequest(boolean) - Method in class org.springframework.web.servlet.FrameworkServlet
Set whether this servlet should dispatch an HTTP OPTIONS request to the FrameworkServlet.doService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) method.
setDispatchTraceRequest(boolean) - Method in class org.springframework.web.servlet.FrameworkServlet
Set whether this servlet should dispatch an HTTP TRACE request to the FrameworkServlet.doService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) method.
setDisplayName(String) - Method in class org.springframework.context.support.AbstractApplicationContext
Set a friendly name for this context.
setDisplayName(String) - Method in class org.springframework.jmx.export.metadata.ManagedMetric
A display name for this metric.
setDocTypeInternalSubset(String) - Method in class org.springframework.oxm.jibx.JibxMarshaller
Sets the internal subset Id for the DTD declaration written when marshalling.
setDocTypePublicId(String) - Method in class org.springframework.oxm.jibx.JibxMarshaller
Sets the public Id for the DTD declaration written when marshalling.
setDocTypeRootElementName(String) - Method in class org.springframework.oxm.jibx.JibxMarshaller
Sets the root element name for the DTD declaration written when marshalling.
setDocTypeSystemId(String) - Method in class org.springframework.oxm.jibx.JibxMarshaller
Sets the system Id for the DTD declaration written when marshalling.
setDocumentLoader(DocumentLoader) - Method in class org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Specify the DocumentLoader to use.
setDocumentReaderClass(Class) - Method in class org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Specify the BeanDefinitionDocumentReader implementation to use, responsible for the actual reading of the XML bean definition document.
setDriver(Driver) - Method in class org.springframework.jdbc.datasource.SimpleDriverDataSource
Specify the JDBC Driver instance to use.
setDriverClass(Class<? extends Driver>) - Method in interface org.springframework.jdbc.datasource.embedded.ConnectionProperties
Set the JDBC driver to use to connect to the database.
setDriverClass(Class<? extends Driver>) - Method in class org.springframework.jdbc.datasource.SimpleDriverDataSource
Specify the JDBC Driver implementation class to use.
setDriverClassName(String) - Method in class org.springframework.jdbc.datasource.DriverManagerDataSource
Set the JDBC driver class name.
setDummyName(String) - Method in class org.springframework.jdbc.support.incrementer.DerbyMaxValueIncrementer
Set the name of the dummy column.
setDuplicateKeyCodes(String[]) - Method in class org.springframework.jdbc.support.SQLErrorCodes

setDurableSubscriptionName(String) - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Set the name of a durable subscription to create.
setDurableSubscriptionName(String) - Method in class org.springframework.jms.listener.endpoint.JmsActivationSpecConfig

setDynamic() - Method in class org.springframework.beans.factory.config.TypedStringValue
Mark this value as dynamic, i.e.
setDynamicAttribute(String, String, Object) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
setDynamicDestinationResolver(DestinationResolver) - Method in class org.springframework.jms.support.destination.JndiDestinationResolver
Set the DestinationResolver to use when falling back to dynamic destinations.
setEarlyFlushBeforeCommit(boolean) - Method in class org.springframework.orm.hibernate3.HibernateTransactionManager
Set whether to perform an early flush before proceeding with a commit.
setElement(String) - Method in class org.springframework.web.servlet.tags.form.AbstractMultiCheckedElementTag
Set the HTML element used to enclose the 'input type="checkbox/radio"' tag.
setElement(String) - Method in class org.springframework.web.servlet.tags.form.ErrorsTag
Set the HTML element must be used to render the error messages.
setElementTypeName(String) - Method in class org.springframework.beans.factory.support.ManagedList
Set the default element type name (class name) to be used for this list.
setElementTypeName(String) - Method in class org.springframework.beans.factory.support.ManagedSet
Set the default element type name (class name) to be used for this set.
setEnabled(boolean) - Method in class org.springframework.jdbc.datasource.init.DataSourceInitializer
Flag to explicitly enable or disable the database populator.
setEncoding(String) - Method in class org.springframework.oxm.castor.CastorMarshaller
Set the encoding to be used for stream access.
setEncoding(String) - Method in class org.springframework.oxm.jibx.JibxMarshaller
Set the document encoding using for marshalling.
setEncoding(String) - Method in class org.springframework.oxm.xstream.XStreamMarshaller
Set the encoding to be used for stream access.
setEncoding(String) - Method in class org.springframework.scripting.support.ResourceScriptSource
Sets the encoding used for reading the script resource.
setEncoding(String) - Method in class org.springframework.web.filter.CharacterEncodingFilter
Set the encoding to use for requests.
setEncoding(String) - Method in class org.springframework.web.servlet.view.freemarker.FreeMarkerView
Set the encoding of the FreeMarker template file.
setEncoding(JsonEncoding) - Method in class org.springframework.web.servlet.view.json.MappingJacksonJsonView
Sets the JsonEncoding for this converter.
setEncoding(String) - Method in class org.springframework.web.servlet.view.velocity.VelocityView
Set the encoding of the Velocity template file.
setEncodingScheme(String) - Method in class org.springframework.web.servlet.view.RedirectView
Set the encoding scheme for this view.
setEnctype(String) - Method in class org.springframework.web.servlet.tags.form.FormTag
Set the value of the 'enctype' attribute.
setEndpointAddress(String) - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Set the endpoint address to specify on the stub or call.
setEndpointAddress(String) - Method in class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
Set the endpoint address to specify on the stub.
setEndpointProperties(Map<String, Object>) - Method in class org.springframework.remoting.jaxws.AbstractJaxWsServiceExporter
Set the property bag for the endpoint, including properties such as "javax.xml.ws.wsdl.service" or "javax.xml.ws.wsdl.port".
setEnforceDestroyMethod(boolean) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Specify whether or not the configured destroy method is the default.
setEnforceInitMethod(boolean) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Specify whether or not the configured init method is the default.
setEnsureUniqueRuntimeObjectNames(boolean) - Method in class org.springframework.jmx.export.MBeanExporter
Indicates whether Spring should ensure that ObjectNames generated by the configured ObjectNamingStrategy for runtime-registered MBeans (MBeanExporter.registerManagedResource(java.lang.Object)) should get modified: to ensure uniqueness for every instance of a managed Class.
setEnterMessage(String) - Method in class org.springframework.aop.interceptor.CustomizableTraceInterceptor
Set the template used for method entry log messages.
setEntityCacheStrategies(Properties) - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Specify the cache strategies for entities (persistent classes or named entities).
setEntityInterceptor(Interceptor) - Method in class org.springframework.orm.hibernate3.HibernateAccessor
Set a Hibernate entity interceptor that allows to inspect and change property values before writing to and reading from the database.
setEntityInterceptor(Interceptor) - Method in class org.springframework.orm.hibernate3.HibernateTransactionManager
Set a Hibernate entity interceptor that allows to inspect and change property values before writing to and reading from the database.
setEntityInterceptor(Interceptor) - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Set a Hibernate entity interceptor that allows to inspect and change property values before writing to and reading from the database.
setEntityInterceptorBeanName(String) - Method in class org.springframework.orm.hibernate3.HibernateAccessor
Set the bean name of a Hibernate entity interceptor that allows to inspect and change property values before writing to and reading from the database.
setEntityInterceptorBeanName(String) - Method in class org.springframework.orm.hibernate3.HibernateTransactionManager
Set the bean name of a Hibernate entity interceptor that allows to inspect and change property values before writing to and reading from the database.
setEntityManager(EntityManager) - Method in class org.springframework.orm.jpa.JpaAccessor
Set the JPA EntityManager to use.
setEntityManager(EntityManager) - Method in class org.springframework.orm.jpa.support.JpaDaoSupport
Set the JPA EntityManager to be used by this DAO.
setEntityManagerFactory(EntityManagerFactory) - Method in class org.springframework.orm.jpa.EntityManagerFactoryAccessor
Set the JPA EntityManagerFactory that should be used to create EntityManagers.
setEntityManagerFactory(EntityManagerFactory) - Method in class org.springframework.orm.jpa.JpaTransactionManager
Set the EntityManagerFactory that this instance should manage transactions for.
setEntityManagerFactory(EntityManagerFactory) - Method in class org.springframework.orm.jpa.support.JpaDaoSupport
Set the JPA EntityManagerFactory to be used by this DAO.
setEntityManagerFactory(EntityManagerFactory) - Method in class org.springframework.test.jpa.AbstractJpaTests
Deprecated.
setEntityManagerFactoryBeanName(String) - Method in class org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter
Set the bean name of the EntityManagerFactory to fetch from Spring's root application context.
setEntityManagerFactoryInterface(Class<? extends EntityManagerFactory>) - Method in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
Specify the (potentially vendor-specific) EntityManagerFactory interface that this EntityManagerFactory proxy is supposed to implement.
setEntityManagerInterface(Class<? extends EntityManager>) - Method in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
Specify the (potentially vendor-specific) EntityManager interface that this factory's EntityManagers are supposed to implement.
setEntityManagerInterface(Class<? extends EntityManager>) - Method in class org.springframework.orm.jpa.support.SharedEntityManagerBean
Specify the EntityManager interface to expose.
setEntityResolver(EntityResolver) - Method in class org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Set a SAX entity resolver to be used for parsing.
setEntityTypeFilters(TypeFilter[]) - Method in class org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean
Specify custom type filters for Spring-based scanning for entity classes.
setEnvironment(Map<String, ?>) - Method in class org.springframework.jmx.access.MBeanClientInterceptor
Specify the environment for the JMX connector.
setEnvironment(Map<String, ?>) - Method in class org.springframework.jmx.access.NotificationListenerRegistrar
Specify the environment for the JMX connector.
setEnvironment(Properties) - Method in class org.springframework.jmx.support.ConnectorServerFactoryBean
Set the environment properties used to construct the JMXConnectorServer as java.util.Properties (String key/value pairs).
setEnvironment(Properties) - Method in class org.springframework.jmx.support.MBeanServerConnectionFactoryBean
Set the environment properties used to construct the JMXConnector as java.util.Properties (String key/value pairs).
setEnvironment(Properties) - Method in class org.springframework.jndi.JndiTemplate
Set the environment for the JNDI InitialContext.
setEnvironmentMap(Map<String, ?>) - Method in class org.springframework.jmx.support.ConnectorServerFactoryBean
Set the environment properties used to construct the JMXConnector as a Map of String keys and arbitrary Object values.
setEnvironmentMap(Map<String, ?>) - Method in class org.springframework.jmx.support.MBeanServerConnectionFactoryBean
Set the environment properties used to construct the JMXConnector as a Map of String keys and arbitrary Object values.
setErrorCodes(String[]) - Method in class org.springframework.jdbc.support.CustomSQLErrorCodesTranslation
Set the SQL error codes to match.
setErrorHandler(ErrorHandler) - Method in class org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Set an implementation of the org.xml.sax.ErrorHandler interface for custom handling of XML parsing errors and warnings.
setErrorHandler(ErrorHandler) - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Set an ErrorHandler to be invoked in case of any uncaught exceptions thrown while processing a Message.
setErrorHandler(ErrorHandler) - Method in class org.springframework.scheduling.commonj.TimerManagerTaskScheduler

setErrorHandler(ErrorHandler) - Method in class org.springframework.scheduling.concurrent.ConcurrentTaskScheduler
Provide an ErrorHandler strategy.
setErrorHandler(ErrorHandler) - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
Provide an ErrorHandler strategy.
setErrorHandler(ResponseErrorHandler) - Method in class org.springframework.web.client.RestTemplate
Set the error handler.
setErrorListener(ErrorListener) - Method in class org.springframework.web.servlet.view.xslt.AbstractXsltView
Deprecated. Set an implementation of the ErrorListener interface for custom handling of transformation errors and warnings.
setErrorListener(ErrorListener) - Method in class org.springframework.web.servlet.view.xslt.XsltView
Set an implementation of the ErrorListener interface for custom handling of transformation errors and warnings.
setErrorListener(ErrorListener) - Method in class org.springframework.web.servlet.view.xslt.XsltViewResolver
Set an implementation of the ErrorListener interface for custom handling of transformation errors and warnings.
setETag(String) - Method in class org.springframework.http.HttpHeaders
Sets the (new) entity tag of the body, as specified by the ETag header.
setETag(String) - Method in class org.springframework.mock.web.portlet.MockCacheControl

setEternal(boolean) - Method in class org.springframework.cache.ehcache.EhCacheFactoryBean
Set whether elements are considered as eternal.
setEvaluationContext(EvaluationContext) - Method in class org.springframework.expression.spel.standard.SpelExpression
Set the evaluation context that will be used if none is specified on an evaluation call.
setEvent(QName, Serializable) - Method in class org.springframework.mock.web.portlet.MockStateAwareResponse

setEvent(String, Serializable) - Method in class org.springframework.mock.web.portlet.MockStateAwareResponse

setEventListener(ReaderEventListener) - Method in class org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Specify which ReaderEventListener to use.
setEventListeners(Map<String, Object>) - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Specify the Hibernate event listeners to register, with listener types as keys and listener objects as values.
setExceptionAttribute(String) - Method in class org.springframework.web.portlet.handler.SimpleMappingExceptionResolver
Set the name of the model attribute as which the exception should be exposed.
setExceptionAttribute(String) - Method in class org.springframework.web.servlet.handler.SimpleMappingExceptionResolver
Set the name of the model attribute as which the exception should be exposed.
setExceptionClass(Class) - Method in class org.springframework.jdbc.support.CustomSQLErrorCodesTranslation
Set the exception class for the specified error codes.
setExceptionConversionEnabled(boolean) - Method in class org.springframework.orm.hibernate3.HibernateInterceptor
Set whether to convert any HibernateException raised to a Spring DataAccessException, compatible with the org.springframework.dao exception hierarchy.
setExceptionConversionEnabled(boolean) - Method in class org.springframework.orm.jdo.JdoInterceptor
Set whether to convert any JDOException raised to a Spring DataAccessException, compatible with the org.springframework.dao exception hierarchy.
setExceptionConversionEnabled(boolean) - Method in class org.springframework.orm.jpa.JpaInterceptor
Set whether to convert any PersistenceException raised to a Spring DataAccessException, compatible with the org.springframework.dao exception hierarchy.
setExceptionListener(ExceptionListener) - Method in class org.springframework.jms.connection.SingleConnectionFactory
Specify an JMS ExceptionListener implementation that should be registered with with the single Connection created by this factory.
setExceptionListener(ExceptionListener) - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Set the JMS ExceptionListener to notify in case of a JMSException thrown by the registered message listener or the invocation infrastructure.
setExceptionMappings(Properties) - Method in class org.springframework.web.portlet.handler.SimpleMappingExceptionResolver
Set the mappings between exception class names and error view names.
setExceptionMappings(Properties) - Method in class org.springframework.web.servlet.handler.SimpleMappingExceptionResolver
Set the mappings between exception class names and error view names.
setExceptionMessage(String) - Method in class org.springframework.aop.interceptor.CustomizableTraceInterceptor
Set the template used for method exception log messages.
setExceptionTranslator(SQLExceptionTranslator) - Method in class org.springframework.jdbc.support.JdbcAccessor
Set the exception translator for this instance.
setExcludedBeans(String[]) - Method in class org.springframework.jmx.export.MBeanExporter
Set the list of names for beans that should be excluded from autodetection.
setExcludedClasses(Class[]) - Method in class org.springframework.web.servlet.mvc.support.AbstractControllerUrlHandlerMapping
Specify controller classes that should be excluded from this mapping.
setExcludedPackages(String[]) - Method in class org.springframework.web.servlet.mvc.support.AbstractControllerUrlHandlerMapping
Specify Java packages that should be excluded from this mapping.
setExcludedPattern(String) - Method in class org.springframework.aop.support.AbstractRegexpMethodPointcut
Convenience method when we have only a single exclusion pattern.
setExcludedPatterns(String[]) - Method in class org.springframework.aop.support.AbstractRegexpMethodPointcut
Set the regular expressions defining methods to match for exclusion.
setExcludeUnlistedClasses(boolean) - Method in class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo

setExecutor(Executor) - Method in class org.springframework.remoting.jaxws.AbstractJaxWsServiceExporter
Set the JDK concurrent executor to use for dispatching incoming requests to exported service instances.
setExecutor(Executor) - Method in class org.springframework.remoting.jaxws.LocalJaxWsServiceFactory
Set the JDK concurrent executor to use for asynchronous executions that require callbacks.
setExecutor(Executor) - Method in class org.springframework.remoting.support.SimpleHttpServerFactoryBean
Set the JDK concurrent executor to use for dispatching incoming requests.
setExecutor(Executor) - Method in class org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcessor
Set the Executor to use when invoking methods asynchronously.
setExitMessage(String) - Method in class org.springframework.aop.interceptor.CustomizableTraceInterceptor
Set the template used for method exit log messages.
setExpectedType(Class) - Method in class org.springframework.jndi.JndiObjectLocator
Specify the type that the located JNDI object is supposed to be assignable to, if any.
setExpirationTime(int) - Method in class org.springframework.mock.web.portlet.MockCacheControl

setExpires(long) - Method in class org.springframework.http.HttpHeaders
Sets the date and time at which the message is no longer valid, as specified by the Expires header.
setExplicitQosEnabled(boolean) - Method in class org.springframework.jms.core.JmsTemplate
Set if the QOS values (deliveryMode, priority, timeToLive) should be used for sending a message.
setExporterClass(Class<? extends JRExporter>) - Method in class org.springframework.web.servlet.view.jasperreports.ConfigurableJasperReportsView
Set the JRExporter implementation Class to use.
setExporterParameters(Map<?, ?>) - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
Set the exporter parameters that should be used when rendering a view.
setExporterParameters(Map<String, Object>) - Method in class org.springframework.web.servlet.view.jasperreports.JasperReportsViewResolver
Set the exporterParameters the view class should use.
setExposeAccessContext(boolean) - Method in class org.springframework.ejb.access.AbstractSlsbInvokerInterceptor
Set whether to expose the JNDI environment context for all access to the target EJB, i.e.
setExposeAccessContext(boolean) - Method in class org.springframework.jndi.JndiObjectFactoryBean
Set whether to expose the JNDI environment context for all access to the target object, i.e.
setExposeClassDescriptor(boolean) - Method in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Set whether to expose the JMX descriptor field "class" for managed operations.
setExposeContextBeansAsAttributes(boolean) - Method in class org.springframework.web.servlet.view.InternalResourceView
Set whether to make all Spring beans in the application context accessible as request attributes, through lazy checking once an attribute gets accessed.
setExposeContextBeansAsAttributes(boolean) - Method in class org.springframework.web.servlet.view.InternalResourceViewResolver
Set whether to make all Spring beans in the application context accessible as request attributes, through lazy checking once an attribute gets accessed.
setExposedContextBeanNames(String[]) - Method in class org.springframework.web.servlet.view.InternalResourceView
Specify the names of beans in the context which are supposed to be exposed.
setExposedContextBeanNames(String[]) - Method in class org.springframework.web.servlet.view.InternalResourceViewResolver
Specify the names of beans in the context which are supposed to be exposed.
setExposeForwardAttributes(boolean) - Method in class org.springframework.web.servlet.view.InternalResourceView
Set whether to explictly expose the Servlet 2.4 forward request attributes when forwarding to the underlying view resource.
setExposeListenerSession(boolean) - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Set whether to expose the listener JMS Session to a registered SessionAwareMessageListener as well as to JmsTemplate calls.
setExposeManagedResourceClassLoader(boolean) - Method in class org.springframework.jmx.export.MBeanExporter
Indicates whether or not the managed resource should be exposed on the thread context ClassLoader before allowing any invocations on the MBean to occur.
setExposeModelAttributes(boolean) - Method in class org.springframework.web.servlet.view.RedirectView
Set the exposeModelAttributes flag which denotes whether or not model attributes should be exposed as HTTP query parameters.
setExposeNativeEntityManager(boolean) - Method in class org.springframework.orm.jpa.JpaTemplate
Set whether to expose the native JPA EntityManager to JpaCallback code.
setExposeNativePersistenceManager(boolean) - Method in class org.springframework.orm.jdo.JdoTemplate
Set whether to expose the native JDO PersistenceManager to JdoCallback code.
setExposeNativeSession(boolean) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
Set whether to expose the native Hibernate Session to HibernateCallback code.
setExposeProxy(boolean) - Method in interface org.springframework.aop.framework.Advised
Set whether the proxy should be exposed by the AOP framework as a ThreadLocal for retrieval via the AopContext class.
setExposeProxy(boolean) - Method in class org.springframework.aop.framework.ProxyConfig
Set whether the proxy should be exposed by the AOP framework as a ThreadLocal for retrieval via the AopContext class.
setExposeRequestAttributes(boolean) - Method in class org.springframework.web.servlet.view.AbstractTemplateView
Set whether all request attributes should be added to the model prior to merging with the template.
setExposeRequestAttributes(boolean) - Method in class org.springframework.web.servlet.view.AbstractTemplateViewResolver
Set whether all request attributes should be added to the model prior to merging with the template.
setExposeSchedulerInRepository(boolean) - Method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
Set whether to expose the Spring-managed Scheduler instance in the Quartz SchedulerRepository.
setExposeSessionAttributes(boolean) - Method in class org.springframework.web.servlet.view.AbstractTemplateView
Set whether all HttpSession attributes should be added to the model prior to merging with the template.
setExposeSessionAttributes(boolean) - Method in class org.springframework.web.servlet.view.AbstractTemplateViewResolver
Set whether all HttpSession attributes should be added to the model prior to merging with the template.
setExposeSpringMacroHelpers(boolean) - Method in class org.springframework.web.servlet.view.AbstractTemplateView
Set whether to expose a RequestContext for use by Spring's macro library, under the name "springMacroRequestContext".
setExposeSpringMacroHelpers(boolean) - Method in class org.springframework.web.servlet.view.AbstractTemplateViewResolver
Set whether to expose a RequestContext for use by Spring's macro library, under the name "springMacroRequestContext".
setExposeTransactionAwareSessionFactory(boolean) - Method in class org.springframework.orm.hibernate3.AbstractSessionFactoryBean
Set whether to expose a transaction-aware current Session from the SessionFactory's getCurrentSession() method, returning the Session that's associated with the current Spring-managed transaction, if any.
setExposeUnconfigurableExecutor(boolean) - Method in class org.springframework.scheduling.concurrent.ScheduledExecutorFactoryBean
Specify whether this FactoryBean should expose an unconfigurable decorator for the created executor.
setExposeUnconfigurableExecutor(boolean) - Method in class org.springframework.scheduling.concurrent.ThreadPoolExecutorFactoryBean
Specify whether this FactoryBean should expose an unconfigurable decorator for the created executor.
setExpression(String) - Method in class org.springframework.aop.aspectj.AspectJExpressionPointcutAdvisor

setExpression(String) - Method in class org.springframework.aop.support.AbstractExpressionPointcut

setExpression(String) - Method in class org.springframework.web.servlet.tags.EvalTag
Set the expression to evaluate.
setExpressionParser(ExpressionParser) - Method in class org.springframework.context.expression.StandardBeanExpressionResolver
Specify the EL parser to use for expression parsing.
setExpressionPrefix(String) - Method in class org.springframework.context.expression.StandardBeanExpressionResolver
Set the prefix that an expression string starts with.
setExpressionSuffix(String) - Method in class org.springframework.context.expression.StandardBeanExpressionResolver
Set the suffix that an expression string ends with.
setExtendedPersistenceContexts(Map<String, String>) - Method in class org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
Specify the extended persistence contexts for EntityManager lookups, as a Map from persistence unit name to persistence context JNDI name (which needs to resolve to an EntityManager instance).
setExtractOldValueForEditor(boolean) - Method in class org.springframework.beans.AbstractPropertyAccessor

setExtractOldValueForEditor(boolean) - Method in interface org.springframework.beans.ConfigurablePropertyAccessor
Set whether to extract the old property value when applying a property editor to a new value for a property.
setExtractOldValueForEditor(boolean) - Method in class org.springframework.validation.DataBinder
Set whether to extract the old field value when applying a property editor to a new value for a field.
SetFactoryBean - Class in org.springframework.beans.factory.config
Simple factory for shared Set instances.
SetFactoryBean() - Constructor for class org.springframework.beans.factory.config.SetFactoryBean

setFactoryBean(String, String) - Method in class org.springframework.beans.factory.support.BeanDefinitionBuilder
Deprecated. since Spring 2.5, in favor of preparing this on the raw BeanDefinition object
setFactoryBeanName(String) - Method in interface org.springframework.beans.factory.config.BeanDefinition
Specify the factory bean to use, if any.
setFactoryBeanName(String) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition

setFactoryClass(Class) - Method in class org.springframework.web.servlet.view.tiles.TilesConfigurer
Deprecated. Set the factory class for Tiles.
setFactoryMethod(String) - Method in class org.springframework.beans.factory.support.BeanDefinitionBuilder
Set the name of the factory method to use for this definition.
setFactoryMethodName(String) - Method in interface org.springframework.beans.factory.config.BeanDefinition
Specify a factory method, if any.
setFactoryMethodName(String) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition

setFailEarlyOnGlobalRollbackOnly(boolean) - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Set whether to fail early in case of the transaction being globally marked as rollback-only.
setFailureMessage(String) - Method in class org.springframework.test.AssertThrows
Deprecated. Set the extra, contextual failure message that will be included in the failure text if the text fails.
setFallbackToDefaultTypeMatch(boolean) - Method in class org.springframework.context.annotation.CommonAnnotationBeanPostProcessor
Set whether to allow a fallback to a type match if no explicit name has been specified.
setFallbackToDynamicDestination(boolean) - Method in class org.springframework.jms.support.destination.JndiDestinationResolver
Set whether this resolver is supposed to create dynamic destinations if the destination name is not found in JNDI.
setFallbackToSystemLocale(boolean) - Method in class org.springframework.context.support.ReloadableResourceBundleMessageSource
Set whether to fall back to the system Locale if no files for a specific Locale have been found.
setFallbackTranslator(SQLExceptionTranslator) - Method in class org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator
Override the default SQL state fallback translator (typically a SQLStateSQLExceptionTranslator).
setFavorParameter(boolean) - Method in class org.springframework.web.servlet.view.ContentNegotiatingViewResolver
Indicates whether a request parameter should be used to determine the requested media type, in favor of looking at the Accept header.
setFavorPathExtension(boolean) - Method in class org.springframework.web.servlet.view.ContentNegotiatingViewResolver
Indicates whether the extension of the request path should be used to determine the requested media type, in favor of looking at the Accept header.
setFeedType(String) - Method in class org.springframework.web.servlet.view.feed.AbstractAtomFeedView
Sets the Rome feed type to use.
setFetchSize(int) - Method in class org.springframework.jdbc.core.JdbcTemplate
Set the fetch size for this JdbcTemplate.
setFetchSize(int) - Method in class org.springframework.jdbc.object.RdbmsOperation
Set the fetch size for this RDBMS operation.
setFetchSize(int) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
Set the fetch size for this HibernateTemplate.
setField(Object, String, Object) - Static method in class org.springframework.test.util.ReflectionTestUtils
Set the field with the given name on the provided target object to the supplied value.
setField(Object, String, Object, Class<?>) - Static method in class org.springframework.test.util.ReflectionTestUtils
Set the field with the given name on the provided target object to the supplied value.
setField(Field, Object, Object) - Static method in class org.springframework.util.ReflectionUtils
Set the field represented by the supplied field object on the specified target object to the specified value.
setFieldAliases(Map<String, String>) - Method in class org.springframework.oxm.xstream.XStreamMarshaller
Sets a field alias/type map, consiting of field names
setFieldDefaultPrefix(String) - Method in class org.springframework.web.bind.WebDataBinder
Specify a prefix that can be used for parameters that indicate default value fields, having "prefix + field" as name.
setFieldMarkerPrefix(String) - Method in class org.springframework.web.bind.WebDataBinder
Specify a prefix that can be used for parameters that mark potentially empty fields, having "prefix + field" as name.
setFileEncoding(String) - Method in class org.springframework.core.io.support.PropertiesLoaderSupport
Set the encoding to use for parsing properties files.
setFileEncodings(Properties) - Method in class org.springframework.context.support.ReloadableResourceBundleMessageSource
Set per-file charsets to use for parsing properties files.
setFileTypeMap(FileTypeMap) - Method in class org.springframework.mail.javamail.MimeMessageHelper
Set the Java Activation Framework FileTypeMap to use for determining the content type of inline content and attachments that get added to the message.
setFilterDefinitions(FilterDefinition[]) - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Specify the Hibernate FilterDefinitions to register with the SessionFactory.
setFilterName(String) - Method in class org.springframework.orm.hibernate3.FilterDefinitionFactoryBean
Set the name of the filter.
setFilterName(String) - Method in class org.springframework.orm.hibernate3.HibernateAccessor
Set the name of a Hibernate filter to be activated for all Sessions that this accessor works with.
setFilterNames(String[]) - Method in class org.springframework.orm.hibernate3.HibernateAccessor
Set one or more names of Hibernate filters to be activated for all Sessions that this accessor works with.
setFilters(List<Filter>) - Method in class org.springframework.remoting.jaxws.SimpleHttpServerJaxWsServiceExporter
Register common Filters to be applied to all detected WebService annotated beans.
setFilters(List<Filter>) - Method in class org.springframework.remoting.support.SimpleHttpServerFactoryBean
Register common Filters to be applied to all locally registered contexts.
setFinishRenderParameter(ActionRequest, ActionResponse) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Pass the the parameter that indicates a finish request forward to the render phase.
setFixedDelayTasks(Map<Runnable, Long>) - Method in class org.springframework.scheduling.config.ScheduledTaskRegistrar

setFixedRate(boolean) - Method in class org.springframework.scheduling.commonj.ScheduledTimerListener
Set whether to schedule as fixed-rate execution, rather than fixed-delay execution.
setFixedRate(boolean) - Method in class org.springframework.scheduling.concurrent.ScheduledExecutorTask
Set whether to schedule as fixed-rate execution, rather than fixed-delay execution.
setFixedRate(boolean) - Method in class org.springframework.scheduling.support.PeriodicTrigger
Specify whether the periodic interval should be measured between the scheduled start times rather than between actual completion times.
setFixedRate(boolean) - Method in class org.springframework.scheduling.timer.ScheduledTimerTask
Deprecated. Set whether to schedule as fixed-rate execution, rather than fixed-delay execution.
setFixedRateTasks(Map<Runnable, Long>) - Method in class org.springframework.scheduling.config.ScheduledTaskRegistrar

setFlushEager(boolean) - Method in class org.springframework.orm.jdo.JdoAccessor
Set if this accessor should flush changes to the database eagerly.
setFlushEager(boolean) - Method in class org.springframework.orm.jpa.JpaAccessor
Set if this accessor should flush changes to the database eagerly.
setFlushMode(int) - Method in class org.springframework.orm.hibernate3.HibernateAccessor
Set the flush behavior to one of the constants in this class.
setFlushMode(FlushMode) - Method in class org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
Specify the Hibernate FlushMode to apply to this filter's Session.
setFlushModeName(String) - Method in class org.springframework.orm.hibernate3.HibernateAccessor
Set the flush behavior by the name of the respective constant in this class, e.g.
setFor(String) - Method in class org.springframework.web.servlet.tags.form.LabelTag
Set the value of the 'for' attribute.
setForceEncoding(boolean) - Method in class org.springframework.web.filter.CharacterEncodingFilter
Set whether the configured encoding of this filter is supposed to override existing request and response encodings.
setFormatKey(String) - Method in class org.springframework.web.servlet.view.jasperreports.JasperReportsMultiFormatView
Set the key of the model parameter that holds the format discriminator.
setFormatMappings(Map<String, Class<? extends AbstractJasperReportsView>>) - Method in class org.springframework.web.servlet.view.jasperreports.JasperReportsMultiFormatView
Set the mappings of format discriminators to view class names.
setFormSubmit(ActionResponse) - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Set the action response parameter that indicates this in a form submission.
setFormView(String) - Method in class org.springframework.web.portlet.mvc.SimpleFormController
Deprecated. Set the name of the view that should be used for form display.
setFormView(String) - Method in class org.springframework.web.servlet.mvc.SimpleFormController
Deprecated. Set the name of the view that should be used for form display.
setForwardedUrl(String) - Method in class org.springframework.mock.web.MockHttpServletResponse

setForwardedUrl(String) - Method in class org.springframework.mock.web.portlet.MockMimeResponse

setFractionDigits(int) - Method in class org.springframework.format.number.CurrencyFormatter
Specify the desired number of fraction digits.
setFreemarkerSettings(Properties) - Method in class org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
Set properties that contain well-known FreeMarker keys which will be passed to FreeMarker's Configuration.setSettings method.
setFreemarkerVariables(Map<String, Object>) - Method in class org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
Set a Map that contains well-known FreeMarker objects which will be passed to FreeMarker's Configuration.setAllSharedVariables() method.
setFrom(String) - Method in class org.springframework.mail.javamail.MimeMailMessage

setFrom(InternetAddress) - Method in class org.springframework.mail.javamail.MimeMessageHelper

setFrom(String) - Method in class org.springframework.mail.javamail.MimeMessageHelper

setFrom(String, String) - Method in class org.springframework.mail.javamail.MimeMessageHelper

setFrom(String) - Method in interface org.springframework.mail.MailMessage

setFrom(String) - Method in class org.springframework.mail.SimpleMailMessage

setFrozen(boolean) - Method in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
Set whether or not the proxy should be frozen, preventing advice from being added to it once it is created.
setFrozen(boolean) - Method in class org.springframework.aop.framework.ProxyConfig
Set whether this config should be frozen.
setFrozen(boolean) - Method in class org.springframework.aop.framework.ProxyFactoryBean

setFunction(boolean) - Method in class org.springframework.jdbc.core.metadata.CallMetaDataContext
Specify whether this call is a function call.
setFunction(boolean) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Specify whether this call is a function call.
setFunction(boolean) - Method in class org.springframework.jdbc.object.SqlCall
Set whether this call is for a function.
setFunctionReturnName(String) - Method in class org.springframework.jdbc.core.metadata.CallMetaDataContext
Specify the name used for the return value of the function.
setGenerateDdl(boolean) - Method in class org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter
Set whether to generate DDL after the EntityManagerFactory has been initialized, creating/updating all relevant tables.
setGeneratedKeyName(String) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Specify the name of a single generated key column
setGeneratedKeyNames(String[]) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Set the names of any generated keys
setGeneratedKeysColumnNameArraySupported(boolean) - Method in class org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
Specify whether a column name array is supported for generated keys
setGeneratedKeysColumnNames(String[]) - Method in class org.springframework.jdbc.core.PreparedStatementCreatorFactory
Set the column names of the auto-generated keys.
setGeneratedKeysColumnNames(String[]) - Method in class org.springframework.jdbc.object.RdbmsOperation
Set the column names of the auto-generated keys.
setGetGeneratedKeysSupported(boolean) - Method in class org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
Specify whether a column name array is supported for generated keys
setGlobalJobListeners(JobListener[]) - Method in class org.springframework.scheduling.quartz.SchedulerAccessor
Specify global Quartz JobListeners to be registered with the Scheduler.
setGlobalRollbackOnParticipationFailure(boolean) - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Set whether to globally mark an existing transaction as rollback-only after a participating transaction failed.
setGlobalTriggerListeners(TriggerListener[]) - Method in class org.springframework.scheduling.quartz.SchedulerAccessor
Specify global Quartz TriggerListeners to be registered with the Scheduler.
setGroup(String) - Method in class org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean
Set the group of the job.
setHandback(Object) - Method in class org.springframework.jmx.support.NotificationListenerHolder
Set the (arbitrary) object that will be 'handed back' as-is by an NotificationBroadcaster when notifying any NotificationListener.
setHandlerResolver(HandlerResolver) - Method in class org.springframework.remoting.jaxws.LocalJaxWsServiceFactory
Set the JAX-WS HandlerResolver to use for all proxies and dispatchers created through this factory.
setHeader(String, String) - Method in class org.springframework.mock.web.MockHttpServletResponse

setHeaders(Properties) - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
Specify the set of headers that are included in each of response.
setHeaders(Properties) - Method in class org.springframework.web.servlet.view.jasperreports.JasperReportsViewResolver
Set the headers the view class should use.
setHessian2(boolean) - Method in class org.springframework.remoting.caucho.HessianClientInterceptor
Set whether version 2 of the Hessian protocol should be used for parsing requests and replies.
setHessian2Reply(boolean) - Method in class org.springframework.remoting.caucho.HessianClientInterceptor
Set whether version 2 of the Hessian protocol should be used for parsing replies.
setHessian2Request(boolean) - Method in class org.springframework.remoting.caucho.HessianClientInterceptor
Set whether version 2 of the Hessian protocol should be used for parsing requests.
setHibernateManagedSession(boolean) - Method in class org.springframework.orm.hibernate3.HibernateTransactionManager
Set whether to operate on a Hibernate-managed Session instead of a Spring-managed Session, that is, whether to obtain the Session through Hibernate's SessionFactory.getCurrentSession() instead of SessionFactory.openSession() (with a Spring TransactionSynchronizationManager check preceding it).
setHibernateProperties(Properties) - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Set Hibernate properties, such as "hibernate.dialect".
setHibernateTemplate(HibernateTemplate) - Method in class org.springframework.orm.hibernate3.support.HibernateDaoSupport
Set the HibernateTemplate for this DAO explicitly, as an alternative to specifying a SessionFactory.
setHideProxyClassNames(boolean) - Method in class org.springframework.aop.interceptor.AbstractTraceInterceptor
Set to "true" to have dynamic loggers hide proxy class names wherever possible.
setHomeInterface(Class) - Method in class org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor
Set a home interface that this invoker will narrow to before performing the parameterless SLSB create() call that returns the actual SLSB proxy.
setHost(String) - Method in class org.springframework.mail.javamail.JavaMailSenderImpl
Set the mail server host, typically an SMTP host.
setHost(String) - Method in class org.springframework.remoting.rmi.RmiRegistryFactoryBean
Set the host of the registry for the exported RMI service, i.e.
setHostname(String) - Method in class org.springframework.remoting.jaxws.SimpleHttpServerJaxWsServiceExporter
Specify the HTTP server's hostname to bind to.
setHostname(String) - Method in class org.springframework.remoting.support.SimpleHttpServerFactoryBean
Specify the HTTP server's hostname to bind to.
setHtmlEscape(String) - Method in class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
Set HTML escaping for this tag, as boolean value.
setHttp10Compatible(boolean) - Method in class org.springframework.web.servlet.view.RedirectView
Set whether to stay compatible with HTTP 1.0 clients.
setHttpClient(HttpClient) - Method in class org.springframework.http.client.CommonsClientHttpRequestFactory
Set the HttpClient used by this factory.
setHttpClient(HttpClient) - Method in class org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor
Set the HttpClient instance to use for this request executor.
setHttpInvokerRequestExecutor(HttpInvokerRequestExecutor) - Method in class org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor
Set the HttpInvokerRequestExecutor implementation to use for executing remote invocations.
setId(String) - Method in interface org.springframework.context.ConfigurableApplicationContext
Set the unique id of this application context.
setId(String) - Method in class org.springframework.context.support.AbstractApplicationContext
Set the unique id of this application context.
setId(String) - Method in class org.springframework.context.support.AbstractRefreshableConfigApplicationContext

setId(String) - Method in class org.springframework.context.support.GenericApplicationContext

setId(String) - Method in class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
Set the value of the 'id' attribute.
setIdleTaskExecutionLimit(int) - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Specify the limit for idle executions of a receive task, not having received any message within its execution.
setIfModifiedSince(long) - Method in class org.springframework.http.HttpHeaders
Sets the (new) value of the If-Modified-Since header.
setIfNoneMatch(String) - Method in class org.springframework.http.HttpHeaders
Sets the (new) value of the If-None-Match header.
setIfNoneMatch(List<String>) - Method in class org.springframework.http.HttpHeaders
Sets the (new) values of the If-None-Match header.
setIgnoreAcceptHeader(boolean) - Method in class org.springframework.web.servlet.view.ContentNegotiatingViewResolver
Indicates whether the HTTP Accept header should be ignored.
setIgnoreCase(boolean) - Method in class org.springframework.beans.support.MutableSortDefinition
Set whether upper and lower case in String values should be ignored.
setIgnoredMethodMappings(Properties) - Method in class org.springframework.jmx.export.assembler.MethodExclusionMBeanInfoAssembler
Set the mappings of bean keys to a comma-separated list of method names.
setIgnoredMethods(String[]) - Method in class org.springframework.jmx.export.assembler.MethodExclusionMBeanInfoAssembler
Set the array of method names to be ignored when creating the management info.
setIgnoredUnknownProperties(String[]) - Method in class org.springframework.scheduling.quartz.SpringBeanJobFactory
Specify the unknown properties (not found in the bean) that should be ignored.
setIgnoreExtraAttributes(boolean) - Method in class org.springframework.oxm.castor.CastorMarshaller
Set whether the Castor Unmarshaller should ignore attributes that do not match a specific field.
setIgnoreExtraElements(boolean) - Method in class org.springframework.oxm.castor.CastorMarshaller
Set whether the Castor Unmarshaller should ignore elements that do not match a specific field.
setIgnoreFailedDrops(boolean) - Method in class org.springframework.jdbc.datasource.init.ResourceDatabasePopulator
Flag to indicate that a failed SQL DROP statement can be ignored.
setIgnoreInvalidFields(boolean) - Method in class org.springframework.validation.DataBinder
Set whether to ignore invalid fields, that is, whether to ignore bind parameters that have corresponding fields in the target object which are not accessible (for example because of null values in the nested path).
setIgnoreInvalidKeys(boolean) - Method in class org.springframework.beans.factory.config.PropertyOverrideConfigurer
Set whether to ignore invalid keys.
setIgnoreInvalidRequests(boolean) - Method in class org.springframework.jms.remoting.JmsInvokerServiceExporter
Set whether invalidly formatted messages should be discarded.
setIgnoreNestedPath(boolean) - Method in class org.springframework.web.servlet.tags.BindTag
Set whether to ignore a nested path, if any.
setIgnoreResourceNotFound(boolean) - Method in class org.springframework.core.io.support.PropertiesLoaderSupport
Set if failure to find the property resource should be ignored.
setIgnoreUnknownFields(boolean) - Method in class org.springframework.validation.DataBinder
Set whether to ignore unknown fields, that is, whether to ignore bind parameters that do not have corresponding fields in the target object.
setIgnoreUnresolvableEditors(boolean) - Method in class org.springframework.beans.factory.config.CustomEditorConfigurer
Set whether unresolvable editors should simply be skipped.
setIgnoreUnresolvablePlaceholders(boolean) - Method in class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
Set whether to ignore unresolvable placeholders.
setIgnoreWarnings(boolean) - Method in class org.springframework.jdbc.core.JdbcTemplate
Set whether or not we want to ignore SQLWarnings.
setImplicitCollections(Map<Class<?>, String>) - Method in class org.springframework.oxm.xstream.XStreamMarshaller
Specify implicit collection fields, as a Map consisting of Class instances mapped to comma separated collection field names.
setIncludeAnnotatedControllers(boolean) - Method in class org.springframework.web.servlet.mvc.support.AbstractControllerUrlHandlerMapping
Set whether to activate or deactivate detection of annotated controllers.
setIncludeAnnotationConfig(boolean) - Method in class org.springframework.context.annotation.ClassPathBeanDefinitionScanner
Specify whether to register annotation config post-processors.
setIncludeClientInfo(boolean) - Method in class org.springframework.web.context.request.Log4jNestedDiagnosticContextInterceptor
Set whether or not the session id and user name should be included in the log message.
setIncludeClientInfo(boolean) - Method in class org.springframework.web.filter.AbstractRequestLoggingFilter
Set whether or not the client address and session id should be included in the log message.
setIncludedUrl(String) - Method in class org.springframework.mock.web.MockHttpServletResponse

setIncludedUrl(String) - Method in class org.springframework.mock.web.portlet.MockMimeResponse

setIncludePatterns(List<String>) - Method in class org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator
Set a list of regex patterns, matching eligible @AspectJ bean names.
setIncludePayload(boolean) - Method in class org.springframework.web.filter.AbstractRequestLoggingFilter
Set whether or not the request payload (body) should be included in the log message.
setIncludeQueryString(boolean) - Method in class org.springframework.web.filter.AbstractRequestLoggingFilter
Set whether or not the query string should be included in the log message.
setIncrementerName(String) - Method in class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
Set the name of the sequence/table.
setIndent(int) - Method in class org.springframework.oxm.jibx.JibxMarshaller
Set the number of nesting indent spaces.
setIndent(boolean) - Method in class org.springframework.web.servlet.view.xslt.AbstractXsltView
Deprecated. Set whether the XSLT transformer may add additional whitespace when outputting the result tree.
setIndent(boolean) - Method in class org.springframework.web.servlet.view.xslt.XsltView
Set whether the XSLT transformer may add additional whitespace when outputting the result tree.
setIndent(boolean) - Method in class org.springframework.web.servlet.view.xslt.XsltViewResolver
Set whether the XSLT transformer may add additional whitespace when outputting the result tree.
setIndex(int) - Method in class org.springframework.jmx.export.metadata.ManagedOperationParameter
Set the index of this parameter in the operation signature.
setInitAnnotationType(Class<? extends Annotation>) - Method in class org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor
Specify the init annotation to check for, indicating initialization methods to call after configuration of a bean.
setInitialDelay(long) - Method in class org.springframework.scheduling.support.PeriodicTrigger
Specify the delay for the initial execution.
setInitMethod(String) - Method in class org.springframework.beans.factory.xml.DocumentDefaultsDefinition
Set the default init-method setting for the document that's currently parsed.
setInitMethodName(String) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Set the name of the initializer method.
setInitMethodName(String) - Method in class org.springframework.beans.factory.support.BeanDefinitionBuilder
Set the init method for this definition.
setInitMethodName(String) - Method in class org.springframework.beans.factory.support.BeanDefinitionDefaults

setInitParameters(Map<String, String>) - Method in class org.springframework.web.portlet.mvc.PortletWrappingController
Specify init parameters for the portlet to wrap, as name-value pairs.
setInitParameters(Properties) - Method in class org.springframework.web.servlet.mvc.ServletWrappingController
Specify init parameters for the servlet to wrap, as name-value pairs.
setInitParamName(String) - Method in class org.springframework.web.context.support.ServletContextParameterFactoryBean
Set the name of the ServletContext init parameter to expose.
setInParameterNames(Set<String>) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Set the names of in parameters to be used.
setInputSource(InputSource) - Method in class org.springframework.oxm.support.MarshallingSource
Throws a UnsupportedOperationException.
setInstantiationStrategy(InstantiationStrategy) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Set the instantiation strategy to use for creating bean instances.
setInteractionSpec(InteractionSpec) - Method in class org.springframework.jca.cci.object.EisOperation
Set the CCI InteractionSpec for this operation.
setInterceptorNames(String[]) - Method in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
Set the common interceptors.
setInterceptorNames(String[]) - Method in class org.springframework.aop.framework.ProxyFactoryBean
Set the list of Advice/Advisor bean names.
setInterceptors(Object[]) - Method in class org.springframework.remoting.support.RemoteExporter
Set additional interceptors (or advisors) to be applied before the remote endpoint, e.g.
setInterceptors(Object[]) - Method in class org.springframework.web.portlet.handler.AbstractHandlerMapping
Set the interceptors to apply for all handlers mapped by this handler mapping.
setInterceptors(Object[]) - Method in class org.springframework.web.servlet.handler.AbstractHandlerMapping
Set the interceptors to apply for all handlers mapped by this handler mapping.
setInterfaceMappings(Properties) - Method in class org.springframework.jmx.export.assembler.InterfaceBasedMBeanInfoAssembler
Set the mappings of bean keys to a comma-separated list of interface names.
setInterfaces(Class[]) - Method in class org.springframework.aop.framework.AdvisedSupport
Set the interfaces to be proxied.
setInterval(int) - Method in class org.springframework.jdbc.support.DatabaseStartupValidator
Set the interval between validation runs (in seconds).
setIntHeader(String, int) - Method in class org.springframework.mock.web.MockHttpServletResponse

setIntrospectionClass(Class) - Method in class org.springframework.beans.BeanWrapperImpl
Set the class to introspect.
setInvalidResultSetAccessCodes(String[]) - Method in class org.springframework.jdbc.support.SQLErrorCodes

setInvalidSubmit(ActionResponse) - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Set the action response parameter that indicates this in an invalid submission.
setIsolationLevel(int) - Method in class org.springframework.jdbc.datasource.IsolationLevelDataSourceAdapter
Specify the default isolation level to use for Connection retrieval, according to the JDBC Connection constants (equivalent to the corresponding Spring TransactionDefinition constants).
setIsolationLevel(int) - Method in class org.springframework.transaction.support.DefaultTransactionDefinition
Set the isolation level.
setIsolationLevelName(String) - Method in class org.springframework.jdbc.datasource.IsolationLevelDataSourceAdapter
Set the default isolation level by the name of the corresponding constant in TransactionDefinition, e.g.
setIsolationLevelName(String) - Method in class org.springframework.transaction.support.DefaultTransactionDefinition
Set the isolation level by the name of the corresponding constant in TransactionDefinition, e.g.
setItemLabel(String) - Method in class org.springframework.web.servlet.tags.form.AbstractMultiCheckedElementTag
Set the value to be displayed as part of the 'input type="checkbox/radio"' tag.
setItemLabel(String) - Method in class org.springframework.web.servlet.tags.form.OptionsTag
Set the name of the property mapped to the label (inner text) of the 'option' tag.
setItemLabel(String) - Method in class org.springframework.web.servlet.tags.form.SelectTag
Set the name of the property mapped to the label (inner text) of the 'option' tag.
setItems(Object) - Method in class org.springframework.web.servlet.tags.form.AbstractMultiCheckedElementTag
Set the Collection, Map or array of objects used to generate the 'input type="checkbox/radio"' tags.
setItems(Object) - Method in class org.springframework.web.servlet.tags.form.OptionsTag
Set the Collection, Map or array of objects used to generate the inner 'option' tags.
setItems(Object) - Method in class org.springframework.web.servlet.tags.form.SelectTag
Set the Collection, Map or array of objects used to generate the inner 'option' tags.
setItemValue(String) - Method in class org.springframework.web.servlet.tags.form.AbstractMultiCheckedElementTag
Set the name of the property mapped to the 'value' attribute of the 'input type="checkbox/radio"' tag.
setItemValue(String) - Method in class org.springframework.web.servlet.tags.form.OptionsTag
Set the name of the property mapped to the 'value' attribute of the 'option' tag.
setItemValue(String) - Method in class org.springframework.web.servlet.tags.form.SelectTag
Set the name of the property mapped to the 'value' attribute of the 'option' tag.
setJavaMailProperties(Properties) - Method in class org.springframework.mail.javamail.JavaMailSenderImpl
Set JavaMail properties for the Session.
setJavaScriptEscape(String) - Method in class org.springframework.web.servlet.tags.EscapeBodyTag
Set JavaScript escaping for this tag, as boolean value.
setJavaScriptEscape(String) - Method in class org.springframework.web.servlet.tags.EvalTag
Set JavaScript escaping for this tag, as boolean value.
setJavaScriptEscape(String) - Method in class org.springframework.web.servlet.tags.MessageTag
Set JavaScript escaping for this tag, as boolean value.
setJavaScriptEscape(String) - Method in class org.springframework.web.servlet.tags.UrlTag
Set JavaScript escaping for this tag, as boolean value.
setJaxbContextProperties(Map<String, ?>) - Method in class org.springframework.oxm.jaxb.Jaxb2Marshaller
Set the JAXBContext properties.
setJaxRpcService(Service) - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Set a reference to an existing JAX-RPC Service instance, for example obtained via JndiObjectFactoryBean.
setJaxRpcServiceInterface(Class) - Method in class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
Deprecated. Set the JAX-RPC service interface to use for looking up the service.
setJaxRpcServiceProperties(Properties) - Method in class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
Deprecated. Set JAX-RPC service properties to be passed to the ServiceFactory, if any.
setJaxWsService(Service) - Method in class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
Set a reference to an existing JAX-WS Service instance, for example obtained via JndiObjectFactoryBean.
setJdbcDataSource(DataSource) - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
Specify the javax.sql.DataSource to use for reports with embedded SQL statements.
setJdbcDataSource(DataSource) - Method in class org.springframework.web.servlet.view.jasperreports.JasperReportsViewResolver
Set the DataSource the view class should use.
setJdbcExceptionTranslator(SQLExceptionTranslator) - Method in class org.springframework.orm.hibernate3.AbstractSessionFactoryBean
Set the JDBC exception translator for the SessionFactory, exposed via the PersistenceExceptionTranslator interface.
setJdbcExceptionTranslator(SQLExceptionTranslator) - Method in class org.springframework.orm.hibernate3.HibernateAccessor
Set the JDBC exception translator for this instance.
setJdbcExceptionTranslator(SQLExceptionTranslator) - Method in class org.springframework.orm.hibernate3.HibernateTransactionManager
Set the JDBC exception translator for this transaction manager.
setJdbcExceptionTranslator(SQLExceptionTranslator) - Method in class org.springframework.orm.jdo.DefaultJdoDialect
Set the JDBC exception translator for this dialect.
setJdbcTemplate(JdbcTemplate) - Method in class org.springframework.jdbc.core.support.JdbcBeanDefinitionReader
Set the JdbcTemplate to be used by this bean factory.
setJdbcTemplate(JdbcTemplate) - Method in class org.springframework.jdbc.core.support.JdbcDaoSupport
Set the JdbcTemplate for this DAO explicitly, as an alternative to specifying a DataSource.
setJdbcTemplate(JdbcTemplate) - Method in class org.springframework.jdbc.object.RdbmsOperation
An alternative to the more commonly used setDataSource() when you want to use the same JdbcTemplate in multiple RdbmsOperations.
setJdoDialect(JdoDialect) - Method in class org.springframework.orm.jdo.JdoAccessor
Set the JDO dialect to use for this accessor.
setJdoDialect(JdoDialect) - Method in class org.springframework.orm.jdo.JdoTransactionManager
Set the JDO dialect to use for this transaction manager.
setJdoDialect(JdoDialect) - Method in class org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean
Set the JDO dialect to use for the PersistenceExceptionTranslator functionality of this factory.
setJdoProperties(Properties) - Method in class org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean
Set JDO properties, such as"javax.jdo.PersistenceManagerFactoryClass".
setJdoPropertyMap(Map<String, Object>) - Method in class org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean
Specify JDO properties as a Map, to be passed into JDOHelper.getPersistenceManagerFactory (if any).
setJdoTemplate(JdoTemplate) - Method in class org.springframework.orm.jdo.support.JdoDaoSupport
Set the JdoTemplate for this DAO explicitly, as an alternative to specifying a PersistenceManagerFactory.
setJmsTemplate(JmsTemplate) - Method in class org.springframework.jms.core.support.JmsGatewaySupport
Set the JmsTemplate for the gateway.
setJndiEnvironment(Properties) - Method in class org.springframework.jndi.JndiAccessor
Set the JNDI environment to use for JNDI lookups.
setJndiEnvironment(Properties) - Method in class org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
Set the JNDI environment to use for JNDI lookups.
setJndiEnvironment(Properties) - Method in class org.springframework.remoting.rmi.JndiRmiServiceExporter
Set the JNDI environment to use for JNDI lookups.
setJndiEnvironment(Properties) - Method in class org.springframework.transaction.jta.JtaTransactionManager
Set the JNDI environment to use for JNDI lookups.
setJndiFactory(BeanFactory) - Method in class org.springframework.context.annotation.CommonAnnotationBeanPostProcessor
Specify the factory for objects to be injected into @Resource / @WebServiceRef / @EJB annotated fields and setter methods, for mappedName attributes that point directly into JNDI.
setJndiName(String) - Method in class org.springframework.jndi.JndiObjectLocator
Specify the JNDI name to look up.
setJndiName(String) - Method in class org.springframework.remoting.rmi.JndiRmiServiceExporter
Set the JNDI name of the exported RMI service.
setJndiTemplate(JndiTemplate) - Method in class org.springframework.jndi.JndiAccessor
Set the JNDI template to use for JNDI lookups.
setJndiTemplate(Object) - Method in class org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
Set the JNDI template to use for JNDI lookups.
setJndiTemplate(JndiTemplate) - Method in class org.springframework.remoting.rmi.JndiRmiServiceExporter
Set the JNDI template to use for JNDI lookups.
setJndiTemplate(JndiTemplate) - Method in class org.springframework.transaction.jta.JtaTransactionManager
Set the JndiTemplate to use for JNDI lookups.
setJobClass(Class) - Method in class org.springframework.scheduling.quartz.JobDetailBean
Overridden to support any job class, to allow a custom JobFactory to adapt the given job class to the Quartz Job interface.
setJobDataAsMap(Map) - Method in class org.springframework.scheduling.quartz.CronTriggerBean
Register objects in the JobDataMap via a given Map.
setJobDataAsMap(Map) - Method in class org.springframework.scheduling.quartz.JobDetailBean
Register objects in the JobDataMap via a given Map.
setJobDataAsMap(Map) - Method in class org.springframework.scheduling.quartz.SimpleTriggerBean
Register objects in the JobDataMap via a given Map.
setJobDetail(JobDetail) - Method in class org.springframework.scheduling.quartz.CronTriggerBean
Set the JobDetail that this trigger should be associated with.
setJobDetail(JobDetail) - Method in class org.springframework.scheduling.quartz.SimpleTriggerBean
Set the JobDetail that this trigger should be associated with.
setJobDetails(JobDetail[]) - Method in class org.springframework.scheduling.quartz.SchedulerAccessor
Register a list of JobDetail objects with the Scheduler that this FactoryBean creates, to be referenced by Triggers.
setJobFactory(JobFactory) - Method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
Set the Quartz JobFactory to use for this Scheduler.
setJobListenerNames(String[]) - Method in class org.springframework.scheduling.quartz.JobDetailBean
Set a list of JobListener names for this job, referring to non-global JobListeners registered with the Scheduler.
setJobListenerNames(String[]) - Method in class org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean
Set a list of JobListener names for this job, referring to non-global JobListeners registered with the Scheduler.
setJobListeners(JobListener[]) - Method in class org.springframework.scheduling.quartz.SchedulerAccessor
Specify named Quartz JobListeners to be registered with the Scheduler.
setJobSchedulingDataLocation(String) - Method in class org.springframework.scheduling.quartz.SchedulerAccessor
Set the location of a Quartz job definition XML file that follows the "job_scheduling_data_1_5" XSD.
setJobSchedulingDataLocations(String[]) - Method in class org.springframework.scheduling.quartz.SchedulerAccessor
Set the locations of Quartz job definition XML files that follow the "job_scheduling_data_1_5" XSD.
setJodaTimeContext(JodaTimeContext) - Static method in class org.springframework.format.datetime.joda.JodaTimeContextHolder
Associate the given JodaTimeContext with the current thread.
setJpaDialect(JpaDialect) - Method in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
Specify the vendor-specific JpaDialect implementation to associate with this EntityManagerFactory.
setJpaDialect(JpaDialect) - Method in class org.springframework.orm.jpa.JpaAccessor
Set the JPA dialect to use for this accessor.
setJpaDialect(JpaDialect) - Method in class org.springframework.orm.jpa.JpaTransactionManager
Set the JPA dialect to use for this transaction manager.
setJpaProperties(Properties) - Method in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
Specify JPA properties, to be passed into Persistence.createEntityManagerFactory (if any).
setJpaProperties(Properties) - Method in class org.springframework.orm.jpa.EntityManagerFactoryAccessor
Specify JPA properties, to be passed into EntityManagerFactory.createEntityManager(Map) (if any).
setJpaProperties(Properties) - Method in class org.springframework.orm.jpa.JpaTransactionManager
Specify JPA properties, to be passed into EntityManagerFactory.createEntityManager(Map) (if any).
setJpaPropertyMap(Map<String, ?>) - Method in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
Specify JPA properties as a Map, to be passed into Persistence.createEntityManagerFactory (if any).
setJpaPropertyMap(Map<String, Object>) - Method in class org.springframework.orm.jpa.EntityManagerFactoryAccessor
Specify JPA properties as a Map, to be passed into EntityManagerFactory.createEntityManager(Map) (if any).
setJpaPropertyMap(Map<String, ?>) - Method in class org.springframework.orm.jpa.JpaTransactionManager
Specify JPA properties as a Map, to be passed into EntityManagerFactory.createEntityManager(Map) (if any).
setJpaTemplate(JpaTemplate) - Method in class org.springframework.orm.jpa.support.JpaDaoSupport
Set the JpaTemplate for this DAO explicitly, as an alternative to specifying a EntityManagerFactory.
setJpaVendorAdapter(JpaVendorAdapter) - Method in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
Specify the JpaVendorAdapter implementation for the desired JPA provider, if any.
setJtaDataSource(DataSource) - Method in class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo

setJtaTransactionManager(TransactionManager) - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Set the JTA TransactionManager to be used for Hibernate's TransactionManagerLookup.
setKeepAliveSeconds(int) - Method in class org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor
Set the ThreadPoolExecutor's keep-alive seconds.
setKeepAliveSeconds(int) - Method in class org.springframework.scheduling.concurrent.ThreadPoolExecutorFactoryBean
Set the ThreadPoolExecutor's keep-alive seconds.
setKeepAliveSeconds(int) - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
Set the ThreadPoolExecutor's keep-alive seconds.
setKeepAliveSeconds(int) - Method in class org.springframework.scheduling.config.TaskExecutorFactoryBean

setKeepTaskList(boolean) - Method in class org.springframework.util.StopWatch
Determine whether the TaskInfo array is built over time.
setKeyTypeName(String) - Method in class org.springframework.beans.factory.support.ManagedMap
Set the default key type name (class name) to be used for this map.
setLabel(Object) - Method in class org.springframework.web.servlet.tags.form.AbstractSingleCheckedElementTag
Set the value of the 'label' attribute.
setLabel(String) - Method in class org.springframework.web.servlet.tags.form.OptionTag
Set the text body of the rendered HTML <option> tag.
setLang(String) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Set the value of the 'lang' attribute.
setLastModified(long) - Method in class org.springframework.http.HttpHeaders
Sets the time the resource was last changed, as specified by the Last-Modified header.
setLayoutKey(String) - Method in class org.springframework.web.servlet.view.velocity.VelocityLayoutView
Set the context key used to specify an alternate layout to be used instead of the default layout.
setLayoutKey(String) - Method in class org.springframework.web.servlet.view.velocity.VelocityLayoutViewResolver
Set the context key used to specify an alternate layout to be used instead of the default layout.
setLayoutUrl(String) - Method in class org.springframework.web.servlet.view.velocity.VelocityLayoutView
Set the layout template to use.
setLayoutUrl(String) - Method in class org.springframework.web.servlet.view.velocity.VelocityLayoutViewResolver
Set the layout template to use.
setLazyDatabaseTransaction(boolean) - Method in class org.springframework.orm.jpa.vendor.EclipseLinkJpaDialect
Set whether to lazily start a database transaction within an EclipseLink transaction.
setLazyDatabaseTransaction(boolean) - Method in class org.springframework.orm.jpa.vendor.TopLinkJpaDialect
Set whether to lazily start a database transaction within a TopLink transaction.
setLazyInit(boolean) - Method in interface org.springframework.beans.factory.config.BeanDefinition
Set whether this bean should be lazily initialized.
setLazyInit(boolean) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Set whether this bean should be lazily initialized.
setLazyInit(boolean) - Method in class org.springframework.beans.factory.support.BeanDefinitionBuilder
Set whether beans for this definition should be lazily initialized or not.
setLazyInit(boolean) - Method in class org.springframework.beans.factory.support.BeanDefinitionDefaults

setLazyInit(String) - Method in class org.springframework.beans.factory.xml.DocumentDefaultsDefinition
Set the default lazy-init flag for the document that's currently parsed.
setLazyInit(boolean) - Method in class org.springframework.jdbc.support.JdbcAccessor
Set whether to lazily initialize the SQLExceptionTranslator for this accessor, on first encounter of a SQLException.
setLazyInit(boolean) - Method in class org.springframework.oxm.jaxb.Jaxb2Marshaller
Set whether to lazily initialize the JAXBContext for this marshaller.
setLazyInitHandlers(boolean) - Method in class org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping
Set whether to lazily initialize handlers.
setLazyInitHandlers(boolean) - Method in class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
Set whether to lazily initialize handlers.
setLenient(boolean) - Method in class org.springframework.format.datetime.DateFormatter
Specify whether or not parsing is to be lenient.
setLenient(boolean) - Method in class org.springframework.format.number.AbstractNumberFormatter
Specify whether or not parsing is to be lenient.
setLenientConstructorResolution(boolean) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Specify whether to resolve constructors in lenient mode (true, which is the default) or to switch to strict resolution (throwing an exception in case of ambigious constructors that all match when converting the arguments, whereas lenient mode would use the one with the 'closest' type matches).
setLenientFallback(boolean) - Method in class org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
Specify whether to apply a lenient fallback to the default DataSource if no specific DataSource could be found for the current lookup key.
setLimitedInParameterNames(Set<String>) - Method in class org.springframework.jdbc.core.metadata.CallMetaDataContext
Specify a limited set of in parameters to be used.
setListeners(MBeanExporterListener[]) - Method in class org.springframework.jmx.export.MBeanExporter
Set the MBeanExporterListeners that should be notified of MBean registration and unregistration events.
setLoadTimeWeaver(LoadTimeWeaver) - Method in class org.springframework.context.weaving.AspectJWeavingEnabler

setLoadTimeWeaver(LoadTimeWeaver) - Method in interface org.springframework.context.weaving.LoadTimeWeaverAware
Set the LoadTimeWeaver of this object's containing ApplicationContext.
setLoadTimeWeaver(LoadTimeWeaver) - Method in class org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean
Specify the Spring LoadTimeWeaver to use for class instrumentation according to the JPA class transformer contract.
setLoadTimeWeaver(LoadTimeWeaver) - Method in class org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager
Specify the Spring LoadTimeWeaver to use for class instrumentation according to the JPA class transformer contract.
setLobHandler(LobHandler) - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Set the LobHandler to be used by the SessionFactory.
setLobHandler(LobHandler) - Method in class org.springframework.orm.ibatis.SqlMapClientFactoryBean
Set the LobHandler to be used by the SqlMapClient.
setLocalAddr(String) - Method in class org.springframework.mock.web.MockHttpServletRequest

setLocale(Locale) - Static method in class org.springframework.context.i18n.LocaleContextHolder
Associate the given Locale with the current thread.
setLocale(Locale, boolean) - Static method in class org.springframework.context.i18n.LocaleContextHolder
Associate the given Locale with the current thread.
setLocale(Locale) - Method in class org.springframework.mock.web.MockHttpServletResponse

setLocale(Locale) - Method in class org.springframework.mock.web.portlet.MockMimeResponse

setLocale(HttpServletRequest, HttpServletResponse, Locale) - Method in class org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver

setLocale(HttpServletRequest, HttpServletResponse, Locale) - Method in class org.springframework.web.servlet.i18n.CookieLocaleResolver

setLocale(HttpServletRequest, HttpServletResponse, Locale) - Method in class org.springframework.web.servlet.i18n.FixedLocaleResolver

setLocale(HttpServletRequest, HttpServletResponse, Locale) - Method in class org.springframework.web.servlet.i18n.SessionLocaleResolver

setLocale(HttpServletRequest, HttpServletResponse, Locale) - Method in interface org.springframework.web.servlet.LocaleResolver
Set the current locale to the given one.
setLocaleContext(LocaleContext) - Static method in class org.springframework.context.i18n.LocaleContextHolder
Associate the given LocaleContext with the current thread, not exposing it as inheritable for child threads.
setLocaleContext(LocaleContext, boolean) - Static method in class org.springframework.context.i18n.LocaleContextHolder
Associate the given LocaleContext with the current thread.
setLocalesToInitialize(Locale[]) - Method in class org.springframework.web.servlet.view.ResourceBundleViewResolver
Specify Locales to initialize eagerly, rather than lazily when actually accessed.
setLocalName(String) - Method in class org.springframework.mock.web.MockHttpServletRequest

setLocalOverride(boolean) - Method in class org.springframework.core.io.support.PropertiesLoaderSupport
Set whether local properties override properties from files.
setLocalPort(int) - Method in class org.springframework.mock.web.MockHttpServletRequest

setLocalVariable(String, Object) - Method in class org.springframework.expression.spel.ExpressionState

setLocateExistingServerIfPossible(boolean) - Method in class org.springframework.jmx.support.MBeanServerFactoryBean
Set whether or not the MBeanServerFactoryBean should attempt to locate a running MBeanServer before creating one.
setLocation(String) - Method in class org.springframework.aop.aspectj.AspectJExpressionPointcutAdvisor

setLocation(String) - Method in class org.springframework.aop.support.AbstractExpressionPointcut
Set the location for debugging.
setLocation(Resource) - Method in class org.springframework.core.io.support.PropertiesLoaderSupport
Set a location of a properties file to be loaded.
setLocation(URI) - Method in class org.springframework.http.HttpHeaders
Set the (new) location of a resource, as specified by the Location header.
setLocation(Resource) - Method in class org.springframework.web.servlet.view.XmlViewResolver
Set the location of the XML file that defines the view beans.
setLocations(Resource[]) - Method in class org.springframework.core.io.support.PropertiesLoaderSupport
Set locations of properties files to be loaded.
setLog(boolean) - Method in class org.springframework.jmx.export.metadata.ManagedResource

setLogFile(String) - Method in class org.springframework.jmx.export.metadata.ManagedResource

setLogger(Log) - Method in class org.springframework.beans.factory.parsing.FailFastProblemReporter
Set the logger that is to be used to report warnings.
setLoggerName(String) - Method in class org.springframework.aop.interceptor.AbstractTraceInterceptor
Set the name of the logger to use.
setLogicalMappings(Properties) - Method in class org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver
Specifies a set of optional logical method name mappings.
setLoginTimeout(int) - Method in class org.springframework.jdbc.datasource.AbstractDataSource
Setting a login timeout is not supported.
setLoginTimeout(int) - Method in class org.springframework.jdbc.datasource.DelegatingDataSource

setLogName(String) - Method in class org.springframework.beans.factory.config.CommonsLogFactoryBean
The name of the log.
setLogTargetClassInvocation(boolean) - Method in class org.springframework.aop.interceptor.AbstractMonitoringInterceptor
Set whether to log the invocation on the target class, if applicable (i.e.
setLogWriter(PrintWriter) - Method in class org.springframework.jdbc.datasource.AbstractDataSource
LogWriter methods are not supported.
setLogWriter(PrintWriter) - Method in class org.springframework.jdbc.datasource.DelegatingDataSource

setLookupHomeOnStartup(boolean) - Method in class org.springframework.ejb.access.AbstractSlsbInvokerInterceptor
Set whether to look up the EJB home object on startup.
setLookupOnStartup(boolean) - Method in class org.springframework.jndi.JndiObjectFactoryBean
Set whether to look up the JNDI object on startup.
setLookupOnStartup(boolean) - Method in class org.springframework.jndi.JndiObjectTargetSource
Set whether to look up the JNDI object on startup.
setLookupServiceOnStartup(boolean) - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Set whether to look up the JAX-RPC service on startup.
setLookupServiceOnStartup(boolean) - Method in class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
Set whether to look up the JAX-WS service on startup.
setLookupStubOnStartup(boolean) - Method in class org.springframework.remoting.rmi.JndiRmiClientInterceptor
Set whether to look up the RMI stub on startup.
setLookupStubOnStartup(boolean) - Method in class org.springframework.remoting.rmi.RmiClientInterceptor
Set whether to look up the RMI stub on startup.
setMaintainSession(boolean) - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Set the maintain session flag to specify on the stub or call.
setMaintainSession(boolean) - Method in class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
Set the "session.maintain" flag to specify on the stub.
setManagedConnectionFactory(ManagedConnectionFactory) - Method in class org.springframework.jca.support.LocalConnectionFactoryBean
Set the JCA ManagerConnectionFactory that should be used to create the desired connection factory.
setManagedInterfaces(Class[]) - Method in class org.springframework.jmx.export.assembler.InterfaceBasedMBeanInfoAssembler
Set the array of interfaces to use for creating the management info.
setManagedMethods(String[]) - Method in class org.springframework.jmx.export.assembler.MethodNameBasedMBeanInfoAssembler
Set the array of method names to use for creating the management info.
setManagedResource(Object, String) - Method in class org.springframework.jmx.export.SpringModelMBean
Sets managed resource to expose and stores its ClassLoader.
setManagementInterface(Class) - Method in class org.springframework.jmx.access.MBeanClientInterceptor
Set the management interface of the target MBean, exposing bean property setters and getters for MBean attributes and conventional Java methods for MBean operations.
setMappedClass(Class<T>) - Method in class org.springframework.jdbc.core.BeanPropertyRowMapper
Set the class that each row should be mapped to.
setMappedHandlerClasses(Class[]) - Method in class org.springframework.web.portlet.handler.AbstractHandlerExceptionResolver
Specify the set of classes that this exception resolver should apply to.
setMappedHandlerClasses(Class[]) - Method in class org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
Specify the set of classes that this exception resolver should apply to.
setMappedHandlers(Set) - Method in class org.springframework.web.portlet.handler.AbstractHandlerExceptionResolver
Specify the set of handlers that this exception resolver should map.
setMappedHandlers(Set) - Method in class org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
Specify the set of handlers that this exception resolver should apply to.
setMappedInterceptors(MappedInterceptor[]) - Method in class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping

setMappedName(String) - Method in class org.springframework.aop.support.NameMatchMethodPointcut
Convenience method when we have only a single method name to match.
setMappedName(String) - Method in class org.springframework.aop.support.NameMatchMethodPointcutAdvisor
Convenience method when we have only a single method name to match.
setMappedNames(String[]) - Method in class org.springframework.aop.support.NameMatchMethodPointcut
Set the method names defining methods to match.
setMappedNames(String[]) - Method in class org.springframework.aop.support.NameMatchMethodPointcutAdvisor
Set the method names defining methods to match.
setMappedObjectName(Object) - Method in class org.springframework.jmx.support.NotificationListenerHolder
Set the ObjectName-style name of the single MBean that the encapsulated NotificationFilter will be registered with to listen for Notifications.
setMappedObjectNames(Object[]) - Method in class org.springframework.jmx.support.NotificationListenerHolder
Set an array of ObjectName-style names of the MBeans that the encapsulated NotificationFilter will be registered with to listen for Notifications.
setMappingDirectoryLocations(Resource[]) - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Set locations of directories that contain Hibernate mapping resources, like "WEB-INF/mappings".
setMappingJarLocations(Resource[]) - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Set locations of jar files that contain Hibernate mapping resources, like "WEB-INF/lib/example.hbm.jar".
setMappingLocation(Resource) - Method in class org.springframework.jmx.export.naming.KeyNamingStrategy
Set a location of a properties file to be loaded, containing object name mappings.
setMappingLocation(Resource) - Method in class org.springframework.mail.javamail.ConfigurableMimeFileTypeMap
Specify the Resource from which mappings are loaded.
setMappingLocation(Resource) - Method in class org.springframework.oxm.castor.CastorMarshaller
Set the locations of the Castor XML Mapping files.
setMappingLocations(Resource[]) - Method in class org.springframework.jmx.export.naming.KeyNamingStrategy
Set location of properties files to be loaded, containing object name mappings.
setMappingLocations(Resource[]) - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Set locations of Hibernate mapping files, for example as classpath resource "classpath:example.hbm.xml".
setMappingLocations(Resource[]) - Method in class org.springframework.orm.ibatis.SqlMapClientFactoryBean
Set locations of iBATIS sql-map mapping files that are going to be merged into the SqlMapClient configuration at runtime.
setMappingLocations(Resource[]) - Method in class org.springframework.oxm.castor.CastorMarshaller
Set the locations of the Castor XML Mapping files.
setMappingLocations(Resource[]) - Method in class org.springframework.validation.beanvalidation.LocalValidatorFactoryBean
Specify resource locations to load XML constraint mapping files from, if any.
setMappingResources(String[]) - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Set Hibernate mapping resources to be found in the class path, like "example.hbm.xml" or "mypackage/example.hbm.xml".
setMappings(Properties) - Method in class org.springframework.jmx.export.naming.KeyNamingStrategy
Set local properties, containing object name mappings, e.g.
setMappings(String[]) - Method in class org.springframework.mail.javamail.ConfigurableMimeFileTypeMap
Specify additional MIME type mappings as lines that follow the mime.types file format, as specified by the Java Activation Framework, for example:
text/html html htm HTML HTM
setMappings(Properties) - Method in class org.springframework.web.portlet.handler.PortletModeHandlerMapping
Set PortletMode to handler bean name mappings from a Properties object.
setMappings(Properties) - Method in class org.springframework.web.servlet.handler.SimpleUrlHandlerMapping
Map URL paths to handler bean names.
setMappings(Properties) - Method in class org.springframework.web.servlet.mvc.multiaction.PropertiesMethodNameResolver
Set explicit URL to method name mappings through a Properties object.
setMarshaller(Marshaller) - Method in class org.springframework.http.converter.xml.MarshallingHttpMessageConverter
Set the Marshaller to be used by this message converter.
setMarshaller(Marshaller) - Method in class org.springframework.jms.support.converter.MarshallingMessageConverter
Set the Marshaller to be used by this message converter.
setMarshaller(Marshaller) - Method in class org.springframework.web.servlet.view.xml.MarshallingView
Sets the Marshaller to be used by this view.
setMarshallerListener(Marshaller.Listener) - Method in class org.springframework.oxm.jaxb.Jaxb2Marshaller
Specify the Marshaller.Listener to be registered with the JAXB Marshaller.
setMarshallerProperties(Map<String, Object>) - Method in class org.springframework.oxm.jaxb.Jaxb2Marshaller
Set the JAXB Marshaller properties.
setMaxConcurrency(int) - Method in class org.springframework.jms.listener.endpoint.JmsActivationSpecConfig
Specify the maximum number of consumers/sessions to use, effectively controlling the number of concurrent invocations on the target listener.
setMaxConcurrentConsumers(int) - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Specify the maximum number of concurrent consumers to create.
setMaxElementsInMemory(int) - Method in class org.springframework.cache.ehcache.EhCacheFactoryBean
Specify the maximum number of cached objects in memory.
setMaxElementsOnDisk(int) - Method in class org.springframework.cache.ehcache.EhCacheFactoryBean
Specify the maximum number of cached objects on disk.
setMaxIdle(int) - Method in class org.springframework.aop.target.CommonsPoolTargetSource
Set the maximum number of idle objects in the pool.
setMaxInactiveInterval(int) - Method in class org.springframework.mock.web.MockHttpSession

setMaxInactiveInterval(int) - Method in class org.springframework.mock.web.portlet.MockPortletSession

setMaxInMemorySize(int) - Method in class org.springframework.web.multipart.commons.CommonsFileUploadSupport
Set the maximum allowed size (in bytes) before uploads are written to disk.
setMaxlength(String) - Method in class org.springframework.web.servlet.tags.form.InputTag
Set the value of the 'maxlength' attribute.
setMaxLinkedPages(int) - Method in class org.springframework.beans.support.PagedListHolder
Set the maximum number of page links to a few pages around the current one.
setMaxMessagesPerTask(int) - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Specify the maximum number of messages to process in one task.
setMaxPayloadLength(int) - Method in class org.springframework.web.filter.AbstractRequestLoggingFilter
Sets the maximum length of the payload body to be included in the log message.
setMaxPoolSize(int) - Method in class org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor
Set the ThreadPoolExecutor's maximum pool size.
setMaxPoolSize(int) - Method in class org.springframework.scheduling.concurrent.ThreadPoolExecutorFactoryBean
Set the ThreadPoolExecutor's maximum pool size.
setMaxPoolSize(int) - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
Set the ThreadPoolExecutor's maximum pool size.
setMaxResults(int) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
Set the maximum number of rows for this HibernateTemplate.
setMaxRows(int) - Method in class org.springframework.jdbc.core.JdbcTemplate
Set the maximum number of rows for this JdbcTemplate.
setMaxRows(int) - Method in class org.springframework.jdbc.object.RdbmsOperation
Set the maximum number of rows for this RDBMS operation.
setMaxRowsAffected(int) - Method in class org.springframework.jdbc.object.SqlUpdate
Set the maximum number of rows that may be affected by this update.
setMaxSize(int) - Method in class org.springframework.aop.target.AbstractPoolingTargetSource
Set the maximum size of the pool.
setMaxUploadSize(long) - Method in class org.springframework.web.multipart.commons.CommonsFileUploadSupport
Set the maximum allowed size (in bytes) before uploads are refused.
setMaxWait(long) - Method in class org.springframework.aop.target.CommonsPoolTargetSource
Set the maximum waiting time for fetching an object from the pool.
setMediaTypes(Map<String, String>) - Method in class org.springframework.web.servlet.view.ContentNegotiatingViewResolver
Sets the mapping from file extensions to media types.
setMemoryStoreEvictionPolicy(MemoryStoreEvictionPolicy) - Method in class org.springframework.cache.ehcache.EhCacheFactoryBean
Set the memory style eviction policy for this cache.
setMerge(String) - Method in class org.springframework.beans.factory.xml.DocumentDefaultsDefinition
Set the default merge setting for the document that's currently parsed.
setMergeEnabled(boolean) - Method in class org.springframework.beans.factory.support.ManagedList
Set whether merging should be enabled for this collection, in case of a 'parent' collection value being present.
setMergeEnabled(boolean) - Method in class org.springframework.beans.factory.support.ManagedMap
Set whether merging should be enabled for this collection, in case of a 'parent' collection value being present.
setMergeEnabled(boolean) - Method in class org.springframework.beans.factory.support.ManagedProperties
Set whether merging should be enabled for this collection, in case of a 'parent' collection value being present.
setMergeEnabled(boolean) - Method in class org.springframework.beans.factory.support.ManagedSet
Set whether merging should be enabled for this collection, in case of a 'parent' collection value being present.
setMessage(Object) - Method in class org.springframework.web.servlet.tags.MessageTag
Set the MessageSourceResolvable for this tag.
setMessageCodesResolver(MessageCodesResolver) - Method in class org.springframework.validation.AbstractBindingResult
Set the strategy to use for resolving errors into message codes.
setMessageCodesResolver(MessageCodesResolver) - Method in class org.springframework.validation.DataBinder
Set the strategy to use for resolving errors into message codes.
setMessageCodesResolver(MessageCodesResolver) - Method in class org.springframework.web.bind.support.ConfigurableWebBindingInitializer
Set the strategy to use for resolving errors into message codes.
setMessageCodesResolver(MessageCodesResolver) - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Set the strategy to use for resolving errors into message codes.
setMessageCodesResolver(MessageCodesResolver) - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Set the strategy to use for resolving errors into message codes.
setMessageConverter(MessageConverter) - Method in class org.springframework.jms.core.JmsTemplate
Set the message converter for this template.
setMessageConverter(MessageConverter) - Method in class org.springframework.jms.listener.adapter.MessageListenerAdapter
Set the converter that will convert incoming JMS messages to listener method arguments, and objects returned from listener methods back to JMS messages.
setMessageConverter(MessageConverter) - Method in class org.springframework.jms.remoting.JmsInvokerClientInterceptor
Specify the MessageConverter to use for turning RemoteInvocation objects into request messages, as well as response messages into RemoteInvocationResult objects.
setMessageConverter(MessageConverter) - Method in class org.springframework.jms.remoting.JmsInvokerServiceExporter
Specify the MessageConverter to use for turning request messages into RemoteInvocation objects, as well as RemoteInvocationResult objects into response messages.
setMessageConverters(List<HttpMessageConverter<?>>) - Method in class org.springframework.web.client.RestTemplate
Set the message body converters to use.
setMessageConverters(HttpMessageConverter<?>[]) - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
Set the message body converters to use.
setMessageConverters(HttpMessageConverter<?>[]) - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver
Set the message body converters to use.
setMessageDrivenContext(MessageDrivenContext) - Method in class org.springframework.ejb.support.AbstractMessageDrivenBean
Required lifecycle method.
setMessageEndpointFactory(MessageEndpointFactory) - Method in class org.springframework.jca.endpoint.GenericMessageEndpointManager
Set the JCA MessageEndpointFactory to activate, pointing to a MessageListener object that the endpoints will delegate to.
setMessageIdEnabled(boolean) - Method in class org.springframework.jms.core.JmsTemplate
Set whether message IDs are enabled.
setMessageInterpolator(MessageInterpolator) - Method in class org.springframework.validation.beanvalidation.CustomValidatorBean
Specify a custom MessageInterpolator to use for this Validator.
setMessageInterpolator(MessageInterpolator) - Method in class org.springframework.validation.beanvalidation.LocalValidatorFactoryBean
Specify a custom MessageInterpolator to use for this ValidatorFactory and its exposed default Validator.
setMessageListener(Object) - Method in class org.springframework.jca.endpoint.GenericMessageEndpointFactory
Specify the message listener object that the endpoint should expose (e.g.
setMessageListener(Object) - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Set the message listener implementation to register.
setMessageListener(MessageListener) - Method in class org.springframework.jms.listener.endpoint.JmsMessageEndpointFactory
Set the JMS MessageListener for this endpoint.
setMessageListener(MessageListener) - Method in class org.springframework.jms.listener.endpoint.JmsMessageEndpointManager
Set the JMS MessageListener for this endpoint.
setMessageSelector(String) - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Set the JMS message selector expression (or null if none).
setMessageSelector(String) - Method in class org.springframework.jms.listener.endpoint.JmsActivationSpecConfig

setMessageSource(MessageSource) - Method in interface org.springframework.context.MessageSourceAware
Set the MessageSource that this object runs in.
setMessageTimestampEnabled(boolean) - Method in class org.springframework.jms.core.JmsTemplate
Set whether message timestamps are enabled.
setMetadataReaderFactory(MetadataReaderFactory) - Method in class org.springframework.context.annotation.ConfigurationClassPostProcessor
Set the MetadataReaderFactory to use.
setMethod(String) - Method in class org.springframework.mock.web.MockHttpServletRequest

setMethod(String) - Method in class org.springframework.mock.web.portlet.MockClientDataRequest

setMethod(String) - Method in class org.springframework.mock.web.portlet.MockEventRequest

setMethod(String) - Method in class org.springframework.web.servlet.tags.form.FormTag
Set the value of the 'method' attribute.
setMethodInvoker(MethodInvoker) - Method in class org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean.MethodInvokingJob
Set the MethodInvoker to use.
setMethodMap(Map<String, TransactionAttribute>) - Method in class org.springframework.transaction.interceptor.MethodMapTransactionAttributeSource
Set a name/attribute map, consisting of "FQCN.method" method names (e.g.
setMethodMappings(Properties) - Method in class org.springframework.jmx.export.assembler.MethodNameBasedMBeanInfoAssembler
Set the mappings of bean keys to a comma-separated list of method names.
setMethodName(String) - Method in class org.springframework.aop.config.MethodLocatingFactoryBean
Set the name of the Method to locate.
setMethodName(String) - Method in class org.springframework.remoting.support.RemoteInvocation
Set the name of the target method.
setMethodNameResolver(MethodNameResolver) - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
Set the MethodNameResolver to use for resolving default handler methods (carrying an empty @RequestMapping annotation).
setMethodNameResolver(MethodNameResolver) - Method in class org.springframework.web.servlet.mvc.multiaction.MultiActionController
Set the method name resolver that this class should use.
setMethodOverrides(MethodOverrides) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Specify method overrides for the bean, if any.
setMethodParam(String) - Method in class org.springframework.web.filter.HiddenHttpMethodFilter
Set the parameter name to look for HTTP methods.
setMethodParam(String) - Method in class org.springframework.web.servlet.tags.form.FormTag
Set the name of the request param for non-browser supported HTTP methods.
setMethodParamNames(String[]) - Method in class org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver
Set a String array of parameter names, where the very existence of a parameter in the list (with value ignored) means that a method of the same name should be invoked.
setMethodResolvers(List<MethodResolver>) - Method in class org.springframework.expression.spel.support.StandardEvaluationContext

setMetricType(MetricType) - Method in class org.springframework.jmx.export.metadata.ManagedMetric
A description of how this metric's values change over time.
setMimeMultiparts(MimeMultipart, MimeMultipart) - Method in class org.springframework.mail.javamail.MimeMessageHelper
Set the given MimeMultipart objects for use by this MimeMessageHelper.
setMinEvictableIdleTimeMillis(long) - Method in class org.springframework.aop.target.CommonsPoolTargetSource
Set the minimum time that an idle object can sit in the pool before it becomes subject to eviction.
setMinIdle(int) - Method in class org.springframework.aop.target.CommonsPoolTargetSource
Set the minimum number of idle objects in the pool.
setMinorVersion(int) - Method in class org.springframework.mock.web.MockServletContext

setMisfireInstructionName(String) - Method in class org.springframework.scheduling.quartz.CronTriggerBean
Set the misfire instruction via the name of the corresponding constant in the CronTrigger class.
setMisfireInstructionName(String) - Method in class org.springframework.scheduling.quartz.SimpleTriggerBean
Set the misfire instruction via the name of the corresponding constant in the SimpleTrigger class.
setMode(int) - Method in class org.springframework.oxm.xstream.XStreamMarshaller
Set the XStream mode.
setModelAttribute(String) - Method in class org.springframework.web.servlet.tags.form.FormTag
Set the name of the form attribute in the model.
setModelKey(String) - Method in class org.springframework.web.servlet.view.xml.MarshallingView
Set the name of the model key that represents the object to be marshalled.
setMtomEnabled(boolean) - Method in class org.springframework.oxm.jaxb.Jaxb2Marshaller
Specify whether MTOM support should be enabled or not.
setMultipartFiles(MultiValueMap<String, MultipartFile>) - Method in class org.springframework.web.multipart.support.AbstractMultipartHttpServletRequest
Set a Map with parameter names as keys and list of MultipartFile objects as values.
setMultipartFiles(MultiValueMap<String, MultipartFile>) - Method in class org.springframework.web.portlet.multipart.DefaultMultipartActionRequest
Set a Map with parameter names as keys and list of MultipartFile objects as values.
setMultipartParameters(Map<String, String[]>) - Method in class org.springframework.web.multipart.support.DefaultMultipartHttpServletRequest
Set a Map with parameter names as keys and String array objects as values.
setMultipartParameters(Map<String, String[]>) - Method in class org.springframework.web.portlet.multipart.DefaultMultipartActionRequest
Set a Map with parameter names as keys and String array objects as values.
setMultipartResolverBeanName(String) - Method in class org.springframework.web.multipart.support.MultipartFilter
Set the bean name of the MultipartResolver to fetch from Spring's root application context.
setMultiple(Object) - Method in class org.springframework.web.servlet.tags.form.SelectTag
Set the value of the HTML 'multiple' attribute rendered on the final 'select' element.
setName(String) - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues.ValueHolder
Set the name of the constructor argument.
setName(String) - Method in class org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder
Sets the name of the embedded database Defaults to 'testdb' if not called.
setName(String) - Method in class org.springframework.jmx.export.metadata.ManagedNotification
Set the name of this notification.
setName(String) - Method in class org.springframework.jmx.export.metadata.ManagedOperationParameter
Set the name of this parameter in the operation signature.
setName(String) - Method in class org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean
Set the name of the job.
setName(String) - Method in class org.springframework.transaction.support.DefaultTransactionDefinition
Set the name of this transaction.
setName(String) - Method in class org.springframework.web.servlet.tags.BindErrorsTag
Set the name of the bean that this tag should check.
setName(String) - Method in class org.springframework.web.servlet.tags.form.FormTag
Set the value of the 'name' attribute.
setName(String) - Method in class org.springframework.web.servlet.tags.Param
Set the raw name of the parameter
setName(String) - Method in class org.springframework.web.servlet.tags.ParamTag
Sets the name of the parameter
setNameMap(Map<String, TransactionAttribute>) - Method in class org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource
Set a name/attribute map, consisting of method names (e.g.
setNamespace(String) - Method in class org.springframework.mock.web.portlet.MockPortletResponse

setNamespace(String) - Method in interface org.springframework.web.context.ConfigurableWebApplicationContext
Set the namespace for this web application context, to be used for building a default context config location.
setNamespace(String) - Method in class org.springframework.web.context.support.AbstractRefreshableWebApplicationContext

setNamespace(String) - Method in class org.springframework.web.context.support.StaticWebApplicationContext

setNamespace(String) - Method in class org.springframework.web.portlet.context.AbstractRefreshablePortletApplicationContext

setNamespace(String) - Method in interface org.springframework.web.portlet.context.ConfigurablePortletApplicationContext
Set the namespace for this portlet application context, to be used for building a default context config location.
setNamespace(String) - Method in class org.springframework.web.portlet.context.StaticPortletApplicationContext

setNamespace(String) - Method in class org.springframework.web.portlet.FrameworkPortlet
Set a custom namespace for this portlet, to be used for building a default context config location.
setNamespace(String) - Method in class org.springframework.web.servlet.FrameworkServlet
Set a custom namespace for this servlet, to be used for building a default context config location.
setNamespace(String) - Method in class org.springframework.web.struts.ContextLoaderPlugIn
Deprecated. Set a custom namespace for the ActionServlet, to be used for building a default context config location.
setNamespaceAware(boolean) - Method in class org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Set whether or not the XML parser should be XML namespace aware.
setNamespaceHandlerResolver(NamespaceHandlerResolver) - Method in class org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Specify the NamespaceHandlerResolver to use.
setNamespaceMappings(Map<String, String>) - Method in class org.springframework.oxm.castor.CastorMarshaller
Set the namespace mappings.
setNamespaceUri(String) - Method in class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
Deprecated. Set the namespace URI of the service.
setNamespaceUri(String) - Method in class org.springframework.remoting.jaxws.LocalJaxWsServiceFactory
Set the namespace URI of the service.
setNamingStrategy(ObjectNamingStrategy) - Method in class org.springframework.jmx.export.MBeanExporter
Set the implementation of the ObjectNamingStrategy interface to use for this exporter.
setNamingStrategy(NamingStrategy) - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Set a Hibernate NamingStrategy for the SessionFactory, determining the physical column and table names given the info in the mapping document.
setNativeConnectionNecessaryForNativeCallableStatements(boolean) - Method in class org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor
Set whether it is necessary to work on the native Connection to receive native CallableStatements.
setNativeConnectionNecessaryForNativePreparedStatements(boolean) - Method in class org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor
Set whether it is necessary to work on the native Connection to receive native PreparedStatements.
setNativeConnectionNecessaryForNativeStatements(boolean) - Method in class org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor
Set whether it is necessary to work on the native Connection to receive native Statements.
setNativeJdbcExtractor(NativeJdbcExtractor) - Method in class org.springframework.jdbc.core.CallableStatementCreatorFactory
Specify the NativeJdbcExtractor to use for unwrapping CallableStatements, if any.
setNativeJdbcExtractor(NativeJdbcExtractor) - Method in class org.springframework.jdbc.core.JdbcTemplate
Set a NativeJdbcExtractor to extract native JDBC objects from wrapped handles.
setNativeJdbcExtractor(NativeJdbcExtractor) - Method in class org.springframework.jdbc.core.PreparedStatementCreatorFactory
Specify the NativeJdbcExtractor to use for unwrapping PreparedStatements, if any.
setNativeJdbcExtractor(NativeJdbcExtractor) - Method in class org.springframework.jdbc.support.lob.OracleLobHandler
Set an appropriate NativeJdbcExtractor to be able to retrieve the underlying native oracle.jdbc.OracleConnection.
setNestedPath(String) - Method in class org.springframework.validation.AbstractErrors

setNestedPath(String) - Method in exception org.springframework.validation.BindException

setNestedPath(String) - Method in interface org.springframework.validation.Errors
Allow context to be changed so that standard validators can validate subtrees.
setNestedPath(String) - Method in class org.springframework.web.bind.EscapedErrors

setNestedTransactionAllowed(boolean) - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Set whether nested transactions are allowed.
setNew(boolean) - Method in class org.springframework.mock.web.MockHttpSession

setNew(boolean) - Method in class org.springframework.mock.web.portlet.MockPortletSession

setNextPossiblePortletModes(Collection<PortletMode>) - Method in class org.springframework.mock.web.portlet.MockRenderResponse

setNonJtaDataSource(DataSource) - Method in class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo

setNonPublicAccessAllowed(boolean) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Specify whether to allow access to non-public constructors and methods, for the case of externalized metadata pointing to those.
setNonTransactionalDataSource(DataSource) - Method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
Set the DataSource to be used by the Scheduler for non-transactional access.
setNotificationFilter(NotificationFilter) - Method in class org.springframework.jmx.support.NotificationListenerHolder
Set the NotificationFilter associated with the encapsulated NotificationFilter.
setNotificationInfoMappings(Map<String, Object>) - Method in class org.springframework.jmx.export.assembler.AbstractConfigurableMBeanInfoAssembler

setNotificationInfos(ManagedNotification[]) - Method in class org.springframework.jmx.export.assembler.AbstractConfigurableMBeanInfoAssembler

setNotificationListener(NotificationListener) - Method in class org.springframework.jmx.support.NotificationListenerHolder
Set the NotificationListener.
setNotificationListenerMappings(Map<?, ? extends NotificationListener>) - Method in class org.springframework.jmx.export.MBeanExporter
Set the NotificationListeners to register with the MBeanServer.
setNotificationListeners(NotificationListenerBean[]) - Method in class org.springframework.jmx.export.MBeanExporter
Set the NotificationListenerBeans containing the NotificationListeners that will be registered with the MBeanServer.
setNotificationPublisher(NotificationPublisher) - Method in interface org.springframework.jmx.export.notification.NotificationPublisherAware
Set the NotificationPublisher instance for the current managed resource instance.
setNotificationType(String) - Method in class org.springframework.jmx.export.metadata.ManagedNotification
Set a single notification type, or a list of notification types as comma-delimited String.
setNotificationTypes(String[]) - Method in class org.springframework.jmx.export.metadata.ManagedNotification
Set a list of notification types.
setNullValue(String) - Method in class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
Set a value that should be treated as null when resolved as a placeholder value: e.g.
setNumberToolAttribute(String) - Method in class org.springframework.web.servlet.view.velocity.VelocityView
Set the name of the NumberTool helper object to expose in the Velocity context of this view, or null if not needed.
setNumberToolAttribute(String) - Method in class org.springframework.web.servlet.view.velocity.VelocityViewResolver
Set the name of the NumberTool helper object to expose in the Velocity context of this view, or null if not needed.
setObjectMapper(ObjectMapper) - Method in class org.springframework.http.converter.json.MappingJacksonHttpMessageConverter
Sets the ObjectMapper for this view.
setObjectMapper(ObjectMapper) - Method in class org.springframework.web.servlet.view.json.MappingJacksonJsonView
Sets the ObjectMapper for this view.
setObjectName(Object) - Method in class org.springframework.jmx.access.MBeanClientInterceptor
Set the ObjectName of the MBean which calls are routed to, as ObjectName instance or as String.
setObjectName(String) - Method in class org.springframework.jmx.export.metadata.ManagedResource
Set the JMX ObjectName of this managed resource.
setObjectName(Object) - Method in class org.springframework.jmx.support.ConnectorServerFactoryBean
Set the ObjectName used to register the JMXConnectorServer itself with the MBeanServer, as ObjectName instance or as String.
setOmittedFields(Map<Class<?>, String>) - Method in class org.springframework.oxm.xstream.XStreamMarshaller
Specify omitted fields, as a Map consisting of Class instances mapped to comma separated field names.
setOnblur(String) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
Set the value of the 'onblur' attribute.
setOnchange(String) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
Set the value of the 'onchange' attribute.
setOnclick(String) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Set the value of the 'onclick' attribute.
setOndblclick(String) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Set the value of the 'ondblclick' attribute.
setOnfocus(String) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
Set the value of the 'onfocus' attribute.
setOnkeydown(String) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Set the value of the 'onkeydown' attribute.
setOnkeypress(String) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Set the value of the 'onkeypress' attribute.
setOnkeyup(String) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Set the value of the 'onkeyup' attribute.
setOnmousedown(String) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Set the value of the 'onmousedown' attribute.
setOnmousemove(String) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Set the value of the 'onmousemove' attribute.
setOnmouseout(String) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Set the value of the 'onmouseout' attribute.
setOnmouseover(String) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Set the value of the 'onmouseover' attribute.
setOnmouseup(String) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Set the value of the 'onmouseup' attribute.
setOnreset(String) - Method in class org.springframework.web.servlet.tags.form.FormTag
Set the value of the 'onreset' attribute.
setOnselect(String) - Method in class org.springframework.web.servlet.tags.form.InputTag
Set the value of the 'onselect' attribute.
setOnselect(String) - Method in class org.springframework.web.servlet.tags.form.TextareaTag
Set the value of the 'onselect' attribute.
setOnsubmit(String) - Method in class org.springframework.web.servlet.tags.form.FormTag
Set the value of the 'onsubmit' attribute.
setOpaque(boolean) - Method in class org.springframework.aop.framework.ProxyConfig
Set whether proxies created by this configuration should be prevented from being cast to Advised to query proxy status.
setOperatorOverloader(OperatorOverloader) - Method in class org.springframework.expression.spel.support.StandardEvaluationContext

setOptimize(boolean) - Method in class org.springframework.aop.framework.ProxyConfig
Set whether proxies should perform aggressive optimizations.
setOptional(boolean) - Method in class org.springframework.beans.PropertyValue

setOptions(Map<String, ?>) - Method in class org.springframework.oxm.xmlbeans.XmlOptionsFactoryBean
Set options on the underlying XmlOptions object.
setOrder(int) - Method in class org.springframework.aop.aspectj.AspectJPointcutAdvisor

setOrder(int) - Method in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
Set the ordering which will apply to this class's implementation of Ordered, used when applying multiple BeanPostProcessors.
setOrder(int) - Method in class org.springframework.aop.support.AbstractPointcutAdvisor

setOrder(int) - Method in class org.springframework.aop.support.DefaultIntroductionAdvisor

setOrder(int) - Method in class org.springframework.aop.support.StaticMethodMatcherPointcutAdvisor

setOrder(int) - Method in class org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor

setOrder(int) - Method in class org.springframework.beans.factory.annotation.CustomAutowireConfigurer

setOrder(int) - Method in class org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor

setOrder(int) - Method in class org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor

setOrder(int) - Method in class org.springframework.beans.factory.config.CustomEditorConfigurer

setOrder(int) - Method in class org.springframework.beans.factory.config.CustomScopeConfigurer

setOrder(int) - Method in class org.springframework.beans.factory.config.PropertyResourceConfigurer

setOrder(int) - Method in class org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor

setOrder(int) - Method in class org.springframework.web.portlet.handler.AbstractHandlerExceptionResolver

setOrder(int) - Method in class org.springframework.web.portlet.handler.AbstractHandlerMapping
Specify the order value for this HandlerMapping bean.
setOrder(int) - Method in class org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter
Specify the order value for this HandlerAdapter bean.
setOrder(int) - Method in class org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver

setOrder(int) - Method in class org.springframework.web.servlet.handler.AbstractHandlerMapping
Specify the order value for this HandlerMapping bean.
setOrder(int) - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
Specify the order value for this HandlerAdapter bean.
setOrder(int) - Method in class org.springframework.web.servlet.view.BeanNameViewResolver

setOrder(int) - Method in class org.springframework.web.servlet.view.ContentNegotiatingViewResolver

setOrder(int) - Method in class org.springframework.web.servlet.view.ResourceBundleViewResolver

setOrder(int) - Method in class org.springframework.web.servlet.view.UrlBasedViewResolver
Set the order in which this ViewResolver is evaluated.
setOrder(int) - Method in class org.springframework.web.servlet.view.XmlViewResolver

setOriginatingBeanDefinition(BeanDefinition) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Set the originating (e.g.
setOutParameterNames(List<String>) - Method in class org.springframework.jdbc.core.metadata.CallMetaDataContext
Specify the names of the out parameters.
setOutputProperties(Properties) - Method in class org.springframework.web.servlet.view.xslt.AbstractXsltView
Deprecated. Set arbitrary transformer output properties to be applied to the stylesheet.
setOutputProperties(Properties) - Method in class org.springframework.web.servlet.view.xslt.XsltView
Set arbitrary transformer output properties to be applied to the stylesheet.
setOutputProperties(Properties) - Method in class org.springframework.web.servlet.view.xslt.XsltViewResolver
Set arbitrary transformer output properties to be applied to the stylesheet.
setOutputRecordCreator(RecordCreator) - Method in class org.springframework.jca.cci.core.CciTemplate
Set a RecordCreator that should be used for creating default output Records.
setOutputRecordCreator(RecordCreator) - Method in class org.springframework.jca.cci.object.MappingRecordOperation
Set a RecordCreator that should be used for creating default output Records.
setOutputStreamAccessAllowed(boolean) - Method in class org.springframework.mock.web.MockHttpServletResponse
Set whether MockHttpServletResponse.getOutputStream() access is allowed.
setOverflowToDisk(boolean) - Method in class org.springframework.cache.ehcache.EhCacheFactoryBean
Set whether elements can overflow to disk when the in-memory cache has reached the maximum size limit.
setOverloaded(boolean) - Method in class org.springframework.beans.factory.support.MethodOverride
Set whether the overridden method has to be considered as overloaded (that is, whether arg type matching has to happen).
setOverloadEnabled(boolean) - Method in class org.springframework.remoting.caucho.BurlapClientInterceptor
Set whether overloaded methods should be enabled for remote invocations.
setOverloadEnabled(boolean) - Method in class org.springframework.remoting.caucho.HessianClientInterceptor
Set whether overloaded methods should be enabled for remote invocations.
setOverrideIncludeSynonymsDefault(boolean) - Method in class org.springframework.jdbc.core.metadata.TableMetaDataContext
Specify whether we should override default for accessing synonyms.
setOverrideIncludeSynonymsDefault(boolean) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Specify whether the default for including synonyms should be changed.
setOverrideLogging(boolean) - Method in class org.springframework.ui.velocity.VelocityEngineFactory
Set whether Velocity should log via Commons Logging, i.e.
setOverwriteExistingJobs(boolean) - Method in class org.springframework.scheduling.quartz.SchedulerAccessor
Set whether any jobs defined on this SchedulerFactoryBean should overwrite existing job definitions.
setPackagesToScan(String[]) - Method in class org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean
Set whether to use Spring-based scanning for entity classes in the classpath instead of listing annotated classes explicitly.
setPaddingLength(int) - Method in class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
Set the padding length, i.e.
setPage(int) - Method in class org.springframework.beans.support.PagedListHolder
Set the current page number.
setPageAttribute(String) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Set the name of the page attribute in the model, containing an Integer with the current page number.
setPageAttribute(String) - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Set the name of the page attribute in the model, containing an Integer with the current page number.
setPageContext(PageContext) - Method in class org.springframework.web.servlet.tags.EvalTag

setPageRenderParameter(ActionResponse, int) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Pass the page number to the render phase by setting a render parameter.
setPages(String[]) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Set the wizard pages, i.e.
setPages(String[]) - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Set the wizard pages, i.e.
setPageSize(int) - Method in class org.springframework.beans.support.PagedListHolder
Set the current page size.
setParameter(String, String) - Method in class org.springframework.mock.web.MockHttpServletRequest
Set a single value for the specified HTTP parameter.
setParameter(String, String[]) - Method in class org.springframework.mock.web.MockHttpServletRequest
Set an array of values for the specified HTTP parameter.
setParameter(String, String) - Method in class org.springframework.mock.web.portlet.MockBaseURL

setParameter(String, String[]) - Method in class org.springframework.mock.web.portlet.MockBaseURL

setParameter(String, String) - Method in class org.springframework.mock.web.portlet.MockPortletRequest

setParameter(String, String[]) - Method in class org.springframework.mock.web.portlet.MockPortletRequest

setParameter(PreparedStatement, int, Object, String) - Method in class org.springframework.orm.ibatis.support.AbstractLobTypeHandler
This implementation delegates to setParameterInternal, passing in a transaction-synchronized LobCreator for the LobHandler of this type.
setParameterInternal(PreparedStatement, int, Object, String, LobCreator) - Method in class org.springframework.orm.ibatis.support.AbstractLobTypeHandler
Template method to set the given value on the given statement.
setParameterInternal(PreparedStatement, int, Object, String, LobCreator) - Method in class org.springframework.orm.ibatis.support.BlobByteArrayTypeHandler

setParameterInternal(PreparedStatement, int, Object, String, LobCreator) - Method in class org.springframework.orm.ibatis.support.BlobSerializableTypeHandler

setParameterInternal(PreparedStatement, int, Object, String, LobCreator) - Method in class org.springframework.orm.ibatis.support.ClobStringTypeHandler

setParameterMap(Map<String, ?>) - Method in class org.springframework.web.portlet.handler.ParameterHandlerMapping
Set a Map with parameters as keys and handler beans or bean names as values.
setParameterName(String) - Method in class org.springframework.web.portlet.handler.ParameterHandlerMapping
Set the name of the parameter used for mapping to handlers.
setParameterName(String) - Method in class org.springframework.web.portlet.handler.ParameterMappingInterceptor
Set the name of the parameter used for mapping.
setParameterName(String) - Method in class org.springframework.web.portlet.handler.PortletModeParameterHandlerMapping
Set the name of the parameter used for mapping to handlers.
setParameterName(String) - Method in class org.springframework.web.servlet.view.ContentNegotiatingViewResolver
Sets the parameter name that can be used to determine the requested media type if the ContentNegotiatingViewResolver.setFavorParameter(boolean) property is true.
setParameterNameDiscoverer(ParameterNameDiscoverer) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Set the ParameterNameDiscoverer to use for resolving method parameter names if needed (e.g.
setParameterNameDiscoverer(ParameterNameDiscoverer) - Method in class org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter
Set the ParameterNameDiscoverer to use for resolving method parameter names if needed (e.g.
setParameterNameDiscoverer(ParameterNameDiscoverer) - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
Set the ParameterNameDiscoverer to use for resolving method parameter names if needed (e.g.
setParameterNames(String[]) - Method in class org.springframework.aop.aspectj.AspectJExpressionPointcut
Set the parameter names for the pointcut.
setParameterNames(String[]) - Method in class org.springframework.aop.aspectj.AspectJExpressionPointcutAdvisor

setParameters(SqlParameter[]) - Method in class org.springframework.jdbc.object.RdbmsOperation
Add one or more declared parameters.
setParameters(Map) - Method in class org.springframework.mock.web.MockHttpServletRequest
Sets all provided parameters replacing any existing values for the provided parameter names.
setParameters(Map<String, String[]>) - Method in class org.springframework.mock.web.portlet.MockBaseURL

setParameters(Map<String, String[]>) - Method in class org.springframework.mock.web.portlet.MockPortletRequest

setParameters(Properties) - Method in class org.springframework.orm.hibernate3.TypeDefinitionBean
Specify default parameters for the type.
setParameterTypes(Class[]) - Method in class org.springframework.aop.aspectj.AspectJExpressionPointcut
Set the parameter types for the pointcut.
setParameterTypes(Class[]) - Method in class org.springframework.aop.aspectj.AspectJExpressionPointcutAdvisor

setParameterTypes(Map<String, String>) - Method in class org.springframework.orm.hibernate3.FilterDefinitionFactoryBean
Set the parameter types for the filter, with parameter names as keys and type names as values.
setParameterTypes(Class[]) - Method in class org.springframework.remoting.support.RemoteInvocation
Set the parameter types of the target method.
setParameterValue(PreparedStatement, int, SqlParameter, Object) - Static method in class org.springframework.jdbc.core.StatementCreatorUtils
Set the value for a parameter.
setParameterValue(PreparedStatement, int, int, Object) - Static method in class org.springframework.jdbc.core.StatementCreatorUtils
Set the value for a parameter.
setParameterValue(PreparedStatement, int, int, String, Object) - Static method in class org.springframework.jdbc.core.StatementCreatorUtils
Set the value for a parameter.
setParamName(String) - Method in class org.springframework.web.servlet.i18n.LocaleChangeInterceptor
Set the name of the parameter that contains a locale specification in a locale change request.
setParamName(String) - Method in class org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver
Set the name of the parameter whose value identifies the name of the method to invoke.
setParamName(String) - Method in class org.springframework.web.servlet.theme.ThemeChangeInterceptor
Set the name of the parameter that contains a theme specification in a theme change request.
setParent(ApplicationContext) - Method in interface org.springframework.context.ConfigurableApplicationContext
Set the parent of this application context.
setParent(ApplicationContext) - Method in class org.springframework.context.support.AbstractApplicationContext

setParent(ApplicationContext) - Method in class org.springframework.context.support.GenericApplicationContext
Set the parent of this application context, also setting the parent of the internal BeanFactory accordingly.
setParent(ApplicationContext) - Method in class org.springframework.web.portlet.context.AbstractRefreshablePortletApplicationContext

setParent(ApplicationContext) - Method in class org.springframework.web.portlet.context.StaticPortletApplicationContext

setParentBeanFactory(BeanFactory) - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Set the parent of this bean factory.
setParentBeanFactory(BeanFactory) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory

setParentMessageSource(MessageSource) - Method in interface org.springframework.context.HierarchicalMessageSource
Set the parent that will be used to try to resolve messages that this object can't resolve.
setParentMessageSource(MessageSource) - Method in class org.springframework.context.support.AbstractMessageSource

setParentMessageSource(MessageSource) - Method in class org.springframework.context.support.DelegatingMessageSource

setParentName(String) - Method in interface org.springframework.beans.factory.config.BeanDefinition
Set the name of the parent definition of this bean definition, if any.
setParentName(String) - Method in class org.springframework.beans.factory.support.BeanDefinitionBuilder
Set the name of the parent definition of this bean definition.
setParentName(String) - Method in class org.springframework.beans.factory.support.ChildBeanDefinition

setParentName(String) - Method in class org.springframework.beans.factory.support.GenericBeanDefinition

setParentName(String) - Method in class org.springframework.beans.factory.support.RootBeanDefinition

setParentThemeSource(ThemeSource) - Method in interface org.springframework.ui.context.HierarchicalThemeSource
Set the parent that will be used to try to resolve theme messages that this object can't resolve.
setParentThemeSource(ThemeSource) - Method in class org.springframework.ui.context.support.DelegatingThemeSource

setParentThemeSource(ThemeSource) - Method in class org.springframework.ui.context.support.ResourceBundleThemeSource

setPartConverters(List<HttpMessageConverter<?>>) - Method in class org.springframework.http.converter.FormHttpMessageConverter
Set the message body converters to use.
setPassword(String) - Method in class org.springframework.jdbc.datasource.AbstractDriverBasedDataSource
Set the JDBC password to use for connecting through the Driver.
setPassword(String) - Method in interface org.springframework.jdbc.datasource.embedded.ConnectionProperties
Sets the password to use to connect to the database.
setPassword(String) - Method in class org.springframework.jdbc.datasource.UserCredentialsDataSourceAdapter
Set the default user's password that this adapter should use for retrieving Connections.
setPassword(String) - Method in class org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter
Set the password that this adapter should use for retrieving Connections.
setPassword(String) - Method in class org.springframework.mail.javamail.JavaMailSenderImpl
Set the password for the account at the mail host, if any.
setPassword(String) - Method in class org.springframework.remoting.caucho.BurlapClientInterceptor
Set the password that this factory should use to access the remote service.
setPassword(String) - Method in class org.springframework.remoting.caucho.HessianClientInterceptor
Set the password that this factory should use to access the remote service.
setPassword(String) - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Set the password to specify on the stub or call.
setPassword(String) - Method in class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
Set the password to specify on the stub.
setPath(String) - Method in class org.springframework.web.servlet.tags.BindTag
Set the path that this tag should apply.
setPath(String) - Method in class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
Set the property path from the form object.
setPath(String) - Method in class org.springframework.web.servlet.tags.form.FormTag
Unsupported for forms.
setPath(String) - Method in class org.springframework.web.servlet.tags.NestedPathTag
Set the path that this tag should apply.
setPath(HttpServletRequest, String) - Static method in class org.springframework.web.servlet.view.tiles.TilesView
Deprecated. Set the path of the layout page to render.
setPathInfo(String) - Method in class org.springframework.mock.web.MockHttpServletRequest

setPathMatcher(PathMatcher) - Method in class org.springframework.core.io.support.PathMatchingResourcePatternResolver
Set the PathMatcher implementation to use for this resource pattern resolver.
setPathMatcher(PathMatcher) - Method in class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
Set the PathMatcher implementation to use for matching URL paths against registered URL patterns.
setPathMatcher(PathMatcher) - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
Set the PathMatcher implementation to use for matching URL paths against registered URL patterns.
setPathMatcher(PathMatcher) - Method in class org.springframework.web.servlet.mvc.multiaction.PropertiesMethodNameResolver
Set the PathMatcher implementation to use for matching URL paths against registered URL patterns.
setPathMatcher(PathMatcher) - Method in class org.springframework.web.servlet.mvc.WebContentInterceptor
Set the PathMatcher implementation to use for matching URL paths against registered URL patterns, for determining cache mappings.
setPathPrefix(String) - Method in class org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping
Specify a prefix to prepend to the path generated from the controller name.
setPathSeparator(String) - Method in class org.springframework.util.AntPathMatcher
Set the path separator to use for pattern parsing.
setPattern(String) - Method in class org.springframework.aop.support.AbstractRegexpMethodPointcut
Convenience method when we have only a single pattern.
setPattern(String) - Method in class org.springframework.aop.support.RegexpMethodPointcutAdvisor
Set the regular expression defining methods to match.
setPattern(String) - Method in class org.springframework.format.datetime.DateFormatter
Set the pattern to use to format date values.
setPattern(String) - Method in class org.springframework.format.number.NumberFormatter
Sets the pattern to use to format number values.
setPatterns(String[]) - Method in class org.springframework.aop.support.AbstractRegexpMethodPointcut
Set the regular expressions defining methods to match.
setPatterns(String[]) - Method in class org.springframework.aop.support.RegexpMethodPointcutAdvisor
Set the regular expressions defining methods to match.
setPeriod(long) - Method in class org.springframework.scheduling.commonj.ScheduledTimerListener
Set the period between repeated task executions, in milliseconds.
setPeriod(long) - Method in class org.springframework.scheduling.concurrent.ScheduledExecutorTask
Set the period between repeated task executions, in milliseconds.
setPeriod(long) - Method in class org.springframework.scheduling.timer.ScheduledTimerTask
Deprecated. Set the period between repeated task executions, in milliseconds.
setPermissionDeniedCodes(String[]) - Method in class org.springframework.jdbc.support.SQLErrorCodes

setPersistenceContexts(Map<String, String>) - Method in class org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
Specify the transactional persistence contexts for EntityManager lookups, as a Map from persistence unit name to persistence context JNDI name (which needs to resolve to an EntityManager instance).
setPersistenceExceptionTranslator(PersistenceExceptionTranslator) - Method in class org.springframework.dao.support.PersistenceExceptionTranslationInterceptor
Specify the PersistenceExceptionTranslator to use.
setPersistenceManagerFactory(PersistenceManagerFactory) - Method in class org.springframework.orm.jdo.JdoAccessor
Set the JDO PersistenceManagerFactory that should be used to create PersistenceManagers.
setPersistenceManagerFactory(PersistenceManagerFactory) - Method in class org.springframework.orm.jdo.JdoTransactionManager
Set the PersistenceManagerFactory that this instance should manage transactions for.
setPersistenceManagerFactory(PersistenceManagerFactory) - Method in class org.springframework.orm.jdo.support.JdoDaoSupport
Set the JDO PersistenceManagerFactory to be used by this DAO.
setPersistenceManagerFactory(PersistenceManagerFactory) - Method in class org.springframework.orm.jdo.support.OpenPersistenceManagerInViewInterceptor
Set the JDO PersistenceManagerFactory that should be used to create PersistenceManagers.
setPersistenceManagerFactory(PersistenceManagerFactory) - Method in class org.springframework.orm.jdo.support.StandardPersistenceManagerProxyBean
Set the target JDO PersistenceManagerFactory that this proxy should delegate to.
setPersistenceManagerFactoryBeanName(String) - Method in class org.springframework.orm.jdo.support.OpenPersistenceManagerInViewFilter
Set the bean name of the PersistenceManagerFactory to fetch from Spring's root application context.
setPersistenceManagerFactoryName(String) - Method in class org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean
Specify the name of the desired PersistenceManagerFactory.
setPersistenceManagerInterface(Class<? extends PersistenceManager>) - Method in class org.springframework.orm.jdo.support.SpringPersistenceManagerProxyBean
Specify the PersistenceManager interface to expose, possibly including vendor extensions.
setPersistenceProvider(PersistenceProvider) - Method in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
Set the PersistenceProvider instance to use for creating the EntityManagerFactory.
setPersistenceProviderClass(Class<? extends PersistenceProvider>) - Method in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
Set the PersistenceProvider implementation class to use for creating the EntityManagerFactory.
setPersistenceProviderClassName(String) - Method in class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo

setPersistenceProviderPackageName(String) - Method in class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo

setPersistenceProviderPackageName(String) - Method in interface org.springframework.orm.jpa.persistenceunit.SmartPersistenceUnitInfo
Set the persistence provider's own package name, for exclusion from class transformation.
setPersistenceUnitManager(PersistenceUnitManager) - Method in class org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean
Set the PersistenceUnitManager to use for obtaining the JPA persistence unit that this FactoryBean is supposed to build an EntityManagerFactory for.
setPersistenceUnitName(String) - Method in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
Specify the name of the EntityManagerFactory configuration.
setPersistenceUnitName(String) - Method in class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo

setPersistenceUnitPostProcessors(PersistenceUnitPostProcessor[]) - Method in class org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean
Set the PersistenceUnitPostProcessors to be applied to the PersistenceUnitInfo used for creating this EntityManagerFactory.
setPersistenceUnitPostProcessors(PersistenceUnitPostProcessor[]) - Method in class org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager
Set the PersistenceUnitPostProcessors to be applied to each PersistenceUnitInfo that has been parsed by this manager.
setPersistenceUnitRootUrl(URL) - Method in class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo

setPersistenceUnits(Map<String, String>) - Method in class org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
Specify the persistence units for EntityManagerFactory lookups, as a Map from persistence unit name to persistence unit JNDI name (which needs to resolve to an EntityManagerFactory instance).
setPersistenceXmlLocation(String) - Method in class org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean
Set the location of the persistence.xml file we want to use.
setPersistenceXmlLocation(String) - Method in class org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager
Specify the location of the persistence.xml files to load.
setPersistenceXmlLocations(String[]) - Method in class org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager
Specify multiple locations of persistence.xml files to load.
setPersistenceXMLSchemaVersion(String) - Method in class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo

setPersistLocation(String) - Method in class org.springframework.jmx.export.metadata.ManagedResource

setPersistName(String) - Method in class org.springframework.jmx.export.metadata.ManagedResource

setPersistPeriod(int) - Method in class org.springframework.jmx.export.metadata.ManagedAttribute

setPersistPeriod(int) - Method in class org.springframework.jmx.export.metadata.ManagedMetric
The persist period for this metric.
setPersistPeriod(int) - Method in class org.springframework.jmx.export.metadata.ManagedResource

setPersistPolicy(String) - Method in class org.springframework.jmx.export.metadata.ManagedAttribute

setPersistPolicy(String) - Method in class org.springframework.jmx.export.metadata.ManagedMetric
The persist policy for this metric.
setPersistPolicy(String) - Method in class org.springframework.jmx.export.metadata.ManagedResource

setPhase(int) - Method in class org.springframework.jca.endpoint.GenericMessageEndpointManager
Specify the phase in which this endpoint manager should be started and stopped.
setPhase(int) - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Specify the phase in which this container should be started and stopped.
setPhase(int) - Method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
Specify the phase in which this scheduler should be started and stopped.
setPlaceholderPrefix(String) - Method in class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
Set the prefix that a placeholder string starts with.
setPlaceholderSuffix(String) - Method in class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
Set the suffix that a placeholder string ends with.
setPointcut(Pointcut) - Method in class org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor
Specify the pointcut targeting the advice.
setPointcut(Pointcut) - Method in class org.springframework.aop.support.DefaultPointcutAdvisor
Specify the pointcut targeting the advice.
setPointcut(Pointcut) - Method in class org.springframework.transaction.interceptor.TransactionProxyFactoryBean
Set a pointcut, i.e a bean that can cause conditional invocation of the TransactionInterceptor depending on method and attributes passed.
setPointcutDeclarationScope(Class) - Method in class org.springframework.aop.aspectj.AspectJExpressionPointcut
Set the declaration scope for the pointcut.
setPoolSize(int) - Method in class org.springframework.scheduling.concurrent.ScheduledExecutorFactoryBean
Set the ScheduledExecutorService's pool size.
setPoolSize(int) - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
Set the ScheduledExecutorService's pool size.
setPoolSize(String) - Method in class org.springframework.scheduling.config.TaskExecutorFactoryBean

setPopulateProtectedVariables(boolean) - Method in class org.springframework.test.AbstractDependencyInjectionSpringContextTests
Deprecated. Set whether to populate protected variables of this test case.
setPort(int) - Method in class org.springframework.mail.javamail.JavaMailSenderImpl
Set the mail server port.
setPort(int) - Method in class org.springframework.remoting.jaxws.SimpleHttpServerJaxWsServiceExporter
Specify the HTTP server's port.
setPort(int) - Method in class org.springframework.remoting.rmi.RmiRegistryFactoryBean
Set the port of the registry for the exported RMI service, i.e.
setPort(int) - Method in class org.springframework.remoting.support.SimpleHttpServerFactoryBean
Specify the HTTP server's port.
setPortInterface(Class) - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Set the JAX-RPC port interface to use.
setPortletClass(Class) - Method in class org.springframework.web.portlet.mvc.PortletWrappingController
Set the class of the Portlet to wrap.
setPortletConfig(PortletConfig) - Method in class org.springframework.web.portlet.context.AbstractRefreshablePortletApplicationContext

setPortletConfig(PortletConfig) - Method in interface org.springframework.web.portlet.context.ConfigurablePortletApplicationContext
Set the PortletConfig for this portlet application context.
setPortletConfig(PortletConfig) - Method in interface org.springframework.web.portlet.context.PortletConfigAware
Set the PortletConfigthat this object runs in.
setPortletConfig(PortletConfig) - Method in class org.springframework.web.portlet.context.StaticPortletApplicationContext

setPortletConfig(PortletConfig) - Method in class org.springframework.web.portlet.handler.SimplePortletPostProcessor

setPortletConfig(PortletConfig) - Method in class org.springframework.web.portlet.mvc.PortletWrappingController

setPortletContext(PortletContext) - Method in class org.springframework.web.portlet.context.AbstractRefreshablePortletApplicationContext

setPortletContext(PortletContext) - Method in interface org.springframework.web.portlet.context.ConfigurablePortletApplicationContext
Set the PortletContext for this portlet application context.
setPortletContext(PortletContext) - Method in class org.springframework.web.portlet.context.PortletApplicationObjectSupport

setPortletContext(PortletContext) - Method in interface org.springframework.web.portlet.context.PortletContextAware
Set the PortletContext that this object runs in.
setPortletContext(PortletContext) - Method in class org.springframework.web.portlet.context.StaticPortletApplicationContext

setPortletContext(PortletContext) - Method in class org.springframework.web.portlet.handler.SimplePortletHandlerAdapter

setPortletContext(PortletContext) - Method in class org.springframework.web.portlet.handler.SimplePortletPostProcessor

setPortletContext(PortletContext) - Method in class org.springframework.web.portlet.multipart.CommonsPortletMultipartResolver

setPortletContext(PortletContext) - Method in class org.springframework.web.portlet.mvc.PortletWrappingController

setPortletContext(PortletContext) - Method in class org.springframework.web.portlet.mvc.SimpleControllerHandlerAdapter

setPortletContextName(String) - Method in class org.springframework.mock.web.portlet.MockPortletContext

setPortletMode(PortletMode) - Method in class org.springframework.mock.web.portlet.MockActionResponse

setPortletMode(PortletMode) - Method in class org.springframework.mock.web.portlet.MockPortletRequest

setPortletMode(PortletMode) - Method in class org.springframework.mock.web.portlet.MockPortletURL

setPortletMode(PortletMode) - Method in class org.springframework.mock.web.portlet.MockStateAwareResponse

setPortletModeMap(Map<String, ?>) - Method in class org.springframework.web.portlet.handler.PortletModeHandlerMapping
Set a Map with PortletModes as keys and handler beans as values.
setPortletModeParameterMap(Map<String, Map<String, ?>>) - Method in class org.springframework.web.portlet.handler.PortletModeParameterHandlerMapping
Set a Map with portlet mode names as keys and another Map as values.
setPortletName(String) - Method in class org.springframework.web.portlet.mvc.PortletWrappingController
Set the name of the Portlet to wrap.
setPortName(String) - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Set the name of the port.
setPortName(String) - Method in class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
Set the name of the port.
setPosition(int) - Method in exception org.springframework.expression.spel.SpelEvaluationException
Set the position in the related expression which gave rise to this exception.
setPostInterceptors(Object[]) - Method in class org.springframework.aop.framework.AbstractSingletonProxyFactoryBean
Set additional interceptors (or advisors) to be applied after the implicit transaction interceptor.
setPostTemplateLoaders(TemplateLoader[]) - Method in class org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
Set a List of TemplateLoaders that will be used to search for templates.
setPragma(String) - Method in class org.springframework.http.HttpHeaders
Sets the (new) value of the Pragma header.
setPreferences(PortletPreferences) - Method in class org.springframework.mock.web.portlet.MockPortletRequest

setPreferencesValidator(PreferencesValidator) - Method in class org.springframework.mock.web.portlet.MockPortletPreferences

setPreferFileSystemAccess(boolean) - Method in class org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
Set whether to prefer file system access for template loading.
setPreferFileSystemAccess(boolean) - Method in class org.springframework.ui.velocity.VelocityEngineFactory
Set whether to prefer file system access for template loading.
setPrefetchSize(int) - Method in class org.springframework.jms.listener.endpoint.JmsActivationSpecConfig
Specify the maximum number of messages to load into a session (a kind of batch size).
setPreFiltered(boolean) - Method in interface org.springframework.aop.framework.Advised
Set whether this proxy configuration is pre-filtered so that it only contains applicable advisors (matching this proxy's target class).
setPreFiltered(boolean) - Method in class org.springframework.aop.framework.AdvisedSupport

setPrefix(String) - Method in class org.springframework.aop.interceptor.AbstractMonitoringInterceptor
Set the text that will get appended to the trace data.
setPrefix(String) - Method in class org.springframework.validation.DefaultMessageCodesResolver
Specify a prefix to be applied to any code built by this resolver.
setPrefix(String) - Method in class org.springframework.web.servlet.mvc.multiaction.InternalPathMethodNameResolver
Specify a common prefix for handler method names.
setPrefix(String) - Method in class org.springframework.web.servlet.mvc.UrlFilenameViewController
Set the prefix to prepend to the request URL filename to build a view name.
setPrefix(String) - Method in class org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator
Set the prefix to prepend to generated view names.
setPrefix(String) - Method in class org.springframework.web.servlet.view.UrlBasedViewResolver
Set the prefix that gets prepended to view names when building a URL.
setPrefixJson(boolean) - Method in class org.springframework.http.converter.json.MappingJacksonHttpMessageConverter
Indicates whether the JSON output by this view should be prefixed with "{} &&".
setPrefixJson(boolean) - Method in class org.springframework.web.servlet.view.json.MappingJacksonJsonView
Indicates whether the JSON output by this view should be prefixed with "{} &&".
setPreInterceptors(Object[]) - Method in class org.springframework.aop.framework.AbstractSingletonProxyFactoryBean
Set additional interceptors (or advisors) to be applied before the implicit transaction interceptor, e.g.
setPrepareConnection(boolean) - Method in class org.springframework.orm.hibernate3.HibernateTransactionManager
Set whether to prepare the underlying JDBC Connection of a transactional Hibernate Session, that is, whether to apply a transaction-specific isolation level and/or the transaction's read-only flag to the underlying JDBC Connection.
setPreparerFactoryClass(Class<? extends PreparerFactory>) - Method in class org.springframework.web.servlet.view.tiles2.TilesConfigurer
Set the PreparerFactory implementation to use.
setPreTemplateLoaders(TemplateLoader[]) - Method in class org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
Set a List of TemplateLoaders that will be used to search for templates.
setPreventDispatchLoop(boolean) - Method in class org.springframework.web.servlet.view.InternalResourceView
Set whether to explicitly prevent dispatching back to the current handler path.
setPreviousFlushMode(FlushMode) - Method in class org.springframework.orm.hibernate3.SessionHolder

setPreviousIsolationLevel(Integer) - Method in class org.springframework.jdbc.datasource.JdbcTransactionObjectSupport

setPrimary(boolean) - Method in interface org.springframework.beans.factory.config.BeanDefinition
Set whether this bean is a primary autowire candidate.
setPrimary(boolean) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Set whether this bean is a primary autowire candidate.
setPrimitivesDefaultedForNullValue(boolean) - Method in class org.springframework.jdbc.core.BeanPropertyRowMapper
Set whether we're defaulting Java primitives in the case of mapping a null value from corresponding database fields.
setPriority(int) - Method in class org.springframework.jms.core.JmsTemplate
Set the priority of a message when sending.
setPriority(int) - Method in class org.springframework.mail.javamail.MimeMessageHelper
Set the priority ("X-Priority" header) of the message.
setProblemReporter(ProblemReporter) - Method in class org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Specify which ProblemReporter to use.
setProblemReporter(ProblemReporter) - Method in class org.springframework.context.annotation.ConfigurationClassPostProcessor
Set the ProblemReporter to use.
setProcedureName(String) - Method in class org.springframework.jdbc.core.metadata.CallMetaDataContext
Specify the name of the procedure.
setProcedureName(String) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Set the name of the stored procedure.
setPropagationBehavior(int) - Method in class org.springframework.transaction.support.DefaultTransactionDefinition
Set the propagation behavior.
setPropagationBehaviorName(String) - Method in class org.springframework.transaction.support.DefaultTransactionDefinition
Set the propagation behavior by the name of the corresponding constant in TransactionDefinition, e.g.
setProperties(Properties) - Method in class org.springframework.core.io.support.PropertiesLoaderSupport
Set local properties, e.g.
setProperties(Properties) - Method in class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo

setProperties(Properties) - Method in class org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource
Parses the given properties into a name/attribute map.
setPropertiesArray(Properties[]) - Method in class org.springframework.core.io.support.PropertiesLoaderSupport
Set local properties, e.g.
setPropertiesPersister(PropertiesPersister) - Method in class org.springframework.beans.factory.support.PropertiesBeanDefinitionReader
Set the PropertiesPersister to use for parsing properties files.
setPropertiesPersister(PropertiesPersister) - Method in class org.springframework.context.support.ReloadableResourceBundleMessageSource
Set the PropertiesPersister to use for parsing properties files.
setPropertiesPersister(PropertiesPersister) - Method in class org.springframework.core.io.support.PropertiesLoaderSupport
Set the PropertiesPersister to use for parsing properties files.
setProperty(String) - Method in class org.springframework.beans.support.MutableSortDefinition
Set the property to compare.
setProperty(String, String) - Method in class org.springframework.mock.web.portlet.MockBaseURL

setProperty(String, String) - Method in class org.springframework.mock.web.portlet.MockPortalContext

setProperty(String, String) - Method in class org.springframework.mock.web.portlet.MockPortletRequest
Set a single value for the specified property.
setProperty(String, String) - Method in class org.springframework.mock.web.portlet.MockPortletResponse

setPropertyAccessors(List<PropertyAccessor>) - Method in class org.springframework.expression.spel.support.StandardEvaluationContext

setPropertyEditorRegistrar(PropertyEditorRegistrar) - Method in class org.springframework.web.bind.support.ConfigurableWebBindingInitializer
Specify a single PropertyEditorRegistrar to be applied to every DataBinder.
setPropertyEditorRegistrar(PropertyEditorRegistrar) - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Specify a single PropertyEditorRegistrar to be applied to every DataBinder that this controller uses.
setPropertyEditorRegistrar(PropertyEditorRegistrar) - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Specify a single PropertyEditorRegistrar to be applied to every DataBinder that this controller uses.
setPropertyEditorRegistrars(PropertyEditorRegistrar[]) - Method in class org.springframework.beans.factory.config.CustomEditorConfigurer
Specify the PropertyEditorRegistrars to apply to beans defined within the current application context.
setPropertyEditorRegistrars(PropertyEditorRegistrar[]) - Method in class org.springframework.web.bind.support.ConfigurableWebBindingInitializer
Specify multiple PropertyEditorRegistrars to be applied to every DataBinder.
setPropertyEditorRegistrars(PropertyEditorRegistrar[]) - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Specify one or more PropertyEditorRegistrars to be applied to every DataBinder that this controller uses.
setPropertyEditorRegistrars(PropertyEditorRegistrar[]) - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Specify multiple PropertyEditorRegistrars to be applied to every DataBinder that this controller uses.
setPropertyPath(String) - Method in class org.springframework.beans.factory.config.PropertyPathFactoryBean
Specify the property path to apply to the target.
setPropertyValue(PropertyValue) - Method in class org.springframework.beans.AbstractPropertyAccessor

setPropertyValue(String, Object) - Method in class org.springframework.beans.AbstractPropertyAccessor
Actually set a property value.
setPropertyValue(String, Object) - Method in class org.springframework.beans.BeanWrapperImpl

setPropertyValue(PropertyValue) - Method in class org.springframework.beans.BeanWrapperImpl

setPropertyValue(String, Object) - Method in class org.springframework.beans.DirectFieldAccessor

setPropertyValue(String, Object) - Method in interface org.springframework.beans.PropertyAccessor
Set the specified value as current property value.
setPropertyValue(PropertyValue) - Method in interface org.springframework.beans.PropertyAccessor
Set the specified value as current property value.
setPropertyValueAt(PropertyValue, int) - Method in class org.springframework.beans.MutablePropertyValues
Modify a PropertyValue object held in this object.
setPropertyValues(Map<?, ?>) - Method in class org.springframework.beans.AbstractPropertyAccessor

setPropertyValues(PropertyValues) - Method in class org.springframework.beans.AbstractPropertyAccessor

setPropertyValues(PropertyValues, boolean) - Method in class org.springframework.beans.AbstractPropertyAccessor

setPropertyValues(PropertyValues, boolean, boolean) - Method in class org.springframework.beans.AbstractPropertyAccessor

setPropertyValues(MutablePropertyValues) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Specify property values for this bean, if any.
setPropertyValues(Map<?, ?>) - Method in interface org.springframework.beans.PropertyAccessor
Perform a batch update from a Map.
setPropertyValues(PropertyValues) - Method in interface org.springframework.beans.PropertyAccessor
The preferred way to perform a batch update.
setPropertyValues(PropertyValues, boolean) - Method in interface org.springframework.beans.PropertyAccessor
Perform a batch update with more control over behavior.
setPropertyValues(PropertyValues, boolean, boolean) - Method in interface org.springframework.beans.PropertyAccessor
Perform a batch update with full control over behavior.
setProtocol(String) - Method in class org.springframework.mail.javamail.JavaMailSenderImpl
Set the mail protocol.
setProtocol(String) - Method in class org.springframework.mock.web.MockHttpServletRequest

setProviderClass(Class<? extends ValidationProvider>) - Method in class org.springframework.validation.beanvalidation.LocalValidatorFactoryBean
Specify the desired provider class, if any.
setProxyClassLoader(ClassLoader) - Method in class org.springframework.aop.framework.AbstractSingletonProxyFactoryBean
Set the ClassLoader to generate the proxy class in.
setProxyClassLoader(ClassLoader) - Method in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
Set the ClassLoader to generate the proxy class in.
setProxyClassLoader(ClassLoader) - Method in class org.springframework.aop.framework.ProxyFactoryBean
Set the ClassLoader to generate the proxy class in.
setProxyFactory(BurlapProxyFactory) - Method in class org.springframework.remoting.caucho.BurlapClientInterceptor
Set the BurlapProxyFactory instance to use.
setProxyFactory(HessianProxyFactory) - Method in class org.springframework.remoting.caucho.HessianClientInterceptor
Set the HessianProxyFactory instance to use.
setProxyInterface(Class) - Method in class org.springframework.jmx.access.MBeanProxyFactoryBean
Set the interface that the generated proxy will implement.
setProxyInterface(Class) - Method in class org.springframework.jndi.JndiObjectFactoryBean
Specify the proxy interface to use for the JNDI object.
setProxyInterfaces(Class[]) - Method in class org.springframework.aop.framework.AbstractSingletonProxyFactoryBean
Specify the set of interfaces being proxied.
setProxyInterfaces(Class[]) - Method in class org.springframework.aop.framework.ProxyFactoryBean
Set the names of the interfaces we're proxying.
setProxyInterfaces(Class[]) - Method in class org.springframework.jndi.JndiObjectFactoryBean
Specify multiple proxy interfaces to use for the JNDI object.
setProxyTargetClass(boolean) - Method in class org.springframework.aop.framework.ProxyConfig
Set whether to proxy the target class directly, instead of just proxying specific interfaces.
setPublicScope(boolean) - Method in class org.springframework.mock.web.portlet.MockCacheControl

setPublishContext(boolean) - Method in class org.springframework.web.portlet.FrameworkPortlet
Set whether to publish this portlet's context as a PortletContext attribute, available to all objects in the web container.
setPublishContext(boolean) - Method in class org.springframework.web.servlet.FrameworkServlet
Set whether to publish this servlet's context as a ServletContext attribute, available to all objects in the web container.
setPublishEvents(boolean) - Method in class org.springframework.web.portlet.FrameworkPortlet
Set whether this portlet should publish a PortletRequestHandledEvent at the end of each request.
setPublishEvents(boolean) - Method in class org.springframework.web.servlet.FrameworkServlet
Set whether this servlet should publish a ServletRequestHandledEvent at the end of each request.
setPubSubDomain(boolean) - Method in class org.springframework.jms.connection.JmsTransactionManager102
Deprecated. Configure the transaction manager with knowledge of the JMS domain used.
setPubSubDomain(boolean) - Method in class org.springframework.jms.connection.SingleConnectionFactory102
Deprecated. Configure the factory with knowledge of the JMS domain used.
setPubSubDomain(boolean) - Method in class org.springframework.jms.listener.endpoint.JmsActivationSpecConfig

setPubSubDomain(boolean) - Method in class org.springframework.jms.support.destination.JmsDestinationAccessor
Configure the destination accessor with knowledge of the JMS domain used.
setPubSubNoLocal(boolean) - Method in class org.springframework.jms.core.JmsTemplate
Set whether to inhibit the delivery of messages published by its own connection.
setPubSubNoLocal(boolean) - Method in class org.springframework.jms.listener.AbstractPollingMessageListenerContainer
Set whether to inhibit the delivery of messages published by its own connection.
setPubSubNoLocal(boolean) - Method in class org.springframework.jms.listener.SimpleMessageListenerContainer
Set whether to inhibit the delivery of messages published by its own connection.
setQualifier(String) - Method in class org.springframework.transaction.interceptor.DefaultTransactionAttribute
Associate a qualifier value with this transaction attribute.
setQuartzProperties(Properties) - Method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
Set Quartz properties, like "org.quartz.threadPool.class".
setQueryCacheRegion(String) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
Set the name of the cache region for queries executed by this template.
setQueryString(String) - Method in class org.springframework.mock.web.MockHttpServletRequest

setQueryTimeout(int) - Method in class org.springframework.jdbc.core.JdbcTemplate
Set the query timeout for statements that this JdbcTemplate executes.
setQueryTimeout(int) - Method in class org.springframework.jdbc.object.RdbmsOperation
Set the query timeout for statements that this RDBMS operation executes.
setQueue(Queue) - Method in class org.springframework.jms.remoting.JmsInvokerClientInterceptor
Set the target Queue to send invoker requests to.
setQueueCapacity(int) - Method in class org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor
Set the capacity for the ThreadPoolExecutor's BlockingQueue.
setQueueCapacity(int) - Method in class org.springframework.scheduling.concurrent.ThreadPoolExecutorFactoryBean
Set the capacity for the ThreadPoolExecutor's BlockingQueue.
setQueueCapacity(int) - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
Set the capacity for the ThreadPoolExecutor's BlockingQueue.
setQueueCapacity(int) - Method in class org.springframework.scheduling.config.TaskExecutorFactoryBean

setQueueName(String) - Method in class org.springframework.jms.remoting.JmsInvokerClientInterceptor
Set the name of target queue to send invoker requests to.
setRaiseExceptions(boolean) - Method in class org.springframework.aop.aspectj.AspectJAdviceParameterNameDiscoverer
Indicate whether IllegalArgumentException and AspectJAdviceParameterNameDiscoverer.AmbiguousBindingException must be thrown as appropriate in the case of failing to deduce advice parameter names.
setReadOnly(String, boolean) - Method in class org.springframework.mock.web.portlet.MockPortletPreferences

setReadOnly(boolean) - Method in class org.springframework.transaction.support.DefaultTransactionDefinition
Set whether to optimize as read-only transaction.
setReadonly(String) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
Sets the value of the 'readonly' attribute.
setReadTimeout(int) - Method in class org.springframework.http.client.CommonsClientHttpRequestFactory
Set the socket read timeout for the underlying HttpClient.
setReadTimeout(long) - Method in class org.springframework.remoting.caucho.HessianClientInterceptor
Set the timeout to use when waiting for a reply from the Hessian service.
setReadTimeout(int) - Method in class org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor
Set the socket read timeout for the underlying HttpClient.
setReceiveTimeout(long) - Method in class org.springframework.jms.core.JmsTemplate
Set the timeout to use for receive calls (in milliseconds).
setReceiveTimeout(long) - Method in class org.springframework.jms.listener.AbstractPollingMessageListenerContainer
Set the timeout to use for receive calls, in milliseconds.
setReceiveTimeout(long) - Method in class org.springframework.jms.remoting.JmsInvokerClientInterceptor
Set the timeout to use for receiving the response message for a request (in milliseconds).
setReconnectOnException(boolean) - Method in class org.springframework.jms.connection.SingleConnectionFactory
Specify whether the single Connection should be reset (to be subsequently renewed) when a JMSException is reported by the underlying Connection.
setRecordName(String) - Method in class org.springframework.jca.cci.core.support.CommAreaRecord

setRecordShortDescription(String) - Method in class org.springframework.jca.cci.core.support.CommAreaRecord

setRecoveryInterval(long) - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Specify the interval between recovery attempts, in milliseconds.
setRedirectAction(boolean) - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Specify whether the action phase is expected to call ActionResponse.sendRedirect(java.lang.String).
setRedirectContextRelative(boolean) - Method in class org.springframework.web.servlet.view.UrlBasedViewResolver
Set whether to interpret a given redirect URL that starts with a slash ("/") as relative to the current ServletContext, i.e.
setRedirectHttp10Compatible(boolean) - Method in class org.springframework.web.servlet.view.UrlBasedViewResolver
Set whether redirects should stay compatible with HTTP 1.0 clients.
setReference(Reference) - Method in class org.springframework.jca.cci.connection.DelegatingConnectionFactory

setRefreshCheckDelay(long) - Method in class org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource
Set the delay between refresh checks, in milliseconds.
setRefreshHomeOnConnectFailure(boolean) - Method in class org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor
Set whether to refresh the EJB home on connect failure.
setRefreshOnConnectFailure(boolean) - Method in class org.springframework.jmx.access.MBeanClientInterceptor
Set whether to refresh the MBeanServer connection on connect failure.
setRefreshServiceAfterConnectFailure(boolean) - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Set whether to refresh the JAX-RPC service on connect failure, that is, whenever a JAX-RPC invocation throws a RemoteException.
setRefreshStubOnConnectFailure(boolean) - Method in class org.springframework.remoting.rmi.JndiRmiClientInterceptor
Set whether to refresh the RMI stub on connect failure.
setRefreshStubOnConnectFailure(boolean) - Method in class org.springframework.remoting.rmi.RmiClientInterceptor
Set whether to refresh the RMI stub on connect failure.
setRefreshTimestamp(long) - Method in class org.springframework.context.support.ReloadableResourceBundleMessageSource.PropertiesHolder

setRegisterTraceInterceptor(boolean) - Method in class org.springframework.remoting.support.RemoteExporter
Set whether to register a RemoteInvocationTraceInterceptor for exported services.
setRegisterWithFactory(boolean) - Method in class org.springframework.jmx.support.MBeanServerFactoryBean
Set whether to register the MBeanServer with the MBeanServerFactory, making it available through MBeanServerFactory.findMBeanServer().
setRegistrationBehavior(int) - Method in class org.springframework.jmx.support.MBeanRegistrationSupport
Specify what action should be taken when attempting to register an MBean under an ObjectName that already exists.
setRegistrationBehaviorName(String) - Method in class org.springframework.jmx.support.MBeanRegistrationSupport
Set the registration behavior by the name of the corresponding constant, e.g.
setRegistry(Registry) - Method in class org.springframework.remoting.rmi.RmiServiceExporter
Specify the RMI registry to register the exported service with.
setRegistryClientSocketFactory(RMIClientSocketFactory) - Method in class org.springframework.remoting.rmi.RmiClientInterceptor
Set a custom RMI client socket factory to use for accessing the RMI registry.
setRegistryClientSocketFactory(RMIClientSocketFactory) - Method in class org.springframework.remoting.rmi.RmiServiceExporter
Set a custom RMI client socket factory to use for the RMI registry.
setRegistryHost(String) - Method in class org.springframework.remoting.rmi.RmiServiceExporter
Set the host of the registry for the exported RMI service, i.e.
setRegistryPort(int) - Method in class org.springframework.remoting.rmi.RmiServiceExporter
Set the port of the registry for the exported RMI service, i.e.
setRegistryServerSocketFactory(RMIServerSocketFactory) - Method in class org.springframework.remoting.rmi.RmiServiceExporter
Set a custom RMI server socket factory to use for the RMI registry.
setRejectedExecutionHandler(RejectedExecutionHandler) - Method in class org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor
Set the RejectedExecutionHandler to use for the ThreadPoolExecutor.
setRejectedExecutionHandler(RejectedExecutionHandler) - Method in class org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
Set the RejectedExecutionHandler to use for the ThreadPoolExecutor.
setRejectedExecutionHandler(Object) - Method in class org.springframework.scheduling.config.TaskExecutorFactoryBean

setReleaseResourcesAfterRead(boolean) - Method in class org.springframework.jdbc.support.lob.OracleLobHandler
Set whether to agressively release any resources used by the LOB.
setRemoteAddr(String) - Method in class org.springframework.mock.web.MockHttpServletRequest

setRemoteHost(String) - Method in class org.springframework.mock.web.MockHttpServletRequest

setRemoteInvocationExecutor(RemoteInvocationExecutor) - Method in class org.springframework.remoting.support.RemoteInvocationBasedExporter
Set the RemoteInvocationExecutor to use for this exporter.
setRemoteInvocationFactory(RemoteInvocationFactory) - Method in class org.springframework.jms.remoting.JmsInvokerClientInterceptor
Set the RemoteInvocationFactory to use for this accessor.
setRemoteInvocationFactory(RemoteInvocationFactory) - Method in class org.springframework.remoting.rmi.JndiRmiClientInterceptor
Set the RemoteInvocationFactory to use for this accessor.
setRemoteInvocationFactory(RemoteInvocationFactory) - Method in class org.springframework.remoting.support.RemoteInvocationBasedAccessor
Set the RemoteInvocationFactory to use for this accessor.
setRemotePort(int) - Method in class org.springframework.mock.web.MockHttpServletRequest

setRemoteUser(String) - Method in class org.springframework.mock.web.MockHttpServletRequest

setRemoteUser(String) - Method in class org.springframework.mock.web.portlet.MockPortletRequest

setRenderCommandAndErrors(ActionRequest, Object, BindException) - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Set the command object and errors object for the render phase.
setRenderedAttributes(Set<String>) - Method in class org.springframework.web.servlet.view.json.MappingJacksonJsonView
Sets the attributes in the model that should be rendered by this view.
setRenderParameter(String, String) - Method in class org.springframework.mock.web.portlet.MockActionResponse

setRenderParameter(String, String[]) - Method in class org.springframework.mock.web.portlet.MockActionResponse

setRenderParameter(String, String) - Method in class org.springframework.mock.web.portlet.MockStateAwareResponse

setRenderParameter(String, String[]) - Method in class org.springframework.mock.web.portlet.MockStateAwareResponse

setRenderParameters(Map<String, String[]>) - Method in class org.springframework.mock.web.portlet.MockActionResponse

setRenderParameters(EventRequest) - Method in class org.springframework.mock.web.portlet.MockEventResponse

setRenderParameters(Map<String, String[]>) - Method in class org.springframework.mock.web.portlet.MockStateAwareResponse

setRenderParameters(String[]) - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Specify the list of parameters that should be passed forward from the action phase to the render phase whenever the form is re-rendered or when AbstractFormController.passRenderParameters(javax.portlet.ActionRequest, javax.portlet.ActionResponse) is called.
setRenderWhenMinimized(boolean) - Method in class org.springframework.web.portlet.handler.AbstractHandlerExceptionResolver
Set if the resolver should render a view when the portlet is in a minimized window.
setRenderWhenMinimized(boolean) - Method in class org.springframework.web.portlet.mvc.AbstractController
Set if the controller should render an view when the portlet is in a minimized window.
setReobtainTransactionalConnections(boolean) - Method in class org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy
Specify whether to reobtain the target Connection for each operation performed within a transaction.
setReplaceExistingBinding(boolean) - Method in class org.springframework.remoting.rmi.RmiServiceExporter
Set whether to replace an existing binding in the RMI registry, that is, whether to simply override an existing binding with the specified service in case of a naming conflict in the registry.
setReplyTo(String) - Method in class org.springframework.mail.javamail.MimeMailMessage

setReplyTo(InternetAddress) - Method in class org.springframework.mail.javamail.MimeMessageHelper

setReplyTo(String) - Method in class org.springframework.mail.javamail.MimeMessageHelper

setReplyTo(String, String) - Method in class org.springframework.mail.javamail.MimeMessageHelper

setReplyTo(String) - Method in interface org.springframework.mail.MailMessage

setReplyTo(String) - Method in class org.springframework.mail.SimpleMailMessage

setReportDataKey(String) - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
Set the name of the model attribute that represents the report data.
setReportDataKey(String) - Method in class org.springframework.web.servlet.view.jasperreports.JasperReportsViewResolver
Set the reportDataKey the view class should use.
setRepositoryAnnotationType(Class<? extends Annotation>) - Method in class org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor
Set the 'repository' annotation type.
setRequestAttributes(RequestAttributes) - Static method in class org.springframework.web.context.request.RequestContextHolder
Bind the given RequestAttributes to the current thread, not exposing it as inheritable for child threads.
setRequestAttributes(RequestAttributes, boolean) - Static method in class org.springframework.web.context.request.RequestContextHolder
Bind the given RequestAttributes to the current thread.
setRequestBody(HttpInvokerClientConfiguration, PostMethod, ByteArrayOutputStream) - Method in class org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor
Set the given serialized remote invocation as request body.
setRequestContextAttribute(String) - Method in class org.springframework.web.servlet.view.AbstractView
Set the name of the RequestContext attribute for this view.
setRequestContextAttribute(String) - Method in class org.springframework.web.servlet.view.UrlBasedViewResolver
Set the name of the RequestContext attribute for all views.
setRequestedSessionId(String) - Method in class org.springframework.mock.web.MockHttpServletRequest

setRequestedSessionIdFromCookie(boolean) - Method in class org.springframework.mock.web.MockHttpServletRequest

setRequestedSessionIdFromURL(boolean) - Method in class org.springframework.mock.web.MockHttpServletRequest

setRequestedSessionIdValid(boolean) - Method in class org.springframework.mock.web.MockHttpServletRequest

setRequestedSessionIdValid(boolean) - Method in class org.springframework.mock.web.portlet.MockPortletRequest

setRequestFactory(ClientHttpRequestFactory) - Method in class org.springframework.http.client.support.HttpAccessor
Set the request factory that this accessor uses for obtaining HttpRequests.
setRequestURI(String) - Method in class org.springframework.mock.web.MockHttpServletRequest

setRequiredAnnotationType(Class<? extends Annotation>) - Method in class org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor
Set the 'required' annotation type, to be used on bean property setter methods.
setRequiredFields(String...) - Method in class org.springframework.validation.DataBinder
Register fields that are required for each binding process.
setRequiredParameterName(String) - Method in class org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor
Set the name of a parameter of the annotation that specifies whether it is required.
setRequiredParameterValue(boolean) - Method in class org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor
Set the boolean value that marks a dependency as required
setRequiredRowsAffected(int) - Method in class org.springframework.jdbc.object.SqlUpdate
Set the exact number of rows that must be affected by this update.
setRequiredType(Class<T>) - Method in class org.springframework.jdbc.core.SingleColumnRowMapper
Set the type that each result object is expected to match.
setRequireSession(boolean) - Method in class org.springframework.web.portlet.handler.PortletContentGenerator
Set whether a session should be required to handle requests.
setRequireSession(boolean) - Method in class org.springframework.web.servlet.support.WebContentGenerator
Set whether a session should be required to handle requests.
setResolveLazily(boolean) - Method in class org.springframework.web.multipart.commons.CommonsMultipartResolver
Set whether to resolve the multipart request lazily at the time of file or parameter access.
setResolveLazily(boolean) - Method in class org.springframework.web.portlet.multipart.CommonsPortletMultipartResolver
Set whether to resolve the multipart request lazily at the time of file or parameter access.
setResource(Resource) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Set the resource that this bean definition came from (for the purpose of showing context in case of errors).
setResourceAdapter(ResourceAdapter) - Method in class org.springframework.jca.endpoint.GenericMessageEndpointManager
Set the JCA ResourceAdapter to manage endpoints for.
setResourceAdapter(ResourceAdapter) - Method in class org.springframework.jca.support.ResourceAdapterFactoryBean
Specify the target JCA ResourceAdapter, passed in as configured instance which hasn't been started yet.
setResourceAdapterClass(Class) - Method in class org.springframework.jca.support.ResourceAdapterFactoryBean
Specify the target JCA ResourceAdapter as class, to be instantiated with its default configuration.
setResourceBundle(Locale, ResourceBundle) - Method in class org.springframework.mock.web.portlet.MockPortletConfig

setResourceDescription(String) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Set a description of the resource that this bean definition came from (for the purpose of showing context in case of errors).
setResourceDescription(String) - Method in class org.springframework.beans.factory.support.BeanDefinitionBuilder
Deprecated. since Spring 2.5, in favor of preparing this on the raw BeanDefinition object
setResourceFactory(BeanFactory) - Method in class org.springframework.context.annotation.CommonAnnotationBeanPostProcessor
Specify the factory for objects to be injected into @Resource / @WebServiceRef / @EJB annotated fields and setter methods, for name attributes and default names.
setResourceID(String) - Method in class org.springframework.mock.web.portlet.MockResourceRequest

setResourceID(String) - Method in class org.springframework.mock.web.portlet.MockResourceURL

setResourceLoader(ResourceLoader) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinitionReader
Set the ResourceLoader to use for resource locations.
setResourceLoader(ResourceLoader) - Method in class org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider
Set the ResourceLoader to use for resource locations.
setResourceLoader(ResourceLoader) - Method in interface org.springframework.context.ResourceLoaderAware
Set the ResourceLoader that this object runs in.
setResourceLoader(ResourceLoader) - Method in class org.springframework.context.support.GenericApplicationContext
Set a ResourceLoader to use for this context.
setResourceLoader(ResourceLoader) - Method in class org.springframework.context.support.ReloadableResourceBundleMessageSource
Set the ResourceLoader to use for loading bundle properties files.
setResourceLoader(ResourceLoader) - Method in class org.springframework.jdbc.config.SortedResourcesFactoryBean

setResourceLoader(ResourceLoader) - Method in class org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean

setResourceLoader(ResourceLoader) - Method in class org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean

setResourceLoader(ResourceLoader) - Method in class org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager

setResourceLoader(ResourceLoader) - Method in class org.springframework.scheduling.quartz.SchedulerAccessor

setResourceLoader(ResourceLoader) - Method in class org.springframework.scripting.support.ScriptFactoryPostProcessor

setResourceLoader(ResourceLoader) - Method in class org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
Set the Spring ResourceLoader to use for loading FreeMarker template files.
setResourceLoader(ResourceLoader) - Method in class org.springframework.ui.velocity.VelocityEngineFactory
Set the Spring ResourceLoader to use for loading Velocity template files.
setResourceLoaderPath(String) - Method in class org.springframework.ui.velocity.VelocityEngineFactory
Set the Velocity resource loader path via a Spring resource location.
setResourcePattern(String) - Method in class org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider
Set the resource pattern to use when scanning the classpath.
setResourceRef(boolean) - Method in class org.springframework.jndi.JndiLocatorSupport
Set whether the lookup occurs in a J2EE container, i.e.
setResourceRef(boolean) - Method in class org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
Set whether the lookup occurs in a J2EE container, i.e.
setRestTemplate(RestTemplate) - Method in class org.springframework.web.client.support.RestGatewaySupport
Sets the RestTemplate for the gateway.
setResultSetType(int) - Method in class org.springframework.jdbc.core.CallableStatementCreatorFactory
Set whether to use prepared statements that return a specific type of ResultSet.
setResultSetType(int) - Method in class org.springframework.jdbc.core.PreparedStatementCreatorFactory
Set whether to use prepared statements that return a specific type of ResultSet.
setResultSetType(int) - Method in class org.springframework.jdbc.object.RdbmsOperation
Set whether to use statements that return a specific type of ResultSet.
setResultsMapCaseInsensitive(boolean) - Method in class org.springframework.jdbc.core.JdbcTemplate
Set whether execution of a CallableStatement will return the results in a Map that uses case insensitive names for the parameters.
setResultType(Class) - Method in class org.springframework.beans.factory.config.PropertyPathFactoryBean
Specify the type of the result from evaluating the property path.
setResultType(Class<T>) - Method in class org.springframework.jdbc.object.SqlFunction
Specify the type that the result object is required to match.
setReturnGeneratedKeys(boolean) - Method in class org.springframework.jdbc.core.PreparedStatementCreatorFactory
Set whether prepared statements should be capable of returning auto-generated keys.
setReturnGeneratedKeys(boolean) - Method in class org.springframework.jdbc.object.RdbmsOperation
Set whether prepared statements should be capable of returning auto-generated keys.
setReturningName(String) - Method in class org.springframework.aop.aspectj.AbstractAspectJAdvice

setReturningName(String) - Method in class org.springframework.aop.aspectj.AspectJAdviceParameterNameDiscoverer
If afterReturning advice binds the return value, the returning variable name must be specified.
setReturningName(String) - Method in class org.springframework.aop.aspectj.AspectJAfterReturningAdvice

setReturningNameNoCheck(String) - Method in class org.springframework.aop.aspectj.AbstractAspectJAdvice
We need to hold the returning name at this level for argument binding calculations, this method allows the afterReturning advice subclass to set the name.
setReturnValueRequired(boolean) - Method in class org.springframework.jdbc.core.metadata.CallMetaDataContext
Specify whether a return value is required.
setReturnValueRequired(boolean) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Specify whether the call requires a rerurn value.
setRole(int) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Set the role hint for this BeanDefinition.
setRole(int) - Method in class org.springframework.beans.factory.support.BeanDefinitionBuilder
Set the role of this definition.
setRollbackOnCommitFailure(boolean) - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Set whether doRollback should be performed on failure of the doCommit call.
setRollbackOnly() - Method in class org.springframework.transaction.jta.ManagedTransactionAdapter

setRollbackOnly() - Method in class org.springframework.transaction.jta.UserTransactionAdapter

setRollbackOnly() - Method in class org.springframework.transaction.support.AbstractTransactionStatus

setRollbackOnly() - Method in class org.springframework.transaction.support.ResourceHolderSupport
Mark the resource transaction as rollback-only.
setRollbackOnly() - Method in interface org.springframework.transaction.TransactionStatus
Set the transaction rollback-only.
setRollbackRules(List<RollbackRuleAttribute>) - Method in class org.springframework.transaction.interceptor.RuleBasedTransactionAttribute
Set the list of RollbackRuleAttribute objects (and/or NoRollbackRuleAttribute objects) to apply.
setRoot(String) - Method in class org.springframework.web.servlet.view.xslt.AbstractXsltView
Deprecated. The document root element name.
setRootHandler(Object) - Method in class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
Set the root handler for this handler mapping, that is, the handler to be registered for the root path ("/").
setRootObject(Object) - Method in class org.springframework.expression.spel.support.StandardEvaluationContext

setRootObject(Object, TypeDescriptor) - Method in class org.springframework.expression.spel.support.StandardEvaluationContext

setRoundingMode(RoundingMode) - Method in class org.springframework.format.number.CurrencyFormatter
Specify the rounding mode to use for decimal parsing.
setRowMapperClass(Class) - Method in class org.springframework.jdbc.object.GenericSqlQuery

setRows(String) - Method in class org.springframework.web.servlet.tags.form.TextareaTag
Set the value of the 'rows' attribute.
setRowsExpected(int) - Method in class org.springframework.jdbc.object.SqlQuery
Set the number of rows expected.
setRunnable(Runnable) - Method in class org.springframework.scheduling.commonj.ScheduledTimerListener
Set the Runnable to schedule as TimerListener.
setRunnable(Runnable) - Method in class org.springframework.scheduling.concurrent.ScheduledExecutorTask
Set the Runnable to schedule as executor task.
setRunnable(Runnable) - Method in class org.springframework.scheduling.timer.ScheduledTimerTask
Deprecated. Set the Runnable to schedule as TimerTask.
setSavepoint(Object) - Method in class org.springframework.transaction.support.AbstractTransactionStatus
Set a savepoint for this transaction.
setSavepointAllowed(boolean) - Method in class org.springframework.jdbc.datasource.JdbcTransactionObjectSupport

setSavepointManager(SavepointManager) - Method in class org.springframework.orm.jpa.EntityManagerHolder

setScheduledExecutor(ScheduledExecutorService) - Method in class org.springframework.scheduling.concurrent.ConcurrentTaskScheduler
Specify the JDK 1.5 scheduled executor to delegate to.
setScheduledExecutorTasks(ScheduledExecutorTask[]) - Method in class org.springframework.scheduling.concurrent.ScheduledExecutorFactoryBean
Register a list of ScheduledExecutorTask objects with the ScheduledExecutorService that this FactoryBean creates.
setScheduledTimerListeners(ScheduledTimerListener[]) - Method in class org.springframework.scheduling.commonj.TimerManagerFactoryBean
Register a list of ScheduledTimerListener objects with the TimerManager that this FactoryBean creates.
setScheduledTimerTasks(ScheduledTimerTask[]) - Method in class org.springframework.scheduling.timer.TimerFactoryBean
Deprecated. Register a list of ScheduledTimerTask objects with the Timer that this FactoryBean creates.
setScheduler(Object) - Method in class org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor
Set the TaskScheduler that will invoke the scheduled methods, or a ScheduledExecutorService to be wrapped as a TaskScheduler.
setScheduler(Object) - Method in class org.springframework.scheduling.config.ScheduledTaskRegistrar

setScheduler(Scheduler) - Method in class org.springframework.scheduling.quartz.SchedulerAccessorBean
Specify the Quartz Scheduler instance to operate on.
setSchedulerContext(SchedulerContext) - Method in interface org.springframework.scheduling.quartz.SchedulerContextAware
Set the SchedulerContext of the current Quartz Scheduler.
setSchedulerContext(SchedulerContext) - Method in class org.springframework.scheduling.quartz.SpringBeanJobFactory

setSchedulerContextAsMap(Map) - Method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
Register objects in the Scheduler context via a given Map.
setSchedulerFactoryClass(Class) - Method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
Set the Quartz SchedulerFactory implementation to use.
setSchedulerListeners(SchedulerListener[]) - Method in class org.springframework.scheduling.quartz.SchedulerAccessor
Specify Quartz SchedulerListeners to be registered with the Scheduler.
setSchedulerName(String) - Method in class org.springframework.scheduling.quartz.SchedulerAccessorBean
Specify the Quartz Scheduler to operate on via its scheduler name in the Spring application context or also in the Quartz SchedulerRepository.
setSchedulerName(String) - Method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
Set the name of the Scheduler to create via the SchedulerFactory.
setSchema(Resource) - Method in class org.springframework.oxm.jaxb.Jaxb2Marshaller
Set the schema resource to use for validation.
setSchemaLanguage(String) - Method in class org.springframework.oxm.jaxb.Jaxb2Marshaller
Set the schema language.
setSchemaName(String) - Method in class org.springframework.jdbc.core.metadata.CallMetaDataContext
Secify the name of the schema.
setSchemaName(String) - Method in class org.springframework.jdbc.core.metadata.TableMetaDataContext
Set the name of the schema for this context.
setSchemaName(String) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcCall
Set the schema name to use,
setSchemaName(String) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Set the name of the schema for this insert
setSchemas(Resource[]) - Method in class org.springframework.oxm.jaxb.Jaxb2Marshaller
Set the schema resources to use for validation.
setSchemaUpdate(boolean) - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Set whether to execute a schema update after SessionFactory initialization.
setScheme(String) - Method in class org.springframework.mock.web.MockHttpServletRequest

setScheme(String) - Method in class org.springframework.mock.web.portlet.MockPortletRequest

setScope(String) - Method in interface org.springframework.beans.factory.config.BeanDefinition
Override the target scope of this bean, specifying a new scope name.
setScope(String) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Set the name of the target scope for the bean.
setScope(String) - Method in class org.springframework.beans.factory.support.BeanDefinitionBuilder
Set the scope of this definition.
setScope(String) - Method in class org.springframework.web.servlet.tags.EvalTag
Set the scope to export the evaluation result to.
setScope(String) - Method in class org.springframework.web.servlet.tags.MessageTag
Set the scope to export the variable to.
setScope(String) - Method in class org.springframework.web.servlet.tags.TransformTag
Set the scope to export the variable to.
setScope(String) - Method in class org.springframework.web.servlet.tags.UrlTag
Set the scope to export the URL variable to.
setScopeAnnotationType(Class<? extends Annotation>) - Method in class org.springframework.context.annotation.AnnotationScopeMetadataResolver
Set the type of annotation that is checked for by this AnnotationScopeMetadataResolver.
setScopedProxyMode(ScopedProxyMode) - Method in class org.springframework.context.annotation.ClassPathBeanDefinitionScanner
Specify the proxy behavior for non-singleton scoped beans.
setScopedProxyMode(ScopedProxyMode) - Method in class org.springframework.context.annotation.ScopeMetadata
Set the proxy-mode to be applied to the scoped instance.
setScopeMetadataResolver(ScopeMetadataResolver) - Method in class org.springframework.context.annotation.AnnotatedBeanDefinitionReader
Set the ScopeMetadataResolver to use for detected bean classes.
setScopeMetadataResolver(ScopeMetadataResolver) - Method in class org.springframework.context.annotation.AnnotationConfigApplicationContext
Set the ScopeMetadataResolver to use for detected bean classes.
setScopeMetadataResolver(ScopeMetadataResolver) - Method in class org.springframework.context.annotation.ClassPathBeanDefinitionScanner
Set the ScopeMetadataResolver to use for detected bean classes.
setScopeName(String) - Method in class org.springframework.context.annotation.ScopeMetadata
Set the name of the scope.
setScopes(Map<String, Object>) - Method in class org.springframework.beans.factory.config.CustomScopeConfigurer
Specify the custom scopes that are to be registered.
setScreenContentKey(String) - Method in class org.springframework.web.servlet.view.velocity.VelocityLayoutView
Set the name of the context key that will hold the content of the screen within the layout template.
setScreenContentKey(String) - Method in class org.springframework.web.servlet.view.velocity.VelocityLayoutViewResolver
Set the name of the context key that will hold the content of the screen within the layout template.
setScript(String) - Method in class org.springframework.scripting.support.StaticScriptSource
Set a fresh script String, overriding the previous script.
setScripts(Resource[]) - Method in class org.springframework.jdbc.datasource.init.ResourceDatabasePopulator
Set the scripts to execute to populate the database.
setSearchContextAttributes(boolean) - Method in class org.springframework.web.context.support.ServletContextPropertyPlaceholderConfigurer
Set whether to search for matching a ServletContext attribute before checking a ServletContext init parameter.
setSearchSystemEnvironment(boolean) - Method in class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
Set whether to search for a matching system environment variable if no matching system property has been found.
setSecure(boolean) - Method in class org.springframework.mock.web.MockHttpServletRequest

setSecure(boolean) - Method in class org.springframework.mock.web.portlet.MockBaseURL

setSecure(boolean) - Method in class org.springframework.mock.web.portlet.MockPortletRequest

setSecurityContext(AccessControlContext) - Method in class org.springframework.beans.BeanWrapperImpl
Set the security context used during the invocation of the wrapped instance methods.
setSecurityContextProvider(SecurityContextProvider) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Set the security context provider for this bean factory.
setSendCollectionType(boolean) - Method in class org.springframework.remoting.caucho.HessianClientInterceptor
Set whether to send the Java collection type for each serialized collection.
setSendCollectionType(boolean) - Method in class org.springframework.remoting.caucho.HessianExporter
Set whether to send the Java collection type for each serialized collection.
setSentDate(Date) - Method in class org.springframework.mail.javamail.MimeMailMessage

setSentDate(Date) - Method in class org.springframework.mail.javamail.MimeMessageHelper
Set the sent-date of the message.
setSentDate(Date) - Method in interface org.springframework.mail.MailMessage

setSentDate(Date) - Method in class org.springframework.mail.SimpleMailMessage

setSeparator(String) - Method in class org.springframework.core.io.support.LocalizedResourceHelper
Set the separator to use inbetween file name parts.
setSeparator(String) - Method in class org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator
Set the value that will replace '/' as the separator in the view name.
setSerializationId(String) - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
Specify an id for serialization purposes, allowing this BeanFactory to be deserialized from this id back into the BeanFactory object, if needed.
setSerializerFactory(SerializerFactory) - Method in class org.springframework.remoting.caucho.HessianClientInterceptor
Specify the Hessian SerializerFactory to use.
setSerializerFactory(SerializerFactory) - Method in class org.springframework.remoting.caucho.HessianExporter
Specify the Hessian SerializerFactory to use.
setServer(MBeanServerConnection) - Method in class org.springframework.jmx.access.MBeanClientInterceptor
Set the MBeanServerConnection used to connect to the MBean which all invocations are routed to.
setServer(MBeanServerConnection) - Method in class org.springframework.jmx.access.NotificationListenerRegistrar
Set the MBeanServerConnection used to connect to the MBean which all invocations are routed to.
setServer(MBeanServer) - Method in class org.springframework.jmx.support.MBeanRegistrationSupport
Specify the MBeanServer instance with which all beans should be registered.
setServer(HttpServer) - Method in class org.springframework.remoting.jaxws.SimpleHttpServerJaxWsServiceExporter
Specify an existing HTTP server to register the web service contexts with.
setServerName(String) - Method in class org.springframework.mock.web.MockHttpServletRequest

setServerName(String) - Method in class org.springframework.mock.web.portlet.MockPortletRequest

setServerPort(int) - Method in class org.springframework.mock.web.MockHttpServletRequest

setServerPort(int) - Method in class org.springframework.mock.web.portlet.MockPortletRequest

setServerSocketFactory(RMIServerSocketFactory) - Method in class org.springframework.remoting.rmi.RmiRegistryFactoryBean
Set a custom RMI server socket factory to use for the RMI registry.
setServerSocketFactory(RMIServerSocketFactory) - Method in class org.springframework.remoting.rmi.RmiServiceExporter
Set a custom RMI server socket factory to use for exporting the service.
setService(Object) - Method in class org.springframework.remoting.support.RemoteExporter
Set the service to export.
setServiceFactory(ServiceFactory) - Method in class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
Deprecated. Set the ServiceFactory instance to use.
setServiceFactoryClass(Class) - Method in class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
Deprecated. Set the ServiceFactory class to use, for example "org.apache.axis.client.ServiceFactory".
setServiceInterface(Class) - Method in class org.springframework.jms.remoting.JmsInvokerProxyFactoryBean
Set the interface that the proxy must implement.
setServiceInterface(Class) - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Set the interface of the service that this factory should create a proxy for.
setServiceInterface(Class<?>) - Method in class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
Set the interface of the service that this factory should create a proxy for.
setServiceInterface(Class) - Method in class org.springframework.remoting.rmi.JndiRmiClientInterceptor
Set the interface of the service to access.
setServiceInterface(Class) - Method in class org.springframework.remoting.support.RemoteAccessor
Set the interface of the service to access.
setServiceInterface(Class) - Method in class org.springframework.remoting.support.RemoteExporter
Set the interface of the service to export.
setServiceLocatorExceptionClass(Class) - Method in class org.springframework.beans.factory.config.ServiceLocatorFactoryBean
Set the exception class that the service locator should throw if service lookup failed.
setServiceLocatorInterface(Class) - Method in class org.springframework.beans.factory.config.ServiceLocatorFactoryBean
Set the service locator interface to use, which must have one or more methods with the signatures MyType xxx() or MyType xxx(MyIdType id) (typically, MyService getService() or MyService getService(String id)).
setServiceMappings(Properties) - Method in class org.springframework.beans.factory.config.ServiceLocatorFactoryBean
Set mappings between service ids (passed into the service locator) and bean names (in the bean factory).
setServiceName(String) - Method in class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
Deprecated. Set the name of the service to look up.
setServiceName(String) - Method in class org.springframework.remoting.jaxws.LocalJaxWsServiceFactory
Set the name of the service to look up.
setServiceName(String) - Method in class org.springframework.remoting.rmi.RmiServiceExporter
Set the name of the exported RMI service, i.e.
setServicePort(int) - Method in class org.springframework.remoting.rmi.RmiServiceExporter
Set the port that the exported RMI service will use.
setServicePostProcessors(JaxRpcServicePostProcessor[]) - Method in class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
Deprecated. Set the JaxRpcServicePostProcessors to be applied to JAX-RPC Service instances created by this factory.
setServiceType(Class) - Method in class org.springframework.beans.factory.serviceloader.AbstractServiceLoaderBasedFactoryBean
Specify the desired service type (typically the service's public API).
setServiceUrl(String) - Method in class org.springframework.jmx.access.MBeanClientInterceptor
Set the service URL of the remote MBeanServer.
setServiceUrl(String) - Method in class org.springframework.jmx.access.NotificationListenerRegistrar
Set the service URL of the remote MBeanServer.
setServiceUrl(String) - Method in class org.springframework.jmx.support.ConnectorServerFactoryBean
Set the service URL for the JMXConnectorServer.
setServiceUrl(String) - Method in class org.springframework.jmx.support.MBeanServerConnectionFactoryBean
Set the service URL of the remote MBeanServer.
setServiceUrl(String) - Method in class org.springframework.remoting.support.UrlBasedRemoteAccessor
Set the URL of this remote accessor's target service.
setServlet(ActionServlet) - Method in class org.springframework.web.struts.ActionSupport
Deprecated. Initialize the WebApplicationContext for this Action.
setServlet(ActionServlet) - Method in class org.springframework.web.struts.DispatchActionSupport
Deprecated. Initialize the WebApplicationContext for this Action.
setServlet(ActionServlet) - Method in class org.springframework.web.struts.LookupDispatchActionSupport
Deprecated. Initialize the WebApplicationContext for this Action.
setServlet(ActionServlet) - Method in class org.springframework.web.struts.MappingDispatchActionSupport
Deprecated. Initialize the WebApplicationContext for this Action.
setServletClass(Class) - Method in class org.springframework.web.servlet.mvc.ServletWrappingController
Set the class of the servlet to wrap.
setServletConfig(ServletConfig) - Method in interface org.springframework.web.context.ConfigurableWebApplicationContext
Set the ServletConfig for this web application context.
setServletConfig(ServletConfig) - Method in interface org.springframework.web.context.ServletConfigAware
Set the ServletConfig that this object runs in.
setServletConfig(ServletConfig) - Method in class org.springframework.web.context.support.AbstractRefreshableWebApplicationContext

setServletConfig(ServletConfig) - Method in class org.springframework.web.context.support.StaticWebApplicationContext

setServletConfig(ServletConfig) - Method in class org.springframework.web.servlet.handler.SimpleServletPostProcessor

setServletContext(ServletContext) - Method in interface org.springframework.web.context.ConfigurableWebApplicationContext
Set the ServletContext for this web application context.
setServletContext(ServletContext) - Method in interface org.springframework.web.context.ServletContextAware
Set the ServletContext that this object runs in.
setServletContext(ServletContext) - Method in class org.springframework.web.context.support.AbstractRefreshableWebApplicationContext

setServletContext(ServletContext) - Method in class org.springframework.web.context.support.GenericWebApplicationContext
Set the ServletContext that this WebApplicationContext runs in.
setServletContext(ServletContext) - Method in class org.springframework.web.context.support.ServletContextAttributeExporter

setServletContext(ServletContext) - Method in class org.springframework.web.context.support.ServletContextAttributeFactoryBean

setServletContext(ServletContext) - Method in class org.springframework.web.context.support.ServletContextFactoryBean
Deprecated.
setServletContext(ServletContext) - Method in class org.springframework.web.context.support.ServletContextParameterFactoryBean

setServletContext(ServletContext) - Method in class org.springframework.web.context.support.ServletContextPropertyPlaceholderConfigurer
Set the ServletContext to resolve placeholders against.
setServletContext(ServletContext) - Method in class org.springframework.web.context.support.StaticWebApplicationContext
Set the ServletContext that this WebApplicationContext runs in.
setServletContext(ServletContext) - Method in class org.springframework.web.context.support.WebApplicationObjectSupport

setServletContext(ServletContext) - Method in class org.springframework.web.filter.GenericFilterBean
Stores the ServletContext that the bean factory runs in.
setServletContext(ServletContext) - Method in class org.springframework.web.multipart.commons.CommonsMultipartResolver

setServletContext(ServletContext) - Method in class org.springframework.web.servlet.handler.SimpleServletPostProcessor

setServletContext(ServletContext) - Method in class org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer
Initialize the TaglibFactory for the given ServletContext.
setServletContext(ServletContext) - Method in class org.springframework.web.servlet.view.tiles2.TilesConfigurer

setServletContext(ServletContext) - Method in class org.springframework.web.servlet.view.velocity.VelocityConfigurer

setServletContextName(String) - Method in class org.springframework.mock.web.MockServletContext

setServletName(String) - Method in class org.springframework.web.servlet.mvc.ServletForwardingController
Set the name of the servlet to forward to, i.e.
setServletName(String) - Method in class org.springframework.web.servlet.mvc.ServletWrappingController
Set the name of the servlet to wrap.
setServletPath(String) - Method in class org.springframework.mock.web.MockHttpServletRequest

setSession(Session) - Method in class org.springframework.mail.javamail.JavaMailSenderImpl
Set the JavaMail Session, possibly pulled from JNDI.
setSession(HttpSession) - Method in class org.springframework.mock.web.MockHttpServletRequest

setSession(PortletSession) - Method in class org.springframework.mock.web.portlet.MockPortletRequest

setSessionAcknowledgeMode(int) - Method in class org.springframework.jms.support.JmsAccessor
Set the JMS acknowledgement mode that is used when creating a JMS Session to send a message.
setSessionAcknowledgeModeName(String) - Method in class org.springframework.jms.support.JmsAccessor
Set the JMS acknowledgement mode by the name of the corresponding constant in the JMS Session interface, e.g.
setSessionAttribute(PortletRequest, String, Object) - Static method in class org.springframework.web.portlet.util.PortletUtils
Set the session attribute with the given name to the given value under the PortletSession.PORTLET_SCOPE.
setSessionAttribute(PortletRequest, String, Object, int) - Static method in class org.springframework.web.portlet.util.PortletUtils
Set the session attribute with the given name to the given value in the given scope.
setSessionAttribute(HttpServletRequest, String, Object) - Static method in class org.springframework.web.util.WebUtils
Set the session attribute with the given name to the given value.
setSessionAttributeStore(SessionAttributeStore) - Method in class org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter
Specify the strategy to store session attributes with.
setSessionAttributeStore(SessionAttributeStore) - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
Specify the strategy to store session attributes with.
setSessionCacheSize(int) - Method in class org.springframework.jms.connection.CachingConnectionFactory
Specify the desired size for the JMS Session cache (per JMS Session type).
setSessionContext(SessionContext) - Method in class org.springframework.ejb.support.AbstractSessionBean
Set the session context for this EJB.
setSessionFactory(SessionFactory) - Method in class org.springframework.orm.hibernate3.HibernateAccessor
Set the Hibernate SessionFactory that should be used to create Hibernate Sessions.
setSessionFactory(SessionFactory) - Method in class org.springframework.orm.hibernate3.HibernateTransactionManager
Set the SessionFactory that this instance should manage transactions for.
setSessionFactory(SessionFactory) - Method in class org.springframework.orm.hibernate3.support.HibernateDaoSupport
Set the Hibernate SessionFactory to be used by this DAO.
setSessionFactoryBeanName(String) - Method in class org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
Set the bean name of the SessionFactory to fetch from Spring's root application context.
setSessionForm(boolean) - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Activate/deactivate session form mode.
setSessionForm(boolean) - Method in class org.springframework.web.servlet.mvc.AbstractFormController
Deprecated. Activate/deactivate session form mode.
setSessionTransacted(boolean) - Method in class org.springframework.jms.listener.AbstractPollingMessageListenerContainer

setSessionTransacted(boolean) - Method in class org.springframework.jms.support.JmsAccessor
Set the transaction mode that is used when creating a JMS Session.
setShareableResources(String[]) - Method in class org.springframework.jndi.support.SimpleJndiBeanFactory
Set a list of names of shareable JNDI resources, which this factory is allowed to cache once obtained.
setShared(boolean) - Method in class org.springframework.cache.ehcache.EhCacheManagerFactoryBean
Set whether the EHCache CacheManager should be shared (as a singleton at the VM level) or independent (typically local within the application).
setShared(boolean) - Method in class org.springframework.scheduling.commonj.TimerManagerAccessor
Specify whether the TimerManager obtained by this FactoryBean is a shared instance ("true") or an independent instance ("false").
setShouldStopConnections(boolean) - Method in class org.springframework.jms.connection.DelegatingConnectionFactory
Indicate whether Connections obtained from the target factory are supposed to be stopped before closed ("true") or simply closed ("false").
setShowPassword(boolean) - Method in class org.springframework.web.servlet.tags.form.PasswordInputTag
Is the password value to be rendered?
setShowSql(boolean) - Method in class org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter
Set whether to show SQL in the log (or in the console).
setShutdownDelay(int) - Method in class org.springframework.remoting.jaxws.SimpleHttpServerJaxWsServiceExporter
Specify the number of seconds to wait until HTTP exchanges have completed when shutting down the HTTP server.
setShutdownDelay(int) - Method in class org.springframework.remoting.support.SimpleHttpServerFactoryBean
Specify the number of seconds to wait until HTTP exchanges have completed when shutting down the HTTP server.
setSingleSession(boolean) - Method in class org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
Set whether to use a single session for each request.
setSingleSession(boolean) - Method in class org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor
Set whether to use a single session for each request.
setSingleton(boolean) - Method in class org.springframework.aop.framework.ProxyFactoryBean
Set the value of the singleton property.
setSingleton(boolean) - Method in class org.springframework.beans.factory.config.AbstractFactoryBean
Set if a singleton should be created, or a new object on each request otherwise.
setSingleton(boolean) - Method in class org.springframework.beans.factory.config.MethodInvokingFactoryBean
Set if a singleton should be created, or a new object on each request else.
setSingleton(boolean) - Method in class org.springframework.beans.factory.config.PropertiesFactoryBean
Set whether a shared 'singleton' Properties instance should be created, or rather a new Properties instance on each request.
setSingleton(boolean) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Deprecated. since Spring 2.5, in favor of AbstractBeanDefinition.setScope(java.lang.String)
setSingleton(boolean) - Method in class org.springframework.beans.factory.support.BeanDefinitionBuilder
Deprecated. since Spring 2.5, in favor of BeanDefinitionBuilder.setScope(java.lang.String)
setSize(String) - Method in class org.springframework.web.servlet.tags.form.InputTag
Set the value of the 'size' attribute.
setSize(String) - Method in class org.springframework.web.servlet.tags.form.SelectTag
Set the value of the HTML 'size' attribute rendered on the final 'select' element.
setSkipResultsProcessing(boolean) - Method in class org.springframework.jdbc.core.JdbcTemplate
Set whether results processing should be skipped.
setSkipUndeclaredResults(boolean) - Method in class org.springframework.jdbc.core.JdbcTemplate
Set whether undelared results should be skipped.
setSoapActionUri(String) - Method in class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
Set the SOAP action URI to specify on the stub.
setSort(SortDefinition) - Method in class org.springframework.beans.support.PagedListHolder
Set the sort definition for this holder.
setSource(Object) - Method in class org.springframework.beans.BeanMetadataAttribute
Set the configuration source Object for this metadata element.
setSource(Object) - Method in class org.springframework.beans.BeanMetadataAttributeAccessor
Set the configuration source Object for this metadata element.
setSource(Object) - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues.ValueHolder
Set the configuration source Object for this metadata element.
setSource(Object) - Method in class org.springframework.beans.factory.config.RuntimeBeanNameReference
Set the configuration source Object for this metadata element.
setSource(Object) - Method in class org.springframework.beans.factory.config.RuntimeBeanReference
Set the configuration source Object for this metadata element.
setSource(Object) - Method in class org.springframework.beans.factory.config.TypedStringValue
Set the configuration source Object for this metadata element.
setSource(Object) - Method in class org.springframework.beans.factory.support.BeanDefinitionBuilder
Deprecated. since Spring 2.5, in favor of preparing this on the raw BeanDefinition object
setSource(Object) - Method in class org.springframework.beans.factory.support.ManagedList
Set the configuration source Object for this metadata element.
setSource(Object) - Method in class org.springframework.beans.factory.support.ManagedMap
Set the configuration source Object for this metadata element.
setSource(Object) - Method in class org.springframework.beans.factory.support.ManagedProperties
Set the configuration source Object for this metadata element.
setSource(Object) - Method in class org.springframework.beans.factory.support.ManagedSet
Set the configuration source Object for this metadata element.
setSource(Object) - Method in class org.springframework.beans.factory.support.MethodOverride
Set the configuration source Object for this metadata element.
setSource(Object) - Method in class org.springframework.beans.factory.xml.DocumentDefaultsDefinition
Set the configuration source Object for this metadata element.
setSource(List<E>) - Method in class org.springframework.beans.support.PagedListHolder
Set the source list for this holder.
setSourceExtractor(SourceExtractor) - Method in class org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Specify the SourceExtractor to use.
setSourceExtractor(SourceExtractor) - Method in class org.springframework.context.annotation.ConfigurationClassPostProcessor
Set the SourceExtractor to use for generated bean definitions that correspond to Bean factory methods.
setSourceKey(String) - Method in class org.springframework.web.servlet.view.xslt.XsltView
Set the name of the model attribute that represents the XSLT Source.
setSourceKey(String) - Method in class org.springframework.web.servlet.view.xslt.XsltViewResolver
Set the name of the model attribute that represents the XSLT Source.
setSourceList(List) - Method in class org.springframework.beans.factory.config.ListFactoryBean
Set the source List, typically populated via XML "list" elements.
setSourceMap(Map) - Method in class org.springframework.beans.factory.config.MapFactoryBean
Set the source Map, typically populated via XML "map" elements.
setSourceSet(Set) - Method in class org.springframework.beans.factory.config.SetFactoryBean
Set the source Set, typically populated via XML "set" elements.
setSpecifiedTypeName(String) - Method in class org.springframework.beans.factory.config.TypedStringValue
Set the type name as actually specified for this particular value, if any.
setSql(String) - Method in class org.springframework.jdbc.object.RdbmsOperation
Set the SQL executed by this operation.
setSqlErrorCodes(SQLErrorCodes) - Method in class org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator
Set custom error codes to be used for translation.
setSqlMapClient(SqlMapClient) - Method in class org.springframework.orm.ibatis.SqlMapClientTemplate
Set the iBATIS Database Layer SqlMapClient that defines the mapped statements.
setSqlMapClient(SqlMapClient) - Method in class org.springframework.orm.ibatis.support.SqlMapClientDaoSupport
Set the iBATIS Database Layer SqlMapClient to work with.
setSqlMapClientProperties(Properties) - Method in class org.springframework.orm.ibatis.SqlMapClientFactoryBean
Set optional properties to be passed into the SqlMapClientBuilder, as alternative to a <properties> tag in the sql-map-config.xml file.
setSqlMapClientTemplate(SqlMapClientTemplate) - Method in class org.springframework.orm.ibatis.support.SqlMapClientDaoSupport
Set the SqlMapClientTemplate for this DAO explicitly, as an alternative to specifying a SqlMapClient.
setSqlReadyForUse(boolean) - Method in class org.springframework.jdbc.object.SqlCall
Set whether the SQL can be used as is.
setSqlScriptEncoding(String) - Method in class org.springframework.jdbc.datasource.init.ResourceDatabasePopulator
Specify the encoding for SQL scripts, if different from the platform encoding.
setSqlScriptEncoding(String) - Method in class org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
Deprecated. Specify the encoding for SQL scripts, if different from the platform encoding.
setSqlScriptEncoding(String) - Method in class org.springframework.test.context.junit38.AbstractTransactionalJUnit38SpringContextTests
Specify the encoding for SQL scripts, if different from the platform encoding.
setSqlScriptEncoding(String) - Method in class org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests
Specify the encoding for SQL scripts, if different from the platform encoding.
setSqlScriptEncoding(String) - Method in class org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests
Specify the encoding for SQL scripts, if different from the platform encoding.
setStandalone(Boolean) - Method in class org.springframework.oxm.jibx.JibxMarshaller
Set the document standalone flag for marshalling.
setStartDelay(long) - Method in class org.springframework.scheduling.quartz.CronTriggerBean
Set the start delay in milliseconds.
setStartDelay(long) - Method in class org.springframework.scheduling.quartz.SimpleTriggerBean
Set the delay before starting the job for the first time.
setStartupDelay(int) - Method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
Set the number of seconds to wait after initialization before starting the scheduler asynchronously.
setStatementParameters(Object[], PreparedStatement, int[]) - Static method in class org.springframework.jdbc.core.BatchUpdateUtils

setStaticField(String) - Method in class org.springframework.beans.factory.config.FieldRetrievingFactoryBean
Set a fully qualified static field name to retrieve, e.g.
setStaticMethod(String) - Method in class org.springframework.util.MethodInvoker
Set a fully qualified static method name to invoke, e.g.
setStatus(int) - Method in class org.springframework.mock.web.MockHttpServletResponse

setStatus(int, String) - Method in class org.springframework.mock.web.MockHttpServletResponse

setStatusCode(HttpStatus) - Method in interface org.springframework.http.server.ServerHttpResponse
Set the HTTP status code of the response.
setStatusCode(HttpStatus) - Method in class org.springframework.http.server.ServletServerHttpResponse

setStatusCode(HttpStatus) - Method in class org.springframework.web.servlet.view.RedirectView
Set the status code for this view.
setStatusCodes(Properties) - Method in class org.springframework.web.servlet.handler.SimpleMappingExceptionResolver
Set the HTTP status code that this exception resolver will apply for a given resolved error view.
setStoresLowerCaseIdentifiers(boolean) - Method in class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
Specify whether the database uses lower case for identifiers
setStoresLowerCaseIdentifiers(boolean) - Method in class org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
Specify whether identifiers use lower case
setStoresUpperCaseIdentifiers(boolean) - Method in class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
Specify whether the database uses upper case for identifiers
setStoresUpperCaseIdentifiers(boolean) - Method in class org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
Specify whether identifiers use upper case
setStreamAsLob(boolean) - Method in class org.springframework.jdbc.support.lob.DefaultLobHandler
Specify whether to submit a binary stream / character stream to the JDBC driver as explicit LOB content, using the JDBC 4.0 setBlob / setClob method with a stream argument.
setStreamDriver(HierarchicalStreamDriver) - Method in class org.springframework.oxm.xstream.XStreamMarshaller
Set the XStream hierarchical stream driver to be used with stream readers and writers.
setStripExtension(boolean) - Method in class org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator
Set whether or not file extensions should be stripped from the URI when generating the view name.
setStripLeadingSlash(boolean) - Method in class org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator
Set whether or not leading slashes should be stripped from the URI when generating the view name.
setStripTrailingSlash(boolean) - Method in class org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator
Set whether or not trailing slashes should be stripped from the URI when generating the view name.
setStyle(int) - Method in class org.springframework.format.datetime.DateFormatter
Set the style to use to format date values.
setStylesheetLocation(Resource) - Method in class org.springframework.web.servlet.view.xslt.AbstractXsltView
Deprecated. Set the location of the XSLT stylesheet.
setSubject(String) - Method in class org.springframework.mail.javamail.MimeMailMessage

setSubject(String) - Method in class org.springframework.mail.javamail.MimeMessageHelper
Set the subject of the message, using the correct encoding.
setSubject(String) - Method in interface org.springframework.mail.MailMessage

setSubject(String) - Method in class org.springframework.mail.SimpleMailMessage

setSubReportDataKeys(String[]) - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
Set the list of names corresponding to the model parameters that will contain data source objects for use in sub-reports.
setSubReportDataKeys(String[]) - Method in class org.springframework.web.servlet.view.jasperreports.JasperReportsViewResolver
Set the subReportDataKeys the view class should use.
setSubReportUrls(Properties) - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
Specify resource paths which must be loaded as instances of JasperReport and passed to the JasperReports engine for rendering as sub-reports, under the same keys as in this mapping.
setSubReportUrls(Properties) - Method in class org.springframework.web.servlet.view.jasperreports.JasperReportsViewResolver
Set the subReportUrls the view class should use.
setSubscriptionDurable(boolean) - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
Set whether to make the subscription durable.
setSubscriptionDurable(boolean) - Method in class org.springframework.jms.listener.endpoint.JmsActivationSpecConfig

setSuccessView(String) - Method in class org.springframework.web.portlet.mvc.SimpleFormController
Deprecated. Set the name of the view that should be shown on successful submit.
setSuccessView(String) - Method in class org.springframework.web.servlet.mvc.SimpleFormController
Deprecated. Set the name of the view that should be shown on successful submit.
setSuffix(String) - Method in class org.springframework.aop.interceptor.AbstractMonitoringInterceptor
Set the text that will get prepended to the trace data.
setSuffix(String) - Method in class org.springframework.web.servlet.mvc.multiaction.InternalPathMethodNameResolver
Specify a common suffix for handler method names.
setSuffix(String) - Method in class org.springframework.web.servlet.mvc.UrlFilenameViewController
Set the suffix to append to the request URL filename to build a view name.
setSuffix(String) - Method in class org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator
Set the suffix to append to generated view names.
setSuffix(String) - Method in class org.springframework.web.servlet.view.UrlBasedViewResolver
Set the suffix that gets appended to view names when building a URL.
setSupportedClasses(Class[]) - Method in class org.springframework.oxm.xstream.XStreamMarshaller
Set the classes supported by this marshaller.
setSupportedMediaTypes(List<MediaType>) - Method in class org.springframework.http.converter.AbstractHttpMessageConverter
Set the list of MediaType objects supported by this converter.
setSupportedMethods(String[]) - Method in class org.springframework.web.servlet.support.WebContentGenerator
Set the HTTP methods that this content generator should support.
setSupportsCatalogsInProcedureCalls(boolean) - Method in class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
Specify whether the database supports the use of catalog name in procedure calls
setSupportsSchemasInProcedureCalls(boolean) - Method in class org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
Specify whether the database supports the use of schema name in procedure calls
setSuppressClose(boolean) - Method in class org.springframework.jdbc.datasource.SingleConnectionDataSource
Set whether the returned Connection should be a close-suppressing proxy or the physical Connection.
setSuppressNamespaces(boolean) - Method in class org.springframework.oxm.castor.CastorMarshaller
Sets whether this marshaller should output namespaces.
setSuppressXsiType(boolean) - Method in class org.springframework.oxm.castor.CastorMarshaller
Sets whether this marshaller should output the xsi:type attribute.
setSynchedLocalTransactionAllowed(boolean) - Method in class org.springframework.jms.connection.TransactionAwareConnectionFactoryProxy
Set whether to allow for a local JMS transaction that is synchronized with a Spring-managed transaction (where the main transaction might be a JDBC-based one for a specific DataSource, for example), with the JMS transaction committing right after the main transaction.
setSynchronizedWithTransaction(boolean) - Method in class org.springframework.transaction.support.ResourceHolderSupport
Mark the resource as synchronized with a transaction.
setSynchronizeOnSession(boolean) - Method in class org.springframework.web.portlet.mvc.AbstractController
Set if controller execution should be synchronized on the session, to serialize parallel invocations from the same client.
setSynchronizeOnSession(boolean) - Method in class org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter
Set if controller execution should be synchronized on the session, to serialize parallel invocations from the same client.
setSynchronizeOnSession(boolean) - Method in class org.springframework.web.servlet.mvc.AbstractController
Set if controller execution should be synchronized on the session, to serialize parallel invocations from the same client.
setSynchronizeOnSession(boolean) - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
Set if controller execution should be synchronized on the session, to serialize parallel invocations from the same client.
setSyncTaskExecutor(TaskExecutor) - Method in class org.springframework.jca.work.SimpleTaskWorkManager
Specify the TaskExecutor to use for synchronous work execution (i.e.
setSynthetic(boolean) - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Set whether this bean definition is 'synthetic', that is, not defined by the application itself (for example, an infrastructure bean such as a helper for auto-proxying, created through <aop:config>).
setSystemPropertiesMode(int) - Method in class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
Set how to check system properties: as fallback, as override, or never.
setSystemPropertiesModeName(String) - Method in class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
Set the system property mode by the name of the corresponding constant, e.g.
setSystemTreePath(String) - Method in class org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer
Set the path in the system preferences tree to use for resolving placeholders.
setTabindex(String) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Set the value of the 'tabindex' attribute.
setTableName(String) - Method in class org.springframework.jdbc.core.metadata.TableMetaDataContext
Set the name of the table for this context.
setTableName(String) - Method in class org.springframework.jdbc.core.simple.AbstractJdbcInsert
Set the name of the table for this insert
setTarget(Object) - Method in class org.springframework.aop.framework.AbstractSingletonProxyFactoryBean
Set the target object, that is, the bean to be wrapped with a transactional proxy.
setTarget(Object) - Method in class org.springframework.aop.framework.AdvisedSupport
Set the given object as target.
setTarget(String) - Method in class org.springframework.web.servlet.tags.form.FormTag
Set the value of the 'target' attribute.
setTargetBeanName(String) - Method in class org.springframework.aop.config.MethodLocatingFactoryBean
Set the name of the bean to locate the Method on.
setTargetBeanName(String) - Method in class org.springframework.aop.scope.ScopedProxyFactoryBean
Set the name of the bean that is to be scoped.
setTargetBeanName(String) - Method in class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
Set the name of the target bean in the factory.
setTargetBeanName(String) - Method in class org.springframework.beans.factory.config.BeanReferenceFactoryBean
Set the name of the target bean.
setTargetBeanName(String) - Method in class org.springframework.beans.factory.config.ObjectFactoryCreatingFactoryBean
Set the name of the target bean.
setTargetBeanName(String) - Method in class org.springframework.beans.factory.config.PropertyPathFactoryBean
Specify the name of a target bean to apply the property path to.
setTargetBeanName(String) - Method in class org.springframework.beans.factory.config.ProviderCreatingFactoryBean
Set the name of the target bean.
setTargetBeanName(String) - Method in class org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean
Set the name of the target bean in the Spring BeanFactory.
setTargetBeanName(String) - Method in class org.springframework.web.filter.DelegatingFilterProxy
Set the name of the target bean in the Spring application context.
setTargetClass(Class) - Method in class org.springframework.aop.framework.AdvisedSupport
Set a target class to be proxied, indicating that the proxy should be castable to the given class.
setTargetClass(Class) - Method in class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
Specify the target class explicitly, to avoid any kind of access to the target bean (for example, to avoid initialization of a FactoryBean instance).
setTargetClass(Class) - Method in class org.springframework.beans.factory.config.FieldRetrievingFactoryBean
Set the target class on which the field is defined.
setTargetClass(Class) - Method in class org.springframework.oxm.castor.CastorMarshaller
Set the Castor target class.
setTargetClass(Class<?>) - Method in class org.springframework.oxm.jibx.JibxMarshaller
Set the target class for this instance.
setTargetClass(Class) - Method in class org.springframework.util.MethodInvoker
Set the target class on which to call the target method.
setTargetClasses(Class[]) - Method in class org.springframework.oxm.castor.CastorMarshaller
Set the Castor target classes.
setTargetConnectionFactory(ConnectionFactory) - Method in class org.springframework.jca.cci.connection.DelegatingConnectionFactory
Set the target ConnectionFactory that this ConnectionFactory should delegate to.
setTargetConnectionFactory(ConnectionFactory) - Method in class org.springframework.jms.connection.DelegatingConnectionFactory
Set the target ConnectionFactory that this ConnectionFactory should delegate to.
setTargetConnectionFactory(ConnectionFactory) - Method in class org.springframework.jms.connection.SingleConnectionFactory
Set the target ConnectionFactory which will be used to lazily create a single Connection.
setTargetConnectionFactory(ConnectionFactory) - Method in class org.springframework.jms.connection.TransactionAwareConnectionFactoryProxy
Set the target ConnectionFactory that this ConnectionFactory should delegate to.
setTargetConnectionFactory(ConnectionFactory) - Method in class org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter
Set the target ConnectionFactory that this ConnectionFactory should delegate to.
setTargetDataSource(DataSource) - Method in class org.springframework.jdbc.datasource.DelegatingDataSource
Set the target DataSource that this DataSource should delegate to.
setTargetDataSources(Map<Object, Object>) - Method in class org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
Specify the map of target DataSources, with the lookup key as key.
setTargetField(String) - Method in class org.springframework.beans.factory.config.FieldRetrievingFactoryBean
Set the name of the field to be retrieved.
setTargetFilterLifecycle(boolean) - Method in class org.springframework.web.filter.DelegatingFilterProxy
Set whether to invoke the Filter.init and Filter.destroy lifecycle methods on the target bean.
setTargetListClass(Class) - Method in class org.springframework.beans.factory.config.ListFactoryBean
Set the class to use for the target List.
setTargetMapClass(Class) - Method in class org.springframework.beans.factory.config.MapFactoryBean
Set the class to use for the target Map.
setTargetMethod(String) - Method in class org.springframework.util.MethodInvoker
Set the name of the method to be invoked.
setTargetName(String) - Method in class org.springframework.aop.framework.ProxyFactoryBean
Set the name of the target bean.
setTargetObject(Object) - Method in class org.springframework.beans.factory.config.FieldRetrievingFactoryBean
Set the target object on which the field is defined.
setTargetObject(Object) - Method in class org.springframework.beans.factory.config.PropertyPathFactoryBean
Specify a target object to apply the property path to.
setTargetObject(Object) - Method in class org.springframework.util.MethodInvoker
Set the target object on which to call the target method.
setTargetPackages(String[]) - Method in class org.springframework.oxm.castor.CastorMarshaller
Set the package names of packages with the Castor descriptor classes.
setTargetPersistenceManagerFactory(PersistenceManagerFactory) - Method in class org.springframework.orm.jdo.TransactionAwarePersistenceManagerFactoryProxy
Set the target JDO PersistenceManagerFactory that this proxy should delegate to.
setTargetRenderParameter(ActionRequest, ActionResponse) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Pass the the parameter that indicates the target page of the request forward to the render phase.
setTargetSetClass(Class) - Method in class org.springframework.beans.factory.config.SetFactoryBean
Set the class to use for the target Set.
setTargetSource(TargetSource) - Method in interface org.springframework.aop.framework.Advised
Change the TargetSource used by this Advised object.
setTargetSource(TargetSource) - Method in class org.springframework.aop.framework.AdvisedSupport

setTargetType(Class) - Method in class org.springframework.beans.factory.config.TypedStringValue
Set the type to convert to.
setTargetType(MessageType) - Method in class org.springframework.jms.support.converter.MarshallingMessageConverter
Specify whether MarshallingMessageConverter.toMessage(Object, Session) should marshal to a BytesMessage or a TextMessage.
setTargetTypeName(String) - Method in class org.springframework.beans.factory.config.TypedStringValue
Specify the type to convert to.
setTaskExecutor(Executor) - Method in class org.springframework.context.event.SimpleApplicationEventMulticaster
Set the TaskExecutor to execute application listeners with.
setTaskExecutor(Executor) - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Set the Spring TaskExecutor to use for running the listener threads.
setTaskExecutor(Executor) - Method in class org.springframework.jms.listener.SimpleMessageListenerContainer
Set the Spring TaskExecutor to use for executing the listener once a message has been received by the provider.
setTaskExecutor(Executor) - Method in class org.springframework.scheduling.annotation.AsyncAnnotationAdvisor
Specify the task executor to use for asynchronous methods.
setTaskExecutor(Executor) - Method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
Set the Spring TaskExecutor to use as Quartz backend.
setTaskScheduler(TaskScheduler) - Method in class org.springframework.scheduling.config.ScheduledTaskRegistrar

setTempClassLoader(ClassLoader) - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Specify a temporary ClassLoader to use for type matching purposes.
setTempClassLoader(ClassLoader) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory

setTemplateLoaderPath(String) - Method in class org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
Set the Freemarker template loader path via a Spring resource location.
setTemplateLoaderPaths(String[]) - Method in class org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
Set multiple Freemarker template loader paths via Spring resource locations.
setTemplateLoaders(TemplateLoader[]) - Method in class org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
Deprecated. as of Spring 2.0.1, in favor of the "preTemplateLoaders" and "postTemplateLoaders" properties
SETTERS - Static variable in class org.springframework.aop.support.Pointcuts
Pointcut matching all bean property setters, in any class
setText(String) - Method in class org.springframework.mail.javamail.MimeMailMessage

setText(String) - Method in class org.springframework.mail.javamail.MimeMessageHelper
Set the given text directly as content in non-multipart mode or as default body part in multipart mode.
setText(String, boolean) - Method in class org.springframework.mail.javamail.MimeMessageHelper
Set the given text directly as content in non-multipart mode or as default body part in multipart mode.
setText(String, String) - Method in class org.springframework.mail.javamail.MimeMessageHelper
Set the given plain text and HTML text as alternatives, offering both options to the email client.
setText(String) - Method in interface org.springframework.mail.MailMessage

setText(String) - Method in class org.springframework.mail.SimpleMailMessage

setText(String) - Method in class org.springframework.web.servlet.tags.MessageTag
Set the message text for this tag.
setText(HSSFCell, String) - Method in class org.springframework.web.servlet.view.document.AbstractExcelView
Convenient method to set a String as text content in a cell.
setThemeName(HttpServletRequest, HttpServletResponse, String) - Method in class org.springframework.web.servlet.theme.CookieThemeResolver

setThemeName(HttpServletRequest, HttpServletResponse, String) - Method in class org.springframework.web.servlet.theme.FixedThemeResolver

setThemeName(HttpServletRequest, HttpServletResponse, String) - Method in class org.springframework.web.servlet.theme.SessionThemeResolver

setThemeName(HttpServletRequest, HttpServletResponse, String) - Method in interface org.springframework.web.servlet.ThemeResolver
Set the current theme name to the given one.
setThreadContextInheritable(boolean) - Method in class org.springframework.web.filter.RequestContextFilter
Set whether to expose the LocaleContext and RequestAttributes as inheritable for child threads (using an InheritableThreadLocal).
setThreadContextInheritable(boolean) - Method in class org.springframework.web.portlet.FrameworkPortlet
Set whether to expose the LocaleContext and RequestAttributes as inheritable for child threads (using an InheritableThreadLocal).
setThreadContextInheritable(boolean) - Method in class org.springframework.web.servlet.FrameworkServlet
Set whether to expose the LocaleContext and RequestAttributes as inheritable for child threads (using an InheritableThreadLocal).
setThreaded(boolean) - Method in class org.springframework.jmx.support.ConnectorServerFactoryBean
Set whether the JMXConnectorServer should be started in a separate thread.
setThreadFactory(ThreadFactory) - Method in class org.springframework.core.task.SimpleAsyncTaskExecutor
Specify an external factory to use for creating new Threads, instead of relying on the local properties of this executor.
setThreadFactory(ThreadFactory) - Method in class org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor
Set the ThreadFactory to use for the ThreadPoolExecutor's thread pool.
setThreadFactory(ThreadFactory) - Method in class org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
Set the ThreadFactory to use for the ThreadPoolExecutor's thread pool.
setThreadGroup(ThreadGroup) - Method in class org.springframework.util.CustomizableThreadCreator
Specify the thread group that threads should be created in.
setThreadGroupName(String) - Method in class org.springframework.util.CustomizableThreadCreator
Specify the name of the thread group that threads should be created in.
setThreadNamePrefix(String) - Method in class org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor

setThreadNamePrefix(String) - Method in class org.springframework.scheduling.concurrent.ExecutorConfigurationSupport

setThreadNamePrefix(String) - Method in class org.springframework.util.CustomizableThreadCreator
Specify the prefix to use for the names of newly created threads.
setThreadPoolName(String) - Method in class org.springframework.jca.work.glassfish.GlassFishWorkManagerTaskExecutor
Identify a specific GlassFish thread pool to talk to.
setThreadPriority(int) - Method in class org.springframework.util.CustomizableThreadCreator
Set the priority of the threads that this factory creates.
setThrowingName(String) - Method in class org.springframework.aop.aspectj.AbstractAspectJAdvice

setThrowingName(String) - Method in class org.springframework.aop.aspectj.AspectJAdviceParameterNameDiscoverer
If afterThrowing advice binds the thrown value, the throwing variable name must be specified.
setThrowingName(String) - Method in class org.springframework.aop.aspectj.AspectJAfterThrowingAdvice

setThrowingNameNoCheck(String) - Method in class org.springframework.aop.aspectj.AbstractAspectJAdvice
We need to hold the throwing name at this level for argument binding calculations, this method allows the afterThrowing advice subclass to set the name.
setTilesInitializer(TilesInitializer) - Method in class org.springframework.web.servlet.view.tiles2.TilesConfigurer
Configure Tiles using a custom TilesInitializer, typically specified as an inner bean.
setTilesProperties(Properties) - Method in class org.springframework.web.servlet.view.tiles2.TilesConfigurer
Set Tiles properties (equivalent to the ServletContext init-params in the Tiles documentation), overriding the default settings.
setTimeBetweenEvictionRunsMillis(long) - Method in class org.springframework.aop.target.CommonsPoolTargetSource
Set the time between eviction runs that check idle objects whether they have been idle for too long or have become invalid.
setTimeout(int) - Method in class org.springframework.jdbc.support.DatabaseStartupValidator
Set the timeout (in seconds) after which a fatal exception will be thrown.
setTimeout(int) - Method in class org.springframework.transaction.support.DefaultTransactionDefinition
Set the timeout to apply, as number of seconds.
setTimeoutInMillis(long) - Method in class org.springframework.transaction.support.ResourceHolderSupport
Set the timeout for this object in milliseconds.
setTimeoutInSeconds(int) - Method in class org.springframework.transaction.support.ResourceHolderSupport
Set the timeout for this object in seconds.
setTimeoutPerShutdownPhase(long) - Method in class org.springframework.context.support.DefaultLifecycleProcessor
Specify the maximum time allotted in milliseconds for the shutdown of any phase (group of SmartLifecycle beans with the same 'phase' value).
setTimer(Timer) - Method in class org.springframework.scheduling.timer.TimerTaskExecutor
Deprecated. Set the Timer to use for this TimerTaskExecutor, for example a shared Timer instance defined by a TimerFactoryBean.
setTimerListener(TimerListener) - Method in class org.springframework.scheduling.commonj.ScheduledTimerListener
Set the TimerListener to schedule.
setTimerManager(TimerManager) - Method in class org.springframework.scheduling.commonj.TimerManagerAccessor
Specify the CommonJ TimerManager to delegate to.
setTimerManagerName(String) - Method in class org.springframework.scheduling.commonj.TimerManagerAccessor
Set the JNDI name of the CommonJ TimerManager.
setTimerTask(TimerTask) - Method in class org.springframework.scheduling.timer.ScheduledTimerTask
Deprecated. Set the TimerTask to schedule.
setTimeStyle(String) - Method in class org.springframework.format.datetime.joda.JodaTimeFormattingConfigurer
Set the default format style of Joda LocalTime objects.
setTimeToIdle(int) - Method in class org.springframework.cache.ehcache.EhCacheFactoryBean
Set the time in seconds to idle for an element before it expires, that is, the maximum amount of time between accesses before an element expires.
setTimeToLive(int) - Method in class org.springframework.cache.ehcache.EhCacheFactoryBean
Set the time in seconds to live for an element before it expires, i.e.
setTimeToLive(long) - Method in class org.springframework.jms.core.JmsTemplate
Set the time-to-live of the message when sending.
setTimeUnit(TimeUnit) - Method in class org.springframework.scheduling.concurrent.ScheduledExecutorTask
Specify the time unit for the delay and period values.
setTimeZone(TimeZone) - Method in class org.springframework.format.datetime.DateFormatter
Set the TimeZone to normalize the date values into, if any.
setTimeZone(DateTimeZone) - Method in class org.springframework.format.datetime.joda.JodaTimeContext
Set the user's timezone.
setTitle(String) - Method in class org.springframework.mock.web.portlet.MockRenderResponse

setTitle(String) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Set the value of the 'title' attribute.
setTo(String) - Method in class org.springframework.mail.javamail.MimeMailMessage

setTo(String[]) - Method in class org.springframework.mail.javamail.MimeMailMessage

setTo(InternetAddress) - Method in class org.springframework.mail.javamail.MimeMessageHelper

setTo(InternetAddress[]) - Method in class org.springframework.mail.javamail.MimeMessageHelper

setTo(String) - Method in class org.springframework.mail.javamail.MimeMessageHelper

setTo(String[]) - Method in class org.springframework.mail.javamail.MimeMessageHelper

setTo(String) - Method in interface org.springframework.mail.MailMessage

setTo(String[]) - Method in interface org.springframework.mail.MailMessage

setTo(String) - Method in class org.springframework.mail.SimpleMailMessage

setTo(String[]) - Method in class org.springframework.mail.SimpleMailMessage

setToggleAscendingOnProperty(boolean) - Method in class org.springframework.beans.support.MutableSortDefinition
Set whether to toggle the ascending flag if the same property gets set again (that is, MutableSortDefinition.setProperty(java.lang.String) gets called with already set property name again).
setToolAttributes(Map<String, Class>) - Method in class org.springframework.web.servlet.view.velocity.VelocityView
Set tool attributes to expose to the view, as attribute name / class name pairs.
setToolboxConfigLocation(String) - Method in class org.springframework.web.servlet.view.velocity.VelocityToolboxView
Set a Velocity Toolbox config location, for example "/WEB-INF/toolbox.xml", to automatically load a Velocity Tools toolbox definition file and expose all defined tools in the specified scopes.
setToolboxConfigLocation(String) - Method in class org.springframework.web.servlet.view.velocity.VelocityViewResolver
Set a Velocity Toolbox config location, for example "/WEB-INF/toolbox.xml", to automatically load a Velocity Tools toolbox definition file and expose all defined tools in the specified scopes.
setTrackAllInvocations(boolean) - Method in class org.springframework.aop.interceptor.JamonPerformanceMonitorInterceptor
Set whether to track all invocations that go through this interceptor, or just invocations with trace logging enabled.
setTrackRowsAffected(boolean) - Method in class org.springframework.jdbc.object.BatchSqlUpdate
Set whether to track the rows affected by batch updates performed by this operation object.
setTransaction(Transaction) - Method in class org.springframework.orm.hibernate3.SessionHolder

setTransactionActive(boolean) - Method in class org.springframework.jdbc.datasource.ConnectionHolder
Set whether this holder represents an active, JDBC-managed transaction.
setTransactionActive(boolean) - Method in class org.springframework.orm.jdo.PersistenceManagerHolder

setTransactionActive(boolean) - Method in class org.springframework.orm.jpa.EntityManagerHolder

setTransactionAttribute(TransactionAttribute) - Method in class org.springframework.transaction.interceptor.MatchAlwaysTransactionAttributeSource
Allows a transaction attribute to be specified, using the String form, for example, "PROPAGATION_REQUIRED".
setTransactionAttributes(Properties) - Method in class org.springframework.transaction.interceptor.TransactionAspectSupport
Set properties with method names as keys and transaction attribute descriptors (parsed via TransactionAttributeEditor) as values: e.g.
setTransactionAttributes(Properties) - Method in class org.springframework.transaction.interceptor.TransactionProxyFactoryBean
Set properties with method names as keys and transaction attribute descriptors (parsed via TransactionAttributeEditor) as values: e.g.
setTransactionAttributeSource(TransactionAttributeSource) - Method in class org.springframework.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor
Set the transaction attribute source which is used to find transaction attributes.
setTransactionAttributeSource(TransactionAttributeSource) - Method in class org.springframework.transaction.interceptor.TransactionAspectSupport
Set the transaction attribute source which is used to find transaction attributes.
setTransactionAttributeSource(TransactionAttributeSource) - Method in class org.springframework.transaction.interceptor.TransactionProxyFactoryBean
Set the transaction attribute source which is used to find transaction attributes.
setTransactionAttributeSources(TransactionAttributeSource[]) - Method in class org.springframework.transaction.interceptor.TransactionAspectSupport
Set multiple transaction attribute sources which are used to find transaction attributes.
setTransactionConfigClass(Class) - Method in class org.springframework.orm.ibatis.SqlMapClientFactoryBean
Set the iBATIS TransactionConfig class to use.
setTransactionConfigProperties(Properties) - Method in class org.springframework.orm.ibatis.SqlMapClientFactoryBean
Set properties to be passed to the TransactionConfig instance used by this SqlMapClient.
setTransactionDefinition(TransactionDefinition) - Method in class org.springframework.test.AbstractTransactionalSpringContextTests
Deprecated. Call this method in an overridden ConditionalTestCase.runBare() method to override the transaction attributes that will be used, so that AbstractSingleSpringContextTests.setUp() and AbstractSingleSpringContextTests.tearDown() behavior is modified.
setTransactionFactory(TransactionFactory) - Method in class org.springframework.jca.endpoint.AbstractMessageEndpointFactory
Set the Spring TransactionFactory to use for wrapping endpoint invocations, enlisting the endpoint resource in each such transaction.
setTransactionInterceptor(TransactionInterceptor) - Method in class org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor
Set the transaction interceptor to use for this advisor.
setTransactionManager(Object) - Method in class org.springframework.jca.endpoint.AbstractMessageEndpointFactory
Set the the XA transaction manager to use for wrapping endpoint invocations, enlisting the endpoint resource in each such transaction.
setTransactionManager(PlatformTransactionManager) - Method in class org.springframework.jms.listener.AbstractPollingMessageListenerContainer
Specify the Spring PlatformTransactionManager to use for transactional wrapping of message reception plus listener execution.
setTransactionManager(Object) - Method in class org.springframework.jms.listener.endpoint.JmsMessageEndpointManager
Set the XA transaction manager to use for wrapping endpoint invocations, enlisting the endpoint resource in each such transaction.
setTransactionManager(PlatformTransactionManager) - Method in class org.springframework.scheduling.quartz.SchedulerAccessor
Set the transaction manager to be used for registering jobs and triggers that are defined by this SchedulerFactoryBean.
setTransactionManager(PlatformTransactionManager) - Method in class org.springframework.test.AbstractTransactionalSpringContextTests
Deprecated. Specify the transaction manager to use.
setTransactionManager(PlatformTransactionManager) - Method in class org.springframework.transaction.interceptor.TransactionAspectSupport
Specify the target transaction manager.
setTransactionManager(PlatformTransactionManager) - Method in class org.springframework.transaction.interceptor.TransactionProxyFactoryBean
Set the transaction manager.
setTransactionManager(TransactionManager) - Method in class org.springframework.transaction.jta.JtaTransactionManager
Set the JTA TransactionManager to use as direct reference.
setTransactionManager(PlatformTransactionManager) - Method in class org.springframework.transaction.support.TransactionTemplate
Set the transaction management strategy to be used.
setTransactionManagerBeanName(String) - Method in class org.springframework.transaction.interceptor.TransactionAspectSupport
Specify the name of the default transaction manager bean.
setTransactionManagerName(String) - Method in class org.springframework.transaction.jta.JtaTransactionManager
Set the JNDI name of the JTA TransactionManager.
setTransactionName(String) - Method in class org.springframework.jca.endpoint.AbstractMessageEndpointFactory
Specify the name of the transaction, if any.
setTransactionName(String) - Method in class org.springframework.jms.listener.AbstractPollingMessageListenerContainer
Specify the transaction name to use for transactional wrapping.
setTransactionSynchronization(int) - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Set when this transaction manager should activate the thread-bound transaction synchronization support.
setTransactionSynchronizationName(String) - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Set the transaction synchronization by the name of the corresponding constant in this class, e.g.
setTransactionSynchronizationRegistryName(String) - Method in class org.springframework.transaction.jta.JtaTransactionManager
Set the JNDI name of the JTA 1.1 TransactionSynchronizationRegistry.
setTransactionTimeout(int) - Method in class org.springframework.jca.endpoint.AbstractMessageEndpointFactory
Specify the transaction timeout, if any.
setTransactionTimeout(int) - Method in class org.springframework.jms.listener.AbstractPollingMessageListenerContainer
Specify the transaction timeout to use for transactional wrapping, in seconds.
setTransactionTimeout(int) - Method in class org.springframework.transaction.jta.UserTransactionAdapter

setTransactionType(PersistenceUnitTransactionType) - Method in class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo

setTransformerFactoryClass(Class) - Method in class org.springframework.web.servlet.view.xslt.AbstractXsltView
Deprecated. Specify the XSLT TransformerFactory class to use.
setTransformerFactoryClass(Class) - Method in class org.springframework.web.servlet.view.xslt.XsltView
Specify the XSLT TransformerFactory class to use.
setTransientDataAccessResourceCodes(String[]) - Method in class org.springframework.jdbc.support.SQLErrorCodes

setTraversableResolver(TraversableResolver) - Method in class org.springframework.validation.beanvalidation.CustomValidatorBean
Specify a custom TraversableResolver to use for this Validator.
setTraversableResolver(TraversableResolver) - Method in class org.springframework.validation.beanvalidation.LocalValidatorFactoryBean
Specify a custom TraversableResolver to use for this ValidatorFactory and its exposed default Validator.
setTriggerListenerNames(String[]) - Method in class org.springframework.scheduling.quartz.CronTriggerBean
Set a list of TriggerListener names for this job, referring to non-global TriggerListeners registered with the Scheduler.
setTriggerListenerNames(String[]) - Method in class org.springframework.scheduling.quartz.SimpleTriggerBean
Set a list of TriggerListener names for this job, referring to non-global TriggerListeners registered with the Scheduler.
setTriggerListeners(TriggerListener[]) - Method in class org.springframework.scheduling.quartz.SchedulerAccessor
Specify named Quartz TriggerListeners to be registered with the Scheduler.
setTriggers(Trigger[]) - Method in class org.springframework.scheduling.quartz.SchedulerAccessor
Register a list of Trigger objects with the Scheduler that this FactoryBean creates.
setTriggerTasks(Map<Runnable, Trigger>) - Method in class org.springframework.scheduling.config.ScheduledTaskRegistrar

setType(String) - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues.ValueHolder
Set the type of the constructor argument.
setType(EmbeddedDatabaseType) - Method in class org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder
Sets the type of embedded database.
setTypeClass(String) - Method in class org.springframework.orm.hibernate3.TypeDefinitionBean
Set the type implementation class.
setTypeComparator(TypeComparator) - Method in class org.springframework.expression.spel.support.StandardEvaluationContext

setTypeConverter(TypeConverter) - Method in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Set a custom type converter that this BeanFactory should use for converting bean property values, constructor argument values, etc.
setTypeConverter(TypeConverter) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory

setTypeConverter(TypeConverter) - Method in class org.springframework.beans.support.ArgumentConvertingMethodInvoker
Set a TypeConverter to use for argument type conversion.
setTypeConverter(TypeConverter) - Method in class org.springframework.expression.spel.support.StandardEvaluationContext

setTypeDefinitions(TypeDefinitionBean[]) - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Specify the Hibernate type definitions to register with the SessionFactory, as Spring TypeDefinitionBean instances.
setTypeIndexForCurrentLevel(int) - Method in class org.springframework.core.MethodParameter
Set the type index for the current nesting level.
setTypeLocator(TypeLocator) - Method in class org.springframework.expression.spel.support.StandardEvaluationContext

setTypeName(String) - Method in class org.springframework.orm.hibernate3.TypeDefinitionBean
Set the name of the type.
setTypePattern(String) - Method in class org.springframework.aop.aspectj.TypePatternClassFilter
Set the AspectJ type pattern to match.
setTypes(int[]) - Method in class org.springframework.jdbc.object.RdbmsOperation
Add anonymous parameters, specifying only their SQL types as defined in the java.sql.Types class.
setTypeValue(PreparedStatement, int, int, String) - Method in interface org.springframework.jdbc.core.SqlTypeValue
Set the type value on the given PreparedStatement.
setTypeValue(PreparedStatement, int, int, String) - Method in class org.springframework.jdbc.core.support.AbstractSqlTypeValue

setTypeValue(PreparedStatement, int, int, String) - Method in class org.springframework.jdbc.core.support.SqlLobValue
Set the specified content via the LobCreator.
setUniqueFactoryMethodName(String) - Method in class org.springframework.beans.factory.support.RootBeanDefinition
Specify a factory method name that refers to a non-overloaded method.
setUnit(String) - Method in class org.springframework.jmx.export.metadata.ManagedMetric
The expected unit of measurement values.
setUnmarshaller(Unmarshaller) - Method in class org.springframework.http.converter.xml.MarshallingHttpMessageConverter
Set the Unmarshaller to be used by this message converter.
setUnmarshaller(Unmarshaller) - Method in class org.springframework.jms.support.converter.MarshallingMessageConverter
Set the Unmarshaller to be used by this message converter.
setUnmarshallerListener(Unmarshaller.Listener) - Method in class org.springframework.oxm.jaxb.Jaxb2Marshaller
Set the Unmarshaller.Listener to be registered with the JAXB Unmarshaller.
setUnmarshallerProperties(Map<String, Object>) - Method in class org.springframework.oxm.jaxb.Jaxb2Marshaller
Set the JAXB Unmarshaller properties.
setUowManager(UOWManager) - Method in class org.springframework.transaction.jta.WebSphereUowTransactionManager
Set the WebSphere UOWManager to use as direct reference.
setUowManagerName(String) - Method in class org.springframework.transaction.jta.WebSphereUowTransactionManager
Set the JNDI name of the WebSphere UOWManager.
setUp() - Method in class org.springframework.test.AbstractSingleSpringContextTests
Deprecated. This implementation is final.
setupArgumentsForVarargsInvocation(Class[], Object...) - Static method in class org.springframework.expression.spel.support.ReflectionHelper
Package up the arguments so that they correctly match what is expected in parameterTypes.
setUpdatableResults(boolean) - Method in class org.springframework.jdbc.core.CallableStatementCreatorFactory
Set whether to use prepared statements capable of returning updatable ResultSets.
setUpdatableResults(boolean) - Method in class org.springframework.jdbc.core.PreparedStatementCreatorFactory
Set whether to use prepared statements capable of returning updatable ResultSets.
setUpdatableResults(boolean) - Method in class org.springframework.jdbc.object.RdbmsOperation
Set whether to use statements that are capable of returning updatable ResultSets.
setUploadTempDir(Resource) - Method in class org.springframework.web.multipart.commons.CommonsFileUploadSupport
Set the temporary directory where uploaded files get stored.
setUriResolver(URIResolver) - Method in class org.springframework.web.servlet.view.xslt.AbstractXsltView
Deprecated. Set the URIResolver used in the transform.
setUriResolver(URIResolver) - Method in class org.springframework.web.servlet.view.xslt.XsltView
Set the URIResolver used in the transform.
setUriResolver(URIResolver) - Method in class org.springframework.web.servlet.view.xslt.XsltViewResolver
Set the URIResolver used in the transform.
setUrl(String) - Method in class org.springframework.jdbc.datasource.AbstractDriverBasedDataSource
Set the JDBC URL to use for connecting through the Driver.
setUrl(String) - Method in interface org.springframework.jdbc.datasource.embedded.ConnectionProperties
Sets the JDBC connection URL of the database.
setUrl(String) - Method in class org.springframework.web.servlet.view.AbstractUrlBasedView
Set the URL of the resource that this view wraps.
setUrl(String) - Method in class org.springframework.web.servlet.view.document.AbstractExcelView
Set the URL of the Excel workbook source, without localization part nor extension.
setUrl(String) - Method in class org.springframework.web.servlet.view.document.AbstractJExcelView
Set the URL of the Excel workbook source, without localization part nor extension.
setUrlDecode(boolean) - Method in class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
Set if context path and request URI should be URL-decoded.
setUrlDecode(boolean) - Method in class org.springframework.web.servlet.mvc.AbstractUrlViewController
Set if context path and request URI should be URL-decoded.
setUrlDecode(boolean) - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
Set if context path and request URI should be URL-decoded.
setUrlDecode(boolean) - Method in class org.springframework.web.servlet.mvc.multiaction.AbstractUrlMethodNameResolver
Set if context path and request URI should be URL-decoded.
setUrlDecode(boolean) - Method in class org.springframework.web.servlet.mvc.WebContentInterceptor
Set if context path and request URI should be URL-decoded.
setUrlDecode(boolean) - Method in class org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator
Set if the context path and request URI should be URL-decoded.
setUrlDecode(boolean) - Method in class org.springframework.web.util.UrlPathHelper
Set if context path and request URI should be URL-decoded.
setUrlMap(Map<String, ?>) - Method in class org.springframework.web.servlet.handler.SimpleUrlHandlerMapping
Set a Map with URL paths as keys and handler beans (or handler bean names) as values.
setUrlPathHelper(UrlPathHelper) - Method in class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
Set the UrlPathHelper to use for resolution of lookup paths.
setUrlPathHelper(UrlPathHelper) - Method in class org.springframework.web.servlet.mvc.AbstractUrlViewController
Set the UrlPathHelper to use for the resolution of lookup paths.
setUrlPathHelper(UrlPathHelper) - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
Set the UrlPathHelper to use for resolution of lookup paths.
setUrlPathHelper(UrlPathHelper) - Method in class org.springframework.web.servlet.mvc.multiaction.AbstractUrlMethodNameResolver
Set the UrlPathHelper to use for resolution of lookup paths.
setUrlPathHelper(UrlPathHelper) - Method in class org.springframework.web.servlet.mvc.WebContentInterceptor
Set the UrlPathHelper to use for resolution of lookup paths.
setUrlPathHelper(UrlPathHelper) - Method in class org.springframework.web.servlet.support.RequestContext
Set the UrlPathHelper to use for context path and request URI decoding.
setUrlPathHelper(UrlPathHelper) - Method in class org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator
Set the UrlPathHelper to use for the resolution of lookup paths.
setUrlPrefix(String) - Method in class org.springframework.web.servlet.mvc.support.ControllerBeanNameHandlerMapping
Set an optional prefix to prepend to generated URL mappings.
setUrlSuffix(String) - Method in class org.springframework.web.servlet.mvc.support.ControllerBeanNameHandlerMapping
Set an optional suffix to append to generated URL mappings.
setUseAttributeFor(Map<?, ?>) - Method in class org.springframework.oxm.xstream.XStreamMarshaller
Set the types to use XML attributes for.
setUseAttributeForTypes(Class[]) - Method in class org.springframework.oxm.xstream.XStreamMarshaller
Set types to use XML attributes for.
setUseCacheControlHeader(boolean) - Method in class org.springframework.web.servlet.support.WebContentGenerator
Set whether to use the HTTP 1.1 cache-control header.
setUseCacheControlNoStore(boolean) - Method in class org.springframework.web.servlet.support.WebContentGenerator
Set whether to use the HTTP 1.1 cache-control header value "no-store" when preventing caching.
setUseCachedContent(boolean) - Method in class org.springframework.mock.web.portlet.MockCacheControl

setUseCodeAsDefaultMessage(boolean) - Method in class org.springframework.context.support.AbstractMessageSource
Set whether to use the message code as default message instead of throwing a NoSuchMessageException.
setUseDefaultSuffixPattern(boolean) - Method in class org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping
Set whether to register paths using the default suffix pattern as well: i.e.
setUseDynamicLogger(boolean) - Method in class org.springframework.aop.interceptor.AbstractTraceInterceptor
Set whether to use a dynamic logger or a static logger.
setUseExpiresHeader(boolean) - Method in class org.springframework.web.servlet.support.WebContentGenerator
Set whether to use the HTTP 1.0 expires header.
setUseIsoFormat(boolean) - Method in class org.springframework.format.datetime.joda.JodaTimeFormattingConfigurer
Set whether standard ISO formatting should be applied to all Date/Time types.
setUseMutableTilesContainer(boolean) - Method in class org.springframework.web.servlet.view.tiles2.TilesConfigurer
Set whether to use a MutableTilesContainer (typically the CachingTilesContainer implementation) for this application.
setUseNotAcceptableStatusCode(boolean) - Method in class org.springframework.web.servlet.view.ContentNegotiatingViewResolver
Indicates whether a 406 Not Acceptable status code should be returned if no suitable view can be found.
setUsePrefix(boolean) - Method in class org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator
Set whether to exclude advisors with a certain prefix in the bean name.
setUserAttribute(String, Object) - Method in class org.springframework.aop.framework.ReflectiveMethodInvocation

setUserAttribute(String, Object) - Method in interface org.springframework.aop.ProxyMethodInvocation
Add the specified user attribute with the given value to this invocation.
setUserinfoUsernameAttributes(String[]) - Method in class org.springframework.web.portlet.FrameworkPortlet
Set the list of attributes to search in the USER_INFO map when trying to find the username of the current user.
setUsername(String) - Method in class org.springframework.jdbc.datasource.AbstractDriverBasedDataSource
Set the JDBC username to use for connecting through the Driver.
setUsername(String) - Method in interface org.springframework.jdbc.datasource.embedded.ConnectionProperties
Sets the username to use to connect to the database.
setUsername(String) - Method in class org.springframework.jdbc.datasource.UserCredentialsDataSourceAdapter
Set the default username that this adapter should use for retrieving Connections.
setUsername(String) - Method in class org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter
Set the username that this adapter should use for retrieving Connections.
setUsername(String) - Method in class org.springframework.mail.javamail.JavaMailSenderImpl
Set the username for the account at the mail host, if any.
setUsername(String) - Method in class org.springframework.remoting.caucho.BurlapClientInterceptor
Set the username that this factory should use to access the remote service.
setUsername(String) - Method in class org.springframework.remoting.caucho.HessianClientInterceptor
Set the username that this factory should use to access the remote service.
setUsername(String) - Method in class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Deprecated. Set the username to specify on the stub or call.
setUsername(String) - Method in class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
Set the username to specify on the stub.
setUserPrincipal(Principal) - Method in class org.springframework.mock.web.MockHttpServletRequest

setUserPrincipal(Principal) - Method in class org.springframework.mock.web.portlet.MockPortletRequest

setUserTransaction(UserTransaction) - Method in class org.springframework.transaction.jta.JtaTransactionManager
Set the JTA UserTransaction to use as direct reference.
setUserTransactionName(String) - Method in class org.springframework.transaction.jta.JtaTransactionManager
Set the JNDI name of the JTA UserTransaction.
setUserTreePath(String) - Method in class org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer
Set the path in the system preferences tree to use for resolving placeholders.
setUseSharedPortletConfig(boolean) - Method in class org.springframework.web.portlet.handler.SimplePortletPostProcessor
Set whether to use the shared PortletConfig object passed in through setPortletConfig, if available.
setUseSharedPortletConfig(boolean) - Method in class org.springframework.web.portlet.mvc.PortletWrappingController
Set whether to use the shared PortletConfig object passed in through setPortletConfig, if available.
setUseSharedServletConfig(boolean) - Method in class org.springframework.web.servlet.handler.SimpleServletPostProcessor
Set whether to use the shared ServletConfig object passed in through setServletConfig, if available.
setUseSingleModelNameAsRoot(boolean) - Method in class org.springframework.web.servlet.view.xslt.AbstractXsltView
Deprecated. Set whether to use the name of a given single model object as the document root element name.
setUseSoapAction(boolean) - Method in class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
Set the "soapaction.use" flag to specify on the stub.
setUseSqlStateForTranslation(boolean) - Method in class org.springframework.jdbc.support.SQLErrorCodes
Set this property to true for databases that do not provide an error code but that do provide SQL State (this includes PostgreSQL).
setUseStrictCasing(boolean) - Method in class org.springframework.jmx.access.MBeanClientInterceptor
Set whether to use strict casing for attributes.
setUseStrictCasing(boolean) - Method in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
Set whether to use strict casing for attributes.
setUseTransactionAwareDataSource(boolean) - Method in class org.springframework.orm.hibernate3.AbstractSessionFactoryBean
Set whether to use a transaction-aware DataSource for the SessionFactory, i.e.
setUseTransactionAwareDataSource(boolean) - Method in class org.springframework.orm.ibatis.SqlMapClientFactoryBean
Set whether to use a transaction-aware DataSource for the SqlMapClient, i.e.
setUseWriter(boolean) - Method in class org.springframework.web.servlet.view.jasperreports.ConfigurableJasperReportsView
Specifies whether or not the JRExporter writes to the PrintWriter of the associated with the request (true) or whether it writes directly to the InputStream of the request (false).
setValidateAddresses(boolean) - Method in class org.springframework.mail.javamail.MimeMessageHelper
Set whether to validate all addresses which get passed to this helper.
setValidateDefinitions(boolean) - Method in class org.springframework.web.servlet.view.tiles.TilesConfigurer
Deprecated. Set whether to validate the Tiles XML definitions.
setValidateDefinitions(boolean) - Method in class org.springframework.web.servlet.view.tiles2.TilesConfigurer
Set whether to validate the Tiles XML definitions.
setValidateExistingTransaction(boolean) - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Set whether existing transactions should be validated before participating in them.
setValidateOnBinding(boolean) - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Set if the Validator should get applied when binding.
setValidateOnBinding(boolean) - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Set if the Validator should get applied when binding.
setValidating(boolean) - Method in class org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Set whether to use XML validation.
setValidating(boolean) - Method in class org.springframework.context.support.AbstractXmlApplicationContext
Set whether to use XML validation.
setValidating(boolean) - Method in class org.springframework.context.support.GenericXmlApplicationContext
Set whether to use XML validation.
setValidating(boolean) - Method in class org.springframework.oxm.castor.CastorMarshaller
Set whether this marshaller should validate in- and outgoing documents.
setValidating(boolean) - Method in class org.springframework.oxm.xmlbeans.XmlBeansMarshaller
Set whether this marshaller should validate in- and outgoing documents.
setValidationEventHandler(ValidationEventHandler) - Method in class org.springframework.oxm.jaxb.Jaxb2Marshaller
Set the JAXB validation event handler.
setValidationMode(int) - Method in class org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Set the validation mode to use.
setValidationModeName(String) - Method in class org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Set the validation mode to use by name.
setValidationProperties(Properties) - Method in class org.springframework.validation.beanvalidation.LocalValidatorFactoryBean
Specify bean validation properties to be passed to the validation provider.
setValidationPropertyMap(Map<String, String>) - Method in class org.springframework.validation.beanvalidation.LocalValidatorFactoryBean
Specify bean validation properties to be passed to the validation provider as a Map.
setValidationQuery(String) - Method in class org.springframework.jdbc.support.DatabaseStartupValidator
Set the SQL query string to use for validation.
setValidator(Validator) - Method in class org.springframework.validation.beanvalidation.BeanValidationPostProcessor
Set the JSR-303 Validator to delegate to for validating beans.
setValidator(Validator) - Method in class org.springframework.validation.DataBinder
Set the Validator to apply after each binding step.
setValidator(Validator) - Method in class org.springframework.web.bind.support.ConfigurableWebBindingInitializer
Set the Validator to apply after each binding step.
setValidator(Validator) - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Set the primary Validator for this controller.
setValidator(Validator) - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Set the primary Validator for this controller.
setValidatorFactory(ValidatorFactory) - Method in class org.springframework.validation.beanvalidation.BeanValidationPostProcessor
Set the JSR-303 ValidatorFactory to delegate to for validating beans, using its default Validator.
setValidatorFactory(ValidatorFactory) - Method in class org.springframework.validation.beanvalidation.CustomValidatorBean
Set the ValidatorFactory to obtain the target Validator from.
setValidators(Validator[]) - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Set the Validators for this controller.
setValidators(Validator[]) - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Set the Validators for this controller.
setValidators(Validator[]) - Method in class org.springframework.web.servlet.mvc.multiaction.MultiActionController
Set the Validators for this controller.
setValue(ELContext, Object, Object, Object) - Method in class org.springframework.beans.factory.access.el.SpringBeanELResolver

setValue(Object) - Method in class org.springframework.beans.factory.config.ConstructorArgumentValues.ValueHolder
Set the value for the constructor argument.
setValue(String) - Method in class org.springframework.beans.factory.config.TypedStringValue
Set the String value.
setValue(Object) - Method in class org.springframework.beans.propertyeditors.CustomCollectionEditor
Convert the given value to a Collection of the target type.
setValue(Object) - Method in class org.springframework.beans.propertyeditors.CustomMapEditor
Convert the given value to a Map of the target type.
setValue(Object) - Method in class org.springframework.beans.propertyeditors.CustomNumberEditor
Coerce a Number value into the required target class, if necessary.
setValue(Object) - Method in class org.springframework.beans.propertyeditors.PropertiesEditor
Take Properties as-is; convert Map into Properties.
setValue(Object) - Method in class org.springframework.core.io.support.ResourceArrayPropertyEditor
Treat the given value as collection or array and convert it to a Resource array.
setValue(EvaluationContext, Object) - Method in class org.springframework.expression.common.CompositeStringExpression

setValue(EvaluationContext, Object, Object) - Method in class org.springframework.expression.common.CompositeStringExpression

setValue(Object, Object) - Method in class org.springframework.expression.common.CompositeStringExpression

setValue(EvaluationContext, Object) - Method in class org.springframework.expression.common.LiteralExpression

setValue(EvaluationContext, Object, Object) - Method in class org.springframework.expression.common.LiteralExpression

setValue(Object, Object) - Method in class org.springframework.expression.common.LiteralExpression

setValue(EvaluationContext, Object) - Method in interface org.springframework.expression.Expression
Set this expression in the provided context to the value provided.
setValue(Object, Object) - Method in interface org.springframework.expression.Expression
Set this expression in the provided context to the value provided.
setValue(EvaluationContext, Object, Object) - Method in interface org.springframework.expression.Expression
Set this expression in the provided context to the value provided.
setValue(ExpressionState, Object) - Method in class org.springframework.expression.spel.ast.CompoundExpression

setValue(ExpressionState, Object) - Method in class org.springframework.expression.spel.ast.Indexer

setValue(ExpressionState, Object) - Method in class org.springframework.expression.spel.ast.PropertyOrFieldReference

setValue(ExpressionState, Object) - Method in class org.springframework.expression.spel.ast.SpelNodeImpl

setValue(ExpressionState, Object) - Method in class org.springframework.expression.spel.ast.VariableReference

setValue(ExpressionState, Object) - Method in interface org.springframework.expression.spel.SpelNode
Evaluate the expression to a node and then set the new value on that node.
setValue(EvaluationContext, Object) - Method in class org.springframework.expression.spel.standard.SpelExpression

setValue(Object, Object) - Method in class org.springframework.expression.spel.standard.SpelExpression

setValue(EvaluationContext, Object, Object) - Method in class org.springframework.expression.spel.standard.SpelExpression

setValue(PreparedStatement, int) - Method in interface org.springframework.jdbc.support.SqlValue
Set the value on the given PreparedStatement.
setValue(String, String) - Method in class org.springframework.mock.web.portlet.MockPortletPreferences

setValue(ELContext, Object, Object, Object) - Method in class org.springframework.web.jsf.el.WebApplicationContextFacesELResolver

setValue(Object) - Method in class org.springframework.web.multipart.support.ByteArrayMultipartFileEditor

setValue(Object) - Method in class org.springframework.web.multipart.support.StringMultipartFileEditor

setValue(Object) - Method in class org.springframework.web.servlet.tags.form.AbstractSingleCheckedElementTag
Set the value of the 'value' attribute.
setValue(Object) - Method in class org.springframework.web.servlet.tags.form.OptionTag
Set the 'value' attribute of the rendered HTML <option> tag.
setValue(String) - Method in class org.springframework.web.servlet.tags.Param
Set the raw value of the parameter
setValue(String) - Method in class org.springframework.web.servlet.tags.ParamTag
Sets the value of the parameter
setValue(Object) - Method in class org.springframework.web.servlet.tags.TransformTag
Set the value to transform, using the appropriate PropertyEditor from the enclosing BindTag.
setValue(String) - Method in class org.springframework.web.servlet.tags.UrlTag
Sets the value of the URL
setValueAnnotationType(Class<? extends Annotation>) - Method in class org.springframework.beans.factory.annotation.QualifierAnnotationAutowireCandidateResolver
Set the 'value' annotation type, to be used on fields, method parameters and constructor parameters.
setValues(PreparedStatement, int) - Method in interface org.springframework.jdbc.core.BatchPreparedStatementSetter
Set parameter values on the given PreparedStatement.
setValues(PreparedStatement) - Method in interface org.springframework.jdbc.core.PreparedStatementSetter
Set parameter values on the given PreparedStatement.
setValues(PreparedStatement, int) - Method in class org.springframework.jdbc.core.support.AbstractInterruptibleBatchPreparedStatementSetter
This implementation calls AbstractInterruptibleBatchPreparedStatementSetter.setValuesIfAvailable(java.sql.PreparedStatement, int) and sets this instance's exhaustion flag accordingly.
setValues(PreparedStatement, LobCreator) - Method in class org.springframework.jdbc.core.support.AbstractLobCreatingPreparedStatementCallback
Set values on the given PreparedStatement, using the given LobCreator for BLOB/CLOB arguments.
setValues(String, String[]) - Method in class org.springframework.mock.web.portlet.MockPortletPreferences

setValuesIfAvailable(PreparedStatement, int) - Method in class org.springframework.jdbc.core.support.AbstractInterruptibleBatchPreparedStatementSetter
Check for available values and set them on the given PreparedStatement.
setValueTypeName(String) - Method in class org.springframework.beans.factory.support.ManagedMap
Set the default value type name (class name) to be used for this map.
setVar(String) - Method in class org.springframework.web.servlet.tags.EvalTag
Set the variable name to expose the evaluation result under.
setVar(String) - Method in class org.springframework.web.servlet.tags.MessageTag
Set PageContext attribute name under which to expose a variable that contains the resolved message.
setVar(String) - Method in class org.springframework.web.servlet.tags.TransformTag
Set PageContext attribute name under which to expose a variable that contains the result of the transformation.
setVar(String) - Method in class org.springframework.web.servlet.tags.UrlTag
Set the variable name to expose the URL under.
setVariable(String, Object) - Method in interface org.springframework.expression.EvaluationContext
Set a named variable within this evaluation context to a specified value.
setVariable(String, Object) - Method in class org.springframework.expression.spel.ExpressionState

setVariable(String, Object) - Method in class org.springframework.expression.spel.support.StandardEvaluationContext

setVariables(Map<String, Object>) - Method in class org.springframework.expression.spel.support.StandardEvaluationContext

setVelocityEngine(VelocityEngine) - Method in class org.springframework.web.servlet.view.velocity.VelocityConfigurer
Set a pre-configured VelocityEngine to use for the Velocity web configuration: e.g.
setVelocityEngine(VelocityEngine) - Method in class org.springframework.web.servlet.view.velocity.VelocityView
Set the VelocityEngine to be used by this view.
setVelocityProperties(Properties) - Method in class org.springframework.ui.velocity.VelocityEngineFactory
Set Velocity properties, like "file.resource.loader.path".
setVelocityPropertiesMap(Map<String, Object>) - Method in class org.springframework.ui.velocity.VelocityEngineFactory
Set Velocity properties as Map, to allow for non-String values like "ds.resource.loader.instance".
setView(Object) - Method in class org.springframework.web.portlet.ModelAndView
Set a View object for this ModelAndView.
setView(View) - Method in class org.springframework.web.servlet.ModelAndView
Set a View object for this ModelAndView.
setViewClass(Class) - Method in class org.springframework.web.servlet.view.UrlBasedViewResolver
Set the view class that should be used to create views.
setViewName(String) - Method in class org.springframework.web.portlet.ModelAndView
Set a view name for this ModelAndView, to be resolved by the DispatcherPortlet via a ViewResolver.
setViewName(String) - Method in class org.springframework.web.portlet.mvc.ParameterizableViewController
Set the name of the view to delegate to.
setViewName(String) - Method in class org.springframework.web.servlet.ModelAndView
Set a view name for this ModelAndView, to be resolved by the DispatcherServlet via a ViewResolver.
setViewName(String) - Method in class org.springframework.web.servlet.mvc.ParameterizableViewController
Set the name of the view to delegate to.
setViewNames(String[]) - Method in class org.springframework.web.servlet.view.UrlBasedViewResolver
Set the view names (or name patterns) that can be handled by this ViewResolver.
setViewRendererUrl(String) - Method in class org.springframework.web.portlet.DispatcherPortlet
Set the URL to the ViewRendererServlet.
setViewResolvers(List<ViewResolver>) - Method in class org.springframework.web.servlet.view.ContentNegotiatingViewResolver
Sets the view resolvers to be wrapped by this view resolver.
setWaitForJobsToCompleteOnShutdown(boolean) - Method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
Set whether to wait for running jobs to complete on shutdown.
setWaitForJobsToCompleteOnShutdown(boolean) - Method in class org.springframework.scheduling.quartz.SimpleThreadPoolTaskExecutor
Set whether to wait for running jobs to complete on shutdown.
setWaitForTasksToCompleteOnShutdown(boolean) - Method in class org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor
Set whether to wait for scheduled tasks to complete on shutdown.
setWaitForTasksToCompleteOnShutdown(boolean) - Method in class org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
Set whether to wait for scheduled tasks to complete on shutdown.
setWarnLogCategory(String) - Method in class org.springframework.web.portlet.handler.AbstractHandlerExceptionResolver
Set the log category for warn logging.
setWarnLogCategory(String) - Method in class org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
Set the log category for warn logging.
setWebAppRootSystemProperty(ServletContext) - Static method in class org.springframework.web.util.WebUtils
Set a system property to the web application root directory.
setWebBindingInitializer(WebBindingInitializer) - Method in class org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter
Specify a WebBindingInitializer which will apply pre-configured configuration to every DataBinder that this controller uses.
setWebBindingInitializer(WebBindingInitializer) - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Specify a WebBindingInitializer which will apply pre-configured configuration to every DataBinder that this controller uses.
setWebBindingInitializer(WebBindingInitializer) - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
Specify a WebBindingInitializer which will apply pre-configured configuration to every DataBinder that this controller uses.
setWebBindingInitializer(WebBindingInitializer) - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Specify a WebBindingInitializer which will apply pre-configured configuration to every DataBinder that this controller uses.
setWebBindingInitializer(WebBindingInitializer) - Method in class org.springframework.web.servlet.mvc.multiaction.MultiActionController
Specify a WebBindingInitializer which will apply pre-configured configuration to every DataBinder that this controller uses.
setWhenExhaustedAction(byte) - Method in class org.springframework.aop.target.CommonsPoolTargetSource
Set the action to take when the pool is exhausted.
setWhenExhaustedActionName(String) - Method in class org.springframework.aop.target.CommonsPoolTargetSource
Set the action to take when the pool is exhausted.
setWhitespacePreserve(boolean) - Method in class org.springframework.oxm.castor.CastorMarshaller
Set whether the Castor Unmarshaller should preserve "ignorable" whitespace.
setWindowID(String) - Method in class org.springframework.mock.web.portlet.MockPortletRequest

setWindowState(WindowState) - Method in class org.springframework.mock.web.portlet.MockActionResponse

setWindowState(WindowState) - Method in class org.springframework.mock.web.portlet.MockPortletRequest

setWindowState(WindowState) - Method in class org.springframework.mock.web.portlet.MockPortletURL

setWindowState(WindowState) - Method in class org.springframework.mock.web.portlet.MockStateAwareResponse

setWorkingDirSystemProperty(String) - Static method in class org.springframework.util.Log4jConfigurer
Set the specified system property to the current working directory.
setWorkListener(WorkListener) - Method in class org.springframework.jca.work.WorkManagerTaskExecutor
Specify a JCA 1.5 WorkListener to apply, if any.
setWorkListener(WorkListener) - Method in class org.springframework.scheduling.commonj.WorkManagerTaskExecutor
Specify a CommonJ WorkListener to apply, if any.
setWorkManager(WorkManager) - Method in class org.springframework.jca.support.ResourceAdapterFactoryBean
Specify the JCA WorkManager to use for bootstrapping the ResourceAdapter.
setWorkManager(WorkManager) - Method in class org.springframework.jca.work.WorkManagerTaskExecutor
Specify the JCA WorkManager instance to delegate to.
setWorkManager(WorkManager) - Method in class org.springframework.scheduling.commonj.WorkManagerTaskExecutor
Specify the CommonJ WorkManager to delegate to.
setWorkManagerMBeanName(String) - Method in class org.springframework.jca.work.jboss.JBossWorkManagerTaskExecutor
Identify a specific JBossWorkManagerMBean to talk to, through its JMX object name.
setWorkManagerName(String) - Method in class org.springframework.jca.work.WorkManagerTaskExecutor
Set the JNDI name of the JCA WorkManager.
setWorkManagerName(String) - Method in class org.springframework.scheduling.commonj.WorkManagerTaskExecutor
Set the JNDI name of the CommonJ WorkManager.
setWrapAsLob(boolean) - Method in class org.springframework.jdbc.support.lob.DefaultLobHandler
Specify whether to submit a byte array / String to the JDBC driver wrapped in a JDBC Blob / Clob object, using the JDBC setBlob / setClob method with a Blob / Clob argument.
setWrappedInstance(Object) - Method in class org.springframework.beans.BeanWrapperImpl
Switch the target object, replacing the cached introspection results only if the class of the new object is different to that of the replaced object.
setWrappedInstance(Object, String, Object) - Method in class org.springframework.beans.BeanWrapperImpl
Switch the target object, replacing the cached introspection results only if the class of the new object is different to that of the replaced object.
setWriteAcceptCharset(boolean) - Method in class org.springframework.http.converter.StringHttpMessageConverter
Indicates whether the Accept-Charset should be written to any outgoing request.
setWriterAccessAllowed(boolean) - Method in class org.springframework.mock.web.MockHttpServletResponse
Set whether MockHttpServletResponse.getWriter() access is allowed.
setWsdlDocumentUrl(URL) - Method in class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
Deprecated. Set the URL of the WSDL document that describes the service.
setWsdlDocumentUrl(URL) - Method in class org.springframework.remoting.jaxws.LocalJaxWsServiceFactory
Set the URL of the WSDL document that describes the service.
setXaTerminator(XATerminator) - Method in class org.springframework.jca.support.ResourceAdapterFactoryBean
Specify the JCA XATerminator to use for bootstrapping the ResourceAdapter.
setXmlOptions(XmlOptions) - Method in class org.springframework.oxm.xmlbeans.XmlBeansMarshaller
Set the XmlOptions.
setXMLReader(XMLReader) - Method in class org.springframework.oxm.support.MarshallingSource
Throws a UnsupportedOperationException.
ShadowingClassLoader - Class in org.springframework.instrument.classloading
ClassLoader decorator that shadows an enclosing ClassLoader, applying registered transformers to all affected classes.
ShadowingClassLoader(ClassLoader) - Constructor for class org.springframework.instrument.classloading.ShadowingClassLoader
Create a new ShadowingClassLoader, decorating the given ClassLoader.
shallowCopyFieldState(Object, Object) - Static method in class org.springframework.util.ReflectionUtils
Given the source object and the destination, which must be the same class or a subclass, copy all fields, including inherited fields.
ShallowEtagHeaderFilter - Class in org.springframework.web.filter
Filter that generates an ETag value based on the content on the response.
ShallowEtagHeaderFilter() - Constructor for class org.springframework.web.filter.ShallowEtagHeaderFilter

sharedConnectionEnabled() - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Return whether a shared JMS Connection should be maintained by this container base class.
sharedConnectionEnabled() - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Use a shared JMS Connection depending on the "cacheLevel" setting.
sharedConnectionEnabled() - Method in class org.springframework.jms.listener.SimpleMessageListenerContainer
Always use a shared JMS Connection.
sharedConnectionMonitor - Variable in class org.springframework.jms.listener.AbstractJmsListeningContainer

sharedEntityManager - Variable in class org.springframework.test.jpa.AbstractJpaTests
Deprecated. Subclasses can use this in test cases.
SharedEntityManagerBean - Class in org.springframework.orm.jpa.support
FactoryBean that exposes a shared JPA EntityManager reference for a given EntityManagerFactory.
SharedEntityManagerBean() - Constructor for class org.springframework.orm.jpa.support.SharedEntityManagerBean

SharedEntityManagerCreator - Class in org.springframework.orm.jpa
Factory for a shareable JPA EntityManager for a given EntityManagerFactory.
SharedEntityManagerCreator() - Constructor for class org.springframework.orm.jpa.SharedEntityManagerCreator

ShortCodedLabeledEnum - Class in org.springframework.core.enums
Deprecated. as of Spring 3.0, in favor of Java 5 enums.
ShortCodedLabeledEnum(int, String) - Constructor for class org.springframework.core.enums.ShortCodedLabeledEnum
Deprecated. Create a new ShortCodedLabeledEnum instance.
shortSummary() - Method in class org.springframework.util.StopWatch
Return a short description of the total running time.
shortValue() - Method in class org.springframework.core.enums.StaticLabeledEnum
Deprecated. Return the code of this LabeledEnum instance as a short.
shouldApplyTo(PortletRequest, Object) - Method in class org.springframework.web.portlet.handler.AbstractHandlerExceptionResolver
Check whether this resolver is supposed to apply to the given handler.
shouldApplyTo(HttpServletRequest, Object) - Method in class org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
Check whether this resolver is supposed to apply to the given handler.
shouldClose(Connection) - Method in class org.springframework.jdbc.datasource.SingleConnectionDataSource
This is a single Connection: Do not close it when returning to the "pool".
shouldClose(Connection) - Method in interface org.springframework.jdbc.datasource.SmartDataSource
Should we close this Connection, obtained from this DataSource?
shouldCommitOnGlobalRollbackOnly() - Method in class org.springframework.orm.jdo.JdoTransactionManager
This implementation returns "true": a JDO2 commit will properly handle transactions that have been marked rollback-only at a global level.
shouldCommitOnGlobalRollbackOnly() - Method in class org.springframework.orm.jpa.JpaTransactionManager
This implementation returns "true": a JPA commit will properly handle transactions that have been marked rollback-only at a global level.
shouldCommitOnGlobalRollbackOnly() - Method in class org.springframework.transaction.jta.JtaTransactionManager
This implementation returns "true": a JTA commit will properly handle transactions that have been marked rollback-only at a global level.
shouldCommitOnGlobalRollbackOnly() - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Return whether to call doCommit on a transaction that has been marked as rollback-only in a global fashion.
shouldFireEvents() - Method in class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
Controls whether this parser is supposed to fire a BeanComponentDefinition event after parsing the bean definition.
shouldGenerateId() - Method in class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
Should an ID be generated instead of read from the passed in Element?
shouldGenerateId() - Method in class org.springframework.jdbc.config.InitializeDatabaseBeanDefinitionParser

shouldGenerateId() - Method in class org.springframework.scheduling.config.ScheduledTasksBeanDefinitionParser

shouldGenerateIdAsFallback() - Method in class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
Should an ID be generated instead if the passed in Element does not specify an "id" attribute explicitly?
shouldNotFilter(HttpServletRequest) - Method in class org.springframework.web.filter.OncePerRequestFilter
Can be overridden in subclasses for custom filtering control, returning true to avoid filtering of the given request.
shouldObtainFixedConnection(DataSource) - Method in class org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy
Determine whether to obtain a fixed target Connection for the proxy or to reobtain the target Connection for each operation.
shouldProxyTargetClass(Class<?>, String) - Method in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
Determine whether the given bean should be proxied with its target class rather than its interfaces.
shouldProxyTargetClass(ConfigurableListableBeanFactory, String) - Static method in class org.springframework.aop.framework.autoproxy.AutoProxyUtils
Determine whether the given bean should be proxied with its target class rather than its interfaces.
shouldReleaseBeforeCompletion() - Method in class org.springframework.transaction.support.ResourceHolderSynchronization
Return whether this holder's resource should be released before transaction completion (true) or rather after transaction completion (false).
shouldRender() - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementBodyTag
Should rendering of this tag proceed at all.
shouldRender() - Method in class org.springframework.web.servlet.tags.form.ErrorsTag
Should rendering of this tag proceed at all?
shouldSkip(Class, String) - Method in class org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator

shouldSkip(Class<?>, String) - Method in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
Subclasses should override this method to return true if the given bean should not be considered for auto-proxying by this post-processor.
shouldSkip(ConfigurableListableBeanFactory, String) - Method in class org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor
Check whether the given bean definition is not subject to the annotation-based required property check as performed by this post-processor.
shouldStop(Connection) - Method in class org.springframework.jms.connection.DelegatingConnectionFactory

shouldStop(Connection) - Method in interface org.springframework.jms.connection.SmartConnectionFactory
Should we stop the Connection, obtained from this ConnectionFactory?
shouldUnbindAtCompletion() - Method in class org.springframework.transaction.support.ResourceHolderSynchronization
Return whether this holder should be unbound at completion (or should rather be left bound to the thread after the transaction).
shouldUseShadowLoader() - Method in class org.springframework.test.jpa.AbstractJpaTests
Deprecated. Subclasses should override this method if they wish to disable shadow class loading.
showForm(RenderRequest, RenderResponse, BindException) - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Prepare the form model and view, including reference and error data.
showForm(RenderRequest, BindException, String) - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Prepare model and view for the given form, including reference and errors.
showForm(RenderRequest, BindException, String, Map) - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Prepare model and view for the given form, including reference and errors, adding a controller-specific control model.
showForm(RenderRequest, RenderResponse, BindException) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Show the first page as form view.
showForm(RenderRequest, RenderResponse, BindException) - Method in class org.springframework.web.portlet.mvc.SimpleFormController
Deprecated. This implementation shows the configured form view, delegating to the analogous showForm version with a controlModel argument.
showForm(RenderRequest, RenderResponse, BindException, Map) - Method in class org.springframework.web.portlet.mvc.SimpleFormController
Deprecated. This implementation shows the configured form view.
showForm(HttpServletRequest, HttpServletResponse, BindException) - Method in class org.springframework.web.servlet.mvc.AbstractFormController
Deprecated. Prepare the form model and view, including reference and error data.
showForm(HttpServletRequest, BindException, String) - Method in class org.springframework.web.servlet.mvc.AbstractFormController
Deprecated. Prepare model and view for the given form, including reference and errors.
showForm(HttpServletRequest, BindException, String, Map) - Method in class org.springframework.web.servlet.mvc.AbstractFormController
Deprecated. Prepare model and view for the given form, including reference and errors, adding a controller-specific control model.
showForm(HttpServletRequest, HttpServletResponse, BindException) - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Show the first page as form view.
showForm(HttpServletRequest, HttpServletResponse, BindException) - Method in class org.springframework.web.servlet.mvc.SimpleFormController
Deprecated. This implementation shows the configured form view, delegating to the analogous SimpleFormController.showForm(HttpServletRequest, HttpServletResponse, BindException, Map) variant with a "controlModel" argument.
showForm(HttpServletRequest, HttpServletResponse, BindException, Map) - Method in class org.springframework.web.servlet.mvc.SimpleFormController
Deprecated. This implementation shows the configured form view.
showNewForm(RenderRequest, RenderResponse) - Method in class org.springframework.web.portlet.mvc.AbstractFormController
Deprecated. Show a new form.
showNewForm(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.mvc.AbstractFormController
Deprecated. Show a new form.
showPage(RenderRequest, BindException, int) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Prepare the form model and view, including reference and error data, for the given page.
showPage(HttpServletRequest, BindException, int) - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Prepare the form model and view, including reference and error data, for the given page.
shutdown() - Method in class org.springframework.core.task.support.ExecutorServiceAdapter

shutdown() - Method in interface org.springframework.jdbc.datasource.embedded.EmbeddedDatabase
Shutdown this embedded database.
shutdown(DataSource, String) - Method in interface org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseConfigurer
Shutdown the embedded database instance that backs dataSource.
shutdown() - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Stop the shared Connection, call AbstractJmsListeningContainer.doShutdown(), and close this container.
shutdown() - Method in class org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor
Perform a shutdown on the ThreadPoolExecutor.
shutdown() - Method in class org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
Perform a shutdown on the ThreadPoolExecutor.
shutdown(boolean) - Method in class org.springframework.scheduling.quartz.LocalTaskExecutorThreadPool

shutdownDatabase() - Method in class org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory
Hook to shutdown the embedded database.
shutdownLogging() - Static method in class org.springframework.util.Log4jConfigurer
Shut down log4j, properly releasing all file locks.
shutdownLogging(ServletContext) - Static method in class org.springframework.web.util.Log4jWebConfigurer
Shut down log4j, properly releasing all file locks and resetting the web app root system property.
shutdownNow() - Method in class org.springframework.core.task.support.ExecutorServiceAdapter

SimpleAliasRegistry - Class in org.springframework.core
Simple implementation of the AliasRegistry interface.
SimpleAliasRegistry() - Constructor for class org.springframework.core.SimpleAliasRegistry

SimpleApplicationEventMulticaster - Class in org.springframework.context.event
Simple implementation of the ApplicationEventMulticaster interface.
SimpleApplicationEventMulticaster() - Constructor for class org.springframework.context.event.SimpleApplicationEventMulticaster
Create a new SimpleApplicationEventMulticaster.
SimpleApplicationEventMulticaster(BeanFactory) - Constructor for class org.springframework.context.event.SimpleApplicationEventMulticaster
Create a new SimpleApplicationEventMulticaster for the given BeanFactory.
SimpleAspectInstanceFactory - Class in org.springframework.aop.aspectj
Implementation of AspectInstanceFactory that creates a new instance of the specified aspect class for every SimpleAspectInstanceFactory.getAspectInstance() call.
SimpleAspectInstanceFactory(Class) - Constructor for class org.springframework.aop.aspectj.SimpleAspectInstanceFactory
Create a new SimpleAspectInstanceFactory for the given aspect class.
SimpleAsyncTaskExecutor - Class in org.springframework.core.task
TaskExecutor implementation that fires up a new Thread for each task, executing it asynchronously.
SimpleAsyncTaskExecutor() - Constructor for class org.springframework.core.task.SimpleAsyncTaskExecutor
Create a new SimpleAsyncTaskExecutor with default thread name prefix.
SimpleAsyncTaskExecutor(String) - Constructor for class org.springframework.core.task.SimpleAsyncTaskExecutor
Create a new SimpleAsyncTaskExecutor with the given thread name prefix.
SimpleAsyncTaskExecutor(ThreadFactory) - Constructor for class org.springframework.core.task.SimpleAsyncTaskExecutor
Create a new SimpleAsyncTaskExecutor with the given external thread factory.
SimpleAutowireCandidateResolver - Class in org.springframework.beans.factory.support
AutowireCandidateResolver implementation to use when no annotation support is available.
SimpleAutowireCandidateResolver() - Constructor for class org.springframework.beans.factory.support.SimpleAutowireCandidateResolver

SimpleBeanDefinitionRegistry - Class in org.springframework.beans.factory.support
Simple implementation of the BeanDefinitionRegistry interface.
SimpleBeanDefinitionRegistry() - Constructor for class org.springframework.beans.factory.support.SimpleBeanDefinitionRegistry

SimpleBeanFactoryAwareAspectInstanceFactory - Class in org.springframework.aop.config
Implementation of AspectInstanceFactory that locates the aspect from the BeanFactory using a configured bean name.
SimpleBeanFactoryAwareAspectInstanceFactory() - Constructor for class org.springframework.aop.config.SimpleBeanFactoryAwareAspectInstanceFactory

SimpleBeanTargetSource - Class in org.springframework.aop.target
Simple TargetSource implementation, freshly obtaining the specified target bean from its containing Spring BeanFactory.
SimpleBeanTargetSource() - Constructor for class org.springframework.aop.target.SimpleBeanTargetSource

SimpleBootstrapContext - Class in org.springframework.jca.support
Simple implementation of the JCA 1.5 BootstrapContext interface, used for bootstrapping a JCA ResourceAdapter in a local environment.
SimpleBootstrapContext(WorkManager) - Constructor for class org.springframework.jca.support.SimpleBootstrapContext
Create a new SimpleBootstrapContext for the given WorkManager, with no XATerminator available.
SimpleBootstrapContext(WorkManager, XATerminator) - Constructor for class org.springframework.jca.support.SimpleBootstrapContext
Create a new SimpleBootstrapContext for the given WorkManager and XATerminator.
SimpleBurlapServiceExporter - Class in org.springframework.remoting.caucho
HTTP request handler that exports the specified service bean as Burlap service endpoint, accessible via a Burlap proxy.
SimpleBurlapServiceExporter() - Constructor for class org.springframework.remoting.caucho.SimpleBurlapServiceExporter

SimpleClientHttpRequestFactory - Class in org.springframework.http.client
ClientHttpRequestFactory implementation that uses standard J2SE facilities.
SimpleClientHttpRequestFactory() - Constructor for class org.springframework.http.client.SimpleClientHttpRequestFactory

SimpleConnectionHandle - Class in org.springframework.jdbc.datasource
Simple implementation of the ConnectionHandle interface, containing a given JDBC Connection.
SimpleConnectionHandle(Connection) - Constructor for class org.springframework.jdbc.datasource.SimpleConnectionHandle
Create a new SimpleConnectionHandle for the given Connection.
SimpleControllerHandlerAdapter - Class in org.springframework.web.portlet.mvc
Adapter to use the Controller workflow interface with the generic DispatcherPortlet.
SimpleControllerHandlerAdapter() - Constructor for class org.springframework.web.portlet.mvc.SimpleControllerHandlerAdapter

SimpleControllerHandlerAdapter - Class in org.springframework.web.servlet.mvc
Adapter to use the plain Controller workflow interface with the generic DispatcherServlet.
SimpleControllerHandlerAdapter() - Constructor for class org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter

SimpleDriverDataSource - Class in org.springframework.jdbc.datasource
Simple implementation of the standard JDBC DataSource interface, configuring a plain old JDBC Driver via bean properties, and returning a new Connection from every getConnection call.
SimpleDriverDataSource() - Constructor for class org.springframework.jdbc.datasource.SimpleDriverDataSource
Constructor for bean-style configuration.
SimpleDriverDataSource(Driver, String) - Constructor for class org.springframework.jdbc.datasource.SimpleDriverDataSource
Create a new DriverManagerDataSource with the given standard Driver parameters.
SimpleDriverDataSource(Driver, String, String, String) - Constructor for class org.springframework.jdbc.datasource.SimpleDriverDataSource
Create a new DriverManagerDataSource with the given standard Driver parameters.
SimpleDriverDataSource(Driver, String, Properties) - Constructor for class org.springframework.jdbc.datasource.SimpleDriverDataSource
Create a new DriverManagerDataSource with the given standard Driver parameters.
SimpleFormController - Class in org.springframework.web.portlet.mvc
Deprecated. as of Spring 3.0, in favor of annotated controllers
SimpleFormController() - Constructor for class org.springframework.web.portlet.mvc.SimpleFormController
Deprecated. Create a new SimpleFormController.
SimpleFormController - Class in org.springframework.web.servlet.mvc
Deprecated. as of Spring 3.0, in favor of annotated controllers
SimpleFormController() - Constructor for class org.springframework.web.servlet.mvc.SimpleFormController
Deprecated. Create a new SimpleFormController.
SimpleHessianServiceExporter - Class in org.springframework.remoting.caucho
HTTP request handler that exports the specified service bean as Hessian service endpoint, accessible via a Hessian proxy.
SimpleHessianServiceExporter() - Constructor for class org.springframework.remoting.caucho.SimpleHessianServiceExporter

SimpleHttpInvokerRequestExecutor - Class in org.springframework.remoting.httpinvoker
HttpInvokerRequestExecutor implementation that uses standard J2SE facilities to execute POST requests, without support for HTTP authentication or advanced configuration options.
SimpleHttpInvokerRequestExecutor() - Constructor for class org.springframework.remoting.httpinvoker.SimpleHttpInvokerRequestExecutor

SimpleHttpInvokerServiceExporter - Class in org.springframework.remoting.httpinvoker
HTTP request handler that exports the specified service bean as HTTP invoker service endpoint, accessible via an HTTP invoker proxy.
SimpleHttpInvokerServiceExporter() - Constructor for class org.springframework.remoting.httpinvoker.SimpleHttpInvokerServiceExporter

SimpleHttpServerFactoryBean - Class in org.springframework.remoting.support
FactoryBean that creates a simple HTTP server, based on the HTTP server that is included in Sun's JRE 1.6.
SimpleHttpServerFactoryBean() - Constructor for class org.springframework.remoting.support.SimpleHttpServerFactoryBean

SimpleHttpServerJaxWsServiceExporter - Class in org.springframework.remoting.jaxws
Simple exporter for JAX-WS services, autodetecting annotated service beans (through the JAX-WS WebService annotation) and exporting them through the HTTP server included in Sun's JDK 1.6.
SimpleHttpServerJaxWsServiceExporter() - Constructor for class org.springframework.remoting.jaxws.SimpleHttpServerJaxWsServiceExporter

SimpleInstantiationStrategy - Class in org.springframework.beans.factory.support
Simple object instantiation strategy for use in a BeanFactory.
SimpleInstantiationStrategy() - Constructor for class org.springframework.beans.factory.support.SimpleInstantiationStrategy

SimpleInstrumentableClassLoader - Class in org.springframework.instrument.classloading
Simplistic implementation of an instrumentable ClassLoader.
SimpleInstrumentableClassLoader(ClassLoader) - Constructor for class org.springframework.instrument.classloading.SimpleInstrumentableClassLoader
Create a new SimpleLoadTimeWeaver for the given ClassLoader.
SimpleJaxWsServiceExporter - Class in org.springframework.remoting.jaxws
Simple exporter for JAX-WS services, autodetecting annotated service beans (through the JAX-WS WebService annotation) and exporting them with a configured base address (by default "http://localhost:8080/") using the JAX-WS provider's built-in publication support.
SimpleJaxWsServiceExporter() - Constructor for class org.springframework.remoting.jaxws.SimpleJaxWsServiceExporter

SimpleJdbcCall - Class in org.springframework.jdbc.core.simple
A SimpleJdbcCall is a multi-threaded, reusable object representing a call to a stored procedure or a stored function.
SimpleJdbcCall(DataSource) - Constructor for class org.springframework.jdbc.core.simple.SimpleJdbcCall
Constructor that takes one parameter with the JDBC DataSource to use when creating the JdbcTemplate.
SimpleJdbcCall(JdbcTemplate) - Constructor for class org.springframework.jdbc.core.simple.SimpleJdbcCall
Alternative Constructor that takes one parameter with the JdbcTemplate to be used.
SimpleJdbcCallOperations - Interface in org.springframework.jdbc.core.simple
Interface specifying the API for a Simple JDBC Call implemented by SimpleJdbcCall.
SimpleJdbcDaoSupport - Class in org.springframework.jdbc.core.simple
Extension of JdbcDaoSupport that exposes a SimpleJdbcTemplate as well.
SimpleJdbcDaoSupport() - Constructor for class org.springframework.jdbc.core.simple.SimpleJdbcDaoSupport

SimpleJdbcInsert - Class in org.springframework.jdbc.core.simple
A SimpleJdbcInsert is a multi-threaded, reusable object providing easy insert capabilities for a table.
SimpleJdbcInsert(DataSource) - Constructor for class org.springframework.jdbc.core.simple.SimpleJdbcInsert
Constructor that takes one parameter with the JDBC DataSource to use when creating the JdbcTemplate.
SimpleJdbcInsert(JdbcTemplate) - Constructor for class org.springframework.jdbc.core.simple.SimpleJdbcInsert
Alternative Constructor that takes one parameter with the JdbcTemplate to be used.
SimpleJdbcInsertOperations - Interface in org.springframework.jdbc.core.simple
Interface specifying the API for a Simple JDBC Insert implemented by SimpleJdbcInsert.
SimpleJdbcOperations - Interface in org.springframework.jdbc.core.simple
JDBC operations interface usable on Java 5 and above, exposing a set of common JDBC operations, whose interface is simplified through the use of varargs and autoboxing.
SimpleJdbcTemplate - Class in org.springframework.jdbc.core.simple
Java-5-based convenience wrapper for the classic Spring JdbcTemplate, taking advantage of varargs and autoboxing, and exposing only the most commonly required operations in order to simplify JdbcTemplate usage.
SimpleJdbcTemplate(DataSource) - Constructor for class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
Create a new SimpleJdbcTemplate for the given DataSource.
SimpleJdbcTemplate(JdbcOperations) - Constructor for class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
Create a new SimpleJdbcTemplate for the given classic Spring JdbcTemplate.
SimpleJdbcTemplate(NamedParameterJdbcOperations) - Constructor for class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
Create a new SimpleJdbcTemplate for the given Spring NamedParameterJdbcTemplate.
simpleJdbcTemplate - Variable in class org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests
Deprecated.
simpleJdbcTemplate - Variable in class org.springframework.test.context.junit38.AbstractTransactionalJUnit38SpringContextTests
The SimpleJdbcTemplate that this base class manages, available to subclasses.
simpleJdbcTemplate - Variable in class org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests
The SimpleJdbcTemplate that this base class manages, available to subclasses.
simpleJdbcTemplate - Variable in class org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests
The SimpleJdbcTemplate that this base class manages, available to subclasses.
SimpleJdbcTestUtils - Class in org.springframework.test.jdbc
A Java-5-based collection of JDBC related utility functions intended to simplify standard database testing scenarios.
SimpleJdbcTestUtils() - Constructor for class org.springframework.test.jdbc.SimpleJdbcTestUtils

SimpleJndiBeanFactory - Class in org.springframework.jndi.support
Simple JNDI-based implementation of Spring's BeanFactory interface.
SimpleJndiBeanFactory() - Constructor for class org.springframework.jndi.support.SimpleJndiBeanFactory

SimpleLoadTimeWeaver - Class in org.springframework.instrument.classloading
LoadTimeWeaver that builds and exposes a SimpleInstrumentableClassLoader.
SimpleLoadTimeWeaver() - Constructor for class org.springframework.instrument.classloading.SimpleLoadTimeWeaver
Create a new SimpleLoadTimeWeaver for the current context ClassLoader.
SimpleLoadTimeWeaver(SimpleInstrumentableClassLoader) - Constructor for class org.springframework.instrument.classloading.SimpleLoadTimeWeaver
Create a new SimpleLoadTimeWeaver for the given ClassLoader.
SimpleLocaleContext - Class in org.springframework.context.i18n
Simple implementation of the LocaleContext interface, always returning a specified Locale.
SimpleLocaleContext(Locale) - Constructor for class org.springframework.context.i18n.SimpleLocaleContext
Create a new SimpleLocaleContext that exposes the specified Locale.
SimpleMailMessage - Class in org.springframework.mail
Models a simple mail message, including data such as the from, to, cc, subject, and text fields.
SimpleMailMessage() - Constructor for class org.springframework.mail.SimpleMailMessage
Create a new SimpleMailMessage.
SimpleMailMessage(SimpleMailMessage) - Constructor for class org.springframework.mail.SimpleMailMessage
Copy constructor for creating a new SimpleMailMessage from the state of an existing SimpleMailMessage instance.
SimpleMappingExceptionResolver - Class in org.springframework.web.portlet.handler
HandlerExceptionResolver implementation that allows for mapping exception class names to view names, either for a set of given handlers or for all handlers in the DispatcherPortlet.
SimpleMappingExceptionResolver() - Constructor for class org.springframework.web.portlet.handler.SimpleMappingExceptionResolver

SimpleMappingExceptionResolver - Class in org.springframework.web.servlet.handler
HandlerExceptionResolver implementation that allows for mapping exception class names to view names, either for a set of given handlers or for all handlers in the DispatcherServlet.
SimpleMappingExceptionResolver() - Constructor for class org.springframework.web.servlet.handler.SimpleMappingExceptionResolver

simpleMatch(String, String) - Static method in class org.springframework.util.PatternMatchUtils
Match a String against the given pattern, supporting the following simple pattern styles: "xxx*", "*xxx", "*xxx*" and "xxx*yyy" matches (with an arbitrary number of pattern parts), as well as direct equality.
simpleMatch(String[], String) - Static method in class org.springframework.util.PatternMatchUtils
Match a String against the given patterns, supporting the following simple pattern styles: "xxx*", "*xxx", "*xxx*" and "xxx*yyy" matches (with an arbitrary number of pattern parts), as well as direct equality.
SimpleMessageConverter - Class in org.springframework.jms.support.converter
A simple message converter which is able to handle TextMessages, BytesMessages, MapMessages, and ObjectMessages.
SimpleMessageConverter() - Constructor for class org.springframework.jms.support.converter.SimpleMessageConverter

SimpleMessageConverter102 - Class in org.springframework.jms.support.converter
Deprecated. as of Spring 3.0, in favor of the JMS 1.1 based SimpleMessageConverter
SimpleMessageConverter102() - Constructor for class org.springframework.jms.support.converter.SimpleMessageConverter102
Deprecated.
SimpleMessageListenerContainer - Class in org.springframework.jms.listener
Message listener container that uses the plain JMS client API's MessageConsumer.setMessageListener() method to create concurrent MessageConsumers for the specified listeners.
SimpleMessageListenerContainer() - Constructor for class org.springframework.jms.listener.SimpleMessageListenerContainer

SimpleMessageListenerContainer102 - Class in org.springframework.jms.listener
Deprecated. as of Spring 3.0, in favor of the JMS 1.1 based SimpleMessageListenerContainer
SimpleMessageListenerContainer102() - Constructor for class org.springframework.jms.listener.SimpleMessageListenerContainer102
Deprecated.
SimpleMetadataAwareAspectInstanceFactory - Class in org.springframework.aop.aspectj.annotation
Implementation of MetadataAwareAspectInstanceFactory that creates a new instance of the specified aspect class for every SimpleAspectInstanceFactory.getAspectInstance() call.
SimpleMetadataAwareAspectInstanceFactory(Class, String) - Constructor for class org.springframework.aop.aspectj.annotation.SimpleMetadataAwareAspectInstanceFactory
Create a new SimpleMetadataAwareAspectInstanceFactory for the given aspect class.
SimpleMetadataReaderFactory - Class in org.springframework.core.type.classreading
Simple implementation of the MetadataReaderFactory interface, creating a new ASM org.springframework.asm.ClassReader for every request.
SimpleMetadataReaderFactory() - Constructor for class org.springframework.core.type.classreading.SimpleMetadataReaderFactory
Create a new SimpleMetadataReaderFactory for the default class loader.
SimpleMetadataReaderFactory(ResourceLoader) - Constructor for class org.springframework.core.type.classreading.SimpleMetadataReaderFactory
Create a new SimpleMetadataReaderFactory for the given resource loader.
SimpleMetadataReaderFactory(ClassLoader) - Constructor for class org.springframework.core.type.classreading.SimpleMetadataReaderFactory
Create a new SimpleMetadataReaderFactory for the given class loader.
SimpleNamespaceContext - Class in org.springframework.util.xml
Simple javax.xml.namespace.NamespaceContext implementation.
SimpleNamespaceContext() - Constructor for class org.springframework.util.xml.SimpleNamespaceContext

SimpleNamingContext - Class in org.springframework.mock.jndi
Simple implementation of a JNDI naming context.
SimpleNamingContext() - Constructor for class org.springframework.mock.jndi.SimpleNamingContext
Create a new naming context.
SimpleNamingContext(String) - Constructor for class org.springframework.mock.jndi.SimpleNamingContext
Create a new naming context with the given naming root.
SimpleNamingContext(String, Hashtable<String, Object>, Hashtable<String, Object>) - Constructor for class org.springframework.mock.jndi.SimpleNamingContext
Create a new naming context with the given naming root, the given name/object map, and the JNDI environment entries.
SimpleNamingContextBuilder - Class in org.springframework.mock.jndi
Simple implementation of a JNDI naming context builder.
SimpleNamingContextBuilder() - Constructor for class org.springframework.mock.jndi.SimpleNamingContextBuilder

SimpleNativeJdbcExtractor - Class in org.springframework.jdbc.support.nativejdbc
Simple implementation of the NativeJdbcExtractor interface.
SimpleNativeJdbcExtractor() - Constructor for class org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor

SimplePortletHandlerAdapter - Class in org.springframework.web.portlet.handler
Adapter to use the Portlet interface with the generic DispatcherPortlet.
SimplePortletHandlerAdapter() - Constructor for class org.springframework.web.portlet.handler.SimplePortletHandlerAdapter

SimplePortletPostProcessor - Class in org.springframework.web.portlet.handler
Bean post-processor that applies initialization and destruction callbacks to beans that implement the Portlet interface.
SimplePortletPostProcessor() - Constructor for class org.springframework.web.portlet.handler.SimplePortletPostProcessor

SimplePropertyNamespaceHandler - Class in org.springframework.beans.factory.xml
Simple NamespaceHandler implementation that maps custom attributes directly through to bean properties.
SimplePropertyNamespaceHandler() - Constructor for class org.springframework.beans.factory.xml.SimplePropertyNamespaceHandler

SimpleRecordOperation - Class in org.springframework.jca.cci.object
EIS operation object that accepts a passed-in CCI input Record and returns a corresponding CCI output Record.
SimpleRecordOperation() - Constructor for class org.springframework.jca.cci.object.SimpleRecordOperation
Constructor that allows use as a JavaBean.
SimpleRecordOperation(ConnectionFactory, InteractionSpec) - Constructor for class org.springframework.jca.cci.object.SimpleRecordOperation
Convenient constructor with ConnectionFactory and specifications (connection and interaction).
SimpleReflectiveMBeanInfoAssembler - Class in org.springframework.jmx.export.assembler
Simple subclass of AbstractReflectiveMBeanInfoAssembler that always votes yes for method and property inclusion, effectively exposing all public methods and properties as operations and attributes.
SimpleReflectiveMBeanInfoAssembler() - Constructor for class org.springframework.jmx.export.assembler.SimpleReflectiveMBeanInfoAssembler

SimpleRemoteSlsbInvokerInterceptor - Class in org.springframework.ejb.access
Basic invoker for a remote Stateless Session Bean.
SimpleRemoteSlsbInvokerInterceptor() - Constructor for class org.springframework.ejb.access.SimpleRemoteSlsbInvokerInterceptor

SimpleRemoteStatelessSessionProxyFactoryBean - Class in org.springframework.ejb.access
Convenient FactoryBean for remote SLSB proxies.
SimpleRemoteStatelessSessionProxyFactoryBean() - Constructor for class org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean

SimpleSaxErrorHandler - Class in org.springframework.util.xml
Simple org.xml.sax.ErrorHandler implementation: logs warnings using the given Commons Logging logger instance, and rethrows errors to discontinue the XML transformation.
SimpleSaxErrorHandler(Log) - Constructor for class org.springframework.util.xml.SimpleSaxErrorHandler
Create a new SimpleSaxErrorHandler for the given Commons Logging logger instance.
SimpleSecurityContextProvider - Class in org.springframework.beans.factory.support
Simple SecurityContextProvider implementation.
SimpleSecurityContextProvider() - Constructor for class org.springframework.beans.factory.support.SimpleSecurityContextProvider
Construct a new SimpleSecurityContextProvider instance.
SimpleSecurityContextProvider(AccessControlContext) - Constructor for class org.springframework.beans.factory.support.SimpleSecurityContextProvider
Construct a new SimpleSecurityContextProvider instance.
SimpleServletHandlerAdapter - Class in org.springframework.web.servlet.handler
Adapter to use the Servlet interface with the generic DispatcherServlet.
SimpleServletHandlerAdapter() - Constructor for class org.springframework.web.servlet.handler.SimpleServletHandlerAdapter

SimpleServletPostProcessor - Class in org.springframework.web.servlet.handler
BeanPostProcessor that applies initialization and destruction callbacks to beans that implement the Servlet interface.
SimpleServletPostProcessor() - Constructor for class org.springframework.web.servlet.handler.SimpleServletPostProcessor

SimpleSessionStatus - Class in org.springframework.web.bind.support
Simple implementation of the SessionStatus interface, keeping the complete flag as an instance variable.
SimpleSessionStatus() - Constructor for class org.springframework.web.bind.support.SimpleSessionStatus

SimpleSpringBeanELResolver - Class in org.springframework.beans.factory.access.el
Simple concrete variant of SpringBeanELResolver, delegating to a given BeanFactory that the resolver was constructed with.
SimpleSpringBeanELResolver(BeanFactory) - Constructor for class org.springframework.beans.factory.access.el.SimpleSpringBeanELResolver
Create a new SimpleSpringBeanELResolver for the given BeanFactory.
SimpleSpringPreparerFactory - Class in org.springframework.web.servlet.view.tiles2
Tiles2 PreparerFactory implementation that expects preparer class names and builds preparer instances for those, creating them through the Spring ApplicationContext in order to apply Spring container callbacks and configured Spring BeanPostProcessors.
SimpleSpringPreparerFactory() - Constructor for class org.springframework.web.servlet.view.tiles2.SimpleSpringPreparerFactory

SimpleTaskWorkManager - Class in org.springframework.jca.work
Simple JCA 1.5 WorkManager implementation that delegates to a Spring TaskExecutor.
SimpleTaskWorkManager() - Constructor for class org.springframework.jca.work.SimpleTaskWorkManager

SimpleTheme - Class in org.springframework.ui.context.support
Default Theme implementation, wrapping a name and an underlying MessageSource.
SimpleTheme(String, MessageSource) - Constructor for class org.springframework.ui.context.support.SimpleTheme
Create a SimpleTheme.
SimpleThreadPoolTaskExecutor - Class in org.springframework.scheduling.quartz
Subclass of Quartz's SimpleThreadPool that implements Spring's TaskExecutor interface and listens to Spring lifecycle callbacks.
SimpleThreadPoolTaskExecutor() - Constructor for class org.springframework.scheduling.quartz.SimpleThreadPoolTaskExecutor

SimpleThreadScope - Class in org.springframework.context.support
Thread-backed Scope implementation.
SimpleThreadScope() - Constructor for class org.springframework.context.support.SimpleThreadScope

SimpleThrowawayClassLoader - Class in org.springframework.instrument.classloading
ClassLoader that can be used to load classes without bringing them into the parent loader.
SimpleThrowawayClassLoader(ClassLoader) - Constructor for class org.springframework.instrument.classloading.SimpleThrowawayClassLoader
Create a new SimpleThrowawayClassLoader for the given class loader.
SimpleTraceInterceptor - Class in org.springframework.aop.interceptor
Simple AOP Alliance MethodInterceptor that can be introduced in a chain to display verbose trace information about intercepted method invocations, with method entry and method exit info.
SimpleTraceInterceptor() - Constructor for class org.springframework.aop.interceptor.SimpleTraceInterceptor
Create a new SimpleTraceInterceptor with a static logger.
SimpleTraceInterceptor(boolean) - Constructor for class org.springframework.aop.interceptor.SimpleTraceInterceptor
Create a new SimpleTraceInterceptor with dynamic or static logger, according to the given flag.
SimpleTransactionFactory - Class in org.springframework.transaction.jta
Default implementation of the TransactionFactory strategy interface, simply wrapping a standard JTA TransactionManager.
SimpleTransactionFactory(TransactionManager) - Constructor for class org.springframework.transaction.jta.SimpleTransactionFactory
Create a new SimpleTransactionFactory for the given TransactionManager
SimpleTransactionStatus - Class in org.springframework.transaction.support
A simple TransactionStatus implementation.
SimpleTransactionStatus() - Constructor for class org.springframework.transaction.support.SimpleTransactionStatus
Create a new instance of the SimpleTransactionStatus class, indicating a new transaction.
SimpleTransactionStatus(boolean) - Constructor for class org.springframework.transaction.support.SimpleTransactionStatus
Create a new instance of the SimpleTransactionStatus class.
SimpleTransformErrorListener - Class in org.springframework.util.xml
Simple javax.xml.transform.ErrorListener implementation: logs warnings using the given Commons Logging logger instance, and rethrows errors to discontinue the XML transformation.
SimpleTransformErrorListener(Log) - Constructor for class org.springframework.util.xml.SimpleTransformErrorListener
Create a new SimpleTransformErrorListener for the given Commons Logging logger instance.
SimpleTriggerBean - Class in org.springframework.scheduling.quartz
Convenience subclass of Quartz's SimpleTrigger class, making bean-style usage easier.
SimpleTriggerBean() - Constructor for class org.springframework.scheduling.quartz.SimpleTriggerBean

SimpleTriggerContext - Class in org.springframework.scheduling.support
Simple data holder implementation of the TriggerContext interface.
SimpleTriggerContext() - Constructor for class org.springframework.scheduling.support.SimpleTriggerContext

SimpleTypeConverter - Class in org.springframework.beans
Simple implementation of the TypeConverter interface that does not operate on any specific target object.
SimpleTypeConverter() - Constructor for class org.springframework.beans.SimpleTypeConverter

SimpleUrlHandlerMapping - Class in org.springframework.web.servlet.handler
Implementation of the HandlerMapping interface to map from URLs to request handler beans.
SimpleUrlHandlerMapping() - Constructor for class org.springframework.web.servlet.handler.SimpleUrlHandlerMapping

SingleColumnRowMapper<T> - Class in org.springframework.jdbc.core
RowMapper implementation that converts a single column into a single result value per row.
SingleColumnRowMapper() - Constructor for class org.springframework.jdbc.core.SingleColumnRowMapper
Create a new SingleColumnRowMapper.
SingleColumnRowMapper(Class<T>) - Constructor for class org.springframework.jdbc.core.SingleColumnRowMapper
Create a new SingleColumnRowMapper.
SingleConnectionDataSource - Class in org.springframework.jdbc.datasource
Implementation of SmartDataSource that wraps a single JDBC Connection which is not closed after use.
SingleConnectionDataSource() - Constructor for class org.springframework.jdbc.datasource.SingleConnectionDataSource
Constructor for bean-style configuration.
SingleConnectionDataSource(String, String, String, String, boolean) - Constructor for class org.springframework.jdbc.datasource.SingleConnectionDataSource
Deprecated. since Spring 2.5. Driver parameter usage is generally not recommended for a SingleConnectionDataSource. If you insist on using driver parameters directly, set up the Driver class manually before invoking this DataSource.
SingleConnectionDataSource(String, String, String, boolean) - Constructor for class org.springframework.jdbc.datasource.SingleConnectionDataSource
Create a new SingleConnectionDataSource with the given standard DriverManager parameters.
SingleConnectionDataSource(String, boolean) - Constructor for class org.springframework.jdbc.datasource.SingleConnectionDataSource
Create a new SingleConnectionDataSource with the given standard DriverManager parameters.
SingleConnectionDataSource(Connection, boolean) - Constructor for class org.springframework.jdbc.datasource.SingleConnectionDataSource
Create a new SingleConnectionDataSource with a given Connection.
SingleConnectionFactory - Class in org.springframework.jca.cci.connection
A CCI ConnectionFactory adapter that returns the same Connection on all getConnection calls, and ignores calls to Connection.close().
SingleConnectionFactory() - Constructor for class org.springframework.jca.cci.connection.SingleConnectionFactory
Create a new SingleConnectionFactory for bean-style usage.
SingleConnectionFactory(Connection) - Constructor for class org.springframework.jca.cci.connection.SingleConnectionFactory
Create a new SingleConnectionFactory that always returns the given Connection.
SingleConnectionFactory(ConnectionFactory) - Constructor for class org.springframework.jca.cci.connection.SingleConnectionFactory
Create a new SingleConnectionFactory that always returns a single Connection which it will lazily create via the given target ConnectionFactory.
SingleConnectionFactory - Class in org.springframework.jms.connection
A JMS ConnectionFactory adapter that returns the same Connection from all SingleConnectionFactory.createConnection() calls, and ignores calls to Connection.close().
SingleConnectionFactory() - Constructor for class org.springframework.jms.connection.SingleConnectionFactory
Create a new SingleConnectionFactory for bean-style usage.
SingleConnectionFactory(Connection) - Constructor for class org.springframework.jms.connection.SingleConnectionFactory
Create a new SingleConnectionFactory that always returns the given Connection.
SingleConnectionFactory(ConnectionFactory) - Constructor for class org.springframework.jms.connection.SingleConnectionFactory
Create a new SingleConnectionFactory that always returns a single Connection that it will lazily create via the given target ConnectionFactory.
SingleConnectionFactory102 - Class in org.springframework.jms.connection
Deprecated. as of Spring 3.0, in favor of the JMS 1.1 based SingleConnectionFactory
SingleConnectionFactory102() - Constructor for class org.springframework.jms.connection.SingleConnectionFactory102
Deprecated. Create a new SingleConnectionFactory102 for bean-style usage.
SingleConnectionFactory102(ConnectionFactory, boolean) - Constructor for class org.springframework.jms.connection.SingleConnectionFactory102
Deprecated. Create a new SingleConnectionFactory102 that always returns a single Connection that it will lazily create via the given target ConnectionFactory.
SingleDataSourceLookup - Class in org.springframework.jdbc.datasource.lookup
An implementation of the DataSourceLookup that simply wraps a single given DataSource, returned for any data source name.
SingleDataSourceLookup(DataSource) - Constructor for class org.springframework.jdbc.datasource.lookup.SingleDataSourceLookup
Create a new instance of the SingleDataSourceLookup class.
singleResult(Collection<T>) - Static method in class org.springframework.dao.support.DataAccessUtils
Return a single result object from the given Collection.
SINGLETON_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate

SINGLETON_KEY - Static variable in class org.springframework.beans.factory.support.PropertiesBeanDefinitionReader
Special key to distinguish owner.(singleton)=false.
SingletonAspectInstanceFactory - Class in org.springframework.aop.aspectj
Implementation of AspectInstanceFactory that is backed by a specified singleton object, returning the same instance for every SingletonAspectInstanceFactory.getAspectInstance() call.
SingletonAspectInstanceFactory(Object) - Constructor for class org.springframework.aop.aspectj.SingletonAspectInstanceFactory
Create a new SingletonAspectInstanceFactory for the given aspect instance.
SingletonBeanFactoryLocator - Class in org.springframework.beans.factory.access
Keyed-singleton implementation of BeanFactoryLocator, which accesses shared Spring BeanFactory instances.
SingletonBeanFactoryLocator(String) - Constructor for class org.springframework.beans.factory.access.SingletonBeanFactoryLocator
Constructor which uses the the specified name as the resource name of the definition file(s).
SingletonBeanRegistry - Interface in org.springframework.beans.factory.config
Interface that defines a registry for shared bean instances.
SingletonMetadataAwareAspectInstanceFactory - Class in org.springframework.aop.aspectj.annotation
Implementation of MetadataAwareAspectInstanceFactory that is backed by a specified singleton object, returning the same instance for every SingletonAspectInstanceFactory.getAspectInstance() call.
SingletonMetadataAwareAspectInstanceFactory(Object, String) - Constructor for class org.springframework.aop.aspectj.annotation.SingletonMetadataAwareAspectInstanceFactory
Create a new SingletonMetadataAwareAspectInstanceFactory for the given aspect.
SingletonTargetSource - Class in org.springframework.aop.target
Implementation of the TargetSource interface that holds a given object.
SingletonTargetSource(Object) - Constructor for class org.springframework.aop.target.SingletonTargetSource
Create a new SingletonTargetSource for the given target.
size() - Method in class org.springframework.beans.MutablePropertyValues
Return the number of PropertyValue entries in the list.
size() - Method in class org.springframework.http.HttpHeaders

size() - Method in class org.springframework.util.AutoPopulatingList

size() - Method in class org.springframework.util.CachingMapDecorator

size() - Method in class org.springframework.util.LinkedMultiValueMap

SIZE_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.InputTag

skip - Variable in class org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement

SKIP_REQUIRED_CHECK_ATTRIBUTE - Static variable in class org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor
Bean definition attribute that may indicate whether a given bean is supposed to be skipped when performing this post-processor's required property check.
sleepInbetweenRecoveryAttempts() - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Sleep according to the specified recovery interval.
SmartApplicationListener - Interface in org.springframework.context.event
Extended variant of the standard ApplicationListener interface, exposing further metadata such as the supported event type.
SmartClassLoader - Interface in org.springframework.core
Interface to be implemented by a reloading-aware ClassLoader (e.g.
SmartConnectionFactory - Interface in org.springframework.jms.connection
Extension of the javax.jms.ConnectionFactory interface, indicating how to release Connections obtained from it.
SmartDataSource - Interface in org.springframework.jdbc.datasource
Extension of the javax.sql.DataSource interface, to be implemented by special DataSources that return JDBC Connections in an unwrapped fashion.
SmartFactoryBean<T> - Interface in org.springframework.beans.factory
Extension of the FactoryBean interface.
SmartInstantiationAwareBeanPostProcessor - Interface in org.springframework.beans.factory.config
Extension of the InstantiationAwareBeanPostProcessor interface, adding a callback for predicting the eventual type of a processed bean.
SmartLifecycle - Interface in org.springframework.context
An extension of the Lifecycle interface for those objects that require to be started upon ApplicationContext refresh and/or shutdown in a particular order.
SmartPersistenceUnitInfo - Interface in org.springframework.orm.jpa.persistenceunit
Extension of the standard JPA PersistenceUnitInfo interface, for advanced collaboration between Spring's LocalEntityManagerFactoryBean and PersistenceUnitManager implementations.
SmartSessionBean - Interface in org.springframework.ejb.support
Interface to be implemented by Session Beans that want to expose important state to cooperating classes.
SmartTransactionObject - Interface in org.springframework.transaction.support
Interface to be implemented by transaction objects that are able to return an internal rollback-only marker, typically from a another transaction that has participated and marked it as rollback-only.
snapshot() - Method in class org.springframework.beans.factory.parsing.ParseState
Create a new instance of ParseState which is an independent snapshot of this instance.
SoapFaultException - Exception in org.springframework.remoting.soap
RemoteInvocationFailureException subclass that provides the details of a SOAP fault.
SoapFaultException(String, Throwable) - Constructor for exception org.springframework.remoting.soap.SoapFaultException
Constructor for SoapFaultException.
sort(List, SortDefinition) - Static method in class org.springframework.beans.support.PropertyComparator
Sort the given List according to the given sort definition.
sort(Object[], SortDefinition) - Static method in class org.springframework.beans.support.PropertyComparator
Sort the given source according to the given sort definition.
sort(List<?>) - Static method in class org.springframework.core.OrderComparator
Sort the given List with a default OrderComparator.
sort(Object[]) - Static method in class org.springframework.core.OrderComparator
Sort the given array with a default OrderComparator.
sortAdvisors(List<Advisor>) - Method in class org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator
Sort the rest by AspectJ precedence.
sortAdvisors(List<Advisor>) - Method in class org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
Sort advisors based on ordering.
sortByQualityValue(List<MediaType>) - Static method in class org.springframework.http.MediaType
Sorts the given list of MediaType objects by quality value.
sortBySpecificity(List<MediaType>) - Static method in class org.springframework.http.MediaType
Sorts the given list of MediaType objects by specificity.
SortDefinition - Interface in org.springframework.beans.support
Definition for sorting bean instances by a property.
SortedResourcesFactoryBean - Class in org.springframework.jdbc.config
FactoryBean implementation that takes a list of location Strings and creates a sorted array of Resource instances.
SortedResourcesFactoryBean(List<String>) - Constructor for class org.springframework.jdbc.config.SortedResourcesFactoryBean

SortedResourcesFactoryBean(ResourceLoader, List<String>) - Constructor for class org.springframework.jdbc.config.SortedResourcesFactoryBean

sortStringArray(String[]) - Static method in class org.springframework.util.StringUtils
Turn given source String array into sorted array.
SourceExtractor - Interface in org.springframework.beans.factory.parsing
Simple strategy allowing tools to control how source metadata is attached to the bean definition metadata.
SourceFilteringListener - Class in org.springframework.context.event
ApplicationListener decorator that filters events from a specified event source, invoking its delegate listener for matching ApplicationEvent objects only.
SourceFilteringListener(Object, ApplicationListener) - Constructor for class org.springframework.context.event.SourceFilteringListener
Create a SourceFilteringListener for the given event source.
SourceFilteringListener(Object) - Constructor for class org.springframework.context.event.SourceFilteringListener
Create a SourceFilteringListener for the given event source, expecting subclasses to override the SourceFilteringListener.onApplicationEventInternal(org.springframework.context.ApplicationEvent) method (instead of specifying a delegate listener).
SourceHttpMessageConverter<T extends Source> - Class in org.springframework.http.converter.xml
Implementation of HttpMessageConverter that can read and write Source objects.
SourceHttpMessageConverter() - Constructor for class org.springframework.http.converter.xml.SourceHttpMessageConverter

SPAN_TAG - Static variable in class org.springframework.web.servlet.tags.form.ErrorsTag
The HTML 'span' tag.
SpelEvaluationException - Exception in org.springframework.expression.spel
Root exception for Spring EL related exceptions.
SpelEvaluationException(SpelMessage, Object...) - Constructor for exception org.springframework.expression.spel.SpelEvaluationException

SpelEvaluationException(int, SpelMessage, Object...) - Constructor for exception org.springframework.expression.spel.SpelEvaluationException

SpelEvaluationException(int, Throwable, SpelMessage, Object...) - Constructor for exception org.springframework.expression.spel.SpelEvaluationException

SpelEvaluationException(Throwable, SpelMessage, Object...) - Constructor for exception org.springframework.expression.spel.SpelEvaluationException

SpelExpression - Class in org.springframework.expression.spel.standard
A SpelExpressions represents a parsed (valid) expression that is ready to be evaluated in a specified context.
SpelExpression(String, SpelNodeImpl, SpelParserConfiguration) - Constructor for class org.springframework.expression.spel.standard.SpelExpression
Construct an expression, only used by the parser.
SpelExpressionParser - Class in org.springframework.expression.spel.standard
SpEL parser.
SpelExpressionParser() - Constructor for class org.springframework.expression.spel.standard.SpelExpressionParser
Create a parser with standard configuration.
SpelExpressionParser(SpelParserConfiguration) - Constructor for class org.springframework.expression.spel.standard.SpelExpressionParser
Create a parser with some configured behavior.
SpelMessage - Enum in org.springframework.expression.spel
Contains all the messages that can be produced by the Spring Expression Language.
SpelMessage.Kind - Enum in org.springframework.expression.spel

SpelNode - Interface in org.springframework.expression.spel
Represents a node in the Ast for a parsed expression.
SpelNodeImpl - Class in org.springframework.expression.spel.ast
The common supertype of all AST nodes in a parsed Spring Expression Language format expression.
SpelNodeImpl(int, SpelNodeImpl...) - Constructor for class org.springframework.expression.spel.ast.SpelNodeImpl

SpelParseException - Exception in org.springframework.expression.spel
Root exception for Spring EL related exceptions.
SpelParseException(String, int, SpelMessage, Object...) - Constructor for exception org.springframework.expression.spel.SpelParseException

SpelParseException(int, SpelMessage, Object...) - Constructor for exception org.springframework.expression.spel.SpelParseException

SpelParseException(int, Throwable, SpelMessage, Object...) - Constructor for exception org.springframework.expression.spel.SpelParseException

SpelParserConfiguration - Class in org.springframework.expression.spel
Configuration object for the SpEL expression parser.
SpelParserConfiguration(boolean, boolean) - Constructor for class org.springframework.expression.spel.SpelParserConfiguration

split(String, String) - Static method in class org.springframework.util.StringUtils
Split a String at the first occurrence of the delimiter.
splitArrayElementsIntoProperties(String[], String) - Static method in class org.springframework.util.StringUtils
Take an array Strings and split each element based on the given delimiter.
splitArrayElementsIntoProperties(String[], String, String) - Static method in class org.springframework.util.StringUtils
Take an array Strings and split each element based on the given delimiter.
splitSqlScript(String, char, List<String>) - Static method in class org.springframework.test.jdbc.JdbcTestUtils
Split an SQL script into separate statements delimited with the provided delimiter character.
SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE - Static variable in class org.springframework.web.servlet.view.AbstractTemplateView
Variable name of the RequestContext instance in the template model, available to Spring's macros: e.g.
SPRING_RESOURCE_LOADER - Static variable in class org.springframework.ui.velocity.SpringResourceLoader

SPRING_RESOURCE_LOADER_CACHE - Static variable in class org.springframework.ui.velocity.SpringResourceLoader

SPRING_RESOURCE_LOADER_CLASS - Static variable in class org.springframework.ui.velocity.SpringResourceLoader

SPRING_RESOURCE_LOADER_PATH - Static variable in class org.springframework.ui.velocity.SpringResourceLoader

SpringBeanAutowiringInterceptor - Class in org.springframework.ejb.interceptor
EJB3-compliant interceptor class that injects Spring beans into fields and methods which are annotated with @Autowired.
SpringBeanAutowiringInterceptor() - Constructor for class org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor

SpringBeanAutowiringSupport - Class in org.springframework.web.context.support
Convenient base class for self-autowiring classes that gets constructed within a Spring-based web application.
SpringBeanAutowiringSupport() - Constructor for class org.springframework.web.context.support.SpringBeanAutowiringSupport
This constructor performs injection on this instance, based on the current web application context.
SpringBeanELResolver - Class in org.springframework.beans.factory.access.el
Unified EL ELResolver that delegates to a Spring BeanFactory, resolving name references to Spring-defined beans.
SpringBeanELResolver() - Constructor for class org.springframework.beans.factory.access.el.SpringBeanELResolver

SpringBeanFacesELResolver - Class in org.springframework.web.jsf.el
JSF 1.2 ELResolver that delegates to the Spring root WebApplicationContext, resolving name references to Spring-defined beans.
SpringBeanFacesELResolver() - Constructor for class org.springframework.web.jsf.el.SpringBeanFacesELResolver

SpringBeanJobFactory - Class in org.springframework.scheduling.quartz
Subclass of AdaptableJobFactory that also supports Spring-style dependency injection on bean properties.
SpringBeanJobFactory() - Constructor for class org.springframework.scheduling.quartz.SpringBeanJobFactory

SpringBeanPreparerFactory - Class in org.springframework.web.servlet.view.tiles2
Tiles2 PreparerFactory implementation that expects preparer bean names and obtains preparer beans from the Spring ApplicationContext.
SpringBeanPreparerFactory() - Constructor for class org.springframework.web.servlet.view.tiles2.SpringBeanPreparerFactory

SpringBeanVariableResolver - Class in org.springframework.web.jsf
This is a subclass of the JSF 1.1 DelegatingVariableResolver, letting Spring bean definitions override other attributes of the same name.
SpringBeanVariableResolver(VariableResolver) - Constructor for class org.springframework.web.jsf.SpringBeanVariableResolver

SpringBindingActionForm - Class in org.springframework.web.struts
Deprecated. as of Spring 3.0
SpringBindingActionForm() - Constructor for class org.springframework.web.struts.SpringBindingActionForm
Deprecated.
SpringConstraintValidatorFactory - Class in org.springframework.validation.beanvalidation
JSR-303 ConstraintValidatorFactory implementation that delegates to a Spring BeanFactory for creating autowired ConstraintValidator instances.
SpringConstraintValidatorFactory(AutowireCapableBeanFactory) - Constructor for class org.springframework.validation.beanvalidation.SpringConstraintValidatorFactory
Create a new SpringConstraintValidatorFactory for the given BeanFactory.
SpringContextResourceAdapter - Class in org.springframework.jca.context
JCA 1.5 ResourceAdapter implementation that loads a Spring ApplicationContext, starting and stopping Spring-managed beans as part of the ResourceAdapter's lifecycle.
SpringContextResourceAdapter() - Constructor for class org.springframework.jca.context.SpringContextResourceAdapter

SpringFailOnTimeout - Class in org.springframework.test.context.junit4.statements
SpringFailOnTimeout is a custom JUnit 4.5+ Statement which adds support for Spring's @Timed annotation by throwing an exception if the next statement in the execution chain takes more than the specified number of milliseconds.
SpringFailOnTimeout(Statement, long) - Constructor for class org.springframework.test.context.junit4.statements.SpringFailOnTimeout
Constructs a new SpringFailOnTimeout statement.
SpringJtaSynchronizationAdapter - Class in org.springframework.transaction.jta
Adapter that implements the JTA Synchronization interface delegating to an underlying Spring TransactionSynchronization.
SpringJtaSynchronizationAdapter(TransactionSynchronization) - Constructor for class org.springframework.transaction.jta.SpringJtaSynchronizationAdapter
Create a new SpringJtaSynchronizationAdapter for the given Spring TransactionSynchronization and JTA TransactionManager.
SpringJtaSynchronizationAdapter(TransactionSynchronization, UserTransaction) - Constructor for class org.springframework.transaction.jta.SpringJtaSynchronizationAdapter
Create a new SpringJtaSynchronizationAdapter for the given Spring TransactionSynchronization and JTA TransactionManager.
SpringJtaSynchronizationAdapter(TransactionSynchronization, TransactionManager) - Constructor for class org.springframework.transaction.jta.SpringJtaSynchronizationAdapter
Create a new SpringJtaSynchronizationAdapter for the given Spring TransactionSynchronization and JTA TransactionManager.
SpringJUnit4ClassRunner - Class in org.springframework.test.context.junit4
SpringJUnit4ClassRunner is a custom extension of BlockJUnit4ClassRunner which provides functionality of the Spring TestContext Framework to standard JUnit 4.5+ tests by means of the TestContextManager and associated support classes and annotations.
SpringJUnit4ClassRunner(Class<?>) - Constructor for class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
Constructs a new SpringJUnit4ClassRunner and initializes a TestContextManager to provide Spring testing functionality to standard JUnit tests.
SpringLobCreatorSynchronization - Class in org.springframework.jdbc.support.lob
Callback for resource cleanup at the end of a Spring transaction.
SpringLobCreatorSynchronization(LobCreator) - Constructor for class org.springframework.jdbc.support.lob.SpringLobCreatorSynchronization
Create a SpringLobCreatorSynchronization for the given LobCreator.
SpringLocaleResolver - Class in org.springframework.web.servlet.view.tiles2
Tiles LocaleResolver adapter that delegates to a Spring LocaleResolver, exposing the DispatcherServlet-managed locale.
SpringLocaleResolver() - Constructor for class org.springframework.web.servlet.view.tiles2.SpringLocaleResolver

SpringModelMBean - Class in org.springframework.jmx.export
Extension of the RequiredModelMBean class that ensures the thread context ClassLoader is switched for the managed resource's ClassLoader before any invocations occur.
SpringModelMBean() - Constructor for class org.springframework.jmx.export.SpringModelMBean
Construct a new SpringModelMBean instance with an empty ModelMBeanInfo.
SpringModelMBean(ModelMBeanInfo) - Constructor for class org.springframework.jmx.export.SpringModelMBean
Construct a new SpringModelMBean instance with the given ModelMBeanInfo.
SpringPersistenceManagerProxyBean - Class in org.springframework.orm.jdo.support
Proxy that implements the PersistenceManager interface, delegating to the current thread-bound PersistenceManager (the Spring-managed transactional PersistenceManager or the single OpenPersistenceManagerInView PersistenceManager, if any) on each invocation.
SpringPersistenceManagerProxyBean() - Constructor for class org.springframework.orm.jdo.support.SpringPersistenceManagerProxyBean

SpringProxy - Interface in org.springframework.aop
Marker interface implemented by all AOP proxies.
SpringRepeat - Class in org.springframework.test.context.junit4.statements
SpringRepeat is a custom JUnit 4.5+ Statement which adds support for Spring's @Repeat annotation by repeating the test for the specified number of times.
SpringRepeat(Statement, Method, int) - Constructor for class org.springframework.test.context.junit4.statements.SpringRepeat
Constructs a new SpringRepeat statement.
SpringResourceLoader - Class in org.springframework.ui.velocity
Velocity ResourceLoader adapter that loads via a Spring ResourceLoader.
SpringResourceLoader() - Constructor for class org.springframework.ui.velocity.SpringResourceLoader

SpringSessionContext - Class in org.springframework.orm.hibernate3
Implementation of Hibernate 3.1's CurrentSessionContext interface that delegates to Spring's SessionFactoryUtils for providing a Spring-managed current Session.
SpringSessionContext(SessionFactoryImplementor) - Constructor for class org.springframework.orm.hibernate3.SpringSessionContext
Create a new SpringSessionContext for the given Hibernate SessionFactory.
SpringTemplateLoader - Class in org.springframework.ui.freemarker
FreeMarker TemplateLoader adapter that loads via a Spring ResourceLoader.
SpringTemplateLoader(ResourceLoader, String) - Constructor for class org.springframework.ui.freemarker.SpringTemplateLoader
Create a new SpringTemplateLoader.
springTestContextAfterTestClass() - Method in class org.springframework.test.context.testng.AbstractTestNGSpringContextTests
Delegates to the configured TestContextManager to call 'after test class' callbacks.
springTestContextAfterTestMethod(Method) - Method in class org.springframework.test.context.testng.AbstractTestNGSpringContextTests
Delegates to the configured TestContextManager to post-process the test method after the actual test has executed.
springTestContextBeforeTestClass() - Method in class org.springframework.test.context.testng.AbstractTestNGSpringContextTests
Delegates to the configured TestContextManager to call 'before test class' callbacks.
springTestContextBeforeTestMethod(Method) - Method in class org.springframework.test.context.testng.AbstractTestNGSpringContextTests
Delegates to the configured TestContextManager to pre-process the test method before the actual test is executed.
springTestContextPrepareTestInstance() - Method in class org.springframework.test.context.testng.AbstractTestNGSpringContextTests
Delegates to the configured TestContextManager to prepare this test instance prior to execution of any individual tests, for example for injecting dependencies, etc.
SpringTilesApplicationContextFactory - Class in org.springframework.web.servlet.view.tiles2
Spring-specific subclass of the standard Tiles AbstractTilesApplicationContextFactory, passing given properties through as Tiles init-param map.
SpringTilesApplicationContextFactory() - Constructor for class org.springframework.web.servlet.view.tiles2.SpringTilesApplicationContextFactory

SpringTransactionAnnotationParser - Class in org.springframework.transaction.annotation
Strategy implementation for parsing Spring's Transactional annotation.
SpringTransactionAnnotationParser() - Constructor for class org.springframework.transaction.annotation.SpringTransactionAnnotationParser

SpringTransactionFactory - Class in org.springframework.orm.hibernate3
Spring-aware implementation of the Hibernate TransactionFactory interface, aware of Spring-synchronized transactions (in particular Spring-managed JTA transactions) and asking for default release mode ON_CLOSE.
SpringTransactionFactory() - Constructor for class org.springframework.orm.hibernate3.SpringTransactionFactory

SpringValidatorAdapter - Class in org.springframework.validation.beanvalidation
Adapter that takes a JSR-303 javax.validator.Validator and exposes it as a Spring Validator while also exposing the original JSR-303 Validator interface itself.
SpringValidatorAdapter(Validator) - Constructor for class org.springframework.validation.beanvalidation.SpringValidatorAdapter
Create a new SpringValidatorAdapter for the given JSR-303 Validator.
SpringVersion - Class in org.springframework.core
Class that exposes the Spring version.
SpringVersion() - Constructor for class org.springframework.core.SpringVersion

SQL_ERROR_CODE_DEFAULT_PATH - Static variable in class org.springframework.jdbc.support.SQLErrorCodesFactory
The name of default SQL error code files, loading from the class path.
SQL_ERROR_CODE_OVERRIDE_PATH - Static variable in class org.springframework.jdbc.support.SQLErrorCodesFactory
The name of custom SQL error codes file, loading from the root of the class path (e.g.
SqlCall - Class in org.springframework.jdbc.object
RdbmsOperation using a JdbcTemplate and representing a SQL-based call such as a stored procedure or a stored function.
SqlCall() - Constructor for class org.springframework.jdbc.object.SqlCall
Constructor to allow use as a JavaBean.
SqlCall(DataSource, String) - Constructor for class org.springframework.jdbc.object.SqlCall
Create a new SqlCall object with SQL, but without parameters.
SQLErrorCodes - Class in org.springframework.jdbc.support
JavaBean for holding JDBC error codes for a particular database.
SQLErrorCodes() - Constructor for class org.springframework.jdbc.support.SQLErrorCodes

SQLErrorCodesFactory - Class in org.springframework.jdbc.support
Factory for creating SQLErrorCodes based on the "databaseProductName" taken from the DatabaseMetaData.
SQLErrorCodesFactory() - Constructor for class org.springframework.jdbc.support.SQLErrorCodesFactory
Create a new instance of the SQLErrorCodesFactory class.
SQLErrorCodeSQLExceptionTranslator - Class in org.springframework.jdbc.support
Implementation of SQLExceptionTranslator that analyzes vendor-specific error codes.
SQLErrorCodeSQLExceptionTranslator() - Constructor for class org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator
Constructor for use as a JavaBean.
SQLErrorCodeSQLExceptionTranslator(DataSource) - Constructor for class org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator
Create a SQL error code translator for the given DataSource.
SQLErrorCodeSQLExceptionTranslator(String) - Constructor for class org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator
Create a SQL error code translator for the given database product name.
SQLErrorCodeSQLExceptionTranslator(SQLErrorCodes) - Constructor for class org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator
Create a SQLErrorCode translator given these error codes.
SQLExceptionSubclassTranslator - Class in org.springframework.jdbc.support
SQLExceptionTranslator implementation which analyzes the specific SQLException subclass thrown by the JDBC driver.
SQLExceptionSubclassTranslator() - Constructor for class org.springframework.jdbc.support.SQLExceptionSubclassTranslator

SQLExceptionTranslator - Interface in org.springframework.jdbc.support
Strategy interface for translating between SQLExceptions and Spring's data access strategy-agnostic DataAccessException hierarchy.
SqlFunction<T> - Class in org.springframework.jdbc.object
SQL "function" wrapper for a query that returns a single row of results.
SqlFunction() - Constructor for class org.springframework.jdbc.object.SqlFunction
Constructor to allow use as a JavaBean.
SqlFunction(DataSource, String) - Constructor for class org.springframework.jdbc.object.SqlFunction
Create a new SqlFunction object with SQL, but without parameters.
SqlFunction(DataSource, String, int[]) - Constructor for class org.springframework.jdbc.object.SqlFunction
Create a new SqlFunction object with SQL and parameters.
SqlFunction(DataSource, String, int[], Class<T>) - Constructor for class org.springframework.jdbc.object.SqlFunction
Create a new SqlFunction object with SQL, parameters and a result type.
SqlInOutParameter - Class in org.springframework.jdbc.core
Subclass of SqlOutParameter to represent an INOUT parameter.
SqlInOutParameter(String, int) - Constructor for class org.springframework.jdbc.core.SqlInOutParameter
Create a new SqlInOutParameter.
SqlInOutParameter(String, int, int) - Constructor for class org.springframework.jdbc.core.SqlInOutParameter
Create a new SqlInOutParameter.
SqlInOutParameter(String, int, String) - Constructor for class org.springframework.jdbc.core.SqlInOutParameter
Create a new SqlInOutParameter.
SqlInOutParameter(String, int, String, SqlReturnType) - Constructor for class org.springframework.jdbc.core.SqlInOutParameter
Create a new SqlInOutParameter.
SqlInOutParameter(String, int, ResultSetExtractor) - Constructor for class org.springframework.jdbc.core.SqlInOutParameter
Create a new SqlInOutParameter.
SqlInOutParameter(String, int, RowCallbackHandler) - Constructor for class org.springframework.jdbc.core.SqlInOutParameter
Create a new SqlInOutParameter.
SqlInOutParameter(String, int, RowMapper) - Constructor for class org.springframework.jdbc.core.SqlInOutParameter
Create a new SqlInOutParameter.
SqlLobValue - Class in org.springframework.jdbc.core.support
Object to represent an SQL BLOB/CLOB value parameter.
SqlLobValue(byte[]) - Constructor for class org.springframework.jdbc.core.support.SqlLobValue
Create a new BLOB value with the given byte array, using a DefaultLobHandler.
SqlLobValue(byte[], LobHandler) - Constructor for class org.springframework.jdbc.core.support.SqlLobValue
Create a new BLOB value with the given byte array.
SqlLobValue(String) - Constructor for class org.springframework.jdbc.core.support.SqlLobValue
Create a new CLOB value with the given content string, using a DefaultLobHandler.
SqlLobValue(String, LobHandler) - Constructor for class org.springframework.jdbc.core.support.SqlLobValue
Create a new CLOB value with the given content string.
SqlLobValue(InputStream, int) - Constructor for class org.springframework.jdbc.core.support.SqlLobValue
Create a new BLOB/CLOB value with the given stream, using a DefaultLobHandler.
SqlLobValue(InputStream, int, LobHandler) - Constructor for class org.springframework.jdbc.core.support.SqlLobValue
Create a new BLOB/CLOB value with the given stream.
SqlLobValue(Reader, int) - Constructor for class org.springframework.jdbc.core.support.SqlLobValue
Create a new CLOB value with the given character stream, using a DefaultLobHandler.
SqlLobValue(Reader, int, LobHandler) - Constructor for class org.springframework.jdbc.core.support.SqlLobValue
Create a new CLOB value with the given character stream.
SqlMapClientCallback<T> - Interface in org.springframework.orm.ibatis
Callback interface for data access code that works with the iBATIS SqlMapExecutor interface.
SqlMapClientDaoSupport - Class in org.springframework.orm.ibatis.support
Convenient super class for iBATIS SqlMapClient data access objects.
SqlMapClientDaoSupport() - Constructor for class org.springframework.orm.ibatis.support.SqlMapClientDaoSupport

SqlMapClientFactoryBean - Class in org.springframework.orm.ibatis
FactoryBean that creates an iBATIS SqlMapClient.
SqlMapClientFactoryBean() - Constructor for class org.springframework.orm.ibatis.SqlMapClientFactoryBean

SqlMapClientOperations - Interface in org.springframework.orm.ibatis
Interface that specifies a basic set of iBATIS SqlMapClient operations, implemented by SqlMapClientTemplate.
SqlMapClientTemplate - Class in org.springframework.orm.ibatis
Helper class that simplifies data access via the iBATIS SqlMapClient API, converting checked SQLExceptions into unchecked DataAccessExceptions, following the org.springframework.dao exception hierarchy.
SqlMapClientTemplate() - Constructor for class org.springframework.orm.ibatis.SqlMapClientTemplate
Create a new SqlMapClientTemplate.
SqlMapClientTemplate(SqlMapClient) - Constructor for class org.springframework.orm.ibatis.SqlMapClientTemplate
Create a new SqlMapTemplate.
SqlMapClientTemplate(DataSource, SqlMapClient) - Constructor for class org.springframework.orm.ibatis.SqlMapClientTemplate
Create a new SqlMapTemplate.
SqlOperation - Class in org.springframework.jdbc.object
Operation object representing a SQL-based operation such as a query or update, as opposed to a stored procedure.
SqlOperation() - Constructor for class org.springframework.jdbc.object.SqlOperation

SqlOutParameter - Class in org.springframework.jdbc.core
Subclass of SqlParameter to represent an output parameter.
SqlOutParameter(String, int) - Constructor for class org.springframework.jdbc.core.SqlOutParameter
Create a new SqlOutParameter.
SqlOutParameter(String, int, int) - Constructor for class org.springframework.jdbc.core.SqlOutParameter
Create a new SqlOutParameter.
SqlOutParameter(String, int, String) - Constructor for class org.springframework.jdbc.core.SqlOutParameter
Create a new SqlOutParameter.
SqlOutParameter(String, int, String, SqlReturnType) - Constructor for class org.springframework.jdbc.core.SqlOutParameter
Create a new SqlOutParameter.
SqlOutParameter(String, int, ResultSetExtractor) - Constructor for class org.springframework.jdbc.core.SqlOutParameter
Create a new SqlOutParameter.
SqlOutParameter(String, int, RowCallbackHandler) - Constructor for class org.springframework.jdbc.core.SqlOutParameter
Create a new SqlOutParameter.
SqlOutParameter(String, int, RowMapper) - Constructor for class org.springframework.jdbc.core.SqlOutParameter
Create a new SqlOutParameter.
SqlParameter - Class in org.springframework.jdbc.core
Object to represent a SQL parameter definition.
SqlParameter(int) - Constructor for class org.springframework.jdbc.core.SqlParameter
Create a new anonymous SqlParameter, supplying the SQL type.
SqlParameter(int, String) - Constructor for class org.springframework.jdbc.core.SqlParameter
Create a new anonymous SqlParameter, supplying the SQL type.
SqlParameter(int, int) - Constructor for class org.springframework.jdbc.core.SqlParameter
Create a new anonymous SqlParameter, supplying the SQL type.
SqlParameter(String, int) - Constructor for class org.springframework.jdbc.core.SqlParameter
Create a new SqlParameter, supplying name and SQL type.
SqlParameter(String, int, String) - Constructor for class org.springframework.jdbc.core.SqlParameter
Create a new SqlParameter, supplying name and SQL type.
SqlParameter(String, int, int) - Constructor for class org.springframework.jdbc.core.SqlParameter
Create a new SqlParameter, supplying name and SQL type.
SqlParameter(SqlParameter) - Constructor for class org.springframework.jdbc.core.SqlParameter
Copy constructor.
SqlParameterSource - Interface in org.springframework.jdbc.core.namedparam
Interface that defines common functionality for objects that can offer parameter values for named SQL parameters, serving as argument for NamedParameterJdbcTemplate operations.
SqlParameterSourceUtils - Class in org.springframework.jdbc.core.namedparam
Class that provides helper methods for the use of SqlParameterSource with SimpleJdbc classes.
SqlParameterSourceUtils() - Constructor for class org.springframework.jdbc.core.namedparam.SqlParameterSourceUtils

SqlParameterValue - Class in org.springframework.jdbc.core
Object to represent a SQL parameter value, including parameter metadata such as the SQL type and the scale for numeric values.
SqlParameterValue(int, Object) - Constructor for class org.springframework.jdbc.core.SqlParameterValue
Create a new SqlParameterValue, supplying the SQL type.
SqlParameterValue(int, String, Object) - Constructor for class org.springframework.jdbc.core.SqlParameterValue
Create a new SqlParameterValue, supplying the SQL type.
SqlParameterValue(int, int, Object) - Constructor for class org.springframework.jdbc.core.SqlParameterValue
Create a new SqlParameterValue, supplying the SQL type.
SqlParameterValue(SqlParameter, Object) - Constructor for class org.springframework.jdbc.core.SqlParameterValue
Create a new SqlParameterValue based on the given SqlParameter declaration.
SqlProvider - Interface in org.springframework.jdbc.core
Interface to be implemented by objects that can provide SQL strings.
SqlQuery<T> - Class in org.springframework.jdbc.object
Reusable operation object representing a SQL query.
SqlQuery() - Constructor for class org.springframework.jdbc.object.SqlQuery
Constructor to allow use as a JavaBean.
SqlQuery(DataSource, String) - Constructor for class org.springframework.jdbc.object.SqlQuery
Convenient constructor with a DataSource and SQL string.
SqlReturnResultSet - Class in org.springframework.jdbc.core
Represents a returned ResultSet from a stored procedure call.
SqlReturnResultSet(String, ResultSetExtractor) - Constructor for class org.springframework.jdbc.core.SqlReturnResultSet
Create a new instance of the SqlReturnResultSet class.
SqlReturnResultSet(String, RowCallbackHandler) - Constructor for class org.springframework.jdbc.core.SqlReturnResultSet
Create a new instance of the SqlReturnResultSet class.
SqlReturnResultSet(String, RowMapper) - Constructor for class org.springframework.jdbc.core.SqlReturnResultSet
Create a new instance of the SqlReturnResultSet class.
SqlReturnType - Interface in org.springframework.jdbc.core
Interface to be implemented for retrieving values for more complex database-specific types not supported by the standard CallableStatement.getObject method.
SqlReturnUpdateCount - Class in org.springframework.jdbc.core
Represents a returned update count from a stored procedure call.
SqlReturnUpdateCount(String) - Constructor for class org.springframework.jdbc.core.SqlReturnUpdateCount
Create a new instance of the SqlReturnUpdateCount class.
SqlRowSet - Interface in org.springframework.jdbc.support.rowset
Mirror interface for javax.sql.RowSet, representing disconnected java.sql.ResultSet data.
SqlRowSetMetaData - Interface in org.springframework.jdbc.support.rowset
Meta data interface for Spring's SqlRowSet, analogous to javax.sql.ResultSetMetaData
SqlRowSetResultSetExtractor - Class in org.springframework.jdbc.core
ResultSetExtractor implementation that returns a Spring SqlRowSet representation for each given ResultSet.
SqlRowSetResultSetExtractor() - Constructor for class org.springframework.jdbc.core.SqlRowSetResultSetExtractor

SqlServerCallMetaDataProvider - Class in org.springframework.jdbc.core.metadata
SQL Server specific implementation for the CallMetaDataProvider interface.
SqlServerCallMetaDataProvider(DatabaseMetaData) - Constructor for class org.springframework.jdbc.core.metadata.SqlServerCallMetaDataProvider

SqlServerMaxValueIncrementer - Class in org.springframework.jdbc.support.incrementer
DataFieldMaxValueIncrementer that increments the maximum value of a given SQL Server table with the equivalent of an auto-increment column.
SqlServerMaxValueIncrementer() - Constructor for class org.springframework.jdbc.support.incrementer.SqlServerMaxValueIncrementer
Default constructor for bean property style usage.
SqlServerMaxValueIncrementer(DataSource, String, String) - Constructor for class org.springframework.jdbc.support.incrementer.SqlServerMaxValueIncrementer
Convenience constructor.
SQLStateSQLExceptionTranslator - Class in org.springframework.jdbc.support
SQLExceptionTranslator implementation that analyzes the SQL state in the SQLException based on the first two digits (the SQL state "class").
SQLStateSQLExceptionTranslator() - Constructor for class org.springframework.jdbc.support.SQLStateSQLExceptionTranslator

sqlTypes() - Method in class org.springframework.orm.hibernate3.support.BlobByteArrayType

sqlTypes() - Method in class org.springframework.orm.hibernate3.support.BlobSerializableType

sqlTypes() - Method in class org.springframework.orm.hibernate3.support.BlobStringType

sqlTypes() - Method in class org.springframework.orm.hibernate3.support.ClobStringType

sqlTypesToAnonymousParameterList(int[]) - Static method in class org.springframework.jdbc.core.SqlParameter
Convert a list of JDBC types, as defined in java.sql.Types, to a List of SqlParameter objects as used in this package.
SqlTypeValue - Interface in org.springframework.jdbc.core
Interface to be implemented for setting values for more complex database-specific types not supported by the standard setObject method.
SqlUpdate - Class in org.springframework.jdbc.object
Reusable operation object representing a SQL update.
SqlUpdate() - Constructor for class org.springframework.jdbc.object.SqlUpdate
Constructor to allow use as a JavaBean.
SqlUpdate(DataSource, String) - Constructor for class org.springframework.jdbc.object.SqlUpdate
Constructs an update object with a given DataSource and SQL.
SqlUpdate(DataSource, String, int[]) - Constructor for class org.springframework.jdbc.object.SqlUpdate
Construct an update object with a given DataSource, SQL and anonymous parameters.
SqlUpdate(DataSource, String, int[], int) - Constructor for class org.springframework.jdbc.object.SqlUpdate
Construct an update object with a given DataSource, SQL, anonymous parameters and specifying the maximum number of rows that may be affected.
SqlValue - Interface in org.springframework.jdbc.support
Simple interface for complex types to be set as statement parameters.
SQLWarning() - Method in exception org.springframework.jdbc.SQLWarningException
Return the underlying SQLWarning.
SQLWarningException - Exception in org.springframework.jdbc
Exception thrown when we're not ignoring SQLWarnings.
SQLWarningException(String, SQLWarning) - Constructor for exception org.springframework.jdbc.SQLWarningException
Constructor for SQLWarningException.
SqlXmlFeatureNotImplementedException - Exception in org.springframework.jdbc.support.xml
Exception thrown when the underlying implementation does not support the requested feature of the API.
SqlXmlFeatureNotImplementedException(String) - Constructor for exception org.springframework.jdbc.support.xml.SqlXmlFeatureNotImplementedException
Constructor for SqlXmlFeatureNotImplementedException.
SqlXmlFeatureNotImplementedException(String, Throwable) - Constructor for exception org.springframework.jdbc.support.xml.SqlXmlFeatureNotImplementedException
Constructor for SqlXmlFeatureNotImplementedException.
SqlXmlHandler - Interface in org.springframework.jdbc.support.xml
Abstraction for handling XML fields in specific databases.
SqlXmlObjectMappingHandler - Interface in org.springframework.jdbc.support.xml
Abstraction for handling XML object mapping to fields in a database.
SqlXmlValue - Interface in org.springframework.jdbc.support.xml
Subinterface of SqlValue that supports passing in XML data to specified column and adds a cleanup callback, to be invoked after the value has been set and the corresponding statement has been executed.
StandardAnnotationMetadata - Class in org.springframework.core.type
AnnotationMetadata implementation that uses standard reflection to introspect a given Class.
StandardAnnotationMetadata(Class) - Constructor for class org.springframework.core.type.StandardAnnotationMetadata
Create a new StandardAnnotationMetadata wrapper for the given Class.
StandardBeanExpressionResolver - Class in org.springframework.context.expression
Standard implementation of the BeanExpressionResolver interface, parsing and evaluating Spring EL using Spring's expression module.
StandardBeanExpressionResolver() - Constructor for class org.springframework.context.expression.StandardBeanExpressionResolver

StandardClassMetadata - Class in org.springframework.core.type
ClassMetadata implementation that uses standard reflection to introspect a given Class.
StandardClassMetadata(Class) - Constructor for class org.springframework.core.type.StandardClassMetadata
Create a new StandardClassMetadata wrapper for the given Class.
StandardEvaluationContext - Class in org.springframework.expression.spel.support
Provides a default EvaluationContext implementation.
StandardEvaluationContext() - Constructor for class org.springframework.expression.spel.support.StandardEvaluationContext

StandardEvaluationContext(Object) - Constructor for class org.springframework.expression.spel.support.StandardEvaluationContext

StandardJmsActivationSpecFactory - Class in org.springframework.jms.listener.endpoint
Standard implementation of the JmsActivationSpecFactory interface.
StandardJmsActivationSpecFactory() - Constructor for class org.springframework.jms.listener.endpoint.StandardJmsActivationSpecFactory

StandardMethodMetadata - Class in org.springframework.core.type
MethodMetadata implementation that uses standard reflection to introspect a given Method.
StandardMethodMetadata(Method) - Constructor for class org.springframework.core.type.StandardMethodMetadata
Create a new StandardMethodMetadata wrapper for the given Method.
StandardOperatorOverloader - Class in org.springframework.expression.spel.support

StandardOperatorOverloader() - Constructor for class org.springframework.expression.spel.support.StandardOperatorOverloader

StandardPersistenceManagerProxyBean - Class in org.springframework.orm.jdo.support
Proxy that implements the PersistenceManager interface, delegating to a thread-bound PersistenceManager on each invocation - as defined by the JDO 2.1 specification.
StandardPersistenceManagerProxyBean() - Constructor for class org.springframework.orm.jdo.support.StandardPersistenceManagerProxyBean

StandardTypeComparator - Class in org.springframework.expression.spel.support
A simple basic TypeComparator implementation.
StandardTypeComparator() - Constructor for class org.springframework.expression.spel.support.StandardTypeComparator

StandardTypeConverter - Class in org.springframework.expression.spel.support
Default implementation of the TypeConverter interface, delegating to a core Spring ConversionService.
StandardTypeConverter() - Constructor for class org.springframework.expression.spel.support.StandardTypeConverter

StandardTypeConverter(ConversionService) - Constructor for class org.springframework.expression.spel.support.StandardTypeConverter

StandardTypeLocator - Class in org.springframework.expression.spel.support
A default implementation of a TypeLocator that uses the context classloader (or any classloader set upon it).
StandardTypeLocator() - Constructor for class org.springframework.expression.spel.support.StandardTypeLocator

StandardTypeLocator(ClassLoader) - Constructor for class org.springframework.expression.spel.support.StandardTypeLocator

start() - Method in interface org.springframework.context.Lifecycle
Start this component.
start() - Method in class org.springframework.context.support.AbstractApplicationContext

start() - Method in class org.springframework.context.support.DefaultLifecycleProcessor
Start all registered beans that implement Lifecycle and are not already running.
start(BootstrapContext) - Method in class org.springframework.jca.context.SpringContextResourceAdapter
This implementation loads a Spring ApplicationContext through the SpringContextResourceAdapter.createApplicationContext(javax.resource.spi.BootstrapContext) template method.
start() - Method in class org.springframework.jca.endpoint.GenericMessageEndpointManager
Activates the configured message endpoint.
start() - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Start this container.
start() - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Overridden to reset the stop callback, if any.
start(Properties) - Method in class org.springframework.orm.hibernate3.LocalCacheProviderProxy

start(Settings, Properties) - Method in class org.springframework.orm.hibernate3.LocalRegionFactoryProxy

start() - Method in class org.springframework.scheduling.commonj.TimerManagerAccessor
Resumes the underlying TimerManager (if not shared).
start() - Method in class org.springframework.scheduling.quartz.SchedulerFactoryBean

start() - Method in class org.springframework.util.StopWatch
Start an unnamed task.
start(String) - Method in class org.springframework.util.StopWatch
Start a named task.
startNewTransaction() - Method in class org.springframework.test.AbstractTransactionalSpringContextTests
Deprecated. Start a new transaction.
startScheduler(Scheduler, int) - Method in class org.springframework.scheduling.quartz.SchedulerFactoryBean
Start the Quartz Scheduler, respecting the "startupDelay" setting.
startSharedConnection() - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Start the shared Connection.
startSharedConnection() - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
This implementations proceeds even after an exception thrown from Connection.start(), relying on listeners to perform appropriate recovery.
startsWithIgnoreCase(String, String) - Static method in class org.springframework.util.StringUtils
Test if the given String starts with the specified prefix, ignoring upper/lower case.
startTag(String) - Method in class org.springframework.web.servlet.tags.form.TagWriter
Start a new tag with the supplied name.
startWork(Work) - Method in class org.springframework.jca.work.SimpleTaskWorkManager

startWork(Work, long, ExecutionContext, WorkListener) - Method in class org.springframework.jca.work.SimpleTaskWorkManager

startWork(Work) - Method in class org.springframework.jca.work.WorkManagerTaskExecutor

startWork(Work, long, ExecutionContext, WorkListener) - Method in class org.springframework.jca.work.WorkManagerTaskExecutor

state(boolean, String) - Static method in class org.springframework.util.Assert
Assert a boolean expression, throwing IllegalStateException if the test result is false.
state(boolean) - Static method in class org.springframework.util.Assert
Assert a boolean expression, throwing IllegalStateException if the test result is false.
STATE_COMMITTED - Static variable in exception org.springframework.transaction.HeuristicCompletionException

STATE_MIXED - Static variable in exception org.springframework.transaction.HeuristicCompletionException

STATE_ROLLED_BACK - Static variable in exception org.springframework.transaction.HeuristicCompletionException

STATE_UNKNOWN - Static variable in exception org.springframework.transaction.HeuristicCompletionException
Values for the outcome state of a heuristically completed transaction.
StatementCallback<T> - Interface in org.springframework.jdbc.core
Generic callback interface for code that operates on a JDBC Statement.
StatementCreatorUtils - Class in org.springframework.jdbc.core
Utility methods for PreparedStatementSetter/Creator and CallableStatementCreator implementations, providing sophisticated parameter management (including support for LOB values).
StatementCreatorUtils() - Constructor for class org.springframework.jdbc.core.StatementCreatorUtils

StaticApplicationContext - Class in org.springframework.context.support
ApplicationContext implementation which supports programmatic registration of beans and messages, rather than reading bean definitions from external configuration sources.
StaticApplicationContext() - Constructor for class org.springframework.context.support.StaticApplicationContext
Create a new StaticApplicationContext.
StaticApplicationContext(ApplicationContext) - Constructor for class org.springframework.context.support.StaticApplicationContext
Create a new StaticApplicationContext with the given parent.
StaticLabeledEnum - Class in org.springframework.core.enums
Deprecated. as of Spring 3.0, in favor of Java 5 enums.
StaticLabeledEnum(int, String) - Constructor for class org.springframework.core.enums.StaticLabeledEnum
Deprecated. Create a new StaticLabeledEnum instance.
StaticLabeledEnumResolver - Class in org.springframework.core.enums
Deprecated. as of Spring 3.0, in favor of Java 5 enums.
StaticLabeledEnumResolver() - Constructor for class org.springframework.core.enums.StaticLabeledEnumResolver
Deprecated.
StaticListableBeanFactory - Class in org.springframework.beans.factory.support
Static BeanFactory implementation which allows to register existing singleton instances programmatically.
StaticListableBeanFactory() - Constructor for class org.springframework.beans.factory.support.StaticListableBeanFactory

StaticMessageSource - Class in org.springframework.context.support
Simple implementation of MessageSource which allows messages to be registered programmatically.
StaticMessageSource() - Constructor for class org.springframework.context.support.StaticMessageSource

StaticMethodMatcher - Class in org.springframework.aop.support
Convenient abstract superclass for static method matchers, which don't care about arguments at runtime.
StaticMethodMatcher() - Constructor for class org.springframework.aop.support.StaticMethodMatcher

StaticMethodMatcherPointcut - Class in org.springframework.aop.support
Convenient superclass when we want to force subclasses to implement the MethodMatcher interface but subclasses will want to be pointcuts.
StaticMethodMatcherPointcut() - Constructor for class org.springframework.aop.support.StaticMethodMatcherPointcut

StaticMethodMatcherPointcutAdvisor - Class in org.springframework.aop.support
Convenient base class for Advisors that are also static pointcuts.
StaticMethodMatcherPointcutAdvisor() - Constructor for class org.springframework.aop.support.StaticMethodMatcherPointcutAdvisor
Create a new StaticMethodMatcherPointcutAdvisor, expecting bean-style configuration.
StaticMethodMatcherPointcutAdvisor(Advice) - Constructor for class org.springframework.aop.support.StaticMethodMatcherPointcutAdvisor
Create a new StaticMethodMatcherPointcutAdvisor for the given advice.
StaticPortletApplicationContext - Class in org.springframework.web.portlet.context
Static Portlet-based ApplicationContext implementation for testing.
StaticPortletApplicationContext() - Constructor for class org.springframework.web.portlet.context.StaticPortletApplicationContext

StaticScriptSource - Class in org.springframework.scripting.support
Static implementation of the ScriptSource interface, encapsulating a given String that contains the script source text.
StaticScriptSource(String) - Constructor for class org.springframework.scripting.support.StaticScriptSource
Create a new StaticScriptSource for the given script.
StaticScriptSource(String, String) - Constructor for class org.springframework.scripting.support.StaticScriptSource
Create a new StaticScriptSource for the given script.
StaticWebApplicationContext - Class in org.springframework.web.context.support
Static WebApplicationContext implementation for testing.
StaticWebApplicationContext() - Constructor for class org.springframework.web.context.support.StaticWebApplicationContext

STATUS_COMMITTED - Static variable in interface org.springframework.transaction.support.TransactionSynchronization
Completion status in case of proper commit
STATUS_ROLLED_BACK - Static variable in interface org.springframework.transaction.support.TransactionSynchronization
Completion status in case of proper rollback
STATUS_UNKNOWN - Static variable in interface org.springframework.transaction.support.TransactionSynchronization
Completion status in case of heuristic mixed completion or system errors
STATUS_VARIABLE_NAME - Static variable in class org.springframework.web.servlet.tags.BindTag
Name of the exposed variable within the scope of this tag: "status".
StaxUtils - Class in org.springframework.util.xml
Convenience methods for working with the StAX API.
StaxUtils() - Constructor for class org.springframework.util.xml.StaxUtils

stop() - Method in interface org.springframework.context.Lifecycle
Stop this component.
stop(Runnable) - Method in interface org.springframework.context.SmartLifecycle
Indicates that a Lifecycle component must stop if it is currently running.
stop() - Method in class org.springframework.context.support.AbstractApplicationContext

stop() - Method in class org.springframework.context.support.DefaultLifecycleProcessor
Stop all registered beans that implement Lifecycle and are currently running.
stop() - Method in class org.springframework.jca.context.SpringContextResourceAdapter
This implementation closes the Spring ApplicationContext.
stop() - Method in class org.springframework.jca.endpoint.GenericMessageEndpointManager
Deactivates the configured message endpoint.
stop(Runnable) - Method in class org.springframework.jca.endpoint.GenericMessageEndpointManager

stop() - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Stop this container.
stop(Runnable) - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer

stop(Runnable) - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
Stop this listener container, invoking the specific callback once all listener processing has actually stopped.
stop() - Method in class org.springframework.orm.hibernate3.LocalCacheProviderProxy

stop() - Method in class org.springframework.orm.hibernate3.LocalRegionFactoryProxy

stop() - Method in class org.springframework.scheduling.commonj.TimerManagerAccessor
Suspends the underlying TimerManager (if not shared).
stop() - Method in class org.springframework.scheduling.quartz.SchedulerFactoryBean

stop(Runnable) - Method in class org.springframework.scheduling.quartz.SchedulerFactoryBean

stop() - Method in class org.springframework.util.StopWatch
Stop the current task.
stopSharedConnection() - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Stop the shared Connection.
stopSharedConnection() - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
This implementations proceeds even after an exception thrown from Connection.stop(), relying on listeners to perform appropriate recovery after a restart.
StopWatch - Class in org.springframework.util
Simple stop watch, allowing for timing of a number of tasks, exposing total running time and running time for each named task.
StopWatch() - Constructor for class org.springframework.util.StopWatch
Construct a new stop watch.
StopWatch(String) - Constructor for class org.springframework.util.StopWatch
Construct a new stop watch with the given id.
StopWatch.TaskInfo - Class in org.springframework.util
Inner class to hold data about one task executed within the stop watch.
store() - Method in class org.springframework.mock.web.portlet.MockPortletPreferences

store(Properties, OutputStream, String) - Method in class org.springframework.util.DefaultPropertiesPersister

store(Properties, Writer, String) - Method in class org.springframework.util.DefaultPropertiesPersister

store(Properties, OutputStream, String) - Method in interface org.springframework.util.PropertiesPersister
Write the contents of the given Properties object to the given OutputStream.
store(Properties, Writer, String) - Method in interface org.springframework.util.PropertiesPersister
Write the contents of the given Properties object to the given Writer.
storeAttribute(WebRequest, String, Object) - Method in class org.springframework.web.bind.support.DefaultSessionAttributeStore

storeAttribute(WebRequest, String, Object) - Method in interface org.springframework.web.bind.support.SessionAttributeStore
Store the supplied attribute in the backend session.
StoredProcedure - Class in org.springframework.jdbc.object
Superclass for object abstractions of RDBMS stored procedures.
StoredProcedure() - Constructor for class org.springframework.jdbc.object.StoredProcedure
Allow use as a bean.
StoredProcedure(DataSource, String) - Constructor for class org.springframework.jdbc.object.StoredProcedure
Create a new object wrapper for a stored procedure.
StoredProcedure(JdbcTemplate, String) - Constructor for class org.springframework.jdbc.object.StoredProcedure
Create a new object wrapper for a stored procedure.
storeToXml(Properties, OutputStream, String) - Method in class org.springframework.util.DefaultPropertiesPersister

storeToXml(Properties, OutputStream, String, String) - Method in class org.springframework.util.DefaultPropertiesPersister

storeToXml(Properties, OutputStream, String) - Method in interface org.springframework.util.PropertiesPersister
Write the contents of the given Properties object to the given XML OutputStream.
storeToXml(Properties, OutputStream, String, String) - Method in interface org.springframework.util.PropertiesPersister
Write the contents of the given Properties object to the given XML OutputStream.
streamData(ResultSet) - Method in class org.springframework.jdbc.core.support.AbstractLobStreamingResultSetExtractor
Stream LOB content from the given ResultSet to some OutputStream.
StringArrayPropertyEditor - Class in org.springframework.beans.propertyeditors
Custom PropertyEditor for String arrays.
StringArrayPropertyEditor() - Constructor for class org.springframework.beans.propertyeditors.StringArrayPropertyEditor
Create a new StringArrayPropertyEditor with the default separator (a comma).
StringArrayPropertyEditor(String) - Constructor for class org.springframework.beans.propertyeditors.StringArrayPropertyEditor
Create a new StringArrayPropertyEditor with the given separator.
StringArrayPropertyEditor(String, boolean) - Constructor for class org.springframework.beans.propertyeditors.StringArrayPropertyEditor
Create a new StringArrayPropertyEditor with the given separator.
StringArrayPropertyEditor(String, boolean, boolean) - Constructor for class org.springframework.beans.propertyeditors.StringArrayPropertyEditor
Create a new StringArrayPropertyEditor with the given separator.
StringArrayPropertyEditor(String, String, boolean) - Constructor for class org.springframework.beans.propertyeditors.StringArrayPropertyEditor
Create a new StringArrayPropertyEditor with the given separator.
StringArrayPropertyEditor(String, String, boolean, boolean) - Constructor for class org.springframework.beans.propertyeditors.StringArrayPropertyEditor
Create a new StringArrayPropertyEditor with the given separator.
StringCodedLabeledEnum - Class in org.springframework.core.enums
Deprecated. as of Spring 3.0, in favor of Java 5 enums.
StringCodedLabeledEnum(String, String) - Constructor for class org.springframework.core.enums.StringCodedLabeledEnum
Deprecated. Create a new StringCodedLabeledEnum instance.
StringHttpMessageConverter - Class in org.springframework.http.converter
Implementation of HttpMessageConverter that can read and write strings.
StringHttpMessageConverter() - Constructor for class org.springframework.http.converter.StringHttpMessageConverter

StringLiteral - Class in org.springframework.expression.spel.ast

StringLiteral(String, int, String) - Constructor for class org.springframework.expression.spel.ast.StringLiteral

StringMultipartFileEditor - Class in org.springframework.web.multipart.support
Custom PropertyEditor for converting MultipartFiles to Strings.
StringMultipartFileEditor() - Constructor for class org.springframework.web.multipart.support.StringMultipartFileEditor
Create a new StringMultipartFileEditor, using the default charset.
StringMultipartFileEditor(String) - Constructor for class org.springframework.web.multipart.support.StringMultipartFileEditor
Create a new StringMultipartFileEditor, using the given charset.
StringTrimmerEditor - Class in org.springframework.beans.propertyeditors
Property editor that trims Strings.
StringTrimmerEditor(boolean) - Constructor for class org.springframework.beans.propertyeditors.StringTrimmerEditor
Create a new StringTrimmerEditor.
StringTrimmerEditor(String, boolean) - Constructor for class org.springframework.beans.propertyeditors.StringTrimmerEditor
Create a new StringTrimmerEditor.
StringUtils - Class in org.springframework.util
Miscellaneous String utility methods.
StringUtils() - Constructor for class org.springframework.util.StringUtils

StringValueResolver - Interface in org.springframework.util
Simple strategy interface for resolving a String value.
stripFilenameExtension(String) - Static method in class org.springframework.util.StringUtils
Strip the filename extension from the given path, e.g.
style(Object) - Method in class org.springframework.core.style.DefaultValueStyler

style(Object) - Static method in class org.springframework.core.style.StylerUtils
Style the specified value according to default conventions.
style(Object) - Method in interface org.springframework.core.style.ValueStyler
Style the given value, returning a String representation.
STYLE_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag

styleEnd(StringBuilder, Object) - Method in class org.springframework.core.style.DefaultToStringStyler

styleEnd(StringBuilder, Object) - Method in interface org.springframework.core.style.ToStringStyler
Style a toString()'ed object after it's fields are styled.
styleField(StringBuilder, String, Object) - Method in class org.springframework.core.style.DefaultToStringStyler

styleField(StringBuilder, String, Object) - Method in interface org.springframework.core.style.ToStringStyler
Style a field value as a string.
styleFieldEnd(StringBuilder, String) - Method in class org.springframework.core.style.DefaultToStringStyler

styleFieldSeparator(StringBuilder) - Method in class org.springframework.core.style.DefaultToStringStyler

styleFieldSeparator(StringBuilder) - Method in interface org.springframework.core.style.ToStringStyler
Style the field separator.
styleFieldStart(StringBuilder, String) - Method in class org.springframework.core.style.DefaultToStringStyler

StylerUtils - Class in org.springframework.core.style
Simple utility class to allow for convenient access to value styling logic, mainly to support descriptive logging messages.
StylerUtils() - Constructor for class org.springframework.core.style.StylerUtils

styleStart(StringBuilder, Object) - Method in class org.springframework.core.style.DefaultToStringStyler

styleStart(StringBuilder, Object) - Method in interface org.springframework.core.style.ToStringStyler
Style a toString()'ed object before its fields are styled.
styleValue(StringBuilder, Object) - Method in class org.springframework.core.style.DefaultToStringStyler

styleValue(StringBuilder, Object) - Method in interface org.springframework.core.style.ToStringStyler
Style the given value.
subList(int, int) - Method in class org.springframework.util.AutoPopulatingList

submit(Runnable) - Method in interface org.springframework.core.task.AsyncTaskExecutor
Submit a Runnable task for execution, receiving a Future representing that task.
submit(Callable<T>) - Method in interface org.springframework.core.task.AsyncTaskExecutor
Submit a Callable task for execution, receiving a Future representing that task.
submit(Runnable) - Method in class org.springframework.core.task.SimpleAsyncTaskExecutor

submit(Callable<T>) - Method in class org.springframework.core.task.SimpleAsyncTaskExecutor

submit(Runnable) - Method in class org.springframework.core.task.support.TaskExecutorAdapter

submit(Callable<T>) - Method in class org.springframework.core.task.support.TaskExecutorAdapter

submit(Runnable) - Method in class org.springframework.jca.work.WorkManagerTaskExecutor

submit(Callable<T>) - Method in class org.springframework.jca.work.WorkManagerTaskExecutor

submit(Runnable) - Method in class org.springframework.scheduling.backportconcurrent.ConcurrentTaskExecutor

submit(Callable<T>) - Method in class org.springframework.scheduling.backportconcurrent.ConcurrentTaskExecutor

submit(Runnable) - Method in class org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor

submit(Callable<T>) - Method in class org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor

submit(Runnable) - Method in class org.springframework.scheduling.commonj.WorkManagerTaskExecutor

submit(Callable<T>) - Method in class org.springframework.scheduling.commonj.WorkManagerTaskExecutor

submit(Runnable) - Method in class org.springframework.scheduling.concurrent.ConcurrentTaskExecutor

submit(Callable<T>) - Method in class org.springframework.scheduling.concurrent.ConcurrentTaskExecutor

submit(Runnable) - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor

submit(Callable<T>) - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor

submit(Runnable) - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler

submit(Callable<T>) - Method in class org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler

submit(Runnable) - Method in class org.springframework.scheduling.quartz.SimpleThreadPoolTaskExecutor

submit(Callable<T>) - Method in class org.springframework.scheduling.quartz.SimpleThreadPoolTaskExecutor

submit(Runnable) - Method in class org.springframework.scheduling.timer.TimerTaskExecutor
Deprecated.
submit(Callable<T>) - Method in class org.springframework.scheduling.timer.TimerTaskExecutor
Deprecated.
SUBMIT_IMAGE_SUFFIXES - Static variable in class org.springframework.web.util.WebUtils
Name suffixes in case of image buttons
SubscriptionNameProvider - Interface in org.springframework.jms.listener
Interface to be implemented by message listener objects that suggest a specific name for a durable subscription that they might be registered with.
substituteNamedParameters(ParsedSql, SqlParameterSource) - Static method in class org.springframework.jdbc.core.namedparam.NamedParameterUtils
Parse the SQL statement and locate any placeholders or named parameters.
substituteNamedParameters(String, SqlParameterSource) - Static method in class org.springframework.jdbc.core.namedparam.NamedParameterUtils
Parse the SQL statement and locate any placeholders or named parameters.
substringMatch(CharSequence, int, CharSequence) - Static method in class org.springframework.util.StringUtils
Test whether the given string matches the given substring at the given index.
suggestedClassName() - Method in interface org.springframework.scripting.ScriptSource
Determine a class name for the underlying script.
suggestedClassName() - Method in class org.springframework.scripting.support.ResourceScriptSource

suggestedClassName() - Method in class org.springframework.scripting.support.StaticScriptSource

supportedDatabaseProductsForFunctions - Static variable in class org.springframework.jdbc.core.metadata.CallMetaDataProviderFactory
List of supported database products for function calls
supportedDatabaseProductsForProcedures - Static variable in class org.springframework.jdbc.core.metadata.CallMetaDataProviderFactory
List of supported database products for procedure calls
supports(Class<?>) - Method in class org.springframework.http.converter.AbstractHttpMessageConverter
Indicates whether the given class is supported by this converter.
supports(Class<?>) - Method in class org.springframework.http.converter.ByteArrayHttpMessageConverter

supports(Class<?>) - Method in class org.springframework.http.converter.feed.AtomFeedHttpMessageConverter

supports(Class<?>) - Method in class org.springframework.http.converter.feed.RssChannelHttpMessageConverter

supports(Class<?>) - Method in class org.springframework.http.converter.json.MappingJacksonHttpMessageConverter

supports(Class<?>) - Method in class org.springframework.http.converter.StringHttpMessageConverter

supports(Class<?>) - Method in class org.springframework.http.converter.xml.Jaxb2RootElementHttpMessageConverter

supports(Class<?>) - Method in class org.springframework.http.converter.xml.MarshallingHttpMessageConverter

supports(Class<?>) - Method in class org.springframework.http.converter.xml.SourceHttpMessageConverter

supports(Class<?>) - Method in class org.springframework.oxm.castor.CastorMarshaller
Returns true for all classes, i.e.
supports(Type) - Method in interface org.springframework.oxm.GenericMarshaller
Indicates whether this marshaller can marshal instances of the supplied generic type.
supports(Type) - Method in interface org.springframework.oxm.GenericUnmarshaller
Indicates whether this marshaller can marshal instances of the supplied generic type.
supports(Class<?>) - Method in class org.springframework.oxm.jaxb.Jaxb2Marshaller

supports(Type) - Method in class org.springframework.oxm.jaxb.Jaxb2Marshaller

supports(Class<?>) - Method in class org.springframework.oxm.jibx.JibxMarshaller

supports(Class<?>) - Method in interface org.springframework.oxm.Marshaller
Indicates whether this marshaller can marshal instances of the supplied type.
supports(Class<?>) - Method in interface org.springframework.oxm.Unmarshaller
Indicates whether this unmarshaller can unmarshal instances of the supplied type.
supports(Class<?>) - Method in class org.springframework.oxm.xmlbeans.XmlBeansMarshaller
This implementation returns true if the given class is an implementation of XmlObject.
supports(Class) - Method in class org.springframework.oxm.xstream.XStreamMarshaller

supports(Class<?>) - Method in class org.springframework.validation.beanvalidation.SpringValidatorAdapter

supports(Class<?>) - Method in interface org.springframework.validation.Validator
Can this Validator validate instances of the supplied clazz?
supports(Object) - Method in class org.springframework.web.portlet.handler.SimplePortletHandlerAdapter

supports(Object) - Method in interface org.springframework.web.portlet.HandlerAdapter
Given a handler instance, return whether or not this HandlerAdapter can support it.
supports(Object) - Method in class org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter

supports(Object) - Method in class org.springframework.web.portlet.mvc.SimpleControllerHandlerAdapter

supports(Object) - Method in class org.springframework.web.servlet.handler.SimpleServletHandlerAdapter

supports(Object) - Method in interface org.springframework.web.servlet.HandlerAdapter
Given a handler instance, return whether or not this HandlerAdapter can support it.
supports(Object) - Method in class org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter

supports(Object) - Method in class org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter

supports(Object) - Method in class org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter

supportsAdvice(Advice) - Method in interface org.springframework.aop.framework.adapter.AdvisorAdapter
Does this adapter understand this advice object? Is it valid to invoke the getInterceptors method with an Advisor that contains this advice as an argument?
supportsAggressiveRelease() - Method in class org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
This implementation returns false: We cannot guarantee to receive the same Connection within a transaction, not even when dealing with a JNDI DataSource.
supportsAggressiveRelease() - Method in class org.springframework.orm.hibernate3.LocalJtaDataSourceConnectionProvider
This implementation returns true, since we're assuming a JTA DataSource.
supportsAggressiveRelease() - Method in class org.springframework.orm.hibernate3.TransactionAwareDataSourceConnectionProvider
This implementation returns true: We can guarantee to receive the same Connection within a transaction, as we are exposing a TransactionAwareDataSourceProxy.
supportsBatchUpdates(Connection) - Static method in class org.springframework.jdbc.support.JdbcUtils
Return whether the given JDBC driver supports JDBC 2.0 batch updates.
supportsEntityManagerFactoryPlusOperations() - Method in class org.springframework.orm.jpa.DefaultJpaDialect

supportsEntityManagerFactoryPlusOperations() - Method in interface org.springframework.orm.jpa.JpaDialect
Return whether the EntityManagerFactoryPlus(Operations) interface is supported by this provider.
supportsEntityManagerPlusOperations() - Method in class org.springframework.orm.jpa.DefaultJpaDialect

supportsEntityManagerPlusOperations() - Method in interface org.springframework.orm.jpa.JpaDialect
Return whether the EntityManagerPlus(Operations) interface is supported by this provider.
supportsEvent(ApplicationListener, Class<? extends ApplicationEvent>, Class) - Method in class org.springframework.context.event.AbstractApplicationEventMulticaster
Determine whether the given listener supports the given event.
supportsEventType(Class<? extends ApplicationEvent>) - Method in class org.springframework.context.event.GenericApplicationListenerAdapter

supportsEventType(Class<? extends ApplicationEvent>) - Method in interface org.springframework.context.event.SmartApplicationListener
Determine whether this listener actually supports the given event type.
supportsEventType(Class<? extends ApplicationEvent>) - Method in class org.springframework.context.event.SourceFilteringListener

supportsLobParameters() - Method in class org.springframework.jdbc.object.BatchSqlUpdate
BatchSqlUpdate does not support BLOB or CLOB parameters.
supportsLobParameters() - Method in class org.springframework.jdbc.object.RdbmsOperation
Return whether BLOB/CLOB parameters are supported for this kind of operation.
supportsProceedingJoinPoint() - Method in class org.springframework.aop.aspectj.AbstractAspectJAdvice

supportsProceedingJoinPoint() - Method in class org.springframework.aop.aspectj.AspectJAroundAdvice

supportsResourceAdapterManagedTransactions() - Method in class org.springframework.transaction.jta.JtaTransactionManager

supportsResourceAdapterManagedTransactions() - Method in class org.springframework.transaction.jta.SimpleTransactionFactory

supportsResourceAdapterManagedTransactions() - Method in interface org.springframework.transaction.jta.TransactionFactory
Determine whether the underlying transaction manager supports XA transactions managed by a resource adapter (i.e.
supportsResourceAdapterManagedTransactions() - Method in class org.springframework.transaction.jta.WebSphereUowTransactionManager
Returns true since WebSphere ResourceAdapters (as exposed in JNDI) implicitly perform transaction enlistment if the MessageEndpointFactory's isDeliveryTransacted method returns true.
supportsSavepoints() - Method in class org.springframework.jdbc.datasource.ConnectionHolder
Return whether JDBC 3.0 Savepoints are supported.
supportsSourceType(Class<?>) - Method in class org.springframework.context.event.GenericApplicationListenerAdapter

supportsSourceType(Class<?>) - Method in interface org.springframework.context.event.SmartApplicationListener
Determine whether this listener actually supports the given source type.
supportsSourceType(Class<?>) - Method in class org.springframework.context.event.SourceFilteringListener

suppress(String) - Method in class org.springframework.instrument.classloading.ResourceOverridingShadowingClassLoader
Ensure that a resource with the given path is not found.
suppressBinding(PortletRequest) - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Return whether to suppress binding for the given request.
suppressBinding(HttpServletRequest) - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Return whether to suppress binding for the given request.
suppressInterface(Class) - Method in class org.springframework.aop.support.IntroductionInfoSupport
Suppress the specified interface, which may have been autodetected due to the delegate implementing it.
suppressValidation(PortletRequest) - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Return whether to suppress validation for the given request.
suppressValidation(PortletRequest) - Method in class org.springframework.web.portlet.mvc.SimpleFormController
Deprecated. This implementation delegates to SimpleFormController.isFormChangeRequest(javax.portlet.PortletRequest): A form change request changes the appearance of the form and should not get validated but just show the new form.
suppressValidation(HttpServletRequest, Object, BindException) - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Return whether to suppress validation for the given request.
suppressValidation(HttpServletRequest, Object) - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Return whether to suppress validation for the given request.
suppressValidation(HttpServletRequest) - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. as of Spring 2.0.4, in favor of the BaseCommandController.suppressValidation(HttpServletRequest, Object) variant
suppressValidation(HttpServletRequest, Object) - Method in class org.springframework.web.servlet.mvc.CancellableFormController
Deprecated. Suppress validation for an explicit cancel request too.
suppressValidation(HttpServletRequest, Object) - Method in class org.springframework.web.servlet.mvc.SimpleFormController
Deprecated. This implementation delegates to SimpleFormController.isFormChangeRequest(HttpServletRequest, Object): A form change request changes the appearance of the form and should not get validated but just show the new form.
suspend(Object) - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Suspend the given transaction.
suspend() - Method in class org.springframework.transaction.support.ResourceHolderSynchronization

suspend() - Method in interface org.springframework.transaction.support.TransactionSynchronization
Suspend this synchronization.
suspend() - Method in class org.springframework.transaction.support.TransactionSynchronizationAdapter

swap(Object) - Method in class org.springframework.aop.target.HotSwappableTargetSource
Swap the target, returning the old target object.
SybaseCallMetaDataProvider - Class in org.springframework.jdbc.core.metadata
Sybase specific implementation for the CallMetaDataProvider interface.
SybaseCallMetaDataProvider(DatabaseMetaData) - Constructor for class org.springframework.jdbc.core.metadata.SybaseCallMetaDataProvider

SybaseMaxValueIncrementer - Class in org.springframework.jdbc.support.incrementer
DataFieldMaxValueIncrementer that increments the maximum value of a given SQL Server table with the equivalent of an auto-increment column.
SybaseMaxValueIncrementer() - Constructor for class org.springframework.jdbc.support.incrementer.SybaseMaxValueIncrementer
Default constructor for bean property style usage.
SybaseMaxValueIncrementer(DataSource, String, String) - Constructor for class org.springframework.jdbc.support.incrementer.SybaseMaxValueIncrementer
Convenience constructor.
SynchedLocalTransactionFailedException - Exception in org.springframework.jms.connection
Exception thrown when a synchronized local transaction failed to complete (after the main transaction has already completed).
SynchedLocalTransactionFailedException(String, JMSException) - Constructor for exception org.springframework.jms.connection.SynchedLocalTransactionFailedException
Create a new SynchedLocalTransactionFailedException.
SYNCHRONIZATION_ALWAYS - Static variable in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Always activate transaction synchronization, even for "empty" transactions that result from PROPAGATION_SUPPORTS with no existing backend transaction.
SYNCHRONIZATION_NEVER - Static variable in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Never active transaction synchronization, not even for actual transactions.
SYNCHRONIZATION_ON_ACTUAL_TRANSACTION - Static variable in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Activate transaction synchronization only for actual transactions, that is, not for empty ones that result from PROPAGATION_SUPPORTS with no existing backend transaction.
SyncTaskExecutor - Class in org.springframework.core.task
TaskExecutor implementation that executes each task synchronously in the calling thread.
SyncTaskExecutor() - Constructor for class org.springframework.core.task.SyncTaskExecutor

SYSTEM_ENVIRONMENT_BEAN_NAME - Static variable in interface org.springframework.context.ConfigurableApplicationContext
Name of the System environment bean in the factory.
SYSTEM_PROPERTIES_BEAN_NAME - Static variable in interface org.springframework.context.ConfigurableApplicationContext
Name of the System properties bean in the factory.
SYSTEM_PROPERTIES_MODE_FALLBACK - Static variable in class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
Check system properties if not resolvable in the specified properties.
SYSTEM_PROPERTIES_MODE_NEVER - Static variable in class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
Never check system properties.
SYSTEM_PROPERTIES_MODE_OVERRIDE - Static variable in class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
Check system properties first, before trying the specified properties.
SystemProfileValueSource - Class in org.springframework.test.annotation
Implementation of ProfileValueSource which uses system properties as the underlying source.
SystemPropertyUtils - Class in org.springframework.util
Helper class for resolving placeholders in texts.
SystemPropertyUtils() - Constructor for class org.springframework.util.SystemPropertyUtils

Overview  Package  Class  Tree  Deprecated   Index  Help
A B C D E F G H I J K L M N O P Q R S T U V W X


T-Index

PREV LETTER NEXT LETTER FRAMES NO FRAMES
A B C D E F G H I J K L M N O P Q R S T U V W X

T

TABINDEX_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
TableMetaDataContext - Class in org.springframework.jdbc.core.metadata
Class to manage context metadata used for the configuration and execution of operations on a database table.
TableMetaDataContext() - Constructor for class org.springframework.jdbc.core.metadata.TableMetaDataContext
TableMetaDataProvider - Interface in org.springframework.jdbc.core.metadata
Interface specifying the API to be implemented by a class providing table metedata.
TableMetaDataProviderFactory - Class in org.springframework.jdbc.core.metadata
Factory used to create a TableMetaDataProvider implementation based on the type of databse being used.
TableMetaDataProviderFactory() - Constructor for class org.springframework.jdbc.core.metadata.TableMetaDataProviderFactory
tableNameToUse(String) - Method in class org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
tableNameToUse(String) - Method in interface org.springframework.jdbc.core.metadata.TableMetaDataProvider
Get the table name formatted based on metadata information.
TableParameterMetaData - Class in org.springframework.jdbc.core.metadata
Holder of metadata for a specific parameter that is used for table processing.
TableParameterMetaData(String, int, boolean) - Constructor for class org.springframework.jdbc.core.metadata.TableParameterMetaData
Constructor taking all the properties.
TagUtils - Class in org.springframework.web.util
Utility class for tag library related code, exposing functionality such as translating Strings to web scopes.
TagUtils() - Constructor for class org.springframework.web.util.TagUtils
TagWriter - Class in org.springframework.web.servlet.tags.form
Utility class for writing HTML content to a Writer instance.
TagWriter(PageContext) - Constructor for class org.springframework.web.servlet.tags.form.TagWriter
Create a new instance of the TagWriter class that writes to the supplied PageContext.
TagWriter(Writer) - Constructor for class org.springframework.web.servlet.tags.form.TagWriter
Create a new instance of the TagWriter class that writes to the supplied Writer.
target - Variable in class org.springframework.aop.framework.ReflectiveMethodInvocation
TargetClassAware - Interface in org.springframework.aop
Minimal interface for exposing the target class behind a proxy.
targetObject - Variable in class org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource
TargetSource - Interface in org.springframework.aop
A TargetSource is used to obtain the current "target" of an AOP invocation, which will be invoked via reflection if no around advice chooses to end the interceptor chain itself.
TargetSourceCreator - Interface in org.springframework.aop.framework.autoproxy
Implementations can create special target sources, such as pooling target sources, for particular beans.
TaskExecutor - Interface in org.springframework.core.task
Simple task executor interface that abstracts the execution of a Runnable.
TaskExecutorAdapter - Class in org.springframework.core.task.support
Adapter that takes a JDK 1.5 java.util.concurrent.Executor and exposes a Spring TaskExecutor for it.
TaskExecutorAdapter(Executor) - Constructor for class org.springframework.core.task.support.TaskExecutorAdapter
Create a new TaskExecutorAdapter, using the given JDK 1.5 concurrent executor.
TaskExecutorFactoryBean - Class in org.springframework.scheduling.config
FactoryBean for creating TaskExecutor instances.
TaskExecutorFactoryBean() - Constructor for class org.springframework.scheduling.config.TaskExecutorFactoryBean
TaskNamespaceHandler - Class in org.springframework.scheduling.config
NamespaceHandler for the 'task' namespace.
TaskNamespaceHandler() - Constructor for class org.springframework.scheduling.config.TaskNamespaceHandler
TaskRejectedException - Exception in org.springframework.core.task
Exception thrown when a TaskExecutor rejects to accept a given task for execution.
TaskRejectedException(String) - Constructor for exception org.springframework.core.task.TaskRejectedException
Create a new TaskRejectedException with the specified detail message and no root cause.
TaskRejectedException(String, Throwable) - Constructor for exception org.springframework.core.task.TaskRejectedException
Create a new TaskRejectedException with the specified detail message and the given root cause.
TaskScheduler - Interface in org.springframework.scheduling
Task scheduler interface that abstracts the scheduling of Runnables based on different kinds of triggers.
TaskTimeoutException - Exception in org.springframework.core.task
Exception thrown when a AsyncTaskExecutor rejects to accept a given task for execution because of the specified timeout.
TaskTimeoutException(String) - Constructor for exception org.springframework.core.task.TaskTimeoutException
Create a new TaskTimeoutException with the specified detail message and no root cause.
TaskTimeoutException(String, Throwable) - Constructor for exception org.springframework.core.task.TaskTimeoutException
Create a new TaskTimeoutException with the specified detail message and the given root cause.
TaskUtils - Class in org.springframework.scheduling.support
Utility methods for decorating tasks with error handling.
TaskUtils() - Constructor for class org.springframework.scheduling.support.TaskUtils
tearDown() - Method in class org.springframework.test.AbstractSingleSpringContextTests
Deprecated. This implementation is final.
TEMP_DIR_CONTEXT_ATTRIBUTE - Static variable in class org.springframework.web.util.WebUtils
Standard Servlet spec context attribute that specifies a temporary directory for the current web application, of type java.io.File.
TEMPLATE_EXPRESSION - Static variable in interface org.springframework.expression.ParserContext
The default ParserContext implementation that enables template expression parsing mode.
TemplateAwareExpressionParser - Class in org.springframework.expression.common
An expression parser that understands templates.
TemplateAwareExpressionParser() - Constructor for class org.springframework.expression.common.TemplateAwareExpressionParser
TemplateParserContext - Class in org.springframework.expression.common
Configurable ParserContext implementation for template parsing.
TemplateParserContext() - Constructor for class org.springframework.expression.common.TemplateParserContext
Create a new TemplateParserContext with the default "#{" prefix and "}" suffix.
TemplateParserContext(String, String) - Constructor for class org.springframework.expression.common.TemplateParserContext
Create a new TemplateParserContext for the given prefix and suffix.
Ternary - Class in org.springframework.expression.spel.ast
Represents a ternary expression, for example: "someCheck()?true:false".
Ternary(int, SpelNodeImpl...) - Constructor for class org.springframework.expression.spel.ast.Ternary
test() - Method in class org.springframework.test.AssertThrows
Deprecated. Subclass must override this abstract method and provide the test logic.
TestContext - Class in org.springframework.test.context
TestContext encapsulates the context in which a test is executed, agnostic of the actual testing framework in use.
TestContextManager - Class in org.springframework.test.context
TestContextManager is the main entry point into the Spring TestContext Framework, which provides support for loading and accessing application contexts, dependency injection of test instances, transactional execution of test methods, etc.
TestContextManager(Class<?>) - Constructor for class org.springframework.test.context.TestContextManager
Delegates to TestContextManager.TestContextManager(Class, String) with a value of null for the default ContextLoader class name.
TestContextManager(Class<?>, String) - Constructor for class org.springframework.test.context.TestContextManager
Constructs a new TestContextManager for the specified test class and automatically registers the TestExecutionListeners configured for the test class via the @TestExecutionListeners annotation.
TestExecutionListener - Interface in org.springframework.test.context
TestExecutionListener defines a listener API for reacting to test execution events published by the TestContextManager with which the listener is registered.
TestExecutionListeners - Annotation Type in org.springframework.test.context
TestExecutionListeners defines class-level metadata for configuring which TestExecutionListeners should be registered with a TestContextManager.
testRegistry(Registry) - Method in class org.springframework.remoting.rmi.RmiRegistryFactoryBean
Test the given RMI registry, calling some operation on it to check whether it is still active.
testRegistry(Registry) - Method in class org.springframework.remoting.rmi.RmiServiceExporter
Test the given RMI registry, calling some operation on it to check whether it is still active.
TEXT_HTML - Static variable in class org.springframework.http.MediaType
Public constant media type for text/html.
TEXT_PLAIN - Static variable in class org.springframework.http.MediaType
Public constant media type for text/plain.
TEXT_XML - Static variable in class org.springframework.http.MediaType
Public constant media type for text/xml.
TextareaTag - Class in org.springframework.web.servlet.tags.form
Databinding-aware JSP tag for rendering an HTML 'textarea'.
TextareaTag() - Constructor for class org.springframework.web.servlet.tags.form.TextareaTag
Theme - Interface in org.springframework.ui.context
A Theme can resolve theme-specific messages, codes, file paths, etcetera (e.g. CSS and image files in a web environment).
THEME_REQUEST_ATTRIBUTE_NAME - Static variable in class org.springframework.web.servlet.theme.CookieThemeResolver
Name of the request attribute that holds the theme name.
THEME_RESOLVER_ATTRIBUTE - Static variable in class org.springframework.web.servlet.DispatcherServlet
Request attribute to hold the current ThemeResolver, retrievable by views.
THEME_RESOLVER_BEAN_NAME - Static variable in class org.springframework.web.servlet.DispatcherServlet
Well-known name for the ThemeResolver object in the bean factory for this namespace.
THEME_SESSION_ATTRIBUTE_NAME - Static variable in class org.springframework.web.servlet.theme.SessionThemeResolver
Name of the session attribute that holds the theme name.
THEME_SOURCE_ATTRIBUTE - Static variable in class org.springframework.web.servlet.DispatcherServlet
Request attribute to hold the current ThemeSource, retrievable by views.
THEME_SOURCE_BEAN_NAME - Static variable in class org.springframework.ui.context.support.UiApplicationContextUtils
Name of the ThemeSource bean in the factory.
ThemeChangeInterceptor - Class in org.springframework.web.servlet.theme
Interceptor that allows for changing the current theme on every request, via a configurable request parameter.
ThemeChangeInterceptor() - Constructor for class org.springframework.web.servlet.theme.ThemeChangeInterceptor
ThemeResolver - Interface in org.springframework.web.servlet
Interface for web-based theme resolution strategies that allows for both theme resolution via the request and theme modification via request and response.
ThemeSource - Interface in org.springframework.ui.context
Interface to be implemented by objects that can resolve Themes.
ThemeTag - Class in org.springframework.web.servlet.tags
Custom tag to look up a theme message in the scope of this page.
ThemeTag() - Constructor for class org.springframework.web.servlet.tags.ThemeTag
ThreadLocalTargetSource - Class in org.springframework.aop.target
Alternative to an object pool.
ThreadLocalTargetSource() - Constructor for class org.springframework.aop.target.ThreadLocalTargetSource
ThreadLocalTargetSourceStats - Interface in org.springframework.aop.target
Statistics for a ThreadLocal TargetSource.
ThreadPoolExecutorFactoryBean - Class in org.springframework.scheduling.concurrent
JavaBean that allows for configuring a JDK 1.5 ThreadPoolExecutor in bean style (through its "corePoolSize", "maxPoolSize", "keepAliveSeconds", "queueCapacity" properties) and exposing it as a bean reference of its native ExecutorService type.
ThreadPoolExecutorFactoryBean() - Constructor for class org.springframework.scheduling.concurrent.ThreadPoolExecutorFactoryBean
ThreadPoolTaskExecutor - Class in org.springframework.scheduling.backportconcurrent
JavaBean that allows for configuring a JSR-166 backport ThreadPoolExecutor in bean style (through its "corePoolSize", "maxPoolSize", "keepAliveSeconds", "queueCapacity" properties), exposing it as a Spring TaskExecutor.
ThreadPoolTaskExecutor() - Constructor for class org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor
ThreadPoolTaskExecutor - Class in org.springframework.scheduling.concurrent
JavaBean that allows for configuring a JDK 1.5 ThreadPoolExecutor in bean style (through its "corePoolSize", "maxPoolSize", "keepAliveSeconds", "queueCapacity" properties) and exposing it as a Spring TaskExecutor.
ThreadPoolTaskExecutor() - Constructor for class org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
ThreadPoolTaskScheduler - Class in org.springframework.scheduling.concurrent
Implementation of Spring's TaskScheduler interface, wrapping a native ScheduledThreadPoolExecutor.
ThreadPoolTaskScheduler() - Constructor for class org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
ThrowsAdvice - Interface in org.springframework.aop
Tag interface for throws advice.
ThrowsAdviceInterceptor - Class in org.springframework.aop.framework.adapter
Interceptor to wrap an after-throwing advice.
ThrowsAdviceInterceptor(Object) - Constructor for class org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor
Create a new ThrowsAdviceInterceptor for the given ThrowsAdvice.
TilesConfigurer - Class in org.springframework.web.servlet.view.tiles
Deprecated. as of Spring 3.0
TilesConfigurer() - Constructor for class org.springframework.web.servlet.view.tiles.TilesConfigurer
Deprecated.
TilesConfigurer - Class in org.springframework.web.servlet.view.tiles2
Helper class to configure Tiles 2.x for the Spring Framework.
TilesConfigurer() - Constructor for class org.springframework.web.servlet.view.tiles2.TilesConfigurer
TilesJstlView - Class in org.springframework.web.servlet.view.tiles
Deprecated. as of Spring 3.0
TilesJstlView() - Constructor for class org.springframework.web.servlet.view.tiles.TilesJstlView
Deprecated.
TilesView - Class in org.springframework.web.servlet.view.tiles
Deprecated. as of Spring 3.0
TilesView() - Constructor for class org.springframework.web.servlet.view.tiles.TilesView
Deprecated.
TilesView - Class in org.springframework.web.servlet.view.tiles2
View implementation that retrieves a Tiles definition.
TilesView() - Constructor for class org.springframework.web.servlet.view.tiles2.TilesView
TilesViewResolver - Class in org.springframework.web.servlet.view.tiles2
Convenience subclass of UrlBasedViewResolver that supports TilesView (i.e.
TilesViewResolver() - Constructor for class org.springframework.web.servlet.view.tiles2.TilesViewResolver
Timed - Annotation Type in org.springframework.test.annotation
Test-specific annotation to indicate that a test method has to finish execution in a specified time period.
TIMEOUT_DEFAULT - Static variable in interface org.springframework.transaction.TransactionDefinition
Use the default timeout of the underlying transaction system, or none if timeouts are not supported.
TIMEOUT_IMMEDIATE - Static variable in interface org.springframework.core.task.AsyncTaskExecutor
Constant that indicates immediate execution
TIMEOUT_INDEFINITE - Static variable in interface org.springframework.core.task.AsyncTaskExecutor
Constant that indicates no time limit
timerExpired(Timer) - Method in class org.springframework.scheduling.commonj.DelegatingTimerListener
Delegates execution to the underlying Runnable.
TimerFactoryBean - Class in org.springframework.scheduling.timer
Deprecated. as of Spring 3.0, in favor of the scheduling.concurrent package which is based on Java 5's java.util.concurrent.ExecutorService
TimerFactoryBean() - Constructor for class org.springframework.scheduling.timer.TimerFactoryBean
Deprecated.
TimerManagerAccessor - Class in org.springframework.scheduling.commonj
Base class for classes that are accessing a CommonJ TimerManager Defines common configuration settings and common lifecycle handling.
TimerManagerAccessor() - Constructor for class org.springframework.scheduling.commonj.TimerManagerAccessor
TimerManagerFactoryBean - Class in org.springframework.scheduling.commonj
FactoryBean that retrieves a CommonJ TimerManager and exposes it for bean references.
TimerManagerFactoryBean() - Constructor for class org.springframework.scheduling.commonj.TimerManagerFactoryBean
TimerManagerTaskScheduler - Class in org.springframework.scheduling.commonj
Implementation of Spring's TaskScheduler interface, wrapping a CommonJ TimerManager.
TimerManagerTaskScheduler() - Constructor for class org.springframework.scheduling.commonj.TimerManagerTaskScheduler
TimerTaskExecutor - Class in org.springframework.scheduling.timer
Deprecated. as of Spring 3.0, in favor of the scheduling.concurrent package which is based on Java 5's java.util.concurrent.ExecutorService
TimerTaskExecutor() - Constructor for class org.springframework.scheduling.timer.TimerTaskExecutor
Deprecated. Create a new TimerTaskExecutor that needs to be further configured and initialized.
TimerTaskExecutor(Timer) - Constructor for class org.springframework.scheduling.timer.TimerTaskExecutor
Deprecated. Create a new TimerTaskExecutor for the given Timer.
TimeZoneEditor - Class in org.springframework.beans.propertyeditors
Editor for java.util.TimeZone, translating timezone IDs into TimeZone objects.
TimeZoneEditor() - Constructor for class org.springframework.beans.propertyeditors.TimeZoneEditor
TITLE_ATTRIBUTE - Static variable in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
toArray() - Method in class org.springframework.util.AutoPopulatingList
toArray(T[]) - Method in class org.springframework.util.AutoPopulatingList
toByteArray() - Method in class org.springframework.jca.cci.core.support.CommAreaRecord
toCode(Object, String) - Method in class org.springframework.core.Constants
Look up the given value within the given group of constants.
toCodeForProperty(Object, String) - Method in class org.springframework.core.Constants
Look up the given value within the group of constants for the given bean property name.
toCodeForSuffix(Object, String) - Method in class org.springframework.core.Constants
Look up the given value within the given group of constants.
toDetailedString() - Method in exception org.springframework.expression.ExpressionException
toIterator(Enumeration<E>) - Static method in class org.springframework.util.CollectionUtils
Adapts an enumeration to an iterator.
tokenizeToStringArray(String, String) - Static method in class org.springframework.util.StringUtils
Tokenize the given String into a String array via a StringTokenizer.
tokenizeToStringArray(String, String, boolean, boolean) - Static method in class org.springframework.util.StringUtils
Tokenize the given String into a String array via a StringTokenizer.
toLanguageTag(Locale) - Static method in class org.springframework.util.StringUtils
Determine the RFC 3066 compliant language tag, as used for the HTTP "Accept-Language" header.
toLongString() - Method in class org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint
TomcatInstrumentableClassLoader - Class in org.springframework.instrument.classloading.tomcat
Extension of Tomcat's default class loader which adds instrumentation to loaded classes without the need to use a VM-wide agent.
TomcatInstrumentableClassLoader() - Constructor for class org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader
Create a new TomcatInstrumentableClassLoader using the current context class loader.
TomcatInstrumentableClassLoader(ClassLoader) - Constructor for class org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader
Create a new TomcatInstrumentableClassLoader with the supplied class loader as parent.
toMessage(Object, Session) - Method in class org.springframework.jms.support.converter.MarshallingMessageConverter
This implementation marshals the given object to a TextMessage or BytesMessage.
toMessage(Object, Session) - Method in interface org.springframework.jms.support.converter.MessageConverter
Convert a Java object to a JMS Message using the supplied session to create the message object.
toMessage(Object, Session) - Method in class org.springframework.jms.support.converter.SimpleMessageConverter
This implementation creates a TextMessage for a String, a BytesMessage for a byte array, a MapMessage for a Map, and an ObjectMessage for a Serializable object.
toObjectArray(Object) - Static method in class org.springframework.util.ObjectUtils
Convert the given array (which may be a primitive array) to an object array (if necessary of primitive wrapper objects).
TopLinkJpaDialect - Class in org.springframework.orm.jpa.vendor
JpaDialect implementation for Oracle TopLink Essentials.
TopLinkJpaDialect() - Constructor for class org.springframework.orm.jpa.vendor.TopLinkJpaDialect
TopLinkJpaVendorAdapter - Class in org.springframework.orm.jpa.vendor
JpaVendorAdapter implementation for Oracle TopLink Essentials.
TopLinkJpaVendorAdapter() - Constructor for class org.springframework.orm.jpa.vendor.TopLinkJpaVendorAdapter
toProxyConfigString() - Method in interface org.springframework.aop.framework.Advised
As toString() will normally be delegated to the target, this returns the equivalent for the AOP proxy.
toProxyConfigString() - Method in class org.springframework.aop.framework.AdvisedSupport
toShortString() - Method in class org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint
toSingleValueMap() - Method in class org.springframework.http.HttpHeaders
toSingleValueMap() - Method in class org.springframework.util.LinkedMultiValueMap
toSingleValueMap() - Method in interface org.springframework.util.MultiValueMap
Returns the first values contained in this MultiValueMap.
toString() - Method in class org.springframework.aop.aspectj.AbstractAspectJAdvice
toString() - Method in class org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory.AspectJAnnotation
toString() - Method in class org.springframework.aop.aspectj.annotation.BeanFactoryAspectInstanceFactory
toString() - Method in class org.springframework.aop.aspectj.annotation.LazySingletonAspectInstanceFactoryDecorator
toString() - Method in class org.springframework.aop.aspectj.AspectJExpressionPointcut
toString() - Method in class org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint
toString() - Method in class org.springframework.aop.config.AdviceEntry
toString() - Method in class org.springframework.aop.config.AdvisorEntry
toString() - Method in class org.springframework.aop.config.AspectEntry
toString() - Method in class org.springframework.aop.config.PointcutEntry
toString() - Method in class org.springframework.aop.framework.AdvisedSupport
For debugging/diagnostic use.
toString() - Method in class org.springframework.aop.framework.ProxyConfig
toString() - Method in class org.springframework.aop.framework.ReflectiveMethodInvocation
toString() - Method in class org.springframework.aop.support.AbstractBeanFactoryPointcutAdvisor
toString() - Method in class org.springframework.aop.support.AbstractGenericPointcutAdvisor
toString() - Method in class org.springframework.aop.support.AbstractRegexpMethodPointcut
toString() - Method in class org.springframework.aop.support.ComposablePointcut
toString() - Method in class org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor
toString() - Method in class org.springframework.aop.support.DefaultIntroductionAdvisor
toString() - Method in class org.springframework.aop.support.DefaultPointcutAdvisor
toString() - Method in class org.springframework.aop.support.RegexpMethodPointcutAdvisor
toString() - Method in class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
toString() - Method in class org.springframework.aop.target.EmptyTargetSource
toString() - Method in class org.springframework.aop.target.HotSwappableTargetSource
toString() - Method in class org.springframework.aop.target.PrototypeTargetSource
toString() - Method in class org.springframework.aop.target.SingletonTargetSource
toString() - Method in class org.springframework.beans.BeanMetadataAttribute
toString() - Method in class org.springframework.beans.BeanWrapperImpl
toString() - Method in class org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement
toString() - Method in exception org.springframework.beans.factory.BeanCreationException
toString() - Method in class org.springframework.beans.factory.config.BeanDefinitionHolder
This implementation returns the long description.
toString() - Method in class org.springframework.beans.factory.config.RuntimeBeanNameReference
toString() - Method in class org.springframework.beans.factory.config.RuntimeBeanReference
toString() - Method in class org.springframework.beans.factory.config.TypedStringValue
toString() - Method in class org.springframework.beans.factory.parsing.AbstractComponentDefinition
Delegates to AbstractComponentDefinition.getDescription().
toString() - Method in class org.springframework.beans.factory.parsing.BeanComponentDefinition
This implementation returns this ComponentDefinition's description.
toString() - Method in class org.springframework.beans.factory.parsing.BeanEntry
toString() - Method in class org.springframework.beans.factory.parsing.ConstructorArgumentEntry
toString() - Method in class org.springframework.beans.factory.parsing.ParseState
Returns a tree-style representation of the current ParseState.
toString() - Method in class org.springframework.beans.factory.parsing.Problem
toString() - Method in class org.springframework.beans.factory.parsing.PropertyEntry
toString() - Method in class org.springframework.beans.factory.parsing.QualifierEntry
toString() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
toString() - Method in class org.springframework.beans.factory.support.ChildBeanDefinition
toString() - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
toString() - Method in class org.springframework.beans.factory.support.GenericBeanDefinition
toString() - Method in class org.springframework.beans.factory.support.LookupOverride
toString() - Method in class org.springframework.beans.factory.support.ReplaceOverride
toString() - Method in class org.springframework.beans.factory.support.RootBeanDefinition
toString() - Method in class org.springframework.beans.factory.xml.BeansDtdResolver
toString() - Method in class org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver
toString() - Method in class org.springframework.beans.factory.xml.DelegatingEntityResolver
toString() - Method in class org.springframework.beans.factory.xml.PluggableSchemaResolver
toString() - Method in class org.springframework.beans.MutablePropertyValues
toString() - Method in exception org.springframework.beans.PropertyBatchUpdateException
toString() - Method in class org.springframework.beans.PropertyValue
toString() - Method in class org.springframework.context.i18n.SimpleLocaleContext
toString() - Method in class org.springframework.context.support.AbstractApplicationContext
Return information about this context.
toString() - Method in class org.springframework.context.support.DefaultMessageSourceResolvable
Default implementation exposes the attributes of this MessageSourceResolvable.
toString() - Method in class org.springframework.context.support.ReloadableResourceBundleMessageSource
toString() - Method in class org.springframework.context.support.ResourceBundleMessageSource
Show the configuration of this MessageSource.
toString() - Method in class org.springframework.context.support.StaticMessageSource
toString() - Method in class org.springframework.core.convert.support.GenericConversionService
toString() - Method in class org.springframework.core.convert.TypeDescriptor
toString() - Method in class org.springframework.core.enums.AbstractLabeledEnum
Deprecated.
toString() - Method in class org.springframework.core.io.AbstractResource
This implementation returns the description of this resource.
toString() - Method in class org.springframework.core.io.support.EncodedResource
toString() - Method in class org.springframework.core.NamedInheritableThreadLocal
toString() - Method in class org.springframework.core.NamedThreadLocal
toString() - Method in class org.springframework.core.style.ToStringCreator
Return the String representation that this ToStringCreator built.
toString() - Method in class org.springframework.expression.spel.ast.Literal
toString() - Method in class org.springframework.expression.spel.ast.NullLiteral
toString() - Method in class org.springframework.expression.spel.ast.StringLiteral
toString() - Method in class org.springframework.expression.spel.support.ReflectionHelper.ArgumentsMatchInfo
toString() - Method in class org.springframework.expression.TypedValue
toString() - Method in class org.springframework.http.HttpHeaders
toString() - Method in enum org.springframework.http.HttpStatus
Return a string representation of this status code.
toString() - Method in class org.springframework.http.MediaType
toString(Collection<MediaType>) - Static method in class org.springframework.http.MediaType
Return a string representation of the given list of MediaType objects.
toString() - Method in class org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader
toString() - Method in class org.springframework.jdbc.core.namedparam.ParsedSql
Exposes the original SQL String.
toString() - Method in class org.springframework.jdbc.datasource.SimpleConnectionHandle
toString() - Method in exception org.springframework.mail.MailSendException
toString() - Method in class org.springframework.mail.SimpleMailMessage
toString() - Method in class org.springframework.mock.web.portlet.MockPortletURL
toString() - Method in class org.springframework.mock.web.portlet.MockResourceURL
toString(Session) - Static method in class org.springframework.orm.hibernate3.SessionFactoryUtils
Stringify the given Session for debug logging.
toString() - Method in class org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo
toString() - Method in class org.springframework.remoting.support.RemoteInvocation
toString() - Method in class org.springframework.scheduling.support.CronSequenceGenerator
toString() - Method in class org.springframework.scheduling.support.DelegatingErrorHandlingRunnable
toString() - Method in class org.springframework.scripting.bsh.BshScriptFactory
toString() - Method in class org.springframework.scripting.groovy.GroovyScriptFactory
toString() - Method in class org.springframework.scripting.jruby.JRubyScriptFactory
toString() - Method in class org.springframework.scripting.support.ResourceScriptSource
toString() - Method in class org.springframework.scripting.support.StaticScriptSource
toString() - Method in class org.springframework.test.context.TestContext
Provide a String representation of this test context's state.
toString() - Method in class org.springframework.test.context.transaction.TransactionConfigurationAttributes
toString() - Method in class org.springframework.transaction.interceptor.MatchAlwaysTransactionAttributeSource
toString() - Method in class org.springframework.transaction.interceptor.MethodMapTransactionAttributeSource
toString() - Method in class org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource
toString() - Method in class org.springframework.transaction.interceptor.NoRollbackRuleAttribute
toString() - Method in class org.springframework.transaction.interceptor.RollbackRuleAttribute
toString() - Method in class org.springframework.transaction.interceptor.RuleBasedTransactionAttribute
toString() - Method in class org.springframework.transaction.interceptor.TransactionAspectSupport.TransactionInfo
toString() - Method in class org.springframework.transaction.support.DefaultTransactionDefinition
Return an identifying description for this transaction definition.
toString() - Method in class org.springframework.transaction.support.DelegatingTransactionDefinition
toString() - Method in class org.springframework.util.CachingMapDecorator
toString() - Method in class org.springframework.util.comparator.BooleanComparator
toString() - Method in class org.springframework.util.comparator.CompoundComparator
toString() - Method in class org.springframework.util.comparator.InvertibleComparator
toString() - Method in class org.springframework.util.comparator.NullSafeComparator
toString() - Method in class org.springframework.util.LinkedMultiValueMap
toString() - Method in class org.springframework.util.StopWatch
Return an informative string describing all tasks performed For custom reporting, call getTaskInfo() and use the task info directly.
toString() - Method in class org.springframework.validation.AbstractErrors
toString() - Method in class org.springframework.validation.FieldError
toString() - Method in class org.springframework.validation.ObjectError
toString() - Method in class org.springframework.web.context.request.FacesWebRequest
toString() - Method in class org.springframework.web.context.request.ServletRequestAttributes
toString() - Method in class org.springframework.web.context.request.ServletWebRequest
toString() - Method in class org.springframework.web.context.support.RequestHandledEvent
toString() - Method in class org.springframework.web.context.support.ServletRequestHandledEvent
toString() - Method in class org.springframework.web.portlet.context.PortletRequestAttributes
toString() - Method in class org.springframework.web.portlet.context.PortletRequestHandledEvent
toString() - Method in class org.springframework.web.portlet.context.PortletWebRequest
toString() - Method in class org.springframework.web.portlet.HandlerExecutionChain
Delegates to the handler's toString().
toString() - Method in class org.springframework.web.portlet.ModelAndView
Return diagnostic information about this model and view.
toString() - Method in class org.springframework.web.servlet.HandlerExecutionChain
Delegates to the handler's toString().
toString() - Method in class org.springframework.web.servlet.ModelAndView
Return diagnostic information about this model and view.
toString() - Method in class org.springframework.web.servlet.support.BindStatus
toString() - Method in class org.springframework.web.servlet.tags.Param
toString() - Method in class org.springframework.web.servlet.view.AbstractUrlBasedView
toString() - Method in class org.springframework.web.servlet.view.AbstractView
toString() - Method in class org.springframework.web.util.UriTemplate
toStringArray(Collection<String>) - Static method in class org.springframework.util.StringUtils
Copy the given Collection into a String array.
toStringArray(Enumeration<String>) - Static method in class org.springframework.util.StringUtils
Copy the given Enumeration into a String array.
toStringAST() - Method in class org.springframework.expression.spel.ast.Assign
toStringAST() - Method in class org.springframework.expression.spel.ast.CompoundExpression
toStringAST() - Method in class org.springframework.expression.spel.ast.ConstructorReference
toStringAST() - Method in class org.springframework.expression.spel.ast.Elvis
toStringAST() - Method in class org.springframework.expression.spel.ast.FunctionReference
toStringAST() - Method in class org.springframework.expression.spel.ast.Identifier
toStringAST() - Method in class org.springframework.expression.spel.ast.Indexer
toStringAST() - Method in class org.springframework.expression.spel.ast.Literal
toStringAST() - Method in class org.springframework.expression.spel.ast.MethodReference
toStringAST() - Method in class org.springframework.expression.spel.ast.Operator
String format for all operators is the same '(' [operand] [operator] [operand] ')'
toStringAST() - Method in class org.springframework.expression.spel.ast.OperatorNot
toStringAST() - Method in class org.springframework.expression.spel.ast.OpMinus
toStringAST() - Method in class org.springframework.expression.spel.ast.OpPlus
toStringAST() - Method in class org.springframework.expression.spel.ast.Projection
toStringAST() - Method in class org.springframework.expression.spel.ast.PropertyOrFieldReference
toStringAST() - Method in class org.springframework.expression.spel.ast.QualifiedIdentifier
toStringAST() - Method in class org.springframework.expression.spel.ast.Selection
toStringAST() - Method in class org.springframework.expression.spel.ast.SpelNodeImpl
toStringAST() - Method in class org.springframework.expression.spel.ast.Ternary
toStringAST() - Method in class org.springframework.expression.spel.ast.TypeReference
toStringAST() - Method in class org.springframework.expression.spel.ast.VariableReference
toStringAST() - Method in interface org.springframework.expression.spel.SpelNode
toStringAST() - Method in class org.springframework.expression.spel.standard.SpelExpression
Produce a string representation of the Abstract Syntax Tree for the expression, this should ideally look like the input expression, but properly formatted since any unnecessary whitespace will have been discarded during the parse of the expression.
ToStringCreator - Class in org.springframework.core.style
Utility class that builds pretty-printing toString() methods with pluggable styling conventions.
ToStringCreator(Object) - Constructor for class org.springframework.core.style.ToStringCreator
Create a ToStringCreator for the given object.
ToStringCreator(Object, ValueStyler) - Constructor for class org.springframework.core.style.ToStringCreator
Create a ToStringCreator for the given object, using the provided style.
ToStringCreator(Object, ToStringStyler) - Constructor for class org.springframework.core.style.ToStringCreator
Create a ToStringCreator for the given object, using the provided style.
ToStringStyler - Interface in org.springframework.core.style
A strategy interface for pretty-printing toString() methods.
toURI(URL) - Static method in class org.springframework.util.ResourceUtils
Create a URI instance for the given URL, replacing spaces with "%20" quotes first.
toURI(String) - Static method in class org.springframework.util.ResourceUtils
Create a URI instance for the given location String, replacing spaces with "%20" quotes first.
Transactional - Annotation Type in org.springframework.transaction.annotation
Describes transaction attributes on a method or class.
TransactionalTestExecutionListener - Class in org.springframework.test.context.transaction
TestExecutionListener which provides support for executing tests within transactions by using @Transactional and @NotTransactional annotations.
TransactionalTestExecutionListener() - Constructor for class org.springframework.test.context.transaction.TransactionalTestExecutionListener
TransactionAnnotationParser - Interface in org.springframework.transaction.annotation
Strategy interface for parsing known transaction annotation types.
TransactionAspectSupport - Class in org.springframework.transaction.interceptor
Base class for transactional aspects, such as the TransactionInterceptor or an AspectJ aspect.
TransactionAspectSupport() - Constructor for class org.springframework.transaction.interceptor.TransactionAspectSupport
TransactionAspectSupport.TransactionInfo - Class in org.springframework.transaction.interceptor
Opaque object used to hold Transaction information.
TransactionAspectSupport.TransactionInfo(PlatformTransactionManager, TransactionAttribute, String) - Constructor for class org.springframework.transaction.interceptor.TransactionAspectSupport.TransactionInfo
TransactionAspectUtils - Class in org.springframework.transaction.interceptor
Utility methods for obtaining a PlatformTransactionManager by qualifier value.
TransactionAspectUtils() - Constructor for class org.springframework.transaction.interceptor.TransactionAspectUtils
TransactionAttribute - Interface in org.springframework.transaction.interceptor
This interface adds a rollbackOn specification to TransactionDefinition.
TransactionAttributeEditor - Class in org.springframework.transaction.interceptor
PropertyEditor for TransactionAttribute objects.
TransactionAttributeEditor() - Constructor for class org.springframework.transaction.interceptor.TransactionAttributeEditor
TransactionAttributeSource - Interface in org.springframework.transaction.interceptor
Interface used by TransactionInterceptor.
TransactionAttributeSourceAdvisor - Class in org.springframework.transaction.interceptor
Advisor driven by a TransactionAttributeSource, used to include a TransactionInterceptor only for methods that are transactional.
TransactionAttributeSourceAdvisor() - Constructor for class org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor
Create a new TransactionAttributeSourceAdvisor.
TransactionAttributeSourceAdvisor(TransactionInterceptor) - Constructor for class org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor
Create a new TransactionAttributeSourceAdvisor.
TransactionAttributeSourceEditor - Class in org.springframework.transaction.interceptor
Property editor that converts a String into a TransactionAttributeSource.
TransactionAttributeSourceEditor() - Constructor for class org.springframework.transaction.interceptor.TransactionAttributeSourceEditor
TransactionAwareConnectionFactoryProxy - Class in org.springframework.jca.cci.connection
Proxy for a target CCI ConnectionFactory, adding awareness of Spring-managed transactions.
TransactionAwareConnectionFactoryProxy() - Constructor for class org.springframework.jca.cci.connection.TransactionAwareConnectionFactoryProxy
Create a new TransactionAwareConnectionFactoryProxy.
TransactionAwareConnectionFactoryProxy(ConnectionFactory) - Constructor for class org.springframework.jca.cci.connection.TransactionAwareConnectionFactoryProxy
Create a new TransactionAwareConnectionFactoryProxy.
TransactionAwareConnectionFactoryProxy - Class in org.springframework.jms.connection
Proxy for a target JMS ConnectionFactory, adding awareness of Spring-managed transactions.
TransactionAwareConnectionFactoryProxy() - Constructor for class org.springframework.jms.connection.TransactionAwareConnectionFactoryProxy
Create a new TransactionAwareConnectionFactoryProxy.
TransactionAwareConnectionFactoryProxy(ConnectionFactory) - Constructor for class org.springframework.jms.connection.TransactionAwareConnectionFactoryProxy
Create a new TransactionAwareConnectionFactoryProxy.
TransactionAwareDataSourceConnectionProvider - Class in org.springframework.orm.hibernate3
Subclass of LocalDataSourceConnectionProvider that returns a transaction-aware proxy for the exposed DataSource.
TransactionAwareDataSourceConnectionProvider() - Constructor for class org.springframework.orm.hibernate3.TransactionAwareDataSourceConnectionProvider
TransactionAwareDataSourceProxy - Class in org.springframework.jdbc.datasource
Proxy for a target JDBC DataSource, adding awareness of Spring-managed transactions.
TransactionAwareDataSourceProxy() - Constructor for class org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy
Create a new TransactionAwareDataSourceProxy.
TransactionAwareDataSourceProxy(DataSource) - Constructor for class org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy
Create a new TransactionAwareDataSourceProxy.
TransactionAwarePersistenceManagerFactoryProxy - Class in org.springframework.orm.jdo
Proxy for a target JDO PersistenceManagerFactory, returning the current thread-bound PersistenceManager (the Spring-managed transactional PersistenceManager or the single OpenPersistenceManagerInView PersistenceManager) on getPersistenceManager(), if any.
TransactionAwarePersistenceManagerFactoryProxy() - Constructor for class org.springframework.orm.jdo.TransactionAwarePersistenceManagerFactoryProxy
TransactionCallback<T> - Interface in org.springframework.transaction.support
Callback interface for transactional code.
TransactionCallbackWithoutResult - Class in org.springframework.transaction.support
Simple convenience class for TransactionCallback implementation.
TransactionCallbackWithoutResult() - Constructor for class org.springframework.transaction.support.TransactionCallbackWithoutResult
TransactionConfiguration - Annotation Type in org.springframework.test.context.transaction
TransactionConfiguration defines class-level metadata for configuring transactional tests.
TransactionConfigurationAttributes - Class in org.springframework.test.context.transaction
Configuration attributes for configuring transactional tests.
TransactionConfigurationAttributes(String, boolean) - Constructor for class org.springframework.test.context.transaction.TransactionConfigurationAttributes
Construct a new TransactionConfigurationAttributes instance from the supplied arguments.
transactionDefinition - Variable in class org.springframework.test.AbstractTransactionalSpringContextTests
Deprecated. Transaction definition used by this test class: by default, a plain DefaultTransactionDefinition.
TransactionDefinition - Interface in org.springframework.transaction
Interface that defines Spring-compliant transaction properties.
TransactionException - Exception in org.springframework.transaction
Superclass for all transaction exceptions.
TransactionException(String) - Constructor for exception org.springframework.transaction.TransactionException
Constructor for TransactionException.
TransactionException(String, Throwable) - Constructor for exception org.springframework.transaction.TransactionException
Constructor for TransactionException.
TransactionFactory - Interface in org.springframework.transaction.jta
Strategy interface for creating JTA Transaction objects based on specified transactional characteristics.
TransactionInProgressException - Exception in org.springframework.jms
Runtime exception mirroring the JMS TransactionInProgressException.
TransactionInProgressException(TransactionInProgressException) - Constructor for exception org.springframework.jms.TransactionInProgressException
TransactionInterceptor - Class in org.springframework.transaction.interceptor
AOP Alliance MethodInterceptor for declarative transaction management using the common Spring transaction infrastructure (PlatformTransactionManager).
TransactionInterceptor() - Constructor for class org.springframework.transaction.interceptor.TransactionInterceptor
Create a new TransactionInterceptor.
TransactionInterceptor(PlatformTransactionManager, Properties) - Constructor for class org.springframework.transaction.interceptor.TransactionInterceptor
Create a new TransactionInterceptor.
TransactionInterceptor(PlatformTransactionManager, TransactionAttributeSource) - Constructor for class org.springframework.transaction.interceptor.TransactionInterceptor
Create a new TransactionInterceptor.
transactionManager - Variable in class org.springframework.test.AbstractTransactionalSpringContextTests
Deprecated. The transaction manager to use
TransactionOperations - Interface in org.springframework.transaction.support
Interface specifying basic transaction execution operations.
TransactionProxyFactoryBean - Class in org.springframework.transaction.interceptor
Proxy factory bean for simplified declarative transaction handling.
TransactionProxyFactoryBean() - Constructor for class org.springframework.transaction.interceptor.TransactionProxyFactoryBean
TransactionRolledBackException - Exception in org.springframework.jms
Runtime exception mirroring the JMS TransactionRolledBackException.
TransactionRolledBackException(TransactionRolledBackException) - Constructor for exception org.springframework.jms.TransactionRolledBackException
transactionStatus - Variable in class org.springframework.test.AbstractTransactionalSpringContextTests
Deprecated. TransactionStatus for this test.
TransactionStatus - Interface in org.springframework.transaction
Representation of the status of a transaction.
TransactionSuspensionNotSupportedException - Exception in org.springframework.transaction
Exception thrown when attempting to suspend an existing transaction but transaction suspension is not supported by the underlying backend.
TransactionSuspensionNotSupportedException(String) - Constructor for exception org.springframework.transaction.TransactionSuspensionNotSupportedException
Constructor for TransactionSuspensionNotSupportedException.
TransactionSuspensionNotSupportedException(String, Throwable) - Constructor for exception org.springframework.transaction.TransactionSuspensionNotSupportedException
Constructor for TransactionSuspensionNotSupportedException.
TransactionSynchronization - Interface in org.springframework.transaction.support
Interface for transaction synchronization callbacks.
TransactionSynchronizationAdapter - Class in org.springframework.transaction.support
Simple TransactionSynchronization adapter containing empty method implementations, for easier overriding of single methods.
TransactionSynchronizationAdapter() - Constructor for class org.springframework.transaction.support.TransactionSynchronizationAdapter
TransactionSynchronizationManager - Class in org.springframework.transaction.support
Central helper that manages resources and transaction synchronizations per thread.
TransactionSynchronizationManager() - Constructor for class org.springframework.transaction.support.TransactionSynchronizationManager
TransactionSynchronizationUtils - Class in org.springframework.transaction.support
Utility methods for triggering specific TransactionSynchronization callback methods on all currently registered synchronizations.
TransactionSynchronizationUtils() - Constructor for class org.springframework.transaction.support.TransactionSynchronizationUtils
TransactionSystemException - Exception in org.springframework.transaction
Exception thrown when a general transaction system error is encountered, like on commit or rollback.
TransactionSystemException(String) - Constructor for exception org.springframework.transaction.TransactionSystemException
Constructor for TransactionSystemException.
TransactionSystemException(String, Throwable) - Constructor for exception org.springframework.transaction.TransactionSystemException
Constructor for TransactionSystemException.
TransactionTemplate - Class in org.springframework.transaction.support
Template class that simplifies programmatic transaction demarcation and transaction exception handling.
TransactionTemplate() - Constructor for class org.springframework.transaction.support.TransactionTemplate
Construct a new TransactionTemplate for bean usage.
TransactionTemplate(PlatformTransactionManager) - Constructor for class org.springframework.transaction.support.TransactionTemplate
Construct a new TransactionTemplate using the given transaction manager.
TransactionTemplate(PlatformTransactionManager, TransactionDefinition) - Constructor for class org.springframework.transaction.support.TransactionTemplate
Construct a new TransactionTemplate using the given transaction manager, taking its default settings from the given transaction definition.
TransactionTimedOutException - Exception in org.springframework.transaction
Exception to be thrown when a transaction has timed out.
TransactionTimedOutException(String) - Constructor for exception org.springframework.transaction.TransactionTimedOutException
Constructor for TransactionTimedOutException.
TransactionTimedOutException(String, Throwable) - Constructor for exception org.springframework.transaction.TransactionTimedOutException
Constructor for TransactionTimedOutException.
TransactionUsageException - Exception in org.springframework.transaction
Superclass for exceptions caused by inappropriate usage of a Spring transaction API.
TransactionUsageException(String) - Constructor for exception org.springframework.transaction.TransactionUsageException
Constructor for TransactionUsageException.
TransactionUsageException(String, Throwable) - Constructor for exception org.springframework.transaction.TransactionUsageException
Constructor for TransactionUsageException.
transferTo(File) - Method in class org.springframework.mock.web.MockMultipartFile
transferTo(File) - Method in class org.springframework.web.multipart.commons.CommonsMultipartFile
transferTo(File) - Method in interface org.springframework.web.multipart.MultipartFile
Transfer the received file to the given destination file.
transform(Source, Result) - Method in class org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter
Transforms the given Source to the Result.
transformedBeanName(String) - Static method in class org.springframework.beans.factory.BeanFactoryUtils
Return the actual bean name, stripping out the factory dereference prefix (if any, also stripping repeated factory prefixes if found).
transformedBeanName(String) - Method in class org.springframework.beans.factory.support.AbstractBeanFactory
Return the bean name, stripping out the factory dereference prefix if necessary, and resolving aliases to canonical names.
TransformerUtils - Class in org.springframework.util.xml
Contains common behavior relating to Transformers, and the javax.xml.transform package in general.
TransformerUtils() - Constructor for class org.springframework.util.xml.TransformerUtils
transformIfNecessary(String, byte[]) - Method in class org.springframework.core.OverridingClassLoader
Transformation hook to be implemented by subclasses.
transformIfNecessary(String, byte[]) - Method in class org.springframework.instrument.classloading.SimpleInstrumentableClassLoader
transformIfNecessary(String, byte[]) - Method in class org.springframework.instrument.classloading.WeavingTransformer
Apply transformation on a given class byte definition.
transformIfNecessary(String, String, byte[], ProtectionDomain) - Method in class org.springframework.instrument.classloading.WeavingTransformer
Apply transformation on a given class byte definition.
transformPath(String) - Method in class org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator
Transform the request URI (in the context of the webapp) stripping slashes and extensions, and replacing the separator as required.
TransformTag - Class in org.springframework.web.servlet.tags
Tag for transforming reference data values from form controllers and other objects inside a spring:bind tag (or a data-bound form element tag from Spring's form tag library).
TransformTag() - Constructor for class org.springframework.web.servlet.tags.TransformTag
TransientDataAccessException - Exception in org.springframework.dao
Root of the hierarchy of data access exceptions that are considered transient - where a previously failed operation might be able to succeed when the operation is retried without any intervention by application-level functionality.
TransientDataAccessException(String) - Constructor for exception org.springframework.dao.TransientDataAccessException
Constructor for TransientDataAccessException.
TransientDataAccessException(String, Throwable) - Constructor for exception org.springframework.dao.TransientDataAccessException
Constructor for TransientDataAccessException.
TransientDataAccessResourceException - Exception in org.springframework.dao
Data access exception thrown when a resource fails temporarily and the operation can be retried.
TransientDataAccessResourceException(String) - Constructor for exception org.springframework.dao.TransientDataAccessResourceException
Constructor for TransientDataAccessResourceException.
TransientDataAccessResourceException(String, Throwable) - Constructor for exception org.springframework.dao.TransientDataAccessResourceException
Constructor for TransientDataAccessResourceException.
translate(String, String, SQLException) - Method in class org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator
Pre-checks the arguments, calls AbstractFallbackSQLExceptionTranslator.doTranslate(java.lang.String, java.lang.String, java.sql.SQLException), and invokes the fallback translator if necessary.
translate(String, String, SQLException) - Method in interface org.springframework.jdbc.support.SQLExceptionTranslator
Translate the given SQLException into a generic DataAccessException.
translateException(JDOException) - Method in class org.springframework.orm.jdo.DefaultJdoDialect
This implementation delegates to PersistenceManagerFactoryUtils.
translateException(JDOException) - Method in interface org.springframework.orm.jdo.JdoDialect
Translate the given JDOException to a corresponding exception from Spring's generic DataAccessException hierarchy.
translateExceptionIfPossible(RuntimeException) - Method in class org.springframework.dao.support.ChainedPersistenceExceptionTranslator
translateExceptionIfPossible(RuntimeException) - Method in interface org.springframework.dao.support.PersistenceExceptionTranslator
Translate the given runtime exception thrown by a persistence framework to a corresponding exception from Spring's generic DataAccessException hierarchy, if possible.
translateExceptionIfPossible(RuntimeException) - Method in class org.springframework.orm.hibernate3.AbstractSessionFactoryBean
Implementation of the PersistenceExceptionTranslator interface, as autodetected by Spring's PersistenceExceptionTranslationPostProcessor.
translateExceptionIfPossible(RuntimeException) - Method in class org.springframework.orm.jdo.DefaultJdoDialect
Implementation of the PersistenceExceptionTranslator interface, as autodetected by Spring's PersistenceExceptionTranslationPostProcessor.
translateExceptionIfPossible(RuntimeException) - Method in class org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean
Implementation of the PersistenceExceptionTranslator interface, as autodetected by Spring's PersistenceExceptionTranslationPostProcessor.
translateExceptionIfPossible(RuntimeException) - Method in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
Implementation of the PersistenceExceptionTranslator interface, as autodetected by Spring's PersistenceExceptionTranslationPostProcessor.
translateExceptionIfPossible(RuntimeException) - Method in class org.springframework.orm.jpa.DefaultJpaDialect
This implementation delegates to EntityManagerFactoryUtils.
translateExceptionIfPossible(RuntimeException) - Method in class org.springframework.orm.jpa.vendor.HibernateJpaDialect
translateIfNecessary(RuntimeException, PersistenceExceptionTranslator) - Static method in class org.springframework.dao.support.DataAccessUtils
Return a translated exception if this is appropriate, otherwise return the input exception.
translateIfNecessary(RuntimeException) - Method in class org.springframework.orm.jpa.JpaAccessor
Convert the given runtime exception to an appropriate exception from the org.springframework.dao hierarchy if necessary, or return the exception itself if it is not persistence related
Trigger - Interface in org.springframework.scheduling
Common interface for trigger objects that determine the next execution time of a task that they get associated with.
triggerAfterCommit() - Static method in class org.springframework.transaction.support.TransactionSynchronizationUtils
Trigger afterCommit callbacks on all currently registered synchronizations.
triggerAfterCompletion(int) - Static method in class org.springframework.transaction.support.TransactionSynchronizationUtils
Trigger afterCompletion callbacks on all currently registered synchronizations.
triggerBeforeCommit(DefaultTransactionStatus) - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Trigger beforeCommit callbacks.
triggerBeforeCommit(boolean) - Static method in class org.springframework.transaction.support.TransactionSynchronizationUtils
Trigger beforeCommit callbacks on all currently registered synchronizations.
triggerBeforeCompletion(DefaultTransactionStatus) - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Trigger beforeCompletion callbacks.
triggerBeforeCompletion() - Static method in class org.springframework.transaction.support.TransactionSynchronizationUtils
Trigger beforeCompletion callbacks on all currently registered synchronizations.
TriggerContext - Interface in org.springframework.scheduling
Context object encapsulating last execution times and last completion time of a given task.
triggerFlush() - Static method in class org.springframework.transaction.support.TransactionSynchronizationUtils
Trigger flush callbacks on all currently registered synchronizations.
trimAllWhitespace(String) - Static method in class org.springframework.util.StringUtils
Trim all whitespace from the given String: leading, trailing, and inbetween characters.
trimArrayElements(String[]) - Static method in class org.springframework.util.StringUtils
Trim the elements of the given String array, calling String.trim() on each of them.
trimLeadingCharacter(String, char) - Static method in class org.springframework.util.StringUtils
Trim all occurences of the supplied leading character from the given String.
trimLeadingWhitespace(String) - Static method in class org.springframework.util.StringUtils
Trim leading whitespace from the given String.
trimTrailingCharacter(String, char) - Static method in class org.springframework.util.StringUtils
Trim all occurences of the supplied trailing character from the given String.
trimTrailingWhitespace(String) - Static method in class org.springframework.util.StringUtils
Trim trailing whitespace from the given String.
trimWhitespace(String) - Static method in class org.springframework.util.StringUtils
Trim leading and trailing whitespace from the given String.
TRUE - Static variable in interface org.springframework.aop.ClassFilter
Canonical instance of a ClassFilter that matches all classes.
TRUE - Static variable in interface org.springframework.aop.MethodMatcher
Canonical instance that matches all methods.
TRUE - Static variable in interface org.springframework.aop.Pointcut
Canonical Pointcut instance that always matches.
TRUE - Static variable in class org.springframework.expression.spel.support.BooleanTypedValue
TRUE_HIGH - Static variable in class org.springframework.util.comparator.BooleanComparator
A shared default instance of this comparator, treating true higher than false.
TRUE_LOW - Static variable in class org.springframework.util.comparator.BooleanComparator
A shared default instance of this comparator, treating true lower than false.
TRUE_VALUE - Static variable in class org.springframework.beans.factory.support.PropertiesBeanDefinitionReader
Value of a T/F attribute that represents true.
TRUE_VALUE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
Value of a T/F attribute that represents true.
TX_DATA_SOURCE_PREFIX - Static variable in class org.springframework.scheduling.quartz.LocalDataSourceJobStore
Name used for the transactional ConnectionProvider for Quartz.
TxNamespaceHandler - Class in org.springframework.transaction.config
NamespaceHandler allowing for the configuration of declarative transaction management using either XML or using annotations.
TxNamespaceHandler() - Constructor for class org.springframework.transaction.config.TxNamespaceHandler
TYPE_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
TYPE_KEY - Static variable in class org.springframework.jmx.export.naming.IdentityNamingStrategy
TYPE_UNKNOWN - Static variable in interface org.springframework.jdbc.core.namedparam.SqlParameterSource
Constant that indicates an unknown (or unspecified) SQL type.
TYPE_UNKNOWN - Static variable in interface org.springframework.jdbc.core.SqlReturnType
Constant that indicates an unknown (or unspecified) SQL type.
TYPE_UNKNOWN - Static variable in interface org.springframework.jdbc.core.SqlTypeValue
Constant that indicates an unknown (or unspecified) SQL type.
TYPE_UNKNOWN - Static variable in class org.springframework.jdbc.support.JdbcUtils
Constant that indicates an unknown (or unspecified) SQL type.
TypeCode - Enum in org.springframework.expression.spel.ast
TypeComparator - Interface in org.springframework.expression
Instances of a type comparator should be able to compare pairs of objects for equality, the specification of the return value is the same as for Comparable.
TypeConverter - Interface in org.springframework.beans
Interface that defines type conversion methods.
TypeConverter - Interface in org.springframework.expression
A type converter can convert values between different types encountered during expression evaluation.
TypeDefinitionBean - Class in org.springframework.orm.hibernate3
Bean that encapsulates a Hibernate type definition.
TypeDefinitionBean() - Constructor for class org.springframework.orm.hibernate3.TypeDefinitionBean
TypeDescriptor - Class in org.springframework.core.convert
Context about a type to convert to.
TypeDescriptor(MethodParameter) - Constructor for class org.springframework.core.convert.TypeDescriptor
Create a new type descriptor from a method or constructor parameter.
TypeDescriptor(Field) - Constructor for class org.springframework.core.convert.TypeDescriptor
Create a new type descriptor for a field.
TypeDescriptor(MethodParameter, Class<?>) - Constructor for class org.springframework.core.convert.TypeDescriptor
Create a new type descriptor from a method or constructor parameter.
TypeDescriptor(Field, Class<?>) - Constructor for class org.springframework.core.convert.TypeDescriptor
Create a new type descriptor for a field.
typeDescriptorCache - Variable in class org.springframework.expression.spel.support.ReflectivePropertyAccessor
TypedStringValue - Class in org.springframework.beans.factory.config
Holder for a typed String value.
TypedStringValue(String) - Constructor for class org.springframework.beans.factory.config.TypedStringValue
Create a new TypedStringValue for the given String value.
TypedStringValue(String, Class) - Constructor for class org.springframework.beans.factory.config.TypedStringValue
Create a new TypedStringValue for the given String value and target type.
TypedStringValue(String, String) - Constructor for class org.springframework.beans.factory.config.TypedStringValue
Create a new TypedStringValue for the given String value and target type.
TypedValue - Class in org.springframework.expression
Encapsulates an object and a type descriptor that describes it.
TypedValue(Object) - Constructor for class org.springframework.expression.TypedValue
Create a TypedValue for a simple object.
TypedValue(Object, TypeDescriptor) - Constructor for class org.springframework.expression.TypedValue
Create a TypedValue for a particular value with a particular type descriptor.
TypeFilter - Interface in org.springframework.core.type.filter
Base interface for type filters using a MetadataReader.
TypeLocator - Interface in org.springframework.expression
Implementors of this interface are expected to be able to locate types.
TypeMismatchDataAccessException - Exception in org.springframework.dao
Exception thrown on mismatch between Java type and database type: for example on an attempt to set an object of the wrong type in an RDBMS column.
TypeMismatchDataAccessException(String) - Constructor for exception org.springframework.dao.TypeMismatchDataAccessException
Constructor for TypeMismatchDataAccessException.
TypeMismatchDataAccessException(String, Throwable) - Constructor for exception org.springframework.dao.TypeMismatchDataAccessException
Constructor for TypeMismatchDataAccessException.
TypeMismatchException - Exception in org.springframework.beans
Exception thrown on a type mismatch when trying to set a bean property.
TypeMismatchException(PropertyChangeEvent, Class) - Constructor for exception org.springframework.beans.TypeMismatchException
Create a new TypeMismatchException.
TypeMismatchException(PropertyChangeEvent, Class, Throwable) - Constructor for exception org.springframework.beans.TypeMismatchException
Create a new TypeMismatchException.
TypeMismatchException(Object, Class) - Constructor for exception org.springframework.beans.TypeMismatchException
Create a new TypeMismatchException without PropertyChangeEvent.
TypeMismatchException(Object, Class, Throwable) - Constructor for exception org.springframework.beans.TypeMismatchException
Create a new TypeMismatchException without PropertyChangeEvent.
TypeMismatchNamingException - Exception in org.springframework.jndi
Exception thrown if a type mismatch is encountered for an object located in a JNDI environment.
TypeMismatchNamingException(String, Class, Class) - Constructor for exception org.springframework.jndi.TypeMismatchNamingException
Construct a new TypeMismatchNamingException, building an explanation text from the given arguments.
TypeMismatchNamingException(String) - Constructor for exception org.springframework.jndi.TypeMismatchNamingException
Construct a new TypeMismatchNamingException.
TypePatternClassFilter - Class in org.springframework.aop.aspectj
Spring AOP ClassFilter implementation using AspectJ type matching.
TypePatternClassFilter() - Constructor for class org.springframework.aop.aspectj.TypePatternClassFilter
Creates a new instance of the TypePatternClassFilter class.
TypePatternClassFilter(String) - Constructor for class org.springframework.aop.aspectj.TypePatternClassFilter
Create a fully configured TypePatternClassFilter using the given type pattern.
TypeReference - Class in org.springframework.expression.spel.ast
Represents a reference to a type, for example "T(String)" or "T(com.somewhere.Foo)"
TypeReference(int, SpelNodeImpl) - Constructor for class org.springframework.expression.spel.ast.TypeReference
TypeUtils - Class in org.springframework.util
Utility to work with Java 5 generic type parameters.
TypeUtils() - Constructor for class org.springframework.util.TypeUtils
Overview Package Class Tree Deprecated Index Help
A B C D E F G H I J K L M N O P Q R S T U V W X


U-Index

PREV LETTER NEXT LETTER FRAMES NO FRAMES
A B C D E F G H I J K L M N O P Q R S T U V W X

U

UiApplicationContextUtils - Class in org.springframework.ui.context.support
Utility class for UI application context implementations.
UiApplicationContextUtils() - Constructor for class org.springframework.ui.context.support.UiApplicationContextUtils
UnableToRegisterMBeanException - Exception in org.springframework.jmx.export
Exception thrown when we are unable to register an MBean, for example because of a naming conflict.
UnableToRegisterMBeanException(String) - Constructor for exception org.springframework.jmx.export.UnableToRegisterMBeanException
Create a new UnableToRegisterMBeanException with the specified error message.
UnableToRegisterMBeanException(String, Throwable) - Constructor for exception org.springframework.jmx.export.UnableToRegisterMBeanException
Create a new UnableToRegisterMBeanException with the specified error message and root cause.
UnableToSendNotificationException - Exception in org.springframework.jmx.export.notification
Thrown when a JMX Notification is unable to be sent.
UnableToSendNotificationException(String) - Constructor for exception org.springframework.jmx.export.notification.UnableToSendNotificationException
Create a new instance of the UnableToSendNotificationException class with the specified error message.
UnableToSendNotificationException(String, Throwable) - Constructor for exception org.springframework.jmx.export.notification.UnableToSendNotificationException
Create a new instance of the UnableToSendNotificationException with the specified error message and root cause.
unbind(String) - Method in class org.springframework.jndi.JndiTemplate
Remove the binding for the given name from the current JNDI context.
unbind(String) - Method in class org.springframework.mock.jndi.SimpleNamingContext
unbind(Name) - Method in class org.springframework.mock.jndi.SimpleNamingContext
unbindResource(Object) - Static method in class org.springframework.transaction.support.TransactionSynchronizationManager
Unbind a resource for the given key from the current thread.
unbindResourceIfPossible(Object) - Static method in class org.springframework.transaction.support.TransactionSynchronizationManager
Unbind a resource for the given key from the current thread.
unbound() - Method in interface org.springframework.transaction.support.ResourceHolder
Notify this holder that it has been unbound from transaction synchronization.
unbound() - Method in class org.springframework.transaction.support.ResourceHolderSupport
UNBOUNDED_CONCURRENCY - Static variable in class org.springframework.core.task.SimpleAsyncTaskExecutor
Permit any number of concurrent invocations: that is, don't throttle concurrency.
UNBOUNDED_CONCURRENCY - Static variable in class org.springframework.util.ConcurrencyThrottleSupport
Permit any number of concurrent invocations: that is, don't throttle concurrency.
uncapitalize(String) - Static method in class org.springframework.util.StringUtils
Uncapitalize a String, changing the first letter to lower case as per Character.toLowerCase(char).
UncategorizedDataAccessException - Exception in org.springframework.dao
Normal superclass when we can't distinguish anything more specific than "something went wrong with the underlying resource": for example, a SQLException from JDBC we can't pinpoint more precisely.
UncategorizedDataAccessException(String, Throwable) - Constructor for exception org.springframework.dao.UncategorizedDataAccessException
Constructor for UncategorizedDataAccessException.
UncategorizedJmsException - Exception in org.springframework.jms
JmsException to be thrown when no other matching subclass found.
UncategorizedJmsException(String) - Constructor for exception org.springframework.jms.UncategorizedJmsException
Constructor that takes a message.
UncategorizedJmsException(String, Throwable) - Constructor for exception org.springframework.jms.UncategorizedJmsException
Constructor that takes a message and a root cause.
UncategorizedJmsException(Throwable) - Constructor for exception org.springframework.jms.UncategorizedJmsException
Constructor that takes a root cause only.
UncategorizedMappingException - Exception in org.springframework.oxm
Exception that indicates that the cause cannot be distinguished further.
UncategorizedMappingException(String, Throwable) - Constructor for exception org.springframework.oxm.UncategorizedMappingException
Construct an UncategorizedMappingException with the specified detail message and nested exception.
UncategorizedSQLException - Exception in org.springframework.jdbc
Exception thrown when we can't classify a SQLException into one of our generic data access exceptions.
UncategorizedSQLException(String, String, SQLException) - Constructor for exception org.springframework.jdbc.UncategorizedSQLException
Constructor for UncategorizedSQLException.
under(Class) - Method in interface org.springframework.core.ControlFlow
Detect whether we're under the given class, according to the current stack trace.
under(Class, String) - Method in interface org.springframework.core.ControlFlow
Detect whether we're under the given class and method, according to the current stack trace.
underToken(String) - Method in interface org.springframework.core.ControlFlow
Detect whether the current stack trace contains the given token.
unescape(String) - Method in class org.springframework.util.DefaultPropertiesPersister
UnexpectedRollbackException - Exception in org.springframework.transaction
Thrown when an attempt to commit a transaction resulted in an unexpected rollback.
UnexpectedRollbackException(String) - Constructor for exception org.springframework.transaction.UnexpectedRollbackException
Constructor for UnexpectedRollbackException.
UnexpectedRollbackException(String, Throwable) - Constructor for exception org.springframework.transaction.UnexpectedRollbackException
Constructor for UnexpectedRollbackException.
union(ClassFilter, ClassFilter) - Static method in class org.springframework.aop.support.ClassFilters
Match all classes that either (or both) of the given ClassFilters matches.
union(ClassFilter[]) - Static method in class org.springframework.aop.support.ClassFilters
Match all classes that either (or all) of the given ClassFilters matches.
union(ClassFilter) - Method in class org.springframework.aop.support.ComposablePointcut
Apply a union with the given ClassFilter.
union(MethodMatcher) - Method in class org.springframework.aop.support.ComposablePointcut
Apply a union with the given MethodMatcher.
union(Pointcut) - Method in class org.springframework.aop.support.ComposablePointcut
Apply a union with the given Pointcut.
union(MethodMatcher, MethodMatcher) - Static method in class org.springframework.aop.support.MethodMatchers
Match all methods that either (or both) of the given MethodMatchers matches.
union(Pointcut, Pointcut) - Static method in class org.springframework.aop.support.Pointcuts
Match all methods that either (or both) of the given pointcuts matches.
uniqueResult(Collection<T>) - Static method in class org.springframework.dao.support.DataAccessUtils
Return a unique result object from the given Collection.
UnknownAdviceTypeException - Exception in org.springframework.aop.framework.adapter
Exception thrown when an attempt is made to use an unsupported Advisor or Advice type.
UnknownAdviceTypeException(Object) - Constructor for exception org.springframework.aop.framework.adapter.UnknownAdviceTypeException
Create a new UnknownAdviceTypeException for the given advice object.
UnknownAdviceTypeException(String) - Constructor for exception org.springframework.aop.framework.adapter.UnknownAdviceTypeException
Create a new UnknownAdviceTypeException with the given message.
unloadBeanFactory() - Method in class org.springframework.ejb.support.AbstractStatefulSessionBean
Unload the Spring BeanFactory instance.
unmarshal(Source) - Method in class org.springframework.oxm.jaxb.Jaxb2Marshaller
unmarshal(Source, MimeContainer) - Method in class org.springframework.oxm.jaxb.Jaxb2Marshaller
unmarshal(Source, MimeContainer) - Method in interface org.springframework.oxm.mime.MimeUnmarshaller
Unmarshals the given provided Source into an object graph, reading binary attachments from a MimeContainer.
unmarshal(Source) - Method in class org.springframework.oxm.support.AbstractMarshaller
Unmarshals the given provided javax.xml.transform.Source into an object graph.
unmarshal(Source) - Method in interface org.springframework.oxm.Unmarshaller
Unmarshals the given Source into an object graph.
unmarshalDomNode(Node) - Method in class org.springframework.oxm.castor.CastorMarshaller
unmarshalDomNode(Node) - Method in class org.springframework.oxm.jibx.JibxMarshaller
unmarshalDomNode(Node) - Method in class org.springframework.oxm.support.AbstractMarshaller
Abstract template method for unmarshalling from a given DOM Node.
unmarshalDomNode(Node) - Method in class org.springframework.oxm.xmlbeans.XmlBeansMarshaller
unmarshalDomNode(Node) - Method in class org.springframework.oxm.xstream.XStreamMarshaller
unmarshalDomSource(DOMSource) - Method in class org.springframework.oxm.support.AbstractMarshaller
Template method for handling DOMSources.
unmarshalFromBytesMessage(BytesMessage, Unmarshaller) - Method in class org.springframework.jms.support.converter.MarshallingMessageConverter
Unmarshal the given BytesMessage into an object.
unmarshalFromMessage(Message, Unmarshaller) - Method in class org.springframework.jms.support.converter.MarshallingMessageConverter
Template method that allows for custom message unmarshalling.
unmarshalFromTextMessage(TextMessage, Unmarshaller) - Method in class org.springframework.jms.support.converter.MarshallingMessageConverter
Unmarshal the given TextMessage into an object.
unmarshalInputStream(InputStream) - Method in class org.springframework.oxm.castor.CastorMarshaller
unmarshalInputStream(InputStream) - Method in class org.springframework.oxm.jibx.JibxMarshaller
unmarshalInputStream(InputStream) - Method in class org.springframework.oxm.support.AbstractMarshaller
Abstract template method for unmarshalling from a given InputStream.
unmarshalInputStream(InputStream) - Method in class org.springframework.oxm.xmlbeans.XmlBeansMarshaller
unmarshalInputStream(InputStream) - Method in class org.springframework.oxm.xstream.XStreamMarshaller
Unmarshaller - Interface in org.springframework.oxm
Defines the contract for Object XML Mapping unmarshallers.
UnmarshallingFailureException - Exception in org.springframework.oxm
Exception thrown on unmarshalling failure.
UnmarshallingFailureException(String) - Constructor for exception org.springframework.oxm.UnmarshallingFailureException
Construct a MarshallingFailureException with the specified detail message.
UnmarshallingFailureException(String, Throwable) - Constructor for exception org.springframework.oxm.UnmarshallingFailureException
Construct a MarshallingFailureException with the specified detail message and nested exception.
unmarshalReader(Reader) - Method in class org.springframework.oxm.castor.CastorMarshaller
unmarshalReader(Reader) - Method in class org.springframework.oxm.jibx.JibxMarshaller
unmarshalReader(Reader) - Method in class org.springframework.oxm.support.AbstractMarshaller
Abstract template method for unmarshalling from a given Reader.
unmarshalReader(Reader) - Method in class org.springframework.oxm.xmlbeans.XmlBeansMarshaller
unmarshalReader(Reader) - Method in class org.springframework.oxm.xstream.XStreamMarshaller
unmarshalSaxReader(XMLReader, InputSource) - Method in class org.springframework.oxm.castor.CastorMarshaller
unmarshalSaxReader(XMLReader, InputSource) - Method in class org.springframework.oxm.jibx.JibxMarshaller
unmarshalSaxReader(XMLReader, InputSource) - Method in class org.springframework.oxm.support.AbstractMarshaller
Abstract template method for unmarshalling using a given SAX XMLReader and InputSource.
unmarshalSaxReader(XMLReader, InputSource) - Method in class org.springframework.oxm.xmlbeans.XmlBeansMarshaller
unmarshalSaxReader(XMLReader, InputSource) - Method in class org.springframework.oxm.xstream.XStreamMarshaller
unmarshalSaxSource(SAXSource) - Method in class org.springframework.oxm.support.AbstractMarshaller
Template method for handling SAXSources.
unmarshalStaxSource(Source) - Method in class org.springframework.oxm.support.AbstractMarshaller
Template method for handling StaxSources.
unmarshalStreamSource(StreamSource) - Method in class org.springframework.oxm.support.AbstractMarshaller
Template method for handling StreamSources.
unmarshalXmlEventReader(XMLEventReader) - Method in class org.springframework.oxm.castor.CastorMarshaller
unmarshalXmlEventReader(XMLEventReader) - Method in class org.springframework.oxm.jibx.JibxMarshaller
unmarshalXmlEventReader(XMLEventReader) - Method in class org.springframework.oxm.support.AbstractMarshaller
Abstract template method for unmarshalling from a given Stax XMLEventReader.
unmarshalXmlEventReader(XMLEventReader) - Method in class org.springframework.oxm.xmlbeans.XmlBeansMarshaller
unmarshalXmlEventReader(XMLEventReader) - Method in class org.springframework.oxm.xstream.XStreamMarshaller
unmarshalXmlStreamReader(XMLStreamReader) - Method in class org.springframework.oxm.castor.CastorMarshaller
unmarshalXmlStreamReader(XMLStreamReader) - Method in class org.springframework.oxm.jibx.JibxMarshaller
unmarshalXmlStreamReader(XMLStreamReader) - Method in class org.springframework.oxm.support.AbstractMarshaller
Abstract template method for unmarshalling from a given Stax XMLStreamReader.
unmarshalXmlStreamReader(XMLStreamReader) - Method in class org.springframework.oxm.xmlbeans.XmlBeansMarshaller
unmarshalXmlStreamReader(XMLStreamReader) - Method in class org.springframework.oxm.xstream.XStreamMarshaller
unqualify(String) - Static method in class org.springframework.util.StringUtils
Unqualify a string qualified by a '.' dot character.
unqualify(String, char) - Static method in class org.springframework.util.StringUtils
Unqualify a string qualified by a separator character.
unregisterBeans() - Method in class org.springframework.jmx.support.MBeanRegistrationSupport
Unregisters all beans that have been registered by an instance of this class.
unregisterManagedResource(ObjectName) - Method in class org.springframework.jmx.export.MBeanExporter
unregisterManagedResource(ObjectName) - Method in interface org.springframework.jmx.export.MBeanExportOperations
Remove the specified MBean from the underlying MBeanServer registry.
UNRESOLVED - Static variable in interface org.springframework.web.bind.support.WebArgumentResolver
Marker to be returned when the resolver does not know how to handle the given method parameter.
UNRESOLVED - Static variable in interface org.springframework.web.servlet.mvc.annotation.ModelAndViewResolver
Marker to be returned when the resolver does not know how to handle the given method parameter.
UnsatisfiedDependencyException - Exception in org.springframework.beans.factory
Exception thrown when a bean depends on other beans or simple properties that were not specified in the bean factory definition, although dependency checking was enabled.
UnsatisfiedDependencyException(String, String, String, String) - Constructor for exception org.springframework.beans.factory.UnsatisfiedDependencyException
Create a new UnsatisfiedDependencyException.
UnsatisfiedDependencyException(String, String, String, BeansException) - Constructor for exception org.springframework.beans.factory.UnsatisfiedDependencyException
Create a new UnsatisfiedDependencyException.
UnsatisfiedDependencyException(String, String, int, Class, String) - Constructor for exception org.springframework.beans.factory.UnsatisfiedDependencyException
Create a new UnsatisfiedDependencyException.
UnsatisfiedDependencyException(String, String, int, Class, BeansException) - Constructor for exception org.springframework.beans.factory.UnsatisfiedDependencyException
Create a new UnsatisfiedDependencyException.
unsatisfiedNonSimpleProperties(AbstractBeanDefinition, BeanWrapper) - Method in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
Return an array of non-simple bean properties that are unsatisfied.
UnsatisfiedServletRequestParameterException - Exception in org.springframework.web.bind
ServletRequestBindingException subclass that indicates an unsatisfied parameter condition, as typically expressed using an @RequestMapping annotation at the @Controller type level.
UnsatisfiedServletRequestParameterException(String[], Map) - Constructor for exception org.springframework.web.bind.UnsatisfiedServletRequestParameterException
Create a new UnsatisfiedServletRequestParameterException.
unwrap(Class<T>) - Method in class org.springframework.jdbc.datasource.AbstractDataSource
unwrap(Class<T>) - Method in class org.springframework.jdbc.datasource.DelegatingDataSource
unwrap(Class<T>) - Method in class org.springframework.validation.beanvalidation.SpringValidatorAdapter
UpdatableSqlQuery<T> - Class in org.springframework.jdbc.object
Reusable RDBMS query in which concrete subclasses must implement the abstract updateRow(ResultSet, int, context) method to update each row of the JDBC ResultSet and optionally map contents into an object.
UpdatableSqlQuery() - Constructor for class org.springframework.jdbc.object.UpdatableSqlQuery
Constructor to allow use as a JavaBean
UpdatableSqlQuery(DataSource, String) - Constructor for class org.springframework.jdbc.object.UpdatableSqlQuery
Convenient constructor with DataSource and SQL string.
UpdatableSqlQuery.RowMapperImpl - Class in org.springframework.jdbc.object
Implementation of RowMapper that calls the enclosing class's updateRow() method for each row.
UpdatableSqlQuery.RowMapperImpl(Map) - Constructor for class org.springframework.jdbc.object.UpdatableSqlQuery.RowMapperImpl
update(String) - Method in interface org.springframework.jdbc.core.JdbcOperations
Issue a single SQL update operation (such as an insert, update or delete statement).
update(PreparedStatementCreator) - Method in interface org.springframework.jdbc.core.JdbcOperations
Issue a single SQL update operation (such as an insert, update or delete statement) using a PreparedStatementCreator to provide SQL and any required parameters.
update(PreparedStatementCreator, KeyHolder) - Method in interface org.springframework.jdbc.core.JdbcOperations
Issue an update statement using a PreparedStatementCreator to provide SQL and any required parameters.
update(String, PreparedStatementSetter) - Method in interface org.springframework.jdbc.core.JdbcOperations
Issue an update statement using a PreparedStatementSetter to set bind parameters, with given SQL.
update(String, Object[], int[]) - Method in interface org.springframework.jdbc.core.JdbcOperations
Issue a single SQL update operation (such as an insert, update or delete statement) via a prepared statement, binding the given arguments.
update(String, Object...) - Method in interface org.springframework.jdbc.core.JdbcOperations
Issue a single SQL update operation (such as an insert, update or delete statement) via a prepared statement, binding the given arguments.
update(String) - Method in class org.springframework.jdbc.core.JdbcTemplate
update(PreparedStatementCreator, PreparedStatementSetter) - Method in class org.springframework.jdbc.core.JdbcTemplate
update(PreparedStatementCreator) - Method in class org.springframework.jdbc.core.JdbcTemplate
update(PreparedStatementCreator, KeyHolder) - Method in class org.springframework.jdbc.core.JdbcTemplate
update(String, PreparedStatementSetter) - Method in class org.springframework.jdbc.core.JdbcTemplate
update(String, Object[], int[]) - Method in class org.springframework.jdbc.core.JdbcTemplate
update(String, Object...) - Method in class org.springframework.jdbc.core.JdbcTemplate
update(String, SqlParameterSource) - Method in interface org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
Issue an update via a prepared statement, binding the given arguments.
update(String, Map<String, ?>) - Method in interface org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
Issue an update via a prepared statement, binding the given arguments.
update(String, SqlParameterSource, KeyHolder) - Method in interface org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
Issue an update via a prepared statement, binding the given arguments, returning generated keys.
update(String, SqlParameterSource, KeyHolder, String[]) - Method in interface org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations
Issue an update via a prepared statement, binding the given arguments, returning generated keys.
update(String, SqlParameterSource) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
update(String, Map<String, ?>) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
update(String, SqlParameterSource, KeyHolder) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
update(String, SqlParameterSource, KeyHolder, String[]) - Method in class org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
update(String, Map<String, ?>) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Execute the supplied SQL statement with (optional) supplied arguments.
update(String, SqlParameterSource) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Execute the supplied SQL statement with supplied arguments.
update(String, Object...) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcOperations
Execute the supplied SQL statement with supplied arguments.
update(String, Map<String, ?>) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
update(String, SqlParameterSource) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
update(String, Object...) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcTemplate
update(Object...) - Method in class org.springframework.jdbc.object.BatchSqlUpdate
Overridden version of update that adds the given statement parameters to the queue rather than executing them immediately.
update(Object...) - Method in class org.springframework.jdbc.object.SqlUpdate
Generic method to execute the update given parameters.
update(Object[], KeyHolder) - Method in class org.springframework.jdbc.object.SqlUpdate
Method to execute the update given arguments and retrieve the generated keys using a KeyHolder.
update() - Method in class org.springframework.jdbc.object.SqlUpdate
Convenience method to execute an update with no parameters.
update(int) - Method in class org.springframework.jdbc.object.SqlUpdate
Convenient method to execute an update given one int arg.
update(int, int) - Method in class org.springframework.jdbc.object.SqlUpdate
Convenient method to execute an update given two int args.
update(long) - Method in class org.springframework.jdbc.object.SqlUpdate
Convenient method to execute an update given one long arg.
update(long, long) - Method in class org.springframework.jdbc.object.SqlUpdate
Convenient method to execute an update given two long args.
update(String) - Method in class org.springframework.jdbc.object.SqlUpdate
Convenient method to execute an update given one String arg.
update(String, String) - Method in class org.springframework.jdbc.object.SqlUpdate
Convenient method to execute an update given two String args.
update(Object) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Update the given persistent instance, associating it with the current Hibernate Session.
update(Object, LockMode) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Update the given persistent instance, associating it with the current Hibernate Session.
update(String, Object) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Update the given persistent instance, associating it with the current Hibernate Session.
update(String, Object, LockMode) - Method in interface org.springframework.orm.hibernate3.HibernateOperations
Update the given persistent instance, associating it with the current Hibernate Session.
update(Object) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
update(Object, LockMode) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
update(String, Object) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
update(String, Object, LockMode) - Method in class org.springframework.orm.hibernate3.HibernateTemplate
update(String) - Method in interface org.springframework.orm.ibatis.SqlMapClientOperations
update(String, Object) - Method in interface org.springframework.orm.ibatis.SqlMapClientOperations
update(String, Object, int) - Method in interface org.springframework.orm.ibatis.SqlMapClientOperations
Convenience method provided by Spring: execute an update operation with an automatic check that the update affected the given required number of rows.
update(String) - Method in class org.springframework.orm.ibatis.SqlMapClientTemplate
update(String, Object) - Method in class org.springframework.orm.ibatis.SqlMapClientTemplate
update(String, Object, int) - Method in class org.springframework.orm.ibatis.SqlMapClientTemplate
update(Date, Date, Date) - Method in class org.springframework.scheduling.support.SimpleTriggerContext
Update this holder's state with the latest time values.
updateAccessedSessionAttributes() - Method in class org.springframework.web.context.request.AbstractRequestAttributes
Update all session attributes that have been accessed during request processing, to expose their potentially updated state to the underlying session manager.
updateAccessedSessionAttributes() - Method in class org.springframework.web.context.request.ServletRequestAttributes
Update all accessed session attributes through session.setAttribute calls, explicitly indicating to the container that they might have been modified.
updateAccessedSessionAttributes() - Method in class org.springframework.web.portlet.context.PortletRequestAttributes
Update all accessed session attributes through session.setAttribute calls, explicitly indicating to the container that they might have been modified.
updateAdvisorArray() - Method in class org.springframework.aop.framework.AdvisedSupport
Bring the array up to date with the list.
updateByNamedParam(Map<String, ?>) - Method in class org.springframework.jdbc.object.SqlUpdate
Generic method to execute the update given named parameters.
updateByNamedParam(Map<String, ?>, KeyHolder) - Method in class org.springframework.jdbc.object.SqlUpdate
Method to execute the update given arguments and retrieve the generated keys using a KeyHolder.
updateDatabaseSchema() - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Execute schema update script, determined by the Configuration object used for creating the SessionFactory.
updateModelAttributes(Object, Map<String, Object>, ExtendedModelMap, NativeWebRequest) - Method in class org.springframework.web.bind.annotation.support.HandlerMethodInvoker
updateRow(ResultSet, int, Map) - Method in class org.springframework.jdbc.object.UpdatableSqlQuery
Subclasses must implement this method to update each row of the ResultSet and optionally create object of the result type.
URI_TEMPLATE_VARIABLES_ATTRIBUTE - Static variable in interface org.springframework.web.servlet.HandlerMapping
Name of the HttpServletRequest attribute that contains the URI templates map, mapping variable names to values.
URIEditor - Class in org.springframework.beans.propertyeditors
Editor for java.net.URI, to directly populate a URI property instead of using a String property as bridge.
URIEditor() - Constructor for class org.springframework.beans.propertyeditors.URIEditor
Create a new, encoding URIEditor, converting "classpath:" locations into standard URIs (not trying to resolve them into physical resources).
URIEditor(boolean) - Constructor for class org.springframework.beans.propertyeditors.URIEditor
Create a new URIEditor, converting "classpath:" locations into standard URIs (not trying to resolve them into physical resources).
URIEditor(ClassLoader) - Constructor for class org.springframework.beans.propertyeditors.URIEditor
Create a new URIEditor, using the given ClassLoader to resolve "classpath:" locations into physical resource URLs.
URIEditor(ClassLoader, boolean) - Constructor for class org.springframework.beans.propertyeditors.URIEditor
Create a new URIEditor, using the given ClassLoader to resolve "classpath:" locations into physical resource URLs.
UriTemplate - Class in org.springframework.web.util
Represents a URI template.
UriTemplate(String) - Constructor for class org.springframework.web.util.UriTemplate
Construct a new UriTemplate with the given URI String.
UriUtils - Class in org.springframework.web.util
Utility class for URI encoding and decoding based on RFC 3986.
UriUtils() - Constructor for class org.springframework.web.util.UriUtils
URL_PROTOCOL_CODE_SOURCE - Static variable in class org.springframework.util.ResourceUtils
URL protocol for an entry from an OC4J jar file: "code-source"
URL_PROTOCOL_FILE - Static variable in class org.springframework.util.ResourceUtils
URL protocol for a file in the file system: "file"
URL_PROTOCOL_JAR - Static variable in class org.springframework.util.ResourceUtils
URL protocol for an entry from a jar file: "jar"
URL_PROTOCOL_VFS - Static variable in class org.springframework.util.ResourceUtils
URL protocol for a JBoss VFS resource: "vfs"
URL_PROTOCOL_VFSZIP - Static variable in class org.springframework.util.ResourceUtils
URL protocol for an entry from a JBoss jar file: "vfszip"
URL_PROTOCOL_WSJAR - Static variable in class org.springframework.util.ResourceUtils
URL protocol for an entry from a WebSphere jar file: "wsjar"
URL_PROTOCOL_ZIP - Static variable in class org.springframework.util.ResourceUtils
URL protocol for an entry from a zip file: "zip"
URL_TYPE_ACTION - Static variable in class org.springframework.mock.web.portlet.MockBaseURL
URL_TYPE_ACTION - Static variable in class org.springframework.mock.web.portlet.MockPortletURL
URL_TYPE_RENDER - Static variable in class org.springframework.mock.web.portlet.MockBaseURL
URL_TYPE_RENDER - Static variable in class org.springframework.mock.web.portlet.MockPortletURL
UrlBasedRemoteAccessor - Class in org.springframework.remoting.support
Abstract base class for classes that access remote services via URLs.
UrlBasedRemoteAccessor() - Constructor for class org.springframework.remoting.support.UrlBasedRemoteAccessor
UrlBasedViewResolver - Class in org.springframework.web.servlet.view
Simple implementation of the ViewResolver interface, allowing for direct resolution of symbolic view names to URLs, without explicit mapping definition.
UrlBasedViewResolver() - Constructor for class org.springframework.web.servlet.view.UrlBasedViewResolver
URLEditor - Class in org.springframework.beans.propertyeditors
Editor for java.net.URL, to directly populate a URL property instead of using a String property as bridge.
URLEditor() - Constructor for class org.springframework.beans.propertyeditors.URLEditor
Create a new URLEditor, using the default ResourceEditor underneath.
URLEditor(ResourceEditor) - Constructor for class org.springframework.beans.propertyeditors.URLEditor
Create a new URLEditor, using the given ResourceEditor underneath.
urlEncode(String, String) - Method in class org.springframework.web.servlet.view.RedirectView
URL-encode the given input String with the given encoding scheme.
UrlFilenameViewController - Class in org.springframework.web.servlet.mvc
Simple Controller implementation that transforms the virtual path of a URL into a view name and returns that view.
UrlFilenameViewController() - Constructor for class org.springframework.web.servlet.mvc.UrlFilenameViewController
UrlPathHelper - Class in org.springframework.web.util
Helper class for URL path matching.
UrlPathHelper() - Constructor for class org.springframework.web.util.UrlPathHelper
UrlResource - Class in org.springframework.core.io
Resource implementation for java.net.URL locators.
UrlResource(URL) - Constructor for class org.springframework.core.io.UrlResource
Create a new UrlResource.
UrlResource(URI) - Constructor for class org.springframework.core.io.UrlResource
Create a new UrlResource.
UrlResource(String) - Constructor for class org.springframework.core.io.UrlResource
Create a new UrlResource.
UrlTag - Class in org.springframework.web.servlet.tags
JSP tag for creating URLs.
UrlTag() - Constructor for class org.springframework.web.servlet.tags.UrlTag
useBeanFactory(String) - Method in interface org.springframework.beans.factory.access.BeanFactoryLocator
Use the BeanFactory (or derived interface such as ApplicationContext) specified by the factoryKey parameter.
useBeanFactory(String) - Method in class org.springframework.beans.factory.access.SingletonBeanFactoryLocator
useBeanFactory(String) - Method in class org.springframework.context.access.ContextJndiBeanFactoryLocator
Load/use a bean factory, as specified by a factory key which is a JNDI address, of the form java:comp/env/ejb/BeanFactoryPath.
useCachedContent() - Method in class org.springframework.mock.web.portlet.MockCacheControl
useConfigValueEditors() - Method in class org.springframework.beans.PropertyEditorRegistrySupport
Activate config value editors which are only intended for configuration purposes, such as StringArrayPropertyEditor.
useDirectFieldAccess() - Method in class org.springframework.web.portlet.mvc.BaseCommandController
Deprecated. Determine whether to use direct field access instead of bean property access.
useDirectFieldAccess() - Method in class org.springframework.web.servlet.mvc.BaseCommandController
Deprecated. Determine whether to use direct field access instead of bean property access.
useInclude(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.mvc.ServletForwardingController
Determine whether to use RequestDispatcher's include or forward method.
useInclude(HttpServletRequest, HttpServletResponse) - Method in class org.springframework.web.servlet.view.InternalResourceView
Determine whether to use RequestDispatcher's include or forward method.
useInParameterNames(String...) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcCall
useInParameterNames(String...) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcCallOperations
Not used yet
UserCredentialsConnectionFactoryAdapter - Class in org.springframework.jms.connection
An adapter for a target JMS ConnectionFactory, applying the given user credentials to every standard createConnection() call, that is, implicitly invoking createConnection(username, password) on the target.
UserCredentialsConnectionFactoryAdapter() - Constructor for class org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter
UserCredentialsDataSourceAdapter - Class in org.springframework.jdbc.datasource
An adapter for a target JDBC DataSource, applying the specified user credentials to every standard getConnection() call, implicitly invoking getConnection(username, password) on the target.
UserCredentialsDataSourceAdapter() - Constructor for class org.springframework.jdbc.datasource.UserCredentialsDataSourceAdapter
UserRoleAuthorizationInterceptor - Class in org.springframework.web.portlet.handler
Interceptor that checks the authorization of the current user via the user's roles, as evaluated by PortletRequest's isUserInRole method.
UserRoleAuthorizationInterceptor() - Constructor for class org.springframework.web.portlet.handler.UserRoleAuthorizationInterceptor
UserRoleAuthorizationInterceptor - Class in org.springframework.web.servlet.handler
Interceptor that checks the authorization of the current user via the user's roles, as evaluated by HttpServletRequest's isUserInRole method.
UserRoleAuthorizationInterceptor() - Constructor for class org.springframework.web.servlet.handler.UserRoleAuthorizationInterceptor
UserTransactionAdapter - Class in org.springframework.transaction.jta
Adapter for a JTA UserTransaction handle, taking a JTA TransactionManager reference and creating a JTA UserTransaction handle for it.
UserTransactionAdapter(TransactionManager) - Constructor for class org.springframework.transaction.jta.UserTransactionAdapter
Create a new UserTransactionAdapter for the given TransactionManager.
useSavepointForNestedTransaction() - Method in class org.springframework.transaction.jta.JtaTransactionManager
This implementation returns false to cause a further invocation of doBegin despite an already existing transaction.
useSavepointForNestedTransaction() - Method in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Return whether to use a savepoint for a nested transaction.
useWeakValue(K, V) - Method in class org.springframework.util.CachingMapDecorator
Decide whether to use a weak reference for the value of the given key-value pair.
useWriter() - Method in class org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsSingleFormatView
Return whether to use a java.io.Writer to write text content to the HTTP response.
useWriter() - Method in class org.springframework.web.servlet.view.jasperreports.ConfigurableJasperReportsView
Indicates how the JRExporter should render its data.
useWriter() - Method in class org.springframework.web.servlet.view.jasperreports.JasperReportsCsvView
useWriter() - Method in class org.springframework.web.servlet.view.jasperreports.JasperReportsHtmlView
useWriter() - Method in class org.springframework.web.servlet.view.jasperreports.JasperReportsPdfView
useWriter() - Method in class org.springframework.web.servlet.view.jasperreports.JasperReportsXlsView
useWriter() - Method in class org.springframework.web.servlet.view.xslt.AbstractXsltView
Deprecated. Return whether to use a java.io.Writer to write text content to the HTTP response.
usingColumns(String...) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcInsert
usingColumns(String...) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcInsertOperations
Specify the column names that the insert statement should be limited to use.
usingContext() - Method in class org.springframework.validation.beanvalidation.LocalValidatorFactoryBean
usingGeneratedKeyColumns(String...) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcInsert
usingGeneratedKeyColumns(String...) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcInsertOperations
Specify the name sof any columns that have auto generated keys.
UtilNamespaceHandler - Class in org.springframework.beans.factory.xml
NamespaceHandler for the util namespace.
UtilNamespaceHandler() - Constructor for class org.springframework.beans.factory.xml.UtilNamespaceHandler
UUIDEditor - Class in org.springframework.beans.propertyeditors
Editor for java.util.UUID, translating UUID String representations into UUID objects and back.
UUIDEditor() - Constructor for class org.springframework.beans.propertyeditors.UUIDEditor
Overview Package Class Tree Deprecated Index Help
A B C D E F G H I J K L M N O P Q R S T U V W X


V-Index

PREV LETTER NEXT LETTER FRAMES NO FRAMES
A B C D E F G H I J K L M N O P Q R S T U V W X

V

validate(Class<?>) - Method in class org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory
validate(Class<?>) - Method in interface org.springframework.aop.aspectj.annotation.AspectJAdvisorFactory
Is the given class a valid AspectJ aspect class?
validate() - Method in class org.springframework.beans.factory.support.AbstractBeanDefinition
Validate this bean definition.
validate() - Method in class org.springframework.beans.factory.support.ChildBeanDefinition
validate(XmlObject) - Method in class org.springframework.oxm.xmlbeans.XmlBeansMarshaller
Validate the given XmlObject.
validate(Object, Errors) - Method in class org.springframework.validation.beanvalidation.SpringValidatorAdapter
validate(T, Class<?>...) - Method in class org.springframework.validation.beanvalidation.SpringValidatorAdapter
validate() - Method in class org.springframework.validation.DataBinder
Invoke the specified Validator, if any.
validate(Object, Errors) - Method in interface org.springframework.validation.Validator
Validate the supplied target object, which must be of a Class for which the Validator.supports(Class) method typically has (or would) return true.
validate(PortletRequest) - Method in interface org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping.PortletRequestMappingPredicate
Validate this predicate's mapping against the current request.
validateAddress(InternetAddress) - Method in class org.springframework.mail.javamail.MimeMessageHelper
Validate the given mail address.
validateAddresses(InternetAddress[]) - Method in class org.springframework.mail.javamail.MimeMessageHelper
Validate all given mail addresses.
validateConfiguration() - Method in class org.springframework.jms.listener.AbstractJmsListeningContainer
Validate the configuration of this container.
validateConfiguration() - Method in class org.springframework.jms.listener.AbstractMessageListenerContainer
validateConfiguration() - Method in class org.springframework.jms.listener.DefaultMessageListenerContainer
validateConfiguration() - Method in class org.springframework.jms.listener.SimpleMessageListenerContainer
validateDatabaseSchema() - Method in class org.springframework.orm.hibernate3.LocalSessionFactoryBean
Execute schema creation script, determined by the Configuration object used for creating the SessionFactory.
validateDestination(Destination, String, boolean) - Method in class org.springframework.jms.support.destination.JndiDestinationResolver
Validate the given Destination object, checking whether it matches the expected type.
validateHandler(Object, PortletRequest) - Method in class org.springframework.web.portlet.mvc.annotation.DefaultAnnotationHandlerMapping
Validate the given annotated handler against the current request.
validateHandler(Object, HttpServletRequest) - Method in class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
Validate the given handler against the current request.
validateHandler(Object, HttpServletRequest) - Method in class org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping
Validate the given annotated handler against the current request.
validateInterfaces() - Method in class org.springframework.aop.aspectj.DeclareParentsAdvisor
validateInterfaces() - Method in interface org.springframework.aop.IntroductionAdvisor
Can the advised interfaces be implemented by the introduction advice? Invoked before adding an IntroductionAdvisor.
validateInterfaces() - Method in class org.springframework.aop.support.DefaultIntroductionAdvisor
validateMapping(RequestMapping, PortletRequest) - Method in class org.springframework.web.portlet.mvc.annotation.DefaultAnnotationHandlerMapping
Validate the given type-level mapping metadata against the current request, checking HTTP request method and parameter conditions.
validateMapping(RequestMapping, HttpServletRequest) - Method in class org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping
Validate the given type-level mapping metadata against the current request, checking HTTP request method and parameter conditions.
validateNamedParameters(Map<String, ?>) - Method in class org.springframework.jdbc.object.RdbmsOperation
Validate the named parameters passed to an execute method based on declared parameters.
validateObject(Object) - Method in class org.springframework.aop.target.CommonsPoolTargetSource
validatePage(Object, Errors, int, boolean) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Template method for custom validation logic for individual pages.
validatePage(Object, Errors, int) - Method in class org.springframework.web.portlet.mvc.AbstractWizardFormController
Deprecated. Template method for custom validation logic for individual pages.
validatePage(Object, Errors, int, boolean) - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Template method for custom validation logic for individual pages.
validatePage(Object, Errors, int) - Method in class org.springframework.web.servlet.mvc.AbstractWizardFormController
Deprecated. Template method for custom validation logic for individual pages.
validateParameters(Object[]) - Method in class org.springframework.jdbc.object.RdbmsOperation
Validate the parameters passed to an execute method based on declared parameters.
validateProperty(T, String, Class<?>...) - Method in class org.springframework.validation.beanvalidation.SpringValidatorAdapter
validateResponse(HttpInvokerClientConfiguration, PostMethod) - Method in class org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor
Validate the given response as contained in the PostMethod object, throwing an exception if it does not correspond to a successful HTTP response.
validateResponse(HttpInvokerClientConfiguration, HttpURLConnection) - Method in class org.springframework.remoting.httpinvoker.SimpleHttpInvokerRequestExecutor
Validate the given response as contained in the HttpURLConnection object, throwing an exception if it does not correspond to a successful HTTP response.
validateValue(Class<T>, String, Object, Class<?>...) - Method in class org.springframework.validation.beanvalidation.SpringValidatorAdapter
VALIDATION_AUTO - Static variable in class org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Indicates that the validation mode should be detected automatically.
VALIDATION_AUTO - Static variable in class org.springframework.util.xml.XmlValidationModeDetector
Indicates that the validation mode should be auto-guessed, since we cannot find a clear indication (probably choked on some special characters, or the like).
VALIDATION_DTD - Static variable in class org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Indicates that DTD validation should be used.
VALIDATION_DTD - Static variable in class org.springframework.util.xml.XmlValidationModeDetector
Indicates that DTD validation should be used (we found a "DOCTYPE" declaration).
VALIDATION_NONE - Static variable in class org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Indicates that the validation should be disabled.
VALIDATION_NONE - Static variable in class org.springframework.util.xml.XmlValidationModeDetector
Indicates that the validation should be disabled.
VALIDATION_XSD - Static variable in class org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Indicates that XSD validation should be used.
VALIDATION_XSD - Static variable in class org.springframework.util.xml.XmlValidationModeDetector
Indicates that XSD validation should be used (found no "DOCTYPE" declaration).
ValidationFailureException - Exception in org.springframework.oxm
Exception thrown on marshalling validation failure.
ValidationFailureException(String) - Constructor for exception org.springframework.oxm.ValidationFailureException
Construct a ValidationFailureException with the specified detail message.
ValidationFailureException(String, Throwable) - Constructor for exception org.springframework.oxm.ValidationFailureException
Construct a ValidationFailureException with the specified detail message and nested exception.
ValidationUtils - Class in org.springframework.validation
Utility class offering convenient methods for invoking a Validator and for rejecting empty fields.
ValidationUtils() - Constructor for class org.springframework.validation.ValidationUtils
Validator - Interface in org.springframework.validation
A validator for application-specific objects.
value() - Method in enum org.springframework.beans.factory.annotation.Autowire
Value - Annotation Type in org.springframework.beans.factory.annotation
Annotation at the field or method/constructor parameter level that indicates a default value expression for the affected argument.
value() - Method in enum org.springframework.http.HttpStatus.Series
Return the integer value of this status series.
value() - Method in enum org.springframework.http.HttpStatus
Return the integer value of this status code.
value() - Method in enum org.springframework.transaction.annotation.Isolation
value() - Method in enum org.springframework.transaction.annotation.Propagation
VALUE_0 - Static variable in class org.springframework.beans.propertyeditors.CustomBooleanEditor
VALUE_1 - Static variable in class org.springframework.beans.propertyeditors.CustomBooleanEditor
VALUE_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
VALUE_ELEMENT - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
VALUE_FALSE - Static variable in class org.springframework.beans.propertyeditors.CustomBooleanEditor
VALUE_KEY - Static variable in class org.springframework.beans.factory.support.AutowireCandidateQualifier
VALUE_NO - Static variable in class org.springframework.beans.propertyeditors.CustomBooleanEditor
VALUE_OFF - Static variable in class org.springframework.beans.propertyeditors.CustomBooleanEditor
VALUE_ON - Static variable in class org.springframework.beans.propertyeditors.CustomBooleanEditor
VALUE_REF_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
VALUE_SEPARATOR - Static variable in class org.springframework.util.SystemPropertyUtils
Value separator for system property placeholders: ":"
VALUE_TRUE - Static variable in class org.springframework.beans.propertyeditors.CustomBooleanEditor
VALUE_TYPE_ATTRIBUTE - Static variable in class org.springframework.beans.factory.xml.BeanDefinitionParserDelegate
VALUE_VARIABLE_NAME - Static variable in class org.springframework.web.servlet.tags.form.OptionTag
The name of the JSP variable used to expose the value for this tag.
VALUE_YES - Static variable in class org.springframework.beans.propertyeditors.CustomBooleanEditor
valueBound(HttpSessionBindingEvent) - Method in class org.springframework.web.context.request.DestructionCallbackBindingListener
ValueConstants - Interface in org.springframework.web.bind.annotation
Common value constants shared between bind annotations.
valueOf(String) - Static method in enum org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory.AspectJAnnotationType
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum org.springframework.beans.factory.annotation.Autowire
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum org.springframework.context.annotation.FilterType
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum org.springframework.context.annotation.ScopedProxyMode
Returns the enum constant of this type with the specified name.
valueOf(Class<?>) - Static method in class org.springframework.core.convert.TypeDescriptor
Create a new type descriptor for the given class.
valueOf(String) - Static method in enum org.springframework.expression.Operation
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum org.springframework.expression.spel.ast.TypeCode
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum org.springframework.expression.spel.SpelMessage.Kind
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum org.springframework.expression.spel.SpelMessage
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum org.springframework.expression.spel.support.ReflectionHelper.ArgsMatchKind
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum org.springframework.format.annotation.DateTimeFormat.ISO
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum org.springframework.format.annotation.NumberFormat.Style
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum org.springframework.http.HttpMethod
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum org.springframework.http.HttpStatus.Series
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum org.springframework.http.HttpStatus
Returns the enum constant of this type with the specified name.
valueOf(int) - Static method in enum org.springframework.http.HttpStatus
Return the enum constant of this type with the specified numeric value.
valueOf(String) - Static method in enum org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum org.springframework.jms.support.converter.MessageType
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum org.springframework.jmx.support.MetricType
Returns the enum constant of this type with the specified name.
valueOf(String) - Method in class org.springframework.orm.ibatis.support.BlobByteArrayTypeHandler
valueOf(String) - Method in class org.springframework.orm.ibatis.support.BlobSerializableTypeHandler
valueOf(String) - Method in class org.springframework.orm.ibatis.support.ClobStringTypeHandler
valueOf(String) - Static method in enum org.springframework.orm.jpa.vendor.Database
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum org.springframework.test.annotation.DirtiesContext.ClassMode
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum org.springframework.transaction.annotation.Isolation
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum org.springframework.transaction.annotation.Propagation
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum org.springframework.web.bind.annotation.RequestMethod
Returns the enum constant of this type with the specified name.
values() - Static method in enum org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory.AspectJAnnotationType
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum org.springframework.beans.factory.annotation.Autowire
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum org.springframework.context.annotation.FilterType
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum org.springframework.context.annotation.ScopedProxyMode
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum org.springframework.expression.Operation
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum org.springframework.expression.spel.ast.TypeCode
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum org.springframework.expression.spel.SpelMessage.Kind
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum org.springframework.expression.spel.SpelMessage
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum org.springframework.expression.spel.support.ReflectionHelper.ArgsMatchKind
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum org.springframework.format.annotation.DateTimeFormat.ISO
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum org.springframework.format.annotation.NumberFormat.Style
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Method in class org.springframework.http.HttpHeaders
values() - Static method in enum org.springframework.http.HttpMethod
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum org.springframework.http.HttpStatus.Series
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum org.springframework.http.HttpStatus
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum org.springframework.jms.support.converter.MessageType
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum org.springframework.jmx.support.MetricType
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum org.springframework.orm.jpa.vendor.Database
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum org.springframework.test.annotation.DirtiesContext.ClassMode
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum org.springframework.transaction.annotation.Isolation
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum org.springframework.transaction.annotation.Propagation
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Method in class org.springframework.util.CachingMapDecorator
values() - Method in class org.springframework.util.LinkedMultiValueMap
values() - Static method in enum org.springframework.web.bind.annotation.RequestMethod
Returns an array containing the constants of this enum type, in the order they are declared.
ValueStyler - Interface in org.springframework.core.style
Strategy that encapsulates value String styling algorithms according to Spring conventions.
valueUnbound(HttpSessionBindingEvent) - Method in class org.springframework.web.context.request.DestructionCallbackBindingListener
VariableReference - Class in org.springframework.expression.spel.ast
Represents a variable reference, eg.
VariableReference(String, int) - Constructor for class org.springframework.expression.spel.ast.VariableReference
VelocityConfig - Interface in org.springframework.web.servlet.view.velocity
Interface to be implemented by objects that configure and manage a VelocityEngine for automatic lookup in a web environment.
VelocityConfigurer - Class in org.springframework.web.servlet.view.velocity
JavaBean to configure Velocity for web usage, via the "configLocation" and/or "velocityProperties" and/or "resourceLoaderPath" bean properties.
VelocityConfigurer() - Constructor for class org.springframework.web.servlet.view.velocity.VelocityConfigurer
VelocityEngineFactory - Class in org.springframework.ui.velocity
Factory that configures a VelocityEngine.
VelocityEngineFactory() - Constructor for class org.springframework.ui.velocity.VelocityEngineFactory
VelocityEngineFactoryBean - Class in org.springframework.ui.velocity
Factory bean that configures a VelocityEngine and provides it as bean reference.
VelocityEngineFactoryBean() - Constructor for class org.springframework.ui.velocity.VelocityEngineFactoryBean
VelocityEngineUtils - Class in org.springframework.ui.velocity
Utility class for working with a VelocityEngine.
VelocityEngineUtils() - Constructor for class org.springframework.ui.velocity.VelocityEngineUtils
VelocityLayoutView - Class in org.springframework.web.servlet.view.velocity
VelocityLayoutView emulates the functionality offered by Velocity's VelocityLayoutServlet to ease page composition from different templates.
VelocityLayoutView() - Constructor for class org.springframework.web.servlet.view.velocity.VelocityLayoutView
VelocityLayoutViewResolver - Class in org.springframework.web.servlet.view.velocity
Convenience subclass of VelocityViewResolver, adding support for VelocityLayoutView and its properties.
VelocityLayoutViewResolver() - Constructor for class org.springframework.web.servlet.view.velocity.VelocityLayoutViewResolver
VelocityToolboxView - Class in org.springframework.web.servlet.view.velocity
VelocityView subclass which adds support for Velocity Tools toolboxes and Velocity Tools ViewTool callbacks / Velocity Tools 1.3 init methods.
VelocityToolboxView() - Constructor for class org.springframework.web.servlet.view.velocity.VelocityToolboxView
VelocityView - Class in org.springframework.web.servlet.view.velocity
View using the Velocity template engine.
VelocityView() - Constructor for class org.springframework.web.servlet.view.velocity.VelocityView
VelocityViewResolver - Class in org.springframework.web.servlet.view.velocity
Convenience subclass of UrlBasedViewResolver that supports VelocityView (i.e.
VelocityViewResolver() - Constructor for class org.springframework.web.servlet.view.velocity.VelocityViewResolver
VfsResource - Class in org.springframework.core.io
VFS based Resource implementation.
VfsResource(VirtualFile) - Constructor for class org.springframework.core.io.VfsResource
View - Interface in org.springframework.web.servlet
MVC View for a web interaction.
VIEW_ATTRIBUTE - Static variable in class org.springframework.web.servlet.ViewRendererServlet
Name of request attribute that holds the View object
VIEW_RESOLVER_BEAN_NAME - Static variable in class org.springframework.web.portlet.DispatcherPortlet
Well-known name for the ViewResolver object in the bean factory for this namespace.
VIEW_RESOLVER_BEAN_NAME - Static variable in class org.springframework.web.servlet.DispatcherServlet
Well-known name for the ViewResolver object in the bean factory for this namespace.
ViewRendererServlet - Class in org.springframework.web.servlet
ViewRendererServlet is a bridge servlet, mainly for the Portlet MVC support.
ViewRendererServlet() - Constructor for class org.springframework.web.servlet.ViewRendererServlet
ViewResolver - Interface in org.springframework.web.servlet
Interface to be implemented by objects that can resolve views by name.
visitBeanClassName(BeanDefinition) - Method in class org.springframework.beans.factory.config.BeanDefinitionVisitor
visitBeanDefinition(BeanDefinition) - Method in class org.springframework.beans.factory.config.BeanDefinitionVisitor
Traverse the given BeanDefinition object and the MutablePropertyValues and ConstructorArgumentValues contained in them.
visitFactoryBeanName(BeanDefinition) - Method in class org.springframework.beans.factory.config.BeanDefinitionVisitor
visitFactoryMethodName(BeanDefinition) - Method in class org.springframework.beans.factory.config.BeanDefinitionVisitor
visitGenericArgumentValues(List<ConstructorArgumentValues.ValueHolder>) - Method in class org.springframework.beans.factory.config.BeanDefinitionVisitor
visitIndexedArgumentValues(Map<Integer, ConstructorArgumentValues.ValueHolder>) - Method in class org.springframework.beans.factory.config.BeanDefinitionVisitor
visitList(List) - Method in class org.springframework.beans.factory.config.BeanDefinitionVisitor
visitMap(Map<?, ?>) - Method in class org.springframework.beans.factory.config.BeanDefinitionVisitor
visitParentName(BeanDefinition) - Method in class org.springframework.beans.factory.config.BeanDefinitionVisitor
visitPropertyValues(MutablePropertyValues) - Method in class org.springframework.beans.factory.config.BeanDefinitionVisitor
visitScope(BeanDefinition) - Method in class org.springframework.beans.factory.config.BeanDefinitionVisitor
visitSet(Set) - Method in class org.springframework.beans.factory.config.BeanDefinitionVisitor
Overview Package Class Tree Deprecated Index Help
A B C D E F G H I J K L M N O P Q R S T U V W X


W-Index

PREV LETTER NEXT LETTER FRAMES NO FRAMES
A B C D E F G H I J K L M N O P Q R S T U V W X

W

waitForAll(Collection, long) - Method in class org.springframework.scheduling.commonj.WorkManagerTaskExecutor
waitForAny(Collection, long) - Method in class org.springframework.scheduling.commonj.WorkManagerTaskExecutor
warning(Problem) - Method in class org.springframework.beans.factory.parsing.FailFastProblemReporter
Writes the supplied Problem to the Log at WARN level.
warning(Problem) - Method in interface org.springframework.beans.factory.parsing.ProblemReporter
Called when a warning is raised during the parsing process.
warning(String, Object) - Method in class org.springframework.beans.factory.parsing.ReaderContext
warning(String, Object, Throwable) - Method in class org.springframework.beans.factory.parsing.ReaderContext
warning(String, Object, ParseState) - Method in class org.springframework.beans.factory.parsing.ReaderContext
warning(String, Object, ParseState, Throwable) - Method in class org.springframework.beans.factory.parsing.ReaderContext
warning(SAXParseException) - Method in class org.springframework.util.xml.SimpleSaxErrorHandler
warning(TransformerException) - Method in class org.springframework.util.xml.SimpleTransformErrorListener
wasCleared() - Method in class org.springframework.web.portlet.ModelAndView
Return whether this ModelAndView object is empty as a result of a call to ModelAndView.clear() i.e.
wasCleared() - Method in class org.springframework.web.servlet.ModelAndView
Return whether this ModelAndView object is empty as a result of a call to ModelAndView.clear() i.e.
wasDataUpdated() - Method in exception org.springframework.dao.IncorrectUpdateSemanticsDataAccessException
Return whether data was updated.
wasDataUpdated() - Method in exception org.springframework.jdbc.JdbcUpdateAffectedIncorrectNumberOfRowsException
wasFailure() - Method in class org.springframework.web.context.support.RequestHandledEvent
Return whether the request failed.
wasNull() - Method in class org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
wasNull() - Method in interface org.springframework.jdbc.support.rowset.SqlRowSet
Reports whether the last column read had a value of SQL NULL.
WeakReferenceMonitor - Class in org.springframework.util
Track references to arbitrary objects using proxy and weak references.
WeakReferenceMonitor() - Constructor for class org.springframework.util.WeakReferenceMonitor
WeakReferenceMonitor.ReleaseListener - Interface in org.springframework.util
Listener that is notified when the handle is being released.
WeavingTransformer - Class in org.springframework.instrument.classloading
ClassFileTransformer-based weaver, allowing for a list of transformers to be applied on a class byte array.
WeavingTransformer(ClassLoader) - Constructor for class org.springframework.instrument.classloading.WeavingTransformer
Create a new WeavingTransformer for the given class loader.
WEB_APP_ROOT_KEY_PARAM - Static variable in class org.springframework.web.util.WebUtils
Web app root key parameter at the servlet context level (i.e.
WEB_APPLICATION_CONTEXT_ATTRIBUTE - Static variable in class org.springframework.web.servlet.DispatcherServlet
Request attribute to hold the current web application context.
WEB_APPLICATION_CONTEXT_ATTRIBUTE - Static variable in class org.springframework.web.servlet.support.RequestContext
Request attribute to hold the current web application context for RequestContext usage.
WEB_APPLICATION_CONTEXT_ATTRIBUTE - Static variable in class org.springframework.web.servlet.ViewRendererServlet
Request attribute to hold current web application context.
WEB_APPLICATION_CONTEXT_VARIABLE_NAME - Static variable in class org.springframework.web.jsf.el.WebApplicationContextFacesELResolver
Name of the exposed WebApplicationContext variable: "webApplicationContext".
WEB_APPLICATION_CONTEXT_VARIABLE_NAME - Static variable in class org.springframework.web.jsf.WebApplicationContextVariableResolver
Name of the exposed WebApplicationContext variable: "webApplicationContext".
WebApplicationContext - Interface in org.springframework.web.context
Interface to provide configuration for a web application.
WebApplicationContextFacesELResolver - Class in org.springframework.web.jsf.el
Special JSF 1.2 ELResolver that exposes the Spring WebApplicationContext instance under a variable named "webApplicationContext".
WebApplicationContextFacesELResolver() - Constructor for class org.springframework.web.jsf.el.WebApplicationContextFacesELResolver
WebApplicationContextUtils - Class in org.springframework.web.context.support
Convenience methods for retrieving the root WebApplicationContext for a given ServletContext.
WebApplicationContextUtils() - Constructor for class org.springframework.web.context.support.WebApplicationContextUtils
WebApplicationContextVariableResolver - Class in org.springframework.web.jsf
Special JSF 1.1 VariableResolver that exposes the Spring WebApplicationContext instance under a variable named "webApplicationContext".
WebApplicationContextVariableResolver(VariableResolver) - Constructor for class org.springframework.web.jsf.WebApplicationContextVariableResolver
Create a new WebApplicationContextVariableResolver, using the given original VariableResolver.
WebApplicationObjectSupport - Class in org.springframework.web.context.support
Convenient superclass for application objects running in a WebApplicationContext.
WebApplicationObjectSupport() - Constructor for class org.springframework.web.context.support.WebApplicationObjectSupport
WebAppRootListener - Class in org.springframework.web.util
Listener that sets a system property to the web application root directory.
WebAppRootListener() - Constructor for class org.springframework.web.util.WebAppRootListener
WebArgumentResolver - Interface in org.springframework.web.bind.support
SPI for resolving custom arguments for a specific handler method parameter.
WebBindingInitializer - Interface in org.springframework.web.bind.support
Callback interface for initializing a WebDataBinder for performing data binding in the context of a specific web request.
WebContentGenerator - Class in org.springframework.web.servlet.support
Convenient superclass for any kind of web content generator, like AbstractController and WebContentInterceptor.
WebContentGenerator() - Constructor for class org.springframework.web.servlet.support.WebContentGenerator
Create a new WebContentGenerator which supports HTTP methods GET, HEAD and POST by default.
WebContentGenerator(boolean) - Constructor for class org.springframework.web.servlet.support.WebContentGenerator
Create a new WebContentGenerator.
WebContentInterceptor - Class in org.springframework.web.servlet.mvc
Interceptor that checks and prepares request and response.
WebContentInterceptor() - Constructor for class org.springframework.web.servlet.mvc.WebContentInterceptor
WebDataBinder - Class in org.springframework.web.bind
Special DataBinder for data binding from web request parameters to JavaBean objects.
WebDataBinder(Object) - Constructor for class org.springframework.web.bind.WebDataBinder
Create a new WebDataBinder instance, with default object name.
WebDataBinder(Object, String) - Constructor for class org.springframework.web.bind.WebDataBinder
Create a new WebDataBinder instance.
WebLogicJtaTransactionManager - Class in org.springframework.transaction.jta
Special JtaTransactionManager variant for BEA WebLogic (9.0 and higher).
WebLogicJtaTransactionManager() - Constructor for class org.springframework.transaction.jta.WebLogicJtaTransactionManager
WebLogicLoadTimeWeaver - Class in org.springframework.instrument.classloading.weblogic
LoadTimeWeaver implementation for WebLogic's instrumentable ClassLoader.
WebLogicLoadTimeWeaver() - Constructor for class org.springframework.instrument.classloading.weblogic.WebLogicLoadTimeWeaver
Creates a new instance of the WebLogicLoadTimeWeaver class using the default class loader.
WebLogicLoadTimeWeaver(ClassLoader) - Constructor for class org.springframework.instrument.classloading.weblogic.WebLogicLoadTimeWeaver
Creates a new instance of the WebLogicLoadTimeWeaver class using the supplied ClassLoader.
WebLogicNativeJdbcExtractor - Class in org.springframework.jdbc.support.nativejdbc
Implementation of the NativeJdbcExtractor interface for WebLogic, supporting WebLogic Server 8.1 and higher.
WebLogicNativeJdbcExtractor() - Constructor for class org.springframework.jdbc.support.nativejdbc.WebLogicNativeJdbcExtractor
This constructor retrieves the WebLogic JDBC extension interface, so we can get the underlying vendor connection using reflection.
WebRequest - Interface in org.springframework.web.context.request
Generic interface for a web request.
WebRequestDataBinder - Class in org.springframework.web.bind.support
Special DataBinder to perform data binding from web request parameters to JavaBeans, including support for multipart files.
WebRequestDataBinder(Object) - Constructor for class org.springframework.web.bind.support.WebRequestDataBinder
Create a new WebRequestDataBinder instance, with default object name.
WebRequestDataBinder(Object, String) - Constructor for class org.springframework.web.bind.support.WebRequestDataBinder
Create a new WebRequestDataBinder instance.
WebRequestHandlerInterceptorAdapter - Class in org.springframework.web.portlet.handler
Adapter that implements the Portlet HandlerInterceptor interface and wraps an underlying WebRequestInterceptor.
WebRequestHandlerInterceptorAdapter(WebRequestInterceptor) - Constructor for class org.springframework.web.portlet.handler.WebRequestHandlerInterceptorAdapter
Create a new WebRequestHandlerInterceptorAdapter for the given WebRequestInterceptor, applying to the render phase only.
WebRequestHandlerInterceptorAdapter(WebRequestInterceptor, boolean) - Constructor for class org.springframework.web.portlet.handler.WebRequestHandlerInterceptorAdapter
Create a new WebRequestHandlerInterceptorAdapter for the given WebRequestInterceptor.
WebRequestHandlerInterceptorAdapter - Class in org.springframework.web.servlet.handler
Adapter that implements the Servlet HandlerInterceptor interface and wraps an underlying WebRequestInterceptor.
WebRequestHandlerInterceptorAdapter(WebRequestInterceptor) - Constructor for class org.springframework.web.servlet.handler.WebRequestHandlerInterceptorAdapter
Create a new WebRequestHandlerInterceptorAdapter for the given WebRequestInterceptor.
WebRequestInterceptor - Interface in org.springframework.web.context.request
Interface for general web request interception.
WebSphereDataSourceAdapter - Class in org.springframework.jdbc.datasource
DataSource implementation that delegates all calls to a WebSphere target DataSource, typically obtained from JNDI, applying a current isolation level and/or current user credentials to every Connection obtained from it.
WebSphereDataSourceAdapter() - Constructor for class org.springframework.jdbc.datasource.WebSphereDataSourceAdapter
This constructor retrieves the WebSphere JDBC connection spec API, so we can get obtain specific WebSphere Connections using reflection.
WebSphereMBeanServerFactoryBean - Class in org.springframework.jmx.support
FactoryBean that obtains a WebSphere MBeanServer reference through WebSphere's proprietary AdminServiceFactory API, available on WebSphere 5.1 and higher.
WebSphereMBeanServerFactoryBean() - Constructor for class org.springframework.jmx.support.WebSphereMBeanServerFactoryBean
WebSphereNativeJdbcExtractor - Class in org.springframework.jdbc.support.nativejdbc
Implementation of the NativeJdbcExtractor interface for WebSphere, supporting WebSphere Application Server 5.1 and higher.
WebSphereNativeJdbcExtractor() - Constructor for class org.springframework.jdbc.support.nativejdbc.WebSphereNativeJdbcExtractor
This constructor retrieves WebSphere JDBC adapter classes, so we can get the underlying vendor connection using reflection.
WebSphereUowTransactionManager - Class in org.springframework.transaction.jta
WebSphere-specific PlatformTransactionManager implementation that delegates to a UOWManager instance, obtained from WebSphere's JNDI environment.
WebSphereUowTransactionManager() - Constructor for class org.springframework.transaction.jta.WebSphereUowTransactionManager
Create a new WebSphereUowTransactionManager.
WebSphereUowTransactionManager(UOWManager) - Constructor for class org.springframework.transaction.jta.WebSphereUowTransactionManager
Create a new WebSphereUowTransactionManager for the given UOWManager.
WebUtils - Class in org.springframework.web.util
Miscellaneous utilities for web applications.
WebUtils() - Constructor for class org.springframework.web.util.WebUtils
withAfterClasses(Statement) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
Wraps the Statement returned by the parent implementation with a RunAfterTestClassCallbacks statement, thus preserving the default functionality but adding support for the Spring TestContext Framework.
withAfters(FrameworkMethod, Object, Statement) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
Wraps the Statement returned by the parent implementation with a RunAfterTestMethodCallbacks statement, thus preserving the default functionality but adding support for the Spring TestContext Framework.
withBeforeClasses(Statement) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
Wraps the Statement returned by the parent implementation with a RunBeforeTestClassCallbacks statement, thus preserving the default functionality but adding support for the Spring TestContext Framework.
withBefores(FrameworkMethod, Object, Statement) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
Wraps the Statement returned by the parent implementation with a RunBeforeTestMethodCallbacks statement, thus preserving the default functionality but adding support for the Spring TestContext Framework.
withCatalogName(String) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcCall
withCatalogName(String) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcCallOperations
Optionally, specify the name of the catalog that contins the stored procedure.
withCatalogName(String) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcInsert
withCatalogName(String) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcInsertOperations
Specify the catalog name, if any, to be used for the insert.
withFunctionName(String) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcCall
withFunctionName(String) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcCallOperations
Specify the procedure name to be used - this implies that we will be calling a stored function.
withoutProcedureColumnMetaDataAccess() - Method in class org.springframework.jdbc.core.simple.SimpleJdbcCall
withoutProcedureColumnMetaDataAccess() - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcCallOperations
Turn off any processing of parameter meta data information obtained via JDBC.
withoutTableColumnMetaDataAccess() - Method in class org.springframework.jdbc.core.simple.SimpleJdbcInsert
withoutTableColumnMetaDataAccess() - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcInsertOperations
Turn off any processing of column meta data information obtained via JDBC.
withPotentialRepeat(FrameworkMethod, Object, Statement) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
Supports Spring's @Repeat annotation by returning a SpringRepeat statement initialized with the configured repeat count or 1 if no repeat count is configured.
withPotentialTimeout(FrameworkMethod, Object, Statement) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
Supports both Spring's @Timed and JUnit's @Test(timeout=...) annotations, but not both simultaneously.
withProcedureName(String) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcCall
withProcedureName(String) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcCallOperations
Specify the procedure name to be used - this implies that we will be calling a stored procedure.
withReturnValue() - Method in class org.springframework.jdbc.core.simple.SimpleJdbcCall
withReturnValue() - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcCallOperations
Indicates the procedure's return value should be included in the results returned.
withSchemaName(String) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcCall
withSchemaName(String) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcCallOperations
Optionally, specify the name of the schema that contins the stored procedure.
withSchemaName(String) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcInsert
withSchemaName(String) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcInsertOperations
Specify the shema name, if any, to be used for the insert.
withTableName(String) - Method in class org.springframework.jdbc.core.simple.SimpleJdbcInsert
withTableName(String) - Method in interface org.springframework.jdbc.core.simple.SimpleJdbcInsertOperations
Specify the table name to be used for the insert.
WorkManagerTaskExecutor - Class in org.springframework.jca.work
TaskExecutor implementation that delegates to a JCA 1.5 WorkManager, implementing the WorkManager interface.
WorkManagerTaskExecutor() - Constructor for class org.springframework.jca.work.WorkManagerTaskExecutor
Create a new WorkManagerTaskExecutor, expecting bean-style configuration.
WorkManagerTaskExecutor(WorkManager) - Constructor for class org.springframework.jca.work.WorkManagerTaskExecutor
Create a new WorkManagerTaskExecutor for the given WorkManager.
WorkManagerTaskExecutor - Class in org.springframework.scheduling.commonj
TaskExecutor implementation that delegates to a CommonJ WorkManager, implementing the WorkManager interface, which either needs to be specified as reference or through the JNDI name.
WorkManagerTaskExecutor() - Constructor for class org.springframework.scheduling.commonj.WorkManagerTaskExecutor
wrap(Object) - Method in interface org.springframework.aop.framework.adapter.AdvisorAdapterRegistry
Return an Advisor wrapping the given advice.
wrap(Object) - Method in class org.springframework.aop.framework.adapter.DefaultAdvisorAdapterRegistry
wrapIfNecessary(Object, String, Object) - Method in class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
Wrap the given bean if necessary, i.e.
wrapSessionFactoryIfNecessary(SessionFactory) - Method in class org.springframework.orm.hibernate3.AbstractSessionFactoryBean
Wrap the given SessionFactory with a proxy, if demanded.
write(EvaluationContext, Object, String, Object) - Method in class org.springframework.context.expression.BeanExpressionContextAccessor
write(EvaluationContext, Object, String, Object) - Method in class org.springframework.context.expression.BeanFactoryAccessor
write(EvaluationContext, Object, String, Object) - Method in class org.springframework.context.expression.MapAccessor
write(EvaluationContext, Object, String, Object) - Method in interface org.springframework.expression.PropertyAccessor
Called to write to a property on a specified target object.
write(EvaluationContext, Object, String, Object) - Method in class org.springframework.expression.spel.support.ReflectivePropertyAccessor
write(T, MediaType, HttpOutputMessage) - Method in class org.springframework.http.converter.AbstractHttpMessageConverter
Write an given object to the given output message.
write(BufferedImage, MediaType, HttpOutputMessage) - Method in class org.springframework.http.converter.BufferedImageHttpMessageConverter
write(MultiValueMap<String, ?>, MediaType, HttpOutputMessage) - Method in class org.springframework.http.converter.FormHttpMessageConverter
write(T, MediaType, HttpOutputMessage) - Method in interface org.springframework.http.converter.HttpMessageConverter
Write an given object to the given output message.
write(Resource, MediaType, HttpOutputMessage) - Method in class org.springframework.http.converter.ResourceHttpMessageConverter
write(OutputStream) - Method in class org.springframework.jca.cci.core.support.CommAreaRecord
write(int) - Method in class org.springframework.mock.web.DelegatingServletOutputStream
write(char[], int, int) - Method in class org.springframework.mock.web.MockBodyContent
write(char[], int, int) - Method in class org.springframework.mock.web.MockJspWriter
write(Writer) - Method in class org.springframework.mock.web.portlet.MockBaseURL
write(Writer, boolean) - Method in class org.springframework.mock.web.portlet.MockBaseURL
write(char) - Method in class org.springframework.util.CommonsLogWriter
write(char[], int, int) - Method in class org.springframework.util.CommonsLogWriter
writeAttribute(String, String) - Method in class org.springframework.web.servlet.tags.form.TagWriter
Write an HTML attribute with the specified name and value.
writeBodyContent(String) - Method in class org.springframework.web.servlet.tags.EscapeBodyTag
Write the escaped body content to the page.
writeDefaultAttributes(TagWriter) - Method in class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
Writes the default set of attributes to the supplied TagWriter.
writeDefaultAttributes(TagWriter) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Writes the default attributes configured via this base class to the supplied TagWriter.
writeInternal(T, HttpOutputMessage) - Method in class org.springframework.http.converter.AbstractHttpMessageConverter
Abstract template method that writes the actual body.
writeInternal(byte[], HttpOutputMessage) - Method in class org.springframework.http.converter.ByteArrayHttpMessageConverter
writeInternal(T, HttpOutputMessage) - Method in class org.springframework.http.converter.feed.AbstractWireFeedHttpMessageConverter
writeInternal(Object, HttpOutputMessage) - Method in class org.springframework.http.converter.json.MappingJacksonHttpMessageConverter
writeInternal(String, HttpOutputMessage) - Method in class org.springframework.http.converter.StringHttpMessageConverter
writeInternal(T, HttpOutputMessage) - Method in class org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter
writeMessage(String) - Method in class org.springframework.web.servlet.tags.MessageTag
Write the message to the page.
writeOptionalAttribute(TagWriter, String, String) - Method in class org.springframework.web.servlet.tags.form.AbstractFormTag
Optionally writes the supplied value under the supplied attribute name into the supplied TagWriter.
writeOptionalAttributes(TagWriter) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
Writes the optional attributes configured via this base class to the supplied TagWriter.
writeOptionalAttributes(TagWriter) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag
Adds input-specific optional attributes as defined by this base class.
writeOptionalAttributeValue(String, String) - Method in class org.springframework.web.servlet.tags.form.TagWriter
Write an HTML attribute if the supplied value is not null or zero length.
writeOut(Writer) - Method in class org.springframework.mock.web.MockBodyContent
writerCache - Variable in class org.springframework.expression.spel.support.ReflectivePropertyAccessor
writeRemoteInvocation(RemoteInvocation, OutputStream) - Method in class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
Serialize the given RemoteInvocation to the given OutputStream.
writeRemoteInvocationResult(Message, Session, RemoteInvocationResult) - Method in class org.springframework.jms.remoting.JmsInvokerServiceExporter
Send the given RemoteInvocationResult as a JMS message to the originator.
writeRemoteInvocationResult(HttpServletRequest, HttpServletResponse, RemoteInvocationResult) - Method in class org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter
Write the given RemoteInvocationResult to the given HTTP response.
writeRemoteInvocationResult(HttpServletRequest, HttpServletResponse, RemoteInvocationResult, OutputStream) - Method in class org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter
Serialize the given RemoteInvocation to the given OutputStream.
writeRemoteInvocationResult(HttpExchange, RemoteInvocationResult) - Method in class org.springframework.remoting.httpinvoker.SimpleHttpInvokerServiceExporter
Write the given RemoteInvocationResult to the given HTTP response.
writeRemoteInvocationResult(HttpExchange, RemoteInvocationResult, OutputStream) - Method in class org.springframework.remoting.httpinvoker.SimpleHttpInvokerServiceExporter
Serialize the given RemoteInvocation to the given OutputStream.
writeReplace() - Method in class org.springframework.aop.target.AbstractPrototypeBasedTargetSource
Replaces this object with a SingletonTargetSource on serialization.
writeReplace() - Method in class org.springframework.beans.factory.support.DefaultListableBeanFactory
writeReplace() - Method in class org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
writeRequestBody(HttpInvokerClientConfiguration, HttpURLConnection, ByteArrayOutputStream) - Method in class org.springframework.remoting.httpinvoker.SimpleHttpInvokerRequestExecutor
Set the given serialized remote invocation as request body.
writeTagContent(TagWriter) - Method in class org.springframework.web.servlet.tags.form.AbstractCheckedElementTag
Writes the 'input' element to the supplied TagWriter, marking it as 'checked' if appropriate.
writeTagContent(TagWriter) - Method in class org.springframework.web.servlet.tags.form.AbstractFormTag
Subclasses should implement this method to perform tag content rendering.
writeTagContent(TagWriter) - Method in class org.springframework.web.servlet.tags.form.AbstractHtmlElementBodyTag
writeTagContent(TagWriter) - Method in class org.springframework.web.servlet.tags.form.AbstractMultiCheckedElementTag
Renders the 'input type="radio"' element with the configured AbstractMultiCheckedElementTag.setItems(Object) values.
writeTagContent(TagWriter) - Method in class org.springframework.web.servlet.tags.form.AbstractSingleCheckedElementTag
Renders the 'input(radio)' element with the configured value.
writeTagContent(TagWriter) - Method in class org.springframework.web.servlet.tags.form.CheckboxesTag
writeTagContent(TagWriter) - Method in class org.springframework.web.servlet.tags.form.CheckboxTag
writeTagContent(TagWriter) - Method in class org.springframework.web.servlet.tags.form.FormTag
Writes the opening part of the block 'form' tag and exposes the form object name in the PageContext.
writeTagContent(TagWriter) - Method in class org.springframework.web.servlet.tags.form.HiddenInputTag
Writes the HTML 'input' tag to the supplied TagWriter including the databound value.
writeTagContent(TagWriter) - Method in class org.springframework.web.servlet.tags.form.InputTag
Writes the 'input' tag to the supplied TagWriter.
writeTagContent(TagWriter) - Method in class org.springframework.web.servlet.tags.form.LabelTag
Writes the opening 'label' tag and forces a block tag so that body content is written correctly.
writeTagContent(TagWriter) - Method in class org.springframework.web.servlet.tags.form.OptionsTag
writeTagContent(TagWriter) - Method in class org.springframework.web.servlet.tags.form.SelectTag
Renders the HTML 'select' tag to the supplied TagWriter.
writeTagContent(TagWriter) - Method in class org.springframework.web.servlet.tags.form.TextareaTag
writeTagDetails(TagWriter) - Method in class org.springframework.web.servlet.tags.form.AbstractSingleCheckedElementTag
Write the details for the given primary tag: i.e.
writeTagDetails(TagWriter) - Method in class org.springframework.web.servlet.tags.form.CheckboxTag
writeTagDetails(TagWriter) - Method in class org.springframework.web.servlet.tags.form.RadioButtonTag
writeToLog(Log, String) - Method in class org.springframework.aop.interceptor.CustomizableTraceInterceptor
Writes the supplied message to the supplied Log instance.
writeToLog(Log, String, Throwable) - Method in class org.springframework.aop.interceptor.CustomizableTraceInterceptor
Writes the supplied message and Throwable to the supplied Log instance.
writeToResponse(HttpServletResponse, ByteArrayOutputStream) - Method in class org.springframework.web.servlet.view.AbstractView
Write the given temporary OutputStream to the HTTP response.
writeToResult(T, HttpHeaders, Result) - Method in class org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter
Abstract template method called from AbstractXmlHttpMessageConverter.writeInternal(Object, HttpOutputMessage).
writeToResult(Object, HttpHeaders, Result) - Method in class org.springframework.http.converter.xml.Jaxb2RootElementHttpMessageConverter
writeToResult(Object, HttpHeaders, Result) - Method in class org.springframework.http.converter.xml.MarshallingHttpMessageConverter
writeToResult(T, HttpHeaders, Result) - Method in class org.springframework.http.converter.xml.SourceHttpMessageConverter
writeValue(TagWriter) - Method in class org.springframework.web.servlet.tags.form.InputTag
Writes the 'value' attribute to the supplied TagWriter.
writeValue(TagWriter) - Method in class org.springframework.web.servlet.tags.form.PasswordInputTag
The PasswordInputTag only writes it's value if the 'showPassword' property value is true.
Overview Package Class Tree Deprecated Index Help
A B C D E F G H I J K L M N O P Q R S T U V W X


X-Index

PREV LETTER NEXT LETTER FRAMES NO FRAMES
A B C D E F G H I J K L M N O P Q R S T U V W X

X

XML_CONTENT_TYPE - Static variable in class org.springframework.web.servlet.view.xslt.AbstractXsltView
Deprecated. The default content type if no stylesheet specified
XML_FILE_EXTENSION - Static variable in class org.springframework.core.io.support.PropertiesLoaderSupport
XML_FILE_EXTENSION - Static variable in class org.springframework.util.Log4jConfigurer
Extension that indicates a log4j XML config file: ".xml"
XmlBeanDefinitionReader - Class in org.springframework.beans.factory.xml
Bean definition reader for XML bean definitions.
XmlBeanDefinitionReader(BeanDefinitionRegistry) - Constructor for class org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Create new XmlBeanDefinitionReader for the given bean factory.
XmlBeanDefinitionStoreException - Exception in org.springframework.beans.factory.xml
XML-specific BeanDefinitionStoreException subclass that wraps a SAXException, typically a SAXParseException which contains information about the error location.
XmlBeanDefinitionStoreException(String, String, SAXException) - Constructor for exception org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException
Create a new XmlBeanDefinitionStoreException.
XmlBeanFactory - Class in org.springframework.beans.factory.xml
Convenience extension of DefaultListableBeanFactory that reads bean definitions from an XML document.
XmlBeanFactory(Resource) - Constructor for class org.springframework.beans.factory.xml.XmlBeanFactory
Create a new XmlBeanFactory with the given resource, which must be parsable using DOM.
XmlBeanFactory(Resource, BeanFactory) - Constructor for class org.springframework.beans.factory.xml.XmlBeanFactory
Create a new XmlBeanFactory with the given input stream, which must be parsable using DOM.
XmlBeansMarshaller - Class in org.springframework.oxm.xmlbeans
Implementation of the Marshaller interface for Apache XMLBeans.
XmlBeansMarshaller() - Constructor for class org.springframework.oxm.xmlbeans.XmlBeansMarshaller
XmlBinaryStreamProvider - Interface in org.springframework.jdbc.support.xml
Interface defining handling involved with providing OutputStream data for XML input.
XmlCharacterStreamProvider - Interface in org.springframework.jdbc.support.xml
Interface defining handling involved with providing Writer data for XML input.
XmlMappingException - Exception in org.springframework.oxm
Root of the hierarchy of Object XML Mapping exceptions.
XmlMappingException(String) - Constructor for exception org.springframework.oxm.XmlMappingException
Construct an XmlMappingException with the specified detail message.
XmlMappingException(String, Throwable) - Constructor for exception org.springframework.oxm.XmlMappingException
Construct an XmlMappingException with the specified detail message and nested exception.
XmlOptionsFactoryBean - Class in org.springframework.oxm.xmlbeans
FactoryBean that configures an XMLBeans XmlOptions object and provides it as a bean reference.
XmlOptionsFactoryBean() - Constructor for class org.springframework.oxm.xmlbeans.XmlOptionsFactoryBean
XmlPortletApplicationContext - Class in org.springframework.web.portlet.context
Portlet-based WebApplicationContext implementation which takes its configuration from XML documents, understood by an XmlBeanDefinitionReader.
XmlPortletApplicationContext() - Constructor for class org.springframework.web.portlet.context.XmlPortletApplicationContext
XmlReaderContext - Class in org.springframework.beans.factory.xml
Extension of ReaderContext, specific to use with an XmlBeanDefinitionReader.
XmlReaderContext(Resource, ProblemReporter, ReaderEventListener, SourceExtractor, XmlBeanDefinitionReader, NamespaceHandlerResolver) - Constructor for class org.springframework.beans.factory.xml.XmlReaderContext
XmlResultProvider - Interface in org.springframework.jdbc.support.xml
Interface defining handling involved with providing Result data for XML input.
XmlValidationModeDetector - Class in org.springframework.util.xml
Detects whether an XML stream is using DTD- or XSD-based validation.
XmlValidationModeDetector() - Constructor for class org.springframework.util.xml.XmlValidationModeDetector
XmlViewResolver - Class in org.springframework.web.servlet.view
Implementation of ViewResolver that uses bean definitions in an XML file, specified by resource location.
XmlViewResolver() - Constructor for class org.springframework.web.servlet.view.XmlViewResolver
XmlWebApplicationContext - Class in org.springframework.web.context.support
WebApplicationContext implementation which takes its configuration from XML documents, understood by an XmlBeanDefinitionReader.
XmlWebApplicationContext() - Constructor for class org.springframework.web.context.support.XmlWebApplicationContext
XSD_SUFFIX - Static variable in class org.springframework.beans.factory.xml.DelegatingEntityResolver
Suffix for schema definition files
XsltView - Class in org.springframework.web.servlet.view.xslt
XSLT-driven View that allows for response context to be rendered as the result of an XSLT transformation.
XsltView() - Constructor for class org.springframework.web.servlet.view.xslt.XsltView
XsltViewResolver - Class in org.springframework.web.servlet.view.xslt
ViewResolver implementation that resolves instances of XsltView by translating the supplied view name into the URL of the XSLT stylesheet.
XsltViewResolver() - Constructor for class org.springframework.web.servlet.view.xslt.XsltViewResolver
XStreamMarshaller - Class in org.springframework.oxm.xstream
Implementation of the Marshaller interface for XStream.
XStreamMarshaller() - Constructor for class org.springframework.oxm.xstream.XStreamMarshaller
Overview Package Class Tree Deprecated Index Help
PREV LETTER NEXT LETTER FRAMES NO FRAMES
A B C D E F G H I J K L M N O P Q R S T U V W X


 org.springframework.aop
Interfaces
Advisor
AfterAdvice
AfterReturningAdvice
BeforeAdvice
ClassFilter
DynamicIntroductionAdvice
IntroductionAdvisor
IntroductionAwareMethodMatcher
IntroductionInfo
IntroductionInterceptor
MethodBeforeAdvice
MethodMatcher
Pointcut
PointcutAdvisor
ProxyMethodInvocation
RawTargetAccess
SpringProxy
TargetClassAware
TargetSource
ThrowsAdvice
Exceptions
AopInvocationException


 org.springframework.aop.aspectj
Interfaces
AspectInstanceFactory
AspectJPrecedenceInformation
InstantiationModelAwarePointcutAdvisor
Classes
AbstractAspectJAdvice
AspectJAdviceParameterNameDiscoverer
AspectJAfterAdvice
AspectJAfterReturningAdvice
AspectJAfterThrowingAdvice
AspectJAopUtils
AspectJAroundAdvice
AspectJExpressionPointcut
AspectJExpressionPointcutAdvisor
AspectJMethodBeforeAdvice
AspectJPointcutAdvisor
AspectJProxyUtils
AspectJWeaverMessageHandler
DeclareParentsAdvisor
MethodInvocationProceedingJoinPoint
SimpleAspectInstanceFactory
SingletonAspectInstanceFactory
TypePatternClassFilter
Exceptions
AspectJAdviceParameterNameDiscoverer.AmbiguousBindingException


AbstractAspectJAdvisorFactory.AspectJAnnotation

org.springframework.aop.aspectj.annotation
Class AbstractAspectJAdvisorFactory.AspectJAnnotation<A extends Annotation>

java.lang.Object
    extended by  org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory.AspectJAnnotation<A>
Enclosing class:
AbstractAspectJAdvisorFactory
protected static class AbstractAspectJAdvisorFactory.AspectJAnnotation<A extends Annotation>
extends Object

Class modelling an AspectJ annotation, exposing its type enumeration and pointcut String.

Constructor Summary
AbstractAspectJAdvisorFactory.AspectJAnnotation(A aspectjAnnotation)
Method Summary
A | getAnnotation()
AbstractAspectJAdvisorFactory.AspectJAnnotationType | getAnnotationType()
String | getArgNames()
String | getPointcutExpression()
String | toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

AbstractAspectJAdvisorFactory.AspectJAnnotation

public AbstractAspectJAdvisorFactory.AspectJAnnotation(A aspectjAnnotation)
Method Detail

getAnnotationType

public AbstractAspectJAdvisorFactory.AspectJAnnotationType getAnnotationType()

getAnnotation

public A getAnnotation()

getPointcutExpression

public String getPointcutExpression()

getArgNames

public String getArgNames()

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


 org.springframework.aop.aspectj.annotation
Interfaces
AspectJAdvisorFactory
MetadataAwareAspectInstanceFactory
Classes
AbstractAspectJAdvisorFactory
AbstractAspectJAdvisorFactory.AspectJAnnotation
AnnotationAwareAspectJAutoProxyCreator
AspectJProxyFactory
AspectMetadata
BeanFactoryAspectInstanceFactory
BeanFactoryAspectJAdvisorsBuilder
LazySingletonAspectInstanceFactoryDecorator
PrototypeAspectInstanceFactory
ReflectiveAspectJAdvisorFactory
ReflectiveAspectJAdvisorFactory.SyntheticInstantiationAdvisor
SimpleMetadataAwareAspectInstanceFactory
SingletonMetadataAwareAspectInstanceFactory
Enums
AbstractAspectJAdvisorFactory.AspectJAnnotationType
Exceptions
NotAnAtAspectException


 org.springframework.aop.aspectj.autoproxy
Classes
AspectJAwareAdvisorAutoProxyCreator


 org.springframework.aop.config
Classes
AbstractInterceptorDrivenBeanDefinitionDecorator
AdviceEntry
AdvisorComponentDefinition
AdvisorEntry
AopConfigUtils
AopNamespaceHandler
AopNamespaceUtils
AspectComponentDefinition
AspectEntry
MethodLocatingFactoryBean
PointcutComponentDefinition
PointcutEntry
SimpleBeanFactoryAwareAspectInstanceFactory


 org.springframework.aop.framework
Interfaces
Advised
AdvisedSupportListener
AdvisorChainFactory
AopInfrastructureBean
AopProxy
AopProxyFactory
Classes
AbstractSingletonProxyFactoryBean
AdvisedSupport
AopContext
AopProxyUtils
DefaultAdvisorChainFactory
DefaultAopProxyFactory
ProxyConfig
ProxyCreatorSupport
ProxyFactory
ProxyFactoryBean
ReflectiveMethodInvocation
Exceptions
AopConfigException


 org.springframework.aop.framework.adapter
Interfaces
AdvisorAdapter
AdvisorAdapterRegistry
Classes
AdvisorAdapterRegistrationManager
AfterReturningAdviceInterceptor
DefaultAdvisorAdapterRegistry
GlobalAdvisorAdapterRegistry
MethodBeforeAdviceInterceptor
ThrowsAdviceInterceptor
Exceptions
UnknownAdviceTypeException


 org.springframework.aop.framework.autoproxy
Interfaces
TargetSourceCreator
Classes
AbstractAdvisorAutoProxyCreator
AbstractAutoProxyCreator
AutoProxyUtils
BeanFactoryAdvisorRetrievalHelper
BeanNameAutoProxyCreator
DefaultAdvisorAutoProxyCreator
InfrastructureAdvisorAutoProxyCreator
ProxyCreationContext


 org.springframework.aop.framework.autoproxy.target
Classes
AbstractBeanFactoryBasedTargetSourceCreator
LazyInitTargetSourceCreator
QuickTargetSourceCreator


 org.springframework.aop.interceptor
Classes
AbstractMonitoringInterceptor
AbstractTraceInterceptor
AsyncExecutionInterceptor
ConcurrencyThrottleInterceptor
CustomizableTraceInterceptor
DebugInterceptor
ExposeBeanNameAdvisors
ExposeInvocationInterceptor
JamonPerformanceMonitorInterceptor
PerformanceMonitorInterceptor
SimpleTraceInterceptor


 org.springframework.aop.scope
Interfaces
ScopedObject
Classes
DefaultScopedObject
ScopedProxyFactoryBean
ScopedProxyUtils


 org.springframework.aop.support
Interfaces
ExpressionPointcut
Classes
AbstractBeanFactoryPointcutAdvisor
AbstractExpressionPointcut
AbstractGenericPointcutAdvisor
AbstractPointcutAdvisor
AbstractRegexpMethodPointcut
AopUtils
ClassFilters
ComposablePointcut
ControlFlowPointcut
DefaultBeanFactoryPointcutAdvisor
DefaultIntroductionAdvisor
DefaultPointcutAdvisor
DelegatePerTargetObjectIntroductionInterceptor
DelegatingIntroductionInterceptor
DynamicMethodMatcher
DynamicMethodMatcherPointcut
IntroductionInfoSupport
JdkRegexpMethodPointcut
MethodMatchers
NameMatchMethodPointcut
NameMatchMethodPointcutAdvisor
Pointcuts
RegexpMethodPointcutAdvisor
RootClassFilter
StaticMethodMatcher
StaticMethodMatcherPointcut
StaticMethodMatcherPointcutAdvisor


 org.springframework.aop.support.annotation
Classes
AnnotationClassFilter
AnnotationMatchingPointcut
AnnotationMethodMatcher


 org.springframework.aop.target
Interfaces
PoolingConfig
ThreadLocalTargetSourceStats
Classes
AbstractBeanFactoryBasedTargetSource
AbstractLazyCreationTargetSource
AbstractPoolingTargetSource
AbstractPrototypeBasedTargetSource
CommonsPoolTargetSource
EmptyTargetSource
HotSwappableTargetSource
LazyInitTargetSource
PrototypeTargetSource
SimpleBeanTargetSource
SingletonTargetSource
ThreadLocalTargetSource


 org.springframework.aop.target.dynamic
Interfaces
Refreshable
Classes
AbstractRefreshableTargetSource
BeanFactoryRefreshableTargetSource


 org.springframework.beans
Interfaces
BeanMetadataElement
BeanWrapper
ConfigurablePropertyAccessor
Mergeable
PropertyAccessor
PropertyEditorRegistrar
PropertyEditorRegistry
PropertyValues
TypeConverter
Classes
AbstractPropertyAccessor
BeanMetadataAttribute
BeanMetadataAttributeAccessor
BeanUtils
BeanWrapperImpl
CachedIntrospectionResults
DirectFieldAccessor
MutablePropertyValues
PropertyAccessorFactory
PropertyAccessorUtils
PropertyEditorRegistrySupport
PropertyValue
PropertyValuesEditor
SimpleTypeConverter
Exceptions
BeanInstantiationException
BeansException
ConversionNotSupportedException
FatalBeanException
InvalidPropertyException
MethodInvocationException
NotReadablePropertyException
NotWritablePropertyException
NullValueInNestedPathException
PropertyAccessException
PropertyBatchUpdateException
TypeMismatchException


 org.springframework.beans.annotation
Classes
AnnotationBeanUtils


 org.springframework.beans.factory
Interfaces
BeanClassLoaderAware
BeanFactory
BeanFactoryAware
BeanNameAware
DisposableBean
FactoryBean
HierarchicalBeanFactory
InitializingBean
ListableBeanFactory
NamedBean
ObjectFactory
SmartFactoryBean
Classes
BeanFactoryUtils
Exceptions
BeanCreationException
BeanCreationNotAllowedException
BeanCurrentlyInCreationException
BeanDefinitionStoreException
BeanExpressionException
BeanInitializationException
BeanIsAbstractException
BeanIsNotAFactoryException
BeanNotOfRequiredTypeException
CannotLoadBeanClassException
FactoryBeanNotInitializedException
NoSuchBeanDefinitionException
UnsatisfiedDependencyException


 org.springframework.beans.factory.access
Interfaces
BeanFactoryLocator
BeanFactoryReference
Classes
SingletonBeanFactoryLocator
Exceptions
BootstrapException


 org.springframework.beans.factory.access.el
Classes
SimpleSpringBeanELResolver
SpringBeanELResolver


 org.springframework.beans.factory.annotation
Interfaces
AnnotatedBeanDefinition
Classes
AnnotatedGenericBeanDefinition
AnnotationBeanWiringInfoResolver
AutowiredAnnotationBeanPostProcessor
CustomAutowireConfigurer
InitDestroyAnnotationBeanPostProcessor
InjectionMetadata
InjectionMetadata.InjectedElement
QualifierAnnotationAutowireCandidateResolver
RequiredAnnotationBeanPostProcessor
Enums
Autowire
Annotation Types
Autowired
Configurable
Qualifier
Required
Value


 org.springframework.beans.factory.aspectj
Interfaces
ConfigurableObject


 org.springframework.beans.factory.config
Interfaces
AutowireCapableBeanFactory
BeanDefinition
BeanExpressionResolver
BeanFactoryPostProcessor
BeanPostProcessor
BeanReference
ConfigurableBeanFactory
ConfigurableListableBeanFactory
DestructionAwareBeanPostProcessor
InstantiationAwareBeanPostProcessor
Scope
SingletonBeanRegistry
SmartInstantiationAwareBeanPostProcessor
Classes
AbstractFactoryBean
BeanDefinitionHolder
BeanDefinitionVisitor
BeanExpressionContext
BeanReferenceFactoryBean
CommonsLogFactoryBean
ConstructorArgumentValues
ConstructorArgumentValues.ValueHolder
CustomEditorConfigurer
CustomScopeConfigurer
DependencyDescriptor
FieldRetrievingFactoryBean
InstantiationAwareBeanPostProcessorAdapter
ListFactoryBean
MapFactoryBean
MethodInvokingFactoryBean
ObjectFactoryCreatingFactoryBean
PreferencesPlaceholderConfigurer
PropertiesFactoryBean
PropertyOverrideConfigurer
PropertyPathFactoryBean
PropertyPlaceholderConfigurer
PropertyResourceConfigurer
ProviderCreatingFactoryBean
RuntimeBeanNameReference
RuntimeBeanReference
ServiceLocatorFactoryBean
SetFactoryBean
TypedStringValue


 org.springframework.beans.factory.parsing
Interfaces
ComponentDefinition
DefaultsDefinition
ParseState.Entry
ProblemReporter
ReaderEventListener
SourceExtractor
Classes
AbstractComponentDefinition
AliasDefinition
BeanComponentDefinition
BeanEntry
CompositeComponentDefinition
ConstructorArgumentEntry
EmptyReaderEventListener
FailFastProblemReporter
ImportDefinition
Location
NullSourceExtractor
ParseState
PassThroughSourceExtractor
Problem
PropertyEntry
QualifierEntry
ReaderContext
Exceptions
BeanDefinitionParsingException


 org.springframework.beans.factory.serviceloader
Classes
AbstractServiceLoaderBasedFactoryBean
ServiceFactoryBean
ServiceListFactoryBean
ServiceLoaderFactoryBean


 org.springframework.beans.factory.support
Interfaces
AutowireCandidateResolver
BeanDefinitionReader
BeanDefinitionRegistry
BeanDefinitionRegistryPostProcessor
BeanNameGenerator
InstantiationStrategy
MergedBeanDefinitionPostProcessor
MethodReplacer
SecurityContextProvider
Classes
AbstractAutowireCapableBeanFactory
AbstractBeanDefinition
AbstractBeanDefinitionReader
AbstractBeanFactory
AutowireCandidateQualifier
BeanDefinitionBuilder
BeanDefinitionDefaults
BeanDefinitionReaderUtils
CglibSubclassingInstantiationStrategy
ChildBeanDefinition
DefaultBeanNameGenerator
DefaultListableBeanFactory
DefaultSingletonBeanRegistry
FactoryBeanRegistrySupport
GenericBeanDefinition
LookupOverride
ManagedArray
ManagedList
ManagedMap
ManagedProperties
ManagedSet
MethodOverride
MethodOverrides
PropertiesBeanDefinitionReader
ReplaceOverride
RootBeanDefinition
SimpleAutowireCandidateResolver
SimpleBeanDefinitionRegistry
SimpleInstantiationStrategy
SimpleSecurityContextProvider
StaticListableBeanFactory
Exceptions
BeanDefinitionValidationException


 org.springframework.beans.factory.wiring
Interfaces
BeanWiringInfoResolver
Classes
BeanConfigurerSupport
BeanWiringInfo
ClassNameBeanWiringInfoResolver


 org.springframework.beans.factory.xml
Interfaces
BeanDefinitionDecorator
BeanDefinitionDocumentReader
BeanDefinitionParser
DocumentLoader
NamespaceHandler
NamespaceHandlerResolver
Classes
AbstractBeanDefinitionParser
AbstractSimpleBeanDefinitionParser
AbstractSingleBeanDefinitionParser
BeanDefinitionParserDelegate
BeansDtdResolver
DefaultBeanDefinitionDocumentReader
DefaultDocumentLoader
DefaultNamespaceHandlerResolver
DelegatingEntityResolver
DocumentDefaultsDefinition
NamespaceHandlerSupport
ParserContext
PluggableSchemaResolver
ResourceEntityResolver
SimplePropertyNamespaceHandler
UtilNamespaceHandler
XmlBeanDefinitionReader
XmlBeanFactory
XmlReaderContext
Exceptions
XmlBeanDefinitionStoreException


 org.springframework.beans.propertyeditors
Classes
ByteArrayPropertyEditor
CharacterEditor
CharArrayPropertyEditor
CharsetEditor
ClassArrayEditor
ClassEditor
CurrencyEditor
CustomBooleanEditor
CustomCollectionEditor
CustomDateEditor
CustomMapEditor
CustomNumberEditor
FileEditor
InputStreamEditor
LocaleEditor
PatternEditor
PropertiesEditor
ResourceBundleEditor
StringArrayPropertyEditor
StringTrimmerEditor
TimeZoneEditor
URIEditor
URLEditor
UUIDEditor


 org.springframework.beans.support
Interfaces
SortDefinition
Classes
ArgumentConvertingMethodInvoker
MutableSortDefinition
PagedListHolder
PropertyComparator
ResourceEditorRegistrar


 org.springframework.cache.ehcache
Classes
EhCacheFactoryBean
EhCacheManagerFactoryBean


 org.springframework.context
Interfaces
ApplicationContext
ApplicationContextAware
ApplicationEventPublisher
ApplicationEventPublisherAware
ApplicationListener
ConfigurableApplicationContext
HierarchicalMessageSource
Lifecycle
LifecycleProcessor
MessageSource
MessageSourceAware
MessageSourceResolvable
Phased
ResourceLoaderAware
SmartLifecycle
Classes
ApplicationEvent
Exceptions
ApplicationContextException
NoSuchMessageException


 org.springframework.context.access
Classes
ContextBeanFactoryReference
ContextJndiBeanFactoryLocator
ContextSingletonBeanFactoryLocator
DefaultLocatorFactory


 org.springframework.context.annotation
Interfaces
ScopeMetadataResolver
Classes
AnnotatedBeanDefinitionReader
AnnotationBeanNameGenerator
AnnotationConfigApplicationContext
AnnotationConfigBeanDefinitionParser
AnnotationConfigUtils
AnnotationScopeMetadataResolver
ClassPathBeanDefinitionScanner
ClassPathScanningCandidateComponentProvider
CommonAnnotationBeanPostProcessor
ComponentScanBeanDefinitionParser
ConfigurationClassPostProcessor
Jsr330ScopeMetadataResolver
ScannedGenericBeanDefinition
ScopeMetadata
Enums
FilterType
ScopedProxyMode
Annotation Types
Bean
Configuration
DependsOn
Import
ImportResource
Lazy
Primary
Scope


 org.springframework.context.config
Classes
ContextNamespaceHandler


 org.springframework.context.event
Interfaces
ApplicationEventMulticaster
SmartApplicationListener
Classes
AbstractApplicationEventMulticaster
ApplicationContextEvent
ContextClosedEvent
ContextRefreshedEvent
ContextStartedEvent
ContextStoppedEvent
EventPublicationInterceptor
GenericApplicationListenerAdapter
SimpleApplicationEventMulticaster
SourceFilteringListener


 org.springframework.context.expression
Classes
BeanExpressionContextAccessor
BeanFactoryAccessor
MapAccessor
StandardBeanExpressionResolver


 org.springframework.context.i18n
Interfaces
LocaleContext
Classes
LocaleContextHolder
SimpleLocaleContext


 org.springframework.context.support
Classes
AbstractApplicationContext
AbstractMessageSource
AbstractRefreshableApplicationContext
AbstractRefreshableConfigApplicationContext
AbstractXmlApplicationContext
ApplicationObjectSupport
ClassPathXmlApplicationContext
ConversionServiceFactoryBean
DefaultLifecycleProcessor
DefaultMessageSourceResolvable
DelegatingMessageSource
FileSystemXmlApplicationContext
GenericApplicationContext
GenericXmlApplicationContext
MessageSourceAccessor
MessageSourceResourceBundle
MessageSourceSupport
ReloadableResourceBundleMessageSource
ResourceBundleMessageSource
SimpleThreadScope
StaticApplicationContext
StaticMessageSource


 org.springframework.context.weaving
Interfaces
LoadTimeWeaverAware
Classes
AspectJWeavingEnabler
DefaultContextLoadTimeWeaver
LoadTimeWeaverAwareProcessor


 org.springframework.core
Interfaces
AliasRegistry
AttributeAccessor
ConcurrentMap
ControlFlow
ErrorCoded
InfrastructureProxy
Ordered
ParameterNameDiscoverer
PriorityOrdered
SmartClassLoader
Classes
AttributeAccessorSupport
BridgeMethodResolver
CollectionFactory
ConfigurableObjectInputStream
Constants
ControlFlowFactory
Conventions
DecoratingClassLoader
GenericCollectionTypeResolver
GenericTypeResolver
JdkVersion
LocalVariableTableParameterNameDiscoverer
MethodParameter
NamedInheritableThreadLocal
NamedThreadLocal
NestedExceptionUtils
OrderComparator
OverridingClassLoader
PrioritizedParameterNameDiscoverer
SimpleAliasRegistry
SpringVersion
Exceptions
ConstantException
NestedCheckedException
NestedIOException
NestedRuntimeException


 org.springframework.core.annotation
Classes
AnnotationAwareOrderComparator
AnnotationUtils
Annotation Types
Order


 org.springframework.core.convert
Interfaces
ConversionService
Classes
TypeDescriptor
Exceptions
ConversionException
ConversionFailedException
ConverterNotFoundException


 org.springframework.core.convert.converter
Interfaces
ConditionalGenericConverter
Converter
ConverterFactory
ConverterRegistry
GenericConverter
Classes
GenericConverter.ConvertiblePair


 org.springframework.core.convert.support
Classes
ConversionServiceFactory
ConvertingPropertyEditorAdapter
GenericConversionService
PropertyTypeDescriptor


 org.springframework.core.enums
Interfaces
LabeledEnum
LabeledEnumResolver
Classes
AbstractCachingLabeledEnumResolver
AbstractGenericLabeledEnum
AbstractLabeledEnum
LetterCodedLabeledEnum
ShortCodedLabeledEnum
StaticLabeledEnum
StaticLabeledEnumResolver
StringCodedLabeledEnum


 org.springframework.core.io
Interfaces
ContextResource
InputStreamSource
Resource
ResourceLoader
Classes
AbstractFileResolvingResource
AbstractResource
ByteArrayResource
ClassPathResource
ClassRelativeResourceLoader
DefaultResourceLoader
DescriptiveResource
FileSystemResource
FileSystemResourceLoader
InputStreamResource
ResourceEditor
UrlResource
VfsResource


 org.springframework.core.io.support
Interfaces
ResourcePatternResolver
Classes
EncodedResource
LocalizedResourceHelper
PathMatchingResourcePatternResolver
PropertiesLoaderSupport
PropertiesLoaderUtils
ResourceArrayPropertyEditor
ResourcePatternUtils


 org.springframework.core.style
Interfaces
ToStringStyler
ValueStyler
Classes
DefaultToStringStyler
DefaultValueStyler
StylerUtils
ToStringCreator


 org.springframework.core.task
Interfaces
AsyncTaskExecutor
TaskExecutor
Classes
SimpleAsyncTaskExecutor
SyncTaskExecutor
Exceptions
TaskRejectedException
TaskTimeoutException


 org.springframework.core.task.support
Classes
ConcurrentExecutorAdapter
ExecutorServiceAdapter
TaskExecutorAdapter


 org.springframework.core.type
Interfaces
AnnotationMetadata
ClassMetadata
MethodMetadata
Classes
StandardAnnotationMetadata
StandardClassMetadata
StandardMethodMetadata


 org.springframework.core.type.classreading
Interfaces
MetadataReader
MetadataReaderFactory
Classes
CachingMetadataReaderFactory
SimpleMetadataReaderFactory


 org.springframework.core.type.filter
Interfaces
TypeFilter
Classes
AbstractClassTestingTypeFilter
AbstractTypeHierarchyTraversingFilter
AnnotationTypeFilter
AspectJTypeFilter
AssignableTypeFilter
RegexPatternTypeFilter


 org.springframework.dao
Exceptions
CannotAcquireLockException
CannotSerializeTransactionException
CleanupFailureDataAccessException
ConcurrencyFailureException
DataAccessException
DataAccessResourceFailureException
DataIntegrityViolationException
DataRetrievalFailureException
DeadlockLoserDataAccessException
DuplicateKeyException
EmptyResultDataAccessException
IncorrectResultSizeDataAccessException
IncorrectUpdateSemanticsDataAccessException
InvalidDataAccessApiUsageException
InvalidDataAccessResourceUsageException
NonTransientDataAccessException
NonTransientDataAccessResourceException
OptimisticLockingFailureException
PermissionDeniedDataAccessException
PessimisticLockingFailureException
RecoverableDataAccessException
TransientDataAccessException
TransientDataAccessResourceException
TypeMismatchDataAccessException
UncategorizedDataAccessException


 org.springframework.dao.annotation
Classes
PersistenceExceptionTranslationAdvisor
PersistenceExceptionTranslationPostProcessor


 org.springframework.dao.support
Interfaces
PersistenceExceptionTranslator
Classes
ChainedPersistenceExceptionTranslator
DaoSupport
DataAccessUtils
PersistenceExceptionTranslationInterceptor


 org.springframework.ejb.access
Classes
AbstractRemoteSlsbInvokerInterceptor
AbstractSlsbInvokerInterceptor
LocalSlsbInvokerInterceptor
LocalStatelessSessionProxyFactoryBean
SimpleRemoteSlsbInvokerInterceptor
SimpleRemoteStatelessSessionProxyFactoryBean
Exceptions
EjbAccessException


 org.springframework.ejb.config
Classes
JeeNamespaceHandler


 org.springframework.ejb.interceptor
Classes
SpringBeanAutowiringInterceptor


 org.springframework.ejb.support
Interfaces
SmartSessionBean
Classes
AbstractEnterpriseBean
AbstractJmsMessageDrivenBean
AbstractMessageDrivenBean
AbstractSessionBean
AbstractStatefulSessionBean
AbstractStatelessSessionBean


 org.springframework.expression
Interfaces
ConstructorExecutor
ConstructorResolver
EvaluationContext
Expression
ExpressionParser
MethodExecutor
MethodFilter
MethodResolver
OperatorOverloader
ParserContext
PropertyAccessor
TypeComparator
TypeConverter
TypeLocator
Classes
TypedValue
Enums
Operation
Exceptions
AccessException
EvaluationException
ExpressionException
ParseException


 org.springframework.expression.common
Classes
CompositeStringExpression
ExpressionUtils
LiteralExpression
TemplateAwareExpressionParser
TemplateParserContext


 org.springframework.expression.spel
Interfaces
SpelNode
Classes
ExpressionState
SpelParserConfiguration
Enums
SpelMessage
SpelMessage.Kind
Exceptions
InternalParseException
SpelEvaluationException
SpelParseException


 org.springframework.expression.spel.ast
Classes
Assign
AstUtils
BooleanLiteral
CompoundExpression
ConstructorReference
Elvis
FormatHelper
FunctionReference
Identifier
Indexer
IntLiteral
Literal
LongLiteral
MethodReference
NullLiteral
OpAnd
OpDivide
OpEQ
Operator
OperatorBetween
OperatorInstanceof
OperatorMatches
OperatorNot
OperatorPower
OpGE
OpGT
OpLE
OpLT
OpMinus
OpModulus
OpMultiply
OpNE
OpOr
OpPlus
Projection
PropertyOrFieldReference
QualifiedIdentifier
RealLiteral
Selection
SpelNodeImpl
StringLiteral
Ternary
TypeReference
VariableReference
Enums
TypeCode


 org.springframework.expression.spel.standard
Classes
SpelExpression
SpelExpressionParser


 org.springframework.expression.spel.support
Classes
BooleanTypedValue
ReflectionHelper
ReflectionHelper.ArgumentsMatchInfo
ReflectiveConstructorResolver
ReflectiveMethodResolver
ReflectivePropertyAccessor
StandardEvaluationContext
StandardOperatorOverloader
StandardTypeComparator
StandardTypeConverter
StandardTypeLocator
Enums
ReflectionHelper.ArgsMatchKind


 org.springframework.format
Interfaces
AnnotationFormatterFactory
Formatter
FormatterRegistry
Parser
Printer


DateTimeFormat.ISO

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

org.springframework.format.annotation
Enum DateTimeFormat.ISO

java.lang.Object
    extended by  java.lang.Enum<DateTimeFormat.ISO>
        extended by  org.springframework.format.annotation.DateTimeFormat.ISO
All Implemented Interfaces:
Serializable, Comparable<DateTimeFormat.ISO>
Enclosing class:
DateTimeFormat
public static enum DateTimeFormat.ISO
extends Enum<DateTimeFormat.ISO>

Common ISO date time format patterns.

Enum Constant Summary
DATE
The most common ISO Date Format yyyy-MM-dd e.g.
DATE_TIME
The most common ISO DateTime Format yyyy-MM-dd'T'hh:mm:ss.SSSZ e.g.
NONE
Indicates that no ISO-based format pattern should be applied.
TIME
The most common ISO Time Format hh:mm:ss.SSSZ e.g.
Method Summary
static DateTimeFormat.ISO | valueOf(String name) Returns the enum constant of this type with the specified name.
static DateTimeFormat.ISO[] | values() Returns an array containing the constants of this enum type, in the order they are declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

DATE

public static final DateTimeFormat.ISO DATE
The most common ISO Date Format yyyy-MM-dd e.g. 2000-10-31.

TIME

public static final DateTimeFormat.ISO TIME
The most common ISO Time Format hh:mm:ss.SSSZ e.g. 01:30:00.000-05:00.

DATE_TIME

public static final DateTimeFormat.ISO DATE_TIME
The most common ISO DateTime Format yyyy-MM-dd'T'hh:mm:ss.SSSZ e.g. 2000-10-31 01:30:00.000-05:00. The default if no annotation value is specified.

NONE

public static final DateTimeFormat.ISO NONE
Indicates that no ISO-based format pattern should be applied.

Method Detail

values

public static DateTimeFormat.ISO[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (DateTimeFormat.ISO c : DateTimeFormat.ISO.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static DateTimeFormat.ISO valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


NumberFormat.Style

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD

org.springframework.format.annotation
Enum NumberFormat.Style

java.lang.Object
    extended by  java.lang.Enum<NumberFormat.Style>
        extended by  org.springframework.format.annotation.NumberFormat.Style
All Implemented Interfaces:
Serializable, Comparable<NumberFormat.Style>
Enclosing class:
NumberFormat
public static enum NumberFormat.Style
extends Enum<NumberFormat.Style>

Common number format styles.

Since:
3.0
Author:
Keith Donald

Enum Constant Summary
CURRENCY
The currency format for the current locale.
NUMBER
The general-purpose number format for the current locale.
PERCENT
The percent format for the current locale.
Method Summary
static NumberFormat.Style | valueOf(String name) Returns the enum constant of this type with the specified name.
static NumberFormat.Style[] | values() Returns an array containing the constants of this enum type, in the order they are declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

NUMBER

public static final NumberFormat.Style NUMBER
The general-purpose number format for the current locale.

CURRENCY

public static final NumberFormat.Style CURRENCY
The currency format for the current locale.

PERCENT

public static final NumberFormat.Style PERCENT
The percent format for the current locale.

Method Detail

values

public static NumberFormat.Style[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (NumberFormat.Style c : NumberFormat.Style.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static NumberFormat.Style valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD


 org.springframework.format.annotation
Enums
DateTimeFormat.ISO
NumberFormat.Style
Annotation Types
DateTimeFormat
NumberFormat


 org.springframework.format.datetime
Classes
DateFormatter


 org.springframework.format.datetime.joda
Classes
DateTimeParser
JodaDateTimeFormatAnnotationFormatterFactory
JodaTimeContext
JodaTimeContextHolder
JodaTimeFormattingConfigurer
MillisecondInstantPrinter
ReadableInstantPrinter
ReadablePartialPrinter


 org.springframework.format.number
Classes
AbstractNumberFormatter
CurrencyFormatter
NumberFormatAnnotationFormatterFactory
NumberFormatter
PercentFormatter


 org.springframework.format.support
Classes
FormattingConversionService
FormattingConversionServiceFactoryBean


 org.springframework.http
Interfaces
HttpInputMessage
HttpMessage
HttpOutputMessage
Classes
HttpEntity
HttpHeaders
MediaType
MediaTypeEditor
ResponseEntity
Enums
HttpMethod
HttpStatus
HttpStatus.Series


 org.springframework.http.client
Interfaces
ClientHttpRequest
ClientHttpRequestFactory
ClientHttpResponse
Classes
AbstractClientHttpRequest
CommonsClientHttpRequestFactory
SimpleClientHttpRequestFactory


 org.springframework.http.client.support
Classes
HttpAccessor


 org.springframework.http.converter
Interfaces
HttpMessageConverter
Classes
AbstractHttpMessageConverter
BufferedImageHttpMessageConverter
ByteArrayHttpMessageConverter
FormHttpMessageConverter
ResourceHttpMessageConverter
StringHttpMessageConverter
Exceptions
HttpMessageConversionException
HttpMessageNotReadableException
HttpMessageNotWritableException


 org.springframework.http.converter.feed
Classes
AbstractWireFeedHttpMessageConverter
AtomFeedHttpMessageConverter
RssChannelHttpMessageConverter


 org.springframework.http.converter.json
Classes
MappingJacksonHttpMessageConverter


 org.springframework.http.converter.xml
Classes
AbstractJaxb2HttpMessageConverter
AbstractXmlHttpMessageConverter
Jaxb2RootElementHttpMessageConverter
MarshallingHttpMessageConverter
SourceHttpMessageConverter


 org.springframework.http.server
Interfaces
ServerHttpRequest
ServerHttpResponse
Classes
ServletServerHttpRequest
ServletServerHttpResponse


 org.springframework.instrument
Classes
InstrumentationSavingAgent


 org.springframework.instrument.classloading
Interfaces
LoadTimeWeaver
Classes
InstrumentationLoadTimeWeaver
ReflectiveLoadTimeWeaver
ResourceOverridingShadowingClassLoader
ShadowingClassLoader
SimpleInstrumentableClassLoader
SimpleLoadTimeWeaver
SimpleThrowawayClassLoader
WeavingTransformer


 org.springframework.instrument.classloading.glassfish
Classes
GlassFishLoadTimeWeaver


 org.springframework.instrument.classloading.jboss
Classes
JBossLoadTimeWeaver


 org.springframework.instrument.classloading.oc4j
Classes
OC4JLoadTimeWeaver


 org.springframework.instrument.classloading.tomcat
Classes
TomcatInstrumentableClassLoader


 org.springframework.instrument.classloading.weblogic
Classes
WebLogicLoadTimeWeaver


 org.springframework.jca.cci
Exceptions
CannotCreateRecordException
CannotGetCciConnectionException
CciOperationNotSupportedException
InvalidResultSetAccessException
RecordTypeNotSupportedException


 org.springframework.jca.cci.connection
Classes
CciLocalTransactionManager
ConnectionFactoryUtils
ConnectionHolder
ConnectionSpecConnectionFactoryAdapter
DelegatingConnectionFactory
NotSupportedRecordFactory
SingleConnectionFactory
TransactionAwareConnectionFactoryProxy


 org.springframework.jca.cci.core
Interfaces
CciOperations
ConnectionCallback
InteractionCallback
RecordCreator
RecordExtractor
Classes
CciTemplate


 org.springframework.jca.cci.core.support
Classes
CciDaoSupport
CommAreaRecord


 org.springframework.jca.cci.object
Classes
EisOperation
MappingCommAreaOperation
MappingRecordOperation
SimpleRecordOperation


 org.springframework.jca.context
Interfaces
BootstrapContextAware
Classes
ResourceAdapterApplicationContext
SpringContextResourceAdapter


 org.springframework.jca.endpoint
Classes
AbstractMessageEndpointFactory
GenericMessageEndpointFactory
GenericMessageEndpointManager
Exceptions
GenericMessageEndpointFactory.InternalResourceException


 org.springframework.jca.support
Classes
LocalConnectionFactoryBean
ResourceAdapterFactoryBean
SimpleBootstrapContext


 org.springframework.jca.work
Classes
DelegatingWork
SimpleTaskWorkManager
WorkManagerTaskExecutor


 org.springframework.jca.work.glassfish
Classes
GlassFishWorkManagerTaskExecutor


 org.springframework.jca.work.jboss
Classes
JBossWorkManagerTaskExecutor
JBossWorkManagerUtils


 org.springframework.jdbc
Exceptions
BadSqlGrammarException
CannotGetJdbcConnectionException
IncorrectResultSetColumnCountException
InvalidResultSetAccessException
JdbcUpdateAffectedIncorrectNumberOfRowsException
LobRetrievalFailureException
SQLWarningException
UncategorizedSQLException


 org.springframework.jdbc.config
Classes
EmbeddedDatabaseBeanDefinitionParser
InitializeDatabaseBeanDefinitionParser
JdbcNamespaceHandler
SortedResourcesFactoryBean


 org.springframework.jdbc.core
Interfaces
BatchPreparedStatementSetter
CallableStatementCallback
CallableStatementCreator
ConnectionCallback
DisposableSqlTypeValue
InterruptibleBatchPreparedStatementSetter
JdbcOperations
ParameterDisposer
ParameterMapper
PreparedStatementCallback
PreparedStatementCreator
PreparedStatementSetter
ResultSetExtractor
RowCallbackHandler
RowMapper
SqlProvider
SqlReturnType
SqlTypeValue
StatementCallback
Classes
BatchUpdateUtils
BeanPropertyRowMapper
CallableStatementCreatorFactory
ColumnMapRowMapper
JdbcTemplate
PreparedStatementCreatorFactory
ResultSetSupportingSqlParameter
RowCountCallbackHandler
RowMapperResultSetExtractor
SingleColumnRowMapper
SqlInOutParameter
SqlOutParameter
SqlParameter
SqlParameterValue
SqlReturnResultSet
SqlReturnUpdateCount
SqlRowSetResultSetExtractor
StatementCreatorUtils


 org.springframework.jdbc.core.metadata
Interfaces
CallMetaDataProvider
TableMetaDataProvider
Classes
CallMetaDataContext
CallMetaDataProviderFactory
CallParameterMetaData
Db2CallMetaDataProvider
DerbyCallMetaDataProvider
DerbyTableMetaDataProvider
GenericCallMetaDataProvider
GenericTableMetaDataProvider
HsqlTableMetaDataProvider
OracleCallMetaDataProvider
OracleTableMetaDataProvider
PostgresCallMetaDataProvider
PostgresTableMetaDataProvider
SqlServerCallMetaDataProvider
SybaseCallMetaDataProvider
TableMetaDataContext
TableMetaDataProviderFactory
TableParameterMetaData


 org.springframework.jdbc.core.namedparam
Interfaces
NamedParameterJdbcOperations
SqlParameterSource
Classes
AbstractSqlParameterSource
BeanPropertySqlParameterSource
MapSqlParameterSource
NamedParameterBatchUpdateUtils
NamedParameterJdbcDaoSupport
NamedParameterJdbcTemplate
NamedParameterUtils
ParsedSql
SqlParameterSourceUtils


 org.springframework.jdbc.core.simple
Interfaces
ParameterizedRowMapper
SimpleJdbcCallOperations
SimpleJdbcInsertOperations
SimpleJdbcOperations
Classes
AbstractJdbcCall
AbstractJdbcInsert
ParameterizedBeanPropertyRowMapper
ParameterizedSingleColumnRowMapper
SimpleJdbcCall
SimpleJdbcDaoSupport
SimpleJdbcInsert
SimpleJdbcTemplate


 org.springframework.jdbc.core.support
Classes
AbstractInterruptibleBatchPreparedStatementSetter
AbstractLobCreatingPreparedStatementCallback
AbstractLobStreamingResultSetExtractor
AbstractSqlTypeValue
JdbcBeanDefinitionReader
JdbcDaoSupport
SqlLobValue


 org.springframework.jdbc.datasource
Interfaces
ConnectionHandle
ConnectionProxy
SmartDataSource
Classes
AbstractDataSource
AbstractDriverBasedDataSource
ConnectionHolder
DataSourceTransactionManager
DataSourceUtils
DelegatingDataSource
DriverManagerDataSource
IsolationLevelDataSourceAdapter
JdbcTransactionObjectSupport
LazyConnectionDataSourceProxy
SimpleConnectionHandle
SimpleDriverDataSource
SingleConnectionDataSource
TransactionAwareDataSourceProxy
UserCredentialsDataSourceAdapter
WebSphereDataSourceAdapter


 org.springframework.jdbc.datasource.embedded
Interfaces
ConnectionProperties
DataSourceFactory
EmbeddedDatabase
EmbeddedDatabaseConfigurer
Classes
EmbeddedDatabaseBuilder
EmbeddedDatabaseFactory
EmbeddedDatabaseFactoryBean
OutputStreamFactory
Enums
EmbeddedDatabaseType


 org.springframework.jdbc.datasource.init
Interfaces
DatabasePopulator
Classes
DataSourceInitializer
ResourceDatabasePopulator
Exceptions
CannotReadScriptException


 org.springframework.jdbc.datasource.lookup
Interfaces
DataSourceLookup
Classes
AbstractRoutingDataSource
BeanFactoryDataSourceLookup
IsolationLevelDataSourceRouter
JndiDataSourceLookup
MapDataSourceLookup
SingleDataSourceLookup
Exceptions
DataSourceLookupFailureException


 org.springframework.jdbc.object
Classes
BatchSqlUpdate
GenericSqlQuery
GenericStoredProcedure
MappingSqlQuery
MappingSqlQueryWithParameters
RdbmsOperation
SqlCall
SqlFunction
SqlOperation
SqlQuery
SqlUpdate
StoredProcedure
UpdatableSqlQuery


 org.springframework.jdbc.support
Interfaces
DatabaseMetaDataCallback
KeyHolder
SQLExceptionTranslator
SqlValue
Classes
AbstractFallbackSQLExceptionTranslator
CustomSQLErrorCodesTranslation
DatabaseStartupValidator
GeneratedKeyHolder
JdbcAccessor
JdbcUtils
SQLErrorCodes
SQLErrorCodesFactory
SQLErrorCodeSQLExceptionTranslator
SQLExceptionSubclassTranslator
SQLStateSQLExceptionTranslator
Exceptions
MetaDataAccessException


 org.springframework.jdbc.support.incrementer
Interfaces
DataFieldMaxValueIncrementer
Classes
AbstractColumnMaxValueIncrementer
AbstractDataFieldMaxValueIncrementer
AbstractSequenceMaxValueIncrementer
DB2MainframeSequenceMaxValueIncrementer
DB2SequenceMaxValueIncrementer
DerbyMaxValueIncrementer
H2SequenceMaxValueIncrementer
HsqlMaxValueIncrementer
HsqlSequenceMaxValueIncrementer
MySQLMaxValueIncrementer
OracleSequenceMaxValueIncrementer
PostgreSQLSequenceMaxValueIncrementer
SqlServerMaxValueIncrementer
SybaseMaxValueIncrementer


 org.springframework.jdbc.support.lob
Interfaces
LobCreator
LobHandler
OracleLobHandler.LobCallback
Classes
AbstractLobHandler
DefaultLobHandler
JtaLobCreatorSynchronization
LobCreatorUtils
OracleLobHandler
SpringLobCreatorSynchronization


 org.springframework.jdbc.support.nativejdbc
Interfaces
NativeJdbcExtractor
Classes
C3P0NativeJdbcExtractor
CommonsDbcpNativeJdbcExtractor
JBossNativeJdbcExtractor
Jdbc4NativeJdbcExtractor
NativeJdbcExtractorAdapter
SimpleNativeJdbcExtractor
WebLogicNativeJdbcExtractor
WebSphereNativeJdbcExtractor


 org.springframework.jdbc.support.rowset
Interfaces
SqlRowSet
SqlRowSetMetaData
Classes
ResultSetWrappingSqlRowSet
ResultSetWrappingSqlRowSetMetaData


 org.springframework.jdbc.support.xml
Interfaces
SqlXmlHandler
SqlXmlObjectMappingHandler
SqlXmlValue
XmlBinaryStreamProvider
XmlCharacterStreamProvider
XmlResultProvider
Classes
Jdbc4SqlXmlHandler
Exceptions
SqlXmlFeatureNotImplementedException


 org.springframework.jms
Exceptions
IllegalStateException
InvalidClientIDException
InvalidDestinationException
InvalidSelectorException
JmsException
JmsSecurityException
MessageEOFException
MessageFormatException
MessageNotReadableException
MessageNotWriteableException
ResourceAllocationException
TransactionInProgressException
TransactionRolledBackException
UncategorizedJmsException


 org.springframework.jms.config
Classes
JmsNamespaceHandler


 org.springframework.jms.connection
Interfaces
ConnectionFactoryUtils.ResourceFactory
SessionProxy
SmartConnectionFactory
Classes
CachingConnectionFactory
ChainedExceptionListener
ConnectionFactoryUtils
DelegatingConnectionFactory
JmsResourceHolder
JmsTransactionManager
JmsTransactionManager102
SingleConnectionFactory
SingleConnectionFactory102
TransactionAwareConnectionFactoryProxy
UserCredentialsConnectionFactoryAdapter
Exceptions
SynchedLocalTransactionFailedException


 org.springframework.jms.core
Interfaces
BrowserCallback
JmsOperations
MessageCreator
MessagePostProcessor
ProducerCallback
SessionCallback
Classes
JmsTemplate
JmsTemplate102


 org.springframework.jms.core.support
Classes
JmsGatewaySupport


 org.springframework.jms.listener
Interfaces
SessionAwareMessageListener
SubscriptionNameProvider
Classes
AbstractJmsListeningContainer
AbstractMessageListenerContainer
AbstractPollingMessageListenerContainer
DefaultMessageListenerContainer
DefaultMessageListenerContainer102
SimpleMessageListenerContainer
SimpleMessageListenerContainer102
Exceptions
AbstractJmsListeningContainer.SharedConnectionNotInitializedException


 org.springframework.jms.listener.adapter
Classes
MessageListenerAdapter
MessageListenerAdapter102
Exceptions
ListenerExecutionFailedException


 org.springframework.jms.listener.endpoint
Interfaces
JmsActivationSpecFactory
Classes
DefaultJmsActivationSpecFactory
JmsActivationSpecConfig
JmsMessageEndpointFactory
JmsMessageEndpointManager
StandardJmsActivationSpecFactory
Exceptions
JmsMessageEndpointFactory.JmsResourceException


 org.springframework.jms.remoting
Classes
JmsInvokerClientInterceptor
JmsInvokerProxyFactoryBean
JmsInvokerServiceExporter


 org.springframework.jms.support
Classes
JmsAccessor
JmsUtils


 org.springframework.jms.support.converter
Interfaces
MessageConverter
Classes
MarshallingMessageConverter
SimpleMessageConverter
SimpleMessageConverter102
Enums
MessageType
Exceptions
MessageConversionException


 org.springframework.jms.support.destination
Interfaces
CachingDestinationResolver
DestinationResolver
Classes
BeanFactoryDestinationResolver
DynamicDestinationResolver
JmsDestinationAccessor
JndiDestinationResolver
Exceptions
DestinationResolutionException


 org.springframework.jmx
Exceptions
JmxException
MBeanServerNotFoundException


 org.springframework.jmx.access
Classes
MBeanClientInterceptor
MBeanProxyFactoryBean
NotificationListenerRegistrar
Exceptions
InvalidInvocationException
InvocationFailureException
MBeanConnectFailureException
MBeanInfoRetrievalException


 org.springframework.jmx.export
Interfaces
MBeanExporterListener
MBeanExportOperations
Classes
MBeanExporter
NotificationListenerBean
SpringModelMBean
Exceptions
MBeanExportException
UnableToRegisterMBeanException


 org.springframework.jmx.export.annotation
Classes
AnnotationJmxAttributeSource
AnnotationMBeanExporter
Annotation Types
ManagedAttribute
ManagedMetric
ManagedNotification
ManagedNotifications
ManagedOperation
ManagedOperationParameter
ManagedOperationParameters
ManagedResource


 org.springframework.jmx.export.assembler
Interfaces
AutodetectCapableMBeanInfoAssembler
MBeanInfoAssembler
Classes
AbstractConfigurableMBeanInfoAssembler
AbstractMBeanInfoAssembler
AbstractReflectiveMBeanInfoAssembler
InterfaceBasedMBeanInfoAssembler
MetadataMBeanInfoAssembler
MethodExclusionMBeanInfoAssembler
MethodNameBasedMBeanInfoAssembler
SimpleReflectiveMBeanInfoAssembler


 org.springframework.jmx.export.metadata
Interfaces
JmxAttributeSource
Classes
AbstractJmxAttribute
JmxMetadataUtils
ManagedAttribute
ManagedMetric
ManagedNotification
ManagedOperation
ManagedOperationParameter
ManagedResource
Exceptions
InvalidMetadataException


 org.springframework.jmx.export.naming
Interfaces
ObjectNamingStrategy
SelfNaming
Classes
IdentityNamingStrategy
KeyNamingStrategy
MetadataNamingStrategy


 org.springframework.jmx.export.notification
Interfaces
NotificationPublisher
NotificationPublisherAware
Classes
ModelMBeanNotificationPublisher
Exceptions
UnableToSendNotificationException


 org.springframework.jmx.support
Classes
ConnectorServerFactoryBean
JmxUtils
MBeanRegistrationSupport
MBeanServerConnectionFactoryBean
MBeanServerFactoryBean
NotificationListenerHolder
ObjectNameManager
WebSphereMBeanServerFactoryBean
Enums
MetricType


 org.springframework.jndi
Interfaces
JndiCallback
Classes
JndiAccessor
JndiLocatorDelegate
JndiLocatorSupport
JndiObjectFactoryBean
JndiObjectLocator
JndiObjectTargetSource
JndiTemplate
JndiTemplateEditor
Exceptions
JndiLookupFailureException
TypeMismatchNamingException


 org.springframework.jndi.support
Classes
SimpleJndiBeanFactory


 org.springframework.mail
Interfaces
MailMessage
MailSender
Classes
SimpleMailMessage
Exceptions
MailAuthenticationException
MailException
MailParseException
MailPreparationException
MailSendException


 org.springframework.mail.javamail
Interfaces
JavaMailSender
MimeMessagePreparator
Classes
ConfigurableMimeFileTypeMap
InternetAddressEditor
JavaMailSenderImpl
MimeMailMessage
MimeMessageHelper


 org.springframework.mock.jndi
Classes
ExpectedLookupTemplate
SimpleNamingContext
SimpleNamingContextBuilder


 org.springframework.mock.staticmock
Annotation Types
MockStaticEntityMethods


 org.springframework.mock.web
Classes
DelegatingServletInputStream
DelegatingServletOutputStream
MockBodyContent
MockExpressionEvaluator
MockFilterChain
MockFilterConfig
MockHttpServletRequest
MockHttpServletResponse
MockHttpSession
MockJspWriter
MockMultipartFile
MockMultipartHttpServletRequest
MockPageContext
MockRequestDispatcher
MockServletConfig
MockServletContext
PassThroughFilterChain


 org.springframework.mock.web.portlet
Classes
MockActionRequest
MockActionResponse
MockBaseURL
MockCacheControl
MockClientDataRequest
MockEvent
MockEventRequest
MockEventResponse
MockMimeResponse
MockMultipartActionRequest
MockPortalContext
MockPortletConfig
MockPortletContext
MockPortletPreferences
MockPortletRequest
MockPortletRequestDispatcher
MockPortletResponse
MockPortletSession
MockPortletURL
MockRenderRequest
MockRenderResponse
MockResourceRequest
MockResourceResponse
MockResourceURL
MockStateAwareResponse
ServletWrappingPortletContext


 org.springframework.orm
Exceptions
ObjectOptimisticLockingFailureException
ObjectRetrievalFailureException


 org.springframework.orm.hibernate3
Interfaces
HibernateCallback
HibernateOperations
Classes
AbstractSessionFactoryBean
FilterDefinitionFactoryBean
HibernateAccessor
HibernateInterceptor
HibernateTemplate
HibernateTransactionManager
LocalCacheProviderProxy
LocalDataSourceConnectionProvider
LocalJtaDataSourceConnectionProvider
LocalRegionFactoryProxy
LocalSessionFactoryBean
LocalTransactionManagerLookup
SessionFactoryUtils
SessionHolder
SpringSessionContext
SpringTransactionFactory
TransactionAwareDataSourceConnectionProvider
TypeDefinitionBean
Exceptions
HibernateJdbcException
HibernateObjectRetrievalFailureException
HibernateOptimisticLockingFailureException
HibernateQueryException
HibernateSystemException


 org.springframework.orm.hibernate3.annotation
Classes
AnnotationSessionFactoryBean


 org.springframework.orm.hibernate3.support
Classes
AbstractLobType
BlobByteArrayType
BlobSerializableType
BlobStringType
ClobStringType
HibernateDaoSupport
IdTransferringMergeEventListener
OpenSessionInViewFilter
OpenSessionInViewInterceptor
ScopedBeanInterceptor


 org.springframework.orm.ibatis
Interfaces
SqlMapClientCallback
SqlMapClientOperations
Classes
SqlMapClientFactoryBean
SqlMapClientTemplate


 org.springframework.orm.ibatis.support
Classes
AbstractLobTypeHandler
BlobByteArrayTypeHandler
BlobSerializableTypeHandler
ClobStringTypeHandler
SqlMapClientDaoSupport


 org.springframework.orm.jdo
Interfaces
JdoCallback
JdoDialect
JdoOperations
Classes
DefaultJdoDialect
JdoAccessor
JdoInterceptor
JdoTemplate
JdoTransactionManager
LocalPersistenceManagerFactoryBean
PersistenceManagerFactoryUtils
PersistenceManagerHolder
TransactionAwarePersistenceManagerFactoryProxy
Exceptions
JdoObjectRetrievalFailureException
JdoOptimisticLockingFailureException
JdoResourceFailureException
JdoSystemException
JdoUsageException


 org.springframework.orm.jdo.support
Classes
JdoDaoSupport
OpenPersistenceManagerInViewFilter
OpenPersistenceManagerInViewInterceptor
SpringPersistenceManagerProxyBean
StandardPersistenceManagerProxyBean


 org.springframework.orm.jpa
Interfaces
EntityManagerFactoryInfo
EntityManagerFactoryPlus
EntityManagerFactoryPlusOperations
EntityManagerPlus
EntityManagerPlusOperations
EntityManagerProxy
JpaCallback
JpaDialect
JpaOperations
JpaVendorAdapter
Classes
AbstractEntityManagerFactoryBean
DefaultJpaDialect
EntityManagerFactoryAccessor
EntityManagerFactoryUtils
EntityManagerHolder
ExtendedEntityManagerCreator
JpaAccessor
JpaInterceptor
JpaTemplate
JpaTransactionManager
LocalContainerEntityManagerFactoryBean
LocalEntityManagerFactoryBean
SharedEntityManagerCreator
Exceptions
JpaObjectRetrievalFailureException
JpaOptimisticLockingFailureException
JpaSystemException


 org.springframework.orm.jpa.persistenceunit
Interfaces
PersistenceUnitManager
PersistenceUnitPostProcessor
SmartPersistenceUnitInfo
Classes
DefaultPersistenceUnitManager
MutablePersistenceUnitInfo


 org.springframework.orm.jpa.support
Classes
JpaDaoSupport
OpenEntityManagerInViewFilter
OpenEntityManagerInViewInterceptor
PersistenceAnnotationBeanPostProcessor
SharedEntityManagerBean


 org.springframework.orm.jpa.vendor
Classes
AbstractJpaVendorAdapter
EclipseLinkJpaDialect
EclipseLinkJpaVendorAdapter
HibernateJpaDialect
HibernateJpaVendorAdapter
OpenJpaDialect
OpenJpaVendorAdapter
TopLinkJpaDialect
TopLinkJpaVendorAdapter
Enums
Database


 org.springframework.oxm
Interfaces
GenericMarshaller
GenericUnmarshaller
Marshaller
Unmarshaller
Exceptions
MarshallingException
MarshallingFailureException
UncategorizedMappingException
UnmarshallingFailureException
ValidationFailureException
XmlMappingException


 org.springframework.oxm.castor
Classes
CastorMarshaller
Exceptions
CastorMappingException


 org.springframework.oxm.config
Classes
OxmNamespaceHandler


 org.springframework.oxm.jaxb
Classes
Jaxb2Marshaller


 org.springframework.oxm.jibx
Classes
JibxMarshaller


 org.springframework.oxm.mime
Interfaces
MimeContainer
MimeMarshaller
MimeUnmarshaller


 org.springframework.oxm.support
Classes
AbstractMarshaller
MarshallingSource
SaxResourceUtils


 org.springframework.oxm.xmlbeans
Classes
XmlBeansMarshaller
XmlOptionsFactoryBean


 org.springframework.oxm.xstream
Classes
XStreamMarshaller


 org.springframework.remoting
Exceptions
RemoteAccessException
RemoteConnectFailureException
RemoteInvocationFailureException
RemoteLookupFailureException
RemoteProxyFailureException


 org.springframework.remoting.caucho
Classes
BurlapClientInterceptor
BurlapExporter
BurlapProxyFactoryBean
BurlapServiceExporter
HessianClientInterceptor
HessianExporter
HessianProxyFactoryBean
HessianServiceExporter
SimpleBurlapServiceExporter
SimpleHessianServiceExporter


 org.springframework.remoting.httpinvoker
Interfaces
HttpInvokerClientConfiguration
HttpInvokerRequestExecutor
Classes
AbstractHttpInvokerRequestExecutor
CommonsHttpInvokerRequestExecutor
HttpInvokerClientInterceptor
HttpInvokerProxyFactoryBean
HttpInvokerServiceExporter
SimpleHttpInvokerRequestExecutor
SimpleHttpInvokerServiceExporter


 org.springframework.remoting.jaxrpc
Interfaces
JaxRpcServicePostProcessor
Classes
JaxRpcPortClientInterceptor
JaxRpcPortProxyFactoryBean
LocalJaxRpcServiceFactory
LocalJaxRpcServiceFactoryBean
ServletEndpointSupport
Exceptions
JaxRpcSoapFaultException


 org.springframework.remoting.jaxws
Classes
AbstractJaxWsServiceExporter
JaxWsPortClientInterceptor
JaxWsPortProxyFactoryBean
LocalJaxWsServiceFactory
LocalJaxWsServiceFactoryBean
SimpleHttpServerJaxWsServiceExporter
SimpleJaxWsServiceExporter
Exceptions
JaxWsSoapFaultException


 org.springframework.remoting.rmi
Interfaces
RmiInvocationHandler
Classes
CodebaseAwareObjectInputStream
JndiRmiClientInterceptor
JndiRmiProxyFactoryBean
JndiRmiServiceExporter
RemoteInvocationSerializingExporter
RmiBasedExporter
RmiClientInterceptor
RmiClientInterceptorUtils
RmiProxyFactoryBean
RmiRegistryFactoryBean
RmiServiceExporter


 org.springframework.remoting.soap
Exceptions
SoapFaultException


 org.springframework.remoting.support
Interfaces
RemoteInvocationExecutor
RemoteInvocationFactory
Classes
DefaultRemoteInvocationExecutor
DefaultRemoteInvocationFactory
RemoteAccessor
RemoteExporter
RemoteInvocation
RemoteInvocationBasedAccessor
RemoteInvocationBasedExporter
RemoteInvocationResult
RemoteInvocationTraceInterceptor
RemoteInvocationUtils
RemotingSupport
SimpleHttpServerFactoryBean
UrlBasedRemoteAccessor


 org.springframework.scheduling
Interfaces
SchedulingAwareRunnable
SchedulingTaskExecutor
TaskScheduler
Trigger
TriggerContext
Exceptions
SchedulingException


 org.springframework.scheduling.annotation
Classes
AsyncAnnotationAdvisor
AsyncAnnotationBeanPostProcessor
AsyncResult
ScheduledAnnotationBeanPostProcessor
Annotation Types
Async
Scheduled


 org.springframework.scheduling.backportconcurrent
Classes
ConcurrentTaskExecutor
CustomizableThreadFactory
ThreadPoolTaskExecutor


 org.springframework.scheduling.commonj
Classes
DelegatingTimerListener
DelegatingWork
ScheduledTimerListener
TimerManagerAccessor
TimerManagerFactoryBean
TimerManagerTaskScheduler
WorkManagerTaskExecutor


 org.springframework.scheduling.concurrent
Classes
ConcurrentTaskExecutor
ConcurrentTaskScheduler
CustomizableThreadFactory
ExecutorConfigurationSupport
ScheduledExecutorFactoryBean
ScheduledExecutorTask
ThreadPoolExecutorFactoryBean
ThreadPoolTaskExecutor
ThreadPoolTaskScheduler


 org.springframework.scheduling.config
Classes
AnnotationDrivenBeanDefinitionParser
ExecutorBeanDefinitionParser
ScheduledTaskRegistrar
ScheduledTasksBeanDefinitionParser
SchedulerBeanDefinitionParser
TaskExecutorFactoryBean
TaskNamespaceHandler


 org.springframework.scheduling.quartz
Interfaces
JobDetailAwareTrigger
SchedulerContextAware
Classes
AdaptableJobFactory
CronTriggerBean
DelegatingJob
JobDetailBean
LocalDataSourceJobStore
LocalTaskExecutorThreadPool
MethodInvokingJobDetailFactoryBean
MethodInvokingJobDetailFactoryBean.MethodInvokingJob
MethodInvokingJobDetailFactoryBean.StatefulMethodInvokingJob
QuartzJobBean
ResourceLoaderClassLoadHelper
SchedulerAccessor
SchedulerAccessorBean
SchedulerFactoryBean
SimpleThreadPoolTaskExecutor
SimpleTriggerBean
SpringBeanJobFactory
Exceptions
JobMethodInvocationFailedException


 org.springframework.scheduling.support
Classes
CronSequenceGenerator
CronTrigger
DelegatingErrorHandlingRunnable
MethodInvokingRunnable
PeriodicTrigger
SimpleTriggerContext
TaskUtils


 org.springframework.scheduling.timer
Classes
DelegatingTimerTask
MethodInvokingTimerTaskFactoryBean
ScheduledTimerTask
TimerFactoryBean
TimerTaskExecutor


 org.springframework.scripting
Interfaces
ScriptFactory
ScriptSource
Exceptions
ScriptCompilationException


 org.springframework.scripting.bsh
Classes
BshScriptFactory
BshScriptUtils
Exceptions
BshScriptUtils.BshExecutionException


 org.springframework.scripting.config
Classes
LangNamespaceHandler
LangNamespaceUtils
ScriptingDefaultsParser


 org.springframework.scripting.groovy
Interfaces
GroovyObjectCustomizer
Classes
GroovyScriptFactory


 org.springframework.scripting.jruby
Classes
JRubyScriptFactory
JRubyScriptUtils
Exceptions
JRubyScriptUtils.JRubyExecutionException


 org.springframework.scripting.support
Classes
RefreshableScriptTargetSource
ResourceScriptSource
ScriptFactoryPostProcessor
StaticScriptSource


 org.springframework.stereotype
Annotation Types
Component
Controller
Repository
Service


 org.springframework.test
Classes
AbstractDependencyInjectionSpringContextTests
AbstractSingleSpringContextTests
AbstractSpringContextTests
AbstractTransactionalDataSourceSpringContextTests
AbstractTransactionalSpringContextTests
AssertThrows
ConditionalTestCase


DirtiesContext.ClassMode

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

org.springframework.test.annotation
Enum DirtiesContext.ClassMode

java.lang.Object
    extended by  java.lang.Enum<DirtiesContext.ClassMode>
        extended by  org.springframework.test.annotation.DirtiesContext.ClassMode
All Implemented Interfaces:
Serializable, Comparable<DirtiesContext.ClassMode>
Enclosing class:
DirtiesContext
public static enum DirtiesContext.ClassMode
extends Enum<DirtiesContext.ClassMode>

Defines modes which determine how @DirtiesContext is interpreted when used to annotate a test class.

Enum Constant Summary
AFTER_CLASS
The associated ApplicationContext will be marked as dirty after the test class.
AFTER_EACH_TEST_METHOD
The associated ApplicationContext will be marked as dirty after each test method in the class.
Method Summary
static DirtiesContext.ClassMode | valueOf(String name) Returns the enum constant of this type with the specified name.
static DirtiesContext.ClassMode[] | values() Returns an array containing the constants of this enum type, in the order they are declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

AFTER_CLASS

public static final DirtiesContext.ClassMode AFTER_CLASS
The associated ApplicationContext will be marked as dirty after the test class.

AFTER_EACH_TEST_METHOD

public static final DirtiesContext.ClassMode AFTER_EACH_TEST_METHOD
The associated ApplicationContext will be marked as dirty after each test method in the class.

Method Detail

values

public static DirtiesContext.ClassMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (DirtiesContext.ClassMode c : DirtiesContext.ClassMode.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static DirtiesContext.ClassMode valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


 org.springframework.test.annotation
Interfaces
ProfileValueSource
Classes
AbstractAnnotationAwareTransactionalTests
ProfileValueUtils
SystemProfileValueSource
Enums
DirtiesContext.ClassMode
Annotation Types
DirtiesContext
ExpectedException
IfProfileValue
NotTransactional
ProfileValueSourceConfiguration
Repeat
Rollback
Timed


 org.springframework.test.context
Interfaces
ContextLoader
TestExecutionListener
Classes
TestContext
TestContextManager
Annotation Types
ContextConfiguration
TestExecutionListeners


 org.springframework.test.context.junit38
Classes
AbstractJUnit38SpringContextTests
AbstractTransactionalJUnit38SpringContextTests


 org.springframework.test.context.junit4
Classes
AbstractJUnit4SpringContextTests
AbstractTransactionalJUnit4SpringContextTests
SpringJUnit4ClassRunner


 org.springframework.test.context.junit4.statements
Classes
RunAfterTestClassCallbacks
RunAfterTestMethodCallbacks
RunBeforeTestClassCallbacks
RunBeforeTestMethodCallbacks
SpringFailOnTimeout
SpringRepeat


 org.springframework.test.context.support
Classes
AbstractContextLoader
AbstractGenericContextLoader
AbstractTestExecutionListener
DependencyInjectionTestExecutionListener
DirtiesContextTestExecutionListener
GenericPropertiesContextLoader
GenericXmlContextLoader


 org.springframework.test.context.testng
Classes
AbstractTestNGSpringContextTests
AbstractTransactionalTestNGSpringContextTests


 org.springframework.test.context.transaction
Classes
TransactionalTestExecutionListener
TransactionConfigurationAttributes
Annotation Types
AfterTransaction
BeforeTransaction
TransactionConfiguration


 org.springframework.test.jdbc
Classes
JdbcTestUtils
SimpleJdbcTestUtils


 org.springframework.test.jpa
Classes
AbstractAspectjJpaTests
AbstractJpaTests


 org.springframework.test.util
Classes
ReflectionTestUtils


 org.springframework.test.web
Classes
AbstractModelAndViewTests
ModelAndViewAssert


 org.springframework.transaction
Interfaces
PlatformTransactionManager
SavepointManager
TransactionDefinition
TransactionStatus
Exceptions
CannotCreateTransactionException
HeuristicCompletionException
IllegalTransactionStateException
InvalidIsolationLevelException
InvalidTimeoutException
NestedTransactionNotSupportedException
NoTransactionException
TransactionException
TransactionSuspensionNotSupportedException
TransactionSystemException
TransactionTimedOutException
TransactionUsageException
UnexpectedRollbackException


 org.springframework.transaction.annotation
Interfaces
TransactionAnnotationParser
Classes
AnnotationTransactionAttributeSource
Ejb3TransactionAnnotationParser
SpringTransactionAnnotationParser
Enums
Isolation
Propagation
Annotation Types
Transactional


 org.springframework.transaction.config
Classes
JtaTransactionManagerBeanDefinitionParser
TxNamespaceHandler


 org.springframework.transaction.interceptor
Interfaces
TransactionAttribute
TransactionAttributeSource
Classes
AbstractFallbackTransactionAttributeSource
BeanFactoryTransactionAttributeSourceAdvisor
CompositeTransactionAttributeSource
DefaultTransactionAttribute
DelegatingTransactionAttribute
MatchAlwaysTransactionAttributeSource
MethodMapTransactionAttributeSource
NameMatchTransactionAttributeSource
NoRollbackRuleAttribute
RollbackRuleAttribute
RuleBasedTransactionAttribute
TransactionAspectSupport
TransactionAspectUtils
TransactionAttributeEditor
TransactionAttributeSourceAdvisor
TransactionAttributeSourceEditor
TransactionInterceptor
TransactionProxyFactoryBean


 org.springframework.transaction.jta
Interfaces
TransactionFactory
Classes
JtaAfterCompletionSynchronization
JtaTransactionManager
JtaTransactionObject
ManagedTransactionAdapter
OC4JJtaTransactionManager
SimpleTransactionFactory
SpringJtaSynchronizationAdapter
UserTransactionAdapter
WebLogicJtaTransactionManager
WebSphereUowTransactionManager


 org.springframework.transaction.support
Interfaces
CallbackPreferringPlatformTransactionManager
ResourceHolder
ResourceTransactionManager
SmartTransactionObject
TransactionCallback
TransactionOperations
TransactionSynchronization
Classes
AbstractPlatformTransactionManager
AbstractPlatformTransactionManager.SuspendedResourcesHolder
AbstractTransactionStatus
DefaultTransactionDefinition
DefaultTransactionStatus
DelegatingTransactionDefinition
ResourceHolderSupport
ResourceHolderSynchronization
SimpleTransactionStatus
TransactionCallbackWithoutResult
TransactionSynchronizationAdapter
TransactionSynchronizationManager
TransactionSynchronizationUtils
TransactionTemplate


 org.springframework.ui
Interfaces
Model
Classes
ExtendedModelMap
ModelMap


 org.springframework.ui.context
Interfaces
HierarchicalThemeSource
Theme
ThemeSource


 org.springframework.ui.context.support
Classes
DelegatingThemeSource
ResourceBundleThemeSource
SimpleTheme
UiApplicationContextUtils


 org.springframework.ui.freemarker
Classes
FreeMarkerConfigurationFactory
FreeMarkerConfigurationFactoryBean
FreeMarkerTemplateUtils
SpringTemplateLoader


 org.springframework.ui.jasperreports
Classes
JasperReportsUtils


 org.springframework.ui.velocity
Classes
CommonsLoggingLogSystem
SpringResourceLoader
VelocityEngineFactory
VelocityEngineFactoryBean
VelocityEngineUtils


AutoPopulatingList.ElementFactory

org.springframework.util
Interface AutoPopulatingList.ElementFactory<E>

Enclosing class:
AutoPopulatingList<E>
public static interface AutoPopulatingList.ElementFactory<E>

Factory interface for creating elements for an index-based access data structure such as a List.

Method Summary
 E createElement(int index)
Create the element for the supplied index.

Method Detail

createElement

E createElement(int index)
                throws AutoPopulatingList.ElementInstantiationException
Create the element for the supplied index.

Returns:
the element object
Throws:
AutoPopulatingList.ElementInstantiationException - if the instantiation process failed (any exception thrown by a target constructor should be propagated as-is)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


 org.springframework.util
Interfaces
AutoPopulatingList.ElementFactory
ErrorHandler
MultiValueMap
PathMatcher
PropertiesPersister
PropertyPlaceholderHelper.PlaceholderResolver
ReflectionUtils.FieldCallback
ReflectionUtils.FieldFilter
ReflectionUtils.MethodCallback
ReflectionUtils.MethodFilter
StringValueResolver
WeakReferenceMonitor.ReleaseListener
Classes
AntPathMatcher
Assert
AutoPopulatingList
CachingMapDecorator
ClassUtils
CollectionUtils
CommonsLogWriter
CompositeIterator
ConcurrencyThrottleSupport
CustomizableThreadCreator
DefaultPropertiesPersister
DigestUtils
FileCopyUtils
FileSystemUtils
LinkedCaseInsensitiveMap
LinkedMultiValueMap
Log4jConfigurer
MethodInvoker
NumberUtils
ObjectUtils
PatternMatchUtils
PropertyPlaceholderHelper
ReflectionUtils
ResourceUtils
StopWatch
StopWatch.TaskInfo
StringUtils
SystemPropertyUtils
TypeUtils
WeakReferenceMonitor
Exceptions
AutoPopulatingList.ElementInstantiationException


 org.springframework.util.comparator
Classes
BooleanComparator
ComparableComparator
CompoundComparator
InvertibleComparator
NullSafeComparator


 org.springframework.util.xml
Classes
DomUtils
SimpleNamespaceContext
SimpleSaxErrorHandler
SimpleTransformErrorListener
StaxUtils
TransformerUtils
XmlValidationModeDetector


 org.springframework.validation
Interfaces
BindingErrorProcessor
BindingResult
Errors
MessageCodesResolver
Validator
Classes
AbstractBindingResult
AbstractErrors
AbstractPropertyBindingResult
BeanPropertyBindingResult
BindingResultUtils
DataBinder
DefaultBindingErrorProcessor
DefaultMessageCodesResolver
DirectFieldBindingResult
FieldError
MapBindingResult
ObjectError
ValidationUtils
Exceptions
BindException


 org.springframework.validation.beanvalidation
Classes
BeanValidationPostProcessor
CustomValidatorBean
LocaleContextMessageInterpolator
LocalValidatorFactoryBean
SpringConstraintValidatorFactory
SpringValidatorAdapter


 org.springframework.validation.support
Classes
BindingAwareModelMap


 org.springframework.web
Interfaces
HttpRequestHandler
Exceptions
HttpMediaTypeException
HttpMediaTypeNotAcceptableException
HttpMediaTypeNotSupportedException
HttpRequestMethodNotSupportedException
HttpSessionRequiredException


 org.springframework.web.bind
Classes
EscapedErrors
ServletRequestDataBinder
ServletRequestParameterPropertyValues
ServletRequestUtils
WebDataBinder
Exceptions
MissingServletRequestParameterException
ServletRequestBindingException
UnsatisfiedServletRequestParameterException


 org.springframework.web.bind.annotation
Interfaces
ValueConstants
Enums
RequestMethod
Annotation Types
CookieValue
ExceptionHandler
InitBinder
Mapping
ModelAttribute
PathVariable
RequestBody
RequestHeader
RequestMapping
RequestParam
ResponseBody
ResponseStatus
SessionAttributes


 org.springframework.web.bind.annotation.support
Classes
HandlerMethodInvoker
HandlerMethodResolver
Exceptions
HandlerMethodInvocationException


 org.springframework.web.bind.support
Interfaces
SessionAttributeStore
SessionStatus
WebArgumentResolver
WebBindingInitializer
Classes
ConfigurableWebBindingInitializer
DefaultSessionAttributeStore
SimpleSessionStatus
WebRequestDataBinder


 org.springframework.web.client
Interfaces
RequestCallback
ResponseErrorHandler
ResponseExtractor
RestOperations
Classes
DefaultResponseErrorHandler
HttpMessageConverterExtractor
RestTemplate
Exceptions
HttpClientErrorException
HttpServerErrorException
HttpStatusCodeException
ResourceAccessException
RestClientException


 org.springframework.web.client.support
Classes
RestGatewaySupport


 org.springframework.web.context
Interfaces
ConfigurableWebApplicationContext
ServletConfigAware
ServletContextAware
WebApplicationContext
Classes
ContextCleanupListener
ContextLoader
ContextLoaderListener


 org.springframework.web.context.request
Interfaces
NativeWebRequest
RequestAttributes
WebRequest
WebRequestInterceptor
Classes
AbstractRequestAttributes
AbstractRequestAttributesScope
DestructionCallbackBindingListener
FacesRequestAttributes
FacesWebRequest
Log4jNestedDiagnosticContextInterceptor
RequestContextHolder
RequestContextListener
RequestScope
ServletRequestAttributes
ServletWebRequest
SessionScope


 org.springframework.web.context.support
Classes
AbstractRefreshableWebApplicationContext
AnnotationConfigWebApplicationContext
ContextExposingHttpServletRequest
GenericWebApplicationContext
HttpRequestHandlerServlet
RequestHandledEvent
ServletContextAttributeExporter
ServletContextAttributeFactoryBean
ServletContextAwareProcessor
ServletContextFactoryBean
ServletContextParameterFactoryBean
ServletContextPropertyPlaceholderConfigurer
ServletContextResource
ServletContextResourceLoader
ServletContextResourcePatternResolver
ServletContextScope
ServletRequestHandledEvent
SpringBeanAutowiringSupport
StaticWebApplicationContext
WebApplicationContextUtils
WebApplicationObjectSupport
XmlWebApplicationContext


 org.springframework.web.filter
Classes
AbstractRequestLoggingFilter
CharacterEncodingFilter
CommonsRequestLoggingFilter
DelegatingFilterProxy
GenericFilterBean
HiddenHttpMethodFilter
Log4jNestedDiagnosticContextFilter
OncePerRequestFilter
RequestContextFilter
ServletContextRequestLoggingFilter
ShallowEtagHeaderFilter


 org.springframework.web.jsf
Classes
DecoratingNavigationHandler
DelegatingNavigationHandlerProxy
DelegatingPhaseListenerMulticaster
DelegatingVariableResolver
FacesContextUtils
SpringBeanVariableResolver
WebApplicationContextVariableResolver


 org.springframework.web.jsf.el
Classes
SpringBeanFacesELResolver
WebApplicationContextFacesELResolver


 org.springframework.web.multipart
Interfaces
MultipartFile
MultipartHttpServletRequest
MultipartRequest
MultipartResolver
Exceptions
MaxUploadSizeExceededException
MultipartException


 org.springframework.web.multipart.commons
Classes
CommonsFileUploadSupport
CommonsFileUploadSupport.MultipartParsingResult
CommonsMultipartFile
CommonsMultipartResolver


 org.springframework.web.multipart.support
Classes
AbstractMultipartHttpServletRequest
ByteArrayMultipartFileEditor
DefaultMultipartHttpServletRequest
MultipartFilter
StringMultipartFileEditor


 org.springframework.web.portlet
Interfaces
HandlerAdapter
HandlerExceptionResolver
HandlerInterceptor
HandlerMapping
Classes
DispatcherPortlet
FrameworkPortlet
GenericPortletBean
HandlerExecutionChain
ModelAndView
Exceptions
ModelAndViewDefiningException


 org.springframework.web.portlet.bind
Classes
PortletRequestDataBinder
PortletRequestParameterPropertyValues
PortletRequestUtils
Exceptions
MissingPortletRequestParameterException
PortletRequestBindingException


 org.springframework.web.portlet.bind.annotation
Annotation Types
ActionMapping
EventMapping
RenderMapping
ResourceMapping


 org.springframework.web.portlet.context
Interfaces
ConfigurablePortletApplicationContext
PortletConfigAware
PortletContextAware
Classes
AbstractRefreshablePortletApplicationContext
PortletApplicationContextUtils
PortletApplicationObjectSupport
PortletContextAwareProcessor
PortletContextResource
PortletContextResourceLoader
PortletContextResourcePatternResolver
PortletContextScope
PortletRequestAttributes
PortletRequestHandledEvent
PortletWebRequest
StaticPortletApplicationContext
XmlPortletApplicationContext


 org.springframework.web.portlet.handler
Interfaces
AbstractMapBasedHandlerMapping.PortletRequestMappingPredicate
Classes
AbstractHandlerExceptionResolver
AbstractHandlerMapping
AbstractMapBasedHandlerMapping
HandlerInterceptorAdapter
ParameterHandlerMapping
ParameterMappingInterceptor
PortletContentGenerator
PortletModeHandlerMapping
PortletModeParameterHandlerMapping
SimpleMappingExceptionResolver
SimplePortletHandlerAdapter
SimplePortletPostProcessor
UserRoleAuthorizationInterceptor
WebRequestHandlerInterceptorAdapter
Exceptions
PortletRequestMethodNotSupportedException
PortletSessionRequiredException


 org.springframework.web.portlet.multipart
Interfaces
MultipartActionRequest
PortletMultipartResolver
Classes
CommonsPortletMultipartResolver
DefaultMultipartActionRequest


 org.springframework.web.portlet.mvc
Interfaces
Controller
EventAwareController
ResourceAwareController
Classes
AbstractCommandController
AbstractController
AbstractFormController
AbstractWizardFormController
BaseCommandController
ParameterizableViewController
PortletModeNameViewController
PortletWrappingController
SimpleControllerHandlerAdapter
SimpleFormController


 org.springframework.web.portlet.mvc.annotation
Classes
AnnotationMethodHandlerAdapter
AnnotationMethodHandlerExceptionResolver
DefaultAnnotationHandlerMapping


 org.springframework.web.portlet.util
Classes
PortletUtils


 org.springframework.web.servlet
Interfaces
HandlerAdapter
HandlerExceptionResolver
HandlerInterceptor
HandlerMapping
LocaleResolver
RequestToViewNameTranslator
ThemeResolver
View
ViewResolver
Classes
DispatcherServlet
FrameworkServlet
HandlerExecutionChain
HttpServletBean
ModelAndView
ResourceServlet
ViewRendererServlet
Exceptions
ModelAndViewDefiningException


 org.springframework.web.servlet.config
Classes
MvcNamespaceHandler


 org.springframework.web.servlet.handler
Classes
AbstractDetectingUrlHandlerMapping
AbstractHandlerExceptionResolver
AbstractHandlerMapping
AbstractUrlHandlerMapping
BeanNameUrlHandlerMapping
ConversionServiceExposingInterceptor
DispatcherServletWebRequest
HandlerInterceptorAdapter
MappedInterceptor
SimpleMappingExceptionResolver
SimpleServletHandlerAdapter
SimpleServletPostProcessor
SimpleUrlHandlerMapping
UserRoleAuthorizationInterceptor
WebRequestHandlerInterceptorAdapter


 org.springframework.web.servlet.i18n
Classes
AbstractLocaleResolver
AcceptHeaderLocaleResolver
CookieLocaleResolver
FixedLocaleResolver
LocaleChangeInterceptor
SessionLocaleResolver


 org.springframework.web.servlet.mvc
Interfaces
Controller
LastModified
Classes
AbstractCommandController
AbstractController
AbstractFormController
AbstractUrlViewController
AbstractWizardFormController
BaseCommandController
CancellableFormController
HttpRequestHandlerAdapter
ParameterizableViewController
ServletForwardingController
ServletWrappingController
SimpleControllerHandlerAdapter
SimpleFormController
UrlFilenameViewController
WebContentInterceptor


 org.springframework.web.servlet.mvc.annotation
Interfaces
ModelAndViewResolver
Classes
AnnotationMethodHandlerAdapter
AnnotationMethodHandlerExceptionResolver
DefaultAnnotationHandlerMapping
ResponseStatusExceptionResolver


 org.springframework.web.servlet.mvc.multiaction
Interfaces
MethodNameResolver
Classes
AbstractUrlMethodNameResolver
InternalPathMethodNameResolver
MultiActionController
ParameterMethodNameResolver
PropertiesMethodNameResolver
Exceptions
NoSuchRequestHandlingMethodException


 org.springframework.web.servlet.mvc.support
Classes
AbstractControllerUrlHandlerMapping
ControllerBeanNameHandlerMapping
ControllerClassNameHandlerMapping
DefaultHandlerExceptionResolver


 org.springframework.web.servlet.support
Classes
BindStatus
JspAwareRequestContext
JstlUtils
RequestContext
RequestContextUtils
WebContentGenerator


 org.springframework.web.servlet.tags
Interfaces
EditorAwareTag
ParamAware
Classes
BindErrorsTag
BindTag
EscapeBodyTag
EvalTag
HtmlEscapeTag
HtmlEscapingAwareTag
MessageTag
NestedPathTag
Param
ParamTag
RequestContextAwareTag
ThemeTag
TransformTag
UrlTag


 org.springframework.web.servlet.tags.form
Classes
AbstractCheckedElementTag
AbstractDataBoundFormElementTag
AbstractFormTag
AbstractHtmlElementBodyTag
AbstractHtmlElementTag
AbstractHtmlInputElementTag
AbstractMultiCheckedElementTag
AbstractSingleCheckedElementTag
CheckboxesTag
CheckboxTag
ErrorsTag
FormTag
HiddenInputTag
InputTag
LabelTag
OptionsTag
OptionTag
PasswordInputTag
RadioButtonsTag
RadioButtonTag
SelectTag
TagWriter
TextareaTag


 org.springframework.web.servlet.theme
Classes
AbstractThemeResolver
CookieThemeResolver
FixedThemeResolver
SessionThemeResolver
ThemeChangeInterceptor


 org.springframework.web.servlet.view
Classes
AbstractCachingViewResolver
AbstractTemplateView
AbstractTemplateViewResolver
AbstractUrlBasedView
AbstractView
BeanNameViewResolver
ContentNegotiatingViewResolver
DefaultRequestToViewNameTranslator
InternalResourceView
InternalResourceViewResolver
JstlView
RedirectView
ResourceBundleViewResolver
UrlBasedViewResolver
XmlViewResolver


 org.springframework.web.servlet.view.document
Classes
AbstractExcelView
AbstractJExcelView
AbstractPdfStamperView
AbstractPdfView


 org.springframework.web.servlet.view.feed
Classes
AbstractAtomFeedView
AbstractFeedView
AbstractRssFeedView


 org.springframework.web.servlet.view.freemarker
Interfaces
FreeMarkerConfig
Classes
FreeMarkerConfigurer
FreeMarkerView
FreeMarkerViewResolver


 org.springframework.web.servlet.view.jasperreports
Classes
AbstractJasperReportsSingleFormatView
AbstractJasperReportsView
ConfigurableJasperReportsView
JasperReportsCsvView
JasperReportsHtmlView
JasperReportsMultiFormatView
JasperReportsPdfView
JasperReportsViewResolver
JasperReportsXlsView


 org.springframework.web.servlet.view.json
Classes
MappingJacksonJsonView


 org.springframework.web.servlet.view.tiles
Classes
ComponentControllerSupport
TilesConfigurer
TilesJstlView
TilesView


 org.springframework.web.servlet.view.tiles2
Classes
AbstractSpringPreparerFactory
SimpleSpringPreparerFactory
SpringBeanPreparerFactory
SpringLocaleResolver
SpringTilesApplicationContextFactory
TilesConfigurer
TilesView
TilesViewResolver


 org.springframework.web.servlet.view.velocity
Interfaces
VelocityConfig
Classes
VelocityConfigurer
VelocityLayoutView
VelocityLayoutViewResolver
VelocityToolboxView
VelocityView
VelocityViewResolver


 org.springframework.web.servlet.view.xml
Classes
MarshallingView


 org.springframework.web.servlet.view.xslt
Classes
AbstractXsltView
XsltView
XsltViewResolver


 org.springframework.web.struts
Classes
ActionSupport
AutowiringRequestProcessor
AutowiringTilesRequestProcessor
ContextLoaderPlugIn
DelegatingActionProxy
DelegatingActionUtils
DelegatingRequestProcessor
DelegatingTilesRequestProcessor
DispatchActionSupport
LookupDispatchActionSupport
MappingDispatchActionSupport
SpringBindingActionForm


 org.springframework.web.util
Classes
CookieGenerator
ExpressionEvaluationUtils
HtmlUtils
HttpSessionMutexListener
IntrospectorCleanupListener
JavaScriptUtils
Log4jConfigListener
Log4jWebConfigurer
TagUtils
UriTemplate
UriUtils
UrlPathHelper
WebAppRootListener
WebUtils
Exceptions
NestedServletException